From: support Date: Wed, 23 Nov 2022 08:39:36 +0000 (+0000) Subject: Built motion from commit 2a6dfb68.|2.6.23 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22%7B%7Blicense.mail?a=commitdiff_plain;h=9a172e2bdd084e0e9753f1d9d8e88774ca4c3497;p=motion2.git Built motion from commit 2a6dfb68.|2.6.23 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 3b089bb..9b67e12 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-22T12:08:41.046Z", + "time": "2022-11-23T08:31:00.805Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index e83c9d9..66f912e 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-22T12:08:41.046Z", + "time": "2022-11-23T08:31:00.805Z", "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 f8e4b9b..3258124 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 _0xe78a=['getDataValue','STRING','integration','motionbar','jscripty','urlForward','bot','script','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)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[body]','sequelize','exports','VIRTUAL'];(function(_0x18550a,_0xd97082){var _0x517dda=function(_0x4f8be9){while(--_0x4f8be9){_0x18550a['push'](_0x18550a['shift']());}};_0x517dda(++_0xd97082);}(_0xe78a,0x1d9));var _0xae78=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe78a[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xae78('0x0'));module[_0xae78('0x1')]={'name':{'type':Sequelize[_0xae78('0x2')],'get':function(_0x5e296f){return this[_0xae78('0x3')]('action');}},'action':{'type':Sequelize[_0xae78('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xae78('0x5'),_0xae78('0x6'),_0xae78('0x7'),_0xae78('0x8'),'browser',_0xae78('0x9'),_0xae78('0xa')]],'msg':_0xae78('0xb')}},'comment':_0xae78('0xb')},'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[_0xae78('0x4')](0x1000),'comment':_0xae78('0xc')},'data3':{'type':Sequelize[_0xae78('0x4')](0x1000),'comment':_0xae78('0xd')},'data4':{'type':Sequelize[_0xae78('0x4')](0x1000),'comments':_0xae78('0xe')},'data5':{'type':Sequelize[_0xae78('0x4')](0x1000),'comments':_0xae78('0xf')},'data6':{'type':Sequelize[_0xae78('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0xae78('0x10')}}; \ No newline at end of file +var _0xbf16=['urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x2c2b30,_0x48ed61){var _0x3b386a=function(_0x4f95ad){while(--_0x4f95ad){_0x2c2b30['push'](_0x2c2b30['shift']());}};_0x3b386a(++_0x48ed61);}(_0xbf16,0x73));var _0x6bf1=function(_0x24ae08,_0x299dee){_0x24ae08=_0x24ae08-0x0;var _0x18339c=_0xbf16[_0x24ae08];return _0x18339c;};'use strict';var Sequelize=require(_0x6bf1('0x0'));module[_0x6bf1('0x1')]={'name':{'type':Sequelize[_0x6bf1('0x2')],'get':function(_0x5525f6){return this[_0x6bf1('0x3')]('action');}},'action':{'type':Sequelize[_0x6bf1('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6bf1('0x5'),_0x6bf1('0x6'),_0x6bf1('0x7'),_0x6bf1('0x8'),'urlForward',_0x6bf1('0x9'),_0x6bf1('0xa'),_0x6bf1('0xb')]],'msg':_0x6bf1('0xc')}},'comment':_0x6bf1('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x6bf1('0xd')},'data2':{'type':Sequelize[_0x6bf1('0x4')](0x1000),'comment':_0x6bf1('0xe')},'data3':{'type':Sequelize[_0x6bf1('0x4')](0x1000),'comment':_0x6bf1('0xf')},'data4':{'type':Sequelize[_0x6bf1('0x4')](0x1000),'comments':_0x6bf1('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x6bf1('0x11')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x6bf1('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 0f0f76e..4c27122 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 _0x3fc5=['offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x28f1c6,_0x4b5cef){var _0x2e0870=function(_0x545d78){while(--_0x545d78){_0x28f1c6['push'](_0x28f1c6['shift']());}};_0x2e0870(++_0x4b5cef);}(_0x3fc5,0x13f));var _0x53fc=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3fc5[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x53fc('0x0'));var zipdir=require(_0x53fc('0x1'));var jsonpatch=require(_0x53fc('0x2'));var rp=require(_0x53fc('0x3'));var moment=require(_0x53fc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x53fc('0x5'));var util=require(_0x53fc('0x6'));var path=require(_0x53fc('0x7'));var sox=require(_0x53fc('0x8'));var csv=require(_0x53fc('0x9'));var ejs=require(_0x53fc('0xa'));var fs=require('fs');var fs_extra=require(_0x53fc('0xb'));var _=require(_0x53fc('0xc'));var squel=require(_0x53fc('0xd'));var crypto=require(_0x53fc('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x53fc('0xf'));var toCsv=require('to-csv');var querystring=require(_0x53fc('0x10'));var Papa=require(_0x53fc('0x11'));var Redis=require(_0x53fc('0x12'));var authService=require(_0x53fc('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x53fc('0x14'));var hardwareService=require(_0x53fc('0x15'));var logger=require(_0x53fc('0x16'))(_0x53fc('0x17'));var utils=require('../../config/utils');var config=require(_0x53fc('0x18'));var licenseUtil=require(_0x53fc('0x19'));var db=require(_0x53fc('0x1a'))['db'];function respondWithStatusCode(_0x436766,_0x3a82bd){_0x3a82bd=_0x3a82bd||0xcc;return function(_0x36994a){if(_0x36994a){return _0x436766[_0x53fc('0x1b')](_0x3a82bd);}return _0x436766[_0x53fc('0x1c')](_0x3a82bd)[_0x53fc('0x1d')]();};}function respondWithResult(_0x35a63f,_0xcc10b7){_0xcc10b7=_0xcc10b7||0xc8;return function(_0x172ae0){if(_0x172ae0){return _0x35a63f[_0x53fc('0x1c')](_0xcc10b7)[_0x53fc('0x1e')](_0x172ae0);}};}function respondWithFilteredResult(_0x215d6a,_0x4bfa1d){return function(_0x48fa7e){if(_0x48fa7e){var _0x16505e=typeof _0x4bfa1d[_0x53fc('0x1f')]==='undefined'&&typeof _0x4bfa1d[_0x53fc('0x20')]===_0x53fc('0x21');var _0x3d4658=_0x48fa7e[_0x53fc('0x22')];var _0x273e13=_0x16505e?0x0:_0x4bfa1d[_0x53fc('0x1f')];var _0x3f8e4c=_0x16505e?_0x48fa7e[_0x53fc('0x22')]:_0x4bfa1d[_0x53fc('0x1f')]+_0x4bfa1d[_0x53fc('0x20')];var _0x2f01ee;if(_0x3f8e4c>=_0x3d4658){_0x3f8e4c=_0x3d4658;_0x2f01ee=0xc8;}else{_0x2f01ee=0xce;}_0x215d6a[_0x53fc('0x1c')](_0x2f01ee);return _0x215d6a['set'](_0x53fc('0x23'),_0x273e13+'-'+_0x3f8e4c+'/'+_0x3d4658)[_0x53fc('0x1e')](_0x48fa7e);}return null;};}function patchUpdates(_0x1b4383){return function(_0x4ee205){try{jsonpatch['apply'](_0x4ee205,_0x1b4383,!![]);}catch(_0x171ccd){return BPromise[_0x53fc('0x24')](_0x171ccd);}return _0x4ee205[_0x53fc('0x25')]();};}function saveUpdates(_0x542b47,_0xacf7e){return function(_0x4edfbf){if(_0x4edfbf){return _0x4edfbf[_0x53fc('0x26')](_0x542b47)[_0x53fc('0x27')](function(_0x211089){return _0x211089;});}return null;};}function removeEntity(_0x17a9f8,_0x2a931b){return function(_0x1335c0){if(_0x1335c0){return _0x1335c0[_0x53fc('0x28')]()[_0x53fc('0x27')](function(){_0x17a9f8[_0x53fc('0x1c')](0xcc)[_0x53fc('0x1d')]();});}};}function handleEntityNotFound(_0x58b1f0,_0x1d1520){return function(_0xf0d2bb){if(!_0xf0d2bb){_0x58b1f0[_0x53fc('0x1b')](0x194);}return _0xf0d2bb;};}function handleError(_0x38ffa6,_0x37da23){_0x37da23=_0x37da23||0x1f4;return function(_0x190742){logger[_0x53fc('0x29')](_0x190742[_0x53fc('0x2a')]);if(_0x190742[_0x53fc('0x2b')]){delete _0x190742[_0x53fc('0x2b')];}_0x38ffa6[_0x53fc('0x1c')](_0x37da23)[_0x53fc('0x2c')](_0x190742);};}exports[_0x53fc('0x26')]=function(_0x426a9e,_0x2c2d31){if(_0x426a9e[_0x53fc('0x2d')]['id']){delete _0x426a9e[_0x53fc('0x2d')]['id'];}return db[_0x53fc('0x2e')][_0x53fc('0x2f')]({'where':{'id':_0x426a9e[_0x53fc('0x30')]['id']}})[_0x53fc('0x27')](handleEntityNotFound(_0x2c2d31,null))[_0x53fc('0x27')](saveUpdates(_0x426a9e[_0x53fc('0x2d')],null))['then'](respondWithResult(_0x2c2d31,null))['catch'](handleError(_0x2c2d31,null));};exports[_0x53fc('0x28')]=function(_0x34587e,_0x49f392){return db[_0x53fc('0x2e')][_0x53fc('0x2f')]({'where':{'id':_0x34587e[_0x53fc('0x30')]['id']}})[_0x53fc('0x27')](handleEntityNotFound(_0x49f392,null))[_0x53fc('0x27')](removeEntity(_0x49f392,null))[_0x53fc('0x31')](handleError(_0x49f392,null));}; \ No newline at end of file +var _0x2a68=['count','set','save','destroy','end','sendStatus','error','stack','name','send','body','find','params','then','catch','rimraf','fast-json-patch','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined'];(function(_0x53a625,_0xba388d){var _0x303cc0=function(_0x792727){while(--_0x792727){_0x53a625['push'](_0x53a625['shift']());}};_0x303cc0(++_0xba388d);}(_0x2a68,0x13c));var _0x82a6=function(_0xc66af2,_0x14f6d8){_0xc66af2=_0xc66af2-0x0;var _0x38d439=_0x2a68[_0xc66af2];return _0x38d439;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82a6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x82a6('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x82a6('0x2'));var path=require(_0x82a6('0x3'));var sox=require('sox');var csv=require(_0x82a6('0x4'));var ejs=require(_0x82a6('0x5'));var fs=require('fs');var fs_extra=require(_0x82a6('0x6'));var _=require(_0x82a6('0x7'));var squel=require(_0x82a6('0x8'));var crypto=require('crypto');var jsforce=require(_0x82a6('0x9'));var deskjs=require(_0x82a6('0xa'));var toCsv=require(_0x82a6('0x4'));var querystring=require(_0x82a6('0xb'));var Papa=require(_0x82a6('0xc'));var Redis=require(_0x82a6('0xd'));var authService=require(_0x82a6('0xe'));var qs=require(_0x82a6('0xf'));var as=require(_0x82a6('0x10'));var hardwareService=require(_0x82a6('0x11'));var logger=require('../../config/logger')(_0x82a6('0x12'));var utils=require(_0x82a6('0x13'));var config=require(_0x82a6('0x14'));var licenseUtil=require(_0x82a6('0x15'));var db=require(_0x82a6('0x16'))['db'];function respondWithStatusCode(_0x63bb7e,_0x547fdd){_0x547fdd=_0x547fdd||0xcc;return function(_0xa91f16){if(_0xa91f16){return _0x63bb7e['sendStatus'](_0x547fdd);}return _0x63bb7e[_0x82a6('0x17')](_0x547fdd)['end']();};}function respondWithResult(_0x42a959,_0x466786){_0x466786=_0x466786||0xc8;return function(_0x4dd6f4){if(_0x4dd6f4){return _0x42a959[_0x82a6('0x17')](_0x466786)[_0x82a6('0x18')](_0x4dd6f4);}};}function respondWithFilteredResult(_0x3a9fb7,_0xb8ddeb){return function(_0x9cfff7){if(_0x9cfff7){var _0x55e48d=typeof _0xb8ddeb[_0x82a6('0x19')]==='undefined'&&typeof _0xb8ddeb[_0x82a6('0x1a')]===_0x82a6('0x1b');var _0x4f809f=_0x9cfff7[_0x82a6('0x1c')];var _0x4f263a=_0x55e48d?0x0:_0xb8ddeb['offset'];var _0x55be56=_0x55e48d?_0x9cfff7[_0x82a6('0x1c')]:_0xb8ddeb['offset']+_0xb8ddeb['limit'];var _0x32c4ab;if(_0x55be56>=_0x4f809f){_0x55be56=_0x4f809f;_0x32c4ab=0xc8;}else{_0x32c4ab=0xce;}_0x3a9fb7['status'](_0x32c4ab);return _0x3a9fb7[_0x82a6('0x1d')]('Content-Range',_0x4f263a+'-'+_0x55be56+'/'+_0x4f809f)[_0x82a6('0x18')](_0x9cfff7);}return null;};}function patchUpdates(_0x1d8a6f){return function(_0x53011e){try{jsonpatch['apply'](_0x53011e,_0x1d8a6f,!![]);}catch(_0x5419f5){return BPromise['reject'](_0x5419f5);}return _0x53011e[_0x82a6('0x1e')]();};}function saveUpdates(_0x330e91,_0x4b1db1){return function(_0x15abfa){if(_0x15abfa){return _0x15abfa['update'](_0x330e91)['then'](function(_0x51c3e2){return _0x51c3e2;});}return null;};}function removeEntity(_0x1e3934,_0x58080c){return function(_0x171320){if(_0x171320){return _0x171320[_0x82a6('0x1f')]()['then'](function(){_0x1e3934[_0x82a6('0x17')](0xcc)[_0x82a6('0x20')]();});}};}function handleEntityNotFound(_0x29d2e9,_0x3ff6fb){return function(_0x2feee4){if(!_0x2feee4){_0x29d2e9[_0x82a6('0x21')](0x194);}return _0x2feee4;};}function handleError(_0x182937,_0x103440){_0x103440=_0x103440||0x1f4;return function(_0x1083c4){logger[_0x82a6('0x22')](_0x1083c4[_0x82a6('0x23')]);if(_0x1083c4[_0x82a6('0x24')]){delete _0x1083c4['name'];}_0x182937[_0x82a6('0x17')](_0x103440)[_0x82a6('0x25')](_0x1083c4);};}exports['update']=function(_0x4b206c,_0x1a2080){if(_0x4b206c[_0x82a6('0x26')]['id']){delete _0x4b206c[_0x82a6('0x26')]['id'];}return db['Action'][_0x82a6('0x27')]({'where':{'id':_0x4b206c[_0x82a6('0x28')]['id']}})[_0x82a6('0x29')](handleEntityNotFound(_0x1a2080,null))[_0x82a6('0x29')](saveUpdates(_0x4b206c[_0x82a6('0x26')],null))[_0x82a6('0x29')](respondWithResult(_0x1a2080,null))[_0x82a6('0x2a')](handleError(_0x1a2080,null));};exports[_0x82a6('0x1f')]=function(_0x373341,_0x2e88ec){return db['Action']['find']({'where':{'id':_0x373341[_0x82a6('0x28')]['id']}})['then'](handleEntityNotFound(_0x2e88ec,null))[_0x82a6('0x29')](removeEntity(_0x2e88ec,null))[_0x82a6('0x2a')](handleError(_0x2e88ec,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index edc1c61..cbb4449 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 _0xe1fe=['moment','bluebird','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','api'];(function(_0x38e953,_0x1003a5){var _0x55b726=function(_0x3ea840){while(--_0x3ea840){_0x38e953['push'](_0x38e953['shift']());}};_0x55b726(++_0x1003a5);}(_0xe1fe,0x1c3));var _0xee1f=function(_0x28128f,_0x3ab1d5){_0x28128f=_0x28128f-0x0;var _0x3543ae=_0xe1fe[_0x28128f];return _0x3543ae;};'use strict';var _=require(_0xee1f('0x0'));var util=require(_0xee1f('0x1'));var logger=require(_0xee1f('0x2'))(_0xee1f('0x3'));var moment=require(_0xee1f('0x4'));var BPromise=require(_0xee1f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xee1f('0x6'));var config=require(_0xee1f('0x7'));var attributes=require(_0xee1f('0x8'));module[_0xee1f('0x9')]=function(_0x27cec4,_0x13f2d9){return _0x27cec4[_0xee1f('0xa')](_0xee1f('0xb'),attributes,{'tableName':_0xee1f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f33=['request-promise','../../config/environment','exports','define','tools_actions','lodash','util','../../config/logger','bluebird'];(function(_0xc20f22,_0x49698f){var _0x1535d5=function(_0x5ce3f3){while(--_0x5ce3f3){_0xc20f22['push'](_0xc20f22['shift']());}};_0x1535d5(++_0x49698f);}(_0x6f33,0x7a));var _0x36f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f33[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x36f3('0x0'));var util=require(_0x36f3('0x1'));var logger=require(_0x36f3('0x2'))('api');var moment=require('moment');var BPromise=require(_0x36f3('0x3'));var rp=require(_0x36f3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x36f3('0x5'));var attributes=require('./action.attributes');module[_0x36f3('0x6')]=function(_0x54b611,_0x5c12f6){return _0x54b611[_0x36f3('0x7')]('Action',attributes,{'tableName':_0x36f3('0x8'),'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 9eba9b8..58303fb 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x4b5fd7,_0xe85d64){var _0x1997df=function(_0x2798b6){while(--_0x2798b6){_0x4b5fd7['push'](_0x4b5fd7['shift']());}};_0x1997df(++_0xe85d64);}(_0xe14b,0x93));var _0xbe14=function(_0x372bff,_0x2bb900){_0x372bff=_0x372bff-0x0;var _0x25b72b=_0xe14b[_0x372bff];return _0x25b72b;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x358b92,_0x2d671a){var _0x58f1a5=function(_0xc03bac){while(--_0xc03bac){_0x358b92['push'](_0x358b92['shift']());}};_0x58f1a5(++_0x2d671a);}(_0xe14b,0x93));var _0xbe14=function(_0x3dc439,_0x7d1ec8){_0x3dc439=_0x3dc439-0x0;var _0x3405cf=_0xe14b[_0x3dc439];return _0x3405cf;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index ebfcdfe..ca58b3f 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 _0x6a63=['./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x540201,_0x2a7c63){var _0x28edbc=function(_0x1c2178){while(--_0x1c2178){_0x540201['push'](_0x540201['shift']());}};_0x28edbc(++_0x2a7c63);}(_0x6a63,0x86));var _0x36a6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6a63[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x36a6('0x0'));var path=require(_0x36a6('0x1'));var timeout=require(_0x36a6('0x2'));var express=require('express');var router=express[_0x36a6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x36a6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x36a6('0x5'));var controller=require(_0x36a6('0x6'));router[_0x36a6('0x7')](_0x36a6('0x8'),auth[_0x36a6('0x9')](),controller[_0x36a6('0xa')]);router[_0x36a6('0xb')]('/:id',auth[_0x36a6('0x9')](),controller[_0x36a6('0xc')]);module[_0x36a6('0xd')]=router; \ No newline at end of file +var _0x1c23=['delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1c23,0x110));var _0x31c2=function(_0x3dc292,_0x5d0d37){_0x3dc292=_0x3dc292-0x0;var _0xbbe021=_0x1c23[_0x3dc292];return _0xbbe021;};'use strict';var multer=require(_0x31c2('0x0'));var util=require('util');var path=require(_0x31c2('0x1'));var timeout=require(_0x31c2('0x2'));var express=require(_0x31c2('0x3'));var router=express[_0x31c2('0x4')]();var fs_extra=require(_0x31c2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x31c2('0x6'));var config=require(_0x31c2('0x7'));var controller=require(_0x31c2('0x8'));router[_0x31c2('0x9')](_0x31c2('0xa'),auth[_0x31c2('0xb')](),controller[_0x31c2('0xc')]);router[_0x31c2('0xd')]('/:id',auth[_0x31c2('0xb')](),controller['destroy']);module[_0x31c2('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 5f079ca..d4da8fd 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 _0x7217=['sequelize','STRING','TEXT'];(function(_0x3922,_0x4eea26){var _0x54f26f=function(_0x1ce396){while(--_0x1ce396){_0x3922['push'](_0x3922['shift']());}};_0x54f26f(++_0x4eea26);}(_0x7217,0x19e));var _0x7721=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x7217[_0x21aec3];return _0x288bbc;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x2f3b14,_0x554f94){var _0x20e924=function(_0x3f4c1c){while(--_0x3f4c1c){_0x2f3b14['push'](_0x2f3b14['shift']());}};_0x20e924(++_0x554f94);}(_0x5075,0x73));var _0x5507=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x5075[_0x35da42];return _0x370035;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index ce30fc8..a684b3c 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 _0x64e6=['fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','AnalyticCustomReport','includeAll','findAll','rows','catch','show','intersection','include','find','create','user','Reports','autoAssociation','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%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)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','join','COUNT(DISTINCT\x20%s)','DATE(%s)','IS\x20EMPTY','condition','from','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../files/reports','savename','COUNT(*)','QueryTypes','SELECT','run','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes'];(function(_0x488820,_0x18e13a){var _0x4f0366=function(_0x4fda9e){while(--_0x4fda9e){_0x488820['push'](_0x488820['shift']());}};_0x4f0366(++_0x18e13a);}(_0x64e6,0x1b2));var _0x664e=function(_0x288b5a,_0x337e71){_0x288b5a=_0x288b5a-0x0;var _0x1f5241=_0x64e6[_0x288b5a];return _0x1f5241;};'use strict';var emlformat=require(_0x664e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x664e('0x1'));var jsonpatch=require(_0x664e('0x2'));var rp=require(_0x664e('0x3'));var moment=require(_0x664e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x664e('0x5'));var path=require('path');var sox=require(_0x664e('0x6'));var csv=require(_0x664e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x664e('0x8'));var _=require(_0x664e('0x9'));var squel=require(_0x664e('0xa'));var crypto=require('crypto');var jsforce=require(_0x664e('0xb'));var deskjs=require(_0x664e('0xc'));var toCsv=require(_0x664e('0x7'));var querystring=require(_0x664e('0xd'));var Papa=require(_0x664e('0xe'));var Redis=require(_0x664e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x664e('0x10'));var as=require(_0x664e('0x11'));var hardwareService=require(_0x664e('0x12'));var logger=require(_0x664e('0x13'))(_0x664e('0x14'));var utils=require('../../config/utils');var config=require(_0x664e('0x15'));var licenseUtil=require(_0x664e('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0x664e('0x17'))['dbH'];function respondWithStatusCode(_0x14671b,_0x32d217){_0x32d217=_0x32d217||0xcc;return function(_0x575407){if(_0x575407){return _0x14671b['sendStatus'](_0x32d217);}return _0x14671b[_0x664e('0x18')](_0x32d217)[_0x664e('0x19')]();};}function respondWithResult(_0x48df4e,_0x34ef62){_0x34ef62=_0x34ef62||0xc8;return function(_0x3f2fb5){if(_0x3f2fb5){return _0x48df4e[_0x664e('0x18')](_0x34ef62)[_0x664e('0x1a')](_0x3f2fb5);}};}function respondWithFilteredResult(_0x2a967f,_0x4e9a56){return function(_0xb1da9e){if(_0xb1da9e){var _0x47c019=typeof _0x4e9a56[_0x664e('0x1b')]==='undefined'&&typeof _0x4e9a56[_0x664e('0x1c')]==='undefined';var _0x677349=_0xb1da9e[_0x664e('0x1d')];var _0x5c783d=_0x47c019?0x0:_0x4e9a56[_0x664e('0x1b')];var _0x39e9f0=_0x47c019?_0xb1da9e[_0x664e('0x1d')]:_0x4e9a56['offset']+_0x4e9a56[_0x664e('0x1c')];var _0x49b444;if(_0x39e9f0>=_0x677349){_0x39e9f0=_0x677349;_0x49b444=0xc8;}else{_0x49b444=0xce;}_0x2a967f[_0x664e('0x18')](_0x49b444);return _0x2a967f[_0x664e('0x1e')](_0x664e('0x1f'),_0x5c783d+'-'+_0x39e9f0+'/'+_0x677349)['json'](_0xb1da9e);}return null;};}function patchUpdates(_0x593be0){return function(_0x364641){try{jsonpatch['apply'](_0x364641,_0x593be0,!![]);}catch(_0x149490){return BPromise[_0x664e('0x20')](_0x149490);}return _0x364641[_0x664e('0x21')]();};}function saveUpdates(_0x3fbc90,_0x5f36e4){return function(_0x4fdc8f){if(_0x4fdc8f){return _0x4fdc8f[_0x664e('0x22')](_0x3fbc90)[_0x664e('0x23')](function(_0x14f7f5){return _0x14f7f5;});}return null;};}function removeEntity(_0x351336,_0x1f7801){return function(_0x51cbd2){if(_0x51cbd2){return _0x51cbd2[_0x664e('0x24')]()[_0x664e('0x23')](function(){var _0x393212=_0x51cbd2[_0x664e('0x25')]({'plain':!![]});var _0x7e3679='CustomReports';return db[_0x664e('0x26')][_0x664e('0x24')]({'where':{'type':_0x7e3679,'resourceId':_0x393212['id']}})['then'](function(){return _0x51cbd2;});})[_0x664e('0x23')](function(){_0x351336[_0x664e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6ae86e,_0x12f3f6){return function(_0x460af4){if(!_0x460af4){_0x6ae86e['sendStatus'](0x194);}return _0x460af4;};}function handleError(_0x35220f,_0x54f4a1){_0x54f4a1=_0x54f4a1||0x1f4;return function(_0x5b5371){logger['error'](_0x5b5371[_0x664e('0x27')]);if(_0x5b5371[_0x664e('0x28')]){delete _0x5b5371[_0x664e('0x28')];}_0x35220f[_0x664e('0x18')](_0x54f4a1)[_0x664e('0x29')](_0x5b5371);};}exports[_0x664e('0x2a')]=function(_0x3cbaf6,_0x4d9612){var _0x5d6639={},_0x17944f={},_0x180085={'count':0x0,'rows':[]};var _0x5f82f3=_[_0x664e('0x2b')](db['AnalyticCustomReport'][_0x664e('0x2c')],function(_0x22b618){return{'name':_0x22b618[_0x664e('0x2d')],'type':_0x22b618[_0x664e('0x2e')]['key']};});_0x17944f[_0x664e('0x2f')]=_[_0x664e('0x2b')](_0x5f82f3,_0x664e('0x28'));_0x17944f[_0x664e('0x30')]=_[_0x664e('0x31')](_0x3cbaf6[_0x664e('0x30')]);_0x17944f[_0x664e('0x32')]=_['intersection'](_0x17944f[_0x664e('0x2f')],_0x17944f[_0x664e('0x30')]);_0x5d6639[_0x664e('0x33')]=_['intersection'](_0x17944f[_0x664e('0x2f')],qs[_0x664e('0x34')](_0x3cbaf6['query'][_0x664e('0x34')]));_0x5d6639[_0x664e('0x33')]=_0x5d6639['attributes'][_0x664e('0x35')]?_0x5d6639[_0x664e('0x33')]:_0x17944f['model'];if(!_0x3cbaf6[_0x664e('0x30')][_0x664e('0x36')]('nolimit')){_0x5d6639['limit']=qs[_0x664e('0x1c')](_0x3cbaf6[_0x664e('0x30')][_0x664e('0x1c')]);_0x5d6639[_0x664e('0x1b')]=qs[_0x664e('0x1b')](_0x3cbaf6['query'][_0x664e('0x1b')]);}_0x5d6639[_0x664e('0x37')]=qs[_0x664e('0x38')](_0x3cbaf6[_0x664e('0x30')][_0x664e('0x38')]);_0x5d6639[_0x664e('0x39')]=qs[_0x664e('0x32')](_[_0x664e('0x3a')](_0x3cbaf6['query'],_0x17944f[_0x664e('0x32')]),_0x5f82f3);if(_0x3cbaf6[_0x664e('0x30')][_0x664e('0x3b')]){_0x5d6639['where']=_['merge'](_0x5d6639[_0x664e('0x39')],{'$or':_[_0x664e('0x2b')](_0x5f82f3,function(_0x1b5528){if(_0x1b5528['type']!==_0x664e('0x3c')){var _0x2de92e={};_0x2de92e[_0x1b5528[_0x664e('0x28')]]={'$like':'%'+_0x3cbaf6['query'][_0x664e('0x3b')]+'%'};return _0x2de92e;}})});}_0x5d6639=_[_0x664e('0x3d')]({},_0x5d6639,_0x3cbaf6[_0x664e('0x3e')]);var _0x79b8a4={'where':_0x5d6639[_0x664e('0x39')]};return db[_0x664e('0x3f')][_0x664e('0x1d')](_0x79b8a4)[_0x664e('0x23')](function(_0x42f1db){_0x180085['count']=_0x42f1db;if(_0x3cbaf6[_0x664e('0x30')][_0x664e('0x40')]){_0x5d6639['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x664e('0x41')](_0x5d6639);})[_0x664e('0x23')](function(_0xc10e25){_0x180085[_0x664e('0x42')]=_0xc10e25;return _0x180085;})[_0x664e('0x23')](respondWithFilteredResult(_0x4d9612,_0x5d6639))[_0x664e('0x43')](handleError(_0x4d9612,null));};exports[_0x664e('0x44')]=function(_0x427624,_0x4fe9bd){var _0x237f89={'raw':![],'where':{'id':_0x427624['params']['id']}},_0xfa8fd9={};_0xfa8fd9['model']=_[_0x664e('0x31')](db[_0x664e('0x3f')][_0x664e('0x2c')]);_0xfa8fd9[_0x664e('0x30')]=_['keys'](_0x427624['query']);_0xfa8fd9[_0x664e('0x32')]=_[_0x664e('0x45')](_0xfa8fd9['model'],_0xfa8fd9[_0x664e('0x30')]);_0x237f89[_0x664e('0x33')]=_['intersection'](_0xfa8fd9[_0x664e('0x2f')],qs[_0x664e('0x34')](_0x427624['query'][_0x664e('0x34')]));_0x237f89[_0x664e('0x33')]=_0x237f89[_0x664e('0x33')][_0x664e('0x35')]?_0x237f89['attributes']:_0xfa8fd9[_0x664e('0x2f')];if(_0x427624[_0x664e('0x30')][_0x664e('0x40')]){_0x237f89[_0x664e('0x46')]=[{'all':!![]}];}_0x237f89=_[_0x664e('0x3d')]({},_0x237f89,_0x427624['options']);return db[_0x664e('0x3f')][_0x664e('0x47')](_0x237f89)[_0x664e('0x23')](handleEntityNotFound(_0x4fe9bd,null))['then'](respondWithResult(_0x4fe9bd,null))[_0x664e('0x43')](handleError(_0x4fe9bd,null));};exports[_0x664e('0x48')]=function(_0x1f3e89,_0x42fb4e){return db[_0x664e('0x3f')][_0x664e('0x48')](_0x1f3e89['body'],{})[_0x664e('0x23')](function(_0x42bd7f){var _0x43a54f=_0x1f3e89[_0x664e('0x49')][_0x664e('0x25')]({'plain':!![]});if(!_0x43a54f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x43a54f['role']===_0x664e('0x49')){var _0x28f8c9=_0x42bd7f[_0x664e('0x25')]({'plain':!![]});var _0x4b8a76=_0x664e('0x4a');return db['UserProfileSection'][_0x664e('0x47')]({'where':{'name':_0x4b8a76,'userProfileId':_0x43a54f['userProfileId']},'raw':!![]})['then'](function(_0x52ec36){if(_0x52ec36&&_0x52ec36[_0x664e('0x4b')]===0x0){return db[_0x664e('0x26')]['create']({'name':_0x28f8c9[_0x664e('0x28')],'resourceId':_0x28f8c9['id'],'type':_0x664e('0x4c'),'sectionId':_0x52ec36['id']},{})[_0x664e('0x23')](function(){return _0x42bd7f;});}else{return _0x42bd7f;}})['catch'](function(_0x44509d){logger[_0x664e('0x4d')](_0x664e('0x4e'),_0x44509d);throw _0x44509d;});}return _0x42bd7f;})[_0x664e('0x23')](respondWithResult(_0x42fb4e,0xc9))[_0x664e('0x43')](handleError(_0x42fb4e,null));};exports[_0x664e('0x22')]=function(_0x187881,_0x37f122){if(_0x187881[_0x664e('0x4f')]['id']){delete _0x187881[_0x664e('0x4f')]['id'];}return db[_0x664e('0x3f')][_0x664e('0x47')]({'where':{'id':_0x187881['params']['id']}})['then'](handleEntityNotFound(_0x37f122,null))[_0x664e('0x23')](saveUpdates(_0x187881[_0x664e('0x4f')],null))[_0x664e('0x23')](respondWithResult(_0x37f122,null))['catch'](handleError(_0x37f122,null));};exports[_0x664e('0x24')]=function(_0x2cccdb,_0x17645d){return db[_0x664e('0x3f')][_0x664e('0x47')]({'where':{'id':_0x2cccdb[_0x664e('0x50')]['id']}})[_0x664e('0x23')](handleEntityNotFound(_0x17645d,null))['then'](removeEntity(_0x17645d,null))[_0x664e('0x43')](handleError(_0x17645d,null));};exports[_0x664e('0x51')]=function(_0x38f326,_0x141a6f){var _0xe81685=0xa;var _0x6d16ad=['join',_0x664e('0x52'),_0x664e('0x53'),_0x664e('0x54')];var _0x4ebbd5={'SUM':_0x664e('0x55'),'COUNT':_0x664e('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x664e('0x57'),'MIN':_0x664e('0x58'),'AVG':_0x664e('0x59'),'GROUP_CONCAT':_0x664e('0x5a'),'GROUP_CONCAT ASC':_0x664e('0x5b'),'GROUP_CONCAT DESC':_0x664e('0x5c')};var _0x5a4e02={'SEC_TO_TIME':_0x664e('0x5d'),'DATE':'DATE(%s)','HOUR':_0x664e('0x5e'),'ROUND':_0x664e('0x5f'),'UNIX_TIMESTAMP':_0x664e('0x60')};var _0xe02cc9=function(_0x16a651){return!_[_0x664e('0x61')]([_0x664e('0x62'),_0x664e('0x63'),'IS\x20EMPTY',_0x664e('0x64')],_0x16a651);};var _0x348131=function(_0x3fed0c){if(!_0x3fed0c||!_0x3fed0c[_0x664e('0x65')][_0x664e('0x35')]){return'';}for(var _0x38158f='(',_0x276d02=0x0;_0x276d02<_0x3fed0c['rules'][_0x664e('0x35')];_0x276d02+=0x1){_0x276d02>0x0&&(_0x38158f+='\x20'+_0x3fed0c[_0x664e('0x66')]+'\x20');_0x38158f+=_0x3fed0c['rules'][_0x276d02][_0x664e('0x67')]?_0x348131(_0x3fed0c[_0x664e('0x65')][_0x276d02][_0x664e('0x67')]):_0x3fed0c[_0x664e('0x65')][_0x276d02][_0x664e('0x68')]+'\x20'+_0x3fed0c[_0x664e('0x65')][_0x276d02]['condition']+(_0xe02cc9(_0x3fed0c[_0x664e('0x65')][_0x276d02]['condition'])?'\x20'+_0x3fed0c[_0x664e('0x65')][_0x276d02][_0x664e('0x69')]:'');}return _0x38158f+')';};var _0xf7b09f={'where':{'id':_0x38f326[_0x664e('0x50')]['id']}},_0x261fb7,_0x2fb2ac,_0x4cc9a3,_0x1a57f0,_0x26f561;_0xf7b09f=_[_0x664e('0x3d')]({},_0xf7b09f,_0x38f326['options']);return db[_0x664e('0x3f')][_0x664e('0x47')](_0xf7b09f)[_0x664e('0x23')](function(_0xcbb404){if(_0xcbb404){_0x261fb7=_0xcbb404;return _0xcbb404[_0x664e('0x6a')]();}return null;})[_0x664e('0x23')](function(_0x15a698){if(_0x15a698){if(!_0x15a698['length']){throw new db[(_0x664e('0x6b'))][(_0x664e('0x6c'))](_0x664e('0x6d'),0x193);}_0x2fb2ac=_0x15a698;return db[_0x664e('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x664e('0x23')](function(_0x8bb879){if(_0x8bb879){_0x4cc9a3=_[_0x664e('0x6f')](_0x8bb879,'id');var _0x3c9fe2;var _0x224930=squel[_0x664e('0x70')]();_0x224930['from'](_0x261fb7[_0x664e('0x71')]);for(var _0x248d23=0x0;_0x248d23<_0x2fb2ac[_0x664e('0x35')];_0x248d23+=0x1){_0x3c9fe2=_0x2fb2ac[_0x248d23][_0x664e('0x72')]?_0x4cc9a3[_0x2fb2ac[_0x248d23][_0x664e('0x72')]][_0x664e('0x73')]:_0x2fb2ac[_0x248d23][_0x664e('0x68')];_0x3c9fe2=_0x2fb2ac[_0x248d23][_0x664e('0x74')]?_['replace'](_0x4ebbd5[_0x2fb2ac[_0x248d23][_0x664e('0x74')]],'%s',_0x3c9fe2):_0x3c9fe2;_0x3c9fe2=_0x2fb2ac[_0x248d23][_0x664e('0x75')]?_[_0x664e('0x76')](_0x5a4e02[_0x2fb2ac[_0x248d23][_0x664e('0x75')]],'%s',_0x3c9fe2):_0x3c9fe2;if(_0x2fb2ac[_0x248d23][_0x664e('0x77')]){_0x224930[_0x664e('0x67')](_0x3c9fe2);}_0x2fb2ac[_0x248d23][_0x664e('0x78')]&&_0x224930[_0x664e('0x37')](_0x3c9fe2,_0x2fb2ac[_0x248d23]['orderBy']===_0x664e('0x79')?![]:!![]);_0x224930[_0x664e('0x68')](_0x3c9fe2,_0x2fb2ac[_0x248d23][_0x664e('0x7a')]||_0x3c9fe2);}if(_0x261fb7[_0x664e('0x7b')]){_0x261fb7[_0x664e('0x7b')]=JSON[_0x664e('0x7c')](_0x261fb7[_0x664e('0x7b')]);for(var _0x53b1a5=0x0;_0x53b1a5<_0x261fb7[_0x664e('0x7b')]['length'];_0x53b1a5+=0x1){if(_0x261fb7[_0x664e('0x7b')][_0x53b1a5][_0x664e('0x2e')]&&_['includes'](_0x6d16ad,_0x261fb7[_0x664e('0x7b')][_0x53b1a5][_0x664e('0x2e')])&&_0x261fb7['joins'][_0x53b1a5][_0x664e('0x7d')]&&_0x261fb7[_0x664e('0x7b')][_0x53b1a5][_0x664e('0x7e')]&&_0x261fb7[_0x664e('0x7b')][_0x53b1a5][_0x664e('0x7f')]){_0x224930[_0x261fb7[_0x664e('0x7b')][_0x53b1a5][_0x664e('0x2e')]](_0x261fb7[_0x664e('0x7b')][_0x53b1a5]['foreignTable'],null,util[_0x664e('0x75')](_0x664e('0x80'),_0x261fb7[_0x664e('0x71')],_0x261fb7['joins'][_0x53b1a5][_0x664e('0x7d')],_0x261fb7[_0x664e('0x7b')][_0x53b1a5][_0x664e('0x7e')],_0x261fb7[_0x664e('0x7b')][_0x53b1a5][_0x664e('0x7f')]));}}}if(_0x261fb7[_0x664e('0x81')]){_0x261fb7[_0x664e('0x81')]=JSON[_0x664e('0x7c')](_0x261fb7[_0x664e('0x81')]);_0x224930[_0x664e('0x39')](_0x348131(_0x261fb7['conditions']['group']));}_0x26f561=_0x224930[_0x664e('0x82')]();_0x224930[_0x664e('0x1c')](_0xe81685);_0x224930[_0x664e('0x1b')](0x0);logger[_0x664e('0x83')](_0x664e('0x84'),_0x224930[_0x664e('0x85')]());return dbH[_0x664e('0x86')][_0x664e('0x30')](_0x224930[_0x664e('0x85')](),{'type':dbH['sequelize']['QueryTypes']['SELECT']});}})[_0x664e('0x23')](respondWithResult(_0x141a6f,null))[_0x664e('0x43')](handleError(_0x141a6f,null));};function runReport(_0x240636,_0x33a256,_0x4d1e1c){var _0x594087=_0x33a256[_0x664e('0x28')];var _0xf293f2=0xa;var _0x36f1b5=[_0x664e('0x87'),'left_join',_0x664e('0x53'),_0x664e('0x54')];var _0x49f452={'SUM':'SUM(%s)','COUNT':_0x664e('0x56'),'COUNT DISTINCT':_0x664e('0x88'),'MAX':_0x664e('0x57'),'MIN':_0x664e('0x58'),'AVG':_0x664e('0x59'),'GROUP_CONCAT':_0x664e('0x5a'),'GROUP_CONCAT ASC':_0x664e('0x5b'),'GROUP_CONCAT DESC':_0x664e('0x5c')};var _0x21ef4d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x664e('0x89'),'HOUR':_0x664e('0x5e'),'ROUND':_0x664e('0x5f'),'UNIX_TIMESTAMP':_0x664e('0x60')};var _0x3f1eef=function(_0x4d2c2c){return!_['includes']([_0x664e('0x62'),_0x664e('0x63'),_0x664e('0x8a'),_0x664e('0x64')],_0x4d2c2c);};var _0x103b2b=function(_0x3083e8){if(!_0x3083e8||!_0x3083e8[_0x664e('0x65')][_0x664e('0x35')]){return'';}for(var _0x54b8d1='(',_0x3e26c8=0x0;_0x3e26c8<_0x3083e8[_0x664e('0x65')]['length'];_0x3e26c8+=0x1){_0x3e26c8>0x0&&(_0x54b8d1+='\x20'+_0x3083e8[_0x664e('0x66')]+'\x20');_0x54b8d1+=_0x3083e8['rules'][_0x3e26c8][_0x664e('0x67')]?_0x103b2b(_0x3083e8[_0x664e('0x65')][_0x3e26c8][_0x664e('0x67')]):_0x3083e8[_0x664e('0x65')][_0x3e26c8][_0x664e('0x68')]+'\x20'+_0x3083e8[_0x664e('0x65')][_0x3e26c8]['condition']+(_0x3f1eef(_0x3083e8['rules'][_0x3e26c8][_0x664e('0x8b')])?'\x20'+_0x3083e8[_0x664e('0x65')][_0x3e26c8]['value']:'');}return _0x54b8d1+')';};var _0x31599d={'where':{'id':_0x240636['id']}},_0x260107,_0x45dc8b,_0x36aa92,_0x58377,_0x36d988;_0x31599d=_['merge']({},_0x31599d,_0x4d1e1c);return db[_0x664e('0x3f')]['find'](_0x31599d)[_0x664e('0x23')](function(_0x516bbb){if(_0x516bbb){_0x260107=_0x516bbb;return _0x516bbb[_0x664e('0x6a')]();}return null;})[_0x664e('0x23')](function(_0x2dcefb){if(_0x2dcefb){if(!_0x2dcefb[_0x664e('0x35')]){throw new db['Sequelize'][(_0x664e('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x45dc8b=_0x2dcefb;return db[_0x664e('0x6e')][_0x664e('0x41')]({'raw':!![]});}return null;})[_0x664e('0x23')](function(_0x4d6cce){if(_0x4d6cce){_0x36aa92=_[_0x664e('0x6f')](_0x4d6cce,'id');var _0x228f73;var _0x3bf324=squel[_0x664e('0x70')]();_0x3bf324[_0x664e('0x8c')](_0x260107[_0x664e('0x71')]);for(var _0x50ed6a=0x0;_0x50ed6a<_0x45dc8b[_0x664e('0x35')];_0x50ed6a+=0x1){_0x228f73=_0x45dc8b[_0x50ed6a]['MetricId']?_0x36aa92[_0x45dc8b[_0x50ed6a][_0x664e('0x72')]]['metric']:_0x45dc8b[_0x50ed6a][_0x664e('0x68')];_0x228f73=_0x45dc8b[_0x50ed6a]['function']?_['replace'](_0x49f452[_0x45dc8b[_0x50ed6a][_0x664e('0x74')]],'%s',_0x228f73):_0x228f73;_0x228f73=_0x45dc8b[_0x50ed6a]['format']?_[_0x664e('0x76')](_0x21ef4d[_0x45dc8b[_0x50ed6a][_0x664e('0x75')]],'%s',_0x228f73):_0x228f73;if(_0x45dc8b[_0x50ed6a][_0x664e('0x77')]){_0x3bf324[_0x664e('0x67')](_0x228f73);}_0x45dc8b[_0x50ed6a]['orderBy']&&_0x3bf324[_0x664e('0x37')](_0x228f73,_0x45dc8b[_0x50ed6a][_0x664e('0x78')]==='DESC'?![]:!![]);_0x3bf324[_0x664e('0x68')](_0x228f73,_0x45dc8b[_0x50ed6a]['alias']||_0x228f73);}if(_0x260107[_0x664e('0x7b')]){_0x260107['joins']=JSON[_0x664e('0x7c')](_0x260107['joins']);for(var _0x19966e=0x0;_0x19966e<_0x260107[_0x664e('0x7b')][_0x664e('0x35')];_0x19966e+=0x1){if(_0x260107[_0x664e('0x7b')][_0x19966e][_0x664e('0x2e')]&&_[_0x664e('0x61')](_0x36f1b5,_0x260107[_0x664e('0x7b')][_0x19966e][_0x664e('0x2e')])&&_0x260107[_0x664e('0x7b')][_0x19966e][_0x664e('0x7d')]&&_0x260107['joins'][_0x19966e][_0x664e('0x7e')]&&_0x260107[_0x664e('0x7b')][_0x19966e][_0x664e('0x7f')]){_0x3bf324[_0x260107[_0x664e('0x7b')][_0x19966e]['type']](_0x260107[_0x664e('0x7b')][_0x19966e][_0x664e('0x7e')],null,util[_0x664e('0x75')]('%s.%s\x20=\x20%s.%s',_0x260107['table'],_0x260107[_0x664e('0x7b')][_0x19966e][_0x664e('0x7d')],_0x260107[_0x664e('0x7b')][_0x19966e]['foreignTable'],_0x260107['joins'][_0x19966e][_0x664e('0x7f')]));}}}if(_0x260107[_0x664e('0x81')]){_0x260107[_0x664e('0x81')]=JSON[_0x664e('0x7c')](_0x260107['conditions']);_0x3bf324[_0x664e('0x39')](_0x103b2b(_0x260107[_0x664e('0x81')]['group']));}_0x36d988=_0x3bf324[_0x664e('0x82')]();_0x3bf324[_0x664e('0x1c')](_0xf293f2);_0x3bf324['offset'](0x0);return;}})[_0x664e('0x23')](function(){if(_0x33a256[_0x664e('0x8d')]===_0x664e('0x8e')){return null;}var _0xfef594=_[_0x664e('0x3d')](_0x33a256,{'name':_0x33a256[_0x664e('0x8f')]||_0x33a256[_0x664e('0x28')]||_0x260107[_0x664e('0x28')],'basename':_0x594087,'savename':util[_0x664e('0x75')](_0x664e('0x90'),_0x33a256[_0x664e('0x28')]||_0x260107[_0x664e('0x28')],require(_0x664e('0x91'))[_0x664e('0x92')](0x4),_0x33a256['output']||'csv'),'reportId':_0x260107['id'],'reportType':_0x664e('0x93')});return db[_0x664e('0x94')]['create'](_0xfef594,{'raw':!![]});})['then'](function(_0x538502){if(_0x260107[_0x664e('0x71')]==='cdr'){_0x36d988[_0x664e('0x39')](_0x260107[_0x664e('0x71')]+_0x664e('0x95'),_0x33a256[_0x664e('0x96')],_0x33a256[_0x664e('0x97')]);}else{_0x36d988[_0x664e('0x39')](_0x260107['table']+_0x664e('0x98'),_0x33a256['startDate'],_0x33a256[_0x664e('0x97')]);}if(_0x538502){logger[_0x664e('0x99')]('Run\x20Query:',_0x36d988[_0x664e('0x85')]());require(_0x664e('0x9a'))[_0x664e('0x9b')](path[_0x664e('0x87')](__dirname,'../../components/export/',_0x538502[_0x664e('0x8d')]),[_0x538502['id'],_0x36d988[_0x664e('0x85')](),path['join'](__dirname,_0x664e('0x9c'),_0x538502[_0x664e('0x9d')]),_0x594087]);return _0x538502;}else{var _0x3acdbb=squel[_0x664e('0x70')]();_0x3acdbb['from']('('+_0x36d988[_0x664e('0x85')]()+')','countTable');_0x3acdbb[_0x664e('0x68')](_0x664e('0x9e'),_0x664e('0x1d'));_0x36d988[_0x664e('0x1c')](_0x33a256[_0x664e('0x1c')]||_0xf293f2);_0x36d988[_0x664e('0x1b')](_0x33a256[_0x664e('0x1b')]||0x0);return dbH[_0x664e('0x86')]['query'](_0x3acdbb[_0x664e('0x85')](),{'type':dbH[_0x664e('0x86')][_0x664e('0x9f')][_0x664e('0xa0')]})[_0x664e('0x23')](function(_0x5da381){if(!_0x5da381[_0x664e('0x35')]){_0x58377=0x0;}else{_0x58377=_0x5da381[0x0][_0x664e('0x1d')]||0x0;}return dbH[_0x664e('0x86')]['query'](_0x36d988[_0x664e('0x85')](),{'type':dbH[_0x664e('0x86')]['QueryTypes']['SELECT']});})['then'](function(_0x484160){return{'rows':_0x484160||[],'count':_0x58377};});}});}exports[_0x664e('0xa1')]=function(_0x1836da,_0x40aaa7){return runReport(_0x1836da[_0x664e('0x50')],_0x1836da[_0x664e('0x30')],_0x1836da[_0x664e('0x3e')])[_0x664e('0x23')](respondWithResult(_0x40aaa7,null))[_0x664e('0x43')](handleError(_0x40aaa7,null));};exports['runReport']=runReport;exports['query']=function(_0xd36dba,_0x144ee9){var _0x317f3e=0xa;var _0x590716=['join',_0x664e('0x52'),_0x664e('0x53'),_0x664e('0x54')];var _0x4bf20e={'SUM':_0x664e('0x55'),'COUNT':_0x664e('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x664e('0x57'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x664e('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x664e('0x5c')};var _0xa56c7e={'SEC_TO_TIME':_0x664e('0x5d'),'DATE':'DATE(%s)','HOUR':_0x664e('0x5e'),'ROUND':_0x664e('0x5f'),'UNIX_TIMESTAMP':_0x664e('0x60')};var _0x5091db=function(_0x3dc054){return!_[_0x664e('0x61')]([_0x664e('0x62'),'IS\x20NOT\x20NULL',_0x664e('0x8a'),_0x664e('0x64')],_0x3dc054);};var _0x3907db=function(_0x2eb354){if(!_0x2eb354||!_0x2eb354['rules'][_0x664e('0x35')]){return'';}for(var _0x221ce8='(',_0x357c46=0x0;_0x357c46<_0x2eb354[_0x664e('0x65')][_0x664e('0x35')];_0x357c46+=0x1){_0x357c46>0x0&&(_0x221ce8+='\x20'+_0x2eb354[_0x664e('0x66')]+'\x20');_0x221ce8+=_0x2eb354['rules'][_0x357c46][_0x664e('0x67')]?_0x3907db(_0x2eb354[_0x664e('0x65')][_0x357c46][_0x664e('0x67')]):_0x2eb354[_0x664e('0x65')][_0x357c46][_0x664e('0x68')]+'\x20'+_0x2eb354['rules'][_0x357c46][_0x664e('0x8b')]+(_0x5091db(_0x2eb354[_0x664e('0x65')][_0x357c46]['condition'])?'\x20'+_0x2eb354[_0x664e('0x65')][_0x357c46]['value']:'');}return _0x221ce8+')';};var _0x4a58d6={'where':{'id':_0xd36dba[_0x664e('0x50')]['id']}},_0x1fa99c,_0x1abc9f,_0x131659,_0xb55e9b,_0x1c506f;_0x4a58d6=_['merge']({},_0x4a58d6,_0xd36dba['options']);return db['AnalyticCustomReport'][_0x664e('0x47')](_0x4a58d6)[_0x664e('0x23')](function(_0x375c62){if(_0x375c62){_0x1fa99c=_0x375c62;return _0x375c62[_0x664e('0x6a')]();}return null;})[_0x664e('0x23')](function(_0x1f8482){if(_0x1f8482){if(!_0x1f8482[_0x664e('0x35')]){throw new db['Sequelize'][(_0x664e('0x6c'))](_0x664e('0x6d'),0x193);}_0x1abc9f=_0x1f8482;return db[_0x664e('0x6e')][_0x664e('0x41')]({'raw':!![]});}return null;})[_0x664e('0x23')](function(_0x27584b){if(_0x27584b){_0x131659=_['keyBy'](_0x27584b,'id');var _0x383e6b;var _0x4d4024=squel[_0x664e('0x70')]();_0x4d4024[_0x664e('0x8c')](_0x1fa99c[_0x664e('0x71')]);for(var _0x2c9810=0x0;_0x2c9810<_0x1abc9f[_0x664e('0x35')];_0x2c9810+=0x1){_0x383e6b=_0x1abc9f[_0x2c9810][_0x664e('0x72')]?_0x131659[_0x1abc9f[_0x2c9810][_0x664e('0x72')]]['metric']:_0x1abc9f[_0x2c9810][_0x664e('0x68')];_0x383e6b=_0x1abc9f[_0x2c9810][_0x664e('0x74')]?_['replace'](_0x4bf20e[_0x1abc9f[_0x2c9810][_0x664e('0x74')]],'%s',_0x383e6b):_0x383e6b;_0x383e6b=_0x1abc9f[_0x2c9810]['format']?_[_0x664e('0x76')](_0xa56c7e[_0x1abc9f[_0x2c9810][_0x664e('0x75')]],'%s',_0x383e6b):_0x383e6b;if(_0x1abc9f[_0x2c9810]['groupBy']){_0x4d4024[_0x664e('0x67')](_0x383e6b);}_0x1abc9f[_0x2c9810][_0x664e('0x78')]&&_0x4d4024[_0x664e('0x37')](_0x383e6b,_0x1abc9f[_0x2c9810][_0x664e('0x78')]==='DESC'?![]:!![]);_0x4d4024[_0x664e('0x68')](_0x383e6b,_0x1abc9f[_0x2c9810]['alias']||_0x383e6b);}if(_0x1fa99c[_0x664e('0x7b')]){_0x1fa99c['joins']=JSON[_0x664e('0x7c')](_0x1fa99c[_0x664e('0x7b')]);for(var _0x39e0ad=0x0;_0x39e0ad<_0x1fa99c[_0x664e('0x7b')][_0x664e('0x35')];_0x39e0ad+=0x1){if(_0x1fa99c[_0x664e('0x7b')][_0x39e0ad][_0x664e('0x2e')]&&_[_0x664e('0x61')](_0x590716,_0x1fa99c['joins'][_0x39e0ad][_0x664e('0x2e')])&&_0x1fa99c[_0x664e('0x7b')][_0x39e0ad][_0x664e('0x7d')]&&_0x1fa99c[_0x664e('0x7b')][_0x39e0ad][_0x664e('0x7e')]&&_0x1fa99c[_0x664e('0x7b')][_0x39e0ad][_0x664e('0x7f')]){_0x4d4024[_0x1fa99c[_0x664e('0x7b')][_0x39e0ad][_0x664e('0x2e')]](_0x1fa99c[_0x664e('0x7b')][_0x39e0ad][_0x664e('0x7e')],null,util['format'](_0x664e('0x80'),_0x1fa99c[_0x664e('0x71')],_0x1fa99c[_0x664e('0x7b')][_0x39e0ad]['parentKey'],_0x1fa99c[_0x664e('0x7b')][_0x39e0ad][_0x664e('0x7e')],_0x1fa99c[_0x664e('0x7b')][_0x39e0ad]['foreignKey']));}}}if(_0x1fa99c[_0x664e('0x81')]){_0x1fa99c[_0x664e('0x81')]=JSON[_0x664e('0x7c')](_0x1fa99c[_0x664e('0x81')]);_0x4d4024['where'](_0x3907db(_0x1fa99c[_0x664e('0x81')][_0x664e('0x67')]));}_0x1c506f=_0x4d4024['clone']();_0x4d4024[_0x664e('0x1c')](_0x317f3e);_0x4d4024[_0x664e('0x1b')](0x0);logger[_0x664e('0x83')](_0x664e('0x84'),_0x4d4024[_0x664e('0x85')]());return dbH[_0x664e('0x86')][_0x664e('0x30')](_0x4d4024['toString'](),{'type':dbH[_0x664e('0x86')][_0x664e('0x9f')][_0x664e('0xa0')]});}})['then'](function(){return{'sql':_0x1c506f[_0x664e('0x85')]()};})[_0x664e('0x23')](respondWithResult(_0x144ee9,null))[_0x664e('0x43')](handleError(_0x144ee9,null));}; \ No newline at end of file +var _0x58a6=['attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','findAll','rows','show','params','include','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','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','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','toString','sequelize','QueryTypes','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','from','clone','output','web','fullPath','randomstring','generate','csv','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','child_process','fork','../../components/export/','../../files/reports','countTable','SELECT','run','runReport','parentKey','Limited\x20Query:','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','destroy','then','CustomReports','UserProfileResource','send','map','type','key','name','keys','filters','intersection','model','query'];(function(_0x15b1b6,_0x184912){var _0x704435=function(_0x19e530){while(--_0x19e530){_0x15b1b6['push'](_0x15b1b6['shift']());}};_0x704435(++_0x184912);}(_0x58a6,0x109));var _0x658a=function(_0x424c63,_0x49c9e4){_0x424c63=_0x424c63-0x0;var _0x27b529=_0x58a6[_0x424c63];return _0x27b529;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x658a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x658a('0x1'));var rp=require('request-promise');var moment=require(_0x658a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x658a('0x3'));var util=require(_0x658a('0x4'));var path=require(_0x658a('0x5'));var sox=require(_0x658a('0x6'));var csv=require(_0x658a('0x7'));var ejs=require(_0x658a('0x8'));var fs=require('fs');var fs_extra=require(_0x658a('0x9'));var _=require('lodash');var squel=require(_0x658a('0xa'));var crypto=require(_0x658a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x658a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x658a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x658a('0xe'));var qs=require(_0x658a('0xf'));var as=require(_0x658a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x658a('0x11'))(_0x658a('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x658a('0x13'));var db=require(_0x658a('0x14'))['db'];var dbH=require(_0x658a('0x14'))[_0x658a('0x15')];function respondWithStatusCode(_0x3f2613,_0x48f1ab){_0x48f1ab=_0x48f1ab||0xcc;return function(_0x371e43){if(_0x371e43){return _0x3f2613[_0x658a('0x16')](_0x48f1ab);}return _0x3f2613[_0x658a('0x17')](_0x48f1ab)[_0x658a('0x18')]();};}function respondWithResult(_0x579b47,_0x1da786){_0x1da786=_0x1da786||0xc8;return function(_0x2ddd8c){if(_0x2ddd8c){return _0x579b47['status'](_0x1da786)['json'](_0x2ddd8c);}};}function respondWithFilteredResult(_0x2b4b6b,_0x454105){return function(_0x29009c){if(_0x29009c){var _0x9d64c9=typeof _0x454105[_0x658a('0x19')]===_0x658a('0x1a')&&typeof _0x454105[_0x658a('0x1b')]===_0x658a('0x1a');var _0x2656d8=_0x29009c[_0x658a('0x1c')];var _0x3563ae=_0x9d64c9?0x0:_0x454105['offset'];var _0x3ee499=_0x9d64c9?_0x29009c['count']:_0x454105['offset']+_0x454105[_0x658a('0x1b')];var _0x113238;if(_0x3ee499>=_0x2656d8){_0x3ee499=_0x2656d8;_0x113238=0xc8;}else{_0x113238=0xce;}_0x2b4b6b[_0x658a('0x17')](_0x113238);return _0x2b4b6b[_0x658a('0x1d')](_0x658a('0x1e'),_0x3563ae+'-'+_0x3ee499+'/'+_0x2656d8)[_0x658a('0x1f')](_0x29009c);}return null;};}function patchUpdates(_0x5d53ae){return function(_0x1ccfe7){try{jsonpatch[_0x658a('0x20')](_0x1ccfe7,_0x5d53ae,!![]);}catch(_0x328f9e){return BPromise['reject'](_0x328f9e);}return _0x1ccfe7['save']();};}function saveUpdates(_0x2b45dd,_0x46e2f4){return function(_0x309cb4){if(_0x309cb4){return _0x309cb4['update'](_0x2b45dd)['then'](function(_0x1235ed){return _0x1235ed;});}return null;};}function removeEntity(_0x638219,_0x377c8a){return function(_0x11a3fe){if(_0x11a3fe){return _0x11a3fe[_0x658a('0x21')]()[_0x658a('0x22')](function(){var _0x3956b4=_0x11a3fe['get']({'plain':!![]});var _0x44c149=_0x658a('0x23');return db[_0x658a('0x24')][_0x658a('0x21')]({'where':{'type':_0x44c149,'resourceId':_0x3956b4['id']}})[_0x658a('0x22')](function(){return _0x11a3fe;});})['then'](function(){_0x638219[_0x658a('0x17')](0xcc)[_0x658a('0x18')]();});}};}function handleEntityNotFound(_0x294626,_0x2258c6){return function(_0x4f9e50){if(!_0x4f9e50){_0x294626[_0x658a('0x16')](0x194);}return _0x4f9e50;};}function handleError(_0x25236a,_0x3fa57b){_0x3fa57b=_0x3fa57b||0x1f4;return function(_0x3d7350){logger['error'](_0x3d7350['stack']);if(_0x3d7350['name']){delete _0x3d7350['name'];}_0x25236a[_0x658a('0x17')](_0x3fa57b)[_0x658a('0x25')](_0x3d7350);};}exports['index']=function(_0x52fdaa,_0x2f6300){var _0x1fae56={},_0x41cf2d={},_0x6cf542={'count':0x0,'rows':[]};var _0x316a06=_[_0x658a('0x26')](db['AnalyticCustomReport']['rawAttributes'],function(_0x35499c){return{'name':_0x35499c['fieldName'],'type':_0x35499c[_0x658a('0x27')][_0x658a('0x28')]};});_0x41cf2d['model']=_[_0x658a('0x26')](_0x316a06,_0x658a('0x29'));_0x41cf2d['query']=_[_0x658a('0x2a')](_0x52fdaa['query']);_0x41cf2d[_0x658a('0x2b')]=_[_0x658a('0x2c')](_0x41cf2d[_0x658a('0x2d')],_0x41cf2d[_0x658a('0x2e')]);_0x1fae56[_0x658a('0x2f')]=_[_0x658a('0x2c')](_0x41cf2d[_0x658a('0x2d')],qs[_0x658a('0x30')](_0x52fdaa[_0x658a('0x2e')][_0x658a('0x30')]));_0x1fae56['attributes']=_0x1fae56[_0x658a('0x2f')][_0x658a('0x31')]?_0x1fae56[_0x658a('0x2f')]:_0x41cf2d[_0x658a('0x2d')];if(!_0x52fdaa['query']['hasOwnProperty']('nolimit')){_0x1fae56[_0x658a('0x1b')]=qs[_0x658a('0x1b')](_0x52fdaa['query'][_0x658a('0x1b')]);_0x1fae56[_0x658a('0x19')]=qs[_0x658a('0x19')](_0x52fdaa[_0x658a('0x2e')][_0x658a('0x19')]);}_0x1fae56[_0x658a('0x32')]=qs[_0x658a('0x33')](_0x52fdaa['query'][_0x658a('0x33')]);_0x1fae56[_0x658a('0x34')]=qs['filters'](_[_0x658a('0x35')](_0x52fdaa[_0x658a('0x2e')],_0x41cf2d[_0x658a('0x2b')]),_0x316a06);if(_0x52fdaa[_0x658a('0x2e')][_0x658a('0x36')]){_0x1fae56['where']=_[_0x658a('0x37')](_0x1fae56[_0x658a('0x34')],{'$or':_[_0x658a('0x26')](_0x316a06,function(_0x4d0515){if(_0x4d0515[_0x658a('0x27')]!==_0x658a('0x38')){var _0x82e405={};_0x82e405[_0x4d0515[_0x658a('0x29')]]={'$like':'%'+_0x52fdaa['query']['filter']+'%'};return _0x82e405;}})});}_0x1fae56=_['merge']({},_0x1fae56,_0x52fdaa[_0x658a('0x39')]);var _0x13da64={'where':_0x1fae56[_0x658a('0x34')]};return db[_0x658a('0x3a')]['count'](_0x13da64)['then'](function(_0x500656){_0x6cf542[_0x658a('0x1c')]=_0x500656;if(_0x52fdaa[_0x658a('0x2e')][_0x658a('0x3b')]){_0x1fae56['include']=[{'all':!![]}];}return db[_0x658a('0x3a')][_0x658a('0x3c')](_0x1fae56);})[_0x658a('0x22')](function(_0x4ff4ab){_0x6cf542[_0x658a('0x3d')]=_0x4ff4ab;return _0x6cf542;})[_0x658a('0x22')](respondWithFilteredResult(_0x2f6300,_0x1fae56))['catch'](handleError(_0x2f6300,null));};exports[_0x658a('0x3e')]=function(_0x1f217b,_0x457563){var _0x38e804={'raw':![],'where':{'id':_0x1f217b[_0x658a('0x3f')]['id']}},_0x15e4a0={};_0x15e4a0[_0x658a('0x2d')]=_[_0x658a('0x2a')](db[_0x658a('0x3a')]['rawAttributes']);_0x15e4a0['query']=_['keys'](_0x1f217b[_0x658a('0x2e')]);_0x15e4a0[_0x658a('0x2b')]=_['intersection'](_0x15e4a0[_0x658a('0x2d')],_0x15e4a0[_0x658a('0x2e')]);_0x38e804[_0x658a('0x2f')]=_[_0x658a('0x2c')](_0x15e4a0[_0x658a('0x2d')],qs[_0x658a('0x30')](_0x1f217b['query'][_0x658a('0x30')]));_0x38e804[_0x658a('0x2f')]=_0x38e804[_0x658a('0x2f')][_0x658a('0x31')]?_0x38e804[_0x658a('0x2f')]:_0x15e4a0[_0x658a('0x2d')];if(_0x1f217b[_0x658a('0x2e')][_0x658a('0x3b')]){_0x38e804[_0x658a('0x40')]=[{'all':!![]}];}_0x38e804=_['merge']({},_0x38e804,_0x1f217b[_0x658a('0x39')]);return db['AnalyticCustomReport'][_0x658a('0x41')](_0x38e804)[_0x658a('0x22')](handleEntityNotFound(_0x457563,null))['then'](respondWithResult(_0x457563,null))[_0x658a('0x42')](handleError(_0x457563,null));};exports[_0x658a('0x43')]=function(_0x31fc66,_0x501a57){return db['AnalyticCustomReport'][_0x658a('0x43')](_0x31fc66['body'],{})['then'](function(_0x226d00){var _0x114539=_0x31fc66[_0x658a('0x44')][_0x658a('0x45')]({'plain':!![]});if(!_0x114539)throw new Error(_0x658a('0x46'));if(_0x114539[_0x658a('0x47')]===_0x658a('0x44')){var _0x7426ae=_0x226d00[_0x658a('0x45')]({'plain':!![]});var _0x491de1=_0x658a('0x48');return db[_0x658a('0x49')][_0x658a('0x41')]({'where':{'name':_0x491de1,'userProfileId':_0x114539['userProfileId']},'raw':!![]})['then'](function(_0x1e7e77){if(_0x1e7e77&&_0x1e7e77[_0x658a('0x4a')]===0x0){return db[_0x658a('0x24')][_0x658a('0x43')]({'name':_0x7426ae[_0x658a('0x29')],'resourceId':_0x7426ae['id'],'type':_0x658a('0x23'),'sectionId':_0x1e7e77['id']},{})[_0x658a('0x22')](function(){return _0x226d00;});}else{return _0x226d00;}})[_0x658a('0x42')](function(_0x44b9f9){logger[_0x658a('0x4b')](_0x658a('0x4c'),_0x44b9f9);throw _0x44b9f9;});}return _0x226d00;})[_0x658a('0x22')](respondWithResult(_0x501a57,0xc9))['catch'](handleError(_0x501a57,null));};exports['update']=function(_0x4bc1ec,_0x1f3088){if(_0x4bc1ec[_0x658a('0x4d')]['id']){delete _0x4bc1ec[_0x658a('0x4d')]['id'];}return db['AnalyticCustomReport'][_0x658a('0x41')]({'where':{'id':_0x4bc1ec[_0x658a('0x3f')]['id']}})[_0x658a('0x22')](handleEntityNotFound(_0x1f3088,null))['then'](saveUpdates(_0x4bc1ec[_0x658a('0x4d')],null))[_0x658a('0x22')](respondWithResult(_0x1f3088,null))['catch'](handleError(_0x1f3088,null));};exports[_0x658a('0x21')]=function(_0x19934c,_0x9ae3e4){return db[_0x658a('0x3a')][_0x658a('0x41')]({'where':{'id':_0x19934c[_0x658a('0x3f')]['id']}})[_0x658a('0x22')](handleEntityNotFound(_0x9ae3e4,null))[_0x658a('0x22')](removeEntity(_0x9ae3e4,null))[_0x658a('0x42')](handleError(_0x9ae3e4,null));};exports['preview']=function(_0x3d09db,_0x429dc4){var _0x24e676=0xa;var _0x1feb0b=[_0x658a('0x4e'),_0x658a('0x4f'),_0x658a('0x50'),_0x658a('0x51')];var _0x18390e={'SUM':_0x658a('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x658a('0x53'),'MAX':_0x658a('0x54'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x658a('0x55'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x658a('0x56')};var _0x35906b={'SEC_TO_TIME':_0x658a('0x57'),'DATE':_0x658a('0x58'),'HOUR':_0x658a('0x59'),'ROUND':_0x658a('0x5a'),'UNIX_TIMESTAMP':_0x658a('0x5b')};var _0x1fbd7d=function(_0x4157f9){return!_[_0x658a('0x5c')]([_0x658a('0x5d'),_0x658a('0x5e'),_0x658a('0x5f'),_0x658a('0x60')],_0x4157f9);};var _0x312239=function(_0x3ae403){if(!_0x3ae403||!_0x3ae403['rules'][_0x658a('0x31')]){return'';}for(var _0x4e8531='(',_0xff1d43=0x0;_0xff1d43<_0x3ae403[_0x658a('0x61')][_0x658a('0x31')];_0xff1d43+=0x1){_0xff1d43>0x0&&(_0x4e8531+='\x20'+_0x3ae403[_0x658a('0x62')]+'\x20');_0x4e8531+=_0x3ae403[_0x658a('0x61')][_0xff1d43]['group']?_0x312239(_0x3ae403[_0x658a('0x61')][_0xff1d43][_0x658a('0x63')]):_0x3ae403[_0x658a('0x61')][_0xff1d43][_0x658a('0x64')]+'\x20'+_0x3ae403[_0x658a('0x61')][_0xff1d43][_0x658a('0x65')]+(_0x1fbd7d(_0x3ae403['rules'][_0xff1d43]['condition'])?'\x20'+_0x3ae403[_0x658a('0x61')][_0xff1d43][_0x658a('0x66')]:'');}return _0x4e8531+')';};var _0x43540e={'where':{'id':_0x3d09db[_0x658a('0x3f')]['id']}},_0x35cf96,_0x4bf6cd,_0xf50503,_0x4eb3ac,_0x2f678f;_0x43540e=_[_0x658a('0x37')]({},_0x43540e,_0x3d09db[_0x658a('0x39')]);return db[_0x658a('0x3a')][_0x658a('0x41')](_0x43540e)[_0x658a('0x22')](function(_0x3f9ede){if(_0x3f9ede){_0x35cf96=_0x3f9ede;return _0x3f9ede[_0x658a('0x67')]();}return null;})['then'](function(_0x34d98b){if(_0x34d98b){if(!_0x34d98b[_0x658a('0x31')]){throw new db[(_0x658a('0x68'))][(_0x658a('0x69'))](_0x658a('0x6a'),0x193);}_0x4bf6cd=_0x34d98b;return db[_0x658a('0x6b')][_0x658a('0x3c')]({'raw':!![]});}return null;})[_0x658a('0x22')](function(_0x1dcdd6){if(_0x1dcdd6){_0xf50503=_[_0x658a('0x6c')](_0x1dcdd6,'id');var _0x1aa0ed;var _0x17d35f=squel[_0x658a('0x6d')]();_0x17d35f['from'](_0x35cf96[_0x658a('0x6e')]);for(var _0xfda05f=0x0;_0xfda05f<_0x4bf6cd[_0x658a('0x31')];_0xfda05f+=0x1){_0x1aa0ed=_0x4bf6cd[_0xfda05f][_0x658a('0x6f')]?_0xf50503[_0x4bf6cd[_0xfda05f]['MetricId']][_0x658a('0x70')]:_0x4bf6cd[_0xfda05f][_0x658a('0x64')];_0x1aa0ed=_0x4bf6cd[_0xfda05f]['function']?_[_0x658a('0x71')](_0x18390e[_0x4bf6cd[_0xfda05f][_0x658a('0x72')]],'%s',_0x1aa0ed):_0x1aa0ed;_0x1aa0ed=_0x4bf6cd[_0xfda05f][_0x658a('0x73')]?_[_0x658a('0x71')](_0x35906b[_0x4bf6cd[_0xfda05f]['format']],'%s',_0x1aa0ed):_0x1aa0ed;if(_0x4bf6cd[_0xfda05f][_0x658a('0x74')]){_0x17d35f[_0x658a('0x63')](_0x1aa0ed);}_0x4bf6cd[_0xfda05f][_0x658a('0x75')]&&_0x17d35f[_0x658a('0x32')](_0x1aa0ed,_0x4bf6cd[_0xfda05f]['orderBy']===_0x658a('0x76')?![]:!![]);_0x17d35f['field'](_0x1aa0ed,_0x4bf6cd[_0xfda05f][_0x658a('0x77')]||_0x1aa0ed);}if(_0x35cf96[_0x658a('0x78')]){_0x35cf96[_0x658a('0x78')]=JSON[_0x658a('0x79')](_0x35cf96[_0x658a('0x78')]);for(var _0x37f697=0x0;_0x37f697<_0x35cf96[_0x658a('0x78')][_0x658a('0x31')];_0x37f697+=0x1){if(_0x35cf96[_0x658a('0x78')][_0x37f697][_0x658a('0x27')]&&_[_0x658a('0x5c')](_0x1feb0b,_0x35cf96[_0x658a('0x78')][_0x37f697][_0x658a('0x27')])&&_0x35cf96[_0x658a('0x78')][_0x37f697]['parentKey']&&_0x35cf96[_0x658a('0x78')][_0x37f697][_0x658a('0x7a')]&&_0x35cf96[_0x658a('0x78')][_0x37f697][_0x658a('0x7b')]){_0x17d35f[_0x35cf96[_0x658a('0x78')][_0x37f697][_0x658a('0x27')]](_0x35cf96[_0x658a('0x78')][_0x37f697][_0x658a('0x7a')],null,util[_0x658a('0x73')](_0x658a('0x7c'),_0x35cf96[_0x658a('0x6e')],_0x35cf96[_0x658a('0x78')][_0x37f697]['parentKey'],_0x35cf96['joins'][_0x37f697]['foreignTable'],_0x35cf96['joins'][_0x37f697][_0x658a('0x7b')]));}}}if(_0x35cf96[_0x658a('0x7d')]){_0x35cf96[_0x658a('0x7d')]=JSON[_0x658a('0x79')](_0x35cf96[_0x658a('0x7d')]);_0x17d35f[_0x658a('0x34')](_0x312239(_0x35cf96[_0x658a('0x7d')]['group']));}_0x2f678f=_0x17d35f['clone']();_0x17d35f[_0x658a('0x1b')](_0x24e676);_0x17d35f[_0x658a('0x19')](0x0);logger[_0x658a('0x7e')]('Limited\x20Query:',_0x17d35f[_0x658a('0x7f')]());return dbH['sequelize'][_0x658a('0x2e')](_0x17d35f[_0x658a('0x7f')](),{'type':dbH[_0x658a('0x80')][_0x658a('0x81')]['SELECT']});}})['then'](respondWithResult(_0x429dc4,null))[_0x658a('0x42')](handleError(_0x429dc4,null));};function runReport(_0x37d5a1,_0x5b4f74,_0x173da5){var _0x494302=_0x5b4f74[_0x658a('0x29')];var _0x25008c=0xa;var _0x59c528=[_0x658a('0x4e'),_0x658a('0x4f'),_0x658a('0x50'),'cross_join'];var _0x15cb1b={'SUM':_0x658a('0x52'),'COUNT':_0x658a('0x82'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x658a('0x54'),'MIN':_0x658a('0x83'),'AVG':_0x658a('0x84'),'GROUP_CONCAT':_0x658a('0x55'),'GROUP_CONCAT ASC':_0x658a('0x85'),'GROUP_CONCAT DESC':_0x658a('0x56')};var _0x37f5a7={'SEC_TO_TIME':_0x658a('0x57'),'DATE':_0x658a('0x58'),'HOUR':_0x658a('0x59'),'ROUND':_0x658a('0x5a'),'UNIX_TIMESTAMP':_0x658a('0x5b')};var _0xca5f52=function(_0x5cf102){return!_[_0x658a('0x5c')](['IS\x20NULL',_0x658a('0x5e'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x5cf102);};var _0x17a94b=function(_0xf64188){if(!_0xf64188||!_0xf64188[_0x658a('0x61')][_0x658a('0x31')]){return'';}for(var _0x2321a9='(',_0x14e43f=0x0;_0x14e43f<_0xf64188[_0x658a('0x61')][_0x658a('0x31')];_0x14e43f+=0x1){_0x14e43f>0x0&&(_0x2321a9+='\x20'+_0xf64188[_0x658a('0x62')]+'\x20');_0x2321a9+=_0xf64188[_0x658a('0x61')][_0x14e43f][_0x658a('0x63')]?_0x17a94b(_0xf64188['rules'][_0x14e43f][_0x658a('0x63')]):_0xf64188[_0x658a('0x61')][_0x14e43f]['field']+'\x20'+_0xf64188[_0x658a('0x61')][_0x14e43f][_0x658a('0x65')]+(_0xca5f52(_0xf64188[_0x658a('0x61')][_0x14e43f][_0x658a('0x65')])?'\x20'+_0xf64188[_0x658a('0x61')][_0x14e43f][_0x658a('0x66')]:'');}return _0x2321a9+')';};var _0x46f74d={'where':{'id':_0x37d5a1['id']}},_0x57b4ba,_0x55e6a4,_0x517d56,_0x3a6d77,_0x14133e;_0x46f74d=_[_0x658a('0x37')]({},_0x46f74d,_0x173da5);return db[_0x658a('0x3a')][_0x658a('0x41')](_0x46f74d)[_0x658a('0x22')](function(_0x2b94a9){if(_0x2b94a9){_0x57b4ba=_0x2b94a9;return _0x2b94a9['getFields']();}return null;})[_0x658a('0x22')](function(_0x29a790){if(_0x29a790){if(!_0x29a790['length']){throw new db[(_0x658a('0x68'))][(_0x658a('0x69'))](_0x658a('0x6a'),0x193);}_0x55e6a4=_0x29a790;return db[_0x658a('0x6b')][_0x658a('0x3c')]({'raw':!![]});}return null;})[_0x658a('0x22')](function(_0x1e77f5){if(_0x1e77f5){_0x517d56=_[_0x658a('0x6c')](_0x1e77f5,'id');var _0xdbf012;var _0x3af52c=squel['select']();_0x3af52c[_0x658a('0x86')](_0x57b4ba[_0x658a('0x6e')]);for(var _0x2304a4=0x0;_0x2304a4<_0x55e6a4[_0x658a('0x31')];_0x2304a4+=0x1){_0xdbf012=_0x55e6a4[_0x2304a4][_0x658a('0x6f')]?_0x517d56[_0x55e6a4[_0x2304a4][_0x658a('0x6f')]][_0x658a('0x70')]:_0x55e6a4[_0x2304a4]['field'];_0xdbf012=_0x55e6a4[_0x2304a4]['function']?_['replace'](_0x15cb1b[_0x55e6a4[_0x2304a4][_0x658a('0x72')]],'%s',_0xdbf012):_0xdbf012;_0xdbf012=_0x55e6a4[_0x2304a4]['format']?_[_0x658a('0x71')](_0x37f5a7[_0x55e6a4[_0x2304a4][_0x658a('0x73')]],'%s',_0xdbf012):_0xdbf012;if(_0x55e6a4[_0x2304a4][_0x658a('0x74')]){_0x3af52c[_0x658a('0x63')](_0xdbf012);}_0x55e6a4[_0x2304a4]['orderBy']&&_0x3af52c['order'](_0xdbf012,_0x55e6a4[_0x2304a4][_0x658a('0x75')]==='DESC'?![]:!![]);_0x3af52c['field'](_0xdbf012,_0x55e6a4[_0x2304a4][_0x658a('0x77')]||_0xdbf012);}if(_0x57b4ba[_0x658a('0x78')]){_0x57b4ba['joins']=JSON[_0x658a('0x79')](_0x57b4ba[_0x658a('0x78')]);for(var _0x318314=0x0;_0x318314<_0x57b4ba[_0x658a('0x78')][_0x658a('0x31')];_0x318314+=0x1){if(_0x57b4ba[_0x658a('0x78')][_0x318314][_0x658a('0x27')]&&_[_0x658a('0x5c')](_0x59c528,_0x57b4ba[_0x658a('0x78')][_0x318314][_0x658a('0x27')])&&_0x57b4ba['joins'][_0x318314]['parentKey']&&_0x57b4ba['joins'][_0x318314][_0x658a('0x7a')]&&_0x57b4ba[_0x658a('0x78')][_0x318314][_0x658a('0x7b')]){_0x3af52c[_0x57b4ba[_0x658a('0x78')][_0x318314][_0x658a('0x27')]](_0x57b4ba[_0x658a('0x78')][_0x318314]['foreignTable'],null,util[_0x658a('0x73')](_0x658a('0x7c'),_0x57b4ba[_0x658a('0x6e')],_0x57b4ba[_0x658a('0x78')][_0x318314]['parentKey'],_0x57b4ba[_0x658a('0x78')][_0x318314][_0x658a('0x7a')],_0x57b4ba[_0x658a('0x78')][_0x318314][_0x658a('0x7b')]));}}}if(_0x57b4ba['conditions']){_0x57b4ba[_0x658a('0x7d')]=JSON[_0x658a('0x79')](_0x57b4ba[_0x658a('0x7d')]);_0x3af52c[_0x658a('0x34')](_0x17a94b(_0x57b4ba['conditions']['group']));}_0x14133e=_0x3af52c[_0x658a('0x87')]();_0x3af52c[_0x658a('0x1b')](_0x25008c);_0x3af52c[_0x658a('0x19')](0x0);return;}})['then'](function(){if(_0x5b4f74[_0x658a('0x88')]===_0x658a('0x89')){return null;}var _0x4faaf4=_['merge'](_0x5b4f74,{'name':_0x5b4f74[_0x658a('0x8a')]||_0x5b4f74['name']||_0x57b4ba['name'],'basename':_0x494302,'savename':util[_0x658a('0x73')]('%s-%s.%s',_0x5b4f74[_0x658a('0x29')]||_0x57b4ba['name'],require(_0x658a('0x8b'))[_0x658a('0x8c')](0x4),_0x5b4f74['output']||_0x658a('0x8d')),'reportId':_0x57b4ba['id'],'reportType':'custom'});return db[_0x658a('0x8e')][_0x658a('0x43')](_0x4faaf4,{'raw':!![]});})[_0x658a('0x22')](function(_0x486f8e){if(_0x57b4ba[_0x658a('0x6e')]==='cdr'){_0x14133e['where'](_0x57b4ba[_0x658a('0x6e')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5b4f74[_0x658a('0x8f')],_0x5b4f74[_0x658a('0x90')]);}else{_0x14133e[_0x658a('0x34')](_0x57b4ba[_0x658a('0x6e')]+_0x658a('0x91'),_0x5b4f74[_0x658a('0x8f')],_0x5b4f74[_0x658a('0x90')]);}if(_0x486f8e){logger['info']('Run\x20Query:',_0x14133e[_0x658a('0x7f')]());require(_0x658a('0x92'))[_0x658a('0x93')](path['join'](__dirname,_0x658a('0x94'),_0x486f8e[_0x658a('0x88')]),[_0x486f8e['id'],_0x14133e[_0x658a('0x7f')](),path[_0x658a('0x4e')](__dirname,_0x658a('0x95'),_0x486f8e['savename']),_0x494302]);return _0x486f8e;}else{var _0x27b81f=squel[_0x658a('0x6d')]();_0x27b81f['from']('('+_0x14133e[_0x658a('0x7f')]()+')',_0x658a('0x96'));_0x27b81f['field']('COUNT(*)',_0x658a('0x1c'));_0x14133e[_0x658a('0x1b')](_0x5b4f74[_0x658a('0x1b')]||_0x25008c);_0x14133e[_0x658a('0x19')](_0x5b4f74[_0x658a('0x19')]||0x0);return dbH[_0x658a('0x80')]['query'](_0x27b81f[_0x658a('0x7f')](),{'type':dbH[_0x658a('0x80')][_0x658a('0x81')][_0x658a('0x97')]})['then'](function(_0xb743ed){if(!_0xb743ed[_0x658a('0x31')]){_0x3a6d77=0x0;}else{_0x3a6d77=_0xb743ed[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x14133e[_0x658a('0x7f')](),{'type':dbH[_0x658a('0x80')][_0x658a('0x81')][_0x658a('0x97')]});})[_0x658a('0x22')](function(_0xe51c1d){return{'rows':_0xe51c1d||[],'count':_0x3a6d77};});}});}exports[_0x658a('0x98')]=function(_0x19154e,_0x154652){return runReport(_0x19154e[_0x658a('0x3f')],_0x19154e[_0x658a('0x2e')],_0x19154e[_0x658a('0x39')])[_0x658a('0x22')](respondWithResult(_0x154652,null))[_0x658a('0x42')](handleError(_0x154652,null));};exports[_0x658a('0x99')]=runReport;exports[_0x658a('0x2e')]=function(_0x15e62f,_0x266a19){var _0x4d75b3=0xa;var _0x465f42=[_0x658a('0x4e'),_0x658a('0x4f'),_0x658a('0x50'),_0x658a('0x51')];var _0x3275a6={'SUM':'SUM(%s)','COUNT':_0x658a('0x82'),'COUNT DISTINCT':_0x658a('0x53'),'MAX':_0x658a('0x54'),'MIN':'MIN(%s)','AVG':_0x658a('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x658a('0x85'),'GROUP_CONCAT DESC':_0x658a('0x56')};var _0x5b0a55={'SEC_TO_TIME':_0x658a('0x57'),'DATE':_0x658a('0x58'),'HOUR':_0x658a('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x658a('0x5b')};var _0x3d63c8=function(_0xab1ebf){return!_[_0x658a('0x5c')]([_0x658a('0x5d'),_0x658a('0x5e'),_0x658a('0x5f'),'IS\x20NOT\x20EMPTY'],_0xab1ebf);};var _0x1f9ba5=function(_0x55115e){if(!_0x55115e||!_0x55115e[_0x658a('0x61')][_0x658a('0x31')]){return'';}for(var _0x6ab582='(',_0x1a0ab3=0x0;_0x1a0ab3<_0x55115e[_0x658a('0x61')][_0x658a('0x31')];_0x1a0ab3+=0x1){_0x1a0ab3>0x0&&(_0x6ab582+='\x20'+_0x55115e[_0x658a('0x62')]+'\x20');_0x6ab582+=_0x55115e[_0x658a('0x61')][_0x1a0ab3]['group']?_0x1f9ba5(_0x55115e['rules'][_0x1a0ab3][_0x658a('0x63')]):_0x55115e[_0x658a('0x61')][_0x1a0ab3][_0x658a('0x64')]+'\x20'+_0x55115e['rules'][_0x1a0ab3]['condition']+(_0x3d63c8(_0x55115e[_0x658a('0x61')][_0x1a0ab3][_0x658a('0x65')])?'\x20'+_0x55115e[_0x658a('0x61')][_0x1a0ab3][_0x658a('0x66')]:'');}return _0x6ab582+')';};var _0x417c5a={'where':{'id':_0x15e62f['params']['id']}},_0x5de7cb,_0x155b4b,_0x3186fc,_0x104b0e,_0x2a2bc0;_0x417c5a=_[_0x658a('0x37')]({},_0x417c5a,_0x15e62f['options']);return db['AnalyticCustomReport'][_0x658a('0x41')](_0x417c5a)[_0x658a('0x22')](function(_0x4e47d3){if(_0x4e47d3){_0x5de7cb=_0x4e47d3;return _0x4e47d3[_0x658a('0x67')]();}return null;})[_0x658a('0x22')](function(_0x28334d){if(_0x28334d){if(!_0x28334d[_0x658a('0x31')]){throw new db[(_0x658a('0x68'))][(_0x658a('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x155b4b=_0x28334d;return db[_0x658a('0x6b')][_0x658a('0x3c')]({'raw':!![]});}return null;})['then'](function(_0x7a4acf){if(_0x7a4acf){_0x3186fc=_['keyBy'](_0x7a4acf,'id');var _0x37e132;var _0x3cb72f=squel[_0x658a('0x6d')]();_0x3cb72f['from'](_0x5de7cb[_0x658a('0x6e')]);for(var _0x35078c=0x0;_0x35078c<_0x155b4b[_0x658a('0x31')];_0x35078c+=0x1){_0x37e132=_0x155b4b[_0x35078c][_0x658a('0x6f')]?_0x3186fc[_0x155b4b[_0x35078c][_0x658a('0x6f')]]['metric']:_0x155b4b[_0x35078c][_0x658a('0x64')];_0x37e132=_0x155b4b[_0x35078c][_0x658a('0x72')]?_['replace'](_0x3275a6[_0x155b4b[_0x35078c][_0x658a('0x72')]],'%s',_0x37e132):_0x37e132;_0x37e132=_0x155b4b[_0x35078c]['format']?_[_0x658a('0x71')](_0x5b0a55[_0x155b4b[_0x35078c][_0x658a('0x73')]],'%s',_0x37e132):_0x37e132;if(_0x155b4b[_0x35078c]['groupBy']){_0x3cb72f['group'](_0x37e132);}_0x155b4b[_0x35078c][_0x658a('0x75')]&&_0x3cb72f['order'](_0x37e132,_0x155b4b[_0x35078c][_0x658a('0x75')]===_0x658a('0x76')?![]:!![]);_0x3cb72f[_0x658a('0x64')](_0x37e132,_0x155b4b[_0x35078c][_0x658a('0x77')]||_0x37e132);}if(_0x5de7cb['joins']){_0x5de7cb['joins']=JSON[_0x658a('0x79')](_0x5de7cb[_0x658a('0x78')]);for(var _0x3f9c37=0x0;_0x3f9c37<_0x5de7cb[_0x658a('0x78')]['length'];_0x3f9c37+=0x1){if(_0x5de7cb[_0x658a('0x78')][_0x3f9c37][_0x658a('0x27')]&&_[_0x658a('0x5c')](_0x465f42,_0x5de7cb[_0x658a('0x78')][_0x3f9c37]['type'])&&_0x5de7cb[_0x658a('0x78')][_0x3f9c37][_0x658a('0x9a')]&&_0x5de7cb[_0x658a('0x78')][_0x3f9c37]['foreignTable']&&_0x5de7cb[_0x658a('0x78')][_0x3f9c37][_0x658a('0x7b')]){_0x3cb72f[_0x5de7cb['joins'][_0x3f9c37][_0x658a('0x27')]](_0x5de7cb[_0x658a('0x78')][_0x3f9c37][_0x658a('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x5de7cb[_0x658a('0x6e')],_0x5de7cb[_0x658a('0x78')][_0x3f9c37][_0x658a('0x9a')],_0x5de7cb['joins'][_0x3f9c37][_0x658a('0x7a')],_0x5de7cb[_0x658a('0x78')][_0x3f9c37][_0x658a('0x7b')]));}}}if(_0x5de7cb[_0x658a('0x7d')]){_0x5de7cb[_0x658a('0x7d')]=JSON[_0x658a('0x79')](_0x5de7cb[_0x658a('0x7d')]);_0x3cb72f[_0x658a('0x34')](_0x1f9ba5(_0x5de7cb[_0x658a('0x7d')]['group']));}_0x2a2bc0=_0x3cb72f[_0x658a('0x87')]();_0x3cb72f[_0x658a('0x1b')](_0x4d75b3);_0x3cb72f[_0x658a('0x19')](0x0);logger['debug'](_0x658a('0x9b'),_0x3cb72f[_0x658a('0x7f')]());return dbH[_0x658a('0x80')][_0x658a('0x2e')](_0x3cb72f['toString'](),{'type':dbH['sequelize'][_0x658a('0x81')][_0x658a('0x97')]});}})[_0x658a('0x22')](function(){return{'sql':_0x2a2bc0[_0x658a('0x7f')]()};})['then'](respondWithResult(_0x266a19,null))[_0x658a('0x42')](handleError(_0x266a19,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 4b9b403..82a9055 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 _0xbd5e=['path','rimraf','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','util','moment','bluebird','request-promise'];(function(_0x38aabb,_0x477305){var _0x5ba3e4=function(_0xd486f9){while(--_0xd486f9){_0x38aabb['push'](_0x38aabb['shift']());}};_0x5ba3e4(++_0x477305);}(_0xbd5e,0xa6));var _0xebd5=function(_0x283630,_0x22f536){_0x283630=_0x283630-0x0;var _0x5e28fd=_0xbd5e[_0x283630];return _0x5e28fd;};'use strict';var _=require('lodash');var util=require(_0xebd5('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xebd5('0x1'));var BPromise=require(_0xebd5('0x2'));var rp=require(_0xebd5('0x3'));var fs=require('fs');var path=require(_0xebd5('0x4'));var rimraf=require(_0xebd5('0x5'));var config=require('../../config/environment');var attributes=require(_0xebd5('0x6'));module[_0xebd5('0x7')]=function(_0x2895c9,_0x152177){return _0x2895c9['define'](_0xebd5('0x8'),attributes,{'tableName':_0xebd5('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83f0=['AnalyticCustomReport','analytics_custom_reports','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x47dec4,_0x3efca2){var _0x531676=function(_0x5689b9){while(--_0x5689b9){_0x47dec4['push'](_0x47dec4['shift']());}};_0x531676(++_0x3efca2);}(_0x83f0,0x176));var _0x083f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x83f0[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x083f('0x0'));var util=require(_0x083f('0x1'));var logger=require('../../config/logger')(_0x083f('0x2'));var moment=require(_0x083f('0x3'));var BPromise=require('bluebird');var rp=require(_0x083f('0x4'));var fs=require('fs');var path=require(_0x083f('0x5'));var rimraf=require(_0x083f('0x6'));var config=require(_0x083f('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x083f('0x8')]=function(_0x3c84be,_0x3a2c1b){return _0x3c84be[_0x083f('0x9')](_0x083f('0xa'),attributes,{'tableName':_0x083f('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 99f1a9e..b5aebac 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 _0xb788=['error','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb788,0x17f));var _0x8b78=function(_0x5016c9,_0x57cdf0){_0x5016c9=_0x5016c9-0x0;var _0x5371ee=_0xb788[_0x5016c9];return _0x5371ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8b78('0x0'));var BPromise=require('bluebird');var rs=require(_0x8b78('0x1'));var fs=require('fs');var Redis=require(_0x8b78('0x2'));var db=require(_0x8b78('0x3'))['db'];var utils=require(_0x8b78('0x4'));var logger=require(_0x8b78('0x5'))(_0x8b78('0x6'));var config=require(_0x8b78('0x7'));var jayson=require(_0x8b78('0x8'));var client=jayson[_0x8b78('0x9')][_0x8b78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2caad0,_0x378387,_0x4aeac4){return new BPromise(function(_0xd22869,_0x53cc82){return client['request'](_0x2caad0,_0x4aeac4)[_0x8b78('0xb')](function(_0x1c9cbf){logger[_0x8b78('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x378387,_0x8b78('0xd'));logger[_0x8b78('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x378387,_0x8b78('0xd'),JSON[_0x8b78('0xf')](_0x1c9cbf));if(_0x1c9cbf[_0x8b78('0x10')]){if(_0x1c9cbf[_0x8b78('0x10')]['code']===0x1f4){logger[_0x8b78('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x378387,_0x1c9cbf['error'][_0x8b78('0x11')]);return _0x53cc82(_0x1c9cbf[_0x8b78('0x10')][_0x8b78('0x11')]);}logger[_0x8b78('0x10')](_0x8b78('0x12'),_0x378387,_0x1c9cbf['error'][_0x8b78('0x11')]);return _0xd22869(_0x1c9cbf['error'][_0x8b78('0x11')]);}else{logger[_0x8b78('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x378387,_0x8b78('0xd'));_0xd22869(_0x1c9cbf[_0x8b78('0x13')]['message']);}})[_0x8b78('0x14')](function(_0x473edc){logger['error'](_0x8b78('0x12'),_0x378387,_0x473edc);_0x53cc82(_0x473edc);});});} \ No newline at end of file +var _0xb80d=['request\x20sent','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','http','then','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info'];(function(_0xd8203d,_0x454961){var _0x1a1430=function(_0x17d837){while(--_0x17d837){_0xd8203d['push'](_0xd8203d['shift']());}};_0x1a1430(++_0x454961);}(_0xb80d,0x155));var _0xdb80=function(_0x1e9424,_0x191cba){_0x1e9424=_0x1e9424-0x0;var _0x1bd96c=_0xb80d[_0x1e9424];return _0x1bd96c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdb80('0x0'));var BPromise=require(_0xdb80('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb80('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdb80('0x3'))('rpc');var config=require(_0xdb80('0x4'));var jayson=require(_0xdb80('0x5'));var client=jayson['client'][_0xdb80('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x514e7b,_0x496ec7,_0x5e3fb7){return new BPromise(function(_0x1a855,_0x13e1bc){return client['request'](_0x514e7b,_0x5e3fb7)[_0xdb80('0x7')](function(_0x6a56bb){logger['info'](_0xdb80('0x8'),_0x496ec7,'request\x20sent');logger[_0xdb80('0x9')](_0xdb80('0xa'),_0x496ec7,'request\x20sent',JSON[_0xdb80('0xb')](_0x6a56bb));if(_0x6a56bb['error']){if(_0x6a56bb['error'][_0xdb80('0xc')]===0x1f4){logger[_0xdb80('0xd')](_0xdb80('0x8'),_0x496ec7,_0x6a56bb[_0xdb80('0xd')][_0xdb80('0xe')]);return _0x13e1bc(_0x6a56bb[_0xdb80('0xd')][_0xdb80('0xe')]);}logger[_0xdb80('0xd')](_0xdb80('0x8'),_0x496ec7,_0x6a56bb[_0xdb80('0xd')]['message']);return _0x1a855(_0x6a56bb[_0xdb80('0xd')][_0xdb80('0xe')]);}else{logger[_0xdb80('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x496ec7,_0xdb80('0x10'));_0x1a855(_0x6a56bb['result']['message']);}})['catch'](function(_0x522fc5){logger[_0xdb80('0xd')](_0xdb80('0x8'),_0x496ec7,_0x522fc5);_0x13e1bc(_0x522fc5);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 0be5305..d4fad9a 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 _0x1db3=['/:id/query','post','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run'];(function(_0x2b47e7,_0x4c3bc0){var _0x360cbd=function(_0x250e96){while(--_0x250e96){_0x2b47e7['push'](_0x2b47e7['shift']());}};_0x360cbd(++_0x4c3bc0);}(_0x1db3,0x7e));var _0x31db=function(_0x53b39d,_0x279d8e){_0x53b39d=_0x53b39d-0x0;var _0x55171b=_0x1db3[_0x53b39d];return _0x55171b;};'use strict';var multer=require(_0x31db('0x0'));var util=require(_0x31db('0x1'));var path=require(_0x31db('0x2'));var timeout=require('connect-timeout');var express=require(_0x31db('0x3'));var router=express[_0x31db('0x4')]();var fs_extra=require(_0x31db('0x5'));var auth=require(_0x31db('0x6'));var interaction=require(_0x31db('0x7'));var config=require(_0x31db('0x8'));var controller=require(_0x31db('0x9'));router[_0x31db('0xa')]('/',auth[_0x31db('0xb')](),controller[_0x31db('0xc')]);router[_0x31db('0xa')](_0x31db('0xd'),auth[_0x31db('0xb')](),controller[_0x31db('0xe')]);router['get'](_0x31db('0xf'),auth[_0x31db('0xb')](),controller[_0x31db('0x10')]);router[_0x31db('0xa')]('/:id/run',auth[_0x31db('0xb')](),controller[_0x31db('0x11')]);router[_0x31db('0xa')](_0x31db('0x12'),auth[_0x31db('0xb')](),controller['query']);router[_0x31db('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x31db('0x14')](_0x31db('0xd'),auth[_0x31db('0xb')](),controller[_0x31db('0x15')]);router['delete'](_0x31db('0xd'),auth[_0x31db('0xb')](),controller[_0x31db('0x16')]);module[_0x31db('0x17')]=router; \ No newline at end of file +var _0x51f7=['run','/:id/query','query','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated','get','/:id','show','/:id/preview','preview','/:id/run'];(function(_0x2fa371,_0x50a68b){var _0x36744a=function(_0x4650bc){while(--_0x4650bc){_0x2fa371['push'](_0x2fa371['shift']());}};_0x36744a(++_0x50a68b);}(_0x51f7,0x9f));var _0x751f=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0x51f7[_0x489b87];return _0x1823b6;};'use strict';var multer=require('multer');var util=require(_0x751f('0x0'));var path=require(_0x751f('0x1'));var timeout=require(_0x751f('0x2'));var express=require(_0x751f('0x3'));var router=express[_0x751f('0x4')]();var fs_extra=require(_0x751f('0x5'));var auth=require(_0x751f('0x6'));var interaction=require(_0x751f('0x7'));var config=require('../../config/environment');var controller=require(_0x751f('0x8'));router['get']('/',auth[_0x751f('0x9')](),controller['index']);router[_0x751f('0xa')](_0x751f('0xb'),auth[_0x751f('0x9')](),controller[_0x751f('0xc')]);router[_0x751f('0xa')](_0x751f('0xd'),auth[_0x751f('0x9')](),controller[_0x751f('0xe')]);router['get'](_0x751f('0xf'),auth[_0x751f('0x9')](),controller[_0x751f('0x10')]);router[_0x751f('0xa')](_0x751f('0x11'),auth['isAuthenticated'](),controller[_0x751f('0x12')]);router[_0x751f('0x13')]('/',auth[_0x751f('0x9')](),controller[_0x751f('0x14')]);router[_0x751f('0x15')](_0x751f('0xb'),auth[_0x751f('0x9')](),controller[_0x751f('0x16')]);router[_0x751f('0x17')](_0x751f('0xb'),auth[_0x751f('0x9')](),controller[_0x751f('0x18')]);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 beea5ff..859f2b8 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 _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x5a7dd3,_0x26b7cf){var _0x2f4d07=function(_0x280510){while(--_0x280510){_0x5a7dd3['push'](_0x5a7dd3['shift']());}};_0x2f4d07(++_0x26b7cf);}(_0xdc97,0x13b));var _0x7dc9=function(_0x534714,_0x2abe44){_0x534714=_0x534714-0x0;var _0x5c1c6f=_0xdc97[_0x534714];return _0x5c1c6f;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}}; \ No newline at end of file +var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x5aa9da,_0x2a08f4){var _0x412c52=function(_0xf23e19){while(--_0xf23e19){_0x5aa9da['push'](_0x5aa9da['shift']());}};_0x412c52(++_0x2a08f4);}(_0x3eea,0x1ca));var _0xa3ee=function(_0xf2f21e,_0x966cf2){_0xf2f21e=_0xf2f21e-0x0;var _0x1c5925=_0x3eea[_0xf2f21e];return _0x1c5925;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index a28e344..91f7786 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 _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x3073ac,_0x29dc2b){var _0x31d3bd=function(_0x163b3b){while(--_0x163b3b){_0x3073ac['push'](_0x3073ac['shift']());}};_0x31d3bd(++_0x29dc2b);}(_0xda19,0xd5));var _0x9da1=function(_0x20cbc2,_0xf68490){_0x20cbc2=_0x20cbc2-0x0;var _0x28b0b7=_0xda19[_0x20cbc2];return _0x28b0b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));}; \ No newline at end of file +var _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%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)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6d38,0x1ef));var _0x86d3=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x6d38[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index a092132..31cb616 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 _0xe32d=['rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','moment','request-promise','path'];(function(_0xf1acc1,_0x58a444){var _0x364215=function(_0x3f333c){while(--_0x3f333c){_0xf1acc1['push'](_0xf1acc1['shift']());}};_0x364215(++_0x58a444);}(_0xe32d,0x92));var _0xde32=function(_0x21596a,_0x597558){_0x21596a=_0x21596a-0x0;var _0x207c9b=_0xe32d[_0x21596a];return _0x207c9b;};'use strict';var _=require(_0xde32('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xde32('0x1'));var BPromise=require('bluebird');var rp=require(_0xde32('0x2'));var fs=require('fs');var path=require(_0xde32('0x3'));var rimraf=require(_0xde32('0x4'));var config=require(_0xde32('0x5'));var attributes=require(_0xde32('0x6'));module['exports']=function(_0x17677d,_0xd2876b){return _0x17677d[_0xde32('0x7')](_0xde32('0x8'),attributes,{'tableName':_0xde32('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x741d=['path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','moment','request-promise'];(function(_0x8f6fa5,_0x320980){var _0x2e1201=function(_0x92e939){while(--_0x92e939){_0x8f6fa5['push'](_0x8f6fa5['shift']());}};_0x2e1201(++_0x320980);}(_0x741d,0xef));var _0xd741=function(_0x57d452,_0x1c7d16){_0x57d452=_0x57d452-0x0;var _0x2e12d2=_0x741d[_0x57d452];return _0x2e12d2;};'use strict';var _=require('lodash');var util=require(_0xd741('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd741('0x1'));var BPromise=require('bluebird');var rp=require(_0xd741('0x2'));var fs=require('fs');var path=require(_0xd741('0x3'));var rimraf=require(_0xd741('0x4'));var config=require(_0xd741('0x5'));var attributes=require(_0xd741('0x6'));module[_0xd741('0x7')]=function(_0x164197,_0x5a67e4){return _0x164197[_0xd741('0x8')](_0xd741('0x9'),attributes,{'tableName':_0xd741('0xa'),'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 27bd772..9130260 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 _0x3f8f=['AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x3f8f,0x1cb));var _0xf3f8=function(_0x1c8fd3,_0x57cb04){_0x1c8fd3=_0x1c8fd3-0x0;var _0x2592cd=_0x3f8f[_0x1c8fd3];return _0x2592cd;};'use strict';var _=require(_0xf3f8('0x0'));var util=require('util');var moment=require(_0xf3f8('0x1'));var BPromise=require(_0xf3f8('0x2'));var rs=require(_0xf3f8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf3f8('0x4'))['db'];var utils=require(_0xf3f8('0x5'));var logger=require(_0xf3f8('0x6'))('rpc');var config=require(_0xf3f8('0x7'));var jayson=require(_0xf3f8('0x8'));var client=jayson[_0xf3f8('0x9')][_0xf3f8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4663a9,_0x5997ca,_0xdba019){return new BPromise(function(_0x2bb008,_0x1e3f24){return client['request'](_0x4663a9,_0xdba019)[_0xf3f8('0xb')](function(_0xfd5b63){logger[_0xf3f8('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5997ca,'request\x20sent');logger[_0xf3f8('0xd')](_0xf3f8('0xe'),_0x5997ca,'request\x20sent',JSON['stringify'](_0xfd5b63));if(_0xfd5b63[_0xf3f8('0xf')]){if(_0xfd5b63[_0xf3f8('0xf')]['code']===0x1f4){logger[_0xf3f8('0xf')](_0xf3f8('0x10'),_0x5997ca,_0xfd5b63[_0xf3f8('0xf')][_0xf3f8('0x11')]);return _0x1e3f24(_0xfd5b63[_0xf3f8('0xf')][_0xf3f8('0x11')]);}logger[_0xf3f8('0xf')](_0xf3f8('0x10'),_0x5997ca,_0xfd5b63[_0xf3f8('0xf')][_0xf3f8('0x11')]);return _0x2bb008(_0xfd5b63[_0xf3f8('0xf')][_0xf3f8('0x11')]);}else{logger[_0xf3f8('0xc')](_0xf3f8('0x10'),_0x5997ca,'request\x20sent');_0x2bb008(_0xfd5b63[_0xf3f8('0x12')][_0xf3f8('0x11')]);}})['catch'](function(_0x44b38d){logger[_0xf3f8('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5997ca,_0x44b38d);_0x1e3f24(_0x44b38d);});});} \ No newline at end of file +var _0xcfca=['result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x28ccd4,_0x83c4c){var _0x220be4=function(_0x2669db){while(--_0x2669db){_0x28ccd4['push'](_0x28ccd4['shift']());}};_0x220be4(++_0x83c4c);}(_0xcfca,0x152));var _0xacfc=function(_0x316a8c,_0x187236){_0x316a8c=_0x316a8c-0x0;var _0xf54b36=_0xcfca[_0x316a8c];return _0xf54b36;};'use strict';var _=require(_0xacfc('0x0'));var util=require(_0xacfc('0x1'));var moment=require(_0xacfc('0x2'));var BPromise=require(_0xacfc('0x3'));var rs=require(_0xacfc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xacfc('0x5'));var logger=require(_0xacfc('0x6'))(_0xacfc('0x7'));var config=require(_0xacfc('0x8'));var jayson=require(_0xacfc('0x9'));var client=jayson[_0xacfc('0xa')][_0xacfc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bc9de,_0x2188da,_0x49c779){return new BPromise(function(_0x5e6e8e,_0x7263de){return client['request'](_0x5bc9de,_0x49c779)['then'](function(_0x7420b4){logger[_0xacfc('0xc')](_0xacfc('0xd'),_0x2188da,_0xacfc('0xe'));logger['debug'](_0xacfc('0xf'),_0x2188da,'request\x20sent',JSON['stringify'](_0x7420b4));if(_0x7420b4[_0xacfc('0x10')]){if(_0x7420b4[_0xacfc('0x10')][_0xacfc('0x11')]===0x1f4){logger['error'](_0xacfc('0xd'),_0x2188da,_0x7420b4[_0xacfc('0x10')][_0xacfc('0x12')]);return _0x7263de(_0x7420b4[_0xacfc('0x10')][_0xacfc('0x12')]);}logger[_0xacfc('0x10')](_0xacfc('0xd'),_0x2188da,_0x7420b4['error']['message']);return _0x5e6e8e(_0x7420b4[_0xacfc('0x10')][_0xacfc('0x12')]);}else{logger['info'](_0xacfc('0xd'),_0x2188da,_0xacfc('0xe'));_0x5e6e8e(_0x7420b4[_0xacfc('0x13')][_0xacfc('0x12')]);}})[_0xacfc('0x14')](function(_0x23a610){logger[_0xacfc('0x10')](_0xacfc('0xd'),_0x2188da,_0x23a610);_0x7263de(_0x23a610);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 7df7dc8..86bda7a 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 _0x3402=['express','Router','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','post','put','destroy','exports','multer','path'];(function(_0x2e26f5,_0x226f4d){var _0x2f9b1c=function(_0x4825e4){while(--_0x4825e4){_0x2e26f5['push'](_0x2e26f5['shift']());}};_0x2f9b1c(++_0x226f4d);}(_0x3402,0x163));var _0x2340=function(_0x6b7e40,_0xe65904){_0x6b7e40=_0x6b7e40-0x0;var _0xe33bb4=_0x3402[_0x6b7e40];return _0xe33bb4;};'use strict';var multer=require(_0x2340('0x0'));var util=require('util');var path=require(_0x2340('0x1'));var timeout=require('connect-timeout');var express=require(_0x2340('0x2'));var router=express[_0x2340('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2340('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2340('0x5'));var controller=require(_0x2340('0x6'));router[_0x2340('0x7')]('/',auth[_0x2340('0x8')](),controller[_0x2340('0x9')]);router[_0x2340('0x7')](_0x2340('0xa'),auth[_0x2340('0x8')](),controller[_0x2340('0xb')]);router[_0x2340('0x7')](_0x2340('0xc'),auth['isAuthenticated'](),controller[_0x2340('0xd')]);router[_0x2340('0x7')]('/:id/run',auth[_0x2340('0x8')](),controller[_0x2340('0xe')]);router['get'](_0x2340('0xf'),auth[_0x2340('0x8')](),controller[_0x2340('0x10')]);router[_0x2340('0x11')]('/',auth[_0x2340('0x8')](),controller['create']);router[_0x2340('0x12')](_0x2340('0xa'),auth[_0x2340('0x8')](),controller['update']);router['delete']('/:id',auth[_0x2340('0x8')](),controller[_0x2340('0x13')]);module[_0x2340('0x14')]=router; \ No newline at end of file +var _0x66ef=['./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/run','query','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x4581cb,_0x166469){var _0x11593f=function(_0x4447bd){while(--_0x4447bd){_0x4581cb['push'](_0x4581cb['shift']());}};_0x11593f(++_0x166469);}(_0x66ef,0x123));var _0xf66e=function(_0x2283e2,_0x49043f){_0x2283e2=_0x2283e2-0x0;var _0x1fe85b=_0x66ef[_0x2283e2];return _0x1fe85b;};'use strict';var multer=require(_0xf66e('0x0'));var util=require(_0xf66e('0x1'));var path=require(_0xf66e('0x2'));var timeout=require(_0xf66e('0x3'));var express=require(_0xf66e('0x4'));var router=express[_0xf66e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf66e('0x6'));var config=require(_0xf66e('0x7'));var controller=require(_0xf66e('0x8'));router[_0xf66e('0x9')]('/',auth[_0xf66e('0xa')](),controller[_0xf66e('0xb')]);router[_0xf66e('0x9')](_0xf66e('0xc'),auth[_0xf66e('0xa')](),controller[_0xf66e('0xd')]);router[_0xf66e('0x9')]('/:id/preview',auth[_0xf66e('0xa')](),controller[_0xf66e('0xe')]);router['get'](_0xf66e('0xf'),auth[_0xf66e('0xa')](),controller['run']);router[_0xf66e('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0xf66e('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf66e('0x11')]);router[_0xf66e('0x12')](_0xf66e('0xc'),auth[_0xf66e('0xa')](),controller[_0xf66e('0x13')]);router[_0xf66e('0x14')](_0xf66e('0xc'),auth[_0xf66e('0xa')](),controller[_0xf66e('0x15')]);module[_0xf66e('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 1888842..c50d202 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 _0xf126=['exports','STRING','ENUM','csv','pdf','DATE','scheduled','manual','UNSIGNED','sequelize','moment'];(function(_0x587e10,_0x29b3a9){var _0x203454=function(_0x18dfc6){while(--_0x18dfc6){_0x587e10['push'](_0x587e10['shift']());}};_0x203454(++_0x29b3a9);}(_0xf126,0x11c));var _0x6f12=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xf126[_0x2cf2e9];return _0xd3670d;};'use strict';var Sequelize=require(_0x6f12('0x0'));var moment=require(_0x6f12('0x1'));module[_0x6f12('0x2')]={'name':{'type':Sequelize[_0x6f12('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x6f12('0x4')](_0x6f12('0x5'),_0x6f12('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0x6f12('0x5')},'savename':{'type':Sequelize[_0x6f12('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x6f12('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x6f12('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x6f12('0x4')]('manual',_0x6f12('0x8')),'allowNull':![],'defaultValue':_0x6f12('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x6f12('0xa')]},'reportType':{'type':Sequelize[_0x6f12('0x3')]}}; \ No newline at end of file +var _0x0301=['sequelize','moment','STRING','ENUM','csv','pdf','xlsx','DATE','manual','INTEGER','UNSIGNED'];(function(_0x1a9713,_0x2197de){var _0xf59b37=function(_0x193709){while(--_0x193709){_0x1a9713['push'](_0x1a9713['shift']());}};_0xf59b37(++_0x2197de);}(_0x0301,0xe7));var _0x1030=function(_0x2cb91f,_0x406af5){_0x2cb91f=_0x2cb91f-0x0;var _0x51c7e3=_0x0301[_0x2cb91f];return _0x51c7e3;};'use strict';var Sequelize=require(_0x1030('0x0'));var moment=require(_0x1030('0x1'));module['exports']={'name':{'type':Sequelize[_0x1030('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x1030('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x1030('0x3')](_0x1030('0x4'),_0x1030('0x5'),_0x1030('0x6')),'allowNull':![],'defaultValue':_0x1030('0x4')},'savename':{'type':Sequelize[_0x1030('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1030('0x7')]},'endDate':{'type':Sequelize[_0x1030('0x7')]},'status':{'type':Sequelize[_0x1030('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual','scheduled'),'allowNull':![],'defaultValue':_0x1030('0x8')},'reportId':{'type':Sequelize[_0x1030('0x9')](0xb)[_0x1030('0xa')]},'reportType':{'type':Sequelize[_0x1030('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 1fa6022..ef8add4 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 _0x6cad=['create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ExtractedReports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','format','%s.%s','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','limit','undefined','offset','count','set','Content-Range','json','apply','save','update','then','destroy','get','stack','name','index','map','AnalyticExtractedReport','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','keys','rawAttributes','length'];(function(_0x497141,_0x365823){var _0x281aa5=function(_0x42a167){while(--_0x42a167){_0x497141['push'](_0x497141['shift']());}};_0x281aa5(++_0x365823);}(_0x6cad,0x78));var _0xd6ca=function(_0x592110,_0x4f56a1){_0x592110=_0x592110-0x0;var _0x1a01c5=_0x6cad[_0x592110];return _0x1a01c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6ca('0x0'));var zipdir=require(_0xd6ca('0x1'));var jsonpatch=require(_0xd6ca('0x2'));var rp=require(_0xd6ca('0x3'));var moment=require(_0xd6ca('0x4'));var BPromise=require(_0xd6ca('0x5'));var Mustache=require(_0xd6ca('0x6'));var util=require(_0xd6ca('0x7'));var path=require(_0xd6ca('0x8'));var sox=require(_0xd6ca('0x9'));var csv=require('to-csv');var ejs=require(_0xd6ca('0xa'));var fs=require('fs');var fs_extra=require(_0xd6ca('0xb'));var _=require(_0xd6ca('0xc'));var squel=require(_0xd6ca('0xd'));var crypto=require(_0xd6ca('0xe'));var jsforce=require(_0xd6ca('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd6ca('0x10'));var Redis=require(_0xd6ca('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd6ca('0x12'));var hardwareService=require(_0xd6ca('0x13'));var logger=require('../../config/logger')(_0xd6ca('0x14'));var utils=require(_0xd6ca('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd6ca('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x922eb6,_0x2fa82b){_0x2fa82b=_0x2fa82b||0xcc;return function(_0x365c98){if(_0x365c98){return _0x922eb6[_0xd6ca('0x17')](_0x2fa82b);}return _0x922eb6['status'](_0x2fa82b)['end']();};}function respondWithResult(_0x4b58f1,_0x43bb00){_0x43bb00=_0x43bb00||0xc8;return function(_0x296ba7){if(_0x296ba7){return _0x4b58f1[_0xd6ca('0x18')](_0x43bb00)['json'](_0x296ba7);}};}function respondWithFilteredResult(_0x553d01,_0x46c69d){return function(_0xf5b04b){if(_0xf5b04b){var _0x8aff05=typeof _0x46c69d['offset']==='undefined'&&typeof _0x46c69d[_0xd6ca('0x19')]===_0xd6ca('0x1a');var _0x32d86c=_0xf5b04b['count'];var _0x51d48d=_0x8aff05?0x0:_0x46c69d[_0xd6ca('0x1b')];var _0x1ddd61=_0x8aff05?_0xf5b04b[_0xd6ca('0x1c')]:_0x46c69d[_0xd6ca('0x1b')]+_0x46c69d[_0xd6ca('0x19')];var _0x49f457;if(_0x1ddd61>=_0x32d86c){_0x1ddd61=_0x32d86c;_0x49f457=0xc8;}else{_0x49f457=0xce;}_0x553d01[_0xd6ca('0x18')](_0x49f457);return _0x553d01[_0xd6ca('0x1d')](_0xd6ca('0x1e'),_0x51d48d+'-'+_0x1ddd61+'/'+_0x32d86c)[_0xd6ca('0x1f')](_0xf5b04b);}return null;};}function patchUpdates(_0xbefee0){return function(_0x281504){try{jsonpatch[_0xd6ca('0x20')](_0x281504,_0xbefee0,!![]);}catch(_0x221378){return BPromise['reject'](_0x221378);}return _0x281504[_0xd6ca('0x21')]();};}function saveUpdates(_0x469bb0,_0xcc120f){return function(_0x2122f8){if(_0x2122f8){return _0x2122f8[_0xd6ca('0x22')](_0x469bb0)[_0xd6ca('0x23')](function(_0x4e7fff){return _0x4e7fff;});}return null;};}function removeEntity(_0x317a36,_0x57ee58){return function(_0x59df78){if(_0x59df78){return _0x59df78[_0xd6ca('0x24')]()[_0xd6ca('0x23')](function(){var _0x5545ca=_0x59df78[_0xd6ca('0x25')]({'plain':!![]});var _0x2e6868='ExtractedReports';return db['UserProfileResource'][_0xd6ca('0x24')]({'where':{'type':_0x2e6868,'resourceId':_0x5545ca['id']}})[_0xd6ca('0x23')](function(){return _0x59df78;});})[_0xd6ca('0x23')](function(){_0x317a36[_0xd6ca('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28ffeb,_0x4aea19){return function(_0x409778){if(!_0x409778){_0x28ffeb[_0xd6ca('0x17')](0x194);}return _0x409778;};}function handleError(_0x1598af,_0x438043){_0x438043=_0x438043||0x1f4;return function(_0xf466e){logger['error'](_0xf466e[_0xd6ca('0x26')]);if(_0xf466e['name']){delete _0xf466e[_0xd6ca('0x27')];}_0x1598af['status'](_0x438043)['send'](_0xf466e);};}exports[_0xd6ca('0x28')]=function(_0x38c736,_0x3aff06){var _0x408b92={},_0x2b9405={},_0xd61588={'count':0x0,'rows':[]};var _0x16c1da=_[_0xd6ca('0x29')](db[_0xd6ca('0x2a')]['rawAttributes'],function(_0x59cb03){return{'name':_0x59cb03[_0xd6ca('0x2b')],'type':_0x59cb03[_0xd6ca('0x2c')]['key']};});_0x2b9405[_0xd6ca('0x2d')]=_['map'](_0x16c1da,_0xd6ca('0x27'));_0x2b9405[_0xd6ca('0x2e')]=_['keys'](_0x38c736[_0xd6ca('0x2e')]);_0x2b9405[_0xd6ca('0x2f')]=_[_0xd6ca('0x30')](_0x2b9405[_0xd6ca('0x2d')],_0x2b9405['query']);_0x408b92['attributes']=_[_0xd6ca('0x30')](_0x2b9405['model'],qs[_0xd6ca('0x31')](_0x38c736[_0xd6ca('0x2e')][_0xd6ca('0x31')]));_0x408b92[_0xd6ca('0x32')]=_0x408b92['attributes']['length']?_0x408b92[_0xd6ca('0x32')]:_0x2b9405[_0xd6ca('0x2d')];if(!_0x38c736['query'][_0xd6ca('0x33')]('nolimit')){_0x408b92[_0xd6ca('0x19')]=qs[_0xd6ca('0x19')](_0x38c736[_0xd6ca('0x2e')][_0xd6ca('0x19')]);_0x408b92[_0xd6ca('0x1b')]=qs[_0xd6ca('0x1b')](_0x38c736[_0xd6ca('0x2e')][_0xd6ca('0x1b')]);}_0x408b92[_0xd6ca('0x34')]=qs[_0xd6ca('0x35')](_0x38c736[_0xd6ca('0x2e')][_0xd6ca('0x35')]);_0x408b92[_0xd6ca('0x36')]=qs['filters'](_[_0xd6ca('0x37')](_0x38c736[_0xd6ca('0x2e')],_0x2b9405['filters']),_0x16c1da);if(_0x38c736[_0xd6ca('0x2e')][_0xd6ca('0x38')]){_0x408b92[_0xd6ca('0x36')]=_['merge'](_0x408b92[_0xd6ca('0x36')],{'$or':_['map'](_0x16c1da,function(_0x1962b2){if(_0x1962b2[_0xd6ca('0x2c')]!=='VIRTUAL'){var _0x574521={};_0x574521[_0x1962b2['name']]={'$like':'%'+_0x38c736[_0xd6ca('0x2e')][_0xd6ca('0x38')]+'%'};return _0x574521;}})});}_0x408b92=_[_0xd6ca('0x39')]({},_0x408b92,_0x38c736[_0xd6ca('0x3a')]);var _0x4c5cc4={'where':_0x408b92[_0xd6ca('0x36')]};return db[_0xd6ca('0x2a')][_0xd6ca('0x1c')](_0x4c5cc4)[_0xd6ca('0x23')](function(_0x55d62a){_0xd61588[_0xd6ca('0x1c')]=_0x55d62a;if(_0x38c736[_0xd6ca('0x2e')][_0xd6ca('0x3b')]){_0x408b92[_0xd6ca('0x3c')]=[{'all':!![]}];}return db[_0xd6ca('0x2a')][_0xd6ca('0x3d')](_0x408b92);})[_0xd6ca('0x23')](function(_0x1ee404){_0xd61588['rows']=_0x1ee404;return _0xd61588;})[_0xd6ca('0x23')](respondWithFilteredResult(_0x3aff06,_0x408b92))[_0xd6ca('0x3e')](handleError(_0x3aff06,null));};exports['show']=function(_0x4978bf,_0x377916){var _0x1387dd={'raw':!![],'where':{'id':_0x4978bf['params']['id']}},_0x1225a6={};_0x1225a6[_0xd6ca('0x2d')]=_[_0xd6ca('0x3f')](db[_0xd6ca('0x2a')][_0xd6ca('0x40')]);_0x1225a6['query']=_[_0xd6ca('0x3f')](_0x4978bf[_0xd6ca('0x2e')]);_0x1225a6[_0xd6ca('0x2f')]=_[_0xd6ca('0x30')](_0x1225a6['model'],_0x1225a6['query']);_0x1387dd[_0xd6ca('0x32')]=_[_0xd6ca('0x30')](_0x1225a6[_0xd6ca('0x2d')],qs[_0xd6ca('0x31')](_0x4978bf['query'][_0xd6ca('0x31')]));_0x1387dd[_0xd6ca('0x32')]=_0x1387dd[_0xd6ca('0x32')][_0xd6ca('0x41')]?_0x1387dd[_0xd6ca('0x32')]:_0x1225a6[_0xd6ca('0x2d')];if(_0x4978bf[_0xd6ca('0x2e')][_0xd6ca('0x3b')]){_0x1387dd[_0xd6ca('0x3c')]=[{'all':!![]}];}_0x1387dd=_[_0xd6ca('0x39')]({},_0x1387dd,_0x4978bf[_0xd6ca('0x3a')]);return db['AnalyticExtractedReport']['find'](_0x1387dd)[_0xd6ca('0x23')](handleEntityNotFound(_0x377916,null))[_0xd6ca('0x23')](respondWithResult(_0x377916,null))[_0xd6ca('0x3e')](handleError(_0x377916,null));};exports[_0xd6ca('0x42')]=function(_0x1f7062,_0x35356c){return db['AnalyticExtractedReport'][_0xd6ca('0x42')](_0x1f7062['body'],{})['then'](function(_0x81c2c8){var _0x32517e=_0x1f7062['user'][_0xd6ca('0x25')]({'plain':!![]});if(!_0x32517e)throw new Error(_0xd6ca('0x43'));if(_0x32517e['role']===_0xd6ca('0x44')){var _0x544970=_0x81c2c8[_0xd6ca('0x25')]({'plain':!![]});var _0x55a58e=_0xd6ca('0x45');return db[_0xd6ca('0x46')][_0xd6ca('0x47')]({'where':{'name':_0x55a58e,'userProfileId':_0x32517e[_0xd6ca('0x48')]},'raw':!![]})[_0xd6ca('0x23')](function(_0x1f7cf9){if(_0x1f7cf9&&_0x1f7cf9[_0xd6ca('0x49')]===0x0){return db[_0xd6ca('0x4a')][_0xd6ca('0x42')]({'name':_0x544970[_0xd6ca('0x27')],'resourceId':_0x544970['id'],'type':_0x1f7cf9[_0xd6ca('0x27')],'sectionId':_0x1f7cf9['id']},{})[_0xd6ca('0x23')](function(){return _0x81c2c8;});}else{return _0x81c2c8;}})['catch'](function(_0x192a63){logger[_0xd6ca('0x4b')](_0xd6ca('0x4c'),_0x192a63);throw _0x192a63;});}return _0x81c2c8;})[_0xd6ca('0x23')](respondWithResult(_0x35356c,0xc9))[_0xd6ca('0x3e')](handleError(_0x35356c,null));};exports[_0xd6ca('0x22')]=function(_0x4ffcce,_0x43ccdd){if(_0x4ffcce['body']['id']){delete _0x4ffcce['body']['id'];}return db[_0xd6ca('0x2a')]['find']({'where':{'id':_0x4ffcce[_0xd6ca('0x4d')]['id']}})[_0xd6ca('0x23')](handleEntityNotFound(_0x43ccdd,null))[_0xd6ca('0x23')](saveUpdates(_0x4ffcce[_0xd6ca('0x4e')],null))['then'](respondWithResult(_0x43ccdd,null))[_0xd6ca('0x3e')](handleError(_0x43ccdd,null));};exports[_0xd6ca('0x24')]=function(_0x28271d,_0x15005e){return db[_0xd6ca('0x2a')][_0xd6ca('0x47')]({'where':{'id':_0x28271d[_0xd6ca('0x4d')]['id']}})[_0xd6ca('0x23')](handleEntityNotFound(_0x15005e,null))[_0xd6ca('0x23')](removeEntity(_0x15005e,null))['catch'](handleError(_0x15005e,null));};exports[_0xd6ca('0x4f')]=function(_0x1d21a4,_0x1b77bc,_0x3501bb){return db[_0xd6ca('0x2a')][_0xd6ca('0x47')]({'where':{'id':_0x1d21a4[_0xd6ca('0x4d')]['id']},'attributes':[_0xd6ca('0x27'),_0xd6ca('0x50'),_0xd6ca('0x51'),_0xd6ca('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x1b77bc,null))[_0xd6ca('0x23')](function(_0x15bf18){if(_0x15bf18){if(!fs[_0xd6ca('0x53')](path[_0xd6ca('0x54')](config[_0xd6ca('0x55')],_0xd6ca('0x56'),_0x15bf18['savename']))){throw new db[(_0xd6ca('0x57'))][(_0xd6ca('0x58'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x1d21a4[_0xd6ca('0x2e')][_0xd6ca('0x59')]){return _0x1b77bc[_0xd6ca('0x17')](0xc8);}return _0x1b77bc[_0xd6ca('0x4f')](path[_0xd6ca('0x54')](config[_0xd6ca('0x55')],'server/files/reports',_0x15bf18[_0xd6ca('0x51')]),util[_0xd6ca('0x5a')](_0xd6ca('0x5b'),_0x15bf18['basename']||_0x15bf18[_0xd6ca('0x27')],_0x15bf18[_0xd6ca('0x52')][_0xd6ca('0x5c')]()));}})['catch'](handleError(_0x1b77bc,null));}; \ No newline at end of file +var _0xd035=['download','basename','savename','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','output','toLowerCase','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','get','ExtractedReports','UserProfileResource','destroy','end','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation'];(function(_0x585e6c,_0x456254){var _0x372276=function(_0x3d7e23){while(--_0x3d7e23){_0x585e6c['push'](_0x585e6c['shift']());}};_0x372276(++_0x456254);}(_0xd035,0x12c));var _0x5d03=function(_0x173452,_0x3aa870){_0x173452=_0x173452-0x0;var _0xee3fd0=_0xd035[_0x173452];return _0xee3fd0;};'use strict';var emlformat=require(_0x5d03('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d03('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d03('0x2'));var moment=require(_0x5d03('0x3'));var BPromise=require(_0x5d03('0x4'));var Mustache=require('mustache');var util=require(_0x5d03('0x5'));var path=require(_0x5d03('0x6'));var sox=require(_0x5d03('0x7'));var csv=require('to-csv');var ejs=require(_0x5d03('0x8'));var fs=require('fs');var fs_extra=require(_0x5d03('0x9'));var _=require(_0x5d03('0xa'));var squel=require(_0x5d03('0xb'));var crypto=require(_0x5d03('0xc'));var jsforce=require(_0x5d03('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5d03('0xe'));var Papa=require(_0x5d03('0xf'));var Redis=require('ioredis');var authService=require(_0x5d03('0x10'));var qs=require(_0x5d03('0x11'));var as=require(_0x5d03('0x12'));var hardwareService=require(_0x5d03('0x13'));var logger=require('../../config/logger')(_0x5d03('0x14'));var utils=require(_0x5d03('0x15'));var config=require(_0x5d03('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5d03('0x17'))['db'];function respondWithStatusCode(_0x416161,_0xe259d5){_0xe259d5=_0xe259d5||0xcc;return function(_0x22ce2e){if(_0x22ce2e){return _0x416161[_0x5d03('0x18')](_0xe259d5);}return _0x416161[_0x5d03('0x19')](_0xe259d5)['end']();};}function respondWithResult(_0x3b683e,_0x1a9caa){_0x1a9caa=_0x1a9caa||0xc8;return function(_0x10595c){if(_0x10595c){return _0x3b683e['status'](_0x1a9caa)[_0x5d03('0x1a')](_0x10595c);}};}function respondWithFilteredResult(_0x3bb924,_0x36f4b5){return function(_0x30f691){if(_0x30f691){var _0x33d874=typeof _0x36f4b5[_0x5d03('0x1b')]===_0x5d03('0x1c')&&typeof _0x36f4b5['limit']==='undefined';var _0x4ec4f1=_0x30f691[_0x5d03('0x1d')];var _0x9dcf86=_0x33d874?0x0:_0x36f4b5[_0x5d03('0x1b')];var _0x3a9fab=_0x33d874?_0x30f691[_0x5d03('0x1d')]:_0x36f4b5['offset']+_0x36f4b5[_0x5d03('0x1e')];var _0x4825bd;if(_0x3a9fab>=_0x4ec4f1){_0x3a9fab=_0x4ec4f1;_0x4825bd=0xc8;}else{_0x4825bd=0xce;}_0x3bb924[_0x5d03('0x19')](_0x4825bd);return _0x3bb924[_0x5d03('0x1f')](_0x5d03('0x20'),_0x9dcf86+'-'+_0x3a9fab+'/'+_0x4ec4f1)[_0x5d03('0x1a')](_0x30f691);}return null;};}function patchUpdates(_0x43bca4){return function(_0x3c7817){try{jsonpatch[_0x5d03('0x21')](_0x3c7817,_0x43bca4,!![]);}catch(_0x1c70df){return BPromise['reject'](_0x1c70df);}return _0x3c7817[_0x5d03('0x22')]();};}function saveUpdates(_0xfae50b,_0x3e884e){return function(_0x537627){if(_0x537627){return _0x537627[_0x5d03('0x23')](_0xfae50b)[_0x5d03('0x24')](function(_0x16e033){return _0x16e033;});}return null;};}function removeEntity(_0x1e5b01,_0xe7db1){return function(_0x4f4e17){if(_0x4f4e17){return _0x4f4e17['destroy']()[_0x5d03('0x24')](function(){var _0x5a0449=_0x4f4e17[_0x5d03('0x25')]({'plain':!![]});var _0x15589d=_0x5d03('0x26');return db[_0x5d03('0x27')][_0x5d03('0x28')]({'where':{'type':_0x15589d,'resourceId':_0x5a0449['id']}})['then'](function(){return _0x4f4e17;});})[_0x5d03('0x24')](function(){_0x1e5b01[_0x5d03('0x19')](0xcc)[_0x5d03('0x29')]();});}};}function handleEntityNotFound(_0x31a03e,_0x35975f){return function(_0x38100a){if(!_0x38100a){_0x31a03e[_0x5d03('0x18')](0x194);}return _0x38100a;};}function handleError(_0x4f5eba,_0x909aaa){_0x909aaa=_0x909aaa||0x1f4;return function(_0x568b3c){logger[_0x5d03('0x2a')](_0x568b3c[_0x5d03('0x2b')]);if(_0x568b3c[_0x5d03('0x2c')]){delete _0x568b3c[_0x5d03('0x2c')];}_0x4f5eba[_0x5d03('0x19')](_0x909aaa)[_0x5d03('0x2d')](_0x568b3c);};}exports['index']=function(_0x541431,_0x38e24f){var _0x5c59c5={},_0x44f3ac={},_0x294158={'count':0x0,'rows':[]};var _0x4c0350=_[_0x5d03('0x2e')](db[_0x5d03('0x2f')][_0x5d03('0x30')],function(_0x4ab344){return{'name':_0x4ab344[_0x5d03('0x31')],'type':_0x4ab344[_0x5d03('0x32')][_0x5d03('0x33')]};});_0x44f3ac['model']=_['map'](_0x4c0350,_0x5d03('0x2c'));_0x44f3ac['query']=_['keys'](_0x541431[_0x5d03('0x34')]);_0x44f3ac[_0x5d03('0x35')]=_[_0x5d03('0x36')](_0x44f3ac[_0x5d03('0x37')],_0x44f3ac[_0x5d03('0x34')]);_0x5c59c5[_0x5d03('0x38')]=_[_0x5d03('0x36')](_0x44f3ac[_0x5d03('0x37')],qs[_0x5d03('0x39')](_0x541431[_0x5d03('0x34')][_0x5d03('0x39')]));_0x5c59c5[_0x5d03('0x38')]=_0x5c59c5[_0x5d03('0x38')][_0x5d03('0x3a')]?_0x5c59c5['attributes']:_0x44f3ac[_0x5d03('0x37')];if(!_0x541431[_0x5d03('0x34')][_0x5d03('0x3b')](_0x5d03('0x3c'))){_0x5c59c5['limit']=qs['limit'](_0x541431['query'][_0x5d03('0x1e')]);_0x5c59c5[_0x5d03('0x1b')]=qs['offset'](_0x541431[_0x5d03('0x34')][_0x5d03('0x1b')]);}_0x5c59c5[_0x5d03('0x3d')]=qs[_0x5d03('0x3e')](_0x541431[_0x5d03('0x34')]['sort']);_0x5c59c5['where']=qs['filters'](_['pick'](_0x541431[_0x5d03('0x34')],_0x44f3ac[_0x5d03('0x35')]),_0x4c0350);if(_0x541431['query'][_0x5d03('0x3f')]){_0x5c59c5[_0x5d03('0x40')]=_[_0x5d03('0x41')](_0x5c59c5[_0x5d03('0x40')],{'$or':_[_0x5d03('0x2e')](_0x4c0350,function(_0x24d68e){if(_0x24d68e['type']!==_0x5d03('0x42')){var _0xfb043a={};_0xfb043a[_0x24d68e[_0x5d03('0x2c')]]={'$like':'%'+_0x541431['query'][_0x5d03('0x3f')]+'%'};return _0xfb043a;}})});}_0x5c59c5=_['merge']({},_0x5c59c5,_0x541431[_0x5d03('0x43')]);var _0x1cce26={'where':_0x5c59c5[_0x5d03('0x40')]};return db[_0x5d03('0x2f')]['count'](_0x1cce26)[_0x5d03('0x24')](function(_0x2ca4ef){_0x294158[_0x5d03('0x1d')]=_0x2ca4ef;if(_0x541431[_0x5d03('0x34')][_0x5d03('0x44')]){_0x5c59c5[_0x5d03('0x45')]=[{'all':!![]}];}return db[_0x5d03('0x2f')][_0x5d03('0x46')](_0x5c59c5);})[_0x5d03('0x24')](function(_0x19a18d){_0x294158[_0x5d03('0x47')]=_0x19a18d;return _0x294158;})[_0x5d03('0x24')](respondWithFilteredResult(_0x38e24f,_0x5c59c5))['catch'](handleError(_0x38e24f,null));};exports[_0x5d03('0x48')]=function(_0x4347f7,_0x32d853){var _0x4aa47e={'raw':!![],'where':{'id':_0x4347f7[_0x5d03('0x49')]['id']}},_0x19b405={};_0x19b405[_0x5d03('0x37')]=_[_0x5d03('0x4a')](db['AnalyticExtractedReport'][_0x5d03('0x30')]);_0x19b405[_0x5d03('0x34')]=_['keys'](_0x4347f7[_0x5d03('0x34')]);_0x19b405['filters']=_[_0x5d03('0x36')](_0x19b405[_0x5d03('0x37')],_0x19b405[_0x5d03('0x34')]);_0x4aa47e['attributes']=_['intersection'](_0x19b405[_0x5d03('0x37')],qs[_0x5d03('0x39')](_0x4347f7[_0x5d03('0x34')][_0x5d03('0x39')]));_0x4aa47e['attributes']=_0x4aa47e[_0x5d03('0x38')]['length']?_0x4aa47e[_0x5d03('0x38')]:_0x19b405[_0x5d03('0x37')];if(_0x4347f7[_0x5d03('0x34')]['includeAll']){_0x4aa47e[_0x5d03('0x45')]=[{'all':!![]}];}_0x4aa47e=_[_0x5d03('0x41')]({},_0x4aa47e,_0x4347f7[_0x5d03('0x43')]);return db[_0x5d03('0x2f')]['find'](_0x4aa47e)[_0x5d03('0x24')](handleEntityNotFound(_0x32d853,null))['then'](respondWithResult(_0x32d853,null))[_0x5d03('0x4b')](handleError(_0x32d853,null));};exports[_0x5d03('0x4c')]=function(_0x538d13,_0x23e86e){return db['AnalyticExtractedReport'][_0x5d03('0x4c')](_0x538d13[_0x5d03('0x4d')],{})[_0x5d03('0x24')](function(_0x415a45){var _0x373c6f=_0x538d13[_0x5d03('0x4e')][_0x5d03('0x25')]({'plain':!![]});if(!_0x373c6f)throw new Error(_0x5d03('0x4f'));if(_0x373c6f[_0x5d03('0x50')]===_0x5d03('0x4e')){var _0x18e74a=_0x415a45[_0x5d03('0x25')]({'plain':!![]});var _0x35090c='ExtractedReports';return db[_0x5d03('0x51')][_0x5d03('0x52')]({'where':{'name':_0x35090c,'userProfileId':_0x373c6f['userProfileId']},'raw':!![]})[_0x5d03('0x24')](function(_0x2959cc){if(_0x2959cc&&_0x2959cc[_0x5d03('0x53')]===0x0){return db[_0x5d03('0x27')]['create']({'name':_0x18e74a['name'],'resourceId':_0x18e74a['id'],'type':_0x2959cc[_0x5d03('0x2c')],'sectionId':_0x2959cc['id']},{})[_0x5d03('0x24')](function(){return _0x415a45;});}else{return _0x415a45;}})[_0x5d03('0x4b')](function(_0x9eeb44){logger[_0x5d03('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9eeb44);throw _0x9eeb44;});}return _0x415a45;})[_0x5d03('0x24')](respondWithResult(_0x23e86e,0xc9))[_0x5d03('0x4b')](handleError(_0x23e86e,null));};exports['update']=function(_0x4f8541,_0x46cc29){if(_0x4f8541[_0x5d03('0x4d')]['id']){delete _0x4f8541['body']['id'];}return db[_0x5d03('0x2f')]['find']({'where':{'id':_0x4f8541[_0x5d03('0x49')]['id']}})[_0x5d03('0x24')](handleEntityNotFound(_0x46cc29,null))['then'](saveUpdates(_0x4f8541[_0x5d03('0x4d')],null))[_0x5d03('0x24')](respondWithResult(_0x46cc29,null))[_0x5d03('0x4b')](handleError(_0x46cc29,null));};exports[_0x5d03('0x28')]=function(_0x709ba7,_0x183711){return db[_0x5d03('0x2f')][_0x5d03('0x52')]({'where':{'id':_0x709ba7[_0x5d03('0x49')]['id']}})[_0x5d03('0x24')](handleEntityNotFound(_0x183711,null))[_0x5d03('0x24')](removeEntity(_0x183711,null))[_0x5d03('0x4b')](handleError(_0x183711,null));};exports[_0x5d03('0x54')]=function(_0x23e549,_0x38d016,_0x51a153){return db[_0x5d03('0x2f')][_0x5d03('0x52')]({'where':{'id':_0x23e549[_0x5d03('0x49')]['id']},'attributes':[_0x5d03('0x2c'),_0x5d03('0x55'),_0x5d03('0x56'),'output'],'raw':!![]})[_0x5d03('0x24')](handleEntityNotFound(_0x38d016,null))[_0x5d03('0x24')](function(_0x47924a){if(_0x47924a){if(!fs['existsSync'](path[_0x5d03('0x57')](config[_0x5d03('0x58')],_0x5d03('0x59'),_0x47924a['savename']))){throw new db[(_0x5d03('0x5a'))][(_0x5d03('0x5b'))](_0x5d03('0x5c'));}if(_0x23e549['query'][_0x5d03('0x5d')]){return _0x38d016['sendStatus'](0xc8);}return _0x38d016['download'](path['join'](config['root'],_0x5d03('0x59'),_0x47924a[_0x5d03('0x56')]),util['format']('%s.%s',_0x47924a[_0x5d03('0x55')]||_0x47924a[_0x5d03('0x2c')],_0x47924a[_0x5d03('0x5e')][_0x5d03('0x5f')]()));}})['catch'](handleError(_0x38d016,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index abf9b71..980590c 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 _0x5e9b=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','analytics_extracted_reports','lodash','../../config/logger','bluebird','request-promise'];(function(_0x1d1d09,_0x504d77){var _0x8827e=function(_0x4f3128){while(--_0x4f3128){_0x1d1d09['push'](_0x1d1d09['shift']());}};_0x8827e(++_0x504d77);}(_0x5e9b,0x1aa));var _0xb5e9=function(_0x3a2b29,_0x5481ca){_0x3a2b29=_0x3a2b29-0x0;var _0x3832a6=_0x5e9b[_0x3a2b29];return _0x3832a6;};'use strict';var _=require(_0xb5e9('0x0'));var util=require('util');var logger=require(_0xb5e9('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb5e9('0x2'));var rp=require(_0xb5e9('0x3'));var fs=require('fs');var path=require(_0xb5e9('0x4'));var rimraf=require(_0xb5e9('0x5'));var config=require(_0xb5e9('0x6'));var attributes=require(_0xb5e9('0x7'));module[_0xb5e9('0x8')]=function(_0x2141f2,_0x1e9d57){return _0x2141f2['define']('AnalyticExtractedReport',attributes,{'tableName':_0xb5e9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x93f8=['AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x11154e,_0x1f6679){var _0x62962=function(_0x3943ec){while(--_0x3943ec){_0x11154e['push'](_0x11154e['shift']());}};_0x62962(++_0x1f6679);}(_0x93f8,0x1be));var _0x893f=function(_0x695762,_0x5137e1){_0x695762=_0x695762-0x0;var _0x5241c3=_0x93f8[_0x695762];return _0x5241c3;};'use strict';var _=require(_0x893f('0x0'));var util=require('util');var logger=require(_0x893f('0x1'))(_0x893f('0x2'));var moment=require('moment');var BPromise=require(_0x893f('0x3'));var rp=require(_0x893f('0x4'));var fs=require('fs');var path=require(_0x893f('0x5'));var rimraf=require(_0x893f('0x6'));var config=require(_0x893f('0x7'));var attributes=require(_0x893f('0x8'));module[_0x893f('0x9')]=function(_0xbdc308,_0x4048b1){return _0xbdc308['define'](_0x893f('0xa'),attributes,{'tableName':_0x893f('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 256fcdd..42e63eb 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 _0x5b38=['request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x31e12a,_0x57b4bc){var _0x420db1=function(_0x2b8f3e){while(--_0x2b8f3e){_0x31e12a['push'](_0x31e12a['shift']());}};_0x420db1(++_0x57b4bc);}(_0x5b38,0x81));var _0x85b3=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x5b38[_0x56f7e2];return _0x36240b;};'use strict';var _=require(_0x85b3('0x0'));var util=require(_0x85b3('0x1'));var moment=require(_0x85b3('0x2'));var BPromise=require('bluebird');var rs=require(_0x85b3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x85b3('0x4'));var logger=require(_0x85b3('0x5'))(_0x85b3('0x6'));var config=require(_0x85b3('0x7'));var jayson=require(_0x85b3('0x8'));var client=jayson[_0x85b3('0x9')][_0x85b3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40d41b,_0x18020a,_0x3e3607){return new BPromise(function(_0x1999d4,_0xa8087a){return client[_0x85b3('0xb')](_0x40d41b,_0x3e3607)[_0x85b3('0xc')](function(_0x4ae3fd){logger[_0x85b3('0xd')](_0x85b3('0xe'),_0x18020a,_0x85b3('0xf'));logger[_0x85b3('0x10')](_0x85b3('0x11'),_0x18020a,_0x85b3('0xf'),JSON[_0x85b3('0x12')](_0x4ae3fd));if(_0x4ae3fd['error']){if(_0x4ae3fd[_0x85b3('0x13')][_0x85b3('0x14')]===0x1f4){logger[_0x85b3('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x18020a,_0x4ae3fd[_0x85b3('0x13')][_0x85b3('0x15')]);return _0xa8087a(_0x4ae3fd['error'][_0x85b3('0x15')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x18020a,_0x4ae3fd[_0x85b3('0x13')][_0x85b3('0x15')]);return _0x1999d4(_0x4ae3fd[_0x85b3('0x13')][_0x85b3('0x15')]);}else{logger['info'](_0x85b3('0xe'),_0x18020a,'request\x20sent');_0x1999d4(_0x4ae3fd[_0x85b3('0x16')][_0x85b3('0x15')]);}})[_0x85b3('0x17')](function(_0x43bd54){logger[_0x85b3('0x13')](_0x85b3('0xe'),_0x18020a,_0x43bd54);_0xa8087a(_0x43bd54);});});} \ No newline at end of file +var _0x176f=['stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x5a6961,_0xd41ca6){var _0x4af0a6=function(_0x1201fe){while(--_0x1201fe){_0x5a6961['push'](_0x5a6961['shift']());}};_0x4af0a6(++_0xd41ca6);}(_0x176f,0x97));var _0xf176=function(_0x41d246,_0x481f8b){_0x41d246=_0x41d246-0x0;var _0x56541d=_0x176f[_0x41d246];return _0x56541d;};'use strict';var _=require(_0xf176('0x0'));var util=require(_0xf176('0x1'));var moment=require(_0xf176('0x2'));var BPromise=require(_0xf176('0x3'));var rs=require(_0xf176('0x4'));var fs=require('fs');var Redis=require(_0xf176('0x5'));var db=require(_0xf176('0x6'))['db'];var utils=require(_0xf176('0x7'));var logger=require(_0xf176('0x8'))(_0xf176('0x9'));var config=require(_0xf176('0xa'));var jayson=require(_0xf176('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd420d0,_0xa1bd4b,_0x2b423a){return new BPromise(function(_0x37c633,_0x1f2a35){return client[_0xf176('0xc')](_0xd420d0,_0x2b423a)[_0xf176('0xd')](function(_0x3b3a5a){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0xa1bd4b,_0xf176('0xe'));logger[_0xf176('0xf')](_0xf176('0x10'),_0xa1bd4b,_0xf176('0xe'),JSON[_0xf176('0x11')](_0x3b3a5a));if(_0x3b3a5a[_0xf176('0x12')]){if(_0x3b3a5a['error'][_0xf176('0x13')]===0x1f4){logger[_0xf176('0x12')](_0xf176('0x14'),_0xa1bd4b,_0x3b3a5a[_0xf176('0x12')]['message']);return _0x1f2a35(_0x3b3a5a['error'][_0xf176('0x15')]);}logger[_0xf176('0x12')](_0xf176('0x14'),_0xa1bd4b,_0x3b3a5a[_0xf176('0x12')][_0xf176('0x15')]);return _0x37c633(_0x3b3a5a['error'][_0xf176('0x15')]);}else{logger[_0xf176('0x16')](_0xf176('0x14'),_0xa1bd4b,_0xf176('0xe'));_0x37c633(_0x3b3a5a['result'][_0xf176('0x15')]);}})[_0xf176('0x17')](function(_0xc3be2f){logger['error'](_0xf176('0x14'),_0xa1bd4b,_0xc3be2f);_0x1f2a35(_0xc3be2f);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index e90e96d..d34f778 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 _0x9a23=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','index','isAuthenticated','show','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x5a88bf,_0x51775e){var _0x3820de=function(_0x4d4463){while(--_0x4d4463){_0x5a88bf['push'](_0x5a88bf['shift']());}};_0x3820de(++_0x51775e);}(_0x9a23,0x1df));var _0x39a2=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x9a23[_0xda464c];return _0x19e222;};'use strict';var multer=require(_0x39a2('0x0'));var util=require(_0x39a2('0x1'));var path=require(_0x39a2('0x2'));var timeout=require(_0x39a2('0x3'));var express=require(_0x39a2('0x4'));var router=express[_0x39a2('0x5')]();var fs_extra=require(_0x39a2('0x6'));var auth=require(_0x39a2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x39a2('0x8'));var controller=require(_0x39a2('0x9'));router[_0x39a2('0xa')]('/',auth['isAuthenticated'](),controller[_0x39a2('0xb')]);router[_0x39a2('0xa')]('/:id',auth[_0x39a2('0xc')](),controller[_0x39a2('0xd')]);router[_0x39a2('0xa')](_0x39a2('0xe'),auth[_0x39a2('0xc')](),controller[_0x39a2('0xf')]);router[_0x39a2('0x10')]('/',auth['isAuthenticated'](),controller[_0x39a2('0x11')]);router[_0x39a2('0x12')](_0x39a2('0x13'),auth[_0x39a2('0xc')](),controller[_0x39a2('0x14')]);router[_0x39a2('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x39a2('0x16')]);module[_0x39a2('0x17')]=router; \ No newline at end of file +var _0x020c=['update','delete','destroy','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','/:id/download','download','put'];(function(_0x12f59c,_0x13d956){var _0x2db43e=function(_0x1743fb){while(--_0x1743fb){_0x12f59c['push'](_0x12f59c['shift']());}};_0x2db43e(++_0x13d956);}(_0x020c,0x1d7));var _0xc020=function(_0x2dce5a,_0x2e992b){_0x2dce5a=_0x2dce5a-0x0;var _0x62fa90=_0x020c[_0x2dce5a];return _0x62fa90;};'use strict';var multer=require(_0xc020('0x0'));var util=require(_0xc020('0x1'));var path=require('path');var timeout=require(_0xc020('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc020('0x3'));var auth=require(_0xc020('0x4'));var interaction=require(_0xc020('0x5'));var config=require(_0xc020('0x6'));var controller=require(_0xc020('0x7'));router['get']('/',auth[_0xc020('0x8')](),controller[_0xc020('0x9')]);router[_0xc020('0xa')](_0xc020('0xb'),auth[_0xc020('0x8')](),controller['show']);router[_0xc020('0xa')](_0xc020('0xc'),auth[_0xc020('0x8')](),controller[_0xc020('0xd')]);router['post']('/',auth[_0xc020('0x8')](),controller['create']);router[_0xc020('0xe')]('/:id',auth[_0xc020('0x8')](),controller[_0xc020('0xf')]);router[_0xc020('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc020('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 236d6db..957d008 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 _0x8c9b=['exports','TEXT','STRING','BOOLEAN'];(function(_0x2d8efc,_0x58e635){var _0x4a7f2d=function(_0x5404e7){while(--_0x5404e7){_0x2d8efc['push'](_0x2d8efc['shift']());}};_0x4a7f2d(++_0x58e635);}(_0x8c9b,0xa8));var _0xb8c9=function(_0x49f7e0,_0x15a064){_0x49f7e0=_0x49f7e0-0x0;var _0x556090=_0x8c9b[_0x49f7e0];return _0x556090;};'use strict';var Sequelize=require('sequelize');module[_0xb8c9('0x0')]={'field':{'type':Sequelize[_0xb8c9('0x1')]},'alias':{'type':Sequelize[_0xb8c9('0x2')]},'function':{'type':Sequelize[_0xb8c9('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xb8c9('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xb8c9('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xce48=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x211711,_0x3f64af){var _0x13deec=function(_0x4f50de){while(--_0x4f50de){_0x211711['push'](_0x211711['shift']());}};_0x13deec(++_0x3f64af);}(_0xce48,0x149));var _0x8ce4=function(_0x3fb150,_0x5e32ed){_0x3fb150=_0x3fb150-0x0;var _0x56f4a8=_0xce48[_0x3fb150];return _0x56f4a8;};'use strict';var Sequelize=require(_0x8ce4('0x0'));module[_0x8ce4('0x1')]={'field':{'type':Sequelize[_0x8ce4('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x8ce4('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x8ce4('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8ce4('0x3')]},'custom':{'type':Sequelize[_0x8ce4('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 5ab417e..262e24a 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 _0x49c1=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','destroy','error','stack','send','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','where','VIRTUAL','merge','AnalyticFieldReport','then','include','findAll','rows','catch','params','rawAttributes','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util'];(function(_0x402d00,_0x46761f){var _0x23df42=function(_0x55eac8){while(--_0x55eac8){_0x402d00['push'](_0x402d00['shift']());}};_0x23df42(++_0x46761f);}(_0x49c1,0x184));var _0x149c=function(_0x5c4893,_0x491e7b){_0x5c4893=_0x5c4893-0x0;var _0x299145=_0x49c1[_0x5c4893];return _0x299145;};'use strict';var emlformat=require(_0x149c('0x0'));var rimraf=require(_0x149c('0x1'));var zipdir=require(_0x149c('0x2'));var jsonpatch=require(_0x149c('0x3'));var rp=require(_0x149c('0x4'));var moment=require('moment');var BPromise=require(_0x149c('0x5'));var Mustache=require('mustache');var util=require(_0x149c('0x6'));var path=require(_0x149c('0x7'));var sox=require(_0x149c('0x8'));var csv=require(_0x149c('0x9'));var ejs=require(_0x149c('0xa'));var fs=require('fs');var fs_extra=require(_0x149c('0xb'));var _=require(_0x149c('0xc'));var squel=require('squel');var crypto=require(_0x149c('0xd'));var jsforce=require(_0x149c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x149c('0x9'));var querystring=require(_0x149c('0xf'));var Papa=require(_0x149c('0x10'));var Redis=require('ioredis');var authService=require(_0x149c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x149c('0x12'));var hardwareService=require(_0x149c('0x13'));var logger=require(_0x149c('0x14'))(_0x149c('0x15'));var utils=require('../../config/utils');var config=require(_0x149c('0x16'));var licenseUtil=require(_0x149c('0x17'));var db=require(_0x149c('0x18'))['db'];function respondWithStatusCode(_0x24eca3,_0x2c3fe7){_0x2c3fe7=_0x2c3fe7||0xcc;return function(_0x55fce4){if(_0x55fce4){return _0x24eca3[_0x149c('0x19')](_0x2c3fe7);}return _0x24eca3[_0x149c('0x1a')](_0x2c3fe7)[_0x149c('0x1b')]();};}function respondWithResult(_0x2dc8d0,_0x1704fd){_0x1704fd=_0x1704fd||0xc8;return function(_0x20d480){if(_0x20d480){return _0x2dc8d0['status'](_0x1704fd)[_0x149c('0x1c')](_0x20d480);}};}function respondWithFilteredResult(_0x4fec04,_0xaf16f7){return function(_0x46d1b8){if(_0x46d1b8){var _0x9088e=typeof _0xaf16f7[_0x149c('0x1d')]==='undefined'&&typeof _0xaf16f7[_0x149c('0x1e')]==='undefined';var _0x5d4a0b=_0x46d1b8[_0x149c('0x1f')];var _0x1076dc=_0x9088e?0x0:_0xaf16f7[_0x149c('0x1d')];var _0x299612=_0x9088e?_0x46d1b8[_0x149c('0x1f')]:_0xaf16f7['offset']+_0xaf16f7['limit'];var _0x4edd23;if(_0x299612>=_0x5d4a0b){_0x299612=_0x5d4a0b;_0x4edd23=0xc8;}else{_0x4edd23=0xce;}_0x4fec04[_0x149c('0x1a')](_0x4edd23);return _0x4fec04[_0x149c('0x20')]('Content-Range',_0x1076dc+'-'+_0x299612+'/'+_0x5d4a0b)['json'](_0x46d1b8);}return null;};}function patchUpdates(_0x4704b8){return function(_0x1590a0){try{jsonpatch[_0x149c('0x21')](_0x1590a0,_0x4704b8,!![]);}catch(_0x505c06){return BPromise['reject'](_0x505c06);}return _0x1590a0['save']();};}function saveUpdates(_0x337891,_0x59e0f8){return function(_0x584205){if(_0x584205){return _0x584205['update'](_0x337891)['then'](function(_0x2956e3){return _0x2956e3;});}return null;};}function removeEntity(_0x373133,_0xde3a7){return function(_0x18193d){if(_0x18193d){return _0x18193d[_0x149c('0x22')]()['then'](function(){_0x373133[_0x149c('0x1a')](0xcc)[_0x149c('0x1b')]();});}};}function handleEntityNotFound(_0x408a5c,_0x3b6fbc){return function(_0x4cd3c3){if(!_0x4cd3c3){_0x408a5c['sendStatus'](0x194);}return _0x4cd3c3;};}function handleError(_0x5b29ff,_0x4ba85b){_0x4ba85b=_0x4ba85b||0x1f4;return function(_0x2a8717){logger[_0x149c('0x23')](_0x2a8717[_0x149c('0x24')]);if(_0x2a8717['name']){delete _0x2a8717['name'];}_0x5b29ff[_0x149c('0x1a')](_0x4ba85b)[_0x149c('0x25')](_0x2a8717);};}exports['index']=function(_0x4ea959,_0x328f93){var _0x52037d={},_0xe65f6b={},_0x3bd0c9={'count':0x0,'rows':[]};var _0x54dd19=_['map'](db['AnalyticFieldReport']['rawAttributes'],function(_0x59d330){return{'name':_0x59d330[_0x149c('0x26')],'type':_0x59d330[_0x149c('0x27')][_0x149c('0x28')]};});_0xe65f6b[_0x149c('0x29')]=_[_0x149c('0x2a')](_0x54dd19,_0x149c('0x2b'));_0xe65f6b[_0x149c('0x2c')]=_[_0x149c('0x2d')](_0x4ea959[_0x149c('0x2c')]);_0xe65f6b[_0x149c('0x2e')]=_[_0x149c('0x2f')](_0xe65f6b[_0x149c('0x29')],_0xe65f6b['query']);_0x52037d['attributes']=_[_0x149c('0x2f')](_0xe65f6b[_0x149c('0x29')],qs[_0x149c('0x30')](_0x4ea959[_0x149c('0x2c')]['fields']));_0x52037d[_0x149c('0x31')]=_0x52037d[_0x149c('0x31')][_0x149c('0x32')]?_0x52037d[_0x149c('0x31')]:_0xe65f6b[_0x149c('0x29')];if(!_0x4ea959[_0x149c('0x2c')][_0x149c('0x33')](_0x149c('0x34'))){_0x52037d[_0x149c('0x1e')]=qs[_0x149c('0x1e')](_0x4ea959['query']['limit']);_0x52037d[_0x149c('0x1d')]=qs[_0x149c('0x1d')](_0x4ea959[_0x149c('0x2c')][_0x149c('0x1d')]);}_0x52037d[_0x149c('0x35')]=qs['sort'](_0x4ea959[_0x149c('0x2c')]['sort']);_0x52037d['where']=qs['filters'](_[_0x149c('0x36')](_0x4ea959['query'],_0xe65f6b['filters']),_0x54dd19);if(_0x4ea959[_0x149c('0x2c')][_0x149c('0x37')]){_0x52037d[_0x149c('0x38')]=_['merge'](_0x52037d[_0x149c('0x38')],{'$or':_[_0x149c('0x2a')](_0x54dd19,function(_0x466211){if(_0x466211['type']!==_0x149c('0x39')){var _0x366ff0={};_0x366ff0[_0x466211['name']]={'$like':'%'+_0x4ea959[_0x149c('0x2c')]['filter']+'%'};return _0x366ff0;}})});}_0x52037d=_[_0x149c('0x3a')]({},_0x52037d,_0x4ea959['options']);var _0x35a282={'where':_0x52037d['where']};return db[_0x149c('0x3b')][_0x149c('0x1f')](_0x35a282)[_0x149c('0x3c')](function(_0x2f4548){_0x3bd0c9[_0x149c('0x1f')]=_0x2f4548;if(_0x4ea959[_0x149c('0x2c')]['includeAll']){_0x52037d[_0x149c('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x149c('0x3e')](_0x52037d);})[_0x149c('0x3c')](function(_0x14da52){_0x3bd0c9[_0x149c('0x3f')]=_0x14da52;return _0x3bd0c9;})[_0x149c('0x3c')](respondWithFilteredResult(_0x328f93,_0x52037d))[_0x149c('0x40')](handleError(_0x328f93,null));};exports['show']=function(_0x38c260,_0x1d70ef){var _0xf2b44c={'raw':![],'where':{'id':_0x38c260[_0x149c('0x41')]['id']}},_0x25536e={};_0x25536e[_0x149c('0x29')]=_[_0x149c('0x2d')](db[_0x149c('0x3b')][_0x149c('0x42')]);_0x25536e['query']=_[_0x149c('0x2d')](_0x38c260['query']);_0x25536e['filters']=_[_0x149c('0x2f')](_0x25536e[_0x149c('0x29')],_0x25536e[_0x149c('0x2c')]);_0xf2b44c['attributes']=_[_0x149c('0x2f')](_0x25536e[_0x149c('0x29')],qs[_0x149c('0x30')](_0x38c260['query']['fields']));_0xf2b44c[_0x149c('0x31')]=_0xf2b44c[_0x149c('0x31')][_0x149c('0x32')]?_0xf2b44c[_0x149c('0x31')]:_0x25536e[_0x149c('0x29')];if(_0x38c260[_0x149c('0x2c')]['includeAll']){_0xf2b44c[_0x149c('0x3d')]=[{'all':!![]}];}_0xf2b44c=_[_0x149c('0x3a')]({},_0xf2b44c,_0x38c260['options']);return db[_0x149c('0x3b')][_0x149c('0x43')](_0xf2b44c)[_0x149c('0x3c')](handleEntityNotFound(_0x1d70ef,null))['then'](respondWithResult(_0x1d70ef,null))[_0x149c('0x40')](handleError(_0x1d70ef,null));};exports[_0x149c('0x44')]=function(_0x245412,_0x12e076){return db[_0x149c('0x3b')][_0x149c('0x44')](_0x245412[_0x149c('0x45')],{})[_0x149c('0x3c')](respondWithResult(_0x12e076,0xc9))['catch'](handleError(_0x12e076,null));};exports[_0x149c('0x46')]=function(_0x13333a,_0x2523e7){return db[_0x149c('0x3b')][_0x149c('0x46')](_0x13333a[_0x149c('0x45')],{'raw':![],'individualHooks':!![]})[_0x149c('0x3c')](respondWithResult(_0x2523e7,0xc9))[_0x149c('0x40')](handleError(_0x2523e7,null));};exports['update']=function(_0x42d75f,_0x2ee3ec){if(_0x42d75f[_0x149c('0x45')]['id']){delete _0x42d75f[_0x149c('0x45')]['id'];}return db[_0x149c('0x3b')][_0x149c('0x43')]({'where':{'id':_0x42d75f[_0x149c('0x41')]['id']}})['then'](handleEntityNotFound(_0x2ee3ec,null))[_0x149c('0x3c')](saveUpdates(_0x42d75f[_0x149c('0x45')],null))['then'](respondWithResult(_0x2ee3ec,null))[_0x149c('0x40')](handleError(_0x2ee3ec,null));};exports['destroy']=function(_0x3dda7b,_0x2538f2){return db[_0x149c('0x3b')]['find']({'where':{'id':_0x3dda7b['params']['id']}})['then'](handleEntityNotFound(_0x2538f2,null))[_0x149c('0x3c')](removeEntity(_0x2538f2,null))[_0x149c('0x40')](handleError(_0x2538f2,null));};exports[_0x149c('0x47')]=function(_0x30cfd9,_0x5b8f86){return db[_0x149c('0x3b')][_0x149c('0x22')]({'where':{'id':_0x30cfd9[_0x149c('0x2c')][_0x149c('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x149c('0x3c')](respondWithResult(_0x5b8f86,0xcc))[_0x149c('0x40')](handleError(_0x5b8f86,null));};exports[_0x149c('0x49')]=function(_0x31c581,_0x37dafa,_0x50c3f3){return db[_0x149c('0x4a')][_0x149c('0x4b')]({'where':{'id':_0x31c581['params']['id']}})[_0x149c('0x3c')](handleEntityNotFound(_0x37dafa,null))[_0x149c('0x3c')](function(_0x4440a2){if(_0x4440a2){return db[_0x149c('0x4c')][_0x149c('0x4d')](function(_0x136204){return db[_0x149c('0x3b')][_0x149c('0x22')]({'where':{'CustomReportId':_0x31c581['params']['id']},'transaction':_0x136204})[_0x149c('0x3c')](function(_0x3e873d){var _0xabe33d=_[_0x149c('0x2a')](_0x31c581[_0x149c('0x45')],function(_0x5295d2){delete _0x5295d2['id'];_0x5295d2[_0x149c('0x4e')]=_0x31c581[_0x149c('0x41')]['id'];return _0x5295d2;});return db[_0x149c('0x3b')]['bulkCreate'](_0xabe33d,{'transaction':_0x136204});});})[_0x149c('0x3c')](function(){return db[_0x149c('0x3b')]['findAll']({'where':{'CustomReportId':_0x31c581['params']['id']}});});}})[_0x149c('0x3c')](respondWithResult(_0x37dafa,null))[_0x149c('0x40')](handleError(_0x37dafa,null));}; \ No newline at end of file +var _0x8a1f=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','destroy','CustomReportId','eml-format'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8a1f,0x1ad));var _0xf8a1=function(_0x3a5a8d,_0x22dac9){_0x3a5a8d=_0x3a5a8d-0x0;var _0x1b94b7=_0x8a1f[_0x3a5a8d];return _0x1b94b7;};'use strict';var emlformat=require(_0xf8a1('0x0'));var rimraf=require(_0xf8a1('0x1'));var zipdir=require(_0xf8a1('0x2'));var jsonpatch=require(_0xf8a1('0x3'));var rp=require(_0xf8a1('0x4'));var moment=require(_0xf8a1('0x5'));var BPromise=require(_0xf8a1('0x6'));var Mustache=require(_0xf8a1('0x7'));var util=require(_0xf8a1('0x8'));var path=require('path');var sox=require(_0xf8a1('0x9'));var csv=require(_0xf8a1('0xa'));var ejs=require(_0xf8a1('0xb'));var fs=require('fs');var fs_extra=require(_0xf8a1('0xc'));var _=require(_0xf8a1('0xd'));var squel=require(_0xf8a1('0xe'));var crypto=require(_0xf8a1('0xf'));var jsforce=require(_0xf8a1('0x10'));var deskjs=require(_0xf8a1('0x11'));var toCsv=require(_0xf8a1('0xa'));var querystring=require(_0xf8a1('0x12'));var Papa=require('papaparse');var Redis=require(_0xf8a1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf8a1('0x14'));var as=require(_0xf8a1('0x15'));var hardwareService=require(_0xf8a1('0x16'));var logger=require(_0xf8a1('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xf8a1('0x18'));var licenseUtil=require(_0xf8a1('0x19'));var db=require(_0xf8a1('0x1a'))['db'];function respondWithStatusCode(_0x4c6cee,_0x29c5f9){_0x29c5f9=_0x29c5f9||0xcc;return function(_0xa28473){if(_0xa28473){return _0x4c6cee[_0xf8a1('0x1b')](_0x29c5f9);}return _0x4c6cee[_0xf8a1('0x1c')](_0x29c5f9)[_0xf8a1('0x1d')]();};}function respondWithResult(_0x264cf0,_0x3cc7fd){_0x3cc7fd=_0x3cc7fd||0xc8;return function(_0x362650){if(_0x362650){return _0x264cf0['status'](_0x3cc7fd)[_0xf8a1('0x1e')](_0x362650);}};}function respondWithFilteredResult(_0x30b0dc,_0xaec725){return function(_0x230c16){if(_0x230c16){var _0x12b643=typeof _0xaec725['offset']===_0xf8a1('0x1f')&&typeof _0xaec725[_0xf8a1('0x20')]==='undefined';var _0x32fad6=_0x230c16['count'];var _0x317121=_0x12b643?0x0:_0xaec725['offset'];var _0x397238=_0x12b643?_0x230c16[_0xf8a1('0x21')]:_0xaec725['offset']+_0xaec725['limit'];var _0x4fe48b;if(_0x397238>=_0x32fad6){_0x397238=_0x32fad6;_0x4fe48b=0xc8;}else{_0x4fe48b=0xce;}_0x30b0dc[_0xf8a1('0x1c')](_0x4fe48b);return _0x30b0dc[_0xf8a1('0x22')](_0xf8a1('0x23'),_0x317121+'-'+_0x397238+'/'+_0x32fad6)[_0xf8a1('0x1e')](_0x230c16);}return null;};}function patchUpdates(_0x5dcb89){return function(_0x2b1d0d){try{jsonpatch[_0xf8a1('0x24')](_0x2b1d0d,_0x5dcb89,!![]);}catch(_0x1c8714){return BPromise[_0xf8a1('0x25')](_0x1c8714);}return _0x2b1d0d['save']();};}function saveUpdates(_0x200489,_0x1baeb8){return function(_0x47e575){if(_0x47e575){return _0x47e575[_0xf8a1('0x26')](_0x200489)[_0xf8a1('0x27')](function(_0x33e269){return _0x33e269;});}return null;};}function removeEntity(_0x37f7ac,_0x2396b7){return function(_0x4dace2){if(_0x4dace2){return _0x4dace2['destroy']()[_0xf8a1('0x27')](function(){_0x37f7ac[_0xf8a1('0x1c')](0xcc)[_0xf8a1('0x1d')]();});}};}function handleEntityNotFound(_0x5d8618,_0x58c449){return function(_0x293913){if(!_0x293913){_0x5d8618[_0xf8a1('0x1b')](0x194);}return _0x293913;};}function handleError(_0x1ce9f8,_0x4e0fa6){_0x4e0fa6=_0x4e0fa6||0x1f4;return function(_0x40e8b9){logger[_0xf8a1('0x28')](_0x40e8b9['stack']);if(_0x40e8b9[_0xf8a1('0x29')]){delete _0x40e8b9[_0xf8a1('0x29')];}_0x1ce9f8['status'](_0x4e0fa6)[_0xf8a1('0x2a')](_0x40e8b9);};}exports['index']=function(_0x5cdd38,_0x4fdcb1){var _0x3eaeed={},_0x29ce04={},_0x2cf506={'count':0x0,'rows':[]};var _0x585798=_[_0xf8a1('0x2b')](db[_0xf8a1('0x2c')][_0xf8a1('0x2d')],function(_0x38bd65){return{'name':_0x38bd65[_0xf8a1('0x2e')],'type':_0x38bd65[_0xf8a1('0x2f')][_0xf8a1('0x30')]};});_0x29ce04[_0xf8a1('0x31')]=_[_0xf8a1('0x2b')](_0x585798,_0xf8a1('0x29'));_0x29ce04[_0xf8a1('0x32')]=_[_0xf8a1('0x33')](_0x5cdd38['query']);_0x29ce04[_0xf8a1('0x34')]=_[_0xf8a1('0x35')](_0x29ce04[_0xf8a1('0x31')],_0x29ce04['query']);_0x3eaeed[_0xf8a1('0x36')]=_['intersection'](_0x29ce04['model'],qs['fields'](_0x5cdd38['query'][_0xf8a1('0x37')]));_0x3eaeed['attributes']=_0x3eaeed['attributes'][_0xf8a1('0x38')]?_0x3eaeed[_0xf8a1('0x36')]:_0x29ce04[_0xf8a1('0x31')];if(!_0x5cdd38[_0xf8a1('0x32')][_0xf8a1('0x39')](_0xf8a1('0x3a'))){_0x3eaeed[_0xf8a1('0x20')]=qs[_0xf8a1('0x20')](_0x5cdd38[_0xf8a1('0x32')][_0xf8a1('0x20')]);_0x3eaeed[_0xf8a1('0x3b')]=qs[_0xf8a1('0x3b')](_0x5cdd38['query'][_0xf8a1('0x3b')]);}_0x3eaeed[_0xf8a1('0x3c')]=qs[_0xf8a1('0x3d')](_0x5cdd38[_0xf8a1('0x32')][_0xf8a1('0x3d')]);_0x3eaeed['where']=qs[_0xf8a1('0x34')](_[_0xf8a1('0x3e')](_0x5cdd38[_0xf8a1('0x32')],_0x29ce04['filters']),_0x585798);if(_0x5cdd38[_0xf8a1('0x32')][_0xf8a1('0x3f')]){_0x3eaeed['where']=_[_0xf8a1('0x40')](_0x3eaeed[_0xf8a1('0x41')],{'$or':_[_0xf8a1('0x2b')](_0x585798,function(_0x36f35b){if(_0x36f35b[_0xf8a1('0x2f')]!==_0xf8a1('0x42')){var _0x5f364a={};_0x5f364a[_0x36f35b[_0xf8a1('0x29')]]={'$like':'%'+_0x5cdd38[_0xf8a1('0x32')][_0xf8a1('0x3f')]+'%'};return _0x5f364a;}})});}_0x3eaeed=_[_0xf8a1('0x40')]({},_0x3eaeed,_0x5cdd38[_0xf8a1('0x43')]);var _0x15076b={'where':_0x3eaeed['where']};return db[_0xf8a1('0x2c')][_0xf8a1('0x21')](_0x15076b)['then'](function(_0xa62d37){_0x2cf506['count']=_0xa62d37;if(_0x5cdd38['query'][_0xf8a1('0x44')]){_0x3eaeed[_0xf8a1('0x45')]=[{'all':!![]}];}return db[_0xf8a1('0x2c')][_0xf8a1('0x46')](_0x3eaeed);})[_0xf8a1('0x27')](function(_0x3b4c77){_0x2cf506['rows']=_0x3b4c77;return _0x2cf506;})[_0xf8a1('0x27')](respondWithFilteredResult(_0x4fdcb1,_0x3eaeed))[_0xf8a1('0x47')](handleError(_0x4fdcb1,null));};exports['show']=function(_0x30042a,_0x5a72ad){var _0x5eec5f={'raw':![],'where':{'id':_0x30042a[_0xf8a1('0x48')]['id']}},_0x3038ca={};_0x3038ca['model']=_['keys'](db[_0xf8a1('0x2c')][_0xf8a1('0x2d')]);_0x3038ca[_0xf8a1('0x32')]=_[_0xf8a1('0x33')](_0x30042a[_0xf8a1('0x32')]);_0x3038ca['filters']=_['intersection'](_0x3038ca[_0xf8a1('0x31')],_0x3038ca[_0xf8a1('0x32')]);_0x5eec5f[_0xf8a1('0x36')]=_[_0xf8a1('0x35')](_0x3038ca[_0xf8a1('0x31')],qs[_0xf8a1('0x37')](_0x30042a['query'][_0xf8a1('0x37')]));_0x5eec5f[_0xf8a1('0x36')]=_0x5eec5f[_0xf8a1('0x36')][_0xf8a1('0x38')]?_0x5eec5f[_0xf8a1('0x36')]:_0x3038ca['model'];if(_0x30042a[_0xf8a1('0x32')][_0xf8a1('0x44')]){_0x5eec5f['include']=[{'all':!![]}];}_0x5eec5f=_['merge']({},_0x5eec5f,_0x30042a[_0xf8a1('0x43')]);return db[_0xf8a1('0x2c')][_0xf8a1('0x49')](_0x5eec5f)[_0xf8a1('0x27')](handleEntityNotFound(_0x5a72ad,null))['then'](respondWithResult(_0x5a72ad,null))[_0xf8a1('0x47')](handleError(_0x5a72ad,null));};exports[_0xf8a1('0x4a')]=function(_0x1ed6a2,_0x259161){return db[_0xf8a1('0x2c')][_0xf8a1('0x4a')](_0x1ed6a2[_0xf8a1('0x4b')],{})[_0xf8a1('0x27')](respondWithResult(_0x259161,0xc9))[_0xf8a1('0x47')](handleError(_0x259161,null));};exports[_0xf8a1('0x4c')]=function(_0xb8bc65,_0x63e338){return db[_0xf8a1('0x2c')]['bulkCreate'](_0xb8bc65[_0xf8a1('0x4b')],{'raw':![],'individualHooks':!![]})[_0xf8a1('0x27')](respondWithResult(_0x63e338,0xc9))[_0xf8a1('0x47')](handleError(_0x63e338,null));};exports[_0xf8a1('0x26')]=function(_0x21cd9f,_0x6c114){if(_0x21cd9f['body']['id']){delete _0x21cd9f[_0xf8a1('0x4b')]['id'];}return db[_0xf8a1('0x2c')][_0xf8a1('0x49')]({'where':{'id':_0x21cd9f[_0xf8a1('0x48')]['id']}})[_0xf8a1('0x27')](handleEntityNotFound(_0x6c114,null))[_0xf8a1('0x27')](saveUpdates(_0x21cd9f[_0xf8a1('0x4b')],null))[_0xf8a1('0x27')](respondWithResult(_0x6c114,null))['catch'](handleError(_0x6c114,null));};exports['destroy']=function(_0x7c5c52,_0x51c6ed){return db[_0xf8a1('0x2c')][_0xf8a1('0x49')]({'where':{'id':_0x7c5c52[_0xf8a1('0x48')]['id']}})[_0xf8a1('0x27')](handleEntityNotFound(_0x51c6ed,null))[_0xf8a1('0x27')](removeEntity(_0x51c6ed,null))[_0xf8a1('0x47')](handleError(_0x51c6ed,null));};exports[_0xf8a1('0x4d')]=function(_0x3cc71a,_0x522912){return db[_0xf8a1('0x2c')]['destroy']({'where':{'id':_0x3cc71a[_0xf8a1('0x32')][_0xf8a1('0x4e')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x522912,0xcc))['catch'](handleError(_0x522912,null));};exports[_0xf8a1('0x4f')]=function(_0x24784b,_0x52a32e,_0x45d494){return db[_0xf8a1('0x50')][_0xf8a1('0x51')]({'where':{'id':_0x24784b['params']['id']}})['then'](handleEntityNotFound(_0x52a32e,null))[_0xf8a1('0x27')](function(_0x1000cd){if(_0x1000cd){return db[_0xf8a1('0x52')][_0xf8a1('0x53')](function(_0x440ace){return db[_0xf8a1('0x2c')][_0xf8a1('0x54')]({'where':{'CustomReportId':_0x24784b['params']['id']},'transaction':_0x440ace})['then'](function(_0x4a2af3){var _0x1fc043=_['map'](_0x24784b[_0xf8a1('0x4b')],function(_0x38ed01){delete _0x38ed01['id'];_0x38ed01[_0xf8a1('0x55')]=_0x24784b[_0xf8a1('0x48')]['id'];return _0x38ed01;});return db[_0xf8a1('0x2c')][_0xf8a1('0x4c')](_0x1fc043,{'transaction':_0x440ace});});})[_0xf8a1('0x27')](function(){return db[_0xf8a1('0x2c')]['findAll']({'where':{'CustomReportId':_0x24784b['params']['id']}});});}})['then'](respondWithResult(_0x52a32e,null))['catch'](handleError(_0x52a32e,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 715f6a7..6d479e6 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 _0x74d5=['exports','define','AnalyticFieldReport','lodash','util','../../config/logger','moment','request-promise','path','./analyticFieldReport.attributes'];(function(_0x12526d,_0x7fada3){var _0xefd69a=function(_0xbd146c){while(--_0xbd146c){_0x12526d['push'](_0x12526d['shift']());}};_0xefd69a(++_0x7fada3);}(_0x74d5,0x1b1));var _0x574d=function(_0x20cf10,_0x465f55){_0x20cf10=_0x20cf10-0x0;var _0x53fe52=_0x74d5[_0x20cf10];return _0x53fe52;};'use strict';var _=require(_0x574d('0x0'));var util=require(_0x574d('0x1'));var logger=require(_0x574d('0x2'))('api');var moment=require(_0x574d('0x3'));var BPromise=require('bluebird');var rp=require(_0x574d('0x4'));var fs=require('fs');var path=require(_0x574d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x574d('0x6'));module[_0x574d('0x7')]=function(_0x3173a2,_0x349cab){return _0x3173a2[_0x574d('0x8')](_0x574d('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0e4=['../../config/environment','define','AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4778ad,_0x22a372){var _0x345476=function(_0x47fd6f){while(--_0x47fd6f){_0x4778ad['push'](_0x4778ad['shift']());}};_0x345476(++_0x22a372);}(_0xa0e4,0x12c));var _0x4a0e=function(_0x435ba5,_0x55875f){_0x435ba5=_0x435ba5-0x0;var _0x5af51d=_0xa0e4[_0x435ba5];return _0x5af51d;};'use strict';var _=require(_0x4a0e('0x0'));var util=require(_0x4a0e('0x1'));var logger=require(_0x4a0e('0x2'))(_0x4a0e('0x3'));var moment=require(_0x4a0e('0x4'));var BPromise=require(_0x4a0e('0x5'));var rp=require(_0x4a0e('0x6'));var fs=require('fs');var path=require(_0x4a0e('0x7'));var rimraf=require('rimraf');var config=require(_0x4a0e('0x8'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x4ddbc4,_0x2f666d){return _0x4ddbc4[_0x4a0e('0x9')](_0x4a0e('0xa'),attributes,{'tableName':'analytics_report_fields','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 b13c7f3..b64b613 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 _0x9a3c=['info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x122932,_0x989fcb){var _0x2391c=function(_0x2df1f9){while(--_0x2df1f9){_0x122932['push'](_0x122932['shift']());}};_0x2391c(++_0x989fcb);}(_0x9a3c,0x1ed));var _0xc9a3=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x9a3c[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0xc9a3('0x0'));var util=require(_0xc9a3('0x1'));var moment=require(_0xc9a3('0x2'));var BPromise=require(_0xc9a3('0x3'));var rs=require(_0xc9a3('0x4'));var fs=require('fs');var Redis=require(_0xc9a3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9a3('0x6'));var logger=require(_0xc9a3('0x7'))(_0xc9a3('0x8'));var config=require(_0xc9a3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc9a3('0xa')][_0xc9a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d00e2,_0x5a8010,_0x5edb0b){return new BPromise(function(_0x2f2c65,_0x362351){return client[_0xc9a3('0xc')](_0x4d00e2,_0x5edb0b)['then'](function(_0x1f7752){logger[_0xc9a3('0xd')](_0xc9a3('0xe'),_0x5a8010,_0xc9a3('0xf'));logger['debug'](_0xc9a3('0x10'),_0x5a8010,_0xc9a3('0xf'),JSON[_0xc9a3('0x11')](_0x1f7752));if(_0x1f7752[_0xc9a3('0x12')]){if(_0x1f7752['error'][_0xc9a3('0x13')]===0x1f4){logger[_0xc9a3('0x12')](_0xc9a3('0xe'),_0x5a8010,_0x1f7752['error'][_0xc9a3('0x14')]);return _0x362351(_0x1f7752[_0xc9a3('0x12')][_0xc9a3('0x14')]);}logger[_0xc9a3('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5a8010,_0x1f7752[_0xc9a3('0x12')][_0xc9a3('0x14')]);return _0x2f2c65(_0x1f7752[_0xc9a3('0x12')][_0xc9a3('0x14')]);}else{logger['info'](_0xc9a3('0xe'),_0x5a8010,'request\x20sent');_0x2f2c65(_0x1f7752[_0xc9a3('0x15')][_0xc9a3('0x14')]);}})[_0xc9a3('0x16')](function(_0x349d4e){logger[_0xc9a3('0x12')](_0xc9a3('0xe'),_0x5a8010,_0x349d4e);_0x362351(_0x349d4e);});});} \ No newline at end of file +var _0x8537=['AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x49aee4,_0x17186c){var _0x4042b7=function(_0x2d86cf){while(--_0x2d86cf){_0x49aee4['push'](_0x49aee4['shift']());}};_0x4042b7(++_0x17186c);}(_0x8537,0xe2));var _0x7853=function(_0x1c7c63,_0x5337aa){_0x1c7c63=_0x1c7c63-0x0;var _0x385f7a=_0x8537[_0x1c7c63];return _0x385f7a;};'use strict';var _=require(_0x7853('0x0'));var util=require('util');var moment=require(_0x7853('0x1'));var BPromise=require(_0x7853('0x2'));var rs=require(_0x7853('0x3'));var fs=require('fs');var Redis=require(_0x7853('0x4'));var db=require(_0x7853('0x5'))['db'];var utils=require(_0x7853('0x6'));var logger=require(_0x7853('0x7'))(_0x7853('0x8'));var config=require(_0x7853('0x9'));var jayson=require(_0x7853('0xa'));var client=jayson['client'][_0x7853('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2da0a3,_0x39ff2e,_0x5dfe39){return new BPromise(function(_0x4a6b16,_0x3f2fc7){return client['request'](_0x2da0a3,_0x5dfe39)[_0x7853('0xc')](function(_0x30e9dc){logger[_0x7853('0xd')](_0x7853('0xe'),_0x39ff2e,_0x7853('0xf'));logger[_0x7853('0x10')](_0x7853('0x11'),_0x39ff2e,_0x7853('0xf'),JSON[_0x7853('0x12')](_0x30e9dc));if(_0x30e9dc[_0x7853('0x13')]){if(_0x30e9dc[_0x7853('0x13')][_0x7853('0x14')]===0x1f4){logger[_0x7853('0x13')](_0x7853('0xe'),_0x39ff2e,_0x30e9dc[_0x7853('0x13')]['message']);return _0x3f2fc7(_0x30e9dc[_0x7853('0x13')][_0x7853('0x15')]);}logger[_0x7853('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x39ff2e,_0x30e9dc['error'][_0x7853('0x15')]);return _0x4a6b16(_0x30e9dc[_0x7853('0x13')][_0x7853('0x15')]);}else{logger[_0x7853('0xd')](_0x7853('0xe'),_0x39ff2e,_0x7853('0xf'));_0x4a6b16(_0x30e9dc[_0x7853('0x16')][_0x7853('0x15')]);}})[_0x7853('0x17')](function(_0x365fce){logger[_0x7853('0x13')](_0x7853('0xe'),_0x39ff2e,_0x365fce);_0x3f2fc7(_0x365fce);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 1569d20..b73cc21 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(_0x114e4f,_0xbe96ca){var _0x27010e=function(_0x167474){while(--_0x167474){_0x114e4f['push'](_0x114e4f['shift']());}};_0x27010e(++_0xbe96ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x362058,_0x446816){var _0x1e4d4b=function(_0x2d4b2a){while(--_0x2d4b2a){_0x362058['push'](_0x362058['shift']());}};_0x1e4d4b(++_0x446816);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 3e806d5..bbe4848 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 _0xd87e=['STRING','TEXT','sequelize','exports','name'];(function(_0x575627,_0x5f2c9f){var _0xac789a=function(_0x178836){while(--_0x178836){_0x575627['push'](_0x575627['shift']());}};_0xac789a(++_0x5f2c9f);}(_0xd87e,0x1bf));var _0xed87=function(_0xf0bbde,_0x1e8776){_0xf0bbde=_0xf0bbde-0x0;var _0x450001=_0xd87e[_0xf0bbde];return _0x450001;};'use strict';var Sequelize=require(_0xed87('0x0'));module[_0xed87('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xed87('0x2')},'table':{'type':Sequelize[_0xed87('0x3')]},'metric':{'type':Sequelize[_0xed87('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb077=['TEXT','STRING','sequelize','name'];(function(_0xa066f8,_0x4636af){var _0x2b5cb8=function(_0x3a4052){while(--_0x3a4052){_0xa066f8['push'](_0xa066f8['shift']());}};_0x2b5cb8(++_0x4636af);}(_0xb077,0x7a));var _0x7b07=function(_0x555e0e,_0x379d86){_0x555e0e=_0x555e0e-0x0;var _0x798715=_0xb077[_0x555e0e];return _0x798715;};'use strict';var Sequelize=require(_0x7b07('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7b07('0x1')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x7b07('0x2')]},'description':{'type':Sequelize[_0x7b07('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index c28c485..2a93a17 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 _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','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'];(function(_0x3a1b92,_0x28d1ff){var _0x3c35ae=function(_0x3a0de8){while(--_0x3a0de8){_0x3a1b92['push'](_0x3a1b92['shift']());}};_0x3c35ae(++_0x28d1ff);}(_0x55ca,0x126));var _0xa55c=function(_0x3f6bcf,_0x531e79){_0x3f6bcf=_0x3f6bcf-0x0;var _0x1c5350=_0x55ca[_0x3f6bcf];return _0x1c5350;};'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(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));}; \ No newline at end of file +var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5ac3b7,_0x4e43a3){var _0x56b129=function(_0x2b75c0){while(--_0x2b75c0){_0x5ac3b7['push'](_0x5ac3b7['shift']());}};_0x56b129(++_0x4e43a3);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x389318,_0x13a53d){_0x389318=_0x389318-0x0;var _0x7919e3=_0xf2ca[_0x389318];return _0x7919e3;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 44fe502..d3d87c7 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 _0x814b=['define','AnalyticMetric','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0xba7351,_0x13dea5){var _0x38347b=function(_0x19f72a){while(--_0x19f72a){_0xba7351['push'](_0xba7351['shift']());}};_0x38347b(++_0x13dea5);}(_0x814b,0x1a2));var _0xb814=function(_0x1857c6,_0x48840c){_0x1857c6=_0x1857c6-0x0;var _0x51011c=_0x814b[_0x1857c6];return _0x51011c;};'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':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46ed=['lodash','util','api','moment','bluebird','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x46ed,0x168));var _0xd46e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x46ed[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));module[_0xd46e('0x8')]=function(_0x160bcf,_0x25cf78){return _0x160bcf[_0xd46e('0x9')](_0xd46e('0xa'),attributes,{'tableName':_0xd46e('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 e0dd3fe..097524e 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 _0x5699=['moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x12f891,_0x2ea175){var _0x124954=function(_0x5085b4){while(--_0x5085b4){_0x12f891['push'](_0x12f891['shift']());}};_0x124954(++_0x2ea175);}(_0x5699,0x1a2));var _0x9569=function(_0x2b6ec7,_0x514fd5){_0x2b6ec7=_0x2b6ec7-0x0;var _0x41063d=_0x5699[_0x2b6ec7];return _0x41063d;};'use strict';var _=require(_0x9569('0x0'));var util=require(_0x9569('0x1'));var moment=require(_0x9569('0x2'));var BPromise=require(_0x9569('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9569('0x4'));var db=require(_0x9569('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9569('0x6'));var jayson=require(_0x9569('0x7'));var client=jayson[_0x9569('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12dd20,_0x12e385,_0x3ecdc7){return new BPromise(function(_0x35254b,_0x4e9c24){return client[_0x9569('0x9')](_0x12dd20,_0x3ecdc7)['then'](function(_0x1f0d7d){logger[_0x9569('0xa')](_0x9569('0xb'),_0x12e385,_0x9569('0xc'));logger[_0x9569('0xd')](_0x9569('0xe'),_0x12e385,_0x9569('0xc'),JSON[_0x9569('0xf')](_0x1f0d7d));if(_0x1f0d7d[_0x9569('0x10')]){if(_0x1f0d7d[_0x9569('0x10')][_0x9569('0x11')]===0x1f4){logger[_0x9569('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x12e385,_0x1f0d7d[_0x9569('0x10')]['message']);return _0x4e9c24(_0x1f0d7d['error'][_0x9569('0x12')]);}logger[_0x9569('0x10')](_0x9569('0xb'),_0x12e385,_0x1f0d7d[_0x9569('0x10')][_0x9569('0x12')]);return _0x35254b(_0x1f0d7d[_0x9569('0x10')][_0x9569('0x12')]);}else{logger['info'](_0x9569('0xb'),_0x12e385,'request\x20sent');_0x35254b(_0x1f0d7d[_0x9569('0x13')][_0x9569('0x12')]);}})[_0x9569('0x14')](function(_0x5cda0e){logger['error'](_0x9569('0xb'),_0x12e385,_0x5cda0e);_0x4e9c24(_0x5cda0e);});});} \ No newline at end of file +var _0x87cd=['info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','AnalyticMetric,\x20%s,\x20%s','message','catch','util','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xc18fc0,_0x2fa31c){var _0x208c93=function(_0x58a2c0){while(--_0x58a2c0){_0xc18fc0['push'](_0xc18fc0['shift']());}};_0x208c93(++_0x2fa31c);}(_0x87cd,0xe6));var _0xd87c=function(_0xc9ed15,_0x1401a8){_0xc9ed15=_0xc9ed15-0x0;var _0x470a09=_0x87cd[_0xc9ed15];return _0x470a09;};'use strict';var _=require('lodash');var util=require(_0xd87c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd87c('0x1'));var fs=require('fs');var Redis=require(_0xd87c('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd87c('0x3'));var config=require(_0xd87c('0x4'));var jayson=require(_0xd87c('0x5'));var client=jayson[_0xd87c('0x6')][_0xd87c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2fe4f8,_0x4e5676,_0x1243b4){return new BPromise(function(_0x361c30,_0xf1f770){return client['request'](_0x2fe4f8,_0x1243b4)['then'](function(_0x4b13c9){logger[_0xd87c('0x8')]('AnalyticMetric,\x20%s,\x20%s',_0x4e5676,_0xd87c('0x9'));logger[_0xd87c('0xa')](_0xd87c('0xb'),_0x4e5676,'request\x20sent',JSON['stringify'](_0x4b13c9));if(_0x4b13c9['error']){if(_0x4b13c9[_0xd87c('0xc')][_0xd87c('0xd')]===0x1f4){logger[_0xd87c('0xc')](_0xd87c('0xe'),_0x4e5676,_0x4b13c9[_0xd87c('0xc')]['message']);return _0xf1f770(_0x4b13c9[_0xd87c('0xc')]['message']);}logger[_0xd87c('0xc')](_0xd87c('0xe'),_0x4e5676,_0x4b13c9['error'][_0xd87c('0xf')]);return _0x361c30(_0x4b13c9[_0xd87c('0xc')]['message']);}else{logger[_0xd87c('0x8')](_0xd87c('0xe'),_0x4e5676,_0xd87c('0x9'));_0x361c30(_0x4b13c9['result'][_0xd87c('0xf')]);}})[_0xd87c('0x10')](function(_0x23864d){logger[_0xd87c('0xc')](_0xd87c('0xe'),_0x4e5676,_0x23864d);_0xf1f770(_0x23864d);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 4790353..1a59465 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 _0xb073=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1fca71,_0x19bbe2){var _0x3de03f=function(_0x1f0cf0){while(--_0x1f0cf0){_0x1fca71['push'](_0x1fca71['shift']());}};_0x3de03f(++_0x19bbe2);}(_0xb073,0x187));var _0x3b07=function(_0xc39b1d,_0x52a3b6){_0xc39b1d=_0xc39b1d-0x0;var _0x358fad=_0xb073[_0xc39b1d];return _0x358fad;};'use strict';var multer=require('multer');var util=require(_0x3b07('0x0'));var path=require('path');var timeout=require(_0x3b07('0x1'));var express=require(_0x3b07('0x2'));var router=express[_0x3b07('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3b07('0x4'));var interaction=require(_0x3b07('0x5'));var config=require(_0x3b07('0x6'));var controller=require('./analyticMetric.controller');router[_0x3b07('0x7')]('/',auth[_0x3b07('0x8')](),controller[_0x3b07('0x9')]);router[_0x3b07('0x7')](_0x3b07('0xa'),auth[_0x3b07('0x8')](),controller[_0x3b07('0xb')]);router[_0x3b07('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3b07('0xd')](_0x3b07('0xa'),auth[_0x3b07('0x8')](),controller[_0x3b07('0xe')]);router[_0x3b07('0xf')](_0x3b07('0xa'),auth[_0x3b07('0x8')](),controller[_0x3b07('0x10')]);module[_0x3b07('0x11')]=router; \ No newline at end of file +var _0x79a8=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','update','multer'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x79a8,0x1d0));var _0x879a=function(_0xd29c88,_0x141c80){_0xd29c88=_0xd29c88-0x0;var _0x375635=_0x79a8[_0xd29c88];return _0x375635;};'use strict';var multer=require(_0x879a('0x0'));var util=require('util');var path=require(_0x879a('0x1'));var timeout=require(_0x879a('0x2'));var express=require(_0x879a('0x3'));var router=express['Router']();var fs_extra=require(_0x879a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x879a('0x5'));var config=require(_0x879a('0x6'));var controller=require(_0x879a('0x7'));router[_0x879a('0x8')]('/',auth[_0x879a('0x9')](),controller[_0x879a('0xa')]);router[_0x879a('0x8')](_0x879a('0xb'),auth['isAuthenticated'](),controller[_0x879a('0xc')]);router['post']('/',auth[_0x879a('0x9')](),controller[_0x879a('0xd')]);router['put'](_0x879a('0xb'),auth[_0x879a('0x9')](),controller[_0x879a('0xe')]);router['delete'](_0x879a('0xb'),auth[_0x879a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index ffa8c12..8ab2944 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 _0x71ef=['TEXT','sequelize','exports'];(function(_0x5f2498,_0x43d481){var _0x34813f=function(_0x53c206){while(--_0x53c206){_0x5f2498['push'](_0x5f2498['shift']());}};_0x34813f(++_0x43d481);}(_0x71ef,0x100));var _0xf71e=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0x71ef[_0x2f6f50];return _0x2cf365;};'use strict';var Sequelize=require(_0xf71e('0x0'));module[_0xf71e('0x1')]={'tree':{'type':Sequelize[_0xf71e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8f6a=['TEXT','sequelize','exports'];(function(_0x9ae5b4,_0x139b17){var _0xa4d634=function(_0x57500e){while(--_0x57500e){_0x9ae5b4['push'](_0x9ae5b4['shift']());}};_0xa4d634(++_0x139b17);}(_0x8f6a,0x12d));var _0xa8f6=function(_0x59ddda,_0x332c06){_0x59ddda=_0x59ddda-0x0;var _0x1ab861=_0x8f6a[_0x59ddda];return _0x1ab861;};'use strict';var Sequelize=require(_0xa8f6('0x0'));module[_0xa8f6('0x1')]={'tree':{'type':Sequelize[_0xa8f6('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index c0c4e09..29df0b9 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 _0x57dd=['query','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','fields','length','create','body','params','destroy','find','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','key','model','keys'];(function(_0x39d381,_0x1b56fd){var _0x42b529=function(_0x5e7a79){while(--_0x5e7a79){_0x39d381['push'](_0x39d381['shift']());}};_0x42b529(++_0x1b56fd);}(_0x57dd,0x186));var _0xd57d=function(_0x3d0b5e,_0x42c004){_0x3d0b5e=_0x3d0b5e-0x0;var _0x274e50=_0x57dd[_0x3d0b5e];return _0x274e50;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd57d('0x0'));var jsonpatch=require(_0xd57d('0x1'));var rp=require(_0xd57d('0x2'));var moment=require('moment');var BPromise=require(_0xd57d('0x3'));var Mustache=require(_0xd57d('0x4'));var util=require(_0xd57d('0x5'));var path=require('path');var sox=require(_0xd57d('0x6'));var csv=require(_0xd57d('0x7'));var ejs=require(_0xd57d('0x8'));var fs=require('fs');var fs_extra=require(_0xd57d('0x9'));var _=require('lodash');var squel=require(_0xd57d('0xa'));var crypto=require(_0xd57d('0xb'));var jsforce=require(_0xd57d('0xc'));var deskjs=require(_0xd57d('0xd'));var toCsv=require(_0xd57d('0x7'));var querystring=require('querystring');var Papa=require(_0xd57d('0xe'));var Redis=require(_0xd57d('0xf'));var authService=require(_0xd57d('0x10'));var qs=require(_0xd57d('0x11'));var as=require(_0xd57d('0x12'));var hardwareService=require(_0xd57d('0x13'));var logger=require('../../config/logger')(_0xd57d('0x14'));var utils=require('../../config/utils');var config=require(_0xd57d('0x15'));var licenseUtil=require(_0xd57d('0x16'));var db=require(_0xd57d('0x17'))['db'];function respondWithStatusCode(_0xfba75f,_0x1c9f9b){_0x1c9f9b=_0x1c9f9b||0xcc;return function(_0x2e87fb){if(_0x2e87fb){return _0xfba75f[_0xd57d('0x18')](_0x1c9f9b);}return _0xfba75f[_0xd57d('0x19')](_0x1c9f9b)['end']();};}function respondWithResult(_0x21d24b,_0x54e1cf){_0x54e1cf=_0x54e1cf||0xc8;return function(_0x728c3e){if(_0x728c3e){return _0x21d24b[_0xd57d('0x19')](_0x54e1cf)[_0xd57d('0x1a')](_0x728c3e);}};}function respondWithFilteredResult(_0x22e5bf,_0x973fc2){return function(_0x307bce){if(_0x307bce){var _0x2534f4=typeof _0x973fc2[_0xd57d('0x1b')]===_0xd57d('0x1c')&&typeof _0x973fc2[_0xd57d('0x1d')]===_0xd57d('0x1c');var _0x25b0af=_0x307bce[_0xd57d('0x1e')];var _0x34f325=_0x2534f4?0x0:_0x973fc2['offset'];var _0x5d7a37=_0x2534f4?_0x307bce[_0xd57d('0x1e')]:_0x973fc2[_0xd57d('0x1b')]+_0x973fc2[_0xd57d('0x1d')];var _0x3b3a20;if(_0x5d7a37>=_0x25b0af){_0x5d7a37=_0x25b0af;_0x3b3a20=0xc8;}else{_0x3b3a20=0xce;}_0x22e5bf[_0xd57d('0x19')](_0x3b3a20);return _0x22e5bf['set'](_0xd57d('0x1f'),_0x34f325+'-'+_0x5d7a37+'/'+_0x25b0af)[_0xd57d('0x1a')](_0x307bce);}return null;};}function patchUpdates(_0x1a8f45){return function(_0x20957a){try{jsonpatch[_0xd57d('0x20')](_0x20957a,_0x1a8f45,!![]);}catch(_0x464f84){return BPromise[_0xd57d('0x21')](_0x464f84);}return _0x20957a['save']();};}function saveUpdates(_0xff735d,_0x29a7a3){return function(_0x367a7e){if(_0x367a7e){return _0x367a7e[_0xd57d('0x22')](_0xff735d)[_0xd57d('0x23')](function(_0x618f52){return _0x618f52;});}return null;};}function removeEntity(_0x232ddd,_0x2d5c05){return function(_0x72e8ec){if(_0x72e8ec){return _0x72e8ec['destroy']()[_0xd57d('0x23')](function(){_0x232ddd[_0xd57d('0x19')](0xcc)[_0xd57d('0x24')]();});}};}function handleEntityNotFound(_0x2fefce,_0x1919bd){return function(_0x208995){if(!_0x208995){_0x2fefce[_0xd57d('0x18')](0x194);}return _0x208995;};}function handleError(_0x2bfd37,_0x2e94e6){_0x2e94e6=_0x2e94e6||0x1f4;return function(_0x35f5d5){logger[_0xd57d('0x25')](_0x35f5d5[_0xd57d('0x26')]);if(_0x35f5d5['name']){delete _0x35f5d5[_0xd57d('0x27')];}_0x2bfd37[_0xd57d('0x19')](_0x2e94e6)[_0xd57d('0x28')](_0x35f5d5);};}exports[_0xd57d('0x29')]=function(_0x51d01e,_0x5dca86){var _0x17bb9b={},_0x4d3b23={},_0x2b2606={'count':0x0,'rows':[]};var _0x4a8a53=_[_0xd57d('0x2a')](db[_0xd57d('0x2b')]['rawAttributes'],function(_0x492207){return{'name':_0x492207[_0xd57d('0x2c')],'type':_0x492207['type'][_0xd57d('0x2d')]};});_0x4d3b23[_0xd57d('0x2e')]=_[_0xd57d('0x2a')](_0x4a8a53,_0xd57d('0x27'));_0x4d3b23['query']=_[_0xd57d('0x2f')](_0x51d01e[_0xd57d('0x30')]);_0x4d3b23[_0xd57d('0x31')]=_['intersection'](_0x4d3b23[_0xd57d('0x2e')],_0x4d3b23[_0xd57d('0x30')]);_0x17bb9b['attributes']=_[_0xd57d('0x32')](_0x4d3b23['model'],qs['fields'](_0x51d01e[_0xd57d('0x30')]['fields']));_0x17bb9b[_0xd57d('0x33')]=_0x17bb9b[_0xd57d('0x33')]['length']?_0x17bb9b[_0xd57d('0x33')]:_0x4d3b23[_0xd57d('0x2e')];if(!_0x51d01e[_0xd57d('0x30')][_0xd57d('0x34')]('nolimit')){_0x17bb9b[_0xd57d('0x1d')]=qs[_0xd57d('0x1d')](_0x51d01e[_0xd57d('0x30')][_0xd57d('0x1d')]);_0x17bb9b[_0xd57d('0x1b')]=qs['offset'](_0x51d01e[_0xd57d('0x30')][_0xd57d('0x1b')]);}_0x17bb9b[_0xd57d('0x35')]=qs[_0xd57d('0x36')](_0x51d01e[_0xd57d('0x30')]['sort']);_0x17bb9b[_0xd57d('0x37')]=qs[_0xd57d('0x31')](_[_0xd57d('0x38')](_0x51d01e[_0xd57d('0x30')],_0x4d3b23[_0xd57d('0x31')]),_0x4a8a53);if(_0x51d01e[_0xd57d('0x30')][_0xd57d('0x39')]){_0x17bb9b[_0xd57d('0x37')]=_[_0xd57d('0x3a')](_0x17bb9b[_0xd57d('0x37')],{'$or':_[_0xd57d('0x2a')](_0x4a8a53,function(_0x47be4a){if(_0x47be4a[_0xd57d('0x3b')]!=='VIRTUAL'){var _0x961e36={};_0x961e36[_0x47be4a[_0xd57d('0x27')]]={'$like':'%'+_0x51d01e[_0xd57d('0x30')][_0xd57d('0x39')]+'%'};return _0x961e36;}})});}_0x17bb9b=_[_0xd57d('0x3a')]({},_0x17bb9b,_0x51d01e[_0xd57d('0x3c')]);var _0x338697={'where':_0x17bb9b[_0xd57d('0x37')]};return db[_0xd57d('0x2b')][_0xd57d('0x1e')](_0x338697)[_0xd57d('0x23')](function(_0x30b220){_0x2b2606[_0xd57d('0x1e')]=_0x30b220;if(_0x51d01e[_0xd57d('0x30')][_0xd57d('0x3d')]){_0x17bb9b[_0xd57d('0x3e')]=[{'all':!![]}];}return db[_0xd57d('0x2b')][_0xd57d('0x3f')](_0x17bb9b);})['then'](function(_0x4c1116){_0x2b2606[_0xd57d('0x40')]=_0x4c1116;return _0x2b2606;})['then'](respondWithFilteredResult(_0x5dca86,_0x17bb9b))[_0xd57d('0x41')](handleError(_0x5dca86,null));};exports['show']=function(_0x2ea787,_0x3007ce){var _0x5243a0={'raw':!![],'where':{'id':_0x2ea787['params']['id']}},_0x4782dc={};_0x4782dc[_0xd57d('0x2e')]=_[_0xd57d('0x2f')](db[_0xd57d('0x2b')]['rawAttributes']);_0x4782dc['query']=_[_0xd57d('0x2f')](_0x2ea787[_0xd57d('0x30')]);_0x4782dc[_0xd57d('0x31')]=_['intersection'](_0x4782dc['model'],_0x4782dc['query']);_0x5243a0[_0xd57d('0x33')]=_[_0xd57d('0x32')](_0x4782dc[_0xd57d('0x2e')],qs[_0xd57d('0x42')](_0x2ea787[_0xd57d('0x30')]['fields']));_0x5243a0[_0xd57d('0x33')]=_0x5243a0[_0xd57d('0x33')][_0xd57d('0x43')]?_0x5243a0['attributes']:_0x4782dc[_0xd57d('0x2e')];if(_0x2ea787[_0xd57d('0x30')][_0xd57d('0x3d')]){_0x5243a0[_0xd57d('0x3e')]=[{'all':!![]}];}_0x5243a0=_[_0xd57d('0x3a')]({},_0x5243a0,_0x2ea787[_0xd57d('0x3c')]);return db[_0xd57d('0x2b')]['find'](_0x5243a0)[_0xd57d('0x23')](handleEntityNotFound(_0x3007ce,null))['then'](respondWithResult(_0x3007ce,null))[_0xd57d('0x41')](handleError(_0x3007ce,null));};exports[_0xd57d('0x44')]=function(_0x342cee,_0x1195bc){return db[_0xd57d('0x2b')][_0xd57d('0x44')](_0x342cee[_0xd57d('0x45')],{})['then'](respondWithResult(_0x1195bc,0xc9))['catch'](handleError(_0x1195bc,null));};exports[_0xd57d('0x22')]=function(_0x2ba2dc,_0x53f440){if(_0x2ba2dc['body']['id']){delete _0x2ba2dc[_0xd57d('0x45')]['id'];}return db[_0xd57d('0x2b')]['find']({'where':{'id':_0x2ba2dc[_0xd57d('0x46')]['id']}})[_0xd57d('0x23')](handleEntityNotFound(_0x53f440,null))[_0xd57d('0x23')](saveUpdates(_0x2ba2dc[_0xd57d('0x45')],null))['then'](respondWithResult(_0x53f440,null))['catch'](handleError(_0x53f440,null));};exports[_0xd57d('0x47')]=function(_0xacfaa4,_0x1d5020){return db['AnalyticTreeReport'][_0xd57d('0x48')]({'where':{'id':_0xacfaa4['params']['id']}})[_0xd57d('0x23')](handleEntityNotFound(_0x1d5020,null))[_0xd57d('0x23')](removeEntity(_0x1d5020,null))[_0xd57d('0x41')](handleError(_0x1d5020,null));}; \ No newline at end of file +var _0x27d7=['pick','filter','merge','type','VIRTUAL','count','includeAll','catch','show','params','fields','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','AnalyticTreeReport','rawAttributes','key','map','keys','query','filters','intersection','model','attributes','length','nolimit','order','sort','where'];(function(_0x470137,_0x41829f){var _0x3737e0=function(_0x4b652e){while(--_0x4b652e){_0x470137['push'](_0x470137['shift']());}};_0x3737e0(++_0x41829f);}(_0x27d7,0xa7));var _0x727d=function(_0x51e5bd,_0x3c2cf1){_0x51e5bd=_0x51e5bd-0x0;var _0x250aed=_0x27d7[_0x51e5bd];return _0x250aed;};'use strict';var emlformat=require(_0x727d('0x0'));var rimraf=require(_0x727d('0x1'));var zipdir=require(_0x727d('0x2'));var jsonpatch=require(_0x727d('0x3'));var rp=require(_0x727d('0x4'));var moment=require('moment');var BPromise=require(_0x727d('0x5'));var Mustache=require('mustache');var util=require(_0x727d('0x6'));var path=require('path');var sox=require(_0x727d('0x7'));var csv=require(_0x727d('0x8'));var ejs=require(_0x727d('0x9'));var fs=require('fs');var fs_extra=require(_0x727d('0xa'));var _=require(_0x727d('0xb'));var squel=require(_0x727d('0xc'));var crypto=require(_0x727d('0xd'));var jsforce=require(_0x727d('0xe'));var deskjs=require(_0x727d('0xf'));var toCsv=require(_0x727d('0x8'));var querystring=require('querystring');var Papa=require(_0x727d('0x10'));var Redis=require(_0x727d('0x11'));var authService=require(_0x727d('0x12'));var qs=require(_0x727d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x727d('0x14'));var logger=require(_0x727d('0x15'))(_0x727d('0x16'));var utils=require(_0x727d('0x17'));var config=require(_0x727d('0x18'));var licenseUtil=require(_0x727d('0x19'));var db=require(_0x727d('0x1a'))['db'];function respondWithStatusCode(_0x321068,_0x1ca9c7){_0x1ca9c7=_0x1ca9c7||0xcc;return function(_0x1d860c){if(_0x1d860c){return _0x321068[_0x727d('0x1b')](_0x1ca9c7);}return _0x321068['status'](_0x1ca9c7)[_0x727d('0x1c')]();};}function respondWithResult(_0x429a79,_0x48821d){_0x48821d=_0x48821d||0xc8;return function(_0x12d790){if(_0x12d790){return _0x429a79[_0x727d('0x1d')](_0x48821d)[_0x727d('0x1e')](_0x12d790);}};}function respondWithFilteredResult(_0x11832c,_0x396d42){return function(_0x1a2467){if(_0x1a2467){var _0x303fea=typeof _0x396d42[_0x727d('0x1f')]===_0x727d('0x20')&&typeof _0x396d42[_0x727d('0x21')]==='undefined';var _0x513849=_0x1a2467['count'];var _0x403fac=_0x303fea?0x0:_0x396d42[_0x727d('0x1f')];var _0x3cc4dc=_0x303fea?_0x1a2467['count']:_0x396d42['offset']+_0x396d42[_0x727d('0x21')];var _0x594e80;if(_0x3cc4dc>=_0x513849){_0x3cc4dc=_0x513849;_0x594e80=0xc8;}else{_0x594e80=0xce;}_0x11832c[_0x727d('0x1d')](_0x594e80);return _0x11832c[_0x727d('0x22')](_0x727d('0x23'),_0x403fac+'-'+_0x3cc4dc+'/'+_0x513849)[_0x727d('0x1e')](_0x1a2467);}return null;};}function patchUpdates(_0x8b6a01){return function(_0xe32817){try{jsonpatch[_0x727d('0x24')](_0xe32817,_0x8b6a01,!![]);}catch(_0x8d51a0){return BPromise[_0x727d('0x25')](_0x8d51a0);}return _0xe32817[_0x727d('0x26')]();};}function saveUpdates(_0x5d0772,_0x22c65e){return function(_0x376e35){if(_0x376e35){return _0x376e35[_0x727d('0x27')](_0x5d0772)[_0x727d('0x28')](function(_0x20ff11){return _0x20ff11;});}return null;};}function removeEntity(_0x48ac12,_0x3d5677){return function(_0x466ced){if(_0x466ced){return _0x466ced[_0x727d('0x29')]()[_0x727d('0x28')](function(){_0x48ac12['status'](0xcc)[_0x727d('0x1c')]();});}};}function handleEntityNotFound(_0x5f19c3,_0x4055bf){return function(_0x55559e){if(!_0x55559e){_0x5f19c3[_0x727d('0x1b')](0x194);}return _0x55559e;};}function handleError(_0x1cb4fa,_0x2db44f){_0x2db44f=_0x2db44f||0x1f4;return function(_0x43fe4d){logger[_0x727d('0x2a')](_0x43fe4d['stack']);if(_0x43fe4d['name']){delete _0x43fe4d[_0x727d('0x2b')];}_0x1cb4fa[_0x727d('0x1d')](_0x2db44f)[_0x727d('0x2c')](_0x43fe4d);};}exports[_0x727d('0x2d')]=function(_0x3fc033,_0x3d1081){var _0x160bd0={},_0x1db63b={},_0x4b8e45={'count':0x0,'rows':[]};var _0x47df5d=_['map'](db[_0x727d('0x2e')][_0x727d('0x2f')],function(_0x21fc5c){return{'name':_0x21fc5c['fieldName'],'type':_0x21fc5c['type'][_0x727d('0x30')]};});_0x1db63b['model']=_[_0x727d('0x31')](_0x47df5d,_0x727d('0x2b'));_0x1db63b['query']=_[_0x727d('0x32')](_0x3fc033[_0x727d('0x33')]);_0x1db63b[_0x727d('0x34')]=_[_0x727d('0x35')](_0x1db63b[_0x727d('0x36')],_0x1db63b[_0x727d('0x33')]);_0x160bd0[_0x727d('0x37')]=_['intersection'](_0x1db63b[_0x727d('0x36')],qs['fields'](_0x3fc033[_0x727d('0x33')]['fields']));_0x160bd0[_0x727d('0x37')]=_0x160bd0[_0x727d('0x37')][_0x727d('0x38')]?_0x160bd0[_0x727d('0x37')]:_0x1db63b[_0x727d('0x36')];if(!_0x3fc033[_0x727d('0x33')]['hasOwnProperty'](_0x727d('0x39'))){_0x160bd0[_0x727d('0x21')]=qs[_0x727d('0x21')](_0x3fc033[_0x727d('0x33')][_0x727d('0x21')]);_0x160bd0[_0x727d('0x1f')]=qs[_0x727d('0x1f')](_0x3fc033[_0x727d('0x33')][_0x727d('0x1f')]);}_0x160bd0[_0x727d('0x3a')]=qs[_0x727d('0x3b')](_0x3fc033[_0x727d('0x33')][_0x727d('0x3b')]);_0x160bd0[_0x727d('0x3c')]=qs[_0x727d('0x34')](_[_0x727d('0x3d')](_0x3fc033['query'],_0x1db63b[_0x727d('0x34')]),_0x47df5d);if(_0x3fc033[_0x727d('0x33')][_0x727d('0x3e')]){_0x160bd0[_0x727d('0x3c')]=_[_0x727d('0x3f')](_0x160bd0[_0x727d('0x3c')],{'$or':_[_0x727d('0x31')](_0x47df5d,function(_0x55b1fc){if(_0x55b1fc[_0x727d('0x40')]!==_0x727d('0x41')){var _0x3c99a5={};_0x3c99a5[_0x55b1fc[_0x727d('0x2b')]]={'$like':'%'+_0x3fc033[_0x727d('0x33')][_0x727d('0x3e')]+'%'};return _0x3c99a5;}})});}_0x160bd0=_['merge']({},_0x160bd0,_0x3fc033['options']);var _0x2da1e3={'where':_0x160bd0[_0x727d('0x3c')]};return db[_0x727d('0x2e')]['count'](_0x2da1e3)[_0x727d('0x28')](function(_0x1f4a23){_0x4b8e45[_0x727d('0x42')]=_0x1f4a23;if(_0x3fc033[_0x727d('0x33')][_0x727d('0x43')]){_0x160bd0['include']=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x160bd0);})[_0x727d('0x28')](function(_0x5e4cc3){_0x4b8e45['rows']=_0x5e4cc3;return _0x4b8e45;})[_0x727d('0x28')](respondWithFilteredResult(_0x3d1081,_0x160bd0))[_0x727d('0x44')](handleError(_0x3d1081,null));};exports[_0x727d('0x45')]=function(_0x4f8ee3,_0x15db7c){var _0x4794c0={'raw':!![],'where':{'id':_0x4f8ee3[_0x727d('0x46')]['id']}},_0x3f9dd5={};_0x3f9dd5['model']=_[_0x727d('0x32')](db['AnalyticTreeReport'][_0x727d('0x2f')]);_0x3f9dd5[_0x727d('0x33')]=_['keys'](_0x4f8ee3[_0x727d('0x33')]);_0x3f9dd5[_0x727d('0x34')]=_['intersection'](_0x3f9dd5['model'],_0x3f9dd5[_0x727d('0x33')]);_0x4794c0[_0x727d('0x37')]=_['intersection'](_0x3f9dd5[_0x727d('0x36')],qs[_0x727d('0x47')](_0x4f8ee3[_0x727d('0x33')][_0x727d('0x47')]));_0x4794c0[_0x727d('0x37')]=_0x4794c0[_0x727d('0x37')]['length']?_0x4794c0[_0x727d('0x37')]:_0x3f9dd5[_0x727d('0x36')];if(_0x4f8ee3[_0x727d('0x33')][_0x727d('0x43')]){_0x4794c0[_0x727d('0x48')]=[{'all':!![]}];}_0x4794c0=_[_0x727d('0x3f')]({},_0x4794c0,_0x4f8ee3['options']);return db[_0x727d('0x2e')][_0x727d('0x49')](_0x4794c0)['then'](handleEntityNotFound(_0x15db7c,null))[_0x727d('0x28')](respondWithResult(_0x15db7c,null))['catch'](handleError(_0x15db7c,null));};exports[_0x727d('0x4a')]=function(_0x1e5dec,_0x4699a2){return db[_0x727d('0x2e')][_0x727d('0x4a')](_0x1e5dec[_0x727d('0x4b')],{})[_0x727d('0x28')](respondWithResult(_0x4699a2,0xc9))[_0x727d('0x44')](handleError(_0x4699a2,null));};exports[_0x727d('0x27')]=function(_0x2e6407,_0x1cacd8){if(_0x2e6407['body']['id']){delete _0x2e6407[_0x727d('0x4b')]['id'];}return db[_0x727d('0x2e')]['find']({'where':{'id':_0x2e6407['params']['id']}})[_0x727d('0x28')](handleEntityNotFound(_0x1cacd8,null))[_0x727d('0x28')](saveUpdates(_0x2e6407[_0x727d('0x4b')],null))[_0x727d('0x28')](respondWithResult(_0x1cacd8,null))[_0x727d('0x44')](handleError(_0x1cacd8,null));};exports[_0x727d('0x29')]=function(_0x90c82e,_0x4d81c1){return db[_0x727d('0x2e')][_0x727d('0x49')]({'where':{'id':_0x90c82e[_0x727d('0x46')]['id']}})[_0x727d('0x28')](handleEntityNotFound(_0x4d81c1,null))['then'](removeEntity(_0x4d81c1,null))[_0x727d('0x44')](handleError(_0x4d81c1,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index e4981a7..1b8f523 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 _0xce9b=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x403fc7,_0x32931a){var _0x5d0827=function(_0x5ea698){while(--_0x5ea698){_0x403fc7['push'](_0x403fc7['shift']());}};_0x5d0827(++_0x32931a);}(_0xce9b,0x161));var _0xbce9=function(_0x285471,_0x459f2c){_0x285471=_0x285471-0x0;var _0x419a80=_0xce9b[_0x285471];return _0x419a80;};'use strict';var _=require(_0xbce9('0x0'));var util=require(_0xbce9('0x1'));var logger=require(_0xbce9('0x2'))(_0xbce9('0x3'));var moment=require(_0xbce9('0x4'));var BPromise=require(_0xbce9('0x5'));var rp=require(_0xbce9('0x6'));var fs=require('fs');var path=require(_0xbce9('0x7'));var rimraf=require(_0xbce9('0x8'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0xbce9('0x9')]=function(_0xabb3be,_0x492687){return _0xabb3be[_0xbce9('0xa')](_0xbce9('0xb'),attributes,{'tableName':_0xbce9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf96=['path','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','moment','bluebird'];(function(_0x5a5f0f,_0x197f35){var _0x5d2113=function(_0x4ea33c){while(--_0x4ea33c){_0x5a5f0f['push'](_0x5a5f0f['shift']());}};_0x5d2113(++_0x197f35);}(_0xaf96,0x8b));var _0x6af9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf96[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6af9('0x0'));var logger=require(_0x6af9('0x1'))(_0x6af9('0x2'));var moment=require(_0x6af9('0x3'));var BPromise=require(_0x6af9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6af9('0x5'));var rimraf=require('rimraf');var config=require(_0x6af9('0x6'));var attributes=require(_0x6af9('0x7'));module[_0x6af9('0x8')]=function(_0x3dd17a,_0x2939bc){return _0x3dd17a[_0x6af9('0x9')](_0x6af9('0xa'),attributes,{'tableName':_0x6af9('0xb'),'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 ac1c0c7..19083e7 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x6b475b,_0x3b9f10){var _0x472550=function(_0x3af4f2){while(--_0x3af4f2){_0x6b475b['push'](_0x6b475b['shift']());}};_0x472550(++_0x3b9f10);}(_0x2ef3,0xba));var _0x32ef=function(_0x22ad81,_0x328bca){_0x22ad81=_0x22ad81-0x0;var _0x5f0a47=_0x2ef3[_0x22ad81];return _0x5f0a47;};'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')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x5e62e9,_0x566fed){_0x5e62e9=_0x5e62e9-0x0;var _0x32271e=_0x7a54[_0x5e62e9];return _0x32271e;};'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')]('AnalyticTreeReport,\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/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 5cd6a4c..39f8526 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 _0x408c=['isAuthenticated','show','create','put','update','delete','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x397017,_0x40fdfd){var _0x58a0d1=function(_0x4bd681){while(--_0x4bd681){_0x397017['push'](_0x397017['shift']());}};_0x58a0d1(++_0x40fdfd);}(_0x408c,0x1e7));var _0xc408=function(_0x3ab5cb,_0x5b9e3d){_0x3ab5cb=_0x3ab5cb-0x0;var _0x46facb=_0x408c[_0x3ab5cb];return _0x46facb;};'use strict';var multer=require('multer');var util=require(_0xc408('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc408('0x1'));var router=express[_0xc408('0x2')]();var fs_extra=require(_0xc408('0x3'));var auth=require(_0xc408('0x4'));var interaction=require(_0xc408('0x5'));var config=require(_0xc408('0x6'));var controller=require('./analyticTreeReport.controller');router[_0xc408('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc408('0x8'),auth[_0xc408('0x9')](),controller[_0xc408('0xa')]);router['post']('/',auth[_0xc408('0x9')](),controller[_0xc408('0xb')]);router[_0xc408('0xc')]('/:id',auth[_0xc408('0x9')](),controller[_0xc408('0xd')]);router[_0xc408('0xe')](_0xc408('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xc408('0xf')]=router; \ No newline at end of file +var _0xaeae=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3810f6,_0x41f38f){var _0x442125=function(_0x394205){while(--_0x394205){_0x3810f6['push'](_0x3810f6['shift']());}};_0x442125(++_0x41f38f);}(_0xaeae,0xa1));var _0xeaea=function(_0x14151d,_0x9bc455){_0x14151d=_0x14151d-0x0;var _0x371652=_0xaeae[_0x14151d];return _0x371652;};'use strict';var multer=require(_0xeaea('0x0'));var util=require(_0xeaea('0x1'));var path=require(_0xeaea('0x2'));var timeout=require(_0xeaea('0x3'));var express=require(_0xeaea('0x4'));var router=express[_0xeaea('0x5')]();var fs_extra=require(_0xeaea('0x6'));var auth=require(_0xeaea('0x7'));var interaction=require(_0xeaea('0x8'));var config=require(_0xeaea('0x9'));var controller=require(_0xeaea('0xa'));router[_0xeaea('0xb')]('/',auth[_0xeaea('0xc')](),controller[_0xeaea('0xd')]);router['get'](_0xeaea('0xe'),auth[_0xeaea('0xc')](),controller[_0xeaea('0xf')]);router[_0xeaea('0x10')]('/',auth[_0xeaea('0xc')](),controller['create']);router[_0xeaea('0x11')](_0xeaea('0xe'),auth[_0xeaea('0xc')](),controller[_0xeaea('0x12')]);router[_0xeaea('0x13')](_0xeaea('0xe'),auth['isAuthenticated'](),controller[_0xeaea('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 89ff408..59bb1d7 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 _0xc818=['sequelize','exports','STRING'];(function(_0x364779,_0x1e70a1){var _0x243d94=function(_0xde1cba){while(--_0xde1cba){_0x364779['push'](_0x364779['shift']());}};_0x243d94(++_0x1e70a1);}(_0xc818,0x1e3));var _0x8c81=function(_0x24cecc,_0x29b88b){_0x24cecc=_0x24cecc-0x0;var _0x3b9e78=_0xc818[_0x24cecc];return _0x3b9e78;};'use strict';var Sequelize=require(_0x8c81('0x0'));module[_0x8c81('0x1')]={'name':{'type':Sequelize[_0x8c81('0x2')]},'basename':{'type':Sequelize[_0x8c81('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb6b1=['STRING','sequelize'];(function(_0x3f9584,_0x5ab12c){var _0x9d54c=function(_0x2882df){while(--_0x2882df){_0x3f9584['push'](_0x3f9584['shift']());}};_0x9d54c(++_0x5ab12c);}(_0xb6b1,0x17b));var _0x1b6b=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0xb6b1[_0xa79977];return _0x109f10;};'use strict';var Sequelize=require(_0x1b6b('0x0'));module['exports']={'name':{'type':Sequelize[_0x1b6b('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1b6b('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index dbd065e..a189964 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 _0xacfa=['createdAt','updatedAt','body','omit','create','file','originalname','basename','filename','mimetype','download','join','root','server/files/attachments/','offline-chat/','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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','end','status','offset','undefined','count','limit','set','apply','save','update','destroy','stack','name','send','Attachment','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','then','includeAll','findAll','rows','catch','params','length','clone','find','get'];(function(_0x247d6d,_0x26be90){var _0x2e56f4=function(_0x365e10){while(--_0x365e10){_0x247d6d['push'](_0x247d6d['shift']());}};_0x2e56f4(++_0x26be90);}(_0xacfa,0x1bd));var _0xaacf=function(_0x124817,_0x1888f2){_0x124817=_0x124817-0x0;var _0x1d80a9=_0xacfa[_0x124817];return _0x1d80a9;};'use strict';var emlformat=require(_0xaacf('0x0'));var rimraf=require(_0xaacf('0x1'));var zipdir=require(_0xaacf('0x2'));var jsonpatch=require(_0xaacf('0x3'));var rp=require(_0xaacf('0x4'));var moment=require(_0xaacf('0x5'));var BPromise=require(_0xaacf('0x6'));var Mustache=require('mustache');var util=require(_0xaacf('0x7'));var path=require(_0xaacf('0x8'));var sox=require(_0xaacf('0x9'));var csv=require(_0xaacf('0xa'));var ejs=require(_0xaacf('0xb'));var fs=require('fs');var fs_extra=require(_0xaacf('0xc'));var _=require('lodash');var squel=require(_0xaacf('0xd'));var crypto=require(_0xaacf('0xe'));var jsforce=require(_0xaacf('0xf'));var deskjs=require(_0xaacf('0x10'));var toCsv=require(_0xaacf('0xa'));var querystring=require(_0xaacf('0x11'));var Papa=require(_0xaacf('0x12'));var Redis=require(_0xaacf('0x13'));var authService=require(_0xaacf('0x14'));var qs=require(_0xaacf('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaacf('0x16'))(_0xaacf('0x17'));var utils=require(_0xaacf('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x344ec5,_0x4d2edf){_0x4d2edf=_0x4d2edf||0xcc;return function(_0x344520){if(_0x344520){return _0x344ec5[_0xaacf('0x19')](_0x4d2edf);}return _0x344ec5['status'](_0x4d2edf)[_0xaacf('0x1a')]();};}function respondWithResult(_0x4d7d3d,_0x5551bc){_0x5551bc=_0x5551bc||0xc8;return function(_0x39afad){if(_0x39afad){return _0x4d7d3d[_0xaacf('0x1b')](_0x5551bc)['json'](_0x39afad);}};}function respondWithFilteredResult(_0x2bacbc,_0xd9d502){return function(_0x1b2a4a){if(_0x1b2a4a){var _0x341fd5=typeof _0xd9d502[_0xaacf('0x1c')]==='undefined'&&typeof _0xd9d502['limit']===_0xaacf('0x1d');var _0x4fbabb=_0x1b2a4a[_0xaacf('0x1e')];var _0x53b12b=_0x341fd5?0x0:_0xd9d502['offset'];var _0x29bd38=_0x341fd5?_0x1b2a4a['count']:_0xd9d502[_0xaacf('0x1c')]+_0xd9d502[_0xaacf('0x1f')];var _0x2ae06a;if(_0x29bd38>=_0x4fbabb){_0x29bd38=_0x4fbabb;_0x2ae06a=0xc8;}else{_0x2ae06a=0xce;}_0x2bacbc[_0xaacf('0x1b')](_0x2ae06a);return _0x2bacbc[_0xaacf('0x20')]('Content-Range',_0x53b12b+'-'+_0x29bd38+'/'+_0x4fbabb)['json'](_0x1b2a4a);}return null;};}function patchUpdates(_0x4ff008){return function(_0x3e7bd9){try{jsonpatch[_0xaacf('0x21')](_0x3e7bd9,_0x4ff008,!![]);}catch(_0x4ddfea){return BPromise['reject'](_0x4ddfea);}return _0x3e7bd9[_0xaacf('0x22')]();};}function saveUpdates(_0x5c10a0,_0x314cfb){return function(_0x813a9e){if(_0x813a9e){return _0x813a9e[_0xaacf('0x23')](_0x5c10a0)['then'](function(_0x30e197){return _0x30e197;});}return null;};}function removeEntity(_0x349a31,_0x2445ec){return function(_0x160173){if(_0x160173){return _0x160173[_0xaacf('0x24')]()['then'](function(){_0x349a31[_0xaacf('0x1b')](0xcc)[_0xaacf('0x1a')]();});}};}function handleEntityNotFound(_0x9071fc,_0x3e5496){return function(_0x235979){if(!_0x235979){_0x9071fc[_0xaacf('0x19')](0x194);}return _0x235979;};}function handleError(_0x4b6a1a,_0x5049de){_0x5049de=_0x5049de||0x1f4;return function(_0x1baa47){logger['error'](_0x1baa47[_0xaacf('0x25')]);if(_0x1baa47[_0xaacf('0x26')]){delete _0x1baa47[_0xaacf('0x26')];}_0x4b6a1a[_0xaacf('0x1b')](_0x5049de)[_0xaacf('0x27')](_0x1baa47);};}exports['index']=function(_0x4a2ea4,_0x282c0c){var _0x1eacf9={},_0x127221={},_0x71ac1b={'count':0x0,'rows':[]};var _0x2eeaa0=_['map'](db[_0xaacf('0x28')][_0xaacf('0x29')],function(_0x570a43){return{'name':_0x570a43[_0xaacf('0x2a')],'type':_0x570a43['type'][_0xaacf('0x2b')]};});_0x127221[_0xaacf('0x2c')]=_[_0xaacf('0x2d')](_0x2eeaa0,_0xaacf('0x26'));_0x127221['query']=_[_0xaacf('0x2e')](_0x4a2ea4[_0xaacf('0x2f')]);_0x127221[_0xaacf('0x30')]=_[_0xaacf('0x31')](_0x127221[_0xaacf('0x2c')],_0x127221['query']);_0x1eacf9[_0xaacf('0x32')]=_[_0xaacf('0x31')](_0x127221[_0xaacf('0x2c')],qs[_0xaacf('0x33')](_0x4a2ea4[_0xaacf('0x2f')][_0xaacf('0x33')]));_0x1eacf9['attributes']=_0x1eacf9[_0xaacf('0x32')]['length']?_0x1eacf9['attributes']:_0x127221[_0xaacf('0x2c')];if(!_0x4a2ea4[_0xaacf('0x2f')][_0xaacf('0x34')](_0xaacf('0x35'))){_0x1eacf9['limit']=qs[_0xaacf('0x1f')](_0x4a2ea4['query'][_0xaacf('0x1f')]);_0x1eacf9['offset']=qs[_0xaacf('0x1c')](_0x4a2ea4[_0xaacf('0x2f')]['offset']);}_0x1eacf9['order']=qs[_0xaacf('0x36')](_0x4a2ea4[_0xaacf('0x2f')]['sort']);_0x1eacf9[_0xaacf('0x37')]=qs[_0xaacf('0x30')](_['pick'](_0x4a2ea4[_0xaacf('0x2f')],_0x127221[_0xaacf('0x30')]),_0x2eeaa0);if(_0x4a2ea4[_0xaacf('0x2f')][_0xaacf('0x38')]){_0x1eacf9[_0xaacf('0x37')]=_[_0xaacf('0x39')](_0x1eacf9[_0xaacf('0x37')],{'$or':_[_0xaacf('0x2d')](_0x2eeaa0,function(_0x37d3fa){if(_0x37d3fa[_0xaacf('0x3a')]!==_0xaacf('0x3b')){var _0x283f7f={};_0x283f7f[_0x37d3fa['name']]={'$like':'%'+_0x4a2ea4['query']['filter']+'%'};return _0x283f7f;}})});}_0x1eacf9=_['merge']({},_0x1eacf9,_0x4a2ea4[_0xaacf('0x3c')]);var _0xe008e7={'where':_0x1eacf9[_0xaacf('0x37')]};return db['Attachment'][_0xaacf('0x1e')](_0xe008e7)[_0xaacf('0x3d')](function(_0x3c62d7){_0x71ac1b['count']=_0x3c62d7;if(_0x4a2ea4[_0xaacf('0x2f')][_0xaacf('0x3e')]){_0x1eacf9['include']=[{'all':!![]}];}return db[_0xaacf('0x28')][_0xaacf('0x3f')](_0x1eacf9);})[_0xaacf('0x3d')](function(_0x3dc0ee){_0x71ac1b[_0xaacf('0x40')]=_0x3dc0ee;return _0x71ac1b;})[_0xaacf('0x3d')](respondWithFilteredResult(_0x282c0c,_0x1eacf9))[_0xaacf('0x41')](handleError(_0x282c0c,null));};exports['show']=function(_0x1a9de7,_0x64cf93){var _0x3f2a0d={'raw':!![],'where':{'id':_0x1a9de7[_0xaacf('0x42')]['id']}},_0x3c0c20={};_0x3c0c20[_0xaacf('0x2c')]=_[_0xaacf('0x2e')](db[_0xaacf('0x28')][_0xaacf('0x29')]);_0x3c0c20[_0xaacf('0x2f')]=_[_0xaacf('0x2e')](_0x1a9de7[_0xaacf('0x2f')]);_0x3c0c20[_0xaacf('0x30')]=_[_0xaacf('0x31')](_0x3c0c20['model'],_0x3c0c20[_0xaacf('0x2f')]);_0x3f2a0d[_0xaacf('0x32')]=_[_0xaacf('0x31')](_0x3c0c20['model'],qs[_0xaacf('0x33')](_0x1a9de7[_0xaacf('0x2f')][_0xaacf('0x33')]));_0x3f2a0d[_0xaacf('0x32')]=_0x3f2a0d[_0xaacf('0x32')][_0xaacf('0x43')]?_0x3f2a0d[_0xaacf('0x32')]:_0x3c0c20[_0xaacf('0x2c')];if(_0x1a9de7[_0xaacf('0x2f')]['includeAll']){_0x3f2a0d['include']=[{'all':!![]}];}_0x3f2a0d=_['merge']({},_0x3f2a0d,_0x1a9de7[_0xaacf('0x3c')]);return db[_0xaacf('0x28')]['find'](_0x3f2a0d)[_0xaacf('0x3d')](handleEntityNotFound(_0x64cf93,null))[_0xaacf('0x3d')](respondWithResult(_0x64cf93,null))['catch'](handleError(_0x64cf93,null));};exports[_0xaacf('0x44')]=function(_0x53c2dd,_0x36d2cb){var _0x57cdab={'where':{'id':_0x53c2dd[_0xaacf('0x42')]['id']}},_0x18e3e0={};_0x18e3e0[_0xaacf('0x2c')]=_[_0xaacf('0x2e')](db[_0xaacf('0x28')]['rawAttributes']);_0x57cdab[_0xaacf('0x32')]=_[_0xaacf('0x31')](_0x18e3e0[_0xaacf('0x2c')],qs[_0xaacf('0x33')](_0x53c2dd[_0xaacf('0x2f')][_0xaacf('0x33')]));_0x57cdab[_0xaacf('0x32')]=_0x57cdab[_0xaacf('0x32')]['length']?_0x57cdab[_0xaacf('0x32')]:_0x18e3e0['model'];if(_0x53c2dd['query'][_0xaacf('0x3e')]){_0x57cdab['include']=[{'all':!![]}];}_0x57cdab=_[_0xaacf('0x39')]({},_0x57cdab,_0x53c2dd['options']);return db[_0xaacf('0x28')][_0xaacf('0x45')](_0x57cdab)[_0xaacf('0x3d')](handleEntityNotFound(_0x36d2cb,null))[_0xaacf('0x3d')](function(_0x33ceb6){if(_0x33ceb6){var _0x1000ef=_0x33ceb6[_0xaacf('0x46')]({'plain':!![]});_0x1000ef=qs['omit'](_0x1000ef,['id',_0xaacf('0x47'),_0xaacf('0x48')]);_0x53c2dd[_0xaacf('0x49')]=_[_0xaacf('0x4a')](_0x53c2dd[_0xaacf('0x49')],['id',_0xaacf('0x47'),_0xaacf('0x48')]);return db[_0xaacf('0x28')][_0xaacf('0x4b')](_[_0xaacf('0x39')](_0x1000ef,_0x53c2dd['body']),{'include':_0x53c2dd['query'][_0xaacf('0x3e')]?[{'all':!![]}]:undefined});}})[_0xaacf('0x3d')](respondWithResult(_0x36d2cb,0xc9))[_0xaacf('0x41')](handleError(_0x36d2cb,null));};exports[_0xaacf('0x23')]=function(_0x4c11dc,_0x16f859){if(_0x4c11dc['body']['id']){delete _0x4c11dc[_0xaacf('0x49')]['id'];}return db[_0xaacf('0x28')][_0xaacf('0x45')]({'where':{'id':_0x4c11dc[_0xaacf('0x42')]['id']}})[_0xaacf('0x3d')](handleEntityNotFound(_0x16f859,null))[_0xaacf('0x3d')](saveUpdates(_0x4c11dc['body'],null))[_0xaacf('0x3d')](respondWithResult(_0x16f859,null))['catch'](handleError(_0x16f859,null));};exports['destroy']=function(_0xa7443,_0x5677bd){return db[_0xaacf('0x28')][_0xaacf('0x45')]({'where':{'id':_0xa7443[_0xaacf('0x42')]['id']}})[_0xaacf('0x3d')](handleEntityNotFound(_0x5677bd,null))[_0xaacf('0x3d')](removeEntity(_0x5677bd,null))[_0xaacf('0x41')](handleError(_0x5677bd,null));};exports[_0xaacf('0x4b')]=function(_0x3cb229,_0xa6457a,_0x4e57ad){_0x3cb229[_0xaacf('0x49')][_0xaacf('0x26')]=_0x3cb229[_0xaacf('0x4c')][_0xaacf('0x4d')];_0x3cb229[_0xaacf('0x49')][_0xaacf('0x4e')]=_0x3cb229[_0xaacf('0x4c')][_0xaacf('0x4f')];_0x3cb229[_0xaacf('0x49')][_0xaacf('0x3a')]=_0x3cb229[_0xaacf('0x4c')][_0xaacf('0x50')];return db['Attachment'][_0xaacf('0x4b')](_0x3cb229[_0xaacf('0x49')])[_0xaacf('0x3d')](respondWithResult(_0xa6457a,0xc9))[_0xaacf('0x41')](handleError(_0xa6457a,null));};exports[_0xaacf('0x51')]=function(_0x22fad1,_0x129ed7,_0x507975){return db['Attachment']['findOne']({'where':{'id':_0x22fad1[_0xaacf('0x42')]['id']},'raw':!![]})[_0xaacf('0x3d')](handleEntityNotFound(_0x129ed7,null))[_0xaacf('0x3d')](function(_0x508ee6){if(_0x508ee6){var _0x4c9ad8=_0x508ee6['ChatOfflineMessageId']!==null;var _0x3ab995=path[_0xaacf('0x52')](config[_0xaacf('0x53')],_0xaacf('0x54'));if(_0x4c9ad8){_0x3ab995=path[_0xaacf('0x52')](_0x3ab995,_0xaacf('0x55'));}var _0x1243ba=path['join'](_0x3ab995,_0x508ee6['basename']);return _0x129ed7['download'](_0x1243ba);}})[_0xaacf('0x41')](handleError(_0x129ed7,null));}; \ No newline at end of file +var _0x95ae=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','Attachment','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','fields','includeAll','merge','find','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel'];(function(_0x55c485,_0x3fe77e){var _0x6bb521=function(_0x466a3d){while(--_0x466a3d){_0x55c485['push'](_0x55c485['shift']());}};_0x6bb521(++_0x3fe77e);}(_0x95ae,0xb1));var _0xe95a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x95ae[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0xe95a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe95a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe95a('0x2'));var moment=require(_0xe95a('0x3'));var BPromise=require(_0xe95a('0x4'));var Mustache=require(_0xe95a('0x5'));var util=require(_0xe95a('0x6'));var path=require(_0xe95a('0x7'));var sox=require(_0xe95a('0x8'));var csv=require('to-csv');var ejs=require(_0xe95a('0x9'));var fs=require('fs');var fs_extra=require(_0xe95a('0xa'));var _=require(_0xe95a('0xb'));var squel=require(_0xe95a('0xc'));var crypto=require(_0xe95a('0xd'));var jsforce=require(_0xe95a('0xe'));var deskjs=require(_0xe95a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe95a('0x10'));var Papa=require(_0xe95a('0x11'));var Redis=require(_0xe95a('0x12'));var authService=require(_0xe95a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe95a('0x14'));var hardwareService=require(_0xe95a('0x15'));var logger=require('../../config/logger')(_0xe95a('0x16'));var utils=require(_0xe95a('0x17'));var config=require(_0xe95a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe95a('0x19'))['db'];function respondWithStatusCode(_0x24b257,_0x564a3d){_0x564a3d=_0x564a3d||0xcc;return function(_0x15e61c){if(_0x15e61c){return _0x24b257['sendStatus'](_0x564a3d);}return _0x24b257[_0xe95a('0x1a')](_0x564a3d)[_0xe95a('0x1b')]();};}function respondWithResult(_0x1447af,_0x25ab84){_0x25ab84=_0x25ab84||0xc8;return function(_0x44c517){if(_0x44c517){return _0x1447af[_0xe95a('0x1a')](_0x25ab84)[_0xe95a('0x1c')](_0x44c517);}};}function respondWithFilteredResult(_0xe4787d,_0x482013){return function(_0x5ceb8f){if(_0x5ceb8f){var _0x45ea0c=typeof _0x482013[_0xe95a('0x1d')]===_0xe95a('0x1e')&&typeof _0x482013[_0xe95a('0x1f')]===_0xe95a('0x1e');var _0x350ce3=_0x5ceb8f[_0xe95a('0x20')];var _0x46ee37=_0x45ea0c?0x0:_0x482013[_0xe95a('0x1d')];var _0xb1e685=_0x45ea0c?_0x5ceb8f[_0xe95a('0x20')]:_0x482013[_0xe95a('0x1d')]+_0x482013['limit'];var _0x11dc7b;if(_0xb1e685>=_0x350ce3){_0xb1e685=_0x350ce3;_0x11dc7b=0xc8;}else{_0x11dc7b=0xce;}_0xe4787d[_0xe95a('0x1a')](_0x11dc7b);return _0xe4787d[_0xe95a('0x21')](_0xe95a('0x22'),_0x46ee37+'-'+_0xb1e685+'/'+_0x350ce3)[_0xe95a('0x1c')](_0x5ceb8f);}return null;};}function patchUpdates(_0x3d90ea){return function(_0x15b873){try{jsonpatch[_0xe95a('0x23')](_0x15b873,_0x3d90ea,!![]);}catch(_0x30dfe5){return BPromise[_0xe95a('0x24')](_0x30dfe5);}return _0x15b873[_0xe95a('0x25')]();};}function saveUpdates(_0x3b04f6,_0x398270){return function(_0x257b2a){if(_0x257b2a){return _0x257b2a[_0xe95a('0x26')](_0x3b04f6)[_0xe95a('0x27')](function(_0x486451){return _0x486451;});}return null;};}function removeEntity(_0x56b347,_0x157cc3){return function(_0x1668c4){if(_0x1668c4){return _0x1668c4[_0xe95a('0x28')]()[_0xe95a('0x27')](function(){_0x56b347['status'](0xcc)[_0xe95a('0x1b')]();});}};}function handleEntityNotFound(_0x4e2174,_0x61925e){return function(_0x109bad){if(!_0x109bad){_0x4e2174[_0xe95a('0x29')](0x194);}return _0x109bad;};}function handleError(_0x24377b,_0x38534d){_0x38534d=_0x38534d||0x1f4;return function(_0x2e2e5a){logger[_0xe95a('0x2a')](_0x2e2e5a[_0xe95a('0x2b')]);if(_0x2e2e5a[_0xe95a('0x2c')]){delete _0x2e2e5a[_0xe95a('0x2c')];}_0x24377b[_0xe95a('0x1a')](_0x38534d)[_0xe95a('0x2d')](_0x2e2e5a);};}exports[_0xe95a('0x2e')]=function(_0x7984ec,_0x3cb7ff){var _0x2efdee={},_0x2902d3={},_0x3dc720={'count':0x0,'rows':[]};var _0x252ab1=_['map'](db[_0xe95a('0x2f')][_0xe95a('0x30')],function(_0x2674de){return{'name':_0x2674de[_0xe95a('0x31')],'type':_0x2674de['type'][_0xe95a('0x32')]};});_0x2902d3[_0xe95a('0x33')]=_['map'](_0x252ab1,'name');_0x2902d3[_0xe95a('0x34')]=_['keys'](_0x7984ec[_0xe95a('0x34')]);_0x2902d3[_0xe95a('0x35')]=_[_0xe95a('0x36')](_0x2902d3['model'],_0x2902d3[_0xe95a('0x34')]);_0x2efdee[_0xe95a('0x37')]=_[_0xe95a('0x36')](_0x2902d3[_0xe95a('0x33')],qs['fields'](_0x7984ec['query']['fields']));_0x2efdee['attributes']=_0x2efdee['attributes'][_0xe95a('0x38')]?_0x2efdee[_0xe95a('0x37')]:_0x2902d3[_0xe95a('0x33')];if(!_0x7984ec[_0xe95a('0x34')][_0xe95a('0x39')](_0xe95a('0x3a'))){_0x2efdee['limit']=qs['limit'](_0x7984ec[_0xe95a('0x34')][_0xe95a('0x1f')]);_0x2efdee[_0xe95a('0x1d')]=qs[_0xe95a('0x1d')](_0x7984ec[_0xe95a('0x34')]['offset']);}_0x2efdee[_0xe95a('0x3b')]=qs[_0xe95a('0x3c')](_0x7984ec['query'][_0xe95a('0x3c')]);_0x2efdee['where']=qs[_0xe95a('0x35')](_[_0xe95a('0x3d')](_0x7984ec[_0xe95a('0x34')],_0x2902d3[_0xe95a('0x35')]),_0x252ab1);if(_0x7984ec['query'][_0xe95a('0x3e')]){_0x2efdee[_0xe95a('0x3f')]=_['merge'](_0x2efdee['where'],{'$or':_['map'](_0x252ab1,function(_0x5e28e8){if(_0x5e28e8[_0xe95a('0x40')]!==_0xe95a('0x41')){var _0x3a0109={};_0x3a0109[_0x5e28e8[_0xe95a('0x2c')]]={'$like':'%'+_0x7984ec[_0xe95a('0x34')][_0xe95a('0x3e')]+'%'};return _0x3a0109;}})});}_0x2efdee=_['merge']({},_0x2efdee,_0x7984ec[_0xe95a('0x42')]);var _0x19f2ec={'where':_0x2efdee[_0xe95a('0x3f')]};return db['Attachment'][_0xe95a('0x20')](_0x19f2ec)[_0xe95a('0x27')](function(_0x1cf34c){_0x3dc720[_0xe95a('0x20')]=_0x1cf34c;if(_0x7984ec[_0xe95a('0x34')]['includeAll']){_0x2efdee[_0xe95a('0x43')]=[{'all':!![]}];}return db['Attachment'][_0xe95a('0x44')](_0x2efdee);})[_0xe95a('0x27')](function(_0x5cd4ea){_0x3dc720[_0xe95a('0x45')]=_0x5cd4ea;return _0x3dc720;})['then'](respondWithFilteredResult(_0x3cb7ff,_0x2efdee))[_0xe95a('0x46')](handleError(_0x3cb7ff,null));};exports[_0xe95a('0x47')]=function(_0x2e6dea,_0x561775){var _0x7cadbc={'raw':!![],'where':{'id':_0x2e6dea[_0xe95a('0x48')]['id']}},_0x8ed769={};_0x8ed769[_0xe95a('0x33')]=_[_0xe95a('0x49')](db[_0xe95a('0x2f')]['rawAttributes']);_0x8ed769['query']=_[_0xe95a('0x49')](_0x2e6dea[_0xe95a('0x34')]);_0x8ed769[_0xe95a('0x35')]=_[_0xe95a('0x36')](_0x8ed769[_0xe95a('0x33')],_0x8ed769[_0xe95a('0x34')]);_0x7cadbc[_0xe95a('0x37')]=_[_0xe95a('0x36')](_0x8ed769[_0xe95a('0x33')],qs['fields'](_0x2e6dea['query'][_0xe95a('0x4a')]));_0x7cadbc[_0xe95a('0x37')]=_0x7cadbc[_0xe95a('0x37')]['length']?_0x7cadbc[_0xe95a('0x37')]:_0x8ed769[_0xe95a('0x33')];if(_0x2e6dea[_0xe95a('0x34')][_0xe95a('0x4b')]){_0x7cadbc['include']=[{'all':!![]}];}_0x7cadbc=_[_0xe95a('0x4c')]({},_0x7cadbc,_0x2e6dea[_0xe95a('0x42')]);return db[_0xe95a('0x2f')]['find'](_0x7cadbc)['then'](handleEntityNotFound(_0x561775,null))[_0xe95a('0x27')](respondWithResult(_0x561775,null))[_0xe95a('0x46')](handleError(_0x561775,null));};exports['clone']=function(_0x53ae61,_0x40c020){var _0x2b2689={'where':{'id':_0x53ae61[_0xe95a('0x48')]['id']}},_0x15b1be={};_0x15b1be[_0xe95a('0x33')]=_[_0xe95a('0x49')](db[_0xe95a('0x2f')][_0xe95a('0x30')]);_0x2b2689[_0xe95a('0x37')]=_[_0xe95a('0x36')](_0x15b1be[_0xe95a('0x33')],qs['fields'](_0x53ae61[_0xe95a('0x34')][_0xe95a('0x4a')]));_0x2b2689[_0xe95a('0x37')]=_0x2b2689['attributes'][_0xe95a('0x38')]?_0x2b2689[_0xe95a('0x37')]:_0x15b1be['model'];if(_0x53ae61[_0xe95a('0x34')][_0xe95a('0x4b')]){_0x2b2689[_0xe95a('0x43')]=[{'all':!![]}];}_0x2b2689=_[_0xe95a('0x4c')]({},_0x2b2689,_0x53ae61[_0xe95a('0x42')]);return db['Attachment'][_0xe95a('0x4d')](_0x2b2689)[_0xe95a('0x27')](handleEntityNotFound(_0x40c020,null))[_0xe95a('0x27')](function(_0x2d02ab){if(_0x2d02ab){var _0x5af28d=_0x2d02ab[_0xe95a('0x4e')]({'plain':!![]});_0x5af28d=qs[_0xe95a('0x4f')](_0x5af28d,['id',_0xe95a('0x50'),_0xe95a('0x51')]);_0x53ae61[_0xe95a('0x52')]=_['omit'](_0x53ae61[_0xe95a('0x52')],['id',_0xe95a('0x50'),_0xe95a('0x51')]);return db[_0xe95a('0x2f')][_0xe95a('0x53')](_[_0xe95a('0x4c')](_0x5af28d,_0x53ae61[_0xe95a('0x52')]),{'include':_0x53ae61[_0xe95a('0x34')][_0xe95a('0x4b')]?[{'all':!![]}]:undefined});}})[_0xe95a('0x27')](respondWithResult(_0x40c020,0xc9))['catch'](handleError(_0x40c020,null));};exports[_0xe95a('0x26')]=function(_0x6146a5,_0x24d347){if(_0x6146a5['body']['id']){delete _0x6146a5[_0xe95a('0x52')]['id'];}return db[_0xe95a('0x2f')][_0xe95a('0x4d')]({'where':{'id':_0x6146a5['params']['id']}})[_0xe95a('0x27')](handleEntityNotFound(_0x24d347,null))[_0xe95a('0x27')](saveUpdates(_0x6146a5[_0xe95a('0x52')],null))['then'](respondWithResult(_0x24d347,null))[_0xe95a('0x46')](handleError(_0x24d347,null));};exports['destroy']=function(_0x3aa9b2,_0x1c6f94){return db[_0xe95a('0x2f')][_0xe95a('0x4d')]({'where':{'id':_0x3aa9b2[_0xe95a('0x48')]['id']}})['then'](handleEntityNotFound(_0x1c6f94,null))['then'](removeEntity(_0x1c6f94,null))[_0xe95a('0x46')](handleError(_0x1c6f94,null));};exports[_0xe95a('0x53')]=function(_0xeaf732,_0x23114f,_0x215eec){_0xeaf732[_0xe95a('0x52')]['name']=_0xeaf732[_0xe95a('0x54')][_0xe95a('0x55')];_0xeaf732[_0xe95a('0x52')][_0xe95a('0x56')]=_0xeaf732[_0xe95a('0x54')][_0xe95a('0x57')];_0xeaf732[_0xe95a('0x52')][_0xe95a('0x40')]=_0xeaf732['file'][_0xe95a('0x58')];return db[_0xe95a('0x2f')][_0xe95a('0x53')](_0xeaf732[_0xe95a('0x52')])['then'](respondWithResult(_0x23114f,0xc9))[_0xe95a('0x46')](handleError(_0x23114f,null));};exports['download']=function(_0x44fc11,_0x373039,_0x3c7e62){return db[_0xe95a('0x2f')]['findOne']({'where':{'id':_0x44fc11[_0xe95a('0x48')]['id']},'raw':!![]})[_0xe95a('0x27')](handleEntityNotFound(_0x373039,null))['then'](function(_0x1db057){if(_0x1db057){var _0x3851b4=_0x1db057[_0xe95a('0x59')]!==null;var _0x5cab7b=path[_0xe95a('0x5a')](config[_0xe95a('0x5b')],_0xe95a('0x5c'));if(_0x3851b4){_0x5cab7b=path[_0xe95a('0x5a')](_0x5cab7b,_0xe95a('0x5d'));}var _0x4d060c=path[_0xe95a('0x5a')](_0x5cab7b,_0x1db057[_0xe95a('0x56')]);return _0x373039[_0xe95a('0x5e')](_0x4d060c);}})['catch'](handleError(_0x373039,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 5babb4e..d1aba7c 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 _0xee41=['attachments','lodash','util','api','moment','path','rimraf','../../config/environment','define'];(function(_0x13fd61,_0x57e527){var _0x13dfb8=function(_0x4ce2d1){while(--_0x4ce2d1){_0x13fd61['push'](_0x13fd61['shift']());}};_0x13dfb8(++_0x57e527);}(_0xee41,0x1e7));var _0x1ee4=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xee41[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require(_0x1ee4('0x0'));var util=require(_0x1ee4('0x1'));var logger=require('../../config/logger')(_0x1ee4('0x2'));var moment=require(_0x1ee4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1ee4('0x4'));var rimraf=require(_0x1ee4('0x5'));var config=require(_0x1ee4('0x6'));var attributes=require('./attachment.attributes');module['exports']=function(_0x57c008,_0x481ebd){return _0x57c008[_0x1ee4('0x7')]('Attachment',attributes,{'tableName':_0x1ee4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d83=['attachments','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x321b2f,_0x2a1ee1){var _0x18e486=function(_0x578758){while(--_0x578758){_0x321b2f['push'](_0x321b2f['shift']());}};_0x18e486(++_0x2a1ee1);}(_0x9d83,0x1d5));var _0x39d8=function(_0xd467d7,_0x2f13cd){_0xd467d7=_0xd467d7-0x0;var _0x23b23d=_0x9d83[_0xd467d7];return _0x23b23d;};'use strict';var _=require(_0x39d8('0x0'));var util=require(_0x39d8('0x1'));var logger=require('../../config/logger')(_0x39d8('0x2'));var moment=require(_0x39d8('0x3'));var BPromise=require(_0x39d8('0x4'));var rp=require(_0x39d8('0x5'));var fs=require('fs');var path=require(_0x39d8('0x6'));var rimraf=require(_0x39d8('0x7'));var config=require(_0x39d8('0x8'));var attributes=require(_0x39d8('0x9'));module[_0x39d8('0xa')]=function(_0x4e8750,_0x645c29){return _0x4e8750[_0x39d8('0xb')]('Attachment',attributes,{'tableName':_0x39d8('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 501334a..5a22369 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 _0xb7c8=['raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','create','body','options'];(function(_0x5874ca,_0xf90b52){var _0x4b41d7=function(_0x3342f3){while(--_0x3342f3){_0x5874ca['push'](_0x5874ca['shift']());}};_0x4b41d7(++_0xf90b52);}(_0xb7c8,0x119));var _0x8b7c=function(_0x16f83e,_0xd9d70){_0x16f83e=_0x16f83e-0x0;var _0x573f2c=_0xb7c8[_0x16f83e];return _0x573f2c;};'use strict';var _=require('lodash');var util=require(_0x8b7c('0x0'));var moment=require(_0x8b7c('0x1'));var BPromise=require(_0x8b7c('0x2'));var rs=require(_0x8b7c('0x3'));var fs=require('fs');var Redis=require(_0x8b7c('0x4'));var db=require(_0x8b7c('0x5'))['db'];var utils=require(_0x8b7c('0x6'));var logger=require('../../config/logger')(_0x8b7c('0x7'));var config=require(_0x8b7c('0x8'));var jayson=require(_0x8b7c('0x9'));var client=jayson[_0x8b7c('0xa')][_0x8b7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12665c,_0x7a3850,_0x3c8fd6){return new BPromise(function(_0x6afb55,_0x30a924){return client[_0x8b7c('0xc')](_0x12665c,_0x3c8fd6)[_0x8b7c('0xd')](function(_0x48370e){logger[_0x8b7c('0xe')]('Attachment,\x20%s,\x20%s',_0x7a3850,_0x8b7c('0xf'));logger[_0x8b7c('0x10')]('Attachment,\x20%s,\x20%s,\x20%s',_0x7a3850,_0x8b7c('0xf'),JSON[_0x8b7c('0x11')](_0x48370e));if(_0x48370e[_0x8b7c('0x12')]){if(_0x48370e['error']['code']===0x1f4){logger[_0x8b7c('0x12')](_0x8b7c('0x13'),_0x7a3850,_0x48370e[_0x8b7c('0x12')][_0x8b7c('0x14')]);return _0x30a924(_0x48370e[_0x8b7c('0x12')][_0x8b7c('0x14')]);}logger[_0x8b7c('0x12')]('Attachment,\x20%s,\x20%s',_0x7a3850,_0x48370e[_0x8b7c('0x12')][_0x8b7c('0x14')]);return _0x6afb55(_0x48370e[_0x8b7c('0x12')]['message']);}else{logger[_0x8b7c('0xe')](_0x8b7c('0x13'),_0x7a3850,'request\x20sent');_0x6afb55(_0x48370e[_0x8b7c('0x15')][_0x8b7c('0x14')]);}})[_0x8b7c('0x16')](function(_0x1682fd){logger[_0x8b7c('0x12')]('Attachment,\x20%s,\x20%s',_0x7a3850,_0x1682fd);_0x30a924(_0x1682fd);});});}exports[_0x8b7c('0x17')]=function(_0x3ef583){var _0x3c2cc6=this;return new Promise(function(_0x2ac635,_0x77c9b7){return db['Attachment'][_0x8b7c('0x18')](_0x3ef583[_0x8b7c('0x19')],{'raw':_0x3ef583[_0x8b7c('0x1a')]?_0x3ef583[_0x8b7c('0x1a')][_0x8b7c('0x1b')]===undefined?!![]:![]:!![]})[_0x8b7c('0xd')](function(_0x3f587b){logger[_0x8b7c('0xe')](_0x8b7c('0x17'),_0x3ef583);logger[_0x8b7c('0x10')](_0x8b7c('0x17'),_0x3ef583,JSON[_0x8b7c('0x11')](_0x3f587b));_0x2ac635(_0x3f587b);})['catch'](function(_0x4222ab){logger[_0x8b7c('0x12')](_0x8b7c('0x17'),_0x4222ab[_0x8b7c('0x14')],_0x3ef583);_0x77c9b7(_0x3c2cc6[_0x8b7c('0x12')](0x1f4,_0x4222ab[_0x8b7c('0x14')]));});});}; \ No newline at end of file +var _0x9de3=['jayson/promise','http','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','create','options','CreateAttachment','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4a1380,_0x3362cd){var _0x217ff1=function(_0x5e5abe){while(--_0x5e5abe){_0x4a1380['push'](_0x4a1380['shift']());}};_0x217ff1(++_0x3362cd);}(_0x9de3,0xea));var _0x39de=function(_0x496511,_0x449bc7){_0x496511=_0x496511-0x0;var _0x5c3fe8=_0x9de3[_0x496511];return _0x5c3fe8;};'use strict';var _=require(_0x39de('0x0'));var util=require('util');var moment=require(_0x39de('0x1'));var BPromise=require(_0x39de('0x2'));var rs=require(_0x39de('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39de('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x39de('0x5'))(_0x39de('0x6'));var config=require(_0x39de('0x7'));var jayson=require(_0x39de('0x8'));var client=jayson['client'][_0x39de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x185872,_0x3ed6a1,_0x87049c){return new BPromise(function(_0x2604fa,_0x59ce28){return client['request'](_0x185872,_0x87049c)['then'](function(_0x27e596){logger[_0x39de('0xa')](_0x39de('0xb'),_0x3ed6a1,_0x39de('0xc'));logger[_0x39de('0xd')](_0x39de('0xe'),_0x3ed6a1,_0x39de('0xc'),JSON[_0x39de('0xf')](_0x27e596));if(_0x27e596['error']){if(_0x27e596[_0x39de('0x10')]['code']===0x1f4){logger['error'](_0x39de('0xb'),_0x3ed6a1,_0x27e596[_0x39de('0x10')][_0x39de('0x11')]);return _0x59ce28(_0x27e596['error'][_0x39de('0x11')]);}logger[_0x39de('0x10')](_0x39de('0xb'),_0x3ed6a1,_0x27e596[_0x39de('0x10')][_0x39de('0x11')]);return _0x2604fa(_0x27e596[_0x39de('0x10')][_0x39de('0x11')]);}else{logger[_0x39de('0xa')](_0x39de('0xb'),_0x3ed6a1,_0x39de('0xc'));_0x2604fa(_0x27e596['result'][_0x39de('0x11')]);}})[_0x39de('0x12')](function(_0x20bd18){logger[_0x39de('0x10')]('Attachment,\x20%s,\x20%s',_0x3ed6a1,_0x20bd18);_0x59ce28(_0x20bd18);});});}exports['CreateAttachment']=function(_0x2d355b){var _0x5e9e37=this;return new Promise(function(_0x1fb6fa,_0x1d08a2){return db['Attachment'][_0x39de('0x13')](_0x2d355b['body'],{'raw':_0x2d355b[_0x39de('0x14')]?_0x2d355b[_0x39de('0x14')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xab6f89){logger['info']('CreateAttachment',_0x2d355b);logger[_0x39de('0xd')](_0x39de('0x15'),_0x2d355b,JSON[_0x39de('0xf')](_0xab6f89));_0x1fb6fa(_0xab6f89);})[_0x39de('0x12')](function(_0x400d62){logger[_0x39de('0x10')]('CreateAttachment',_0x400d62[_0x39de('0x11')],_0x2d355b);_0x1d08a2(_0x5e9e37[_0x39de('0x10')](0x1f4,_0x400d62[_0x39de('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 4244b04..3c83bee 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x164bc9,_0x4229ec){_0x164bc9=_0x164bc9-0x0;var _0x3bdeaf=_0xdb28[_0x164bc9];return _0x3bdeaf;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=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(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1c1fba,_0xd5872d){_0x1c1fba=_0x1c1fba-0x0;var _0x37e346=_0x0b0e[_0x1c1fba];return _0x37e346;};'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/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 29ddade..3b87422 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xef17=['online','admin','user','agent','then','blocked','add','minutes','clearBlockUser','getLicense','catch','send','message','ad-login','role','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','api','activedirectory','baseDN','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','blockDuration','name','password','disabled','blockedAt'];(function(_0x49218f,_0x4248b6){var _0x1b9f85=function(_0x4eb59c){while(--_0x4eb59c){_0x49218f['push'](_0x49218f['shift']());}};_0x1b9f85(++_0x4248b6);}(_0xef17,0x136));var _0x7ef1=function(_0x4b2a4d,_0x14d7d4){_0x4b2a4d=_0x4b2a4d-0x0;var _0x3bac6d=_0xef17[_0x4b2a4d];return _0x3bac6d;};'use strict';var passport=require(_0x7ef1('0x0'));var LocalStrategy=require(_0x7ef1('0x1'))[_0x7ef1('0x2')];var moment=require(_0x7ef1('0x3'));var ActiveDirectory=require(_0x7ef1('0x4'));var BPromise=require(_0x7ef1('0x5'));var util=require(_0x7ef1('0x6'));var db=require(_0x7ef1('0x7'))['db'];var authService=require(_0x7ef1('0x8'));var utils=require('../../config/utils');var config=require(_0x7ef1('0x9'));var logger=require('../../config/logger')(_0x7ef1('0xa'));function isActiveDirectoryConfigured(_0x498596){var _0x34a040=![];if(typeof _0x498596['activedirectory']!=='undefined'){_0x34a040=_0x498596[_0x7ef1('0xb')][_0x7ef1('0xc')]&&_0x498596['activedirectory'][_0x7ef1('0xd')]&&_0x498596[_0x7ef1('0xb')][_0x7ef1('0xe')];}return _0x34a040;}function adAuthenticate(_0x3d47e2,_0x2cb9b0,_0x3ce78d){return new BPromise(function(_0x642de7,_0x4bedd1){try{var _0x4da8e8=new ActiveDirectory(_0x3d47e2);_0x4da8e8[_0x7ef1('0xf')](_0x2cb9b0,_0x3ce78d,function(_0x4dc653,_0x5ab4a4){if(_0x4dc653){logger['error'](_0x7ef1('0x10'),_0x2cb9b0,util['inspect'](_0x4dc653,{'showHidden':![],'depth':null}));_0x4bedd1(_0x7ef1('0x11'));}else if(!_0x5ab4a4){logger[_0x7ef1('0x12')](_0x7ef1('0x13'),_0x2cb9b0);_0x4bedd1(_0x7ef1('0x11'));}else{_0x642de7(_0x5ab4a4);}});}catch(_0x39ea9c){_0x4bedd1(_0x39ea9c);}});}function ActiveDirectoryAuthenticate(_0x317125,_0x26e9fb,_0x44d304,_0x57296a){var _0x4de80f,_0x267f0e;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x7ef1('0x14'),_0x26e9fb);return _0x57296a(null,![],{'message':_0x7ef1('0x11')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x7ef1('0x15')],'raw':!![]})['then'](function(_0x3a5835){_0x4de80f=_0x3a5835;if(!_0x4de80f['adSsoEnabled']){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x26e9fb);throw new Error(_0x7ef1('0x11'));}return _0x317125['findOne']({'attributes':['id',_0x7ef1('0x16'),_0x7ef1('0x17'),'salt','role',_0x7ef1('0x18'),'blocked',_0x7ef1('0x19'),_0x7ef1('0x1a')],'where':{'name':_0x26e9fb,'role':{'$or':[_0x7ef1('0x1b'),_0x7ef1('0x1c'),_0x7ef1('0x1d')]},'adSsoEnabled':!![]}});})[_0x7ef1('0x1e')](function(_0x20887b){if(!_0x20887b||_0x20887b&&_0x20887b[_0x7ef1('0x16')]!==_0x26e9fb){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x267f0e=_0x20887b;var _0x2a1bdd=_0x267f0e[_0x7ef1('0x16')]+'@'+config[_0x7ef1('0xb')][_0x7ef1('0xe')];return adAuthenticate(config[_0x7ef1('0xb')],_0x2a1bdd,_0x44d304);})[_0x7ef1('0x1e')](function(_0x423c42){if(_0x267f0e[_0x7ef1('0x18')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x4de80f['blockDuration']>0x0){if(_0x267f0e[_0x7ef1('0x1f')]){if(moment(_0x267f0e[_0x7ef1('0x19')])[_0x7ef1('0x20')](_0x4de80f[_0x7ef1('0x15')],_0x7ef1('0x21'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x7ef1('0x22')](_0x267f0e,0x0,![],null)[_0x7ef1('0x1e')](function(){return utils[_0x7ef1('0x23')](_0x267f0e);})[_0x7ef1('0x1e')](function(){return _0x57296a(null,_0x267f0e);});}else{return utils[_0x7ef1('0x23')](_0x267f0e)[_0x7ef1('0x1e')](function(){return _0x57296a(null,_0x267f0e);});}}else{return utils[_0x7ef1('0x23')](_0x267f0e)['then'](function(){return _0x57296a(null,_0x267f0e);});}})[_0x7ef1('0x24')](function(_0x4b0380){return _0x57296a(null,![],_0x4b0380);});}function handleError(_0x3306b0,_0x2546bf,_0x4b5fde){return _0x3306b0['status'](_0x2546bf||0x1f4)[_0x7ef1('0x25')]({'message':_0x4b5fde?_0x4b5fde[_0x7ef1('0x26')]||_0x4b5fde:''});}exports['login']=function(_0xbf918d,_0x56fe40,_0x3aa113){passport['authenticate'](_0x7ef1('0x27'),function(_0x23414f,_0x585238,_0x536083){var _0x4e5831=_0x23414f||_0x536083;if(_0x4e5831){return handleError(_0x56fe40,0x191,_0x4e5831);}if(!_0x585238){return handleError(_0x56fe40,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x1b72a1={'payload':{'id':_0x585238['id'],'role':_0x585238[_0x7ef1('0x28')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1b72a1)[_0x7ef1('0x1e')](function(_0x4dbb22){_0x56fe40['json']({'id':_0x585238['id'],'token':_0x4dbb22,'statusCall':'','isAlreadyLogged':_0x585238[_0x7ef1('0x1a')]});});}})(_0xbf918d,_0x56fe40,_0x3aa113);};passport['use'](_0x7ef1('0x27'),new LocalStrategy({'usernameField':_0x7ef1('0x16'),'passwordField':_0x7ef1('0x17')},function(_0x1bfa7b,_0x47e0e1,_0x191575){return ActiveDirectoryAuthenticate(db[_0x7ef1('0x29')],_0x1bfa7b,_0x47e0e1,_0x191575);})); \ No newline at end of file +var _0xe1e7=['adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','role','disabled','blocked','user','name','then','blockedAt','add','getLicense','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','use','User','passport','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','url','domain','authenticate','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration'];(function(_0xf08c83,_0x4fd61d){var _0x139e49=function(_0xa03366){while(--_0xa03366){_0xf08c83['push'](_0xf08c83['shift']());}};_0x139e49(++_0x4fd61d);}(_0xe1e7,0xe5));var _0x7e1e=function(_0x5c2888,_0x435a80){_0x5c2888=_0x5c2888-0x0;var _0xfbdf00=_0xe1e7[_0x5c2888];return _0xfbdf00;};'use strict';var passport=require(_0x7e1e('0x0'));var LocalStrategy=require('passport-local')[_0x7e1e('0x1')];var moment=require('moment');var ActiveDirectory=require(_0x7e1e('0x2'));var BPromise=require(_0x7e1e('0x3'));var util=require(_0x7e1e('0x4'));var db=require(_0x7e1e('0x5'))['db'];var authService=require(_0x7e1e('0x6'));var utils=require(_0x7e1e('0x7'));var config=require(_0x7e1e('0x8'));var logger=require(_0x7e1e('0x9'))(_0x7e1e('0xa'));function isActiveDirectoryConfigured(_0x1140fa){var _0xb94dc=![];if(typeof _0x1140fa[_0x7e1e('0xb')]!==_0x7e1e('0xc')){_0xb94dc=_0x1140fa[_0x7e1e('0xb')]['baseDN']&&_0x1140fa[_0x7e1e('0xb')][_0x7e1e('0xd')]&&_0x1140fa[_0x7e1e('0xb')][_0x7e1e('0xe')];}return _0xb94dc;}function adAuthenticate(_0x21b72e,_0x9b2260,_0x23f7e9){return new BPromise(function(_0x562cdb,_0x1dee70){try{var _0x20526a=new ActiveDirectory(_0x21b72e);_0x20526a[_0x7e1e('0xf')](_0x9b2260,_0x23f7e9,function(_0xb472cb,_0x5467f4){if(_0xb472cb){logger[_0x7e1e('0x10')]('Error\x20authenticate\x20%s:\x20%s',_0x9b2260,util[_0x7e1e('0x11')](_0xb472cb,{'showHidden':![],'depth':null}));_0x1dee70('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x5467f4){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x9b2260);_0x1dee70(_0x7e1e('0x12'));}else{_0x562cdb(_0x5467f4);}});}catch(_0xed2d76){_0x1dee70(_0xed2d76);}});}function ActiveDirectoryAuthenticate(_0x1b9e5f,_0x54a5a1,_0x584059,_0x50ffb7){var _0x4a92db,_0x5b07a0;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x7e1e('0x13'),_0x54a5a1);return _0x50ffb7(null,![],{'message':_0x7e1e('0x12')});}return db[_0x7e1e('0x14')][_0x7e1e('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x7e1e('0x16')],'raw':!![]})['then'](function(_0x5eee11){_0x4a92db=_0x5eee11;if(!_0x4a92db[_0x7e1e('0x17')]){logger['error'](_0x7e1e('0x18'),_0x54a5a1);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x1b9e5f[_0x7e1e('0x15')]({'attributes':['id','name','password','salt',_0x7e1e('0x19'),_0x7e1e('0x1a'),_0x7e1e('0x1b'),'blockedAt','online'],'where':{'name':_0x54a5a1,'role':{'$or':['admin',_0x7e1e('0x1c'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x4ebc10){if(!_0x4ebc10||_0x4ebc10&&_0x4ebc10[_0x7e1e('0x1d')]!==_0x54a5a1){throw new Error(_0x7e1e('0x12'));}_0x5b07a0=_0x4ebc10;var _0x5a684e=_0x5b07a0[_0x7e1e('0x1d')]+'@'+config[_0x7e1e('0xb')]['domain'];return adAuthenticate(config['activedirectory'],_0x5a684e,_0x584059);})[_0x7e1e('0x1e')](function(_0xb0574e){if(_0x5b07a0[_0x7e1e('0x1a')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x4a92db[_0x7e1e('0x16')]>0x0){if(_0x5b07a0[_0x7e1e('0x1b')]){if(moment(_0x5b07a0[_0x7e1e('0x1f')])[_0x7e1e('0x20')](_0x4a92db[_0x7e1e('0x16')],'minutes')>moment()){throw new Error(_0x7e1e('0x12'));}return utils['clearBlockUser'](_0x5b07a0,0x0,![],null)['then'](function(){return utils[_0x7e1e('0x21')](_0x5b07a0);})[_0x7e1e('0x1e')](function(){return _0x50ffb7(null,_0x5b07a0);});}else{return utils[_0x7e1e('0x21')](_0x5b07a0)['then'](function(){return _0x50ffb7(null,_0x5b07a0);});}}else{return utils[_0x7e1e('0x21')](_0x5b07a0)[_0x7e1e('0x1e')](function(){return _0x50ffb7(null,_0x5b07a0);});}})['catch'](function(_0x184160){return _0x50ffb7(null,![],_0x184160);});}function handleError(_0x4ba40d,_0x5a5e07,_0x39c147){return _0x4ba40d[_0x7e1e('0x22')](_0x5a5e07||0x1f4)[_0x7e1e('0x23')]({'message':_0x39c147?_0x39c147['message']||_0x39c147:''});}exports[_0x7e1e('0x24')]=function(_0x168d63,_0x3a4287,_0x43977b){passport[_0x7e1e('0xf')](_0x7e1e('0x25'),function(_0x2c100e,_0x311b7e,_0x3442e9){var _0x3cbcbd=_0x2c100e||_0x3442e9;if(_0x3cbcbd){return handleError(_0x3a4287,0x191,_0x3cbcbd);}if(!_0x311b7e){return handleError(_0x3a4287,0x194,{'message':_0x7e1e('0x26')});}else{var _0xb8c240={'payload':{'id':_0x311b7e['id'],'role':_0x311b7e[_0x7e1e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xb8c240)[_0x7e1e('0x1e')](function(_0x507ecc){_0x3a4287[_0x7e1e('0x27')]({'id':_0x311b7e['id'],'token':_0x507ecc,'statusCall':'','isAlreadyLogged':_0x311b7e['online']});});}})(_0x168d63,_0x3a4287,_0x43977b);};passport[_0x7e1e('0x28')]('ad-login',new LocalStrategy({'usernameField':_0x7e1e('0x1d'),'passwordField':'password'},function(_0x106a47,_0x3158d8,_0x56f44b){return ActiveDirectoryAuthenticate(db[_0x7e1e('0x29')],_0x106a47,_0x3158d8,_0x56f44b);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 41c1024..82f21f8 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x32d5=['post','login','exports','express','Router'];(function(_0x20a125,_0x309dfc){var _0x220b9a=function(_0x421ee5){while(--_0x421ee5){_0x20a125['push'](_0x20a125['shift']());}};_0x220b9a(++_0x309dfc);}(_0x32d5,0x18e));var _0x532d=function(_0x14afd5,_0x41bdeb){_0x14afd5=_0x14afd5-0x0;var _0x2a2f6c=_0x32d5[_0x14afd5];return _0x2a2f6c;};'use strict';var express=require(_0x532d('0x0'));var router=express[_0x532d('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x532d('0x2')]('/',controller[_0x532d('0x3')]);module[_0x532d('0x4')]=router; \ No newline at end of file +var _0xc76d=['express','Router','post','login','exports'];(function(_0x4ea590,_0x4dcd74){var _0x1151e7=function(_0x5bc2eb){while(--_0x5bc2eb){_0x4ea590['push'](_0x4ea590['shift']());}};_0x1151e7(++_0x4dcd74);}(_0xc76d,0xd7));var _0xdc76=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0xc76d[_0x16de68];return _0x1c277e;};'use strict';var express=require(_0xdc76('0x0'));var router=express[_0xdc76('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0xdc76('0x2')]('/',controller[_0xdc76('0x3')]);module[_0xdc76('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index e7525dc..5f7c665 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x7a54,0x106));var _0x47a5=function(_0x24eda3,_0x3d89c0){_0x24eda3=_0x24eda3-0x0;var _0x54d22d=_0x7a54[_0x24eda3];return _0x54d22d;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x7a54,0x106));var _0x47a5=function(_0x35c504,_0x574374){_0x35c504=_0x35c504-0x0;var _0x2ffd85=_0x7a54[_0x35c504];return _0x2ffd85;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index c59627e..1e37d50 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 _0x536e=['/callback','callback','isMiddleware','setTokenCookie','exports','express','../user/user.controller.js','../../components/auth/service','get','login'];(function(_0x528d5e,_0x533d1e){var _0x56916f=function(_0x44123a){while(--_0x44123a){_0x528d5e['push'](_0x528d5e['shift']());}};_0x56916f(++_0x533d1e);}(_0x536e,0x19f));var _0xe536=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0x536e[_0x3f4891];return _0x54f2d8;};'use strict';var express=require(_0xe536('0x0'));var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xe536('0x1'));var authService=require(_0xe536('0x2'));router[_0xe536('0x3')]('/',controller[_0xe536('0x4')]);router[_0xe536('0x3')](_0xe536('0x5'),controller[_0xe536('0x6')],authService[_0xe536('0x7')],userController[_0xe536('0x4')],authService[_0xe536('0x8')]);module[_0xe536('0x9')]=router; \ No newline at end of file +var _0x1288=['isMiddleware','setTokenCookie','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x1288,0x14c));var _0x8128=function(_0x28d54c,_0x53d9ba){_0x28d54c=_0x28d54c-0x0;var _0x32ab5c=_0x1288[_0x28d54c];return _0x32ab5c;};'use strict';var express=require(_0x8128('0x0'));var passport=require('passport');var router=express[_0x8128('0x1')]();var controller=require(_0x8128('0x2'));var userController=require(_0x8128('0x3'));var authService=require(_0x8128('0x4'));router[_0x8128('0x5')]('/',controller[_0x8128('0x6')]);router[_0x8128('0x5')](_0x8128('0x7'),controller[_0x8128('0x8')],authService[_0x8128('0x9')],userController[_0x8128('0x6')],authService[_0x8128('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index b8db503..b537510 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 _0xd61c=['previousPasswords','validatePasswordHistory','resetPasswordExpires','save','Password\x20reset!','use','local-login','util','passport','passport-local','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','disabled','blocked','blockedAt','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','Smtp','CloudProvider','merge','format','\x22%s\x22\x20<%s>','email','user','request','SendMail','error','message','stringify','login','role','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern'];(function(_0x141775,_0x574d3b){var _0x46c892=function(_0x2577ce){while(--_0x2577ce){_0x141775['push'](_0x141775['shift']());}};_0x46c892(++_0x574d3b);}(_0xd61c,0xb1));var _0xcd61=function(_0x27bbad,_0x558ef0){_0x27bbad=_0x27bbad-0x0;var _0x188c0b=_0xd61c[_0x27bbad];return _0x188c0b;};'use strict';var util=require(_0xcd61('0x0'));var passport=require(_0xcd61('0x1'));var LocalStrategy=require(_0xcd61('0x2'))['Strategy'];var jayson=require(_0xcd61('0x3'));var _=require('lodash');var rs=require(_0xcd61('0x4'));var moment=require(_0xcd61('0x5'));var db=require(_0xcd61('0x6'))['db'];var authService=require(_0xcd61('0x7'));var utils=require(_0xcd61('0x8'));var client=jayson[_0xcd61('0x9')][_0xcd61('0xa')]({'port':0x232b});function localAuthenticate(_0x3f1299,_0x1bf94f,_0x1947d7,_0x47dddf){var _0x42bff7,_0x4927b1;return db[_0xcd61('0xb')][_0xcd61('0xc')]({'where':{'id':0x1},'attributes':[_0xcd61('0xd'),'blockDuration'],'raw':!![]})[_0xcd61('0xe')](function(_0x269ca8){_0x42bff7=_0x269ca8;return _0x3f1299[_0xcd61('0xc')]({'attributes':['id',_0xcd61('0xf'),_0xcd61('0x10'),'salt','role',_0xcd61('0x11'),_0xcd61('0x12'),_0xcd61('0x13'),'loginAttempts'],'where':{'name':_0x1bf94f,'role':{'$or':[_0xcd61('0x14'),'user','agent']}}});})['then'](function(_0x23a289){if(!_0x23a289||_0x23a289&&_0x23a289[_0xcd61('0xf')]!==_0x1bf94f){throw new Error(_0xcd61('0x15'));}else{_0x4927b1=_0x23a289;return _0x4927b1;}})[_0xcd61('0xe')](function(){_0x4927b1[_0xcd61('0x16')](_0x1947d7,function(_0x2b58a4,_0xa30220){var _0x11d8ed=_0x4927b1[_0xcd61('0x17')]+0x1;if(_0x2b58a4){return _0x47dddf(_0x2b58a4);}else if(!_0xa30220){if(_0x4927b1[_0xcd61('0x11')]){return _0x47dddf(null,![],{'message':_0xcd61('0x15')});}else if(_0x42bff7[_0xcd61('0xd')]>0x0){if(_0x4927b1[_0xcd61('0x12')]){if(_0x42bff7[_0xcd61('0x18')]>0x0){if(moment(_0x4927b1['blockedAt'])[_0xcd61('0x19')](_0x42bff7[_0xcd61('0x18')],_0xcd61('0x1a'))>moment()){return _0x47dddf(null,![],{'message':_0xcd61('0x15')});}else{return utils[_0xcd61('0x1b')](_0x4927b1,_0x11d8ed,![],null)['then'](function(){return _0x47dddf(null,![],{'message':_0xcd61('0x15')});});}}else{return _0x47dddf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x11d8ed>=_0x42bff7[_0xcd61('0xd')]){return utils[_0xcd61('0x1b')](_0x4927b1,0x0,!![],moment())[_0xcd61('0xe')](function(){return _0x47dddf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xcd61('0x1b')](_0x4927b1,_0x11d8ed,![],null)['then'](function(){return _0x47dddf(null,![],{'message':_0xcd61('0x15')});});}}}else{return _0x47dddf(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x4927b1[_0xcd61('0x11')]){return _0x47dddf(null,![],{'message':_0xcd61('0x15')});}else if(_0x42bff7[_0xcd61('0xd')]>0x0){if(_0x4927b1[_0xcd61('0x12')]){if(_0x42bff7['blockDuration']>0x0){if(moment(_0x4927b1['blockedAt'])[_0xcd61('0x19')](_0x42bff7['blockDuration'],'minutes')>moment()){return _0x47dddf(null,![],{'message':_0xcd61('0x15')});}else{return utils[_0xcd61('0x1b')](_0x4927b1,0x0,![],null)[_0xcd61('0xe')](function(){return utils[_0xcd61('0x1c')](_0x4927b1);})[_0xcd61('0xe')](function(){return _0x47dddf(null,_0x4927b1);});}}else{return _0x47dddf(null,![],{'message':_0xcd61('0x15')});}}else{return utils[_0xcd61('0x1b')](_0x4927b1,0x0,![],null)[_0xcd61('0xe')](function(){return utils[_0xcd61('0x1c')](_0x4927b1);})[_0xcd61('0xe')](function(){return _0x47dddf(null,_0x4927b1);})[_0xcd61('0x1d')](function(_0x2d81b6){return _0x47dddf(null,![],_0x2d81b6);});}}else{if(_0x4927b1[_0xcd61('0x12')]){return _0x47dddf(null,![],{'message':_0xcd61('0x15')});}else{return utils[_0xcd61('0x1c')](_0x4927b1)[_0xcd61('0xe')](function(){return _0x47dddf(null,_0x4927b1);});}}}});})[_0xcd61('0x1d')](function(_0x3a3d1d){return _0x47dddf(null,![],_0x3a3d1d);});}function sendServiceMail(_0x592514){return db[_0xcd61('0x1e')][_0xcd61('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xcd61('0xf'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xcd61('0x20'),'include':[{'model':db[_0xcd61('0x21')],'as':_0xcd61('0x21')}]}]})[_0xcd61('0xe')](function(_0x1f0fbb){if(!_0x1f0fbb){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x56eaee=_0x1f0fbb['getSmtpOptions']();var _0x2356a2={'account':_0x56eaee,'message':_[_0xcd61('0x22')]({'from':util[_0xcd61('0x23')](_0xcd61('0x24'),_0x1f0fbb['name'],_0x1f0fbb[_0xcd61('0x25')]||_0x1f0fbb['Smtp'][_0xcd61('0x26')])},_0x592514)};return client[_0xcd61('0x27')](_0xcd61('0x28'),_0x2356a2);})['then'](function(_0x468118){if(_0x468118[_0xcd61('0x29')]){throw new Error(util[_0xcd61('0x23')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x468118[_0xcd61('0x29')][_0xcd61('0x2a')]||JSON[_0xcd61('0x2b')](_0x468118[_0xcd61('0x29')])));}return!![];});}function handleError(_0x3ef2fa,_0x5465d7,_0x5f18dc){return _0x3ef2fa['status'](_0x5465d7||0x1f4)['send']({'message':_0x5f18dc?_0x5f18dc[_0xcd61('0x2a')]||_0x5f18dc:''});}exports[_0xcd61('0x2c')]=function(_0x165d90,_0x4b097d,_0x16dd1f){passport['authenticate']('local-login',function(_0x5ef3c1,_0x54144f,_0x710dff){var _0x14c854=_0x5ef3c1||_0x710dff;if(_0x14c854){return handleError(_0x4b097d,0x191,_0x14c854);}if(!_0x54144f){return handleError(_0x4b097d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x90196b={'payload':{'id':_0x54144f['id'],'role':_0x54144f[_0xcd61('0x2d')]},'options':{'expiresIn':0x15180}};return authService[_0xcd61('0x2e')](_0x90196b)['then'](function(_0x569be2){_0x4b097d[_0xcd61('0x2f')]({'id':_0x54144f['id'],'token':_0x569be2,'statusCall':'','isAlreadyLogged':_0x54144f[_0xcd61('0x30')]});});}})(_0x165d90,_0x4b097d,_0x16dd1f);};exports[_0xcd61('0x31')]=function(_0x328937,_0x3ebf99){if(!_0x328937[_0xcd61('0x32')][_0xcd61('0x25')]){return handleError(_0x3ebf99,0x1f4,{'message':_0xcd61('0x33')});}var _0x323128=rs[_0xcd61('0x34')]();_0x328937['body'][_0xcd61('0x25')]=_0x328937[_0xcd61('0x32')][_0xcd61('0x25')][_0xcd61('0x35')]()[_0xcd61('0x36')]();var _0x2beb26;return db[_0xcd61('0xb')][_0xcd61('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xcd61('0x18')],'raw':!![]})['then'](function(_0x153bf8){_0x2beb26=_0x153bf8;return db[_0xcd61('0x37')][_0xcd61('0x1f')]({'where':{'email':_0x328937[_0xcd61('0x32')][_0xcd61('0x25')]}});})['then'](function(_0x4bc4b4){if(!_0x4bc4b4){throw new Error(_0xcd61('0x38'));}if(_0x4bc4b4[_0xcd61('0x11')]){throw new Error(_0xcd61('0x39'));}if(_0x4bc4b4[_0xcd61('0x12')]){if(moment(_0x4bc4b4[_0xcd61('0x13')])[_0xcd61('0x19')](_0x2beb26[_0xcd61('0x18')],'minutes')>moment()){throw new Error(_0xcd61('0x3a'));}else{_0x4bc4b4[_0xcd61('0x12')]=![];_0x4bc4b4[_0xcd61('0x13')]=null;}}_0x4bc4b4[_0xcd61('0x3b')]=_0x323128;_0x4bc4b4['resetPasswordExpires']=Date[_0xcd61('0x3c')]()+0x36ee80;return _0x4bc4b4['save']();})[_0xcd61('0xe')](function(){return sendServiceMail({'to':_0x328937['body'][_0xcd61('0x25')],'subject':_0xcd61('0x3d'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xcd61('0x3e')+_0xcd61('0x3f')+_0x328937[_0xcd61('0x40')][_0xcd61('0x41')]+_0xcd61('0x42')+_0x323128+'\x0a\x0a'+_0xcd61('0x43')});})[_0xcd61('0xe')](function(){_0x3ebf99[_0xcd61('0x44')](0xc8)[_0xcd61('0x45')]({'message':_0xcd61('0x46')});})[_0xcd61('0x1d')](function(_0xec250e){return handleError(_0x3ebf99,0x1f4,_0xec250e);});};exports[_0xcd61('0x47')]=function(_0x445383,_0x17e962){return db[_0xcd61('0x37')][_0xcd61('0x1f')]({'where':{'resetPasswordToken':_0x445383['params'][_0xcd61('0x48')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xcd61('0xe')](function(_0x4ff590){if(!_0x4ff590){throw new Error(_0xcd61('0x49'));}return db[_0xcd61('0xb')][_0xcd61('0xc')]({'attributes':['id',_0xcd61('0x4a'),_0xcd61('0x4b'),_0xcd61('0x4c')]})[_0xcd61('0xe')](function(_0x2c5da6){if(_0x2c5da6[_0xcd61('0x4a')])authService[_0xcd61('0x4d')](_0x445383[_0xcd61('0x32')][_0xcd61('0x10')]);if(!_0x2c5da6[_0xcd61('0x4b')]||!_0x4ff590[_0xcd61('0x4e')])return _0x4ff590;authService[_0xcd61('0x4f')](_0x445383[_0xcd61('0x32')][_0xcd61('0x10')],_0x4ff590['previousPasswords'],_0x2c5da6[_0xcd61('0x4c')]);return _0x4ff590;})[_0xcd61('0xe')](function(){_0x4ff590[_0xcd61('0x10')]=_0x445383[_0xcd61('0x32')][_0xcd61('0x10')];_0x4ff590[_0xcd61('0x3b')]=null;_0x4ff590[_0xcd61('0x50')]=null;return _0x4ff590[_0xcd61('0x51')]();});})['then'](function(){_0x17e962[_0xcd61('0x44')](0xc8)[_0xcd61('0x45')]({'message':_0xcd61('0x52')});})[_0xcd61('0x1d')](function(_0x226f88){return handleError(_0x17e962,0x1f4,_0x226f88);});};passport[_0xcd61('0x53')](_0xcd61('0x54'),new LocalStrategy({'usernameField':_0xcd61('0xf'),'passwordField':'password'},function(_0xd12c8f,_0xb34feb,_0x6d6dc1){return localAuthenticate(db[_0xcd61('0x37')],_0xd12c8f,_0xb34feb,_0x6d6dc1);})); \ No newline at end of file +var _0xd053=['body','trim','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','then','findOne','name','password','salt','role','disabled','blocked','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','blockedAt','minutes','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','message','stringify','status','send','login','local-login','signToken','online','forgot','Email\x20parameter\x20is\x20missing','generate'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xd053,0x1c7));var _0x3d05=function(_0x3d27ba,_0x2671a3){_0x3d27ba=_0x3d27ba-0x0;var _0xf01885=_0xd053[_0x3d27ba];return _0xf01885;};'use strict';var util=require(_0x3d05('0x0'));var passport=require(_0x3d05('0x1'));var LocalStrategy=require(_0x3d05('0x2'))[_0x3d05('0x3')];var jayson=require(_0x3d05('0x4'));var _=require(_0x3d05('0x5'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x3d05('0x6'))['db'];var authService=require(_0x3d05('0x7'));var utils=require(_0x3d05('0x8'));var client=jayson[_0x3d05('0x9')][_0x3d05('0xa')]({'port':0x232b});function localAuthenticate(_0x165846,_0x35623c,_0x11bb10,_0x3d068c){var _0xd09f9d,_0x1701fd;return db[_0x3d05('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x3d05('0xc'),'blockDuration'],'raw':!![]})[_0x3d05('0xd')](function(_0x456157){_0xd09f9d=_0x456157;return _0x165846[_0x3d05('0xe')]({'attributes':['id',_0x3d05('0xf'),_0x3d05('0x10'),_0x3d05('0x11'),_0x3d05('0x12'),_0x3d05('0x13'),_0x3d05('0x14'),'blockedAt',_0x3d05('0x15')],'where':{'name':_0x35623c,'role':{'$or':['admin',_0x3d05('0x16'),_0x3d05('0x17')]}}});})['then'](function(_0x8c3f36){if(!_0x8c3f36||_0x8c3f36&&_0x8c3f36['name']!==_0x35623c){throw new Error(_0x3d05('0x18'));}else{_0x1701fd=_0x8c3f36;return _0x1701fd;}})[_0x3d05('0xd')](function(){_0x1701fd[_0x3d05('0x19')](_0x11bb10,function(_0x36fde5,_0x29c463){var _0x1f1bf3=_0x1701fd[_0x3d05('0x15')]+0x1;if(_0x36fde5){return _0x3d068c(_0x36fde5);}else if(!_0x29c463){if(_0x1701fd['disabled']){return _0x3d068c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xd09f9d['allowedLoginAttempts']>0x0){if(_0x1701fd['blocked']){if(_0xd09f9d[_0x3d05('0x1a')]>0x0){if(moment(_0x1701fd[_0x3d05('0x1b')])['add'](_0xd09f9d[_0x3d05('0x1a')],_0x3d05('0x1c'))>moment()){return _0x3d068c(null,![],{'message':_0x3d05('0x18')});}else{return utils[_0x3d05('0x1d')](_0x1701fd,_0x1f1bf3,![],null)[_0x3d05('0xd')](function(){return _0x3d068c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3d068c(null,![],{'message':_0x3d05('0x18')});}}else{if(_0x1f1bf3>=_0xd09f9d[_0x3d05('0xc')]){return utils[_0x3d05('0x1d')](_0x1701fd,0x0,!![],moment())[_0x3d05('0xd')](function(){return _0x3d068c(null,![],{'message':_0x3d05('0x18')});});}else{return utils[_0x3d05('0x1d')](_0x1701fd,_0x1f1bf3,![],null)['then'](function(){return _0x3d068c(null,![],{'message':_0x3d05('0x18')});});}}}else{return _0x3d068c(null,![],{'message':_0x3d05('0x18')});}}else{if(_0x1701fd[_0x3d05('0x13')]){return _0x3d068c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xd09f9d['allowedLoginAttempts']>0x0){if(_0x1701fd[_0x3d05('0x14')]){if(_0xd09f9d[_0x3d05('0x1a')]>0x0){if(moment(_0x1701fd[_0x3d05('0x1b')])['add'](_0xd09f9d['blockDuration'],_0x3d05('0x1c'))>moment()){return _0x3d068c(null,![],{'message':_0x3d05('0x18')});}else{return utils[_0x3d05('0x1d')](_0x1701fd,0x0,![],null)[_0x3d05('0xd')](function(){return utils[_0x3d05('0x1e')](_0x1701fd);})[_0x3d05('0xd')](function(){return _0x3d068c(null,_0x1701fd);});}}else{return _0x3d068c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x3d05('0x1d')](_0x1701fd,0x0,![],null)[_0x3d05('0xd')](function(){return utils[_0x3d05('0x1e')](_0x1701fd);})[_0x3d05('0xd')](function(){return _0x3d068c(null,_0x1701fd);})[_0x3d05('0x1f')](function(_0x2be856){return _0x3d068c(null,![],_0x2be856);});}}else{if(_0x1701fd[_0x3d05('0x14')]){return _0x3d068c(null,![],{'message':_0x3d05('0x18')});}else{return utils['getLicense'](_0x1701fd)['then'](function(){return _0x3d068c(null,_0x1701fd);});}}}});})['catch'](function(_0xb420a6){return _0x3d068c(null,![],_0xb420a6);});}function sendServiceMail(_0x579faf){return db[_0x3d05('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0x3d05('0xf'),_0x3d05('0x21')],'include':[{'model':db[_0x3d05('0x22')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x3d05('0x23')}]}]})[_0x3d05('0xd')](function(_0x5418ed){if(!_0x5418ed){throw new Error(_0x3d05('0x24'));}var _0x496e62=_0x5418ed['getSmtpOptions']();var _0x28715c={'account':_0x496e62,'message':_[_0x3d05('0x25')]({'from':util[_0x3d05('0x26')](_0x3d05('0x27'),_0x5418ed[_0x3d05('0xf')],_0x5418ed['email']||_0x5418ed[_0x3d05('0x28')][_0x3d05('0x16')])},_0x579faf)};return client[_0x3d05('0x29')](_0x3d05('0x2a'),_0x28715c);})[_0x3d05('0xd')](function(_0x1f78ca){if(_0x1f78ca[_0x3d05('0x2b')]){throw new Error(util[_0x3d05('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1f78ca[_0x3d05('0x2b')][_0x3d05('0x2c')]||JSON[_0x3d05('0x2d')](_0x1f78ca['error'])));}return!![];});}function handleError(_0x4cc02d,_0xd3d645,_0x5ba33b){return _0x4cc02d[_0x3d05('0x2e')](_0xd3d645||0x1f4)[_0x3d05('0x2f')]({'message':_0x5ba33b?_0x5ba33b[_0x3d05('0x2c')]||_0x5ba33b:''});}exports[_0x3d05('0x30')]=function(_0x37de9e,_0xdd8f4,_0x26a639){passport['authenticate'](_0x3d05('0x31'),function(_0x1c837c,_0x516100,_0x4e2b78){var _0x547a66=_0x1c837c||_0x4e2b78;if(_0x547a66){return handleError(_0xdd8f4,0x191,_0x547a66);}if(!_0x516100){return handleError(_0xdd8f4,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x409abe={'payload':{'id':_0x516100['id'],'role':_0x516100[_0x3d05('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x3d05('0x32')](_0x409abe)[_0x3d05('0xd')](function(_0x4cb6e8){_0xdd8f4['json']({'id':_0x516100['id'],'token':_0x4cb6e8,'statusCall':'','isAlreadyLogged':_0x516100[_0x3d05('0x33')]});});}})(_0x37de9e,_0xdd8f4,_0x26a639);};exports[_0x3d05('0x34')]=function(_0x4db180,_0x44c1e5){if(!_0x4db180['body'][_0x3d05('0x21')]){return handleError(_0x44c1e5,0x1f4,{'message':_0x3d05('0x35')});}var _0x4b7fc7=rs[_0x3d05('0x36')]();_0x4db180[_0x3d05('0x37')]['email']=_0x4db180[_0x3d05('0x37')][_0x3d05('0x21')][_0x3d05('0x38')]()['toLowerCase']();var _0x1e6d8e;return db[_0x3d05('0xb')][_0x3d05('0xe')]({'where':{'id':0x1},'attributes':[_0x3d05('0xc'),_0x3d05('0x1a')],'raw':!![]})[_0x3d05('0xd')](function(_0x44206f){_0x1e6d8e=_0x44206f;return db[_0x3d05('0x39')][_0x3d05('0x3a')]({'where':{'email':_0x4db180[_0x3d05('0x37')][_0x3d05('0x21')]}});})[_0x3d05('0xd')](function(_0xcf5308){if(!_0xcf5308){throw new Error(_0x3d05('0x3b'));}if(_0xcf5308[_0x3d05('0x13')]){throw new Error(_0x3d05('0x3c'));}if(_0xcf5308[_0x3d05('0x14')]){if(moment(_0xcf5308[_0x3d05('0x1b')])[_0x3d05('0x3d')](_0x1e6d8e[_0x3d05('0x1a')],_0x3d05('0x1c'))>moment()){throw new Error(_0x3d05('0x3e'));}else{_0xcf5308[_0x3d05('0x14')]=![];_0xcf5308[_0x3d05('0x1b')]=null;}}_0xcf5308[_0x3d05('0x3f')]=_0x4b7fc7;_0xcf5308[_0x3d05('0x40')]=Date[_0x3d05('0x41')]()+0x36ee80;return _0xcf5308[_0x3d05('0x42')]();})['then'](function(){return sendServiceMail({'to':_0x4db180[_0x3d05('0x37')][_0x3d05('0x21')],'subject':_0x3d05('0x43'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x3d05('0x44')+_0x3d05('0x45')+_0x4db180[_0x3d05('0x46')][_0x3d05('0x47')]+_0x3d05('0x48')+_0x4b7fc7+'\x0a\x0a'+_0x3d05('0x49')});})[_0x3d05('0xd')](function(){_0x44c1e5[_0x3d05('0x2e')](0xc8)[_0x3d05('0x2f')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x58288e){return handleError(_0x44c1e5,0x1f4,_0x58288e);});};exports[_0x3d05('0x4a')]=function(_0x127916,_0x595d9f){return db[_0x3d05('0x39')][_0x3d05('0x3a')]({'where':{'resetPasswordToken':_0x127916[_0x3d05('0x4b')][_0x3d05('0x4c')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x3d05('0xd')](function(_0x22de9a){if(!_0x22de9a){throw new Error(_0x3d05('0x4d'));}return db[_0x3d05('0xb')]['findOne']({'attributes':['id',_0x3d05('0x4e'),_0x3d05('0x4f'),'passwordHistoryLimit']})[_0x3d05('0xd')](function(_0xbf20bb){if(_0xbf20bb[_0x3d05('0x4e')])authService['validatePasswordPattern'](_0x127916[_0x3d05('0x37')][_0x3d05('0x10')]);if(!_0xbf20bb[_0x3d05('0x4f')]||!_0x22de9a[_0x3d05('0x50')])return _0x22de9a;authService[_0x3d05('0x51')](_0x127916[_0x3d05('0x37')][_0x3d05('0x10')],_0x22de9a[_0x3d05('0x50')],_0xbf20bb[_0x3d05('0x52')]);return _0x22de9a;})['then'](function(){_0x22de9a[_0x3d05('0x10')]=_0x127916['body'][_0x3d05('0x10')];_0x22de9a[_0x3d05('0x3f')]=null;_0x22de9a[_0x3d05('0x40')]=null;return _0x22de9a[_0x3d05('0x42')]();});})['then'](function(){_0x595d9f[_0x3d05('0x2e')](0xc8)['send']({'message':_0x3d05('0x53')});})[_0x3d05('0x1f')](function(_0x52433c){return handleError(_0x595d9f,0x1f4,_0x52433c);});};passport[_0x3d05('0x54')](_0x3d05('0x31'),new LocalStrategy({'usernameField':_0x3d05('0xf'),'passwordField':_0x3d05('0x10')},function(_0x173a58,_0x67b70e,_0xf195c9){return localAuthenticate(db[_0x3d05('0x39')],_0x173a58,_0x67b70e,_0xf195c9);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 09aa122..67ebcff 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 _0xd449=['exports','express','Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset'];(function(_0x3df10f,_0x4c73ec){var _0x5519d6=function(_0x338ceb){while(--_0x338ceb){_0x3df10f['push'](_0x3df10f['shift']());}};_0x5519d6(++_0x4c73ec);}(_0xd449,0x1b9));var _0x9d44=function(_0xea1570,_0x2f7856){_0xea1570=_0xea1570-0x0;var _0x579e74=_0xd449[_0xea1570];return _0x579e74;};'use strict';var express=require(_0x9d44('0x0'));var router=express[_0x9d44('0x1')]();var controller=require(_0x9d44('0x2'));router[_0x9d44('0x3')]('/',controller[_0x9d44('0x4')]);router[_0x9d44('0x3')](_0x9d44('0x5'),controller[_0x9d44('0x6')]);router['post'](_0x9d44('0x7'),controller[_0x9d44('0x8')]);module[_0x9d44('0x9')]=router; \ No newline at end of file +var _0xffa1=['/forgot','reset','exports','express','Router','post'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0xffa1,0x87));var _0x1ffa=function(_0xa21809,_0x3ac2ef){_0xa21809=_0xa21809-0x0;var _0x870ae1=_0xffa1[_0xa21809];return _0x870ae1;};'use strict';var express=require(_0x1ffa('0x0'));var router=express[_0x1ffa('0x1')]();var controller=require('./authLocal.controller');router[_0x1ffa('0x2')]('/',controller['login']);router[_0x1ffa('0x2')](_0x1ffa('0x3'),controller['forgot']);router['post']('/reset/:token',controller[_0x1ffa('0x4')]);module[_0x1ffa('0x5')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 73fe361..01db78c 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 _0x6183=['STRING','INTEGER','exports'];(function(_0x95cc9d,_0x361445){var _0x2d53f6=function(_0x21b659){while(--_0x21b659){_0x95cc9d['push'](_0x95cc9d['shift']());}};_0x2d53f6(++_0x361445);}(_0x6183,0x95));var _0x3618=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x6183[_0x209ec9];return _0x129b1b;};'use strict';var Sequelize=require('sequelize');module[_0x3618('0x0')]={'name':{'type':Sequelize[_0x3618('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x3618('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3618('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0x51fa=['BOOLEAN','sequelize','STRING'];(function(_0x3ca916,_0xee3579){var _0x1ec219=function(_0x33365b){while(--_0x33365b){_0x3ca916['push'](_0x3ca916['shift']());}};_0x1ec219(++_0xee3579);}(_0x51fa,0x73));var _0xa51f=function(_0x4c8acb,_0x1d3959){_0x4c8acb=_0x4c8acb-0x0;var _0x24b7b2=_0x51fa[_0x4c8acb];return _0x24b7b2;};'use strict';var Sequelize=require(_0xa51f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa51f('0x1')]},'status':{'type':Sequelize[_0xa51f('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 3eaead2..c108c0f 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 _0xf4cc=['status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','Automation','findAll','rows','catch','show','params','includeAll','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','nolimit','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x217751,_0x5a0349){var _0x66446b=function(_0x10a50d){while(--_0x10a50d){_0x217751['push'](_0x217751['shift']());}};_0x66446b(++_0x5a0349);}(_0xf4cc,0x197));var _0xcf4c=function(_0xc26892,_0x2bb25b){_0xc26892=_0xc26892-0x0;var _0x14b0b4=_0xf4cc[_0xc26892];return _0x14b0b4;};'use strict';var emlformat=require(_0xcf4c('0x0'));var rimraf=require(_0xcf4c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcf4c('0x2'));var rp=require(_0xcf4c('0x3'));var moment=require('moment');var BPromise=require(_0xcf4c('0x4'));var Mustache=require(_0xcf4c('0x5'));var util=require(_0xcf4c('0x6'));var path=require(_0xcf4c('0x7'));var sox=require(_0xcf4c('0x8'));var csv=require(_0xcf4c('0x9'));var ejs=require(_0xcf4c('0xa'));var fs=require('fs');var fs_extra=require(_0xcf4c('0xb'));var _=require(_0xcf4c('0xc'));var squel=require(_0xcf4c('0xd'));var crypto=require(_0xcf4c('0xe'));var jsforce=require(_0xcf4c('0xf'));var deskjs=require(_0xcf4c('0x10'));var toCsv=require(_0xcf4c('0x9'));var querystring=require(_0xcf4c('0x11'));var Papa=require(_0xcf4c('0x12'));var Redis=require(_0xcf4c('0x13'));var authService=require(_0xcf4c('0x14'));var qs=require(_0xcf4c('0x15'));var as=require(_0xcf4c('0x16'));var hardwareService=require(_0xcf4c('0x17'));var logger=require(_0xcf4c('0x18'))(_0xcf4c('0x19'));var utils=require('../../config/utils');var config=require(_0xcf4c('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xcf4c('0x1b'))['db'];function respondWithStatusCode(_0x53d171,_0x199bab){_0x199bab=_0x199bab||0xcc;return function(_0x252fcf){if(_0x252fcf){return _0x53d171['sendStatus'](_0x199bab);}return _0x53d171[_0xcf4c('0x1c')](_0x199bab)[_0xcf4c('0x1d')]();};}function respondWithResult(_0x42af8d,_0x3cdc74){_0x3cdc74=_0x3cdc74||0xc8;return function(_0x2b5620){if(_0x2b5620){return _0x42af8d[_0xcf4c('0x1c')](_0x3cdc74)[_0xcf4c('0x1e')](_0x2b5620);}};}function respondWithFilteredResult(_0x9f4533,_0x2eccf8){return function(_0x56a4f3){if(_0x56a4f3){var _0x1894ab=typeof _0x2eccf8[_0xcf4c('0x1f')]==='undefined'&&typeof _0x2eccf8[_0xcf4c('0x20')]===_0xcf4c('0x21');var _0x1e11f7=_0x56a4f3[_0xcf4c('0x22')];var _0x22b01e=_0x1894ab?0x0:_0x2eccf8[_0xcf4c('0x1f')];var _0x1297e1=_0x1894ab?_0x56a4f3['count']:_0x2eccf8[_0xcf4c('0x1f')]+_0x2eccf8[_0xcf4c('0x20')];var _0x573be8;if(_0x1297e1>=_0x1e11f7){_0x1297e1=_0x1e11f7;_0x573be8=0xc8;}else{_0x573be8=0xce;}_0x9f4533[_0xcf4c('0x1c')](_0x573be8);return _0x9f4533['set'](_0xcf4c('0x23'),_0x22b01e+'-'+_0x1297e1+'/'+_0x1e11f7)[_0xcf4c('0x1e')](_0x56a4f3);}return null;};}function patchUpdates(_0x3e80dc){return function(_0x568b4e){try{jsonpatch[_0xcf4c('0x24')](_0x568b4e,_0x3e80dc,!![]);}catch(_0x443430){return BPromise[_0xcf4c('0x25')](_0x443430);}return _0x568b4e[_0xcf4c('0x26')]();};}function saveUpdates(_0x560f97,_0x40f841){return function(_0x1ba4bb){if(_0x1ba4bb){return _0x1ba4bb[_0xcf4c('0x27')](_0x560f97)[_0xcf4c('0x28')](function(_0x12b56a){return _0x12b56a;});}return null;};}function removeEntity(_0x188dc0,_0x2eec88){return function(_0x238eb6){if(_0x238eb6){return _0x238eb6[_0xcf4c('0x29')]()['then'](function(){_0x188dc0[_0xcf4c('0x1c')](0xcc)[_0xcf4c('0x1d')]();});}};}function handleEntityNotFound(_0x243930,_0x2c1925){return function(_0x4094f8){if(!_0x4094f8){_0x243930['sendStatus'](0x194);}return _0x4094f8;};}function handleError(_0x1dad7a,_0x5ca4ae){_0x5ca4ae=_0x5ca4ae||0x1f4;return function(_0x3a4a94){logger[_0xcf4c('0x2a')](_0x3a4a94[_0xcf4c('0x2b')]);if(_0x3a4a94[_0xcf4c('0x2c')]){delete _0x3a4a94[_0xcf4c('0x2c')];}_0x1dad7a[_0xcf4c('0x1c')](_0x5ca4ae)[_0xcf4c('0x2d')](_0x3a4a94);};}exports[_0xcf4c('0x2e')]=function(_0x2b0f05,_0x2c7b64){var _0x15e170={},_0xcaa680={},_0x26d12d={'count':0x0,'rows':[]};var _0x26a829=_[_0xcf4c('0x2f')](db['Automation'][_0xcf4c('0x30')],function(_0x5bd96e){return{'name':_0x5bd96e[_0xcf4c('0x31')],'type':_0x5bd96e[_0xcf4c('0x32')]['key']};});_0xcaa680[_0xcf4c('0x33')]=_[_0xcf4c('0x2f')](_0x26a829,_0xcf4c('0x2c'));_0xcaa680[_0xcf4c('0x34')]=_[_0xcf4c('0x35')](_0x2b0f05['query']);_0xcaa680[_0xcf4c('0x36')]=_[_0xcf4c('0x37')](_0xcaa680['model'],_0xcaa680[_0xcf4c('0x34')]);_0x15e170[_0xcf4c('0x38')]=_[_0xcf4c('0x37')](_0xcaa680[_0xcf4c('0x33')],qs[_0xcf4c('0x39')](_0x2b0f05[_0xcf4c('0x34')][_0xcf4c('0x39')]));_0x15e170[_0xcf4c('0x38')]=_0x15e170[_0xcf4c('0x38')][_0xcf4c('0x3a')]?_0x15e170[_0xcf4c('0x38')]:_0xcaa680[_0xcf4c('0x33')];if(!_0x2b0f05['query'][_0xcf4c('0x3b')]('nolimit')){_0x15e170[_0xcf4c('0x20')]=qs[_0xcf4c('0x20')](_0x2b0f05[_0xcf4c('0x34')][_0xcf4c('0x20')]);_0x15e170[_0xcf4c('0x1f')]=qs[_0xcf4c('0x1f')](_0x2b0f05[_0xcf4c('0x34')][_0xcf4c('0x1f')]);}_0x15e170[_0xcf4c('0x3c')]=qs[_0xcf4c('0x3d')](_0x2b0f05[_0xcf4c('0x34')][_0xcf4c('0x3d')]);_0x15e170[_0xcf4c('0x3e')]=qs['filters'](_[_0xcf4c('0x3f')](_0x2b0f05[_0xcf4c('0x34')],_0xcaa680[_0xcf4c('0x36')]),_0x26a829);if(_0x2b0f05[_0xcf4c('0x34')]['filter']){_0x15e170[_0xcf4c('0x3e')]=_['merge'](_0x15e170['where'],{'$or':_[_0xcf4c('0x2f')](_0x26a829,function(_0x1fc9ff){if(_0x1fc9ff[_0xcf4c('0x32')]!=='VIRTUAL'){var _0x291495={};_0x291495[_0x1fc9ff['name']]={'$like':'%'+_0x2b0f05['query'][_0xcf4c('0x40')]+'%'};return _0x291495;}})});}_0x15e170=_[_0xcf4c('0x41')]({},_0x15e170,_0x2b0f05[_0xcf4c('0x42')]);var _0xd3886e={'where':_0x15e170[_0xcf4c('0x3e')]};return db['Automation'][_0xcf4c('0x22')](_0xd3886e)[_0xcf4c('0x28')](function(_0x455d33){_0x26d12d['count']=_0x455d33;if(_0x2b0f05['query']['includeAll']){_0x15e170['include']=[{'all':!![]}];}return db[_0xcf4c('0x43')][_0xcf4c('0x44')](_0x15e170);})[_0xcf4c('0x28')](function(_0x4af220){_0x26d12d[_0xcf4c('0x45')]=_0x4af220;return _0x26d12d;})[_0xcf4c('0x28')](respondWithFilteredResult(_0x2c7b64,_0x15e170))[_0xcf4c('0x46')](handleError(_0x2c7b64,null));};exports[_0xcf4c('0x47')]=function(_0x3eb309,_0x276da6){var _0x4d5be7={'raw':![],'where':{'id':_0x3eb309[_0xcf4c('0x48')]['id']}},_0xde32c8={};_0xde32c8[_0xcf4c('0x33')]=_['keys'](db[_0xcf4c('0x43')][_0xcf4c('0x30')]);_0xde32c8[_0xcf4c('0x34')]=_[_0xcf4c('0x35')](_0x3eb309[_0xcf4c('0x34')]);_0xde32c8[_0xcf4c('0x36')]=_[_0xcf4c('0x37')](_0xde32c8[_0xcf4c('0x33')],_0xde32c8['query']);_0x4d5be7['attributes']=_[_0xcf4c('0x37')](_0xde32c8['model'],qs[_0xcf4c('0x39')](_0x3eb309[_0xcf4c('0x34')][_0xcf4c('0x39')]));_0x4d5be7[_0xcf4c('0x38')]=_0x4d5be7[_0xcf4c('0x38')][_0xcf4c('0x3a')]?_0x4d5be7[_0xcf4c('0x38')]:_0xde32c8[_0xcf4c('0x33')];if(_0x3eb309['query'][_0xcf4c('0x49')]){_0x4d5be7['include']=[{'all':!![]}];}_0x4d5be7=_[_0xcf4c('0x41')]({},_0x4d5be7,_0x3eb309[_0xcf4c('0x42')]);return db[_0xcf4c('0x43')][_0xcf4c('0x4a')](_0x4d5be7)['then'](handleEntityNotFound(_0x276da6,null))['then'](respondWithResult(_0x276da6,null))[_0xcf4c('0x46')](handleError(_0x276da6,null));};exports['create']=function(_0x5cf5b2,_0x4bc1a3){return db[_0xcf4c('0x43')][_0xcf4c('0x4b')](_0x5cf5b2[_0xcf4c('0x4c')],{})[_0xcf4c('0x28')](respondWithResult(_0x4bc1a3,0xc9))['catch'](handleError(_0x4bc1a3,null));};exports['update']=function(_0x3f9836,_0x8fad9f){if(_0x3f9836[_0xcf4c('0x4c')]['id']){delete _0x3f9836[_0xcf4c('0x4c')]['id'];}return db[_0xcf4c('0x43')]['find']({'where':{'id':_0x3f9836[_0xcf4c('0x48')]['id']}})['then'](handleEntityNotFound(_0x8fad9f,null))[_0xcf4c('0x28')](saveUpdates(_0x3f9836[_0xcf4c('0x4c')],null))[_0xcf4c('0x28')](respondWithResult(_0x8fad9f,null))['catch'](handleError(_0x8fad9f,null));};exports['destroy']=function(_0xfd8193,_0x381ae2){return db['Automation'][_0xcf4c('0x4a')]({'where':{'id':_0xfd8193['params']['id']}})[_0xcf4c('0x28')](handleEntityNotFound(_0x381ae2,null))[_0xcf4c('0x28')](removeEntity(_0x381ae2,null))[_0xcf4c('0x46')](handleError(_0x381ae2,null));};exports[_0xcf4c('0x4d')]=function(_0x35d89f,_0x265bcf,_0x1f066b){return db[_0xcf4c('0x4e')][_0xcf4c('0x4a')]({'where':{'id':_0x35d89f[_0xcf4c('0x48')]['id']}})[_0xcf4c('0x28')](handleEntityNotFound(_0x265bcf,null))[_0xcf4c('0x28')](function(_0x3e0b53){if(_0x3e0b53){return _0x3e0b53['addConditions'](_0x35d89f[_0xcf4c('0x4c')][_0xcf4c('0x4f')],_[_0xcf4c('0x50')](_0x35d89f['body'],[_0xcf4c('0x4f'),'id'])||{});}})[_0xcf4c('0x28')](respondWithResult(_0x265bcf,null))[_0xcf4c('0x46')](handleError(_0x265bcf,null));};exports[_0xcf4c('0x51')]=function(_0x402d1b,_0x59b8b4,_0x3d85ad){var _0x2cf6fd={};var _0x347b41={};var _0x593e10;var _0x2f54f4;return db['Automation'][_0xcf4c('0x52')]({'where':{'id':_0x402d1b[_0xcf4c('0x48')]['id']}})['then'](handleEntityNotFound(_0x59b8b4,null))[_0xcf4c('0x28')](function(_0x5aa39f){if(_0x5aa39f){_0x593e10=_0x5aa39f;_0x347b41[_0xcf4c('0x33')]=_[_0xcf4c('0x35')](db[_0xcf4c('0x4e')][_0xcf4c('0x30')]);_0x347b41[_0xcf4c('0x34')]=_['keys'](_0x402d1b[_0xcf4c('0x34')]);_0x347b41[_0xcf4c('0x36')]=_[_0xcf4c('0x37')](_0x347b41[_0xcf4c('0x33')],_0x347b41[_0xcf4c('0x34')]);_0x2cf6fd[_0xcf4c('0x38')]=_[_0xcf4c('0x37')](_0x347b41[_0xcf4c('0x33')],qs[_0xcf4c('0x39')](_0x402d1b[_0xcf4c('0x34')]['fields']));_0x2cf6fd['attributes']=_0x2cf6fd[_0xcf4c('0x38')]['length']?_0x2cf6fd[_0xcf4c('0x38')]:_0x347b41[_0xcf4c('0x33')];_0x2cf6fd['order']=qs[_0xcf4c('0x3d')](_0x402d1b[_0xcf4c('0x34')][_0xcf4c('0x3d')]);_0x2cf6fd[_0xcf4c('0x3e')]=qs[_0xcf4c('0x36')](_['pick'](_0x402d1b[_0xcf4c('0x34')],_0x347b41[_0xcf4c('0x36')]));if(_0x402d1b[_0xcf4c('0x34')][_0xcf4c('0x40')]){_0x2cf6fd[_0xcf4c('0x3e')]=_['merge'](_0x2cf6fd[_0xcf4c('0x3e')],{'$or':_[_0xcf4c('0x2f')](_0x2cf6fd[_0xcf4c('0x38')],function(_0x24cfba){var _0x4b1e69={};_0x4b1e69[_0x24cfba]={'$like':'%'+_0x402d1b[_0xcf4c('0x34')]['filter']+'%'};return _0x4b1e69;})});}_0x2cf6fd=_[_0xcf4c('0x41')]({},_0x2cf6fd,_0x402d1b['options']);return _0x593e10[_0xcf4c('0x51')](_0x2cf6fd);}})[_0xcf4c('0x28')](function(_0x297f29){if(_0x297f29){_0x2f54f4=_0x297f29[_0xcf4c('0x3a')];if(!_0x402d1b[_0xcf4c('0x34')][_0xcf4c('0x3b')]('nolimit')){_0x2cf6fd[_0xcf4c('0x20')]=qs[_0xcf4c('0x20')](_0x402d1b[_0xcf4c('0x34')][_0xcf4c('0x20')]);_0x2cf6fd[_0xcf4c('0x1f')]=qs[_0xcf4c('0x1f')](_0x402d1b['query']['offset']);}return _0x593e10[_0xcf4c('0x51')](_0x2cf6fd);}})[_0xcf4c('0x28')](function(_0x181607){if(_0x181607){return _0x181607?{'count':_0x2f54f4,'rows':_0x181607}:null;}})[_0xcf4c('0x28')](respondWithResult(_0x59b8b4,null))[_0xcf4c('0x46')](handleError(_0x59b8b4,null));};exports[_0xcf4c('0x53')]=function(_0x350fb6,_0x17f579,_0x271be6){return db[_0xcf4c('0x54')][_0xcf4c('0x4a')]({'where':{'id':_0x350fb6[_0xcf4c('0x48')]['id']}})[_0xcf4c('0x28')](handleEntityNotFound(_0x17f579,null))['then'](function(_0x1a9560){if(_0x1a9560){return _0x1a9560[_0xcf4c('0x53')](_0x350fb6[_0xcf4c('0x4c')][_0xcf4c('0x4f')],_[_0xcf4c('0x50')](_0x350fb6['body'],['ids','id'])||{});}})[_0xcf4c('0x28')](respondWithResult(_0x17f579,null))[_0xcf4c('0x46')](handleError(_0x17f579,null));};exports[_0xcf4c('0x55')]=function(_0x256c61,_0x117925,_0xcbefe8){var _0x48c5ba={};var _0x27a95f={};var _0x39396a;var _0x1fcb12;return db['Automation'][_0xcf4c('0x52')]({'where':{'id':_0x256c61[_0xcf4c('0x48')]['id']}})['then'](handleEntityNotFound(_0x117925,null))['then'](function(_0x24e378){if(_0x24e378){_0x39396a=_0x24e378;_0x27a95f[_0xcf4c('0x33')]=_[_0xcf4c('0x35')](db[_0xcf4c('0x54')]['rawAttributes']);_0x27a95f[_0xcf4c('0x34')]=_['keys'](_0x256c61[_0xcf4c('0x34')]);_0x27a95f[_0xcf4c('0x36')]=_[_0xcf4c('0x37')](_0x27a95f[_0xcf4c('0x33')],_0x27a95f[_0xcf4c('0x34')]);_0x48c5ba[_0xcf4c('0x38')]=_['intersection'](_0x27a95f[_0xcf4c('0x33')],qs[_0xcf4c('0x39')](_0x256c61[_0xcf4c('0x34')][_0xcf4c('0x39')]));_0x48c5ba[_0xcf4c('0x38')]=_0x48c5ba['attributes'][_0xcf4c('0x3a')]?_0x48c5ba[_0xcf4c('0x38')]:_0x27a95f['model'];_0x48c5ba[_0xcf4c('0x3c')]=qs['sort'](_0x256c61[_0xcf4c('0x34')][_0xcf4c('0x3d')]);_0x48c5ba[_0xcf4c('0x3e')]=qs['filters'](_[_0xcf4c('0x3f')](_0x256c61[_0xcf4c('0x34')],_0x27a95f[_0xcf4c('0x36')]));if(_0x256c61[_0xcf4c('0x34')][_0xcf4c('0x40')]){_0x48c5ba[_0xcf4c('0x3e')]=_[_0xcf4c('0x41')](_0x48c5ba['where'],{'$or':_['map'](_0x48c5ba[_0xcf4c('0x38')],function(_0x11ea42){var _0x392426={};_0x392426[_0x11ea42]={'$like':'%'+_0x256c61[_0xcf4c('0x34')][_0xcf4c('0x40')]+'%'};return _0x392426;})});}_0x48c5ba=_[_0xcf4c('0x41')]({},_0x48c5ba,_0x256c61['options']);return _0x39396a[_0xcf4c('0x55')](_0x48c5ba);}})[_0xcf4c('0x28')](function(_0x47aa3b){if(_0x47aa3b){_0x1fcb12=_0x47aa3b[_0xcf4c('0x3a')];if(!_0x256c61[_0xcf4c('0x34')][_0xcf4c('0x3b')](_0xcf4c('0x56'))){_0x48c5ba[_0xcf4c('0x20')]=qs['limit'](_0x256c61['query'][_0xcf4c('0x20')]);_0x48c5ba['offset']=qs['offset'](_0x256c61[_0xcf4c('0x34')][_0xcf4c('0x1f')]);}return _0x39396a[_0xcf4c('0x55')](_0x48c5ba);}})[_0xcf4c('0x28')](function(_0x1293e9){if(_0x1293e9){return _0x1293e9?{'count':_0x1fcb12,'rows':_0x1293e9}:null;}})['then'](respondWithResult(_0x117925,null))[_0xcf4c('0x46')](handleError(_0x117925,null));}; \ No newline at end of file +var _0xc461=['include','findAll','show','params','options','find','catch','create','body','destroy','Condition','addConditions','ids','omit','getConditions','findOne','filter','Action','addActions','getActions','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','Automation','rawAttributes','fieldName','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','includeAll'];(function(_0xc5c9ac,_0x57c492){var _0x3f4606=function(_0x2aa448){while(--_0x2aa448){_0xc5c9ac['push'](_0xc5c9ac['shift']());}};_0x3f4606(++_0x57c492);}(_0xc461,0x68));var _0x1c46=function(_0x2b8332,_0x18b4b8){_0x2b8332=_0x2b8332-0x0;var _0x46a4da=_0xc461[_0x2b8332];return _0x46a4da;};'use strict';var emlformat=require(_0x1c46('0x0'));var rimraf=require(_0x1c46('0x1'));var zipdir=require(_0x1c46('0x2'));var jsonpatch=require(_0x1c46('0x3'));var rp=require(_0x1c46('0x4'));var moment=require(_0x1c46('0x5'));var BPromise=require(_0x1c46('0x6'));var Mustache=require('mustache');var util=require(_0x1c46('0x7'));var path=require(_0x1c46('0x8'));var sox=require(_0x1c46('0x9'));var csv=require('to-csv');var ejs=require(_0x1c46('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1c46('0xb'));var deskjs=require(_0x1c46('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1c46('0xd'));var Redis=require(_0x1c46('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x1c46('0xf'));var as=require(_0x1c46('0x10'));var hardwareService=require(_0x1c46('0x11'));var logger=require(_0x1c46('0x12'))(_0x1c46('0x13'));var utils=require('../../config/utils');var config=require(_0x1c46('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1c46('0x15'))['db'];function respondWithStatusCode(_0x2ee0f9,_0x1654b1){_0x1654b1=_0x1654b1||0xcc;return function(_0x55b4a2){if(_0x55b4a2){return _0x2ee0f9[_0x1c46('0x16')](_0x1654b1);}return _0x2ee0f9[_0x1c46('0x17')](_0x1654b1)[_0x1c46('0x18')]();};}function respondWithResult(_0x56845d,_0x10e16e){_0x10e16e=_0x10e16e||0xc8;return function(_0x5e3f1a){if(_0x5e3f1a){return _0x56845d[_0x1c46('0x17')](_0x10e16e)[_0x1c46('0x19')](_0x5e3f1a);}};}function respondWithFilteredResult(_0x42cd15,_0xe9812b){return function(_0x3782cf){if(_0x3782cf){var _0x387217=typeof _0xe9812b[_0x1c46('0x1a')]===_0x1c46('0x1b')&&typeof _0xe9812b[_0x1c46('0x1c')]==='undefined';var _0x331cca=_0x3782cf[_0x1c46('0x1d')];var _0x1a772b=_0x387217?0x0:_0xe9812b[_0x1c46('0x1a')];var _0x1dfa67=_0x387217?_0x3782cf[_0x1c46('0x1d')]:_0xe9812b[_0x1c46('0x1a')]+_0xe9812b[_0x1c46('0x1c')];var _0x112d3d;if(_0x1dfa67>=_0x331cca){_0x1dfa67=_0x331cca;_0x112d3d=0xc8;}else{_0x112d3d=0xce;}_0x42cd15[_0x1c46('0x17')](_0x112d3d);return _0x42cd15[_0x1c46('0x1e')](_0x1c46('0x1f'),_0x1a772b+'-'+_0x1dfa67+'/'+_0x331cca)['json'](_0x3782cf);}return null;};}function patchUpdates(_0x5b7bb5){return function(_0x5df8e8){try{jsonpatch[_0x1c46('0x20')](_0x5df8e8,_0x5b7bb5,!![]);}catch(_0x40cc6c){return BPromise[_0x1c46('0x21')](_0x40cc6c);}return _0x5df8e8[_0x1c46('0x22')]();};}function saveUpdates(_0x149e9a,_0x3246bf){return function(_0x358fe6){if(_0x358fe6){return _0x358fe6[_0x1c46('0x23')](_0x149e9a)[_0x1c46('0x24')](function(_0x1deddc){return _0x1deddc;});}return null;};}function removeEntity(_0x30d766,_0x2b451e){return function(_0x4f6562){if(_0x4f6562){return _0x4f6562['destroy']()[_0x1c46('0x24')](function(){_0x30d766[_0x1c46('0x17')](0xcc)[_0x1c46('0x18')]();});}};}function handleEntityNotFound(_0x395801,_0x197bbd){return function(_0x481558){if(!_0x481558){_0x395801[_0x1c46('0x16')](0x194);}return _0x481558;};}function handleError(_0x2f2abe,_0x5a0ecf){_0x5a0ecf=_0x5a0ecf||0x1f4;return function(_0x3700fe){logger[_0x1c46('0x25')](_0x3700fe[_0x1c46('0x26')]);if(_0x3700fe['name']){delete _0x3700fe[_0x1c46('0x27')];}_0x2f2abe[_0x1c46('0x17')](_0x5a0ecf)[_0x1c46('0x28')](_0x3700fe);};}exports['index']=function(_0x11331d,_0x3eb679){var _0xddb15={},_0x355fc8={},_0x315d72={'count':0x0,'rows':[]};var _0x1c517c=_['map'](db[_0x1c46('0x29')][_0x1c46('0x2a')],function(_0x2e8e73){return{'name':_0x2e8e73[_0x1c46('0x2b')],'type':_0x2e8e73['type'][_0x1c46('0x2c')]};});_0x355fc8['model']=_[_0x1c46('0x2d')](_0x1c517c,'name');_0x355fc8[_0x1c46('0x2e')]=_[_0x1c46('0x2f')](_0x11331d[_0x1c46('0x2e')]);_0x355fc8['filters']=_[_0x1c46('0x30')](_0x355fc8[_0x1c46('0x31')],_0x355fc8[_0x1c46('0x2e')]);_0xddb15['attributes']=_[_0x1c46('0x30')](_0x355fc8[_0x1c46('0x31')],qs[_0x1c46('0x32')](_0x11331d[_0x1c46('0x2e')][_0x1c46('0x32')]));_0xddb15[_0x1c46('0x33')]=_0xddb15[_0x1c46('0x33')][_0x1c46('0x34')]?_0xddb15[_0x1c46('0x33')]:_0x355fc8[_0x1c46('0x31')];if(!_0x11331d[_0x1c46('0x2e')][_0x1c46('0x35')](_0x1c46('0x36'))){_0xddb15['limit']=qs[_0x1c46('0x1c')](_0x11331d[_0x1c46('0x2e')][_0x1c46('0x1c')]);_0xddb15[_0x1c46('0x1a')]=qs[_0x1c46('0x1a')](_0x11331d['query'][_0x1c46('0x1a')]);}_0xddb15['order']=qs[_0x1c46('0x37')](_0x11331d[_0x1c46('0x2e')][_0x1c46('0x37')]);_0xddb15[_0x1c46('0x38')]=qs[_0x1c46('0x39')](_[_0x1c46('0x3a')](_0x11331d[_0x1c46('0x2e')],_0x355fc8[_0x1c46('0x39')]),_0x1c517c);if(_0x11331d[_0x1c46('0x2e')]['filter']){_0xddb15[_0x1c46('0x38')]=_[_0x1c46('0x3b')](_0xddb15['where'],{'$or':_[_0x1c46('0x2d')](_0x1c517c,function(_0x30fb54){if(_0x30fb54[_0x1c46('0x3c')]!=='VIRTUAL'){var _0x3b6793={};_0x3b6793[_0x30fb54['name']]={'$like':'%'+_0x11331d[_0x1c46('0x2e')]['filter']+'%'};return _0x3b6793;}})});}_0xddb15=_['merge']({},_0xddb15,_0x11331d['options']);var _0x4b3951={'where':_0xddb15[_0x1c46('0x38')]};return db[_0x1c46('0x29')][_0x1c46('0x1d')](_0x4b3951)[_0x1c46('0x24')](function(_0x5022e5){_0x315d72[_0x1c46('0x1d')]=_0x5022e5;if(_0x11331d[_0x1c46('0x2e')][_0x1c46('0x3d')]){_0xddb15[_0x1c46('0x3e')]=[{'all':!![]}];}return db[_0x1c46('0x29')][_0x1c46('0x3f')](_0xddb15);})[_0x1c46('0x24')](function(_0x19da41){_0x315d72['rows']=_0x19da41;return _0x315d72;})[_0x1c46('0x24')](respondWithFilteredResult(_0x3eb679,_0xddb15))['catch'](handleError(_0x3eb679,null));};exports[_0x1c46('0x40')]=function(_0x388a1d,_0x2787dc){var _0x19f8b3={'raw':![],'where':{'id':_0x388a1d[_0x1c46('0x41')]['id']}},_0x255c7b={};_0x255c7b['model']=_[_0x1c46('0x2f')](db[_0x1c46('0x29')][_0x1c46('0x2a')]);_0x255c7b[_0x1c46('0x2e')]=_[_0x1c46('0x2f')](_0x388a1d['query']);_0x255c7b[_0x1c46('0x39')]=_[_0x1c46('0x30')](_0x255c7b['model'],_0x255c7b[_0x1c46('0x2e')]);_0x19f8b3[_0x1c46('0x33')]=_[_0x1c46('0x30')](_0x255c7b[_0x1c46('0x31')],qs[_0x1c46('0x32')](_0x388a1d[_0x1c46('0x2e')][_0x1c46('0x32')]));_0x19f8b3[_0x1c46('0x33')]=_0x19f8b3[_0x1c46('0x33')][_0x1c46('0x34')]?_0x19f8b3['attributes']:_0x255c7b['model'];if(_0x388a1d['query'][_0x1c46('0x3d')]){_0x19f8b3[_0x1c46('0x3e')]=[{'all':!![]}];}_0x19f8b3=_['merge']({},_0x19f8b3,_0x388a1d[_0x1c46('0x42')]);return db[_0x1c46('0x29')][_0x1c46('0x43')](_0x19f8b3)[_0x1c46('0x24')](handleEntityNotFound(_0x2787dc,null))[_0x1c46('0x24')](respondWithResult(_0x2787dc,null))[_0x1c46('0x44')](handleError(_0x2787dc,null));};exports[_0x1c46('0x45')]=function(_0x385baf,_0x2fabeb){return db[_0x1c46('0x29')][_0x1c46('0x45')](_0x385baf['body'],{})['then'](respondWithResult(_0x2fabeb,0xc9))[_0x1c46('0x44')](handleError(_0x2fabeb,null));};exports[_0x1c46('0x23')]=function(_0x30a52e,_0x4a7bfb){if(_0x30a52e[_0x1c46('0x46')]['id']){delete _0x30a52e[_0x1c46('0x46')]['id'];}return db[_0x1c46('0x29')][_0x1c46('0x43')]({'where':{'id':_0x30a52e[_0x1c46('0x41')]['id']}})[_0x1c46('0x24')](handleEntityNotFound(_0x4a7bfb,null))[_0x1c46('0x24')](saveUpdates(_0x30a52e[_0x1c46('0x46')],null))[_0x1c46('0x24')](respondWithResult(_0x4a7bfb,null))[_0x1c46('0x44')](handleError(_0x4a7bfb,null));};exports[_0x1c46('0x47')]=function(_0xacc9ec,_0x3e7c7f){return db['Automation'][_0x1c46('0x43')]({'where':{'id':_0xacc9ec[_0x1c46('0x41')]['id']}})[_0x1c46('0x24')](handleEntityNotFound(_0x3e7c7f,null))[_0x1c46('0x24')](removeEntity(_0x3e7c7f,null))[_0x1c46('0x44')](handleError(_0x3e7c7f,null));};exports['addConditions']=function(_0x3d7a5e,_0x2815fc,_0x553356){return db[_0x1c46('0x48')]['find']({'where':{'id':_0x3d7a5e['params']['id']}})[_0x1c46('0x24')](handleEntityNotFound(_0x2815fc,null))[_0x1c46('0x24')](function(_0x57ee07){if(_0x57ee07){return _0x57ee07[_0x1c46('0x49')](_0x3d7a5e[_0x1c46('0x46')][_0x1c46('0x4a')],_[_0x1c46('0x4b')](_0x3d7a5e[_0x1c46('0x46')],['ids','id'])||{});}})['then'](respondWithResult(_0x2815fc,null))[_0x1c46('0x44')](handleError(_0x2815fc,null));};exports[_0x1c46('0x4c')]=function(_0x455f55,_0x59d1c3,_0x26e454){var _0x50d99e={};var _0x2fe34f={};var _0x4d9f5f;var _0x4bacce;return db['Automation'][_0x1c46('0x4d')]({'where':{'id':_0x455f55[_0x1c46('0x41')]['id']}})[_0x1c46('0x24')](handleEntityNotFound(_0x59d1c3,null))[_0x1c46('0x24')](function(_0x14c4ae){if(_0x14c4ae){_0x4d9f5f=_0x14c4ae;_0x2fe34f[_0x1c46('0x31')]=_[_0x1c46('0x2f')](db[_0x1c46('0x48')][_0x1c46('0x2a')]);_0x2fe34f[_0x1c46('0x2e')]=_['keys'](_0x455f55[_0x1c46('0x2e')]);_0x2fe34f[_0x1c46('0x39')]=_[_0x1c46('0x30')](_0x2fe34f[_0x1c46('0x31')],_0x2fe34f[_0x1c46('0x2e')]);_0x50d99e['attributes']=_[_0x1c46('0x30')](_0x2fe34f[_0x1c46('0x31')],qs[_0x1c46('0x32')](_0x455f55[_0x1c46('0x2e')][_0x1c46('0x32')]));_0x50d99e['attributes']=_0x50d99e['attributes'][_0x1c46('0x34')]?_0x50d99e[_0x1c46('0x33')]:_0x2fe34f[_0x1c46('0x31')];_0x50d99e['order']=qs[_0x1c46('0x37')](_0x455f55[_0x1c46('0x2e')][_0x1c46('0x37')]);_0x50d99e['where']=qs[_0x1c46('0x39')](_[_0x1c46('0x3a')](_0x455f55[_0x1c46('0x2e')],_0x2fe34f['filters']));if(_0x455f55[_0x1c46('0x2e')][_0x1c46('0x4e')]){_0x50d99e['where']=_['merge'](_0x50d99e[_0x1c46('0x38')],{'$or':_['map'](_0x50d99e[_0x1c46('0x33')],function(_0x136539){var _0x389c1e={};_0x389c1e[_0x136539]={'$like':'%'+_0x455f55[_0x1c46('0x2e')][_0x1c46('0x4e')]+'%'};return _0x389c1e;})});}_0x50d99e=_['merge']({},_0x50d99e,_0x455f55[_0x1c46('0x42')]);return _0x4d9f5f[_0x1c46('0x4c')](_0x50d99e);}})['then'](function(_0x55098b){if(_0x55098b){_0x4bacce=_0x55098b[_0x1c46('0x34')];if(!_0x455f55['query'][_0x1c46('0x35')](_0x1c46('0x36'))){_0x50d99e[_0x1c46('0x1c')]=qs['limit'](_0x455f55['query'][_0x1c46('0x1c')]);_0x50d99e['offset']=qs[_0x1c46('0x1a')](_0x455f55[_0x1c46('0x2e')][_0x1c46('0x1a')]);}return _0x4d9f5f[_0x1c46('0x4c')](_0x50d99e);}})[_0x1c46('0x24')](function(_0x16b40b){if(_0x16b40b){return _0x16b40b?{'count':_0x4bacce,'rows':_0x16b40b}:null;}})[_0x1c46('0x24')](respondWithResult(_0x59d1c3,null))[_0x1c46('0x44')](handleError(_0x59d1c3,null));};exports['addActions']=function(_0x3ad3a5,_0x1a6fb0,_0xef5f20){return db[_0x1c46('0x4f')]['find']({'where':{'id':_0x3ad3a5[_0x1c46('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a6fb0,null))[_0x1c46('0x24')](function(_0xfbbfb1){if(_0xfbbfb1){return _0xfbbfb1[_0x1c46('0x50')](_0x3ad3a5[_0x1c46('0x46')][_0x1c46('0x4a')],_['omit'](_0x3ad3a5[_0x1c46('0x46')],[_0x1c46('0x4a'),'id'])||{});}})[_0x1c46('0x24')](respondWithResult(_0x1a6fb0,null))[_0x1c46('0x44')](handleError(_0x1a6fb0,null));};exports[_0x1c46('0x51')]=function(_0x61511d,_0x346d3e,_0x50e51f){var _0x459b2e={};var _0x4f2c8e={};var _0x39efa9;var _0x58c7c9;return db[_0x1c46('0x29')][_0x1c46('0x4d')]({'where':{'id':_0x61511d[_0x1c46('0x41')]['id']}})[_0x1c46('0x24')](handleEntityNotFound(_0x346d3e,null))[_0x1c46('0x24')](function(_0x40e929){if(_0x40e929){_0x39efa9=_0x40e929;_0x4f2c8e['model']=_[_0x1c46('0x2f')](db['Action']['rawAttributes']);_0x4f2c8e[_0x1c46('0x2e')]=_[_0x1c46('0x2f')](_0x61511d[_0x1c46('0x2e')]);_0x4f2c8e[_0x1c46('0x39')]=_[_0x1c46('0x30')](_0x4f2c8e['model'],_0x4f2c8e[_0x1c46('0x2e')]);_0x459b2e['attributes']=_[_0x1c46('0x30')](_0x4f2c8e[_0x1c46('0x31')],qs[_0x1c46('0x32')](_0x61511d[_0x1c46('0x2e')]['fields']));_0x459b2e[_0x1c46('0x33')]=_0x459b2e['attributes'][_0x1c46('0x34')]?_0x459b2e[_0x1c46('0x33')]:_0x4f2c8e['model'];_0x459b2e[_0x1c46('0x52')]=qs[_0x1c46('0x37')](_0x61511d[_0x1c46('0x2e')][_0x1c46('0x37')]);_0x459b2e['where']=qs[_0x1c46('0x39')](_[_0x1c46('0x3a')](_0x61511d[_0x1c46('0x2e')],_0x4f2c8e[_0x1c46('0x39')]));if(_0x61511d[_0x1c46('0x2e')][_0x1c46('0x4e')]){_0x459b2e[_0x1c46('0x38')]=_[_0x1c46('0x3b')](_0x459b2e[_0x1c46('0x38')],{'$or':_[_0x1c46('0x2d')](_0x459b2e[_0x1c46('0x33')],function(_0x199c2e){var _0x545df9={};_0x545df9[_0x199c2e]={'$like':'%'+_0x61511d[_0x1c46('0x2e')][_0x1c46('0x4e')]+'%'};return _0x545df9;})});}_0x459b2e=_[_0x1c46('0x3b')]({},_0x459b2e,_0x61511d['options']);return _0x39efa9[_0x1c46('0x51')](_0x459b2e);}})[_0x1c46('0x24')](function(_0x4846f9){if(_0x4846f9){_0x58c7c9=_0x4846f9[_0x1c46('0x34')];if(!_0x61511d['query'][_0x1c46('0x35')](_0x1c46('0x36'))){_0x459b2e[_0x1c46('0x1c')]=qs['limit'](_0x61511d[_0x1c46('0x2e')][_0x1c46('0x1c')]);_0x459b2e[_0x1c46('0x1a')]=qs[_0x1c46('0x1a')](_0x61511d['query'][_0x1c46('0x1a')]);}return _0x39efa9[_0x1c46('0x51')](_0x459b2e);}})[_0x1c46('0x24')](function(_0x2df8fb){if(_0x2df8fb){return _0x2df8fb?{'count':_0x58c7c9,'rows':_0x2df8fb}:null;}})[_0x1c46('0x24')](respondWithResult(_0x346d3e,null))[_0x1c46('0x44')](handleError(_0x346d3e,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 2f5e17b..39da091 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 _0xf097=['exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./automation.attributes'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xf097,0x1a4));var _0x7f09=function(_0x4cc860,_0xf7eea3){_0x4cc860=_0x4cc860-0x0;var _0x1d01ff=_0xf097[_0x4cc860];return _0x1d01ff;};'use strict';var _=require(_0x7f09('0x0'));var util=require(_0x7f09('0x1'));var logger=require(_0x7f09('0x2'))(_0x7f09('0x3'));var moment=require('moment');var BPromise=require(_0x7f09('0x4'));var rp=require(_0x7f09('0x5'));var fs=require('fs');var path=require(_0x7f09('0x6'));var rimraf=require('rimraf');var config=require(_0x7f09('0x7'));var attributes=require(_0x7f09('0x8'));module[_0x7f09('0x9')]=function(_0xd5de49,_0x2f080c){return _0xd5de49[_0x7f09('0xa')](_0x7f09('0xb'),attributes,{'tableName':_0x7f09('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b54=['define','Automation','tools_automations','lodash','api','moment','path','rimraf','../../config/environment','exports'];(function(_0x11abe5,_0x2cc613){var _0x88fb48=function(_0x29fa80){while(--_0x29fa80){_0x11abe5['push'](_0x11abe5['shift']());}};_0x88fb48(++_0x2cc613);}(_0x0b54,0xc1));var _0x40b5=function(_0x3a8dc1,_0x2f03b8){_0x3a8dc1=_0x3a8dc1-0x0;var _0x4b3595=_0x0b54[_0x3a8dc1];return _0x4b3595;};'use strict';var _=require(_0x40b5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x40b5('0x1'));var moment=require(_0x40b5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x40b5('0x3'));var rimraf=require(_0x40b5('0x4'));var config=require(_0x40b5('0x5'));var attributes=require('./automation.attributes');module[_0x40b5('0x6')]=function(_0x12cfd6,_0x41a796){return _0x12cfd6[_0x40b5('0x7')](_0x40b5('0x8'),attributes,{'tableName':_0x40b5('0x9'),'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 29e94e4..57e8394 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 _0xfa94=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa94,0xef));var _0x4fa9=function(_0x51f012,_0x629f0d){_0x51f012=_0x51f012-0x0;var _0x1e3e8f=_0xfa94[_0x51f012];return _0x1e3e8f;};'use strict';var _=require(_0x4fa9('0x0'));var util=require('util');var moment=require(_0x4fa9('0x1'));var BPromise=require('bluebird');var rs=require(_0x4fa9('0x2'));var fs=require('fs');var Redis=require(_0x4fa9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4fa9('0x4'));var logger=require(_0x4fa9('0x5'))(_0x4fa9('0x6'));var config=require(_0x4fa9('0x7'));var jayson=require(_0x4fa9('0x8'));var client=jayson[_0x4fa9('0x9')][_0x4fa9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56faa9,_0xd4dcad,_0x2fb0b3){return new BPromise(function(_0x48fe52,_0x500b64){return client[_0x4fa9('0xb')](_0x56faa9,_0x2fb0b3)['then'](function(_0x2049ea){logger[_0x4fa9('0xc')](_0x4fa9('0xd'),_0xd4dcad,'request\x20sent');logger[_0x4fa9('0xe')]('Automation,\x20%s,\x20%s,\x20%s',_0xd4dcad,_0x4fa9('0xf'),JSON[_0x4fa9('0x10')](_0x2049ea));if(_0x2049ea['error']){if(_0x2049ea[_0x4fa9('0x11')][_0x4fa9('0x12')]===0x1f4){logger[_0x4fa9('0x11')]('Automation,\x20%s,\x20%s',_0xd4dcad,_0x2049ea[_0x4fa9('0x11')]['message']);return _0x500b64(_0x2049ea[_0x4fa9('0x11')][_0x4fa9('0x13')]);}logger['error'](_0x4fa9('0xd'),_0xd4dcad,_0x2049ea[_0x4fa9('0x11')][_0x4fa9('0x13')]);return _0x48fe52(_0x2049ea[_0x4fa9('0x11')][_0x4fa9('0x13')]);}else{logger[_0x4fa9('0xc')](_0x4fa9('0xd'),_0xd4dcad,_0x4fa9('0xf'));_0x48fe52(_0x2049ea[_0x4fa9('0x14')]['message']);}})[_0x4fa9('0x15')](function(_0x1a1117){logger['error']('Automation,\x20%s,\x20%s',_0xd4dcad,_0x1a1117);_0x500b64(_0x1a1117);});});} \ No newline at end of file +var _0xd237=['client','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5e7fbe,_0x49c047){var _0x3ec021=function(_0x2c149b){while(--_0x2c149b){_0x5e7fbe['push'](_0x5e7fbe['shift']());}};_0x3ec021(++_0x49c047);}(_0xd237,0x14f));var _0x7d23=function(_0x141a31,_0x3ab263){_0x141a31=_0x141a31-0x0;var _0x44b4e3=_0xd237[_0x141a31];return _0x44b4e3;};'use strict';var _=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var moment=require(_0x7d23('0x2'));var BPromise=require(_0x7d23('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d23('0x4'));var db=require(_0x7d23('0x5'))['db'];var utils=require(_0x7d23('0x6'));var logger=require(_0x7d23('0x7'))(_0x7d23('0x8'));var config=require(_0x7d23('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d23('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ca126,_0x48358f,_0xc43371){return new BPromise(function(_0x42c334,_0x6ce28d){return client[_0x7d23('0xb')](_0x5ca126,_0xc43371)[_0x7d23('0xc')](function(_0x23f1d6){logger[_0x7d23('0xd')](_0x7d23('0xe'),_0x48358f,'request\x20sent');logger[_0x7d23('0xf')](_0x7d23('0x10'),_0x48358f,_0x7d23('0x11'),JSON['stringify'](_0x23f1d6));if(_0x23f1d6[_0x7d23('0x12')]){if(_0x23f1d6['error'][_0x7d23('0x13')]===0x1f4){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x6ce28d(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}logger['error']('Automation,\x20%s,\x20%s',_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x42c334(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}else{logger['info'](_0x7d23('0xe'),_0x48358f,'request\x20sent');_0x42c334(_0x23f1d6[_0x7d23('0x15')]['message']);}})[_0x7d23('0x16')](function(_0x46a35b){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x46a35b);_0x6ce28d(_0x46a35b);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index be13e0d..d5b6d1a 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 _0xb024=['getConditions','/:id/actions','getActions','create','post','addConditions','addActions','put','/:id','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','show','isAuthenticated'];(function(_0x443eb1,_0x17c7bf){var _0x122dd5=function(_0x1a14f0){while(--_0x1a14f0){_0x443eb1['push'](_0x443eb1['shift']());}};_0x122dd5(++_0x17c7bf);}(_0xb024,0x1ad));var _0x4b02=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb024[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x4b02('0x0'));var path=require(_0x4b02('0x1'));var timeout=require(_0x4b02('0x2'));var express=require(_0x4b02('0x3'));var router=express[_0x4b02('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4b02('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4b02('0x6'));var controller=require('./automation.controller');router[_0x4b02('0x7')]('/',auth['isAuthenticated'](),controller[_0x4b02('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4b02('0x9')]);router[_0x4b02('0x7')]('/:id/conditions',auth[_0x4b02('0xa')](),controller[_0x4b02('0xb')]);router[_0x4b02('0x7')](_0x4b02('0xc'),auth[_0x4b02('0xa')](),controller[_0x4b02('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4b02('0xe')]);router[_0x4b02('0xf')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x4b02('0x10')]);router[_0x4b02('0xf')]('/:id/actions',auth[_0x4b02('0xa')](),controller[_0x4b02('0x11')]);router[_0x4b02('0x12')](_0x4b02('0x13'),auth[_0x4b02('0xa')](),controller['update']);router[_0x4b02('0x14')](_0x4b02('0x13'),auth['isAuthenticated'](),controller[_0x4b02('0x15')]);module['exports']=router; \ No newline at end of file +var _0x5455=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./automation.controller','get','/:id','show','isAuthenticated','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','destroy','exports','util'];(function(_0x5d1502,_0x4d4ba5){var _0x4ffad4=function(_0x2d4a19){while(--_0x2d4a19){_0x5d1502['push'](_0x5d1502['shift']());}};_0x4ffad4(++_0x4d4ba5);}(_0x5455,0x197));var _0x5545=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x5455[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require(_0x5545('0x0'));var path=require(_0x5545('0x1'));var timeout=require(_0x5545('0x2'));var express=require(_0x5545('0x3'));var router=express[_0x5545('0x4')]();var fs_extra=require(_0x5545('0x5'));var auth=require(_0x5545('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5545('0x7'));router[_0x5545('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5545('0x8')](_0x5545('0x9'),auth['isAuthenticated'](),controller[_0x5545('0xa')]);router[_0x5545('0x8')]('/:id/conditions',auth[_0x5545('0xb')](),controller[_0x5545('0xc')]);router[_0x5545('0x8')](_0x5545('0xd'),auth[_0x5545('0xb')](),controller[_0x5545('0xe')]);router[_0x5545('0xf')]('/',auth[_0x5545('0xb')](),controller[_0x5545('0x10')]);router['post']('/:id/conditions',auth[_0x5545('0xb')](),controller[_0x5545('0x11')]);router[_0x5545('0xf')](_0x5545('0xd'),auth['isAuthenticated'](),controller[_0x5545('0x12')]);router[_0x5545('0x13')]('/:id',auth[_0x5545('0xb')](),controller[_0x5545('0x14')]);router[_0x5545('0x15')](_0x5545('0x9'),auth['isAuthenticated'](),controller[_0x5545('0x16')]);module[_0x5545('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index eac3221..6154e03 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 _0xc482=['Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#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)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)'];(function(_0x23e3a6,_0x160687){var _0x3330c=function(_0x47fe6f){while(--_0x47fe6f){_0x23e3a6['push'](_0x23e3a6['shift']());}};_0x3330c(++_0x160687);}(_0xc482,0x96));var _0x2c48=function(_0x535251,_0x646da){_0x535251=_0x535251-0x0;var _0x43f6f9=_0xc482[_0x535251];return _0x43f6f9;};'use strict';var Sequelize=require(_0x2c48('0x0'));module[_0x2c48('0x1')]={'name':{'type':Sequelize[_0x2c48('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x2c48('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x2c48('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2c48('0x5')},'limitCalls':{'type':Sequelize[_0x2c48('0x6')](0x4)[_0x2c48('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x2c48('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x2c48('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2c48('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x2c48('0x6')](0x3)[_0x2c48('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2c48('0x6')](0x5)[_0x2c48('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2c48('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x2c48('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2c48('0xa')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2c48('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2c48('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x2c48('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2c48('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x2c48('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2c48('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2c48('0x2')],'defaultValue':_0x2c48('0xe')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x2c48('0xf'),'onlyIfOpen'),'defaultValue':_0x2c48('0x10')},'dialAMDActive':{'type':Sequelize[_0x2c48('0x11')],'defaultValue':0x0,'comment':_0x2c48('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x2c48('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2c48('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x2c48('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2c48('0x6')](0x9)[_0x2c48('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2c48('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2c48('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x2c48('0x6')](0x9)[_0x2c48('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2c48('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2c48('0x6')](0x9)[_0x2c48('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2c48('0x6')](0x9)[_0x2c48('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2c48('0x6')](0x5)[_0x2c48('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2c48('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x2c48('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2c48('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2c48('0x3')](_0x2c48('0x19'),_0x2c48('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x2c48('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2c48('0x6')](0x3)[_0x2c48('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2c48('0x1b')},'dialCutDigit':{'type':Sequelize[_0x2c48('0x6')](0x3)[_0x2c48('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2c48('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2c48('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2c48('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2c48('0x6')](0x5)[_0x2c48('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2c48('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x2c48('0x6')](0x3)[_0x2c48('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2c48('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2c48('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2c48('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2c48('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2c48('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2c48('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x2c48('0x6')](0x3)[_0x2c48('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2c48('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x2c48('0x6')](0x5)[_0x2c48('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2c48('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2c48('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2c48('0x6')](0x5)[_0x2c48('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2c48('0x24')}}; \ No newline at end of file +var _0xeef7=['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)','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','exports','name','ENUM','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','STRING','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\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)'];(function(_0x5ed21f,_0x24e6c6){var _0x18a335=function(_0x29dd35){while(--_0x29dd35){_0x5ed21f['push'](_0x5ed21f['shift']());}};_0x18a335(++_0x24e6c6);}(_0xeef7,0x7d));var _0x7eef=function(_0x758841,_0x29e9df){_0x758841=_0x758841-0x0;var _0x24e623=_0xeef7[_0x758841];return _0x24e623;};'use strict';var Sequelize=require(_0x7eef('0x0'));module[_0x7eef('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7eef('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7eef('0x3')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x7eef('0x4')],'defaultValue':0x0,'comment':_0x7eef('0x5')},'limitCalls':{'type':Sequelize[_0x7eef('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7eef('0x7')]},'dialOriginateTimeout':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7eef('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7eef('0x6')](0x5)[_0x7eef('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7eef('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7eef('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7eef('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7eef('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'defaultValue':0x3,'comment':_0x7eef('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7eef('0x6')](0x5)[_0x7eef('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7eef('0xe')},'dialTimezone':{'type':Sequelize[_0x7eef('0x7')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x7eef('0x3')](_0x7eef('0xf'),_0x7eef('0x10'),_0x7eef('0x11')),'defaultValue':_0x7eef('0xf')},'dialAMDActive':{'type':Sequelize[_0x7eef('0x4')],'defaultValue':0x0,'comment':_0x7eef('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x7eef('0x6')](0x9)[_0x7eef('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7eef('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x7eef('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7eef('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7eef('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7eef('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7eef('0x6')](0x9)[_0x7eef('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7eef('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x7eef('0x6')](0x9)[_0x7eef('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7eef('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7eef('0x6')](0x9)[_0x7eef('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7eef('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7eef('0x6')](0x9)[_0x7eef('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7eef('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7eef('0x6')](0x5)[_0x7eef('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7eef('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7eef('0x6')](0x9)[_0x7eef('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x7eef('0x3')]('DESC','ASC'),'defaultValue':_0x7eef('0x1b')},'dialPrefix':{'type':Sequelize[_0x7eef('0x7')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7eef('0x1c')},'dialCutDigit':{'type':Sequelize[_0x7eef('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7eef('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7eef('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7eef('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7eef('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7eef('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x7eef('0x6')](0x5)[_0x7eef('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7eef('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7eef('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7eef('0x6')](0x5)[_0x7eef('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)[_0x7eef('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x7eef('0x6')](0x5)[_0x7eef('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7eef('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7eef('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7eef('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7eef('0x6')](0x5)[_0x7eef('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7eef('0x25')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 4dd73cd..d227e86 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 _0xa30e=['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','get','IvrCampaigns','error','stack','name','index','map','Campaign','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','include','findAll','rows','catch','show','rawAttributes','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','omit','user','UserProfileResource','getHoppers','findOne','CmHopper','pick','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','NOW()','ListId\x20=\x20?','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa30e,0x117));var _0xea30=function(_0x2cdcf9,_0x8a09d1){_0x2cdcf9=_0x2cdcf9-0x0;var _0x39412d=_0xa30e[_0x2cdcf9];return _0x39412d;};'use strict';var emlformat=require(_0xea30('0x0'));var rimraf=require(_0xea30('0x1'));var zipdir=require(_0xea30('0x2'));var jsonpatch=require(_0xea30('0x3'));var rp=require(_0xea30('0x4'));var moment=require(_0xea30('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xea30('0x6'));var sox=require(_0xea30('0x7'));var csv=require(_0xea30('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea30('0x9'));var _=require(_0xea30('0xa'));var squel=require(_0xea30('0xb'));var crypto=require(_0xea30('0xc'));var jsforce=require(_0xea30('0xd'));var deskjs=require(_0xea30('0xe'));var toCsv=require(_0xea30('0x8'));var querystring=require(_0xea30('0xf'));var Papa=require(_0xea30('0x10'));var Redis=require(_0xea30('0x11'));var authService=require(_0xea30('0x12'));var qs=require(_0xea30('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xea30('0x14'))(_0xea30('0x15'));var utils=require(_0xea30('0x16'));var config=require(_0xea30('0x17'));var licenseUtil=require(_0xea30('0x18'));var db=require(_0xea30('0x19'))['db'];function respondWithStatusCode(_0x13fb06,_0x26fe96){_0x26fe96=_0x26fe96||0xcc;return function(_0x348aad){if(_0x348aad){return _0x13fb06[_0xea30('0x1a')](_0x26fe96);}return _0x13fb06[_0xea30('0x1b')](_0x26fe96)[_0xea30('0x1c')]();};}function respondWithResult(_0x3a15fc,_0x597009){_0x597009=_0x597009||0xc8;return function(_0x2b0add){if(_0x2b0add){return _0x3a15fc[_0xea30('0x1b')](_0x597009)[_0xea30('0x1d')](_0x2b0add);}};}function respondWithFilteredResult(_0x54235a,_0x27e663){return function(_0x4151a6){if(_0x4151a6){var _0x1e2c8f=typeof _0x27e663[_0xea30('0x1e')]===_0xea30('0x1f')&&typeof _0x27e663[_0xea30('0x20')]===_0xea30('0x1f');var _0x598d66=_0x4151a6[_0xea30('0x21')];var _0x2e7504=_0x1e2c8f?0x0:_0x27e663[_0xea30('0x1e')];var _0x225bb7=_0x1e2c8f?_0x4151a6[_0xea30('0x21')]:_0x27e663[_0xea30('0x1e')]+_0x27e663['limit'];var _0x25eaad;if(_0x225bb7>=_0x598d66){_0x225bb7=_0x598d66;_0x25eaad=0xc8;}else{_0x25eaad=0xce;}_0x54235a[_0xea30('0x1b')](_0x25eaad);return _0x54235a[_0xea30('0x22')](_0xea30('0x23'),_0x2e7504+'-'+_0x225bb7+'/'+_0x598d66)[_0xea30('0x1d')](_0x4151a6);}return null;};}function patchUpdates(_0x2c3cc0){return function(_0x21dd56){try{jsonpatch[_0xea30('0x24')](_0x21dd56,_0x2c3cc0,!![]);}catch(_0x5b4fd7){return BPromise[_0xea30('0x25')](_0x5b4fd7);}return _0x21dd56['save']();};}function saveUpdates(_0x54d817,_0x50951f){return function(_0x2f95e8){if(_0x2f95e8){return _0x2f95e8[_0xea30('0x26')](_0x54d817)[_0xea30('0x27')](function(_0x4345e0){return _0x4345e0;});}return null;};}function removeEntity(_0x23fc0f,_0x527a28){return function(_0x74ceb1){if(_0x74ceb1){return _0x74ceb1[_0xea30('0x28')]()[_0xea30('0x27')](function(){var _0x2b7805=_0x74ceb1[_0xea30('0x29')]({'plain':!![]});var _0x4092a8=_0xea30('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x4092a8,'resourceId':_0x2b7805['id']}})[_0xea30('0x27')](function(){return _0x74ceb1;});})[_0xea30('0x27')](function(){_0x23fc0f[_0xea30('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x203554,_0x3c70dd){return function(_0x2b5b4c){if(!_0x2b5b4c){_0x203554[_0xea30('0x1a')](0x194);}return _0x2b5b4c;};}function handleError(_0x4a256e,_0x593e71){_0x593e71=_0x593e71||0x1f4;return function(_0x32d2f3){logger[_0xea30('0x2b')](_0x32d2f3[_0xea30('0x2c')]);if(_0x32d2f3[_0xea30('0x2d')]){delete _0x32d2f3[_0xea30('0x2d')];}_0x4a256e[_0xea30('0x1b')](_0x593e71)['send'](_0x32d2f3);};}exports[_0xea30('0x2e')]=function(_0xdcf47e,_0x35292c){var _0x2e957a={},_0x43de29={},_0x143f53={'count':0x0,'rows':[]};var _0x2b3396=_[_0xea30('0x2f')](db[_0xea30('0x30')]['rawAttributes'],function(_0x594168){return{'name':_0x594168[_0xea30('0x31')],'type':_0x594168[_0xea30('0x32')]['key']};});_0x43de29['model']=_[_0xea30('0x2f')](_0x2b3396,_0xea30('0x2d'));_0x43de29[_0xea30('0x33')]=_[_0xea30('0x34')](_0xdcf47e[_0xea30('0x33')]);_0x43de29['filters']=_[_0xea30('0x35')](_0x43de29[_0xea30('0x36')],_0x43de29[_0xea30('0x33')]);_0x2e957a[_0xea30('0x37')]=_[_0xea30('0x35')](_0x43de29['model'],qs['fields'](_0xdcf47e[_0xea30('0x33')][_0xea30('0x38')]));_0x2e957a[_0xea30('0x37')]=_0x2e957a[_0xea30('0x37')][_0xea30('0x39')]?_0x2e957a[_0xea30('0x37')]:_0x43de29[_0xea30('0x36')];if(!_0xdcf47e[_0xea30('0x33')][_0xea30('0x3a')](_0xea30('0x3b'))){_0x2e957a[_0xea30('0x20')]=qs[_0xea30('0x20')](_0xdcf47e['query'][_0xea30('0x20')]);_0x2e957a[_0xea30('0x1e')]=qs[_0xea30('0x1e')](_0xdcf47e['query']['offset']);}_0x2e957a[_0xea30('0x3c')]=qs[_0xea30('0x3d')](_0xdcf47e[_0xea30('0x33')][_0xea30('0x3d')]);_0x2e957a[_0xea30('0x3e')]=qs[_0xea30('0x3f')](_['pick'](_0xdcf47e['query'],_0x43de29[_0xea30('0x3f')]),_0x2b3396);if(_0xdcf47e[_0xea30('0x33')]['filter']){_0x2e957a[_0xea30('0x3e')]=_[_0xea30('0x40')](_0x2e957a[_0xea30('0x3e')],{'$or':_['map'](_0x2b3396,function(_0x2e4802){if(_0x2e4802[_0xea30('0x32')]!==_0xea30('0x41')){var _0x1dbd4e={};_0x1dbd4e[_0x2e4802[_0xea30('0x2d')]]={'$like':'%'+_0xdcf47e[_0xea30('0x33')][_0xea30('0x42')]+'%'};return _0x1dbd4e;}})});}_0x2e957a=_[_0xea30('0x40')]({},_0x2e957a,_0xdcf47e['options']);var _0x37a2de={'where':_0x2e957a[_0xea30('0x3e')]};return db[_0xea30('0x30')][_0xea30('0x21')](_0x37a2de)['then'](function(_0x4e2f17){_0x143f53[_0xea30('0x21')]=_0x4e2f17;if(_0xdcf47e[_0xea30('0x33')]['includeAll']){_0x2e957a[_0xea30('0x43')]=[{'all':!![]}];}return db[_0xea30('0x30')][_0xea30('0x44')](_0x2e957a);})[_0xea30('0x27')](function(_0x14a530){_0x143f53[_0xea30('0x45')]=_0x14a530;return _0x143f53;})[_0xea30('0x27')](respondWithFilteredResult(_0x35292c,_0x2e957a))[_0xea30('0x46')](handleError(_0x35292c,null));};exports[_0xea30('0x47')]=function(_0x4ecdef,_0x52e533){var _0x331ccb={'raw':![],'where':{'id':_0x4ecdef['params']['id']}},_0x3e058c={};_0x3e058c[_0xea30('0x36')]=_[_0xea30('0x34')](db[_0xea30('0x30')][_0xea30('0x48')]);_0x3e058c[_0xea30('0x33')]=_[_0xea30('0x34')](_0x4ecdef[_0xea30('0x33')]);_0x3e058c[_0xea30('0x3f')]=_[_0xea30('0x35')](_0x3e058c[_0xea30('0x36')],_0x3e058c[_0xea30('0x33')]);_0x331ccb[_0xea30('0x37')]=_[_0xea30('0x35')](_0x3e058c[_0xea30('0x36')],qs['fields'](_0x4ecdef[_0xea30('0x33')]['fields']));_0x331ccb['attributes']=_0x331ccb[_0xea30('0x37')]['length']?_0x331ccb['attributes']:_0x3e058c[_0xea30('0x36')];if(_0x4ecdef['query'][_0xea30('0x49')]){_0x331ccb[_0xea30('0x43')]=[{'all':!![]}];}_0x331ccb=_[_0xea30('0x40')]({},_0x331ccb,_0x4ecdef[_0xea30('0x4a')]);return db['Campaign'][_0xea30('0x4b')](_0x331ccb)[_0xea30('0x27')](handleEntityNotFound(_0x52e533,null))[_0xea30('0x27')](respondWithResult(_0x52e533,null))[_0xea30('0x46')](handleError(_0x52e533,null));};exports[_0xea30('0x4c')]=function(_0x1c5daf,_0x3bdc06){return db[_0xea30('0x30')][_0xea30('0x4c')](_0x1c5daf[_0xea30('0x4d')],{})[_0xea30('0x27')](function(_0x3757e3){var _0x5266de=_0x1c5daf['user'][_0xea30('0x29')]({'plain':!![]});if(!_0x5266de)throw new Error(_0xea30('0x4e'));if(_0x5266de[_0xea30('0x4f')]==='user'){var _0x1f1e57=_0x3757e3[_0xea30('0x29')]({'plain':!![]});var _0x28b582=_0xea30('0x2a');return db[_0xea30('0x50')][_0xea30('0x4b')]({'where':{'name':_0x28b582,'userProfileId':_0x5266de[_0xea30('0x51')]},'raw':!![]})[_0xea30('0x27')](function(_0x2a9868){if(_0x2a9868&&_0x2a9868[_0xea30('0x52')]===0x0){return db['UserProfileResource'][_0xea30('0x4c')]({'name':_0x1f1e57['name'],'resourceId':_0x1f1e57['id'],'type':_0x2a9868[_0xea30('0x2d')],'sectionId':_0x2a9868['id']},{})[_0xea30('0x27')](function(){return _0x3757e3;});}else{return _0x3757e3;}})['catch'](function(_0x20dce6){logger[_0xea30('0x2b')](_0xea30('0x53'),_0x20dce6);throw _0x20dce6;});}return _0x3757e3;})['then'](respondWithResult(_0x3bdc06,0xc9))[_0xea30('0x46')](handleError(_0x3bdc06,null));};exports[_0xea30('0x54')]=function(_0x5183e5,_0x2ad5b8){var _0x2a4bfb={'where':{'id':_0x5183e5[_0xea30('0x55')]['id']}},_0x35300b={};_0x35300b['model']=_[_0xea30('0x34')](db[_0xea30('0x30')]['rawAttributes']);_0x2a4bfb['attributes']=_['intersection'](_0x35300b[_0xea30('0x36')],qs[_0xea30('0x38')](_0x5183e5['query'][_0xea30('0x38')]));_0x2a4bfb[_0xea30('0x37')]=_0x2a4bfb[_0xea30('0x37')]['length']?_0x2a4bfb[_0xea30('0x37')]:_0x35300b[_0xea30('0x36')];if(_0x5183e5[_0xea30('0x33')][_0xea30('0x49')]){_0x2a4bfb['include']=[{'all':!![]}];}_0x2a4bfb=_['merge']({},_0x2a4bfb,_0x5183e5[_0xea30('0x4a')]);return db['Campaign'][_0xea30('0x4b')](_0x2a4bfb)[_0xea30('0x27')](handleEntityNotFound(_0x2ad5b8,null))['then'](function(_0x9fdc7e){if(_0x9fdc7e){var _0x32e5bb=_0x9fdc7e[_0xea30('0x29')]({'plain':!![]});_0x32e5bb=qs['omit'](_0x32e5bb,['id',_0xea30('0x56'),_0xea30('0x57')]);_0x5183e5[_0xea30('0x4d')]=_[_0xea30('0x58')](_0x5183e5[_0xea30('0x4d')],['id','createdAt',_0xea30('0x57')]);return db['Campaign'][_0xea30('0x4c')](_[_0xea30('0x40')](_0x32e5bb,_0x5183e5['body']),{'include':_0x5183e5[_0xea30('0x33')][_0xea30('0x49')]?[{'all':!![]}]:undefined})[_0xea30('0x27')](function(_0x4ea130){var _0x474180=_0x5183e5[_0xea30('0x59')][_0xea30('0x29')]({'plain':!![]});if(!_0x474180)throw new Error(_0xea30('0x4e'));if(_0x474180[_0xea30('0x4f')]==='user'){var _0xfedf04=_0x4ea130[_0xea30('0x29')]({'plain':!![]});var _0xe72409=_0xea30('0x2a');return db[_0xea30('0x50')][_0xea30('0x4b')]({'where':{'name':_0xe72409,'userProfileId':_0x474180[_0xea30('0x51')]},'raw':!![]})[_0xea30('0x27')](function(_0x24e6ec){if(_0x24e6ec&&_0x24e6ec[_0xea30('0x52')]===0x0){return db[_0xea30('0x5a')][_0xea30('0x4c')]({'name':_0xfedf04[_0xea30('0x2d')],'resourceId':_0xfedf04['id'],'type':_0x24e6ec['name'],'sectionId':_0x24e6ec['id']},{})[_0xea30('0x27')](function(){return _0x4ea130;});}else{return _0x4ea130;}})[_0xea30('0x46')](function(_0x1e3e0b){logger[_0xea30('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e3e0b);throw _0x1e3e0b;});}return _0x4ea130;});}})[_0xea30('0x27')](respondWithResult(_0x2ad5b8,0xc9))['catch'](handleError(_0x2ad5b8,null));};exports[_0xea30('0x26')]=function(_0x41cc6c,_0x1fa9f3){if(_0x41cc6c[_0xea30('0x4d')]['id']){delete _0x41cc6c['body']['id'];}return db[_0xea30('0x30')][_0xea30('0x4b')]({'where':{'id':_0x41cc6c[_0xea30('0x55')]['id']}})['then'](handleEntityNotFound(_0x1fa9f3,null))['then'](saveUpdates(_0x41cc6c[_0xea30('0x4d')],null))['then'](respondWithResult(_0x1fa9f3,null))[_0xea30('0x46')](handleError(_0x1fa9f3,null));};exports[_0xea30('0x28')]=function(_0xfc3c94,_0x43d622){return db[_0xea30('0x30')]['find']({'where':{'id':_0xfc3c94[_0xea30('0x55')]['id']}})[_0xea30('0x27')](handleEntityNotFound(_0x43d622,null))[_0xea30('0x27')](removeEntity(_0x43d622,null))[_0xea30('0x46')](handleError(_0x43d622,null));};exports[_0xea30('0x5b')]=function(_0x4a35b9,_0x52df2c,_0x29ceb8){var _0x573c30={'raw':!![],'where':{}};var _0x49ce5a={};var _0x3ce8ac={'count':0x0,'rows':[]};return db[_0xea30('0x30')][_0xea30('0x5c')]({'where':{'id':_0x4a35b9[_0xea30('0x55')]['id']}})[_0xea30('0x27')](handleEntityNotFound(_0x52df2c,null))['then'](function(_0x40e1c7){if(_0x40e1c7){_0x49ce5a['model']=_[_0xea30('0x34')](db[_0xea30('0x5d')][_0xea30('0x48')]);_0x49ce5a[_0xea30('0x33')]=_[_0xea30('0x34')](_0x4a35b9[_0xea30('0x33')]);_0x49ce5a[_0xea30('0x3f')]=_[_0xea30('0x35')](_0x49ce5a[_0xea30('0x36')],_0x49ce5a['query']);_0x573c30[_0xea30('0x37')]=_[_0xea30('0x35')](_0x49ce5a[_0xea30('0x36')],qs['fields'](_0x4a35b9['query'][_0xea30('0x38')]));_0x573c30[_0xea30('0x37')]=_0x573c30['attributes']['length']?_0x573c30[_0xea30('0x37')]:_0x49ce5a[_0xea30('0x36')];if(!_0x4a35b9[_0xea30('0x33')]['hasOwnProperty']('nolimit')){_0x573c30[_0xea30('0x20')]=qs[_0xea30('0x20')](_0x4a35b9[_0xea30('0x33')]['limit']);_0x573c30['offset']=qs[_0xea30('0x1e')](_0x4a35b9['query'][_0xea30('0x1e')]);}_0x573c30['order']=qs[_0xea30('0x3d')](_0x4a35b9[_0xea30('0x33')][_0xea30('0x3d')]);_0x573c30[_0xea30('0x3e')]=qs[_0xea30('0x3f')](_[_0xea30('0x5e')](_0x4a35b9[_0xea30('0x33')],_0x49ce5a['filters']));_0x573c30[_0xea30('0x3e')][_0xea30('0x5f')]=_0x40e1c7['id'];if(_0x4a35b9['query'][_0xea30('0x42')]){_0x573c30[_0xea30('0x3e')]=_[_0xea30('0x40')](_0x573c30[_0xea30('0x3e')],{'$or':_[_0xea30('0x2f')](_0x573c30[_0xea30('0x37')],function(_0x1d5b86){var _0x5ba113={};_0x5ba113[_0x1d5b86]={'$like':'%'+_0x4a35b9[_0xea30('0x33')][_0xea30('0x42')]+'%'};return _0x5ba113;})});}_0x573c30=_[_0xea30('0x40')]({},_0x573c30,_0x4a35b9[_0xea30('0x4a')]);return db[_0xea30('0x5d')][_0xea30('0x21')]({'where':_0x573c30[_0xea30('0x3e')]})[_0xea30('0x27')](function(_0x39bdaf){_0x3ce8ac[_0xea30('0x21')]=_0x39bdaf;if(_0x4a35b9['query']['includeAll']){_0x573c30['include']=[{'all':!![]}];}return db[_0xea30('0x5d')]['findAll'](_0x573c30);})['then'](function(_0x11ce38){_0x3ce8ac[_0xea30('0x45')]=_0x11ce38;return _0x3ce8ac;});}})[_0xea30('0x27')](respondWithFilteredResult(_0x52df2c,_0x573c30))['catch'](handleError(_0x52df2c,null));};exports[_0xea30('0x60')]=function(_0x165f33,_0x48b03f,_0x392549){var _0x285d43={'raw':!![],'where':{}};var _0x54542a={};var _0x462b3f={'count':0x0,'rows':[]};return db[_0xea30('0x30')][_0xea30('0x5c')]({'where':{'id':_0x165f33[_0xea30('0x55')]['id']}})['then'](handleEntityNotFound(_0x48b03f,null))['then'](function(_0x186ed0){if(_0x186ed0){_0x54542a['model']=_[_0xea30('0x34')](db['CmHopperHistory'][_0xea30('0x48')]);_0x54542a[_0xea30('0x33')]=_[_0xea30('0x34')](_0x165f33[_0xea30('0x33')]);_0x54542a['filters']=_['intersection'](_0x54542a[_0xea30('0x36')],_0x54542a[_0xea30('0x33')]);_0x285d43[_0xea30('0x37')]=_[_0xea30('0x35')](_0x54542a['model'],qs[_0xea30('0x38')](_0x165f33[_0xea30('0x33')][_0xea30('0x38')]));_0x285d43[_0xea30('0x37')]=_0x285d43[_0xea30('0x37')][_0xea30('0x39')]?_0x285d43[_0xea30('0x37')]:_0x54542a[_0xea30('0x36')];if(!_0x165f33[_0xea30('0x33')]['hasOwnProperty'](_0xea30('0x3b'))){_0x285d43[_0xea30('0x20')]=qs['limit'](_0x165f33['query'][_0xea30('0x20')]);_0x285d43[_0xea30('0x1e')]=qs[_0xea30('0x1e')](_0x165f33[_0xea30('0x33')][_0xea30('0x1e')]);}_0x285d43[_0xea30('0x3c')]=qs['sort'](_0x165f33[_0xea30('0x33')][_0xea30('0x3d')]);_0x285d43[_0xea30('0x3e')]=qs[_0xea30('0x3f')](_[_0xea30('0x5e')](_0x165f33[_0xea30('0x33')],_0x54542a[_0xea30('0x3f')]));_0x285d43[_0xea30('0x3e')][_0xea30('0x5f')]=_0x186ed0['id'];if(_0x165f33[_0xea30('0x33')][_0xea30('0x42')]){_0x285d43[_0xea30('0x3e')]=_[_0xea30('0x40')](_0x285d43[_0xea30('0x3e')],{'$or':_[_0xea30('0x2f')](_0x285d43[_0xea30('0x37')],function(_0x5a2b9c){var _0x5cb674={};_0x5cb674[_0x5a2b9c]={'$like':'%'+_0x165f33['query'][_0xea30('0x42')]+'%'};return _0x5cb674;})});}_0x285d43=_['merge']({},_0x285d43,_0x165f33[_0xea30('0x4a')]);return db[_0xea30('0x61')][_0xea30('0x21')]({'where':_0x285d43[_0xea30('0x3e')]})['then'](function(_0x2bd215){_0x462b3f[_0xea30('0x21')]=_0x2bd215;if(_0x165f33[_0xea30('0x33')][_0xea30('0x49')]){_0x285d43[_0xea30('0x43')]=[{'all':!![]}];}return db[_0xea30('0x61')][_0xea30('0x44')](_0x285d43);})[_0xea30('0x27')](function(_0x45c21a){_0x462b3f[_0xea30('0x45')]=_0x45c21a;return _0x462b3f;});}})[_0xea30('0x27')](respondWithFilteredResult(_0x48b03f,_0x285d43))[_0xea30('0x46')](handleError(_0x48b03f,null));};exports['getHopperFinals']=function(_0x165734,_0x1e02a3,_0x1f876a){var _0x546310={'raw':!![],'where':{}};var _0x2c11cd={};var _0x106b77={'count':0x0,'rows':[]};return db[_0xea30('0x30')][_0xea30('0x5c')]({'where':{'id':_0x165734[_0xea30('0x55')]['id']}})[_0xea30('0x27')](handleEntityNotFound(_0x1e02a3,null))['then'](function(_0x3ed3c3){if(_0x3ed3c3){_0x2c11cd['model']=_[_0xea30('0x34')](db[_0xea30('0x62')][_0xea30('0x48')]);_0x2c11cd['query']=_[_0xea30('0x34')](_0x165734['query']);_0x2c11cd[_0xea30('0x3f')]=_[_0xea30('0x35')](_0x2c11cd[_0xea30('0x36')],_0x2c11cd[_0xea30('0x33')]);_0x546310[_0xea30('0x37')]=_[_0xea30('0x35')](_0x2c11cd['model'],qs['fields'](_0x165734['query'][_0xea30('0x38')]));_0x546310[_0xea30('0x37')]=_0x546310[_0xea30('0x37')]['length']?_0x546310[_0xea30('0x37')]:_0x2c11cd[_0xea30('0x36')];if(!_0x165734[_0xea30('0x33')][_0xea30('0x3a')]('nolimit')){_0x546310[_0xea30('0x20')]=qs[_0xea30('0x20')](_0x165734['query'][_0xea30('0x20')]);_0x546310[_0xea30('0x1e')]=qs[_0xea30('0x1e')](_0x165734['query'][_0xea30('0x1e')]);}_0x546310[_0xea30('0x3c')]=qs[_0xea30('0x3d')](_0x165734['query'][_0xea30('0x3d')]);_0x546310[_0xea30('0x3e')]=qs[_0xea30('0x3f')](_['pick'](_0x165734['query'],_0x2c11cd[_0xea30('0x3f')]));_0x546310['where']['CampaignId']=_0x3ed3c3['id'];if(_0x165734[_0xea30('0x33')]['filter']){_0x546310['where']=_[_0xea30('0x40')](_0x546310[_0xea30('0x3e')],{'$or':_[_0xea30('0x2f')](_0x546310[_0xea30('0x37')],function(_0x124d4f){var _0x525a63={};_0x525a63[_0x124d4f]={'$like':'%'+_0x165734[_0xea30('0x33')][_0xea30('0x42')]+'%'};return _0x525a63;})});}_0x546310=_[_0xea30('0x40')]({},_0x546310,_0x165734[_0xea30('0x4a')]);return db['CmHopperFinal'][_0xea30('0x21')]({'where':_0x546310['where']})[_0xea30('0x27')](function(_0x23a939){_0x106b77['count']=_0x23a939;if(_0x165734[_0xea30('0x33')][_0xea30('0x49')]){_0x546310['include']=[{'all':!![]}];}return db[_0xea30('0x62')][_0xea30('0x44')](_0x546310);})['then'](function(_0xd1c51c){_0x106b77[_0xea30('0x45')]=_0xd1c51c;return _0x106b77;});}})[_0xea30('0x27')](respondWithFilteredResult(_0x1e02a3,_0x546310))[_0xea30('0x46')](handleError(_0x1e02a3,null));};exports[_0xea30('0x63')]=function(_0x3e3e8a,_0x3904e5,_0x22e372){var _0xef3dc6={'raw':!![],'where':{}};var _0x286450={};var _0x4fb17b={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3e3e8a['params']['id']}})['then'](handleEntityNotFound(_0x3904e5,null))[_0xea30('0x27')](function(_0xb8af39){if(_0xb8af39){_0x286450['model']=_[_0xea30('0x34')](db[_0xea30('0x64')][_0xea30('0x48')]);_0x286450[_0xea30('0x33')]=_['keys'](_0x3e3e8a[_0xea30('0x33')]);_0x286450['filters']=_['intersection'](_0x286450[_0xea30('0x36')],_0x286450[_0xea30('0x33')]);_0xef3dc6[_0xea30('0x37')]=_[_0xea30('0x35')](_0x286450[_0xea30('0x36')],qs[_0xea30('0x38')](_0x3e3e8a[_0xea30('0x33')][_0xea30('0x38')]));_0xef3dc6[_0xea30('0x37')]=_0xef3dc6[_0xea30('0x37')][_0xea30('0x39')]?_0xef3dc6[_0xea30('0x37')]:_0x286450[_0xea30('0x36')];if(!_0x3e3e8a[_0xea30('0x33')]['hasOwnProperty'](_0xea30('0x3b'))){_0xef3dc6['limit']=qs['limit'](_0x3e3e8a[_0xea30('0x33')]['limit']);_0xef3dc6['offset']=qs[_0xea30('0x1e')](_0x3e3e8a[_0xea30('0x33')]['offset']);}_0xef3dc6[_0xea30('0x3c')]=qs[_0xea30('0x3d')](_0x3e3e8a[_0xea30('0x33')][_0xea30('0x3d')]);_0xef3dc6[_0xea30('0x3e')]=qs[_0xea30('0x3f')](_[_0xea30('0x5e')](_0x3e3e8a[_0xea30('0x33')],_0x286450[_0xea30('0x3f')]));_0xef3dc6[_0xea30('0x3e')][_0xea30('0x5f')]=_0xb8af39['id'];if(_0x3e3e8a['query']['filter']){_0xef3dc6[_0xea30('0x3e')]=_[_0xea30('0x40')](_0xef3dc6['where'],{'$or':_['map'](_0xef3dc6[_0xea30('0x37')],function(_0xca83e0){var _0x34a092={};_0x34a092[_0xca83e0]={'$like':'%'+_0x3e3e8a[_0xea30('0x33')][_0xea30('0x42')]+'%'};return _0x34a092;})});}_0xef3dc6=_['merge']({},_0xef3dc6,_0x3e3e8a[_0xea30('0x4a')]);return db[_0xea30('0x64')][_0xea30('0x21')]({'where':_0xef3dc6[_0xea30('0x3e')]})[_0xea30('0x27')](function(_0x24de70){_0x4fb17b['count']=_0x24de70;if(_0x3e3e8a[_0xea30('0x33')]['includeAll']){_0xef3dc6['include']=[{'all':!![]}];}return db[_0xea30('0x64')]['findAll'](_0xef3dc6);})[_0xea30('0x27')](function(_0x4f9f81){_0x4fb17b[_0xea30('0x45')]=_0x4f9f81;return _0x4fb17b;});}})[_0xea30('0x27')](respondWithFilteredResult(_0x3904e5,_0xef3dc6))[_0xea30('0x46')](handleError(_0x3904e5,null));};exports['getLists']=function(_0x35f181,_0x1e3342,_0x59d726){var _0x1f56e3={};var _0x20b402={};var _0x3c1ab0;var _0x3e9ce8;return db[_0xea30('0x30')][_0xea30('0x5c')]({'where':{'id':_0x35f181[_0xea30('0x55')]['id']}})[_0xea30('0x27')](handleEntityNotFound(_0x1e3342,null))[_0xea30('0x27')](function(_0x3101ae){if(_0x3101ae){_0x3c1ab0=_0x3101ae;_0x20b402[_0xea30('0x36')]=_[_0xea30('0x34')](db[_0xea30('0x65')][_0xea30('0x48')]);_0x20b402[_0xea30('0x33')]=_[_0xea30('0x34')](_0x35f181['query']);_0x20b402[_0xea30('0x3f')]=_[_0xea30('0x35')](_0x20b402[_0xea30('0x36')],_0x20b402[_0xea30('0x33')]);_0x1f56e3[_0xea30('0x37')]=_['intersection'](_0x20b402[_0xea30('0x36')],qs[_0xea30('0x38')](_0x35f181['query'][_0xea30('0x38')]));_0x1f56e3[_0xea30('0x37')]=_0x1f56e3[_0xea30('0x37')]['length']?_0x1f56e3[_0xea30('0x37')]:_0x20b402[_0xea30('0x36')];_0x1f56e3['order']=qs[_0xea30('0x3d')](_0x35f181[_0xea30('0x33')][_0xea30('0x3d')]);_0x1f56e3['where']=qs[_0xea30('0x3f')](_[_0xea30('0x5e')](_0x35f181[_0xea30('0x33')],_0x20b402[_0xea30('0x3f')]));if(_0x35f181[_0xea30('0x33')][_0xea30('0x42')]){_0x1f56e3[_0xea30('0x3e')]=_[_0xea30('0x40')](_0x1f56e3[_0xea30('0x3e')],{'$or':_[_0xea30('0x2f')](_0x1f56e3['attributes'],function(_0x47b973){var _0x292dec={};_0x292dec[_0x47b973]={'$like':'%'+_0x35f181['query'][_0xea30('0x42')]+'%'};return _0x292dec;})});}_0x1f56e3=_[_0xea30('0x40')]({},_0x1f56e3,_0x35f181[_0xea30('0x4a')]);return _0x3c1ab0[_0xea30('0x66')](_0x1f56e3);}})['then'](function(_0x32e19b){if(_0x32e19b){_0x3e9ce8=_0x32e19b[_0xea30('0x39')];if(!_0x35f181[_0xea30('0x33')][_0xea30('0x3a')]('nolimit')){_0x1f56e3[_0xea30('0x20')]=qs[_0xea30('0x20')](_0x35f181[_0xea30('0x33')][_0xea30('0x20')]);_0x1f56e3[_0xea30('0x1e')]=qs[_0xea30('0x1e')](_0x35f181[_0xea30('0x33')][_0xea30('0x1e')]);}return _0x3c1ab0[_0xea30('0x66')](_0x1f56e3);}})[_0xea30('0x27')](function(_0x4533dd){if(_0x4533dd){return _0x4533dd?{'count':_0x3e9ce8,'rows':_0x4533dd}:null;}})[_0xea30('0x27')](respondWithResult(_0x1e3342,null))['catch'](handleError(_0x1e3342,null));};exports[_0xea30('0x67')]=function(_0x1d5f40,_0x1fc94b,_0x2ec151){var _0x93cf67,_0x4f84cc;var _0x4c7cca=[];var _0x2e0473=moment()[_0xea30('0x68')](_0xea30('0x69'));return db[_0xea30('0x30')][_0xea30('0x4b')]({'where':{'id':_0x1d5f40[_0xea30('0x55')]['id']}})[_0xea30('0x27')](handleEntityNotFound(_0x1fc94b,null))[_0xea30('0x27')](function(_0x2965df){if(_0x2965df){_0x4f84cc=_0x2965df;return _0x2965df[_0xea30('0x67')](_0x1d5f40[_0xea30('0x4d')][_0xea30('0x6a')],_[_0xea30('0x58')](_0x1d5f40[_0xea30('0x4d')],[_0xea30('0x6a'),'id'])||{});}return null;})[_0xea30('0x6b')](function(_0xbb9d60){var _0x5038d2;var _0x28b878;_0x93cf67=_0xbb9d60||[];var _0x420aac=[];if(_0xbb9d60){for(var _0x26e165=0x0;_0x26e165<_0xbb9d60[_0xea30('0x39')];_0x26e165+=0x1){var _0x4fd6ed=_0xbb9d60[_0x26e165]['get']({'plain':!![]});_0x4f84cc[_0xea30('0x6c')]=_0x1d5f40[_0xea30('0x4d')][_0xea30('0x6c')]?_0x1d5f40['body'][_0xea30('0x6c')]:_0x4f84cc['dialCheckDuplicateType'];switch(_0x4f84cc[_0xea30('0x6c')]){case _0xea30('0x6d'):_0x5038d2=squel[_0xea30('0x6e')]()[_0xea30('0x6f')](_0xea30('0x70'))[_0xea30('0x71')]([_0xea30('0x72'),_0xea30('0x73'),_0xea30('0x74'),_0xea30('0x75'),_0xea30('0x5f'),_0xea30('0x56'),_0xea30('0x57')],squel['select']()['field'](_0xea30('0x72'),_0xea30('0x72'))[_0xea30('0x76')]('NOW()',_0xea30('0x73'))[_0xea30('0x76')]('id',_0xea30('0x74'))['field'](_0x4fd6ed[_0xea30('0x77')][_0xea30('0x78')](),_0xea30('0x75'))[_0xea30('0x76')](_0x1d5f40[_0xea30('0x55')]['id'][_0xea30('0x78')](),_0xea30('0x5f'))['field']('\x27'+_0x2e0473+'\x27',_0xea30('0x56'))[_0xea30('0x76')]('\x27'+_0x2e0473+'\x27',_0xea30('0x57'))[_0xea30('0x79')](_0xea30('0x7a'))[_0xea30('0x3e')](_0xea30('0x7b'))[_0xea30('0x3e')]('ListId\x20=\x20?',_0x4fd6ed[_0xea30('0x77')][_0xea30('0x78')]())[_0xea30('0x3e')](_0xea30('0x7c'))[_0xea30('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0xea30('0x7d')]()['field'](_0xea30('0x7e'))[_0xea30('0x79')](_0xea30('0x7f'))[_0xea30('0x3e')](_0xea30('0x80'),_0x1d5f40[_0xea30('0x55')]['id']['toString']()))[_0xea30('0x3e')](_0xea30('0x81'),squel['select']()['field'](_0xea30('0x82'))[_0xea30('0x79')](_0xea30('0x70'))[_0xea30('0x3e')](_0xea30('0x80'),_0x1d5f40[_0xea30('0x55')]['id']['toString']())))['toString']();break;case _0xea30('0x83'):_0x5038d2=squel[_0xea30('0x6e')]()['into']('cm_hopper')[_0xea30('0x71')]([_0xea30('0x72'),_0xea30('0x73'),_0xea30('0x74'),_0xea30('0x75'),'CampaignId',_0xea30('0x56'),_0xea30('0x57')],squel[_0xea30('0x7d')]()[_0xea30('0x76')](_0xea30('0x72'),_0xea30('0x72'))[_0xea30('0x76')](_0xea30('0x84'),'scheduledAt')[_0xea30('0x76')]('id',_0xea30('0x74'))[_0xea30('0x76')](_0x4fd6ed['CmListId'][_0xea30('0x78')](),_0xea30('0x75'))[_0xea30('0x76')](_0x1d5f40['params']['id'][_0xea30('0x78')](),_0xea30('0x5f'))[_0xea30('0x76')]('\x27'+_0x2e0473+'\x27',_0xea30('0x56'))[_0xea30('0x76')]('\x27'+_0x2e0473+'\x27',_0xea30('0x57'))[_0xea30('0x79')](_0xea30('0x7a'))[_0xea30('0x3e')](_0xea30('0x7b'))[_0xea30('0x3e')](_0xea30('0x85'),_0x4fd6ed[_0xea30('0x77')][_0xea30('0x78')]())['where'](_0xea30('0x7c'))[_0xea30('0x3e')](_0xea30('0x81'),squel[_0xea30('0x7d')]()[_0xea30('0x76')](_0xea30('0x82'))[_0xea30('0x79')](_0xea30('0x70'))[_0xea30('0x3e')](_0xea30('0x80'),_0x1d5f40[_0xea30('0x55')]['id'][_0xea30('0x78')]())))['toString']();break;default:_0x5038d2=squel['insert']()[_0xea30('0x6f')](_0xea30('0x70'))[_0xea30('0x71')](['phone','scheduledAt',_0xea30('0x74'),'ListId',_0xea30('0x5f'),_0xea30('0x56'),'updatedAt'],squel['select']()[_0xea30('0x76')](_0xea30('0x72'),_0xea30('0x72'))['field'](_0xea30('0x84'),_0xea30('0x73'))[_0xea30('0x76')]('id',_0xea30('0x74'))[_0xea30('0x76')](_0x4fd6ed[_0xea30('0x77')][_0xea30('0x78')](),_0xea30('0x75'))['field'](_0x1d5f40[_0xea30('0x55')]['id'][_0xea30('0x78')](),_0xea30('0x5f'))[_0xea30('0x76')]('\x27'+_0x2e0473+'\x27',_0xea30('0x56'))[_0xea30('0x76')]('\x27'+_0x2e0473+'\x27',_0xea30('0x57'))['from'](_0xea30('0x7a'))['where'](_0xea30('0x7b'))[_0xea30('0x3e')](_0xea30('0x85'),_0x4fd6ed['CmListId'][_0xea30('0x78')]())[_0xea30('0x3e')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x28b878=squel['insert']()[_0xea30('0x6f')]('cm_hopper_additional_phones')[_0xea30('0x71')](['cmHopperId','scheduledAt','phone',_0xea30('0x86'),'createdAt',_0xea30('0x57')],squel[_0xea30('0x7d')]()[_0xea30('0x76')](_0xea30('0x87'),'id')[_0xea30('0x76')](_0xea30('0x84'),'scheduledAt')['field'](_0xea30('0x88'),_0xea30('0x72'))[_0xea30('0x76')](_0xea30('0x89'),_0xea30('0x86'))[_0xea30('0x76')]('\x27'+_0x2e0473+'\x27',_0xea30('0x56'))[_0xea30('0x76')]('\x27'+_0x2e0473+'\x27',_0xea30('0x57'))['from'](_0xea30('0x8a'),'ci')[_0xea30('0x8b')](_0xea30('0x70'),'h',_0xea30('0x8c'))[_0xea30('0x3e')](_0xea30('0x8d'),_0x4fd6ed[_0xea30('0x77')][_0xea30('0x78')]())[_0xea30('0x3e')]('h.CampaignId=?',_0x1d5f40[_0xea30('0x55')]['id']['toString']())[_0xea30('0x3e')]('h.createdAt\x20=\x20?',_0x2e0473))[_0xea30('0x78')]();_0x420aac[_0xea30('0x8e')](db[_0xea30('0x8f')][_0xea30('0x33')](_0x5038d2));_0x4c7cca[_0xea30('0x8e')](db[_0xea30('0x8f')][_0xea30('0x33')](_0x28b878));}return BPromise['all'](_0x420aac);}})[_0xea30('0x27')](function(){return BPromise['all'](_0x4c7cca);})[_0xea30('0x27')](function(){return _0x93cf67;})[_0xea30('0x27')](respondWithResult(_0x1fc94b,null))[_0xea30('0x46')](handleError(_0x1fc94b,null));};exports[_0xea30('0x90')]=function(_0x1790a6,_0x48892c,_0x3693a7){return db[_0xea30('0x30')][_0xea30('0x4b')]({'where':{'id':_0x1790a6[_0xea30('0x55')]['id']}})[_0xea30('0x27')](handleEntityNotFound(_0x48892c,null))[_0xea30('0x27')](function(_0x443087){if(_0x443087){return _0x443087['removeLists'](_0x1790a6[_0xea30('0x33')][_0xea30('0x6a')]);}})['then'](function(_0x16966e){if(_0x16966e){return db[_0xea30('0x5d')][_0xea30('0x28')]({'where':{'ListId':_0x1790a6[_0xea30('0x33')]['ids'],'CampaignId':_0x1790a6[_0xea30('0x55')]['id']}})[_0xea30('0x27')](function(){return _0x16966e;});}})[_0xea30('0x27')](respondWithStatusCode(_0x48892c,null))[_0xea30('0x46')](handleError(_0x48892c,null));};exports[_0xea30('0x91')]=function(_0x523a53,_0x46ebcb,_0x331e5b){var _0x3792c0={};var _0x2d9faa={};var _0x21ca14;var _0x89e72b;return db[_0xea30('0x30')][_0xea30('0x5c')]({'where':{'id':_0x523a53[_0xea30('0x55')]['id']}})[_0xea30('0x27')](handleEntityNotFound(_0x46ebcb,null))[_0xea30('0x27')](function(_0x1a285e){if(_0x1a285e){_0x21ca14=_0x1a285e;_0x2d9faa[_0xea30('0x36')]=_[_0xea30('0x34')](db[_0xea30('0x65')]['rawAttributes']);_0x2d9faa['query']=_[_0xea30('0x34')](_0x523a53[_0xea30('0x33')]);_0x2d9faa['filters']=_[_0xea30('0x35')](_0x2d9faa[_0xea30('0x36')],_0x2d9faa[_0xea30('0x33')]);_0x3792c0[_0xea30('0x37')]=_[_0xea30('0x35')](_0x2d9faa['model'],qs[_0xea30('0x38')](_0x523a53[_0xea30('0x33')]['fields']));_0x3792c0['attributes']=_0x3792c0[_0xea30('0x37')]['length']?_0x3792c0[_0xea30('0x37')]:_0x2d9faa[_0xea30('0x36')];_0x3792c0['order']=qs['sort'](_0x523a53[_0xea30('0x33')]['sort']);_0x3792c0['where']=qs[_0xea30('0x3f')](_['pick'](_0x523a53[_0xea30('0x33')],_0x2d9faa[_0xea30('0x3f')]));if(_0x523a53[_0xea30('0x33')][_0xea30('0x42')]){_0x3792c0[_0xea30('0x3e')]=_['merge'](_0x3792c0[_0xea30('0x3e')],{'$or':_['map'](_0x3792c0[_0xea30('0x37')],function(_0x4ae3a8){var _0x5c60d7={};_0x5c60d7[_0x4ae3a8]={'$like':'%'+_0x523a53[_0xea30('0x33')]['filter']+'%'};return _0x5c60d7;})});}_0x3792c0=_[_0xea30('0x40')]({},_0x3792c0,_0x523a53[_0xea30('0x4a')]);return _0x21ca14[_0xea30('0x91')](_0x3792c0);}})[_0xea30('0x27')](function(_0x2f6b15){if(_0x2f6b15){_0x89e72b=_0x2f6b15[_0xea30('0x39')];if(!_0x523a53[_0xea30('0x33')][_0xea30('0x3a')](_0xea30('0x3b'))){_0x3792c0[_0xea30('0x20')]=qs[_0xea30('0x20')](_0x523a53[_0xea30('0x33')][_0xea30('0x20')]);_0x3792c0[_0xea30('0x1e')]=qs[_0xea30('0x1e')](_0x523a53[_0xea30('0x33')][_0xea30('0x1e')]);}return _0x21ca14[_0xea30('0x91')](_0x3792c0);}})[_0xea30('0x27')](function(_0x34f23f){if(_0x34f23f){return _0x34f23f?{'count':_0x89e72b,'rows':_0x34f23f}:null;}})[_0xea30('0x27')](respondWithResult(_0x46ebcb,null))[_0xea30('0x46')](handleError(_0x46ebcb,null));};exports[_0xea30('0x92')]=function(_0x2757df,_0x28a585,_0x4fd895){var _0x2b6892,_0x2d285b;var _0x8ad151=[];var _0x50fc3c=moment()[_0xea30('0x68')](_0xea30('0x69'));return db[_0xea30('0x30')][_0xea30('0x4b')]({'where':{'id':_0x2757df[_0xea30('0x55')]['id']}})[_0xea30('0x27')](handleEntityNotFound(_0x28a585,null))[_0xea30('0x27')](function(_0x5808da){if(_0x5808da){_0x2d285b=_0x5808da;return _0x5808da[_0xea30('0x92')](_0x2757df['body'][_0xea30('0x6a')],_[_0xea30('0x58')](_0x2757df[_0xea30('0x4d')],[_0xea30('0x6a'),'id'])||{});}return null;})[_0xea30('0x6b')](function(_0xcd9f7c){var _0x1c6264;var _0x35c435;_0x2b6892=_0xcd9f7c||[];var _0x1a909f=[];if(_0xcd9f7c){for(var _0x287177=0x0;_0x287177<_0xcd9f7c['length'];_0x287177+=0x1){var _0x3779af=_0xcd9f7c[_0x287177][_0xea30('0x29')]({'plain':!![]});_0x1c6264=squel['insert']()['into'](_0xea30('0x93'))[_0xea30('0x71')](['phone',_0xea30('0x74'),_0xea30('0x75'),'CampaignId',_0xea30('0x56'),_0xea30('0x57')],squel[_0xea30('0x7d')]()[_0xea30('0x76')](_0xea30('0x72'),'phone')[_0xea30('0x76')]('id','ContactId')[_0xea30('0x76')](_0x3779af[_0xea30('0x77')]['toString'](),_0xea30('0x75'))['field'](_0x2757df['params']['id'][_0xea30('0x78')](),'CampaignId')[_0xea30('0x76')](_0xea30('0x84'),_0xea30('0x56'))['field'](_0xea30('0x84'),_0xea30('0x57'))['from'](_0xea30('0x7a'))[_0xea30('0x3e')](_0xea30('0x7b'))['where'](_0xea30('0x85'),_0x3779af[_0xea30('0x77')][_0xea30('0x78')]())['where'](_0xea30('0x7c')))[_0xea30('0x78')]();_0x1a909f[_0xea30('0x8e')](db[_0xea30('0x8f')]['query'](_0x1c6264));}return BPromise[_0xea30('0x94')](_0x1a909f);}})[_0xea30('0x27')](function(){return _0x2b6892;})['then'](respondWithResult(_0x28a585,null))[_0xea30('0x46')](handleError(_0x28a585,null));};exports[_0xea30('0x95')]=function(_0x15177e,_0x34be1f,_0xc7807){return db[_0xea30('0x30')][_0xea30('0x4b')]({'where':{'id':_0x15177e[_0xea30('0x55')]['id']}})['then'](handleEntityNotFound(_0x34be1f,null))[_0xea30('0x27')](function(_0xa4692e){if(_0xa4692e){return _0xa4692e[_0xea30('0x95')](_0x15177e[_0xea30('0x33')][_0xea30('0x6a')]);}})['then'](function(_0x21c13b){if(_0x21c13b){return db['CmHopperBlack'][_0xea30('0x28')]({'where':{'ListId':_0x15177e[_0xea30('0x33')][_0xea30('0x6a')],'CampaignId':_0x15177e[_0xea30('0x55')]['id']}})['then'](function(){return _0x21c13b;});}})[_0xea30('0x27')](respondWithStatusCode(_0x34be1f,null))[_0xea30('0x46')](handleError(_0x34be1f,null));}; \ No newline at end of file +var _0xd3d3=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','Campaign','includeAll','include','rows','catch','show','params','find','create','user','role','IvrCampaigns','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','NOW()','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','push','sequelize','all','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','zip-dir','fast-json-patch','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x584b87,_0x3542b8){var _0x3e7b7e=function(_0xe8964d){while(--_0xe8964d){_0x584b87['push'](_0x584b87['shift']());}};_0x3e7b7e(++_0x3542b8);}(_0xd3d3,0x19a));var _0x3d3d=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xd3d3[_0x474bc0];return _0x4b24cf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3d3d('0x0'));var jsonpatch=require(_0x3d3d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3d3d('0x2'));var util=require(_0x3d3d('0x3'));var path=require(_0x3d3d('0x4'));var sox=require('sox');var csv=require(_0x3d3d('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d3d('0x6'));var _=require(_0x3d3d('0x7'));var squel=require(_0x3d3d('0x8'));var crypto=require(_0x3d3d('0x9'));var jsforce=require(_0x3d3d('0xa'));var deskjs=require(_0x3d3d('0xb'));var toCsv=require(_0x3d3d('0x5'));var querystring=require('querystring');var Papa=require(_0x3d3d('0xc'));var Redis=require(_0x3d3d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3d3d('0xe'));var as=require(_0x3d3d('0xf'));var hardwareService=require(_0x3d3d('0x10'));var logger=require(_0x3d3d('0x11'))(_0x3d3d('0x12'));var utils=require(_0x3d3d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3d3d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cb5f3,_0xe37fe6){_0xe37fe6=_0xe37fe6||0xcc;return function(_0x12cef1){if(_0x12cef1){return _0x1cb5f3['sendStatus'](_0xe37fe6);}return _0x1cb5f3[_0x3d3d('0x15')](_0xe37fe6)[_0x3d3d('0x16')]();};}function respondWithResult(_0x25305d,_0x553f92){_0x553f92=_0x553f92||0xc8;return function(_0x32ca75){if(_0x32ca75){return _0x25305d[_0x3d3d('0x15')](_0x553f92)[_0x3d3d('0x17')](_0x32ca75);}};}function respondWithFilteredResult(_0x16274f,_0xb02393){return function(_0x22bb7d){if(_0x22bb7d){var _0x3840b8=typeof _0xb02393['offset']===_0x3d3d('0x18')&&typeof _0xb02393[_0x3d3d('0x19')]===_0x3d3d('0x18');var _0x5a3bcd=_0x22bb7d[_0x3d3d('0x1a')];var _0x4658b9=_0x3840b8?0x0:_0xb02393[_0x3d3d('0x1b')];var _0x94eba2=_0x3840b8?_0x22bb7d[_0x3d3d('0x1a')]:_0xb02393[_0x3d3d('0x1b')]+_0xb02393[_0x3d3d('0x19')];var _0x4eff34;if(_0x94eba2>=_0x5a3bcd){_0x94eba2=_0x5a3bcd;_0x4eff34=0xc8;}else{_0x4eff34=0xce;}_0x16274f[_0x3d3d('0x15')](_0x4eff34);return _0x16274f['set'](_0x3d3d('0x1c'),_0x4658b9+'-'+_0x94eba2+'/'+_0x5a3bcd)[_0x3d3d('0x17')](_0x22bb7d);}return null;};}function patchUpdates(_0x5691d9){return function(_0x5ede83){try{jsonpatch[_0x3d3d('0x1d')](_0x5ede83,_0x5691d9,!![]);}catch(_0x2cafd4){return BPromise[_0x3d3d('0x1e')](_0x2cafd4);}return _0x5ede83[_0x3d3d('0x1f')]();};}function saveUpdates(_0x49685a,_0x4291cb){return function(_0xf88a7e){if(_0xf88a7e){return _0xf88a7e[_0x3d3d('0x20')](_0x49685a)['then'](function(_0x388900){return _0x388900;});}return null;};}function removeEntity(_0x288002,_0x1dbb69){return function(_0x557bab){if(_0x557bab){return _0x557bab['destroy']()[_0x3d3d('0x21')](function(){var _0x38cd63=_0x557bab[_0x3d3d('0x22')]({'plain':!![]});var _0x25854e='IvrCampaigns';return db[_0x3d3d('0x23')][_0x3d3d('0x24')]({'where':{'type':_0x25854e,'resourceId':_0x38cd63['id']}})[_0x3d3d('0x21')](function(){return _0x557bab;});})[_0x3d3d('0x21')](function(){_0x288002[_0x3d3d('0x15')](0xcc)[_0x3d3d('0x16')]();});}};}function handleEntityNotFound(_0x158504,_0x50fbad){return function(_0x49a2b7){if(!_0x49a2b7){_0x158504['sendStatus'](0x194);}return _0x49a2b7;};}function handleError(_0x566dd8,_0x5bf25b){_0x5bf25b=_0x5bf25b||0x1f4;return function(_0x51c8fb){logger[_0x3d3d('0x25')](_0x51c8fb[_0x3d3d('0x26')]);if(_0x51c8fb[_0x3d3d('0x27')]){delete _0x51c8fb[_0x3d3d('0x27')];}_0x566dd8[_0x3d3d('0x15')](_0x5bf25b)[_0x3d3d('0x28')](_0x51c8fb);};}exports[_0x3d3d('0x29')]=function(_0x5c1e3c,_0xecbe5b){var _0x20f7b8={},_0x421152={},_0x413e80={'count':0x0,'rows':[]};var _0x237815=_[_0x3d3d('0x2a')](db['Campaign'][_0x3d3d('0x2b')],function(_0x366414){return{'name':_0x366414[_0x3d3d('0x2c')],'type':_0x366414[_0x3d3d('0x2d')][_0x3d3d('0x2e')]};});_0x421152['model']=_['map'](_0x237815,_0x3d3d('0x27'));_0x421152[_0x3d3d('0x2f')]=_[_0x3d3d('0x30')](_0x5c1e3c[_0x3d3d('0x2f')]);_0x421152['filters']=_['intersection'](_0x421152[_0x3d3d('0x31')],_0x421152[_0x3d3d('0x2f')]);_0x20f7b8[_0x3d3d('0x32')]=_[_0x3d3d('0x33')](_0x421152[_0x3d3d('0x31')],qs[_0x3d3d('0x34')](_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x34')]));_0x20f7b8[_0x3d3d('0x32')]=_0x20f7b8[_0x3d3d('0x32')][_0x3d3d('0x35')]?_0x20f7b8['attributes']:_0x421152[_0x3d3d('0x31')];if(!_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x36')](_0x3d3d('0x37'))){_0x20f7b8[_0x3d3d('0x19')]=qs[_0x3d3d('0x19')](_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x19')]);_0x20f7b8[_0x3d3d('0x1b')]=qs['offset'](_0x5c1e3c['query'][_0x3d3d('0x1b')]);}_0x20f7b8[_0x3d3d('0x38')]=qs['sort'](_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x39')]);_0x20f7b8['where']=qs[_0x3d3d('0x3a')](_[_0x3d3d('0x3b')](_0x5c1e3c[_0x3d3d('0x2f')],_0x421152[_0x3d3d('0x3a')]),_0x237815);if(_0x5c1e3c['query'][_0x3d3d('0x3c')]){_0x20f7b8[_0x3d3d('0x3d')]=_[_0x3d3d('0x3e')](_0x20f7b8[_0x3d3d('0x3d')],{'$or':_[_0x3d3d('0x2a')](_0x237815,function(_0x54647b){if(_0x54647b[_0x3d3d('0x2d')]!==_0x3d3d('0x3f')){var _0x486fc4={};_0x486fc4[_0x54647b[_0x3d3d('0x27')]]={'$like':'%'+_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x3c')]+'%'};return _0x486fc4;}})});}_0x20f7b8=_['merge']({},_0x20f7b8,_0x5c1e3c[_0x3d3d('0x40')]);var _0x49db65={'where':_0x20f7b8[_0x3d3d('0x3d')]};return db[_0x3d3d('0x41')]['count'](_0x49db65)[_0x3d3d('0x21')](function(_0x130686){_0x413e80[_0x3d3d('0x1a')]=_0x130686;if(_0x5c1e3c[_0x3d3d('0x2f')][_0x3d3d('0x42')]){_0x20f7b8[_0x3d3d('0x43')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x20f7b8);})['then'](function(_0xe5e1){_0x413e80[_0x3d3d('0x44')]=_0xe5e1;return _0x413e80;})[_0x3d3d('0x21')](respondWithFilteredResult(_0xecbe5b,_0x20f7b8))[_0x3d3d('0x45')](handleError(_0xecbe5b,null));};exports[_0x3d3d('0x46')]=function(_0x214357,_0x4fad9f){var _0x158b1d={'raw':![],'where':{'id':_0x214357[_0x3d3d('0x47')]['id']}},_0xde01a5={};_0xde01a5[_0x3d3d('0x31')]=_['keys'](db[_0x3d3d('0x41')]['rawAttributes']);_0xde01a5[_0x3d3d('0x2f')]=_[_0x3d3d('0x30')](_0x214357[_0x3d3d('0x2f')]);_0xde01a5[_0x3d3d('0x3a')]=_['intersection'](_0xde01a5[_0x3d3d('0x31')],_0xde01a5[_0x3d3d('0x2f')]);_0x158b1d['attributes']=_[_0x3d3d('0x33')](_0xde01a5['model'],qs['fields'](_0x214357['query'][_0x3d3d('0x34')]));_0x158b1d['attributes']=_0x158b1d[_0x3d3d('0x32')]['length']?_0x158b1d['attributes']:_0xde01a5['model'];if(_0x214357[_0x3d3d('0x2f')][_0x3d3d('0x42')]){_0x158b1d['include']=[{'all':!![]}];}_0x158b1d=_[_0x3d3d('0x3e')]({},_0x158b1d,_0x214357['options']);return db[_0x3d3d('0x41')][_0x3d3d('0x48')](_0x158b1d)[_0x3d3d('0x21')](handleEntityNotFound(_0x4fad9f,null))[_0x3d3d('0x21')](respondWithResult(_0x4fad9f,null))[_0x3d3d('0x45')](handleError(_0x4fad9f,null));};exports[_0x3d3d('0x49')]=function(_0x1825e8,_0x437782){return db[_0x3d3d('0x41')][_0x3d3d('0x49')](_0x1825e8['body'],{})[_0x3d3d('0x21')](function(_0x25f7a5){var _0x25d2f6=_0x1825e8[_0x3d3d('0x4a')][_0x3d3d('0x22')]({'plain':!![]});if(!_0x25d2f6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25d2f6[_0x3d3d('0x4b')]===_0x3d3d('0x4a')){var _0xbad206=_0x25f7a5[_0x3d3d('0x22')]({'plain':!![]});var _0x1b22a9=_0x3d3d('0x4c');return db['UserProfileSection'][_0x3d3d('0x48')]({'where':{'name':_0x1b22a9,'userProfileId':_0x25d2f6['userProfileId']},'raw':!![]})[_0x3d3d('0x21')](function(_0x181c76){if(_0x181c76&&_0x181c76['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xbad206[_0x3d3d('0x27')],'resourceId':_0xbad206['id'],'type':_0x181c76[_0x3d3d('0x27')],'sectionId':_0x181c76['id']},{})['then'](function(){return _0x25f7a5;});}else{return _0x25f7a5;}})['catch'](function(_0x1a0c6d){logger[_0x3d3d('0x25')](_0x3d3d('0x4d'),_0x1a0c6d);throw _0x1a0c6d;});}return _0x25f7a5;})[_0x3d3d('0x21')](respondWithResult(_0x437782,0xc9))[_0x3d3d('0x45')](handleError(_0x437782,null));};exports[_0x3d3d('0x4e')]=function(_0x346b0c,_0x1a98a1){var _0x50c0b1={'where':{'id':_0x346b0c[_0x3d3d('0x47')]['id']}},_0x24418d={};_0x24418d['model']=_[_0x3d3d('0x30')](db[_0x3d3d('0x41')][_0x3d3d('0x2b')]);_0x50c0b1[_0x3d3d('0x32')]=_['intersection'](_0x24418d['model'],qs['fields'](_0x346b0c['query'][_0x3d3d('0x34')]));_0x50c0b1['attributes']=_0x50c0b1[_0x3d3d('0x32')]['length']?_0x50c0b1[_0x3d3d('0x32')]:_0x24418d[_0x3d3d('0x31')];if(_0x346b0c[_0x3d3d('0x2f')][_0x3d3d('0x42')]){_0x50c0b1[_0x3d3d('0x43')]=[{'all':!![]}];}_0x50c0b1=_['merge']({},_0x50c0b1,_0x346b0c['options']);return db[_0x3d3d('0x41')][_0x3d3d('0x48')](_0x50c0b1)['then'](handleEntityNotFound(_0x1a98a1,null))[_0x3d3d('0x21')](function(_0x51be10){if(_0x51be10){var _0x419c4e=_0x51be10['get']({'plain':!![]});_0x419c4e=qs[_0x3d3d('0x4f')](_0x419c4e,['id',_0x3d3d('0x50'),_0x3d3d('0x51')]);_0x346b0c[_0x3d3d('0x52')]=_['omit'](_0x346b0c[_0x3d3d('0x52')],['id','createdAt',_0x3d3d('0x51')]);return db[_0x3d3d('0x41')]['create'](_[_0x3d3d('0x3e')](_0x419c4e,_0x346b0c[_0x3d3d('0x52')]),{'include':_0x346b0c[_0x3d3d('0x2f')][_0x3d3d('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x3c68fb){var _0x4d79ce=_0x346b0c[_0x3d3d('0x4a')][_0x3d3d('0x22')]({'plain':!![]});if(!_0x4d79ce)throw new Error(_0x3d3d('0x53'));if(_0x4d79ce[_0x3d3d('0x4b')]===_0x3d3d('0x4a')){var _0x5f0de4=_0x3c68fb['get']({'plain':!![]});var _0x130ee8=_0x3d3d('0x4c');return db['UserProfileSection'][_0x3d3d('0x48')]({'where':{'name':_0x130ee8,'userProfileId':_0x4d79ce[_0x3d3d('0x54')]},'raw':!![]})['then'](function(_0x46de23){if(_0x46de23&&_0x46de23['autoAssociation']===0x0){return db[_0x3d3d('0x23')][_0x3d3d('0x49')]({'name':_0x5f0de4['name'],'resourceId':_0x5f0de4['id'],'type':_0x46de23[_0x3d3d('0x27')],'sectionId':_0x46de23['id']},{})['then'](function(){return _0x3c68fb;});}else{return _0x3c68fb;}})['catch'](function(_0x4eb7da){logger[_0x3d3d('0x25')](_0x3d3d('0x4d'),_0x4eb7da);throw _0x4eb7da;});}return _0x3c68fb;});}})[_0x3d3d('0x21')](respondWithResult(_0x1a98a1,0xc9))[_0x3d3d('0x45')](handleError(_0x1a98a1,null));};exports[_0x3d3d('0x20')]=function(_0x4e7390,_0x57e663){if(_0x4e7390[_0x3d3d('0x52')]['id']){delete _0x4e7390[_0x3d3d('0x52')]['id'];}return db[_0x3d3d('0x41')][_0x3d3d('0x48')]({'where':{'id':_0x4e7390[_0x3d3d('0x47')]['id']}})['then'](handleEntityNotFound(_0x57e663,null))[_0x3d3d('0x21')](saveUpdates(_0x4e7390[_0x3d3d('0x52')],null))[_0x3d3d('0x21')](respondWithResult(_0x57e663,null))[_0x3d3d('0x45')](handleError(_0x57e663,null));};exports[_0x3d3d('0x24')]=function(_0x391c12,_0xbe69c4){return db[_0x3d3d('0x41')][_0x3d3d('0x48')]({'where':{'id':_0x391c12[_0x3d3d('0x47')]['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0xbe69c4,null))[_0x3d3d('0x21')](removeEntity(_0xbe69c4,null))['catch'](handleError(_0xbe69c4,null));};exports['getHoppers']=function(_0x45d1d4,_0x16e672,_0x5b5554){var _0x19dae8={'raw':!![],'where':{}};var _0x158b51={};var _0x3fdd24={'count':0x0,'rows':[]};return db[_0x3d3d('0x41')][_0x3d3d('0x55')]({'where':{'id':_0x45d1d4[_0x3d3d('0x47')]['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0x16e672,null))[_0x3d3d('0x21')](function(_0x2421a7){if(_0x2421a7){_0x158b51[_0x3d3d('0x31')]=_[_0x3d3d('0x30')](db['CmHopper'][_0x3d3d('0x2b')]);_0x158b51['query']=_[_0x3d3d('0x30')](_0x45d1d4[_0x3d3d('0x2f')]);_0x158b51[_0x3d3d('0x3a')]=_['intersection'](_0x158b51['model'],_0x158b51[_0x3d3d('0x2f')]);_0x19dae8['attributes']=_[_0x3d3d('0x33')](_0x158b51[_0x3d3d('0x31')],qs[_0x3d3d('0x34')](_0x45d1d4[_0x3d3d('0x2f')][_0x3d3d('0x34')]));_0x19dae8[_0x3d3d('0x32')]=_0x19dae8[_0x3d3d('0x32')][_0x3d3d('0x35')]?_0x19dae8['attributes']:_0x158b51['model'];if(!_0x45d1d4[_0x3d3d('0x2f')][_0x3d3d('0x36')](_0x3d3d('0x37'))){_0x19dae8[_0x3d3d('0x19')]=qs[_0x3d3d('0x19')](_0x45d1d4[_0x3d3d('0x2f')][_0x3d3d('0x19')]);_0x19dae8[_0x3d3d('0x1b')]=qs['offset'](_0x45d1d4[_0x3d3d('0x2f')]['offset']);}_0x19dae8[_0x3d3d('0x38')]=qs[_0x3d3d('0x39')](_0x45d1d4[_0x3d3d('0x2f')][_0x3d3d('0x39')]);_0x19dae8['where']=qs[_0x3d3d('0x3a')](_[_0x3d3d('0x3b')](_0x45d1d4['query'],_0x158b51[_0x3d3d('0x3a')]));_0x19dae8[_0x3d3d('0x3d')][_0x3d3d('0x56')]=_0x2421a7['id'];if(_0x45d1d4['query']['filter']){_0x19dae8[_0x3d3d('0x3d')]=_[_0x3d3d('0x3e')](_0x19dae8[_0x3d3d('0x3d')],{'$or':_[_0x3d3d('0x2a')](_0x19dae8[_0x3d3d('0x32')],function(_0x1417b5){var _0x30de4e={};_0x30de4e[_0x1417b5]={'$like':'%'+_0x45d1d4[_0x3d3d('0x2f')][_0x3d3d('0x3c')]+'%'};return _0x30de4e;})});}_0x19dae8=_['merge']({},_0x19dae8,_0x45d1d4['options']);return db[_0x3d3d('0x57')]['count']({'where':_0x19dae8['where']})[_0x3d3d('0x21')](function(_0x7d16f8){_0x3fdd24[_0x3d3d('0x1a')]=_0x7d16f8;if(_0x45d1d4[_0x3d3d('0x2f')]['includeAll']){_0x19dae8[_0x3d3d('0x43')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x19dae8);})[_0x3d3d('0x21')](function(_0x85ba84){_0x3fdd24[_0x3d3d('0x44')]=_0x85ba84;return _0x3fdd24;});}})[_0x3d3d('0x21')](respondWithFilteredResult(_0x16e672,_0x19dae8))[_0x3d3d('0x45')](handleError(_0x16e672,null));};exports[_0x3d3d('0x58')]=function(_0x6557b8,_0x1f78d8,_0x31124f){var _0x352b53={'raw':!![],'where':{}};var _0x221832={};var _0x46b342={'count':0x0,'rows':[]};return db[_0x3d3d('0x41')][_0x3d3d('0x55')]({'where':{'id':_0x6557b8[_0x3d3d('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f78d8,null))[_0x3d3d('0x21')](function(_0x413607){if(_0x413607){_0x221832[_0x3d3d('0x31')]=_[_0x3d3d('0x30')](db['CmHopperHistory']['rawAttributes']);_0x221832[_0x3d3d('0x2f')]=_[_0x3d3d('0x30')](_0x6557b8[_0x3d3d('0x2f')]);_0x221832[_0x3d3d('0x3a')]=_[_0x3d3d('0x33')](_0x221832[_0x3d3d('0x31')],_0x221832[_0x3d3d('0x2f')]);_0x352b53[_0x3d3d('0x32')]=_[_0x3d3d('0x33')](_0x221832[_0x3d3d('0x31')],qs[_0x3d3d('0x34')](_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x34')]));_0x352b53['attributes']=_0x352b53[_0x3d3d('0x32')]['length']?_0x352b53['attributes']:_0x221832[_0x3d3d('0x31')];if(!_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x36')](_0x3d3d('0x37'))){_0x352b53[_0x3d3d('0x19')]=qs['limit'](_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x19')]);_0x352b53['offset']=qs[_0x3d3d('0x1b')](_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x1b')]);}_0x352b53[_0x3d3d('0x38')]=qs['sort'](_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x39')]);_0x352b53['where']=qs['filters'](_[_0x3d3d('0x3b')](_0x6557b8[_0x3d3d('0x2f')],_0x221832[_0x3d3d('0x3a')]));_0x352b53[_0x3d3d('0x3d')][_0x3d3d('0x56')]=_0x413607['id'];if(_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x3c')]){_0x352b53[_0x3d3d('0x3d')]=_[_0x3d3d('0x3e')](_0x352b53[_0x3d3d('0x3d')],{'$or':_[_0x3d3d('0x2a')](_0x352b53['attributes'],function(_0x1f7fa8){var _0x34fa27={};_0x34fa27[_0x1f7fa8]={'$like':'%'+_0x6557b8[_0x3d3d('0x2f')][_0x3d3d('0x3c')]+'%'};return _0x34fa27;})});}_0x352b53=_[_0x3d3d('0x3e')]({},_0x352b53,_0x6557b8[_0x3d3d('0x40')]);return db[_0x3d3d('0x59')][_0x3d3d('0x1a')]({'where':_0x352b53[_0x3d3d('0x3d')]})[_0x3d3d('0x21')](function(_0x22f909){_0x46b342[_0x3d3d('0x1a')]=_0x22f909;if(_0x6557b8['query'][_0x3d3d('0x42')]){_0x352b53[_0x3d3d('0x43')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3d3d('0x5a')](_0x352b53);})[_0x3d3d('0x21')](function(_0x235d77){_0x46b342[_0x3d3d('0x44')]=_0x235d77;return _0x46b342;});}})[_0x3d3d('0x21')](respondWithFilteredResult(_0x1f78d8,_0x352b53))[_0x3d3d('0x45')](handleError(_0x1f78d8,null));};exports[_0x3d3d('0x5b')]=function(_0x574ac5,_0x219b4f,_0x5643f6){var _0x31aa86={'raw':!![],'where':{}};var _0x35c479={};var _0x1acccf={'count':0x0,'rows':[]};return db[_0x3d3d('0x41')][_0x3d3d('0x55')]({'where':{'id':_0x574ac5[_0x3d3d('0x47')]['id']}})['then'](handleEntityNotFound(_0x219b4f,null))[_0x3d3d('0x21')](function(_0x3682e5){if(_0x3682e5){_0x35c479[_0x3d3d('0x31')]=_[_0x3d3d('0x30')](db[_0x3d3d('0x5c')][_0x3d3d('0x2b')]);_0x35c479['query']=_['keys'](_0x574ac5['query']);_0x35c479[_0x3d3d('0x3a')]=_['intersection'](_0x35c479[_0x3d3d('0x31')],_0x35c479[_0x3d3d('0x2f')]);_0x31aa86[_0x3d3d('0x32')]=_[_0x3d3d('0x33')](_0x35c479[_0x3d3d('0x31')],qs['fields'](_0x574ac5[_0x3d3d('0x2f')]['fields']));_0x31aa86[_0x3d3d('0x32')]=_0x31aa86[_0x3d3d('0x32')][_0x3d3d('0x35')]?_0x31aa86['attributes']:_0x35c479[_0x3d3d('0x31')];if(!_0x574ac5[_0x3d3d('0x2f')][_0x3d3d('0x36')](_0x3d3d('0x37'))){_0x31aa86[_0x3d3d('0x19')]=qs[_0x3d3d('0x19')](_0x574ac5[_0x3d3d('0x2f')][_0x3d3d('0x19')]);_0x31aa86[_0x3d3d('0x1b')]=qs[_0x3d3d('0x1b')](_0x574ac5[_0x3d3d('0x2f')][_0x3d3d('0x1b')]);}_0x31aa86[_0x3d3d('0x38')]=qs[_0x3d3d('0x39')](_0x574ac5[_0x3d3d('0x2f')][_0x3d3d('0x39')]);_0x31aa86[_0x3d3d('0x3d')]=qs[_0x3d3d('0x3a')](_['pick'](_0x574ac5[_0x3d3d('0x2f')],_0x35c479['filters']));_0x31aa86[_0x3d3d('0x3d')][_0x3d3d('0x56')]=_0x3682e5['id'];if(_0x574ac5[_0x3d3d('0x2f')][_0x3d3d('0x3c')]){_0x31aa86[_0x3d3d('0x3d')]=_['merge'](_0x31aa86['where'],{'$or':_[_0x3d3d('0x2a')](_0x31aa86['attributes'],function(_0x1c6a86){var _0xbde49e={};_0xbde49e[_0x1c6a86]={'$like':'%'+_0x574ac5[_0x3d3d('0x2f')][_0x3d3d('0x3c')]+'%'};return _0xbde49e;})});}_0x31aa86=_[_0x3d3d('0x3e')]({},_0x31aa86,_0x574ac5[_0x3d3d('0x40')]);return db[_0x3d3d('0x5c')][_0x3d3d('0x1a')]({'where':_0x31aa86[_0x3d3d('0x3d')]})[_0x3d3d('0x21')](function(_0x5ecd08){_0x1acccf[_0x3d3d('0x1a')]=_0x5ecd08;if(_0x574ac5[_0x3d3d('0x2f')][_0x3d3d('0x42')]){_0x31aa86[_0x3d3d('0x43')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x3d3d('0x5a')](_0x31aa86);})['then'](function(_0x292bf5){_0x1acccf[_0x3d3d('0x44')]=_0x292bf5;return _0x1acccf;});}})[_0x3d3d('0x21')](respondWithFilteredResult(_0x219b4f,_0x31aa86))[_0x3d3d('0x45')](handleError(_0x219b4f,null));};exports[_0x3d3d('0x5d')]=function(_0x347df4,_0x34f11d,_0x412aa7){var _0xcf6326={'raw':!![],'where':{}};var _0x112a70={};var _0x36734f={'count':0x0,'rows':[]};return db[_0x3d3d('0x41')]['findOne']({'where':{'id':_0x347df4['params']['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0x34f11d,null))['then'](function(_0x9e7fca){if(_0x9e7fca){_0x112a70['model']=_[_0x3d3d('0x30')](db[_0x3d3d('0x5e')][_0x3d3d('0x2b')]);_0x112a70[_0x3d3d('0x2f')]=_[_0x3d3d('0x30')](_0x347df4[_0x3d3d('0x2f')]);_0x112a70[_0x3d3d('0x3a')]=_[_0x3d3d('0x33')](_0x112a70[_0x3d3d('0x31')],_0x112a70[_0x3d3d('0x2f')]);_0xcf6326[_0x3d3d('0x32')]=_[_0x3d3d('0x33')](_0x112a70['model'],qs['fields'](_0x347df4['query'][_0x3d3d('0x34')]));_0xcf6326[_0x3d3d('0x32')]=_0xcf6326['attributes'][_0x3d3d('0x35')]?_0xcf6326[_0x3d3d('0x32')]:_0x112a70['model'];if(!_0x347df4[_0x3d3d('0x2f')][_0x3d3d('0x36')](_0x3d3d('0x37'))){_0xcf6326[_0x3d3d('0x19')]=qs['limit'](_0x347df4['query'][_0x3d3d('0x19')]);_0xcf6326[_0x3d3d('0x1b')]=qs[_0x3d3d('0x1b')](_0x347df4[_0x3d3d('0x2f')][_0x3d3d('0x1b')]);}_0xcf6326['order']=qs[_0x3d3d('0x39')](_0x347df4['query'][_0x3d3d('0x39')]);_0xcf6326[_0x3d3d('0x3d')]=qs['filters'](_[_0x3d3d('0x3b')](_0x347df4[_0x3d3d('0x2f')],_0x112a70[_0x3d3d('0x3a')]));_0xcf6326[_0x3d3d('0x3d')]['CampaignId']=_0x9e7fca['id'];if(_0x347df4[_0x3d3d('0x2f')][_0x3d3d('0x3c')]){_0xcf6326[_0x3d3d('0x3d')]=_[_0x3d3d('0x3e')](_0xcf6326[_0x3d3d('0x3d')],{'$or':_[_0x3d3d('0x2a')](_0xcf6326[_0x3d3d('0x32')],function(_0x28210f){var _0xce2318={};_0xce2318[_0x28210f]={'$like':'%'+_0x347df4['query'][_0x3d3d('0x3c')]+'%'};return _0xce2318;})});}_0xcf6326=_[_0x3d3d('0x3e')]({},_0xcf6326,_0x347df4[_0x3d3d('0x40')]);return db[_0x3d3d('0x5e')]['count']({'where':_0xcf6326[_0x3d3d('0x3d')]})[_0x3d3d('0x21')](function(_0x5d962e){_0x36734f[_0x3d3d('0x1a')]=_0x5d962e;if(_0x347df4[_0x3d3d('0x2f')][_0x3d3d('0x42')]){_0xcf6326[_0x3d3d('0x43')]=[{'all':!![]}];}return db[_0x3d3d('0x5e')][_0x3d3d('0x5a')](_0xcf6326);})[_0x3d3d('0x21')](function(_0x5234a){_0x36734f[_0x3d3d('0x44')]=_0x5234a;return _0x36734f;});}})[_0x3d3d('0x21')](respondWithFilteredResult(_0x34f11d,_0xcf6326))['catch'](handleError(_0x34f11d,null));};exports[_0x3d3d('0x5f')]=function(_0x20a20f,_0x56e805,_0x3587f1){var _0x32eb44={};var _0x191ba1={};var _0x278afa;var _0x3fcfe8;return db[_0x3d3d('0x41')][_0x3d3d('0x55')]({'where':{'id':_0x20a20f[_0x3d3d('0x47')]['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0x56e805,null))[_0x3d3d('0x21')](function(_0x36a57c){if(_0x36a57c){_0x278afa=_0x36a57c;_0x191ba1['model']=_[_0x3d3d('0x30')](db[_0x3d3d('0x60')][_0x3d3d('0x2b')]);_0x191ba1[_0x3d3d('0x2f')]=_[_0x3d3d('0x30')](_0x20a20f[_0x3d3d('0x2f')]);_0x191ba1[_0x3d3d('0x3a')]=_[_0x3d3d('0x33')](_0x191ba1[_0x3d3d('0x31')],_0x191ba1[_0x3d3d('0x2f')]);_0x32eb44[_0x3d3d('0x32')]=_['intersection'](_0x191ba1[_0x3d3d('0x31')],qs['fields'](_0x20a20f[_0x3d3d('0x2f')][_0x3d3d('0x34')]));_0x32eb44[_0x3d3d('0x32')]=_0x32eb44[_0x3d3d('0x32')]['length']?_0x32eb44[_0x3d3d('0x32')]:_0x191ba1[_0x3d3d('0x31')];_0x32eb44[_0x3d3d('0x38')]=qs['sort'](_0x20a20f[_0x3d3d('0x2f')][_0x3d3d('0x39')]);_0x32eb44[_0x3d3d('0x3d')]=qs['filters'](_['pick'](_0x20a20f[_0x3d3d('0x2f')],_0x191ba1[_0x3d3d('0x3a')]));if(_0x20a20f[_0x3d3d('0x2f')][_0x3d3d('0x3c')]){_0x32eb44[_0x3d3d('0x3d')]=_['merge'](_0x32eb44['where'],{'$or':_[_0x3d3d('0x2a')](_0x32eb44['attributes'],function(_0x2f826f){var _0x1f7ff1={};_0x1f7ff1[_0x2f826f]={'$like':'%'+_0x20a20f['query'][_0x3d3d('0x3c')]+'%'};return _0x1f7ff1;})});}_0x32eb44=_[_0x3d3d('0x3e')]({},_0x32eb44,_0x20a20f[_0x3d3d('0x40')]);return _0x278afa[_0x3d3d('0x5f')](_0x32eb44);}})[_0x3d3d('0x21')](function(_0x5cea6d){if(_0x5cea6d){_0x3fcfe8=_0x5cea6d[_0x3d3d('0x35')];if(!_0x20a20f[_0x3d3d('0x2f')]['hasOwnProperty'](_0x3d3d('0x37'))){_0x32eb44[_0x3d3d('0x19')]=qs['limit'](_0x20a20f[_0x3d3d('0x2f')][_0x3d3d('0x19')]);_0x32eb44[_0x3d3d('0x1b')]=qs[_0x3d3d('0x1b')](_0x20a20f[_0x3d3d('0x2f')][_0x3d3d('0x1b')]);}return _0x278afa[_0x3d3d('0x5f')](_0x32eb44);}})[_0x3d3d('0x21')](function(_0x5091c5){if(_0x5091c5){return _0x5091c5?{'count':_0x3fcfe8,'rows':_0x5091c5}:null;}})[_0x3d3d('0x21')](respondWithResult(_0x56e805,null))[_0x3d3d('0x45')](handleError(_0x56e805,null));};exports[_0x3d3d('0x61')]=function(_0x4e5209,_0x47392e,_0x1ee1cd){var _0x4dd81a,_0x5ef8bb;var _0x10808a=[];var _0xf9473d=moment()[_0x3d3d('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x3d3d('0x41')][_0x3d3d('0x48')]({'where':{'id':_0x4e5209['params']['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0x47392e,null))['then'](function(_0x35ddb9){if(_0x35ddb9){_0x5ef8bb=_0x35ddb9;return _0x35ddb9[_0x3d3d('0x61')](_0x4e5209[_0x3d3d('0x52')][_0x3d3d('0x63')],_[_0x3d3d('0x4f')](_0x4e5209['body'],['ids','id'])||{});}return null;})[_0x3d3d('0x64')](function(_0xbb1bfa){var _0x4f880c;var _0x19a6cf;_0x4dd81a=_0xbb1bfa||[];var _0x12e6cc=[];if(_0xbb1bfa){for(var _0x4aeba1=0x0;_0x4aeba1<_0xbb1bfa['length'];_0x4aeba1+=0x1){var _0x51d50f=_0xbb1bfa[_0x4aeba1][_0x3d3d('0x22')]({'plain':!![]});_0x5ef8bb[_0x3d3d('0x65')]=_0x4e5209[_0x3d3d('0x52')][_0x3d3d('0x65')]?_0x4e5209[_0x3d3d('0x52')][_0x3d3d('0x65')]:_0x5ef8bb[_0x3d3d('0x65')];switch(_0x5ef8bb[_0x3d3d('0x65')]){case _0x3d3d('0x66'):_0x4f880c=squel[_0x3d3d('0x67')]()[_0x3d3d('0x68')](_0x3d3d('0x69'))[_0x3d3d('0x6a')]([_0x3d3d('0x6b'),_0x3d3d('0x6c'),'ContactId',_0x3d3d('0x6d'),_0x3d3d('0x56'),_0x3d3d('0x50'),'updatedAt'],squel[_0x3d3d('0x6e')]()[_0x3d3d('0x6f')](_0x3d3d('0x6b'),_0x3d3d('0x6b'))['field']('NOW()','scheduledAt')[_0x3d3d('0x6f')]('id',_0x3d3d('0x70'))['field'](_0x51d50f[_0x3d3d('0x71')]['toString'](),_0x3d3d('0x6d'))[_0x3d3d('0x6f')](_0x4e5209[_0x3d3d('0x47')]['id'][_0x3d3d('0x72')](),_0x3d3d('0x56'))[_0x3d3d('0x6f')]('\x27'+_0xf9473d+'\x27','createdAt')[_0x3d3d('0x6f')]('\x27'+_0xf9473d+'\x27',_0x3d3d('0x51'))[_0x3d3d('0x73')](_0x3d3d('0x74'))[_0x3d3d('0x3d')](_0x3d3d('0x75'))[_0x3d3d('0x3d')](_0x3d3d('0x76'),_0x51d50f[_0x3d3d('0x71')][_0x3d3d('0x72')]())[_0x3d3d('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0x3d3d('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3d3d('0x6e')]()[_0x3d3d('0x6f')](_0x3d3d('0x77'))[_0x3d3d('0x73')](_0x3d3d('0x78'))[_0x3d3d('0x3d')](_0x3d3d('0x79'),_0x4e5209[_0x3d3d('0x47')]['id']['toString']()))['where'](_0x3d3d('0x7a'),squel[_0x3d3d('0x6e')]()[_0x3d3d('0x6f')](_0x3d3d('0x7b'))[_0x3d3d('0x73')]('cm_hopper')[_0x3d3d('0x3d')]('CampaignId\x20=\x20?',_0x4e5209[_0x3d3d('0x47')]['id']['toString']())))[_0x3d3d('0x72')]();break;case _0x3d3d('0x7c'):_0x4f880c=squel['insert']()[_0x3d3d('0x68')]('cm_hopper')[_0x3d3d('0x6a')]([_0x3d3d('0x6b'),_0x3d3d('0x6c'),_0x3d3d('0x70'),'ListId','CampaignId',_0x3d3d('0x50'),_0x3d3d('0x51')],squel[_0x3d3d('0x6e')]()[_0x3d3d('0x6f')](_0x3d3d('0x6b'),_0x3d3d('0x6b'))[_0x3d3d('0x6f')](_0x3d3d('0x7d'),_0x3d3d('0x6c'))['field']('id',_0x3d3d('0x70'))[_0x3d3d('0x6f')](_0x51d50f[_0x3d3d('0x71')]['toString'](),_0x3d3d('0x6d'))[_0x3d3d('0x6f')](_0x4e5209[_0x3d3d('0x47')]['id']['toString'](),'CampaignId')[_0x3d3d('0x6f')]('\x27'+_0xf9473d+'\x27','createdAt')[_0x3d3d('0x6f')]('\x27'+_0xf9473d+'\x27',_0x3d3d('0x51'))[_0x3d3d('0x73')]('cm_contacts')[_0x3d3d('0x3d')]('deletedAt\x20IS\x20NULL')[_0x3d3d('0x3d')](_0x3d3d('0x76'),_0x51d50f[_0x3d3d('0x71')][_0x3d3d('0x72')]())[_0x3d3d('0x3d')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x3d3d('0x6e')]()[_0x3d3d('0x6f')](_0x3d3d('0x7b'))[_0x3d3d('0x73')](_0x3d3d('0x69'))['where']('CampaignId\x20=\x20?',_0x4e5209[_0x3d3d('0x47')]['id']['toString']())))[_0x3d3d('0x72')]();break;default:_0x4f880c=squel[_0x3d3d('0x67')]()[_0x3d3d('0x68')](_0x3d3d('0x69'))[_0x3d3d('0x6a')](['phone',_0x3d3d('0x6c'),_0x3d3d('0x70'),_0x3d3d('0x6d'),'CampaignId','createdAt','updatedAt'],squel[_0x3d3d('0x6e')]()[_0x3d3d('0x6f')]('phone',_0x3d3d('0x6b'))[_0x3d3d('0x6f')](_0x3d3d('0x7d'),_0x3d3d('0x6c'))[_0x3d3d('0x6f')]('id',_0x3d3d('0x70'))['field'](_0x51d50f['CmListId'][_0x3d3d('0x72')](),_0x3d3d('0x6d'))[_0x3d3d('0x6f')](_0x4e5209[_0x3d3d('0x47')]['id'][_0x3d3d('0x72')](),_0x3d3d('0x56'))[_0x3d3d('0x6f')]('\x27'+_0xf9473d+'\x27',_0x3d3d('0x50'))[_0x3d3d('0x6f')]('\x27'+_0xf9473d+'\x27','updatedAt')[_0x3d3d('0x73')]('cm_contacts')[_0x3d3d('0x3d')](_0x3d3d('0x75'))[_0x3d3d('0x3d')](_0x3d3d('0x76'),_0x51d50f[_0x3d3d('0x71')][_0x3d3d('0x72')]())[_0x3d3d('0x3d')](_0x3d3d('0x7e')))[_0x3d3d('0x72')]();}_0x19a6cf=squel[_0x3d3d('0x67')]()[_0x3d3d('0x68')](_0x3d3d('0x7f'))[_0x3d3d('0x6a')]([_0x3d3d('0x80'),_0x3d3d('0x6c'),_0x3d3d('0x6b'),_0x3d3d('0x81'),_0x3d3d('0x50'),'updatedAt'],squel[_0x3d3d('0x6e')]()[_0x3d3d('0x6f')]('h.id','id')[_0x3d3d('0x6f')](_0x3d3d('0x7d'),'scheduledAt')[_0x3d3d('0x6f')]('ci.item',_0x3d3d('0x6b'))[_0x3d3d('0x6f')](_0x3d3d('0x82'),_0x3d3d('0x81'))[_0x3d3d('0x6f')]('\x27'+_0xf9473d+'\x27',_0x3d3d('0x50'))['field']('\x27'+_0xf9473d+'\x27','updatedAt')[_0x3d3d('0x73')](_0x3d3d('0x83'),'ci')[_0x3d3d('0x84')](_0x3d3d('0x69'),'h',_0x3d3d('0x85'))[_0x3d3d('0x3d')](_0x3d3d('0x86'),_0x51d50f[_0x3d3d('0x71')][_0x3d3d('0x72')]())[_0x3d3d('0x3d')]('h.CampaignId=?',_0x4e5209[_0x3d3d('0x47')]['id']['toString']())[_0x3d3d('0x3d')]('h.createdAt\x20=\x20?',_0xf9473d))[_0x3d3d('0x72')]();_0x12e6cc[_0x3d3d('0x87')](db[_0x3d3d('0x88')]['query'](_0x4f880c));_0x10808a['push'](db['sequelize'][_0x3d3d('0x2f')](_0x19a6cf));}return BPromise[_0x3d3d('0x89')](_0x12e6cc);}})['then'](function(){return BPromise[_0x3d3d('0x89')](_0x10808a);})[_0x3d3d('0x21')](function(){return _0x4dd81a;})[_0x3d3d('0x21')](respondWithResult(_0x47392e,null))[_0x3d3d('0x45')](handleError(_0x47392e,null));};exports['removeLists']=function(_0xede95d,_0x3409f3,_0xa2a580){return db[_0x3d3d('0x41')][_0x3d3d('0x48')]({'where':{'id':_0xede95d[_0x3d3d('0x47')]['id']}})['then'](handleEntityNotFound(_0x3409f3,null))[_0x3d3d('0x21')](function(_0x32b787){if(_0x32b787){return _0x32b787['removeLists'](_0xede95d[_0x3d3d('0x2f')][_0x3d3d('0x63')]);}})[_0x3d3d('0x21')](function(_0x1c246e){if(_0x1c246e){return db[_0x3d3d('0x57')][_0x3d3d('0x24')]({'where':{'ListId':_0xede95d['query'][_0x3d3d('0x63')],'CampaignId':_0xede95d[_0x3d3d('0x47')]['id']}})[_0x3d3d('0x21')](function(){return _0x1c246e;});}})[_0x3d3d('0x21')](respondWithStatusCode(_0x3409f3,null))[_0x3d3d('0x45')](handleError(_0x3409f3,null));};exports[_0x3d3d('0x8a')]=function(_0x2ce4d5,_0x46f091,_0x1b14e0){var _0xb39e95={};var _0x63d492={};var _0x2a73e6;var _0x5b97e7;return db[_0x3d3d('0x41')][_0x3d3d('0x55')]({'where':{'id':_0x2ce4d5['params']['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0x46f091,null))[_0x3d3d('0x21')](function(_0x1cc399){if(_0x1cc399){_0x2a73e6=_0x1cc399;_0x63d492[_0x3d3d('0x31')]=_[_0x3d3d('0x30')](db['CmList'][_0x3d3d('0x2b')]);_0x63d492[_0x3d3d('0x2f')]=_['keys'](_0x2ce4d5[_0x3d3d('0x2f')]);_0x63d492[_0x3d3d('0x3a')]=_[_0x3d3d('0x33')](_0x63d492['model'],_0x63d492[_0x3d3d('0x2f')]);_0xb39e95['attributes']=_['intersection'](_0x63d492[_0x3d3d('0x31')],qs[_0x3d3d('0x34')](_0x2ce4d5['query'][_0x3d3d('0x34')]));_0xb39e95[_0x3d3d('0x32')]=_0xb39e95[_0x3d3d('0x32')][_0x3d3d('0x35')]?_0xb39e95[_0x3d3d('0x32')]:_0x63d492[_0x3d3d('0x31')];_0xb39e95[_0x3d3d('0x38')]=qs[_0x3d3d('0x39')](_0x2ce4d5[_0x3d3d('0x2f')][_0x3d3d('0x39')]);_0xb39e95[_0x3d3d('0x3d')]=qs[_0x3d3d('0x3a')](_[_0x3d3d('0x3b')](_0x2ce4d5[_0x3d3d('0x2f')],_0x63d492[_0x3d3d('0x3a')]));if(_0x2ce4d5[_0x3d3d('0x2f')]['filter']){_0xb39e95[_0x3d3d('0x3d')]=_[_0x3d3d('0x3e')](_0xb39e95[_0x3d3d('0x3d')],{'$or':_[_0x3d3d('0x2a')](_0xb39e95['attributes'],function(_0x5a45a0){var _0x448054={};_0x448054[_0x5a45a0]={'$like':'%'+_0x2ce4d5[_0x3d3d('0x2f')][_0x3d3d('0x3c')]+'%'};return _0x448054;})});}_0xb39e95=_['merge']({},_0xb39e95,_0x2ce4d5[_0x3d3d('0x40')]);return _0x2a73e6[_0x3d3d('0x8a')](_0xb39e95);}})['then'](function(_0x4eb054){if(_0x4eb054){_0x5b97e7=_0x4eb054[_0x3d3d('0x35')];if(!_0x2ce4d5[_0x3d3d('0x2f')][_0x3d3d('0x36')](_0x3d3d('0x37'))){_0xb39e95[_0x3d3d('0x19')]=qs[_0x3d3d('0x19')](_0x2ce4d5[_0x3d3d('0x2f')]['limit']);_0xb39e95[_0x3d3d('0x1b')]=qs['offset'](_0x2ce4d5[_0x3d3d('0x2f')]['offset']);}return _0x2a73e6[_0x3d3d('0x8a')](_0xb39e95);}})[_0x3d3d('0x21')](function(_0x86c019){if(_0x86c019){return _0x86c019?{'count':_0x5b97e7,'rows':_0x86c019}:null;}})['then'](respondWithResult(_0x46f091,null))[_0x3d3d('0x45')](handleError(_0x46f091,null));};exports[_0x3d3d('0x8b')]=function(_0x5a20f4,_0x5bc772,_0x5ee542){var _0x42e28e,_0x2aed8d;var _0xecc5d9=[];var _0x5d498f=moment()[_0x3d3d('0x62')](_0x3d3d('0x8c'));return db['Campaign'][_0x3d3d('0x48')]({'where':{'id':_0x5a20f4[_0x3d3d('0x47')]['id']}})[_0x3d3d('0x21')](handleEntityNotFound(_0x5bc772,null))[_0x3d3d('0x21')](function(_0x92bf6b){if(_0x92bf6b){_0x2aed8d=_0x92bf6b;return _0x92bf6b[_0x3d3d('0x8b')](_0x5a20f4[_0x3d3d('0x52')][_0x3d3d('0x63')],_[_0x3d3d('0x4f')](_0x5a20f4[_0x3d3d('0x52')],['ids','id'])||{});}return null;})['spread'](function(_0x4cf2e7){var _0x1e15b4;var _0xdbfc9e;_0x42e28e=_0x4cf2e7||[];var _0x19438f=[];if(_0x4cf2e7){for(var _0x574b5e=0x0;_0x574b5e<_0x4cf2e7['length'];_0x574b5e+=0x1){var _0x376459=_0x4cf2e7[_0x574b5e][_0x3d3d('0x22')]({'plain':!![]});_0x1e15b4=squel[_0x3d3d('0x67')]()[_0x3d3d('0x68')](_0x3d3d('0x8d'))[_0x3d3d('0x6a')]([_0x3d3d('0x6b'),_0x3d3d('0x70'),_0x3d3d('0x6d'),'CampaignId',_0x3d3d('0x50'),_0x3d3d('0x51')],squel[_0x3d3d('0x6e')]()[_0x3d3d('0x6f')](_0x3d3d('0x6b'),_0x3d3d('0x6b'))['field']('id',_0x3d3d('0x70'))[_0x3d3d('0x6f')](_0x376459['CmListId']['toString'](),_0x3d3d('0x6d'))[_0x3d3d('0x6f')](_0x5a20f4[_0x3d3d('0x47')]['id']['toString'](),_0x3d3d('0x56'))[_0x3d3d('0x6f')]('NOW()',_0x3d3d('0x50'))[_0x3d3d('0x6f')](_0x3d3d('0x7d'),_0x3d3d('0x51'))[_0x3d3d('0x73')](_0x3d3d('0x74'))[_0x3d3d('0x3d')](_0x3d3d('0x75'))['where']('ListId\x20=\x20?',_0x376459['CmListId']['toString']())[_0x3d3d('0x3d')](_0x3d3d('0x7e')))['toString']();_0x19438f[_0x3d3d('0x87')](db['sequelize'][_0x3d3d('0x2f')](_0x1e15b4));}return BPromise[_0x3d3d('0x89')](_0x19438f);}})['then'](function(){return _0x42e28e;})[_0x3d3d('0x21')](respondWithResult(_0x5bc772,null))[_0x3d3d('0x45')](handleError(_0x5bc772,null));};exports['removeBlackLists']=function(_0x5170a8,_0x1d3aa3,_0x7b8ed1){return db['Campaign']['find']({'where':{'id':_0x5170a8['params']['id']}})['then'](handleEntityNotFound(_0x1d3aa3,null))[_0x3d3d('0x21')](function(_0x7b66f6){if(_0x7b66f6){return _0x7b66f6['removeBlackLists'](_0x5170a8['query'][_0x3d3d('0x63')]);}})['then'](function(_0x323172){if(_0x323172){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x5170a8[_0x3d3d('0x2f')]['ids'],'CampaignId':_0x5170a8['params']['id']}})[_0x3d3d('0x21')](function(){return _0x323172;});}})[_0x3d3d('0x21')](respondWithStatusCode(_0x1d3aa3,null))[_0x3d3d('0x45')](handleError(_0x1d3aa3,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 38ff8d6..78f4839 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1f7928,_0xdafed0){var _0x498443=function(_0x2da729){while(--_0x2da729){_0x1f7928['push'](_0x1f7928['shift']());}};_0x498443(++_0xdafed0);}(_0x7a54,0x106));var _0x47a5=function(_0x37adb3,_0x46c3a9){_0x37adb3=_0x37adb3-0x0;var _0x4502f7=_0x7a54[_0x37adb3];return _0x4502f7;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 d593ee1..353969b 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 _0x8b7c=['debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','Campaign','options','where','attributes','limit','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x17b647,_0x3d0d8a){var _0x14d603=function(_0x5d3b75){while(--_0x5d3b75){_0x17b647['push'](_0x17b647['shift']());}};_0x14d603(++_0x3d0d8a);}(_0x8b7c,0x119));var _0xc8b7=function(_0x3c2efd,_0x405f28){_0x3c2efd=_0x3c2efd-0x0;var _0x433b01=_0x8b7c[_0x3c2efd];return _0x433b01;};'use strict';var _=require(_0xc8b7('0x0'));var util=require(_0xc8b7('0x1'));var moment=require(_0xc8b7('0x2'));var BPromise=require(_0xc8b7('0x3'));var rs=require(_0xc8b7('0x4'));var fs=require('fs');var Redis=require(_0xc8b7('0x5'));var db=require(_0xc8b7('0x6'))['db'];var utils=require(_0xc8b7('0x7'));var logger=require('../../config/logger')(_0xc8b7('0x8'));var config=require(_0xc8b7('0x9'));var jayson=require(_0xc8b7('0xa'));var client=jayson['client'][_0xc8b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x90cb38,_0x42d65e,_0x2c7807){return new BPromise(function(_0x9e4763,_0x2f149d){return client['request'](_0x90cb38,_0x2c7807)[_0xc8b7('0xc')](function(_0x504550){logger[_0xc8b7('0xd')](_0xc8b7('0xe'),_0x42d65e,_0xc8b7('0xf'));logger[_0xc8b7('0x10')](_0xc8b7('0x11'),_0x42d65e,'request\x20sent',JSON['stringify'](_0x504550));if(_0x504550['error']){if(_0x504550[_0xc8b7('0x12')][_0xc8b7('0x13')]===0x1f4){logger[_0xc8b7('0x12')](_0xc8b7('0xe'),_0x42d65e,_0x504550['error']['message']);return _0x2f149d(_0x504550['error'][_0xc8b7('0x14')]);}logger[_0xc8b7('0x12')](_0xc8b7('0xe'),_0x42d65e,_0x504550['error'][_0xc8b7('0x14')]);return _0x9e4763(_0x504550[_0xc8b7('0x12')][_0xc8b7('0x14')]);}else{logger[_0xc8b7('0xd')](_0xc8b7('0xe'),_0x42d65e,'request\x20sent');_0x9e4763(_0x504550[_0xc8b7('0x15')][_0xc8b7('0x14')]);}})[_0xc8b7('0x16')](function(_0x3323de){logger[_0xc8b7('0x12')](_0xc8b7('0xe'),_0x42d65e,_0x3323de);_0x2f149d(_0x3323de);});});}exports[_0xc8b7('0x17')]=function(_0x485415){var _0x5ae36a=this;return new Promise(function(_0x1cf47c,_0x403659){return db[_0xc8b7('0x18')]['findAll']({'raw':_0x485415['options']?_0x485415[_0xc8b7('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x485415[_0xc8b7('0x19')]?_0x485415['options'][_0xc8b7('0x1a')]||null:null,'attributes':_0x485415[_0xc8b7('0x19')]?_0x485415['options'][_0xc8b7('0x1b')]||null:null,'limit':_0x485415['options']?_0x485415[_0xc8b7('0x19')][_0xc8b7('0x1c')]||null:null,'include':_0x485415[_0xc8b7('0x19')]?_0x485415['options'][_0xc8b7('0x1d')]?_[_0xc8b7('0x1e')](_0x485415[_0xc8b7('0x19')]['include'],function(_0x3b0e47){return{'model':db[_0x3b0e47[_0xc8b7('0x1f')]],'as':_0x3b0e47['as'],'attributes':_0x3b0e47[_0xc8b7('0x1b')],'include':_0x3b0e47[_0xc8b7('0x1d')]?_[_0xc8b7('0x1e')](_0x3b0e47[_0xc8b7('0x1d')],function(_0x2acda2){return{'model':db[_0x2acda2[_0xc8b7('0x1f')]],'as':_0x2acda2['as'],'attributes':_0x2acda2[_0xc8b7('0x1b')],'include':_0x2acda2[_0xc8b7('0x1d')]?_[_0xc8b7('0x1e')](_0x2acda2['include'],function(_0x28e65d){return{'model':db[_0x28e65d[_0xc8b7('0x1f')]],'as':_0x28e65d['as'],'attributes':_0x28e65d[_0xc8b7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc8b7('0xc')](function(_0x2046f5){logger[_0xc8b7('0xd')]('GetCampaign',_0x485415);logger['debug'](_0xc8b7('0x17'),_0x485415,JSON[_0xc8b7('0x20')](_0x2046f5));_0x1cf47c(_0x2046f5);})[_0xc8b7('0x16')](function(_0x2a2b25){logger[_0xc8b7('0x12')](_0xc8b7('0x17'),_0x2a2b25[_0xc8b7('0x14')],_0x485415);_0x403659(_0x5ae36a['error'](0x1f4,_0x2a2b25[_0xc8b7('0x14')]));});});}; \ No newline at end of file +var _0x37b4=['stringify','error','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','options','attributes','include','map','model','then','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','info','request\x20sent'];(function(_0x3cf68c,_0x32feab){var _0x741a2c=function(_0x108349){while(--_0x108349){_0x3cf68c['push'](_0x3cf68c['shift']());}};_0x741a2c(++_0x32feab);}(_0x37b4,0xef));var _0x437b=function(_0x12833b,_0x26c1d2){_0x12833b=_0x12833b-0x0;var _0x3acad3=_0x37b4[_0x12833b];return _0x3acad3;};'use strict';var _=require(_0x437b('0x0'));var util=require('util');var moment=require(_0x437b('0x1'));var BPromise=require(_0x437b('0x2'));var rs=require(_0x437b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x437b('0x4'))['db'];var utils=require(_0x437b('0x5'));var logger=require(_0x437b('0x6'))(_0x437b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x437b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c7dea,_0x4aada7,_0x226e3c){return new BPromise(function(_0x5df980,_0x432b63){return client['request'](_0x3c7dea,_0x226e3c)['then'](function(_0x44bf1d){logger[_0x437b('0x9')]('Campaign,\x20%s,\x20%s',_0x4aada7,_0x437b('0xa'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x4aada7,_0x437b('0xa'),JSON[_0x437b('0xb')](_0x44bf1d));if(_0x44bf1d[_0x437b('0xc')]){if(_0x44bf1d[_0x437b('0xc')]['code']===0x1f4){logger[_0x437b('0xc')](_0x437b('0xd'),_0x4aada7,_0x44bf1d[_0x437b('0xc')]['message']);return _0x432b63(_0x44bf1d[_0x437b('0xc')][_0x437b('0xe')]);}logger[_0x437b('0xc')]('Campaign,\x20%s,\x20%s',_0x4aada7,_0x44bf1d[_0x437b('0xc')]['message']);return _0x5df980(_0x44bf1d[_0x437b('0xc')][_0x437b('0xe')]);}else{logger[_0x437b('0x9')]('Campaign,\x20%s,\x20%s',_0x4aada7,_0x437b('0xa'));_0x5df980(_0x44bf1d[_0x437b('0xf')][_0x437b('0xe')]);}})[_0x437b('0x10')](function(_0x1d31af){logger[_0x437b('0xc')]('Campaign,\x20%s,\x20%s',_0x4aada7,_0x1d31af);_0x432b63(_0x1d31af);});});}exports[_0x437b('0x11')]=function(_0x501d8c){var _0x2b3994=this;return new Promise(function(_0x107024,_0x1c91bc){return db[_0x437b('0x12')]['findAll']({'raw':_0x501d8c['options']?_0x501d8c['options']['raw']===undefined?!![]:![]:!![],'where':_0x501d8c[_0x437b('0x13')]?_0x501d8c[_0x437b('0x13')]['where']||null:null,'attributes':_0x501d8c[_0x437b('0x13')]?_0x501d8c['options'][_0x437b('0x14')]||null:null,'limit':_0x501d8c[_0x437b('0x13')]?_0x501d8c[_0x437b('0x13')]['limit']||null:null,'include':_0x501d8c['options']?_0x501d8c['options'][_0x437b('0x15')]?_[_0x437b('0x16')](_0x501d8c[_0x437b('0x13')][_0x437b('0x15')],function(_0x8c5852){return{'model':db[_0x8c5852[_0x437b('0x17')]],'as':_0x8c5852['as'],'attributes':_0x8c5852[_0x437b('0x14')],'include':_0x8c5852[_0x437b('0x15')]?_[_0x437b('0x16')](_0x8c5852[_0x437b('0x15')],function(_0x258198){return{'model':db[_0x258198['model']],'as':_0x258198['as'],'attributes':_0x258198[_0x437b('0x14')],'include':_0x258198[_0x437b('0x15')]?_[_0x437b('0x16')](_0x258198[_0x437b('0x15')],function(_0x17092c){return{'model':db[_0x17092c['model']],'as':_0x17092c['as'],'attributes':_0x17092c[_0x437b('0x14')]};}):[]};}):[]};}):[]:[]})[_0x437b('0x18')](function(_0x4a7d0b){logger[_0x437b('0x9')]('GetCampaign',_0x501d8c);logger['debug']('GetCampaign',_0x501d8c,JSON[_0x437b('0xb')](_0x4a7d0b));_0x107024(_0x4a7d0b);})['catch'](function(_0x37a3d7){logger[_0x437b('0xc')](_0x437b('0x11'),_0x37a3d7['message'],_0x501d8c);_0x1c91bc(_0x2b3994['error'](0x1f4,_0x37a3d7[_0x437b('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index d9bf349..370caae 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 _0xd164=['addLists','/:id/blacklists','put','update','delete','destroy','removeBlackLists','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getBlackLists','create','post','/:id/clone'];(function(_0x16aa10,_0xc22da3){var _0x3bc706=function(_0x1fd6a7){while(--_0x1fd6a7){_0x16aa10['push'](_0x16aa10['shift']());}};_0x3bc706(++_0xc22da3);}(_0xd164,0x9e));var _0x4d16=function(_0x3ac201,_0x2ffa10){_0x3ac201=_0x3ac201-0x0;var _0x29b81d=_0xd164[_0x3ac201];return _0x29b81d;};'use strict';var multer=require('multer');var util=require(_0x4d16('0x0'));var path=require(_0x4d16('0x1'));var timeout=require(_0x4d16('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4d16('0x3'));var auth=require(_0x4d16('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4d16('0x5'));var controller=require('./campaign.controller');router[_0x4d16('0x6')]('/',auth[_0x4d16('0x7')](),controller['index']);router['get'](_0x4d16('0x8'),auth[_0x4d16('0x7')](),controller[_0x4d16('0x9')]);router[_0x4d16('0x6')](_0x4d16('0xa'),auth['isAuthenticated'](),controller[_0x4d16('0xb')]);router[_0x4d16('0x6')]('/:id/hopper_histories',auth[_0x4d16('0x7')](),controller[_0x4d16('0xc')]);router[_0x4d16('0x6')](_0x4d16('0xd'),auth[_0x4d16('0x7')](),controller[_0x4d16('0xe')]);router['get'](_0x4d16('0xf'),auth[_0x4d16('0x7')](),controller[_0x4d16('0x10')]);router[_0x4d16('0x6')](_0x4d16('0x11'),auth[_0x4d16('0x7')](),controller['getLists']);router['get']('/:id/blacklists',auth[_0x4d16('0x7')](),controller[_0x4d16('0x12')]);router['post']('/',auth[_0x4d16('0x7')](),controller[_0x4d16('0x13')]);router[_0x4d16('0x14')](_0x4d16('0x15'),auth[_0x4d16('0x7')](),controller['clone']);router[_0x4d16('0x14')](_0x4d16('0x11'),auth[_0x4d16('0x7')](),controller[_0x4d16('0x16')]);router['post'](_0x4d16('0x17'),auth[_0x4d16('0x7')](),controller['addBlackLists']);router[_0x4d16('0x18')](_0x4d16('0x8'),auth[_0x4d16('0x7')](),controller[_0x4d16('0x19')]);router[_0x4d16('0x1a')](_0x4d16('0x8'),auth[_0x4d16('0x7')](),controller[_0x4d16('0x1b')]);router[_0x4d16('0x1a')](_0x4d16('0x11'),auth[_0x4d16('0x7')](),controller['removeLists']);router['delete'](_0x4d16('0x17'),auth[_0x4d16('0x7')](),controller[_0x4d16('0x1c')]);module[_0x4d16('0x1d')]=router; \ No newline at end of file +var _0x8f2e=['put','update','delete','destroy','removeLists','removeBlackLists','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists'];(function(_0x25b606,_0x25d3b2){var _0x148b67=function(_0x5b7d74){while(--_0x5b7d74){_0x25b606['push'](_0x25b606['shift']());}};_0x148b67(++_0x25d3b2);}(_0x8f2e,0xb0));var _0xe8f2=function(_0x46ba64,_0x55b3e7){_0x46ba64=_0x46ba64-0x0;var _0x2f6edb=_0x8f2e[_0x46ba64];return _0x2f6edb;};'use strict';var multer=require(_0xe8f2('0x0'));var util=require('util');var path=require(_0xe8f2('0x1'));var timeout=require('connect-timeout');var express=require(_0xe8f2('0x2'));var router=express[_0xe8f2('0x3')]();var fs_extra=require(_0xe8f2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe8f2('0x5'));var config=require(_0xe8f2('0x6'));var controller=require(_0xe8f2('0x7'));router[_0xe8f2('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe8f2('0x9'),auth[_0xe8f2('0xa')](),controller[_0xe8f2('0xb')]);router[_0xe8f2('0x8')](_0xe8f2('0xc'),auth['isAuthenticated'](),controller[_0xe8f2('0xd')]);router[_0xe8f2('0x8')](_0xe8f2('0xe'),auth['isAuthenticated'](),controller[_0xe8f2('0xf')]);router['get'](_0xe8f2('0x10'),auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x11')]);router['get'](_0xe8f2('0x12'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xe8f2('0x8')](_0xe8f2('0x13'),auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x14')]);router[_0xe8f2('0x8')](_0xe8f2('0x15'),auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x16')]);router[_0xe8f2('0x17')]('/',auth['isAuthenticated'](),controller[_0xe8f2('0x18')]);router[_0xe8f2('0x17')](_0xe8f2('0x19'),auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x1a')]);router['post']('/:id/lists',auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x1b')]);router[_0xe8f2('0x17')](_0xe8f2('0x15'),auth[_0xe8f2('0xa')](),controller['addBlackLists']);router[_0xe8f2('0x1c')](_0xe8f2('0x9'),auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x1d')]);router[_0xe8f2('0x1e')](_0xe8f2('0x9'),auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x1f')]);router[_0xe8f2('0x1e')](_0xe8f2('0x13'),auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x20')]);router[_0xe8f2('0x1e')]('/:id/blacklists',auth[_0xe8f2('0xa')](),controller[_0xe8f2('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 4d017c3..d0370e9 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 _0x8535=['VIRTUAL','getDataValue','key','exports','TEXT','medium'];(function(_0xac4af,_0x309efb){var _0x473b46=function(_0x1bb587){while(--_0x1bb587){_0xac4af['push'](_0xac4af['shift']());}};_0x473b46(++_0x309efb);}(_0x8535,0x13b));var _0x5853=function(_0x56ceb5,_0x517b43){_0x56ceb5=_0x56ceb5-0x0;var _0x24139c=_0x8535[_0x56ceb5];return _0x24139c;};'use strict';var Sequelize=require('sequelize');module[_0x5853('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x5853('0x1')],'length':_0x5853('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x5853('0x3')],'get':function(){return this[_0x5853('0x4')](_0x5853('0x5'));}}}; \ No newline at end of file +var _0x422d=['key','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0xc898bb,_0x51b13a){var _0x2b8ca6=function(_0x5b3ecf){while(--_0x5b3ecf){_0xc898bb['push'](_0xc898bb['shift']());}};_0x2b8ca6(++_0x51b13a);}(_0x422d,0x18d));var _0xd422=function(_0x18a0da,_0x8cb375){_0x18a0da=_0x18a0da-0x0;var _0x3cf6b8=_0x422d[_0x18a0da];return _0x3cf6b8;};'use strict';var Sequelize=require(_0xd422('0x0'));module[_0xd422('0x1')]={'key':{'type':Sequelize[_0xd422('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xd422('0x3')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0xd422('0x2')]},'name':{'type':Sequelize[_0xd422('0x4')],'get':function(){return this['getDataValue'](_0xd422('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 5b4e3d6..56cf2c3 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 _0x6b14=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','name','index','map','CannedAnswer','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','length','options','find','params','destroy','create','MailAccountId','body','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','UserProfileResource'];(function(_0x2b72c0,_0x1bc08f){var _0x12af91=function(_0x5ccb77){while(--_0x5ccb77){_0x2b72c0['push'](_0x2b72c0['shift']());}};_0x12af91(++_0x1bc08f);}(_0x6b14,0x168));var _0x46b1=function(_0x5b5fa6,_0x26eb1f){_0x5b5fa6=_0x5b5fa6-0x0;var _0x2a06b4=_0x6b14[_0x5b5fa6];return _0x2a06b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x46b1('0x0'));var zipdir=require(_0x46b1('0x1'));var jsonpatch=require(_0x46b1('0x2'));var rp=require('request-promise');var moment=require(_0x46b1('0x3'));var BPromise=require(_0x46b1('0x4'));var Mustache=require(_0x46b1('0x5'));var util=require(_0x46b1('0x6'));var path=require(_0x46b1('0x7'));var sox=require(_0x46b1('0x8'));var csv=require(_0x46b1('0x9'));var ejs=require(_0x46b1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46b1('0xb'));var squel=require(_0x46b1('0xc'));var crypto=require('crypto');var jsforce=require(_0x46b1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x46b1('0x9'));var querystring=require(_0x46b1('0xe'));var Papa=require(_0x46b1('0xf'));var Redis=require(_0x46b1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x46b1('0x11'));var as=require(_0x46b1('0x12'));var hardwareService=require(_0x46b1('0x13'));var logger=require(_0x46b1('0x14'))(_0x46b1('0x15'));var utils=require('../../config/utils');var config=require(_0x46b1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x46b1('0x17'))['db'];function respondWithStatusCode(_0x484a7d,_0x3043a3){_0x3043a3=_0x3043a3||0xcc;return function(_0x90a936){if(_0x90a936){return _0x484a7d['sendStatus'](_0x3043a3);}return _0x484a7d['status'](_0x3043a3)[_0x46b1('0x18')]();};}function respondWithResult(_0x5006be,_0x2f9d78){_0x2f9d78=_0x2f9d78||0xc8;return function(_0xdc5b85){if(_0xdc5b85){return _0x5006be[_0x46b1('0x19')](_0x2f9d78)['json'](_0xdc5b85);}};}function respondWithFilteredResult(_0x49e1d7,_0x5022d3){return function(_0x4667cd){if(_0x4667cd){var _0x28367e=typeof _0x5022d3[_0x46b1('0x1a')]==='undefined'&&typeof _0x5022d3[_0x46b1('0x1b')]===_0x46b1('0x1c');var _0x448495=_0x4667cd['count'];var _0x398923=_0x28367e?0x0:_0x5022d3[_0x46b1('0x1a')];var _0x545b74=_0x28367e?_0x4667cd[_0x46b1('0x1d')]:_0x5022d3['offset']+_0x5022d3[_0x46b1('0x1b')];var _0x95e9da;if(_0x545b74>=_0x448495){_0x545b74=_0x448495;_0x95e9da=0xc8;}else{_0x95e9da=0xce;}_0x49e1d7['status'](_0x95e9da);return _0x49e1d7[_0x46b1('0x1e')](_0x46b1('0x1f'),_0x398923+'-'+_0x545b74+'/'+_0x448495)[_0x46b1('0x20')](_0x4667cd);}return null;};}function patchUpdates(_0x27d281){return function(_0x5b3061){try{jsonpatch[_0x46b1('0x21')](_0x5b3061,_0x27d281,!![]);}catch(_0x4eaa8c){return BPromise[_0x46b1('0x22')](_0x4eaa8c);}return _0x5b3061[_0x46b1('0x23')]();};}function saveUpdates(_0x5bffde,_0x189ec6){return function(_0x17b600){if(_0x17b600){return _0x17b600[_0x46b1('0x24')](_0x5bffde)[_0x46b1('0x25')](function(_0x47be61){return _0x47be61;});}return null;};}function removeEntity(_0x22884b,_0x27e86b){return function(_0x4e202f){if(_0x4e202f){return _0x4e202f['destroy']()[_0x46b1('0x25')](function(){var _0x40f5de=_0x4e202f['get']({'plain':!![]});var _0x425e94='CannedAnswers';return db['UserProfileResource']['destroy']({'where':{'type':_0x425e94,'resourceId':_0x40f5de['id']}})[_0x46b1('0x25')](function(){return _0x4e202f;});})[_0x46b1('0x25')](function(){_0x22884b[_0x46b1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3539,_0x2dbcea){return function(_0xbfd9ac){if(!_0xbfd9ac){_0x2d3539[_0x46b1('0x26')](0x194);}return _0xbfd9ac;};}function handleError(_0x4d5e1a,_0x28575a){_0x28575a=_0x28575a||0x1f4;return function(_0x10985d){logger[_0x46b1('0x27')](_0x10985d['stack']);if(_0x10985d[_0x46b1('0x28')]){delete _0x10985d[_0x46b1('0x28')];}_0x4d5e1a[_0x46b1('0x19')](_0x28575a)['send'](_0x10985d);};}exports[_0x46b1('0x29')]=function(_0xc8d1bb,_0x4b7aca){var _0x21594b={},_0x170ae4={},_0x3f4a4e={'count':0x0,'rows':[]};var _0x3664d2=_[_0x46b1('0x2a')](db[_0x46b1('0x2b')]['rawAttributes'],function(_0x5c3df3){return{'name':_0x5c3df3[_0x46b1('0x2c')],'type':_0x5c3df3['type'][_0x46b1('0x2d')]};});_0x170ae4[_0x46b1('0x2e')]=_['map'](_0x3664d2,_0x46b1('0x28'));_0x170ae4[_0x46b1('0x2f')]=_[_0x46b1('0x30')](_0xc8d1bb[_0x46b1('0x2f')]);_0x170ae4[_0x46b1('0x31')]=_[_0x46b1('0x32')](_0x170ae4[_0x46b1('0x2e')],_0x170ae4[_0x46b1('0x2f')]);_0x21594b[_0x46b1('0x33')]=_[_0x46b1('0x32')](_0x170ae4['model'],qs[_0x46b1('0x34')](_0xc8d1bb['query']['fields']));_0x21594b[_0x46b1('0x33')]=_0x21594b[_0x46b1('0x33')]['length']?_0x21594b['attributes']:_0x170ae4[_0x46b1('0x2e')];if(!_0xc8d1bb['query'][_0x46b1('0x35')](_0x46b1('0x36'))){_0x21594b[_0x46b1('0x1b')]=qs[_0x46b1('0x1b')](_0xc8d1bb[_0x46b1('0x2f')][_0x46b1('0x1b')]);_0x21594b['offset']=qs[_0x46b1('0x1a')](_0xc8d1bb[_0x46b1('0x2f')][_0x46b1('0x1a')]);}_0x21594b[_0x46b1('0x37')]=qs['sort'](_0xc8d1bb[_0x46b1('0x2f')][_0x46b1('0x38')]);_0x21594b[_0x46b1('0x39')]=qs[_0x46b1('0x31')](_[_0x46b1('0x3a')](_0xc8d1bb[_0x46b1('0x2f')],_0x170ae4[_0x46b1('0x31')]),_0x3664d2);if(_0xc8d1bb[_0x46b1('0x2f')][_0x46b1('0x3b')]){_0x21594b[_0x46b1('0x39')]=_[_0x46b1('0x3c')](_0x21594b[_0x46b1('0x39')],{'$or':[{'key':{'$like':'%'+_0xc8d1bb[_0x46b1('0x2f')][_0x46b1('0x3b')]+'%'}},{'value':{'$like':'%'+_0xc8d1bb[_0x46b1('0x2f')]['filter']+'%'}}]});}_0x21594b=_[_0x46b1('0x3c')]({},_0x21594b,_0xc8d1bb['options']);var _0x2c08ce={'where':_0x21594b[_0x46b1('0x39')]};return db[_0x46b1('0x2b')]['count'](_0x2c08ce)[_0x46b1('0x25')](function(_0x4d861f){_0x3f4a4e[_0x46b1('0x1d')]=_0x4d861f;if(_0xc8d1bb[_0x46b1('0x2f')][_0x46b1('0x3d')]){_0x21594b[_0x46b1('0x3e')]=[{'all':!![]}];}return db[_0x46b1('0x2b')][_0x46b1('0x3f')](_0x21594b);})[_0x46b1('0x25')](function(_0x4626ab){_0x3f4a4e[_0x46b1('0x40')]=_0x4626ab;return _0x3f4a4e;})[_0x46b1('0x25')](respondWithFilteredResult(_0x4b7aca,_0x21594b))[_0x46b1('0x41')](handleError(_0x4b7aca,null));};exports[_0x46b1('0x42')]=function(_0x473d6d,_0x5731f9){var _0x69e58d={'raw':!![],'where':{'id':_0x473d6d['params']['id']}},_0x329ee4={};_0x329ee4['model']=_['keys'](db[_0x46b1('0x2b')]['rawAttributes']);_0x329ee4[_0x46b1('0x2f')]=_[_0x46b1('0x30')](_0x473d6d[_0x46b1('0x2f')]);_0x329ee4[_0x46b1('0x31')]=_[_0x46b1('0x32')](_0x329ee4['model'],_0x329ee4[_0x46b1('0x2f')]);_0x69e58d[_0x46b1('0x33')]=_['intersection'](_0x329ee4[_0x46b1('0x2e')],qs['fields'](_0x473d6d[_0x46b1('0x2f')][_0x46b1('0x34')]));_0x69e58d['attributes']=_0x69e58d[_0x46b1('0x33')][_0x46b1('0x43')]?_0x69e58d[_0x46b1('0x33')]:_0x329ee4[_0x46b1('0x2e')];if(_0x473d6d['query'][_0x46b1('0x3d')]){_0x69e58d['include']=[{'all':!![]}];}_0x69e58d=_[_0x46b1('0x3c')]({},_0x69e58d,_0x473d6d[_0x46b1('0x44')]);return db[_0x46b1('0x2b')]['find'](_0x69e58d)[_0x46b1('0x25')](handleEntityNotFound(_0x5731f9,null))[_0x46b1('0x25')](respondWithResult(_0x5731f9,null))['catch'](handleError(_0x5731f9,null));};exports['update']=function(_0x4e4601,_0x1ae613){if(_0x4e4601['body']['id']){delete _0x4e4601['body']['id'];}return db[_0x46b1('0x2b')][_0x46b1('0x45')]({'where':{'id':_0x4e4601[_0x46b1('0x46')]['id']}})[_0x46b1('0x25')](handleEntityNotFound(_0x1ae613,null))[_0x46b1('0x25')](saveUpdates(_0x4e4601['body'],null))[_0x46b1('0x25')](respondWithResult(_0x1ae613,null))[_0x46b1('0x41')](handleError(_0x1ae613,null));};exports[_0x46b1('0x47')]=function(_0x107624,_0x3fb7d9){return db['CannedAnswer'][_0x46b1('0x45')]({'where':{'id':_0x107624[_0x46b1('0x46')]['id']}})[_0x46b1('0x25')](handleEntityNotFound(_0x3fb7d9,null))[_0x46b1('0x25')](removeEntity(_0x3fb7d9,null))[_0x46b1('0x41')](handleError(_0x3fb7d9,null));};exports[_0x46b1('0x48')]=function(_0x58c45e,_0x19a491){var _0xdb29e7={'key':_0x58c45e['body'][_0x46b1('0x2d')]};if(_0x58c45e['body'][_0x46b1('0x49')]){_0xdb29e7['MailAccountId']=_0x58c45e[_0x46b1('0x4a')][_0x46b1('0x49')];}else if(_0x58c45e[_0x46b1('0x4a')][_0x46b1('0x4b')]){_0xdb29e7[_0x46b1('0x4b')]=_0x58c45e['body'][_0x46b1('0x4b')];}else if(_0x58c45e[_0x46b1('0x4a')]['OpenchannelAccountId']){_0xdb29e7['OpenchannelAccountId']=_0x58c45e['body'][_0x46b1('0x4c')];}else if(_0x58c45e['body'][_0x46b1('0x4d')]){_0xdb29e7[_0x46b1('0x4d')]=_0x58c45e[_0x46b1('0x4a')][_0x46b1('0x4d')];}return db[_0x46b1('0x2b')][_0x46b1('0x45')]({'where':_0xdb29e7})[_0x46b1('0x25')](function(_0x43603d){if(_0x43603d){throw new db[(_0x46b1('0x4e'))][(_0x46b1('0x4f'))](_0x46b1('0x50'));}return db['CannedAnswer'][_0x46b1('0x48')](_0x58c45e[_0x46b1('0x4a')]);})['then'](function(_0x36fcdd){var _0x1299fb=_0x58c45e['user']['get']({'plain':!![]});if(!_0x1299fb)throw new Error(_0x46b1('0x51'));if(_0x1299fb[_0x46b1('0x52')]===_0x46b1('0x53')){var _0x597cb2=_0x36fcdd[_0x46b1('0x54')]({'plain':!![]});return db[_0x46b1('0x55')]['find']({'where':{'name':_0x46b1('0x56'),'userProfileId':_0x1299fb[_0x46b1('0x57')]},'raw':!![]})[_0x46b1('0x25')](function(_0x587cb1){if(_0x587cb1&&_0x587cb1[_0x46b1('0x58')]===0x0){return db[_0x46b1('0x59')][_0x46b1('0x48')]({'name':_0x597cb2[_0x46b1('0x28')],'resourceId':_0x597cb2['id'],'type':_0x587cb1['name'],'sectionId':_0x587cb1['id']},{})[_0x46b1('0x25')](function(){return _0x36fcdd;});}else{return _0x36fcdd;}})[_0x46b1('0x41')](function(_0x711ab5){logger[_0x46b1('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x711ab5);throw _0x711ab5;});}return _0x36fcdd;})[_0x46b1('0x25')](respondWithResult(_0x19a491,0xc9))[_0x46b1('0x41')](handleError(_0x19a491,null));}; \ No newline at end of file +var _0x2671=['filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','UserProfileSection','CannedAnswers','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','status','end','json','limit','undefined','offset','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','type','key','query','keys','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x2671,0x165));var _0x1267=function(_0x35b87c,_0x166a8c){_0x35b87c=_0x35b87c-0x0;var _0x24795b=_0x2671[_0x35b87c];return _0x24795b;};'use strict';var emlformat=require(_0x1267('0x0'));var rimraf=require(_0x1267('0x1'));var zipdir=require(_0x1267('0x2'));var jsonpatch=require(_0x1267('0x3'));var rp=require(_0x1267('0x4'));var moment=require(_0x1267('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1267('0x6'));var util=require('util');var path=require('path');var sox=require(_0x1267('0x7'));var csv=require(_0x1267('0x8'));var ejs=require(_0x1267('0x9'));var fs=require('fs');var fs_extra=require(_0x1267('0xa'));var _=require('lodash');var squel=require(_0x1267('0xb'));var crypto=require(_0x1267('0xc'));var jsforce=require(_0x1267('0xd'));var deskjs=require(_0x1267('0xe'));var toCsv=require(_0x1267('0x8'));var querystring=require(_0x1267('0xf'));var Papa=require('papaparse');var Redis=require(_0x1267('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1267('0x11'));var hardwareService=require(_0x1267('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x1267('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x68e727,_0x4936a9){_0x4936a9=_0x4936a9||0xcc;return function(_0x2a51b4){if(_0x2a51b4){return _0x68e727[_0x1267('0x14')](_0x4936a9);}return _0x68e727[_0x1267('0x15')](_0x4936a9)[_0x1267('0x16')]();};}function respondWithResult(_0x522cca,_0xf0b899){_0xf0b899=_0xf0b899||0xc8;return function(_0x36ccc1){if(_0x36ccc1){return _0x522cca[_0x1267('0x15')](_0xf0b899)[_0x1267('0x17')](_0x36ccc1);}};}function respondWithFilteredResult(_0x36d02e,_0x220815){return function(_0x366631){if(_0x366631){var _0x2b740f=typeof _0x220815['offset']==='undefined'&&typeof _0x220815[_0x1267('0x18')]===_0x1267('0x19');var _0x24bfb6=_0x366631['count'];var _0x2e33e9=_0x2b740f?0x0:_0x220815[_0x1267('0x1a')];var _0x20840f=_0x2b740f?_0x366631[_0x1267('0x1b')]:_0x220815['offset']+_0x220815[_0x1267('0x18')];var _0x1047ef;if(_0x20840f>=_0x24bfb6){_0x20840f=_0x24bfb6;_0x1047ef=0xc8;}else{_0x1047ef=0xce;}_0x36d02e['status'](_0x1047ef);return _0x36d02e[_0x1267('0x1c')]('Content-Range',_0x2e33e9+'-'+_0x20840f+'/'+_0x24bfb6)[_0x1267('0x17')](_0x366631);}return null;};}function patchUpdates(_0x27b4b7){return function(_0x520066){try{jsonpatch[_0x1267('0x1d')](_0x520066,_0x27b4b7,!![]);}catch(_0x3652dc){return BPromise[_0x1267('0x1e')](_0x3652dc);}return _0x520066[_0x1267('0x1f')]();};}function saveUpdates(_0x1928aa,_0x4862d4){return function(_0x5bf4cf){if(_0x5bf4cf){return _0x5bf4cf[_0x1267('0x20')](_0x1928aa)[_0x1267('0x21')](function(_0xcab624){return _0xcab624;});}return null;};}function removeEntity(_0x28f2e5,_0x51571f){return function(_0x4ff670){if(_0x4ff670){return _0x4ff670[_0x1267('0x22')]()[_0x1267('0x21')](function(){var _0x3f4729=_0x4ff670[_0x1267('0x23')]({'plain':!![]});var _0x502397='CannedAnswers';return db[_0x1267('0x24')]['destroy']({'where':{'type':_0x502397,'resourceId':_0x3f4729['id']}})[_0x1267('0x21')](function(){return _0x4ff670;});})[_0x1267('0x21')](function(){_0x28f2e5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b4286,_0x2040d3){return function(_0x1ee27b){if(!_0x1ee27b){_0x4b4286['sendStatus'](0x194);}return _0x1ee27b;};}function handleError(_0x5707c1,_0x1665a1){_0x1665a1=_0x1665a1||0x1f4;return function(_0x364ac6){logger[_0x1267('0x25')](_0x364ac6[_0x1267('0x26')]);if(_0x364ac6[_0x1267('0x27')]){delete _0x364ac6[_0x1267('0x27')];}_0x5707c1[_0x1267('0x15')](_0x1665a1)['send'](_0x364ac6);};}exports[_0x1267('0x28')]=function(_0x598853,_0x50b7e3){var _0x3ae431={},_0x1561f9={},_0x52ec9c={'count':0x0,'rows':[]};var _0x5df264=_[_0x1267('0x29')](db['CannedAnswer']['rawAttributes'],function(_0xc6411c){return{'name':_0xc6411c['fieldName'],'type':_0xc6411c[_0x1267('0x2a')][_0x1267('0x2b')]};});_0x1561f9['model']=_[_0x1267('0x29')](_0x5df264,'name');_0x1561f9[_0x1267('0x2c')]=_[_0x1267('0x2d')](_0x598853[_0x1267('0x2c')]);_0x1561f9[_0x1267('0x2e')]=_['intersection'](_0x1561f9['model'],_0x1561f9[_0x1267('0x2c')]);_0x3ae431[_0x1267('0x2f')]=_[_0x1267('0x30')](_0x1561f9['model'],qs[_0x1267('0x31')](_0x598853['query']['fields']));_0x3ae431[_0x1267('0x2f')]=_0x3ae431['attributes'][_0x1267('0x32')]?_0x3ae431['attributes']:_0x1561f9[_0x1267('0x33')];if(!_0x598853[_0x1267('0x2c')][_0x1267('0x34')](_0x1267('0x35'))){_0x3ae431[_0x1267('0x18')]=qs['limit'](_0x598853[_0x1267('0x2c')][_0x1267('0x18')]);_0x3ae431['offset']=qs[_0x1267('0x1a')](_0x598853[_0x1267('0x2c')]['offset']);}_0x3ae431[_0x1267('0x36')]=qs[_0x1267('0x37')](_0x598853[_0x1267('0x2c')]['sort']);_0x3ae431[_0x1267('0x38')]=qs[_0x1267('0x2e')](_[_0x1267('0x39')](_0x598853[_0x1267('0x2c')],_0x1561f9[_0x1267('0x2e')]),_0x5df264);if(_0x598853[_0x1267('0x2c')][_0x1267('0x3a')]){_0x3ae431[_0x1267('0x38')]=_['merge'](_0x3ae431[_0x1267('0x38')],{'$or':[{'key':{'$like':'%'+_0x598853[_0x1267('0x2c')][_0x1267('0x3a')]+'%'}},{'value':{'$like':'%'+_0x598853[_0x1267('0x2c')][_0x1267('0x3a')]+'%'}}]});}_0x3ae431=_[_0x1267('0x3b')]({},_0x3ae431,_0x598853[_0x1267('0x3c')]);var _0x367ec1={'where':_0x3ae431[_0x1267('0x38')]};return db[_0x1267('0x3d')][_0x1267('0x1b')](_0x367ec1)[_0x1267('0x21')](function(_0x1e11c4){_0x52ec9c[_0x1267('0x1b')]=_0x1e11c4;if(_0x598853[_0x1267('0x2c')][_0x1267('0x3e')]){_0x3ae431[_0x1267('0x3f')]=[{'all':!![]}];}return db[_0x1267('0x3d')][_0x1267('0x40')](_0x3ae431);})['then'](function(_0x66e9c){_0x52ec9c[_0x1267('0x41')]=_0x66e9c;return _0x52ec9c;})[_0x1267('0x21')](respondWithFilteredResult(_0x50b7e3,_0x3ae431))[_0x1267('0x42')](handleError(_0x50b7e3,null));};exports[_0x1267('0x43')]=function(_0xef9a7a,_0x398f9d){var _0x363dcf={'raw':!![],'where':{'id':_0xef9a7a[_0x1267('0x44')]['id']}},_0x2076d9={};_0x2076d9[_0x1267('0x33')]=_[_0x1267('0x2d')](db['CannedAnswer'][_0x1267('0x45')]);_0x2076d9[_0x1267('0x2c')]=_[_0x1267('0x2d')](_0xef9a7a[_0x1267('0x2c')]);_0x2076d9[_0x1267('0x2e')]=_[_0x1267('0x30')](_0x2076d9[_0x1267('0x33')],_0x2076d9[_0x1267('0x2c')]);_0x363dcf[_0x1267('0x2f')]=_[_0x1267('0x30')](_0x2076d9[_0x1267('0x33')],qs[_0x1267('0x31')](_0xef9a7a['query'][_0x1267('0x31')]));_0x363dcf['attributes']=_0x363dcf[_0x1267('0x2f')]['length']?_0x363dcf[_0x1267('0x2f')]:_0x2076d9[_0x1267('0x33')];if(_0xef9a7a[_0x1267('0x2c')][_0x1267('0x3e')]){_0x363dcf['include']=[{'all':!![]}];}_0x363dcf=_[_0x1267('0x3b')]({},_0x363dcf,_0xef9a7a[_0x1267('0x3c')]);return db[_0x1267('0x3d')][_0x1267('0x46')](_0x363dcf)[_0x1267('0x21')](handleEntityNotFound(_0x398f9d,null))[_0x1267('0x21')](respondWithResult(_0x398f9d,null))[_0x1267('0x42')](handleError(_0x398f9d,null));};exports['update']=function(_0x298058,_0x28c0dc){if(_0x298058[_0x1267('0x47')]['id']){delete _0x298058[_0x1267('0x47')]['id'];}return db[_0x1267('0x3d')]['find']({'where':{'id':_0x298058['params']['id']}})[_0x1267('0x21')](handleEntityNotFound(_0x28c0dc,null))[_0x1267('0x21')](saveUpdates(_0x298058[_0x1267('0x47')],null))[_0x1267('0x21')](respondWithResult(_0x28c0dc,null))[_0x1267('0x42')](handleError(_0x28c0dc,null));};exports[_0x1267('0x22')]=function(_0x45896b,_0xcc05d3){return db[_0x1267('0x3d')]['find']({'where':{'id':_0x45896b[_0x1267('0x44')]['id']}})['then'](handleEntityNotFound(_0xcc05d3,null))[_0x1267('0x21')](removeEntity(_0xcc05d3,null))['catch'](handleError(_0xcc05d3,null));};exports[_0x1267('0x48')]=function(_0x25a580,_0xde7b88){var _0x24fb5b={'key':_0x25a580[_0x1267('0x47')][_0x1267('0x2b')]};if(_0x25a580[_0x1267('0x47')]['MailAccountId']){_0x24fb5b[_0x1267('0x49')]=_0x25a580['body'][_0x1267('0x49')];}else if(_0x25a580[_0x1267('0x47')][_0x1267('0x4a')]){_0x24fb5b['SmsAccountId']=_0x25a580[_0x1267('0x47')][_0x1267('0x4a')];}else if(_0x25a580[_0x1267('0x47')]['OpenchannelAccountId']){_0x24fb5b[_0x1267('0x4b')]=_0x25a580['body']['OpenchannelAccountId'];}else if(_0x25a580['body'][_0x1267('0x4c')]){_0x24fb5b[_0x1267('0x4c')]=_0x25a580['body']['ChatWebsiteId'];}return db[_0x1267('0x3d')][_0x1267('0x46')]({'where':_0x24fb5b})['then'](function(_0x36fb86){if(_0x36fb86){throw new db[(_0x1267('0x4d'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer']['create'](_0x25a580['body']);})[_0x1267('0x21')](function(_0x303e9f){var _0x32e390=_0x25a580[_0x1267('0x4e')]['get']({'plain':!![]});if(!_0x32e390)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32e390['role']===_0x1267('0x4e')){var _0x59982a=_0x303e9f[_0x1267('0x23')]({'plain':!![]});return db[_0x1267('0x4f')][_0x1267('0x46')]({'where':{'name':_0x1267('0x50'),'userProfileId':_0x32e390[_0x1267('0x51')]},'raw':!![]})[_0x1267('0x21')](function(_0x1b087e){if(_0x1b087e&&_0x1b087e['autoAssociation']===0x0){return db['UserProfileResource'][_0x1267('0x48')]({'name':_0x59982a['name'],'resourceId':_0x59982a['id'],'type':_0x1b087e[_0x1267('0x27')],'sectionId':_0x1b087e['id']},{})[_0x1267('0x21')](function(){return _0x303e9f;});}else{return _0x303e9f;}})['catch'](function(_0x2abc40){logger['error'](_0x1267('0x52'),_0x2abc40);throw _0x2abc40;});}return _0x303e9f;})[_0x1267('0x21')](respondWithResult(_0xde7b88,0xc9))[_0x1267('0x42')](handleError(_0xde7b88,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 8aec05b..7599e66 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 _0x160b=['CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define'];(function(_0x233277,_0x2568a0){var _0x5d215e=function(_0x419752){while(--_0x419752){_0x233277['push'](_0x233277['shift']());}};_0x5d215e(++_0x2568a0);}(_0x160b,0xff));var _0xb160=function(_0x4d7d6d,_0x1f67c0){_0x4d7d6d=_0x4d7d6d-0x0;var _0x447c3b=_0x160b[_0x4d7d6d];return _0x447c3b;};'use strict';var _=require(_0xb160('0x0'));var util=require(_0xb160('0x1'));var logger=require(_0xb160('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb160('0x3'));var rp=require(_0xb160('0x4'));var fs=require('fs');var path=require(_0xb160('0x5'));var rimraf=require(_0xb160('0x6'));var config=require(_0xb160('0x7'));var attributes=require(_0xb160('0x8'));module[_0xb160('0x9')]=function(_0x42a9c4,_0x29248e){return _0x42a9c4[_0xb160('0xa')](_0xb160('0xb'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb160('0xc'),'collate':_0xb160('0xd')});}; \ No newline at end of file +var _0xd446=['./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x582d0b,_0x28f609){var _0x2e93e1=function(_0xb6a81c){while(--_0xb6a81c){_0x582d0b['push'](_0x582d0b['shift']());}};_0x2e93e1(++_0x28f609);}(_0xd446,0x171));var _0x6d44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd446[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6d44('0x0'));var util=require('util');var logger=require(_0x6d44('0x1'))('api');var moment=require(_0x6d44('0x2'));var BPromise=require(_0x6d44('0x3'));var rp=require(_0x6d44('0x4'));var fs=require('fs');var path=require(_0x6d44('0x5'));var rimraf=require(_0x6d44('0x6'));var config=require(_0x6d44('0x7'));var attributes=require(_0x6d44('0x8'));module[_0x6d44('0x9')]=function(_0x16b328,_0x3b75b2){return _0x16b328[_0x6d44('0xa')]('CannedAnswer',attributes,{'tableName':_0x6d44('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d44('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 27ba989..317f973 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(_0x7efe61,_0x38754f){var _0x333432=function(_0x16d078){while(--_0x16d078){_0x7efe61['push'](_0x7efe61['shift']());}};_0x333432(++_0x38754f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0x339e44,_0x361cea){var _0x3c1be2=function(_0x7a04ce){while(--_0x7a04ce){_0x339e44['push'](_0x339e44['shift']());}};_0x3c1be2(++_0x361cea);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 709395a..ba187d3 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 _0x1293=['put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','post','create'];(function(_0x969954,_0x31293f){var _0x1585dc=function(_0x8be733){while(--_0x8be733){_0x969954['push'](_0x969954['shift']());}};_0x1585dc(++_0x31293f);}(_0x1293,0x10d));var _0x3129=function(_0x3290b0,_0x381109){_0x3290b0=_0x3290b0-0x0;var _0x52d0d8=_0x1293[_0x3290b0];return _0x52d0d8;};'use strict';var multer=require('multer');var util=require(_0x3129('0x0'));var path=require(_0x3129('0x1'));var timeout=require(_0x3129('0x2'));var express=require(_0x3129('0x3'));var router=express[_0x3129('0x4')]();var fs_extra=require(_0x3129('0x5'));var auth=require(_0x3129('0x6'));var interaction=require(_0x3129('0x7'));var config=require(_0x3129('0x8'));var controller=require(_0x3129('0x9'));router[_0x3129('0xa')]('/',auth['isAuthenticated'](),controller[_0x3129('0xb')]);router['get'](_0x3129('0xc'),auth[_0x3129('0xd')](),controller['show']);router[_0x3129('0xe')]('/',auth[_0x3129('0xd')](),controller[_0x3129('0xf')]);router[_0x3129('0x10')]('/:id',auth[_0x3129('0xd')](),controller['update']);router[_0x3129('0x11')](_0x3129('0xc'),auth[_0x3129('0xd')](),controller[_0x3129('0x12')]);module['exports']=router; \ No newline at end of file +var _0x8473=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','/:id','post','create','put','update','delete','exports','util','path','express','fs-extra'];(function(_0x526b29,_0x3e9b10){var _0x1289b4=function(_0x5ec127){while(--_0x5ec127){_0x526b29['push'](_0x526b29['shift']());}};_0x1289b4(++_0x3e9b10);}(_0x8473,0xec));var _0x3847=function(_0x1f17db,_0x1b258e){_0x1f17db=_0x1f17db-0x0;var _0x68d72b=_0x8473[_0x1f17db];return _0x68d72b;};'use strict';var multer=require('multer');var util=require(_0x3847('0x0'));var path=require(_0x3847('0x1'));var timeout=require('connect-timeout');var express=require(_0x3847('0x2'));var router=express['Router']();var fs_extra=require(_0x3847('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3847('0x4'));var config=require(_0x3847('0x5'));var controller=require(_0x3847('0x6'));router['get']('/',auth[_0x3847('0x7')](),controller[_0x3847('0x8')]);router['get'](_0x3847('0x9'),auth[_0x3847('0x7')](),controller['show']);router[_0x3847('0xa')]('/',auth[_0x3847('0x7')](),controller[_0x3847('0xb')]);router[_0x3847('0xc')](_0x3847('0x9'),auth[_0x3847('0x7')](),controller[_0x3847('0xd')]);router[_0x3847('0xe')]('/:id',auth[_0x3847('0x7')](),controller['destroy']);module[_0x3847('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 070d279..544ceff 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 _0x5bb7=['sequelize','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x1a3fe2,_0x553b71){var _0x490ee2=function(_0xc569b4){while(--_0xc569b4){_0x1a3fe2['push'](_0x1a3fe2['shift']());}};_0x490ee2(++_0x553b71);}(_0x5bb7,0x104));var _0x75bb=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x5bb7[_0x468b0f];return _0x3e74d9;};'use strict';var Sequelize=require(_0x75bb('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x75bb('0x1')],'allowNull':![],'defaultValue':_0x75bb('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x75bb('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x75bb('0x3')]},'dstchannel':{'type':Sequelize[_0x75bb('0x3')]},'lastapp':{'type':Sequelize[_0x75bb('0x3')]},'lastdata':{'type':Sequelize[_0x75bb('0x3')]},'duration':{'type':Sequelize[_0x75bb('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x75bb('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x75bb('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x75bb('0x3')]},'userfield':{'type':Sequelize[_0x75bb('0x3')]},'uniqueid':{'type':Sequelize[_0x75bb('0x3')]},'linkedid':{'type':Sequelize[_0x75bb('0x3')]},'sequence':{'type':Sequelize[_0x75bb('0x3')]},'peeraccount':{'type':Sequelize[_0x75bb('0x3')]},'type':{'type':Sequelize[_0x75bb('0x3')]},'tag':{'type':Sequelize[_0x75bb('0x3')]}}; \ No newline at end of file +var _0x106b=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x52f3d5,_0x43cda9){var _0x51b27b=function(_0x1d3137){while(--_0x1d3137){_0x52f3d5['push'](_0x52f3d5['shift']());}};_0x51b27b(++_0x43cda9);}(_0x106b,0xa2));var _0xb106=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0x106b[_0xd39959];return _0x1ff69c;};'use strict';var Sequelize=require(_0xb106('0x0'));module[_0xb106('0x1')]={'calldate':{'type':Sequelize[_0xb106('0x2')],'allowNull':![],'defaultValue':_0xb106('0x3')},'clid':{'type':Sequelize[_0xb106('0x4')]},'src':{'type':Sequelize[_0xb106('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xb106('0x4')]},'channel':{'type':Sequelize[_0xb106('0x4')]},'dstchannel':{'type':Sequelize[_0xb106('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xb106('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb106('0x4')]},'amaflags':{'type':Sequelize[_0xb106('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb106('0x4')]},'userfield':{'type':Sequelize[_0xb106('0x4')]},'uniqueid':{'type':Sequelize[_0xb106('0x4')]},'linkedid':{'type':Sequelize[_0xb106('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xb106('0x4')]},'type':{'type':Sequelize[_0xb106('0x4')]},'tag':{'type':Sequelize[_0xb106('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 2be2f10..96e63dd 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 _0x1cb9=['rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','length','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','Cdr'];(function(_0x1501ef,_0x2c3cd9){var _0x2e18df=function(_0x30664e){while(--_0x30664e){_0x1501ef['push'](_0x1501ef['shift']());}};_0x2e18df(++_0x2c3cd9);}(_0x1cb9,0x14e));var _0x91cb=function(_0x404030,_0x3cdbb2){_0x404030=_0x404030-0x0;var _0x1fcd75=_0x1cb9[_0x404030];return _0x1fcd75;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x423c4f,_0x264e9b){return function(_0x4c8438){if(!_0x4c8438){_0x423c4f['sendStatus'](0x194);}return _0x4c8438;};}function handleError(_0x234eb1,_0x554350){_0x554350=_0x554350||0x1f4;return function(_0x1c67d2){logger[_0x91cb('0x27')](_0x1c67d2[_0x91cb('0x28')]);if(_0x1c67d2['name']){delete _0x1c67d2[_0x91cb('0x29')];}_0x234eb1['status'](_0x554350)[_0x91cb('0x2a')](_0x1c67d2);};}exports[_0x91cb('0x2b')]=function(_0x3b3ee6,_0x2fb473){var _0x468908={},_0x504275={},_0x2f04a3={'count':0x0,'rows':[]};var _0x52670a=_[_0x91cb('0x2c')](db[_0x91cb('0x2d')][_0x91cb('0x2e')],function(_0x4944bd){return{'name':_0x4944bd[_0x91cb('0x2f')],'type':_0x4944bd[_0x91cb('0x30')][_0x91cb('0x31')]};});_0x504275[_0x91cb('0x32')]=_[_0x91cb('0x2c')](_0x52670a,_0x91cb('0x29'));_0x504275[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x3b3ee6[_0x91cb('0x33')]);_0x504275['filters']=_[_0x91cb('0x35')](_0x504275[_0x91cb('0x32')],_0x504275[_0x91cb('0x33')]);_0x468908[_0x91cb('0x36')]=_[_0x91cb('0x35')](_0x504275['model'],qs[_0x91cb('0x37')](_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x37')]));_0x468908[_0x91cb('0x36')]=_0x468908[_0x91cb('0x36')]['length']?_0x468908[_0x91cb('0x36')]:_0x504275['model'];if(!_0x3b3ee6['query']['hasOwnProperty'](_0x91cb('0x38'))){_0x468908['limit']=qs[_0x91cb('0x1d')](_0x3b3ee6['query']['limit']);_0x468908[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x1f')]);}_0x468908[_0x91cb('0x39')]=qs['sort'](_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x3a')]);_0x468908[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_['pick'](_0x3b3ee6['query'],_0x504275[_0x91cb('0x3c')]),_0x52670a);if(_0x3b3ee6[_0x91cb('0x33')]['filter']){_0x468908[_0x91cb('0x3b')]=_[_0x91cb('0x3d')](_0x468908['where'],{'$or':_[_0x91cb('0x2c')](_0x52670a,function(_0xddc409){if(_0xddc409['type']!==_0x91cb('0x3e')){var _0x545687={};_0x545687[_0xddc409[_0x91cb('0x29')]]={'$like':'%'+_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x3f')]+'%'};return _0x545687;}})});}_0x468908=_[_0x91cb('0x3d')]({},_0x468908,_0x3b3ee6[_0x91cb('0x40')]);var _0x20bf50={'where':_0x468908['where']};return db[_0x91cb('0x2d')][_0x91cb('0x1e')](_0x20bf50)['then'](function(_0x312581){_0x2f04a3['count']=_0x312581;if(_0x3b3ee6[_0x91cb('0x33')][_0x91cb('0x41')]){_0x468908[_0x91cb('0x42')]=[{'all':!![]}];}return db[_0x91cb('0x2d')]['findAll'](_0x468908);})[_0x91cb('0x25')](function(_0x5af0e6){_0x2f04a3[_0x91cb('0x43')]=_0x5af0e6;return _0x2f04a3;})[_0x91cb('0x25')](respondWithFilteredResult(_0x2fb473,_0x468908))[_0x91cb('0x44')](handleError(_0x2fb473,null));};exports[_0x91cb('0x45')]=function(_0x451463,_0x111cc0){var _0x325dca={'raw':!![],'where':{'id':_0x451463['params']['id']}},_0x3cc4c1={};_0x3cc4c1[_0x91cb('0x32')]=_['keys'](db[_0x91cb('0x2d')]['rawAttributes']);_0x3cc4c1[_0x91cb('0x33')]=_['keys'](_0x451463[_0x91cb('0x33')]);_0x3cc4c1[_0x91cb('0x3c')]=_[_0x91cb('0x35')](_0x3cc4c1[_0x91cb('0x32')],_0x3cc4c1['query']);_0x325dca[_0x91cb('0x36')]=_[_0x91cb('0x35')](_0x3cc4c1['model'],qs[_0x91cb('0x37')](_0x451463[_0x91cb('0x33')][_0x91cb('0x37')]));_0x325dca[_0x91cb('0x36')]=_0x325dca[_0x91cb('0x36')][_0x91cb('0x46')]?_0x325dca[_0x91cb('0x36')]:_0x3cc4c1[_0x91cb('0x32')];if(_0x451463[_0x91cb('0x33')]['includeAll']){_0x325dca[_0x91cb('0x42')]=[{'all':!![]}];}_0x325dca=_[_0x91cb('0x3d')]({},_0x325dca,_0x451463[_0x91cb('0x40')]);return db[_0x91cb('0x2d')][_0x91cb('0x47')](_0x325dca)[_0x91cb('0x25')](handleEntityNotFound(_0x111cc0,null))[_0x91cb('0x25')](respondWithResult(_0x111cc0,null))[_0x91cb('0x44')](handleError(_0x111cc0,null));};exports['create']=function(_0x348d78,_0x46caf1){return db[_0x91cb('0x2d')][_0x91cb('0x48')](_0x348d78['body'],{})[_0x91cb('0x25')](respondWithResult(_0x46caf1,0xc9))[_0x91cb('0x44')](handleError(_0x46caf1,null));};exports['update']=function(_0x212473,_0x47cdb7){if(_0x212473[_0x91cb('0x49')]['id']){delete _0x212473['body']['id'];}return db['Cdr']['find']({'where':{'id':_0x212473[_0x91cb('0x4a')]['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x47cdb7,null))[_0x91cb('0x25')](saveUpdates(_0x212473[_0x91cb('0x49')],null))[_0x91cb('0x25')](respondWithResult(_0x47cdb7,null))['catch'](handleError(_0x47cdb7,null));};exports['destroy']=function(_0x1d26b8,_0xfe6692){return db[_0x91cb('0x2d')][_0x91cb('0x47')]({'where':{'id':_0x1d26b8['params']['id']}})['then'](handleEntityNotFound(_0xfe6692,null))['then'](removeEntity(_0xfe6692,null))[_0x91cb('0x44')](handleError(_0xfe6692,null));};exports['describe']=function(_0x3f22a1,_0x4aa670){return db[_0x91cb('0x2d')][_0x91cb('0x4b')]()[_0x91cb('0x25')](respondWithResult(_0x4aa670,null))[_0x91cb('0x44')](handleError(_0x4aa670,null));}; \ No newline at end of file +var _0x5162=['undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','intersection','find','create','body','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5162,0x103));var _0x2516=function(_0x173336,_0x3f98c4){_0x173336=_0x173336-0x0;var _0x12dc79=_0x5162[_0x173336];return _0x12dc79;};'use strict';var emlformat=require(_0x2516('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2516('0x1'));var BPromise=require(_0x2516('0x2'));var Mustache=require(_0x2516('0x3'));var util=require(_0x2516('0x4'));var path=require(_0x2516('0x5'));var sox=require(_0x2516('0x6'));var csv=require(_0x2516('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2516('0x8'));var crypto=require(_0x2516('0x9'));var jsforce=require(_0x2516('0xa'));var deskjs=require(_0x2516('0xb'));var toCsv=require(_0x2516('0x7'));var querystring=require(_0x2516('0xc'));var Papa=require(_0x2516('0xd'));var Redis=require('ioredis');var authService=require(_0x2516('0xe'));var qs=require(_0x2516('0xf'));var as=require(_0x2516('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2516('0x11'));var licenseUtil=require(_0x2516('0x12'));var db=require(_0x2516('0x13'))['db'];function respondWithStatusCode(_0x3ef6ff,_0x56c69c){_0x56c69c=_0x56c69c||0xcc;return function(_0x33496b){if(_0x33496b){return _0x3ef6ff[_0x2516('0x14')](_0x56c69c);}return _0x3ef6ff[_0x2516('0x15')](_0x56c69c)[_0x2516('0x16')]();};}function respondWithResult(_0x42c771,_0x558d20){_0x558d20=_0x558d20||0xc8;return function(_0x3e5e0f){if(_0x3e5e0f){return _0x42c771[_0x2516('0x15')](_0x558d20)[_0x2516('0x17')](_0x3e5e0f);}};}function respondWithFilteredResult(_0x181a28,_0x2637e8){return function(_0x2ec31f){if(_0x2ec31f){var _0x19aacb=typeof _0x2637e8[_0x2516('0x18')]===_0x2516('0x19')&&typeof _0x2637e8['limit']===_0x2516('0x19');var _0x1ced29=_0x2ec31f[_0x2516('0x1a')];var _0x564d05=_0x19aacb?0x0:_0x2637e8[_0x2516('0x18')];var _0x5e96c7=_0x19aacb?_0x2ec31f['count']:_0x2637e8[_0x2516('0x18')]+_0x2637e8[_0x2516('0x1b')];var _0x151168;if(_0x5e96c7>=_0x1ced29){_0x5e96c7=_0x1ced29;_0x151168=0xc8;}else{_0x151168=0xce;}_0x181a28[_0x2516('0x15')](_0x151168);return _0x181a28[_0x2516('0x1c')](_0x2516('0x1d'),_0x564d05+'-'+_0x5e96c7+'/'+_0x1ced29)[_0x2516('0x17')](_0x2ec31f);}return null;};}function patchUpdates(_0x113616){return function(_0x248c5a){try{jsonpatch[_0x2516('0x1e')](_0x248c5a,_0x113616,!![]);}catch(_0x39ba5b){return BPromise[_0x2516('0x1f')](_0x39ba5b);}return _0x248c5a[_0x2516('0x20')]();};}function saveUpdates(_0x4fb7d9,_0x559a3e){return function(_0x12db4d){if(_0x12db4d){return _0x12db4d[_0x2516('0x21')](_0x4fb7d9)[_0x2516('0x22')](function(_0x2d5b1b){return _0x2d5b1b;});}return null;};}function removeEntity(_0x3ffb6d,_0x32de7a){return function(_0x3d906d){if(_0x3d906d){return _0x3d906d[_0x2516('0x23')]()['then'](function(){_0x3ffb6d[_0x2516('0x15')](0xcc)[_0x2516('0x16')]();});}};}function handleEntityNotFound(_0x774b60,_0x434d54){return function(_0x47f4fb){if(!_0x47f4fb){_0x774b60[_0x2516('0x14')](0x194);}return _0x47f4fb;};}function handleError(_0x30eeb9,_0x1f722c){_0x1f722c=_0x1f722c||0x1f4;return function(_0x3d728a){logger[_0x2516('0x24')](_0x3d728a['stack']);if(_0x3d728a[_0x2516('0x25')]){delete _0x3d728a[_0x2516('0x25')];}_0x30eeb9[_0x2516('0x15')](_0x1f722c)[_0x2516('0x26')](_0x3d728a);};}exports[_0x2516('0x27')]=function(_0x285e67,_0x556f01){var _0x136893={},_0x20dc9f={},_0x493a3e={'count':0x0,'rows':[]};var _0x19d90d=_[_0x2516('0x28')](db[_0x2516('0x29')][_0x2516('0x2a')],function(_0x539704){return{'name':_0x539704[_0x2516('0x2b')],'type':_0x539704[_0x2516('0x2c')][_0x2516('0x2d')]};});_0x20dc9f[_0x2516('0x2e')]=_[_0x2516('0x28')](_0x19d90d,_0x2516('0x25'));_0x20dc9f[_0x2516('0x2f')]=_[_0x2516('0x30')](_0x285e67[_0x2516('0x2f')]);_0x20dc9f[_0x2516('0x31')]=_['intersection'](_0x20dc9f[_0x2516('0x2e')],_0x20dc9f['query']);_0x136893[_0x2516('0x32')]=_['intersection'](_0x20dc9f[_0x2516('0x2e')],qs['fields'](_0x285e67[_0x2516('0x2f')][_0x2516('0x33')]));_0x136893[_0x2516('0x32')]=_0x136893[_0x2516('0x32')][_0x2516('0x34')]?_0x136893[_0x2516('0x32')]:_0x20dc9f[_0x2516('0x2e')];if(!_0x285e67[_0x2516('0x2f')][_0x2516('0x35')]('nolimit')){_0x136893[_0x2516('0x1b')]=qs[_0x2516('0x1b')](_0x285e67[_0x2516('0x2f')][_0x2516('0x1b')]);_0x136893['offset']=qs['offset'](_0x285e67[_0x2516('0x2f')][_0x2516('0x18')]);}_0x136893[_0x2516('0x36')]=qs[_0x2516('0x37')](_0x285e67[_0x2516('0x2f')][_0x2516('0x37')]);_0x136893[_0x2516('0x38')]=qs[_0x2516('0x31')](_[_0x2516('0x39')](_0x285e67[_0x2516('0x2f')],_0x20dc9f['filters']),_0x19d90d);if(_0x285e67['query'][_0x2516('0x3a')]){_0x136893[_0x2516('0x38')]=_['merge'](_0x136893['where'],{'$or':_[_0x2516('0x28')](_0x19d90d,function(_0x3b310f){if(_0x3b310f['type']!==_0x2516('0x3b')){var _0x52ef6b={};_0x52ef6b[_0x3b310f[_0x2516('0x25')]]={'$like':'%'+_0x285e67[_0x2516('0x2f')]['filter']+'%'};return _0x52ef6b;}})});}_0x136893=_[_0x2516('0x3c')]({},_0x136893,_0x285e67[_0x2516('0x3d')]);var _0x155cf7={'where':_0x136893[_0x2516('0x38')]};return db[_0x2516('0x29')][_0x2516('0x1a')](_0x155cf7)[_0x2516('0x22')](function(_0x2371a8){_0x493a3e[_0x2516('0x1a')]=_0x2371a8;if(_0x285e67[_0x2516('0x2f')][_0x2516('0x3e')]){_0x136893[_0x2516('0x3f')]=[{'all':!![]}];}return db[_0x2516('0x29')]['findAll'](_0x136893);})[_0x2516('0x22')](function(_0x1bc0e){_0x493a3e['rows']=_0x1bc0e;return _0x493a3e;})[_0x2516('0x22')](respondWithFilteredResult(_0x556f01,_0x136893))[_0x2516('0x40')](handleError(_0x556f01,null));};exports[_0x2516('0x41')]=function(_0x1afefb,_0x421c58){var _0x582cb6={'raw':!![],'where':{'id':_0x1afefb[_0x2516('0x42')]['id']}},_0x1a8d2d={};_0x1a8d2d[_0x2516('0x2e')]=_[_0x2516('0x30')](db[_0x2516('0x29')][_0x2516('0x2a')]);_0x1a8d2d['query']=_[_0x2516('0x30')](_0x1afefb[_0x2516('0x2f')]);_0x1a8d2d[_0x2516('0x31')]=_[_0x2516('0x43')](_0x1a8d2d[_0x2516('0x2e')],_0x1a8d2d[_0x2516('0x2f')]);_0x582cb6[_0x2516('0x32')]=_['intersection'](_0x1a8d2d[_0x2516('0x2e')],qs['fields'](_0x1afefb[_0x2516('0x2f')]['fields']));_0x582cb6[_0x2516('0x32')]=_0x582cb6[_0x2516('0x32')][_0x2516('0x34')]?_0x582cb6['attributes']:_0x1a8d2d['model'];if(_0x1afefb[_0x2516('0x2f')][_0x2516('0x3e')]){_0x582cb6['include']=[{'all':!![]}];}_0x582cb6=_['merge']({},_0x582cb6,_0x1afefb[_0x2516('0x3d')]);return db[_0x2516('0x29')][_0x2516('0x44')](_0x582cb6)['then'](handleEntityNotFound(_0x421c58,null))[_0x2516('0x22')](respondWithResult(_0x421c58,null))['catch'](handleError(_0x421c58,null));};exports[_0x2516('0x45')]=function(_0x39fd32,_0x318128){return db[_0x2516('0x29')]['create'](_0x39fd32[_0x2516('0x46')],{})[_0x2516('0x22')](respondWithResult(_0x318128,0xc9))[_0x2516('0x40')](handleError(_0x318128,null));};exports[_0x2516('0x21')]=function(_0x43874c,_0x482883){if(_0x43874c[_0x2516('0x46')]['id']){delete _0x43874c[_0x2516('0x46')]['id'];}return db[_0x2516('0x29')][_0x2516('0x44')]({'where':{'id':_0x43874c['params']['id']}})[_0x2516('0x22')](handleEntityNotFound(_0x482883,null))[_0x2516('0x22')](saveUpdates(_0x43874c[_0x2516('0x46')],null))[_0x2516('0x22')](respondWithResult(_0x482883,null))[_0x2516('0x40')](handleError(_0x482883,null));};exports['destroy']=function(_0x1c4be3,_0x1aa854){return db[_0x2516('0x29')][_0x2516('0x44')]({'where':{'id':_0x1c4be3[_0x2516('0x42')]['id']}})[_0x2516('0x22')](handleEntityNotFound(_0x1aa854,null))['then'](removeEntity(_0x1aa854,null))['catch'](handleError(_0x1aa854,null));};exports['describe']=function(_0x323590,_0x4f7eb4){return db['Cdr']['describe']()[_0x2516('0x22')](respondWithResult(_0x4f7eb4,null))[_0x2516('0x40')](handleError(_0x4f7eb4,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 8a4b76b..e455df5 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x20f0dd,_0x52b93f){var _0x575364=function(_0x1b86cf){while(--_0x1b86cf){_0x20f0dd['push'](_0x20f0dd['shift']());}};_0x575364(++_0x52b93f);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x2d8a02,_0x1f4e5d){var _0xe7aaf8=function(_0x1ba751){while(--_0x1ba751){_0x2d8a02['push'](_0x2d8a02['shift']());}};_0xe7aaf8(++_0x1f4e5d);}(_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 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 ba9faec..67babbe 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 _0x7da8=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','Cdr,\x20%s,\x20%s','message','lodash'];(function(_0x407bd8,_0x277add){var _0x20b6c9=function(_0x215b6c){while(--_0x215b6c){_0x407bd8['push'](_0x407bd8['shift']());}};_0x20b6c9(++_0x277add);}(_0x7da8,0x1a3));var _0x87da=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x7da8[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x87da('0x0'));var util=require(_0x87da('0x1'));var moment=require(_0x87da('0x2'));var BPromise=require(_0x87da('0x3'));var rs=require(_0x87da('0x4'));var fs=require('fs');var Redis=require(_0x87da('0x5'));var db=require(_0x87da('0x6'))['db'];var utils=require(_0x87da('0x7'));var logger=require(_0x87da('0x8'))('rpc');var config=require(_0x87da('0x9'));var jayson=require(_0x87da('0xa'));var client=jayson['client'][_0x87da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x407a47,_0x3d0435,_0x2fac84){return new BPromise(function(_0x298d3b,_0x54b7f7){return client['request'](_0x407a47,_0x2fac84)['then'](function(_0x38b983){logger[_0x87da('0xc')]('Cdr,\x20%s,\x20%s',_0x3d0435,_0x87da('0xd'));logger[_0x87da('0xe')](_0x87da('0xf'),_0x3d0435,_0x87da('0xd'),JSON['stringify'](_0x38b983));if(_0x38b983[_0x87da('0x10')]){if(_0x38b983['error'][_0x87da('0x11')]===0x1f4){logger['error'](_0x87da('0x12'),_0x3d0435,_0x38b983[_0x87da('0x10')][_0x87da('0x13')]);return _0x54b7f7(_0x38b983[_0x87da('0x10')][_0x87da('0x13')]);}logger[_0x87da('0x10')]('Cdr,\x20%s,\x20%s',_0x3d0435,_0x38b983['error'][_0x87da('0x13')]);return _0x298d3b(_0x38b983['error']['message']);}else{logger[_0x87da('0xc')](_0x87da('0x12'),_0x3d0435,_0x87da('0xd'));_0x298d3b(_0x38b983['result'][_0x87da('0x13')]);}})['catch'](function(_0x1fd398){logger['error'](_0x87da('0x12'),_0x3d0435,_0x1fd398);_0x54b7f7(_0x1fd398);});});} \ No newline at end of file +var _0x2421=['stringify','error','Cdr,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x395aaf,_0x48a467){var _0x1b39d3=function(_0x228248){while(--_0x228248){_0x395aaf['push'](_0x395aaf['shift']());}};_0x1b39d3(++_0x48a467);}(_0x2421,0x11a));var _0x1242=function(_0x46f6bd,_0xb41e){_0x46f6bd=_0x46f6bd-0x0;var _0x233b9e=_0x2421[_0x46f6bd];return _0x233b9e;};'use strict';var _=require('lodash');var util=require(_0x1242('0x0'));var moment=require(_0x1242('0x1'));var BPromise=require(_0x1242('0x2'));var rs=require(_0x1242('0x3'));var fs=require('fs');var Redis=require(_0x1242('0x4'));var db=require(_0x1242('0x5'))['db'];var utils=require(_0x1242('0x6'));var logger=require(_0x1242('0x7'))('rpc');var config=require(_0x1242('0x8'));var jayson=require(_0x1242('0x9'));var client=jayson[_0x1242('0xa')][_0x1242('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cf342,_0x1b1e59,_0x1881d1){return new BPromise(function(_0x43298b,_0x3898a5){return client[_0x1242('0xc')](_0x5cf342,_0x1881d1)[_0x1242('0xd')](function(_0x5aa53d){logger[_0x1242('0xe')]('Cdr,\x20%s,\x20%s',_0x1b1e59,'request\x20sent');logger['debug'](_0x1242('0xf'),_0x1b1e59,_0x1242('0x10'),JSON[_0x1242('0x11')](_0x5aa53d));if(_0x5aa53d[_0x1242('0x12')]){if(_0x5aa53d['error']['code']===0x1f4){logger[_0x1242('0x12')](_0x1242('0x13'),_0x1b1e59,_0x5aa53d[_0x1242('0x12')][_0x1242('0x14')]);return _0x3898a5(_0x5aa53d['error']['message']);}logger[_0x1242('0x12')](_0x1242('0x13'),_0x1b1e59,_0x5aa53d[_0x1242('0x12')]['message']);return _0x43298b(_0x5aa53d[_0x1242('0x12')]['message']);}else{logger[_0x1242('0xe')](_0x1242('0x13'),_0x1b1e59,_0x1242('0x10'));_0x43298b(_0x5aa53d[_0x1242('0x15')][_0x1242('0x14')]);}})[_0x1242('0x16')](function(_0x5d2dfb){logger[_0x1242('0x12')]('Cdr,\x20%s,\x20%s',_0x1b1e59,_0x5d2dfb);_0x3898a5(_0x5d2dfb);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 680e3d8..3d39e90 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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x22ebd5,_0x30bb61){var _0x23da9a=function(_0x38fd97){while(--_0x38fd97){_0x22ebd5['push'](_0x22ebd5['shift']());}};_0x23da9a(++_0x30bb61);}(_0xb10b,0x12a));var _0xbb10=function(_0x9b14ee,_0x574340){_0x9b14ee=_0x9b14ee-0x0;var _0xc3fa3c=_0xb10b[_0x9b14ee];return _0xc3fa3c;};'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')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x481342,_0x39c5b0){var _0x47e1ad=function(_0x35e7db){while(--_0x35e7db){_0x481342['push'](_0x481342['shift']());}};_0x47e1ad(++_0x39c5b0);}(_0xb10b,0x12a));var _0xbb10=function(_0x5426d0,_0x4a4f10){_0x5426d0=_0x5426d0-0x0;var _0x37be89=_0xb10b[_0x5426d0];return _0x37be89;};'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')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('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 4db0c16..8038650 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 _0x4996=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x1c1ae5,_0x2eaccf){var _0x15bf42=function(_0x122796){while(--_0x122796){_0x1c1ae5['push'](_0x1c1ae5['shift']());}};_0x15bf42(++_0x2eaccf);}(_0x4996,0x74));var _0x6499=function(_0x4f680c,_0x292aba){_0x4f680c=_0x4f680c-0x0;var _0x5326b2=_0x4996[_0x4f680c];return _0x5326b2;};'use strict';var Sequelize=require(_0x6499('0x0'));module[_0x6499('0x1')]={'priority':{'type':Sequelize[_0x6499('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6499('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6499('0x4')]()},'description':{'type':Sequelize[_0x6499('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6499('0x5')}}; \ No newline at end of file +var _0x3f92=['STRING','sequelize','INTEGER','TEXT'];(function(_0x4a655c,_0x5054ee){var _0x987318=function(_0x4d3ef6){while(--_0x4d3ef6){_0x4a655c['push'](_0x4a655c['shift']());}};_0x987318(++_0x5054ee);}(_0x3f92,0x131));var _0x23f9=function(_0x25d3c8,_0x5dcdf0){_0x25d3c8=_0x25d3c8-0x0;var _0x35afa5=_0x3f92[_0x25d3c8];return _0x35afa5;};'use strict';var Sequelize=require(_0x23f9('0x0'));module['exports']={'priority':{'type':Sequelize[_0x23f9('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x23f9('0x2')]()},'description':{'type':Sequelize[_0x23f9('0x3')]},'interval':{'type':Sequelize[_0x23f9('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 db3f177..c6deded 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 _0xfdb5=['sendStatus','stack','name','show','params','model','keys','ChatApplication','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','update','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','count','offset','limit','set','apply','reject','save','then'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0xfdb5,0x12f));var _0x5fdb=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xfdb5[_0x20ef64];return _0x3707d8;};'use strict';var emlformat=require(_0x5fdb('0x0'));var rimraf=require(_0x5fdb('0x1'));var zipdir=require(_0x5fdb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5fdb('0x3'));var moment=require(_0x5fdb('0x4'));var BPromise=require(_0x5fdb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5fdb('0x6'));var sox=require('sox');var csv=require(_0x5fdb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5fdb('0x8'));var _=require(_0x5fdb('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5fdb('0xa'));var toCsv=require(_0x5fdb('0x7'));var querystring=require(_0x5fdb('0xb'));var Papa=require(_0x5fdb('0xc'));var Redis=require(_0x5fdb('0xd'));var authService=require(_0x5fdb('0xe'));var qs=require(_0x5fdb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5fdb('0x10'));var logger=require('../../config/logger')(_0x5fdb('0x11'));var utils=require(_0x5fdb('0x12'));var config=require(_0x5fdb('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5fdb('0x14'))['db'];function respondWithStatusCode(_0x573f40,_0x27433e){_0x27433e=_0x27433e||0xcc;return function(_0x368750){if(_0x368750){return _0x573f40['sendStatus'](_0x27433e);}return _0x573f40[_0x5fdb('0x15')](_0x27433e)[_0x5fdb('0x16')]();};}function respondWithResult(_0x3a2e29,_0x59f815){_0x59f815=_0x59f815||0xc8;return function(_0x3d15a2){if(_0x3d15a2){return _0x3a2e29[_0x5fdb('0x15')](_0x59f815)[_0x5fdb('0x17')](_0x3d15a2);}};}function respondWithFilteredResult(_0xaf6b0e,_0x40c32d){return function(_0x2d620c){if(_0x2d620c){var _0x58ae27=typeof _0x40c32d['offset']===_0x5fdb('0x18')&&typeof _0x40c32d['limit']===_0x5fdb('0x18');var _0x148223=_0x2d620c[_0x5fdb('0x19')];var _0x47a10f=_0x58ae27?0x0:_0x40c32d[_0x5fdb('0x1a')];var _0xb8c99f=_0x58ae27?_0x2d620c[_0x5fdb('0x19')]:_0x40c32d[_0x5fdb('0x1a')]+_0x40c32d[_0x5fdb('0x1b')];var _0x30d7d1;if(_0xb8c99f>=_0x148223){_0xb8c99f=_0x148223;_0x30d7d1=0xc8;}else{_0x30d7d1=0xce;}_0xaf6b0e['status'](_0x30d7d1);return _0xaf6b0e[_0x5fdb('0x1c')]('Content-Range',_0x47a10f+'-'+_0xb8c99f+'/'+_0x148223)['json'](_0x2d620c);}return null;};}function patchUpdates(_0x8937c){return function(_0x2ab3a4){try{jsonpatch[_0x5fdb('0x1d')](_0x2ab3a4,_0x8937c,!![]);}catch(_0x571802){return BPromise[_0x5fdb('0x1e')](_0x571802);}return _0x2ab3a4[_0x5fdb('0x1f')]();};}function saveUpdates(_0x47e13a,_0x3e755a){return function(_0x170ad5){if(_0x170ad5){return _0x170ad5['update'](_0x47e13a)['then'](function(_0x4dc591){return _0x4dc591;});}return null;};}function removeEntity(_0x56997a,_0x15d2ec){return function(_0x573132){if(_0x573132){return _0x573132['destroy']()[_0x5fdb('0x20')](function(){_0x56997a[_0x5fdb('0x15')](0xcc)[_0x5fdb('0x16')]();});}};}function handleEntityNotFound(_0x49e795,_0x3b47f5){return function(_0x848e51){if(!_0x848e51){_0x49e795[_0x5fdb('0x21')](0x194);}return _0x848e51;};}function handleError(_0x2b043b,_0x5893a9){_0x5893a9=_0x5893a9||0x1f4;return function(_0x200eaf){logger['error'](_0x200eaf[_0x5fdb('0x22')]);if(_0x200eaf[_0x5fdb('0x23')]){delete _0x200eaf['name'];}_0x2b043b[_0x5fdb('0x15')](_0x5893a9)['send'](_0x200eaf);};}exports[_0x5fdb('0x24')]=function(_0x474217,_0x5bd442){var _0x57e93a={'raw':!![],'where':{'id':_0x474217[_0x5fdb('0x25')]['id']}},_0xa5c0e2={};_0xa5c0e2[_0x5fdb('0x26')]=_[_0x5fdb('0x27')](db[_0x5fdb('0x28')]['rawAttributes']);_0xa5c0e2['query']=_[_0x5fdb('0x27')](_0x474217[_0x5fdb('0x29')]);_0xa5c0e2[_0x5fdb('0x2a')]=_[_0x5fdb('0x2b')](_0xa5c0e2[_0x5fdb('0x26')],_0xa5c0e2[_0x5fdb('0x29')]);_0x57e93a[_0x5fdb('0x2c')]=_[_0x5fdb('0x2b')](_0xa5c0e2[_0x5fdb('0x26')],qs[_0x5fdb('0x2d')](_0x474217[_0x5fdb('0x29')][_0x5fdb('0x2d')]));_0x57e93a[_0x5fdb('0x2c')]=_0x57e93a[_0x5fdb('0x2c')][_0x5fdb('0x2e')]?_0x57e93a['attributes']:_0xa5c0e2[_0x5fdb('0x26')];if(_0x474217[_0x5fdb('0x29')][_0x5fdb('0x2f')]){_0x57e93a[_0x5fdb('0x30')]=[{'all':!![]}];}_0x57e93a=_[_0x5fdb('0x31')]({},_0x57e93a,_0x474217[_0x5fdb('0x32')]);return db[_0x5fdb('0x28')][_0x5fdb('0x33')](_0x57e93a)[_0x5fdb('0x20')](handleEntityNotFound(_0x5bd442,null))[_0x5fdb('0x20')](respondWithResult(_0x5bd442,null))['catch'](handleError(_0x5bd442,null));};exports[_0x5fdb('0x34')]=function(_0x12ce07,_0x217641){if(_0x12ce07[_0x5fdb('0x35')]['id']){delete _0x12ce07[_0x5fdb('0x35')]['id'];}return db[_0x5fdb('0x28')]['find']({'where':{'id':_0x12ce07['params']['id']}})[_0x5fdb('0x20')](handleEntityNotFound(_0x217641,null))[_0x5fdb('0x20')](saveUpdates(_0x12ce07[_0x5fdb('0x35')],null))[_0x5fdb('0x20')](respondWithResult(_0x217641,null))[_0x5fdb('0x36')](handleError(_0x217641,null));};exports[_0x5fdb('0x37')]=function(_0xbbd7f2,_0x58ed74){return db[_0x5fdb('0x28')][_0x5fdb('0x33')]({'where':{'id':_0xbbd7f2[_0x5fdb('0x25')]['id']}})[_0x5fdb('0x20')](handleEntityNotFound(_0x58ed74,null))[_0x5fdb('0x20')](removeEntity(_0x58ed74,null))[_0x5fdb('0x36')](handleError(_0x58ed74,null));}; \ No newline at end of file +var _0x5d31=['then','destroy','error','stack','name','send','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','ChatApplication','find','catch','body','params','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update'];(function(_0x3be8b2,_0x26c3b4){var _0x47672e=function(_0x1633b6){while(--_0x1633b6){_0x3be8b2['push'](_0x3be8b2['shift']());}};_0x47672e(++_0x26c3b4);}(_0x5d31,0xf7));var _0x15d3=function(_0x38c2b5,_0x4de8fa){_0x38c2b5=_0x38c2b5-0x0;var _0x46deb3=_0x5d31[_0x38c2b5];return _0x46deb3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15d3('0x0'));var zipdir=require(_0x15d3('0x1'));var jsonpatch=require(_0x15d3('0x2'));var rp=require('request-promise');var moment=require(_0x15d3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x15d3('0x4'));var path=require(_0x15d3('0x5'));var sox=require(_0x15d3('0x6'));var csv=require(_0x15d3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15d3('0x8'));var _=require(_0x15d3('0x9'));var squel=require(_0x15d3('0xa'));var crypto=require(_0x15d3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x15d3('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x15d3('0xd'));var Redis=require('ioredis');var authService=require(_0x15d3('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15d3('0xf'));var logger=require(_0x15d3('0x10'))(_0x15d3('0x11'));var utils=require(_0x15d3('0x12'));var config=require(_0x15d3('0x13'));var licenseUtil=require(_0x15d3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x219867,_0x1397d8){_0x1397d8=_0x1397d8||0xcc;return function(_0x2811b5){if(_0x2811b5){return _0x219867[_0x15d3('0x15')](_0x1397d8);}return _0x219867[_0x15d3('0x16')](_0x1397d8)[_0x15d3('0x17')]();};}function respondWithResult(_0x24eb07,_0x1658cf){_0x1658cf=_0x1658cf||0xc8;return function(_0x44b5a4){if(_0x44b5a4){return _0x24eb07[_0x15d3('0x16')](_0x1658cf)[_0x15d3('0x18')](_0x44b5a4);}};}function respondWithFilteredResult(_0x4af3a7,_0x304a13){return function(_0x17401b){if(_0x17401b){var _0x5bbfef=typeof _0x304a13[_0x15d3('0x19')]===_0x15d3('0x1a')&&typeof _0x304a13[_0x15d3('0x1b')]===_0x15d3('0x1a');var _0x1b7b3f=_0x17401b[_0x15d3('0x1c')];var _0x46f9ce=_0x5bbfef?0x0:_0x304a13[_0x15d3('0x19')];var _0x46e18b=_0x5bbfef?_0x17401b[_0x15d3('0x1c')]:_0x304a13[_0x15d3('0x19')]+_0x304a13['limit'];var _0x41c358;if(_0x46e18b>=_0x1b7b3f){_0x46e18b=_0x1b7b3f;_0x41c358=0xc8;}else{_0x41c358=0xce;}_0x4af3a7[_0x15d3('0x16')](_0x41c358);return _0x4af3a7['set']('Content-Range',_0x46f9ce+'-'+_0x46e18b+'/'+_0x1b7b3f)['json'](_0x17401b);}return null;};}function patchUpdates(_0x4ebc97){return function(_0x39bb05){try{jsonpatch[_0x15d3('0x1d')](_0x39bb05,_0x4ebc97,!![]);}catch(_0x40a327){return BPromise[_0x15d3('0x1e')](_0x40a327);}return _0x39bb05[_0x15d3('0x1f')]();};}function saveUpdates(_0x2fa13c,_0x4da198){return function(_0x49eb89){if(_0x49eb89){return _0x49eb89[_0x15d3('0x20')](_0x2fa13c)[_0x15d3('0x21')](function(_0x444075){return _0x444075;});}return null;};}function removeEntity(_0x72852f,_0x5b06cc){return function(_0x232078){if(_0x232078){return _0x232078[_0x15d3('0x22')]()[_0x15d3('0x21')](function(){_0x72852f[_0x15d3('0x16')](0xcc)[_0x15d3('0x17')]();});}};}function handleEntityNotFound(_0x240cf4,_0x4a499a){return function(_0x514380){if(!_0x514380){_0x240cf4['sendStatus'](0x194);}return _0x514380;};}function handleError(_0x31706f,_0x1cd5bc){_0x1cd5bc=_0x1cd5bc||0x1f4;return function(_0x23e1f8){logger[_0x15d3('0x23')](_0x23e1f8[_0x15d3('0x24')]);if(_0x23e1f8[_0x15d3('0x25')]){delete _0x23e1f8[_0x15d3('0x25')];}_0x31706f[_0x15d3('0x16')](_0x1cd5bc)[_0x15d3('0x26')](_0x23e1f8);};}exports['show']=function(_0x5f445a,_0x164aa1){var _0x4e5840={'raw':!![],'where':{'id':_0x5f445a['params']['id']}},_0x6a9c0c={};_0x6a9c0c[_0x15d3('0x27')]=_[_0x15d3('0x28')](db['ChatApplication'][_0x15d3('0x29')]);_0x6a9c0c[_0x15d3('0x2a')]=_[_0x15d3('0x28')](_0x5f445a[_0x15d3('0x2a')]);_0x6a9c0c[_0x15d3('0x2b')]=_[_0x15d3('0x2c')](_0x6a9c0c[_0x15d3('0x27')],_0x6a9c0c[_0x15d3('0x2a')]);_0x4e5840[_0x15d3('0x2d')]=_[_0x15d3('0x2c')](_0x6a9c0c['model'],qs[_0x15d3('0x2e')](_0x5f445a[_0x15d3('0x2a')][_0x15d3('0x2e')]));_0x4e5840[_0x15d3('0x2d')]=_0x4e5840[_0x15d3('0x2d')][_0x15d3('0x2f')]?_0x4e5840[_0x15d3('0x2d')]:_0x6a9c0c[_0x15d3('0x27')];if(_0x5f445a['query'][_0x15d3('0x30')]){_0x4e5840['include']=[{'all':!![]}];}_0x4e5840=_[_0x15d3('0x31')]({},_0x4e5840,_0x5f445a[_0x15d3('0x32')]);return db[_0x15d3('0x33')][_0x15d3('0x34')](_0x4e5840)[_0x15d3('0x21')](handleEntityNotFound(_0x164aa1,null))[_0x15d3('0x21')](respondWithResult(_0x164aa1,null))[_0x15d3('0x35')](handleError(_0x164aa1,null));};exports[_0x15d3('0x20')]=function(_0x340d03,_0x20e680){if(_0x340d03[_0x15d3('0x36')]['id']){delete _0x340d03[_0x15d3('0x36')]['id'];}return db[_0x15d3('0x33')][_0x15d3('0x34')]({'where':{'id':_0x340d03[_0x15d3('0x37')]['id']}})['then'](handleEntityNotFound(_0x20e680,null))[_0x15d3('0x21')](saveUpdates(_0x340d03[_0x15d3('0x36')],null))['then'](respondWithResult(_0x20e680,null))[_0x15d3('0x35')](handleError(_0x20e680,null));};exports[_0x15d3('0x22')]=function(_0xd2708,_0x51963f){return db[_0x15d3('0x33')]['find']({'where':{'id':_0xd2708[_0x15d3('0x37')]['id']}})[_0x15d3('0x21')](handleEntityNotFound(_0x51963f,null))['then'](removeEntity(_0x51963f,null))[_0x15d3('0x35')](handleError(_0x51963f,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 665188a..bd786fb 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 _0x2d6e=['ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports'];(function(_0x435254,_0x167b7a){var _0x4964fb=function(_0x477265){while(--_0x477265){_0x435254['push'](_0x435254['shift']());}};_0x4964fb(++_0x167b7a);}(_0x2d6e,0x107));var _0xe2d6=function(_0x18a032,_0x347bc1){_0x18a032=_0x18a032-0x0;var _0x1337f7=_0x2d6e[_0x18a032];return _0x1337f7;};'use strict';var _=require(_0xe2d6('0x0'));var util=require(_0xe2d6('0x1'));var logger=require(_0xe2d6('0x2'))('api');var moment=require(_0xe2d6('0x3'));var BPromise=require(_0xe2d6('0x4'));var rp=require(_0xe2d6('0x5'));var fs=require('fs');var path=require(_0xe2d6('0x6'));var rimraf=require(_0xe2d6('0x7'));var config=require('../../config/environment');var attributes=require(_0xe2d6('0x8'));module[_0xe2d6('0x9')]=function(_0x4ef03e,_0x3a9764){return _0x4ef03e['define'](_0xe2d6('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe2d6('0xb'),'collate':_0xe2d6('0xc')});}; \ No newline at end of file +var _0x8865=['../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf'];(function(_0x55a1ce,_0x3aba0e){var _0x20a711=function(_0x3642c7){while(--_0x3642c7){_0x55a1ce['push'](_0x55a1ce['shift']());}};_0x20a711(++_0x3aba0e);}(_0x8865,0x173));var _0x5886=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8865[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x5886('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5886('0x1'));var moment=require(_0x5886('0x2'));var BPromise=require('bluebird');var rp=require(_0x5886('0x3'));var fs=require('fs');var path=require(_0x5886('0x4'));var rimraf=require(_0x5886('0x5'));var config=require(_0x5886('0x6'));var attributes=require(_0x5886('0x7'));module[_0x5886('0x8')]=function(_0xd48fdd,_0x141d99){return _0xd48fdd[_0x5886('0x9')]('ChatApplication',attributes,{'tableName':_0x5886('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5886('0xb'),'collate':_0x5886('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 50d8970..103fc25 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 _0xa657=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0xa657,0x1de));var _0x7a65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa657[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7a65('0x0'));var util=require(_0x7a65('0x1'));var moment=require(_0x7a65('0x2'));var BPromise=require(_0x7a65('0x3'));var rs=require(_0x7a65('0x4'));var fs=require('fs');var Redis=require(_0x7a65('0x5'));var db=require(_0x7a65('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a65('0x7'))(_0x7a65('0x8'));var config=require(_0x7a65('0x9'));var jayson=require(_0x7a65('0xa'));var client=jayson[_0x7a65('0xb')][_0x7a65('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3cc1f2,_0x426856,_0x5a963d){return new BPromise(function(_0x421dc4,_0x38ca16){return client['request'](_0x3cc1f2,_0x5a963d)['then'](function(_0x29b811){logger[_0x7a65('0xd')](_0x7a65('0xe'),_0x426856,_0x7a65('0xf'));logger['debug'](_0x7a65('0x10'),_0x426856,'request\x20sent',JSON[_0x7a65('0x11')](_0x29b811));if(_0x29b811[_0x7a65('0x12')]){if(_0x29b811['error'][_0x7a65('0x13')]===0x1f4){logger[_0x7a65('0x12')](_0x7a65('0xe'),_0x426856,_0x29b811[_0x7a65('0x12')][_0x7a65('0x14')]);return _0x38ca16(_0x29b811[_0x7a65('0x12')]['message']);}logger[_0x7a65('0x12')](_0x7a65('0xe'),_0x426856,_0x29b811[_0x7a65('0x12')][_0x7a65('0x14')]);return _0x421dc4(_0x29b811[_0x7a65('0x12')][_0x7a65('0x14')]);}else{logger[_0x7a65('0xd')](_0x7a65('0xe'),_0x426856,_0x7a65('0xf'));_0x421dc4(_0x29b811[_0x7a65('0x15')][_0x7a65('0x14')]);}})[_0x7a65('0x16')](function(_0x7a338f){logger[_0x7a65('0x12')](_0x7a65('0xe'),_0x426856,_0x7a338f);_0x38ca16(_0x7a338f);});});} \ No newline at end of file +var _0x88c0=['rpc','../../config/environment','jayson/promise','client','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','randomstring','../../config/utils','../../config/logger'];(function(_0x2c856c,_0x1eeaa6){var _0xa9d840=function(_0x1576e3){while(--_0x1576e3){_0x2c856c['push'](_0x2c856c['shift']());}};_0xa9d840(++_0x1eeaa6);}(_0x88c0,0x13e));var _0x088c=function(_0x379d46,_0x590ea8){_0x379d46=_0x379d46-0x0;var _0x5f80c6=_0x88c0[_0x379d46];return _0x5f80c6;};'use strict';var _=require('lodash');var util=require(_0x088c('0x0'));var moment=require(_0x088c('0x1'));var BPromise=require('bluebird');var rs=require(_0x088c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x088c('0x3'));var logger=require(_0x088c('0x4'))(_0x088c('0x5'));var config=require(_0x088c('0x6'));var jayson=require(_0x088c('0x7'));var client=jayson[_0x088c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18a09a,_0x44f89b,_0x4e0d2d){return new BPromise(function(_0xa09013,_0x50f61c){return client[_0x088c('0x9')](_0x18a09a,_0x4e0d2d)['then'](function(_0x446e05){logger[_0x088c('0xa')](_0x088c('0xb'),_0x44f89b,_0x088c('0xc'));logger[_0x088c('0xd')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x44f89b,_0x088c('0xc'),JSON[_0x088c('0xe')](_0x446e05));if(_0x446e05['error']){if(_0x446e05[_0x088c('0xf')]['code']===0x1f4){logger[_0x088c('0xf')](_0x088c('0xb'),_0x44f89b,_0x446e05[_0x088c('0xf')]['message']);return _0x50f61c(_0x446e05[_0x088c('0xf')][_0x088c('0x10')]);}logger[_0x088c('0xf')](_0x088c('0xb'),_0x44f89b,_0x446e05['error']['message']);return _0xa09013(_0x446e05[_0x088c('0xf')][_0x088c('0x10')]);}else{logger['info'](_0x088c('0xb'),_0x44f89b,'request\x20sent');_0xa09013(_0x446e05[_0x088c('0x11')][_0x088c('0x10')]);}})[_0x088c('0x12')](function(_0x10a216){logger[_0x088c('0xf')](_0x088c('0xb'),_0x44f89b,_0x10a216);_0x50f61c(_0x10a216);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 98ca7da..3d18269 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 _0x7541=['show','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0xc47c11,_0x943516){var _0x3bcd85=function(_0x134a47){while(--_0x134a47){_0xc47c11['push'](_0xc47c11['shift']());}};_0x3bcd85(++_0x943516);}(_0x7541,0x83));var _0x1754=function(_0x2652ef,_0x234230){_0x2652ef=_0x2652ef-0x0;var _0x2db578=_0x7541[_0x2652ef];return _0x2db578;};'use strict';var multer=require(_0x1754('0x0'));var util=require(_0x1754('0x1'));var path=require('path');var timeout=require(_0x1754('0x2'));var express=require(_0x1754('0x3'));var router=express[_0x1754('0x4')]();var fs_extra=require(_0x1754('0x5'));var auth=require(_0x1754('0x6'));var interaction=require(_0x1754('0x7'));var config=require(_0x1754('0x8'));var controller=require(_0x1754('0x9'));router[_0x1754('0xa')](_0x1754('0xb'),auth[_0x1754('0xc')](),controller[_0x1754('0xd')]);router[_0x1754('0xe')](_0x1754('0xb'),auth[_0x1754('0xc')](),controller[_0x1754('0xf')]);router['delete'](_0x1754('0xb'),auth[_0x1754('0xc')](),controller[_0x1754('0x10')]);module[_0x1754('0x11')]=router; \ No newline at end of file +var _0x4fb3=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','exports','multer'];(function(_0x33ca22,_0xbcc94){var _0x1790c3=function(_0x448b06){while(--_0x448b06){_0x33ca22['push'](_0x33ca22['shift']());}};_0x1790c3(++_0xbcc94);}(_0x4fb3,0xb5));var _0x34fb=function(_0x300e3a,_0x25164b){_0x300e3a=_0x300e3a-0x0;var _0xbdd812=_0x4fb3[_0x300e3a];return _0xbdd812;};'use strict';var multer=require(_0x34fb('0x0'));var util=require('util');var path=require(_0x34fb('0x1'));var timeout=require(_0x34fb('0x2'));var express=require(_0x34fb('0x3'));var router=express[_0x34fb('0x4')]();var fs_extra=require(_0x34fb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x34fb('0x6'));var config=require(_0x34fb('0x7'));var controller=require(_0x34fb('0x8'));router['get'](_0x34fb('0x9'),auth[_0x34fb('0xa')](),controller[_0x34fb('0xb')]);router['put'](_0x34fb('0x9'),auth[_0x34fb('0xa')](),controller['update']);router['delete'](_0x34fb('0x9'),auth[_0x34fb('0xa')](),controller['destroy']);module[_0x34fb('0xc')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 6130d98..5b73301 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 _0xb209=['STRING','sequelize','exports'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0xb209,0x6d));var _0x9b20=function(_0x2fce1b,_0x18bfe9){_0x2fce1b=_0x2fce1b-0x0;var _0x5d2b69=_0xb209[_0x2fce1b];return _0x5d2b69;};'use strict';var Sequelize=require(_0x9b20('0x0'));module[_0x9b20('0x1')]={'name':{'type':Sequelize[_0x9b20('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9b20('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x8b02=['STRING','BOOLEAN'];(function(_0x5452b9,_0x3e1158){var _0x218041=function(_0x566dd1){while(--_0x566dd1){_0x5452b9['push'](_0x5452b9['shift']());}};_0x218041(++_0x3e1158);}(_0x8b02,0x94));var _0x28b0=function(_0x1731bd,_0x4830f0){_0x1731bd=_0x1731bd-0x0;var _0x33e629=_0x8b02[_0x1731bd];return _0x33e629;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x28b0('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x28b0('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index e22ee29..c75a874 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 _0x0f88=['getMembers','hasOwnProperty','removeMembers','ids','ChatInternalMessage','getMessages','pick','$gte','format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ChatGroup','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','describe','getUnread','user','addMembers','omit','findOne','User','merge'];(function(_0x41dc14,_0xfe7034){var _0x254684=function(_0x32a649){while(--_0x32a649){_0x41dc14['push'](_0x41dc14['shift']());}};_0x254684(++_0xfe7034);}(_0x0f88,0x64));var _0x80f8=function(_0x402845,_0x34addd){_0x402845=_0x402845-0x0;var _0x47fd8f=_0x0f88[_0x402845];return _0x47fd8f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x80f8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x80f8('0x1'));var rp=require('request-promise');var moment=require(_0x80f8('0x2'));var BPromise=require(_0x80f8('0x3'));var Mustache=require('mustache');var util=require(_0x80f8('0x4'));var path=require(_0x80f8('0x5'));var sox=require(_0x80f8('0x6'));var csv=require(_0x80f8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x80f8('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x80f8('0x9'));var jsforce=require(_0x80f8('0xa'));var deskjs=require(_0x80f8('0xb'));var toCsv=require('to-csv');var querystring=require(_0x80f8('0xc'));var Papa=require(_0x80f8('0xd'));var Redis=require(_0x80f8('0xe'));var authService=require(_0x80f8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x80f8('0x10'));var hardwareService=require(_0x80f8('0x11'));var logger=require('../../config/logger')(_0x80f8('0x12'));var utils=require(_0x80f8('0x13'));var config=require(_0x80f8('0x14'));var licenseUtil=require(_0x80f8('0x15'));var db=require(_0x80f8('0x16'))['db'];config[_0x80f8('0x17')]=_[_0x80f8('0x18')](config['redis'],{'host':_0x80f8('0x19'),'port':0x18eb});var socket=require(_0x80f8('0x1a'))(new Redis(config[_0x80f8('0x17')]));require(_0x80f8('0x1b'))[_0x80f8('0x1c')](socket);function respondWithStatusCode(_0x5d01b0,_0x2ba5e5){_0x2ba5e5=_0x2ba5e5||0xcc;return function(_0x34361e){if(_0x34361e){return _0x5d01b0['sendStatus'](_0x2ba5e5);}return _0x5d01b0[_0x80f8('0x1d')](_0x2ba5e5)['end']();};}function respondWithResult(_0xb19aba,_0x340fed){_0x340fed=_0x340fed||0xc8;return function(_0xba2f93){if(_0xba2f93){return _0xb19aba['status'](_0x340fed)[_0x80f8('0x1e')](_0xba2f93);}};}function respondWithFilteredResult(_0x1ea7df,_0x573c1a){return function(_0xf09c0c){if(_0xf09c0c){var _0x2c657b=typeof _0x573c1a['offset']==='undefined'&&typeof _0x573c1a[_0x80f8('0x1f')]===_0x80f8('0x20');var _0x7667ed=_0xf09c0c[_0x80f8('0x21')];var _0x40f345=_0x2c657b?0x0:_0x573c1a[_0x80f8('0x22')];var _0x5ec78c=_0x2c657b?_0xf09c0c[_0x80f8('0x21')]:_0x573c1a[_0x80f8('0x22')]+_0x573c1a[_0x80f8('0x1f')];var _0x239060;if(_0x5ec78c>=_0x7667ed){_0x5ec78c=_0x7667ed;_0x239060=0xc8;}else{_0x239060=0xce;}_0x1ea7df[_0x80f8('0x1d')](_0x239060);return _0x1ea7df[_0x80f8('0x23')](_0x80f8('0x24'),_0x40f345+'-'+_0x5ec78c+'/'+_0x7667ed)['json'](_0xf09c0c);}return null;};}function patchUpdates(_0x260876){return function(_0x3445e2){try{jsonpatch[_0x80f8('0x25')](_0x3445e2,_0x260876,!![]);}catch(_0x51b0ab){return BPromise[_0x80f8('0x26')](_0x51b0ab);}return _0x3445e2[_0x80f8('0x27')]();};}function saveUpdates(_0x3daf3e,_0x47fe91){return function(_0x1721a6){if(_0x1721a6){return _0x1721a6[_0x80f8('0x28')](_0x3daf3e)[_0x80f8('0x29')](function(_0x105016){return _0x105016;});}return null;};}function removeEntity(_0xb6fe6a,_0x230583){return function(_0xe1f710){if(_0xe1f710){return _0xe1f710[_0x80f8('0x2a')]()[_0x80f8('0x29')](function(){_0xb6fe6a[_0x80f8('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ad5b0,_0x40787d){return function(_0x27e146){if(!_0x27e146){_0x5ad5b0['sendStatus'](0x194);}return _0x27e146;};}function handleError(_0x3796e3,_0x523340){_0x523340=_0x523340||0x1f4;return function(_0x29d97c){logger['error'](_0x29d97c[_0x80f8('0x2b')]);if(_0x29d97c[_0x80f8('0x2c')]){delete _0x29d97c['name'];}_0x3796e3[_0x80f8('0x1d')](_0x523340)[_0x80f8('0x2d')](_0x29d97c);};}exports[_0x80f8('0x2e')]=function(_0x4672f6,_0x5123f9){var _0x437194={},_0x29c403={},_0x403100={'count':0x0,'rows':[]};var _0x51c774=_[_0x80f8('0x2f')](db[_0x80f8('0x30')]['rawAttributes'],function(_0x445250){return{'name':_0x445250['fieldName'],'type':_0x445250[_0x80f8('0x31')]['key']};});_0x29c403[_0x80f8('0x32')]=_[_0x80f8('0x2f')](_0x51c774,'name');_0x29c403[_0x80f8('0x33')]=_[_0x80f8('0x34')](_0x4672f6[_0x80f8('0x33')]);_0x29c403[_0x80f8('0x35')]=_[_0x80f8('0x36')](_0x29c403['model'],_0x29c403[_0x80f8('0x33')]);_0x437194[_0x80f8('0x37')]=_[_0x80f8('0x36')](_0x29c403[_0x80f8('0x32')],qs[_0x80f8('0x38')](_0x4672f6[_0x80f8('0x33')][_0x80f8('0x38')]));_0x437194[_0x80f8('0x37')]=_0x437194['attributes'][_0x80f8('0x39')]?_0x437194[_0x80f8('0x37')]:_0x29c403[_0x80f8('0x32')];if(!_0x4672f6[_0x80f8('0x33')]['hasOwnProperty'](_0x80f8('0x3a'))){_0x437194['limit']=qs['limit'](_0x4672f6[_0x80f8('0x33')][_0x80f8('0x1f')]);_0x437194[_0x80f8('0x22')]=qs[_0x80f8('0x22')](_0x4672f6[_0x80f8('0x33')][_0x80f8('0x22')]);}_0x437194[_0x80f8('0x3b')]=qs[_0x80f8('0x3c')](_0x4672f6[_0x80f8('0x33')][_0x80f8('0x3c')]);_0x437194[_0x80f8('0x3d')]=qs['filters'](_['pick'](_0x4672f6[_0x80f8('0x33')],_0x29c403[_0x80f8('0x35')]),_0x51c774);if(_0x4672f6[_0x80f8('0x33')][_0x80f8('0x3e')]){_0x437194[_0x80f8('0x3d')]=_['merge'](_0x437194[_0x80f8('0x3d')],{'$or':_[_0x80f8('0x2f')](_0x51c774,function(_0x6bd059){if(_0x6bd059[_0x80f8('0x31')]!==_0x80f8('0x3f')){var _0x4269de={};_0x4269de[_0x6bd059['name']]={'$like':'%'+_0x4672f6['query']['filter']+'%'};return _0x4269de;}})});}_0x437194=_['merge']({},_0x437194,_0x4672f6[_0x80f8('0x40')]);var _0x341a4f={'where':_0x437194['where']};return db['ChatGroup'][_0x80f8('0x21')](_0x341a4f)[_0x80f8('0x29')](function(_0xbba104){_0x403100[_0x80f8('0x21')]=_0xbba104;if(_0x4672f6[_0x80f8('0x33')][_0x80f8('0x41')]){_0x437194[_0x80f8('0x42')]=[{'all':!![]}];}return db[_0x80f8('0x30')][_0x80f8('0x43')](_0x437194);})['then'](function(_0x16e6e8){_0x403100['rows']=_0x16e6e8;return _0x403100;})[_0x80f8('0x29')](respondWithFilteredResult(_0x5123f9,_0x437194))[_0x80f8('0x44')](handleError(_0x5123f9,null));};exports['show']=function(_0x3b591c,_0x238674){var _0x393ae9={'raw':!![],'where':{'id':_0x3b591c[_0x80f8('0x45')]['id']}},_0x103380={};_0x103380[_0x80f8('0x32')]=_[_0x80f8('0x34')](db[_0x80f8('0x30')][_0x80f8('0x46')]);_0x103380[_0x80f8('0x33')]=_[_0x80f8('0x34')](_0x3b591c[_0x80f8('0x33')]);_0x103380[_0x80f8('0x35')]=_[_0x80f8('0x36')](_0x103380[_0x80f8('0x32')],_0x103380[_0x80f8('0x33')]);_0x393ae9[_0x80f8('0x37')]=_[_0x80f8('0x36')](_0x103380[_0x80f8('0x32')],qs[_0x80f8('0x38')](_0x3b591c[_0x80f8('0x33')][_0x80f8('0x38')]));_0x393ae9[_0x80f8('0x37')]=_0x393ae9[_0x80f8('0x37')][_0x80f8('0x39')]?_0x393ae9[_0x80f8('0x37')]:_0x103380[_0x80f8('0x32')];if(_0x3b591c[_0x80f8('0x33')][_0x80f8('0x41')]){_0x393ae9[_0x80f8('0x42')]=[{'all':!![]}];}_0x393ae9=_['merge']({},_0x393ae9,_0x3b591c[_0x80f8('0x40')]);return db[_0x80f8('0x30')][_0x80f8('0x47')](_0x393ae9)[_0x80f8('0x29')](handleEntityNotFound(_0x238674,null))[_0x80f8('0x29')](respondWithResult(_0x238674,null))[_0x80f8('0x44')](handleError(_0x238674,null));};exports[_0x80f8('0x48')]=function(_0x314a6f,_0x56c4b){return db[_0x80f8('0x30')][_0x80f8('0x48')](_0x314a6f[_0x80f8('0x49')],{})[_0x80f8('0x29')](respondWithResult(_0x56c4b,0xc9))[_0x80f8('0x44')](handleError(_0x56c4b,null));};exports[_0x80f8('0x28')]=function(_0xa6468,_0x2bb230){if(_0xa6468[_0x80f8('0x49')]['id']){delete _0xa6468['body']['id'];}return db[_0x80f8('0x30')]['find']({'where':{'id':_0xa6468['params']['id']}})[_0x80f8('0x29')](handleEntityNotFound(_0x2bb230,null))[_0x80f8('0x29')](saveUpdates(_0xa6468['body'],null))[_0x80f8('0x29')](respondWithResult(_0x2bb230,null))[_0x80f8('0x44')](handleError(_0x2bb230,null));};exports[_0x80f8('0x2a')]=function(_0x59e9c1,_0x6e585e){return db['ChatGroup']['find']({'where':{'id':_0x59e9c1['params']['id']}})[_0x80f8('0x29')](handleEntityNotFound(_0x6e585e,null))[_0x80f8('0x29')](removeEntity(_0x6e585e,null))[_0x80f8('0x44')](handleError(_0x6e585e,null));};exports[_0x80f8('0x4a')]=function(_0x59c5b1,_0x4919a9){return db[_0x80f8('0x30')][_0x80f8('0x4a')]()['then'](respondWithResult(_0x4919a9,null))[_0x80f8('0x44')](handleError(_0x4919a9,null));};exports[_0x80f8('0x4b')]=function(_0x2c8262,_0x53849d,_0x166bfd){return db['ChatInternalMessage'][_0x80f8('0x21')]({'where':{'ChatGroupId':_0x2c8262['params']['id'],'ToId':_0x2c8262[_0x80f8('0x4c')]['id'],'read':![]}})[_0x80f8('0x29')](function(_0x56283f){return{'id':_['toInteger'](_0x2c8262['params']['id']),'count':_0x56283f};})[_0x80f8('0x29')](respondWithResult(_0x53849d,null))[_0x80f8('0x44')](handleError(_0x53849d,null));};exports[_0x80f8('0x4d')]=function(_0x2d8111,_0x34c2ff,_0x14e481){return db[_0x80f8('0x30')][_0x80f8('0x47')]({'where':{'id':_0x2d8111[_0x80f8('0x45')]['id']}})['then'](handleEntityNotFound(_0x34c2ff,null))['then'](function(_0x105746){if(_0x105746){return _0x105746[_0x80f8('0x4d')](_0x2d8111[_0x80f8('0x49')]['ids'],_[_0x80f8('0x4e')](_0x2d8111['body'],['ids','id'])||{});}})[_0x80f8('0x29')](respondWithResult(_0x34c2ff,null))['catch'](handleError(_0x34c2ff,null));};exports['getMembers']=function(_0x9ece10,_0x6f3bc0,_0x37850e){var _0x48e043={};var _0x4a9503={};var _0x7445ac;var _0x26948e;return db[_0x80f8('0x30')][_0x80f8('0x4f')]({'where':{'id':_0x9ece10[_0x80f8('0x45')]['id']}})[_0x80f8('0x29')](handleEntityNotFound(_0x6f3bc0,null))['then'](function(_0x361b90){if(_0x361b90){_0x7445ac=_0x361b90;_0x4a9503[_0x80f8('0x32')]=_[_0x80f8('0x34')](db[_0x80f8('0x50')][_0x80f8('0x46')]);_0x4a9503['query']=_['keys'](_0x9ece10[_0x80f8('0x33')]);_0x4a9503[_0x80f8('0x35')]=_[_0x80f8('0x36')](_0x4a9503['model'],_0x4a9503['query']);_0x48e043[_0x80f8('0x37')]=_['intersection'](_0x4a9503[_0x80f8('0x32')],qs[_0x80f8('0x38')](_0x9ece10['query'][_0x80f8('0x38')]));_0x48e043[_0x80f8('0x37')]=_0x48e043[_0x80f8('0x37')][_0x80f8('0x39')]?_0x48e043[_0x80f8('0x37')]:_0x4a9503[_0x80f8('0x32')];_0x48e043[_0x80f8('0x3b')]=qs[_0x80f8('0x3c')](_0x9ece10[_0x80f8('0x33')]['sort']);_0x48e043['where']=qs[_0x80f8('0x35')](_['pick'](_0x9ece10[_0x80f8('0x33')],_0x4a9503[_0x80f8('0x35')]));if(_0x9ece10['query'][_0x80f8('0x3e')]){_0x48e043[_0x80f8('0x3d')]=_['merge'](_0x48e043[_0x80f8('0x3d')],{'$or':_[_0x80f8('0x2f')](_0x48e043[_0x80f8('0x37')],function(_0x6b9deb){var _0x43b321={};_0x43b321[_0x6b9deb]={'$like':'%'+_0x9ece10[_0x80f8('0x33')][_0x80f8('0x3e')]+'%'};return _0x43b321;})});}_0x48e043=_[_0x80f8('0x51')]({},_0x48e043,_0x9ece10[_0x80f8('0x40')]);return _0x7445ac[_0x80f8('0x52')](_0x48e043);}})[_0x80f8('0x29')](function(_0x561da1){if(_0x561da1){_0x26948e=_0x561da1[_0x80f8('0x39')];if(!_0x9ece10[_0x80f8('0x33')][_0x80f8('0x53')](_0x80f8('0x3a'))){_0x48e043[_0x80f8('0x1f')]=qs[_0x80f8('0x1f')](_0x9ece10[_0x80f8('0x33')][_0x80f8('0x1f')]);_0x48e043[_0x80f8('0x22')]=qs[_0x80f8('0x22')](_0x9ece10['query']['offset']);}return _0x7445ac[_0x80f8('0x52')](_0x48e043);}})[_0x80f8('0x29')](function(_0x199a56){if(_0x199a56){return _0x199a56?{'count':_0x26948e,'rows':_0x199a56}:null;}})[_0x80f8('0x29')](respondWithResult(_0x6f3bc0,null))[_0x80f8('0x44')](handleError(_0x6f3bc0,null));};exports[_0x80f8('0x54')]=function(_0x1f8573,_0x22ab61,_0x15caa8){return db[_0x80f8('0x30')][_0x80f8('0x47')]({'where':{'id':_0x1f8573[_0x80f8('0x45')]['id']}})[_0x80f8('0x29')](handleEntityNotFound(_0x22ab61,null))[_0x80f8('0x29')](function(_0x23cc9c){if(_0x23cc9c){return _0x23cc9c[_0x80f8('0x54')](_0x1f8573[_0x80f8('0x33')][_0x80f8('0x55')]);}})['then'](respondWithStatusCode(_0x22ab61,null))['catch'](handleError(_0x22ab61,null));};exports['addMessage']=function(_0xab136,_0x188aa7,_0x266e02){if(_0xab136[_0x80f8('0x49')]['id']){delete _0xab136['body']['id'];}return db[_0x80f8('0x30')][_0x80f8('0x47')]({'where':{'id':_0xab136['params']['id']}})['then'](handleEntityNotFound(_0x188aa7,null))['then'](function(_0x2a048e){if(_0x2a048e){_0xab136[_0x80f8('0x49')]['ChatGroupId']=_0x2a048e['id'];return db[_0x80f8('0x56')][_0x80f8('0x48')](_0xab136[_0x80f8('0x49')]);}})['then'](respondWithResult(_0x188aa7,null))[_0x80f8('0x44')](handleError(_0x188aa7,null));};exports[_0x80f8('0x57')]=function(_0x2ef811,_0x139a36,_0x581286){var _0x678a63={};var _0x1355a5={};var _0x52812a;var _0x4bea63;return db[_0x80f8('0x30')][_0x80f8('0x4f')]({'where':{'id':_0x2ef811['params']['id']}})[_0x80f8('0x29')](handleEntityNotFound(_0x139a36,null))[_0x80f8('0x29')](function(_0x302525){if(_0x302525){_0x52812a=_0x302525;_0x1355a5[_0x80f8('0x32')]=_[_0x80f8('0x34')](db[_0x80f8('0x56')]['rawAttributes']);_0x1355a5[_0x80f8('0x33')]=_[_0x80f8('0x34')](_0x2ef811[_0x80f8('0x33')]);_0x1355a5[_0x80f8('0x35')]=_[_0x80f8('0x36')](_0x1355a5[_0x80f8('0x32')],_0x1355a5[_0x80f8('0x33')]);_0x678a63['attributes']=_[_0x80f8('0x36')](_0x1355a5[_0x80f8('0x32')],qs['fields'](_0x2ef811[_0x80f8('0x33')][_0x80f8('0x38')]));_0x678a63[_0x80f8('0x37')]=_0x678a63[_0x80f8('0x37')][_0x80f8('0x39')]?_0x678a63[_0x80f8('0x37')]:_0x1355a5[_0x80f8('0x32')];_0x678a63['order']=qs[_0x80f8('0x3c')](_0x2ef811['query'][_0x80f8('0x3c')]);_0x678a63[_0x80f8('0x3d')]=qs[_0x80f8('0x35')](_[_0x80f8('0x58')](_0x2ef811[_0x80f8('0x33')],_0x1355a5['filters']));if(_0x2ef811[_0x80f8('0x33')][_0x80f8('0x3e')]){_0x678a63[_0x80f8('0x3d')]=_[_0x80f8('0x51')](_0x678a63[_0x80f8('0x3d')],{'$or':_[_0x80f8('0x2f')](_0x678a63['attributes'],function(_0x157651){var _0x1dca2b={};_0x1dca2b[_0x157651]={'$like':'%'+_0x2ef811[_0x80f8('0x33')]['filter']+'%'};return _0x1dca2b;})});}if(_0x2ef811[_0x80f8('0x33')][_0x80f8('0x59')]){var _0x1b4a3d=_0x2ef811[_0x80f8('0x33')]['$gte']['split'](',');var _0x44177a={};_0x44177a[_0x1b4a3d[0x0]]={'$gte':moment(_0x1b4a3d[0x1])[_0x80f8('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x678a63[_0x80f8('0x3d')]=_[_0x80f8('0x51')](_0x678a63[_0x80f8('0x3d')],_0x44177a);}_0x678a63=_[_0x80f8('0x51')]({},_0x678a63,_0x2ef811[_0x80f8('0x40')]);return _0x52812a[_0x80f8('0x57')](_0x678a63);}})[_0x80f8('0x29')](function(_0x20c181){if(_0x20c181){_0x4bea63=_0x20c181[_0x80f8('0x39')];if(!_0x2ef811[_0x80f8('0x33')][_0x80f8('0x53')](_0x80f8('0x3a'))){_0x678a63['limit']=qs['limit'](_0x2ef811[_0x80f8('0x33')][_0x80f8('0x1f')]);_0x678a63[_0x80f8('0x22')]=qs[_0x80f8('0x22')](_0x2ef811['query'][_0x80f8('0x22')]);}return _0x52812a['getMessages'](_0x678a63);}})[_0x80f8('0x29')](function(_0x3c52fb){if(_0x3c52fb){return _0x3c52fb?{'count':_0x4bea63,'rows':_0x3c52fb}:null;}})['then'](respondWithResult(_0x139a36,null))[_0x80f8('0x44')](handleError(_0x139a36,null));}; \ No newline at end of file +var _0xc5d6=['order','sort','where','filters','pick','filter','merge','includeAll','include','rows','catch','show','params','rawAttributes','intersection','options','find','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ChatGroup','fieldName','type','key','model','map','keys','query','attributes','fields','length','hasOwnProperty'];(function(_0x588460,_0x54b426){var _0x144a23=function(_0x5b7892){while(--_0x5b7892){_0x588460['push'](_0x588460['shift']());}};_0x144a23(++_0x54b426);}(_0xc5d6,0x19c));var _0x6c5d=function(_0x3c6efc,_0x44841d){_0x3c6efc=_0x3c6efc-0x0;var _0x386160=_0xc5d6[_0x3c6efc];return _0x386160;};'use strict';var emlformat=require(_0x6c5d('0x0'));var rimraf=require(_0x6c5d('0x1'));var zipdir=require(_0x6c5d('0x2'));var jsonpatch=require(_0x6c5d('0x3'));var rp=require('request-promise');var moment=require(_0x6c5d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6c5d('0x5'));var util=require('util');var path=require(_0x6c5d('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6c5d('0x7'));var fs=require('fs');var fs_extra=require(_0x6c5d('0x8'));var _=require(_0x6c5d('0x9'));var squel=require(_0x6c5d('0xa'));var crypto=require(_0x6c5d('0xb'));var jsforce=require(_0x6c5d('0xc'));var deskjs=require(_0x6c5d('0xd'));var toCsv=require(_0x6c5d('0xe'));var querystring=require(_0x6c5d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6c5d('0x10'));var qs=require(_0x6c5d('0x11'));var as=require(_0x6c5d('0x12'));var hardwareService=require(_0x6c5d('0x13'));var logger=require(_0x6c5d('0x14'))(_0x6c5d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6c5d('0x16')]=_[_0x6c5d('0x17')](config[_0x6c5d('0x16')],{'host':_0x6c5d('0x18'),'port':0x18eb});var socket=require(_0x6c5d('0x19'))(new Redis(config['redis']));require(_0x6c5d('0x1a'))['register'](socket);function respondWithStatusCode(_0x122fc6,_0x5786e6){_0x5786e6=_0x5786e6||0xcc;return function(_0x17e933){if(_0x17e933){return _0x122fc6[_0x6c5d('0x1b')](_0x5786e6);}return _0x122fc6[_0x6c5d('0x1c')](_0x5786e6)[_0x6c5d('0x1d')]();};}function respondWithResult(_0x3b0683,_0x582353){_0x582353=_0x582353||0xc8;return function(_0x5c86e2){if(_0x5c86e2){return _0x3b0683[_0x6c5d('0x1c')](_0x582353)[_0x6c5d('0x1e')](_0x5c86e2);}};}function respondWithFilteredResult(_0x102e9f,_0x3a15c5){return function(_0x1fc128){if(_0x1fc128){var _0x4a1a14=typeof _0x3a15c5[_0x6c5d('0x1f')]==='undefined'&&typeof _0x3a15c5[_0x6c5d('0x20')]==='undefined';var _0x468972=_0x1fc128[_0x6c5d('0x21')];var _0x3ca9e3=_0x4a1a14?0x0:_0x3a15c5[_0x6c5d('0x1f')];var _0x5546a1=_0x4a1a14?_0x1fc128[_0x6c5d('0x21')]:_0x3a15c5[_0x6c5d('0x1f')]+_0x3a15c5['limit'];var _0x1c1a16;if(_0x5546a1>=_0x468972){_0x5546a1=_0x468972;_0x1c1a16=0xc8;}else{_0x1c1a16=0xce;}_0x102e9f[_0x6c5d('0x1c')](_0x1c1a16);return _0x102e9f['set'](_0x6c5d('0x22'),_0x3ca9e3+'-'+_0x5546a1+'/'+_0x468972)[_0x6c5d('0x1e')](_0x1fc128);}return null;};}function patchUpdates(_0x55a896){return function(_0x5b7914){try{jsonpatch[_0x6c5d('0x23')](_0x5b7914,_0x55a896,!![]);}catch(_0x164ed0){return BPromise[_0x6c5d('0x24')](_0x164ed0);}return _0x5b7914[_0x6c5d('0x25')]();};}function saveUpdates(_0x2134b0,_0x465202){return function(_0x4735bf){if(_0x4735bf){return _0x4735bf[_0x6c5d('0x26')](_0x2134b0)[_0x6c5d('0x27')](function(_0x4b67ed){return _0x4b67ed;});}return null;};}function removeEntity(_0x1fb2e2,_0x201602){return function(_0x29cdba){if(_0x29cdba){return _0x29cdba[_0x6c5d('0x28')]()[_0x6c5d('0x27')](function(){_0x1fb2e2[_0x6c5d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x474443,_0x27ba8c){return function(_0x223229){if(!_0x223229){_0x474443['sendStatus'](0x194);}return _0x223229;};}function handleError(_0xb74692,_0x424fa2){_0x424fa2=_0x424fa2||0x1f4;return function(_0x922f2a){logger[_0x6c5d('0x29')](_0x922f2a[_0x6c5d('0x2a')]);if(_0x922f2a[_0x6c5d('0x2b')]){delete _0x922f2a[_0x6c5d('0x2b')];}_0xb74692[_0x6c5d('0x1c')](_0x424fa2)[_0x6c5d('0x2c')](_0x922f2a);};}exports[_0x6c5d('0x2d')]=function(_0xf7752c,_0x29f604){var _0x581824={},_0x4220da={},_0x3b0f03={'count':0x0,'rows':[]};var _0x44d7a7=_['map'](db[_0x6c5d('0x2e')]['rawAttributes'],function(_0xf8a441){return{'name':_0xf8a441[_0x6c5d('0x2f')],'type':_0xf8a441[_0x6c5d('0x30')][_0x6c5d('0x31')]};});_0x4220da[_0x6c5d('0x32')]=_[_0x6c5d('0x33')](_0x44d7a7,'name');_0x4220da['query']=_[_0x6c5d('0x34')](_0xf7752c[_0x6c5d('0x35')]);_0x4220da['filters']=_['intersection'](_0x4220da['model'],_0x4220da[_0x6c5d('0x35')]);_0x581824[_0x6c5d('0x36')]=_['intersection'](_0x4220da[_0x6c5d('0x32')],qs[_0x6c5d('0x37')](_0xf7752c[_0x6c5d('0x35')][_0x6c5d('0x37')]));_0x581824['attributes']=_0x581824['attributes'][_0x6c5d('0x38')]?_0x581824[_0x6c5d('0x36')]:_0x4220da['model'];if(!_0xf7752c[_0x6c5d('0x35')][_0x6c5d('0x39')]('nolimit')){_0x581824['limit']=qs[_0x6c5d('0x20')](_0xf7752c[_0x6c5d('0x35')][_0x6c5d('0x20')]);_0x581824['offset']=qs[_0x6c5d('0x1f')](_0xf7752c[_0x6c5d('0x35')][_0x6c5d('0x1f')]);}_0x581824[_0x6c5d('0x3a')]=qs[_0x6c5d('0x3b')](_0xf7752c[_0x6c5d('0x35')][_0x6c5d('0x3b')]);_0x581824[_0x6c5d('0x3c')]=qs[_0x6c5d('0x3d')](_[_0x6c5d('0x3e')](_0xf7752c[_0x6c5d('0x35')],_0x4220da['filters']),_0x44d7a7);if(_0xf7752c[_0x6c5d('0x35')][_0x6c5d('0x3f')]){_0x581824[_0x6c5d('0x3c')]=_[_0x6c5d('0x40')](_0x581824[_0x6c5d('0x3c')],{'$or':_[_0x6c5d('0x33')](_0x44d7a7,function(_0x23d0d7){if(_0x23d0d7[_0x6c5d('0x30')]!=='VIRTUAL'){var _0x4714fc={};_0x4714fc[_0x23d0d7[_0x6c5d('0x2b')]]={'$like':'%'+_0xf7752c['query'][_0x6c5d('0x3f')]+'%'};return _0x4714fc;}})});}_0x581824=_[_0x6c5d('0x40')]({},_0x581824,_0xf7752c['options']);var _0x37f300={'where':_0x581824['where']};return db[_0x6c5d('0x2e')][_0x6c5d('0x21')](_0x37f300)[_0x6c5d('0x27')](function(_0x1fbdb6){_0x3b0f03[_0x6c5d('0x21')]=_0x1fbdb6;if(_0xf7752c[_0x6c5d('0x35')][_0x6c5d('0x41')]){_0x581824[_0x6c5d('0x42')]=[{'all':!![]}];}return db[_0x6c5d('0x2e')]['findAll'](_0x581824);})[_0x6c5d('0x27')](function(_0x16b9f4){_0x3b0f03[_0x6c5d('0x43')]=_0x16b9f4;return _0x3b0f03;})[_0x6c5d('0x27')](respondWithFilteredResult(_0x29f604,_0x581824))[_0x6c5d('0x44')](handleError(_0x29f604,null));};exports[_0x6c5d('0x45')]=function(_0x217ec4,_0x1338b4){var _0x9dbfc2={'raw':!![],'where':{'id':_0x217ec4[_0x6c5d('0x46')]['id']}},_0xb9a0bb={};_0xb9a0bb['model']=_[_0x6c5d('0x34')](db[_0x6c5d('0x2e')][_0x6c5d('0x47')]);_0xb9a0bb['query']=_[_0x6c5d('0x34')](_0x217ec4[_0x6c5d('0x35')]);_0xb9a0bb[_0x6c5d('0x3d')]=_[_0x6c5d('0x48')](_0xb9a0bb[_0x6c5d('0x32')],_0xb9a0bb['query']);_0x9dbfc2[_0x6c5d('0x36')]=_[_0x6c5d('0x48')](_0xb9a0bb[_0x6c5d('0x32')],qs[_0x6c5d('0x37')](_0x217ec4[_0x6c5d('0x35')][_0x6c5d('0x37')]));_0x9dbfc2[_0x6c5d('0x36')]=_0x9dbfc2[_0x6c5d('0x36')][_0x6c5d('0x38')]?_0x9dbfc2['attributes']:_0xb9a0bb[_0x6c5d('0x32')];if(_0x217ec4[_0x6c5d('0x35')][_0x6c5d('0x41')]){_0x9dbfc2[_0x6c5d('0x42')]=[{'all':!![]}];}_0x9dbfc2=_[_0x6c5d('0x40')]({},_0x9dbfc2,_0x217ec4[_0x6c5d('0x49')]);return db[_0x6c5d('0x2e')][_0x6c5d('0x4a')](_0x9dbfc2)[_0x6c5d('0x27')](handleEntityNotFound(_0x1338b4,null))[_0x6c5d('0x27')](respondWithResult(_0x1338b4,null))[_0x6c5d('0x44')](handleError(_0x1338b4,null));};exports[_0x6c5d('0x4b')]=function(_0x871037,_0x10ef98){return db[_0x6c5d('0x2e')][_0x6c5d('0x4b')](_0x871037[_0x6c5d('0x4c')],{})[_0x6c5d('0x27')](respondWithResult(_0x10ef98,0xc9))['catch'](handleError(_0x10ef98,null));};exports[_0x6c5d('0x26')]=function(_0x491194,_0x3998da){if(_0x491194[_0x6c5d('0x4c')]['id']){delete _0x491194[_0x6c5d('0x4c')]['id'];}return db['ChatGroup'][_0x6c5d('0x4a')]({'where':{'id':_0x491194[_0x6c5d('0x46')]['id']}})[_0x6c5d('0x27')](handleEntityNotFound(_0x3998da,null))['then'](saveUpdates(_0x491194['body'],null))[_0x6c5d('0x27')](respondWithResult(_0x3998da,null))[_0x6c5d('0x44')](handleError(_0x3998da,null));};exports[_0x6c5d('0x28')]=function(_0x3f2fd3,_0x52365f){return db['ChatGroup'][_0x6c5d('0x4a')]({'where':{'id':_0x3f2fd3[_0x6c5d('0x46')]['id']}})['then'](handleEntityNotFound(_0x52365f,null))[_0x6c5d('0x27')](removeEntity(_0x52365f,null))[_0x6c5d('0x44')](handleError(_0x52365f,null));};exports[_0x6c5d('0x4d')]=function(_0xb97c00,_0x2d731e){return db['ChatGroup'][_0x6c5d('0x4d')]()[_0x6c5d('0x27')](respondWithResult(_0x2d731e,null))[_0x6c5d('0x44')](handleError(_0x2d731e,null));};exports['getUnread']=function(_0xcf571e,_0x4c90ea,_0x39b014){return db[_0x6c5d('0x4e')][_0x6c5d('0x21')]({'where':{'ChatGroupId':_0xcf571e[_0x6c5d('0x46')]['id'],'ToId':_0xcf571e[_0x6c5d('0x4f')]['id'],'read':![]}})[_0x6c5d('0x27')](function(_0x35bf31){return{'id':_[_0x6c5d('0x50')](_0xcf571e['params']['id']),'count':_0x35bf31};})[_0x6c5d('0x27')](respondWithResult(_0x4c90ea,null))[_0x6c5d('0x44')](handleError(_0x4c90ea,null));};exports[_0x6c5d('0x51')]=function(_0x445a92,_0x258351,_0x28473d){return db['ChatGroup']['find']({'where':{'id':_0x445a92[_0x6c5d('0x46')]['id']}})['then'](handleEntityNotFound(_0x258351,null))[_0x6c5d('0x27')](function(_0x11ccf8){if(_0x11ccf8){return _0x11ccf8[_0x6c5d('0x51')](_0x445a92[_0x6c5d('0x4c')][_0x6c5d('0x52')],_['omit'](_0x445a92[_0x6c5d('0x4c')],[_0x6c5d('0x52'),'id'])||{});}})[_0x6c5d('0x27')](respondWithResult(_0x258351,null))['catch'](handleError(_0x258351,null));};exports[_0x6c5d('0x53')]=function(_0x509a07,_0x4dd3d1,_0x3dd8ab){var _0x4785e5={};var _0x523c18={};var _0x343f03;var _0x4eedc4;return db['ChatGroup'][_0x6c5d('0x54')]({'where':{'id':_0x509a07[_0x6c5d('0x46')]['id']}})['then'](handleEntityNotFound(_0x4dd3d1,null))['then'](function(_0x11189b){if(_0x11189b){_0x343f03=_0x11189b;_0x523c18[_0x6c5d('0x32')]=_[_0x6c5d('0x34')](db['User']['rawAttributes']);_0x523c18[_0x6c5d('0x35')]=_[_0x6c5d('0x34')](_0x509a07[_0x6c5d('0x35')]);_0x523c18[_0x6c5d('0x3d')]=_[_0x6c5d('0x48')](_0x523c18['model'],_0x523c18[_0x6c5d('0x35')]);_0x4785e5['attributes']=_['intersection'](_0x523c18['model'],qs['fields'](_0x509a07[_0x6c5d('0x35')][_0x6c5d('0x37')]));_0x4785e5[_0x6c5d('0x36')]=_0x4785e5[_0x6c5d('0x36')][_0x6c5d('0x38')]?_0x4785e5[_0x6c5d('0x36')]:_0x523c18[_0x6c5d('0x32')];_0x4785e5['order']=qs['sort'](_0x509a07[_0x6c5d('0x35')][_0x6c5d('0x3b')]);_0x4785e5['where']=qs[_0x6c5d('0x3d')](_[_0x6c5d('0x3e')](_0x509a07['query'],_0x523c18['filters']));if(_0x509a07[_0x6c5d('0x35')][_0x6c5d('0x3f')]){_0x4785e5['where']=_[_0x6c5d('0x40')](_0x4785e5[_0x6c5d('0x3c')],{'$or':_[_0x6c5d('0x33')](_0x4785e5[_0x6c5d('0x36')],function(_0x207b7d){var _0x1661ec={};_0x1661ec[_0x207b7d]={'$like':'%'+_0x509a07[_0x6c5d('0x35')]['filter']+'%'};return _0x1661ec;})});}_0x4785e5=_[_0x6c5d('0x40')]({},_0x4785e5,_0x509a07[_0x6c5d('0x49')]);return _0x343f03['getMembers'](_0x4785e5);}})[_0x6c5d('0x27')](function(_0x1638a9){if(_0x1638a9){_0x4eedc4=_0x1638a9[_0x6c5d('0x38')];if(!_0x509a07['query']['hasOwnProperty'](_0x6c5d('0x55'))){_0x4785e5[_0x6c5d('0x20')]=qs[_0x6c5d('0x20')](_0x509a07['query']['limit']);_0x4785e5['offset']=qs['offset'](_0x509a07[_0x6c5d('0x35')]['offset']);}return _0x343f03[_0x6c5d('0x53')](_0x4785e5);}})['then'](function(_0x3f5f44){if(_0x3f5f44){return _0x3f5f44?{'count':_0x4eedc4,'rows':_0x3f5f44}:null;}})[_0x6c5d('0x27')](respondWithResult(_0x4dd3d1,null))['catch'](handleError(_0x4dd3d1,null));};exports[_0x6c5d('0x56')]=function(_0x3a0d63,_0x4c6a39,_0x4e7c16){return db[_0x6c5d('0x2e')][_0x6c5d('0x4a')]({'where':{'id':_0x3a0d63[_0x6c5d('0x46')]['id']}})[_0x6c5d('0x27')](handleEntityNotFound(_0x4c6a39,null))['then'](function(_0xb1737){if(_0xb1737){return _0xb1737[_0x6c5d('0x56')](_0x3a0d63[_0x6c5d('0x35')][_0x6c5d('0x52')]);}})[_0x6c5d('0x27')](respondWithStatusCode(_0x4c6a39,null))[_0x6c5d('0x44')](handleError(_0x4c6a39,null));};exports[_0x6c5d('0x57')]=function(_0x33e9dd,_0x46be47,_0x36c566){if(_0x33e9dd[_0x6c5d('0x4c')]['id']){delete _0x33e9dd[_0x6c5d('0x4c')]['id'];}return db[_0x6c5d('0x2e')]['find']({'where':{'id':_0x33e9dd[_0x6c5d('0x46')]['id']}})[_0x6c5d('0x27')](handleEntityNotFound(_0x46be47,null))[_0x6c5d('0x27')](function(_0x149924){if(_0x149924){_0x33e9dd[_0x6c5d('0x4c')][_0x6c5d('0x58')]=_0x149924['id'];return db[_0x6c5d('0x4e')]['create'](_0x33e9dd[_0x6c5d('0x4c')]);}})[_0x6c5d('0x27')](respondWithResult(_0x46be47,null))[_0x6c5d('0x44')](handleError(_0x46be47,null));};exports[_0x6c5d('0x59')]=function(_0x4f90cd,_0x5e8d59,_0x2772e9){var _0x43347e={};var _0x36632e={};var _0x281849;var _0x831f5;return db[_0x6c5d('0x2e')]['findOne']({'where':{'id':_0x4f90cd[_0x6c5d('0x46')]['id']}})[_0x6c5d('0x27')](handleEntityNotFound(_0x5e8d59,null))[_0x6c5d('0x27')](function(_0x47c19d){if(_0x47c19d){_0x281849=_0x47c19d;_0x36632e[_0x6c5d('0x32')]=_[_0x6c5d('0x34')](db[_0x6c5d('0x4e')][_0x6c5d('0x47')]);_0x36632e[_0x6c5d('0x35')]=_[_0x6c5d('0x34')](_0x4f90cd[_0x6c5d('0x35')]);_0x36632e['filters']=_[_0x6c5d('0x48')](_0x36632e[_0x6c5d('0x32')],_0x36632e[_0x6c5d('0x35')]);_0x43347e[_0x6c5d('0x36')]=_[_0x6c5d('0x48')](_0x36632e[_0x6c5d('0x32')],qs[_0x6c5d('0x37')](_0x4f90cd[_0x6c5d('0x35')]['fields']));_0x43347e[_0x6c5d('0x36')]=_0x43347e[_0x6c5d('0x36')]['length']?_0x43347e['attributes']:_0x36632e[_0x6c5d('0x32')];_0x43347e[_0x6c5d('0x3a')]=qs[_0x6c5d('0x3b')](_0x4f90cd[_0x6c5d('0x35')][_0x6c5d('0x3b')]);_0x43347e[_0x6c5d('0x3c')]=qs[_0x6c5d('0x3d')](_[_0x6c5d('0x3e')](_0x4f90cd['query'],_0x36632e[_0x6c5d('0x3d')]));if(_0x4f90cd[_0x6c5d('0x35')][_0x6c5d('0x3f')]){_0x43347e['where']=_[_0x6c5d('0x40')](_0x43347e[_0x6c5d('0x3c')],{'$or':_[_0x6c5d('0x33')](_0x43347e[_0x6c5d('0x36')],function(_0x1c3e48){var _0xcc0b48={};_0xcc0b48[_0x1c3e48]={'$like':'%'+_0x4f90cd[_0x6c5d('0x35')][_0x6c5d('0x3f')]+'%'};return _0xcc0b48;})});}if(_0x4f90cd[_0x6c5d('0x35')][_0x6c5d('0x5a')]){var _0x1eca20=_0x4f90cd[_0x6c5d('0x35')][_0x6c5d('0x5a')][_0x6c5d('0x5b')](',');var _0x3eb113={};_0x3eb113[_0x1eca20[0x0]]={'$gte':moment(_0x1eca20[0x1])[_0x6c5d('0x5c')](_0x6c5d('0x5d'))};_0x43347e[_0x6c5d('0x3c')]=_[_0x6c5d('0x40')](_0x43347e['where'],_0x3eb113);}_0x43347e=_[_0x6c5d('0x40')]({},_0x43347e,_0x4f90cd[_0x6c5d('0x49')]);return _0x281849[_0x6c5d('0x59')](_0x43347e);}})[_0x6c5d('0x27')](function(_0x1a92ca){if(_0x1a92ca){_0x831f5=_0x1a92ca['length'];if(!_0x4f90cd[_0x6c5d('0x35')][_0x6c5d('0x39')]('nolimit')){_0x43347e[_0x6c5d('0x20')]=qs[_0x6c5d('0x20')](_0x4f90cd[_0x6c5d('0x35')][_0x6c5d('0x20')]);_0x43347e[_0x6c5d('0x1f')]=qs[_0x6c5d('0x1f')](_0x4f90cd[_0x6c5d('0x35')][_0x6c5d('0x1f')]);}return _0x281849[_0x6c5d('0x59')](_0x43347e);}})[_0x6c5d('0x27')](function(_0x3caf05){if(_0x3caf05){return _0x3caf05?{'count':_0x831f5,'rows':_0x3caf05}:null;}})[_0x6c5d('0x27')](respondWithResult(_0x5e8d59,null))[_0x6c5d('0x44')](handleError(_0x5e8d59,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 5dfa53b..0a0aad0 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 _0x7a02=['exports','../../mysqldb','ChatGroup','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0x7a02,0x1ba));var _0x27a0=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x7a02[_0x486f4a];return _0x135d99;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x27a0('0x0'))['db'][_0x27a0('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x27a0('0x2')](0x0);var events={'afterCreate':_0x27a0('0x3'),'afterUpdate':_0x27a0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x939042){return function(_0x2b3fe8,_0x380a04,_0x46d249){ChatGroupEvents[_0x27a0('0x5')](_0x939042+':'+_0x2b3fe8['id'],_0x2b3fe8);ChatGroupEvents[_0x27a0('0x5')](_0x939042,_0x2b3fe8);_0x46d249(null);};}for(var e in events){if(events[_0x27a0('0x6')](e)){var event=events[e];ChatGroup[_0x27a0('0x7')](e,emitEvent(event));}}module[_0x27a0('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x0b36=['ChatGroup','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x2f47a9,_0x4805d8){var _0x560aa3=function(_0x1df9e4){while(--_0x1df9e4){_0x2f47a9['push'](_0x2f47a9['shift']());}};_0x560aa3(++_0x4805d8);}(_0x0b36,0x10c));var _0x60b3=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0x0b36[_0x419e17];return _0x1f2044;};'use strict';var EventEmitter=require(_0x60b3('0x0'));var ChatGroup=require(_0x60b3('0x1'))['db'][_0x60b3('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x60b3('0x3')};function emitEvent(_0x530d5b){return function(_0xa0e029,_0x19dbae,_0x3afbc7){ChatGroupEvents[_0x60b3('0x4')](_0x530d5b+':'+_0xa0e029['id'],_0xa0e029);ChatGroupEvents[_0x60b3('0x4')](_0x530d5b,_0xa0e029);_0x3afbc7(null);};}for(var e in events){if(events[_0x60b3('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 28a7b37..81bec29 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 _0x65c2=['./chatGroup.attributes','ChatGroup','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x83af7f,_0x49c6fd){var _0x32d85c=function(_0xf0e8bc){while(--_0xf0e8bc){_0x83af7f['push'](_0x83af7f['shift']());}};_0x32d85c(++_0x49c6fd);}(_0x65c2,0x142));var _0x265c=function(_0x45847f,_0x3f579d){_0x45847f=_0x45847f-0x0;var _0x5439d0=_0x65c2[_0x45847f];return _0x5439d0;};'use strict';var _=require(_0x265c('0x0'));var util=require('util');var logger=require(_0x265c('0x1'))(_0x265c('0x2'));var moment=require('moment');var BPromise=require(_0x265c('0x3'));var rp=require(_0x265c('0x4'));var fs=require('fs');var path=require(_0x265c('0x5'));var rimraf=require(_0x265c('0x6'));var config=require(_0x265c('0x7'));var attributes=require(_0x265c('0x8'));module['exports']=function(_0x15b436,_0x2810a8){return _0x15b436['define'](_0x265c('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x29f6=['api','moment','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','../../config/logger'];(function(_0x330414,_0x4f3207){var _0x99dbff=function(_0x166f85){while(--_0x166f85){_0x330414['push'](_0x330414['shift']());}};_0x99dbff(++_0x4f3207);}(_0x29f6,0xb9));var _0x629f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29f6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x629f('0x0'));var util=require('util');var logger=require(_0x629f('0x1'))(_0x629f('0x2'));var moment=require(_0x629f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x629f('0x4'));var rimraf=require(_0x629f('0x5'));var config=require('../../config/environment');var attributes=require(_0x629f('0x6'));module[_0x629f('0x7')]=function(_0x57554c,_0x1a92e2){return _0x57554c[_0x629f('0x8')](_0x629f('0x9'),attributes,{'tableName':_0x629f('0xa'),'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 ddd5e00..392df3f 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 _0x29fb=['error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0xa2d90a,_0x721950){var _0x3962f0=function(_0x34d303){while(--_0x34d303){_0xa2d90a['push'](_0xa2d90a['shift']());}};_0x3962f0(++_0x721950);}(_0x29fb,0x13d));var _0xb29f=function(_0x58e1fd,_0x2d6689){_0x58e1fd=_0x58e1fd-0x0;var _0x23f756=_0x29fb[_0x58e1fd];return _0x23f756;};'use strict';var _=require(_0xb29f('0x0'));var util=require('util');var moment=require(_0xb29f('0x1'));var BPromise=require(_0xb29f('0x2'));var rs=require(_0xb29f('0x3'));var fs=require('fs');var Redis=require(_0xb29f('0x4'));var db=require(_0xb29f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb29f('0x6'))('rpc');var config=require(_0xb29f('0x7'));var jayson=require(_0xb29f('0x8'));var client=jayson[_0xb29f('0x9')][_0xb29f('0xa')]({'port':0x232a});config[_0xb29f('0xb')]=_[_0xb29f('0xc')](config[_0xb29f('0xb')],{'host':_0xb29f('0xd'),'port':0x18eb});var socket=require(_0xb29f('0xe'))(new Redis(config[_0xb29f('0xb')]));require(_0xb29f('0xf'))[_0xb29f('0x10')](socket);function respondWithRpcPromise(_0x45d8bb,_0x16a06b,_0x4f0325){return new BPromise(function(_0x3c51e1,_0x4acb9f){return client['request'](_0x45d8bb,_0x4f0325)['then'](function(_0x3694a8){logger['info'](_0xb29f('0x11'),_0x16a06b,_0xb29f('0x12'));logger[_0xb29f('0x13')](_0xb29f('0x14'),_0x16a06b,_0xb29f('0x12'),JSON['stringify'](_0x3694a8));if(_0x3694a8[_0xb29f('0x15')]){if(_0x3694a8[_0xb29f('0x15')]['code']===0x1f4){logger[_0xb29f('0x15')]('ChatGroup,\x20%s,\x20%s',_0x16a06b,_0x3694a8[_0xb29f('0x15')][_0xb29f('0x16')]);return _0x4acb9f(_0x3694a8[_0xb29f('0x15')]['message']);}logger[_0xb29f('0x15')](_0xb29f('0x11'),_0x16a06b,_0x3694a8[_0xb29f('0x15')][_0xb29f('0x16')]);return _0x3c51e1(_0x3694a8[_0xb29f('0x15')][_0xb29f('0x16')]);}else{logger[_0xb29f('0x17')](_0xb29f('0x11'),_0x16a06b,'request\x20sent');_0x3c51e1(_0x3694a8[_0xb29f('0x18')][_0xb29f('0x16')]);}})[_0xb29f('0x19')](function(_0x44e0e3){logger['error'](_0xb29f('0x11'),_0x16a06b,_0x44e0e3);_0x4acb9f(_0x44e0e3);});});} \ No newline at end of file +var _0xad86=['ChatGroup,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./chatGroup.socket','register','request','then','request\x20sent','debug','error','message'];(function(_0x2f7d02,_0x21afa7){var _0x3969ec=function(_0x32aa8e){while(--_0x32aa8e){_0x2f7d02['push'](_0x2f7d02['shift']());}};_0x3969ec(++_0x21afa7);}(_0xad86,0x194));var _0x6ad8=function(_0x51793f,_0xeefc7e){_0x51793f=_0x51793f-0x0;var _0x14b589=_0xad86[_0x51793f];return _0x14b589;};'use strict';var _=require(_0x6ad8('0x0'));var util=require(_0x6ad8('0x1'));var moment=require(_0x6ad8('0x2'));var BPromise=require(_0x6ad8('0x3'));var rs=require(_0x6ad8('0x4'));var fs=require('fs');var Redis=require(_0x6ad8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6ad8('0x6'))(_0x6ad8('0x7'));var config=require(_0x6ad8('0x8'));var jayson=require(_0x6ad8('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x6ad8('0xa')]=_[_0x6ad8('0xb')](config[_0x6ad8('0xa')],{'host':_0x6ad8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6ad8('0xd'))[_0x6ad8('0xe')](socket);function respondWithRpcPromise(_0x3a9cae,_0x1c04bc,_0x355abf){return new BPromise(function(_0x3a6b94,_0x41332f){return client[_0x6ad8('0xf')](_0x3a9cae,_0x355abf)[_0x6ad8('0x10')](function(_0x5ca991){logger['info']('ChatGroup,\x20%s,\x20%s',_0x1c04bc,_0x6ad8('0x11'));logger[_0x6ad8('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1c04bc,_0x6ad8('0x11'),JSON['stringify'](_0x5ca991));if(_0x5ca991[_0x6ad8('0x13')]){if(_0x5ca991[_0x6ad8('0x13')]['code']===0x1f4){logger[_0x6ad8('0x13')]('ChatGroup,\x20%s,\x20%s',_0x1c04bc,_0x5ca991[_0x6ad8('0x13')][_0x6ad8('0x14')]);return _0x41332f(_0x5ca991[_0x6ad8('0x13')][_0x6ad8('0x14')]);}logger['error'](_0x6ad8('0x15'),_0x1c04bc,_0x5ca991[_0x6ad8('0x13')][_0x6ad8('0x14')]);return _0x3a6b94(_0x5ca991[_0x6ad8('0x13')]['message']);}else{logger[_0x6ad8('0x16')](_0x6ad8('0x15'),_0x1c04bc,'request\x20sent');_0x3a6b94(_0x5ca991[_0x6ad8('0x17')]['message']);}})[_0x6ad8('0x18')](function(_0x157fa2){logger[_0x6ad8('0x13')](_0x6ad8('0x15'),_0x1c04bc,_0x157fa2);_0x41332f(_0x157fa2);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 215fd52..7745d61 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 _0x25c5=['remove','update','emit','removeListener','register','length','./chatGroup.events','save'];(function(_0x1e9562,_0x155d5e){var _0x31f51c=function(_0x563970){while(--_0x563970){_0x1e9562['push'](_0x1e9562['shift']());}};_0x31f51c(++_0x155d5e);}(_0x25c5,0x176));var _0x525c=function(_0x13b330,_0x297092){_0x13b330=_0x13b330-0x0;var _0x1f666c=_0x25c5[_0x13b330];return _0x1f666c;};'use strict';var ChatGroupEvents=require(_0x525c('0x0'));var events=[_0x525c('0x1'),_0x525c('0x2'),_0x525c('0x3')];function createListener(_0x1f24fb,_0x21e312){return function(_0x3c9511){_0x21e312[_0x525c('0x4')](_0x1f24fb,_0x3c9511);};}function removeListener(_0x5ea338,_0x135d6e){return function(){ChatGroupEvents[_0x525c('0x5')](_0x5ea338,_0x135d6e);};}exports[_0x525c('0x6')]=function(_0x51c0de){for(var _0x2e0c13=0x0,_0x2cf5cb=events[_0x525c('0x7')];_0x2e0c13<_0x2cf5cb;_0x2e0c13++){var _0x5ed67b=events[_0x2e0c13];var _0x4dd49c=createListener('chatGroup:'+_0x5ed67b,_0x51c0de);ChatGroupEvents['on'](_0x5ed67b,_0x4dd49c);}}; \ No newline at end of file +var _0x6ad9=['update','emit','removeListener','register','length','./chatGroup.events','save','remove'];(function(_0x51a415,_0xf9de36){var _0x16f409=function(_0x2f0dd9){while(--_0x2f0dd9){_0x51a415['push'](_0x51a415['shift']());}};_0x16f409(++_0xf9de36);}(_0x6ad9,0x1bd));var _0x96ad=function(_0x11d0a5,_0x4ecf1f){_0x11d0a5=_0x11d0a5-0x0;var _0x5b1ff4=_0x6ad9[_0x11d0a5];return _0x5b1ff4;};'use strict';var ChatGroupEvents=require(_0x96ad('0x0'));var events=[_0x96ad('0x1'),_0x96ad('0x2'),_0x96ad('0x3')];function createListener(_0x26a951,_0x5724b1){return function(_0xbd7176){_0x5724b1[_0x96ad('0x4')](_0x26a951,_0xbd7176);};}function removeListener(_0x5a4b01,_0x2b241b){return function(){ChatGroupEvents[_0x96ad('0x5')](_0x5a4b01,_0x2b241b);};}exports[_0x96ad('0x6')]=function(_0x5d0be9){for(var _0x10daff=0x0,_0x5c3970=events[_0x96ad('0x7')];_0x10daff<_0x5c3970;_0x10daff++){var _0x4db874=events[_0x10daff];var _0x15a9fe=createListener('chatGroup:'+_0x4db874,_0x5d0be9);ChatGroupEvents['on'](_0x4db874,_0x15a9fe);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 7e2367e..e73af23 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 _0x7e73=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','create','post','addMembers','addMessage','put','update','delete','destroy','exports','multer','util'];(function(_0x212a61,_0x441195){var _0x2979e9=function(_0x28019b){while(--_0x28019b){_0x212a61['push'](_0x212a61['shift']());}};_0x2979e9(++_0x441195);}(_0x7e73,0x15a));var _0x37e7=function(_0x478b5f,_0x341096){_0x478b5f=_0x478b5f-0x0;var _0x4c09fc=_0x7e73[_0x478b5f];return _0x4c09fc;};'use strict';var multer=require(_0x37e7('0x0'));var util=require(_0x37e7('0x1'));var path=require('path');var timeout=require(_0x37e7('0x2'));var express=require('express');var router=express[_0x37e7('0x3')]();var fs_extra=require(_0x37e7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x37e7('0x5'));var config=require(_0x37e7('0x6'));var controller=require(_0x37e7('0x7'));router[_0x37e7('0x8')]('/',auth[_0x37e7('0x9')](),controller[_0x37e7('0xa')]);router[_0x37e7('0x8')](_0x37e7('0xb'),auth[_0x37e7('0x9')](),controller[_0x37e7('0xc')]);router[_0x37e7('0x8')](_0x37e7('0xd'),auth[_0x37e7('0x9')](),controller[_0x37e7('0xe')]);router[_0x37e7('0x8')](_0x37e7('0xf'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x10')]);router[_0x37e7('0x8')](_0x37e7('0x11'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x12')]);router[_0x37e7('0x8')](_0x37e7('0x13'),auth[_0x37e7('0x9')](),controller['getMessages']);router['post']('/',auth[_0x37e7('0x9')](),controller[_0x37e7('0x14')]);router[_0x37e7('0x15')](_0x37e7('0x11'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x16')]);router['post']('/:id/messages',auth[_0x37e7('0x9')](),controller[_0x37e7('0x17')]);router[_0x37e7('0x18')](_0x37e7('0xd'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x19')]);router[_0x37e7('0x1a')](_0x37e7('0xd'),auth['isAuthenticated'](),controller[_0x37e7('0x1b')]);router[_0x37e7('0x1a')](_0x37e7('0x11'),auth[_0x37e7('0x9')](),controller['removeMembers']);module[_0x37e7('0x1c')]=router; \ No newline at end of file +var _0x0283=['../../components/auth/service','./chatGroup.controller','get','index','/describe','/:id','isAuthenticated','show','/:id/unread','getUnread','getMessages','post','create','/:id/members','addMembers','/:id/messages','addMessage','update','delete','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4ebd4b,_0x460f6b){var _0x40db91=function(_0x2d947c){while(--_0x2d947c){_0x4ebd4b['push'](_0x4ebd4b['shift']());}};_0x40db91(++_0x460f6b);}(_0x0283,0xa1));var _0x3028=function(_0x9b2bb0,_0x3965b1){_0x9b2bb0=_0x9b2bb0-0x0;var _0x2cdb3b=_0x0283[_0x9b2bb0];return _0x2cdb3b;};'use strict';var multer=require(_0x3028('0x0'));var util=require(_0x3028('0x1'));var path=require(_0x3028('0x2'));var timeout=require(_0x3028('0x3'));var express=require(_0x3028('0x4'));var router=express[_0x3028('0x5')]();var fs_extra=require(_0x3028('0x6'));var auth=require(_0x3028('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3028('0x8'));router[_0x3028('0x9')]('/',auth['isAuthenticated'](),controller[_0x3028('0xa')]);router[_0x3028('0x9')](_0x3028('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3028('0x9')](_0x3028('0xc'),auth[_0x3028('0xd')](),controller[_0x3028('0xe')]);router['get'](_0x3028('0xf'),auth['isAuthenticated'](),controller[_0x3028('0x10')]);router[_0x3028('0x9')]('/:id/members',auth[_0x3028('0xd')](),controller['getMembers']);router[_0x3028('0x9')]('/:id/messages',auth[_0x3028('0xd')](),controller[_0x3028('0x11')]);router[_0x3028('0x12')]('/',auth[_0x3028('0xd')](),controller[_0x3028('0x13')]);router['post'](_0x3028('0x14'),auth[_0x3028('0xd')](),controller[_0x3028('0x15')]);router['post'](_0x3028('0x16'),auth['isAuthenticated'](),controller[_0x3028('0x17')]);router['put']('/:id',auth[_0x3028('0xd')](),controller[_0x3028('0x18')]);router[_0x3028('0x19')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x3028('0x19')](_0x3028('0x14'),auth[_0x3028('0xd')](),controller[_0x3028('0x1a')]);module[_0x3028('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 390ccac..ef83828 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 _0x7195=['TEXT','STRING','long','DATE','ENUM','out','BOOLEAN','INTEGER','thumb','star'];(function(_0x5a66bd,_0x22713b){var _0x18e264=function(_0x51b5d3){while(--_0x51b5d3){_0x5a66bd['push'](_0x5a66bd['shift']());}};_0x18e264(++_0x22713b);}(_0x7195,0xd8));var _0x5719=function(_0xe80621,_0x31c622){_0xe80621=_0xe80621-0x0;var _0x4a2fb7=_0x7195[_0xe80621];return _0x4a2fb7;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x5719('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x5719('0x1')]},'ratingType':{'type':Sequelize['ENUM']('star',_0x5719('0x2')),'defaultValue':_0x5719('0x3')},'ratingMessage':{'type':Sequelize[_0x5719('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x5719('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x5719('0x5')]},'thirdDisposition':{'type':Sequelize[_0x5719('0x5')]},'note':{'type':Sequelize[_0x5719('0x5')]},'browserName':{'type':Sequelize[_0x5719('0x5')]},'browserVersion':{'type':Sequelize[_0x5719('0x5')]},'osName':{'type':Sequelize[_0x5719('0x5')]},'osVersion':{'type':Sequelize[_0x5719('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x5719('0x5')]},'deviceType':{'type':Sequelize[_0x5719('0x5')]},'referer':{'type':Sequelize[_0x5719('0x4')]},'customerIp':{'type':Sequelize[_0x5719('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x5719('0x6'))},'read1stAt':{'type':Sequelize[_0x5719('0x7')]},'lastMsgAt':{'type':Sequelize[_0x5719('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x5719('0x8')]('in',_0x5719('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x5719('0x5')]},'customerPort':{'type':Sequelize[_0x5719('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x5719('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x5719('0x0')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x5719('0x1')]}}; \ No newline at end of file +var _0x765d=['out','sequelize','exports','BOOLEAN','INTEGER','ENUM','thumb','star','TEXT','DATE','STRING'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x765d,0xd2));var _0xd765=function(_0x18cbd6,_0x1633d2){_0x18cbd6=_0x18cbd6-0x0;var _0x441c99=_0x765d[_0x18cbd6];return _0x441c99;};'use strict';var Sequelize=require(_0xd765('0x0'));module[_0xd765('0x1')]={'closed':{'type':Sequelize[_0xd765('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xd765('0x3')]},'ratingType':{'type':Sequelize[_0xd765('0x4')]('star',_0xd765('0x5')),'defaultValue':_0xd765('0x6')},'ratingMessage':{'type':Sequelize[_0xd765('0x7')]},'pathTranscript':{'type':Sequelize[_0xd765('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xd765('0x8')]},'disposition':{'type':Sequelize[_0xd765('0x9')]},'secondDisposition':{'type':Sequelize[_0xd765('0x9')]},'thirdDisposition':{'type':Sequelize[_0xd765('0x9')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xd765('0x9')]},'browserVersion':{'type':Sequelize[_0xd765('0x9')]},'osName':{'type':Sequelize[_0xd765('0x9')]},'osVersion':{'type':Sequelize[_0xd765('0x9')]},'deviceModel':{'type':Sequelize[_0xd765('0x9')]},'deviceVendor':{'type':Sequelize[_0xd765('0x9')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xd765('0x7')]},'customerIp':{'type':Sequelize[_0xd765('0x9')]},'formData':{'type':Sequelize[_0xd765('0x7')]('long')},'read1stAt':{'type':Sequelize[_0xd765('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd765('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xd765('0x9')]},'customerPort':{'type':Sequelize[_0xd765('0x9')]},'vidaooSessionId':{'type':Sequelize[_0xd765('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xd765('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xd765('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 8de1fe1..33724f7 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 _0xc44e=['alias','includeAll','addTags','setTags','omit','spread','Tag','color','chatInteractionTags:save','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','Account','Owner','get','mkdirSync','N.A.','toString','closedAt','osName','referer','customerIp','customerPort','tail','createReadStream','createWriteStream','read','value','renderFile','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','moment','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','end','undefined','count','limit','set','Content-Range','update','destroy','stack','name','send','render','body','contact','agent','interaction','account','index','map','ChatInteraction','fieldName','type','chat','user','show','params','model','rawAttributes','keys','query','intersection','attributes','fields','merge','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','email','POST','isNull','vidaooNote','follow','vidaooMetadata','parse','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Sequelize','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','originalname','basename','filename','mimetype','attachmentDownload','json','Unauthorized','Attachment','attachId','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','join','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','ContactId','length','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','fullname','[%s]\x20%s:\x20%s\x0a','direction','appendFileSync','MailServerOut','CloudProvider','getSmtpOptions','SendMail','sendMail','Smtp','Mail\x20Transcript','addMessage','ids','getMessages','filters','hasOwnProperty','nolimit','offset','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','order','secret','options','includeAgent','push'];(function(_0x53fa0c,_0x2cb21d){var _0x361347=function(_0x5020bd){while(--_0x5020bd){_0x53fa0c['push'](_0x53fa0c['shift']());}};_0x361347(++_0x2cb21d);}(_0xc44e,0xff));var _0xec44=function(_0x5bcd0a,_0x2a552d){_0x5bcd0a=_0x5bcd0a-0x0;var _0x5293a6=_0xc44e[_0x5bcd0a];return _0x5293a6;};'use strict';var rimraf=require(_0xec44('0x0'));var zipdir=require('zip-dir');var rp=require(_0xec44('0x1'));var moment=require(_0xec44('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xec44('0x3'));var util=require(_0xec44('0x4'));var path=require(_0xec44('0x5'));var ejs=require(_0xec44('0x6'));var fs=require('fs');var _=require(_0xec44('0x7'));var Redis=require(_0xec44('0x8'));var interaction=require(_0xec44('0x9'));var qs=require(_0xec44('0xa'));var pdf=require(_0xec44('0xb'));var logger=require(_0xec44('0xc'))(_0xec44('0xd'));var config=require(_0xec44('0xe'));var db=require(_0xec44('0xf'))['db'];config['redis']=_[_0xec44('0x10')](config[_0xec44('0x11')],{'host':_0xec44('0x12'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xec44('0x11')]));require(_0xec44('0x13'))[_0xec44('0x14')](socket);var jayson=require(_0xec44('0x15'));var client=jayson[_0xec44('0x16')][_0xec44('0x17')]({'port':0x232b});var client9004=jayson[_0xec44('0x16')][_0xec44('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x34858f,_0x20b142,_0x405565,_0x3ddca2){return new BPromise(function(_0x34afab,_0x2d05e3){var _0x16825c=_0x3ddca2||client;return _0x16825c[_0xec44('0x18')](_0x34858f,_0x405565)[_0xec44('0x19')](function(_0x85266d){logger['info'](_0xec44('0x1a'),_0x20b142,_0xec44('0x1b'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x20b142,_0xec44('0x1b'),JSON[_0xec44('0x1c')](_0x85266d));if(_0x85266d['error']){if(_0x85266d[_0xec44('0x1d')]['code']===0x1f4){logger[_0xec44('0x1d')](_0xec44('0x1a'),_0x20b142,_0x85266d[_0xec44('0x1d')][_0xec44('0x1e')]);return _0x2d05e3(_0x85266d[_0xec44('0x1d')][_0xec44('0x1e')]);}logger[_0xec44('0x1d')](_0xec44('0x1a'),_0x20b142,_0x85266d[_0xec44('0x1d')][_0xec44('0x1e')]);return _0x34afab(_0x85266d['error'][_0xec44('0x1e')]);}else{logger[_0xec44('0x1f')](_0xec44('0x1a'),_0x20b142,_0xec44('0x1b'));_0x34afab(_0x85266d[_0xec44('0x20')][_0xec44('0x1e')]);}})[_0xec44('0x21')](function(_0x40f599){logger[_0xec44('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x20b142,_0x40f599);_0x2d05e3(_0x40f599);});});}function respondWithStatusCode(_0x1069ce,_0x351607){_0x351607=_0x351607||0xcc;return function(_0x20c979){if(_0x20c979){return _0x1069ce[_0xec44('0x22')](_0x351607);}return _0x1069ce[_0xec44('0x23')](_0x351607)[_0xec44('0x24')]();};}function respondWithResult(_0x5b7f8b,_0x4b140d){_0x4b140d=_0x4b140d||0xc8;return function(_0x1e8535){if(_0x1e8535){return _0x5b7f8b[_0xec44('0x23')](_0x4b140d)['json'](_0x1e8535);}};}function respondWithFilteredResult(_0x476d32,_0x33922a){return function(_0x3a2c1c){if(_0x3a2c1c){var _0xd095c6=typeof _0x33922a['offset']===_0xec44('0x25')&&typeof _0x33922a['limit']===_0xec44('0x25');var _0x245a20=_0x3a2c1c[_0xec44('0x26')];var _0x4bfb7a=_0xd095c6?0x0:_0x33922a['offset'];var _0x270afc=_0xd095c6?_0x3a2c1c[_0xec44('0x26')]:_0x33922a['offset']+_0x33922a[_0xec44('0x27')];var _0xf6849a;if(_0x270afc>=_0x245a20){_0x270afc=_0x245a20;_0xf6849a=0xc8;}else{_0xf6849a=0xce;}_0x476d32['status'](_0xf6849a);return _0x476d32[_0xec44('0x28')](_0xec44('0x29'),_0x4bfb7a+'-'+_0x270afc+'/'+_0x245a20)['json'](_0x3a2c1c);}return null;};}function saveUpdates(_0x173e13){return function(_0x5ab60a){if(_0x5ab60a){return _0x5ab60a[_0xec44('0x2a')](_0x173e13)[_0xec44('0x19')](function(_0x24434e){return _0x24434e;});}return null;};}function removeEntity(_0x540bed){return function(_0x2b0ee3){if(_0x2b0ee3){return _0x2b0ee3[_0xec44('0x2b')]()[_0xec44('0x19')](function(){_0x540bed[_0xec44('0x23')](0xcc)[_0xec44('0x24')]();});}};}function handleEntityNotFound(_0x18bd0b){return function(_0x1bceb6){if(!_0x1bceb6){_0x18bd0b['sendStatus'](0x194);}return _0x1bceb6;};}function handleError(_0x5bace8,_0x404d3a){_0x404d3a=_0x404d3a||0x1f4;return function(_0x440248){logger[_0xec44('0x1d')](_0x440248[_0xec44('0x2c')]);if(_0x440248[_0xec44('0x2d')]){delete _0x440248['name'];}_0x5bace8[_0xec44('0x23')](_0x404d3a)[_0xec44('0x2e')](_0x440248);};}function getMustacheRender(_0x55fa9f,_0x307224){return Mustache[_0xec44('0x2f')](_0x55fa9f,_['merge'](_0x307224[_0xec44('0x30')],{'contact':_0x307224[_0xec44('0x31')],'message':_0x307224['message'],'agent':_0x307224[_0xec44('0x32')],'interaction':_0x307224[_0xec44('0x33')],'account':_0x307224[_0xec44('0x34')]}))||'';}exports[_0xec44('0x35')]=function(_0xb26c3a,_0x559fe7){var _0x13b716={};var _0x14bcd4=_[_0xec44('0x36')](db[_0xec44('0x37')]['rawAttributes'],function(_0x2caa61){return{'name':_0x2caa61[_0xec44('0x38')],'type':_0x2caa61[_0xec44('0x39')]['key']};});_0x13b716=qs['getOptions'](_0x14bcd4,_0xb26c3a);return interaction['findAll'](_0xec44('0x3a'),_0xb26c3a['query'],_0xb26c3a[_0xec44('0x3b')],_0x13b716,_0x14bcd4)[_0xec44('0x19')](respondWithFilteredResult(_0x559fe7,_0x13b716))[_0xec44('0x21')](handleError(_0x559fe7,null));};exports[_0xec44('0x3c')]=function(_0x2636f9,_0x5224c2){var _0x4ae698={'raw':![],'where':{'id':_0x2636f9[_0xec44('0x3d')]['id']}},_0x4f2643={};_0x4f2643[_0xec44('0x3e')]=_['keys'](db[_0xec44('0x37')][_0xec44('0x3f')]);_0x4f2643['query']=_[_0xec44('0x40')](_0x2636f9[_0xec44('0x41')]);_0x4f2643['filters']=_[_0xec44('0x42')](_0x4f2643['model'],_0x4f2643[_0xec44('0x41')]);_0x4ae698[_0xec44('0x43')]=_[_0xec44('0x42')](_0x4f2643[_0xec44('0x3e')],qs[_0xec44('0x44')](_0x2636f9[_0xec44('0x41')][_0xec44('0x44')]));_0x4ae698[_0xec44('0x43')]=_0x4ae698[_0xec44('0x43')]['length']?_0x4ae698[_0xec44('0x43')]:_0x4f2643[_0xec44('0x3e')];if(_0x2636f9[_0xec44('0x41')]['includeAll']){_0x4ae698['include']=[{'all':!![]}];}_0x4ae698=_[_0xec44('0x45')]({},_0x4ae698,_0x2636f9['options']);return db[_0xec44('0x37')][_0xec44('0x46')](_0x4ae698)[_0xec44('0x19')](handleEntityNotFound(_0x5224c2,null))[_0xec44('0x19')](respondWithResult(_0x5224c2,null))[_0xec44('0x21')](handleError(_0x5224c2,null));};exports[_0xec44('0x47')]=function(_0x530a90,_0x59f554){return db[_0xec44('0x37')][_0xec44('0x47')](_0x530a90[_0xec44('0x30')],{})['then'](respondWithResult(_0x59f554,0xc9))[_0xec44('0x21')](handleError(_0x59f554,null));};exports[_0xec44('0x2a')]=function(_0x369c2e,_0x2b6c36){if(_0x369c2e[_0xec44('0x30')]['id']){delete _0x369c2e[_0xec44('0x30')]['id'];}return db[_0xec44('0x37')][_0xec44('0x46')]({'where':{'id':_0x369c2e[_0xec44('0x3d')]['id']}})[_0xec44('0x19')](handleEntityNotFound(_0x2b6c36,null))[_0xec44('0x19')](saveUpdates(_0x369c2e[_0xec44('0x30')],null))[_0xec44('0x19')](respondWithResult(_0x2b6c36,null))['catch'](handleError(_0x2b6c36,null));};exports[_0xec44('0x2b')]=function(_0xf95877,_0x3bcc67){return db[_0xec44('0x37')]['find']({'where':{'id':_0xf95877[_0xec44('0x3d')]['id']}})[_0xec44('0x19')](handleEntityNotFound(_0x3bcc67,null))[_0xec44('0x19')](removeEntity(_0x3bcc67,null))[_0xec44('0x21')](handleError(_0x3bcc67,null));};exports[_0xec44('0x48')]=function(_0x5242e8,_0x47e239){return db[_0xec44('0x37')][_0xec44('0x48')]()['then'](respondWithResult(_0x47e239,null))['catch'](handleError(_0x47e239,null));};exports[_0xec44('0x49')]=function(_0x48f92b,_0x11d612){var _0x28d8f6=_0x48f92b['params']['id'];var _0x1eca4c;var _0x5beb54;var _0x24a70e;return db[_0xec44('0x37')][_0xec44('0x4a')]({'where':{'id':_0x28d8f6}})['then'](function(_0x422d78){_0x1eca4c=_0x422d78;return db[_0xec44('0x4b')][_0xec44('0x4a')]({'where':{'id':_0x422d78[_0xec44('0x4c')]},'attributes':['id',_0xec44('0x4d'),_0xec44('0x4e'),_0xec44('0x4f'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0xec44('0x19')](function(_0x2441a8){if(_0x2441a8&&_0x2441a8[_0xec44('0x4d')]&&_0x2441a8[_0xec44('0x4e')]){_0x5beb54=_0x2441a8;var _0xf1fabb={'interaction':{'id':_0x28d8f6},'agent':{'id':_0x48f92b[_0xec44('0x3b')]['id'],'name':_0x48f92b[_0xec44('0x3b')][_0xec44('0x2d')],'fullname':_0x48f92b[_0xec44('0x3b')]['fullname'],'email':_0x48f92b['user'][_0xec44('0x50')]},'contact':_0x48f92b[_0xec44('0x30')][_0xec44('0x31')],'account':_0x48f92b[_0xec44('0x30')]['account']};var _0x163d34={'rejectUnauthorized':![],'method':_0xec44('0x51'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2441a8[_0xec44('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x48f92b[_0xec44('0x3b')][_0xec44('0x50')]],'buttons':null,'topic':_0x5beb54[_0xec44('0x4f')],'note':_[_0xec44('0x52')](_0x5beb54[_0xec44('0x53')])?null:getMustacheRender(_0x5beb54[_0xec44('0x53')],_0xf1fabb),'metadata':null},'redirect':_0xec44('0x54'),'json':!![]};try{if(!_[_0xec44('0x52')](_0x5beb54[_0xec44('0x55')])){var _0x37ba3c=getMustacheRender(_0x5beb54[_0xec44('0x55')],_0xf1fabb);var _0x1b8c25=JSON[_0xec44('0x56')](_0x37ba3c);_0x163d34[_0xec44('0x30')][_0xec44('0x57')]=_0x1b8c25;}}catch(_0x4b742a){throw new db['Sequelize'][(_0xec44('0x58'))](_0xec44('0x59'));}return rp(_0x163d34);}else{throw new db['Sequelize'][(_0xec44('0x58'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xec44('0x19')](function(_0x3ffc13){_0x24a70e=_0x3ffc13;if(_0x24a70e['id']){var _0x12cf4b={'body':_0x24a70e[_0xec44('0x5a')],'ChatWebsiteId':_0x5beb54['id'],'ChatInteractionId':_0x1eca4c['id'],'direction':_0xec44('0x5b'),'UserId':_0x48f92b[_0xec44('0x3b')]['id']};return db[_0xec44('0x5c')][_0xec44('0x47')](_0x12cf4b,{});}else{throw new db[(_0xec44('0x5d'))][(_0xec44('0x58'))](_0xec44('0x5e'));}})[_0xec44('0x19')](function(){return _0x1eca4c[_0xec44('0x5f')]({'vidaooSessionId':_0x24a70e['id']});})[_0xec44('0x19')](respondWithResult(_0x11d612,null))[_0xec44('0x21')](handleError(_0x11d612,null));};exports[_0xec44('0x60')]=function(_0x193581,_0xb3edfd){if(_0x193581[_0xec44('0x30')]['id']){delete _0x193581[_0xec44('0x30')]['id'];}return db[_0xec44('0x37')][_0xec44('0x46')]({'where':{'id':_0x193581[_0xec44('0x3d')]['id']},'include':[{'model':db[_0xec44('0x61')],'as':_0xec44('0x62')}]})['then'](handleEntityNotFound(_0xb3edfd,null))[_0xec44('0x19')](saveUpdates(_0x193581[_0xec44('0x30')],null))[_0xec44('0x19')](respondWithResult(_0xb3edfd,null))[_0xec44('0x21')](handleError(_0xb3edfd,null));};exports['abandon']=function(_0x1516ec,_0x37e904){if(_0x1516ec[_0xec44('0x30')]['id']){delete _0x1516ec[_0xec44('0x30')]['id'];}return db[_0xec44('0x37')][_0xec44('0x46')]({'where':{'id':_0x1516ec[_0xec44('0x3d')]['id']}})[_0xec44('0x19')](function(_0x32c1d8){if(!_0x32c1d8){logger[_0xec44('0x1d')](_0xec44('0x63'),_0xec44('0x64'),0x194,_0xec44('0x65'));_0x37e904[_0xec44('0x22')](0x194);}else{if(_0x32c1d8[_0xec44('0x66')]){throw new db[(_0xec44('0x5d'))][(_0xec44('0x58'))](_0xec44('0x67'));}}return _0x32c1d8;})[_0xec44('0x19')](function(_0x4eae39){if(_0x4eae39){return _0x4eae39[_0xec44('0x2a')]({'closed':_0x1516ec[_0xec44('0x30')][_0xec44('0x68')],'disposition':_0x1516ec[_0xec44('0x30')][_0xec44('0x69')]})[_0xec44('0x19')](function(_0x376199){return _0x376199;});}})[_0xec44('0x19')](function(){return respondWithRpcPromise(_0xec44('0x6a'),_0xec44('0x64'),_0x1516ec['body'],client9004);})[_0xec44('0x19')](respondWithResult(_0x37e904,null))[_0xec44('0x21')](handleError(_0x37e904,null));};exports['attachmentUpload']=function(_0x494a16,_0x5df05a){_0x494a16['body'][_0xec44('0x2d')]=_0x494a16[_0xec44('0x6b')][_0xec44('0x6c')];_0x494a16['body'][_0xec44('0x6d')]=_0x494a16[_0xec44('0x6b')][_0xec44('0x6e')];_0x494a16[_0xec44('0x30')]['type']=_0x494a16[_0xec44('0x6b')][_0xec44('0x6f')];return db['Attachment']['create'](_0x494a16['body'])[_0xec44('0x19')](respondWithResult(_0x5df05a,0xc9))['catch'](handleError(_0x5df05a,null));};exports[_0xec44('0x70')]=function(_0x333c38,_0x2575a7){return db[_0xec44('0x37')][_0xec44('0x4a')]({'where':{'id':_0x333c38['params']['id']},'raw':!![]})[_0xec44('0x19')](handleEntityNotFound(_0x2575a7,null))[_0xec44('0x19')](function(_0x11bc50){if(_0x11bc50){if(_0x11bc50[_0xec44('0x68')]){return _0x2575a7[_0xec44('0x23')](0x193)[_0xec44('0x71')]({'status':0x193,'message':_0xec44('0x72')});}return db[_0xec44('0x73')][_0xec44('0x4a')]({'where':{'id':_0x333c38[_0xec44('0x41')][_0xec44('0x74')]},'raw':!![]})[_0xec44('0x19')](handleEntityNotFound(_0x2575a7,null));}})[_0xec44('0x19')](function(_0x387c2b){if(_0x387c2b){var _0x25feca=_0x387c2b[_0xec44('0x75')]!==null;var _0x2e0971=path['join'](config[_0xec44('0x76')],_0xec44('0x77'));if(_0x25feca){_0x2e0971=path['join'](_0x2e0971,_0xec44('0x78'));}var _0x509595=path[_0xec44('0x79')](_0x2e0971,_0x387c2b['basename']);return _0x2575a7[_0xec44('0x7a')](_0x509595);}})[_0xec44('0x21')](handleError(_0x2575a7,null));};exports[_0xec44('0x7b')]=function(_0x25e76a,_0x533c2b){var _0x256a9f=null;var _0x27fa57=null;var _0x32d8d2=null;if(_0x25e76a['body']['id']){delete _0x25e76a[_0xec44('0x30')]['id'];}if(_0x25e76a[_0xec44('0x30')][_0xec44('0x7c')]){_0x32d8d2=path[_0xec44('0x79')](config[_0xec44('0x76')],_0xec44('0x7d'),util[_0xec44('0x7e')](_0xec44('0x7f'),Date[_0xec44('0x80')]()));_0x25e76a[_0xec44('0x30')]['pathTranscript']=_0x32d8d2;}return db[_0xec44('0x37')][_0xec44('0x46')]({'where':{'id':_0x25e76a[_0xec44('0x3d')]['id']},'include':[{'model':db[_0xec44('0x5c')],'as':_0xec44('0x81'),'include':[{'model':db[_0xec44('0x82')],'as':'User'}]}]})[_0xec44('0x19')](handleEntityNotFound(_0x533c2b,null))['then'](saveUpdates(_0x25e76a[_0xec44('0x30')],null))[_0xec44('0x19')](function(_0x2acb3a){if(_0x2acb3a){_0x256a9f=_0x2acb3a;return db[_0xec44('0x4b')][_0xec44('0x46')]({'where':{'id':_0x256a9f[_0xec44('0x4c')]}});}})['then'](function(_0x5c2113){if(_0x5c2113){_0x27fa57=_0x5c2113;return db[_0xec44('0x61')][_0xec44('0x46')]({'where':{'id':_0x256a9f[_0xec44('0x83')]}});}})[_0xec44('0x19')](function(_0x2e4f51){if(_0x2e4f51){if(_0x32d8d2){var _0x23e995=null;for(var _0x2549c7=0x1;_0x2549c7<_0x256a9f[_0xec44('0x81')][_0xec44('0x84')];++_0x2549c7){_0x23e995=_0x256a9f['Messages'][_0x2549c7];var _0x5b3209=_0x23e995[_0xec44('0x66')]?util[_0xec44('0x7e')](_0xec44('0x85'),_0x27fa57[_0xec44('0x86')],_0x23e995[_0xec44('0x66')]):_0xec44('0x87');var _0x50072a=_0x25e76a[_0xec44('0x30')][_0xec44('0x88')]||util[_0xec44('0x7e')](_0xec44('0x85'),_0xec44('0x89'),_0x23e995[_0xec44('0x83')]);switch(_0x27fa57[_0xec44('0x8a')]){case _0xec44('0x8b'):_0x5b3209=_0x23e995[_0xec44('0x66')]?util['format'](_0xec44('0x85'),_0x27fa57[_0xec44('0x86')],_0x23e995[_0xec44('0x66')]):_0xec44('0x87');break;case _0xec44('0x8c'):_0x5b3209=_0x23e995[_0xec44('0x66')]?_0x23e995[_0xec44('0x82')]['alias']||_0x23e995[_0xec44('0x82')][_0xec44('0x8d')]:_0xec44('0x87');break;case'agent_fullname':_0x5b3209=_0x23e995[_0xec44('0x66')]?_0x23e995[_0xec44('0x82')][_0xec44('0x8d')]:'System';break;default:_0x5b3209=_0x23e995[_0xec44('0x66')]?util[_0xec44('0x7e')]('%s%d',_0x27fa57[_0xec44('0x86')],_0x23e995['UserId']):_0xec44('0x87');}var _0x5770d0=util['format'](_0xec44('0x8e'),moment(_0x23e995['createdAt'])[_0xec44('0x7e')]('MM/DD/YYYY\x20HH:mm:ss'),_0x23e995[_0xec44('0x8f')]==='in'?_0x50072a:_0x5b3209,_0x23e995['body']);if(!_0x23e995['secret']){fs[_0xec44('0x90')](_0x32d8d2,_0x5770d0);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xec44('0x91')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xec44('0x92'),'raw':!![]}]}]});}}})[_0xec44('0x19')](function(_0x2537c1){if(!_0x2537c1||!_0x2537c1['Smtp']||!_0x25e76a[_0xec44('0x30')])return _0x256a9f;var _0x478497=_0x2537c1[_0xec44('0x93')]();return respondWithRpcPromise(_0xec44('0x94'),_0xec44('0x95'),{'account':_0x478497,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2537c1['name'],_0x2537c1[_0xec44('0x50')]||_0x2537c1[_0xec44('0x96')][_0xec44('0x3b')]),'to':_0x25e76a[_0xec44('0x30')]['mailTranscript'],'subject':_0xec44('0x97'),'text':util[_0xec44('0x7e')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x25e76a['body'][_0xec44('0x7c')]),'attachments':[{'path':_0x32d8d2}]}})['then'](function(){return _0x256a9f;})['catch'](function(_0x19608a){logger[_0xec44('0x1d')](_0x19608a);});})[_0xec44('0x19')](respondWithStatusCode(_0x533c2b,0xc8))[_0xec44('0x21')](handleError(_0x533c2b,null));};exports[_0xec44('0x98')]=function(_0x60ebf4,_0x5ee31d){return db['ChatMessage'][_0xec44('0x46')]({'where':{'id':_0x60ebf4[_0xec44('0x3d')]['id']}})[_0xec44('0x19')](handleEntityNotFound(_0x5ee31d,null))[_0xec44('0x19')](function(_0x3d6384){if(_0x3d6384){return _0x3d6384[_0xec44('0x98')](_0x60ebf4['body'][_0xec44('0x99')],_['omit'](_0x60ebf4['body'],[_0xec44('0x99'),'id'])||{});}})['then'](respondWithResult(_0x5ee31d,null))[_0xec44('0x21')](handleError(_0x5ee31d,null));};exports[_0xec44('0x9a')]=function(_0x2d4118,_0xd99666){var _0x5dcde8={'raw':![],'where':{}};var _0x32fa08={};var _0x155eaf={'count':0x0,'rows':[]};return db[_0xec44('0x37')][_0xec44('0x4a')]({'where':{'id':_0x2d4118[_0xec44('0x3d')]['id']}})[_0xec44('0x19')](handleEntityNotFound(_0xd99666,null))[_0xec44('0x19')](function(_0x22626b){if(_0x22626b){_0x32fa08[_0xec44('0x3e')]=_[_0xec44('0x40')](db[_0xec44('0x5c')]['rawAttributes']);_0x32fa08['query']=_[_0xec44('0x40')](_0x2d4118[_0xec44('0x41')]);_0x32fa08[_0xec44('0x9b')]=_[_0xec44('0x42')](_0x32fa08[_0xec44('0x3e')],_0x32fa08[_0xec44('0x41')]);_0x5dcde8[_0xec44('0x43')]=_[_0xec44('0x42')](_0x32fa08[_0xec44('0x3e')],qs[_0xec44('0x44')](_0x2d4118['query']['fields']));_0x5dcde8[_0xec44('0x43')]=_0x5dcde8['attributes'][_0xec44('0x84')]?_0x5dcde8[_0xec44('0x43')]:_0x32fa08[_0xec44('0x3e')];if(!_0x2d4118['query'][_0xec44('0x9c')](_0xec44('0x9d'))){_0x5dcde8[_0xec44('0x27')]=qs['limit'](_0x2d4118['query']['limit']);_0x5dcde8[_0xec44('0x9e')]=qs['offset'](_0x2d4118[_0xec44('0x41')]['offset']);}_0x5dcde8['order']=qs[_0xec44('0x9f')](_0x2d4118[_0xec44('0x41')][_0xec44('0x9f')]);_0x5dcde8[_0xec44('0xa0')]=qs[_0xec44('0x9b')](_[_0xec44('0xa1')](_0x2d4118[_0xec44('0x41')],_0x32fa08[_0xec44('0x9b')]));_0x5dcde8['where'][_0xec44('0xa2')]=_0x22626b['id'];if(_0x2d4118['query'][_0xec44('0xa3')]){_0x5dcde8[_0xec44('0xa0')]=_[_0xec44('0x45')](_0x5dcde8[_0xec44('0xa0')],{'$or':_[_0xec44('0x36')](_0x5dcde8['attributes'],function(_0xc8be28){var _0x37974d={};_0x37974d[_0xc8be28]={'$like':'%'+_0x2d4118['query'][_0xec44('0xa3')]+'%'};return _0x37974d;})});}if(_0x2d4118[_0xec44('0x41')][_0xec44('0xa4')]){var _0x6130ce=_0x2d4118[_0xec44('0x41')][_0xec44('0xa4')][_0xec44('0xa5')](',');var _0x119bf5={};_0x119bf5[_0x6130ce[0x0]]={'$gte':moment(_0x6130ce[0x1])[_0xec44('0x7e')](_0xec44('0xa6'))};_0x5dcde8[_0xec44('0xa0')]=_[_0xec44('0x45')](_0x5dcde8[_0xec44('0xa0')],_0x119bf5);}_0x5dcde8=_[_0xec44('0x45')]({},_0x5dcde8,_0x2d4118['options']);return db[_0xec44('0x5c')][_0xec44('0x26')]({'where':_0x5dcde8[_0xec44('0xa0')]})['then'](function(_0x5bdbd7){_0x155eaf['count']=_0x5bdbd7;if(_0x2d4118[_0xec44('0x41')]['includeAll']){_0x5dcde8[_0xec44('0xa7')]=[{'all':!![]}];}return db[_0xec44('0x5c')][_0xec44('0xa8')](_0x5dcde8);})[_0xec44('0x19')](function(_0x370d21){_0x155eaf[_0xec44('0xa9')]=_0x370d21;return _0x155eaf;});}})['then'](respondWithFilteredResult(_0xd99666,_0x5dcde8))[_0xec44('0x21')](handleError(_0xd99666,null));};exports['getMyMessages']=function(_0x40c53d,_0x11e3fb){var _0x4ca176={'where':{}},_0x5e4cae={},_0x4de9a2={'count':0x0,'rows':[]};return db[_0xec44('0x37')][_0xec44('0x4a')]({'where':{'id':_0x40c53d[_0xec44('0x3d')]['id']}})[_0xec44('0x19')](handleEntityNotFound(_0x11e3fb,null))['then'](function(_0x445ac6){if(_0x445ac6){_0x5e4cae[_0xec44('0x3e')]=_[_0xec44('0x40')](db['ChatMessage'][_0xec44('0x3f')]);_0x5e4cae['query']=_['keys'](_0x40c53d[_0xec44('0x41')]);_0x5e4cae[_0xec44('0x9b')]=_['intersection'](_0x5e4cae['model'],_0x5e4cae['query']);_0x4ca176[_0xec44('0x43')]=_[_0xec44('0x42')](_0x5e4cae[_0xec44('0x3e')],qs[_0xec44('0x44')](_0x40c53d[_0xec44('0x41')][_0xec44('0x44')]));_0x4ca176[_0xec44('0x43')]=_0x4ca176['attributes'][_0xec44('0x84')]?_0x4ca176[_0xec44('0x43')]:_0x5e4cae[_0xec44('0x3e')];if(!_0x40c53d[_0xec44('0x41')][_0xec44('0x9c')](_0xec44('0x9d'))){_0x4ca176[_0xec44('0x27')]=qs['limit'](_0x40c53d[_0xec44('0x41')][_0xec44('0x27')]);_0x4ca176[_0xec44('0x9e')]=qs[_0xec44('0x9e')](_0x40c53d[_0xec44('0x41')][_0xec44('0x9e')]);}_0x4ca176[_0xec44('0xaa')]=qs[_0xec44('0x9f')](_0x40c53d[_0xec44('0x41')][_0xec44('0x9f')]);_0x4ca176['where']=qs['filters'](_[_0xec44('0xa1')](_0x40c53d[_0xec44('0x41')],_0x5e4cae[_0xec44('0x9b')]));_0x4ca176['where'][_0xec44('0xa2')]=_0x445ac6['id'];if(_0x40c53d[_0xec44('0x41')]['filter']){_0x4ca176[_0xec44('0xa0')]=_[_0xec44('0x45')](_0x4ca176['where'],{'$or':_['map'](_0x4ca176[_0xec44('0x43')],function(_0xd9ca9c){var _0x2c24e9={};_0x2c24e9[_0xd9ca9c]={'$like':'%'+_0x40c53d[_0xec44('0x41')][_0xec44('0xa3')]+'%'};return _0x2c24e9;})});}_0x4ca176[_0xec44('0xa0')][_0xec44('0xab')]=![];if(_0x40c53d[_0xec44('0x41')]['id']){_0x4ca176[_0xec44('0xa0')]['id']={'$gt':_0x40c53d[_0xec44('0x41')]['id']};}_0x4ca176=_['merge']({},_0x4ca176,_0x40c53d[_0xec44('0xac')]);return db[_0xec44('0x5c')]['count']({'where':_0x4ca176[_0xec44('0xa0')]})[_0xec44('0x19')](function(_0x2e485f){_0x4de9a2[_0xec44('0x26')]=_0x2e485f;_0x4ca176[_0xec44('0xa7')]=[];if(_0x40c53d[_0xec44('0x41')][_0xec44('0xad')]){_0x4ca176[_0xec44('0xa7')][_0xec44('0xae')]({'model':db['User'],'as':'User','attributes':['id','fullname',_0xec44('0xaf')]});}if(_0x40c53d[_0xec44('0x41')][_0xec44('0xb0')]){_0x4ca176['include']=[{'all':!![]}];}return db[_0xec44('0x5c')][_0xec44('0xa8')](_0x4ca176);})[_0xec44('0x19')](function(_0x196ca0){_0x4de9a2['rows']=_0x196ca0;return _0x4de9a2;});}})[_0xec44('0x19')](respondWithFilteredResult(_0x11e3fb,_0x4ca176))[_0xec44('0x21')](handleError(_0x11e3fb,null));};exports[_0xec44('0xb1')]=function(_0x5b3548,_0x23452a){return db[_0xec44('0x37')][_0xec44('0x46')]({'where':{'id':_0x5b3548[_0xec44('0x3d')]['id']}})[_0xec44('0x19')](handleEntityNotFound(_0x23452a,null))[_0xec44('0x19')](function(_0x483b0c){if(_0x483b0c){return _0x483b0c[_0xec44('0xb2')](_0x5b3548[_0xec44('0x30')]['ids'],_[_0xec44('0xb3')](_0x5b3548[_0xec44('0x30')],['ids','id'])||{})[_0xec44('0xb4')](function(){return db[_0xec44('0xb5')][_0xec44('0xa8')]({'attributes':['id','name',_0xec44('0xb6')],'where':{'id':_0x5b3548['body'][_0xec44('0x99')]}});})[_0xec44('0x19')](function(_0x4f15ad){socket['emit'](_0xec44('0xb7'),{'id':Number(_0x5b3548['params']['id']),'tags':_0x4f15ad||[]});return{'id':Number(_0x5b3548[_0xec44('0x3d')]['id']),'tags':_0x4f15ad||[]};});}})[_0xec44('0x19')](respondWithResult(_0x23452a,null))[_0xec44('0x21')](handleError(_0x23452a,null));};exports[_0xec44('0xb8')]=function(_0x464fce,_0x17f9ba){return db[_0xec44('0x37')][_0xec44('0x46')]({'where':{'id':_0x464fce[_0xec44('0x3d')]['id']}})[_0xec44('0x19')](handleEntityNotFound(_0x17f9ba,null))['then'](function(_0x5dd26b){if(_0x5dd26b){return _0x5dd26b[_0xec44('0xb8')](_0x464fce[_0xec44('0x41')][_0xec44('0x99')]);}})['then'](respondWithStatusCode(_0x17f9ba,null))[_0xec44('0x21')](handleError(_0x17f9ba,null));};exports[_0xec44('0x7a')]=function(_0x3b68c8,_0x5bb446){var _0x35c4aa=moment()[_0xec44('0xb9')]()['toString']();var _0x5b8c87=path['join'](config[_0xec44('0x76')],_0xec44('0xba'),_0xec44('0xbb'),'tmp');var _0x3911ad=path[_0xec44('0x79')](config[_0xec44('0x76')],_0xec44('0xba'),'files',_0xec44('0xbc'));var _0xce081c=path[_0xec44('0x79')](_0x5b8c87,_0x35c4aa);var _0x5e6bd0=util[_0xec44('0x7e')](_0xec44('0xbd'),_0x3b68c8[_0xec44('0x3d')]['id'],_0x35c4aa);var _0x1551db=path[_0xec44('0x79')](_0x5b8c87,_0x5e6bd0);var _0x14671e=[];_0x14671e[_0xec44('0xae')]({'model':db[_0xec44('0x82')],'as':_0xec44('0x82'),'attributes':['id',_0xec44('0x8d')],'raw':!![]});_0x14671e[_0xec44('0xae')]({'model':db[_0xec44('0x61')],'as':'Contact','attributes':['id',_0xec44('0xbe'),_0xec44('0xbf')],'raw':!![]});if(_0x3b68c8[_0xec44('0x41')][_0xec44('0xbc')]){_0x14671e[_0xec44('0xae')]({'model':db[_0xec44('0x73')],'as':_0xec44('0x73'),'raw':!![]});}var _0x4a35b0=[{'model':db[_0xec44('0x5c')],'as':_0xec44('0x81'),'attributes':['id',_0xec44('0x30'),_0xec44('0xc0'),_0xec44('0x8f'),'secret','read'],'include':_0x14671e}];_0x4a35b0[_0xec44('0xae')]({'model':db[_0xec44('0x4b')],'as':_0xec44('0xc1'),'attributes':['id',_0xec44('0x2d')]});_0x4a35b0[_0xec44('0xae')]({'model':db[_0xec44('0x82')],'as':_0xec44('0xc2'),'attributes':['id',_0xec44('0x8d')]});return db[_0xec44('0x37')]['find']({'where':{'id':_0x3b68c8[_0xec44('0x3d')]['id']},'include':_0x4a35b0})[_0xec44('0x19')](handleEntityNotFound(_0x5bb446,null))[_0xec44('0x19')](function(_0x3c4170){if(_0x3c4170){var _0x416ef8=_0x3c4170[_0xec44('0xc3')]({'plain':!![]});fs[_0xec44('0xc4')](_0xce081c);var _0x53dea2={'channel':'Chat','account':_0x416ef8[_0xec44('0xc1')][_0xec44('0x2d')],'agent':_0x416ef8[_0xec44('0xc2')]?_0x416ef8['Owner'][_0xec44('0x8d')]:_0xec44('0xc5'),'createdAt':moment(_0x416ef8[_0xec44('0xc0')])[_0xec44('0x7e')](_0xec44('0xa6'))[_0xec44('0xc6')](),'closedAt':_0x416ef8['closed']?moment(_0x416ef8[_0xec44('0xc7')])[_0xec44('0x7e')]('YYYY-MM-DD\x20HH:mm:ss')[_0xec44('0xc6')]():'','disposition':_0x416ef8[_0xec44('0x69')],'chatInfo':{'browser':_0x416ef8['browserName'],'os':_0x416ef8[_0xec44('0xc8')],'referer':_0x416ef8[_0xec44('0xc9')],'customerIp':_0x416ef8[_0xec44('0xca')],'customerPort':_0x416ef8[_0xec44('0xcb')]?_0x416ef8[_0xec44('0xcb')]:_0xec44('0xc5')},'messages':_(_0x416ef8['Messages'])[_0xec44('0xcc')]()['filter']({'secret':![]})[_0xec44('0x36')](function(_0x6b012d){if(_0x6b012d['Attachment']){var _0x40d765=path['join'](_0x3911ad,_0x6b012d[_0xec44('0x73')][_0xec44('0x6d')]);if(fs['existsSync'](_0x40d765)){fs[_0xec44('0xcd')](_0x40d765)['pipe'](fs[_0xec44('0xce')](path[_0xec44('0x79')](_0xce081c,_0x6b012d[_0xec44('0x73')][_0xec44('0x6d')])));}}return{'date':moment(_0x6b012d['createdAt'])[_0xec44('0x7e')](_0xec44('0xa6'))[_0xec44('0xc6')](),'sender':_0x6b012d[_0xec44('0x8f')]===_0xec44('0x5b')?_0x6b012d['User']?_0x6b012d[_0xec44('0x82')][_0xec44('0x8d')]:_0xec44('0x87'):_0x6b012d['Contact'][_0xec44('0xbe')]+(_0x6b012d[_0xec44('0x62')][_0xec44('0xbf')]?'\x20'+_0x6b012d[_0xec44('0x62')][_0xec44('0xbf')]:''),'body':_0x6b012d[_0xec44('0x73')]?_0x6b012d[_0xec44('0x73')][_0xec44('0x6d')]:_0x6b012d[_0xec44('0x30')],'direction':_0x6b012d['direction']===_0xec44('0x5b')?'A':'C','secret':_0x6b012d['secret'],'read':_0x6b012d[_0xec44('0xcf')],'attachment':_0x6b012d['Attachment']};})[_0xec44('0xd0')]()};return ejs[_0xec44('0xd1')](path[_0xec44('0x79')](config['root'],_0xec44('0xba'),'views','downloadInteraction.ejs'),{'interaction':_0x53dea2})[_0xec44('0x19')](function(_0x338022){var _0x468524=path[_0xec44('0x79')](_0xce081c,_0xec44('0xd2')+_0x416ef8['id']+'-'+_0x35c4aa+_0xec44('0xd3'));var _0x217661={'path':_0x468524,'channel':'Chat','interactionId':_0x416ef8['id']};return pdf[_0xec44('0xd4')](_0x338022,_0x217661);})[_0xec44('0x19')](function(){return new Promise(function(_0x3b836e,_0x4f0e38){zipdir(_0xce081c,{'saveTo':_0x1551db},function(_0x4cdb55,_0x39b22b){if(_0x4cdb55)return _0x4f0e38(_0x4cdb55);return _0x3b836e(_0x39b22b);});})[_0xec44('0x19')](function(){return new BPromise(function(_0x388392,_0x557b5e){rimraf(_0xce081c,function(_0x18f659){if(_0x18f659)_0x557b5e(_0x18f659);return _0x388392();});});})[_0xec44('0x19')](function(){return _0x5bb446['download'](_0x1551db,_0x5e6bd0,function(_0xf24c02){if(_0xf24c02){logger[_0xec44('0x1d')](_0xec44('0xd5'),_0xf24c02);}else{fs[_0xec44('0xd6')](_0x1551db);}});});});}else{return _0x5bb446[_0xec44('0x22')](0xc8);}})[_0xec44('0x21')](handleError(_0x5bb446,null));}; \ No newline at end of file +var _0xfc64=['destroy','stack','name','send','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','fieldName','type','key','getOptions','findAll','chat','params','keys','rawAttributes','query','filters','model','attributes','intersection','fields','length','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','user','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','root','join','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','User','ContactId','Messages','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','order','sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','hasOwnProperty','includeAgent','addTags','setTags','omit','spread','emit','removeTags','unix','toString','server','tmp','push','firstName','lastName','attachments','read','Owner','mkdirSync','Chat','Account','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','pipe','createWriteStream','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update'];(function(_0x1b1426,_0x5a45e9){var _0x44b0d5=function(_0x48317b){while(--_0x48317b){_0x1b1426['push'](_0x1b1426['shift']());}};_0x44b0d5(++_0x5a45e9);}(_0xfc64,0x9f));var _0x4fc6=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xfc64[_0x6131cd];return _0x47e916;};'use strict';var rimraf=require(_0x4fc6('0x0'));var zipdir=require(_0x4fc6('0x1'));var rp=require('request-promise');var moment=require(_0x4fc6('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4fc6('0x3'));var Redis=require(_0x4fc6('0x4'));var interaction=require(_0x4fc6('0x5'));var qs=require('../../components/parsers/qs');var pdf=require(_0x4fc6('0x6'));var logger=require(_0x4fc6('0x7'))(_0x4fc6('0x8'));var config=require('../../config/environment');var db=require(_0x4fc6('0x9'))['db'];config[_0x4fc6('0xa')]=_['defaults'](config[_0x4fc6('0xa')],{'host':_0x4fc6('0xb'),'port':0x18eb});var socket=require(_0x4fc6('0xc'))(new Redis(config[_0x4fc6('0xa')]));require(_0x4fc6('0xd'))[_0x4fc6('0xe')](socket);var jayson=require(_0x4fc6('0xf'));var client=jayson[_0x4fc6('0x10')][_0x4fc6('0x11')]({'port':0x232b});var client9004=jayson[_0x4fc6('0x10')][_0x4fc6('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x25dd95,_0x4fd544,_0x3f0c88,_0x4990ce){return new BPromise(function(_0x23120e,_0x5b7852){var _0x49c388=_0x4990ce||client;return _0x49c388['request'](_0x25dd95,_0x3f0c88)[_0x4fc6('0x12')](function(_0xab8d70){logger['info'](_0x4fc6('0x13'),_0x4fd544,_0x4fc6('0x14'));logger[_0x4fc6('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4fd544,'request\x20sent',JSON['stringify'](_0xab8d70));if(_0xab8d70['error']){if(_0xab8d70[_0x4fc6('0x16')][_0x4fc6('0x17')]===0x1f4){logger[_0x4fc6('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x4fd544,_0xab8d70['error'][_0x4fc6('0x18')]);return _0x5b7852(_0xab8d70[_0x4fc6('0x16')]['message']);}logger[_0x4fc6('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x4fd544,_0xab8d70[_0x4fc6('0x16')]['message']);return _0x23120e(_0xab8d70['error']['message']);}else{logger[_0x4fc6('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x4fd544,_0x4fc6('0x14'));_0x23120e(_0xab8d70[_0x4fc6('0x1a')][_0x4fc6('0x18')]);}})[_0x4fc6('0x1b')](function(_0x11f4f8){logger[_0x4fc6('0x16')](_0x4fc6('0x13'),_0x4fd544,_0x11f4f8);_0x5b7852(_0x11f4f8);});});}function respondWithStatusCode(_0x1cc4bd,_0x4c78a7){_0x4c78a7=_0x4c78a7||0xcc;return function(_0x1814e5){if(_0x1814e5){return _0x1cc4bd[_0x4fc6('0x1c')](_0x4c78a7);}return _0x1cc4bd[_0x4fc6('0x1d')](_0x4c78a7)[_0x4fc6('0x1e')]();};}function respondWithResult(_0x35eab1,_0x1d12b3){_0x1d12b3=_0x1d12b3||0xc8;return function(_0x47b570){if(_0x47b570){return _0x35eab1[_0x4fc6('0x1d')](_0x1d12b3)[_0x4fc6('0x1f')](_0x47b570);}};}function respondWithFilteredResult(_0x4de676,_0xcc1f2f){return function(_0x8cbf49){if(_0x8cbf49){var _0x4baabd=typeof _0xcc1f2f[_0x4fc6('0x20')]==='undefined'&&typeof _0xcc1f2f[_0x4fc6('0x21')]===_0x4fc6('0x22');var _0x156b7f=_0x8cbf49[_0x4fc6('0x23')];var _0x5eac17=_0x4baabd?0x0:_0xcc1f2f[_0x4fc6('0x20')];var _0x3af3c8=_0x4baabd?_0x8cbf49[_0x4fc6('0x23')]:_0xcc1f2f[_0x4fc6('0x20')]+_0xcc1f2f['limit'];var _0x36ca34;if(_0x3af3c8>=_0x156b7f){_0x3af3c8=_0x156b7f;_0x36ca34=0xc8;}else{_0x36ca34=0xce;}_0x4de676[_0x4fc6('0x1d')](_0x36ca34);return _0x4de676[_0x4fc6('0x24')](_0x4fc6('0x25'),_0x5eac17+'-'+_0x3af3c8+'/'+_0x156b7f)[_0x4fc6('0x1f')](_0x8cbf49);}return null;};}function saveUpdates(_0x1f8edc){return function(_0x1e189a){if(_0x1e189a){return _0x1e189a[_0x4fc6('0x26')](_0x1f8edc)[_0x4fc6('0x12')](function(_0x508108){return _0x508108;});}return null;};}function removeEntity(_0xa3947e){return function(_0x219ef9){if(_0x219ef9){return _0x219ef9[_0x4fc6('0x27')]()['then'](function(){_0xa3947e[_0x4fc6('0x1d')](0xcc)[_0x4fc6('0x1e')]();});}};}function handleEntityNotFound(_0x5ceef0){return function(_0x506fbb){if(!_0x506fbb){_0x5ceef0[_0x4fc6('0x1c')](0x194);}return _0x506fbb;};}function handleError(_0xf776a5,_0x461ba){_0x461ba=_0x461ba||0x1f4;return function(_0x3f5e78){logger['error'](_0x3f5e78[_0x4fc6('0x28')]);if(_0x3f5e78[_0x4fc6('0x29')]){delete _0x3f5e78[_0x4fc6('0x29')];}_0xf776a5[_0x4fc6('0x1d')](_0x461ba)[_0x4fc6('0x2a')](_0x3f5e78);};}function getMustacheRender(_0x2880b7,_0x3100ce){return Mustache['render'](_0x2880b7,_[_0x4fc6('0x2b')](_0x3100ce[_0x4fc6('0x2c')],{'contact':_0x3100ce[_0x4fc6('0x2d')],'message':_0x3100ce[_0x4fc6('0x18')],'agent':_0x3100ce[_0x4fc6('0x2e')],'interaction':_0x3100ce[_0x4fc6('0x2f')],'account':_0x3100ce[_0x4fc6('0x30')]}))||'';}exports[_0x4fc6('0x31')]=function(_0x1542bd,_0x9475f5){var _0x49218e={};var _0x13a217=_[_0x4fc6('0x32')](db[_0x4fc6('0x33')]['rawAttributes'],function(_0x151029){return{'name':_0x151029[_0x4fc6('0x34')],'type':_0x151029[_0x4fc6('0x35')][_0x4fc6('0x36')]};});_0x49218e=qs[_0x4fc6('0x37')](_0x13a217,_0x1542bd);return interaction[_0x4fc6('0x38')](_0x4fc6('0x39'),_0x1542bd['query'],_0x1542bd['user'],_0x49218e,_0x13a217)['then'](respondWithFilteredResult(_0x9475f5,_0x49218e))[_0x4fc6('0x1b')](handleError(_0x9475f5,null));};exports['show']=function(_0x148850,_0x8d2329){var _0x3d8053={'raw':![],'where':{'id':_0x148850[_0x4fc6('0x3a')]['id']}},_0xa792ed={};_0xa792ed['model']=_[_0x4fc6('0x3b')](db[_0x4fc6('0x33')][_0x4fc6('0x3c')]);_0xa792ed[_0x4fc6('0x3d')]=_[_0x4fc6('0x3b')](_0x148850[_0x4fc6('0x3d')]);_0xa792ed[_0x4fc6('0x3e')]=_['intersection'](_0xa792ed[_0x4fc6('0x3f')],_0xa792ed[_0x4fc6('0x3d')]);_0x3d8053[_0x4fc6('0x40')]=_[_0x4fc6('0x41')](_0xa792ed['model'],qs[_0x4fc6('0x42')](_0x148850[_0x4fc6('0x3d')][_0x4fc6('0x42')]));_0x3d8053[_0x4fc6('0x40')]=_0x3d8053['attributes'][_0x4fc6('0x43')]?_0x3d8053[_0x4fc6('0x40')]:_0xa792ed[_0x4fc6('0x3f')];if(_0x148850[_0x4fc6('0x3d')]['includeAll']){_0x3d8053[_0x4fc6('0x44')]=[{'all':!![]}];}_0x3d8053=_['merge']({},_0x3d8053,_0x148850[_0x4fc6('0x45')]);return db[_0x4fc6('0x33')][_0x4fc6('0x46')](_0x3d8053)[_0x4fc6('0x12')](handleEntityNotFound(_0x8d2329,null))['then'](respondWithResult(_0x8d2329,null))[_0x4fc6('0x1b')](handleError(_0x8d2329,null));};exports[_0x4fc6('0x47')]=function(_0x1d28c6,_0x19132d){return db[_0x4fc6('0x33')][_0x4fc6('0x47')](_0x1d28c6['body'],{})[_0x4fc6('0x12')](respondWithResult(_0x19132d,0xc9))[_0x4fc6('0x1b')](handleError(_0x19132d,null));};exports[_0x4fc6('0x26')]=function(_0x54b28b,_0x4abaab){if(_0x54b28b[_0x4fc6('0x2c')]['id']){delete _0x54b28b[_0x4fc6('0x2c')]['id'];}return db[_0x4fc6('0x33')][_0x4fc6('0x46')]({'where':{'id':_0x54b28b[_0x4fc6('0x3a')]['id']}})[_0x4fc6('0x12')](handleEntityNotFound(_0x4abaab,null))['then'](saveUpdates(_0x54b28b[_0x4fc6('0x2c')],null))[_0x4fc6('0x12')](respondWithResult(_0x4abaab,null))['catch'](handleError(_0x4abaab,null));};exports[_0x4fc6('0x27')]=function(_0x1f458b,_0x460eb2){return db[_0x4fc6('0x33')][_0x4fc6('0x46')]({'where':{'id':_0x1f458b[_0x4fc6('0x3a')]['id']}})['then'](handleEntityNotFound(_0x460eb2,null))[_0x4fc6('0x12')](removeEntity(_0x460eb2,null))[_0x4fc6('0x1b')](handleError(_0x460eb2,null));};exports[_0x4fc6('0x48')]=function(_0xb6c9da,_0x1cd548){return db['ChatInteraction'][_0x4fc6('0x48')]()[_0x4fc6('0x12')](respondWithResult(_0x1cd548,null))['catch'](handleError(_0x1cd548,null));};exports[_0x4fc6('0x49')]=function(_0x678a15,_0x542bd5){var _0xc6db2e=_0x678a15[_0x4fc6('0x3a')]['id'];var _0x200fe6;var _0x1d24db;var _0x498c6d;return db[_0x4fc6('0x33')][_0x4fc6('0x4a')]({'where':{'id':_0xc6db2e}})[_0x4fc6('0x12')](function(_0x5b45d6){_0x200fe6=_0x5b45d6;return db[_0x4fc6('0x4b')]['findOne']({'where':{'id':_0x5b45d6[_0x4fc6('0x4c')]},'attributes':['id',_0x4fc6('0x4d'),_0x4fc6('0x4e'),_0x4fc6('0x4f'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x4fc6('0x12')](function(_0x50ce8c){if(_0x50ce8c&&_0x50ce8c[_0x4fc6('0x4d')]&&_0x50ce8c[_0x4fc6('0x4e')]){_0x1d24db=_0x50ce8c;var _0x45c24b={'interaction':{'id':_0xc6db2e},'agent':{'id':_0x678a15[_0x4fc6('0x50')]['id'],'name':_0x678a15[_0x4fc6('0x50')]['name'],'fullname':_0x678a15['user'][_0x4fc6('0x51')],'email':_0x678a15[_0x4fc6('0x50')]['email']},'contact':_0x678a15[_0x4fc6('0x2c')][_0x4fc6('0x2d')],'account':_0x678a15[_0x4fc6('0x2c')][_0x4fc6('0x30')]};var _0x190a07={'rejectUnauthorized':![],'method':_0x4fc6('0x52'),'url':_0x4fc6('0x53'),'headers':{'X-APIKEY':_0x50ce8c['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x678a15[_0x4fc6('0x50')]['email']],'buttons':null,'topic':_0x1d24db[_0x4fc6('0x4f')],'note':_[_0x4fc6('0x54')](_0x1d24db['vidaooNote'])?null:getMustacheRender(_0x1d24db[_0x4fc6('0x55')],_0x45c24b),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x4fc6('0x54')](_0x1d24db[_0x4fc6('0x56')])){var _0x4832b7=getMustacheRender(_0x1d24db['vidaooMetadata'],_0x45c24b);var _0x588970=JSON['parse'](_0x4832b7);_0x190a07[_0x4fc6('0x2c')][_0x4fc6('0x57')]=_0x588970;}}catch(_0x43114c){throw new db[(_0x4fc6('0x58'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x190a07);}else{throw new db[(_0x4fc6('0x58'))][(_0x4fc6('0x59'))](_0x4fc6('0x5a'));}})[_0x4fc6('0x12')](function(_0x4a62fd){_0x498c6d=_0x4a62fd;if(_0x498c6d['id']){var _0x331a92={'body':_0x498c6d[_0x4fc6('0x5b')],'ChatWebsiteId':_0x1d24db['id'],'ChatInteractionId':_0x200fe6['id'],'direction':_0x4fc6('0x5c'),'UserId':_0x678a15['user']['id']};return db[_0x4fc6('0x5d')][_0x4fc6('0x47')](_0x331a92,{});}else{throw new db[(_0x4fc6('0x58'))][(_0x4fc6('0x59'))](_0x4fc6('0x5e'));}})['then'](function(){return _0x200fe6[_0x4fc6('0x5f')]({'vidaooSessionId':_0x498c6d['id']});})[_0x4fc6('0x12')](respondWithResult(_0x542bd5,null))['catch'](handleError(_0x542bd5,null));};exports[_0x4fc6('0x60')]=function(_0x3e4b17,_0xb94fbc){if(_0x3e4b17[_0x4fc6('0x2c')]['id']){delete _0x3e4b17['body']['id'];}return db[_0x4fc6('0x33')][_0x4fc6('0x46')]({'where':{'id':_0x3e4b17['params']['id']},'include':[{'model':db[_0x4fc6('0x61')],'as':_0x4fc6('0x62')}]})[_0x4fc6('0x12')](handleEntityNotFound(_0xb94fbc,null))[_0x4fc6('0x12')](saveUpdates(_0x3e4b17[_0x4fc6('0x2c')],null))[_0x4fc6('0x12')](respondWithResult(_0xb94fbc,null))['catch'](handleError(_0xb94fbc,null));};exports[_0x4fc6('0x63')]=function(_0x445a04,_0x214439){if(_0x445a04[_0x4fc6('0x2c')]['id']){delete _0x445a04['body']['id'];}return db[_0x4fc6('0x33')][_0x4fc6('0x46')]({'where':{'id':_0x445a04[_0x4fc6('0x3a')]['id']}})[_0x4fc6('0x12')](function(_0x566eb8){if(!_0x566eb8){logger[_0x4fc6('0x16')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x4fc6('0x63'),0x194,_0x4fc6('0x64'));_0x214439[_0x4fc6('0x1c')](0x194);}else{if(_0x566eb8[_0x4fc6('0x65')]){throw new db[(_0x4fc6('0x58'))][(_0x4fc6('0x59'))](_0x4fc6('0x66'));}}return _0x566eb8;})[_0x4fc6('0x12')](function(_0x298ea8){if(_0x298ea8){return _0x298ea8[_0x4fc6('0x26')]({'closed':_0x445a04[_0x4fc6('0x2c')][_0x4fc6('0x67')],'disposition':_0x445a04['body'][_0x4fc6('0x68')]})['then'](function(_0x218576){return _0x218576;});}})[_0x4fc6('0x12')](function(){return respondWithRpcPromise(_0x4fc6('0x69'),'abandon',_0x445a04[_0x4fc6('0x2c')],client9004);})['then'](respondWithResult(_0x214439,null))['catch'](handleError(_0x214439,null));};exports[_0x4fc6('0x6a')]=function(_0x1f7f8f,_0x881371){_0x1f7f8f['body'][_0x4fc6('0x29')]=_0x1f7f8f['file'][_0x4fc6('0x6b')];_0x1f7f8f[_0x4fc6('0x2c')][_0x4fc6('0x6c')]=_0x1f7f8f[_0x4fc6('0x6d')]['filename'];_0x1f7f8f[_0x4fc6('0x2c')]['type']=_0x1f7f8f['file'][_0x4fc6('0x6e')];return db[_0x4fc6('0x6f')]['create'](_0x1f7f8f[_0x4fc6('0x2c')])[_0x4fc6('0x12')](respondWithResult(_0x881371,0xc9))['catch'](handleError(_0x881371,null));};exports[_0x4fc6('0x70')]=function(_0x16ea78,_0x482fa6){return db[_0x4fc6('0x33')]['findOne']({'where':{'id':_0x16ea78['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x482fa6,null))[_0x4fc6('0x12')](function(_0x4e2f4f){if(_0x4e2f4f){if(_0x4e2f4f[_0x4fc6('0x67')]){return _0x482fa6['status'](0x193)[_0x4fc6('0x1f')]({'status':0x193,'message':_0x4fc6('0x71')});}return db[_0x4fc6('0x6f')]['findOne']({'where':{'id':_0x16ea78[_0x4fc6('0x3d')][_0x4fc6('0x72')]},'raw':!![]})[_0x4fc6('0x12')](handleEntityNotFound(_0x482fa6,null));}})[_0x4fc6('0x12')](function(_0x161c6b){if(_0x161c6b){var _0xd1278c=_0x161c6b['ChatOfflineMessageId']!==null;var _0x2c4159=path['join'](config[_0x4fc6('0x73')],'server/files/attachments/');if(_0xd1278c){_0x2c4159=path[_0x4fc6('0x74')](_0x2c4159,'offline-chat/');}var _0x56b389=path['join'](_0x2c4159,_0x161c6b[_0x4fc6('0x6c')]);return _0x482fa6[_0x4fc6('0x75')](_0x56b389);}})[_0x4fc6('0x1b')](handleError(_0x482fa6,null));};exports[_0x4fc6('0x76')]=function(_0x1eb4f2,_0x5f2297){var _0x4da04e=null;var _0x242141=null;var _0x4527da=null;if(_0x1eb4f2[_0x4fc6('0x2c')]['id']){delete _0x1eb4f2[_0x4fc6('0x2c')]['id'];}if(_0x1eb4f2[_0x4fc6('0x2c')][_0x4fc6('0x77')]){_0x4527da=path[_0x4fc6('0x74')](config[_0x4fc6('0x73')],_0x4fc6('0x78'),util[_0x4fc6('0x79')]('transcript-%s.txt',Date[_0x4fc6('0x7a')]()));_0x1eb4f2[_0x4fc6('0x2c')][_0x4fc6('0x7b')]=_0x4527da;}return db['ChatInteraction'][_0x4fc6('0x46')]({'where':{'id':_0x1eb4f2['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x4fc6('0x7c')],'as':_0x4fc6('0x7c')}]}]})['then'](handleEntityNotFound(_0x5f2297,null))[_0x4fc6('0x12')](saveUpdates(_0x1eb4f2[_0x4fc6('0x2c')],null))[_0x4fc6('0x12')](function(_0x373a97){if(_0x373a97){_0x4da04e=_0x373a97;return db[_0x4fc6('0x4b')][_0x4fc6('0x46')]({'where':{'id':_0x4da04e[_0x4fc6('0x4c')]}});}})[_0x4fc6('0x12')](function(_0x2bee20){if(_0x2bee20){_0x242141=_0x2bee20;return db[_0x4fc6('0x61')][_0x4fc6('0x46')]({'where':{'id':_0x4da04e[_0x4fc6('0x7d')]}});}})[_0x4fc6('0x12')](function(_0x4d3723){if(_0x4d3723){if(_0x4527da){var _0x1c8309=null;for(var _0xf6c2b4=0x1;_0xf6c2b4<_0x4da04e[_0x4fc6('0x7e')][_0x4fc6('0x43')];++_0xf6c2b4){_0x1c8309=_0x4da04e[_0x4fc6('0x7e')][_0xf6c2b4];var _0x5e3bb4=_0x1c8309[_0x4fc6('0x65')]?util['format']('%s%d',_0x242141[_0x4fc6('0x7f')],_0x1c8309[_0x4fc6('0x65')]):_0x4fc6('0x80');var _0x20a21c=_0x1eb4f2['body'][_0x4fc6('0x81')]||util[_0x4fc6('0x79')](_0x4fc6('0x82'),_0x4fc6('0x83'),_0x1c8309[_0x4fc6('0x7d')]);switch(_0x242141[_0x4fc6('0x84')]){case _0x4fc6('0x85'):_0x5e3bb4=_0x1c8309[_0x4fc6('0x65')]?util[_0x4fc6('0x79')](_0x4fc6('0x82'),_0x242141[_0x4fc6('0x7f')],_0x1c8309[_0x4fc6('0x65')]):_0x4fc6('0x80');break;case'agent_alias':_0x5e3bb4=_0x1c8309[_0x4fc6('0x65')]?_0x1c8309[_0x4fc6('0x7c')][_0x4fc6('0x86')]||_0x1c8309[_0x4fc6('0x7c')][_0x4fc6('0x51')]:_0x4fc6('0x80');break;case _0x4fc6('0x87'):_0x5e3bb4=_0x1c8309[_0x4fc6('0x65')]?_0x1c8309[_0x4fc6('0x7c')]['fullname']:_0x4fc6('0x80');break;default:_0x5e3bb4=_0x1c8309[_0x4fc6('0x65')]?util[_0x4fc6('0x79')](_0x4fc6('0x82'),_0x242141[_0x4fc6('0x7f')],_0x1c8309[_0x4fc6('0x65')]):_0x4fc6('0x80');}var _0xcc09d0=util[_0x4fc6('0x79')](_0x4fc6('0x88'),moment(_0x1c8309[_0x4fc6('0x89')])[_0x4fc6('0x79')](_0x4fc6('0x8a')),_0x1c8309[_0x4fc6('0x8b')]==='in'?_0x20a21c:_0x5e3bb4,_0x1c8309[_0x4fc6('0x2c')]);if(!_0x1c8309[_0x4fc6('0x8c')]){fs['appendFileSync'](_0x4527da,_0xcc09d0);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x4fc6('0x8d')],'as':_0x4fc6('0x8e'),'raw':!![],'include':[{'model':db[_0x4fc6('0x8f')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x4fc6('0x12')](function(_0x49d9d8){if(!_0x49d9d8||!_0x49d9d8[_0x4fc6('0x8e')]||!_0x1eb4f2['body'])return _0x4da04e;var _0x3964c0=_0x49d9d8[_0x4fc6('0x90')]();return respondWithRpcPromise('SendMail',_0x4fc6('0x91'),{'account':_0x3964c0,'message':{'from':util[_0x4fc6('0x79')]('\x22%s\x22\x20<%s>',_0x49d9d8[_0x4fc6('0x29')],_0x49d9d8['email']||_0x49d9d8[_0x4fc6('0x8e')]['user']),'to':_0x1eb4f2[_0x4fc6('0x2c')][_0x4fc6('0x77')],'subject':'Mail\x20Transcript','text':util[_0x4fc6('0x79')](_0x4fc6('0x92'),_0x1eb4f2[_0x4fc6('0x2c')][_0x4fc6('0x77')]),'attachments':[{'path':_0x4527da}]}})[_0x4fc6('0x12')](function(){return _0x4da04e;})[_0x4fc6('0x1b')](function(_0x2409e6){logger['error'](_0x2409e6);});})[_0x4fc6('0x12')](respondWithStatusCode(_0x5f2297,0xc8))[_0x4fc6('0x1b')](handleError(_0x5f2297,null));};exports['addMessage']=function(_0x1b08da,_0x2820c6){return db[_0x4fc6('0x5d')][_0x4fc6('0x46')]({'where':{'id':_0x1b08da['params']['id']}})[_0x4fc6('0x12')](handleEntityNotFound(_0x2820c6,null))[_0x4fc6('0x12')](function(_0x4b2ac2){if(_0x4b2ac2){return _0x4b2ac2[_0x4fc6('0x93')](_0x1b08da[_0x4fc6('0x2c')][_0x4fc6('0x94')],_['omit'](_0x1b08da[_0x4fc6('0x2c')],[_0x4fc6('0x94'),'id'])||{});}})[_0x4fc6('0x12')](respondWithResult(_0x2820c6,null))['catch'](handleError(_0x2820c6,null));};exports['getMessages']=function(_0xacf389,_0x54d3ed){var _0x318a5a={'raw':![],'where':{}};var _0x777f49={};var _0x33160f={'count':0x0,'rows':[]};return db[_0x4fc6('0x33')][_0x4fc6('0x4a')]({'where':{'id':_0xacf389[_0x4fc6('0x3a')]['id']}})[_0x4fc6('0x12')](handleEntityNotFound(_0x54d3ed,null))[_0x4fc6('0x12')](function(_0x5a3a84){if(_0x5a3a84){_0x777f49['model']=_[_0x4fc6('0x3b')](db[_0x4fc6('0x5d')][_0x4fc6('0x3c')]);_0x777f49[_0x4fc6('0x3d')]=_[_0x4fc6('0x3b')](_0xacf389[_0x4fc6('0x3d')]);_0x777f49[_0x4fc6('0x3e')]=_[_0x4fc6('0x41')](_0x777f49['model'],_0x777f49[_0x4fc6('0x3d')]);_0x318a5a['attributes']=_[_0x4fc6('0x41')](_0x777f49[_0x4fc6('0x3f')],qs[_0x4fc6('0x42')](_0xacf389[_0x4fc6('0x3d')][_0x4fc6('0x42')]));_0x318a5a[_0x4fc6('0x40')]=_0x318a5a['attributes']['length']?_0x318a5a[_0x4fc6('0x40')]:_0x777f49[_0x4fc6('0x3f')];if(!_0xacf389['query']['hasOwnProperty']('nolimit')){_0x318a5a[_0x4fc6('0x21')]=qs[_0x4fc6('0x21')](_0xacf389['query'][_0x4fc6('0x21')]);_0x318a5a[_0x4fc6('0x20')]=qs[_0x4fc6('0x20')](_0xacf389[_0x4fc6('0x3d')][_0x4fc6('0x20')]);}_0x318a5a[_0x4fc6('0x95')]=qs['sort'](_0xacf389[_0x4fc6('0x3d')][_0x4fc6('0x96')]);_0x318a5a['where']=qs[_0x4fc6('0x3e')](_['pick'](_0xacf389[_0x4fc6('0x3d')],_0x777f49[_0x4fc6('0x3e')]));_0x318a5a[_0x4fc6('0x97')][_0x4fc6('0x98')]=_0x5a3a84['id'];if(_0xacf389[_0x4fc6('0x3d')]['filter']){_0x318a5a[_0x4fc6('0x97')]=_[_0x4fc6('0x2b')](_0x318a5a[_0x4fc6('0x97')],{'$or':_[_0x4fc6('0x32')](_0x318a5a[_0x4fc6('0x40')],function(_0x1d7b5a){var _0x13a47c={};_0x13a47c[_0x1d7b5a]={'$like':'%'+_0xacf389[_0x4fc6('0x3d')][_0x4fc6('0x99')]+'%'};return _0x13a47c;})});}if(_0xacf389[_0x4fc6('0x3d')]['$gte']){var _0xae8b3e=_0xacf389[_0x4fc6('0x3d')][_0x4fc6('0x9a')][_0x4fc6('0x9b')](',');var _0x2434d0={};_0x2434d0[_0xae8b3e[0x0]]={'$gte':moment(_0xae8b3e[0x1])[_0x4fc6('0x79')](_0x4fc6('0x9c'))};_0x318a5a[_0x4fc6('0x97')]=_[_0x4fc6('0x2b')](_0x318a5a[_0x4fc6('0x97')],_0x2434d0);}_0x318a5a=_[_0x4fc6('0x2b')]({},_0x318a5a,_0xacf389[_0x4fc6('0x45')]);return db[_0x4fc6('0x5d')][_0x4fc6('0x23')]({'where':_0x318a5a[_0x4fc6('0x97')]})[_0x4fc6('0x12')](function(_0x3c4a22){_0x33160f[_0x4fc6('0x23')]=_0x3c4a22;if(_0xacf389[_0x4fc6('0x3d')][_0x4fc6('0x9d')]){_0x318a5a[_0x4fc6('0x44')]=[{'all':!![]}];}return db[_0x4fc6('0x5d')][_0x4fc6('0x38')](_0x318a5a);})['then'](function(_0x52c6ba){_0x33160f[_0x4fc6('0x9e')]=_0x52c6ba;return _0x33160f;});}})[_0x4fc6('0x12')](respondWithFilteredResult(_0x54d3ed,_0x318a5a))[_0x4fc6('0x1b')](handleError(_0x54d3ed,null));};exports['getMyMessages']=function(_0x81b7ed,_0x540c02){var _0x496b2a={'where':{}},_0xf354bc={},_0x1ebc25={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x4fc6('0x4a')]({'where':{'id':_0x81b7ed[_0x4fc6('0x3a')]['id']}})[_0x4fc6('0x12')](handleEntityNotFound(_0x540c02,null))[_0x4fc6('0x12')](function(_0x4c1e22){if(_0x4c1e22){_0xf354bc['model']=_[_0x4fc6('0x3b')](db[_0x4fc6('0x5d')][_0x4fc6('0x3c')]);_0xf354bc[_0x4fc6('0x3d')]=_['keys'](_0x81b7ed[_0x4fc6('0x3d')]);_0xf354bc['filters']=_[_0x4fc6('0x41')](_0xf354bc['model'],_0xf354bc['query']);_0x496b2a['attributes']=_[_0x4fc6('0x41')](_0xf354bc[_0x4fc6('0x3f')],qs[_0x4fc6('0x42')](_0x81b7ed[_0x4fc6('0x3d')][_0x4fc6('0x42')]));_0x496b2a[_0x4fc6('0x40')]=_0x496b2a[_0x4fc6('0x40')][_0x4fc6('0x43')]?_0x496b2a['attributes']:_0xf354bc['model'];if(!_0x81b7ed[_0x4fc6('0x3d')][_0x4fc6('0x9f')]('nolimit')){_0x496b2a['limit']=qs[_0x4fc6('0x21')](_0x81b7ed[_0x4fc6('0x3d')][_0x4fc6('0x21')]);_0x496b2a[_0x4fc6('0x20')]=qs['offset'](_0x81b7ed['query'][_0x4fc6('0x20')]);}_0x496b2a['order']=qs[_0x4fc6('0x96')](_0x81b7ed['query'][_0x4fc6('0x96')]);_0x496b2a[_0x4fc6('0x97')]=qs[_0x4fc6('0x3e')](_['pick'](_0x81b7ed['query'],_0xf354bc[_0x4fc6('0x3e')]));_0x496b2a[_0x4fc6('0x97')]['ChatInteractionId']=_0x4c1e22['id'];if(_0x81b7ed[_0x4fc6('0x3d')][_0x4fc6('0x99')]){_0x496b2a['where']=_[_0x4fc6('0x2b')](_0x496b2a[_0x4fc6('0x97')],{'$or':_[_0x4fc6('0x32')](_0x496b2a['attributes'],function(_0x37ca7a){var _0x49ee3f={};_0x49ee3f[_0x37ca7a]={'$like':'%'+_0x81b7ed[_0x4fc6('0x3d')][_0x4fc6('0x99')]+'%'};return _0x49ee3f;})});}_0x496b2a[_0x4fc6('0x97')][_0x4fc6('0x8c')]=![];if(_0x81b7ed[_0x4fc6('0x3d')]['id']){_0x496b2a[_0x4fc6('0x97')]['id']={'$gt':_0x81b7ed[_0x4fc6('0x3d')]['id']};}_0x496b2a=_[_0x4fc6('0x2b')]({},_0x496b2a,_0x81b7ed['options']);return db['ChatMessage']['count']({'where':_0x496b2a[_0x4fc6('0x97')]})[_0x4fc6('0x12')](function(_0x12d291){_0x1ebc25['count']=_0x12d291;_0x496b2a[_0x4fc6('0x44')]=[];if(_0x81b7ed[_0x4fc6('0x3d')][_0x4fc6('0xa0')]){_0x496b2a['include']['push']({'model':db[_0x4fc6('0x7c')],'as':_0x4fc6('0x7c'),'attributes':['id','fullname','alias']});}if(_0x81b7ed[_0x4fc6('0x3d')][_0x4fc6('0x9d')]){_0x496b2a[_0x4fc6('0x44')]=[{'all':!![]}];}return db[_0x4fc6('0x5d')][_0x4fc6('0x38')](_0x496b2a);})[_0x4fc6('0x12')](function(_0x27b030){_0x1ebc25['rows']=_0x27b030;return _0x1ebc25;});}})[_0x4fc6('0x12')](respondWithFilteredResult(_0x540c02,_0x496b2a))[_0x4fc6('0x1b')](handleError(_0x540c02,null));};exports[_0x4fc6('0xa1')]=function(_0xe15a,_0x525d39){return db[_0x4fc6('0x33')][_0x4fc6('0x46')]({'where':{'id':_0xe15a['params']['id']}})[_0x4fc6('0x12')](handleEntityNotFound(_0x525d39,null))['then'](function(_0x224af2){if(_0x224af2){return _0x224af2[_0x4fc6('0xa2')](_0xe15a[_0x4fc6('0x2c')][_0x4fc6('0x94')],_[_0x4fc6('0xa3')](_0xe15a[_0x4fc6('0x2c')],['ids','id'])||{})[_0x4fc6('0xa4')](function(){return db['Tag'][_0x4fc6('0x38')]({'attributes':['id',_0x4fc6('0x29'),'color'],'where':{'id':_0xe15a[_0x4fc6('0x2c')][_0x4fc6('0x94')]}});})[_0x4fc6('0x12')](function(_0x1f5f6b){socket[_0x4fc6('0xa5')]('chatInteractionTags:save',{'id':Number(_0xe15a[_0x4fc6('0x3a')]['id']),'tags':_0x1f5f6b||[]});return{'id':Number(_0xe15a[_0x4fc6('0x3a')]['id']),'tags':_0x1f5f6b||[]};});}})[_0x4fc6('0x12')](respondWithResult(_0x525d39,null))[_0x4fc6('0x1b')](handleError(_0x525d39,null));};exports[_0x4fc6('0xa6')]=function(_0x541ab2,_0x3200cc){return db[_0x4fc6('0x33')]['find']({'where':{'id':_0x541ab2[_0x4fc6('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3200cc,null))[_0x4fc6('0x12')](function(_0xfdbc0f){if(_0xfdbc0f){return _0xfdbc0f['removeTags'](_0x541ab2[_0x4fc6('0x3d')][_0x4fc6('0x94')]);}})[_0x4fc6('0x12')](respondWithStatusCode(_0x3200cc,null))[_0x4fc6('0x1b')](handleError(_0x3200cc,null));};exports[_0x4fc6('0x75')]=function(_0x4a9147,_0x3698f9){var _0xc8f65=moment()[_0x4fc6('0xa7')]()[_0x4fc6('0xa8')]();var _0x3ba9e3=path['join'](config[_0x4fc6('0x73')],_0x4fc6('0xa9'),'files',_0x4fc6('0xaa'));var _0x40f016=path['join'](config[_0x4fc6('0x73')],_0x4fc6('0xa9'),'files','attachments');var _0x4a4593=path['join'](_0x3ba9e3,_0xc8f65);var _0x30e85a=util[_0x4fc6('0x79')]('transcript-%d-%s.zip',_0x4a9147[_0x4fc6('0x3a')]['id'],_0xc8f65);var _0x39f2c5=path['join'](_0x3ba9e3,_0x30e85a);var _0x240a54=[];_0x240a54['push']({'model':db['User'],'as':_0x4fc6('0x7c'),'attributes':['id',_0x4fc6('0x51')],'raw':!![]});_0x240a54[_0x4fc6('0xab')]({'model':db[_0x4fc6('0x61')],'as':_0x4fc6('0x62'),'attributes':['id',_0x4fc6('0xac'),_0x4fc6('0xad')],'raw':!![]});if(_0x4a9147[_0x4fc6('0x3d')][_0x4fc6('0xae')]){_0x240a54[_0x4fc6('0xab')]({'model':db['Attachment'],'as':_0x4fc6('0x6f'),'raw':!![]});}var _0x18b2fc=[{'model':db['ChatMessage'],'as':_0x4fc6('0x7e'),'attributes':['id',_0x4fc6('0x2c'),_0x4fc6('0x89'),_0x4fc6('0x8b'),_0x4fc6('0x8c'),_0x4fc6('0xaf')],'include':_0x240a54}];_0x18b2fc['push']({'model':db[_0x4fc6('0x4b')],'as':'Account','attributes':['id',_0x4fc6('0x29')]});_0x18b2fc[_0x4fc6('0xab')]({'model':db['User'],'as':_0x4fc6('0xb0'),'attributes':['id','fullname']});return db[_0x4fc6('0x33')][_0x4fc6('0x46')]({'where':{'id':_0x4a9147[_0x4fc6('0x3a')]['id']},'include':_0x18b2fc})['then'](handleEntityNotFound(_0x3698f9,null))[_0x4fc6('0x12')](function(_0x51a6d1){if(_0x51a6d1){var _0x4627af=_0x51a6d1['get']({'plain':!![]});fs[_0x4fc6('0xb1')](_0x4a4593);var _0x272bc8={'channel':_0x4fc6('0xb2'),'account':_0x4627af[_0x4fc6('0xb3')][_0x4fc6('0x29')],'agent':_0x4627af[_0x4fc6('0xb0')]?_0x4627af[_0x4fc6('0xb0')][_0x4fc6('0x51')]:_0x4fc6('0xb4'),'createdAt':moment(_0x4627af[_0x4fc6('0x89')])[_0x4fc6('0x79')](_0x4fc6('0x9c'))['toString'](),'closedAt':_0x4627af[_0x4fc6('0x67')]?moment(_0x4627af[_0x4fc6('0xb5')])[_0x4fc6('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4fc6('0xa8')]():'','disposition':_0x4627af[_0x4fc6('0x68')],'chatInfo':{'browser':_0x4627af[_0x4fc6('0xb6')],'os':_0x4627af[_0x4fc6('0xb7')],'referer':_0x4627af[_0x4fc6('0xb8')],'customerIp':_0x4627af[_0x4fc6('0xb9')],'customerPort':_0x4627af[_0x4fc6('0xba')]?_0x4627af[_0x4fc6('0xba')]:'N.A.'},'messages':_(_0x4627af['Messages'])['tail']()[_0x4fc6('0x99')]({'secret':![]})[_0x4fc6('0x32')](function(_0x53aaba){if(_0x53aaba[_0x4fc6('0x6f')]){var _0x4e6a6e=path['join'](_0x40f016,_0x53aaba[_0x4fc6('0x6f')][_0x4fc6('0x6c')]);if(fs[_0x4fc6('0xbb')](_0x4e6a6e)){fs['createReadStream'](_0x4e6a6e)[_0x4fc6('0xbc')](fs[_0x4fc6('0xbd')](path[_0x4fc6('0x74')](_0x4a4593,_0x53aaba['Attachment'][_0x4fc6('0x6c')])));}}return{'date':moment(_0x53aaba[_0x4fc6('0x89')])[_0x4fc6('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4fc6('0xa8')](),'sender':_0x53aaba['direction']===_0x4fc6('0x5c')?_0x53aaba[_0x4fc6('0x7c')]?_0x53aaba[_0x4fc6('0x7c')][_0x4fc6('0x51')]:_0x4fc6('0x80'):_0x53aaba[_0x4fc6('0x62')][_0x4fc6('0xac')]+(_0x53aaba['Contact']['lastName']?'\x20'+_0x53aaba[_0x4fc6('0x62')]['lastName']:''),'body':_0x53aaba[_0x4fc6('0x6f')]?_0x53aaba[_0x4fc6('0x6f')]['basename']:_0x53aaba['body'],'direction':_0x53aaba[_0x4fc6('0x8b')]===_0x4fc6('0x5c')?'A':'C','secret':_0x53aaba['secret'],'read':_0x53aaba['read'],'attachment':_0x53aaba[_0x4fc6('0x6f')]};})[_0x4fc6('0xbe')]()};return ejs[_0x4fc6('0xbf')](path[_0x4fc6('0x74')](config[_0x4fc6('0x73')],_0x4fc6('0xa9'),_0x4fc6('0xc0'),_0x4fc6('0xc1')),{'interaction':_0x272bc8})[_0x4fc6('0x12')](function(_0x2d2e8e){var _0x3638ee=path['join'](_0x4a4593,_0x4fc6('0xc2')+_0x4627af['id']+'-'+_0xc8f65+'.pdf');var _0x45e3b0={'path':_0x3638ee,'channel':_0x4fc6('0xb2'),'interactionId':_0x4627af['id']};return pdf[_0x4fc6('0xc3')](_0x2d2e8e,_0x45e3b0);})[_0x4fc6('0x12')](function(){return new Promise(function(_0x50d3da,_0x57156a){zipdir(_0x4a4593,{'saveTo':_0x39f2c5},function(_0x7cea3,_0x155c68){if(_0x7cea3)return _0x57156a(_0x7cea3);return _0x50d3da(_0x155c68);});})[_0x4fc6('0x12')](function(){return new BPromise(function(_0xfc4b5c,_0x3b9f48){rimraf(_0x4a4593,function(_0x57a028){if(_0x57a028)_0x3b9f48(_0x57a028);return _0xfc4b5c();});});})['then'](function(){return _0x3698f9['download'](_0x39f2c5,_0x30e85a,function(_0x59d344){if(_0x59d344){logger[_0x4fc6('0x16')](_0x4fc6('0xc4'),_0x59d344);}else{fs[_0x4fc6('0xc5')](_0x39f2c5);}});});});}else{return _0x3698f9[_0x4fc6('0x1c')](0xc8);}})[_0x4fc6('0x1b')](handleError(_0x3698f9,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 296b76d..902e324 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 _0x50f1=['unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update','remove','then','Users','map','findAll','setDataValue'];(function(_0x24cc3e,_0x3b2f20){var _0x299210=function(_0x19e3f5){while(--_0x19e3f5){_0x24cc3e['push'](_0x24cc3e['shift']());}};_0x299210(++_0x3b2f20);}(_0x50f1,0x180));var _0x150f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x50f1[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x150f('0x0'));var ChatInteraction=require(_0x150f('0x1'))['db'][_0x150f('0x2')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x150f('0x3')](0x0);var events={'afterCreate':_0x150f('0x4'),'afterUpdate':_0x150f('0x5'),'afterDestroy':_0x150f('0x6')};function emitEvent(_0x318465){return function(_0x59830c,_0x3b6f74,_0x47ce97){_0x59830c['getUsers']({'attributes':['id'],'raw':!![]})[_0x150f('0x7')](function(_0x122c95){_0x59830c['setDataValue'](_0x150f('0x8'),_0x122c95[_0x150f('0x9')](function(_0xc5ad76){return{'id':_0xc5ad76['id']};}));return ChatMessage[_0x150f('0xa')]({'where':{'ChatInteractionId':_0x59830c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x150f('0x7')](function(_0xb2555f){_0x59830c[_0x150f('0xb')](_0x150f('0xc'),_0xb2555f[_0x150f('0xd')]);ChatInteractionEvents[_0x150f('0xe')](_0x318465+':'+_0x59830c['id'],_0x59830c);ChatInteractionEvents[_0x150f('0xe')](_0x318465,_0x59830c);_0x47ce97(null);})[_0x150f('0xf')](_0x47ce97(null));};}for(var e in events){if(events[_0x150f('0x10')](e)){var event=events[e];ChatInteraction[_0x150f('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x59a3=['length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x59a3,0x102));var _0x359a=function(_0x7a50a5,_0x19b21a){_0x7a50a5=_0x7a50a5-0x0;var _0x5acd1b=_0x59a3[_0x7a50a5];return _0x5acd1b;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x359a('0x0'))['db'][_0x359a('0x1')];var ChatMessage=require(_0x359a('0x0'))['db'][_0x359a('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x359a('0x3')](0x0);var events={'afterCreate':_0x359a('0x4'),'afterUpdate':_0x359a('0x5'),'afterDestroy':_0x359a('0x6')};function emitEvent(_0x1f925c){return function(_0x224013,_0x5c6dd6,_0x4ba71b){_0x224013['getUsers']({'attributes':['id'],'raw':!![]})[_0x359a('0x7')](function(_0x11d97f){_0x224013[_0x359a('0x8')](_0x359a('0x9'),_0x11d97f[_0x359a('0xa')](function(_0x6cb691){return{'id':_0x6cb691['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x224013['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5f3ef0){_0x224013['setDataValue'](_0x359a('0xb'),_0x5f3ef0[_0x359a('0xc')]);ChatInteractionEvents[_0x359a('0xd')](_0x1f925c+':'+_0x224013['id'],_0x224013);ChatInteractionEvents['emit'](_0x1f925c,_0x224013);_0x4ba71b(null);})[_0x359a('0xe')](_0x4ba71b(null));};}for(var e in events){if(events[_0x359a('0xf')](e)){var event=events[e];ChatInteraction[_0x359a('0x10')](e,emitEvent(event));}}module[_0x359a('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 865db10..1461c8f 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 _0xd47e=['rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path'];(function(_0x1bf737,_0x4c3631){var _0x1629d1=function(_0x10c5d6){while(--_0x10c5d6){_0x1bf737['push'](_0x1bf737['shift']());}};_0x1629d1(++_0x4c3631);}(_0xd47e,0x11b));var _0xed47=function(_0xe3ca7f,_0x2fa923){_0xe3ca7f=_0xe3ca7f-0x0;var _0x22650c=_0xd47e[_0xe3ca7f];return _0x22650c;};'use strict';var _=require(_0xed47('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xed47('0x1'));var moment=require(_0xed47('0x2'));var BPromise=require(_0xed47('0x3'));var rp=require(_0xed47('0x4'));var fs=require('fs');var path=require(_0xed47('0x5'));var rimraf=require(_0xed47('0x6'));var config=require(_0xed47('0x7'));var attributes=require(_0xed47('0x8'));module[_0xed47('0x9')]=function(_0x3057b5,_0x5c7b74){return _0x3057b5[_0xed47('0xa')]('ChatInteraction',attributes,{'tableName':_0xed47('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c6665,_0x39f557,_0x26a537){if(_0x1c6665['changed'](_0xed47('0xc'))){_0x1c6665[_0xed47('0xd')]=moment()[_0xed47('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x26a537(null,_0x1c6665);}},'charset':_0xed47('0xf'),'collate':_0xed47('0x10')});}; \ No newline at end of file +var _0x60e2=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','rimraf','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions'];(function(_0x39503a,_0x3d959e){var _0x3110cc=function(_0x4090c3){while(--_0x4090c3){_0x39503a['push'](_0x39503a['shift']());}};_0x3110cc(++_0x3d959e);}(_0x60e2,0x1e5));var _0x260e=function(_0x152cb6,_0x10b962){_0x152cb6=_0x152cb6-0x0;var _0x22080a=_0x60e2[_0x152cb6];return _0x22080a;};'use strict';var _=require('lodash');var util=require(_0x260e('0x0'));var logger=require(_0x260e('0x1'))('api');var moment=require(_0x260e('0x2'));var BPromise=require(_0x260e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x260e('0x4'));var rimraf=require(_0x260e('0x5'));var config=require('../../config/environment');var attributes=require(_0x260e('0x6'));module[_0x260e('0x7')]=function(_0x2d2fcb,_0x385b20){return _0x2d2fcb[_0x260e('0x8')](_0x260e('0x9'),attributes,{'tableName':_0x260e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x315fdf,_0x4cdb66,_0x40aa75){if(_0x315fdf[_0x260e('0xb')](_0x260e('0xc'))){_0x315fdf[_0x260e('0xd')]=moment()['format'](_0x260e('0xe'));}_0x40aa75(null,_0x315fdf);}},'charset':'utf8mb4','collate':_0x260e('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index bb34709..7702aeb 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 _0xd17a=['request\x20sent','result','catch','UpdateChatInteraction','update','options','raw','where','attributes','limit','AddTagsToChatInteraction','ChatInteraction','find','addTags','body','ids','spread','AddTags','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x1af0e5,_0x152990){var _0x3c444a=function(_0x3b3d13){while(--_0x3b3d13){_0x1af0e5['push'](_0x1af0e5['shift']());}};_0x3c444a(++_0x152990);}(_0xd17a,0xc3));var _0xad17=function(_0x27a848,_0x2dfc9a){_0x27a848=_0x27a848-0x0;var _0x57dbb0=_0xd17a[_0x27a848];return _0x57dbb0;};'use strict';var _=require(_0xad17('0x0'));var util=require('util');var moment=require(_0xad17('0x1'));var BPromise=require(_0xad17('0x2'));var rs=require(_0xad17('0x3'));var fs=require('fs');var Redis=require(_0xad17('0x4'));var db=require(_0xad17('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xad17('0x6'))(_0xad17('0x7'));var config=require(_0xad17('0x8'));var jayson=require(_0xad17('0x9'));var client=jayson['client'][_0xad17('0xa')]({'port':0x232a});config[_0xad17('0xb')]=_[_0xad17('0xc')](config[_0xad17('0xb')],{'host':_0xad17('0xd'),'port':0x18eb});var socket=require(_0xad17('0xe'))(new Redis(config[_0xad17('0xb')]));require(_0xad17('0xf'))['register'](socket);function respondWithRpcPromise(_0x20d13c,_0x5abbfd,_0xdce258){return new BPromise(function(_0x10755c,_0x2dba04){return client[_0xad17('0x10')](_0x20d13c,_0xdce258)[_0xad17('0x11')](function(_0x31f695){logger['info'](_0xad17('0x12'),_0x5abbfd,'request\x20sent');logger['debug'](_0xad17('0x13'),_0x5abbfd,'request\x20sent',JSON[_0xad17('0x14')](_0x31f695));if(_0x31f695[_0xad17('0x15')]){if(_0x31f695[_0xad17('0x15')][_0xad17('0x16')]===0x1f4){logger[_0xad17('0x15')](_0xad17('0x12'),_0x5abbfd,_0x31f695[_0xad17('0x15')][_0xad17('0x17')]);return _0x2dba04(_0x31f695['error']['message']);}logger[_0xad17('0x15')](_0xad17('0x12'),_0x5abbfd,_0x31f695[_0xad17('0x15')]['message']);return _0x10755c(_0x31f695[_0xad17('0x15')][_0xad17('0x17')]);}else{logger[_0xad17('0x18')](_0xad17('0x12'),_0x5abbfd,_0xad17('0x19'));_0x10755c(_0x31f695[_0xad17('0x1a')][_0xad17('0x17')]);}})[_0xad17('0x1b')](function(_0xfa24d3){logger[_0xad17('0x15')](_0xad17('0x12'),_0x5abbfd,_0xfa24d3);_0x2dba04(_0xfa24d3);});});}exports[_0xad17('0x1c')]=function(_0x285487){var _0x195f93=this;return new Promise(function(_0x17e1cf,_0x1c6a13){return db['ChatInteraction'][_0xad17('0x1d')](_0x285487['body'],{'raw':_0x285487[_0xad17('0x1e')]?_0x285487[_0xad17('0x1e')][_0xad17('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x285487[_0xad17('0x1e')]?_0x285487['options'][_0xad17('0x20')]||null:null,'attributes':_0x285487[_0xad17('0x1e')]?_0x285487[_0xad17('0x1e')][_0xad17('0x21')]||null:null,'limit':_0x285487[_0xad17('0x1e')]?_0x285487['options'][_0xad17('0x22')]||null:null})[_0xad17('0x11')](function(_0x155046){logger['info'](_0xad17('0x1c'),_0x285487);logger['debug'](_0xad17('0x1c'),_0x285487,JSON[_0xad17('0x14')](_0x155046));_0x17e1cf(_0x155046);})[_0xad17('0x1b')](function(_0x5b7096){logger[_0xad17('0x15')]('UpdateChatInteraction',_0x5b7096[_0xad17('0x17')],_0x285487);_0x1c6a13(_0x195f93[_0xad17('0x15')](0x1f4,_0x5b7096['message']));});});};exports[_0xad17('0x23')]=function(_0xbfa9ea){return new Promise(function(_0x512250,_0x22e7d9){return db[_0xad17('0x24')][_0xad17('0x25')]({'where':_0xbfa9ea['options']?_0xbfa9ea[_0xad17('0x1e')][_0xad17('0x20')]||null:null})[_0xad17('0x11')](function(_0x381dc0){if(_0x381dc0){return _0x381dc0[_0xad17('0x26')](_0xbfa9ea[_0xad17('0x27')][_0xad17('0x28')],_['omit'](_0xbfa9ea[_0xad17('0x27')],[_0xad17('0x28'),'id'])||{});}})[_0xad17('0x29')](function(_0x413e16){logger[_0xad17('0x18')](_0xad17('0x2a'),_0xbfa9ea);logger[_0xad17('0x2b')](_0xad17('0x2a'),_0xbfa9ea,JSON['stringify'](_0x413e16));_0x512250(_0x413e16);})[_0xad17('0x1b')](function(_0x5439ff){logger[_0xad17('0x15')](_0xad17('0x2a'),_0x5439ff[_0xad17('0x17')],_0xbfa9ea);_0x22e7d9(_this[_0xad17('0x15')](0x1f4,_0x5439ff['message']));});});}; \ No newline at end of file +var _0x0009=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','ChatInteraction','raw','options','where','attributes','limit','UpdateChatInteraction','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','body','spread','AddTags','lodash','util','bluebird','randomstring','ioredis'];(function(_0x4d1f8e,_0x1c9026){var _0x5020d7=function(_0x327227){while(--_0x327227){_0x4d1f8e['push'](_0x4d1f8e['shift']());}};_0x5020d7(++_0x1c9026);}(_0x0009,0x121));var _0x9000=function(_0x5706fb,_0xacfe3c){_0x5706fb=_0x5706fb-0x0;var _0x21799d=_0x0009[_0x5706fb];return _0x21799d;};'use strict';var _=require(_0x9000('0x0'));var util=require(_0x9000('0x1'));var moment=require('moment');var BPromise=require(_0x9000('0x2'));var rs=require(_0x9000('0x3'));var fs=require('fs');var Redis=require(_0x9000('0x4'));var db=require(_0x9000('0x5'))['db'];var utils=require(_0x9000('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9000('0x7'));var jayson=require(_0x9000('0x8'));var client=jayson[_0x9000('0x9')]['http']({'port':0x232a});config[_0x9000('0xa')]=_['defaults'](config[_0x9000('0xa')],{'host':_0x9000('0xb'),'port':0x18eb});var socket=require(_0x9000('0xc'))(new Redis(config[_0x9000('0xa')]));require(_0x9000('0xd'))['register'](socket);function respondWithRpcPromise(_0x49863d,_0x2addf9,_0x4952ec){return new BPromise(function(_0x4b9705,_0x20f63e){return client[_0x9000('0xe')](_0x49863d,_0x4952ec)[_0x9000('0xf')](function(_0x4caee6){logger[_0x9000('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x2addf9,_0x9000('0x11'));logger[_0x9000('0x12')](_0x9000('0x13'),_0x2addf9,_0x9000('0x11'),JSON['stringify'](_0x4caee6));if(_0x4caee6[_0x9000('0x14')]){if(_0x4caee6[_0x9000('0x14')][_0x9000('0x15')]===0x1f4){logger[_0x9000('0x14')](_0x9000('0x16'),_0x2addf9,_0x4caee6[_0x9000('0x14')][_0x9000('0x17')]);return _0x20f63e(_0x4caee6[_0x9000('0x14')][_0x9000('0x17')]);}logger[_0x9000('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2addf9,_0x4caee6[_0x9000('0x14')][_0x9000('0x17')]);return _0x4b9705(_0x4caee6['error'][_0x9000('0x17')]);}else{logger[_0x9000('0x10')](_0x9000('0x16'),_0x2addf9,'request\x20sent');_0x4b9705(_0x4caee6[_0x9000('0x18')][_0x9000('0x17')]);}})[_0x9000('0x19')](function(_0x333259){logger['error'](_0x9000('0x16'),_0x2addf9,_0x333259);_0x20f63e(_0x333259);});});}exports['UpdateChatInteraction']=function(_0x2833f4){var _0x5b393c=this;return new Promise(function(_0x2d9d27,_0xd7afcd){return db[_0x9000('0x1a')]['update'](_0x2833f4['body'],{'raw':_0x2833f4['options']?_0x2833f4['options'][_0x9000('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2833f4[_0x9000('0x1c')]?_0x2833f4[_0x9000('0x1c')][_0x9000('0x1d')]||null:null,'attributes':_0x2833f4[_0x9000('0x1c')]?_0x2833f4[_0x9000('0x1c')][_0x9000('0x1e')]||null:null,'limit':_0x2833f4[_0x9000('0x1c')]?_0x2833f4[_0x9000('0x1c')][_0x9000('0x1f')]||null:null})[_0x9000('0xf')](function(_0x50b295){logger[_0x9000('0x10')](_0x9000('0x20'),_0x2833f4);logger['debug'](_0x9000('0x20'),_0x2833f4,JSON[_0x9000('0x21')](_0x50b295));_0x2d9d27(_0x50b295);})['catch'](function(_0x5cbeed){logger[_0x9000('0x14')](_0x9000('0x20'),_0x5cbeed['message'],_0x2833f4);_0xd7afcd(_0x5b393c[_0x9000('0x14')](0x1f4,_0x5cbeed[_0x9000('0x17')]));});});};exports[_0x9000('0x22')]=function(_0x442214){return new Promise(function(_0x298488,_0x16c8fa){return db['ChatInteraction'][_0x9000('0x23')]({'where':_0x442214[_0x9000('0x1c')]?_0x442214[_0x9000('0x1c')][_0x9000('0x1d')]||null:null})[_0x9000('0xf')](function(_0x9a2999){if(_0x9a2999){return _0x9a2999[_0x9000('0x24')](_0x442214['body'][_0x9000('0x25')],_[_0x9000('0x26')](_0x442214[_0x9000('0x27')],[_0x9000('0x25'),'id'])||{});}})[_0x9000('0x28')](function(_0x2e2334){logger[_0x9000('0x10')](_0x9000('0x29'),_0x442214);logger['debug'](_0x9000('0x29'),_0x442214,JSON['stringify'](_0x2e2334));_0x298488(_0x2e2334);})[_0x9000('0x19')](function(_0x36f10e){logger[_0x9000('0x14')](_0x9000('0x29'),_0x36f10e[_0x9000('0x17')],_0x442214);_0x16c8fa(_this[_0x9000('0x14')](0x1f4,_0x36f10e[_0x9000('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 9b937b7..403551e 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 _0x4d39=['save','update','emit','removeListener','register','length','chatInteraction:'];(function(_0x29cb3f,_0x3386cf){var _0x4b90b9=function(_0x20e0f3){while(--_0x20e0f3){_0x29cb3f['push'](_0x29cb3f['shift']());}};_0x4b90b9(++_0x3386cf);}(_0x4d39,0x18f));var _0x94d3=function(_0xcad83b,_0x1bbb16){_0xcad83b=_0xcad83b-0x0;var _0x15fe13=_0x4d39[_0xcad83b];return _0x15fe13;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x94d3('0x0'),'remove',_0x94d3('0x1')];function createListener(_0x3e46e4,_0x4626f7){return function(_0x3311ee){_0x4626f7[_0x94d3('0x2')](_0x3e46e4,_0x3311ee);};}function removeListener(_0x388891,_0x29ac3d){return function(){ChatInteractionEvents[_0x94d3('0x3')](_0x388891,_0x29ac3d);};}exports[_0x94d3('0x4')]=function(_0x227559){for(var _0x454327=0x0,_0x5768bd=events[_0x94d3('0x5')];_0x454327<_0x5768bd;_0x454327++){var _0x1f4dff=events[_0x454327];var _0x847975=createListener(_0x94d3('0x6')+_0x1f4dff,_0x227559);ChatInteractionEvents['on'](_0x1f4dff,_0x847975);}}; \ No newline at end of file +var _0x8873=['emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x462545,_0x3c0f1b){var _0x680d51=function(_0x22727b){while(--_0x22727b){_0x462545['push'](_0x462545['shift']());}};_0x680d51(++_0x3c0f1b);}(_0x8873,0xad));var _0x3887=function(_0x2e0ffa,_0x451f12){_0x2e0ffa=_0x2e0ffa-0x0;var _0x24d627=_0x8873[_0x2e0ffa];return _0x24d627;};'use strict';var ChatInteractionEvents=require(_0x3887('0x0'));var events=[_0x3887('0x1'),_0x3887('0x2'),'update'];function createListener(_0x24558e,_0x3dd931){return function(_0x1ce9b5){_0x3dd931[_0x3887('0x3')](_0x24558e,_0x1ce9b5);};}function removeListener(_0x5b4e43,_0x203e5d){return function(){ChatInteractionEvents[_0x3887('0x4')](_0x5b4e43,_0x203e5d);};}exports[_0x3887('0x5')]=function(_0x3eb246){for(var _0x5358ef=0x0,_0x5c651f=events[_0x3887('0x6')];_0x5358ef<_0x5c651f;_0x5358ef++){var _0x4a46ff=events[_0x5358ef];var _0x42e810=createListener(_0x3887('0x7')+_0x4a46ff,_0x3eb246);ChatInteractionEvents['on'](_0x4a46ff,_0x42e810);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 155331d..e9d22c5 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 _0x38e0=['/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','root','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','/:id','isChatInteractionAuthorized','show'];(function(_0x548467,_0x5ef1f2){var _0x53c1b0=function(_0x38644a){while(--_0x38644a){_0x548467['push'](_0x548467['shift']());}};_0x53c1b0(++_0x5ef1f2);}(_0x38e0,0xb5));var _0x038e=function(_0x4f02e,_0x4ac328){_0x4f02e=_0x4f02e-0x0;var _0x5a09cd=_0x38e0[_0x4f02e];return _0x5a09cd;};'use strict';var multer=require(_0x038e('0x0'));var util=require(_0x038e('0x1'));var path=require(_0x038e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x038e('0x3')]();var fs_extra=require(_0x038e('0x4'));var auth=require(_0x038e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x038e('0x6'));var controller=require(_0x038e('0x7'));router['get']('/',auth[_0x038e('0x8')](),controller[_0x038e('0x9')]);router[_0x038e('0xa')](_0x038e('0xb'),auth[_0x038e('0x8')](),controller['describe']);router[_0x038e('0xa')](_0x038e('0xc'),auth[_0x038e('0xd')](),controller[_0x038e('0xe')]);router['get'](_0x038e('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x038e('0x10')]);router[_0x038e('0xa')](_0x038e('0x11'),auth['isAuthenticated'](),controller[_0x038e('0x12')]);router[_0x038e('0xa')](_0x038e('0x13'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get'](_0x038e('0x14'),auth[_0x038e('0x8')](),controller[_0x038e('0x15')]);router[_0x038e('0x16')]('/',auth[_0x038e('0x8')](),controller['create']);router[_0x038e('0x16')](_0x038e('0x17'),auth[_0x038e('0x8')](),controller[_0x038e('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x49d547,_0x307d6f,_0xbd8e38){_0xbd8e38(null,path['join'](config[_0x038e('0x19')],_0x038e('0x1a')));},'filename':function(_0x347fb8,_0x389e8e,_0x3ad64f){_0x3ad64f(null,util[_0x038e('0x1b')](_0x038e('0x1c'),Date['now'](),_0x389e8e[_0x038e('0x1d')][_0x038e('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x038e('0x1f'),upload[_0x038e('0x20')]('file'),controller[_0x038e('0x21')]);router[_0x038e('0x16')](_0x038e('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x038e('0x22')]);router[_0x038e('0x16')](_0x038e('0x23'),auth['isAuthenticated'](),interaction[_0x038e('0x24')](_0x038e('0x25'),'chatinteraction:addtags'),controller[_0x038e('0x26')]);router[_0x038e('0x27')](_0x038e('0xc'),auth[_0x038e('0x8')](),interaction['tracked'](_0x038e('0x25'),_0x038e('0x28')),controller[_0x038e('0x29')]);router[_0x038e('0x27')]('/:id/custom_update',controller[_0x038e('0x2a')]);router[_0x038e('0x27')](_0x038e('0x2b'),auth[_0x038e('0xd')](),controller[_0x038e('0x2c')]);router[_0x038e('0x27')]('/:id/close',controller['close']);router[_0x038e('0x2d')](_0x038e('0xc'),auth[_0x038e('0x8')](),interaction[_0x038e('0x24')](_0x038e('0x25'),_0x038e('0x2e')),controller[_0x038e('0x2f')]);router[_0x038e('0x2d')](_0x038e('0x23'),auth[_0x038e('0x8')](),controller[_0x038e('0x30')]);module['exports']=router; \ No newline at end of file +var _0x075d=['attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','format','%s-%s','now','originalname','replace'];(function(_0x5ced7d,_0x20ce01){var _0x5ceaa6=function(_0xdc898f){while(--_0xdc898f){_0x5ced7d['push'](_0x5ced7d['shift']());}};_0x5ceaa6(++_0x20ce01);}(_0x075d,0xf8));var _0xd075=function(_0x20763f,_0x95bba){_0x20763f=_0x20763f-0x0;var _0x5462a3=_0x075d[_0x20763f];return _0x5462a3;};'use strict';var multer=require(_0xd075('0x0'));var util=require(_0xd075('0x1'));var path=require(_0xd075('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd075('0x3')]();var fs_extra=require(_0xd075('0x4'));var auth=require(_0xd075('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd075('0x6'));var controller=require('./chatInteraction.controller');router[_0xd075('0x7')]('/',auth[_0xd075('0x8')](),controller[_0xd075('0x9')]);router['get'](_0xd075('0xa'),auth[_0xd075('0x8')](),controller[_0xd075('0xb')]);router[_0xd075('0x7')]('/:id',auth[_0xd075('0xc')](),controller[_0xd075('0xd')]);router[_0xd075('0x7')](_0xd075('0xe'),auth[_0xd075('0xc')](),controller['attachmentDownload']);router[_0xd075('0x7')]('/:id/messages',auth[_0xd075('0x8')](),controller['getMessages']);router['get'](_0xd075('0xf'),auth[_0xd075('0xc')](),controller[_0xd075('0x10')]);router[_0xd075('0x7')](_0xd075('0x11'),auth[_0xd075('0x8')](),controller[_0xd075('0x12')]);router[_0xd075('0x13')]('/',auth[_0xd075('0x8')](),controller[_0xd075('0x14')]);router[_0xd075('0x13')]('/:id/vidaoo',auth[_0xd075('0x8')](),controller[_0xd075('0x15')]);var upload=multer({'storage':multer[_0xd075('0x16')]({'destination':function(_0x3c3c84,_0x1dd101,_0x40c45d){_0x40c45d(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x2e0d91,_0x22ef12,_0x1e1831){_0x1e1831(null,util[_0xd075('0x17')](_0xd075('0x18'),Date[_0xd075('0x19')](),_0x22ef12[_0xd075('0x1a')][_0xd075('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd075('0x13')]('/:id/attachment_upload',upload['single']('file'),controller[_0xd075('0x1c')]);router['post'](_0xd075('0x1d'),auth[_0xd075('0xc')](),controller[_0xd075('0x1e')]);router[_0xd075('0x13')]('/:id/tags',auth[_0xd075('0x8')](),interaction[_0xd075('0x1f')](_0xd075('0x20'),_0xd075('0x21')),controller['addTags']);router[_0xd075('0x22')]('/:id',auth[_0xd075('0x8')](),interaction[_0xd075('0x1f')]('chat',_0xd075('0x23')),controller['update']);router['put'](_0xd075('0x24'),controller[_0xd075('0x25')]);router[_0xd075('0x22')](_0xd075('0x26'),auth['isChatInteractionAuthorized'](),controller[_0xd075('0x27')]);router[_0xd075('0x22')](_0xd075('0x28'),controller['close']);router['delete']('/:id',auth[_0xd075('0x8')](),interaction['tracked']('chat',_0xd075('0x29')),controller[_0xd075('0x2a')]);router[_0xd075('0x2b')]('/:id/tags',auth['isAuthenticated'](),controller[_0xd075('0x2c')]);module[_0xd075('0x2d')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index ed19a6f..f8dc066 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 _0x07d6=['INTEGER','exports','TEXT'];(function(_0x195223,_0x121404){var _0x3a62dd=function(_0x3adeda){while(--_0x3adeda){_0x195223['push'](_0x195223['shift']());}};_0x3a62dd(++_0x121404);}(_0x07d6,0x1f0));var _0x607d=function(_0x456f08,_0x150572){_0x456f08=_0x456f08-0x0;var _0x4a10bc=_0x07d6[_0x456f08];return _0x4a10bc;};'use strict';var Sequelize=require('sequelize');module[_0x607d('0x0')]={'body':{'type':Sequelize[_0x607d('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x607d('0x2')]}}; \ No newline at end of file +var _0x41c6=['sequelize','TEXT','INTEGER'];(function(_0x4332a5,_0xa5b7f5){var _0x41d367=function(_0xff6d4c){while(--_0xff6d4c){_0x4332a5['push'](_0x4332a5['shift']());}};_0x41d367(++_0xa5b7f5);}(_0x41c6,0x87));var _0x641c=function(_0x599d26,_0x48ef3f){_0x599d26=_0x599d26-0x0;var _0x2ebcfc=_0x41c6[_0x599d26];return _0x2ebcfc;};'use strict';var Sequelize=require(_0x641c('0x0'));module['exports']={'body':{'type':Sequelize[_0x641c('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x641c('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 05f73e1..e6225bc 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 _0xd89d=['length','find','create','update','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','User','findAll','agent','admin','fullname','role','internal','online','lastLoginAt','-online','VoiceQueue','VoiceQueues','user','UserProfileSection','Agents','userProfileId','UserProfileResource','resourceId','push','FromId','ToId','read','-createdAt','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./chatInternalMessage.socket','register','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','ChatInternalMessage','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','includeAll','include','catch','show','params','keys'];(function(_0x2920dd,_0x19d049){var _0x5d4e52=function(_0x46c751){while(--_0x46c751){_0x2920dd['push'](_0x2920dd['shift']());}};_0x5d4e52(++_0x19d049);}(_0xd89d,0x1c3));var _0xdd89=function(_0xbb3efa,_0x43ae72){_0xbb3efa=_0xbb3efa-0x0;var _0x281171=_0xd89d[_0xbb3efa];return _0x281171;};'use strict';var emlformat=require(_0xdd89('0x0'));var rimraf=require(_0xdd89('0x1'));var zipdir=require(_0xdd89('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd89('0x3'));var moment=require(_0xdd89('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdd89('0x5'));var util=require(_0xdd89('0x6'));var path=require('path');var sox=require(_0xdd89('0x7'));var csv=require(_0xdd89('0x8'));var ejs=require(_0xdd89('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd89('0xa'));var squel=require(_0xdd89('0xb'));var crypto=require(_0xdd89('0xc'));var jsforce=require(_0xdd89('0xd'));var deskjs=require(_0xdd89('0xe'));var toCsv=require(_0xdd89('0x8'));var querystring=require(_0xdd89('0xf'));var Papa=require('papaparse');var Redis=require(_0xdd89('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdd89('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd89('0x12'))('api');var utils=require(_0xdd89('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xdd89('0x14'));var db=require(_0xdd89('0x15'))['db'];config[_0xdd89('0x16')]=_[_0xdd89('0x17')](config[_0xdd89('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdd89('0x18'))[_0xdd89('0x19')](socket);function respondWithStatusCode(_0x22b0e4,_0x37e9cd){_0x37e9cd=_0x37e9cd||0xcc;return function(_0x2c3643){if(_0x2c3643){return _0x22b0e4['sendStatus'](_0x37e9cd);}return _0x22b0e4['status'](_0x37e9cd)[_0xdd89('0x1a')]();};}function respondWithResult(_0x4e728f,_0x32cce8){_0x32cce8=_0x32cce8||0xc8;return function(_0x51107d){if(_0x51107d){return _0x4e728f['status'](_0x32cce8)[_0xdd89('0x1b')](_0x51107d);}};}function respondWithFilteredResult(_0x31b242,_0x4af1e4){return function(_0x191999){if(_0x191999){var _0x2b9d56=typeof _0x4af1e4[_0xdd89('0x1c')]==='undefined'&&typeof _0x4af1e4[_0xdd89('0x1d')]===_0xdd89('0x1e');var _0x458915=_0x191999[_0xdd89('0x1f')];var _0x447a7a=_0x2b9d56?0x0:_0x4af1e4[_0xdd89('0x1c')];var _0x2bd687=_0x2b9d56?_0x191999[_0xdd89('0x1f')]:_0x4af1e4[_0xdd89('0x1c')]+_0x4af1e4[_0xdd89('0x1d')];var _0x2219d3;if(_0x2bd687>=_0x458915){_0x2bd687=_0x458915;_0x2219d3=0xc8;}else{_0x2219d3=0xce;}_0x31b242[_0xdd89('0x20')](_0x2219d3);return _0x31b242[_0xdd89('0x21')](_0xdd89('0x22'),_0x447a7a+'-'+_0x2bd687+'/'+_0x458915)['json'](_0x191999);}return null;};}function patchUpdates(_0x49f157){return function(_0x1654ec){try{jsonpatch[_0xdd89('0x23')](_0x1654ec,_0x49f157,!![]);}catch(_0x25f342){return BPromise[_0xdd89('0x24')](_0x25f342);}return _0x1654ec[_0xdd89('0x25')]();};}function saveUpdates(_0xe8c91d,_0x41a761){return function(_0x35914f){if(_0x35914f){return _0x35914f['update'](_0xe8c91d)[_0xdd89('0x26')](function(_0x1f78e6){return _0x1f78e6;});}return null;};}function removeEntity(_0x5d2601,_0x3989d1){return function(_0x4f466f){if(_0x4f466f){return _0x4f466f[_0xdd89('0x27')]()[_0xdd89('0x26')](function(){_0x5d2601['status'](0xcc)[_0xdd89('0x1a')]();});}};}function handleEntityNotFound(_0xba0ad6,_0x2b0825){return function(_0x349c98){if(!_0x349c98){_0xba0ad6[_0xdd89('0x28')](0x194);}return _0x349c98;};}function handleError(_0x26e589,_0xd66b3a){_0xd66b3a=_0xd66b3a||0x1f4;return function(_0x13d5e2){logger[_0xdd89('0x29')](_0x13d5e2['stack']);if(_0x13d5e2[_0xdd89('0x2a')]){delete _0x13d5e2['name'];}_0x26e589[_0xdd89('0x20')](_0xd66b3a)[_0xdd89('0x2b')](_0x13d5e2);};}exports[_0xdd89('0x2c')]=function(_0x4a8ae2,_0x32b1f3){var _0x4fba07={},_0x17362c={},_0x3067b2={'count':0x0,'rows':[]};var _0x3199f8=_['map'](db[_0xdd89('0x2d')]['rawAttributes'],function(_0x18502f){return{'name':_0x18502f[_0xdd89('0x2e')],'type':_0x18502f[_0xdd89('0x2f')][_0xdd89('0x30')]};});_0x17362c[_0xdd89('0x31')]=_[_0xdd89('0x32')](_0x3199f8,'name');_0x17362c[_0xdd89('0x33')]=_['keys'](_0x4a8ae2[_0xdd89('0x33')]);_0x17362c[_0xdd89('0x34')]=_[_0xdd89('0x35')](_0x17362c[_0xdd89('0x31')],_0x17362c[_0xdd89('0x33')]);_0x4fba07['attributes']=_[_0xdd89('0x35')](_0x17362c[_0xdd89('0x31')],qs[_0xdd89('0x36')](_0x4a8ae2[_0xdd89('0x33')][_0xdd89('0x36')]));_0x4fba07[_0xdd89('0x37')]=_0x4fba07[_0xdd89('0x37')]['length']?_0x4fba07['attributes']:_0x17362c[_0xdd89('0x31')];if(!_0x4a8ae2[_0xdd89('0x33')][_0xdd89('0x38')](_0xdd89('0x39'))){_0x4fba07[_0xdd89('0x1d')]=qs[_0xdd89('0x1d')](_0x4a8ae2[_0xdd89('0x33')][_0xdd89('0x1d')]);_0x4fba07[_0xdd89('0x1c')]=qs[_0xdd89('0x1c')](_0x4a8ae2['query'][_0xdd89('0x1c')]);}_0x4fba07['order']=qs['sort'](_0x4a8ae2['query'][_0xdd89('0x3a')]);_0x4fba07[_0xdd89('0x3b')]=qs['filters'](_[_0xdd89('0x3c')](_0x4a8ae2['query'],_0x17362c[_0xdd89('0x34')]),_0x3199f8);if(_0x4a8ae2['query']['filter']){_0x4fba07[_0xdd89('0x3b')]=_[_0xdd89('0x3d')](_0x4fba07[_0xdd89('0x3b')],{'$or':_[_0xdd89('0x32')](_0x3199f8,function(_0x655ee3){if(_0x655ee3[_0xdd89('0x2f')]!==_0xdd89('0x3e')){var _0x1511a6={};_0x1511a6[_0x655ee3[_0xdd89('0x2a')]]={'$like':'%'+_0x4a8ae2[_0xdd89('0x33')]['filter']+'%'};return _0x1511a6;}})});}_0x4fba07=_['merge']({},_0x4fba07,_0x4a8ae2['options']);var _0x3b1ad0={'where':_0x4fba07[_0xdd89('0x3b')]};return db[_0xdd89('0x2d')]['count'](_0x3b1ad0)[_0xdd89('0x26')](function(_0x2b37db){_0x3067b2[_0xdd89('0x1f')]=_0x2b37db;if(_0x4a8ae2[_0xdd89('0x33')][_0xdd89('0x3f')]){_0x4fba07[_0xdd89('0x40')]=[{'all':!![]}];}return db[_0xdd89('0x2d')]['findAll'](_0x4fba07);})['then'](function(_0x131500){_0x3067b2['rows']=_0x131500;return _0x3067b2;})[_0xdd89('0x26')](respondWithFilteredResult(_0x32b1f3,_0x4fba07))[_0xdd89('0x41')](handleError(_0x32b1f3,null));};exports[_0xdd89('0x42')]=function(_0x170bf6,_0x18ed0b){var _0xb8911={'raw':!![],'where':{'id':_0x170bf6[_0xdd89('0x43')]['id']}},_0x5a5a92={};_0x5a5a92[_0xdd89('0x31')]=_[_0xdd89('0x44')](db[_0xdd89('0x2d')]['rawAttributes']);_0x5a5a92[_0xdd89('0x33')]=_[_0xdd89('0x44')](_0x170bf6[_0xdd89('0x33')]);_0x5a5a92['filters']=_['intersection'](_0x5a5a92[_0xdd89('0x31')],_0x5a5a92[_0xdd89('0x33')]);_0xb8911[_0xdd89('0x37')]=_[_0xdd89('0x35')](_0x5a5a92[_0xdd89('0x31')],qs[_0xdd89('0x36')](_0x170bf6[_0xdd89('0x33')][_0xdd89('0x36')]));_0xb8911[_0xdd89('0x37')]=_0xb8911[_0xdd89('0x37')][_0xdd89('0x45')]?_0xb8911[_0xdd89('0x37')]:_0x5a5a92[_0xdd89('0x31')];if(_0x170bf6[_0xdd89('0x33')][_0xdd89('0x3f')]){_0xb8911[_0xdd89('0x40')]=[{'all':!![]}];}_0xb8911=_[_0xdd89('0x3d')]({},_0xb8911,_0x170bf6['options']);return db[_0xdd89('0x2d')][_0xdd89('0x46')](_0xb8911)[_0xdd89('0x26')](handleEntityNotFound(_0x18ed0b,null))[_0xdd89('0x26')](respondWithResult(_0x18ed0b,null))['catch'](handleError(_0x18ed0b,null));};exports[_0xdd89('0x47')]=function(_0x54edef,_0x2f53eb){return db[_0xdd89('0x2d')]['create'](_0x54edef['body'],{})['then'](respondWithResult(_0x2f53eb,0xc9))[_0xdd89('0x41')](handleError(_0x2f53eb,null));};exports[_0xdd89('0x48')]=function(_0x2686cf,_0x203164){if(_0x2686cf[_0xdd89('0x49')]['id']){delete _0x2686cf[_0xdd89('0x49')]['id'];}return db[_0xdd89('0x2d')][_0xdd89('0x46')]({'where':{'id':_0x2686cf[_0xdd89('0x43')]['id']}})['then'](handleEntityNotFound(_0x203164,null))[_0xdd89('0x26')](saveUpdates(_0x2686cf[_0xdd89('0x49')],null))[_0xdd89('0x26')](respondWithResult(_0x203164,null))['catch'](handleError(_0x203164,null));};exports[_0xdd89('0x27')]=function(_0x1c427c,_0x3b05ed){return db[_0xdd89('0x2d')]['find']({'where':{'id':_0x1c427c[_0xdd89('0x43')]['id']}})[_0xdd89('0x26')](handleEntityNotFound(_0x3b05ed,null))['then'](removeEntity(_0x3b05ed,null))['catch'](handleError(_0x3b05ed,null));};exports[_0xdd89('0x4a')]=function(_0x34b8cb,_0x2b0507){return db[_0xdd89('0x2d')]['describe']()[_0xdd89('0x26')](respondWithResult(_0x2b0507,null))[_0xdd89('0x41')](handleError(_0x2b0507,null));};function wrapUser(_0x4ed577){return function(_0xdc3386){var _0x28f2c8=_0x4ed577[_0xdd89('0x4b')]({'plain':!![]});_0x28f2c8[_0xdd89('0x4c')]=[];if(_0xdc3386){_0x28f2c8[_0xdd89('0x4d')]=_0xdc3386[_0xdd89('0x4e')];_0x28f2c8[_0xdd89('0x4f')]=_0xdc3386;}else{_0x28f2c8[_0xdd89('0x4d')]=moment(0x0)['format'](_0xdd89('0x50'));_0x28f2c8[_0xdd89('0x4f')]={};}return _0x28f2c8;};}exports['getUsers']=function(_0x63b24c,_0x441f71,_0x4f52a0){var _0x4fd363=[];return db[_0xdd89('0x51')][_0xdd89('0x52')]({'where':{'role':[_0xdd89('0x53'),_0xdd89('0x54'),'user']},'attributes':['id',_0xdd89('0x55'),'name',_0xdd89('0x56'),'userpic',_0xdd89('0x57'),_0xdd89('0x58'),_0xdd89('0x59'),'allowmessenger','showWebBar'],'order':qs['sort'](_0xdd89('0x5a')),'include':[{'model':db[_0xdd89('0x5b')],'as':_0xdd89('0x5c'),'attributes':['id','name',_0xdd89('0x2f')],'through':{'attributes':[]}}]})['then'](function(_0x51fad6){if(_0x51fad6){var _0x2d2b7d=_0x63b24c[_0xdd89('0x5d')][_0xdd89('0x4b')]({'plain':!![]});if(!_0x2d2b7d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d2b7d['role']==='user'){return db[_0xdd89('0x5e')][_0xdd89('0x46')]({'where':{'name':_0xdd89('0x5f'),'userProfileId':_0x2d2b7d[_0xdd89('0x60')]},'raw':!![]})[_0xdd89('0x26')](function(_0x11cc89){if(_0x11cc89){if(_0x11cc89['autoAssociation']===0x0){return db[_0xdd89('0x61')][_0xdd89('0x52')]({'where':{'sectionId':_0x11cc89['id']},'raw':!![]})[_0xdd89('0x26')](function(_0x27cd8e){var _0x4a8df1=[];if(_['isEmpty'](_0x27cd8e)){_0x4a8df1=_['filter'](_0x51fad6,function(_0x84eeda){if(_0x84eeda[_0xdd89('0x56')]!==_0xdd89('0x53')){return _0x84eeda;}});return _0x4a8df1;}else{for(var _0x4e1daa=0x0;_0x4e1daa<_0x51fad6[_0xdd89('0x45')];_0x4e1daa++){var _0x512672=_0x51fad6[_0x4e1daa];if(_0x512672[_0xdd89('0x56')]===_0xdd89('0x53')){var _0x473c13=_[_0xdd89('0x46')](_0x27cd8e,function(_0x18a072){return _0x18a072[_0xdd89('0x62')]===_0x512672['id'];});if(_0x473c13)_0x4a8df1[_0xdd89('0x63')](_0x512672);}else{_0x4a8df1['push'](_0x512672);}}return _0x4a8df1;}});}else{return _0x51fad6;}}else{var _0x3a1d0c=_['filter'](_0x51fad6,function(_0x400da9){if(_0x400da9[_0xdd89('0x56')]!=='agent'){return _0x400da9;}});return _0x3a1d0c;}});}else{return _0x51fad6;}}})[_0xdd89('0x26')](function(_0x1680bb){var _0x400b39=[];if(_0x1680bb){_0x4fd363=_0x1680bb;for(var _0x127652=0x0;_0x127652<_0x1680bb[_0xdd89('0x45')];_0x127652+=0x1){_0x4fd363[_0x127652][_0xdd89('0x4c')]=[];_0x400b39[_0xdd89('0x63')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x63b24c[_0xdd89('0x5d')]['id'],_0x1680bb[_0x127652]['id']],'ToId':[_0x63b24c[_0xdd89('0x5d')]['id'],_0x1680bb[_0x127652]['id']],'ChatGroupId':null},'attributes':['id',_0xdd89('0x4e'),_0xdd89('0x64'),_0xdd89('0x65'),_0xdd89('0x66'),_0xdd89('0x49')],'order':qs[_0xdd89('0x3a')](_0xdd89('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x1680bb[_0x127652])));}return BPromise['all'](_0x400b39);}return[];})['then'](function(_0x39618f){return{'rows':_0x39618f,'count':_0x39618f[_0xdd89('0x45')]};})[_0xdd89('0x26')](respondWithResult(_0x441f71,null))['catch'](handleError(_0x441f71,null));}; \ No newline at end of file +var _0x2377=['include','findAll','rows','show','keys','fields','includeAll','find','catch','create','body','describe','get','messages','lastMessageAt','lastMessage','format','agent','user','fullname','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','role','Agents','userProfileId','autoAssociation','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','ChatInternalMessage'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x2377,0x93));var _0x7237=function(_0x4d8d65,_0x22a6bd){_0x4d8d65=_0x4d8d65-0x0;var _0x26c8b2=_0x2377[_0x4d8d65];return _0x26c8b2;};'use strict';var emlformat=require(_0x7237('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7237('0x1'));var jsonpatch=require(_0x7237('0x2'));var rp=require(_0x7237('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7237('0x4'));var util=require(_0x7237('0x5'));var path=require(_0x7237('0x6'));var sox=require(_0x7237('0x7'));var csv=require('to-csv');var ejs=require(_0x7237('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7237('0x9'));var squel=require(_0x7237('0xa'));var crypto=require(_0x7237('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7237('0xc'));var querystring=require(_0x7237('0xd'));var Papa=require(_0x7237('0xe'));var Redis=require(_0x7237('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7237('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7237('0x11'));var utils=require(_0x7237('0x12'));var config=require(_0x7237('0x13'));var licenseUtil=require(_0x7237('0x14'));var db=require(_0x7237('0x15'))['db'];config[_0x7237('0x16')]=_[_0x7237('0x17')](config[_0x7237('0x16')],{'host':_0x7237('0x18'),'port':0x18eb});var socket=require(_0x7237('0x19'))(new Redis(config[_0x7237('0x16')]));require('./chatInternalMessage.socket')[_0x7237('0x1a')](socket);function respondWithStatusCode(_0xcafef6,_0x168c82){_0x168c82=_0x168c82||0xcc;return function(_0x24da65){if(_0x24da65){return _0xcafef6['sendStatus'](_0x168c82);}return _0xcafef6['status'](_0x168c82)[_0x7237('0x1b')]();};}function respondWithResult(_0x3cb196,_0x3ab93e){_0x3ab93e=_0x3ab93e||0xc8;return function(_0x34878a){if(_0x34878a){return _0x3cb196[_0x7237('0x1c')](_0x3ab93e)[_0x7237('0x1d')](_0x34878a);}};}function respondWithFilteredResult(_0x52e388,_0x532f66){return function(_0x1abd2e){if(_0x1abd2e){var _0x172da1=typeof _0x532f66['offset']===_0x7237('0x1e')&&typeof _0x532f66[_0x7237('0x1f')]===_0x7237('0x1e');var _0xe7afc=_0x1abd2e[_0x7237('0x20')];var _0x4512af=_0x172da1?0x0:_0x532f66[_0x7237('0x21')];var _0x2478c3=_0x172da1?_0x1abd2e[_0x7237('0x20')]:_0x532f66[_0x7237('0x21')]+_0x532f66['limit'];var _0x2593ac;if(_0x2478c3>=_0xe7afc){_0x2478c3=_0xe7afc;_0x2593ac=0xc8;}else{_0x2593ac=0xce;}_0x52e388[_0x7237('0x1c')](_0x2593ac);return _0x52e388['set'](_0x7237('0x22'),_0x4512af+'-'+_0x2478c3+'/'+_0xe7afc)['json'](_0x1abd2e);}return null;};}function patchUpdates(_0x2e16af){return function(_0x44f9bd){try{jsonpatch['apply'](_0x44f9bd,_0x2e16af,!![]);}catch(_0xb30025){return BPromise[_0x7237('0x23')](_0xb30025);}return _0x44f9bd[_0x7237('0x24')]();};}function saveUpdates(_0x269fa8,_0x34d9f2){return function(_0x240f02){if(_0x240f02){return _0x240f02[_0x7237('0x25')](_0x269fa8)[_0x7237('0x26')](function(_0x1d6e2d){return _0x1d6e2d;});}return null;};}function removeEntity(_0x45ce73,_0x4bc4a2){return function(_0x4fc5fe){if(_0x4fc5fe){return _0x4fc5fe[_0x7237('0x27')]()[_0x7237('0x26')](function(){_0x45ce73['status'](0xcc)[_0x7237('0x1b')]();});}};}function handleEntityNotFound(_0x26b8f4,_0x3fa628){return function(_0xf903ba){if(!_0xf903ba){_0x26b8f4[_0x7237('0x28')](0x194);}return _0xf903ba;};}function handleError(_0x45f7f9,_0x528b16){_0x528b16=_0x528b16||0x1f4;return function(_0x48358a){logger['error'](_0x48358a[_0x7237('0x29')]);if(_0x48358a[_0x7237('0x2a')]){delete _0x48358a['name'];}_0x45f7f9[_0x7237('0x1c')](_0x528b16)[_0x7237('0x2b')](_0x48358a);};}exports[_0x7237('0x2c')]=function(_0x34e45b,_0x21152c){var _0x57f4ef={},_0x252a22={},_0x30bf6a={'count':0x0,'rows':[]};var _0x3f9958=_[_0x7237('0x2d')](db['ChatInternalMessage'][_0x7237('0x2e')],function(_0x3124e2){return{'name':_0x3124e2[_0x7237('0x2f')],'type':_0x3124e2[_0x7237('0x30')][_0x7237('0x31')]};});_0x252a22['model']=_[_0x7237('0x2d')](_0x3f9958,_0x7237('0x2a'));_0x252a22[_0x7237('0x32')]=_['keys'](_0x34e45b[_0x7237('0x32')]);_0x252a22[_0x7237('0x33')]=_[_0x7237('0x34')](_0x252a22['model'],_0x252a22[_0x7237('0x32')]);_0x57f4ef['attributes']=_[_0x7237('0x34')](_0x252a22[_0x7237('0x35')],qs['fields'](_0x34e45b['query']['fields']));_0x57f4ef[_0x7237('0x36')]=_0x57f4ef['attributes'][_0x7237('0x37')]?_0x57f4ef[_0x7237('0x36')]:_0x252a22[_0x7237('0x35')];if(!_0x34e45b[_0x7237('0x32')][_0x7237('0x38')](_0x7237('0x39'))){_0x57f4ef[_0x7237('0x1f')]=qs[_0x7237('0x1f')](_0x34e45b[_0x7237('0x32')]['limit']);_0x57f4ef[_0x7237('0x21')]=qs['offset'](_0x34e45b[_0x7237('0x32')][_0x7237('0x21')]);}_0x57f4ef[_0x7237('0x3a')]=qs[_0x7237('0x3b')](_0x34e45b['query'][_0x7237('0x3b')]);_0x57f4ef['where']=qs[_0x7237('0x33')](_[_0x7237('0x3c')](_0x34e45b[_0x7237('0x32')],_0x252a22[_0x7237('0x33')]),_0x3f9958);if(_0x34e45b[_0x7237('0x32')]['filter']){_0x57f4ef['where']=_[_0x7237('0x3d')](_0x57f4ef[_0x7237('0x3e')],{'$or':_[_0x7237('0x2d')](_0x3f9958,function(_0x587424){if(_0x587424[_0x7237('0x30')]!==_0x7237('0x3f')){var _0x202c13={};_0x202c13[_0x587424[_0x7237('0x2a')]]={'$like':'%'+_0x34e45b[_0x7237('0x32')][_0x7237('0x40')]+'%'};return _0x202c13;}})});}_0x57f4ef=_[_0x7237('0x3d')]({},_0x57f4ef,_0x34e45b[_0x7237('0x41')]);var _0x3065cd={'where':_0x57f4ef[_0x7237('0x3e')]};return db[_0x7237('0x42')][_0x7237('0x20')](_0x3065cd)[_0x7237('0x26')](function(_0x2c98e2){_0x30bf6a[_0x7237('0x20')]=_0x2c98e2;if(_0x34e45b[_0x7237('0x32')]['includeAll']){_0x57f4ef[_0x7237('0x43')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x7237('0x44')](_0x57f4ef);})[_0x7237('0x26')](function(_0x4b9d3f){_0x30bf6a[_0x7237('0x45')]=_0x4b9d3f;return _0x30bf6a;})['then'](respondWithFilteredResult(_0x21152c,_0x57f4ef))['catch'](handleError(_0x21152c,null));};exports[_0x7237('0x46')]=function(_0x21ab9b,_0x55666d){var _0x314da1={'raw':!![],'where':{'id':_0x21ab9b['params']['id']}},_0x159ab1={};_0x159ab1[_0x7237('0x35')]=_['keys'](db[_0x7237('0x42')][_0x7237('0x2e')]);_0x159ab1[_0x7237('0x32')]=_[_0x7237('0x47')](_0x21ab9b['query']);_0x159ab1[_0x7237('0x33')]=_[_0x7237('0x34')](_0x159ab1[_0x7237('0x35')],_0x159ab1['query']);_0x314da1[_0x7237('0x36')]=_[_0x7237('0x34')](_0x159ab1[_0x7237('0x35')],qs[_0x7237('0x48')](_0x21ab9b[_0x7237('0x32')][_0x7237('0x48')]));_0x314da1['attributes']=_0x314da1['attributes'][_0x7237('0x37')]?_0x314da1['attributes']:_0x159ab1[_0x7237('0x35')];if(_0x21ab9b[_0x7237('0x32')][_0x7237('0x49')]){_0x314da1['include']=[{'all':!![]}];}_0x314da1=_['merge']({},_0x314da1,_0x21ab9b[_0x7237('0x41')]);return db[_0x7237('0x42')][_0x7237('0x4a')](_0x314da1)[_0x7237('0x26')](handleEntityNotFound(_0x55666d,null))[_0x7237('0x26')](respondWithResult(_0x55666d,null))[_0x7237('0x4b')](handleError(_0x55666d,null));};exports[_0x7237('0x4c')]=function(_0x192832,_0xdbdddb){return db['ChatInternalMessage'][_0x7237('0x4c')](_0x192832['body'],{})[_0x7237('0x26')](respondWithResult(_0xdbdddb,0xc9))[_0x7237('0x4b')](handleError(_0xdbdddb,null));};exports['update']=function(_0x1c3a6b,_0x2d323){if(_0x1c3a6b['body']['id']){delete _0x1c3a6b[_0x7237('0x4d')]['id'];}return db['ChatInternalMessage'][_0x7237('0x4a')]({'where':{'id':_0x1c3a6b['params']['id']}})[_0x7237('0x26')](handleEntityNotFound(_0x2d323,null))[_0x7237('0x26')](saveUpdates(_0x1c3a6b[_0x7237('0x4d')],null))[_0x7237('0x26')](respondWithResult(_0x2d323,null))[_0x7237('0x4b')](handleError(_0x2d323,null));};exports[_0x7237('0x27')]=function(_0x4ca215,_0xd9369b){return db[_0x7237('0x42')]['find']({'where':{'id':_0x4ca215['params']['id']}})[_0x7237('0x26')](handleEntityNotFound(_0xd9369b,null))[_0x7237('0x26')](removeEntity(_0xd9369b,null))['catch'](handleError(_0xd9369b,null));};exports['describe']=function(_0x514bd0,_0x47423e){return db[_0x7237('0x42')][_0x7237('0x4e')]()[_0x7237('0x26')](respondWithResult(_0x47423e,null))[_0x7237('0x4b')](handleError(_0x47423e,null));};function wrapUser(_0x5df70f){return function(_0x1cf28a){var _0xb39162=_0x5df70f[_0x7237('0x4f')]({'plain':!![]});_0xb39162[_0x7237('0x50')]=[];if(_0x1cf28a){_0xb39162[_0x7237('0x51')]=_0x1cf28a['createdAt'];_0xb39162[_0x7237('0x52')]=_0x1cf28a;}else{_0xb39162[_0x7237('0x51')]=moment(0x0)[_0x7237('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0xb39162[_0x7237('0x52')]={};}return _0xb39162;};}exports['getUsers']=function(_0x17cb09,_0x264b2e,_0x416eab){var _0x45e03c=[];return db['User']['findAll']({'where':{'role':[_0x7237('0x54'),'admin',_0x7237('0x55')]},'attributes':['id',_0x7237('0x56'),_0x7237('0x2a'),'role',_0x7237('0x57'),_0x7237('0x58'),_0x7237('0x59'),'lastLoginAt',_0x7237('0x5a'),_0x7237('0x5b')],'order':qs['sort'](_0x7237('0x5c')),'include':[{'model':db[_0x7237('0x5d')],'as':_0x7237('0x5e'),'attributes':['id',_0x7237('0x2a'),_0x7237('0x30')],'through':{'attributes':[]}}]})[_0x7237('0x26')](function(_0x3cb866){if(_0x3cb866){var _0x3ef253=_0x17cb09[_0x7237('0x55')][_0x7237('0x4f')]({'plain':!![]});if(!_0x3ef253)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ef253[_0x7237('0x5f')]===_0x7237('0x55')){return db['UserProfileSection'][_0x7237('0x4a')]({'where':{'name':_0x7237('0x60'),'userProfileId':_0x3ef253[_0x7237('0x61')]},'raw':!![]})[_0x7237('0x26')](function(_0xee2c23){if(_0xee2c23){if(_0xee2c23[_0x7237('0x62')]===0x0){return db['UserProfileResource'][_0x7237('0x44')]({'where':{'sectionId':_0xee2c23['id']},'raw':!![]})[_0x7237('0x26')](function(_0x3b83bb){var _0x43edf1=[];if(_['isEmpty'](_0x3b83bb)){_0x43edf1=_[_0x7237('0x40')](_0x3cb866,function(_0x5979c6){if(_0x5979c6['role']!==_0x7237('0x54')){return _0x5979c6;}});return _0x43edf1;}else{for(var _0x5f5a79=0x0;_0x5f5a79<_0x3cb866[_0x7237('0x37')];_0x5f5a79++){var _0x269eff=_0x3cb866[_0x5f5a79];if(_0x269eff[_0x7237('0x5f')]===_0x7237('0x54')){var _0xe01da4=_['find'](_0x3b83bb,function(_0x26f5a9){return _0x26f5a9[_0x7237('0x63')]===_0x269eff['id'];});if(_0xe01da4)_0x43edf1[_0x7237('0x64')](_0x269eff);}else{_0x43edf1['push'](_0x269eff);}}return _0x43edf1;}});}else{return _0x3cb866;}}else{var _0x46dffd=_[_0x7237('0x40')](_0x3cb866,function(_0x3c4ac0){if(_0x3c4ac0[_0x7237('0x5f')]!==_0x7237('0x54')){return _0x3c4ac0;}});return _0x46dffd;}});}else{return _0x3cb866;}}})[_0x7237('0x26')](function(_0x1ce085){var _0x83dcaf=[];if(_0x1ce085){_0x45e03c=_0x1ce085;for(var _0x6301f9=0x0;_0x6301f9<_0x1ce085['length'];_0x6301f9+=0x1){_0x45e03c[_0x6301f9][_0x7237('0x50')]=[];_0x83dcaf['push'](db['ChatInternalMessage'][_0x7237('0x4a')]({'where':{'FromId':[_0x17cb09[_0x7237('0x55')]['id'],_0x1ce085[_0x6301f9]['id']],'ToId':[_0x17cb09[_0x7237('0x55')]['id'],_0x1ce085[_0x6301f9]['id']],'ChatGroupId':null},'attributes':['id',_0x7237('0x65'),_0x7237('0x66'),_0x7237('0x67'),_0x7237('0x68'),'body'],'order':qs[_0x7237('0x3b')](_0x7237('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7237('0x26')](wrapUser(_0x1ce085[_0x6301f9])));}return BPromise[_0x7237('0x6a')](_0x83dcaf);}return[];})[_0x7237('0x26')](function(_0x506514){return{'rows':_0x506514,'count':_0x506514[_0x7237('0x37')]};})[_0x7237('0x26')](respondWithResult(_0x264b2e,null))['catch'](handleError(_0x264b2e,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index b38d156..fffad87 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 _0x2902=['hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit'];(function(_0x2962b4,_0x4b0786){var _0x411b7d=function(_0x363aad){while(--_0x363aad){_0x2962b4['push'](_0x2962b4['shift']());}};_0x411b7d(++_0x4b0786);}(_0x2902,0x77));var _0x2290=function(_0x5b1c50,_0x56e694){_0x5b1c50=_0x5b1c50-0x0;var _0x2d379b=_0x2902[_0x5b1c50];return _0x2d379b;};'use strict';var EventEmitter=require(_0x2290('0x0'));var ChatInternalMessage=require(_0x2290('0x1'))['db'][_0x2290('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2290('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2290('0x4'),'afterDestroy':_0x2290('0x5')};function emitEvent(_0x1beffb){return function(_0x511ff6,_0x585868,_0x208f8a){ChatInternalMessageEvents[_0x2290('0x6')](_0x1beffb+':'+_0x511ff6['id'],_0x511ff6);ChatInternalMessageEvents['emit'](_0x1beffb,_0x511ff6);_0x208f8a(null);};}for(var e in events){if(events[_0x2290('0x7')](e)){var event=events[e];ChatInternalMessage[_0x2290('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x8c8f=['exports','events','ChatInternalMessage','hasOwnProperty','hook'];(function(_0x4733d3,_0x454290){var _0x1b9a44=function(_0x1a93bb){while(--_0x1a93bb){_0x4733d3['push'](_0x4733d3['shift']());}};_0x1b9a44(++_0x454290);}(_0x8c8f,0x1e6));var _0xf8c8=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x8c8f[_0x2dadb9];return _0x2f0097;};'use strict';var EventEmitter=require(_0xf8c8('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xf8c8('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4ad7e8){return function(_0x5f25fe,_0x22f13f,_0x5f1880){ChatInternalMessageEvents['emit'](_0x4ad7e8+':'+_0x5f25fe['id'],_0x5f25fe);ChatInternalMessageEvents['emit'](_0x4ad7e8,_0x5f25fe);_0x5f1880(null);};}for(var e in events){if(events[_0xf8c8('0x2')](e)){var event=events[e];ChatInternalMessage[_0xf8c8('0x3')](e,emitEvent(event));}}module[_0xf8c8('0x4')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index cbf36dd..c5cccd5 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 _0xdbdf=['define','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0xdbdf,0x106));var _0xfdbd=function(_0x271466,_0x13f1d9){_0x271466=_0x271466-0x0;var _0x26d395=_0xdbdf[_0x271466];return _0x26d395;};'use strict';var _=require(_0xfdbd('0x0'));var util=require(_0xfdbd('0x1'));var logger=require(_0xfdbd('0x2'))(_0xfdbd('0x3'));var moment=require(_0xfdbd('0x4'));var BPromise=require(_0xfdbd('0x5'));var rp=require(_0xfdbd('0x6'));var fs=require('fs');var path=require(_0xfdbd('0x7'));var rimraf=require(_0xfdbd('0x8'));var config=require('../../config/environment');var attributes=require(_0xfdbd('0x9'));module[_0xfdbd('0xa')]=function(_0x158cf1,_0x4e239b){return _0x158cf1[_0xfdbd('0xb')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfdbd('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf706=['utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','../../config/environment','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf706,0xca));var _0x6f70=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf706[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f70('0x0'))(_0x6f70('0x1'));var moment=require('moment');var BPromise=require(_0x6f70('0x2'));var rp=require(_0x6f70('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6f70('0x4'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x19e863,_0x51a409){return _0x19e863[_0x6f70('0x5')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6f70('0x6'),'collate':_0x6f70('0x7')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a795390..1b4eb3e 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 _0xe142=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2f2a6f,_0xe63e10){var _0x14441d=function(_0x3ab031){while(--_0x3ab031){_0x2f2a6f['push'](_0x2f2a6f['shift']());}};_0x14441d(++_0xe63e10);}(_0xe142,0xaa));var _0x2e14=function(_0x212860,_0x114464){_0x212860=_0x212860-0x0;var _0x577708=_0xe142[_0x212860];return _0x577708;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2e14('0x0'));var BPromise=require('bluebird');var rs=require(_0x2e14('0x1'));var fs=require('fs');var Redis=require(_0x2e14('0x2'));var db=require(_0x2e14('0x3'))['db'];var utils=require(_0x2e14('0x4'));var logger=require(_0x2e14('0x5'))(_0x2e14('0x6'));var config=require('../../config/environment');var jayson=require(_0x2e14('0x7'));var client=jayson[_0x2e14('0x8')][_0x2e14('0x9')]({'port':0x232a});config[_0x2e14('0xa')]=_[_0x2e14('0xb')](config[_0x2e14('0xa')],{'host':_0x2e14('0xc'),'port':0x18eb});var socket=require(_0x2e14('0xd'))(new Redis(config[_0x2e14('0xa')]));require('./chatInternalMessage.socket')[_0x2e14('0xe')](socket);function respondWithRpcPromise(_0x9d235b,_0x5a48d6,_0x5d921d){return new BPromise(function(_0x1e3713,_0x22f1b3){return client['request'](_0x9d235b,_0x5d921d)[_0x2e14('0xf')](function(_0x2be8db){logger['info'](_0x2e14('0x10'),_0x5a48d6,_0x2e14('0x11'));logger[_0x2e14('0x12')](_0x2e14('0x13'),_0x5a48d6,_0x2e14('0x11'),JSON[_0x2e14('0x14')](_0x2be8db));if(_0x2be8db[_0x2e14('0x15')]){if(_0x2be8db[_0x2e14('0x15')]['code']===0x1f4){logger[_0x2e14('0x15')](_0x2e14('0x10'),_0x5a48d6,_0x2be8db[_0x2e14('0x15')]['message']);return _0x22f1b3(_0x2be8db[_0x2e14('0x15')][_0x2e14('0x16')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x5a48d6,_0x2be8db[_0x2e14('0x15')]['message']);return _0x1e3713(_0x2be8db[_0x2e14('0x15')][_0x2e14('0x16')]);}else{logger['info'](_0x2e14('0x10'),_0x5a48d6,_0x2e14('0x11'));_0x1e3713(_0x2be8db[_0x2e14('0x17')][_0x2e14('0x16')]);}})[_0x2e14('0x18')](function(_0x2e6760){logger[_0x2e14('0x15')](_0x2e14('0x10'),_0x5a48d6,_0x2e6760);_0x22f1b3(_0x2e6760);});});} \ No newline at end of file +var _0x181d=['../../config/utils','rpc','../../config/environment','http','defaults','redis','localhost','./chatInternalMessage.socket','register','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb'];(function(_0xc1743c,_0x154fe5){var _0x3143ff=function(_0x4b9899){while(--_0x4b9899){_0xc1743c['push'](_0xc1743c['shift']());}};_0x3143ff(++_0x154fe5);}(_0x181d,0x10f));var _0xd181=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x181d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd181('0x0'));var BPromise=require('bluebird');var rs=require(_0xd181('0x1'));var fs=require('fs');var Redis=require(_0xd181('0x2'));var db=require(_0xd181('0x3'))['db'];var utils=require(_0xd181('0x4'));var logger=require('../../config/logger')(_0xd181('0x5'));var config=require(_0xd181('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd181('0x7')]({'port':0x232a});config['redis']=_[_0xd181('0x8')](config[_0xd181('0x9')],{'host':_0xd181('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd181('0x9')]));require(_0xd181('0xb'))[_0xd181('0xc')](socket);function respondWithRpcPromise(_0x74ef22,_0x103eee,_0x589470){return new BPromise(function(_0x51d3ce,_0x549dd2){return client['request'](_0x74ef22,_0x589470)[_0xd181('0xd')](function(_0x4cb3f6){logger['info'](_0xd181('0xe'),_0x103eee,_0xd181('0xf'));logger[_0xd181('0x10')](_0xd181('0x11'),_0x103eee,_0xd181('0xf'),JSON[_0xd181('0x12')](_0x4cb3f6));if(_0x4cb3f6[_0xd181('0x13')]){if(_0x4cb3f6[_0xd181('0x13')][_0xd181('0x14')]===0x1f4){logger[_0xd181('0x13')](_0xd181('0xe'),_0x103eee,_0x4cb3f6[_0xd181('0x13')][_0xd181('0x15')]);return _0x549dd2(_0x4cb3f6[_0xd181('0x13')][_0xd181('0x15')]);}logger[_0xd181('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x103eee,_0x4cb3f6[_0xd181('0x13')][_0xd181('0x15')]);return _0x51d3ce(_0x4cb3f6[_0xd181('0x13')]['message']);}else{logger[_0xd181('0x16')](_0xd181('0xe'),_0x103eee,_0xd181('0xf'));_0x51d3ce(_0x4cb3f6[_0xd181('0x17')][_0xd181('0x15')]);}})[_0xd181('0x18')](function(_0x483615){logger[_0xd181('0x13')](_0xd181('0xe'),_0x103eee,_0x483615);_0x549dd2(_0x483615);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index d19b2cb..51f2619 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 _0xb2e9=['remove','update','emit','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x4d6993,_0x46c55a){var _0x32caaf=function(_0x22e4e3){while(--_0x22e4e3){_0x4d6993['push'](_0x4d6993['shift']());}};_0x32caaf(++_0x46c55a);}(_0xb2e9,0xbb));var _0x9b2e=function(_0x3bdba1,_0x50a91f){_0x3bdba1=_0x3bdba1-0x0;var _0x222f1d=_0xb2e9[_0x3bdba1];return _0x222f1d;};'use strict';var ChatInternalMessageEvents=require(_0x9b2e('0x0'));var events=[_0x9b2e('0x1'),_0x9b2e('0x2'),_0x9b2e('0x3')];function createListener(_0x4c34b8,_0xa94f22){return function(_0x54ae4e){_0xa94f22[_0x9b2e('0x4')](_0x4c34b8,_0x54ae4e);};}function removeListener(_0x370c58,_0x205730){return function(){ChatInternalMessageEvents['removeListener'](_0x370c58,_0x205730);};}exports['register']=function(_0x440cdd){for(var _0x3d122a=0x0,_0x43982c=events[_0x9b2e('0x5')];_0x3d122a<_0x43982c;_0x3d122a++){var _0x5ac3e5=events[_0x3d122a];var _0x26e8ca=createListener(_0x9b2e('0x6')+_0x5ac3e5,_0x440cdd);ChatInternalMessageEvents['on'](_0x5ac3e5,_0x26e8ca);}}; \ No newline at end of file +var _0x125d=['length','save','remove','emit','register'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x125d,0x182));var _0xd125=function(_0x2b9978,_0x4c5bc5){_0x2b9978=_0x2b9978-0x0;var _0x5dd096=_0x125d[_0x2b9978];return _0x5dd096;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xd125('0x0'),_0xd125('0x1'),'update'];function createListener(_0x10d34e,_0x5af449){return function(_0x1c546b){_0x5af449[_0xd125('0x2')](_0x10d34e,_0x1c546b);};}function removeListener(_0x5b9c86,_0x266995){return function(){ChatInternalMessageEvents['removeListener'](_0x5b9c86,_0x266995);};}exports[_0xd125('0x3')]=function(_0x3f65ef){for(var _0x4449d2=0x0,_0x566ca6=events[_0xd125('0x4')];_0x4449d2<_0x566ca6;_0x4449d2++){var _0x278cfa=events[_0x4449d2];var _0x216a4d=createListener('chatInternalMessage:'+_0x278cfa,_0x3f65ef);ChatInternalMessageEvents['on'](_0x278cfa,_0x216a4d);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 01d2664..59c163b 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 _0xc3ed=['isAuthenticated','index','/describe','describe','/users','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','Router','fs-extra','./chatInternalMessage.controller','get'];(function(_0x42befc,_0x8b04cf){var _0x1ccf6b=function(_0x1c6e0f){while(--_0x1c6e0f){_0x42befc['push'](_0x42befc['shift']());}};_0x1ccf6b(++_0x8b04cf);}(_0xc3ed,0x19d));var _0xdc3e=function(_0x25428f,_0x3e4c19){_0x25428f=_0x25428f-0x0;var _0xda115a=_0xc3ed[_0x25428f];return _0xda115a;};'use strict';var multer=require('multer');var util=require(_0xdc3e('0x0'));var path=require(_0xdc3e('0x1'));var timeout=require(_0xdc3e('0x2'));var express=require('express');var router=express[_0xdc3e('0x3')]();var fs_extra=require(_0xdc3e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdc3e('0x5'));router[_0xdc3e('0x6')]('/',auth[_0xdc3e('0x7')](),controller[_0xdc3e('0x8')]);router[_0xdc3e('0x6')](_0xdc3e('0x9'),auth[_0xdc3e('0x7')](),controller[_0xdc3e('0xa')]);router['get'](_0xdc3e('0xb'),auth['isAuthenticated'](),controller['getUsers']);router[_0xdc3e('0x6')](_0xdc3e('0xc'),auth['isAuthenticated'](),controller[_0xdc3e('0xd')]);router[_0xdc3e('0xe')]('/',auth[_0xdc3e('0x7')](),controller[_0xdc3e('0xf')]);router[_0xdc3e('0x10')](_0xdc3e('0xc'),controller[_0xdc3e('0x11')]);router[_0xdc3e('0x12')]('/:id',auth[_0xdc3e('0x7')](),controller[_0xdc3e('0x13')]);module['exports']=router; \ No newline at end of file +var _0x8406=['isAuthenticated','/describe','describe','/users','getUsers','/:id','show','create','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8406,0x162));var _0x6840=function(_0x4a55c4,_0x15a91d){_0x4a55c4=_0x4a55c4-0x0;var _0x175338=_0x8406[_0x4a55c4];return _0x175338;};'use strict';var multer=require('multer');var util=require(_0x6840('0x0'));var path=require(_0x6840('0x1'));var timeout=require('connect-timeout');var express=require(_0x6840('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6840('0x3'));var interaction=require(_0x6840('0x4'));var config=require('../../config/environment');var controller=require(_0x6840('0x5'));router[_0x6840('0x6')]('/',auth[_0x6840('0x7')](),controller['index']);router[_0x6840('0x6')](_0x6840('0x8'),auth[_0x6840('0x7')](),controller[_0x6840('0x9')]);router[_0x6840('0x6')](_0x6840('0xa'),auth[_0x6840('0x7')](),controller[_0x6840('0xb')]);router[_0x6840('0x6')](_0x6840('0xc'),auth[_0x6840('0x7')](),controller[_0x6840('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6840('0xe')]);router['put'](_0x6840('0xc'),controller[_0x6840('0xf')]);router[_0x6840('0x10')]('/:id',auth[_0x6840('0x7')](),controller[_0x6840('0x11')]);module[_0x6840('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 52c0c11..727e99c 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 _0x4483=['exports','TEXT','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x1b55b5,_0xcc53e0){var _0xb4335e=function(_0x5dd98c){while(--_0x5dd98c){_0x1b55b5['push'](_0x1b55b5['shift']());}};_0xb4335e(++_0xcc53e0);}(_0x4483,0x1a3));var _0x3448=function(_0x24fe49,_0x9ea218){_0x24fe49=_0x24fe49-0x0;var _0x32adf5=_0x4483[_0x24fe49];return _0x32adf5;};'use strict';var Sequelize=require(_0x3448('0x0'));module[_0x3448('0x1')]={'body':{'type':Sequelize[_0x3448('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3448('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3448('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3448('0x4')]('in',_0x3448('0x5')),'defaultValue':_0x3448('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x3448('0x6')]},'providerResponse':{'type':Sequelize[_0x3448('0x2')]}}; \ No newline at end of file +var _0x720e=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT'];(function(_0x3a2797,_0x1f905c){var _0x5c2d96=function(_0x3c7bd7){while(--_0x3c7bd7){_0x3a2797['push'](_0x3a2797['shift']());}};_0x5c2d96(++_0x1f905c);}(_0x720e,0x1cb));var _0xe720=function(_0x5c18ef,_0xa2e81d){_0x5c18ef=_0x5c18ef-0x0;var _0x33789d=_0x720e[_0x5c18ef];return _0x33789d;};'use strict';var Sequelize=require(_0xe720('0x0'));module[_0xe720('0x1')]={'body':{'type':Sequelize[_0xe720('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xe720('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe720('0x4')),'defaultValue':_0xe720('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe720('0x5')]},'providerName':{'type':Sequelize[_0xe720('0x6')]},'providerResponse':{'type':Sequelize[_0xe720('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 37ea515..8f47a02 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 _0x2226=['SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','accept','EventManager','acceptmessage','parse','formData','role','User','motionChannel','event','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','http','request','info','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','request\x20sent','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','ChatMessage','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes'];(function(_0x1f5143,_0x5e31e6){var _0x383a38=function(_0x2c123c){while(--_0x2c123c){_0x1f5143['push'](_0x1f5143['shift']());}};_0x383a38(++_0x5e31e6);}(_0x2226,0x191));var _0x6222=function(_0x5550b3,_0x2d0ee0){_0x5550b3=_0x5550b3-0x0;var _0x4b8fc4=_0x2226[_0x5550b3];return _0x4b8fc4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6222('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6222('0x1'));var moment=require('moment');var BPromise=require(_0x6222('0x2'));var Mustache=require(_0x6222('0x3'));var util=require(_0x6222('0x4'));var path=require(_0x6222('0x5'));var sox=require(_0x6222('0x6'));var csv=require(_0x6222('0x7'));var ejs=require(_0x6222('0x8'));var fs=require('fs');var fs_extra=require(_0x6222('0x9'));var _=require(_0x6222('0xa'));var squel=require('squel');var crypto=require(_0x6222('0xb'));var jsforce=require(_0x6222('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6222('0x7'));var querystring=require(_0x6222('0xd'));var Papa=require(_0x6222('0xe'));var Redis=require(_0x6222('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6222('0x10'));var as=require(_0x6222('0x11'));var hardwareService=require(_0x6222('0x12'));var logger=require(_0x6222('0x13'))(_0x6222('0x14'));var utils=require(_0x6222('0x15'));var config=require(_0x6222('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6222('0x17'))['db'];config[_0x6222('0x18')]=_[_0x6222('0x19')](config[_0x6222('0x18')],{'host':_0x6222('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6222('0x18')]));require(_0x6222('0x1b'))[_0x6222('0x1c')](socket);var jayson=require(_0x6222('0x1d'));var client=jayson['client'][_0x6222('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x6222('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3d7fa3,_0xa445d3,_0x21bb63,_0x220e08){return new BPromise(function(_0x5f0b44,_0x1aac02){var _0x1838f0=_0x220e08||client;return _0x1838f0[_0x6222('0x1f')](_0x3d7fa3,_0x21bb63)['then'](function(_0xc6ff70){logger[_0x6222('0x20')]('ChatMessage,\x20%s,\x20%s',_0xa445d3,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0xa445d3,'request\x20sent',JSON[_0x6222('0x21')](_0xc6ff70));if(_0xc6ff70[_0x6222('0x22')]){if(_0xc6ff70['error'][_0x6222('0x23')]===0x1f4){logger[_0x6222('0x22')](_0x6222('0x24'),_0xa445d3,_0xc6ff70[_0x6222('0x22')]['message']);return _0x1aac02(_0xc6ff70['error'][_0x6222('0x25')]);}logger[_0x6222('0x22')](_0x6222('0x24'),_0xa445d3,_0xc6ff70[_0x6222('0x22')][_0x6222('0x25')]);return _0x5f0b44(_0xc6ff70[_0x6222('0x22')][_0x6222('0x25')]);}else{logger[_0x6222('0x20')](_0x6222('0x24'),_0xa445d3,_0x6222('0x26'));_0x5f0b44(_0xc6ff70['result']['message']);}})['catch'](function(_0x68724c){logger[_0x6222('0x22')](_0x6222('0x24'),_0xa445d3,_0x68724c);_0x1aac02(_0x68724c);});});}function respondWithStatusCode(_0x454ed8,_0x10f84e){_0x10f84e=_0x10f84e||0xcc;return function(_0x32d5da){if(_0x32d5da){return _0x454ed8[_0x6222('0x27')](_0x10f84e);}return _0x454ed8[_0x6222('0x28')](_0x10f84e)[_0x6222('0x29')]();};}function respondWithResult(_0x3c898a,_0x16dcf6){_0x16dcf6=_0x16dcf6||0xc8;return function(_0x58b773){if(_0x58b773){return _0x3c898a[_0x6222('0x28')](_0x16dcf6)['json'](_0x58b773);}};}function respondWithFilteredResult(_0x5c7065,_0x3b21f6){return function(_0xbd7e87){if(_0xbd7e87){var _0x371cbf=typeof _0x3b21f6[_0x6222('0x2a')]===_0x6222('0x2b')&&typeof _0x3b21f6['limit']==='undefined';var _0x2f0319=_0xbd7e87[_0x6222('0x2c')];var _0x2bfc62=_0x371cbf?0x0:_0x3b21f6[_0x6222('0x2a')];var _0x579764=_0x371cbf?_0xbd7e87[_0x6222('0x2c')]:_0x3b21f6[_0x6222('0x2a')]+_0x3b21f6[_0x6222('0x2d')];var _0x7163d9;if(_0x579764>=_0x2f0319){_0x579764=_0x2f0319;_0x7163d9=0xc8;}else{_0x7163d9=0xce;}_0x5c7065[_0x6222('0x28')](_0x7163d9);return _0x5c7065[_0x6222('0x2e')](_0x6222('0x2f'),_0x2bfc62+'-'+_0x579764+'/'+_0x2f0319)['json'](_0xbd7e87);}return null;};}function patchUpdates(_0xb97d0){return function(_0x567f4d){try{jsonpatch[_0x6222('0x30')](_0x567f4d,_0xb97d0,!![]);}catch(_0x1b742b){return BPromise[_0x6222('0x31')](_0x1b742b);}return _0x567f4d[_0x6222('0x32')]();};}function saveUpdates(_0x58d743,_0x3dc770){return function(_0xd2134b){if(_0xd2134b){return _0xd2134b[_0x6222('0x33')](_0x58d743)[_0x6222('0x34')](function(_0x410e1b){return _0x410e1b;});}return null;};}function removeEntity(_0x419c62,_0x33066f){return function(_0x3b9f39){if(_0x3b9f39){return _0x3b9f39[_0x6222('0x35')]()[_0x6222('0x34')](function(){_0x419c62[_0x6222('0x28')](0xcc)[_0x6222('0x29')]();});}};}function handleEntityNotFound(_0x1815c4,_0x36a997){return function(_0x285bed){if(!_0x285bed){_0x1815c4['sendStatus'](0x194);}return _0x285bed;};}function handleError(_0x23f5ab,_0x201593){_0x201593=_0x201593||0x1f4;return function(_0xf56940){logger[_0x6222('0x22')](_0xf56940['stack']);if(_0xf56940['name']){delete _0xf56940[_0x6222('0x36')];}_0x23f5ab['status'](_0x201593)[_0x6222('0x37')](_0xf56940);};}exports[_0x6222('0x38')]=function(_0x51381d,_0x4cbc9b){var _0x43f3ec={},_0x49890a={},_0x885591={'count':0x0,'rows':[]};var _0x575fce=_[_0x6222('0x39')](db[_0x6222('0x3a')][_0x6222('0x3b')],function(_0x494edc){return{'name':_0x494edc['fieldName'],'type':_0x494edc[_0x6222('0x3c')][_0x6222('0x3d')]};});_0x49890a[_0x6222('0x3e')]=_['map'](_0x575fce,'name');_0x49890a['query']=_['keys'](_0x51381d[_0x6222('0x3f')]);_0x49890a[_0x6222('0x40')]=_[_0x6222('0x41')](_0x49890a[_0x6222('0x3e')],_0x49890a[_0x6222('0x3f')]);_0x43f3ec[_0x6222('0x42')]=_['intersection'](_0x49890a[_0x6222('0x3e')],qs[_0x6222('0x43')](_0x51381d[_0x6222('0x3f')][_0x6222('0x43')]));_0x43f3ec[_0x6222('0x42')]=_0x43f3ec[_0x6222('0x42')]['length']?_0x43f3ec[_0x6222('0x42')]:_0x49890a[_0x6222('0x3e')];if(!_0x51381d[_0x6222('0x3f')]['hasOwnProperty'](_0x6222('0x44'))){_0x43f3ec[_0x6222('0x2d')]=qs[_0x6222('0x2d')](_0x51381d['query'][_0x6222('0x2d')]);_0x43f3ec['offset']=qs[_0x6222('0x2a')](_0x51381d[_0x6222('0x3f')][_0x6222('0x2a')]);}_0x43f3ec[_0x6222('0x45')]=qs[_0x6222('0x46')](_0x51381d[_0x6222('0x3f')][_0x6222('0x46')]);_0x43f3ec[_0x6222('0x47')]=qs['filters'](_['pick'](_0x51381d['query'],_0x49890a[_0x6222('0x40')]),_0x575fce);if(_0x51381d['query'][_0x6222('0x48')]){_0x43f3ec[_0x6222('0x47')]=_[_0x6222('0x49')](_0x43f3ec[_0x6222('0x47')],{'$or':_[_0x6222('0x39')](_0x575fce,function(_0x202ed1){if(_0x202ed1[_0x6222('0x3c')]!==_0x6222('0x4a')){var _0x3cb8b9={};_0x3cb8b9[_0x202ed1[_0x6222('0x36')]]={'$like':'%'+_0x51381d['query'][_0x6222('0x48')]+'%'};return _0x3cb8b9;}})});}_0x43f3ec=_['merge']({},_0x43f3ec,_0x51381d[_0x6222('0x4b')]);var _0x3b67bd={'where':_0x43f3ec[_0x6222('0x47')]};return db[_0x6222('0x3a')][_0x6222('0x2c')](_0x3b67bd)['then'](function(_0x271042){_0x885591[_0x6222('0x2c')]=_0x271042;if(_0x51381d[_0x6222('0x3f')][_0x6222('0x4c')]){_0x43f3ec[_0x6222('0x4d')]=[{'all':!![]}];}return db[_0x6222('0x3a')][_0x6222('0x4e')](_0x43f3ec);})[_0x6222('0x34')](function(_0x1282b0){_0x885591[_0x6222('0x4f')]=_0x1282b0;return _0x885591;})[_0x6222('0x34')](respondWithFilteredResult(_0x4cbc9b,_0x43f3ec))['catch'](handleError(_0x4cbc9b,null));};exports[_0x6222('0x50')]=function(_0x194c2a,_0x161bb1){var _0x502765={'raw':!![],'where':{'id':_0x194c2a[_0x6222('0x51')]['id']}},_0xf14961={};_0xf14961['model']=_[_0x6222('0x52')](db[_0x6222('0x3a')][_0x6222('0x3b')]);_0xf14961[_0x6222('0x3f')]=_[_0x6222('0x52')](_0x194c2a[_0x6222('0x3f')]);_0xf14961[_0x6222('0x40')]=_[_0x6222('0x41')](_0xf14961[_0x6222('0x3e')],_0xf14961[_0x6222('0x3f')]);_0x502765[_0x6222('0x42')]=_['intersection'](_0xf14961[_0x6222('0x3e')],qs[_0x6222('0x43')](_0x194c2a[_0x6222('0x3f')][_0x6222('0x43')]));_0x502765[_0x6222('0x42')]=_0x502765[_0x6222('0x42')]['length']?_0x502765[_0x6222('0x42')]:_0xf14961[_0x6222('0x3e')];if(_0x194c2a[_0x6222('0x3f')]['includeAll']){_0x502765['include']=[{'all':!![]}];}_0x502765=_[_0x6222('0x49')]({},_0x502765,_0x194c2a[_0x6222('0x4b')]);return db[_0x6222('0x3a')]['find'](_0x502765)['then'](handleEntityNotFound(_0x161bb1,null))['then'](respondWithResult(_0x161bb1,null))[_0x6222('0x53')](handleError(_0x161bb1,null));};exports['create']=function(_0x759f5e,_0x16f2f3){return db[_0x6222('0x3a')][_0x6222('0x54')](_0x759f5e[_0x6222('0x55')],{})[_0x6222('0x34')](respondWithResult(_0x16f2f3,0xc9))[_0x6222('0x53')](handleError(_0x16f2f3,null));};exports[_0x6222('0x33')]=function(_0x26b71e,_0x23a55f){if(_0x26b71e[_0x6222('0x55')]['id']){delete _0x26b71e[_0x6222('0x55')]['id'];}return db[_0x6222('0x3a')][_0x6222('0x56')]({'where':{'id':_0x26b71e[_0x6222('0x51')]['id']}})[_0x6222('0x34')](handleEntityNotFound(_0x23a55f,null))[_0x6222('0x34')](saveUpdates(_0x26b71e['body'],null))['then'](respondWithResult(_0x23a55f,null))[_0x6222('0x53')](handleError(_0x23a55f,null));};exports[_0x6222('0x35')]=function(_0x280244,_0x40f71b){return db[_0x6222('0x3a')][_0x6222('0x56')]({'where':{'id':_0x280244[_0x6222('0x51')]['id']}})[_0x6222('0x34')](handleEntityNotFound(_0x40f71b,null))[_0x6222('0x34')](removeEntity(_0x40f71b,null))[_0x6222('0x53')](handleError(_0x40f71b,null));};exports[_0x6222('0x57')]=function(_0x1a571c,_0x23c237){return db[_0x6222('0x3a')][_0x6222('0x57')]()[_0x6222('0x34')](respondWithResult(_0x23c237,null))[_0x6222('0x53')](handleError(_0x23c237,null));};var interaction_log=require('../../config/logger')(_0x6222('0x58'));exports['accept']=function(_0x2fcdab,_0x5c4eb1,_0x41be7c){var _0x284c62={'agent':{},'channel':_0x6222('0x59')};if(_0x2fcdab['body']['id']){delete _0x2fcdab['body']['id'];}_0x2fcdab[_0x6222('0x55')][_0x6222('0x5a')]=!![];_0x2fcdab[_0x6222('0x55')][_0x6222('0x5b')]=moment()[_0x6222('0x5c')](_0x6222('0x5d'));_0x2fcdab[_0x6222('0x55')][_0x6222('0x5e')]=_0x2fcdab['body'][_0x6222('0x5e')]||_0x2fcdab[_0x6222('0x5f')]['id'];_0x284c62[_0x6222('0x60')]['id']=_0x2fcdab['body'][_0x6222('0x5e')];return db['ChatMessage']['find']({'where':{'id':_0x2fcdab['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5c4eb1,null))[_0x6222('0x34')](saveUpdates(_0x2fcdab[_0x6222('0x55')],null))['then'](function(_0x504cd5){if(_0x504cd5){_0x284c62[_0x6222('0x25')]=_0x504cd5[_0x6222('0x61')]({'plain':!![]});return db[_0x6222('0x62')]['find']({'where':{'id':_0x504cd5[_0x6222('0x63')]}});}return null;})[_0x6222('0x34')](handleEntityNotFound(_0x5c4eb1,null))[_0x6222('0x34')](function(_0x43eadd){if(_0x43eadd){return _0x43eadd[_0x6222('0x33')]({'UserId':_0x2fcdab[_0x6222('0x55')][_0x6222('0x5e')],'read1stAt':_[_0x6222('0x64')](_0x43eadd[_0x6222('0x65')])?moment()[_0x6222('0x5c')](_0x6222('0x5d')):undefined});}return null;})['then'](function(_0xa78dc1){if(_0xa78dc1){_0x284c62[_0x6222('0x66')]=_0xa78dc1[_0x6222('0x61')]({'plain':!![]});interaction_log[_0x6222('0x20')](_0x6222('0x67'),_0x2fcdab['user']['id'],_0x2fcdab[_0x6222('0x5f')]['name'],_0x2fcdab[_0x6222('0x5f')]['role'],_0x284c62[_0x6222('0x66')]['id'],_0x2fcdab[_0x6222('0x55')]?JSON[_0x6222('0x21')](_0x2fcdab[_0x6222('0x55')]):_0x6222('0x68'));return respondWithRpcPromise('AcceptMessage',_0x6222('0x69'),_0x284c62);}return null;})['then'](function(_0x3ec2af){var _0xda5032=_0x6222('0x6a')+_0x3ec2af[_0x6222('0x25')][_0x6222('0x6b')];return db[_0x6222('0x6c')][_0x6222('0x3f')](_0xda5032,{'type':db[_0x6222('0x6d')][_0x6222('0x6e')][_0x6222('0x6f')],'raw':!![]})[_0x6222('0x34')](function(_0x3cf1fc){return _0x3cf1fc;});})[_0x6222('0x34')](function(_0x4883dd){if(_0x4883dd){_0x284c62[_0x6222('0x25')]['contact']=_0x4883dd[0x0];if(!_0x2fcdab['body'][_0x6222('0x5e')])return;return db['User']['find']({'where':{'id':_0x2fcdab['body']['UserId'],'role':'agent'},'attributes':['id',_0x6222('0x36'),_0x6222('0x70'),_0x6222('0x71'),_0x6222('0x72')],'raw':!![]});}return null;})[_0x6222('0x34')](function(_0x546841){if(!_0x546841)return null;_0x284c62[_0x6222('0x25')][_0x6222('0x60')]=_0x546841;return _0x284c62;})[_0x6222('0x34')](function(_0xd13442){if(_0xd13442){if(_0x2fcdab[_0x6222('0x55')][_0x6222('0x73')]){_0x284c62[_0x6222('0x25')][_0x6222('0x74')]=util[_0x6222('0x5c')](_0x6222('0x75'),_0x2fcdab[_0x6222('0x5f')]['name']);_0x284c62[_0x6222('0x25')][_0x6222('0x76')]=_0x284c62['channel'];_0x284c62['message']['motionChannel']=_0x284c62[_0x6222('0x76')];_0x284c62[_0x6222('0x25')]['event']=_0x6222('0x77');return respondWithRpcPromise(_0x6222('0x78'),_0x6222('0x78'),{'event':_0x6222('0x79'),'message':_['merge'](_0x284c62[_0x6222('0x25')],JSON[_0x6222('0x7a')](_0x284c62[_0x6222('0x66')][_0x6222('0x7b')]))},client9002)[_0x6222('0x34')](function(){return _0x284c62;});}return _0x284c62;}return null;})['then'](respondWithResult(_0x5c4eb1,null))[_0x6222('0x53')](handleError(_0x5c4eb1,null));};var interaction_log=require(_0x6222('0x13'))(_0x6222('0x58'));exports[_0x6222('0x31')]=function(_0x702d16,_0x108587,_0x52fe46){var _0x57dae5={'agent':{},'channel':_0x6222('0x59')};if(_0x702d16[_0x6222('0x55')]['id']){delete _0x702d16['body']['id'];}_0x702d16['body'][_0x6222('0x5e')]=_0x702d16['body'][_0x6222('0x5e')]||_0x702d16[_0x6222('0x5f')]['id'];_0x57dae5[_0x6222('0x60')]['id']=_0x702d16[_0x6222('0x55')][_0x6222('0x5e')];return db[_0x6222('0x3a')][_0x6222('0x56')]({'where':{'id':_0x702d16[_0x6222('0x51')]['id'],'UserId':null}})[_0x6222('0x34')](handleEntityNotFound(_0x108587,null))['then'](function(_0x133890){if(_0x133890){_0x57dae5['message']=_0x133890[_0x6222('0x61')]({'plain':!![]});return db['ChatInteraction'][_0x6222('0x56')]({'where':{'id':_0x133890[_0x6222('0x63')]}});}return null;})[_0x6222('0x34')](handleEntityNotFound(_0x108587,null))[_0x6222('0x34')](function(_0x3a76c4){if(_0x3a76c4){_0x57dae5[_0x6222('0x66')]=_0x3a76c4[_0x6222('0x61')]({'plain':!![]});interaction_log[_0x6222('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x702d16[_0x6222('0x5f')]['id'],_0x702d16[_0x6222('0x5f')][_0x6222('0x36')],_0x702d16['user'][_0x6222('0x7c')],_0x57dae5[_0x6222('0x66')]['id'],_0x702d16['body']?JSON[_0x6222('0x21')](_0x702d16[_0x6222('0x55')]):_0x6222('0x68'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x57dae5);}return null;})[_0x6222('0x34')](function(_0x1bb1a7){var _0x240cb4=_0x6222('0x6a')+_0x1bb1a7[_0x6222('0x25')][_0x6222('0x6b')];return db[_0x6222('0x6c')][_0x6222('0x3f')](_0x240cb4,{'type':db[_0x6222('0x6d')]['QueryTypes'][_0x6222('0x6f')],'raw':!![]})['then'](function(_0x1ec295){return _0x1ec295;});})[_0x6222('0x34')](function(_0x32fcf9){if(_0x32fcf9){_0x57dae5[_0x6222('0x25')]['contact']=_0x32fcf9[0x0];if(!_0x702d16[_0x6222('0x55')][_0x6222('0x5e')])return;return db[_0x6222('0x7d')]['find']({'where':{'id':_0x702d16[_0x6222('0x55')]['UserId'],'role':_0x6222('0x60')},'attributes':['id',_0x6222('0x36'),_0x6222('0x70'),_0x6222('0x71'),_0x6222('0x72')],'raw':!![]});}return null;})[_0x6222('0x34')](function(_0x328adc){if(!_0x328adc)return null;_0x57dae5[_0x6222('0x25')][_0x6222('0x60')]=_0x328adc;return _0x57dae5;})[_0x6222('0x34')](function(_0x3576e9){if(_0x3576e9){_0x3576e9['message'][_0x6222('0x74')]=util[_0x6222('0x5c')]('SIP/%s',_0x702d16[_0x6222('0x5f')][_0x6222('0x36')]);_0x3576e9[_0x6222('0x25')]['channel']=_0x57dae5[_0x6222('0x76')];_0x3576e9['message'][_0x6222('0x7e')]=_0x57dae5['channel'];_0x3576e9[_0x6222('0x25')][_0x6222('0x7f')]=_0x6222('0x31');respondWithRpcPromise('EventManager',_0x6222('0x78'),{'event':'rejectmessage','message':_[_0x6222('0x49')](_0x57dae5['message'],JSON[_0x6222('0x7a')](_0x57dae5[_0x6222('0x66')][_0x6222('0x7b')]))},client9002);return _0x57dae5;}return null;})[_0x6222('0x34')](respondWithResult(_0x108587,null))['catch'](handleError(_0x108587,null));}; \ No newline at end of file +var _0xa2e0=['reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','ChatMessage','includeAll','include','findAll','rows','show','params','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','ChatInteractionId','isNil','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','agent','fullname','email','internal','manual','interface','motionChannel','event','EventManager','acceptmessage','parse','formData','RejectMessage','contact','SIP/%s','channel','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','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','redis','localhost','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json'];(function(_0x3aa8b2,_0x5a11e3){var _0x6f394e=function(_0x254bb8){while(--_0x254bb8){_0x3aa8b2['push'](_0x3aa8b2['shift']());}};_0x6f394e(++_0x5a11e3);}(_0xa2e0,0x1e4));var _0x0a2e=function(_0x339798,_0x14d3b7){_0x339798=_0x339798-0x0;var _0x574b4e=_0xa2e0[_0x339798];return _0x574b4e;};'use strict';var emlformat=require(_0x0a2e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a2e('0x1'));var jsonpatch=require(_0x0a2e('0x2'));var rp=require(_0x0a2e('0x3'));var moment=require(_0x0a2e('0x4'));var BPromise=require(_0x0a2e('0x5'));var Mustache=require(_0x0a2e('0x6'));var util=require(_0x0a2e('0x7'));var path=require('path');var sox=require(_0x0a2e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a2e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0a2e('0xa'));var crypto=require(_0x0a2e('0xb'));var jsforce=require(_0x0a2e('0xc'));var deskjs=require(_0x0a2e('0xd'));var toCsv=require(_0x0a2e('0xe'));var querystring=require(_0x0a2e('0xf'));var Papa=require(_0x0a2e('0x10'));var Redis=require(_0x0a2e('0x11'));var authService=require(_0x0a2e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0a2e('0x13'));var hardwareService=require(_0x0a2e('0x14'));var logger=require(_0x0a2e('0x15'))(_0x0a2e('0x16'));var utils=require(_0x0a2e('0x17'));var config=require(_0x0a2e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a2e('0x19'))['db'];config[_0x0a2e('0x1a')]=_['defaults'](config[_0x0a2e('0x1a')],{'host':_0x0a2e('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a2e('0x1a')]));require('./chatMessage.socket')[_0x0a2e('0x1c')](socket);var jayson=require(_0x0a2e('0x1d'));var client=jayson[_0x0a2e('0x1e')][_0x0a2e('0x1f')]({'port':0x232c});var client9002=jayson[_0x0a2e('0x1e')][_0x0a2e('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2b1ed8,_0x4b6087,_0x537b12,_0x473326){return new BPromise(function(_0x119858,_0x514a13){var _0x3a262c=_0x473326||client;return _0x3a262c[_0x0a2e('0x20')](_0x2b1ed8,_0x537b12)[_0x0a2e('0x21')](function(_0xf58d){logger['info'](_0x0a2e('0x22'),_0x4b6087,_0x0a2e('0x23'));logger[_0x0a2e('0x24')](_0x0a2e('0x25'),_0x4b6087,_0x0a2e('0x23'),JSON[_0x0a2e('0x26')](_0xf58d));if(_0xf58d['error']){if(_0xf58d[_0x0a2e('0x27')]['code']===0x1f4){logger['error'](_0x0a2e('0x22'),_0x4b6087,_0xf58d[_0x0a2e('0x27')][_0x0a2e('0x28')]);return _0x514a13(_0xf58d[_0x0a2e('0x27')][_0x0a2e('0x28')]);}logger[_0x0a2e('0x27')](_0x0a2e('0x22'),_0x4b6087,_0xf58d[_0x0a2e('0x27')][_0x0a2e('0x28')]);return _0x119858(_0xf58d[_0x0a2e('0x27')][_0x0a2e('0x28')]);}else{logger['info'](_0x0a2e('0x22'),_0x4b6087,_0x0a2e('0x23'));_0x119858(_0xf58d[_0x0a2e('0x29')]['message']);}})[_0x0a2e('0x2a')](function(_0x11e0fa){logger[_0x0a2e('0x27')]('ChatMessage,\x20%s,\x20%s',_0x4b6087,_0x11e0fa);_0x514a13(_0x11e0fa);});});}function respondWithStatusCode(_0x643c05,_0x290d67){_0x290d67=_0x290d67||0xcc;return function(_0x23107c){if(_0x23107c){return _0x643c05[_0x0a2e('0x2b')](_0x290d67);}return _0x643c05[_0x0a2e('0x2c')](_0x290d67)[_0x0a2e('0x2d')]();};}function respondWithResult(_0xde2054,_0x55c766){_0x55c766=_0x55c766||0xc8;return function(_0x23732a){if(_0x23732a){return _0xde2054[_0x0a2e('0x2c')](_0x55c766)['json'](_0x23732a);}};}function respondWithFilteredResult(_0x5e3162,_0x146961){return function(_0x58e5b2){if(_0x58e5b2){var _0x5f3854=typeof _0x146961[_0x0a2e('0x2e')]==='undefined'&&typeof _0x146961[_0x0a2e('0x2f')]===_0x0a2e('0x30');var _0x2ecb7b=_0x58e5b2[_0x0a2e('0x31')];var _0x1fb83f=_0x5f3854?0x0:_0x146961[_0x0a2e('0x2e')];var _0x5b0b40=_0x5f3854?_0x58e5b2[_0x0a2e('0x31')]:_0x146961['offset']+_0x146961[_0x0a2e('0x2f')];var _0xf0d024;if(_0x5b0b40>=_0x2ecb7b){_0x5b0b40=_0x2ecb7b;_0xf0d024=0xc8;}else{_0xf0d024=0xce;}_0x5e3162['status'](_0xf0d024);return _0x5e3162['set'](_0x0a2e('0x32'),_0x1fb83f+'-'+_0x5b0b40+'/'+_0x2ecb7b)[_0x0a2e('0x33')](_0x58e5b2);}return null;};}function patchUpdates(_0x4eac0a){return function(_0x549810){try{jsonpatch['apply'](_0x549810,_0x4eac0a,!![]);}catch(_0x3212fe){return BPromise[_0x0a2e('0x34')](_0x3212fe);}return _0x549810[_0x0a2e('0x35')]();};}function saveUpdates(_0x576a19,_0x5ae69e){return function(_0x5d677a){if(_0x5d677a){return _0x5d677a[_0x0a2e('0x36')](_0x576a19)[_0x0a2e('0x21')](function(_0x156d1f){return _0x156d1f;});}return null;};}function removeEntity(_0x57b30b,_0x3def0a){return function(_0x4a5f40){if(_0x4a5f40){return _0x4a5f40[_0x0a2e('0x37')]()['then'](function(){_0x57b30b[_0x0a2e('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc97779,_0x577bf2){return function(_0x4929f4){if(!_0x4929f4){_0xc97779['sendStatus'](0x194);}return _0x4929f4;};}function handleError(_0x9294d8,_0x10c4f6){_0x10c4f6=_0x10c4f6||0x1f4;return function(_0x221b7f){logger[_0x0a2e('0x27')](_0x221b7f[_0x0a2e('0x38')]);if(_0x221b7f[_0x0a2e('0x39')]){delete _0x221b7f['name'];}_0x9294d8['status'](_0x10c4f6)[_0x0a2e('0x3a')](_0x221b7f);};}exports[_0x0a2e('0x3b')]=function(_0x5344b9,_0x2d121f){var _0x2c73a2={},_0x33118e={},_0x53953f={'count':0x0,'rows':[]};var _0x32454=_[_0x0a2e('0x3c')](db['ChatMessage'][_0x0a2e('0x3d')],function(_0x35b009){return{'name':_0x35b009[_0x0a2e('0x3e')],'type':_0x35b009[_0x0a2e('0x3f')]['key']};});_0x33118e[_0x0a2e('0x40')]=_[_0x0a2e('0x3c')](_0x32454,_0x0a2e('0x39'));_0x33118e[_0x0a2e('0x41')]=_[_0x0a2e('0x42')](_0x5344b9['query']);_0x33118e[_0x0a2e('0x43')]=_['intersection'](_0x33118e[_0x0a2e('0x40')],_0x33118e[_0x0a2e('0x41')]);_0x2c73a2[_0x0a2e('0x44')]=_[_0x0a2e('0x45')](_0x33118e[_0x0a2e('0x40')],qs[_0x0a2e('0x46')](_0x5344b9[_0x0a2e('0x41')][_0x0a2e('0x46')]));_0x2c73a2[_0x0a2e('0x44')]=_0x2c73a2[_0x0a2e('0x44')][_0x0a2e('0x47')]?_0x2c73a2[_0x0a2e('0x44')]:_0x33118e['model'];if(!_0x5344b9[_0x0a2e('0x41')]['hasOwnProperty'](_0x0a2e('0x48'))){_0x2c73a2[_0x0a2e('0x2f')]=qs[_0x0a2e('0x2f')](_0x5344b9['query'][_0x0a2e('0x2f')]);_0x2c73a2[_0x0a2e('0x2e')]=qs['offset'](_0x5344b9[_0x0a2e('0x41')][_0x0a2e('0x2e')]);}_0x2c73a2[_0x0a2e('0x49')]=qs[_0x0a2e('0x4a')](_0x5344b9['query']['sort']);_0x2c73a2[_0x0a2e('0x4b')]=qs[_0x0a2e('0x43')](_[_0x0a2e('0x4c')](_0x5344b9[_0x0a2e('0x41')],_0x33118e[_0x0a2e('0x43')]),_0x32454);if(_0x5344b9['query'][_0x0a2e('0x4d')]){_0x2c73a2[_0x0a2e('0x4b')]=_['merge'](_0x2c73a2[_0x0a2e('0x4b')],{'$or':_[_0x0a2e('0x3c')](_0x32454,function(_0x220680){if(_0x220680[_0x0a2e('0x3f')]!=='VIRTUAL'){var _0x2ff098={};_0x2ff098[_0x220680[_0x0a2e('0x39')]]={'$like':'%'+_0x5344b9['query'][_0x0a2e('0x4d')]+'%'};return _0x2ff098;}})});}_0x2c73a2=_[_0x0a2e('0x4e')]({},_0x2c73a2,_0x5344b9[_0x0a2e('0x4f')]);var _0x5843f3={'where':_0x2c73a2['where']};return db[_0x0a2e('0x50')][_0x0a2e('0x31')](_0x5843f3)['then'](function(_0x45e8c7){_0x53953f[_0x0a2e('0x31')]=_0x45e8c7;if(_0x5344b9[_0x0a2e('0x41')][_0x0a2e('0x51')]){_0x2c73a2[_0x0a2e('0x52')]=[{'all':!![]}];}return db[_0x0a2e('0x50')][_0x0a2e('0x53')](_0x2c73a2);})[_0x0a2e('0x21')](function(_0x3841e5){_0x53953f[_0x0a2e('0x54')]=_0x3841e5;return _0x53953f;})[_0x0a2e('0x21')](respondWithFilteredResult(_0x2d121f,_0x2c73a2))[_0x0a2e('0x2a')](handleError(_0x2d121f,null));};exports[_0x0a2e('0x55')]=function(_0x257203,_0x466834){var _0x1a246c={'raw':!![],'where':{'id':_0x257203[_0x0a2e('0x56')]['id']}},_0x4117bb={};_0x4117bb[_0x0a2e('0x40')]=_['keys'](db[_0x0a2e('0x50')]['rawAttributes']);_0x4117bb[_0x0a2e('0x41')]=_[_0x0a2e('0x42')](_0x257203[_0x0a2e('0x41')]);_0x4117bb[_0x0a2e('0x43')]=_['intersection'](_0x4117bb[_0x0a2e('0x40')],_0x4117bb[_0x0a2e('0x41')]);_0x1a246c[_0x0a2e('0x44')]=_[_0x0a2e('0x45')](_0x4117bb[_0x0a2e('0x40')],qs[_0x0a2e('0x46')](_0x257203[_0x0a2e('0x41')]['fields']));_0x1a246c[_0x0a2e('0x44')]=_0x1a246c[_0x0a2e('0x44')][_0x0a2e('0x47')]?_0x1a246c[_0x0a2e('0x44')]:_0x4117bb[_0x0a2e('0x40')];if(_0x257203[_0x0a2e('0x41')][_0x0a2e('0x51')]){_0x1a246c[_0x0a2e('0x52')]=[{'all':!![]}];}_0x1a246c=_[_0x0a2e('0x4e')]({},_0x1a246c,_0x257203['options']);return db[_0x0a2e('0x50')][_0x0a2e('0x57')](_0x1a246c)[_0x0a2e('0x21')](handleEntityNotFound(_0x466834,null))[_0x0a2e('0x21')](respondWithResult(_0x466834,null))[_0x0a2e('0x2a')](handleError(_0x466834,null));};exports[_0x0a2e('0x58')]=function(_0x4b9d48,_0x17e734){return db[_0x0a2e('0x50')][_0x0a2e('0x58')](_0x4b9d48[_0x0a2e('0x59')],{})[_0x0a2e('0x21')](respondWithResult(_0x17e734,0xc9))[_0x0a2e('0x2a')](handleError(_0x17e734,null));};exports[_0x0a2e('0x36')]=function(_0x4ffda3,_0x1b2296){if(_0x4ffda3['body']['id']){delete _0x4ffda3['body']['id'];}return db[_0x0a2e('0x50')][_0x0a2e('0x57')]({'where':{'id':_0x4ffda3[_0x0a2e('0x56')]['id']}})[_0x0a2e('0x21')](handleEntityNotFound(_0x1b2296,null))[_0x0a2e('0x21')](saveUpdates(_0x4ffda3[_0x0a2e('0x59')],null))[_0x0a2e('0x21')](respondWithResult(_0x1b2296,null))[_0x0a2e('0x2a')](handleError(_0x1b2296,null));};exports['destroy']=function(_0x7f04b8,_0x31b5f5){return db[_0x0a2e('0x50')][_0x0a2e('0x57')]({'where':{'id':_0x7f04b8[_0x0a2e('0x56')]['id']}})['then'](handleEntityNotFound(_0x31b5f5,null))[_0x0a2e('0x21')](removeEntity(_0x31b5f5,null))[_0x0a2e('0x2a')](handleError(_0x31b5f5,null));};exports[_0x0a2e('0x5a')]=function(_0x1f646d,_0x80bab1){return db[_0x0a2e('0x50')][_0x0a2e('0x5a')]()[_0x0a2e('0x21')](respondWithResult(_0x80bab1,null))[_0x0a2e('0x2a')](handleError(_0x80bab1,null));};var interaction_log=require(_0x0a2e('0x15'))(_0x0a2e('0x5b'));exports[_0x0a2e('0x5c')]=function(_0x29bd76,_0x49a7bc,_0x48ba7b){var _0xb74473={'agent':{},'channel':_0x0a2e('0x5d')};if(_0x29bd76[_0x0a2e('0x59')]['id']){delete _0x29bd76[_0x0a2e('0x59')]['id'];}_0x29bd76[_0x0a2e('0x59')][_0x0a2e('0x5e')]=!![];_0x29bd76[_0x0a2e('0x59')][_0x0a2e('0x5f')]=moment()[_0x0a2e('0x60')](_0x0a2e('0x61'));_0x29bd76[_0x0a2e('0x59')][_0x0a2e('0x62')]=_0x29bd76[_0x0a2e('0x59')][_0x0a2e('0x62')]||_0x29bd76['user']['id'];_0xb74473['agent']['id']=_0x29bd76[_0x0a2e('0x59')][_0x0a2e('0x62')];return db[_0x0a2e('0x50')][_0x0a2e('0x57')]({'where':{'id':_0x29bd76[_0x0a2e('0x56')]['id'],'UserId':null}})[_0x0a2e('0x21')](handleEntityNotFound(_0x49a7bc,null))[_0x0a2e('0x21')](saveUpdates(_0x29bd76[_0x0a2e('0x59')],null))[_0x0a2e('0x21')](function(_0x69bd4d){if(_0x69bd4d){_0xb74473['message']=_0x69bd4d[_0x0a2e('0x63')]({'plain':!![]});return db[_0x0a2e('0x64')][_0x0a2e('0x57')]({'where':{'id':_0x69bd4d[_0x0a2e('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x49a7bc,null))['then'](function(_0x34247d){if(_0x34247d){return _0x34247d[_0x0a2e('0x36')]({'UserId':_0x29bd76[_0x0a2e('0x59')][_0x0a2e('0x62')],'read1stAt':_[_0x0a2e('0x66')](_0x34247d['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a2e('0x21')](function(_0x1832c7){if(_0x1832c7){_0xb74473[_0x0a2e('0x67')]=_0x1832c7[_0x0a2e('0x63')]({'plain':!![]});interaction_log[_0x0a2e('0x68')](_0x0a2e('0x69'),_0x29bd76['user']['id'],_0x29bd76[_0x0a2e('0x6a')][_0x0a2e('0x39')],_0x29bd76[_0x0a2e('0x6a')][_0x0a2e('0x6b')],_0xb74473['interaction']['id'],_0x29bd76[_0x0a2e('0x59')]?JSON[_0x0a2e('0x26')](_0x29bd76['body']):_0x0a2e('0x6c'));return respondWithRpcPromise(_0x0a2e('0x6d'),_0x0a2e('0x6e'),_0xb74473);}return null;})['then'](function(_0x23dbd1){var _0xe2d878=_0x0a2e('0x6f')+_0x23dbd1[_0x0a2e('0x28')][_0x0a2e('0x70')];return db[_0x0a2e('0x71')]['query'](_0xe2d878,{'type':db[_0x0a2e('0x72')]['QueryTypes'][_0x0a2e('0x73')],'raw':!![]})[_0x0a2e('0x21')](function(_0x149b53){return _0x149b53;});})[_0x0a2e('0x21')](function(_0x2e52d6){if(_0x2e52d6){_0xb74473[_0x0a2e('0x28')]['contact']=_0x2e52d6[0x0];if(!_0x29bd76[_0x0a2e('0x59')][_0x0a2e('0x62')])return;return db[_0x0a2e('0x74')][_0x0a2e('0x57')]({'where':{'id':_0x29bd76['body'][_0x0a2e('0x62')],'role':_0x0a2e('0x75')},'attributes':['id','name',_0x0a2e('0x76'),_0x0a2e('0x77'),_0x0a2e('0x78')],'raw':!![]});}return null;})['then'](function(_0x6fbd63){if(!_0x6fbd63)return null;_0xb74473[_0x0a2e('0x28')][_0x0a2e('0x75')]=_0x6fbd63;return _0xb74473;})[_0x0a2e('0x21')](function(_0x4eb8ad){if(_0x4eb8ad){if(_0x29bd76[_0x0a2e('0x59')][_0x0a2e('0x79')]){_0xb74473['message'][_0x0a2e('0x7a')]=util[_0x0a2e('0x60')]('SIP/%s',_0x29bd76['user']['name']);_0xb74473[_0x0a2e('0x28')]['channel']=_0xb74473['channel'];_0xb74473['message'][_0x0a2e('0x7b')]=_0xb74473['channel'];_0xb74473['message'][_0x0a2e('0x7c')]='accept';return respondWithRpcPromise(_0x0a2e('0x7d'),'EventManager',{'event':_0x0a2e('0x7e'),'message':_[_0x0a2e('0x4e')](_0xb74473[_0x0a2e('0x28')],JSON[_0x0a2e('0x7f')](_0xb74473['interaction'][_0x0a2e('0x80')]))},client9002)[_0x0a2e('0x21')](function(){return _0xb74473;});}return _0xb74473;}return null;})[_0x0a2e('0x21')](respondWithResult(_0x49a7bc,null))[_0x0a2e('0x2a')](handleError(_0x49a7bc,null));};var interaction_log=require(_0x0a2e('0x15'))(_0x0a2e('0x5b'));exports[_0x0a2e('0x34')]=function(_0x192580,_0x2ecb01,_0x10c6c9){var _0x44d5d2={'agent':{},'channel':'chat'};if(_0x192580[_0x0a2e('0x59')]['id']){delete _0x192580[_0x0a2e('0x59')]['id'];}_0x192580['body'][_0x0a2e('0x62')]=_0x192580[_0x0a2e('0x59')]['UserId']||_0x192580['user']['id'];_0x44d5d2['agent']['id']=_0x192580[_0x0a2e('0x59')][_0x0a2e('0x62')];return db[_0x0a2e('0x50')][_0x0a2e('0x57')]({'where':{'id':_0x192580[_0x0a2e('0x56')]['id'],'UserId':null}})[_0x0a2e('0x21')](handleEntityNotFound(_0x2ecb01,null))[_0x0a2e('0x21')](function(_0x57178c){if(_0x57178c){_0x44d5d2[_0x0a2e('0x28')]=_0x57178c[_0x0a2e('0x63')]({'plain':!![]});return db[_0x0a2e('0x64')]['find']({'where':{'id':_0x57178c[_0x0a2e('0x65')]}});}return null;})[_0x0a2e('0x21')](handleEntityNotFound(_0x2ecb01,null))['then'](function(_0x924b08){if(_0x924b08){_0x44d5d2[_0x0a2e('0x67')]=_0x924b08[_0x0a2e('0x63')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x192580['user']['id'],_0x192580[_0x0a2e('0x6a')][_0x0a2e('0x39')],_0x192580[_0x0a2e('0x6a')][_0x0a2e('0x6b')],_0x44d5d2[_0x0a2e('0x67')]['id'],_0x192580[_0x0a2e('0x59')]?JSON[_0x0a2e('0x26')](_0x192580[_0x0a2e('0x59')]):_0x0a2e('0x6c'));return respondWithRpcPromise(_0x0a2e('0x81'),'rejectMessage',_0x44d5d2);}return null;})[_0x0a2e('0x21')](function(_0x55a978){var _0x443b2e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x55a978[_0x0a2e('0x28')][_0x0a2e('0x70')];return db['sequelize'][_0x0a2e('0x41')](_0x443b2e,{'type':db['Sequelize']['QueryTypes'][_0x0a2e('0x73')],'raw':!![]})['then'](function(_0x335169){return _0x335169;});})[_0x0a2e('0x21')](function(_0x59d0b9){if(_0x59d0b9){_0x44d5d2[_0x0a2e('0x28')][_0x0a2e('0x82')]=_0x59d0b9[0x0];if(!_0x192580['body']['UserId'])return;return db[_0x0a2e('0x74')]['find']({'where':{'id':_0x192580[_0x0a2e('0x59')][_0x0a2e('0x62')],'role':_0x0a2e('0x75')},'attributes':['id','name',_0x0a2e('0x76'),'email',_0x0a2e('0x78')],'raw':!![]});}return null;})['then'](function(_0x5ce9bd){if(!_0x5ce9bd)return null;_0x44d5d2[_0x0a2e('0x28')]['agent']=_0x5ce9bd;return _0x44d5d2;})[_0x0a2e('0x21')](function(_0x26ed7d){if(_0x26ed7d){_0x26ed7d['message'][_0x0a2e('0x7a')]=util[_0x0a2e('0x60')](_0x0a2e('0x83'),_0x192580[_0x0a2e('0x6a')]['name']);_0x26ed7d[_0x0a2e('0x28')][_0x0a2e('0x84')]=_0x44d5d2['channel'];_0x26ed7d['message'][_0x0a2e('0x7b')]=_0x44d5d2[_0x0a2e('0x84')];_0x26ed7d[_0x0a2e('0x28')]['event']=_0x0a2e('0x34');respondWithRpcPromise(_0x0a2e('0x7d'),_0x0a2e('0x7d'),{'event':_0x0a2e('0x85'),'message':_[_0x0a2e('0x4e')](_0x44d5d2['message'],JSON[_0x0a2e('0x7f')](_0x44d5d2['interaction'][_0x0a2e('0x80')]))},client9002);return _0x44d5d2;}return null;})[_0x0a2e('0x21')](respondWithResult(_0x2ecb01,null))['catch'](handleError(_0x2ecb01,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 61b793c..15b4af6 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 _0x9ca8=['remove','emit','hook','events','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x5b3b9c,_0x5698b7){var _0x42e769=function(_0x2bbf27){while(--_0x2bbf27){_0x5b3b9c['push'](_0x5b3b9c['shift']());}};_0x42e769(++_0x5698b7);}(_0x9ca8,0xf6));var _0x89ca=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0x9ca8[_0x4695ba];return _0x524b7d;};'use strict';var EventEmitter=require(_0x89ca('0x0'));var ChatMessage=require(_0x89ca('0x1'))['db'][_0x89ca('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x89ca('0x3')](0x0);var events={'afterCreate':_0x89ca('0x4'),'afterUpdate':_0x89ca('0x5'),'afterDestroy':_0x89ca('0x6')};function emitEvent(_0x3758f3){return function(_0x1e2af1,_0x4462c3,_0x437aee){ChatMessageEvents['emit'](_0x3758f3+':'+_0x1e2af1['id'],_0x1e2af1);ChatMessageEvents[_0x89ca('0x7')](_0x3758f3,_0x1e2af1);_0x437aee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x89ca('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0xab48=['save','remove','emit','hasOwnProperty','hook','exports','ChatMessage','setMaxListeners'];(function(_0x380667,_0x863bc8){var _0x114eed=function(_0x4127a4){while(--_0x4127a4){_0x380667['push'](_0x380667['shift']());}};_0x114eed(++_0x863bc8);}(_0xab48,0x156));var _0x8ab4=function(_0x3dc538,_0x4f7702){_0x3dc538=_0x3dc538-0x0;var _0x72c2fd=_0xab48[_0x3dc538];return _0x72c2fd;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x8ab4('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8ab4('0x1')](0x0);var events={'afterCreate':_0x8ab4('0x2'),'afterUpdate':'update','afterDestroy':_0x8ab4('0x3')};function emitEvent(_0x5ad2a5){return function(_0x3e1ece,_0x5da763,_0x27355e){ChatMessageEvents['emit'](_0x5ad2a5+':'+_0x3e1ece['id'],_0x3e1ece);ChatMessageEvents[_0x8ab4('0x4')](_0x5ad2a5,_0x3e1ece);_0x27355e(null);};}for(var e in events){if(events[_0x8ab4('0x5')](e)){var event=events[e];ChatMessage[_0x8ab4('0x6')](e,emitEvent(event));}}module[_0x8ab4('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 7e5867a..e2f977c 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 _0xb2b1=['path','rimraf','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x55a317,_0x454d14){var _0x217680=function(_0x47d962){while(--_0x47d962){_0x55a317['push'](_0x55a317['shift']());}};_0x217680(++_0x454d14);}(_0xb2b1,0x190));var _0x1b2b=function(_0x179a65,_0x16a31b){_0x179a65=_0x179a65-0x0;var _0x2cff46=_0xb2b1[_0x179a65];return _0x2cff46;};'use strict';var _=require(_0x1b2b('0x0'));var util=require(_0x1b2b('0x1'));var logger=require(_0x1b2b('0x2'))(_0x1b2b('0x3'));var moment=require(_0x1b2b('0x4'));var BPromise=require(_0x1b2b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b2b('0x6'));var rimraf=require(_0x1b2b('0x7'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0x1b2b('0x8')]=function(_0x298b57,_0x4587ba){return _0x298b57[_0x1b2b('0x9')](_0x1b2b('0xa'),attributes,{'tableName':_0x1b2b('0xb'),'paranoid':![],'indexes':[{'name':_0x1b2b('0xc'),'fields':[_0x1b2b('0xd')],'type':_0x1b2b('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x517ce5,_0x2f116f,_0x309ff9){var _0x52a32d=_0x298b57['models'];var _0x58e8d8=_0x517ce5[_0x1b2b('0xf')]({'plain':!![]});if(_0x58e8d8[_0x1b2b('0x10')]['toLowerCase']()==='in'||_0x58e8d8[_0x1b2b('0x10')][_0x1b2b('0x11')]()===_0x1b2b('0x12')&&!_0x58e8d8[_0x1b2b('0x13')]&&!_['isNil'](_0x58e8d8[_0x1b2b('0x14')])){_0x52a32d[_0x1b2b('0x15')][_0x1b2b('0x16')]({'where':{'id':_0x58e8d8[_0x1b2b('0x17')]}})[_0x1b2b('0x18')](function(_0x4e02e5){if(_0x4e02e5){_0x4e02e5[_0x1b2b('0x19')]({'lastMsgAt':_0x58e8d8[_0x1b2b('0x1a')],'lastMsgDirection':_0x58e8d8['direction']['toLowerCase']()});}})['catch'](function(_0x3f1624){console['error'](_0x3f1624);});}_0x309ff9();}},'charset':_0x1b2b('0x1b'),'collate':_0x1b2b('0x1c')});}; \ No newline at end of file +var _0xb0ff=['bluebird','request-promise','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb0ff,0xb3));var _0xfb0f=function(_0x20c0d1,_0x1d76b5){_0x20c0d1=_0x20c0d1-0x0;var _0x2dc2f3=_0xb0ff[_0x20c0d1];return _0x2dc2f3;};'use strict';var _=require('lodash');var util=require(_0xfb0f('0x0'));var logger=require(_0xfb0f('0x1'))('api');var moment=require(_0xfb0f('0x2'));var BPromise=require(_0xfb0f('0x3'));var rp=require(_0xfb0f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb0f('0x5'));var config=require('../../config/environment');var attributes=require(_0xfb0f('0x6'));module[_0xfb0f('0x7')]=function(_0x334b59,_0x2583f8){return _0x334b59[_0xfb0f('0x8')](_0xfb0f('0x9'),attributes,{'tableName':_0xfb0f('0xa'),'paranoid':![],'indexes':[{'name':_0xfb0f('0xb'),'fields':['body'],'type':_0xfb0f('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a9323,_0x979445,_0xd17401){var _0x28907c=_0x334b59['models'];var _0xfe7436=_0x1a9323[_0xfb0f('0xd')]({'plain':!![]});if(_0xfe7436[_0xfb0f('0xe')]['toLowerCase']()==='in'||_0xfe7436[_0xfb0f('0xe')][_0xfb0f('0xf')]()===_0xfb0f('0x10')&&!_0xfe7436['secret']&&!_[_0xfb0f('0x11')](_0xfe7436[_0xfb0f('0x12')])){_0x28907c[_0xfb0f('0x13')]['findOne']({'where':{'id':_0xfe7436['ChatInteractionId']}})[_0xfb0f('0x14')](function(_0x45ea50){if(_0x45ea50){_0x45ea50[_0xfb0f('0x15')]({'lastMsgAt':_0xfe7436[_0xfb0f('0x16')],'lastMsgDirection':_0xfe7436[_0xfb0f('0xe')]['toLowerCase']()});}})['catch'](function(_0x34bf7b){console[_0xfb0f('0x17')](_0x34bf7b);});}_0xd17401();}},'charset':_0xfb0f('0x18'),'collate':_0xfb0f('0x19')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index b280b82..72e1e0f 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 _0xb6f9=['body','options','raw','then','stringify','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','request\x20sent','debug','error','code','ChatMessage,\x20%s,\x20%s','message','catch','CreateChatMessage','ChatMessage'];(function(_0x26a682,_0x4319b7){var _0x18a562=function(_0x235879){while(--_0x235879){_0x26a682['push'](_0x26a682['shift']());}};_0x18a562(++_0x4319b7);}(_0xb6f9,0x145));var _0x9b6f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb6f9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9b6f('0x0'));var moment=require(_0x9b6f('0x1'));var BPromise=require(_0x9b6f('0x2'));var rs=require(_0x9b6f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9b6f('0x4'))(_0x9b6f('0x5'));var config=require(_0x9b6f('0x6'));var jayson=require(_0x9b6f('0x7'));var client=jayson[_0x9b6f('0x8')][_0x9b6f('0x9')]({'port':0x232a});config['redis']=_[_0x9b6f('0xa')](config[_0x9b6f('0xb')],{'host':_0x9b6f('0xc'),'port':0x18eb});var socket=require(_0x9b6f('0xd'))(new Redis(config[_0x9b6f('0xb')]));require(_0x9b6f('0xe'))[_0x9b6f('0xf')](socket);function respondWithRpcPromise(_0x36f708,_0xd923fd,_0x45d24e){return new BPromise(function(_0x239847,_0x2c4637){return client[_0x9b6f('0x10')](_0x36f708,_0x45d24e)['then'](function(_0x58c080){logger[_0x9b6f('0x11')]('ChatMessage,\x20%s,\x20%s',_0xd923fd,_0x9b6f('0x12'));logger[_0x9b6f('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0xd923fd,'request\x20sent',JSON['stringify'](_0x58c080));if(_0x58c080['error']){if(_0x58c080[_0x9b6f('0x14')][_0x9b6f('0x15')]===0x1f4){logger[_0x9b6f('0x14')](_0x9b6f('0x16'),_0xd923fd,_0x58c080['error'][_0x9b6f('0x17')]);return _0x2c4637(_0x58c080[_0x9b6f('0x14')][_0x9b6f('0x17')]);}logger['error'](_0x9b6f('0x16'),_0xd923fd,_0x58c080[_0x9b6f('0x14')][_0x9b6f('0x17')]);return _0x239847(_0x58c080[_0x9b6f('0x14')][_0x9b6f('0x17')]);}else{logger[_0x9b6f('0x11')](_0x9b6f('0x16'),_0xd923fd,_0x9b6f('0x12'));_0x239847(_0x58c080['result'][_0x9b6f('0x17')]);}})[_0x9b6f('0x18')](function(_0x1d2a25){logger[_0x9b6f('0x14')](_0x9b6f('0x16'),_0xd923fd,_0x1d2a25);_0x2c4637(_0x1d2a25);});});}exports[_0x9b6f('0x19')]=function(_0x19832e){var _0x2f5ce2=this;return new Promise(function(_0xaf4273,_0x1605f9){return db[_0x9b6f('0x1a')]['create'](_0x19832e[_0x9b6f('0x1b')],{'raw':_0x19832e[_0x9b6f('0x1c')]?_0x19832e['options'][_0x9b6f('0x1d')]===undefined?!![]:![]:!![]})[_0x9b6f('0x1e')](function(_0x461200){logger[_0x9b6f('0x11')](_0x9b6f('0x19'),_0x19832e);logger[_0x9b6f('0x13')]('CreateChatMessage',_0x19832e,JSON[_0x9b6f('0x1f')](_0x461200));_0xaf4273(_0x461200);})['catch'](function(_0x236a4d){logger[_0x9b6f('0x14')](_0x9b6f('0x19'),_0x236a4d[_0x9b6f('0x17')],_0x19832e);_0x1605f9(_0x2f5ce2[_0x9b6f('0x14')](0x1f4,_0x236a4d[_0x9b6f('0x17')]));});});}; \ No newline at end of file +var _0x7d53=['defaults','localhost','./chatMessage.socket','register','request','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','CreateChatMessage','ChatMessage','create','body','options','then','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','redis'];(function(_0x129b99,_0x169e1a){var _0x3aaa57=function(_0x1673a2){while(--_0x1673a2){_0x129b99['push'](_0x129b99['shift']());}};_0x3aaa57(++_0x169e1a);}(_0x7d53,0x1b9));var _0x37d5=function(_0x12f80c,_0x56b096){_0x12f80c=_0x12f80c-0x0;var _0x3cb84d=_0x7d53[_0x12f80c];return _0x3cb84d;};'use strict';var _=require(_0x37d5('0x0'));var util=require(_0x37d5('0x1'));var moment=require(_0x37d5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37d5('0x3'));var db=require(_0x37d5('0x4'))['db'];var utils=require(_0x37d5('0x5'));var logger=require('../../config/logger')(_0x37d5('0x6'));var config=require('../../config/environment');var jayson=require(_0x37d5('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x37d5('0x8')]=_[_0x37d5('0x9')](config['redis'],{'host':_0x37d5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37d5('0x8')]));require(_0x37d5('0xb'))[_0x37d5('0xc')](socket);function respondWithRpcPromise(_0x24451d,_0x5c3f83,_0x3defd8){return new BPromise(function(_0x183c63,_0x331cee){return client[_0x37d5('0xd')](_0x24451d,_0x3defd8)['then'](function(_0x29ddb0){logger['info']('ChatMessage,\x20%s,\x20%s',_0x5c3f83,_0x37d5('0xe'));logger[_0x37d5('0xf')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5c3f83,_0x37d5('0xe'),JSON[_0x37d5('0x10')](_0x29ddb0));if(_0x29ddb0[_0x37d5('0x11')]){if(_0x29ddb0['error'][_0x37d5('0x12')]===0x1f4){logger[_0x37d5('0x11')](_0x37d5('0x13'),_0x5c3f83,_0x29ddb0[_0x37d5('0x11')]['message']);return _0x331cee(_0x29ddb0['error'][_0x37d5('0x14')]);}logger[_0x37d5('0x11')]('ChatMessage,\x20%s,\x20%s',_0x5c3f83,_0x29ddb0[_0x37d5('0x11')]['message']);return _0x183c63(_0x29ddb0[_0x37d5('0x11')]['message']);}else{logger[_0x37d5('0x15')]('ChatMessage,\x20%s,\x20%s',_0x5c3f83,_0x37d5('0xe'));_0x183c63(_0x29ddb0[_0x37d5('0x16')][_0x37d5('0x14')]);}})[_0x37d5('0x17')](function(_0x324794){logger[_0x37d5('0x11')](_0x37d5('0x13'),_0x5c3f83,_0x324794);_0x331cee(_0x324794);});});}exports[_0x37d5('0x18')]=function(_0x536aeb){var _0x3efc36=this;return new Promise(function(_0x59fa49,_0x4b0ff4){return db[_0x37d5('0x19')][_0x37d5('0x1a')](_0x536aeb[_0x37d5('0x1b')],{'raw':_0x536aeb['options']?_0x536aeb[_0x37d5('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x37d5('0x1d')](function(_0x44715e){logger[_0x37d5('0x15')](_0x37d5('0x18'),_0x536aeb);logger[_0x37d5('0xf')](_0x37d5('0x18'),_0x536aeb,JSON[_0x37d5('0x10')](_0x44715e));_0x59fa49(_0x44715e);})['catch'](function(_0x224f26){logger[_0x37d5('0x11')](_0x37d5('0x18'),_0x224f26[_0x37d5('0x14')],_0x536aeb);_0x4b0ff4(_0x3efc36[_0x37d5('0x11')](0x1f4,_0x224f26[_0x37d5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index f11485d..07c8951 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 _0x6108=['register','chatMessage:','./chatMessage.events','remove','update','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6108,0xbc));var _0x8610=function(_0x139bcf,_0x43779b){_0x139bcf=_0x139bcf-0x0;var _0x143cc3=_0x6108[_0x139bcf];return _0x143cc3;};'use strict';var ChatMessageEvents=require(_0x8610('0x0'));var events=['save',_0x8610('0x1'),_0x8610('0x2')];function createListener(_0x19a0a6,_0x49e7c9){return function(_0x4a9c20){_0x49e7c9[_0x8610('0x3')](_0x19a0a6,_0x4a9c20);};}function removeListener(_0x42741d,_0x54802f){return function(){ChatMessageEvents['removeListener'](_0x42741d,_0x54802f);};}exports[_0x8610('0x4')]=function(_0x1ca62b){for(var _0x28a680=0x0,_0x26dab3=events['length'];_0x28a680<_0x26dab3;_0x28a680++){var _0x174f41=events[_0x28a680];var _0x49e0a2=createListener(_0x8610('0x5')+_0x174f41,_0x1ca62b);ChatMessageEvents['on'](_0x174f41,_0x49e0a2);}}; \ No newline at end of file +var _0x8ef6=['length','chatMessage:','./chatMessage.events','save','remove','update','removeListener','register'];(function(_0x90f100,_0x20511d){var _0x2076da=function(_0x15aa9c){while(--_0x15aa9c){_0x90f100['push'](_0x90f100['shift']());}};_0x2076da(++_0x20511d);}(_0x8ef6,0xf2));var _0x68ef=function(_0x588028,_0x34c872){_0x588028=_0x588028-0x0;var _0x551202=_0x8ef6[_0x588028];return _0x551202;};'use strict';var ChatMessageEvents=require(_0x68ef('0x0'));var events=[_0x68ef('0x1'),_0x68ef('0x2'),_0x68ef('0x3')];function createListener(_0x2cc97b,_0x44e0d3){return function(_0x3411a2){_0x44e0d3['emit'](_0x2cc97b,_0x3411a2);};}function removeListener(_0x27d0af,_0x129ce){return function(){ChatMessageEvents[_0x68ef('0x4')](_0x27d0af,_0x129ce);};}exports[_0x68ef('0x5')]=function(_0x4d26e3){for(var _0x4f77f3=0x0,_0x3c2ff3=events[_0x68ef('0x6')];_0x4f77f3<_0x3c2ff3;_0x4f77f3++){var _0x2de776=events[_0x4f77f3];var _0x4eb5eb=createListener(_0x68ef('0x7')+_0x2de776,_0x4d26e3);ChatMessageEvents['on'](_0x2de776,_0x4eb5eb);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 26afe79..0255da4 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 _0x1322=['reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','chat','chatmessage:create','create','update','put','/:id/accept','accept','/:id/reject'];(function(_0x54ff03,_0x49684c){var _0x52eef7=function(_0x515fff){while(--_0x515fff){_0x54ff03['push'](_0x54ff03['shift']());}};_0x52eef7(++_0x49684c);}(_0x1322,0x1d3));var _0x2132=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x1322[_0x17406a];return _0x1501ff;};'use strict';var multer=require(_0x2132('0x0'));var util=require(_0x2132('0x1'));var path=require(_0x2132('0x2'));var timeout=require(_0x2132('0x3'));var express=require(_0x2132('0x4'));var router=express[_0x2132('0x5')]();var fs_extra=require(_0x2132('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2132('0x7'));var config=require(_0x2132('0x8'));var controller=require(_0x2132('0x9'));router[_0x2132('0xa')]('/',auth[_0x2132('0xb')](),controller[_0x2132('0xc')]);router[_0x2132('0xa')](_0x2132('0xd'),auth['isAuthenticated'](),controller[_0x2132('0xe')]);router[_0x2132('0xa')](_0x2132('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x2132('0x10')]('/',auth['isAuthenticated'](),interaction[_0x2132('0x11')](_0x2132('0x12'),_0x2132('0x13')),controller[_0x2132('0x14')]);router['put'](_0x2132('0xf'),controller[_0x2132('0x15')]);router[_0x2132('0x16')](_0x2132('0x17'),auth['isAuthenticated'](),controller[_0x2132('0x18')]);router[_0x2132('0x16')](_0x2132('0x19'),auth[_0x2132('0xb')](),controller[_0x2132('0x1a')]);router[_0x2132('0x1b')](_0x2132('0xf'),auth[_0x2132('0xb')](),controller[_0x2132('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x6e1d=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','tracked','chat','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x195eb3,_0x59180c){var _0x36ea03=function(_0x5f583d){while(--_0x5f583d){_0x195eb3['push'](_0x195eb3['shift']());}};_0x36ea03(++_0x59180c);}(_0x6e1d,0x132));var _0xd6e1=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0x6e1d[_0x355ce8];return _0x1db8b8;};'use strict';var multer=require(_0xd6e1('0x0'));var util=require(_0xd6e1('0x1'));var path=require('path');var timeout=require(_0xd6e1('0x2'));var express=require(_0xd6e1('0x3'));var router=express['Router']();var fs_extra=require(_0xd6e1('0x4'));var auth=require(_0xd6e1('0x5'));var interaction=require(_0xd6e1('0x6'));var config=require(_0xd6e1('0x7'));var controller=require('./chatMessage.controller');router[_0xd6e1('0x8')]('/',auth[_0xd6e1('0x9')](),controller['index']);router['get'](_0xd6e1('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xd6e1('0x8')](_0xd6e1('0xb'),auth['isAuthenticated'](),controller[_0xd6e1('0xc')]);router[_0xd6e1('0xd')]('/',auth[_0xd6e1('0x9')](),interaction[_0xd6e1('0xe')](_0xd6e1('0xf'),'chatmessage:create'),controller[_0xd6e1('0x10')]);router[_0xd6e1('0x11')](_0xd6e1('0xb'),controller[_0xd6e1('0x12')]);router[_0xd6e1('0x11')](_0xd6e1('0x13'),auth['isAuthenticated'](),controller[_0xd6e1('0x14')]);router[_0xd6e1('0x11')](_0xd6e1('0x15'),auth[_0xd6e1('0x9')](),controller[_0xd6e1('0x16')]);router[_0xd6e1('0x17')](_0xd6e1('0xb'),auth[_0xd6e1('0x9')](),controller[_0xd6e1('0x18')]);module[_0xd6e1('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 7cad98a..7472de0 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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x3c705c,_0x4b7a52){var _0x530a9e=function(_0x8bd485){while(--_0x8bd485){_0x3c705c['push'](_0x3c705c['shift']());}};_0x530a9e(++_0x4b7a52);}(_0xb10b,0x12a));var _0xbb10=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xb10b[_0x256b72];return _0x2183e3;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x2032=['medium','exports','TEXT'];(function(_0x3ece4e,_0x3585fb){var _0x52decd=function(_0x1f78d5){while(--_0x1f78d5){_0x3ece4e['push'](_0x3ece4e['shift']());}};_0x52decd(++_0x3585fb);}(_0x2032,0xd9));var _0x2203=function(_0x304340,_0x1f9cb6){_0x304340=_0x304340-0x0;var _0x379f25=_0x2032[_0x304340];return _0x379f25;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index d6c62b2..731d384 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2ab4d6,_0x2e501d){var _0x1666f4=function(_0x96d727){while(--_0x96d727){_0x2ab4d6['push'](_0x2ab4d6['shift']());}};_0x1666f4(++_0x2e501d);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x7a54,0x106));var _0x47a5=function(_0x1b322d,_0x1525dc){_0x1b322d=_0x1b322d-0x0;var _0x51ea67=_0x7a54[_0x1b322d];return _0x51ea67;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 33e2558..59f4ff1 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3408=['exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x23729c,_0x26718d){var _0x7fa9ca=function(_0x513933){while(--_0x513933){_0x23729c['push'](_0x23729c['shift']());}};_0x7fa9ca(++_0x26718d);}(_0x3408,0x177));var _0x8340=function(_0x59c60e,_0x58abdc){_0x59c60e=_0x59c60e-0x0;var _0x199ee4=_0x3408[_0x59c60e];return _0x199ee4;};'use strict';var EventEmitter=require(_0x8340('0x0'));var ChatOfflineMessage=require(_0x8340('0x1'))['db'][_0x8340('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x8340('0x3')](0x0);var events={'afterCreate':_0x8340('0x4'),'afterUpdate':_0x8340('0x5'),'afterDestroy':_0x8340('0x6')};function emitEvent(_0x3c8360){return function(_0x1ca22c,_0x33ee17,_0x67180){ChatOfflineMessageEvents[_0x8340('0x7')](_0x3c8360+':'+_0x1ca22c['id'],_0x1ca22c);ChatOfflineMessageEvents[_0x8340('0x7')](_0x3c8360,_0x1ca22c);_0x67180(null);};}for(var e in events){if(events[_0x8340('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x8340('0x9')](e,emitEvent(event));}}module[_0x8340('0xa')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x0618=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x38fa3f,_0x32e02d){var _0x351d29=function(_0x3bd49e){while(--_0x3bd49e){_0x38fa3f['push'](_0x38fa3f['shift']());}};_0x351d29(++_0x32e02d);}(_0x0618,0x1c6));var _0x8061=function(_0xa83097,_0x15f383){_0xa83097=_0xa83097-0x0;var _0x15fd69=_0x0618[_0xa83097];return _0x15fd69;};'use strict';var EventEmitter=require(_0x8061('0x0'));var ChatOfflineMessage=require(_0x8061('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x8061('0x2')](0x0);var events={'afterCreate':_0x8061('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x32ff20){return function(_0x6aff35,_0x382b13,_0x2683db){ChatOfflineMessageEvents[_0x8061('0x4')](_0x32ff20+':'+_0x6aff35['id'],_0x6aff35);ChatOfflineMessageEvents[_0x8061('0x4')](_0x32ff20,_0x6aff35);_0x2683db(null);};}for(var e in events){if(events[_0x8061('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x8061('0x6')](e,emitEvent(event));}}module[_0x8061('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index c05a60f..4965371 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 _0xde59=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','ChatOfflineMessage','utf8mb4'];(function(_0x3c30f7,_0x5c663f){var _0xabf72e=function(_0x1eb9d0){while(--_0x1eb9d0){_0x3c30f7['push'](_0x3c30f7['shift']());}};_0xabf72e(++_0x5c663f);}(_0xde59,0x175));var _0x9de5=function(_0x46672b,_0x3943d2){_0x46672b=_0x46672b-0x0;var _0x13af10=_0xde59[_0x46672b];return _0x13af10;};'use strict';var attributes=require(_0x9de5('0x0'));module['exports']=function(_0x29e249){return _0x29e249['define'](_0x9de5('0x1'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9de5('0x2'),'collate':_0x9de5('0x3')});}; \ No newline at end of file +var _0x9756=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9756,0x1c0));var _0x6975=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x9756[_0x556927];return _0x5f1235;};'use strict';var attributes=require(_0x6975('0x0'));module[_0x6975('0x1')]=function(_0x2739be){return _0x2739be['define'](_0x6975('0x2'),attributes,{'tableName':_0x6975('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6975('0x4'),'collate':_0x6975('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 3c9c2c9..55b04a2 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 _0x06bf=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment'];(function(_0x5f0c5f,_0x1a58ae){var _0x2112e3=function(_0x419017){while(--_0x419017){_0x5f0c5f['push'](_0x5f0c5f['shift']());}};_0x2112e3(++_0x1a58ae);}(_0x06bf,0x105));var _0xf06b=function(_0x1a23d3,_0x19d8c0){_0x1a23d3=_0x1a23d3-0x0;var _0x14fff5=_0x06bf[_0x1a23d3];return _0x14fff5;};'use strict';var _=require(_0xf06b('0x0'));var util=require(_0xf06b('0x1'));var moment=require(_0xf06b('0x2'));var BPromise=require(_0xf06b('0x3'));var rs=require(_0xf06b('0x4'));var fs=require('fs');var Redis=require(_0xf06b('0x5'));var db=require(_0xf06b('0x6'))['db'];var utils=require(_0xf06b('0x7'));var logger=require('../../config/logger')(_0xf06b('0x8'));var config=require(_0xf06b('0x9'));var jayson=require(_0xf06b('0xa'));var client=jayson['client'][_0xf06b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb69d30,_0x2458d6,_0x7a4950){return new BPromise(function(_0x5196ed,_0x158086){return client[_0xf06b('0xc')](_0xb69d30,_0x7a4950)['then'](function(_0x531593){logger[_0xf06b('0xd')](_0xf06b('0xe'),_0x2458d6,_0xf06b('0xf'));logger[_0xf06b('0x10')](_0xf06b('0x11'),_0x2458d6,_0xf06b('0xf'),JSON[_0xf06b('0x12')](_0x531593));if(_0x531593[_0xf06b('0x13')]){if(_0x531593['error']['code']===0x1f4){logger['error'](_0xf06b('0xe'),_0x2458d6,_0x531593[_0xf06b('0x13')]['message']);return _0x158086(_0x531593['error'][_0xf06b('0x14')]);}logger[_0xf06b('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2458d6,_0x531593[_0xf06b('0x13')][_0xf06b('0x14')]);return _0x5196ed(_0x531593[_0xf06b('0x13')]['message']);}else{logger[_0xf06b('0xd')](_0xf06b('0xe'),_0x2458d6,_0xf06b('0xf'));_0x5196ed(_0x531593['result'][_0xf06b('0x14')]);}})[_0xf06b('0x15')](function(_0x1559ef){logger[_0xf06b('0x13')](_0xf06b('0xe'),_0x2458d6,_0x1559ef);_0x158086(_0x1559ef);});});} \ No newline at end of file +var _0xc023=['client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1cdf4e,_0x3ca200){var _0x223592=function(_0xe259e5){while(--_0xe259e5){_0x1cdf4e['push'](_0x1cdf4e['shift']());}};_0x223592(++_0x3ca200);}(_0xc023,0x162));var _0x3c02=function(_0x5bd431,_0x5bc0d0){_0x5bd431=_0x5bd431-0x0;var _0x263dd5=_0xc023[_0x5bd431];return _0x263dd5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3c02('0x0'));var BPromise=require(_0x3c02('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c02('0x2'))['db'];var utils=require(_0x3c02('0x3'));var logger=require(_0x3c02('0x4'))(_0x3c02('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3c02('0x6')][_0x3c02('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2675f2,_0x530fb5,_0x4cb4d5){return new BPromise(function(_0x3dd58f,_0x2dd82d){return client['request'](_0x2675f2,_0x4cb4d5)[_0x3c02('0x8')](function(_0x14f51e){logger[_0x3c02('0x9')](_0x3c02('0xa'),_0x530fb5,_0x3c02('0xb'));logger['debug'](_0x3c02('0xc'),_0x530fb5,_0x3c02('0xb'),JSON[_0x3c02('0xd')](_0x14f51e));if(_0x14f51e[_0x3c02('0xe')]){if(_0x14f51e[_0x3c02('0xe')][_0x3c02('0xf')]===0x1f4){logger[_0x3c02('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x530fb5,_0x14f51e['error'][_0x3c02('0x10')]);return _0x2dd82d(_0x14f51e['error'][_0x3c02('0x10')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x530fb5,_0x14f51e['error'][_0x3c02('0x10')]);return _0x3dd58f(_0x14f51e[_0x3c02('0xe')][_0x3c02('0x10')]);}else{logger['info'](_0x3c02('0xa'),_0x530fb5,_0x3c02('0xb'));_0x3dd58f(_0x14f51e['result'][_0x3c02('0x10')]);}})[_0x3c02('0x11')](function(_0x56f9b3){logger[_0x3c02('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x530fb5,_0x56f9b3);_0x2dd82d(_0x56f9b3);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 6619a6d..b960b98 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 _0xb4d6=['describe','get','/:id','post','create','put','update','delete','destroy','exports','multer','express','Router','../../components/auth/service','./chatOfflineMessage.controller','isAuthenticated','/describe'];(function(_0xfa7ae8,_0x1286a9){var _0x3f698c=function(_0x96e55){while(--_0x96e55){_0xfa7ae8['push'](_0xfa7ae8['shift']());}};_0x3f698c(++_0x1286a9);}(_0xb4d6,0x70));var _0x6b4d=function(_0x50e89b,_0x4bded8){_0x50e89b=_0x50e89b-0x0;var _0x4b9202=_0xb4d6[_0x50e89b];return _0x4b9202;};'use strict';var multer=require(_0x6b4d('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b4d('0x1'));var router=express[_0x6b4d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6b4d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6b4d('0x4'));router['get']('/',auth[_0x6b4d('0x5')](),controller['index']);router['get'](_0x6b4d('0x6'),auth['isAuthenticated'](),controller[_0x6b4d('0x7')]);router[_0x6b4d('0x8')](_0x6b4d('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x6b4d('0xa')]('/',auth[_0x6b4d('0x5')](),controller[_0x6b4d('0xb')]);router[_0x6b4d('0xc')](_0x6b4d('0x9'),auth[_0x6b4d('0x5')](),controller[_0x6b4d('0xd')]);router[_0x6b4d('0xe')](_0x6b4d('0x9'),auth[_0x6b4d('0x5')](),controller[_0x6b4d('0xf')]);module[_0x6b4d('0x10')]=router; \ No newline at end of file +var _0x7640=['describe','/:id','show','post','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe'];(function(_0x281ca5,_0x46f921){var _0x796a84=function(_0x50ebca){while(--_0x50ebca){_0x281ca5['push'](_0x281ca5['shift']());}};_0x796a84(++_0x46f921);}(_0x7640,0xe4));var _0x0764=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x7640[_0xda464c];return _0x19e222;};'use strict';var multer=require(_0x0764('0x0'));var util=require('util');var path=require(_0x0764('0x1'));var timeout=require(_0x0764('0x2'));var express=require(_0x0764('0x3'));var router=express[_0x0764('0x4')]();var fs_extra=require(_0x0764('0x5'));var auth=require(_0x0764('0x6'));var interaction=require(_0x0764('0x7'));var config=require(_0x0764('0x8'));var controller=require(_0x0764('0x9'));router['get']('/',auth[_0x0764('0xa')](),controller[_0x0764('0xb')]);router[_0x0764('0xc')](_0x0764('0xd'),auth['isAuthenticated'](),controller[_0x0764('0xe')]);router[_0x0764('0xc')](_0x0764('0xf'),auth[_0x0764('0xa')](),controller[_0x0764('0x10')]);router[_0x0764('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0764('0x12')](_0x0764('0xf'),auth[_0x0764('0xa')](),controller[_0x0764('0x13')]);router[_0x0764('0x14')](_0x0764('0xf'),auth[_0x0764('0xa')](),controller['destroy']);module[_0x0764('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 1237e25..2f37027 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 _0xf807=['mouseOver','INTEGER','exports','STRING'];(function(_0x2952b7,_0x18b173){var _0x1b86cd=function(_0x6b9a0e){while(--_0x6b9a0e){_0x2952b7['push'](_0x2952b7['shift']());}};_0x1b86cd(++_0x18b173);}(_0xf807,0xb2));var _0x7f80=function(_0x108d5f,_0x33f82d){_0x108d5f=_0x108d5f-0x0;var _0x456ea3=_0xf807[_0x108d5f];return _0x456ea3;};'use strict';var Sequelize=require('sequelize');module[_0x7f80('0x0')]={'name':{'type':Sequelize[_0x7f80('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7f80('0x2'),'timeout'),'defaultValue':_0x7f80('0x2')},'selector':{'type':Sequelize[_0x7f80('0x1')]},'timeout':{'type':Sequelize[_0x7f80('0x3')]}}; \ No newline at end of file +var _0xe973=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x2cc594,_0x4d727b){var _0x4abff7=function(_0x22b01d){while(--_0x22b01d){_0x2cc594['push'](_0x2cc594['shift']());}};_0x4abff7(++_0x4d727b);}(_0xe973,0x73));var _0x3e97=function(_0x5a36df,_0x3b781f){_0x5a36df=_0x5a36df-0x0;var _0x504577=_0xe973[_0x5a36df];return _0x504577;};'use strict';var Sequelize=require(_0x3e97('0x0'));module[_0x3e97('0x1')]={'name':{'type':Sequelize[_0x3e97('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3e97('0x3')](_0x3e97('0x4'),'timeout'),'defaultValue':_0x3e97('0x4')},'selector':{'type':Sequelize[_0x3e97('0x2')]},'timeout':{'type':Sequelize[_0x3e97('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index c0daece..adead08 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 _0x1666=['bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','params','model','keys','ChatProactiveAction','filters','intersection','query','attributes','fields','length','merge','options','find','create','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x1666,0x75));var _0x6166=function(_0x25e6df,_0x2efa38){_0x25e6df=_0x25e6df-0x0;var _0x2dfaf6=_0x1666[_0x25e6df];return _0x2dfaf6;};'use strict';var emlformat=require(_0x6166('0x0'));var rimraf=require(_0x6166('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6166('0x2'));var rp=require(_0x6166('0x3'));var moment=require(_0x6166('0x4'));var BPromise=require(_0x6166('0x5'));var Mustache=require(_0x6166('0x6'));var util=require(_0x6166('0x7'));var path=require(_0x6166('0x8'));var sox=require(_0x6166('0x9'));var csv=require('to-csv');var ejs=require(_0x6166('0xa'));var fs=require('fs');var fs_extra=require(_0x6166('0xb'));var _=require(_0x6166('0xc'));var squel=require(_0x6166('0xd'));var crypto=require(_0x6166('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6166('0xf'));var Papa=require('papaparse');var Redis=require(_0x6166('0x10'));var authService=require(_0x6166('0x11'));var qs=require(_0x6166('0x12'));var as=require(_0x6166('0x13'));var hardwareService=require(_0x6166('0x14'));var logger=require(_0x6166('0x15'))(_0x6166('0x16'));var utils=require('../../config/utils');var config=require(_0x6166('0x17'));var licenseUtil=require(_0x6166('0x18'));var db=require(_0x6166('0x19'))['db'];function respondWithStatusCode(_0x5b2335,_0x320728){_0x320728=_0x320728||0xcc;return function(_0x2ce997){if(_0x2ce997){return _0x5b2335[_0x6166('0x1a')](_0x320728);}return _0x5b2335[_0x6166('0x1b')](_0x320728)['end']();};}function respondWithResult(_0x1316f2,_0x33789f){_0x33789f=_0x33789f||0xc8;return function(_0x42abca){if(_0x42abca){return _0x1316f2[_0x6166('0x1b')](_0x33789f)[_0x6166('0x1c')](_0x42abca);}};}function respondWithFilteredResult(_0x147874,_0x56520c){return function(_0x3d2f83){if(_0x3d2f83){var _0x12f0a5=typeof _0x56520c[_0x6166('0x1d')]===_0x6166('0x1e')&&typeof _0x56520c[_0x6166('0x1f')]===_0x6166('0x1e');var _0x15f2e3=_0x3d2f83['count'];var _0x29764d=_0x12f0a5?0x0:_0x56520c[_0x6166('0x1d')];var _0x171795=_0x12f0a5?_0x3d2f83[_0x6166('0x20')]:_0x56520c[_0x6166('0x1d')]+_0x56520c['limit'];var _0x1c823b;if(_0x171795>=_0x15f2e3){_0x171795=_0x15f2e3;_0x1c823b=0xc8;}else{_0x1c823b=0xce;}_0x147874[_0x6166('0x1b')](_0x1c823b);return _0x147874[_0x6166('0x21')](_0x6166('0x22'),_0x29764d+'-'+_0x171795+'/'+_0x15f2e3)[_0x6166('0x1c')](_0x3d2f83);}return null;};}function patchUpdates(_0x28d90c){return function(_0x2411de){try{jsonpatch[_0x6166('0x23')](_0x2411de,_0x28d90c,!![]);}catch(_0x3b5a7e){return BPromise[_0x6166('0x24')](_0x3b5a7e);}return _0x2411de[_0x6166('0x25')]();};}function saveUpdates(_0x49c474,_0x1646ff){return function(_0x438ed3){if(_0x438ed3){return _0x438ed3[_0x6166('0x26')](_0x49c474)[_0x6166('0x27')](function(_0x33bc9b){return _0x33bc9b;});}return null;};}function removeEntity(_0x1d23c3,_0x3ffd46){return function(_0x26d926){if(_0x26d926){return _0x26d926['destroy']()[_0x6166('0x27')](function(){_0x1d23c3['status'](0xcc)[_0x6166('0x28')]();});}};}function handleEntityNotFound(_0x10a23e,_0x489b88){return function(_0x3b7452){if(!_0x3b7452){_0x10a23e[_0x6166('0x1a')](0x194);}return _0x3b7452;};}function handleError(_0x3b6107,_0x38fdb1){_0x38fdb1=_0x38fdb1||0x1f4;return function(_0x494838){logger[_0x6166('0x29')](_0x494838[_0x6166('0x2a')]);if(_0x494838[_0x6166('0x2b')]){delete _0x494838[_0x6166('0x2b')];}_0x3b6107[_0x6166('0x1b')](_0x38fdb1)[_0x6166('0x2c')](_0x494838);};}exports['show']=function(_0x54213b,_0x2c1167){var _0x2c1e5f={'raw':!![],'where':{'id':_0x54213b[_0x6166('0x2d')]['id']}},_0x357525={};_0x357525[_0x6166('0x2e')]=_[_0x6166('0x2f')](db[_0x6166('0x30')]['rawAttributes']);_0x357525['query']=_[_0x6166('0x2f')](_0x54213b['query']);_0x357525[_0x6166('0x31')]=_[_0x6166('0x32')](_0x357525[_0x6166('0x2e')],_0x357525[_0x6166('0x33')]);_0x2c1e5f[_0x6166('0x34')]=_['intersection'](_0x357525[_0x6166('0x2e')],qs[_0x6166('0x35')](_0x54213b[_0x6166('0x33')][_0x6166('0x35')]));_0x2c1e5f[_0x6166('0x34')]=_0x2c1e5f[_0x6166('0x34')][_0x6166('0x36')]?_0x2c1e5f['attributes']:_0x357525[_0x6166('0x2e')];if(_0x54213b[_0x6166('0x33')]['includeAll']){_0x2c1e5f['include']=[{'all':!![]}];}_0x2c1e5f=_[_0x6166('0x37')]({},_0x2c1e5f,_0x54213b[_0x6166('0x38')]);return db['ChatProactiveAction'][_0x6166('0x39')](_0x2c1e5f)[_0x6166('0x27')](handleEntityNotFound(_0x2c1167,null))[_0x6166('0x27')](respondWithResult(_0x2c1167,null))['catch'](handleError(_0x2c1167,null));};exports[_0x6166('0x3a')]=function(_0x45d518,_0x228790){return db['ChatProactiveAction']['create'](_0x45d518['body'],{})[_0x6166('0x27')](respondWithResult(_0x228790,0xc9))[_0x6166('0x3b')](handleError(_0x228790,null));};exports[_0x6166('0x26')]=function(_0x443a20,_0x38bb21){if(_0x443a20['body']['id']){delete _0x443a20[_0x6166('0x3c')]['id'];}return db[_0x6166('0x30')][_0x6166('0x39')]({'where':{'id':_0x443a20[_0x6166('0x2d')]['id']}})['then'](handleEntityNotFound(_0x38bb21,null))[_0x6166('0x27')](saveUpdates(_0x443a20[_0x6166('0x3c')],null))[_0x6166('0x27')](respondWithResult(_0x38bb21,null))[_0x6166('0x3b')](handleError(_0x38bb21,null));};exports['destroy']=function(_0x3a9917,_0x111d3b){return db[_0x6166('0x30')][_0x6166('0x39')]({'where':{'id':_0x3a9917[_0x6166('0x2d')]['id']}})[_0x6166('0x27')](handleEntityNotFound(_0x111d3b,null))['then'](removeEntity(_0x111d3b,null))[_0x6166('0x3b')](handleError(_0x111d3b,null));}; \ No newline at end of file +var _0x7da7=['../../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','end','error','stack','name','send','show','params','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','include','merge','options','find','create','catch','body','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x29655f,_0x35c443){var _0x253f8d=function(_0x2d3da0){while(--_0x2d3da0){_0x29655f['push'](_0x29655f['shift']());}};_0x253f8d(++_0x35c443);}(_0x7da7,0x10d));var _0x77da=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7da7[_0x502c7d];return _0x30b7ed;};'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(){_0x27b6c7['status'](0xcc)[_0x77da('0x23')]();});}};}function handleEntityNotFound(_0x2d009f,_0x835167){return function(_0xbd06b7){if(!_0xbd06b7){_0x2d009f['sendStatus'](0x194);}return _0xbd06b7;};}function handleError(_0x42240b,_0x167240){_0x167240=_0x167240||0x1f4;return function(_0x470c9f){logger[_0x77da('0x24')](_0x470c9f[_0x77da('0x25')]);if(_0x470c9f['name']){delete _0x470c9f[_0x77da('0x26')];}_0x42240b[_0x77da('0x18')](_0x167240)[_0x77da('0x27')](_0x470c9f);};}exports[_0x77da('0x28')]=function(_0x496ecd,_0x5b4638){var _0x4d395a={'raw':!![],'where':{'id':_0x496ecd[_0x77da('0x29')]['id']}},_0x2258e9={};_0x2258e9[_0x77da('0x2a')]=_[_0x77da('0x2b')](db[_0x77da('0x2c')]['rawAttributes']);_0x2258e9[_0x77da('0x2d')]=_[_0x77da('0x2b')](_0x496ecd[_0x77da('0x2d')]);_0x2258e9[_0x77da('0x2e')]=_[_0x77da('0x2f')](_0x2258e9[_0x77da('0x2a')],_0x2258e9['query']);_0x4d395a[_0x77da('0x30')]=_[_0x77da('0x2f')](_0x2258e9[_0x77da('0x2a')],qs[_0x77da('0x31')](_0x496ecd[_0x77da('0x2d')][_0x77da('0x31')]));_0x4d395a[_0x77da('0x30')]=_0x4d395a[_0x77da('0x30')]['length']?_0x4d395a['attributes']:_0x2258e9[_0x77da('0x2a')];if(_0x496ecd[_0x77da('0x2d')]['includeAll']){_0x4d395a[_0x77da('0x32')]=[{'all':!![]}];}_0x4d395a=_[_0x77da('0x33')]({},_0x4d395a,_0x496ecd[_0x77da('0x34')]);return db[_0x77da('0x2c')][_0x77da('0x35')](_0x4d395a)[_0x77da('0x21')](handleEntityNotFound(_0x5b4638,null))[_0x77da('0x21')](respondWithResult(_0x5b4638,null))['catch'](handleError(_0x5b4638,null));};exports[_0x77da('0x36')]=function(_0x4df4b9,_0x54b7f2){return db['ChatProactiveAction'][_0x77da('0x36')](_0x4df4b9['body'],{})[_0x77da('0x21')](respondWithResult(_0x54b7f2,0xc9))[_0x77da('0x37')](handleError(_0x54b7f2,null));};exports[_0x77da('0x20')]=function(_0x3cc78b,_0x3c46d2){if(_0x3cc78b[_0x77da('0x38')]['id']){delete _0x3cc78b[_0x77da('0x38')]['id'];}return db['ChatProactiveAction'][_0x77da('0x35')]({'where':{'id':_0x3cc78b[_0x77da('0x29')]['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x3c46d2,null))[_0x77da('0x21')](saveUpdates(_0x3cc78b[_0x77da('0x38')],null))[_0x77da('0x21')](respondWithResult(_0x3c46d2,null))['catch'](handleError(_0x3c46d2,null));};exports[_0x77da('0x22')]=function(_0x16a0e0,_0x2cd190){return db['ChatProactiveAction'][_0x77da('0x35')]({'where':{'id':_0x16a0e0['params']['id']}})['then'](handleEntityNotFound(_0x2cd190,null))['then'](removeEntity(_0x2cd190,null))['catch'](handleError(_0x2cd190,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index fd38e91..dd72281 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 _0x911b=['../../config/environment','./chatProactiveAction.attributes','exports','util','moment','request-promise','rimraf'];(function(_0x2bdf1d,_0x4239d5){var _0xcc6155=function(_0x4deccf){while(--_0x4deccf){_0x2bdf1d['push'](_0x2bdf1d['shift']());}};_0xcc6155(++_0x4239d5);}(_0x911b,0xce));var _0xb911=function(_0x460a02,_0x341a72){_0x460a02=_0x460a02-0x0;var _0x4aad44=_0x911b[_0x460a02];return _0x4aad44;};'use strict';var _=require('lodash');var util=require(_0xb911('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb911('0x1'));var BPromise=require('bluebird');var rp=require(_0xb911('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb911('0x3'));var config=require(_0xb911('0x4'));var attributes=require(_0xb911('0x5'));module[_0xb911('0x6')]=function(_0x4ac950,_0x3ba514){return _0x4ac950['define']('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d52=['./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','api','request-promise','path'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3d52,0x16c));var _0x23d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d52[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x23d5('0x0'));var util=require(_0x23d5('0x1'));var logger=require('../../config/logger')(_0x23d5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x23d5('0x3'));var fs=require('fs');var path=require(_0x23d5('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x23d5('0x5'));module['exports']=function(_0x2adfce,_0x50bbf3){return _0x2adfce[_0x23d5('0x6')](_0x23d5('0x7'),attributes,{'tableName':_0x23d5('0x8'),'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 8f8559e..af1cd1e 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 _0xa8e0=['debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x390a8e,_0x76f621){var _0x42bc00=function(_0x2e03ab){while(--_0x2e03ab){_0x390a8e['push'](_0x390a8e['shift']());}};_0x42bc00(++_0x76f621);}(_0xa8e0,0xf0));var _0x0a8e=function(_0x2f7725,_0x4d913b){_0x2f7725=_0x2f7725-0x0;var _0x498fa9=_0xa8e0[_0x2f7725];return _0x498fa9;};'use strict';var _=require('lodash');var util=require(_0x0a8e('0x0'));var moment=require('moment');var BPromise=require(_0x0a8e('0x1'));var rs=require(_0x0a8e('0x2'));var fs=require('fs');var Redis=require(_0x0a8e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0a8e('0x4'));var jayson=require(_0x0a8e('0x5'));var client=jayson[_0x0a8e('0x6')][_0x0a8e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5349cd,_0x236c5e,_0x23baeb){return new BPromise(function(_0x1a825a,_0x427e24){return client[_0x0a8e('0x8')](_0x5349cd,_0x23baeb)[_0x0a8e('0x9')](function(_0x4a6812){logger['info'](_0x0a8e('0xa'),_0x236c5e,_0x0a8e('0xb'));logger[_0x0a8e('0xc')](_0x0a8e('0xd'),_0x236c5e,'request\x20sent',JSON[_0x0a8e('0xe')](_0x4a6812));if(_0x4a6812[_0x0a8e('0xf')]){if(_0x4a6812[_0x0a8e('0xf')][_0x0a8e('0x10')]===0x1f4){logger[_0x0a8e('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x236c5e,_0x4a6812[_0x0a8e('0xf')]['message']);return _0x427e24(_0x4a6812[_0x0a8e('0xf')]['message']);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x236c5e,_0x4a6812[_0x0a8e('0xf')][_0x0a8e('0x11')]);return _0x1a825a(_0x4a6812[_0x0a8e('0xf')][_0x0a8e('0x11')]);}else{logger[_0x0a8e('0x12')](_0x0a8e('0xa'),_0x236c5e,_0x0a8e('0xb'));_0x1a825a(_0x4a6812[_0x0a8e('0x13')][_0x0a8e('0x11')]);}})[_0x0a8e('0x14')](function(_0x9a717c){logger[_0x0a8e('0xf')](_0x0a8e('0xa'),_0x236c5e,_0x9a717c);_0x427e24(_0x9a717c);});});} \ No newline at end of file +var _0x4ca3=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x4ca3,0x150));var _0x34ca=function(_0x2f32ae,_0x84ea81){_0x2f32ae=_0x2f32ae-0x0;var _0x23374c=_0x4ca3[_0x2f32ae];return _0x23374c;};'use strict';var _=require(_0x34ca('0x0'));var util=require(_0x34ca('0x1'));var moment=require(_0x34ca('0x2'));var BPromise=require(_0x34ca('0x3'));var rs=require(_0x34ca('0x4'));var fs=require('fs');var Redis=require(_0x34ca('0x5'));var db=require(_0x34ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x34ca('0x7'));var config=require(_0x34ca('0x8'));var jayson=require(_0x34ca('0x9'));var client=jayson[_0x34ca('0xa')][_0x34ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16f55e,_0x340f9d,_0x1434a8){return new BPromise(function(_0x1656ea,_0x1daf41){return client[_0x34ca('0xc')](_0x16f55e,_0x1434a8)[_0x34ca('0xd')](function(_0x2036c1){logger['info'](_0x34ca('0xe'),_0x340f9d,_0x34ca('0xf'));logger[_0x34ca('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x340f9d,_0x34ca('0xf'),JSON[_0x34ca('0x11')](_0x2036c1));if(_0x2036c1[_0x34ca('0x12')]){if(_0x2036c1[_0x34ca('0x12')][_0x34ca('0x13')]===0x1f4){logger['error'](_0x34ca('0xe'),_0x340f9d,_0x2036c1[_0x34ca('0x12')][_0x34ca('0x14')]);return _0x1daf41(_0x2036c1['error'][_0x34ca('0x14')]);}logger['error'](_0x34ca('0xe'),_0x340f9d,_0x2036c1[_0x34ca('0x12')]['message']);return _0x1656ea(_0x2036c1['error'][_0x34ca('0x14')]);}else{logger[_0x34ca('0x15')](_0x34ca('0xe'),_0x340f9d,_0x34ca('0xf'));_0x1656ea(_0x2036c1[_0x34ca('0x16')][_0x34ca('0x14')]);}})[_0x34ca('0x17')](function(_0x29c1b3){logger[_0x34ca('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x340f9d,_0x29c1b3);_0x1daf41(_0x29c1b3);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index dcb687d..24332e3 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 _0xf2ca=['show','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x247998,_0x4a91be){var _0xacbe8c=function(_0x1ad715){while(--_0x1ad715){_0x247998['push'](_0x247998['shift']());}};_0xacbe8c(++_0x4a91be);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x565fed,_0xb85768){_0x565fed=_0x565fed-0x0;var _0x3e018f=_0xf2ca[_0x565fed];return _0x3e018f;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xaf2c('0x9')](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xc')]);router['post']('/',auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xd')]);router['put'](_0xaf2c('0xa'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['delete'](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xf')]);module[_0xaf2c('0x10')]=router; \ No newline at end of file +var _0x8d0e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','/:id','delete','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x37eed1,_0x2bf10d){_0x37eed1=_0x37eed1-0x0;var _0x5157e9=_0x8d0e[_0x37eed1];return _0x5157e9;};'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']('/:id',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xb')]);router[_0xe8d0('0xc')]('/',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xe')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['update']);router[_0xe8d0('0x10')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 21922ae..eabf02b 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 _0x08ca=['rrmemory','beepall','roundrobin','sequelize','exports','name','STRING','INTEGER'];(function(_0x3b15f7,_0x2cf95b){var _0x4f373a=function(_0x44053d){while(--_0x44053d){_0x3b15f7['push'](_0x3b15f7['shift']());}};_0x4f373a(++_0x2cf95b);}(_0x08ca,0x9b));var _0xa08c=function(_0x4faa64,_0x2dfdbe){_0x4faa64=_0x4faa64-0x0;var _0x2f2487=_0x08ca[_0x4faa64];return _0x2f2487;};'use strict';var Sequelize=require(_0xa08c('0x0'));module[_0xa08c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa08c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa08c('0x3')]},'timeout':{'type':Sequelize[_0xa08c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa08c('0x5'),_0xa08c('0x6'),_0xa08c('0x7'))}}; \ No newline at end of file +var _0xe482=['name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xe482,0xa5));var _0x2e48=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xe482[_0x266618];return _0x54dbf5;};'use strict';var Sequelize=require(_0x2e48('0x0'));module[_0x2e48('0x1')]={'name':{'type':Sequelize[_0x2e48('0x2')],'unique':_0x2e48('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2e48('0x2')]},'timeout':{'type':Sequelize[_0x2e48('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2e48('0x5')](_0x2e48('0x6'),'beepall',_0x2e48('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index f4d4817..c5f9a17 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 _0x8e2a=['SIP','getTeams','Team','order','hasOwnProperty','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','ids','isEmpty','emit','addAgents','omit','spread','userChatQueue:save','removeAgents','isArray','userChatQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','destroy','then','get','UserProfileResource','end','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','include','query','rows','catch','params','model','keys','intersection','fields','attributes','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','nolimit','limit','sort','filters','pick','where','filter','UserChatQueue','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s'];(function(_0x4c7bc9,_0x1428a7){var _0x220db8=function(_0x1e1b21){while(--_0x1e1b21){_0x4c7bc9['push'](_0x4c7bc9['shift']());}};_0x220db8(++_0x1428a7);}(_0x8e2a,0x139));var _0xa8e2=function(_0x771f80,_0x279715){_0x771f80=_0x771f80-0x0;var _0x2090ec=_0x8e2a[_0x771f80];return _0x2090ec;};'use strict';var BPromise=require(_0xa8e2('0x0'));var util=require(_0xa8e2('0x1'));var _=require(_0xa8e2('0x2'));var squel=require(_0xa8e2('0x3'));var Redis=require(_0xa8e2('0x4'));var qs=require(_0xa8e2('0x5'));var logger=require(_0xa8e2('0x6'))(_0xa8e2('0x7'));var config=require('../../config/environment');var db=require(_0xa8e2('0x8'))['db'];config[_0xa8e2('0x9')]=_[_0xa8e2('0xa')](config[_0xa8e2('0x9')],{'host':_0xa8e2('0xb'),'port':0x18eb});var socket=require(_0xa8e2('0xc'))(new Redis(config[_0xa8e2('0x9')]));require(_0xa8e2('0xd'))[_0xa8e2('0xe')](socket);function respondWithStatusCode(_0x5d973c,_0x319cbd){_0x319cbd=_0x319cbd||0xcc;return function(_0x3f0be1){if(_0x3f0be1){return _0x5d973c[_0xa8e2('0xf')](_0x319cbd);}return _0x5d973c['status'](_0x319cbd)['end']();};}function respondWithResult(_0x38b0f9,_0x1bb55a){_0x1bb55a=_0x1bb55a||0xc8;return function(_0x499514){if(_0x499514){return _0x38b0f9[_0xa8e2('0x10')](_0x1bb55a)[_0xa8e2('0x11')](_0x499514);}};}function respondWithFilteredResult(_0x5372e5,_0x1535b7){return function(_0x46ea9f){if(_0x46ea9f){var _0xed8660=typeof _0x1535b7[_0xa8e2('0x12')]===_0xa8e2('0x13')&&typeof _0x1535b7['limit']===_0xa8e2('0x13');var _0x317f3b=_0x46ea9f[_0xa8e2('0x14')];var _0x2776ef=_0xed8660?0x0:_0x1535b7[_0xa8e2('0x12')];var _0x2235ab=_0xed8660?_0x46ea9f[_0xa8e2('0x14')]:_0x1535b7['offset']+_0x1535b7['limit'];var _0x5657b5;if(_0x2235ab>=_0x317f3b){_0x2235ab=_0x317f3b;_0x5657b5=0xc8;}else{_0x5657b5=0xce;}_0x5372e5[_0xa8e2('0x10')](_0x5657b5);return _0x5372e5[_0xa8e2('0x15')](_0xa8e2('0x16'),_0x2776ef+'-'+_0x2235ab+'/'+_0x317f3b)[_0xa8e2('0x11')](_0x46ea9f);}return null;};}function saveUpdates(_0x1f22fa){return function(_0x30a786){if(_0x30a786){return _0x30a786['update'](_0x1f22fa)['then'](function(_0x4f9dfe){return _0x4f9dfe;});}return null;};}function removeEntity(_0x3695ea){return function(_0x22b7bc){if(_0x22b7bc){return _0x22b7bc[_0xa8e2('0x17')]()[_0xa8e2('0x18')](function(){var _0x1b9867=_0x22b7bc[_0xa8e2('0x19')]({'plain':!![]});var _0x3dc5f3='ChatQueues';return db[_0xa8e2('0x1a')]['destroy']({'where':{'type':_0x3dc5f3,'resourceId':_0x1b9867['id']}})[_0xa8e2('0x18')](function(){return _0x22b7bc;});})['then'](function(){_0x3695ea['status'](0xcc)[_0xa8e2('0x1b')]();});}};}function handleEntityNotFound(_0x1d7fc3){return function(_0xb88c7e){if(!_0xb88c7e){_0x1d7fc3[_0xa8e2('0xf')](0x194);}return _0xb88c7e;};}function handleError(_0x4366db,_0x4e8edb){_0x4e8edb=_0x4e8edb||0x1f4;return function(_0x571c0a){logger['error'](_0x571c0a[_0xa8e2('0x1c')]);if(_0x571c0a['name']){delete _0x571c0a[_0xa8e2('0x1d')];}_0x4366db['status'](_0x4e8edb)[_0xa8e2('0x1e')](_0x571c0a);};}exports[_0xa8e2('0x1f')]=function(_0x44710d,_0x3b52bf){var _0x451734={};var _0x28ccc6={'count':0x0,'rows':[]};var _0x13ca7a=_[_0xa8e2('0x20')](db[_0xa8e2('0x21')][_0xa8e2('0x22')],function(_0x2304df){return{'name':_0x2304df[_0xa8e2('0x23')],'type':_0x2304df[_0xa8e2('0x24')][_0xa8e2('0x25')]};});_0x451734=qs[_0xa8e2('0x26')](_0x13ca7a,_0x44710d);var _0x305749={'where':_0x451734['where']};return db[_0xa8e2('0x21')][_0xa8e2('0x14')](_0x305749)[_0xa8e2('0x18')](function(_0x508247){_0x28ccc6[_0xa8e2('0x14')]=_0x508247;_0x451734['include']=qs[_0xa8e2('0x27')](_0x44710d[_0xa8e2('0x28')]);return db[_0xa8e2('0x21')]['findAll'](_0x451734);})['then'](function(_0x4f79fb){_0x28ccc6[_0xa8e2('0x29')]=_0x4f79fb;return _0x28ccc6;})['then'](respondWithFilteredResult(_0x3b52bf,_0x451734))[_0xa8e2('0x2a')](handleError(_0x3b52bf,null));};exports['show']=function(_0x50b398,_0x1da902){var _0x2dd150={'raw':!![],'where':{'id':_0x50b398[_0xa8e2('0x2b')]['id']}},_0x116891={};_0x116891[_0xa8e2('0x2c')]=_['keys'](db['ChatQueue']['rawAttributes']);_0x116891[_0xa8e2('0x28')]=_[_0xa8e2('0x2d')](_0x50b398[_0xa8e2('0x28')]);_0x116891['filters']=_[_0xa8e2('0x2e')](_0x116891['model'],_0x116891[_0xa8e2('0x28')]);_0x2dd150['attributes']=_[_0xa8e2('0x2e')](_0x116891[_0xa8e2('0x2c')],qs['fields'](_0x50b398[_0xa8e2('0x28')][_0xa8e2('0x2f')]));_0x2dd150[_0xa8e2('0x30')]=_0x2dd150[_0xa8e2('0x30')][_0xa8e2('0x31')]?_0x2dd150[_0xa8e2('0x30')]:_0x116891[_0xa8e2('0x2c')];if(_0x50b398[_0xa8e2('0x28')]['includeAll']){_0x2dd150[_0xa8e2('0x27')]=[{'all':!![]}];}_0x2dd150=_[_0xa8e2('0x32')]({},_0x2dd150,_0x50b398[_0xa8e2('0x33')]);return db[_0xa8e2('0x21')][_0xa8e2('0x34')](_0x2dd150)[_0xa8e2('0x18')](handleEntityNotFound(_0x1da902,null))[_0xa8e2('0x18')](respondWithResult(_0x1da902,null))[_0xa8e2('0x2a')](handleError(_0x1da902,null));};exports[_0xa8e2('0x35')]=function(_0x553775,_0x4c7e40){return db[_0xa8e2('0x21')][_0xa8e2('0x35')](_0x553775[_0xa8e2('0x36')],{})[_0xa8e2('0x18')](function(_0x2b08a0){var _0x59eb63=_0x553775[_0xa8e2('0x37')][_0xa8e2('0x19')]({'plain':!![]});if(!_0x59eb63)throw new Error(_0xa8e2('0x38'));if(_0x59eb63[_0xa8e2('0x39')]==='user'){var _0x4ab5e2=_0x2b08a0[_0xa8e2('0x19')]({'plain':!![]});var _0x2b5dc6=_0xa8e2('0x3a');return db[_0xa8e2('0x3b')][_0xa8e2('0x34')]({'where':{'name':_0x2b5dc6,'userProfileId':_0x59eb63[_0xa8e2('0x3c')]},'raw':!![]})['then'](function(_0x50454f){if(_0x50454f&&_0x50454f[_0xa8e2('0x3d')]===0x0){return db['UserProfileResource']['create']({'name':_0x4ab5e2[_0xa8e2('0x1d')],'resourceId':_0x4ab5e2['id'],'type':_0x50454f[_0xa8e2('0x1d')],'sectionId':_0x50454f['id']},{})[_0xa8e2('0x18')](function(){return _0x2b08a0;});}else{return _0x2b08a0;}})[_0xa8e2('0x2a')](function(_0x57472c){logger[_0xa8e2('0x3e')](_0xa8e2('0x3f'),_0x57472c);throw _0x57472c;});}return _0x2b08a0;})[_0xa8e2('0x18')](respondWithResult(_0x4c7e40,0xc9))[_0xa8e2('0x2a')](handleError(_0x4c7e40,null));};exports[_0xa8e2('0x40')]=function(_0x3de02c,_0x143d7b){if(_0x3de02c['body']['id']){delete _0x3de02c[_0xa8e2('0x36')]['id'];}return db['ChatQueue'][_0xa8e2('0x34')]({'where':{'id':_0x3de02c[_0xa8e2('0x2b')]['id']}})[_0xa8e2('0x18')](handleEntityNotFound(_0x143d7b,null))['then'](saveUpdates(_0x3de02c['body'],null))['then'](respondWithResult(_0x143d7b,null))[_0xa8e2('0x2a')](handleError(_0x143d7b,null));};exports['destroy']=function(_0x221dc4,_0x49dab2){return db[_0xa8e2('0x21')][_0xa8e2('0x34')]({'where':{'id':_0x221dc4[_0xa8e2('0x2b')]['id']}})[_0xa8e2('0x18')](handleEntityNotFound(_0x49dab2,null))[_0xa8e2('0x18')](removeEntity(_0x49dab2,null))[_0xa8e2('0x2a')](handleError(_0x49dab2,null));};exports[_0xa8e2('0x41')]=function(_0x1322bf,_0x2faaa9){return db[_0xa8e2('0x21')][_0xa8e2('0x41')]()['then'](respondWithResult(_0x2faaa9,null))[_0xa8e2('0x2a')](handleError(_0x2faaa9,null));};exports[_0xa8e2('0x42')]=function(_0x3cb6b3,_0x4b9b79){var _0x453cda={'raw':!![],'where':{}},_0x163e0b={},_0x279d05;return db['ChatQueue'][_0xa8e2('0x43')]({'where':{'id':_0x3cb6b3[_0xa8e2('0x2b')]['id']}})[_0xa8e2('0x18')](handleEntityNotFound(_0x4b9b79,null))[_0xa8e2('0x18')](function(_0x29a6cb){if(_0x29a6cb){_0x279d05=_0x29a6cb[_0xa8e2('0x19')]({'plain':!![]});_0x163e0b[_0xa8e2('0x2c')]=_[_0xa8e2('0x2d')](db['UserChatQueue'][_0xa8e2('0x22')]);_0x163e0b[_0xa8e2('0x28')]=_[_0xa8e2('0x2d')](_0x3cb6b3[_0xa8e2('0x28')]);_0x163e0b['filters']=_['intersection'](_0x163e0b[_0xa8e2('0x2c')],_0x163e0b[_0xa8e2('0x28')]);_0x453cda[_0xa8e2('0x30')]=_[_0xa8e2('0x2e')](_0x163e0b['model'],qs[_0xa8e2('0x2f')](_0x3cb6b3[_0xa8e2('0x28')]['fields']));_0x453cda[_0xa8e2('0x30')]=_0x453cda[_0xa8e2('0x30')][_0xa8e2('0x31')]?_0x453cda[_0xa8e2('0x30')]:_0x163e0b[_0xa8e2('0x2c')];if(!_0x3cb6b3[_0xa8e2('0x28')]['hasOwnProperty'](_0xa8e2('0x44'))){_0x453cda[_0xa8e2('0x45')]=qs[_0xa8e2('0x45')](_0x3cb6b3[_0xa8e2('0x28')][_0xa8e2('0x45')]);_0x453cda[_0xa8e2('0x12')]=qs[_0xa8e2('0x12')](_0x3cb6b3[_0xa8e2('0x28')][_0xa8e2('0x12')]);}_0x453cda['order']=qs[_0xa8e2('0x46')](_0x3cb6b3['query'][_0xa8e2('0x46')]);_0x453cda['where']=qs[_0xa8e2('0x47')](_[_0xa8e2('0x48')](_0x3cb6b3[_0xa8e2('0x28')],_0x163e0b['filters']));_0x453cda[_0xa8e2('0x49')]['ChatQueueId']=_0x29a6cb['id'];if(_0x3cb6b3[_0xa8e2('0x28')][_0xa8e2('0x4a')]){_0x453cda['where']=_['merge'](_0x453cda[_0xa8e2('0x49')],{'$or':_['map'](_0x453cda['attributes'],function(_0x3db500){var _0x1a93ff={};_0x1a93ff[_0x3db500]={'$like':'%'+_0x3cb6b3[_0xa8e2('0x28')][_0xa8e2('0x4a')]+'%'};return _0x1a93ff;})});}_0x453cda=_[_0xa8e2('0x32')]({},_0x453cda,_0x3cb6b3[_0xa8e2('0x33')]);return db[_0xa8e2('0x4b')][_0xa8e2('0x4c')](_0x453cda);}})[_0xa8e2('0x18')](function(_0x2d3433){if(_0x2d3433){return db[_0xa8e2('0x4d')][_0xa8e2('0x4e')]({'where':{'id':_[_0xa8e2('0x20')](_0x2d3433,_0xa8e2('0x4f')),'role':_0xa8e2('0x50')},'attributes':['id',_0xa8e2('0x1d'),_0xa8e2('0x51'),_0xa8e2('0x52'),_0xa8e2('0x53')]});}})[_0xa8e2('0x18')](function(_0x4ce073){if(_0x4ce073){return{'count':_0x4ce073[_0xa8e2('0x14')],'rows':_[_0xa8e2('0x20')](_0x4ce073[_0xa8e2('0x29')],function(_0x4a530f){return{'membername':_0x4a530f[_0xa8e2('0x1d')],'UserId':_0x4a530f['id'],'queue_name':_0x279d05[_0xa8e2('0x1d')],'ChatQueueId':_0x279d05['id'],'interface':util[_0xa8e2('0x54')](_0xa8e2('0x55'),_0xa8e2('0x56'),_0x4a530f['name']),'penalty':0x0,'paused':_0x4a530f[_0xa8e2('0x51')],'createdAt':_0x4a530f[_0xa8e2('0x53')],'updatedAt':_0x4a530f[_0xa8e2('0x52')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa8e2('0x18')](respondWithFilteredResult(_0x4b9b79,_0x453cda))['catch'](handleError(_0x4b9b79,null));};exports[_0xa8e2('0x57')]=function(_0x20d250,_0x8390d8){var _0x1579d0={};var _0x458e12={};var _0x483da2;var _0x2f6201;return db['ChatQueue'][_0xa8e2('0x43')]({'where':{'id':_0x20d250[_0xa8e2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x8390d8,null))['then'](function(_0x65a782){if(_0x65a782){_0x483da2=_0x65a782;_0x458e12[_0xa8e2('0x2c')]=_[_0xa8e2('0x2d')](db[_0xa8e2('0x58')][_0xa8e2('0x22')]);_0x458e12['query']=_[_0xa8e2('0x2d')](_0x20d250[_0xa8e2('0x28')]);_0x458e12['filters']=_[_0xa8e2('0x2e')](_0x458e12['model'],_0x458e12['query']);_0x1579d0['attributes']=_[_0xa8e2('0x2e')](_0x458e12['model'],qs['fields'](_0x20d250[_0xa8e2('0x28')][_0xa8e2('0x2f')]));_0x1579d0[_0xa8e2('0x30')]=_0x1579d0[_0xa8e2('0x30')][_0xa8e2('0x31')]?_0x1579d0[_0xa8e2('0x30')]:_0x458e12['model'];_0x1579d0[_0xa8e2('0x59')]=qs[_0xa8e2('0x46')](_0x20d250[_0xa8e2('0x28')][_0xa8e2('0x46')]);_0x1579d0[_0xa8e2('0x49')]=qs['filters'](_[_0xa8e2('0x48')](_0x20d250[_0xa8e2('0x28')],_0x458e12[_0xa8e2('0x47')]));if(_0x20d250['query']['filter']){_0x1579d0[_0xa8e2('0x49')]=_[_0xa8e2('0x32')](_0x1579d0[_0xa8e2('0x49')],{'$or':_[_0xa8e2('0x20')](_0x1579d0[_0xa8e2('0x30')],function(_0x38e3ef){var _0x21557f={};_0x21557f[_0x38e3ef]={'$like':'%'+_0x20d250[_0xa8e2('0x28')]['filter']+'%'};return _0x21557f;})});}_0x1579d0=_[_0xa8e2('0x32')]({},_0x1579d0,_0x20d250[_0xa8e2('0x33')]);return _0x483da2['getTeams'](_0x1579d0);}})['then'](function(_0x2860ad){if(_0x2860ad){_0x2f6201=_0x2860ad[_0xa8e2('0x31')];if(!_0x20d250[_0xa8e2('0x28')][_0xa8e2('0x5a')](_0xa8e2('0x44'))){_0x1579d0[_0xa8e2('0x45')]=qs['limit'](_0x20d250['query'][_0xa8e2('0x45')]);_0x1579d0[_0xa8e2('0x12')]=qs['offset'](_0x20d250['query']['offset']);}return _0x483da2['getTeams'](_0x1579d0);}})[_0xa8e2('0x18')](function(_0x4cc798){if(_0x4cc798){return _0x4cc798?{'count':_0x2f6201,'rows':_0x4cc798}:null;}})[_0xa8e2('0x18')](respondWithResult(_0x8390d8,null))['catch'](handleError(_0x8390d8,null));};exports[_0xa8e2('0x5b')]=function(_0x372d24,_0x39ffd0){var _0x16991b=_0x372d24[_0xa8e2('0x36')]['ids'];return db[_0xa8e2('0x58')][_0xa8e2('0x4c')]({'where':{'id':_0x16991b},'attributes':['id'],'include':[{'model':db[_0xa8e2('0x4d')],'as':_0xa8e2('0x5c'),'attributes':['id',_0xa8e2('0x1d'),_0xa8e2('0x5d'),_0xa8e2('0x5e'),_0xa8e2('0x5f')],'raw':!![]}]})[_0xa8e2('0x18')](function(_0x8b4814){if(_0x8b4814){var _0x565df1=_[_0xa8e2('0x60')](_0x8b4814,function(_0x3a34b6){var _0x367aa3=_0x3a34b6[_0xa8e2('0x19')]({'plain':!![]});return _0x367aa3[_0xa8e2('0x5c')];});return db[_0xa8e2('0x21')][_0xa8e2('0x34')]({'where':{'id':_0x372d24['params']['id']}})['then'](function(_0x870bbe){return db[_0xa8e2('0x61')][_0xa8e2('0x62')](function(_0x19ea0f){return _0x870bbe[_0xa8e2('0x5b')](_0x16991b,{'transaction':_0x19ea0f})[_0xa8e2('0x18')](function(){return BPromise[_0xa8e2('0x63')](_0x565df1,function(_0x8dbd0e){return db[_0xa8e2('0x4b')]['findOrCreate']({'where':{'UserId':_0x8dbd0e['id'],'ChatQueueId':_0x372d24[_0xa8e2('0x2b')]['id']},'transaction':_0x19ea0f});});})['then'](function(){_0x565df1[_0xa8e2('0x64')](function(_0x317f60){socket['emit']('userChatQueue:save',{'UserId':_0x317f60['id'],'ChatQueueId':_0x870bbe['id']});});});});});}})[_0xa8e2('0x18')](respondWithStatusCode(_0x39ffd0,null))[_0xa8e2('0x2a')](handleError(_0x39ffd0,null));};exports[_0xa8e2('0x65')]=function(_0x57e734,_0x57e5b3){return db['Team'][_0xa8e2('0x4c')]({'where':{'id':_0x57e734['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xa8e2('0x4d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa8e2('0x18')](handleEntityNotFound(_0x57e5b3,null))[_0xa8e2('0x18')](function(_0x54a33b){var _0x3c27df=_[_0xa8e2('0x20')](_0x54a33b,'id');var _0x375a4b=[];var _0x10f97f=[];var _0x2fc8f4=squel[_0xa8e2('0x66')]();_0x2fc8f4[_0xa8e2('0x67')](_0xa8e2('0x68'))[_0xa8e2('0x69')](_0xa8e2('0x6a'),'tq')[_0xa8e2('0x6b')](_0xa8e2('0x6c'),'ut',_0xa8e2('0x6d'))['where'](_0xa8e2('0x6e'),_0x57e734[_0xa8e2('0x2b')]['id']);for(var _0x18c8dd=0x0;_0x18c8dd<_0x54a33b[_0xa8e2('0x31')];_0x18c8dd+=0x1){let _0x16e9bc=_0x54a33b[_0x18c8dd];for(var _0x2814b9=0x0;_0x2814b9<_0x16e9bc[_0xa8e2('0x5c')][_0xa8e2('0x31')];_0x2814b9+=0x1){let _0x2bcc81=_0x16e9bc[_0xa8e2('0x5c')][_0x2814b9];var _0x1a260b=_0x2fc8f4[_0xa8e2('0x6f')]();_0x1a260b['where'](_0xa8e2('0x70'),_0x2bcc81['id']);_0x10f97f[_0xa8e2('0x71')](db[_0xa8e2('0x61')][_0xa8e2('0x28')](_0x1a260b['toString'](),{'type':db[_0xa8e2('0x61')][_0xa8e2('0x72')][_0xa8e2('0x73')]})[_0xa8e2('0x18')](function(_0x40bc03){if(_0x40bc03[_0xa8e2('0x31')]===0x1){return _0x2bcc81['id'];}else{var _0x25c31f=_[_0xa8e2('0x74')](_[_0xa8e2('0x20')](_0x40bc03,_0xa8e2('0x75')),function(_0x1364a1){return _[_0xa8e2('0x76')](_0x3c27df,_0x1364a1);});if(_0x25c31f){return _0x2bcc81['id'];}}}));}}return BPromise[_0xa8e2('0x77')](_0x10f97f)[_0xa8e2('0x18')](function(_0x135ef1){_0x375a4b=_(_0x375a4b)[_0xa8e2('0x78')](_0x135ef1)[_0xa8e2('0x79')]()['value']();return db[_0xa8e2('0x21')][_0xa8e2('0x34')]({'where':{'id':_0x57e734[_0xa8e2('0x2b')]['id']}})['then'](function(_0x559d03){return db[_0xa8e2('0x61')][_0xa8e2('0x62')](function(_0x1b73f5){return _0x559d03[_0xa8e2('0x65')](_0x57e734['query'][_0xa8e2('0x7a')],{'transaction':_0x1b73f5})[_0xa8e2('0x18')](function(){if(!_[_0xa8e2('0x7b')](_0x375a4b)){return _0x559d03['removeAgents'](_0x375a4b,{'transaction':_0x1b73f5});}})[_0xa8e2('0x18')](function(){_0x375a4b[_0xa8e2('0x64')](function(_0x194377){socket[_0xa8e2('0x7c')]('userChatQueue:remove',{'UserId':_0x194377,'ChatQueueId':_0x559d03['id']});});});});});});})[_0xa8e2('0x18')](respondWithStatusCode(_0x57e5b3,null))['catch'](handleError(_0x57e5b3,null));};exports['addAgents']=function(_0x2d883b,_0x1ec6e3){return db[_0xa8e2('0x21')][_0xa8e2('0x34')]({'where':{'id':_0x2d883b[_0xa8e2('0x2b')]['id']}})[_0xa8e2('0x18')](handleEntityNotFound(_0x1ec6e3,null))[_0xa8e2('0x18')](function(_0x440b1c){if(_0x440b1c){return _0x440b1c[_0xa8e2('0x7d')](_0x2d883b[_0xa8e2('0x36')][_0xa8e2('0x7a')],_[_0xa8e2('0x7e')](_0x2d883b[_0xa8e2('0x36')],[_0xa8e2('0x7a'),'id'])||{})[_0xa8e2('0x7f')](function(_0x37b39a){for(var _0x36179f=0x0;_0x36179f<_0x2d883b[_0xa8e2('0x36')][_0xa8e2('0x7a')]['length'];_0x36179f+=0x1){socket['emit'](_0xa8e2('0x80'),{'UserId':Number(_0x2d883b[_0xa8e2('0x36')][_0xa8e2('0x7a')][_0x36179f]),'ChatQueueId':Number(_0x2d883b[_0xa8e2('0x2b')]['id'])});}return _0x37b39a;});}})[_0xa8e2('0x18')](respondWithResult(_0x1ec6e3,null))[_0xa8e2('0x2a')](handleError(_0x1ec6e3,null));};exports['removeAgents']=function(_0x23f42f,_0x7bcb0e){return db[_0xa8e2('0x21')][_0xa8e2('0x34')]({'where':{'id':_0x23f42f[_0xa8e2('0x2b')]['id']}})[_0xa8e2('0x18')](handleEntityNotFound(_0x7bcb0e,null))[_0xa8e2('0x18')](function(_0x413ce4){if(_0x413ce4){return _0x413ce4[_0xa8e2('0x81')](_0x23f42f[_0xa8e2('0x28')][_0xa8e2('0x7a')])['then'](function(){if(_[_0xa8e2('0x82')](_0x23f42f[_0xa8e2('0x28')][_0xa8e2('0x7a')])){for(var _0x4120e3=0x0;_0x4120e3<_0x23f42f['query']['ids'][_0xa8e2('0x31')];_0x4120e3+=0x1){socket['emit'](_0xa8e2('0x83'),{'UserId':Number(_0x23f42f[_0xa8e2('0x28')][_0xa8e2('0x7a')][_0x4120e3]),'ChatQueueId':Number(_0x23f42f[_0xa8e2('0x2b')]['id'])});}}else{socket[_0xa8e2('0x7c')](_0xa8e2('0x83'),{'UserId':Number(_0x23f42f[_0xa8e2('0x28')][_0xa8e2('0x7a')]),'ChatQueueId':Number(_0x23f42f[_0xa8e2('0x2b')]['id'])});}});}})['then'](respondWithStatusCode(_0x7bcb0e,null))['catch'](handleError(_0x7bcb0e,null));};exports[_0xa8e2('0x84')]=function(_0x47aa24,_0x52758b){var _0x1913ac={};var _0x5f0fe6={};var _0x57bdff;var _0x371dff;return db[_0xa8e2('0x21')]['findOne']({'where':{'id':_0x47aa24[_0xa8e2('0x2b')]['id']}})[_0xa8e2('0x18')](handleEntityNotFound(_0x52758b,null))[_0xa8e2('0x18')](function(_0x1bd028){if(_0x1bd028){_0x57bdff=_0x1bd028;_0x5f0fe6[_0xa8e2('0x2c')]=_[_0xa8e2('0x2d')](db[_0xa8e2('0x4d')][_0xa8e2('0x22')]);_0x5f0fe6['query']=_[_0xa8e2('0x2d')](_0x47aa24[_0xa8e2('0x28')]);_0x5f0fe6[_0xa8e2('0x47')]=_[_0xa8e2('0x2e')](_0x5f0fe6[_0xa8e2('0x2c')],_0x5f0fe6[_0xa8e2('0x28')]);_0x1913ac[_0xa8e2('0x30')]=_['intersection'](_0x5f0fe6['model'],qs[_0xa8e2('0x2f')](_0x47aa24[_0xa8e2('0x28')][_0xa8e2('0x2f')]));_0x1913ac[_0xa8e2('0x30')]=_0x1913ac['attributes'][_0xa8e2('0x31')]?_0x1913ac[_0xa8e2('0x30')]:_0x5f0fe6[_0xa8e2('0x2c')];_0x1913ac[_0xa8e2('0x59')]=qs[_0xa8e2('0x46')](_0x47aa24[_0xa8e2('0x28')]['sort']);_0x1913ac[_0xa8e2('0x49')]=qs[_0xa8e2('0x47')](_[_0xa8e2('0x48')](_0x47aa24[_0xa8e2('0x28')],_0x5f0fe6['filters']));if(_0x47aa24[_0xa8e2('0x28')][_0xa8e2('0x4a')]){_0x1913ac[_0xa8e2('0x49')]=_[_0xa8e2('0x32')](_0x1913ac[_0xa8e2('0x49')],{'$or':_['map'](_0x1913ac[_0xa8e2('0x30')],function(_0x1093c3){var _0x4bf724={};_0x4bf724[_0x1093c3]={'$like':'%'+_0x47aa24[_0xa8e2('0x28')][_0xa8e2('0x4a')]+'%'};return _0x4bf724;})});}_0x1913ac=_[_0xa8e2('0x32')]({},_0x1913ac,_0x47aa24[_0xa8e2('0x33')]);return _0x57bdff['getAgents'](_0x1913ac);}})[_0xa8e2('0x18')](function(_0x1ce8f2){if(_0x1ce8f2){_0x371dff=_0x1ce8f2[_0xa8e2('0x31')];if(!_0x47aa24[_0xa8e2('0x28')][_0xa8e2('0x5a')](_0xa8e2('0x44'))){_0x1913ac[_0xa8e2('0x45')]=qs[_0xa8e2('0x45')](_0x47aa24[_0xa8e2('0x28')][_0xa8e2('0x45')]);_0x1913ac[_0xa8e2('0x12')]=qs['offset'](_0x47aa24['query'][_0xa8e2('0x12')]);}return _0x57bdff[_0xa8e2('0x84')](_0x1913ac);}})[_0xa8e2('0x18')](function(_0x2bc091){if(_0x2bc091){return _0x2bc091?{'count':_0x371dff,'rows':_0x2bc091}:null;}})[_0xa8e2('0x18')](respondWithResult(_0x52758b,null))['catch'](handleError(_0x52758b,null));}; \ No newline at end of file +var _0xf92f=['defaults','localhost','./chatQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','json','update','then','destroy','get','ChatQueues','UserProfileResource','end','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','model','keys','intersection','fields','attributes','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','filters','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','UserChatQueue','UserId','chatPause','updatedAt','%s/%s','createdAt','getTeams','Team','addTeams','ids','User','Agents','online','interface','flatMap','transaction','findOrCreate','forEach','userChatQueue:save','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','sequelize','QueryTypes','every','TeamId','includes','all','union','compact','removeAgents','emit','userChatQueue:remove','addAgents','spread','isArray','getAgents','bluebird','lodash','squel','ioredis','../../config/environment','../../mysqldb','redis'];(function(_0x44dc4c,_0x357e6a){var _0x4e644e=function(_0x2f033e){while(--_0x2f033e){_0x44dc4c['push'](_0x44dc4c['shift']());}};_0x4e644e(++_0x357e6a);}(_0xf92f,0xdf));var _0xff92=function(_0x11e1b2,_0x24d02c){_0x11e1b2=_0x11e1b2-0x0;var _0x2d6782=_0xf92f[_0x11e1b2];return _0x2d6782;};'use strict';var BPromise=require(_0xff92('0x0'));var util=require('util');var _=require(_0xff92('0x1'));var squel=require(_0xff92('0x2'));var Redis=require(_0xff92('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0xff92('0x4'));var db=require(_0xff92('0x5'))['db'];config[_0xff92('0x6')]=_[_0xff92('0x7')](config['redis'],{'host':_0xff92('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xff92('0x6')]));require(_0xff92('0x9'))[_0xff92('0xa')](socket);function respondWithStatusCode(_0x53b9df,_0x4fcbc9){_0x4fcbc9=_0x4fcbc9||0xcc;return function(_0x1dd006){if(_0x1dd006){return _0x53b9df[_0xff92('0xb')](_0x4fcbc9);}return _0x53b9df[_0xff92('0xc')](_0x4fcbc9)['end']();};}function respondWithResult(_0x46b0fc,_0x4ba40b){_0x4ba40b=_0x4ba40b||0xc8;return function(_0x54577b){if(_0x54577b){return _0x46b0fc['status'](_0x4ba40b)['json'](_0x54577b);}};}function respondWithFilteredResult(_0x660daf,_0x2ce5b4){return function(_0x1551ae){if(_0x1551ae){var _0x398cf6=typeof _0x2ce5b4[_0xff92('0xd')]===_0xff92('0xe')&&typeof _0x2ce5b4[_0xff92('0xf')]==='undefined';var _0x46b3f=_0x1551ae[_0xff92('0x10')];var _0x3d8006=_0x398cf6?0x0:_0x2ce5b4['offset'];var _0x269c68=_0x398cf6?_0x1551ae[_0xff92('0x10')]:_0x2ce5b4[_0xff92('0xd')]+_0x2ce5b4[_0xff92('0xf')];var _0xeafb2;if(_0x269c68>=_0x46b3f){_0x269c68=_0x46b3f;_0xeafb2=0xc8;}else{_0xeafb2=0xce;}_0x660daf[_0xff92('0xc')](_0xeafb2);return _0x660daf[_0xff92('0x11')]('Content-Range',_0x3d8006+'-'+_0x269c68+'/'+_0x46b3f)[_0xff92('0x12')](_0x1551ae);}return null;};}function saveUpdates(_0x58b21a){return function(_0x5da68f){if(_0x5da68f){return _0x5da68f[_0xff92('0x13')](_0x58b21a)[_0xff92('0x14')](function(_0x50b770){return _0x50b770;});}return null;};}function removeEntity(_0x35ad2a){return function(_0x32e45a){if(_0x32e45a){return _0x32e45a[_0xff92('0x15')]()['then'](function(){var _0x558427=_0x32e45a[_0xff92('0x16')]({'plain':!![]});var _0x285f69=_0xff92('0x17');return db[_0xff92('0x18')]['destroy']({'where':{'type':_0x285f69,'resourceId':_0x558427['id']}})[_0xff92('0x14')](function(){return _0x32e45a;});})['then'](function(){_0x35ad2a['status'](0xcc)[_0xff92('0x19')]();});}};}function handleEntityNotFound(_0x53d1d5){return function(_0x5c7487){if(!_0x5c7487){_0x53d1d5[_0xff92('0xb')](0x194);}return _0x5c7487;};}function handleError(_0x24f6d7,_0x2c53bb){_0x2c53bb=_0x2c53bb||0x1f4;return function(_0xbcd1f4){logger[_0xff92('0x1a')](_0xbcd1f4[_0xff92('0x1b')]);if(_0xbcd1f4[_0xff92('0x1c')]){delete _0xbcd1f4[_0xff92('0x1c')];}_0x24f6d7[_0xff92('0xc')](_0x2c53bb)[_0xff92('0x1d')](_0xbcd1f4);};}exports[_0xff92('0x1e')]=function(_0x49dc1f,_0x1fbd78){var _0x40d5ec={};var _0x38c7a2={'count':0x0,'rows':[]};var _0x599dd5=_[_0xff92('0x1f')](db[_0xff92('0x20')][_0xff92('0x21')],function(_0x4893fc){return{'name':_0x4893fc[_0xff92('0x22')],'type':_0x4893fc[_0xff92('0x23')][_0xff92('0x24')]};});_0x40d5ec=qs[_0xff92('0x25')](_0x599dd5,_0x49dc1f);var _0x1df3f7={'where':_0x40d5ec[_0xff92('0x26')]};return db[_0xff92('0x20')][_0xff92('0x10')](_0x1df3f7)['then'](function(_0x39c308){_0x38c7a2[_0xff92('0x10')]=_0x39c308;_0x40d5ec[_0xff92('0x27')]=qs['include'](_0x49dc1f[_0xff92('0x28')]);return db['ChatQueue'][_0xff92('0x29')](_0x40d5ec);})['then'](function(_0x2c1bfb){_0x38c7a2[_0xff92('0x2a')]=_0x2c1bfb;return _0x38c7a2;})[_0xff92('0x14')](respondWithFilteredResult(_0x1fbd78,_0x40d5ec))[_0xff92('0x2b')](handleError(_0x1fbd78,null));};exports[_0xff92('0x2c')]=function(_0x3b5953,_0x467f65){var _0xab4e18={'raw':!![],'where':{'id':_0x3b5953[_0xff92('0x2d')]['id']}},_0x42f7f3={};_0x42f7f3[_0xff92('0x2e')]=_[_0xff92('0x2f')](db[_0xff92('0x20')][_0xff92('0x21')]);_0x42f7f3[_0xff92('0x28')]=_[_0xff92('0x2f')](_0x3b5953[_0xff92('0x28')]);_0x42f7f3['filters']=_[_0xff92('0x30')](_0x42f7f3[_0xff92('0x2e')],_0x42f7f3['query']);_0xab4e18['attributes']=_[_0xff92('0x30')](_0x42f7f3[_0xff92('0x2e')],qs[_0xff92('0x31')](_0x3b5953[_0xff92('0x28')][_0xff92('0x31')]));_0xab4e18[_0xff92('0x32')]=_0xab4e18[_0xff92('0x32')][_0xff92('0x33')]?_0xab4e18[_0xff92('0x32')]:_0x42f7f3[_0xff92('0x2e')];if(_0x3b5953['query']['includeAll']){_0xab4e18[_0xff92('0x27')]=[{'all':!![]}];}_0xab4e18=_[_0xff92('0x34')]({},_0xab4e18,_0x3b5953[_0xff92('0x35')]);return db[_0xff92('0x20')][_0xff92('0x36')](_0xab4e18)[_0xff92('0x14')](handleEntityNotFound(_0x467f65,null))[_0xff92('0x14')](respondWithResult(_0x467f65,null))[_0xff92('0x2b')](handleError(_0x467f65,null));};exports['create']=function(_0x373cd3,_0x435aed){return db[_0xff92('0x20')][_0xff92('0x37')](_0x373cd3[_0xff92('0x38')],{})[_0xff92('0x14')](function(_0x1187a1){var _0x3c33f9=_0x373cd3[_0xff92('0x39')][_0xff92('0x16')]({'plain':!![]});if(!_0x3c33f9)throw new Error(_0xff92('0x3a'));if(_0x3c33f9['role']===_0xff92('0x39')){var _0x4fa64d=_0x1187a1[_0xff92('0x16')]({'plain':!![]});var _0xc25d4e=_0xff92('0x17');return db[_0xff92('0x3b')][_0xff92('0x36')]({'where':{'name':_0xc25d4e,'userProfileId':_0x3c33f9[_0xff92('0x3c')]},'raw':!![]})[_0xff92('0x14')](function(_0x25fb46){if(_0x25fb46&&_0x25fb46[_0xff92('0x3d')]===0x0){return db[_0xff92('0x18')]['create']({'name':_0x4fa64d[_0xff92('0x1c')],'resourceId':_0x4fa64d['id'],'type':_0x25fb46[_0xff92('0x1c')],'sectionId':_0x25fb46['id']},{})[_0xff92('0x14')](function(){return _0x1187a1;});}else{return _0x1187a1;}})[_0xff92('0x2b')](function(_0x54cebf){logger[_0xff92('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54cebf);throw _0x54cebf;});}return _0x1187a1;})[_0xff92('0x14')](respondWithResult(_0x435aed,0xc9))['catch'](handleError(_0x435aed,null));};exports[_0xff92('0x13')]=function(_0x509940,_0x45dbc5){if(_0x509940[_0xff92('0x38')]['id']){delete _0x509940[_0xff92('0x38')]['id'];}return db[_0xff92('0x20')][_0xff92('0x36')]({'where':{'id':_0x509940[_0xff92('0x2d')]['id']}})[_0xff92('0x14')](handleEntityNotFound(_0x45dbc5,null))['then'](saveUpdates(_0x509940['body'],null))[_0xff92('0x14')](respondWithResult(_0x45dbc5,null))['catch'](handleError(_0x45dbc5,null));};exports['destroy']=function(_0x3eee9e,_0x595abd){return db[_0xff92('0x20')][_0xff92('0x36')]({'where':{'id':_0x3eee9e[_0xff92('0x2d')]['id']}})[_0xff92('0x14')](handleEntityNotFound(_0x595abd,null))[_0xff92('0x14')](removeEntity(_0x595abd,null))['catch'](handleError(_0x595abd,null));};exports[_0xff92('0x3e')]=function(_0x4160b5,_0x7bcde6){return db[_0xff92('0x20')][_0xff92('0x3e')]()[_0xff92('0x14')](respondWithResult(_0x7bcde6,null))[_0xff92('0x2b')](handleError(_0x7bcde6,null));};exports[_0xff92('0x3f')]=function(_0x4780d0,_0x31f70b){var _0x26d292={'raw':!![],'where':{}},_0x446277={},_0x42800f;return db[_0xff92('0x20')][_0xff92('0x40')]({'where':{'id':_0x4780d0[_0xff92('0x2d')]['id']}})['then'](handleEntityNotFound(_0x31f70b,null))[_0xff92('0x14')](function(_0x8cd9c5){if(_0x8cd9c5){_0x42800f=_0x8cd9c5[_0xff92('0x16')]({'plain':!![]});_0x446277['model']=_[_0xff92('0x2f')](db['UserChatQueue'][_0xff92('0x21')]);_0x446277[_0xff92('0x28')]=_['keys'](_0x4780d0['query']);_0x446277[_0xff92('0x41')]=_[_0xff92('0x30')](_0x446277[_0xff92('0x2e')],_0x446277[_0xff92('0x28')]);_0x26d292[_0xff92('0x32')]=_['intersection'](_0x446277['model'],qs[_0xff92('0x31')](_0x4780d0['query'][_0xff92('0x31')]));_0x26d292[_0xff92('0x32')]=_0x26d292['attributes'][_0xff92('0x33')]?_0x26d292[_0xff92('0x32')]:_0x446277[_0xff92('0x2e')];if(!_0x4780d0['query'][_0xff92('0x42')](_0xff92('0x43'))){_0x26d292['limit']=qs[_0xff92('0xf')](_0x4780d0['query'][_0xff92('0xf')]);_0x26d292[_0xff92('0xd')]=qs[_0xff92('0xd')](_0x4780d0[_0xff92('0x28')][_0xff92('0xd')]);}_0x26d292[_0xff92('0x44')]=qs[_0xff92('0x45')](_0x4780d0[_0xff92('0x28')]['sort']);_0x26d292[_0xff92('0x26')]=qs['filters'](_[_0xff92('0x46')](_0x4780d0[_0xff92('0x28')],_0x446277[_0xff92('0x41')]));_0x26d292[_0xff92('0x26')][_0xff92('0x47')]=_0x8cd9c5['id'];if(_0x4780d0['query'][_0xff92('0x48')]){_0x26d292[_0xff92('0x26')]=_[_0xff92('0x34')](_0x26d292[_0xff92('0x26')],{'$or':_[_0xff92('0x1f')](_0x26d292[_0xff92('0x32')],function(_0x1510b3){var _0x59b4f0={};_0x59b4f0[_0x1510b3]={'$like':'%'+_0x4780d0[_0xff92('0x28')][_0xff92('0x48')]+'%'};return _0x59b4f0;})});}_0x26d292=_['merge']({},_0x26d292,_0x4780d0[_0xff92('0x35')]);return db[_0xff92('0x49')][_0xff92('0x29')](_0x26d292);}})[_0xff92('0x14')](function(_0x36e7ad){if(_0x36e7ad){return db['User']['findAndCountAll']({'where':{'id':_[_0xff92('0x1f')](_0x36e7ad,_0xff92('0x4a')),'role':'agent'},'attributes':['id',_0xff92('0x1c'),_0xff92('0x4b'),_0xff92('0x4c'),'createdAt']});}})[_0xff92('0x14')](function(_0x18a64a){if(_0x18a64a){return{'count':_0x18a64a[_0xff92('0x10')],'rows':_['map'](_0x18a64a[_0xff92('0x2a')],function(_0x1de085){return{'membername':_0x1de085['name'],'UserId':_0x1de085['id'],'queue_name':_0x42800f['name'],'ChatQueueId':_0x42800f['id'],'interface':util['format'](_0xff92('0x4d'),'SIP',_0x1de085[_0xff92('0x1c')]),'penalty':0x0,'paused':_0x1de085[_0xff92('0x4b')],'createdAt':_0x1de085[_0xff92('0x4e')],'updatedAt':_0x1de085[_0xff92('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xff92('0x14')](respondWithFilteredResult(_0x31f70b,_0x26d292))[_0xff92('0x2b')](handleError(_0x31f70b,null));};exports[_0xff92('0x4f')]=function(_0x23203a,_0x597489){var _0x2d3723={};var _0x2ae8f8={};var _0xb16e2;var _0x35e24c;return db[_0xff92('0x20')][_0xff92('0x40')]({'where':{'id':_0x23203a[_0xff92('0x2d')]['id']}})[_0xff92('0x14')](handleEntityNotFound(_0x597489,null))[_0xff92('0x14')](function(_0x987c52){if(_0x987c52){_0xb16e2=_0x987c52;_0x2ae8f8[_0xff92('0x2e')]=_[_0xff92('0x2f')](db[_0xff92('0x50')][_0xff92('0x21')]);_0x2ae8f8[_0xff92('0x28')]=_[_0xff92('0x2f')](_0x23203a[_0xff92('0x28')]);_0x2ae8f8[_0xff92('0x41')]=_[_0xff92('0x30')](_0x2ae8f8['model'],_0x2ae8f8[_0xff92('0x28')]);_0x2d3723[_0xff92('0x32')]=_[_0xff92('0x30')](_0x2ae8f8[_0xff92('0x2e')],qs['fields'](_0x23203a['query'][_0xff92('0x31')]));_0x2d3723[_0xff92('0x32')]=_0x2d3723[_0xff92('0x32')][_0xff92('0x33')]?_0x2d3723[_0xff92('0x32')]:_0x2ae8f8[_0xff92('0x2e')];_0x2d3723[_0xff92('0x44')]=qs[_0xff92('0x45')](_0x23203a[_0xff92('0x28')][_0xff92('0x45')]);_0x2d3723['where']=qs[_0xff92('0x41')](_[_0xff92('0x46')](_0x23203a[_0xff92('0x28')],_0x2ae8f8[_0xff92('0x41')]));if(_0x23203a['query'][_0xff92('0x48')]){_0x2d3723[_0xff92('0x26')]=_[_0xff92('0x34')](_0x2d3723[_0xff92('0x26')],{'$or':_[_0xff92('0x1f')](_0x2d3723[_0xff92('0x32')],function(_0x2cdc86){var _0x486de7={};_0x486de7[_0x2cdc86]={'$like':'%'+_0x23203a[_0xff92('0x28')]['filter']+'%'};return _0x486de7;})});}_0x2d3723=_[_0xff92('0x34')]({},_0x2d3723,_0x23203a[_0xff92('0x35')]);return _0xb16e2['getTeams'](_0x2d3723);}})['then'](function(_0x3f4b31){if(_0x3f4b31){_0x35e24c=_0x3f4b31['length'];if(!_0x23203a[_0xff92('0x28')][_0xff92('0x42')](_0xff92('0x43'))){_0x2d3723[_0xff92('0xf')]=qs['limit'](_0x23203a[_0xff92('0x28')][_0xff92('0xf')]);_0x2d3723[_0xff92('0xd')]=qs['offset'](_0x23203a[_0xff92('0x28')][_0xff92('0xd')]);}return _0xb16e2['getTeams'](_0x2d3723);}})[_0xff92('0x14')](function(_0x43a4a){if(_0x43a4a){return _0x43a4a?{'count':_0x35e24c,'rows':_0x43a4a}:null;}})[_0xff92('0x14')](respondWithResult(_0x597489,null))[_0xff92('0x2b')](handleError(_0x597489,null));};exports[_0xff92('0x51')]=function(_0xbd93a4,_0x153d60){var _0x41f718=_0xbd93a4[_0xff92('0x38')][_0xff92('0x52')];return db[_0xff92('0x50')]['findAll']({'where':{'id':_0x41f718},'attributes':['id'],'include':[{'model':db[_0xff92('0x53')],'as':_0xff92('0x54'),'attributes':['id',_0xff92('0x1c'),_0xff92('0x55'),'voicePause',_0xff92('0x56')],'raw':!![]}]})[_0xff92('0x14')](function(_0x3ba60a){if(_0x3ba60a){var _0x52fd2f=_[_0xff92('0x57')](_0x3ba60a,function(_0x1ab607){var _0x5d5727=_0x1ab607[_0xff92('0x16')]({'plain':!![]});return _0x5d5727['Agents'];});return db[_0xff92('0x20')][_0xff92('0x36')]({'where':{'id':_0xbd93a4[_0xff92('0x2d')]['id']}})['then'](function(_0x3da8cf){return db['sequelize'][_0xff92('0x58')](function(_0x410873){return _0x3da8cf[_0xff92('0x51')](_0x41f718,{'transaction':_0x410873})[_0xff92('0x14')](function(){return BPromise['each'](_0x52fd2f,function(_0x264730){return db[_0xff92('0x49')][_0xff92('0x59')]({'where':{'UserId':_0x264730['id'],'ChatQueueId':_0xbd93a4[_0xff92('0x2d')]['id']},'transaction':_0x410873});});})[_0xff92('0x14')](function(){_0x52fd2f[_0xff92('0x5a')](function(_0x543ade){socket['emit'](_0xff92('0x5b'),{'UserId':_0x543ade['id'],'ChatQueueId':_0x3da8cf['id']});});});});});}})[_0xff92('0x14')](respondWithStatusCode(_0x153d60,null))[_0xff92('0x2b')](handleError(_0x153d60,null));};exports['removeTeams']=function(_0x51d691,_0x91006){return db[_0xff92('0x50')][_0xff92('0x29')]({'where':{'id':_0x51d691['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xff92('0x53')],'as':_0xff92('0x54'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x91006,null))['then'](function(_0x4c52ed){var _0x5a3c60=_[_0xff92('0x1f')](_0x4c52ed,'id');var _0x5338c6=[];var _0x379f7e=[];var _0x2eb81a=squel['select']();_0x2eb81a[_0xff92('0x5c')](_0xff92('0x5d'))[_0xff92('0x5e')](_0xff92('0x5f'),'tq')[_0xff92('0x60')](_0xff92('0x61'),'ut',_0xff92('0x62'))[_0xff92('0x26')](_0xff92('0x63'),_0x51d691['params']['id']);for(var _0x1f2aaf=0x0;_0x1f2aaf<_0x4c52ed[_0xff92('0x33')];_0x1f2aaf+=0x1){let _0x227dd1=_0x4c52ed[_0x1f2aaf];for(var _0x8ae2e1=0x0;_0x8ae2e1<_0x227dd1[_0xff92('0x54')]['length'];_0x8ae2e1+=0x1){let _0x175a1e=_0x227dd1['Agents'][_0x8ae2e1];var _0xf6f2e=_0x2eb81a['clone']();_0xf6f2e[_0xff92('0x26')]('ut.UserId\x20=\x20?',_0x175a1e['id']);_0x379f7e['push'](db[_0xff92('0x64')][_0xff92('0x28')](_0xf6f2e['toString'](),{'type':db['sequelize'][_0xff92('0x65')]['SELECT']})['then'](function(_0xb394f2){if(_0xb394f2['length']===0x1){return _0x175a1e['id'];}else{var _0x4939cd=_[_0xff92('0x66')](_[_0xff92('0x1f')](_0xb394f2,_0xff92('0x67')),function(_0x12c776){return _[_0xff92('0x68')](_0x5a3c60,_0x12c776);});if(_0x4939cd){return _0x175a1e['id'];}}}));}}return BPromise[_0xff92('0x69')](_0x379f7e)[_0xff92('0x14')](function(_0x4db6f7){_0x5338c6=_(_0x5338c6)[_0xff92('0x6a')](_0x4db6f7)[_0xff92('0x6b')]()['value']();return db[_0xff92('0x20')][_0xff92('0x36')]({'where':{'id':_0x51d691[_0xff92('0x2d')]['id']}})[_0xff92('0x14')](function(_0x4963a1){return db[_0xff92('0x64')][_0xff92('0x58')](function(_0x1cfd4d){return _0x4963a1['removeTeams'](_0x51d691[_0xff92('0x28')][_0xff92('0x52')],{'transaction':_0x1cfd4d})['then'](function(){if(!_['isEmpty'](_0x5338c6)){return _0x4963a1[_0xff92('0x6c')](_0x5338c6,{'transaction':_0x1cfd4d});}})[_0xff92('0x14')](function(){_0x5338c6[_0xff92('0x5a')](function(_0x17bd78){socket[_0xff92('0x6d')](_0xff92('0x6e'),{'UserId':_0x17bd78,'ChatQueueId':_0x4963a1['id']});});});});});});})['then'](respondWithStatusCode(_0x91006,null))[_0xff92('0x2b')](handleError(_0x91006,null));};exports[_0xff92('0x6f')]=function(_0x25903e,_0x634f4f){return db[_0xff92('0x20')][_0xff92('0x36')]({'where':{'id':_0x25903e[_0xff92('0x2d')]['id']}})['then'](handleEntityNotFound(_0x634f4f,null))['then'](function(_0x4a7870){if(_0x4a7870){return _0x4a7870[_0xff92('0x6f')](_0x25903e[_0xff92('0x38')][_0xff92('0x52')],_['omit'](_0x25903e[_0xff92('0x38')],[_0xff92('0x52'),'id'])||{})[_0xff92('0x70')](function(_0x3ec1e1){for(var _0x55d155=0x0;_0x55d155<_0x25903e[_0xff92('0x38')][_0xff92('0x52')][_0xff92('0x33')];_0x55d155+=0x1){socket[_0xff92('0x6d')](_0xff92('0x5b'),{'UserId':Number(_0x25903e[_0xff92('0x38')][_0xff92('0x52')][_0x55d155]),'ChatQueueId':Number(_0x25903e[_0xff92('0x2d')]['id'])});}return _0x3ec1e1;});}})[_0xff92('0x14')](respondWithResult(_0x634f4f,null))['catch'](handleError(_0x634f4f,null));};exports['removeAgents']=function(_0x68baac,_0x5d21ab){return db[_0xff92('0x20')][_0xff92('0x36')]({'where':{'id':_0x68baac['params']['id']}})[_0xff92('0x14')](handleEntityNotFound(_0x5d21ab,null))[_0xff92('0x14')](function(_0x5b297f){if(_0x5b297f){return _0x5b297f[_0xff92('0x6c')](_0x68baac[_0xff92('0x28')]['ids'])[_0xff92('0x14')](function(){if(_[_0xff92('0x71')](_0x68baac[_0xff92('0x28')]['ids'])){for(var _0x5a498c=0x0;_0x5a498c<_0x68baac['query'][_0xff92('0x52')]['length'];_0x5a498c+=0x1){socket[_0xff92('0x6d')](_0xff92('0x6e'),{'UserId':Number(_0x68baac[_0xff92('0x28')]['ids'][_0x5a498c]),'ChatQueueId':Number(_0x68baac[_0xff92('0x2d')]['id'])});}}else{socket[_0xff92('0x6d')](_0xff92('0x6e'),{'UserId':Number(_0x68baac[_0xff92('0x28')][_0xff92('0x52')]),'ChatQueueId':Number(_0x68baac['params']['id'])});}});}})[_0xff92('0x14')](respondWithStatusCode(_0x5d21ab,null))[_0xff92('0x2b')](handleError(_0x5d21ab,null));};exports[_0xff92('0x72')]=function(_0x2c6fbf,_0x3e853d){var _0x55c39f={};var _0xfd12e6={};var _0x2fbed2;var _0x1d5fcf;return db[_0xff92('0x20')][_0xff92('0x40')]({'where':{'id':_0x2c6fbf[_0xff92('0x2d')]['id']}})[_0xff92('0x14')](handleEntityNotFound(_0x3e853d,null))['then'](function(_0x35ca81){if(_0x35ca81){_0x2fbed2=_0x35ca81;_0xfd12e6[_0xff92('0x2e')]=_[_0xff92('0x2f')](db[_0xff92('0x53')][_0xff92('0x21')]);_0xfd12e6[_0xff92('0x28')]=_['keys'](_0x2c6fbf['query']);_0xfd12e6[_0xff92('0x41')]=_[_0xff92('0x30')](_0xfd12e6[_0xff92('0x2e')],_0xfd12e6[_0xff92('0x28')]);_0x55c39f[_0xff92('0x32')]=_['intersection'](_0xfd12e6['model'],qs[_0xff92('0x31')](_0x2c6fbf[_0xff92('0x28')][_0xff92('0x31')]));_0x55c39f[_0xff92('0x32')]=_0x55c39f[_0xff92('0x32')][_0xff92('0x33')]?_0x55c39f[_0xff92('0x32')]:_0xfd12e6[_0xff92('0x2e')];_0x55c39f['order']=qs['sort'](_0x2c6fbf[_0xff92('0x28')]['sort']);_0x55c39f[_0xff92('0x26')]=qs[_0xff92('0x41')](_[_0xff92('0x46')](_0x2c6fbf[_0xff92('0x28')],_0xfd12e6[_0xff92('0x41')]));if(_0x2c6fbf[_0xff92('0x28')][_0xff92('0x48')]){_0x55c39f[_0xff92('0x26')]=_[_0xff92('0x34')](_0x55c39f[_0xff92('0x26')],{'$or':_[_0xff92('0x1f')](_0x55c39f[_0xff92('0x32')],function(_0x4c1b5f){var _0x57ef54={};_0x57ef54[_0x4c1b5f]={'$like':'%'+_0x2c6fbf[_0xff92('0x28')][_0xff92('0x48')]+'%'};return _0x57ef54;})});}_0x55c39f=_['merge']({},_0x55c39f,_0x2c6fbf[_0xff92('0x35')]);return _0x2fbed2[_0xff92('0x72')](_0x55c39f);}})[_0xff92('0x14')](function(_0x543f13){if(_0x543f13){_0x1d5fcf=_0x543f13[_0xff92('0x33')];if(!_0x2c6fbf[_0xff92('0x28')][_0xff92('0x42')](_0xff92('0x43'))){_0x55c39f[_0xff92('0xf')]=qs['limit'](_0x2c6fbf[_0xff92('0x28')][_0xff92('0xf')]);_0x55c39f['offset']=qs[_0xff92('0xd')](_0x2c6fbf[_0xff92('0x28')][_0xff92('0xd')]);}return _0x2fbed2[_0xff92('0x72')](_0x55c39f);}})[_0xff92('0x14')](function(_0x2447dc){if(_0x2447dc){return _0x2447dc?{'count':_0x1d5fcf,'rows':_0x2447dc}:null;}})['then'](respondWithResult(_0x3e853d,null))[_0xff92('0x2b')](handleError(_0x3e853d,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 925800d..e985419 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 _0x520e=['exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x246f0c,_0x39f734){var _0x30fe50=function(_0x9a975c){while(--_0x9a975c){_0x246f0c['push'](_0x246f0c['shift']());}};_0x30fe50(++_0x39f734);}(_0x520e,0x90));var _0xe520=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x520e[_0x5ddb1c];return _0x354adc;};'use strict';var EventEmitter=require(_0xe520('0x0'));var ChatQueue=require(_0xe520('0x1'))['db'][_0xe520('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe520('0x3')](0x0);var events={'afterCreate':_0xe520('0x4'),'afterUpdate':_0xe520('0x5'),'afterDestroy':_0xe520('0x6')};function emitEvent(_0x53ed75){return function(_0x2724f4,_0x120b9f,_0x56ab37){ChatQueueEvents[_0xe520('0x7')](_0x53ed75+':'+_0x2724f4['id'],_0x2724f4);ChatQueueEvents[_0xe520('0x7')](_0x53ed75,_0x2724f4);_0x56ab37(null);};}for(var e in events){if(events[_0xe520('0x8')](e)){var event=events[e];ChatQueue[_0xe520('0x9')](e,emitEvent(event));}}module[_0xe520('0xa')]=ChatQueueEvents; \ No newline at end of file +var _0xcf13=['exports','../../mysqldb','ChatQueue','save','emit','hook'];(function(_0x59e8ed,_0x3c82a1){var _0x3dd124=function(_0x3b9194){while(--_0x3b9194){_0x59e8ed['push'](_0x59e8ed['shift']());}};_0x3dd124(++_0x3c82a1);}(_0xcf13,0x1b7));var _0x3cf1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf13[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x3cf1('0x0'))['db'][_0x3cf1('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3cf1('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x26d776){return function(_0x34cd84,_0x20c5cd,_0x59a857){ChatQueueEvents['emit'](_0x26d776+':'+_0x34cd84['id'],_0x34cd84);ChatQueueEvents[_0x3cf1('0x3')](_0x26d776,_0x34cd84);_0x59a857(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x3cf1('0x4')](e,emitEvent(event));}}module[_0x3cf1('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 e4d9433..d277a7e 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 _0xf98d=['moment','bluebird','request-promise','path','rimraf','exports','define','chat_queues','lodash','../../config/logger','api'];(function(_0x16337a,_0x4789a1){var _0x422365=function(_0x34f039){while(--_0x34f039){_0x16337a['push'](_0x16337a['shift']());}};_0x422365(++_0x4789a1);}(_0xf98d,0x81));var _0xdf98=function(_0x364588,_0xef20c6){_0x364588=_0x364588-0x0;var _0x1a7a7d=_0xf98d[_0x364588];return _0x1a7a7d;};'use strict';var _=require(_0xdf98('0x0'));var util=require('util');var logger=require(_0xdf98('0x1'))(_0xdf98('0x2'));var moment=require(_0xdf98('0x3'));var BPromise=require(_0xdf98('0x4'));var rp=require(_0xdf98('0x5'));var fs=require('fs');var path=require(_0xdf98('0x6'));var rimraf=require(_0xdf98('0x7'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0xdf98('0x8')]=function(_0x7dce23,_0xb09f4e){return _0x7dce23[_0xdf98('0x9')]('ChatQueue',attributes,{'tableName':_0xdf98('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x91a6=['lodash','util','../../config/logger','api','request-promise','path','rimraf','./chatQueue.attributes','exports','ChatQueue','chat_queues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x91a6,0x1ef));var _0x691a=function(_0x544d66,_0x1738b6){_0x544d66=_0x544d66-0x0;var _0x1b6800=_0x91a6[_0x544d66];return _0x1b6800;};'use strict';var _=require(_0x691a('0x0'));var util=require(_0x691a('0x1'));var logger=require(_0x691a('0x2'))(_0x691a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x691a('0x4'));var fs=require('fs');var path=require(_0x691a('0x5'));var rimraf=require(_0x691a('0x6'));var config=require('../../config/environment');var attributes=require(_0x691a('0x7'));module[_0x691a('0x8')]=function(_0x406f39,_0x4cb2a8){return _0x406f39['define'](_0x691a('0x9'),attributes,{'tableName':_0x691a('0xa'),'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 b241d71..162ebd2 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 _0x42f4=['limit','include','model','map','ShowChatQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes'];(function(_0x2ab559,_0x3f4e89){var _0x22ceb9=function(_0x7d8f21){while(--_0x7d8f21){_0x2ab559['push'](_0x2ab559['shift']());}};_0x22ceb9(++_0x3f4e89);}(_0x42f4,0x19d));var _0x442f=function(_0x581960,_0x1232ff){_0x581960=_0x581960-0x0;var _0x4ee892=_0x42f4[_0x581960];return _0x4ee892;};'use strict';var _=require(_0x442f('0x0'));var util=require('util');var moment=require(_0x442f('0x1'));var BPromise=require(_0x442f('0x2'));var rs=require(_0x442f('0x3'));var fs=require('fs');var Redis=require(_0x442f('0x4'));var db=require(_0x442f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x442f('0x6'));var jayson=require(_0x442f('0x7'));var client=jayson['client'][_0x442f('0x8')]({'port':0x232a});config[_0x442f('0x9')]=_[_0x442f('0xa')](config[_0x442f('0x9')],{'host':_0x442f('0xb'),'port':0x18eb});var socket=require(_0x442f('0xc'))(new Redis(config['redis']));require(_0x442f('0xd'))['register'](socket);function respondWithRpcPromise(_0x541889,_0x57c026,_0x46e693){return new BPromise(function(_0x3dd176,_0x3d3baf){return client[_0x442f('0xe')](_0x541889,_0x46e693)[_0x442f('0xf')](function(_0x203d7b){logger[_0x442f('0x10')](_0x442f('0x11'),_0x57c026,_0x442f('0x12'));logger[_0x442f('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x57c026,_0x442f('0x12'),JSON[_0x442f('0x14')](_0x203d7b));if(_0x203d7b[_0x442f('0x15')]){if(_0x203d7b[_0x442f('0x15')][_0x442f('0x16')]===0x1f4){logger[_0x442f('0x15')](_0x442f('0x11'),_0x57c026,_0x203d7b[_0x442f('0x15')][_0x442f('0x17')]);return _0x3d3baf(_0x203d7b[_0x442f('0x15')][_0x442f('0x17')]);}logger[_0x442f('0x15')](_0x442f('0x11'),_0x57c026,_0x203d7b[_0x442f('0x15')][_0x442f('0x17')]);return _0x3dd176(_0x203d7b[_0x442f('0x15')]['message']);}else{logger[_0x442f('0x10')]('ChatQueue,\x20%s,\x20%s',_0x57c026,'request\x20sent');_0x3dd176(_0x203d7b['result']['message']);}})[_0x442f('0x18')](function(_0x3c9661){logger[_0x442f('0x15')](_0x442f('0x11'),_0x57c026,_0x3c9661);_0x3d3baf(_0x3c9661);});});}exports[_0x442f('0x19')]=function(_0x13b37a){var _0x520d2f=this;return new Promise(function(_0x2ded18,_0x552f81){return db[_0x442f('0x1a')][_0x442f('0x1b')]({'raw':_0x13b37a[_0x442f('0x1c')]?_0x13b37a['options'][_0x442f('0x1d')]===undefined?!![]:![]:!![],'where':_0x13b37a[_0x442f('0x1c')]?_0x13b37a['options']['where']||null:null,'attributes':_0x13b37a[_0x442f('0x1c')]?_0x13b37a[_0x442f('0x1c')][_0x442f('0x1e')]||null:null,'limit':_0x13b37a[_0x442f('0x1c')]?_0x13b37a[_0x442f('0x1c')][_0x442f('0x1f')]||null:null,'include':_0x13b37a[_0x442f('0x1c')]?_0x13b37a[_0x442f('0x1c')][_0x442f('0x20')]?_['map'](_0x13b37a[_0x442f('0x1c')][_0x442f('0x20')],function(_0x31b66a){return{'model':db[_0x31b66a[_0x442f('0x21')]],'as':_0x31b66a['as'],'attributes':_0x31b66a['attributes'],'include':_0x31b66a[_0x442f('0x20')]?_[_0x442f('0x22')](_0x31b66a[_0x442f('0x20')],function(_0x3bcae2){return{'model':db[_0x3bcae2['model']],'as':_0x3bcae2['as'],'attributes':_0x3bcae2[_0x442f('0x1e')],'include':_0x3bcae2[_0x442f('0x20')]?_[_0x442f('0x22')](_0x3bcae2['include'],function(_0x37da9d){return{'model':db[_0x37da9d['model']],'as':_0x37da9d['as'],'attributes':_0x37da9d[_0x442f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x442f('0xf')](function(_0x75f990){logger['info'](_0x442f('0x19'),_0x13b37a);logger[_0x442f('0x13')](_0x442f('0x19'),_0x13b37a,JSON[_0x442f('0x14')](_0x75f990));_0x2ded18(_0x75f990);})[_0x442f('0x18')](function(_0x59d0d8){logger['error'](_0x442f('0x19'),_0x59d0d8['message'],_0x13b37a);_0x552f81(_0x520d2f[_0x442f('0x15')](0x1f4,_0x59d0d8[_0x442f('0x17')]));});});};exports[_0x442f('0x23')]=function(_0x1b9a60){var _0x39684d=this;return new Promise(function(_0x1232fe,_0x44ac9b){return db[_0x442f('0x1a')][_0x442f('0x24')]({'raw':_0x1b9a60['options']?_0x1b9a60[_0x442f('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1b9a60[_0x442f('0x1c')]?_0x1b9a60[_0x442f('0x1c')]['where']||null:null,'attributes':_0x1b9a60[_0x442f('0x1c')]?_0x1b9a60[_0x442f('0x1c')][_0x442f('0x1e')]||null:null,'include':_0x1b9a60[_0x442f('0x1c')]?_0x1b9a60[_0x442f('0x1c')]['include']?_[_0x442f('0x22')](_0x1b9a60[_0x442f('0x1c')][_0x442f('0x20')],function(_0x12d02b){return{'model':db[_0x12d02b[_0x442f('0x21')]],'as':_0x12d02b['as'],'attributes':_0x12d02b['attributes'],'include':_0x12d02b[_0x442f('0x20')]?_[_0x442f('0x22')](_0x12d02b['include'],function(_0x5f2575){return{'model':db[_0x5f2575[_0x442f('0x21')]],'as':_0x5f2575['as'],'attributes':_0x5f2575['attributes'],'include':_0x5f2575[_0x442f('0x20')]?_[_0x442f('0x22')](_0x5f2575[_0x442f('0x20')],function(_0x1e6266){return{'model':db[_0x1e6266[_0x442f('0x21')]],'as':_0x1e6266['as'],'attributes':_0x1e6266[_0x442f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x442f('0xf')](function(_0x5eceab){logger[_0x442f('0x10')](_0x442f('0x23'),_0x1b9a60);logger['debug'](_0x442f('0x23'),_0x1b9a60,JSON['stringify'](_0x5eceab));_0x1232fe(_0x5eceab);})[_0x442f('0x18')](function(_0x341d94){logger[_0x442f('0x15')]('ShowChatQueue',_0x341d94['message'],_0x1b9a60);_0x44ac9b(_0x39684d['error'](0x1f4,_0x341d94[_0x442f('0x17')]));});});}; \ No newline at end of file +var _0x2cf5=['model','stringify','catch','find','ShowChatQueue','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','limit','include','map'];(function(_0x456bd3,_0x58161b){var _0x5c5ba1=function(_0x1efab2){while(--_0x1efab2){_0x456bd3['push'](_0x456bd3['shift']());}};_0x5c5ba1(++_0x58161b);}(_0x2cf5,0x19f));var _0x52cf=function(_0x44103b,_0xbfa4fb){_0x44103b=_0x44103b-0x0;var _0x5dba51=_0x2cf5[_0x44103b];return _0x5dba51;};'use strict';var _=require(_0x52cf('0x0'));var util=require(_0x52cf('0x1'));var moment=require('moment');var BPromise=require(_0x52cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52cf('0x3'));var db=require(_0x52cf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x52cf('0x5'));var config=require(_0x52cf('0x6'));var jayson=require(_0x52cf('0x7'));var client=jayson[_0x52cf('0x8')][_0x52cf('0x9')]({'port':0x232a});config[_0x52cf('0xa')]=_[_0x52cf('0xb')](config[_0x52cf('0xa')],{'host':_0x52cf('0xc'),'port':0x18eb});var socket=require(_0x52cf('0xd'))(new Redis(config[_0x52cf('0xa')]));require('./chatQueue.socket')[_0x52cf('0xe')](socket);function respondWithRpcPromise(_0x201710,_0x2b9974,_0x120dab){return new BPromise(function(_0x4e5b19,_0xadb2a6){return client[_0x52cf('0xf')](_0x201710,_0x120dab)[_0x52cf('0x10')](function(_0x54806d){logger[_0x52cf('0x11')](_0x52cf('0x12'),_0x2b9974,_0x52cf('0x13'));logger[_0x52cf('0x14')](_0x52cf('0x15'),_0x2b9974,_0x52cf('0x13'),JSON['stringify'](_0x54806d));if(_0x54806d['error']){if(_0x54806d[_0x52cf('0x16')][_0x52cf('0x17')]===0x1f4){logger[_0x52cf('0x16')](_0x52cf('0x12'),_0x2b9974,_0x54806d[_0x52cf('0x16')][_0x52cf('0x18')]);return _0xadb2a6(_0x54806d[_0x52cf('0x16')][_0x52cf('0x18')]);}logger['error'](_0x52cf('0x12'),_0x2b9974,_0x54806d[_0x52cf('0x16')][_0x52cf('0x18')]);return _0x4e5b19(_0x54806d['error'][_0x52cf('0x18')]);}else{logger['info'](_0x52cf('0x12'),_0x2b9974,_0x52cf('0x13'));_0x4e5b19(_0x54806d[_0x52cf('0x19')][_0x52cf('0x18')]);}})['catch'](function(_0x229595){logger[_0x52cf('0x16')](_0x52cf('0x12'),_0x2b9974,_0x229595);_0xadb2a6(_0x229595);});});}exports[_0x52cf('0x1a')]=function(_0x4ab08f){var _0x326311=this;return new Promise(function(_0x5f5200,_0x1d9fdd){return db[_0x52cf('0x1b')][_0x52cf('0x1c')]({'raw':_0x4ab08f['options']?_0x4ab08f['options'][_0x52cf('0x1d')]===undefined?!![]:![]:!![],'where':_0x4ab08f[_0x52cf('0x1e')]?_0x4ab08f[_0x52cf('0x1e')][_0x52cf('0x1f')]||null:null,'attributes':_0x4ab08f[_0x52cf('0x1e')]?_0x4ab08f[_0x52cf('0x1e')][_0x52cf('0x20')]||null:null,'limit':_0x4ab08f[_0x52cf('0x1e')]?_0x4ab08f[_0x52cf('0x1e')][_0x52cf('0x21')]||null:null,'include':_0x4ab08f['options']?_0x4ab08f['options'][_0x52cf('0x22')]?_[_0x52cf('0x23')](_0x4ab08f[_0x52cf('0x1e')][_0x52cf('0x22')],function(_0x499ac7){return{'model':db[_0x499ac7['model']],'as':_0x499ac7['as'],'attributes':_0x499ac7[_0x52cf('0x20')],'include':_0x499ac7[_0x52cf('0x22')]?_[_0x52cf('0x23')](_0x499ac7[_0x52cf('0x22')],function(_0x42132c){return{'model':db[_0x42132c[_0x52cf('0x24')]],'as':_0x42132c['as'],'attributes':_0x42132c[_0x52cf('0x20')],'include':_0x42132c[_0x52cf('0x22')]?_[_0x52cf('0x23')](_0x42132c['include'],function(_0x4796b5){return{'model':db[_0x4796b5[_0x52cf('0x24')]],'as':_0x4796b5['as'],'attributes':_0x4796b5[_0x52cf('0x20')]};}):[]};}):[]};}):[]:[]})[_0x52cf('0x10')](function(_0x1e1318){logger['info'](_0x52cf('0x1a'),_0x4ab08f);logger[_0x52cf('0x14')](_0x52cf('0x1a'),_0x4ab08f,JSON[_0x52cf('0x25')](_0x1e1318));_0x5f5200(_0x1e1318);})[_0x52cf('0x26')](function(_0x1ed92a){logger['error'](_0x52cf('0x1a'),_0x1ed92a[_0x52cf('0x18')],_0x4ab08f);_0x1d9fdd(_0x326311[_0x52cf('0x16')](0x1f4,_0x1ed92a[_0x52cf('0x18')]));});});};exports['ShowChatQueue']=function(_0x1c6bc2){var _0xcffed3=this;return new Promise(function(_0x46eca4,_0x141871){return db[_0x52cf('0x1b')][_0x52cf('0x27')]({'raw':_0x1c6bc2[_0x52cf('0x1e')]?_0x1c6bc2[_0x52cf('0x1e')][_0x52cf('0x1d')]===undefined?!![]:![]:!![],'where':_0x1c6bc2[_0x52cf('0x1e')]?_0x1c6bc2['options']['where']||null:null,'attributes':_0x1c6bc2[_0x52cf('0x1e')]?_0x1c6bc2[_0x52cf('0x1e')][_0x52cf('0x20')]||null:null,'include':_0x1c6bc2[_0x52cf('0x1e')]?_0x1c6bc2['options']['include']?_[_0x52cf('0x23')](_0x1c6bc2[_0x52cf('0x1e')][_0x52cf('0x22')],function(_0xafd307){return{'model':db[_0xafd307[_0x52cf('0x24')]],'as':_0xafd307['as'],'attributes':_0xafd307[_0x52cf('0x20')],'include':_0xafd307[_0x52cf('0x22')]?_[_0x52cf('0x23')](_0xafd307[_0x52cf('0x22')],function(_0x163181){return{'model':db[_0x163181[_0x52cf('0x24')]],'as':_0x163181['as'],'attributes':_0x163181[_0x52cf('0x20')],'include':_0x163181[_0x52cf('0x22')]?_[_0x52cf('0x23')](_0x163181[_0x52cf('0x22')],function(_0x50d881){return{'model':db[_0x50d881[_0x52cf('0x24')]],'as':_0x50d881['as'],'attributes':_0x50d881[_0x52cf('0x20')]};}):[]};}):[]};}):[]:[]})[_0x52cf('0x10')](function(_0x2f9a0a){logger[_0x52cf('0x11')](_0x52cf('0x28'),_0x1c6bc2);logger[_0x52cf('0x14')]('ShowChatQueue',_0x1c6bc2,JSON[_0x52cf('0x25')](_0x2f9a0a));_0x46eca4(_0x2f9a0a);})[_0x52cf('0x26')](function(_0x5e56cc){logger['error'](_0x52cf('0x28'),_0x5e56cc['message'],_0x1c6bc2);_0x141871(_0xcffed3['error'](0x1f4,_0x5e56cc[_0x52cf('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index a640793..2ad06bd 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 _0xd6d6=['chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x373276,_0x42c878){var _0xdefed0=function(_0x30d136){while(--_0x30d136){_0x373276['push'](_0x373276['shift']());}};_0xdefed0(++_0x42c878);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x3cadd4,_0x2a1011){_0x3cadd4=_0x3cadd4-0x0;var _0x1a0d55=_0xd6d6[_0x3cadd4];return _0x1a0d55;};'use strict';var ChatQueueEvents=require(_0x6d6d('0x0'));var events=[_0x6d6d('0x1'),_0x6d6d('0x2'),_0x6d6d('0x3')];function createListener(_0x536523,_0x2e1aed){return function(_0x3b743d){_0x2e1aed[_0x6d6d('0x4')](_0x536523,_0x3b743d);};}function removeListener(_0x2a838a,_0x5207c9){return function(){ChatQueueEvents[_0x6d6d('0x5')](_0x2a838a,_0x5207c9);};}exports[_0x6d6d('0x6')]=function(_0x5702dc){for(var _0x210ff7=0x0,_0x1bf731=events[_0x6d6d('0x7')];_0x210ff7<_0x1bf731;_0x210ff7++){var _0x18f824=events[_0x210ff7];var _0xd49f57=createListener(_0x6d6d('0x8')+_0x18f824,_0x5702dc);ChatQueueEvents['on'](_0x18f824,_0xd49f57);}}; \ No newline at end of file +var _0x6737=['chatQueue:','save','remove','emit','removeListener'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x6737,0xe2));var _0x7673=function(_0xf68acb,_0x46d773){_0xf68acb=_0xf68acb-0x0;var _0x26d4c1=_0x6737[_0xf68acb];return _0x26d4c1;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x7673('0x0'),_0x7673('0x1'),'update'];function createListener(_0x2f05d4,_0x2a9cd0){return function(_0x43ee27){_0x2a9cd0[_0x7673('0x2')](_0x2f05d4,_0x43ee27);};}function removeListener(_0x54002e,_0x32e6f2){return function(){ChatQueueEvents[_0x7673('0x3')](_0x54002e,_0x32e6f2);};}exports['register']=function(_0x2f5edc){for(var _0x15230f=0x0,_0x5af802=events['length'];_0x15230f<_0x5af802;_0x15230f++){var _0x53d67d=events[_0x15230f];var _0x5292f7=createListener(_0x7673('0x4')+_0x53d67d,_0x2f5edc);ChatQueueEvents['on'](_0x53d67d,_0x5292f7);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 0b234eb..573c316 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x4b09e4,_0xfa6265){var _0x5408f4=function(_0x68b42d){while(--_0x68b42d){_0x4b09e4['push'](_0x4b09e4['shift']());}};_0x5408f4(++_0xfa6265);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0xa015c9,_0x307fb8){var _0x4ef54c=function(_0xc82a6b){while(--_0xc82a6b){_0xa015c9['push'](_0xa015c9['shift']());}};_0x4ef54c(++_0x307fb8);}(_0x7217,0x19e));var _0x7721=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x7217[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 143dd99..b1e79e4 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 _0xf2c9=['moment','exports','STRING','DATE'];(function(_0x2364f6,_0x37184e){var _0x3c9a0e=function(_0xf68dce){while(--_0xf68dce){_0x2364f6['push'](_0x2364f6['shift']());}};_0x3c9a0e(++_0x37184e);}(_0xf2c9,0xf4));var _0x9f2c=function(_0x1e8e02,_0x4e9df0){_0x1e8e02=_0x1e8e02-0x0;var _0x3aa4c5=_0xf2c9[_0x1e8e02];return _0x3aa4c5;};'use strict';var moment=require(_0x9f2c('0x0'));var Sequelize=require('sequelize');module[_0x9f2c('0x1')]={'uniqueid':{'type':Sequelize[_0x9f2c('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9f2c('0x2')]},'joinAt':{'type':Sequelize[_0x9f2c('0x3')]},'leaveAt':{'type':Sequelize[_0x9f2c('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1aea=['exports','STRING','DATE','moment','sequelize'];(function(_0x13679b,_0xabb2ad){var _0x4b8004=function(_0x54e362){while(--_0x54e362){_0x13679b['push'](_0x13679b['shift']());}};_0x4b8004(++_0xabb2ad);}(_0x1aea,0x1d4));var _0xa1ae=function(_0x590851,_0x496bee){_0x590851=_0x590851-0x0;var _0x3b0115=_0x1aea[_0x590851];return _0x3b0115;};'use strict';var moment=require(_0xa1ae('0x0'));var Sequelize=require(_0xa1ae('0x1'));module[_0xa1ae('0x2')]={'uniqueid':{'type':Sequelize[_0xa1ae('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa1ae('0x3')]},'joinAt':{'type':Sequelize[_0xa1ae('0x4')]},'leaveAt':{'type':Sequelize[_0xa1ae('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa1ae('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index eca76eb..dbe4784 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 _0x29b1=['where','merge','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','find','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','order','sort','pick','filter'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x29b1,0x13b));var _0x129b=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x29b1[_0x1e3c16];return _0x47a0c9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x129b('0x0'));var jsonpatch=require(_0x129b('0x1'));var rp=require(_0x129b('0x2'));var moment=require(_0x129b('0x3'));var BPromise=require(_0x129b('0x4'));var Mustache=require(_0x129b('0x5'));var util=require(_0x129b('0x6'));var path=require(_0x129b('0x7'));var sox=require(_0x129b('0x8'));var csv=require(_0x129b('0x9'));var ejs=require(_0x129b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x129b('0xb'));var squel=require('squel');var crypto=require(_0x129b('0xc'));var jsforce=require(_0x129b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x129b('0xe'));var Papa=require('papaparse');var Redis=require(_0x129b('0xf'));var authService=require(_0x129b('0x10'));var qs=require(_0x129b('0x11'));var as=require(_0x129b('0x12'));var hardwareService=require(_0x129b('0x13'));var logger=require(_0x129b('0x14'))('api');var utils=require(_0x129b('0x15'));var config=require(_0x129b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x129b('0x17'))['db'];function respondWithStatusCode(_0x1e5102,_0x4b8f35){_0x4b8f35=_0x4b8f35||0xcc;return function(_0x3cf7c5){if(_0x3cf7c5){return _0x1e5102[_0x129b('0x18')](_0x4b8f35);}return _0x1e5102[_0x129b('0x19')](_0x4b8f35)[_0x129b('0x1a')]();};}function respondWithResult(_0x379cd1,_0x4f3ff3){_0x4f3ff3=_0x4f3ff3||0xc8;return function(_0x94390d){if(_0x94390d){return _0x379cd1[_0x129b('0x19')](_0x4f3ff3)[_0x129b('0x1b')](_0x94390d);}};}function respondWithFilteredResult(_0x4edd0e,_0x139d4b){return function(_0x30beb8){if(_0x30beb8){var _0x5b49a8=typeof _0x139d4b[_0x129b('0x1c')]==='undefined'&&typeof _0x139d4b[_0x129b('0x1d')]===_0x129b('0x1e');var _0x1ba4c7=_0x30beb8[_0x129b('0x1f')];var _0x463095=_0x5b49a8?0x0:_0x139d4b[_0x129b('0x1c')];var _0x5d704e=_0x5b49a8?_0x30beb8[_0x129b('0x1f')]:_0x139d4b[_0x129b('0x1c')]+_0x139d4b['limit'];var _0x12899c;if(_0x5d704e>=_0x1ba4c7){_0x5d704e=_0x1ba4c7;_0x12899c=0xc8;}else{_0x12899c=0xce;}_0x4edd0e[_0x129b('0x19')](_0x12899c);return _0x4edd0e[_0x129b('0x20')](_0x129b('0x21'),_0x463095+'-'+_0x5d704e+'/'+_0x1ba4c7)[_0x129b('0x1b')](_0x30beb8);}return null;};}function patchUpdates(_0x1062ab){return function(_0x54c15b){try{jsonpatch[_0x129b('0x22')](_0x54c15b,_0x1062ab,!![]);}catch(_0x352dd4){return BPromise['reject'](_0x352dd4);}return _0x54c15b[_0x129b('0x23')]();};}function saveUpdates(_0x4ecb00,_0x352e71){return function(_0x575a01){if(_0x575a01){return _0x575a01[_0x129b('0x24')](_0x4ecb00)['then'](function(_0x26d9d5){return _0x26d9d5;});}return null;};}function removeEntity(_0x11f11c,_0x1c3022){return function(_0x5bae73){if(_0x5bae73){return _0x5bae73[_0x129b('0x25')]()[_0x129b('0x26')](function(){_0x11f11c[_0x129b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59819b,_0x458f11){return function(_0x168beb){if(!_0x168beb){_0x59819b['sendStatus'](0x194);}return _0x168beb;};}function handleError(_0x2aeaee,_0x17b6f4){_0x17b6f4=_0x17b6f4||0x1f4;return function(_0x245abd){logger[_0x129b('0x27')](_0x245abd[_0x129b('0x28')]);if(_0x245abd[_0x129b('0x29')]){delete _0x245abd[_0x129b('0x29')];}_0x2aeaee[_0x129b('0x19')](_0x17b6f4)[_0x129b('0x2a')](_0x245abd);};}exports[_0x129b('0x2b')]=function(_0x3979eb,_0xf262aa){var _0x15cf9b={},_0x1cbac9={},_0x424f90={'count':0x0,'rows':[]};var _0x1747c0=_['map'](db[_0x129b('0x2c')][_0x129b('0x2d')],function(_0x5c2b10){return{'name':_0x5c2b10[_0x129b('0x2e')],'type':_0x5c2b10[_0x129b('0x2f')]['key']};});_0x1cbac9['model']=_[_0x129b('0x30')](_0x1747c0,'name');_0x1cbac9[_0x129b('0x31')]=_[_0x129b('0x32')](_0x3979eb[_0x129b('0x31')]);_0x1cbac9[_0x129b('0x33')]=_[_0x129b('0x34')](_0x1cbac9[_0x129b('0x35')],_0x1cbac9[_0x129b('0x31')]);_0x15cf9b[_0x129b('0x36')]=_[_0x129b('0x34')](_0x1cbac9[_0x129b('0x35')],qs[_0x129b('0x37')](_0x3979eb['query']['fields']));_0x15cf9b[_0x129b('0x36')]=_0x15cf9b[_0x129b('0x36')]['length']?_0x15cf9b[_0x129b('0x36')]:_0x1cbac9[_0x129b('0x35')];if(!_0x3979eb['query']['hasOwnProperty']('nolimit')){_0x15cf9b[_0x129b('0x1d')]=qs[_0x129b('0x1d')](_0x3979eb[_0x129b('0x31')]['limit']);_0x15cf9b['offset']=qs[_0x129b('0x1c')](_0x3979eb[_0x129b('0x31')][_0x129b('0x1c')]);}_0x15cf9b[_0x129b('0x38')]=qs[_0x129b('0x39')](_0x3979eb[_0x129b('0x31')][_0x129b('0x39')]);_0x15cf9b['where']=qs[_0x129b('0x33')](_[_0x129b('0x3a')](_0x3979eb[_0x129b('0x31')],_0x1cbac9[_0x129b('0x33')]),_0x1747c0);if(_0x3979eb[_0x129b('0x31')][_0x129b('0x3b')]){_0x15cf9b[_0x129b('0x3c')]=_[_0x129b('0x3d')](_0x15cf9b[_0x129b('0x3c')],{'$or':_[_0x129b('0x30')](_0x1747c0,function(_0x3d92f8){if(_0x3d92f8[_0x129b('0x2f')]!=='VIRTUAL'){var _0xabc270={};_0xabc270[_0x3d92f8[_0x129b('0x29')]]={'$like':'%'+_0x3979eb[_0x129b('0x31')][_0x129b('0x3b')]+'%'};return _0xabc270;}})});}_0x15cf9b=_['merge']({},_0x15cf9b,_0x3979eb[_0x129b('0x3e')]);var _0x503b07={'where':_0x15cf9b[_0x129b('0x3c')]};return db[_0x129b('0x2c')][_0x129b('0x1f')](_0x503b07)[_0x129b('0x26')](function(_0x348e06){_0x424f90[_0x129b('0x1f')]=_0x348e06;if(_0x3979eb[_0x129b('0x31')][_0x129b('0x3f')]){_0x15cf9b['include']=[{'all':!![]}];}return db[_0x129b('0x2c')][_0x129b('0x40')](_0x15cf9b);})[_0x129b('0x26')](function(_0x49bdce){_0x424f90[_0x129b('0x41')]=_0x49bdce;return _0x424f90;})[_0x129b('0x26')](respondWithFilteredResult(_0xf262aa,_0x15cf9b))[_0x129b('0x42')](handleError(_0xf262aa,null));};exports[_0x129b('0x43')]=function(_0x33c741,_0x14810f){var _0x5273c6={'raw':!![],'where':{'id':_0x33c741[_0x129b('0x44')]['id']}},_0x4b5b8d={};_0x4b5b8d[_0x129b('0x35')]=_['keys'](db['ChatQueueReport']['rawAttributes']);_0x4b5b8d[_0x129b('0x31')]=_['keys'](_0x33c741['query']);_0x4b5b8d[_0x129b('0x33')]=_[_0x129b('0x34')](_0x4b5b8d['model'],_0x4b5b8d[_0x129b('0x31')]);_0x5273c6['attributes']=_[_0x129b('0x34')](_0x4b5b8d['model'],qs['fields'](_0x33c741[_0x129b('0x31')][_0x129b('0x37')]));_0x5273c6[_0x129b('0x36')]=_0x5273c6[_0x129b('0x36')][_0x129b('0x45')]?_0x5273c6['attributes']:_0x4b5b8d[_0x129b('0x35')];if(_0x33c741['query'][_0x129b('0x3f')]){_0x5273c6[_0x129b('0x46')]=[{'all':!![]}];}_0x5273c6=_[_0x129b('0x3d')]({},_0x5273c6,_0x33c741[_0x129b('0x3e')]);return db[_0x129b('0x2c')]['find'](_0x5273c6)[_0x129b('0x26')](handleEntityNotFound(_0x14810f,null))['then'](respondWithResult(_0x14810f,null))[_0x129b('0x42')](handleError(_0x14810f,null));};exports[_0x129b('0x47')]=function(_0xa0244d,_0x2f034e){return db[_0x129b('0x2c')][_0x129b('0x47')](_0xa0244d[_0x129b('0x48')],{})['then'](respondWithResult(_0x2f034e,0xc9))['catch'](handleError(_0x2f034e,null));};exports[_0x129b('0x24')]=function(_0x29bbcc,_0x1989f6){if(_0x29bbcc[_0x129b('0x48')]['id']){delete _0x29bbcc[_0x129b('0x48')]['id'];}return db[_0x129b('0x2c')][_0x129b('0x49')]({'where':{'id':_0x29bbcc[_0x129b('0x44')]['id']}})[_0x129b('0x26')](handleEntityNotFound(_0x1989f6,null))['then'](saveUpdates(_0x29bbcc[_0x129b('0x48')],null))[_0x129b('0x26')](respondWithResult(_0x1989f6,null))['catch'](handleError(_0x1989f6,null));};exports[_0x129b('0x25')]=function(_0x2105c2,_0x173263){return db[_0x129b('0x2c')]['find']({'where':{'id':_0x2105c2['params']['id']}})[_0x129b('0x26')](handleEntityNotFound(_0x173263,null))[_0x129b('0x26')](removeEntity(_0x173263,null))[_0x129b('0x42')](handleError(_0x173263,null));};exports[_0x129b('0x4a')]=function(_0x22560b,_0x4317d1){return db[_0x129b('0x2c')][_0x129b('0x4a')]()[_0x129b('0x26')](respondWithResult(_0x4317d1,null))[_0x129b('0x42')](handleError(_0x4317d1,null));}; \ No newline at end of file +var _0x8212=['order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','ChatQueueReport','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','undefined','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit'];(function(_0x39f36c,_0x15ac8e){var _0x42f49c=function(_0x4195c6){while(--_0x4195c6){_0x39f36c['push'](_0x39f36c['shift']());}};_0x42f49c(++_0x15ac8e);}(_0x8212,0xb3));var _0x2821=function(_0x4ce9b5,_0x465447){_0x4ce9b5=_0x4ce9b5-0x0;var _0x2c3b31=_0x8212[_0x4ce9b5];return _0x2c3b31;};'use strict';var emlformat=require(_0x2821('0x0'));var rimraf=require(_0x2821('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2821('0x2'));var rp=require(_0x2821('0x3'));var moment=require(_0x2821('0x4'));var BPromise=require(_0x2821('0x5'));var Mustache=require(_0x2821('0x6'));var util=require(_0x2821('0x7'));var path=require(_0x2821('0x8'));var sox=require(_0x2821('0x9'));var csv=require('to-csv');var ejs=require(_0x2821('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2821('0xb'));var squel=require(_0x2821('0xc'));var crypto=require('crypto');var jsforce=require(_0x2821('0xd'));var deskjs=require(_0x2821('0xe'));var toCsv=require(_0x2821('0xf'));var querystring=require(_0x2821('0x10'));var Papa=require(_0x2821('0x11'));var Redis=require(_0x2821('0x12'));var authService=require(_0x2821('0x13'));var qs=require(_0x2821('0x14'));var as=require(_0x2821('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2821('0x16'))(_0x2821('0x17'));var utils=require(_0x2821('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c81c1,_0x11d227){_0x11d227=_0x11d227||0xcc;return function(_0x18a2bb){if(_0x18a2bb){return _0x4c81c1[_0x2821('0x19')](_0x11d227);}return _0x4c81c1[_0x2821('0x1a')](_0x11d227)[_0x2821('0x1b')]();};}function respondWithResult(_0x2fbc96,_0x5d5ee5){_0x5d5ee5=_0x5d5ee5||0xc8;return function(_0x3ba091){if(_0x3ba091){return _0x2fbc96['status'](_0x5d5ee5)['json'](_0x3ba091);}};}function respondWithFilteredResult(_0x4142f1,_0xe30acf){return function(_0x243c46){if(_0x243c46){var _0x472238=typeof _0xe30acf['offset']===_0x2821('0x1c')&&typeof _0xe30acf['limit']===_0x2821('0x1c');var _0x2673d2=_0x243c46[_0x2821('0x1d')];var _0x3f1057=_0x472238?0x0:_0xe30acf[_0x2821('0x1e')];var _0x500357=_0x472238?_0x243c46[_0x2821('0x1d')]:_0xe30acf[_0x2821('0x1e')]+_0xe30acf['limit'];var _0x22990a;if(_0x500357>=_0x2673d2){_0x500357=_0x2673d2;_0x22990a=0xc8;}else{_0x22990a=0xce;}_0x4142f1['status'](_0x22990a);return _0x4142f1[_0x2821('0x1f')](_0x2821('0x20'),_0x3f1057+'-'+_0x500357+'/'+_0x2673d2)[_0x2821('0x21')](_0x243c46);}return null;};}function patchUpdates(_0x8ba96e){return function(_0x38d898){try{jsonpatch[_0x2821('0x22')](_0x38d898,_0x8ba96e,!![]);}catch(_0x1c0907){return BPromise[_0x2821('0x23')](_0x1c0907);}return _0x38d898[_0x2821('0x24')]();};}function saveUpdates(_0x1f4e4f,_0x275810){return function(_0x597d8b){if(_0x597d8b){return _0x597d8b['update'](_0x1f4e4f)[_0x2821('0x25')](function(_0x243ff2){return _0x243ff2;});}return null;};}function removeEntity(_0x2838d8,_0x279a46){return function(_0x37c669){if(_0x37c669){return _0x37c669[_0x2821('0x26')]()[_0x2821('0x25')](function(){_0x2838d8[_0x2821('0x1a')](0xcc)[_0x2821('0x1b')]();});}};}function handleEntityNotFound(_0x27cef1,_0x7a49da){return function(_0x1d2c8f){if(!_0x1d2c8f){_0x27cef1[_0x2821('0x19')](0x194);}return _0x1d2c8f;};}function handleError(_0x3ddbe7,_0x14fbd4){_0x14fbd4=_0x14fbd4||0x1f4;return function(_0x2ab3ab){logger[_0x2821('0x27')](_0x2ab3ab[_0x2821('0x28')]);if(_0x2ab3ab[_0x2821('0x29')]){delete _0x2ab3ab[_0x2821('0x29')];}_0x3ddbe7['status'](_0x14fbd4)[_0x2821('0x2a')](_0x2ab3ab);};}exports['index']=function(_0x109262,_0x4402ea){var _0x449e46={},_0x7dfdc3={},_0x5eba60={'count':0x0,'rows':[]};var _0x3ea1de=_[_0x2821('0x2b')](db['ChatQueueReport'][_0x2821('0x2c')],function(_0x2e4395){return{'name':_0x2e4395[_0x2821('0x2d')],'type':_0x2e4395['type'][_0x2821('0x2e')]};});_0x7dfdc3[_0x2821('0x2f')]=_[_0x2821('0x2b')](_0x3ea1de,_0x2821('0x29'));_0x7dfdc3[_0x2821('0x30')]=_[_0x2821('0x31')](_0x109262[_0x2821('0x30')]);_0x7dfdc3['filters']=_[_0x2821('0x32')](_0x7dfdc3[_0x2821('0x2f')],_0x7dfdc3[_0x2821('0x30')]);_0x449e46[_0x2821('0x33')]=_[_0x2821('0x32')](_0x7dfdc3[_0x2821('0x2f')],qs[_0x2821('0x34')](_0x109262[_0x2821('0x30')][_0x2821('0x34')]));_0x449e46[_0x2821('0x33')]=_0x449e46[_0x2821('0x33')]['length']?_0x449e46[_0x2821('0x33')]:_0x7dfdc3[_0x2821('0x2f')];if(!_0x109262[_0x2821('0x30')][_0x2821('0x35')]('nolimit')){_0x449e46[_0x2821('0x36')]=qs[_0x2821('0x36')](_0x109262[_0x2821('0x30')][_0x2821('0x36')]);_0x449e46[_0x2821('0x1e')]=qs[_0x2821('0x1e')](_0x109262[_0x2821('0x30')][_0x2821('0x1e')]);}_0x449e46[_0x2821('0x37')]=qs[_0x2821('0x38')](_0x109262['query'][_0x2821('0x38')]);_0x449e46[_0x2821('0x39')]=qs[_0x2821('0x3a')](_[_0x2821('0x3b')](_0x109262[_0x2821('0x30')],_0x7dfdc3['filters']),_0x3ea1de);if(_0x109262[_0x2821('0x30')]['filter']){_0x449e46['where']=_[_0x2821('0x3c')](_0x449e46[_0x2821('0x39')],{'$or':_[_0x2821('0x2b')](_0x3ea1de,function(_0x276edc){if(_0x276edc[_0x2821('0x3d')]!==_0x2821('0x3e')){var _0x210c60={};_0x210c60[_0x276edc['name']]={'$like':'%'+_0x109262['query'][_0x2821('0x3f')]+'%'};return _0x210c60;}})});}_0x449e46=_[_0x2821('0x3c')]({},_0x449e46,_0x109262[_0x2821('0x40')]);var _0x2737a7={'where':_0x449e46[_0x2821('0x39')]};return db['ChatQueueReport']['count'](_0x2737a7)[_0x2821('0x25')](function(_0x26d389){_0x5eba60[_0x2821('0x1d')]=_0x26d389;if(_0x109262[_0x2821('0x30')][_0x2821('0x41')]){_0x449e46[_0x2821('0x42')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x2821('0x43')](_0x449e46);})[_0x2821('0x25')](function(_0x4fe0cd){_0x5eba60[_0x2821('0x44')]=_0x4fe0cd;return _0x5eba60;})[_0x2821('0x25')](respondWithFilteredResult(_0x4402ea,_0x449e46))[_0x2821('0x45')](handleError(_0x4402ea,null));};exports[_0x2821('0x46')]=function(_0x20c8db,_0x4ffc43){var _0x2b2796={'raw':!![],'where':{'id':_0x20c8db[_0x2821('0x47')]['id']}},_0x8d988a={};_0x8d988a[_0x2821('0x2f')]=_['keys'](db['ChatQueueReport'][_0x2821('0x2c')]);_0x8d988a[_0x2821('0x30')]=_[_0x2821('0x31')](_0x20c8db[_0x2821('0x30')]);_0x8d988a[_0x2821('0x3a')]=_[_0x2821('0x32')](_0x8d988a[_0x2821('0x2f')],_0x8d988a['query']);_0x2b2796['attributes']=_[_0x2821('0x32')](_0x8d988a['model'],qs[_0x2821('0x34')](_0x20c8db[_0x2821('0x30')][_0x2821('0x34')]));_0x2b2796[_0x2821('0x33')]=_0x2b2796[_0x2821('0x33')][_0x2821('0x48')]?_0x2b2796[_0x2821('0x33')]:_0x8d988a['model'];if(_0x20c8db[_0x2821('0x30')][_0x2821('0x41')]){_0x2b2796[_0x2821('0x42')]=[{'all':!![]}];}_0x2b2796=_[_0x2821('0x3c')]({},_0x2b2796,_0x20c8db[_0x2821('0x40')]);return db[_0x2821('0x49')][_0x2821('0x4a')](_0x2b2796)[_0x2821('0x25')](handleEntityNotFound(_0x4ffc43,null))['then'](respondWithResult(_0x4ffc43,null))[_0x2821('0x45')](handleError(_0x4ffc43,null));};exports[_0x2821('0x4b')]=function(_0x175ef3,_0x3f370d){return db['ChatQueueReport'][_0x2821('0x4b')](_0x175ef3[_0x2821('0x4c')],{})[_0x2821('0x25')](respondWithResult(_0x3f370d,0xc9))['catch'](handleError(_0x3f370d,null));};exports['update']=function(_0x5162b3,_0x9721){if(_0x5162b3[_0x2821('0x4c')]['id']){delete _0x5162b3[_0x2821('0x4c')]['id'];}return db['ChatQueueReport'][_0x2821('0x4a')]({'where':{'id':_0x5162b3[_0x2821('0x47')]['id']}})[_0x2821('0x25')](handleEntityNotFound(_0x9721,null))[_0x2821('0x25')](saveUpdates(_0x5162b3[_0x2821('0x4c')],null))[_0x2821('0x25')](respondWithResult(_0x9721,null))['catch'](handleError(_0x9721,null));};exports['destroy']=function(_0x284b28,_0x39fcc9){return db['ChatQueueReport'][_0x2821('0x4a')]({'where':{'id':_0x284b28[_0x2821('0x47')]['id']}})[_0x2821('0x25')](handleEntityNotFound(_0x39fcc9,null))[_0x2821('0x25')](removeEntity(_0x39fcc9,null))[_0x2821('0x45')](handleError(_0x39fcc9,null));};exports[_0x2821('0x4d')]=function(_0x40fecc,_0x2e4a4d){return db[_0x2821('0x49')]['describe']()['then'](respondWithResult(_0x2e4a4d,null))['catch'](handleError(_0x2e4a4d,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 906f12d..754ab97 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x23e4cf,_0x12704d){var _0x2bd35a=function(_0xaa827a){while(--_0xaa827a){_0x23e4cf['push'](_0x23e4cf['shift']());}};_0x2bd35a(++_0x12704d);}(_0xb10b,0x12a));var _0xbb10=function(_0xc1078,_0x87768b){_0xc1078=_0xc1078-0x0;var _0x1eb9bd=_0xb10b[_0xc1078];return _0x1eb9bd;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x2cc3e7,_0x62ffb6){var _0x20179e=function(_0x1f1ede){while(--_0x1f1ede){_0x2cc3e7['push'](_0x2cc3e7['shift']());}};_0x20179e(++_0x62ffb6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xcb91[_0x5f5cce];return _0x705ecf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'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 d75d208..92ad761 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 _0x40b2=['stringify','error','message','result','catch','CreateChatQueueReport','create','options','raw','debug','UpdateChatQueueReport','ChatQueueReport','where','attributes','limit','util','moment','randomstring','ioredis','../../config/logger','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x23ed03,_0x4e008c){var _0x58ab9d=function(_0xc57b84){while(--_0xc57b84){_0x23ed03['push'](_0x23ed03['shift']());}};_0x58ab9d(++_0x4e008c);}(_0x40b2,0x143));var _0x240b=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x40b2[_0x134c2e];return _0x2825db;};'use strict';var _=require('lodash');var util=require(_0x240b('0x0'));var moment=require(_0x240b('0x1'));var BPromise=require('bluebird');var rs=require(_0x240b('0x2'));var fs=require('fs');var Redis=require(_0x240b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x240b('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x240b('0x5')][_0x240b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x528a9a,_0x1b7264,_0x41c313){return new BPromise(function(_0x34cda0,_0x59644c){return client[_0x240b('0x7')](_0x528a9a,_0x41c313)[_0x240b('0x8')](function(_0x16ac5d){logger[_0x240b('0x9')](_0x240b('0xa'),_0x1b7264,_0x240b('0xb'));logger['debug'](_0x240b('0xc'),_0x1b7264,_0x240b('0xb'),JSON[_0x240b('0xd')](_0x16ac5d));if(_0x16ac5d[_0x240b('0xe')]){if(_0x16ac5d[_0x240b('0xe')]['code']===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x1b7264,_0x16ac5d[_0x240b('0xe')]['message']);return _0x59644c(_0x16ac5d[_0x240b('0xe')][_0x240b('0xf')]);}logger['error'](_0x240b('0xa'),_0x1b7264,_0x16ac5d['error'][_0x240b('0xf')]);return _0x34cda0(_0x16ac5d[_0x240b('0xe')][_0x240b('0xf')]);}else{logger[_0x240b('0x9')](_0x240b('0xa'),_0x1b7264,_0x240b('0xb'));_0x34cda0(_0x16ac5d[_0x240b('0x10')]['message']);}})[_0x240b('0x11')](function(_0xb1b2b8){logger[_0x240b('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x1b7264,_0xb1b2b8);_0x59644c(_0xb1b2b8);});});}exports[_0x240b('0x12')]=function(_0x34f2b8){var _0x1997d0=this;return new Promise(function(_0x40852c,_0x594dfa){return db['ChatQueueReport'][_0x240b('0x13')](_0x34f2b8['body'],{'raw':_0x34f2b8[_0x240b('0x14')]?_0x34f2b8['options'][_0x240b('0x15')]===undefined?!![]:![]:!![]})[_0x240b('0x8')](function(_0x1c045a){logger[_0x240b('0x9')](_0x240b('0x12'),_0x34f2b8);logger[_0x240b('0x16')]('CreateChatQueueReport',_0x34f2b8,JSON[_0x240b('0xd')](_0x1c045a));_0x40852c(_0x1c045a);})[_0x240b('0x11')](function(_0x5dccf1){logger[_0x240b('0xe')](_0x240b('0x12'),_0x5dccf1[_0x240b('0xf')],_0x34f2b8);_0x594dfa(_0x1997d0[_0x240b('0xe')](0x1f4,_0x5dccf1['message']));});});};exports[_0x240b('0x17')]=function(_0x3a278f){var _0x525c4e=this;return new Promise(function(_0x202085,_0x40d9d8){return db[_0x240b('0x18')]['update'](_0x3a278f['body'],{'raw':_0x3a278f[_0x240b('0x14')]?_0x3a278f[_0x240b('0x14')][_0x240b('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a278f[_0x240b('0x14')]?_0x3a278f[_0x240b('0x14')][_0x240b('0x19')]||null:null,'attributes':_0x3a278f['options']?_0x3a278f[_0x240b('0x14')][_0x240b('0x1a')]||null:null,'limit':_0x3a278f[_0x240b('0x14')]?_0x3a278f[_0x240b('0x14')][_0x240b('0x1b')]||null:null})[_0x240b('0x8')](function(_0x5ee8d4){logger[_0x240b('0x9')](_0x240b('0x17'),_0x3a278f);logger[_0x240b('0x16')](_0x240b('0x17'),_0x3a278f,JSON['stringify'](_0x5ee8d4));_0x202085(_0x5ee8d4);})['catch'](function(_0xab3292){logger[_0x240b('0xe')](_0x240b('0x17'),_0xab3292[_0x240b('0xf')],_0x3a278f);_0x40d9d8(_0x525c4e[_0x240b('0xe')](0x1f4,_0xab3292[_0x240b('0xf')]));});});}; \ No newline at end of file +var _0xa832=['options','raw','UpdateChatQueueReport','update','body','where','attributes','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0x3e864d,_0x43e000){var _0x24bd1b=function(_0x2e76f6){while(--_0x2e76f6){_0x3e864d['push'](_0x3e864d['shift']());}};_0x24bd1b(++_0x43e000);}(_0xa832,0x16f));var _0x2a83=function(_0x2bf67e,_0x16d378){_0x2bf67e=_0x2bf67e-0x0;var _0x5138d5=_0xa832[_0x2bf67e];return _0x5138d5;};'use strict';var _=require('lodash');var util=require(_0x2a83('0x0'));var moment=require(_0x2a83('0x1'));var BPromise=require(_0x2a83('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a83('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2a83('0x4'));var logger=require(_0x2a83('0x5'))('rpc');var config=require(_0x2a83('0x6'));var jayson=require(_0x2a83('0x7'));var client=jayson['client'][_0x2a83('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5adb1a,_0x12733e,_0x1d296e){return new BPromise(function(_0x4512b2,_0x267f76){return client[_0x2a83('0x9')](_0x5adb1a,_0x1d296e)[_0x2a83('0xa')](function(_0x54ca5d){logger[_0x2a83('0xb')](_0x2a83('0xc'),_0x12733e,_0x2a83('0xd'));logger[_0x2a83('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x12733e,_0x2a83('0xd'),JSON[_0x2a83('0xf')](_0x54ca5d));if(_0x54ca5d[_0x2a83('0x10')]){if(_0x54ca5d[_0x2a83('0x10')][_0x2a83('0x11')]===0x1f4){logger[_0x2a83('0x10')](_0x2a83('0xc'),_0x12733e,_0x54ca5d['error']['message']);return _0x267f76(_0x54ca5d[_0x2a83('0x10')]['message']);}logger[_0x2a83('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x12733e,_0x54ca5d['error'][_0x2a83('0x12')]);return _0x4512b2(_0x54ca5d[_0x2a83('0x10')]['message']);}else{logger[_0x2a83('0xb')](_0x2a83('0xc'),_0x12733e,_0x2a83('0xd'));_0x4512b2(_0x54ca5d[_0x2a83('0x13')][_0x2a83('0x12')]);}})[_0x2a83('0x14')](function(_0xf838d6){logger[_0x2a83('0x10')](_0x2a83('0xc'),_0x12733e,_0xf838d6);_0x267f76(_0xf838d6);});});}exports[_0x2a83('0x15')]=function(_0x1a8849){var _0x16dff7=this;return new Promise(function(_0x4a1d1c,_0x260c32){return db[_0x2a83('0x16')]['create'](_0x1a8849['body'],{'raw':_0x1a8849['options']?_0x1a8849[_0x2a83('0x17')][_0x2a83('0x18')]===undefined?!![]:![]:!![]})[_0x2a83('0xa')](function(_0x4a3232){logger[_0x2a83('0xb')](_0x2a83('0x15'),_0x1a8849);logger[_0x2a83('0xe')](_0x2a83('0x15'),_0x1a8849,JSON[_0x2a83('0xf')](_0x4a3232));_0x4a1d1c(_0x4a3232);})[_0x2a83('0x14')](function(_0x6d3dc7){logger[_0x2a83('0x10')](_0x2a83('0x15'),_0x6d3dc7[_0x2a83('0x12')],_0x1a8849);_0x260c32(_0x16dff7['error'](0x1f4,_0x6d3dc7['message']));});});};exports[_0x2a83('0x19')]=function(_0x2234a6){var _0x8afcec=this;return new Promise(function(_0x439888,_0x17fb6f){return db['ChatQueueReport'][_0x2a83('0x1a')](_0x2234a6[_0x2a83('0x1b')],{'raw':_0x2234a6[_0x2a83('0x17')]?_0x2234a6['options'][_0x2a83('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2234a6[_0x2a83('0x17')]?_0x2234a6['options'][_0x2a83('0x1c')]||null:null,'attributes':_0x2234a6['options']?_0x2234a6[_0x2a83('0x17')][_0x2a83('0x1d')]||null:null,'limit':_0x2234a6['options']?_0x2234a6[_0x2a83('0x17')]['limit']||null:null})[_0x2a83('0xa')](function(_0x40d8ea){logger[_0x2a83('0xb')](_0x2a83('0x19'),_0x2234a6);logger[_0x2a83('0xe')](_0x2a83('0x19'),_0x2234a6,JSON[_0x2a83('0xf')](_0x40d8ea));_0x439888(_0x40d8ea);})[_0x2a83('0x14')](function(_0x1c4feb){logger[_0x2a83('0x10')](_0x2a83('0x19'),_0x1c4feb[_0x2a83('0x12')],_0x2234a6);_0x17fb6f(_0x8afcec[_0x2a83('0x10')](0x1f4,_0x1c4feb[_0x2a83('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 6e86178..f55bc6d 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 _0x08ef=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','/describe','describe','get','show','post','create','/:id','update','exports','util'];(function(_0x5da4f9,_0x5526be){var _0x157e2b=function(_0x3d5069){while(--_0x3d5069){_0x5da4f9['push'](_0x5da4f9['shift']());}};_0x157e2b(++_0x5526be);}(_0x08ef,0xfb));var _0xf08e=function(_0x11d094,_0xba01a8){_0x11d094=_0x11d094-0x0;var _0x6c9744=_0x08ef[_0x11d094];return _0x6c9744;};'use strict';var multer=require('multer');var util=require(_0xf08e('0x0'));var path=require(_0xf08e('0x1'));var timeout=require(_0xf08e('0x2'));var express=require(_0xf08e('0x3'));var router=express[_0xf08e('0x4')]();var fs_extra=require(_0xf08e('0x5'));var auth=require(_0xf08e('0x6'));var interaction=require(_0xf08e('0x7'));var config=require(_0xf08e('0x8'));var controller=require(_0xf08e('0x9'));router['get']('/',auth[_0xf08e('0xa')](),controller[_0xf08e('0xb')]);router['get'](_0xf08e('0xc'),auth[_0xf08e('0xa')](),controller[_0xf08e('0xd')]);router[_0xf08e('0xe')]('/:id',auth[_0xf08e('0xa')](),controller[_0xf08e('0xf')]);router[_0xf08e('0x10')]('/',auth[_0xf08e('0xa')](),controller[_0xf08e('0x11')]);router['put'](_0xf08e('0x12'),auth[_0xf08e('0xa')](),controller[_0xf08e('0x13')]);router['delete'](_0xf08e('0x12'),auth[_0xf08e('0xa')](),controller['destroy']);module[_0xf08e('0x14')]=router; \ No newline at end of file +var _0xa7bc=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put','update','destroy','exports','multer','util','path'];(function(_0x5ad555,_0x35e672){var _0x346bb9=function(_0x4ff069){while(--_0x4ff069){_0x5ad555['push'](_0x5ad555['shift']());}};_0x346bb9(++_0x35e672);}(_0xa7bc,0x173));var _0xca7b=function(_0x4965ac,_0x5dada2){_0x4965ac=_0x4965ac-0x0;var _0x5a35c2=_0xa7bc[_0x4965ac];return _0x5a35c2;};'use strict';var multer=require(_0xca7b('0x0'));var util=require(_0xca7b('0x1'));var path=require(_0xca7b('0x2'));var timeout=require(_0xca7b('0x3'));var express=require(_0xca7b('0x4'));var router=express[_0xca7b('0x5')]();var fs_extra=require(_0xca7b('0x6'));var auth=require(_0xca7b('0x7'));var interaction=require(_0xca7b('0x8'));var config=require(_0xca7b('0x9'));var controller=require(_0xca7b('0xa'));router['get']('/',auth[_0xca7b('0xb')](),controller[_0xca7b('0xc')]);router[_0xca7b('0xd')](_0xca7b('0xe'),auth[_0xca7b('0xb')](),controller['describe']);router['get'](_0xca7b('0xf'),auth['isAuthenticated'](),controller[_0xca7b('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xca7b('0x11')]);router[_0xca7b('0x12')](_0xca7b('0xf'),auth[_0xca7b('0xb')](),controller[_0xca7b('0x13')]);router['delete'](_0xca7b('0xf'),auth[_0xca7b('0xb')](),controller[_0xca7b('0x14')]);module[_0xca7b('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 48f5344..b171b2c 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x33ad03,_0x107fb0){var _0x14c4eb=function(_0x28a6c6){while(--_0x28a6c6){_0x33ad03['push'](_0x33ad03['shift']());}};_0x14c4eb(++_0x107fb0);}(_0xedd9,0xfc));var _0x9edd=function(_0x5a8749,_0x2e0709){_0x5a8749=_0x5a8749-0x0;var _0xa0f9=_0xedd9[_0x5a8749];return _0xa0f9;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x45b892,_0x3f7e45){var _0x208a1d=function(_0x5cb604){while(--_0x5cb604){_0x45b892['push'](_0x45b892['shift']());}};_0x208a1d(++_0x3f7e45);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0xcb91[_0x19159a];return _0xa677f4;};'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 14776ca..2b9af9e 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 _0x7d4a=['attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','rows','catch','show','params','include','find','create','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','offset','set','apply','reject','update','then','end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','model','query','keys','filters','intersection','fields'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0x7d4a,0xf5));var _0xa7d4=function(_0x3b40ab,_0x524ba7){_0x3b40ab=_0x3b40ab-0x0;var _0x570838=_0x7d4a[_0x3b40ab];return _0x570838;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa7d4('0x0'));var zipdir=require(_0xa7d4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa7d4('0x2'));var moment=require(_0xa7d4('0x3'));var BPromise=require(_0xa7d4('0x4'));var Mustache=require('mustache');var util=require(_0xa7d4('0x5'));var path=require(_0xa7d4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa7d4('0x7'));var fs=require('fs');var fs_extra=require(_0xa7d4('0x8'));var _=require(_0xa7d4('0x9'));var squel=require(_0xa7d4('0xa'));var crypto=require(_0xa7d4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa7d4('0xc'));var toCsv=require(_0xa7d4('0xd'));var querystring=require(_0xa7d4('0xe'));var Papa=require(_0xa7d4('0xf'));var Redis=require(_0xa7d4('0x10'));var authService=require(_0xa7d4('0x11'));var qs=require(_0xa7d4('0x12'));var as=require(_0xa7d4('0x13'));var hardwareService=require(_0xa7d4('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xa7d4('0x15'));var config=require(_0xa7d4('0x16'));var licenseUtil=require(_0xa7d4('0x17'));var db=require(_0xa7d4('0x18'))['db'];function respondWithStatusCode(_0x2ef4e8,_0x40c59d){_0x40c59d=_0x40c59d||0xcc;return function(_0x542e77){if(_0x542e77){return _0x2ef4e8['sendStatus'](_0x40c59d);}return _0x2ef4e8[_0xa7d4('0x19')](_0x40c59d)['end']();};}function respondWithResult(_0x2bc4a9,_0x402802){_0x402802=_0x402802||0xc8;return function(_0x152d58){if(_0x152d58){return _0x2bc4a9[_0xa7d4('0x19')](_0x402802)[_0xa7d4('0x1a')](_0x152d58);}};}function respondWithFilteredResult(_0x1dc179,_0x5c9d7b){return function(_0x2e7c08){if(_0x2e7c08){var _0x57d442=typeof _0x5c9d7b['offset']==='undefined'&&typeof _0x5c9d7b[_0xa7d4('0x1b')]===_0xa7d4('0x1c');var _0x3eec15=_0x2e7c08['count'];var _0x3ba413=_0x57d442?0x0:_0x5c9d7b['offset'];var _0x5b4578=_0x57d442?_0x2e7c08['count']:_0x5c9d7b[_0xa7d4('0x1d')]+_0x5c9d7b['limit'];var _0x651020;if(_0x5b4578>=_0x3eec15){_0x5b4578=_0x3eec15;_0x651020=0xc8;}else{_0x651020=0xce;}_0x1dc179[_0xa7d4('0x19')](_0x651020);return _0x1dc179[_0xa7d4('0x1e')]('Content-Range',_0x3ba413+'-'+_0x5b4578+'/'+_0x3eec15)[_0xa7d4('0x1a')](_0x2e7c08);}return null;};}function patchUpdates(_0x55126b){return function(_0x38f81a){try{jsonpatch[_0xa7d4('0x1f')](_0x38f81a,_0x55126b,!![]);}catch(_0x2d65fc){return BPromise[_0xa7d4('0x20')](_0x2d65fc);}return _0x38f81a['save']();};}function saveUpdates(_0x3a217b,_0x4db5de){return function(_0x1eb81a){if(_0x1eb81a){return _0x1eb81a[_0xa7d4('0x21')](_0x3a217b)[_0xa7d4('0x22')](function(_0x5980c0){return _0x5980c0;});}return null;};}function removeEntity(_0x57a7fd,_0x522dcb){return function(_0x48e152){if(_0x48e152){return _0x48e152['destroy']()['then'](function(){_0x57a7fd['status'](0xcc)[_0xa7d4('0x23')]();});}};}function handleEntityNotFound(_0x34ffec,_0x82dfe0){return function(_0x336a91){if(!_0x336a91){_0x34ffec['sendStatus'](0x194);}return _0x336a91;};}function handleError(_0x17f493,_0x339773){_0x339773=_0x339773||0x1f4;return function(_0x23533a){logger[_0xa7d4('0x24')](_0x23533a[_0xa7d4('0x25')]);if(_0x23533a[_0xa7d4('0x26')]){delete _0x23533a[_0xa7d4('0x26')];}_0x17f493[_0xa7d4('0x19')](_0x339773)[_0xa7d4('0x27')](_0x23533a);};}exports[_0xa7d4('0x28')]=function(_0x189e71,_0x1b1911){var _0x2677c2={},_0x4bc1cc={},_0x4d621f={'count':0x0,'rows':[]};var _0x13ab42=_[_0xa7d4('0x29')](db[_0xa7d4('0x2a')][_0xa7d4('0x2b')],function(_0x41fb8e){return{'name':_0x41fb8e['fieldName'],'type':_0x41fb8e[_0xa7d4('0x2c')]['key']};});_0x4bc1cc[_0xa7d4('0x2d')]=_[_0xa7d4('0x29')](_0x13ab42,_0xa7d4('0x26'));_0x4bc1cc[_0xa7d4('0x2e')]=_[_0xa7d4('0x2f')](_0x189e71['query']);_0x4bc1cc[_0xa7d4('0x30')]=_[_0xa7d4('0x31')](_0x4bc1cc[_0xa7d4('0x2d')],_0x4bc1cc[_0xa7d4('0x2e')]);_0x2677c2['attributes']=_[_0xa7d4('0x31')](_0x4bc1cc[_0xa7d4('0x2d')],qs['fields'](_0x189e71[_0xa7d4('0x2e')][_0xa7d4('0x32')]));_0x2677c2[_0xa7d4('0x33')]=_0x2677c2[_0xa7d4('0x33')][_0xa7d4('0x34')]?_0x2677c2[_0xa7d4('0x33')]:_0x4bc1cc[_0xa7d4('0x2d')];if(!_0x189e71[_0xa7d4('0x2e')]['hasOwnProperty'](_0xa7d4('0x35'))){_0x2677c2['limit']=qs['limit'](_0x189e71[_0xa7d4('0x2e')]['limit']);_0x2677c2[_0xa7d4('0x1d')]=qs['offset'](_0x189e71[_0xa7d4('0x2e')]['offset']);}_0x2677c2[_0xa7d4('0x36')]=qs[_0xa7d4('0x37')](_0x189e71[_0xa7d4('0x2e')]['sort']);_0x2677c2['where']=qs['filters'](_[_0xa7d4('0x38')](_0x189e71[_0xa7d4('0x2e')],_0x4bc1cc[_0xa7d4('0x30')]),_0x13ab42);if(_0x189e71[_0xa7d4('0x2e')][_0xa7d4('0x39')]){_0x2677c2['where']=_['merge'](_0x2677c2[_0xa7d4('0x3a')],{'$or':_[_0xa7d4('0x29')](_0x13ab42,function(_0x42c89c){if(_0x42c89c[_0xa7d4('0x2c')]!==_0xa7d4('0x3b')){var _0x3bb247={};_0x3bb247[_0x42c89c[_0xa7d4('0x26')]]={'$like':'%'+_0x189e71[_0xa7d4('0x2e')][_0xa7d4('0x39')]+'%'};return _0x3bb247;}})});}_0x2677c2=_[_0xa7d4('0x3c')]({},_0x2677c2,_0x189e71[_0xa7d4('0x3d')]);var _0x3700b7={'where':_0x2677c2[_0xa7d4('0x3a')]};return db[_0xa7d4('0x2a')][_0xa7d4('0x3e')](_0x3700b7)['then'](function(_0x1314c0){_0x4d621f[_0xa7d4('0x3e')]=_0x1314c0;if(_0x189e71[_0xa7d4('0x2e')][_0xa7d4('0x3f')]){_0x2677c2['include']=[{'all':!![]}];}return db[_0xa7d4('0x2a')]['findAll'](_0x2677c2);})['then'](function(_0x32c8c1){_0x4d621f[_0xa7d4('0x40')]=_0x32c8c1;return _0x4d621f;})[_0xa7d4('0x22')](respondWithFilteredResult(_0x1b1911,_0x2677c2))[_0xa7d4('0x41')](handleError(_0x1b1911,null));};exports[_0xa7d4('0x42')]=function(_0x46f967,_0x125ccf){var _0x1195e3={'raw':!![],'where':{'id':_0x46f967[_0xa7d4('0x43')]['id']}},_0xd9f1f={};_0xd9f1f[_0xa7d4('0x2d')]=_[_0xa7d4('0x2f')](db['ChatTransferReport'][_0xa7d4('0x2b')]);_0xd9f1f[_0xa7d4('0x2e')]=_[_0xa7d4('0x2f')](_0x46f967[_0xa7d4('0x2e')]);_0xd9f1f[_0xa7d4('0x30')]=_[_0xa7d4('0x31')](_0xd9f1f[_0xa7d4('0x2d')],_0xd9f1f[_0xa7d4('0x2e')]);_0x1195e3[_0xa7d4('0x33')]=_[_0xa7d4('0x31')](_0xd9f1f['model'],qs[_0xa7d4('0x32')](_0x46f967[_0xa7d4('0x2e')][_0xa7d4('0x32')]));_0x1195e3[_0xa7d4('0x33')]=_0x1195e3[_0xa7d4('0x33')][_0xa7d4('0x34')]?_0x1195e3[_0xa7d4('0x33')]:_0xd9f1f[_0xa7d4('0x2d')];if(_0x46f967[_0xa7d4('0x2e')]['includeAll']){_0x1195e3[_0xa7d4('0x44')]=[{'all':!![]}];}_0x1195e3=_[_0xa7d4('0x3c')]({},_0x1195e3,_0x46f967[_0xa7d4('0x3d')]);return db[_0xa7d4('0x2a')][_0xa7d4('0x45')](_0x1195e3)[_0xa7d4('0x22')](handleEntityNotFound(_0x125ccf,null))['then'](respondWithResult(_0x125ccf,null))[_0xa7d4('0x41')](handleError(_0x125ccf,null));};exports[_0xa7d4('0x46')]=function(_0xeae1cb,_0x361568){return db[_0xa7d4('0x2a')][_0xa7d4('0x46')](_0xeae1cb[_0xa7d4('0x47')],{})[_0xa7d4('0x22')](respondWithResult(_0x361568,0xc9))[_0xa7d4('0x41')](handleError(_0x361568,null));};exports['update']=function(_0x58fde9,_0x5bf86d){if(_0x58fde9[_0xa7d4('0x47')]['id']){delete _0x58fde9['body']['id'];}return db[_0xa7d4('0x2a')][_0xa7d4('0x45')]({'where':{'id':_0x58fde9[_0xa7d4('0x43')]['id']}})['then'](handleEntityNotFound(_0x5bf86d,null))['then'](saveUpdates(_0x58fde9['body'],null))['then'](respondWithResult(_0x5bf86d,null))['catch'](handleError(_0x5bf86d,null));};exports[_0xa7d4('0x48')]=function(_0xc49b8,_0x5098b5){return db[_0xa7d4('0x2a')][_0xa7d4('0x45')]({'where':{'id':_0xc49b8[_0xa7d4('0x43')]['id']}})['then'](handleEntityNotFound(_0x5098b5,null))['then'](removeEntity(_0x5098b5,null))[_0xa7d4('0x41')](handleError(_0x5098b5,null));};exports[_0xa7d4('0x49')]=function(_0x5d8c05,_0x3337c2){return db[_0xa7d4('0x2a')][_0xa7d4('0x49')]()[_0xa7d4('0x22')](respondWithResult(_0x3337c2,null))[_0xa7d4('0x41')](handleError(_0x3337c2,null));}; \ No newline at end of file +var _0x70a5=['undefined','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','ChatTransferReport','findAll','rows','catch','params','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end'];(function(_0x12a04a,_0x4e3d1a){var _0x6d5409=function(_0x2b3c9f){while(--_0x2b3c9f){_0x12a04a['push'](_0x12a04a['shift']());}};_0x6d5409(++_0x4e3d1a);}(_0x70a5,0x7b));var _0x570a=function(_0x4ab830,_0x47921f){_0x4ab830=_0x4ab830-0x0;var _0x49c499=_0x70a5[_0x4ab830];return _0x49c499;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x570a('0x0'));var zipdir=require(_0x570a('0x1'));var jsonpatch=require(_0x570a('0x2'));var rp=require(_0x570a('0x3'));var moment=require('moment');var BPromise=require(_0x570a('0x4'));var Mustache=require(_0x570a('0x5'));var util=require(_0x570a('0x6'));var path=require(_0x570a('0x7'));var sox=require(_0x570a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x570a('0x9'));var _=require(_0x570a('0xa'));var squel=require('squel');var crypto=require(_0x570a('0xb'));var jsforce=require(_0x570a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x570a('0xd'));var querystring=require(_0x570a('0xe'));var Papa=require(_0x570a('0xf'));var Redis=require(_0x570a('0x10'));var authService=require(_0x570a('0x11'));var qs=require(_0x570a('0x12'));var as=require(_0x570a('0x13'));var hardwareService=require(_0x570a('0x14'));var logger=require('../../config/logger')(_0x570a('0x15'));var utils=require(_0x570a('0x16'));var config=require(_0x570a('0x17'));var licenseUtil=require(_0x570a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcafb61,_0x1403d8){_0x1403d8=_0x1403d8||0xcc;return function(_0x1d02e8){if(_0x1d02e8){return _0xcafb61['sendStatus'](_0x1403d8);}return _0xcafb61[_0x570a('0x19')](_0x1403d8)[_0x570a('0x1a')]();};}function respondWithResult(_0x1ce01b,_0x164d2e){_0x164d2e=_0x164d2e||0xc8;return function(_0x34e875){if(_0x34e875){return _0x1ce01b[_0x570a('0x19')](_0x164d2e)['json'](_0x34e875);}};}function respondWithFilteredResult(_0x773978,_0xcc7610){return function(_0x2eaa1f){if(_0x2eaa1f){var _0x2dd5cd=typeof _0xcc7610['offset']===_0x570a('0x1b')&&typeof _0xcc7610['limit']===_0x570a('0x1b');var _0x1a3bc6=_0x2eaa1f[_0x570a('0x1c')];var _0x1d3d98=_0x2dd5cd?0x0:_0xcc7610[_0x570a('0x1d')];var _0x1a89f8=_0x2dd5cd?_0x2eaa1f[_0x570a('0x1c')]:_0xcc7610[_0x570a('0x1d')]+_0xcc7610['limit'];var _0x46a9ce;if(_0x1a89f8>=_0x1a3bc6){_0x1a89f8=_0x1a3bc6;_0x46a9ce=0xc8;}else{_0x46a9ce=0xce;}_0x773978[_0x570a('0x19')](_0x46a9ce);return _0x773978['set'](_0x570a('0x1e'),_0x1d3d98+'-'+_0x1a89f8+'/'+_0x1a3bc6)[_0x570a('0x1f')](_0x2eaa1f);}return null;};}function patchUpdates(_0x3761eb){return function(_0x3673ce){try{jsonpatch[_0x570a('0x20')](_0x3673ce,_0x3761eb,!![]);}catch(_0x2c5aa1){return BPromise[_0x570a('0x21')](_0x2c5aa1);}return _0x3673ce[_0x570a('0x22')]();};}function saveUpdates(_0x293544,_0x40e75b){return function(_0x7cb61e){if(_0x7cb61e){return _0x7cb61e[_0x570a('0x23')](_0x293544)[_0x570a('0x24')](function(_0x55a3d4){return _0x55a3d4;});}return null;};}function removeEntity(_0x525799,_0x594a25){return function(_0x5c90cf){if(_0x5c90cf){return _0x5c90cf[_0x570a('0x25')]()[_0x570a('0x24')](function(){_0x525799[_0x570a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x79aef3,_0x1e7750){return function(_0x11c1e5){if(!_0x11c1e5){_0x79aef3[_0x570a('0x26')](0x194);}return _0x11c1e5;};}function handleError(_0xf83502,_0xe66f2c){_0xe66f2c=_0xe66f2c||0x1f4;return function(_0x4e5f1a){logger['error'](_0x4e5f1a['stack']);if(_0x4e5f1a['name']){delete _0x4e5f1a[_0x570a('0x27')];}_0xf83502[_0x570a('0x19')](_0xe66f2c)[_0x570a('0x28')](_0x4e5f1a);};}exports[_0x570a('0x29')]=function(_0x49d087,_0x1248e0){var _0x32334a={},_0x340c80={},_0x42a866={'count':0x0,'rows':[]};var _0x925a2a=_[_0x570a('0x2a')](db['ChatTransferReport'][_0x570a('0x2b')],function(_0x1f0a76){return{'name':_0x1f0a76[_0x570a('0x2c')],'type':_0x1f0a76['type']['key']};});_0x340c80[_0x570a('0x2d')]=_[_0x570a('0x2a')](_0x925a2a,_0x570a('0x27'));_0x340c80['query']=_[_0x570a('0x2e')](_0x49d087[_0x570a('0x2f')]);_0x340c80[_0x570a('0x30')]=_[_0x570a('0x31')](_0x340c80['model'],_0x340c80[_0x570a('0x2f')]);_0x32334a[_0x570a('0x32')]=_[_0x570a('0x31')](_0x340c80[_0x570a('0x2d')],qs[_0x570a('0x33')](_0x49d087[_0x570a('0x2f')][_0x570a('0x33')]));_0x32334a[_0x570a('0x32')]=_0x32334a[_0x570a('0x32')][_0x570a('0x34')]?_0x32334a[_0x570a('0x32')]:_0x340c80[_0x570a('0x2d')];if(!_0x49d087[_0x570a('0x2f')]['hasOwnProperty'](_0x570a('0x35'))){_0x32334a[_0x570a('0x36')]=qs['limit'](_0x49d087[_0x570a('0x2f')][_0x570a('0x36')]);_0x32334a[_0x570a('0x1d')]=qs['offset'](_0x49d087[_0x570a('0x2f')][_0x570a('0x1d')]);}_0x32334a[_0x570a('0x37')]=qs[_0x570a('0x38')](_0x49d087[_0x570a('0x2f')]['sort']);_0x32334a[_0x570a('0x39')]=qs[_0x570a('0x30')](_[_0x570a('0x3a')](_0x49d087[_0x570a('0x2f')],_0x340c80[_0x570a('0x30')]),_0x925a2a);if(_0x49d087[_0x570a('0x2f')][_0x570a('0x3b')]){_0x32334a[_0x570a('0x39')]=_[_0x570a('0x3c')](_0x32334a['where'],{'$or':_['map'](_0x925a2a,function(_0x1da7c9){if(_0x1da7c9[_0x570a('0x3d')]!==_0x570a('0x3e')){var _0x459b30={};_0x459b30[_0x1da7c9[_0x570a('0x27')]]={'$like':'%'+_0x49d087[_0x570a('0x2f')][_0x570a('0x3b')]+'%'};return _0x459b30;}})});}_0x32334a=_[_0x570a('0x3c')]({},_0x32334a,_0x49d087[_0x570a('0x3f')]);var _0x15f05d={'where':_0x32334a['where']};return db['ChatTransferReport'][_0x570a('0x1c')](_0x15f05d)[_0x570a('0x24')](function(_0x1c45a8){_0x42a866[_0x570a('0x1c')]=_0x1c45a8;if(_0x49d087[_0x570a('0x2f')][_0x570a('0x40')]){_0x32334a[_0x570a('0x41')]=[{'all':!![]}];}return db[_0x570a('0x42')][_0x570a('0x43')](_0x32334a);})[_0x570a('0x24')](function(_0xc532e1){_0x42a866[_0x570a('0x44')]=_0xc532e1;return _0x42a866;})[_0x570a('0x24')](respondWithFilteredResult(_0x1248e0,_0x32334a))[_0x570a('0x45')](handleError(_0x1248e0,null));};exports['show']=function(_0x3605c2,_0x4de68f){var _0x1a5a22={'raw':!![],'where':{'id':_0x3605c2[_0x570a('0x46')]['id']}},_0x2c4717={};_0x2c4717[_0x570a('0x2d')]=_[_0x570a('0x2e')](db[_0x570a('0x42')][_0x570a('0x2b')]);_0x2c4717[_0x570a('0x2f')]=_['keys'](_0x3605c2['query']);_0x2c4717['filters']=_[_0x570a('0x31')](_0x2c4717[_0x570a('0x2d')],_0x2c4717[_0x570a('0x2f')]);_0x1a5a22[_0x570a('0x32')]=_['intersection'](_0x2c4717[_0x570a('0x2d')],qs[_0x570a('0x33')](_0x3605c2['query'][_0x570a('0x33')]));_0x1a5a22[_0x570a('0x32')]=_0x1a5a22[_0x570a('0x32')][_0x570a('0x34')]?_0x1a5a22[_0x570a('0x32')]:_0x2c4717[_0x570a('0x2d')];if(_0x3605c2[_0x570a('0x2f')][_0x570a('0x40')]){_0x1a5a22[_0x570a('0x41')]=[{'all':!![]}];}_0x1a5a22=_[_0x570a('0x3c')]({},_0x1a5a22,_0x3605c2[_0x570a('0x3f')]);return db['ChatTransferReport']['find'](_0x1a5a22)[_0x570a('0x24')](handleEntityNotFound(_0x4de68f,null))['then'](respondWithResult(_0x4de68f,null))[_0x570a('0x45')](handleError(_0x4de68f,null));};exports[_0x570a('0x47')]=function(_0x310210,_0x3f6e40){return db[_0x570a('0x42')][_0x570a('0x47')](_0x310210['body'],{})[_0x570a('0x24')](respondWithResult(_0x3f6e40,0xc9))[_0x570a('0x45')](handleError(_0x3f6e40,null));};exports[_0x570a('0x23')]=function(_0x132b4d,_0x4598df){if(_0x132b4d[_0x570a('0x48')]['id']){delete _0x132b4d['body']['id'];}return db['ChatTransferReport'][_0x570a('0x49')]({'where':{'id':_0x132b4d[_0x570a('0x46')]['id']}})[_0x570a('0x24')](handleEntityNotFound(_0x4598df,null))[_0x570a('0x24')](saveUpdates(_0x132b4d[_0x570a('0x48')],null))[_0x570a('0x24')](respondWithResult(_0x4598df,null))[_0x570a('0x45')](handleError(_0x4598df,null));};exports[_0x570a('0x25')]=function(_0x35749,_0x392711){return db[_0x570a('0x42')][_0x570a('0x49')]({'where':{'id':_0x35749[_0x570a('0x46')]['id']}})[_0x570a('0x24')](handleEntityNotFound(_0x392711,null))[_0x570a('0x24')](removeEntity(_0x392711,null))[_0x570a('0x45')](handleError(_0x392711,null));};exports['describe']=function(_0x3865fc,_0x115682){return db[_0x570a('0x42')][_0x570a('0x4a')]()[_0x570a('0x24')](respondWithResult(_0x115682,null))['catch'](handleError(_0x115682,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 3b7dd63..eea543f 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 _0xc17a=['path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x13f583,_0x23b5a4){var _0x5c27fc=function(_0x10cac1){while(--_0x10cac1){_0x13f583['push'](_0x13f583['shift']());}};_0x5c27fc(++_0x23b5a4);}(_0xc17a,0x1bc));var _0xac17=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xc17a[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xac17('0x0'));var util=require(_0xac17('0x1'));var logger=require(_0xac17('0x2'))(_0xac17('0x3'));var moment=require('moment');var BPromise=require(_0xac17('0x4'));var rp=require(_0xac17('0x5'));var fs=require('fs');var path=require(_0xac17('0x6'));var rimraf=require(_0xac17('0x7'));var config=require(_0xac17('0x8'));var attributes=require(_0xac17('0x9'));module[_0xac17('0xa')]=function(_0x3e08fb,_0x238265){return _0x3e08fb[_0xac17('0xb')](_0xac17('0xc'),attributes,{'tableName':_0xac17('0xd'),'paranoid':![],'indexes':[{'name':_0xac17('0xe'),'fields':[_0xac17('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0154=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','define'];(function(_0x3a13cf,_0x478c62){var _0x4817c=function(_0x3a2e75){while(--_0x3a2e75){_0x3a13cf['push'](_0x3a13cf['shift']());}};_0x4817c(++_0x478c62);}(_0x0154,0x71));var _0x4015=function(_0x14a4ff,_0x7fcb89){_0x14a4ff=_0x14a4ff-0x0;var _0x2bd22d=_0x0154[_0x14a4ff];return _0x2bd22d;};'use strict';var _=require(_0x4015('0x0'));var util=require(_0x4015('0x1'));var logger=require(_0x4015('0x2'))('api');var moment=require(_0x4015('0x3'));var BPromise=require(_0x4015('0x4'));var rp=require(_0x4015('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4015('0x6'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x11bdd0,_0x45b284){return _0x11bdd0[_0x4015('0x7')](_0x4015('0x8'),attributes,{'tableName':_0x4015('0x9'),'paranoid':![],'indexes':[{'name':_0x4015('0xa'),'fields':[_0x4015('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index b5bd837..9e46711 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 _0xe852=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0xe852,0x18b));var _0x2e85=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xe852[_0x550d12];return _0x12103d;};'use strict';var _=require(_0x2e85('0x0'));var util=require(_0x2e85('0x1'));var moment=require(_0x2e85('0x2'));var BPromise=require(_0x2e85('0x3'));var rs=require(_0x2e85('0x4'));var fs=require('fs');var Redis=require(_0x2e85('0x5'));var db=require(_0x2e85('0x6'))['db'];var utils=require(_0x2e85('0x7'));var logger=require(_0x2e85('0x8'))(_0x2e85('0x9'));var config=require(_0x2e85('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x2e85('0xb')][_0x2e85('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55233a,_0x1db24c,_0x421a5c){return new BPromise(function(_0x6b3582,_0x3e6155){return client[_0x2e85('0xd')](_0x55233a,_0x421a5c)['then'](function(_0xdfd770){logger[_0x2e85('0xe')](_0x2e85('0xf'),_0x1db24c,_0x2e85('0x10'));logger['debug'](_0x2e85('0x11'),_0x1db24c,'request\x20sent',JSON[_0x2e85('0x12')](_0xdfd770));if(_0xdfd770[_0x2e85('0x13')]){if(_0xdfd770[_0x2e85('0x13')][_0x2e85('0x14')]===0x1f4){logger[_0x2e85('0x13')](_0x2e85('0xf'),_0x1db24c,_0xdfd770[_0x2e85('0x13')]['message']);return _0x3e6155(_0xdfd770[_0x2e85('0x13')][_0x2e85('0x15')]);}logger[_0x2e85('0x13')](_0x2e85('0xf'),_0x1db24c,_0xdfd770[_0x2e85('0x13')][_0x2e85('0x15')]);return _0x6b3582(_0xdfd770['error'][_0x2e85('0x15')]);}else{logger[_0x2e85('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x1db24c,_0x2e85('0x10'));_0x6b3582(_0xdfd770['result'][_0x2e85('0x15')]);}})[_0x2e85('0x16')](function(_0x25ebb5){logger['error'](_0x2e85('0xf'),_0x1db24c,_0x25ebb5);_0x3e6155(_0x25ebb5);});});} \ No newline at end of file +var _0x1c4a=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x32c3c2,_0x42a5bf){var _0x43070a=function(_0x12d21d){while(--_0x12d21d){_0x32c3c2['push'](_0x32c3c2['shift']());}};_0x43070a(++_0x42a5bf);}(_0x1c4a,0x71));var _0xa1c4=function(_0x17de86,_0x514d01){_0x17de86=_0x17de86-0x0;var _0xdc4ef4=_0x1c4a[_0x17de86];return _0xdc4ef4;};'use strict';var _=require('lodash');var util=require(_0xa1c4('0x0'));var moment=require(_0xa1c4('0x1'));var BPromise=require(_0xa1c4('0x2'));var rs=require(_0xa1c4('0x3'));var fs=require('fs');var Redis=require(_0xa1c4('0x4'));var db=require(_0xa1c4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c4('0x6'))(_0xa1c4('0x7'));var config=require(_0xa1c4('0x8'));var jayson=require(_0xa1c4('0x9'));var client=jayson[_0xa1c4('0xa')][_0xa1c4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8316b1,_0x491938,_0x395d77){return new BPromise(function(_0x5b7851,_0x45af8e){return client['request'](_0x8316b1,_0x395d77)['then'](function(_0x14d852){logger[_0xa1c4('0xc')](_0xa1c4('0xd'),_0x491938,'request\x20sent');logger[_0xa1c4('0xe')](_0xa1c4('0xf'),_0x491938,_0xa1c4('0x10'),JSON['stringify'](_0x14d852));if(_0x14d852[_0xa1c4('0x11')]){if(_0x14d852['error'][_0xa1c4('0x12')]===0x1f4){logger[_0xa1c4('0x11')](_0xa1c4('0xd'),_0x491938,_0x14d852['error'][_0xa1c4('0x13')]);return _0x45af8e(_0x14d852[_0xa1c4('0x11')][_0xa1c4('0x13')]);}logger[_0xa1c4('0x11')](_0xa1c4('0xd'),_0x491938,_0x14d852[_0xa1c4('0x11')][_0xa1c4('0x13')]);return _0x5b7851(_0x14d852['error'][_0xa1c4('0x13')]);}else{logger['info'](_0xa1c4('0xd'),_0x491938,_0xa1c4('0x10'));_0x5b7851(_0x14d852[_0xa1c4('0x14')][_0xa1c4('0x13')]);}})[_0xa1c4('0x15')](function(_0x1f0485){logger[_0xa1c4('0x11')](_0xa1c4('0xd'),_0x491938,_0x1f0485);_0x45af8e(_0x1f0485);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index c580aff..56e28a6 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 _0xd4d6=['put','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x5baf6d,_0x439aa7){var _0x285208=function(_0x1c7bc9){while(--_0x1c7bc9){_0x5baf6d['push'](_0x5baf6d['shift']());}};_0x285208(++_0x439aa7);}(_0xd4d6,0x15b));var _0x6d4d=function(_0x59ffb9,_0x2405a9){_0x59ffb9=_0x59ffb9-0x0;var _0x1b649a=_0xd4d6[_0x59ffb9];return _0x1b649a;};'use strict';var multer=require(_0x6d4d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6d4d('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6d4d('0x2'));var auth=require(_0x6d4d('0x3'));var interaction=require(_0x6d4d('0x4'));var config=require(_0x6d4d('0x5'));var controller=require(_0x6d4d('0x6'));router[_0x6d4d('0x7')]('/',auth[_0x6d4d('0x8')](),controller[_0x6d4d('0x9')]);router[_0x6d4d('0x7')](_0x6d4d('0xa'),auth[_0x6d4d('0x8')](),controller['describe']);router[_0x6d4d('0x7')](_0x6d4d('0xb'),auth['isAuthenticated'](),controller[_0x6d4d('0xc')]);router[_0x6d4d('0xd')]('/',auth[_0x6d4d('0x8')](),controller['create']);router[_0x6d4d('0xe')](_0x6d4d('0xb'),auth[_0x6d4d('0x8')](),controller[_0x6d4d('0xf')]);router[_0x6d4d('0x10')](_0x6d4d('0xb'),auth[_0x6d4d('0x8')](),controller[_0x6d4d('0x11')]);module[_0x6d4d('0x12')]=router; \ No newline at end of file +var _0x23f2=['isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x23f2,0x193));var _0x223f=function(_0x47855d,_0x5e51b8){_0x47855d=_0x47855d-0x0;var _0x1133b6=_0x23f2[_0x47855d];return _0x1133b6;};'use strict';var multer=require(_0x223f('0x0'));var util=require('util');var path=require(_0x223f('0x1'));var timeout=require(_0x223f('0x2'));var express=require(_0x223f('0x3'));var router=express[_0x223f('0x4')]();var fs_extra=require(_0x223f('0x5'));var auth=require(_0x223f('0x6'));var interaction=require(_0x223f('0x7'));var config=require(_0x223f('0x8'));var controller=require(_0x223f('0x9'));router[_0x223f('0xa')]('/',auth[_0x223f('0xb')](),controller['index']);router[_0x223f('0xa')](_0x223f('0xc'),auth['isAuthenticated'](),controller[_0x223f('0xd')]);router[_0x223f('0xa')](_0x223f('0xe'),auth['isAuthenticated'](),controller[_0x223f('0xf')]);router[_0x223f('0x10')]('/',auth[_0x223f('0xb')](),controller[_0x223f('0x11')]);router[_0x223f('0x12')](_0x223f('0xe'),auth[_0x223f('0xb')](),controller[_0x223f('0x13')]);router[_0x223f('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x223f('0x15')]);module[_0x223f('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 01a3558..dd93020 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 _0x4a9d=['setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','ENUM','thumb','star','stringify','input','name','text','getDataValue','parse','onlineForm','Comments','Leave\x20your\x20comments','offlineForm'];(function(_0x2ecb67,_0x8ec62d){var _0x168079=function(_0x56c365){while(--_0x56c365){_0x2ecb67['push'](_0x2ecb67['shift']());}};_0x168079(++_0x8ec62d);}(_0x4a9d,0x115));var _0xd4a9=function(_0x5ce15d,_0x57429f){_0x5ce15d=_0x5ce15d-0x0;var _0x4568c0=_0x4a9d[_0x5ce15d];return _0x4568c0;};'use strict';var Sequelize=require(_0xd4a9('0x0'));var rs=require(_0xd4a9('0x1'));module[_0xd4a9('0x2')]={'name':{'type':Sequelize[_0xd4a9('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xd4a9('0x3')],'allowNull':![],'unique':_0xd4a9('0x4')},'description':{'type':Sequelize[_0xd4a9('0x3')]},'mapKey':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xd4a9('0x5')},'key':{'type':Sequelize[_0xd4a9('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0x6')},'customerAlias':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd4a9('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd4a9('0x3')],'allowNull':![],'defaultValue':_0xd4a9('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd4a9('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xd4a9('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd4a9('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd4a9('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xd4a9('0x9')),'defaultValue':_0xd4a9('0xa')},'header_online':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0xb')},'start_chat_button':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0xc')},'offline_chat_button':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0xd')},'header_offline':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xd4a9('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xd4a9('0x10')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd4a9('0x11')]},'closingQuestion':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd4a9('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0x14')},'placeholderMessage':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0x15')},'closingMessage':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xd4a9('0x10')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd4a9('0x10')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd4a9('0x10')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xd4a9('0x16')]('star',_0xd4a9('0x17')),'defaultValue':_0xd4a9('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd4a9('0x11')],'defaultValue':function(){return JSON[_0xd4a9('0x19')]({'items':[{'type':_0xd4a9('0x1a'),'variable':null,'config':{'placeholder':_0xd4a9('0x1b'),'type':_0xd4a9('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xd4a9('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd4a9('0x1d')]('onlineForm')?JSON[_0xd4a9('0x1e')](this['getDataValue'](_0xd4a9('0x1f'))):{};},'set':function(_0x38c4fd){return this['setDataValue']('onlineForm',JSON[_0xd4a9('0x19')](_0x38c4fd));}},'offlineForm':{'type':Sequelize[_0xd4a9('0x11')],'defaultValue':function(){return JSON[_0xd4a9('0x19')]({'items':[{'type':_0xd4a9('0x1a'),'props':{'title':_0xd4a9('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xd4a9('0x5'),'type':_0xd4a9('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xd4a9('0x20')},'props':{'title':'Comments','helpText':_0xd4a9('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xd4a9('0x1d')](_0xd4a9('0x22'))?JSON[_0xd4a9('0x1e')](this[_0xd4a9('0x1d')](_0xd4a9('0x22'))):{};},'set':function(_0x3c9132){return this[_0xd4a9('0x23')]('offlineForm',JSON['stringify'](_0x3c9132));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd4a9('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd4a9('0x10')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd4a9('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0x25')},'waitingMessage':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0x27')},'sendUnmanaged':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xd4a9('0x10')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd4a9('0x10')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd4a9('0x11')]},'showAgentAvatar':{'type':Sequelize[_0xd4a9('0x10')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd4a9('0x3')]},'notificationTemplate':{'type':Sequelize[_0xd4a9('0x11')],'defaultValue':function(){return _0xd4a9('0x28');}},'notificationSound':{'type':Sequelize[_0xd4a9('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd4a9('0x10')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd4a9('0x10')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd4a9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd4a9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0x2a')},'verticalAlignment':{'type':Sequelize[_0xd4a9('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0x2b')},'messagesAlignment':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0x2c')},'defaultTitle':{'type':Sequelize[_0xd4a9('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xd4a9('0x10')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd4a9('0x3')],'allowNull':![],'defaultValue':_0xd4a9('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd4a9('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd4a9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':_0xd4a9('0x2e')},'systemAvatar':{'type':Sequelize[_0xd4a9('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xd4a9('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xd4a9('0x10')],'defaultValue':![],'comment':_0xd4a9('0x30'),'set':function(_0x14d1fb){if(!_0x14d1fb)this[_0xd4a9('0x23')](_0xd4a9('0x31'),null);this['setDataValue']('mandatoryDisposition',_0x14d1fb);}},'vidaooEscalation':{'type':Sequelize[_0xd4a9('0x10')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd4a9('0x3')]},'vidaooTopic':{'type':Sequelize[_0xd4a9('0x3')],'allowNull':![],'defaultValue':_0xd4a9('0x32')},'vidaooNote':{'type':Sequelize[_0xd4a9('0x3')],'defaultValue':function(){return _0xd4a9('0x33');}},'vidaooMetadata':{'type':Sequelize[_0xd4a9('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd4a9('0x10')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd4a9('0x11')]}}; \ No newline at end of file +var _0x6534=['Leave\x20your\x20comments','parse','offlineForm','generate','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','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','INTEGER','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','star','stringify','input','name','text','getDataValue','onlineForm','setDataValue','textarea','Comments'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x6534,0x14b));var _0x4653=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6534[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x4653('0x0'));var rs=require(_0x4653('0x1'));module['exports']={'name':{'type':Sequelize[_0x4653('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x4653('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x3')},'mapKeyOffline':{'type':Sequelize[_0x4653('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x4653('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x4')},'customerAlias':{'type':Sequelize[_0x4653('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x4653('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x4653('0x2')],'allowNull':![],'defaultValue':_0x4653('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4653('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x4653('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4653('0x2')]},'animation':{'type':Sequelize[_0x4653('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x4653('0x8')](_0x4653('0x9'),_0x4653('0xa')),'defaultValue':_0x4653('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x4653('0xb')},'start_chat_button':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0xc')},'offline_chat_button':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x4653('0xe')},'download_transcript':{'type':Sequelize[_0x4653('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x4653('0x10')]},'closingQuestion':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x13')},'noteTitle':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x14')},'placeholderMessage':{'type':Sequelize[_0x4653('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x15')},'closingMessageButton':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0xd')},'skipMessageButton':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x16')},'conditionAgreement':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x4653('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x4653('0x17'),'thumb'),'defaultValue':_0x4653('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x4653('0x18')]({'items':[{'type':_0x4653('0x19'),'variable':null,'config':{'placeholder':_0x4653('0x1a'),'type':_0x4653('0x1b'),'required':!![]},'props':{'title':_0x4653('0x1a'),'helpText':''}},{'type':_0x4653('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x4653('0x3'),'type':_0x4653('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x4653('0x1c')](_0x4653('0x1d'))?JSON['parse'](this[_0x4653('0x1c')](_0x4653('0x1d'))):{};},'set':function(_0x42923b){return this[_0x4653('0x1e')](_0x4653('0x1d'),JSON[_0x4653('0x18')](_0x42923b));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x4653('0x18')]({'items':[{'type':_0x4653('0x19'),'props':{'title':_0x4653('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x4653('0x3')},'variable':null},{'type':_0x4653('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0x4653('0x20'),'helpText':_0x4653('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x4653('0x1c')]('offlineForm')?JSON[_0x4653('0x22')](this[_0x4653('0x1c')](_0x4653('0x23'))):{};},'set':function(_0x4bb3a0){return this[_0x4653('0x1e')](_0x4653('0x23'),JSON[_0x4653('0x18')](_0x4bb3a0));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x4653('0x24')]();}},'autoclose':{'type':Sequelize[_0x4653('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4653('0x2')]},'forwardOffline':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x4653('0x2')]},'waitingTitle':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x25')},'waitingMessage':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x4653('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4653('0x28')},'skipUnmanaged':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x16')},'sendUnmanaged':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x4653('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x4653('0x2')]},'notificationTemplate':{'type':Sequelize[_0x4653('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4653('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x2a')},'verticalAlignment':{'type':Sequelize[_0x4653('0x2b')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x4653('0x2c')},'messagesAlignment':{'type':Sequelize[_0x4653('0x2')],'defaultValue':_0x4653('0x2d')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x4653('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4653('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4653('0x2b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4653('0x2b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x4653('0x2f')},'systemAvatar':{'type':Sequelize[_0x4653('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4653('0x2b')],'comment':_0x4653('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![],'comment':_0x4653('0x31'),'set':function(_0x3d9d8f){if(!_0x3d9d8f)this[_0x4653('0x1e')](_0x4653('0x32'),null);this[_0x4653('0x1e')]('mandatoryDisposition',_0x3d9d8f);}},'vidaooEscalation':{'type':Sequelize[_0x4653('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x4653('0x2')]},'vidaooTopic':{'type':Sequelize[_0x4653('0x2')],'allowNull':![],'defaultValue':_0x4653('0x33')},'vidaooNote':{'type':Sequelize[_0x4653('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x4653('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x4653('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 4b3598e..63a6c15 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 _0xa01f=['getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','lodash','querystring','html-to-text','ioredis','jayson/promise','url','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','handleError','redis','defaults','socket.io-emitter','./chatWebsite.socket','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','ChatWebsites','end','sendStatus','stack','name','send','getSnippet','timezone','format','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','get','all','some','user-agent-parser','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','version','unknown','%s\x20%s','device','model','%s\x20%s\x20%s','type','stringify','index','Pause','mandatoryDispositionPause','ChatWebsite','key','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','rawAttributes','fields','options','find','create','body','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','addLogo','sitepic','file','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','../../config/license/util','getLicense','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','notify','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','ChatApplication','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','List','account','list','applications','priority','asc','Contacts','contact','threadId','externalUrl','ChatInteraction','ContactId','interaction','firstName','messageId','autoclose','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','queueId','waitForTheAssignedQueue','Start','EventManager','offline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','files','attachments','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','offlineMessageSubject','openNewInteraction','mimetype','subjectOffline','toPairsIn','mapValues','email','Chat','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','URL','address','origin','3.5.0','remote','headers','connection','remoteAddress','replace','alignment','textColor','backgroundColor','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','finally'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa01f,0x13e));var _0xfa01=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa01f[_0x220dbb];return _0x2b77de;};'use strict';var Mustache=require(_0xfa01('0x0'));var util=require(_0xfa01('0x1'));var path=require(_0xfa01('0x2'));var ejs=require(_0xfa01('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfa01('0x4'));var querystring=require(_0xfa01('0x5'));var htmlToText=require(_0xfa01('0x6'));var Redis=require(_0xfa01('0x7'));var jayson=require(_0xfa01('0x8'));var url=require(_0xfa01('0x9'));var qs=require(_0xfa01('0xa'));var logger=require(_0xfa01('0xb'))('api');var config=require(_0xfa01('0xc'));var APIOutOfIntervalError=require(_0xfa01('0xd'))['APIOutOfIntervalError'];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIHandleError=require('../../errors/api')[_0xfa01('0xe')];var db=require('../../mysqldb')['db'];config[_0xfa01('0xf')]=_[_0xfa01('0x10')](config[_0xfa01('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa01('0x11'))(new Redis(config[_0xfa01('0xf')]));require(_0xfa01('0x12'))['register'](socket);var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xfa01('0x13')]['http']({'port':0x232a});var client9003=jayson[_0xfa01('0x13')][_0xfa01('0x14')]({'port':0x232b});var client9001=jayson['client'][_0xfa01('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x8b9389,_0x1d1e17,_0x166815,_0xe0927f){return new Promise(function(_0x1244c9,_0xb23d63){var _0x1f0d56=_0xe0927f||client;return _0x1f0d56[_0xfa01('0x15')](_0x8b9389,_0x166815)['then'](function(_0x40a86b){logger[_0xfa01('0x16')](_0xfa01('0x17'),_0x1d1e17,_0xfa01('0x18'));logger[_0xfa01('0x19')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1d1e17,'request\x20sent',JSON['stringify'](_0x40a86b));if(_0x40a86b[_0xfa01('0x1a')]){if(_0x40a86b[_0xfa01('0x1a')][_0xfa01('0x1b')]===0x1f4){logger['error'](_0xfa01('0x17'),_0x1d1e17,_0x40a86b[_0xfa01('0x1a')][_0xfa01('0x1c')]);return _0xb23d63(_0x40a86b[_0xfa01('0x1a')][_0xfa01('0x1c')]);}logger[_0xfa01('0x1a')](_0xfa01('0x17'),_0x1d1e17,_0x40a86b[_0xfa01('0x1a')]['message']);return _0x1244c9(_0x40a86b['error'][_0xfa01('0x1c')]);}else{logger['info'](_0xfa01('0x17'),_0x1d1e17,_0xfa01('0x18'));_0x1244c9(_0x40a86b[_0xfa01('0x1d')][_0xfa01('0x1c')]);}})[_0xfa01('0x1e')](function(_0x44516a){logger['error'](_0xfa01('0x17'),_0x1d1e17,_0x44516a);_0xb23d63(_0x44516a);});});}function respondWithStatusCode(_0x19962f,_0x48070a){_0x48070a=_0x48070a||0xcc;return function(_0x4bb131){if(_0x4bb131){return _0x19962f['sendStatus'](_0x48070a);}return _0x19962f[_0xfa01('0x1f')](_0x48070a)['end']();};}function respondWithResult(_0x4f7b9d,_0x3a848e){_0x3a848e=_0x3a848e||0xc8;return function(_0x3f7a8b){if(_0x3f7a8b){return _0x4f7b9d[_0xfa01('0x1f')](_0x3a848e)['json'](_0x3f7a8b);}};}function respondWithFilteredResult(_0x471adb,_0x3c810b){return function(_0x14406e){if(_0x14406e){var _0x58c0a8=typeof _0x3c810b[_0xfa01('0x20')]===_0xfa01('0x21')&&typeof _0x3c810b[_0xfa01('0x22')]===_0xfa01('0x21');var _0x834869=_0x14406e[_0xfa01('0x23')];var _0x4768c4=_0x58c0a8?0x0:_0x3c810b[_0xfa01('0x20')];var _0x30d3ad=_0x58c0a8?_0x14406e[_0xfa01('0x23')]:_0x3c810b[_0xfa01('0x20')]+_0x3c810b[_0xfa01('0x22')];var _0x2e759e;if(_0x30d3ad>=_0x834869){_0x30d3ad=_0x834869;_0x2e759e=0xc8;}else{_0x2e759e=0xce;}_0x471adb['status'](_0x2e759e);return _0x471adb[_0xfa01('0x24')](_0xfa01('0x25'),_0x4768c4+'-'+_0x30d3ad+'/'+_0x834869)[_0xfa01('0x26')](_0x14406e);}return null;};}function saveUpdates(_0x34a91d){return function(_0x531a79){if(_0x531a79){return _0x531a79[_0xfa01('0x27')](_0x34a91d)[_0xfa01('0x28')](function(_0x303ce3){return _0x303ce3;});}return null;};}function removeEntity(_0x334d9b){return function(_0x28454f){if(_0x28454f){return _0x28454f[_0xfa01('0x29')]()[_0xfa01('0x28')](function(){var _0x5bf117=_0x28454f['get']({'plain':!![]});var _0x203f27=_0xfa01('0x2a');return db['UserProfileResource'][_0xfa01('0x29')]({'where':{'type':_0x203f27,'resourceId':_0x5bf117['id']}})[_0xfa01('0x28')](function(){return _0x28454f;});})[_0xfa01('0x28')](function(){_0x334d9b[_0xfa01('0x1f')](0xcc)[_0xfa01('0x2b')]();});}};}function handleEntityNotFound(_0x1fded0){return function(_0x2c4cbe){if(!_0x2c4cbe){_0x1fded0[_0xfa01('0x2c')](0x194);}return _0x2c4cbe;};}function handleError(_0x25d653,_0xc9c7ed){_0xc9c7ed=_0xc9c7ed||0x1f4;return function(_0x3941ca){logger[_0xfa01('0x1a')](_0x3941ca[_0xfa01('0x2d')]);if(_0x3941ca[_0xfa01('0x2e')]){delete _0x3941ca[_0xfa01('0x2e')];}_0x25d653[_0xfa01('0x1f')](_0xc9c7ed)[_0xfa01('0x2f')](_0x3941ca);};}function iftimePromise(_0xa7ab86,_0x2c56ef){return respondWithRpcPromise('Command',_0xfa01('0x30'),{'command':_0x2c56ef[_0xfa01('0x31')]?util[_0xfa01('0x32')]('iftime\x20%s,%s',_0xa7ab86[_0xfa01('0x33')],_0x2c56ef[_0xfa01('0x31')]):util['format'](_0xfa01('0x34'),_0xa7ab86['interval'])},client9002)[_0xfa01('0x28')](function(_0x4dc8f5){var _0x2c0722=_0x4dc8f5&&_0x4dc8f5['indexOf'](_0xfa01('0x35'))>=0x0?!![]:![];logger['info'](_0xfa01('0x36'),_0x2c56ef['id'],_0xa7ab86['id'],_0xa7ab86[_0xfa01('0x33')],_0x2c0722?_0xfa01('0x37'):_0xfa01('0x38'),_0x2c56ef[_0xfa01('0x31')]?_0x2c56ef[_0xfa01('0x31')]:_0xfa01('0x39'));return _0x2c0722;})[_0xfa01('0x1e')](function(_0x5dd215){logger[_0xfa01('0x1a')](_0xfa01('0x36'),_0x2c56ef['id'],_0xa7ab86['id'],_0xa7ab86[_0xfa01('0x33')],util[_0xfa01('0x3a')](_0x5dd215,{'showHidden':![],'depth':null}),_0x2c56ef[_0xfa01('0x31')]?_0x2c56ef[_0xfa01('0x31')]:_0xfa01('0x39'));return![];});}function checkWebsiteIntervals(_0x556b54){var _0x109212=_['map'](_0x556b54[_0xfa01('0x3b')][_0xfa01('0x3c')],function(_0x588969){var _0x12a887=_0x588969[_0xfa01('0x3d')]({'plain':!![]});return iftimePromise(_0x12a887,_0x556b54);});return Promise[_0xfa01('0x3e')](_0x109212)[_0xfa01('0x28')](function(_0x201897){return _[_0xfa01('0x3f')](_0x201897);});}function createInteractionObject(_0x36666a,_0x1f02c6,_0x3615a7,_0x1b0af4){var _0x57e873=require(_0xfa01('0x40'));var _0x31b534=new _0x57e873();var _0x2344ad=_0x31b534[_0xfa01('0x41')](_0x3615a7[_0xfa01('0x42')])[_0xfa01('0x43')]();var _0x3d468a=_0x1f02c6[_0xfa01('0x44')];if(_0x3615a7[_0xfa01('0x45')]){_0x3d468a=_0x3615a7[_0xfa01('0x45')];}else if(_0x3615a7[_0xfa01('0x46')]){_0x3d468a=_[_0xfa01('0x47')](_0x3615a7[_0xfa01('0x46')][_0xfa01('0x48')](','));}return{'ContactId':_0x1b0af4['id'],'ChatWebsiteId':_0x36666a,'from':(_0x1b0af4['firstName']||'')+'\x20'+(_0x1b0af4[_0xfa01('0x49')]||''),'customerIp':_0x3d468a,'customerPort':_0x3615a7[_0xfa01('0x4a')]?_0x3615a7[_0xfa01('0x4a')]:null,'referer':_0x1f02c6[_0xfa01('0x4b')],'browserName':_0x2344ad[_0xfa01('0x4c')][_0xfa01('0x2e')]&&_0x2344ad['browser'][_0xfa01('0x4d')]?util['format']('%s\x20%s',_0x2344ad[_0xfa01('0x4c')][_0xfa01('0x2e')],_0x2344ad[_0xfa01('0x4c')][_0xfa01('0x4d')]):'unknown','browserVersion':_0x2344ad[_0xfa01('0x4c')][_0xfa01('0x4d')]||_0xfa01('0x4e'),'osName':util[_0xfa01('0x32')](_0xfa01('0x4f'),_0x2344ad['os'][_0xfa01('0x2e')],_0x2344ad['os']['version']),'osVersion':_0x2344ad['os']['version'],'deviceModel':_0x2344ad[_0xfa01('0x50')][_0xfa01('0x51')]&&_0x2344ad[_0xfa01('0x50')]['vendor']?util[_0xfa01('0x32')](_0xfa01('0x52'),_0x2344ad[_0xfa01('0x50')][_0xfa01('0x51')],_0x2344ad[_0xfa01('0x50')]['vendor'],_0x2344ad[_0xfa01('0x50')]['type']):null,'deviceVendor':_0x2344ad[_0xfa01('0x50')]['vendor'],'deviceType':_0x2344ad['device'][_0xfa01('0x53')],'formData':JSON[_0xfa01('0x54')](_0x1f02c6)};}exports[_0xfa01('0x55')]=function(_0x57f9c9,_0x2aa582){var _0x44c728={'include':[{'model':db[_0xfa01('0x56')],'as':_0xfa01('0x57')}]},_0x4ec461={},_0x32f7bd={'count':0x0,'rows':[]};var _0x5a16b7=_['map'](db[_0xfa01('0x58')]['rawAttributes'],function(_0x4805fb){return{'name':_0x4805fb['fieldName'],'type':_0x4805fb[_0xfa01('0x53')][_0xfa01('0x59')]};});_0x4ec461[_0xfa01('0x51')]=_[_0xfa01('0x5a')](_0x5a16b7,'name');_0x4ec461[_0xfa01('0x5b')]=_['keys'](_0x57f9c9[_0xfa01('0x5b')]);_0x4ec461[_0xfa01('0x5c')]=_[_0xfa01('0x5d')](_0x4ec461['model'],_0x4ec461[_0xfa01('0x5b')]);_0x44c728[_0xfa01('0x5e')]=_[_0xfa01('0x5d')](_0x4ec461['model'],qs['fields'](_0x57f9c9['query']['fields']));_0x44c728['attributes']=_0x44c728[_0xfa01('0x5e')][_0xfa01('0x5f')]?_0x44c728[_0xfa01('0x5e')]:_0x4ec461[_0xfa01('0x51')];if(!_0x57f9c9[_0xfa01('0x5b')][_0xfa01('0x60')](_0xfa01('0x61'))){_0x44c728[_0xfa01('0x22')]=qs[_0xfa01('0x22')](_0x57f9c9['query'][_0xfa01('0x22')]);_0x44c728[_0xfa01('0x20')]=qs[_0xfa01('0x20')](_0x57f9c9['query']['offset']);}_0x44c728[_0xfa01('0x62')]=qs[_0xfa01('0x63')](_0x57f9c9['query'][_0xfa01('0x63')]);_0x44c728['where']=qs['filters'](_[_0xfa01('0x64')](_0x57f9c9[_0xfa01('0x5b')],_0x4ec461[_0xfa01('0x5c')]),_0x5a16b7);if(_0x57f9c9['query'][_0xfa01('0x65')]){_0x44c728[_0xfa01('0x66')]=_[_0xfa01('0x67')](_0x44c728[_0xfa01('0x66')],{'$or':_[_0xfa01('0x5a')](_0x5a16b7,function(_0x4ebc51){if(_0x4ebc51[_0xfa01('0x53')]!==_0xfa01('0x68')){var _0x3abf53={};_0x3abf53[_0x4ebc51['name']]={'$like':'%'+_0x57f9c9[_0xfa01('0x5b')][_0xfa01('0x65')]+'%'};return _0x3abf53;}})});}_0x44c728=_[_0xfa01('0x67')]({},_0x44c728,_0x57f9c9['options']);var _0x35d770={'where':_0x44c728['where']};return db[_0xfa01('0x58')][_0xfa01('0x23')](_0x35d770)[_0xfa01('0x28')](function(_0x184df3){_0x32f7bd[_0xfa01('0x23')]=_0x184df3;if(_0x57f9c9[_0xfa01('0x5b')][_0xfa01('0x69')]){_0x44c728[_0xfa01('0x6a')]=[{'all':!![]}];}return db[_0xfa01('0x58')][_0xfa01('0x6b')](_0x44c728);})[_0xfa01('0x28')](function(_0x45babe){_0x32f7bd[_0xfa01('0x6c')]=_0x45babe;return _0x32f7bd;})['then'](respondWithFilteredResult(_0x2aa582,_0x44c728))[_0xfa01('0x1e')](handleError(_0x2aa582,null));};exports[_0xfa01('0x6d')]=function(_0x128f62,_0xdf8941){var _0x4e5568={'raw':![],'where':{'id':_0x128f62[_0xfa01('0x6e')]['id']},'include':[{'model':db[_0xfa01('0x56')],'as':'mandatoryDispositionPause'}]},_0x5df919={};_0x5df919[_0xfa01('0x51')]=_[_0xfa01('0x6f')](db[_0xfa01('0x58')][_0xfa01('0x70')]);_0x5df919[_0xfa01('0x5b')]=_[_0xfa01('0x6f')](_0x128f62['query']);_0x5df919['filters']=_[_0xfa01('0x5d')](_0x5df919[_0xfa01('0x51')],_0x5df919['query']);_0x4e5568['attributes']=_[_0xfa01('0x5d')](_0x5df919[_0xfa01('0x51')],qs[_0xfa01('0x71')](_0x128f62['query'][_0xfa01('0x71')]));_0x4e5568['attributes']=_0x4e5568[_0xfa01('0x5e')][_0xfa01('0x5f')]?_0x4e5568[_0xfa01('0x5e')]:_0x5df919[_0xfa01('0x51')];if(_0x128f62[_0xfa01('0x5b')][_0xfa01('0x69')]){_0x4e5568[_0xfa01('0x6a')]=[{'all':!![]}];}_0x4e5568=_[_0xfa01('0x67')]({},_0x4e5568,_0x128f62[_0xfa01('0x72')]);return db[_0xfa01('0x58')][_0xfa01('0x73')](_0x4e5568)[_0xfa01('0x28')](handleEntityNotFound(_0xdf8941,null))['then'](respondWithResult(_0xdf8941,null))[_0xfa01('0x1e')](handleError(_0xdf8941,null));};exports[_0xfa01('0x74')]=function(_0x5829c0,_0x1e7560){return db['ChatWebsite'][_0xfa01('0x74')](_0x5829c0[_0xfa01('0x75')],{})[_0xfa01('0x28')](function(_0xa52269){var _0x1f3d6e=_0x5829c0['user']['get']({'plain':!![]});if(!_0x1f3d6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f3d6e[_0xfa01('0x76')]===_0xfa01('0x77')){var _0x23a65c=_0xa52269['get']({'plain':!![]});var _0xc2769a=_0xfa01('0x2a');return db[_0xfa01('0x78')][_0xfa01('0x73')]({'where':{'name':_0xc2769a,'userProfileId':_0x1f3d6e[_0xfa01('0x79')]},'raw':!![]})[_0xfa01('0x28')](function(_0x13c7d3){if(_0x13c7d3&&_0x13c7d3['autoAssociation']===0x0){return db[_0xfa01('0x7a')][_0xfa01('0x74')]({'name':_0x23a65c[_0xfa01('0x2e')],'resourceId':_0x23a65c['id'],'type':_0x13c7d3['name'],'sectionId':_0x13c7d3['id']},{})[_0xfa01('0x28')](function(){return _0xa52269;});}else{return _0xa52269;}})[_0xfa01('0x1e')](function(_0x3df986){logger[_0xfa01('0x1a')](_0xfa01('0x7b'),_0x3df986);throw _0x3df986;});}return _0xa52269;})['then'](respondWithResult(_0x1e7560,0xc9))['catch'](handleError(_0x1e7560,null));};exports['update']=function(_0xe20704,_0x26726e){if(_0xe20704[_0xfa01('0x75')]['id']){delete _0xe20704[_0xfa01('0x75')]['id'];}return db[_0xfa01('0x58')][_0xfa01('0x73')]({'where':{'id':_0xe20704['params']['id']},'include':[{'model':db[_0xfa01('0x56')],'as':_0xfa01('0x57')}]})['then'](handleEntityNotFound(_0x26726e,null))[_0xfa01('0x28')](saveUpdates(_0xe20704[_0xfa01('0x75')],null))[_0xfa01('0x28')](respondWithResult(_0x26726e,null))[_0xfa01('0x1e')](handleError(_0x26726e,null));};exports['destroy']=function(_0x5d0b19,_0x38fe79){return db[_0xfa01('0x58')]['find']({'where':{'id':_0x5d0b19[_0xfa01('0x6e')]['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0x38fe79,null))[_0xfa01('0x28')](removeEntity(_0x38fe79,null))[_0xfa01('0x1e')](handleError(_0x38fe79,null));};exports[_0xfa01('0x7c')]=function(_0x29b6b6,_0x3091f1){return db[_0xfa01('0x58')]['describe']()[_0xfa01('0x28')](respondWithResult(_0x3091f1,null))[_0xfa01('0x1e')](handleError(_0x3091f1,null));};exports['addDisposition']=function(_0x36f678,_0x205675){if(_0x36f678[_0xfa01('0x75')]['id']){delete _0x36f678[_0xfa01('0x75')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x36f678[_0xfa01('0x6e')]['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0x205675,null))['then'](function(_0x5658be){if(_0x5658be){_0x36f678[_0xfa01('0x75')][_0xfa01('0x7d')]=_0x5658be['id'];return db[_0xfa01('0x7e')][_0xfa01('0x74')](_0x36f678['body']);}})[_0xfa01('0x28')](respondWithResult(_0x205675,null))['catch'](handleError(_0x205675,null));};exports[_0xfa01('0x7f')]=function(_0x329f2c,_0x3df010){var _0x5013ad={'raw':![],'where':{}};var _0xe85444={};var _0x1d2a9c={'count':0x0,'rows':[]};return db[_0xfa01('0x58')]['findOne']({'where':{'id':_0x329f2c['params']['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0x3df010,null))[_0xfa01('0x28')](function(_0x23b148){if(_0x23b148){_0xe85444[_0xfa01('0x51')]=_[_0xfa01('0x6f')](db['Disposition'][_0xfa01('0x70')]);_0xe85444[_0xfa01('0x5b')]=_[_0xfa01('0x6f')](_0x329f2c[_0xfa01('0x5b')]);_0xe85444['filters']=_[_0xfa01('0x5d')](_0xe85444[_0xfa01('0x51')],_0xe85444[_0xfa01('0x5b')]);_0x5013ad[_0xfa01('0x5e')]=_[_0xfa01('0x5d')](_0xe85444[_0xfa01('0x51')],qs[_0xfa01('0x71')](_0x329f2c[_0xfa01('0x5b')][_0xfa01('0x71')]));_0x5013ad[_0xfa01('0x5e')]=_0x5013ad['attributes'][_0xfa01('0x5f')]?_0x5013ad['attributes']:_0xe85444[_0xfa01('0x51')];if(!_0x329f2c[_0xfa01('0x5b')][_0xfa01('0x60')](_0xfa01('0x61'))){_0x5013ad['limit']=qs['limit'](_0x329f2c[_0xfa01('0x5b')][_0xfa01('0x22')]);_0x5013ad[_0xfa01('0x20')]=qs[_0xfa01('0x20')](_0x329f2c[_0xfa01('0x5b')]['offset']);}_0x5013ad[_0xfa01('0x62')]=qs[_0xfa01('0x63')](_0x329f2c[_0xfa01('0x5b')][_0xfa01('0x63')]);_0x5013ad[_0xfa01('0x66')]=qs[_0xfa01('0x5c')](_[_0xfa01('0x64')](_0x329f2c[_0xfa01('0x5b')],_0xe85444[_0xfa01('0x5c')]));_0x5013ad[_0xfa01('0x66')]['ChatWebsiteId']=_0x23b148['id'];if(_0x329f2c[_0xfa01('0x5b')]['filter']){_0x5013ad['where']=_['merge'](_0x5013ad['where'],{'$or':_['map'](_0x5013ad['attributes'],function(_0x627efe){var _0x316e1c={};_0x316e1c[_0x627efe]={'$like':'%'+_0x329f2c[_0xfa01('0x5b')][_0xfa01('0x65')]+'%'};return _0x316e1c;})});}_0x5013ad=_['merge']({},_0x5013ad,_0x329f2c[_0xfa01('0x72')]);return db[_0xfa01('0x7e')][_0xfa01('0x23')]({'where':_0x5013ad['where']})[_0xfa01('0x28')](function(_0x272bc9){_0x1d2a9c[_0xfa01('0x23')]=_0x272bc9;if(_0x329f2c['query'][_0xfa01('0x69')]){_0x5013ad[_0xfa01('0x6a')]=[{'all':!![]}];}return db[_0xfa01('0x7e')][_0xfa01('0x6b')](_0x5013ad);})[_0xfa01('0x28')](function(_0x218b84){_0x1d2a9c[_0xfa01('0x6c')]=_0x218b84;return _0x1d2a9c;});}})['then'](respondWithFilteredResult(_0x3df010,_0x5013ad))['catch'](handleError(_0x3df010,null));};exports[_0xfa01('0x80')]=function(_0x27c93e,_0x59f528){return db[_0xfa01('0x58')][_0xfa01('0x73')]({'where':{'id':_0x27c93e[_0xfa01('0x6e')]['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0x59f528,null))['then'](function(_0x4ce351){if(_0x4ce351){return _0x4ce351[_0xfa01('0x80')](_0x27c93e[_0xfa01('0x5b')][_0xfa01('0x81')]);}})[_0xfa01('0x28')](respondWithStatusCode(_0x59f528,null))['catch'](handleError(_0x59f528,null));};exports[_0xfa01('0x82')]=function(_0x524551,_0x54fbfe){if(_0x524551[_0xfa01('0x75')]['id']){delete _0x524551['body']['id'];}return db['ChatWebsite'][_0xfa01('0x73')]({'where':{'id':_0x524551[_0xfa01('0x6e')]['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0x54fbfe,null))['then'](function(_0x536805){if(_0x536805){_0x524551[_0xfa01('0x75')][_0xfa01('0x7d')]=_0x536805['id'];return db[_0xfa01('0x83')][_0xfa01('0x74')](_0x524551[_0xfa01('0x75')]);}})[_0xfa01('0x28')](respondWithResult(_0x54fbfe,null))['catch'](handleError(_0x54fbfe,null));};exports[_0xfa01('0x84')]=function(_0x2f9d5f,_0x18a7e0){var _0x3f35e2={'raw':![],'where':{}};var _0x293d96={};var _0x519748={'count':0x0,'rows':[]};return db[_0xfa01('0x58')][_0xfa01('0x85')]({'where':{'id':_0x2f9d5f[_0xfa01('0x6e')]['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0x18a7e0,null))[_0xfa01('0x28')](function(_0x1a2297){if(_0x1a2297){_0x293d96['model']=_['keys'](db['CannedAnswer'][_0xfa01('0x70')]);_0x293d96[_0xfa01('0x5b')]=_[_0xfa01('0x6f')](_0x2f9d5f[_0xfa01('0x5b')]);_0x293d96[_0xfa01('0x5c')]=_['intersection'](_0x293d96['model'],_0x293d96['query']);_0x3f35e2[_0xfa01('0x5e')]=_[_0xfa01('0x5d')](_0x293d96[_0xfa01('0x51')],qs['fields'](_0x2f9d5f['query'][_0xfa01('0x71')]));_0x3f35e2[_0xfa01('0x5e')]=_0x3f35e2[_0xfa01('0x5e')][_0xfa01('0x5f')]?_0x3f35e2[_0xfa01('0x5e')]:_0x293d96[_0xfa01('0x51')];if(!_0x2f9d5f[_0xfa01('0x5b')][_0xfa01('0x60')](_0xfa01('0x61'))){_0x3f35e2[_0xfa01('0x22')]=qs[_0xfa01('0x22')](_0x2f9d5f['query']['limit']);_0x3f35e2[_0xfa01('0x20')]=qs[_0xfa01('0x20')](_0x2f9d5f[_0xfa01('0x5b')][_0xfa01('0x20')]);}_0x3f35e2[_0xfa01('0x62')]=qs[_0xfa01('0x63')](_0x2f9d5f[_0xfa01('0x5b')][_0xfa01('0x63')]);_0x3f35e2[_0xfa01('0x66')]=qs[_0xfa01('0x5c')](_['pick'](_0x2f9d5f['query'],_0x293d96[_0xfa01('0x5c')]));_0x3f35e2['where'][_0xfa01('0x7d')]=_0x1a2297['id'];if(_0x2f9d5f[_0xfa01('0x5b')][_0xfa01('0x65')]){_0x3f35e2[_0xfa01('0x66')]=_[_0xfa01('0x67')](_0x3f35e2['where'],{'$or':_[_0xfa01('0x5a')](_0x3f35e2[_0xfa01('0x5e')],function(_0x1f3bbc){var _0x2d1858={};_0x2d1858[_0x1f3bbc]={'$like':'%'+_0x2f9d5f[_0xfa01('0x5b')]['filter']+'%'};return _0x2d1858;})});}_0x3f35e2=_[_0xfa01('0x67')]({},_0x3f35e2,_0x2f9d5f[_0xfa01('0x72')]);return db[_0xfa01('0x83')][_0xfa01('0x23')]({'where':_0x3f35e2[_0xfa01('0x66')]})['then'](function(_0x43bb34){_0x519748['count']=_0x43bb34;if(_0x2f9d5f['query'][_0xfa01('0x69')]){_0x3f35e2['include']=[{'all':!![]}];}return db[_0xfa01('0x83')]['findAll'](_0x3f35e2);})[_0xfa01('0x28')](function(_0xeb64f8){_0x519748[_0xfa01('0x6c')]=_0xeb64f8;return _0x519748;});}})[_0xfa01('0x28')](respondWithFilteredResult(_0x18a7e0,_0x3f35e2))[_0xfa01('0x1e')](handleError(_0x18a7e0,null));};exports['removeAnswers']=function(_0x2d02ee,_0x29c867){return db[_0xfa01('0x58')][_0xfa01('0x73')]({'where':{'id':_0x2d02ee[_0xfa01('0x6e')]['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0x29c867,null))[_0xfa01('0x28')](function(_0x452c41){if(_0x452c41){return _0x452c41['removeAnswers'](_0x2d02ee['query'][_0xfa01('0x81')]);}})[_0xfa01('0x28')](respondWithStatusCode(_0x29c867,null))['catch'](handleError(_0x29c867,null));};exports[_0xfa01('0x86')]=function(_0x2b2744,_0x384db9){_0x2b2744['body'][_0xfa01('0x87')]=_0x2b2744[_0xfa01('0x88')]['filename'];return db['ChatWebsite'][_0xfa01('0x73')]({'where':{'id':_0x2b2744[_0xfa01('0x6e')]['id']}})['then'](handleEntityNotFound(_0x384db9,null))['then'](saveUpdates(_0x2b2744[_0xfa01('0x75')],null))[_0xfa01('0x28')](respondWithResult(_0x384db9,null))[_0xfa01('0x1e')](handleError(_0x384db9,null));};exports['addAvatar']=function(_0x320c65,_0x3a4770){_0x320c65[_0xfa01('0x75')][_0xfa01('0x89')]=_0x320c65[_0xfa01('0x88')][_0xfa01('0x8a')];return db[_0xfa01('0x58')][_0xfa01('0x73')]({'where':{'id':_0x320c65[_0xfa01('0x6e')]['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0x3a4770,null))[_0xfa01('0x28')](saveUpdates(_0x320c65[_0xfa01('0x75')],null))[_0xfa01('0x28')](respondWithResult(_0x3a4770,null))['catch'](handleError(_0x3a4770,null));};exports[_0xfa01('0x8b')]=function(_0x75a1af,_0x423f94){_0x75a1af[_0xfa01('0x75')][_0xfa01('0x8c')]=_0x75a1af[_0xfa01('0x88')][_0xfa01('0x8a')];return db[_0xfa01('0x58')][_0xfa01('0x73')]({'where':{'id':_0x75a1af[_0xfa01('0x6e')]['id']}})['then'](handleEntityNotFound(_0x423f94,null))[_0xfa01('0x28')](saveUpdates(_0x75a1af[_0xfa01('0x75')],null))[_0xfa01('0x28')](respondWithResult(_0x423f94,null))[_0xfa01('0x1e')](handleError(_0x423f94,null));};exports[_0xfa01('0x8d')]=function(_0x387f7b,_0x21bc2c){_0x387f7b[_0xfa01('0x75')][_0xfa01('0x8e')]=_0x387f7b[_0xfa01('0x88')][_0xfa01('0x8a')];return db[_0xfa01('0x58')][_0xfa01('0x73')]({'where':{'id':_0x387f7b[_0xfa01('0x6e')]['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0x21bc2c,null))[_0xfa01('0x28')](saveUpdates(_0x387f7b[_0xfa01('0x75')],null))['then'](respondWithResult(_0x21bc2c,null))[_0xfa01('0x1e')](handleError(_0x21bc2c,null));};exports[_0xfa01('0x8f')]=function(_0x32654d,_0x2cecb3){var _0x7f3d6c=path['join'](config[_0xfa01('0x90')],'server/files/images/logos/default_logo.svg');var _0x42aab7={'where':{'id':_0x32654d['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x33ed99=![];return require(_0xfa01('0x91'))[_0xfa01('0x92')]()[_0xfa01('0x28')](function(_0x4904ae){if(_0x4904ae){_0x33ed99=_0x4904ae['custom'];}})['then'](function(){return db[_0xfa01('0x58')][_0xfa01('0x73')](_0x42aab7);})[_0xfa01('0x28')](handleEntityNotFound(_0x2cecb3,null))[_0xfa01('0x28')](function(_0x45b30b){if(_0x45b30b){if(!_[_0xfa01('0x93')](_0x45b30b[_0xfa01('0x87')])){if(fs[_0xfa01('0x94')](path[_0xfa01('0x95')](config[_0xfa01('0x90')],_0xfa01('0x96'),_0x45b30b[_0xfa01('0x87')]))&&_0x33ed99){_0x7f3d6c=path[_0xfa01('0x95')](config[_0xfa01('0x90')],_0xfa01('0x96'),_0x45b30b[_0xfa01('0x87')]);}}return _0x2cecb3[_0xfa01('0x97')](_0x7f3d6c);}})[_0xfa01('0x1e')](handleError(_0x2cecb3,null));};exports[_0xfa01('0x98')]=function(_0x443801,_0x494099){var _0x22862e=path[_0xfa01('0x95')](config['root'],_0xfa01('0x99'));var _0x419511={'where':{'id':_0x443801[_0xfa01('0x6e')]['id']},'attributes':['id',_0xfa01('0x89')],'raw':!![]};return db[_0xfa01('0x58')][_0xfa01('0x73')](_0x419511)[_0xfa01('0x28')](handleEntityNotFound(_0x494099,null))[_0xfa01('0x28')](function(_0x3ccc2e){if(_0x3ccc2e){if(!_[_0xfa01('0x93')](_0x3ccc2e['agentAvatar'])){if(fs[_0xfa01('0x94')](path[_0xfa01('0x95')](config[_0xfa01('0x90')],_0xfa01('0x9a'),_0x3ccc2e['agentAvatar']))){_0x22862e=path[_0xfa01('0x95')](config[_0xfa01('0x90')],_0xfa01('0x9a'),_0x3ccc2e['agentAvatar']);}}return _0x494099[_0xfa01('0x97')](_0x22862e);}})[_0xfa01('0x1e')](handleError(_0x494099,null));};exports['getCustomerAvatar']=function(_0x4b6a5b,_0x53ffea){var _0x2360d1=path['join'](config[_0xfa01('0x90')],_0xfa01('0x9b'));var _0x4db772={'where':{'id':_0x4b6a5b[_0xfa01('0x6e')]['id']},'attributes':['id',_0xfa01('0x8c'),'showCustomerAvatar'],'raw':!![]};return db[_0xfa01('0x58')]['find'](_0x4db772)[_0xfa01('0x28')](handleEntityNotFound(_0x53ffea,null))[_0xfa01('0x28')](function(_0xd2c2e7){if(_0xd2c2e7){if(!_[_0xfa01('0x93')](_0xd2c2e7[_0xfa01('0x8c')])){if(fs[_0xfa01('0x94')](path[_0xfa01('0x95')](config['root'],_0xfa01('0x9a'),_0xd2c2e7[_0xfa01('0x8c')]))&&_0xd2c2e7[_0xfa01('0x9c')]){_0x2360d1=path['join'](config['root'],_0xfa01('0x9a'),_0xd2c2e7[_0xfa01('0x8c')]);}}return _0x53ffea['download'](_0x2360d1);}})[_0xfa01('0x1e')](handleError(_0x53ffea,null));};exports['getSystemAvatar']=function(_0x2921a4,_0xd06084){var _0x31c118=path[_0xfa01('0x95')](config[_0xfa01('0x90')],'server/files/images/avatars/system_avatar.png');var _0x3af595={'where':{'id':_0x2921a4[_0xfa01('0x6e')]['id']},'attributes':['id',_0xfa01('0x8e')],'raw':!![]};return db['ChatWebsite'][_0xfa01('0x73')](_0x3af595)[_0xfa01('0x28')](handleEntityNotFound(_0xd06084,null))[_0xfa01('0x28')](function(_0x1f9045){if(_0x1f9045){if(!_[_0xfa01('0x93')](_0x1f9045['systemAvatar'])){if(fs[_0xfa01('0x94')](path[_0xfa01('0x95')](config[_0xfa01('0x90')],'server/files/images/avatars/',_0x1f9045[_0xfa01('0x8e')]))){_0x31c118=path[_0xfa01('0x95')](config['root'],_0xfa01('0x9a'),_0x1f9045[_0xfa01('0x8e')]);}}return _0xd06084[_0xfa01('0x97')](_0x31c118);}})['catch'](handleError(_0xd06084,null));};exports[_0xfa01('0x9d')]=function(_0x6728fc,_0x136f0c){var _0x5a0a98={'body':_0x6728fc[_0xfa01('0x75')],'channel':'chat'};var _0x43dc86=[];var _0x59c59a=[];var _0x412e04={};var _0x2695aa=![];return db[_0xfa01('0x9e')][_0xfa01('0x7c')]()['then'](function(_0x18a305){if(!_0x18a305){throw new db['Sequelize'][(_0xfa01('0x9f'))](_0xfa01('0xa0'));}_0x43dc86=_['difference'](_['keys'](_0x18a305),[_0xfa01('0xa1'),_0xfa01('0xa2')]);_0x59c59a=_[_0xfa01('0xa3')](_['keys'](_0x18a305),['createdAt',_0xfa01('0xa2'),_0xfa01('0xa4'),_0xfa01('0xa5')]);if(_0x6728fc['body']['id']){delete _0x6728fc['body']['id'];}if(_[_0xfa01('0x93')](_0x6728fc[_0xfa01('0x75')][_0xfa01('0xa6')])){throw new db[(_0xfa01('0xa7'))][(_0xfa01('0x9f'))](_0xfa01('0xa8'));}if(_['isNil'](_0x6728fc[_0xfa01('0x75')]['body'])||_0x6728fc['body'][_0xfa01('0x75')]===''){throw new db[(_0xfa01('0xa7'))][(_0xfa01('0x9f'))](_0xfa01('0xa9'));}if(_[_0xfa01('0x93')](_0x6728fc[_0xfa01('0x75')][_0xfa01('0xaa')])){throw new db[(_0xfa01('0xa7'))][(_0xfa01('0x9f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x59c59a);}if(!_[_0xfa01('0xab')](_0x59c59a,_0x6728fc[_0xfa01('0x75')][_0xfa01('0xaa')])){throw new db['Sequelize'][(_0xfa01('0x9f'))](_0xfa01('0xac')+_0x59c59a);}_0x412e04[_0x6728fc[_0xfa01('0x75')][_0xfa01('0xaa')]]=_0x6728fc['body'][_0xfa01('0xa6')];})['then'](function(){return db[_0xfa01('0x58')][_0xfa01('0x73')]({'where':{'id':_0x6728fc[_0xfa01('0x6e')]['id']},'include':[{'model':db[_0xfa01('0xad')],'as':'List','include':[{'model':db[_0xfa01('0x9e')],'as':'Contacts','where':_0x412e04,'limit':0x1,'order':[['updatedAt',_0xfa01('0xae')]]}]},{'model':db[_0xfa01('0xaf')],'as':_0xfa01('0xb0')},{'model':db[_0xfa01('0x3b')],'as':_0xfa01('0x3b'),'include':[{'model':db['Interval'],'as':_0xfa01('0x3c'),'attributes':['id',_0xfa01('0x33')],'raw':!![]}]}]});})[_0xfa01('0x28')](function(_0x1d2eeb){if(!_0x1d2eeb)throw new APINotFoundError(util[_0xfa01('0x32')](_0xfa01('0xb1'),_0x6728fc['params']['id']));if(!_0x1d2eeb[_0xfa01('0x3b')]||!_0x1d2eeb['Interval'][_0xfa01('0x3c')])return[_0x1d2eeb,!![]];return[_0x1d2eeb,checkWebsiteIntervals(_0x1d2eeb)];})[_0xfa01('0xb2')](function(_0x3a534f,_0x320417){if(!_0x320417)throw new APIOutOfIntervalError();if(!_0x3a534f[_0xfa01('0xb3')])return;_0x5a0a98[_0xfa01('0xb4')]=_0x3a534f;_0x5a0a98[_0xfa01('0xb5')]=_0x3a534f[_0xfa01('0xb3')];_0x5a0a98[_0xfa01('0xb6')]=_['orderBy'](_0x3a534f[_0xfa01('0xb0')],[_0xfa01('0xb7')],[_0xfa01('0xb8')]);if(_0x5a0a98[_0xfa01('0xb4')][_0xfa01('0xb0')]){delete _0x5a0a98[_0xfa01('0xb4')][_0xfa01('0xb0')];}if(_0x5a0a98[_0xfa01('0xb4')][_0xfa01('0xb3')]&&_0x5a0a98['account'][_0xfa01('0xb3')][_0xfa01('0xb9')][_0xfa01('0x5f')]){return _0x5a0a98[_0xfa01('0xb4')][_0xfa01('0xb3')][_0xfa01('0xb9')][0x0];}var _0x361458=_[_0xfa01('0x10')](_0x6728fc[_0xfa01('0x75')],{'firstName':_0x6728fc['body']['from'],'ListId':_0x3a534f[_0xfa01('0xa5')]});_0x361458[_0x6728fc[_0xfa01('0x75')][_0xfa01('0xaa')]]=_0x6728fc[_0xfa01('0x75')][_0xfa01('0xa6')];return db[_0xfa01('0x9e')][_0xfa01('0x74')](_0x361458,{'fields':_0x43dc86,'raw':!![]});})['then'](function(_0x26ba5e){_0x5a0a98[_0xfa01('0xba')]=_0x26ba5e;var _0x2d3810=createInteractionObject(_0x6728fc[_0xfa01('0x6e')]['id'],_0x6728fc['body'],_0x6728fc['headers'],_0x26ba5e);var _0x409684={'ChatWebsiteId':_0x6728fc[_0xfa01('0x6e')]['id'],'closed':![]};if(_0x6728fc[_0xfa01('0x75')][_0xfa01('0xbb')]){_0x409684[_0xfa01('0xbb')]=_0x6728fc['body'][_0xfa01('0xbb')];return db['ChatInteraction'][_0xfa01('0x73')]({'where':_0x409684})['then'](function(_0x4b9ffb){if(_0x4b9ffb){_0x2695aa=!![];return _0x4b9ffb;}_0x2d3810[_0xfa01('0xbb')]=_0x6728fc[_0xfa01('0x75')][_0xfa01('0xbb')];_0x2d3810[_0xfa01('0xbc')]=_0x6728fc[_0xfa01('0x75')]['externalUrl'];return db[_0xfa01('0xbd')]['create'](_0x2d3810);});}_0x409684[_0xfa01('0xbe')]=_0x26ba5e['id'];if(_0x6728fc[_0xfa01('0x75')][_0xfa01('0xbf')]&&_0x6728fc[_0xfa01('0x75')][_0xfa01('0xbf')]['id']){_0x409684['id']=_0x6728fc[_0xfa01('0x75')]['interaction']['id'];return db['ChatInteraction']['find']({'where':_0x409684})[_0xfa01('0x28')](function(_0x3d2111){if(_0x3d2111){_0x2695aa=!![];return _0x3d2111;}return db['ChatInteraction'][_0xfa01('0x74')](_0x2d3810);});}return db[_0xfa01('0xbd')][_0xfa01('0x74')](_0x2d3810);})[_0xfa01('0x28')](function(_0x34cbd4){if(!_0x2695aa)return _0x34cbd4;var _0x559c3d={'from':(_0x5a0a98[_0xfa01('0xba')][_0xfa01('0xc0')]||'')+'\x20'+(_0x5a0a98['contact'][_0xfa01('0x49')]||'')};if(_0x6728fc[_0xfa01('0x75')]['threadId']&&_0x6728fc['body'][_0xfa01('0xc1')]&&_0x6728fc[_0xfa01('0x75')][_0xfa01('0xbb')]!=_0x6728fc[_0xfa01('0x75')][_0xfa01('0xc1')]){_0x559c3d['threadId']=_0x6728fc[_0xfa01('0x75')][_0xfa01('0xc1')];}return _0x34cbd4[_0xfa01('0x27')](_0x559c3d);})['then'](function(_0x38ff9f){_0x5a0a98['interaction']=_0x38ff9f[_0xfa01('0x3d')]({'plain':!![]});_0x5a0a98[_0xfa01('0xbf')]['created']=!_0x2695aa;if(_0x5a0a98['interaction']['created']){if(_0x5a0a98[_0xfa01('0xb4')][_0xfa01('0xc2')]){_0x5a0a98[_0xfa01('0xb6')]['push']({'id':0x0,'priority':_0x5a0a98[_0xfa01('0xb6')][_0xfa01('0x5f')]+0x1,'app':'close','appdata':_0xfa01('0xc3'),'interval':_0xfa01('0xc4')});}}return db[_0xfa01('0xc5')][_0xfa01('0x74')]({'body':_0x6728fc[_0xfa01('0x75')][_0xfa01('0x75')],'ChatWebsiteId':_0x6728fc[_0xfa01('0x6e')]['id'],'ChatInteractionId':_0x38ff9f['id'],'direction':'in','ContactId':_0x5a0a98[_0xfa01('0xba')]['id'],'AttachmentId':_0x6728fc[_0xfa01('0x75')][_0xfa01('0xc6')]});})[_0xfa01('0x28')](function(_0x25f185){_0x5a0a98[_0xfa01('0x1c')]=_0x25f185;if(!_0x5a0a98['interaction'][_0xfa01('0xc7')]){return;}return db['User'][_0xfa01('0x73')]({'attributes':['id',_0xfa01('0x2e')],'where':{'id':_0x5a0a98[_0xfa01('0xbf')]['UserId']}});})[_0xfa01('0x28')](function(_0x34c2e4){if(_0x34c2e4){_0x5a0a98['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xfa01('0xc8'),'appdata':_0x34c2e4['name']+','+(_0x5a0a98[_0xfa01('0xb4')][_0xfa01('0xc9')]||0xa),'interval':_0xfa01('0xc4')});_0x5a0a98[_0xfa01('0xca')]=!![];}if(!_0x5a0a98[_0xfa01('0xbf')][_0xfa01('0xcb')]){return;}return db['ChatQueue']['find']({'attributes':['id',_0xfa01('0x2e')],'where':{'id':_0x5a0a98[_0xfa01('0xbf')][_0xfa01('0xcb')]}});})[_0xfa01('0x28')](function(_0x3a4e27){if(_0x3a4e27){_0x5a0a98[_0xfa01('0xb6')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x3a4e27[_0xfa01('0x2e')]+','+(_0x5a0a98[_0xfa01('0xb4')][_0xfa01('0xcc')]||0x12c),'interval':_0xfa01('0xc4')});}return respondWithRpcPromise(_0xfa01('0xcd'),'startRouting',_0x5a0a98);})[_0xfa01('0x28')](function(_0x29ad8f){respondWithRpcPromise(_0xfa01('0xce'),_0xfa01('0xce'),{'event':_0xfa01('0x9d'),'message':_0x29ad8f},client9002);return _0x29ad8f;})['then'](respondWithResult(_0x136f0c,null))[_0xfa01('0x1e')](APIHandleError(_0x136f0c));};exports[_0xfa01('0xcf')]=function(_0x1381cb,_0x40260b){var _0x3ae686,_0x3930d9,_0x407f07;var _0x14e3a5=[];var _0x2f973f={};var _0x3c0be3=_0x1381cb['files']||[];var _0x56af1b=[];var _0x22f9a2;return db['CmContact'][_0xfa01('0x7c')]()[_0xfa01('0x28')](function(_0x4d713e){if(!_0x4d713e){throw new db[(_0xfa01('0xa7'))][(_0xfa01('0x9f'))]('no\x20available\x20attributes');}_0x14e3a5=_[_0xfa01('0xa3')](_[_0xfa01('0x6f')](_0x4d713e),[_0xfa01('0xa1'),_0xfa01('0xa2'),_0xfa01('0xa4'),_0xfa01('0xa5')]);if(_0x1381cb[_0xfa01('0x75')]['id']){delete _0x1381cb['body']['id'];}if(_[_0xfa01('0x93')](_0x1381cb[_0xfa01('0x75')][_0xfa01('0xa6')])){throw _0x40260b[_0xfa01('0x1f')](0x1f4)[_0xfa01('0x2f')](new db['Sequelize'][(_0xfa01('0x9f'))](_0xfa01('0xa8')));}if(_[_0xfa01('0x93')](_0x1381cb[_0xfa01('0x75')][_0xfa01('0x75')])||_0x1381cb[_0xfa01('0x75')][_0xfa01('0x75')]===''){throw _0x40260b['status'](0x1f4)['send'](new db[(_0xfa01('0xa7'))][(_0xfa01('0x9f'))](_0xfa01('0xa9')));}if(_['isNil'](_0x1381cb[_0xfa01('0x75')]['mapKeyOffline'])){throw _0x40260b[_0xfa01('0x1f')](0x1f4)[_0xfa01('0x2f')](new db[(_0xfa01('0xa7'))][(_0xfa01('0x9f'))](_0xfa01('0xd0')+_0x14e3a5));}if(!_[_0xfa01('0xab')](_0x14e3a5,_0x1381cb[_0xfa01('0x75')][_0xfa01('0xd1')])){throw _0x40260b[_0xfa01('0x1f')](0x1f4)['send'](new db[(_0xfa01('0xa7'))][(_0xfa01('0x9f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x14e3a5));}_0x2f973f[_0x1381cb[_0xfa01('0x75')][_0xfa01('0xd1')]]=_0x1381cb[_0xfa01('0x75')]['from'];})[_0xfa01('0x28')](function(){return db['ChatWebsite'][_0xfa01('0x73')]({'where':{'id':_0x1381cb[_0xfa01('0x6e')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0xfa01('0xd2')],'as':_0xfa01('0xd2')}]});})[_0xfa01('0x28')](handleEntityNotFound(_0x40260b,null))['then'](function(_0x27017c){if(_0x27017c&&_0x27017c[_0xfa01('0xb3')]){_0x3930d9=_0x27017c;var _0x17c166=_['defaults'](_0x1381cb[_0xfa01('0x75')],{'firstName':_0x1381cb[_0xfa01('0x75')][_0xfa01('0xa6')],'phone':_0x1381cb[_0xfa01('0x75')][_0xfa01('0xa6')],'ListId':_0x27017c[_0xfa01('0xa5')]});_0x17c166[_0x1381cb['body'][_0xfa01('0xd1')]]=_0x1381cb['body'][_0xfa01('0xa6')];return db[_0xfa01('0x9e')][_0xfa01('0xd3')]({'where':_0x2f973f,'defaults':_0x17c166});}})[_0xfa01('0xb2')](function(_0x1f9b25){if(_0x1f9b25){_0x407f07=_0x1f9b25;var _0x5b17b7=fs['readFileSync'](path['join'](config['root'],_0xfa01('0xd4')),_0xfa01('0xd5'));var _0x4f1188=ejs[_0xfa01('0xd6')](_0x5b17b7,{'body':_[_0xfa01('0xd7')](_0x1381cb[_0xfa01('0x75')][_0xfa01('0x75')]),'bodyTitle':_0x3930d9[_0xfa01('0xd8')]});return db[_0xfa01('0xd9')]['create']({'body':_0x4f1188,'plainBody':htmlToText['fromString'](_0x4f1188),'ContactId':_0x1f9b25['id'],'ChatWebsiteId':_0x3930d9['id']});}})[_0xfa01('0x28')](function(_0x37f354){_0x22f9a2=_0x37f354;if(_0x3c0be3[_0xfa01('0x5f')]){var _0x5206f0=_0x3c0be3['map'](function(_0x1b7ee0){return{'name':_0x1b7ee0[_0xfa01('0xda')],'basename':_0x1b7ee0['filename'],'type':_0x1b7ee0['mimetype'],'ChatOfflineMessageId':_0x37f354['id']};});_0x56af1b=_0x5206f0['map'](_0x597d9c=>{var _0x1e974a={'filename':_0x597d9c[_0xfa01('0x2e')],'path':path[_0xfa01('0x95')](config['root'],_0xfa01('0xdb'),_0xfa01('0xdc'),_0xfa01('0xdd'),_0xfa01('0xde'),_0x597d9c[_0xfa01('0xdf')])};return _0x1e974a;});if(!_0x3930d9['openNewInteraction']){return db[_0xfa01('0xe0')][_0xfa01('0xe1')](function(_0x394df1){return db[_0xfa01('0xe2')][_0xfa01('0xe3')](_0x5206f0,{'transaction':_0x394df1});});}}})[_0xfa01('0x28')](function(){if(_0x22f9a2){_0x3ae686=_0x22f9a2;return db[_0xfa01('0xd2')][_0xfa01('0x85')]({'where':{'service':!![]},'include':[{'model':db[_0xfa01('0xe4')],'as':_0xfa01('0xe5'),'raw':!![],'include':[{'model':db[_0xfa01('0xe6')],'as':_0xfa01('0xe6'),'raw':!![]}]}]});}})['then'](function(_0x14a999){if(_0x14a999&&_0x14a999['Smtp']&&_0x3930d9['forwardOffline']&&_0x3930d9[_0xfa01('0xe7')]){var _0x4f852c=_0x14a999[_0xfa01('0xe8')]();return respondWithRpcPromise(_0xfa01('0xe9'),_0xfa01('0xea'),{'account':_0x4f852c,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x14a999[_0xfa01('0x2e')],_0x14a999['email']||_0x14a999[_0xfa01('0xe5')][_0xfa01('0x77')]),'to':_0x3930d9['forwardOfflineAddress'],'subject':_0x3930d9[_0xfa01('0xeb')],'html':_0x3ae686[_0xfa01('0x75')],'attachments':_0x56af1b}},client9003)[_0xfa01('0x28')](function(){return _0x3ae686;})[_0xfa01('0x1e')](function(_0x1f2dae){logger[_0xfa01('0x1a')](_0x1f2dae);});}})[_0xfa01('0x28')](function(){if(_0x3930d9&&_0x3930d9[_0xfa01('0xec')]&&_0x3930d9['MailAccountId']){var _0x258e51=[];if(_0x3c0be3[_0xfa01('0x5f')]){_0x258e51=_0x3c0be3[_0xfa01('0x5a')](function(_0x55c231){return{'name':_0x55c231[_0xfa01('0xda')],'basename':_0x55c231[_0xfa01('0x8a')],'type':_0x55c231[_0xfa01('0xed')],'ChatOfflineMessageId':_0x22f9a2['id']};});}var _0x440c82;if(!_[_0xfa01('0x93')](_0x3930d9[_0xfa01('0xee')])){var _0x3cad20=_['map'](_0x1381cb[_0xfa01('0x75')],function(_0x1e3a9a){return _0x1e3a9a;});var _0x1543c2=_[_0xfa01('0xef')](_0x3cad20)[0x0];var _0x2813d8=_[_0xfa01('0xf0')](_0x1543c2,function(_0x54d8d0){return _0x54d8d0;});_0x440c82=_0x2813d8[0x1][_0x3930d9[_0xfa01('0xee')]];}var _0x328b57={'from':_0x407f07[_0xfa01('0xf1')],'firstName':_0x407f07[_0xfa01('0xc0')],'lastName':_0x407f07[_0xfa01('0x49')],'mapKey':_0xfa01('0xf1'),'message':{'from':_0x407f07[_0xfa01('0xf1')],'to':_0x3930d9[_0xfa01('0xd2')][_0xfa01('0xf1')],'cc':'','subject':_['isNil'](_0x440c82)?_0x3930d9['offlineMessageSubject']:_0x440c82,'messageId':'','sentAt':new Date(),'attach':_0x258e51[_0xfa01('0x5f')],'attachments':_0x258e51,'originChannel':_0xfa01('0xf2'),'ChatWebsiteId':_0x3930d9['id'],'ChatOfflineMessageId':_0x3ae686['id'],'originTo':_0x3930d9[_0xfa01('0xd2')][_0xfa01('0xf1')]},'body':_0x3ae686['body']};var _0x11ae40={'account':{'id':_0x3930d9[_0xfa01('0xf3')]},'body':_0x328b57,'log':_0xfa01('0xf4')};return respondWithRpcPromise(_0xfa01('0xf4'),_0xfa01('0xf5'),_0x11ae40,client9001)[_0xfa01('0x28')](function(){return _0x3ae686;})[_0xfa01('0x1e')](function(_0x424098){logger[_0xfa01('0x1a')](_0x424098);});}return;})[_0xfa01('0x28')](function(){if(_0x3ae686){return _0x3ae686;}})[_0xfa01('0x28')](respondWithResult(_0x40260b,null))['catch'](function(){for(var _0x552b13 of _0x3c0be3){var _0x376ecc=path[_0xfa01('0x95')](config[_0xfa01('0x90')],_0xfa01('0xdb'),_0xfa01('0xdc'),_0xfa01('0xdd'),_0xfa01('0xde'),_0x552b13[_0xfa01('0x8a')]);fs_extra[_0xfa01('0xf6')](_0x376ecc)['catch'](function(_0x482e11){logger['error'](_0xfa01('0xf7'),_0x376ecc,_0x482e11);});}});};exports['addInteraction']=function(_0x11bfa6,_0x19f365){return db[_0xfa01('0xbd')][_0xfa01('0x73')]({'where':{'id':_0x11bfa6['params']['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0x19f365,null))['then'](function(_0x2e719a){if(_0x2e719a){return _0x2e719a[_0xfa01('0xf8')](_0x11bfa6['body'][_0xfa01('0x81')],_['omit'](_0x11bfa6[_0xfa01('0x75')],[_0xfa01('0x81'),'id'])||{});}})['then'](respondWithResult(_0x19f365,null))[_0xfa01('0x1e')](handleError(_0x19f365,null));};exports[_0xfa01('0xf9')]=function(_0x371738,_0x488ba5){var _0x24f7c6={'raw':![],'where':{}};var _0x674f40={};var _0x207879={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xfa01('0x85')]({'where':{'id':_0x371738[_0xfa01('0x6e')]['id']}})['then'](handleEntityNotFound(_0x488ba5,null))['then'](function(_0x51597a){if(_0x51597a){_0x674f40['model']=_[_0xfa01('0x6f')](db[_0xfa01('0xbd')]['rawAttributes']);_0x674f40[_0xfa01('0x5b')]=_[_0xfa01('0x6f')](_0x371738[_0xfa01('0x5b')]);_0x674f40[_0xfa01('0x5c')]=_[_0xfa01('0x5d')](_0x674f40[_0xfa01('0x51')],_0x674f40[_0xfa01('0x5b')]);_0x24f7c6['attributes']=_[_0xfa01('0x5d')](_0x674f40['model'],qs['fields'](_0x371738[_0xfa01('0x5b')][_0xfa01('0x71')]));_0x24f7c6[_0xfa01('0x5e')]=_0x24f7c6[_0xfa01('0x5e')]['length']?_0x24f7c6[_0xfa01('0x5e')]:_0x674f40['model'];if(!_0x371738['query'][_0xfa01('0x60')](_0xfa01('0x61'))){_0x24f7c6[_0xfa01('0x22')]=qs['limit'](_0x371738['query'][_0xfa01('0x22')]);_0x24f7c6[_0xfa01('0x20')]=qs[_0xfa01('0x20')](_0x371738[_0xfa01('0x5b')][_0xfa01('0x20')]);}_0x24f7c6[_0xfa01('0x62')]=qs[_0xfa01('0x63')](_0x371738[_0xfa01('0x5b')][_0xfa01('0x63')]);_0x24f7c6[_0xfa01('0x66')]=qs[_0xfa01('0x5c')](_[_0xfa01('0x64')](_0x371738[_0xfa01('0x5b')],_0x674f40[_0xfa01('0x5c')]));_0x24f7c6[_0xfa01('0x66')]['ChatWebsiteId']=_0x51597a['id'];if(_0x371738[_0xfa01('0x5b')][_0xfa01('0x65')]){_0x24f7c6[_0xfa01('0x66')]=_[_0xfa01('0x67')](_0x24f7c6[_0xfa01('0x66')],{'$or':_[_0xfa01('0x5a')](_0x24f7c6[_0xfa01('0x5e')],function(_0x35d02b){var _0x942791={};_0x942791[_0x35d02b]={'$like':'%'+_0x371738[_0xfa01('0x5b')][_0xfa01('0x65')]+'%'};return _0x942791;})});}_0x24f7c6=_[_0xfa01('0x67')]({},_0x24f7c6,_0x371738[_0xfa01('0x72')]);return db['ChatInteraction'][_0xfa01('0x23')]({'where':_0x24f7c6[_0xfa01('0x66')]})[_0xfa01('0x28')](function(_0x4159ec){_0x207879[_0xfa01('0x23')]=_0x4159ec;if(_0x371738['query']['includeAll']){_0x24f7c6['include']=[{'model':db[_0xfa01('0x9e')],'as':_0xfa01('0xfa'),'required':![]},{'model':db[_0xfa01('0xfb')],'as':_0xfa01('0xfc'),'attributes':['name',_0xfa01('0xfd'),_0xfa01('0xfe')],'required':![]},{'model':db[_0xfa01('0xff')],'as':'Tags','attributes':['id',_0xfa01('0x2e'),_0xfa01('0x100')],'where':_0x371738[_0xfa01('0x5b')][_0xfa01('0x101')]?{'id':_0x371738[_0xfa01('0x5b')]['tag']}:undefined,'required':_0x371738[_0xfa01('0x5b')][_0xfa01('0x101')]?!![]:![]}];}return db[_0xfa01('0xbd')][_0xfa01('0x6b')](_0x24f7c6);})[_0xfa01('0x28')](function(_0x5c6758){_0x207879['rows']=_0x5c6758;return _0x207879;});}})['then'](respondWithFilteredResult(_0x488ba5,_0x24f7c6))['catch'](handleError(_0x488ba5,null));};exports[_0xfa01('0x30')]=function(_0x57cccf,_0x378d27){var _0x1a699a=0x0;var _0x362a07=0x0;var _0x4cdc65=![];var _0x5d6056;var _0x1784a6;return db[_0xfa01('0x58')][_0xfa01('0x73')]({'where':{'id':_0x57cccf[_0xfa01('0x6e')]['id']},'include':[{'model':db['Interval'],'as':_0xfa01('0x3b'),'include':[{'model':db['Interval'],'as':_0xfa01('0x3c'),'attributes':['id',_0xfa01('0x33')]}]}]})[_0xfa01('0x28')](handleEntityNotFound(_0x378d27,null))['then'](function(_0x47e03d){if(_0x47e03d){_0x5d6056=_0x47e03d;return _0x47e03d[_0xfa01('0x102')]({'raw':!![]});}})[_0xfa01('0x28')](function(_0x1de5e8){if(_0x5d6056){if(_0x1de5e8){_0x1784a6=_0x1de5e8;}}return require('../../config/license/util')[_0xfa01('0x92')]();})[_0xfa01('0x28')](function(_0x555e92){if(_0x555e92){_0x362a07=_0x555e92[_0xfa01('0x103')];_0x4cdc65=_0x555e92[_0xfa01('0x104')];}})[_0xfa01('0x28')](function(){return db['ChatInteraction'][_0xfa01('0x23')]({'where':{'closed':![]}});})[_0xfa01('0x28')](function(_0x21aedf){_0x1a699a=_0x21aedf;if(_0x362a07&&_0x21aedf>_0x362a07){return db[_0xfa01('0x105')][_0xfa01('0x85')]({'where':{'id':0x1}})[_0xfa01('0x28')](function(_0x4ef094){if(_0x4ef094){_0x4ef094[_0xfa01('0x106')](_0xfa01('0x107'));}});}})[_0xfa01('0x28')](function(){if(!_0x5d6056[_0xfa01('0x3b')]||!_0x5d6056['Interval'][_0xfa01('0x3c')])return!![];return checkWebsiteIntervals(_0x5d6056);})[_0xfa01('0x28')](function(_0x2df48f){var _0x19ee75=fs[_0xfa01('0x108')](path['join'](config[_0xfa01('0x90')],_0xfa01('0x109')),_0xfa01('0xd5'));var _0x3175c6=new url[(_0xfa01('0x10a'))](_0x5d6056[_0xfa01('0x10b')])[_0xfa01('0x10c')];var _0x382667=_0xfa01('0x10d');var _0x47848c=![];var _0x3a8692={'chatVersion':_0x382667,'chatWebsiteAddressOrigin':_0x3175c6,'remote':_0x5d6056[_0xfa01('0x10e')],'query':querystring[_0xfa01('0x54')](_[_0xfa01('0x67')](_0x5d6056[_0xfa01('0x3d')]({'plain':!![]}),{'customerIp':_0x57cccf[_0xfa01('0x10f')][_0xfa01('0x46')]||_0x57cccf['headers']['x-real-ip']||_0x57cccf[_0xfa01('0x110')][_0xfa01('0x111')]||_0x57cccf['ip'],'referer':_0x57cccf[_0xfa01('0x10f')]['referer'],'openedInteractions':_0x1a699a,'maxInteractions':_0x362a07,'virtual':_0x4cdc65['virtual'],'online':_0x2df48f,'custom':_0x4cdc65}))[_0xfa01('0x112')](/'/g,'\x5c\x27')};_0x378d27['send'](ejs['render'](Mustache[_0xfa01('0xd6')](_0x19ee75,_0x3a8692),{'proactiveActions':_0x1784a6,'alignment':_0x5d6056[_0xfa01('0x113')],'verticalAlignment':_0x5d6056['verticalAlignment'],'div_color':_0x5d6056[_0xfa01('0x100')],'labelText':_0x5d6056['labelText'],'text_color':_0x5d6056[_0xfa01('0x114')],'text_button_color':_0x5d6056['textButtonColor'],'button_color':_0x5d6056['color_button'],'background_color':_0x5d6056[_0xfa01('0x115')],'hideWhenOffline':_0x5d6056[_0xfa01('0x116')],'intervalId':_0x5d6056[_0xfa01('0x117')],'isDevelopment':_0x47848c,'chatVersion':_0x382667}));})[_0xfa01('0x1e')](handleError(_0x378d27,null));};exports['addApplications']=function(_0x1aa2cc,_0x32049e){var _0x4c5f4f=_0x1aa2cc['params']['id'];var _0x525de1=_0x1aa2cc[_0xfa01('0x75')];var _0x489965=0xc8;var _0x547a47=null;return db[_0xfa01('0xe0')]['transaction']({'isolationLevel':db[_0xfa01('0xe0')][_0xfa01('0x118')][_0xfa01('0x119')][_0xfa01('0x11a')]},function(_0x2b68e5){return db[_0xfa01('0x58')][_0xfa01('0x85')]({'where':{'id':_0x4c5f4f},'transaction':_0x2b68e5})[_0xfa01('0x28')](function(_0xa95480){if(_0xa95480){return db['ChatApplication'][_0xfa01('0x29')]({'where':{'ChatWebsiteId':_0x4c5f4f},'transaction':_0x2b68e5})[_0xfa01('0x28')](function(){var _0x1dd5a5=_[_0xfa01('0x5a')](_0x525de1,function(_0x325a65){_0x325a65[_0xfa01('0x7d')]=_0x4c5f4f;return _0x325a65;});return db['ChatApplication'][_0xfa01('0xe3')](_0x1dd5a5,{'transaction':_0x2b68e5});});}else{_0x489965=0x194;_0x547a47=[];}});})['then'](function(){if(_0x489965!==0x194){return db[_0xfa01('0xaf')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x4c5f4f},'order':'priority'})['then'](function(_0x656b04){_0x547a47=_0x656b04;});}})[_0xfa01('0x1e')](function(_0x9e0f65){_0x489965=0x1f4;logger[_0xfa01('0x1a')](_0x9e0f65['stack']);if(_0x9e0f65[_0xfa01('0x2e')]){delete _0x9e0f65[_0xfa01('0x2e')];}_0x547a47=_0x9e0f65;})[_0xfa01('0x11b')](function(){if(_0x547a47===null){_0x32049e[_0xfa01('0x2c')](_0x489965);}else{if(_0x489965===0x1f4){_0x32049e[_0xfa01('0x1f')](_0x489965)[_0xfa01('0x2f')](_0x547a47);}else{_0x32049e['status'](_0x489965)[_0xfa01('0x26')](_0x547a47);}}});};exports[_0xfa01('0x11c')]=function(_0x614232,_0x2711f8){var _0x2a9129={};var _0x3ff5ef={};var _0x559e47;var _0x43afe0;return db[_0xfa01('0x58')][_0xfa01('0x85')]({'where':{'id':_0x614232[_0xfa01('0x6e')]['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0x2711f8,null))[_0xfa01('0x28')](function(_0x45649f){if(_0x45649f){_0x559e47=_0x45649f;_0x3ff5ef[_0xfa01('0x51')]=_[_0xfa01('0x6f')](db['ChatApplication']['rawAttributes']);_0x3ff5ef[_0xfa01('0x5b')]=_['keys'](_0x614232[_0xfa01('0x5b')]);_0x3ff5ef[_0xfa01('0x5c')]=_[_0xfa01('0x5d')](_0x3ff5ef[_0xfa01('0x51')],_0x3ff5ef['query']);_0x2a9129[_0xfa01('0x5e')]=_['intersection'](_0x3ff5ef['model'],qs[_0xfa01('0x71')](_0x614232[_0xfa01('0x5b')]['fields']));_0x2a9129[_0xfa01('0x5e')]=_0x2a9129[_0xfa01('0x5e')]['length']?_0x2a9129[_0xfa01('0x5e')]:_0x3ff5ef[_0xfa01('0x51')];_0x2a9129[_0xfa01('0x62')]=qs[_0xfa01('0x63')](_0x614232[_0xfa01('0x5b')][_0xfa01('0x63')]);_0x2a9129['where']=qs[_0xfa01('0x5c')](_[_0xfa01('0x64')](_0x614232[_0xfa01('0x5b')],_0x3ff5ef['filters']));if(_0x614232[_0xfa01('0x5b')]['filter']){_0x2a9129['where']=_[_0xfa01('0x67')](_0x2a9129[_0xfa01('0x66')],{'$or':_[_0xfa01('0x5a')](_0x2a9129[_0xfa01('0x5e')],function(_0x55b027){var _0x4a2982={};_0x4a2982[_0x55b027]={'$like':'%'+_0x614232[_0xfa01('0x5b')]['filter']+'%'};return _0x4a2982;})});}_0x2a9129=_[_0xfa01('0x67')]({},_0x2a9129,_0x614232['options']);return _0x559e47['getApplications'](_0x2a9129);}})['then'](function(_0x313137){if(_0x313137){_0x43afe0=_0x313137[_0xfa01('0x5f')];if(!_0x614232[_0xfa01('0x5b')][_0xfa01('0x60')](_0xfa01('0x61'))){_0x2a9129['limit']=qs['limit'](_0x614232[_0xfa01('0x5b')][_0xfa01('0x22')]);_0x2a9129[_0xfa01('0x20')]=qs[_0xfa01('0x20')](_0x614232[_0xfa01('0x5b')][_0xfa01('0x20')]);}return _0x559e47[_0xfa01('0x11c')](_0x2a9129);}})[_0xfa01('0x28')](function(_0x94dbef){if(_0x94dbef){return _0x94dbef?{'count':_0x43afe0,'rows':_0x94dbef}:null;}})['then'](respondWithResult(_0x2711f8,null))[_0xfa01('0x1e')](handleError(_0x2711f8,null));};exports[_0xfa01('0x11d')]=function(_0x232d61,_0x4a6932){return db[_0xfa01('0x11e')][_0xfa01('0x73')]({'where':{'id':_0x232d61[_0xfa01('0x6e')]['id']}})['then'](handleEntityNotFound(_0x4a6932,null))[_0xfa01('0x28')](function(_0x136e0d){if(_0x136e0d){return _0x136e0d[_0xfa01('0x11d')](_0x232d61[_0xfa01('0x75')][_0xfa01('0x81')],_[_0xfa01('0x11f')](_0x232d61[_0xfa01('0x75')],[_0xfa01('0x81'),'id'])||{});}})[_0xfa01('0x28')](respondWithResult(_0x4a6932,null))[_0xfa01('0x1e')](handleError(_0x4a6932,null));};exports[_0xfa01('0x102')]=function(_0x30af47,_0x40b5e2){var _0x5bc14d={};var _0x54100a={};var _0x44739d;var _0x22b34e;return db[_0xfa01('0x58')]['findOne']({'where':{'id':_0x30af47[_0xfa01('0x6e')]['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0x40b5e2,null))[_0xfa01('0x28')](function(_0xa63c6a){if(_0xa63c6a){_0x44739d=_0xa63c6a;_0x54100a[_0xfa01('0x51')]=_[_0xfa01('0x6f')](db[_0xfa01('0x120')][_0xfa01('0x70')]);_0x54100a[_0xfa01('0x5b')]=_[_0xfa01('0x6f')](_0x30af47[_0xfa01('0x5b')]);_0x54100a['filters']=_[_0xfa01('0x5d')](_0x54100a[_0xfa01('0x51')],_0x54100a[_0xfa01('0x5b')]);_0x5bc14d[_0xfa01('0x5e')]=_[_0xfa01('0x5d')](_0x54100a['model'],qs[_0xfa01('0x71')](_0x30af47[_0xfa01('0x5b')][_0xfa01('0x71')]));_0x5bc14d['attributes']=_0x5bc14d['attributes'][_0xfa01('0x5f')]?_0x5bc14d[_0xfa01('0x5e')]:_0x54100a[_0xfa01('0x51')];_0x5bc14d[_0xfa01('0x62')]=qs['sort'](_0x30af47[_0xfa01('0x5b')]['sort']);_0x5bc14d[_0xfa01('0x66')]=qs['filters'](_[_0xfa01('0x64')](_0x30af47[_0xfa01('0x5b')],_0x54100a[_0xfa01('0x5c')]));if(_0x30af47[_0xfa01('0x5b')][_0xfa01('0x65')]){_0x5bc14d[_0xfa01('0x66')]=_[_0xfa01('0x67')](_0x5bc14d[_0xfa01('0x66')],{'$or':_['map'](_0x5bc14d[_0xfa01('0x5e')],function(_0x51b17a){var _0x21fca7={};_0x21fca7[_0x51b17a]={'$like':'%'+_0x30af47[_0xfa01('0x5b')][_0xfa01('0x65')]+'%'};return _0x21fca7;})});}_0x5bc14d=_['merge']({},_0x5bc14d,_0x30af47['options']);return _0x44739d['getProactiveActions'](_0x5bc14d);}})[_0xfa01('0x28')](function(_0x3bcb62){if(_0x3bcb62){_0x22b34e=_0x3bcb62[_0xfa01('0x5f')];if(!_0x30af47[_0xfa01('0x5b')]['hasOwnProperty'](_0xfa01('0x61'))){_0x5bc14d[_0xfa01('0x22')]=qs['limit'](_0x30af47[_0xfa01('0x5b')][_0xfa01('0x22')]);_0x5bc14d[_0xfa01('0x20')]=qs[_0xfa01('0x20')](_0x30af47[_0xfa01('0x5b')][_0xfa01('0x20')]);}return _0x44739d['getProactiveActions'](_0x5bc14d);}})[_0xfa01('0x28')](function(_0x4ef0fe){if(_0x4ef0fe){return _0x4ef0fe?{'count':_0x22b34e,'rows':_0x4ef0fe}:null;}})[_0xfa01('0x28')](respondWithResult(_0x40b5e2,null))[_0xfa01('0x1e')](handleError(_0x40b5e2,null));};exports[_0xfa01('0x121')]=function(_0x5a0e95,_0xe11493){var _0x2bb41a=_0x5a0e95['query']['online']===_0xfa01('0x122')?_0xfa01('0x123'):'onlineForm';return db[_0xfa01('0x58')][_0xfa01('0x73')]({'attributes':['id',_0x2bb41a],'where':{'id':_0x5a0e95['params']['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0xe11493,null))['then'](function(_0x4ebba2){if(_0x4ebba2){var _0x33c070=_0x4ebba2[_0x2bb41a];var _0x306140=_0x33c070&&_0x33c070[_0xfa01('0x124')]?_0x33c070['items']:[];_0xe11493[_0xfa01('0x2f')]({'fromKey':_['isNil'](_0x33c070['fromKey'])?undefined:_0x33c070[_0xfa01('0x125')],'count':_0x306140[_0xfa01('0x5f')],'rows':_0x306140});}})[_0xfa01('0x1e')](handleError(_0xe11493,null));};exports['getOfflineMessages']=function(_0xfd0a2d,_0x5c63e9){var _0xd0bc83={'raw':![],'where':{}};var _0x347e4f={};var _0x3a175c={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xfa01('0x85')]({'where':{'id':_0xfd0a2d[_0xfa01('0x6e')]['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0x5c63e9,null))[_0xfa01('0x28')](function(_0x183493){if(_0x183493){_0x347e4f[_0xfa01('0x51')]=_[_0xfa01('0x6f')](db[_0xfa01('0xd9')][_0xfa01('0x70')]);_0x347e4f[_0xfa01('0x5b')]=_[_0xfa01('0x6f')](_0xfd0a2d[_0xfa01('0x5b')]);_0x347e4f[_0xfa01('0x5c')]=_[_0xfa01('0x5d')](_0x347e4f[_0xfa01('0x51')],_0x347e4f[_0xfa01('0x5b')]);_0xd0bc83[_0xfa01('0x5e')]=_['intersection'](_0x347e4f['model'],qs['fields'](_0xfd0a2d[_0xfa01('0x5b')][_0xfa01('0x71')]));_0xd0bc83[_0xfa01('0x5e')]=_0xd0bc83[_0xfa01('0x5e')][_0xfa01('0x5f')]?_0xd0bc83[_0xfa01('0x5e')]:_0x347e4f[_0xfa01('0x51')];if(!_0xfd0a2d[_0xfa01('0x5b')]['hasOwnProperty']('nolimit')){_0xd0bc83['limit']=qs[_0xfa01('0x22')](_0xfd0a2d[_0xfa01('0x5b')][_0xfa01('0x22')]);_0xd0bc83['offset']=qs[_0xfa01('0x20')](_0xfd0a2d[_0xfa01('0x5b')]['offset']);}_0xd0bc83[_0xfa01('0x62')]=qs[_0xfa01('0x63')](_0xfd0a2d[_0xfa01('0x5b')]['sort']);_0xd0bc83[_0xfa01('0x66')]=qs[_0xfa01('0x5c')](_[_0xfa01('0x64')](_0xfd0a2d[_0xfa01('0x5b')],_0x347e4f[_0xfa01('0x5c')]));_0xd0bc83[_0xfa01('0x66')][_0xfa01('0x7d')]=_0x183493['id'];if(_0xfd0a2d[_0xfa01('0x5b')]['filter']){_0xd0bc83['where']=_[_0xfa01('0x67')](_0xd0bc83[_0xfa01('0x66')],{'$or':_[_0xfa01('0x5a')](_0xd0bc83[_0xfa01('0x5e')],function(_0x1d970d){var _0x373207={};_0x373207[_0x1d970d]={'$like':'%'+_0xfd0a2d[_0xfa01('0x5b')][_0xfa01('0x65')]+'%'};return _0x373207;})});}_0xd0bc83=_['merge']({},_0xd0bc83,_0xfd0a2d[_0xfa01('0x72')]);return db[_0xfa01('0xd9')][_0xfa01('0x23')]({'where':_0xd0bc83['where']})[_0xfa01('0x28')](function(_0x417afe){_0x3a175c[_0xfa01('0x23')]=_0x417afe;if(_0xfd0a2d[_0xfa01('0x5b')]['includeAll']){_0xd0bc83[_0xfa01('0x6a')]=[{'all':!![]}];}else{_0xd0bc83[_0xfa01('0x6a')]=[{'model':db[_0xfa01('0x9e')],'as':_0xfa01('0xfa'),'required':![]},{'model':db[_0xfa01('0xe2')],'as':'Attachments','required':![]}];}return db[_0xfa01('0xd9')][_0xfa01('0x6b')](_0xd0bc83);})[_0xfa01('0x28')](function(_0x5a3019){_0x3a175c[_0xfa01('0x6c')]=_0x5a3019;return _0x3a175c;});}})[_0xfa01('0x28')](respondWithFilteredResult(_0x5c63e9,_0xd0bc83))[_0xfa01('0x1e')](handleError(_0x5c63e9,null));};exports['addAgents']=function(_0x3fdd58,_0x39f070){return db[_0xfa01('0x58')][_0xfa01('0x73')]({'where':{'id':_0x3fdd58['params']['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0x39f070,null))[_0xfa01('0x28')](function(_0x22be42){if(_0x22be42){return _0x22be42[_0xfa01('0x126')](_0x3fdd58['body'][_0xfa01('0x81')],_[_0xfa01('0x11f')](_0x3fdd58['body'],[_0xfa01('0x81'),'id'])||{})[_0xfa01('0xb2')](function(_0xee3953){for(var _0x20d7d1=0x0;_0x20d7d1<_0x3fdd58['body'][_0xfa01('0x81')][_0xfa01('0x5f')];_0x20d7d1+=0x1){socket[_0xfa01('0x127')](_0xfa01('0x128'),{'UserId':Number(_0x3fdd58['body'][_0xfa01('0x81')][_0x20d7d1]),'ChatWebsiteId':Number(_0x3fdd58[_0xfa01('0x6e')]['id'])});}return _0xee3953;});}})[_0xfa01('0x28')](respondWithResult(_0x39f070,null))['catch'](handleError(_0x39f070,null));};exports[_0xfa01('0x129')]=function(_0x19a977,_0x4df93d){return db[_0xfa01('0x58')][_0xfa01('0x73')]({'where':{'id':_0x19a977['params']['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0x4df93d,null))[_0xfa01('0x28')](function(_0x5649dc){if(_0x5649dc){return _0x5649dc[_0xfa01('0x129')](_0x19a977[_0xfa01('0x5b')][_0xfa01('0x81')])[_0xfa01('0x28')](function(){if(_[_0xfa01('0x12a')](_0x19a977[_0xfa01('0x5b')][_0xfa01('0x81')])){for(var _0x344ef3=0x0;_0x344ef3<_0x19a977['query'][_0xfa01('0x81')][_0xfa01('0x5f')];_0x344ef3+=0x1){socket['emit'](_0xfa01('0x12b'),{'UserId':Number(_0x19a977[_0xfa01('0x5b')][_0xfa01('0x81')][_0x344ef3]),'ChatWebsiteId':Number(_0x19a977[_0xfa01('0x6e')]['id'])});}}else{socket[_0xfa01('0x127')]('userChatWebsite:remove',{'UserId':Number(_0x19a977[_0xfa01('0x5b')][_0xfa01('0x81')]),'ChatWebsiteId':Number(_0x19a977[_0xfa01('0x6e')]['id'])});}});}})[_0xfa01('0x28')](respondWithStatusCode(_0x4df93d,null))['catch'](handleError(_0x4df93d,null));};exports[_0xfa01('0x12c')]=function(_0x2f55b7,_0x3ab7e9){var _0x454b24={};var _0x1b55d6={};var _0x1ad7b5;var _0x5a95a1;return db[_0xfa01('0x58')][_0xfa01('0x85')]({'where':{'id':_0x2f55b7[_0xfa01('0x6e')]['id']}})[_0xfa01('0x28')](handleEntityNotFound(_0x3ab7e9,null))[_0xfa01('0x28')](function(_0x4ebd8a){if(_0x4ebd8a){_0x1ad7b5=_0x4ebd8a;_0x1b55d6[_0xfa01('0x51')]=_[_0xfa01('0x6f')](db[_0xfa01('0xfb')][_0xfa01('0x70')]);_0x1b55d6[_0xfa01('0x5b')]=_[_0xfa01('0x6f')](_0x2f55b7[_0xfa01('0x5b')]);_0x1b55d6[_0xfa01('0x5c')]=_['intersection'](_0x1b55d6[_0xfa01('0x51')],_0x1b55d6[_0xfa01('0x5b')]);_0x454b24[_0xfa01('0x5e')]=_['intersection'](_0x1b55d6['model'],qs[_0xfa01('0x71')](_0x2f55b7[_0xfa01('0x5b')]['fields']));_0x454b24['attributes']=_0x454b24[_0xfa01('0x5e')][_0xfa01('0x5f')]?_0x454b24['attributes']:_0x1b55d6['model'];_0x454b24['order']=qs['sort'](_0x2f55b7[_0xfa01('0x5b')][_0xfa01('0x63')]);_0x454b24['where']=qs[_0xfa01('0x5c')](_[_0xfa01('0x64')](_0x2f55b7[_0xfa01('0x5b')],_0x1b55d6[_0xfa01('0x5c')]));if(_0x2f55b7['query'][_0xfa01('0x65')]){_0x454b24[_0xfa01('0x66')]=_[_0xfa01('0x67')](_0x454b24[_0xfa01('0x66')],{'$or':_['map'](_0x454b24['attributes'],function(_0x4496bc){var _0x5e9419={};_0x5e9419[_0x4496bc]={'$like':'%'+_0x2f55b7['query'][_0xfa01('0x65')]+'%'};return _0x5e9419;})});}_0x454b24=_[_0xfa01('0x67')]({},_0x454b24,_0x2f55b7[_0xfa01('0x72')]);return _0x1ad7b5[_0xfa01('0x12c')](_0x454b24);}})['then'](function(_0x39343c){if(_0x39343c){_0x5a95a1=_0x39343c[_0xfa01('0x5f')];if(!_0x2f55b7[_0xfa01('0x5b')][_0xfa01('0x60')](_0xfa01('0x61'))){_0x454b24['limit']=qs[_0xfa01('0x22')](_0x2f55b7[_0xfa01('0x5b')][_0xfa01('0x22')]);_0x454b24[_0xfa01('0x20')]=qs['offset'](_0x2f55b7[_0xfa01('0x5b')][_0xfa01('0x20')]);}return _0x1ad7b5[_0xfa01('0x12c')](_0x454b24);}})[_0xfa01('0x28')](function(_0x2a7abe){if(_0x2a7abe){return _0x2a7abe?{'count':_0x5a95a1,'rows':_0x2a7abe}:null;}})['then'](respondWithResult(_0x3ab7e9,null))[_0xfa01('0x1e')](handleError(_0x3ab7e9,null));}; \ No newline at end of file +var _0x2cd1=['addLogo','sitepic','file','filename','addCustomerAvatar','systemAvatar','getLogo','join','getLicense','isNil','server/files/images/logos/','download','root','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','DESC','ChatApplication','Applications','spread','account','list','applications','Contacts','contact','headers','threadId','ChatInteraction','externalUrl','interaction','messageId','created','autoclose','push','close','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','ChatQueue','queueId','unshift','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','ChatOfflineMessage','fromString','originalname','server','attachments','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','offline-chat','addInteraction','ids','omit','getInteractions','Contact','Owner','fullname','Tags','color','tag','custom','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','URL','address','3.5.0','remote','x-real-ip','connection','remoteAddress','virtual','replace','render','alignment','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','lodash','querystring','html-to-text','url','api','../../config/environment','../../errors/api','handleError','redis','defaults','localhost','socket.io-emitter','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','ChatWebsites','UserProfileResource','sendStatus','name','send','Command','getSnippet','format','timezone','iftime\x20%s','interval','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','map','Interval','Intervals','get','all','user-agent-parser','setUA','user-agent','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','version','%s\x20%s','unknown','browser','device','%s\x20%s\x20%s','model','vendor','type','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','update','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','options'];(function(_0xaeb431,_0x248d88){var _0x2aea8a=function(_0x2caf18){while(--_0x2caf18){_0xaeb431['push'](_0xaeb431['shift']());}};_0x2aea8a(++_0x248d88);}(_0x2cd1,0x1d5));var _0x12cd=function(_0x3edaf9,_0x940c3d){_0x3edaf9=_0x3edaf9-0x0;var _0x2dc4b8=_0x2cd1[_0x3edaf9];return _0x2dc4b8;};'use strict';var Mustache=require(_0x12cd('0x0'));var util=require(_0x12cd('0x1'));var path=require(_0x12cd('0x2'));var ejs=require(_0x12cd('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12cd('0x4'));var querystring=require(_0x12cd('0x5'));var htmlToText=require(_0x12cd('0x6'));var Redis=require('ioredis');var jayson=require('jayson/promise');var url=require(_0x12cd('0x7'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x12cd('0x8'));var config=require(_0x12cd('0x9'));var APIOutOfIntervalError=require(_0x12cd('0xa'))['APIOutOfIntervalError'];var APINotFoundError=require(_0x12cd('0xa'))['APINotFoundError'];var APIHandleError=require(_0x12cd('0xa'))[_0x12cd('0xb')];var db=require('../../mysqldb')['db'];config[_0x12cd('0xc')]=_[_0x12cd('0xd')](config['redis'],{'host':_0x12cd('0xe'),'port':0x18eb});var socket=require(_0x12cd('0xf'))(new Redis(config[_0x12cd('0xc')]));require('./chatWebsite.socket')['register'](socket);var client=jayson[_0x12cd('0x10')][_0x12cd('0x11')]({'port':0x232c});var client9002=jayson[_0x12cd('0x10')][_0x12cd('0x11')]({'port':0x232a});var client9003=jayson[_0x12cd('0x10')]['http']({'port':0x232b});var client9001=jayson[_0x12cd('0x10')]['http']({'port':0x2329});function respondWithRpcPromise(_0x52e095,_0x4fb183,_0x281292,_0x17fe3d){return new Promise(function(_0x3c8d00,_0x20e83e){var _0xf155f6=_0x17fe3d||client;return _0xf155f6[_0x12cd('0x12')](_0x52e095,_0x281292)[_0x12cd('0x13')](function(_0x22b69e){logger[_0x12cd('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x4fb183,_0x12cd('0x15'));logger[_0x12cd('0x16')](_0x12cd('0x17'),_0x4fb183,'request\x20sent',JSON[_0x12cd('0x18')](_0x22b69e));if(_0x22b69e[_0x12cd('0x19')]){if(_0x22b69e['error'][_0x12cd('0x1a')]===0x1f4){logger[_0x12cd('0x19')](_0x12cd('0x1b'),_0x4fb183,_0x22b69e[_0x12cd('0x19')]['message']);return _0x20e83e(_0x22b69e['error'][_0x12cd('0x1c')]);}logger[_0x12cd('0x19')](_0x12cd('0x1b'),_0x4fb183,_0x22b69e['error'][_0x12cd('0x1c')]);return _0x3c8d00(_0x22b69e[_0x12cd('0x19')]['message']);}else{logger[_0x12cd('0x14')](_0x12cd('0x1b'),_0x4fb183,_0x12cd('0x15'));_0x3c8d00(_0x22b69e[_0x12cd('0x1d')][_0x12cd('0x1c')]);}})[_0x12cd('0x1e')](function(_0x3b136e){logger['error'](_0x12cd('0x1b'),_0x4fb183,_0x3b136e);_0x20e83e(_0x3b136e);});});}function respondWithStatusCode(_0x423234,_0x4cd3cd){_0x4cd3cd=_0x4cd3cd||0xcc;return function(_0x19dd3b){if(_0x19dd3b){return _0x423234['sendStatus'](_0x4cd3cd);}return _0x423234[_0x12cd('0x1f')](_0x4cd3cd)[_0x12cd('0x20')]();};}function respondWithResult(_0xbf1a94,_0x14b0ba){_0x14b0ba=_0x14b0ba||0xc8;return function(_0x4d4f5e){if(_0x4d4f5e){return _0xbf1a94[_0x12cd('0x1f')](_0x14b0ba)[_0x12cd('0x21')](_0x4d4f5e);}};}function respondWithFilteredResult(_0x3c4c82,_0x4412cf){return function(_0x1cb388){if(_0x1cb388){var _0xf42fee=typeof _0x4412cf[_0x12cd('0x22')]===_0x12cd('0x23')&&typeof _0x4412cf[_0x12cd('0x24')]==='undefined';var _0xa80225=_0x1cb388['count'];var _0x5dcc06=_0xf42fee?0x0:_0x4412cf[_0x12cd('0x22')];var _0x3e4a58=_0xf42fee?_0x1cb388[_0x12cd('0x25')]:_0x4412cf['offset']+_0x4412cf[_0x12cd('0x24')];var _0x27a9a3;if(_0x3e4a58>=_0xa80225){_0x3e4a58=_0xa80225;_0x27a9a3=0xc8;}else{_0x27a9a3=0xce;}_0x3c4c82[_0x12cd('0x1f')](_0x27a9a3);return _0x3c4c82[_0x12cd('0x26')](_0x12cd('0x27'),_0x5dcc06+'-'+_0x3e4a58+'/'+_0xa80225)[_0x12cd('0x21')](_0x1cb388);}return null;};}function saveUpdates(_0x4857dc){return function(_0x258b46){if(_0x258b46){return _0x258b46['update'](_0x4857dc)[_0x12cd('0x13')](function(_0xfa6e7b){return _0xfa6e7b;});}return null;};}function removeEntity(_0x432d22){return function(_0x274c60){if(_0x274c60){return _0x274c60[_0x12cd('0x28')]()[_0x12cd('0x13')](function(){var _0x386d3e=_0x274c60['get']({'plain':!![]});var _0x201940=_0x12cd('0x29');return db[_0x12cd('0x2a')][_0x12cd('0x28')]({'where':{'type':_0x201940,'resourceId':_0x386d3e['id']}})[_0x12cd('0x13')](function(){return _0x274c60;});})[_0x12cd('0x13')](function(){_0x432d22[_0x12cd('0x1f')](0xcc)[_0x12cd('0x20')]();});}};}function handleEntityNotFound(_0x4189ca){return function(_0x1a6d09){if(!_0x1a6d09){_0x4189ca[_0x12cd('0x2b')](0x194);}return _0x1a6d09;};}function handleError(_0x17ca6e,_0x4fe049){_0x4fe049=_0x4fe049||0x1f4;return function(_0x314f34){logger[_0x12cd('0x19')](_0x314f34['stack']);if(_0x314f34[_0x12cd('0x2c')]){delete _0x314f34[_0x12cd('0x2c')];}_0x17ca6e[_0x12cd('0x1f')](_0x4fe049)[_0x12cd('0x2d')](_0x314f34);};}function iftimePromise(_0x4a6984,_0x423a86){return respondWithRpcPromise(_0x12cd('0x2e'),_0x12cd('0x2f'),{'command':_0x423a86['timezone']?util[_0x12cd('0x30')]('iftime\x20%s,%s',_0x4a6984['interval'],_0x423a86[_0x12cd('0x31')]):util['format'](_0x12cd('0x32'),_0x4a6984[_0x12cd('0x33')])},client9002)['then'](function(_0x3a424e){var _0x105c2c=_0x3a424e&&_0x3a424e['indexOf']('true')>=0x0?!![]:![];logger[_0x12cd('0x14')](_0x12cd('0x34'),_0x423a86['id'],_0x4a6984['id'],_0x4a6984[_0x12cd('0x33')],_0x105c2c?_0x12cd('0x35'):_0x12cd('0x36'),_0x423a86[_0x12cd('0x31')]?_0x423a86[_0x12cd('0x31')]:'No\x20timezone');return _0x105c2c;})[_0x12cd('0x1e')](function(_0x242853){logger[_0x12cd('0x19')](_0x12cd('0x34'),_0x423a86['id'],_0x4a6984['id'],_0x4a6984['interval'],util['inspect'](_0x242853,{'showHidden':![],'depth':null}),_0x423a86[_0x12cd('0x31')]?_0x423a86['timezone']:_0x12cd('0x37'));return![];});}function checkWebsiteIntervals(_0x25fc35){var _0x3d54ed=_[_0x12cd('0x38')](_0x25fc35[_0x12cd('0x39')][_0x12cd('0x3a')],function(_0x39697a){var _0x21a6e0=_0x39697a[_0x12cd('0x3b')]({'plain':!![]});return iftimePromise(_0x21a6e0,_0x25fc35);});return Promise[_0x12cd('0x3c')](_0x3d54ed)['then'](function(_0x68ed4e){return _['some'](_0x68ed4e);});}function createInteractionObject(_0x4c9789,_0x28a673,_0x38020d,_0x5ebe5a){var _0x597ef0=require(_0x12cd('0x3d'));var _0x4a31ee=new _0x597ef0();var _0x144d4f=_0x4a31ee[_0x12cd('0x3e')](_0x38020d[_0x12cd('0x3f')])['getResult']();var _0x3a65f1=_0x28a673[_0x12cd('0x40')];if(_0x38020d[_0x12cd('0x41')]){_0x3a65f1=_0x38020d[_0x12cd('0x41')];}else if(_0x38020d[_0x12cd('0x42')]){_0x3a65f1=_['first'](_0x38020d['x-forwarded-for'][_0x12cd('0x43')](','));}return{'ContactId':_0x5ebe5a['id'],'ChatWebsiteId':_0x4c9789,'from':(_0x5ebe5a[_0x12cd('0x44')]||'')+'\x20'+(_0x5ebe5a[_0x12cd('0x45')]||''),'customerIp':_0x3a65f1,'customerPort':_0x38020d[_0x12cd('0x46')]?_0x38020d[_0x12cd('0x46')]:null,'referer':_0x28a673[_0x12cd('0x47')],'browserName':_0x144d4f['browser']['name']&&_0x144d4f['browser'][_0x12cd('0x48')]?util[_0x12cd('0x30')](_0x12cd('0x49'),_0x144d4f['browser']['name'],_0x144d4f['browser'][_0x12cd('0x48')]):_0x12cd('0x4a'),'browserVersion':_0x144d4f[_0x12cd('0x4b')][_0x12cd('0x48')]||_0x12cd('0x4a'),'osName':util[_0x12cd('0x30')](_0x12cd('0x49'),_0x144d4f['os'][_0x12cd('0x2c')],_0x144d4f['os'][_0x12cd('0x48')]),'osVersion':_0x144d4f['os']['version'],'deviceModel':_0x144d4f[_0x12cd('0x4c')]['model']&&_0x144d4f[_0x12cd('0x4c')]['vendor']?util[_0x12cd('0x30')](_0x12cd('0x4d'),_0x144d4f[_0x12cd('0x4c')][_0x12cd('0x4e')],_0x144d4f[_0x12cd('0x4c')][_0x12cd('0x4f')],_0x144d4f[_0x12cd('0x4c')][_0x12cd('0x50')]):null,'deviceVendor':_0x144d4f['device'][_0x12cd('0x4f')],'deviceType':_0x144d4f[_0x12cd('0x4c')][_0x12cd('0x50')],'formData':JSON['stringify'](_0x28a673)};}exports[_0x12cd('0x51')]=function(_0x5b8fdd,_0x10d5dd){var _0x36063b={'include':[{'model':db['Pause'],'as':_0x12cd('0x52')}]},_0x5f0047={},_0x438515={'count':0x0,'rows':[]};var _0x2e7bcc=_['map'](db[_0x12cd('0x53')][_0x12cd('0x54')],function(_0x520e7a){return{'name':_0x520e7a[_0x12cd('0x55')],'type':_0x520e7a[_0x12cd('0x50')][_0x12cd('0x56')]};});_0x5f0047['model']=_[_0x12cd('0x38')](_0x2e7bcc,_0x12cd('0x2c'));_0x5f0047[_0x12cd('0x57')]=_[_0x12cd('0x58')](_0x5b8fdd[_0x12cd('0x57')]);_0x5f0047[_0x12cd('0x59')]=_[_0x12cd('0x5a')](_0x5f0047[_0x12cd('0x4e')],_0x5f0047['query']);_0x36063b[_0x12cd('0x5b')]=_[_0x12cd('0x5a')](_0x5f0047[_0x12cd('0x4e')],qs['fields'](_0x5b8fdd[_0x12cd('0x57')][_0x12cd('0x5c')]));_0x36063b['attributes']=_0x36063b['attributes'][_0x12cd('0x5d')]?_0x36063b['attributes']:_0x5f0047[_0x12cd('0x4e')];if(!_0x5b8fdd[_0x12cd('0x57')][_0x12cd('0x5e')](_0x12cd('0x5f'))){_0x36063b[_0x12cd('0x24')]=qs[_0x12cd('0x24')](_0x5b8fdd[_0x12cd('0x57')][_0x12cd('0x24')]);_0x36063b[_0x12cd('0x22')]=qs[_0x12cd('0x22')](_0x5b8fdd[_0x12cd('0x57')][_0x12cd('0x22')]);}_0x36063b[_0x12cd('0x60')]=qs[_0x12cd('0x61')](_0x5b8fdd[_0x12cd('0x57')]['sort']);_0x36063b['where']=qs[_0x12cd('0x59')](_[_0x12cd('0x62')](_0x5b8fdd[_0x12cd('0x57')],_0x5f0047[_0x12cd('0x59')]),_0x2e7bcc);if(_0x5b8fdd[_0x12cd('0x57')]['filter']){_0x36063b[_0x12cd('0x63')]=_[_0x12cd('0x64')](_0x36063b[_0x12cd('0x63')],{'$or':_['map'](_0x2e7bcc,function(_0x2d5af2){if(_0x2d5af2[_0x12cd('0x50')]!==_0x12cd('0x65')){var _0x2059e2={};_0x2059e2[_0x2d5af2[_0x12cd('0x2c')]]={'$like':'%'+_0x5b8fdd[_0x12cd('0x57')][_0x12cd('0x66')]+'%'};return _0x2059e2;}})});}_0x36063b=_[_0x12cd('0x64')]({},_0x36063b,_0x5b8fdd['options']);var _0x2ed0fa={'where':_0x36063b[_0x12cd('0x63')]};return db[_0x12cd('0x53')]['count'](_0x2ed0fa)['then'](function(_0x51da24){_0x438515[_0x12cd('0x25')]=_0x51da24;if(_0x5b8fdd[_0x12cd('0x57')][_0x12cd('0x67')]){_0x36063b[_0x12cd('0x68')]=[{'all':!![]}];}return db[_0x12cd('0x53')][_0x12cd('0x69')](_0x36063b);})[_0x12cd('0x13')](function(_0x2e611f){_0x438515[_0x12cd('0x6a')]=_0x2e611f;return _0x438515;})[_0x12cd('0x13')](respondWithFilteredResult(_0x10d5dd,_0x36063b))[_0x12cd('0x1e')](handleError(_0x10d5dd,null));};exports[_0x12cd('0x6b')]=function(_0x3dd292,_0x15e4ed){var _0x4f4e83={'raw':![],'where':{'id':_0x3dd292[_0x12cd('0x6c')]['id']},'include':[{'model':db[_0x12cd('0x6d')],'as':_0x12cd('0x52')}]},_0x1f99ec={};_0x1f99ec['model']=_[_0x12cd('0x58')](db[_0x12cd('0x53')][_0x12cd('0x54')]);_0x1f99ec[_0x12cd('0x57')]=_[_0x12cd('0x58')](_0x3dd292['query']);_0x1f99ec[_0x12cd('0x59')]=_['intersection'](_0x1f99ec['model'],_0x1f99ec[_0x12cd('0x57')]);_0x4f4e83[_0x12cd('0x5b')]=_['intersection'](_0x1f99ec['model'],qs[_0x12cd('0x5c')](_0x3dd292[_0x12cd('0x57')][_0x12cd('0x5c')]));_0x4f4e83[_0x12cd('0x5b')]=_0x4f4e83[_0x12cd('0x5b')]['length']?_0x4f4e83[_0x12cd('0x5b')]:_0x1f99ec[_0x12cd('0x4e')];if(_0x3dd292['query'][_0x12cd('0x67')]){_0x4f4e83[_0x12cd('0x68')]=[{'all':!![]}];}_0x4f4e83=_[_0x12cd('0x64')]({},_0x4f4e83,_0x3dd292['options']);return db[_0x12cd('0x53')][_0x12cd('0x6e')](_0x4f4e83)[_0x12cd('0x13')](handleEntityNotFound(_0x15e4ed,null))[_0x12cd('0x13')](respondWithResult(_0x15e4ed,null))[_0x12cd('0x1e')](handleError(_0x15e4ed,null));};exports[_0x12cd('0x6f')]=function(_0x1bd3d9,_0x3b5fba){return db[_0x12cd('0x53')]['create'](_0x1bd3d9[_0x12cd('0x70')],{})[_0x12cd('0x13')](function(_0x525a6a){var _0x3732f0=_0x1bd3d9[_0x12cd('0x71')][_0x12cd('0x3b')]({'plain':!![]});if(!_0x3732f0)throw new Error(_0x12cd('0x72'));if(_0x3732f0['role']==='user'){var _0x2f4f66=_0x525a6a['get']({'plain':!![]});var _0x540fb3=_0x12cd('0x29');return db['UserProfileSection'][_0x12cd('0x6e')]({'where':{'name':_0x540fb3,'userProfileId':_0x3732f0[_0x12cd('0x73')]},'raw':!![]})[_0x12cd('0x13')](function(_0x52d112){if(_0x52d112&&_0x52d112[_0x12cd('0x74')]===0x0){return db[_0x12cd('0x2a')][_0x12cd('0x6f')]({'name':_0x2f4f66[_0x12cd('0x2c')],'resourceId':_0x2f4f66['id'],'type':_0x52d112[_0x12cd('0x2c')],'sectionId':_0x52d112['id']},{})[_0x12cd('0x13')](function(){return _0x525a6a;});}else{return _0x525a6a;}})[_0x12cd('0x1e')](function(_0x57c389){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57c389);throw _0x57c389;});}return _0x525a6a;})[_0x12cd('0x13')](respondWithResult(_0x3b5fba,0xc9))[_0x12cd('0x1e')](handleError(_0x3b5fba,null));};exports[_0x12cd('0x75')]=function(_0x1d545b,_0x2dc9c0){if(_0x1d545b[_0x12cd('0x70')]['id']){delete _0x1d545b[_0x12cd('0x70')]['id'];}return db[_0x12cd('0x53')][_0x12cd('0x6e')]({'where':{'id':_0x1d545b[_0x12cd('0x6c')]['id']},'include':[{'model':db[_0x12cd('0x6d')],'as':_0x12cd('0x52')}]})[_0x12cd('0x13')](handleEntityNotFound(_0x2dc9c0,null))[_0x12cd('0x13')](saveUpdates(_0x1d545b['body'],null))[_0x12cd('0x13')](respondWithResult(_0x2dc9c0,null))['catch'](handleError(_0x2dc9c0,null));};exports[_0x12cd('0x28')]=function(_0x1c6148,_0x666a4c){return db[_0x12cd('0x53')][_0x12cd('0x6e')]({'where':{'id':_0x1c6148[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x666a4c,null))[_0x12cd('0x13')](removeEntity(_0x666a4c,null))[_0x12cd('0x1e')](handleError(_0x666a4c,null));};exports['describe']=function(_0x36f014,_0x585a27){return db[_0x12cd('0x53')][_0x12cd('0x76')]()[_0x12cd('0x13')](respondWithResult(_0x585a27,null))[_0x12cd('0x1e')](handleError(_0x585a27,null));};exports[_0x12cd('0x77')]=function(_0x6a2772,_0x21f3f1){if(_0x6a2772[_0x12cd('0x70')]['id']){delete _0x6a2772['body']['id'];}return db[_0x12cd('0x53')]['find']({'where':{'id':_0x6a2772[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x21f3f1,null))[_0x12cd('0x13')](function(_0x495208){if(_0x495208){_0x6a2772[_0x12cd('0x70')][_0x12cd('0x78')]=_0x495208['id'];return db[_0x12cd('0x79')][_0x12cd('0x6f')](_0x6a2772[_0x12cd('0x70')]);}})[_0x12cd('0x13')](respondWithResult(_0x21f3f1,null))['catch'](handleError(_0x21f3f1,null));};exports[_0x12cd('0x7a')]=function(_0x1997b8,_0xb83847){var _0x36236d={'raw':![],'where':{}};var _0x533319={};var _0x1c5124={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x12cd('0x7b')]({'where':{'id':_0x1997b8[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0xb83847,null))[_0x12cd('0x13')](function(_0x38b1e8){if(_0x38b1e8){_0x533319[_0x12cd('0x4e')]=_[_0x12cd('0x58')](db[_0x12cd('0x79')][_0x12cd('0x54')]);_0x533319[_0x12cd('0x57')]=_[_0x12cd('0x58')](_0x1997b8['query']);_0x533319[_0x12cd('0x59')]=_[_0x12cd('0x5a')](_0x533319[_0x12cd('0x4e')],_0x533319['query']);_0x36236d[_0x12cd('0x5b')]=_['intersection'](_0x533319['model'],qs['fields'](_0x1997b8[_0x12cd('0x57')][_0x12cd('0x5c')]));_0x36236d[_0x12cd('0x5b')]=_0x36236d[_0x12cd('0x5b')][_0x12cd('0x5d')]?_0x36236d['attributes']:_0x533319['model'];if(!_0x1997b8[_0x12cd('0x57')][_0x12cd('0x5e')]('nolimit')){_0x36236d[_0x12cd('0x24')]=qs[_0x12cd('0x24')](_0x1997b8[_0x12cd('0x57')][_0x12cd('0x24')]);_0x36236d[_0x12cd('0x22')]=qs[_0x12cd('0x22')](_0x1997b8[_0x12cd('0x57')][_0x12cd('0x22')]);}_0x36236d['order']=qs['sort'](_0x1997b8[_0x12cd('0x57')][_0x12cd('0x61')]);_0x36236d[_0x12cd('0x63')]=qs['filters'](_[_0x12cd('0x62')](_0x1997b8[_0x12cd('0x57')],_0x533319[_0x12cd('0x59')]));_0x36236d[_0x12cd('0x63')][_0x12cd('0x78')]=_0x38b1e8['id'];if(_0x1997b8[_0x12cd('0x57')][_0x12cd('0x66')]){_0x36236d[_0x12cd('0x63')]=_[_0x12cd('0x64')](_0x36236d['where'],{'$or':_[_0x12cd('0x38')](_0x36236d['attributes'],function(_0x27987e){var _0x39ce3f={};_0x39ce3f[_0x27987e]={'$like':'%'+_0x1997b8[_0x12cd('0x57')][_0x12cd('0x66')]+'%'};return _0x39ce3f;})});}_0x36236d=_['merge']({},_0x36236d,_0x1997b8['options']);return db['Disposition'][_0x12cd('0x25')]({'where':_0x36236d[_0x12cd('0x63')]})[_0x12cd('0x13')](function(_0x472e30){_0x1c5124[_0x12cd('0x25')]=_0x472e30;if(_0x1997b8[_0x12cd('0x57')][_0x12cd('0x67')]){_0x36236d[_0x12cd('0x68')]=[{'all':!![]}];}return db[_0x12cd('0x79')]['findAll'](_0x36236d);})[_0x12cd('0x13')](function(_0x2306db){_0x1c5124[_0x12cd('0x6a')]=_0x2306db;return _0x1c5124;});}})['then'](respondWithFilteredResult(_0xb83847,_0x36236d))['catch'](handleError(_0xb83847,null));};exports['removeDispositions']=function(_0x3cfec7,_0x3ee441){return db[_0x12cd('0x53')]['find']({'where':{'id':_0x3cfec7[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x3ee441,null))[_0x12cd('0x13')](function(_0xc5fc6f){if(_0xc5fc6f){return _0xc5fc6f[_0x12cd('0x7c')](_0x3cfec7[_0x12cd('0x57')]['ids']);}})[_0x12cd('0x13')](respondWithStatusCode(_0x3ee441,null))[_0x12cd('0x1e')](handleError(_0x3ee441,null));};exports[_0x12cd('0x7d')]=function(_0x455d5d,_0x275cb9){if(_0x455d5d[_0x12cd('0x70')]['id']){delete _0x455d5d['body']['id'];}return db[_0x12cd('0x53')][_0x12cd('0x6e')]({'where':{'id':_0x455d5d[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x275cb9,null))['then'](function(_0x1903d0){if(_0x1903d0){_0x455d5d['body']['ChatWebsiteId']=_0x1903d0['id'];return db[_0x12cd('0x7e')][_0x12cd('0x6f')](_0x455d5d[_0x12cd('0x70')]);}})[_0x12cd('0x13')](respondWithResult(_0x275cb9,null))['catch'](handleError(_0x275cb9,null));};exports[_0x12cd('0x7f')]=function(_0x404219,_0x47e832){var _0x455019={'raw':![],'where':{}};var _0x391274={};var _0x5a4d2b={'count':0x0,'rows':[]};return db[_0x12cd('0x53')][_0x12cd('0x7b')]({'where':{'id':_0x404219[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x47e832,null))[_0x12cd('0x13')](function(_0x24851f){if(_0x24851f){_0x391274[_0x12cd('0x4e')]=_[_0x12cd('0x58')](db[_0x12cd('0x7e')]['rawAttributes']);_0x391274['query']=_[_0x12cd('0x58')](_0x404219[_0x12cd('0x57')]);_0x391274[_0x12cd('0x59')]=_[_0x12cd('0x5a')](_0x391274[_0x12cd('0x4e')],_0x391274[_0x12cd('0x57')]);_0x455019[_0x12cd('0x5b')]=_['intersection'](_0x391274[_0x12cd('0x4e')],qs[_0x12cd('0x5c')](_0x404219['query']['fields']));_0x455019[_0x12cd('0x5b')]=_0x455019[_0x12cd('0x5b')][_0x12cd('0x5d')]?_0x455019['attributes']:_0x391274[_0x12cd('0x4e')];if(!_0x404219[_0x12cd('0x57')][_0x12cd('0x5e')]('nolimit')){_0x455019['limit']=qs[_0x12cd('0x24')](_0x404219[_0x12cd('0x57')][_0x12cd('0x24')]);_0x455019[_0x12cd('0x22')]=qs[_0x12cd('0x22')](_0x404219[_0x12cd('0x57')][_0x12cd('0x22')]);}_0x455019['order']=qs[_0x12cd('0x61')](_0x404219[_0x12cd('0x57')][_0x12cd('0x61')]);_0x455019[_0x12cd('0x63')]=qs['filters'](_[_0x12cd('0x62')](_0x404219[_0x12cd('0x57')],_0x391274[_0x12cd('0x59')]));_0x455019[_0x12cd('0x63')]['ChatWebsiteId']=_0x24851f['id'];if(_0x404219['query'][_0x12cd('0x66')]){_0x455019[_0x12cd('0x63')]=_[_0x12cd('0x64')](_0x455019[_0x12cd('0x63')],{'$or':_['map'](_0x455019[_0x12cd('0x5b')],function(_0x36fc5c){var _0x35d79e={};_0x35d79e[_0x36fc5c]={'$like':'%'+_0x404219['query'][_0x12cd('0x66')]+'%'};return _0x35d79e;})});}_0x455019=_['merge']({},_0x455019,_0x404219[_0x12cd('0x80')]);return db[_0x12cd('0x7e')][_0x12cd('0x25')]({'where':_0x455019[_0x12cd('0x63')]})[_0x12cd('0x13')](function(_0x2b27c5){_0x5a4d2b[_0x12cd('0x25')]=_0x2b27c5;if(_0x404219['query'][_0x12cd('0x67')]){_0x455019[_0x12cd('0x68')]=[{'all':!![]}];}return db[_0x12cd('0x7e')][_0x12cd('0x69')](_0x455019);})[_0x12cd('0x13')](function(_0x37ed5b){_0x5a4d2b[_0x12cd('0x6a')]=_0x37ed5b;return _0x5a4d2b;});}})['then'](respondWithFilteredResult(_0x47e832,_0x455019))['catch'](handleError(_0x47e832,null));};exports['removeAnswers']=function(_0x2805ab,_0x2ddd6f){return db['ChatWebsite'][_0x12cd('0x6e')]({'where':{'id':_0x2805ab[_0x12cd('0x6c')]['id']}})['then'](handleEntityNotFound(_0x2ddd6f,null))[_0x12cd('0x13')](function(_0x1b56d3){if(_0x1b56d3){return _0x1b56d3['removeAnswers'](_0x2805ab[_0x12cd('0x57')]['ids']);}})['then'](respondWithStatusCode(_0x2ddd6f,null))[_0x12cd('0x1e')](handleError(_0x2ddd6f,null));};exports[_0x12cd('0x81')]=function(_0xc60783,_0x4f2bc8){_0xc60783['body'][_0x12cd('0x82')]=_0xc60783[_0x12cd('0x83')][_0x12cd('0x84')];return db['ChatWebsite']['find']({'where':{'id':_0xc60783[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x4f2bc8,null))[_0x12cd('0x13')](saveUpdates(_0xc60783[_0x12cd('0x70')],null))[_0x12cd('0x13')](respondWithResult(_0x4f2bc8,null))['catch'](handleError(_0x4f2bc8,null));};exports['addAvatar']=function(_0x2aa9f1,_0x5cbd05){_0x2aa9f1[_0x12cd('0x70')]['agentAvatar']=_0x2aa9f1['file']['filename'];return db[_0x12cd('0x53')]['find']({'where':{'id':_0x2aa9f1[_0x12cd('0x6c')]['id']}})['then'](handleEntityNotFound(_0x5cbd05,null))[_0x12cd('0x13')](saveUpdates(_0x2aa9f1['body'],null))[_0x12cd('0x13')](respondWithResult(_0x5cbd05,null))[_0x12cd('0x1e')](handleError(_0x5cbd05,null));};exports[_0x12cd('0x85')]=function(_0x10cb2f,_0x59cf4b){_0x10cb2f[_0x12cd('0x70')]['customerAvatar']=_0x10cb2f[_0x12cd('0x83')][_0x12cd('0x84')];return db[_0x12cd('0x53')]['find']({'where':{'id':_0x10cb2f[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x59cf4b,null))[_0x12cd('0x13')](saveUpdates(_0x10cb2f[_0x12cd('0x70')],null))[_0x12cd('0x13')](respondWithResult(_0x59cf4b,null))[_0x12cd('0x1e')](handleError(_0x59cf4b,null));};exports['addSystemAvatar']=function(_0x233dad,_0x170d4b){_0x233dad[_0x12cd('0x70')][_0x12cd('0x86')]=_0x233dad[_0x12cd('0x83')][_0x12cd('0x84')];return db[_0x12cd('0x53')][_0x12cd('0x6e')]({'where':{'id':_0x233dad['params']['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x170d4b,null))[_0x12cd('0x13')](saveUpdates(_0x233dad[_0x12cd('0x70')],null))['then'](respondWithResult(_0x170d4b,null))['catch'](handleError(_0x170d4b,null));};exports[_0x12cd('0x87')]=function(_0x31b809,_0x4a49b2){var _0x3be59f=path[_0x12cd('0x88')](config['root'],'server/files/images/logos/default_logo.svg');var _0x2a11f8={'where':{'id':_0x31b809[_0x12cd('0x6c')]['id']},'attributes':['id',_0x12cd('0x82')],'raw':!![]};var _0x2ffcfd=![];return require('../../config/license/util')[_0x12cd('0x89')]()[_0x12cd('0x13')](function(_0x1009b2){if(_0x1009b2){_0x2ffcfd=_0x1009b2['custom'];}})[_0x12cd('0x13')](function(){return db[_0x12cd('0x53')][_0x12cd('0x6e')](_0x2a11f8);})[_0x12cd('0x13')](handleEntityNotFound(_0x4a49b2,null))[_0x12cd('0x13')](function(_0x44291a){if(_0x44291a){if(!_[_0x12cd('0x8a')](_0x44291a['sitepic'])){if(fs['existsSync'](path[_0x12cd('0x88')](config['root'],_0x12cd('0x8b'),_0x44291a[_0x12cd('0x82')]))&&_0x2ffcfd){_0x3be59f=path[_0x12cd('0x88')](config['root'],'server/files/images/logos/',_0x44291a['sitepic']);}}return _0x4a49b2[_0x12cd('0x8c')](_0x3be59f);}})[_0x12cd('0x1e')](handleError(_0x4a49b2,null));};exports['getAvatar']=function(_0x4dbfac,_0x23b348){var _0x5758d9=path[_0x12cd('0x88')](config[_0x12cd('0x8d')],_0x12cd('0x8e'));var _0x290423={'where':{'id':_0x4dbfac[_0x12cd('0x6c')]['id']},'attributes':['id',_0x12cd('0x8f')],'raw':!![]};return db['ChatWebsite']['find'](_0x290423)[_0x12cd('0x13')](handleEntityNotFound(_0x23b348,null))['then'](function(_0x4d53b6){if(_0x4d53b6){if(!_[_0x12cd('0x8a')](_0x4d53b6[_0x12cd('0x8f')])){if(fs[_0x12cd('0x90')](path[_0x12cd('0x88')](config[_0x12cd('0x8d')],_0x12cd('0x91'),_0x4d53b6[_0x12cd('0x8f')]))){_0x5758d9=path[_0x12cd('0x88')](config[_0x12cd('0x8d')],'server/files/images/avatars/',_0x4d53b6[_0x12cd('0x8f')]);}}return _0x23b348['download'](_0x5758d9);}})[_0x12cd('0x1e')](handleError(_0x23b348,null));};exports[_0x12cd('0x92')]=function(_0x31daef,_0x359fcc){var _0x14ac22=path[_0x12cd('0x88')](config[_0x12cd('0x8d')],_0x12cd('0x93'));var _0x8e3d83={'where':{'id':_0x31daef[_0x12cd('0x6c')]['id']},'attributes':['id','customerAvatar',_0x12cd('0x94')],'raw':!![]};return db[_0x12cd('0x53')][_0x12cd('0x6e')](_0x8e3d83)[_0x12cd('0x13')](handleEntityNotFound(_0x359fcc,null))['then'](function(_0x4be70c){if(_0x4be70c){if(!_[_0x12cd('0x8a')](_0x4be70c[_0x12cd('0x95')])){if(fs['existsSync'](path[_0x12cd('0x88')](config[_0x12cd('0x8d')],_0x12cd('0x91'),_0x4be70c[_0x12cd('0x95')]))&&_0x4be70c[_0x12cd('0x94')]){_0x14ac22=path[_0x12cd('0x88')](config[_0x12cd('0x8d')],_0x12cd('0x91'),_0x4be70c[_0x12cd('0x95')]);}}return _0x359fcc[_0x12cd('0x8c')](_0x14ac22);}})[_0x12cd('0x1e')](handleError(_0x359fcc,null));};exports[_0x12cd('0x96')]=function(_0x2efd7e,_0x14082b){var _0x52e0c6=path['join'](config['root'],_0x12cd('0x97'));var _0x318ade={'where':{'id':_0x2efd7e[_0x12cd('0x6c')]['id']},'attributes':['id',_0x12cd('0x86')],'raw':!![]};return db[_0x12cd('0x53')][_0x12cd('0x6e')](_0x318ade)[_0x12cd('0x13')](handleEntityNotFound(_0x14082b,null))[_0x12cd('0x13')](function(_0xd44765){if(_0xd44765){if(!_['isNil'](_0xd44765[_0x12cd('0x86')])){if(fs[_0x12cd('0x90')](path[_0x12cd('0x88')](config[_0x12cd('0x8d')],_0x12cd('0x91'),_0xd44765[_0x12cd('0x86')]))){_0x52e0c6=path['join'](config[_0x12cd('0x8d')],'server/files/images/avatars/',_0xd44765['systemAvatar']);}}return _0x14082b[_0x12cd('0x8c')](_0x52e0c6);}})['catch'](handleError(_0x14082b,null));};exports[_0x12cd('0x98')]=function(_0x2a3ecb,_0x5ad450){var _0x14c513={'body':_0x2a3ecb[_0x12cd('0x70')],'channel':_0x12cd('0x99')};var _0x5a8390=[];var _0x335fe2=[];var _0x3d9991={};var _0x2c0079=![];return db[_0x12cd('0x9a')]['describe']()['then'](function(_0x3413d9){if(!_0x3413d9){throw new db[(_0x12cd('0x9b'))][(_0x12cd('0x9c'))](_0x12cd('0x9d'));}_0x5a8390=_['difference'](_[_0x12cd('0x58')](_0x3413d9),[_0x12cd('0x9e'),_0x12cd('0x9f')]);_0x335fe2=_[_0x12cd('0xa0')](_[_0x12cd('0x58')](_0x3413d9),['createdAt',_0x12cd('0x9f'),_0x12cd('0xa1'),_0x12cd('0xa2')]);if(_0x2a3ecb[_0x12cd('0x70')]['id']){delete _0x2a3ecb[_0x12cd('0x70')]['id'];}if(_[_0x12cd('0x8a')](_0x2a3ecb[_0x12cd('0x70')]['from'])){throw new db[(_0x12cd('0x9b'))][(_0x12cd('0x9c'))]('from\x20is\x20mandatory');}if(_[_0x12cd('0x8a')](_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0x70')])||_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0x70')]===''){throw new db[(_0x12cd('0x9b'))][(_0x12cd('0x9c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2a3ecb['body'][_0x12cd('0xa3')])){throw new db[(_0x12cd('0x9b'))]['ValidationError'](_0x12cd('0xa4')+_0x335fe2);}if(!_[_0x12cd('0xa5')](_0x335fe2,_0x2a3ecb['body'][_0x12cd('0xa3')])){throw new db[(_0x12cd('0x9b'))]['ValidationError'](_0x12cd('0xa6')+_0x335fe2);}_0x3d9991[_0x2a3ecb['body'][_0x12cd('0xa3')]]=_0x2a3ecb['body'][_0x12cd('0xa7')];})[_0x12cd('0x13')](function(){return db[_0x12cd('0x53')][_0x12cd('0x6e')]({'where':{'id':_0x2a3ecb[_0x12cd('0x6c')]['id']},'include':[{'model':db[_0x12cd('0xa8')],'as':_0x12cd('0xa9'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x3d9991,'limit':0x1,'order':[[_0x12cd('0x9f'),_0x12cd('0xaa')]]}]},{'model':db[_0x12cd('0xab')],'as':_0x12cd('0xac')},{'model':db[_0x12cd('0x39')],'as':'Interval','include':[{'model':db[_0x12cd('0x39')],'as':'Intervals','attributes':['id',_0x12cd('0x33')],'raw':!![]}]}]});})[_0x12cd('0x13')](function(_0x216353){if(!_0x216353)throw new APINotFoundError(util['format']('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x2a3ecb[_0x12cd('0x6c')]['id']));if(!_0x216353[_0x12cd('0x39')]||!_0x216353['Interval'][_0x12cd('0x3a')])return[_0x216353,!![]];return[_0x216353,checkWebsiteIntervals(_0x216353)];})[_0x12cd('0xad')](function(_0x7734dd,_0xcc01c8){if(!_0xcc01c8)throw new APIOutOfIntervalError();if(!_0x7734dd['List'])return;_0x14c513[_0x12cd('0xae')]=_0x7734dd;_0x14c513[_0x12cd('0xaf')]=_0x7734dd[_0x12cd('0xa9')];_0x14c513[_0x12cd('0xb0')]=_['orderBy'](_0x7734dd[_0x12cd('0xac')],['priority'],['asc']);if(_0x14c513[_0x12cd('0xae')][_0x12cd('0xac')]){delete _0x14c513[_0x12cd('0xae')][_0x12cd('0xac')];}if(_0x14c513[_0x12cd('0xae')]['List']&&_0x14c513[_0x12cd('0xae')]['List']['Contacts'][_0x12cd('0x5d')]){return _0x14c513['account'][_0x12cd('0xa9')][_0x12cd('0xb1')][0x0];}var _0x459a57=_[_0x12cd('0xd')](_0x2a3ecb[_0x12cd('0x70')],{'firstName':_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xa7')],'ListId':_0x7734dd[_0x12cd('0xa2')]});_0x459a57[_0x2a3ecb['body'][_0x12cd('0xa3')]]=_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xa7')];return db[_0x12cd('0x9a')]['create'](_0x459a57,{'fields':_0x5a8390,'raw':!![]});})[_0x12cd('0x13')](function(_0x3d24c3){_0x14c513[_0x12cd('0xb2')]=_0x3d24c3;var _0x31b9a9=createInteractionObject(_0x2a3ecb[_0x12cd('0x6c')]['id'],_0x2a3ecb[_0x12cd('0x70')],_0x2a3ecb[_0x12cd('0xb3')],_0x3d24c3);var _0x4bb76d={'ChatWebsiteId':_0x2a3ecb[_0x12cd('0x6c')]['id'],'closed':![]};if(_0x2a3ecb['body'][_0x12cd('0xb4')]){_0x4bb76d['threadId']=_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xb4')];return db[_0x12cd('0xb5')][_0x12cd('0x6e')]({'where':_0x4bb76d})[_0x12cd('0x13')](function(_0x25e08a){if(_0x25e08a){_0x2c0079=!![];return _0x25e08a;}_0x31b9a9['threadId']=_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xb4')];_0x31b9a9[_0x12cd('0xb6')]=_0x2a3ecb[_0x12cd('0x70')]['externalUrl'];return db[_0x12cd('0xb5')][_0x12cd('0x6f')](_0x31b9a9);});}_0x4bb76d['ContactId']=_0x3d24c3['id'];if(_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xb7')]&&_0x2a3ecb[_0x12cd('0x70')]['interaction']['id']){_0x4bb76d['id']=_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xb7')]['id'];return db[_0x12cd('0xb5')]['find']({'where':_0x4bb76d})['then'](function(_0x3aff96){if(_0x3aff96){_0x2c0079=!![];return _0x3aff96;}return db[_0x12cd('0xb5')]['create'](_0x31b9a9);});}return db[_0x12cd('0xb5')][_0x12cd('0x6f')](_0x31b9a9);})[_0x12cd('0x13')](function(_0x2d8792){if(!_0x2c0079)return _0x2d8792;var _0x26c640={'from':(_0x14c513[_0x12cd('0xb2')][_0x12cd('0x44')]||'')+'\x20'+(_0x14c513[_0x12cd('0xb2')][_0x12cd('0x45')]||'')};if(_0x2a3ecb['body']['threadId']&&_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xb8')]&&_0x2a3ecb[_0x12cd('0x70')]['threadId']!=_0x2a3ecb['body']['messageId']){_0x26c640['threadId']=_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xb8')];}return _0x2d8792[_0x12cd('0x75')](_0x26c640);})[_0x12cd('0x13')](function(_0x37738c){_0x14c513[_0x12cd('0xb7')]=_0x37738c[_0x12cd('0x3b')]({'plain':!![]});_0x14c513[_0x12cd('0xb7')]['created']=!_0x2c0079;if(_0x14c513[_0x12cd('0xb7')][_0x12cd('0xb9')]){if(_0x14c513[_0x12cd('0xae')][_0x12cd('0xba')]){_0x14c513[_0x12cd('0xb0')][_0x12cd('0xbb')]({'id':0x0,'priority':_0x14c513[_0x12cd('0xb0')][_0x12cd('0x5d')]+0x1,'app':_0x12cd('0xbc'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x12cd('0xbd')][_0x12cd('0x6f')]({'body':_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0x70')],'ChatWebsiteId':_0x2a3ecb[_0x12cd('0x6c')]['id'],'ChatInteractionId':_0x37738c['id'],'direction':'in','ContactId':_0x14c513['contact']['id'],'AttachmentId':_0x2a3ecb[_0x12cd('0x70')][_0x12cd('0xbe')]});})[_0x12cd('0x13')](function(_0x16103e){_0x14c513['message']=_0x16103e;if(!_0x14c513[_0x12cd('0xb7')][_0x12cd('0xbf')]){return;}return db[_0x12cd('0xc0')]['find']({'attributes':['id',_0x12cd('0x2c')],'where':{'id':_0x14c513[_0x12cd('0xb7')][_0x12cd('0xbf')]}});})[_0x12cd('0x13')](function(_0xc5479){if(_0xc5479){_0x14c513[_0x12cd('0xb0')]['unshift']({'id':0x0,'priority':0x0,'app':_0x12cd('0xc1'),'appdata':_0xc5479[_0x12cd('0x2c')]+','+(_0x14c513[_0x12cd('0xae')][_0x12cd('0xc2')]||0xa),'interval':_0x12cd('0xc3')});_0x14c513[_0x12cd('0xc4')]=!![];}if(!_0x14c513['interaction']['queueId']){return;}return db[_0x12cd('0xc5')]['find']({'attributes':['id','name'],'where':{'id':_0x14c513[_0x12cd('0xb7')][_0x12cd('0xc6')]}});})['then'](function(_0x1b81a8){if(_0x1b81a8){_0x14c513[_0x12cd('0xb0')][_0x12cd('0xc7')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x1b81a8[_0x12cd('0x2c')]+','+(_0x14c513[_0x12cd('0xae')][_0x12cd('0xc8')]||0x12c),'interval':_0x12cd('0xc3')});}return respondWithRpcPromise(_0x12cd('0xc9'),_0x12cd('0xca'),_0x14c513);})['then'](function(_0xf4be09){respondWithRpcPromise(_0x12cd('0xcb'),_0x12cd('0xcb'),{'event':_0x12cd('0x98'),'message':_0xf4be09},client9002);return _0xf4be09;})[_0x12cd('0x13')](respondWithResult(_0x5ad450,null))[_0x12cd('0x1e')](APIHandleError(_0x5ad450));};exports[_0x12cd('0xcc')]=function(_0xdd12c,_0xbd5c34){var _0x1bb99b,_0x1120bb,_0x3bc6e3;var _0x16218e=[];var _0x354422={};var _0xa006a3=_0xdd12c[_0x12cd('0xcd')]||[];var _0x57e8a9=[];var _0x5b83d1;return db['CmContact'][_0x12cd('0x76')]()[_0x12cd('0x13')](function(_0x416409){if(!_0x416409){throw new db['Sequelize'][(_0x12cd('0x9c'))](_0x12cd('0x9d'));}_0x16218e=_[_0x12cd('0xa0')](_[_0x12cd('0x58')](_0x416409),['createdAt',_0x12cd('0x9f'),_0x12cd('0xa1'),_0x12cd('0xa2')]);if(_0xdd12c[_0x12cd('0x70')]['id']){delete _0xdd12c[_0x12cd('0x70')]['id'];}if(_[_0x12cd('0x8a')](_0xdd12c[_0x12cd('0x70')]['from'])){throw _0xbd5c34[_0x12cd('0x1f')](0x1f4)['send'](new db[(_0x12cd('0x9b'))][(_0x12cd('0x9c'))](_0x12cd('0xce')));}if(_[_0x12cd('0x8a')](_0xdd12c[_0x12cd('0x70')][_0x12cd('0x70')])||_0xdd12c['body'][_0x12cd('0x70')]===''){throw _0xbd5c34[_0x12cd('0x1f')](0x1f4)['send'](new db[(_0x12cd('0x9b'))]['ValidationError'](_0x12cd('0xcf')));}if(_[_0x12cd('0x8a')](_0xdd12c[_0x12cd('0x70')][_0x12cd('0xd0')])){throw _0xbd5c34[_0x12cd('0x1f')](0x1f4)[_0x12cd('0x2d')](new db[(_0x12cd('0x9b'))][(_0x12cd('0x9c'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x16218e));}if(!_[_0x12cd('0xa5')](_0x16218e,_0xdd12c[_0x12cd('0x70')][_0x12cd('0xd0')])){throw _0xbd5c34[_0x12cd('0x1f')](0x1f4)['send'](new db[(_0x12cd('0x9b'))][(_0x12cd('0x9c'))](_0x12cd('0xd1')+_0x16218e));}_0x354422[_0xdd12c['body'][_0x12cd('0xd0')]]=_0xdd12c['body'][_0x12cd('0xa7')];})['then'](function(){return db[_0x12cd('0x53')][_0x12cd('0x6e')]({'where':{'id':_0xdd12c['params']['id']},'include':[{'model':db[_0x12cd('0xa8')],'as':_0x12cd('0xa9')},{'model':db[_0x12cd('0xd2')],'as':_0x12cd('0xd2')}]});})['then'](handleEntityNotFound(_0xbd5c34,null))[_0x12cd('0x13')](function(_0x5ea350){if(_0x5ea350&&_0x5ea350[_0x12cd('0xa9')]){_0x1120bb=_0x5ea350;var _0x35a80a=_['defaults'](_0xdd12c[_0x12cd('0x70')],{'firstName':_0xdd12c[_0x12cd('0x70')][_0x12cd('0xa7')],'phone':_0xdd12c['body'][_0x12cd('0xa7')],'ListId':_0x5ea350[_0x12cd('0xa2')]});_0x35a80a[_0xdd12c[_0x12cd('0x70')]['mapKeyOffline']]=_0xdd12c[_0x12cd('0x70')][_0x12cd('0xa7')];return db[_0x12cd('0x9a')]['findOrCreate']({'where':_0x354422,'defaults':_0x35a80a});}})[_0x12cd('0xad')](function(_0x413cf0){if(_0x413cf0){_0x3bc6e3=_0x413cf0;var _0x2d7f8a=fs[_0x12cd('0xd3')](path[_0x12cd('0x88')](config['root'],_0x12cd('0xd4')),_0x12cd('0xd5'));var _0x2d92cf=ejs['render'](_0x2d7f8a,{'body':_['toPairs'](_0xdd12c[_0x12cd('0x70')][_0x12cd('0x70')]),'bodyTitle':_0x1120bb['offlineMessageBody']});return db[_0x12cd('0xd6')][_0x12cd('0x6f')]({'body':_0x2d92cf,'plainBody':htmlToText[_0x12cd('0xd7')](_0x2d92cf),'ContactId':_0x413cf0['id'],'ChatWebsiteId':_0x1120bb['id']});}})[_0x12cd('0x13')](function(_0x1fb1a2){_0x5b83d1=_0x1fb1a2;if(_0xa006a3[_0x12cd('0x5d')]){var _0x4a4107=_0xa006a3['map'](function(_0x456c93){return{'name':_0x456c93[_0x12cd('0xd8')],'basename':_0x456c93[_0x12cd('0x84')],'type':_0x456c93['mimetype'],'ChatOfflineMessageId':_0x1fb1a2['id']};});_0x57e8a9=_0x4a4107[_0x12cd('0x38')](_0x2c948b=>{var _0x3dd6f0={'filename':_0x2c948b[_0x12cd('0x2c')],'path':path[_0x12cd('0x88')](config['root'],_0x12cd('0xd9'),_0x12cd('0xcd'),_0x12cd('0xda'),'offline-chat',_0x2c948b[_0x12cd('0xdb')])};return _0x3dd6f0;});if(!_0x1120bb['openNewInteraction']){return db[_0x12cd('0xdc')][_0x12cd('0xdd')](function(_0xae8c3d){return db[_0x12cd('0xde')][_0x12cd('0xdf')](_0x4a4107,{'transaction':_0xae8c3d});});}}})[_0x12cd('0x13')](function(){if(_0x5b83d1){_0x1bb99b=_0x5b83d1;return db['MailAccount'][_0x12cd('0x7b')]({'where':{'service':!![]},'include':[{'model':db[_0x12cd('0xe0')],'as':_0x12cd('0xe1'),'raw':!![],'include':[{'model':db[_0x12cd('0xe2')],'as':_0x12cd('0xe2'),'raw':!![]}]}]});}})[_0x12cd('0x13')](function(_0x520c42){if(_0x520c42&&_0x520c42['Smtp']&&_0x1120bb[_0x12cd('0xe3')]&&_0x1120bb[_0x12cd('0xe4')]){var _0x3fa0ad=_0x520c42['getSmtpOptions']();return respondWithRpcPromise(_0x12cd('0xe5'),'sendMail',{'account':_0x3fa0ad,'message':{'from':util[_0x12cd('0x30')](_0x12cd('0xe6'),_0x520c42[_0x12cd('0x2c')],_0x520c42[_0x12cd('0xe7')]||_0x520c42[_0x12cd('0xe1')][_0x12cd('0x71')]),'to':_0x1120bb[_0x12cd('0xe4')],'subject':_0x1120bb[_0x12cd('0xe8')],'html':_0x1bb99b[_0x12cd('0x70')],'attachments':_0x57e8a9}},client9003)[_0x12cd('0x13')](function(){return _0x1bb99b;})[_0x12cd('0x1e')](function(_0x35d51d){logger['error'](_0x35d51d);});}})[_0x12cd('0x13')](function(){if(_0x1120bb&&_0x1120bb['openNewInteraction']&&_0x1120bb[_0x12cd('0xe9')]){var _0xc884fb=[];if(_0xa006a3[_0x12cd('0x5d')]){_0xc884fb=_0xa006a3[_0x12cd('0x38')](function(_0x1798ad){return{'name':_0x1798ad[_0x12cd('0xd8')],'basename':_0x1798ad['filename'],'type':_0x1798ad[_0x12cd('0xea')],'ChatOfflineMessageId':_0x5b83d1['id']};});}var _0x532d18;if(!_[_0x12cd('0x8a')](_0x1120bb[_0x12cd('0xeb')])){var _0x2b1d79=_[_0x12cd('0x38')](_0xdd12c[_0x12cd('0x70')],function(_0x596a6e){return _0x596a6e;});var _0x277b03=_[_0x12cd('0xec')](_0x2b1d79)[0x0];var _0x2344cf=_[_0x12cd('0xed')](_0x277b03,function(_0x5854ea){return _0x5854ea;});_0x532d18=_0x2344cf[0x1][_0x1120bb[_0x12cd('0xeb')]];}var _0x528056={'from':_0x3bc6e3['email'],'firstName':_0x3bc6e3[_0x12cd('0x44')],'lastName':_0x3bc6e3['lastName'],'mapKey':_0x12cd('0xe7'),'message':{'from':_0x3bc6e3[_0x12cd('0xe7')],'to':_0x1120bb['MailAccount']['email'],'cc':'','subject':_[_0x12cd('0x8a')](_0x532d18)?_0x1120bb[_0x12cd('0xe8')]:_0x532d18,'messageId':'','sentAt':new Date(),'attach':_0xc884fb[_0x12cd('0x5d')],'attachments':_0xc884fb,'originChannel':_0x12cd('0xee'),'ChatWebsiteId':_0x1120bb['id'],'ChatOfflineMessageId':_0x1bb99b['id'],'originTo':_0x1120bb['MailAccount'][_0x12cd('0xe7')]},'body':_0x1bb99b[_0x12cd('0x70')]};var _0x1af560={'account':{'id':_0x1120bb[_0x12cd('0xe9')]},'body':_0x528056,'log':_0x12cd('0xef')};return respondWithRpcPromise(_0x12cd('0xef'),_0x12cd('0xf0'),_0x1af560,client9001)[_0x12cd('0x13')](function(){return _0x1bb99b;})[_0x12cd('0x1e')](function(_0x32b757){logger[_0x12cd('0x19')](_0x32b757);});}return;})[_0x12cd('0x13')](function(){if(_0x1bb99b){return _0x1bb99b;}})[_0x12cd('0x13')](respondWithResult(_0xbd5c34,null))[_0x12cd('0x1e')](function(){for(var _0x4c28c2 of _0xa006a3){var _0x5b9618=path[_0x12cd('0x88')](config[_0x12cd('0x8d')],_0x12cd('0xd9'),_0x12cd('0xcd'),_0x12cd('0xda'),_0x12cd('0xf1'),_0x4c28c2['filename']);fs_extra['remove'](_0x5b9618)[_0x12cd('0x1e')](function(_0x5b76a1){logger[_0x12cd('0x19')]('Could\x20not\x20remove\x20attachment\x20file',_0x5b9618,_0x5b76a1);});}});};exports[_0x12cd('0xf2')]=function(_0x5b95fc,_0x3f9562){return db[_0x12cd('0xb5')]['find']({'where':{'id':_0x5b95fc[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x3f9562,null))[_0x12cd('0x13')](function(_0x501354){if(_0x501354){return _0x501354['addInteraction'](_0x5b95fc[_0x12cd('0x70')][_0x12cd('0xf3')],_[_0x12cd('0xf4')](_0x5b95fc[_0x12cd('0x70')],[_0x12cd('0xf3'),'id'])||{});}})[_0x12cd('0x13')](respondWithResult(_0x3f9562,null))[_0x12cd('0x1e')](handleError(_0x3f9562,null));};exports[_0x12cd('0xf5')]=function(_0x442760,_0x55728a){var _0x5e882d={'raw':![],'where':{}};var _0x5f0eeb={};var _0x753532={'count':0x0,'rows':[]};return db[_0x12cd('0x53')][_0x12cd('0x7b')]({'where':{'id':_0x442760[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x55728a,null))[_0x12cd('0x13')](function(_0x29169e){if(_0x29169e){_0x5f0eeb[_0x12cd('0x4e')]=_['keys'](db['ChatInteraction'][_0x12cd('0x54')]);_0x5f0eeb[_0x12cd('0x57')]=_[_0x12cd('0x58')](_0x442760['query']);_0x5f0eeb[_0x12cd('0x59')]=_[_0x12cd('0x5a')](_0x5f0eeb[_0x12cd('0x4e')],_0x5f0eeb['query']);_0x5e882d[_0x12cd('0x5b')]=_['intersection'](_0x5f0eeb[_0x12cd('0x4e')],qs[_0x12cd('0x5c')](_0x442760[_0x12cd('0x57')][_0x12cd('0x5c')]));_0x5e882d[_0x12cd('0x5b')]=_0x5e882d[_0x12cd('0x5b')]['length']?_0x5e882d['attributes']:_0x5f0eeb[_0x12cd('0x4e')];if(!_0x442760[_0x12cd('0x57')][_0x12cd('0x5e')]('nolimit')){_0x5e882d[_0x12cd('0x24')]=qs[_0x12cd('0x24')](_0x442760[_0x12cd('0x57')][_0x12cd('0x24')]);_0x5e882d[_0x12cd('0x22')]=qs[_0x12cd('0x22')](_0x442760[_0x12cd('0x57')][_0x12cd('0x22')]);}_0x5e882d[_0x12cd('0x60')]=qs[_0x12cd('0x61')](_0x442760[_0x12cd('0x57')][_0x12cd('0x61')]);_0x5e882d[_0x12cd('0x63')]=qs[_0x12cd('0x59')](_['pick'](_0x442760[_0x12cd('0x57')],_0x5f0eeb[_0x12cd('0x59')]));_0x5e882d[_0x12cd('0x63')][_0x12cd('0x78')]=_0x29169e['id'];if(_0x442760[_0x12cd('0x57')][_0x12cd('0x66')]){_0x5e882d[_0x12cd('0x63')]=_[_0x12cd('0x64')](_0x5e882d[_0x12cd('0x63')],{'$or':_[_0x12cd('0x38')](_0x5e882d['attributes'],function(_0x3895ae){var _0xc3fe18={};_0xc3fe18[_0x3895ae]={'$like':'%'+_0x442760[_0x12cd('0x57')][_0x12cd('0x66')]+'%'};return _0xc3fe18;})});}_0x5e882d=_['merge']({},_0x5e882d,_0x442760[_0x12cd('0x80')]);return db['ChatInteraction'][_0x12cd('0x25')]({'where':_0x5e882d[_0x12cd('0x63')]})['then'](function(_0x56ca9f){_0x753532[_0x12cd('0x25')]=_0x56ca9f;if(_0x442760[_0x12cd('0x57')]['includeAll']){_0x5e882d[_0x12cd('0x68')]=[{'model':db['CmContact'],'as':_0x12cd('0xf6'),'required':![]},{'model':db['User'],'as':_0x12cd('0xf7'),'attributes':[_0x12cd('0x2c'),_0x12cd('0xf8'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x12cd('0xf9'),'attributes':['id',_0x12cd('0x2c'),_0x12cd('0xfa')],'where':_0x442760[_0x12cd('0x57')][_0x12cd('0xfb')]?{'id':_0x442760[_0x12cd('0x57')]['tag']}:undefined,'required':_0x442760['query']['tag']?!![]:![]}];}return db[_0x12cd('0xb5')][_0x12cd('0x69')](_0x5e882d);})['then'](function(_0x106c17){_0x753532[_0x12cd('0x6a')]=_0x106c17;return _0x753532;});}})['then'](respondWithFilteredResult(_0x55728a,_0x5e882d))['catch'](handleError(_0x55728a,null));};exports['getSnippet']=function(_0x52b360,_0x4d28e2){var _0x50f7d3=0x0;var _0x20b98a=0x0;var _0x24e44d=![];var _0x59ee60;var _0x2ef3b1;return db[_0x12cd('0x53')][_0x12cd('0x6e')]({'where':{'id':_0x52b360['params']['id']},'include':[{'model':db['Interval'],'as':_0x12cd('0x39'),'include':[{'model':db[_0x12cd('0x39')],'as':'Intervals','attributes':['id',_0x12cd('0x33')]}]}]})[_0x12cd('0x13')](handleEntityNotFound(_0x4d28e2,null))[_0x12cd('0x13')](function(_0x4c070c){if(_0x4c070c){_0x59ee60=_0x4c070c;return _0x4c070c['getProactiveActions']({'raw':!![]});}})[_0x12cd('0x13')](function(_0x59dd4f){if(_0x59ee60){if(_0x59dd4f){_0x2ef3b1=_0x59dd4f;}}return require('../../config/license/util')[_0x12cd('0x89')]();})['then'](function(_0x3a4b80){if(_0x3a4b80){_0x20b98a=_0x3a4b80['virtual'];_0x24e44d=_0x3a4b80[_0x12cd('0xfc')];}})[_0x12cd('0x13')](function(){return db['ChatInteraction'][_0x12cd('0x25')]({'where':{'closed':![]}});})[_0x12cd('0x13')](function(_0x2a25f5){_0x50f7d3=_0x2a25f5;if(_0x20b98a&&_0x2a25f5>_0x20b98a){return db[_0x12cd('0xfd')][_0x12cd('0x7b')]({'where':{'id':0x1}})[_0x12cd('0x13')](function(_0x241790){if(_0x241790){_0x241790[_0x12cd('0xfe')](_0x12cd('0xff'));}});}})[_0x12cd('0x13')](function(){if(!_0x59ee60[_0x12cd('0x39')]||!_0x59ee60[_0x12cd('0x39')][_0x12cd('0x3a')])return!![];return checkWebsiteIntervals(_0x59ee60);})[_0x12cd('0x13')](function(_0x5845bf){var _0x5213b0=fs['readFileSync'](path[_0x12cd('0x88')](config[_0x12cd('0x8d')],_0x12cd('0x100')),_0x12cd('0xd5'));var _0x3a5c7b=new url[(_0x12cd('0x101'))](_0x59ee60[_0x12cd('0x102')])['origin'];var _0x3984af=_0x12cd('0x103');var _0x34684b=![];var _0x444bc3={'chatVersion':_0x3984af,'chatWebsiteAddressOrigin':_0x3a5c7b,'remote':_0x59ee60[_0x12cd('0x104')],'query':querystring[_0x12cd('0x18')](_[_0x12cd('0x64')](_0x59ee60[_0x12cd('0x3b')]({'plain':!![]}),{'customerIp':_0x52b360[_0x12cd('0xb3')][_0x12cd('0x42')]||_0x52b360[_0x12cd('0xb3')][_0x12cd('0x105')]||_0x52b360[_0x12cd('0x106')][_0x12cd('0x107')]||_0x52b360['ip'],'referer':_0x52b360[_0x12cd('0xb3')][_0x12cd('0x47')],'openedInteractions':_0x50f7d3,'maxInteractions':_0x20b98a,'virtual':_0x24e44d[_0x12cd('0x108')],'online':_0x5845bf,'custom':_0x24e44d}))[_0x12cd('0x109')](/'/g,'\x5c\x27')};_0x4d28e2[_0x12cd('0x2d')](ejs[_0x12cd('0x10a')](Mustache[_0x12cd('0x10a')](_0x5213b0,_0x444bc3),{'proactiveActions':_0x2ef3b1,'alignment':_0x59ee60[_0x12cd('0x10b')],'verticalAlignment':_0x59ee60['verticalAlignment'],'div_color':_0x59ee60[_0x12cd('0xfa')],'labelText':_0x59ee60['labelText'],'text_color':_0x59ee60[_0x12cd('0x10c')],'text_button_color':_0x59ee60[_0x12cd('0x10d')],'button_color':_0x59ee60[_0x12cd('0x10e')],'background_color':_0x59ee60[_0x12cd('0x10f')],'hideWhenOffline':_0x59ee60[_0x12cd('0x110')],'intervalId':_0x59ee60[_0x12cd('0x111')],'isDevelopment':_0x34684b,'chatVersion':_0x3984af}));})[_0x12cd('0x1e')](handleError(_0x4d28e2,null));};exports[_0x12cd('0x112')]=function(_0x4830f6,_0x345053){var _0x44ab3f=_0x4830f6[_0x12cd('0x6c')]['id'];var _0x4cb9f3=_0x4830f6[_0x12cd('0x70')];var _0x4e18eb=0xc8;var _0x50fd58=null;return db['sequelize'][_0x12cd('0xdd')]({'isolationLevel':db[_0x12cd('0xdc')][_0x12cd('0x113')]['ISOLATION_LEVELS'][_0x12cd('0x114')]},function(_0x155d3c){return db['ChatWebsite']['findOne']({'where':{'id':_0x44ab3f},'transaction':_0x155d3c})[_0x12cd('0x13')](function(_0x37d75a){if(_0x37d75a){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x44ab3f},'transaction':_0x155d3c})['then'](function(){var _0x5452ec=_[_0x12cd('0x38')](_0x4cb9f3,function(_0x54798a){_0x54798a[_0x12cd('0x78')]=_0x44ab3f;return _0x54798a;});return db[_0x12cd('0xab')][_0x12cd('0xdf')](_0x5452ec,{'transaction':_0x155d3c});});}else{_0x4e18eb=0x194;_0x50fd58=[];}});})[_0x12cd('0x13')](function(){if(_0x4e18eb!==0x194){return db[_0x12cd('0xab')][_0x12cd('0x115')]({'where':{'ChatWebsiteId':_0x44ab3f},'order':_0x12cd('0x116')})['then'](function(_0x258967){_0x50fd58=_0x258967;});}})['catch'](function(_0x54ea7e){_0x4e18eb=0x1f4;logger['error'](_0x54ea7e['stack']);if(_0x54ea7e['name']){delete _0x54ea7e[_0x12cd('0x2c')];}_0x50fd58=_0x54ea7e;})[_0x12cd('0x117')](function(){if(_0x50fd58===null){_0x345053[_0x12cd('0x2b')](_0x4e18eb);}else{if(_0x4e18eb===0x1f4){_0x345053['status'](_0x4e18eb)[_0x12cd('0x2d')](_0x50fd58);}else{_0x345053[_0x12cd('0x1f')](_0x4e18eb)[_0x12cd('0x21')](_0x50fd58);}}});};exports[_0x12cd('0x118')]=function(_0x1fef1d,_0x5909f2){var _0x927a45={};var _0x5e9936={};var _0x427dce;var _0x4cf473;return db[_0x12cd('0x53')][_0x12cd('0x7b')]({'where':{'id':_0x1fef1d[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x5909f2,null))[_0x12cd('0x13')](function(_0x5aa08b){if(_0x5aa08b){_0x427dce=_0x5aa08b;_0x5e9936[_0x12cd('0x4e')]=_[_0x12cd('0x58')](db[_0x12cd('0xab')][_0x12cd('0x54')]);_0x5e9936['query']=_[_0x12cd('0x58')](_0x1fef1d[_0x12cd('0x57')]);_0x5e9936['filters']=_['intersection'](_0x5e9936[_0x12cd('0x4e')],_0x5e9936['query']);_0x927a45[_0x12cd('0x5b')]=_[_0x12cd('0x5a')](_0x5e9936[_0x12cd('0x4e')],qs[_0x12cd('0x5c')](_0x1fef1d[_0x12cd('0x57')][_0x12cd('0x5c')]));_0x927a45[_0x12cd('0x5b')]=_0x927a45[_0x12cd('0x5b')][_0x12cd('0x5d')]?_0x927a45[_0x12cd('0x5b')]:_0x5e9936['model'];_0x927a45[_0x12cd('0x60')]=qs[_0x12cd('0x61')](_0x1fef1d[_0x12cd('0x57')][_0x12cd('0x61')]);_0x927a45[_0x12cd('0x63')]=qs[_0x12cd('0x59')](_[_0x12cd('0x62')](_0x1fef1d[_0x12cd('0x57')],_0x5e9936[_0x12cd('0x59')]));if(_0x1fef1d[_0x12cd('0x57')][_0x12cd('0x66')]){_0x927a45[_0x12cd('0x63')]=_[_0x12cd('0x64')](_0x927a45[_0x12cd('0x63')],{'$or':_[_0x12cd('0x38')](_0x927a45[_0x12cd('0x5b')],function(_0x5da4cf){var _0x1ff8fc={};_0x1ff8fc[_0x5da4cf]={'$like':'%'+_0x1fef1d['query']['filter']+'%'};return _0x1ff8fc;})});}_0x927a45=_['merge']({},_0x927a45,_0x1fef1d['options']);return _0x427dce[_0x12cd('0x118')](_0x927a45);}})['then'](function(_0xa77b36){if(_0xa77b36){_0x4cf473=_0xa77b36[_0x12cd('0x5d')];if(!_0x1fef1d[_0x12cd('0x57')]['hasOwnProperty'](_0x12cd('0x5f'))){_0x927a45[_0x12cd('0x24')]=qs[_0x12cd('0x24')](_0x1fef1d[_0x12cd('0x57')][_0x12cd('0x24')]);_0x927a45[_0x12cd('0x22')]=qs['offset'](_0x1fef1d[_0x12cd('0x57')][_0x12cd('0x22')]);}return _0x427dce[_0x12cd('0x118')](_0x927a45);}})[_0x12cd('0x13')](function(_0x41619c){if(_0x41619c){return _0x41619c?{'count':_0x4cf473,'rows':_0x41619c}:null;}})[_0x12cd('0x13')](respondWithResult(_0x5909f2,null))[_0x12cd('0x1e')](handleError(_0x5909f2,null));};exports[_0x12cd('0x119')]=function(_0x135d8d,_0x274fb2){return db[_0x12cd('0x11a')]['find']({'where':{'id':_0x135d8d['params']['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x274fb2,null))[_0x12cd('0x13')](function(_0x445b9b){if(_0x445b9b){return _0x445b9b[_0x12cd('0x119')](_0x135d8d[_0x12cd('0x70')][_0x12cd('0xf3')],_['omit'](_0x135d8d['body'],[_0x12cd('0xf3'),'id'])||{});}})[_0x12cd('0x13')](respondWithResult(_0x274fb2,null))[_0x12cd('0x1e')](handleError(_0x274fb2,null));};exports[_0x12cd('0x11b')]=function(_0x559c6c,_0x138d75){var _0x37c833={};var _0x310a8d={};var _0x2d22fb;var _0xaffe48;return db[_0x12cd('0x53')]['findOne']({'where':{'id':_0x559c6c[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x138d75,null))['then'](function(_0x58ec37){if(_0x58ec37){_0x2d22fb=_0x58ec37;_0x310a8d[_0x12cd('0x4e')]=_[_0x12cd('0x58')](db[_0x12cd('0x11c')][_0x12cd('0x54')]);_0x310a8d['query']=_[_0x12cd('0x58')](_0x559c6c[_0x12cd('0x57')]);_0x310a8d[_0x12cd('0x59')]=_['intersection'](_0x310a8d[_0x12cd('0x4e')],_0x310a8d[_0x12cd('0x57')]);_0x37c833['attributes']=_[_0x12cd('0x5a')](_0x310a8d[_0x12cd('0x4e')],qs[_0x12cd('0x5c')](_0x559c6c[_0x12cd('0x57')]['fields']));_0x37c833[_0x12cd('0x5b')]=_0x37c833['attributes'][_0x12cd('0x5d')]?_0x37c833[_0x12cd('0x5b')]:_0x310a8d[_0x12cd('0x4e')];_0x37c833[_0x12cd('0x60')]=qs['sort'](_0x559c6c[_0x12cd('0x57')]['sort']);_0x37c833[_0x12cd('0x63')]=qs[_0x12cd('0x59')](_[_0x12cd('0x62')](_0x559c6c['query'],_0x310a8d[_0x12cd('0x59')]));if(_0x559c6c[_0x12cd('0x57')]['filter']){_0x37c833['where']=_[_0x12cd('0x64')](_0x37c833['where'],{'$or':_['map'](_0x37c833[_0x12cd('0x5b')],function(_0x39fd3b){var _0x328192={};_0x328192[_0x39fd3b]={'$like':'%'+_0x559c6c[_0x12cd('0x57')][_0x12cd('0x66')]+'%'};return _0x328192;})});}_0x37c833=_[_0x12cd('0x64')]({},_0x37c833,_0x559c6c[_0x12cd('0x80')]);return _0x2d22fb[_0x12cd('0x11b')](_0x37c833);}})[_0x12cd('0x13')](function(_0x3ee4f1){if(_0x3ee4f1){_0xaffe48=_0x3ee4f1['length'];if(!_0x559c6c[_0x12cd('0x57')]['hasOwnProperty'](_0x12cd('0x5f'))){_0x37c833[_0x12cd('0x24')]=qs[_0x12cd('0x24')](_0x559c6c[_0x12cd('0x57')][_0x12cd('0x24')]);_0x37c833[_0x12cd('0x22')]=qs[_0x12cd('0x22')](_0x559c6c[_0x12cd('0x57')][_0x12cd('0x22')]);}return _0x2d22fb['getProactiveActions'](_0x37c833);}})['then'](function(_0x988c01){if(_0x988c01){return _0x988c01?{'count':_0xaffe48,'rows':_0x988c01}:null;}})['then'](respondWithResult(_0x138d75,null))[_0x12cd('0x1e')](handleError(_0x138d75,null));};exports[_0x12cd('0x11d')]=function(_0x588f5e,_0x597a66){var _0x2ae8cf=_0x588f5e[_0x12cd('0x57')][_0x12cd('0x11e')]==='false'?_0x12cd('0x11f'):_0x12cd('0x120');return db['ChatWebsite'][_0x12cd('0x6e')]({'attributes':['id',_0x2ae8cf],'where':{'id':_0x588f5e[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x597a66,null))['then'](function(_0x141659){if(_0x141659){var _0x5c4204=_0x141659[_0x2ae8cf];var _0x118052=_0x5c4204&&_0x5c4204[_0x12cd('0x121')]?_0x5c4204[_0x12cd('0x121')]:[];_0x597a66[_0x12cd('0x2d')]({'fromKey':_[_0x12cd('0x8a')](_0x5c4204['fromKey'])?undefined:_0x5c4204[_0x12cd('0x122')],'count':_0x118052[_0x12cd('0x5d')],'rows':_0x118052});}})[_0x12cd('0x1e')](handleError(_0x597a66,null));};exports['getOfflineMessages']=function(_0x232d5a,_0xb0a2fe){var _0x10f4df={'raw':![],'where':{}};var _0x3925e0={};var _0x706fe7={'count':0x0,'rows':[]};return db[_0x12cd('0x53')][_0x12cd('0x7b')]({'where':{'id':_0x232d5a[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0xb0a2fe,null))[_0x12cd('0x13')](function(_0x32b4b2){if(_0x32b4b2){_0x3925e0['model']=_[_0x12cd('0x58')](db[_0x12cd('0xd6')][_0x12cd('0x54')]);_0x3925e0[_0x12cd('0x57')]=_[_0x12cd('0x58')](_0x232d5a['query']);_0x3925e0[_0x12cd('0x59')]=_['intersection'](_0x3925e0[_0x12cd('0x4e')],_0x3925e0[_0x12cd('0x57')]);_0x10f4df[_0x12cd('0x5b')]=_[_0x12cd('0x5a')](_0x3925e0[_0x12cd('0x4e')],qs[_0x12cd('0x5c')](_0x232d5a[_0x12cd('0x57')]['fields']));_0x10f4df[_0x12cd('0x5b')]=_0x10f4df[_0x12cd('0x5b')]['length']?_0x10f4df[_0x12cd('0x5b')]:_0x3925e0[_0x12cd('0x4e')];if(!_0x232d5a[_0x12cd('0x57')][_0x12cd('0x5e')](_0x12cd('0x5f'))){_0x10f4df[_0x12cd('0x24')]=qs[_0x12cd('0x24')](_0x232d5a[_0x12cd('0x57')][_0x12cd('0x24')]);_0x10f4df[_0x12cd('0x22')]=qs[_0x12cd('0x22')](_0x232d5a[_0x12cd('0x57')][_0x12cd('0x22')]);}_0x10f4df[_0x12cd('0x60')]=qs[_0x12cd('0x61')](_0x232d5a[_0x12cd('0x57')][_0x12cd('0x61')]);_0x10f4df[_0x12cd('0x63')]=qs[_0x12cd('0x59')](_[_0x12cd('0x62')](_0x232d5a[_0x12cd('0x57')],_0x3925e0['filters']));_0x10f4df[_0x12cd('0x63')][_0x12cd('0x78')]=_0x32b4b2['id'];if(_0x232d5a['query'][_0x12cd('0x66')]){_0x10f4df[_0x12cd('0x63')]=_[_0x12cd('0x64')](_0x10f4df[_0x12cd('0x63')],{'$or':_['map'](_0x10f4df[_0x12cd('0x5b')],function(_0x1a404d){var _0x4a34b2={};_0x4a34b2[_0x1a404d]={'$like':'%'+_0x232d5a[_0x12cd('0x57')][_0x12cd('0x66')]+'%'};return _0x4a34b2;})});}_0x10f4df=_[_0x12cd('0x64')]({},_0x10f4df,_0x232d5a[_0x12cd('0x80')]);return db['ChatOfflineMessage'][_0x12cd('0x25')]({'where':_0x10f4df[_0x12cd('0x63')]})[_0x12cd('0x13')](function(_0x40a626){_0x706fe7['count']=_0x40a626;if(_0x232d5a[_0x12cd('0x57')][_0x12cd('0x67')]){_0x10f4df['include']=[{'all':!![]}];}else{_0x10f4df[_0x12cd('0x68')]=[{'model':db[_0x12cd('0x9a')],'as':'Contact','required':![]},{'model':db[_0x12cd('0xde')],'as':_0x12cd('0x123'),'required':![]}];}return db[_0x12cd('0xd6')][_0x12cd('0x69')](_0x10f4df);})[_0x12cd('0x13')](function(_0x73f51e){_0x706fe7[_0x12cd('0x6a')]=_0x73f51e;return _0x706fe7;});}})[_0x12cd('0x13')](respondWithFilteredResult(_0xb0a2fe,_0x10f4df))[_0x12cd('0x1e')](handleError(_0xb0a2fe,null));};exports[_0x12cd('0x124')]=function(_0x165029,_0x24308b){return db[_0x12cd('0x53')]['find']({'where':{'id':_0x165029[_0x12cd('0x6c')]['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x24308b,null))[_0x12cd('0x13')](function(_0x114bed){if(_0x114bed){return _0x114bed[_0x12cd('0x124')](_0x165029[_0x12cd('0x70')]['ids'],_[_0x12cd('0xf4')](_0x165029[_0x12cd('0x70')],[_0x12cd('0xf3'),'id'])||{})[_0x12cd('0xad')](function(_0x336f67){for(var _0x2501e1=0x0;_0x2501e1<_0x165029[_0x12cd('0x70')][_0x12cd('0xf3')][_0x12cd('0x5d')];_0x2501e1+=0x1){socket[_0x12cd('0x125')](_0x12cd('0x126'),{'UserId':Number(_0x165029[_0x12cd('0x70')][_0x12cd('0xf3')][_0x2501e1]),'ChatWebsiteId':Number(_0x165029['params']['id'])});}return _0x336f67;});}})[_0x12cd('0x13')](respondWithResult(_0x24308b,null))[_0x12cd('0x1e')](handleError(_0x24308b,null));};exports[_0x12cd('0x127')]=function(_0x1791fc,_0x3af55c){return db[_0x12cd('0x53')]['find']({'where':{'id':_0x1791fc[_0x12cd('0x6c')]['id']}})['then'](handleEntityNotFound(_0x3af55c,null))[_0x12cd('0x13')](function(_0x12ad1c){if(_0x12ad1c){return _0x12ad1c[_0x12cd('0x127')](_0x1791fc[_0x12cd('0x57')][_0x12cd('0xf3')])[_0x12cd('0x13')](function(){if(_[_0x12cd('0x128')](_0x1791fc[_0x12cd('0x57')][_0x12cd('0xf3')])){for(var _0x2a869c=0x0;_0x2a869c<_0x1791fc[_0x12cd('0x57')][_0x12cd('0xf3')][_0x12cd('0x5d')];_0x2a869c+=0x1){socket[_0x12cd('0x125')](_0x12cd('0x129'),{'UserId':Number(_0x1791fc['query'][_0x12cd('0xf3')][_0x2a869c]),'ChatWebsiteId':Number(_0x1791fc[_0x12cd('0x6c')]['id'])});}}else{socket[_0x12cd('0x125')](_0x12cd('0x129'),{'UserId':Number(_0x1791fc[_0x12cd('0x57')][_0x12cd('0xf3')]),'ChatWebsiteId':Number(_0x1791fc['params']['id'])});}});}})[_0x12cd('0x13')](respondWithStatusCode(_0x3af55c,null))[_0x12cd('0x1e')](handleError(_0x3af55c,null));};exports[_0x12cd('0x12a')]=function(_0x9c4ca1,_0x3cbc6a){var _0x318e78={};var _0x4a4c49={};var _0x1e63c2;var _0x46fd04;return db[_0x12cd('0x53')][_0x12cd('0x7b')]({'where':{'id':_0x9c4ca1['params']['id']}})[_0x12cd('0x13')](handleEntityNotFound(_0x3cbc6a,null))[_0x12cd('0x13')](function(_0x32d3ec){if(_0x32d3ec){_0x1e63c2=_0x32d3ec;_0x4a4c49['model']=_['keys'](db[_0x12cd('0xc0')][_0x12cd('0x54')]);_0x4a4c49[_0x12cd('0x57')]=_[_0x12cd('0x58')](_0x9c4ca1['query']);_0x4a4c49[_0x12cd('0x59')]=_[_0x12cd('0x5a')](_0x4a4c49['model'],_0x4a4c49[_0x12cd('0x57')]);_0x318e78[_0x12cd('0x5b')]=_[_0x12cd('0x5a')](_0x4a4c49[_0x12cd('0x4e')],qs[_0x12cd('0x5c')](_0x9c4ca1['query'][_0x12cd('0x5c')]));_0x318e78[_0x12cd('0x5b')]=_0x318e78['attributes'][_0x12cd('0x5d')]?_0x318e78[_0x12cd('0x5b')]:_0x4a4c49['model'];_0x318e78['order']=qs['sort'](_0x9c4ca1['query'][_0x12cd('0x61')]);_0x318e78[_0x12cd('0x63')]=qs[_0x12cd('0x59')](_[_0x12cd('0x62')](_0x9c4ca1[_0x12cd('0x57')],_0x4a4c49[_0x12cd('0x59')]));if(_0x9c4ca1[_0x12cd('0x57')][_0x12cd('0x66')]){_0x318e78['where']=_[_0x12cd('0x64')](_0x318e78['where'],{'$or':_[_0x12cd('0x38')](_0x318e78[_0x12cd('0x5b')],function(_0x151e5f){var _0x45dde9={};_0x45dde9[_0x151e5f]={'$like':'%'+_0x9c4ca1[_0x12cd('0x57')][_0x12cd('0x66')]+'%'};return _0x45dde9;})});}_0x318e78=_['merge']({},_0x318e78,_0x9c4ca1[_0x12cd('0x80')]);return _0x1e63c2[_0x12cd('0x12a')](_0x318e78);}})['then'](function(_0x99e510){if(_0x99e510){_0x46fd04=_0x99e510['length'];if(!_0x9c4ca1[_0x12cd('0x57')]['hasOwnProperty'](_0x12cd('0x5f'))){_0x318e78['limit']=qs[_0x12cd('0x24')](_0x9c4ca1[_0x12cd('0x57')]['limit']);_0x318e78[_0x12cd('0x22')]=qs[_0x12cd('0x22')](_0x9c4ca1['query']['offset']);}return _0x1e63c2['getAgents'](_0x318e78);}})[_0x12cd('0x13')](function(_0x3c8420){if(_0x3c8420){return _0x3c8420?{'count':_0x46fd04,'rows':_0x3c8420}:null;}})[_0x12cd('0x13')](respondWithResult(_0x3cbc6a,null))[_0x12cd('0x1e')](handleError(_0x3cbc6a,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 499cf84..d908614 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 _0xdc03=['update','remove','emit','hasOwnProperty','hook','events','ChatWebsite','setMaxListeners'];(function(_0x5817e6,_0x44a2d0){var _0x51916a=function(_0x1a56e3){while(--_0x1a56e3){_0x5817e6['push'](_0x5817e6['shift']());}};_0x51916a(++_0x44a2d0);}(_0xdc03,0x65));var _0x3dc0=function(_0x272dc7,_0xddef1e){_0x272dc7=_0x272dc7-0x0;var _0x540f00=_0xdc03[_0x272dc7];return _0x540f00;};'use strict';var EventEmitter=require(_0x3dc0('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x3dc0('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3dc0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3dc0('0x3'),'afterDestroy':_0x3dc0('0x4')};function emitEvent(_0x2971c1){return function(_0x10c75a,_0x3b41f0,_0x221975){ChatWebsiteEvents['emit'](_0x2971c1+':'+_0x10c75a['id'],_0x10c75a);ChatWebsiteEvents[_0x3dc0('0x5')](_0x2971c1,_0x10c75a);_0x221975(null);};}for(var e in events){if(events[_0x3dc0('0x6')](e)){var event=events[e];ChatWebsite[_0x3dc0('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x98d3=['events','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x5ca9bb,_0x2ce05c){var _0x1b2a34=function(_0x2e5426){while(--_0x2e5426){_0x5ca9bb['push'](_0x5ca9bb['shift']());}};_0x1b2a34(++_0x2ce05c);}(_0x98d3,0x173));var _0x398d=function(_0x2cd8b0,_0x20b66a){_0x2cd8b0=_0x2cd8b0-0x0;var _0xd5fbcf=_0x98d3[_0x2cd8b0];return _0xd5fbcf;};'use strict';var EventEmitter=require(_0x398d('0x0'));var ChatWebsite=require(_0x398d('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x398d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x398d('0x3'),'afterDestroy':'remove'};function emitEvent(_0x465d4a){return function(_0x41f57c,_0x4f7a58,_0x547cbc){ChatWebsiteEvents[_0x398d('0x4')](_0x465d4a+':'+_0x41f57c['id'],_0x41f57c);ChatWebsiteEvents[_0x398d('0x4')](_0x465d4a,_0x41f57c);_0x547cbc(null);};}for(var e in events){if(events[_0x398d('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x398d('0x6')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 7d1215e..0811bd3 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 _0x8b77=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8b77,0x155));var _0x78b7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8b77[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x78b7('0x0'));var logger=require('../../config/logger')(_0x78b7('0x1'));var moment=require(_0x78b7('0x2'));var BPromise=require(_0x78b7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x78b7('0x4'));var rimraf=require(_0x78b7('0x5'));var config=require(_0x78b7('0x6'));var attributes=require(_0x78b7('0x7'));module[_0x78b7('0x8')]=function(_0x80a212,_0x4b5c23){return _0x80a212[_0x78b7('0x9')](_0x78b7('0xa'),attributes,{'tableName':_0x78b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x505c=['exports','ChatWebsite','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0x505c,0x10a));var _0xc505=function(_0x3441bb,_0x11052c){_0x3441bb=_0x3441bb-0x0;var _0xd94568=_0x505c[_0x3441bb];return _0xd94568;};'use strict';var _=require(_0xc505('0x0'));var util=require(_0xc505('0x1'));var logger=require(_0xc505('0x2'))('api');var moment=require(_0xc505('0x3'));var BPromise=require(_0xc505('0x4'));var rp=require(_0xc505('0x5'));var fs=require('fs');var path=require(_0xc505('0x6'));var rimraf=require(_0xc505('0x7'));var config=require('../../config/environment');var attributes=require(_0xc505('0x8'));module[_0xc505('0x9')]=function(_0x2ba66b,_0x4d0e53){return _0x2ba66b['define'](_0xc505('0xa'),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 614dde3..d6a9a4f 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 _0xfda4=['ChatWebsite,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3f903b,_0x243493){var _0x5d8519=function(_0x3e6d5d){while(--_0x3e6d5d){_0x3f903b['push'](_0x3f903b['shift']());}};_0x5d8519(++_0x243493);}(_0xfda4,0x17b));var _0x4fda=function(_0x472ca8,_0x2c8c37){_0x472ca8=_0x472ca8-0x0;var _0x14c783=_0xfda4[_0x472ca8];return _0x14c783;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4fda('0x0'));var BPromise=require(_0x4fda('0x1'));var rs=require(_0x4fda('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4fda('0x3'))(_0x4fda('0x4'));var config=require(_0x4fda('0x5'));var jayson=require(_0x4fda('0x6'));var client=jayson[_0x4fda('0x7')][_0x4fda('0x8')]({'port':0x232a});config[_0x4fda('0x9')]=_[_0x4fda('0xa')](config[_0x4fda('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4fda('0xb'))(new Redis(config[_0x4fda('0x9')]));require(_0x4fda('0xc'))[_0x4fda('0xd')](socket);function respondWithRpcPromise(_0x273341,_0x183da2,_0x4c33b8){return new BPromise(function(_0xbecaeb,_0x1b32d0){return client[_0x4fda('0xe')](_0x273341,_0x4c33b8)[_0x4fda('0xf')](function(_0x432845){logger[_0x4fda('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x183da2,_0x4fda('0x11'));logger['debug'](_0x4fda('0x12'),_0x183da2,_0x4fda('0x11'),JSON['stringify'](_0x432845));if(_0x432845[_0x4fda('0x13')]){if(_0x432845[_0x4fda('0x13')][_0x4fda('0x14')]===0x1f4){logger[_0x4fda('0x13')](_0x4fda('0x15'),_0x183da2,_0x432845[_0x4fda('0x13')][_0x4fda('0x16')]);return _0x1b32d0(_0x432845[_0x4fda('0x13')][_0x4fda('0x16')]);}logger[_0x4fda('0x13')](_0x4fda('0x15'),_0x183da2,_0x432845[_0x4fda('0x13')][_0x4fda('0x16')]);return _0xbecaeb(_0x432845[_0x4fda('0x13')]['message']);}else{logger['info'](_0x4fda('0x15'),_0x183da2,_0x4fda('0x11'));_0xbecaeb(_0x432845[_0x4fda('0x17')]['message']);}})[_0x4fda('0x18')](function(_0x4b51e0){logger[_0x4fda('0x13')](_0x4fda('0x15'),_0x183da2,_0x4b51e0);_0x1b32d0(_0x4b51e0);});});} \ No newline at end of file +var _0x6835=['request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\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','redis','defaults','localhost','./chatWebsite.socket'];(function(_0x132fd3,_0x4352e8){var _0x5ce659=function(_0x17c5a4){while(--_0x17c5a4){_0x132fd3['push'](_0x132fd3['shift']());}};_0x5ce659(++_0x4352e8);}(_0x6835,0xc1));var _0x5683=function(_0x3cba89,_0x5a2845){_0x3cba89=_0x3cba89-0x0;var _0x25c1c5=_0x6835[_0x3cba89];return _0x25c1c5;};'use strict';var _=require(_0x5683('0x0'));var util=require(_0x5683('0x1'));var moment=require(_0x5683('0x2'));var BPromise=require(_0x5683('0x3'));var rs=require(_0x5683('0x4'));var fs=require('fs');var Redis=require(_0x5683('0x5'));var db=require(_0x5683('0x6'))['db'];var utils=require(_0x5683('0x7'));var logger=require(_0x5683('0x8'))(_0x5683('0x9'));var config=require(_0x5683('0xa'));var jayson=require(_0x5683('0xb'));var client=jayson[_0x5683('0xc')]['http']({'port':0x232a});config[_0x5683('0xd')]=_[_0x5683('0xe')](config[_0x5683('0xd')],{'host':_0x5683('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5683('0x10'))['register'](socket);function respondWithRpcPromise(_0x45ea00,_0x1da7ad,_0x2fa270){return new BPromise(function(_0x944285,_0x3a42c2){return client[_0x5683('0x11')](_0x45ea00,_0x2fa270)[_0x5683('0x12')](function(_0x2b31bc){logger[_0x5683('0x13')](_0x5683('0x14'),_0x1da7ad,_0x5683('0x15'));logger[_0x5683('0x16')](_0x5683('0x17'),_0x1da7ad,_0x5683('0x15'),JSON[_0x5683('0x18')](_0x2b31bc));if(_0x2b31bc[_0x5683('0x19')]){if(_0x2b31bc[_0x5683('0x19')][_0x5683('0x1a')]===0x1f4){logger['error'](_0x5683('0x14'),_0x1da7ad,_0x2b31bc[_0x5683('0x19')][_0x5683('0x1b')]);return _0x3a42c2(_0x2b31bc[_0x5683('0x19')]['message']);}logger[_0x5683('0x19')](_0x5683('0x14'),_0x1da7ad,_0x2b31bc[_0x5683('0x19')][_0x5683('0x1b')]);return _0x944285(_0x2b31bc['error']['message']);}else{logger[_0x5683('0x13')](_0x5683('0x14'),_0x1da7ad,_0x5683('0x15'));_0x944285(_0x2b31bc[_0x5683('0x1c')][_0x5683('0x1b')]);}})[_0x5683('0x1d')](function(_0x535f10){logger[_0x5683('0x19')](_0x5683('0x14'),_0x1da7ad,_0x535f10);_0x3a42c2(_0x535f10);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index ee1f3e9..34b9500 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 _0xa435=['save','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x2e655a,_0x6d5799){var _0x26f13b=function(_0x2dd535){while(--_0x2dd535){_0x2e655a['push'](_0x2e655a['shift']());}};_0x26f13b(++_0x6d5799);}(_0xa435,0xe7));var _0x5a43=function(_0x363b90,_0x25fb45){_0x363b90=_0x363b90-0x0;var _0x5e7841=_0xa435[_0x363b90];return _0x5e7841;};'use strict';var ChatWebsiteEvents=require(_0x5a43('0x0'));var events=[_0x5a43('0x1'),'remove',_0x5a43('0x2')];function createListener(_0x45aa05,_0x518c13){return function(_0x2a26c6){_0x518c13[_0x5a43('0x3')](_0x45aa05,_0x2a26c6);};}function removeListener(_0x445d57,_0x14e889){return function(){ChatWebsiteEvents[_0x5a43('0x4')](_0x445d57,_0x14e889);};}exports[_0x5a43('0x5')]=function(_0x457f7d){for(var _0x5764ef=0x0,_0x2aa524=events[_0x5a43('0x6')];_0x5764ef<_0x2aa524;_0x5764ef++){var _0x102930=events[_0x5764ef];var _0x1149fe=createListener(_0x5a43('0x7')+_0x102930,_0x457f7d);ChatWebsiteEvents['on'](_0x102930,_0x1149fe);}}; \ No newline at end of file +var _0xcfa5=['./chatWebsite.events','save','update','emit','removeListener','chatWebsite:'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xcfa5,0xc6));var _0x5cfa=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xcfa5[_0x2641f9];return _0x585741;};'use strict';var ChatWebsiteEvents=require(_0x5cfa('0x0'));var events=[_0x5cfa('0x1'),'remove',_0x5cfa('0x2')];function createListener(_0xaca869,_0x172bde){return function(_0x176b06){_0x172bde[_0x5cfa('0x3')](_0xaca869,_0x176b06);};}function removeListener(_0x3ff5e1,_0x453ff0){return function(){ChatWebsiteEvents[_0x5cfa('0x4')](_0x3ff5e1,_0x453ff0);};}exports['register']=function(_0x9f649f){for(var _0x15448c=0x0,_0x278774=events['length'];_0x15448c<_0x278774;_0x15448c++){var _0x372666=events[_0x15448c];var _0x14e777=createListener(_0x5cfa('0x5')+_0x372666,_0x9f649f);ChatWebsiteEvents['on'](_0x372666,_0x14e777);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 8be3bd3..7e7d53a 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 _0x3c9c=['put','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id','show','/:id/dispositions','getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getAgents','post','create','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','join','addAvatar','/:id/customer_avatar','addCustomerAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','/:id/users','addAgents'];(function(_0x463b5e,_0x13d524){var _0x379243=function(_0x3dabb3){while(--_0x3dabb3){_0x463b5e['push'](_0x463b5e['shift']());}};_0x379243(++_0x13d524);}(_0x3c9c,0x9f));var _0xc3c9=function(_0x11eade,_0x162e34){_0x11eade=_0x11eade-0x0;var _0x3b948f=_0x3c9c[_0x11eade];return _0x3b948f;};'use strict';var multer=require(_0xc3c9('0x0'));var util=require(_0xc3c9('0x1'));var path=require('path');var timeout=require(_0xc3c9('0x2'));var express=require(_0xc3c9('0x3'));var router=express[_0xc3c9('0x4')]();var fs_extra=require(_0xc3c9('0x5'));var auth=require(_0xc3c9('0x6'));var interaction=require(_0xc3c9('0x7'));var config=require(_0xc3c9('0x8'));var controller=require('./chatWebsite.controller');router[_0xc3c9('0x9')]('/',auth['isAuthenticated'](),controller[_0xc3c9('0xa')]);router[_0xc3c9('0x9')]('/describe',auth[_0xc3c9('0xb')](),controller['describe']);router[_0xc3c9('0x9')](_0xc3c9('0xc'),auth[_0xc3c9('0xb')](),controller[_0xc3c9('0xd')]);router[_0xc3c9('0x9')](_0xc3c9('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xc3c9('0x9')]('/:id/canned_answers',auth[_0xc3c9('0xb')](),controller[_0xc3c9('0xf')]);router[_0xc3c9('0x9')]('/:id/logo',controller[_0xc3c9('0x10')]);router[_0xc3c9('0x9')](_0xc3c9('0x11'),controller[_0xc3c9('0x12')]);router['get']('/:id/customer_avatar',controller[_0xc3c9('0x13')]);router[_0xc3c9('0x9')]('/:id/system_avatar',controller[_0xc3c9('0x14')]);router[_0xc3c9('0x9')](_0xc3c9('0x15'),auth[_0xc3c9('0xb')](),controller[_0xc3c9('0x16')]);router['get'](_0xc3c9('0x17'),controller[_0xc3c9('0x18')]);router[_0xc3c9('0x9')]('/:id/applications',auth[_0xc3c9('0xb')](),controller[_0xc3c9('0x19')]);router[_0xc3c9('0x9')](_0xc3c9('0x1a'),auth[_0xc3c9('0xb')](),controller[_0xc3c9('0x1b')]);router[_0xc3c9('0x9')](_0xc3c9('0x1c'),controller[_0xc3c9('0x1d')]);router[_0xc3c9('0x9')](_0xc3c9('0x1e'),auth[_0xc3c9('0xb')](),controller['getOfflineMessages']);router[_0xc3c9('0x9')]('/:id/users',auth[_0xc3c9('0xb')](),controller[_0xc3c9('0x1f')]);router[_0xc3c9('0x20')]('/',auth[_0xc3c9('0xb')](),controller[_0xc3c9('0x21')]);router[_0xc3c9('0x20')](_0xc3c9('0xe'),auth[_0xc3c9('0xb')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0xc3c9('0xb')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xc3c9('0x22')]({'destination':function(_0x59d73e,_0x48ceaa,_0x306e60){_0x306e60(null,path['join'](config[_0xc3c9('0x23')],_0xc3c9('0x24')));},'filename':function(_0x20a334,_0xa3cb87,_0x264c31){_0x264c31(null,util[_0xc3c9('0x25')](_0xc3c9('0x26'),Date[_0xc3c9('0x27')](),_0xa3cb87[_0xc3c9('0x28')]));}})});router[_0xc3c9('0x20')]('/:id/logo',upload[_0xc3c9('0x29')](_0xc3c9('0x2a')),controller[_0xc3c9('0x2b')]);var upload=multer({'storage':multer[_0xc3c9('0x22')]({'destination':function(_0x5c0733,_0x6e787,_0x4f76aa){_0x4f76aa(null,path[_0xc3c9('0x2c')](config[_0xc3c9('0x23')],'server/files/images/avatars/'));},'filename':function(_0x324206,_0xad3a38,_0x5812da){_0x5812da(null,util[_0xc3c9('0x25')]('%s-%s',Date[_0xc3c9('0x27')](),_0xad3a38['originalname']));}})});router['post'](_0xc3c9('0x11'),upload[_0xc3c9('0x29')]('file'),controller[_0xc3c9('0x2d')]);var upload=multer({'storage':multer[_0xc3c9('0x22')]({'destination':function(_0x544a94,_0x502314,_0x133ab5){_0x133ab5(null,path[_0xc3c9('0x2c')](config[_0xc3c9('0x23')],'server/files/images/avatars/'));},'filename':function(_0xfc98f5,_0x28df7d,_0x5155ef){_0x5155ef(null,util[_0xc3c9('0x25')](_0xc3c9('0x26'),Date[_0xc3c9('0x27')](),_0x28df7d[_0xc3c9('0x28')]));}})});router[_0xc3c9('0x20')](_0xc3c9('0x2e'),upload[_0xc3c9('0x29')]('file'),controller[_0xc3c9('0x2f')]);var upload=multer({'storage':multer[_0xc3c9('0x22')]({'destination':function(_0x3bdaa5,_0x244c86,_0x32fedf){_0x32fedf(null,path[_0xc3c9('0x2c')](config['root'],_0xc3c9('0x30')));},'filename':function(_0xcccc08,_0x2b8192,_0x2ac8ac){_0x2ac8ac(null,util['format'](_0xc3c9('0x26'),Date['now'](),_0x2b8192[_0xc3c9('0x28')]));}})});router[_0xc3c9('0x20')]('/:id/system_avatar',upload['single']('file'),controller[_0xc3c9('0x31')]);router[_0xc3c9('0x20')](_0xc3c9('0x32'),controller[_0xc3c9('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0xc3c9('0x22')]({'destination':function(_0x38b459,_0x5d7438,_0x58ead2){const _0x3f20f0=path[_0xc3c9('0x2c')](config[_0xc3c9('0x23')],_0xc3c9('0x34'),_0xc3c9('0x35'),_0xc3c9('0x36'));fs_extra['ensureDir'](_0x3f20f0,function(){_0x58ead2(null,_0x3f20f0);});},'filename':function(_0x6f9d5c,_0x228bf4,_0x538ad3){const _0x2ac978=_0x228bf4[_0xc3c9('0x28')][_0xc3c9('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1357b7=path[_0xc3c9('0x38')](_0x2ac978);const _0x4a75e4=Date[_0xc3c9('0x27')]()+'-'+_0x2ac978[_0xc3c9('0x37')](_0x1357b7,'')+_0x1357b7;_0x538ad3(null,_0x4a75e4);}})});router[_0xc3c9('0x20')](_0xc3c9('0x39'),offlineUploadMulter[_0xc3c9('0x3a')](),controller[_0xc3c9('0x3b')]);router[_0xc3c9('0x20')]('/:id/interactions',auth[_0xc3c9('0xb')](),controller[_0xc3c9('0x3c')]);router[_0xc3c9('0x20')](_0xc3c9('0x3d'),auth[_0xc3c9('0xb')](),controller[_0xc3c9('0x3e')]);router[_0xc3c9('0x20')](_0xc3c9('0x1a'),auth[_0xc3c9('0xb')](),controller[_0xc3c9('0x3f')]);router[_0xc3c9('0x20')](_0xc3c9('0x40'),auth['isAuthenticated'](),controller[_0xc3c9('0x41')]);router[_0xc3c9('0x42')](_0xc3c9('0xc'),auth[_0xc3c9('0xb')](),controller[_0xc3c9('0x43')]);router[_0xc3c9('0x44')](_0xc3c9('0xc'),auth[_0xc3c9('0xb')](),controller[_0xc3c9('0x45')]);router[_0xc3c9('0x44')]('/:id/dispositions',auth[_0xc3c9('0xb')](),controller[_0xc3c9('0x46')]);router['delete'](_0xc3c9('0x47'),auth[_0xc3c9('0xb')](),controller[_0xc3c9('0x48')]);router['delete'](_0xc3c9('0x40'),auth[_0xc3c9('0xb')](),controller[_0xc3c9('0x49')]);module[_0xc3c9('0x4a')]=router; \ No newline at end of file +var _0x2f55=['isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','originalname','addLogo','server/files/images/avatars/','single','addAvatar','diskStorage','file','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','offline','addApplications','addProactiveActions','addAgents','put','destroy','delete','removeDispositions','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get'];(function(_0x5fff96,_0x49b8c8){var _0x5532bc=function(_0x283752){while(--_0x283752){_0x5fff96['push'](_0x5fff96['shift']());}};_0x5532bc(++_0x49b8c8);}(_0x2f55,0x11f));var _0x52f5=function(_0x4254d5,_0x3d3ce9){_0x4254d5=_0x4254d5-0x0;var _0x858b3d=_0x2f55[_0x4254d5];return _0x858b3d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x52f5('0x0'));var timeout=require(_0x52f5('0x1'));var express=require(_0x52f5('0x2'));var router=express[_0x52f5('0x3')]();var fs_extra=require(_0x52f5('0x4'));var auth=require(_0x52f5('0x5'));var interaction=require(_0x52f5('0x6'));var config=require('../../config/environment');var controller=require(_0x52f5('0x7'));router[_0x52f5('0x8')]('/',auth[_0x52f5('0x9')](),controller[_0x52f5('0xa')]);router[_0x52f5('0x8')](_0x52f5('0xb'),auth[_0x52f5('0x9')](),controller[_0x52f5('0xc')]);router[_0x52f5('0x8')](_0x52f5('0xd'),auth[_0x52f5('0x9')](),controller[_0x52f5('0xe')]);router[_0x52f5('0x8')](_0x52f5('0xf'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x10')]);router[_0x52f5('0x8')](_0x52f5('0x11'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x12')]);router[_0x52f5('0x8')](_0x52f5('0x13'),controller[_0x52f5('0x14')]);router[_0x52f5('0x8')](_0x52f5('0x15'),controller['getAvatar']);router['get'](_0x52f5('0x16'),controller[_0x52f5('0x17')]);router[_0x52f5('0x8')](_0x52f5('0x18'),controller[_0x52f5('0x19')]);router[_0x52f5('0x8')](_0x52f5('0x1a'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x52f5('0x8')](_0x52f5('0x1b'),controller[_0x52f5('0x1c')]);router[_0x52f5('0x8')](_0x52f5('0x1d'),auth['isAuthenticated'](),controller[_0x52f5('0x1e')]);router['get'](_0x52f5('0x1f'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x20')]);router[_0x52f5('0x8')](_0x52f5('0x21'),controller['getFields']);router[_0x52f5('0x8')](_0x52f5('0x22'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x23')]);router['get'](_0x52f5('0x24'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x25')]);router[_0x52f5('0x26')]('/',auth['isAuthenticated'](),controller['create']);router[_0x52f5('0x26')](_0x52f5('0xf'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x52f5('0x11'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x48c66d,_0x2faaf7,_0x53bef1){_0x53bef1(null,path[_0x52f5('0x28')](config[_0x52f5('0x29')],_0x52f5('0x2a')));},'filename':function(_0x3aa4da,_0x4e7557,_0x2772ee){_0x2772ee(null,util[_0x52f5('0x2b')](_0x52f5('0x2c'),Date[_0x52f5('0x2d')](),_0x4e7557[_0x52f5('0x2e')]));}})});router[_0x52f5('0x26')](_0x52f5('0x13'),upload['single']('file'),controller[_0x52f5('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3db6f2,_0x55605e,_0x5e613c){_0x5e613c(null,path[_0x52f5('0x28')](config['root'],_0x52f5('0x30')));},'filename':function(_0x4f1533,_0x4fbbd0,_0x4a102a){_0x4a102a(null,util[_0x52f5('0x2b')](_0x52f5('0x2c'),Date[_0x52f5('0x2d')](),_0x4fbbd0['originalname']));}})});router[_0x52f5('0x26')](_0x52f5('0x15'),upload[_0x52f5('0x31')]('file'),controller[_0x52f5('0x32')]);var upload=multer({'storage':multer[_0x52f5('0x33')]({'destination':function(_0x58ac90,_0x294cff,_0x138901){_0x138901(null,path[_0x52f5('0x28')](config[_0x52f5('0x29')],_0x52f5('0x30')));},'filename':function(_0x3eb9f7,_0x5b7c62,_0x4c15b0){_0x4c15b0(null,util['format']('%s-%s',Date[_0x52f5('0x2d')](),_0x5b7c62[_0x52f5('0x2e')]));}})});router[_0x52f5('0x26')](_0x52f5('0x16'),upload['single'](_0x52f5('0x34')),controller[_0x52f5('0x35')]);var upload=multer({'storage':multer[_0x52f5('0x33')]({'destination':function(_0x9e78f5,_0x552b87,_0x52d0ba){_0x52d0ba(null,path[_0x52f5('0x28')](config[_0x52f5('0x29')],_0x52f5('0x30')));},'filename':function(_0x2fa4d1,_0x49af2d,_0x51ea35){_0x51ea35(null,util[_0x52f5('0x2b')](_0x52f5('0x2c'),Date[_0x52f5('0x2d')](),_0x49af2d['originalname']));}})});router[_0x52f5('0x26')](_0x52f5('0x18'),upload[_0x52f5('0x31')](_0x52f5('0x34')),controller[_0x52f5('0x36')]);router[_0x52f5('0x26')](_0x52f5('0x37'),controller[_0x52f5('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x52f5('0x33')]({'destination':function(_0x243780,_0x24da18,_0x397dad){const _0x1e90b6=path[_0x52f5('0x28')](config[_0x52f5('0x29')],_0x52f5('0x39'),_0x52f5('0x3a'),'offline-chat');fs_extra[_0x52f5('0x3b')](_0x1e90b6,function(){_0x397dad(null,_0x1e90b6);});},'filename':function(_0x3d1e33,_0x56619f,_0x334804){const _0x56981d=_0x56619f['originalname'][_0x52f5('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3592e5=path[_0x52f5('0x3d')](_0x56981d);const _0x4fe950=Date[_0x52f5('0x2d')]()+'-'+_0x56981d[_0x52f5('0x3c')](_0x3592e5,'')+_0x3592e5;_0x334804(null,_0x4fe950);}})});router[_0x52f5('0x26')](_0x52f5('0x3e'),offlineUploadMulter[_0x52f5('0x3f')](),controller[_0x52f5('0x40')]);router[_0x52f5('0x26')](_0x52f5('0x1a'),auth[_0x52f5('0x9')](),controller['addInteraction']);router[_0x52f5('0x26')](_0x52f5('0x1d'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x41')]);router[_0x52f5('0x26')](_0x52f5('0x1f'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x42')]);router[_0x52f5('0x26')]('/:id/users',auth[_0x52f5('0x9')](),controller[_0x52f5('0x43')]);router[_0x52f5('0x44')](_0x52f5('0xd'),auth[_0x52f5('0x9')](),controller['update']);router['delete'](_0x52f5('0xd'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x45')]);router[_0x52f5('0x46')](_0x52f5('0xf'),auth[_0x52f5('0x9')](),controller[_0x52f5('0x47')]);router[_0x52f5('0x46')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x52f5('0x46')](_0x52f5('0x24'),auth['isAuthenticated'](),controller[_0x52f5('0x48')]);module[_0x52f5('0x49')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index b669d27..a335853 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ba4=['env','production','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','express','../config/environment'];(function(_0x12fb17,_0xfb6eb6){var _0x56a609=function(_0x877d01){while(--_0x877d01){_0x12fb17['push'](_0x12fb17['shift']());}};_0x56a609(++_0xfb6eb6);}(_0x1ba4,0x17e));var _0x41ba=function(_0x245505,_0x18c203){_0x245505=_0x245505-0x0;var _0x2dfa0d=_0x1ba4[_0x245505];return _0x2dfa0d;};var beaverLogger=require('beaver-logger/server');var express=require(_0x41ba('0x0'));var auth=require('../components/auth/service');var config=require(_0x41ba('0x1'));var router=express['Router']();var isProduction=config[_0x41ba('0x2')]===_0x41ba('0x3')||![];function clientSideLogs(_0x31a81d,_0x5377eb,_0x506673){var _0x401578=_0x31a81d['app'][_0x41ba('0x4')](_0x41ba('0x5'));if(!_0x401578){throw new Error(_0x41ba('0x6'));}return beaverLogger[_0x41ba('0x7')]({'uri':_0x41ba('0x8'),'logger':_0x401578,'enableCors':!isProduction})(_0x31a81d,_0x5377eb,_0x506673);}router[_0x41ba('0x9')](auth[_0x41ba('0xa')](),clientSideLogs);module[_0x41ba('0xb')]=router; \ No newline at end of file +var _0xa7fe=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','../config/environment','app','get','client-side-logger'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0xa7fe,0x102));var _0xea7f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa7fe[_0x3dd15e];return _0x231fd0;};var beaverLogger=require(_0xea7f('0x0'));var express=require('express');var auth=require(_0xea7f('0x1'));var config=require(_0xea7f('0x2'));var router=express['Router']();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x3f4c68,_0x2e3d87,_0x5bb30f){var _0xd423f7=_0x3f4c68[_0xea7f('0x3')][_0xea7f('0x4')](_0xea7f('0x5'));if(!_0xd423f7){throw new Error(_0xea7f('0x6'));}return beaverLogger[_0xea7f('0x7')]({'uri':'/client-logs','logger':_0xd423f7,'enableCors':!isProduction})(_0x3f4c68,_0x2e3d87,_0x5bb30f);}router[_0xea7f('0x8')](auth[_0xea7f('0x9')](),clientSideLogs);module[_0xea7f('0xa')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 4b52266..5eaa0c1 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 _0xcf13=['TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x4fa484,_0x306897){var _0x5be185=function(_0x299968){while(--_0x299968){_0x4fa484['push'](_0x4fa484['shift']());}};_0x5be185(++_0x306897);}(_0xcf13,0xf2));var _0x3cf1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf13[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3cf1('0x0'));module[_0x3cf1('0x1')]={'name':{'type':Sequelize[_0x3cf1('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3cf1('0x3')](_0x3cf1('0x4'),'Google',_0x3cf1('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x3cf1('0x3')](_0x3cf1('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0x3cf1('0x2')],'comment':_0x3cf1('0x7')},'data2':{'type':Sequelize[_0x3cf1('0x2')],'comment':_0x3cf1('0x8')},'data3':{'type':Sequelize[_0x3cf1('0x2')],'comment':_0x3cf1('0x9')},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x3cf1('0xa')],'comment':_0x3cf1('0xb')},'data6':{'type':Sequelize[_0x3cf1('0xa')],'comment':_0x3cf1('0xc')},'data7':{'type':Sequelize[_0x3cf1('0xa')],'comment':_0x3cf1('0xd')}}; \ No newline at end of file +var _0x7e5c=['MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0x7e5c,0x7e));var _0xc7e5=function(_0x2e18a9,_0x2ae8c2){_0x2e18a9=_0x2e18a9-0x0;var _0x39d8d7=_0x7e5c[_0x2e18a9];return _0x39d8d7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc7e5('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc7e5('0x1')](_0xc7e5('0x2'),_0xc7e5('0x3'),_0xc7e5('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xc7e5('0x1')](_0xc7e5('0x5'),'Dynamics365')},'data1':{'type':Sequelize[_0xc7e5('0x0')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xc7e5('0x0')],'comment':_0xc7e5('0x6')},'data4':{'type':Sequelize['STRING'],'comment':_0xc7e5('0x7')},'data5':{'type':Sequelize[_0xc7e5('0x8')],'comment':_0xc7e5('0x9')},'data6':{'type':Sequelize[_0xc7e5('0x8')],'comment':_0xc7e5('0xa')},'data7':{'type':Sequelize['TEXT'],'comment':_0xc7e5('0xb')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 1112ad9..0bb2a45 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 _0xe25e=['ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','localhost','socket.io-emitter','redis','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','padEnd','slice','map','CloudProvider','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','includeAll','find','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','catch','params','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','state','parse','from','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','code','data5','access_token','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash'];(function(_0x48ffb9,_0x1155de){var _0x4da8a8=function(_0x40a759){while(--_0x40a759){_0x48ffb9['push'](_0x48ffb9['shift']());}};_0x4da8a8(++_0x1155de);}(_0xe25e,0x177));var _0xee25=function(_0x53a489,_0x4855b4){_0x53a489=_0x53a489-0x0;var _0x239ddc=_0xe25e[_0x53a489];return _0x239ddc;};'use strict';var _=require(_0xee25('0x0'));var Redis=require(_0xee25('0x1'));var qs=require(_0xee25('0x2'));var encryptor=require(_0xee25('0x3'));var config=require(_0xee25('0x4'));var logger=require(_0xee25('0x5'))(_0xee25('0x6'));var db=require(_0xee25('0x7'))['db'];var oauth=require(_0xee25('0x8'));config['redis']=_[_0xee25('0x9')](config['redis'],{'host':_0xee25('0xa'),'port':0x18eb});var socket=require(_0xee25('0xb'))(new Redis(config[_0xee25('0xc')]));var redis=new Redis(config[_0xee25('0xc')]);function respondWithStatusCode(_0x3fc608,_0x522951){_0x522951=_0x522951||0xcc;return function(_0x495684){if(_0x495684){return _0x3fc608[_0xee25('0xd')](_0x522951);}return _0x3fc608[_0xee25('0xe')](_0x522951)[_0xee25('0xf')]();};}function respondWithResult(_0x590629,_0x478281){_0x478281=_0x478281||0xc8;return function(_0x9c9bcb){if(_0x9c9bcb){return _0x590629[_0xee25('0xe')](_0x478281)[_0xee25('0x10')](_0x9c9bcb);}};}function respondWithFilteredResult(_0xf117fa,_0x1dfa30){return function(_0xf6f368){if(_0xf6f368){var _0x329e1a=typeof _0x1dfa30[_0xee25('0x11')]===_0xee25('0x12')&&typeof _0x1dfa30[_0xee25('0x13')]==='undefined';var _0x1fe203=_0xf6f368[_0xee25('0x14')];var _0x52bae1=_0x329e1a?0x0:_0x1dfa30[_0xee25('0x11')];var _0x36cd43=_0x329e1a?_0xf6f368['count']:_0x1dfa30[_0xee25('0x11')]+_0x1dfa30[_0xee25('0x13')];var _0x520b53;if(_0x36cd43>=_0x1fe203){_0x36cd43=_0x1fe203;_0x520b53=0xc8;}else{_0x520b53=0xce;}_0xf117fa[_0xee25('0xe')](_0x520b53);return _0xf117fa[_0xee25('0x15')](_0xee25('0x16'),_0x52bae1+'-'+_0x36cd43+'/'+_0x1fe203)[_0xee25('0x10')](_0xf6f368);}return null;};}function saveUpdates(_0x1bd475){return function(_0x31b484){if(_0x31b484){return _0x31b484[_0xee25('0x17')](_0x1bd475)[_0xee25('0x18')](function(_0x4b1c1d){return _0x4b1c1d;});}return null;};}function removeEntity(_0x57d4c6){return function(_0x37a50e){if(_0x37a50e){return _0x37a50e[_0xee25('0x19')]()[_0xee25('0x18')](function(){_0x57d4c6[_0xee25('0xe')](0xcc)[_0xee25('0xf')]();});}};}function handleEntityNotFound(_0x513ef9){return function(_0x4ddbc0){if(!_0x4ddbc0){_0x513ef9[_0xee25('0xd')](0x194);}return _0x4ddbc0;};}function handleError(_0x3f605b,_0x5bc267){_0x5bc267=_0x5bc267||0x1f4;return function(_0x858d8b){logger[_0xee25('0x1a')](_0x858d8b[_0xee25('0x1b')]);if(_0x858d8b[_0xee25('0x1c')]){delete _0x858d8b[_0xee25('0x1c')];}_0x3f605b[_0xee25('0xe')](_0x5bc267)[_0xee25('0x1d')](_0x858d8b);};}function maskClientSecret(_0x594224){return _[_0xee25('0x1e')](_0x594224[_0xee25('0x1f')](0x0,0x3),0x14,'*');}exports['index']=function(_0x3e1f43,_0x5490e3){var _0x31f6c3={},_0x575da4={},_0x10624b={'count':0x0,'rows':[]};var _0x18652b=_[_0xee25('0x20')](db[_0xee25('0x21')][_0xee25('0x22')],function(_0x2ecaab){return{'name':_0x2ecaab['fieldName'],'type':_0x2ecaab[_0xee25('0x23')][_0xee25('0x24')]};});_0x575da4['model']=_[_0xee25('0x20')](_0x18652b,_0xee25('0x1c'));_0x575da4[_0xee25('0x25')]=_[_0xee25('0x26')](_0x3e1f43[_0xee25('0x25')]);_0x575da4['filters']=_[_0xee25('0x27')](_0x575da4[_0xee25('0x28')],_0x575da4[_0xee25('0x25')]);_0x31f6c3[_0xee25('0x29')]=_[_0xee25('0x27')](_0x575da4[_0xee25('0x28')],qs[_0xee25('0x2a')](_0x3e1f43[_0xee25('0x25')][_0xee25('0x2a')]));_0x31f6c3['attributes']=_0x31f6c3[_0xee25('0x29')][_0xee25('0x2b')]?_0x31f6c3[_0xee25('0x29')]:_0x575da4[_0xee25('0x28')];if(!_0x3e1f43[_0xee25('0x25')][_0xee25('0x2c')]('nolimit')){_0x31f6c3[_0xee25('0x13')]=qs['limit'](_0x3e1f43[_0xee25('0x25')][_0xee25('0x13')]);_0x31f6c3[_0xee25('0x11')]=qs[_0xee25('0x11')](_0x3e1f43[_0xee25('0x25')][_0xee25('0x11')]);}_0x31f6c3[_0xee25('0x2d')]=qs[_0xee25('0x2e')](_0x3e1f43[_0xee25('0x25')][_0xee25('0x2e')]);_0x31f6c3[_0xee25('0x2f')]=qs[_0xee25('0x30')](_[_0xee25('0x31')](_0x3e1f43[_0xee25('0x25')],_0x575da4[_0xee25('0x30')]),_0x18652b);if(_0x3e1f43[_0xee25('0x25')]['filter']){_0x31f6c3['where']=_['merge'](_0x31f6c3[_0xee25('0x2f')],{'$or':_[_0xee25('0x20')](_0x18652b,function(_0x34c06c){if(_0x34c06c['type']!=='VIRTUAL'){var _0x345fa9={};_0x345fa9[_0x34c06c[_0xee25('0x1c')]]={'$like':'%'+_0x3e1f43[_0xee25('0x25')][_0xee25('0x32')]+'%'};return _0x345fa9;}})});}_0x31f6c3=_[_0xee25('0x33')]({},_0x31f6c3,_0x3e1f43[_0xee25('0x34')]);var _0x65bdaa={'where':_0x31f6c3[_0xee25('0x2f')]};return db[_0xee25('0x21')][_0xee25('0x14')](_0x65bdaa)[_0xee25('0x18')](function(_0x5205e3){_0x10624b[_0xee25('0x14')]=_0x5205e3;if(_0x3e1f43['query']['includeAll']){_0x31f6c3[_0xee25('0x35')]=[{'all':!![]}];}return db[_0xee25('0x21')][_0xee25('0x36')](_0x31f6c3);})[_0xee25('0x18')](function(_0x37e066){_0x10624b[_0xee25('0x37')]=_[_0xee25('0x20')](_0x37e066,function(_0x5315c0){if(_0x5315c0[_0xee25('0x38')]===_0xee25('0x39')){var _0x279d51=encryptor[_0xee25('0x3a')](_0x5315c0['data3']);_0x5315c0[_0xee25('0x3b')]=maskClientSecret(_0x279d51);}return _0x5315c0;});return _0x10624b;})[_0xee25('0x18')](respondWithFilteredResult(_0x5490e3,_0x31f6c3))['catch'](handleError(_0x5490e3,null));};exports[_0xee25('0x3c')]=function(_0x4317be,_0x52f3d3){var _0xca8b98={'raw':!![],'where':{'id':_0x4317be['params']['id']}},_0x209f00={};_0x209f00[_0xee25('0x28')]=_['keys'](db[_0xee25('0x21')][_0xee25('0x22')]);_0x209f00['query']=_[_0xee25('0x26')](_0x4317be[_0xee25('0x25')]);_0x209f00[_0xee25('0x30')]=_[_0xee25('0x27')](_0x209f00[_0xee25('0x28')],_0x209f00[_0xee25('0x25')]);_0xca8b98[_0xee25('0x29')]=_[_0xee25('0x27')](_0x209f00[_0xee25('0x28')],qs['fields'](_0x4317be[_0xee25('0x25')][_0xee25('0x2a')]));_0xca8b98[_0xee25('0x29')]=_0xca8b98[_0xee25('0x29')][_0xee25('0x2b')]?_0xca8b98[_0xee25('0x29')]:_0x209f00[_0xee25('0x28')];if(_0x4317be[_0xee25('0x25')][_0xee25('0x3d')]){_0xca8b98['include']=[{'all':!![]}];}_0xca8b98=_[_0xee25('0x33')]({},_0xca8b98,_0x4317be[_0xee25('0x34')]);return db['CloudProvider'][_0xee25('0x3e')](_0xca8b98)[_0xee25('0x18')](handleEntityNotFound(_0x52f3d3,null))['then'](function(_0x3e816f){if(_0x3e816f['service']==='MicrosoftAzure'){var _0x5ac705=encryptor[_0xee25('0x3a')](_0x3e816f[_0xee25('0x3b')]);_0x3e816f[_0xee25('0x3b')]=maskClientSecret(_0x5ac705);}return _0x3e816f;})['then'](respondWithResult(_0x52f3d3,null))['catch'](handleError(_0x52f3d3,null));};exports[_0xee25('0x3f')]=function(_0x5ed9db,_0x1b93c){if(!_0x5ed9db[_0xee25('0x40')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x5ed9db['body'][_0xee25('0x38')])throw new Error(_0xee25('0x41'));var _0x202f38=db[_0xee25('0x21')][_0xee25('0x22')][_0xee25('0x38')][_0xee25('0x42')];if(!_0x202f38[_0xee25('0x43')](_0x5ed9db[_0xee25('0x40')][_0xee25('0x38')]))throw new Error(_0xee25('0x44')+_0x202f38['join'](',\x20'));if(_0x5ed9db[_0xee25('0x40')][_0xee25('0x38')]==='MicrosoftAzure'&&_0x5ed9db[_0xee25('0x40')][_0xee25('0x3b')]){_0x5ed9db[_0xee25('0x40')][_0xee25('0x3b')]=encryptor[_0xee25('0x45')](_0x5ed9db['body'][_0xee25('0x3b')]);}return db[_0xee25('0x21')][_0xee25('0x3f')](_0x5ed9db[_0xee25('0x40')],{})[_0xee25('0x18')](respondWithResult(_0x1b93c,0xc9))[_0xee25('0x46')](handleError(_0x1b93c,null));};exports[_0xee25('0x17')]=function(_0x3556f3,_0x38511f){if(_0x3556f3[_0xee25('0x40')]['id']){delete _0x3556f3['body']['id'];}return db[_0xee25('0x21')]['find']({'where':{'id':_0x3556f3[_0xee25('0x47')]['id']}})[_0xee25('0x18')](handleEntityNotFound(_0x38511f,null))['then'](function(_0x355538){if(_0x355538[_0xee25('0x38')]===_0xee25('0x39')&&_0x3556f3['body'][_0xee25('0x3b')]){_0x3556f3['body'][_0xee25('0x3b')]=encryptor[_0xee25('0x45')](_0x3556f3[_0xee25('0x40')][_0xee25('0x3b')]);}return _0x355538;})['then'](saveUpdates(_0x3556f3[_0xee25('0x40')],null))['then'](respondWithResult(_0x38511f,null))[_0xee25('0x46')](handleError(_0x38511f,null));};exports[_0xee25('0x19')]=function(_0x52a8fc,_0x695fb5){return db[_0xee25('0x21')][_0xee25('0x3e')]({'where':{'id':_0x52a8fc['params']['id']}})[_0xee25('0x18')](handleEntityNotFound(_0x695fb5,null))[_0xee25('0x18')](removeEntity(_0x695fb5,null))[_0xee25('0x46')](handleError(_0x695fb5,null));};exports[_0xee25('0x48')]=function(_0x245d5a,_0x472734){return db[_0xee25('0x21')][_0xee25('0x49')]({'where':{'id':_0x245d5a[_0xee25('0x47')]['id']},'raw':!![]})['then'](function(_0x22026e){if(!_0x22026e)return _0x472734[_0xee25('0xd')](0x194);return{'url':oauth[_0xee25('0x4a')](_0x22026e,_0x245d5a[_0xee25('0x4b')]['id'])};})['then'](respondWithResult(_0x472734,null))['catch'](handleError(_0x472734,null));};exports['oauth2MicrosoftCallback']=function(_0x6cddcf,_0x17fbc0){var _0x16393d=_0x6cddcf[_0xee25('0x40')];var _0x34245e;var _0x22e007;if(_0x16393d['error'])throw _0x16393d;redis[_0xee25('0x4c')](_0x16393d[_0xee25('0x4d')])['then'](function(_0x3fa321){if(!_0x3fa321)throw new Error('Invalid\x20state\x20parameter');_0x34245e=JSON[_0xee25('0x4e')](_0x3fa321);var _0x298d39=Buffer[_0xee25('0x4f')](_0x16393d[_0xee25('0x4d')],'base64')[_0xee25('0x50')](_0xee25('0x51'));_0x22e007=JSON[_0xee25('0x4e')](_0x298d39);if(!oauth['isValidIdToken'](_0x16393d[_0xee25('0x52')],_0x34245e[_0xee25('0x53')]))throw new Error(_0xee25('0x54'));redis['del'](_0x16393d[_0xee25('0x4d')]);return oauth['getOauth2MicrosoftAccessToken'](_0x16393d[_0xee25('0x55')],_0x34245e);})['then'](function(_0x3fa696){_0x34245e[_0xee25('0x56')]=_0x3fa696[_0xee25('0x57')];_0x34245e['data6']=_0x3fa696[_0xee25('0x58')];return db['CloudProvider']['update']({'data5':_0x34245e[_0xee25('0x56')],'data6':_0x34245e['data6']},{'where':{'id':_0x34245e['id']}});})['then'](function(){oauth[_0xee25('0x59')](_0x34245e);socket[_0xee25('0x5a')](_0xee25('0x5b'),{'id':_0x22e007['id']});return;})[_0xee25('0x18')](respondWithStatusCode(_0x17fbc0,null))[_0xee25('0x46')](function(_0x49d575){if(_0x22e007){socket[_0xee25('0x5a')]('microsoftAuthorization:error',{'id':_0x22e007['id']});}if(!_0x34245e){logger['error'](_0xee25('0x5c'),_0x49d575);return _0x17fbc0[_0xee25('0xe')](0x1f4)['send'](_0x49d575['message']);}logger[_0xee25('0x1a')](_0xee25('0x5d'),_0x34245e['id'],JSON['stringify'](_0x49d575));});}; \ No newline at end of file +var _0x4e89=['generateMicrosoftAuthorizationUrl','user','error','get','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','stack','name','send','slice','map','CloudProvider','fieldName','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','service','MicrosoftAzure','decryptString','data3','show','params','rawAttributes','fields','length','include','find','catch','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','findOne'];(function(_0x542503,_0x3074d1){var _0x3b1d94=function(_0x1cbbe9){while(--_0x1cbbe9){_0x542503['push'](_0x542503['shift']());}};_0x3b1d94(++_0x3074d1);}(_0x4e89,0x81));var _0x94e8=function(_0x28b07c,_0x162ebe){_0x28b07c=_0x28b07c-0x0;var _0x25eda7=_0x4e89[_0x28b07c];return _0x25eda7;};'use strict';var _=require('lodash');var Redis=require(_0x94e8('0x0'));var qs=require(_0x94e8('0x1'));var encryptor=require(_0x94e8('0x2'));var config=require(_0x94e8('0x3'));var logger=require(_0x94e8('0x4'))(_0x94e8('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x94e8('0x6'));config[_0x94e8('0x7')]=_[_0x94e8('0x8')](config[_0x94e8('0x7')],{'host':_0x94e8('0x9'),'port':0x18eb});var socket=require(_0x94e8('0xa'))(new Redis(config[_0x94e8('0x7')]));var redis=new Redis(config[_0x94e8('0x7')]);function respondWithStatusCode(_0x40359e,_0x5e92f5){_0x5e92f5=_0x5e92f5||0xcc;return function(_0xf1bdc0){if(_0xf1bdc0){return _0x40359e[_0x94e8('0xb')](_0x5e92f5);}return _0x40359e[_0x94e8('0xc')](_0x5e92f5)[_0x94e8('0xd')]();};}function respondWithResult(_0x1a5743,_0x863cc){_0x863cc=_0x863cc||0xc8;return function(_0x2a3a5d){if(_0x2a3a5d){return _0x1a5743[_0x94e8('0xc')](_0x863cc)[_0x94e8('0xe')](_0x2a3a5d);}};}function respondWithFilteredResult(_0x87a5a8,_0x47653a){return function(_0x42e25f){if(_0x42e25f){var _0x517a1a=typeof _0x47653a[_0x94e8('0xf')]==='undefined'&&typeof _0x47653a[_0x94e8('0x10')]===_0x94e8('0x11');var _0x511bff=_0x42e25f[_0x94e8('0x12')];var _0x24a63d=_0x517a1a?0x0:_0x47653a[_0x94e8('0xf')];var _0x2941c6=_0x517a1a?_0x42e25f[_0x94e8('0x12')]:_0x47653a[_0x94e8('0xf')]+_0x47653a['limit'];var _0x15ba6a;if(_0x2941c6>=_0x511bff){_0x2941c6=_0x511bff;_0x15ba6a=0xc8;}else{_0x15ba6a=0xce;}_0x87a5a8[_0x94e8('0xc')](_0x15ba6a);return _0x87a5a8[_0x94e8('0x13')](_0x94e8('0x14'),_0x24a63d+'-'+_0x2941c6+'/'+_0x511bff)['json'](_0x42e25f);}return null;};}function saveUpdates(_0x566e1f){return function(_0x321698){if(_0x321698){return _0x321698[_0x94e8('0x15')](_0x566e1f)[_0x94e8('0x16')](function(_0x53e11c){return _0x53e11c;});}return null;};}function removeEntity(_0x27ccdd){return function(_0x838ca1){if(_0x838ca1){return _0x838ca1[_0x94e8('0x17')]()[_0x94e8('0x16')](function(){_0x27ccdd[_0x94e8('0xc')](0xcc)[_0x94e8('0xd')]();});}};}function handleEntityNotFound(_0x18077b){return function(_0x434517){if(!_0x434517){_0x18077b[_0x94e8('0xb')](0x194);}return _0x434517;};}function handleError(_0x20d86e,_0x25f928){_0x25f928=_0x25f928||0x1f4;return function(_0x3c2230){logger['error'](_0x3c2230[_0x94e8('0x18')]);if(_0x3c2230['name']){delete _0x3c2230[_0x94e8('0x19')];}_0x20d86e['status'](_0x25f928)[_0x94e8('0x1a')](_0x3c2230);};}function maskClientSecret(_0x35b4d2){return _['padEnd'](_0x35b4d2[_0x94e8('0x1b')](0x0,0x3),0x14,'*');}exports['index']=function(_0x58bceb,_0x3e3ce3){var _0x2fec76={},_0x4665b3={},_0x2c614f={'count':0x0,'rows':[]};var _0x1be93d=_[_0x94e8('0x1c')](db[_0x94e8('0x1d')]['rawAttributes'],function(_0x9ba625){return{'name':_0x9ba625[_0x94e8('0x1e')],'type':_0x9ba625[_0x94e8('0x1f')][_0x94e8('0x20')]};});_0x4665b3[_0x94e8('0x21')]=_[_0x94e8('0x1c')](_0x1be93d,_0x94e8('0x19'));_0x4665b3['query']=_[_0x94e8('0x22')](_0x58bceb[_0x94e8('0x23')]);_0x4665b3[_0x94e8('0x24')]=_[_0x94e8('0x25')](_0x4665b3[_0x94e8('0x21')],_0x4665b3[_0x94e8('0x23')]);_0x2fec76[_0x94e8('0x26')]=_[_0x94e8('0x25')](_0x4665b3[_0x94e8('0x21')],qs['fields'](_0x58bceb[_0x94e8('0x23')]['fields']));_0x2fec76[_0x94e8('0x26')]=_0x2fec76[_0x94e8('0x26')]['length']?_0x2fec76[_0x94e8('0x26')]:_0x4665b3['model'];if(!_0x58bceb[_0x94e8('0x23')][_0x94e8('0x27')](_0x94e8('0x28'))){_0x2fec76[_0x94e8('0x10')]=qs[_0x94e8('0x10')](_0x58bceb[_0x94e8('0x23')][_0x94e8('0x10')]);_0x2fec76[_0x94e8('0xf')]=qs[_0x94e8('0xf')](_0x58bceb['query']['offset']);}_0x2fec76['order']=qs[_0x94e8('0x29')](_0x58bceb[_0x94e8('0x23')][_0x94e8('0x29')]);_0x2fec76[_0x94e8('0x2a')]=qs['filters'](_[_0x94e8('0x2b')](_0x58bceb['query'],_0x4665b3[_0x94e8('0x24')]),_0x1be93d);if(_0x58bceb['query'][_0x94e8('0x2c')]){_0x2fec76['where']=_[_0x94e8('0x2d')](_0x2fec76[_0x94e8('0x2a')],{'$or':_[_0x94e8('0x1c')](_0x1be93d,function(_0x38c719){if(_0x38c719[_0x94e8('0x1f')]!==_0x94e8('0x2e')){var _0x1d724f={};_0x1d724f[_0x38c719[_0x94e8('0x19')]]={'$like':'%'+_0x58bceb['query']['filter']+'%'};return _0x1d724f;}})});}_0x2fec76=_['merge']({},_0x2fec76,_0x58bceb[_0x94e8('0x2f')]);var _0x42cbf4={'where':_0x2fec76[_0x94e8('0x2a')]};return db['CloudProvider'][_0x94e8('0x12')](_0x42cbf4)[_0x94e8('0x16')](function(_0x1e31db){_0x2c614f[_0x94e8('0x12')]=_0x1e31db;if(_0x58bceb[_0x94e8('0x23')]['includeAll']){_0x2fec76['include']=[{'all':!![]}];}return db[_0x94e8('0x1d')][_0x94e8('0x30')](_0x2fec76);})[_0x94e8('0x16')](function(_0x21bd6c){_0x2c614f['rows']=_[_0x94e8('0x1c')](_0x21bd6c,function(_0x452dbf){if(_0x452dbf[_0x94e8('0x31')]===_0x94e8('0x32')){var _0x2e95f9=encryptor[_0x94e8('0x33')](_0x452dbf[_0x94e8('0x34')]);_0x452dbf[_0x94e8('0x34')]=maskClientSecret(_0x2e95f9);}return _0x452dbf;});return _0x2c614f;})['then'](respondWithFilteredResult(_0x3e3ce3,_0x2fec76))['catch'](handleError(_0x3e3ce3,null));};exports[_0x94e8('0x35')]=function(_0x28c8ca,_0x44b5f5){var _0x107fe7={'raw':!![],'where':{'id':_0x28c8ca[_0x94e8('0x36')]['id']}},_0x371426={};_0x371426[_0x94e8('0x21')]=_[_0x94e8('0x22')](db[_0x94e8('0x1d')][_0x94e8('0x37')]);_0x371426['query']=_[_0x94e8('0x22')](_0x28c8ca['query']);_0x371426[_0x94e8('0x24')]=_[_0x94e8('0x25')](_0x371426[_0x94e8('0x21')],_0x371426[_0x94e8('0x23')]);_0x107fe7['attributes']=_[_0x94e8('0x25')](_0x371426[_0x94e8('0x21')],qs['fields'](_0x28c8ca[_0x94e8('0x23')][_0x94e8('0x38')]));_0x107fe7[_0x94e8('0x26')]=_0x107fe7[_0x94e8('0x26')][_0x94e8('0x39')]?_0x107fe7[_0x94e8('0x26')]:_0x371426['model'];if(_0x28c8ca['query']['includeAll']){_0x107fe7[_0x94e8('0x3a')]=[{'all':!![]}];}_0x107fe7=_['merge']({},_0x107fe7,_0x28c8ca[_0x94e8('0x2f')]);return db['CloudProvider'][_0x94e8('0x3b')](_0x107fe7)[_0x94e8('0x16')](handleEntityNotFound(_0x44b5f5,null))['then'](function(_0x11e514){if(_0x11e514[_0x94e8('0x31')]===_0x94e8('0x32')){var _0x295821=encryptor[_0x94e8('0x33')](_0x11e514['data3']);_0x11e514['data3']=maskClientSecret(_0x295821);}return _0x11e514;})[_0x94e8('0x16')](respondWithResult(_0x44b5f5,null))[_0x94e8('0x3c')](handleError(_0x44b5f5,null));};exports['create']=function(_0x409d6b,_0xc0d208){if(!_0x409d6b[_0x94e8('0x3d')]['name'])throw new Error(_0x94e8('0x3e'));if(!_0x409d6b[_0x94e8('0x3d')][_0x94e8('0x31')])throw new Error(_0x94e8('0x3f'));var _0x55de39=db['CloudProvider']['rawAttributes'][_0x94e8('0x31')][_0x94e8('0x40')];if(!_0x55de39[_0x94e8('0x41')](_0x409d6b['body']['service']))throw new Error(_0x94e8('0x42')+_0x55de39[_0x94e8('0x43')](',\x20'));if(_0x409d6b[_0x94e8('0x3d')][_0x94e8('0x31')]===_0x94e8('0x32')&&_0x409d6b[_0x94e8('0x3d')][_0x94e8('0x34')]){_0x409d6b[_0x94e8('0x3d')]['data3']=encryptor[_0x94e8('0x44')](_0x409d6b[_0x94e8('0x3d')][_0x94e8('0x34')]);}return db[_0x94e8('0x1d')][_0x94e8('0x45')](_0x409d6b[_0x94e8('0x3d')],{})[_0x94e8('0x16')](respondWithResult(_0xc0d208,0xc9))[_0x94e8('0x3c')](handleError(_0xc0d208,null));};exports[_0x94e8('0x15')]=function(_0x10df82,_0x42f57d){if(_0x10df82[_0x94e8('0x3d')]['id']){delete _0x10df82[_0x94e8('0x3d')]['id'];}return db[_0x94e8('0x1d')]['find']({'where':{'id':_0x10df82[_0x94e8('0x36')]['id']}})[_0x94e8('0x16')](handleEntityNotFound(_0x42f57d,null))[_0x94e8('0x16')](function(_0x5668a8){if(_0x5668a8['service']===_0x94e8('0x32')&&_0x10df82[_0x94e8('0x3d')][_0x94e8('0x34')]){_0x10df82[_0x94e8('0x3d')][_0x94e8('0x34')]=encryptor['encryptString'](_0x10df82['body']['data3']);}return _0x5668a8;})[_0x94e8('0x16')](saveUpdates(_0x10df82[_0x94e8('0x3d')],null))[_0x94e8('0x16')](respondWithResult(_0x42f57d,null))['catch'](handleError(_0x42f57d,null));};exports[_0x94e8('0x17')]=function(_0x1919ce,_0x4fe895){return db[_0x94e8('0x1d')][_0x94e8('0x3b')]({'where':{'id':_0x1919ce[_0x94e8('0x36')]['id']}})[_0x94e8('0x16')](handleEntityNotFound(_0x4fe895,null))[_0x94e8('0x16')](removeEntity(_0x4fe895,null))[_0x94e8('0x3c')](handleError(_0x4fe895,null));};exports['oauth2MicrosoftAuthorize']=function(_0x213732,_0x30f319){return db[_0x94e8('0x1d')][_0x94e8('0x46')]({'where':{'id':_0x213732[_0x94e8('0x36')]['id']},'raw':!![]})[_0x94e8('0x16')](function(_0x16d987){if(!_0x16d987)return _0x30f319['sendStatus'](0x194);return{'url':oauth[_0x94e8('0x47')](_0x16d987,_0x213732[_0x94e8('0x48')]['id'])};})[_0x94e8('0x16')](respondWithResult(_0x30f319,null))[_0x94e8('0x3c')](handleError(_0x30f319,null));};exports['oauth2MicrosoftCallback']=function(_0x3fba08,_0x19145e){var _0x47da11=_0x3fba08[_0x94e8('0x3d')];var _0x50542d;var _0x149c71;if(_0x47da11[_0x94e8('0x49')])throw _0x47da11;redis[_0x94e8('0x4a')](_0x47da11[_0x94e8('0x4b')])[_0x94e8('0x16')](function(_0x508592){if(!_0x508592)throw new Error(_0x94e8('0x4c'));_0x50542d=JSON['parse'](_0x508592);var _0x59b8aa=Buffer[_0x94e8('0x4d')](_0x47da11[_0x94e8('0x4b')],_0x94e8('0x4e'))[_0x94e8('0x4f')](_0x94e8('0x50'));_0x149c71=JSON[_0x94e8('0x51')](_0x59b8aa);if(!oauth[_0x94e8('0x52')](_0x47da11[_0x94e8('0x53')],_0x50542d[_0x94e8('0x54')]))throw new Error(_0x94e8('0x55'));redis[_0x94e8('0x56')](_0x47da11['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x47da11[_0x94e8('0x57')],_0x50542d);})['then'](function(_0x9658a8){_0x50542d[_0x94e8('0x58')]=_0x9658a8[_0x94e8('0x59')];_0x50542d[_0x94e8('0x5a')]=_0x9658a8[_0x94e8('0x5b')];return db[_0x94e8('0x1d')][_0x94e8('0x15')]({'data5':_0x50542d['data5'],'data6':_0x50542d[_0x94e8('0x5a')]},{'where':{'id':_0x50542d['id']}});})[_0x94e8('0x16')](function(){oauth[_0x94e8('0x5c')](_0x50542d);socket[_0x94e8('0x5d')](_0x94e8('0x5e'),{'id':_0x149c71['id']});return;})[_0x94e8('0x16')](respondWithStatusCode(_0x19145e,null))[_0x94e8('0x3c')](function(_0x2a2b90){if(_0x149c71){socket[_0x94e8('0x5d')](_0x94e8('0x5f'),{'id':_0x149c71['id']});}if(!_0x50542d){logger[_0x94e8('0x49')](_0x94e8('0x60'),_0x2a2b90);return _0x19145e[_0x94e8('0xc')](0x1f4)[_0x94e8('0x1a')](_0x2a2b90[_0x94e8('0x61')]);}logger[_0x94e8('0x49')](_0x94e8('0x62'),_0x50542d['id'],JSON[_0x94e8('0x63')](_0x2a2b90));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index c6a925a..55ff2f3 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 _0x2db4=['moment','bluebird','request-promise','path','../../config/environment','exports','define','CloudProvider','cloud_providers','util','../../config/logger','api'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x2db4,0xd5));var _0x42db=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x2db4[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0x42db('0x0'));var logger=require(_0x42db('0x1'))(_0x42db('0x2'));var moment=require(_0x42db('0x3'));var BPromise=require(_0x42db('0x4'));var rp=require(_0x42db('0x5'));var fs=require('fs');var path=require(_0x42db('0x6'));var rimraf=require('rimraf');var config=require(_0x42db('0x7'));var attributes=require('./cloudProvider.attributes');module[_0x42db('0x8')]=function(_0x1bccb4,_0x3b612c){return _0x1bccb4[_0x42db('0x9')](_0x42db('0xa'),attributes,{'tableName':_0x42db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe93a=['rimraf','../../config/environment','./cloudProvider.attributes','define','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5aebca,_0x47182f){var _0xe24952=function(_0x10a551){while(--_0x10a551){_0x5aebca['push'](_0x5aebca['shift']());}};_0xe24952(++_0x47182f);}(_0xe93a,0x1bf));var _0xae93=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xe93a[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0xae93('0x0'));var util=require(_0xae93('0x1'));var logger=require(_0xae93('0x2'))(_0xae93('0x3'));var moment=require(_0xae93('0x4'));var BPromise=require(_0xae93('0x5'));var rp=require(_0xae93('0x6'));var fs=require('fs');var path=require(_0xae93('0x7'));var rimraf=require(_0xae93('0x8'));var config=require(_0xae93('0x9'));var attributes=require(_0xae93('0xa'));module['exports']=function(_0x3da3fa,_0x140903){return _0x3da3fa[_0xae93('0xb')]('CloudProvider',attributes,{'tableName':_0xae93('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 31f46f1..b277adb 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ed4=['https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','response_type','redirect_uri','data4','response_mode','form_post','scope','nonce','value','oauth2/','data1','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','decryptString','data3','POST','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','../../config/environment','api','redis','defaults','localhost'];(function(_0x389ae9,_0x506e63){var _0x3effc8=function(_0x20d8a4){while(--_0x20d8a4){_0x389ae9['push'](_0x389ae9['shift']());}};_0x3effc8(++_0x506e63);}(_0x0ed4,0x1d0));var _0x40ed=function(_0x22342c,_0x218835){_0x22342c=_0x22342c-0x0;var _0xd3b434=_0x0ed4[_0x22342c];return _0xd3b434;};'use strict';var _=require(_0x40ed('0x0'));var crypto=require(_0x40ed('0x1'));var jwt=require(_0x40ed('0x2'));var moment=require(_0x40ed('0x3'));var Redis=require(_0x40ed('0x4'));var rp=require('request-promise');var util=require('util');var encryptor=require('../../components/encryptor');var config=require(_0x40ed('0x5'));var logger=require('../../config/logger')(_0x40ed('0x6'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0x40ed('0x7')]=_[_0x40ed('0x8')](config[_0x40ed('0x7')],{'host':_0x40ed('0x9'),'port':0x18eb});var redis=new Redis(config[_0x40ed('0x7')]);var MICROSOFT_AUTH_URL=_0x40ed('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0x40ed('0xb'),_0x40ed('0xc'),'email',_0x40ed('0xd'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0x40ed('0xe')],'Dynamics365':[_0x40ed('0xb'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x40ed('0xf');var MICROSOFT_TOKEN_ENDPOINT=_0x40ed('0x10');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5bb5a1){var _0x2b3b4f=_[_0x40ed('0x11')](AZURE_AUTH_SCOPES[_0x5bb5a1['type']]);if(_0x5bb5a1[_0x40ed('0x12')]===_0x40ed('0x13'))_0x2b3b4f[_0x40ed('0x14')](_0x5bb5a1[_0x40ed('0x15')]+_0x40ed('0x16'));return _0x2b3b4f[_0x40ed('0x17')]('\x20');}function getAccessTokenScope(_0xc35046){if(_0xc35046[_0x40ed('0x12')]===_0x40ed('0x18'))return _0x40ed('0x19');if(_0xc35046[_0x40ed('0x12')]==='Dynamics365')return _0xc35046['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x30f7c0,_0x2535a9){var _0x4f3ed8=MICROSOFT_AUTH_URL[_0x40ed('0x1a')](_0x40ed('0x1b'),_0x30f7c0[_0x40ed('0x1c')]);var _0x40ee1b=[_0x40ed('0x1d'),_0x40ed('0x1e')];var _0x35b848=Buffer[_0x40ed('0x1f')](JSON[_0x40ed('0x20')]({'id':_0x2535a9}))[_0x40ed('0x21')](_0x40ed('0x22'));var _0x164011=crypto[_0x40ed('0x23')](0x10)[_0x40ed('0x21')]('hex');var _0x403f98=getAuthorizationScopes(_0x30f7c0);var _0xa5445c=[{'key':'client_id','value':_0x30f7c0['data1']},{'key':_0x40ed('0x24'),'value':encodeURIComponent(_0x40ee1b['join']('\x20'))},{'key':_0x40ed('0x25'),'value':_0x30f7c0[_0x40ed('0x26')]},{'key':_0x40ed('0x27'),'value':_0x40ed('0x28')},{'key':_0x40ed('0x29'),'value':encodeURIComponent(_0x403f98)},{'key':'state','value':_0x35b848},{'key':_0x40ed('0x2a'),'value':_0x164011},{'key':'prompt','value':'login'}];var _0x55d20b=_0x4f3ed8+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x40ed('0x11')](_0xa5445c,function(_0x33d264){return _0x33d264['key']+'='+_0x33d264[_0x40ed('0x2b')];})['join']('&');_0x30f7c0['oauth2Claims']={'issuer':_0x4f3ed8[_0x40ed('0x1a')](_0x40ed('0x2c'),''),'audience':_0x30f7c0[_0x40ed('0x2d')],'state':_0x35b848,'nonce':_0x164011};redis[_0x40ed('0x2e')](_0x35b848,JSON[_0x40ed('0x20')](_0x30f7c0));return _0x55d20b;}function isValidIdToken(_0x24ad16,_0x474962){try{var _0x197f19=jwt[_0x40ed('0x2f')](_0x24ad16,{'complete':!![]});var _0x40eb00=_0x197f19[_0x40ed('0x30')];if(_0x40eb00[_0x40ed('0x31')]!==_0x474962[_0x40ed('0x32')])return![];if(_0x40eb00[_0x40ed('0x33')]!==_0x474962[_0x40ed('0x34')])return![];if(_0x40eb00[_0x40ed('0x2a')]!==_0x474962[_0x40ed('0x2a')])return![];if(moment()[_0x40ed('0x35')](moment[_0x40ed('0x36')](_0x40eb00[_0x40ed('0x37')])))return![];return!![];}catch(_0x12621c){throw _0x12621c;}}function refreshOauth2MicrosoftAccessToken(_0x2680a5){return Promise[_0x40ed('0x38')]()[_0x40ed('0x39')](function(){if(_0x2680a5['data3'])return _0x2680a5;return db[_0x40ed('0x3a')][_0x40ed('0x3b')]({'where':{'id':_0x2680a5['id']},'raw':!![]});})['then'](function(_0x1e286d){var _0x3a5e79={'grant_type':_0x40ed('0x3c'),'refresh_token':_0x1e286d[_0x40ed('0x3d')],'scope':getAccessTokenScope(_0x1e286d),'redirect_uri':_0x1e286d['data4'],'client_id':_0x1e286d['data1'],'client_secret':encryptor[_0x40ed('0x3e')](_0x1e286d[_0x40ed('0x3f')])};var _0x4eb172={'method':_0x40ed('0x40'),'uri':MICROSOFT_AUTH_URL[_0x40ed('0x1a')](_0x40ed('0x1b'),_0x1e286d[_0x40ed('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3a5e79,'json':!![]};return rp(_0x4eb172);})[_0x40ed('0x39')](function(_0x108da5){_0x2680a5[_0x40ed('0x41')]=_0x108da5[_0x40ed('0x42')];_0x2680a5[_0x40ed('0x3d')]=_0x108da5['refresh_token'];return db['CloudProvider'][_0x40ed('0x43')]({'data5':_0x2680a5['data5'],'data6':_0x2680a5[_0x40ed('0x3d')]},{'where':{'id':_0x2680a5['id']}});})['then'](function(){return _0x2680a5;})[_0x40ed('0x44')](function(_0x481a62){logger[_0x40ed('0x45')](_0x40ed('0x46'),_0x2680a5['id'],_0x481a62);});}function getOauth2MicrosoftAccessToken(_0x81782e,_0x30a454){var _0x38c655={'grant_type':_0x40ed('0x47'),'code':_0x81782e,'scope':getAccessTokenScope(_0x30a454),'redirect_uri':_0x30a454[_0x40ed('0x26')],'client_id':_0x30a454[_0x40ed('0x2d')],'client_secret':encryptor[_0x40ed('0x3e')](_0x30a454[_0x40ed('0x3f')])};var _0x5ed4bb={'method':_0x40ed('0x40'),'uri':MICROSOFT_AUTH_URL[_0x40ed('0x1a')](_0x40ed('0x1b'),_0x30a454[_0x40ed('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x38c655,'json':!![]};return rp(_0x5ed4bb);}function startRefreshInterval(_0x523879){var _0x1db4f2=schedule[_0x40ed('0x48')];if(_0x1db4f2[_0x523879['id']])clearInterval(_0x1db4f2[_0x523879['id']]);_0x1db4f2[_0x523879['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x40ed('0x49')](this,{'id':_0x523879['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x40ed('0x48')]=_0x1db4f2;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x40ed('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x2e57b3){var _0x2b4057=_0x2e57b3[_0x40ed('0x11')](function(_0x1641ae){return refreshOauth2MicrosoftAccessToken(_0x1641ae)[_0x40ed('0x39')](function(_0x377b27){startRefreshInterval(_0x377b27);});});return Promise[_0x40ed('0x4b')](_0x2b4057);})[_0x40ed('0x44')](function(_0x26f481){var _0x498778=_0x26f481?util[_0x40ed('0x4c')](_0x26f481,{'showHidden':![],'depth':null}):'';logger['error'](_0x40ed('0x4d'),_0x498778);});}module[_0x40ed('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x6eed=['access_token','data6','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','exports','lodash','crypto','jsonwebtoken','request-promise','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','push','data7','/.default','join','Dynamics365','replace','data2','from','stringify','base64','hex','client_id','data1','response_type','response_mode','form_post','scope','prompt','login','key','value','oauth2Claims','oauth2/','set','payload','iss','issuer','aud','audience','nonce','isAfter','unix','exp','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST','{TENANT_ID}'];(function(_0x5d7cc3,_0x4e5550){var _0xf00bb0=function(_0x4ac4ab){while(--_0x4ac4ab){_0x5d7cc3['push'](_0x5d7cc3['shift']());}};_0xf00bb0(++_0x4e5550);}(_0x6eed,0x17e));var _0xd6ee=function(_0x3fbca8,_0x2e2902){_0x3fbca8=_0x3fbca8-0x0;var _0x47e565=_0x6eed[_0x3fbca8];return _0x47e565;};'use strict';var _=require(_0xd6ee('0x0'));var crypto=require(_0xd6ee('0x1'));var jwt=require(_0xd6ee('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0xd6ee('0x3'));var util=require('util');var encryptor=require('../../components/encryptor');var config=require(_0xd6ee('0x4'));var logger=require(_0xd6ee('0x5'))(_0xd6ee('0x6'));var schedule=require(_0xd6ee('0x7'));var db=require(_0xd6ee('0x8'))['db'];config[_0xd6ee('0x9')]=_['defaults'](config['redis'],{'host':_0xd6ee('0xa'),'port':0x18eb});var redis=new Redis(config[_0xd6ee('0x9')]);var MICROSOFT_AUTH_URL=_0xd6ee('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xd6ee('0xc'),_0xd6ee('0xd'),'email',_0xd6ee('0xe'),_0xd6ee('0xf'),_0xd6ee('0x10'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xd6ee('0xc'),_0xd6ee('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0xd6ee('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0xd6ee('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x460702){var _0x2b4c60=_[_0xd6ee('0x13')](AZURE_AUTH_SCOPES[_0x460702[_0xd6ee('0x14')]]);if(_0x460702[_0xd6ee('0x14')]==='Dynamics365')_0x2b4c60[_0xd6ee('0x15')](_0x460702[_0xd6ee('0x16')]+_0xd6ee('0x17'));return _0x2b4c60[_0xd6ee('0x18')]('\x20');}function getAccessTokenScope(_0x35e0f1){if(_0x35e0f1[_0xd6ee('0x14')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x35e0f1[_0xd6ee('0x14')]===_0xd6ee('0x19'))return _0x35e0f1[_0xd6ee('0x16')]+_0xd6ee('0x17');}function generateMicrosoftAuthorizationUrl(_0x582fb4,_0x412e20){var _0x587e2f=MICROSOFT_AUTH_URL[_0xd6ee('0x1a')]('{TENANT_ID}',_0x582fb4[_0xd6ee('0x1b')]);var _0x2ed29c=['code','id_token'];var _0x4be323=Buffer[_0xd6ee('0x1c')](JSON[_0xd6ee('0x1d')]({'id':_0x412e20}))['toString'](_0xd6ee('0x1e'));var _0x2fd597=crypto['randomBytes'](0x10)['toString'](_0xd6ee('0x1f'));var _0x4760b3=getAuthorizationScopes(_0x582fb4);var _0x142d38=[{'key':_0xd6ee('0x20'),'value':_0x582fb4[_0xd6ee('0x21')]},{'key':_0xd6ee('0x22'),'value':encodeURIComponent(_0x2ed29c[_0xd6ee('0x18')]('\x20'))},{'key':'redirect_uri','value':_0x582fb4['data4']},{'key':_0xd6ee('0x23'),'value':_0xd6ee('0x24')},{'key':_0xd6ee('0x25'),'value':encodeURIComponent(_0x4760b3)},{'key':'state','value':_0x4be323},{'key':'nonce','value':_0x2fd597},{'key':_0xd6ee('0x26'),'value':_0xd6ee('0x27')}];var _0x1db60f=_0x587e2f+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x142d38,function(_0x6b3175){return _0x6b3175[_0xd6ee('0x28')]+'='+_0x6b3175[_0xd6ee('0x29')];})[_0xd6ee('0x18')]('&');_0x582fb4[_0xd6ee('0x2a')]={'issuer':_0x587e2f[_0xd6ee('0x1a')](_0xd6ee('0x2b'),''),'audience':_0x582fb4[_0xd6ee('0x21')],'state':_0x4be323,'nonce':_0x2fd597};redis[_0xd6ee('0x2c')](_0x4be323,JSON[_0xd6ee('0x1d')](_0x582fb4));return _0x1db60f;}function isValidIdToken(_0xc3ac1,_0x48c522){try{var _0x1ffa1c=jwt['decode'](_0xc3ac1,{'complete':!![]});var _0x170b68=_0x1ffa1c[_0xd6ee('0x2d')];if(_0x170b68[_0xd6ee('0x2e')]!==_0x48c522[_0xd6ee('0x2f')])return![];if(_0x170b68[_0xd6ee('0x30')]!==_0x48c522[_0xd6ee('0x31')])return![];if(_0x170b68[_0xd6ee('0x32')]!==_0x48c522[_0xd6ee('0x32')])return![];if(moment()[_0xd6ee('0x33')](moment[_0xd6ee('0x34')](_0x170b68[_0xd6ee('0x35')])))return![];return!![];}catch(_0x121a08){throw _0x121a08;}}function refreshOauth2MicrosoftAccessToken(_0x2a2944){return Promise['resolve']()[_0xd6ee('0x36')](function(){if(_0x2a2944[_0xd6ee('0x37')])return _0x2a2944;return db[_0xd6ee('0x38')][_0xd6ee('0x39')]({'where':{'id':_0x2a2944['id']},'raw':!![]});})['then'](function(_0x542f55){var _0x5ab2a3={'grant_type':_0xd6ee('0x3a'),'refresh_token':_0x542f55['data6'],'scope':getAccessTokenScope(_0x542f55),'redirect_uri':_0x542f55['data4'],'client_id':_0x542f55[_0xd6ee('0x21')],'client_secret':encryptor[_0xd6ee('0x3b')](_0x542f55[_0xd6ee('0x37')])};var _0x563ac5={'method':_0xd6ee('0x3c'),'uri':MICROSOFT_AUTH_URL['replace'](_0xd6ee('0x3d'),_0x542f55[_0xd6ee('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5ab2a3,'json':!![]};return rp(_0x563ac5);})[_0xd6ee('0x36')](function(_0x4f0f65){_0x2a2944['data5']=_0x4f0f65[_0xd6ee('0x3e')];_0x2a2944[_0xd6ee('0x3f')]=_0x4f0f65['refresh_token'];return db['CloudProvider'][_0xd6ee('0x40')]({'data5':_0x2a2944[_0xd6ee('0x41')],'data6':_0x2a2944[_0xd6ee('0x3f')]},{'where':{'id':_0x2a2944['id']}});})['then'](function(){return _0x2a2944;})[_0xd6ee('0x42')](function(_0x56ab07){logger[_0xd6ee('0x43')](_0xd6ee('0x44'),_0x2a2944['id'],_0x56ab07);});}function getOauth2MicrosoftAccessToken(_0x3d4772,_0x20480c){var _0x1e7d6f={'grant_type':_0xd6ee('0x45'),'code':_0x3d4772,'scope':getAccessTokenScope(_0x20480c),'redirect_uri':_0x20480c['data4'],'client_id':_0x20480c[_0xd6ee('0x21')],'client_secret':encryptor[_0xd6ee('0x3b')](_0x20480c[_0xd6ee('0x37')])};var _0x28d969={'method':_0xd6ee('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xd6ee('0x1a')]('{TENANT_ID}',_0x20480c['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1e7d6f,'json':!![]};return rp(_0x28d969);}function startRefreshInterval(_0x2470f5){var _0x1a8551=schedule[_0xd6ee('0x46')];if(_0x1a8551[_0x2470f5['id']])clearInterval(_0x1a8551[_0x2470f5['id']]);_0x1a8551[_0x2470f5['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xd6ee('0x47')](this,{'id':_0x2470f5['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x1a8551;}function startAllRefreshIntervals(){return db[_0xd6ee('0x38')][_0xd6ee('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xd6ee('0x36')](function(_0x4907f9){var _0x5e7372=_0x4907f9[_0xd6ee('0x13')](function(_0x3b7a3a){return refreshOauth2MicrosoftAccessToken(_0x3b7a3a)[_0xd6ee('0x36')](function(_0x2c7e50){startRefreshInterval(_0x2c7e50);});});return Promise['all'](_0x5e7372);})[_0xd6ee('0x42')](function(_0x1a07b4){var _0x98bf78=_0x1a07b4?util['inspect'](_0x1a07b4,{'showHidden':![],'depth':null}):'';logger[_0xd6ee('0x43')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x98bf78);});}module[_0xd6ee('0x49')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index d863a47..21eda5c 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 _0xc6d7=['rpc','../../config/environment','jayson/promise','client','http','request','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1d0f18,_0x3ba667){var _0x2df54a=function(_0x1853a3){while(--_0x1853a3){_0x1d0f18['push'](_0x1d0f18['shift']());}};_0x2df54a(++_0x3ba667);}(_0xc6d7,0x71));var _0x7c6d=function(_0x478517,_0x3733ad){_0x478517=_0x478517-0x0;var _0x1dc7be=_0xc6d7[_0x478517];return _0x1dc7be;};'use strict';var _=require(_0x7c6d('0x0'));var util=require(_0x7c6d('0x1'));var moment=require(_0x7c6d('0x2'));var BPromise=require(_0x7c6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c6d('0x4'))['db'];var utils=require(_0x7c6d('0x5'));var logger=require(_0x7c6d('0x6'))(_0x7c6d('0x7'));var config=require(_0x7c6d('0x8'));var jayson=require(_0x7c6d('0x9'));var client=jayson[_0x7c6d('0xa')][_0x7c6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x446b68,_0x45713e,_0x338f94){return new BPromise(function(_0x1ad7e2,_0x22755d){return client[_0x7c6d('0xc')](_0x446b68,_0x338f94)['then'](function(_0x477a41){logger['info'](_0x7c6d('0xd'),_0x45713e,_0x7c6d('0xe'));logger[_0x7c6d('0xf')](_0x7c6d('0x10'),_0x45713e,'request\x20sent',JSON[_0x7c6d('0x11')](_0x477a41));if(_0x477a41[_0x7c6d('0x12')]){if(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x13')]===0x1f4){logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x477a41[_0x7c6d('0x12')]['message']);return _0x22755d(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);}logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);return _0x1ad7e2(_0x477a41[_0x7c6d('0x12')][_0x7c6d('0x14')]);}else{logger[_0x7c6d('0x15')]('CloudProvider,\x20%s,\x20%s',_0x45713e,_0x7c6d('0xe'));_0x1ad7e2(_0x477a41[_0x7c6d('0x16')]['message']);}})[_0x7c6d('0x17')](function(_0x220bae){logger[_0x7c6d('0x12')](_0x7c6d('0xd'),_0x45713e,_0x220bae);_0x22755d(_0x220bae);});});} \ No newline at end of file +var _0xb4f8=['client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x45da0f,_0x370d35){var _0x3ac5ca=function(_0xd9b600){while(--_0xd9b600){_0x45da0f['push'](_0x45da0f['shift']());}};_0x3ac5ca(++_0x370d35);}(_0xb4f8,0x83));var _0x8b4f=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0xb4f8[_0x2962d5];return _0x273406;};'use strict';var _=require('lodash');var util=require(_0x8b4f('0x0'));var moment=require(_0x8b4f('0x1'));var BPromise=require(_0x8b4f('0x2'));var rs=require(_0x8b4f('0x3'));var fs=require('fs');var Redis=require(_0x8b4f('0x4'));var db=require(_0x8b4f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b4f('0x6'))('rpc');var config=require(_0x8b4f('0x7'));var jayson=require(_0x8b4f('0x8'));var client=jayson[_0x8b4f('0x9')][_0x8b4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2eefde,_0x557bc0,_0x2dfe1c){return new BPromise(function(_0xa91c09,_0x40042b){return client['request'](_0x2eefde,_0x2dfe1c)[_0x8b4f('0xb')](function(_0x13d37a){logger[_0x8b4f('0xc')](_0x8b4f('0xd'),_0x557bc0,_0x8b4f('0xe'));logger['debug'](_0x8b4f('0xf'),_0x557bc0,_0x8b4f('0xe'),JSON['stringify'](_0x13d37a));if(_0x13d37a[_0x8b4f('0x10')]){if(_0x13d37a[_0x8b4f('0x10')]['code']===0x1f4){logger[_0x8b4f('0x10')](_0x8b4f('0xd'),_0x557bc0,_0x13d37a['error'][_0x8b4f('0x11')]);return _0x40042b(_0x13d37a[_0x8b4f('0x10')][_0x8b4f('0x11')]);}logger[_0x8b4f('0x10')]('CloudProvider,\x20%s,\x20%s',_0x557bc0,_0x13d37a[_0x8b4f('0x10')][_0x8b4f('0x11')]);return _0xa91c09(_0x13d37a[_0x8b4f('0x10')][_0x8b4f('0x11')]);}else{logger[_0x8b4f('0xc')](_0x8b4f('0xd'),_0x557bc0,'request\x20sent');_0xa91c09(_0x13d37a[_0x8b4f('0x12')][_0x8b4f('0x11')]);}})[_0x8b4f('0x13')](function(_0x1b4b9f){logger[_0x8b4f('0x10')](_0x8b4f('0xd'),_0x557bc0,_0x1b4b9f);_0x40042b(_0x1b4b9f);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 81114fc..2f0fd77 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 _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x19d685,_0x90a37b){var _0x297d4d=function(_0x425549){while(--_0x425549){_0x19d685['push'](_0x19d685['shift']());}};_0x297d4d(++_0x90a37b);}(_0xadb5,0xad));var _0x5adb=function(_0x32e8ba,_0x44474e){_0x32e8ba=_0x32e8ba-0x0;var _0x17f047=_0xadb5[_0x32e8ba];return _0x17f047;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file +var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x33154d,_0x854047){var _0x3b2f03=function(_0x35f7a6){while(--_0x35f7a6){_0x33154d['push'](_0x33154d['shift']());}};_0x3b2f03(++_0x854047);}(_0x1261,0x144));var _0x1126=function(_0x32b79a,_0xd2538a){_0x32b79a=_0x32b79a-0x0;var _0x483450=_0x1261[_0x32b79a];return _0x483450;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 46a5a37..0bc7d4b 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 _0x4dca=['STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4dca,0x1c0));var _0xa4dc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4dca[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xa4dc('0x0'));module[_0xa4dc('0x1')]={'name':{'type':Sequelize[_0xa4dc('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa4dc('0x2')]},'companyId':{'type':Sequelize[_0xa4dc('0x2')]},'website':{'type':Sequelize[_0xa4dc('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xa4dc('0x2')]},'type':{'type':Sequelize[_0xa4dc('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xa4dc('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa4dc('0x2')]},'email':{'type':Sequelize[_0xa4dc('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa4dc('0x2')]},'sStreet':{'type':Sequelize[_0xa4dc('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xa4dc('0x2')]},'sCountry':{'type':Sequelize[_0xa4dc('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xab99=['STRING','sequelize'];(function(_0x5e27c9,_0x1fffd2){var _0x529849=function(_0x13a2f7){while(--_0x13a2f7){_0x5e27c9['push'](_0x5e27c9['shift']());}};_0x529849(++_0x1fffd2);}(_0xab99,0x1a7));var _0x9ab9=function(_0x228895,_0x16f857){_0x228895=_0x228895-0x0;var _0x40c252=_0xab99[_0x228895];return _0x40c252;};'use strict';var Sequelize=require(_0x9ab9('0x0'));module['exports']={'name':{'type':Sequelize[_0x9ab9('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9ab9('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x9ab9('0x1')]},'phone':{'type':Sequelize[_0x9ab9('0x1')]},'fax':{'type':Sequelize[_0x9ab9('0x1')]},'type':{'type':Sequelize[_0x9ab9('0x1')]},'street':{'type':Sequelize[_0x9ab9('0x1')]},'postalCode':{'type':Sequelize[_0x9ab9('0x1')]},'city':{'type':Sequelize[_0x9ab9('0x1')]},'country':{'type':Sequelize[_0x9ab9('0x1')]},'email':{'type':Sequelize[_0x9ab9('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9ab9('0x1')]},'sStreet':{'type':Sequelize[_0x9ab9('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x9ab9('0x1')]},'sCountry':{'type':Sequelize[_0x9ab9('0x1')]},'description':{'type':Sequelize[_0x9ab9('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 1749818..a81aef0 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 _0xcc64=['CmCompany','describe','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','filter','merge','map','options','count','findAll','rows','catch','show','params','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','omit','ids','getContacts','findOne','length','nolimit','eml-format','fast-json-patch','moment','mustache','util','path','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','name','index'];(function(_0x54786d,_0x487ec5){var _0x588f09=function(_0x1ca5ac){while(--_0x1ca5ac){_0x54786d['push'](_0x54786d['shift']());}};_0x588f09(++_0x487ec5);}(_0xcc64,0xd5));var _0x4cc6=function(_0x24eecb,_0x311df3){_0x24eecb=_0x24eecb-0x0;var _0x5366fe=_0xcc64[_0x24eecb];return _0x5366fe;};'use strict';var emlformat=require(_0x4cc6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4cc6('0x1'));var rp=require('request-promise');var moment=require(_0x4cc6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4cc6('0x3'));var util=require(_0x4cc6('0x4'));var path=require(_0x4cc6('0x5'));var sox=require('sox');var csv=require(_0x4cc6('0x6'));var ejs=require(_0x4cc6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4cc6('0x8'));var crypto=require('crypto');var jsforce=require(_0x4cc6('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x4cc6('0x6'));var querystring=require(_0x4cc6('0xa'));var Papa=require(_0x4cc6('0xb'));var Redis=require(_0x4cc6('0xc'));var authService=require(_0x4cc6('0xd'));var qs=require(_0x4cc6('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4cc6('0xf'));var logger=require(_0x4cc6('0x10'))(_0x4cc6('0x11'));var utils=require(_0x4cc6('0x12'));var config=require(_0x4cc6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x4cc6('0x14'))['db'];function respondWithStatusCode(_0x348b12,_0x4ef568){_0x4ef568=_0x4ef568||0xcc;return function(_0x287e74){if(_0x287e74){return _0x348b12[_0x4cc6('0x15')](_0x4ef568);}return _0x348b12[_0x4cc6('0x16')](_0x4ef568)[_0x4cc6('0x17')]();};}function respondWithResult(_0x241d08,_0x2439ef){_0x2439ef=_0x2439ef||0xc8;return function(_0x19fe15){if(_0x19fe15){return _0x241d08[_0x4cc6('0x16')](_0x2439ef)[_0x4cc6('0x18')](_0x19fe15);}};}function respondWithFilteredResult(_0x38de85,_0x5d1878){return function(_0x200082){if(_0x200082){var _0x4eb252=typeof _0x5d1878[_0x4cc6('0x19')]===_0x4cc6('0x1a')&&typeof _0x5d1878[_0x4cc6('0x1b')]===_0x4cc6('0x1a');var _0x2313d7=_0x200082['count'];var _0x202dc6=_0x4eb252?0x0:_0x5d1878['offset'];var _0x9216c0=_0x4eb252?_0x200082['count']:_0x5d1878['offset']+_0x5d1878[_0x4cc6('0x1b')];var _0x2540c6;if(_0x9216c0>=_0x2313d7){_0x9216c0=_0x2313d7;_0x2540c6=0xc8;}else{_0x2540c6=0xce;}_0x38de85[_0x4cc6('0x16')](_0x2540c6);return _0x38de85[_0x4cc6('0x1c')](_0x4cc6('0x1d'),_0x202dc6+'-'+_0x9216c0+'/'+_0x2313d7)[_0x4cc6('0x18')](_0x200082);}return null;};}function patchUpdates(_0x3246c9){return function(_0x587e16){try{jsonpatch[_0x4cc6('0x1e')](_0x587e16,_0x3246c9,!![]);}catch(_0x21d8fb){return BPromise[_0x4cc6('0x1f')](_0x21d8fb);}return _0x587e16[_0x4cc6('0x20')]();};}function saveUpdates(_0x3013bb,_0x2ca178){return function(_0x376f23){if(_0x376f23){return _0x376f23[_0x4cc6('0x21')](_0x3013bb)[_0x4cc6('0x22')](function(_0x461efa){return _0x461efa;});}return null;};}function removeEntity(_0x4bd61d,_0x193ab1){return function(_0x2cab47){if(_0x2cab47){return _0x2cab47[_0x4cc6('0x23')]()[_0x4cc6('0x22')](function(){var _0x276986=_0x2cab47[_0x4cc6('0x24')]({'plain':!![]});var _0x429164=_0x4cc6('0x25');return db[_0x4cc6('0x26')][_0x4cc6('0x23')]({'where':{'type':_0x429164,'resourceId':_0x276986['id']}})[_0x4cc6('0x22')](function(){return _0x2cab47;});})['then'](function(){_0x4bd61d[_0x4cc6('0x16')](0xcc)[_0x4cc6('0x17')]();});}};}function handleEntityNotFound(_0x95cbb7,_0x4503e6){return function(_0xede3d5){if(!_0xede3d5){_0x95cbb7['sendStatus'](0x194);}return _0xede3d5;};}function handleError(_0x5a66f0,_0x532ee4){_0x532ee4=_0x532ee4||0x1f4;return function(_0xb9daaa){logger[_0x4cc6('0x27')](_0xb9daaa['stack']);if(_0xb9daaa['name']){delete _0xb9daaa[_0x4cc6('0x28')];}_0x5a66f0[_0x4cc6('0x16')](_0x532ee4)['send'](_0xb9daaa);};}exports[_0x4cc6('0x29')]=function(_0x283464,_0x254f65){var _0xbdea66={},_0x3086c0={},_0x5e9423={'count':0x0,'rows':[]};return db[_0x4cc6('0x2a')][_0x4cc6('0x2b')]()[_0x4cc6('0x22')](function(_0x574205){_0x3086c0[_0x4cc6('0x2c')]=_[_0x4cc6('0x2d')](_0x574205);_0x3086c0['query']=_[_0x4cc6('0x2d')](_0x283464[_0x4cc6('0x2e')]);_0x3086c0[_0x4cc6('0x2f')]=_['intersection'](_0x3086c0[_0x4cc6('0x2c')],_0x3086c0['query']);_0xbdea66[_0x4cc6('0x30')]=_[_0x4cc6('0x31')](_0x3086c0[_0x4cc6('0x2c')],qs[_0x4cc6('0x32')](_0x283464['query'][_0x4cc6('0x32')]));_0xbdea66[_0x4cc6('0x30')]=_0xbdea66[_0x4cc6('0x30')]['length']?_0xbdea66[_0x4cc6('0x30')]:_0x3086c0[_0x4cc6('0x2c')];if(!_0x283464[_0x4cc6('0x2e')][_0x4cc6('0x33')]('nolimit')){_0xbdea66[_0x4cc6('0x1b')]=qs[_0x4cc6('0x1b')](_0x283464[_0x4cc6('0x2e')][_0x4cc6('0x1b')]);_0xbdea66['offset']=qs[_0x4cc6('0x19')](_0x283464[_0x4cc6('0x2e')][_0x4cc6('0x19')]);}_0xbdea66[_0x4cc6('0x34')]=qs[_0x4cc6('0x35')](_0x283464['query']['sort']);_0xbdea66[_0x4cc6('0x36')]=qs[_0x4cc6('0x2f')](_['pick'](_0x283464['query'],_0x3086c0[_0x4cc6('0x2f')]),_0x574205);if(_0x283464[_0x4cc6('0x2e')][_0x4cc6('0x37')]){_0xbdea66[_0x4cc6('0x36')]=_[_0x4cc6('0x38')](_0xbdea66[_0x4cc6('0x36')],{'$or':_[_0x4cc6('0x39')](_0xbdea66['attributes'],function(_0x54f090){var _0x120f48={};_0x120f48[_0x54f090]={'$like':'%'+_0x283464[_0x4cc6('0x2e')][_0x4cc6('0x37')]+'%'};return _0x120f48;})});}_0xbdea66=_[_0x4cc6('0x38')]({},_0xbdea66,_0x283464[_0x4cc6('0x3a')]);var _0x4c59d5={'where':_0xbdea66[_0x4cc6('0x36')]};return db[_0x4cc6('0x2a')][_0x4cc6('0x3b')](_0x4c59d5)[_0x4cc6('0x22')](function(_0x4b1692){_0x5e9423['count']=_0x4b1692;if(_0x283464[_0x4cc6('0x2e')]['includeAll']){_0xbdea66['include']=[{'all':!![]}];}return db[_0x4cc6('0x2a')][_0x4cc6('0x3c')](_0xbdea66);})[_0x4cc6('0x22')](function(_0x32a691){_0x5e9423[_0x4cc6('0x3d')]=_0x32a691;return _0x5e9423;})['then'](respondWithFilteredResult(_0x254f65,_0xbdea66))[_0x4cc6('0x3e')](handleError(_0x254f65,null));})[_0x4cc6('0x3e')](handleError(_0x254f65,null));};exports[_0x4cc6('0x3f')]=function(_0x206bd1,_0x3e7af2){var _0x2dc065={'raw':![],'where':{'id':_0x206bd1[_0x4cc6('0x40')]['id']}},_0x2c7509={};_0x2c7509[_0x4cc6('0x2c')]=_['keys'](db[_0x4cc6('0x2a')][_0x4cc6('0x41')]);_0x2c7509[_0x4cc6('0x2e')]=_[_0x4cc6('0x2d')](_0x206bd1[_0x4cc6('0x2e')]);_0x2c7509[_0x4cc6('0x2f')]=_[_0x4cc6('0x31')](_0x2c7509['model'],_0x2c7509['query']);_0x2dc065['attributes']=_[_0x4cc6('0x31')](_0x2c7509[_0x4cc6('0x2c')],qs['fields'](_0x206bd1[_0x4cc6('0x2e')][_0x4cc6('0x32')]));_0x2dc065[_0x4cc6('0x30')]=_0x2dc065[_0x4cc6('0x30')]['length']?_0x2dc065[_0x4cc6('0x30')]:_0x2c7509[_0x4cc6('0x2c')];if(_0x206bd1[_0x4cc6('0x2e')]['includeAll']){_0x2dc065[_0x4cc6('0x42')]=[{'all':!![]}];}_0x2dc065=_[_0x4cc6('0x38')]({},_0x2dc065,_0x206bd1[_0x4cc6('0x3a')]);return db['CmCompany']['find'](_0x2dc065)['then'](handleEntityNotFound(_0x3e7af2,null))[_0x4cc6('0x22')](respondWithResult(_0x3e7af2,null))[_0x4cc6('0x3e')](handleError(_0x3e7af2,null));};exports[_0x4cc6('0x43')]=function(_0x19d316,_0xb85ab){return db[_0x4cc6('0x2a')][_0x4cc6('0x43')](_0x19d316[_0x4cc6('0x44')],{})[_0x4cc6('0x22')](function(_0xbd44ba){var _0x42ed5a=_0x19d316[_0x4cc6('0x45')][_0x4cc6('0x24')]({'plain':!![]});if(!_0x42ed5a)throw new Error(_0x4cc6('0x46'));if(_0x42ed5a[_0x4cc6('0x47')]===_0x4cc6('0x45')){var _0x167bdc=_0xbd44ba['get']({'plain':!![]});var _0x51a531=_0x4cc6('0x25');return db[_0x4cc6('0x48')][_0x4cc6('0x49')]({'where':{'name':_0x51a531,'userProfileId':_0x42ed5a[_0x4cc6('0x4a')]},'raw':!![]})[_0x4cc6('0x22')](function(_0x43712f){if(_0x43712f&&_0x43712f[_0x4cc6('0x4b')]===0x0){return db[_0x4cc6('0x26')][_0x4cc6('0x43')]({'name':_0x167bdc[_0x4cc6('0x28')],'resourceId':_0x167bdc['id'],'type':_0x43712f[_0x4cc6('0x28')],'sectionId':_0x43712f['id']},{})[_0x4cc6('0x22')](function(){return _0xbd44ba;});}else{return _0xbd44ba;}})['catch'](function(_0x5e1b53){logger[_0x4cc6('0x27')](_0x4cc6('0x4c'),_0x5e1b53);throw _0x5e1b53;});}return _0xbd44ba;})['then'](respondWithResult(_0xb85ab,0xc9))[_0x4cc6('0x3e')](handleError(_0xb85ab,null));};exports[_0x4cc6('0x21')]=function(_0x3d50be,_0x3c35f5){if(_0x3d50be[_0x4cc6('0x44')]['id']){delete _0x3d50be[_0x4cc6('0x44')]['id'];}return db[_0x4cc6('0x2a')][_0x4cc6('0x49')]({'where':{'id':_0x3d50be['params']['id']}})['then'](handleEntityNotFound(_0x3c35f5,null))[_0x4cc6('0x22')](saveUpdates(_0x3d50be[_0x4cc6('0x44')],null))['then'](respondWithResult(_0x3c35f5,null))[_0x4cc6('0x3e')](handleError(_0x3c35f5,null));};exports[_0x4cc6('0x23')]=function(_0x400a02,_0x519f81){return db[_0x4cc6('0x2a')][_0x4cc6('0x49')]({'where':{'id':_0x400a02['params']['id']}})[_0x4cc6('0x22')](handleEntityNotFound(_0x519f81,null))[_0x4cc6('0x22')](removeEntity(_0x519f81,null))[_0x4cc6('0x3e')](handleError(_0x519f81,null));};exports[_0x4cc6('0x2b')]=function(_0x274e31,_0xa0106d){return db[_0x4cc6('0x2a')]['describe']()[_0x4cc6('0x22')](respondWithResult(_0xa0106d,null))[_0x4cc6('0x3e')](handleError(_0xa0106d,null));};exports[_0x4cc6('0x4d')]=function(_0x2835e7,_0x227a87,_0x282ca4){return db[_0x4cc6('0x4e')]['find']({'where':{'id':_0x2835e7[_0x4cc6('0x40')]['id']}})[_0x4cc6('0x22')](handleEntityNotFound(_0x227a87,null))[_0x4cc6('0x22')](function(_0x54c7c3){if(_0x54c7c3){return _0x54c7c3[_0x4cc6('0x4d')](_0x2835e7['body']['ids'],_[_0x4cc6('0x4f')](_0x2835e7[_0x4cc6('0x44')],[_0x4cc6('0x50'),'id'])||{});}})[_0x4cc6('0x22')](respondWithResult(_0x227a87,null))[_0x4cc6('0x3e')](handleError(_0x227a87,null));};exports[_0x4cc6('0x51')]=function(_0x105ca5,_0x19b15f,_0x5180fb){var _0x43b2db={};var _0x1fe272={};var _0x257a60;var _0x2f8028;return db['CmCompany'][_0x4cc6('0x52')]({'where':{'id':_0x105ca5[_0x4cc6('0x40')]['id']}})[_0x4cc6('0x22')](handleEntityNotFound(_0x19b15f,null))[_0x4cc6('0x22')](function(_0x24f6ec){if(_0x24f6ec){_0x257a60=_0x24f6ec;_0x1fe272[_0x4cc6('0x2c')]=_[_0x4cc6('0x2d')](db[_0x4cc6('0x4e')][_0x4cc6('0x41')]);_0x1fe272[_0x4cc6('0x2e')]=_[_0x4cc6('0x2d')](_0x105ca5['query']);_0x1fe272['filters']=_['intersection'](_0x1fe272[_0x4cc6('0x2c')],_0x1fe272[_0x4cc6('0x2e')]);_0x43b2db[_0x4cc6('0x30')]=_[_0x4cc6('0x31')](_0x1fe272[_0x4cc6('0x2c')],qs['fields'](_0x105ca5['query'][_0x4cc6('0x32')]));_0x43b2db[_0x4cc6('0x30')]=_0x43b2db[_0x4cc6('0x30')][_0x4cc6('0x53')]?_0x43b2db[_0x4cc6('0x30')]:_0x1fe272[_0x4cc6('0x2c')];_0x43b2db[_0x4cc6('0x34')]=qs[_0x4cc6('0x35')](_0x105ca5['query'][_0x4cc6('0x35')]);_0x43b2db[_0x4cc6('0x36')]=qs[_0x4cc6('0x2f')](_['pick'](_0x105ca5[_0x4cc6('0x2e')],_0x1fe272[_0x4cc6('0x2f')]));if(_0x105ca5['query'][_0x4cc6('0x37')]){_0x43b2db[_0x4cc6('0x36')]=_['merge'](_0x43b2db[_0x4cc6('0x36')],{'$or':_[_0x4cc6('0x39')](_0x43b2db[_0x4cc6('0x30')],function(_0x56e320){var _0x5e1c02={};_0x5e1c02[_0x56e320]={'$like':'%'+_0x105ca5[_0x4cc6('0x2e')][_0x4cc6('0x37')]+'%'};return _0x5e1c02;})});}_0x43b2db=_[_0x4cc6('0x38')]({},_0x43b2db,_0x105ca5[_0x4cc6('0x3a')]);return _0x257a60['getContacts'](_0x43b2db);}})[_0x4cc6('0x22')](function(_0x5ce81a){if(_0x5ce81a){_0x2f8028=_0x5ce81a[_0x4cc6('0x53')];if(!_0x105ca5[_0x4cc6('0x2e')]['hasOwnProperty'](_0x4cc6('0x54'))){_0x43b2db['limit']=qs[_0x4cc6('0x1b')](_0x105ca5[_0x4cc6('0x2e')][_0x4cc6('0x1b')]);_0x43b2db[_0x4cc6('0x19')]=qs[_0x4cc6('0x19')](_0x105ca5['query']['offset']);}return _0x257a60[_0x4cc6('0x51')](_0x43b2db);}})[_0x4cc6('0x22')](function(_0x15859b){if(_0x15859b){return _0x15859b?{'count':_0x2f8028,'rows':_0x15859b}:null;}})[_0x4cc6('0x22')](respondWithResult(_0x19b15f,null))['catch'](handleError(_0x19b15f,null));}; \ No newline at end of file +var _0x4697=['find','create','body','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','getContacts','findOne','CmContact','rimraf','request-promise','moment','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','Companies','UserProfileResource','then','sendStatus','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','map','filter','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x4697,0x1ed));var _0x7469=function(_0x24114d,_0x4606fc){_0x24114d=_0x24114d-0x0;var _0x21f1c7=_0x4697[_0x24114d];return _0x21f1c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7469('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7469('0x1'));var moment=require(_0x7469('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7469('0x3'));var util=require('util');var path=require(_0x7469('0x4'));var sox=require(_0x7469('0x5'));var csv=require('to-csv');var ejs=require(_0x7469('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7469('0x7'));var crypto=require(_0x7469('0x8'));var jsforce=require(_0x7469('0x9'));var deskjs=require(_0x7469('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7469('0xb'));var Redis=require(_0x7469('0xc'));var authService=require(_0x7469('0xd'));var qs=require(_0x7469('0xe'));var as=require(_0x7469('0xf'));var hardwareService=require(_0x7469('0x10'));var logger=require(_0x7469('0x11'))('api');var utils=require(_0x7469('0x12'));var config=require(_0x7469('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x7469('0x14'))['db'];function respondWithStatusCode(_0xb72c09,_0x233fd0){_0x233fd0=_0x233fd0||0xcc;return function(_0x3fdd3f){if(_0x3fdd3f){return _0xb72c09['sendStatus'](_0x233fd0);}return _0xb72c09['status'](_0x233fd0)[_0x7469('0x15')]();};}function respondWithResult(_0x414513,_0x10e166){_0x10e166=_0x10e166||0xc8;return function(_0x27a9c8){if(_0x27a9c8){return _0x414513[_0x7469('0x16')](_0x10e166)[_0x7469('0x17')](_0x27a9c8);}};}function respondWithFilteredResult(_0x34050a,_0x542864){return function(_0x40ae7f){if(_0x40ae7f){var _0x1842f0=typeof _0x542864[_0x7469('0x18')]===_0x7469('0x19')&&typeof _0x542864['limit']==='undefined';var _0x5dd80b=_0x40ae7f[_0x7469('0x1a')];var _0x4b2fb1=_0x1842f0?0x0:_0x542864[_0x7469('0x18')];var _0x25549f=_0x1842f0?_0x40ae7f['count']:_0x542864[_0x7469('0x18')]+_0x542864[_0x7469('0x1b')];var _0x225c24;if(_0x25549f>=_0x5dd80b){_0x25549f=_0x5dd80b;_0x225c24=0xc8;}else{_0x225c24=0xce;}_0x34050a['status'](_0x225c24);return _0x34050a[_0x7469('0x1c')](_0x7469('0x1d'),_0x4b2fb1+'-'+_0x25549f+'/'+_0x5dd80b)[_0x7469('0x17')](_0x40ae7f);}return null;};}function patchUpdates(_0x44f813){return function(_0x3ad0fe){try{jsonpatch['apply'](_0x3ad0fe,_0x44f813,!![]);}catch(_0x51ba20){return BPromise[_0x7469('0x1e')](_0x51ba20);}return _0x3ad0fe[_0x7469('0x1f')]();};}function saveUpdates(_0x1a7058,_0x4d44ae){return function(_0x456b00){if(_0x456b00){return _0x456b00[_0x7469('0x20')](_0x1a7058)['then'](function(_0x55aefd){return _0x55aefd;});}return null;};}function removeEntity(_0x5add64,_0x3a0474){return function(_0x2bc8b1){if(_0x2bc8b1){return _0x2bc8b1[_0x7469('0x21')]()['then'](function(){var _0xeab407=_0x2bc8b1['get']({'plain':!![]});var _0x407777=_0x7469('0x22');return db[_0x7469('0x23')][_0x7469('0x21')]({'where':{'type':_0x407777,'resourceId':_0xeab407['id']}})[_0x7469('0x24')](function(){return _0x2bc8b1;});})[_0x7469('0x24')](function(){_0x5add64[_0x7469('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x361336,_0x1cff15){return function(_0x3222e0){if(!_0x3222e0){_0x361336[_0x7469('0x25')](0x194);}return _0x3222e0;};}function handleError(_0x3c7f37,_0x22c2c3){_0x22c2c3=_0x22c2c3||0x1f4;return function(_0x246799){logger['error'](_0x246799['stack']);if(_0x246799[_0x7469('0x26')]){delete _0x246799[_0x7469('0x26')];}_0x3c7f37[_0x7469('0x16')](_0x22c2c3)[_0x7469('0x27')](_0x246799);};}exports[_0x7469('0x28')]=function(_0x26cf9b,_0x3ecbc8){var _0x2ed1f5={},_0x2685be={},_0x377675={'count':0x0,'rows':[]};return db[_0x7469('0x29')][_0x7469('0x2a')]()[_0x7469('0x24')](function(_0x29eef6){_0x2685be[_0x7469('0x2b')]=_[_0x7469('0x2c')](_0x29eef6);_0x2685be['query']=_['keys'](_0x26cf9b[_0x7469('0x2d')]);_0x2685be[_0x7469('0x2e')]=_[_0x7469('0x2f')](_0x2685be['model'],_0x2685be[_0x7469('0x2d')]);_0x2ed1f5[_0x7469('0x30')]=_[_0x7469('0x2f')](_0x2685be[_0x7469('0x2b')],qs[_0x7469('0x31')](_0x26cf9b[_0x7469('0x2d')]['fields']));_0x2ed1f5[_0x7469('0x30')]=_0x2ed1f5[_0x7469('0x30')]['length']?_0x2ed1f5[_0x7469('0x30')]:_0x2685be[_0x7469('0x2b')];if(!_0x26cf9b[_0x7469('0x2d')][_0x7469('0x32')](_0x7469('0x33'))){_0x2ed1f5[_0x7469('0x1b')]=qs['limit'](_0x26cf9b[_0x7469('0x2d')][_0x7469('0x1b')]);_0x2ed1f5[_0x7469('0x18')]=qs['offset'](_0x26cf9b[_0x7469('0x2d')]['offset']);}_0x2ed1f5[_0x7469('0x34')]=qs[_0x7469('0x35')](_0x26cf9b['query'][_0x7469('0x35')]);_0x2ed1f5[_0x7469('0x36')]=qs[_0x7469('0x2e')](_['pick'](_0x26cf9b[_0x7469('0x2d')],_0x2685be[_0x7469('0x2e')]),_0x29eef6);if(_0x26cf9b[_0x7469('0x2d')]['filter']){_0x2ed1f5[_0x7469('0x36')]=_[_0x7469('0x37')](_0x2ed1f5[_0x7469('0x36')],{'$or':_[_0x7469('0x38')](_0x2ed1f5[_0x7469('0x30')],function(_0x2df343){var _0x852db0={};_0x852db0[_0x2df343]={'$like':'%'+_0x26cf9b[_0x7469('0x2d')][_0x7469('0x39')]+'%'};return _0x852db0;})});}_0x2ed1f5=_['merge']({},_0x2ed1f5,_0x26cf9b[_0x7469('0x3a')]);var _0x5f314f={'where':_0x2ed1f5[_0x7469('0x36')]};return db[_0x7469('0x29')]['count'](_0x5f314f)['then'](function(_0x343dfa){_0x377675[_0x7469('0x1a')]=_0x343dfa;if(_0x26cf9b['query'][_0x7469('0x3b')]){_0x2ed1f5[_0x7469('0x3c')]=[{'all':!![]}];}return db[_0x7469('0x29')][_0x7469('0x3d')](_0x2ed1f5);})[_0x7469('0x24')](function(_0x56a31c){_0x377675[_0x7469('0x3e')]=_0x56a31c;return _0x377675;})[_0x7469('0x24')](respondWithFilteredResult(_0x3ecbc8,_0x2ed1f5))[_0x7469('0x3f')](handleError(_0x3ecbc8,null));})['catch'](handleError(_0x3ecbc8,null));};exports['show']=function(_0x2240cf,_0x411671){var _0x367534={'raw':![],'where':{'id':_0x2240cf[_0x7469('0x40')]['id']}},_0x1aaeef={};_0x1aaeef[_0x7469('0x2b')]=_['keys'](db[_0x7469('0x29')][_0x7469('0x41')]);_0x1aaeef[_0x7469('0x2d')]=_[_0x7469('0x2c')](_0x2240cf[_0x7469('0x2d')]);_0x1aaeef[_0x7469('0x2e')]=_[_0x7469('0x2f')](_0x1aaeef['model'],_0x1aaeef['query']);_0x367534[_0x7469('0x30')]=_[_0x7469('0x2f')](_0x1aaeef[_0x7469('0x2b')],qs[_0x7469('0x31')](_0x2240cf['query'][_0x7469('0x31')]));_0x367534['attributes']=_0x367534[_0x7469('0x30')][_0x7469('0x42')]?_0x367534['attributes']:_0x1aaeef[_0x7469('0x2b')];if(_0x2240cf[_0x7469('0x2d')][_0x7469('0x3b')]){_0x367534[_0x7469('0x3c')]=[{'all':!![]}];}_0x367534=_[_0x7469('0x37')]({},_0x367534,_0x2240cf[_0x7469('0x3a')]);return db[_0x7469('0x29')][_0x7469('0x43')](_0x367534)[_0x7469('0x24')](handleEntityNotFound(_0x411671,null))[_0x7469('0x24')](respondWithResult(_0x411671,null))[_0x7469('0x3f')](handleError(_0x411671,null));};exports[_0x7469('0x44')]=function(_0x24b567,_0x192747){return db['CmCompany'][_0x7469('0x44')](_0x24b567[_0x7469('0x45')],{})[_0x7469('0x24')](function(_0x2b9b54){var _0xbde0ea=_0x24b567[_0x7469('0x46')]['get']({'plain':!![]});if(!_0xbde0ea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbde0ea['role']===_0x7469('0x46')){var _0x369bcd=_0x2b9b54['get']({'plain':!![]});var _0x2a4d37=_0x7469('0x22');return db['UserProfileSection'][_0x7469('0x43')]({'where':{'name':_0x2a4d37,'userProfileId':_0xbde0ea[_0x7469('0x47')]},'raw':!![]})[_0x7469('0x24')](function(_0x5c1c35){if(_0x5c1c35&&_0x5c1c35[_0x7469('0x48')]===0x0){return db[_0x7469('0x23')]['create']({'name':_0x369bcd[_0x7469('0x26')],'resourceId':_0x369bcd['id'],'type':_0x5c1c35[_0x7469('0x26')],'sectionId':_0x5c1c35['id']},{})[_0x7469('0x24')](function(){return _0x2b9b54;});}else{return _0x2b9b54;}})['catch'](function(_0x640b06){logger[_0x7469('0x49')](_0x7469('0x4a'),_0x640b06);throw _0x640b06;});}return _0x2b9b54;})[_0x7469('0x24')](respondWithResult(_0x192747,0xc9))['catch'](handleError(_0x192747,null));};exports[_0x7469('0x20')]=function(_0x4d0804,_0x3e88ae){if(_0x4d0804['body']['id']){delete _0x4d0804[_0x7469('0x45')]['id'];}return db[_0x7469('0x29')][_0x7469('0x43')]({'where':{'id':_0x4d0804[_0x7469('0x40')]['id']}})[_0x7469('0x24')](handleEntityNotFound(_0x3e88ae,null))[_0x7469('0x24')](saveUpdates(_0x4d0804[_0x7469('0x45')],null))[_0x7469('0x24')](respondWithResult(_0x3e88ae,null))[_0x7469('0x3f')](handleError(_0x3e88ae,null));};exports['destroy']=function(_0x7b418,_0x552778){return db[_0x7469('0x29')][_0x7469('0x43')]({'where':{'id':_0x7b418[_0x7469('0x40')]['id']}})[_0x7469('0x24')](handleEntityNotFound(_0x552778,null))[_0x7469('0x24')](removeEntity(_0x552778,null))[_0x7469('0x3f')](handleError(_0x552778,null));};exports['describe']=function(_0x47e497,_0x6f9778){return db['CmCompany'][_0x7469('0x2a')]()[_0x7469('0x24')](respondWithResult(_0x6f9778,null))[_0x7469('0x3f')](handleError(_0x6f9778,null));};exports[_0x7469('0x4b')]=function(_0x28653e,_0x3a8be9,_0x5777cb){return db['CmContact'][_0x7469('0x43')]({'where':{'id':_0x28653e['params']['id']}})[_0x7469('0x24')](handleEntityNotFound(_0x3a8be9,null))[_0x7469('0x24')](function(_0x1157e0){if(_0x1157e0){return _0x1157e0['addContacts'](_0x28653e[_0x7469('0x45')][_0x7469('0x4c')],_['omit'](_0x28653e[_0x7469('0x45')],[_0x7469('0x4c'),'id'])||{});}})[_0x7469('0x24')](respondWithResult(_0x3a8be9,null))[_0x7469('0x3f')](handleError(_0x3a8be9,null));};exports[_0x7469('0x4d')]=function(_0x13d103,_0x583d48,_0x5f08a1){var _0x2caa6c={};var _0x3e98b7={};var _0x585631;var _0x1e71b7;return db[_0x7469('0x29')][_0x7469('0x4e')]({'where':{'id':_0x13d103[_0x7469('0x40')]['id']}})['then'](handleEntityNotFound(_0x583d48,null))['then'](function(_0x565a8d){if(_0x565a8d){_0x585631=_0x565a8d;_0x3e98b7[_0x7469('0x2b')]=_[_0x7469('0x2c')](db[_0x7469('0x4f')]['rawAttributes']);_0x3e98b7['query']=_[_0x7469('0x2c')](_0x13d103['query']);_0x3e98b7[_0x7469('0x2e')]=_[_0x7469('0x2f')](_0x3e98b7[_0x7469('0x2b')],_0x3e98b7[_0x7469('0x2d')]);_0x2caa6c['attributes']=_[_0x7469('0x2f')](_0x3e98b7[_0x7469('0x2b')],qs[_0x7469('0x31')](_0x13d103[_0x7469('0x2d')][_0x7469('0x31')]));_0x2caa6c['attributes']=_0x2caa6c[_0x7469('0x30')][_0x7469('0x42')]?_0x2caa6c['attributes']:_0x3e98b7[_0x7469('0x2b')];_0x2caa6c[_0x7469('0x34')]=qs[_0x7469('0x35')](_0x13d103[_0x7469('0x2d')][_0x7469('0x35')]);_0x2caa6c[_0x7469('0x36')]=qs[_0x7469('0x2e')](_['pick'](_0x13d103[_0x7469('0x2d')],_0x3e98b7['filters']));if(_0x13d103[_0x7469('0x2d')][_0x7469('0x39')]){_0x2caa6c[_0x7469('0x36')]=_[_0x7469('0x37')](_0x2caa6c[_0x7469('0x36')],{'$or':_[_0x7469('0x38')](_0x2caa6c['attributes'],function(_0x3f2ef8){var _0xdbb423={};_0xdbb423[_0x3f2ef8]={'$like':'%'+_0x13d103[_0x7469('0x2d')][_0x7469('0x39')]+'%'};return _0xdbb423;})});}_0x2caa6c=_[_0x7469('0x37')]({},_0x2caa6c,_0x13d103[_0x7469('0x3a')]);return _0x585631[_0x7469('0x4d')](_0x2caa6c);}})[_0x7469('0x24')](function(_0x58bb3c){if(_0x58bb3c){_0x1e71b7=_0x58bb3c[_0x7469('0x42')];if(!_0x13d103[_0x7469('0x2d')]['hasOwnProperty'](_0x7469('0x33'))){_0x2caa6c[_0x7469('0x1b')]=qs['limit'](_0x13d103[_0x7469('0x2d')][_0x7469('0x1b')]);_0x2caa6c[_0x7469('0x18')]=qs[_0x7469('0x18')](_0x13d103[_0x7469('0x2d')][_0x7469('0x18')]);}return _0x585631[_0x7469('0x4d')](_0x2caa6c);}})['then'](function(_0x2d7519){if(_0x2d7519){return _0x2d7519?{'count':_0x1e71b7,'rows':_0x2d7519}:null;}})[_0x7469('0x24')](respondWithResult(_0x583d48,null))[_0x7469('0x3f')](handleError(_0x583d48,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 874b941..b207ecc 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 _0x3b85=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1bb58c,_0x2c8a4d){var _0x277586=function(_0x11fd4c){while(--_0x11fd4c){_0x1bb58c['push'](_0x1bb58c['shift']());}};_0x277586(++_0x2c8a4d);}(_0x3b85,0x17e));var _0x53b8=function(_0x55ee91,_0x160100){_0x55ee91=_0x55ee91-0x0;var _0x2a17c9=_0x3b85[_0x55ee91];return _0x2a17c9;};'use strict';var _=require(_0x53b8('0x0'));var util=require(_0x53b8('0x1'));var logger=require('../../config/logger')(_0x53b8('0x2'));var moment=require(_0x53b8('0x3'));var BPromise=require(_0x53b8('0x4'));var rp=require(_0x53b8('0x5'));var fs=require('fs');var path=require(_0x53b8('0x6'));var rimraf=require('rimraf');var config=require(_0x53b8('0x7'));var attributes=require(_0x53b8('0x8'));module[_0x53b8('0x9')]=function(_0x281abe,_0xfa1b3d){return _0x281abe[_0x53b8('0xa')](_0x53b8('0xb'),attributes,{'tableName':_0x53b8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe238=['../../config/logger','moment','path','rimraf','./cmCompany.attributes','define','cm_companies'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe238,0xbd));var _0x8e23=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xe238[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8e23('0x0'))('api');var moment=require(_0x8e23('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e23('0x2'));var rimraf=require(_0x8e23('0x3'));var config=require('../../config/environment');var attributes=require(_0x8e23('0x4'));module['exports']=function(_0x3104f6,_0x29b312){return _0x3104f6[_0x8e23('0x5')]('CmCompany',attributes,{'tableName':_0x8e23('0x6'),'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 4299bf8..a77053f 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 _0xbfa5=['request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xdbd8a0,_0x1e6a6d){var _0x1d0c8d=function(_0x1f0f0c){while(--_0x1f0f0c){_0xdbd8a0['push'](_0xdbd8a0['shift']());}};_0x1d0c8d(++_0x1e6a6d);}(_0xbfa5,0x16a));var _0x5bfa=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xbfa5[_0x5f3f88];return _0xd08119;};'use strict';var _=require('lodash');var util=require(_0x5bfa('0x0'));var moment=require(_0x5bfa('0x1'));var BPromise=require(_0x5bfa('0x2'));var rs=require(_0x5bfa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5bfa('0x4'))['db'];var utils=require(_0x5bfa('0x5'));var logger=require(_0x5bfa('0x6'))(_0x5bfa('0x7'));var config=require(_0x5bfa('0x8'));var jayson=require(_0x5bfa('0x9'));var client=jayson[_0x5bfa('0xa')][_0x5bfa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b1231,_0x47b58e,_0x502cf3){return new BPromise(function(_0x13b919,_0x299df8){return client[_0x5bfa('0xc')](_0x5b1231,_0x502cf3)[_0x5bfa('0xd')](function(_0x343e6f){logger[_0x5bfa('0xe')](_0x5bfa('0xf'),_0x47b58e,_0x5bfa('0x10'));logger[_0x5bfa('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x47b58e,_0x5bfa('0x10'),JSON['stringify'](_0x343e6f));if(_0x343e6f['error']){if(_0x343e6f[_0x5bfa('0x12')][_0x5bfa('0x13')]===0x1f4){logger['error'](_0x5bfa('0xf'),_0x47b58e,_0x343e6f[_0x5bfa('0x12')][_0x5bfa('0x14')]);return _0x299df8(_0x343e6f[_0x5bfa('0x12')][_0x5bfa('0x14')]);}logger['error']('CmCompany,\x20%s,\x20%s',_0x47b58e,_0x343e6f['error'][_0x5bfa('0x14')]);return _0x13b919(_0x343e6f[_0x5bfa('0x12')]['message']);}else{logger[_0x5bfa('0xe')](_0x5bfa('0xf'),_0x47b58e,'request\x20sent');_0x13b919(_0x343e6f[_0x5bfa('0x15')][_0x5bfa('0x14')]);}})['catch'](function(_0x413c21){logger['error'](_0x5bfa('0xf'),_0x47b58e,_0x413c21);_0x299df8(_0x413c21);});});} \ No newline at end of file +var _0x4a00=['CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','client','then','info'];(function(_0x3576c0,_0x196351){var _0x310e7d=function(_0x41c25e){while(--_0x41c25e){_0x3576c0['push'](_0x3576c0['shift']());}};_0x310e7d(++_0x196351);}(_0x4a00,0x1c3));var _0x04a0=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4a00[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x04a0('0x0'));var moment=require(_0x04a0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x04a0('0x2'))['db'];var utils=require(_0x04a0('0x3'));var logger=require(_0x04a0('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x04a0('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39c87b,_0xacae57,_0x53ef10){return new BPromise(function(_0x43ac8a,_0xc1c197){return client['request'](_0x39c87b,_0x53ef10)[_0x04a0('0x6')](function(_0x294d8e){logger[_0x04a0('0x7')](_0x04a0('0x8'),_0xacae57,_0x04a0('0x9'));logger[_0x04a0('0xa')]('CmCompany,\x20%s,\x20%s,\x20%s',_0xacae57,_0x04a0('0x9'),JSON[_0x04a0('0xb')](_0x294d8e));if(_0x294d8e[_0x04a0('0xc')]){if(_0x294d8e['error'][_0x04a0('0xd')]===0x1f4){logger[_0x04a0('0xc')](_0x04a0('0x8'),_0xacae57,_0x294d8e['error'][_0x04a0('0xe')]);return _0xc1c197(_0x294d8e[_0x04a0('0xc')][_0x04a0('0xe')]);}logger[_0x04a0('0xc')](_0x04a0('0x8'),_0xacae57,_0x294d8e[_0x04a0('0xc')][_0x04a0('0xe')]);return _0x43ac8a(_0x294d8e[_0x04a0('0xc')][_0x04a0('0xe')]);}else{logger[_0x04a0('0x7')](_0x04a0('0x8'),_0xacae57,_0x04a0('0x9'));_0x43ac8a(_0x294d8e[_0x04a0('0xf')][_0x04a0('0xe')]);}})[_0x04a0('0x10')](function(_0x1a4b0e){logger[_0x04a0('0xc')](_0x04a0('0x8'),_0xacae57,_0x1a4b0e);_0xc1c197(_0x1a4b0e);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index eb285a4..e08b721 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 _0xeeda=['/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','index','get'];(function(_0x323acd,_0x520e66){var _0x3bc3cb=function(_0x262506){while(--_0x262506){_0x323acd['push'](_0x323acd['shift']());}};_0x3bc3cb(++_0x520e66);}(_0xeeda,0x1be));var _0xaeed=function(_0x4b51d2,_0x286d4d){_0x4b51d2=_0x4b51d2-0x0;var _0x49ee75=_0xeeda[_0x4b51d2];return _0x49ee75;};'use strict';var multer=require(_0xaeed('0x0'));var util=require(_0xaeed('0x1'));var path=require(_0xaeed('0x2'));var timeout=require(_0xaeed('0x3'));var express=require(_0xaeed('0x4'));var router=express[_0xaeed('0x5')]();var fs_extra=require(_0xaeed('0x6'));var auth=require(_0xaeed('0x7'));var interaction=require(_0xaeed('0x8'));var config=require(_0xaeed('0x9'));var controller=require(_0xaeed('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xaeed('0xb')]);router[_0xaeed('0xc')](_0xaeed('0xd'),auth[_0xaeed('0xe')](),controller[_0xaeed('0xf')]);router[_0xaeed('0xc')](_0xaeed('0x10'),auth[_0xaeed('0xe')](),controller[_0xaeed('0x11')]);router[_0xaeed('0xc')](_0xaeed('0x12'),auth[_0xaeed('0xe')](),controller[_0xaeed('0x13')]);router[_0xaeed('0x14')]('/',auth[_0xaeed('0xe')](),controller[_0xaeed('0x15')]);router[_0xaeed('0x14')]('/:id/contacts',auth[_0xaeed('0xe')](),controller[_0xaeed('0x16')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaeed('0x17')]);router[_0xaeed('0x18')](_0xaeed('0x10'),auth['isAuthenticated'](),controller[_0xaeed('0x19')]);module[_0xaeed('0x1a')]=router; \ No newline at end of file +var _0x7ffc=['../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','getContacts','create','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x29b34c,_0x3aebc8){var _0x595b12=function(_0x58d9bc){while(--_0x58d9bc){_0x29b34c['push'](_0x29b34c['shift']());}};_0x595b12(++_0x3aebc8);}(_0x7ffc,0x144));var _0xc7ff=function(_0xcdd749,_0x19f007){_0xcdd749=_0xcdd749-0x0;var _0xa16c06=_0x7ffc[_0xcdd749];return _0xa16c06;};'use strict';var multer=require(_0xc7ff('0x0'));var util=require(_0xc7ff('0x1'));var path=require(_0xc7ff('0x2'));var timeout=require(_0xc7ff('0x3'));var express=require(_0xc7ff('0x4'));var router=express[_0xc7ff('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc7ff('0x6'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0xc7ff('0x7')](),controller[_0xc7ff('0x8')]);router[_0xc7ff('0x9')](_0xc7ff('0xa'),auth[_0xc7ff('0x7')](),controller[_0xc7ff('0xb')]);router[_0xc7ff('0x9')](_0xc7ff('0xc'),auth['isAuthenticated'](),controller[_0xc7ff('0xd')]);router[_0xc7ff('0x9')](_0xc7ff('0xe'),auth[_0xc7ff('0x7')](),controller[_0xc7ff('0xf')]);router['post']('/',auth[_0xc7ff('0x7')](),controller[_0xc7ff('0x10')]);router[_0xc7ff('0x11')](_0xc7ff('0xe'),auth['isAuthenticated'](),controller['addContacts']);router[_0xc7ff('0x12')](_0xc7ff('0xc'),auth['isAuthenticated'](),controller[_0xc7ff('0x13')]);router[_0xc7ff('0x14')](_0xc7ff('0xc'),auth[_0xc7ff('0x7')](),controller['destroy']);module[_0xc7ff('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index c9e5766..fd1c6e9 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 _0x0a42=['STRING','TEXT','INTEGER','NOW','lodash','exports'];(function(_0x1997ae,_0x19a6e4){var _0x3b4ac4=function(_0x1bc089){while(--_0x1bc089){_0x1997ae['push'](_0x1997ae['shift']());}};_0x3b4ac4(++_0x19a6e4);}(_0x0a42,0x82));var _0x20a4=function(_0x1f21bd,_0x47b870){_0x1f21bd=_0x1f21bd-0x0;var _0x3a1064=_0x0a42[_0x1f21bd];return _0x3a1064;};'use strict';var _=require(_0x20a4('0x0'));var Sequelize=require('sequelize');module[_0x20a4('0x1')]={'firstName':{'type':Sequelize[_0x20a4('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x20a4('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x20a4('0x2')]},'city':{'type':Sequelize[_0x20a4('0x2')]},'country':{'type':Sequelize[_0x20a4('0x2')]},'dateOfBirth':{'type':Sequelize[_0x20a4('0x2')]},'description':{'type':Sequelize[_0x20a4('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x20a4('0x2')]},'fax':{'type':Sequelize[_0x20a4('0x2')]},'email':{'type':Sequelize[_0x20a4('0x2')]},'url':{'type':Sequelize[_0x20a4('0x2')]},'facebook':{'type':Sequelize[_0x20a4('0x2')]},'fb_data':{'type':Sequelize[_0x20a4('0x2')]},'twitter':{'type':Sequelize[_0x20a4('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x20a4('0x2')]},'viber':{'type':Sequelize[_0x20a4('0x2')]},'line':{'type':Sequelize[_0x20a4('0x2')]},'wechat':{'type':Sequelize[_0x20a4('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x20a4('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x20a4('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x20a4('0x5')]},'dialTimezone':{'type':Sequelize[_0x20a4('0x2')]},'utcOffset':{'type':Sequelize[_0x20a4('0x4')]}}; \ No newline at end of file +var _0x3fde=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x3fde,0xcc));var _0xe3fd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3fde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe3fd('0x0'));var Sequelize=require(_0xe3fd('0x1'));module[_0xe3fd('0x2')]={'firstName':{'type':Sequelize[_0xe3fd('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xe3fd('0x3')]},'street':{'type':Sequelize[_0xe3fd('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xe3fd('0x3')]},'country':{'type':Sequelize[_0xe3fd('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe3fd('0x4')]},'phone':{'type':Sequelize[_0xe3fd('0x3')]},'mobile':{'type':Sequelize[_0xe3fd('0x3')]},'fax':{'type':Sequelize[_0xe3fd('0x3')]},'email':{'type':Sequelize[_0xe3fd('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xe3fd('0x3')]},'twitter':{'type':Sequelize[_0xe3fd('0x3')]},'skype':{'type':Sequelize[_0xe3fd('0x3')]},'teams':{'type':Sequelize[_0xe3fd('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xe3fd('0x3')]},'wechat':{'type':Sequelize[_0xe3fd('0x3')]},'telegram':{'type':Sequelize[_0xe3fd('0x3')]},'UserId':{'type':Sequelize[_0xe3fd('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xe3fd('0x3')]},'priority':{'type':Sequelize[_0xe3fd('0x5')](0x2)[_0xe3fd('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe3fd('0x7')],'defaultValue':Sequelize[_0xe3fd('0x8')]},'dialTimezone':{'type':Sequelize[_0xe3fd('0x3')]},'utcOffset':{'type':Sequelize[_0xe3fd('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 28a8fe2..b768b77 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 _0xf9a0=['map','cf_%d','omit','pickBy','format','setFields','id\x20=\x20?','sequelize','text','phone','getTags','findOne','rawAttributes','filters','intersection','model','attributes','fields','order','sort','pick','filter','options','nolimit','setTags','setAdditionalPhones','OrderBy','item_types','ItemTypeId','items','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','includeAll','include','rows','getHopperHistories','ContactId','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','filename','chmodSync','0777','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','upload','createReadStream','import','binding','child_process','../../components/import/cm/csv2','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','User','firstName','fork','../../components/import/cm/csvUpdates','stringify','message','mail','chat','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','Invalid\x20channel','toLowerCase','range','parse','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','type','source','destination','callerid','starttime','note','createdAt','userDisposition','userThirdDisposition','UserId','DESC','findAndCountAll','fullname','startCase','Website','closed','closedAt','disposition','secondDisposition','thirdDisposition','Account','key','browserName','customerPort','deviceModel','osName','ratingMessage','ratingType','referer','subject','substatus','threadId','Interaction','Owner','flatten','sortBy','value','slice','bluebird','util','path','squel','papaparse','ioredis','../../config/logger','../../config/environment','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','offset','undefined','limit','count','status','set','json','update','then','end','sendStatus','stack','name','send','index','describe','getOptions','findAll','query','user','destroy','CmContact','params','catch','tags','keys','length','startsWith','cf_','columnName','analytics','CmCustomField','displayName','alias','custom','values','info','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatMessage','ChatOfflineMessage','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','FaxQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','ListId','findOrCreate','spread','contact','all','show','find','Tag','Tags','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','push'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf9a0,0x8c));var _0x0f9a=function(_0x1f0724,_0x3a58bf){_0x1f0724=_0x1f0724-0x0;var _0x253ffb=_0xf9a0[_0x1f0724];return _0x253ffb;};'use strict';var moment=require('moment');var BPromise=require(_0x0f9a('0x0'));var util=require(_0x0f9a('0x1'));var path=require(_0x0f9a('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0f9a('0x3'));var Papa=require(_0x0f9a('0x4'));var Redis=require(_0x0f9a('0x5'));var contacts=require('../../components/contacts');var qs=require('../../components/parsers/qs');var logger=require(_0x0f9a('0x6'))('api');var config=require(_0x0f9a('0x7'));var shared=require(_0x0f9a('0x8'));var db=require('../../mysqldb')['db'];config[_0x0f9a('0x9')]=_[_0x0f9a('0xa')](config[_0x0f9a('0x9')],{'host':_0x0f9a('0xb'),'port':0x18eb});var socket=require(_0x0f9a('0xc'))(new Redis(config[_0x0f9a('0x9')]));require(_0x0f9a('0xd'))['register'](socket);function respondWithResult(_0xc38cd1,_0x18aa81){_0x18aa81=_0x18aa81||0xc8;return function(_0x4d97b5){if(_0x4d97b5){return _0xc38cd1['status'](_0x18aa81)['json'](_0x4d97b5);}};}function respondWithFilteredResult(_0x2f8acb,_0x11656f){return function(_0x1b4b91){if(_0x1b4b91){var _0x47d242=typeof _0x11656f[_0x0f9a('0xe')]===_0x0f9a('0xf')&&typeof _0x11656f[_0x0f9a('0x10')]==='undefined';var _0x60381a=_0x1b4b91[_0x0f9a('0x11')];var _0x55f9d6=_0x47d242?0x0:_0x11656f['offset'];var _0x2ab6d8=_0x47d242?_0x1b4b91[_0x0f9a('0x11')]:_0x11656f['offset']+_0x11656f[_0x0f9a('0x10')];var _0x253ee5;if(_0x2ab6d8>=_0x60381a){_0x2ab6d8=_0x60381a;_0x253ee5=0xc8;}else{_0x253ee5=0xce;}_0x2f8acb[_0x0f9a('0x12')](_0x253ee5);return _0x2f8acb[_0x0f9a('0x13')]('Content-Range',_0x55f9d6+'-'+_0x2ab6d8+'/'+_0x60381a)[_0x0f9a('0x14')](_0x1b4b91);}return null;};}function saveUpdates(_0xc41528){return function(_0x30c313){if(_0x30c313){return _0x30c313[_0x0f9a('0x15')](_0xc41528)[_0x0f9a('0x16')](function(_0x473878){return _0x473878;});}return null;};}function removeEntity(_0x4c077f){return function(_0x511426){if(_0x511426){return _0x511426['destroy']()[_0x0f9a('0x16')](function(){_0x4c077f[_0x0f9a('0x12')](0xcc)[_0x0f9a('0x17')]();});}};}function handleEntityNotFound(_0x5bb898){return function(_0x1987a1){if(!_0x1987a1){_0x5bb898[_0x0f9a('0x18')](0x194);}return _0x1987a1;};}function handleError(_0x2a1de8,_0x242dfc){_0x242dfc=_0x242dfc||0x1f4;return function(_0x357ba3){logger['error'](_0x357ba3[_0x0f9a('0x19')]);if(_0x357ba3[_0x0f9a('0x1a')]){delete _0x357ba3[_0x0f9a('0x1a')];}_0x2a1de8[_0x0f9a('0x12')](_0x242dfc)[_0x0f9a('0x1b')](_0x357ba3);};}exports[_0x0f9a('0x1c')]=function(_0x4e0896,_0x5240d5){var _0x2412c1={};return contacts[_0x0f9a('0x1d')]()[_0x0f9a('0x16')](function(_0x2dd84e){_0x2412c1=qs[_0x0f9a('0x1e')](_0x2dd84e,_0x4e0896);return contacts[_0x0f9a('0x1f')](_0x4e0896[_0x0f9a('0x20')],_0x4e0896[_0x0f9a('0x21')],_0x2412c1,_0x2dd84e);})[_0x0f9a('0x16')](respondWithFilteredResult(_0x5240d5,_0x2412c1))['catch'](handleError(_0x5240d5,null));};exports[_0x0f9a('0x22')]=function(_0x1d1716,_0x2f5930){return db[_0x0f9a('0x23')]['find']({'where':{'id':_0x1d1716[_0x0f9a('0x24')]['id']}})[_0x0f9a('0x16')](handleEntityNotFound(_0x2f5930,null))['then'](removeEntity(_0x2f5930,null))[_0x0f9a('0x25')](handleError(_0x2f5930,null));};exports[_0x0f9a('0x1d')]=function(_0x1cc670,_0x1932cf){return db[_0x0f9a('0x23')]['describe']()[_0x0f9a('0x16')](function(_0x25825){delete _0x25825[_0x0f9a('0x26')];for(var _0x151e89=0x0;_0x151e890x0){return new Promise(function(_0x1898c6){var _0x203f55=[];for(var _0x2a3103=0x0;_0x2a3103<_0xfccf10[_0x0f9a('0x28')];_0x2a3103++){_0x203f55['push'](insertAdditionalPhones(_0xfccf10[_0x2a3103][_0x0f9a('0x5e')],_0xfccf10[_0x2a3103][_0x0f9a('0x56')]));}Promise[_0x0f9a('0x5f')](_0x203f55)['then'](function(){_0x1898c6(0x1);});})[_0x0f9a('0x16')](function(){return{'success':_0x4ace5e,'failure':_0x3eef7b,'duplicates':_0x16ac01};});}else{return{'success':_0x4ace5e,'failure':_0x3eef7b,'duplicates':_0x16ac01};}}})[_0x0f9a('0x16')](respondWithResult(_0x10fd18,0xc9))['catch'](handleError(_0x10fd18,null));};exports[_0x0f9a('0x60')]=function(_0x5b6004,_0x111e3){var _0x56afbb;return db[_0x0f9a('0x23')][_0x0f9a('0x1d')]()[_0x0f9a('0x16')](function(_0x291ef0){return db[_0x0f9a('0x23')][_0x0f9a('0x61')]({'where':{'id':_0x5b6004['params']['id']},'include':[{'model':db[_0x0f9a('0x62')],'as':_0x0f9a('0x63'),'attributes':['id','name',_0x0f9a('0x64')],'required':_0x5b6004[_0x0f9a('0x20')][_0x0f9a('0x65')]?!![]:![]},{'model':db[_0x0f9a('0x49')],'as':_0x0f9a('0x66'),'where':{'CmContactId':_0x5b6004[_0x0f9a('0x24')]['id']},'required':![],'include':[{'model':db[_0x0f9a('0x67')],'as':_0x0f9a('0x68')}]}],'order':[db['sequelize'][_0x0f9a('0x69')](_0x0f9a('0x6a'))],'attributes':_[_0x0f9a('0x27')](_0x291ef0)});})[_0x0f9a('0x16')](function(_0x305b08){if(!_[_0x0f9a('0x52')](_0x305b08)){_0x56afbb=_0x305b08['get']({'plain':!![]});var _0x655e={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x305b08&&_0x305b08[_0x0f9a('0x5b')]){if(_0x305b08['ListId']){_0x655e[_0x0f9a('0x5a')][_0x0f9a('0x6b')][_0x0f9a('0x6c')]({'ListId':{'$ne':_0x305b08[_0x0f9a('0x5b')]}});}}return db[_0x0f9a('0x2d')][_0x0f9a('0x1f')](_0x655e);}})[_0x0f9a('0x16')](function(_0x65425e){if(!_[_0x0f9a('0x52')](_0x65425e)){return _['omit'](_0x56afbb,_[_0x0f9a('0x6d')](_0x65425e,function(_0x37f494){return util['format'](_0x0f9a('0x6e'),_0x37f494['id']);}));}})[_0x0f9a('0x16')](handleEntityNotFound(_0x111e3,null))[_0x0f9a('0x16')](respondWithResult(_0x111e3,null))['catch'](handleError(_0x111e3,null));};exports['update']=function(_0xbf29aa,_0x4869fc){var _0x2af4ca;if(_0xbf29aa[_0x0f9a('0x36')]['id']){delete _0xbf29aa[_0x0f9a('0x36')]['id'];}if(!_[_0x0f9a('0x52')](_0xbf29aa[_0x0f9a('0x36')][_0x0f9a('0x53')])){var _0x15ace0=_0xbf29aa['body'][_0x0f9a('0x53')];if(!_[_0x0f9a('0x52')](shared[_0x0f9a('0x54')][_0x15ace0]))_0xbf29aa[_0x0f9a('0x36')][_0x0f9a('0x55')]=shared[_0x0f9a('0x54')][_0x15ace0][_0x0f9a('0x55')];}return db['CmContact'][_0x0f9a('0x61')]({'where':{'id':_0xbf29aa[_0x0f9a('0x24')]['id']}})[_0x0f9a('0x16')](handleEntityNotFound(_0x4869fc,null))['then'](saveUpdates(_0xbf29aa[_0x0f9a('0x36')],null))[_0x0f9a('0x16')](function(_0x5eeccf){_0x2af4ca=_0x5eeccf;var _0x2b79f3={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x5eeccf&&_0x5eeccf[_0x0f9a('0x5b')]){if(_0x5eeccf[_0x0f9a('0x5b')]){_0x2b79f3[_0x0f9a('0x5a')][_0x0f9a('0x6b')]['push']({'ListId':{'$ne':_0x5eeccf['ListId']}});}}return db[_0x0f9a('0x2d')][_0x0f9a('0x1f')](_0x2b79f3);})[_0x0f9a('0x16')](function(_0x3829c4){if(_0x3829c4){return _[_0x0f9a('0x6f')](_[_0x0f9a('0x70')](_0xbf29aa[_0x0f9a('0x36')],function(_0xe5911f,_0x4b61af){return _[_0x0f9a('0x29')](_0x4b61af,_0x0f9a('0x2a'));}),_[_0x0f9a('0x6d')](_0x3829c4,function(_0x58097e){return util[_0x0f9a('0x71')](_0x0f9a('0x6e'),_0x58097e['id']);}));}})[_0x0f9a('0x16')](function(_0x550e18){if(_0x550e18&&!_['isEmpty'](_0x550e18)){var _0x6fa3ff=squel[_0x0f9a('0x15')]()['table']('cm_contacts')[_0x0f9a('0x72')](_0x550e18)[_0x0f9a('0x5a')](_0x0f9a('0x73'),_0xbf29aa[_0x0f9a('0x24')]['id'])['toParam']();return db[_0x0f9a('0x74')][_0x0f9a('0x20')](_0x6fa3ff[_0x0f9a('0x75')],{'replacements':_0x6fa3ff['values']});}})[_0x0f9a('0x16')](function(){if(_0xbf29aa[_0x0f9a('0x36')][_0x0f9a('0x76')]&&_0x2af4ca){return db[_0x0f9a('0x3d')]['update']({'phone':_0xbf29aa[_0x0f9a('0x36')][_0x0f9a('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x2af4ca['id']}});}})['then'](function(){return _0x2af4ca;})[_0x0f9a('0x16')](respondWithResult(_0x4869fc,null))[_0x0f9a('0x25')](handleError(_0x4869fc,null));};exports[_0x0f9a('0x77')]=function(_0x2fbbb1,_0x19a84e){var _0xf07f42={};var _0x34c649={};var _0x40327f;var _0x2a08d1;return db[_0x0f9a('0x23')][_0x0f9a('0x78')]({'where':{'id':_0x2fbbb1[_0x0f9a('0x24')]['id']}})[_0x0f9a('0x16')](handleEntityNotFound(_0x19a84e,null))[_0x0f9a('0x16')](function(_0x3a01cd){if(_0x3a01cd){_0x40327f=_0x3a01cd;_0x34c649['model']=_[_0x0f9a('0x27')](db[_0x0f9a('0x62')][_0x0f9a('0x79')]);_0x34c649['query']=_[_0x0f9a('0x27')](_0x2fbbb1[_0x0f9a('0x20')]);_0x34c649[_0x0f9a('0x7a')]=_[_0x0f9a('0x7b')](_0x34c649[_0x0f9a('0x7c')],_0x34c649[_0x0f9a('0x20')]);_0xf07f42[_0x0f9a('0x7d')]=_[_0x0f9a('0x7b')](_0x34c649['model'],qs[_0x0f9a('0x7e')](_0x2fbbb1['query'][_0x0f9a('0x7e')]));_0xf07f42[_0x0f9a('0x7d')]=_0xf07f42[_0x0f9a('0x7d')]['length']?_0xf07f42[_0x0f9a('0x7d')]:_0x34c649['model'];_0xf07f42[_0x0f9a('0x7f')]=qs[_0x0f9a('0x80')](_0x2fbbb1['query'][_0x0f9a('0x80')]);_0xf07f42[_0x0f9a('0x5a')]=qs[_0x0f9a('0x7a')](_[_0x0f9a('0x81')](_0x2fbbb1[_0x0f9a('0x20')],_0x34c649[_0x0f9a('0x7a')]));if(_0x2fbbb1[_0x0f9a('0x20')][_0x0f9a('0x82')]){_0xf07f42[_0x0f9a('0x5a')]=_['merge'](_0xf07f42[_0x0f9a('0x5a')],{'$or':_['map'](_0xf07f42[_0x0f9a('0x7d')],function(_0x16c0ad){var _0x2943d1={};_0x2943d1[_0x16c0ad]={'$like':'%'+_0x2fbbb1[_0x0f9a('0x20')][_0x0f9a('0x82')]+'%'};return _0x2943d1;})});}_0xf07f42=_['merge']({},_0xf07f42,_0x2fbbb1[_0x0f9a('0x83')]);return _0x40327f[_0x0f9a('0x77')](_0xf07f42);}})['then'](function(_0x28a743){if(_0x28a743){_0x2a08d1=_0x28a743['length'];if(!_0x2fbbb1[_0x0f9a('0x20')][_0x0f9a('0x34')](_0x0f9a('0x84'))){_0xf07f42['limit']=qs[_0x0f9a('0x10')](_0x2fbbb1[_0x0f9a('0x20')][_0x0f9a('0x10')]);_0xf07f42[_0x0f9a('0xe')]=qs[_0x0f9a('0xe')](_0x2fbbb1['query']['offset']);}return _0x40327f[_0x0f9a('0x77')](_0xf07f42);}})[_0x0f9a('0x16')](function(_0x158447){if(_0x158447){return _0x158447?{'count':_0x2a08d1,'rows':_0x158447}:null;}})['then'](respondWithResult(_0x19a84e,null))[_0x0f9a('0x25')](handleError(_0x19a84e,null));};exports[_0x0f9a('0x85')]=function(_0x37c93e,_0x15eb6f){if(_0x37c93e[_0x0f9a('0x36')]['id']){delete _0x37c93e[_0x0f9a('0x36')]['id'];}return db['CmContact'][_0x0f9a('0x78')]({'where':{'id':_0x37c93e['params']['id']}})[_0x0f9a('0x16')](handleEntityNotFound(_0x15eb6f,null))[_0x0f9a('0x16')](function(_0x3608f6){if(_0x3608f6){return _0x3608f6[_0x0f9a('0x85')](_0x37c93e[_0x0f9a('0x36')]['ids']||[]);}return null;})[_0x0f9a('0x16')](respondWithResult(_0x15eb6f,null))[_0x0f9a('0x25')](handleError(_0x15eb6f,null));};exports[_0x0f9a('0x86')]=function(_0x2425bc,_0x1d51de){var _0x2a4e39=[];_0x2a4e39['push'](addAdditionalPhones(_0x2425bc[_0x0f9a('0x36')]));Promise['all'](_0x2a4e39)[_0x0f9a('0x16')](function(){_0x2a4e39=[];_0x2a4e39[_0x0f9a('0x6c')](deleteCmHopperPhones(_0x2425bc[_0x0f9a('0x36')]['id']));_0x2a4e39[_0x0f9a('0x6c')](addCmHopperPhones(_0x2425bc[_0x0f9a('0x36')]['id']));Promise[_0x0f9a('0x5f')](_0x2a4e39)[_0x0f9a('0x16')](function(){return[0x1];})[_0x0f9a('0x16')](respondWithResult(_0x1d51de,null));});};function addAdditionalPhones(_0x224879){var _0x4b59bb;return new Promise(function(_0x248e23){return db[_0x0f9a('0x49')]['destroy']({'where':{'CmContactId':_0x224879['id']}})[_0x0f9a('0x16')](function(){db[_0x0f9a('0x67')][_0x0f9a('0x1f')]({'raw':!![],'attributes':['id',_0x0f9a('0x87')]})[_0x0f9a('0x16')](function(_0x587c28){var _0x2b15a3=[];for(var _0x56ce86=0x0;_0x56ce86<_0x224879['items']['length'];_0x56ce86++){var _0x394212=_0x224879['item_types']?_[_0x0f9a('0x52')](_0x224879[_0x0f9a('0x88')][_0x56ce86])?'':_0x224879['item_types'][_0x56ce86]:_0x224879['items'][_0x56ce86][_0x0f9a('0x89')]?_0x224879[_0x0f9a('0x8a')][_0x56ce86]['ItemTypeId']:'';var _0x221751=_[_0x0f9a('0x52')](_0x224879[_0x0f9a('0x8a')][_0x56ce86][_0x0f9a('0x8b')])?'':_0x224879['items'][_0x56ce86][_0x0f9a('0x8b')];var _0x4864c0=_0x394212+':'+_0x224879['items'][_0x56ce86][_0x0f9a('0x76')]+'§'+_0x221751;if(_['isNil'](_0x4b59bb))_0x4b59bb=_0x4864c0;else _0x4b59bb+=';'+_0x4864c0;var _0x30eb86=null;var _0x483222=null;if(_0x224879['item_types']){if(!_[_0x0f9a('0x52')](_0x224879[_0x0f9a('0x88')][_0x56ce86])){_0x483222=_['find'](_0x587c28,function(_0x3e9fd7){return _0x3e9fd7['id']===_0x224879['item_types'][_0x56ce86];});if(!_[_0x0f9a('0x52')](_0x483222)){_0x30eb86=_0x483222[_0x0f9a('0x87')];}}}else{if(!_['isNil'](_0x224879[_0x0f9a('0x8a')][_0x56ce86])){_0x483222=_['find'](_0x587c28,function(_0x3b77c7){return _0x3b77c7['id']===_0x224879[_0x0f9a('0x8a')][_0x56ce86][_0x0f9a('0x89')];});if(!_[_0x0f9a('0x52')](_0x483222)){_0x30eb86=_0x56ce86;}}}if(_[_0x0f9a('0x52')](_0x30eb86)){_0x30eb86=0x64;}_0x2b15a3[_0x0f9a('0x6c')](addAdditionalPhone(_0x224879['id'],_0x224879['items'][_0x56ce86][_0x0f9a('0x76')],_0x224879[_0x0f9a('0x88')]?_[_0x0f9a('0x52')](_0x224879[_0x0f9a('0x88')][_0x56ce86])?null:_0x224879[_0x0f9a('0x88')][_0x56ce86]:_0x224879[_0x0f9a('0x8a')][_0x56ce86]['ItemTypeId']?_0x224879[_0x0f9a('0x8a')][_0x56ce86][_0x0f9a('0x89')]:null,_0x30eb86,_0x221751));}Promise['all'](_0x2b15a3)['then'](function(){db[_0x0f9a('0x23')]['update']({'AdditionalPhones':_0x4b59bb},{'where':{'id':_0x224879['id']}})[_0x0f9a('0x16')](function(){_0x248e23(0x1);});});});});});}function addAdditionalPhone(_0x6660c6,_0x162eb8,_0x4b7f1e,_0x137a2b,_0x3a6999){return db[_0x0f9a('0x49')][_0x0f9a('0x61')]({'where':{'CmContactId':_0x6660c6,'item':_0x162eb8}})[_0x0f9a('0x16')](function(_0x2a2fde){if(_0x2a2fde)logger['info'](_0x0f9a('0x8c'),_0x2a2fde);else{db[_0x0f9a('0x49')][_0x0f9a('0x40')]({'CmContactId':_0x6660c6,'item':_0x162eb8,'ItemTypeId':_0x4b7f1e,'OrderBy':_0x137a2b,'ItemClass':_0x0f9a('0x8d'),'description':_0x3a6999});}});}function deleteCmHopperPhones(_0x59fc20){return new Promise(function(_0x4c5f61){return db[_0x0f9a('0x3d')][_0x0f9a('0x1f')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x59fc20}})[_0x0f9a('0x16')](function(_0x462ac5){db[_0x0f9a('0x8e')][_0x0f9a('0x22')]({'where':{'CmHopperId':{'$in':_[_0x0f9a('0x6d')](_0x462ac5,'id')}}});})[_0x0f9a('0x16')](function(){_0x4c5f61(0x1);});});}function addCmHopperPhones(_0x5c3b50){return new Promise(function(_0x487a8c){return db['CmHopper'][_0x0f9a('0x1f')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x5c3b50}})[_0x0f9a('0x16')](function(_0x32c627){var _0x18fb73=[];_[_0x0f9a('0x6d')](_0x32c627,function(_0x44e451){_0x18fb73[_0x0f9a('0x6c')](createCmHopperPhone(_0x5c3b50,_0x44e451['id']));});Promise[_0x0f9a('0x5f')](_0x18fb73)[_0x0f9a('0x16')](function(){_0x487a8c(0x1);});});});}function createCmHopperPhone(_0x59cad3,_0x53f5db){return new Promise(function(_0x2b79ff){db[_0x0f9a('0x49')][_0x0f9a('0x1f')]({'raw':!![],'attributes':[_0x0f9a('0x8f'),'OrderBy'],'where':{'CmContactId':_0x59cad3,'ItemClass':_0x0f9a('0x8d')},'include':[{'model':db[_0x0f9a('0x67')],'attributes':[_0x0f9a('0x87')],'as':_0x0f9a('0x68')}],'order':[_0x0f9a('0x87'),db[_0x0f9a('0x74')][_0x0f9a('0x69')](_0x0f9a('0x90'))]})[_0x0f9a('0x16')](function(_0x11a611){var _0x3cf9ff=0x1;var _0x8c2318=_['map'](_0x11a611,function(_0x43ce3c){_0x43ce3c['CmHopperId']=_0x53f5db;_0x43ce3c[_0x0f9a('0x76')]=_0x43ce3c['item'];_0x43ce3c['OrderBy']=_0x3cf9ff;delete _0x43ce3c['ItemType.OrderBy'];_0x3cf9ff=_0x3cf9ff+0x1;return _0x43ce3c;});return db[_0x0f9a('0x8e')][_0x0f9a('0x57')](_0x8c2318,{});})['then'](function(){_0x2b79ff(0x1);});});}function insertAdditionalPhones(_0x285f37,_0x2237da){return new Promise(function(_0x17a2ac){var _0x397201=[];for(var _0x4c2a49=0x0;_0x4c2a49<_0x2237da['length'];_0x4c2a49++){var _0x563c8b=_0x2237da[_0x4c2a49];_0x397201['push'](parseContactItemType(_0x563c8b));}Promise[_0x0f9a('0x5f')](_0x397201)[_0x0f9a('0x16')](function(){var _0x4322af={'id':_0x285f37['id'],'items':_0x2237da};return addAdditionalPhones(_0x4322af)[_0x0f9a('0x16')](function(){return addCmHopperPhones(_0x285f37['id']);});})['then'](function(){_0x17a2ac(_0x285f37);});});}function parseContactItemType(_0x3d6de3){return new Promise(function(_0x3e5e08){if(_0x3d6de3[_0x0f9a('0x34')]('ItemTypeId')){_0x3e5e08(_0x3d6de3);}else{return db[_0x0f9a('0x67')][_0x0f9a('0x61')]({'where':{'name':_0x3d6de3['ItemType']}})[_0x0f9a('0x16')](function(_0x4e37ca){if(_[_0x0f9a('0x52')](_0x4e37ca))_0x3d6de3[_0x0f9a('0x89')]=null;else _0x3d6de3['ItemTypeId']=_0x4e37ca['id'];_0x3e5e08(_0x3d6de3);});}});}exports[_0x0f9a('0x91')]=function(_0x570f2d,_0x1aad6c){return db[_0x0f9a('0x49')][_0x0f9a('0x1f')]({'raw':!![],'where':{'CmContactId':_0x570f2d['params']['id'],'ItemClass':'PHONE'},'include':[{'model':db[_0x0f9a('0x67')],'as':_0x0f9a('0x68')}],'order':[['OrderBy'],[db[_0x0f9a('0x74')][_0x0f9a('0x69')](_0x0f9a('0x90'))]]})[_0x0f9a('0x16')](function(_0x7745a0){return _0x7745a0;})[_0x0f9a('0x16')](respondWithResult(_0x1aad6c,null))[_0x0f9a('0x25')](handleError(_0x1aad6c,null));};exports[_0x0f9a('0x92')]=function(_0x267c8c,_0x154371){return db[_0x0f9a('0x49')]['findAll']({'raw':!![],'where':{'CmContactId':_0x267c8c['body'][_0x0f9a('0x93')]}})[_0x0f9a('0x16')](function(_0x33bcbc){var _0x25ec26=_['map'](_0x33bcbc,function(_0x1ad912){_0x1ad912[_0x0f9a('0x94')]=_0x267c8c[_0x0f9a('0x36')][_0x0f9a('0x95')];return _0x1ad912;});return db[_0x0f9a('0x49')][_0x0f9a('0x57')](_0x25ec26,{});})[_0x0f9a('0x16')](function(){return addCmHopperPhones(_0x267c8c['body'][_0x0f9a('0x95')]);})[_0x0f9a('0x16')](function(){return['ok'];})[_0x0f9a('0x16')](respondWithResult(_0x154371,null))['catch'](handleError(_0x154371,null));};exports[_0x0f9a('0x96')]=function(_0x780ad9,_0x5d0a2f){var _0x127a49=[];_0x127a49['push'](createCmHopperPhone(_0x780ad9[_0x0f9a('0x36')]['id'],_0x780ad9[_0x0f9a('0x36')][_0x0f9a('0x97')]));Promise[_0x0f9a('0x5f')](_0x127a49)['then'](function(){return[0x1];})['then'](respondWithResult(_0x5d0a2f,null));};exports[_0x0f9a('0x98')]=function(_0x31f9cf,_0x16675b){var _0xc6e3b8={'raw':![],'where':{}};var _0x3b0fce={};var _0x854923={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x31f9cf[_0x0f9a('0x24')]['id']}})[_0x0f9a('0x16')](handleEntityNotFound(_0x16675b,null))[_0x0f9a('0x16')](function(_0x3a88c8){if(_0x3a88c8){_0x3b0fce[_0x0f9a('0x7c')]=_[_0x0f9a('0x27')](db[_0x0f9a('0x3d')][_0x0f9a('0x79')]);_0x3b0fce[_0x0f9a('0x20')]=_['keys'](_0x31f9cf[_0x0f9a('0x20')]);_0x3b0fce[_0x0f9a('0x7a')]=_['intersection'](_0x3b0fce['model'],_0x3b0fce['query']);_0xc6e3b8[_0x0f9a('0x7d')]=_[_0x0f9a('0x7b')](_0x3b0fce['model'],qs[_0x0f9a('0x7e')](_0x31f9cf[_0x0f9a('0x20')][_0x0f9a('0x7e')]));_0xc6e3b8[_0x0f9a('0x7d')]=_0xc6e3b8[_0x0f9a('0x7d')][_0x0f9a('0x28')]?_0xc6e3b8['attributes']:_0x3b0fce[_0x0f9a('0x7c')];if(!_0x31f9cf[_0x0f9a('0x20')][_0x0f9a('0x34')]('nolimit')){_0xc6e3b8[_0x0f9a('0x10')]=qs['limit'](_0x31f9cf[_0x0f9a('0x20')][_0x0f9a('0x10')]);_0xc6e3b8[_0x0f9a('0xe')]=qs['offset'](_0x31f9cf[_0x0f9a('0x20')][_0x0f9a('0xe')]);}_0xc6e3b8[_0x0f9a('0x7f')]=qs[_0x0f9a('0x80')](_0x31f9cf[_0x0f9a('0x20')][_0x0f9a('0x80')]);_0xc6e3b8[_0x0f9a('0x5a')]=qs[_0x0f9a('0x7a')](_[_0x0f9a('0x81')](_0x31f9cf[_0x0f9a('0x20')],_0x3b0fce['filters']));_0xc6e3b8['where']['ContactId']=_0x3a88c8['id'];if(_0x31f9cf['query'][_0x0f9a('0x82')]){_0xc6e3b8[_0x0f9a('0x5a')]=_[_0x0f9a('0x35')](_0xc6e3b8[_0x0f9a('0x5a')],{'$or':_[_0x0f9a('0x6d')](_0xc6e3b8[_0x0f9a('0x7d')],function(_0x42ad6e){var _0x461039={};_0x461039[_0x42ad6e]={'$like':'%'+_0x31f9cf[_0x0f9a('0x20')][_0x0f9a('0x82')]+'%'};return _0x461039;})});}_0xc6e3b8=_[_0x0f9a('0x35')]({},_0xc6e3b8,_0x31f9cf[_0x0f9a('0x83')]);return db[_0x0f9a('0x3d')][_0x0f9a('0x11')]({'where':_0xc6e3b8[_0x0f9a('0x5a')]})[_0x0f9a('0x16')](function(_0x440a8c){_0x854923[_0x0f9a('0x11')]=_0x440a8c;if(_0x31f9cf[_0x0f9a('0x20')][_0x0f9a('0x99')]){_0xc6e3b8[_0x0f9a('0x9a')]=[{'all':!![]}];}return db['CmHopper'][_0x0f9a('0x1f')](_0xc6e3b8);})[_0x0f9a('0x16')](function(_0x47f11c){_0x854923[_0x0f9a('0x9b')]=_0x47f11c;return _0x854923;});}})[_0x0f9a('0x16')](respondWithFilteredResult(_0x16675b,_0xc6e3b8))[_0x0f9a('0x25')](handleError(_0x16675b,null));};exports[_0x0f9a('0x9c')]=function(_0x183dc1,_0x3d3948){var _0x3b2739={'raw':!![],'where':{}};var _0x3fb488={};var _0x343842={'count':0x0,'rows':[]};return db[_0x0f9a('0x23')][_0x0f9a('0x78')]({'where':{'id':_0x183dc1[_0x0f9a('0x24')]['id']}})[_0x0f9a('0x16')](handleEntityNotFound(_0x3d3948,null))['then'](function(_0x19b0d1){if(_0x19b0d1){_0x3fb488['model']=_['keys'](db[_0x0f9a('0x4b')][_0x0f9a('0x79')]);_0x3fb488['query']=_[_0x0f9a('0x27')](_0x183dc1[_0x0f9a('0x20')]);_0x3fb488[_0x0f9a('0x7a')]=_[_0x0f9a('0x7b')](_0x3fb488[_0x0f9a('0x7c')],_0x3fb488[_0x0f9a('0x20')]);_0x3b2739[_0x0f9a('0x7d')]=_[_0x0f9a('0x7b')](_0x3fb488['model'],qs[_0x0f9a('0x7e')](_0x183dc1[_0x0f9a('0x20')][_0x0f9a('0x7e')]));_0x3b2739[_0x0f9a('0x7d')]=_0x3b2739[_0x0f9a('0x7d')]['length']?_0x3b2739[_0x0f9a('0x7d')]:_0x3fb488[_0x0f9a('0x7c')];if(!_0x183dc1[_0x0f9a('0x20')][_0x0f9a('0x34')]('nolimit')){_0x3b2739['limit']=qs['limit'](_0x183dc1['query'][_0x0f9a('0x10')]);_0x3b2739['offset']=qs['offset'](_0x183dc1[_0x0f9a('0x20')][_0x0f9a('0xe')]);}_0x3b2739[_0x0f9a('0x7f')]=qs[_0x0f9a('0x80')](_0x183dc1[_0x0f9a('0x20')][_0x0f9a('0x80')]);_0x3b2739[_0x0f9a('0x5a')]=qs[_0x0f9a('0x7a')](_['pick'](_0x183dc1[_0x0f9a('0x20')],_0x3fb488['filters']));_0x3b2739[_0x0f9a('0x5a')][_0x0f9a('0x9d')]=_0x19b0d1['id'];if(_0x183dc1[_0x0f9a('0x20')][_0x0f9a('0x82')]){_0x3b2739[_0x0f9a('0x5a')]=_[_0x0f9a('0x35')](_0x3b2739[_0x0f9a('0x5a')],{'$or':_[_0x0f9a('0x6d')](_0x3b2739[_0x0f9a('0x7d')],function(_0x4fe552){var _0x5788a7={};_0x5788a7[_0x4fe552]={'$like':'%'+_0x183dc1['query'][_0x0f9a('0x82')]+'%'};return _0x5788a7;})});}_0x3b2739=_[_0x0f9a('0x35')]({},_0x3b2739,_0x183dc1[_0x0f9a('0x83')]);return db[_0x0f9a('0x4b')]['count']({'where':_0x3b2739[_0x0f9a('0x5a')]})[_0x0f9a('0x16')](function(_0x1196a3){_0x343842['count']=_0x1196a3;if(_0x183dc1[_0x0f9a('0x20')][_0x0f9a('0x99')]){_0x3b2739[_0x0f9a('0x9a')]=[{'all':!![]}];}return db[_0x0f9a('0x4b')]['findAll'](_0x3b2739);})[_0x0f9a('0x16')](function(_0x1571db){_0x343842[_0x0f9a('0x9b')]=_0x1571db;return _0x343842;});}})[_0x0f9a('0x16')](respondWithFilteredResult(_0x3d3948,_0x3b2739))[_0x0f9a('0x25')](handleError(_0x3d3948,null));};exports['getHopperFinals']=function(_0x283f5e,_0x112863){var _0x444333={'raw':!![],'where':{}};var _0x429329={};var _0x537cb7={'count':0x0,'rows':[]};return db['CmContact'][_0x0f9a('0x78')]({'where':{'id':_0x283f5e[_0x0f9a('0x24')]['id']}})[_0x0f9a('0x16')](handleEntityNotFound(_0x112863,null))[_0x0f9a('0x16')](function(_0x454aba){if(_0x454aba){_0x429329[_0x0f9a('0x7c')]=_[_0x0f9a('0x27')](db[_0x0f9a('0x4a')][_0x0f9a('0x79')]);_0x429329[_0x0f9a('0x20')]=_[_0x0f9a('0x27')](_0x283f5e['query']);_0x429329['filters']=_['intersection'](_0x429329[_0x0f9a('0x7c')],_0x429329[_0x0f9a('0x20')]);_0x444333[_0x0f9a('0x7d')]=_[_0x0f9a('0x7b')](_0x429329[_0x0f9a('0x7c')],qs[_0x0f9a('0x7e')](_0x283f5e['query'][_0x0f9a('0x7e')]));_0x444333[_0x0f9a('0x7d')]=_0x444333[_0x0f9a('0x7d')][_0x0f9a('0x28')]?_0x444333[_0x0f9a('0x7d')]:_0x429329['model'];if(!_0x283f5e[_0x0f9a('0x20')]['hasOwnProperty']('nolimit')){_0x444333[_0x0f9a('0x10')]=qs[_0x0f9a('0x10')](_0x283f5e[_0x0f9a('0x20')][_0x0f9a('0x10')]);_0x444333[_0x0f9a('0xe')]=qs['offset'](_0x283f5e[_0x0f9a('0x20')][_0x0f9a('0xe')]);}_0x444333[_0x0f9a('0x7f')]=qs[_0x0f9a('0x80')](_0x283f5e[_0x0f9a('0x20')]['sort']);_0x444333[_0x0f9a('0x5a')]=qs[_0x0f9a('0x7a')](_[_0x0f9a('0x81')](_0x283f5e[_0x0f9a('0x20')],_0x429329[_0x0f9a('0x7a')]));_0x444333[_0x0f9a('0x5a')][_0x0f9a('0x9d')]=_0x454aba['id'];if(_0x283f5e[_0x0f9a('0x20')]['filter']){_0x444333[_0x0f9a('0x5a')]=_['merge'](_0x444333[_0x0f9a('0x5a')],{'$or':_[_0x0f9a('0x6d')](_0x444333[_0x0f9a('0x7d')],function(_0x53a21f){var _0x5c05df={};_0x5c05df[_0x53a21f]={'$like':'%'+_0x283f5e[_0x0f9a('0x20')][_0x0f9a('0x82')]+'%'};return _0x5c05df;})});}_0x444333=_[_0x0f9a('0x35')]({},_0x444333,_0x283f5e['options']);return db[_0x0f9a('0x4a')]['count']({'where':_0x444333[_0x0f9a('0x5a')]})['then'](function(_0x2c609a){_0x537cb7[_0x0f9a('0x11')]=_0x2c609a;if(_0x283f5e[_0x0f9a('0x20')][_0x0f9a('0x99')]){_0x444333['include']=[{'all':!![]}];}return db[_0x0f9a('0x4a')][_0x0f9a('0x1f')](_0x444333);})[_0x0f9a('0x16')](function(_0x29f0a9){_0x537cb7[_0x0f9a('0x9b')]=_0x29f0a9;return _0x537cb7;});}})[_0x0f9a('0x16')](respondWithFilteredResult(_0x112863,_0x444333))[_0x0f9a('0x25')](handleError(_0x112863,null));};exports[_0x0f9a('0x9e')]=function(_0x488126,_0x5c4ee9){var _0x358dd6={'raw':!![],'where':{}};var _0x401506={};var _0x125f71={'count':0x0,'rows':[]};return db[_0x0f9a('0x23')][_0x0f9a('0x78')]({'where':{'id':_0x488126[_0x0f9a('0x24')]['id']}})['then'](handleEntityNotFound(_0x5c4ee9,null))[_0x0f9a('0x16')](function(_0x5c4c4d){if(_0x5c4c4d){_0x401506[_0x0f9a('0x7c')]=_[_0x0f9a('0x27')](db[_0x0f9a('0x4e')][_0x0f9a('0x79')]);_0x401506[_0x0f9a('0x20')]=_['keys'](_0x488126[_0x0f9a('0x20')]);_0x401506[_0x0f9a('0x7a')]=_[_0x0f9a('0x7b')](_0x401506['model'],_0x401506['query']);_0x358dd6['attributes']=_[_0x0f9a('0x7b')](_0x401506[_0x0f9a('0x7c')],qs[_0x0f9a('0x7e')](_0x488126['query'][_0x0f9a('0x7e')]));_0x358dd6[_0x0f9a('0x7d')]=_0x358dd6[_0x0f9a('0x7d')][_0x0f9a('0x28')]?_0x358dd6[_0x0f9a('0x7d')]:_0x401506[_0x0f9a('0x7c')];if(!_0x488126['query']['hasOwnProperty'](_0x0f9a('0x84'))){_0x358dd6[_0x0f9a('0x10')]=qs[_0x0f9a('0x10')](_0x488126['query']['limit']);_0x358dd6[_0x0f9a('0xe')]=qs[_0x0f9a('0xe')](_0x488126[_0x0f9a('0x20')][_0x0f9a('0xe')]);}_0x358dd6['order']=qs[_0x0f9a('0x80')](_0x488126[_0x0f9a('0x20')]['sort']);_0x358dd6[_0x0f9a('0x5a')]=qs[_0x0f9a('0x7a')](_['pick'](_0x488126['query'],_0x401506[_0x0f9a('0x7a')]));_0x358dd6[_0x0f9a('0x5a')]['ContactId']=_0x5c4c4d['id'];if(_0x488126['query'][_0x0f9a('0x82')]){_0x358dd6[_0x0f9a('0x5a')]=_[_0x0f9a('0x35')](_0x358dd6[_0x0f9a('0x5a')],{'$or':_[_0x0f9a('0x6d')](_0x358dd6[_0x0f9a('0x7d')],function(_0x32c636){var _0xbe6f57={};_0xbe6f57[_0x32c636]={'$like':'%'+_0x488126['query']['filter']+'%'};return _0xbe6f57;})});}_0x358dd6=_[_0x0f9a('0x35')]({},_0x358dd6,_0x488126[_0x0f9a('0x83')]);return db[_0x0f9a('0x4e')]['count']({'where':_0x358dd6[_0x0f9a('0x5a')]})[_0x0f9a('0x16')](function(_0x59226e){_0x125f71[_0x0f9a('0x11')]=_0x59226e;if(_0x488126['query'][_0x0f9a('0x99')]){_0x358dd6['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x358dd6);})[_0x0f9a('0x16')](function(_0x530527){_0x125f71['rows']=_0x530527;return _0x125f71;});}})[_0x0f9a('0x16')](respondWithFilteredResult(_0x5c4ee9,_0x358dd6))['catch'](handleError(_0x5c4ee9,null));};exports['uploadCsv']=function(_0x3922ea,_0x4beb39){try{if(!_0x3922ea['body'][_0x0f9a('0x5b')]){throw new Error(_0x0f9a('0x9f'));}if(!_0x3922ea[_0x0f9a('0x36')][_0x0f9a('0xa0')]){throw new Error(_0x0f9a('0xa1'));}if(!_0x3922ea['body'][_0x0f9a('0xa2')]){throw new Error(_0x0f9a('0xa3'));}if(!_0x3922ea[_0x0f9a('0x36')]['socket_timestamp']){throw new Error(_0x0f9a('0xa4'));}var _0x3c767b=_0x3922ea['body'][_0x0f9a('0xa0')][_0x0f9a('0xa5')](',');var _0x48b5c8=_0x3922ea[_0x0f9a('0x36')][_0x0f9a('0xa2')][_0x0f9a('0xa5')](',');if(!_0x3c767b[_0x0f9a('0x28')]||!_0x48b5c8[_0x0f9a('0x28')]||_0x3c767b['length']!==_0x48b5c8['length']){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x3922ea[_0x0f9a('0x36')][_0x0f9a('0x7e')]=_[_0x0f9a('0xa6')](_0x3c767b,_0x48b5c8);if(!_0x3922ea[_0x0f9a('0x36')][_0x0f9a('0x7e')][_0x0f9a('0x76')]){throw new Error(_0x0f9a('0xa7'));}if(!_0x3922ea[_0x0f9a('0x36')][_0x0f9a('0x7e')]['firstName']){throw new Error(_0x0f9a('0xa8'));}var _0x1d9880=path[_0x0f9a('0x3b')](config[_0x0f9a('0xa9')],'server/files/tmp',_0x3922ea['file'][_0x0f9a('0xaa')]);fs[_0x0f9a('0xab')](_0x1d9880,parseInt(_0x0f9a('0xac'),0x8));var _0x2f176e=require('child_process')['fork'](path[_0x0f9a('0x3b')](__dirname,_0x0f9a('0xad')),[_0x1d9880,_0x3922ea['body'][_0x0f9a('0xa0')],_0x3922ea[_0x0f9a('0x36')][_0x0f9a('0xa2')],_0x3922ea[_0x0f9a('0x36')][_0x0f9a('0x5b')],_0x3922ea[_0x0f9a('0x36')][_0x0f9a('0xae')],_0x3922ea['body'][_0x0f9a('0x59')],_0x3922ea['body'][_0x0f9a('0xaf')]]);return _0x4beb39[_0x0f9a('0x12')](0xc8)[_0x0f9a('0x14')]({'message':_0x0f9a('0xb0'),'pid':_0x2f176e[_0x0f9a('0xb1')]});}catch(_0x28f74e){return _0x4beb39[_0x0f9a('0x12')](0x1f4)[_0x0f9a('0x1b')](_0x28f74e);}};exports[_0x0f9a('0xb2')]=function(_0x3734b6,_0x544742){var _0x42353e=fs[_0x0f9a('0xb3')](_0x3734b6['file']['path']);Papa['parse'](_0x42353e,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4b1c3d){return _0x544742[_0x0f9a('0x12')](0xc8)[_0x0f9a('0x14')]({'file':_0x3734b6['file'],'fields':_0x4b1c3d['meta'][_0x0f9a('0x7e')]});}});};exports[_0x0f9a('0xb4')]=function(_0xaadd9e,_0x1bc2e2){return db['User'][_0x0f9a('0x1f')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x0f9a('0x16')](function(_0x390b70){var _0xb7558f=![];if(!_0xaadd9e[_0x0f9a('0x36')]['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0xaadd9e[_0x0f9a('0x36')]['binding'][_0x0f9a('0x76')]){throw new Error(_0x0f9a('0xa7'));}if(!_0xaadd9e[_0x0f9a('0x36')][_0x0f9a('0xb5')]['firstName']){throw new Error(_0x0f9a('0xa8'));}if(!_0xaadd9e['body'][_0x0f9a('0xaf')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x202b87=require(_0x0f9a('0xb6'))['fork'](path['join'](__dirname,_0x0f9a('0xb7')),[_0xaadd9e['params']['id'],JSON['stringify'](_0xaadd9e[_0x0f9a('0x36')]),JSON['stringify'](_0x390b70)]);_0x202b87['on']('message',function(){_0xb7558f=!![];return _0x1bc2e2[_0x0f9a('0x12')](0xc8)[_0x0f9a('0x14')]({'message':_0x0f9a('0xb8'),'pid':_0x202b87[_0x0f9a('0xb1')]});});_0x202b87['on'](_0x0f9a('0xb9'),function(_0x196c81){if(_0x196c81&&!_0xb7558f){return _0x1bc2e2['status'](0x1f4)[_0x0f9a('0x14')]({'message':_0x0f9a('0xba'),'pid':_0x202b87[_0x0f9a('0xb1')]});}});})[_0x0f9a('0x25')](handleError(_0x1bc2e2,null));};exports[_0x0f9a('0xbb')]=function(_0x40875c,_0x51bd28){return db[_0x0f9a('0xbc')][_0x0f9a('0x1f')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x0f9a('0x16')](function(_0x17b9bc){var _0x1a61fa=![];if(!_0x40875c['body'][_0x0f9a('0x5b')]){throw new Error('No\x20ListId\x20specified');}if(!_0x40875c[_0x0f9a('0x36')]['binding']['phone']){throw new Error(_0x0f9a('0xa7'));}if(!_0x40875c[_0x0f9a('0x36')]['binding'][_0x0f9a('0xbd')]){throw new Error(_0x0f9a('0xa8'));}if(!_0x40875c[_0x0f9a('0x36')][_0x0f9a('0xaf')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x5e21d9=require(_0x0f9a('0xb6'))[_0x0f9a('0xbe')](path[_0x0f9a('0x3b')](__dirname,_0x0f9a('0xbf')),[_0x40875c[_0x0f9a('0x24')]['id'],JSON[_0x0f9a('0xc0')](_0x40875c[_0x0f9a('0x36')]),JSON[_0x0f9a('0xc0')](_0x17b9bc)]);_0x5e21d9['on'](_0x0f9a('0xc1'),function(){_0x1a61fa=!![];return _0x51bd28[_0x0f9a('0x12')](0xc8)[_0x0f9a('0x14')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x5e21d9['pid']});});_0x5e21d9['on'](_0x0f9a('0xb9'),function(_0x30df28){if(_0x30df28&&!_0x1a61fa){return _0x51bd28[_0x0f9a('0x12')](0x1f4)['json']({'message':_0x0f9a('0xba'),'pid':_0x5e21d9[_0x0f9a('0xb1')]});}});})[_0x0f9a('0x25')](handleError(_0x51bd28,null));};exports['getJourney']=function(_0x49a61b,_0x289a40){var _0x3ddce1=[_0x0f9a('0xc2'),_0x0f9a('0xc3'),'sms',_0x0f9a('0xc4'),_0x0f9a('0xc5'),_0x0f9a('0xc6'),_0x0f9a('0xc7')];var _0x13b6c5={'offset':0x0,'order':qs['sort'](_0x0f9a('0xc8'))},_0x4b99e7={'count':0x0,'rows':[]};Promise['resolve']()['then'](function(){if(_0x49a61b['query'][_0x0f9a('0xc9')]){if(!_[_0x0f9a('0xca')](_0x3ddce1,_0x49a61b['query'][_0x0f9a('0xc9')]['toLowerCase']())){throw new Error(_0x0f9a('0xcb'));}_0x3ddce1=[_0x49a61b[_0x0f9a('0x20')][_0x0f9a('0xc9')][_0x0f9a('0xcc')]()];}if(_0x49a61b[_0x0f9a('0x20')][_0x0f9a('0xcd')]){try{var _0x29ec38=JSON[_0x0f9a('0xce')](_0x49a61b[_0x0f9a('0x20')]['range']);if(!moment(_0x29ec38[_0x0f9a('0x37')])['isValid']()){throw new Error(_0x0f9a('0xcf'));}if(!moment(_0x29ec38['to'])['isValid']()){throw new Error(_0x0f9a('0xd0'));}}catch(_0x27c101){throw new Error(_0x0f9a('0xd1'));}}if(!_0x49a61b[_0x0f9a('0x20')]['hasOwnProperty'](_0x0f9a('0x84'))){_0x13b6c5[_0x0f9a('0x10')]=qs[_0x0f9a('0x10')](_0x49a61b[_0x0f9a('0x20')]['limit']||0xa);_0x13b6c5[_0x0f9a('0xe')]=qs['offset'](_0x49a61b['query'][_0x0f9a('0xe')]);}var _0x240b23=_0x3ddce1[_0x0f9a('0x6d')](function(_0x680c95){if(_0x680c95==='voice'){var _0x1830b5={'attributes':['id',_0x0f9a('0xd2'),_0x0f9a('0xd3'),_0x0f9a('0xd4'),_0x0f9a('0xd5'),_0x0f9a('0xd6'),_0x0f9a('0xd7'),'endtime','duration',_0x0f9a('0xd8'),_0x0f9a('0xd9'),_0x0f9a('0xda'),'userSecondDisposition',_0x0f9a('0xdb'),_0x0f9a('0xdc')],'where':{'ContactId':_0x49a61b[_0x0f9a('0x24')]['id']},'include':[{'model':db[_0x0f9a('0xbc')],'as':_0x0f9a('0xbc'),'attributes':['id',_0x0f9a('0x1a'),'fullname',_0x0f9a('0x2f')]}],'order':[[_0x0f9a('0xd9'),_0x0f9a('0xdd')]]};if(_0x49a61b[_0x0f9a('0x20')][_0x0f9a('0xcd')]){_0x1830b5[_0x0f9a('0x5a')]['createdAt']={'$gte':_0x29ec38[_0x0f9a('0x37')],'$lte':_0x29ec38['to']};}return db[_0x0f9a('0x4c')][_0x0f9a('0xde')](_0x1830b5)[_0x0f9a('0x16')](function(_0x2d29fe){_0x4b99e7[_0x0f9a('0x11')]+=_0x2d29fe[_0x0f9a('0x11')];return _['map'](_0x2d29fe['rows'],function(_0x5d88d6){var _0x49becb=_0x5d88d6[_0x0f9a('0x38')]({'plain':!![]});_0x49becb[_0x0f9a('0xc9')]=_0x680c95;if(_0x49becb['User']){_0x49becb['User']={'id':_0x49becb[_0x0f9a('0xbc')]['id'],'name':_0x49becb[_0x0f9a('0xbc')][_0x0f9a('0x1a')],'fullname':_0x49becb[_0x0f9a('0xbc')][_0x0f9a('0xdf')],'alias':_0x49becb[_0x0f9a('0xbc')][_0x0f9a('0x2f')]};}return _0x49becb;});});}else{var _0x5b7063=_[_0x0f9a('0xe0')](_0x680c95)+(_0x680c95===_0x0f9a('0xc3')?_0x0f9a('0xe1'):'Account');var _0x218856={'attributes':['id',_0x0f9a('0xe2'),_0x0f9a('0xe3'),_0x0f9a('0xd9'),_0x0f9a('0xd8'),_0x0f9a('0xe4'),_0x0f9a('0xe5'),_0x0f9a('0xe6'),_0x0f9a('0xdc'),_0x5b7063+'Id'],'where':{'ContactId':_0x49a61b['params']['id']},'include':[{'model':db[_0x5b7063],'as':_0x0f9a('0xe7'),'attributes':['id',_0x0f9a('0x1a'),_0x0f9a('0xe8')]},{'model':db['User'],'as':'Owner','attributes':['id',_0x0f9a('0x1a'),_0x0f9a('0xdf')]},{'model':db['Tag'],'as':_0x0f9a('0x63'),'attributes':['id',_0x0f9a('0x1a'),_0x0f9a('0x64')],'through':{'attributes':[]}}],'order':[['createdAt',_0x0f9a('0xdd')]]};if(_0x49a61b[_0x0f9a('0x20')][_0x0f9a('0xcd')]){_0x218856[_0x0f9a('0x5a')][_0x0f9a('0xd9')]={'$gte':_0x29ec38[_0x0f9a('0x37')],'$lte':_0x29ec38['to']};}switch(_0x680c95){case _0x0f9a('0xc3'):_0x218856['attributes'][_0x0f9a('0x6c')](_0x0f9a('0xe9'),'customerIp',_0x0f9a('0xea'),_0x0f9a('0xeb'),_0x0f9a('0xec'),_0x0f9a('0xed'),_0x0f9a('0xee'),'ratingValue',_0x0f9a('0xef'));break;case'mail':_0x218856[_0x0f9a('0x7d')][_0x0f9a('0x6c')](_0x0f9a('0xf0'),_0x0f9a('0xf1'));break;case _0x0f9a('0xc4'):_0x218856[_0x0f9a('0x7d')]['push']('externalUrl',_0x0f9a('0xf2'));break;}return db[_[_0x0f9a('0xe0')](_0x680c95)+_0x0f9a('0xf3')]['findAndCountAll'](_0x218856)['then'](function(_0x4cb984){_0x4b99e7[_0x0f9a('0x11')]+=_0x4cb984[_0x0f9a('0x11')];return _['map'](_0x4cb984['rows'],function(_0x4efddf){var _0x1716df=_0x4efddf[_0x0f9a('0x38')]({'plain':!![]});_0x1716df['channel']=_0x680c95;if(_0x1716df[_0x0f9a('0xf4')]){_0x1716df[_0x0f9a('0xf4')]={'id':_0x1716df[_0x0f9a('0xf4')]['id'],'name':_0x1716df['Owner'][_0x0f9a('0x1a')],'fullname':_0x1716df[_0x0f9a('0xf4')][_0x0f9a('0xdf')]};}return _0x1716df;});});}});return Promise['all'](_0x240b23);})['then'](function(_0x5bea9f){return _(_0x5bea9f)[_0x0f9a('0xf5')]()[_0x0f9a('0xf6')](_0x0f9a('0xd9'))['reverse']()[_0x0f9a('0xf7')]();})[_0x0f9a('0x16')](function(_0x10cbb0){_0x4b99e7[_0x0f9a('0x9b')]=_0x13b6c5[_0x0f9a('0x10')]?_0x10cbb0[_0x0f9a('0xf8')](_0x13b6c5[_0x0f9a('0xe')],_0x13b6c5['offset']+_0x13b6c5[_0x0f9a('0x10')]):_0x10cbb0;return _0x4b99e7;})[_0x0f9a('0x16')](respondWithFilteredResult(_0x289a40,_0x13b6c5))['catch'](handleError(_0x289a40,null));}; \ No newline at end of file +var _0xea05=['order','pick','filter','nolimit','findOne','ids','setAdditionalPhones','OrderBy','item_types','items','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','intersection','ContactId','options','includeAll','getHopperHistories','sort','include','rows','getHopperFinals','rawAttributes','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','upload','createReadStream','parse','file','meta','import','agent','binding','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','importUpdates','User','message','chat','sms','whatsapp','voice','-createdAt','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','destination','callerid','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','DESC','findAndCountAll','fullname','startCase','Website','Account','closed','closedAt','note','disposition','secondDisposition','key','Owner','browserName','customerPort','deviceModel','ratingMessage','ratingType','referer','mail','subject','substatus','externalUrl','flatten','sortBy','reverse','value','slice','moment','util','path','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','undefined','limit','count','offset','set','update','then','destroy','end','sendStatus','name','send','describe','getOptions','findAll','user','CmContact','find','keys','length','startsWith','columnName','analytics','query','CmCustomField','cf_','displayName','alias','values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','catch','merge','body','from','get','mergeWith','isArray','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','isNil','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','push','ListId','findOrCreate','spread','all','show','params','Tag','Tags','color','CmContactHasItem','Phones','ContactItemType','ItemType','sequelize','literal','$and','omit','map','format','cf_%d','dialTimezone','isEmpty','table','cm_contacts','setFields','toParam','phone','getTags','model','filters','attributes','fields'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xea05,0x7b));var _0x5ea0=function(_0x380165,_0x4df1cf){_0x380165=_0x380165-0x0;var _0x2183c7=_0xea05[_0x380165];return _0x2183c7;};'use strict';var moment=require(_0x5ea0('0x0'));var BPromise=require('bluebird');var util=require(_0x5ea0('0x1'));var path=require(_0x5ea0('0x2'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x5ea0('0x3'));var contacts=require(_0x5ea0('0x4'));var qs=require(_0x5ea0('0x5'));var logger=require(_0x5ea0('0x6'))(_0x5ea0('0x7'));var config=require(_0x5ea0('0x8'));var shared=require(_0x5ea0('0x9'));var db=require(_0x5ea0('0xa'))['db'];config[_0x5ea0('0xb')]=_[_0x5ea0('0xc')](config[_0x5ea0('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ea0('0xd'))(new Redis(config['redis']));require(_0x5ea0('0xe'))[_0x5ea0('0xf')](socket);function respondWithResult(_0x1b1ee7,_0x4a8042){_0x4a8042=_0x4a8042||0xc8;return function(_0x373b72){if(_0x373b72){return _0x1b1ee7[_0x5ea0('0x10')](_0x4a8042)['json'](_0x373b72);}};}function respondWithFilteredResult(_0x1f9e20,_0x1762ac){return function(_0x16ed71){if(_0x16ed71){var _0xcf5b48=typeof _0x1762ac['offset']===_0x5ea0('0x11')&&typeof _0x1762ac[_0x5ea0('0x12')]===_0x5ea0('0x11');var _0x35e3ae=_0x16ed71[_0x5ea0('0x13')];var _0x312edc=_0xcf5b48?0x0:_0x1762ac[_0x5ea0('0x14')];var _0x57ff29=_0xcf5b48?_0x16ed71[_0x5ea0('0x13')]:_0x1762ac[_0x5ea0('0x14')]+_0x1762ac[_0x5ea0('0x12')];var _0x3e6b15;if(_0x57ff29>=_0x35e3ae){_0x57ff29=_0x35e3ae;_0x3e6b15=0xc8;}else{_0x3e6b15=0xce;}_0x1f9e20[_0x5ea0('0x10')](_0x3e6b15);return _0x1f9e20[_0x5ea0('0x15')]('Content-Range',_0x312edc+'-'+_0x57ff29+'/'+_0x35e3ae)['json'](_0x16ed71);}return null;};}function saveUpdates(_0x3d0b7c){return function(_0x1091d1){if(_0x1091d1){return _0x1091d1[_0x5ea0('0x16')](_0x3d0b7c)[_0x5ea0('0x17')](function(_0x598c71){return _0x598c71;});}return null;};}function removeEntity(_0x53a49f){return function(_0x35284d){if(_0x35284d){return _0x35284d[_0x5ea0('0x18')]()[_0x5ea0('0x17')](function(){_0x53a49f['status'](0xcc)[_0x5ea0('0x19')]();});}};}function handleEntityNotFound(_0x56aba3){return function(_0x119d67){if(!_0x119d67){_0x56aba3[_0x5ea0('0x1a')](0x194);}return _0x119d67;};}function handleError(_0x4485d7,_0x3dc778){_0x3dc778=_0x3dc778||0x1f4;return function(_0x2004ec){logger['error'](_0x2004ec['stack']);if(_0x2004ec[_0x5ea0('0x1b')]){delete _0x2004ec[_0x5ea0('0x1b')];}_0x4485d7[_0x5ea0('0x10')](_0x3dc778)[_0x5ea0('0x1c')](_0x2004ec);};}exports['index']=function(_0x46a8fa,_0x18658d){var _0x307299={};return contacts[_0x5ea0('0x1d')]()[_0x5ea0('0x17')](function(_0x2daecb){_0x307299=qs[_0x5ea0('0x1e')](_0x2daecb,_0x46a8fa);return contacts[_0x5ea0('0x1f')](_0x46a8fa['query'],_0x46a8fa[_0x5ea0('0x20')],_0x307299,_0x2daecb);})[_0x5ea0('0x17')](respondWithFilteredResult(_0x18658d,_0x307299))['catch'](handleError(_0x18658d,null));};exports['destroy']=function(_0x52ab96,_0xb42a63){return db[_0x5ea0('0x21')][_0x5ea0('0x22')]({'where':{'id':_0x52ab96['params']['id']}})[_0x5ea0('0x17')](handleEntityNotFound(_0xb42a63,null))[_0x5ea0('0x17')](removeEntity(_0xb42a63,null))['catch'](handleError(_0xb42a63,null));};exports[_0x5ea0('0x1d')]=function(_0x4ed0b6,_0x5c97f6){return db[_0x5ea0('0x21')]['describe']()[_0x5ea0('0x17')](function(_0x10d0e0){delete _0x10d0e0['tags'];for(var _0x11555f=0x0;_0x11555f0x0){return new Promise(function(_0x182512){var _0x56b2b5=[];for(var _0x1311df=0x0;_0x1311df<_0x4bcd76['length'];_0x1311df++){_0x56b2b5[_0x5ea0('0x5c')](insertAdditionalPhones(_0x4bcd76[_0x1311df]['contact'],_0x4bcd76[_0x1311df]['additionalPhones']));}Promise[_0x5ea0('0x60')](_0x56b2b5)[_0x5ea0('0x17')](function(){_0x182512(0x1);});})['then'](function(){return{'success':_0x2f45fa,'failure':_0x176b9c,'duplicates':_0x3bfbe0};});}else{return{'success':_0x2f45fa,'failure':_0x176b9c,'duplicates':_0x3bfbe0};}}})['then'](respondWithResult(_0x33850c,0xc9))[_0x5ea0('0x31')](handleError(_0x33850c,null));};exports[_0x5ea0('0x61')]=function(_0x453771,_0x5b897d){var _0x1b2a25;return db[_0x5ea0('0x21')][_0x5ea0('0x1d')]()['then'](function(_0x396192){return db['CmContact'][_0x5ea0('0x22')]({'where':{'id':_0x453771[_0x5ea0('0x62')]['id']},'include':[{'model':db[_0x5ea0('0x63')],'as':_0x5ea0('0x64'),'attributes':['id',_0x5ea0('0x1b'),_0x5ea0('0x65')],'required':_0x453771[_0x5ea0('0x28')]['tag']?!![]:![]},{'model':db[_0x5ea0('0x66')],'as':_0x5ea0('0x67'),'where':{'CmContactId':_0x453771[_0x5ea0('0x62')]['id']},'required':![],'include':[{'model':db[_0x5ea0('0x68')],'as':_0x5ea0('0x69')}]}],'order':[db[_0x5ea0('0x6a')][_0x5ea0('0x6b')]('Phones.OrderBy')],'attributes':_['keys'](_0x396192)});})[_0x5ea0('0x17')](function(_0x4aea2f){if(!_['isNil'](_0x4aea2f)){_0x1b2a25=_0x4aea2f['get']({'plain':!![]});var _0x4f4f3d={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4aea2f&&_0x4aea2f['ListId']){if(_0x4aea2f[_0x5ea0('0x5d')]){_0x4f4f3d[_0x5ea0('0x5b')][_0x5ea0('0x6c')][_0x5ea0('0x5c')]({'ListId':{'$ne':_0x4aea2f['ListId']}});}}return db[_0x5ea0('0x29')][_0x5ea0('0x1f')](_0x4f4f3d);}})[_0x5ea0('0x17')](function(_0x455807){if(!_[_0x5ea0('0x54')](_0x455807)){return _[_0x5ea0('0x6d')](_0x1b2a25,_[_0x5ea0('0x6e')](_0x455807,function(_0x6bc691){return util[_0x5ea0('0x6f')](_0x5ea0('0x70'),_0x6bc691['id']);}));}})[_0x5ea0('0x17')](handleEntityNotFound(_0x5b897d,null))[_0x5ea0('0x17')](respondWithResult(_0x5b897d,null))[_0x5ea0('0x31')](handleError(_0x5b897d,null));};exports[_0x5ea0('0x16')]=function(_0x39e06a,_0x32c79c){var _0x23b644;if(_0x39e06a['body']['id']){delete _0x39e06a['body']['id'];}if(!_[_0x5ea0('0x54')](_0x39e06a[_0x5ea0('0x33')][_0x5ea0('0x71')])){var _0x5cde87=_0x39e06a[_0x5ea0('0x33')][_0x5ea0('0x71')];if(!_['isNil'](shared[_0x5ea0('0x55')][_0x5cde87]))_0x39e06a[_0x5ea0('0x33')][_0x5ea0('0x56')]=shared['timezones'][_0x5cde87][_0x5ea0('0x56')];}return db[_0x5ea0('0x21')][_0x5ea0('0x22')]({'where':{'id':_0x39e06a['params']['id']}})[_0x5ea0('0x17')](handleEntityNotFound(_0x32c79c,null))[_0x5ea0('0x17')](saveUpdates(_0x39e06a['body'],null))[_0x5ea0('0x17')](function(_0x22e831){_0x23b644=_0x22e831;var _0x6c6c4={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x22e831&&_0x22e831[_0x5ea0('0x5d')]){if(_0x22e831['ListId']){_0x6c6c4[_0x5ea0('0x5b')][_0x5ea0('0x6c')][_0x5ea0('0x5c')]({'ListId':{'$ne':_0x22e831['ListId']}});}}return db[_0x5ea0('0x29')][_0x5ea0('0x1f')](_0x6c6c4);})[_0x5ea0('0x17')](function(_0x4c358){if(_0x4c358){return _[_0x5ea0('0x6d')](_['pickBy'](_0x39e06a[_0x5ea0('0x33')],function(_0xf19be7,_0x23a979){return _[_0x5ea0('0x25')](_0x23a979,_0x5ea0('0x2a'));}),_[_0x5ea0('0x6e')](_0x4c358,function(_0x1c0b0b){return util['format'](_0x5ea0('0x70'),_0x1c0b0b['id']);}));}})[_0x5ea0('0x17')](function(_0x4c217d){if(_0x4c217d&&!_[_0x5ea0('0x72')](_0x4c217d)){var _0x3e34f7=squel[_0x5ea0('0x16')]()[_0x5ea0('0x73')](_0x5ea0('0x74'))[_0x5ea0('0x75')](_0x4c217d)[_0x5ea0('0x5b')]('id\x20=\x20?',_0x39e06a[_0x5ea0('0x62')]['id'])[_0x5ea0('0x76')]();return db[_0x5ea0('0x6a')]['query'](_0x3e34f7['text'],{'replacements':_0x3e34f7[_0x5ea0('0x2d')]});}})[_0x5ea0('0x17')](function(){if(_0x39e06a[_0x5ea0('0x33')][_0x5ea0('0x77')]&&_0x23b644){return db[_0x5ea0('0x3b')]['update']({'phone':_0x39e06a['body']['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x23b644['id']}});}})[_0x5ea0('0x17')](function(){return _0x23b644;})['then'](respondWithResult(_0x32c79c,null))[_0x5ea0('0x31')](handleError(_0x32c79c,null));};exports[_0x5ea0('0x78')]=function(_0x1e1a14,_0x2a6032){var _0x22f1c3={};var _0x3949cb={};var _0x2f8b09;var _0x43d252;return db[_0x5ea0('0x21')]['findOne']({'where':{'id':_0x1e1a14[_0x5ea0('0x62')]['id']}})[_0x5ea0('0x17')](handleEntityNotFound(_0x2a6032,null))[_0x5ea0('0x17')](function(_0x2c1c58){if(_0x2c1c58){_0x2f8b09=_0x2c1c58;_0x3949cb[_0x5ea0('0x79')]=_[_0x5ea0('0x23')](db[_0x5ea0('0x63')]['rawAttributes']);_0x3949cb[_0x5ea0('0x28')]=_['keys'](_0x1e1a14['query']);_0x3949cb[_0x5ea0('0x7a')]=_['intersection'](_0x3949cb[_0x5ea0('0x79')],_0x3949cb['query']);_0x22f1c3[_0x5ea0('0x7b')]=_['intersection'](_0x3949cb[_0x5ea0('0x79')],qs[_0x5ea0('0x7c')](_0x1e1a14['query'][_0x5ea0('0x7c')]));_0x22f1c3['attributes']=_0x22f1c3['attributes'][_0x5ea0('0x24')]?_0x22f1c3['attributes']:_0x3949cb['model'];_0x22f1c3[_0x5ea0('0x7d')]=qs['sort'](_0x1e1a14[_0x5ea0('0x28')]['sort']);_0x22f1c3[_0x5ea0('0x5b')]=qs['filters'](_[_0x5ea0('0x7e')](_0x1e1a14['query'],_0x3949cb[_0x5ea0('0x7a')]));if(_0x1e1a14[_0x5ea0('0x28')][_0x5ea0('0x7f')]){_0x22f1c3['where']=_[_0x5ea0('0x32')](_0x22f1c3[_0x5ea0('0x5b')],{'$or':_['map'](_0x22f1c3[_0x5ea0('0x7b')],function(_0x1536d8){var _0x3cc26={};_0x3cc26[_0x1536d8]={'$like':'%'+_0x1e1a14[_0x5ea0('0x28')][_0x5ea0('0x7f')]+'%'};return _0x3cc26;})});}_0x22f1c3=_[_0x5ea0('0x32')]({},_0x22f1c3,_0x1e1a14['options']);return _0x2f8b09['getTags'](_0x22f1c3);}})['then'](function(_0x37c117){if(_0x37c117){_0x43d252=_0x37c117[_0x5ea0('0x24')];if(!_0x1e1a14[_0x5ea0('0x28')][_0x5ea0('0x30')](_0x5ea0('0x80'))){_0x22f1c3[_0x5ea0('0x12')]=qs[_0x5ea0('0x12')](_0x1e1a14[_0x5ea0('0x28')]['limit']);_0x22f1c3[_0x5ea0('0x14')]=qs[_0x5ea0('0x14')](_0x1e1a14[_0x5ea0('0x28')][_0x5ea0('0x14')]);}return _0x2f8b09['getTags'](_0x22f1c3);}})[_0x5ea0('0x17')](function(_0x5d0d5c){if(_0x5d0d5c){return _0x5d0d5c?{'count':_0x43d252,'rows':_0x5d0d5c}:null;}})[_0x5ea0('0x17')](respondWithResult(_0x2a6032,null))['catch'](handleError(_0x2a6032,null));};exports['setTags']=function(_0x508312,_0xbed269){if(_0x508312[_0x5ea0('0x33')]['id']){delete _0x508312[_0x5ea0('0x33')]['id'];}return db[_0x5ea0('0x21')][_0x5ea0('0x81')]({'where':{'id':_0x508312[_0x5ea0('0x62')]['id']}})[_0x5ea0('0x17')](handleEntityNotFound(_0xbed269,null))['then'](function(_0x405db9){if(_0x405db9){return _0x405db9['setTags'](_0x508312[_0x5ea0('0x33')][_0x5ea0('0x82')]||[]);}return null;})[_0x5ea0('0x17')](respondWithResult(_0xbed269,null))[_0x5ea0('0x31')](handleError(_0xbed269,null));};exports[_0x5ea0('0x83')]=function(_0x456713,_0x3bd2c7){var _0x5efcc5=[];_0x5efcc5['push'](addAdditionalPhones(_0x456713['body']));Promise['all'](_0x5efcc5)[_0x5ea0('0x17')](function(){_0x5efcc5=[];_0x5efcc5[_0x5ea0('0x5c')](deleteCmHopperPhones(_0x456713[_0x5ea0('0x33')]['id']));_0x5efcc5[_0x5ea0('0x5c')](addCmHopperPhones(_0x456713[_0x5ea0('0x33')]['id']));Promise[_0x5ea0('0x60')](_0x5efcc5)[_0x5ea0('0x17')](function(){return[0x1];})['then'](respondWithResult(_0x3bd2c7,null));});};function addAdditionalPhones(_0x323cbe){var _0x1b5238;return new Promise(function(_0x3002b3){return db['CmContactHasItem']['destroy']({'where':{'CmContactId':_0x323cbe['id']}})[_0x5ea0('0x17')](function(){db['ContactItemType']['findAll']({'raw':!![],'attributes':['id',_0x5ea0('0x84')]})[_0x5ea0('0x17')](function(_0x24bd31){var _0x129258=[];for(var _0x50fec7=0x0;_0x50fec7<_0x323cbe['items'][_0x5ea0('0x24')];_0x50fec7++){var _0x48d8fa=_0x323cbe[_0x5ea0('0x85')]?_['isNil'](_0x323cbe[_0x5ea0('0x85')][_0x50fec7])?'':_0x323cbe[_0x5ea0('0x85')][_0x50fec7]:_0x323cbe[_0x5ea0('0x86')][_0x50fec7][_0x5ea0('0x87')]?_0x323cbe[_0x5ea0('0x86')][_0x50fec7]['ItemTypeId']:'';var _0x2dc8d9=_['isNil'](_0x323cbe['items'][_0x50fec7]['description'])?'':_0x323cbe[_0x5ea0('0x86')][_0x50fec7][_0x5ea0('0x88')];var _0x43fad5=_0x48d8fa+':'+_0x323cbe[_0x5ea0('0x86')][_0x50fec7]['phone']+'§'+_0x2dc8d9;if(_['isNil'](_0x1b5238))_0x1b5238=_0x43fad5;else _0x1b5238+=';'+_0x43fad5;var _0x2c3dce=null;var _0x581620=null;if(_0x323cbe['item_types']){if(!_[_0x5ea0('0x54')](_0x323cbe[_0x5ea0('0x85')][_0x50fec7])){_0x581620=_['find'](_0x24bd31,function(_0x25cb66){return _0x25cb66['id']===_0x323cbe[_0x5ea0('0x85')][_0x50fec7];});if(!_['isNil'](_0x581620)){_0x2c3dce=_0x581620[_0x5ea0('0x84')];}}}else{if(!_[_0x5ea0('0x54')](_0x323cbe[_0x5ea0('0x86')][_0x50fec7])){_0x581620=_[_0x5ea0('0x22')](_0x24bd31,function(_0x47de94){return _0x47de94['id']===_0x323cbe[_0x5ea0('0x86')][_0x50fec7][_0x5ea0('0x87')];});if(!_[_0x5ea0('0x54')](_0x581620)){_0x2c3dce=_0x50fec7;}}}if(_[_0x5ea0('0x54')](_0x2c3dce)){_0x2c3dce=0x64;}_0x129258[_0x5ea0('0x5c')](addAdditionalPhone(_0x323cbe['id'],_0x323cbe[_0x5ea0('0x86')][_0x50fec7]['phone'],_0x323cbe[_0x5ea0('0x85')]?_[_0x5ea0('0x54')](_0x323cbe[_0x5ea0('0x85')][_0x50fec7])?null:_0x323cbe[_0x5ea0('0x85')][_0x50fec7]:_0x323cbe[_0x5ea0('0x86')][_0x50fec7][_0x5ea0('0x87')]?_0x323cbe['items'][_0x50fec7][_0x5ea0('0x87')]:null,_0x2c3dce,_0x2dc8d9));}Promise[_0x5ea0('0x60')](_0x129258)[_0x5ea0('0x17')](function(){db['CmContact']['update']({'AdditionalPhones':_0x1b5238},{'where':{'id':_0x323cbe['id']}})[_0x5ea0('0x17')](function(){_0x3002b3(0x1);});});});});});}function addAdditionalPhone(_0x416189,_0x41ad95,_0x3fb1ca,_0x4f17c0,_0x567393){return db[_0x5ea0('0x66')]['find']({'where':{'CmContactId':_0x416189,'item':_0x41ad95}})[_0x5ea0('0x17')](function(_0x8b405d){if(_0x8b405d)logger[_0x5ea0('0x3c')](_0x5ea0('0x89'),_0x8b405d);else{db[_0x5ea0('0x66')]['create']({'CmContactId':_0x416189,'item':_0x41ad95,'ItemTypeId':_0x3fb1ca,'OrderBy':_0x4f17c0,'ItemClass':_0x5ea0('0x8a'),'description':_0x567393});}});}function deleteCmHopperPhones(_0x48a36a){return new Promise(function(_0x40ef64){return db['CmHopper'][_0x5ea0('0x1f')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x48a36a}})[_0x5ea0('0x17')](function(_0x2fed5a){db[_0x5ea0('0x8b')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x5ea0('0x6e')](_0x2fed5a,'id')}}});})[_0x5ea0('0x17')](function(){_0x40ef64(0x1);});});}function addCmHopperPhones(_0x4c4215){return new Promise(function(_0x4f8a82){return db[_0x5ea0('0x3b')][_0x5ea0('0x1f')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x4c4215}})[_0x5ea0('0x17')](function(_0x272883){var _0x1134e4=[];_[_0x5ea0('0x6e')](_0x272883,function(_0x172dbd){_0x1134e4[_0x5ea0('0x5c')](createCmHopperPhone(_0x4c4215,_0x172dbd['id']));});Promise[_0x5ea0('0x60')](_0x1134e4)['then'](function(){_0x4f8a82(0x1);});});});}function createCmHopperPhone(_0x11e0f4,_0x396bc1){return new Promise(function(_0x3e2887){db[_0x5ea0('0x66')][_0x5ea0('0x1f')]({'raw':!![],'attributes':[_0x5ea0('0x8c'),_0x5ea0('0x84')],'where':{'CmContactId':_0x11e0f4,'ItemClass':_0x5ea0('0x8a')},'include':[{'model':db[_0x5ea0('0x68')],'attributes':[_0x5ea0('0x84')],'as':_0x5ea0('0x69')}],'order':[_0x5ea0('0x84'),db['sequelize']['literal'](_0x5ea0('0x8d'))]})[_0x5ea0('0x17')](function(_0x123301){var _0x4877cd=0x1;var _0x1d9bd5=_[_0x5ea0('0x6e')](_0x123301,function(_0x5e1688){_0x5e1688[_0x5ea0('0x8e')]=_0x396bc1;_0x5e1688[_0x5ea0('0x77')]=_0x5e1688[_0x5ea0('0x8c')];_0x5e1688[_0x5ea0('0x84')]=_0x4877cd;delete _0x5e1688[_0x5ea0('0x8f')];_0x4877cd=_0x4877cd+0x1;return _0x5e1688;});return db[_0x5ea0('0x8b')][_0x5ea0('0x58')](_0x1d9bd5,{});})['then'](function(){_0x3e2887(0x1);});});}function insertAdditionalPhones(_0x276e1d,_0x1b8bdc){return new Promise(function(_0x18f96b){var _0x1a6cd4=[];for(var _0x479045=0x0;_0x479045<_0x1b8bdc[_0x5ea0('0x24')];_0x479045++){var _0x340490=_0x1b8bdc[_0x479045];_0x1a6cd4[_0x5ea0('0x5c')](parseContactItemType(_0x340490));}Promise['all'](_0x1a6cd4)[_0x5ea0('0x17')](function(){var _0x42c0f3={'id':_0x276e1d['id'],'items':_0x1b8bdc};return addAdditionalPhones(_0x42c0f3)[_0x5ea0('0x17')](function(){return addCmHopperPhones(_0x276e1d['id']);});})[_0x5ea0('0x17')](function(){_0x18f96b(_0x276e1d);});});}function parseContactItemType(_0x40fa1e){return new Promise(function(_0x317c11){if(_0x40fa1e['hasOwnProperty'](_0x5ea0('0x87'))){_0x317c11(_0x40fa1e);}else{return db[_0x5ea0('0x68')][_0x5ea0('0x22')]({'where':{'name':_0x40fa1e['ItemType']}})[_0x5ea0('0x17')](function(_0x16deb7){if(_[_0x5ea0('0x54')](_0x16deb7))_0x40fa1e[_0x5ea0('0x87')]=null;else _0x40fa1e['ItemTypeId']=_0x16deb7['id'];_0x317c11(_0x40fa1e);});}});}exports[_0x5ea0('0x90')]=function(_0x3e2287,_0xd1fe03){return db['CmContactHasItem'][_0x5ea0('0x1f')]({'raw':!![],'where':{'CmContactId':_0x3e2287[_0x5ea0('0x62')]['id'],'ItemClass':_0x5ea0('0x8a')},'include':[{'model':db[_0x5ea0('0x68')],'as':'ItemType'}],'order':[['OrderBy'],[db[_0x5ea0('0x6a')][_0x5ea0('0x6b')]('`ItemType`.OrderBy')]]})[_0x5ea0('0x17')](function(_0x387895){return _0x387895;})['then'](respondWithResult(_0xd1fe03,null))[_0x5ea0('0x31')](handleError(_0xd1fe03,null));};exports[_0x5ea0('0x91')]=function(_0x443820,_0x62e81e){return db['CmContactHasItem'][_0x5ea0('0x1f')]({'raw':!![],'where':{'CmContactId':_0x443820['body'][_0x5ea0('0x92')]}})['then'](function(_0x58a45a){var _0x5238a3=_[_0x5ea0('0x6e')](_0x58a45a,function(_0x1b681c){_0x1b681c[_0x5ea0('0x93')]=_0x443820[_0x5ea0('0x33')][_0x5ea0('0x94')];return _0x1b681c;});return db[_0x5ea0('0x66')]['bulkCreate'](_0x5238a3,{});})[_0x5ea0('0x17')](function(){return addCmHopperPhones(_0x443820['body'][_0x5ea0('0x94')]);})[_0x5ea0('0x17')](function(){return['ok'];})[_0x5ea0('0x17')](respondWithResult(_0x62e81e,null))[_0x5ea0('0x31')](handleError(_0x62e81e,null));};exports[_0x5ea0('0x95')]=function(_0x2cd70c,_0x14ded6){var _0x340057=[];_0x340057[_0x5ea0('0x5c')](createCmHopperPhone(_0x2cd70c['body']['id'],_0x2cd70c[_0x5ea0('0x33')][_0x5ea0('0x96')]));Promise[_0x5ea0('0x60')](_0x340057)[_0x5ea0('0x17')](function(){return[0x1];})[_0x5ea0('0x17')](respondWithResult(_0x14ded6,null));};exports['getHoppers']=function(_0x37beb9,_0x1c0564){var _0x5a8861={'raw':![],'where':{}};var _0x1bf2b9={};var _0x467e9b={'count':0x0,'rows':[]};return db[_0x5ea0('0x21')][_0x5ea0('0x81')]({'where':{'id':_0x37beb9[_0x5ea0('0x62')]['id']}})['then'](handleEntityNotFound(_0x1c0564,null))[_0x5ea0('0x17')](function(_0x3ca833){if(_0x3ca833){_0x1bf2b9['model']=_['keys'](db[_0x5ea0('0x3b')]['rawAttributes']);_0x1bf2b9[_0x5ea0('0x28')]=_[_0x5ea0('0x23')](_0x37beb9[_0x5ea0('0x28')]);_0x1bf2b9[_0x5ea0('0x7a')]=_['intersection'](_0x1bf2b9[_0x5ea0('0x79')],_0x1bf2b9['query']);_0x5a8861[_0x5ea0('0x7b')]=_[_0x5ea0('0x97')](_0x1bf2b9[_0x5ea0('0x79')],qs[_0x5ea0('0x7c')](_0x37beb9[_0x5ea0('0x28')][_0x5ea0('0x7c')]));_0x5a8861[_0x5ea0('0x7b')]=_0x5a8861['attributes']['length']?_0x5a8861[_0x5ea0('0x7b')]:_0x1bf2b9[_0x5ea0('0x79')];if(!_0x37beb9['query']['hasOwnProperty'](_0x5ea0('0x80'))){_0x5a8861[_0x5ea0('0x12')]=qs[_0x5ea0('0x12')](_0x37beb9[_0x5ea0('0x28')]['limit']);_0x5a8861[_0x5ea0('0x14')]=qs[_0x5ea0('0x14')](_0x37beb9[_0x5ea0('0x28')][_0x5ea0('0x14')]);}_0x5a8861['order']=qs['sort'](_0x37beb9['query']['sort']);_0x5a8861[_0x5ea0('0x5b')]=qs[_0x5ea0('0x7a')](_[_0x5ea0('0x7e')](_0x37beb9['query'],_0x1bf2b9[_0x5ea0('0x7a')]));_0x5a8861[_0x5ea0('0x5b')][_0x5ea0('0x98')]=_0x3ca833['id'];if(_0x37beb9[_0x5ea0('0x28')]['filter']){_0x5a8861['where']=_[_0x5ea0('0x32')](_0x5a8861[_0x5ea0('0x5b')],{'$or':_[_0x5ea0('0x6e')](_0x5a8861['attributes'],function(_0x17c32e){var _0x17d167={};_0x17d167[_0x17c32e]={'$like':'%'+_0x37beb9['query'][_0x5ea0('0x7f')]+'%'};return _0x17d167;})});}_0x5a8861=_['merge']({},_0x5a8861,_0x37beb9[_0x5ea0('0x99')]);return db[_0x5ea0('0x3b')]['count']({'where':_0x5a8861['where']})[_0x5ea0('0x17')](function(_0x5140c7){_0x467e9b[_0x5ea0('0x13')]=_0x5140c7;if(_0x37beb9[_0x5ea0('0x28')][_0x5ea0('0x9a')]){_0x5a8861['include']=[{'all':!![]}];}return db[_0x5ea0('0x3b')][_0x5ea0('0x1f')](_0x5a8861);})['then'](function(_0x577e4d){_0x467e9b['rows']=_0x577e4d;return _0x467e9b;});}})['then'](respondWithFilteredResult(_0x1c0564,_0x5a8861))[_0x5ea0('0x31')](handleError(_0x1c0564,null));};exports[_0x5ea0('0x9b')]=function(_0x1ee13e,_0x54f4dd){var _0x524212={'raw':!![],'where':{}};var _0x50a509={};var _0x2d4b0d={'count':0x0,'rows':[]};return db[_0x5ea0('0x21')][_0x5ea0('0x81')]({'where':{'id':_0x1ee13e[_0x5ea0('0x62')]['id']}})['then'](handleEntityNotFound(_0x54f4dd,null))[_0x5ea0('0x17')](function(_0x53d848){if(_0x53d848){_0x50a509[_0x5ea0('0x79')]=_[_0x5ea0('0x23')](db[_0x5ea0('0x4b')]['rawAttributes']);_0x50a509[_0x5ea0('0x28')]=_[_0x5ea0('0x23')](_0x1ee13e[_0x5ea0('0x28')]);_0x50a509[_0x5ea0('0x7a')]=_[_0x5ea0('0x97')](_0x50a509[_0x5ea0('0x79')],_0x50a509[_0x5ea0('0x28')]);_0x524212['attributes']=_['intersection'](_0x50a509[_0x5ea0('0x79')],qs[_0x5ea0('0x7c')](_0x1ee13e['query'][_0x5ea0('0x7c')]));_0x524212[_0x5ea0('0x7b')]=_0x524212[_0x5ea0('0x7b')][_0x5ea0('0x24')]?_0x524212[_0x5ea0('0x7b')]:_0x50a509[_0x5ea0('0x79')];if(!_0x1ee13e[_0x5ea0('0x28')]['hasOwnProperty'](_0x5ea0('0x80'))){_0x524212[_0x5ea0('0x12')]=qs['limit'](_0x1ee13e[_0x5ea0('0x28')]['limit']);_0x524212[_0x5ea0('0x14')]=qs[_0x5ea0('0x14')](_0x1ee13e['query'][_0x5ea0('0x14')]);}_0x524212[_0x5ea0('0x7d')]=qs[_0x5ea0('0x9c')](_0x1ee13e[_0x5ea0('0x28')][_0x5ea0('0x9c')]);_0x524212[_0x5ea0('0x5b')]=qs[_0x5ea0('0x7a')](_['pick'](_0x1ee13e['query'],_0x50a509['filters']));_0x524212[_0x5ea0('0x5b')][_0x5ea0('0x98')]=_0x53d848['id'];if(_0x1ee13e[_0x5ea0('0x28')]['filter']){_0x524212[_0x5ea0('0x5b')]=_[_0x5ea0('0x32')](_0x524212[_0x5ea0('0x5b')],{'$or':_['map'](_0x524212['attributes'],function(_0x2931f0){var _0x323562={};_0x323562[_0x2931f0]={'$like':'%'+_0x1ee13e[_0x5ea0('0x28')]['filter']+'%'};return _0x323562;})});}_0x524212=_['merge']({},_0x524212,_0x1ee13e['options']);return db['CmHopperHistory']['count']({'where':_0x524212[_0x5ea0('0x5b')]})[_0x5ea0('0x17')](function(_0x1839cf){_0x2d4b0d[_0x5ea0('0x13')]=_0x1839cf;if(_0x1ee13e['query'][_0x5ea0('0x9a')]){_0x524212[_0x5ea0('0x9d')]=[{'all':!![]}];}return db[_0x5ea0('0x4b')][_0x5ea0('0x1f')](_0x524212);})[_0x5ea0('0x17')](function(_0x4116a0){_0x2d4b0d[_0x5ea0('0x9e')]=_0x4116a0;return _0x2d4b0d;});}})['then'](respondWithFilteredResult(_0x54f4dd,_0x524212))[_0x5ea0('0x31')](handleError(_0x54f4dd,null));};exports[_0x5ea0('0x9f')]=function(_0x463159,_0x5133f5){var _0x45c9cd={'raw':!![],'where':{}};var _0x4797d9={};var _0x5ccfe5={'count':0x0,'rows':[]};return db[_0x5ea0('0x21')][_0x5ea0('0x81')]({'where':{'id':_0x463159[_0x5ea0('0x62')]['id']}})['then'](handleEntityNotFound(_0x5133f5,null))[_0x5ea0('0x17')](function(_0x311022){if(_0x311022){_0x4797d9[_0x5ea0('0x79')]=_['keys'](db[_0x5ea0('0x4a')][_0x5ea0('0xa0')]);_0x4797d9[_0x5ea0('0x28')]=_[_0x5ea0('0x23')](_0x463159[_0x5ea0('0x28')]);_0x4797d9[_0x5ea0('0x7a')]=_[_0x5ea0('0x97')](_0x4797d9['model'],_0x4797d9[_0x5ea0('0x28')]);_0x45c9cd[_0x5ea0('0x7b')]=_[_0x5ea0('0x97')](_0x4797d9['model'],qs['fields'](_0x463159['query'][_0x5ea0('0x7c')]));_0x45c9cd['attributes']=_0x45c9cd['attributes']['length']?_0x45c9cd[_0x5ea0('0x7b')]:_0x4797d9[_0x5ea0('0x79')];if(!_0x463159['query']['hasOwnProperty'](_0x5ea0('0x80'))){_0x45c9cd[_0x5ea0('0x12')]=qs['limit'](_0x463159[_0x5ea0('0x28')][_0x5ea0('0x12')]);_0x45c9cd[_0x5ea0('0x14')]=qs['offset'](_0x463159[_0x5ea0('0x28')][_0x5ea0('0x14')]);}_0x45c9cd[_0x5ea0('0x7d')]=qs[_0x5ea0('0x9c')](_0x463159[_0x5ea0('0x28')][_0x5ea0('0x9c')]);_0x45c9cd[_0x5ea0('0x5b')]=qs[_0x5ea0('0x7a')](_[_0x5ea0('0x7e')](_0x463159['query'],_0x4797d9['filters']));_0x45c9cd[_0x5ea0('0x5b')][_0x5ea0('0x98')]=_0x311022['id'];if(_0x463159[_0x5ea0('0x28')][_0x5ea0('0x7f')]){_0x45c9cd[_0x5ea0('0x5b')]=_[_0x5ea0('0x32')](_0x45c9cd['where'],{'$or':_[_0x5ea0('0x6e')](_0x45c9cd[_0x5ea0('0x7b')],function(_0x4cd93e){var _0x9ae5eb={};_0x9ae5eb[_0x4cd93e]={'$like':'%'+_0x463159[_0x5ea0('0x28')][_0x5ea0('0x7f')]+'%'};return _0x9ae5eb;})});}_0x45c9cd=_[_0x5ea0('0x32')]({},_0x45c9cd,_0x463159[_0x5ea0('0x99')]);return db['CmHopperFinal']['count']({'where':_0x45c9cd[_0x5ea0('0x5b')]})['then'](function(_0x3954de){_0x5ccfe5[_0x5ea0('0x13')]=_0x3954de;if(_0x463159[_0x5ea0('0x28')][_0x5ea0('0x9a')]){_0x45c9cd[_0x5ea0('0x9d')]=[{'all':!![]}];}return db[_0x5ea0('0x4a')][_0x5ea0('0x1f')](_0x45c9cd);})['then'](function(_0x25efef){_0x5ccfe5[_0x5ea0('0x9e')]=_0x25efef;return _0x5ccfe5;});}})[_0x5ea0('0x17')](respondWithFilteredResult(_0x5133f5,_0x45c9cd))[_0x5ea0('0x31')](handleError(_0x5133f5,null));};exports['getJscriptySessions']=function(_0x48af3c,_0x1fddf3){var _0x513fa8={'raw':!![],'where':{}};var _0x5692c6={};var _0x1b9446={'count':0x0,'rows':[]};return db['CmContact'][_0x5ea0('0x81')]({'where':{'id':_0x48af3c[_0x5ea0('0x62')]['id']}})[_0x5ea0('0x17')](handleEntityNotFound(_0x1fddf3,null))[_0x5ea0('0x17')](function(_0x254711){if(_0x254711){_0x5692c6[_0x5ea0('0x79')]=_[_0x5ea0('0x23')](db['JscriptySessionReport'][_0x5ea0('0xa0')]);_0x5692c6[_0x5ea0('0x28')]=_[_0x5ea0('0x23')](_0x48af3c[_0x5ea0('0x28')]);_0x5692c6[_0x5ea0('0x7a')]=_[_0x5ea0('0x97')](_0x5692c6['model'],_0x5692c6[_0x5ea0('0x28')]);_0x513fa8[_0x5ea0('0x7b')]=_[_0x5ea0('0x97')](_0x5692c6[_0x5ea0('0x79')],qs[_0x5ea0('0x7c')](_0x48af3c[_0x5ea0('0x28')][_0x5ea0('0x7c')]));_0x513fa8[_0x5ea0('0x7b')]=_0x513fa8[_0x5ea0('0x7b')]['length']?_0x513fa8[_0x5ea0('0x7b')]:_0x5692c6[_0x5ea0('0x79')];if(!_0x48af3c[_0x5ea0('0x28')][_0x5ea0('0x30')](_0x5ea0('0x80'))){_0x513fa8['limit']=qs[_0x5ea0('0x12')](_0x48af3c['query'][_0x5ea0('0x12')]);_0x513fa8[_0x5ea0('0x14')]=qs[_0x5ea0('0x14')](_0x48af3c[_0x5ea0('0x28')][_0x5ea0('0x14')]);}_0x513fa8[_0x5ea0('0x7d')]=qs[_0x5ea0('0x9c')](_0x48af3c[_0x5ea0('0x28')]['sort']);_0x513fa8[_0x5ea0('0x5b')]=qs['filters'](_[_0x5ea0('0x7e')](_0x48af3c['query'],_0x5692c6[_0x5ea0('0x7a')]));_0x513fa8[_0x5ea0('0x5b')]['ContactId']=_0x254711['id'];if(_0x48af3c[_0x5ea0('0x28')]['filter']){_0x513fa8[_0x5ea0('0x5b')]=_['merge'](_0x513fa8[_0x5ea0('0x5b')],{'$or':_[_0x5ea0('0x6e')](_0x513fa8[_0x5ea0('0x7b')],function(_0x1da4fc){var _0x3b9261={};_0x3b9261[_0x1da4fc]={'$like':'%'+_0x48af3c[_0x5ea0('0x28')][_0x5ea0('0x7f')]+'%'};return _0x3b9261;})});}_0x513fa8=_[_0x5ea0('0x32')]({},_0x513fa8,_0x48af3c[_0x5ea0('0x99')]);return db[_0x5ea0('0x51')]['count']({'where':_0x513fa8[_0x5ea0('0x5b')]})[_0x5ea0('0x17')](function(_0x103d5e){_0x1b9446[_0x5ea0('0x13')]=_0x103d5e;if(_0x48af3c[_0x5ea0('0x28')][_0x5ea0('0x9a')]){_0x513fa8[_0x5ea0('0x9d')]=[{'all':!![]}];}return db[_0x5ea0('0x51')]['findAll'](_0x513fa8);})[_0x5ea0('0x17')](function(_0x1bb3ea){_0x1b9446['rows']=_0x1bb3ea;return _0x1b9446;});}})['then'](respondWithFilteredResult(_0x1fddf3,_0x513fa8))[_0x5ea0('0x31')](handleError(_0x1fddf3,null));};exports['uploadCsv']=function(_0x331251,_0x5e3358){try{if(!_0x331251[_0x5ea0('0x33')][_0x5ea0('0x5d')]){throw new Error(_0x5ea0('0xa1'));}if(!_0x331251[_0x5ea0('0x33')][_0x5ea0('0xa2')]){throw new Error(_0x5ea0('0xa3'));}if(!_0x331251['body'][_0x5ea0('0xa4')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x331251['body'][_0x5ea0('0xa5')]){throw new Error(_0x5ea0('0xa6'));}var _0x223d30=_0x331251[_0x5ea0('0x33')][_0x5ea0('0xa2')][_0x5ea0('0xa7')](',');var _0x424235=_0x331251[_0x5ea0('0x33')]['binding_values'][_0x5ea0('0xa7')](',');if(!_0x223d30[_0x5ea0('0x24')]||!_0x424235[_0x5ea0('0x24')]||_0x223d30[_0x5ea0('0x24')]!==_0x424235[_0x5ea0('0x24')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x331251[_0x5ea0('0x33')]['fields']=_['zipObject'](_0x223d30,_0x424235);if(!_0x331251['body'][_0x5ea0('0x7c')]['phone']){throw new Error(_0x5ea0('0xa8'));}if(!_0x331251[_0x5ea0('0x33')][_0x5ea0('0x7c')][_0x5ea0('0xa9')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x337280=path['join'](config[_0x5ea0('0xaa')],_0x5ea0('0xab'),_0x331251['file'][_0x5ea0('0xac')]);fs[_0x5ea0('0xad')](_0x337280,parseInt(_0x5ea0('0xae'),0x8));var _0x3d71e4=require(_0x5ea0('0xaf'))[_0x5ea0('0xb0')](path[_0x5ea0('0x39')](__dirname,_0x5ea0('0xb1')),[_0x337280,_0x331251['body'][_0x5ea0('0xa2')],_0x331251[_0x5ea0('0x33')][_0x5ea0('0xa4')],_0x331251['body'][_0x5ea0('0x5d')],_0x331251[_0x5ea0('0x33')][_0x5ea0('0xb2')],_0x331251['body'][_0x5ea0('0x5a')],_0x331251['body'][_0x5ea0('0xa5')]]);return _0x5e3358[_0x5ea0('0x10')](0xc8)[_0x5ea0('0xb3')]({'message':_0x5ea0('0xb4'),'pid':_0x3d71e4['pid']});}catch(_0x461cfe){return _0x5e3358[_0x5ea0('0x10')](0x1f4)[_0x5ea0('0x1c')](_0x461cfe);}};exports[_0x5ea0('0xb5')]=function(_0x1261c9,_0x3a1641){var _0x515109=fs[_0x5ea0('0xb6')](_0x1261c9['file'][_0x5ea0('0x2')]);Papa[_0x5ea0('0xb7')](_0x515109,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x493631){return _0x3a1641['status'](0xc8)['json']({'file':_0x1261c9[_0x5ea0('0xb8')],'fields':_0x493631[_0x5ea0('0xb9')][_0x5ea0('0x7c')]});}});};exports[_0x5ea0('0xba')]=function(_0x562882,_0x50880a){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x5ea0('0xbb')}})[_0x5ea0('0x17')](function(_0x1d59a5){var _0x83127a=![];if(!_0x562882[_0x5ea0('0x33')]['ListId']){throw new Error(_0x5ea0('0xa1'));}if(!_0x562882[_0x5ea0('0x33')]['binding']['phone']){throw new Error(_0x5ea0('0xa8'));}if(!_0x562882[_0x5ea0('0x33')][_0x5ea0('0xbc')][_0x5ea0('0xa9')]){throw new Error(_0x5ea0('0xbd'));}if(!_0x562882[_0x5ea0('0x33')][_0x5ea0('0xa5')]){throw new Error(_0x5ea0('0xa6'));}var _0x4c5cf0=require(_0x5ea0('0xaf'))[_0x5ea0('0xb0')](path[_0x5ea0('0x39')](__dirname,_0x5ea0('0xbe')),[_0x562882[_0x5ea0('0x62')]['id'],JSON[_0x5ea0('0xbf')](_0x562882[_0x5ea0('0x33')]),JSON[_0x5ea0('0xbf')](_0x1d59a5)]);_0x4c5cf0['on']('message',function(){_0x83127a=!![];return _0x50880a[_0x5ea0('0x10')](0xc8)[_0x5ea0('0xb3')]({'message':_0x5ea0('0xc0'),'pid':_0x4c5cf0[_0x5ea0('0xc1')]});});_0x4c5cf0['on'](_0x5ea0('0xc2'),function(_0x1718ca){if(_0x1718ca&&!_0x83127a){return _0x50880a[_0x5ea0('0x10')](0x1f4)[_0x5ea0('0xb3')]({'message':_0x5ea0('0xc3'),'pid':_0x4c5cf0[_0x5ea0('0xc1')]});}});})[_0x5ea0('0x31')](handleError(_0x50880a,null));};exports[_0x5ea0('0xc4')]=function(_0x1b4961,_0x500d81){return db[_0x5ea0('0xc5')][_0x5ea0('0x1f')]({'raw':!![],'attributes':['id'],'where':{'role':_0x5ea0('0xbb')}})[_0x5ea0('0x17')](function(_0x3f9755){var _0x477570=![];if(!_0x1b4961[_0x5ea0('0x33')][_0x5ea0('0x5d')]){throw new Error(_0x5ea0('0xa1'));}if(!_0x1b4961['body'][_0x5ea0('0xbc')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x1b4961['body'][_0x5ea0('0xbc')]['firstName']){throw new Error(_0x5ea0('0xbd'));}if(!_0x1b4961['body']['socket_timestamp']){throw new Error(_0x5ea0('0xa6'));}var _0x49d139=require(_0x5ea0('0xaf'))['fork'](path[_0x5ea0('0x39')](__dirname,'../../components/import/cm/csvUpdates'),[_0x1b4961[_0x5ea0('0x62')]['id'],JSON[_0x5ea0('0xbf')](_0x1b4961['body']),JSON[_0x5ea0('0xbf')](_0x3f9755)]);_0x49d139['on'](_0x5ea0('0xc6'),function(){_0x477570=!![];return _0x500d81[_0x5ea0('0x10')](0xc8)[_0x5ea0('0xb3')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x49d139['pid']});});_0x49d139['on'](_0x5ea0('0xc2'),function(_0x537dc6){if(_0x537dc6&&!_0x477570){return _0x500d81[_0x5ea0('0x10')](0x1f4)[_0x5ea0('0xb3')]({'message':_0x5ea0('0xc3'),'pid':_0x49d139['pid']});}});})['catch'](handleError(_0x500d81,null));};exports['getJourney']=function(_0x4289cc,_0x845a88){var _0xf75fd9=['mail',_0x5ea0('0xc7'),_0x5ea0('0xc8'),'openchannel','fax',_0x5ea0('0xc9'),_0x5ea0('0xca')];var _0x4f486d={'offset':0x0,'order':qs['sort'](_0x5ea0('0xcb'))},_0x2c195f={'count':0x0,'rows':[]};Promise['resolve']()[_0x5ea0('0x17')](function(){if(_0x4289cc['query']['channel']){if(!_['includes'](_0xf75fd9,_0x4289cc[_0x5ea0('0x28')][_0x5ea0('0xcc')][_0x5ea0('0xcd')]())){throw new Error(_0x5ea0('0xce'));}_0xf75fd9=[_0x4289cc[_0x5ea0('0x28')]['channel']['toLowerCase']()];}if(_0x4289cc[_0x5ea0('0x28')]['range']){try{var _0x16218f=JSON[_0x5ea0('0xb7')](_0x4289cc[_0x5ea0('0x28')][_0x5ea0('0xcf')]);if(!moment(_0x16218f[_0x5ea0('0x34')])[_0x5ea0('0xd0')]()){throw new Error(_0x5ea0('0xd1'));}if(!moment(_0x16218f['to'])[_0x5ea0('0xd0')]()){throw new Error(_0x5ea0('0xd2'));}}catch(_0x3df7d0){throw new Error(_0x5ea0('0xd3'));}}if(!_0x4289cc[_0x5ea0('0x28')][_0x5ea0('0x30')](_0x5ea0('0x80'))){_0x4f486d[_0x5ea0('0x12')]=qs['limit'](_0x4289cc[_0x5ea0('0x28')]['limit']||0xa);_0x4f486d['offset']=qs[_0x5ea0('0x14')](_0x4289cc['query'][_0x5ea0('0x14')]);}var _0xd2b1e2=_0xf75fd9['map'](function(_0x297d80){if(_0x297d80==='voice'){var _0x28edca={'attributes':['id','uniqueid','type','source',_0x5ea0('0xd4'),_0x5ea0('0xd5'),'starttime','endtime',_0x5ea0('0xd6'),'note',_0x5ea0('0xd7'),_0x5ea0('0xd8'),_0x5ea0('0xd9'),_0x5ea0('0xda'),_0x5ea0('0xdb')],'where':{'ContactId':_0x4289cc[_0x5ea0('0x62')]['id']},'include':[{'model':db[_0x5ea0('0xc5')],'as':_0x5ea0('0xc5'),'attributes':['id',_0x5ea0('0x1b'),'fullname',_0x5ea0('0x2c')]}],'order':[[_0x5ea0('0xd7'),_0x5ea0('0xdc')]]};if(_0x4289cc['query'][_0x5ea0('0xcf')]){_0x28edca[_0x5ea0('0x5b')][_0x5ea0('0xd7')]={'$gte':_0x16218f[_0x5ea0('0x34')],'$lte':_0x16218f['to']};}return db['VoiceCallReport'][_0x5ea0('0xdd')](_0x28edca)[_0x5ea0('0x17')](function(_0x213fe4){_0x2c195f[_0x5ea0('0x13')]+=_0x213fe4[_0x5ea0('0x13')];return _[_0x5ea0('0x6e')](_0x213fe4['rows'],function(_0x1aae8c){var _0x1c8596=_0x1aae8c['get']({'plain':!![]});_0x1c8596[_0x5ea0('0xcc')]=_0x297d80;if(_0x1c8596[_0x5ea0('0xc5')]){_0x1c8596[_0x5ea0('0xc5')]={'id':_0x1c8596[_0x5ea0('0xc5')]['id'],'name':_0x1c8596[_0x5ea0('0xc5')][_0x5ea0('0x1b')],'fullname':_0x1c8596[_0x5ea0('0xc5')][_0x5ea0('0xde')],'alias':_0x1c8596[_0x5ea0('0xc5')][_0x5ea0('0x2c')]};}return _0x1c8596;});});}else{var _0x8e7860=_[_0x5ea0('0xdf')](_0x297d80)+(_0x297d80==='chat'?_0x5ea0('0xe0'):_0x5ea0('0xe1'));var _0xf8cd17={'attributes':['id',_0x5ea0('0xe2'),_0x5ea0('0xe3'),_0x5ea0('0xd7'),_0x5ea0('0xe4'),_0x5ea0('0xe5'),_0x5ea0('0xe6'),'thirdDisposition',_0x5ea0('0xdb'),_0x8e7860+'Id'],'where':{'ContactId':_0x4289cc[_0x5ea0('0x62')]['id']},'include':[{'model':db[_0x8e7860],'as':_0x5ea0('0xe1'),'attributes':['id',_0x5ea0('0x1b'),_0x5ea0('0xe7')]},{'model':db[_0x5ea0('0xc5')],'as':_0x5ea0('0xe8'),'attributes':['id',_0x5ea0('0x1b'),_0x5ea0('0xde')]},{'model':db['Tag'],'as':_0x5ea0('0x64'),'attributes':['id',_0x5ea0('0x1b'),_0x5ea0('0x65')],'through':{'attributes':[]}}],'order':[[_0x5ea0('0xd7'),_0x5ea0('0xdc')]]};if(_0x4289cc[_0x5ea0('0x28')]['range']){_0xf8cd17[_0x5ea0('0x5b')][_0x5ea0('0xd7')]={'$gte':_0x16218f[_0x5ea0('0x34')],'$lte':_0x16218f['to']};}switch(_0x297d80){case _0x5ea0('0xc7'):_0xf8cd17[_0x5ea0('0x7b')][_0x5ea0('0x5c')](_0x5ea0('0xe9'),'customerIp',_0x5ea0('0xea'),_0x5ea0('0xeb'),'osName',_0x5ea0('0xec'),_0x5ea0('0xed'),'ratingValue',_0x5ea0('0xee'));break;case _0x5ea0('0xef'):_0xf8cd17[_0x5ea0('0x7b')][_0x5ea0('0x5c')](_0x5ea0('0xf0'),_0x5ea0('0xf1'));break;case'openchannel':_0xf8cd17[_0x5ea0('0x7b')][_0x5ea0('0x5c')](_0x5ea0('0xf2'),'threadId');break;}return db[_[_0x5ea0('0xdf')](_0x297d80)+'Interaction']['findAndCountAll'](_0xf8cd17)[_0x5ea0('0x17')](function(_0x3a3141){_0x2c195f[_0x5ea0('0x13')]+=_0x3a3141['count'];return _['map'](_0x3a3141[_0x5ea0('0x9e')],function(_0x194b5f){var _0x3da651=_0x194b5f[_0x5ea0('0x35')]({'plain':!![]});_0x3da651[_0x5ea0('0xcc')]=_0x297d80;if(_0x3da651['Owner']){_0x3da651[_0x5ea0('0xe8')]={'id':_0x3da651[_0x5ea0('0xe8')]['id'],'name':_0x3da651[_0x5ea0('0xe8')][_0x5ea0('0x1b')],'fullname':_0x3da651['Owner'][_0x5ea0('0xde')]};}return _0x3da651;});});}});return Promise[_0x5ea0('0x60')](_0xd2b1e2);})[_0x5ea0('0x17')](function(_0x1c011d){return _(_0x1c011d)[_0x5ea0('0xf3')]()[_0x5ea0('0xf4')](_0x5ea0('0xd7'))[_0x5ea0('0xf5')]()[_0x5ea0('0xf6')]();})[_0x5ea0('0x17')](function(_0x5c09d2){_0x2c195f[_0x5ea0('0x9e')]=_0x4f486d['limit']?_0x5c09d2[_0x5ea0('0xf7')](_0x4f486d[_0x5ea0('0x14')],_0x4f486d[_0x5ea0('0x14')]+_0x4f486d[_0x5ea0('0x12')]):_0x5c09d2;return _0x2c195f;})[_0x5ea0('0x17')](respondWithFilteredResult(_0x845a88,_0x4f486d))['catch'](handleError(_0x845a88,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index d2c10fc..1f824b2 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e72=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','CmContact','setMaxListeners','save'];(function(_0x3dc53b,_0x5271aa){var _0xe99dcb=function(_0x2244e9){while(--_0x2244e9){_0x3dc53b['push'](_0x3dc53b['shift']());}};_0xe99dcb(++_0x5271aa);}(_0x2e72,0x19a));var _0x22e7=function(_0x218756,_0x419c39){_0x218756=_0x218756-0x0;var _0x1b90ec=_0x2e72[_0x218756];return _0x1b90ec;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x22e7('0x0'))['db'][_0x22e7('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x22e7('0x2')](0x0);var events={'afterCreate':_0x22e7('0x3'),'afterUpdate':'update','afterDestroy':_0x22e7('0x4')};function emitEvent(_0x5a2e78){return function(_0x5ccc97,_0x326f17,_0x54bfdd){CmContactEvents['emit'](_0x5a2e78+':'+_0x5ccc97['id'],_0x5ccc97);CmContactEvents[_0x22e7('0x5')](_0x5a2e78,_0x5ccc97);_0x54bfdd(null);};}for(var e in events){if(events[_0x22e7('0x6')](e)){var event=events[e];CmContact[_0x22e7('0x7')](e,emitEvent(event));}}module[_0x22e7('0x8')]=CmContactEvents; \ No newline at end of file +var _0x0708=['exports','../../mysqldb','CmContact','setMaxListeners','save','update','remove','emit','hook'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x0708,0x1b1));var _0x8070=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x0708[_0x4ed520];return _0x4415a6;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x8070('0x0'))['db'][_0x8070('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x8070('0x2')](0x0);var events={'afterCreate':_0x8070('0x3'),'afterUpdate':_0x8070('0x4'),'afterDestroy':_0x8070('0x5')};function emitEvent(_0x3cdd3d){return function(_0x2a2a3e,_0x148eb0,_0x5bb9a7){CmContactEvents[_0x8070('0x6')](_0x3cdd3d+':'+_0x2a2a3e['id'],_0x2a2a3e);CmContactEvents[_0x8070('0x6')](_0x3cdd3d,_0x2a2a3e);_0x5bb9a7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x8070('0x7')](e,emitEvent(event));}}module[_0x8070('0x8')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index a846b00..06fd3a0 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b34=['add','minutes','ret','CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','findOne','cmContact,\x20afterCreate\x20','cmContact,\x20afterCreate,\x20','error','cmContact','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','afterCreate','message','always','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','api','bluebird','path','../../config/environment','../../config/environment/shared','exports','define','CmContact','phone','firstName','lastName','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','then','timezones','utcOffset'];(function(_0x19b4da,_0x10ac4){var _0x203ac0=function(_0x2edc64){while(--_0x2edc64){_0x19b4da['push'](_0x19b4da['shift']());}};_0x203ac0(++_0x10ac4);}(_0x3b34,0xb9));var _0x43b3=function(_0x4ff51e,_0xf66763){_0x4ff51e=_0x4ff51e-0x0;var _0x38951f=_0x3b34[_0x4ff51e];return _0x38951f;};'use strict';var _=require(_0x43b3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x43b3('0x1'));var moment=require('moment');var BPromise=require(_0x43b3('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x43b3('0x3'));var rimraf=require('rimraf');var config=require(_0x43b3('0x4'));var shared=require(_0x43b3('0x5'));var attributes=require('./cmContact.attributes');module[_0x43b3('0x6')]=function(_0x72015e,_0x1a37eb){return _0x72015e[_0x43b3('0x7')](_0x43b3('0x8'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':'phone','fields':[_0x43b3('0x9')]},{'name':'fti_cm_contacts','fields':[_0x43b3('0xa'),_0x43b3('0xb'),_0x43b3('0x9'),'mobile',_0x43b3('0xc'),'email'],'type':_0x43b3('0xd')}],'timestamps':!![],'charset':_0x43b3('0xe'),'collate':_0x43b3('0xf'),'hooks':{'afterCreate':function(_0x528612,_0x43eb53,_0x149ccc){var _0x44bca6=_0x72015e[_0x43b3('0x10')];var _0x484fce=_0x528612[_0x43b3('0x11')]({'plain':!![]});function _0x3de2a9(){return function(_0x410087){logger['error']('cmContact','afterCreate',util[_0x43b3('0x12')](_0x410087,{'showHidden':![],'depth':null}));};}function _0x4894df(_0x4f3e3f,_0x4ef44c){var _0x26e66e=_0x4ef44c['scheduledat']?_0x4ef44c[_0x43b3('0x13')]:moment()[_0x43b3('0x14')](_0x43b3('0x15'));return new BPromise(function(_0x59f5d5,_0x55becb){if(_[_0x43b3('0x16')](_0x4ef44c[_0x43b3('0x17')])){_0x59f5d5({'ret':_0x26e66e});}else{_0x44bca6[_0x43b3('0x18')]['findOne']({'where':{'id':_0x4f3e3f['id']}})[_0x43b3('0x19')](function(_0x151a85){if(!_[_0x43b3('0x16')](_0x151a85)){var _0x15b2ad=_0x151a85['dialTimezone'];if(!_[_0x43b3('0x16')](_0x15b2ad)){var _0x4a1db4=shared[_0x43b3('0x1a')];var _0x4b7103=_0x4a1db4[_0x15b2ad];var _0x521d94=_0x4a1db4[_0x4ef44c['dialTimezone']];if(!_['isNil'](_0x4b7103)&&!_[_0x43b3('0x16')](_0x521d94)){var _0x350ddc=_0x4b7103[_0x43b3('0x1b')]-_0x521d94[_0x43b3('0x1b')];_0x26e66e=_0x4ef44c['scheduledat']?_0x4ef44c[_0x43b3('0x13')]:moment();var _0x4565d9=moment(_0x26e66e)[_0x43b3('0x1c')](_0x350ddc,_0x43b3('0x1d'));_0x59f5d5({'ret':_0x4565d9[_0x43b3('0x14')](_0x43b3('0x15'))});}else _0x59f5d5({'ret':_0x26e66e});}else _0x59f5d5({'ret':_0x26e66e});}else{_0x59f5d5({'ret':_0x26e66e});}});}});return 0xa;}var _0x3e5310=function(_0x240a0c){return new BPromise(function(_0x5dc6be,_0x5f26ac){_0x4894df(_0x240a0c,_0x484fce)[_0x43b3('0x19')](function(_0x34776c){_0x484fce['scheduledat']=_0x34776c[_0x43b3('0x1e')];_0x44bca6[_0x43b3('0x1f')]['findOne']({'where':{'phone':_0x484fce[_0x43b3('0x9')],'VoiceQueueId':_0x240a0c['id']}})[_0x43b3('0x19')](function(_0x699d13){if(!_[_0x43b3('0x16')](_0x699d13)){throw new Error('cmContact,\x20afterCreate\x20'+_0x484fce[_0x43b3('0x9')]+_0x43b3('0x20')+_0x240a0c['id']);}return _0x44bca6['CmHopper'][_0x43b3('0x21')]({'phone':_0x484fce[_0x43b3('0x9')],'ContactId':_0x484fce['id'],'ListId':_0x484fce[_0x43b3('0x22')],'priority':_0x484fce['priority']?_0x484fce[_0x43b3('0x23')]:0x2,'scheduledat':_0x484fce[_0x43b3('0x13')]?_0x484fce[_0x43b3('0x13')]:moment()[_0x43b3('0x14')](_0x43b3('0x15')),'callback':_0x484fce[_0x43b3('0x24')]?!![]:![],'callbackuniqueid':_0x484fce[_0x43b3('0x24')]?_0x484fce[_0x43b3('0x24')]:undefined,'callbackat':_0x484fce[_0x43b3('0x24')]?moment()['format'](_0x43b3('0x15')):undefined,'VoiceQueueId':_0x240a0c['id']});})[_0x43b3('0x25')](function(_0xce7136){_0x5f26ac(_0xce7136);});});});};var _0x4d5388=function(_0x151682){return new BPromise(function(_0x487d78,_0x1b1af1){_0x4894df(_0x151682,_0x484fce)[_0x43b3('0x19')](function(_0x3b9c5d){_0x484fce[_0x43b3('0x13')]=_0x3b9c5d[_0x43b3('0x1e')];_0x44bca6['CmHopper'][_0x43b3('0x26')]({'where':{'phone':_0x484fce[_0x43b3('0x9')],'VoiceQueueId':_0x151682['id']}})[_0x43b3('0x19')](function(_0x4a8d6a){if(!_['isNil'](_0x4a8d6a)){throw new Error(_0x43b3('0x27')+_0x484fce[_0x43b3('0x9')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x151682['id']);}return _0x44bca6['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x484fce[_0x43b3('0x9')],'VoiceQueueId':_0x151682['id']}});})['then'](function(_0x2bbbb8){if(!_['isNil'](_0x2bbbb8)){throw new Error(_0x43b3('0x28')+_0x484fce[_0x43b3('0x9')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x151682['id']);}return _0x44bca6[_0x43b3('0x1f')][_0x43b3('0x21')]({'phone':_0x484fce['phone'],'ContactId':_0x484fce['id'],'ListId':_0x484fce[_0x43b3('0x22')],'priority':_0x484fce[_0x43b3('0x23')]?_0x484fce['priority']:0x2,'scheduledat':_0x484fce['scheduledat']?_0x484fce[_0x43b3('0x13')]:moment()[_0x43b3('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x484fce[_0x43b3('0x24')]?!![]:![],'callbackuniqueid':_0x484fce[_0x43b3('0x24')]?_0x484fce[_0x43b3('0x24')]:undefined,'callbackat':_0x484fce[_0x43b3('0x24')]?moment()[_0x43b3('0x14')](_0x43b3('0x15')):undefined,'VoiceQueueId':_0x151682['id']});})[_0x43b3('0x25')](function(_0x60fdcb){_0x1b1af1(_0x60fdcb);});});});};function _0x20bdca(){return function(_0x4f907c){logger[_0x43b3('0x29')](_0x43b3('0x2a'),'afterCreate',util[_0x43b3('0x12')](_0x4f907c,{'showHidden':![],'depth':null}));};}function _0x13fb22(_0x4b952c,_0x4bacb9){var _0x354718=_0x4bacb9['scheduledat']?_0x4bacb9[_0x43b3('0x13')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x178cac,_0x420b41){if(_['isNil'](_0x4bacb9[_0x43b3('0x17')])){_0x178cac({'ret':_0x354718});}else{_0x44bca6[_0x43b3('0x2b')][_0x43b3('0x26')]({'where':{'id':_0x4b952c['id']}})[_0x43b3('0x19')](function(_0x52a997){if(!_[_0x43b3('0x16')](_0x52a997)){var _0x2e7af8=_0x52a997['dialTimezone'];if(!_[_0x43b3('0x16')](_0x2e7af8)){var _0x4e5499=shared['timezones'];var _0x60184b=_0x4e5499[_0x2e7af8];var _0x4efca1=_0x4e5499[_0x4bacb9[_0x43b3('0x17')]];if(!_['isNil'](_0x60184b)&&!_['isNil'](_0x4efca1)){var _0x6f2e11=_0x60184b[_0x43b3('0x1b')]-_0x4efca1[_0x43b3('0x1b')];_0x354718=_0x4bacb9[_0x43b3('0x13')]?_0x4bacb9[_0x43b3('0x13')]:moment();var _0x3a29e8=moment(_0x354718)['add'](_0x6f2e11,_0x43b3('0x1d'));_0x178cac({'ret':_0x3a29e8[_0x43b3('0x14')](_0x43b3('0x15'))});}else _0x178cac({'ret':_0x354718});}else _0x178cac({'ret':_0x354718});}else{_0x178cac({'ret':_0x354718});}});}});return 0xa;}var _0x1c07af=function(_0xfeefe5){return new BPromise(function(_0x4d09e0,_0x18615e){_0x13fb22(_0xfeefe5,_0x484fce)[_0x43b3('0x19')](function(_0x4072d8){_0x484fce[_0x43b3('0x13')]=_0x4072d8[_0x43b3('0x1e')];_0x44bca6[_0x43b3('0x1f')][_0x43b3('0x26')]({'where':{'phone':_0x484fce[_0x43b3('0x9')],'CampaignId':_0xfeefe5['id']}})[_0x43b3('0x19')](function(_0x16826b){if(!_['isNil'](_0x16826b)){throw new Error('cmContact,\x20afterCreate\x20'+_0x484fce[_0x43b3('0x9')]+_0x43b3('0x2c')+_0xfeefe5['id']);}return _0x44bca6[_0x43b3('0x1f')]['create']({'phone':_0x484fce[_0x43b3('0x9')],'ContactId':_0x484fce['id'],'ListId':_0x484fce[_0x43b3('0x22')],'priority':_0x484fce['priority']?_0x484fce[_0x43b3('0x23')]:0x2,'scheduledat':_0x484fce['scheduledat']?_0x484fce['scheduledat']:moment()['format'](_0x43b3('0x15')),'callback':_0x484fce['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x484fce[_0x43b3('0x24')]?_0x484fce['callbackUniqueid']:undefined,'callbackat':_0x484fce[_0x43b3('0x24')]?moment()[_0x43b3('0x14')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0xfeefe5['id']});})[_0x43b3('0x25')](function(_0x2d78b1){_0x18615e(_0x2d78b1);});});});};var _0x314f27=function(_0x401f21){return new BPromise(function(_0x1ecfa0,_0x3b57eb){_0x13fb22(_0x401f21,_0x484fce)[_0x43b3('0x19')](function(_0x2f6253){_0x484fce[_0x43b3('0x13')]=_0x2f6253[_0x43b3('0x1e')];_0x44bca6[_0x43b3('0x1f')]['findOne']({'where':{'phone':_0x484fce[_0x43b3('0x9')],'CampaignId':_0x401f21['id']}})[_0x43b3('0x19')](function(_0x32175d){if(!_[_0x43b3('0x16')](_0x32175d)){throw new Error(_0x43b3('0x27')+_0x484fce[_0x43b3('0x9')]+_0x43b3('0x2d')+_0x401f21['id']);}return _0x44bca6[_0x43b3('0x2e')][_0x43b3('0x26')]({'where':{'calleridnum':_0x484fce[_0x43b3('0x9')],'CampaignId':_0x401f21['id']}});})[_0x43b3('0x19')](function(_0xbeee71){if(!_[_0x43b3('0x16')](_0xbeee71)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x484fce[_0x43b3('0x9')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x401f21['id']);}return _0x44bca6[_0x43b3('0x1f')][_0x43b3('0x21')]({'phone':_0x484fce[_0x43b3('0x9')],'ContactId':_0x484fce['id'],'ListId':_0x484fce[_0x43b3('0x22')],'priority':_0x484fce[_0x43b3('0x23')]?_0x484fce[_0x43b3('0x23')]:0x2,'scheduledat':_0x484fce[_0x43b3('0x13')]?_0x484fce[_0x43b3('0x13')]:moment()[_0x43b3('0x14')](_0x43b3('0x15')),'callback':_0x484fce['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x484fce['callbackUniqueid']?_0x484fce[_0x43b3('0x24')]:undefined,'callbackat':_0x484fce[_0x43b3('0x24')]?moment()[_0x43b3('0x14')](_0x43b3('0x15')):undefined,'CampaignId':_0x401f21['id']});})['catch'](function(_0x265cc4){_0x3b57eb(_0x265cc4);});});});};if(_0x484fce[_0x43b3('0x22')]){_0x44bca6[_0x43b3('0x18')][_0x43b3('0x2f')]({'where':{'type':_0x43b3('0x30')},'attributes':['id',_0x43b3('0x31'),'dialTimezone'],'include':[{'model':_0x44bca6[_0x43b3('0x32')],'as':_0x43b3('0x33'),'where':{'id':_0x484fce[_0x43b3('0x22')]}}]})[_0x43b3('0x19')](function(_0x1750f4){if(_0x1750f4){var _0x43679e=[];for(var _0xc41ac3=0x0,_0x579715;_0xc41ac3<_0x1750f4[_0x43b3('0x34')];_0xc41ac3+=0x1){_0x579715=_0x1750f4[_0xc41ac3]['get']({'plain':!![]});switch(_0x579715[_0x43b3('0x31')]){case'always':_0x4d5388(_0x579715)[_0x43b3('0x25')](_0x3de2a9());break;case _0x43b3('0x35'):_0x3e5310(_0x579715)['catch'](_0x3de2a9());break;default:_0x13fb22(_0x579715,_0x484fce)[_0x43b3('0x19')](function(_0x44de10){_0x484fce[_0x43b3('0x13')]=_0x44de10[_0x43b3('0x1e')];_0x44bca6[_0x43b3('0x1f')][_0x43b3('0x21')]({'phone':_0x484fce[_0x43b3('0x9')],'ContactId':_0x484fce['id'],'ListId':_0x484fce['ListId'],'scheduledat':_0x484fce[_0x43b3('0x13')]?_0x484fce[_0x43b3('0x13')]:moment()[_0x43b3('0x14')](_0x43b3('0x15')),'priority':_0x484fce['priority']?_0x484fce[_0x43b3('0x23')]:0x2,'callback':_0x484fce[_0x43b3('0x24')]?!![]:![],'callbackuniqueid':_0x484fce[_0x43b3('0x24')]?_0x484fce['callbackUniqueid']:undefined,'callbackat':_0x484fce['callbackUniqueid']?moment()[_0x43b3('0x14')](_0x43b3('0x15')):undefined,'VoiceQueueId':_0x579715['id']})[_0x43b3('0x25')](_0x3de2a9());});}}}})[_0x43b3('0x19')](function(){return _0x44bca6[_0x43b3('0x18')][_0x43b3('0x2f')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x44bca6[_0x43b3('0x32')],'as':_0x43b3('0x36'),'where':{'id':_0x484fce[_0x43b3('0x22')]}}]})['then'](function(_0x27b384){if(_0x27b384){var _0x53593c=[];for(var _0x4ff0c3=0x0,_0x545c87;_0x4ff0c3<_0x27b384[_0x43b3('0x34')];_0x4ff0c3+=0x1){_0x545c87=_0x27b384[_0x4ff0c3][_0x43b3('0x11')]({'plain':!![]});_0x44bca6[_0x43b3('0x37')][_0x43b3('0x21')]({'phone':_0x484fce[_0x43b3('0x9')],'ContactId':_0x484fce['id'],'ListId':_0x484fce[_0x43b3('0x22')],'VoiceQueueId':_0x545c87['id']})[_0x43b3('0x25')](function(_0x4422b4){logger[_0x43b3('0x29')](_0x43b3('0x38'),_0x43b3('0x39'),_0x4422b4[_0x43b3('0x3a')]);});}}});})[_0x43b3('0x19')](function(){return _0x44bca6[_0x43b3('0x2b')][_0x43b3('0x2f')]({'attributes':['id',_0x43b3('0x31'),'dialTimezone'],'include':[{'model':_0x44bca6[_0x43b3('0x32')],'as':_0x43b3('0x33'),'where':{'id':_0x484fce[_0x43b3('0x22')]}}]})['then'](function(_0x1c3af4){if(_0x1c3af4){var _0x572cde=[];for(var _0x1b09a8=0x0,_0x2dae8c;_0x1b09a8<_0x1c3af4[_0x43b3('0x34')];_0x1b09a8+=0x1){_0x2dae8c=_0x1c3af4[_0x1b09a8][_0x43b3('0x11')]({'plain':!![]});switch(_0x2dae8c[_0x43b3('0x31')]){case _0x43b3('0x3b'):_0x314f27(_0x2dae8c)['catch'](_0x20bdca());break;case _0x43b3('0x35'):_0x1c07af(_0x2dae8c)['catch'](_0x20bdca());break;default:_0x44bca6[_0x43b3('0x1f')]['create']({'phone':_0x484fce[_0x43b3('0x9')],'ContactId':_0x484fce['id'],'ListId':_0x484fce[_0x43b3('0x22')],'scheduledat':_0x484fce[_0x43b3('0x13')]?_0x484fce[_0x43b3('0x13')]:moment()[_0x43b3('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x484fce[_0x43b3('0x23')]?_0x484fce['priority']:0x2,'callback':_0x484fce[_0x43b3('0x24')]?!![]:![],'callbackuniqueid':_0x484fce[_0x43b3('0x24')]?_0x484fce[_0x43b3('0x24')]:undefined,'callbackat':_0x484fce[_0x43b3('0x24')]?moment()[_0x43b3('0x14')](_0x43b3('0x15')):undefined,'CampaignId':_0x2dae8c['id']})[_0x43b3('0x25')](_0x20bdca());}}}});})[_0x43b3('0x19')](function(){return _0x44bca6[_0x43b3('0x2b')]['findAll']({'attributes':['id'],'include':[{'model':_0x44bca6['CmList'],'as':'BlackLists','where':{'id':_0x484fce[_0x43b3('0x22')]}}]})[_0x43b3('0x19')](function(_0x41f20f){if(_0x41f20f){var _0x5a96c1=[];for(var _0x49b355=0x0,_0x39c551;_0x49b355<_0x41f20f[_0x43b3('0x34')];_0x49b355+=0x1){_0x39c551=_0x41f20f[_0x49b355]['get']({'plain':!![]});_0x44bca6[_0x43b3('0x37')][_0x43b3('0x21')]({'phone':_0x484fce[_0x43b3('0x9')],'ContactId':_0x484fce['id'],'ListId':_0x484fce[_0x43b3('0x22')],'CampaignId':_0x39c551['id']})[_0x43b3('0x25')](function(_0x4e5a6f){logger[_0x43b3('0x29')]('cmContact,\x20%s,\x20%s',_0x43b3('0x39'),_0x4e5a6f[_0x43b3('0x3a')]);});}}});})[_0x43b3('0x19')](function(){_0x149ccc();})[_0x43b3('0x25')](function(_0x3a3973){logger[_0x43b3('0x29')]('cmContact,\x20%s,\x20%s','afterCreate',_0x3a3973['message']);_0x149ccc(_0x3a3973);});}else{_0x149ccc(new Error(_0x43b3('0x3c')));}},'afterDestroy':function(_0x4f43b1,_0x4e3639,_0x13b70f){var _0x1e05e8=_0x72015e[_0x43b3('0x10')];var _0x515345=_0x4f43b1['get']({'plain':!![]});return _0x1e05e8['CmHopper']['findAll']({'raw':!![],'where':{'ListId':_0x515345[_0x43b3('0x22')],'ContactId':_0x515345['id']}})[_0x43b3('0x19')](function(_0x4582f0){if(!_[_0x43b3('0x3d')](_0x4582f0)){var _0x422d2b=[];for(var _0xe15864=0x0;_0xe15864<_0x4582f0['length'];_0xe15864+=0x1){var _0x4d589e=_0x1e05e8['CmHopper'][_0x43b3('0x3e')]({'where':{'ListId':_0x4582f0[_0xe15864][_0x43b3('0x22')],'ContactId':_0x4582f0[_0xe15864][_0x43b3('0x3f')],'VoiceQueueId':_0x4582f0[_0xe15864][_0x43b3('0x40')],'CampaignId':_0x4582f0[_0xe15864][_0x43b3('0x41')]}});_0x422d2b[_0x43b3('0x42')](_0x4d589e);}return BPromise[_0x43b3('0x43')](_0x422d2b);}})['then'](function(_0x5e69c6){logger[_0x43b3('0x44')](_0x43b3('0x45'),util[_0x43b3('0x12')](_0x5e69c6,{'showHidden':![],'depth':null}));_0x13b70f();})['catch'](function(_0x286a20){logger[_0x43b3('0x29')](_0x43b3('0x46'),util[_0x43b3('0x12')](_0x286a20,{'showHidden':![],'depth':null}));_0x13b70f(_0x286a20);});}}});}; \ No newline at end of file +var _0xead8=['path','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','VoiceQueue','findOne','then','isNil','timezones','utcOffset','add','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','catch','cmContact','afterCreate','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','CmList','Lists','length','dialCheckDuplicateType','always','BlackLists','message','onlyIfOpen','CmHopperBlack','cmContact,\x20%s,\x20%s','destroy','ContactId','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Succesfull]','inspect','[CmContact][afterDestroy][Error]','lodash','util','api','moment'];(function(_0x17e0dc,_0x24af53){var _0x39c2aa=function(_0x361756){while(--_0x361756){_0x17e0dc['push'](_0x17e0dc['shift']());}};_0x39c2aa(++_0x24af53);}(_0xead8,0x120));var _0x8ead=function(_0xeeb6dd,_0x3e5f7b){_0xeeb6dd=_0xeeb6dd-0x0;var _0x95d347=_0xead8[_0xeeb6dd];return _0x95d347;};'use strict';var _=require(_0x8ead('0x0'));var util=require(_0x8ead('0x1'));var logger=require('../../config/logger')(_0x8ead('0x2'));var moment=require(_0x8ead('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ead('0x4'));var rimraf=require('rimraf');var config=require(_0x8ead('0x5'));var shared=require(_0x8ead('0x6'));var attributes=require(_0x8ead('0x7'));module[_0x8ead('0x8')]=function(_0x1a76ef,_0x3ecbb5){return _0x1a76ef['define'](_0x8ead('0x9'),attributes,{'tableName':_0x8ead('0xa'),'paranoid':!![],'indexes':[{'name':_0x8ead('0xb'),'fields':[_0x8ead('0xb')]},{'name':_0x8ead('0xc'),'fields':[_0x8ead('0xd'),'lastName',_0x8ead('0xb'),'mobile','fax',_0x8ead('0xe')],'type':_0x8ead('0xf')}],'timestamps':!![],'charset':_0x8ead('0x10'),'collate':_0x8ead('0x11'),'hooks':{'afterCreate':function(_0x2c766b,_0x519ab6,_0xfe7f3c){var _0x3f34c5=_0x1a76ef[_0x8ead('0x12')];var _0x3cfeb6=_0x2c766b[_0x8ead('0x13')]({'plain':!![]});function _0x1b7f6c(){return function(_0x31d53e){logger[_0x8ead('0x14')]('cmContact','afterCreate',util['inspect'](_0x31d53e,{'showHidden':![],'depth':null}));};}function _0x2532aa(_0x175fbb,_0x49cf96){var _0x1233b6=_0x49cf96[_0x8ead('0x15')]?_0x49cf96[_0x8ead('0x15')]:moment()[_0x8ead('0x16')](_0x8ead('0x17'));return new BPromise(function(_0xc8f3d,_0x537292){if(_['isNil'](_0x49cf96[_0x8ead('0x18')])){_0xc8f3d({'ret':_0x1233b6});}else{_0x3f34c5[_0x8ead('0x19')][_0x8ead('0x1a')]({'where':{'id':_0x175fbb['id']}})[_0x8ead('0x1b')](function(_0x394a55){if(!_['isNil'](_0x394a55)){var _0x5a4564=_0x394a55[_0x8ead('0x18')];if(!_[_0x8ead('0x1c')](_0x5a4564)){var _0x2f5bae=shared[_0x8ead('0x1d')];var _0x4d2983=_0x2f5bae[_0x5a4564];var _0x5e9b85=_0x2f5bae[_0x49cf96['dialTimezone']];if(!_[_0x8ead('0x1c')](_0x4d2983)&&!_[_0x8ead('0x1c')](_0x5e9b85)){var _0x2b4e58=_0x4d2983[_0x8ead('0x1e')]-_0x5e9b85[_0x8ead('0x1e')];_0x1233b6=_0x49cf96[_0x8ead('0x15')]?_0x49cf96[_0x8ead('0x15')]:moment();var _0x320bbe=moment(_0x1233b6)[_0x8ead('0x1f')](_0x2b4e58,_0x8ead('0x20'));_0xc8f3d({'ret':_0x320bbe[_0x8ead('0x16')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0xc8f3d({'ret':_0x1233b6});}else _0xc8f3d({'ret':_0x1233b6});}else{_0xc8f3d({'ret':_0x1233b6});}});}});return 0xa;}var _0x10de7e=function(_0xd8bc8f){return new BPromise(function(_0x4c89d3,_0x2e08a8){_0x2532aa(_0xd8bc8f,_0x3cfeb6)[_0x8ead('0x1b')](function(_0x584696){_0x3cfeb6['scheduledat']=_0x584696[_0x8ead('0x21')];_0x3f34c5[_0x8ead('0x22')]['findOne']({'where':{'phone':_0x3cfeb6[_0x8ead('0xb')],'VoiceQueueId':_0xd8bc8f['id']}})[_0x8ead('0x1b')](function(_0x377535){if(!_[_0x8ead('0x1c')](_0x377535)){throw new Error(_0x8ead('0x23')+_0x3cfeb6[_0x8ead('0xb')]+_0x8ead('0x24')+_0xd8bc8f['id']);}return _0x3f34c5[_0x8ead('0x22')][_0x8ead('0x25')]({'phone':_0x3cfeb6[_0x8ead('0xb')],'ContactId':_0x3cfeb6['id'],'ListId':_0x3cfeb6[_0x8ead('0x26')],'priority':_0x3cfeb6[_0x8ead('0x27')]?_0x3cfeb6[_0x8ead('0x27')]:0x2,'scheduledat':_0x3cfeb6[_0x8ead('0x15')]?_0x3cfeb6[_0x8ead('0x15')]:moment()['format'](_0x8ead('0x17')),'callback':_0x3cfeb6[_0x8ead('0x28')]?!![]:![],'callbackuniqueid':_0x3cfeb6[_0x8ead('0x28')]?_0x3cfeb6[_0x8ead('0x28')]:undefined,'callbackat':_0x3cfeb6[_0x8ead('0x28')]?moment()[_0x8ead('0x16')](_0x8ead('0x17')):undefined,'VoiceQueueId':_0xd8bc8f['id']});})['catch'](function(_0xa1d3eb){_0x2e08a8(_0xa1d3eb);});});});};var _0x2a5af5=function(_0x28334f){return new BPromise(function(_0x592896,_0x1ae103){_0x2532aa(_0x28334f,_0x3cfeb6)[_0x8ead('0x1b')](function(_0x423bbb){_0x3cfeb6[_0x8ead('0x15')]=_0x423bbb[_0x8ead('0x21')];_0x3f34c5['CmHopper']['findOne']({'where':{'phone':_0x3cfeb6['phone'],'VoiceQueueId':_0x28334f['id']}})['then'](function(_0x4f1845){if(!_[_0x8ead('0x1c')](_0x4f1845)){throw new Error('cmContact,\x20afterCreate\x20'+_0x3cfeb6['phone']+_0x8ead('0x29')+_0x28334f['id']);}return _0x3f34c5[_0x8ead('0x2a')][_0x8ead('0x1a')]({'where':{'calleridnum':_0x3cfeb6['phone'],'VoiceQueueId':_0x28334f['id']}});})[_0x8ead('0x1b')](function(_0x25deb1){if(!_['isNil'](_0x25deb1)){throw new Error(_0x8ead('0x2b')+_0x3cfeb6[_0x8ead('0xb')]+_0x8ead('0x2c')+_0x28334f['id']);}return _0x3f34c5['CmHopper']['create']({'phone':_0x3cfeb6[_0x8ead('0xb')],'ContactId':_0x3cfeb6['id'],'ListId':_0x3cfeb6[_0x8ead('0x26')],'priority':_0x3cfeb6[_0x8ead('0x27')]?_0x3cfeb6[_0x8ead('0x27')]:0x2,'scheduledat':_0x3cfeb6['scheduledat']?_0x3cfeb6[_0x8ead('0x15')]:moment()['format'](_0x8ead('0x17')),'callback':_0x3cfeb6[_0x8ead('0x28')]?!![]:![],'callbackuniqueid':_0x3cfeb6[_0x8ead('0x28')]?_0x3cfeb6[_0x8ead('0x28')]:undefined,'callbackat':_0x3cfeb6[_0x8ead('0x28')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x28334f['id']});})[_0x8ead('0x2d')](function(_0x265cb8){_0x1ae103(_0x265cb8);});});});};function _0x2f91d8(){return function(_0x38e3a1){logger['error'](_0x8ead('0x2e'),_0x8ead('0x2f'),util['inspect'](_0x38e3a1,{'showHidden':![],'depth':null}));};}function _0x2b7144(_0x1e1297,_0x4d5d76){var _0xf71907=_0x4d5d76[_0x8ead('0x15')]?_0x4d5d76[_0x8ead('0x15')]:moment()[_0x8ead('0x16')](_0x8ead('0x17'));return new BPromise(function(_0x5cd446,_0x163864){if(_[_0x8ead('0x1c')](_0x4d5d76[_0x8ead('0x18')])){_0x5cd446({'ret':_0xf71907});}else{_0x3f34c5[_0x8ead('0x30')][_0x8ead('0x1a')]({'where':{'id':_0x1e1297['id']}})[_0x8ead('0x1b')](function(_0x2444b7){if(!_[_0x8ead('0x1c')](_0x2444b7)){var _0x5dfc4a=_0x2444b7[_0x8ead('0x18')];if(!_[_0x8ead('0x1c')](_0x5dfc4a)){var _0xe6d9cb=shared[_0x8ead('0x1d')];var _0x3f91de=_0xe6d9cb[_0x5dfc4a];var _0xa67b2b=_0xe6d9cb[_0x4d5d76['dialTimezone']];if(!_[_0x8ead('0x1c')](_0x3f91de)&&!_[_0x8ead('0x1c')](_0xa67b2b)){var _0x52c0c1=_0x3f91de[_0x8ead('0x1e')]-_0xa67b2b[_0x8ead('0x1e')];_0xf71907=_0x4d5d76[_0x8ead('0x15')]?_0x4d5d76[_0x8ead('0x15')]:moment();var _0x3e2ee0=moment(_0xf71907)[_0x8ead('0x1f')](_0x52c0c1,_0x8ead('0x20'));_0x5cd446({'ret':_0x3e2ee0[_0x8ead('0x16')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x5cd446({'ret':_0xf71907});}else _0x5cd446({'ret':_0xf71907});}else{_0x5cd446({'ret':_0xf71907});}});}});return 0xa;}var _0x2d5a1b=function(_0x5dac65){return new BPromise(function(_0x1693db,_0x13805f){_0x2b7144(_0x5dac65,_0x3cfeb6)[_0x8ead('0x1b')](function(_0x425310){_0x3cfeb6[_0x8ead('0x15')]=_0x425310['ret'];_0x3f34c5['CmHopper'][_0x8ead('0x1a')]({'where':{'phone':_0x3cfeb6[_0x8ead('0xb')],'CampaignId':_0x5dac65['id']}})[_0x8ead('0x1b')](function(_0x20fafd){if(!_[_0x8ead('0x1c')](_0x20fafd)){throw new Error(_0x8ead('0x23')+_0x3cfeb6[_0x8ead('0xb')]+_0x8ead('0x31')+_0x5dac65['id']);}return _0x3f34c5[_0x8ead('0x22')][_0x8ead('0x25')]({'phone':_0x3cfeb6[_0x8ead('0xb')],'ContactId':_0x3cfeb6['id'],'ListId':_0x3cfeb6[_0x8ead('0x26')],'priority':_0x3cfeb6['priority']?_0x3cfeb6['priority']:0x2,'scheduledat':_0x3cfeb6[_0x8ead('0x15')]?_0x3cfeb6[_0x8ead('0x15')]:moment()[_0x8ead('0x16')](_0x8ead('0x17')),'callback':_0x3cfeb6[_0x8ead('0x28')]?!![]:![],'callbackuniqueid':_0x3cfeb6[_0x8ead('0x28')]?_0x3cfeb6['callbackUniqueid']:undefined,'callbackat':_0x3cfeb6[_0x8ead('0x28')]?moment()['format'](_0x8ead('0x17')):undefined,'CampaignId':_0x5dac65['id']});})[_0x8ead('0x2d')](function(_0x5c5193){_0x13805f(_0x5c5193);});});});};var _0x4cd244=function(_0x4c8d46){return new BPromise(function(_0x3e0bd4,_0x45fded){_0x2b7144(_0x4c8d46,_0x3cfeb6)[_0x8ead('0x1b')](function(_0x3fb42f){_0x3cfeb6['scheduledat']=_0x3fb42f['ret'];_0x3f34c5['CmHopper'][_0x8ead('0x1a')]({'where':{'phone':_0x3cfeb6[_0x8ead('0xb')],'CampaignId':_0x4c8d46['id']}})['then'](function(_0x4a38f1){if(!_[_0x8ead('0x1c')](_0x4a38f1)){throw new Error(_0x8ead('0x23')+_0x3cfeb6[_0x8ead('0xb')]+_0x8ead('0x32')+_0x4c8d46['id']);}return _0x3f34c5[_0x8ead('0x2a')]['findOne']({'where':{'calleridnum':_0x3cfeb6[_0x8ead('0xb')],'CampaignId':_0x4c8d46['id']}});})['then'](function(_0x3a1a63){if(!_['isNil'](_0x3a1a63)){throw new Error(_0x8ead('0x2b')+_0x3cfeb6[_0x8ead('0xb')]+_0x8ead('0x33')+_0x4c8d46['id']);}return _0x3f34c5[_0x8ead('0x22')][_0x8ead('0x25')]({'phone':_0x3cfeb6['phone'],'ContactId':_0x3cfeb6['id'],'ListId':_0x3cfeb6[_0x8ead('0x26')],'priority':_0x3cfeb6[_0x8ead('0x27')]?_0x3cfeb6[_0x8ead('0x27')]:0x2,'scheduledat':_0x3cfeb6[_0x8ead('0x15')]?_0x3cfeb6[_0x8ead('0x15')]:moment()[_0x8ead('0x16')](_0x8ead('0x17')),'callback':_0x3cfeb6[_0x8ead('0x28')]?!![]:![],'callbackuniqueid':_0x3cfeb6[_0x8ead('0x28')]?_0x3cfeb6['callbackUniqueid']:undefined,'callbackat':_0x3cfeb6[_0x8ead('0x28')]?moment()[_0x8ead('0x16')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4c8d46['id']});})[_0x8ead('0x2d')](function(_0x297880){_0x45fded(_0x297880);});});});};if(_0x3cfeb6[_0x8ead('0x26')]){_0x3f34c5['VoiceQueue'][_0x8ead('0x34')]({'where':{'type':_0x8ead('0x35')},'attributes':['id','dialCheckDuplicateType',_0x8ead('0x18')],'include':[{'model':_0x3f34c5[_0x8ead('0x36')],'as':_0x8ead('0x37'),'where':{'id':_0x3cfeb6['ListId']}}]})['then'](function(_0x4ed637){if(_0x4ed637){var _0xd59a96=[];for(var _0x1625c4=0x0,_0x39d229;_0x1625c4<_0x4ed637[_0x8ead('0x38')];_0x1625c4+=0x1){_0x39d229=_0x4ed637[_0x1625c4][_0x8ead('0x13')]({'plain':!![]});switch(_0x39d229[_0x8ead('0x39')]){case _0x8ead('0x3a'):_0x2a5af5(_0x39d229)['catch'](_0x1b7f6c());break;case'onlyIfOpen':_0x10de7e(_0x39d229)[_0x8ead('0x2d')](_0x1b7f6c());break;default:_0x2b7144(_0x39d229,_0x3cfeb6)[_0x8ead('0x1b')](function(_0x171be7){_0x3cfeb6[_0x8ead('0x15')]=_0x171be7['ret'];_0x3f34c5['CmHopper'][_0x8ead('0x25')]({'phone':_0x3cfeb6['phone'],'ContactId':_0x3cfeb6['id'],'ListId':_0x3cfeb6[_0x8ead('0x26')],'scheduledat':_0x3cfeb6[_0x8ead('0x15')]?_0x3cfeb6[_0x8ead('0x15')]:moment()[_0x8ead('0x16')](_0x8ead('0x17')),'priority':_0x3cfeb6[_0x8ead('0x27')]?_0x3cfeb6['priority']:0x2,'callback':_0x3cfeb6[_0x8ead('0x28')]?!![]:![],'callbackuniqueid':_0x3cfeb6[_0x8ead('0x28')]?_0x3cfeb6[_0x8ead('0x28')]:undefined,'callbackat':_0x3cfeb6['callbackUniqueid']?moment()[_0x8ead('0x16')](_0x8ead('0x17')):undefined,'VoiceQueueId':_0x39d229['id']})['catch'](_0x1b7f6c());});}}}})[_0x8ead('0x1b')](function(){return _0x3f34c5[_0x8ead('0x19')][_0x8ead('0x34')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x3f34c5[_0x8ead('0x36')],'as':_0x8ead('0x3b'),'where':{'id':_0x3cfeb6['ListId']}}]})[_0x8ead('0x1b')](function(_0x50f50a){if(_0x50f50a){var _0x2d79a4=[];for(var _0x106007=0x0,_0x15c542;_0x106007<_0x50f50a[_0x8ead('0x38')];_0x106007+=0x1){_0x15c542=_0x50f50a[_0x106007]['get']({'plain':!![]});_0x3f34c5['CmHopperBlack'][_0x8ead('0x25')]({'phone':_0x3cfeb6[_0x8ead('0xb')],'ContactId':_0x3cfeb6['id'],'ListId':_0x3cfeb6[_0x8ead('0x26')],'VoiceQueueId':_0x15c542['id']})[_0x8ead('0x2d')](function(_0x43ac75){logger[_0x8ead('0x14')]('cmContact,\x20%s,\x20%s',_0x8ead('0x2f'),_0x43ac75[_0x8ead('0x3c')]);});}}});})[_0x8ead('0x1b')](function(){return _0x3f34c5[_0x8ead('0x30')][_0x8ead('0x34')]({'attributes':['id',_0x8ead('0x39'),_0x8ead('0x18')],'include':[{'model':_0x3f34c5['CmList'],'as':_0x8ead('0x37'),'where':{'id':_0x3cfeb6[_0x8ead('0x26')]}}]})['then'](function(_0x84bd03){if(_0x84bd03){var _0x6b4d7b=[];for(var _0x4eb332=0x0,_0x3ae33a;_0x4eb332<_0x84bd03[_0x8ead('0x38')];_0x4eb332+=0x1){_0x3ae33a=_0x84bd03[_0x4eb332]['get']({'plain':!![]});switch(_0x3ae33a[_0x8ead('0x39')]){case _0x8ead('0x3a'):_0x4cd244(_0x3ae33a)[_0x8ead('0x2d')](_0x2f91d8());break;case _0x8ead('0x3d'):_0x2d5a1b(_0x3ae33a)[_0x8ead('0x2d')](_0x2f91d8());break;default:_0x3f34c5[_0x8ead('0x22')][_0x8ead('0x25')]({'phone':_0x3cfeb6[_0x8ead('0xb')],'ContactId':_0x3cfeb6['id'],'ListId':_0x3cfeb6[_0x8ead('0x26')],'scheduledat':_0x3cfeb6[_0x8ead('0x15')]?_0x3cfeb6[_0x8ead('0x15')]:moment()[_0x8ead('0x16')](_0x8ead('0x17')),'priority':_0x3cfeb6[_0x8ead('0x27')]?_0x3cfeb6[_0x8ead('0x27')]:0x2,'callback':_0x3cfeb6['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3cfeb6[_0x8ead('0x28')]?_0x3cfeb6['callbackUniqueid']:undefined,'callbackat':_0x3cfeb6[_0x8ead('0x28')]?moment()[_0x8ead('0x16')](_0x8ead('0x17')):undefined,'CampaignId':_0x3ae33a['id']})['catch'](_0x2f91d8());}}}});})[_0x8ead('0x1b')](function(){return _0x3f34c5[_0x8ead('0x30')][_0x8ead('0x34')]({'attributes':['id'],'include':[{'model':_0x3f34c5[_0x8ead('0x36')],'as':_0x8ead('0x3b'),'where':{'id':_0x3cfeb6[_0x8ead('0x26')]}}]})[_0x8ead('0x1b')](function(_0x28fbcb){if(_0x28fbcb){var _0x577486=[];for(var _0xb9cdf6=0x0,_0x106d3b;_0xb9cdf6<_0x28fbcb[_0x8ead('0x38')];_0xb9cdf6+=0x1){_0x106d3b=_0x28fbcb[_0xb9cdf6][_0x8ead('0x13')]({'plain':!![]});_0x3f34c5[_0x8ead('0x3e')][_0x8ead('0x25')]({'phone':_0x3cfeb6[_0x8ead('0xb')],'ContactId':_0x3cfeb6['id'],'ListId':_0x3cfeb6[_0x8ead('0x26')],'CampaignId':_0x106d3b['id']})[_0x8ead('0x2d')](function(_0x2c02be){logger[_0x8ead('0x14')](_0x8ead('0x3f'),_0x8ead('0x2f'),_0x2c02be[_0x8ead('0x3c')]);});}}});})[_0x8ead('0x1b')](function(){_0xfe7f3c();})[_0x8ead('0x2d')](function(_0x4b8ae2){logger[_0x8ead('0x14')](_0x8ead('0x3f'),_0x8ead('0x2f'),_0x4b8ae2[_0x8ead('0x3c')]);_0xfe7f3c(_0x4b8ae2);});}else{_0xfe7f3c(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x4c25c6,_0x5a7dd4,_0x4167e0){var _0x4b09d8=_0x1a76ef['models'];var _0x5f11fa=_0x4c25c6[_0x8ead('0x13')]({'plain':!![]});return _0x4b09d8[_0x8ead('0x22')]['findAll']({'raw':!![],'where':{'ListId':_0x5f11fa['ListId'],'ContactId':_0x5f11fa['id']}})['then'](function(_0x3bd192){if(!_['isEmpty'](_0x3bd192)){var _0x3c7a85=[];for(var _0x2cf9f1=0x0;_0x2cf9f1<_0x3bd192[_0x8ead('0x38')];_0x2cf9f1+=0x1){var _0x4f04c8=_0x4b09d8[_0x8ead('0x22')][_0x8ead('0x40')]({'where':{'ListId':_0x3bd192[_0x2cf9f1][_0x8ead('0x26')],'ContactId':_0x3bd192[_0x2cf9f1][_0x8ead('0x41')],'VoiceQueueId':_0x3bd192[_0x2cf9f1][_0x8ead('0x42')],'CampaignId':_0x3bd192[_0x2cf9f1]['CampaignId']}});_0x3c7a85[_0x8ead('0x43')](_0x4f04c8);}return BPromise[_0x8ead('0x44')](_0x3c7a85);}})[_0x8ead('0x1b')](function(_0x541849){logger[_0x8ead('0x45')](_0x8ead('0x46'),util[_0x8ead('0x47')](_0x541849,{'showHidden':![],'depth':null}));_0x4167e0();})[_0x8ead('0x2d')](function(_0x589ff9){logger[_0x8ead('0x14')](_0x8ead('0x48'),util[_0x8ead('0x47')](_0x589ff9,{'showHidden':![],'depth':null}));_0x4167e0(_0x589ff9);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 77c82fa..7717192 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x13f892,_0x2f76a9){var _0x13e753=function(_0x43d145){while(--_0x43d145){_0x13f892['push'](_0x13f892['shift']());}};_0x13e753(++_0x2f76a9);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x44c489,_0x2bbcb1){var _0x1feb22=function(_0x5c3993){while(--_0x5c3993){_0x44c489['push'](_0x44c489['shift']());}};_0x1feb22(++_0x2bbcb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index d3aeb81..1a1b394 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe79f=['INTEGER','STRING','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe79f,0x13a));var _0xfe79=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe79f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xfe79('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xfe79('0x1')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xfe79('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0xfe79('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x31c2=['sequelize','STRING','INTEGER','PHONE'];(function(_0x43f80a,_0x158675){var _0x2fb4ca=function(_0x19f1e4){while(--_0x19f1e4){_0x43f80a['push'](_0x43f80a['shift']());}};_0x2fb4ca(++_0x158675);}(_0x31c2,0x98));var _0x231c=function(_0x46470b,_0x2e71f1){_0x46470b=_0x46470b-0x0;var _0x57e437=_0x31c2[_0x46470b];return _0x57e437;};'use strict';var Sequelize=require(_0x231c('0x0'));module['exports']={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x231c('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x231c('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x231c('0x3')},'OrderBy':{'type':Sequelize[_0x231c('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x231c('0x1')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 4638e46..19541d5 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x048a=['UserProfileResource','error','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','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','reject','save','then','destroy','get','CmContactHasItems','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','query','keys','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','catch','params','filters','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation'];(function(_0x1e647b,_0x359b5e){var _0x23b626=function(_0x4a9fe6){while(--_0x4a9fe6){_0x1e647b['push'](_0x1e647b['shift']());}};_0x23b626(++_0x359b5e);}(_0x048a,0xfb));var _0xa048=function(_0x3856d6,_0x4b1404){_0x3856d6=_0x3856d6-0x0;var _0x168aa2=_0x048a[_0x3856d6];return _0x168aa2;};'use strict';var emlformat=require(_0xa048('0x0'));var rimraf=require(_0xa048('0x1'));var zipdir=require(_0xa048('0x2'));var jsonpatch=require(_0xa048('0x3'));var rp=require(_0xa048('0x4'));var moment=require(_0xa048('0x5'));var BPromise=require(_0xa048('0x6'));var Mustache=require(_0xa048('0x7'));var util=require(_0xa048('0x8'));var path=require(_0xa048('0x9'));var sox=require('sox');var csv=require(_0xa048('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa048('0xb'));var _=require('lodash');var squel=require(_0xa048('0xc'));var crypto=require(_0xa048('0xd'));var jsforce=require(_0xa048('0xe'));var deskjs=require(_0xa048('0xf'));var toCsv=require(_0xa048('0xa'));var querystring=require(_0xa048('0x10'));var Papa=require('papaparse');var Redis=require(_0xa048('0x11'));var authService=require(_0xa048('0x12'));var qs=require(_0xa048('0x13'));var as=require(_0xa048('0x14'));var hardwareService=require(_0xa048('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xa048('0x16'));var config=require(_0xa048('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b401c,_0x303733){_0x303733=_0x303733||0xcc;return function(_0x48557f){if(_0x48557f){return _0x1b401c[_0xa048('0x18')](_0x303733);}return _0x1b401c['status'](_0x303733)[_0xa048('0x19')]();};}function respondWithResult(_0x52eed1,_0x3d661b){_0x3d661b=_0x3d661b||0xc8;return function(_0x19cfa6){if(_0x19cfa6){return _0x52eed1['status'](_0x3d661b)[_0xa048('0x1a')](_0x19cfa6);}};}function respondWithFilteredResult(_0x44197b,_0x1b3402){return function(_0x2b8690){if(_0x2b8690){var _0x515b2e=typeof _0x1b3402[_0xa048('0x1b')]===_0xa048('0x1c')&&typeof _0x1b3402['limit']===_0xa048('0x1c');var _0x5c1370=_0x2b8690[_0xa048('0x1d')];var _0xb7ddf4=_0x515b2e?0x0:_0x1b3402[_0xa048('0x1b')];var _0x326379=_0x515b2e?_0x2b8690['count']:_0x1b3402[_0xa048('0x1b')]+_0x1b3402[_0xa048('0x1e')];var _0x5630f9;if(_0x326379>=_0x5c1370){_0x326379=_0x5c1370;_0x5630f9=0xc8;}else{_0x5630f9=0xce;}_0x44197b[_0xa048('0x1f')](_0x5630f9);return _0x44197b[_0xa048('0x20')]('Content-Range',_0xb7ddf4+'-'+_0x326379+'/'+_0x5c1370)[_0xa048('0x1a')](_0x2b8690);}return null;};}function patchUpdates(_0xf6802d){return function(_0x6d989a){try{jsonpatch[_0xa048('0x21')](_0x6d989a,_0xf6802d,!![]);}catch(_0x604cdb){return BPromise[_0xa048('0x22')](_0x604cdb);}return _0x6d989a[_0xa048('0x23')]();};}function saveUpdates(_0x1e3102,_0x1e961a){return function(_0x2ef976){if(_0x2ef976){return _0x2ef976['update'](_0x1e3102)[_0xa048('0x24')](function(_0x1d822d){return _0x1d822d;});}return null;};}function removeEntity(_0x37eb27,_0x27e694){return function(_0x5a4fe0){if(_0x5a4fe0){return _0x5a4fe0[_0xa048('0x25')]()[_0xa048('0x24')](function(){var _0xe34862=_0x5a4fe0[_0xa048('0x26')]({'plain':!![]});var _0x4450e0=_0xa048('0x27');return db['UserProfileResource'][_0xa048('0x25')]({'where':{'type':_0x4450e0,'resourceId':_0xe34862['id']}})['then'](function(){return _0x5a4fe0;});})['then'](function(){_0x37eb27[_0xa048('0x1f')](0xcc)[_0xa048('0x19')]();});}};}function handleEntityNotFound(_0x528c07,_0x11a112){return function(_0x29c999){if(!_0x29c999){_0x528c07[_0xa048('0x18')](0x194);}return _0x29c999;};}function handleError(_0x1e4db7,_0x1da8da){_0x1da8da=_0x1da8da||0x1f4;return function(_0x16b4f2){logger['error'](_0x16b4f2[_0xa048('0x28')]);if(_0x16b4f2[_0xa048('0x29')]){delete _0x16b4f2[_0xa048('0x29')];}_0x1e4db7[_0xa048('0x1f')](_0x1da8da)[_0xa048('0x2a')](_0x16b4f2);};}exports[_0xa048('0x2b')]=function(_0x3d13b0,_0x51d575){var _0x2755cf={},_0x14793a={},_0x40f55c={'count':0x0,'rows':[]};var _0x5cb14a=_[_0xa048('0x2c')](db[_0xa048('0x2d')][_0xa048('0x2e')],function(_0x5c905b){return{'name':_0x5c905b[_0xa048('0x2f')],'type':_0x5c905b[_0xa048('0x30')][_0xa048('0x31')]};});_0x14793a['model']=_['map'](_0x5cb14a,'name');_0x14793a[_0xa048('0x32')]=_[_0xa048('0x33')](_0x3d13b0[_0xa048('0x32')]);_0x14793a['filters']=_['intersection'](_0x14793a[_0xa048('0x34')],_0x14793a['query']);_0x2755cf['attributes']=_[_0xa048('0x35')](_0x14793a[_0xa048('0x34')],qs[_0xa048('0x36')](_0x3d13b0[_0xa048('0x32')][_0xa048('0x36')]));_0x2755cf['attributes']=_0x2755cf[_0xa048('0x37')]['length']?_0x2755cf['attributes']:_0x14793a['model'];if(!_0x3d13b0[_0xa048('0x32')][_0xa048('0x38')](_0xa048('0x39'))){_0x2755cf[_0xa048('0x1e')]=qs[_0xa048('0x1e')](_0x3d13b0[_0xa048('0x32')][_0xa048('0x1e')]);_0x2755cf['offset']=qs[_0xa048('0x1b')](_0x3d13b0['query'][_0xa048('0x1b')]);}_0x2755cf[_0xa048('0x3a')]=qs[_0xa048('0x3b')](_0x3d13b0['query'][_0xa048('0x3b')]);_0x2755cf[_0xa048('0x3c')]=qs['filters'](_['pick'](_0x3d13b0['query'],_0x14793a['filters']),_0x5cb14a);if(_0x3d13b0[_0xa048('0x32')][_0xa048('0x3d')]){_0x2755cf[_0xa048('0x3c')]=_[_0xa048('0x3e')](_0x2755cf[_0xa048('0x3c')],{'$or':_[_0xa048('0x2c')](_0x5cb14a,function(_0x235352){if(_0x235352[_0xa048('0x30')]!==_0xa048('0x3f')){var _0x3be81c={};_0x3be81c[_0x235352[_0xa048('0x29')]]={'$like':'%'+_0x3d13b0[_0xa048('0x32')][_0xa048('0x3d')]+'%'};return _0x3be81c;}})});}_0x2755cf=_[_0xa048('0x3e')]({},_0x2755cf,_0x3d13b0['options']);var _0x4dfb9e={'where':_0x2755cf[_0xa048('0x3c')]};return db[_0xa048('0x2d')][_0xa048('0x1d')](_0x4dfb9e)['then'](function(_0x2e66bf){_0x40f55c[_0xa048('0x1d')]=_0x2e66bf;if(_0x3d13b0['query'][_0xa048('0x40')]){_0x2755cf[_0xa048('0x41')]=[{'all':!![]}];}return db[_0xa048('0x2d')]['findAll'](_0x2755cf);})[_0xa048('0x24')](function(_0x441db8){_0x40f55c['rows']=_0x441db8;return _0x40f55c;})[_0xa048('0x24')](respondWithFilteredResult(_0x51d575,_0x2755cf))[_0xa048('0x42')](handleError(_0x51d575,null));};exports['show']=function(_0x4fdb7f,_0xe9a18d){var _0x93461d={'raw':!![],'where':{'id':_0x4fdb7f[_0xa048('0x43')]['id']}},_0x4d302a={};_0x4d302a[_0xa048('0x34')]=_[_0xa048('0x33')](db[_0xa048('0x2d')]['rawAttributes']);_0x4d302a[_0xa048('0x32')]=_[_0xa048('0x33')](_0x4fdb7f[_0xa048('0x32')]);_0x4d302a[_0xa048('0x44')]=_[_0xa048('0x35')](_0x4d302a[_0xa048('0x34')],_0x4d302a[_0xa048('0x32')]);_0x93461d[_0xa048('0x37')]=_[_0xa048('0x35')](_0x4d302a[_0xa048('0x34')],qs[_0xa048('0x36')](_0x4fdb7f[_0xa048('0x32')]['fields']));_0x93461d['attributes']=_0x93461d[_0xa048('0x37')][_0xa048('0x45')]?_0x93461d[_0xa048('0x37')]:_0x4d302a[_0xa048('0x34')];if(_0x4fdb7f[_0xa048('0x32')][_0xa048('0x40')]){_0x93461d[_0xa048('0x41')]=[{'all':!![]}];}_0x93461d=_[_0xa048('0x3e')]({},_0x93461d,_0x4fdb7f['options']);return db[_0xa048('0x2d')][_0xa048('0x46')](_0x93461d)[_0xa048('0x24')](handleEntityNotFound(_0xe9a18d,null))['then'](respondWithResult(_0xe9a18d,null))['catch'](handleError(_0xe9a18d,null));};exports[_0xa048('0x47')]=function(_0x15be97,_0x44fe91){return db[_0xa048('0x2d')][_0xa048('0x47')](_0x15be97['body'],{})['then'](function(_0x1c4b86){var _0x1b7185=_0x15be97[_0xa048('0x48')]['get']({'plain':!![]});if(!_0x1b7185)throw new Error(_0xa048('0x49'));if(_0x1b7185[_0xa048('0x4a')]===_0xa048('0x48')){var _0x41818d=_0x1c4b86[_0xa048('0x26')]({'plain':!![]});var _0x750eed='CmContactHasItems';return db[_0xa048('0x4b')][_0xa048('0x46')]({'where':{'name':_0x750eed,'userProfileId':_0x1b7185['userProfileId']},'raw':!![]})['then'](function(_0xefcd3c){if(_0xefcd3c&&_0xefcd3c[_0xa048('0x4c')]===0x0){return db[_0xa048('0x4d')][_0xa048('0x47')]({'name':_0x41818d[_0xa048('0x29')],'resourceId':_0x41818d['id'],'type':_0xefcd3c['name'],'sectionId':_0xefcd3c['id']},{})[_0xa048('0x24')](function(){return _0x1c4b86;});}else{return _0x1c4b86;}})['catch'](function(_0x5c5da3){logger[_0xa048('0x4e')](_0xa048('0x4f'),_0x5c5da3);throw _0x5c5da3;});}return _0x1c4b86;})[_0xa048('0x24')](respondWithResult(_0x44fe91,0xc9))[_0xa048('0x42')](handleError(_0x44fe91,null));};exports[_0xa048('0x50')]=function(_0x2755fe,_0x4d47c0){if(_0x2755fe[_0xa048('0x51')]['id']){delete _0x2755fe['body']['id'];}return db[_0xa048('0x2d')][_0xa048('0x46')]({'where':{'id':_0x2755fe[_0xa048('0x43')]['id']}})['then'](handleEntityNotFound(_0x4d47c0,null))['then'](saveUpdates(_0x2755fe['body'],null))[_0xa048('0x24')](respondWithResult(_0x4d47c0,null))[_0xa048('0x42')](handleError(_0x4d47c0,null));};exports['destroy']=function(_0xacb17f,_0x4f1151){return db[_0xa048('0x2d')]['find']({'where':{'id':_0xacb17f[_0xa048('0x43')]['id']}})[_0xa048('0x24')](handleEntityNotFound(_0x4f1151,null))['then'](removeEntity(_0x4f1151,null))[_0xa048('0x42')](handleError(_0x4f1151,null));}; \ No newline at end of file +var _0x7539=['type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','merge','CmContactHasItem','includeAll','include','findAll','rows','catch','show','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','fieldName'];(function(_0x3fcfb6,_0x515024){var _0x3b99a7=function(_0x10ddfd){while(--_0x10ddfd){_0x3fcfb6['push'](_0x3fcfb6['shift']());}};_0x3b99a7(++_0x515024);}(_0x7539,0x179));var _0x9753=function(_0x14110b,_0x3ce4f6){_0x14110b=_0x14110b-0x0;var _0x33d8db=_0x7539[_0x14110b];return _0x33d8db;};'use strict';var emlformat=require(_0x9753('0x0'));var rimraf=require(_0x9753('0x1'));var zipdir=require(_0x9753('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9753('0x3'));var moment=require(_0x9753('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9753('0x5'));var util=require(_0x9753('0x6'));var path=require(_0x9753('0x7'));var sox=require(_0x9753('0x8'));var csv=require(_0x9753('0x9'));var ejs=require(_0x9753('0xa'));var fs=require('fs');var fs_extra=require(_0x9753('0xb'));var _=require(_0x9753('0xc'));var squel=require(_0x9753('0xd'));var crypto=require(_0x9753('0xe'));var jsforce=require(_0x9753('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9753('0x9'));var querystring=require(_0x9753('0x10'));var Papa=require(_0x9753('0x11'));var Redis=require(_0x9753('0x12'));var authService=require(_0x9753('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9753('0x14'));var logger=require(_0x9753('0x15'))(_0x9753('0x16'));var utils=require(_0x9753('0x17'));var config=require(_0x9753('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9753('0x19'))['db'];function respondWithStatusCode(_0x40f449,_0x2dee60){_0x2dee60=_0x2dee60||0xcc;return function(_0x47662a){if(_0x47662a){return _0x40f449['sendStatus'](_0x2dee60);}return _0x40f449[_0x9753('0x1a')](_0x2dee60)[_0x9753('0x1b')]();};}function respondWithResult(_0x11e5c9,_0x497c81){_0x497c81=_0x497c81||0xc8;return function(_0x115f6e){if(_0x115f6e){return _0x11e5c9[_0x9753('0x1a')](_0x497c81)[_0x9753('0x1c')](_0x115f6e);}};}function respondWithFilteredResult(_0x161797,_0x460b17){return function(_0x43729d){if(_0x43729d){var _0x1fef8d=typeof _0x460b17[_0x9753('0x1d')]===_0x9753('0x1e')&&typeof _0x460b17[_0x9753('0x1f')]===_0x9753('0x1e');var _0x183772=_0x43729d['count'];var _0x542eea=_0x1fef8d?0x0:_0x460b17[_0x9753('0x1d')];var _0x5ef376=_0x1fef8d?_0x43729d[_0x9753('0x20')]:_0x460b17[_0x9753('0x1d')]+_0x460b17[_0x9753('0x1f')];var _0x4dfa12;if(_0x5ef376>=_0x183772){_0x5ef376=_0x183772;_0x4dfa12=0xc8;}else{_0x4dfa12=0xce;}_0x161797['status'](_0x4dfa12);return _0x161797['set'](_0x9753('0x21'),_0x542eea+'-'+_0x5ef376+'/'+_0x183772)[_0x9753('0x1c')](_0x43729d);}return null;};}function patchUpdates(_0x35cec1){return function(_0xc847a5){try{jsonpatch[_0x9753('0x22')](_0xc847a5,_0x35cec1,!![]);}catch(_0x40eee8){return BPromise[_0x9753('0x23')](_0x40eee8);}return _0xc847a5['save']();};}function saveUpdates(_0x3d18d2,_0x3eba83){return function(_0x4c0c60){if(_0x4c0c60){return _0x4c0c60[_0x9753('0x24')](_0x3d18d2)[_0x9753('0x25')](function(_0x4707ad){return _0x4707ad;});}return null;};}function removeEntity(_0x2befa5,_0x34c366){return function(_0x4672e4){if(_0x4672e4){return _0x4672e4[_0x9753('0x26')]()[_0x9753('0x25')](function(){var _0x38639c=_0x4672e4[_0x9753('0x27')]({'plain':!![]});var _0x47a369='CmContactHasItems';return db[_0x9753('0x28')][_0x9753('0x26')]({'where':{'type':_0x47a369,'resourceId':_0x38639c['id']}})[_0x9753('0x25')](function(){return _0x4672e4;});})[_0x9753('0x25')](function(){_0x2befa5[_0x9753('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x217966,_0x3b8964){return function(_0xf95c56){if(!_0xf95c56){_0x217966['sendStatus'](0x194);}return _0xf95c56;};}function handleError(_0x3113f0,_0x1a1f53){_0x1a1f53=_0x1a1f53||0x1f4;return function(_0x12b842){logger[_0x9753('0x29')](_0x12b842[_0x9753('0x2a')]);if(_0x12b842['name']){delete _0x12b842[_0x9753('0x2b')];}_0x3113f0[_0x9753('0x1a')](_0x1a1f53)[_0x9753('0x2c')](_0x12b842);};}exports[_0x9753('0x2d')]=function(_0x212426,_0xe8aefa){var _0x3e7d67={},_0x43076f={},_0x48fa96={'count':0x0,'rows':[]};var _0x4cb98c=_[_0x9753('0x2e')](db['CmContactHasItem']['rawAttributes'],function(_0x170369){return{'name':_0x170369[_0x9753('0x2f')],'type':_0x170369[_0x9753('0x30')][_0x9753('0x31')]};});_0x43076f[_0x9753('0x32')]=_[_0x9753('0x2e')](_0x4cb98c,_0x9753('0x2b'));_0x43076f[_0x9753('0x33')]=_[_0x9753('0x34')](_0x212426[_0x9753('0x33')]);_0x43076f['filters']=_[_0x9753('0x35')](_0x43076f['model'],_0x43076f[_0x9753('0x33')]);_0x3e7d67['attributes']=_['intersection'](_0x43076f['model'],qs[_0x9753('0x36')](_0x212426[_0x9753('0x33')]['fields']));_0x3e7d67[_0x9753('0x37')]=_0x3e7d67[_0x9753('0x37')][_0x9753('0x38')]?_0x3e7d67[_0x9753('0x37')]:_0x43076f['model'];if(!_0x212426[_0x9753('0x33')][_0x9753('0x39')](_0x9753('0x3a'))){_0x3e7d67['limit']=qs[_0x9753('0x1f')](_0x212426['query'][_0x9753('0x1f')]);_0x3e7d67[_0x9753('0x1d')]=qs[_0x9753('0x1d')](_0x212426[_0x9753('0x33')][_0x9753('0x1d')]);}_0x3e7d67[_0x9753('0x3b')]=qs[_0x9753('0x3c')](_0x212426[_0x9753('0x33')][_0x9753('0x3c')]);_0x3e7d67['where']=qs['filters'](_[_0x9753('0x3d')](_0x212426[_0x9753('0x33')],_0x43076f[_0x9753('0x3e')]),_0x4cb98c);if(_0x212426[_0x9753('0x33')][_0x9753('0x3f')]){_0x3e7d67[_0x9753('0x40')]=_['merge'](_0x3e7d67[_0x9753('0x40')],{'$or':_[_0x9753('0x2e')](_0x4cb98c,function(_0x1564a3){if(_0x1564a3[_0x9753('0x30')]!==_0x9753('0x41')){var _0x24169c={};_0x24169c[_0x1564a3['name']]={'$like':'%'+_0x212426[_0x9753('0x33')][_0x9753('0x3f')]+'%'};return _0x24169c;}})});}_0x3e7d67=_[_0x9753('0x42')]({},_0x3e7d67,_0x212426['options']);var _0xc78310={'where':_0x3e7d67[_0x9753('0x40')]};return db[_0x9753('0x43')][_0x9753('0x20')](_0xc78310)['then'](function(_0x192db5){_0x48fa96[_0x9753('0x20')]=_0x192db5;if(_0x212426['query'][_0x9753('0x44')]){_0x3e7d67[_0x9753('0x45')]=[{'all':!![]}];}return db['CmContactHasItem'][_0x9753('0x46')](_0x3e7d67);})[_0x9753('0x25')](function(_0x2a9088){_0x48fa96[_0x9753('0x47')]=_0x2a9088;return _0x48fa96;})['then'](respondWithFilteredResult(_0xe8aefa,_0x3e7d67))[_0x9753('0x48')](handleError(_0xe8aefa,null));};exports[_0x9753('0x49')]=function(_0x22ce75,_0x1fbcaa){var _0x51c025={'raw':!![],'where':{'id':_0x22ce75['params']['id']}},_0x576fd9={};_0x576fd9[_0x9753('0x32')]=_['keys'](db[_0x9753('0x43')]['rawAttributes']);_0x576fd9[_0x9753('0x33')]=_[_0x9753('0x34')](_0x22ce75['query']);_0x576fd9[_0x9753('0x3e')]=_['intersection'](_0x576fd9[_0x9753('0x32')],_0x576fd9[_0x9753('0x33')]);_0x51c025[_0x9753('0x37')]=_[_0x9753('0x35')](_0x576fd9[_0x9753('0x32')],qs[_0x9753('0x36')](_0x22ce75[_0x9753('0x33')][_0x9753('0x36')]));_0x51c025[_0x9753('0x37')]=_0x51c025[_0x9753('0x37')][_0x9753('0x38')]?_0x51c025['attributes']:_0x576fd9[_0x9753('0x32')];if(_0x22ce75[_0x9753('0x33')]['includeAll']){_0x51c025[_0x9753('0x45')]=[{'all':!![]}];}_0x51c025=_[_0x9753('0x42')]({},_0x51c025,_0x22ce75[_0x9753('0x4a')]);return db[_0x9753('0x43')]['find'](_0x51c025)[_0x9753('0x25')](handleEntityNotFound(_0x1fbcaa,null))[_0x9753('0x25')](respondWithResult(_0x1fbcaa,null))['catch'](handleError(_0x1fbcaa,null));};exports[_0x9753('0x4b')]=function(_0x31ffe2,_0x31e57c){return db['CmContactHasItem'][_0x9753('0x4b')](_0x31ffe2[_0x9753('0x4c')],{})['then'](function(_0x35ef0c){var _0x5ccde8=_0x31ffe2[_0x9753('0x4d')]['get']({'plain':!![]});if(!_0x5ccde8)throw new Error(_0x9753('0x4e'));if(_0x5ccde8[_0x9753('0x4f')]===_0x9753('0x4d')){var _0x1a222f=_0x35ef0c['get']({'plain':!![]});var _0xd7e8db=_0x9753('0x50');return db[_0x9753('0x51')]['find']({'where':{'name':_0xd7e8db,'userProfileId':_0x5ccde8[_0x9753('0x52')]},'raw':!![]})['then'](function(_0x2dc611){if(_0x2dc611&&_0x2dc611['autoAssociation']===0x0){return db[_0x9753('0x28')][_0x9753('0x4b')]({'name':_0x1a222f[_0x9753('0x2b')],'resourceId':_0x1a222f['id'],'type':_0x2dc611['name'],'sectionId':_0x2dc611['id']},{})[_0x9753('0x25')](function(){return _0x35ef0c;});}else{return _0x35ef0c;}})[_0x9753('0x48')](function(_0x5bb5b9){logger['error'](_0x9753('0x53'),_0x5bb5b9);throw _0x5bb5b9;});}return _0x35ef0c;})[_0x9753('0x25')](respondWithResult(_0x31e57c,0xc9))[_0x9753('0x48')](handleError(_0x31e57c,null));};exports[_0x9753('0x24')]=function(_0x360010,_0x40d08c){if(_0x360010[_0x9753('0x4c')]['id']){delete _0x360010[_0x9753('0x4c')]['id'];}return db[_0x9753('0x43')]['find']({'where':{'id':_0x360010['params']['id']}})[_0x9753('0x25')](handleEntityNotFound(_0x40d08c,null))['then'](saveUpdates(_0x360010['body'],null))[_0x9753('0x25')](respondWithResult(_0x40d08c,null))[_0x9753('0x48')](handleError(_0x40d08c,null));};exports[_0x9753('0x26')]=function(_0xa96d33,_0x3791a5){return db[_0x9753('0x43')][_0x9753('0x54')]({'where':{'id':_0xa96d33['params']['id']}})[_0x9753('0x25')](handleEntityNotFound(_0x3791a5,null))[_0x9753('0x25')](removeEntity(_0x3791a5,null))[_0x9753('0x48')](handleError(_0x3791a5,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 32f79b7..a02d7b7 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc577=['exports','define','CmContactHasItem','cm_contact_has_items','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmContactHasItem.attributes'];(function(_0x25019f,_0x243013){var _0x3f0abd=function(_0x3a4984){while(--_0x3a4984){_0x25019f['push'](_0x25019f['shift']());}};_0x3f0abd(++_0x243013);}(_0xc577,0x108));var _0x7c57=function(_0x3a4a66,_0x5afde4){_0x3a4a66=_0x3a4a66-0x0;var _0x2bd136=_0xc577[_0x3a4a66];return _0x2bd136;};'use strict';var _=require('lodash');var util=require(_0x7c57('0x0'));var logger=require(_0x7c57('0x1'))(_0x7c57('0x2'));var moment=require(_0x7c57('0x3'));var BPromise=require(_0x7c57('0x4'));var rp=require(_0x7c57('0x5'));var fs=require('fs');var path=require(_0x7c57('0x6'));var rimraf=require(_0x7c57('0x7'));var config=require('../../config/environment');var attributes=require(_0x7c57('0x8'));module[_0x7c57('0x9')]=function(_0x1687c6,_0x1e27fa){return _0x1687c6[_0x7c57('0xa')](_0x7c57('0xb'),attributes,{'tableName':_0x7c57('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34f2=['util','../../config/logger','moment','bluebird','request-promise','rimraf','./cmContactHasItem.attributes','exports','define','CmContactHasItem','lodash'];(function(_0x13ee4c,_0x26b5ff){var _0x2ea0d5=function(_0x9892e1){while(--_0x9892e1){_0x13ee4c['push'](_0x13ee4c['shift']());}};_0x2ea0d5(++_0x26b5ff);}(_0x34f2,0xd0));var _0x234f=function(_0x3fd595,_0x34a9ab){_0x3fd595=_0x3fd595-0x0;var _0x23e76e=_0x34f2[_0x3fd595];return _0x23e76e;};'use strict';var _=require(_0x234f('0x0'));var util=require(_0x234f('0x1'));var logger=require(_0x234f('0x2'))('api');var moment=require(_0x234f('0x3'));var BPromise=require(_0x234f('0x4'));var rp=require(_0x234f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x234f('0x6'));var config=require('../../config/environment');var attributes=require(_0x234f('0x7'));module[_0x234f('0x8')]=function(_0x1482c8,_0xfa89e9){return _0x1482c8[_0x234f('0x9')](_0x234f('0xa'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index dcc2d2d..7907092 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd9af=['util','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x5f506f,_0xf3ec98){var _0x4ab880=function(_0x1a6c91){while(--_0x1a6c91){_0x5f506f['push'](_0x5f506f['shift']());}};_0x4ab880(++_0xf3ec98);}(_0xd9af,0x1b7));var _0xfd9a=function(_0x5ee6ea,_0x104dac){_0x5ee6ea=_0x5ee6ea-0x0;var _0x43d633=_0xd9af[_0x5ee6ea];return _0x43d633;};'use strict';var _=require(_0xfd9a('0x0'));var util=require(_0xfd9a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfd9a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd9a('0x3'))['db'];var utils=require(_0xfd9a('0x4'));var logger=require(_0xfd9a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfd9a('0x6'));var client=jayson[_0xfd9a('0x7')][_0xfd9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x912266,_0x4088de,_0x403c84){return new BPromise(function(_0x2d9988,_0x3659d0){return client[_0xfd9a('0x9')](_0x912266,_0x403c84)['then'](function(_0x141e90){logger[_0xfd9a('0xa')](_0xfd9a('0xb'),_0x4088de,_0xfd9a('0xc'));logger['debug'](_0xfd9a('0xd'),_0x4088de,_0xfd9a('0xc'),JSON[_0xfd9a('0xe')](_0x141e90));if(_0x141e90[_0xfd9a('0xf')]){if(_0x141e90['error'][_0xfd9a('0x10')]===0x1f4){logger[_0xfd9a('0xf')](_0xfd9a('0xb'),_0x4088de,_0x141e90[_0xfd9a('0xf')][_0xfd9a('0x11')]);return _0x3659d0(_0x141e90[_0xfd9a('0xf')]['message']);}logger[_0xfd9a('0xf')](_0xfd9a('0xb'),_0x4088de,_0x141e90['error'][_0xfd9a('0x11')]);return _0x2d9988(_0x141e90[_0xfd9a('0xf')]['message']);}else{logger['info'](_0xfd9a('0xb'),_0x4088de,_0xfd9a('0xc'));_0x2d9988(_0x141e90[_0xfd9a('0x12')][_0xfd9a('0x11')]);}})[_0xfd9a('0x13')](function(_0x112460){logger[_0xfd9a('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x4088de,_0x112460);_0x3659d0(_0x112460);});});} \ No newline at end of file +var _0x6527=['error','code','message','result','catch','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0x6527,0xf7));var _0x7652=function(_0x18e1b4,_0x5d35a7){_0x18e1b4=_0x18e1b4-0x0;var _0x218642=_0x6527[_0x18e1b4];return _0x218642;};'use strict';var _=require('lodash');var util=require(_0x7652('0x0'));var moment=require(_0x7652('0x1'));var BPromise=require('bluebird');var rs=require(_0x7652('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7652('0x3'));var logger=require(_0x7652('0x4'))(_0x7652('0x5'));var config=require(_0x7652('0x6'));var jayson=require(_0x7652('0x7'));var client=jayson['client'][_0x7652('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b06ed,_0x4694d6,_0x39065f){return new BPromise(function(_0x1f0ec4,_0x1b9b00){return client[_0x7652('0x9')](_0x5b06ed,_0x39065f)[_0x7652('0xa')](function(_0x2e9e9a){logger[_0x7652('0xb')](_0x7652('0xc'),_0x4694d6,_0x7652('0xd'));logger[_0x7652('0xe')](_0x7652('0xf'),_0x4694d6,_0x7652('0xd'),JSON[_0x7652('0x10')](_0x2e9e9a));if(_0x2e9e9a['error']){if(_0x2e9e9a[_0x7652('0x11')][_0x7652('0x12')]===0x1f4){logger[_0x7652('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x4694d6,_0x2e9e9a[_0x7652('0x11')][_0x7652('0x13')]);return _0x1b9b00(_0x2e9e9a[_0x7652('0x11')][_0x7652('0x13')]);}logger[_0x7652('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x4694d6,_0x2e9e9a[_0x7652('0x11')][_0x7652('0x13')]);return _0x1f0ec4(_0x2e9e9a[_0x7652('0x11')][_0x7652('0x13')]);}else{logger[_0x7652('0xb')](_0x7652('0xc'),_0x4694d6,'request\x20sent');_0x1f0ec4(_0x2e9e9a[_0x7652('0x14')][_0x7652('0x13')]);}})[_0x7652('0x15')](function(_0x4f546d){logger['error'](_0x7652('0xc'),_0x4694d6,_0x4f546d);_0x1b9b00(_0x4f546d);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 246d484..4646210 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee12=['./cmContactHasItem.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3e89fe,_0x758fbe){var _0x40a300=function(_0xc8c2e0){while(--_0xc8c2e0){_0x3e89fe['push'](_0x3e89fe['shift']());}};_0x40a300(++_0x758fbe);}(_0xee12,0xc5));var _0x2ee1=function(_0x1eacde,_0x3282ed){_0x1eacde=_0x1eacde-0x0;var _0x481230=_0xee12[_0x1eacde];return _0x481230;};'use strict';var multer=require(_0x2ee1('0x0'));var util=require(_0x2ee1('0x1'));var path=require(_0x2ee1('0x2'));var timeout=require(_0x2ee1('0x3'));var express=require(_0x2ee1('0x4'));var router=express[_0x2ee1('0x5')]();var fs_extra=require(_0x2ee1('0x6'));var auth=require(_0x2ee1('0x7'));var interaction=require(_0x2ee1('0x8'));var config=require(_0x2ee1('0x9'));var controller=require(_0x2ee1('0xa'));router[_0x2ee1('0xb')]('/',auth['isAuthenticated'](),controller[_0x2ee1('0xc')]);router[_0x2ee1('0xb')](_0x2ee1('0xd'),auth['isAuthenticated'](),controller[_0x2ee1('0xe')]);router[_0x2ee1('0xf')]('/',auth[_0x2ee1('0x10')](),controller[_0x2ee1('0x11')]);router[_0x2ee1('0x12')](_0x2ee1('0xd'),auth[_0x2ee1('0x10')](),controller[_0x2ee1('0x13')]);router[_0x2ee1('0x14')](_0x2ee1('0xd'),auth['isAuthenticated'](),controller[_0x2ee1('0x15')]);module[_0x2ee1('0x16')]=router; \ No newline at end of file +var _0xdd76=['put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','get','isAuthenticated','index','show','post','create'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xdd76,0x102));var _0x6dd7=function(_0x5c22b5,_0x26fad1){_0x5c22b5=_0x5c22b5-0x0;var _0x11913a=_0xdd76[_0x5c22b5];return _0x11913a;};'use strict';var multer=require(_0x6dd7('0x0'));var util=require(_0x6dd7('0x1'));var path=require('path');var timeout=require(_0x6dd7('0x2'));var express=require(_0x6dd7('0x3'));var router=express[_0x6dd7('0x4')]();var fs_extra=require(_0x6dd7('0x5'));var auth=require(_0x6dd7('0x6'));var interaction=require(_0x6dd7('0x7'));var config=require('../../config/environment');var controller=require(_0x6dd7('0x8'));router[_0x6dd7('0x9')]('/',auth[_0x6dd7('0xa')](),controller[_0x6dd7('0xb')]);router[_0x6dd7('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6dd7('0xc')]);router[_0x6dd7('0xd')]('/',auth[_0x6dd7('0xa')](),controller[_0x6dd7('0xe')]);router[_0x6dd7('0xf')](_0x6dd7('0x10'),auth[_0x6dd7('0xa')](),controller[_0x6dd7('0x11')]);router[_0x6dd7('0x12')](_0x6dd7('0x10'),auth[_0x6dd7('0xa')](),controller[_0x6dd7('0x13')]);module[_0x6dd7('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 8f4859d..572aa94 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 _0xde58=['STRING','setDataValue','name','type','parse','values','stringify','BOOLEAN','ENUM','voice','sequelize','VIRTUAL','getDataValue','alias'];(function(_0xebd5e7,_0x3185ff){var _0x11c2d5=function(_0x5537c6){while(--_0x5537c6){_0xebd5e7['push'](_0xebd5e7['shift']());}};_0x11c2d5(++_0x3185ff);}(_0xde58,0x6c));var _0x8de5=function(_0xec92ff,_0x6ff1f4){_0xec92ff=_0xec92ff-0x0;var _0x17fea7=_0xde58[_0xec92ff];return _0x17fea7;};'use strict';var Sequelize=require(_0x8de5('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x8de5('0x1')],'get':function(_0x27be22){return this[_0x8de5('0x2')](_0x8de5('0x3'));}},'alias':{'type':Sequelize[_0x8de5('0x4')],'allowNull':![],'set':function(_0x3eb91a){this[_0x8de5('0x5')](_0x8de5('0x3'),_0x3eb91a?_0x3eb91a:this['getDataValue'](_0x8de5('0x6')));}},'type':{'type':Sequelize[_0x8de5('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this[_0x8de5('0x2')](_0x8de5('0x7'))==='select'){return JSON[_0x8de5('0x8')](this[_0x8de5('0x2')](_0x8de5('0x9')));}else{return this[_0x8de5('0x2')](_0x8de5('0x9'));}},'set':function(_0x19a08f){if(Array['isArray'](_0x19a08f)){this[_0x8de5('0x5')](_0x8de5('0x9'),JSON[_0x8de5('0xa')](_0x19a08f));}else{this[_0x8de5('0x5')](_0x8de5('0x9'),_0x19a08f);}}},'required':{'type':Sequelize[_0x8de5('0xb')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x8de5('0xb')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x8de5('0xc')](_0x8de5('0xd'))}}; \ No newline at end of file +var _0xfcd6=['values','setDataValue','stringify','BOOLEAN','ENUM','voice','lodash','exports','VIRTUAL','alias','STRING','name','TEXT','getDataValue','type','select','parse'];(function(_0x5d6cdc,_0x2f6a9a){var _0xcef9d9=function(_0x1e4b0a){while(--_0x1e4b0a){_0x5d6cdc['push'](_0x5d6cdc['shift']());}};_0xcef9d9(++_0x2f6a9a);}(_0xfcd6,0xb0));var _0x6fcd=function(_0x1d1d34,_0x49c0ec){_0x1d1d34=_0x1d1d34-0x0;var _0x4d8023=_0xfcd6[_0x1d1d34];return _0x4d8023;};'use strict';var Sequelize=require('sequelize');var _=require(_0x6fcd('0x0'));module[_0x6fcd('0x1')]={'name':{'type':Sequelize[_0x6fcd('0x2')],'get':function(_0x27b069){return this['getDataValue'](_0x6fcd('0x3'));}},'alias':{'type':Sequelize[_0x6fcd('0x4')],'allowNull':![],'set':function(_0x1b99c9){this['setDataValue'](_0x6fcd('0x3'),_0x1b99c9?_0x1b99c9:this['getDataValue'](_0x6fcd('0x5')));}},'type':{'type':Sequelize[_0x6fcd('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x6fcd('0x6')]('long'),'get':function(){if(this[_0x6fcd('0x7')](_0x6fcd('0x8'))===_0x6fcd('0x9')){return JSON[_0x6fcd('0xa')](this['getDataValue'](_0x6fcd('0xb')));}else{return this[_0x6fcd('0x7')](_0x6fcd('0xb'));}},'set':function(_0x36e3e3){if(Array['isArray'](_0x36e3e3)){this[_0x6fcd('0xc')](_0x6fcd('0xb'),JSON[_0x6fcd('0xd')](_0x36e3e3));}else{this[_0x6fcd('0xc')](_0x6fcd('0xb'),_0x36e3e3);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x6fcd('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x6fcd('0xf')](_0x6fcd('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 6ae2be2..a3a6796 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 _0x615e=['rawAttributes','fieldName','type','model','differenceBy','query','keys','filters','intersection','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','then','catch','show','fields','length','find','body','params','create','transaction','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','apply','reject','save','update','destroy','error','stack','name','send','index','map','CmCustomField'];(function(_0x9ccc17,_0x1d087c){var _0x46e989=function(_0x302510){while(--_0x302510){_0x9ccc17['push'](_0x9ccc17['shift']());}};_0x46e989(++_0x1d087c);}(_0x615e,0x189));var _0xe615=function(_0x402126,_0x148aad){_0x402126=_0x402126-0x0;var _0x3de1d5=_0x615e[_0x402126];return _0x3de1d5;};'use strict';var emlformat=require(_0xe615('0x0'));var rimraf=require(_0xe615('0x1'));var zipdir=require(_0xe615('0x2'));var jsonpatch=require(_0xe615('0x3'));var rp=require('request-promise');var moment=require(_0xe615('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe615('0x5'));var util=require(_0xe615('0x6'));var path=require(_0xe615('0x7'));var sox=require('sox');var csv=require(_0xe615('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe615('0x9'));var crypto=require('crypto');var jsforce=require(_0xe615('0xa'));var deskjs=require(_0xe615('0xb'));var toCsv=require(_0xe615('0x8'));var querystring=require(_0xe615('0xc'));var Papa=require('papaparse');var Redis=require(_0xe615('0xd'));var authService=require(_0xe615('0xe'));var qs=require(_0xe615('0xf'));var as=require(_0xe615('0x10'));var hardwareService=require(_0xe615('0x11'));var logger=require(_0xe615('0x12'))(_0xe615('0x13'));var utils=require('../../config/utils');var config=require(_0xe615('0x14'));var licenseUtil=require(_0xe615('0x15'));var db=require(_0xe615('0x16'))['db'];function respondWithStatusCode(_0x4a4e76,_0x4196b7){_0x4196b7=_0x4196b7||0xcc;return function(_0x15c472){if(_0x15c472){return _0x4a4e76['sendStatus'](_0x4196b7);}return _0x4a4e76[_0xe615('0x17')](_0x4196b7)[_0xe615('0x18')]();};}function respondWithResult(_0x370f4e,_0x4e6344){_0x4e6344=_0x4e6344||0xc8;return function(_0x2657eb){if(_0x2657eb){return _0x370f4e[_0xe615('0x17')](_0x4e6344)[_0xe615('0x19')](_0x2657eb);}};}function respondWithFilteredResult(_0x25be5d,_0x44cb19){return function(_0x2b64d5){if(_0x2b64d5){var _0x190c3e=typeof _0x44cb19[_0xe615('0x1a')]===_0xe615('0x1b')&&typeof _0x44cb19[_0xe615('0x1c')]==='undefined';var _0x5696c3=_0x2b64d5['count'];var _0xb08b3f=_0x190c3e?0x0:_0x44cb19['offset'];var _0x3667e8=_0x190c3e?_0x2b64d5['count']:_0x44cb19['offset']+_0x44cb19[_0xe615('0x1c')];var _0x3a97c4;if(_0x3667e8>=_0x5696c3){_0x3667e8=_0x5696c3;_0x3a97c4=0xc8;}else{_0x3a97c4=0xce;}_0x25be5d[_0xe615('0x17')](_0x3a97c4);return _0x25be5d[_0xe615('0x1d')]('Content-Range',_0xb08b3f+'-'+_0x3667e8+'/'+_0x5696c3)[_0xe615('0x19')](_0x2b64d5);}return null;};}function patchUpdates(_0x3c9d8c){return function(_0xceec7d){try{jsonpatch[_0xe615('0x1e')](_0xceec7d,_0x3c9d8c,!![]);}catch(_0x1b44a6){return BPromise[_0xe615('0x1f')](_0x1b44a6);}return _0xceec7d[_0xe615('0x20')]();};}function saveUpdates(_0x5b53ab,_0x40d7ba){return function(_0x2bc9f5){if(_0x2bc9f5){return _0x2bc9f5[_0xe615('0x21')](_0x5b53ab)['then'](function(_0x571ea5){return _0x571ea5;});}return null;};}function removeEntity(_0x49dcb4,_0x23f048){return function(_0x3e4f90){if(_0x3e4f90){return _0x3e4f90[_0xe615('0x22')]()['then'](function(){_0x49dcb4[_0xe615('0x17')](0xcc)[_0xe615('0x18')]();});}};}function handleEntityNotFound(_0x520d1c,_0xca7197){return function(_0x25ec29){if(!_0x25ec29){_0x520d1c['sendStatus'](0x194);}return _0x25ec29;};}function handleError(_0x10ad1e,_0x268afd){_0x268afd=_0x268afd||0x1f4;return function(_0xca096f){logger[_0xe615('0x23')](_0xca096f[_0xe615('0x24')]);if(_0xca096f[_0xe615('0x25')]){delete _0xca096f[_0xe615('0x25')];}_0x10ad1e[_0xe615('0x17')](_0x268afd)[_0xe615('0x26')](_0xca096f);};}exports[_0xe615('0x27')]=function(_0x468261,_0x171901){var _0x24641f={},_0x3cc680={},_0x4aacbb={'count':0x0,'rows':[]};var _0x1bb45c=_[_0xe615('0x28')](db[_0xe615('0x29')][_0xe615('0x2a')],function(_0x19d542){return{'name':_0x19d542[_0xe615('0x2b')],'type':_0x19d542[_0xe615('0x2c')]['key']};});_0x3cc680[_0xe615('0x2d')]=_[_0xe615('0x2e')](_[_0xe615('0x28')](_0x1bb45c,'name'),[_0xe615('0x25')]);_0x3cc680[_0xe615('0x2f')]=_[_0xe615('0x30')](_0x468261[_0xe615('0x2f')]);_0x3cc680[_0xe615('0x31')]=_[_0xe615('0x32')](_0x3cc680['model'],_0x3cc680[_0xe615('0x2f')]);_0x24641f[_0xe615('0x33')]=_[_0xe615('0x32')](_0x3cc680[_0xe615('0x2d')],qs['fields'](_0x468261['query']['fields']));_0x24641f[_0xe615('0x33')]=_0x24641f[_0xe615('0x33')]['length']?_0x24641f[_0xe615('0x33')]:_0x3cc680[_0xe615('0x2d')];if(!_0x468261['query']['hasOwnProperty'](_0xe615('0x34'))){_0x24641f[_0xe615('0x1c')]=qs[_0xe615('0x1c')](_0x468261[_0xe615('0x2f')][_0xe615('0x1c')]);_0x24641f['offset']=qs['offset'](_0x468261[_0xe615('0x2f')][_0xe615('0x1a')]);}_0x24641f['order']=qs[_0xe615('0x35')](_0x468261[_0xe615('0x2f')][_0xe615('0x35')]);_0x24641f[_0xe615('0x36')]=qs[_0xe615('0x31')](_[_0xe615('0x37')](_0x468261[_0xe615('0x2f')],_0x3cc680[_0xe615('0x31')]),_0x1bb45c);if(_0x468261[_0xe615('0x2f')][_0xe615('0x38')]){_0x24641f[_0xe615('0x36')]=_[_0xe615('0x39')](_0x24641f[_0xe615('0x36')],{'$or':_['map'](_0x1bb45c,function(_0xd8a56f){if(_0xd8a56f['type']!==_0xe615('0x3a')){var _0x2a8b4b={};_0x2a8b4b[_0xd8a56f[_0xe615('0x25')]]={'$like':'%'+_0x468261[_0xe615('0x2f')][_0xe615('0x38')]+'%'};return _0x2a8b4b;}})});}_0x24641f=_[_0xe615('0x39')]({},_0x24641f,_0x468261[_0xe615('0x3b')]);var _0x59493c={'where':_0x24641f[_0xe615('0x36')]};return db[_0xe615('0x29')][_0xe615('0x3c')](_0x59493c)['then'](function(_0xc9fa8f){_0x4aacbb[_0xe615('0x3c')]=_0xc9fa8f;if(_0x468261['query'][_0xe615('0x3d')]){_0x24641f[_0xe615('0x3e')]=[{'all':!![]}];}return db['CmCustomField'][_0xe615('0x3f')](_0x24641f);})['then'](function(_0x50952a){_0x4aacbb[_0xe615('0x40')]=_0x50952a;return _0x4aacbb;})[_0xe615('0x41')](respondWithFilteredResult(_0x171901,_0x24641f))[_0xe615('0x42')](handleError(_0x171901,null));};exports[_0xe615('0x43')]=function(_0x26ae64,_0x3f3a79){var _0x307058={'raw':!![],'where':{'id':_0x26ae64['params']['id']}},_0x399830={};_0x399830[_0xe615('0x2d')]=_[_0xe615('0x30')](db[_0xe615('0x29')][_0xe615('0x2a')]);_0x399830[_0xe615('0x2f')]=_[_0xe615('0x30')](_0x26ae64[_0xe615('0x2f')]);_0x399830[_0xe615('0x31')]=_['intersection'](_0x399830[_0xe615('0x2d')],_0x399830[_0xe615('0x2f')]);_0x307058[_0xe615('0x33')]=_['intersection'](_0x399830['model'],qs['fields'](_0x26ae64[_0xe615('0x2f')][_0xe615('0x44')]));_0x307058[_0xe615('0x33')]=_0x307058[_0xe615('0x33')][_0xe615('0x45')]?_0x307058[_0xe615('0x33')]:_0x399830[_0xe615('0x2d')];if(_0x26ae64[_0xe615('0x2f')][_0xe615('0x3d')]){_0x307058[_0xe615('0x3e')]=[{'all':!![]}];}_0x307058=_[_0xe615('0x39')]({},_0x307058,_0x26ae64[_0xe615('0x3b')]);return db[_0xe615('0x29')][_0xe615('0x46')](_0x307058)['then'](handleEntityNotFound(_0x3f3a79,null))[_0xe615('0x41')](respondWithResult(_0x3f3a79,null))[_0xe615('0x42')](handleError(_0x3f3a79,null));};exports[_0xe615('0x21')]=function(_0x4cb031,_0x77deb8){if(_0x4cb031[_0xe615('0x47')]['id']){delete _0x4cb031[_0xe615('0x47')]['id'];}return db[_0xe615('0x29')]['find']({'where':{'id':_0x4cb031[_0xe615('0x48')]['id']}})[_0xe615('0x41')](handleEntityNotFound(_0x77deb8,null))[_0xe615('0x41')](saveUpdates(_0x4cb031[_0xe615('0x47')],null))[_0xe615('0x41')](respondWithResult(_0x77deb8,null))[_0xe615('0x42')](handleError(_0x77deb8,null));};exports[_0xe615('0x22')]=function(_0xf6a573,_0x529e49){return db[_0xe615('0x29')][_0xe615('0x46')]({'where':{'id':_0xf6a573[_0xe615('0x48')]['id']}})[_0xe615('0x41')](handleEntityNotFound(_0x529e49,null))[_0xe615('0x41')](removeEntity(_0x529e49,null))[_0xe615('0x42')](handleError(_0x529e49,null));};exports[_0xe615('0x49')]=function(_0x37a0a9,_0xa4848c){var _0x5394c3;return db['sequelize'][_0xe615('0x4a')](function(_0x1c71fe){return db[_0xe615('0x29')][_0xe615('0x49')](_0x37a0a9[_0xe615('0x47')],{'transaction':_0x1c71fe})[_0xe615('0x41')](function(_0x1f4eaa){_0x5394c3=_0x1f4eaa;var _0x505d30={'type':db['Sequelize']['TEXT'],'transaction':_0x1c71fe};switch(_0x37a0a9[_0xe615('0x47')]['type']){case'text':_0x505d30['type']=db[_0xe615('0x4b')][_0xe615('0x4c')];break;case _0xe615('0x4d'):_0x505d30[_0xe615('0x2c')]=db['Sequelize'][_0xe615('0x4e')];break;case _0xe615('0x4f'):_0x505d30[_0xe615('0x2c')]=db['Sequelize'][_0xe615('0x50')];_0x505d30[_0xe615('0x51')]=![];break;default:}return db[_0xe615('0x52')][_0xe615('0x53')][_0xe615('0x54')]('cm_contacts',util[_0xe615('0x55')](_0xe615('0x56'),_0x5394c3['id']),_0x505d30);})[_0xe615('0x41')](function(){return _0x5394c3;});})[_0xe615('0x41')](respondWithResult(_0xa4848c,0xc9))[_0xe615('0x42')](handleError(_0xa4848c,null));}; \ No newline at end of file +var _0xe6d7=['Content-Range','reject','update','then','destroy','error','stack','name','index','map','CmCustomField','rawAttributes','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','include','find','body','create','sequelize','transaction','TEXT','type','text','Sequelize','INTEGER','switch','defaultValue','queryInterface','cm_contacts','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set'];(function(_0x2626d1,_0x47c26e){var _0x2bf392=function(_0x4acc0d){while(--_0x4acc0d){_0x2626d1['push'](_0x2626d1['shift']());}};_0x2bf392(++_0x47c26e);}(_0xe6d7,0xd4));var _0x7e6d=function(_0xc99620,_0x28d9c1){_0xc99620=_0xc99620-0x0;var _0x21cd2f=_0xe6d7[_0xc99620];return _0x21cd2f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e6d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e6d('0x1'));var rp=require(_0x7e6d('0x2'));var moment=require(_0x7e6d('0x3'));var BPromise=require(_0x7e6d('0x4'));var Mustache=require('mustache');var util=require(_0x7e6d('0x5'));var path=require(_0x7e6d('0x6'));var sox=require(_0x7e6d('0x7'));var csv=require(_0x7e6d('0x8'));var ejs=require(_0x7e6d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e6d('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7e6d('0xb'));var deskjs=require(_0x7e6d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7e6d('0xd'));var Papa=require(_0x7e6d('0xe'));var Redis=require(_0x7e6d('0xf'));var authService=require(_0x7e6d('0x10'));var qs=require(_0x7e6d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e6d('0x12'));var logger=require(_0x7e6d('0x13'))(_0x7e6d('0x14'));var utils=require('../../config/utils');var config=require(_0x7e6d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7e6d('0x16'))['db'];function respondWithStatusCode(_0x2cdca3,_0x22b0da){_0x22b0da=_0x22b0da||0xcc;return function(_0x2b778a){if(_0x2b778a){return _0x2cdca3[_0x7e6d('0x17')](_0x22b0da);}return _0x2cdca3[_0x7e6d('0x18')](_0x22b0da)[_0x7e6d('0x19')]();};}function respondWithResult(_0x4f65f3,_0x40de72){_0x40de72=_0x40de72||0xc8;return function(_0x555982){if(_0x555982){return _0x4f65f3[_0x7e6d('0x18')](_0x40de72)['json'](_0x555982);}};}function respondWithFilteredResult(_0x1dd9fe,_0x6d4550){return function(_0x4b00fb){if(_0x4b00fb){var _0x5eb49d=typeof _0x6d4550['offset']===_0x7e6d('0x1a')&&typeof _0x6d4550[_0x7e6d('0x1b')]===_0x7e6d('0x1a');var _0x1f9b9d=_0x4b00fb['count'];var _0x5b4313=_0x5eb49d?0x0:_0x6d4550[_0x7e6d('0x1c')];var _0x4b07af=_0x5eb49d?_0x4b00fb[_0x7e6d('0x1d')]:_0x6d4550[_0x7e6d('0x1c')]+_0x6d4550[_0x7e6d('0x1b')];var _0x2f37da;if(_0x4b07af>=_0x1f9b9d){_0x4b07af=_0x1f9b9d;_0x2f37da=0xc8;}else{_0x2f37da=0xce;}_0x1dd9fe[_0x7e6d('0x18')](_0x2f37da);return _0x1dd9fe[_0x7e6d('0x1e')](_0x7e6d('0x1f'),_0x5b4313+'-'+_0x4b07af+'/'+_0x1f9b9d)['json'](_0x4b00fb);}return null;};}function patchUpdates(_0x37369c){return function(_0x16369d){try{jsonpatch['apply'](_0x16369d,_0x37369c,!![]);}catch(_0x2deec2){return BPromise[_0x7e6d('0x20')](_0x2deec2);}return _0x16369d['save']();};}function saveUpdates(_0x505038,_0xfe4ec6){return function(_0x37f30a){if(_0x37f30a){return _0x37f30a[_0x7e6d('0x21')](_0x505038)[_0x7e6d('0x22')](function(_0x3029bc){return _0x3029bc;});}return null;};}function removeEntity(_0x5667c6,_0x2d4b2a){return function(_0x5ebcd0){if(_0x5ebcd0){return _0x5ebcd0[_0x7e6d('0x23')]()['then'](function(){_0x5667c6[_0x7e6d('0x18')](0xcc)[_0x7e6d('0x19')]();});}};}function handleEntityNotFound(_0x513de9,_0x1a1864){return function(_0xa4ce30){if(!_0xa4ce30){_0x513de9[_0x7e6d('0x17')](0x194);}return _0xa4ce30;};}function handleError(_0x2ab933,_0x563a96){_0x563a96=_0x563a96||0x1f4;return function(_0x50ec71){logger[_0x7e6d('0x24')](_0x50ec71[_0x7e6d('0x25')]);if(_0x50ec71['name']){delete _0x50ec71[_0x7e6d('0x26')];}_0x2ab933['status'](_0x563a96)['send'](_0x50ec71);};}exports[_0x7e6d('0x27')]=function(_0x58a602,_0xeea8fd){var _0x4e3c74={},_0x490857={},_0x4ad8f3={'count':0x0,'rows':[]};var _0x31687f=_[_0x7e6d('0x28')](db[_0x7e6d('0x29')][_0x7e6d('0x2a')],function(_0x3a037c){return{'name':_0x3a037c['fieldName'],'type':_0x3a037c['type'][_0x7e6d('0x2b')]};});_0x490857['model']=_['differenceBy'](_[_0x7e6d('0x28')](_0x31687f,'name'),[_0x7e6d('0x26')]);_0x490857[_0x7e6d('0x2c')]=_['keys'](_0x58a602[_0x7e6d('0x2c')]);_0x490857['filters']=_[_0x7e6d('0x2d')](_0x490857[_0x7e6d('0x2e')],_0x490857[_0x7e6d('0x2c')]);_0x4e3c74['attributes']=_['intersection'](_0x490857[_0x7e6d('0x2e')],qs[_0x7e6d('0x2f')](_0x58a602['query'][_0x7e6d('0x2f')]));_0x4e3c74[_0x7e6d('0x30')]=_0x4e3c74[_0x7e6d('0x30')][_0x7e6d('0x31')]?_0x4e3c74[_0x7e6d('0x30')]:_0x490857[_0x7e6d('0x2e')];if(!_0x58a602[_0x7e6d('0x2c')][_0x7e6d('0x32')](_0x7e6d('0x33'))){_0x4e3c74[_0x7e6d('0x1b')]=qs[_0x7e6d('0x1b')](_0x58a602['query'][_0x7e6d('0x1b')]);_0x4e3c74[_0x7e6d('0x1c')]=qs[_0x7e6d('0x1c')](_0x58a602['query'][_0x7e6d('0x1c')]);}_0x4e3c74['order']=qs[_0x7e6d('0x34')](_0x58a602[_0x7e6d('0x2c')][_0x7e6d('0x34')]);_0x4e3c74[_0x7e6d('0x35')]=qs[_0x7e6d('0x36')](_[_0x7e6d('0x37')](_0x58a602[_0x7e6d('0x2c')],_0x490857[_0x7e6d('0x36')]),_0x31687f);if(_0x58a602[_0x7e6d('0x2c')][_0x7e6d('0x38')]){_0x4e3c74[_0x7e6d('0x35')]=_[_0x7e6d('0x39')](_0x4e3c74[_0x7e6d('0x35')],{'$or':_[_0x7e6d('0x28')](_0x31687f,function(_0x3d8720){if(_0x3d8720['type']!==_0x7e6d('0x3a')){var _0x2b76b6={};_0x2b76b6[_0x3d8720[_0x7e6d('0x26')]]={'$like':'%'+_0x58a602['query'][_0x7e6d('0x38')]+'%'};return _0x2b76b6;}})});}_0x4e3c74=_[_0x7e6d('0x39')]({},_0x4e3c74,_0x58a602[_0x7e6d('0x3b')]);var _0xc1a1c3={'where':_0x4e3c74[_0x7e6d('0x35')]};return db[_0x7e6d('0x29')][_0x7e6d('0x1d')](_0xc1a1c3)[_0x7e6d('0x22')](function(_0x35fe0c){_0x4ad8f3['count']=_0x35fe0c;if(_0x58a602['query'][_0x7e6d('0x3c')]){_0x4e3c74['include']=[{'all':!![]}];}return db[_0x7e6d('0x29')][_0x7e6d('0x3d')](_0x4e3c74);})[_0x7e6d('0x22')](function(_0x4f5b7e){_0x4ad8f3['rows']=_0x4f5b7e;return _0x4ad8f3;})[_0x7e6d('0x22')](respondWithFilteredResult(_0xeea8fd,_0x4e3c74))[_0x7e6d('0x3e')](handleError(_0xeea8fd,null));};exports[_0x7e6d('0x3f')]=function(_0xd70e25,_0x566028){var _0x40f3ab={'raw':!![],'where':{'id':_0xd70e25[_0x7e6d('0x40')]['id']}},_0x344cd3={};_0x344cd3['model']=_[_0x7e6d('0x41')](db[_0x7e6d('0x29')][_0x7e6d('0x2a')]);_0x344cd3[_0x7e6d('0x2c')]=_[_0x7e6d('0x41')](_0xd70e25[_0x7e6d('0x2c')]);_0x344cd3['filters']=_[_0x7e6d('0x2d')](_0x344cd3['model'],_0x344cd3[_0x7e6d('0x2c')]);_0x40f3ab[_0x7e6d('0x30')]=_['intersection'](_0x344cd3['model'],qs[_0x7e6d('0x2f')](_0xd70e25[_0x7e6d('0x2c')][_0x7e6d('0x2f')]));_0x40f3ab['attributes']=_0x40f3ab['attributes'][_0x7e6d('0x31')]?_0x40f3ab[_0x7e6d('0x30')]:_0x344cd3[_0x7e6d('0x2e')];if(_0xd70e25[_0x7e6d('0x2c')][_0x7e6d('0x3c')]){_0x40f3ab[_0x7e6d('0x42')]=[{'all':!![]}];}_0x40f3ab=_[_0x7e6d('0x39')]({},_0x40f3ab,_0xd70e25['options']);return db[_0x7e6d('0x29')][_0x7e6d('0x43')](_0x40f3ab)[_0x7e6d('0x22')](handleEntityNotFound(_0x566028,null))[_0x7e6d('0x22')](respondWithResult(_0x566028,null))['catch'](handleError(_0x566028,null));};exports[_0x7e6d('0x21')]=function(_0x4a4c78,_0x14966e){if(_0x4a4c78[_0x7e6d('0x44')]['id']){delete _0x4a4c78[_0x7e6d('0x44')]['id'];}return db[_0x7e6d('0x29')][_0x7e6d('0x43')]({'where':{'id':_0x4a4c78['params']['id']}})[_0x7e6d('0x22')](handleEntityNotFound(_0x14966e,null))[_0x7e6d('0x22')](saveUpdates(_0x4a4c78['body'],null))['then'](respondWithResult(_0x14966e,null))[_0x7e6d('0x3e')](handleError(_0x14966e,null));};exports[_0x7e6d('0x23')]=function(_0x3f6873,_0x4b01f1){return db[_0x7e6d('0x29')][_0x7e6d('0x43')]({'where':{'id':_0x3f6873[_0x7e6d('0x40')]['id']}})[_0x7e6d('0x22')](handleEntityNotFound(_0x4b01f1,null))[_0x7e6d('0x22')](removeEntity(_0x4b01f1,null))[_0x7e6d('0x3e')](handleError(_0x4b01f1,null));};exports[_0x7e6d('0x45')]=function(_0x5ac798,_0x2885d5){var _0x42de51;return db[_0x7e6d('0x46')][_0x7e6d('0x47')](function(_0x5a3f53){return db[_0x7e6d('0x29')][_0x7e6d('0x45')](_0x5ac798[_0x7e6d('0x44')],{'transaction':_0x5a3f53})[_0x7e6d('0x22')](function(_0x50d812){_0x42de51=_0x50d812;var _0xa23d2f={'type':db['Sequelize'][_0x7e6d('0x48')],'transaction':_0x5a3f53};switch(_0x5ac798['body'][_0x7e6d('0x49')]){case _0x7e6d('0x4a'):_0xa23d2f['type']=db[_0x7e6d('0x4b')]['TEXT'];break;case'number':_0xa23d2f[_0x7e6d('0x49')]=db['Sequelize'][_0x7e6d('0x4c')];break;case _0x7e6d('0x4d'):_0xa23d2f[_0x7e6d('0x49')]=db[_0x7e6d('0x4b')]['BOOLEAN'];_0xa23d2f[_0x7e6d('0x4e')]=![];break;default:}return db[_0x7e6d('0x46')][_0x7e6d('0x4f')]['addColumn'](_0x7e6d('0x50'),util['format']('cf_%d',_0x42de51['id']),_0xa23d2f);})['then'](function(){return _0x42de51;});})[_0x7e6d('0x22')](respondWithResult(_0x2885d5,0xc9))[_0x7e6d('0x3e')](handleError(_0x2885d5,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 22d8996..58bdf4f 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 _0x4589=['request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5be795,_0x1cb1b8){var _0x4e8a3b=function(_0x5584ef){while(--_0x5584ef){_0x5be795['push'](_0x5be795['shift']());}};_0x4e8a3b(++_0x1cb1b8);}(_0x4589,0x117));var _0x9458=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x4589[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0x9458('0x0'));var util=require(_0x9458('0x1'));var logger=require(_0x9458('0x2'))(_0x9458('0x3'));var moment=require(_0x9458('0x4'));var BPromise=require(_0x9458('0x5'));var rp=require(_0x9458('0x6'));var fs=require('fs');var path=require(_0x9458('0x7'));var rimraf=require(_0x9458('0x8'));var config=require(_0x9458('0x9'));var attributes=require(_0x9458('0xa'));module[_0x9458('0xb')]=function(_0x254ddc,_0x6b6462){return _0x254ddc[_0x9458('0xc')](_0x9458('0xd'),attributes,{'tableName':_0x9458('0xe'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3ef=['exports','CmCustomField','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x188c90,_0x59c793){var _0x23850f=function(_0x47b75b){while(--_0x47b75b){_0x188c90['push'](_0x188c90['shift']());}};_0x23850f(++_0x59c793);}(_0xd3ef,0x7a));var _0xfd3e=function(_0x5a8c89,_0xc5bd76){_0x5a8c89=_0x5a8c89-0x0;var _0x115fb3=_0xd3ef[_0x5a8c89];return _0x115fb3;};'use strict';var _=require(_0xfd3e('0x0'));var util=require(_0xfd3e('0x1'));var logger=require(_0xfd3e('0x2'))(_0xfd3e('0x3'));var moment=require('moment');var BPromise=require(_0xfd3e('0x4'));var rp=require(_0xfd3e('0x5'));var fs=require('fs');var path=require(_0xfd3e('0x6'));var rimraf=require(_0xfd3e('0x7'));var config=require(_0xfd3e('0x8'));var attributes=require(_0xfd3e('0x9'));module[_0xfd3e('0xa')]=function(_0x24b59f,_0x3f6101){return _0x24b59f['define'](_0xfd3e('0xb'),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 ffbd399..9bb3ac0 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 _0xde0a=['then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xde0a,0xcb));var _0xade0=function(_0x562a41,_0x57565d){_0x562a41=_0x562a41-0x0;var _0x1dee1c=_0xde0a[_0x562a41];return _0x1dee1c;};'use strict';var _=require(_0xade0('0x0'));var util=require(_0xade0('0x1'));var moment=require(_0xade0('0x2'));var BPromise=require(_0xade0('0x3'));var rs=require(_0xade0('0x4'));var fs=require('fs');var Redis=require(_0xade0('0x5'));var db=require(_0xade0('0x6'))['db'];var utils=require(_0xade0('0x7'));var logger=require(_0xade0('0x8'))(_0xade0('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xade0('0xa')][_0xade0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23abea,_0xd24511,_0x1f9471){return new BPromise(function(_0x5f3000,_0xb6264b){return client[_0xade0('0xc')](_0x23abea,_0x1f9471)[_0xade0('0xd')](function(_0x32b4b4){logger[_0xade0('0xe')](_0xade0('0xf'),_0xd24511,_0xade0('0x10'));logger[_0xade0('0x11')](_0xade0('0x12'),_0xd24511,_0xade0('0x10'),JSON[_0xade0('0x13')](_0x32b4b4));if(_0x32b4b4[_0xade0('0x14')]){if(_0x32b4b4[_0xade0('0x14')]['code']===0x1f4){logger[_0xade0('0x14')](_0xade0('0xf'),_0xd24511,_0x32b4b4['error'][_0xade0('0x15')]);return _0xb6264b(_0x32b4b4[_0xade0('0x14')][_0xade0('0x15')]);}logger[_0xade0('0x14')](_0xade0('0xf'),_0xd24511,_0x32b4b4[_0xade0('0x14')][_0xade0('0x15')]);return _0x5f3000(_0x32b4b4[_0xade0('0x14')][_0xade0('0x15')]);}else{logger[_0xade0('0xe')](_0xade0('0xf'),_0xd24511,_0xade0('0x10'));_0x5f3000(_0x32b4b4[_0xade0('0x16')][_0xade0('0x15')]);}})[_0xade0('0x17')](function(_0xf68a3c){logger['error'](_0xade0('0xf'),_0xd24511,_0xf68a3c);_0xb6264b(_0xf68a3c);});});} \ No newline at end of file +var _0x1e1e=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x35b9d3,_0x1babcf){var _0x1d80b8=function(_0xb4c327){while(--_0xb4c327){_0x35b9d3['push'](_0x35b9d3['shift']());}};_0x1d80b8(++_0x1babcf);}(_0x1e1e,0x161));var _0xe1e1=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0x1e1e[_0x5d8018];return _0x151ac4;};'use strict';var _=require('lodash');var util=require(_0xe1e1('0x0'));var moment=require('moment');var BPromise=require(_0xe1e1('0x1'));var rs=require(_0xe1e1('0x2'));var fs=require('fs');var Redis=require(_0xe1e1('0x3'));var db=require(_0xe1e1('0x4'))['db'];var utils=require(_0xe1e1('0x5'));var logger=require(_0xe1e1('0x6'))(_0xe1e1('0x7'));var config=require(_0xe1e1('0x8'));var jayson=require(_0xe1e1('0x9'));var client=jayson[_0xe1e1('0xa')][_0xe1e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x116068,_0x4055cc,_0x241b1b){return new BPromise(function(_0x1a02fe,_0x5c62ed){return client[_0xe1e1('0xc')](_0x116068,_0x241b1b)[_0xe1e1('0xd')](function(_0x18c38c){logger[_0xe1e1('0xe')](_0xe1e1('0xf'),_0x4055cc,_0xe1e1('0x10'));logger[_0xe1e1('0x11')](_0xe1e1('0x12'),_0x4055cc,_0xe1e1('0x10'),JSON[_0xe1e1('0x13')](_0x18c38c));if(_0x18c38c[_0xe1e1('0x14')]){if(_0x18c38c[_0xe1e1('0x14')][_0xe1e1('0x15')]===0x1f4){logger[_0xe1e1('0x14')]('CmCustomField,\x20%s,\x20%s',_0x4055cc,_0x18c38c[_0xe1e1('0x14')][_0xe1e1('0x16')]);return _0x5c62ed(_0x18c38c[_0xe1e1('0x14')][_0xe1e1('0x16')]);}logger[_0xe1e1('0x14')]('CmCustomField,\x20%s,\x20%s',_0x4055cc,_0x18c38c[_0xe1e1('0x14')]['message']);return _0x1a02fe(_0x18c38c[_0xe1e1('0x14')][_0xe1e1('0x16')]);}else{logger[_0xe1e1('0xe')]('CmCustomField,\x20%s,\x20%s',_0x4055cc,_0xe1e1('0x10'));_0x1a02fe(_0x18c38c[_0xe1e1('0x17')][_0xe1e1('0x16')]);}})['catch'](function(_0x16aff8){logger[_0xe1e1('0x14')](_0xe1e1('0xf'),_0x4055cc,_0x16aff8);_0x5c62ed(_0x16aff8);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 2b30e0d..b02d61e 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 _0x5292=['/:id','post','isAuthenticated','put','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x5292,0xf7));var _0x2529=function(_0xce2009,_0x1f8cf8){_0xce2009=_0xce2009-0x0;var _0x1c83cb=_0x5292[_0xce2009];return _0x1c83cb;};'use strict';var multer=require(_0x2529('0x0'));var util=require(_0x2529('0x1'));var path=require('path');var timeout=require(_0x2529('0x2'));var express=require('express');var router=express[_0x2529('0x3')]();var fs_extra=require(_0x2529('0x4'));var auth=require(_0x2529('0x5'));var interaction=require(_0x2529('0x6'));var config=require('../../config/environment');var controller=require(_0x2529('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2529('0x8')](_0x2529('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x2529('0xa')]('/',auth[_0x2529('0xb')](),controller['create']);router[_0x2529('0xc')](_0x2529('0x9'),auth[_0x2529('0xb')](),controller[_0x2529('0xd')]);router[_0x2529('0xe')](_0x2529('0x9'),auth[_0x2529('0xb')](),controller[_0x2529('0xf')]);module['exports']=router; \ No newline at end of file +var _0xbcbb=['express','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','multer','util','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbcbb,0x14d));var _0xbbcb=function(_0x1486e5,_0x39684f){_0x1486e5=_0x1486e5-0x0;var _0x29d89b=_0xbcbb[_0x1486e5];return _0x29d89b;};'use strict';var multer=require(_0xbbcb('0x0'));var util=require(_0xbbcb('0x1'));var path=require(_0xbbcb('0x2'));var timeout=require('connect-timeout');var express=require(_0xbbcb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbbcb('0x4'));var interaction=require(_0xbbcb('0x5'));var config=require('../../config/environment');var controller=require(_0xbbcb('0x6'));router[_0xbbcb('0x7')]('/',auth[_0xbbcb('0x8')](),controller[_0xbbcb('0x9')]);router[_0xbbcb('0x7')](_0xbbcb('0xa'),auth[_0xbbcb('0x8')](),controller[_0xbbcb('0xb')]);router['post']('/',auth[_0xbbcb('0x8')](),controller['create']);router[_0xbbcb('0xc')](_0xbbcb('0xa'),auth[_0xbbcb('0x8')](),controller[_0xbbcb('0xd')]);router[_0xbbcb('0xe')]('/:id',auth[_0xbbcb('0x8')](),controller[_0xbbcb('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 33bd48b..b8f0dce 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 _0xa30e=['STRING','UNSIGNED','contactListQueue','moment','sequelize','BOOLEAN','format','INTEGER'];(function(_0x11ba9b,_0x3a1a80){var _0x3bbcaa=function(_0x1124b4){while(--_0x1124b4){_0x11ba9b['push'](_0x11ba9b['shift']());}};_0x3bbcaa(++_0x3a1a80);}(_0xa30e,0x163));var _0xea30=function(_0x2a2e72,_0x1de962){_0x2a2e72=_0x2a2e72-0x0;var _0x3cfb4a=_0xa30e[_0x2a2e72];return _0x3cfb4a;};'use strict';var moment=require(_0xea30('0x0'));var Sequelize=require(_0xea30('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xea30('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xea30('0x3')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xea30('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xea30('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xea30('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xea30('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xea30('0x4')](0x2)[_0xea30('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xea30('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xea30('0x4')],'unique':_0xea30('0x7')},'ListId':{'type':Sequelize[_0xea30('0x4')],'unique':_0xea30('0x7')},'UserId':{'type':Sequelize[_0xea30('0x4')]},'VoiceQueueId':{'type':Sequelize[_0xea30('0x4')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xea30('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xea30('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xea30('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xea30('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xea30('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xea30('0x4')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xea30('0x5')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x9ef3=['UNSIGNED','contactListQueue','exports','STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x31b5a5,_0x44376a){var _0x364cc9=function(_0x4e5f95){while(--_0x4e5f95){_0x31b5a5['push'](_0x31b5a5['shift']());}};_0x364cc9(++_0x44376a);}(_0x9ef3,0x1ba));var _0x39ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ef3[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x39ef('0x0')]={'phone':{'type':Sequelize[_0x39ef('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x39ef('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x39ef('0x3')],'defaultValue':moment()['format'](_0x39ef('0x4'))},'countbusyretry':{'type':Sequelize[_0x39ef('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x39ef('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x39ef('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x39ef('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x39ef('0x5')](0x2)[_0x39ef('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x39ef('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x39ef('0x5')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x39ef('0x5')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x39ef('0x5')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x39ef('0x7')},'CampaignId':{'type':Sequelize[_0x39ef('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x39ef('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x39ef('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x39ef('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x39ef('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x39ef('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index ab3716b..bc6d56e 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 _0xd58c=['format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','ivr','CmContact','ContactId','lastName','isNil','calleridname','firstName','finally','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','dialOrderByScheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','Contact','CmCompany','CmList','Queue','dialActive','getPreviewRecall','transaction','scheduledat','recallme','Company','List','getOpenContacts','isNumber','entity\x20not\x20found','sendStatus','getTimezones','timezones','push','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','api','../../mysqldb','status','json','offset','undefined','limit','count','set','update','then','error','name','send','map','rawAttributes','key','model','query','keys','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$eq','$not','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$contains','$any','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','CmHopper','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','updatedAt','state','deleted','membername','user','UserId','deletedat'];(function(_0x40e50a,_0x549543){var _0x2802db=function(_0x15c41c){while(--_0x15c41c){_0x40e50a['push'](_0x40e50a['shift']());}};_0x2802db(++_0x549543);}(_0xd58c,0xb6));var _0xcd58=function(_0x531188,_0xc8a886){_0x531188=_0x531188-0x0;var _0x2537c5=_0xd58c[_0x531188];return _0x2537c5;};'use strict';var moment=require(_0xcd58('0x0'));var _=require(_0xcd58('0x1'));var qs=require(_0xcd58('0x2'));var logger=require('../../config/logger')(_0xcd58('0x3'));var shared=require('../../config/environment');var db=require(_0xcd58('0x4'))['db'];function respondWithResult(_0x4be7d0,_0xe6c68){_0xe6c68=_0xe6c68||0xc8;return function(_0x2a22bd){if(_0x2a22bd){return _0x4be7d0[_0xcd58('0x5')](_0xe6c68)[_0xcd58('0x6')](_0x2a22bd);}};}function respondWithFilteredResult(_0x45bc6f,_0x599c02){return function(_0x546187){if(_0x546187){var _0x3f2c97=typeof _0x599c02[_0xcd58('0x7')]===_0xcd58('0x8')&&typeof _0x599c02[_0xcd58('0x9')]===_0xcd58('0x8');var _0x491d5b=_0x546187[_0xcd58('0xa')];var _0x43732a=_0x3f2c97?0x0:_0x599c02['offset'];var _0x1e6f95=_0x3f2c97?_0x546187['count']:_0x599c02[_0xcd58('0x7')]+_0x599c02[_0xcd58('0x9')];var _0x440cf1;if(_0x1e6f95>=_0x491d5b){_0x1e6f95=_0x491d5b;_0x440cf1=0xc8;}else{_0x440cf1=0xce;}_0x45bc6f['status'](_0x440cf1);return _0x45bc6f[_0xcd58('0xb')]('Content-Range',_0x43732a+'-'+_0x1e6f95+'/'+_0x491d5b)[_0xcd58('0x6')](_0x546187);}return null;};}function saveUpdates(_0x51880c,_0x477d19){return function(_0x42b221){if(_0x42b221){return _0x42b221[_0xcd58('0xc')](_0x51880c)[_0xcd58('0xd')](function(_0x37561b){return _0x37561b;});}return null;};}function handleEntityNotFound(_0x202412,_0xda9091){return function(_0x3376f3){if(!_0x3376f3){_0x202412['sendStatus'](0x194);}return _0x3376f3;};}function handleError(_0x5d0aa3,_0x3ce190){_0x3ce190=_0x3ce190||0x1f4;return function(_0xa225e3){logger[_0xcd58('0xe')](_0xa225e3['stack']);if(_0xa225e3['name']){delete _0xa225e3[_0xcd58('0xf')];}_0x5d0aa3[_0xcd58('0x5')](_0x3ce190)[_0xcd58('0x10')](_0xa225e3);};}exports['index']=function(_0x4e9b76,_0x3686ad){var _0x53ad6a={},_0x21ef20={},_0x39dc9c={'count':0x0,'rows':[]};var _0x2824a6=_[_0xcd58('0x11')](db['CmHopper'][_0xcd58('0x12')],function(_0x49881d){return{'name':_0x49881d['fieldName'],'type':_0x49881d['type'][_0xcd58('0x13')]};});_0x21ef20[_0xcd58('0x14')]=_[_0xcd58('0x11')](_0x2824a6,'name');_0x21ef20[_0xcd58('0x15')]=_[_0xcd58('0x16')](_0x4e9b76['query']);_0x21ef20[_0xcd58('0x17')]=_[_0xcd58('0x18')](_0x21ef20[_0xcd58('0x14')],_0x21ef20['query']);_0x21ef20['filters']=_[_0xcd58('0x19')](_0x21ef20[_0xcd58('0x17')],[_0xcd58('0x1a'),_0xcd58('0x1b'),_0xcd58('0x1c'),_0xcd58('0x1d'),_0xcd58('0x1e'),'$lte','$ne',_0xcd58('0x1f'),_0xcd58('0x20'),'$between',_0xcd58('0x21'),'$in',_0xcd58('0x22'),_0xcd58('0x23'),_0xcd58('0x24'),_0xcd58('0x25'),_0xcd58('0x26'),_0xcd58('0x23'),'$overlap',_0xcd58('0x27'),'$contained',_0xcd58('0x28')]);_0x53ad6a['attributes']=_[_0xcd58('0x18')](_0x21ef20['model'],qs[_0xcd58('0x29')](_0x4e9b76['query'][_0xcd58('0x29')]));_0x53ad6a[_0xcd58('0x2a')]=_0x53ad6a[_0xcd58('0x2a')][_0xcd58('0x2b')]?_0x53ad6a['attributes']:_0x21ef20[_0xcd58('0x14')];if(!_0x4e9b76['query'][_0xcd58('0x2c')](_0xcd58('0x2d'))){_0x53ad6a[_0xcd58('0x9')]=qs[_0xcd58('0x9')](_0x4e9b76[_0xcd58('0x15')][_0xcd58('0x9')]);_0x53ad6a['offset']=qs['offset'](_0x4e9b76[_0xcd58('0x15')]['offset']);}_0x53ad6a['order']=qs[_0xcd58('0x2e')](_0x4e9b76[_0xcd58('0x15')][_0xcd58('0x2e')]);_0x53ad6a[_0xcd58('0x2f')]=qs[_0xcd58('0x17')](_[_0xcd58('0x30')](_0x4e9b76['query'],_0x21ef20['filters']),_0x2824a6);if(_0x4e9b76[_0xcd58('0x15')][_0xcd58('0x31')]){_0x53ad6a[_0xcd58('0x2f')]=_['merge'](_0x53ad6a[_0xcd58('0x2f')],{'$or':_[_0xcd58('0x11')](_0x2824a6,function(_0x6a7872){if(_0x6a7872['type']!=='VIRTUAL'){var _0x3e2e37={};_0x3e2e37[_0x6a7872[_0xcd58('0xf')]]={'$like':'%'+_0x4e9b76[_0xcd58('0x15')][_0xcd58('0x31')]+'%'};return _0x3e2e37;}})});}_0x53ad6a=_[_0xcd58('0x32')]({},_0x53ad6a,_0x4e9b76[_0xcd58('0x33')]);var _0x1fa80f={'where':_0x53ad6a[_0xcd58('0x2f')]};return db[_0xcd58('0x34')][_0xcd58('0xa')](_0x1fa80f)[_0xcd58('0xd')](function(_0x37e840){_0x39dc9c[_0xcd58('0xa')]=_0x37e840;if(_0x4e9b76[_0xcd58('0x15')][_0xcd58('0x35')]){_0x53ad6a[_0xcd58('0x36')]=[{'all':!![]}];}return db[_0xcd58('0x34')][_0xcd58('0x37')](_0x53ad6a);})[_0xcd58('0xd')](function(_0x48c097){_0x39dc9c[_0xcd58('0x38')]=_0x48c097;return _0x39dc9c;})['then'](respondWithFilteredResult(_0x3686ad,_0x53ad6a))[_0xcd58('0x39')](handleError(_0x3686ad,null));};exports[_0xcd58('0x3a')]=function(_0x464158,_0x5d774d){var _0x2e637c={'raw':!![],'where':{'id':_0x464158['params']['id']}},_0x41daa7={};_0x41daa7[_0xcd58('0x14')]=_['keys'](db['CmHopper'][_0xcd58('0x12')]);_0x41daa7['query']=_['keys'](_0x464158[_0xcd58('0x15')]);_0x41daa7[_0xcd58('0x17')]=_[_0xcd58('0x18')](_0x41daa7['model'],_0x41daa7['query']);_0x2e637c[_0xcd58('0x2a')]=_['intersection'](_0x41daa7[_0xcd58('0x14')],qs[_0xcd58('0x29')](_0x464158['query']['fields']));_0x2e637c[_0xcd58('0x2a')]=_0x2e637c[_0xcd58('0x2a')][_0xcd58('0x2b')]?_0x2e637c[_0xcd58('0x2a')]:_0x41daa7[_0xcd58('0x14')];if(_0x464158[_0xcd58('0x15')][_0xcd58('0x35')]){_0x2e637c[_0xcd58('0x36')]=[{'all':!![]}];}_0x2e637c=_[_0xcd58('0x32')]({},_0x2e637c,_0x464158[_0xcd58('0x33')]);return db[_0xcd58('0x34')][_0xcd58('0x3b')](_0x2e637c)[_0xcd58('0xd')](handleEntityNotFound(_0x5d774d,null))['then'](respondWithResult(_0x5d774d,null))[_0xcd58('0x39')](handleError(_0x5d774d,null));};exports[_0xcd58('0x3c')]=function(_0x415772,_0x4cb1b6){return db[_0xcd58('0x34')][_0xcd58('0x3c')](_0x415772[_0xcd58('0x3d')],{})[_0xcd58('0xd')](respondWithResult(_0x4cb1b6,0xc9))['catch'](handleError(_0x4cb1b6,null));};exports[_0xcd58('0xc')]=function(_0x26dd8f,_0x16be8c){if(_0x26dd8f[_0xcd58('0x3d')]['id']){delete _0x26dd8f[_0xcd58('0x3d')]['id'];}return db[_0xcd58('0x34')][_0xcd58('0x3b')]({'where':{'id':_0x26dd8f[_0xcd58('0x3e')]['id']}})[_0xcd58('0xd')](handleEntityNotFound(_0x16be8c,null))[_0xcd58('0xd')](saveUpdates(_0x26dd8f['body'],null))[_0xcd58('0xd')](respondWithResult(_0x16be8c,null))[_0xcd58('0x39')](handleError(_0x16be8c,null));};exports[_0xcd58('0x3f')]=function(_0x1ead66,_0x2bd4c9){return db[_0xcd58('0x34')][_0xcd58('0x3f')]()[_0xcd58('0xd')](respondWithResult(_0x2bd4c9,null))[_0xcd58('0x39')](handleError(_0x2bd4c9,null));};exports[_0xcd58('0x40')]=function(_0x1416fa,_0x1e39d8){var _0x5589bd;var _0xf01b8d=_0x1416fa[_0xcd58('0x3e')]['id'];return db['CmHopper'][_0xcd58('0x3b')]({'where':{'id':_0x1416fa[_0xcd58('0x3e')]['id']}})[_0xcd58('0xd')](handleEntityNotFound(_0x1e39d8,null))[_0xcd58('0xd')](function(_0x424cfb){if(_0x424cfb){return _0x424cfb[_0xcd58('0x40')]()['then'](function(_0x51735b){return _0x51735b;});}})[_0xcd58('0xd')](function(_0x50aebc){_0x5589bd=_0x50aebc;if(_0x50aebc){if(_0x50aebc[_0xcd58('0x41')]||_0x50aebc[_0xcd58('0x42')]){return db[_0x50aebc[_0xcd58('0x41')]?_0xcd58('0x43'):'Campaign']['find']({'where':{'id':_0x50aebc[_0xcd58('0x41')]?_0x50aebc['VoiceQueueId']:_0x50aebc['CampaignId']},'attributes':['id',_0xcd58('0xf')],'raw':!![]});}}})[_0xcd58('0xd')](function(_0x361422){var _0xc979ce={};if(_0x361422){_['merge'](_0xc979ce,_[_0xcd58('0x44')](_0x5589bd['dataValues'],['createdAt',_0xcd58('0x45'),'id']));_0xc979ce[_0xcd58('0x46')]=0x15;_0xc979ce['statedesc']=_0xcd58('0x47');_0xc979ce['campaign']=_0x361422[_0xcd58('0xf')];_0xc979ce[_0xcd58('0x48')]=_0x1416fa[_0xcd58('0x49')][_0xcd58('0xf')];_0xc979ce[_0xcd58('0x4a')]=_0x1416fa[_0xcd58('0x49')]['id'];_0xc979ce[_0xcd58('0x47')]=!![];_0xc979ce[_0xcd58('0x4b')]=moment()[_0xcd58('0x4c')](_0xcd58('0x4d'));_0xc979ce[_0xcd58('0x4e')]=_0x5589bd[_0xcd58('0x4f')];_0xc979ce['campaigntype']=_0x5589bd[_0xcd58('0x41')]?'queue':_0xcd58('0x50');return db[_0xcd58('0x51')][_0xcd58('0x3b')]({'where':{'id':_0xc979ce[_0xcd58('0x52')]},'attributes':['firstName',_0xcd58('0x53')]})[_0xcd58('0xd')](function(_0x458157){if(!_[_0xcd58('0x54')](_0x1e39d8)&&!_['isNil'](_0x458157['firstName'])){_0xc979ce[_0xcd58('0x55')]=_0x458157[_0xcd58('0x56')];if(!_[_0xcd58('0x54')](_0x458157[_0xcd58('0x53')])){_0xc979ce[_0xcd58('0x55')]+='\x20'+_0x458157[_0xcd58('0x53')];}}})[_0xcd58('0x57')](function(){return db['CmHopperFinal'][_0xcd58('0x3c')](_0xc979ce);});}})[_0xcd58('0xd')](function(_0x98d9b){return db[_0xcd58('0x58')][_0xcd58('0x40')]({'where':{'CmHopperId':_0xf01b8d}});})[_0xcd58('0xd')](function(){return _0x1e39d8[_0xcd58('0x5')](0xcc)[_0xcd58('0x59')]();})[_0xcd58('0x39')](handleError(_0x1e39d8,null));};exports[_0xcd58('0x5a')]=function(_0x11fdd4,_0x1ba71d){var _0x22579f=[];return db[_0xcd58('0x51')][_0xcd58('0x3f')]()[_0xcd58('0xd')](function(_0x11a622){_0x22579f=_['keys'](_0x11a622);return _0x11fdd4[_0xcd58('0x49')][_0xcd58('0x5b')]({'where':{'type':_0xcd58('0x5c'),'dialActive':!![],'dialMethod':_0xcd58('0x5d')},'attributes':['id','dialOrderByScheduledAt',_0xcd58('0x5e')],'raw':!![]});})[_0xcd58('0xd')](function(_0x2cee65){if(_0x2cee65&&_0x2cee65[_0xcd58('0x2b')]){return db[_0xcd58('0x5f')]['transaction'](function(_0xe8c2ea){var _0x343241={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xcd58('0x4c')](_0xcd58('0x4d'))},'VoiceQueueId':{'$in':_[_0xcd58('0x11')](_0x2cee65,'id')},'$or':[{'UserId':null},{'UserId':_0x11fdd4[_0xcd58('0x49')]['id']}]};var _0x1bc688={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2cee65)[_0xcd58('0x31')]([_0xcd58('0x5e'),0x0])[_0xcd58('0x11')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x11fdd4['user']['id']}]};var _0xb50cd5={'$or':[_0x343241,_0x1bc688]};var _0x39c9c8=[];if(_0x11fdd4[_0xcd58('0x3d')]['direction']&&_0x11fdd4[_0xcd58('0x3d')][_0xcd58('0x60')]==='prev'){if(!_[_0xcd58('0x61')](_0x11fdd4[_0xcd58('0x3d')][_0xcd58('0x62')])){_0xb50cd5['id']={'$in':_0x11fdd4[_0xcd58('0x3d')][_0xcd58('0x62')]};}_0x39c9c8=[[_0xcd58('0x63'),_0xcd58('0x64')],[_0xcd58('0x65'),_0x2cee65[0x0]['dialOrderByScheduledAt']==='ASC'?_0xcd58('0x66'):'ASC'],db[_0xcd58('0x5f')]['literal'](_0xcd58('0x67')),['id',_0xcd58('0x66')]];}else{if(!_[_0xcd58('0x61')](_0x11fdd4[_0xcd58('0x3d')]['hopperIds'])){_0xb50cd5['id']={'$notIn':_0x11fdd4[_0xcd58('0x3d')][_0xcd58('0x62')]};}_0x39c9c8=[['priority',_0xcd58('0x66')],[_0xcd58('0x65'),_0x2cee65[0x0][_0xcd58('0x68')]],db[_0xcd58('0x5f')]['literal'](_0xcd58('0x69')),['id',_0xcd58('0x64')]];}return db[_0xcd58('0x34')][_0xcd58('0x6a')]({'attributes':['id','scheduledat',_0xcd58('0x4f'),'recallme'],'where':_0xb50cd5,'order':_0x39c9c8,'transaction':_0xe8c2ea,'lock':_0xe8c2ea[_0xcd58('0x6b')][_0xcd58('0x6c')],'include':[{'model':db[_0xcd58('0x51')],'as':_0xcd58('0x6d'),'attributes':_0x22579f,'include':[{'model':db[_0xcd58('0x6e')],'as':'Company','attributes':['id',_0xcd58('0xf')]}]},{'model':db[_0xcd58('0x6f')],'as':'List','attributes':['id',_0xcd58('0xf')]},{'model':db['VoiceQueue'],'as':_0xcd58('0x70'),'attributes':['id',_0xcd58('0xf'),_0xcd58('0x71')]}]})[_0xcd58('0xd')](function(_0x3f4643){if(_0x3f4643){return _0x3f4643[_0xcd58('0xc')]({'UserId':_0x11fdd4[_0xcd58('0x49')]['id']},{'transaction':_0xe8c2ea});}});});}})['then'](handleEntityNotFound(_0x1ba71d,null))[_0xcd58('0xd')](respondWithResult(_0x1ba71d,null))[_0xcd58('0x39')](handleError(_0x1ba71d,null));};exports[_0xcd58('0x72')]=function(_0xf0ae68,_0x374f9a,_0x4047dd){var _0xf5e38d=[];var _0xf9fcac=_0xf0ae68[_0xcd58('0x3e')]['id'];var _0x312a35=_0xf0ae68[_0xcd58('0x49')]['id'];return db[_0xcd58('0x51')]['describe']()['then'](function(_0xc6e97a){_0xf5e38d=_[_0xcd58('0x16')](_0xc6e97a);return db[_0xcd58('0x5f')][_0xcd58('0x73')](function(_0x202d96){const _0x46dfaa={'id':_0xf9fcac};return db[_0xcd58('0x34')]['findOne']({'attributes':['id',_0xcd58('0x74'),_0xcd58('0x75')],'where':_0x46dfaa,'transaction':_0x202d96,'lock':_0x202d96['LOCK'][_0xcd58('0x6c')],'include':[{'model':db[_0xcd58('0x51')],'as':_0xcd58('0x6d'),'attributes':_0xf5e38d,'include':[{'model':db[_0xcd58('0x6e')],'as':_0xcd58('0x76'),'attributes':['id',_0xcd58('0xf')]}]},{'model':db[_0xcd58('0x6f')],'as':_0xcd58('0x77'),'attributes':['id',_0xcd58('0xf')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0xcd58('0xf'),'dialActive']}]})['then'](function(_0x353d9e){if(_0x353d9e){return _0x353d9e['update']({'UserId':_0x312a35},{'transaction':_0x202d96});}});});})[_0xcd58('0xd')](handleEntityNotFound(_0x374f9a,null))[_0xcd58('0xd')](respondWithResult(_0x374f9a,null))[_0xcd58('0x39')](handleError(_0x374f9a,null));};exports[_0xcd58('0x78')]=function(_0x400844,_0x573ed5){return _0x400844['user']['getVoiceQueues']({'where':{'type':_0xcd58('0x5c'),'dialActive':!![],'dialMethod':_0xcd58('0x5d')},'attributes':['id'],'raw':!![]})['then'](function(_0x381ee4){if(_0x381ee4&&_0x381ee4[_0xcd58('0x2b')]){return db[_0xcd58('0x34')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xcd58('0x4d'))},'VoiceQueueId':{'$in':_[_0xcd58('0x11')](_0x381ee4,'id')},'$or':[{'UserId':null},{'UserId':_0x400844[_0xcd58('0x49')]['id']}]}});}return 0x0;})[_0xcd58('0xd')](function(_0x5f3799){if(!_[_0xcd58('0x54')](_0x5f3799)&&_[_0xcd58('0x79')](_0x5f3799)){return _0x573ed5[_0xcd58('0x5')](0xc8)[_0xcd58('0x6')]({'contacts':_0x5f3799});}else{logger['error']('CmHopper,\x20%s,\x20%s,\x20%s',_0xcd58('0x78'),0x194,_0xcd58('0x7a'));_0x573ed5[_0xcd58('0x7b')](0x194);}})['catch'](handleError(_0x573ed5,null));};exports[_0xcd58('0x7c')]=function(_0x57cde7,_0x26e93b){var _0x2e92d1=shared[_0xcd58('0x7d')];var _0x10a5cc=[];_[_0xcd58('0x11')](_0x2e92d1,function(_0x155aa7){_0x10a5cc[_0xcd58('0x7e')]({'id':_0x155aa7[_0xcd58('0xf')],'name':_0x155aa7['name'],'utcOffset':_0x155aa7[_0xcd58('0x7f')]});});return _0x26e93b[_0xcd58('0x5')](0xc8)[_0xcd58('0x6')]({'tz':_0x10a5cc});};exports[_0xcd58('0x80')]=function(_0x2c298c,_0x20ee56){var _0x5e21a2=shared[_0xcd58('0x7d')];var _0x257c4e={};if(!_[_0xcd58('0x54')](_0x5e21a2[_0x2c298c[_0xcd58('0x3d')]['id']]))_0x257c4e=_0x5e21a2[_0x2c298c[_0xcd58('0x3d')]['id']];return _0x20ee56[_0xcd58('0x5')](0xc8)[_0xcd58('0x6')](_0x257c4e);}; \ No newline at end of file +var _0xa1f6=['Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getPreviewRecall','findOne','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','push','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','json','offset','undefined','count','limit','set','update','then','sendStatus','error','stack','name','status','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','$and','$lte','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','CmHopper','find','create','body','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','format','calleridnum','phone','campaigntype','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','literal','isEmpty','dialOrderByScheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','LOCK','UPDATE'];(function(_0x320d18,_0x7a06d9){var _0x18166f=function(_0x15c016){while(--_0x15c016){_0x320d18['push'](_0x320d18['shift']());}};_0x18166f(++_0x7a06d9);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0xa1f6[_0x52ea08];return _0x28d546;};'use strict';var moment=require(_0x6a1f('0x0'));var _=require(_0x6a1f('0x1'));var qs=require(_0x6a1f('0x2'));var logger=require(_0x6a1f('0x3'))(_0x6a1f('0x4'));var shared=require(_0x6a1f('0x5'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x52b77b,_0x521944){_0x521944=_0x521944||0xc8;return function(_0x5d4ad7){if(_0x5d4ad7){return _0x52b77b['status'](_0x521944)[_0x6a1f('0x6')](_0x5d4ad7);}};}function respondWithFilteredResult(_0x426ae1,_0xa1c928){return function(_0x3a772b){if(_0x3a772b){var _0x328033=typeof _0xa1c928[_0x6a1f('0x7')]===_0x6a1f('0x8')&&typeof _0xa1c928['limit']===_0x6a1f('0x8');var _0x2950ff=_0x3a772b[_0x6a1f('0x9')];var _0x287e54=_0x328033?0x0:_0xa1c928[_0x6a1f('0x7')];var _0x5aafd2=_0x328033?_0x3a772b[_0x6a1f('0x9')]:_0xa1c928[_0x6a1f('0x7')]+_0xa1c928[_0x6a1f('0xa')];var _0x3151f9;if(_0x5aafd2>=_0x2950ff){_0x5aafd2=_0x2950ff;_0x3151f9=0xc8;}else{_0x3151f9=0xce;}_0x426ae1['status'](_0x3151f9);return _0x426ae1[_0x6a1f('0xb')]('Content-Range',_0x287e54+'-'+_0x5aafd2+'/'+_0x2950ff)[_0x6a1f('0x6')](_0x3a772b);}return null;};}function saveUpdates(_0x17edb6,_0x2a4e94){return function(_0x442576){if(_0x442576){return _0x442576[_0x6a1f('0xc')](_0x17edb6)[_0x6a1f('0xd')](function(_0x3b3adb){return _0x3b3adb;});}return null;};}function handleEntityNotFound(_0x8c3a36,_0x1918c6){return function(_0x27d8f8){if(!_0x27d8f8){_0x8c3a36[_0x6a1f('0xe')](0x194);}return _0x27d8f8;};}function handleError(_0x1c8b26,_0x253305){_0x253305=_0x253305||0x1f4;return function(_0x2677c1){logger[_0x6a1f('0xf')](_0x2677c1[_0x6a1f('0x10')]);if(_0x2677c1[_0x6a1f('0x11')]){delete _0x2677c1[_0x6a1f('0x11')];}_0x1c8b26[_0x6a1f('0x12')](_0x253305)['send'](_0x2677c1);};}exports[_0x6a1f('0x13')]=function(_0x45e6f0,_0x1ccbed){var _0x9ff231={},_0x21d268={},_0x42b4c7={'count':0x0,'rows':[]};var _0x19562a=_[_0x6a1f('0x14')](db['CmHopper'][_0x6a1f('0x15')],function(_0x5100f2){return{'name':_0x5100f2[_0x6a1f('0x16')],'type':_0x5100f2[_0x6a1f('0x17')][_0x6a1f('0x18')]};});_0x21d268[_0x6a1f('0x19')]=_[_0x6a1f('0x14')](_0x19562a,'name');_0x21d268[_0x6a1f('0x1a')]=_[_0x6a1f('0x1b')](_0x45e6f0[_0x6a1f('0x1a')]);_0x21d268[_0x6a1f('0x1c')]=_[_0x6a1f('0x1d')](_0x21d268[_0x6a1f('0x19')],_0x21d268[_0x6a1f('0x1a')]);_0x21d268[_0x6a1f('0x1c')]=_['concat'](_0x21d268[_0x6a1f('0x1c')],[_0x6a1f('0x1e'),'$or','$gt','$gte','$lt',_0x6a1f('0x1f'),'$ne','$eq',_0x6a1f('0x20'),_0x6a1f('0x21'),_0x6a1f('0x22'),_0x6a1f('0x23'),_0x6a1f('0x24'),_0x6a1f('0x25'),_0x6a1f('0x26'),_0x6a1f('0x27'),'$notILike',_0x6a1f('0x25'),_0x6a1f('0x28'),_0x6a1f('0x29'),'$contained',_0x6a1f('0x2a')]);_0x9ff231[_0x6a1f('0x2b')]=_[_0x6a1f('0x1d')](_0x21d268[_0x6a1f('0x19')],qs[_0x6a1f('0x2c')](_0x45e6f0[_0x6a1f('0x1a')][_0x6a1f('0x2c')]));_0x9ff231['attributes']=_0x9ff231['attributes'][_0x6a1f('0x2d')]?_0x9ff231[_0x6a1f('0x2b')]:_0x21d268[_0x6a1f('0x19')];if(!_0x45e6f0[_0x6a1f('0x1a')][_0x6a1f('0x2e')](_0x6a1f('0x2f'))){_0x9ff231[_0x6a1f('0xa')]=qs['limit'](_0x45e6f0[_0x6a1f('0x1a')][_0x6a1f('0xa')]);_0x9ff231['offset']=qs[_0x6a1f('0x7')](_0x45e6f0[_0x6a1f('0x1a')][_0x6a1f('0x7')]);}_0x9ff231['order']=qs['sort'](_0x45e6f0[_0x6a1f('0x1a')][_0x6a1f('0x30')]);_0x9ff231[_0x6a1f('0x31')]=qs['filters'](_['pick'](_0x45e6f0[_0x6a1f('0x1a')],_0x21d268[_0x6a1f('0x1c')]),_0x19562a);if(_0x45e6f0[_0x6a1f('0x1a')][_0x6a1f('0x32')]){_0x9ff231[_0x6a1f('0x31')]=_[_0x6a1f('0x33')](_0x9ff231[_0x6a1f('0x31')],{'$or':_['map'](_0x19562a,function(_0xebc872){if(_0xebc872['type']!==_0x6a1f('0x34')){var _0x13057b={};_0x13057b[_0xebc872['name']]={'$like':'%'+_0x45e6f0[_0x6a1f('0x1a')][_0x6a1f('0x32')]+'%'};return _0x13057b;}})});}_0x9ff231=_['merge']({},_0x9ff231,_0x45e6f0[_0x6a1f('0x35')]);var _0x48c033={'where':_0x9ff231[_0x6a1f('0x31')]};return db['CmHopper'][_0x6a1f('0x9')](_0x48c033)['then'](function(_0x248305){_0x42b4c7[_0x6a1f('0x9')]=_0x248305;if(_0x45e6f0['query'][_0x6a1f('0x36')]){_0x9ff231[_0x6a1f('0x37')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x9ff231);})[_0x6a1f('0xd')](function(_0x4019e9){_0x42b4c7[_0x6a1f('0x38')]=_0x4019e9;return _0x42b4c7;})[_0x6a1f('0xd')](respondWithFilteredResult(_0x1ccbed,_0x9ff231))[_0x6a1f('0x39')](handleError(_0x1ccbed,null));};exports[_0x6a1f('0x3a')]=function(_0x4aa2b1,_0x31b672){var _0x2da23a={'raw':!![],'where':{'id':_0x4aa2b1[_0x6a1f('0x3b')]['id']}},_0x3169ef={};_0x3169ef[_0x6a1f('0x19')]=_[_0x6a1f('0x1b')](db[_0x6a1f('0x3c')][_0x6a1f('0x15')]);_0x3169ef[_0x6a1f('0x1a')]=_[_0x6a1f('0x1b')](_0x4aa2b1[_0x6a1f('0x1a')]);_0x3169ef['filters']=_[_0x6a1f('0x1d')](_0x3169ef[_0x6a1f('0x19')],_0x3169ef[_0x6a1f('0x1a')]);_0x2da23a[_0x6a1f('0x2b')]=_[_0x6a1f('0x1d')](_0x3169ef[_0x6a1f('0x19')],qs['fields'](_0x4aa2b1[_0x6a1f('0x1a')]['fields']));_0x2da23a[_0x6a1f('0x2b')]=_0x2da23a[_0x6a1f('0x2b')][_0x6a1f('0x2d')]?_0x2da23a[_0x6a1f('0x2b')]:_0x3169ef[_0x6a1f('0x19')];if(_0x4aa2b1[_0x6a1f('0x1a')]['includeAll']){_0x2da23a[_0x6a1f('0x37')]=[{'all':!![]}];}_0x2da23a=_[_0x6a1f('0x33')]({},_0x2da23a,_0x4aa2b1[_0x6a1f('0x35')]);return db[_0x6a1f('0x3c')][_0x6a1f('0x3d')](_0x2da23a)[_0x6a1f('0xd')](handleEntityNotFound(_0x31b672,null))[_0x6a1f('0xd')](respondWithResult(_0x31b672,null))[_0x6a1f('0x39')](handleError(_0x31b672,null));};exports[_0x6a1f('0x3e')]=function(_0x292844,_0x58786d){return db['CmHopper']['create'](_0x292844[_0x6a1f('0x3f')],{})[_0x6a1f('0xd')](respondWithResult(_0x58786d,0xc9))[_0x6a1f('0x39')](handleError(_0x58786d,null));};exports[_0x6a1f('0xc')]=function(_0x143aaa,_0xcc7a21){if(_0x143aaa['body']['id']){delete _0x143aaa[_0x6a1f('0x3f')]['id'];}return db['CmHopper'][_0x6a1f('0x3d')]({'where':{'id':_0x143aaa[_0x6a1f('0x3b')]['id']}})['then'](handleEntityNotFound(_0xcc7a21,null))[_0x6a1f('0xd')](saveUpdates(_0x143aaa['body'],null))[_0x6a1f('0xd')](respondWithResult(_0xcc7a21,null))[_0x6a1f('0x39')](handleError(_0xcc7a21,null));};exports[_0x6a1f('0x40')]=function(_0x4318fd,_0x10c713){return db[_0x6a1f('0x3c')]['describe']()[_0x6a1f('0xd')](respondWithResult(_0x10c713,null))[_0x6a1f('0x39')](handleError(_0x10c713,null));};exports[_0x6a1f('0x41')]=function(_0x2bea1a,_0x34fa17){var _0x2bbd38;var _0x4657ec=_0x2bea1a[_0x6a1f('0x3b')]['id'];return db['CmHopper'][_0x6a1f('0x3d')]({'where':{'id':_0x2bea1a[_0x6a1f('0x3b')]['id']}})[_0x6a1f('0xd')](handleEntityNotFound(_0x34fa17,null))['then'](function(_0x140421){if(_0x140421){return _0x140421['destroy']()[_0x6a1f('0xd')](function(_0x52c262){return _0x52c262;});}})[_0x6a1f('0xd')](function(_0x4b2c30){_0x2bbd38=_0x4b2c30;if(_0x4b2c30){if(_0x4b2c30[_0x6a1f('0x42')]||_0x4b2c30[_0x6a1f('0x43')]){return db[_0x4b2c30[_0x6a1f('0x42')]?'VoiceQueue':_0x6a1f('0x44')]['find']({'where':{'id':_0x4b2c30[_0x6a1f('0x42')]?_0x4b2c30['VoiceQueueId']:_0x4b2c30['CampaignId']},'attributes':['id',_0x6a1f('0x11')],'raw':!![]});}}})[_0x6a1f('0xd')](function(_0x4d9667){var _0xcbe5f6={};if(_0x4d9667){_[_0x6a1f('0x33')](_0xcbe5f6,_[_0x6a1f('0x45')](_0x2bbd38['dataValues'],[_0x6a1f('0x46'),_0x6a1f('0x47'),'id']));_0xcbe5f6[_0x6a1f('0x48')]=0x15;_0xcbe5f6[_0x6a1f('0x49')]=_0x6a1f('0x4a');_0xcbe5f6[_0x6a1f('0x4b')]=_0x4d9667['name'];_0xcbe5f6[_0x6a1f('0x4c')]=_0x2bea1a[_0x6a1f('0x4d')][_0x6a1f('0x11')];_0xcbe5f6[_0x6a1f('0x4e')]=_0x2bea1a[_0x6a1f('0x4d')]['id'];_0xcbe5f6['deleted']=!![];_0xcbe5f6['deletedat']=moment()[_0x6a1f('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0xcbe5f6[_0x6a1f('0x50')]=_0x2bbd38[_0x6a1f('0x51')];_0xcbe5f6[_0x6a1f('0x52')]=_0x2bbd38[_0x6a1f('0x42')]?_0x6a1f('0x53'):'ivr';return db[_0x6a1f('0x54')]['find']({'where':{'id':_0xcbe5f6[_0x6a1f('0x55')]},'attributes':[_0x6a1f('0x56'),_0x6a1f('0x57')]})[_0x6a1f('0xd')](function(_0xdba6af){if(!_[_0x6a1f('0x58')](_0x34fa17)&&!_['isNil'](_0xdba6af[_0x6a1f('0x56')])){_0xcbe5f6['calleridname']=_0xdba6af['firstName'];if(!_['isNil'](_0xdba6af[_0x6a1f('0x57')])){_0xcbe5f6[_0x6a1f('0x59')]+='\x20'+_0xdba6af['lastName'];}}})[_0x6a1f('0x5a')](function(){return db[_0x6a1f('0x5b')][_0x6a1f('0x3e')](_0xcbe5f6);});}})['then'](function(_0x2c2bf7){return db['CmHopperAdditionalPhone'][_0x6a1f('0x41')]({'where':{'CmHopperId':_0x4657ec}});})[_0x6a1f('0xd')](function(){return _0x34fa17[_0x6a1f('0x12')](0xcc)['end']();})[_0x6a1f('0x39')](handleError(_0x34fa17,null));};exports[_0x6a1f('0x5c')]=function(_0x3e66af,_0x11ab69){var _0x1a313e=[];return db[_0x6a1f('0x54')][_0x6a1f('0x40')]()[_0x6a1f('0xd')](function(_0x1adf00){_0x1a313e=_[_0x6a1f('0x1b')](_0x1adf00);return _0x3e66af[_0x6a1f('0x4d')][_0x6a1f('0x5d')]({'where':{'type':_0x6a1f('0x5e'),'dialActive':!![],'dialMethod':_0x6a1f('0x5f')},'attributes':['id','dialOrderByScheduledAt',_0x6a1f('0x60')],'raw':!![]});})[_0x6a1f('0xd')](function(_0x4b2211){if(_0x4b2211&&_0x4b2211[_0x6a1f('0x2d')]){return db[_0x6a1f('0x61')][_0x6a1f('0x62')](function(_0x1b9a07){var _0x4322a4={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6a1f('0x4f')](_0x6a1f('0x63'))},'VoiceQueueId':{'$in':_[_0x6a1f('0x14')](_0x4b2211,'id')},'$or':[{'UserId':null},{'UserId':_0x3e66af[_0x6a1f('0x4d')]['id']}]};var _0x547684={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4b2211)[_0x6a1f('0x32')]([_0x6a1f('0x60'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x3e66af[_0x6a1f('0x4d')]['id']}]};var _0x416e40={'$or':[_0x4322a4,_0x547684]};var _0x9b83af=[];if(_0x3e66af[_0x6a1f('0x3f')][_0x6a1f('0x64')]&&_0x3e66af[_0x6a1f('0x3f')][_0x6a1f('0x64')]===_0x6a1f('0x65')){if(!_['isEmpty'](_0x3e66af[_0x6a1f('0x3f')][_0x6a1f('0x66')])){_0x416e40['id']={'$in':_0x3e66af['body'][_0x6a1f('0x66')]};}_0x9b83af=[[_0x6a1f('0x67'),_0x6a1f('0x68')],[_0x6a1f('0x69'),_0x4b2211[0x0]['dialOrderByScheduledAt']===_0x6a1f('0x68')?_0x6a1f('0x6a'):'ASC'],db[_0x6a1f('0x61')][_0x6a1f('0x6b')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x6a1f('0x6c')](_0x3e66af[_0x6a1f('0x3f')][_0x6a1f('0x66')])){_0x416e40['id']={'$notIn':_0x3e66af[_0x6a1f('0x3f')][_0x6a1f('0x66')]};}_0x9b83af=[[_0x6a1f('0x67'),_0x6a1f('0x6a')],['scheduledAt',_0x4b2211[0x0][_0x6a1f('0x6d')]],db[_0x6a1f('0x61')][_0x6a1f('0x6b')](_0x6a1f('0x6e')),['id',_0x6a1f('0x68')]];}return db[_0x6a1f('0x3c')]['findOne']({'attributes':['id',_0x6a1f('0x6f'),_0x6a1f('0x51'),_0x6a1f('0x70')],'where':_0x416e40,'order':_0x9b83af,'transaction':_0x1b9a07,'lock':_0x1b9a07[_0x6a1f('0x71')][_0x6a1f('0x72')],'include':[{'model':db[_0x6a1f('0x54')],'as':_0x6a1f('0x73'),'attributes':_0x1a313e,'include':[{'model':db[_0x6a1f('0x74')],'as':_0x6a1f('0x75'),'attributes':['id',_0x6a1f('0x11')]}]},{'model':db[_0x6a1f('0x76')],'as':_0x6a1f('0x77'),'attributes':['id','name']},{'model':db[_0x6a1f('0x78')],'as':_0x6a1f('0x79'),'attributes':['id',_0x6a1f('0x11'),_0x6a1f('0x7a')]}]})[_0x6a1f('0xd')](function(_0x3af935){if(_0x3af935){return _0x3af935[_0x6a1f('0xc')]({'UserId':_0x3e66af[_0x6a1f('0x4d')]['id']},{'transaction':_0x1b9a07});}});});}})[_0x6a1f('0xd')](handleEntityNotFound(_0x11ab69,null))[_0x6a1f('0xd')](respondWithResult(_0x11ab69,null))[_0x6a1f('0x39')](handleError(_0x11ab69,null));};exports[_0x6a1f('0x7b')]=function(_0x280f9a,_0x2ef531,_0x514e06){var _0x2b661a=[];var _0x5759ee=_0x280f9a['params']['id'];var _0x90aff7=_0x280f9a['user']['id'];return db['CmContact']['describe']()['then'](function(_0xa50b90){_0x2b661a=_[_0x6a1f('0x1b')](_0xa50b90);return db[_0x6a1f('0x61')][_0x6a1f('0x62')](function(_0x311e61){const _0xdef032={'id':_0x5759ee};return db[_0x6a1f('0x3c')][_0x6a1f('0x7c')]({'attributes':['id',_0x6a1f('0x6f'),_0x6a1f('0x70')],'where':_0xdef032,'transaction':_0x311e61,'lock':_0x311e61[_0x6a1f('0x71')][_0x6a1f('0x72')],'include':[{'model':db['CmContact'],'as':_0x6a1f('0x73'),'attributes':_0x2b661a,'include':[{'model':db['CmCompany'],'as':_0x6a1f('0x75'),'attributes':['id','name']}]},{'model':db[_0x6a1f('0x76')],'as':_0x6a1f('0x77'),'attributes':['id','name']},{'model':db[_0x6a1f('0x78')],'as':_0x6a1f('0x79'),'attributes':['id','name','dialActive']}]})[_0x6a1f('0xd')](function(_0x170005){if(_0x170005){return _0x170005[_0x6a1f('0xc')]({'UserId':_0x90aff7},{'transaction':_0x311e61});}});});})[_0x6a1f('0xd')](handleEntityNotFound(_0x2ef531,null))[_0x6a1f('0xd')](respondWithResult(_0x2ef531,null))[_0x6a1f('0x39')](handleError(_0x2ef531,null));};exports['getOpenContacts']=function(_0x555acd,_0x4e6815){return _0x555acd['user']['getVoiceQueues']({'where':{'type':_0x6a1f('0x5e'),'dialActive':!![],'dialMethod':_0x6a1f('0x5f')},'attributes':['id'],'raw':!![]})[_0x6a1f('0xd')](function(_0x266d36){if(_0x266d36&&_0x266d36[_0x6a1f('0x2d')]){return db[_0x6a1f('0x3c')][_0x6a1f('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6a1f('0x4f')](_0x6a1f('0x63'))},'VoiceQueueId':{'$in':_[_0x6a1f('0x14')](_0x266d36,'id')},'$or':[{'UserId':null},{'UserId':_0x555acd['user']['id']}]}});}return 0x0;})['then'](function(_0x1275f7){if(!_[_0x6a1f('0x58')](_0x1275f7)&&_['isNumber'](_0x1275f7)){return _0x4e6815[_0x6a1f('0x12')](0xc8)['json']({'contacts':_0x1275f7});}else{logger['error'](_0x6a1f('0x7d'),_0x6a1f('0x7e'),0x194,_0x6a1f('0x7f'));_0x4e6815[_0x6a1f('0xe')](0x194);}})[_0x6a1f('0x39')](handleError(_0x4e6815,null));};exports[_0x6a1f('0x80')]=function(_0x3e0978,_0x19a821){var _0x52ae3f=shared['timezones'];var _0x969c9d=[];_[_0x6a1f('0x14')](_0x52ae3f,function(_0x482b93){_0x969c9d[_0x6a1f('0x81')]({'id':_0x482b93[_0x6a1f('0x11')],'name':_0x482b93['name'],'utcOffset':_0x482b93[_0x6a1f('0x82')]});});return _0x19a821[_0x6a1f('0x12')](0xc8)[_0x6a1f('0x6')]({'tz':_0x969c9d});};exports[_0x6a1f('0x83')]=function(_0xd2fe96,_0x23c662){var _0x5e088c=shared['timezones'];var _0x2f09e6={};if(!_[_0x6a1f('0x58')](_0x5e088c[_0xd2fe96[_0x6a1f('0x3f')]['id']]))_0x2f09e6=_0x5e088c[_0xd2fe96[_0x6a1f('0x3f')]['id']];return _0x23c662[_0x6a1f('0x12')](0xc8)['json'](_0x2f09e6);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 013cba3..9844328 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 _0xbd51=['./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5e3a45,_0x45f0c5){var _0x13419f=function(_0x5ac996){while(--_0x5ac996){_0x5e3a45['push'](_0x5e3a45['shift']());}};_0x13419f(++_0x45f0c5);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x2d6297,_0x1d3f94){_0x2d6297=_0x2d6297-0x0;var _0x1ee549=_0xbd51[_0x2d6297];return _0x1ee549;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('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(_0x1bd5('0x5'));module[_0x1bd5('0x6')]=function(_0x43e6b6,_0x59ddfb){return _0x43e6b6[_0x1bd5('0x7')](_0x1bd5('0x8'),attributes,{'tableName':_0x1bd5('0x9'),'paranoid':![],'indexes':[{'name':_0x1bd5('0xa'),'fields':[_0x1bd5('0xa')]},{'name':'phone','fields':[_0x1bd5('0xb')]},{'name':'priority','fields':[_0x1bd5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['define','CmHopper','cm_hopper','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./cmHopper.attributes','exports'];(function(_0x5841c2,_0x950a5a){var _0xbdf541=function(_0x2ba293){while(--_0x2ba293){_0x5841c2['push'](_0x5841c2['shift']());}};_0xbdf541(++_0x950a5a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xc4aa[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':['scheduledat']},{'name':_0xac4a('0xc'),'fields':[_0xac4a('0xc')]},{'name':_0xac4a('0xd'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 7a88edd..afb60c1 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 _0x3aee=['info','debug','stringify','catch','error','message','ShowCmHopper','find','where','model','CreateCmHopper','body','UpdateCmHopper','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','CmContact','sequelize','transaction','order','Contact','User','Agent','voicePause','length','UserId','update','includes','push','GetContactDialer','dataValues','MoveContactManagedDialer','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','describe','LOCK','UPDATE','keys','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','literal','NOW()','name','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','attributes','include','map','then'];(function(_0x3ed666,_0x3345f9){var _0x1587f5=function(_0x304fd0){while(--_0x304fd0){_0x3ed666['push'](_0x3ed666['shift']());}};_0x1587f5(++_0x3345f9);}(_0x3aee,0x131));var _0xe3ae=function(_0x323d87,_0x4ef3f9){_0x323d87=_0x323d87-0x0;var _0x5e8f74=_0x3aee[_0x323d87];return _0x5e8f74;};'use strict';var _=require(_0xe3ae('0x0'));var util=require(_0xe3ae('0x1'));var moment=require('moment');var BPromise=require(_0xe3ae('0x2'));var db=require(_0xe3ae('0x3'))['db'];var logger=require(_0xe3ae('0x4'))(_0xe3ae('0x5'));exports[_0xe3ae('0x6')]=function(_0xec17e5){var _0x5f256e=this;return new Promise(function(_0x5b9740,_0x349253){return db[_0xe3ae('0x7')][_0xe3ae('0x8')]({'raw':_0xec17e5[_0xe3ae('0x9')]?_0xec17e5[_0xe3ae('0x9')][_0xe3ae('0xa')]===undefined?!![]:![]:!![],'where':_0xec17e5['options']?_0xec17e5[_0xe3ae('0x9')]['where']||null:null,'attributes':_0xec17e5[_0xe3ae('0x9')]?_0xec17e5[_0xe3ae('0x9')][_0xe3ae('0xb')]||null:null,'limit':_0xec17e5['options']?_0xec17e5['options']['limit']||null:null,'include':_0xec17e5[_0xe3ae('0x9')]?_0xec17e5[_0xe3ae('0x9')][_0xe3ae('0xc')]?_[_0xe3ae('0xd')](_0xec17e5[_0xe3ae('0x9')][_0xe3ae('0xc')],function(_0x49f525){return{'model':db[_0x49f525['model']],'as':_0x49f525['as'],'attributes':_0x49f525[_0xe3ae('0xb')],'include':_0x49f525[_0xe3ae('0xc')]?_['map'](_0x49f525['include'],function(_0x2a3ea8){return{'model':db[_0x2a3ea8['model']],'as':_0x2a3ea8['as'],'attributes':_0x2a3ea8[_0xe3ae('0xb')],'include':_0x2a3ea8[_0xe3ae('0xc')]?_[_0xe3ae('0xd')](_0x2a3ea8[_0xe3ae('0xc')],function(_0x1eb66c){return{'model':db[_0x1eb66c['model']],'as':_0x1eb66c['as'],'attributes':_0x1eb66c[_0xe3ae('0xb')]};}):[]};}):[]};}):[]:[]})[_0xe3ae('0xe')](function(_0x4e505a){logger[_0xe3ae('0xf')](_0xe3ae('0x6'),_0xec17e5);logger[_0xe3ae('0x10')]('GetCmHopper',_0xec17e5,JSON[_0xe3ae('0x11')](_0x4e505a));_0x5b9740(_0x4e505a);})[_0xe3ae('0x12')](function(_0x5b6872){logger[_0xe3ae('0x13')]('GetCmHopper',_0x5b6872[_0xe3ae('0x14')],_0xec17e5);_0x349253(_0x5f256e[_0xe3ae('0x13')](0x1f4,_0x5b6872[_0xe3ae('0x14')]));});});};exports[_0xe3ae('0x15')]=function(_0x2272c0){var _0x280266=this;return new Promise(function(_0x5dba66,_0x48743e){return db[_0xe3ae('0x7')][_0xe3ae('0x16')]({'raw':_0x2272c0[_0xe3ae('0x9')]?_0x2272c0['options'][_0xe3ae('0xa')]===undefined?!![]:![]:!![],'where':_0x2272c0[_0xe3ae('0x9')]?_0x2272c0[_0xe3ae('0x9')][_0xe3ae('0x17')]||null:null,'attributes':_0x2272c0[_0xe3ae('0x9')]?_0x2272c0[_0xe3ae('0x9')][_0xe3ae('0xb')]||null:null,'include':_0x2272c0[_0xe3ae('0x9')]?_0x2272c0[_0xe3ae('0x9')][_0xe3ae('0xc')]?_['map'](_0x2272c0[_0xe3ae('0x9')][_0xe3ae('0xc')],function(_0x38c6b1){return{'model':db[_0x38c6b1['model']],'as':_0x38c6b1['as'],'attributes':_0x38c6b1[_0xe3ae('0xb')],'include':_0x38c6b1[_0xe3ae('0xc')]?_[_0xe3ae('0xd')](_0x38c6b1[_0xe3ae('0xc')],function(_0x4b03fa){return{'model':db[_0x4b03fa[_0xe3ae('0x18')]],'as':_0x4b03fa['as'],'attributes':_0x4b03fa[_0xe3ae('0xb')],'include':_0x4b03fa[_0xe3ae('0xc')]?_[_0xe3ae('0xd')](_0x4b03fa['include'],function(_0x4c0a5c){return{'model':db[_0x4c0a5c[_0xe3ae('0x18')]],'as':_0x4c0a5c['as'],'attributes':_0x4c0a5c[_0xe3ae('0xb')]};}):[]};}):[]};}):[]:[]})[_0xe3ae('0xe')](function(_0x540bd5){logger[_0xe3ae('0xf')]('ShowCmHopper',_0x2272c0);logger[_0xe3ae('0x10')]('ShowCmHopper',_0x2272c0,JSON[_0xe3ae('0x11')](_0x540bd5));_0x5dba66(_0x540bd5);})[_0xe3ae('0x12')](function(_0x243921){logger[_0xe3ae('0x13')](_0xe3ae('0x15'),_0x243921[_0xe3ae('0x14')],_0x2272c0);_0x48743e(_0x280266[_0xe3ae('0x13')](0x1f4,_0x243921[_0xe3ae('0x14')]));});});};exports[_0xe3ae('0x19')]=function(_0x14d09d){var _0x39341e=this;return new Promise(function(_0x2f1321,_0x2e2147){return db[_0xe3ae('0x7')]['create'](_0x14d09d[_0xe3ae('0x1a')],{'raw':_0x14d09d[_0xe3ae('0x9')]?_0x14d09d[_0xe3ae('0x9')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1aa01b){logger['info'](_0xe3ae('0x19'),_0x14d09d);logger[_0xe3ae('0x10')](_0xe3ae('0x19'),_0x14d09d,JSON['stringify'](_0x1aa01b));_0x2f1321(_0x1aa01b);})[_0xe3ae('0x12')](function(_0x219da7){logger[_0xe3ae('0x13')](_0xe3ae('0x19'),_0x219da7[_0xe3ae('0x14')],_0x14d09d);_0x2e2147(_0x39341e[_0xe3ae('0x13')](0x1f4,_0x219da7['message']));});});};exports[_0xe3ae('0x1b')]=function(_0xac2b09){var _0x1dc87b=this;return new Promise(function(_0x38ddef,_0x37a841){return db['CmHopper']['update'](_0xac2b09[_0xe3ae('0x1a')],{'raw':_0xac2b09[_0xe3ae('0x9')]?_0xac2b09[_0xe3ae('0x9')][_0xe3ae('0xa')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xac2b09[_0xe3ae('0x9')]?_0xac2b09[_0xe3ae('0x9')][_0xe3ae('0x17')]||null:null,'attributes':_0xac2b09[_0xe3ae('0x9')]?_0xac2b09[_0xe3ae('0x9')]['attributes']||null:null,'limit':_0xac2b09[_0xe3ae('0x9')]?_0xac2b09['options'][_0xe3ae('0x1c')]||null:null})[_0xe3ae('0xe')](function(_0x910eb){logger[_0xe3ae('0xf')](_0xe3ae('0x1b'),_0xac2b09);logger[_0xe3ae('0xf')](_0xe3ae('0x1d'),JSON['stringify'](_0xac2b09[_0xe3ae('0x9')][_0xe3ae('0x17')]),_0xac2b09[_0xe3ae('0x1a')][_0xe3ae('0x1e')]);logger[_0xe3ae('0x10')](_0xe3ae('0x1b'),_0xac2b09,JSON[_0xe3ae('0x11')](_0x910eb));_0x38ddef(_0x910eb);})[_0xe3ae('0x12')](function(_0x2ddc29){logger[_0xe3ae('0x13')]('UpdateCmHopper',_0x2ddc29[_0xe3ae('0x14')],_0xac2b09);_0x37a841(_0x1dc87b['error'](0x1f4,_0x2ddc29[_0xe3ae('0x14')]));});});};exports[_0xe3ae('0x1f')]=function(_0x3ffa45){var _0x3195e2=this;return new Promise(function(_0x4c9f5e,_0x27080f){return db[_0xe3ae('0x7')][_0xe3ae('0x20')]({'where':_0x3ffa45[_0xe3ae('0x9')]?_0x3ffa45[_0xe3ae('0x9')]['where']||null:null})[_0xe3ae('0xe')](function(_0x16cfaa){logger[_0xe3ae('0xf')]('DestroyCmHopper',_0x3ffa45);logger[_0xe3ae('0x10')](_0xe3ae('0x1f'),_0x3ffa45,JSON['stringify'](_0x16cfaa));_0x4c9f5e(_0x16cfaa);})[_0xe3ae('0x12')](function(_0x28f8eb){logger['error'](_0xe3ae('0x1f'),_0x28f8eb[_0xe3ae('0x14')],_0x3ffa45);_0x27080f(_0x3195e2[_0xe3ae('0x13')](0x1f4,_0x28f8eb['message']));});});};exports['GetContactDialer']=function(_0x591106){var _0x5ed912=this;return new Promise(function(_0x375ea9,_0x1070b3){return db[_0xe3ae('0x21')]['describe']()['then'](function(_0x498a0e){return db[_0xe3ae('0x22')][_0xe3ae('0x23')](function(_0x5514f8){return db[_0xe3ae('0x7')][_0xe3ae('0x8')]({'where':_0x591106[_0xe3ae('0x9')]?_0x591106[_0xe3ae('0x9')]['where']||null:null,'attributes':_0x591106[_0xe3ae('0x9')]?_0x591106['options']['attributes']||null:null,'limit':_0x591106[_0xe3ae('0x9')]?_0x591106[_0xe3ae('0x9')]['limit']||null:null,'order':_0x591106[_0xe3ae('0x9')]?_0x591106[_0xe3ae('0x9')][_0xe3ae('0x24')]||null:null,'transaction':_0x5514f8,'lock':_0x5514f8['LOCK']['UPDATE'],'include':[{'model':db[_0xe3ae('0x21')],'as':_0xe3ae('0x25'),'attributes':_['keys'](_0x498a0e)},{'model':db[_0xe3ae('0x26')],'as':_0xe3ae('0x27'),'attributes':['id','name',_0xe3ae('0x28')]}]})[_0xe3ae('0xe')](function(_0x5ea0a0){var _0x46bc95=[];var _0x41f07d=[];for(var _0x5df0ce=0x0;_0x5df0ce<_0x5ea0a0[_0xe3ae('0x29')];_0x5df0ce+=0x1){var _0xab3897=_0x5ea0a0[_0x5df0ce][_0xe3ae('0x2a')];if(_0xab3897===null){_0x46bc95['push'](_0x5ea0a0[_0x5df0ce][_0xe3ae('0x2b')](_0x591106[_0xe3ae('0x1a')],{'transaction':_0x5514f8}));}else if(!_0x41f07d[_0xe3ae('0x2c')](_0xab3897)){_0x41f07d[_0xe3ae('0x2d')](_0xab3897);_0x46bc95[_0xe3ae('0x2d')](_0x5ea0a0[_0x5df0ce][_0xe3ae('0x2b')](_0x591106[_0xe3ae('0x1a')],{'transaction':_0x5514f8}));}}return BPromise['all'](_0x46bc95);});})['then'](function(_0x4b488e){logger[_0xe3ae('0xf')](_0xe3ae('0x2e'),_0x591106);if(_0x4b488e['length']>0x0){logger[_0xe3ae('0xf')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x4b488e[0x0][_0xe3ae('0x2f')]['id'],_0x4b488e[0x0][_0xe3ae('0x2f')]['ContactId'],_0x4b488e[0x0][_0xe3ae('0x2f')][_0xe3ae('0x1e')]);}logger[_0xe3ae('0x10')](_0xe3ae('0x2e'),_0x591106,JSON[_0xe3ae('0x11')](_0x4b488e));_0x375ea9(_0x4b488e);})[_0xe3ae('0x12')](function(_0x1d064c){logger[_0xe3ae('0x13')](_0xe3ae('0x2e'),_0x1d064c['message'],_0x591106);_0x1070b3(_0x5ed912['error'](0x1f4,_0x1d064c[_0xe3ae('0x14')]));});});});};exports[_0xe3ae('0x30')]=function(_0xd9fb41){var _0x13ea50=this;return new Promise(function(_0x3c0a32,_0x45c797){return db[_0xe3ae('0x22')][_0xe3ae('0x23')](function(_0x1f3619){return db[_0xe3ae('0x31')][_0xe3ae('0x32')](_0xd9fb41[_0xe3ae('0x1a')],{'raw':_0xd9fb41[_0xe3ae('0x9')]?_0xd9fb41[_0xe3ae('0x9')]['raw']===undefined?!![]:![]:!![],'transaction':_0x1f3619})[_0xe3ae('0xe')](function(){logger[_0xe3ae('0xf')](_0xe3ae('0x33'),JSON['stringify'](_0xd9fb41[_0xe3ae('0x9')][_0xe3ae('0x17')]),_0xd9fb41['options'][_0xe3ae('0x17')]['active']);return db[_0xe3ae('0x7')][_0xe3ae('0x20')]({'where':_0xd9fb41[_0xe3ae('0x9')]?_0xd9fb41['options'][_0xe3ae('0x17')]||null:null,'transaction':_0x1f3619});});})['then'](function(_0x43393b){logger['info'](_0xe3ae('0x30'),_0xd9fb41);logger[_0xe3ae('0x10')](_0xe3ae('0x30'),_0xd9fb41,JSON['stringify'](_0x43393b));_0x3c0a32(_0x43393b);})['catch'](function(_0x1ee28b){logger[_0xe3ae('0x13')]('MoveContactManagedDialer',_0x1ee28b['message'],_0xd9fb41);_0x45c797(_0x13ea50[_0xe3ae('0x13')](0x1f4,_0x1ee28b['message']));});});};exports[_0xe3ae('0x34')]=function(_0x3d86ad){var _0x5ce8b0=this;return new Promise(function(_0x454160,_0x34e85f){return db[_0xe3ae('0x7')][_0xe3ae('0x8')]({'raw':_0x3d86ad['options']?_0x3d86ad[_0xe3ae('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x3d86ad[_0xe3ae('0x9')]?_0x3d86ad[_0xe3ae('0x9')]['where']||null:null,'attributes':[[db[_0xe3ae('0x22')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xe3ae('0x35')+util[_0xe3ae('0x36')](_0xe3ae('0x37'),moment()[_0xe3ae('0x36')](_0xe3ae('0x38')))+'\x20,\x201,\x20null'))),_0xe3ae('0x39')]]})[_0xe3ae('0xe')](function(_0x1c63ed){logger[_0xe3ae('0xf')](_0xe3ae('0x34'),_0x3d86ad);logger['debug'](_0xe3ae('0x34'),_0x3d86ad,JSON[_0xe3ae('0x11')](_0x1c63ed));_0x454160(_0x1c63ed);})[_0xe3ae('0x12')](function(_0x592af3){logger[_0xe3ae('0x13')]('CountReScheduled',_0x592af3[_0xe3ae('0x14')],_0x3d86ad);_0x34e85f(_0x5ce8b0['error'](0x1f4,_0x592af3[_0xe3ae('0x14')]));});});};exports[_0xe3ae('0x3a')]=function(_0x2966c3){var _0x9d1029=this;return new Promise(function(_0x3a8e1c,_0x591382){return db[_0xe3ae('0x21')][_0xe3ae('0x3b')]()[_0xe3ae('0xe')](function(){return db[_0xe3ae('0x22')][_0xe3ae('0x23')](function(_0x3041b3){return db[_0xe3ae('0x7')]['findAll']({'where':_0x2966c3['options']?_0x2966c3['options'][_0xe3ae('0x17')]||null:null,'attributes':_0x2966c3['options']?_0x2966c3[_0xe3ae('0x9')][_0xe3ae('0xb')]||null:null,'limit':0x1,'order':_0x2966c3[_0xe3ae('0x9')]?_0x2966c3[_0xe3ae('0x9')][_0xe3ae('0x24')]||null:null,'group':db[_0xe3ae('0x7')][_0xe3ae('0x2a')],'transaction':_0x3041b3,'lock':_0x3041b3[_0xe3ae('0x3c')][_0xe3ae('0x3d')],'include':_0x2966c3['options']?_0x2966c3['options']['include']?_[_0xe3ae('0xd')](_0x2966c3[_0xe3ae('0x9')][_0xe3ae('0xc')],function(_0x379a7a){return{'model':db[_0x379a7a[_0xe3ae('0x18')]],'as':_0x379a7a['as'],'attributes':_0x379a7a[_0xe3ae('0xb')],'include':_0x379a7a[_0xe3ae('0xc')]?_[_0xe3ae('0xd')](_0x379a7a[_0xe3ae('0xc')],function(_0x35bc68){return{'model':db[_0x35bc68[_0xe3ae('0x18')]],'as':_0x35bc68['as'],'attributes':_0x35bc68[_0xe3ae('0xb')],'include':_0x35bc68[_0xe3ae('0xc')]?_[_0xe3ae('0xd')](_0x35bc68[_0xe3ae('0xc')],function(_0x34ee76){return{'model':db[_0x34ee76[_0xe3ae('0x18')]],'as':_0x34ee76['as'],'attributes':_0x34ee76['attributes']};}):[]};}):[]};}):[]:[]})[_0xe3ae('0xe')](function(_0x1fbb30){var _0x43eaa3=[];for(var _0x2b0aa2=0x0;_0x2b0aa2<_0x1fbb30[_0xe3ae('0x29')];_0x2b0aa2+=0x1){_0x43eaa3['push'](_0x1fbb30[_0x2b0aa2][_0xe3ae('0x2b')](_0x2966c3[_0xe3ae('0x1a')],{'transaction':_0x3041b3}));}return BPromise['all'](_0x43eaa3);});})['then'](function(_0xe4af19){logger[_0xe3ae('0xf')](_0xe3ae('0x3a'),_0x2966c3);logger['debug'](_0xe3ae('0x3a'),_0x2966c3,JSON[_0xe3ae('0x11')](_0xe4af19));_0x3a8e1c(_0xe4af19);})[_0xe3ae('0x12')](function(_0x244294){logger[_0xe3ae('0x13')](_0xe3ae('0x3a'),_0x244294[_0xe3ae('0x14')],_0x2966c3);_0x591382(_0x9d1029[_0xe3ae('0x13')](0x1f4,_0x244294[_0xe3ae('0x14')]));});});});};exports['GetCmHopperPreview']=function(_0x1b995e){var _0xd154cd=this;return new Promise(function(_0x5e3cca,_0x124270){db['CmContact'][_0xe3ae('0x3b')]()[_0xe3ae('0xe')](function(_0x93c02f){return db['CmHopper']['findAll']({'raw':_0x1b995e[_0xe3ae('0x9')]?_0x1b995e[_0xe3ae('0x9')][_0xe3ae('0xa')]===undefined?!![]:![]:!![],'where':_0x1b995e[_0xe3ae('0x9')]?_0x1b995e[_0xe3ae('0x9')][_0xe3ae('0x17')]||null:null,'attributes':_0x1b995e['options']?_0x1b995e[_0xe3ae('0x9')][_0xe3ae('0xb')]||null:null,'limit':_0x1b995e[_0xe3ae('0x9')]?_0x1b995e['options']['limit']||null:null,'include':_0x1b995e['options']?_0x1b995e[_0xe3ae('0x9')][_0xe3ae('0xc')]?_[_0xe3ae('0xd')](_0x1b995e[_0xe3ae('0x9')]['include'],function(_0x4696bd){return{'model':db[_0x4696bd[_0xe3ae('0x18')]],'as':_0x4696bd['as'],'attributes':_0x4696bd['as']==='Contact'?_[_0xe3ae('0x3e')](_0x93c02f):_0x4696bd[_0xe3ae('0xb')],'include':_0x4696bd['include']?_['map'](_0x4696bd[_0xe3ae('0xc')],function(_0x4fc4f9){return{'model':db[_0x4fc4f9[_0xe3ae('0x18')]],'as':_0x4fc4f9['as'],'attributes':_0x4fc4f9[_0xe3ae('0xb')],'include':_0x4fc4f9[_0xe3ae('0xc')]?_[_0xe3ae('0xd')](_0x4fc4f9[_0xe3ae('0xc')],function(_0x4bf982){return{'model':db[_0x4bf982[_0xe3ae('0x18')]],'as':_0x4bf982['as'],'attributes':_0x4bf982[_0xe3ae('0xb')]};}):[]};}):[]};}):[]:[]})[_0xe3ae('0xe')](function(_0x1d5104){logger[_0xe3ae('0xf')](_0xe3ae('0x6'),_0x1b995e);logger[_0xe3ae('0x10')](_0xe3ae('0x6'),_0x1b995e,JSON['stringify'](_0x1d5104));_0x5e3cca(_0x1d5104);})['catch'](function(_0x3ca789){logger[_0xe3ae('0x13')](_0xe3ae('0x6'),_0x3ca789['message'],_0x1b995e);_0x124270(_0xd154cd[_0xe3ae('0x13')](0x1f4,_0x3ca789[_0xe3ae('0x14')]));});});});};exports[_0xe3ae('0x3f')]=function(_0x3ff2aa){var _0x456edc=this;return new Promise(function(_0x5985b6,_0x4229de){return db['CmContact'][_0xe3ae('0x40')]({'raw':!![],'where':{'phone':_0x3ff2aa[_0xe3ae('0x9')][_0xe3ae('0x17')]['phone']},'attributes':['id',_0xe3ae('0x41')],'order':[['id',_0xe3ae('0x42')]]})[_0xe3ae('0xe')](function(_0x5eb360){logger['info']('getContactByPhone',_0x3ff2aa);logger[_0xe3ae('0x10')](_0xe3ae('0x43'),_0x3ff2aa,JSON[_0xe3ae('0x11')](_0x5eb360));_0x5985b6(_0x5eb360);})[_0xe3ae('0x12')](function(_0x22eacc){logger[_0xe3ae('0x13')]('getContactByPhone',_0x22eacc['message'],_0x3ff2aa);_0x4229de(_0x456edc[_0xe3ae('0x13')](0x1f4,_0x22eacc[_0xe3ae('0x14')]));});});};exports['ResetActiveCalls']=function(_0x3798e6){var _0x5952a8=this;return new Promise(function(_0x344493,_0x241def){return db[_0xe3ae('0x22')][_0xe3ae('0x23')](function(_0x405609){var _0x46b909=_0x3798e6['options']&&_0x3798e6[_0xe3ae('0x9')][_0xe3ae('0x17')]?_0x3798e6[_0xe3ae('0x9')][_0xe3ae('0x17')]:{};return db[_0xe3ae('0x7')][_0xe3ae('0x2b')](_0x3798e6[_0xe3ae('0x1a')],{'where':_0x46b909,'transaction':_0x405609})['then'](function(_0x396f9b){logger[_0xe3ae('0xf')]('ResetActiveCalls',_0x3798e6);logger[_0xe3ae('0x10')](_0xe3ae('0x44'),_0x3798e6,JSON['stringify'](_0x396f9b));_0x344493(_0x396f9b);})[_0xe3ae('0x12')](function(_0x30f011){logger[_0xe3ae('0x13')](_0xe3ae('0x44'),_0x30f011['message'],_0x3798e6);_0x241def(_0x5952a8['error'](0x1f4,_0x30f011['message']));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x19d421){var _0x372e2b=this;var _0x11b1b2=_0x19d421['body']['where'][_0xe3ae('0x45')];var _0x40c6c0=_0x19d421[_0xe3ae('0x1a')][_0xe3ae('0x17')][_0xe3ae('0x46')];var _0x256c1e=_0x19d421[_0xe3ae('0x1a')][_0xe3ae('0x17')][_0xe3ae('0x47')];return new Promise(function(_0x26b4ad,_0x3ca3fc){return db[_0xe3ae('0x7')]['findAll']({'where':{'voiceQueueId':{'$in':_0x11b1b2},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xe3ae('0x22')]['literal'](_0xe3ae('0x48')+_0x40c6c0+_0xe3ae('0x49')),'$gt':db[_0xe3ae('0x22')][_0xe3ae('0x4a')](_0xe3ae('0x4b'))}},'UserId':{'$in':_0x256c1e}},'include':[{'model':db[_0xe3ae('0x21')],'as':'Contact'},{'model':db[_0xe3ae('0x26')],'as':_0xe3ae('0x27'),'attributes':['id',_0xe3ae('0x4c'),_0xe3ae('0x28')]},{'model':db[_0xe3ae('0x4d')],'as':_0xe3ae('0x4e')}]})[_0xe3ae('0xe')](function(_0x720e8c){if(_0x720e8c[_0xe3ae('0x29')]>0x0){return db[_0xe3ae('0x22')]['transaction'](function(_0xd7435d){return db['CmHopper'][_0xe3ae('0x2b')]({'recallmeNotifiedDate':db[_0xe3ae('0x22')][_0xe3ae('0x4a')]('NOW()')},{'where':{'id':{'$in':_['map'](_0x720e8c,'id')}},'transaction':_0xd7435d})[_0xe3ae('0xe')](function(){_0x26b4ad(_0x720e8c);})[_0xe3ae('0x12')](function(_0x3e2a2f){logger['error'](_0xe3ae('0x4f'),_0x3e2a2f[_0xe3ae('0x14')],_0x19d421);_0x3ca3fc(_0x372e2b[_0xe3ae('0x13')](0x1f4,_0x3e2a2f[_0xe3ae('0x14')]));});})[_0xe3ae('0x12')](function(_0x2ace6b){logger[_0xe3ae('0x13')](_0xe3ae('0x4f'),_0x2ace6b[_0xe3ae('0x14')],_0x19d421);_0x3ca3fc(_0x372e2b[_0xe3ae('0x13')](0x1f4,_0x2ace6b['message']));});}else{_0x26b4ad(_0x720e8c);}});});}; \ No newline at end of file +var _0x2032=['ShowCmHopper','find','where','debug','catch','CreateCmHopper','body','active','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','describe','sequelize','transaction','order','LOCK','UPDATE','keys','User','Agent','name','voicePause','length','UserId','includes','push','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','update','CmContact','Contact','GetContactByPhone','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','\x20MINUTE','List','NOW()','util','moment','bluebird','../../config/logger','rpc','CmHopper','findAll','options','raw','limit','map','include','model','attributes','then','info','GetCmHopper','stringify','error','message'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0x2032,0xd9));var _0x2203=function(_0x234563,_0x5945da){_0x234563=_0x234563-0x0;var _0x28bb6a=_0x2032[_0x234563];return _0x28bb6a;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var BPromise=require(_0x2203('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x2203('0x3'))(_0x2203('0x4'));exports['GetCmHopper']=function(_0x46c49a){var _0x880dcd=this;return new Promise(function(_0x44ccfd,_0x201796){return db[_0x2203('0x5')][_0x2203('0x6')]({'raw':_0x46c49a[_0x2203('0x7')]?_0x46c49a[_0x2203('0x7')][_0x2203('0x8')]===undefined?!![]:![]:!![],'where':_0x46c49a[_0x2203('0x7')]?_0x46c49a[_0x2203('0x7')]['where']||null:null,'attributes':_0x46c49a['options']?_0x46c49a[_0x2203('0x7')]['attributes']||null:null,'limit':_0x46c49a[_0x2203('0x7')]?_0x46c49a[_0x2203('0x7')][_0x2203('0x9')]||null:null,'include':_0x46c49a['options']?_0x46c49a[_0x2203('0x7')]['include']?_[_0x2203('0xa')](_0x46c49a['options'][_0x2203('0xb')],function(_0x1abb51){return{'model':db[_0x1abb51['model']],'as':_0x1abb51['as'],'attributes':_0x1abb51['attributes'],'include':_0x1abb51['include']?_['map'](_0x1abb51['include'],function(_0x238772){return{'model':db[_0x238772['model']],'as':_0x238772['as'],'attributes':_0x238772['attributes'],'include':_0x238772[_0x2203('0xb')]?_[_0x2203('0xa')](_0x238772[_0x2203('0xb')],function(_0x41af85){return{'model':db[_0x41af85[_0x2203('0xc')]],'as':_0x41af85['as'],'attributes':_0x41af85[_0x2203('0xd')]};}):[]};}):[]};}):[]:[]})[_0x2203('0xe')](function(_0x2c085c){logger[_0x2203('0xf')](_0x2203('0x10'),_0x46c49a);logger['debug'](_0x2203('0x10'),_0x46c49a,JSON[_0x2203('0x11')](_0x2c085c));_0x44ccfd(_0x2c085c);})['catch'](function(_0x3f9ef6){logger[_0x2203('0x12')]('GetCmHopper',_0x3f9ef6[_0x2203('0x13')],_0x46c49a);_0x201796(_0x880dcd['error'](0x1f4,_0x3f9ef6[_0x2203('0x13')]));});});};exports[_0x2203('0x14')]=function(_0x3c8c34){var _0x3b4034=this;return new Promise(function(_0x15cb1a,_0x449039){return db['CmHopper'][_0x2203('0x15')]({'raw':_0x3c8c34['options']?_0x3c8c34['options'][_0x2203('0x8')]===undefined?!![]:![]:!![],'where':_0x3c8c34['options']?_0x3c8c34[_0x2203('0x7')][_0x2203('0x16')]||null:null,'attributes':_0x3c8c34['options']?_0x3c8c34[_0x2203('0x7')]['attributes']||null:null,'include':_0x3c8c34['options']?_0x3c8c34[_0x2203('0x7')][_0x2203('0xb')]?_[_0x2203('0xa')](_0x3c8c34[_0x2203('0x7')][_0x2203('0xb')],function(_0x3114ef){return{'model':db[_0x3114ef[_0x2203('0xc')]],'as':_0x3114ef['as'],'attributes':_0x3114ef[_0x2203('0xd')],'include':_0x3114ef['include']?_[_0x2203('0xa')](_0x3114ef[_0x2203('0xb')],function(_0x39a11a){return{'model':db[_0x39a11a['model']],'as':_0x39a11a['as'],'attributes':_0x39a11a[_0x2203('0xd')],'include':_0x39a11a[_0x2203('0xb')]?_['map'](_0x39a11a[_0x2203('0xb')],function(_0xd91f5d){return{'model':db[_0xd91f5d[_0x2203('0xc')]],'as':_0xd91f5d['as'],'attributes':_0xd91f5d[_0x2203('0xd')]};}):[]};}):[]};}):[]:[]})[_0x2203('0xe')](function(_0x1df508){logger[_0x2203('0xf')]('ShowCmHopper',_0x3c8c34);logger[_0x2203('0x17')](_0x2203('0x14'),_0x3c8c34,JSON[_0x2203('0x11')](_0x1df508));_0x15cb1a(_0x1df508);})[_0x2203('0x18')](function(_0x52a426){logger[_0x2203('0x12')](_0x2203('0x14'),_0x52a426[_0x2203('0x13')],_0x3c8c34);_0x449039(_0x3b4034[_0x2203('0x12')](0x1f4,_0x52a426['message']));});});};exports[_0x2203('0x19')]=function(_0x50aa17){var _0x5e6560=this;return new Promise(function(_0x5c0157,_0x1d5f74){return db['CmHopper']['create'](_0x50aa17[_0x2203('0x1a')],{'raw':_0x50aa17[_0x2203('0x7')]?_0x50aa17[_0x2203('0x7')][_0x2203('0x8')]===undefined?!![]:![]:!![]})[_0x2203('0xe')](function(_0x5ac74b){logger[_0x2203('0xf')](_0x2203('0x19'),_0x50aa17);logger['debug'](_0x2203('0x19'),_0x50aa17,JSON[_0x2203('0x11')](_0x5ac74b));_0x5c0157(_0x5ac74b);})[_0x2203('0x18')](function(_0x4187b4){logger[_0x2203('0x12')](_0x2203('0x19'),_0x4187b4[_0x2203('0x13')],_0x50aa17);_0x1d5f74(_0x5e6560[_0x2203('0x12')](0x1f4,_0x4187b4[_0x2203('0x13')]));});});};exports['UpdateCmHopper']=function(_0x15c0ad){var _0x347d3e=this;return new Promise(function(_0x56f9b2,_0x54b90b){return db[_0x2203('0x5')]['update'](_0x15c0ad[_0x2203('0x1a')],{'raw':_0x15c0ad[_0x2203('0x7')]?_0x15c0ad[_0x2203('0x7')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15c0ad['options']?_0x15c0ad[_0x2203('0x7')]['where']||null:null,'attributes':_0x15c0ad[_0x2203('0x7')]?_0x15c0ad['options'][_0x2203('0xd')]||null:null,'limit':_0x15c0ad['options']?_0x15c0ad[_0x2203('0x7')][_0x2203('0x9')]||null:null})[_0x2203('0xe')](function(_0x40a793){logger[_0x2203('0xf')]('UpdateCmHopper',_0x15c0ad);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x2203('0x11')](_0x15c0ad[_0x2203('0x7')][_0x2203('0x16')]),_0x15c0ad[_0x2203('0x1a')][_0x2203('0x1b')]);logger[_0x2203('0x17')](_0x2203('0x1c'),_0x15c0ad,JSON['stringify'](_0x40a793));_0x56f9b2(_0x40a793);})[_0x2203('0x18')](function(_0x1b12c3){logger[_0x2203('0x12')](_0x2203('0x1c'),_0x1b12c3['message'],_0x15c0ad);_0x54b90b(_0x347d3e['error'](0x1f4,_0x1b12c3[_0x2203('0x13')]));});});};exports['DestroyCmHopper']=function(_0x330303){var _0x446209=this;return new Promise(function(_0x132091,_0x548e06){return db['CmHopper'][_0x2203('0x1d')]({'where':_0x330303[_0x2203('0x7')]?_0x330303[_0x2203('0x7')][_0x2203('0x16')]||null:null})[_0x2203('0xe')](function(_0x1fa734){logger['info'](_0x2203('0x1e'),_0x330303);logger[_0x2203('0x17')](_0x2203('0x1e'),_0x330303,JSON[_0x2203('0x11')](_0x1fa734));_0x132091(_0x1fa734);})[_0x2203('0x18')](function(_0x36b99f){logger[_0x2203('0x12')](_0x2203('0x1e'),_0x36b99f[_0x2203('0x13')],_0x330303);_0x548e06(_0x446209[_0x2203('0x12')](0x1f4,_0x36b99f['message']));});});};exports[_0x2203('0x1f')]=function(_0x24e773){var _0x4aab80=this;return new Promise(function(_0x3b9981,_0x4c3259){return db['CmContact'][_0x2203('0x20')]()['then'](function(_0x273e5f){return db[_0x2203('0x21')][_0x2203('0x22')](function(_0x35dba9){return db['CmHopper'][_0x2203('0x6')]({'where':_0x24e773[_0x2203('0x7')]?_0x24e773['options'][_0x2203('0x16')]||null:null,'attributes':_0x24e773[_0x2203('0x7')]?_0x24e773[_0x2203('0x7')][_0x2203('0xd')]||null:null,'limit':_0x24e773['options']?_0x24e773['options'][_0x2203('0x9')]||null:null,'order':_0x24e773['options']?_0x24e773['options'][_0x2203('0x23')]||null:null,'transaction':_0x35dba9,'lock':_0x35dba9[_0x2203('0x24')][_0x2203('0x25')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_[_0x2203('0x26')](_0x273e5f)},{'model':db[_0x2203('0x27')],'as':_0x2203('0x28'),'attributes':['id',_0x2203('0x29'),_0x2203('0x2a')]}]})[_0x2203('0xe')](function(_0x4a7f4e){var _0x747dce=[];var _0x557659=[];for(var _0x3f7685=0x0;_0x3f7685<_0x4a7f4e[_0x2203('0x2b')];_0x3f7685+=0x1){var _0x246aff=_0x4a7f4e[_0x3f7685][_0x2203('0x2c')];if(_0x246aff===null){_0x747dce['push'](_0x4a7f4e[_0x3f7685]['update'](_0x24e773[_0x2203('0x1a')],{'transaction':_0x35dba9}));}else if(!_0x557659[_0x2203('0x2d')](_0x246aff)){_0x557659[_0x2203('0x2e')](_0x246aff);_0x747dce[_0x2203('0x2e')](_0x4a7f4e[_0x3f7685]['update'](_0x24e773['body'],{'transaction':_0x35dba9}));}}return BPromise['all'](_0x747dce);});})[_0x2203('0xe')](function(_0x1c2734){logger['info'](_0x2203('0x1f'),_0x24e773);if(_0x1c2734[_0x2203('0x2b')]>0x0){logger['info'](_0x2203('0x2f'),_0x1c2734[0x0][_0x2203('0x30')]['id'],_0x1c2734[0x0][_0x2203('0x30')][_0x2203('0x31')],_0x1c2734[0x0]['dataValues'][_0x2203('0x1b')]);}logger['debug'](_0x2203('0x1f'),_0x24e773,JSON[_0x2203('0x11')](_0x1c2734));_0x3b9981(_0x1c2734);})['catch'](function(_0x428b18){logger[_0x2203('0x12')](_0x2203('0x1f'),_0x428b18[_0x2203('0x13')],_0x24e773);_0x4c3259(_0x4aab80[_0x2203('0x12')](0x1f4,_0x428b18[_0x2203('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x562a3d){var _0x2f2537=this;return new Promise(function(_0x524356,_0x56e881){return db[_0x2203('0x21')][_0x2203('0x22')](function(_0x14e5d9){return db['CmHopperFinal'][_0x2203('0x32')](_0x562a3d['body'],{'raw':_0x562a3d['options']?_0x562a3d[_0x2203('0x7')]['raw']===undefined?!![]:![]:!![],'transaction':_0x14e5d9})['then'](function(){logger['info'](_0x2203('0x33'),JSON[_0x2203('0x11')](_0x562a3d[_0x2203('0x7')][_0x2203('0x16')]),_0x562a3d[_0x2203('0x7')][_0x2203('0x16')][_0x2203('0x1b')]);return db[_0x2203('0x5')][_0x2203('0x1d')]({'where':_0x562a3d[_0x2203('0x7')]?_0x562a3d[_0x2203('0x7')][_0x2203('0x16')]||null:null,'transaction':_0x14e5d9});});})['then'](function(_0x585bde){logger[_0x2203('0xf')](_0x2203('0x34'),_0x562a3d);logger[_0x2203('0x17')](_0x2203('0x34'),_0x562a3d,JSON[_0x2203('0x11')](_0x585bde));_0x524356(_0x585bde);})[_0x2203('0x18')](function(_0x4f8b8e){logger['error'](_0x2203('0x34'),_0x4f8b8e[_0x2203('0x13')],_0x562a3d);_0x56e881(_0x2f2537[_0x2203('0x12')](0x1f4,_0x4f8b8e[_0x2203('0x13')]));});});};exports[_0x2203('0x35')]=function(_0x7b0b9c){var _0x133d22=this;return new Promise(function(_0x191b67,_0x2c6bcc){return db[_0x2203('0x5')][_0x2203('0x6')]({'raw':_0x7b0b9c['options']?_0x7b0b9c[_0x2203('0x7')][_0x2203('0x8')]===undefined?!![]:![]:!![],'where':_0x7b0b9c[_0x2203('0x7')]?_0x7b0b9c[_0x2203('0x7')][_0x2203('0x16')]||null:null,'attributes':[[db[_0x2203('0x21')]['fn'](_0x2203('0x36'),db[_0x2203('0x21')]['fn']('IF',db[_0x2203('0x21')][_0x2203('0x37')](_0x2203('0x38')+util[_0x2203('0x39')](_0x2203('0x3a'),moment()[_0x2203('0x39')](_0x2203('0x3b')))+_0x2203('0x3c')))),_0x2203('0x3d')]]})[_0x2203('0xe')](function(_0x8a9282){logger[_0x2203('0xf')]('CountReScheduled',_0x7b0b9c);logger[_0x2203('0x17')](_0x2203('0x35'),_0x7b0b9c,JSON[_0x2203('0x11')](_0x8a9282));_0x191b67(_0x8a9282);})['catch'](function(_0x68855d){logger[_0x2203('0x12')](_0x2203('0x35'),_0x68855d[_0x2203('0x13')],_0x7b0b9c);_0x2c6bcc(_0x133d22[_0x2203('0x12')](0x1f4,_0x68855d['message']));});});};exports[_0x2203('0x3e')]=function(_0x11243d){var _0x1c63bf=this;return new Promise(function(_0x4dde80,_0x5507b6){return db['CmContact']['describe']()['then'](function(){return db[_0x2203('0x21')][_0x2203('0x22')](function(_0x27dd95){return db[_0x2203('0x5')][_0x2203('0x6')]({'where':_0x11243d[_0x2203('0x7')]?_0x11243d[_0x2203('0x7')][_0x2203('0x16')]||null:null,'attributes':_0x11243d['options']?_0x11243d['options'][_0x2203('0xd')]||null:null,'limit':0x1,'order':_0x11243d[_0x2203('0x7')]?_0x11243d[_0x2203('0x7')][_0x2203('0x23')]||null:null,'group':db[_0x2203('0x5')][_0x2203('0x2c')],'transaction':_0x27dd95,'lock':_0x27dd95[_0x2203('0x24')][_0x2203('0x25')],'include':_0x11243d[_0x2203('0x7')]?_0x11243d[_0x2203('0x7')][_0x2203('0xb')]?_[_0x2203('0xa')](_0x11243d[_0x2203('0x7')][_0x2203('0xb')],function(_0x288786){return{'model':db[_0x288786[_0x2203('0xc')]],'as':_0x288786['as'],'attributes':_0x288786[_0x2203('0xd')],'include':_0x288786[_0x2203('0xb')]?_[_0x2203('0xa')](_0x288786['include'],function(_0x4232c5){return{'model':db[_0x4232c5['model']],'as':_0x4232c5['as'],'attributes':_0x4232c5[_0x2203('0xd')],'include':_0x4232c5['include']?_[_0x2203('0xa')](_0x4232c5[_0x2203('0xb')],function(_0x269649){return{'model':db[_0x269649[_0x2203('0xc')]],'as':_0x269649['as'],'attributes':_0x269649[_0x2203('0xd')]};}):[]};}):[]};}):[]:[]})[_0x2203('0xe')](function(_0x3e1583){var _0x2eab08=[];for(var _0x4e9a01=0x0;_0x4e9a01<_0x3e1583['length'];_0x4e9a01+=0x1){_0x2eab08[_0x2203('0x2e')](_0x3e1583[_0x4e9a01][_0x2203('0x3f')](_0x11243d[_0x2203('0x1a')],{'transaction':_0x27dd95}));}return BPromise['all'](_0x2eab08);});})['then'](function(_0x54878d){logger[_0x2203('0xf')](_0x2203('0x3e'),_0x11243d);logger[_0x2203('0x17')](_0x2203('0x3e'),_0x11243d,JSON['stringify'](_0x54878d));_0x4dde80(_0x54878d);})[_0x2203('0x18')](function(_0x47a2c7){logger[_0x2203('0x12')](_0x2203('0x3e'),_0x47a2c7[_0x2203('0x13')],_0x11243d);_0x5507b6(_0x1c63bf[_0x2203('0x12')](0x1f4,_0x47a2c7[_0x2203('0x13')]));});});});};exports['GetCmHopperPreview']=function(_0x4592fa){var _0x247f26=this;return new Promise(function(_0x18663f,_0x4a5f15){db[_0x2203('0x40')][_0x2203('0x20')]()[_0x2203('0xe')](function(_0xd76624){return db[_0x2203('0x5')][_0x2203('0x6')]({'raw':_0x4592fa[_0x2203('0x7')]?_0x4592fa[_0x2203('0x7')][_0x2203('0x8')]===undefined?!![]:![]:!![],'where':_0x4592fa[_0x2203('0x7')]?_0x4592fa[_0x2203('0x7')]['where']||null:null,'attributes':_0x4592fa[_0x2203('0x7')]?_0x4592fa[_0x2203('0x7')][_0x2203('0xd')]||null:null,'limit':_0x4592fa[_0x2203('0x7')]?_0x4592fa[_0x2203('0x7')][_0x2203('0x9')]||null:null,'include':_0x4592fa[_0x2203('0x7')]?_0x4592fa[_0x2203('0x7')][_0x2203('0xb')]?_[_0x2203('0xa')](_0x4592fa[_0x2203('0x7')][_0x2203('0xb')],function(_0x4c332f){return{'model':db[_0x4c332f['model']],'as':_0x4c332f['as'],'attributes':_0x4c332f['as']===_0x2203('0x41')?_[_0x2203('0x26')](_0xd76624):_0x4c332f[_0x2203('0xd')],'include':_0x4c332f[_0x2203('0xb')]?_[_0x2203('0xa')](_0x4c332f['include'],function(_0x16e518){return{'model':db[_0x16e518[_0x2203('0xc')]],'as':_0x16e518['as'],'attributes':_0x16e518['attributes'],'include':_0x16e518['include']?_['map'](_0x16e518['include'],function(_0x5e07d7){return{'model':db[_0x5e07d7[_0x2203('0xc')]],'as':_0x5e07d7['as'],'attributes':_0x5e07d7[_0x2203('0xd')]};}):[]};}):[]};}):[]:[]})[_0x2203('0xe')](function(_0x49fd02){logger['info']('GetCmHopper',_0x4592fa);logger[_0x2203('0x17')](_0x2203('0x10'),_0x4592fa,JSON[_0x2203('0x11')](_0x49fd02));_0x18663f(_0x49fd02);})[_0x2203('0x18')](function(_0x369728){logger[_0x2203('0x12')](_0x2203('0x10'),_0x369728['message'],_0x4592fa);_0x4a5f15(_0x247f26[_0x2203('0x12')](0x1f4,_0x369728[_0x2203('0x13')]));});});});};exports[_0x2203('0x42')]=function(_0x3c3bb4){var _0x35ff6b=this;return new Promise(function(_0x35d508,_0x13e11f){return db['CmContact'][_0x2203('0x43')]({'raw':!![],'where':{'phone':_0x3c3bb4['options']['where'][_0x2203('0x44')]},'attributes':['id','dialTimezone'],'order':[['id',_0x2203('0x45')]]})[_0x2203('0xe')](function(_0x4c7ea2){logger[_0x2203('0xf')](_0x2203('0x46'),_0x3c3bb4);logger[_0x2203('0x17')](_0x2203('0x46'),_0x3c3bb4,JSON[_0x2203('0x11')](_0x4c7ea2));_0x35d508(_0x4c7ea2);})[_0x2203('0x18')](function(_0x4cca59){logger[_0x2203('0x12')](_0x2203('0x46'),_0x4cca59['message'],_0x3c3bb4);_0x13e11f(_0x35ff6b['error'](0x1f4,_0x4cca59[_0x2203('0x13')]));});});};exports[_0x2203('0x47')]=function(_0x383d3e){var _0xa88b4f=this;return new Promise(function(_0x416b38,_0x29d9de){return db[_0x2203('0x21')][_0x2203('0x22')](function(_0x4749df){var _0x2bfa45=_0x383d3e[_0x2203('0x7')]&&_0x383d3e[_0x2203('0x7')][_0x2203('0x16')]?_0x383d3e[_0x2203('0x7')][_0x2203('0x16')]:{};return db[_0x2203('0x5')]['update'](_0x383d3e['body'],{'where':_0x2bfa45,'transaction':_0x4749df})[_0x2203('0xe')](function(_0x1295a3){logger['info'](_0x2203('0x47'),_0x383d3e);logger[_0x2203('0x17')]('ResetActiveCalls',_0x383d3e,JSON[_0x2203('0x11')](_0x1295a3));_0x416b38(_0x1295a3);})[_0x2203('0x18')](function(_0x57ccf8){logger[_0x2203('0x12')](_0x2203('0x47'),_0x57ccf8['message'],_0x383d3e);_0x29d9de(_0xa88b4f[_0x2203('0x12')](0x1f4,_0x57ccf8[_0x2203('0x13')]));});});});};exports[_0x2203('0x48')]=function(_0x1596f7){var _0x4c735c=this;var _0x511c66=_0x1596f7[_0x2203('0x1a')][_0x2203('0x16')][_0x2203('0x49')];var _0x4ff77f=_0x1596f7['body'][_0x2203('0x16')][_0x2203('0x4a')];var _0x22cafb=_0x1596f7['body']['where'][_0x2203('0x4b')];return new Promise(function(_0x348ce6,_0x54fe33){return db[_0x2203('0x5')][_0x2203('0x6')]({'where':{'voiceQueueId':{'$in':_0x511c66},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x2203('0x37')]('NOW()\x20+\x20INTERVAL\x20'+_0x4ff77f+_0x2203('0x4c')),'$gt':db['sequelize']['literal']('NOW()')}},'UserId':{'$in':_0x22cafb}},'include':[{'model':db[_0x2203('0x40')],'as':_0x2203('0x41')},{'model':db['User'],'as':_0x2203('0x28'),'attributes':['id',_0x2203('0x29'),_0x2203('0x2a')]},{'model':db['CmList'],'as':_0x2203('0x4d')}]})['then'](function(_0x3f31e0){if(_0x3f31e0[_0x2203('0x2b')]>0x0){return db['sequelize'][_0x2203('0x22')](function(_0x4096f4){return db['CmHopper'][_0x2203('0x3f')]({'recallmeNotifiedDate':db[_0x2203('0x21')][_0x2203('0x37')](_0x2203('0x4e'))},{'where':{'id':{'$in':_[_0x2203('0xa')](_0x3f31e0,'id')}},'transaction':_0x4096f4})['then'](function(){_0x348ce6(_0x3f31e0);})[_0x2203('0x18')](function(_0x1b5185){logger[_0x2203('0x12')](_0x2203('0x48'),_0x1b5185[_0x2203('0x13')],_0x1596f7);_0x54fe33(_0x4c735c[_0x2203('0x12')](0x1f4,_0x1b5185['message']));});})[_0x2203('0x18')](function(_0x2cb9a4){logger['error'](_0x2203('0x48'),_0x2cb9a4['message'],_0x1596f7);_0x54fe33(_0x4c735c[_0x2203('0x12')](0x1f4,_0x2cb9a4[_0x2203('0x13')]));});}else{_0x348ce6(_0x3f31e0);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index c234b44..d9f5098 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 _0xceb1=['index','/describe','describe','/opencontacts','/:id','show','getPreviewRecall','post','/preview','getPreview','/timezone','getTimezone','put','update','delete','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xceb1,0xc0));var _0x1ceb=function(_0x65006,_0x4deb59){_0x65006=_0x65006-0x0;var _0xbbe6a3=_0xceb1[_0x65006];return _0xbbe6a3;};'use strict';var express=require(_0x1ceb('0x0'));var router=express[_0x1ceb('0x1')]();var auth=require(_0x1ceb('0x2'));var controller=require(_0x1ceb('0x3'));router[_0x1ceb('0x4')]('/',auth[_0x1ceb('0x5')](),controller[_0x1ceb('0x6')]);router[_0x1ceb('0x4')](_0x1ceb('0x7'),auth[_0x1ceb('0x5')](),controller[_0x1ceb('0x8')]);router[_0x1ceb('0x4')](_0x1ceb('0x9'),auth[_0x1ceb('0x5')](),controller['getOpenContacts']);router['get']('/timezones',auth[_0x1ceb('0x5')](),controller['getTimezones']);router['get'](_0x1ceb('0xa'),auth[_0x1ceb('0x5')](),controller[_0x1ceb('0xb')]);router['get']('/:id/previewrecall',auth[_0x1ceb('0x5')](),controller[_0x1ceb('0xc')]);router[_0x1ceb('0xd')]('/',auth[_0x1ceb('0x5')](),controller['create']);router[_0x1ceb('0xd')](_0x1ceb('0xe'),auth[_0x1ceb('0x5')](),controller[_0x1ceb('0xf')]);router[_0x1ceb('0xd')](_0x1ceb('0x10'),auth[_0x1ceb('0x5')](),controller[_0x1ceb('0x11')]);router[_0x1ceb('0x12')](_0x1ceb('0xa'),auth[_0x1ceb('0x5')](),controller[_0x1ceb('0x13')]);router[_0x1ceb('0x14')](_0x1ceb('0xa'),auth[_0x1ceb('0x5')](),controller['destroy']);module[_0x1ceb('0x15')]=router; \ No newline at end of file +var _0x1d45=['update','delete','destroy','exports','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','getPreview','/timezone','put'];(function(_0x5d7e60,_0x29d85d){var _0x4eeff6=function(_0x490364){while(--_0x490364){_0x5d7e60['push'](_0x5d7e60['shift']());}};_0x4eeff6(++_0x29d85d);}(_0x1d45,0x12f));var _0x51d4=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x1d45[_0x36884e];return _0x1cc367;};'use strict';var express=require('express');var router=express[_0x51d4('0x0')]();var auth=require(_0x51d4('0x1'));var controller=require(_0x51d4('0x2'));router[_0x51d4('0x3')]('/',auth[_0x51d4('0x4')](),controller[_0x51d4('0x5')]);router[_0x51d4('0x3')]('/describe',auth[_0x51d4('0x4')](),controller[_0x51d4('0x6')]);router[_0x51d4('0x3')](_0x51d4('0x7'),auth['isAuthenticated'](),controller[_0x51d4('0x8')]);router[_0x51d4('0x3')]('/timezones',auth[_0x51d4('0x4')](),controller[_0x51d4('0x9')]);router['get'](_0x51d4('0xa'),auth['isAuthenticated'](),controller[_0x51d4('0xb')]);router[_0x51d4('0x3')](_0x51d4('0xc'),auth[_0x51d4('0x4')](),controller[_0x51d4('0xd')]);router[_0x51d4('0xe')]('/',auth['isAuthenticated'](),controller[_0x51d4('0xf')]);router['post']('/preview',auth[_0x51d4('0x4')](),controller[_0x51d4('0x10')]);router[_0x51d4('0xe')](_0x51d4('0x11'),auth[_0x51d4('0x4')](),controller['getTimezone']);router[_0x51d4('0x12')](_0x51d4('0xa'),auth[_0x51d4('0x4')](),controller[_0x51d4('0x13')]);router[_0x51d4('0x14')](_0x51d4('0xa'),auth[_0x51d4('0x4')](),controller[_0x51d4('0x15')]);module[_0x51d4('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 8fe2d9b..b4d01a7 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56b3=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','INTEGER'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x56b3,0x18c));var _0x356b=function(_0x2ab365,_0xa3812e){_0x2ab365=_0x2ab365-0x0;var _0x49fef3=_0x56b3[_0x2ab365];return _0x49fef3;};'use strict';var moment=require('moment');var Sequelize=require(_0x356b('0x0'));module[_0x356b('0x1')]={'CmHopperId':{'type':Sequelize[_0x356b('0x2')]},'phone':{'type':Sequelize[_0x356b('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x356b('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x356b('0x4')],'defaultValue':moment()[_0x356b('0x5')](_0x356b('0x6'))},'countbusyretry':{'type':Sequelize[_0x356b('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x356b('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x356b('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7558=['DATE','moment','sequelize','exports','STRING','INTEGER'];(function(_0x48ac58,_0x27efe2){var _0x560abc=function(_0x5e21fa){while(--_0x5e21fa){_0x48ac58['push'](_0x48ac58['shift']());}};_0x560abc(++_0x27efe2);}(_0x7558,0x15d));var _0x8755=function(_0x2fe993,_0x50d0c6){_0x2fe993=_0x2fe993-0x0;var _0x55a182=_0x7558[_0x2fe993];return _0x55a182;};'use strict';var moment=require(_0x8755('0x0'));var Sequelize=require(_0x8755('0x1'));module[_0x8755('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x8755('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x8755('0x4')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x8755('0x5')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x8755('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8755('0x4')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x8755('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8755('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8755('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8755('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8755('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 4fcf082..470f44d 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdeed=['Content-Range','apply','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','stack','name','send','index','map','rawAttributes','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','CmHopperAdditionalPhone','includeAll','findAll','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','eml-format','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set'];(function(_0x45638d,_0x35c778){var _0x36412e=function(_0x4bf2e0){while(--_0x4bf2e0){_0x45638d['push'](_0x45638d['shift']());}};_0x36412e(++_0x35c778);}(_0xdeed,0xd5));var _0xddee=function(_0x149489,_0x1486f4){_0x149489=_0x149489-0x0;var _0x1160a6=_0xdeed[_0x149489];return _0x1160a6;};'use strict';var emlformat=require(_0xddee('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xddee('0x1'));var rp=require('request-promise');var moment=require(_0xddee('0x2'));var BPromise=require(_0xddee('0x3'));var Mustache=require('mustache');var util=require(_0xddee('0x4'));var path=require(_0xddee('0x5'));var sox=require(_0xddee('0x6'));var csv=require(_0xddee('0x7'));var ejs=require(_0xddee('0x8'));var fs=require('fs');var fs_extra=require(_0xddee('0x9'));var _=require(_0xddee('0xa'));var squel=require(_0xddee('0xb'));var crypto=require('crypto');var jsforce=require(_0xddee('0xc'));var deskjs=require(_0xddee('0xd'));var toCsv=require(_0xddee('0x7'));var querystring=require(_0xddee('0xe'));var Papa=require(_0xddee('0xf'));var Redis=require(_0xddee('0x10'));var authService=require(_0xddee('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xddee('0x12'));var hardwareService=require(_0xddee('0x13'));var logger=require(_0xddee('0x14'))('api');var utils=require(_0xddee('0x15'));var config=require(_0xddee('0x16'));var licenseUtil=require(_0xddee('0x17'));var db=require(_0xddee('0x18'))['db'];function respondWithStatusCode(_0x2f8389,_0x197a06){_0x197a06=_0x197a06||0xcc;return function(_0x40c0bd){if(_0x40c0bd){return _0x2f8389[_0xddee('0x19')](_0x197a06);}return _0x2f8389['status'](_0x197a06)[_0xddee('0x1a')]();};}function respondWithResult(_0x20135e,_0x123427){_0x123427=_0x123427||0xc8;return function(_0x8446bc){if(_0x8446bc){return _0x20135e['status'](_0x123427)[_0xddee('0x1b')](_0x8446bc);}};}function respondWithFilteredResult(_0x1f97f4,_0x5718a0){return function(_0x377d00){if(_0x377d00){var _0x240b26=typeof _0x5718a0[_0xddee('0x1c')]===_0xddee('0x1d')&&typeof _0x5718a0[_0xddee('0x1e')]===_0xddee('0x1d');var _0xe51095=_0x377d00[_0xddee('0x1f')];var _0x2032ee=_0x240b26?0x0:_0x5718a0[_0xddee('0x1c')];var _0x1fd203=_0x240b26?_0x377d00[_0xddee('0x1f')]:_0x5718a0[_0xddee('0x1c')]+_0x5718a0[_0xddee('0x1e')];var _0x4d12de;if(_0x1fd203>=_0xe51095){_0x1fd203=_0xe51095;_0x4d12de=0xc8;}else{_0x4d12de=0xce;}_0x1f97f4['status'](_0x4d12de);return _0x1f97f4[_0xddee('0x20')](_0xddee('0x21'),_0x2032ee+'-'+_0x1fd203+'/'+_0xe51095)['json'](_0x377d00);}return null;};}function patchUpdates(_0x32e1a9){return function(_0x30f523){try{jsonpatch[_0xddee('0x22')](_0x30f523,_0x32e1a9,!![]);}catch(_0x47326f){return BPromise['reject'](_0x47326f);}return _0x30f523[_0xddee('0x23')]();};}function saveUpdates(_0x40b618,_0x19b4b4){return function(_0x4b14a4){if(_0x4b14a4){return _0x4b14a4[_0xddee('0x24')](_0x40b618)[_0xddee('0x25')](function(_0x2246a3){return _0x2246a3;});}return null;};}function removeEntity(_0x3c5cd8,_0x278cef){return function(_0x513341){if(_0x513341){return _0x513341[_0xddee('0x26')]()['then'](function(){var _0x1d8772=_0x513341[_0xddee('0x27')]({'plain':!![]});var _0x27e215=_0xddee('0x28');return db[_0xddee('0x29')]['destroy']({'where':{'type':_0x27e215,'resourceId':_0x1d8772['id']}})[_0xddee('0x25')](function(){return _0x513341;});})[_0xddee('0x25')](function(){_0x3c5cd8['status'](0xcc)[_0xddee('0x1a')]();});}};}function handleEntityNotFound(_0x4244c6,_0x38ca01){return function(_0xbb27e3){if(!_0xbb27e3){_0x4244c6['sendStatus'](0x194);}return _0xbb27e3;};}function handleError(_0x2d6920,_0x4377d4){_0x4377d4=_0x4377d4||0x1f4;return function(_0xb54903){logger['error'](_0xb54903[_0xddee('0x2a')]);if(_0xb54903['name']){delete _0xb54903[_0xddee('0x2b')];}_0x2d6920['status'](_0x4377d4)[_0xddee('0x2c')](_0xb54903);};}exports[_0xddee('0x2d')]=function(_0x38792d,_0x53c97d){var _0x4dad3d={},_0x1374a8={},_0x5220ee={'count':0x0,'rows':[]};var _0x4f6f33=_[_0xddee('0x2e')](db['CmHopperAdditionalPhone'][_0xddee('0x2f')],function(_0x4f06de){return{'name':_0x4f06de['fieldName'],'type':_0x4f06de[_0xddee('0x30')]['key']};});_0x1374a8[_0xddee('0x31')]=_[_0xddee('0x2e')](_0x4f6f33,'name');_0x1374a8['query']=_[_0xddee('0x32')](_0x38792d['query']);_0x1374a8[_0xddee('0x33')]=_[_0xddee('0x34')](_0x1374a8[_0xddee('0x31')],_0x1374a8[_0xddee('0x35')]);_0x4dad3d[_0xddee('0x36')]=_[_0xddee('0x34')](_0x1374a8[_0xddee('0x31')],qs['fields'](_0x38792d[_0xddee('0x35')][_0xddee('0x37')]));_0x4dad3d[_0xddee('0x36')]=_0x4dad3d['attributes'][_0xddee('0x38')]?_0x4dad3d[_0xddee('0x36')]:_0x1374a8['model'];if(!_0x38792d[_0xddee('0x35')][_0xddee('0x39')](_0xddee('0x3a'))){_0x4dad3d['limit']=qs[_0xddee('0x1e')](_0x38792d['query'][_0xddee('0x1e')]);_0x4dad3d['offset']=qs[_0xddee('0x1c')](_0x38792d['query']['offset']);}_0x4dad3d[_0xddee('0x3b')]=qs['sort'](_0x38792d[_0xddee('0x35')][_0xddee('0x3c')]);_0x4dad3d[_0xddee('0x3d')]=qs[_0xddee('0x33')](_['pick'](_0x38792d[_0xddee('0x35')],_0x1374a8[_0xddee('0x33')]),_0x4f6f33);if(_0x38792d[_0xddee('0x35')][_0xddee('0x3e')]){_0x4dad3d[_0xddee('0x3d')]=_[_0xddee('0x3f')](_0x4dad3d[_0xddee('0x3d')],{'$or':_[_0xddee('0x2e')](_0x4f6f33,function(_0x24760a){if(_0x24760a[_0xddee('0x30')]!=='VIRTUAL'){var _0x2b42d6={};_0x2b42d6[_0x24760a[_0xddee('0x2b')]]={'$like':'%'+_0x38792d[_0xddee('0x35')]['filter']+'%'};return _0x2b42d6;}})});}_0x4dad3d=_[_0xddee('0x3f')]({},_0x4dad3d,_0x38792d[_0xddee('0x40')]);var _0x4807d0={'where':_0x4dad3d['where']};return db[_0xddee('0x41')][_0xddee('0x1f')](_0x4807d0)[_0xddee('0x25')](function(_0x42431c){_0x5220ee[_0xddee('0x1f')]=_0x42431c;if(_0x38792d[_0xddee('0x35')][_0xddee('0x42')]){_0x4dad3d['include']=[{'all':!![]}];}return db[_0xddee('0x41')][_0xddee('0x43')](_0x4dad3d);})[_0xddee('0x25')](function(_0x49b1e9){_0x5220ee['rows']=_0x49b1e9;return _0x5220ee;})[_0xddee('0x25')](respondWithFilteredResult(_0x53c97d,_0x4dad3d))[_0xddee('0x44')](handleError(_0x53c97d,null));};exports[_0xddee('0x45')]=function(_0x1ac425,_0xced781){var _0x53e017={'raw':!![],'where':{'id':_0x1ac425[_0xddee('0x46')]['id']}},_0x44d83d={};_0x44d83d[_0xddee('0x31')]=_[_0xddee('0x32')](db[_0xddee('0x41')]['rawAttributes']);_0x44d83d[_0xddee('0x35')]=_[_0xddee('0x32')](_0x1ac425[_0xddee('0x35')]);_0x44d83d[_0xddee('0x33')]=_[_0xddee('0x34')](_0x44d83d[_0xddee('0x31')],_0x44d83d[_0xddee('0x35')]);_0x53e017[_0xddee('0x36')]=_[_0xddee('0x34')](_0x44d83d[_0xddee('0x31')],qs[_0xddee('0x37')](_0x1ac425[_0xddee('0x35')]['fields']));_0x53e017[_0xddee('0x36')]=_0x53e017[_0xddee('0x36')][_0xddee('0x38')]?_0x53e017[_0xddee('0x36')]:_0x44d83d[_0xddee('0x31')];if(_0x1ac425['query'][_0xddee('0x42')]){_0x53e017[_0xddee('0x47')]=[{'all':!![]}];}_0x53e017=_['merge']({},_0x53e017,_0x1ac425[_0xddee('0x40')]);return db['CmHopperAdditionalPhone'][_0xddee('0x48')](_0x53e017)[_0xddee('0x25')](handleEntityNotFound(_0xced781,null))['then'](respondWithResult(_0xced781,null))['catch'](handleError(_0xced781,null));};exports['create']=function(_0x5f42f8,_0x2f4194){return db['CmHopperAdditionalPhone'][_0xddee('0x49')](_0x5f42f8[_0xddee('0x4a')],{})[_0xddee('0x25')](function(_0x78b691){var _0x37cb20=_0x5f42f8[_0xddee('0x4b')][_0xddee('0x27')]({'plain':!![]});if(!_0x37cb20)throw new Error(_0xddee('0x4c'));if(_0x37cb20[_0xddee('0x4d')]===_0xddee('0x4b')){var _0x46a0f0=_0x78b691[_0xddee('0x27')]({'plain':!![]});var _0x28caf8=_0xddee('0x28');return db[_0xddee('0x4e')]['find']({'where':{'name':_0x28caf8,'userProfileId':_0x37cb20[_0xddee('0x4f')]},'raw':!![]})[_0xddee('0x25')](function(_0x202f71){if(_0x202f71&&_0x202f71[_0xddee('0x50')]===0x0){return db[_0xddee('0x29')][_0xddee('0x49')]({'name':_0x46a0f0['name'],'resourceId':_0x46a0f0['id'],'type':_0x202f71[_0xddee('0x2b')],'sectionId':_0x202f71['id']},{})[_0xddee('0x25')](function(){return _0x78b691;});}else{return _0x78b691;}})[_0xddee('0x44')](function(_0x2ea700){logger[_0xddee('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ea700);throw _0x2ea700;});}return _0x78b691;})[_0xddee('0x25')](respondWithResult(_0x2f4194,0xc9))[_0xddee('0x44')](handleError(_0x2f4194,null));};exports[_0xddee('0x24')]=function(_0x4d29ce,_0x13bbf0){if(_0x4d29ce[_0xddee('0x4a')]['id']){delete _0x4d29ce[_0xddee('0x4a')]['id'];}return db[_0xddee('0x41')][_0xddee('0x48')]({'where':{'id':_0x4d29ce[_0xddee('0x46')]['id']}})[_0xddee('0x25')](handleEntityNotFound(_0x13bbf0,null))[_0xddee('0x25')](saveUpdates(_0x4d29ce[_0xddee('0x4a')],null))[_0xddee('0x25')](respondWithResult(_0x13bbf0,null))['catch'](handleError(_0x13bbf0,null));};exports[_0xddee('0x26')]=function(_0x5f3371,_0x325f4e){return db[_0xddee('0x41')][_0xddee('0x48')]({'where':{'id':_0x5f3371[_0xddee('0x46')]['id']}})[_0xddee('0x25')](handleEntityNotFound(_0x325f4e,null))['then'](removeEntity(_0x325f4e,null))[_0xddee('0x44')](handleError(_0x325f4e,null));}; \ No newline at end of file +var _0x92e9=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','CmHopperAdditionalPhones','then','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x4ca43b,_0xa6e25b){var _0x545dcd=function(_0x4de21b){while(--_0x4de21b){_0x4ca43b['push'](_0x4ca43b['shift']());}};_0x545dcd(++_0xa6e25b);}(_0x92e9,0x153));var _0x992e=function(_0x290f02,_0x398a69){_0x290f02=_0x290f02-0x0;var _0xa2773a=_0x92e9[_0x290f02];return _0xa2773a;};'use strict';var emlformat=require(_0x992e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x992e('0x1'));var rp=require(_0x992e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x992e('0x3'));var util=require(_0x992e('0x4'));var path=require(_0x992e('0x5'));var sox=require(_0x992e('0x6'));var csv=require(_0x992e('0x7'));var ejs=require(_0x992e('0x8'));var fs=require('fs');var fs_extra=require(_0x992e('0x9'));var _=require(_0x992e('0xa'));var squel=require(_0x992e('0xb'));var crypto=require(_0x992e('0xc'));var jsforce=require(_0x992e('0xd'));var deskjs=require(_0x992e('0xe'));var toCsv=require(_0x992e('0x7'));var querystring=require(_0x992e('0xf'));var Papa=require(_0x992e('0x10'));var Redis=require(_0x992e('0x11'));var authService=require(_0x992e('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x992e('0x13'));var logger=require(_0x992e('0x14'))(_0x992e('0x15'));var utils=require('../../config/utils');var config=require(_0x992e('0x16'));var licenseUtil=require(_0x992e('0x17'));var db=require(_0x992e('0x18'))['db'];function respondWithStatusCode(_0x380c24,_0x22167f){_0x22167f=_0x22167f||0xcc;return function(_0x3984a7){if(_0x3984a7){return _0x380c24[_0x992e('0x19')](_0x22167f);}return _0x380c24[_0x992e('0x1a')](_0x22167f)[_0x992e('0x1b')]();};}function respondWithResult(_0x2472e0,_0x20cce4){_0x20cce4=_0x20cce4||0xc8;return function(_0x317f8a){if(_0x317f8a){return _0x2472e0[_0x992e('0x1a')](_0x20cce4)[_0x992e('0x1c')](_0x317f8a);}};}function respondWithFilteredResult(_0x1baf04,_0x4557c0){return function(_0x2fa388){if(_0x2fa388){var _0xbf4f0a=typeof _0x4557c0['offset']==='undefined'&&typeof _0x4557c0[_0x992e('0x1d')]===_0x992e('0x1e');var _0x701185=_0x2fa388[_0x992e('0x1f')];var _0x1dbc21=_0xbf4f0a?0x0:_0x4557c0[_0x992e('0x20')];var _0x4f801a=_0xbf4f0a?_0x2fa388['count']:_0x4557c0['offset']+_0x4557c0[_0x992e('0x1d')];var _0x1b58c8;if(_0x4f801a>=_0x701185){_0x4f801a=_0x701185;_0x1b58c8=0xc8;}else{_0x1b58c8=0xce;}_0x1baf04[_0x992e('0x1a')](_0x1b58c8);return _0x1baf04[_0x992e('0x21')](_0x992e('0x22'),_0x1dbc21+'-'+_0x4f801a+'/'+_0x701185)[_0x992e('0x1c')](_0x2fa388);}return null;};}function patchUpdates(_0x124a7b){return function(_0x594290){try{jsonpatch[_0x992e('0x23')](_0x594290,_0x124a7b,!![]);}catch(_0x448109){return BPromise[_0x992e('0x24')](_0x448109);}return _0x594290[_0x992e('0x25')]();};}function saveUpdates(_0x3e61f0,_0x419943){return function(_0x337d9f){if(_0x337d9f){return _0x337d9f[_0x992e('0x26')](_0x3e61f0)['then'](function(_0x50fc01){return _0x50fc01;});}return null;};}function removeEntity(_0x1618ac,_0x300f0a){return function(_0x19e761){if(_0x19e761){return _0x19e761[_0x992e('0x27')]()['then'](function(){var _0x3c7c61=_0x19e761[_0x992e('0x28')]({'plain':!![]});var _0x1c31f4=_0x992e('0x29');return db['UserProfileResource'][_0x992e('0x27')]({'where':{'type':_0x1c31f4,'resourceId':_0x3c7c61['id']}})[_0x992e('0x2a')](function(){return _0x19e761;});})[_0x992e('0x2a')](function(){_0x1618ac['status'](0xcc)[_0x992e('0x1b')]();});}};}function handleEntityNotFound(_0x5990b7,_0x2b8d22){return function(_0x294918){if(!_0x294918){_0x5990b7[_0x992e('0x19')](0x194);}return _0x294918;};}function handleError(_0x39e892,_0x174bc3){_0x174bc3=_0x174bc3||0x1f4;return function(_0x1ebab4){logger[_0x992e('0x2b')](_0x1ebab4[_0x992e('0x2c')]);if(_0x1ebab4['name']){delete _0x1ebab4[_0x992e('0x2d')];}_0x39e892[_0x992e('0x1a')](_0x174bc3)[_0x992e('0x2e')](_0x1ebab4);};}exports[_0x992e('0x2f')]=function(_0x32f0ad,_0x260b08){var _0x356e61={},_0x4a1c71={},_0x1d79fb={'count':0x0,'rows':[]};var _0x40a56b=_[_0x992e('0x30')](db[_0x992e('0x31')][_0x992e('0x32')],function(_0x12d2a8){return{'name':_0x12d2a8['fieldName'],'type':_0x12d2a8[_0x992e('0x33')][_0x992e('0x34')]};});_0x4a1c71['model']=_[_0x992e('0x30')](_0x40a56b,_0x992e('0x2d'));_0x4a1c71[_0x992e('0x35')]=_[_0x992e('0x36')](_0x32f0ad[_0x992e('0x35')]);_0x4a1c71[_0x992e('0x37')]=_['intersection'](_0x4a1c71[_0x992e('0x38')],_0x4a1c71[_0x992e('0x35')]);_0x356e61[_0x992e('0x39')]=_[_0x992e('0x3a')](_0x4a1c71['model'],qs[_0x992e('0x3b')](_0x32f0ad['query'][_0x992e('0x3b')]));_0x356e61[_0x992e('0x39')]=_0x356e61[_0x992e('0x39')][_0x992e('0x3c')]?_0x356e61[_0x992e('0x39')]:_0x4a1c71[_0x992e('0x38')];if(!_0x32f0ad[_0x992e('0x35')][_0x992e('0x3d')](_0x992e('0x3e'))){_0x356e61[_0x992e('0x1d')]=qs['limit'](_0x32f0ad[_0x992e('0x35')][_0x992e('0x1d')]);_0x356e61['offset']=qs[_0x992e('0x20')](_0x32f0ad['query'][_0x992e('0x20')]);}_0x356e61[_0x992e('0x3f')]=qs['sort'](_0x32f0ad[_0x992e('0x35')][_0x992e('0x40')]);_0x356e61[_0x992e('0x41')]=qs[_0x992e('0x37')](_['pick'](_0x32f0ad[_0x992e('0x35')],_0x4a1c71['filters']),_0x40a56b);if(_0x32f0ad[_0x992e('0x35')][_0x992e('0x42')]){_0x356e61[_0x992e('0x41')]=_[_0x992e('0x43')](_0x356e61[_0x992e('0x41')],{'$or':_[_0x992e('0x30')](_0x40a56b,function(_0x183cae){if(_0x183cae[_0x992e('0x33')]!==_0x992e('0x44')){var _0x9b0e5e={};_0x9b0e5e[_0x183cae[_0x992e('0x2d')]]={'$like':'%'+_0x32f0ad[_0x992e('0x35')][_0x992e('0x42')]+'%'};return _0x9b0e5e;}})});}_0x356e61=_['merge']({},_0x356e61,_0x32f0ad[_0x992e('0x45')]);var _0x1f9831={'where':_0x356e61[_0x992e('0x41')]};return db[_0x992e('0x31')][_0x992e('0x1f')](_0x1f9831)[_0x992e('0x2a')](function(_0x2635e8){_0x1d79fb['count']=_0x2635e8;if(_0x32f0ad[_0x992e('0x35')][_0x992e('0x46')]){_0x356e61['include']=[{'all':!![]}];}return db[_0x992e('0x31')][_0x992e('0x47')](_0x356e61);})['then'](function(_0x1b393a){_0x1d79fb[_0x992e('0x48')]=_0x1b393a;return _0x1d79fb;})[_0x992e('0x2a')](respondWithFilteredResult(_0x260b08,_0x356e61))[_0x992e('0x49')](handleError(_0x260b08,null));};exports[_0x992e('0x4a')]=function(_0x2584d5,_0x4ef473){var _0x2293ad={'raw':!![],'where':{'id':_0x2584d5[_0x992e('0x4b')]['id']}},_0x259533={};_0x259533[_0x992e('0x38')]=_[_0x992e('0x36')](db[_0x992e('0x31')]['rawAttributes']);_0x259533['query']=_['keys'](_0x2584d5['query']);_0x259533[_0x992e('0x37')]=_[_0x992e('0x3a')](_0x259533[_0x992e('0x38')],_0x259533[_0x992e('0x35')]);_0x2293ad['attributes']=_['intersection'](_0x259533['model'],qs[_0x992e('0x3b')](_0x2584d5['query']['fields']));_0x2293ad['attributes']=_0x2293ad[_0x992e('0x39')][_0x992e('0x3c')]?_0x2293ad['attributes']:_0x259533[_0x992e('0x38')];if(_0x2584d5[_0x992e('0x35')]['includeAll']){_0x2293ad[_0x992e('0x4c')]=[{'all':!![]}];}_0x2293ad=_[_0x992e('0x43')]({},_0x2293ad,_0x2584d5[_0x992e('0x45')]);return db[_0x992e('0x31')][_0x992e('0x4d')](_0x2293ad)[_0x992e('0x2a')](handleEntityNotFound(_0x4ef473,null))[_0x992e('0x2a')](respondWithResult(_0x4ef473,null))[_0x992e('0x49')](handleError(_0x4ef473,null));};exports[_0x992e('0x4e')]=function(_0x4cd412,_0x16fc99){return db['CmHopperAdditionalPhone'][_0x992e('0x4e')](_0x4cd412[_0x992e('0x4f')],{})[_0x992e('0x2a')](function(_0x24fd11){var _0x197adc=_0x4cd412['user'][_0x992e('0x28')]({'plain':!![]});if(!_0x197adc)throw new Error(_0x992e('0x50'));if(_0x197adc[_0x992e('0x51')]===_0x992e('0x52')){var _0x5468ed=_0x24fd11[_0x992e('0x28')]({'plain':!![]});var _0x1c440f='CmHopperAdditionalPhones';return db[_0x992e('0x53')][_0x992e('0x4d')]({'where':{'name':_0x1c440f,'userProfileId':_0x197adc[_0x992e('0x54')]},'raw':!![]})[_0x992e('0x2a')](function(_0x2476b3){if(_0x2476b3&&_0x2476b3[_0x992e('0x55')]===0x0){return db[_0x992e('0x56')][_0x992e('0x4e')]({'name':_0x5468ed['name'],'resourceId':_0x5468ed['id'],'type':_0x2476b3[_0x992e('0x2d')],'sectionId':_0x2476b3['id']},{})[_0x992e('0x2a')](function(){return _0x24fd11;});}else{return _0x24fd11;}})['catch'](function(_0x2c3653){logger[_0x992e('0x2b')](_0x992e('0x57'),_0x2c3653);throw _0x2c3653;});}return _0x24fd11;})[_0x992e('0x2a')](respondWithResult(_0x16fc99,0xc9))[_0x992e('0x49')](handleError(_0x16fc99,null));};exports[_0x992e('0x26')]=function(_0x308c31,_0x344cbd){if(_0x308c31['body']['id']){delete _0x308c31['body']['id'];}return db['CmHopperAdditionalPhone'][_0x992e('0x4d')]({'where':{'id':_0x308c31['params']['id']}})[_0x992e('0x2a')](handleEntityNotFound(_0x344cbd,null))[_0x992e('0x2a')](saveUpdates(_0x308c31[_0x992e('0x4f')],null))[_0x992e('0x2a')](respondWithResult(_0x344cbd,null))[_0x992e('0x49')](handleError(_0x344cbd,null));};exports['destroy']=function(_0x48113d,_0x43075d){return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x48113d[_0x992e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x43075d,null))[_0x992e('0x2a')](removeEntity(_0x43075d,null))[_0x992e('0x49')](handleError(_0x43075d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index d3b6cf1..5579704 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x081c=['path','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x081c,0x17a));var _0xc081=function(_0x5a75e7,_0x3ad506){_0x5a75e7=_0x5a75e7-0x0;var _0x15c695=_0x081c[_0x5a75e7];return _0x15c695;};'use strict';var _=require(_0xc081('0x0'));var util=require(_0xc081('0x1'));var logger=require(_0xc081('0x2'))(_0xc081('0x3'));var moment=require('moment');var BPromise=require(_0xc081('0x4'));var rp=require(_0xc081('0x5'));var fs=require('fs');var path=require(_0xc081('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc081('0x7'));module[_0xc081('0x8')]=function(_0x19b440,_0x1a367c){return _0x19b440[_0xc081('0x9')](_0xc081('0xa'),attributes,{'tableName':_0xc081('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c1c=['./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x58df44,_0x5643cc){var _0x47271c=function(_0x1c07f6){while(--_0x1c07f6){_0x58df44['push'](_0x58df44['shift']());}};_0x47271c(++_0x5643cc);}(_0x0c1c,0x10d));var _0xc0c1=function(_0x3337b6,_0x42c7f9){_0x3337b6=_0x3337b6-0x0;var _0x568270=_0x0c1c[_0x3337b6];return _0x568270;};'use strict';var _=require(_0xc0c1('0x0'));var util=require(_0xc0c1('0x1'));var logger=require('../../config/logger')(_0xc0c1('0x2'));var moment=require(_0xc0c1('0x3'));var BPromise=require(_0xc0c1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc0c1('0x5'));var config=require(_0xc0c1('0x6'));var attributes=require(_0xc0c1('0x7'));module[_0xc0c1('0x8')]=function(_0x39c4fc,_0x538533){return _0x39c4fc[_0xc0c1('0x9')](_0xc0c1('0xa'),attributes,{'tableName':_0xc0c1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 63c9a25..696a13b 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2148=['duration','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize','transaction','update','IncrementPreviewCounters','field','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopper','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','findOne','ASC','countbusyretry','countcongestionretry','countabandonedretry','countmachineretry','entity','VerifyAdditionalPhones','ContactId','waitTime'];(function(_0xee4e7c,_0x20c913){var _0x2871f6=function(_0x5770a6){while(--_0x5770a6){_0xee4e7c['push'](_0xee4e7c['shift']());}};_0x2871f6(++_0x20c913);}(_0x2148,0x1d5));var _0x8214=function(_0x3d27a,_0x31311d){_0x3d27a=_0x3d27a-0x0;var _0x314fd7=_0x2148[_0x3d27a];return _0x314fd7;};'use strict';var _=require('lodash');var util=require(_0x8214('0x0'));var moment=require(_0x8214('0x1'));var BPromise=require('bluebird');var rs=require(_0x8214('0x2'));var fs=require('fs');var Redis=require(_0x8214('0x3'));var db=require(_0x8214('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8214('0x5'))(_0x8214('0x6'));var config=require(_0x8214('0x7'));var jayson=require(_0x8214('0x8'));var client=jayson[_0x8214('0x9')][_0x8214('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e6448,_0x13628a,_0x4dface){return new BPromise(function(_0x1a6be9,_0x3c8269){return client[_0x8214('0xb')](_0x4e6448,_0x4dface)[_0x8214('0xc')](function(_0x38e909){logger['info'](_0x8214('0xd'),_0x13628a,_0x8214('0xe'));logger['debug'](_0x8214('0xf'),_0x13628a,_0x8214('0xe'),JSON[_0x8214('0x10')](_0x38e909));if(_0x38e909['error']){if(_0x38e909[_0x8214('0x11')][_0x8214('0x12')]===0x1f4){logger[_0x8214('0x11')](_0x8214('0xd'),_0x13628a,_0x38e909[_0x8214('0x11')][_0x8214('0x13')]);return _0x3c8269(_0x38e909[_0x8214('0x11')]['message']);}logger[_0x8214('0x11')](_0x8214('0xd'),_0x13628a,_0x38e909[_0x8214('0x11')][_0x8214('0x13')]);return _0x1a6be9(_0x38e909[_0x8214('0x11')][_0x8214('0x13')]);}else{logger['info'](_0x8214('0xd'),_0x13628a,_0x8214('0xe'));_0x1a6be9(_0x38e909[_0x8214('0x14')]['message']);}})[_0x8214('0x15')](function(_0x367057){logger[_0x8214('0x11')](_0x8214('0xd'),_0x13628a,_0x367057);_0x3c8269(_0x367057);});});}exports['VerifyAdditionalPhones']=function(_0x4d1864){var _0x23ded3=this;return new Promise(function(_0x3d3b7f,_0x374d3d){return db[_0x8214('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x4d1864[_0x8214('0x17')]['ContactId'],'ListId':_0x4d1864[_0x8214('0x17')][_0x8214('0x18')],'VoiceQueueId':_0x4d1864['body']['VoiceQueueId']===undefined?null:_0x4d1864[_0x8214('0x17')][_0x8214('0x19')],'CampaignId':_0x4d1864['body'][_0x8214('0x1a')]===undefined?null:_0x4d1864[_0x8214('0x17')][_0x8214('0x1a')]}})[_0x8214('0xc')](function(_0x5933cc){if(_0x5933cc!=null){return db[_0x8214('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x5933cc['id'],'OrderBy':{'$gt':_0x5933cc['OrderBy']}},'order':[[_0x8214('0x1c'),'ASC']]})[_0x8214('0xc')](function(_0x21fc32){var _0xc2b46c=0x0;if(_0x21fc32){if(_0x21fc32['countbusyretry']+_0x21fc32['countcongestionretry']+_0x21fc32[_0x8214('0x1d')]+_0x21fc32[_0x8214('0x1e')]+_0x21fc32[_0x8214('0x1f')]+_0x21fc32['countabandonedretry']+_0x21fc32['countmachineretry']+_0x21fc32[_0x8214('0x20')]<_0x4d1864['entity'][_0x8214('0x21')])_0xc2b46c=0x1;_0x3d3b7f({'additional':_0xc2b46c});}else{return db[_0x8214('0x1b')][_0x8214('0x22')]({'raw':!![],'where':{'CmHopperId':_0x5933cc['id']},'order':[[_0x8214('0x1c'),_0x8214('0x23')]]})['then'](function(_0x14e97e){var _0x3ac788=0x0;if(_0x14e97e){if(_0x14e97e[_0x8214('0x24')]+_0x14e97e[_0x8214('0x25')]+_0x14e97e['countnoanswerretry']+_0x14e97e[_0x8214('0x1e')]+_0x14e97e['countdropretry']+_0x14e97e[_0x8214('0x26')]+_0x14e97e[_0x8214('0x27')]+_0x14e97e['countagentrejectretry']<_0x4d1864[_0x8214('0x28')][_0x8214('0x21')])_0x3ac788=0x1;_0x3d3b7f({'additional':_0x3ac788});}else{_0x3d3b7f({'additional':0x0});}})[_0x8214('0x15')](function(_0x342d23){logger['error'](_0x8214('0x29'),_0x342d23[_0x8214('0x13')]);_0x374d3d(_0x23ded3[_0x8214('0x11')](0x1f4,_0x342d23[_0x8214('0x13')]));});}})[_0x8214('0x15')](function(_0x12555c){logger[_0x8214('0x11')](_0x8214('0x29'),_0x12555c[_0x8214('0x13')]);_0x374d3d(_0x23ded3[_0x8214('0x11')](0x1f4,_0x12555c[_0x8214('0x13')]));});}else _0x3d3b7f({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x287762){var _0x1325f3=this;return new Promise(function(_0x27ebd5,_0x13003e){return db[_0x8214('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x287762[_0x8214('0x17')][_0x8214('0x2a')],'ListId':_0x287762['body'][_0x8214('0x18')],'VoiceQueueId':_0x287762[_0x8214('0x17')]['VoiceQueueId']===undefined?null:_0x287762[_0x8214('0x17')][_0x8214('0x19')],'CampaignId':_0x287762[_0x8214('0x17')][_0x8214('0x1a')]===undefined?null:_0x287762[_0x8214('0x17')][_0x8214('0x1a')]}})[_0x8214('0xc')](function(_0x193d35){if(_0x193d35!=null){return db[_0x8214('0x1b')][_0x8214('0x22')]({'raw':!![],'where':{'CmHopperId':_0x193d35['id'],'OrderBy':{'$gte':_0x193d35['OrderBy']}},'order':[[_0x8214('0x1c'),_0x8214('0x23')]]})['then'](function(_0x245dd9){if(_0x245dd9)return activateAdditionalPhone(_0x193d35,_0x287762['body'],_0x245dd9,_0x287762['duration'],_0x287762[_0x8214('0x2b')])[_0x8214('0xc')](function(_0x3c2bb6){_0x27ebd5(_0x3c2bb6);});else{return db[_0x8214('0x1b')][_0x8214('0x22')]({'raw':!![],'where':{'CmHopperId':_0x193d35['id']},'order':[[_0x8214('0x1c'),_0x8214('0x23')]]})[_0x8214('0xc')](function(_0x33b5e0){if(_0x33b5e0)return activateAdditionalPhone(_0x193d35,_0x287762[_0x8214('0x17')],_0x33b5e0,_0x287762[_0x8214('0x2c')],_0x287762[_0x8214('0x2b')])[_0x8214('0xc')](function(_0xe340ee){_0x27ebd5(_0xe340ee);});else{_0x27ebd5({'id':_0x193d35['id'],'phone':''});}})[_0x8214('0x15')](function(_0x40edac){logger['error']('VerifyAdditionalPhones',_0x40edac['message']);_0x13003e(_0x1325f3[_0x8214('0x11')](0x1f4,_0x40edac['message']));});}})[_0x8214('0x15')](function(_0x37d3a5){logger[_0x8214('0x11')]('VerifyAdditionalPhones',_0x37d3a5[_0x8214('0x13')]);_0x13003e(_0x1325f3[_0x8214('0x11')](0x1f4,_0x37d3a5[_0x8214('0x13')]));});}else _0x27ebd5(0x1);});});};function activateAdditionalPhone(_0x259c28,_0xed6b71,_0x102bb8,_0x20630,_0x327809){return new Promise(function(_0x46d648,_0x5b9907){var _0x6938d6;if(_[_0x8214('0x2d')](_0x102bb8[_0x8214('0x2e')])){_0x102bb8[_0x8214('0x2e')]=moment();}if(moment()>moment(_0x102bb8[_0x8214('0x2e')])){_0x6938d6=moment()[_0x8214('0x2f')](_0x327809||0x3,_0x8214('0x30'));}else{if(_0x102bb8[_0x8214('0x1c')]==0x0){_0x6938d6=moment(_0x102bb8[_0x8214('0x2e')]);}else{_0x6938d6=moment()['add'](_0x327809||0x3,_0x8214('0x30'));}}if(_[_0x8214('0x2d')](_0x6938d6)){_0x6938d6=moment()[_0x8214('0x2f')](_0x327809||0x3,_0x8214('0x30'));}var _0x530072={'phone':_0x259c28[_0x8214('0x31')],'active':0x0,'OrderBy':_[_0x8214('0x2d')](_0x259c28[_0x8214('0x1c')])?0x0:_0x259c28[_0x8214('0x1c')],'scheduledat':moment()[_0x8214('0x2f')](_0x20630||0x1,_0x8214('0x30')),'countbusyretry':_0xed6b71[_0x8214('0x24')],'countcongestionretry':_0xed6b71[_0x8214('0x25')],'countnoanswerretry':_0xed6b71[_0x8214('0x1d')],'countnosuchnumberretry':_0xed6b71[_0x8214('0x1e')],'countdropretry':_0xed6b71['countdropretry'],'countabandonedretry':_0xed6b71[_0x8214('0x26')],'countmachineretry':_0xed6b71['countmachineretry'],'countagentrejectretry':_0xed6b71[_0x8214('0x20')],'createdAt':_0xed6b71[_0x8214('0x32')],'updatedAt':_0xed6b71[_0x8214('0x33')]};var _0x2b047d={'CmHopperId':_0x259c28['id'],'phone':_0x102bb8[_0x8214('0x31')],'active':0x0,'OrderBy':_['isNil'](_0x102bb8[_0x8214('0x1c')])?0x0:_0x102bb8['OrderBy'],'scheduledat':_0x6938d6,'countbusyretry':_0x102bb8[_0x8214('0x24')],'countcongestionretry':_0x102bb8[_0x8214('0x25')],'countnoanswerretry':_0x102bb8['countnoanswerretry'],'countnosuchnumberretry':_0x102bb8[_0x8214('0x1e')],'countdropretry':_0x102bb8[_0x8214('0x1f')],'countabandonedretry':_0x102bb8['countabandonedretry'],'countmachineretry':_0x102bb8[_0x8214('0x27')],'countagentrejectretry':_0x102bb8['countagentrejectretry'],'createdAt':_0x102bb8[_0x8214('0x32')],'updatedAt':_0x102bb8[_0x8214('0x33')]};return db[_0x8214('0x34')][_0x8214('0x35')](function(_0x2e1560){return db[_0x8214('0x1b')][_0x8214('0x36')](_0x530072,{'where':{'id':_0x102bb8['id']}},{'transaction':_0x2e1560})['then'](function(){return db[_0x8214('0x16')]['update'](_0x2b047d,{'where':{'id':_0x259c28['id']}},{'transaction':_0x2e1560});});})['then'](function(_0x4dd943){_0x46d648({'id':_0x259c28['id'],'phone':_0x102bb8[_0x8214('0x31')]});})['catch'](function(_0x1810a4){logger[_0x8214('0x11')]('activateAdditionalPhone',_0x1810a4[_0x8214('0x13')]);_0x5b9907({'error':_0x1810a4[_0x8214('0x13')]});});});}exports[_0x8214('0x37')]=function(_0x4fb420){var _0x16db93=this;return new Promise(function(_0x362741,_0x11f64f){return db['CmHopper']['update'](_0x4fb420['body'][_0x8214('0x38')],{'where':{'id':_0x4fb420[_0x8214('0x17')]['id']}})['then'](function(_0x29cadb){_0x362741(_0x29cadb);})[_0x8214('0x15')](function(_0x3b6577){logger['error']('IncrementPreviewCounters',_0x3b6577[_0x8214('0x13')]);_0x11f64f(_0x16db93[_0x8214('0x11')](0x1f4,_0x3b6577[_0x8214('0x13')]));});});}; \ No newline at end of file +var _0xd523=['message','result','catch','VerifyAdditionalPhones','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countabandonedretry','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','transaction','update','CmHopper','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0xd523,0x153));var _0x3d52=function(_0x30ef91,_0x51df94){_0x30ef91=_0x30ef91-0x0;var _0x4ac10a=_0xd523[_0x30ef91];return _0x4ac10a;};'use strict';var _=require(_0x3d52('0x0'));var util=require(_0x3d52('0x1'));var moment=require(_0x3d52('0x2'));var BPromise=require(_0x3d52('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d52('0x4'));var db=require(_0x3d52('0x5'))['db'];var utils=require(_0x3d52('0x6'));var logger=require('../../config/logger')(_0x3d52('0x7'));var config=require(_0x3d52('0x8'));var jayson=require(_0x3d52('0x9'));var client=jayson[_0x3d52('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fcc92,_0x189147,_0x2f3ebc){return new BPromise(function(_0x232bd4,_0x2e03c0){return client[_0x3d52('0xb')](_0x4fcc92,_0x2f3ebc)[_0x3d52('0xc')](function(_0x34c184){logger[_0x3d52('0xd')](_0x3d52('0xe'),_0x189147,'request\x20sent');logger[_0x3d52('0xf')](_0x3d52('0x10'),_0x189147,_0x3d52('0x11'),JSON[_0x3d52('0x12')](_0x34c184));if(_0x34c184[_0x3d52('0x13')]){if(_0x34c184['error'][_0x3d52('0x14')]===0x1f4){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x189147,_0x34c184[_0x3d52('0x13')][_0x3d52('0x15')]);return _0x2e03c0(_0x34c184['error']['message']);}logger['error'](_0x3d52('0xe'),_0x189147,_0x34c184[_0x3d52('0x13')][_0x3d52('0x15')]);return _0x232bd4(_0x34c184[_0x3d52('0x13')][_0x3d52('0x15')]);}else{logger[_0x3d52('0xd')](_0x3d52('0xe'),_0x189147,_0x3d52('0x11'));_0x232bd4(_0x34c184[_0x3d52('0x16')][_0x3d52('0x15')]);}})[_0x3d52('0x17')](function(_0x15cc02){logger[_0x3d52('0x13')](_0x3d52('0xe'),_0x189147,_0x15cc02);_0x2e03c0(_0x15cc02);});});}exports[_0x3d52('0x18')]=function(_0x5bce9a){var _0x163d88=this;return new Promise(function(_0x3b3451,_0x386cdb){return db['CmHopper'][_0x3d52('0x19')]({'raw':!![],'where':{'ContactId':_0x5bce9a[_0x3d52('0x1a')][_0x3d52('0x1b')],'ListId':_0x5bce9a['body'][_0x3d52('0x1c')],'VoiceQueueId':_0x5bce9a[_0x3d52('0x1a')][_0x3d52('0x1d')]===undefined?null:_0x5bce9a[_0x3d52('0x1a')][_0x3d52('0x1d')],'CampaignId':_0x5bce9a[_0x3d52('0x1a')][_0x3d52('0x1e')]===undefined?null:_0x5bce9a[_0x3d52('0x1a')]['CampaignId']}})[_0x3d52('0xc')](function(_0x10f432){if(_0x10f432!=null){return db[_0x3d52('0x1f')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x10f432['id'],'OrderBy':{'$gt':_0x10f432[_0x3d52('0x20')]}},'order':[[_0x3d52('0x20'),_0x3d52('0x21')]]})[_0x3d52('0xc')](function(_0x3816bc){var _0x349b30=0x0;if(_0x3816bc){if(_0x3816bc[_0x3d52('0x22')]+_0x3816bc[_0x3d52('0x23')]+_0x3816bc[_0x3d52('0x24')]+_0x3816bc[_0x3d52('0x25')]+_0x3816bc[_0x3d52('0x26')]+_0x3816bc['countabandonedretry']+_0x3816bc[_0x3d52('0x27')]+_0x3816bc[_0x3d52('0x28')]<_0x5bce9a[_0x3d52('0x29')][_0x3d52('0x2a')])_0x349b30=0x1;_0x3b3451({'additional':_0x349b30});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x10f432['id']},'order':[[_0x3d52('0x20'),_0x3d52('0x21')]]})[_0x3d52('0xc')](function(_0x5adddf){var _0x209cca=0x0;if(_0x5adddf){if(_0x5adddf[_0x3d52('0x22')]+_0x5adddf[_0x3d52('0x23')]+_0x5adddf[_0x3d52('0x24')]+_0x5adddf['countnosuchnumberretry']+_0x5adddf[_0x3d52('0x26')]+_0x5adddf[_0x3d52('0x2b')]+_0x5adddf[_0x3d52('0x27')]+_0x5adddf[_0x3d52('0x28')]<_0x5bce9a['entity'][_0x3d52('0x2a')])_0x209cca=0x1;_0x3b3451({'additional':_0x209cca});}else{_0x3b3451({'additional':0x0});}})['catch'](function(_0x5f006b){logger[_0x3d52('0x13')](_0x3d52('0x18'),_0x5f006b['message']);_0x386cdb(_0x163d88[_0x3d52('0x13')](0x1f4,_0x5f006b['message']));});}})[_0x3d52('0x17')](function(_0x4c0273){logger['error'](_0x3d52('0x18'),_0x4c0273[_0x3d52('0x15')]);_0x386cdb(_0x163d88[_0x3d52('0x13')](0x1f4,_0x4c0273[_0x3d52('0x15')]));});}else _0x3b3451({'additional':0x0});});});};exports[_0x3d52('0x2c')]=function(_0x453f96){var _0x32ed74=this;return new Promise(function(_0x203c3c,_0x26d1d8){return db['CmHopper'][_0x3d52('0x19')]({'raw':!![],'where':{'ContactId':_0x453f96[_0x3d52('0x1a')][_0x3d52('0x1b')],'ListId':_0x453f96[_0x3d52('0x1a')]['ListId'],'VoiceQueueId':_0x453f96[_0x3d52('0x1a')][_0x3d52('0x1d')]===undefined?null:_0x453f96['body'][_0x3d52('0x1d')],'CampaignId':_0x453f96['body'][_0x3d52('0x1e')]===undefined?null:_0x453f96[_0x3d52('0x1a')][_0x3d52('0x1e')]}})['then'](function(_0x2798a7){if(_0x2798a7!=null){return db['CmHopperAdditionalPhone'][_0x3d52('0x19')]({'raw':!![],'where':{'CmHopperId':_0x2798a7['id'],'OrderBy':{'$gte':_0x2798a7[_0x3d52('0x20')]}},'order':[[_0x3d52('0x20'),'ASC']]})['then'](function(_0x2eab67){if(_0x2eab67)return activateAdditionalPhone(_0x2798a7,_0x453f96[_0x3d52('0x1a')],_0x2eab67,_0x453f96[_0x3d52('0x2d')],_0x453f96['waitTime'])[_0x3d52('0xc')](function(_0x22262c){_0x203c3c(_0x22262c);});else{return db[_0x3d52('0x1f')][_0x3d52('0x19')]({'raw':!![],'where':{'CmHopperId':_0x2798a7['id']},'order':[['OrderBy',_0x3d52('0x21')]]})['then'](function(_0x563fe5){if(_0x563fe5)return activateAdditionalPhone(_0x2798a7,_0x453f96[_0x3d52('0x1a')],_0x563fe5,_0x453f96['duration'],_0x453f96[_0x3d52('0x2e')])['then'](function(_0x2099d3){_0x203c3c(_0x2099d3);});else{_0x203c3c({'id':_0x2798a7['id'],'phone':''});}})['catch'](function(_0x576562){logger[_0x3d52('0x13')](_0x3d52('0x18'),_0x576562['message']);_0x26d1d8(_0x32ed74[_0x3d52('0x13')](0x1f4,_0x576562[_0x3d52('0x15')]));});}})['catch'](function(_0xb8a0b2){logger[_0x3d52('0x13')](_0x3d52('0x18'),_0xb8a0b2[_0x3d52('0x15')]);_0x26d1d8(_0x32ed74[_0x3d52('0x13')](0x1f4,_0xb8a0b2[_0x3d52('0x15')]));});}else _0x203c3c(0x1);});});};function activateAdditionalPhone(_0x317a53,_0x5cf4b9,_0x5dfc8c,_0x4cfdeb,_0x4f2edd){return new Promise(function(_0x57a037,_0x4188cc){var _0x552e30;if(_[_0x3d52('0x2f')](_0x5dfc8c['scheduledat'])){_0x5dfc8c[_0x3d52('0x30')]=moment();}if(moment()>moment(_0x5dfc8c[_0x3d52('0x30')])){_0x552e30=moment()[_0x3d52('0x31')](_0x4f2edd||0x3,_0x3d52('0x32'));}else{if(_0x5dfc8c['OrderBy']==0x0){_0x552e30=moment(_0x5dfc8c[_0x3d52('0x30')]);}else{_0x552e30=moment()[_0x3d52('0x31')](_0x4f2edd||0x3,'minutes');}}if(_[_0x3d52('0x2f')](_0x552e30)){_0x552e30=moment()[_0x3d52('0x31')](_0x4f2edd||0x3,_0x3d52('0x32'));}var _0x54c279={'phone':_0x317a53[_0x3d52('0x33')],'active':0x0,'OrderBy':_['isNil'](_0x317a53['OrderBy'])?0x0:_0x317a53['OrderBy'],'scheduledat':moment()['add'](_0x4cfdeb||0x1,_0x3d52('0x32')),'countbusyretry':_0x5cf4b9[_0x3d52('0x22')],'countcongestionretry':_0x5cf4b9[_0x3d52('0x23')],'countnoanswerretry':_0x5cf4b9['countnoanswerretry'],'countnosuchnumberretry':_0x5cf4b9[_0x3d52('0x25')],'countdropretry':_0x5cf4b9['countdropretry'],'countabandonedretry':_0x5cf4b9[_0x3d52('0x2b')],'countmachineretry':_0x5cf4b9[_0x3d52('0x27')],'countagentrejectretry':_0x5cf4b9['countagentrejectretry'],'createdAt':_0x5cf4b9[_0x3d52('0x34')],'updatedAt':_0x5cf4b9[_0x3d52('0x35')]};var _0x405a90={'CmHopperId':_0x317a53['id'],'phone':_0x5dfc8c[_0x3d52('0x33')],'active':0x0,'OrderBy':_['isNil'](_0x5dfc8c['OrderBy'])?0x0:_0x5dfc8c[_0x3d52('0x20')],'scheduledat':_0x552e30,'countbusyretry':_0x5dfc8c['countbusyretry'],'countcongestionretry':_0x5dfc8c[_0x3d52('0x23')],'countnoanswerretry':_0x5dfc8c[_0x3d52('0x24')],'countnosuchnumberretry':_0x5dfc8c[_0x3d52('0x25')],'countdropretry':_0x5dfc8c[_0x3d52('0x26')],'countabandonedretry':_0x5dfc8c['countabandonedretry'],'countmachineretry':_0x5dfc8c[_0x3d52('0x27')],'countagentrejectretry':_0x5dfc8c['countagentrejectretry'],'createdAt':_0x5dfc8c[_0x3d52('0x34')],'updatedAt':_0x5dfc8c[_0x3d52('0x35')]};return db['sequelize'][_0x3d52('0x36')](function(_0x2c633c){return db[_0x3d52('0x1f')][_0x3d52('0x37')](_0x54c279,{'where':{'id':_0x5dfc8c['id']}},{'transaction':_0x2c633c})[_0x3d52('0xc')](function(){return db[_0x3d52('0x38')][_0x3d52('0x37')](_0x405a90,{'where':{'id':_0x317a53['id']}},{'transaction':_0x2c633c});});})[_0x3d52('0xc')](function(_0x3a01d9){_0x57a037({'id':_0x317a53['id'],'phone':_0x5dfc8c['phone']});})[_0x3d52('0x17')](function(_0x380699){logger['error'](_0x3d52('0x39'),_0x380699['message']);_0x4188cc({'error':_0x380699[_0x3d52('0x15')]});});});}exports[_0x3d52('0x3a')]=function(_0x3e53a5){var _0x47daa2=this;return new Promise(function(_0x2cb287,_0x1fd49c){return db['CmHopper']['update'](_0x3e53a5[_0x3d52('0x1a')][_0x3d52('0x3b')],{'where':{'id':_0x3e53a5['body']['id']}})[_0x3d52('0xc')](function(_0x146a5b){_0x2cb287(_0x146a5b);})[_0x3d52('0x17')](function(_0x376cb3){logger[_0x3d52('0x13')](_0x3d52('0x3a'),_0x376cb3['message']);_0x1fd49c(_0x47daa2[_0x3d52('0x13')](0x1f4,_0x376cb3[_0x3d52('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 2b7faec..fe8a85a 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c72=['/:id','create','put','update','delete','exports','multer','path','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x1c72,0xca));var _0x21c7=function(_0x201c2c,_0x5ac646){_0x201c2c=_0x201c2c-0x0;var _0x562261=_0x1c72[_0x201c2c];return _0x562261;};'use strict';var multer=require(_0x21c7('0x0'));var util=require('util');var path=require(_0x21c7('0x1'));var timeout=require('connect-timeout');var express=require(_0x21c7('0x2'));var router=express['Router']();var fs_extra=require(_0x21c7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x21c7('0x4'));var config=require('../../config/environment');var controller=require('./cmHopperAdditionalPhone.controller');router[_0x21c7('0x5')]('/',auth[_0x21c7('0x6')](),controller[_0x21c7('0x7')]);router['get'](_0x21c7('0x8'),auth[_0x21c7('0x6')](),controller['show']);router['post']('/',auth[_0x21c7('0x6')](),controller[_0x21c7('0x9')]);router[_0x21c7('0xa')](_0x21c7('0x8'),auth[_0x21c7('0x6')](),controller[_0x21c7('0xb')]);router[_0x21c7('0xc')](_0x21c7('0x8'),auth[_0x21c7('0x6')](),controller['destroy']);module[_0x21c7('0xd')]=router; \ No newline at end of file +var _0xad1b=['../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xad1b,0x1b0));var _0xbad1=function(_0x4d366b,_0x3b6ea1){_0x4d366b=_0x4d366b-0x0;var _0x113e2e=_0xad1b[_0x4d366b];return _0x113e2e;};'use strict';var multer=require(_0xbad1('0x0'));var util=require(_0xbad1('0x1'));var path=require(_0xbad1('0x2'));var timeout=require(_0xbad1('0x3'));var express=require(_0xbad1('0x4'));var router=express[_0xbad1('0x5')]();var fs_extra=require(_0xbad1('0x6'));var auth=require(_0xbad1('0x7'));var interaction=require(_0xbad1('0x8'));var config=require(_0xbad1('0x9'));var controller=require(_0xbad1('0xa'));router[_0xbad1('0xb')]('/',auth[_0xbad1('0xc')](),controller[_0xbad1('0xd')]);router[_0xbad1('0xb')](_0xbad1('0xe'),auth[_0xbad1('0xc')](),controller[_0xbad1('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbad1('0x10')]);router[_0xbad1('0x11')]('/:id',auth[_0xbad1('0xc')](),controller[_0xbad1('0x12')]);router[_0xbad1('0x13')](_0xbad1('0xe'),auth[_0xbad1('0xc')](),controller[_0xbad1('0x14')]);module[_0xbad1('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 0385deb..a6ccd00 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 _0x3efa=['STRING','INTEGER','contactListQueue','sequelize'];(function(_0xe0c872,_0x492f79){var _0x529100=function(_0x15e81e){while(--_0x15e81e){_0xe0c872['push'](_0xe0c872['shift']());}};_0x529100(++_0x492f79);}(_0x3efa,0x147));var _0xa3ef=function(_0x305f86,_0x49a213){_0x305f86=_0x305f86-0x0;var _0x56fb0e=_0x3efa[_0x305f86];return _0x56fb0e;};'use strict';var moment=require('moment');var Sequelize=require(_0xa3ef('0x0'));module['exports']={'phone':{'type':Sequelize[_0xa3ef('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa3ef('0x2')],'unique':_0xa3ef('0x3')},'ListId':{'type':Sequelize[_0xa3ef('0x2')],'unique':_0xa3ef('0x3')},'VoiceQueueId':{'type':Sequelize[_0xa3ef('0x2')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x2755=['moment','exports','STRING','INTEGER','contactListQueue'];(function(_0xf89475,_0x5a94d7){var _0x3e4bb0=function(_0x19772e){while(--_0x19772e){_0xf89475['push'](_0xf89475['shift']());}};_0x3e4bb0(++_0x5a94d7);}(_0x2755,0x19a));var _0x5275=function(_0x3e9582,_0x5ef882){_0x3e9582=_0x3e9582-0x0;var _0xdf59d7=_0x2755[_0x3e9582];return _0xdf59d7;};'use strict';var moment=require(_0x5275('0x0'));var Sequelize=require('sequelize');module[_0x5275('0x1')]={'phone':{'type':Sequelize[_0x5275('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x5275('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x5275('0x3')],'unique':_0x5275('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x5275('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index dac437a..2b9bba3 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 _0x59a1=['then','sendStatus','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update'];(function(_0x1aa59b,_0x26612c){var _0x33011c=function(_0x29d625){while(--_0x29d625){_0x1aa59b['push'](_0x1aa59b['shift']());}};_0x33011c(++_0x26612c);}(_0x59a1,0xb7));var _0x159a=function(_0x5348ae,_0x309b17){_0x5348ae=_0x5348ae-0x0;var _0x529eca=_0x59a1[_0x5348ae];return _0x529eca;};'use strict';var emlformat=require(_0x159a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x159a('0x1'));var rp=require(_0x159a('0x2'));var moment=require(_0x159a('0x3'));var BPromise=require(_0x159a('0x4'));var Mustache=require(_0x159a('0x5'));var util=require('util');var path=require(_0x159a('0x6'));var sox=require(_0x159a('0x7'));var csv=require(_0x159a('0x8'));var ejs=require(_0x159a('0x9'));var fs=require('fs');var fs_extra=require(_0x159a('0xa'));var _=require(_0x159a('0xb'));var squel=require('squel');var crypto=require(_0x159a('0xc'));var jsforce=require(_0x159a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x159a('0x8'));var querystring=require(_0x159a('0xe'));var Papa=require(_0x159a('0xf'));var Redis=require(_0x159a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x159a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x159a('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x159a('0x13'));var config=require(_0x159a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x159a('0x15'))['db'];function respondWithStatusCode(_0x1205d3,_0x55004b){_0x55004b=_0x55004b||0xcc;return function(_0x333d28){if(_0x333d28){return _0x1205d3['sendStatus'](_0x55004b);}return _0x1205d3[_0x159a('0x16')](_0x55004b)[_0x159a('0x17')]();};}function respondWithResult(_0x2da463,_0x1c58d1){_0x1c58d1=_0x1c58d1||0xc8;return function(_0x4e9da3){if(_0x4e9da3){return _0x2da463[_0x159a('0x16')](_0x1c58d1)[_0x159a('0x18')](_0x4e9da3);}};}function respondWithFilteredResult(_0x3cbfe3,_0x2eb34a){return function(_0xfb25c3){if(_0xfb25c3){var _0x31df1f=typeof _0x2eb34a[_0x159a('0x19')]===_0x159a('0x1a')&&typeof _0x2eb34a[_0x159a('0x1b')]===_0x159a('0x1a');var _0x47788e=_0xfb25c3[_0x159a('0x1c')];var _0x41a600=_0x31df1f?0x0:_0x2eb34a[_0x159a('0x19')];var _0x441c09=_0x31df1f?_0xfb25c3[_0x159a('0x1c')]:_0x2eb34a[_0x159a('0x19')]+_0x2eb34a[_0x159a('0x1b')];var _0xb32489;if(_0x441c09>=_0x47788e){_0x441c09=_0x47788e;_0xb32489=0xc8;}else{_0xb32489=0xce;}_0x3cbfe3['status'](_0xb32489);return _0x3cbfe3[_0x159a('0x1d')](_0x159a('0x1e'),_0x41a600+'-'+_0x441c09+'/'+_0x47788e)['json'](_0xfb25c3);}return null;};}function patchUpdates(_0x407504){return function(_0x43f68d){try{jsonpatch['apply'](_0x43f68d,_0x407504,!![]);}catch(_0x40297f){return BPromise['reject'](_0x40297f);}return _0x43f68d[_0x159a('0x1f')]();};}function saveUpdates(_0x1ae8e9,_0x297637){return function(_0x3cfae5){if(_0x3cfae5){return _0x3cfae5[_0x159a('0x20')](_0x1ae8e9)[_0x159a('0x21')](function(_0x26067d){return _0x26067d;});}return null;};}function removeEntity(_0x1855e7,_0xbe33eb){return function(_0xd21dfc){if(_0xd21dfc){return _0xd21dfc['destroy']()[_0x159a('0x21')](function(){_0x1855e7[_0x159a('0x16')](0xcc)[_0x159a('0x17')]();});}};}function handleEntityNotFound(_0xd8b0e1,_0x18269f){return function(_0x12b9f8){if(!_0x12b9f8){_0xd8b0e1[_0x159a('0x22')](0x194);}return _0x12b9f8;};}function handleError(_0x281675,_0x3249a0){_0x3249a0=_0x3249a0||0x1f4;return function(_0x43c814){logger[_0x159a('0x23')](_0x43c814[_0x159a('0x24')]);if(_0x43c814[_0x159a('0x25')]){delete _0x43c814[_0x159a('0x25')];}_0x281675[_0x159a('0x16')](_0x3249a0)[_0x159a('0x26')](_0x43c814);};}exports[_0x159a('0x27')]=function(_0x122bea,_0x1ce791){var _0x46cfc0={},_0x210a19={},_0x2e113b={'count':0x0,'rows':[]};var _0x5be79f=_[_0x159a('0x28')](db[_0x159a('0x29')][_0x159a('0x2a')],function(_0x29ee9d){return{'name':_0x29ee9d[_0x159a('0x2b')],'type':_0x29ee9d[_0x159a('0x2c')][_0x159a('0x2d')]};});_0x210a19[_0x159a('0x2e')]=_[_0x159a('0x28')](_0x5be79f,'name');_0x210a19[_0x159a('0x2f')]=_[_0x159a('0x30')](_0x122bea[_0x159a('0x2f')]);_0x210a19['filters']=_[_0x159a('0x31')](_0x210a19[_0x159a('0x2e')],_0x210a19[_0x159a('0x2f')]);_0x46cfc0[_0x159a('0x32')]=_[_0x159a('0x31')](_0x210a19[_0x159a('0x2e')],qs[_0x159a('0x33')](_0x122bea[_0x159a('0x2f')]['fields']));_0x46cfc0[_0x159a('0x32')]=_0x46cfc0[_0x159a('0x32')][_0x159a('0x34')]?_0x46cfc0[_0x159a('0x32')]:_0x210a19[_0x159a('0x2e')];if(!_0x122bea[_0x159a('0x2f')]['hasOwnProperty']('nolimit')){_0x46cfc0[_0x159a('0x1b')]=qs['limit'](_0x122bea[_0x159a('0x2f')][_0x159a('0x1b')]);_0x46cfc0['offset']=qs[_0x159a('0x19')](_0x122bea[_0x159a('0x2f')][_0x159a('0x19')]);}_0x46cfc0[_0x159a('0x35')]=qs[_0x159a('0x36')](_0x122bea['query']['sort']);_0x46cfc0[_0x159a('0x37')]=qs[_0x159a('0x38')](_[_0x159a('0x39')](_0x122bea[_0x159a('0x2f')],_0x210a19['filters']),_0x5be79f);if(_0x122bea['query'][_0x159a('0x3a')]){_0x46cfc0[_0x159a('0x37')]=_[_0x159a('0x3b')](_0x46cfc0[_0x159a('0x37')],{'$or':_[_0x159a('0x28')](_0x5be79f,function(_0x16846d){if(_0x16846d['type']!==_0x159a('0x3c')){var _0x190782={};_0x190782[_0x16846d[_0x159a('0x25')]]={'$like':'%'+_0x122bea[_0x159a('0x2f')][_0x159a('0x3a')]+'%'};return _0x190782;}})});}_0x46cfc0=_[_0x159a('0x3b')]({},_0x46cfc0,_0x122bea[_0x159a('0x3d')]);var _0x4be32b={'where':_0x46cfc0[_0x159a('0x37')]};return db[_0x159a('0x29')][_0x159a('0x1c')](_0x4be32b)[_0x159a('0x21')](function(_0x1a4d88){_0x2e113b[_0x159a('0x1c')]=_0x1a4d88;if(_0x122bea[_0x159a('0x2f')][_0x159a('0x3e')]){_0x46cfc0['include']=[{'all':!![]}];}return db[_0x159a('0x29')][_0x159a('0x3f')](_0x46cfc0);})[_0x159a('0x21')](function(_0x43c859){_0x2e113b[_0x159a('0x40')]=_0x43c859;return _0x2e113b;})[_0x159a('0x21')](respondWithFilteredResult(_0x1ce791,_0x46cfc0))[_0x159a('0x41')](handleError(_0x1ce791,null));};exports[_0x159a('0x42')]=function(_0x35b058,_0x4bafeb){var _0x2d79ff={'raw':!![],'where':{'id':_0x35b058[_0x159a('0x43')]['id']}},_0x21c131={};_0x21c131[_0x159a('0x2e')]=_[_0x159a('0x30')](db[_0x159a('0x29')]['rawAttributes']);_0x21c131[_0x159a('0x2f')]=_[_0x159a('0x30')](_0x35b058['query']);_0x21c131['filters']=_[_0x159a('0x31')](_0x21c131['model'],_0x21c131[_0x159a('0x2f')]);_0x2d79ff[_0x159a('0x32')]=_['intersection'](_0x21c131['model'],qs[_0x159a('0x33')](_0x35b058[_0x159a('0x2f')]['fields']));_0x2d79ff[_0x159a('0x32')]=_0x2d79ff[_0x159a('0x32')][_0x159a('0x34')]?_0x2d79ff[_0x159a('0x32')]:_0x21c131[_0x159a('0x2e')];if(_0x35b058['query'][_0x159a('0x3e')]){_0x2d79ff[_0x159a('0x44')]=[{'all':!![]}];}_0x2d79ff=_['merge']({},_0x2d79ff,_0x35b058[_0x159a('0x3d')]);return db[_0x159a('0x29')][_0x159a('0x45')](_0x2d79ff)['then'](handleEntityNotFound(_0x4bafeb,null))[_0x159a('0x21')](respondWithResult(_0x4bafeb,null))[_0x159a('0x41')](handleError(_0x4bafeb,null));};exports['update']=function(_0xcdcef3,_0x198034){if(_0xcdcef3[_0x159a('0x46')]['id']){delete _0xcdcef3[_0x159a('0x46')]['id'];}return db['CmHopperBlack'][_0x159a('0x45')]({'where':{'id':_0xcdcef3[_0x159a('0x43')]['id']}})[_0x159a('0x21')](handleEntityNotFound(_0x198034,null))[_0x159a('0x21')](saveUpdates(_0xcdcef3[_0x159a('0x46')],null))[_0x159a('0x21')](respondWithResult(_0x198034,null))['catch'](handleError(_0x198034,null));};exports['destroy']=function(_0x509bcb,_0x2de69a){return db[_0x159a('0x29')][_0x159a('0x45')]({'where':{'id':_0x509bcb[_0x159a('0x43')]['id']}})[_0x159a('0x21')](handleEntityNotFound(_0x2de69a,null))['then'](removeEntity(_0x2de69a,null))['catch'](handleError(_0x2de69a,null));};exports[_0x159a('0x47')]=function(_0x50831e,_0x5ca690){return db[_0x159a('0x29')][_0x159a('0x47')]()[_0x159a('0x21')](respondWithResult(_0x5ca690,null))[_0x159a('0x41')](handleError(_0x5ca690,null));}; \ No newline at end of file +var _0xb072=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','offset','limit','set','save','update','then','error','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','find','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x1088e1,_0x7b90bf){var _0x463449=function(_0x252a93){while(--_0x252a93){_0x1088e1['push'](_0x1088e1['shift']());}};_0x463449(++_0x7b90bf);}(_0xb072,0x1a7));var _0x2b07=function(_0x3050ab,_0x3f2b58){_0x3050ab=_0x3050ab-0x0;var _0x4dba35=_0xb072[_0x3050ab];return _0x4dba35;};'use strict';var emlformat=require(_0x2b07('0x0'));var rimraf=require(_0x2b07('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2b07('0x2'));var rp=require(_0x2b07('0x3'));var moment=require(_0x2b07('0x4'));var BPromise=require(_0x2b07('0x5'));var Mustache=require(_0x2b07('0x6'));var util=require(_0x2b07('0x7'));var path=require(_0x2b07('0x8'));var sox=require(_0x2b07('0x9'));var csv=require(_0x2b07('0xa'));var ejs=require(_0x2b07('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b07('0xc'));var squel=require(_0x2b07('0xd'));var crypto=require('crypto');var jsforce=require(_0x2b07('0xe'));var deskjs=require(_0x2b07('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2b07('0x10'));var Papa=require(_0x2b07('0x11'));var Redis=require(_0x2b07('0x12'));var authService=require(_0x2b07('0x13'));var qs=require(_0x2b07('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2b07('0x15'))(_0x2b07('0x16'));var utils=require(_0x2b07('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2b07('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x276354,_0x3c0126){_0x3c0126=_0x3c0126||0xcc;return function(_0xa11cde){if(_0xa11cde){return _0x276354[_0x2b07('0x19')](_0x3c0126);}return _0x276354[_0x2b07('0x1a')](_0x3c0126)['end']();};}function respondWithResult(_0x592a8d,_0x212ab1){_0x212ab1=_0x212ab1||0xc8;return function(_0x474a63){if(_0x474a63){return _0x592a8d[_0x2b07('0x1a')](_0x212ab1)[_0x2b07('0x1b')](_0x474a63);}};}function respondWithFilteredResult(_0x17d911,_0x1fec24){return function(_0x2fd99e){if(_0x2fd99e){var _0x4df5d5=typeof _0x1fec24['offset']===_0x2b07('0x1c')&&typeof _0x1fec24['limit']==='undefined';var _0x362140=_0x2fd99e['count'];var _0x518d2d=_0x4df5d5?0x0:_0x1fec24[_0x2b07('0x1d')];var _0x2904ff=_0x4df5d5?_0x2fd99e['count']:_0x1fec24[_0x2b07('0x1d')]+_0x1fec24[_0x2b07('0x1e')];var _0x477077;if(_0x2904ff>=_0x362140){_0x2904ff=_0x362140;_0x477077=0xc8;}else{_0x477077=0xce;}_0x17d911[_0x2b07('0x1a')](_0x477077);return _0x17d911[_0x2b07('0x1f')]('Content-Range',_0x518d2d+'-'+_0x2904ff+'/'+_0x362140)[_0x2b07('0x1b')](_0x2fd99e);}return null;};}function patchUpdates(_0x184cae){return function(_0xb0fa34){try{jsonpatch['apply'](_0xb0fa34,_0x184cae,!![]);}catch(_0x329e66){return BPromise['reject'](_0x329e66);}return _0xb0fa34[_0x2b07('0x20')]();};}function saveUpdates(_0x5a10f0,_0x27936f){return function(_0xd46102){if(_0xd46102){return _0xd46102[_0x2b07('0x21')](_0x5a10f0)[_0x2b07('0x22')](function(_0x10cd2){return _0x10cd2;});}return null;};}function removeEntity(_0x1c0c47,_0x4e8cd9){return function(_0x14ee3d){if(_0x14ee3d){return _0x14ee3d['destroy']()['then'](function(){_0x1c0c47[_0x2b07('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34d9a2,_0x3b1f3f){return function(_0x41e761){if(!_0x41e761){_0x34d9a2[_0x2b07('0x19')](0x194);}return _0x41e761;};}function handleError(_0x4e9362,_0x2647e7){_0x2647e7=_0x2647e7||0x1f4;return function(_0x3944fa){logger[_0x2b07('0x23')](_0x3944fa[_0x2b07('0x24')]);if(_0x3944fa[_0x2b07('0x25')]){delete _0x3944fa[_0x2b07('0x25')];}_0x4e9362['status'](_0x2647e7)[_0x2b07('0x26')](_0x3944fa);};}exports[_0x2b07('0x27')]=function(_0xfa9491,_0x401327){var _0x549c4e={},_0x33d312={},_0x154054={'count':0x0,'rows':[]};var _0x54d08a=_['map'](db[_0x2b07('0x28')][_0x2b07('0x29')],function(_0x43f1e6){return{'name':_0x43f1e6[_0x2b07('0x2a')],'type':_0x43f1e6[_0x2b07('0x2b')][_0x2b07('0x2c')]};});_0x33d312[_0x2b07('0x2d')]=_[_0x2b07('0x2e')](_0x54d08a,_0x2b07('0x25'));_0x33d312[_0x2b07('0x2f')]=_[_0x2b07('0x30')](_0xfa9491[_0x2b07('0x2f')]);_0x33d312['filters']=_[_0x2b07('0x31')](_0x33d312[_0x2b07('0x2d')],_0x33d312[_0x2b07('0x2f')]);_0x549c4e[_0x2b07('0x32')]=_[_0x2b07('0x31')](_0x33d312['model'],qs['fields'](_0xfa9491[_0x2b07('0x2f')][_0x2b07('0x33')]));_0x549c4e['attributes']=_0x549c4e[_0x2b07('0x32')][_0x2b07('0x34')]?_0x549c4e[_0x2b07('0x32')]:_0x33d312[_0x2b07('0x2d')];if(!_0xfa9491[_0x2b07('0x2f')][_0x2b07('0x35')](_0x2b07('0x36'))){_0x549c4e[_0x2b07('0x1e')]=qs[_0x2b07('0x1e')](_0xfa9491['query']['limit']);_0x549c4e[_0x2b07('0x1d')]=qs[_0x2b07('0x1d')](_0xfa9491['query'][_0x2b07('0x1d')]);}_0x549c4e[_0x2b07('0x37')]=qs[_0x2b07('0x38')](_0xfa9491[_0x2b07('0x2f')][_0x2b07('0x38')]);_0x549c4e[_0x2b07('0x39')]=qs[_0x2b07('0x3a')](_['pick'](_0xfa9491['query'],_0x33d312['filters']),_0x54d08a);if(_0xfa9491[_0x2b07('0x2f')][_0x2b07('0x3b')]){_0x549c4e['where']=_[_0x2b07('0x3c')](_0x549c4e['where'],{'$or':_[_0x2b07('0x2e')](_0x54d08a,function(_0x4f80a8){if(_0x4f80a8[_0x2b07('0x2b')]!==_0x2b07('0x3d')){var _0x415786={};_0x415786[_0x4f80a8['name']]={'$like':'%'+_0xfa9491[_0x2b07('0x2f')]['filter']+'%'};return _0x415786;}})});}_0x549c4e=_['merge']({},_0x549c4e,_0xfa9491[_0x2b07('0x3e')]);var _0x42dab1={'where':_0x549c4e[_0x2b07('0x39')]};return db['CmHopperBlack'][_0x2b07('0x3f')](_0x42dab1)[_0x2b07('0x22')](function(_0x4e81ac){_0x154054['count']=_0x4e81ac;if(_0xfa9491[_0x2b07('0x2f')][_0x2b07('0x40')]){_0x549c4e[_0x2b07('0x41')]=[{'all':!![]}];}return db[_0x2b07('0x28')]['findAll'](_0x549c4e);})[_0x2b07('0x22')](function(_0x3eca51){_0x154054[_0x2b07('0x42')]=_0x3eca51;return _0x154054;})[_0x2b07('0x22')](respondWithFilteredResult(_0x401327,_0x549c4e))[_0x2b07('0x43')](handleError(_0x401327,null));};exports[_0x2b07('0x44')]=function(_0xed80a9,_0x3b0613){var _0x17df96={'raw':!![],'where':{'id':_0xed80a9[_0x2b07('0x45')]['id']}},_0x564aa6={};_0x564aa6[_0x2b07('0x2d')]=_[_0x2b07('0x30')](db[_0x2b07('0x28')]['rawAttributes']);_0x564aa6['query']=_['keys'](_0xed80a9['query']);_0x564aa6['filters']=_['intersection'](_0x564aa6[_0x2b07('0x2d')],_0x564aa6[_0x2b07('0x2f')]);_0x17df96[_0x2b07('0x32')]=_[_0x2b07('0x31')](_0x564aa6[_0x2b07('0x2d')],qs[_0x2b07('0x33')](_0xed80a9[_0x2b07('0x2f')]['fields']));_0x17df96[_0x2b07('0x32')]=_0x17df96[_0x2b07('0x32')]['length']?_0x17df96[_0x2b07('0x32')]:_0x564aa6[_0x2b07('0x2d')];if(_0xed80a9[_0x2b07('0x2f')]['includeAll']){_0x17df96[_0x2b07('0x41')]=[{'all':!![]}];}_0x17df96=_[_0x2b07('0x3c')]({},_0x17df96,_0xed80a9[_0x2b07('0x3e')]);return db[_0x2b07('0x28')][_0x2b07('0x46')](_0x17df96)[_0x2b07('0x22')](handleEntityNotFound(_0x3b0613,null))[_0x2b07('0x22')](respondWithResult(_0x3b0613,null))[_0x2b07('0x43')](handleError(_0x3b0613,null));};exports[_0x2b07('0x21')]=function(_0x4928b8,_0x712c89){if(_0x4928b8['body']['id']){delete _0x4928b8['body']['id'];}return db['CmHopperBlack'][_0x2b07('0x46')]({'where':{'id':_0x4928b8[_0x2b07('0x45')]['id']}})[_0x2b07('0x22')](handleEntityNotFound(_0x712c89,null))[_0x2b07('0x22')](saveUpdates(_0x4928b8['body'],null))[_0x2b07('0x22')](respondWithResult(_0x712c89,null))[_0x2b07('0x43')](handleError(_0x712c89,null));};exports[_0x2b07('0x47')]=function(_0xc1aa27,_0xfb8564){return db[_0x2b07('0x28')]['find']({'where':{'id':_0xc1aa27['params']['id']}})[_0x2b07('0x22')](handleEntityNotFound(_0xfb8564,null))[_0x2b07('0x22')](removeEntity(_0xfb8564,null))[_0x2b07('0x43')](handleError(_0xfb8564,null));};exports[_0x2b07('0x48')]=function(_0x122793,_0x524782){return db[_0x2b07('0x28')][_0x2b07('0x48')]()[_0x2b07('0x22')](respondWithResult(_0x524782,null))[_0x2b07('0x43')](handleError(_0x524782,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 436562d..d81d7b5 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 _0x363c=['api','moment','bluebird','path','exports','cm_hopper_black','util'];(function(_0x5d2180,_0x3f9dbe){var _0x8bcff6=function(_0xa0bea2){while(--_0xa0bea2){_0x5d2180['push'](_0x5d2180['shift']());}};_0x8bcff6(++_0x3f9dbe);}(_0x363c,0x125));var _0xc363=function(_0x816de3,_0x38d085){_0x816de3=_0x816de3-0x0;var _0x1e539e=_0x363c[_0x816de3];return _0x1e539e;};'use strict';var _=require('lodash');var util=require(_0xc363('0x0'));var logger=require('../../config/logger')(_0xc363('0x1'));var moment=require(_0xc363('0x2'));var BPromise=require(_0xc363('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc363('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0xc363('0x5')]=function(_0x2a028a,_0x17979f){return _0x2a028a['define']('CmHopperBlack',attributes,{'tableName':_0xc363('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf03=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','lodash'];(function(_0x24d3ea,_0x171385){var _0x538e6c=function(_0x4a50ca){while(--_0x4a50ca){_0x24d3ea['push'](_0x24d3ea['shift']());}};_0x538e6c(++_0x171385);}(_0xcf03,0xaf));var _0x3cf0=function(_0x2826d7,_0x14209e){_0x2826d7=_0x2826d7-0x0;var _0x1547f0=_0xcf03[_0x2826d7];return _0x1547f0;};'use strict';var _=require(_0x3cf0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3cf0('0x1'));var moment=require(_0x3cf0('0x2'));var BPromise=require(_0x3cf0('0x3'));var rp=require(_0x3cf0('0x4'));var fs=require('fs');var path=require(_0x3cf0('0x5'));var rimraf=require(_0x3cf0('0x6'));var config=require(_0x3cf0('0x7'));var attributes=require(_0x3cf0('0x8'));module['exports']=function(_0x4c7537,_0xfad628){return _0x4c7537[_0x3cf0('0x9')](_0x3cf0('0xa'),attributes,{'tableName':'cm_hopper_black','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 0f84349..a2957f0 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 _0xca0f=['jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetCmHopperBlack','CmHopperBlack','options','where','attributes','limit','include','map','model','UpdateCmHopperBlack','update','catch','destroy','DestroyCmHopperBlack','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4480a5,_0x4da2d8){var _0x242494=function(_0x3cb4f0){while(--_0x3cb4f0){_0x4480a5['push'](_0x4480a5['shift']());}};_0x242494(++_0x4da2d8);}(_0xca0f,0x126));var _0xfca0=function(_0x461e6d,_0x3bcc94){_0x461e6d=_0x461e6d-0x0;var _0x2c5e61=_0xca0f[_0x461e6d];return _0x2c5e61;};'use strict';var _=require(_0xfca0('0x0'));var util=require(_0xfca0('0x1'));var moment=require(_0xfca0('0x2'));var BPromise=require(_0xfca0('0x3'));var rs=require(_0xfca0('0x4'));var fs=require('fs');var Redis=require(_0xfca0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfca0('0x6'));var logger=require(_0xfca0('0x7'))(_0xfca0('0x8'));var config=require(_0xfca0('0x9'));var jayson=require(_0xfca0('0xa'));var client=jayson[_0xfca0('0xb')][_0xfca0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x574b2d,_0x37d4b5,_0x6b5cd8){return new BPromise(function(_0x5ea8a3,_0x588ee0){return client[_0xfca0('0xd')](_0x574b2d,_0x6b5cd8)[_0xfca0('0xe')](function(_0x1e3f45){logger[_0xfca0('0xf')](_0xfca0('0x10'),_0x37d4b5,_0xfca0('0x11'));logger['debug'](_0xfca0('0x12'),_0x37d4b5,_0xfca0('0x11'),JSON[_0xfca0('0x13')](_0x1e3f45));if(_0x1e3f45['error']){if(_0x1e3f45[_0xfca0('0x14')]['code']===0x1f4){logger[_0xfca0('0x14')](_0xfca0('0x10'),_0x37d4b5,_0x1e3f45[_0xfca0('0x14')][_0xfca0('0x15')]);return _0x588ee0(_0x1e3f45[_0xfca0('0x14')][_0xfca0('0x15')]);}logger[_0xfca0('0x14')](_0xfca0('0x10'),_0x37d4b5,_0x1e3f45['error'][_0xfca0('0x15')]);return _0x5ea8a3(_0x1e3f45[_0xfca0('0x14')][_0xfca0('0x15')]);}else{logger[_0xfca0('0xf')](_0xfca0('0x10'),_0x37d4b5,_0xfca0('0x11'));_0x5ea8a3(_0x1e3f45[_0xfca0('0x16')][_0xfca0('0x15')]);}})['catch'](function(_0x325640){logger[_0xfca0('0x14')](_0xfca0('0x10'),_0x37d4b5,_0x325640);_0x588ee0(_0x325640);});});}exports[_0xfca0('0x17')]=function(_0x3cd9ee){var _0x5b0a86=this;return new Promise(function(_0x445796,_0x2e32e2){return db[_0xfca0('0x18')]['findAll']({'raw':_0x3cd9ee[_0xfca0('0x19')]?_0x3cd9ee[_0xfca0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd9ee[_0xfca0('0x19')]?_0x3cd9ee[_0xfca0('0x19')][_0xfca0('0x1a')]||null:null,'attributes':_0x3cd9ee['options']?_0x3cd9ee[_0xfca0('0x19')][_0xfca0('0x1b')]||null:null,'limit':_0x3cd9ee['options']?_0x3cd9ee[_0xfca0('0x19')][_0xfca0('0x1c')]||null:null,'include':_0x3cd9ee[_0xfca0('0x19')]?_0x3cd9ee[_0xfca0('0x19')][_0xfca0('0x1d')]?_[_0xfca0('0x1e')](_0x3cd9ee[_0xfca0('0x19')][_0xfca0('0x1d')],function(_0x32e618){return{'model':db[_0x32e618['model']],'as':_0x32e618['as'],'attributes':_0x32e618['attributes'],'include':_0x32e618[_0xfca0('0x1d')]?_[_0xfca0('0x1e')](_0x32e618[_0xfca0('0x1d')],function(_0x4b7a56){return{'model':db[_0x4b7a56[_0xfca0('0x1f')]],'as':_0x4b7a56['as'],'attributes':_0x4b7a56['attributes'],'include':_0x4b7a56[_0xfca0('0x1d')]?_[_0xfca0('0x1e')](_0x4b7a56['include'],function(_0x5a3c3b){return{'model':db[_0x5a3c3b['model']],'as':_0x5a3c3b['as'],'attributes':_0x5a3c3b[_0xfca0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfca0('0xe')](function(_0x41f4d3){logger[_0xfca0('0xf')](_0xfca0('0x17'),_0x3cd9ee);logger['debug']('GetCmHopperBlack',_0x3cd9ee,JSON['stringify'](_0x41f4d3));_0x445796(_0x41f4d3);})['catch'](function(_0x55b890){logger[_0xfca0('0x14')](_0xfca0('0x17'),_0x55b890[_0xfca0('0x15')],_0x3cd9ee);_0x2e32e2(_0x5b0a86[_0xfca0('0x14')](0x1f4,_0x55b890[_0xfca0('0x15')]));});});};exports[_0xfca0('0x20')]=function(_0x405ed8){var _0x4cd695=this;return new Promise(function(_0x47cc0f,_0x441167){return db[_0xfca0('0x18')][_0xfca0('0x21')](_0x405ed8['body'],{'raw':_0x405ed8[_0xfca0('0x19')]?_0x405ed8[_0xfca0('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x405ed8[_0xfca0('0x19')]?_0x405ed8[_0xfca0('0x19')][_0xfca0('0x1a')]||null:null,'attributes':_0x405ed8[_0xfca0('0x19')]?_0x405ed8[_0xfca0('0x19')][_0xfca0('0x1b')]||null:null,'limit':_0x405ed8[_0xfca0('0x19')]?_0x405ed8[_0xfca0('0x19')]['limit']||null:null})[_0xfca0('0xe')](function(_0x45e956){logger['info']('UpdateCmHopperBlack',_0x405ed8);logger['debug']('UpdateCmHopperBlack',_0x405ed8,JSON[_0xfca0('0x13')](_0x45e956));_0x47cc0f(_0x45e956);})[_0xfca0('0x22')](function(_0x1f58ea){logger[_0xfca0('0x14')]('UpdateCmHopperBlack',_0x1f58ea[_0xfca0('0x15')],_0x405ed8);_0x441167(_0x4cd695['error'](0x1f4,_0x1f58ea['message']));});});};exports['DestroyCmHopperBlack']=function(_0x241a3d){var _0x56fb63=this;return new Promise(function(_0x17c602,_0x103399){return db['CmHopperBlack'][_0xfca0('0x23')]({'where':_0x241a3d[_0xfca0('0x19')]?_0x241a3d[_0xfca0('0x19')][_0xfca0('0x1a')]||null:null})[_0xfca0('0xe')](function(_0x2b32b3){logger[_0xfca0('0xf')](_0xfca0('0x24'),_0x241a3d);logger[_0xfca0('0x25')]('DestroyCmHopperBlack',_0x241a3d,JSON[_0xfca0('0x13')](_0x2b32b3));_0x17c602(_0x2b32b3);})[_0xfca0('0x22')](function(_0x41c712){logger[_0xfca0('0x14')](_0xfca0('0x24'),_0x41c712[_0xfca0('0x15')],_0x241a3d);_0x103399(_0x56fb63[_0xfca0('0x14')](0x1f4,_0x41c712['message']));});});}; \ No newline at end of file +var _0x8853=['map','model','include','info','GetCmHopperBlack','stringify','catch','UpdateCmHopperBlack','update','limit','DestroyCmHopperBlack','destroy','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','CmHopperBlack','findAll','options','raw','where','attributes'];(function(_0x389b08,_0x137a7f){var _0x597a85=function(_0x591968){while(--_0x591968){_0x389b08['push'](_0x389b08['shift']());}};_0x597a85(++_0x137a7f);}(_0x8853,0xac));var _0x3885=function(_0x3ca524,_0x4d689b){_0x3ca524=_0x3ca524-0x0;var _0x360631=_0x8853[_0x3ca524];return _0x360631;};'use strict';var _=require(_0x3885('0x0'));var util=require(_0x3885('0x1'));var moment=require(_0x3885('0x2'));var BPromise=require('bluebird');var rs=require(_0x3885('0x3'));var fs=require('fs');var Redis=require(_0x3885('0x4'));var db=require(_0x3885('0x5'))['db'];var utils=require(_0x3885('0x6'));var logger=require(_0x3885('0x7'))(_0x3885('0x8'));var config=require(_0x3885('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3885('0xa')][_0x3885('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x532790,_0x37a703,_0x2f193d){return new BPromise(function(_0x2ec9a6,_0x32b50a){return client[_0x3885('0xc')](_0x532790,_0x2f193d)[_0x3885('0xd')](function(_0x1f52d0){logger['info'](_0x3885('0xe'),_0x37a703,_0x3885('0xf'));logger[_0x3885('0x10')](_0x3885('0x11'),_0x37a703,'request\x20sent',JSON['stringify'](_0x1f52d0));if(_0x1f52d0[_0x3885('0x12')]){if(_0x1f52d0[_0x3885('0x12')][_0x3885('0x13')]===0x1f4){logger[_0x3885('0x12')](_0x3885('0xe'),_0x37a703,_0x1f52d0[_0x3885('0x12')][_0x3885('0x14')]);return _0x32b50a(_0x1f52d0[_0x3885('0x12')][_0x3885('0x14')]);}logger[_0x3885('0x12')](_0x3885('0xe'),_0x37a703,_0x1f52d0['error']['message']);return _0x2ec9a6(_0x1f52d0['error'][_0x3885('0x14')]);}else{logger['info'](_0x3885('0xe'),_0x37a703,_0x3885('0xf'));_0x2ec9a6(_0x1f52d0[_0x3885('0x15')][_0x3885('0x14')]);}})['catch'](function(_0x562a02){logger[_0x3885('0x12')](_0x3885('0xe'),_0x37a703,_0x562a02);_0x32b50a(_0x562a02);});});}exports['GetCmHopperBlack']=function(_0x277140){var _0x341608=this;return new Promise(function(_0x3d71a9,_0x47ab0f){return db[_0x3885('0x16')][_0x3885('0x17')]({'raw':_0x277140[_0x3885('0x18')]?_0x277140['options'][_0x3885('0x19')]===undefined?!![]:![]:!![],'where':_0x277140[_0x3885('0x18')]?_0x277140[_0x3885('0x18')][_0x3885('0x1a')]||null:null,'attributes':_0x277140[_0x3885('0x18')]?_0x277140['options'][_0x3885('0x1b')]||null:null,'limit':_0x277140[_0x3885('0x18')]?_0x277140['options']['limit']||null:null,'include':_0x277140[_0x3885('0x18')]?_0x277140['options']['include']?_[_0x3885('0x1c')](_0x277140[_0x3885('0x18')]['include'],function(_0x4100c1){return{'model':db[_0x4100c1['model']],'as':_0x4100c1['as'],'attributes':_0x4100c1['attributes'],'include':_0x4100c1['include']?_[_0x3885('0x1c')](_0x4100c1['include'],function(_0x36b413){return{'model':db[_0x36b413[_0x3885('0x1d')]],'as':_0x36b413['as'],'attributes':_0x36b413['attributes'],'include':_0x36b413[_0x3885('0x1e')]?_[_0x3885('0x1c')](_0x36b413[_0x3885('0x1e')],function(_0x90376b){return{'model':db[_0x90376b[_0x3885('0x1d')]],'as':_0x90376b['as'],'attributes':_0x90376b[_0x3885('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ae7b2){logger[_0x3885('0x1f')](_0x3885('0x20'),_0x277140);logger[_0x3885('0x10')](_0x3885('0x20'),_0x277140,JSON[_0x3885('0x21')](_0x2ae7b2));_0x3d71a9(_0x2ae7b2);})[_0x3885('0x22')](function(_0x391d98){logger[_0x3885('0x12')](_0x3885('0x20'),_0x391d98[_0x3885('0x14')],_0x277140);_0x47ab0f(_0x341608[_0x3885('0x12')](0x1f4,_0x391d98['message']));});});};exports[_0x3885('0x23')]=function(_0x18eb50){var _0x15ae4c=this;return new Promise(function(_0x31be74,_0x36e554){return db[_0x3885('0x16')][_0x3885('0x24')](_0x18eb50['body'],{'raw':_0x18eb50[_0x3885('0x18')]?_0x18eb50[_0x3885('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18eb50[_0x3885('0x18')]?_0x18eb50['options']['where']||null:null,'attributes':_0x18eb50[_0x3885('0x18')]?_0x18eb50['options']['attributes']||null:null,'limit':_0x18eb50[_0x3885('0x18')]?_0x18eb50[_0x3885('0x18')][_0x3885('0x25')]||null:null})['then'](function(_0x2c8269){logger[_0x3885('0x1f')](_0x3885('0x23'),_0x18eb50);logger[_0x3885('0x10')](_0x3885('0x23'),_0x18eb50,JSON[_0x3885('0x21')](_0x2c8269));_0x31be74(_0x2c8269);})['catch'](function(_0x348e41){logger[_0x3885('0x12')]('UpdateCmHopperBlack',_0x348e41[_0x3885('0x14')],_0x18eb50);_0x36e554(_0x15ae4c[_0x3885('0x12')](0x1f4,_0x348e41['message']));});});};exports[_0x3885('0x26')]=function(_0x1e4cba){var _0x2cbcba=this;return new Promise(function(_0x33bdbf,_0x4e27d7){return db['CmHopperBlack'][_0x3885('0x27')]({'where':_0x1e4cba[_0x3885('0x18')]?_0x1e4cba[_0x3885('0x18')]['where']||null:null})[_0x3885('0xd')](function(_0x50c9d3){logger[_0x3885('0x1f')]('DestroyCmHopperBlack',_0x1e4cba);logger[_0x3885('0x10')](_0x3885('0x26'),_0x1e4cba,JSON[_0x3885('0x21')](_0x50c9d3));_0x33bdbf(_0x50c9d3);})[_0x3885('0x22')](function(_0x15ad22){logger[_0x3885('0x12')](_0x3885('0x26'),_0x15ad22[_0x3885('0x14')],_0x1e4cba);_0x4e27d7(_0x2cbcba[_0x3885('0x12')](0x1f4,_0x15ad22[_0x3885('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 535354f..6b6c4b5 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 _0xe3da=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','exports','multer'];(function(_0xce8183,_0x567545){var _0x27c555=function(_0x2b1dd5){while(--_0x2b1dd5){_0xce8183['push'](_0xce8183['shift']());}};_0x27c555(++_0x567545);}(_0xe3da,0x1cd));var _0xae3d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe3da[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var path=require(_0xae3d('0x2'));var timeout=require(_0xae3d('0x3'));var express=require(_0xae3d('0x4'));var router=express[_0xae3d('0x5')]();var fs_extra=require(_0xae3d('0x6'));var auth=require(_0xae3d('0x7'));var interaction=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var controller=require(_0xae3d('0xa'));router[_0xae3d('0xb')]('/',auth[_0xae3d('0xc')](),controller[_0xae3d('0xd')]);router[_0xae3d('0xb')](_0xae3d('0xe'),auth['isAuthenticated'](),controller[_0xae3d('0xf')]);router[_0xae3d('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xae3d('0x10')]);router[_0xae3d('0x11')](_0xae3d('0x12'),auth[_0xae3d('0xc')](),controller[_0xae3d('0x13')]);router[_0xae3d('0x14')]('/:id',auth[_0xae3d('0xc')](),controller['destroy']);module[_0xae3d('0x15')]=router; \ No newline at end of file +var _0x3d04=['show','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','describe','/:id'];(function(_0xcd90ac,_0x5ae6f6){var _0x4d92f9=function(_0x20069c){while(--_0x20069c){_0xcd90ac['push'](_0xcd90ac['shift']());}};_0x4d92f9(++_0x5ae6f6);}(_0x3d04,0xbe));var _0x43d0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3d04[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var path=require(_0x43d0('0x2'));var timeout=require(_0x43d0('0x3'));var express=require(_0x43d0('0x4'));var router=express[_0x43d0('0x5')]();var fs_extra=require(_0x43d0('0x6'));var auth=require(_0x43d0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x43d0('0x8'));var controller=require(_0x43d0('0x9'));router[_0x43d0('0xa')]('/',auth[_0x43d0('0xb')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x43d0('0xc')]);router[_0x43d0('0xa')](_0x43d0('0xd'),auth[_0x43d0('0xb')](),controller[_0x43d0('0xe')]);router['put']('/:id',auth[_0x43d0('0xb')](),controller['update']);router['delete'](_0x43d0('0xd'),auth[_0x43d0('0xb')](),controller[_0x43d0('0xf')]);module[_0x43d0('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index df22c2c..2a6f14e 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 _0x3bbd=['setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','STRING','INTEGER','DATE','endtime'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x3bbd,0x71));var _0xd3bb=function(_0x5eeb0b,_0x293c14){_0x5eeb0b=_0x5eeb0b-0x0;var _0x270295=_0x3bbd[_0x5eeb0b];return _0x270295;};'use strict';var Sequelize=require(_0xd3bb('0x0'));var moment=require(_0xd3bb('0x1'));module[_0xd3bb('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xd3bb('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xd3bb('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd3bb('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xd3bb('0x3')]},'originatecalleridname':{'type':Sequelize[_0xd3bb('0x3')]},'calleridnum':{'type':Sequelize[_0xd3bb('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd3bb('0x5')]},'responsetime':{'type':Sequelize[_0xd3bb('0x5')]},'answertime':{'type':Sequelize[_0xd3bb('0x5')]},'droptime':{'type':Sequelize[_0xd3bb('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xd3bb('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd3bb('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd3bb('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xd3bb('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd3bb('0x3')]},'campaign':{'type':Sequelize[_0xd3bb('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xd3bb('0x3')]},'reason':{'type':Sequelize[_0xd3bb('0x3')]},'disposition':{'type':Sequelize[_0xd3bb('0x3')]},'secondDisposition':{'type':Sequelize[_0xd3bb('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xd3bb('0x5')],'set':function(_0x2e1603){var _0xf6585b=this['getDataValue'](_0xd3bb('0x6'));if(_0xf6585b&&_0x2e1603){this[_0xd3bb('0x7')](_0xd3bb('0x8'),moment(_0x2e1603)[_0xd3bb('0x9')](moment(_0xf6585b),_0xd3bb('0xa')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xd3bb('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xd3bb('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xd3bb('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xd3bb('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd3bb('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd3bb('0x5')]},'deleted':{'type':Sequelize[_0xd3bb('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xd3bb('0x5')]},'recallme':{'type':Sequelize[_0xd3bb('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xd3bb('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd3bb('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd3bb('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd3bb('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9841=['diff','seconds','BOOLEAN','exports','INTEGER','STRING','DATE','getDataValue','setDataValue'];(function(_0x5afd87,_0x4d71c8){var _0x576fb2=function(_0x287bd7){while(--_0x287bd7){_0x5afd87['push'](_0x5afd87['shift']());}};_0x576fb2(++_0x4d71c8);}(_0x9841,0x1b3));var _0x1984=function(_0x2f637e,_0x5a6751){_0x2f637e=_0x2f637e-0x0;var _0x367ba0=_0x9841[_0x2f637e];return _0x367ba0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x1984('0x0')]={'state':{'type':Sequelize[_0x1984('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x1984('0x2')]},'scheduledat':{'type':Sequelize[_0x1984('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1984('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1984('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1984('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x1984('0x2')]},'calleridname':{'type':Sequelize[_0x1984('0x2')]},'starttime':{'type':Sequelize[_0x1984('0x3')]},'responsetime':{'type':Sequelize[_0x1984('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x1984('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x1984('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1984('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1984('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1984('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1984('0x2')]},'campaign':{'type':Sequelize[_0x1984('0x2')]},'campaigntype':{'type':Sequelize[_0x1984('0x2')]},'membername':{'type':Sequelize[_0x1984('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x1984('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1984('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x1d33eb){var _0x592034=this[_0x1984('0x4')]('endtime');if(_0x592034&&_0x1d33eb){this[_0x1984('0x5')]('followuptime',moment(_0x1d33eb)[_0x1984('0x6')](moment(_0x592034),_0x1984('0x7')));}}},'amd':{'type':Sequelize[_0x1984('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0x1984('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x1984('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x1984('0x3')]},'callback':{'type':Sequelize[_0x1984('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1984('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1984('0x3')]},'deleted':{'type':Sequelize[_0x1984('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x1984('0x3')]},'recallme':{'type':Sequelize[_0x1984('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x1984('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x1984('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1984('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1984('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1984('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1984('0x1')],'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 c2b87b8..10ba139 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(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0x4888,0x198));var _0x8488=function(_0x4937b2,_0x2599cf){_0x4937b2=_0x4937b2-0x0;var _0x8da2fb=_0x4888[_0x4937b2];return _0x8da2fb;};'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 _0x326f=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','options','CmHopperFinal','includeAll','include','rows','catch','show','params','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','scheduledAt','ContactId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','updatedAt','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','toString','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','fromQuery','phone','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','calleridnum\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x326f,0xd1));var _0xf326=function(_0x249271,_0x65b87d){_0x249271=_0x249271-0x0;var _0x3ce184=_0x326f[_0x249271];return _0x3ce184;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}exports['index']=function(_0x4a9abf,_0x6a8e89){var _0x1ae23a={},_0x2fa28e={},_0x5dbe63={'count':0x0,'rows':[]};var _0xc115d9=_[_0xf326('0x28')](db['CmHopperFinal'][_0xf326('0x29')],function(_0x119ab8){return{'name':_0x119ab8[_0xf326('0x2a')],'type':_0x119ab8[_0xf326('0x2b')][_0xf326('0x2c')]};});_0x2fa28e[_0xf326('0x2d')]=_[_0xf326('0x28')](_0xc115d9,_0xf326('0x26'));_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x4a9abf['query']);_0x2fa28e[_0xf326('0x30')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],_0x2fa28e['query']);_0x1ae23a[_0xf326('0x32')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],qs['fields'](_0x4a9abf['query'][_0xf326('0x33')]));_0x1ae23a[_0xf326('0x32')]=_0x1ae23a[_0xf326('0x32')][_0xf326('0x34')]?_0x1ae23a[_0xf326('0x32')]:_0x2fa28e[_0xf326('0x2d')];if(!_0x4a9abf[_0xf326('0x2e')][_0xf326('0x35')]('nolimit')){_0x1ae23a[_0xf326('0x1c')]=qs[_0xf326('0x1c')](_0x4a9abf['query'][_0xf326('0x1c')]);_0x1ae23a['offset']=qs[_0xf326('0x1a')](_0x4a9abf['query']['offset']);}_0x1ae23a[_0xf326('0x36')]=qs['sort'](_0x4a9abf[_0xf326('0x2e')]['sort']);_0x1ae23a[_0xf326('0x37')]=qs[_0xf326('0x30')](_[_0xf326('0x38')](_0x4a9abf['query'],_0x2fa28e[_0xf326('0x30')]),_0xc115d9);if(_0x4a9abf[_0xf326('0x2e')]['filter']){_0x1ae23a[_0xf326('0x37')]=_[_0xf326('0x39')](_0x1ae23a[_0xf326('0x37')],{'$or':_[_0xf326('0x28')](_0xc115d9,function(_0x51076c){if(_0x51076c[_0xf326('0x2b')]!==_0xf326('0x3a')){var _0x1e69b1={};_0x1e69b1[_0x51076c[_0xf326('0x26')]]={'$like':'%'+_0x4a9abf[_0xf326('0x2e')]['filter']+'%'};return _0x1e69b1;}})});}_0x1ae23a=_[_0xf326('0x39')]({},_0x1ae23a,_0x4a9abf[_0xf326('0x3b')]);var _0x5cfb97={'where':_0x1ae23a['where']};return db[_0xf326('0x3c')]['count'](_0x5cfb97)['then'](function(_0x22d462){_0x5dbe63['count']=_0x22d462;if(_0x4a9abf[_0xf326('0x2e')][_0xf326('0x3d')]){_0x1ae23a[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x3c')]['findAll'](_0x1ae23a);})[_0xf326('0x24')](function(_0x45d344){_0x5dbe63[_0xf326('0x3f')]=_0x45d344;return _0x5dbe63;})[_0xf326('0x24')](respondWithFilteredResult(_0x6a8e89,_0x1ae23a))[_0xf326('0x40')](handleError(_0x6a8e89,null));};exports[_0xf326('0x41')]=function(_0x2ad841,_0x224a32){var _0x31283b={'raw':!![],'where':{'id':_0x2ad841[_0xf326('0x42')]['id']}},_0x1227d3={};_0x1227d3[_0xf326('0x2d')]=_['keys'](db[_0xf326('0x3c')][_0xf326('0x29')]);_0x1227d3[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x2ad841[_0xf326('0x2e')]);_0x1227d3[_0xf326('0x30')]=_['intersection'](_0x1227d3[_0xf326('0x2d')],_0x1227d3[_0xf326('0x2e')]);_0x31283b['attributes']=_[_0xf326('0x31')](_0x1227d3[_0xf326('0x2d')],qs[_0xf326('0x33')](_0x2ad841[_0xf326('0x2e')][_0xf326('0x33')]));_0x31283b['attributes']=_0x31283b['attributes'][_0xf326('0x34')]?_0x31283b[_0xf326('0x32')]:_0x1227d3['model'];if(_0x2ad841['query'][_0xf326('0x3d')]){_0x31283b[_0xf326('0x3e')]=[{'all':!![]}];}_0x31283b=_[_0xf326('0x39')]({},_0x31283b,_0x2ad841['options']);return db[_0xf326('0x3c')][_0xf326('0x43')](_0x31283b)[_0xf326('0x24')](handleEntityNotFound(_0x224a32,null))[_0xf326('0x24')](respondWithResult(_0x224a32,null))[_0xf326('0x40')](handleError(_0x224a32,null));};exports[_0xf326('0x44')]=function(_0x12792c,_0x3b90dc){return db[_0xf326('0x3c')][_0xf326('0x44')]()[_0xf326('0x24')](respondWithResult(_0x3b90dc,null))[_0xf326('0x40')](handleError(_0x3b90dc,null));};exports[_0xf326('0x22')]=function(_0x395b1e,_0xeac1a1){if(_0x395b1e['body'][_0xf326('0x45')]){delete _0x395b1e[_0xf326('0x46')][_0xf326('0x45')];}return db[_0xf326('0x3c')]['find']({'where':{'uniqueid':_0x395b1e[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0xeac1a1,null))[_0xf326('0x24')](saveUpdates(_0x395b1e[_0xf326('0x46')],null))['then'](respondWithResult(_0xeac1a1,null))[_0xf326('0x40')](handleError(_0xeac1a1,null));};exports[_0xf326('0x47')]=function(_0x145a77,_0x451ac7,_0x39ba25){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x145a77[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),'noSuchContacts'],[db['sequelize']['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x4c')))),_0xf326('0x4d')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4f')))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x51')))),'dropContacts'],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x53')))),'reCallContacts'],[db[_0xf326('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x54')))),_0xf326('0x55')]]})[_0xf326('0x24')](handleEntityNotFound(_0x451ac7,null))['then'](respondWithResult(_0x451ac7,null))['catch'](handleError(_0x451ac7,null));};exports[_0xf326('0x56')]=function(_0xa85a42,_0x33b259,_0x5d0177){return db[_0xf326('0x3c')]['findAll']({'raw':![],'where':{'CampaignId':_0xa85a42[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),_0xf326('0x57')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xf326('0x4d')],[db['sequelize']['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x51')))),_0xf326('0x58')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x59')))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')](_0xf326('0x53')))),_0xf326('0x5a')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db['sequelize']['literal'](_0xf326('0x54')))),'answeringMachine']]})[_0xf326('0x24')](handleEntityNotFound(_0x33b259,null))[_0xf326('0x24')](respondWithResult(_0x33b259,null))[_0xf326('0x40')](handleError(_0x33b259,null));};exports[_0xf326('0x5b')]=function(_0x17cd36,_0x541491,_0x4a053c){return db['VoiceQueue'][_0xf326('0x43')]({'where':{'id':_0x17cd36[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x541491,null))[_0xf326('0x24')](function(_0xec5857){var _0x5e874b;if(_0xec5857){_0x5e874b=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))['fromQuery'](['phone',_0xf326('0x5f'),_0xf326('0x60'),'ListId','VoiceQueueId',_0xf326('0x61'),'updatedAt'],squel[_0xf326('0x62')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x5f'))['field'](_0xf326('0x65'),_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x68'),_0xf326('0x69'))[_0xf326('0x63')]('NOW()',_0xf326('0x61'))['field'](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')]('cm_hopper_final')[_0xf326('0x37')](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id']['toString']())[_0xf326('0x37')](_0xf326('0x6d'),_0x17cd36[_0xf326('0x46')][_0xf326('0x6e')]['toString']())[_0xf326('0x37')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field']('phone')['from'](_0xf326('0x5e'))['where'](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id'][_0xf326('0x70')]()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field'](_0xf326('0x71'))[_0xf326('0x6b')]('cm_hopper_final')['where'](_0xf326('0x6c'),_0x17cd36['params']['id'][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x72')))[_0xf326('0x73')](_0xf326('0x60')))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x5e874b);}return[];})[_0xf326('0x24')](respondWithResult(_0x541491,null))['catch'](handleError(_0x541491,null));};exports[_0xf326('0x74')]=function(_0x26bbb1,_0x4ac90e,_0x3c82cf){return db['Campaign'][_0xf326('0x43')]({'where':{'id':_0x26bbb1[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x4ac90e,null))['then'](function(_0x2b4414){var _0x1c86c8;if(_0x2b4414){_0x1c86c8=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))[_0xf326('0x75')]([_0xf326('0x76'),_0xf326('0x5f'),_0xf326('0x60'),_0xf326('0x67'),_0xf326('0x77'),_0xf326('0x61'),_0xf326('0x6a')],squel[_0xf326('0x62')]()[_0xf326('0x63')]('ANY_VALUE(calleridnum)',_0xf326('0x76'))[_0xf326('0x63')]('NOW()',_0xf326('0x5f'))[_0xf326('0x63')]('ANY_VALUE(ContactId)',_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x78'),_0xf326('0x77'))['field'](_0xf326('0x64'),_0xf326('0x61'))[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')](_0xf326('0x79'))[_0xf326('0x37')]('CampaignId\x20=\x20?',_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where'](_0xf326('0x6d'),_0x26bbb1['body'][_0xf326('0x6e')][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x7a'))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x76'))[_0xf326('0x6b')](_0xf326('0x5e'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id']['toString']()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x71'))['from'](_0xf326('0x79'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where']('state\x20=\x204'))[_0xf326('0x73')]('ContactId'))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x1c86c8);}return[];})['then'](respondWithResult(_0x4ac90e,null))['catch'](handleError(_0x4ac90e,null));};exports[_0xf326('0x7c')]=function(_0x2d92e4,_0x167ac9,_0x34870c){return db[_0xf326('0x7d')]['findOne']({'where':{'VoiceQueueId':_0x2d92e4[_0xf326('0x46')][_0xf326('0x69')],'CampaignId':_0x2d92e4[_0xf326('0x46')]['CampaignId'],'ContactId':_0x2d92e4['body']['ContactId']}})[_0xf326('0x24')](handleEntityNotFound(_0x167ac9,null))[_0xf326('0x24')](function(_0x2d275d){if(_0x2d275d){return _0x2d275d;}return null;})[_0xf326('0x24')](respondWithResult(_0x167ac9,null))[_0xf326('0x40')](handleError(_0x167ac9,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 0181397..aaf2b41 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 _0x130d=['path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','bluebird'];(function(_0x5bc85f,_0x599249){var _0xe2955d=function(_0x1b7067){while(--_0x1b7067){_0x5bc85f['push'](_0x5bc85f['shift']());}};_0xe2955d(++_0x599249);}(_0x130d,0x106));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd130('0x0'));var util=require(_0xd130('0x1'));var logger=require(_0xd130('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd130('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd130('0x4'));var rimraf=require(_0xd130('0x5'));var config=require(_0xd130('0x6'));var attributes=require(_0xd130('0x7'));module[_0xd130('0x8')]=function(_0x553c41,_0x2c24e7){return _0x553c41[_0xd130('0x9')](_0xd130('0xa'),attributes,{'tableName':_0xd130('0xb'),'paranoid':![],'indexes':[{'name':_0xd130('0xc'),'fields':[_0xd130('0xc')]},{'name':_0xd130('0xd'),'fields':[_0xd130('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x021c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid'];(function(_0x48c212,_0x51a505){var _0x1fdce7=function(_0x129893){while(--_0x129893){_0x48c212['push'](_0x48c212['shift']());}};_0x1fdce7(++_0x51a505);}(_0x021c,0xe1));var _0xc021=function(_0x40b6db,_0x2a1fbb){_0x40b6db=_0x40b6db-0x0;var _0x3eaa81=_0x021c[_0x40b6db];return _0x3eaa81;};'use strict';var _=require(_0xc021('0x0'));var util=require(_0xc021('0x1'));var logger=require(_0xc021('0x2'))(_0xc021('0x3'));var moment=require(_0xc021('0x4'));var BPromise=require(_0xc021('0x5'));var rp=require(_0xc021('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc021('0x7'));var config=require(_0xc021('0x8'));var attributes=require(_0xc021('0x9'));module['exports']=function(_0x84626f,_0x34a83d){return _0x84626f[_0xc021('0xa')](_0xc021('0xb'),attributes,{'tableName':_0xc021('0xc'),'paranoid':![],'indexes':[{'name':_0xc021('0xd'),'fields':[_0xc021('0xd')]},{'name':'uniqueid','fields':[_0xc021('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 67bf558..ed5e1e9 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 _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3574a9,_0x4f1a9f){var _0x536f85=function(_0x3555a6){while(--_0x3555a6){_0x3574a9['push'](_0x3574a9['shift']());}};_0x536f85(++_0x4f1a9f);}(_0x7a54,0x106));var _0x47a5=function(_0x21fe4b,_0x1caa89){_0x21fe4b=_0x21fe4b-0x0;var _0x484e45=_0x7a54[_0x21fe4b];return _0x484e45;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +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(_0x2a9250,_0x263508){var _0x1839fe=function(_0x49bd3e){while(--_0x49bd3e){_0x2a9250['push'](_0x2a9250['shift']());}};_0x1839fe(++_0x263508);}(_0xb10b,0x12a));var _0xbb10=function(_0x490014,_0x519ad6){_0x490014=_0x490014-0x0;var _0x289bee=_0xb10b[_0x490014];return _0x289bee;};'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 5a250e2..4f81f3b 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 _0x27c4=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','checkContactHopper','update','util','connect-timeout','express'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x27c4,0x189));var _0x427c=function(_0x5552b4,_0x3d92ce){_0x5552b4=_0x5552b4-0x0;var _0x2ee108=_0x27c4[_0x5552b4];return _0x2ee108;};'use strict';var multer=require('multer');var util=require(_0x427c('0x0'));var path=require('path');var timeout=require(_0x427c('0x1'));var express=require(_0x427c('0x2'));var router=express[_0x427c('0x3')]();var fs_extra=require(_0x427c('0x4'));var auth=require(_0x427c('0x5'));var interaction=require(_0x427c('0x6'));var config=require(_0x427c('0x7'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0x427c('0x8')](),controller['index']);router[_0x427c('0x9')]('/describe',auth[_0x427c('0x8')](),controller[_0x427c('0xa')]);router['get'](_0x427c('0xb'),auth[_0x427c('0x8')](),controller['show']);router['get'](_0x427c('0xc'),auth[_0x427c('0x8')](),controller[_0x427c('0xd')]);router['get'](_0x427c('0xe'),auth[_0x427c('0x8')](),controller[_0x427c('0xf')]);router[_0x427c('0x10')](_0x427c('0x11'),auth['isAuthenticated'](),controller[_0x427c('0x12')]);router[_0x427c('0x10')]('/voice/campaign/moveContacts/:id',auth[_0x427c('0x8')](),controller[_0x427c('0x13')]);router[_0x427c('0x10')]('/checkContactHopper',auth[_0x427c('0x8')](),controller[_0x427c('0x14')]);router['put'](_0x427c('0xb'),auth[_0x427c('0x8')](),controller[_0x427c('0x15')]);module['exports']=router; \ No newline at end of file +var _0xfd11=['put','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper'];(function(_0x112486,_0x36ee43){var _0x407584=function(_0x154963){while(--_0x154963){_0x112486['push'](_0x112486['shift']());}};_0x407584(++_0x36ee43);}(_0xfd11,0x13a));var _0x1fd1=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0xfd11[_0x29d6e6];return _0xc75ff0;};'use strict';var multer=require('multer');var util=require(_0x1fd1('0x0'));var path=require(_0x1fd1('0x1'));var timeout=require(_0x1fd1('0x2'));var express=require(_0x1fd1('0x3'));var router=express[_0x1fd1('0x4')]();var fs_extra=require(_0x1fd1('0x5'));var auth=require(_0x1fd1('0x6'));var interaction=require(_0x1fd1('0x7'));var config=require(_0x1fd1('0x8'));var controller=require('./cmHopperFinal.controller');router[_0x1fd1('0x9')]('/',auth[_0x1fd1('0xa')](),controller[_0x1fd1('0xb')]);router['get'](_0x1fd1('0xc'),auth[_0x1fd1('0xa')](),controller[_0x1fd1('0xd')]);router[_0x1fd1('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x1fd1('0xe'),auth[_0x1fd1('0xa')](),controller[_0x1fd1('0xf')]);router['get']('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0x1fd1('0x10')]('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller[_0x1fd1('0x11')]);router[_0x1fd1('0x10')](_0x1fd1('0x12'),auth[_0x1fd1('0xa')](),controller[_0x1fd1('0x13')]);router['post'](_0x1fd1('0x14'),auth[_0x1fd1('0xa')](),controller[_0x1fd1('0x15')]);router[_0x1fd1('0x16')]('/:id',auth[_0x1fd1('0xa')](),controller['update']);module[_0x1fd1('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index f916fff..2fcb1cd 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 _0x3f19=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x86ca04,_0x77ec8c){var _0x3c4a3b=function(_0x178fc0){while(--_0x178fc0){_0x86ca04['push'](_0x86ca04['shift']());}};_0x3c4a3b(++_0x77ec8c);}(_0x3f19,0x157));var _0x93f1=function(_0x4c55c2,_0x5dde7e){_0x4c55c2=_0x4c55c2-0x0;var _0x469bab=_0x3f19[_0x4c55c2];return _0x469bab;};'use strict';var Sequelize=require(_0x93f1('0x0'));module[_0x93f1('0x1')]={'state':{'type':Sequelize[_0x93f1('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x93f1('0x3')]},'scheduledat':{'type':Sequelize[_0x93f1('0x4')]},'countbusyretry':{'type':Sequelize[_0x93f1('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x93f1('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x93f1('0x3')]},'calleridname':{'type':Sequelize[_0x93f1('0x3')]},'starttime':{'type':Sequelize[_0x93f1('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x93f1('0x4')]},'droptime':{'type':Sequelize[_0x93f1('0x4')]},'endtime':{'type':Sequelize[_0x93f1('0x4')]},'ringtime':{'type':Sequelize[_0x93f1('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x93f1('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x93f1('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x93f1('0x3')]},'campaign':{'type':Sequelize[_0x93f1('0x3')]},'campaigntype':{'type':Sequelize[_0x93f1('0x3')]},'membername':{'type':Sequelize[_0x93f1('0x3')]},'reason':{'type':Sequelize[_0x93f1('0x3')]},'amd':{'type':Sequelize[_0x93f1('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x93f1('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x93f1('0x4')]},'recallme':{'type':Sequelize[_0x93f1('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x93f1('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x93f1('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x93f1('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x93f1('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x93f1('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x93f1('0x3')]}}; \ No newline at end of file +var _0x229d=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x229d,0x1b0));var _0xd229=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x229d[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0xd229('0x0'));module[_0xd229('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xd229('0x2')]},'scheduledat':{'type':Sequelize[_0xd229('0x3')]},'countbusyretry':{'type':Sequelize[_0xd229('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd229('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd229('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd229('0x2')]},'calleridname':{'type':Sequelize[_0xd229('0x2')]},'starttime':{'type':Sequelize[_0xd229('0x3')]},'responsetime':{'type':Sequelize[_0xd229('0x3')]},'answertime':{'type':Sequelize[_0xd229('0x3')]},'droptime':{'type':Sequelize[_0xd229('0x3')]},'endtime':{'type':Sequelize[_0xd229('0x3')]},'ringtime':{'type':Sequelize[_0xd229('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd229('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd229('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd229('0x2')]},'campaign':{'type':Sequelize[_0xd229('0x2')]},'campaigntype':{'type':Sequelize[_0xd229('0x2')]},'membername':{'type':Sequelize[_0xd229('0x2')]},'reason':{'type':Sequelize[_0xd229('0x2')]},'amd':{'type':Sequelize[_0xd229('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd229('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xd229('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd229('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xd229('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xd229('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xd229('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd229('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd229('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd229('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd229('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xd229('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 8f203c3..9da81b1 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 _0x7cef=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','CmHopperHistory','includeAll','include','findAll','rows','catch','show','find','create','body','describe','uniqueid','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x50180c,_0x3fc232){var _0x5eaa41=function(_0x24fe64){while(--_0x24fe64){_0x50180c['push'](_0x50180c['shift']());}};_0x5eaa41(++_0x3fc232);}(_0x7cef,0xde));var _0xf7ce=function(_0x1ffc47,_0x485a79){_0x1ffc47=_0x1ffc47-0x0;var _0x2e7da4=_0x7cef[_0x1ffc47];return _0x2e7da4;};'use strict';var emlformat=require(_0xf7ce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf7ce('0x1'));var jsonpatch=require(_0xf7ce('0x2'));var rp=require(_0xf7ce('0x3'));var moment=require('moment');var BPromise=require(_0xf7ce('0x4'));var Mustache=require('mustache');var util=require(_0xf7ce('0x5'));var path=require(_0xf7ce('0x6'));var sox=require(_0xf7ce('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7ce('0x8'));var squel=require(_0xf7ce('0x9'));var crypto=require(_0xf7ce('0xa'));var jsforce=require(_0xf7ce('0xb'));var deskjs=require(_0xf7ce('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf7ce('0xd'));var Papa=require(_0xf7ce('0xe'));var Redis=require(_0xf7ce('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf7ce('0x10'));var as=require(_0xf7ce('0x11'));var hardwareService=require(_0xf7ce('0x12'));var logger=require(_0xf7ce('0x13'))(_0xf7ce('0x14'));var utils=require(_0xf7ce('0x15'));var config=require(_0xf7ce('0x16'));var licenseUtil=require(_0xf7ce('0x17'));var db=require(_0xf7ce('0x18'))['db'];function respondWithStatusCode(_0x188d4c,_0x15f7a0){_0x15f7a0=_0x15f7a0||0xcc;return function(_0x48811b){if(_0x48811b){return _0x188d4c[_0xf7ce('0x19')](_0x15f7a0);}return _0x188d4c[_0xf7ce('0x1a')](_0x15f7a0)[_0xf7ce('0x1b')]();};}function respondWithResult(_0x3b53de,_0x16f654){_0x16f654=_0x16f654||0xc8;return function(_0x22b1ca){if(_0x22b1ca){return _0x3b53de[_0xf7ce('0x1a')](_0x16f654)[_0xf7ce('0x1c')](_0x22b1ca);}};}function respondWithFilteredResult(_0x426ebd,_0x563b0b){return function(_0x2bf24b){if(_0x2bf24b){var _0x2ccdbe=typeof _0x563b0b[_0xf7ce('0x1d')]===_0xf7ce('0x1e')&&typeof _0x563b0b['limit']===_0xf7ce('0x1e');var _0x4134b9=_0x2bf24b[_0xf7ce('0x1f')];var _0x631a2b=_0x2ccdbe?0x0:_0x563b0b[_0xf7ce('0x1d')];var _0x58be94=_0x2ccdbe?_0x2bf24b[_0xf7ce('0x1f')]:_0x563b0b[_0xf7ce('0x1d')]+_0x563b0b[_0xf7ce('0x20')];var _0x3b5614;if(_0x58be94>=_0x4134b9){_0x58be94=_0x4134b9;_0x3b5614=0xc8;}else{_0x3b5614=0xce;}_0x426ebd[_0xf7ce('0x1a')](_0x3b5614);return _0x426ebd[_0xf7ce('0x21')](_0xf7ce('0x22'),_0x631a2b+'-'+_0x58be94+'/'+_0x4134b9)['json'](_0x2bf24b);}return null;};}function patchUpdates(_0x546cd0){return function(_0x3aa57e){try{jsonpatch[_0xf7ce('0x23')](_0x3aa57e,_0x546cd0,!![]);}catch(_0xb5823e){return BPromise[_0xf7ce('0x24')](_0xb5823e);}return _0x3aa57e[_0xf7ce('0x25')]();};}function saveUpdates(_0x4fd1d1,_0x51cff9){return function(_0x51d3be){if(_0x51d3be){return _0x51d3be[_0xf7ce('0x26')](_0x4fd1d1)[_0xf7ce('0x27')](function(_0x36f11f){return _0x36f11f;});}return null;};}function removeEntity(_0x33eaed,_0x2ad1fa){return function(_0x5b3805){if(_0x5b3805){return _0x5b3805['destroy']()[_0xf7ce('0x27')](function(){_0x33eaed['status'](0xcc)[_0xf7ce('0x1b')]();});}};}function handleEntityNotFound(_0x5f58f1,_0xc9f6c8){return function(_0x1052ba){if(!_0x1052ba){_0x5f58f1['sendStatus'](0x194);}return _0x1052ba;};}function handleError(_0x102226,_0x28cc43){_0x28cc43=_0x28cc43||0x1f4;return function(_0x36cdcf){logger[_0xf7ce('0x28')](_0x36cdcf[_0xf7ce('0x29')]);if(_0x36cdcf[_0xf7ce('0x2a')]){delete _0x36cdcf[_0xf7ce('0x2a')];}_0x102226[_0xf7ce('0x1a')](_0x28cc43)['send'](_0x36cdcf);};}exports[_0xf7ce('0x2b')]=function(_0x242665,_0x4aeca4){var _0x132017={},_0x5abcfd={},_0x333ecf={'count':0x0,'rows':[]};var _0x2837aa=_[_0xf7ce('0x2c')](db['CmHopperHistory'][_0xf7ce('0x2d')],function(_0x57a1d0){return{'name':_0x57a1d0[_0xf7ce('0x2e')],'type':_0x57a1d0[_0xf7ce('0x2f')][_0xf7ce('0x30')]};});_0x5abcfd[_0xf7ce('0x31')]=_[_0xf7ce('0x2c')](_0x2837aa,_0xf7ce('0x2a'));_0x5abcfd['query']=_[_0xf7ce('0x32')](_0x242665[_0xf7ce('0x33')]);_0x5abcfd[_0xf7ce('0x34')]=_[_0xf7ce('0x35')](_0x5abcfd[_0xf7ce('0x31')],_0x5abcfd['query']);_0x132017[_0xf7ce('0x36')]=_[_0xf7ce('0x35')](_0x5abcfd[_0xf7ce('0x31')],qs['fields'](_0x242665[_0xf7ce('0x33')][_0xf7ce('0x37')]));_0x132017['attributes']=_0x132017[_0xf7ce('0x36')][_0xf7ce('0x38')]?_0x132017['attributes']:_0x5abcfd['model'];if(!_0x242665[_0xf7ce('0x33')][_0xf7ce('0x39')](_0xf7ce('0x3a'))){_0x132017[_0xf7ce('0x20')]=qs[_0xf7ce('0x20')](_0x242665['query'][_0xf7ce('0x20')]);_0x132017[_0xf7ce('0x1d')]=qs[_0xf7ce('0x1d')](_0x242665[_0xf7ce('0x33')][_0xf7ce('0x1d')]);}_0x132017[_0xf7ce('0x3b')]=qs[_0xf7ce('0x3c')](_0x242665[_0xf7ce('0x33')][_0xf7ce('0x3c')]);_0x132017['where']=qs[_0xf7ce('0x34')](_[_0xf7ce('0x3d')](_0x242665[_0xf7ce('0x33')],_0x5abcfd[_0xf7ce('0x34')]),_0x2837aa);if(_0x242665[_0xf7ce('0x33')][_0xf7ce('0x3e')]){_0x132017[_0xf7ce('0x3f')]=_[_0xf7ce('0x40')](_0x132017[_0xf7ce('0x3f')],{'$or':_[_0xf7ce('0x2c')](_0x2837aa,function(_0xf00546){if(_0xf00546[_0xf7ce('0x2f')]!==_0xf7ce('0x41')){var _0x1d4987={};_0x1d4987[_0xf00546[_0xf7ce('0x2a')]]={'$like':'%'+_0x242665[_0xf7ce('0x33')][_0xf7ce('0x3e')]+'%'};return _0x1d4987;}})});}_0x132017=_[_0xf7ce('0x40')]({},_0x132017,_0x242665[_0xf7ce('0x42')]);var _0x306560={'where':_0x132017['where']};return db[_0xf7ce('0x43')][_0xf7ce('0x1f')](_0x306560)[_0xf7ce('0x27')](function(_0x4c7d73){_0x333ecf['count']=_0x4c7d73;if(_0x242665[_0xf7ce('0x33')][_0xf7ce('0x44')]){_0x132017[_0xf7ce('0x45')]=[{'all':!![]}];}return db[_0xf7ce('0x43')][_0xf7ce('0x46')](_0x132017);})[_0xf7ce('0x27')](function(_0x21ab8f){_0x333ecf[_0xf7ce('0x47')]=_0x21ab8f;return _0x333ecf;})['then'](respondWithFilteredResult(_0x4aeca4,_0x132017))[_0xf7ce('0x48')](handleError(_0x4aeca4,null));};exports[_0xf7ce('0x49')]=function(_0x14ad80,_0x26d5c1){var _0x470bbd={'raw':!![],'where':{'id':_0x14ad80['params']['id']}},_0x2a1aa4={};_0x2a1aa4['model']=_['keys'](db['CmHopperHistory'][_0xf7ce('0x2d')]);_0x2a1aa4[_0xf7ce('0x33')]=_[_0xf7ce('0x32')](_0x14ad80[_0xf7ce('0x33')]);_0x2a1aa4[_0xf7ce('0x34')]=_[_0xf7ce('0x35')](_0x2a1aa4['model'],_0x2a1aa4[_0xf7ce('0x33')]);_0x470bbd[_0xf7ce('0x36')]=_['intersection'](_0x2a1aa4[_0xf7ce('0x31')],qs[_0xf7ce('0x37')](_0x14ad80[_0xf7ce('0x33')][_0xf7ce('0x37')]));_0x470bbd['attributes']=_0x470bbd[_0xf7ce('0x36')]['length']?_0x470bbd[_0xf7ce('0x36')]:_0x2a1aa4[_0xf7ce('0x31')];if(_0x14ad80['query'][_0xf7ce('0x44')]){_0x470bbd['include']=[{'all':!![]}];}_0x470bbd=_[_0xf7ce('0x40')]({},_0x470bbd,_0x14ad80['options']);return db[_0xf7ce('0x43')][_0xf7ce('0x4a')](_0x470bbd)['then'](handleEntityNotFound(_0x26d5c1,null))[_0xf7ce('0x27')](respondWithResult(_0x26d5c1,null))[_0xf7ce('0x48')](handleError(_0x26d5c1,null));};exports[_0xf7ce('0x4b')]=function(_0xe810c6,_0x4e8120){return db[_0xf7ce('0x43')][_0xf7ce('0x4b')](_0xe810c6[_0xf7ce('0x4c')],{})[_0xf7ce('0x27')](respondWithResult(_0x4e8120,0xc9))[_0xf7ce('0x48')](handleError(_0x4e8120,null));};exports[_0xf7ce('0x4d')]=function(_0x2adf79,_0x2f7d9e){return db[_0xf7ce('0x43')]['describe']()['then'](respondWithResult(_0x2f7d9e,null))[_0xf7ce('0x48')](handleError(_0x2f7d9e,null));};exports[_0xf7ce('0x26')]=function(_0x5c65d9,_0x1a1f49){if(_0x5c65d9['body'][_0xf7ce('0x4e')]){delete _0x5c65d9[_0xf7ce('0x4c')][_0xf7ce('0x4e')];}return db[_0xf7ce('0x43')][_0xf7ce('0x4a')]({'where':{'uniqueid':_0x5c65d9[_0xf7ce('0x4f')]['id']}})[_0xf7ce('0x27')](handleEntityNotFound(_0x1a1f49,null))['then'](saveUpdates(_0x5c65d9[_0xf7ce('0x4c')],null))['then'](respondWithResult(_0x1a1f49,null))['catch'](handleError(_0x1a1f49,null));}; \ No newline at end of file +var _0x8b33=['querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','CmHopperHistory','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv'];(function(_0x2e41e2,_0x4e7250){var _0x2844d6=function(_0x28ce24){while(--_0x28ce24){_0x2e41e2['push'](_0x2e41e2['shift']());}};_0x2844d6(++_0x4e7250);}(_0x8b33,0x87));var _0x38b3=function(_0x4e142b,_0x402f7b){_0x4e142b=_0x4e142b-0x0;var _0x28789d=_0x8b33[_0x4e142b];return _0x28789d;};'use strict';var emlformat=require(_0x38b3('0x0'));var rimraf=require(_0x38b3('0x1'));var zipdir=require(_0x38b3('0x2'));var jsonpatch=require(_0x38b3('0x3'));var rp=require('request-promise');var moment=require(_0x38b3('0x4'));var BPromise=require(_0x38b3('0x5'));var Mustache=require('mustache');var util=require(_0x38b3('0x6'));var path=require(_0x38b3('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x38b3('0x8'));var fs=require('fs');var fs_extra=require(_0x38b3('0x9'));var _=require(_0x38b3('0xa'));var squel=require(_0x38b3('0xb'));var crypto=require(_0x38b3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x38b3('0xd'));var toCsv=require(_0x38b3('0xe'));var querystring=require(_0x38b3('0xf'));var Papa=require('papaparse');var Redis=require(_0x38b3('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38b3('0x11'));var logger=require(_0x38b3('0x12'))(_0x38b3('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x38b3('0x14'));var db=require(_0x38b3('0x15'))['db'];function respondWithStatusCode(_0x2f498d,_0x16d8ce){_0x16d8ce=_0x16d8ce||0xcc;return function(_0x280507){if(_0x280507){return _0x2f498d['sendStatus'](_0x16d8ce);}return _0x2f498d[_0x38b3('0x16')](_0x16d8ce)[_0x38b3('0x17')]();};}function respondWithResult(_0x148323,_0x27ffa7){_0x27ffa7=_0x27ffa7||0xc8;return function(_0x312a24){if(_0x312a24){return _0x148323['status'](_0x27ffa7)[_0x38b3('0x18')](_0x312a24);}};}function respondWithFilteredResult(_0xdc88ff,_0x4fba31){return function(_0x4c9735){if(_0x4c9735){var _0x428020=typeof _0x4fba31[_0x38b3('0x19')]===_0x38b3('0x1a')&&typeof _0x4fba31[_0x38b3('0x1b')]===_0x38b3('0x1a');var _0xbfe9d8=_0x4c9735[_0x38b3('0x1c')];var _0x5c9d70=_0x428020?0x0:_0x4fba31[_0x38b3('0x19')];var _0x28946d=_0x428020?_0x4c9735[_0x38b3('0x1c')]:_0x4fba31[_0x38b3('0x19')]+_0x4fba31[_0x38b3('0x1b')];var _0x5df2c9;if(_0x28946d>=_0xbfe9d8){_0x28946d=_0xbfe9d8;_0x5df2c9=0xc8;}else{_0x5df2c9=0xce;}_0xdc88ff[_0x38b3('0x16')](_0x5df2c9);return _0xdc88ff['set']('Content-Range',_0x5c9d70+'-'+_0x28946d+'/'+_0xbfe9d8)['json'](_0x4c9735);}return null;};}function patchUpdates(_0x5dc341){return function(_0x22555f){try{jsonpatch[_0x38b3('0x1d')](_0x22555f,_0x5dc341,!![]);}catch(_0x437575){return BPromise[_0x38b3('0x1e')](_0x437575);}return _0x22555f[_0x38b3('0x1f')]();};}function saveUpdates(_0x2ef225,_0x44a379){return function(_0x45ac90){if(_0x45ac90){return _0x45ac90[_0x38b3('0x20')](_0x2ef225)['then'](function(_0x3c7b2f){return _0x3c7b2f;});}return null;};}function removeEntity(_0x56831e,_0x127714){return function(_0x3a8f7e){if(_0x3a8f7e){return _0x3a8f7e[_0x38b3('0x21')]()[_0x38b3('0x22')](function(){_0x56831e[_0x38b3('0x16')](0xcc)[_0x38b3('0x17')]();});}};}function handleEntityNotFound(_0x244d56,_0x267778){return function(_0x206050){if(!_0x206050){_0x244d56[_0x38b3('0x23')](0x194);}return _0x206050;};}function handleError(_0x509b63,_0xd9fae1){_0xd9fae1=_0xd9fae1||0x1f4;return function(_0x3d09d3){logger[_0x38b3('0x24')](_0x3d09d3[_0x38b3('0x25')]);if(_0x3d09d3[_0x38b3('0x26')]){delete _0x3d09d3[_0x38b3('0x26')];}_0x509b63['status'](_0xd9fae1)[_0x38b3('0x27')](_0x3d09d3);};}exports[_0x38b3('0x28')]=function(_0x1265f3,_0xa096f2){var _0x3c9898={},_0x3b8b90={},_0x193838={'count':0x0,'rows':[]};var _0x236c1c=_[_0x38b3('0x29')](db[_0x38b3('0x2a')]['rawAttributes'],function(_0xc2214d){return{'name':_0xc2214d['fieldName'],'type':_0xc2214d[_0x38b3('0x2b')][_0x38b3('0x2c')]};});_0x3b8b90['model']=_['map'](_0x236c1c,_0x38b3('0x26'));_0x3b8b90[_0x38b3('0x2d')]=_[_0x38b3('0x2e')](_0x1265f3['query']);_0x3b8b90['filters']=_[_0x38b3('0x2f')](_0x3b8b90[_0x38b3('0x30')],_0x3b8b90['query']);_0x3c9898[_0x38b3('0x31')]=_[_0x38b3('0x2f')](_0x3b8b90[_0x38b3('0x30')],qs[_0x38b3('0x32')](_0x1265f3['query']['fields']));_0x3c9898[_0x38b3('0x31')]=_0x3c9898[_0x38b3('0x31')][_0x38b3('0x33')]?_0x3c9898[_0x38b3('0x31')]:_0x3b8b90[_0x38b3('0x30')];if(!_0x1265f3[_0x38b3('0x2d')][_0x38b3('0x34')](_0x38b3('0x35'))){_0x3c9898[_0x38b3('0x1b')]=qs[_0x38b3('0x1b')](_0x1265f3['query'][_0x38b3('0x1b')]);_0x3c9898['offset']=qs[_0x38b3('0x19')](_0x1265f3['query'][_0x38b3('0x19')]);}_0x3c9898[_0x38b3('0x36')]=qs['sort'](_0x1265f3['query'][_0x38b3('0x37')]);_0x3c9898[_0x38b3('0x38')]=qs[_0x38b3('0x39')](_[_0x38b3('0x3a')](_0x1265f3['query'],_0x3b8b90[_0x38b3('0x39')]),_0x236c1c);if(_0x1265f3[_0x38b3('0x2d')][_0x38b3('0x3b')]){_0x3c9898[_0x38b3('0x38')]=_[_0x38b3('0x3c')](_0x3c9898[_0x38b3('0x38')],{'$or':_['map'](_0x236c1c,function(_0x40b486){if(_0x40b486[_0x38b3('0x2b')]!==_0x38b3('0x3d')){var _0x3a4d2e={};_0x3a4d2e[_0x40b486[_0x38b3('0x26')]]={'$like':'%'+_0x1265f3[_0x38b3('0x2d')][_0x38b3('0x3b')]+'%'};return _0x3a4d2e;}})});}_0x3c9898=_[_0x38b3('0x3c')]({},_0x3c9898,_0x1265f3['options']);var _0x37c618={'where':_0x3c9898[_0x38b3('0x38')]};return db['CmHopperHistory'][_0x38b3('0x1c')](_0x37c618)['then'](function(_0x464f1d){_0x193838['count']=_0x464f1d;if(_0x1265f3['query'][_0x38b3('0x3e')]){_0x3c9898['include']=[{'all':!![]}];}return db[_0x38b3('0x2a')][_0x38b3('0x3f')](_0x3c9898);})[_0x38b3('0x22')](function(_0x3c3e60){_0x193838[_0x38b3('0x40')]=_0x3c3e60;return _0x193838;})[_0x38b3('0x22')](respondWithFilteredResult(_0xa096f2,_0x3c9898))['catch'](handleError(_0xa096f2,null));};exports[_0x38b3('0x41')]=function(_0x5c117a,_0x3b3faa){var _0x5d30ae={'raw':!![],'where':{'id':_0x5c117a[_0x38b3('0x42')]['id']}},_0x5edb9a={};_0x5edb9a['model']=_['keys'](db[_0x38b3('0x2a')][_0x38b3('0x43')]);_0x5edb9a[_0x38b3('0x2d')]=_[_0x38b3('0x2e')](_0x5c117a[_0x38b3('0x2d')]);_0x5edb9a[_0x38b3('0x39')]=_[_0x38b3('0x2f')](_0x5edb9a[_0x38b3('0x30')],_0x5edb9a[_0x38b3('0x2d')]);_0x5d30ae[_0x38b3('0x31')]=_[_0x38b3('0x2f')](_0x5edb9a[_0x38b3('0x30')],qs[_0x38b3('0x32')](_0x5c117a[_0x38b3('0x2d')][_0x38b3('0x32')]));_0x5d30ae['attributes']=_0x5d30ae[_0x38b3('0x31')][_0x38b3('0x33')]?_0x5d30ae[_0x38b3('0x31')]:_0x5edb9a[_0x38b3('0x30')];if(_0x5c117a['query'][_0x38b3('0x3e')]){_0x5d30ae[_0x38b3('0x44')]=[{'all':!![]}];}_0x5d30ae=_[_0x38b3('0x3c')]({},_0x5d30ae,_0x5c117a['options']);return db[_0x38b3('0x2a')][_0x38b3('0x45')](_0x5d30ae)['then'](handleEntityNotFound(_0x3b3faa,null))['then'](respondWithResult(_0x3b3faa,null))[_0x38b3('0x46')](handleError(_0x3b3faa,null));};exports[_0x38b3('0x47')]=function(_0x35345b,_0xbf3c03){return db[_0x38b3('0x2a')][_0x38b3('0x47')](_0x35345b[_0x38b3('0x48')],{})[_0x38b3('0x22')](respondWithResult(_0xbf3c03,0xc9))[_0x38b3('0x46')](handleError(_0xbf3c03,null));};exports[_0x38b3('0x49')]=function(_0x4750cd,_0x4662cc){return db[_0x38b3('0x2a')][_0x38b3('0x49')]()['then'](respondWithResult(_0x4662cc,null))['catch'](handleError(_0x4662cc,null));};exports[_0x38b3('0x20')]=function(_0x32ba46,_0xff02a0){if(_0x32ba46[_0x38b3('0x48')][_0x38b3('0x4a')]){delete _0x32ba46[_0x38b3('0x48')][_0x38b3('0x4a')];}return db[_0x38b3('0x2a')][_0x38b3('0x45')]({'where':{'uniqueid':_0x32ba46[_0x38b3('0x42')]['id']}})['then'](handleEntityNotFound(_0xff02a0,null))[_0x38b3('0x22')](saveUpdates(_0x32ba46[_0x38b3('0x48')],null))['then'](respondWithResult(_0xff02a0,null))['catch'](handleError(_0xff02a0,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 1f0c2ba..a803f7c 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 _0xf3a8=['util','../../config/logger','moment','path','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x693b8e,_0x5af6d9){var _0x1c491c=function(_0x5b685a){while(--_0x5b685a){_0x693b8e['push'](_0x693b8e['shift']());}};_0x1c491c(++_0x5af6d9);}(_0xf3a8,0xf2));var _0x8f3a=function(_0x41ad87,_0x2f9560){_0x41ad87=_0x41ad87-0x0;var _0x5b1acc=_0xf3a8[_0x41ad87];return _0x5b1acc;};'use strict';var _=require('lodash');var util=require(_0x8f3a('0x0'));var logger=require(_0x8f3a('0x1'))('api');var moment=require(_0x8f3a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f3a('0x3'));var rimraf=require('rimraf');var config=require(_0x8f3a('0x4'));var attributes=require('./cmHopperHistory.attributes');module[_0x8f3a('0x5')]=function(_0x3d6e2d,_0x109997){return _0x3d6e2d[_0x8f3a('0x6')](_0x8f3a('0x7'),attributes,{'tableName':_0x8f3a('0x8'),'paranoid':![],'indexes':[{'name':_0x8f3a('0x9'),'fields':[_0x8f3a('0x9')]},{'name':_0x8f3a('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x38b8=['uniqueid','lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','CmHopperHistory','cm_hopper_history'];(function(_0x2acd5c,_0x3c78d0){var _0x4ee361=function(_0x5391d9){while(--_0x5391d9){_0x2acd5c['push'](_0x2acd5c['shift']());}};_0x4ee361(++_0x3c78d0);}(_0x38b8,0x7f));var _0x838b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x838b('0x0'));var util=require('util');var logger=require(_0x838b('0x1'))(_0x838b('0x2'));var moment=require('moment');var BPromise=require(_0x838b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x838b('0x4'));var config=require(_0x838b('0x5'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x43fd53,_0x4299dc){return _0x43fd53['define'](_0x838b('0x6'),attributes,{'tableName':_0x838b('0x7'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0x838b('0x8'),'fields':[_0x838b('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index f68f577..3ec59dc 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 _0x755e=['outboundReCallsDay','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','name','ivrTotalCallsDays','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','AvgHandleTime','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','findAll','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x755e,0x96));var _0xe755=function(_0x1558ee,_0x40ed70){_0x1558ee=_0x1558ee-0x0;var _0x252dba=_0x755e[_0x1558ee];return _0x252dba;};'use strict';var _=require(_0xe755('0x0'));var util=require(_0xe755('0x1'));var moment=require(_0xe755('0x2'));var BPromise=require(_0xe755('0x3'));var rs=require(_0xe755('0x4'));var fs=require('fs');var Redis=require(_0xe755('0x5'));var db=require(_0xe755('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe755('0x7'))('rpc');var config=require(_0xe755('0x8'));var jayson=require(_0xe755('0x9'));var client=jayson[_0xe755('0xa')][_0xe755('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3184c3,_0x58b2e7,_0x135a54){return new BPromise(function(_0x503412,_0x2f7288){return client['request'](_0x3184c3,_0x135a54)[_0xe755('0xc')](function(_0x232c36){logger[_0xe755('0xd')](_0xe755('0xe'),_0x58b2e7,_0xe755('0xf'));logger[_0xe755('0x10')](_0xe755('0x11'),_0x58b2e7,_0xe755('0xf'),JSON[_0xe755('0x12')](_0x232c36));if(_0x232c36[_0xe755('0x13')]){if(_0x232c36[_0xe755('0x13')][_0xe755('0x14')]===0x1f4){logger['error'](_0xe755('0xe'),_0x58b2e7,_0x232c36[_0xe755('0x13')]['message']);return _0x2f7288(_0x232c36[_0xe755('0x13')][_0xe755('0x15')]);}logger[_0xe755('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x58b2e7,_0x232c36[_0xe755('0x13')][_0xe755('0x15')]);return _0x503412(_0x232c36['error'][_0xe755('0x15')]);}else{logger[_0xe755('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x58b2e7,_0xe755('0xf'));_0x503412(_0x232c36['result'][_0xe755('0x15')]);}})[_0xe755('0x16')](function(_0xb75468){logger[_0xe755('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x58b2e7,_0xb75468);_0x2f7288(_0xb75468);});});}exports[_0xe755('0x17')]=function(_0x597ea9){var _0x29dda6=this;return new Promise(function(_0x5ede72,_0x415451){return db[_0xe755('0x18')]['create'](_0x597ea9[_0xe755('0x19')],{'raw':_0x597ea9[_0xe755('0x1a')]?_0x597ea9[_0xe755('0x1a')][_0xe755('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x7ff66c){logger[_0xe755('0xd')](_0xe755('0x17'),_0x597ea9);logger[_0xe755('0x10')](_0xe755('0x17'),_0x597ea9,JSON[_0xe755('0x12')](_0x7ff66c));_0x5ede72(_0x7ff66c);})[_0xe755('0x16')](function(_0x196df2){logger[_0xe755('0x13')](_0xe755('0x17'),_0x196df2['message'],_0x597ea9);_0x415451(_0x29dda6[_0xe755('0x13')](0x1f4,_0x196df2[_0xe755('0x15')]));});});};exports[_0xe755('0x1c')]=function(_0x4e56b6){var _0x2846f8=this;return new Promise(function(_0xf19c9a,_0x858774){return db[_0xe755('0x18')]['findAll']({'raw':_0x4e56b6['options']?_0x4e56b6[_0xe755('0x1a')][_0xe755('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e56b6[_0xe755('0x1a')]?_0x4e56b6[_0xe755('0x1a')][_0xe755('0x1d')]||null:null,'attributes':[[db[_0xe755('0x1e')]['fn'](_0xe755('0x1f'),db[_0xe755('0x1e')]['col']('id')),_0xe755('0x20')],[db[_0xe755('0x1e')]['fn']('COUNT',db[_0xe755('0x1e')]['fn']('IF',db['sequelize'][_0xe755('0x21')](_0xe755('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0xe755('0x1e')]['fn'](_0xe755('0x1f'),db[_0xe755('0x1e')]['fn']('IF',db[_0xe755('0x1e')]['literal'](_0xe755('0x23')))),_0xe755('0x24')],[db[_0xe755('0x1e')]['fn']('COUNT',db[_0xe755('0x1e')]['fn']('IF',db[_0xe755('0x1e')][_0xe755('0x21')](_0xe755('0x25')))),_0xe755('0x26')],[db['sequelize']['fn'](_0xe755('0x27'),db[_0xe755('0x1e')]['fn']('IF',db['sequelize'][_0xe755('0x21')](_0xe755('0x28')))),_0xe755('0x29')],[db[_0xe755('0x1e')]['fn'](_0xe755('0x27'),db[_0xe755('0x1e')]['fn']('IF',db[_0xe755('0x1e')][_0xe755('0x21')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xe755('0x2a')]]})[_0xe755('0xc')](function(_0x31bb04){logger['info'](_0xe755('0x1c'),_0x4e56b6);logger[_0xe755('0x10')]('AvgHandleTime',_0x4e56b6,JSON[_0xe755('0x12')](_0x31bb04));_0xf19c9a(_0x31bb04);})[_0xe755('0x16')](function(_0x3973c9){logger[_0xe755('0x13')](_0xe755('0x1c'),_0x3973c9[_0xe755('0x15')],_0x4e56b6);_0x858774(_0x2846f8[_0xe755('0x13')](0x1f4,_0x3973c9[_0xe755('0x15')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x40887b){var _0xbf4dc9=this;return new Promise(function(_0x16ae97,_0x5e4cea){return db[_0xe755('0x18')][_0xe755('0x2b')]({'raw':_0x40887b[_0xe755('0x1a')]?_0x40887b['options']['raw']===undefined?!![]:![]:!![],'where':_0x40887b[_0xe755('0x1a')]?_0x40887b[_0xe755('0x1a')][_0xe755('0x1d')]||null:null,'attributes':[['campaign','name'],[db[_0xe755('0x1e')]['fn'](_0xe755('0x1f'),db[_0xe755('0x1e')]['fn']('IF',db[_0xe755('0x1e')][_0xe755('0x21')](_0xe755('0x2c')))),_0xe755('0x2d')],[db[_0xe755('0x1e')]['fn'](_0xe755('0x1f'),db[_0xe755('0x1e')]['fn']('IF',db[_0xe755('0x1e')][_0xe755('0x21')](_0xe755('0x2e')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0xe755('0x1f'),db[_0xe755('0x1e')]['fn']('IF',db[_0xe755('0x1e')][_0xe755('0x21')](_0xe755('0x22')))),_0xe755('0x2f')],[db['sequelize']['fn'](_0xe755('0x1f'),db[_0xe755('0x1e')]['fn']('IF',db[_0xe755('0x1e')][_0xe755('0x21')](_0xe755('0x30')))),_0xe755('0x31')],[db[_0xe755('0x1e')]['fn']('COUNT',db[_0xe755('0x1e')]['fn']('IF',db['sequelize'][_0xe755('0x21')](_0xe755('0x32')))),_0xe755('0x33')],[db[_0xe755('0x1e')]['fn'](_0xe755('0x1f'),db[_0xe755('0x1e')]['fn']('IF',db[_0xe755('0x1e')][_0xe755('0x21')](_0xe755('0x34')))),_0xe755('0x35')],[db[_0xe755('0x1e')]['fn'](_0xe755('0x1f'),db[_0xe755('0x1e')]['fn']('IF',db['sequelize'][_0xe755('0x21')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xe755('0x36')],[db[_0xe755('0x1e')]['fn'](_0xe755('0x1f'),db[_0xe755('0x1e')]['fn']('IF',db[_0xe755('0x1e')][_0xe755('0x21')](_0xe755('0x37')))),_0xe755('0x38')],[db[_0xe755('0x1e')]['fn'](_0xe755('0x1f'),db[_0xe755('0x1e')]['fn']('IF',db['sequelize'][_0xe755('0x21')](_0xe755('0x39')))),_0xe755('0x3a')],[db[_0xe755('0x1e')]['fn'](_0xe755('0x1f'),db[_0xe755('0x1e')]['fn']('IF',db[_0xe755('0x1e')][_0xe755('0x21')](_0xe755('0x3b')))),_0xe755('0x3c')],[db['sequelize']['fn'](_0xe755('0x1f'),db['sequelize']['fn']('IF',db[_0xe755('0x1e')][_0xe755('0x21')](_0xe755('0x3d')))),'outboundRejectCallsDay'],[db[_0xe755('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xe755('0x3e')))),_0xe755('0x3f')],[db[_0xe755('0x1e')]['fn']('COUNT',db[_0xe755('0x1e')]['fn']('IF',db['sequelize'][_0xe755('0x21')](_0xe755('0x40')))),'outboundRejectCallsDay'],[db[_0xe755('0x1e')]['fn'](_0xe755('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xe755('0x21')](_0xe755('0x41')))),_0xe755('0x42')]],'group':[_0xe755('0x43')]})['then'](function(_0x2845b2){logger[_0xe755('0xd')](_0xe755('0x44'),_0x40887b);logger['debug']('GetVoiceQueueHopperHistory',_0x40887b,JSON[_0xe755('0x12')](_0x2845b2));_0x16ae97(_0x2845b2);})[_0xe755('0x16')](function(_0x17305c){logger['error'](_0xe755('0x44'),_0x17305c[_0xe755('0x15')],_0x40887b);_0x5e4cea(_0xbf4dc9['error'](0x1f4,_0x17305c[_0xe755('0x15')]));});});};exports[_0xe755('0x45')]=function(_0x8f2d59){var _0x48ad8a=this;return new Promise(function(_0x58983f,_0x403070){return db['CmHopperHistory'][_0xe755('0x2b')]({'raw':_0x8f2d59[_0xe755('0x1a')]?_0x8f2d59[_0xe755('0x1a')][_0xe755('0x1b')]===undefined?!![]:![]:!![],'where':_0x8f2d59[_0xe755('0x1a')]?_0x8f2d59[_0xe755('0x1a')][_0xe755('0x1d')]||null:null,'attributes':[[_0xe755('0x43'),_0xe755('0x46')],[db[_0xe755('0x1e')]['fn'](_0xe755('0x1f'),db[_0xe755('0x1e')]['col']('id')),_0xe755('0x47')],[db['sequelize']['fn'](_0xe755('0x1f'),db[_0xe755('0x1e')]['fn']('IF',db[_0xe755('0x1e')]['literal'](_0xe755('0x22')))),'ivrAnswerCallsDay']],'group':['campaign']})[_0xe755('0xc')](function(_0x6b8511){logger[_0xe755('0xd')](_0xe755('0x45'),_0x8f2d59);logger[_0xe755('0x10')](_0xe755('0x45'),_0x8f2d59,JSON[_0xe755('0x12')](_0x6b8511));_0x58983f(_0x6b8511);})['catch'](function(_0x2ddfe6){logger['error'](_0xe755('0x45'),_0x2ddfe6[_0xe755('0x15')],_0x8f2d59);_0x403070(_0x48ad8a[_0xe755('0x13')](0x1f4,_0x2ddfe6['message']));});});}; \ No newline at end of file +var _0x5ab4=['outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`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','outboundReCallsDay','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateCmHopperHistory','create','body','options','CmHopperHistory','where','sequelize','COUNT','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime','catch','GetVoiceQueueHopperHistory','findAll','raw','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0x5ab4,0x9f));var _0x45ab=function(_0x1ecbbb,_0x761a71){_0x1ecbbb=_0x1ecbbb-0x0;var _0x5c7880=_0x5ab4[_0x1ecbbb];return _0x5c7880;};'use strict';var _=require(_0x45ab('0x0'));var util=require(_0x45ab('0x1'));var moment=require(_0x45ab('0x2'));var BPromise=require(_0x45ab('0x3'));var rs=require(_0x45ab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45ab('0x5'))['db'];var utils=require(_0x45ab('0x6'));var logger=require(_0x45ab('0x7'))(_0x45ab('0x8'));var config=require(_0x45ab('0x9'));var jayson=require(_0x45ab('0xa'));var client=jayson['client'][_0x45ab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22a033,_0x2941e8,_0x4250ec){return new BPromise(function(_0x2beb3a,_0x2b7264){return client[_0x45ab('0xc')](_0x22a033,_0x4250ec)[_0x45ab('0xd')](function(_0x292720){logger[_0x45ab('0xe')](_0x45ab('0xf'),_0x2941e8,_0x45ab('0x10'));logger[_0x45ab('0x11')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x2941e8,_0x45ab('0x10'),JSON[_0x45ab('0x12')](_0x292720));if(_0x292720[_0x45ab('0x13')]){if(_0x292720[_0x45ab('0x13')][_0x45ab('0x14')]===0x1f4){logger[_0x45ab('0x13')](_0x45ab('0xf'),_0x2941e8,_0x292720[_0x45ab('0x13')][_0x45ab('0x15')]);return _0x2b7264(_0x292720['error']['message']);}logger[_0x45ab('0x13')](_0x45ab('0xf'),_0x2941e8,_0x292720[_0x45ab('0x13')][_0x45ab('0x15')]);return _0x2beb3a(_0x292720[_0x45ab('0x13')][_0x45ab('0x15')]);}else{logger[_0x45ab('0xe')](_0x45ab('0xf'),_0x2941e8,'request\x20sent');_0x2beb3a(_0x292720[_0x45ab('0x16')][_0x45ab('0x15')]);}})['catch'](function(_0x3a9e8b){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x2941e8,_0x3a9e8b);_0x2b7264(_0x3a9e8b);});});}exports[_0x45ab('0x17')]=function(_0x46ef46){var _0x40e4d1=this;return new Promise(function(_0xac7ce0,_0x277352){return db['CmHopperHistory'][_0x45ab('0x18')](_0x46ef46[_0x45ab('0x19')],{'raw':_0x46ef46[_0x45ab('0x1a')]?_0x46ef46[_0x45ab('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x45ab('0xd')](function(_0x54fdab){logger[_0x45ab('0xe')](_0x45ab('0x17'),_0x46ef46);logger[_0x45ab('0x11')](_0x45ab('0x17'),_0x46ef46,JSON[_0x45ab('0x12')](_0x54fdab));_0xac7ce0(_0x54fdab);})['catch'](function(_0x16549e){logger[_0x45ab('0x13')]('CreateCmHopperHistory',_0x16549e[_0x45ab('0x15')],_0x46ef46);_0x277352(_0x40e4d1[_0x45ab('0x13')](0x1f4,_0x16549e[_0x45ab('0x15')]));});});};exports['AvgHandleTime']=function(_0x229ead){var _0x559a00=this;return new Promise(function(_0x577a3a,_0x4d5fac){return db[_0x45ab('0x1b')]['findAll']({'raw':_0x229ead['options']?_0x229ead[_0x45ab('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x229ead[_0x45ab('0x1a')]?_0x229ead[_0x45ab('0x1a')][_0x45ab('0x1c')]||null:null,'attributes':[[db[_0x45ab('0x1d')]['fn'](_0x45ab('0x1e'),db[_0x45ab('0x1d')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x45ab('0x1d')]['fn'](_0x45ab('0x1e'),db[_0x45ab('0x1d')]['fn']('IF',db[_0x45ab('0x1d')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x45ab('0x1d')]['fn'](_0x45ab('0x1e'),db[_0x45ab('0x1d')]['fn']('IF',db[_0x45ab('0x1d')][_0x45ab('0x1f')](_0x45ab('0x20')))),_0x45ab('0x21')],[db[_0x45ab('0x1d')]['fn'](_0x45ab('0x1e'),db['sequelize']['fn']('IF',db[_0x45ab('0x1d')][_0x45ab('0x1f')]('`state`\x20=\x2011,\x201,\x20null'))),_0x45ab('0x22')],[db[_0x45ab('0x1d')]['fn'](_0x45ab('0x23'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x45ab('0x24')))),'predictiveIntervalAvgHoldtime'],[db[_0x45ab('0x1d')]['fn'](_0x45ab('0x23'),db['sequelize']['fn']('IF',db[_0x45ab('0x1d')][_0x45ab('0x1f')](_0x45ab('0x25')))),'predictiveIntervalAvgTalktime']]})[_0x45ab('0xd')](function(_0x2b0158){logger[_0x45ab('0xe')](_0x45ab('0x26'),_0x229ead);logger[_0x45ab('0x11')]('AvgHandleTime',_0x229ead,JSON[_0x45ab('0x12')](_0x2b0158));_0x577a3a(_0x2b0158);})[_0x45ab('0x27')](function(_0x58bd17){logger[_0x45ab('0x13')]('AvgHandleTime',_0x58bd17[_0x45ab('0x15')],_0x229ead);_0x4d5fac(_0x559a00[_0x45ab('0x13')](0x1f4,_0x58bd17[_0x45ab('0x15')]));});});};exports[_0x45ab('0x28')]=function(_0x5e5379){var _0x3d3694=this;return new Promise(function(_0x5e2fa9,_0x5aeff1){return db[_0x45ab('0x1b')][_0x45ab('0x29')]({'raw':_0x5e5379[_0x45ab('0x1a')]?_0x5e5379[_0x45ab('0x1a')][_0x45ab('0x2a')]===undefined?!![]:![]:!![],'where':_0x5e5379[_0x45ab('0x1a')]?_0x5e5379['options'][_0x45ab('0x1c')]||null:null,'attributes':[[_0x45ab('0x2b'),_0x45ab('0x2c')],[db[_0x45ab('0x1d')]['fn'](_0x45ab('0x1e'),db[_0x45ab('0x1d')]['fn']('IF',db['sequelize'][_0x45ab('0x1f')](_0x45ab('0x2d')))),_0x45ab('0x2e')],[db['sequelize']['fn'](_0x45ab('0x1e'),db[_0x45ab('0x1d')]['fn']('IF',db['sequelize'][_0x45ab('0x1f')](_0x45ab('0x2f')))),_0x45ab('0x30')],[db[_0x45ab('0x1d')]['fn'](_0x45ab('0x1e'),db[_0x45ab('0x1d')]['fn']('IF',db[_0x45ab('0x1d')][_0x45ab('0x1f')]('`state`\x20=\x204,\x201,\x20null'))),_0x45ab('0x31')],[db[_0x45ab('0x1d')]['fn'](_0x45ab('0x1e'),db[_0x45ab('0x1d')]['fn']('IF',db['sequelize'][_0x45ab('0x1f')](_0x45ab('0x32')))),'outboundBusyCallsDay'],[db[_0x45ab('0x1d')]['fn'](_0x45ab('0x1e'),db[_0x45ab('0x1d')]['fn']('IF',db['sequelize'][_0x45ab('0x1f')]('`state`\x20=\x208,\x201,\x20null'))),_0x45ab('0x33')],[db[_0x45ab('0x1d')]['fn'](_0x45ab('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x45ab('0x1f')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x45ab('0x34')],[db[_0x45ab('0x1d')]['fn'](_0x45ab('0x1e'),db['sequelize']['fn']('IF',db[_0x45ab('0x1d')][_0x45ab('0x1f')](_0x45ab('0x35')))),_0x45ab('0x36')],[db[_0x45ab('0x1d')]['fn'](_0x45ab('0x1e'),db[_0x45ab('0x1d')]['fn']('IF',db['sequelize'][_0x45ab('0x1f')]('`state`\x20=\x2012,\x201,\x20null'))),_0x45ab('0x37')],[db[_0x45ab('0x1d')]['fn'](_0x45ab('0x1e'),db[_0x45ab('0x1d')]['fn']('IF',db[_0x45ab('0x1d')][_0x45ab('0x1f')](_0x45ab('0x38')))),'outboundBlacklistCallsDay'],[db[_0x45ab('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x45ab('0x1d')]['literal'](_0x45ab('0x39')))),_0x45ab('0x3a')],[db['sequelize']['fn'](_0x45ab('0x1e'),db[_0x45ab('0x1d')]['fn']('IF',db[_0x45ab('0x1d')][_0x45ab('0x1f')](_0x45ab('0x3b')))),_0x45ab('0x3c')],[db[_0x45ab('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x45ab('0x1d')][_0x45ab('0x1f')](_0x45ab('0x3d')))),_0x45ab('0x3e')],[db[_0x45ab('0x1d')]['fn'](_0x45ab('0x1e'),db[_0x45ab('0x1d')]['fn']('IF',db[_0x45ab('0x1d')][_0x45ab('0x1f')](_0x45ab('0x3f')))),_0x45ab('0x3c')],[db[_0x45ab('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x45ab('0x1d')]['literal'](_0x45ab('0x40')))),_0x45ab('0x41')]],'group':['campaign']})['then'](function(_0x26f423){logger[_0x45ab('0xe')](_0x45ab('0x28'),_0x5e5379);logger[_0x45ab('0x11')](_0x45ab('0x28'),_0x5e5379,JSON[_0x45ab('0x12')](_0x26f423));_0x5e2fa9(_0x26f423);})[_0x45ab('0x27')](function(_0x2ee47c){logger[_0x45ab('0x13')]('GetVoiceQueueHopperHistory',_0x2ee47c[_0x45ab('0x15')],_0x5e5379);_0x5aeff1(_0x3d3694[_0x45ab('0x13')](0x1f4,_0x2ee47c[_0x45ab('0x15')]));});});};exports['GetCampaignHopperHistory']=function(_0x45c6dd){var _0x189280=this;return new Promise(function(_0xaf5bd4,_0x5505a3){return db[_0x45ab('0x1b')][_0x45ab('0x29')]({'raw':_0x45c6dd['options']?_0x45c6dd[_0x45ab('0x1a')][_0x45ab('0x2a')]===undefined?!![]:![]:!![],'where':_0x45c6dd[_0x45ab('0x1a')]?_0x45c6dd[_0x45ab('0x1a')][_0x45ab('0x1c')]||null:null,'attributes':[[_0x45ab('0x2b'),_0x45ab('0x2c')],[db[_0x45ab('0x1d')]['fn'](_0x45ab('0x1e'),db[_0x45ab('0x1d')]['col']('id')),_0x45ab('0x42')],[db['sequelize']['fn'](_0x45ab('0x1e'),db[_0x45ab('0x1d')]['fn']('IF',db['sequelize'][_0x45ab('0x1f')]('`state`\x20=\x204,\x201,\x20null'))),_0x45ab('0x43')]],'group':[_0x45ab('0x2b')]})['then'](function(_0x31e8e1){logger['info'](_0x45ab('0x44'),_0x45c6dd);logger['debug'](_0x45ab('0x44'),_0x45c6dd,JSON[_0x45ab('0x12')](_0x31e8e1));_0xaf5bd4(_0x31e8e1);})[_0x45ab('0x27')](function(_0x50d837){logger[_0x45ab('0x13')](_0x45ab('0x44'),_0x50d837[_0x45ab('0x15')],_0x45c6dd);_0x5505a3(_0x189280[_0x45ab('0x13')](0x1f4,_0x50d837['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 5fe2045..a5ff0f0 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 _0x3af3=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','util'];(function(_0x5482e4,_0x539e87){var _0x4828af=function(_0x1d2620){while(--_0x1d2620){_0x5482e4['push'](_0x5482e4['shift']());}};_0x4828af(++_0x539e87);}(_0x3af3,0x1ca));var _0x33af=function(_0x188d31,_0x576e87){_0x188d31=_0x188d31-0x0;var _0x30ed33=_0x3af3[_0x188d31];return _0x30ed33;};'use strict';var multer=require('multer');var util=require(_0x33af('0x0'));var path=require(_0x33af('0x1'));var timeout=require('connect-timeout');var express=require(_0x33af('0x2'));var router=express[_0x33af('0x3')]();var fs_extra=require(_0x33af('0x4'));var auth=require(_0x33af('0x5'));var interaction=require(_0x33af('0x6'));var config=require('../../config/environment');var controller=require(_0x33af('0x7'));router[_0x33af('0x8')]('/',auth['isAuthenticated'](),controller[_0x33af('0x9')]);router[_0x33af('0x8')](_0x33af('0xa'),auth[_0x33af('0xb')](),controller[_0x33af('0xc')]);router['get'](_0x33af('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x33af('0xe')]('/',auth['isAuthenticated'](),controller[_0x33af('0xf')]);router[_0x33af('0x10')](_0x33af('0xd'),auth[_0x33af('0xb')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x21a3=['index','get','/describe','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated'];(function(_0x754ab4,_0x56daa7){var _0x34079a=function(_0x295ec1){while(--_0x295ec1){_0x754ab4['push'](_0x754ab4['shift']());}};_0x34079a(++_0x56daa7);}(_0x21a3,0xd2));var _0x321a=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0x21a3[_0x3712e2];return _0x1faff4;};'use strict';var multer=require(_0x321a('0x0'));var util=require(_0x321a('0x1'));var path=require(_0x321a('0x2'));var timeout=require(_0x321a('0x3'));var express=require(_0x321a('0x4'));var router=express[_0x321a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x321a('0x6'));var config=require(_0x321a('0x7'));var controller=require(_0x321a('0x8'));router['get']('/',auth[_0x321a('0x9')](),controller[_0x321a('0xa')]);router[_0x321a('0xb')](_0x321a('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x321a('0xb')](_0x321a('0xd'),auth[_0x321a('0x9')](),controller[_0x321a('0xe')]);router[_0x321a('0xf')]('/',auth[_0x321a('0x9')](),controller[_0x321a('0x10')]);router[_0x321a('0x11')](_0x321a('0xd'),auth[_0x321a('0x9')](),controller[_0x321a('0x12')]);module[_0x321a('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 9260a44..e2b0839 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 _0x6f72=['exports','STRING','name'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x6f72,0xae));var _0x26f7=function(_0x475e3e,_0x5dc802){_0x475e3e=_0x475e3e-0x0;var _0x106a2f=_0x6f72[_0x475e3e];return _0x106a2f;};'use strict';var Sequelize=require('sequelize');module[_0x26f7('0x0')]={'name':{'type':Sequelize[_0x26f7('0x1')],'unique':_0x26f7('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x26f7('0x1')]}}; \ No newline at end of file +var _0xe5e0=['exports','STRING','name','sequelize'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xe5e0,0x123));var _0x0e5e=function(_0xf405af,_0x19319e){_0xf405af=_0xf405af-0x0;var _0x2c74dd=_0xe5e0[_0xf405af];return _0x2c74dd;};'use strict';var Sequelize=require(_0x0e5e('0x0'));module[_0x0e5e('0x1')]={'name':{'type':Sequelize[_0x0e5e('0x2')],'unique':_0x0e5e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0e5e('0x2')]},'dialPrefix':{'type':Sequelize[_0x0e5e('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 7dc64a0..a824c85 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 _0x15ae=['role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','getDispositions','Disposition','includeAll','removeDispositions','ids','tags','isArray','CmContact','success','push','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.deletedAt\x20is\x20null','distinct','field','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','each','isEmpty','now','writeFileSync','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','download','/tmp/list_%d_%s.csv','addCustomField','findOne','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','BOOLEAN','defaultValue','queryInterface','addColumn','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','omit','spread','removeAgents','userCmList:remove','emit','getAgents','User','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','get','Lists','UserProfileResource','destroy','end','error','stack','name','send','index','map','CmList','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','include','findAll','rows','catch','keys','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x35485a,_0x91cdd4){var _0x5148e6=function(_0x27ed1d){while(--_0x27ed1d){_0x35485a['push'](_0x35485a['shift']());}};_0x5148e6(++_0x91cdd4);}(_0x15ae,0xee));var _0xe15a=function(_0x38f107,_0x31de9e){_0x38f107=_0x38f107-0x0;var _0x245532=_0x15ae[_0x38f107];return _0x245532;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe15a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe15a('0x1'));var rp=require('request-promise');var moment=require(_0xe15a('0x2'));var BPromise=require(_0xe15a('0x3'));var Mustache=require(_0xe15a('0x4'));var util=require(_0xe15a('0x5'));var path=require(_0xe15a('0x6'));var sox=require(_0xe15a('0x7'));var csv=require(_0xe15a('0x8'));var ejs=require(_0xe15a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe15a('0xa'));var crypto=require(_0xe15a('0xb'));var jsforce=require(_0xe15a('0xc'));var deskjs=require(_0xe15a('0xd'));var toCsv=require(_0xe15a('0x8'));var querystring=require(_0xe15a('0xe'));var Papa=require(_0xe15a('0xf'));var Redis=require(_0xe15a('0x10'));var authService=require(_0xe15a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe15a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe15a('0x13'));var config=require(_0xe15a('0x14'));var licenseUtil=require(_0xe15a('0x15'));var db=require(_0xe15a('0x16'))['db'];var csv_results;config[_0xe15a('0x17')]=_[_0xe15a('0x18')](config[_0xe15a('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xe15a('0x19'))(new Redis(config[_0xe15a('0x17')]));require('./cmList.socket')[_0xe15a('0x1a')](socket);function respondWithStatusCode(_0x1c211c,_0xd11d2b){_0xd11d2b=_0xd11d2b||0xcc;return function(_0x2e9821){if(_0x2e9821){return _0x1c211c[_0xe15a('0x1b')](_0xd11d2b);}return _0x1c211c[_0xe15a('0x1c')](_0xd11d2b)['end']();};}function respondWithResult(_0x1570f1,_0xc2d73d){_0xc2d73d=_0xc2d73d||0xc8;return function(_0x210512){if(_0x210512){return _0x1570f1[_0xe15a('0x1c')](_0xc2d73d)[_0xe15a('0x1d')](_0x210512);}};}function respondWithFilteredResult(_0x231c28,_0x2de9d8){return function(_0x451ccb){if(_0x451ccb){var _0x361c93=typeof _0x2de9d8[_0xe15a('0x1e')]==='undefined'&&typeof _0x2de9d8[_0xe15a('0x1f')]===_0xe15a('0x20');var _0xf21f7b=_0x451ccb[_0xe15a('0x21')];var _0x15fb11=_0x361c93?0x0:_0x2de9d8[_0xe15a('0x1e')];var _0x6cc2c2=_0x361c93?_0x451ccb[_0xe15a('0x21')]:_0x2de9d8[_0xe15a('0x1e')]+_0x2de9d8[_0xe15a('0x1f')];var _0x345eab;if(_0x6cc2c2>=_0xf21f7b){_0x6cc2c2=_0xf21f7b;_0x345eab=0xc8;}else{_0x345eab=0xce;}_0x231c28[_0xe15a('0x1c')](_0x345eab);return _0x231c28['set'](_0xe15a('0x22'),_0x15fb11+'-'+_0x6cc2c2+'/'+_0xf21f7b)['json'](_0x451ccb);}return null;};}function patchUpdates(_0x20882f){return function(_0x1258b9){try{jsonpatch[_0xe15a('0x23')](_0x1258b9,_0x20882f,!![]);}catch(_0x27f850){return BPromise[_0xe15a('0x24')](_0x27f850);}return _0x1258b9[_0xe15a('0x25')]();};}function saveUpdates(_0x1b7a7b,_0x5cc2d3){return function(_0x383898){if(_0x383898){return _0x383898[_0xe15a('0x26')](_0x1b7a7b)['then'](function(_0x15a79c){return _0x15a79c;});}return null;};}function removeEntity(_0x21eb78,_0x3f4e37){return function(_0x7bf895){if(_0x7bf895){return _0x7bf895['destroy']()[_0xe15a('0x27')](function(){var _0xdff421=_0x7bf895[_0xe15a('0x28')]({'plain':!![]});var _0x53c983=_0xe15a('0x29');return db[_0xe15a('0x2a')][_0xe15a('0x2b')]({'where':{'type':_0x53c983,'resourceId':_0xdff421['id']}})['then'](function(){return _0x7bf895;});})['then'](function(){_0x21eb78['status'](0xcc)[_0xe15a('0x2c')]();});}};}function handleEntityNotFound(_0xd5b59b,_0x154f19){return function(_0x16f935){if(!_0x16f935){_0xd5b59b['sendStatus'](0x194);}return _0x16f935;};}function handleError(_0x11d6aa,_0x47739f){_0x47739f=_0x47739f||0x1f4;return function(_0x5b951d){logger[_0xe15a('0x2d')](_0x5b951d[_0xe15a('0x2e')]);if(_0x5b951d[_0xe15a('0x2f')]){delete _0x5b951d['name'];}_0x11d6aa['status'](_0x47739f)[_0xe15a('0x30')](_0x5b951d);};}exports[_0xe15a('0x31')]=function(_0x333ed4,_0x3d2b57){var _0x1a9274={},_0x45ecef={},_0x508a44={'count':0x0,'rows':[]};var _0x182660=_[_0xe15a('0x32')](db[_0xe15a('0x33')]['rawAttributes'],function(_0x2c823f){return{'name':_0x2c823f[_0xe15a('0x34')],'type':_0x2c823f[_0xe15a('0x35')][_0xe15a('0x36')]};});_0x45ecef['model']=_[_0xe15a('0x32')](_0x182660,_0xe15a('0x2f'));_0x45ecef[_0xe15a('0x37')]=_['keys'](_0x333ed4[_0xe15a('0x37')]);_0x45ecef['filters']=_[_0xe15a('0x38')](_0x45ecef[_0xe15a('0x39')],_0x45ecef['query']);_0x1a9274[_0xe15a('0x3a')]=_[_0xe15a('0x38')](_0x45ecef[_0xe15a('0x39')],qs[_0xe15a('0x3b')](_0x333ed4[_0xe15a('0x37')][_0xe15a('0x3b')]));_0x1a9274[_0xe15a('0x3a')]=_0x1a9274[_0xe15a('0x3a')][_0xe15a('0x3c')]?_0x1a9274['attributes']:_0x45ecef[_0xe15a('0x39')];if(!_0x333ed4[_0xe15a('0x37')][_0xe15a('0x3d')](_0xe15a('0x3e'))){_0x1a9274[_0xe15a('0x1f')]=qs[_0xe15a('0x1f')](_0x333ed4[_0xe15a('0x37')]['limit']);_0x1a9274[_0xe15a('0x1e')]=qs[_0xe15a('0x1e')](_0x333ed4['query']['offset']);}_0x1a9274[_0xe15a('0x3f')]=qs[_0xe15a('0x40')](_0x333ed4['query'][_0xe15a('0x40')]);_0x1a9274[_0xe15a('0x41')]=qs['filters'](_[_0xe15a('0x42')](_0x333ed4[_0xe15a('0x37')],_0x45ecef[_0xe15a('0x43')]),_0x182660);if(_0x333ed4[_0xe15a('0x37')]['filter']){_0x1a9274[_0xe15a('0x41')]=_[_0xe15a('0x44')](_0x1a9274[_0xe15a('0x41')],{'$or':_['map'](_0x182660,function(_0x156e9c){if(_0x156e9c[_0xe15a('0x35')]!==_0xe15a('0x45')){var _0x255e1d={};_0x255e1d[_0x156e9c['name']]={'$like':'%'+_0x333ed4[_0xe15a('0x37')][_0xe15a('0x46')]+'%'};return _0x255e1d;}})});}_0x1a9274=_[_0xe15a('0x44')]({},_0x1a9274,_0x333ed4[_0xe15a('0x47')]);var _0x473047={'where':_0x1a9274[_0xe15a('0x41')]};return db['CmList'][_0xe15a('0x21')](_0x473047)[_0xe15a('0x27')](function(_0x3f85dc){_0x508a44[_0xe15a('0x21')]=_0x3f85dc;if(_0x333ed4[_0xe15a('0x37')]['includeAll']){_0x1a9274[_0xe15a('0x48')]=[{'all':!![]}];}return db['CmList'][_0xe15a('0x49')](_0x1a9274);})['then'](function(_0x4a8397){_0x508a44[_0xe15a('0x4a')]=_0x4a8397;return _0x508a44;})['then'](respondWithFilteredResult(_0x3d2b57,_0x1a9274))[_0xe15a('0x4b')](handleError(_0x3d2b57,null));};exports['show']=function(_0x109cc5,_0x2fd6eb){var _0x25af16={'raw':![],'where':{'id':_0x109cc5['params']['id']}},_0x1c7c1c={};_0x1c7c1c['model']=_[_0xe15a('0x4c')](db[_0xe15a('0x33')][_0xe15a('0x4d')]);_0x1c7c1c[_0xe15a('0x37')]=_[_0xe15a('0x4c')](_0x109cc5[_0xe15a('0x37')]);_0x1c7c1c['filters']=_[_0xe15a('0x38')](_0x1c7c1c[_0xe15a('0x39')],_0x1c7c1c[_0xe15a('0x37')]);_0x25af16['attributes']=_[_0xe15a('0x38')](_0x1c7c1c['model'],qs[_0xe15a('0x3b')](_0x109cc5[_0xe15a('0x37')][_0xe15a('0x3b')]));_0x25af16['attributes']=_0x25af16[_0xe15a('0x3a')][_0xe15a('0x3c')]?_0x25af16[_0xe15a('0x3a')]:_0x1c7c1c[_0xe15a('0x39')];if(_0x109cc5[_0xe15a('0x37')]['includeAll']){_0x25af16[_0xe15a('0x48')]=[{'all':!![]}];}_0x25af16=_['merge']({},_0x25af16,_0x109cc5['options']);return db['CmList'][_0xe15a('0x4e')](_0x25af16)[_0xe15a('0x27')](handleEntityNotFound(_0x2fd6eb,null))[_0xe15a('0x27')](respondWithResult(_0x2fd6eb,null))[_0xe15a('0x4b')](handleError(_0x2fd6eb,null));};exports['create']=function(_0x2e37cc,_0x27ffd4){return db[_0xe15a('0x33')][_0xe15a('0x4f')](_0x2e37cc[_0xe15a('0x50')],{})[_0xe15a('0x27')](function(_0x428c7c){var _0x19e26e=_0x2e37cc['user'][_0xe15a('0x28')]({'plain':!![]});if(!_0x19e26e)throw new Error(_0xe15a('0x51'));if(_0x19e26e[_0xe15a('0x52')]===_0xe15a('0x53')){var _0x508211=_0x428c7c[_0xe15a('0x28')]({'plain':!![]});var _0x37e699=_0xe15a('0x29');return db[_0xe15a('0x54')]['find']({'where':{'name':_0x37e699,'userProfileId':_0x19e26e['userProfileId']},'raw':!![]})[_0xe15a('0x27')](function(_0xd01897){if(_0xd01897&&_0xd01897['autoAssociation']===0x0){return db[_0xe15a('0x2a')][_0xe15a('0x4f')]({'name':_0x508211[_0xe15a('0x2f')],'resourceId':_0x508211['id'],'type':_0xd01897[_0xe15a('0x2f')],'sectionId':_0xd01897['id']},{})['then'](function(){return _0x428c7c;});}else{return _0x428c7c;}})[_0xe15a('0x4b')](function(_0x5e1f9a){logger['error'](_0xe15a('0x55'),_0x5e1f9a);throw _0x5e1f9a;});}return _0x428c7c;})['then'](respondWithResult(_0x27ffd4,0xc9))[_0xe15a('0x4b')](handleError(_0x27ffd4,null));};exports[_0xe15a('0x26')]=function(_0x24948c,_0xc18786){if(_0x24948c[_0xe15a('0x50')]['id']){delete _0x24948c[_0xe15a('0x50')]['id'];}return db[_0xe15a('0x33')][_0xe15a('0x4e')]({'where':{'id':_0x24948c[_0xe15a('0x56')]['id']}})[_0xe15a('0x27')](handleEntityNotFound(_0xc18786,null))[_0xe15a('0x27')](saveUpdates(_0x24948c[_0xe15a('0x50')],null))[_0xe15a('0x27')](respondWithResult(_0xc18786,null))['catch'](handleError(_0xc18786,null));};exports[_0xe15a('0x2b')]=function(_0xec37bd,_0x5ed41f){return db[_0xe15a('0x33')][_0xe15a('0x4e')]({'where':{'id':_0xec37bd[_0xe15a('0x56')]['id']}})[_0xe15a('0x27')](handleEntityNotFound(_0x5ed41f,null))['then'](removeEntity(_0x5ed41f,null))[_0xe15a('0x4b')](handleError(_0x5ed41f,null));};exports[_0xe15a('0x57')]=function(_0x4e0175,_0x99c634){return db['CmList'][_0xe15a('0x57')]()['then'](respondWithResult(_0x99c634,null))['catch'](handleError(_0x99c634,null));};exports[_0xe15a('0x58')]=function(_0x64f7a7,_0x228cae,_0x14bdef){if(_0x64f7a7[_0xe15a('0x50')]['id']){delete _0x64f7a7[_0xe15a('0x50')]['id'];}return db['CmList'][_0xe15a('0x4e')]({'where':{'id':_0x64f7a7[_0xe15a('0x56')]['id']}})[_0xe15a('0x27')](handleEntityNotFound(_0x228cae,null))[_0xe15a('0x27')](function(_0x459d61){if(_0x459d61){_0x64f7a7[_0xe15a('0x50')][_0xe15a('0x59')]=_0x459d61['id'];return db['Disposition'][_0xe15a('0x4f')](_0x64f7a7[_0xe15a('0x50')]);}})[_0xe15a('0x27')](respondWithResult(_0x228cae,null))[_0xe15a('0x4b')](handleError(_0x228cae,null));};exports[_0xe15a('0x5a')]=function(_0x3b2918,_0x29a121,_0x4465cc){var _0x594396={'raw':![],'where':{}};var _0x111034={};var _0x2703a5={'count':0x0,'rows':[]};return db[_0xe15a('0x33')]['findOne']({'where':{'id':_0x3b2918[_0xe15a('0x56')]['id']}})[_0xe15a('0x27')](handleEntityNotFound(_0x29a121,null))[_0xe15a('0x27')](function(_0x4b7624){if(_0x4b7624){_0x111034[_0xe15a('0x39')]=_[_0xe15a('0x4c')](db[_0xe15a('0x5b')]['rawAttributes']);_0x111034['query']=_[_0xe15a('0x4c')](_0x3b2918[_0xe15a('0x37')]);_0x111034[_0xe15a('0x43')]=_[_0xe15a('0x38')](_0x111034[_0xe15a('0x39')],_0x111034['query']);_0x594396[_0xe15a('0x3a')]=_[_0xe15a('0x38')](_0x111034[_0xe15a('0x39')],qs['fields'](_0x3b2918['query']['fields']));_0x594396[_0xe15a('0x3a')]=_0x594396['attributes'][_0xe15a('0x3c')]?_0x594396[_0xe15a('0x3a')]:_0x111034['model'];if(!_0x3b2918[_0xe15a('0x37')][_0xe15a('0x3d')](_0xe15a('0x3e'))){_0x594396[_0xe15a('0x1f')]=qs['limit'](_0x3b2918['query']['limit']);_0x594396[_0xe15a('0x1e')]=qs[_0xe15a('0x1e')](_0x3b2918[_0xe15a('0x37')][_0xe15a('0x1e')]);}_0x594396[_0xe15a('0x3f')]=qs[_0xe15a('0x40')](_0x3b2918[_0xe15a('0x37')][_0xe15a('0x40')]);_0x594396[_0xe15a('0x41')]=qs[_0xe15a('0x43')](_[_0xe15a('0x42')](_0x3b2918[_0xe15a('0x37')],_0x111034[_0xe15a('0x43')]));_0x594396[_0xe15a('0x41')][_0xe15a('0x59')]=_0x4b7624['id'];if(_0x3b2918['query'][_0xe15a('0x46')]){_0x594396['where']=_[_0xe15a('0x44')](_0x594396[_0xe15a('0x41')],{'$or':_[_0xe15a('0x32')](_0x594396[_0xe15a('0x3a')],function(_0x18e196){var _0x85f84a={};_0x85f84a[_0x18e196]={'$like':'%'+_0x3b2918[_0xe15a('0x37')]['filter']+'%'};return _0x85f84a;})});}_0x594396=_[_0xe15a('0x44')]({},_0x594396,_0x3b2918[_0xe15a('0x47')]);return db[_0xe15a('0x5b')][_0xe15a('0x21')]({'where':_0x594396[_0xe15a('0x41')]})['then'](function(_0x577931){_0x2703a5[_0xe15a('0x21')]=_0x577931;if(_0x3b2918[_0xe15a('0x37')][_0xe15a('0x5c')]){_0x594396[_0xe15a('0x48')]=[{'all':!![]}];}return db[_0xe15a('0x5b')]['findAll'](_0x594396);})['then'](function(_0x55530a){_0x2703a5[_0xe15a('0x4a')]=_0x55530a;return _0x2703a5;});}})[_0xe15a('0x27')](respondWithFilteredResult(_0x29a121,_0x594396))[_0xe15a('0x4b')](handleError(_0x29a121,null));};exports[_0xe15a('0x5d')]=function(_0x2ee44a,_0x47b1b6,_0x2c068a){return db['CmList']['find']({'where':{'id':_0x2ee44a[_0xe15a('0x56')]['id']}})[_0xe15a('0x27')](handleEntityNotFound(_0x47b1b6,null))['then'](function(_0x4d4ee1){if(_0x4d4ee1){return _0x4d4ee1[_0xe15a('0x5d')](_0x2ee44a[_0xe15a('0x37')][_0xe15a('0x5e')]);}})[_0xe15a('0x27')](respondWithStatusCode(_0x47b1b6,null))[_0xe15a('0x4b')](handleError(_0x47b1b6,null));};exports['addContacts']=function(_0x48f9c9,_0x5a0a1d,_0x2f0625){return db['CmList'][_0xe15a('0x4e')]({'where':{'id':_0x48f9c9['params']['id']}})[_0xe15a('0x27')](handleEntityNotFound(_0x5a0a1d,null))[_0xe15a('0x27')](function(_0x307023){if(_0x307023){var _0x5e064d=[];var _0xd68a05={'success':[],'errors':[]};return db['CmContact']['describe']()[_0xe15a('0x27')](function(_0x363e3f){if(_0x48f9c9[_0xe15a('0x50')]['tags']&&_['isArray'](_0x48f9c9['body'][_0xe15a('0x5f')])){if(_0x48f9c9[_0xe15a('0x50')][_0xe15a('0x5f')][_0xe15a('0x3c')]){_0x48f9c9[_0xe15a('0x50')]['tags']=_0x48f9c9['body'][_0xe15a('0x5f')]['join'](';')+';';}else{_0x48f9c9['body'][_0xe15a('0x5f')]=null;}}else{_0x48f9c9[_0xe15a('0x50')]['tags']=null;}if(_0x48f9c9[_0xe15a('0x50')]&&_[_0xe15a('0x60')](_0x48f9c9[_0xe15a('0x50')])){for(var _0x1b1d1c=0x0;_0x1b1d1c<_0x48f9c9[_0xe15a('0x50')][_0xe15a('0x3c')];_0x1b1d1c+=0x1){_0x48f9c9[_0xe15a('0x50')][_0x1b1d1c]['ListId']=_0x48f9c9[_0xe15a('0x56')]['id'];_0x5e064d['push'](_0x48f9c9[_0xe15a('0x50')][_0x1b1d1c]);}return BPromise['each'](_0x5e064d,function(_0x3e6f63){return db[_0xe15a('0x61')][_0xe15a('0x4f')](_['omit'](_0x3e6f63,[_0xe15a('0x5e'),'id'])||{},{'fields':_['keys'](_0x363e3f),'raw':!![]})['then'](function(_0x39dadc){_0xd68a05[_0xe15a('0x62')][_0xe15a('0x63')](_0x39dadc['dataValues']);})['catch'](function(_0x44f8b1){_0xd68a05['errors'][_0xe15a('0x63')]({'data':_0x3e6f63,'error':_0x44f8b1[_0xe15a('0x64')]});});})[_0xe15a('0x27')](function(_0x22a14b){return _0xd68a05;})[_0xe15a('0x4b')](function(_0x2942b6){return _0x2942b6;});}else{_0x5a0a1d[_0xe15a('0x1c')](0x190)['json']({'message':_0xe15a('0x65')});}});}})['then'](respondWithResult(_0x5a0a1d,null))[_0xe15a('0x4b')](handleError(_0x5a0a1d,null));};exports[_0xe15a('0x66')]=function(_0x5d2a88,_0x25bf37,_0x3ebe48){var _0x2bb410;return db['CmList']['find']({'where':{'id':_0x5d2a88[_0xe15a('0x56')]['id']},'include':[{'model':db[_0xe15a('0x67')],'as':_0xe15a('0x68')}]})[_0xe15a('0x27')](handleEntityNotFound(_0x25bf37,null))[_0xe15a('0x27')](function(_0x227533){if(_0x227533){_0x2bb410=_0x227533;return db['CmContact']['rawAttributes'];}})[_0xe15a('0x27')](function(_0x14dfeb){if(_0x14dfeb){var _0xb65759={};var _0x3f1a65={};_0x3f1a65[_0xe15a('0x39')]=_[_0xe15a('0x69')](_[_0xe15a('0x4c')](_0x14dfeb),_[_0xe15a('0x32')](_0x2bb410[_0xe15a('0x68')],function(_0x8c3f04){return util[_0xe15a('0x6a')](_0xe15a('0x6b'),_0x8c3f04['id']);}));_0x3f1a65['query']=_['keys'](_0x5d2a88[_0xe15a('0x37')]);_0x3f1a65[_0xe15a('0x43')]=_[_0xe15a('0x38')](_0x3f1a65['model'],_0x3f1a65['query']);_0xb65759[_0xe15a('0x3a')]=_[_0xe15a('0x38')](_0x3f1a65[_0xe15a('0x39')],qs[_0xe15a('0x3b')](_0x5d2a88[_0xe15a('0x37')]['fields']));_0xb65759[_0xe15a('0x3a')]=_0xb65759[_0xe15a('0x3a')]['length']?_0xb65759[_0xe15a('0x3a')]:_0x3f1a65[_0xe15a('0x39')];if(!_0x5d2a88['query'][_0xe15a('0x3d')](_0xe15a('0x3e'))){_0xb65759[_0xe15a('0x1f')]=qs['limit'](_0x5d2a88['query'][_0xe15a('0x1f')]);_0xb65759[_0xe15a('0x1e')]=qs[_0xe15a('0x1e')](_0x5d2a88[_0xe15a('0x37')]['offset']);}_0xb65759[_0xe15a('0x3f')]=qs['sort'](_0x5d2a88['query'][_0xe15a('0x40')]);_0xb65759[_0xe15a('0x41')]=qs[_0xe15a('0x43')](_[_0xe15a('0x42')](_0x5d2a88[_0xe15a('0x37')],_0x3f1a65[_0xe15a('0x43')]));_0xb65759[_0xe15a('0x6c')]=!![];if(_0x5d2a88['query'][_0xe15a('0x46')]){_0xb65759[_0xe15a('0x41')]=_[_0xe15a('0x44')](_0xb65759[_0xe15a('0x41')],{'$or':_['map'](_0xb65759['attributes'],function(_0x3c86b3){var _0x5d97bd={};_0x5d97bd[_0x3c86b3]={'$like':'%'+_0x5d2a88[_0xe15a('0x37')][_0xe15a('0x46')]+'%'};return _0x5d97bd;})});}_0xb65759=_[_0xe15a('0x44')]({},_0xb65759,_0x5d2a88[_0xe15a('0x47')]);return _0x2bb410['getContacts'](_0xb65759);}})['then'](respondWithResult(_0x25bf37,null))['catch'](handleError(_0x25bf37,null));};exports[_0xe15a('0x6d')]=function(_0x1e8e07,_0x5325fc,_0x39706f){var _0x2d0a24;var _0x320b63;var _0x2597ca;var _0x666644=_0x1e8e07[_0xe15a('0x56')]['id'];csv_results=[];return db[_0xe15a('0x6e')][_0xe15a('0x49')]({'attributes':['id',_0xe15a('0x2f')],'raw':!![],'order':[_0xe15a('0x6f')]})[_0xe15a('0x27')](function(_0x37329d){_0x2d0a24=_0x37329d;var _0x15a3da=_['keys'](db[_0xe15a('0x61')]['rawAttributes']);return db[_0xe15a('0x67')][_0xe15a('0x49')]({'raw':!![],'attributes':['id',_0xe15a('0x70')]})[_0xe15a('0x27')](function(_0x11bbe1){_0x320b63=_0x11bbe1;var _0x86a50c=squel[_0xe15a('0x71')]()['fields'](_0x15a3da)[_0xe15a('0x72')](_0xe15a('0x73'),'c')[_0xe15a('0x41')]('c.ListId\x20=\x20?',_0x666644)[_0xe15a('0x41')](_0xe15a('0x74'))[_0xe15a('0x75')]();for(var _0x1c04ff=0x0;_0x1c04ff<_0x320b63[_0xe15a('0x3c')];_0x1c04ff++){_0x86a50c[_0xe15a('0x76')]('c.cf_'+_0x320b63[_0x1c04ff]['id'],'customField_'+_0x320b63[_0x1c04ff]['alias']);}for(var _0x1c04ff=0x0;_0x1c04ff<_0x2d0a24[_0xe15a('0x3c')];_0x1c04ff++){_0x86a50c[_0xe15a('0x76')](squel[_0xe15a('0x71')]()[_0xe15a('0x76')](_0xe15a('0x77'))[_0xe15a('0x72')](_0xe15a('0x78'))[_0xe15a('0x41')](_0xe15a('0x79'),_0x2d0a24[_0x1c04ff]['id'])[_0xe15a('0x41')](_0xe15a('0x7a')),_0xe15a('0x7b')+_0x2d0a24[_0x1c04ff][_0xe15a('0x2f')]);_0x86a50c[_0xe15a('0x76')](squel['select']()['field'](_0xe15a('0x7c'))[_0xe15a('0x72')](_0xe15a('0x78'))[_0xe15a('0x41')](_0xe15a('0x79'),_0x2d0a24[_0x1c04ff]['id'])['where'](_0xe15a('0x7a')),_0xe15a('0x7d')+_0x2d0a24[_0x1c04ff][_0xe15a('0x2f')]);}var _0x3971e8=[];_0x3971e8[_0xe15a('0x63')](_0x86a50c['toString']());BPromise[_0xe15a('0x7e')](_0x3971e8,handleQuery)[_0xe15a('0x27')](function(_0x4ec41b){handleQuery(_0x86a50c['toString']());var _0x361933=csv_results[0x0];if(!_[_0xe15a('0x7f')](_0x361933)){var _0x1817b2=toCsv(_0x361933);var _0x1521a6=Date[_0xe15a('0x80')]();fs[_0xe15a('0x81')](util['format']('/tmp/list_%d_%s.csv',_0x666644,_0x1521a6),_0x1817b2);_0x5325fc[_0xe15a('0x82')]('Content-disposition',_0xe15a('0x83')+util[_0xe15a('0x6a')](_0xe15a('0x84'),_0x666644,_0x1521a6));_0x5325fc[_0xe15a('0x82')](_0xe15a('0x85'),'text/csv');return _0x5325fc[_0xe15a('0x86')](util[_0xe15a('0x6a')](_0xe15a('0x87'),_0x666644,_0x1521a6));}else{return _0x5325fc[_0xe15a('0x1b')](0xcc);}});});});};exports[_0xe15a('0x88')]=function(_0xc83b8f,_0x23532c,_0x357a1d){var _0x4d0e11;delete _0xc83b8f[_0xe15a('0x50')]['id'];return db[_0xe15a('0x33')][_0xe15a('0x89')]({'where':{'id':_0xc83b8f[_0xe15a('0x56')]['id']}})[_0xe15a('0x27')](handleEntityNotFound(_0x23532c,null))[_0xe15a('0x27')](function(_0x1ac095){if(_0x1ac095){return db[_0xe15a('0x8a')][_0xe15a('0x8b')](function(_0x3fb77f){return db[_0xe15a('0x67')][_0xe15a('0x4f')](_0xc83b8f['body'],{'transaction':_0x3fb77f})[_0xe15a('0x27')](function(_0x2de2aa){_0x4d0e11=_0x2de2aa;return _0x1ac095[_0xe15a('0x8c')](_0x2de2aa,{'transaction':_0x3fb77f});})[_0xe15a('0x27')](function(){var _0x36a673={'type':db[_0xe15a('0x8d')][_0xe15a('0x8e')],'transaction':_0x3fb77f};switch(_0xc83b8f['body'][_0xe15a('0x35')]){case _0xe15a('0x8f'):_0x36a673[_0xe15a('0x35')]=db['Sequelize'][_0xe15a('0x8e')];break;case _0xe15a('0x90'):_0x36a673['type']=db['Sequelize']['INTEGER'];break;case'switch':_0x36a673[_0xe15a('0x35')]=db['Sequelize'][_0xe15a('0x91')];_0x36a673[_0xe15a('0x92')]=![];break;default:}return db[_0xe15a('0x8a')][_0xe15a('0x93')][_0xe15a('0x94')](_0xe15a('0x73'),util['format']('cf_%s',_0x4d0e11['id']),_0x36a673);})[_0xe15a('0x27')](function(){return _0x4d0e11;});});}})[_0xe15a('0x27')](respondWithResult(_0x23532c,null))[_0xe15a('0x4b')](handleError(_0x23532c,null));};exports[_0xe15a('0x95')]=function(_0x2ad1b1,_0x3d2008,_0x3c3af5){var _0x9ce208={};var _0x5962e1={};var _0x3bb174;var _0x5b4025;return db[_0xe15a('0x33')]['findOne']({'where':{'id':_0x2ad1b1['params']['id']}})['then'](handleEntityNotFound(_0x3d2008,null))['then'](function(_0x13527a){if(_0x13527a){_0x3bb174=_0x13527a;_0x5962e1[_0xe15a('0x39')]=_[_0xe15a('0x4c')](db[_0xe15a('0x67')]['rawAttributes']);_0x5962e1['query']=_[_0xe15a('0x4c')](_0x2ad1b1['query']);_0x5962e1['filters']=_[_0xe15a('0x38')](_0x5962e1[_0xe15a('0x39')],_0x5962e1[_0xe15a('0x37')]);_0x9ce208[_0xe15a('0x3a')]=_['intersection'](_0x5962e1[_0xe15a('0x39')],qs['fields'](_0x2ad1b1[_0xe15a('0x37')]['fields']));_0x9ce208['attributes']=_0x9ce208['attributes'][_0xe15a('0x3c')]?_0x9ce208[_0xe15a('0x3a')]:_0x5962e1[_0xe15a('0x39')];_0x9ce208[_0xe15a('0x3f')]=qs['sort'](_0x2ad1b1[_0xe15a('0x37')][_0xe15a('0x40')]);_0x9ce208[_0xe15a('0x41')]=qs[_0xe15a('0x43')](_[_0xe15a('0x42')](_0x2ad1b1[_0xe15a('0x37')],_0x5962e1[_0xe15a('0x43')]));_0x9ce208[_0xe15a('0x41')]=_[_0xe15a('0x44')](_0x9ce208[_0xe15a('0x41')],{'$or':[{'ListId':_0x13527a['id']},{'ListId':null}]});if(_0x2ad1b1[_0xe15a('0x37')][_0xe15a('0x46')]){_0x9ce208[_0xe15a('0x41')]=_[_0xe15a('0x44')](_0x9ce208[_0xe15a('0x41')],{'$or':_[_0xe15a('0x32')](_0x9ce208[_0xe15a('0x3a')],function(_0x1c8826){var _0x34b242={};_0x34b242[_0x1c8826]={'$like':'%'+_0x2ad1b1[_0xe15a('0x37')][_0xe15a('0x46')]+'%'};return _0x34b242;})});}_0x9ce208=_[_0xe15a('0x44')]({},_0x9ce208,_0x2ad1b1[_0xe15a('0x47')]);return db[_0xe15a('0x67')][_0xe15a('0x96')](_0x9ce208);}})['then'](respondWithResult(_0x3d2008,null))[_0xe15a('0x4b')](handleError(_0x3d2008,null));};exports[_0xe15a('0x97')]=function(_0x553340,_0x1ab978){return db[_0xe15a('0x67')][_0xe15a('0x96')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x1ab978,null))['then'](function(_0x224adf){return _0x224adf;})[_0xe15a('0x27')](respondWithResult(_0x1ab978,null))[_0xe15a('0x4b')](handleError(_0x1ab978,null));};exports[_0xe15a('0x98')]=function(_0x4ba832,_0x1b82a7,_0x4be8fa){return db[_0xe15a('0x33')][_0xe15a('0x4e')]({'where':{'id':_0x4ba832['params']['id']}})[_0xe15a('0x27')](handleEntityNotFound(_0x1b82a7,null))['then'](function(_0x5a3cbe){if(_0x5a3cbe){return _0x5a3cbe[_0xe15a('0x98')](_0x4ba832['body'][_0xe15a('0x5e')],_[_0xe15a('0x99')](_0x4ba832[_0xe15a('0x50')],[_0xe15a('0x5e'),'id'])||{})[_0xe15a('0x9a')](function(_0x590914){for(var _0x386b94=0x0;_0x386b94<_0x4ba832[_0xe15a('0x50')]['ids'][_0xe15a('0x3c')];_0x386b94+=0x1){socket['emit']('userCmList:save',{'UserId':Number(_0x4ba832[_0xe15a('0x50')][_0xe15a('0x5e')][_0x386b94]),'CmListId':Number(_0x4ba832[_0xe15a('0x56')]['id'])});}return _0x590914;});}})[_0xe15a('0x27')](respondWithResult(_0x1b82a7,null))[_0xe15a('0x4b')](handleError(_0x1b82a7,null));};exports[_0xe15a('0x9b')]=function(_0x4e5d2d,_0x372a48,_0x23a7f2){return db[_0xe15a('0x33')]['find']({'where':{'id':_0x4e5d2d[_0xe15a('0x56')]['id']}})[_0xe15a('0x27')](handleEntityNotFound(_0x372a48,null))[_0xe15a('0x27')](function(_0x4ae800){if(_0x4ae800){return _0x4ae800[_0xe15a('0x9b')](_0x4e5d2d[_0xe15a('0x37')]['ids'])[_0xe15a('0x27')](function(){if(_[_0xe15a('0x60')](_0x4e5d2d[_0xe15a('0x37')]['ids'])){for(var _0x297c10=0x0;_0x297c10<_0x4e5d2d['query'][_0xe15a('0x5e')][_0xe15a('0x3c')];_0x297c10+=0x1){socket['emit'](_0xe15a('0x9c'),{'UserId':Number(_0x4e5d2d[_0xe15a('0x37')]['ids'][_0x297c10]),'CmListId':Number(_0x4e5d2d[_0xe15a('0x56')]['id'])});}}else{socket[_0xe15a('0x9d')](_0xe15a('0x9c'),{'UserId':Number(_0x4e5d2d[_0xe15a('0x37')][_0xe15a('0x5e')]),'CmListId':Number(_0x4e5d2d['params']['id'])});}});}})[_0xe15a('0x27')](respondWithStatusCode(_0x372a48,null))['catch'](handleError(_0x372a48,null));};exports[_0xe15a('0x9e')]=function(_0x3296f5,_0x1b7179,_0x4be498){var _0x43367b={};var _0x339760={};var _0x5d268d;var _0x4b4951;return db[_0xe15a('0x33')]['findOne']({'where':{'id':_0x3296f5[_0xe15a('0x56')]['id']}})[_0xe15a('0x27')](handleEntityNotFound(_0x1b7179,null))[_0xe15a('0x27')](function(_0x3c29a4){if(_0x3c29a4){_0x5d268d=_0x3c29a4;_0x339760['model']=_[_0xe15a('0x4c')](db[_0xe15a('0x9f')][_0xe15a('0x4d')]);_0x339760[_0xe15a('0x37')]=_[_0xe15a('0x4c')](_0x3296f5[_0xe15a('0x37')]);_0x339760[_0xe15a('0x43')]=_[_0xe15a('0x38')](_0x339760[_0xe15a('0x39')],_0x339760['query']);_0x43367b[_0xe15a('0x3a')]=_['intersection'](_0x339760[_0xe15a('0x39')],qs['fields'](_0x3296f5[_0xe15a('0x37')][_0xe15a('0x3b')]));_0x43367b[_0xe15a('0x3a')]=_0x43367b['attributes'][_0xe15a('0x3c')]?_0x43367b[_0xe15a('0x3a')]:_0x339760[_0xe15a('0x39')];_0x43367b[_0xe15a('0x3f')]=qs[_0xe15a('0x40')](_0x3296f5[_0xe15a('0x37')][_0xe15a('0x40')]);_0x43367b['where']=qs[_0xe15a('0x43')](_[_0xe15a('0x42')](_0x3296f5[_0xe15a('0x37')],_0x339760[_0xe15a('0x43')]));if(_0x3296f5[_0xe15a('0x37')]['filter']){_0x43367b[_0xe15a('0x41')]=_[_0xe15a('0x44')](_0x43367b[_0xe15a('0x41')],{'$or':_[_0xe15a('0x32')](_0x43367b[_0xe15a('0x3a')],function(_0xa160b3){var _0x229a95={};_0x229a95[_0xa160b3]={'$like':'%'+_0x3296f5[_0xe15a('0x37')][_0xe15a('0x46')]+'%'};return _0x229a95;})});}_0x43367b=_[_0xe15a('0x44')]({},_0x43367b,_0x3296f5[_0xe15a('0x47')]);return _0x5d268d['getAgents'](_0x43367b);}})[_0xe15a('0x27')](function(_0x5c5982){if(_0x5c5982){_0x4b4951=_0x5c5982[_0xe15a('0x3c')];if(!_0x3296f5['query']['hasOwnProperty'](_0xe15a('0x3e'))){_0x43367b[_0xe15a('0x1f')]=qs[_0xe15a('0x1f')](_0x3296f5[_0xe15a('0x37')]['limit']);_0x43367b[_0xe15a('0x1e')]=qs[_0xe15a('0x1e')](_0x3296f5['query'][_0xe15a('0x1e')]);}return _0x5d268d['getAgents'](_0x43367b);}})[_0xe15a('0x27')](function(_0x184744){if(_0x184744){return _0x184744?{'count':_0x4b4951,'rows':_0x184744}:null;}})[_0xe15a('0x27')](respondWithResult(_0x1b7179,null))['catch'](handleError(_0x1b7179,null));};function handleQuery(_0x371a62){logger['info'](_0x371a62);return db[_0xe15a('0x8a')]['query'](_0x371a62)[_0xe15a('0x9a')](function(_0x30f034){csv_results[_0xe15a('0x63')](_0x30f034);})[_0xe15a('0x4b')](function(_0x18589c){logger[_0xe15a('0x2d')](_0x18589c[_0xe15a('0x64')]);});} \ No newline at end of file +var _0x72f0=['info','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','update','destroy','then','get','Lists','UserProfileResource','error','stack','name','map','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','CmList','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','ListId','Disposition','getDispositions','filter','removeDispositions','ids','addContacts','CmContact','tags','isArray','push','each','omit','success','dataValues','errors','message','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','hasOwnProperty','getContactsCsv','ContactItemType','OrderBy','select','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','customField_','alias','field','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','ItemTypeId\x20=\x20?','toString','isEmpty','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','findOne','sequelize','addCustomFields','Sequelize','text','TEXT','number','INTEGER','defaultValue','cm_contacts','cf_%s','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User'];(function(_0xf9eb3,_0x3ac70d){var _0x25776c=function(_0x29b656){while(--_0x29b656){_0xf9eb3['push'](_0xf9eb3['shift']());}};_0x25776c(++_0x3ac70d);}(_0x72f0,0x143));var _0x072f=function(_0x308374,_0x550e85){_0x308374=_0x308374-0x0;var _0x1f71e0=_0x72f0[_0x308374];return _0x1f71e0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x072f('0x0'));var zipdir=require(_0x072f('0x1'));var jsonpatch=require(_0x072f('0x2'));var rp=require(_0x072f('0x3'));var moment=require(_0x072f('0x4'));var BPromise=require(_0x072f('0x5'));var Mustache=require(_0x072f('0x6'));var util=require('util');var path=require(_0x072f('0x7'));var sox=require(_0x072f('0x8'));var csv=require(_0x072f('0x9'));var ejs=require(_0x072f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x072f('0xb'));var squel=require('squel');var crypto=require(_0x072f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x072f('0xd'));var toCsv=require(_0x072f('0x9'));var querystring=require(_0x072f('0xe'));var Papa=require('papaparse');var Redis=require(_0x072f('0xf'));var authService=require(_0x072f('0x10'));var qs=require(_0x072f('0x11'));var as=require(_0x072f('0x12'));var hardwareService=require(_0x072f('0x13'));var logger=require(_0x072f('0x14'))(_0x072f('0x15'));var utils=require(_0x072f('0x16'));var config=require(_0x072f('0x17'));var licenseUtil=require(_0x072f('0x18'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x072f('0x19')]=_[_0x072f('0x1a')](config[_0x072f('0x19')],{'host':_0x072f('0x1b'),'port':0x18eb});var socket=require(_0x072f('0x1c'))(new Redis(config[_0x072f('0x19')]));require(_0x072f('0x1d'))[_0x072f('0x1e')](socket);function respondWithStatusCode(_0x350792,_0x534ab6){_0x534ab6=_0x534ab6||0xcc;return function(_0x28a236){if(_0x28a236){return _0x350792[_0x072f('0x1f')](_0x534ab6);}return _0x350792[_0x072f('0x20')](_0x534ab6)[_0x072f('0x21')]();};}function respondWithResult(_0x356223,_0x1bc059){_0x1bc059=_0x1bc059||0xc8;return function(_0x238918){if(_0x238918){return _0x356223[_0x072f('0x20')](_0x1bc059)['json'](_0x238918);}};}function respondWithFilteredResult(_0x4bc24e,_0x2d835f){return function(_0x376375){if(_0x376375){var _0xa7f40d=typeof _0x2d835f[_0x072f('0x22')]===_0x072f('0x23')&&typeof _0x2d835f['limit']==='undefined';var _0x1cf53a=_0x376375[_0x072f('0x24')];var _0x4b4c5b=_0xa7f40d?0x0:_0x2d835f[_0x072f('0x22')];var _0x57bc98=_0xa7f40d?_0x376375[_0x072f('0x24')]:_0x2d835f['offset']+_0x2d835f['limit'];var _0x5368ee;if(_0x57bc98>=_0x1cf53a){_0x57bc98=_0x1cf53a;_0x5368ee=0xc8;}else{_0x5368ee=0xce;}_0x4bc24e[_0x072f('0x20')](_0x5368ee);return _0x4bc24e['set'](_0x072f('0x25'),_0x4b4c5b+'-'+_0x57bc98+'/'+_0x1cf53a)[_0x072f('0x26')](_0x376375);}return null;};}function patchUpdates(_0x28e8a2){return function(_0x1fc30c){try{jsonpatch[_0x072f('0x27')](_0x1fc30c,_0x28e8a2,!![]);}catch(_0x4d9960){return BPromise['reject'](_0x4d9960);}return _0x1fc30c['save']();};}function saveUpdates(_0xf5c038,_0x1e3ed8){return function(_0x41411a){if(_0x41411a){return _0x41411a[_0x072f('0x28')](_0xf5c038)['then'](function(_0x17a384){return _0x17a384;});}return null;};}function removeEntity(_0x465982,_0x1b3d1c){return function(_0x40ac2a){if(_0x40ac2a){return _0x40ac2a[_0x072f('0x29')]()[_0x072f('0x2a')](function(){var _0x2c2141=_0x40ac2a[_0x072f('0x2b')]({'plain':!![]});var _0x3451be=_0x072f('0x2c');return db[_0x072f('0x2d')]['destroy']({'where':{'type':_0x3451be,'resourceId':_0x2c2141['id']}})[_0x072f('0x2a')](function(){return _0x40ac2a;});})[_0x072f('0x2a')](function(){_0x465982[_0x072f('0x20')](0xcc)[_0x072f('0x21')]();});}};}function handleEntityNotFound(_0x577e31,_0x1eb4de){return function(_0x5f5d43){if(!_0x5f5d43){_0x577e31[_0x072f('0x1f')](0x194);}return _0x5f5d43;};}function handleError(_0x1630e6,_0x32e650){_0x32e650=_0x32e650||0x1f4;return function(_0x136238){logger[_0x072f('0x2e')](_0x136238[_0x072f('0x2f')]);if(_0x136238[_0x072f('0x30')]){delete _0x136238[_0x072f('0x30')];}_0x1630e6[_0x072f('0x20')](_0x32e650)['send'](_0x136238);};}exports['index']=function(_0x67144,_0x2ad9ee){var _0x218016={},_0x2c7279={},_0x371e62={'count':0x0,'rows':[]};var _0x5cc6b8=_[_0x072f('0x31')](db['CmList']['rawAttributes'],function(_0x23c05a){return{'name':_0x23c05a[_0x072f('0x32')],'type':_0x23c05a[_0x072f('0x33')]['key']};});_0x2c7279['model']=_[_0x072f('0x31')](_0x5cc6b8,_0x072f('0x30'));_0x2c7279[_0x072f('0x34')]=_[_0x072f('0x35')](_0x67144['query']);_0x2c7279[_0x072f('0x36')]=_[_0x072f('0x37')](_0x2c7279[_0x072f('0x38')],_0x2c7279[_0x072f('0x34')]);_0x218016[_0x072f('0x39')]=_[_0x072f('0x37')](_0x2c7279[_0x072f('0x38')],qs[_0x072f('0x3a')](_0x67144[_0x072f('0x34')][_0x072f('0x3a')]));_0x218016['attributes']=_0x218016[_0x072f('0x39')][_0x072f('0x3b')]?_0x218016[_0x072f('0x39')]:_0x2c7279[_0x072f('0x38')];if(!_0x67144[_0x072f('0x34')]['hasOwnProperty'](_0x072f('0x3c'))){_0x218016[_0x072f('0x3d')]=qs[_0x072f('0x3d')](_0x67144[_0x072f('0x34')]['limit']);_0x218016['offset']=qs['offset'](_0x67144[_0x072f('0x34')]['offset']);}_0x218016[_0x072f('0x3e')]=qs[_0x072f('0x3f')](_0x67144[_0x072f('0x34')][_0x072f('0x3f')]);_0x218016[_0x072f('0x40')]=qs['filters'](_[_0x072f('0x41')](_0x67144[_0x072f('0x34')],_0x2c7279[_0x072f('0x36')]),_0x5cc6b8);if(_0x67144[_0x072f('0x34')]['filter']){_0x218016[_0x072f('0x40')]=_[_0x072f('0x42')](_0x218016[_0x072f('0x40')],{'$or':_[_0x072f('0x31')](_0x5cc6b8,function(_0x145138){if(_0x145138['type']!==_0x072f('0x43')){var _0x9e26d9={};_0x9e26d9[_0x145138['name']]={'$like':'%'+_0x67144[_0x072f('0x34')]['filter']+'%'};return _0x9e26d9;}})});}_0x218016=_[_0x072f('0x42')]({},_0x218016,_0x67144[_0x072f('0x44')]);var _0x5c7ba9={'where':_0x218016['where']};return db[_0x072f('0x45')][_0x072f('0x24')](_0x5c7ba9)['then'](function(_0x597e23){_0x371e62[_0x072f('0x24')]=_0x597e23;if(_0x67144['query'][_0x072f('0x46')]){_0x218016[_0x072f('0x47')]=[{'all':!![]}];}return db['CmList'][_0x072f('0x48')](_0x218016);})['then'](function(_0x169949){_0x371e62[_0x072f('0x49')]=_0x169949;return _0x371e62;})['then'](respondWithFilteredResult(_0x2ad9ee,_0x218016))[_0x072f('0x4a')](handleError(_0x2ad9ee,null));};exports[_0x072f('0x4b')]=function(_0x580213,_0x1d7e8c){var _0x94352e={'raw':![],'where':{'id':_0x580213[_0x072f('0x4c')]['id']}},_0x40e770={};_0x40e770[_0x072f('0x38')]=_[_0x072f('0x35')](db[_0x072f('0x45')][_0x072f('0x4d')]);_0x40e770[_0x072f('0x34')]=_[_0x072f('0x35')](_0x580213[_0x072f('0x34')]);_0x40e770[_0x072f('0x36')]=_['intersection'](_0x40e770[_0x072f('0x38')],_0x40e770['query']);_0x94352e['attributes']=_['intersection'](_0x40e770['model'],qs['fields'](_0x580213[_0x072f('0x34')][_0x072f('0x3a')]));_0x94352e['attributes']=_0x94352e[_0x072f('0x39')]['length']?_0x94352e[_0x072f('0x39')]:_0x40e770[_0x072f('0x38')];if(_0x580213[_0x072f('0x34')][_0x072f('0x46')]){_0x94352e[_0x072f('0x47')]=[{'all':!![]}];}_0x94352e=_[_0x072f('0x42')]({},_0x94352e,_0x580213[_0x072f('0x44')]);return db[_0x072f('0x45')]['find'](_0x94352e)[_0x072f('0x2a')](handleEntityNotFound(_0x1d7e8c,null))[_0x072f('0x2a')](respondWithResult(_0x1d7e8c,null))['catch'](handleError(_0x1d7e8c,null));};exports['create']=function(_0x47cf60,_0x456980){return db[_0x072f('0x45')][_0x072f('0x4e')](_0x47cf60[_0x072f('0x4f')],{})[_0x072f('0x2a')](function(_0x13a3aa){var _0x25f91f=_0x47cf60['user'][_0x072f('0x2b')]({'plain':!![]});if(!_0x25f91f)throw new Error(_0x072f('0x50'));if(_0x25f91f[_0x072f('0x51')]===_0x072f('0x52')){var _0x4be3ad=_0x13a3aa[_0x072f('0x2b')]({'plain':!![]});var _0x4a4eda=_0x072f('0x2c');return db[_0x072f('0x53')]['find']({'where':{'name':_0x4a4eda,'userProfileId':_0x25f91f[_0x072f('0x54')]},'raw':!![]})[_0x072f('0x2a')](function(_0x2f08f1){if(_0x2f08f1&&_0x2f08f1['autoAssociation']===0x0){return db[_0x072f('0x2d')]['create']({'name':_0x4be3ad[_0x072f('0x30')],'resourceId':_0x4be3ad['id'],'type':_0x2f08f1[_0x072f('0x30')],'sectionId':_0x2f08f1['id']},{})[_0x072f('0x2a')](function(){return _0x13a3aa;});}else{return _0x13a3aa;}})['catch'](function(_0x474cc3){logger[_0x072f('0x2e')](_0x072f('0x55'),_0x474cc3);throw _0x474cc3;});}return _0x13a3aa;})[_0x072f('0x2a')](respondWithResult(_0x456980,0xc9))[_0x072f('0x4a')](handleError(_0x456980,null));};exports[_0x072f('0x28')]=function(_0x2a0f43,_0x5c29b9){if(_0x2a0f43[_0x072f('0x4f')]['id']){delete _0x2a0f43['body']['id'];}return db[_0x072f('0x45')][_0x072f('0x56')]({'where':{'id':_0x2a0f43[_0x072f('0x4c')]['id']}})[_0x072f('0x2a')](handleEntityNotFound(_0x5c29b9,null))['then'](saveUpdates(_0x2a0f43[_0x072f('0x4f')],null))[_0x072f('0x2a')](respondWithResult(_0x5c29b9,null))['catch'](handleError(_0x5c29b9,null));};exports[_0x072f('0x29')]=function(_0x9c6490,_0x3fab24){return db['CmList'][_0x072f('0x56')]({'where':{'id':_0x9c6490[_0x072f('0x4c')]['id']}})[_0x072f('0x2a')](handleEntityNotFound(_0x3fab24,null))[_0x072f('0x2a')](removeEntity(_0x3fab24,null))[_0x072f('0x4a')](handleError(_0x3fab24,null));};exports[_0x072f('0x57')]=function(_0x33ce0d,_0x546324){return db[_0x072f('0x45')][_0x072f('0x57')]()['then'](respondWithResult(_0x546324,null))[_0x072f('0x4a')](handleError(_0x546324,null));};exports['addDisposition']=function(_0x5ac7a8,_0x4e73be,_0x50f045){if(_0x5ac7a8[_0x072f('0x4f')]['id']){delete _0x5ac7a8[_0x072f('0x4f')]['id'];}return db[_0x072f('0x45')]['find']({'where':{'id':_0x5ac7a8[_0x072f('0x4c')]['id']}})[_0x072f('0x2a')](handleEntityNotFound(_0x4e73be,null))['then'](function(_0x2ae642){if(_0x2ae642){_0x5ac7a8[_0x072f('0x4f')][_0x072f('0x58')]=_0x2ae642['id'];return db[_0x072f('0x59')][_0x072f('0x4e')](_0x5ac7a8[_0x072f('0x4f')]);}})['then'](respondWithResult(_0x4e73be,null))[_0x072f('0x4a')](handleError(_0x4e73be,null));};exports[_0x072f('0x5a')]=function(_0x37a02f,_0xf7123f,_0x3a3855){var _0x14b962={'raw':![],'where':{}};var _0x355e3c={};var _0x2dd7e5={'count':0x0,'rows':[]};return db[_0x072f('0x45')]['findOne']({'where':{'id':_0x37a02f[_0x072f('0x4c')]['id']}})['then'](handleEntityNotFound(_0xf7123f,null))[_0x072f('0x2a')](function(_0x4350b1){if(_0x4350b1){_0x355e3c[_0x072f('0x38')]=_[_0x072f('0x35')](db['Disposition']['rawAttributes']);_0x355e3c[_0x072f('0x34')]=_['keys'](_0x37a02f['query']);_0x355e3c[_0x072f('0x36')]=_[_0x072f('0x37')](_0x355e3c[_0x072f('0x38')],_0x355e3c[_0x072f('0x34')]);_0x14b962[_0x072f('0x39')]=_[_0x072f('0x37')](_0x355e3c[_0x072f('0x38')],qs['fields'](_0x37a02f['query'][_0x072f('0x3a')]));_0x14b962['attributes']=_0x14b962['attributes']['length']?_0x14b962[_0x072f('0x39')]:_0x355e3c['model'];if(!_0x37a02f[_0x072f('0x34')]['hasOwnProperty']('nolimit')){_0x14b962[_0x072f('0x3d')]=qs[_0x072f('0x3d')](_0x37a02f['query']['limit']);_0x14b962['offset']=qs['offset'](_0x37a02f[_0x072f('0x34')][_0x072f('0x22')]);}_0x14b962[_0x072f('0x3e')]=qs[_0x072f('0x3f')](_0x37a02f[_0x072f('0x34')][_0x072f('0x3f')]);_0x14b962['where']=qs[_0x072f('0x36')](_[_0x072f('0x41')](_0x37a02f[_0x072f('0x34')],_0x355e3c[_0x072f('0x36')]));_0x14b962['where'][_0x072f('0x58')]=_0x4350b1['id'];if(_0x37a02f[_0x072f('0x34')][_0x072f('0x5b')]){_0x14b962[_0x072f('0x40')]=_[_0x072f('0x42')](_0x14b962[_0x072f('0x40')],{'$or':_[_0x072f('0x31')](_0x14b962[_0x072f('0x39')],function(_0x15f547){var _0x1d80cb={};_0x1d80cb[_0x15f547]={'$like':'%'+_0x37a02f[_0x072f('0x34')][_0x072f('0x5b')]+'%'};return _0x1d80cb;})});}_0x14b962=_[_0x072f('0x42')]({},_0x14b962,_0x37a02f[_0x072f('0x44')]);return db[_0x072f('0x59')]['count']({'where':_0x14b962[_0x072f('0x40')]})[_0x072f('0x2a')](function(_0x25903d){_0x2dd7e5[_0x072f('0x24')]=_0x25903d;if(_0x37a02f[_0x072f('0x34')][_0x072f('0x46')]){_0x14b962[_0x072f('0x47')]=[{'all':!![]}];}return db[_0x072f('0x59')][_0x072f('0x48')](_0x14b962);})[_0x072f('0x2a')](function(_0x3ae49b){_0x2dd7e5[_0x072f('0x49')]=_0x3ae49b;return _0x2dd7e5;});}})['then'](respondWithFilteredResult(_0xf7123f,_0x14b962))[_0x072f('0x4a')](handleError(_0xf7123f,null));};exports[_0x072f('0x5c')]=function(_0x201360,_0x2b9ee6,_0x119ebb){return db['CmList'][_0x072f('0x56')]({'where':{'id':_0x201360[_0x072f('0x4c')]['id']}})[_0x072f('0x2a')](handleEntityNotFound(_0x2b9ee6,null))[_0x072f('0x2a')](function(_0x2ad84e){if(_0x2ad84e){return _0x2ad84e['removeDispositions'](_0x201360[_0x072f('0x34')][_0x072f('0x5d')]);}})['then'](respondWithStatusCode(_0x2b9ee6,null))[_0x072f('0x4a')](handleError(_0x2b9ee6,null));};exports[_0x072f('0x5e')]=function(_0x560c40,_0x26b60d,_0x199dc2){return db[_0x072f('0x45')][_0x072f('0x56')]({'where':{'id':_0x560c40[_0x072f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x26b60d,null))[_0x072f('0x2a')](function(_0x19292a){if(_0x19292a){var _0x5e553d=[];var _0x3e5608={'success':[],'errors':[]};return db[_0x072f('0x5f')][_0x072f('0x57')]()[_0x072f('0x2a')](function(_0x29b662){if(_0x560c40['body'][_0x072f('0x60')]&&_['isArray'](_0x560c40[_0x072f('0x4f')][_0x072f('0x60')])){if(_0x560c40[_0x072f('0x4f')][_0x072f('0x60')][_0x072f('0x3b')]){_0x560c40[_0x072f('0x4f')][_0x072f('0x60')]=_0x560c40[_0x072f('0x4f')][_0x072f('0x60')]['join'](';')+';';}else{_0x560c40[_0x072f('0x4f')][_0x072f('0x60')]=null;}}else{_0x560c40['body'][_0x072f('0x60')]=null;}if(_0x560c40['body']&&_[_0x072f('0x61')](_0x560c40['body'])){for(var _0x1249c9=0x0;_0x1249c9<_0x560c40['body'][_0x072f('0x3b')];_0x1249c9+=0x1){_0x560c40[_0x072f('0x4f')][_0x1249c9]['ListId']=_0x560c40[_0x072f('0x4c')]['id'];_0x5e553d[_0x072f('0x62')](_0x560c40[_0x072f('0x4f')][_0x1249c9]);}return BPromise[_0x072f('0x63')](_0x5e553d,function(_0x3227c0){return db[_0x072f('0x5f')][_0x072f('0x4e')](_[_0x072f('0x64')](_0x3227c0,['ids','id'])||{},{'fields':_[_0x072f('0x35')](_0x29b662),'raw':!![]})['then'](function(_0x2f6a1c){_0x3e5608[_0x072f('0x65')][_0x072f('0x62')](_0x2f6a1c[_0x072f('0x66')]);})[_0x072f('0x4a')](function(_0x4242fa){_0x3e5608[_0x072f('0x67')][_0x072f('0x62')]({'data':_0x3227c0,'error':_0x4242fa[_0x072f('0x68')]});});})['then'](function(_0x561c67){return _0x3e5608;})['catch'](function(_0x2af3a6){return _0x2af3a6;});}else{_0x26b60d[_0x072f('0x20')](0x190)[_0x072f('0x26')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x072f('0x2a')](respondWithResult(_0x26b60d,null))[_0x072f('0x4a')](handleError(_0x26b60d,null));};exports[_0x072f('0x69')]=function(_0x1597b2,_0x24639b,_0x123c55){var _0x5b24f3;return db[_0x072f('0x45')]['find']({'where':{'id':_0x1597b2[_0x072f('0x4c')]['id']},'include':[{'model':db[_0x072f('0x6a')],'as':_0x072f('0x6b')}]})['then'](handleEntityNotFound(_0x24639b,null))[_0x072f('0x2a')](function(_0x295886){if(_0x295886){_0x5b24f3=_0x295886;return db['CmContact']['rawAttributes'];}})[_0x072f('0x2a')](function(_0x5708cb){if(_0x5708cb){var _0xdf0ab={};var _0x302545={};_0x302545[_0x072f('0x38')]=_[_0x072f('0x6c')](_[_0x072f('0x35')](_0x5708cb),_[_0x072f('0x31')](_0x5b24f3[_0x072f('0x6b')],function(_0x5444c6){return util[_0x072f('0x6d')](_0x072f('0x6e'),_0x5444c6['id']);}));_0x302545['query']=_[_0x072f('0x35')](_0x1597b2['query']);_0x302545[_0x072f('0x36')]=_[_0x072f('0x37')](_0x302545[_0x072f('0x38')],_0x302545[_0x072f('0x34')]);_0xdf0ab[_0x072f('0x39')]=_['intersection'](_0x302545[_0x072f('0x38')],qs[_0x072f('0x3a')](_0x1597b2['query']['fields']));_0xdf0ab[_0x072f('0x39')]=_0xdf0ab[_0x072f('0x39')][_0x072f('0x3b')]?_0xdf0ab['attributes']:_0x302545[_0x072f('0x38')];if(!_0x1597b2[_0x072f('0x34')][_0x072f('0x6f')]('nolimit')){_0xdf0ab[_0x072f('0x3d')]=qs[_0x072f('0x3d')](_0x1597b2['query'][_0x072f('0x3d')]);_0xdf0ab['offset']=qs['offset'](_0x1597b2[_0x072f('0x34')][_0x072f('0x22')]);}_0xdf0ab[_0x072f('0x3e')]=qs[_0x072f('0x3f')](_0x1597b2[_0x072f('0x34')][_0x072f('0x3f')]);_0xdf0ab[_0x072f('0x40')]=qs[_0x072f('0x36')](_['pick'](_0x1597b2[_0x072f('0x34')],_0x302545[_0x072f('0x36')]));_0xdf0ab['raw']=!![];if(_0x1597b2['query'][_0x072f('0x5b')]){_0xdf0ab[_0x072f('0x40')]=_[_0x072f('0x42')](_0xdf0ab[_0x072f('0x40')],{'$or':_[_0x072f('0x31')](_0xdf0ab['attributes'],function(_0x116c29){var _0x222678={};_0x222678[_0x116c29]={'$like':'%'+_0x1597b2[_0x072f('0x34')]['filter']+'%'};return _0x222678;})});}_0xdf0ab=_[_0x072f('0x42')]({},_0xdf0ab,_0x1597b2[_0x072f('0x44')]);return _0x5b24f3[_0x072f('0x69')](_0xdf0ab);}})['then'](respondWithResult(_0x24639b,null))['catch'](handleError(_0x24639b,null));};exports[_0x072f('0x70')]=function(_0x239460,_0x1ecb1b,_0x29c140){var _0x29783e;var _0x351bd4;var _0x54e769;var _0x481061=_0x239460[_0x072f('0x4c')]['id'];csv_results=[];return db[_0x072f('0x71')][_0x072f('0x48')]({'attributes':['id',_0x072f('0x30')],'raw':!![],'order':[_0x072f('0x72')]})['then'](function(_0x380d93){_0x29783e=_0x380d93;var _0x189775=_[_0x072f('0x35')](db[_0x072f('0x5f')][_0x072f('0x4d')]);return db[_0x072f('0x6a')][_0x072f('0x48')]({'raw':!![],'attributes':['id','alias']})[_0x072f('0x2a')](function(_0x46b246){_0x351bd4=_0x46b246;var _0x5db538=squel[_0x072f('0x73')]()[_0x072f('0x3a')](_0x189775)[_0x072f('0x74')]('cm_contacts','c')[_0x072f('0x40')](_0x072f('0x75'),_0x481061)[_0x072f('0x40')](_0x072f('0x76'))['distinct']();for(var _0x838614=0x0;_0x838614<_0x351bd4[_0x072f('0x3b')];_0x838614++){_0x5db538['field']('c.cf_'+_0x351bd4[_0x838614]['id'],_0x072f('0x77')+_0x351bd4[_0x838614][_0x072f('0x78')]);}for(var _0x838614=0x0;_0x838614<_0x29783e[_0x072f('0x3b')];_0x838614++){_0x5db538[_0x072f('0x79')](squel[_0x072f('0x73')]()[_0x072f('0x79')]('item')[_0x072f('0x74')](_0x072f('0x7a'))['where']('ItemTypeId\x20=\x20?',_0x29783e[_0x838614]['id'])[_0x072f('0x40')](_0x072f('0x7b')),_0x072f('0x7c')+_0x29783e[_0x838614][_0x072f('0x30')]);_0x5db538[_0x072f('0x79')](squel[_0x072f('0x73')]()['field'](_0x072f('0x7d'))[_0x072f('0x74')](_0x072f('0x7a'))[_0x072f('0x40')](_0x072f('0x7e'),_0x29783e[_0x838614]['id'])[_0x072f('0x40')]('CmContactId\x20=\x20c.id'),'description_additionalPhone_'+_0x29783e[_0x838614][_0x072f('0x30')]);}var _0x13e42c=[];_0x13e42c['push'](_0x5db538[_0x072f('0x7f')]());BPromise['each'](_0x13e42c,handleQuery)[_0x072f('0x2a')](function(_0x1f04d4){handleQuery(_0x5db538[_0x072f('0x7f')]());var _0x55b6a7=csv_results[0x0];if(!_[_0x072f('0x80')](_0x55b6a7)){var _0x543362=toCsv(_0x55b6a7);var _0x3ba3dd=Date['now']();fs[_0x072f('0x81')](util[_0x072f('0x6d')]('/tmp/list_%d_%s.csv',_0x481061,_0x3ba3dd),_0x543362);_0x1ecb1b[_0x072f('0x82')](_0x072f('0x83'),_0x072f('0x84')+util[_0x072f('0x6d')](_0x072f('0x85'),_0x481061,_0x3ba3dd));_0x1ecb1b[_0x072f('0x82')](_0x072f('0x86'),_0x072f('0x87'));return _0x1ecb1b[_0x072f('0x88')](util[_0x072f('0x6d')](_0x072f('0x89'),_0x481061,_0x3ba3dd));}else{return _0x1ecb1b['sendStatus'](0xcc);}});});});};exports[_0x072f('0x8a')]=function(_0x426a11,_0x44c35c,_0xa187d7){var _0x54280c;delete _0x426a11[_0x072f('0x4f')]['id'];return db[_0x072f('0x45')][_0x072f('0x8b')]({'where':{'id':_0x426a11[_0x072f('0x4c')]['id']}})[_0x072f('0x2a')](handleEntityNotFound(_0x44c35c,null))[_0x072f('0x2a')](function(_0x13d757){if(_0x13d757){return db[_0x072f('0x8c')]['transaction'](function(_0x8e93a2){return db[_0x072f('0x6a')][_0x072f('0x4e')](_0x426a11[_0x072f('0x4f')],{'transaction':_0x8e93a2})[_0x072f('0x2a')](function(_0x134bb6){_0x54280c=_0x134bb6;return _0x13d757[_0x072f('0x8d')](_0x134bb6,{'transaction':_0x8e93a2});})[_0x072f('0x2a')](function(){var _0x25d095={'type':db[_0x072f('0x8e')]['TEXT'],'transaction':_0x8e93a2};switch(_0x426a11[_0x072f('0x4f')][_0x072f('0x33')]){case _0x072f('0x8f'):_0x25d095['type']=db[_0x072f('0x8e')][_0x072f('0x90')];break;case _0x072f('0x91'):_0x25d095['type']=db['Sequelize'][_0x072f('0x92')];break;case'switch':_0x25d095[_0x072f('0x33')]=db[_0x072f('0x8e')]['BOOLEAN'];_0x25d095[_0x072f('0x93')]=![];break;default:}return db['sequelize']['queryInterface']['addColumn'](_0x072f('0x94'),util[_0x072f('0x6d')](_0x072f('0x95'),_0x54280c['id']),_0x25d095);})['then'](function(){return _0x54280c;});});}})[_0x072f('0x2a')](respondWithResult(_0x44c35c,null))[_0x072f('0x4a')](handleError(_0x44c35c,null));};exports['getCustomFields']=function(_0x49e5a3,_0x171aa3,_0x2c62ea){var _0x9aed84={};var _0x1a045e={};var _0x236033;var _0x3b4979;return db[_0x072f('0x45')][_0x072f('0x8b')]({'where':{'id':_0x49e5a3['params']['id']}})[_0x072f('0x2a')](handleEntityNotFound(_0x171aa3,null))['then'](function(_0x31f929){if(_0x31f929){_0x236033=_0x31f929;_0x1a045e[_0x072f('0x38')]=_[_0x072f('0x35')](db['CmCustomField']['rawAttributes']);_0x1a045e[_0x072f('0x34')]=_[_0x072f('0x35')](_0x49e5a3[_0x072f('0x34')]);_0x1a045e[_0x072f('0x36')]=_[_0x072f('0x37')](_0x1a045e['model'],_0x1a045e[_0x072f('0x34')]);_0x9aed84['attributes']=_['intersection'](_0x1a045e[_0x072f('0x38')],qs[_0x072f('0x3a')](_0x49e5a3[_0x072f('0x34')]['fields']));_0x9aed84[_0x072f('0x39')]=_0x9aed84[_0x072f('0x39')][_0x072f('0x3b')]?_0x9aed84[_0x072f('0x39')]:_0x1a045e[_0x072f('0x38')];_0x9aed84[_0x072f('0x3e')]=qs['sort'](_0x49e5a3[_0x072f('0x34')][_0x072f('0x3f')]);_0x9aed84[_0x072f('0x40')]=qs[_0x072f('0x36')](_[_0x072f('0x41')](_0x49e5a3[_0x072f('0x34')],_0x1a045e[_0x072f('0x36')]));_0x9aed84['where']=_['merge'](_0x9aed84[_0x072f('0x40')],{'$or':[{'ListId':_0x31f929['id']},{'ListId':null}]});if(_0x49e5a3[_0x072f('0x34')][_0x072f('0x5b')]){_0x9aed84[_0x072f('0x40')]=_[_0x072f('0x42')](_0x9aed84[_0x072f('0x40')],{'$or':_['map'](_0x9aed84[_0x072f('0x39')],function(_0x25bd07){var _0xd537f1={};_0xd537f1[_0x25bd07]={'$like':'%'+_0x49e5a3[_0x072f('0x34')][_0x072f('0x5b')]+'%'};return _0xd537f1;})});}_0x9aed84=_[_0x072f('0x42')]({},_0x9aed84,_0x49e5a3['options']);return db['CmCustomField'][_0x072f('0x96')](_0x9aed84);}})[_0x072f('0x2a')](respondWithResult(_0x171aa3,null))['catch'](handleError(_0x171aa3,null));};exports[_0x072f('0x97')]=function(_0x35406e,_0x49c1ac){return db[_0x072f('0x6a')][_0x072f('0x96')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x49c1ac,null))['then'](function(_0xb517db){return _0xb517db;})[_0x072f('0x2a')](respondWithResult(_0x49c1ac,null))[_0x072f('0x4a')](handleError(_0x49c1ac,null));};exports['addAgents']=function(_0x5dc3db,_0x4647cf,_0x4ef3bc){return db['CmList'][_0x072f('0x56')]({'where':{'id':_0x5dc3db[_0x072f('0x4c')]['id']}})[_0x072f('0x2a')](handleEntityNotFound(_0x4647cf,null))['then'](function(_0x350996){if(_0x350996){return _0x350996[_0x072f('0x98')](_0x5dc3db['body'][_0x072f('0x5d')],_[_0x072f('0x64')](_0x5dc3db[_0x072f('0x4f')],['ids','id'])||{})[_0x072f('0x99')](function(_0xdb902e){for(var _0x469c97=0x0;_0x469c97<_0x5dc3db[_0x072f('0x4f')]['ids'][_0x072f('0x3b')];_0x469c97+=0x1){socket[_0x072f('0x9a')](_0x072f('0x9b'),{'UserId':Number(_0x5dc3db[_0x072f('0x4f')]['ids'][_0x469c97]),'CmListId':Number(_0x5dc3db[_0x072f('0x4c')]['id'])});}return _0xdb902e;});}})[_0x072f('0x2a')](respondWithResult(_0x4647cf,null))['catch'](handleError(_0x4647cf,null));};exports['removeAgents']=function(_0x80983f,_0x2288b1,_0x5ef0fd){return db[_0x072f('0x45')][_0x072f('0x56')]({'where':{'id':_0x80983f[_0x072f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2288b1,null))[_0x072f('0x2a')](function(_0x2ec7a1){if(_0x2ec7a1){return _0x2ec7a1[_0x072f('0x9c')](_0x80983f[_0x072f('0x34')][_0x072f('0x5d')])[_0x072f('0x2a')](function(){if(_[_0x072f('0x61')](_0x80983f[_0x072f('0x34')][_0x072f('0x5d')])){for(var _0x5ebb78=0x0;_0x5ebb78<_0x80983f[_0x072f('0x34')][_0x072f('0x5d')][_0x072f('0x3b')];_0x5ebb78+=0x1){socket['emit'](_0x072f('0x9d'),{'UserId':Number(_0x80983f[_0x072f('0x34')][_0x072f('0x5d')][_0x5ebb78]),'CmListId':Number(_0x80983f['params']['id'])});}}else{socket[_0x072f('0x9a')](_0x072f('0x9d'),{'UserId':Number(_0x80983f[_0x072f('0x34')][_0x072f('0x5d')]),'CmListId':Number(_0x80983f[_0x072f('0x4c')]['id'])});}});}})[_0x072f('0x2a')](respondWithStatusCode(_0x2288b1,null))[_0x072f('0x4a')](handleError(_0x2288b1,null));};exports[_0x072f('0x9e')]=function(_0x1c2960,_0x1b9104,_0x5bc3f8){var _0x5c155e={};var _0x19ff0d={};var _0x464790;var _0x3c92a1;return db[_0x072f('0x45')][_0x072f('0x8b')]({'where':{'id':_0x1c2960[_0x072f('0x4c')]['id']}})[_0x072f('0x2a')](handleEntityNotFound(_0x1b9104,null))[_0x072f('0x2a')](function(_0xa19426){if(_0xa19426){_0x464790=_0xa19426;_0x19ff0d[_0x072f('0x38')]=_['keys'](db[_0x072f('0x9f')][_0x072f('0x4d')]);_0x19ff0d[_0x072f('0x34')]=_[_0x072f('0x35')](_0x1c2960[_0x072f('0x34')]);_0x19ff0d['filters']=_[_0x072f('0x37')](_0x19ff0d[_0x072f('0x38')],_0x19ff0d[_0x072f('0x34')]);_0x5c155e[_0x072f('0x39')]=_['intersection'](_0x19ff0d[_0x072f('0x38')],qs[_0x072f('0x3a')](_0x1c2960[_0x072f('0x34')][_0x072f('0x3a')]));_0x5c155e[_0x072f('0x39')]=_0x5c155e[_0x072f('0x39')][_0x072f('0x3b')]?_0x5c155e[_0x072f('0x39')]:_0x19ff0d['model'];_0x5c155e[_0x072f('0x3e')]=qs['sort'](_0x1c2960[_0x072f('0x34')]['sort']);_0x5c155e['where']=qs['filters'](_[_0x072f('0x41')](_0x1c2960['query'],_0x19ff0d[_0x072f('0x36')]));if(_0x1c2960[_0x072f('0x34')][_0x072f('0x5b')]){_0x5c155e[_0x072f('0x40')]=_[_0x072f('0x42')](_0x5c155e[_0x072f('0x40')],{'$or':_[_0x072f('0x31')](_0x5c155e['attributes'],function(_0x5406ba){var _0xecf337={};_0xecf337[_0x5406ba]={'$like':'%'+_0x1c2960[_0x072f('0x34')][_0x072f('0x5b')]+'%'};return _0xecf337;})});}_0x5c155e=_[_0x072f('0x42')]({},_0x5c155e,_0x1c2960[_0x072f('0x44')]);return _0x464790[_0x072f('0x9e')](_0x5c155e);}})[_0x072f('0x2a')](function(_0x19dad7){if(_0x19dad7){_0x3c92a1=_0x19dad7[_0x072f('0x3b')];if(!_0x1c2960[_0x072f('0x34')][_0x072f('0x6f')](_0x072f('0x3c'))){_0x5c155e[_0x072f('0x3d')]=qs[_0x072f('0x3d')](_0x1c2960[_0x072f('0x34')][_0x072f('0x3d')]);_0x5c155e[_0x072f('0x22')]=qs[_0x072f('0x22')](_0x1c2960['query'][_0x072f('0x22')]);}return _0x464790['getAgents'](_0x5c155e);}})[_0x072f('0x2a')](function(_0x24ddb6){if(_0x24ddb6){return _0x24ddb6?{'count':_0x3c92a1,'rows':_0x24ddb6}:null;}})[_0x072f('0x2a')](respondWithResult(_0x1b9104,null))[_0x072f('0x4a')](handleError(_0x1b9104,null));};function handleQuery(_0x1552a7){logger[_0x072f('0xa0')](_0x1552a7);return db['sequelize']['query'](_0x1552a7)[_0x072f('0x99')](function(_0x3acfef){csv_results['push'](_0x3acfef);})[_0x072f('0x4a')](function(_0x5cb397){logger['error'](_0x5cb397[_0x072f('0x68')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 3a1a0ef..a859b01 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(_0x2d4cf0,_0x209abe){var _0x22353c=function(_0x19cd19){while(--_0x19cd19){_0x2d4cf0['push'](_0x2d4cf0['shift']());}};_0x22353c(++_0x209abe);}(_0x814b,0x1a2));var _0xb814=function(_0x1ee5be,_0x5f46e3){_0x1ee5be=_0x1ee5be-0x0;var _0x177140=_0x814b[_0x1ee5be];return _0x177140;};'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(_0x27dba4,_0x419253){var _0x35ec9d=function(_0x2d13b2){while(--_0x2d13b2){_0x27dba4['push'](_0x27dba4['shift']());}};_0x35ec9d(++_0x419253);}(_0x5fc3,0xa8));var _0x35fc=function(_0x57e00e,_0x36e79a){_0x57e00e=_0x57e00e-0x0;var _0x415e60=_0x5fc3[_0x57e00e];return _0x415e60;};'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 0697f2f..02c766d 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 _0xb4e6=['path','rimraf','./cmList.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1d7665,_0xa95e64){var _0x2fe722=function(_0xb8c446){while(--_0xb8c446){_0x1d7665['push'](_0x1d7665['shift']());}};_0x2fe722(++_0xa95e64);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0xb4e6[_0x27e811];return _0x1627fa;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','CmList','cm_lists','lodash'];(function(_0x554be5,_0x177df1){var _0x2ec936=function(_0x5a2071){while(--_0x5a2071){_0x554be5['push'](_0x554be5['shift']());}};_0x2ec936(++_0x177df1);}(_0xdace,0xc5));var _0xedac=function(_0xba1760,_0x191969){_0xba1760=_0xba1760-0x0;var _0x1f3143=_0xdace[_0xba1760];return _0x1f3143;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./cmList.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'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 a4bf7bd..7874323 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 _0x4dd5=['request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s'];(function(_0x11a404,_0x4ae96a){var _0x2be6f7=function(_0x41c940){while(--_0x41c940){_0x11a404['push'](_0x11a404['shift']());}};_0x2be6f7(++_0x4ae96a);}(_0x4dd5,0x10f));var _0x54dd=function(_0x90d7c5,_0x5c9441){_0x90d7c5=_0x90d7c5-0x0;var _0x50661d=_0x4dd5[_0x90d7c5];return _0x50661d;};'use strict';var _=require('lodash');var util=require(_0x54dd('0x0'));var moment=require(_0x54dd('0x1'));var BPromise=require('bluebird');var rs=require(_0x54dd('0x2'));var fs=require('fs');var Redis=require(_0x54dd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x54dd('0x4'));var config=require(_0x54dd('0x5'));var jayson=require(_0x54dd('0x6'));var client=jayson[_0x54dd('0x7')][_0x54dd('0x8')]({'port':0x232a});config[_0x54dd('0x9')]=_['defaults'](config[_0x54dd('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x54dd('0xa'))(new Redis(config[_0x54dd('0x9')]));require(_0x54dd('0xb'))[_0x54dd('0xc')](socket);function respondWithRpcPromise(_0x34428f,_0x9db1a8,_0x117956){return new BPromise(function(_0x387001,_0x1181ea){return client[_0x54dd('0xd')](_0x34428f,_0x117956)[_0x54dd('0xe')](function(_0x3cadc3){logger[_0x54dd('0xf')](_0x54dd('0x10'),_0x9db1a8,_0x54dd('0x11'));logger[_0x54dd('0x12')](_0x54dd('0x13'),_0x9db1a8,_0x54dd('0x11'),JSON[_0x54dd('0x14')](_0x3cadc3));if(_0x3cadc3[_0x54dd('0x15')]){if(_0x3cadc3[_0x54dd('0x15')][_0x54dd('0x16')]===0x1f4){logger[_0x54dd('0x15')](_0x54dd('0x10'),_0x9db1a8,_0x3cadc3['error'][_0x54dd('0x17')]);return _0x1181ea(_0x3cadc3[_0x54dd('0x15')][_0x54dd('0x17')]);}logger[_0x54dd('0x15')]('CmList,\x20%s,\x20%s',_0x9db1a8,_0x3cadc3[_0x54dd('0x15')]['message']);return _0x387001(_0x3cadc3[_0x54dd('0x15')][_0x54dd('0x17')]);}else{logger[_0x54dd('0xf')](_0x54dd('0x10'),_0x9db1a8,_0x54dd('0x11'));_0x387001(_0x3cadc3['result']['message']);}})['catch'](function(_0x1fe696){logger['error'](_0x54dd('0x10'),_0x9db1a8,_0x1fe696);_0x1181ea(_0x1fe696);});});} \ No newline at end of file +var _0x96fb=['rpc','../../config/environment','jayson/promise','client','redis','localhost','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','randomstring','ioredis'];(function(_0x73f519,_0x15fa15){var _0x410358=function(_0x7d7b48){while(--_0x7d7b48){_0x73f519['push'](_0x73f519['shift']());}};_0x410358(++_0x15fa15);}(_0x96fb,0x1ca));var _0xb96f=function(_0x2890e0,_0xb13a29){_0x2890e0=_0x2890e0-0x0;var _0x267dfe=_0x96fb[_0x2890e0];return _0x267dfe;};'use strict';var _=require(_0xb96f('0x0'));var util=require('util');var moment=require(_0xb96f('0x1'));var BPromise=require('bluebird');var rs=require(_0xb96f('0x2'));var fs=require('fs');var Redis=require(_0xb96f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb96f('0x4'));var config=require(_0xb96f('0x5'));var jayson=require(_0xb96f('0x6'));var client=jayson[_0xb96f('0x7')]['http']({'port':0x232a});config[_0xb96f('0x8')]=_['defaults'](config[_0xb96f('0x8')],{'host':_0xb96f('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb96f('0x8')]));require(_0xb96f('0xa'))['register'](socket);function respondWithRpcPromise(_0x234bad,_0x3e18a4,_0x114e9f){return new BPromise(function(_0x4a86fb,_0x18b321){return client[_0xb96f('0xb')](_0x234bad,_0x114e9f)[_0xb96f('0xc')](function(_0x43b2d7){logger[_0xb96f('0xd')](_0xb96f('0xe'),_0x3e18a4,_0xb96f('0xf'));logger['debug'](_0xb96f('0x10'),_0x3e18a4,_0xb96f('0xf'),JSON['stringify'](_0x43b2d7));if(_0x43b2d7[_0xb96f('0x11')]){if(_0x43b2d7['error']['code']===0x1f4){logger[_0xb96f('0x11')](_0xb96f('0xe'),_0x3e18a4,_0x43b2d7[_0xb96f('0x11')][_0xb96f('0x12')]);return _0x18b321(_0x43b2d7[_0xb96f('0x11')][_0xb96f('0x12')]);}logger[_0xb96f('0x11')](_0xb96f('0xe'),_0x3e18a4,_0x43b2d7['error'][_0xb96f('0x12')]);return _0x4a86fb(_0x43b2d7[_0xb96f('0x11')][_0xb96f('0x12')]);}else{logger[_0xb96f('0xd')](_0xb96f('0xe'),_0x3e18a4,_0xb96f('0xf'));_0x4a86fb(_0x43b2d7[_0xb96f('0x13')]['message']);}})[_0xb96f('0x14')](function(_0x54bb04){logger[_0xb96f('0x11')](_0xb96f('0xe'),_0x3e18a4,_0x54bb04);_0x18b321(_0x54bb04);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 5daeacc..4d67ab9 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 _0x7fe8=['length','./cmList.events','save','update','removeListener'];(function(_0x27fcea,_0x3b71c0){var _0x102ff7=function(_0x4cad83){while(--_0x4cad83){_0x27fcea['push'](_0x27fcea['shift']());}};_0x102ff7(++_0x3b71c0);}(_0x7fe8,0x13c));var _0x87fe=function(_0xc40b9f,_0x17ec1f){_0xc40b9f=_0xc40b9f-0x0;var _0x535b9c=_0x7fe8[_0xc40b9f];return _0x535b9c;};'use strict';var CmListEvents=require(_0x87fe('0x0'));var events=[_0x87fe('0x1'),'remove',_0x87fe('0x2')];function createListener(_0x57bd95,_0x48bbca){return function(_0x86dbad){_0x48bbca['emit'](_0x57bd95,_0x86dbad);};}function removeListener(_0x17eaaf,_0x53387a){return function(){CmListEvents[_0x87fe('0x3')](_0x17eaaf,_0x53387a);};}exports['register']=function(_0x5df68a){for(var _0x5afd4f=0x0,_0x6e6c6e=events[_0x87fe('0x4')];_0x5afd4f<_0x6e6c6e;_0x5afd4f++){var _0x40e4ee=events[_0x5afd4f];var _0x571b66=createListener('cmList:'+_0x40e4ee,_0x5df68a);CmListEvents['on'](_0x40e4ee,_0x571b66);}}; \ No newline at end of file +var _0x0897=['./cmList.events','save','remove','update','emit','register','length'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x0897,0xaf));var _0x7089=function(_0x2c26d6,_0x2beadf){_0x2c26d6=_0x2c26d6-0x0;var _0x13aa70=_0x0897[_0x2c26d6];return _0x13aa70;};'use strict';var CmListEvents=require(_0x7089('0x0'));var events=[_0x7089('0x1'),_0x7089('0x2'),_0x7089('0x3')];function createListener(_0x29fbb5,_0x26b4b0){return function(_0x5d3460){_0x26b4b0[_0x7089('0x4')](_0x29fbb5,_0x5d3460);};}function removeListener(_0x35e606,_0x1f8e40){return function(){CmListEvents['removeListener'](_0x35e606,_0x1f8e40);};}exports[_0x7089('0x5')]=function(_0x2648b0){for(var _0x3d1f28=0x0,_0x242f03=events[_0x7089('0x6')];_0x3d1f28<_0x242f03;_0x3d1f28++){var _0x260bd4=events[_0x3d1f28];var _0x34b078=createListener('cmList:'+_0x260bd4,_0x2648b0);CmListEvents['on'](_0x260bd4,_0x34b078);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 44f72ec..f9d136d 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 _0x0a6d=['post','create','addContacts','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','getGlobalCustomFields','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents'];(function(_0x3e5a4b,_0x2c33b4){var _0x58db22=function(_0x43d4ec){while(--_0x43d4ec){_0x3e5a4b['push'](_0x3e5a4b['shift']());}};_0x58db22(++_0x2c33b4);}(_0x0a6d,0xd1));var _0xd0a6=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x0a6d[_0x21549c];return _0x426cbd;};'use strict';var multer=require(_0xd0a6('0x0'));var util=require(_0xd0a6('0x1'));var path=require('path');var timeout=require(_0xd0a6('0x2'));var express=require(_0xd0a6('0x3'));var router=express[_0xd0a6('0x4')]();var fs_extra=require(_0xd0a6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd0a6('0x6'));var config=require(_0xd0a6('0x7'));var controller=require(_0xd0a6('0x8'));router[_0xd0a6('0x9')]('/',auth[_0xd0a6('0xa')](),controller['index']);router['get']('/describe',auth[_0xd0a6('0xa')](),controller['describe']);router[_0xd0a6('0x9')]('/global_fields',auth[_0xd0a6('0xa')](),controller[_0xd0a6('0xb')]);router[_0xd0a6('0x9')](_0xd0a6('0xc'),auth[_0xd0a6('0xa')](),controller[_0xd0a6('0xd')]);router['get'](_0xd0a6('0xe'),auth[_0xd0a6('0xa')](),controller['getDispositions']);router[_0xd0a6('0x9')](_0xd0a6('0xf'),auth[_0xd0a6('0xa')](),controller[_0xd0a6('0x10')]);router[_0xd0a6('0x9')](_0xd0a6('0x11'),auth['isAuthenticated'](),controller['getContactsCsv']);router['get'](_0xd0a6('0x12'),auth[_0xd0a6('0xa')](),controller[_0xd0a6('0x13')]);router[_0xd0a6('0x9')](_0xd0a6('0x14'),auth[_0xd0a6('0xa')](),controller[_0xd0a6('0x15')]);router[_0xd0a6('0x16')]('/',auth[_0xd0a6('0xa')](),controller[_0xd0a6('0x17')]);router[_0xd0a6('0x16')](_0xd0a6('0xe'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0xd0a6('0xf'),auth[_0xd0a6('0xa')](),controller[_0xd0a6('0x18')]);router[_0xd0a6('0x16')](_0xd0a6('0x12'),auth[_0xd0a6('0xa')](),controller['addCustomField']);router[_0xd0a6('0x16')](_0xd0a6('0x14'),auth['isAuthenticated'](),controller[_0xd0a6('0x19')]);router[_0xd0a6('0x1a')](_0xd0a6('0xc'),auth['isAuthenticated'](),controller[_0xd0a6('0x1b')]);router[_0xd0a6('0x1c')]('/:id',auth[_0xd0a6('0xa')](),controller[_0xd0a6('0x1d')]);router['delete'](_0xd0a6('0xe'),auth[_0xd0a6('0xa')](),controller[_0xd0a6('0x1e')]);router[_0xd0a6('0x1c')](_0xd0a6('0x14'),auth[_0xd0a6('0xa')](),controller[_0xd0a6('0x1f')]);module[_0xd0a6('0x20')]=router; \ No newline at end of file +var _0x3045=['Router','fs-extra','../../components/auth/service','isAuthenticated','index','/describe','describe','get','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','express'];(function(_0x3ba753,_0x2f3216){var _0x2f469a=function(_0x3c0c23){while(--_0x3c0c23){_0x3ba753['push'](_0x3ba753['shift']());}};_0x2f469a(++_0x2f3216);}(_0x3045,0x134));var _0x5304=function(_0x776660,_0x1d1885){_0x776660=_0x776660-0x0;var _0x1359b9=_0x3045[_0x776660];return _0x1359b9;};'use strict';var multer=require(_0x5304('0x0'));var util=require(_0x5304('0x1'));var path=require(_0x5304('0x2'));var timeout=require('connect-timeout');var express=require(_0x5304('0x3'));var router=express[_0x5304('0x4')]();var fs_extra=require(_0x5304('0x5'));var auth=require(_0x5304('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmList.controller');router['get']('/',auth[_0x5304('0x7')](),controller[_0x5304('0x8')]);router['get'](_0x5304('0x9'),auth['isAuthenticated'](),controller[_0x5304('0xa')]);router[_0x5304('0xb')](_0x5304('0xc'),auth[_0x5304('0x7')](),controller[_0x5304('0xd')]);router[_0x5304('0xb')](_0x5304('0xe'),auth[_0x5304('0x7')](),controller[_0x5304('0xf')]);router['get'](_0x5304('0x10'),auth['isAuthenticated'](),controller[_0x5304('0x11')]);router[_0x5304('0xb')](_0x5304('0x12'),auth[_0x5304('0x7')](),controller[_0x5304('0x13')]);router[_0x5304('0xb')](_0x5304('0x14'),auth[_0x5304('0x7')](),controller[_0x5304('0x15')]);router[_0x5304('0xb')](_0x5304('0x16'),auth[_0x5304('0x7')](),controller[_0x5304('0x17')]);router[_0x5304('0xb')](_0x5304('0x18'),auth[_0x5304('0x7')](),controller[_0x5304('0x19')]);router[_0x5304('0x1a')]('/',auth[_0x5304('0x7')](),controller[_0x5304('0x1b')]);router[_0x5304('0x1a')](_0x5304('0x10'),auth[_0x5304('0x7')](),controller[_0x5304('0x1c')]);router[_0x5304('0x1a')](_0x5304('0x12'),auth[_0x5304('0x7')](),controller[_0x5304('0x1d')]);router[_0x5304('0x1a')](_0x5304('0x16'),auth[_0x5304('0x7')](),controller[_0x5304('0x1e')]);router[_0x5304('0x1a')](_0x5304('0x18'),auth[_0x5304('0x7')](),controller[_0x5304('0x1f')]);router[_0x5304('0x20')]('/:id',auth[_0x5304('0x7')](),controller[_0x5304('0x21')]);router[_0x5304('0x22')](_0x5304('0xe'),auth['isAuthenticated'](),controller[_0x5304('0x23')]);router[_0x5304('0x22')](_0x5304('0x10'),auth[_0x5304('0x7')](),controller[_0x5304('0x24')]);router[_0x5304('0x22')](_0x5304('0x18'),auth[_0x5304('0x7')](),controller[_0x5304('0x25')]);module[_0x5304('0x26')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index d05c6d4..3b1f0e4 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 _0xb0f7=['VIRTUAL','field','STRING','sequelize','exports'];(function(_0x4a77e4,_0x556f71){var _0x1c68d8=function(_0x5d8ddf){while(--_0x5d8ddf){_0x4a77e4['push'](_0x4a77e4['shift']());}};_0x1c68d8(++_0x556f71);}(_0xb0f7,0x134));var _0x7b0f=function(_0x83c716,_0x25152d){_0x83c716=_0x83c716-0x0;var _0xab9893=_0xb0f7[_0x83c716];return _0xab9893;};'use strict';var Sequelize=require(_0x7b0f('0x0'));module[_0x7b0f('0x1')]={'name':{'type':Sequelize[_0x7b0f('0x2')],'get':function(_0x34d2b3){return this['getDataValue'](_0x7b0f('0x3'));}},'field':{'type':Sequelize[_0x7b0f('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7b0f('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7b0f('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xd39b=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x3a97b5,_0x4fdaad){var _0x39a0c6=function(_0x6b92ea){while(--_0x6b92ea){_0x3a97b5['push'](_0x3a97b5['shift']());}};_0x39a0c6(++_0x4fdaad);}(_0xd39b,0xe7));var _0xbd39=function(_0x272e71,_0x3aeff4){_0x272e71=_0x272e71-0x0;var _0x2f1ff3=_0xd39b[_0x272e71];return _0x2f1ff3;};'use strict';var Sequelize=require(_0xbd39('0x0'));module[_0xbd39('0x1')]={'name':{'type':Sequelize[_0xbd39('0x2')],'get':function(_0x491f7e){return this['getDataValue'](_0xbd39('0x3'));}},'field':{'type':Sequelize[_0xbd39('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xbd39('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xbd39('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 73c62a4..0dfe279 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(_0xbb633,_0x4475ee){var _0x347250=function(_0x53106e){while(--_0x53106e){_0xbb633['push'](_0xbb633['shift']());}};_0x347250(++_0x4475ee);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 _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(_0x17126c,_0x5ed1e7){var _0x3d3140=function(_0x5efc53){while(--_0x5efc53){_0x17126c['push'](_0x17126c['shift']());}};_0x3d3140(++_0x5ed1e7);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 1b4cc24..a068172 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 _0x30b0=['Condition','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./condition.attributes','exports','define'];(function(_0x4f60e9,_0x18069a){var _0x531656=function(_0x3272e4){while(--_0x3272e4){_0x4f60e9['push'](_0x4f60e9['shift']());}};_0x531656(++_0x18069a);}(_0x30b0,0x115));var _0x030b=function(_0x440448,_0x1371de){_0x440448=_0x440448-0x0;var _0x5aaa24=_0x30b0[_0x440448];return _0x5aaa24;};'use strict';var _=require(_0x030b('0x0'));var util=require(_0x030b('0x1'));var logger=require('../../config/logger')(_0x030b('0x2'));var moment=require(_0x030b('0x3'));var BPromise=require(_0x030b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x030b('0x5'));var rimraf=require(_0x030b('0x6'));var config=require(_0x030b('0x7'));var attributes=require(_0x030b('0x8'));module[_0x030b('0x9')]=function(_0x4c1bf3,_0x16484b){return _0x4c1bf3[_0x030b('0xa')](_0x030b('0xb'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43cc=['./condition.attributes','define','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x43cc,0xb7));var _0xc43c=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0x43cc[_0x1e48d3];return _0x2852b1;};'use strict';var _=require(_0xc43c('0x0'));var util=require(_0xc43c('0x1'));var logger=require(_0xc43c('0x2'))(_0xc43c('0x3'));var moment=require(_0xc43c('0x4'));var BPromise=require(_0xc43c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc43c('0x6'));var rimraf=require(_0xc43c('0x7'));var config=require(_0xc43c('0x8'));var attributes=require(_0xc43c('0x9'));module['exports']=function(_0x59a7b0,_0x73c0b8){return _0x59a7b0[_0xc43c('0xa')]('Condition',attributes,{'tableName':_0xc43c('0xb'),'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 49e025f..289ec7e 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 _0xf15e=['Condition,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','info','request\x20sent','debug','error','code'];(function(_0x12711a,_0x455f94){var _0x175027=function(_0x456248){while(--_0x456248){_0x12711a['push'](_0x12711a['shift']());}};_0x175027(++_0x455f94);}(_0xf15e,0xaf));var _0xef15=function(_0x1347d2,_0x552ad2){_0x1347d2=_0x1347d2-0x0;var _0x53b6aa=_0xf15e[_0x1347d2];return _0x53b6aa;};'use strict';var _=require(_0xef15('0x0'));var util=require(_0xef15('0x1'));var moment=require(_0xef15('0x2'));var BPromise=require(_0xef15('0x3'));var rs=require(_0xef15('0x4'));var fs=require('fs');var Redis=require(_0xef15('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xef15('0x6'));var logger=require('../../config/logger')(_0xef15('0x7'));var config=require(_0xef15('0x8'));var jayson=require(_0xef15('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1855ea,_0x102441,_0x494a0e){return new BPromise(function(_0x34631b,_0x32d275){return client['request'](_0x1855ea,_0x494a0e)['then'](function(_0x53f8f5){logger[_0xef15('0xa')]('Condition,\x20%s,\x20%s',_0x102441,_0xef15('0xb'));logger[_0xef15('0xc')]('Condition,\x20%s,\x20%s,\x20%s',_0x102441,_0xef15('0xb'),JSON['stringify'](_0x53f8f5));if(_0x53f8f5[_0xef15('0xd')]){if(_0x53f8f5[_0xef15('0xd')][_0xef15('0xe')]===0x1f4){logger['error'](_0xef15('0xf'),_0x102441,_0x53f8f5[_0xef15('0xd')]['message']);return _0x32d275(_0x53f8f5[_0xef15('0xd')]['message']);}logger[_0xef15('0xd')](_0xef15('0xf'),_0x102441,_0x53f8f5[_0xef15('0xd')][_0xef15('0x10')]);return _0x34631b(_0x53f8f5[_0xef15('0xd')][_0xef15('0x10')]);}else{logger[_0xef15('0xa')]('Condition,\x20%s,\x20%s',_0x102441,'request\x20sent');_0x34631b(_0x53f8f5[_0xef15('0x11')][_0xef15('0x10')]);}})[_0xef15('0x12')](function(_0x682a1e){logger[_0xef15('0xd')](_0xef15('0xf'),_0x102441,_0x682a1e);_0x32d275(_0x682a1e);});});} \ No newline at end of file +var _0x4e26=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x4e26,0x109));var _0x64e2=function(_0x29e479,_0x4d2b3f){_0x29e479=_0x29e479-0x0;var _0x174485=_0x4e26[_0x29e479];return _0x174485;};'use strict';var _=require(_0x64e2('0x0'));var util=require('util');var moment=require(_0x64e2('0x1'));var BPromise=require(_0x64e2('0x2'));var rs=require(_0x64e2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x64e2('0x4'))['db'];var utils=require(_0x64e2('0x5'));var logger=require('../../config/logger')(_0x64e2('0x6'));var config=require(_0x64e2('0x7'));var jayson=require(_0x64e2('0x8'));var client=jayson[_0x64e2('0x9')][_0x64e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14b414,_0x515803,_0x142fe5){return new BPromise(function(_0x556832,_0x1ddb50){return client[_0x64e2('0xb')](_0x14b414,_0x142fe5)[_0x64e2('0xc')](function(_0x2000c0){logger[_0x64e2('0xd')](_0x64e2('0xe'),_0x515803,'request\x20sent');logger[_0x64e2('0xf')](_0x64e2('0x10'),_0x515803,'request\x20sent',JSON[_0x64e2('0x11')](_0x2000c0));if(_0x2000c0[_0x64e2('0x12')]){if(_0x2000c0['error'][_0x64e2('0x13')]===0x1f4){logger[_0x64e2('0x12')](_0x64e2('0xe'),_0x515803,_0x2000c0[_0x64e2('0x12')]['message']);return _0x1ddb50(_0x2000c0[_0x64e2('0x12')][_0x64e2('0x14')]);}logger[_0x64e2('0x12')](_0x64e2('0xe'),_0x515803,_0x2000c0[_0x64e2('0x12')][_0x64e2('0x14')]);return _0x556832(_0x2000c0['error'][_0x64e2('0x14')]);}else{logger[_0x64e2('0xd')](_0x64e2('0xe'),_0x515803,_0x64e2('0x15'));_0x556832(_0x2000c0[_0x64e2('0x16')][_0x64e2('0x14')]);}})[_0x64e2('0x17')](function(_0x4fdd0b){logger['error'](_0x64e2('0xe'),_0x515803,_0x4fdd0b);_0x1ddb50(_0x4fdd0b);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 08a7dd7..19f8838 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 _0x7195=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','delete','exports','multer','path'];(function(_0x33a8d5,_0x2a6abb){var _0x464e38=function(_0x3ab173){while(--_0x3ab173){_0x33a8d5['push'](_0x33a8d5['shift']());}};_0x464e38(++_0x2a6abb);}(_0x7195,0xb4));var _0x5719=function(_0x20e3c5,_0x579bb1){_0x20e3c5=_0x20e3c5-0x0;var _0x152499=_0x7195[_0x20e3c5];return _0x152499;};'use strict';var multer=require(_0x5719('0x0'));var util=require('util');var path=require(_0x5719('0x1'));var timeout=require(_0x5719('0x2'));var express=require(_0x5719('0x3'));var router=express[_0x5719('0x4')]();var fs_extra=require(_0x5719('0x5'));var auth=require(_0x5719('0x6'));var interaction=require(_0x5719('0x7'));var config=require(_0x5719('0x8'));var controller=require(_0x5719('0x9'));router['put'](_0x5719('0xa'),auth[_0x5719('0xb')](),controller['update']);router[_0x5719('0xc')](_0x5719('0xa'),auth[_0x5719('0xb')](),controller['destroy']);module[_0x5719('0xd')]=router; \ No newline at end of file +var _0xf760=['put','/:id','isAuthenticated','destroy','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x46f9bc,_0x1b4da0){var _0x2cda76=function(_0x56df2a){while(--_0x56df2a){_0x46f9bc['push'](_0x46f9bc['shift']());}};_0x2cda76(++_0x1b4da0);}(_0xf760,0x19b));var _0x0f76=function(_0x2896e2,_0x546984){_0x2896e2=_0x2896e2-0x0;var _0x1fcb56=_0xf760[_0x2896e2];return _0x1fcb56;};'use strict';var multer=require(_0x0f76('0x0'));var util=require(_0x0f76('0x1'));var path=require(_0x0f76('0x2'));var timeout=require('connect-timeout');var express=require(_0x0f76('0x3'));var router=express['Router']();var fs_extra=require(_0x0f76('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0f76('0x5'));var config=require(_0x0f76('0x6'));var controller=require('./condition.controller');router[_0x0f76('0x7')](_0x0f76('0x8'),auth[_0x0f76('0x9')](),controller['update']);router['delete'](_0x0f76('0x8'),auth[_0x0f76('0x9')](),controller[_0x0f76('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 7eca0b1..b0d1976 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e53=['INTEGER','sequelize','exports','STRING','name'];(function(_0x262183,_0x1cfe27){var _0x255d63=function(_0x4cc495){while(--_0x4cc495){_0x262183['push'](_0x262183['shift']());}};_0x255d63(++_0x1cfe27);}(_0x4e53,0x1a5));var _0x34e5=function(_0x441979,_0x5c4608){_0x441979=_0x441979-0x0;var _0x4b19b8=_0x4e53[_0x441979];return _0x4b19b8;};'use strict';var Sequelize=require(_0x34e5('0x0'));module[_0x34e5('0x1')]={'name':{'type':Sequelize[_0x34e5('0x2')],'allowNull':![],'unique':_0x34e5('0x3')},'OrderBy':{'type':Sequelize[_0x34e5('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x34e5('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x1177=['exports','STRING','name'];(function(_0x36df70,_0x258d78){var _0x2d0ce6=function(_0x1b3e7b){while(--_0x1b3e7b){_0x36df70['push'](_0x36df70['shift']());}};_0x2d0ce6(++_0x258d78);}(_0x1177,0x10b));var _0x7117=function(_0xb4a2e9,_0x40a752){_0xb4a2e9=_0xb4a2e9-0x0;var _0x10dd8b=_0x1177[_0xb4a2e9];return _0x10dd8b;};'use strict';var Sequelize=require('sequelize');module[_0x7117('0x0')]={'name':{'type':Sequelize[_0x7117('0x1')],'allowNull':![],'unique':_0x7117('0x2')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x7117('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 3d11b41..d5cdcc5 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x955f=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','get','ContactItemTypes','UserProfileResource','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','create','user','catch'];(function(_0x18546c,_0x4daf94){var _0x46ef43=function(_0x559377){while(--_0x559377){_0x18546c['push'](_0x18546c['shift']());}};_0x46ef43(++_0x4daf94);}(_0x955f,0x1eb));var _0xf955=function(_0x4b9adf,_0x2d9552){_0x4b9adf=_0x4b9adf-0x0;var _0x2b4a52=_0x955f[_0x4b9adf];return _0x2b4a52;};'use strict';var emlformat=require(_0xf955('0x0'));var rimraf=require(_0xf955('0x1'));var zipdir=require(_0xf955('0x2'));var jsonpatch=require(_0xf955('0x3'));var rp=require(_0xf955('0x4'));var moment=require('moment');var BPromise=require(_0xf955('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf955('0x6'));var sox=require('sox');var csv=require(_0xf955('0x7'));var ejs=require(_0xf955('0x8'));var fs=require('fs');var fs_extra=require(_0xf955('0x9'));var _=require('lodash');var squel=require(_0xf955('0xa'));var crypto=require(_0xf955('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf955('0xc'));var toCsv=require(_0xf955('0x7'));var querystring=require(_0xf955('0xd'));var Papa=require(_0xf955('0xe'));var Redis=require(_0xf955('0xf'));var authService=require(_0xf955('0x10'));var qs=require(_0xf955('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf955('0x12'));var logger=require('../../config/logger')(_0xf955('0x13'));var utils=require(_0xf955('0x14'));var config=require(_0xf955('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf955('0x16'))['db'];function respondWithStatusCode(_0x542347,_0x23e0c6){_0x23e0c6=_0x23e0c6||0xcc;return function(_0x50d9a9){if(_0x50d9a9){return _0x542347[_0xf955('0x17')](_0x23e0c6);}return _0x542347[_0xf955('0x18')](_0x23e0c6)[_0xf955('0x19')]();};}function respondWithResult(_0x109bc5,_0x2080c4){_0x2080c4=_0x2080c4||0xc8;return function(_0x341b8c){if(_0x341b8c){return _0x109bc5[_0xf955('0x18')](_0x2080c4)[_0xf955('0x1a')](_0x341b8c);}};}function respondWithFilteredResult(_0x3c6af7,_0x24e75c){return function(_0x5350e4){if(_0x5350e4){var _0xc29b35=typeof _0x24e75c['offset']===_0xf955('0x1b')&&typeof _0x24e75c[_0xf955('0x1c')]===_0xf955('0x1b');var _0x15c07c=_0x5350e4['count'];var _0x5ac6cb=_0xc29b35?0x0:_0x24e75c[_0xf955('0x1d')];var _0xe6de5c=_0xc29b35?_0x5350e4[_0xf955('0x1e')]:_0x24e75c['offset']+_0x24e75c[_0xf955('0x1c')];var _0x3576fa;if(_0xe6de5c>=_0x15c07c){_0xe6de5c=_0x15c07c;_0x3576fa=0xc8;}else{_0x3576fa=0xce;}_0x3c6af7[_0xf955('0x18')](_0x3576fa);return _0x3c6af7[_0xf955('0x1f')](_0xf955('0x20'),_0x5ac6cb+'-'+_0xe6de5c+'/'+_0x15c07c)['json'](_0x5350e4);}return null;};}function patchUpdates(_0x17d86a){return function(_0x3dbbe8){try{jsonpatch[_0xf955('0x21')](_0x3dbbe8,_0x17d86a,!![]);}catch(_0x488d04){return BPromise[_0xf955('0x22')](_0x488d04);}return _0x3dbbe8['save']();};}function saveUpdates(_0x21ae24,_0x43b078){return function(_0x37143d){if(_0x37143d){return _0x37143d[_0xf955('0x23')](_0x21ae24)[_0xf955('0x24')](function(_0x565641){return _0x565641;});}return null;};}function removeEntity(_0x25f4f2,_0x5fab1c){return function(_0x3585c7){if(_0x3585c7){return _0x3585c7[_0xf955('0x25')]()[_0xf955('0x24')](function(){var _0x102e36=_0x3585c7[_0xf955('0x26')]({'plain':!![]});var _0x552cf3=_0xf955('0x27');return db[_0xf955('0x28')][_0xf955('0x25')]({'where':{'type':_0x552cf3,'resourceId':_0x102e36['id']}})[_0xf955('0x24')](function(){return _0x3585c7;});})[_0xf955('0x24')](function(){_0x25f4f2[_0xf955('0x18')](0xcc)[_0xf955('0x19')]();});}};}function handleEntityNotFound(_0x51f3ab,_0x3caea6){return function(_0x145098){if(!_0x145098){_0x51f3ab[_0xf955('0x17')](0x194);}return _0x145098;};}function handleError(_0xbd0b74,_0x28fa9c){_0x28fa9c=_0x28fa9c||0x1f4;return function(_0x264f6d){logger['error'](_0x264f6d[_0xf955('0x29')]);if(_0x264f6d[_0xf955('0x2a')]){delete _0x264f6d['name'];}_0xbd0b74[_0xf955('0x18')](_0x28fa9c)[_0xf955('0x2b')](_0x264f6d);};}exports[_0xf955('0x2c')]=function(_0x1ef794,_0x59bfb5){var _0x3a951c={},_0x518fb3={},_0x227104={'count':0x0,'rows':[]};var _0x2c222a=_[_0xf955('0x2d')](db[_0xf955('0x2e')][_0xf955('0x2f')],function(_0x32121b){return{'name':_0x32121b[_0xf955('0x30')],'type':_0x32121b[_0xf955('0x31')]['key']};});_0x518fb3[_0xf955('0x32')]=_[_0xf955('0x2d')](_0x2c222a,_0xf955('0x2a'));_0x518fb3[_0xf955('0x33')]=_['keys'](_0x1ef794[_0xf955('0x33')]);_0x518fb3[_0xf955('0x34')]=_[_0xf955('0x35')](_0x518fb3[_0xf955('0x32')],_0x518fb3[_0xf955('0x33')]);_0x3a951c['attributes']=_['intersection'](_0x518fb3['model'],qs[_0xf955('0x36')](_0x1ef794[_0xf955('0x33')][_0xf955('0x36')]));_0x3a951c[_0xf955('0x37')]=_0x3a951c[_0xf955('0x37')][_0xf955('0x38')]?_0x3a951c['attributes']:_0x518fb3[_0xf955('0x32')];if(!_0x1ef794['query'][_0xf955('0x39')](_0xf955('0x3a'))){_0x3a951c[_0xf955('0x1c')]=qs['limit'](_0x1ef794[_0xf955('0x33')]['limit']);_0x3a951c[_0xf955('0x1d')]=qs[_0xf955('0x1d')](_0x1ef794[_0xf955('0x33')][_0xf955('0x1d')]);}_0x3a951c['order']=qs[_0xf955('0x3b')](_0x1ef794[_0xf955('0x33')]['sort']);_0x3a951c[_0xf955('0x3c')]=qs[_0xf955('0x34')](_[_0xf955('0x3d')](_0x1ef794['query'],_0x518fb3[_0xf955('0x34')]),_0x2c222a);if(_0x1ef794[_0xf955('0x33')][_0xf955('0x3e')]){_0x3a951c['where']=_[_0xf955('0x3f')](_0x3a951c[_0xf955('0x3c')],{'$or':_[_0xf955('0x2d')](_0x2c222a,function(_0x2069f3){if(_0x2069f3[_0xf955('0x31')]!==_0xf955('0x40')){var _0x2b614d={};_0x2b614d[_0x2069f3[_0xf955('0x2a')]]={'$like':'%'+_0x1ef794['query'][_0xf955('0x3e')]+'%'};return _0x2b614d;}})});}_0x3a951c=_[_0xf955('0x3f')]({},_0x3a951c,_0x1ef794[_0xf955('0x41')]);var _0xe633fa={'where':_0x3a951c[_0xf955('0x3c')]};return db[_0xf955('0x2e')][_0xf955('0x1e')](_0xe633fa)[_0xf955('0x24')](function(_0x47651b){_0x227104[_0xf955('0x1e')]=_0x47651b;if(_0x1ef794[_0xf955('0x33')][_0xf955('0x42')]){_0x3a951c[_0xf955('0x43')]=[{'all':!![]}];}return db[_0xf955('0x2e')][_0xf955('0x44')](_0x3a951c);})[_0xf955('0x24')](function(_0x356ec2){_0x227104[_0xf955('0x45')]=_0x356ec2;return _0x227104;})[_0xf955('0x24')](respondWithFilteredResult(_0x59bfb5,_0x3a951c))['catch'](handleError(_0x59bfb5,null));};exports[_0xf955('0x46')]=function(_0x25d809,_0x2db18d){var _0x5f0ef9={'raw':!![],'where':{'id':_0x25d809['params']['id']}},_0x16fc1a={};_0x16fc1a[_0xf955('0x32')]=_['keys'](db[_0xf955('0x2e')][_0xf955('0x2f')]);_0x16fc1a[_0xf955('0x33')]=_[_0xf955('0x47')](_0x25d809['query']);_0x16fc1a[_0xf955('0x34')]=_[_0xf955('0x35')](_0x16fc1a[_0xf955('0x32')],_0x16fc1a['query']);_0x5f0ef9['attributes']=_[_0xf955('0x35')](_0x16fc1a[_0xf955('0x32')],qs[_0xf955('0x36')](_0x25d809[_0xf955('0x33')]['fields']));_0x5f0ef9[_0xf955('0x37')]=_0x5f0ef9[_0xf955('0x37')][_0xf955('0x38')]?_0x5f0ef9['attributes']:_0x16fc1a[_0xf955('0x32')];if(_0x25d809['query'][_0xf955('0x42')]){_0x5f0ef9[_0xf955('0x43')]=[{'all':!![]}];}_0x5f0ef9=_[_0xf955('0x3f')]({},_0x5f0ef9,_0x25d809['options']);return db[_0xf955('0x2e')][_0xf955('0x48')](_0x5f0ef9)[_0xf955('0x24')](handleEntityNotFound(_0x2db18d,null))[_0xf955('0x24')](respondWithResult(_0x2db18d,null))['catch'](handleError(_0x2db18d,null));};exports[_0xf955('0x49')]=function(_0x4ff0f1,_0x1c6d76){return db[_0xf955('0x2e')][_0xf955('0x49')](_0x4ff0f1['body'],{})[_0xf955('0x24')](function(_0x4e7269){var _0x35c23c=_0x4ff0f1['user'][_0xf955('0x26')]({'plain':!![]});if(!_0x35c23c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35c23c['role']===_0xf955('0x4a')){var _0x45c7fe=_0x4e7269['get']({'plain':!![]});var _0x142e8f='ContactItemTypes';return db['UserProfileSection']['find']({'where':{'name':_0x142e8f,'userProfileId':_0x35c23c['userProfileId']},'raw':!![]})[_0xf955('0x24')](function(_0x1abe1c){if(_0x1abe1c&&_0x1abe1c['autoAssociation']===0x0){return db['UserProfileResource'][_0xf955('0x49')]({'name':_0x45c7fe[_0xf955('0x2a')],'resourceId':_0x45c7fe['id'],'type':_0x1abe1c[_0xf955('0x2a')],'sectionId':_0x1abe1c['id']},{})[_0xf955('0x24')](function(){return _0x4e7269;});}else{return _0x4e7269;}})[_0xf955('0x4b')](function(_0xa56483){logger[_0xf955('0x4c')](_0xf955('0x4d'),_0xa56483);throw _0xa56483;});}return _0x4e7269;})[_0xf955('0x24')](respondWithResult(_0x1c6d76,0xc9))[_0xf955('0x4b')](handleError(_0x1c6d76,null));};exports[_0xf955('0x23')]=function(_0x350873,_0x47a3a6){if(_0x350873[_0xf955('0x4e')]['id']){delete _0x350873[_0xf955('0x4e')]['id'];}return db[_0xf955('0x2e')][_0xf955('0x48')]({'where':{'id':_0x350873[_0xf955('0x4f')]['id']}})['then'](handleEntityNotFound(_0x47a3a6,null))[_0xf955('0x24')](saveUpdates(_0x350873[_0xf955('0x4e')],null))[_0xf955('0x24')](respondWithResult(_0x47a3a6,null))[_0xf955('0x4b')](handleError(_0x47a3a6,null));};exports[_0xf955('0x25')]=function(_0x9057df,_0x228d59){return db[_0xf955('0x2e')][_0xf955('0x48')]({'where':{'id':_0x9057df[_0xf955('0x4f')]['id']}})['then'](handleEntityNotFound(_0x228d59,null))[_0xf955('0x24')](db[_0xf955('0x50')][_0xf955('0x23')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x9057df[_0xf955('0x4f')]['id']}}))[_0xf955('0x24')](removeEntity(_0x228d59,null))[_0xf955('0x4b')](handleError(_0x228d59,null));}; \ No newline at end of file +var _0x14a0=['undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','send','index','map','ContactItemType','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','userProfileId','autoAssociation','params','CmContactHasItem','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x4f5fbc,_0x74cb4e){var _0x486e0e=function(_0x306829){while(--_0x306829){_0x4f5fbc['push'](_0x4f5fbc['shift']());}};_0x486e0e(++_0x74cb4e);}(_0x14a0,0x8e));var _0x014a=function(_0x20c27e,_0x44dbaa){_0x20c27e=_0x20c27e-0x0;var _0x380560=_0x14a0[_0x20c27e];return _0x380560;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x014a('0x0'));var zipdir=require(_0x014a('0x1'));var jsonpatch=require(_0x014a('0x2'));var rp=require(_0x014a('0x3'));var moment=require(_0x014a('0x4'));var BPromise=require(_0x014a('0x5'));var Mustache=require(_0x014a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x014a('0x7'));var csv=require(_0x014a('0x8'));var ejs=require(_0x014a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x014a('0xf'))(_0x014a('0x10'));var utils=require('../../config/utils');var config=require(_0x014a('0x11'));var licenseUtil=require(_0x014a('0x12'));var db=require(_0x014a('0x13'))['db'];function respondWithStatusCode(_0x43bfeb,_0x1bcd1){_0x1bcd1=_0x1bcd1||0xcc;return function(_0x20cb56){if(_0x20cb56){return _0x43bfeb[_0x014a('0x14')](_0x1bcd1);}return _0x43bfeb[_0x014a('0x15')](_0x1bcd1)[_0x014a('0x16')]();};}function respondWithResult(_0x71535d,_0x45cd80){_0x45cd80=_0x45cd80||0xc8;return function(_0x3c54c8){if(_0x3c54c8){return _0x71535d['status'](_0x45cd80)[_0x014a('0x17')](_0x3c54c8);}};}function respondWithFilteredResult(_0x3cf92f,_0x59f207){return function(_0x3a836f){if(_0x3a836f){var _0x128c46=typeof _0x59f207['offset']===_0x014a('0x18')&&typeof _0x59f207[_0x014a('0x19')]===_0x014a('0x18');var _0x12da95=_0x3a836f[_0x014a('0x1a')];var _0x12d339=_0x128c46?0x0:_0x59f207[_0x014a('0x1b')];var _0x263b07=_0x128c46?_0x3a836f[_0x014a('0x1a')]:_0x59f207[_0x014a('0x1b')]+_0x59f207[_0x014a('0x19')];var _0x89e132;if(_0x263b07>=_0x12da95){_0x263b07=_0x12da95;_0x89e132=0xc8;}else{_0x89e132=0xce;}_0x3cf92f[_0x014a('0x15')](_0x89e132);return _0x3cf92f[_0x014a('0x1c')]('Content-Range',_0x12d339+'-'+_0x263b07+'/'+_0x12da95)[_0x014a('0x17')](_0x3a836f);}return null;};}function patchUpdates(_0x109a9c){return function(_0x11065f){try{jsonpatch[_0x014a('0x1d')](_0x11065f,_0x109a9c,!![]);}catch(_0xc9a563){return BPromise[_0x014a('0x1e')](_0xc9a563);}return _0x11065f[_0x014a('0x1f')]();};}function saveUpdates(_0x3dd2d0,_0x290b86){return function(_0x486e66){if(_0x486e66){return _0x486e66[_0x014a('0x20')](_0x3dd2d0)['then'](function(_0x1a1318){return _0x1a1318;});}return null;};}function removeEntity(_0x26718b,_0x44d921){return function(_0x36d52b){if(_0x36d52b){return _0x36d52b[_0x014a('0x21')]()[_0x014a('0x22')](function(){var _0x3fec9f=_0x36d52b[_0x014a('0x23')]({'plain':!![]});var _0x165a42='ContactItemTypes';return db[_0x014a('0x24')]['destroy']({'where':{'type':_0x165a42,'resourceId':_0x3fec9f['id']}})[_0x014a('0x22')](function(){return _0x36d52b;});})[_0x014a('0x22')](function(){_0x26718b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9a901f,_0x3f9719){return function(_0x143346){if(!_0x143346){_0x9a901f['sendStatus'](0x194);}return _0x143346;};}function handleError(_0x183f19,_0x3c1fa4){_0x3c1fa4=_0x3c1fa4||0x1f4;return function(_0x598179){logger[_0x014a('0x25')](_0x598179[_0x014a('0x26')]);if(_0x598179['name']){delete _0x598179['name'];}_0x183f19[_0x014a('0x15')](_0x3c1fa4)[_0x014a('0x27')](_0x598179);};}exports[_0x014a('0x28')]=function(_0x29fce5,_0x4ea00c){var _0x434038={},_0x147e7e={},_0x15af07={'count':0x0,'rows':[]};var _0x402d3b=_[_0x014a('0x29')](db[_0x014a('0x2a')][_0x014a('0x2b')],function(_0x1dae8e){return{'name':_0x1dae8e[_0x014a('0x2c')],'type':_0x1dae8e[_0x014a('0x2d')][_0x014a('0x2e')]};});_0x147e7e['model']=_[_0x014a('0x29')](_0x402d3b,_0x014a('0x2f'));_0x147e7e[_0x014a('0x30')]=_[_0x014a('0x31')](_0x29fce5[_0x014a('0x30')]);_0x147e7e[_0x014a('0x32')]=_[_0x014a('0x33')](_0x147e7e['model'],_0x147e7e[_0x014a('0x30')]);_0x434038[_0x014a('0x34')]=_['intersection'](_0x147e7e[_0x014a('0x35')],qs[_0x014a('0x36')](_0x29fce5[_0x014a('0x30')][_0x014a('0x36')]));_0x434038[_0x014a('0x34')]=_0x434038[_0x014a('0x34')][_0x014a('0x37')]?_0x434038[_0x014a('0x34')]:_0x147e7e['model'];if(!_0x29fce5[_0x014a('0x30')][_0x014a('0x38')](_0x014a('0x39'))){_0x434038[_0x014a('0x19')]=qs['limit'](_0x29fce5[_0x014a('0x30')][_0x014a('0x19')]);_0x434038[_0x014a('0x1b')]=qs[_0x014a('0x1b')](_0x29fce5[_0x014a('0x30')][_0x014a('0x1b')]);}_0x434038[_0x014a('0x3a')]=qs[_0x014a('0x3b')](_0x29fce5[_0x014a('0x30')]['sort']);_0x434038[_0x014a('0x3c')]=qs['filters'](_[_0x014a('0x3d')](_0x29fce5[_0x014a('0x30')],_0x147e7e[_0x014a('0x32')]),_0x402d3b);if(_0x29fce5[_0x014a('0x30')][_0x014a('0x3e')]){_0x434038['where']=_[_0x014a('0x3f')](_0x434038[_0x014a('0x3c')],{'$or':_['map'](_0x402d3b,function(_0x9227b8){if(_0x9227b8[_0x014a('0x2d')]!==_0x014a('0x40')){var _0x2e7a14={};_0x2e7a14[_0x9227b8[_0x014a('0x2f')]]={'$like':'%'+_0x29fce5[_0x014a('0x30')][_0x014a('0x3e')]+'%'};return _0x2e7a14;}})});}_0x434038=_[_0x014a('0x3f')]({},_0x434038,_0x29fce5[_0x014a('0x41')]);var _0x537bde={'where':_0x434038[_0x014a('0x3c')]};return db[_0x014a('0x2a')][_0x014a('0x1a')](_0x537bde)[_0x014a('0x22')](function(_0x5f1a91){_0x15af07[_0x014a('0x1a')]=_0x5f1a91;if(_0x29fce5[_0x014a('0x30')][_0x014a('0x42')]){_0x434038[_0x014a('0x43')]=[{'all':!![]}];}return db[_0x014a('0x2a')][_0x014a('0x44')](_0x434038);})['then'](function(_0x361866){_0x15af07[_0x014a('0x45')]=_0x361866;return _0x15af07;})['then'](respondWithFilteredResult(_0x4ea00c,_0x434038))[_0x014a('0x46')](handleError(_0x4ea00c,null));};exports[_0x014a('0x47')]=function(_0x2c45f1,_0x5dc092){var _0x5bcf8={'raw':!![],'where':{'id':_0x2c45f1['params']['id']}},_0x50a8f0={};_0x50a8f0[_0x014a('0x35')]=_[_0x014a('0x31')](db['ContactItemType'][_0x014a('0x2b')]);_0x50a8f0[_0x014a('0x30')]=_[_0x014a('0x31')](_0x2c45f1[_0x014a('0x30')]);_0x50a8f0[_0x014a('0x32')]=_[_0x014a('0x33')](_0x50a8f0['model'],_0x50a8f0[_0x014a('0x30')]);_0x5bcf8[_0x014a('0x34')]=_[_0x014a('0x33')](_0x50a8f0['model'],qs['fields'](_0x2c45f1[_0x014a('0x30')]['fields']));_0x5bcf8['attributes']=_0x5bcf8[_0x014a('0x34')]['length']?_0x5bcf8[_0x014a('0x34')]:_0x50a8f0[_0x014a('0x35')];if(_0x2c45f1[_0x014a('0x30')]['includeAll']){_0x5bcf8[_0x014a('0x43')]=[{'all':!![]}];}_0x5bcf8=_[_0x014a('0x3f')]({},_0x5bcf8,_0x2c45f1[_0x014a('0x41')]);return db[_0x014a('0x2a')][_0x014a('0x48')](_0x5bcf8)[_0x014a('0x22')](handleEntityNotFound(_0x5dc092,null))['then'](respondWithResult(_0x5dc092,null))[_0x014a('0x46')](handleError(_0x5dc092,null));};exports[_0x014a('0x49')]=function(_0x5a861c,_0x1a4df9){return db[_0x014a('0x2a')][_0x014a('0x49')](_0x5a861c[_0x014a('0x4a')],{})[_0x014a('0x22')](function(_0x357ca1){var _0x437f23=_0x5a861c[_0x014a('0x4b')]['get']({'plain':!![]});if(!_0x437f23)throw new Error(_0x014a('0x4c'));if(_0x437f23[_0x014a('0x4d')]===_0x014a('0x4b')){var _0x135e7e=_0x357ca1[_0x014a('0x23')]({'plain':!![]});var _0x4b2fdb=_0x014a('0x4e');return db['UserProfileSection'][_0x014a('0x48')]({'where':{'name':_0x4b2fdb,'userProfileId':_0x437f23[_0x014a('0x4f')]},'raw':!![]})[_0x014a('0x22')](function(_0x479dc0){if(_0x479dc0&&_0x479dc0[_0x014a('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x135e7e['name'],'resourceId':_0x135e7e['id'],'type':_0x479dc0['name'],'sectionId':_0x479dc0['id']},{})[_0x014a('0x22')](function(){return _0x357ca1;});}else{return _0x357ca1;}})['catch'](function(_0x1fe253){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1fe253);throw _0x1fe253;});}return _0x357ca1;})[_0x014a('0x22')](respondWithResult(_0x1a4df9,0xc9))['catch'](handleError(_0x1a4df9,null));};exports[_0x014a('0x20')]=function(_0x1e778d,_0x400633){if(_0x1e778d[_0x014a('0x4a')]['id']){delete _0x1e778d[_0x014a('0x4a')]['id'];}return db[_0x014a('0x2a')][_0x014a('0x48')]({'where':{'id':_0x1e778d[_0x014a('0x51')]['id']}})[_0x014a('0x22')](handleEntityNotFound(_0x400633,null))[_0x014a('0x22')](saveUpdates(_0x1e778d['body'],null))['then'](respondWithResult(_0x400633,null))[_0x014a('0x46')](handleError(_0x400633,null));};exports[_0x014a('0x21')]=function(_0x237345,_0x4cc246){return db['ContactItemType'][_0x014a('0x48')]({'where':{'id':_0x237345['params']['id']}})[_0x014a('0x22')](handleEntityNotFound(_0x4cc246,null))[_0x014a('0x22')](db[_0x014a('0x52')][_0x014a('0x20')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x237345['params']['id']}}))[_0x014a('0x22')](removeEntity(_0x4cc246,null))[_0x014a('0x46')](handleError(_0x4cc246,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 6474173..6137662 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x180d=['define','ContactItemType','tools_contact_item_types','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes'];(function(_0x111073,_0x39cae3){var _0x12e5fd=function(_0x5ca26d){while(--_0x5ca26d){_0x111073['push'](_0x111073['shift']());}};_0x12e5fd(++_0x39cae3);}(_0x180d,0xdb));var _0xd180=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x180d[_0x1d24eb];return _0x1dc576;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd180('0x0'))(_0xd180('0x1'));var moment=require(_0xd180('0x2'));var BPromise=require(_0xd180('0x3'));var rp=require(_0xd180('0x4'));var fs=require('fs');var path=require(_0xd180('0x5'));var rimraf=require(_0xd180('0x6'));var config=require(_0xd180('0x7'));var attributes=require(_0xd180('0x8'));module['exports']=function(_0x4efafd,_0xc58974){return _0x4efafd[_0xd180('0x9')](_0xd180('0xa'),attributes,{'tableName':_0xd180('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe611=['./contactItemType.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x19ab6a,_0x11383d){var _0x3d5fdf=function(_0x4e64e8){while(--_0x4e64e8){_0x19ab6a['push'](_0x19ab6a['shift']());}};_0x3d5fdf(++_0x11383d);}(_0xe611,0x153));var _0x1e61=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xe611[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x1e61('0x0'));var util=require(_0x1e61('0x1'));var logger=require(_0x1e61('0x2'))(_0x1e61('0x3'));var moment=require(_0x1e61('0x4'));var BPromise=require(_0x1e61('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e61('0x6'));var rimraf=require(_0x1e61('0x7'));var config=require(_0x1e61('0x8'));var attributes=require(_0x1e61('0x9'));module[_0x1e61('0xa')]=function(_0x27959e,_0x25ad42){return _0x27959e[_0x1e61('0xb')]('ContactItemType',attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index f66f796..bc48855 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0a6b=['http','then','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x157784,_0x3be5bb){var _0x43909c=function(_0x4b02cd){while(--_0x4b02cd){_0x157784['push'](_0x157784['shift']());}};_0x43909c(++_0x3be5bb);}(_0x0a6b,0x120));var _0xb0a6=function(_0x3d44e9,_0x2e8d17){_0x3d44e9=_0x3d44e9-0x0;var _0x40f2cf=_0x0a6b[_0x3d44e9];return _0x40f2cf;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var moment=require(_0xb0a6('0x1'));var BPromise=require(_0xb0a6('0x2'));var rs=require(_0xb0a6('0x3'));var fs=require('fs');var Redis=require(_0xb0a6('0x4'));var db=require(_0xb0a6('0x5'))['db'];var utils=require(_0xb0a6('0x6'));var logger=require(_0xb0a6('0x7'))(_0xb0a6('0x8'));var config=require(_0xb0a6('0x9'));var jayson=require(_0xb0a6('0xa'));var client=jayson['client'][_0xb0a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x504a45,_0x23e004,_0x490cfc){return new BPromise(function(_0x597b68,_0xdaa894){return client['request'](_0x504a45,_0x490cfc)[_0xb0a6('0xc')](function(_0x423683){logger['info'](_0xb0a6('0xd'),_0x23e004,_0xb0a6('0xe'));logger['debug'](_0xb0a6('0xf'),_0x23e004,_0xb0a6('0xe'),JSON[_0xb0a6('0x10')](_0x423683));if(_0x423683[_0xb0a6('0x11')]){if(_0x423683[_0xb0a6('0x11')][_0xb0a6('0x12')]===0x1f4){logger[_0xb0a6('0x11')](_0xb0a6('0xd'),_0x23e004,_0x423683['error'][_0xb0a6('0x13')]);return _0xdaa894(_0x423683[_0xb0a6('0x11')][_0xb0a6('0x13')]);}logger[_0xb0a6('0x11')](_0xb0a6('0xd'),_0x23e004,_0x423683['error'][_0xb0a6('0x13')]);return _0x597b68(_0x423683[_0xb0a6('0x11')]['message']);}else{logger[_0xb0a6('0x14')]('ContactItemType,\x20%s,\x20%s',_0x23e004,'request\x20sent');_0x597b68(_0x423683[_0xb0a6('0x15')][_0xb0a6('0x13')]);}})[_0xb0a6('0x16')](function(_0x2ef938){logger[_0xb0a6('0x11')](_0xb0a6('0xd'),_0x23e004,_0x2ef938);_0xdaa894(_0x2ef938);});});} \ No newline at end of file +var _0xb770=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','error','ContactItemType,\x20%s,\x20%s','message','info','result','util'];(function(_0x170bba,_0x2be92f){var _0xa7c249=function(_0x2b6505){while(--_0x2b6505){_0x170bba['push'](_0x170bba['shift']());}};_0xa7c249(++_0x2be92f);}(_0xb770,0x1e2));var _0x0b77=function(_0x3824f2,_0x197ec3){_0x3824f2=_0x3824f2-0x0;var _0x99d941=_0xb770[_0x3824f2];return _0x99d941;};'use strict';var _=require('lodash');var util=require(_0x0b77('0x0'));var moment=require(_0x0b77('0x1'));var BPromise=require(_0x0b77('0x2'));var rs=require(_0x0b77('0x3'));var fs=require('fs');var Redis=require(_0x0b77('0x4'));var db=require(_0x0b77('0x5'))['db'];var utils=require(_0x0b77('0x6'));var logger=require(_0x0b77('0x7'))(_0x0b77('0x8'));var config=require(_0x0b77('0x9'));var jayson=require(_0x0b77('0xa'));var client=jayson[_0x0b77('0xb')][_0x0b77('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55e9b6,_0x176698,_0x5bed15){return new BPromise(function(_0x1b802a,_0x32ff80){return client[_0x0b77('0xd')](_0x55e9b6,_0x5bed15)[_0x0b77('0xe')](function(_0x2bcb59){logger['info']('ContactItemType,\x20%s,\x20%s',_0x176698,_0x0b77('0xf'));logger[_0x0b77('0x10')](_0x0b77('0x11'),_0x176698,_0x0b77('0xf'),JSON['stringify'](_0x2bcb59));if(_0x2bcb59['error']){if(_0x2bcb59[_0x0b77('0x12')]['code']===0x1f4){logger[_0x0b77('0x12')](_0x0b77('0x13'),_0x176698,_0x2bcb59[_0x0b77('0x12')][_0x0b77('0x14')]);return _0x32ff80(_0x2bcb59['error'][_0x0b77('0x14')]);}logger[_0x0b77('0x12')](_0x0b77('0x13'),_0x176698,_0x2bcb59[_0x0b77('0x12')]['message']);return _0x1b802a(_0x2bcb59['error']['message']);}else{logger[_0x0b77('0x15')]('ContactItemType,\x20%s,\x20%s',_0x176698,_0x0b77('0xf'));_0x1b802a(_0x2bcb59[_0x0b77('0x16')][_0x0b77('0x14')]);}})['catch'](function(_0x4265e9){logger[_0x0b77('0x12')](_0x0b77('0x13'),_0x176698,_0x4265e9);_0x32ff80(_0x4265e9);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 5fd9d33..552c95c 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x77aa=['index','get','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x77aa,0x126));var _0xa77a=function(_0x5470ef,_0x1c9453){_0x5470ef=_0x5470ef-0x0;var _0x5a0e81=_0x77aa[_0x5470ef];return _0x5a0e81;};'use strict';var multer=require(_0xa77a('0x0'));var util=require(_0xa77a('0x1'));var path=require(_0xa77a('0x2'));var timeout=require(_0xa77a('0x3'));var express=require(_0xa77a('0x4'));var router=express[_0xa77a('0x5')]();var fs_extra=require(_0xa77a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa77a('0x7'));var config=require(_0xa77a('0x8'));var controller=require('./contactItemType.controller');router['get']('/',auth[_0xa77a('0x9')](),controller[_0xa77a('0xa')]);router[_0xa77a('0xb')](_0xa77a('0xc'),auth[_0xa77a('0x9')](),controller[_0xa77a('0xd')]);router[_0xa77a('0xe')]('/',auth['isAuthenticated'](),controller[_0xa77a('0xf')]);router[_0xa77a('0x10')](_0xa77a('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa77a('0x11')](_0xa77a('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xa77a('0x12')]=router; \ No newline at end of file +var _0x4ded=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','show','isAuthenticated','create','put','delete','/:id','destroy','exports','util'];(function(_0xf7e9df,_0x536ce1){var _0x946ab=function(_0x4a70df){while(--_0x4a70df){_0xf7e9df['push'](_0xf7e9df['shift']());}};_0x946ab(++_0x536ce1);}(_0x4ded,0x167));var _0xd4de=function(_0x2d9959,_0x51e526){_0x2d9959=_0x2d9959-0x0;var _0x23c717=_0x4ded[_0x2d9959];return _0x23c717;};'use strict';var multer=require('multer');var util=require(_0xd4de('0x0'));var path=require('path');var timeout=require(_0xd4de('0x1'));var express=require(_0xd4de('0x2'));var router=express[_0xd4de('0x3')]();var fs_extra=require(_0xd4de('0x4'));var auth=require(_0xd4de('0x5'));var interaction=require(_0xd4de('0x6'));var config=require(_0xd4de('0x7'));var controller=require(_0xd4de('0x8'));router[_0xd4de('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd4de('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd4de('0xa')]);router['post']('/',auth[_0xd4de('0xb')](),controller[_0xd4de('0xc')]);router[_0xd4de('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd4de('0xe')](_0xd4de('0xf'),auth[_0xd4de('0xb')](),controller[_0xd4de('0x10')]);module[_0xd4de('0x11')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index fec304a..5e572c0 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 _0x2032=['name','exports','STRING'];(function(_0x1a4227,_0x24a351){var _0x47bf20=function(_0x20df4b){while(--_0x20df4b){_0x1a4227['push'](_0x1a4227['shift']());}};_0x47bf20(++_0x24a351);}(_0x2032,0xd9));var _0x2203=function(_0x293c0b,_0x4a0c11){_0x293c0b=_0x293c0b-0x0;var _0xf6743f=_0x2032[_0x293c0b];return _0xf6743f;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0x57c8f8,_0x23bb28){var _0x3e9cde=function(_0x4bd8ba){while(--_0x4bd8ba){_0x57c8f8['push'](_0x57c8f8['shift']());}};_0x3e9cde(++_0x23bb28);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d3b9d,_0xdd459c){_0x1d3b9d=_0x1d3b9d-0x0;var _0x5caef6=_0xb10b[_0x1d3b9d];return _0x5caef6;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 7a9ed44..f422a9b 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 _0xed6d=['./dashboard.socket','register','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','get','UserProfileResource','end','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Dashboard','findAll','rows','catch','show','params','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','createdAt','updatedAt','omit','error','destroy','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','attrVoiceQueues','attrFontSize','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','total','attrSerie2','attrSerie3','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','findOne','getItems','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x3b62bf,_0x2393a1){var _0x2dbbe3=function(_0x3bd4f1){while(--_0x3bd4f1){_0x3b62bf['push'](_0x3b62bf['shift']());}};_0x2dbbe3(++_0x2393a1);}(_0xed6d,0x1de));var _0xded6=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xed6d[_0x4ff09b];return _0x3f5c2e;};'use strict';var emlformat=require(_0xded6('0x0'));var rimraf=require(_0xded6('0x1'));var zipdir=require(_0xded6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xded6('0x3'));var moment=require('moment');var BPromise=require(_0xded6('0x4'));var Mustache=require('mustache');var util=require(_0xded6('0x5'));var path=require('path');var sox=require(_0xded6('0x6'));var csv=require(_0xded6('0x7'));var ejs=require(_0xded6('0x8'));var fs=require('fs');var fs_extra=require(_0xded6('0x9'));var _=require(_0xded6('0xa'));var squel=require(_0xded6('0xb'));var crypto=require(_0xded6('0xc'));var jsforce=require(_0xded6('0xd'));var deskjs=require(_0xded6('0xe'));var toCsv=require(_0xded6('0x7'));var querystring=require(_0xded6('0xf'));var Papa=require('papaparse');var Redis=require(_0xded6('0x10'));var authService=require(_0xded6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xded6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xded6('0x13'))(_0xded6('0x14'));var utils=require('../../config/utils');var config=require(_0xded6('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xded6('0x16')]=_[_0xded6('0x17')](config[_0xded6('0x16')],{'host':_0xded6('0x18'),'port':0x18eb});var socket=require(_0xded6('0x19'))(new Redis(config[_0xded6('0x16')]));require(_0xded6('0x1a'))[_0xded6('0x1b')](socket);function respondWithStatusCode(_0x1e7148,_0x201266){_0x201266=_0x201266||0xcc;return function(_0x347fc7){if(_0x347fc7){return _0x1e7148[_0xded6('0x1c')](_0x201266);}return _0x1e7148['status'](_0x201266)['end']();};}function respondWithResult(_0x87afa6,_0xa92cd7){_0xa92cd7=_0xa92cd7||0xc8;return function(_0x2c25a8){if(_0x2c25a8){return _0x87afa6[_0xded6('0x1d')](_0xa92cd7)[_0xded6('0x1e')](_0x2c25a8);}};}function respondWithFilteredResult(_0x29867e,_0x349973){return function(_0x3e9947){if(_0x3e9947){var _0x4aaef5=typeof _0x349973['offset']===_0xded6('0x1f')&&typeof _0x349973[_0xded6('0x20')]===_0xded6('0x1f');var _0xb58275=_0x3e9947['count'];var _0x3d5c00=_0x4aaef5?0x0:_0x349973[_0xded6('0x21')];var _0x4a6f9a=_0x4aaef5?_0x3e9947[_0xded6('0x22')]:_0x349973['offset']+_0x349973[_0xded6('0x20')];var _0xa66841;if(_0x4a6f9a>=_0xb58275){_0x4a6f9a=_0xb58275;_0xa66841=0xc8;}else{_0xa66841=0xce;}_0x29867e['status'](_0xa66841);return _0x29867e[_0xded6('0x23')](_0xded6('0x24'),_0x3d5c00+'-'+_0x4a6f9a+'/'+_0xb58275)['json'](_0x3e9947);}return null;};}function patchUpdates(_0x3c2943){return function(_0xc29e61){try{jsonpatch[_0xded6('0x25')](_0xc29e61,_0x3c2943,!![]);}catch(_0x5d9b2d){return BPromise[_0xded6('0x26')](_0x5d9b2d);}return _0xc29e61['save']();};}function saveUpdates(_0x1a1570,_0xd5c8bf){return function(_0x1cbc82){if(_0x1cbc82){return _0x1cbc82[_0xded6('0x27')](_0x1a1570)[_0xded6('0x28')](function(_0xf1b759){return _0xf1b759;});}return null;};}function removeEntity(_0x4eff89,_0x26b494){return function(_0x3fe8d7){if(_0x3fe8d7){return _0x3fe8d7['destroy']()[_0xded6('0x28')](function(){var _0x59f818=_0x3fe8d7[_0xded6('0x29')]({'plain':!![]});var _0x1738ab='CustomDashboards';return db[_0xded6('0x2a')]['destroy']({'where':{'type':_0x1738ab,'resourceId':_0x59f818['id']}})[_0xded6('0x28')](function(){return _0x3fe8d7;});})['then'](function(){_0x4eff89[_0xded6('0x1d')](0xcc)[_0xded6('0x2b')]();});}};}function handleEntityNotFound(_0x353d47,_0xd581de){return function(_0x23869a){if(!_0x23869a){_0x353d47['sendStatus'](0x194);}return _0x23869a;};}function handleError(_0xf4f1d5,_0xdb4b56){_0xdb4b56=_0xdb4b56||0x1f4;return function(_0x329dcc){logger['error'](_0x329dcc['stack']);if(_0x329dcc[_0xded6('0x2c')]){delete _0x329dcc['name'];}_0xf4f1d5[_0xded6('0x1d')](_0xdb4b56)['send'](_0x329dcc);};}exports['index']=function(_0x398e97,_0x5c76d4){var _0x5a66fc={},_0xd8fa04={},_0x37967c={'count':0x0,'rows':[]};var _0xedc061=_[_0xded6('0x2d')](db['Dashboard'][_0xded6('0x2e')],function(_0x597dc7){return{'name':_0x597dc7[_0xded6('0x2f')],'type':_0x597dc7[_0xded6('0x30')]['key']};});_0xd8fa04[_0xded6('0x31')]=_[_0xded6('0x2d')](_0xedc061,_0xded6('0x2c'));_0xd8fa04[_0xded6('0x32')]=_[_0xded6('0x33')](_0x398e97[_0xded6('0x32')]);_0xd8fa04[_0xded6('0x34')]=_[_0xded6('0x35')](_0xd8fa04[_0xded6('0x31')],_0xd8fa04[_0xded6('0x32')]);_0x5a66fc[_0xded6('0x36')]=_[_0xded6('0x35')](_0xd8fa04[_0xded6('0x31')],qs[_0xded6('0x37')](_0x398e97[_0xded6('0x32')][_0xded6('0x37')]));_0x5a66fc[_0xded6('0x36')]=_0x5a66fc['attributes']['length']?_0x5a66fc[_0xded6('0x36')]:_0xd8fa04[_0xded6('0x31')];if(!_0x398e97[_0xded6('0x32')][_0xded6('0x38')](_0xded6('0x39'))){_0x5a66fc[_0xded6('0x20')]=qs[_0xded6('0x20')](_0x398e97[_0xded6('0x32')][_0xded6('0x20')]);_0x5a66fc[_0xded6('0x21')]=qs[_0xded6('0x21')](_0x398e97[_0xded6('0x32')]['offset']);}_0x5a66fc[_0xded6('0x3a')]=qs['sort'](_0x398e97['query'][_0xded6('0x3b')]);_0x5a66fc[_0xded6('0x3c')]=qs[_0xded6('0x34')](_[_0xded6('0x3d')](_0x398e97[_0xded6('0x32')],_0xd8fa04[_0xded6('0x34')]),_0xedc061);if(_0x398e97[_0xded6('0x32')][_0xded6('0x3e')]){_0x5a66fc[_0xded6('0x3c')]=_[_0xded6('0x3f')](_0x5a66fc[_0xded6('0x3c')],{'$or':_['map'](_0xedc061,function(_0x4d96fa){if(_0x4d96fa['type']!==_0xded6('0x40')){var _0xeed879={};_0xeed879[_0x4d96fa[_0xded6('0x2c')]]={'$like':'%'+_0x398e97[_0xded6('0x32')]['filter']+'%'};return _0xeed879;}})});}_0x5a66fc=_[_0xded6('0x3f')]({},_0x5a66fc,_0x398e97[_0xded6('0x41')]);var _0x46d5f6={'where':_0x5a66fc[_0xded6('0x3c')]};return db['Dashboard'][_0xded6('0x22')](_0x46d5f6)['then'](function(_0x67246a){_0x37967c[_0xded6('0x22')]=_0x67246a;if(_0x398e97[_0xded6('0x32')][_0xded6('0x42')]){_0x5a66fc[_0xded6('0x43')]=[{'all':!![]}];}return db[_0xded6('0x44')][_0xded6('0x45')](_0x5a66fc);})[_0xded6('0x28')](function(_0x59551c){_0x37967c[_0xded6('0x46')]=_0x59551c;return _0x37967c;})[_0xded6('0x28')](respondWithFilteredResult(_0x5c76d4,_0x5a66fc))[_0xded6('0x47')](handleError(_0x5c76d4,null));};exports[_0xded6('0x48')]=function(_0xc868ec,_0x3ed69f){var _0x2eaba0={'raw':![],'where':{'id':_0xc868ec[_0xded6('0x49')]['id']}},_0x5344={};_0x5344[_0xded6('0x31')]=_[_0xded6('0x33')](db[_0xded6('0x44')][_0xded6('0x2e')]);_0x5344[_0xded6('0x32')]=_[_0xded6('0x33')](_0xc868ec['query']);_0x5344[_0xded6('0x34')]=_['intersection'](_0x5344['model'],_0x5344['query']);_0x2eaba0['attributes']=_['intersection'](_0x5344[_0xded6('0x31')],qs[_0xded6('0x37')](_0xc868ec[_0xded6('0x32')][_0xded6('0x37')]));_0x2eaba0[_0xded6('0x36')]=_0x2eaba0['attributes']['length']?_0x2eaba0['attributes']:_0x5344[_0xded6('0x31')];if(_0xc868ec[_0xded6('0x32')][_0xded6('0x42')]){_0x2eaba0[_0xded6('0x43')]=[{'all':!![]}];}_0x2eaba0=_['merge']({},_0x2eaba0,_0xc868ec[_0xded6('0x41')]);return db[_0xded6('0x44')]['find'](_0x2eaba0)[_0xded6('0x28')](handleEntityNotFound(_0x3ed69f,null))[_0xded6('0x28')](respondWithResult(_0x3ed69f,null))[_0xded6('0x47')](handleError(_0x3ed69f,null));};exports['create']=function(_0x53ee05,_0x1cab4f){return db['Dashboard']['create'](_0x53ee05[_0xded6('0x4a')],{})[_0xded6('0x28')](function(_0x5dfb45){var _0x100b9c=_0x53ee05[_0xded6('0x4b')][_0xded6('0x29')]({'plain':!![]});if(!_0x100b9c)throw new Error(_0xded6('0x4c'));if(_0x100b9c['role']===_0xded6('0x4b')){var _0x320449=_0x5dfb45[_0xded6('0x29')]({'plain':!![]});var _0x29c4e1=_0xded6('0x4d');return db[_0xded6('0x4e')][_0xded6('0x4f')]({'where':{'name':_0x29c4e1,'userProfileId':_0x100b9c[_0xded6('0x50')]},'raw':!![]})[_0xded6('0x28')](function(_0x493aa1){if(_0x493aa1&&_0x493aa1[_0xded6('0x51')]===0x0){return db[_0xded6('0x2a')][_0xded6('0x52')]({'name':_0x320449[_0xded6('0x2c')],'resourceId':_0x320449['id'],'type':_0x493aa1[_0xded6('0x2c')],'sectionId':_0x493aa1['id']},{})[_0xded6('0x28')](function(){return _0x5dfb45;});}else{return _0x5dfb45;}})[_0xded6('0x47')](function(_0x6d59bf){logger['error'](_0xded6('0x53'),_0x6d59bf);throw _0x6d59bf;});}return _0x5dfb45;})[_0xded6('0x28')](respondWithResult(_0x1cab4f,0xc9))[_0xded6('0x47')](handleError(_0x1cab4f,null));};exports[_0xded6('0x54')]=function(_0x2ad794,_0x75065e){var _0x5cea6d={'where':{'id':_0x2ad794['params']['id']}},_0x1909ee={};_0x1909ee['model']=_[_0xded6('0x33')](db[_0xded6('0x44')]['rawAttributes']);_0x5cea6d[_0xded6('0x36')]=_['intersection'](_0x1909ee[_0xded6('0x31')],qs[_0xded6('0x37')](_0x2ad794['query'][_0xded6('0x37')]));_0x5cea6d[_0xded6('0x36')]=_0x5cea6d[_0xded6('0x36')][_0xded6('0x55')]?_0x5cea6d[_0xded6('0x36')]:_0x1909ee[_0xded6('0x31')];if(_0x2ad794[_0xded6('0x32')][_0xded6('0x42')]){_0x5cea6d['include']=[{'all':!![]}];}_0x5cea6d=_[_0xded6('0x3f')]({},_0x5cea6d,_0x2ad794[_0xded6('0x41')]);return db['Dashboard']['find'](_0x5cea6d)[_0xded6('0x28')](handleEntityNotFound(_0x75065e,null))[_0xded6('0x28')](function(_0x54a3d3){if(_0x54a3d3){var _0x1a7f8b=_0x54a3d3[_0xded6('0x29')]({'plain':!![]});_0x1a7f8b=qs['omit'](_0x1a7f8b,['id',_0xded6('0x56'),_0xded6('0x57')]);_0x2ad794[_0xded6('0x4a')]=_[_0xded6('0x58')](_0x2ad794[_0xded6('0x4a')],['id',_0xded6('0x56'),'updatedAt']);return db[_0xded6('0x44')]['create'](_[_0xded6('0x3f')](_0x1a7f8b,_0x2ad794[_0xded6('0x4a')]),{'include':_0x2ad794[_0xded6('0x32')][_0xded6('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x5a10ee){var _0x1f9a19=_0x2ad794[_0xded6('0x4b')][_0xded6('0x29')]({'plain':!![]});if(!_0x1f9a19)throw new Error(_0xded6('0x4c'));if(_0x1f9a19['role']===_0xded6('0x4b')){var _0x1bdc3c=_0x5a10ee[_0xded6('0x29')]({'plain':!![]});var _0x55c96f=_0xded6('0x4d');return db['UserProfileSection'][_0xded6('0x4f')]({'where':{'name':_0x55c96f,'userProfileId':_0x1f9a19['userProfileId']},'raw':!![]})[_0xded6('0x28')](function(_0x4f3377){if(_0x4f3377&&_0x4f3377['autoAssociation']===0x0){return db[_0xded6('0x2a')][_0xded6('0x52')]({'name':_0x1bdc3c[_0xded6('0x2c')],'resourceId':_0x1bdc3c['id'],'type':_0x4f3377[_0xded6('0x2c')],'sectionId':_0x4f3377['id']},{})[_0xded6('0x28')](function(){return _0x5a10ee;});}else{return _0x5a10ee;}})[_0xded6('0x47')](function(_0x1ef2ed){logger[_0xded6('0x59')](_0xded6('0x53'),_0x1ef2ed);throw _0x1ef2ed;});}return _0x5a10ee;});}})[_0xded6('0x28')](respondWithResult(_0x75065e,0xc9))['catch'](handleError(_0x75065e,null));};exports[_0xded6('0x27')]=function(_0x1b10d8,_0x453318){if(_0x1b10d8['body']['id']){delete _0x1b10d8[_0xded6('0x4a')]['id'];}return db[_0xded6('0x44')][_0xded6('0x4f')]({'where':{'id':_0x1b10d8[_0xded6('0x49')]['id']}})[_0xded6('0x28')](handleEntityNotFound(_0x453318,null))['then'](saveUpdates(_0x1b10d8['body'],null))[_0xded6('0x28')](respondWithResult(_0x453318,null))[_0xded6('0x47')](handleError(_0x453318,null));};exports[_0xded6('0x5a')]=function(_0x5618d5,_0x4a599e){return db[_0xded6('0x44')][_0xded6('0x4f')]({'where':{'id':_0x5618d5[_0xded6('0x49')]['id']}})[_0xded6('0x28')](handleEntityNotFound(_0x4a599e,null))[_0xded6('0x28')](removeEntity(_0x4a599e,null))['catch'](handleError(_0x4a599e,null));};function widgetAttributes(_0x244a84){try{switch(_0x244a84[_0xded6('0x30')]){case _0xded6('0x5b'):return[{'name':_0xded6('0x5c'),'value':_0x244a84[_0xded6('0x5c')]||(_0x244a84['attrs']&&_0x244a84[_0xded6('0x5d')][0x0]?_0x244a84[_0xded6('0x5d')][0x0][_0xded6('0x5e')]:undefined)||'https://'}];case _0xded6('0x5f'):return[{'name':_0xded6('0x60'),'value':_0x244a84[_0xded6('0x60')]||(_0x244a84['attrs']&&_0x244a84['attrs'][0x0]?_0x244a84[_0xded6('0x5d')][0x0][_0xded6('0x5e')]:undefined)||''}];case _0xded6('0x61'):return[{'name':_0xded6('0x62'),'value':_0x244a84['attrHourFormat']||(_0x244a84[_0xded6('0x5d')]&&_0x244a84['attrs'][0x0]?_0x244a84[_0xded6('0x5d')][0x0][_0xded6('0x5e')]:undefined)||_0xded6('0x63')},{'name':_0xded6('0x64'),'value':_0x244a84[_0xded6('0x64')]||(_0x244a84[_0xded6('0x5d')]&&_0x244a84['attrs'][0x1]?_0x244a84[_0xded6('0x5d')][0x1][_0xded6('0x5e')]:undefined)||_0xded6('0x65')},{'name':'attrFontSize','value':_0x244a84['attrFontSize']||(_0x244a84[_0xded6('0x5d')]&&_0x244a84['attrs'][0x2]?_0x244a84[_0xded6('0x5d')][0x2]['value']:undefined)||0xc}];case _0xded6('0x66'):return[{'name':_0xded6('0x67'),'value':_0x244a84[_0xded6('0x67')]||(_0x244a84[_0xded6('0x5d')]&&_0x244a84[_0xded6('0x5d')][0x0]?_0x244a84[_0xded6('0x5d')][0x0][_0xded6('0x5e')]:undefined)||'total'},{'name':_0xded6('0x68'),'value':_0x244a84['attrVoiceQueues']||(_0x244a84['attrs']&&_0x244a84[_0xded6('0x5d')][0x1]?_0x244a84[_0xded6('0x5d')][0x1][_0xded6('0x5e')]:undefined)||[]},{'name':_0xded6('0x69'),'value':_0x244a84['attrFontSize']||(_0x244a84[_0xded6('0x5d')]&&_0x244a84['attrs'][0x2]?_0x244a84[_0xded6('0x5d')][0x2]['value']:undefined)||0x14},{'name':_0xded6('0x6a'),'value':_0x244a84[_0xded6('0x6a')]||(_0x244a84['attrs']&&_0x244a84['attrs'][0x3]?_0x244a84[_0xded6('0x5d')][0x3][_0xded6('0x5e')]:undefined)||_0xded6('0x6b')},{'name':_0xded6('0x6c'),'value':_0x244a84[_0xded6('0x6c')]||(_0x244a84['attrs']&&_0x244a84[_0xded6('0x5d')][0x4]?_0x244a84[_0xded6('0x5d')][0x4]['value']:undefined)||''},{'name':_0xded6('0x6d'),'value':_0x244a84[_0xded6('0x6d')]||(_0x244a84[_0xded6('0x5d')]&&_0x244a84['attrs'][0x5]?_0x244a84[_0xded6('0x5d')][0x5][_0xded6('0x5e')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x244a84[_0xded6('0x6e')]||(_0x244a84[_0xded6('0x5d')]&&_0x244a84[_0xded6('0x5d')][0x6]?_0x244a84[_0xded6('0x5d')][0x6][_0xded6('0x5e')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x244a84[_0xded6('0x6f')]||(_0x244a84[_0xded6('0x5d')]&&_0x244a84[_0xded6('0x5d')][0x7]?_0x244a84[_0xded6('0x5d')][0x7]['value']:undefined)||''},{'name':_0xded6('0x70'),'value':_0x244a84[_0xded6('0x70')]||(_0x244a84['attrs']&&_0x244a84['attrs'][0x8]?_0x244a84[_0xded6('0x5d')][0x8][_0xded6('0x5e')]:undefined)||''},{'name':_0xded6('0x71'),'value':_0x244a84[_0xded6('0x71')]||(_0x244a84[_0xded6('0x5d')]&&_0x244a84[_0xded6('0x5d')][0x9]?_0x244a84[_0xded6('0x5d')][0x9][_0xded6('0x5e')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0xded6('0x72'),'value':_0x244a84[_0xded6('0x72')]||(_0x244a84['attrs']&&_0x244a84[_0xded6('0x5d')][0x0]?_0x244a84[_0xded6('0x5d')][0x0][_0xded6('0x5e')]:undefined)||_0xded6('0x73')},{'name':_0xded6('0x74'),'value':_0x244a84[_0xded6('0x74')]||(_0x244a84[_0xded6('0x5d')]&&_0x244a84[_0xded6('0x5d')][0x1]?_0x244a84[_0xded6('0x5d')][0x1][_0xded6('0x5e')]:undefined)||null},{'name':_0xded6('0x75'),'value':_0x244a84[_0xded6('0x75')]||(_0x244a84[_0xded6('0x5d')]&&_0x244a84[_0xded6('0x5d')][0x2]?_0x244a84[_0xded6('0x5d')][0x2][_0xded6('0x5e')]:undefined)||null},{'name':_0xded6('0x68'),'value':_0x244a84[_0xded6('0x68')]||(_0x244a84[_0xded6('0x5d')]&&_0x244a84[_0xded6('0x5d')][0x3]?_0x244a84[_0xded6('0x5d')][0x3]['value']:undefined)||[]},{'name':_0xded6('0x6a'),'value':_0x244a84[_0xded6('0x6a')]||(_0x244a84['attrs']&&_0x244a84[_0xded6('0x5d')][0x4]?_0x244a84[_0xded6('0x5d')][0x4][_0xded6('0x5e')]:undefined)||_0xded6('0x6b')},{'name':_0xded6('0x6c'),'value':_0x244a84[_0xded6('0x6c')]||(_0x244a84[_0xded6('0x5d')]&&_0x244a84[_0xded6('0x5d')][0x5]?_0x244a84[_0xded6('0x5d')][0x5][_0xded6('0x5e')]:undefined)||''},{'name':_0xded6('0x6d'),'value':_0x244a84[_0xded6('0x6d')]||(_0x244a84[_0xded6('0x5d')]&&_0x244a84['attrs'][0x6]?_0x244a84[_0xded6('0x5d')][0x6][_0xded6('0x5e')]:undefined)||''},{'name':_0xded6('0x6e'),'value':_0x244a84[_0xded6('0x6e')]||(_0x244a84['attrs']&&_0x244a84['attrs'][0x7]?_0x244a84[_0xded6('0x5d')][0x7][_0xded6('0x5e')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x244a84[_0xded6('0x6f')]||(_0x244a84[_0xded6('0x5d')]&&_0x244a84[_0xded6('0x5d')][0x8]?_0x244a84[_0xded6('0x5d')][0x8][_0xded6('0x5e')]:undefined)||''},{'name':_0xded6('0x70'),'value':_0x244a84[_0xded6('0x70')]||(_0x244a84[_0xded6('0x5d')]&&_0x244a84['attrs'][0x9]?_0x244a84[_0xded6('0x5d')][0x9]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x244a84[_0xded6('0x71')]||(_0x244a84['attrs']&&_0x244a84[_0xded6('0x5d')][0xa]?_0x244a84[_0xded6('0x5d')][0xa][_0xded6('0x5e')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x244a84[_0xded6('0x76')]||(_0x244a84[_0xded6('0x5d')]&&_0x244a84[_0xded6('0x5d')][0x0]?_0x244a84[_0xded6('0x5d')][0x0][_0xded6('0x30')]:undefined)||null,'value':_0x244a84['attrReport']||(_0x244a84[_0xded6('0x5d')]&&_0x244a84[_0xded6('0x5d')][0x0]?_0x244a84[_0xded6('0x5d')][0x0][_0xded6('0x5e')]:undefined)||null},{'name':_0xded6('0x77'),'value':_0x244a84['attrRefresh']||(_0x244a84['attrs']&&_0x244a84[_0xded6('0x5d')][0x1]?_0x244a84['attrs'][0x1][_0xded6('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x462a15){logger[_0xded6('0x59')](_0xded6('0x78'),JSON['stringify'](_0x462a15));return[];}}exports[_0xded6('0x79')]=function(_0x5dc134,_0x119d1a,_0x27f009){if(_0x5dc134[_0xded6('0x4a')]['id']){delete _0x5dc134[_0xded6('0x4a')]['id'];}return db[_0xded6('0x44')]['find']({'where':{'id':_0x5dc134['params']['id']}})['then'](handleEntityNotFound(_0x119d1a,null))[_0xded6('0x28')](function(_0x150a63){if(_0x150a63){_0x5dc134[_0xded6('0x4a')][_0xded6('0x7a')]=_0x150a63['id'];_0x5dc134[_0xded6('0x4a')]['attrs']=widgetAttributes(_0x5dc134['body']);return db[_0xded6('0x7b')][_0xded6('0x52')](_0x5dc134[_0xded6('0x4a')]);}})['then'](respondWithResult(_0x119d1a,null))[_0xded6('0x47')](handleError(_0x119d1a,null));};exports['getItems']=function(_0x5e78f7,_0x1ea60f,_0x3ee7e5){var _0x2fc4f7={};var _0x410d02={};var _0x1722b6;var _0xdf249e;return db[_0xded6('0x44')][_0xded6('0x7c')]({'where':{'id':_0x5e78f7[_0xded6('0x49')]['id']}})[_0xded6('0x28')](handleEntityNotFound(_0x1ea60f,null))[_0xded6('0x28')](function(_0x1c5523){if(_0x1c5523){_0x1722b6=_0x1c5523;_0x410d02['model']=_['keys'](db[_0xded6('0x7b')][_0xded6('0x2e')]);_0x410d02[_0xded6('0x32')]=_['keys'](_0x5e78f7[_0xded6('0x32')]);_0x410d02[_0xded6('0x34')]=_[_0xded6('0x35')](_0x410d02['model'],_0x410d02[_0xded6('0x32')]);_0x2fc4f7[_0xded6('0x36')]=_[_0xded6('0x35')](_0x410d02['model'],qs[_0xded6('0x37')](_0x5e78f7[_0xded6('0x32')]['fields']));_0x2fc4f7[_0xded6('0x36')]=_0x2fc4f7[_0xded6('0x36')][_0xded6('0x55')]?_0x2fc4f7[_0xded6('0x36')]:_0x410d02[_0xded6('0x31')];_0x2fc4f7['order']=qs['sort'](_0x5e78f7[_0xded6('0x32')][_0xded6('0x3b')]);_0x2fc4f7[_0xded6('0x3c')]=qs[_0xded6('0x34')](_[_0xded6('0x3d')](_0x5e78f7[_0xded6('0x32')],_0x410d02[_0xded6('0x34')]));if(_0x5e78f7['query']['filter']){_0x2fc4f7[_0xded6('0x3c')]=_[_0xded6('0x3f')](_0x2fc4f7[_0xded6('0x3c')],{'$or':_['map'](_0x2fc4f7[_0xded6('0x36')],function(_0x4a1c90){var _0x2ea61c={};_0x2ea61c[_0x4a1c90]={'$like':'%'+_0x5e78f7[_0xded6('0x32')][_0xded6('0x3e')]+'%'};return _0x2ea61c;})});}_0x2fc4f7=_[_0xded6('0x3f')]({},_0x2fc4f7,_0x5e78f7[_0xded6('0x41')]);return _0x1722b6['getItems'](_0x2fc4f7);}})[_0xded6('0x28')](function(_0x3b1fec){if(_0x3b1fec){_0xdf249e=_0x3b1fec[_0xded6('0x55')];if(!_0x5e78f7[_0xded6('0x32')][_0xded6('0x38')]('nolimit')){_0x2fc4f7[_0xded6('0x20')]=qs[_0xded6('0x20')](_0x5e78f7[_0xded6('0x32')][_0xded6('0x20')]);_0x2fc4f7[_0xded6('0x21')]=qs[_0xded6('0x21')](_0x5e78f7['query'][_0xded6('0x21')]);}return _0x1722b6[_0xded6('0x7d')](_0x2fc4f7);}})['then'](function(_0x42f97b){if(_0x42f97b){return _0x42f97b?{'count':_0xdf249e,'rows':_0x42f97b}:null;}})[_0xded6('0x28')](respondWithResult(_0x1ea60f,null))[_0xded6('0x47')](handleError(_0x1ea60f,null));}; \ No newline at end of file +var _0x75cd=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','type','iframe','attrUrl','value','https://','custom','attrPath','attrs','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','voice','web-report','attrReport','attrRefresh','stringify','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x75cd,0x78));var _0xd75c=function(_0x40d3d2,_0x34a0f7){_0x40d3d2=_0x40d3d2-0x0;var _0x369e8e=_0x75cd[_0x40d3d2];return _0x369e8e;};'use strict';var emlformat=require(_0xd75c('0x0'));var rimraf=require(_0xd75c('0x1'));var zipdir=require(_0xd75c('0x2'));var jsonpatch=require(_0xd75c('0x3'));var rp=require(_0xd75c('0x4'));var moment=require(_0xd75c('0x5'));var BPromise=require(_0xd75c('0x6'));var Mustache=require(_0xd75c('0x7'));var util=require(_0xd75c('0x8'));var path=require(_0xd75c('0x9'));var sox=require(_0xd75c('0xa'));var csv=require(_0xd75c('0xb'));var ejs=require(_0xd75c('0xc'));var fs=require('fs');var fs_extra=require(_0xd75c('0xd'));var _=require(_0xd75c('0xe'));var squel=require(_0xd75c('0xf'));var crypto=require(_0xd75c('0x10'));var jsforce=require(_0xd75c('0x11'));var deskjs=require(_0xd75c('0x12'));var toCsv=require('to-csv');var querystring=require(_0xd75c('0x13'));var Papa=require(_0xd75c('0x14'));var Redis=require(_0xd75c('0x15'));var authService=require('../../components/auth/service');var qs=require(_0xd75c('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd75c('0x17'))(_0xd75c('0x18'));var utils=require('../../config/utils');var config=require(_0xd75c('0x19'));var licenseUtil=require(_0xd75c('0x1a'));var db=require(_0xd75c('0x1b'))['db'];config[_0xd75c('0x1c')]=_['defaults'](config[_0xd75c('0x1c')],{'host':_0xd75c('0x1d'),'port':0x18eb});var socket=require(_0xd75c('0x1e'))(new Redis(config[_0xd75c('0x1c')]));require(_0xd75c('0x1f'))[_0xd75c('0x20')](socket);function respondWithStatusCode(_0x21db96,_0x359d66){_0x359d66=_0x359d66||0xcc;return function(_0x251e6b){if(_0x251e6b){return _0x21db96[_0xd75c('0x21')](_0x359d66);}return _0x21db96[_0xd75c('0x22')](_0x359d66)[_0xd75c('0x23')]();};}function respondWithResult(_0x59fb4b,_0x5d1e86){_0x5d1e86=_0x5d1e86||0xc8;return function(_0x4cd6d4){if(_0x4cd6d4){return _0x59fb4b[_0xd75c('0x22')](_0x5d1e86)[_0xd75c('0x24')](_0x4cd6d4);}};}function respondWithFilteredResult(_0x370eed,_0x1e8631){return function(_0x2ac815){if(_0x2ac815){var _0x296ad8=typeof _0x1e8631[_0xd75c('0x25')]===_0xd75c('0x26')&&typeof _0x1e8631[_0xd75c('0x27')]==='undefined';var _0x1777a0=_0x2ac815[_0xd75c('0x28')];var _0x424553=_0x296ad8?0x0:_0x1e8631[_0xd75c('0x25')];var _0x363297=_0x296ad8?_0x2ac815[_0xd75c('0x28')]:_0x1e8631[_0xd75c('0x25')]+_0x1e8631[_0xd75c('0x27')];var _0x31be4b;if(_0x363297>=_0x1777a0){_0x363297=_0x1777a0;_0x31be4b=0xc8;}else{_0x31be4b=0xce;}_0x370eed[_0xd75c('0x22')](_0x31be4b);return _0x370eed[_0xd75c('0x29')](_0xd75c('0x2a'),_0x424553+'-'+_0x363297+'/'+_0x1777a0)[_0xd75c('0x24')](_0x2ac815);}return null;};}function patchUpdates(_0x26471f){return function(_0x3393d2){try{jsonpatch[_0xd75c('0x2b')](_0x3393d2,_0x26471f,!![]);}catch(_0x3ad245){return BPromise[_0xd75c('0x2c')](_0x3ad245);}return _0x3393d2[_0xd75c('0x2d')]();};}function saveUpdates(_0x42ce2e,_0x504330){return function(_0x1b7185){if(_0x1b7185){return _0x1b7185[_0xd75c('0x2e')](_0x42ce2e)[_0xd75c('0x2f')](function(_0x1f89a2){return _0x1f89a2;});}return null;};}function removeEntity(_0x446132,_0x3a4b1e){return function(_0x1bf39e){if(_0x1bf39e){return _0x1bf39e[_0xd75c('0x30')]()[_0xd75c('0x2f')](function(){var _0x20b91f=_0x1bf39e[_0xd75c('0x31')]({'plain':!![]});var _0x16a803=_0xd75c('0x32');return db[_0xd75c('0x33')]['destroy']({'where':{'type':_0x16a803,'resourceId':_0x20b91f['id']}})[_0xd75c('0x2f')](function(){return _0x1bf39e;});})[_0xd75c('0x2f')](function(){_0x446132[_0xd75c('0x22')](0xcc)[_0xd75c('0x23')]();});}};}function handleEntityNotFound(_0x258045,_0x564a74){return function(_0x1e7d54){if(!_0x1e7d54){_0x258045[_0xd75c('0x21')](0x194);}return _0x1e7d54;};}function handleError(_0xc52303,_0x18e7ff){_0x18e7ff=_0x18e7ff||0x1f4;return function(_0x52eb68){logger[_0xd75c('0x34')](_0x52eb68[_0xd75c('0x35')]);if(_0x52eb68['name']){delete _0x52eb68[_0xd75c('0x36')];}_0xc52303[_0xd75c('0x22')](_0x18e7ff)['send'](_0x52eb68);};}exports[_0xd75c('0x37')]=function(_0x53fbfa,_0x483a77){var _0x48b831={},_0x3ae868={},_0x2dcc29={'count':0x0,'rows':[]};var _0x283593=_[_0xd75c('0x38')](db[_0xd75c('0x39')][_0xd75c('0x3a')],function(_0x48608b){return{'name':_0x48608b[_0xd75c('0x3b')],'type':_0x48608b['type']['key']};});_0x3ae868[_0xd75c('0x3c')]=_[_0xd75c('0x38')](_0x283593,'name');_0x3ae868[_0xd75c('0x3d')]=_[_0xd75c('0x3e')](_0x53fbfa['query']);_0x3ae868[_0xd75c('0x3f')]=_[_0xd75c('0x40')](_0x3ae868[_0xd75c('0x3c')],_0x3ae868[_0xd75c('0x3d')]);_0x48b831[_0xd75c('0x41')]=_[_0xd75c('0x40')](_0x3ae868[_0xd75c('0x3c')],qs['fields'](_0x53fbfa[_0xd75c('0x3d')][_0xd75c('0x42')]));_0x48b831[_0xd75c('0x41')]=_0x48b831['attributes'][_0xd75c('0x43')]?_0x48b831['attributes']:_0x3ae868[_0xd75c('0x3c')];if(!_0x53fbfa[_0xd75c('0x3d')]['hasOwnProperty'](_0xd75c('0x44'))){_0x48b831[_0xd75c('0x27')]=qs[_0xd75c('0x27')](_0x53fbfa[_0xd75c('0x3d')][_0xd75c('0x27')]);_0x48b831[_0xd75c('0x25')]=qs[_0xd75c('0x25')](_0x53fbfa[_0xd75c('0x3d')][_0xd75c('0x25')]);}_0x48b831[_0xd75c('0x45')]=qs[_0xd75c('0x46')](_0x53fbfa[_0xd75c('0x3d')][_0xd75c('0x46')]);_0x48b831[_0xd75c('0x47')]=qs[_0xd75c('0x3f')](_[_0xd75c('0x48')](_0x53fbfa['query'],_0x3ae868[_0xd75c('0x3f')]),_0x283593);if(_0x53fbfa[_0xd75c('0x3d')][_0xd75c('0x49')]){_0x48b831[_0xd75c('0x47')]=_['merge'](_0x48b831[_0xd75c('0x47')],{'$or':_[_0xd75c('0x38')](_0x283593,function(_0x4c154f){if(_0x4c154f['type']!==_0xd75c('0x4a')){var _0x26be79={};_0x26be79[_0x4c154f[_0xd75c('0x36')]]={'$like':'%'+_0x53fbfa[_0xd75c('0x3d')][_0xd75c('0x49')]+'%'};return _0x26be79;}})});}_0x48b831=_[_0xd75c('0x4b')]({},_0x48b831,_0x53fbfa[_0xd75c('0x4c')]);var _0x40b8a1={'where':_0x48b831[_0xd75c('0x47')]};return db[_0xd75c('0x39')][_0xd75c('0x28')](_0x40b8a1)['then'](function(_0x5aa863){_0x2dcc29['count']=_0x5aa863;if(_0x53fbfa[_0xd75c('0x3d')][_0xd75c('0x4d')]){_0x48b831[_0xd75c('0x4e')]=[{'all':!![]}];}return db[_0xd75c('0x39')][_0xd75c('0x4f')](_0x48b831);})[_0xd75c('0x2f')](function(_0x221fc8){_0x2dcc29[_0xd75c('0x50')]=_0x221fc8;return _0x2dcc29;})['then'](respondWithFilteredResult(_0x483a77,_0x48b831))[_0xd75c('0x51')](handleError(_0x483a77,null));};exports[_0xd75c('0x52')]=function(_0x91374d,_0xcb1ca5){var _0x94a021={'raw':![],'where':{'id':_0x91374d[_0xd75c('0x53')]['id']}},_0x5ab5db={};_0x5ab5db[_0xd75c('0x3c')]=_['keys'](db[_0xd75c('0x39')]['rawAttributes']);_0x5ab5db[_0xd75c('0x3d')]=_[_0xd75c('0x3e')](_0x91374d[_0xd75c('0x3d')]);_0x5ab5db['filters']=_[_0xd75c('0x40')](_0x5ab5db['model'],_0x5ab5db[_0xd75c('0x3d')]);_0x94a021['attributes']=_[_0xd75c('0x40')](_0x5ab5db[_0xd75c('0x3c')],qs[_0xd75c('0x42')](_0x91374d['query']['fields']));_0x94a021[_0xd75c('0x41')]=_0x94a021[_0xd75c('0x41')][_0xd75c('0x43')]?_0x94a021[_0xd75c('0x41')]:_0x5ab5db[_0xd75c('0x3c')];if(_0x91374d['query']['includeAll']){_0x94a021[_0xd75c('0x4e')]=[{'all':!![]}];}_0x94a021=_['merge']({},_0x94a021,_0x91374d['options']);return db[_0xd75c('0x39')][_0xd75c('0x54')](_0x94a021)[_0xd75c('0x2f')](handleEntityNotFound(_0xcb1ca5,null))[_0xd75c('0x2f')](respondWithResult(_0xcb1ca5,null))['catch'](handleError(_0xcb1ca5,null));};exports['create']=function(_0x2a3d1a,_0x102724){return db[_0xd75c('0x39')][_0xd75c('0x55')](_0x2a3d1a[_0xd75c('0x56')],{})[_0xd75c('0x2f')](function(_0x38b964){var _0x29e7b0=_0x2a3d1a[_0xd75c('0x57')][_0xd75c('0x31')]({'plain':!![]});if(!_0x29e7b0)throw new Error(_0xd75c('0x58'));if(_0x29e7b0[_0xd75c('0x59')]==='user'){var _0x271318=_0x38b964[_0xd75c('0x31')]({'plain':!![]});var _0x2dc14e='CustomDashboards';return db['UserProfileSection']['find']({'where':{'name':_0x2dc14e,'userProfileId':_0x29e7b0[_0xd75c('0x5a')]},'raw':!![]})[_0xd75c('0x2f')](function(_0x2da900){if(_0x2da900&&_0x2da900[_0xd75c('0x5b')]===0x0){return db[_0xd75c('0x33')]['create']({'name':_0x271318[_0xd75c('0x36')],'resourceId':_0x271318['id'],'type':_0x2da900['name'],'sectionId':_0x2da900['id']},{})['then'](function(){return _0x38b964;});}else{return _0x38b964;}})[_0xd75c('0x51')](function(_0x304a69){logger[_0xd75c('0x34')](_0xd75c('0x5c'),_0x304a69);throw _0x304a69;});}return _0x38b964;})['then'](respondWithResult(_0x102724,0xc9))[_0xd75c('0x51')](handleError(_0x102724,null));};exports[_0xd75c('0x5d')]=function(_0x12ea9c,_0x554380){var _0x3af3c1={'where':{'id':_0x12ea9c['params']['id']}},_0x263951={};_0x263951[_0xd75c('0x3c')]=_[_0xd75c('0x3e')](db[_0xd75c('0x39')][_0xd75c('0x3a')]);_0x3af3c1['attributes']=_[_0xd75c('0x40')](_0x263951[_0xd75c('0x3c')],qs['fields'](_0x12ea9c[_0xd75c('0x3d')][_0xd75c('0x42')]));_0x3af3c1['attributes']=_0x3af3c1[_0xd75c('0x41')][_0xd75c('0x43')]?_0x3af3c1[_0xd75c('0x41')]:_0x263951[_0xd75c('0x3c')];if(_0x12ea9c[_0xd75c('0x3d')]['includeAll']){_0x3af3c1[_0xd75c('0x4e')]=[{'all':!![]}];}_0x3af3c1=_[_0xd75c('0x4b')]({},_0x3af3c1,_0x12ea9c[_0xd75c('0x4c')]);return db[_0xd75c('0x39')][_0xd75c('0x54')](_0x3af3c1)[_0xd75c('0x2f')](handleEntityNotFound(_0x554380,null))[_0xd75c('0x2f')](function(_0x16f165){if(_0x16f165){var _0x2a1427=_0x16f165['get']({'plain':!![]});_0x2a1427=qs[_0xd75c('0x5e')](_0x2a1427,['id',_0xd75c('0x5f'),_0xd75c('0x60')]);_0x12ea9c[_0xd75c('0x56')]=_[_0xd75c('0x5e')](_0x12ea9c[_0xd75c('0x56')],['id',_0xd75c('0x5f'),_0xd75c('0x60')]);return db[_0xd75c('0x39')][_0xd75c('0x55')](_[_0xd75c('0x4b')](_0x2a1427,_0x12ea9c[_0xd75c('0x56')]),{'include':_0x12ea9c['query'][_0xd75c('0x4d')]?[{'all':!![]}]:undefined})[_0xd75c('0x2f')](function(_0x27cc2c){var _0xba8917=_0x12ea9c[_0xd75c('0x57')]['get']({'plain':!![]});if(!_0xba8917)throw new Error(_0xd75c('0x58'));if(_0xba8917[_0xd75c('0x59')]===_0xd75c('0x57')){var _0x55ba31=_0x27cc2c['get']({'plain':!![]});var _0x25ed0e=_0xd75c('0x32');return db[_0xd75c('0x61')][_0xd75c('0x54')]({'where':{'name':_0x25ed0e,'userProfileId':_0xba8917['userProfileId']},'raw':!![]})[_0xd75c('0x2f')](function(_0x20baf9){if(_0x20baf9&&_0x20baf9[_0xd75c('0x5b')]===0x0){return db['UserProfileResource'][_0xd75c('0x55')]({'name':_0x55ba31[_0xd75c('0x36')],'resourceId':_0x55ba31['id'],'type':_0x20baf9[_0xd75c('0x36')],'sectionId':_0x20baf9['id']},{})[_0xd75c('0x2f')](function(){return _0x27cc2c;});}else{return _0x27cc2c;}})[_0xd75c('0x51')](function(_0x3fd774){logger['error'](_0xd75c('0x5c'),_0x3fd774);throw _0x3fd774;});}return _0x27cc2c;});}})[_0xd75c('0x2f')](respondWithResult(_0x554380,0xc9))[_0xd75c('0x51')](handleError(_0x554380,null));};exports['update']=function(_0x291152,_0x282d84){if(_0x291152[_0xd75c('0x56')]['id']){delete _0x291152['body']['id'];}return db[_0xd75c('0x39')]['find']({'where':{'id':_0x291152['params']['id']}})[_0xd75c('0x2f')](handleEntityNotFound(_0x282d84,null))[_0xd75c('0x2f')](saveUpdates(_0x291152[_0xd75c('0x56')],null))[_0xd75c('0x2f')](respondWithResult(_0x282d84,null))[_0xd75c('0x51')](handleError(_0x282d84,null));};exports[_0xd75c('0x30')]=function(_0x590ed0,_0x376b0f){return db['Dashboard'][_0xd75c('0x54')]({'where':{'id':_0x590ed0['params']['id']}})[_0xd75c('0x2f')](handleEntityNotFound(_0x376b0f,null))[_0xd75c('0x2f')](removeEntity(_0x376b0f,null))['catch'](handleError(_0x376b0f,null));};function widgetAttributes(_0x477c7b){try{switch(_0x477c7b[_0xd75c('0x62')]){case _0xd75c('0x63'):return[{'name':_0xd75c('0x64'),'value':_0x477c7b['attrUrl']||(_0x477c7b['attrs']&&_0x477c7b['attrs'][0x0]?_0x477c7b['attrs'][0x0][_0xd75c('0x65')]:undefined)||_0xd75c('0x66')}];case _0xd75c('0x67'):return[{'name':_0xd75c('0x68'),'value':_0x477c7b[_0xd75c('0x68')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b[_0xd75c('0x69')][0x0]?_0x477c7b[_0xd75c('0x69')][0x0]['value']:undefined)||''}];case _0xd75c('0x6a'):return[{'name':_0xd75c('0x6b'),'value':_0x477c7b['attrHourFormat']||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b[_0xd75c('0x69')][0x0]?_0x477c7b[_0xd75c('0x69')][0x0][_0xd75c('0x65')]:undefined)||'HH:mm:ss'},{'name':_0xd75c('0x6c'),'value':_0x477c7b[_0xd75c('0x6c')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b[_0xd75c('0x69')][0x1]?_0x477c7b['attrs'][0x1]['value']:undefined)||_0xd75c('0x6d')},{'name':'attrFontSize','value':_0x477c7b[_0xd75c('0x6e')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b[_0xd75c('0x69')][0x2]?_0x477c7b[_0xd75c('0x69')][0x2][_0xd75c('0x65')]:undefined)||0xc}];case _0xd75c('0x6f'):return[{'name':_0xd75c('0x70'),'value':_0x477c7b[_0xd75c('0x70')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b[_0xd75c('0x69')][0x0]?_0x477c7b[_0xd75c('0x69')][0x0][_0xd75c('0x65')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x477c7b[_0xd75c('0x71')]||(_0x477c7b['attrs']&&_0x477c7b[_0xd75c('0x69')][0x1]?_0x477c7b['attrs'][0x1][_0xd75c('0x65')]:undefined)||[]},{'name':_0xd75c('0x6e'),'value':_0x477c7b[_0xd75c('0x6e')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b[_0xd75c('0x69')][0x2]?_0x477c7b[_0xd75c('0x69')][0x2][_0xd75c('0x65')]:undefined)||0x14},{'name':_0xd75c('0x72'),'value':_0x477c7b['attrChannel']||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b[_0xd75c('0x69')][0x3]?_0x477c7b[_0xd75c('0x69')][0x3][_0xd75c('0x65')]:undefined)||'voice'},{'name':_0xd75c('0x73'),'value':_0x477c7b[_0xd75c('0x73')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b[_0xd75c('0x69')][0x4]?_0x477c7b[_0xd75c('0x69')][0x4]['value']:undefined)||''},{'name':_0xd75c('0x74'),'value':_0x477c7b[_0xd75c('0x74')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b[_0xd75c('0x69')][0x5]?_0x477c7b[_0xd75c('0x69')][0x5]['value']:undefined)||''},{'name':_0xd75c('0x75'),'value':_0x477c7b[_0xd75c('0x75')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b['attrs'][0x6]?_0x477c7b[_0xd75c('0x69')][0x6][_0xd75c('0x65')]:undefined)||''},{'name':_0xd75c('0x76'),'value':_0x477c7b[_0xd75c('0x76')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b[_0xd75c('0x69')][0x7]?_0x477c7b[_0xd75c('0x69')][0x7][_0xd75c('0x65')]:undefined)||''},{'name':_0xd75c('0x77'),'value':_0x477c7b[_0xd75c('0x77')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b['attrs'][0x8]?_0x477c7b[_0xd75c('0x69')][0x8][_0xd75c('0x65')]:undefined)||''},{'name':'attrChatWebsites','value':_0x477c7b[_0xd75c('0x78')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b['attrs'][0x9]?_0x477c7b[_0xd75c('0x69')][0x9][_0xd75c('0x65')]:undefined)||''}];case'multibar-chart':case _0xd75c('0x79'):return[{'name':_0xd75c('0x7a'),'value':_0x477c7b[_0xd75c('0x7a')]||(_0x477c7b['attrs']&&_0x477c7b[_0xd75c('0x69')][0x0]?_0x477c7b['attrs'][0x0][_0xd75c('0x65')]:undefined)||_0xd75c('0x7b')},{'name':'attrSerie2','value':_0x477c7b[_0xd75c('0x7c')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b[_0xd75c('0x69')][0x1]?_0x477c7b[_0xd75c('0x69')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x477c7b[_0xd75c('0x7d')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b[_0xd75c('0x69')][0x2]?_0x477c7b[_0xd75c('0x69')][0x2][_0xd75c('0x65')]:undefined)||null},{'name':_0xd75c('0x71'),'value':_0x477c7b[_0xd75c('0x71')]||(_0x477c7b['attrs']&&_0x477c7b['attrs'][0x3]?_0x477c7b[_0xd75c('0x69')][0x3][_0xd75c('0x65')]:undefined)||[]},{'name':'attrChannel','value':_0x477c7b[_0xd75c('0x72')]||(_0x477c7b['attrs']&&_0x477c7b[_0xd75c('0x69')][0x4]?_0x477c7b[_0xd75c('0x69')][0x4][_0xd75c('0x65')]:undefined)||_0xd75c('0x7e')},{'name':_0xd75c('0x73'),'value':_0x477c7b[_0xd75c('0x73')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b['attrs'][0x5]?_0x477c7b[_0xd75c('0x69')][0x5][_0xd75c('0x65')]:undefined)||''},{'name':_0xd75c('0x74'),'value':_0x477c7b[_0xd75c('0x74')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b['attrs'][0x6]?_0x477c7b[_0xd75c('0x69')][0x6][_0xd75c('0x65')]:undefined)||''},{'name':_0xd75c('0x75'),'value':_0x477c7b[_0xd75c('0x75')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b['attrs'][0x7]?_0x477c7b[_0xd75c('0x69')][0x7]['value']:undefined)||''},{'name':_0xd75c('0x76'),'value':_0x477c7b[_0xd75c('0x76')]||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b[_0xd75c('0x69')][0x8]?_0x477c7b[_0xd75c('0x69')][0x8]['value']:undefined)||''},{'name':_0xd75c('0x77'),'value':_0x477c7b[_0xd75c('0x77')]||(_0x477c7b['attrs']&&_0x477c7b[_0xd75c('0x69')][0x9]?_0x477c7b[_0xd75c('0x69')][0x9]['value']:undefined)||''},{'name':_0xd75c('0x78'),'value':_0x477c7b[_0xd75c('0x78')]||(_0x477c7b['attrs']&&_0x477c7b[_0xd75c('0x69')][0xa]?_0x477c7b[_0xd75c('0x69')][0xa][_0xd75c('0x65')]:undefined)||''}];case _0xd75c('0x7f'):return[{'name':'attrReport','type':_0x477c7b['reportType']||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b[_0xd75c('0x69')][0x0]?_0x477c7b[_0xd75c('0x69')][0x0]['type']:undefined)||null,'value':_0x477c7b[_0xd75c('0x80')]||(_0x477c7b['attrs']&&_0x477c7b[_0xd75c('0x69')][0x0]?_0x477c7b[_0xd75c('0x69')][0x0][_0xd75c('0x65')]:undefined)||null},{'name':_0xd75c('0x81'),'value':_0x477c7b['attrRefresh']||(_0x477c7b[_0xd75c('0x69')]&&_0x477c7b[_0xd75c('0x69')][0x1]?_0x477c7b[_0xd75c('0x69')][0x1][_0xd75c('0x65')]:undefined)||0x0}];default:return[];}}catch(_0x4bb22d){logger[_0xd75c('0x34')]('widgetAttributes:\x20%s',JSON[_0xd75c('0x82')](_0x4bb22d));return[];}}exports['addItem']=function(_0x321224,_0x451f1c,_0x5c2bff){if(_0x321224[_0xd75c('0x56')]['id']){delete _0x321224[_0xd75c('0x56')]['id'];}return db['Dashboard'][_0xd75c('0x54')]({'where':{'id':_0x321224[_0xd75c('0x53')]['id']}})[_0xd75c('0x2f')](handleEntityNotFound(_0x451f1c,null))['then'](function(_0x59a984){if(_0x59a984){_0x321224[_0xd75c('0x56')][_0xd75c('0x83')]=_0x59a984['id'];_0x321224[_0xd75c('0x56')][_0xd75c('0x69')]=widgetAttributes(_0x321224[_0xd75c('0x56')]);return db[_0xd75c('0x84')]['create'](_0x321224['body']);}})['then'](respondWithResult(_0x451f1c,null))[_0xd75c('0x51')](handleError(_0x451f1c,null));};exports[_0xd75c('0x85')]=function(_0x54388c,_0x1c5738,_0x1e2c93){var _0x5c5ecd={};var _0x5018ae={};var _0x247102;var _0x300b0f;return db[_0xd75c('0x39')][_0xd75c('0x86')]({'where':{'id':_0x54388c['params']['id']}})[_0xd75c('0x2f')](handleEntityNotFound(_0x1c5738,null))[_0xd75c('0x2f')](function(_0x5c0c80){if(_0x5c0c80){_0x247102=_0x5c0c80;_0x5018ae[_0xd75c('0x3c')]=_[_0xd75c('0x3e')](db[_0xd75c('0x84')]['rawAttributes']);_0x5018ae[_0xd75c('0x3d')]=_['keys'](_0x54388c[_0xd75c('0x3d')]);_0x5018ae[_0xd75c('0x3f')]=_[_0xd75c('0x40')](_0x5018ae[_0xd75c('0x3c')],_0x5018ae[_0xd75c('0x3d')]);_0x5c5ecd['attributes']=_['intersection'](_0x5018ae[_0xd75c('0x3c')],qs[_0xd75c('0x42')](_0x54388c['query'][_0xd75c('0x42')]));_0x5c5ecd['attributes']=_0x5c5ecd[_0xd75c('0x41')][_0xd75c('0x43')]?_0x5c5ecd[_0xd75c('0x41')]:_0x5018ae[_0xd75c('0x3c')];_0x5c5ecd[_0xd75c('0x45')]=qs['sort'](_0x54388c[_0xd75c('0x3d')][_0xd75c('0x46')]);_0x5c5ecd[_0xd75c('0x47')]=qs[_0xd75c('0x3f')](_[_0xd75c('0x48')](_0x54388c[_0xd75c('0x3d')],_0x5018ae['filters']));if(_0x54388c[_0xd75c('0x3d')][_0xd75c('0x49')]){_0x5c5ecd[_0xd75c('0x47')]=_[_0xd75c('0x4b')](_0x5c5ecd[_0xd75c('0x47')],{'$or':_[_0xd75c('0x38')](_0x5c5ecd[_0xd75c('0x41')],function(_0x579301){var _0x2dde34={};_0x2dde34[_0x579301]={'$like':'%'+_0x54388c[_0xd75c('0x3d')][_0xd75c('0x49')]+'%'};return _0x2dde34;})});}_0x5c5ecd=_[_0xd75c('0x4b')]({},_0x5c5ecd,_0x54388c[_0xd75c('0x4c')]);return _0x247102[_0xd75c('0x85')](_0x5c5ecd);}})['then'](function(_0x45f81e){if(_0x45f81e){_0x300b0f=_0x45f81e[_0xd75c('0x43')];if(!_0x54388c[_0xd75c('0x3d')]['hasOwnProperty']('nolimit')){_0x5c5ecd[_0xd75c('0x27')]=qs[_0xd75c('0x27')](_0x54388c['query']['limit']);_0x5c5ecd[_0xd75c('0x25')]=qs[_0xd75c('0x25')](_0x54388c[_0xd75c('0x3d')]['offset']);}return _0x247102[_0xd75c('0x85')](_0x5c5ecd);}})[_0xd75c('0x2f')](function(_0x46060d){if(_0x46060d){return _0x46060d?{'count':_0x300b0f,'rows':_0x46060d}:null;}})[_0xd75c('0x2f')](respondWithResult(_0x1c5738,null))[_0xd75c('0x51')](handleError(_0x1c5738,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index a3cadb7..fd233fc 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 _0xeadc=['remove','emit','hook','exports','events','../../mysqldb','Dashboard','update'];(function(_0x3a7ac8,_0x1ab67b){var _0x3acf7b=function(_0x32865f){while(--_0x32865f){_0x3a7ac8['push'](_0x3a7ac8['shift']());}};_0x3acf7b(++_0x1ab67b);}(_0xeadc,0x1d4));var _0xcead=function(_0x501667,_0x331fb0){_0x501667=_0x501667-0x0;var _0xa99aab=_0xeadc[_0x501667];return _0xa99aab;};'use strict';var EventEmitter=require(_0xcead('0x0'));var Dashboard=require(_0xcead('0x1'))['db'][_0xcead('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xcead('0x3'),'afterDestroy':_0xcead('0x4')};function emitEvent(_0x10ae26){return function(_0x1d310,_0x30194d,_0x3e44c2){DashboardEvents['emit'](_0x10ae26+':'+_0x1d310['id'],_0x1d310);DashboardEvents[_0xcead('0x5')](_0x10ae26,_0x1d310);_0x3e44c2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xcead('0x6')](e,emitEvent(event));}}module[_0xcead('0x7')]=DashboardEvents; \ No newline at end of file +var _0xc04a=['emit','hasOwnProperty','exports','events','setMaxListeners','update','remove'];(function(_0x19b4be,_0xd53155){var _0x563084=function(_0x39c260){while(--_0x39c260){_0x19b4be['push'](_0x19b4be['shift']());}};_0x563084(++_0xd53155);}(_0xc04a,0x184));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xac04('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xac04('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xac04('0x2'),'afterDestroy':_0xac04('0x3')};function emitEvent(_0x2383ec){return function(_0x18436f,_0x504856,_0x32392e){DashboardEvents[_0xac04('0x4')](_0x2383ec+':'+_0x18436f['id'],_0x18436f);DashboardEvents[_0xac04('0x4')](_0x2383ec,_0x18436f);_0x32392e(null);};}for(var e in events){if(events[_0xac04('0x5')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xac04('0x6')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 001245b..d5b2084 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 _0xbeec=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','dashboards','lodash','util','../../config/logger'];(function(_0x57fcc0,_0x585004){var _0x5270df=function(_0x5f2db0){while(--_0x5f2db0){_0x57fcc0['push'](_0x57fcc0['shift']());}};_0x5270df(++_0x585004);}(_0xbeec,0x135));var _0xcbee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbeec[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xcbee('0x0'));var util=require(_0xcbee('0x1'));var logger=require(_0xcbee('0x2'))(_0xcbee('0x3'));var moment=require(_0xcbee('0x4'));var BPromise=require(_0xcbee('0x5'));var rp=require(_0xcbee('0x6'));var fs=require('fs');var path=require(_0xcbee('0x7'));var rimraf=require(_0xcbee('0x8'));var config=require(_0xcbee('0x9'));var attributes=require(_0xcbee('0xa'));module['exports']=function(_0x505803,_0x5036af){return _0x505803['define']('Dashboard',attributes,{'tableName':_0xcbee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9cee=['dashboards','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','define','Dashboard'];(function(_0x46ddaa,_0xa62155){var _0x525693=function(_0x5c1860){while(--_0x5c1860){_0x46ddaa['push'](_0x46ddaa['shift']());}};_0x525693(++_0xa62155);}(_0x9cee,0x1f0));var _0xe9ce=function(_0x3c2882,_0x5c5ab0){_0x3c2882=_0x3c2882-0x0;var _0x20de69=_0x9cee[_0x3c2882];return _0x20de69;};'use strict';var _=require(_0xe9ce('0x0'));var util=require(_0xe9ce('0x1'));var logger=require(_0xe9ce('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe9ce('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe9ce('0x4'));var rimraf=require(_0xe9ce('0x5'));var config=require(_0xe9ce('0x6'));var attributes=require(_0xe9ce('0x7'));module['exports']=function(_0x4737e7,_0x429d7b){return _0x4737e7[_0xe9ce('0x8')](_0xe9ce('0x9'),attributes,{'tableName':_0xe9ce('0xa'),'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 9694b1f..c4e4d5a 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 _0x3148=['register','request','info','Dashboard,\x20%s,\x20%s','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket'];(function(_0x5b8310,_0x77ea6f){var _0xd3ebc1=function(_0x9dfb29){while(--_0x9dfb29){_0x5b8310['push'](_0x5b8310['shift']());}};_0xd3ebc1(++_0x77ea6f);}(_0x3148,0x1d6));var _0x8314=function(_0x4198d6,_0x332030){_0x4198d6=_0x4198d6-0x0;var _0x145d70=_0x3148[_0x4198d6];return _0x145d70;};'use strict';var _=require(_0x8314('0x0'));var util=require(_0x8314('0x1'));var moment=require(_0x8314('0x2'));var BPromise=require('bluebird');var rs=require(_0x8314('0x3'));var fs=require('fs');var Redis=require(_0x8314('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8314('0x5'));var logger=require(_0x8314('0x6'))(_0x8314('0x7'));var config=require(_0x8314('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8314('0x9')][_0x8314('0xa')]({'port':0x232a});config[_0x8314('0xb')]=_[_0x8314('0xc')](config[_0x8314('0xb')],{'host':_0x8314('0xd'),'port':0x18eb});var socket=require(_0x8314('0xe'))(new Redis(config['redis']));require(_0x8314('0xf'))[_0x8314('0x10')](socket);function respondWithRpcPromise(_0x1606dc,_0x433589,_0x352d5d){return new BPromise(function(_0x3996f6,_0x32864c){return client[_0x8314('0x11')](_0x1606dc,_0x352d5d)['then'](function(_0x2d9976){logger[_0x8314('0x12')](_0x8314('0x13'),_0x433589,'request\x20sent');logger['debug'](_0x8314('0x14'),_0x433589,_0x8314('0x15'),JSON[_0x8314('0x16')](_0x2d9976));if(_0x2d9976[_0x8314('0x17')]){if(_0x2d9976['error'][_0x8314('0x18')]===0x1f4){logger[_0x8314('0x17')]('Dashboard,\x20%s,\x20%s',_0x433589,_0x2d9976[_0x8314('0x17')][_0x8314('0x19')]);return _0x32864c(_0x2d9976[_0x8314('0x17')][_0x8314('0x19')]);}logger[_0x8314('0x17')]('Dashboard,\x20%s,\x20%s',_0x433589,_0x2d9976['error']['message']);return _0x3996f6(_0x2d9976[_0x8314('0x17')][_0x8314('0x19')]);}else{logger[_0x8314('0x12')](_0x8314('0x13'),_0x433589,_0x8314('0x15'));_0x3996f6(_0x2d9976['result'][_0x8314('0x19')]);}})[_0x8314('0x1a')](function(_0x4f47cc){logger['error']('Dashboard,\x20%s,\x20%s',_0x433589,_0x4f47cc);_0x32864c(_0x4f47cc);});});} \ No newline at end of file +var _0xd581=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xd581,0xe8));var _0x1d58=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xd581[_0x3070dc];return _0x431489;};'use strict';var _=require(_0x1d58('0x0'));var util=require(_0x1d58('0x1'));var moment=require(_0x1d58('0x2'));var BPromise=require(_0x1d58('0x3'));var rs=require(_0x1d58('0x4'));var fs=require('fs');var Redis=require(_0x1d58('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d58('0x6'));var logger=require(_0x1d58('0x7'))(_0x1d58('0x8'));var config=require('../../config/environment');var jayson=require(_0x1d58('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x1d58('0xa')]=_[_0x1d58('0xb')](config[_0x1d58('0xa')],{'host':_0x1d58('0xc'),'port':0x18eb});var socket=require(_0x1d58('0xd'))(new Redis(config[_0x1d58('0xa')]));require(_0x1d58('0xe'))['register'](socket);function respondWithRpcPromise(_0x3bbab1,_0x167ddb,_0x22da91){return new BPromise(function(_0x157eb0,_0x587051){return client[_0x1d58('0xf')](_0x3bbab1,_0x22da91)['then'](function(_0x2f1809){logger['info'](_0x1d58('0x10'),_0x167ddb,_0x1d58('0x11'));logger[_0x1d58('0x12')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x167ddb,_0x1d58('0x11'),JSON[_0x1d58('0x13')](_0x2f1809));if(_0x2f1809[_0x1d58('0x14')]){if(_0x2f1809['error'][_0x1d58('0x15')]===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x167ddb,_0x2f1809[_0x1d58('0x14')][_0x1d58('0x16')]);return _0x587051(_0x2f1809[_0x1d58('0x14')][_0x1d58('0x16')]);}logger['error'](_0x1d58('0x10'),_0x167ddb,_0x2f1809[_0x1d58('0x14')][_0x1d58('0x16')]);return _0x157eb0(_0x2f1809['error'][_0x1d58('0x16')]);}else{logger[_0x1d58('0x17')]('Dashboard,\x20%s,\x20%s',_0x167ddb,_0x1d58('0x11'));_0x157eb0(_0x2f1809[_0x1d58('0x18')][_0x1d58('0x16')]);}})[_0x1d58('0x19')](function(_0x2edb97){logger[_0x1d58('0x14')]('Dashboard,\x20%s,\x20%s',_0x167ddb,_0x2edb97);_0x587051(_0x2edb97);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 8a62804..57aff6b 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 _0x218f=['save','update','emit','removeListener','length','./dashboard.events'];(function(_0x34722d,_0x5292e8){var _0x5bfc6a=function(_0x31a3b5){while(--_0x31a3b5){_0x34722d['push'](_0x34722d['shift']());}};_0x5bfc6a(++_0x5292e8);}(_0x218f,0x191));var _0xf218=function(_0x43cdb6,_0x200525){_0x43cdb6=_0x43cdb6-0x0;var _0x10429c=_0x218f[_0x43cdb6];return _0x10429c;};'use strict';var DashboardEvents=require(_0xf218('0x0'));var events=[_0xf218('0x1'),'remove',_0xf218('0x2')];function createListener(_0x2ad016,_0xf22061){return function(_0x5f0c72){_0xf22061[_0xf218('0x3')](_0x2ad016,_0x5f0c72);};}function removeListener(_0x3dfe1d,_0x20b76d){return function(){DashboardEvents[_0xf218('0x4')](_0x3dfe1d,_0x20b76d);};}exports['register']=function(_0x3ecf69){for(var _0x4ece1b=0x0,_0x5506bf=events[_0xf218('0x5')];_0x4ece1b<_0x5506bf;_0x4ece1b++){var _0x5b7d32=events[_0x4ece1b];var _0xbef4d8=createListener('dashboard:'+_0x5b7d32,_0x3ecf69);DashboardEvents['on'](_0x5b7d32,_0xbef4d8);}}; \ No newline at end of file +var _0xa5c5=['removeListener','register','length','dashboard:','./dashboard.events','save','update','emit'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa5c5,0x10c));var _0x5a5c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa5c5[_0x19e35c];return _0x3e1fe8;};'use strict';var DashboardEvents=require(_0x5a5c('0x0'));var events=[_0x5a5c('0x1'),'remove',_0x5a5c('0x2')];function createListener(_0x478edc,_0x56b9ff){return function(_0x2e66d8){_0x56b9ff[_0x5a5c('0x3')](_0x478edc,_0x2e66d8);};}function removeListener(_0x3db287,_0xa3aa46){return function(){DashboardEvents[_0x5a5c('0x4')](_0x3db287,_0xa3aa46);};}exports[_0x5a5c('0x5')]=function(_0x534511){for(var _0x259f12=0x0,_0x20ec8a=events[_0x5a5c('0x6')];_0x259f12<_0x20ec8a;_0x259f12++){var _0x5e8da9=events[_0x259f12];var _0x1f261d=createListener(_0x5a5c('0x7')+_0x5e8da9,_0x534511);DashboardEvents['on'](_0x5e8da9,_0x1f261d);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index e592ed4..df8a2e2 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 _0xb090=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated','show','post','create','/:id/clone','clone','/:id/items','update','delete','destroy','exports','path','connect-timeout','Router'];(function(_0x4d6506,_0x196b50){var _0xd25b4b=function(_0x206d94){while(--_0x206d94){_0x4d6506['push'](_0x4d6506['shift']());}};_0xd25b4b(++_0x196b50);}(_0xb090,0x1cb));var _0x0b09=function(_0x5436c0,_0x45beac){_0x5436c0=_0x5436c0-0x0;var _0x51a455=_0xb090[_0x5436c0];return _0x51a455;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0b09('0x0'));var timeout=require(_0x0b09('0x1'));var express=require('express');var router=express[_0x0b09('0x2')]();var fs_extra=require(_0x0b09('0x3'));var auth=require(_0x0b09('0x4'));var interaction=require(_0x0b09('0x5'));var config=require(_0x0b09('0x6'));var controller=require(_0x0b09('0x7'));router[_0x0b09('0x8')]('/',auth['isAuthenticated'](),controller[_0x0b09('0x9')]);router[_0x0b09('0x8')](_0x0b09('0xa'),auth[_0x0b09('0xb')](),controller[_0x0b09('0xc')]);router['get']('/:id/items',auth['isAuthenticated'](),controller['getItems']);router[_0x0b09('0xd')]('/',auth['isAuthenticated'](),controller[_0x0b09('0xe')]);router[_0x0b09('0xd')](_0x0b09('0xf'),auth[_0x0b09('0xb')](),controller[_0x0b09('0x10')]);router[_0x0b09('0xd')](_0x0b09('0x11'),auth[_0x0b09('0xb')](),controller['addItem']);router['put'](_0x0b09('0xa'),auth[_0x0b09('0xb')](),controller[_0x0b09('0x12')]);router[_0x0b09('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x0b09('0x14')]);module[_0x0b09('0x15')]=router; \ No newline at end of file +var _0x153f=['addItem','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','post','clone'];(function(_0x23b85e,_0x39b209){var _0x329756=function(_0x3418e1){while(--_0x3418e1){_0x23b85e['push'](_0x23b85e['shift']());}};_0x329756(++_0x39b209);}(_0x153f,0x17d));var _0xf153=function(_0x204349,_0x28cbde){_0x204349=_0x204349-0x0;var _0x5deea3=_0x153f[_0x204349];return _0x5deea3;};'use strict';var multer=require('multer');var util=require(_0xf153('0x0'));var path=require(_0xf153('0x1'));var timeout=require(_0xf153('0x2'));var express=require(_0xf153('0x3'));var router=express[_0xf153('0x4')]();var fs_extra=require(_0xf153('0x5'));var auth=require(_0xf153('0x6'));var interaction=require(_0xf153('0x7'));var config=require(_0xf153('0x8'));var controller=require(_0xf153('0x9'));router[_0xf153('0xa')]('/',auth[_0xf153('0xb')](),controller[_0xf153('0xc')]);router['get'](_0xf153('0xd'),auth[_0xf153('0xb')](),controller[_0xf153('0xe')]);router['get'](_0xf153('0xf'),auth[_0xf153('0xb')](),controller['getItems']);router[_0xf153('0x10')]('/',auth[_0xf153('0xb')](),controller['create']);router[_0xf153('0x10')]('/:id/clone',auth[_0xf153('0xb')](),controller[_0xf153('0x11')]);router[_0xf153('0x10')]('/:id/items',auth[_0xf153('0xb')](),controller[_0xf153('0x12')]);router['put'](_0xf153('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xf153('0x13')](_0xf153('0xd'),auth[_0xf153('0xb')](),controller['destroy']);module[_0xf153('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 faf3e2e..0628b02 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 _0xbd51=['setDataValue','INTEGER','#ffffff','#2196f3','sequelize','lodash','exports','STRING','attrs','stringify'];(function(_0x45d94b,_0x1e09cc){var _0x48597f=function(_0x64c058){while(--_0x64c058){_0x45d94b['push'](_0x45d94b['shift']());}};_0x48597f(++_0x1e09cc);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3ec8ed,_0x292b75){_0x3ec8ed=_0x3ec8ed-0x0;var _0x54519f=_0xbd51[_0x3ec8ed];return _0x54519f;};'use strict';var Sequelize=require(_0x1bd5('0x0'));var squel=require('squel');var _=require(_0x1bd5('0x1'));module[_0x1bd5('0x2')]={'title':{'type':Sequelize[_0x1bd5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x1bd5('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x1bd5('0x4')));}catch(_0x362b24){return[];}},'set':function(_0x43e6b6){try{this['setDataValue'](_0x1bd5('0x4'),JSON[_0x1bd5('0x5')](_0x43e6b6));}catch(_0x19077c){this[_0x1bd5('0x6')](_0x1bd5('0x4'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x1bd5('0x7')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x1bd5('0x7')]},'col':{'type':Sequelize[_0x1bd5('0x7')]},'background':{'type':Sequelize[_0x1bd5('0x3')],'allowNull':![],'defaultValue':_0x1bd5('0x8'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x1bd5('0x3')],'allowNull':![],'defaultValue':_0x1bd5('0x9'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x1bd5('0x7')],'defaultValue':0xc}}; \ No newline at end of file +var _0xd8fb=['exports','long','parse','attrs','setDataValue','stringify','INTEGER','#ffffff','STRING','sequelize','squel','lodash'];(function(_0x22541c,_0x5e7c24){var _0x2c5667=function(_0x45db16){while(--_0x45db16){_0x22541c['push'](_0x22541c['shift']());}};_0x2c5667(++_0x5e7c24);}(_0xd8fb,0x99));var _0xbd8f=function(_0xa79bad,_0x1ab0b5){_0xa79bad=_0xa79bad-0x0;var _0x4a23db=_0xd8fb[_0xa79bad];return _0x4a23db;};'use strict';var Sequelize=require(_0xbd8f('0x0'));var squel=require(_0xbd8f('0x1'));var _=require(_0xbd8f('0x2'));module[_0xbd8f('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xbd8f('0x4')),'get':function(){try{return JSON[_0xbd8f('0x5')](this['getDataValue'](_0xbd8f('0x6')));}catch(_0x2343bf){return[];}},'set':function(_0x5543b2){try{this[_0xbd8f('0x7')]('attrs',JSON[_0xbd8f('0x8')](_0x5543b2));}catch(_0x578499){this[_0xbd8f('0x7')](_0xbd8f('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xbd8f('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xbd8f('0x9')]},'col':{'type':Sequelize[_0xbd8f('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbd8f('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xbd8f('0xb')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xbd8f('0x9')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 42c748a..ecf7d55 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 _0x11e5=['model','attributes','fields','length','merge','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','body','create','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','params','keys','DashboardItem','rawAttributes','query','filters','intersection'];(function(_0x223bbd,_0x2f8c30){var _0x11e852=function(_0x5c03ab){while(--_0x5c03ab){_0x223bbd['push'](_0x223bbd['shift']());}};_0x11e852(++_0x2f8c30);}(_0x11e5,0x8b));var _0x511e=function(_0x1c9b46,_0x507d41){_0x1c9b46=_0x1c9b46-0x0;var _0x2d199c=_0x11e5[_0x1c9b46];return _0x2d199c;};'use strict';var emlformat=require(_0x511e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x511e('0x1'));var jsonpatch=require(_0x511e('0x2'));var rp=require('request-promise');var moment=require(_0x511e('0x3'));var BPromise=require(_0x511e('0x4'));var Mustache=require(_0x511e('0x5'));var util=require('util');var path=require(_0x511e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x511e('0x7'));var fs=require('fs');var fs_extra=require(_0x511e('0x8'));var _=require(_0x511e('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x511e('0xa'));var deskjs=require(_0x511e('0xb'));var toCsv=require(_0x511e('0xc'));var querystring=require(_0x511e('0xd'));var Papa=require(_0x511e('0xe'));var Redis=require(_0x511e('0xf'));var authService=require(_0x511e('0x10'));var qs=require(_0x511e('0x11'));var as=require(_0x511e('0x12'));var hardwareService=require(_0x511e('0x13'));var logger=require(_0x511e('0x14'))('api');var utils=require(_0x511e('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x511e('0x16'))['db'];config[_0x511e('0x17')]=_[_0x511e('0x18')](config[_0x511e('0x17')],{'host':_0x511e('0x19'),'port':0x18eb});var socket=require(_0x511e('0x1a'))(new Redis(config['redis']));require(_0x511e('0x1b'))[_0x511e('0x1c')](socket);function respondWithStatusCode(_0x4e6507,_0x14b34e){_0x14b34e=_0x14b34e||0xcc;return function(_0x43a329){if(_0x43a329){return _0x4e6507['sendStatus'](_0x14b34e);}return _0x4e6507[_0x511e('0x1d')](_0x14b34e)[_0x511e('0x1e')]();};}function respondWithResult(_0x3b990b,_0x17fd4a){_0x17fd4a=_0x17fd4a||0xc8;return function(_0x5b6cd6){if(_0x5b6cd6){return _0x3b990b[_0x511e('0x1d')](_0x17fd4a)[_0x511e('0x1f')](_0x5b6cd6);}};}function respondWithFilteredResult(_0x2e66b6,_0x577616){return function(_0x26af67){if(_0x26af67){var _0x5bd814=typeof _0x577616[_0x511e('0x20')]==='undefined'&&typeof _0x577616['limit']===_0x511e('0x21');var _0x5c4fb9=_0x26af67[_0x511e('0x22')];var _0x325278=_0x5bd814?0x0:_0x577616[_0x511e('0x20')];var _0x3cbc5a=_0x5bd814?_0x26af67[_0x511e('0x22')]:_0x577616[_0x511e('0x20')]+_0x577616[_0x511e('0x23')];var _0x452f20;if(_0x3cbc5a>=_0x5c4fb9){_0x3cbc5a=_0x5c4fb9;_0x452f20=0xc8;}else{_0x452f20=0xce;}_0x2e66b6['status'](_0x452f20);return _0x2e66b6[_0x511e('0x24')](_0x511e('0x25'),_0x325278+'-'+_0x3cbc5a+'/'+_0x5c4fb9)[_0x511e('0x1f')](_0x26af67);}return null;};}function patchUpdates(_0x1a273b){return function(_0xaea29d){try{jsonpatch[_0x511e('0x26')](_0xaea29d,_0x1a273b,!![]);}catch(_0x886b6){return BPromise[_0x511e('0x27')](_0x886b6);}return _0xaea29d[_0x511e('0x28')]();};}function saveUpdates(_0x26618d,_0x4c35e2){return function(_0x4ad22b){if(_0x4ad22b){return _0x4ad22b[_0x511e('0x29')](_0x26618d)['then'](function(_0x1ff5c4){return _0x1ff5c4;});}return null;};}function removeEntity(_0x53017d,_0x3fbd19){return function(_0x473f30){if(_0x473f30){return _0x473f30[_0x511e('0x2a')]()[_0x511e('0x2b')](function(){_0x53017d[_0x511e('0x1d')](0xcc)[_0x511e('0x1e')]();});}};}function handleEntityNotFound(_0x3c057c,_0x4d89a5){return function(_0x309695){if(!_0x309695){_0x3c057c[_0x511e('0x2c')](0x194);}return _0x309695;};}function handleError(_0x5b72fe,_0x2930b2){_0x2930b2=_0x2930b2||0x1f4;return function(_0x1d754d){logger[_0x511e('0x2d')](_0x1d754d[_0x511e('0x2e')]);if(_0x1d754d[_0x511e('0x2f')]){delete _0x1d754d['name'];}_0x5b72fe[_0x511e('0x1d')](_0x2930b2)['send'](_0x1d754d);};}exports['show']=function(_0x262dde,_0xb1d444){var _0xa3b110={'raw':![],'where':{'id':_0x262dde[_0x511e('0x30')]['id']}},_0x2fb396={};_0x2fb396['model']=_[_0x511e('0x31')](db[_0x511e('0x32')][_0x511e('0x33')]);_0x2fb396[_0x511e('0x34')]=_[_0x511e('0x31')](_0x262dde['query']);_0x2fb396[_0x511e('0x35')]=_[_0x511e('0x36')](_0x2fb396[_0x511e('0x37')],_0x2fb396[_0x511e('0x34')]);_0xa3b110[_0x511e('0x38')]=_[_0x511e('0x36')](_0x2fb396[_0x511e('0x37')],qs[_0x511e('0x39')](_0x262dde['query'][_0x511e('0x39')]));_0xa3b110[_0x511e('0x38')]=_0xa3b110[_0x511e('0x38')][_0x511e('0x3a')]?_0xa3b110['attributes']:_0x2fb396['model'];if(_0x262dde[_0x511e('0x34')]['includeAll']){_0xa3b110['include']=[{'all':!![]}];}_0xa3b110=_[_0x511e('0x3b')]({},_0xa3b110,_0x262dde[_0x511e('0x3c')]);return db[_0x511e('0x32')][_0x511e('0x3d')](_0xa3b110)[_0x511e('0x2b')](handleEntityNotFound(_0xb1d444,null))['then'](respondWithResult(_0xb1d444,null))[_0x511e('0x3e')](handleError(_0xb1d444,null));};exports[_0x511e('0x2a')]=function(_0x26fefa,_0x4a7a6c){return db[_0x511e('0x32')][_0x511e('0x3d')]({'where':{'id':_0x26fefa[_0x511e('0x30')]['id']}})['then'](handleEntityNotFound(_0x4a7a6c,null))[_0x511e('0x2b')](removeEntity(_0x4a7a6c,null))[_0x511e('0x3e')](handleError(_0x4a7a6c,null));};function widgetAttributes(_0x4f124f){try{switch(_0x4f124f[_0x511e('0x3f')]){case _0x511e('0x40'):return[{'name':_0x511e('0x41'),'value':_0x4f124f[_0x511e('0x41')]||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x0]?_0x4f124f[_0x511e('0x42')][0x0][_0x511e('0x43')]:undefined)||_0x511e('0x44')}];case _0x511e('0x45'):return[{'name':_0x511e('0x46'),'value':_0x4f124f['attrPath']||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f['attrs'][0x0]?_0x4f124f['attrs'][0x0][_0x511e('0x43')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x4f124f[_0x511e('0x47')]||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x0]?_0x4f124f[_0x511e('0x42')][0x0][_0x511e('0x43')]:undefined)||_0x511e('0x48')},{'name':_0x511e('0x49'),'value':_0x4f124f[_0x511e('0x49')]||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x1]?_0x4f124f[_0x511e('0x42')][0x1][_0x511e('0x43')]:undefined)||_0x511e('0x4a')},{'name':_0x511e('0x4b'),'value':_0x4f124f['attrFontSize']||(_0x4f124f['attrs']&&_0x4f124f[_0x511e('0x42')][0x2]?_0x4f124f[_0x511e('0x42')][0x2][_0x511e('0x43')]:undefined)||0xc}];case _0x511e('0x4c'):return[{'name':_0x511e('0x4d'),'value':_0x4f124f['attrMetric']||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x0]?_0x4f124f[_0x511e('0x42')][0x0]['value']:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x4f124f[_0x511e('0x4e')]||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x1]?_0x4f124f['attrs'][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x4f124f[_0x511e('0x4b')]||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x2]?_0x4f124f[_0x511e('0x42')][0x2][_0x511e('0x43')]:undefined)||0x14},{'name':_0x511e('0x4f'),'value':_0x4f124f[_0x511e('0x4f')]||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x3]?_0x4f124f[_0x511e('0x42')][0x3][_0x511e('0x43')]:undefined)||_0x511e('0x50')},{'name':_0x511e('0x51'),'value':_0x4f124f[_0x511e('0x51')]||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x4]?_0x4f124f[_0x511e('0x42')][0x4][_0x511e('0x43')]:undefined)||''},{'name':_0x511e('0x52'),'value':_0x4f124f[_0x511e('0x52')]||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x5]?_0x4f124f[_0x511e('0x42')][0x5][_0x511e('0x43')]:undefined)||''},{'name':_0x511e('0x53'),'value':_0x4f124f[_0x511e('0x53')]||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x6]?_0x4f124f[_0x511e('0x42')][0x6][_0x511e('0x43')]:undefined)||''},{'name':_0x511e('0x54'),'value':_0x4f124f['attrOpenchannelAccounts']||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f['attrs'][0x7]?_0x4f124f[_0x511e('0x42')][0x7][_0x511e('0x43')]:undefined)||''},{'name':_0x511e('0x55'),'value':_0x4f124f['attrWhatsappAccounts']||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x8]?_0x4f124f[_0x511e('0x42')][0x8]['value']:undefined)||''},{'name':_0x511e('0x56'),'value':_0x4f124f[_0x511e('0x56')]||(_0x4f124f['attrs']&&_0x4f124f[_0x511e('0x42')][0x9]?_0x4f124f[_0x511e('0x42')][0x9][_0x511e('0x43')]:undefined)||''}];case _0x511e('0x57'):case'pie-chart':return[{'name':_0x511e('0x58'),'value':_0x4f124f['attrSerie1']||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x0]?_0x4f124f[_0x511e('0x42')][0x0]['value']:undefined)||_0x511e('0x59')},{'name':'attrSerie2','value':_0x4f124f[_0x511e('0x5a')]||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x1]?_0x4f124f[_0x511e('0x42')][0x1][_0x511e('0x43')]:undefined)||null},{'name':'attrSerie3','value':_0x4f124f[_0x511e('0x5b')]||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x2]?_0x4f124f[_0x511e('0x42')][0x2][_0x511e('0x43')]:undefined)||null},{'name':_0x511e('0x4e'),'value':_0x4f124f[_0x511e('0x4e')]||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f['attrs'][0x3]?_0x4f124f[_0x511e('0x42')][0x3][_0x511e('0x43')]:undefined)||[]},{'name':'attrChannel','value':_0x4f124f[_0x511e('0x4f')]||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x4]?_0x4f124f[_0x511e('0x42')][0x4][_0x511e('0x43')]:undefined)||_0x511e('0x50')},{'name':'attrEmailAccounts','value':_0x4f124f[_0x511e('0x51')]||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f['attrs'][0x5]?_0x4f124f[_0x511e('0x42')][0x5]['value']:undefined)||''},{'name':_0x511e('0x52'),'value':_0x4f124f[_0x511e('0x52')]||(_0x4f124f['attrs']&&_0x4f124f['attrs'][0x6]?_0x4f124f['attrs'][0x6]['value']:undefined)||''},{'name':_0x511e('0x53'),'value':_0x4f124f['attrSmsAccounts']||(_0x4f124f['attrs']&&_0x4f124f[_0x511e('0x42')][0x7]?_0x4f124f[_0x511e('0x42')][0x7]['value']:undefined)||''},{'name':_0x511e('0x54'),'value':_0x4f124f['attrOpenchannelAccounts']||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f['attrs'][0x8]?_0x4f124f['attrs'][0x8]['value']:undefined)||''},{'name':_0x511e('0x55'),'value':_0x4f124f[_0x511e('0x55')]||(_0x4f124f['attrs']&&_0x4f124f['attrs'][0x9]?_0x4f124f['attrs'][0x9]['value']:undefined)||''},{'name':_0x511e('0x56'),'value':_0x4f124f['attrChatWebsites']||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f['attrs'][0xa]?_0x4f124f[_0x511e('0x42')][0xa][_0x511e('0x43')]:undefined)||''}];case _0x511e('0x5c'):return[{'name':_0x511e('0x5d'),'type':_0x4f124f['reportType']||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x0]?_0x4f124f[_0x511e('0x42')][0x0][_0x511e('0x3f')]:undefined)||null,'value':_0x4f124f[_0x511e('0x5d')]||(_0x4f124f['attrs']&&_0x4f124f['attrs'][0x0]?_0x4f124f[_0x511e('0x42')][0x0][_0x511e('0x43')]:undefined)||null},{'name':_0x511e('0x5e'),'value':_0x4f124f[_0x511e('0x5e')]||(_0x4f124f[_0x511e('0x42')]&&_0x4f124f[_0x511e('0x42')][0x1]?_0x4f124f[_0x511e('0x42')][0x1][_0x511e('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x118582){logger[_0x511e('0x2d')]('widgetAttributes:\x20%s',JSON['stringify'](_0x118582));return[];}}exports['create']=function(_0x86f362,_0x5525ed){if(_0x86f362[_0x511e('0x5f')]){_0x86f362['body'][_0x511e('0x42')]=widgetAttributes(_0x86f362['body']);}return db[_0x511e('0x32')][_0x511e('0x60')](_0x86f362[_0x511e('0x5f')],{})[_0x511e('0x2b')](respondWithResult(_0x5525ed,0xc9))[_0x511e('0x3e')](handleError(_0x5525ed,null));};exports['update']=function(_0x2f3523,_0x5d1433){if(_0x2f3523[_0x511e('0x5f')]['id']){delete _0x2f3523[_0x511e('0x5f')]['id'];}_0x2f3523[_0x511e('0x5f')]['attrs']=widgetAttributes(_0x2f3523[_0x511e('0x5f')]);return db[_0x511e('0x32')][_0x511e('0x3d')]({'where':{'id':_0x2f3523[_0x511e('0x30')]['id']}})['then'](handleEntityNotFound(_0x5d1433,null))['then'](saveUpdates(_0x2f3523[_0x511e('0x5f')],null))[_0x511e('0x2b')](respondWithResult(_0x5d1433,null))['catch'](handleError(_0x5d1433,null));}; \ No newline at end of file +var _0x1134=['value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','show','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','length','include','options','find','catch','iframe','attrUrl','attrs'];(function(_0x4f5257,_0xaa3675){var _0x2bf596=function(_0x95afbf){while(--_0x95afbf){_0x4f5257['push'](_0x4f5257['shift']());}};_0x2bf596(++_0xaa3675);}(_0x1134,0x19c));var _0x4113=function(_0x4e5bb9,_0x5e1cb0){_0x4e5bb9=_0x4e5bb9-0x0;var _0x5d20ef=_0x1134[_0x4e5bb9];return _0x5d20ef;};'use strict';var emlformat=require(_0x4113('0x0'));var rimraf=require(_0x4113('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4113('0x2'));var rp=require(_0x4113('0x3'));var moment=require('moment');var BPromise=require(_0x4113('0x4'));var Mustache=require(_0x4113('0x5'));var util=require('util');var path=require(_0x4113('0x6'));var sox=require('sox');var csv=require(_0x4113('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4113('0x8'));var _=require('lodash');var squel=require(_0x4113('0x9'));var crypto=require(_0x4113('0xa'));var jsforce=require(_0x4113('0xb'));var deskjs=require(_0x4113('0xc'));var toCsv=require(_0x4113('0x7'));var querystring=require(_0x4113('0xd'));var Papa=require(_0x4113('0xe'));var Redis=require(_0x4113('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4113('0x10'));var as=require(_0x4113('0x11'));var hardwareService=require(_0x4113('0x12'));var logger=require(_0x4113('0x13'))(_0x4113('0x14'));var utils=require(_0x4113('0x15'));var config=require(_0x4113('0x16'));var licenseUtil=require(_0x4113('0x17'));var db=require(_0x4113('0x18'))['db'];config[_0x4113('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4113('0x1a'))(new Redis(config[_0x4113('0x19')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x40f01e,_0x5d9801){_0x5d9801=_0x5d9801||0xcc;return function(_0x34123d){if(_0x34123d){return _0x40f01e['sendStatus'](_0x5d9801);}return _0x40f01e['status'](_0x5d9801)[_0x4113('0x1b')]();};}function respondWithResult(_0xe88992,_0x2f8952){_0x2f8952=_0x2f8952||0xc8;return function(_0x3de530){if(_0x3de530){return _0xe88992[_0x4113('0x1c')](_0x2f8952)[_0x4113('0x1d')](_0x3de530);}};}function respondWithFilteredResult(_0x405849,_0xa7f33d){return function(_0x1051d4){if(_0x1051d4){var _0x1cd9ae=typeof _0xa7f33d['offset']===_0x4113('0x1e')&&typeof _0xa7f33d[_0x4113('0x1f')]===_0x4113('0x1e');var _0x1d40ba=_0x1051d4[_0x4113('0x20')];var _0x9608c3=_0x1cd9ae?0x0:_0xa7f33d[_0x4113('0x21')];var _0x4cdffc=_0x1cd9ae?_0x1051d4[_0x4113('0x20')]:_0xa7f33d['offset']+_0xa7f33d[_0x4113('0x1f')];var _0x2776a6;if(_0x4cdffc>=_0x1d40ba){_0x4cdffc=_0x1d40ba;_0x2776a6=0xc8;}else{_0x2776a6=0xce;}_0x405849['status'](_0x2776a6);return _0x405849['set'](_0x4113('0x22'),_0x9608c3+'-'+_0x4cdffc+'/'+_0x1d40ba)['json'](_0x1051d4);}return null;};}function patchUpdates(_0x149d1a){return function(_0x1a9167){try{jsonpatch[_0x4113('0x23')](_0x1a9167,_0x149d1a,!![]);}catch(_0x5a85be){return BPromise[_0x4113('0x24')](_0x5a85be);}return _0x1a9167[_0x4113('0x25')]();};}function saveUpdates(_0x349b33,_0x1f095c){return function(_0x34ee93){if(_0x34ee93){return _0x34ee93[_0x4113('0x26')](_0x349b33)[_0x4113('0x27')](function(_0x1c498a){return _0x1c498a;});}return null;};}function removeEntity(_0x122102,_0xc73743){return function(_0x22f1ce){if(_0x22f1ce){return _0x22f1ce[_0x4113('0x28')]()['then'](function(){_0x122102[_0x4113('0x1c')](0xcc)[_0x4113('0x1b')]();});}};}function handleEntityNotFound(_0x54cf93,_0x34d8b4){return function(_0x98d652){if(!_0x98d652){_0x54cf93[_0x4113('0x29')](0x194);}return _0x98d652;};}function handleError(_0x177a6a,_0x2d9cc6){_0x2d9cc6=_0x2d9cc6||0x1f4;return function(_0x180fed){logger[_0x4113('0x2a')](_0x180fed[_0x4113('0x2b')]);if(_0x180fed[_0x4113('0x2c')]){delete _0x180fed[_0x4113('0x2c')];}_0x177a6a[_0x4113('0x1c')](_0x2d9cc6)[_0x4113('0x2d')](_0x180fed);};}exports[_0x4113('0x2e')]=function(_0x24a487,_0x515526){var _0x1607a6={'raw':![],'where':{'id':_0x24a487['params']['id']}},_0xfeabfd={};_0xfeabfd[_0x4113('0x2f')]=_[_0x4113('0x30')](db[_0x4113('0x31')][_0x4113('0x32')]);_0xfeabfd['query']=_[_0x4113('0x30')](_0x24a487[_0x4113('0x33')]);_0xfeabfd[_0x4113('0x34')]=_[_0x4113('0x35')](_0xfeabfd[_0x4113('0x2f')],_0xfeabfd[_0x4113('0x33')]);_0x1607a6[_0x4113('0x36')]=_[_0x4113('0x35')](_0xfeabfd[_0x4113('0x2f')],qs['fields'](_0x24a487[_0x4113('0x33')]['fields']));_0x1607a6[_0x4113('0x36')]=_0x1607a6[_0x4113('0x36')][_0x4113('0x37')]?_0x1607a6[_0x4113('0x36')]:_0xfeabfd[_0x4113('0x2f')];if(_0x24a487[_0x4113('0x33')]['includeAll']){_0x1607a6[_0x4113('0x38')]=[{'all':!![]}];}_0x1607a6=_['merge']({},_0x1607a6,_0x24a487[_0x4113('0x39')]);return db[_0x4113('0x31')][_0x4113('0x3a')](_0x1607a6)['then'](handleEntityNotFound(_0x515526,null))[_0x4113('0x27')](respondWithResult(_0x515526,null))['catch'](handleError(_0x515526,null));};exports[_0x4113('0x28')]=function(_0x580434,_0x13d161){return db[_0x4113('0x31')]['find']({'where':{'id':_0x580434['params']['id']}})[_0x4113('0x27')](handleEntityNotFound(_0x13d161,null))[_0x4113('0x27')](removeEntity(_0x13d161,null))[_0x4113('0x3b')](handleError(_0x13d161,null));};function widgetAttributes(_0x4b2739){try{switch(_0x4b2739['type']){case _0x4113('0x3c'):return[{'name':_0x4113('0x3d'),'value':_0x4b2739[_0x4113('0x3d')]||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739[_0x4113('0x3e')][0x0]?_0x4b2739['attrs'][0x0][_0x4113('0x3f')]:undefined)||_0x4113('0x40')}];case _0x4113('0x41'):return[{'name':'attrPath','value':_0x4b2739[_0x4113('0x42')]||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739[_0x4113('0x3e')][0x0]?_0x4b2739['attrs'][0x0][_0x4113('0x3f')]:undefined)||''}];case'clock':return[{'name':_0x4113('0x43'),'value':_0x4b2739['attrHourFormat']||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739[_0x4113('0x3e')][0x0]?_0x4b2739[_0x4113('0x3e')][0x0][_0x4113('0x3f')]:undefined)||_0x4113('0x44')},{'name':_0x4113('0x45'),'value':_0x4b2739[_0x4113('0x45')]||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739['attrs'][0x1]?_0x4b2739[_0x4113('0x3e')][0x1][_0x4113('0x3f')]:undefined)||'0.00'},{'name':_0x4113('0x46'),'value':_0x4b2739['attrFontSize']||(_0x4b2739['attrs']&&_0x4b2739[_0x4113('0x3e')][0x2]?_0x4b2739['attrs'][0x2][_0x4113('0x3f')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x4b2739[_0x4113('0x47')]||(_0x4b2739['attrs']&&_0x4b2739[_0x4113('0x3e')][0x0]?_0x4b2739[_0x4113('0x3e')][0x0]['value']:undefined)||'total'},{'name':_0x4113('0x48'),'value':_0x4b2739[_0x4113('0x48')]||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739[_0x4113('0x3e')][0x1]?_0x4b2739['attrs'][0x1][_0x4113('0x3f')]:undefined)||[]},{'name':_0x4113('0x46'),'value':_0x4b2739['attrFontSize']||(_0x4b2739['attrs']&&_0x4b2739[_0x4113('0x3e')][0x2]?_0x4b2739['attrs'][0x2][_0x4113('0x3f')]:undefined)||0x14},{'name':_0x4113('0x49'),'value':_0x4b2739[_0x4113('0x49')]||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739['attrs'][0x3]?_0x4b2739[_0x4113('0x3e')][0x3]['value']:undefined)||'voice'},{'name':_0x4113('0x4a'),'value':_0x4b2739[_0x4113('0x4a')]||(_0x4b2739['attrs']&&_0x4b2739[_0x4113('0x3e')][0x4]?_0x4b2739['attrs'][0x4][_0x4113('0x3f')]:undefined)||''},{'name':_0x4113('0x4b'),'value':_0x4b2739[_0x4113('0x4b')]||(_0x4b2739['attrs']&&_0x4b2739[_0x4113('0x3e')][0x5]?_0x4b2739[_0x4113('0x3e')][0x5][_0x4113('0x3f')]:undefined)||''},{'name':_0x4113('0x4c'),'value':_0x4b2739[_0x4113('0x4c')]||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739[_0x4113('0x3e')][0x6]?_0x4b2739[_0x4113('0x3e')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x4b2739[_0x4113('0x4d')]||(_0x4b2739['attrs']&&_0x4b2739['attrs'][0x7]?_0x4b2739['attrs'][0x7][_0x4113('0x3f')]:undefined)||''},{'name':_0x4113('0x4e'),'value':_0x4b2739[_0x4113('0x4e')]||(_0x4b2739['attrs']&&_0x4b2739[_0x4113('0x3e')][0x8]?_0x4b2739[_0x4113('0x3e')][0x8][_0x4113('0x3f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x4b2739[_0x4113('0x4f')]||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739[_0x4113('0x3e')][0x9]?_0x4b2739[_0x4113('0x3e')][0x9][_0x4113('0x3f')]:undefined)||''}];case'multibar-chart':case _0x4113('0x50'):return[{'name':_0x4113('0x51'),'value':_0x4b2739['attrSerie1']||(_0x4b2739['attrs']&&_0x4b2739['attrs'][0x0]?_0x4b2739['attrs'][0x0]['value']:undefined)||_0x4113('0x52')},{'name':_0x4113('0x53'),'value':_0x4b2739[_0x4113('0x53')]||(_0x4b2739['attrs']&&_0x4b2739['attrs'][0x1]?_0x4b2739['attrs'][0x1]['value']:undefined)||null},{'name':_0x4113('0x54'),'value':_0x4b2739[_0x4113('0x54')]||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739['attrs'][0x2]?_0x4b2739[_0x4113('0x3e')][0x2][_0x4113('0x3f')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x4b2739[_0x4113('0x48')]||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739[_0x4113('0x3e')][0x3]?_0x4b2739['attrs'][0x3][_0x4113('0x3f')]:undefined)||[]},{'name':_0x4113('0x49'),'value':_0x4b2739[_0x4113('0x49')]||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739[_0x4113('0x3e')][0x4]?_0x4b2739[_0x4113('0x3e')][0x4][_0x4113('0x3f')]:undefined)||_0x4113('0x55')},{'name':'attrEmailAccounts','value':_0x4b2739[_0x4113('0x4a')]||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739['attrs'][0x5]?_0x4b2739[_0x4113('0x3e')][0x5]['value']:undefined)||''},{'name':_0x4113('0x4b'),'value':_0x4b2739['attrFaxAccounts']||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739[_0x4113('0x3e')][0x6]?_0x4b2739['attrs'][0x6][_0x4113('0x3f')]:undefined)||''},{'name':_0x4113('0x4c'),'value':_0x4b2739[_0x4113('0x4c')]||(_0x4b2739['attrs']&&_0x4b2739['attrs'][0x7]?_0x4b2739['attrs'][0x7][_0x4113('0x3f')]:undefined)||''},{'name':_0x4113('0x4d'),'value':_0x4b2739[_0x4113('0x4d')]||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739[_0x4113('0x3e')][0x8]?_0x4b2739[_0x4113('0x3e')][0x8]['value']:undefined)||''},{'name':_0x4113('0x4e'),'value':_0x4b2739['attrWhatsappAccounts']||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739[_0x4113('0x3e')][0x9]?_0x4b2739[_0x4113('0x3e')][0x9][_0x4113('0x3f')]:undefined)||''},{'name':_0x4113('0x4f'),'value':_0x4b2739[_0x4113('0x4f')]||(_0x4b2739['attrs']&&_0x4b2739[_0x4113('0x3e')][0xa]?_0x4b2739['attrs'][0xa][_0x4113('0x3f')]:undefined)||''}];case _0x4113('0x56'):return[{'name':_0x4113('0x57'),'type':_0x4b2739[_0x4113('0x58')]||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739['attrs'][0x0]?_0x4b2739[_0x4113('0x3e')][0x0][_0x4113('0x59')]:undefined)||null,'value':_0x4b2739[_0x4113('0x57')]||(_0x4b2739[_0x4113('0x3e')]&&_0x4b2739[_0x4113('0x3e')][0x0]?_0x4b2739['attrs'][0x0][_0x4113('0x3f')]:undefined)||null},{'name':_0x4113('0x5a'),'value':_0x4b2739[_0x4113('0x5a')]||(_0x4b2739['attrs']&&_0x4b2739[_0x4113('0x3e')][0x1]?_0x4b2739['attrs'][0x1][_0x4113('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x41c0d2){logger['error'](_0x4113('0x5b'),JSON[_0x4113('0x5c')](_0x41c0d2));return[];}}exports[_0x4113('0x5d')]=function(_0x370984,_0x573bd5){if(_0x370984[_0x4113('0x5e')]){_0x370984[_0x4113('0x5e')][_0x4113('0x3e')]=widgetAttributes(_0x370984[_0x4113('0x5e')]);}return db[_0x4113('0x31')][_0x4113('0x5d')](_0x370984[_0x4113('0x5e')],{})[_0x4113('0x27')](respondWithResult(_0x573bd5,0xc9))[_0x4113('0x3b')](handleError(_0x573bd5,null));};exports['update']=function(_0x53a52f,_0x58843f){if(_0x53a52f[_0x4113('0x5e')]['id']){delete _0x53a52f[_0x4113('0x5e')]['id'];}_0x53a52f[_0x4113('0x5e')][_0x4113('0x3e')]=widgetAttributes(_0x53a52f[_0x4113('0x5e')]);return db[_0x4113('0x31')]['find']({'where':{'id':_0x53a52f['params']['id']}})[_0x4113('0x27')](handleEntityNotFound(_0x58843f,null))['then'](saveUpdates(_0x53a52f[_0x4113('0x5e')],null))['then'](respondWithResult(_0x58843f,null))['catch'](handleError(_0x58843f,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 8d8e3a4..25bfba4 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 _0xbc11=['events','../../mysqldb','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x2e4b57,_0x428aae){var _0x326652=function(_0x12803f){while(--_0x12803f){_0x2e4b57['push'](_0x2e4b57['shift']());}};_0x326652(++_0x428aae);}(_0xbc11,0xa0));var _0x1bc1=function(_0x490983,_0x562374){_0x490983=_0x490983-0x0;var _0x40ef8a=_0xbc11[_0x490983];return _0x40ef8a;};'use strict';var EventEmitter=require(_0x1bc1('0x0'));var DashboardItem=require(_0x1bc1('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1bc1('0x2'),'afterUpdate':_0x1bc1('0x3'),'afterDestroy':_0x1bc1('0x4')};function emitEvent(_0x3061e0){return function(_0x1e5e93,_0x26a3ba,_0x539566){DashboardItemEvents[_0x1bc1('0x5')](_0x3061e0+':'+_0x1e5e93['id'],_0x1e5e93);DashboardItemEvents[_0x1bc1('0x5')](_0x3061e0,_0x1e5e93);_0x539566(null);};}for(var e in events){if(events[_0x1bc1('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x1bc1('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0x14ec=['remove','emit','hasOwnProperty','hook','exports','events','DashboardItem','setMaxListeners','save','update'];(function(_0x162939,_0x56203f){var _0x5bb0d8=function(_0x17d6d1){while(--_0x17d6d1){_0x162939['push'](_0x162939['shift']());}};_0x5bb0d8(++_0x56203f);}(_0x14ec,0x127));var _0xc14e=function(_0x2d1c98,_0x3a2c95){_0x2d1c98=_0x2d1c98-0x0;var _0x4063ae=_0x14ec[_0x2d1c98];return _0x4063ae;};'use strict';var EventEmitter=require(_0xc14e('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xc14e('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xc14e('0x2')](0x0);var events={'afterCreate':_0xc14e('0x3'),'afterUpdate':_0xc14e('0x4'),'afterDestroy':_0xc14e('0x5')};function emitEvent(_0x2ddcc4){return function(_0x515956,_0x5f2682,_0x582857){DashboardItemEvents['emit'](_0x2ddcc4+':'+_0x515956['id'],_0x515956);DashboardItemEvents[_0xc14e('0x6')](_0x2ddcc4,_0x515956);_0x582857(null);};}for(var e in events){if(events[_0xc14e('0x7')](e)){var event=events[e];DashboardItem[_0xc14e('0x8')](e,emitEvent(event));}}module[_0xc14e('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 3080ac6..a02b12b 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 _0x48e7=['moment','bluebird','request-promise','./dashboardItem.attributes','exports','DashboardItem','dashboard_items','util','../../config/logger','api'];(function(_0x1c5835,_0x20431a){var _0x558ebf=function(_0x2bc9da){while(--_0x2bc9da){_0x1c5835['push'](_0x1c5835['shift']());}};_0x558ebf(++_0x20431a);}(_0x48e7,0x13d));var _0x748e=function(_0x342993,_0x17d720){_0x342993=_0x342993-0x0;var _0x200761=_0x48e7[_0x342993];return _0x200761;};'use strict';var _=require('lodash');var util=require(_0x748e('0x0'));var logger=require(_0x748e('0x1'))(_0x748e('0x2'));var moment=require(_0x748e('0x3'));var BPromise=require(_0x748e('0x4'));var rp=require(_0x748e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x748e('0x6'));module[_0x748e('0x7')]=function(_0x3b4ea9,_0x119f8c){return _0x3b4ea9['define'](_0x748e('0x8'),attributes,{'tableName':_0x748e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48a9=['rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','util','../../config/logger','api','moment','path'];(function(_0x4ffb23,_0x174f2b){var _0x1b9def=function(_0x314599){while(--_0x314599){_0x4ffb23['push'](_0x4ffb23['shift']());}};_0x1b9def(++_0x174f2b);}(_0x48a9,0x8a));var _0x948a=function(_0x51ec61,_0xf9d1e3){_0x51ec61=_0x51ec61-0x0;var _0x223200=_0x48a9[_0x51ec61];return _0x223200;};'use strict';var _=require('lodash');var util=require(_0x948a('0x0'));var logger=require(_0x948a('0x1'))(_0x948a('0x2'));var moment=require(_0x948a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x948a('0x4'));var rimraf=require(_0x948a('0x5'));var config=require(_0x948a('0x6'));var attributes=require(_0x948a('0x7'));module[_0x948a('0x8')]=function(_0x165416,_0x53583c){return _0x165416[_0x948a('0x9')](_0x948a('0xa'),attributes,{'tableName':'dashboard_items','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 e788935..a7832a2 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 _0x40dc=['localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x40dc,0x15a));var _0xc40d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40dc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc40d('0x0'));var moment=require(_0xc40d('0x1'));var BPromise=require(_0xc40d('0x2'));var rs=require(_0xc40d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc40d('0x4'))['db'];var utils=require(_0xc40d('0x5'));var logger=require(_0xc40d('0x6'))(_0xc40d('0x7'));var config=require(_0xc40d('0x8'));var jayson=require(_0xc40d('0x9'));var client=jayson[_0xc40d('0xa')][_0xc40d('0xb')]({'port':0x232a});config[_0xc40d('0xc')]=_[_0xc40d('0xd')](config[_0xc40d('0xc')],{'host':_0xc40d('0xe'),'port':0x18eb});var socket=require(_0xc40d('0xf'))(new Redis(config[_0xc40d('0xc')]));require(_0xc40d('0x10'))[_0xc40d('0x11')](socket);function respondWithRpcPromise(_0x9876ae,_0x1b2932,_0x2c6017){return new BPromise(function(_0x141e03,_0x2162e7){return client[_0xc40d('0x12')](_0x9876ae,_0x2c6017)[_0xc40d('0x13')](function(_0xdd3922){logger['info'](_0xc40d('0x14'),_0x1b2932,_0xc40d('0x15'));logger[_0xc40d('0x16')](_0xc40d('0x17'),_0x1b2932,'request\x20sent',JSON[_0xc40d('0x18')](_0xdd3922));if(_0xdd3922['error']){if(_0xdd3922[_0xc40d('0x19')]['code']===0x1f4){logger[_0xc40d('0x19')]('DashboardItem,\x20%s,\x20%s',_0x1b2932,_0xdd3922[_0xc40d('0x19')][_0xc40d('0x1a')]);return _0x2162e7(_0xdd3922[_0xc40d('0x19')]['message']);}logger[_0xc40d('0x19')]('DashboardItem,\x20%s,\x20%s',_0x1b2932,_0xdd3922[_0xc40d('0x19')][_0xc40d('0x1a')]);return _0x141e03(_0xdd3922[_0xc40d('0x19')][_0xc40d('0x1a')]);}else{logger[_0xc40d('0x1b')](_0xc40d('0x14'),_0x1b2932,_0xc40d('0x15'));_0x141e03(_0xdd3922[_0xc40d('0x1c')]['message']);}})[_0xc40d('0x1d')](function(_0x1dfa43){logger['error']('DashboardItem,\x20%s,\x20%s',_0x1b2932,_0x1dfa43);_0x2162e7(_0x1dfa43);});});} \ No newline at end of file +var _0x9c51=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s'];(function(_0x436d1f,_0x7c4d8b){var _0x2e8011=function(_0x879bbf){while(--_0x879bbf){_0x436d1f['push'](_0x436d1f['shift']());}};_0x2e8011(++_0x7c4d8b);}(_0x9c51,0xbc));var _0x19c5=function(_0xe44a3c,_0x5e86c9){_0xe44a3c=_0xe44a3c-0x0;var _0xafd907=_0x9c51[_0xe44a3c];return _0xafd907;};'use strict';var _=require(_0x19c5('0x0'));var util=require(_0x19c5('0x1'));var moment=require('moment');var BPromise=require(_0x19c5('0x2'));var rs=require(_0x19c5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x19c5('0x4'));var logger=require(_0x19c5('0x5'))(_0x19c5('0x6'));var config=require(_0x19c5('0x7'));var jayson=require(_0x19c5('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x19c5('0x9')]=_[_0x19c5('0xa')](config[_0x19c5('0x9')],{'host':_0x19c5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x19c5('0x9')]));require(_0x19c5('0xc'))['register'](socket);function respondWithRpcPromise(_0x112786,_0x481141,_0x132cbd){return new BPromise(function(_0x12fdc7,_0x7bed38){return client[_0x19c5('0xd')](_0x112786,_0x132cbd)[_0x19c5('0xe')](function(_0x3d6d2c){logger[_0x19c5('0xf')](_0x19c5('0x10'),_0x481141,_0x19c5('0x11'));logger[_0x19c5('0x12')](_0x19c5('0x13'),_0x481141,_0x19c5('0x11'),JSON[_0x19c5('0x14')](_0x3d6d2c));if(_0x3d6d2c[_0x19c5('0x15')]){if(_0x3d6d2c[_0x19c5('0x15')][_0x19c5('0x16')]===0x1f4){logger[_0x19c5('0x15')](_0x19c5('0x10'),_0x481141,_0x3d6d2c[_0x19c5('0x15')][_0x19c5('0x17')]);return _0x7bed38(_0x3d6d2c['error'][_0x19c5('0x17')]);}logger[_0x19c5('0x15')](_0x19c5('0x10'),_0x481141,_0x3d6d2c[_0x19c5('0x15')][_0x19c5('0x17')]);return _0x12fdc7(_0x3d6d2c['error'][_0x19c5('0x17')]);}else{logger[_0x19c5('0xf')](_0x19c5('0x10'),_0x481141,_0x19c5('0x11'));_0x12fdc7(_0x3d6d2c[_0x19c5('0x18')][_0x19c5('0x17')]);}})[_0x19c5('0x19')](function(_0x46ad21){logger[_0x19c5('0x15')]('DashboardItem,\x20%s,\x20%s',_0x481141,_0x46ad21);_0x7bed38(_0x46ad21);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index c248eaa..aef4952 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 _0xe5fa=['emit','register','dashboardItem:','remove','update'];(function(_0x5d1b6d,_0x1d1b02){var _0x3c7d95=function(_0x4627d7){while(--_0x4627d7){_0x5d1b6d['push'](_0x5d1b6d['shift']());}};_0x3c7d95(++_0x1d1b02);}(_0xe5fa,0x17f));var _0xae5f=function(_0x1434bf,_0x1dae5c){_0x1434bf=_0x1434bf-0x0;var _0x23da9c=_0xe5fa[_0x1434bf];return _0x23da9c;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0xae5f('0x0'),_0xae5f('0x1')];function createListener(_0x1511c0,_0x5abd57){return function(_0xd56a61){_0x5abd57[_0xae5f('0x2')](_0x1511c0,_0xd56a61);};}function removeListener(_0x6d8472,_0x2df4d9){return function(){DashboardItemEvents['removeListener'](_0x6d8472,_0x2df4d9);};}exports[_0xae5f('0x3')]=function(_0x38a8a6){for(var _0x367111=0x0,_0x1c4e13=events['length'];_0x367111<_0x1c4e13;_0x367111++){var _0x373deb=events[_0x367111];var _0x36f7ce=createListener(_0xae5f('0x4')+_0x373deb,_0x38a8a6);DashboardItemEvents['on'](_0x373deb,_0x36f7ce);}}; \ No newline at end of file +var _0x5b65=['removeListener','register','length','./dashboardItem.events','remove','emit'];(function(_0x3ba2d8,_0x31a858){var _0x1af3fb=function(_0x424c5f){while(--_0x424c5f){_0x3ba2d8['push'](_0x3ba2d8['shift']());}};_0x1af3fb(++_0x31a858);}(_0x5b65,0x177));var _0x55b6=function(_0x5ee7ee,_0x4c3b18){_0x5ee7ee=_0x5ee7ee-0x0;var _0x578956=_0x5b65[_0x5ee7ee];return _0x578956;};'use strict';var DashboardItemEvents=require(_0x55b6('0x0'));var events=['save',_0x55b6('0x1'),'update'];function createListener(_0x2b2ca9,_0x45f850){return function(_0x6e2c30){_0x45f850[_0x55b6('0x2')](_0x2b2ca9,_0x6e2c30);};}function removeListener(_0x53959a,_0x36e136){return function(){DashboardItemEvents[_0x55b6('0x3')](_0x53959a,_0x36e136);};}exports[_0x55b6('0x4')]=function(_0x378135){for(var _0x104be4=0x0,_0x9def68=events[_0x55b6('0x5')];_0x104be4<_0x9def68;_0x104be4++){var _0x22e47c=events[_0x104be4];var _0x4a0911=createListener('dashboardItem:'+_0x22e47c,_0x378135);DashboardItemEvents['on'](_0x22e47c,_0x4a0911);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index be6ede0..74b5583 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 _0xd08e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','path','connect-timeout'];(function(_0x5acae3,_0x31d121){var _0x9a433d=function(_0x526ace){while(--_0x526ace){_0x5acae3['push'](_0x5acae3['shift']());}};_0x9a433d(++_0x31d121);}(_0xd08e,0x1c6));var _0xed08=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xd08e[_0x4a7631];return _0x1a5a6f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xed08('0x0'));var timeout=require(_0xed08('0x1'));var express=require(_0xed08('0x2'));var router=express[_0xed08('0x3')]();var fs_extra=require(_0xed08('0x4'));var auth=require(_0xed08('0x5'));var interaction=require(_0xed08('0x6'));var config=require(_0xed08('0x7'));var controller=require(_0xed08('0x8'));router[_0xed08('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xed08('0xa')]);router[_0xed08('0xb')]('/',auth[_0xed08('0xc')](),controller[_0xed08('0xd')]);router[_0xed08('0xe')](_0xed08('0xf'),auth['isAuthenticated'](),controller[_0xed08('0x10')]);router[_0xed08('0x11')](_0xed08('0xf'),auth[_0xed08('0xc')](),controller[_0xed08('0x12')]);module['exports']=router; \ No newline at end of file +var _0xfc29=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','/:id','isAuthenticated','post','create','put','update','exports','multer','path'];(function(_0x43a954,_0x1d73d7){var _0x1973f6=function(_0x3de96c){while(--_0x3de96c){_0x43a954['push'](_0x43a954['shift']());}};_0x1973f6(++_0x1d73d7);}(_0xfc29,0x64));var _0x9fc2=function(_0x2e9c98,_0x53310c){_0x2e9c98=_0x2e9c98-0x0;var _0x1be665=_0xfc29[_0x2e9c98];return _0x1be665;};'use strict';var multer=require(_0x9fc2('0x0'));var util=require('util');var path=require(_0x9fc2('0x1'));var timeout=require(_0x9fc2('0x2'));var express=require(_0x9fc2('0x3'));var router=express[_0x9fc2('0x4')]();var fs_extra=require(_0x9fc2('0x5'));var auth=require(_0x9fc2('0x6'));var interaction=require(_0x9fc2('0x7'));var config=require('../../config/environment');var controller=require(_0x9fc2('0x8'));router[_0x9fc2('0x9')](_0x9fc2('0xa'),auth[_0x9fc2('0xb')](),controller['show']);router[_0x9fc2('0xc')]('/',auth[_0x9fc2('0xb')](),controller[_0x9fc2('0xd')]);router[_0x9fc2('0xe')]('/:id',auth[_0x9fc2('0xb')](),controller[_0x9fc2('0xf')]);router['delete'](_0x9fc2('0xa'),auth[_0x9fc2('0xb')](),controller['destroy']);module[_0x9fc2('0x10')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 291c871..03ecab3 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 _0x384b=['second','third','sequelize','STRING','first'];(function(_0x3d3e6e,_0x302dfa){var _0x557cee=function(_0x59507a){while(--_0x59507a){_0x3d3e6e['push'](_0x3d3e6e['shift']());}};_0x557cee(++_0x302dfa);}(_0x384b,0xa2));var _0xb384=function(_0x3148df,_0x5226bb){_0x3148df=_0x3148df-0x0;var _0x10a71f=_0x384b[_0x3148df];return _0x10a71f;};'use strict';var Sequelize=require(_0xb384('0x0'));module['exports']={'name':{'type':Sequelize[_0xb384('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xb384('0x2'),_0xb384('0x3'),_0xb384('0x4')),'allowNull':![],'defaultValue':_0xb384('0x2')},'description':{'type':Sequelize[_0xb384('0x1')]}}; \ No newline at end of file +var _0x29e1=['exports','ENUM','first','second','third'];(function(_0x41dfaf,_0x57cb30){var _0x48e117=function(_0x546459){while(--_0x546459){_0x41dfaf['push'](_0x41dfaf['shift']());}};_0x48e117(++_0x57cb30);}(_0x29e1,0xeb));var _0x129e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x129e('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x129e('0x1')](_0x129e('0x2'),_0x129e('0x3'),_0x129e('0x4')),'allowNull':![],'defaultValue':_0x129e('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index de95333..b735402 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 _0x7163=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Disposition','include','rows','show','params','keys','length','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x412b6d,_0x3383b7){var _0x855f66=function(_0x27d9e8){while(--_0x27d9e8){_0x412b6d['push'](_0x412b6d['shift']());}};_0x855f66(++_0x3383b7);}(_0x7163,0x1ef));var _0x3716=function(_0x523adf,_0x3e1620){_0x523adf=_0x523adf-0x0;var _0x283870=_0x7163[_0x523adf];return _0x283870;};'use strict';var emlformat=require(_0x3716('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3716('0x1'));var rp=require(_0x3716('0x2'));var moment=require(_0x3716('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3716('0x4'));var util=require(_0x3716('0x5'));var path=require(_0x3716('0x6'));var sox=require(_0x3716('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3716('0x8'));var _=require(_0x3716('0x9'));var squel=require(_0x3716('0xa'));var crypto=require(_0x3716('0xb'));var jsforce=require(_0x3716('0xc'));var deskjs=require(_0x3716('0xd'));var toCsv=require(_0x3716('0xe'));var querystring=require(_0x3716('0xf'));var Papa=require(_0x3716('0x10'));var Redis=require(_0x3716('0x11'));var authService=require(_0x3716('0x12'));var qs=require(_0x3716('0x13'));var as=require(_0x3716('0x14'));var hardwareService=require(_0x3716('0x15'));var logger=require(_0x3716('0x16'))(_0x3716('0x17'));var utils=require(_0x3716('0x18'));var config=require(_0x3716('0x19'));var licenseUtil=require(_0x3716('0x1a'));var db=require(_0x3716('0x1b'))['db'];function respondWithStatusCode(_0x2c32cf,_0x2bbb95){_0x2bbb95=_0x2bbb95||0xcc;return function(_0x21925a){if(_0x21925a){return _0x2c32cf[_0x3716('0x1c')](_0x2bbb95);}return _0x2c32cf[_0x3716('0x1d')](_0x2bbb95)[_0x3716('0x1e')]();};}function respondWithResult(_0xc095c4,_0x131c5a){_0x131c5a=_0x131c5a||0xc8;return function(_0x4d1791){if(_0x4d1791){return _0xc095c4['status'](_0x131c5a)['json'](_0x4d1791);}};}function respondWithFilteredResult(_0x493b7d,_0x372785){return function(_0x5bbc0a){if(_0x5bbc0a){var _0x166835=typeof _0x372785[_0x3716('0x1f')]===_0x3716('0x20')&&typeof _0x372785['limit']==='undefined';var _0x5f3833=_0x5bbc0a['count'];var _0x27fa57=_0x166835?0x0:_0x372785[_0x3716('0x1f')];var _0x5d16c4=_0x166835?_0x5bbc0a[_0x3716('0x21')]:_0x372785[_0x3716('0x1f')]+_0x372785[_0x3716('0x22')];var _0xf6c764;if(_0x5d16c4>=_0x5f3833){_0x5d16c4=_0x5f3833;_0xf6c764=0xc8;}else{_0xf6c764=0xce;}_0x493b7d[_0x3716('0x1d')](_0xf6c764);return _0x493b7d[_0x3716('0x23')](_0x3716('0x24'),_0x27fa57+'-'+_0x5d16c4+'/'+_0x5f3833)['json'](_0x5bbc0a);}return null;};}function patchUpdates(_0x4cd0a6){return function(_0x524db1){try{jsonpatch[_0x3716('0x25')](_0x524db1,_0x4cd0a6,!![]);}catch(_0x49a885){return BPromise[_0x3716('0x26')](_0x49a885);}return _0x524db1[_0x3716('0x27')]();};}function saveUpdates(_0x2cccca,_0x233517){return function(_0x2b5296){if(_0x2b5296){return _0x2b5296[_0x3716('0x28')](_0x2cccca)[_0x3716('0x29')](function(_0x12bc19){return _0x12bc19;});}return null;};}function removeEntity(_0x1f18b2,_0x483bdd){return function(_0xec15ce){if(_0xec15ce){return _0xec15ce[_0x3716('0x2a')]()[_0x3716('0x29')](function(){var _0x4a073e=_0xec15ce[_0x3716('0x2b')]({'plain':!![]});var _0x3e7452='Dispositions';return db[_0x3716('0x2c')]['destroy']({'where':{'type':_0x3e7452,'resourceId':_0x4a073e['id']}})[_0x3716('0x29')](function(){return _0xec15ce;});})[_0x3716('0x29')](function(){_0x1f18b2[_0x3716('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x150324,_0x5a4476){return function(_0x430ed4){if(!_0x430ed4){_0x150324[_0x3716('0x1c')](0x194);}return _0x430ed4;};}function handleError(_0x4f0f2b,_0x3aec25){_0x3aec25=_0x3aec25||0x1f4;return function(_0x3dcf6b){logger[_0x3716('0x2d')](_0x3dcf6b[_0x3716('0x2e')]);if(_0x3dcf6b[_0x3716('0x2f')]){delete _0x3dcf6b['name'];}_0x4f0f2b[_0x3716('0x1d')](_0x3aec25)[_0x3716('0x30')](_0x3dcf6b);};}exports[_0x3716('0x31')]=function(_0x16ed51,_0x4fee70){var _0x3e844f={},_0x27553a={},_0x440e7f={'count':0x0,'rows':[]};var _0x3f82c7=_[_0x3716('0x32')](db['Disposition'][_0x3716('0x33')],function(_0x1abb66){return{'name':_0x1abb66[_0x3716('0x34')],'type':_0x1abb66['type']['key']};});_0x27553a[_0x3716('0x35')]=_[_0x3716('0x32')](_0x3f82c7,_0x3716('0x2f'));_0x27553a[_0x3716('0x36')]=_['keys'](_0x16ed51[_0x3716('0x36')]);_0x27553a[_0x3716('0x37')]=_[_0x3716('0x38')](_0x27553a[_0x3716('0x35')],_0x27553a[_0x3716('0x36')]);_0x3e844f[_0x3716('0x39')]=_['intersection'](_0x27553a[_0x3716('0x35')],qs[_0x3716('0x3a')](_0x16ed51[_0x3716('0x36')]['fields']));_0x3e844f['attributes']=_0x3e844f[_0x3716('0x39')]['length']?_0x3e844f[_0x3716('0x39')]:_0x27553a[_0x3716('0x35')];if(!_0x16ed51[_0x3716('0x36')][_0x3716('0x3b')](_0x3716('0x3c'))){_0x3e844f[_0x3716('0x22')]=qs[_0x3716('0x22')](_0x16ed51[_0x3716('0x36')]['limit']);_0x3e844f[_0x3716('0x1f')]=qs[_0x3716('0x1f')](_0x16ed51[_0x3716('0x36')]['offset']);}_0x3e844f[_0x3716('0x3d')]=qs['sort'](_0x16ed51[_0x3716('0x36')][_0x3716('0x3e')]);_0x3e844f[_0x3716('0x3f')]=qs[_0x3716('0x37')](_[_0x3716('0x40')](_0x16ed51[_0x3716('0x36')],_0x27553a[_0x3716('0x37')]),_0x3f82c7);if(_0x16ed51[_0x3716('0x36')][_0x3716('0x41')]){_0x3e844f[_0x3716('0x3f')]=_[_0x3716('0x42')](_0x3e844f['where'],{'$or':_[_0x3716('0x32')](_0x3f82c7,function(_0x18a4b2){if(_0x18a4b2[_0x3716('0x43')]!==_0x3716('0x44')){var _0x57b8b2={};_0x57b8b2[_0x18a4b2[_0x3716('0x2f')]]={'$like':'%'+_0x16ed51[_0x3716('0x36')]['filter']+'%'};return _0x57b8b2;}})});}_0x3e844f=_[_0x3716('0x42')]({},_0x3e844f,_0x16ed51[_0x3716('0x45')]);var _0x56f193={'where':_0x3e844f[_0x3716('0x3f')]};return db[_0x3716('0x46')]['count'](_0x56f193)[_0x3716('0x29')](function(_0xe4b86a){_0x440e7f['count']=_0xe4b86a;if(_0x16ed51[_0x3716('0x36')]['includeAll']){_0x3e844f[_0x3716('0x47')]=[{'all':!![]}];}return db[_0x3716('0x46')]['findAll'](_0x3e844f);})['then'](function(_0x100807){_0x440e7f[_0x3716('0x48')]=_0x100807;return _0x440e7f;})[_0x3716('0x29')](respondWithFilteredResult(_0x4fee70,_0x3e844f))['catch'](handleError(_0x4fee70,null));};exports[_0x3716('0x49')]=function(_0x1517dd,_0x57fddb){var _0x2c5e55={'raw':!![],'where':{'id':_0x1517dd[_0x3716('0x4a')]['id']}},_0x550fda={};_0x550fda[_0x3716('0x35')]=_[_0x3716('0x4b')](db['Disposition']['rawAttributes']);_0x550fda[_0x3716('0x36')]=_[_0x3716('0x4b')](_0x1517dd['query']);_0x550fda[_0x3716('0x37')]=_[_0x3716('0x38')](_0x550fda[_0x3716('0x35')],_0x550fda[_0x3716('0x36')]);_0x2c5e55[_0x3716('0x39')]=_[_0x3716('0x38')](_0x550fda[_0x3716('0x35')],qs['fields'](_0x1517dd[_0x3716('0x36')][_0x3716('0x3a')]));_0x2c5e55[_0x3716('0x39')]=_0x2c5e55[_0x3716('0x39')][_0x3716('0x4c')]?_0x2c5e55[_0x3716('0x39')]:_0x550fda[_0x3716('0x35')];if(_0x1517dd['query']['includeAll']){_0x2c5e55['include']=[{'all':!![]}];}_0x2c5e55=_['merge']({},_0x2c5e55,_0x1517dd[_0x3716('0x45')]);return db[_0x3716('0x46')][_0x3716('0x4d')](_0x2c5e55)[_0x3716('0x29')](handleEntityNotFound(_0x57fddb,null))['then'](respondWithResult(_0x57fddb,null))[_0x3716('0x4e')](handleError(_0x57fddb,null));};exports['create']=function(_0xf06450,_0x524088){return db[_0x3716('0x46')]['create'](_0xf06450[_0x3716('0x4f')],{})[_0x3716('0x29')](function(_0x417ed6){var _0x259b7a=_0xf06450[_0x3716('0x50')][_0x3716('0x2b')]({'plain':!![]});if(!_0x259b7a)throw new Error(_0x3716('0x51'));if(_0x259b7a[_0x3716('0x52')]===_0x3716('0x50')){var _0xca5eca=_0x417ed6[_0x3716('0x2b')]({'plain':!![]});var _0x54b41a='Dispositions';return db[_0x3716('0x53')][_0x3716('0x4d')]({'where':{'name':_0x54b41a,'userProfileId':_0x259b7a['userProfileId']},'raw':!![]})[_0x3716('0x29')](function(_0x42db1a){if(_0x42db1a&&_0x42db1a[_0x3716('0x54')]===0x0){return db[_0x3716('0x2c')][_0x3716('0x55')]({'name':_0xca5eca['name'],'resourceId':_0xca5eca['id'],'type':_0x42db1a[_0x3716('0x2f')],'sectionId':_0x42db1a['id']},{})[_0x3716('0x29')](function(){return _0x417ed6;});}else{return _0x417ed6;}})['catch'](function(_0xa2c92c){logger[_0x3716('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa2c92c);throw _0xa2c92c;});}return _0x417ed6;})[_0x3716('0x29')](respondWithResult(_0x524088,0xc9))[_0x3716('0x4e')](handleError(_0x524088,null));};exports['update']=function(_0x534efd,_0x40698b){if(_0x534efd[_0x3716('0x4f')]['id']){delete _0x534efd[_0x3716('0x4f')]['id'];}return db[_0x3716('0x46')][_0x3716('0x4d')]({'where':{'id':_0x534efd[_0x3716('0x4a')]['id']}})[_0x3716('0x29')](handleEntityNotFound(_0x40698b,null))[_0x3716('0x29')](saveUpdates(_0x534efd[_0x3716('0x4f')],null))['then'](respondWithResult(_0x40698b,null))[_0x3716('0x4e')](handleError(_0x40698b,null));};exports[_0x3716('0x2a')]=function(_0xbcadc4,_0x50ceee){return db[_0x3716('0x46')][_0x3716('0x4d')]({'where':{'id':_0xbcadc4[_0x3716('0x4a')]['id']}})[_0x3716('0x29')](handleEntityNotFound(_0x50ceee,null))[_0x3716('0x29')](removeEntity(_0x50ceee,null))[_0x3716('0x4e')](handleError(_0x50ceee,null));}; \ No newline at end of file +var _0x0736=['pick','filter','merge','where','VIRTUAL','options','Disposition','includeAll','include','rows','show','catch','create','body','user','get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','eml-format','rimraf','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','then','destroy','Dispositions','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x2af8f3,_0x128153){var _0x5a04d8=function(_0x29999e){while(--_0x29999e){_0x2af8f3['push'](_0x2af8f3['shift']());}};_0x5a04d8(++_0x128153);}(_0x0736,0x1c0));var _0x6073=function(_0x5e0dfe,_0x1fb095){_0x5e0dfe=_0x5e0dfe-0x0;var _0x41b5a2=_0x0736[_0x5e0dfe];return _0x41b5a2;};'use strict';var emlformat=require(_0x6073('0x0'));var rimraf=require(_0x6073('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6073('0x2'));var rp=require(_0x6073('0x3'));var moment=require(_0x6073('0x4'));var BPromise=require(_0x6073('0x5'));var Mustache=require(_0x6073('0x6'));var util=require(_0x6073('0x7'));var path=require(_0x6073('0x8'));var sox=require(_0x6073('0x9'));var csv=require(_0x6073('0xa'));var ejs=require(_0x6073('0xb'));var fs=require('fs');var fs_extra=require(_0x6073('0xc'));var _=require(_0x6073('0xd'));var squel=require(_0x6073('0xe'));var crypto=require(_0x6073('0xf'));var jsforce=require(_0x6073('0x10'));var deskjs=require(_0x6073('0x11'));var toCsv=require(_0x6073('0xa'));var querystring=require('querystring');var Papa=require(_0x6073('0x12'));var Redis=require(_0x6073('0x13'));var authService=require(_0x6073('0x14'));var qs=require(_0x6073('0x15'));var as=require(_0x6073('0x16'));var hardwareService=require(_0x6073('0x17'));var logger=require(_0x6073('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6073('0x19'))['db'];function respondWithStatusCode(_0xbb20d4,_0x4ceaa8){_0x4ceaa8=_0x4ceaa8||0xcc;return function(_0x305dd0){if(_0x305dd0){return _0xbb20d4[_0x6073('0x1a')](_0x4ceaa8);}return _0xbb20d4[_0x6073('0x1b')](_0x4ceaa8)[_0x6073('0x1c')]();};}function respondWithResult(_0x109dc5,_0x32fb98){_0x32fb98=_0x32fb98||0xc8;return function(_0x2f1baa){if(_0x2f1baa){return _0x109dc5[_0x6073('0x1b')](_0x32fb98)[_0x6073('0x1d')](_0x2f1baa);}};}function respondWithFilteredResult(_0xcb3c36,_0x5a6ae0){return function(_0x43a2fe){if(_0x43a2fe){var _0x45637e=typeof _0x5a6ae0['offset']===_0x6073('0x1e')&&typeof _0x5a6ae0[_0x6073('0x1f')]===_0x6073('0x1e');var _0x50d889=_0x43a2fe[_0x6073('0x20')];var _0x43b234=_0x45637e?0x0:_0x5a6ae0[_0x6073('0x21')];var _0x6ebd7a=_0x45637e?_0x43a2fe['count']:_0x5a6ae0['offset']+_0x5a6ae0[_0x6073('0x1f')];var _0x4a6299;if(_0x6ebd7a>=_0x50d889){_0x6ebd7a=_0x50d889;_0x4a6299=0xc8;}else{_0x4a6299=0xce;}_0xcb3c36['status'](_0x4a6299);return _0xcb3c36[_0x6073('0x22')](_0x6073('0x23'),_0x43b234+'-'+_0x6ebd7a+'/'+_0x50d889)[_0x6073('0x1d')](_0x43a2fe);}return null;};}function patchUpdates(_0x16ee59){return function(_0x1a95b1){try{jsonpatch['apply'](_0x1a95b1,_0x16ee59,!![]);}catch(_0x1794cf){return BPromise['reject'](_0x1794cf);}return _0x1a95b1['save']();};}function saveUpdates(_0x12a6d9,_0x2defaf){return function(_0x2228ca){if(_0x2228ca){return _0x2228ca['update'](_0x12a6d9)[_0x6073('0x24')](function(_0x3db8c8){return _0x3db8c8;});}return null;};}function removeEntity(_0x10589d,_0x3d454f){return function(_0x21dd44){if(_0x21dd44){return _0x21dd44[_0x6073('0x25')]()['then'](function(){var _0x321f4d=_0x21dd44['get']({'plain':!![]});var _0xd58a15=_0x6073('0x26');return db[_0x6073('0x27')][_0x6073('0x25')]({'where':{'type':_0xd58a15,'resourceId':_0x321f4d['id']}})[_0x6073('0x24')](function(){return _0x21dd44;});})[_0x6073('0x24')](function(){_0x10589d[_0x6073('0x1b')](0xcc)[_0x6073('0x1c')]();});}};}function handleEntityNotFound(_0x205492,_0x4def74){return function(_0x1d3d35){if(!_0x1d3d35){_0x205492['sendStatus'](0x194);}return _0x1d3d35;};}function handleError(_0x5a8564,_0x2bb3ec){_0x2bb3ec=_0x2bb3ec||0x1f4;return function(_0x3dd707){logger[_0x6073('0x28')](_0x3dd707[_0x6073('0x29')]);if(_0x3dd707[_0x6073('0x2a')]){delete _0x3dd707[_0x6073('0x2a')];}_0x5a8564[_0x6073('0x1b')](_0x2bb3ec)[_0x6073('0x2b')](_0x3dd707);};}exports[_0x6073('0x2c')]=function(_0x5ad864,_0x5c01c1){var _0x1fade1={},_0x20cbfe={},_0x34fe56={'count':0x0,'rows':[]};var _0x348bad=_[_0x6073('0x2d')](db['Disposition'][_0x6073('0x2e')],function(_0x200fad){return{'name':_0x200fad[_0x6073('0x2f')],'type':_0x200fad[_0x6073('0x30')][_0x6073('0x31')]};});_0x20cbfe['model']=_[_0x6073('0x2d')](_0x348bad,_0x6073('0x2a'));_0x20cbfe[_0x6073('0x32')]=_[_0x6073('0x33')](_0x5ad864[_0x6073('0x32')]);_0x20cbfe[_0x6073('0x34')]=_['intersection'](_0x20cbfe['model'],_0x20cbfe['query']);_0x1fade1[_0x6073('0x35')]=_[_0x6073('0x36')](_0x20cbfe[_0x6073('0x37')],qs['fields'](_0x5ad864['query'][_0x6073('0x38')]));_0x1fade1['attributes']=_0x1fade1['attributes'][_0x6073('0x39')]?_0x1fade1[_0x6073('0x35')]:_0x20cbfe[_0x6073('0x37')];if(!_0x5ad864['query'][_0x6073('0x3a')](_0x6073('0x3b'))){_0x1fade1[_0x6073('0x1f')]=qs[_0x6073('0x1f')](_0x5ad864[_0x6073('0x32')]['limit']);_0x1fade1[_0x6073('0x21')]=qs['offset'](_0x5ad864['query'][_0x6073('0x21')]);}_0x1fade1[_0x6073('0x3c')]=qs[_0x6073('0x3d')](_0x5ad864[_0x6073('0x32')][_0x6073('0x3d')]);_0x1fade1['where']=qs['filters'](_[_0x6073('0x3e')](_0x5ad864[_0x6073('0x32')],_0x20cbfe[_0x6073('0x34')]),_0x348bad);if(_0x5ad864[_0x6073('0x32')][_0x6073('0x3f')]){_0x1fade1['where']=_[_0x6073('0x40')](_0x1fade1[_0x6073('0x41')],{'$or':_[_0x6073('0x2d')](_0x348bad,function(_0x3b3f25){if(_0x3b3f25[_0x6073('0x30')]!==_0x6073('0x42')){var _0x55026d={};_0x55026d[_0x3b3f25[_0x6073('0x2a')]]={'$like':'%'+_0x5ad864[_0x6073('0x32')][_0x6073('0x3f')]+'%'};return _0x55026d;}})});}_0x1fade1=_[_0x6073('0x40')]({},_0x1fade1,_0x5ad864[_0x6073('0x43')]);var _0x3b38ee={'where':_0x1fade1[_0x6073('0x41')]};return db[_0x6073('0x44')][_0x6073('0x20')](_0x3b38ee)[_0x6073('0x24')](function(_0x277ce0){_0x34fe56[_0x6073('0x20')]=_0x277ce0;if(_0x5ad864[_0x6073('0x32')][_0x6073('0x45')]){_0x1fade1[_0x6073('0x46')]=[{'all':!![]}];}return db[_0x6073('0x44')]['findAll'](_0x1fade1);})['then'](function(_0x22952c){_0x34fe56[_0x6073('0x47')]=_0x22952c;return _0x34fe56;})[_0x6073('0x24')](respondWithFilteredResult(_0x5c01c1,_0x1fade1))['catch'](handleError(_0x5c01c1,null));};exports[_0x6073('0x48')]=function(_0x4870e4,_0x1b14d3){var _0x14e3a7={'raw':!![],'where':{'id':_0x4870e4['params']['id']}},_0x3d1a8d={};_0x3d1a8d[_0x6073('0x37')]=_[_0x6073('0x33')](db[_0x6073('0x44')][_0x6073('0x2e')]);_0x3d1a8d[_0x6073('0x32')]=_[_0x6073('0x33')](_0x4870e4['query']);_0x3d1a8d[_0x6073('0x34')]=_[_0x6073('0x36')](_0x3d1a8d[_0x6073('0x37')],_0x3d1a8d[_0x6073('0x32')]);_0x14e3a7[_0x6073('0x35')]=_[_0x6073('0x36')](_0x3d1a8d['model'],qs[_0x6073('0x38')](_0x4870e4[_0x6073('0x32')]['fields']));_0x14e3a7[_0x6073('0x35')]=_0x14e3a7[_0x6073('0x35')][_0x6073('0x39')]?_0x14e3a7[_0x6073('0x35')]:_0x3d1a8d['model'];if(_0x4870e4[_0x6073('0x32')][_0x6073('0x45')]){_0x14e3a7[_0x6073('0x46')]=[{'all':!![]}];}_0x14e3a7=_[_0x6073('0x40')]({},_0x14e3a7,_0x4870e4[_0x6073('0x43')]);return db[_0x6073('0x44')]['find'](_0x14e3a7)[_0x6073('0x24')](handleEntityNotFound(_0x1b14d3,null))['then'](respondWithResult(_0x1b14d3,null))[_0x6073('0x49')](handleError(_0x1b14d3,null));};exports[_0x6073('0x4a')]=function(_0x3c5af9,_0x5a5270){return db[_0x6073('0x44')][_0x6073('0x4a')](_0x3c5af9[_0x6073('0x4b')],{})[_0x6073('0x24')](function(_0x320c8e){var _0x16f9c0=_0x3c5af9[_0x6073('0x4c')][_0x6073('0x4d')]({'plain':!![]});if(!_0x16f9c0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16f9c0[_0x6073('0x4e')]===_0x6073('0x4c')){var _0x5c67a1=_0x320c8e[_0x6073('0x4d')]({'plain':!![]});var _0xc6cf2f='Dispositions';return db[_0x6073('0x4f')]['find']({'where':{'name':_0xc6cf2f,'userProfileId':_0x16f9c0['userProfileId']},'raw':!![]})[_0x6073('0x24')](function(_0x22a5a6){if(_0x22a5a6&&_0x22a5a6[_0x6073('0x50')]===0x0){return db[_0x6073('0x27')][_0x6073('0x4a')]({'name':_0x5c67a1[_0x6073('0x2a')],'resourceId':_0x5c67a1['id'],'type':_0x22a5a6[_0x6073('0x2a')],'sectionId':_0x22a5a6['id']},{})[_0x6073('0x24')](function(){return _0x320c8e;});}else{return _0x320c8e;}})[_0x6073('0x49')](function(_0x575d81){logger[_0x6073('0x28')](_0x6073('0x51'),_0x575d81);throw _0x575d81;});}return _0x320c8e;})[_0x6073('0x24')](respondWithResult(_0x5a5270,0xc9))['catch'](handleError(_0x5a5270,null));};exports[_0x6073('0x52')]=function(_0x53853d,_0x9c3577){if(_0x53853d[_0x6073('0x4b')]['id']){delete _0x53853d['body']['id'];}return db[_0x6073('0x44')][_0x6073('0x53')]({'where':{'id':_0x53853d[_0x6073('0x54')]['id']}})['then'](handleEntityNotFound(_0x9c3577,null))[_0x6073('0x24')](saveUpdates(_0x53853d['body'],null))[_0x6073('0x24')](respondWithResult(_0x9c3577,null))[_0x6073('0x49')](handleError(_0x9c3577,null));};exports[_0x6073('0x25')]=function(_0xf39498,_0x461045){return db[_0x6073('0x44')][_0x6073('0x53')]({'where':{'id':_0xf39498['params']['id']}})[_0x6073('0x24')](handleEntityNotFound(_0x461045,null))[_0x6073('0x24')](removeEntity(_0x461045,null))[_0x6073('0x49')](handleError(_0x461045,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 38ad774..3db26d5 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 _0xc936=['name','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./disposition.attributes','exports','tools_dispositions','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms'];(function(_0xbee07d,_0x255af8){var _0x4507de=function(_0xa35a24){while(--_0xa35a24){_0xbee07d['push'](_0xbee07d['shift']());}};_0x4507de(++_0x255af8);}(_0xc936,0xed));var _0x6c93=function(_0x52ff63,_0x32f56b){_0x52ff63=_0x52ff63-0x0;var _0x43a43a=_0xc936[_0x52ff63];return _0x43a43a;};'use strict';var _=require('lodash');var util=require(_0x6c93('0x0'));var logger=require(_0x6c93('0x1'))(_0x6c93('0x2'));var moment=require(_0x6c93('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c93('0x4'));var fs=require('fs');var path=require(_0x6c93('0x5'));var rimraf=require('rimraf');var config=require(_0x6c93('0x6'));var attributes=require(_0x6c93('0x7'));module[_0x6c93('0x8')]=function(_0x8a6db,_0x2680d9){return _0x8a6db['define']('Disposition',attributes,{'tableName':_0x6c93('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name','ListId']},{'unique':!![],'name':_0x6c93('0xa'),'fields':['name',_0x6c93('0xb')]},{'unique':!![],'name':_0x6c93('0xc'),'fields':['name',_0x6c93('0xd')]},{'unique':!![],'name':_0x6c93('0xe'),'fields':[_0x6c93('0xf'),_0x6c93('0x10')]},{'unique':!![],'name':_0x6c93('0x11'),'fields':[_0x6c93('0xf'),'FaxAccountId']},{'unique':!![],'name':_0x6c93('0x12'),'fields':['name',_0x6c93('0x13')]},{'unique':!![],'name':_0x6c93('0x14'),'fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4242=['name_mail','name_sms','SmsAccountId','name_fax','name_openchannel','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice','name','name_chat','ChatWebsiteId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4242,0xcb));var _0x2424=function(_0x3806b0,_0x26b634){_0x3806b0=_0x3806b0-0x0;var _0x5e898e=_0x4242[_0x3806b0];return _0x5e898e;};'use strict';var _=require(_0x2424('0x0'));var util=require('util');var logger=require(_0x2424('0x1'))(_0x2424('0x2'));var moment=require(_0x2424('0x3'));var BPromise=require(_0x2424('0x4'));var rp=require(_0x2424('0x5'));var fs=require('fs');var path=require(_0x2424('0x6'));var rimraf=require(_0x2424('0x7'));var config=require(_0x2424('0x8'));var attributes=require(_0x2424('0x9'));module[_0x2424('0xa')]=function(_0x59d949,_0x474397){return _0x59d949[_0x2424('0xb')]('Disposition',attributes,{'tableName':_0x2424('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x2424('0xd'),'fields':[_0x2424('0xe'),'ListId']},{'unique':!![],'name':_0x2424('0xf'),'fields':['name',_0x2424('0x10')]},{'unique':!![],'name':_0x2424('0x11'),'fields':[_0x2424('0xe'),'MailAccountId']},{'unique':!![],'name':_0x2424('0x12'),'fields':[_0x2424('0xe'),_0x2424('0x13')]},{'unique':!![],'name':_0x2424('0x14'),'fields':[_0x2424('0xe'),'FaxAccountId']},{'unique':!![],'name':_0x2424('0x15'),'fields':['name','OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0x2424('0xe'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 8bf2a2c..426c8b4 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(_0x42feaa,_0x50e04f){var _0x22382c=function(_0x3070b6){while(--_0x3070b6){_0x42feaa['push'](_0x42feaa['shift']());}};_0x22382c(++_0x50e04f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x4b5bca,_0x3b57cf){var _0x1ade3e=function(_0x4cd2e3){while(--_0x4cd2e3){_0x4b5bca['push'](_0x4b5bca['shift']());}};_0x1ade3e(++_0x3b57cf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 8f5a4b9..a4b17c2 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 _0x5f46=['../../config/environment','./disposition.controller','get','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5f46,0xb4));var _0x65f4=function(_0x5573a5,_0x2c888f){_0x5573a5=_0x5573a5-0x0;var _0x1eb86f=_0x5f46[_0x5573a5];return _0x1eb86f;};'use strict';var multer=require(_0x65f4('0x0'));var util=require(_0x65f4('0x1'));var path=require(_0x65f4('0x2'));var timeout=require(_0x65f4('0x3'));var express=require(_0x65f4('0x4'));var router=express[_0x65f4('0x5')]();var fs_extra=require(_0x65f4('0x6'));var auth=require(_0x65f4('0x7'));var interaction=require(_0x65f4('0x8'));var config=require(_0x65f4('0x9'));var controller=require(_0x65f4('0xa'));router[_0x65f4('0xb')]('/',auth[_0x65f4('0xc')](),controller['index']);router[_0x65f4('0xb')]('/:id',auth[_0x65f4('0xc')](),controller[_0x65f4('0xd')]);router[_0x65f4('0xe')]('/',auth[_0x65f4('0xc')](),controller[_0x65f4('0xf')]);router[_0x65f4('0x10')](_0x65f4('0x11'),auth[_0x65f4('0xc')](),controller['update']);router[_0x65f4('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x65f4('0x13')]);module[_0x65f4('0x14')]=router; \ No newline at end of file +var _0x26f7=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','util','path','express','Router'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0x26f7,0x1c7));var _0x726f=function(_0xc31d8a,_0x123995){_0xc31d8a=_0xc31d8a-0x0;var _0x11c548=_0x26f7[_0xc31d8a];return _0x11c548;};'use strict';var multer=require(_0x726f('0x0'));var util=require(_0x726f('0x1'));var path=require(_0x726f('0x2'));var timeout=require('connect-timeout');var express=require(_0x726f('0x3'));var router=express[_0x726f('0x4')]();var fs_extra=require(_0x726f('0x5'));var auth=require(_0x726f('0x6'));var interaction=require(_0x726f('0x7'));var config=require(_0x726f('0x8'));var controller=require(_0x726f('0x9'));router[_0x726f('0xa')]('/',auth[_0x726f('0xb')](),controller[_0x726f('0xc')]);router[_0x726f('0xa')](_0x726f('0xd'),auth['isAuthenticated'](),controller[_0x726f('0xe')]);router[_0x726f('0xf')]('/',auth[_0x726f('0xb')](),controller[_0x726f('0x10')]);router['put'](_0x726f('0xd'),auth['isAuthenticated'](),controller[_0x726f('0x11')]);router[_0x726f('0x12')](_0x726f('0xd'),auth[_0x726f('0xb')](),controller[_0x726f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 6f534c0..303bc0a 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 _0xd8fb=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','xCALLY\x20Motion\x20Fax','localstationid','ENUM','4800','9600','14400','7200','INTEGER','SIP','IAX','DADHI','KHOMP'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0xd8fb,0x99));var _0xbd8f=function(_0x2e66e3,_0x3db0ea){_0x2e66e3=_0x2e66e3-0x0;var _0x13ce11=_0xd8fb[_0x2e66e3];return _0x13ce11;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbd8f('0x2')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xbd8f('0x2')],'defaultValue':_0xbd8f('0x3')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xbd8f('0x4')},'minrate':{'type':Sequelize[_0xbd8f('0x5')]('2400',_0xbd8f('0x6'),'7200',_0xbd8f('0x7'),'12000',_0xbd8f('0x8')),'defaultValue':_0xbd8f('0x6')},'maxrate':{'type':Sequelize['ENUM']('2400',_0xbd8f('0x6'),_0xbd8f('0x9'),_0xbd8f('0x7'),'12000',_0xbd8f('0x8')),'defaultValue':_0xbd8f('0x8')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xbd8f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xbd8f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xbd8f('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xbd8f('0xb'),_0xbd8f('0xc'),_0xbd8f('0xd'),_0xbd8f('0xe')),'defaultValue':_0xbd8f('0xb')},'key':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xbd8f('0xf')],'defaultValue':function(){return _0xbd8f('0x10');}},'notificationSound':{'type':Sequelize[_0xbd8f('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbd8f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xbd8f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbd8f('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbd8f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbd8f('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbd8f('0xa')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xbd8f('0x11')],'defaultValue':![],'comment':_0xbd8f('0x12'),'set':function(_0x504adb){if(!_0x504adb)this[_0xbd8f('0x13')](_0xbd8f('0x14'),null);this['setDataValue']('mandatoryDisposition',_0x504adb);}}}; \ No newline at end of file +var _0x4819=['localstationid','2400','9600','12000','14400','4800','v17,v27,v29','INTEGER','SIP','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x4819,0xcd));var _0x9481=function(_0x211f68,_0x47a58a){_0x211f68=_0x211f68-0x0;var _0x13604e=_0x4819[_0x211f68];return _0x13604e;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9481('0x1')]},'ecm':{'type':Sequelize[_0x9481('0x2')](_0x9481('0x3'),'no'),'defaultValue':_0x9481('0x3')},'headerinfo':{'type':Sequelize[_0x9481('0x1')],'defaultValue':_0x9481('0x4')},'localstationid':{'type':Sequelize[_0x9481('0x1')],'unique':_0x9481('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x9481('0x6'),'4800','7200',_0x9481('0x7'),_0x9481('0x8'),_0x9481('0x9')),'defaultValue':_0x9481('0xa')},'maxrate':{'type':Sequelize[_0x9481('0x2')]('2400',_0x9481('0xa'),'7200',_0x9481('0x7'),'12000',_0x9481('0x9')),'defaultValue':_0x9481('0x9')},'modem':{'type':Sequelize[_0x9481('0x1')],'defaultValue':_0x9481('0xb')},'gateway':{'type':Sequelize[_0x9481('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9481('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x9481('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x9481('0x2')](_0x9481('0xd'),'IAX','DADHI',_0x9481('0xe')),'defaultValue':_0x9481('0xd')},'key':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9481('0xf')],'defaultValue':function(){return _0x9481('0x10');}},'notificationSound':{'type':Sequelize[_0x9481('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9481('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x9481('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9481('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9481('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9481('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x9481('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x9481('0x11')],'defaultValue':![],'comment':_0x9481('0x13'),'set':function(_0x546fce){if(!_0x546fce)this['setDataValue'](_0x9481('0x14'),null);this['setDataValue']('mandatoryDisposition',_0x546fce);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index bab62c8..9fd65a1 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 _0x227a=['dataValues','Messages','SendFax','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','client','http','request','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','FaxAccounts','then','name','send','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','show','mandatoryDispositionPause','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','FaxAccountId','getDispositions','Disposition','findAll','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','getInteractions','findOne','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','stack','finally','sendStatus','getApplications','from-voip-provider','exten','localstationid','app','system','description','push','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','CmContact','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','ContactId'];(function(_0x1b3a72,_0x3a1f98){var _0x8b247f=function(_0x17cc35){while(--_0x17cc35){_0x1b3a72['push'](_0x1b3a72['shift']());}};_0x8b247f(++_0x3a1f98);}(_0x227a,0xcf));var _0xa227=function(_0x5d1e36,_0x1ae76c){_0x5d1e36=_0x5d1e36-0x0;var _0x52d660=_0x227a[_0x5d1e36];return _0x52d660;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa227('0x0'));var zipdir=require(_0xa227('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa227('0x2'));var moment=require('moment');var BPromise=require(_0xa227('0x3'));var Mustache=require('mustache');var util=require(_0xa227('0x4'));var path=require(_0xa227('0x5'));var sox=require(_0xa227('0x6'));var csv=require(_0xa227('0x7'));var ejs=require(_0xa227('0x8'));var fs=require('fs');var fs_extra=require(_0xa227('0x9'));var _=require('lodash');var squel=require(_0xa227('0xa'));var crypto=require(_0xa227('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa227('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa227('0xd'));var Papa=require(_0xa227('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa227('0xf'));var as=require(_0xa227('0x10'));var hardwareService=require(_0xa227('0x11'));var logger=require(_0xa227('0x12'))(_0xa227('0x13'));var utils=require(_0xa227('0x14'));var config=require(_0xa227('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa227('0x16'))['db'];config[_0xa227('0x17')]=_['defaults'](config[_0xa227('0x17')],{'host':_0xa227('0x18'),'port':0x18eb});var socket=require(_0xa227('0x19'))(new Redis(config[_0xa227('0x17')]));require('./faxAccount.socket')[_0xa227('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa227('0x1b')]['http']({'port':0x232c});var client9002=jayson['client'][_0xa227('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2d2306,_0xcde3dd,_0x180f2a,_0x2cd5c8){return new BPromise(function(_0x15913d,_0x544885){var _0x10b048=_0x2cd5c8||client;return _0x10b048[_0xa227('0x1d')](_0x2d2306,_0x180f2a)['then'](function(_0x18e723){logger['info']('FaxAccount,\x20%s,\x20%s',_0xcde3dd,_0xa227('0x1e'));logger[_0xa227('0x1f')](_0xa227('0x20'),_0xcde3dd,_0xa227('0x1e'),JSON[_0xa227('0x21')](_0x18e723));if(_0x18e723[_0xa227('0x22')]){if(_0x18e723['error'][_0xa227('0x23')]===0x1f4){logger[_0xa227('0x22')](_0xa227('0x24'),_0xcde3dd,_0x18e723[_0xa227('0x22')][_0xa227('0x25')]);return _0x544885(_0x18e723['error']['message']);}logger[_0xa227('0x22')]('FaxAccount,\x20%s,\x20%s',_0xcde3dd,_0x18e723[_0xa227('0x22')][_0xa227('0x25')]);return _0x15913d(_0x18e723[_0xa227('0x22')][_0xa227('0x25')]);}else{logger[_0xa227('0x26')](_0xa227('0x24'),_0xcde3dd,'request\x20sent');_0x15913d(_0x18e723[_0xa227('0x27')][_0xa227('0x25')]);}})[_0xa227('0x28')](function(_0x3fe7ec){logger[_0xa227('0x22')](_0xa227('0x24'),_0xcde3dd,_0x3fe7ec);_0x544885(_0x3fe7ec);});});}function respondWithStatusCode(_0x857521,_0x298d13){_0x298d13=_0x298d13||0xcc;return function(_0x19d82){if(_0x19d82){return _0x857521['sendStatus'](_0x298d13);}return _0x857521[_0xa227('0x29')](_0x298d13)[_0xa227('0x2a')]();};}function respondWithResult(_0x5b5d23,_0x36e56d){_0x36e56d=_0x36e56d||0xc8;return function(_0x2572d4){if(_0x2572d4){return _0x5b5d23[_0xa227('0x29')](_0x36e56d)[_0xa227('0x2b')](_0x2572d4);}};}function respondWithFilteredResult(_0x34c4ca,_0x5bb8c0){return function(_0x20e153){if(_0x20e153){var _0x509541=typeof _0x5bb8c0[_0xa227('0x2c')]===_0xa227('0x2d')&&typeof _0x5bb8c0[_0xa227('0x2e')]===_0xa227('0x2d');var _0x17425b=_0x20e153[_0xa227('0x2f')];var _0x178c19=_0x509541?0x0:_0x5bb8c0[_0xa227('0x2c')];var _0x30df38=_0x509541?_0x20e153[_0xa227('0x2f')]:_0x5bb8c0[_0xa227('0x2c')]+_0x5bb8c0[_0xa227('0x2e')];var _0x3fe468;if(_0x30df38>=_0x17425b){_0x30df38=_0x17425b;_0x3fe468=0xc8;}else{_0x3fe468=0xce;}_0x34c4ca[_0xa227('0x29')](_0x3fe468);return _0x34c4ca['set'](_0xa227('0x30'),_0x178c19+'-'+_0x30df38+'/'+_0x17425b)[_0xa227('0x2b')](_0x20e153);}return null;};}function patchUpdates(_0x5f062a){return function(_0x292849){try{jsonpatch[_0xa227('0x31')](_0x292849,_0x5f062a,!![]);}catch(_0x844bec){return BPromise['reject'](_0x844bec);}return _0x292849[_0xa227('0x32')]();};}function saveUpdates(_0x31cc78,_0xc66cf7){return function(_0x191f7d){if(_0x191f7d){return _0x191f7d[_0xa227('0x33')](_0x31cc78)['then'](function(_0x2d413d){return _0x2d413d;});}return null;};}function removeEntity(_0x363b10,_0x31fd06){return function(_0x3d10e4){if(_0x3d10e4){return _0x3d10e4[_0xa227('0x34')]()['then'](function(){var _0x1708bd=_0x3d10e4['get']({'plain':!![]});var _0x599b7a=_0xa227('0x35');return db['UserProfileResource'][_0xa227('0x34')]({'where':{'type':_0x599b7a,'resourceId':_0x1708bd['id']}})[_0xa227('0x36')](function(){return _0x3d10e4;});})[_0xa227('0x36')](function(){_0x363b10[_0xa227('0x29')](0xcc)[_0xa227('0x2a')]();});}};}function handleEntityNotFound(_0x12cc3c,_0x16a2f4){return function(_0x5d1fa0){if(!_0x5d1fa0){_0x12cc3c['sendStatus'](0x194);}return _0x5d1fa0;};}function handleError(_0x201502,_0x2faa1a){_0x2faa1a=_0x2faa1a||0x1f4;return function(_0x1fa489){logger[_0xa227('0x22')](_0x1fa489['stack']);if(_0x1fa489[_0xa227('0x37')]){delete _0x1fa489[_0xa227('0x37')];}_0x201502['status'](_0x2faa1a)[_0xa227('0x38')](_0x1fa489);};}exports['index']=function(_0x3bfa3b,_0x2d9f24){var _0x279d1a={'include':[{'model':db[_0xa227('0x39')],'as':'mandatoryDispositionPause'}]},_0x31de5c={},_0x2565b2={'count':0x0,'rows':[]};var _0x569751=_[_0xa227('0x3a')](db[_0xa227('0x3b')][_0xa227('0x3c')],function(_0x4ec1ab){return{'name':_0x4ec1ab[_0xa227('0x3d')],'type':_0x4ec1ab[_0xa227('0x3e')][_0xa227('0x3f')]};});_0x31de5c[_0xa227('0x40')]=_[_0xa227('0x3a')](_0x569751,'name');_0x31de5c[_0xa227('0x41')]=_[_0xa227('0x42')](_0x3bfa3b[_0xa227('0x41')]);_0x31de5c[_0xa227('0x43')]=_[_0xa227('0x44')](_0x31de5c[_0xa227('0x40')],_0x31de5c[_0xa227('0x41')]);_0x279d1a[_0xa227('0x45')]=_[_0xa227('0x44')](_0x31de5c[_0xa227('0x40')],qs[_0xa227('0x46')](_0x3bfa3b[_0xa227('0x41')][_0xa227('0x46')]));_0x279d1a[_0xa227('0x45')]=_0x279d1a[_0xa227('0x45')][_0xa227('0x47')]?_0x279d1a[_0xa227('0x45')]:_0x31de5c[_0xa227('0x40')];if(!_0x3bfa3b[_0xa227('0x41')][_0xa227('0x48')](_0xa227('0x49'))){_0x279d1a[_0xa227('0x2e')]=qs[_0xa227('0x2e')](_0x3bfa3b[_0xa227('0x41')]['limit']);_0x279d1a[_0xa227('0x2c')]=qs[_0xa227('0x2c')](_0x3bfa3b[_0xa227('0x41')][_0xa227('0x2c')]);}_0x279d1a[_0xa227('0x4a')]=qs['sort'](_0x3bfa3b['query'][_0xa227('0x4b')]);_0x279d1a[_0xa227('0x4c')]=qs[_0xa227('0x43')](_[_0xa227('0x4d')](_0x3bfa3b[_0xa227('0x41')],_0x31de5c[_0xa227('0x43')]),_0x569751);if(_0x3bfa3b['query'][_0xa227('0x4e')]){_0x279d1a[_0xa227('0x4c')]=_['merge'](_0x279d1a['where'],{'$or':_[_0xa227('0x3a')](_0x569751,function(_0x4e3d56){if(_0x4e3d56[_0xa227('0x3e')]!==_0xa227('0x4f')){var _0x26a43b={};_0x26a43b[_0x4e3d56[_0xa227('0x37')]]={'$like':'%'+_0x3bfa3b[_0xa227('0x41')][_0xa227('0x4e')]+'%'};return _0x26a43b;}})});}_0x279d1a=_[_0xa227('0x50')]({},_0x279d1a,_0x3bfa3b[_0xa227('0x51')]);var _0x354295={'where':_0x279d1a[_0xa227('0x4c')]};return db[_0xa227('0x3b')][_0xa227('0x2f')](_0x354295)['then'](function(_0x3c0aa9){_0x2565b2['count']=_0x3c0aa9;if(_0x3bfa3b[_0xa227('0x41')][_0xa227('0x52')]){_0x279d1a['include']=[{'all':!![]}];}return db[_0xa227('0x3b')]['findAll'](_0x279d1a);})['then'](function(_0x17622d){_0x2565b2['rows']=_0x17622d;return _0x2565b2;})[_0xa227('0x36')](respondWithFilteredResult(_0x2d9f24,_0x279d1a))['catch'](handleError(_0x2d9f24,null));};exports[_0xa227('0x53')]=function(_0x32b7d6,_0x44bad9){var _0x158c35={'raw':![],'where':{'id':_0x32b7d6['params']['id']},'include':[{'model':db[_0xa227('0x39')],'as':_0xa227('0x54')}]},_0x4b6457={};_0x4b6457[_0xa227('0x40')]=_['keys'](db[_0xa227('0x3b')]['rawAttributes']);_0x4b6457[_0xa227('0x41')]=_[_0xa227('0x42')](_0x32b7d6[_0xa227('0x41')]);_0x4b6457['filters']=_[_0xa227('0x44')](_0x4b6457[_0xa227('0x40')],_0x4b6457[_0xa227('0x41')]);_0x158c35[_0xa227('0x45')]=_['intersection'](_0x4b6457['model'],qs[_0xa227('0x46')](_0x32b7d6[_0xa227('0x41')][_0xa227('0x46')]));_0x158c35['attributes']=_0x158c35[_0xa227('0x45')][_0xa227('0x47')]?_0x158c35['attributes']:_0x4b6457[_0xa227('0x40')];if(_0x32b7d6[_0xa227('0x41')][_0xa227('0x52')]){_0x158c35[_0xa227('0x55')]=[{'all':!![]}];}_0x158c35=_[_0xa227('0x50')]({},_0x158c35,_0x32b7d6[_0xa227('0x51')]);return db['FaxAccount'][_0xa227('0x56')](_0x158c35)['then'](handleEntityNotFound(_0x44bad9,null))['then'](respondWithResult(_0x44bad9,null))['catch'](handleError(_0x44bad9,null));};exports[_0xa227('0x57')]=function(_0x127a2d,_0x305866){return db['FaxAccount'][_0xa227('0x57')](_0x127a2d['body'],{})['then'](function(_0x369d2d){var _0x5a8447=_0x127a2d[_0xa227('0x58')][_0xa227('0x59')]({'plain':!![]});if(!_0x5a8447)throw new Error(_0xa227('0x5a'));if(_0x5a8447[_0xa227('0x5b')]===_0xa227('0x58')){var _0x486391=_0x369d2d['get']({'plain':!![]});var _0x345959=_0xa227('0x35');return db[_0xa227('0x5c')][_0xa227('0x56')]({'where':{'name':_0x345959,'userProfileId':_0x5a8447[_0xa227('0x5d')]},'raw':!![]})[_0xa227('0x36')](function(_0xf6ecec){if(_0xf6ecec&&_0xf6ecec[_0xa227('0x5e')]===0x0){return db[_0xa227('0x5f')][_0xa227('0x57')]({'name':_0x486391[_0xa227('0x37')],'resourceId':_0x486391['id'],'type':_0xf6ecec[_0xa227('0x37')],'sectionId':_0xf6ecec['id']},{})['then'](function(){return _0x369d2d;});}else{return _0x369d2d;}})[_0xa227('0x28')](function(_0x261609){logger[_0xa227('0x22')](_0xa227('0x60'),_0x261609);throw _0x261609;});}return _0x369d2d;})[_0xa227('0x36')](respondWithResult(_0x305866,0xc9))[_0xa227('0x28')](handleError(_0x305866,null));};exports[_0xa227('0x33')]=function(_0x38ab22,_0x1b05ba){if(_0x38ab22['body']['id']){delete _0x38ab22[_0xa227('0x61')]['id'];}return db['FaxAccount'][_0xa227('0x56')]({'where':{'id':_0x38ab22[_0xa227('0x62')]['id']},'include':[{'model':db[_0xa227('0x39')],'as':_0xa227('0x54')}]})[_0xa227('0x36')](handleEntityNotFound(_0x1b05ba,null))[_0xa227('0x36')](saveUpdates(_0x38ab22['body'],null))['then'](respondWithResult(_0x1b05ba,null))[_0xa227('0x28')](handleError(_0x1b05ba,null));};exports[_0xa227('0x34')]=function(_0xb0b9d6,_0x1417fd){return db[_0xa227('0x3b')][_0xa227('0x56')]({'where':{'id':_0xb0b9d6[_0xa227('0x62')]['id']}})[_0xa227('0x36')](handleEntityNotFound(_0x1417fd,null))['then'](removeEntity(_0x1417fd,null))[_0xa227('0x28')](handleError(_0x1417fd,null));};exports[_0xa227('0x63')]=function(_0x2928f1,_0x3b6ecd){return db[_0xa227('0x3b')]['describe']()[_0xa227('0x36')](respondWithResult(_0x3b6ecd,null))[_0xa227('0x28')](handleError(_0x3b6ecd,null));};exports[_0xa227('0x64')]=function(_0x3b2e22,_0x39b5ef,_0x533178){if(_0x3b2e22[_0xa227('0x61')]['id']){delete _0x3b2e22[_0xa227('0x61')]['id'];}return db[_0xa227('0x3b')][_0xa227('0x56')]({'where':{'id':_0x3b2e22[_0xa227('0x62')]['id']}})[_0xa227('0x36')](handleEntityNotFound(_0x39b5ef,null))['then'](function(_0x2fd163){if(_0x2fd163){_0x3b2e22['body'][_0xa227('0x65')]=_0x2fd163['id'];return db['Disposition'][_0xa227('0x57')](_0x3b2e22['body']);}})[_0xa227('0x36')](respondWithResult(_0x39b5ef,null))[_0xa227('0x28')](handleError(_0x39b5ef,null));};exports[_0xa227('0x66')]=function(_0x360485,_0x315503,_0x4ae64a){var _0x22f348={'raw':![],'where':{}};var _0x46da26={};var _0x45a222={'count':0x0,'rows':[]};return db[_0xa227('0x3b')]['findOne']({'where':{'id':_0x360485[_0xa227('0x62')]['id']}})[_0xa227('0x36')](handleEntityNotFound(_0x315503,null))[_0xa227('0x36')](function(_0x4d7fbc){if(_0x4d7fbc){_0x46da26[_0xa227('0x40')]=_['keys'](db[_0xa227('0x67')][_0xa227('0x3c')]);_0x46da26[_0xa227('0x41')]=_[_0xa227('0x42')](_0x360485['query']);_0x46da26[_0xa227('0x43')]=_[_0xa227('0x44')](_0x46da26[_0xa227('0x40')],_0x46da26[_0xa227('0x41')]);_0x22f348[_0xa227('0x45')]=_[_0xa227('0x44')](_0x46da26[_0xa227('0x40')],qs['fields'](_0x360485['query'][_0xa227('0x46')]));_0x22f348['attributes']=_0x22f348[_0xa227('0x45')]['length']?_0x22f348[_0xa227('0x45')]:_0x46da26[_0xa227('0x40')];if(!_0x360485[_0xa227('0x41')][_0xa227('0x48')](_0xa227('0x49'))){_0x22f348[_0xa227('0x2e')]=qs['limit'](_0x360485[_0xa227('0x41')][_0xa227('0x2e')]);_0x22f348[_0xa227('0x2c')]=qs[_0xa227('0x2c')](_0x360485['query']['offset']);}_0x22f348[_0xa227('0x4a')]=qs[_0xa227('0x4b')](_0x360485[_0xa227('0x41')]['sort']);_0x22f348[_0xa227('0x4c')]=qs[_0xa227('0x43')](_['pick'](_0x360485['query'],_0x46da26[_0xa227('0x43')]));_0x22f348[_0xa227('0x4c')][_0xa227('0x65')]=_0x4d7fbc['id'];if(_0x360485[_0xa227('0x41')]['filter']){_0x22f348[_0xa227('0x4c')]=_[_0xa227('0x50')](_0x22f348[_0xa227('0x4c')],{'$or':_[_0xa227('0x3a')](_0x22f348[_0xa227('0x45')],function(_0x5c5d30){var _0x1d8f52={};_0x1d8f52[_0x5c5d30]={'$like':'%'+_0x360485[_0xa227('0x41')][_0xa227('0x4e')]+'%'};return _0x1d8f52;})});}_0x22f348=_[_0xa227('0x50')]({},_0x22f348,_0x360485['options']);return db[_0xa227('0x67')]['count']({'where':_0x22f348['where']})['then'](function(_0x11f58c){_0x45a222[_0xa227('0x2f')]=_0x11f58c;if(_0x360485['query'][_0xa227('0x52')]){_0x22f348[_0xa227('0x55')]=[{'all':!![]}];}return db['Disposition'][_0xa227('0x68')](_0x22f348);})[_0xa227('0x36')](function(_0x4e04b8){_0x45a222[_0xa227('0x69')]=_0x4e04b8;return _0x45a222;});}})[_0xa227('0x36')](respondWithFilteredResult(_0x315503,_0x22f348))['catch'](handleError(_0x315503,null));};exports[_0xa227('0x6a')]=function(_0xacfe0,_0x39c029,_0x1ce044){return db[_0xa227('0x3b')][_0xa227('0x56')]({'where':{'id':_0xacfe0[_0xa227('0x62')]['id']}})[_0xa227('0x36')](handleEntityNotFound(_0x39c029,null))['then'](function(_0x1693d5){if(_0x1693d5){return _0x1693d5[_0xa227('0x6a')](_0xacfe0[_0xa227('0x41')][_0xa227('0x6b')]);}})[_0xa227('0x36')](respondWithStatusCode(_0x39c029,null))[_0xa227('0x28')](handleError(_0x39c029,null));};exports['addAnswer']=function(_0x18f41d,_0x557921,_0x25fdf1){if(_0x18f41d[_0xa227('0x61')]['id']){delete _0x18f41d[_0xa227('0x61')]['id'];}return db['FaxAccount'][_0xa227('0x56')]({'where':{'id':_0x18f41d[_0xa227('0x62')]['id']}})['then'](handleEntityNotFound(_0x557921,null))[_0xa227('0x36')](function(_0x10bb35){if(_0x10bb35){_0x18f41d['body'][_0xa227('0x65')]=_0x10bb35['id'];return db[_0xa227('0x6c')]['create'](_0x18f41d[_0xa227('0x61')]);}})[_0xa227('0x36')](respondWithResult(_0x557921,null))[_0xa227('0x28')](handleError(_0x557921,null));};exports[_0xa227('0x6d')]=function(_0x394bc4,_0x4a7295,_0x8fdb61){var _0x253ff9={'raw':![],'where':{}};var _0x213e22={};var _0x426b53={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x394bc4[_0xa227('0x62')]['id']}})[_0xa227('0x36')](handleEntityNotFound(_0x4a7295,null))[_0xa227('0x36')](function(_0x3ad498){if(_0x3ad498){_0x213e22[_0xa227('0x40')]=_[_0xa227('0x42')](db['CannedAnswer'][_0xa227('0x3c')]);_0x213e22[_0xa227('0x41')]=_[_0xa227('0x42')](_0x394bc4['query']);_0x213e22['filters']=_['intersection'](_0x213e22[_0xa227('0x40')],_0x213e22[_0xa227('0x41')]);_0x253ff9[_0xa227('0x45')]=_[_0xa227('0x44')](_0x213e22[_0xa227('0x40')],qs['fields'](_0x394bc4[_0xa227('0x41')]['fields']));_0x253ff9[_0xa227('0x45')]=_0x253ff9[_0xa227('0x45')][_0xa227('0x47')]?_0x253ff9[_0xa227('0x45')]:_0x213e22[_0xa227('0x40')];if(!_0x394bc4[_0xa227('0x41')][_0xa227('0x48')](_0xa227('0x49'))){_0x253ff9[_0xa227('0x2e')]=qs['limit'](_0x394bc4[_0xa227('0x41')][_0xa227('0x2e')]);_0x253ff9[_0xa227('0x2c')]=qs[_0xa227('0x2c')](_0x394bc4[_0xa227('0x41')][_0xa227('0x2c')]);}_0x253ff9[_0xa227('0x4a')]=qs['sort'](_0x394bc4[_0xa227('0x41')][_0xa227('0x4b')]);_0x253ff9['where']=qs[_0xa227('0x43')](_['pick'](_0x394bc4[_0xa227('0x41')],_0x213e22[_0xa227('0x43')]));_0x253ff9[_0xa227('0x4c')]['FaxAccountId']=_0x3ad498['id'];if(_0x394bc4[_0xa227('0x41')][_0xa227('0x4e')]){_0x253ff9[_0xa227('0x4c')]=_[_0xa227('0x50')](_0x253ff9[_0xa227('0x4c')],{'$or':_[_0xa227('0x3a')](_0x253ff9[_0xa227('0x45')],function(_0x356d5c){var _0x4ca568={};_0x4ca568[_0x356d5c]={'$like':'%'+_0x394bc4[_0xa227('0x41')][_0xa227('0x4e')]+'%'};return _0x4ca568;})});}_0x253ff9=_[_0xa227('0x50')]({},_0x253ff9,_0x394bc4[_0xa227('0x51')]);return db[_0xa227('0x6c')][_0xa227('0x2f')]({'where':_0x253ff9[_0xa227('0x4c')]})[_0xa227('0x36')](function(_0x18f9fa){_0x426b53[_0xa227('0x2f')]=_0x18f9fa;if(_0x394bc4[_0xa227('0x41')][_0xa227('0x52')]){_0x253ff9[_0xa227('0x55')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x253ff9);})[_0xa227('0x36')](function(_0x1d29a4){_0x426b53['rows']=_0x1d29a4;return _0x426b53;});}})['then'](respondWithFilteredResult(_0x4a7295,_0x253ff9))['catch'](handleError(_0x4a7295,null));};exports[_0xa227('0x6e')]=function(_0x2bb3e7,_0x40f70b,_0x39acbb){return db[_0xa227('0x3b')][_0xa227('0x56')]({'where':{'id':_0x2bb3e7[_0xa227('0x62')]['id']}})['then'](handleEntityNotFound(_0x40f70b,null))[_0xa227('0x36')](function(_0xa93da){if(_0xa93da){return _0xa93da[_0xa227('0x6e')](_0x2bb3e7[_0xa227('0x41')][_0xa227('0x6b')]);}})[_0xa227('0x36')](respondWithStatusCode(_0x40f70b,null))[_0xa227('0x28')](handleError(_0x40f70b,null));};exports['addInteraction']=function(_0x2c8d11,_0x19c529,_0x159360){return db[_0xa227('0x6f')]['find']({'where':{'id':_0x2c8d11[_0xa227('0x62')]['id']}})[_0xa227('0x36')](handleEntityNotFound(_0x19c529,null))[_0xa227('0x36')](function(_0x42f710){if(_0x42f710){return _0x42f710[_0xa227('0x70')](_0x2c8d11[_0xa227('0x61')][_0xa227('0x6b')],_['omit'](_0x2c8d11[_0xa227('0x61')],[_0xa227('0x6b'),'id'])||{});}})[_0xa227('0x36')](respondWithResult(_0x19c529,null))[_0xa227('0x28')](handleError(_0x19c529,null));};exports[_0xa227('0x71')]=function(_0x1c54ee,_0x233833,_0xe842c2){var _0x5d4aed={'raw':![],'where':{}};var _0x154be6={};var _0x54d014={'count':0x0,'rows':[]};return db[_0xa227('0x3b')][_0xa227('0x72')]({'where':{'id':_0x1c54ee[_0xa227('0x62')]['id']}})[_0xa227('0x36')](handleEntityNotFound(_0x233833,null))[_0xa227('0x36')](function(_0x109ba0){if(_0x109ba0){_0x154be6[_0xa227('0x40')]=_[_0xa227('0x42')](db[_0xa227('0x6f')][_0xa227('0x3c')]);_0x154be6['query']=_[_0xa227('0x42')](_0x1c54ee[_0xa227('0x41')]);_0x154be6[_0xa227('0x43')]=_[_0xa227('0x44')](_0x154be6[_0xa227('0x40')],_0x154be6['query']);_0x5d4aed['attributes']=_['intersection'](_0x154be6[_0xa227('0x40')],qs[_0xa227('0x46')](_0x1c54ee[_0xa227('0x41')]['fields']));_0x5d4aed['attributes']=_0x5d4aed[_0xa227('0x45')][_0xa227('0x47')]?_0x5d4aed[_0xa227('0x45')]:_0x154be6[_0xa227('0x40')];if(!_0x1c54ee[_0xa227('0x41')]['hasOwnProperty'](_0xa227('0x49'))){_0x5d4aed[_0xa227('0x2e')]=qs[_0xa227('0x2e')](_0x1c54ee[_0xa227('0x41')][_0xa227('0x2e')]);_0x5d4aed['offset']=qs['offset'](_0x1c54ee[_0xa227('0x41')][_0xa227('0x2c')]);}_0x5d4aed[_0xa227('0x4a')]=qs[_0xa227('0x4b')](_0x1c54ee['query'][_0xa227('0x4b')]);_0x5d4aed['where']=qs['filters'](_[_0xa227('0x4d')](_0x1c54ee[_0xa227('0x41')],_0x154be6[_0xa227('0x43')]));_0x5d4aed[_0xa227('0x4c')][_0xa227('0x65')]=_0x109ba0['id'];if(_0x1c54ee[_0xa227('0x41')][_0xa227('0x4e')]){_0x5d4aed[_0xa227('0x4c')]=_[_0xa227('0x50')](_0x5d4aed['where'],{'$or':_[_0xa227('0x3a')](_0x5d4aed['attributes'],function(_0x340dfd){var _0x216b74={};_0x216b74[_0x340dfd]={'$like':'%'+_0x1c54ee[_0xa227('0x41')][_0xa227('0x4e')]+'%'};return _0x216b74;})});}_0x5d4aed=_[_0xa227('0x50')]({},_0x5d4aed,_0x1c54ee[_0xa227('0x51')]);return db[_0xa227('0x6f')][_0xa227('0x2f')]({'where':_0x5d4aed[_0xa227('0x4c')]})[_0xa227('0x36')](function(_0x21402e){_0x54d014[_0xa227('0x2f')]=_0x21402e;if(_0x1c54ee[_0xa227('0x41')][_0xa227('0x52')]){_0x5d4aed[_0xa227('0x55')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xa227('0x73'),'attributes':[_0xa227('0x37'),'fullname',_0xa227('0x74')],'required':![]},{'model':db[_0xa227('0x75')],'as':_0xa227('0x76'),'attributes':['id',_0xa227('0x37'),_0xa227('0x77')],'where':_0x1c54ee[_0xa227('0x41')][_0xa227('0x78')]?{'id':_0x1c54ee[_0xa227('0x41')]['tag']}:undefined,'required':_0x1c54ee['query'][_0xa227('0x78')]?!![]:![]}];}return db[_0xa227('0x6f')][_0xa227('0x68')](_0x5d4aed);})[_0xa227('0x36')](function(_0x5f0a8d){_0x54d014[_0xa227('0x69')]=_0x5f0a8d;return _0x54d014;});}})[_0xa227('0x36')](respondWithFilteredResult(_0x233833,_0x5d4aed))[_0xa227('0x28')](handleError(_0x233833,null));};exports[_0xa227('0x79')]=function(_0x2c4ae6,_0xc74973){var _0x5c566f=_0x2c4ae6[_0xa227('0x62')]['id'];var _0x44bc1d=_0x2c4ae6[_0xa227('0x61')];var _0x3c7b6f=0xc8;var _0x35b311=null;return db[_0xa227('0x7a')][_0xa227('0x7b')]({'isolationLevel':db[_0xa227('0x7a')][_0xa227('0x7c')][_0xa227('0x7d')]['READ_COMMITTED']},function(_0x5e5e1f){return db[_0xa227('0x3b')]['findOne']({'where':{'id':_0x5c566f},'transaction':_0x5e5e1f})[_0xa227('0x36')](function(_0x1e8995){if(_0x1e8995){return db[_0xa227('0x7e')]['destroy']({'where':{'FaxAccountId':_0x5c566f},'transaction':_0x5e5e1f})[_0xa227('0x36')](function(){var _0x3306f7=_[_0xa227('0x3a')](_0x44bc1d,function(_0x283fc5){_0x283fc5[_0xa227('0x65')]=_0x5c566f;return _0x283fc5;});return db[_0xa227('0x7e')][_0xa227('0x7f')](_0x3306f7,{'transaction':_0x5e5e1f});});}else{_0x3c7b6f=0x194;_0x35b311=[];}});})[_0xa227('0x36')](function(){if(_0x3c7b6f!==0x194){return db[_0xa227('0x7e')][_0xa227('0x80')]({'where':{'FaxAccountId':_0x5c566f},'order':_0xa227('0x81')})[_0xa227('0x36')](function(_0x271669){_0x35b311=_0x271669;});}})[_0xa227('0x28')](function(_0x1242fa){_0x3c7b6f=0x1f4;logger[_0xa227('0x22')](_0x1242fa[_0xa227('0x82')]);if(_0x1242fa[_0xa227('0x37')]){delete _0x1242fa[_0xa227('0x37')];}_0x35b311=_0x1242fa;})[_0xa227('0x83')](function(){if(_0x35b311===null){_0xc74973[_0xa227('0x84')](_0x3c7b6f);}else{if(_0x3c7b6f===0x1f4){_0xc74973[_0xa227('0x29')](_0x3c7b6f)[_0xa227('0x38')](_0x35b311);}else{_0xc74973[_0xa227('0x29')](_0x3c7b6f)['json'](_0x35b311);}}});};exports[_0xa227('0x85')]=function(_0x1b8b63,_0x1a53fd,_0x345b7d){var _0x3d242a={};var _0x1c52d1={};var _0x32c979;var _0x376a35;return db[_0xa227('0x3b')][_0xa227('0x72')]({'where':{'id':_0x1b8b63['params']['id']}})[_0xa227('0x36')](handleEntityNotFound(_0x1a53fd,null))[_0xa227('0x36')](function(_0x4f4233){if(_0x4f4233){_0x32c979=_0x4f4233;_0x1c52d1['model']=_[_0xa227('0x42')](db[_0xa227('0x7e')][_0xa227('0x3c')]);_0x1c52d1[_0xa227('0x41')]=_[_0xa227('0x42')](_0x1b8b63[_0xa227('0x41')]);_0x1c52d1['filters']=_['intersection'](_0x1c52d1['model'],_0x1c52d1[_0xa227('0x41')]);_0x3d242a[_0xa227('0x45')]=_[_0xa227('0x44')](_0x1c52d1[_0xa227('0x40')],qs[_0xa227('0x46')](_0x1b8b63[_0xa227('0x41')][_0xa227('0x46')]));_0x3d242a['attributes']=_0x3d242a[_0xa227('0x45')]['length']?_0x3d242a[_0xa227('0x45')]:_0x1c52d1['model'];_0x3d242a['order']=qs[_0xa227('0x4b')](_0x1b8b63['query'][_0xa227('0x4b')]);_0x3d242a[_0xa227('0x4c')]=qs[_0xa227('0x43')](_['pick'](_0x1b8b63['query'],_0x1c52d1[_0xa227('0x43')]));if(_0x1b8b63[_0xa227('0x41')][_0xa227('0x4e')]){_0x3d242a[_0xa227('0x4c')]=_['merge'](_0x3d242a[_0xa227('0x4c')],{'$or':_[_0xa227('0x3a')](_0x3d242a[_0xa227('0x45')],function(_0xc0bad6){var _0x232036={};_0x232036[_0xc0bad6]={'$like':'%'+_0x1b8b63[_0xa227('0x41')][_0xa227('0x4e')]+'%'};return _0x232036;})});}_0x3d242a=_['merge']({},_0x3d242a,_0x1b8b63[_0xa227('0x51')]);return _0x32c979['getApplications'](_0x3d242a);}})[_0xa227('0x36')](function(_0xf7b320){if(_0xf7b320){_0x376a35=_0xf7b320[_0xa227('0x47')];if(!_0x1b8b63[_0xa227('0x41')]['hasOwnProperty'](_0xa227('0x49'))){_0x3d242a[_0xa227('0x2e')]=qs[_0xa227('0x2e')](_0x1b8b63[_0xa227('0x41')][_0xa227('0x2e')]);_0x3d242a['offset']=qs[_0xa227('0x2c')](_0x1b8b63[_0xa227('0x41')][_0xa227('0x2c')]);}return _0x32c979[_0xa227('0x85')](_0x3d242a);}})[_0xa227('0x36')](function(_0x17a63f){if(_0x17a63f){return _0x17a63f?{'count':_0x376a35,'rows':_0x17a63f}:null;}})[_0xa227('0x36')](respondWithResult(_0x1a53fd,null))[_0xa227('0x28')](handleError(_0x1a53fd,null));};function Extension(_0x104e81,_0x4b2bf0,_0x2ea697,_0x53ca87){this['context']=_0xa227('0x86');this[_0xa227('0x87')]=_0x104e81[_0xa227('0x88')];this[_0xa227('0x89')]=_0x53ca87;this[_0xa227('0x3e')]=_0xa227('0x8a');this[_0xa227('0x8b')]='Fax\x20Extension';this['FaxAccountId']=_0x104e81['id'];this[_0xa227('0x81')]=_0x4b2bf0;this['appdata']=_0x2ea697;}function createExtensionsReciveFax(_0x15e17c){var _0x35b9ac=0x1;var _0x5017f8=[];_0x5017f8[_0xa227('0x8c')](new Extension(_0x15e17c,_0x35b9ac,'','Answer'));_0x35b9ac+=0x1;_0x5017f8[_0xa227('0x8c')](new Extension(_0x15e17c,_0x35b9ac,_0xa227('0x8d'),_0xa227('0x8e')));_0x35b9ac+=0x1;for(var _0x3890a3 in _0x15e17c){if(_0x15e17c['hasOwnProperty'](_0x3890a3)&&(_0x3890a3===_0xa227('0x8f')||_0x3890a3===_0xa227('0x88')||_0x3890a3===_0xa227('0x90')||_0x3890a3==='faxdetect'||_0x3890a3===_0xa227('0x91')||_0x3890a3==='maxrate'||_0x3890a3===_0xa227('0x92')||_0x3890a3===_0xa227('0x93')||_0x3890a3===_0xa227('0x94'))){_0x5017f8['push'](new Extension(_0x15e17c,_0x35b9ac,_0xa227('0x95')+_0x3890a3+')='+_0x15e17c[_0x3890a3],'Set'));_0x35b9ac+=0x1;}}_0x5017f8['push'](new Extension(_0x15e17c,_0x35b9ac,'6',_0xa227('0x96')));_0x35b9ac+=0x1;_0x5017f8[_0xa227('0x8c')](new Extension(_0x15e17c,_0x35b9ac,_0xa227('0x97'),_0xa227('0x98')));_0x35b9ac=0x0;return _0x5017f8;}exports['addAccountApplications']=function(_0x25441f,_0x3900b6,_0x5756eb){var _0x18896a;return db[_0xa227('0x7a')][_0xa227('0x7b')](function(_0x26764f){return db[_0xa227('0x3b')][_0xa227('0x57')](_0x25441f[_0xa227('0x61')],{'transaction':_0x26764f})[_0xa227('0x36')](function(_0x27cdb4){_0x18896a=_0x27cdb4[_0xa227('0x59')]({'plain':!![]});return db[_0xa227('0x99')][_0xa227('0x7f')](createExtensionsReciveFax(_0x18896a),{'transaction':_0x26764f});});})[_0xa227('0x36')](function(){return _0x18896a;})[_0xa227('0x36')](respondWithResult(_0x3900b6,null))[_0xa227('0x28')](handleError(_0x3900b6,null));};exports[_0xa227('0x9a')]=function(_0x25b7ae,_0x1e9c4f,_0x67f926){var _0xfe4ab8;return db[_0xa227('0x7a')]['transaction'](function(_0x4040d8){return db[_0xa227('0x3b')][_0xa227('0x33')](_0x25b7ae[_0xa227('0x61')],{'where':{'id':_0x25b7ae[_0xa227('0x61')]['id']},'transaction':_0x4040d8})[_0xa227('0x36')](function(_0x4a0adc){return db[_0xa227('0x99')][_0xa227('0x34')]({'where':{'FaxAccountId':_0x25b7ae['body']['id']},'transaction':_0x4040d8})['then'](function(_0x2a5f21){return db[_0xa227('0x99')][_0xa227('0x7f')](createExtensionsReciveFax(_['omit'](_0x25b7ae[_0xa227('0x61')],[_0xa227('0x9b'),_0xa227('0x3f'),_0xa227('0x9c'),_0xa227('0x9d'),_0xa227('0x9e'),_0xa227('0x9f')])),{'transaction':_0x4040d8});});});})[_0xa227('0x36')](function(){return db[_0xa227('0x3b')]['findById'](_0x25b7ae['body']['id']);})[_0xa227('0x36')](respondWithResult(_0x1e9c4f,null))['catch'](handleError(_0x1e9c4f,null));};exports[_0xa227('0xa0')]=function(_0x3de154,_0x4a5ff4,_0x1f311d){var _0x196007={'raw':!![],'where':{}};var _0x557ccd={};var _0x248e98={'count':0x0,'rows':[]};return db['FaxAccount'][_0xa227('0x72')]({'where':{'id':_0x3de154['params']['id']}})[_0xa227('0x36')](handleEntityNotFound(_0x4a5ff4,null))[_0xa227('0x36')](function(_0x38c7de){if(_0x38c7de){_0x557ccd[_0xa227('0x40')]=_[_0xa227('0x42')](db[_0xa227('0xa1')][_0xa227('0x3c')]);_0x557ccd[_0xa227('0x41')]=_[_0xa227('0x42')](_0x3de154['query']);_0x557ccd['filters']=_['intersection'](_0x557ccd['model'],_0x557ccd['query']);_0x196007['attributes']=_['intersection'](_0x557ccd['model'],qs[_0xa227('0x46')](_0x3de154[_0xa227('0x41')][_0xa227('0x46')]));_0x196007[_0xa227('0x45')]=_0x196007[_0xa227('0x45')]['length']?_0x196007[_0xa227('0x45')]:_0x557ccd[_0xa227('0x40')];if(!_0x3de154[_0xa227('0x41')][_0xa227('0x48')](_0xa227('0x49'))){_0x196007['limit']=qs[_0xa227('0x2e')](_0x3de154['query']['limit']);_0x196007[_0xa227('0x2c')]=qs['offset'](_0x3de154['query'][_0xa227('0x2c')]);}_0x196007[_0xa227('0x4a')]=qs[_0xa227('0x4b')](_0x3de154[_0xa227('0x41')]['sort']);_0x196007[_0xa227('0x4c')]=qs['filters'](_[_0xa227('0x4d')](_0x3de154['query'],_0x557ccd[_0xa227('0x43')]));_0x196007[_0xa227('0x4c')]['FaxAccountId']=_0x38c7de['id'];if(_0x3de154[_0xa227('0x41')][_0xa227('0x4e')]){_0x196007['where']=_[_0xa227('0x50')](_0x196007[_0xa227('0x4c')],{'$or':_[_0xa227('0x3a')](_0x196007[_0xa227('0x45')],function(_0x4faee0){var _0xd300d2={};_0xd300d2[_0x4faee0]={'$like':'%'+_0x3de154[_0xa227('0x41')]['filter']+'%'};return _0xd300d2;})});}if(_0x3de154[_0xa227('0x41')][_0xa227('0xa2')]){var _0x182317=_0x3de154['query']['$gte'][_0xa227('0xa3')](',');var _0x19349c={};_0x19349c[_0x182317[0x0]]={'$gte':moment(_0x182317[0x1])[_0xa227('0xa4')](_0xa227('0xa5'))};_0x196007[_0xa227('0x4c')]=_[_0xa227('0x50')](_0x196007[_0xa227('0x4c')],_0x19349c);}_0x196007=_[_0xa227('0x50')]({},_0x196007,_0x3de154[_0xa227('0x51')]);return db[_0xa227('0xa1')]['count']({'where':_0x196007[_0xa227('0x4c')]})['then'](function(_0x247923){_0x248e98['count']=_0x247923;if(_0x3de154[_0xa227('0x41')][_0xa227('0x52')]){_0x196007['include']=[{'all':!![]}];}return db[_0xa227('0xa1')]['findAll'](_0x196007);})[_0xa227('0x36')](function(_0x1a14bb){_0x248e98[_0xa227('0x69')]=_0x1a14bb;return _0x248e98;});}})[_0xa227('0x36')](respondWithFilteredResult(_0x4a5ff4,_0x196007))[_0xa227('0x28')](handleError(_0x4a5ff4,null));};exports[_0xa227('0x38')]=function(_0x22d173,_0xa4b359,_0x58ed2b){var _0x564c01,_0x55c932={},_0x826bfb;if(_0x22d173[_0xa227('0x61')]['to']){_0x826bfb=_0x22d173[_0xa227('0x61')]['to'][0x0];}return db[_0xa227('0x3b')][_0xa227('0x56')]({'where':{'id':_0x22d173['params']['id']},'include':[{'model':db[_0xa227('0xa6')],'as':_0xa227('0xa7'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x826bfb},'limit':0x1,'order':[[_0xa227('0x9d'),_0xa227('0xa8')]]}]}]})['then'](handleEntityNotFound(_0xa4b359,null))[_0xa227('0x36')](function(_0x2980d4){_0x564c01=_0x2980d4;if(_0x22d173[_0xa227('0x61')][_0xa227('0xa9')]&&_0x22d173[_0xa227('0x61')][_0xa227('0xa9')][_0xa227('0x47')]){for(var _0x4d13cf=0x0;_0x4d13cf<_0x22d173[_0xa227('0x61')][_0xa227('0xa9')]['length'];_0x4d13cf+=0x1){_0x22d173[_0xa227('0x61')][_0xa227('0xa9')][_0x4d13cf]={'filename':_0x22d173[_0xa227('0x61')][_0xa227('0xa9')][_0x4d13cf][_0xa227('0x37')],'id':_0x22d173[_0xa227('0x61')][_0xa227('0xa9')][_0x4d13cf]['id'],'path':path[_0xa227('0xaa')](config[_0xa227('0xab')],_0xa227('0xac'),_0x22d173[_0xa227('0x61')][_0xa227('0xa9')][_0x4d13cf][_0xa227('0xad')])};}}return respondWithRpcPromise(_0xa227('0xae'),_0xa227('0xae'),{'FaxAccountId':_[_0xa227('0xaf')](_0x22d173['params']['id'])?undefined:_0x22d173['params']['id'],'path':_[_0xa227('0xaf')](_0x22d173[_0xa227('0x61')][_0xa227('0xa9')][0x0][_0xa227('0x5')])?undefined:_0x22d173[_0xa227('0x61')]['attachments'][0x0][_0xa227('0x5')],'fax':_[_0xa227('0xaf')](_0x22d173[_0xa227('0x61')]['to'][0x0])?undefined:_0x22d173[_0xa227('0x61')]['to'][0x0]},client9002);})[_0xa227('0x36')](function(){if(_0x564c01){if(_[_0xa227('0xaf')](_0x22d173['body'][_0xa227('0xb0')])){_0x22d173[_0xa227('0x61')][_0xa227('0xb0')]=util[_0xa227('0xa4')](_0xa227('0xb1'),_0x564c01['name'],_0x564c01[_0xa227('0xb2')]);}if(_0x564c01['List']){if(_0x564c01[_0xa227('0xa7')]['Contacts']['length']){return _0x564c01[_0xa227('0xa7')][_0xa227('0xb3')][0x0];}else{return db[_0xa227('0xb4')][_0xa227('0x57')](_[_0xa227('0xb5')](_0x22d173['body'],{'firstName':_0x22d173[_0xa227('0x61')]['to'][0x0],'phone':_0x22d173[_0xa227('0x61')]['to'][0x0],'fax':_0x22d173[_0xa227('0x61')]['to'][0x0],'ListId':_0x564c01[_0xa227('0x9f')]}));}}else{throw new Error(_0xa227('0xb6'));}}else{throw new Error(_0xa227('0xb7'));}})[_0xa227('0x36')](function(_0x3375a6){if(_0x3375a6){return db[_0xa227('0x6f')][_0xa227('0x56')]({'where':{'ContactId':_0x3375a6['id'],'closed':![],'FaxAccountId':_0x564c01['id']}})[_0xa227('0x36')](function(_0x41d01c){if(_0x41d01c){return[_0x41d01c,![]];}return db[_0xa227('0x6f')]['create']({'UserId':_0x22d173['user']['id'],'ContactId':_0x3375a6['id'],'FaxAccountId':_0x564c01['id'],'fax':_0x22d173[_0xa227('0x61')]['to'][0x0],'firstMsgDirection':_0xa227('0xb8'),'Messages':[_[_0xa227('0x50')](_0x22d173['body'],{'read':![],'body':_0x22d173['body']['attachments'][0x0][_0xa227('0xb9')],'FaxAccountId':_0x564c01['id'],'UserId':_0x22d173[_0xa227('0x58')]['id'],'ContactId':_0x3375a6['id'],'AttachmentId':_0x22d173[_0xa227('0x61')][_0xa227('0xa9')][0x0]['id']})]},{'include':[{'model':db[_0xa227('0xa1')],'as':'Messages'}]})['then'](function(_0x361b3f){return[_0x361b3f,!![]];});});}else{throw new Error(_0xa227('0xba'));}})[_0xa227('0xbb')](function(_0x37fea3,_0x2bf1ae){if(_0x2bf1ae){return _0x37fea3;}return db[_0xa227('0xa1')][_0xa227('0x57')]({'direction':_0xa227('0xb8'),'read':![],'body':_0x22d173[_0xa227('0x61')][_0xa227('0xa9')][0x0][_0xa227('0xb9')],'FaxAccountId':_0x564c01['id'],'FaxInteractionId':_0x37fea3['id'],'UserId':_0x22d173[_0xa227('0x58')]['id'],'ContactId':_0x37fea3[_0xa227('0xbc')],'AttachmentId':_0x22d173[_0xa227('0x61')][_0xa227('0xa9')][0x0]['id']})[_0xa227('0x36')](function(_0x11eb9a){_0x37fea3[_0xa227('0xbd')][_0xa227('0xbe')]=[];_0x37fea3['dataValues'][_0xa227('0xbe')][_0xa227('0x8c')](_0x11eb9a[_0xa227('0xbd')]);return _0x37fea3;});})[_0xa227('0x36')](function(_0x4bc5b4){respondWithRpcPromise(_0xa227('0xbf'),_0xa227('0xbf'),{'FaxAccountId':_[_0xa227('0xaf')](_0x22d173[_0xa227('0x62')]['id'])?undefined:_0x22d173[_0xa227('0x62')]['id'],'path':_['isNil'](_0x22d173[_0xa227('0x61')]['attachments'][0x0][_0xa227('0x5')])?undefined:_0x22d173['body']['attachments'][0x0]['path'],'fax':_[_0xa227('0xaf')](_0x22d173[_0xa227('0x61')]['to'][0x0])?undefined:_0x22d173[_0xa227('0x61')]['to'][0x0],'AttachmentId':_0x22d173[_0xa227('0x61')][_0xa227('0xa9')][0x0]['id']},client9002)[_0xa227('0x36')](function(_0x1acf46){logger[_0xa227('0x26')]('SendFaxRpc,\x20%s',_0x1acf46);})[_0xa227('0x28')](function(_0x53a6b3){logger[_0xa227('0x26')]('SendFaxRpc,\x20%s',_0x53a6b3);});return _0x4bc5b4;})[_0xa227('0x36')](respondWithResult(_0xa4b359,null))['catch'](handleError(_0xa4b359,null));};exports['addAgents']=function(_0x53d567,_0x1d6155,_0x2b4a7c){return db[_0xa227('0x3b')][_0xa227('0x56')]({'where':{'id':_0x53d567[_0xa227('0x62')]['id']}})[_0xa227('0x36')](handleEntityNotFound(_0x1d6155,null))[_0xa227('0x36')](function(_0x2db1a1){if(_0x2db1a1){return _0x2db1a1[_0xa227('0xc0')](_0x53d567['body'][_0xa227('0x6b')],_['omit'](_0x53d567['body'],['ids','id'])||{})[_0xa227('0xbb')](function(_0x47be8b){for(var _0xc06cf7=0x0;_0xc06cf7<_0x53d567[_0xa227('0x61')]['ids'][_0xa227('0x47')];_0xc06cf7+=0x1){socket[_0xa227('0xc1')](_0xa227('0xc2'),{'UserId':Number(_0x53d567[_0xa227('0x61')]['ids'][_0xc06cf7]),'FaxAccountId':Number(_0x53d567[_0xa227('0x62')]['id'])});}return _0x47be8b;});}})[_0xa227('0x36')](respondWithResult(_0x1d6155,null))['catch'](handleError(_0x1d6155,null));};exports[_0xa227('0xc3')]=function(_0x59cbb0,_0x484171,_0x4c1359){return db['FaxAccount'][_0xa227('0x56')]({'where':{'id':_0x59cbb0[_0xa227('0x62')]['id']}})[_0xa227('0x36')](handleEntityNotFound(_0x484171,null))[_0xa227('0x36')](function(_0x349018){if(_0x349018){return _0x349018['removeAgents'](_0x59cbb0[_0xa227('0x41')]['ids'])[_0xa227('0x36')](function(){if(_['isArray'](_0x59cbb0[_0xa227('0x41')][_0xa227('0x6b')])){for(var _0x5616f1=0x0;_0x5616f1<_0x59cbb0[_0xa227('0x41')][_0xa227('0x6b')][_0xa227('0x47')];_0x5616f1+=0x1){socket[_0xa227('0xc1')](_0xa227('0xc4'),{'UserId':Number(_0x59cbb0['query']['ids'][_0x5616f1]),'FaxAccountId':Number(_0x59cbb0[_0xa227('0x62')]['id'])});}}else{socket[_0xa227('0xc1')](_0xa227('0xc4'),{'UserId':Number(_0x59cbb0[_0xa227('0x41')][_0xa227('0x6b')]),'FaxAccountId':Number(_0x59cbb0[_0xa227('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x484171,null))[_0xa227('0x28')](handleError(_0x484171,null));};exports['getAgents']=function(_0x58e2bc,_0x43f711,_0x2be215){var _0x29d19c={};var _0x4ae2db={};var _0x5849f0;var _0x5d04d0;return db['FaxAccount'][_0xa227('0x72')]({'where':{'id':_0x58e2bc[_0xa227('0x62')]['id']}})[_0xa227('0x36')](handleEntityNotFound(_0x43f711,null))[_0xa227('0x36')](function(_0x3db87d){if(_0x3db87d){_0x5849f0=_0x3db87d;_0x4ae2db[_0xa227('0x40')]=_['keys'](db['User']['rawAttributes']);_0x4ae2db[_0xa227('0x41')]=_['keys'](_0x58e2bc['query']);_0x4ae2db['filters']=_[_0xa227('0x44')](_0x4ae2db[_0xa227('0x40')],_0x4ae2db[_0xa227('0x41')]);_0x29d19c[_0xa227('0x45')]=_[_0xa227('0x44')](_0x4ae2db['model'],qs['fields'](_0x58e2bc[_0xa227('0x41')][_0xa227('0x46')]));_0x29d19c[_0xa227('0x45')]=_0x29d19c[_0xa227('0x45')][_0xa227('0x47')]?_0x29d19c[_0xa227('0x45')]:_0x4ae2db['model'];_0x29d19c[_0xa227('0x4a')]=qs[_0xa227('0x4b')](_0x58e2bc[_0xa227('0x41')][_0xa227('0x4b')]);_0x29d19c[_0xa227('0x4c')]=qs['filters'](_[_0xa227('0x4d')](_0x58e2bc[_0xa227('0x41')],_0x4ae2db[_0xa227('0x43')]));if(_0x58e2bc[_0xa227('0x41')]['filter']){_0x29d19c[_0xa227('0x4c')]=_[_0xa227('0x50')](_0x29d19c[_0xa227('0x4c')],{'$or':_[_0xa227('0x3a')](_0x29d19c[_0xa227('0x45')],function(_0x37c201){var _0x55ea9a={};_0x55ea9a[_0x37c201]={'$like':'%'+_0x58e2bc[_0xa227('0x41')][_0xa227('0x4e')]+'%'};return _0x55ea9a;})});}_0x29d19c=_['merge']({},_0x29d19c,_0x58e2bc[_0xa227('0x51')]);return _0x5849f0['getAgents'](_0x29d19c);}})['then'](function(_0x435d6d){if(_0x435d6d){_0x5d04d0=_0x435d6d['length'];if(!_0x58e2bc[_0xa227('0x41')][_0xa227('0x48')](_0xa227('0x49'))){_0x29d19c[_0xa227('0x2e')]=qs[_0xa227('0x2e')](_0x58e2bc[_0xa227('0x41')][_0xa227('0x2e')]);_0x29d19c[_0xa227('0x2c')]=qs[_0xa227('0x2c')](_0x58e2bc[_0xa227('0x41')][_0xa227('0x2c')]);}return _0x5849f0[_0xa227('0xc5')](_0x29d19c);}})['then'](function(_0x3bbc76){if(_0x3bbc76){return _0x3bbc76?{'count':_0x5d04d0,'rows':_0x3bbc76}:null;}})[_0xa227('0x36')](respondWithResult(_0x43f711,null))[_0xa227('0x28')](handleError(_0x43f711,null));}; \ No newline at end of file +var _0x884c=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','options','FaxAccount','includeAll','include','findAll','rows','catch','params','rawAttributes','merge','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','Contact','internal','Tag','color','tag','addApplications','sequelize','transaction','READ_COMMITTED','FaxApplication','bulkCreate','priority','finally','getApplications','exten','localstationid','app','system','Fax\x20Extension','appdata','push','Answer','gateway','faxdetect','maxrate','modem','t38timeout','FAXOPT(','Set','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','findById','FaxMessage','$gte','split','format','CmList','CmContact','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','ListId','out','Messages','Contact\x20not\x20found','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','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','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','count','limit','set','Content-Range','reject','save','update','destroy','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','fieldName','key','model','map','query','keys','filters','intersection'];(function(_0x100415,_0x4c109b){var _0x508f5c=function(_0x397d08){while(--_0x397d08){_0x100415['push'](_0x100415['shift']());}};_0x508f5c(++_0x4c109b);}(_0x884c,0x77));var _0xc884=function(_0x4951e4,_0x17641d){_0x4951e4=_0x4951e4-0x0;var _0xb1cc7e=_0x884c[_0x4951e4];return _0xb1cc7e;};'use strict';var emlformat=require(_0xc884('0x0'));var rimraf=require(_0xc884('0x1'));var zipdir=require(_0xc884('0x2'));var jsonpatch=require(_0xc884('0x3'));var rp=require('request-promise');var moment=require(_0xc884('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc884('0x5'));var sox=require(_0xc884('0x6'));var csv=require(_0xc884('0x7'));var ejs=require(_0xc884('0x8'));var fs=require('fs');var fs_extra=require(_0xc884('0x9'));var _=require('lodash');var squel=require(_0xc884('0xa'));var crypto=require(_0xc884('0xb'));var jsforce=require(_0xc884('0xc'));var deskjs=require(_0xc884('0xd'));var toCsv=require(_0xc884('0x7'));var querystring=require(_0xc884('0xe'));var Papa=require(_0xc884('0xf'));var Redis=require('ioredis');var authService=require(_0xc884('0x10'));var qs=require(_0xc884('0x11'));var as=require(_0xc884('0x12'));var hardwareService=require(_0xc884('0x13'));var logger=require(_0xc884('0x14'))(_0xc884('0x15'));var utils=require('../../config/utils');var config=require(_0xc884('0x16'));var licenseUtil=require(_0xc884('0x17'));var db=require('../../mysqldb')['db'];config[_0xc884('0x18')]=_[_0xc884('0x19')](config[_0xc884('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xc884('0x1a'))(new Redis(config[_0xc884('0x18')]));require('./faxAccount.socket')[_0xc884('0x1b')](socket);var jayson=require(_0xc884('0x1c'));var client=jayson[_0xc884('0x1d')][_0xc884('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xc884('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3edccf,_0x1cddf2,_0x931036,_0x26ff11){return new BPromise(function(_0x559000,_0x2f5c15){var _0x3da5f5=_0x26ff11||client;return _0x3da5f5[_0xc884('0x1f')](_0x3edccf,_0x931036)[_0xc884('0x20')](function(_0x11bbcb){logger[_0xc884('0x21')](_0xc884('0x22'),_0x1cddf2,_0xc884('0x23'));logger[_0xc884('0x24')](_0xc884('0x25'),_0x1cddf2,'request\x20sent',JSON[_0xc884('0x26')](_0x11bbcb));if(_0x11bbcb[_0xc884('0x27')]){if(_0x11bbcb[_0xc884('0x27')][_0xc884('0x28')]===0x1f4){logger['error'](_0xc884('0x22'),_0x1cddf2,_0x11bbcb[_0xc884('0x27')][_0xc884('0x29')]);return _0x2f5c15(_0x11bbcb[_0xc884('0x27')][_0xc884('0x29')]);}logger[_0xc884('0x27')]('FaxAccount,\x20%s,\x20%s',_0x1cddf2,_0x11bbcb[_0xc884('0x27')][_0xc884('0x29')]);return _0x559000(_0x11bbcb[_0xc884('0x27')][_0xc884('0x29')]);}else{logger[_0xc884('0x21')](_0xc884('0x22'),_0x1cddf2,_0xc884('0x23'));_0x559000(_0x11bbcb['result'][_0xc884('0x29')]);}})['catch'](function(_0x453009){logger[_0xc884('0x27')]('FaxAccount,\x20%s,\x20%s',_0x1cddf2,_0x453009);_0x2f5c15(_0x453009);});});}function respondWithStatusCode(_0x3baaf0,_0xa641b2){_0xa641b2=_0xa641b2||0xcc;return function(_0x1ee00f){if(_0x1ee00f){return _0x3baaf0[_0xc884('0x2a')](_0xa641b2);}return _0x3baaf0[_0xc884('0x2b')](_0xa641b2)[_0xc884('0x2c')]();};}function respondWithResult(_0x15db86,_0x4a29d4){_0x4a29d4=_0x4a29d4||0xc8;return function(_0x376682){if(_0x376682){return _0x15db86[_0xc884('0x2b')](_0x4a29d4)[_0xc884('0x2d')](_0x376682);}};}function respondWithFilteredResult(_0x5f3d0e,_0x254c88){return function(_0x4e6f17){if(_0x4e6f17){var _0x1dc111=typeof _0x254c88[_0xc884('0x2e')]==='undefined'&&typeof _0x254c88['limit']==='undefined';var _0x27ac24=_0x4e6f17[_0xc884('0x2f')];var _0xe3ab6a=_0x1dc111?0x0:_0x254c88[_0xc884('0x2e')];var _0x3bdfb5=_0x1dc111?_0x4e6f17[_0xc884('0x2f')]:_0x254c88[_0xc884('0x2e')]+_0x254c88[_0xc884('0x30')];var _0x4eeda5;if(_0x3bdfb5>=_0x27ac24){_0x3bdfb5=_0x27ac24;_0x4eeda5=0xc8;}else{_0x4eeda5=0xce;}_0x5f3d0e[_0xc884('0x2b')](_0x4eeda5);return _0x5f3d0e[_0xc884('0x31')](_0xc884('0x32'),_0xe3ab6a+'-'+_0x3bdfb5+'/'+_0x27ac24)[_0xc884('0x2d')](_0x4e6f17);}return null;};}function patchUpdates(_0x56f8d2){return function(_0x3b0553){try{jsonpatch['apply'](_0x3b0553,_0x56f8d2,!![]);}catch(_0x48beec){return BPromise[_0xc884('0x33')](_0x48beec);}return _0x3b0553[_0xc884('0x34')]();};}function saveUpdates(_0x3c7acd,_0x33a81f){return function(_0x720d1f){if(_0x720d1f){return _0x720d1f[_0xc884('0x35')](_0x3c7acd)[_0xc884('0x20')](function(_0x42e38a){return _0x42e38a;});}return null;};}function removeEntity(_0x27a21d,_0x1f5822){return function(_0x183936){if(_0x183936){return _0x183936[_0xc884('0x36')]()[_0xc884('0x20')](function(){var _0x236f42=_0x183936['get']({'plain':!![]});var _0x3e6690=_0xc884('0x37');return db[_0xc884('0x38')][_0xc884('0x36')]({'where':{'type':_0x3e6690,'resourceId':_0x236f42['id']}})[_0xc884('0x20')](function(){return _0x183936;});})['then'](function(){_0x27a21d[_0xc884('0x2b')](0xcc)[_0xc884('0x2c')]();});}};}function handleEntityNotFound(_0x2ca9b4,_0x30339d){return function(_0x24bef8){if(!_0x24bef8){_0x2ca9b4[_0xc884('0x2a')](0x194);}return _0x24bef8;};}function handleError(_0x352a9e,_0x16ed73){_0x16ed73=_0x16ed73||0x1f4;return function(_0x1d1643){logger['error'](_0x1d1643[_0xc884('0x39')]);if(_0x1d1643[_0xc884('0x3a')]){delete _0x1d1643['name'];}_0x352a9e['status'](_0x16ed73)[_0xc884('0x3b')](_0x1d1643);};}exports[_0xc884('0x3c')]=function(_0x4f88e4,_0x51f30f){var _0x40f06d={'include':[{'model':db[_0xc884('0x3d')],'as':_0xc884('0x3e')}]},_0x111d3b={},_0x59ec93={'count':0x0,'rows':[]};var _0x1e6b06=_['map'](db['FaxAccount']['rawAttributes'],function(_0x366343){return{'name':_0x366343[_0xc884('0x3f')],'type':_0x366343['type'][_0xc884('0x40')]};});_0x111d3b[_0xc884('0x41')]=_[_0xc884('0x42')](_0x1e6b06,_0xc884('0x3a'));_0x111d3b[_0xc884('0x43')]=_[_0xc884('0x44')](_0x4f88e4[_0xc884('0x43')]);_0x111d3b[_0xc884('0x45')]=_[_0xc884('0x46')](_0x111d3b[_0xc884('0x41')],_0x111d3b['query']);_0x40f06d[_0xc884('0x47')]=_[_0xc884('0x46')](_0x111d3b[_0xc884('0x41')],qs[_0xc884('0x48')](_0x4f88e4[_0xc884('0x43')][_0xc884('0x48')]));_0x40f06d[_0xc884('0x47')]=_0x40f06d[_0xc884('0x47')][_0xc884('0x49')]?_0x40f06d[_0xc884('0x47')]:_0x111d3b['model'];if(!_0x4f88e4[_0xc884('0x43')][_0xc884('0x4a')](_0xc884('0x4b'))){_0x40f06d[_0xc884('0x30')]=qs[_0xc884('0x30')](_0x4f88e4[_0xc884('0x43')][_0xc884('0x30')]);_0x40f06d['offset']=qs[_0xc884('0x2e')](_0x4f88e4[_0xc884('0x43')][_0xc884('0x2e')]);}_0x40f06d[_0xc884('0x4c')]=qs[_0xc884('0x4d')](_0x4f88e4[_0xc884('0x43')][_0xc884('0x4d')]);_0x40f06d['where']=qs[_0xc884('0x45')](_[_0xc884('0x4e')](_0x4f88e4['query'],_0x111d3b['filters']),_0x1e6b06);if(_0x4f88e4[_0xc884('0x43')][_0xc884('0x4f')]){_0x40f06d[_0xc884('0x50')]=_['merge'](_0x40f06d[_0xc884('0x50')],{'$or':_[_0xc884('0x42')](_0x1e6b06,function(_0x116553){if(_0x116553[_0xc884('0x51')]!=='VIRTUAL'){var _0xc50653={};_0xc50653[_0x116553[_0xc884('0x3a')]]={'$like':'%'+_0x4f88e4['query']['filter']+'%'};return _0xc50653;}})});}_0x40f06d=_['merge']({},_0x40f06d,_0x4f88e4[_0xc884('0x52')]);var _0x1d2ade={'where':_0x40f06d['where']};return db[_0xc884('0x53')][_0xc884('0x2f')](_0x1d2ade)[_0xc884('0x20')](function(_0x149c0e){_0x59ec93[_0xc884('0x2f')]=_0x149c0e;if(_0x4f88e4['query'][_0xc884('0x54')]){_0x40f06d[_0xc884('0x55')]=[{'all':!![]}];}return db[_0xc884('0x53')][_0xc884('0x56')](_0x40f06d);})['then'](function(_0x59b1ec){_0x59ec93[_0xc884('0x57')]=_0x59b1ec;return _0x59ec93;})[_0xc884('0x20')](respondWithFilteredResult(_0x51f30f,_0x40f06d))[_0xc884('0x58')](handleError(_0x51f30f,null));};exports['show']=function(_0xfce5be,_0x3a3ff2){var _0x23d134={'raw':![],'where':{'id':_0xfce5be[_0xc884('0x59')]['id']},'include':[{'model':db[_0xc884('0x3d')],'as':_0xc884('0x3e')}]},_0x2ba95e={};_0x2ba95e[_0xc884('0x41')]=_[_0xc884('0x44')](db['FaxAccount'][_0xc884('0x5a')]);_0x2ba95e[_0xc884('0x43')]=_[_0xc884('0x44')](_0xfce5be[_0xc884('0x43')]);_0x2ba95e[_0xc884('0x45')]=_[_0xc884('0x46')](_0x2ba95e[_0xc884('0x41')],_0x2ba95e[_0xc884('0x43')]);_0x23d134[_0xc884('0x47')]=_[_0xc884('0x46')](_0x2ba95e['model'],qs['fields'](_0xfce5be['query'][_0xc884('0x48')]));_0x23d134[_0xc884('0x47')]=_0x23d134[_0xc884('0x47')][_0xc884('0x49')]?_0x23d134[_0xc884('0x47')]:_0x2ba95e[_0xc884('0x41')];if(_0xfce5be[_0xc884('0x43')][_0xc884('0x54')]){_0x23d134['include']=[{'all':!![]}];}_0x23d134=_[_0xc884('0x5b')]({},_0x23d134,_0xfce5be['options']);return db[_0xc884('0x53')][_0xc884('0x5c')](_0x23d134)[_0xc884('0x20')](handleEntityNotFound(_0x3a3ff2,null))['then'](respondWithResult(_0x3a3ff2,null))['catch'](handleError(_0x3a3ff2,null));};exports['create']=function(_0x2a400f,_0x21c20e){return db[_0xc884('0x53')][_0xc884('0x5d')](_0x2a400f['body'],{})['then'](function(_0x84bc55){var _0x1dac62=_0x2a400f['user'][_0xc884('0x5e')]({'plain':!![]});if(!_0x1dac62)throw new Error(_0xc884('0x5f'));if(_0x1dac62['role']===_0xc884('0x60')){var _0xebe2bb=_0x84bc55[_0xc884('0x5e')]({'plain':!![]});var _0x433e32=_0xc884('0x37');return db[_0xc884('0x61')]['find']({'where':{'name':_0x433e32,'userProfileId':_0x1dac62[_0xc884('0x62')]},'raw':!![]})[_0xc884('0x20')](function(_0x5156ea){if(_0x5156ea&&_0x5156ea[_0xc884('0x63')]===0x0){return db[_0xc884('0x38')][_0xc884('0x5d')]({'name':_0xebe2bb[_0xc884('0x3a')],'resourceId':_0xebe2bb['id'],'type':_0x5156ea['name'],'sectionId':_0x5156ea['id']},{})[_0xc884('0x20')](function(){return _0x84bc55;});}else{return _0x84bc55;}})['catch'](function(_0x5343c5){logger['error'](_0xc884('0x64'),_0x5343c5);throw _0x5343c5;});}return _0x84bc55;})['then'](respondWithResult(_0x21c20e,0xc9))['catch'](handleError(_0x21c20e,null));};exports[_0xc884('0x35')]=function(_0x475925,_0x39ed36){if(_0x475925[_0xc884('0x65')]['id']){delete _0x475925[_0xc884('0x65')]['id'];}return db[_0xc884('0x53')]['find']({'where':{'id':_0x475925[_0xc884('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0xc884('0x3e')}]})['then'](handleEntityNotFound(_0x39ed36,null))['then'](saveUpdates(_0x475925[_0xc884('0x65')],null))['then'](respondWithResult(_0x39ed36,null))[_0xc884('0x58')](handleError(_0x39ed36,null));};exports['destroy']=function(_0x336e71,_0x289bf4){return db[_0xc884('0x53')]['find']({'where':{'id':_0x336e71[_0xc884('0x59')]['id']}})['then'](handleEntityNotFound(_0x289bf4,null))[_0xc884('0x20')](removeEntity(_0x289bf4,null))[_0xc884('0x58')](handleError(_0x289bf4,null));};exports[_0xc884('0x66')]=function(_0x4b88f7,_0x1ced8c){return db[_0xc884('0x53')][_0xc884('0x66')]()['then'](respondWithResult(_0x1ced8c,null))[_0xc884('0x58')](handleError(_0x1ced8c,null));};exports[_0xc884('0x67')]=function(_0x1675df,_0x2c48e1,_0x34d54d){if(_0x1675df['body']['id']){delete _0x1675df['body']['id'];}return db[_0xc884('0x53')][_0xc884('0x5c')]({'where':{'id':_0x1675df[_0xc884('0x59')]['id']}})[_0xc884('0x20')](handleEntityNotFound(_0x2c48e1,null))['then'](function(_0x381908){if(_0x381908){_0x1675df[_0xc884('0x65')][_0xc884('0x68')]=_0x381908['id'];return db[_0xc884('0x69')][_0xc884('0x5d')](_0x1675df[_0xc884('0x65')]);}})[_0xc884('0x20')](respondWithResult(_0x2c48e1,null))['catch'](handleError(_0x2c48e1,null));};exports[_0xc884('0x6a')]=function(_0x370c62,_0x4a2023,_0x11f5b5){var _0xd3bc15={'raw':![],'where':{}};var _0x1daaff={};var _0x47b862={'count':0x0,'rows':[]};return db[_0xc884('0x53')][_0xc884('0x6b')]({'where':{'id':_0x370c62[_0xc884('0x59')]['id']}})[_0xc884('0x20')](handleEntityNotFound(_0x4a2023,null))[_0xc884('0x20')](function(_0x31af11){if(_0x31af11){_0x1daaff[_0xc884('0x41')]=_[_0xc884('0x44')](db[_0xc884('0x69')][_0xc884('0x5a')]);_0x1daaff['query']=_[_0xc884('0x44')](_0x370c62[_0xc884('0x43')]);_0x1daaff[_0xc884('0x45')]=_[_0xc884('0x46')](_0x1daaff[_0xc884('0x41')],_0x1daaff[_0xc884('0x43')]);_0xd3bc15[_0xc884('0x47')]=_[_0xc884('0x46')](_0x1daaff['model'],qs[_0xc884('0x48')](_0x370c62['query']['fields']));_0xd3bc15['attributes']=_0xd3bc15[_0xc884('0x47')][_0xc884('0x49')]?_0xd3bc15[_0xc884('0x47')]:_0x1daaff[_0xc884('0x41')];if(!_0x370c62[_0xc884('0x43')]['hasOwnProperty']('nolimit')){_0xd3bc15[_0xc884('0x30')]=qs[_0xc884('0x30')](_0x370c62[_0xc884('0x43')][_0xc884('0x30')]);_0xd3bc15[_0xc884('0x2e')]=qs[_0xc884('0x2e')](_0x370c62[_0xc884('0x43')]['offset']);}_0xd3bc15['order']=qs[_0xc884('0x4d')](_0x370c62[_0xc884('0x43')][_0xc884('0x4d')]);_0xd3bc15[_0xc884('0x50')]=qs['filters'](_[_0xc884('0x4e')](_0x370c62[_0xc884('0x43')],_0x1daaff[_0xc884('0x45')]));_0xd3bc15['where'][_0xc884('0x68')]=_0x31af11['id'];if(_0x370c62[_0xc884('0x43')][_0xc884('0x4f')]){_0xd3bc15[_0xc884('0x50')]=_[_0xc884('0x5b')](_0xd3bc15[_0xc884('0x50')],{'$or':_['map'](_0xd3bc15[_0xc884('0x47')],function(_0x57cc4d){var _0x3b7a49={};_0x3b7a49[_0x57cc4d]={'$like':'%'+_0x370c62[_0xc884('0x43')][_0xc884('0x4f')]+'%'};return _0x3b7a49;})});}_0xd3bc15=_[_0xc884('0x5b')]({},_0xd3bc15,_0x370c62[_0xc884('0x52')]);return db[_0xc884('0x69')][_0xc884('0x2f')]({'where':_0xd3bc15[_0xc884('0x50')]})['then'](function(_0x1ad228){_0x47b862[_0xc884('0x2f')]=_0x1ad228;if(_0x370c62['query']['includeAll']){_0xd3bc15[_0xc884('0x55')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0xd3bc15);})[_0xc884('0x20')](function(_0x3f78a7){_0x47b862[_0xc884('0x57')]=_0x3f78a7;return _0x47b862;});}})[_0xc884('0x20')](respondWithFilteredResult(_0x4a2023,_0xd3bc15))[_0xc884('0x58')](handleError(_0x4a2023,null));};exports[_0xc884('0x6c')]=function(_0x410b00,_0x51144b,_0x388138){return db[_0xc884('0x53')][_0xc884('0x5c')]({'where':{'id':_0x410b00[_0xc884('0x59')]['id']}})[_0xc884('0x20')](handleEntityNotFound(_0x51144b,null))['then'](function(_0x39b6b0){if(_0x39b6b0){return _0x39b6b0[_0xc884('0x6c')](_0x410b00[_0xc884('0x43')][_0xc884('0x6d')]);}})['then'](respondWithStatusCode(_0x51144b,null))[_0xc884('0x58')](handleError(_0x51144b,null));};exports[_0xc884('0x6e')]=function(_0x309528,_0x3a3894,_0x4e64aa){if(_0x309528[_0xc884('0x65')]['id']){delete _0x309528[_0xc884('0x65')]['id'];}return db[_0xc884('0x53')][_0xc884('0x5c')]({'where':{'id':_0x309528[_0xc884('0x59')]['id']}})['then'](handleEntityNotFound(_0x3a3894,null))[_0xc884('0x20')](function(_0xb10eb){if(_0xb10eb){_0x309528[_0xc884('0x65')][_0xc884('0x68')]=_0xb10eb['id'];return db[_0xc884('0x6f')]['create'](_0x309528[_0xc884('0x65')]);}})['then'](respondWithResult(_0x3a3894,null))[_0xc884('0x58')](handleError(_0x3a3894,null));};exports[_0xc884('0x70')]=function(_0x195033,_0x28c299,_0x1f9788){var _0x3bc2b1={'raw':![],'where':{}};var _0xb9f9a4={};var _0x218ee4={'count':0x0,'rows':[]};return db[_0xc884('0x53')][_0xc884('0x6b')]({'where':{'id':_0x195033[_0xc884('0x59')]['id']}})[_0xc884('0x20')](handleEntityNotFound(_0x28c299,null))[_0xc884('0x20')](function(_0x3b5274){if(_0x3b5274){_0xb9f9a4['model']=_['keys'](db['CannedAnswer'][_0xc884('0x5a')]);_0xb9f9a4[_0xc884('0x43')]=_[_0xc884('0x44')](_0x195033[_0xc884('0x43')]);_0xb9f9a4[_0xc884('0x45')]=_[_0xc884('0x46')](_0xb9f9a4[_0xc884('0x41')],_0xb9f9a4['query']);_0x3bc2b1[_0xc884('0x47')]=_['intersection'](_0xb9f9a4[_0xc884('0x41')],qs[_0xc884('0x48')](_0x195033['query']['fields']));_0x3bc2b1[_0xc884('0x47')]=_0x3bc2b1[_0xc884('0x47')][_0xc884('0x49')]?_0x3bc2b1[_0xc884('0x47')]:_0xb9f9a4[_0xc884('0x41')];if(!_0x195033['query'][_0xc884('0x4a')](_0xc884('0x4b'))){_0x3bc2b1[_0xc884('0x30')]=qs['limit'](_0x195033[_0xc884('0x43')][_0xc884('0x30')]);_0x3bc2b1[_0xc884('0x2e')]=qs[_0xc884('0x2e')](_0x195033[_0xc884('0x43')][_0xc884('0x2e')]);}_0x3bc2b1[_0xc884('0x4c')]=qs[_0xc884('0x4d')](_0x195033[_0xc884('0x43')]['sort']);_0x3bc2b1[_0xc884('0x50')]=qs[_0xc884('0x45')](_[_0xc884('0x4e')](_0x195033[_0xc884('0x43')],_0xb9f9a4[_0xc884('0x45')]));_0x3bc2b1[_0xc884('0x50')]['FaxAccountId']=_0x3b5274['id'];if(_0x195033[_0xc884('0x43')][_0xc884('0x4f')]){_0x3bc2b1[_0xc884('0x50')]=_[_0xc884('0x5b')](_0x3bc2b1['where'],{'$or':_['map'](_0x3bc2b1[_0xc884('0x47')],function(_0x4a4fd6){var _0x43e017={};_0x43e017[_0x4a4fd6]={'$like':'%'+_0x195033['query'][_0xc884('0x4f')]+'%'};return _0x43e017;})});}_0x3bc2b1=_['merge']({},_0x3bc2b1,_0x195033[_0xc884('0x52')]);return db['CannedAnswer'][_0xc884('0x2f')]({'where':_0x3bc2b1[_0xc884('0x50')]})[_0xc884('0x20')](function(_0xbeccab){_0x218ee4[_0xc884('0x2f')]=_0xbeccab;if(_0x195033[_0xc884('0x43')]['includeAll']){_0x3bc2b1[_0xc884('0x55')]=[{'all':!![]}];}return db[_0xc884('0x6f')][_0xc884('0x56')](_0x3bc2b1);})[_0xc884('0x20')](function(_0x5dbd4c){_0x218ee4[_0xc884('0x57')]=_0x5dbd4c;return _0x218ee4;});}})[_0xc884('0x20')](respondWithFilteredResult(_0x28c299,_0x3bc2b1))[_0xc884('0x58')](handleError(_0x28c299,null));};exports[_0xc884('0x71')]=function(_0x1b7514,_0x478df1,_0x19a68a){return db[_0xc884('0x53')][_0xc884('0x5c')]({'where':{'id':_0x1b7514['params']['id']}})[_0xc884('0x20')](handleEntityNotFound(_0x478df1,null))[_0xc884('0x20')](function(_0x56ea5a){if(_0x56ea5a){return _0x56ea5a['removeAnswers'](_0x1b7514[_0xc884('0x43')]['ids']);}})[_0xc884('0x20')](respondWithStatusCode(_0x478df1,null))[_0xc884('0x58')](handleError(_0x478df1,null));};exports['addInteraction']=function(_0x29929c,_0x1f5ebe,_0x4f1921){return db[_0xc884('0x72')][_0xc884('0x5c')]({'where':{'id':_0x29929c[_0xc884('0x59')]['id']}})[_0xc884('0x20')](handleEntityNotFound(_0x1f5ebe,null))[_0xc884('0x20')](function(_0x3e5f75){if(_0x3e5f75){return _0x3e5f75[_0xc884('0x73')](_0x29929c[_0xc884('0x65')][_0xc884('0x6d')],_[_0xc884('0x74')](_0x29929c[_0xc884('0x65')],['ids','id'])||{});}})[_0xc884('0x20')](respondWithResult(_0x1f5ebe,null))['catch'](handleError(_0x1f5ebe,null));};exports[_0xc884('0x75')]=function(_0x2122ac,_0x341cdf,_0x289671){var _0x604c4e={'raw':![],'where':{}};var _0x1c4046={};var _0x202e7b={'count':0x0,'rows':[]};return db[_0xc884('0x53')][_0xc884('0x6b')]({'where':{'id':_0x2122ac[_0xc884('0x59')]['id']}})[_0xc884('0x20')](handleEntityNotFound(_0x341cdf,null))[_0xc884('0x20')](function(_0x2f7ebb){if(_0x2f7ebb){_0x1c4046[_0xc884('0x41')]=_['keys'](db[_0xc884('0x72')][_0xc884('0x5a')]);_0x1c4046['query']=_[_0xc884('0x44')](_0x2122ac['query']);_0x1c4046['filters']=_[_0xc884('0x46')](_0x1c4046[_0xc884('0x41')],_0x1c4046[_0xc884('0x43')]);_0x604c4e[_0xc884('0x47')]=_['intersection'](_0x1c4046[_0xc884('0x41')],qs[_0xc884('0x48')](_0x2122ac[_0xc884('0x43')][_0xc884('0x48')]));_0x604c4e['attributes']=_0x604c4e[_0xc884('0x47')][_0xc884('0x49')]?_0x604c4e[_0xc884('0x47')]:_0x1c4046[_0xc884('0x41')];if(!_0x2122ac[_0xc884('0x43')][_0xc884('0x4a')](_0xc884('0x4b'))){_0x604c4e[_0xc884('0x30')]=qs['limit'](_0x2122ac[_0xc884('0x43')][_0xc884('0x30')]);_0x604c4e[_0xc884('0x2e')]=qs[_0xc884('0x2e')](_0x2122ac[_0xc884('0x43')]['offset']);}_0x604c4e[_0xc884('0x4c')]=qs[_0xc884('0x4d')](_0x2122ac['query'][_0xc884('0x4d')]);_0x604c4e[_0xc884('0x50')]=qs[_0xc884('0x45')](_['pick'](_0x2122ac[_0xc884('0x43')],_0x1c4046[_0xc884('0x45')]));_0x604c4e['where'][_0xc884('0x68')]=_0x2f7ebb['id'];if(_0x2122ac[_0xc884('0x43')]['filter']){_0x604c4e[_0xc884('0x50')]=_[_0xc884('0x5b')](_0x604c4e[_0xc884('0x50')],{'$or':_[_0xc884('0x42')](_0x604c4e[_0xc884('0x47')],function(_0xa1f527){var _0x350369={};_0x350369[_0xa1f527]={'$like':'%'+_0x2122ac[_0xc884('0x43')]['filter']+'%'};return _0x350369;})});}_0x604c4e=_[_0xc884('0x5b')]({},_0x604c4e,_0x2122ac[_0xc884('0x52')]);return db[_0xc884('0x72')]['count']({'where':_0x604c4e[_0xc884('0x50')]})[_0xc884('0x20')](function(_0x6ea773){_0x202e7b[_0xc884('0x2f')]=_0x6ea773;if(_0x2122ac[_0xc884('0x43')]['includeAll']){_0x604c4e[_0xc884('0x55')]=[{'model':db['CmContact'],'as':_0xc884('0x76'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xc884('0x3a'),'fullname',_0xc884('0x77')],'required':![]},{'model':db[_0xc884('0x78')],'as':'Tags','attributes':['id',_0xc884('0x3a'),_0xc884('0x79')],'where':_0x2122ac[_0xc884('0x43')][_0xc884('0x7a')]?{'id':_0x2122ac['query']['tag']}:undefined,'required':_0x2122ac[_0xc884('0x43')][_0xc884('0x7a')]?!![]:![]}];}return db[_0xc884('0x72')]['findAll'](_0x604c4e);})[_0xc884('0x20')](function(_0x2a16de){_0x202e7b['rows']=_0x2a16de;return _0x202e7b;});}})['then'](respondWithFilteredResult(_0x341cdf,_0x604c4e))[_0xc884('0x58')](handleError(_0x341cdf,null));};exports[_0xc884('0x7b')]=function(_0x6c00cf,_0x85707a){var _0x5ab22a=_0x6c00cf[_0xc884('0x59')]['id'];var _0x5bfa50=_0x6c00cf[_0xc884('0x65')];var _0x45256d=0xc8;var _0x4041fc=null;return db[_0xc884('0x7c')][_0xc884('0x7d')]({'isolationLevel':db[_0xc884('0x7c')]['Transaction']['ISOLATION_LEVELS'][_0xc884('0x7e')]},function(_0xddfd30){return db['FaxAccount']['findOne']({'where':{'id':_0x5ab22a},'transaction':_0xddfd30})['then'](function(_0x2e4564){if(_0x2e4564){return db[_0xc884('0x7f')][_0xc884('0x36')]({'where':{'FaxAccountId':_0x5ab22a},'transaction':_0xddfd30})[_0xc884('0x20')](function(){var _0x1488d4=_['map'](_0x5bfa50,function(_0x1d7ca2){_0x1d7ca2[_0xc884('0x68')]=_0x5ab22a;return _0x1d7ca2;});return db[_0xc884('0x7f')][_0xc884('0x80')](_0x1488d4,{'transaction':_0xddfd30});});}else{_0x45256d=0x194;_0x4041fc=[];}});})[_0xc884('0x20')](function(){if(_0x45256d!==0x194){return db[_0xc884('0x7f')]['findAndCountAll']({'where':{'FaxAccountId':_0x5ab22a},'order':_0xc884('0x81')})['then'](function(_0x391621){_0x4041fc=_0x391621;});}})[_0xc884('0x58')](function(_0x38d3ac){_0x45256d=0x1f4;logger[_0xc884('0x27')](_0x38d3ac[_0xc884('0x39')]);if(_0x38d3ac['name']){delete _0x38d3ac['name'];}_0x4041fc=_0x38d3ac;})[_0xc884('0x82')](function(){if(_0x4041fc===null){_0x85707a['sendStatus'](_0x45256d);}else{if(_0x45256d===0x1f4){_0x85707a[_0xc884('0x2b')](_0x45256d)[_0xc884('0x3b')](_0x4041fc);}else{_0x85707a[_0xc884('0x2b')](_0x45256d)[_0xc884('0x2d')](_0x4041fc);}}});};exports[_0xc884('0x83')]=function(_0x326554,_0x5aba1d,_0xadc5f6){var _0x4c699c={};var _0x3d2840={};var _0x103aa9;var _0x48d251;return db[_0xc884('0x53')][_0xc884('0x6b')]({'where':{'id':_0x326554[_0xc884('0x59')]['id']}})[_0xc884('0x20')](handleEntityNotFound(_0x5aba1d,null))[_0xc884('0x20')](function(_0x32c02b){if(_0x32c02b){_0x103aa9=_0x32c02b;_0x3d2840[_0xc884('0x41')]=_['keys'](db[_0xc884('0x7f')][_0xc884('0x5a')]);_0x3d2840[_0xc884('0x43')]=_[_0xc884('0x44')](_0x326554[_0xc884('0x43')]);_0x3d2840['filters']=_[_0xc884('0x46')](_0x3d2840[_0xc884('0x41')],_0x3d2840['query']);_0x4c699c[_0xc884('0x47')]=_[_0xc884('0x46')](_0x3d2840['model'],qs[_0xc884('0x48')](_0x326554['query']['fields']));_0x4c699c[_0xc884('0x47')]=_0x4c699c[_0xc884('0x47')][_0xc884('0x49')]?_0x4c699c['attributes']:_0x3d2840[_0xc884('0x41')];_0x4c699c[_0xc884('0x4c')]=qs['sort'](_0x326554[_0xc884('0x43')][_0xc884('0x4d')]);_0x4c699c[_0xc884('0x50')]=qs['filters'](_[_0xc884('0x4e')](_0x326554[_0xc884('0x43')],_0x3d2840[_0xc884('0x45')]));if(_0x326554[_0xc884('0x43')][_0xc884('0x4f')]){_0x4c699c[_0xc884('0x50')]=_[_0xc884('0x5b')](_0x4c699c[_0xc884('0x50')],{'$or':_[_0xc884('0x42')](_0x4c699c[_0xc884('0x47')],function(_0x566363){var _0x4e768b={};_0x4e768b[_0x566363]={'$like':'%'+_0x326554[_0xc884('0x43')][_0xc884('0x4f')]+'%'};return _0x4e768b;})});}_0x4c699c=_[_0xc884('0x5b')]({},_0x4c699c,_0x326554['options']);return _0x103aa9[_0xc884('0x83')](_0x4c699c);}})[_0xc884('0x20')](function(_0x2c7fb1){if(_0x2c7fb1){_0x48d251=_0x2c7fb1['length'];if(!_0x326554['query'][_0xc884('0x4a')]('nolimit')){_0x4c699c[_0xc884('0x30')]=qs[_0xc884('0x30')](_0x326554[_0xc884('0x43')][_0xc884('0x30')]);_0x4c699c['offset']=qs[_0xc884('0x2e')](_0x326554['query'][_0xc884('0x2e')]);}return _0x103aa9['getApplications'](_0x4c699c);}})['then'](function(_0x2ee6a3){if(_0x2ee6a3){return _0x2ee6a3?{'count':_0x48d251,'rows':_0x2ee6a3}:null;}})[_0xc884('0x20')](respondWithResult(_0x5aba1d,null))[_0xc884('0x58')](handleError(_0x5aba1d,null));};function Extension(_0x1cb2b2,_0x243e0b,_0x86b24e,_0x383849){this['context']='from-voip-provider';this[_0xc884('0x84')]=_0x1cb2b2[_0xc884('0x85')];this[_0xc884('0x86')]=_0x383849;this[_0xc884('0x51')]=_0xc884('0x87');this['description']=_0xc884('0x88');this[_0xc884('0x68')]=_0x1cb2b2['id'];this[_0xc884('0x81')]=_0x243e0b;this[_0xc884('0x89')]=_0x86b24e;}function createExtensionsReciveFax(_0x1bf2ff){var _0x279686=0x1;var _0x36f984=[];_0x36f984[_0xc884('0x8a')](new Extension(_0x1bf2ff,_0x279686,'',_0xc884('0x8b')));_0x279686+=0x1;_0x36f984[_0xc884('0x8a')](new Extension(_0x1bf2ff,_0x279686,'CDR(type)=inbound-fax','Set'));_0x279686+=0x1;for(var _0x1d5d15 in _0x1bf2ff){if(_0x1bf2ff[_0xc884('0x4a')](_0x1d5d15)&&(_0x1d5d15==='ecm'||_0x1d5d15===_0xc884('0x85')||_0x1d5d15===_0xc884('0x8c')||_0x1d5d15===_0xc884('0x8d')||_0x1d5d15==='headerinfo'||_0x1d5d15===_0xc884('0x8e')||_0x1d5d15==='minrate'||_0x1d5d15===_0xc884('0x8f')||_0x1d5d15===_0xc884('0x90'))){_0x36f984['push'](new Extension(_0x1bf2ff,_0x279686,_0xc884('0x91')+_0x1d5d15+')='+_0x1bf2ff[_0x1d5d15],_0xc884('0x92')));_0x279686+=0x1;}}_0x36f984['push'](new Extension(_0x1bf2ff,_0x279686,'6','Wait'));_0x279686+=0x1;_0x36f984['push'](new Extension(_0x1bf2ff,_0x279686,'/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',_0xc884('0x93')));_0x279686=0x0;return _0x36f984;}exports[_0xc884('0x94')]=function(_0x53757d,_0x3425e5,_0x5108a7){var _0x3c6a2b;return db[_0xc884('0x7c')][_0xc884('0x7d')](function(_0x43a0a4){return db[_0xc884('0x53')][_0xc884('0x5d')](_0x53757d[_0xc884('0x65')],{'transaction':_0x43a0a4})['then'](function(_0x1be8b4){_0x3c6a2b=_0x1be8b4[_0xc884('0x5e')]({'plain':!![]});return db[_0xc884('0x95')][_0xc884('0x80')](createExtensionsReciveFax(_0x3c6a2b),{'transaction':_0x43a0a4});});})['then'](function(){return _0x3c6a2b;})['then'](respondWithResult(_0x3425e5,null))[_0xc884('0x58')](handleError(_0x3425e5,null));};exports[_0xc884('0x96')]=function(_0x4b2b1e,_0x3e397a,_0x75aae2){var _0x371906;return db[_0xc884('0x7c')][_0xc884('0x7d')](function(_0xc408d){return db['FaxAccount'][_0xc884('0x35')](_0x4b2b1e[_0xc884('0x65')],{'where':{'id':_0x4b2b1e[_0xc884('0x65')]['id']},'transaction':_0xc408d})[_0xc884('0x20')](function(_0x2e41b3){return db['VoiceExtension'][_0xc884('0x36')]({'where':{'FaxAccountId':_0x4b2b1e[_0xc884('0x65')]['id']},'transaction':_0xc408d})[_0xc884('0x20')](function(_0xbce56d){return db[_0xc884('0x95')][_0xc884('0x80')](createExtensionsReciveFax(_[_0xc884('0x74')](_0x4b2b1e[_0xc884('0x65')],[_0xc884('0x97'),_0xc884('0x40'),_0xc884('0x98'),_0xc884('0x99'),_0xc884('0x9a'),'ListId'])),{'transaction':_0xc408d});});});})['then'](function(){return db[_0xc884('0x53')][_0xc884('0x9b')](_0x4b2b1e[_0xc884('0x65')]['id']);})[_0xc884('0x20')](respondWithResult(_0x3e397a,null))[_0xc884('0x58')](handleError(_0x3e397a,null));};exports['getMessages']=function(_0x1f9a3d,_0x5d968a,_0xb4f36b){var _0x10f3e6={'raw':!![],'where':{}};var _0x29ddb1={};var _0x269327={'count':0x0,'rows':[]};return db[_0xc884('0x53')][_0xc884('0x6b')]({'where':{'id':_0x1f9a3d[_0xc884('0x59')]['id']}})[_0xc884('0x20')](handleEntityNotFound(_0x5d968a,null))[_0xc884('0x20')](function(_0x7d95fa){if(_0x7d95fa){_0x29ddb1[_0xc884('0x41')]=_['keys'](db[_0xc884('0x9c')][_0xc884('0x5a')]);_0x29ddb1[_0xc884('0x43')]=_[_0xc884('0x44')](_0x1f9a3d[_0xc884('0x43')]);_0x29ddb1['filters']=_[_0xc884('0x46')](_0x29ddb1['model'],_0x29ddb1[_0xc884('0x43')]);_0x10f3e6[_0xc884('0x47')]=_[_0xc884('0x46')](_0x29ddb1[_0xc884('0x41')],qs[_0xc884('0x48')](_0x1f9a3d[_0xc884('0x43')]['fields']));_0x10f3e6[_0xc884('0x47')]=_0x10f3e6['attributes']['length']?_0x10f3e6[_0xc884('0x47')]:_0x29ddb1[_0xc884('0x41')];if(!_0x1f9a3d[_0xc884('0x43')][_0xc884('0x4a')](_0xc884('0x4b'))){_0x10f3e6[_0xc884('0x30')]=qs[_0xc884('0x30')](_0x1f9a3d[_0xc884('0x43')][_0xc884('0x30')]);_0x10f3e6[_0xc884('0x2e')]=qs[_0xc884('0x2e')](_0x1f9a3d[_0xc884('0x43')][_0xc884('0x2e')]);}_0x10f3e6[_0xc884('0x4c')]=qs[_0xc884('0x4d')](_0x1f9a3d[_0xc884('0x43')][_0xc884('0x4d')]);_0x10f3e6[_0xc884('0x50')]=qs['filters'](_['pick'](_0x1f9a3d['query'],_0x29ddb1[_0xc884('0x45')]));_0x10f3e6[_0xc884('0x50')][_0xc884('0x68')]=_0x7d95fa['id'];if(_0x1f9a3d['query'][_0xc884('0x4f')]){_0x10f3e6[_0xc884('0x50')]=_['merge'](_0x10f3e6[_0xc884('0x50')],{'$or':_[_0xc884('0x42')](_0x10f3e6['attributes'],function(_0x22e518){var _0x228442={};_0x228442[_0x22e518]={'$like':'%'+_0x1f9a3d[_0xc884('0x43')][_0xc884('0x4f')]+'%'};return _0x228442;})});}if(_0x1f9a3d[_0xc884('0x43')][_0xc884('0x9d')]){var _0x335627=_0x1f9a3d['query'][_0xc884('0x9d')][_0xc884('0x9e')](',');var _0x554d53={};_0x554d53[_0x335627[0x0]]={'$gte':moment(_0x335627[0x1])[_0xc884('0x9f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x10f3e6[_0xc884('0x50')]=_[_0xc884('0x5b')](_0x10f3e6[_0xc884('0x50')],_0x554d53);}_0x10f3e6=_[_0xc884('0x5b')]({},_0x10f3e6,_0x1f9a3d[_0xc884('0x52')]);return db['FaxMessage'][_0xc884('0x2f')]({'where':_0x10f3e6['where']})['then'](function(_0x2629ef){_0x269327[_0xc884('0x2f')]=_0x2629ef;if(_0x1f9a3d[_0xc884('0x43')][_0xc884('0x54')]){_0x10f3e6[_0xc884('0x55')]=[{'all':!![]}];}return db['FaxMessage'][_0xc884('0x56')](_0x10f3e6);})['then'](function(_0xd30e9d){_0x269327[_0xc884('0x57')]=_0xd30e9d;return _0x269327;});}})[_0xc884('0x20')](respondWithFilteredResult(_0x5d968a,_0x10f3e6))[_0xc884('0x58')](handleError(_0x5d968a,null));};exports['send']=function(_0x4213a6,_0x1aa5e4,_0xf46002){var _0x29713a,_0x4fae73={},_0x18897a;if(_0x4213a6[_0xc884('0x65')]['to']){_0x18897a=_0x4213a6[_0xc884('0x65')]['to'][0x0];}return db[_0xc884('0x53')][_0xc884('0x5c')]({'where':{'id':_0x4213a6[_0xc884('0x59')]['id']},'include':[{'model':db[_0xc884('0xa0')],'as':'List','include':[{'model':db[_0xc884('0xa1')],'as':_0xc884('0xa2'),'where':{'fax':_0x18897a},'limit':0x1,'order':[[_0xc884('0x99'),_0xc884('0xa3')]]}]}]})[_0xc884('0x20')](handleEntityNotFound(_0x1aa5e4,null))[_0xc884('0x20')](function(_0x5f028b){_0x29713a=_0x5f028b;if(_0x4213a6[_0xc884('0x65')][_0xc884('0xa4')]&&_0x4213a6['body'][_0xc884('0xa4')][_0xc884('0x49')]){for(var _0x361e41=0x0;_0x361e41<_0x4213a6['body'][_0xc884('0xa4')][_0xc884('0x49')];_0x361e41+=0x1){_0x4213a6[_0xc884('0x65')]['attachments'][_0x361e41]={'filename':_0x4213a6['body'][_0xc884('0xa4')][_0x361e41][_0xc884('0x3a')],'id':_0x4213a6['body'][_0xc884('0xa4')][_0x361e41]['id'],'path':path[_0xc884('0xa5')](config[_0xc884('0xa6')],_0xc884('0xa7'),_0x4213a6[_0xc884('0x65')][_0xc884('0xa4')][_0x361e41]['basename'])};}}return respondWithRpcPromise(_0xc884('0xa8'),_0xc884('0xa8'),{'FaxAccountId':_[_0xc884('0xa9')](_0x4213a6[_0xc884('0x59')]['id'])?undefined:_0x4213a6[_0xc884('0x59')]['id'],'path':_[_0xc884('0xa9')](_0x4213a6['body'][_0xc884('0xa4')][0x0][_0xc884('0x5')])?undefined:_0x4213a6[_0xc884('0x65')]['attachments'][0x0][_0xc884('0x5')],'fax':_['isNil'](_0x4213a6[_0xc884('0x65')]['to'][0x0])?undefined:_0x4213a6['body']['to'][0x0]},client9002);})[_0xc884('0x20')](function(){if(_0x29713a){if(_[_0xc884('0xa9')](_0x4213a6['body'][_0xc884('0xaa')])){_0x4213a6[_0xc884('0x65')][_0xc884('0xaa')]=util['format'](_0xc884('0xab'),_0x29713a[_0xc884('0x3a')],_0x29713a[_0xc884('0xac')]);}if(_0x29713a[_0xc884('0xad')]){if(_0x29713a[_0xc884('0xad')][_0xc884('0xa2')]['length']){return _0x29713a[_0xc884('0xad')][_0xc884('0xa2')][0x0];}else{return db[_0xc884('0xa1')][_0xc884('0x5d')](_[_0xc884('0x19')](_0x4213a6[_0xc884('0x65')],{'firstName':_0x4213a6[_0xc884('0x65')]['to'][0x0],'phone':_0x4213a6['body']['to'][0x0],'fax':_0x4213a6[_0xc884('0x65')]['to'][0x0],'ListId':_0x29713a[_0xc884('0xae')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xc884('0x20')](function(_0x538612){if(_0x538612){return db['FaxInteraction'][_0xc884('0x5c')]({'where':{'ContactId':_0x538612['id'],'closed':![],'FaxAccountId':_0x29713a['id']}})[_0xc884('0x20')](function(_0x1aade6){if(_0x1aade6){return[_0x1aade6,![]];}return db[_0xc884('0x72')][_0xc884('0x5d')]({'UserId':_0x4213a6[_0xc884('0x60')]['id'],'ContactId':_0x538612['id'],'FaxAccountId':_0x29713a['id'],'fax':_0x4213a6[_0xc884('0x65')]['to'][0x0],'firstMsgDirection':_0xc884('0xaf'),'Messages':[_[_0xc884('0x5b')](_0x4213a6[_0xc884('0x65')],{'read':![],'body':_0x4213a6['body'][_0xc884('0xa4')][0x0]['filename'],'FaxAccountId':_0x29713a['id'],'UserId':_0x4213a6[_0xc884('0x60')]['id'],'ContactId':_0x538612['id'],'AttachmentId':_0x4213a6[_0xc884('0x65')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xc884('0x9c')],'as':_0xc884('0xb0')}]})[_0xc884('0x20')](function(_0x4fffaa){return[_0x4fffaa,!![]];});});}else{throw new Error(_0xc884('0xb1'));}})['spread'](function(_0x2d827b,_0x4644ab){if(_0x4644ab){return _0x2d827b;}return db[_0xc884('0x9c')][_0xc884('0x5d')]({'direction':_0xc884('0xaf'),'read':![],'body':_0x4213a6[_0xc884('0x65')][_0xc884('0xa4')][0x0][_0xc884('0xb2')],'FaxAccountId':_0x29713a['id'],'FaxInteractionId':_0x2d827b['id'],'UserId':_0x4213a6[_0xc884('0x60')]['id'],'ContactId':_0x2d827b[_0xc884('0xb3')],'AttachmentId':_0x4213a6[_0xc884('0x65')]['attachments'][0x0]['id']})[_0xc884('0x20')](function(_0x422f65){_0x2d827b['dataValues']['Messages']=[];_0x2d827b[_0xc884('0xb4')][_0xc884('0xb0')][_0xc884('0x8a')](_0x422f65[_0xc884('0xb4')]);return _0x2d827b;});})['then'](function(_0xc106c5){respondWithRpcPromise(_0xc884('0xb5'),_0xc884('0xb5'),{'FaxAccountId':_[_0xc884('0xa9')](_0x4213a6[_0xc884('0x59')]['id'])?undefined:_0x4213a6[_0xc884('0x59')]['id'],'path':_[_0xc884('0xa9')](_0x4213a6[_0xc884('0x65')][_0xc884('0xa4')][0x0]['path'])?undefined:_0x4213a6[_0xc884('0x65')][_0xc884('0xa4')][0x0][_0xc884('0x5')],'fax':_[_0xc884('0xa9')](_0x4213a6[_0xc884('0x65')]['to'][0x0])?undefined:_0x4213a6[_0xc884('0x65')]['to'][0x0],'AttachmentId':_0x4213a6[_0xc884('0x65')]['attachments'][0x0]['id']},client9002)[_0xc884('0x20')](function(_0x2bb722){logger['info'](_0xc884('0xb6'),_0x2bb722);})[_0xc884('0x58')](function(_0x22aeeb){logger[_0xc884('0x21')](_0xc884('0xb6'),_0x22aeeb);});return _0xc106c5;})['then'](respondWithResult(_0x1aa5e4,null))[_0xc884('0x58')](handleError(_0x1aa5e4,null));};exports[_0xc884('0xb7')]=function(_0x4d45a2,_0x40aa82,_0x27baf5){return db[_0xc884('0x53')]['find']({'where':{'id':_0x4d45a2[_0xc884('0x59')]['id']}})[_0xc884('0x20')](handleEntityNotFound(_0x40aa82,null))[_0xc884('0x20')](function(_0x38a601){if(_0x38a601){return _0x38a601[_0xc884('0xb7')](_0x4d45a2[_0xc884('0x65')][_0xc884('0x6d')],_['omit'](_0x4d45a2['body'],[_0xc884('0x6d'),'id'])||{})[_0xc884('0xb8')](function(_0x37cee4){for(var _0x13f5bd=0x0;_0x13f5bd<_0x4d45a2[_0xc884('0x65')]['ids'][_0xc884('0x49')];_0x13f5bd+=0x1){socket[_0xc884('0xb9')]('userFaxAccount:save',{'UserId':Number(_0x4d45a2[_0xc884('0x65')]['ids'][_0x13f5bd]),'FaxAccountId':Number(_0x4d45a2[_0xc884('0x59')]['id'])});}return _0x37cee4;});}})['then'](respondWithResult(_0x40aa82,null))[_0xc884('0x58')](handleError(_0x40aa82,null));};exports['removeAgents']=function(_0x50e930,_0x3f6197,_0x4d1478){return db[_0xc884('0x53')][_0xc884('0x5c')]({'where':{'id':_0x50e930[_0xc884('0x59')]['id']}})['then'](handleEntityNotFound(_0x3f6197,null))['then'](function(_0x2e6a59){if(_0x2e6a59){return _0x2e6a59[_0xc884('0xba')](_0x50e930['query']['ids'])[_0xc884('0x20')](function(){if(_[_0xc884('0xbb')](_0x50e930[_0xc884('0x43')]['ids'])){for(var _0x530040=0x0;_0x530040<_0x50e930[_0xc884('0x43')][_0xc884('0x6d')]['length'];_0x530040+=0x1){socket[_0xc884('0xb9')]('userFaxAccount:remove',{'UserId':Number(_0x50e930[_0xc884('0x43')]['ids'][_0x530040]),'FaxAccountId':Number(_0x50e930[_0xc884('0x59')]['id'])});}}else{socket[_0xc884('0xb9')](_0xc884('0xbc'),{'UserId':Number(_0x50e930[_0xc884('0x43')][_0xc884('0x6d')]),'FaxAccountId':Number(_0x50e930[_0xc884('0x59')]['id'])});}});}})[_0xc884('0x20')](respondWithStatusCode(_0x3f6197,null))['catch'](handleError(_0x3f6197,null));};exports[_0xc884('0xbd')]=function(_0x105582,_0x35ee03,_0x4ebccc){var _0x19dc5c={};var _0x507391={};var _0x45cfdf;var _0x5e6f52;return db[_0xc884('0x53')][_0xc884('0x6b')]({'where':{'id':_0x105582[_0xc884('0x59')]['id']}})['then'](handleEntityNotFound(_0x35ee03,null))[_0xc884('0x20')](function(_0x321208){if(_0x321208){_0x45cfdf=_0x321208;_0x507391[_0xc884('0x41')]=_[_0xc884('0x44')](db['User']['rawAttributes']);_0x507391['query']=_[_0xc884('0x44')](_0x105582['query']);_0x507391[_0xc884('0x45')]=_[_0xc884('0x46')](_0x507391[_0xc884('0x41')],_0x507391['query']);_0x19dc5c[_0xc884('0x47')]=_[_0xc884('0x46')](_0x507391['model'],qs[_0xc884('0x48')](_0x105582[_0xc884('0x43')][_0xc884('0x48')]));_0x19dc5c[_0xc884('0x47')]=_0x19dc5c[_0xc884('0x47')][_0xc884('0x49')]?_0x19dc5c['attributes']:_0x507391[_0xc884('0x41')];_0x19dc5c[_0xc884('0x4c')]=qs[_0xc884('0x4d')](_0x105582['query']['sort']);_0x19dc5c['where']=qs[_0xc884('0x45')](_[_0xc884('0x4e')](_0x105582[_0xc884('0x43')],_0x507391['filters']));if(_0x105582[_0xc884('0x43')][_0xc884('0x4f')]){_0x19dc5c[_0xc884('0x50')]=_[_0xc884('0x5b')](_0x19dc5c['where'],{'$or':_[_0xc884('0x42')](_0x19dc5c[_0xc884('0x47')],function(_0x4e7c10){var _0x29acf5={};_0x29acf5[_0x4e7c10]={'$like':'%'+_0x105582[_0xc884('0x43')]['filter']+'%'};return _0x29acf5;})});}_0x19dc5c=_['merge']({},_0x19dc5c,_0x105582[_0xc884('0x52')]);return _0x45cfdf[_0xc884('0xbd')](_0x19dc5c);}})[_0xc884('0x20')](function(_0xe50258){if(_0xe50258){_0x5e6f52=_0xe50258[_0xc884('0x49')];if(!_0x105582[_0xc884('0x43')][_0xc884('0x4a')](_0xc884('0x4b'))){_0x19dc5c[_0xc884('0x30')]=qs[_0xc884('0x30')](_0x105582['query']['limit']);_0x19dc5c[_0xc884('0x2e')]=qs[_0xc884('0x2e')](_0x105582[_0xc884('0x43')][_0xc884('0x2e')]);}return _0x45cfdf[_0xc884('0xbd')](_0x19dc5c);}})['then'](function(_0x531b3f){if(_0x531b3f){return _0x531b3f?{'count':_0x5e6f52,'rows':_0x531b3f}:null;}})[_0xc884('0x20')](respondWithResult(_0x35ee03,null))[_0xc884('0x58')](handleError(_0x35ee03,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 35af22b..7c49b16 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 _0x8e01=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','update'];(function(_0x1d59b6,_0x2c49d7){var _0x18254f=function(_0x5b0815){while(--_0x5b0815){_0x1d59b6['push'](_0x1d59b6['shift']());}};_0x18254f(++_0x2c49d7);}(_0x8e01,0x1d8));var _0x18e0=function(_0x2c2525,_0xff7c0){_0x2c2525=_0x2c2525-0x0;var _0x2cc103=_0x8e01[_0x2c2525];return _0x2cc103;};'use strict';var EventEmitter=require(_0x18e0('0x0'));var FaxAccount=require(_0x18e0('0x1'))['db'][_0x18e0('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x18e0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x18e0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2fb1ac){return function(_0x18fc05,_0x1019da,_0xcc7738){FaxAccountEvents[_0x18e0('0x5')](_0x2fb1ac+':'+_0x18fc05['id'],_0x18fc05);FaxAccountEvents[_0x18e0('0x5')](_0x2fb1ac,_0x18fc05);_0xcc7738(null);};}for(var e in events){if(events[_0x18e0('0x6')](e)){var event=events[e];FaxAccount[_0x18e0('0x7')](e,emitEvent(event));}}module[_0x18e0('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x0c2a=['exports','events','FaxAccount','setMaxListeners','save','update','remove','emit','hook'];(function(_0x56690b,_0x4d8b5c){var _0x35709d=function(_0x4651cf){while(--_0x4651cf){_0x56690b['push'](_0x56690b['shift']());}};_0x35709d(++_0x4d8b5c);}(_0x0c2a,0x1d5));var _0xa0c2=function(_0x3db7be,_0xbb5e16){_0x3db7be=_0x3db7be-0x0;var _0x4474f8=_0x0c2a[_0x3db7be];return _0x4474f8;};'use strict';var EventEmitter=require(_0xa0c2('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xa0c2('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xa0c2('0x2')](0x0);var events={'afterCreate':_0xa0c2('0x3'),'afterUpdate':_0xa0c2('0x4'),'afterDestroy':_0xa0c2('0x5')};function emitEvent(_0x5bf39d){return function(_0x4c35be,_0x41c2ac,_0x138945){FaxAccountEvents[_0xa0c2('0x6')](_0x5bf39d+':'+_0x4c35be['id'],_0x4c35be);FaxAccountEvents['emit'](_0x5bf39d,_0x4c35be);_0x138945(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xa0c2('0x7')](e,emitEvent(event));}}module[_0xa0c2('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 7e245c7..7cca4c8 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 _0x7268=['exports','FaxAccount','lodash','util','api','moment','rimraf','./faxAccount.attributes'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7268,0x132));var _0x8726=function(_0x11a335,_0x5de2da){_0x11a335=_0x11a335-0x0;var _0x2986db=_0x7268[_0x11a335];return _0x2986db;};'use strict';var _=require(_0x8726('0x0'));var util=require(_0x8726('0x1'));var logger=require('../../config/logger')(_0x8726('0x2'));var moment=require(_0x8726('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8726('0x4'));var config=require('../../config/environment');var attributes=require(_0x8726('0x5'));module[_0x8726('0x6')]=function(_0x314f93,_0x456834){return _0x314f93['define'](_0x8726('0x7'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6a3=['bluebird','path','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','lodash','../../config/logger','api'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xc6a3,0x133));var _0x3c6a=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xc6a3[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x3c6a('0x0'));var util=require('util');var logger=require(_0x3c6a('0x1'))(_0x3c6a('0x2'));var moment=require('moment');var BPromise=require(_0x3c6a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c6a('0x4'));var rimraf=require('rimraf');var config=require(_0x3c6a('0x5'));var attributes=require(_0x3c6a('0x6'));module[_0x3c6a('0x7')]=function(_0x420803,_0x3e3e72){return _0x420803[_0x3c6a('0x8')](_0x3c6a('0x9'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index d9bd12a..371f5e0 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 _0xa650=['rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','GetFaxAccount','FaxAccount','options','raw','where','limit','include','map','model','attributes','catch','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','keys','CompanyId','body','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','find','account','CmList','List','DESC','FaxApplication','Applications','get','applications','orderBy','priority','Contacts','length','ListId','create','FaxInteraction','spread','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','User','name','UserId','unshift','agent','waitForTheAssignedAgent','FaxQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','lodash','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x5cb76d,_0x47d11a){var _0x34a1f2=function(_0x189bc8){while(--_0x189bc8){_0x5cb76d['push'](_0x5cb76d['shift']());}};_0x34a1f2(++_0x47d11a);}(_0xa650,0x1c1));var _0x0a65=function(_0x59a98b,_0x51fa57){_0x59a98b=_0x59a98b-0x0;var _0x4715c4=_0xa650[_0x59a98b];return _0x4715c4;};'use strict';var _=require(_0x0a65('0x0'));var util=require(_0x0a65('0x1'));var moment=require(_0x0a65('0x2'));var BPromise=require(_0x0a65('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a65('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a65('0x5'))(_0x0a65('0x6'));var config=require('../../config/environment');var jayson=require(_0x0a65('0x7'));var client=jayson[_0x0a65('0x8')][_0x0a65('0x9')]({'port':0x232c});config[_0x0a65('0xa')]=_[_0x0a65('0xb')](config[_0x0a65('0xa')],{'host':_0x0a65('0xc'),'port':0x18eb});var socket=require(_0x0a65('0xd'))(new Redis(config['redis']));require(_0x0a65('0xe'))[_0x0a65('0xf')](socket);function respondWithRpcPromise(_0x3613bb,_0xc334dd,_0x3df511){return new BPromise(function(_0x481ead,_0x3fbde0){return client['request'](_0x3613bb,_0x3df511)[_0x0a65('0x10')](function(_0x18cad5){logger[_0x0a65('0x11')](_0x0a65('0x12'),_0xc334dd,'request\x20sent');logger[_0x0a65('0x13')](_0x0a65('0x14'),_0xc334dd,'request\x20sent',JSON['stringify'](_0x18cad5));if(_0x18cad5[_0x0a65('0x15')]){if(_0x18cad5[_0x0a65('0x15')][_0x0a65('0x16')]===0x1f4){logger[_0x0a65('0x15')](_0x0a65('0x12'),_0xc334dd,_0x18cad5[_0x0a65('0x15')][_0x0a65('0x17')]);return _0x3fbde0(_0x18cad5[_0x0a65('0x15')]['message']);}logger[_0x0a65('0x15')](_0x0a65('0x12'),_0xc334dd,_0x18cad5[_0x0a65('0x15')]['message']);return _0x481ead(_0x18cad5['error'][_0x0a65('0x17')]);}else{logger[_0x0a65('0x11')](_0x0a65('0x12'),_0xc334dd,_0x0a65('0x18'));_0x481ead(_0x18cad5[_0x0a65('0x19')][_0x0a65('0x17')]);}})['catch'](function(_0x8b6acb){logger[_0x0a65('0x15')](_0x0a65('0x12'),_0xc334dd,_0x8b6acb);_0x3fbde0(_0x8b6acb);});});}exports[_0x0a65('0x1a')]=function(_0x48ef85){var _0x2dc800=this;return new Promise(function(_0x564763,_0x3b6fd2){return db[_0x0a65('0x1b')]['findAll']({'raw':_0x48ef85[_0x0a65('0x1c')]?_0x48ef85[_0x0a65('0x1c')][_0x0a65('0x1d')]===undefined?!![]:![]:!![],'where':_0x48ef85[_0x0a65('0x1c')]?_0x48ef85['options'][_0x0a65('0x1e')]||null:null,'attributes':_0x48ef85[_0x0a65('0x1c')]?_0x48ef85[_0x0a65('0x1c')]['attributes']||null:null,'limit':_0x48ef85[_0x0a65('0x1c')]?_0x48ef85['options'][_0x0a65('0x1f')]||null:null,'include':_0x48ef85[_0x0a65('0x1c')]?_0x48ef85[_0x0a65('0x1c')][_0x0a65('0x20')]?_[_0x0a65('0x21')](_0x48ef85[_0x0a65('0x1c')][_0x0a65('0x20')],function(_0x51e876){return{'model':db[_0x51e876[_0x0a65('0x22')]],'as':_0x51e876['as'],'attributes':_0x51e876['attributes'],'include':_0x51e876[_0x0a65('0x20')]?_[_0x0a65('0x21')](_0x51e876['include'],function(_0x4196b9){return{'model':db[_0x4196b9['model']],'as':_0x4196b9['as'],'attributes':_0x4196b9[_0x0a65('0x23')],'include':_0x4196b9[_0x0a65('0x20')]?_[_0x0a65('0x21')](_0x4196b9[_0x0a65('0x20')],function(_0x4c996f){return{'model':db[_0x4c996f[_0x0a65('0x22')]],'as':_0x4c996f['as'],'attributes':_0x4c996f[_0x0a65('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0a65('0x10')](function(_0x543452){logger['info']('GetFaxAccount',_0x48ef85);logger['debug'](_0x0a65('0x1a'),_0x48ef85,JSON['stringify'](_0x543452));_0x564763(_0x543452);})[_0x0a65('0x24')](function(_0x2adfd0){logger[_0x0a65('0x15')](_0x0a65('0x1a'),_0x2adfd0[_0x0a65('0x17')],_0x48ef85);_0x3b6fd2(_0x2dc800[_0x0a65('0x15')](0x1f4,_0x2adfd0[_0x0a65('0x17')]));});});};exports['NotifyFaxAccount']=function(_0x15b59f,_0x18d8ed,_0x4a6cbe){var _0x349e60=this;return new Promise(function(_0x176362,_0x5a01e4){var _0x253232={'body':_0x15b59f['body'],'channel':_0x0a65('0x25')};var _0x3df571=[];var _0x2d666a=[];var _0x5d79a1={};return db['CmContact'][_0x0a65('0x26')]()['then'](function(_0x7eca4e){if(!_0x7eca4e){throw new db[(_0x0a65('0x27'))][(_0x0a65('0x28'))](_0x0a65('0x29'));}_0x3df571=_['difference'](_['keys'](_0x7eca4e),[_0x0a65('0x2a'),_0x0a65('0x2b')]);_0x2d666a=_['difference'](_[_0x0a65('0x2c')](_0x7eca4e),[_0x0a65('0x2a'),_0x0a65('0x2b'),_0x0a65('0x2d'),'ListId']);if(_0x15b59f[_0x0a65('0x2e')]['id']){delete _0x15b59f['body']['id'];}if(_[_0x0a65('0x2f')](_0x15b59f[_0x0a65('0x2e')][_0x0a65('0x30')])){throw new db[(_0x0a65('0x27'))][(_0x0a65('0x28'))](_0x0a65('0x31'));}if(_['isNil'](_0x15b59f[_0x0a65('0x2e')]['body'])||_0x15b59f[_0x0a65('0x2e')]['body']===''){throw new db['Sequelize'][(_0x0a65('0x28'))](_0x0a65('0x32'));}if(_[_0x0a65('0x2f')](_0x15b59f[_0x0a65('0x2e')][_0x0a65('0x33')])){throw new db[(_0x0a65('0x27'))][(_0x0a65('0x28'))](_0x0a65('0x34')+_0x2d666a);}if(!_[_0x0a65('0x35')](_0x2d666a,_0x15b59f[_0x0a65('0x2e')]['mapKey'])){throw new db[(_0x0a65('0x27'))][(_0x0a65('0x28'))](_0x0a65('0x36')+_0x2d666a);}_0x5d79a1[_0x15b59f[_0x0a65('0x2e')][_0x0a65('0x33')]]=_0x15b59f[_0x0a65('0x2e')][_0x0a65('0x30')];})[_0x0a65('0x10')](function(){return db['FaxAccount'][_0x0a65('0x37')]({'where':{'id':_0x15b59f[_0x0a65('0x38')]['id']},'include':[{'model':db[_0x0a65('0x39')],'as':_0x0a65('0x3a'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x5d79a1,'limit':0x1,'order':[['updatedAt',_0x0a65('0x3b')]]}]},{'model':db[_0x0a65('0x3c')],'as':_0x0a65('0x3d')}]});})[_0x0a65('0x10')](function(_0x2f55ef){if(_0x2f55ef&&_0x2f55ef['List']){var _0x192121=_0x2f55ef[_0x0a65('0x3e')]({'plain':!![]});_0x253232['account']=_0x192121;_0x253232[_0x0a65('0x3f')]=_0x192121[_0x0a65('0x3d')];_0x253232['list']=_0x192121['List'];_0x253232[_0x0a65('0x3f')]=_[_0x0a65('0x40')](_0x253232['applications'],[_0x0a65('0x41')],['asc']);if(_0x253232[_0x0a65('0x38')][_0x0a65('0x3d')]){delete _0x253232[_0x0a65('0x38')][_0x0a65('0x3d')];}if(_0x253232[_0x0a65('0x38')]['List']&&_0x253232[_0x0a65('0x38')][_0x0a65('0x3a')][_0x0a65('0x42')][_0x0a65('0x43')]){return _0x253232['account'][_0x0a65('0x3a')][_0x0a65('0x42')][0x0];}var _0x10d426=_[_0x0a65('0xb')](_0x15b59f[_0x0a65('0x2e')],{'firstName':_0x15b59f[_0x0a65('0x2e')][_0x0a65('0x30')],'ListId':_0x192121[_0x0a65('0x44')]});_0x10d426[_0x15b59f['body'][_0x0a65('0x33')]]=_0x15b59f[_0x0a65('0x2e')]['from'];return db['CmContact'][_0x0a65('0x45')](_0x10d426,{'fields':_0x3df571,'raw':!![]});}})[_0x0a65('0x10')](function(_0x5b3459){_0x253232['contact']=_0x5b3459;if(_0x5b3459){var _0x304d65={'ContactId':_0x5b3459['id'],'FaxAccountId':_0x15b59f[_0x0a65('0x38')]['id'],'fax':_0x5b3459['fax']};return db[_0x0a65('0x46')]['find']({'where':{'ContactId':_0x5b3459['id'],'closed':![],'FaxAccountId':_0x15b59f[_0x0a65('0x38')]['id']}})[_0x0a65('0x10')](function(_0x1085aa){if(_0x1085aa){return[_0x1085aa,![]];}return db[_0x0a65('0x46')][_0x0a65('0x45')](_0x304d65)[_0x0a65('0x10')](function(_0x4fef08){return[_0x4fef08,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x0a65('0x47')](function(_0x365ba8,_0x3a6e70){var _0x1f36d7=_0x365ba8['get']({'plain':!![]});if(_0x3a6e70){if(_0x253232[_0x0a65('0x38')]['autoclose']){_0x253232[_0x0a65('0x3f')]['push']({'id':0x0,'priority':_0x253232[_0x0a65('0x3f')][_0x0a65('0x43')]+0x1,'app':_0x0a65('0x48'),'appdata':_0x0a65('0x49'),'interval':_0x0a65('0x4a')});}_0x1f36d7[_0x0a65('0x4b')]=!![];}else{_0x1f36d7[_0x0a65('0x4b')]=![];}_0x253232[_0x0a65('0x4c')]=_0x1f36d7;return db[_0x0a65('0x4d')][_0x0a65('0x45')]({'body':_0x15b59f['body']['body'],'FaxAccountId':_0x15b59f[_0x0a65('0x38')]['id'],'FaxInteractionId':_0x365ba8['id'],'direction':'in','ContactId':_0x365ba8[_0x0a65('0x4e')],'AttachmentId':_0x15b59f[_0x0a65('0x2e')]['AttachmentId']});})[_0x0a65('0x10')](function(_0x32be01){_0x253232[_0x0a65('0x17')]=_0x32be01;if(!_0x253232[_0x0a65('0x4c')]['UserId'])return;return db[_0x0a65('0x4f')][_0x0a65('0x37')]({'attributes':['id',_0x0a65('0x50')],'where':{'id':_0x253232['interaction'][_0x0a65('0x51')]}});})[_0x0a65('0x10')](function(_0x417b6b){if(_0x417b6b){_0x253232[_0x0a65('0x3f')][_0x0a65('0x52')]({'id':0x0,'priority':0x0,'app':_0x0a65('0x53'),'appdata':_0x417b6b[_0x0a65('0x50')]+','+(_0x253232['account'][_0x0a65('0x54')]||0xa),'interval':_0x0a65('0x4a')});}if(!_0x253232[_0x0a65('0x4c')]['queueId'])return;return db[_0x0a65('0x55')][_0x0a65('0x37')]({'attributes':['id',_0x0a65('0x50')],'where':{'id':_0x253232['interaction'][_0x0a65('0x56')]}});})[_0x0a65('0x10')](function(_0x280a8e){if(_0x280a8e){_0x253232['applications'][_0x0a65('0x52')]({'id':0x0,'priority':0x1,'app':_0x0a65('0x57'),'appdata':_0x280a8e[_0x0a65('0x50')]+','+(_0x253232[_0x0a65('0x38')][_0x0a65('0x58')]||0x12c),'interval':_0x0a65('0x4a')});}return respondWithRpcPromise(_0x0a65('0x59'),_0x0a65('0x5a'),_0x253232);})[_0x0a65('0x10')](function(_0x517117){_0x176362(_0x517117);})['catch'](function(_0x5ca001){_0x5a01e4(_0x349e60[_0x0a65('0x15')](0x1f4,_0x5ca001['message']));});});}; \ No newline at end of file +var _0x145b=['error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','limit','map','include','attributes','then','NotifyFaxAccount','body','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','keys','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','updatedAt','FaxApplication','Applications','account','applications','list','orderBy','asc','Contacts','create','contact','find','FaxInteraction','Contact\x20not\x20found','spread','get','autoclose','push','length','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','agent','waitForTheAssignedAgent','FaxQueue','queueId','unshift','queue','waitForTheAssignedQueue','startRouting','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./faxAccount.socket','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5077ed,_0x4467b2){var _0x236dbc=function(_0x2afa62){while(--_0x2afa62){_0x5077ed['push'](_0x5077ed['shift']());}};_0x236dbc(++_0x4467b2);}(_0x145b,0x1c0));var _0xb145=function(_0x2e1612,_0x44512f){_0x2e1612=_0x2e1612-0x0;var _0x3c2e2e=_0x145b[_0x2e1612];return _0x3c2e2e;};'use strict';var _=require('lodash');var util=require(_0xb145('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb145('0x1'));var fs=require('fs');var Redis=require(_0xb145('0x2'));var db=require(_0xb145('0x3'))['db'];var utils=require(_0xb145('0x4'));var logger=require(_0xb145('0x5'))(_0xb145('0x6'));var config=require(_0xb145('0x7'));var jayson=require(_0xb145('0x8'));var client=jayson['client'][_0xb145('0x9')]({'port':0x232c});config['redis']=_[_0xb145('0xa')](config['redis'],{'host':_0xb145('0xb'),'port':0x18eb});var socket=require(_0xb145('0xc'))(new Redis(config[_0xb145('0xd')]));require(_0xb145('0xe'))['register'](socket);function respondWithRpcPromise(_0x3c6b22,_0x1e7151,_0x52004b){return new BPromise(function(_0x142789,_0x4f3a20){return client[_0xb145('0xf')](_0x3c6b22,_0x52004b)['then'](function(_0x1cd7cc){logger[_0xb145('0x10')](_0xb145('0x11'),_0x1e7151,_0xb145('0x12'));logger[_0xb145('0x13')](_0xb145('0x14'),_0x1e7151,'request\x20sent',JSON[_0xb145('0x15')](_0x1cd7cc));if(_0x1cd7cc['error']){if(_0x1cd7cc[_0xb145('0x16')][_0xb145('0x17')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x1e7151,_0x1cd7cc[_0xb145('0x16')]['message']);return _0x4f3a20(_0x1cd7cc['error'][_0xb145('0x18')]);}logger[_0xb145('0x16')]('FaxAccount,\x20%s,\x20%s',_0x1e7151,_0x1cd7cc[_0xb145('0x16')][_0xb145('0x18')]);return _0x142789(_0x1cd7cc['error'][_0xb145('0x18')]);}else{logger[_0xb145('0x10')](_0xb145('0x11'),_0x1e7151,_0xb145('0x12'));_0x142789(_0x1cd7cc[_0xb145('0x19')][_0xb145('0x18')]);}})[_0xb145('0x1a')](function(_0x14f86){logger[_0xb145('0x16')](_0xb145('0x11'),_0x1e7151,_0x14f86);_0x4f3a20(_0x14f86);});});}exports[_0xb145('0x1b')]=function(_0x5d1790){var _0x55a7b9=this;return new Promise(function(_0x56b708,_0x3bdd71){return db[_0xb145('0x1c')][_0xb145('0x1d')]({'raw':_0x5d1790[_0xb145('0x1e')]?_0x5d1790[_0xb145('0x1e')][_0xb145('0x1f')]===undefined?!![]:![]:!![],'where':_0x5d1790['options']?_0x5d1790[_0xb145('0x1e')][_0xb145('0x20')]||null:null,'attributes':_0x5d1790['options']?_0x5d1790['options']['attributes']||null:null,'limit':_0x5d1790[_0xb145('0x1e')]?_0x5d1790['options'][_0xb145('0x21')]||null:null,'include':_0x5d1790[_0xb145('0x1e')]?_0x5d1790[_0xb145('0x1e')]['include']?_[_0xb145('0x22')](_0x5d1790['options'][_0xb145('0x23')],function(_0x591ac9){return{'model':db[_0x591ac9['model']],'as':_0x591ac9['as'],'attributes':_0x591ac9[_0xb145('0x24')],'include':_0x591ac9[_0xb145('0x23')]?_[_0xb145('0x22')](_0x591ac9['include'],function(_0x50f469){return{'model':db[_0x50f469['model']],'as':_0x50f469['as'],'attributes':_0x50f469['attributes'],'include':_0x50f469[_0xb145('0x23')]?_[_0xb145('0x22')](_0x50f469[_0xb145('0x23')],function(_0x4a5ae3){return{'model':db[_0x4a5ae3['model']],'as':_0x4a5ae3['as'],'attributes':_0x4a5ae3[_0xb145('0x24')]};}):[]};}):[]};}):[]:[]})[_0xb145('0x25')](function(_0x23f094){logger['info'](_0xb145('0x1b'),_0x5d1790);logger['debug'](_0xb145('0x1b'),_0x5d1790,JSON['stringify'](_0x23f094));_0x56b708(_0x23f094);})[_0xb145('0x1a')](function(_0x1759a8){logger[_0xb145('0x16')](_0xb145('0x1b'),_0x1759a8[_0xb145('0x18')],_0x5d1790);_0x3bdd71(_0x55a7b9['error'](0x1f4,_0x1759a8['message']));});});};exports[_0xb145('0x26')]=function(_0x421c46,_0x5e961a,_0x11ec04){var _0x1106de=this;return new Promise(function(_0x46321b,_0x40dc4b){var _0x6168aa={'body':_0x421c46[_0xb145('0x27')],'channel':'fax'};var _0x486264=[];var _0x2e3905=[];var _0x2d0403={};return db['CmContact'][_0xb145('0x28')]()['then'](function(_0x20638b){if(!_0x20638b){throw new db[(_0xb145('0x29'))][(_0xb145('0x2a'))](_0xb145('0x2b'));}_0x486264=_[_0xb145('0x2c')](_['keys'](_0x20638b),[_0xb145('0x2d'),'updatedAt']);_0x2e3905=_[_0xb145('0x2c')](_[_0xb145('0x2e')](_0x20638b),[_0xb145('0x2d'),'updatedAt','CompanyId',_0xb145('0x2f')]);if(_0x421c46[_0xb145('0x27')]['id']){delete _0x421c46[_0xb145('0x27')]['id'];}if(_[_0xb145('0x30')](_0x421c46[_0xb145('0x27')][_0xb145('0x31')])){throw new db['Sequelize']['ValidationError'](_0xb145('0x32'));}if(_[_0xb145('0x30')](_0x421c46[_0xb145('0x27')][_0xb145('0x27')])||_0x421c46['body'][_0xb145('0x27')]===''){throw new db[(_0xb145('0x29'))][(_0xb145('0x2a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x421c46[_0xb145('0x27')][_0xb145('0x33')])){throw new db[(_0xb145('0x29'))][(_0xb145('0x2a'))](_0xb145('0x34')+_0x2e3905);}if(!_['includes'](_0x2e3905,_0x421c46[_0xb145('0x27')][_0xb145('0x33')])){throw new db[(_0xb145('0x29'))]['ValidationError'](_0xb145('0x35')+_0x2e3905);}_0x2d0403[_0x421c46[_0xb145('0x27')][_0xb145('0x33')]]=_0x421c46[_0xb145('0x27')][_0xb145('0x31')];})[_0xb145('0x25')](function(){return db['FaxAccount']['find']({'where':{'id':_0x421c46['account']['id']},'include':[{'model':db[_0xb145('0x36')],'as':_0xb145('0x37'),'include':[{'model':db[_0xb145('0x38')],'as':'Contacts','where':_0x2d0403,'limit':0x1,'order':[[_0xb145('0x39'),'DESC']]}]},{'model':db[_0xb145('0x3a')],'as':_0xb145('0x3b')}]});})[_0xb145('0x25')](function(_0x3637b7){if(_0x3637b7&&_0x3637b7[_0xb145('0x37')]){var _0x4d591d=_0x3637b7['get']({'plain':!![]});_0x6168aa[_0xb145('0x3c')]=_0x4d591d;_0x6168aa[_0xb145('0x3d')]=_0x4d591d[_0xb145('0x3b')];_0x6168aa[_0xb145('0x3e')]=_0x4d591d['List'];_0x6168aa[_0xb145('0x3d')]=_[_0xb145('0x3f')](_0x6168aa[_0xb145('0x3d')],['priority'],[_0xb145('0x40')]);if(_0x6168aa[_0xb145('0x3c')]['Applications']){delete _0x6168aa['account'][_0xb145('0x3b')];}if(_0x6168aa['account'][_0xb145('0x37')]&&_0x6168aa['account']['List']['Contacts']['length']){return _0x6168aa[_0xb145('0x3c')]['List'][_0xb145('0x41')][0x0];}var _0x4d2f9b=_[_0xb145('0xa')](_0x421c46[_0xb145('0x27')],{'firstName':_0x421c46[_0xb145('0x27')][_0xb145('0x31')],'ListId':_0x4d591d['ListId']});_0x4d2f9b[_0x421c46[_0xb145('0x27')]['mapKey']]=_0x421c46[_0xb145('0x27')][_0xb145('0x31')];return db[_0xb145('0x38')][_0xb145('0x42')](_0x4d2f9b,{'fields':_0x486264,'raw':!![]});}})[_0xb145('0x25')](function(_0x4b06c8){_0x6168aa[_0xb145('0x43')]=_0x4b06c8;if(_0x4b06c8){var _0x570db1={'ContactId':_0x4b06c8['id'],'FaxAccountId':_0x421c46[_0xb145('0x3c')]['id'],'fax':_0x4b06c8['fax']};return db['FaxInteraction'][_0xb145('0x44')]({'where':{'ContactId':_0x4b06c8['id'],'closed':![],'FaxAccountId':_0x421c46[_0xb145('0x3c')]['id']}})[_0xb145('0x25')](function(_0x236ac5){if(_0x236ac5){return[_0x236ac5,![]];}return db[_0xb145('0x45')][_0xb145('0x42')](_0x570db1)[_0xb145('0x25')](function(_0x30290f){return[_0x30290f,!![]];});});}else{throw new Error(_0xb145('0x46'));}})[_0xb145('0x47')](function(_0x4d00de,_0x12fefa){var _0x3c7e0b=_0x4d00de[_0xb145('0x48')]({'plain':!![]});if(_0x12fefa){if(_0x6168aa['account'][_0xb145('0x49')]){_0x6168aa[_0xb145('0x3d')][_0xb145('0x4a')]({'id':0x0,'priority':_0x6168aa[_0xb145('0x3d')][_0xb145('0x4b')]+0x1,'app':_0xb145('0x4c'),'appdata':_0xb145('0x4d'),'interval':_0xb145('0x4e')});}_0x3c7e0b[_0xb145('0x4f')]=!![];}else{_0x3c7e0b[_0xb145('0x4f')]=![];}_0x6168aa[_0xb145('0x50')]=_0x3c7e0b;return db[_0xb145('0x51')][_0xb145('0x42')]({'body':_0x421c46[_0xb145('0x27')]['body'],'FaxAccountId':_0x421c46[_0xb145('0x3c')]['id'],'FaxInteractionId':_0x4d00de['id'],'direction':'in','ContactId':_0x4d00de[_0xb145('0x52')],'AttachmentId':_0x421c46[_0xb145('0x27')][_0xb145('0x53')]});})[_0xb145('0x25')](function(_0x4ff93f){_0x6168aa['message']=_0x4ff93f;if(!_0x6168aa[_0xb145('0x50')][_0xb145('0x54')])return;return db['User'][_0xb145('0x44')]({'attributes':['id',_0xb145('0x55')],'where':{'id':_0x6168aa[_0xb145('0x50')]['UserId']}});})[_0xb145('0x25')](function(_0x3f3eab){if(_0x3f3eab){_0x6168aa['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xb145('0x56'),'appdata':_0x3f3eab[_0xb145('0x55')]+','+(_0x6168aa[_0xb145('0x3c')][_0xb145('0x57')]||0xa),'interval':_0xb145('0x4e')});}if(!_0x6168aa[_0xb145('0x50')]['queueId'])return;return db[_0xb145('0x58')]['find']({'attributes':['id',_0xb145('0x55')],'where':{'id':_0x6168aa[_0xb145('0x50')][_0xb145('0x59')]}});})[_0xb145('0x25')](function(_0x55eaca){if(_0x55eaca){_0x6168aa[_0xb145('0x3d')][_0xb145('0x5a')]({'id':0x0,'priority':0x1,'app':_0xb145('0x5b'),'appdata':_0x55eaca[_0xb145('0x55')]+','+(_0x6168aa[_0xb145('0x3c')][_0xb145('0x5c')]||0x12c),'interval':_0xb145('0x4e')});}return respondWithRpcPromise('Start',_0xb145('0x5d'),_0x6168aa);})[_0xb145('0x25')](function(_0x187921){_0x46321b(_0x187921);})[_0xb145('0x1a')](function(_0x4a12d7){_0x40dc4b(_0x1106de[_0xb145('0x16')](0x1f4,_0x4a12d7['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 99e353c..fc117df 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 _0xe74e=['update','emit','register','length','faxAccount:','./faxAccount.events','save','remove'];(function(_0x21c7aa,_0x34d629){var _0x5e8f84=function(_0x212620){while(--_0x212620){_0x21c7aa['push'](_0x21c7aa['shift']());}};_0x5e8f84(++_0x34d629);}(_0xe74e,0xc5));var _0xee74=function(_0x2dc2df,_0x5e8375){_0x2dc2df=_0x2dc2df-0x0;var _0x33d604=_0xe74e[_0x2dc2df];return _0x33d604;};'use strict';var FaxAccountEvents=require(_0xee74('0x0'));var events=[_0xee74('0x1'),_0xee74('0x2'),_0xee74('0x3')];function createListener(_0x5783d4,_0x422cbf){return function(_0x270b33){_0x422cbf[_0xee74('0x4')](_0x5783d4,_0x270b33);};}function removeListener(_0x571212,_0x22a339){return function(){FaxAccountEvents['removeListener'](_0x571212,_0x22a339);};}exports[_0xee74('0x5')]=function(_0x522fa9){for(var _0x5390b8=0x0,_0x24b22d=events[_0xee74('0x6')];_0x5390b8<_0x24b22d;_0x5390b8++){var _0x17bf3b=events[_0x5390b8];var _0x3727aa=createListener(_0xee74('0x7')+_0x17bf3b,_0x522fa9);FaxAccountEvents['on'](_0x17bf3b,_0x3727aa);}}; \ No newline at end of file +var _0xa18a=['length','faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x35a140,_0x3aeac6){var _0x30ab82=function(_0x15a7c3){while(--_0x15a7c3){_0x35a140['push'](_0x35a140['shift']());}};_0x30ab82(++_0x3aeac6);}(_0xa18a,0xfe));var _0xaa18=function(_0x43d20a,_0x343dad){_0x43d20a=_0x43d20a-0x0;var _0x4e2420=_0xa18a[_0x43d20a];return _0x4e2420;};'use strict';var FaxAccountEvents=require(_0xaa18('0x0'));var events=[_0xaa18('0x1'),_0xaa18('0x2'),_0xaa18('0x3')];function createListener(_0x3644ac,_0x3c5151){return function(_0x26de74){_0x3c5151[_0xaa18('0x4')](_0x3644ac,_0x26de74);};}function removeListener(_0x56e0f3,_0x5b68ad){return function(){FaxAccountEvents[_0xaa18('0x5')](_0x56e0f3,_0x5b68ad);};}exports[_0xaa18('0x6')]=function(_0x4c4608){for(var _0x33c881=0x0,_0x5524c0=events[_0xaa18('0x7')];_0x33c881<_0x5524c0;_0x33c881++){var _0x5b3422=events[_0x33c881];var _0x5de3ed=createListener(_0xaa18('0x8')+_0x5b3422,_0x4c4608);FaxAccountEvents['on'](_0x5b3422,_0x5de3ed);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index abfe105..9067a85 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 _0x456b=['updateAccountApplications','send','put','delete','removeDispositions','removeAgents','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/users','getAgents','post','create','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications'];(function(_0x51f87e,_0x50f6bc){var _0x57bea7=function(_0x18c418){while(--_0x18c418){_0x51f87e['push'](_0x51f87e['shift']());}};_0x57bea7(++_0x50f6bc);}(_0x456b,0x1e8));var _0xb456=function(_0x4a0e40,_0x16f70c){_0x4a0e40=_0x4a0e40-0x0;var _0x53dc22=_0x456b[_0x4a0e40];return _0x53dc22;};'use strict';var multer=require(_0xb456('0x0'));var util=require('util');var path=require(_0xb456('0x1'));var timeout=require('connect-timeout');var express=require(_0xb456('0x2'));var router=express['Router']();var fs_extra=require(_0xb456('0x3'));var auth=require(_0xb456('0x4'));var interaction=require(_0xb456('0x5'));var config=require('../../config/environment');var controller=require(_0xb456('0x6'));router[_0xb456('0x7')]('/',auth[_0xb456('0x8')](),controller['index']);router[_0xb456('0x7')](_0xb456('0x9'),auth[_0xb456('0x8')](),controller[_0xb456('0xa')]);router[_0xb456('0x7')](_0xb456('0xb'),auth[_0xb456('0x8')](),controller[_0xb456('0xc')]);router[_0xb456('0x7')](_0xb456('0xd'),auth[_0xb456('0x8')](),controller['getDispositions']);router[_0xb456('0x7')](_0xb456('0xe'),auth[_0xb456('0x8')](),controller['getAnswers']);router['get'](_0xb456('0xf'),auth['isAuthenticated'](),controller[_0xb456('0x10')]);router[_0xb456('0x7')](_0xb456('0x11'),auth[_0xb456('0x8')](),controller[_0xb456('0x12')]);router[_0xb456('0x7')](_0xb456('0x13'),auth[_0xb456('0x8')](),controller['getMessages']);router[_0xb456('0x7')](_0xb456('0x14'),auth[_0xb456('0x8')](),controller[_0xb456('0x15')]);router[_0xb456('0x16')]('/',auth[_0xb456('0x8')](),controller[_0xb456('0x17')]);router[_0xb456('0x16')](_0xb456('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xb456('0x16')](_0xb456('0xe'),auth[_0xb456('0x8')](),controller[_0xb456('0x18')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0xb456('0x19')]);router[_0xb456('0x16')](_0xb456('0x11'),auth[_0xb456('0x8')](),controller[_0xb456('0x1a')]);router['post'](_0xb456('0x1b'),auth[_0xb456('0x8')](),controller[_0xb456('0x1c')]);router[_0xb456('0x16')](_0xb456('0x1d'),auth[_0xb456('0x8')](),controller[_0xb456('0x1e')]);router[_0xb456('0x16')]('/:id/send',auth['isAuthenticated'](),controller[_0xb456('0x1f')]);router[_0xb456('0x16')](_0xb456('0x14'),auth[_0xb456('0x8')](),controller['addAgents']);router[_0xb456('0x20')](_0xb456('0xb'),auth[_0xb456('0x8')](),controller['update']);router[_0xb456('0x21')](_0xb456('0xb'),auth[_0xb456('0x8')](),controller['destroy']);router['delete'](_0xb456('0xd'),auth['isAuthenticated'](),controller[_0xb456('0x22')]);router[_0xb456('0x21')](_0xb456('0xe'),auth[_0xb456('0x8')](),controller['removeAnswers']);router[_0xb456('0x21')](_0xb456('0x14'),auth[_0xb456('0x8')](),controller[_0xb456('0x23')]);module[_0xb456('0x24')]=router; \ No newline at end of file +var _0x0c84=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/users','getAgents','create','post','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','send','update','delete','destroy','removeDispositions','multer'];(function(_0x5e7199,_0x878944){var _0x218f5d=function(_0x4e4b){while(--_0x4e4b){_0x5e7199['push'](_0x5e7199['shift']());}};_0x218f5d(++_0x878944);}(_0x0c84,0x185));var _0x40c8=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x0c84[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x40c8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x40c8('0x1'));var express=require('express');var router=express[_0x40c8('0x2')]();var fs_extra=require(_0x40c8('0x3'));var auth=require(_0x40c8('0x4'));var interaction=require(_0x40c8('0x5'));var config=require(_0x40c8('0x6'));var controller=require('./faxAccount.controller');router[_0x40c8('0x7')]('/',auth['isAuthenticated'](),controller[_0x40c8('0x8')]);router[_0x40c8('0x7')](_0x40c8('0x9'),auth[_0x40c8('0xa')](),controller[_0x40c8('0xb')]);router['get'](_0x40c8('0xc'),auth[_0x40c8('0xa')](),controller[_0x40c8('0xd')]);router[_0x40c8('0x7')](_0x40c8('0xe'),auth[_0x40c8('0xa')](),controller['getDispositions']);router['get'](_0x40c8('0xf'),auth[_0x40c8('0xa')](),controller[_0x40c8('0x10')]);router[_0x40c8('0x7')](_0x40c8('0x11'),auth[_0x40c8('0xa')](),controller[_0x40c8('0x12')]);router[_0x40c8('0x7')](_0x40c8('0x13'),auth[_0x40c8('0xa')](),controller[_0x40c8('0x14')]);router[_0x40c8('0x7')]('/:id/messages',auth[_0x40c8('0xa')](),controller[_0x40c8('0x15')]);router[_0x40c8('0x7')](_0x40c8('0x16'),auth[_0x40c8('0xa')](),controller[_0x40c8('0x17')]);router['post']('/',auth['isAuthenticated'](),controller[_0x40c8('0x18')]);router[_0x40c8('0x19')]('/:id/dispositions',auth[_0x40c8('0xa')](),controller[_0x40c8('0x1a')]);router[_0x40c8('0x19')](_0x40c8('0xf'),auth[_0x40c8('0xa')](),controller[_0x40c8('0x1b')]);router[_0x40c8('0x19')]('/:id/interactions',auth[_0x40c8('0xa')](),controller[_0x40c8('0x1c')]);router['post'](_0x40c8('0x13'),auth['isAuthenticated'](),controller[_0x40c8('0x1d')]);router[_0x40c8('0x19')](_0x40c8('0x1e'),auth[_0x40c8('0xa')](),controller[_0x40c8('0x1f')]);router[_0x40c8('0x19')](_0x40c8('0x20'),auth[_0x40c8('0xa')](),controller[_0x40c8('0x21')]);router[_0x40c8('0x19')]('/:id/send',auth[_0x40c8('0xa')](),controller[_0x40c8('0x22')]);router[_0x40c8('0x19')](_0x40c8('0x16'),auth[_0x40c8('0xa')](),controller['addAgents']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x40c8('0x23')]);router[_0x40c8('0x24')](_0x40c8('0xc'),auth[_0x40c8('0xa')](),controller[_0x40c8('0x25')]);router['delete'](_0x40c8('0xe'),auth[_0x40c8('0xa')](),controller[_0x40c8('0x26')]);router[_0x40c8('0x24')](_0x40c8('0xf'),auth[_0x40c8('0xa')](),controller['removeAnswers']);router[_0x40c8('0x24')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 926c65c..d5f99b9 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 _0xb138=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x3c59fc,_0x10dbd2){var _0x2b78d4=function(_0x5f161a){while(--_0x5f161a){_0x3c59fc['push'](_0x3c59fc['shift']());}};_0x2b78d4(++_0x10dbd2);}(_0xb138,0x1da));var _0x8b13=function(_0x1d5f62,_0x39ef57){_0x1d5f62=_0x1d5f62-0x0;var _0x43b086=_0xb138[_0x1d5f62];return _0x43b086;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'priority':{'type':Sequelize[_0x8b13('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8b13('0x3')],'allowNull':![],'defaultValue':_0x8b13('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x8b13('0x3')]},'interval':{'type':Sequelize[_0x8b13('0x3')],'defaultValue':_0x8b13('0x5')}}; \ No newline at end of file +var _0x0f56=['sequelize','exports','INTEGER','STRING','*,*,*,*'];(function(_0x8866c,_0x4396f3){var _0x2f52a2=function(_0x33d1f5){while(--_0x33d1f5){_0x8866c['push'](_0x8866c['shift']());}};_0x2f52a2(++_0x4396f3);}(_0x0f56,0xe1));var _0x60f5=function(_0x47c025,_0x59b5d3){_0x47c025=_0x47c025-0x0;var _0x217e2c=_0x0f56[_0x47c025];return _0x217e2c;};'use strict';var Sequelize=require(_0x60f5('0x0'));module[_0x60f5('0x1')]={'priority':{'type':Sequelize[_0x60f5('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x60f5('0x3')],'defaultValue':_0x60f5('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 7c19b10..f543bc7 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 _0x9339=['options','includeAll','FaxApplication','findAll','rows','show','params','rawAttributes','length','find','catch','create','body','update','destroy','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','count','limit','Content-Range','json','apply','reject','save','then','end','error','stack','fieldName','key','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','map','VIRTUAL','merge'];(function(_0x188e3b,_0x4b8e01){var _0x5137c9=function(_0x167a06){while(--_0x167a06){_0x188e3b['push'](_0x188e3b['shift']());}};_0x5137c9(++_0x4b8e01);}(_0x9339,0xe1));var _0x9933=function(_0x4fb930,_0x4141c4){_0x4fb930=_0x4fb930-0x0;var _0x59adc4=_0x9339[_0x4fb930];return _0x59adc4;};'use strict';var emlformat=require(_0x9933('0x0'));var rimraf=require(_0x9933('0x1'));var zipdir=require(_0x9933('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9933('0x3'));var BPromise=require(_0x9933('0x4'));var Mustache=require('mustache');var util=require(_0x9933('0x5'));var path=require('path');var sox=require(_0x9933('0x6'));var csv=require(_0x9933('0x7'));var ejs=require(_0x9933('0x8'));var fs=require('fs');var fs_extra=require(_0x9933('0x9'));var _=require(_0x9933('0xa'));var squel=require(_0x9933('0xb'));var crypto=require(_0x9933('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9933('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9933('0xe'));var Papa=require(_0x9933('0xf'));var Redis=require(_0x9933('0x10'));var authService=require(_0x9933('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9933('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9933('0x13'))('api');var utils=require(_0x9933('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9933('0x15'));var db=require(_0x9933('0x16'))['db'];function respondWithStatusCode(_0x556f0e,_0xb854d2){_0xb854d2=_0xb854d2||0xcc;return function(_0x393f2e){if(_0x393f2e){return _0x556f0e[_0x9933('0x17')](_0xb854d2);}return _0x556f0e[_0x9933('0x18')](_0xb854d2)['end']();};}function respondWithResult(_0x385b5f,_0x39afda){_0x39afda=_0x39afda||0xc8;return function(_0x232fb7){if(_0x232fb7){return _0x385b5f[_0x9933('0x18')](_0x39afda)['json'](_0x232fb7);}};}function respondWithFilteredResult(_0x5ea3b1,_0x2afa9c){return function(_0x52d888){if(_0x52d888){var _0x26efc6=typeof _0x2afa9c[_0x9933('0x19')]==='undefined'&&typeof _0x2afa9c['limit']==='undefined';var _0x24f2cc=_0x52d888[_0x9933('0x1a')];var _0x576d7d=_0x26efc6?0x0:_0x2afa9c[_0x9933('0x19')];var _0x1b5a30=_0x26efc6?_0x52d888[_0x9933('0x1a')]:_0x2afa9c[_0x9933('0x19')]+_0x2afa9c[_0x9933('0x1b')];var _0x2d6644;if(_0x1b5a30>=_0x24f2cc){_0x1b5a30=_0x24f2cc;_0x2d6644=0xc8;}else{_0x2d6644=0xce;}_0x5ea3b1[_0x9933('0x18')](_0x2d6644);return _0x5ea3b1['set'](_0x9933('0x1c'),_0x576d7d+'-'+_0x1b5a30+'/'+_0x24f2cc)[_0x9933('0x1d')](_0x52d888);}return null;};}function patchUpdates(_0x4c5c86){return function(_0x5e9fcd){try{jsonpatch[_0x9933('0x1e')](_0x5e9fcd,_0x4c5c86,!![]);}catch(_0x5e947a){return BPromise[_0x9933('0x1f')](_0x5e947a);}return _0x5e9fcd[_0x9933('0x20')]();};}function saveUpdates(_0x5da2af,_0x472d7e){return function(_0x4c55ee){if(_0x4c55ee){return _0x4c55ee['update'](_0x5da2af)[_0x9933('0x21')](function(_0x38c70f){return _0x38c70f;});}return null;};}function removeEntity(_0x740784,_0xba189f){return function(_0x187e6e){if(_0x187e6e){return _0x187e6e['destroy']()[_0x9933('0x21')](function(){_0x740784[_0x9933('0x18')](0xcc)[_0x9933('0x22')]();});}};}function handleEntityNotFound(_0x3f2422,_0x4ec2ab){return function(_0x48b35e){if(!_0x48b35e){_0x3f2422['sendStatus'](0x194);}return _0x48b35e;};}function handleError(_0x599fcd,_0x531ea4){_0x531ea4=_0x531ea4||0x1f4;return function(_0x3a3866){logger[_0x9933('0x23')](_0x3a3866[_0x9933('0x24')]);if(_0x3a3866['name']){delete _0x3a3866['name'];}_0x599fcd['status'](_0x531ea4)['send'](_0x3a3866);};}exports['index']=function(_0x391ed6,_0xaa07ea){var _0x3ec4f5={},_0x2165ea={},_0x21a929={'count':0x0,'rows':[]};var _0x4ed1ff=_['map'](db['FaxApplication']['rawAttributes'],function(_0xf24f36){return{'name':_0xf24f36[_0x9933('0x25')],'type':_0xf24f36['type'][_0x9933('0x26')]};});_0x2165ea[_0x9933('0x27')]=_['map'](_0x4ed1ff,_0x9933('0x28'));_0x2165ea['query']=_[_0x9933('0x29')](_0x391ed6[_0x9933('0x2a')]);_0x2165ea[_0x9933('0x2b')]=_[_0x9933('0x2c')](_0x2165ea['model'],_0x2165ea[_0x9933('0x2a')]);_0x3ec4f5[_0x9933('0x2d')]=_[_0x9933('0x2c')](_0x2165ea[_0x9933('0x27')],qs[_0x9933('0x2e')](_0x391ed6[_0x9933('0x2a')]['fields']));_0x3ec4f5[_0x9933('0x2d')]=_0x3ec4f5[_0x9933('0x2d')]['length']?_0x3ec4f5[_0x9933('0x2d')]:_0x2165ea[_0x9933('0x27')];if(!_0x391ed6[_0x9933('0x2a')][_0x9933('0x2f')]('nolimit')){_0x3ec4f5[_0x9933('0x1b')]=qs[_0x9933('0x1b')](_0x391ed6[_0x9933('0x2a')]['limit']);_0x3ec4f5[_0x9933('0x19')]=qs['offset'](_0x391ed6['query']['offset']);}_0x3ec4f5['order']=qs[_0x9933('0x30')](_0x391ed6[_0x9933('0x2a')][_0x9933('0x30')]);_0x3ec4f5[_0x9933('0x31')]=qs['filters'](_[_0x9933('0x32')](_0x391ed6['query'],_0x2165ea[_0x9933('0x2b')]),_0x4ed1ff);if(_0x391ed6[_0x9933('0x2a')][_0x9933('0x33')]){_0x3ec4f5[_0x9933('0x31')]=_['merge'](_0x3ec4f5[_0x9933('0x31')],{'$or':_[_0x9933('0x34')](_0x4ed1ff,function(_0xb740df){if(_0xb740df['type']!==_0x9933('0x35')){var _0x20f59b={};_0x20f59b[_0xb740df[_0x9933('0x28')]]={'$like':'%'+_0x391ed6['query'][_0x9933('0x33')]+'%'};return _0x20f59b;}})});}_0x3ec4f5=_[_0x9933('0x36')]({},_0x3ec4f5,_0x391ed6[_0x9933('0x37')]);var _0x44fed0={'where':_0x3ec4f5[_0x9933('0x31')]};return db['FaxApplication']['count'](_0x44fed0)[_0x9933('0x21')](function(_0x2c4b3c){_0x21a929[_0x9933('0x1a')]=_0x2c4b3c;if(_0x391ed6['query'][_0x9933('0x38')]){_0x3ec4f5['include']=[{'all':!![]}];}return db[_0x9933('0x39')][_0x9933('0x3a')](_0x3ec4f5);})[_0x9933('0x21')](function(_0x3b45b7){_0x21a929[_0x9933('0x3b')]=_0x3b45b7;return _0x21a929;})[_0x9933('0x21')](respondWithFilteredResult(_0xaa07ea,_0x3ec4f5))['catch'](handleError(_0xaa07ea,null));};exports[_0x9933('0x3c')]=function(_0x39cbdb,_0x311021){var _0x5f0334={'raw':!![],'where':{'id':_0x39cbdb[_0x9933('0x3d')]['id']}},_0x1617f2={};_0x1617f2[_0x9933('0x27')]=_[_0x9933('0x29')](db[_0x9933('0x39')][_0x9933('0x3e')]);_0x1617f2[_0x9933('0x2a')]=_[_0x9933('0x29')](_0x39cbdb[_0x9933('0x2a')]);_0x1617f2[_0x9933('0x2b')]=_['intersection'](_0x1617f2[_0x9933('0x27')],_0x1617f2[_0x9933('0x2a')]);_0x5f0334[_0x9933('0x2d')]=_[_0x9933('0x2c')](_0x1617f2['model'],qs[_0x9933('0x2e')](_0x39cbdb[_0x9933('0x2a')][_0x9933('0x2e')]));_0x5f0334[_0x9933('0x2d')]=_0x5f0334['attributes'][_0x9933('0x3f')]?_0x5f0334[_0x9933('0x2d')]:_0x1617f2[_0x9933('0x27')];if(_0x39cbdb[_0x9933('0x2a')][_0x9933('0x38')]){_0x5f0334['include']=[{'all':!![]}];}_0x5f0334=_[_0x9933('0x36')]({},_0x5f0334,_0x39cbdb[_0x9933('0x37')]);return db['FaxApplication'][_0x9933('0x40')](_0x5f0334)['then'](handleEntityNotFound(_0x311021,null))[_0x9933('0x21')](respondWithResult(_0x311021,null))[_0x9933('0x41')](handleError(_0x311021,null));};exports[_0x9933('0x42')]=function(_0x5a0a83,_0x37cfab){return db[_0x9933('0x39')][_0x9933('0x42')](_0x5a0a83[_0x9933('0x43')],{})['then'](respondWithResult(_0x37cfab,0xc9))[_0x9933('0x41')](handleError(_0x37cfab,null));};exports[_0x9933('0x44')]=function(_0x80c360,_0x366e0d){if(_0x80c360[_0x9933('0x43')]['id']){delete _0x80c360[_0x9933('0x43')]['id'];}return db[_0x9933('0x39')][_0x9933('0x40')]({'where':{'id':_0x80c360[_0x9933('0x3d')]['id']}})[_0x9933('0x21')](handleEntityNotFound(_0x366e0d,null))[_0x9933('0x21')](saveUpdates(_0x80c360['body'],null))[_0x9933('0x21')](respondWithResult(_0x366e0d,null))[_0x9933('0x41')](handleError(_0x366e0d,null));};exports[_0x9933('0x45')]=function(_0x5bb8f0,_0x25c9a9){return db[_0x9933('0x39')]['find']({'where':{'id':_0x5bb8f0['params']['id']}})[_0x9933('0x21')](handleEntityNotFound(_0x25c9a9,null))['then'](removeEntity(_0x25c9a9,null))[_0x9933('0x41')](handleError(_0x25c9a9,null));}; \ No newline at end of file +var _0xc0f0=['length','include','merge','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','map','FaxApplication','type','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes'];(function(_0x4db641,_0x4b34a8){var _0x21144a=function(_0x56c54a){while(--_0x56c54a){_0x4db641['push'](_0x4db641['shift']());}};_0x21144a(++_0x4b34a8);}(_0xc0f0,0x1c2));var _0x0c0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc0f0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0c0f('0x0'));var rimraf=require(_0x0c0f('0x1'));var zipdir=require(_0x0c0f('0x2'));var jsonpatch=require(_0x0c0f('0x3'));var rp=require(_0x0c0f('0x4'));var moment=require(_0x0c0f('0x5'));var BPromise=require(_0x0c0f('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0c0f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c0f('0x8'));var _=require(_0x0c0f('0x9'));var squel=require(_0x0c0f('0xa'));var crypto=require(_0x0c0f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0c0f('0xc'));var toCsv=require(_0x0c0f('0xd'));var querystring=require(_0x0c0f('0xe'));var Papa=require(_0x0c0f('0xf'));var Redis=require(_0x0c0f('0x10'));var authService=require(_0x0c0f('0x11'));var qs=require(_0x0c0f('0x12'));var as=require(_0x0c0f('0x13'));var hardwareService=require(_0x0c0f('0x14'));var logger=require(_0x0c0f('0x15'))(_0x0c0f('0x16'));var utils=require(_0x0c0f('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23348e,_0x24be7f){_0x24be7f=_0x24be7f||0xcc;return function(_0x1a08bd){if(_0x1a08bd){return _0x23348e[_0x0c0f('0x18')](_0x24be7f);}return _0x23348e['status'](_0x24be7f)[_0x0c0f('0x19')]();};}function respondWithResult(_0xd55930,_0x4e1036){_0x4e1036=_0x4e1036||0xc8;return function(_0x3f4dfe){if(_0x3f4dfe){return _0xd55930[_0x0c0f('0x1a')](_0x4e1036)[_0x0c0f('0x1b')](_0x3f4dfe);}};}function respondWithFilteredResult(_0x54bd89,_0x359a8c){return function(_0x1c3906){if(_0x1c3906){var _0x43a52c=typeof _0x359a8c[_0x0c0f('0x1c')]===_0x0c0f('0x1d')&&typeof _0x359a8c[_0x0c0f('0x1e')]===_0x0c0f('0x1d');var _0x31d45a=_0x1c3906['count'];var _0x6d8063=_0x43a52c?0x0:_0x359a8c[_0x0c0f('0x1c')];var _0x10a7dd=_0x43a52c?_0x1c3906[_0x0c0f('0x1f')]:_0x359a8c[_0x0c0f('0x1c')]+_0x359a8c[_0x0c0f('0x1e')];var _0x3d2329;if(_0x10a7dd>=_0x31d45a){_0x10a7dd=_0x31d45a;_0x3d2329=0xc8;}else{_0x3d2329=0xce;}_0x54bd89[_0x0c0f('0x1a')](_0x3d2329);return _0x54bd89[_0x0c0f('0x20')]('Content-Range',_0x6d8063+'-'+_0x10a7dd+'/'+_0x31d45a)['json'](_0x1c3906);}return null;};}function patchUpdates(_0x4dbe30){return function(_0x170504){try{jsonpatch[_0x0c0f('0x21')](_0x170504,_0x4dbe30,!![]);}catch(_0x158ee5){return BPromise[_0x0c0f('0x22')](_0x158ee5);}return _0x170504[_0x0c0f('0x23')]();};}function saveUpdates(_0x24f4cd,_0x3ca629){return function(_0x55e4f2){if(_0x55e4f2){return _0x55e4f2[_0x0c0f('0x24')](_0x24f4cd)[_0x0c0f('0x25')](function(_0x51ee4e){return _0x51ee4e;});}return null;};}function removeEntity(_0x177cfa,_0x244fc4){return function(_0x21039f){if(_0x21039f){return _0x21039f[_0x0c0f('0x26')]()[_0x0c0f('0x25')](function(){_0x177cfa[_0x0c0f('0x1a')](0xcc)[_0x0c0f('0x19')]();});}};}function handleEntityNotFound(_0x3dba57,_0x2fc3a2){return function(_0x2bcbf3){if(!_0x2bcbf3){_0x3dba57[_0x0c0f('0x18')](0x194);}return _0x2bcbf3;};}function handleError(_0x230f15,_0x2b443e){_0x2b443e=_0x2b443e||0x1f4;return function(_0x3f5d5a){logger['error'](_0x3f5d5a[_0x0c0f('0x27')]);if(_0x3f5d5a['name']){delete _0x3f5d5a[_0x0c0f('0x28')];}_0x230f15[_0x0c0f('0x1a')](_0x2b443e)[_0x0c0f('0x29')](_0x3f5d5a);};}exports['index']=function(_0x7b4093,_0x4fccf6){var _0x8d046a={},_0x504cd8={},_0x30868c={'count':0x0,'rows':[]};var _0x538dcd=_[_0x0c0f('0x2a')](db[_0x0c0f('0x2b')]['rawAttributes'],function(_0x2c51fc){return{'name':_0x2c51fc['fieldName'],'type':_0x2c51fc[_0x0c0f('0x2c')][_0x0c0f('0x2d')]};});_0x504cd8['model']=_[_0x0c0f('0x2a')](_0x538dcd,'name');_0x504cd8[_0x0c0f('0x2e')]=_[_0x0c0f('0x2f')](_0x7b4093[_0x0c0f('0x2e')]);_0x504cd8['filters']=_['intersection'](_0x504cd8[_0x0c0f('0x30')],_0x504cd8['query']);_0x8d046a[_0x0c0f('0x31')]=_[_0x0c0f('0x32')](_0x504cd8['model'],qs['fields'](_0x7b4093['query'][_0x0c0f('0x33')]));_0x8d046a['attributes']=_0x8d046a['attributes']['length']?_0x8d046a[_0x0c0f('0x31')]:_0x504cd8[_0x0c0f('0x30')];if(!_0x7b4093['query'][_0x0c0f('0x34')](_0x0c0f('0x35'))){_0x8d046a[_0x0c0f('0x1e')]=qs[_0x0c0f('0x1e')](_0x7b4093[_0x0c0f('0x2e')]['limit']);_0x8d046a[_0x0c0f('0x1c')]=qs['offset'](_0x7b4093[_0x0c0f('0x2e')][_0x0c0f('0x1c')]);}_0x8d046a[_0x0c0f('0x36')]=qs[_0x0c0f('0x37')](_0x7b4093[_0x0c0f('0x2e')][_0x0c0f('0x37')]);_0x8d046a[_0x0c0f('0x38')]=qs[_0x0c0f('0x39')](_[_0x0c0f('0x3a')](_0x7b4093[_0x0c0f('0x2e')],_0x504cd8[_0x0c0f('0x39')]),_0x538dcd);if(_0x7b4093[_0x0c0f('0x2e')][_0x0c0f('0x3b')]){_0x8d046a[_0x0c0f('0x38')]=_['merge'](_0x8d046a[_0x0c0f('0x38')],{'$or':_['map'](_0x538dcd,function(_0x4157ff){if(_0x4157ff[_0x0c0f('0x2c')]!==_0x0c0f('0x3c')){var _0x66aef1={};_0x66aef1[_0x4157ff['name']]={'$like':'%'+_0x7b4093['query'][_0x0c0f('0x3b')]+'%'};return _0x66aef1;}})});}_0x8d046a=_['merge']({},_0x8d046a,_0x7b4093[_0x0c0f('0x3d')]);var _0x140dc2={'where':_0x8d046a['where']};return db[_0x0c0f('0x2b')]['count'](_0x140dc2)['then'](function(_0x54f380){_0x30868c[_0x0c0f('0x1f')]=_0x54f380;if(_0x7b4093[_0x0c0f('0x2e')][_0x0c0f('0x3e')]){_0x8d046a['include']=[{'all':!![]}];}return db[_0x0c0f('0x2b')]['findAll'](_0x8d046a);})[_0x0c0f('0x25')](function(_0x4335eb){_0x30868c[_0x0c0f('0x3f')]=_0x4335eb;return _0x30868c;})['then'](respondWithFilteredResult(_0x4fccf6,_0x8d046a))[_0x0c0f('0x40')](handleError(_0x4fccf6,null));};exports[_0x0c0f('0x41')]=function(_0x46051c,_0x501498){var _0x3bc396={'raw':!![],'where':{'id':_0x46051c[_0x0c0f('0x42')]['id']}},_0x38e344={};_0x38e344[_0x0c0f('0x30')]=_[_0x0c0f('0x2f')](db['FaxApplication'][_0x0c0f('0x43')]);_0x38e344[_0x0c0f('0x2e')]=_[_0x0c0f('0x2f')](_0x46051c[_0x0c0f('0x2e')]);_0x38e344[_0x0c0f('0x39')]=_[_0x0c0f('0x32')](_0x38e344[_0x0c0f('0x30')],_0x38e344[_0x0c0f('0x2e')]);_0x3bc396[_0x0c0f('0x31')]=_[_0x0c0f('0x32')](_0x38e344[_0x0c0f('0x30')],qs[_0x0c0f('0x33')](_0x46051c['query'][_0x0c0f('0x33')]));_0x3bc396[_0x0c0f('0x31')]=_0x3bc396[_0x0c0f('0x31')][_0x0c0f('0x44')]?_0x3bc396[_0x0c0f('0x31')]:_0x38e344[_0x0c0f('0x30')];if(_0x46051c[_0x0c0f('0x2e')][_0x0c0f('0x3e')]){_0x3bc396[_0x0c0f('0x45')]=[{'all':!![]}];}_0x3bc396=_[_0x0c0f('0x46')]({},_0x3bc396,_0x46051c[_0x0c0f('0x3d')]);return db['FaxApplication'][_0x0c0f('0x47')](_0x3bc396)[_0x0c0f('0x25')](handleEntityNotFound(_0x501498,null))['then'](respondWithResult(_0x501498,null))[_0x0c0f('0x40')](handleError(_0x501498,null));};exports[_0x0c0f('0x48')]=function(_0x231556,_0x4ef6c6){return db[_0x0c0f('0x2b')][_0x0c0f('0x48')](_0x231556['body'],{})[_0x0c0f('0x25')](respondWithResult(_0x4ef6c6,0xc9))[_0x0c0f('0x40')](handleError(_0x4ef6c6,null));};exports[_0x0c0f('0x24')]=function(_0x1df7ab,_0x45e75a){if(_0x1df7ab[_0x0c0f('0x49')]['id']){delete _0x1df7ab[_0x0c0f('0x49')]['id'];}return db[_0x0c0f('0x2b')][_0x0c0f('0x47')]({'where':{'id':_0x1df7ab[_0x0c0f('0x42')]['id']}})[_0x0c0f('0x25')](handleEntityNotFound(_0x45e75a,null))[_0x0c0f('0x25')](saveUpdates(_0x1df7ab[_0x0c0f('0x49')],null))[_0x0c0f('0x25')](respondWithResult(_0x45e75a,null))['catch'](handleError(_0x45e75a,null));};exports['destroy']=function(_0x18047c,_0x63ac60){return db[_0x0c0f('0x2b')][_0x0c0f('0x47')]({'where':{'id':_0x18047c['params']['id']}})[_0x0c0f('0x25')](handleEntityNotFound(_0x63ac60,null))['then'](removeEntity(_0x63ac60,null))[_0x0c0f('0x40')](handleError(_0x63ac60,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 8a293fc..8f4c4a1 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 _0xd807=['./faxApplication.attributes','exports','FaxApplication','utf8mb4_unicode_ci','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);}(_0xd807,0xfb));var _0x7d80=function(_0x3470df,_0x30df04){_0x3470df=_0x3470df-0x0;var _0x387878=_0xd807[_0x3470df];return _0x387878;};'use strict';var _=require('lodash');var util=require(_0x7d80('0x0'));var logger=require(_0x7d80('0x1'))(_0x7d80('0x2'));var moment=require(_0x7d80('0x3'));var BPromise=require(_0x7d80('0x4'));var rp=require(_0x7d80('0x5'));var fs=require('fs');var path=require(_0x7d80('0x6'));var rimraf=require(_0x7d80('0x7'));var config=require(_0x7d80('0x8'));var attributes=require(_0x7d80('0x9'));module[_0x7d80('0xa')]=function(_0x46444d,_0x502d88){return _0x46444d['define'](_0x7d80('0xb'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7d80('0xc')});}; \ No newline at end of file +var _0x15e4=['FaxApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxApplication.attributes','exports','define'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x15e4,0xb8));var _0x415e=function(_0x6880e6,_0x4964d8){_0x6880e6=_0x6880e6-0x0;var _0x4c3672=_0x15e4[_0x6880e6];return _0x4c3672;};'use strict';var _=require(_0x415e('0x0'));var util=require(_0x415e('0x1'));var logger=require(_0x415e('0x2'))(_0x415e('0x3'));var moment=require(_0x415e('0x4'));var BPromise=require(_0x415e('0x5'));var rp=require(_0x415e('0x6'));var fs=require('fs');var path=require(_0x415e('0x7'));var rimraf=require('rimraf');var config=require(_0x415e('0x8'));var attributes=require(_0x415e('0x9'));module[_0x415e('0xa')]=function(_0x24ae13,_0x41850d){return _0x24ae13[_0x415e('0xb')](_0x415e('0xc'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x415e('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 5ccec64..4547243 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 _0xc2fc=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','message','catch','UpdateFaxApplication','FaxApplication','options','where','attributes','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2ca536,_0x3c62e4){var _0x204de1=function(_0x2e810a){while(--_0x2e810a){_0x2ca536['push'](_0x2ca536['shift']());}};_0x204de1(++_0x3c62e4);}(_0xc2fc,0xda));var _0xcc2f=function(_0x16be5f,_0x47e38d){_0x16be5f=_0x16be5f-0x0;var _0x52609b=_0xc2fc[_0x16be5f];return _0x52609b;};'use strict';var _=require(_0xcc2f('0x0'));var util=require(_0xcc2f('0x1'));var moment=require(_0xcc2f('0x2'));var BPromise=require('bluebird');var rs=require(_0xcc2f('0x3'));var fs=require('fs');var Redis=require(_0xcc2f('0x4'));var db=require(_0xcc2f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc2f('0x6'))(_0xcc2f('0x7'));var config=require(_0xcc2f('0x8'));var jayson=require(_0xcc2f('0x9'));var client=jayson[_0xcc2f('0xa')][_0xcc2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dae3b,_0x1a6918,_0x1c3749){return new BPromise(function(_0x49a841,_0x48f609){return client[_0xcc2f('0xc')](_0x2dae3b,_0x1c3749)[_0xcc2f('0xd')](function(_0x570315){logger[_0xcc2f('0xe')](_0xcc2f('0xf'),_0x1a6918,_0xcc2f('0x10'));logger[_0xcc2f('0x11')](_0xcc2f('0x12'),_0x1a6918,_0xcc2f('0x10'),JSON['stringify'](_0x570315));if(_0x570315[_0xcc2f('0x13')]){if(_0x570315[_0xcc2f('0x13')]['code']===0x1f4){logger['error'](_0xcc2f('0xf'),_0x1a6918,_0x570315[_0xcc2f('0x13')][_0xcc2f('0x14')]);return _0x48f609(_0x570315[_0xcc2f('0x13')]['message']);}logger[_0xcc2f('0x13')]('FaxApplication,\x20%s,\x20%s',_0x1a6918,_0x570315[_0xcc2f('0x13')]['message']);return _0x49a841(_0x570315[_0xcc2f('0x13')][_0xcc2f('0x14')]);}else{logger[_0xcc2f('0xe')](_0xcc2f('0xf'),_0x1a6918,_0xcc2f('0x10'));_0x49a841(_0x570315['result']['message']);}})[_0xcc2f('0x15')](function(_0x1a5642){logger[_0xcc2f('0x13')](_0xcc2f('0xf'),_0x1a6918,_0x1a5642);_0x48f609(_0x1a5642);});});}exports[_0xcc2f('0x16')]=function(_0x58f529){var _0x225af1=this;return new Promise(function(_0x275626,_0x7fbccd){return db[_0xcc2f('0x17')]['update'](_0x58f529['body'],{'raw':_0x58f529[_0xcc2f('0x18')]?_0x58f529['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58f529['options']?_0x58f529[_0xcc2f('0x18')][_0xcc2f('0x19')]||null:null,'attributes':_0x58f529[_0xcc2f('0x18')]?_0x58f529['options'][_0xcc2f('0x1a')]||null:null,'limit':_0x58f529[_0xcc2f('0x18')]?_0x58f529['options']['limit']||null:null})[_0xcc2f('0xd')](function(_0x281e6a){logger[_0xcc2f('0xe')]('UpdateFaxApplication',_0x58f529);logger[_0xcc2f('0x11')](_0xcc2f('0x16'),_0x58f529,JSON[_0xcc2f('0x1b')](_0x281e6a));_0x275626(_0x281e6a);})[_0xcc2f('0x15')](function(_0x178835){logger['error'](_0xcc2f('0x16'),_0x178835[_0xcc2f('0x14')],_0x58f529);_0x7fbccd(_0x225af1[_0xcc2f('0x13')](0x1f4,_0x178835['message']));});});}; \ No newline at end of file +var _0xfb0b=['FaxApplication','update','body','options','raw','where','attributes','UpdateFaxApplication','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','FaxApplication,\x20%s,\x20%s','result'];(function(_0x457092,_0x109dff){var _0xb2d7a2=function(_0x483e39){while(--_0x483e39){_0x457092['push'](_0x457092['shift']());}};_0xb2d7a2(++_0x109dff);}(_0xfb0b,0x1d8));var _0xbfb0=function(_0x5b8f9a,_0x6079fd){_0x5b8f9a=_0x5b8f9a-0x0;var _0x2c1d4c=_0xfb0b[_0x5b8f9a];return _0x2c1d4c;};'use strict';var _=require(_0xbfb0('0x0'));var util=require('util');var moment=require(_0xbfb0('0x1'));var BPromise=require('bluebird');var rs=require(_0xbfb0('0x2'));var fs=require('fs');var Redis=require(_0xbfb0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbfb0('0x4'));var logger=require(_0xbfb0('0x5'))('rpc');var config=require(_0xbfb0('0x6'));var jayson=require(_0xbfb0('0x7'));var client=jayson[_0xbfb0('0x8')][_0xbfb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x224c2a,_0x527964,_0x3e15e5){return new BPromise(function(_0x573298,_0xdd2f1a){return client[_0xbfb0('0xa')](_0x224c2a,_0x3e15e5)[_0xbfb0('0xb')](function(_0x3d318d){logger[_0xbfb0('0xc')]('FaxApplication,\x20%s,\x20%s',_0x527964,_0xbfb0('0xd'));logger[_0xbfb0('0xe')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x527964,_0xbfb0('0xd'),JSON[_0xbfb0('0xf')](_0x3d318d));if(_0x3d318d[_0xbfb0('0x10')]){if(_0x3d318d[_0xbfb0('0x10')][_0xbfb0('0x11')]===0x1f4){logger[_0xbfb0('0x10')]('FaxApplication,\x20%s,\x20%s',_0x527964,_0x3d318d['error'][_0xbfb0('0x12')]);return _0xdd2f1a(_0x3d318d['error'][_0xbfb0('0x12')]);}logger[_0xbfb0('0x10')](_0xbfb0('0x13'),_0x527964,_0x3d318d['error'][_0xbfb0('0x12')]);return _0x573298(_0x3d318d[_0xbfb0('0x10')][_0xbfb0('0x12')]);}else{logger[_0xbfb0('0xc')]('FaxApplication,\x20%s,\x20%s',_0x527964,'request\x20sent');_0x573298(_0x3d318d[_0xbfb0('0x14')][_0xbfb0('0x12')]);}})['catch'](function(_0x214929){logger[_0xbfb0('0x10')](_0xbfb0('0x13'),_0x527964,_0x214929);_0xdd2f1a(_0x214929);});});}exports['UpdateFaxApplication']=function(_0x2ea46f){var _0x1ffc8a=this;return new Promise(function(_0x1ca868,_0x2f7fab){return db[_0xbfb0('0x15')][_0xbfb0('0x16')](_0x2ea46f[_0xbfb0('0x17')],{'raw':_0x2ea46f[_0xbfb0('0x18')]?_0x2ea46f[_0xbfb0('0x18')][_0xbfb0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ea46f['options']?_0x2ea46f['options'][_0xbfb0('0x1a')]||null:null,'attributes':_0x2ea46f['options']?_0x2ea46f['options'][_0xbfb0('0x1b')]||null:null,'limit':_0x2ea46f[_0xbfb0('0x18')]?_0x2ea46f[_0xbfb0('0x18')]['limit']||null:null})[_0xbfb0('0xb')](function(_0x2467ce){logger[_0xbfb0('0xc')](_0xbfb0('0x1c'),_0x2ea46f);logger[_0xbfb0('0xe')](_0xbfb0('0x1c'),_0x2ea46f,JSON[_0xbfb0('0xf')](_0x2467ce));_0x1ca868(_0x2467ce);})['catch'](function(_0x251980){logger[_0xbfb0('0x10')](_0xbfb0('0x1c'),_0x251980[_0xbfb0('0x12')],_0x2ea46f);_0x2f7fab(_0x1ffc8a[_0xbfb0('0x10')](0x1f4,_0x251980[_0xbfb0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index ebc7c6f..86bff26 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 _0xd4a2=['../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','connect-timeout','Router'];(function(_0xce0b20,_0x2f6f89){var _0x345e42=function(_0x12ac5f){while(--_0x12ac5f){_0xce0b20['push'](_0xce0b20['shift']());}};_0x345e42(++_0x2f6f89);}(_0xd4a2,0x173));var _0x2d4a=function(_0x3557af,_0x1ab748){_0x3557af=_0x3557af-0x0;var _0x42362b=_0xd4a2[_0x3557af];return _0x42362b;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0xb')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0xd')](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0xf')](_0x2d4a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x2d4a('0x10')]=router; \ No newline at end of file +var _0xe5b5=['../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2d3485,_0x4af469){var _0x1d209b=function(_0x15a041){while(--_0x15a041){_0x2d3485['push'](_0x2d3485['shift']());}};_0x1d209b(++_0x4af469);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0xe5b5[_0x26b80e];return _0x84a8a8;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0x10')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0x12')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x13')]);router['delete'](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x14')]);module[_0x5e5b('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 74dbec1..60fd39d 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 _0x8f4c=['out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x230143,_0x22949b){var _0x5e9ee3=function(_0xe0aff2){while(--_0xe0aff2){_0x230143['push'](_0x230143['shift']());}};_0x5e9ee3(++_0x22949b);}(_0x8f4c,0x113));var _0xc8f4=function(_0x30db0a,_0x6561ab){_0x30db0a=_0x30db0a-0x0;var _0x23fea7=_0x8f4c[_0x30db0a];return _0x23fea7;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'closed':{'type':Sequelize[_0xc8f4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc8f4('0x3')]},'disposition':{'type':Sequelize[_0xc8f4('0x4')]},'secondDisposition':{'type':Sequelize[_0xc8f4('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc8f4('0x4')]},'read1stAt':{'type':Sequelize[_0xc8f4('0x3')]},'fax':{'type':Sequelize[_0xc8f4('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xc8f4('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xc8f4('0x6')]}}; \ No newline at end of file +var _0xa6b0=['sequelize','exports','STRING','DATE','ENUM','out','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x5c53fd,_0x3db1ea){_0x5c53fd=_0x5c53fd-0x0;var _0x22c3f0=_0xa6b0[_0x5c53fd];return _0x22c3f0;};'use strict';var Sequelize=require(_0x0a6b('0x0'));module[_0x0a6b('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0a6b('0x2')]},'secondDisposition':{'type':Sequelize[_0x0a6b('0x2')]},'thirdDisposition':{'type':Sequelize[_0x0a6b('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0a6b('0x3')]},'fax':{'type':Sequelize[_0x0a6b('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x0a6b('0x4')]('in',_0x0a6b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0a6b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0a6b('0x4')]('in',_0x0a6b('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x0a6b('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 29193ef..8660acd 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 _0xa25a=['unix','toString','server','files','join','root','attachments','Attachment','Messages','createdAt','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','resolve','log','err','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','offset','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','key','getOptions','findAll','query','user','catch','show','params','model','keys','filters','intersection','fields','attributes','length','merge','options','body','find','describe','FaxMessage','addMessage','omit','ids','getMessages','findOne','hasOwnProperty','order','sort','where','pick','FaxInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','rows','addTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa25a,0x78));var _0xaa25=function(_0x103e39,_0x7db66){_0x103e39=_0x103e39-0x0;var _0x3e95c3=_0xa25a[_0x103e39];return _0x3e95c3;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0xaa25('0x0'));var BPromise=require(_0xaa25('0x1'));var util=require(_0xaa25('0x2'));var path=require(_0xaa25('0x3'));var fs=require('fs');var _=require(_0xaa25('0x4'));var Redis=require(_0xaa25('0x5'));var interaction=require(_0xaa25('0x6'));var qs=require(_0xaa25('0x7'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xaa25('0x8'))['db'];config['redis']=_[_0xaa25('0x9')](config[_0xaa25('0xa')],{'host':_0xaa25('0xb'),'port':0x18eb});var socket=require(_0xaa25('0xc'))(new Redis(config[_0xaa25('0xa')]));require(_0xaa25('0xd'))[_0xaa25('0xe')](socket);function respondWithStatusCode(_0x4fdcea,_0x15e493){_0x15e493=_0x15e493||0xcc;return function(_0x5b7a8b){if(_0x5b7a8b){return _0x4fdcea[_0xaa25('0xf')](_0x15e493);}return _0x4fdcea[_0xaa25('0x10')](_0x15e493)[_0xaa25('0x11')]();};}function respondWithResult(_0x1cdd37,_0x570cb8){_0x570cb8=_0x570cb8||0xc8;return function(_0x48715f){if(_0x48715f){return _0x1cdd37['status'](_0x570cb8)['json'](_0x48715f);}};}function respondWithFilteredResult(_0x41f954,_0x37a64b){return function(_0x4b57c5){if(_0x4b57c5){var _0x4a9ce9=typeof _0x37a64b[_0xaa25('0x12')]==='undefined'&&typeof _0x37a64b[_0xaa25('0x13')]==='undefined';var _0x47bfa5=_0x4b57c5[_0xaa25('0x14')];var _0x595073=_0x4a9ce9?0x0:_0x37a64b[_0xaa25('0x12')];var _0xab3832=_0x4a9ce9?_0x4b57c5[_0xaa25('0x14')]:_0x37a64b[_0xaa25('0x12')]+_0x37a64b[_0xaa25('0x13')];var _0x1403fa;if(_0xab3832>=_0x47bfa5){_0xab3832=_0x47bfa5;_0x1403fa=0xc8;}else{_0x1403fa=0xce;}_0x41f954[_0xaa25('0x10')](_0x1403fa);return _0x41f954[_0xaa25('0x15')](_0xaa25('0x16'),_0x595073+'-'+_0xab3832+'/'+_0x47bfa5)['json'](_0x4b57c5);}return null;};}function saveUpdates(_0x24ec63){return function(_0x3321f8){if(_0x3321f8){return _0x3321f8[_0xaa25('0x17')](_0x24ec63)[_0xaa25('0x18')](function(_0x291093){return _0x291093;});}return null;};}function removeEntity(_0x1bfcd3){return function(_0x149764){if(_0x149764){return _0x149764[_0xaa25('0x19')]()[_0xaa25('0x18')](function(){_0x1bfcd3[_0xaa25('0x10')](0xcc)[_0xaa25('0x11')]();});}};}function handleEntityNotFound(_0xa3d644){return function(_0x2a2c60){if(!_0x2a2c60){_0xa3d644[_0xaa25('0xf')](0x194);}return _0x2a2c60;};}function handleError(_0x34f1d8,_0x41e0e3){_0x41e0e3=_0x41e0e3||0x1f4;return function(_0x273178){logger[_0xaa25('0x1a')](_0x273178[_0xaa25('0x1b')]);if(_0x273178['name']){delete _0x273178[_0xaa25('0x1c')];}_0x34f1d8['status'](_0x41e0e3)[_0xaa25('0x1d')](_0x273178);};}exports[_0xaa25('0x1e')]=function(_0x4d39cc,_0x345a0c){var _0x1fe7ca={};var _0x5ba5ee=_[_0xaa25('0x1f')](db[_0xaa25('0x20')][_0xaa25('0x21')],function(_0x419836){return{'name':_0x419836[_0xaa25('0x22')],'type':_0x419836['type'][_0xaa25('0x23')]};});_0x1fe7ca=qs[_0xaa25('0x24')](_0x5ba5ee,_0x4d39cc);return interaction[_0xaa25('0x25')]('fax',_0x4d39cc[_0xaa25('0x26')],_0x4d39cc[_0xaa25('0x27')],_0x1fe7ca,_0x5ba5ee)[_0xaa25('0x18')](respondWithFilteredResult(_0x345a0c,_0x1fe7ca))[_0xaa25('0x28')](handleError(_0x345a0c,null));};exports[_0xaa25('0x29')]=function(_0x22cab7,_0xc617d5){var _0x572207={'raw':![],'where':{'id':_0x22cab7[_0xaa25('0x2a')]['id']}},_0x4c88dd={};_0x4c88dd[_0xaa25('0x2b')]=_[_0xaa25('0x2c')](db['FaxInteraction']['rawAttributes']);_0x4c88dd['query']=_[_0xaa25('0x2c')](_0x22cab7[_0xaa25('0x26')]);_0x4c88dd[_0xaa25('0x2d')]=_[_0xaa25('0x2e')](_0x4c88dd[_0xaa25('0x2b')],_0x4c88dd[_0xaa25('0x26')]);_0x572207['attributes']=_[_0xaa25('0x2e')](_0x4c88dd['model'],qs[_0xaa25('0x2f')](_0x22cab7[_0xaa25('0x26')][_0xaa25('0x2f')]));_0x572207[_0xaa25('0x30')]=_0x572207[_0xaa25('0x30')][_0xaa25('0x31')]?_0x572207['attributes']:_0x4c88dd['model'];if(_0x22cab7['query']['includeAll']){_0x572207['include']=[{'all':!![]}];}_0x572207=_[_0xaa25('0x32')]({},_0x572207,_0x22cab7[_0xaa25('0x33')]);return db[_0xaa25('0x20')]['find'](_0x572207)[_0xaa25('0x18')](handleEntityNotFound(_0xc617d5,null))[_0xaa25('0x18')](respondWithResult(_0xc617d5,null))[_0xaa25('0x28')](handleError(_0xc617d5,null));};exports['create']=function(_0x41b1f4,_0x51c116){return db[_0xaa25('0x20')]['create'](_0x41b1f4[_0xaa25('0x34')],{})['then'](respondWithResult(_0x51c116,0xc9))[_0xaa25('0x28')](handleError(_0x51c116,null));};exports['update']=function(_0x3611a4,_0x5d7d68){if(_0x3611a4[_0xaa25('0x34')]['id']){delete _0x3611a4[_0xaa25('0x34')]['id'];}return db[_0xaa25('0x20')][_0xaa25('0x35')]({'where':{'id':_0x3611a4[_0xaa25('0x2a')]['id']}})[_0xaa25('0x18')](handleEntityNotFound(_0x5d7d68,null))[_0xaa25('0x18')](saveUpdates(_0x3611a4[_0xaa25('0x34')],null))[_0xaa25('0x18')](respondWithResult(_0x5d7d68,null))['catch'](handleError(_0x5d7d68,null));};exports[_0xaa25('0x19')]=function(_0x2d51be,_0x1fbca3){return db[_0xaa25('0x20')][_0xaa25('0x35')]({'where':{'id':_0x2d51be[_0xaa25('0x2a')]['id']}})[_0xaa25('0x18')](handleEntityNotFound(_0x1fbca3,null))[_0xaa25('0x18')](removeEntity(_0x1fbca3,null))[_0xaa25('0x28')](handleError(_0x1fbca3,null));};exports[_0xaa25('0x36')]=function(_0x39bdec,_0x57ce68){return db[_0xaa25('0x20')][_0xaa25('0x36')]()[_0xaa25('0x18')](respondWithResult(_0x57ce68,null))['catch'](handleError(_0x57ce68,null));};exports['addMessage']=function(_0x4d3fb9,_0x517b39){return db[_0xaa25('0x37')]['find']({'where':{'id':_0x4d3fb9[_0xaa25('0x2a')]['id']}})['then'](handleEntityNotFound(_0x517b39,null))['then'](function(_0x479a5e){if(_0x479a5e){return _0x479a5e[_0xaa25('0x38')](_0x4d3fb9[_0xaa25('0x34')]['ids'],_[_0xaa25('0x39')](_0x4d3fb9['body'],[_0xaa25('0x3a'),'id'])||{});}})[_0xaa25('0x18')](respondWithResult(_0x517b39,null))[_0xaa25('0x28')](handleError(_0x517b39,null));};exports[_0xaa25('0x3b')]=function(_0x1c09ef,_0x17cb98){var _0xeea9bb={'raw':![],'where':{}};var _0x2101c1={};var _0x57e641={'count':0x0,'rows':[]};return db[_0xaa25('0x20')][_0xaa25('0x3c')]({'where':{'id':_0x1c09ef[_0xaa25('0x2a')]['id']}})[_0xaa25('0x18')](handleEntityNotFound(_0x17cb98,null))['then'](function(_0x55a3bb){if(_0x55a3bb){_0x2101c1[_0xaa25('0x2b')]=_['keys'](db['FaxMessage'][_0xaa25('0x21')]);_0x2101c1[_0xaa25('0x26')]=_['keys'](_0x1c09ef[_0xaa25('0x26')]);_0x2101c1[_0xaa25('0x2d')]=_[_0xaa25('0x2e')](_0x2101c1['model'],_0x2101c1[_0xaa25('0x26')]);_0xeea9bb[_0xaa25('0x30')]=_['intersection'](_0x2101c1[_0xaa25('0x2b')],qs['fields'](_0x1c09ef[_0xaa25('0x26')][_0xaa25('0x2f')]));_0xeea9bb[_0xaa25('0x30')]=_0xeea9bb['attributes'][_0xaa25('0x31')]?_0xeea9bb[_0xaa25('0x30')]:_0x2101c1[_0xaa25('0x2b')];if(!_0x1c09ef[_0xaa25('0x26')][_0xaa25('0x3d')]('nolimit')){_0xeea9bb[_0xaa25('0x13')]=qs[_0xaa25('0x13')](_0x1c09ef[_0xaa25('0x26')]['limit']);_0xeea9bb[_0xaa25('0x12')]=qs['offset'](_0x1c09ef[_0xaa25('0x26')][_0xaa25('0x12')]);}_0xeea9bb[_0xaa25('0x3e')]=qs[_0xaa25('0x3f')](_0x1c09ef[_0xaa25('0x26')]['sort']);_0xeea9bb[_0xaa25('0x40')]=qs['filters'](_[_0xaa25('0x41')](_0x1c09ef[_0xaa25('0x26')],_0x2101c1[_0xaa25('0x2d')]));_0xeea9bb['where'][_0xaa25('0x42')]=_0x55a3bb['id'];if(_0x1c09ef[_0xaa25('0x26')]['filter']){_0xeea9bb[_0xaa25('0x40')]=_['merge'](_0xeea9bb[_0xaa25('0x40')],{'$or':_[_0xaa25('0x1f')](_0xeea9bb[_0xaa25('0x30')],function(_0x367e51){var _0x3f6bda={};_0x3f6bda[_0x367e51]={'$like':'%'+_0x1c09ef['query'][_0xaa25('0x43')]+'%'};return _0x3f6bda;})});}if(_0x1c09ef[_0xaa25('0x26')][_0xaa25('0x44')]){var _0x219db0=_0x1c09ef['query'][_0xaa25('0x44')]['split'](',');var _0x5e43e5={};_0x5e43e5[_0x219db0[0x0]]={'$gte':moment(_0x219db0[0x1])[_0xaa25('0x45')](_0xaa25('0x46'))};_0xeea9bb[_0xaa25('0x40')]=_[_0xaa25('0x32')](_0xeea9bb[_0xaa25('0x40')],_0x5e43e5);}_0xeea9bb=_[_0xaa25('0x32')]({},_0xeea9bb,_0x1c09ef[_0xaa25('0x33')]);return db[_0xaa25('0x37')][_0xaa25('0x14')]({'where':_0xeea9bb['where']})[_0xaa25('0x18')](function(_0x53f751){_0x57e641['count']=_0x53f751;if(_0x1c09ef[_0xaa25('0x26')][_0xaa25('0x47')]){_0xeea9bb[_0xaa25('0x48')]=[{'all':!![]}];}return db['FaxMessage'][_0xaa25('0x25')](_0xeea9bb);})['then'](function(_0xa92b41){_0x57e641[_0xaa25('0x49')]=_0xa92b41;return _0x57e641;});}})[_0xaa25('0x18')](respondWithFilteredResult(_0x17cb98,_0xeea9bb))[_0xaa25('0x28')](handleError(_0x17cb98,null));};exports[_0xaa25('0x4a')]=function(_0x3fa4cf,_0x233c31){return db[_0xaa25('0x20')][_0xaa25('0x35')]({'where':{'id':_0x3fa4cf[_0xaa25('0x2a')]['id']}})[_0xaa25('0x18')](handleEntityNotFound(_0x233c31,null))[_0xaa25('0x18')](function(_0x1da9a6){if(_0x1da9a6){return _0x1da9a6['setTags'](_0x3fa4cf[_0xaa25('0x34')]['ids'],_[_0xaa25('0x39')](_0x3fa4cf[_0xaa25('0x34')],[_0xaa25('0x3a'),'id'])||{})[_0xaa25('0x4b')](function(){return db[_0xaa25('0x4c')][_0xaa25('0x25')]({'attributes':['id',_0xaa25('0x1c'),_0xaa25('0x4d')],'where':{'id':_0x3fa4cf[_0xaa25('0x34')]['ids']}});})[_0xaa25('0x18')](function(_0x387bc2){socket[_0xaa25('0x4e')](_0xaa25('0x4f'),{'id':Number(_0x3fa4cf['params']['id']),'tags':_0x387bc2||[]});return{'id':Number(_0x3fa4cf[_0xaa25('0x2a')]['id']),'tags':_0x387bc2||[]};});}})['then'](respondWithResult(_0x233c31,null))[_0xaa25('0x28')](handleError(_0x233c31,null));};exports[_0xaa25('0x50')]=function(_0x5ed3b8,_0xf353c8){return db[_0xaa25('0x20')][_0xaa25('0x35')]({'where':{'id':_0x5ed3b8[_0xaa25('0x2a')]['id']}})[_0xaa25('0x18')](handleEntityNotFound(_0xf353c8,null))[_0xaa25('0x18')](function(_0x4f6755){if(_0x4f6755){return _0x4f6755[_0xaa25('0x50')](_0x5ed3b8[_0xaa25('0x26')]['ids']);}})[_0xaa25('0x18')](respondWithStatusCode(_0xf353c8,null))[_0xaa25('0x28')](handleError(_0xf353c8,null));};exports[_0xaa25('0x51')]=function(_0x594f51,_0x5a29d2){var _0x220ad6=moment()[_0xaa25('0x52')]()[_0xaa25('0x53')]();var _0x3c4063=path['join'](config['root'],_0xaa25('0x54'),_0xaa25('0x55'),'tmp');var _0x40330f=path[_0xaa25('0x56')](config[_0xaa25('0x57')],_0xaa25('0x54'),_0xaa25('0x55'),_0xaa25('0x58'));var _0x3afa92=path[_0xaa25('0x56')](_0x3c4063,_0x220ad6);var _0x12e705=util[_0xaa25('0x45')]('transcript-%d-%s.zip',_0x594f51[_0xaa25('0x2a')]['id'],_0x220ad6);var _0x48b6fa=path[_0xaa25('0x56')](_0x3c4063,_0x12e705);var _0x7690d2=[];_0x7690d2['push']({'model':db[_0xaa25('0x59')],'as':_0xaa25('0x59'),'raw':!![]});var _0x1485ab=[{'model':db[_0xaa25('0x37')],'as':_0xaa25('0x5a'),'attributes':['id','body',_0xaa25('0x5b')],'include':_0x7690d2}];return db[_0xaa25('0x20')][_0xaa25('0x35')]({'where':{'id':_0x594f51[_0xaa25('0x2a')]['id']},'include':_0x1485ab})[_0xaa25('0x18')](handleEntityNotFound(_0x5a29d2,null))['then'](function(_0x1788df){if(_0x1788df&&_0x1788df[_0xaa25('0x5a')]){var _0x13fe9a=_0x1788df[_0xaa25('0x5c')]({'plain':!![]});fs[_0xaa25('0x5d')](_0x3afa92);for(var _0x7849af=0x0;_0x7849af<_0x13fe9a[_0xaa25('0x5a')]['length'];_0x7849af++){var _0x5e97c9=_0x13fe9a[_0xaa25('0x5a')][_0x7849af][_0xaa25('0x59')];if(_0x5e97c9){var _0x48dfe4=path[_0xaa25('0x56')](_0x40330f,_0x5e97c9[_0xaa25('0x5e')]);if(fs['existsSync'](_0x48dfe4)){fs[_0xaa25('0x5f')](_0x48dfe4)[_0xaa25('0x60')](fs[_0xaa25('0x61')](path[_0xaa25('0x56')](_0x3afa92,_0x5e97c9['basename'])));}}}return BPromise[_0xaa25('0x62')]()[_0xaa25('0x18')](function(){return new BPromise(function(_0x51a5b0,_0x493613){zipdir(_0x3afa92,{'saveTo':_0x48b6fa},function(_0x1a841d,_0x4b21c5){if(_0x1a841d)return _0x493613(_0x1a841d);return _0x51a5b0(_0x4b21c5);});})['then'](function(){return new BPromise(function(_0x1ad411,_0x40fe42){rimraf(_0x3afa92,function(_0x14d89b){if(_0x14d89b)_0x40fe42(_0x14d89b);return _0x1ad411();});});})['then'](function(){return _0x5a29d2[_0xaa25('0x51')](_0x48b6fa,_0x12e705,function(_0x41dfc7){if(_0x41dfc7){console[_0xaa25('0x63')](_0xaa25('0x64'),_0x41dfc7);}else{fs['unlinkSync'](_0x48b6fa);}});});});}else{return _0x5a29d2[_0xaa25('0xf')](0xc8);}})['catch'](handleError(_0x5a29d2,null));}; \ No newline at end of file +var _0x2b4a=['removeTags','download','unix','toString','root','server','files','tmp','join','attachments','push','Attachment','createdAt','Messages','mkdirSync','pipe','createWriteStream','basename','resolve','log','err','rimraf','zip-dir','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','map','FaxInteraction','fieldName','getOptions','findAll','fax','query','params','model','keys','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','describe','addMessage','FaxMessage','ids','omit','rawAttributes','hasOwnProperty','order','sort','pick','FaxInteractionId','filter','where','$gte','split','format','rows','addTags','setTags','spread','Tag','emit'];(function(_0x7d80c1,_0x20b039){var _0x20a123=function(_0x3a63fb){while(--_0x3a63fb){_0x7d80c1['push'](_0x7d80c1['shift']());}};_0x20a123(++_0x20b039);}(_0x2b4a,0x13e));var _0xa2b4=function(_0x2b81be,_0x544bdf){_0x2b81be=_0x2b81be-0x0;var _0x8ed4a7=_0x2b4a[_0x2b81be];return _0x8ed4a7;};'use strict';var rimraf=require(_0xa2b4('0x0'));var zipdir=require(_0xa2b4('0x1'));var moment=require(_0xa2b4('0x2'));var BPromise=require(_0xa2b4('0x3'));var util=require(_0xa2b4('0x4'));var path=require(_0xa2b4('0x5'));var fs=require('fs');var _=require(_0xa2b4('0x6'));var Redis=require(_0xa2b4('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0xa2b4('0x8'));var logger=require(_0xa2b4('0x9'))(_0xa2b4('0xa'));var config=require(_0xa2b4('0xb'));var db=require('../../mysqldb')['db'];config[_0xa2b4('0xc')]=_[_0xa2b4('0xd')](config['redis'],{'host':_0xa2b4('0xe'),'port':0x18eb});var socket=require(_0xa2b4('0xf'))(new Redis(config[_0xa2b4('0xc')]));require(_0xa2b4('0x10'))[_0xa2b4('0x11')](socket);function respondWithStatusCode(_0x20619e,_0x5e5cb0){_0x5e5cb0=_0x5e5cb0||0xcc;return function(_0x5f5abc){if(_0x5f5abc){return _0x20619e[_0xa2b4('0x12')](_0x5e5cb0);}return _0x20619e['status'](_0x5e5cb0)[_0xa2b4('0x13')]();};}function respondWithResult(_0x2975b1,_0x2913ce){_0x2913ce=_0x2913ce||0xc8;return function(_0x39e30e){if(_0x39e30e){return _0x2975b1[_0xa2b4('0x14')](_0x2913ce)[_0xa2b4('0x15')](_0x39e30e);}};}function respondWithFilteredResult(_0x1ee212,_0x337d97){return function(_0x2dc151){if(_0x2dc151){var _0x22a14=typeof _0x337d97[_0xa2b4('0x16')]===_0xa2b4('0x17')&&typeof _0x337d97[_0xa2b4('0x18')]===_0xa2b4('0x17');var _0x56c444=_0x2dc151[_0xa2b4('0x19')];var _0x2ab39b=_0x22a14?0x0:_0x337d97[_0xa2b4('0x16')];var _0x296249=_0x22a14?_0x2dc151[_0xa2b4('0x19')]:_0x337d97[_0xa2b4('0x16')]+_0x337d97['limit'];var _0x326491;if(_0x296249>=_0x56c444){_0x296249=_0x56c444;_0x326491=0xc8;}else{_0x326491=0xce;}_0x1ee212[_0xa2b4('0x14')](_0x326491);return _0x1ee212[_0xa2b4('0x1a')](_0xa2b4('0x1b'),_0x2ab39b+'-'+_0x296249+'/'+_0x56c444)['json'](_0x2dc151);}return null;};}function saveUpdates(_0x50ca0c){return function(_0x3083ea){if(_0x3083ea){return _0x3083ea[_0xa2b4('0x1c')](_0x50ca0c)[_0xa2b4('0x1d')](function(_0x6ed641){return _0x6ed641;});}return null;};}function removeEntity(_0x5d6ce3){return function(_0x66db7f){if(_0x66db7f){return _0x66db7f[_0xa2b4('0x1e')]()[_0xa2b4('0x1d')](function(){_0x5d6ce3[_0xa2b4('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57b56e){return function(_0x538eda){if(!_0x538eda){_0x57b56e[_0xa2b4('0x12')](0x194);}return _0x538eda;};}function handleError(_0x47c22b,_0x46aa5c){_0x46aa5c=_0x46aa5c||0x1f4;return function(_0x389a42){logger[_0xa2b4('0x1f')](_0x389a42[_0xa2b4('0x20')]);if(_0x389a42[_0xa2b4('0x21')]){delete _0x389a42['name'];}_0x47c22b[_0xa2b4('0x14')](_0x46aa5c)['send'](_0x389a42);};}exports['index']=function(_0x54b35a,_0x1fc4ba){var _0xa407de={};var _0x3e824b=_[_0xa2b4('0x22')](db[_0xa2b4('0x23')]['rawAttributes'],function(_0x272dcb){return{'name':_0x272dcb[_0xa2b4('0x24')],'type':_0x272dcb['type']['key']};});_0xa407de=qs[_0xa2b4('0x25')](_0x3e824b,_0x54b35a);return interaction[_0xa2b4('0x26')](_0xa2b4('0x27'),_0x54b35a[_0xa2b4('0x28')],_0x54b35a['user'],_0xa407de,_0x3e824b)[_0xa2b4('0x1d')](respondWithFilteredResult(_0x1fc4ba,_0xa407de))['catch'](handleError(_0x1fc4ba,null));};exports['show']=function(_0x33e0f9,_0x5cabc4){var _0x24310c={'raw':![],'where':{'id':_0x33e0f9[_0xa2b4('0x29')]['id']}},_0x4dd746={};_0x4dd746[_0xa2b4('0x2a')]=_[_0xa2b4('0x2b')](db['FaxInteraction']['rawAttributes']);_0x4dd746[_0xa2b4('0x28')]=_[_0xa2b4('0x2b')](_0x33e0f9[_0xa2b4('0x28')]);_0x4dd746[_0xa2b4('0x2c')]=_[_0xa2b4('0x2d')](_0x4dd746['model'],_0x4dd746[_0xa2b4('0x28')]);_0x24310c['attributes']=_[_0xa2b4('0x2d')](_0x4dd746['model'],qs['fields'](_0x33e0f9[_0xa2b4('0x28')][_0xa2b4('0x2e')]));_0x24310c[_0xa2b4('0x2f')]=_0x24310c[_0xa2b4('0x2f')][_0xa2b4('0x30')]?_0x24310c['attributes']:_0x4dd746[_0xa2b4('0x2a')];if(_0x33e0f9[_0xa2b4('0x28')][_0xa2b4('0x31')]){_0x24310c[_0xa2b4('0x32')]=[{'all':!![]}];}_0x24310c=_[_0xa2b4('0x33')]({},_0x24310c,_0x33e0f9[_0xa2b4('0x34')]);return db['FaxInteraction']['find'](_0x24310c)[_0xa2b4('0x1d')](handleEntityNotFound(_0x5cabc4,null))['then'](respondWithResult(_0x5cabc4,null))['catch'](handleError(_0x5cabc4,null));};exports['create']=function(_0x5e293e,_0x50a1e9){return db[_0xa2b4('0x23')]['create'](_0x5e293e['body'],{})[_0xa2b4('0x1d')](respondWithResult(_0x50a1e9,0xc9))[_0xa2b4('0x35')](handleError(_0x50a1e9,null));};exports[_0xa2b4('0x1c')]=function(_0x50a0fa,_0x3bdbec){if(_0x50a0fa['body']['id']){delete _0x50a0fa[_0xa2b4('0x36')]['id'];}return db[_0xa2b4('0x23')]['find']({'where':{'id':_0x50a0fa['params']['id']}})['then'](handleEntityNotFound(_0x3bdbec,null))[_0xa2b4('0x1d')](saveUpdates(_0x50a0fa[_0xa2b4('0x36')],null))[_0xa2b4('0x1d')](respondWithResult(_0x3bdbec,null))[_0xa2b4('0x35')](handleError(_0x3bdbec,null));};exports[_0xa2b4('0x1e')]=function(_0x4b5452,_0x768393){return db[_0xa2b4('0x23')][_0xa2b4('0x37')]({'where':{'id':_0x4b5452[_0xa2b4('0x29')]['id']}})['then'](handleEntityNotFound(_0x768393,null))[_0xa2b4('0x1d')](removeEntity(_0x768393,null))['catch'](handleError(_0x768393,null));};exports['describe']=function(_0x474a5f,_0x4c1870){return db['FaxInteraction'][_0xa2b4('0x38')]()[_0xa2b4('0x1d')](respondWithResult(_0x4c1870,null))[_0xa2b4('0x35')](handleError(_0x4c1870,null));};exports[_0xa2b4('0x39')]=function(_0x120608,_0x39c766){return db[_0xa2b4('0x3a')]['find']({'where':{'id':_0x120608[_0xa2b4('0x29')]['id']}})[_0xa2b4('0x1d')](handleEntityNotFound(_0x39c766,null))['then'](function(_0x52dda2){if(_0x52dda2){return _0x52dda2[_0xa2b4('0x39')](_0x120608[_0xa2b4('0x36')][_0xa2b4('0x3b')],_[_0xa2b4('0x3c')](_0x120608[_0xa2b4('0x36')],['ids','id'])||{});}})['then'](respondWithResult(_0x39c766,null))['catch'](handleError(_0x39c766,null));};exports['getMessages']=function(_0x28e21c,_0x58b485){var _0x11e9fe={'raw':![],'where':{}};var _0x191d77={};var _0x2ff7bd={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x28e21c['params']['id']}})['then'](handleEntityNotFound(_0x58b485,null))[_0xa2b4('0x1d')](function(_0x4c6842){if(_0x4c6842){_0x191d77[_0xa2b4('0x2a')]=_[_0xa2b4('0x2b')](db[_0xa2b4('0x3a')][_0xa2b4('0x3d')]);_0x191d77[_0xa2b4('0x28')]=_[_0xa2b4('0x2b')](_0x28e21c['query']);_0x191d77[_0xa2b4('0x2c')]=_[_0xa2b4('0x2d')](_0x191d77[_0xa2b4('0x2a')],_0x191d77[_0xa2b4('0x28')]);_0x11e9fe[_0xa2b4('0x2f')]=_[_0xa2b4('0x2d')](_0x191d77[_0xa2b4('0x2a')],qs[_0xa2b4('0x2e')](_0x28e21c[_0xa2b4('0x28')]['fields']));_0x11e9fe[_0xa2b4('0x2f')]=_0x11e9fe[_0xa2b4('0x2f')]['length']?_0x11e9fe[_0xa2b4('0x2f')]:_0x191d77[_0xa2b4('0x2a')];if(!_0x28e21c[_0xa2b4('0x28')][_0xa2b4('0x3e')]('nolimit')){_0x11e9fe[_0xa2b4('0x18')]=qs[_0xa2b4('0x18')](_0x28e21c[_0xa2b4('0x28')][_0xa2b4('0x18')]);_0x11e9fe['offset']=qs[_0xa2b4('0x16')](_0x28e21c[_0xa2b4('0x28')][_0xa2b4('0x16')]);}_0x11e9fe[_0xa2b4('0x3f')]=qs[_0xa2b4('0x40')](_0x28e21c[_0xa2b4('0x28')][_0xa2b4('0x40')]);_0x11e9fe['where']=qs[_0xa2b4('0x2c')](_[_0xa2b4('0x41')](_0x28e21c[_0xa2b4('0x28')],_0x191d77[_0xa2b4('0x2c')]));_0x11e9fe['where'][_0xa2b4('0x42')]=_0x4c6842['id'];if(_0x28e21c[_0xa2b4('0x28')][_0xa2b4('0x43')]){_0x11e9fe[_0xa2b4('0x44')]=_['merge'](_0x11e9fe[_0xa2b4('0x44')],{'$or':_[_0xa2b4('0x22')](_0x11e9fe[_0xa2b4('0x2f')],function(_0xd9625d){var _0x254ba3={};_0x254ba3[_0xd9625d]={'$like':'%'+_0x28e21c[_0xa2b4('0x28')][_0xa2b4('0x43')]+'%'};return _0x254ba3;})});}if(_0x28e21c[_0xa2b4('0x28')]['$gte']){var _0x11486d=_0x28e21c[_0xa2b4('0x28')][_0xa2b4('0x45')][_0xa2b4('0x46')](',');var _0x35c010={};_0x35c010[_0x11486d[0x0]]={'$gte':moment(_0x11486d[0x1])[_0xa2b4('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x11e9fe['where']=_['merge'](_0x11e9fe[_0xa2b4('0x44')],_0x35c010);}_0x11e9fe=_[_0xa2b4('0x33')]({},_0x11e9fe,_0x28e21c[_0xa2b4('0x34')]);return db[_0xa2b4('0x3a')][_0xa2b4('0x19')]({'where':_0x11e9fe[_0xa2b4('0x44')]})[_0xa2b4('0x1d')](function(_0x4b584c){_0x2ff7bd['count']=_0x4b584c;if(_0x28e21c[_0xa2b4('0x28')]['includeAll']){_0x11e9fe[_0xa2b4('0x32')]=[{'all':!![]}];}return db[_0xa2b4('0x3a')][_0xa2b4('0x26')](_0x11e9fe);})[_0xa2b4('0x1d')](function(_0x5c68cb){_0x2ff7bd[_0xa2b4('0x48')]=_0x5c68cb;return _0x2ff7bd;});}})[_0xa2b4('0x1d')](respondWithFilteredResult(_0x58b485,_0x11e9fe))[_0xa2b4('0x35')](handleError(_0x58b485,null));};exports[_0xa2b4('0x49')]=function(_0x11ca0f,_0x35b53b){return db[_0xa2b4('0x23')][_0xa2b4('0x37')]({'where':{'id':_0x11ca0f[_0xa2b4('0x29')]['id']}})[_0xa2b4('0x1d')](handleEntityNotFound(_0x35b53b,null))[_0xa2b4('0x1d')](function(_0x409014){if(_0x409014){return _0x409014[_0xa2b4('0x4a')](_0x11ca0f[_0xa2b4('0x36')][_0xa2b4('0x3b')],_['omit'](_0x11ca0f[_0xa2b4('0x36')],[_0xa2b4('0x3b'),'id'])||{})[_0xa2b4('0x4b')](function(){return db[_0xa2b4('0x4c')][_0xa2b4('0x26')]({'attributes':['id',_0xa2b4('0x21'),'color'],'where':{'id':_0x11ca0f[_0xa2b4('0x36')][_0xa2b4('0x3b')]}});})['then'](function(_0x446439){socket[_0xa2b4('0x4d')]('faxInteractionTags:save',{'id':Number(_0x11ca0f[_0xa2b4('0x29')]['id']),'tags':_0x446439||[]});return{'id':Number(_0x11ca0f[_0xa2b4('0x29')]['id']),'tags':_0x446439||[]};});}})['then'](respondWithResult(_0x35b53b,null))[_0xa2b4('0x35')](handleError(_0x35b53b,null));};exports[_0xa2b4('0x4e')]=function(_0x3964c5,_0x54d280){return db[_0xa2b4('0x23')][_0xa2b4('0x37')]({'where':{'id':_0x3964c5[_0xa2b4('0x29')]['id']}})['then'](handleEntityNotFound(_0x54d280,null))[_0xa2b4('0x1d')](function(_0x52457a){if(_0x52457a){return _0x52457a[_0xa2b4('0x4e')](_0x3964c5[_0xa2b4('0x28')][_0xa2b4('0x3b')]);}})[_0xa2b4('0x1d')](respondWithStatusCode(_0x54d280,null))[_0xa2b4('0x35')](handleError(_0x54d280,null));};exports[_0xa2b4('0x4f')]=function(_0x382fc9,_0x7a03d5){var _0x532900=moment()[_0xa2b4('0x50')]()[_0xa2b4('0x51')]();var _0x1e5b10=path['join'](config[_0xa2b4('0x52')],_0xa2b4('0x53'),_0xa2b4('0x54'),_0xa2b4('0x55'));var _0x5ee592=path[_0xa2b4('0x56')](config['root'],_0xa2b4('0x53'),_0xa2b4('0x54'),_0xa2b4('0x57'));var _0x5cf6d5=path[_0xa2b4('0x56')](_0x1e5b10,_0x532900);var _0x2df037=util['format']('transcript-%d-%s.zip',_0x382fc9['params']['id'],_0x532900);var _0x4dfa69=path[_0xa2b4('0x56')](_0x1e5b10,_0x2df037);var _0x348e1a=[];_0x348e1a[_0xa2b4('0x58')]({'model':db[_0xa2b4('0x59')],'as':_0xa2b4('0x59'),'raw':!![]});var _0x58ab6f=[{'model':db[_0xa2b4('0x3a')],'as':'Messages','attributes':['id',_0xa2b4('0x36'),_0xa2b4('0x5a')],'include':_0x348e1a}];return db[_0xa2b4('0x23')][_0xa2b4('0x37')]({'where':{'id':_0x382fc9[_0xa2b4('0x29')]['id']},'include':_0x58ab6f})[_0xa2b4('0x1d')](handleEntityNotFound(_0x7a03d5,null))['then'](function(_0x5811b3){if(_0x5811b3&&_0x5811b3[_0xa2b4('0x5b')]){var _0x27f621=_0x5811b3['get']({'plain':!![]});fs[_0xa2b4('0x5c')](_0x5cf6d5);for(var _0x3c9760=0x0;_0x3c9760<_0x27f621[_0xa2b4('0x5b')]['length'];_0x3c9760++){var _0xabb02b=_0x27f621[_0xa2b4('0x5b')][_0x3c9760][_0xa2b4('0x59')];if(_0xabb02b){var _0x4b5b79=path[_0xa2b4('0x56')](_0x5ee592,_0xabb02b['basename']);if(fs['existsSync'](_0x4b5b79)){fs['createReadStream'](_0x4b5b79)[_0xa2b4('0x5d')](fs[_0xa2b4('0x5e')](path[_0xa2b4('0x56')](_0x5cf6d5,_0xabb02b[_0xa2b4('0x5f')])));}}}return BPromise[_0xa2b4('0x60')]()['then'](function(){return new BPromise(function(_0x5bc854,_0x4c79cf){zipdir(_0x5cf6d5,{'saveTo':_0x4dfa69},function(_0x3bf3a0,_0x3f637a){if(_0x3bf3a0)return _0x4c79cf(_0x3bf3a0);return _0x5bc854(_0x3f637a);});})['then'](function(){return new BPromise(function(_0x461238,_0x36fab4){rimraf(_0x5cf6d5,function(_0x9621f3){if(_0x9621f3)_0x36fab4(_0x9621f3);return _0x461238();});});})[_0xa2b4('0x1d')](function(){return _0x7a03d5['download'](_0x4dfa69,_0x2df037,function(_0x5d07a0){if(_0x5d07a0){console[_0xa2b4('0x61')](_0xa2b4('0x62'),_0x5d07a0);}else{fs['unlinkSync'](_0x4dfa69);}});});});}else{return _0x7a03d5[_0xa2b4('0x12')](0xc8);}})[_0xa2b4('0x35')](handleError(_0x7a03d5,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 1054d89..90cf048 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 _0x5ac7=['emit','catch','hasOwnProperty','events','../../mysqldb','FaxInteraction','setMaxListeners','save','then','setDataValue','map','findAll','unreadMessages'];(function(_0x2d5077,_0x2cd2af){var _0x4a582e=function(_0x291e82){while(--_0x291e82){_0x2d5077['push'](_0x2d5077['shift']());}};_0x4a582e(++_0x2cd2af);}(_0x5ac7,0xc6));var _0x75ac=function(_0x37030e,_0x228766){_0x37030e=_0x37030e-0x0;var _0x3fb2b2=_0x5ac7[_0x37030e];return _0x3fb2b2;};'use strict';var EventEmitter=require(_0x75ac('0x0'));var FaxInteraction=require(_0x75ac('0x1'))['db'][_0x75ac('0x2')];var FaxMessage=require(_0x75ac('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x75ac('0x3')](0x0);var events={'afterCreate':_0x75ac('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xe5a332){return function(_0x1162b0,_0x407264,_0x2a647b){_0x1162b0['getUsers']({'attributes':['id'],'raw':!![]})[_0x75ac('0x5')](function(_0x5a775f){_0x1162b0[_0x75ac('0x6')]('Users',_0x5a775f[_0x75ac('0x7')](function(_0x441539){return{'id':_0x441539['id']};}));return FaxMessage[_0x75ac('0x8')]({'where':{'FaxInteractionId':_0x1162b0['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x554e47){_0x1162b0['setDataValue'](_0x75ac('0x9'),_0x554e47['length']);FaxInteractionEvents['emit'](_0xe5a332+':'+_0x1162b0['id'],_0x1162b0);FaxInteractionEvents[_0x75ac('0xa')](_0xe5a332,_0x1162b0);_0x2a647b(null);})[_0x75ac('0xb')](_0x2a647b(null));};}for(var e in events){if(events[_0x75ac('0xc')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x7cb8=['FaxMessage','save','update','remove','getUsers','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','FaxInteraction','../../mysqldb'];(function(_0x1d6f1a,_0x13ba63){var _0x5e13ea=function(_0xd7dbd6){while(--_0xd7dbd6){_0x1d6f1a['push'](_0x1d6f1a['shift']());}};_0x5e13ea(++_0x13ba63);}(_0x7cb8,0x7b));var _0x87cb=function(_0x2f928f,_0x3f7715){_0x2f928f=_0x2f928f-0x0;var _0x113814=_0x7cb8[_0x2f928f];return _0x113814;};'use strict';var EventEmitter=require(_0x87cb('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x87cb('0x1')];var FaxMessage=require(_0x87cb('0x2'))['db'][_0x87cb('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x87cb('0x4'),'afterUpdate':_0x87cb('0x5'),'afterDestroy':_0x87cb('0x6')};function emitEvent(_0x4d7658){return function(_0x11e79b,_0x1e58fc,_0x20615b){_0x11e79b[_0x87cb('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x31a7b1){_0x11e79b[_0x87cb('0x8')](_0x87cb('0x9'),_0x31a7b1[_0x87cb('0xa')](function(_0x1b2915){return{'id':_0x1b2915['id']};}));return FaxMessage[_0x87cb('0xb')]({'where':{'FaxInteractionId':_0x11e79b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3a401d){_0x11e79b[_0x87cb('0x8')]('unreadMessages',_0x3a401d[_0x87cb('0xc')]);FaxInteractionEvents[_0x87cb('0xd')](_0x4d7658+':'+_0x11e79b['id'],_0x11e79b);FaxInteractionEvents['emit'](_0x4d7658,_0x11e79b);_0x20615b(null);})[_0x87cb('0xe')](_0x20615b(null));};}for(var e in events){if(events[_0x87cb('0xf')](e)){var event=events[e];FaxInteraction[_0x87cb('0x10')](e,emitEvent(event));}}module[_0x87cb('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index e7fb843..5db9a70 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 _0xae29=['closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed'];(function(_0x48026e,_0x2bb295){var _0x4b42aa=function(_0x42c647){while(--_0x42c647){_0x48026e['push'](_0x48026e['shift']());}};_0x4b42aa(++_0x2bb295);}(_0xae29,0x147));var _0x9ae2=function(_0x549c25,_0x306e07){_0x549c25=_0x549c25-0x0;var _0x5ae518=_0xae29[_0x549c25];return _0x5ae518;};'use strict';var _=require(_0x9ae2('0x0'));var util=require(_0x9ae2('0x1'));var logger=require(_0x9ae2('0x2'))(_0x9ae2('0x3'));var moment=require(_0x9ae2('0x4'));var BPromise=require(_0x9ae2('0x5'));var rp=require(_0x9ae2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ae2('0x7'));var config=require(_0x9ae2('0x8'));var attributes=require(_0x9ae2('0x9'));module[_0x9ae2('0xa')]=function(_0x510b55,_0x56beaa){return _0x510b55[_0x9ae2('0xb')](_0x9ae2('0xc'),attributes,{'tableName':_0x9ae2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb602f2,_0x1fc927,_0x529858){if(_0xb602f2[_0x9ae2('0xe')](_0x9ae2('0xf'))){_0xb602f2['closedAt']=moment()[_0x9ae2('0x10')](_0x9ae2('0x11'));}_0x529858(null,_0xb602f2);}}});}; \ No newline at end of file +var _0x3185=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','closed','closedAt','format'];(function(_0x47752d,_0x43212e){var _0x3f5d59=function(_0x1a83c7){while(--_0x1a83c7){_0x47752d['push'](_0x47752d['shift']());}};_0x3f5d59(++_0x43212e);}(_0x3185,0x177));var _0x5318=function(_0x58ac52,_0xa5d7fa){_0x58ac52=_0x58ac52-0x0;var _0x45590e=_0x3185[_0x58ac52];return _0x45590e;};'use strict';var _=require(_0x5318('0x0'));var util=require(_0x5318('0x1'));var logger=require(_0x5318('0x2'))(_0x5318('0x3'));var moment=require(_0x5318('0x4'));var BPromise=require(_0x5318('0x5'));var rp=require(_0x5318('0x6'));var fs=require('fs');var path=require(_0x5318('0x7'));var rimraf=require('rimraf');var config=require(_0x5318('0x8'));var attributes=require(_0x5318('0x9'));module[_0x5318('0xa')]=function(_0xd07d91,_0x5c8d7d){return _0xd07d91[_0x5318('0xb')](_0x5318('0xc'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8da5c3,_0x31dedf,_0x5c42b1){if(_0x8da5c3['changed'](_0x5318('0xd'))){_0x8da5c3[_0x5318('0xe')]=moment()[_0x5318('0xf')](_0x5318('0x10'));}_0x5c42b1(null,_0x8da5c3);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index a6de661..5d0c048 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 _0x935d=['util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','defaults','socket.io-emitter','redis','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','FaxInteraction','body','options','where','limit','UpdateFaxInteraction','addTags','ids','omit','spread','AddTags','stringify','lodash'];(function(_0x30586b,_0x27653e){var _0x14483c=function(_0x5fa7c2){while(--_0x5fa7c2){_0x30586b['push'](_0x30586b['shift']());}};_0x14483c(++_0x27653e);}(_0x935d,0xb8));var _0xd935=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x935d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd935('0x0'));var util=require(_0xd935('0x1'));var moment=require('moment');var BPromise=require(_0xd935('0x2'));var rs=require(_0xd935('0x3'));var fs=require('fs');var Redis=require(_0xd935('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd935('0x5'));var logger=require('../../config/logger')(_0xd935('0x6'));var config=require(_0xd935('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd935('0x8')][_0xd935('0x9')]({'port':0x232a});config['redis']=_[_0xd935('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd935('0xb'))(new Redis(config[_0xd935('0xc')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x2d98ca,_0x326aa8,_0x4676b2){return new BPromise(function(_0x2b3d1b,_0x4f2ae0){return client[_0xd935('0xd')](_0x2d98ca,_0x4676b2)[_0xd935('0xe')](function(_0x31650e){logger[_0xd935('0xf')](_0xd935('0x10'),_0x326aa8,_0xd935('0x11'));logger[_0xd935('0x12')](_0xd935('0x13'),_0x326aa8,_0xd935('0x11'),JSON['stringify'](_0x31650e));if(_0x31650e[_0xd935('0x14')]){if(_0x31650e['error'][_0xd935('0x15')]===0x1f4){logger['error'](_0xd935('0x10'),_0x326aa8,_0x31650e[_0xd935('0x14')][_0xd935('0x16')]);return _0x4f2ae0(_0x31650e[_0xd935('0x14')]['message']);}logger[_0xd935('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x326aa8,_0x31650e[_0xd935('0x14')][_0xd935('0x16')]);return _0x2b3d1b(_0x31650e[_0xd935('0x14')][_0xd935('0x16')]);}else{logger[_0xd935('0xf')](_0xd935('0x10'),_0x326aa8,_0xd935('0x11'));_0x2b3d1b(_0x31650e[_0xd935('0x17')][_0xd935('0x16')]);}})[_0xd935('0x18')](function(_0x4e545e){logger[_0xd935('0x14')](_0xd935('0x10'),_0x326aa8,_0x4e545e);_0x4f2ae0(_0x4e545e);});});}exports['UpdateFaxInteraction']=function(_0x4628d3){var _0x3bd9cc=this;return new Promise(function(_0x327aa0,_0x2f3092){return db[_0xd935('0x19')]['update'](_0x4628d3[_0xd935('0x1a')],{'raw':_0x4628d3['options']?_0x4628d3[_0xd935('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4628d3[_0xd935('0x1b')]?_0x4628d3['options'][_0xd935('0x1c')]||null:null,'attributes':_0x4628d3['options']?_0x4628d3[_0xd935('0x1b')]['attributes']||null:null,'limit':_0x4628d3[_0xd935('0x1b')]?_0x4628d3['options'][_0xd935('0x1d')]||null:null})[_0xd935('0xe')](function(_0x2ab0f8){logger[_0xd935('0xf')]('UpdateFaxInteraction',_0x4628d3);logger[_0xd935('0x12')]('UpdateFaxInteraction',_0x4628d3,JSON['stringify'](_0x2ab0f8));_0x327aa0(_0x2ab0f8);})[_0xd935('0x18')](function(_0x2c85b8){logger[_0xd935('0x14')](_0xd935('0x1e'),_0x2c85b8[_0xd935('0x16')],_0x4628d3);_0x2f3092(_0x3bd9cc['error'](0x1f4,_0x2c85b8['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x1cb11e){return new Promise(function(_0x3ed30e,_0x116d07){return db['FaxInteraction']['find']({'where':_0x1cb11e['options']?_0x1cb11e['options'][_0xd935('0x1c')]||null:null})[_0xd935('0xe')](function(_0x24c956){if(_0x24c956){return _0x24c956[_0xd935('0x1f')](_0x1cb11e[_0xd935('0x1a')][_0xd935('0x20')],_[_0xd935('0x21')](_0x1cb11e[_0xd935('0x1a')],[_0xd935('0x20'),'id'])||{});}})[_0xd935('0x22')](function(_0x2e8d5f){logger[_0xd935('0xf')](_0xd935('0x23'),_0x1cb11e);logger[_0xd935('0x12')]('AddTags',_0x1cb11e,JSON[_0xd935('0x24')](_0x2e8d5f));_0x3ed30e(_0x2e8d5f);})[_0xd935('0x18')](function(_0x525e29){logger[_0xd935('0x14')](_0xd935('0x23'),_0x525e29[_0xd935('0x16')],_0x1cb11e);_0x116d07(_this[_0xd935('0x14')](0x1f4,_0x525e29[_0xd935('0x16')]));});});}; \ No newline at end of file +var _0x45fd=['FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info'];(function(_0x1a0016,_0x3d80e1){var _0x2945df=function(_0x2e82b2){while(--_0x2e82b2){_0x1a0016['push'](_0x1a0016['shift']());}};_0x2945df(++_0x3d80e1);}(_0x45fd,0x179));var _0xd45f=function(_0x492a11,_0x32bdbe){_0x492a11=_0x492a11-0x0;var _0x36c3e6=_0x45fd[_0x492a11];return _0x36c3e6;};'use strict';var _=require(_0xd45f('0x0'));var util=require(_0xd45f('0x1'));var moment=require(_0xd45f('0x2'));var BPromise=require(_0xd45f('0x3'));var rs=require(_0xd45f('0x4'));var fs=require('fs');var Redis=require(_0xd45f('0x5'));var db=require(_0xd45f('0x6'))['db'];var utils=require(_0xd45f('0x7'));var logger=require(_0xd45f('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd45f('0x9'));var client=jayson['client'][_0xd45f('0xa')]({'port':0x232a});config[_0xd45f('0xb')]=_['defaults'](config[_0xd45f('0xb')],{'host':_0xd45f('0xc'),'port':0x18eb});var socket=require(_0xd45f('0xd'))(new Redis(config[_0xd45f('0xb')]));require(_0xd45f('0xe'))[_0xd45f('0xf')](socket);function respondWithRpcPromise(_0x35a928,_0x175269,_0x150bbe){return new BPromise(function(_0x57ecad,_0x1c6d66){return client[_0xd45f('0x10')](_0x35a928,_0x150bbe)[_0xd45f('0x11')](function(_0x1147b2){logger[_0xd45f('0x12')](_0xd45f('0x13'),_0x175269,_0xd45f('0x14'));logger[_0xd45f('0x15')](_0xd45f('0x16'),_0x175269,_0xd45f('0x14'),JSON[_0xd45f('0x17')](_0x1147b2));if(_0x1147b2[_0xd45f('0x18')]){if(_0x1147b2[_0xd45f('0x18')][_0xd45f('0x19')]===0x1f4){logger[_0xd45f('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x175269,_0x1147b2['error']['message']);return _0x1c6d66(_0x1147b2[_0xd45f('0x18')][_0xd45f('0x1a')]);}logger[_0xd45f('0x18')](_0xd45f('0x13'),_0x175269,_0x1147b2[_0xd45f('0x18')]['message']);return _0x57ecad(_0x1147b2[_0xd45f('0x18')][_0xd45f('0x1a')]);}else{logger[_0xd45f('0x12')](_0xd45f('0x13'),_0x175269,_0xd45f('0x14'));_0x57ecad(_0x1147b2[_0xd45f('0x1b')][_0xd45f('0x1a')]);}})[_0xd45f('0x1c')](function(_0x18e62c){logger[_0xd45f('0x18')](_0xd45f('0x13'),_0x175269,_0x18e62c);_0x1c6d66(_0x18e62c);});});}exports[_0xd45f('0x1d')]=function(_0x119063){var _0xec0899=this;return new Promise(function(_0x165318,_0x3432cf){return db[_0xd45f('0x1e')][_0xd45f('0x1f')](_0x119063[_0xd45f('0x20')],{'raw':_0x119063[_0xd45f('0x21')]?_0x119063[_0xd45f('0x21')][_0xd45f('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x119063[_0xd45f('0x21')]?_0x119063[_0xd45f('0x21')][_0xd45f('0x23')]||null:null,'attributes':_0x119063[_0xd45f('0x21')]?_0x119063['options'][_0xd45f('0x24')]||null:null,'limit':_0x119063['options']?_0x119063[_0xd45f('0x21')][_0xd45f('0x25')]||null:null})[_0xd45f('0x11')](function(_0x40366f){logger[_0xd45f('0x12')](_0xd45f('0x1d'),_0x119063);logger[_0xd45f('0x15')](_0xd45f('0x1d'),_0x119063,JSON['stringify'](_0x40366f));_0x165318(_0x40366f);})[_0xd45f('0x1c')](function(_0x3b9a02){logger['error']('UpdateFaxInteraction',_0x3b9a02[_0xd45f('0x1a')],_0x119063);_0x3432cf(_0xec0899['error'](0x1f4,_0x3b9a02[_0xd45f('0x1a')]));});});};exports[_0xd45f('0x26')]=function(_0xf97699){return new Promise(function(_0x51b84e,_0x48f2a7){return db[_0xd45f('0x1e')][_0xd45f('0x27')]({'where':_0xf97699[_0xd45f('0x21')]?_0xf97699[_0xd45f('0x21')]['where']||null:null})[_0xd45f('0x11')](function(_0x31e1c5){if(_0x31e1c5){return _0x31e1c5[_0xd45f('0x28')](_0xf97699[_0xd45f('0x20')][_0xd45f('0x29')],_[_0xd45f('0x2a')](_0xf97699[_0xd45f('0x20')],[_0xd45f('0x29'),'id'])||{});}})['spread'](function(_0x314403){logger[_0xd45f('0x12')](_0xd45f('0x2b'),_0xf97699);logger['debug'](_0xd45f('0x2b'),_0xf97699,JSON[_0xd45f('0x17')](_0x314403));_0x51b84e(_0x314403);})['catch'](function(_0x2ab9d5){logger['error']('AddTags',_0x2ab9d5['message'],_0xf97699);_0x48f2a7(_this[_0xd45f('0x18')](0x1f4,_0x2ab9d5[_0xd45f('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 146916d..6834fa7 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 _0x12a0=['length','faxInteraction:','save','emit','removeListener'];(function(_0x539d79,_0x4216f1){var _0x1c886f=function(_0x142e39){while(--_0x142e39){_0x539d79['push'](_0x539d79['shift']());}};_0x1c886f(++_0x4216f1);}(_0x12a0,0x19c));var _0x012a=function(_0x547f90,_0x3d0cb0){_0x547f90=_0x547f90-0x0;var _0x49b910=_0x12a0[_0x547f90];return _0x49b910;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x012a('0x0'),'remove','update'];function createListener(_0x267343,_0x7bfc33){return function(_0x23ae0d){_0x7bfc33[_0x012a('0x1')](_0x267343,_0x23ae0d);};}function removeListener(_0x1f32bc,_0x163601){return function(){FaxInteractionEvents[_0x012a('0x2')](_0x1f32bc,_0x163601);};}exports['register']=function(_0xa2f719){for(var _0x3b6a3f=0x0,_0x39c927=events[_0x012a('0x3')];_0x3b6a3f<_0x39c927;_0x3b6a3f++){var _0x27f127=events[_0x3b6a3f];var _0x33aa83=createListener(_0x012a('0x4')+_0x27f127,_0xa2f719);FaxInteractionEvents['on'](_0x27f127,_0x33aa83);}}; \ No newline at end of file +var _0x94fc=['update','emit','removeListener','register','length','./faxInteraction.events'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0x94fc,0xcb));var _0xc94f=function(_0x30a30c,_0x5597c4){_0x30a30c=_0x30a30c-0x0;var _0x2455df=_0x94fc[_0x30a30c];return _0x2455df;};'use strict';var FaxInteractionEvents=require(_0xc94f('0x0'));var events=['save','remove',_0xc94f('0x1')];function createListener(_0x2fa117,_0x201b63){return function(_0x110157){_0x201b63[_0xc94f('0x2')](_0x2fa117,_0x110157);};}function removeListener(_0x118772,_0x3eec30){return function(){FaxInteractionEvents[_0xc94f('0x3')](_0x118772,_0x3eec30);};}exports[_0xc94f('0x4')]=function(_0x20586f){for(var _0x269280=0x0,_0x160d77=events[_0xc94f('0x5')];_0x269280<_0x160d77;_0x269280++){var _0x28518c=events[_0x269280];var _0x432cbd=createListener('faxInteraction:'+_0x28518c,_0x20586f);FaxInteractionEvents['on'](_0x28518c,_0x432cbd);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 77ad6b6..80a7609 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 _0xd344=['download','create','post','/:id/tags','tracked','fax','addTags','put','/:id','faxinteraction:update','update','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download'];(function(_0x1ac002,_0x1f8b3d){var _0x5118d5=function(_0x5d7323){while(--_0x5d7323){_0x1ac002['push'](_0x1ac002['shift']());}};_0x5118d5(++_0x1f8b3d);}(_0xd344,0x104));var _0x4d34=function(_0x4acbef,_0x4754ca){_0x4acbef=_0x4acbef-0x0;var _0x44b38c=_0xd344[_0x4acbef];return _0x44b38c;};'use strict';var multer=require(_0x4d34('0x0'));var util=require(_0x4d34('0x1'));var path=require(_0x4d34('0x2'));var timeout=require(_0x4d34('0x3'));var express=require(_0x4d34('0x4'));var router=express[_0x4d34('0x5')]();var fs_extra=require(_0x4d34('0x6'));var auth=require(_0x4d34('0x7'));var interaction=require(_0x4d34('0x8'));var config=require(_0x4d34('0x9'));var controller=require(_0x4d34('0xa'));router[_0x4d34('0xb')]('/',auth[_0x4d34('0xc')](),controller[_0x4d34('0xd')]);router[_0x4d34('0xb')](_0x4d34('0xe'),auth['isAuthenticated'](),controller[_0x4d34('0xf')]);router[_0x4d34('0xb')]('/:id',auth[_0x4d34('0xc')](),controller[_0x4d34('0x10')]);router[_0x4d34('0xb')](_0x4d34('0x11'),auth[_0x4d34('0xc')](),controller[_0x4d34('0x12')]);router[_0x4d34('0xb')](_0x4d34('0x13'),auth[_0x4d34('0xc')](),controller[_0x4d34('0x14')]);router['post']('/',auth[_0x4d34('0xc')](),controller[_0x4d34('0x15')]);router[_0x4d34('0x16')](_0x4d34('0x11'),auth['isAuthenticated'](),controller['addMessage']);router[_0x4d34('0x16')](_0x4d34('0x17'),auth['isAuthenticated'](),interaction[_0x4d34('0x18')](_0x4d34('0x19'),'faxinteraction:addtags'),controller[_0x4d34('0x1a')]);router[_0x4d34('0x1b')](_0x4d34('0x1c'),auth[_0x4d34('0xc')](),interaction['tracked'](_0x4d34('0x19'),_0x4d34('0x1d')),controller[_0x4d34('0x1e')]);router['delete'](_0x4d34('0x1c'),auth['isAuthenticated'](),interaction['tracked'](_0x4d34('0x19'),_0x4d34('0x1f')),controller[_0x4d34('0x20')]);router['delete'](_0x4d34('0x17'),auth[_0x4d34('0xc')](),controller[_0x4d34('0x21')]);module[_0x4d34('0x22')]=router; \ No newline at end of file +var _0xc794=['/:id/download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','put','/:id','faxinteraction:update','delete','faxinteraction:destroy','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','get','show','/:id/messages','getMessages'];(function(_0xe51964,_0x433b90){var _0x2c2366=function(_0x1bc95c){while(--_0x1bc95c){_0xe51964['push'](_0xe51964['shift']());}};_0x2c2366(++_0x433b90);}(_0xc794,0x17b));var _0x4c79=function(_0x2eb256,_0x28d4b7){_0x2eb256=_0x2eb256-0x0;var _0x44d134=_0xc794[_0x2eb256];return _0x44d134;};'use strict';var multer=require('multer');var util=require(_0x4c79('0x0'));var path=require(_0x4c79('0x1'));var timeout=require(_0x4c79('0x2'));var express=require('express');var router=express[_0x4c79('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4c79('0x4'));var interaction=require(_0x4c79('0x5'));var config=require(_0x4c79('0x6'));var controller=require(_0x4c79('0x7'));router['get']('/',auth[_0x4c79('0x8')](),controller['index']);router['get']('/describe',auth[_0x4c79('0x8')](),controller['describe']);router[_0x4c79('0x9')]('/:id',auth[_0x4c79('0x8')](),controller[_0x4c79('0xa')]);router[_0x4c79('0x9')](_0x4c79('0xb'),auth[_0x4c79('0x8')](),controller[_0x4c79('0xc')]);router[_0x4c79('0x9')](_0x4c79('0xd'),auth[_0x4c79('0x8')](),controller['download']);router[_0x4c79('0xe')]('/',auth['isAuthenticated'](),controller[_0x4c79('0xf')]);router['post']('/:id/messages',auth[_0x4c79('0x8')](),controller[_0x4c79('0x10')]);router[_0x4c79('0xe')](_0x4c79('0x11'),auth['isAuthenticated'](),interaction[_0x4c79('0x12')](_0x4c79('0x13'),_0x4c79('0x14')),controller['addTags']);router[_0x4c79('0x15')](_0x4c79('0x16'),auth[_0x4c79('0x8')](),interaction[_0x4c79('0x12')](_0x4c79('0x13'),_0x4c79('0x17')),controller['update']);router[_0x4c79('0x18')](_0x4c79('0x16'),auth['isAuthenticated'](),interaction[_0x4c79('0x12')](_0x4c79('0x13'),_0x4c79('0x19')),controller[_0x4c79('0x1a')]);router[_0x4c79('0x18')](_0x4c79('0x11'),auth[_0x4c79('0x8')](),controller['removeTags']);module[_0x4c79('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 85e2463..67c9a31 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 _0x4016=['DATE','exports','TEXT','out'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x4016,0x131));var _0x6401=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x4016[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0x6401('0x0')]={'body':{'type':Sequelize[_0x6401('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x6401('0x2')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x6401('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x6401('0x3')]}}; \ No newline at end of file +var _0x644a=['out','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x20714a,_0x7de591){var _0x15e877=function(_0x3f9f8d){while(--_0x3f9f8d){_0x20714a['push'](_0x20714a['shift']());}};_0x15e877(++_0x7de591);}(_0x644a,0xfd));var _0xa644=function(_0x9d39e9,_0x3aebc9){_0x9d39e9=_0x9d39e9-0x0;var _0x4ac75b=_0x644a[_0x9d39e9];return _0x4ac75b;};'use strict';var Sequelize=require(_0xa644('0x0'));module[_0xa644('0x1')]={'body':{'type':Sequelize[_0xa644('0x2')](_0xa644('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa644('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa644('0x5')),'defaultValue':_0xa644('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index a0d5c3e..e0f6397 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 _0x9db3=['moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','destroy','end','stack','name','send','index','FaxMessage','rawAttributes','key','model','map','query','keys','intersection','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type','includeAll','findAll','rows','show','params','fields','length','include','merge','options','body','find','describe','../../config/logger','fax-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','SIP/%s','EventManager','rejectmessage','create','CmContact','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','files','eml-format','request-promise'];(function(_0x59dff6,_0x722127){var _0x5dbabc=function(_0x14fc28){while(--_0x14fc28){_0x59dff6['push'](_0x59dff6['shift']());}};_0x5dbabc(++_0x722127);}(_0x9db3,0x1a8));var _0x39db=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x9db3[_0x4a53d];return _0x27410e;};'use strict';var emlformat=require(_0x39db('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x39db('0x1'));var moment=require(_0x39db('0x2'));var BPromise=require(_0x39db('0x3'));var Mustache=require(_0x39db('0x4'));var util=require(_0x39db('0x5'));var path=require(_0x39db('0x6'));var sox=require(_0x39db('0x7'));var csv=require(_0x39db('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x39db('0x9'));var crypto=require(_0x39db('0xa'));var jsforce=require(_0x39db('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x39db('0x8'));var querystring=require(_0x39db('0xc'));var Papa=require(_0x39db('0xd'));var Redis=require(_0x39db('0xe'));var authService=require(_0x39db('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x39db('0x10'));var logger=require('../../config/logger')(_0x39db('0x11'));var utils=require(_0x39db('0x12'));var config=require(_0x39db('0x13'));var licenseUtil=require(_0x39db('0x14'));var db=require(_0x39db('0x15'))['db'];config[_0x39db('0x16')]=_[_0x39db('0x17')](config[_0x39db('0x16')],{'host':_0x39db('0x18'),'port':0x18eb});var socket=require(_0x39db('0x19'))(new Redis(config[_0x39db('0x16')]));require('./faxMessage.socket')[_0x39db('0x1a')](socket);var jayson=require(_0x39db('0x1b'));var client=jayson[_0x39db('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x39db('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe73864,_0x3673d1,_0x1b7e91,_0x5c16bc){return new BPromise(function(_0x59e82d,_0x597198){var _0x1d607e=_0x5c16bc||client;return _0x1d607e[_0x39db('0x1d')](_0xe73864,_0x1b7e91)[_0x39db('0x1e')](function(_0x574b44){logger[_0x39db('0x1f')](_0x39db('0x20'),_0x3673d1,'request\x20sent');logger[_0x39db('0x21')](_0x39db('0x22'),_0x3673d1,'request\x20sent',JSON[_0x39db('0x23')](_0x574b44));if(_0x574b44['error']){if(_0x574b44[_0x39db('0x24')][_0x39db('0x25')]===0x1f4){logger[_0x39db('0x24')](_0x39db('0x20'),_0x3673d1,_0x574b44[_0x39db('0x24')][_0x39db('0x26')]);return _0x597198(_0x574b44['error']['message']);}logger[_0x39db('0x24')](_0x39db('0x20'),_0x3673d1,_0x574b44['error'][_0x39db('0x26')]);return _0x59e82d(_0x574b44['error'][_0x39db('0x26')]);}else{logger[_0x39db('0x1f')](_0x39db('0x20'),_0x3673d1,_0x39db('0x27'));_0x59e82d(_0x574b44['result'][_0x39db('0x26')]);}})[_0x39db('0x28')](function(_0x398f16){logger[_0x39db('0x24')]('FaxMessage,\x20%s,\x20%s',_0x3673d1,_0x398f16);_0x597198(_0x398f16);});});}function respondWithStatusCode(_0x28d4a1,_0x24261d){_0x24261d=_0x24261d||0xcc;return function(_0xaf5952){if(_0xaf5952){return _0x28d4a1[_0x39db('0x29')](_0x24261d);}return _0x28d4a1[_0x39db('0x2a')](_0x24261d)['end']();};}function respondWithResult(_0x3bf766,_0x7c3b05){_0x7c3b05=_0x7c3b05||0xc8;return function(_0x1e78db){if(_0x1e78db){return _0x3bf766[_0x39db('0x2a')](_0x7c3b05)['json'](_0x1e78db);}};}function respondWithFilteredResult(_0x2f51b0,_0x8b34c3){return function(_0x33fa42){if(_0x33fa42){var _0x5edfb1=typeof _0x8b34c3[_0x39db('0x2b')]===_0x39db('0x2c')&&typeof _0x8b34c3[_0x39db('0x2d')]==='undefined';var _0x391321=_0x33fa42[_0x39db('0x2e')];var _0x293ac1=_0x5edfb1?0x0:_0x8b34c3[_0x39db('0x2b')];var _0x3b6a07=_0x5edfb1?_0x33fa42['count']:_0x8b34c3[_0x39db('0x2b')]+_0x8b34c3[_0x39db('0x2d')];var _0x5a7a25;if(_0x3b6a07>=_0x391321){_0x3b6a07=_0x391321;_0x5a7a25=0xc8;}else{_0x5a7a25=0xce;}_0x2f51b0['status'](_0x5a7a25);return _0x2f51b0[_0x39db('0x2f')]('Content-Range',_0x293ac1+'-'+_0x3b6a07+'/'+_0x391321)['json'](_0x33fa42);}return null;};}function patchUpdates(_0x69cd15){return function(_0x469863){try{jsonpatch[_0x39db('0x30')](_0x469863,_0x69cd15,!![]);}catch(_0xd88315){return BPromise[_0x39db('0x31')](_0xd88315);}return _0x469863[_0x39db('0x32')]();};}function saveUpdates(_0x50d316,_0x164f10){return function(_0x1b0bc2){if(_0x1b0bc2){return _0x1b0bc2[_0x39db('0x33')](_0x50d316)[_0x39db('0x1e')](function(_0x1e7596){return _0x1e7596;});}return null;};}function removeEntity(_0x3f12bc,_0x3b6b9b){return function(_0x42186e){if(_0x42186e){return _0x42186e[_0x39db('0x34')]()[_0x39db('0x1e')](function(){_0x3f12bc[_0x39db('0x2a')](0xcc)[_0x39db('0x35')]();});}};}function handleEntityNotFound(_0x39bcbc,_0x5527e8){return function(_0xbd33bc){if(!_0xbd33bc){_0x39bcbc[_0x39db('0x29')](0x194);}return _0xbd33bc;};}function handleError(_0xdfb6c6,_0xebd205){_0xebd205=_0xebd205||0x1f4;return function(_0x43fb48){logger['error'](_0x43fb48[_0x39db('0x36')]);if(_0x43fb48[_0x39db('0x37')]){delete _0x43fb48['name'];}_0xdfb6c6[_0x39db('0x2a')](_0xebd205)[_0x39db('0x38')](_0x43fb48);};}exports[_0x39db('0x39')]=function(_0x590df2,_0xc90862){var _0x3f6829={},_0x1294e8={},_0x48c738={'count':0x0,'rows':[]};var _0x810c13=_['map'](db[_0x39db('0x3a')][_0x39db('0x3b')],function(_0x37a7ad){return{'name':_0x37a7ad['fieldName'],'type':_0x37a7ad['type'][_0x39db('0x3c')]};});_0x1294e8[_0x39db('0x3d')]=_[_0x39db('0x3e')](_0x810c13,_0x39db('0x37'));_0x1294e8[_0x39db('0x3f')]=_[_0x39db('0x40')](_0x590df2[_0x39db('0x3f')]);_0x1294e8['filters']=_[_0x39db('0x41')](_0x1294e8[_0x39db('0x3d')],_0x1294e8[_0x39db('0x3f')]);_0x3f6829['attributes']=_['intersection'](_0x1294e8[_0x39db('0x3d')],qs['fields'](_0x590df2[_0x39db('0x3f')]['fields']));_0x3f6829[_0x39db('0x42')]=_0x3f6829['attributes']['length']?_0x3f6829[_0x39db('0x42')]:_0x1294e8[_0x39db('0x3d')];if(!_0x590df2[_0x39db('0x3f')][_0x39db('0x43')](_0x39db('0x44'))){_0x3f6829[_0x39db('0x2d')]=qs['limit'](_0x590df2['query'][_0x39db('0x2d')]);_0x3f6829[_0x39db('0x2b')]=qs[_0x39db('0x2b')](_0x590df2[_0x39db('0x3f')][_0x39db('0x2b')]);}_0x3f6829['order']=qs[_0x39db('0x45')](_0x590df2[_0x39db('0x3f')][_0x39db('0x45')]);_0x3f6829[_0x39db('0x46')]=qs[_0x39db('0x47')](_[_0x39db('0x48')](_0x590df2[_0x39db('0x3f')],_0x1294e8[_0x39db('0x47')]),_0x810c13);if(_0x590df2[_0x39db('0x3f')][_0x39db('0x49')]){_0x3f6829[_0x39db('0x46')]=_['merge'](_0x3f6829[_0x39db('0x46')],{'$or':_[_0x39db('0x3e')](_0x810c13,function(_0x42151b){if(_0x42151b[_0x39db('0x4a')]!=='VIRTUAL'){var _0x126eb9={};_0x126eb9[_0x42151b[_0x39db('0x37')]]={'$like':'%'+_0x590df2[_0x39db('0x3f')][_0x39db('0x49')]+'%'};return _0x126eb9;}})});}_0x3f6829=_['merge']({},_0x3f6829,_0x590df2['options']);var _0x1b581b={'where':_0x3f6829[_0x39db('0x46')]};return db['FaxMessage']['count'](_0x1b581b)['then'](function(_0x4ccbfc){_0x48c738[_0x39db('0x2e')]=_0x4ccbfc;if(_0x590df2[_0x39db('0x3f')][_0x39db('0x4b')]){_0x3f6829['include']=[{'all':!![]}];}return db['FaxMessage'][_0x39db('0x4c')](_0x3f6829);})['then'](function(_0x4ca1d1){_0x48c738[_0x39db('0x4d')]=_0x4ca1d1;return _0x48c738;})[_0x39db('0x1e')](respondWithFilteredResult(_0xc90862,_0x3f6829))[_0x39db('0x28')](handleError(_0xc90862,null));};exports[_0x39db('0x4e')]=function(_0x5678f3,_0x2575c6){var _0x27cd97={'raw':!![],'where':{'id':_0x5678f3[_0x39db('0x4f')]['id']}},_0x3647c2={};_0x3647c2[_0x39db('0x3d')]=_[_0x39db('0x40')](db[_0x39db('0x3a')][_0x39db('0x3b')]);_0x3647c2[_0x39db('0x3f')]=_[_0x39db('0x40')](_0x5678f3[_0x39db('0x3f')]);_0x3647c2[_0x39db('0x47')]=_['intersection'](_0x3647c2[_0x39db('0x3d')],_0x3647c2[_0x39db('0x3f')]);_0x27cd97[_0x39db('0x42')]=_[_0x39db('0x41')](_0x3647c2[_0x39db('0x3d')],qs[_0x39db('0x50')](_0x5678f3['query']['fields']));_0x27cd97[_0x39db('0x42')]=_0x27cd97[_0x39db('0x42')][_0x39db('0x51')]?_0x27cd97[_0x39db('0x42')]:_0x3647c2[_0x39db('0x3d')];if(_0x5678f3[_0x39db('0x3f')][_0x39db('0x4b')]){_0x27cd97[_0x39db('0x52')]=[{'all':!![]}];}_0x27cd97=_[_0x39db('0x53')]({},_0x27cd97,_0x5678f3[_0x39db('0x54')]);return db[_0x39db('0x3a')]['find'](_0x27cd97)[_0x39db('0x1e')](handleEntityNotFound(_0x2575c6,null))[_0x39db('0x1e')](respondWithResult(_0x2575c6,null))[_0x39db('0x28')](handleError(_0x2575c6,null));};exports[_0x39db('0x33')]=function(_0x52fb7a,_0x1a749d){if(_0x52fb7a['body']['id']){delete _0x52fb7a[_0x39db('0x55')]['id'];}return db['FaxMessage'][_0x39db('0x56')]({'where':{'id':_0x52fb7a[_0x39db('0x4f')]['id']}})[_0x39db('0x1e')](handleEntityNotFound(_0x1a749d,null))['then'](saveUpdates(_0x52fb7a[_0x39db('0x55')],null))[_0x39db('0x1e')](respondWithResult(_0x1a749d,null))[_0x39db('0x28')](handleError(_0x1a749d,null));};exports[_0x39db('0x34')]=function(_0x4fe4b0,_0x3e3041){return db[_0x39db('0x3a')][_0x39db('0x56')]({'where':{'id':_0x4fe4b0[_0x39db('0x4f')]['id']}})[_0x39db('0x1e')](handleEntityNotFound(_0x3e3041,null))['then'](removeEntity(_0x3e3041,null))[_0x39db('0x28')](handleError(_0x3e3041,null));};exports[_0x39db('0x57')]=function(_0x3b4fb3,_0x2940d1){return db[_0x39db('0x3a')][_0x39db('0x57')]()[_0x39db('0x1e')](respondWithResult(_0x2940d1,null))[_0x39db('0x28')](handleError(_0x2940d1,null));};var interaction_log=require(_0x39db('0x58'))(_0x39db('0x59'));exports[_0x39db('0x5a')]=function(_0xe2e9ed,_0x3d3f4b,_0x4a351e){var _0x29e14f={'agent':{},'channel':'fax'};if(_0xe2e9ed[_0x39db('0x55')]['id']){delete _0xe2e9ed['body']['id'];}_0xe2e9ed[_0x39db('0x55')][_0x39db('0x5b')]=!![];_0xe2e9ed[_0x39db('0x55')][_0x39db('0x5c')]=moment()[_0x39db('0x5d')](_0x39db('0x5e'));_0xe2e9ed[_0x39db('0x55')]['UserId']=_0xe2e9ed['body']['UserId']||_0xe2e9ed[_0x39db('0x5f')]['id'];_0x29e14f[_0x39db('0x60')]['id']=_0xe2e9ed[_0x39db('0x55')][_0x39db('0x61')];return db[_0x39db('0x3a')][_0x39db('0x56')]({'where':{'id':_0xe2e9ed[_0x39db('0x4f')]['id'],'UserId':null}})[_0x39db('0x1e')](handleEntityNotFound(_0x3d3f4b,null))[_0x39db('0x1e')](saveUpdates(_0xe2e9ed['body'],null))[_0x39db('0x1e')](function(_0x58c4d5){if(_0x58c4d5){_0x29e14f['message']=_0x58c4d5[_0x39db('0x62')]({'plain':!![]});return db[_0x39db('0x63')][_0x39db('0x56')]({'where':{'id':_0x58c4d5[_0x39db('0x64')]}});}return null;})[_0x39db('0x1e')](handleEntityNotFound(_0x3d3f4b,null))[_0x39db('0x1e')](function(_0x1a8b25){if(_0x1a8b25){return _0x1a8b25[_0x39db('0x33')]({'UserId':_0xe2e9ed[_0x39db('0x55')][_0x39db('0x61')],'read1stAt':_[_0x39db('0x65')](_0x1a8b25[_0x39db('0x66')])?moment()[_0x39db('0x5d')](_0x39db('0x5e')):undefined});}return null;})[_0x39db('0x1e')](function(_0x5495be){if(_0x5495be){_0x29e14f[_0x39db('0x67')]=_0x5495be[_0x39db('0x62')]({'plain':!![]});interaction_log[_0x39db('0x1f')](_0x39db('0x68'),_0xe2e9ed[_0x39db('0x5f')]['id'],_0xe2e9ed['user'][_0x39db('0x37')],_0xe2e9ed[_0x39db('0x5f')][_0x39db('0x69')],_0x29e14f[_0x39db('0x67')]['id'],_0xe2e9ed['body']?JSON[_0x39db('0x23')](_0xe2e9ed['body']):_0x39db('0x6a'));return respondWithRpcPromise(_0x39db('0x6b'),'acceptMessage',_0x29e14f);}return null;})[_0x39db('0x1e')](function(_0x302879){var _0x2c1b08=_0x39db('0x6c')+_0x302879['message']['ContactId'];return db[_0x39db('0x6d')][_0x39db('0x3f')](_0x2c1b08,{'type':db[_0x39db('0x6e')][_0x39db('0x6f')][_0x39db('0x70')],'raw':!![]})[_0x39db('0x1e')](function(_0x391823){return _0x391823;});})[_0x39db('0x1e')](function(_0x2025c8){if(_0x2025c8){_0x29e14f['message'][_0x39db('0x71')]=_0x2025c8[0x0];if(!_0xe2e9ed['body']['UserId'])return;return db[_0x39db('0x72')][_0x39db('0x56')]({'where':{'id':_0xe2e9ed[_0x39db('0x55')][_0x39db('0x61')],'role':_0x39db('0x60')},'attributes':['id',_0x39db('0x37'),_0x39db('0x73'),_0x39db('0x74'),_0x39db('0x75')],'raw':!![]});}return null;})[_0x39db('0x1e')](function(_0x1f4eb2){if(!_0x1f4eb2)return null;_0x29e14f['message'][_0x39db('0x60')]=_0x1f4eb2;return _0x29e14f;})['then'](function(_0x2d7f89){if(_0x2d7f89){if(_0xe2e9ed[_0x39db('0x55')][_0x39db('0x76')]){_0x29e14f[_0x39db('0x26')][_0x39db('0x77')]=util[_0x39db('0x5d')]('SIP/%s',_0xe2e9ed[_0x39db('0x5f')][_0x39db('0x37')]);_0x29e14f[_0x39db('0x26')][_0x39db('0x78')]=_0x29e14f[_0x39db('0x78')];_0x29e14f['message'][_0x39db('0x79')]=_0x29e14f[_0x39db('0x78')];_0x29e14f[_0x39db('0x26')][_0x39db('0x7a')]=_0x39db('0x5a');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x29e14f[_0x39db('0x26')]},client9002)['then'](function(){return _0x29e14f;});}return _0x29e14f;}return null;})[_0x39db('0x1e')](respondWithResult(_0x3d3f4b,null))[_0x39db('0x28')](handleError(_0x3d3f4b,null));};var interaction_log=require(_0x39db('0x58'))(_0x39db('0x59'));exports[_0x39db('0x31')]=function(_0x57a77b,_0x11b2fc,_0x3a3550){var _0x562e25={'agent':{},'channel':_0x39db('0x7b')};if(_0x57a77b[_0x39db('0x55')]['id']){delete _0x57a77b[_0x39db('0x55')]['id'];}_0x57a77b[_0x39db('0x55')][_0x39db('0x61')]=_0x57a77b['body'][_0x39db('0x61')]||_0x57a77b['user']['id'];_0x562e25['agent']['id']=_0x57a77b[_0x39db('0x55')]['UserId'];return db[_0x39db('0x3a')]['find']({'where':{'id':_0x57a77b[_0x39db('0x4f')]['id'],'UserId':null}})[_0x39db('0x1e')](handleEntityNotFound(_0x11b2fc,null))[_0x39db('0x1e')](function(_0x4bf627){if(_0x4bf627){_0x562e25['message']=_0x4bf627['get']({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x4bf627[_0x39db('0x64')]}});}return null;})[_0x39db('0x1e')](handleEntityNotFound(_0x11b2fc,null))[_0x39db('0x1e')](function(_0x3659aa){if(_0x3659aa){_0x562e25[_0x39db('0x67')]=_0x3659aa[_0x39db('0x62')]({'plain':!![]});interaction_log['info'](_0x39db('0x7c'),_0x57a77b[_0x39db('0x5f')]['id'],_0x57a77b[_0x39db('0x5f')]['name'],_0x57a77b['user'][_0x39db('0x69')],_0x562e25['interaction']['id'],_0x57a77b[_0x39db('0x55')]?JSON[_0x39db('0x23')](_0x57a77b[_0x39db('0x55')]):_0x39db('0x6a'));return respondWithRpcPromise(_0x39db('0x7d'),'rejectMessage',_0x562e25);}return null;})['then'](function(_0xa24e55){var _0x355e0b=_0x39db('0x6c')+_0xa24e55[_0x39db('0x26')][_0x39db('0x7e')];return db[_0x39db('0x6d')][_0x39db('0x3f')](_0x355e0b,{'type':db['Sequelize'][_0x39db('0x6f')][_0x39db('0x70')],'raw':!![]})[_0x39db('0x1e')](function(_0x4c005f){return _0x4c005f;});})['then'](function(_0x18906f){if(_0x18906f){_0x562e25['message']['contact']=_0x18906f[0x0];if(!_0x57a77b[_0x39db('0x55')][_0x39db('0x61')])return;return db[_0x39db('0x72')]['find']({'where':{'id':_0x57a77b['body'][_0x39db('0x61')],'role':_0x39db('0x60')},'attributes':['id',_0x39db('0x37'),_0x39db('0x73'),_0x39db('0x74'),_0x39db('0x75')],'raw':!![]});}return null;})[_0x39db('0x1e')](function(_0x4d4980){if(!_0x4d4980)return null;_0x562e25[_0x39db('0x26')]['agent']=_0x4d4980;return _0x562e25;})[_0x39db('0x1e')](function(_0x250880){if(_0x250880){_0x250880['message'][_0x39db('0x77')]=util[_0x39db('0x5d')](_0x39db('0x7f'),_0x57a77b[_0x39db('0x5f')][_0x39db('0x37')]);_0x250880['message'][_0x39db('0x78')]=_0x562e25[_0x39db('0x78')];_0x250880[_0x39db('0x26')][_0x39db('0x79')]=_0x562e25[_0x39db('0x78')];_0x250880[_0x39db('0x26')][_0x39db('0x7a')]=_0x39db('0x31');respondWithRpcPromise(_0x39db('0x80'),_0x39db('0x80'),{'event':_0x39db('0x81'),'message':_0x250880[_0x39db('0x26')]},client9002);return _0x562e25;}return null;})[_0x39db('0x1e')](respondWithResult(_0x11b2fc,null))[_0x39db('0x28')](handleError(_0x11b2fc,null));};exports[_0x39db('0x82')]=function(_0x5885d1,_0x2a778b){var _0xf359e2;return db[_0x39db('0x3a')][_0x39db('0x82')](_0x5885d1[_0x39db('0x55')],{})[_0x39db('0x1e')](function(_0x4b7c10){_0xf359e2=_0x4b7c10;return db[_0x39db('0x83')]['findOne']({'where':{'id':_0xf359e2[_0x39db('0x7e')]}});})[_0x39db('0x1e')](function(_0x3b6da9){if(_[_0x39db('0x65')](_0x3b6da9)){return;}else{_0xf359e2[_0x39db('0x7b')]=_0x3b6da9[_0x39db('0x7b')];return db[_0x39db('0x84')][_0x39db('0x85')]({'where':{'id':_0xf359e2[_0x39db('0x86')]}});}})[_0x39db('0x1e')](function(_0x294e48){return respondWithRpcPromise(_0x39db('0x87'),_0x39db('0x87'),{'FaxAccountId':_['isNil'](_0x5885d1[_0x39db('0x55')])?undefined:_0x5885d1[_0x39db('0x55')][_0x39db('0x88')],'path':_[_0x39db('0x65')](_0x294e48)?undefined:util[_0x39db('0x5d')](_0x39db('0x89'),_0x294e48[_0x39db('0x8a')]),'fax':_[_0x39db('0x65')](_0xf359e2[_0x39db('0x7b')])?undefined:_0xf359e2[_0x39db('0x7b')],'AttachmentId':_0xf359e2[_0x39db('0x86')]},client9002);})[_0x39db('0x1e')](respondWithResult(_0x2a778b,0xc9))[_0x39db('0x28')](handleError(_0x2a778b,null));};exports[_0x39db('0x8b')]=function(_0x46f762,_0x1e3f12){var _0x236676=path[_0x39db('0x8c')](config['root'],'server',_0x39db('0x8d'),'attachments');return db[_0x39db('0x3a')][_0x39db('0x56')]({'where':{'id':_0x46f762[_0x39db('0x4f')]['id']},'include':[{'model':db[_0x39db('0x84')],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x1e3f12,null))[_0x39db('0x1e')](function(_0x423a9f){if(_0x423a9f){return _0x1e3f12[_0x39db('0x8b')](path[_0x39db('0x8c')](_0x236676,_0x423a9f[_0x39db('0x84')][_0x39db('0x8a')]));}})[_0x39db('0x28')](handleError(_0x1e3f12,null));}; \ No newline at end of file +var _0xffad=['../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','stack','name','send','index','map','FaxMessage','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','find','catch','update','body','destroy','describe','fax-interactions','accept','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','channel','motionChannel','EventManager','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','contact','interface','SIP/%s','event','create','CmContact','findOne','Attachment','SendFax','FaxAccountId','AttachmentId','join','root','attachments','download','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x2c6c8a,_0x149625){var _0x1dcb2b=function(_0x352fd8){while(--_0x352fd8){_0x2c6c8a['push'](_0x2c6c8a['shift']());}};_0x1dcb2b(++_0x149625);}(_0xffad,0x19b));var _0xdffa=function(_0x4d8673,_0x50b542){_0x4d8673=_0x4d8673-0x0;var _0xf35faa=_0xffad[_0x4d8673];return _0xf35faa;};'use strict';var emlformat=require(_0xdffa('0x0'));var rimraf=require(_0xdffa('0x1'));var zipdir=require(_0xdffa('0x2'));var jsonpatch=require(_0xdffa('0x3'));var rp=require(_0xdffa('0x4'));var moment=require(_0xdffa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdffa('0x6'));var util=require(_0xdffa('0x7'));var path=require(_0xdffa('0x8'));var sox=require('sox');var csv=require(_0xdffa('0x9'));var ejs=require(_0xdffa('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdffa('0xb'));var squel=require('squel');var crypto=require(_0xdffa('0xc'));var jsforce=require(_0xdffa('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdffa('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdffa('0xf'));var as=require(_0xdffa('0x10'));var hardwareService=require(_0xdffa('0x11'));var logger=require(_0xdffa('0x12'))(_0xdffa('0x13'));var utils=require(_0xdffa('0x14'));var config=require(_0xdffa('0x15'));var licenseUtil=require(_0xdffa('0x16'));var db=require('../../mysqldb')['db'];config[_0xdffa('0x17')]=_[_0xdffa('0x18')](config[_0xdffa('0x17')],{'host':_0xdffa('0x19'),'port':0x18eb});var socket=require(_0xdffa('0x1a'))(new Redis(config[_0xdffa('0x17')]));require(_0xdffa('0x1b'))[_0xdffa('0x1c')](socket);var jayson=require(_0xdffa('0x1d'));var client=jayson[_0xdffa('0x1e')][_0xdffa('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xdffa('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x529073,_0x14ae8f,_0x2ee747,_0x421a92){return new BPromise(function(_0x5cbd42,_0x205eac){var _0x412c89=_0x421a92||client;return _0x412c89[_0xdffa('0x20')](_0x529073,_0x2ee747)[_0xdffa('0x21')](function(_0x565cc5){logger[_0xdffa('0x22')]('FaxMessage,\x20%s,\x20%s',_0x14ae8f,_0xdffa('0x23'));logger[_0xdffa('0x24')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x14ae8f,_0xdffa('0x23'),JSON[_0xdffa('0x25')](_0x565cc5));if(_0x565cc5[_0xdffa('0x26')]){if(_0x565cc5[_0xdffa('0x26')][_0xdffa('0x27')]===0x1f4){logger[_0xdffa('0x26')](_0xdffa('0x28'),_0x14ae8f,_0x565cc5['error'][_0xdffa('0x29')]);return _0x205eac(_0x565cc5[_0xdffa('0x26')][_0xdffa('0x29')]);}logger[_0xdffa('0x26')](_0xdffa('0x28'),_0x14ae8f,_0x565cc5[_0xdffa('0x26')][_0xdffa('0x29')]);return _0x5cbd42(_0x565cc5[_0xdffa('0x26')]['message']);}else{logger['info'](_0xdffa('0x28'),_0x14ae8f,_0xdffa('0x23'));_0x5cbd42(_0x565cc5[_0xdffa('0x2a')][_0xdffa('0x29')]);}})['catch'](function(_0x5c8c18){logger[_0xdffa('0x26')](_0xdffa('0x28'),_0x14ae8f,_0x5c8c18);_0x205eac(_0x5c8c18);});});}function respondWithStatusCode(_0x4fc807,_0x4d396d){_0x4d396d=_0x4d396d||0xcc;return function(_0x48d02d){if(_0x48d02d){return _0x4fc807[_0xdffa('0x2b')](_0x4d396d);}return _0x4fc807[_0xdffa('0x2c')](_0x4d396d)[_0xdffa('0x2d')]();};}function respondWithResult(_0x2ab674,_0x425c14){_0x425c14=_0x425c14||0xc8;return function(_0x4fba6e){if(_0x4fba6e){return _0x2ab674['status'](_0x425c14)[_0xdffa('0x2e')](_0x4fba6e);}};}function respondWithFilteredResult(_0x28a486,_0x5f108a){return function(_0x463d4d){if(_0x463d4d){var _0x56cd70=typeof _0x5f108a[_0xdffa('0x2f')]==='undefined'&&typeof _0x5f108a['limit']===_0xdffa('0x30');var _0x1b7f07=_0x463d4d[_0xdffa('0x31')];var _0x2f7164=_0x56cd70?0x0:_0x5f108a[_0xdffa('0x2f')];var _0x1358a2=_0x56cd70?_0x463d4d['count']:_0x5f108a[_0xdffa('0x2f')]+_0x5f108a[_0xdffa('0x32')];var _0x400ffd;if(_0x1358a2>=_0x1b7f07){_0x1358a2=_0x1b7f07;_0x400ffd=0xc8;}else{_0x400ffd=0xce;}_0x28a486[_0xdffa('0x2c')](_0x400ffd);return _0x28a486[_0xdffa('0x33')]('Content-Range',_0x2f7164+'-'+_0x1358a2+'/'+_0x1b7f07)['json'](_0x463d4d);}return null;};}function patchUpdates(_0x9ec65f){return function(_0x17b5ec){try{jsonpatch[_0xdffa('0x34')](_0x17b5ec,_0x9ec65f,!![]);}catch(_0x50d8ce){return BPromise[_0xdffa('0x35')](_0x50d8ce);}return _0x17b5ec[_0xdffa('0x36')]();};}function saveUpdates(_0x242650,_0x636c53){return function(_0x14c20e){if(_0x14c20e){return _0x14c20e['update'](_0x242650)[_0xdffa('0x21')](function(_0x5f0461){return _0x5f0461;});}return null;};}function removeEntity(_0x4ac616,_0x576ed0){return function(_0xd8a023){if(_0xd8a023){return _0xd8a023['destroy']()[_0xdffa('0x21')](function(){_0x4ac616[_0xdffa('0x2c')](0xcc)[_0xdffa('0x2d')]();});}};}function handleEntityNotFound(_0x43fe36,_0x5a3a5e){return function(_0x23b6d3){if(!_0x23b6d3){_0x43fe36['sendStatus'](0x194);}return _0x23b6d3;};}function handleError(_0x44d561,_0xd2903){_0xd2903=_0xd2903||0x1f4;return function(_0xb84bf4){logger['error'](_0xb84bf4[_0xdffa('0x37')]);if(_0xb84bf4['name']){delete _0xb84bf4[_0xdffa('0x38')];}_0x44d561[_0xdffa('0x2c')](_0xd2903)[_0xdffa('0x39')](_0xb84bf4);};}exports[_0xdffa('0x3a')]=function(_0x5e3570,_0x58a834){var _0x39d286={},_0x2401ad={},_0x5cd781={'count':0x0,'rows':[]};var _0x5ced5e=_[_0xdffa('0x3b')](db[_0xdffa('0x3c')]['rawAttributes'],function(_0x567cd9){return{'name':_0x567cd9[_0xdffa('0x3d')],'type':_0x567cd9['type'][_0xdffa('0x3e')]};});_0x2401ad['model']=_[_0xdffa('0x3b')](_0x5ced5e,_0xdffa('0x38'));_0x2401ad[_0xdffa('0x3f')]=_[_0xdffa('0x40')](_0x5e3570['query']);_0x2401ad[_0xdffa('0x41')]=_[_0xdffa('0x42')](_0x2401ad[_0xdffa('0x43')],_0x2401ad[_0xdffa('0x3f')]);_0x39d286['attributes']=_[_0xdffa('0x42')](_0x2401ad[_0xdffa('0x43')],qs['fields'](_0x5e3570[_0xdffa('0x3f')][_0xdffa('0x44')]));_0x39d286[_0xdffa('0x45')]=_0x39d286['attributes'][_0xdffa('0x46')]?_0x39d286[_0xdffa('0x45')]:_0x2401ad[_0xdffa('0x43')];if(!_0x5e3570['query']['hasOwnProperty'](_0xdffa('0x47'))){_0x39d286[_0xdffa('0x32')]=qs[_0xdffa('0x32')](_0x5e3570[_0xdffa('0x3f')]['limit']);_0x39d286['offset']=qs[_0xdffa('0x2f')](_0x5e3570['query']['offset']);}_0x39d286[_0xdffa('0x48')]=qs[_0xdffa('0x49')](_0x5e3570[_0xdffa('0x3f')][_0xdffa('0x49')]);_0x39d286[_0xdffa('0x4a')]=qs[_0xdffa('0x41')](_[_0xdffa('0x4b')](_0x5e3570[_0xdffa('0x3f')],_0x2401ad[_0xdffa('0x41')]),_0x5ced5e);if(_0x5e3570['query']['filter']){_0x39d286[_0xdffa('0x4a')]=_['merge'](_0x39d286[_0xdffa('0x4a')],{'$or':_[_0xdffa('0x3b')](_0x5ced5e,function(_0x1e0167){if(_0x1e0167['type']!=='VIRTUAL'){var _0x1859a5={};_0x1859a5[_0x1e0167[_0xdffa('0x38')]]={'$like':'%'+_0x5e3570[_0xdffa('0x3f')][_0xdffa('0x4c')]+'%'};return _0x1859a5;}})});}_0x39d286=_[_0xdffa('0x4d')]({},_0x39d286,_0x5e3570[_0xdffa('0x4e')]);var _0x250260={'where':_0x39d286[_0xdffa('0x4a')]};return db[_0xdffa('0x3c')]['count'](_0x250260)[_0xdffa('0x21')](function(_0xe28b6c){_0x5cd781['count']=_0xe28b6c;if(_0x5e3570[_0xdffa('0x3f')][_0xdffa('0x4f')]){_0x39d286[_0xdffa('0x50')]=[{'all':!![]}];}return db[_0xdffa('0x3c')][_0xdffa('0x51')](_0x39d286);})['then'](function(_0xe5b60f){_0x5cd781[_0xdffa('0x52')]=_0xe5b60f;return _0x5cd781;})[_0xdffa('0x21')](respondWithFilteredResult(_0x58a834,_0x39d286))['catch'](handleError(_0x58a834,null));};exports['show']=function(_0x1bba74,_0x45599b){var _0x262faa={'raw':!![],'where':{'id':_0x1bba74[_0xdffa('0x53')]['id']}},_0x6a97e5={};_0x6a97e5[_0xdffa('0x43')]=_[_0xdffa('0x40')](db[_0xdffa('0x3c')]['rawAttributes']);_0x6a97e5[_0xdffa('0x3f')]=_[_0xdffa('0x40')](_0x1bba74[_0xdffa('0x3f')]);_0x6a97e5[_0xdffa('0x41')]=_['intersection'](_0x6a97e5[_0xdffa('0x43')],_0x6a97e5[_0xdffa('0x3f')]);_0x262faa['attributes']=_[_0xdffa('0x42')](_0x6a97e5[_0xdffa('0x43')],qs['fields'](_0x1bba74[_0xdffa('0x3f')][_0xdffa('0x44')]));_0x262faa['attributes']=_0x262faa['attributes'][_0xdffa('0x46')]?_0x262faa[_0xdffa('0x45')]:_0x6a97e5[_0xdffa('0x43')];if(_0x1bba74['query']['includeAll']){_0x262faa['include']=[{'all':!![]}];}_0x262faa=_[_0xdffa('0x4d')]({},_0x262faa,_0x1bba74[_0xdffa('0x4e')]);return db[_0xdffa('0x3c')][_0xdffa('0x54')](_0x262faa)[_0xdffa('0x21')](handleEntityNotFound(_0x45599b,null))['then'](respondWithResult(_0x45599b,null))[_0xdffa('0x55')](handleError(_0x45599b,null));};exports[_0xdffa('0x56')]=function(_0x3f0b3a,_0x4209e){if(_0x3f0b3a[_0xdffa('0x57')]['id']){delete _0x3f0b3a['body']['id'];}return db[_0xdffa('0x3c')]['find']({'where':{'id':_0x3f0b3a[_0xdffa('0x53')]['id']}})['then'](handleEntityNotFound(_0x4209e,null))[_0xdffa('0x21')](saveUpdates(_0x3f0b3a['body'],null))[_0xdffa('0x21')](respondWithResult(_0x4209e,null))[_0xdffa('0x55')](handleError(_0x4209e,null));};exports[_0xdffa('0x58')]=function(_0x4caac4,_0x8bb6fd){return db['FaxMessage'][_0xdffa('0x54')]({'where':{'id':_0x4caac4[_0xdffa('0x53')]['id']}})['then'](handleEntityNotFound(_0x8bb6fd,null))[_0xdffa('0x21')](removeEntity(_0x8bb6fd,null))['catch'](handleError(_0x8bb6fd,null));};exports[_0xdffa('0x59')]=function(_0x233744,_0x31442e){return db[_0xdffa('0x3c')][_0xdffa('0x59')]()['then'](respondWithResult(_0x31442e,null))[_0xdffa('0x55')](handleError(_0x31442e,null));};var interaction_log=require(_0xdffa('0x12'))(_0xdffa('0x5a'));exports[_0xdffa('0x5b')]=function(_0x288465,_0x36f995,_0x182061){var _0x497308={'agent':{},'channel':_0xdffa('0x5c')};if(_0x288465[_0xdffa('0x57')]['id']){delete _0x288465[_0xdffa('0x57')]['id'];}_0x288465['body'][_0xdffa('0x5d')]=!![];_0x288465[_0xdffa('0x57')][_0xdffa('0x5e')]=moment()['format'](_0xdffa('0x5f'));_0x288465[_0xdffa('0x57')]['UserId']=_0x288465[_0xdffa('0x57')][_0xdffa('0x60')]||_0x288465[_0xdffa('0x61')]['id'];_0x497308[_0xdffa('0x62')]['id']=_0x288465['body'][_0xdffa('0x60')];return db[_0xdffa('0x3c')][_0xdffa('0x54')]({'where':{'id':_0x288465[_0xdffa('0x53')]['id'],'UserId':null}})[_0xdffa('0x21')](handleEntityNotFound(_0x36f995,null))[_0xdffa('0x21')](saveUpdates(_0x288465['body'],null))[_0xdffa('0x21')](function(_0x3bcc01){if(_0x3bcc01){_0x497308[_0xdffa('0x29')]=_0x3bcc01[_0xdffa('0x63')]({'plain':!![]});return db[_0xdffa('0x64')][_0xdffa('0x54')]({'where':{'id':_0x3bcc01[_0xdffa('0x65')]}});}return null;})[_0xdffa('0x21')](handleEntityNotFound(_0x36f995,null))[_0xdffa('0x21')](function(_0x55a8a4){if(_0x55a8a4){return _0x55a8a4['update']({'UserId':_0x288465['body'][_0xdffa('0x60')],'read1stAt':_[_0xdffa('0x66')](_0x55a8a4[_0xdffa('0x67')])?moment()[_0xdffa('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdffa('0x21')](function(_0x28af66){if(_0x28af66){_0x497308[_0xdffa('0x69')]=_0x28af66['get']({'plain':!![]});interaction_log[_0xdffa('0x22')](_0xdffa('0x6a'),_0x288465[_0xdffa('0x61')]['id'],_0x288465['user'][_0xdffa('0x38')],_0x288465[_0xdffa('0x61')][_0xdffa('0x6b')],_0x497308['interaction']['id'],_0x288465['body']?JSON[_0xdffa('0x25')](_0x288465[_0xdffa('0x57')]):_0xdffa('0x6c'));return respondWithRpcPromise(_0xdffa('0x6d'),_0xdffa('0x6e'),_0x497308);}return null;})[_0xdffa('0x21')](function(_0xd268ca){var _0x4d7994='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xd268ca[_0xdffa('0x29')][_0xdffa('0x6f')];return db['sequelize']['query'](_0x4d7994,{'type':db[_0xdffa('0x70')][_0xdffa('0x71')][_0xdffa('0x72')],'raw':!![]})[_0xdffa('0x21')](function(_0x27a8bf){return _0x27a8bf;});})[_0xdffa('0x21')](function(_0x366fe4){if(_0x366fe4){_0x497308['message']['contact']=_0x366fe4[0x0];if(!_0x288465[_0xdffa('0x57')][_0xdffa('0x60')])return;return db[_0xdffa('0x73')][_0xdffa('0x54')]({'where':{'id':_0x288465[_0xdffa('0x57')][_0xdffa('0x60')],'role':_0xdffa('0x62')},'attributes':['id','name',_0xdffa('0x74'),_0xdffa('0x75'),_0xdffa('0x76')],'raw':!![]});}return null;})['then'](function(_0x10eb5c){if(!_0x10eb5c)return null;_0x497308[_0xdffa('0x29')][_0xdffa('0x62')]=_0x10eb5c;return _0x497308;})['then'](function(_0xd47c2f){if(_0xd47c2f){if(_0x288465[_0xdffa('0x57')][_0xdffa('0x77')]){_0x497308[_0xdffa('0x29')]['interface']=util[_0xdffa('0x68')]('SIP/%s',_0x288465['user'][_0xdffa('0x38')]);_0x497308['message'][_0xdffa('0x78')]=_0x497308[_0xdffa('0x78')];_0x497308['message'][_0xdffa('0x79')]=_0x497308[_0xdffa('0x78')];_0x497308['message']['event']=_0xdffa('0x5b');return respondWithRpcPromise(_0xdffa('0x7a'),_0xdffa('0x7a'),{'event':'acceptmessage','message':_0x497308[_0xdffa('0x29')]},client9002)[_0xdffa('0x21')](function(){return _0x497308;});}return _0x497308;}return null;})[_0xdffa('0x21')](respondWithResult(_0x36f995,null))[_0xdffa('0x55')](handleError(_0x36f995,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports['reject']=function(_0x44d058,_0x4ea379,_0x49d38b){var _0x7c12f4={'agent':{},'channel':_0xdffa('0x5c')};if(_0x44d058[_0xdffa('0x57')]['id']){delete _0x44d058[_0xdffa('0x57')]['id'];}_0x44d058[_0xdffa('0x57')][_0xdffa('0x60')]=_0x44d058[_0xdffa('0x57')][_0xdffa('0x60')]||_0x44d058[_0xdffa('0x61')]['id'];_0x7c12f4[_0xdffa('0x62')]['id']=_0x44d058[_0xdffa('0x57')][_0xdffa('0x60')];return db[_0xdffa('0x3c')][_0xdffa('0x54')]({'where':{'id':_0x44d058[_0xdffa('0x53')]['id'],'UserId':null}})[_0xdffa('0x21')](handleEntityNotFound(_0x4ea379,null))[_0xdffa('0x21')](function(_0x123c26){if(_0x123c26){_0x7c12f4[_0xdffa('0x29')]=_0x123c26[_0xdffa('0x63')]({'plain':!![]});return db[_0xdffa('0x64')]['find']({'where':{'id':_0x123c26[_0xdffa('0x65')]}});}return null;})[_0xdffa('0x21')](handleEntityNotFound(_0x4ea379,null))['then'](function(_0x3bcb3e){if(_0x3bcb3e){_0x7c12f4['interaction']=_0x3bcb3e[_0xdffa('0x63')]({'plain':!![]});interaction_log[_0xdffa('0x22')](_0xdffa('0x7b'),_0x44d058[_0xdffa('0x61')]['id'],_0x44d058[_0xdffa('0x61')][_0xdffa('0x38')],_0x44d058[_0xdffa('0x61')][_0xdffa('0x6b')],_0x7c12f4[_0xdffa('0x69')]['id'],_0x44d058[_0xdffa('0x57')]?JSON[_0xdffa('0x25')](_0x44d058['body']):_0xdffa('0x6c'));return respondWithRpcPromise(_0xdffa('0x7c'),_0xdffa('0x7d'),_0x7c12f4);}return null;})[_0xdffa('0x21')](function(_0xbf71c4){var _0x58c38a=_0xdffa('0x7e')+_0xbf71c4['message'][_0xdffa('0x6f')];return db[_0xdffa('0x7f')]['query'](_0x58c38a,{'type':db['Sequelize'][_0xdffa('0x71')][_0xdffa('0x72')],'raw':!![]})[_0xdffa('0x21')](function(_0x2f3aac){return _0x2f3aac;});})[_0xdffa('0x21')](function(_0x31c62d){if(_0x31c62d){_0x7c12f4[_0xdffa('0x29')][_0xdffa('0x80')]=_0x31c62d[0x0];if(!_0x44d058[_0xdffa('0x57')][_0xdffa('0x60')])return;return db[_0xdffa('0x73')][_0xdffa('0x54')]({'where':{'id':_0x44d058[_0xdffa('0x57')][_0xdffa('0x60')],'role':_0xdffa('0x62')},'attributes':['id','name','fullname',_0xdffa('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0x3ce235){if(!_0x3ce235)return null;_0x7c12f4[_0xdffa('0x29')][_0xdffa('0x62')]=_0x3ce235;return _0x7c12f4;})[_0xdffa('0x21')](function(_0x504afa){if(_0x504afa){_0x504afa[_0xdffa('0x29')][_0xdffa('0x81')]=util[_0xdffa('0x68')](_0xdffa('0x82'),_0x44d058[_0xdffa('0x61')][_0xdffa('0x38')]);_0x504afa[_0xdffa('0x29')][_0xdffa('0x78')]=_0x7c12f4[_0xdffa('0x78')];_0x504afa['message']['motionChannel']=_0x7c12f4[_0xdffa('0x78')];_0x504afa['message'][_0xdffa('0x83')]=_0xdffa('0x35');respondWithRpcPromise('EventManager',_0xdffa('0x7a'),{'event':'rejectmessage','message':_0x504afa[_0xdffa('0x29')]},client9002);return _0x7c12f4;}return null;})[_0xdffa('0x21')](respondWithResult(_0x4ea379,null))['catch'](handleError(_0x4ea379,null));};exports['create']=function(_0x5a9bc5,_0x2ddb88){var _0x59ccf8;return db['FaxMessage'][_0xdffa('0x84')](_0x5a9bc5[_0xdffa('0x57')],{})['then'](function(_0xd430e7){_0x59ccf8=_0xd430e7;return db[_0xdffa('0x85')][_0xdffa('0x86')]({'where':{'id':_0x59ccf8['ContactId']}});})['then'](function(_0x2d0a86){if(_['isNil'](_0x2d0a86)){return;}else{_0x59ccf8[_0xdffa('0x5c')]=_0x2d0a86[_0xdffa('0x5c')];return db[_0xdffa('0x87')][_0xdffa('0x86')]({'where':{'id':_0x59ccf8['AttachmentId']}});}})[_0xdffa('0x21')](function(_0x20ca13){return respondWithRpcPromise(_0xdffa('0x88'),_0xdffa('0x88'),{'FaxAccountId':_[_0xdffa('0x66')](_0x5a9bc5[_0xdffa('0x57')])?undefined:_0x5a9bc5[_0xdffa('0x57')][_0xdffa('0x89')],'path':_[_0xdffa('0x66')](_0x20ca13)?undefined:util[_0xdffa('0x68')]('/var/opt/motion2/server/files/attachments/%s',_0x20ca13['basename']),'fax':_[_0xdffa('0x66')](_0x59ccf8[_0xdffa('0x5c')])?undefined:_0x59ccf8[_0xdffa('0x5c')],'AttachmentId':_0x59ccf8[_0xdffa('0x8a')]},client9002);})[_0xdffa('0x21')](respondWithResult(_0x2ddb88,0xc9))['catch'](handleError(_0x2ddb88,null));};exports['download']=function(_0x476f52,_0x32ea1b){var _0x186d8f=path[_0xdffa('0x8b')](config[_0xdffa('0x8c')],'server','files',_0xdffa('0x8d'));return db['FaxMessage'][_0xdffa('0x54')]({'where':{'id':_0x476f52['params']['id']},'include':[{'model':db['Attachment'],'as':_0xdffa('0x87')}]})['then'](handleEntityNotFound(_0x32ea1b,null))['then'](function(_0x3cf392){if(_0x3cf392){return _0x32ea1b[_0xdffa('0x8e')](path[_0xdffa('0x8b')](_0x186d8f,_0x3cf392[_0xdffa('0x87')][_0xdffa('0x8f')]));}})[_0xdffa('0x55')](handleError(_0x32ea1b,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 1d1db89..97d3783 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 _0x4351=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxMessage'];(function(_0x22103c,_0x27346b){var _0x509853=function(_0x5754f9){while(--_0x5754f9){_0x22103c['push'](_0x22103c['shift']());}};_0x509853(++_0x27346b);}(_0x4351,0x1b5));var _0x1435=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x4351[_0x1d1779];return _0x2377e9;};'use strict';var EventEmitter=require(_0x1435('0x0'));var FaxMessage=require(_0x1435('0x1'))['db'][_0x1435('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1435('0x3')](0x0);var events={'afterCreate':_0x1435('0x4'),'afterUpdate':_0x1435('0x5'),'afterDestroy':_0x1435('0x6')};function emitEvent(_0x1b5f1e){return function(_0x2fc1f2,_0x2fa227,_0x111bc6){FaxMessageEvents[_0x1435('0x7')](_0x1b5f1e+':'+_0x2fc1f2['id'],_0x2fc1f2);FaxMessageEvents[_0x1435('0x7')](_0x1b5f1e,_0x2fc1f2);_0x111bc6(null);};}for(var e in events){if(events[_0x1435('0x8')](e)){var event=events[e];FaxMessage[_0x1435('0x9')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x1623=['emit','hasOwnProperty','exports','events','setMaxListeners','save','update','remove'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x1623,0xab));var _0x3162=function(_0x47a0f2,_0x37abcb){_0x47a0f2=_0x47a0f2-0x0;var _0x4098a9=_0x1623[_0x47a0f2];return _0x4098a9;};'use strict';var EventEmitter=require(_0x3162('0x0'));var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x3162('0x1')](0x0);var events={'afterCreate':_0x3162('0x2'),'afterUpdate':_0x3162('0x3'),'afterDestroy':_0x3162('0x4')};function emitEvent(_0x428dd7){return function(_0x4ce2bd,_0x5d49d0,_0x7a4559){FaxMessageEvents['emit'](_0x428dd7+':'+_0x4ce2bd['id'],_0x4ce2bd);FaxMessageEvents[_0x3162('0x5')](_0x428dd7,_0x4ce2bd);_0x7a4559(null);};}for(var e in events){if(events[_0x3162('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x3162('0x7')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 83f6b08..e314f46 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 _0x07c1=['api','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','toLowerCase','direction','out','secret','isNil','FaxInteraction','findOne','FaxInteractionId','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x07c1,0x127));var _0x107c=function(_0x30dcb1,_0x47eb46){_0x30dcb1=_0x30dcb1-0x0;var _0x98ed93=_0x07c1[_0x30dcb1];return _0x98ed93;};'use strict';var _=require(_0x107c('0x0'));var util=require(_0x107c('0x1'));var logger=require('../../config/logger')(_0x107c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x107c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x107c('0x4'));var config=require(_0x107c('0x5'));var attributes=require(_0x107c('0x6'));module[_0x107c('0x7')]=function(_0x58516e,_0x6c3fdb){return _0x58516e[_0x107c('0x8')](_0x107c('0x9'),attributes,{'tableName':_0x107c('0xa'),'paranoid':![],'indexes':[{'name':_0x107c('0xb'),'fields':[_0x107c('0xc')],'type':_0x107c('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x380ecc,_0x7e2b50,_0x5e6851){var _0x1b833c=_0x58516e[_0x107c('0xe')];var _0x145074=_0x380ecc['get']({'plain':!![]});if(_0x145074['direction'][_0x107c('0xf')]()==='in'||_0x145074[_0x107c('0x10')][_0x107c('0xf')]()===_0x107c('0x11')&&!_0x145074[_0x107c('0x12')]&&!_[_0x107c('0x13')](_0x145074['UserId'])){_0x1b833c[_0x107c('0x14')][_0x107c('0x15')]({'where':{'id':_0x145074[_0x107c('0x16')]}})['then'](function(_0x39f61d){if(_0x39f61d){_0x39f61d[_0x107c('0x17')]({'lastMsgAt':_0x145074['createdAt'],'lastMsgDirection':_0x145074[_0x107c('0x10')][_0x107c('0xf')]()});}})['catch'](function(_0x29a27d){console[_0x107c('0x18')](_0x29a27d);});}_0x5e6851();}},'charset':_0x107c('0x19'),'collate':_0x107c('0x1a')});}; \ No newline at end of file +var _0x0486=['FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','models','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne'];(function(_0x4b185e,_0x31c299){var _0x558b84=function(_0x5aa4d5){while(--_0x5aa4d5){_0x4b185e['push'](_0x4b185e['shift']());}};_0x558b84(++_0x31c299);}(_0x0486,0x131));var _0x6048=function(_0x56c70f,_0x4e4493){_0x56c70f=_0x56c70f-0x0;var _0x3812ed=_0x0486[_0x56c70f];return _0x3812ed;};'use strict';var _=require(_0x6048('0x0'));var util=require('util');var logger=require(_0x6048('0x1'))(_0x6048('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6048('0x3'));var rimraf=require(_0x6048('0x4'));var config=require(_0x6048('0x5'));var attributes=require(_0x6048('0x6'));module[_0x6048('0x7')]=function(_0x57e919,_0x41e5a0){return _0x57e919[_0x6048('0x8')](_0x6048('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4167c3,_0x56b248,_0x32c207){var _0x3d6462=_0x57e919[_0x6048('0xa')];var _0x26d28a=_0x4167c3['get']({'plain':!![]});if(_0x26d28a['direction']['toLowerCase']()==='in'||_0x26d28a[_0x6048('0xb')][_0x6048('0xc')]()===_0x6048('0xd')&&!_0x26d28a[_0x6048('0xe')]&&!_[_0x6048('0xf')](_0x26d28a[_0x6048('0x10')])){_0x3d6462[_0x6048('0x11')][_0x6048('0x12')]({'where':{'id':_0x26d28a[_0x6048('0x13')]}})[_0x6048('0x14')](function(_0x4da44c){if(_0x4da44c){_0x4da44c[_0x6048('0x15')]({'lastMsgAt':_0x26d28a[_0x6048('0x16')],'lastMsgDirection':_0x26d28a[_0x6048('0xb')][_0x6048('0xc')]()});}})[_0x6048('0x17')](function(_0x1c6320){console[_0x6048('0x18')](_0x1c6320);});}_0x32c207();}},'charset':_0x6048('0x19'),'collate':_0x6048('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index ad7ba89..f3f4bb3 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 _0x9a19=['http','redis','socket.io-emitter','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','body','options','raw','update','attributes','limit','UpdateFaxMessage','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4cfb78,_0x4c1da6){var _0xc1250e=function(_0x217b6c){while(--_0x217b6c){_0x4cfb78['push'](_0x4cfb78['shift']());}};_0xc1250e(++_0x4c1da6);}(_0x9a19,0x114));var _0x99a1=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x9a19[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var moment=require(_0x99a1('0x2'));var BPromise=require('bluebird');var rs=require(_0x99a1('0x3'));var fs=require('fs');var Redis=require(_0x99a1('0x4'));var db=require(_0x99a1('0x5'))['db'];var utils=require(_0x99a1('0x6'));var logger=require(_0x99a1('0x7'))(_0x99a1('0x8'));var config=require(_0x99a1('0x9'));var jayson=require(_0x99a1('0xa'));var client=jayson[_0x99a1('0xb')][_0x99a1('0xc')]({'port':0x232a});config[_0x99a1('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x99a1('0xe'))(new Redis(config[_0x99a1('0xd')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4696f6,_0xd7b568,_0x23db53){return new BPromise(function(_0x26473f,_0x1551a1){return client['request'](_0x4696f6,_0x23db53)[_0x99a1('0xf')](function(_0xdd29e1){logger[_0x99a1('0x10')](_0x99a1('0x11'),_0xd7b568,_0x99a1('0x12'));logger[_0x99a1('0x13')](_0x99a1('0x14'),_0xd7b568,_0x99a1('0x12'),JSON[_0x99a1('0x15')](_0xdd29e1));if(_0xdd29e1[_0x99a1('0x16')]){if(_0xdd29e1[_0x99a1('0x16')][_0x99a1('0x17')]===0x1f4){logger[_0x99a1('0x16')](_0x99a1('0x11'),_0xd7b568,_0xdd29e1[_0x99a1('0x16')]['message']);return _0x1551a1(_0xdd29e1[_0x99a1('0x16')][_0x99a1('0x18')]);}logger[_0x99a1('0x16')](_0x99a1('0x11'),_0xd7b568,_0xdd29e1[_0x99a1('0x16')][_0x99a1('0x18')]);return _0x26473f(_0xdd29e1[_0x99a1('0x16')]['message']);}else{logger['info'](_0x99a1('0x11'),_0xd7b568,_0x99a1('0x12'));_0x26473f(_0xdd29e1[_0x99a1('0x19')][_0x99a1('0x18')]);}})[_0x99a1('0x1a')](function(_0x209021){logger[_0x99a1('0x16')](_0x99a1('0x11'),_0xd7b568,_0x209021);_0x1551a1(_0x209021);});});}exports[_0x99a1('0x1b')]=function(_0x2d8cac){var _0x3c23c0=this;return new Promise(function(_0x5eabcb,_0x3023a1){return db[_0x99a1('0x1c')]['create'](_0x2d8cac[_0x99a1('0x1d')],{'raw':_0x2d8cac['options']?_0x2d8cac[_0x99a1('0x1e')][_0x99a1('0x1f')]===undefined?!![]:![]:!![]})[_0x99a1('0xf')](function(_0x2d3b82){logger['info'](_0x99a1('0x1b'),_0x2d8cac);logger[_0x99a1('0x13')]('CreateFaxMessage',_0x2d8cac,JSON[_0x99a1('0x15')](_0x2d3b82));_0x5eabcb(_0x2d3b82);})['catch'](function(_0x1f9800){logger[_0x99a1('0x16')](_0x99a1('0x1b'),_0x1f9800[_0x99a1('0x18')],_0x2d8cac);_0x3023a1(_0x3c23c0[_0x99a1('0x16')](0x1f4,_0x1f9800[_0x99a1('0x18')]));});});};exports['UpdateFaxMessage']=function(_0x114b38){var _0x5dabd9=this;return new Promise(function(_0x5dc733,_0xafea84){return db[_0x99a1('0x1c')][_0x99a1('0x20')](_0x114b38[_0x99a1('0x1d')],{'raw':_0x114b38[_0x99a1('0x1e')]?_0x114b38[_0x99a1('0x1e')][_0x99a1('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x114b38['options']?_0x114b38[_0x99a1('0x1e')]['where']||null:null,'attributes':_0x114b38[_0x99a1('0x1e')]?_0x114b38[_0x99a1('0x1e')][_0x99a1('0x21')]||null:null,'limit':_0x114b38['options']?_0x114b38[_0x99a1('0x1e')][_0x99a1('0x22')]||null:null})['then'](function(_0x37514e){logger[_0x99a1('0x10')](_0x99a1('0x23'),_0x114b38);logger[_0x99a1('0x13')](_0x99a1('0x23'),_0x114b38,JSON[_0x99a1('0x15')](_0x37514e));_0x5dc733(_0x37514e);})[_0x99a1('0x1a')](function(_0x26c23c){logger['error']('UpdateFaxMessage',_0x26c23c[_0x99a1('0x18')],_0x114b38);_0xafea84(_0x5dabd9['error'](0x1f4,_0x26c23c[_0x99a1('0x18')]));});});}; \ No newline at end of file +var _0x22fb=['request','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','options','raw','then','debug','UpdateFaxMessage','update','body','attributes','limit','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x22fb,0x192));var _0xb22f=function(_0x4412c7,_0x4c8c88){_0x4412c7=_0x4412c7-0x0;var _0x139311=_0x22fb[_0x4412c7];return _0x139311;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb22f('0x0'));var BPromise=require('bluebird');var rs=require(_0xb22f('0x1'));var fs=require('fs');var Redis=require(_0xb22f('0x2'));var db=require(_0xb22f('0x3'))['db'];var utils=require(_0xb22f('0x4'));var logger=require(_0xb22f('0x5'))('rpc');var config=require(_0xb22f('0x6'));var jayson=require(_0xb22f('0x7'));var client=jayson[_0xb22f('0x8')][_0xb22f('0x9')]({'port':0x232a});config[_0xb22f('0xa')]=_[_0xb22f('0xb')](config['redis'],{'host':_0xb22f('0xc'),'port':0x18eb});var socket=require(_0xb22f('0xd'))(new Redis(config[_0xb22f('0xa')]));require(_0xb22f('0xe'))[_0xb22f('0xf')](socket);function respondWithRpcPromise(_0x3593fb,_0x188cea,_0x2ca6dd){return new BPromise(function(_0x26cf79,_0x2676f3){return client[_0xb22f('0x10')](_0x3593fb,_0x2ca6dd)['then'](function(_0x4b9e56){logger['info'](_0xb22f('0x11'),_0x188cea,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x188cea,_0xb22f('0x12'),JSON[_0xb22f('0x13')](_0x4b9e56));if(_0x4b9e56[_0xb22f('0x14')]){if(_0x4b9e56[_0xb22f('0x14')][_0xb22f('0x15')]===0x1f4){logger[_0xb22f('0x14')]('FaxMessage,\x20%s,\x20%s',_0x188cea,_0x4b9e56[_0xb22f('0x14')]['message']);return _0x2676f3(_0x4b9e56[_0xb22f('0x14')]['message']);}logger[_0xb22f('0x14')](_0xb22f('0x11'),_0x188cea,_0x4b9e56[_0xb22f('0x14')][_0xb22f('0x16')]);return _0x26cf79(_0x4b9e56[_0xb22f('0x14')]['message']);}else{logger[_0xb22f('0x17')]('FaxMessage,\x20%s,\x20%s',_0x188cea,_0xb22f('0x12'));_0x26cf79(_0x4b9e56[_0xb22f('0x18')][_0xb22f('0x16')]);}})[_0xb22f('0x19')](function(_0x139bb6){logger[_0xb22f('0x14')]('FaxMessage,\x20%s,\x20%s',_0x188cea,_0x139bb6);_0x2676f3(_0x139bb6);});});}exports[_0xb22f('0x1a')]=function(_0x4b4510){var _0x3e05ce=this;return new Promise(function(_0x3878d8,_0x316f11){return db[_0xb22f('0x1b')][_0xb22f('0x1c')](_0x4b4510['body'],{'raw':_0x4b4510['options']?_0x4b4510[_0xb22f('0x1d')][_0xb22f('0x1e')]===undefined?!![]:![]:!![]})[_0xb22f('0x1f')](function(_0x16e465){logger[_0xb22f('0x17')](_0xb22f('0x1a'),_0x4b4510);logger[_0xb22f('0x20')](_0xb22f('0x1a'),_0x4b4510,JSON['stringify'](_0x16e465));_0x3878d8(_0x16e465);})['catch'](function(_0x3ab1d8){logger[_0xb22f('0x14')]('CreateFaxMessage',_0x3ab1d8[_0xb22f('0x16')],_0x4b4510);_0x316f11(_0x3e05ce[_0xb22f('0x14')](0x1f4,_0x3ab1d8['message']));});});};exports[_0xb22f('0x21')]=function(_0x2918be){var _0x4dfb62=this;return new Promise(function(_0x3e471f,_0x2c4a9e){return db[_0xb22f('0x1b')][_0xb22f('0x22')](_0x2918be[_0xb22f('0x23')],{'raw':_0x2918be[_0xb22f('0x1d')]?_0x2918be[_0xb22f('0x1d')][_0xb22f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2918be['options']?_0x2918be['options']['where']||null:null,'attributes':_0x2918be[_0xb22f('0x1d')]?_0x2918be['options'][_0xb22f('0x24')]||null:null,'limit':_0x2918be[_0xb22f('0x1d')]?_0x2918be[_0xb22f('0x1d')][_0xb22f('0x25')]||null:null})[_0xb22f('0x1f')](function(_0x5b2a42){logger['info'](_0xb22f('0x21'),_0x2918be);logger[_0xb22f('0x20')](_0xb22f('0x21'),_0x2918be,JSON[_0xb22f('0x13')](_0x5b2a42));_0x3e471f(_0x5b2a42);})['catch'](function(_0x176133){logger[_0xb22f('0x14')]('UpdateFaxMessage',_0x176133[_0xb22f('0x16')],_0x2918be);_0x2c4a9e(_0x4dfb62[_0xb22f('0x14')](0x1f4,_0x176133[_0xb22f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 094205e..e9ea646 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 _0x540a=['emit','length','faxMessage:','./faxMessage.events','save','remove','update'];(function(_0x58de31,_0x492d8b){var _0x149bc6=function(_0x159afa){while(--_0x159afa){_0x58de31['push'](_0x58de31['shift']());}};_0x149bc6(++_0x492d8b);}(_0x540a,0x1a0));var _0xa540=function(_0xb6d930,_0x4c9ca1){_0xb6d930=_0xb6d930-0x0;var _0x31e8b7=_0x540a[_0xb6d930];return _0x31e8b7;};'use strict';var FaxMessageEvents=require(_0xa540('0x0'));var events=[_0xa540('0x1'),_0xa540('0x2'),_0xa540('0x3')];function createListener(_0x4ab2df,_0x122aef){return function(_0x21ffaf){_0x122aef[_0xa540('0x4')](_0x4ab2df,_0x21ffaf);};}function removeListener(_0x2a93f5,_0x301ca6){return function(){FaxMessageEvents['removeListener'](_0x2a93f5,_0x301ca6);};}exports['register']=function(_0x75788e){for(var _0x192402=0x0,_0x24c82e=events[_0xa540('0x5')];_0x192402<_0x24c82e;_0x192402++){var _0x4ad9c2=events[_0x192402];var _0x4b43f8=createListener(_0xa540('0x6')+_0x4ad9c2,_0x75788e);FaxMessageEvents['on'](_0x4ad9c2,_0x4b43f8);}}; \ No newline at end of file +var _0x777f=['./faxMessage.events','save','remove','emit','removeListener','register','faxMessage:'];(function(_0x6eca42,_0x2810b1){var _0x39cba2=function(_0x1a28db){while(--_0x1a28db){_0x6eca42['push'](_0x6eca42['shift']());}};_0x39cba2(++_0x2810b1);}(_0x777f,0xbd));var _0xf777=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x777f[_0x3a7634];return _0x23bbe9;};'use strict';var FaxMessageEvents=require(_0xf777('0x0'));var events=[_0xf777('0x1'),_0xf777('0x2'),'update'];function createListener(_0x4957cb,_0x299896){return function(_0xa20463){_0x299896[_0xf777('0x3')](_0x4957cb,_0xa20463);};}function removeListener(_0x554f5f,_0x571be5){return function(){FaxMessageEvents[_0xf777('0x4')](_0x554f5f,_0x571be5);};}exports[_0xf777('0x5')]=function(_0xf6ccc7){for(var _0x299be4=0x0,_0x340a1c=events['length'];_0x299be4<_0x340a1c;_0x299be4++){var _0x3aeed6=events[_0x299be4];var _0x5b76ea=createListener(_0xf777('0x6')+_0x3aeed6,_0xf6ccc7);FaxMessageEvents['on'](_0x3aeed6,_0x5b76ea);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index faa02b7..5b3f950 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 _0xd3d1=['put','update','accept','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','tracked','fax','faxmessage:create','create'];(function(_0x36e254,_0xd75634){var _0xd2251f=function(_0x109319){while(--_0x109319){_0x36e254['push'](_0x36e254['shift']());}};_0xd2251f(++_0xd75634);}(_0xd3d1,0x172));var _0x1d3d=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xd3d1[_0x5f0089];return _0x193892;};'use strict';var multer=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d3d('0x2'));var router=express[_0x1d3d('0x3')]();var fs_extra=require(_0x1d3d('0x4'));var auth=require(_0x1d3d('0x5'));var interaction=require(_0x1d3d('0x6'));var config=require(_0x1d3d('0x7'));var controller=require(_0x1d3d('0x8'));router[_0x1d3d('0x9')]('/',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0xb')]);router[_0x1d3d('0x9')](_0x1d3d('0xc'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0xd')]);router[_0x1d3d('0x9')](_0x1d3d('0xe'),auth[_0x1d3d('0xa')](),controller['show']);router[_0x1d3d('0x9')](_0x1d3d('0xf'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x10')]);router[_0x1d3d('0x11')]('/',auth[_0x1d3d('0xa')](),interaction[_0x1d3d('0x12')](_0x1d3d('0x13'),_0x1d3d('0x14')),controller[_0x1d3d('0x15')]);router[_0x1d3d('0x16')]('/:id',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x17')]);router['put']('/:id/accept',auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x18')]);router[_0x1d3d('0x16')]('/:id/reject',auth[_0x1d3d('0xa')](),controller['reject']);router[_0x1d3d('0x19')](_0x1d3d('0xe'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0x1a')]);module[_0x1d3d('0x1b')]=router; \ No newline at end of file +var _0x55e0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','describe','/:id','/:id/download','download','post','fax','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','multer','util','path','connect-timeout','fs-extra'];(function(_0x1b3044,_0x24fe5d){var _0x4a7bb1=function(_0x41713e){while(--_0x41713e){_0x1b3044['push'](_0x1b3044['shift']());}};_0x4a7bb1(++_0x24fe5d);}(_0x55e0,0xdc));var _0x055e=function(_0x5f48d4,_0x1bedc6){_0x5f48d4=_0x5f48d4-0x0;var _0x463662=_0x55e0[_0x5f48d4];return _0x463662;};'use strict';var multer=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var path=require(_0x055e('0x2'));var timeout=require(_0x055e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x055e('0x4'));var auth=require(_0x055e('0x5'));var interaction=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var controller=require(_0x055e('0x8'));router[_0x055e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x055e('0x9')]('/describe',auth[_0x055e('0xa')](),controller[_0x055e('0xb')]);router[_0x055e('0x9')](_0x055e('0xc'),auth[_0x055e('0xa')](),controller['show']);router[_0x055e('0x9')](_0x055e('0xd'),auth[_0x055e('0xa')](),controller[_0x055e('0xe')]);router[_0x055e('0xf')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x055e('0x10'),'faxmessage:create'),controller[_0x055e('0x11')]);router[_0x055e('0x12')](_0x055e('0xc'),auth[_0x055e('0xa')](),controller[_0x055e('0x13')]);router[_0x055e('0x12')](_0x055e('0x14'),auth['isAuthenticated'](),controller[_0x055e('0x15')]);router[_0x055e('0x12')](_0x055e('0x16'),auth[_0x055e('0xa')](),controller[_0x055e('0x17')]);router['delete'](_0x055e('0xc'),auth[_0x055e('0xa')](),controller[_0x055e('0x18')]);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 2aed184..1d9ee47 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 _0xe9e4=['rrmemory','roundrobin','exports','STRING','name','INTEGER'];(function(_0x57a048,_0x41a46c){var _0xfb3a76=function(_0xa87fe){while(--_0xa87fe){_0x57a048['push'](_0x57a048['shift']());}};_0xfb3a76(++_0x41a46c);}(_0xe9e4,0x1e2));var _0x4e9e=function(_0x384222,_0x121068){_0x384222=_0x384222-0x0;var _0x314878=_0xe9e4[_0x384222];return _0x314878;};'use strict';var Sequelize=require('sequelize');module[_0x4e9e('0x0')]={'name':{'type':Sequelize[_0x4e9e('0x1')],'unique':_0x4e9e('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4e9e('0x1')]},'timeout':{'type':Sequelize[_0x4e9e('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x4e9e('0x4'),'beepall',_0x4e9e('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x4e9e('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbba1=['STRING','rrmemory','INTEGER','sequelize','name'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xbba1,0x17f));var _0x1bba=function(_0x8fa2fb,_0x2d380e){_0x8fa2fb=_0x8fa2fb-0x0;var _0x277a43=_0xbba1[_0x8fa2fb];return _0x277a43;};'use strict';var Sequelize=require(_0x1bba('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1bba('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1bba('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1bba('0x3'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x1bba('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index c63a39b..8385325 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 _0xf03a=['Team','User','Agents','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','addAgents','omit','spread','isArray','userFaxQueue:remove','pick','getAgents','util','lodash','squel','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','update','then','get','FaxQueues','destroy','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','where','include','query','findAll','rows','show','params','model','keys','filters','intersection','fields','attributes','length','merge','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','nolimit','sort','FaxQueueId','filter','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','order','addTeams','ids'];(function(_0x205b1c,_0x51c033){var _0x1605ac=function(_0x3b6895){while(--_0x3b6895){_0x205b1c['push'](_0x205b1c['shift']());}};_0x1605ac(++_0x51c033);}(_0xf03a,0x1a0));var _0xaf03=function(_0x40ef83,_0x5eb7b7){_0x40ef83=_0x40ef83-0x0;var _0x1a4853=_0xf03a[_0x40ef83];return _0x1a4853;};'use strict';var BPromise=require('bluebird');var util=require(_0xaf03('0x0'));var _=require(_0xaf03('0x1'));var squel=require(_0xaf03('0x2'));var Redis=require(_0xaf03('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xaf03('0x4'))(_0xaf03('0x5'));var config=require('../../config/environment');var db=require(_0xaf03('0x6'))['db'];config[_0xaf03('0x7')]=_[_0xaf03('0x8')](config[_0xaf03('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xaf03('0x9'))(new Redis(config['redis']));require(_0xaf03('0xa'))[_0xaf03('0xb')](socket);function respondWithStatusCode(_0x33a463,_0x28127e){_0x28127e=_0x28127e||0xcc;return function(_0x2e1964){if(_0x2e1964){return _0x33a463[_0xaf03('0xc')](_0x28127e);}return _0x33a463['status'](_0x28127e)[_0xaf03('0xd')]();};}function respondWithResult(_0x12e1a1,_0x4766d1){_0x4766d1=_0x4766d1||0xc8;return function(_0x33803e){if(_0x33803e){return _0x12e1a1[_0xaf03('0xe')](_0x4766d1)['json'](_0x33803e);}};}function respondWithFilteredResult(_0x1bc5a0,_0xa7a11c){return function(_0x2254d4){if(_0x2254d4){var _0x44255a=typeof _0xa7a11c[_0xaf03('0xf')]===_0xaf03('0x10')&&typeof _0xa7a11c[_0xaf03('0x11')]==='undefined';var _0x583919=_0x2254d4[_0xaf03('0x12')];var _0x525cfb=_0x44255a?0x0:_0xa7a11c[_0xaf03('0xf')];var _0x550e22=_0x44255a?_0x2254d4['count']:_0xa7a11c[_0xaf03('0xf')]+_0xa7a11c[_0xaf03('0x11')];var _0x38ca61;if(_0x550e22>=_0x583919){_0x550e22=_0x583919;_0x38ca61=0xc8;}else{_0x38ca61=0xce;}_0x1bc5a0[_0xaf03('0xe')](_0x38ca61);return _0x1bc5a0[_0xaf03('0x13')](_0xaf03('0x14'),_0x525cfb+'-'+_0x550e22+'/'+_0x583919)['json'](_0x2254d4);}return null;};}function saveUpdates(_0xcdc24){return function(_0x136ad9){if(_0x136ad9){return _0x136ad9[_0xaf03('0x15')](_0xcdc24)[_0xaf03('0x16')](function(_0x24a074){return _0x24a074;});}return null;};}function removeEntity(_0x27e625){return function(_0x5cede9){if(_0x5cede9){return _0x5cede9['destroy']()[_0xaf03('0x16')](function(){var _0xe4690a=_0x5cede9[_0xaf03('0x17')]({'plain':!![]});var _0xfe3672=_0xaf03('0x18');return db['UserProfileResource'][_0xaf03('0x19')]({'where':{'type':_0xfe3672,'resourceId':_0xe4690a['id']}})['then'](function(){return _0x5cede9;});})[_0xaf03('0x16')](function(){_0x27e625[_0xaf03('0xe')](0xcc)[_0xaf03('0xd')]();});}};}function handleEntityNotFound(_0x1f93c4){return function(_0x2962f5){if(!_0x2962f5){_0x1f93c4[_0xaf03('0xc')](0x194);}return _0x2962f5;};}function handleError(_0x230dd7,_0x1cefca){_0x1cefca=_0x1cefca||0x1f4;return function(_0x32370d){logger[_0xaf03('0x1a')](_0x32370d[_0xaf03('0x1b')]);if(_0x32370d['name']){delete _0x32370d[_0xaf03('0x1c')];}_0x230dd7[_0xaf03('0xe')](_0x1cefca)[_0xaf03('0x1d')](_0x32370d);};}exports[_0xaf03('0x1e')]=function(_0x4ef6cc,_0x5ea8c8){var _0x38aa61={};var _0x382e43={'count':0x0,'rows':[]};var _0x4db61b=_[_0xaf03('0x1f')](db[_0xaf03('0x20')][_0xaf03('0x21')],function(_0x1b1ac8){return{'name':_0x1b1ac8[_0xaf03('0x22')],'type':_0x1b1ac8[_0xaf03('0x23')]['key']};});_0x38aa61=qs['getOptions'](_0x4db61b,_0x4ef6cc);var _0x898120={'where':_0x38aa61[_0xaf03('0x24')]};return db[_0xaf03('0x20')][_0xaf03('0x12')](_0x898120)[_0xaf03('0x16')](function(_0x3a74b9){_0x382e43[_0xaf03('0x12')]=_0x3a74b9;_0x38aa61[_0xaf03('0x25')]=qs[_0xaf03('0x25')](_0x4ef6cc[_0xaf03('0x26')]);return db[_0xaf03('0x20')][_0xaf03('0x27')](_0x38aa61);})[_0xaf03('0x16')](function(_0x5be2ab){_0x382e43[_0xaf03('0x28')]=_0x5be2ab;return _0x382e43;})[_0xaf03('0x16')](respondWithFilteredResult(_0x5ea8c8,_0x38aa61))['catch'](handleError(_0x5ea8c8,null));};exports[_0xaf03('0x29')]=function(_0x480a3b,_0xfdaeb8){var _0xced6d0={'raw':!![],'where':{'id':_0x480a3b[_0xaf03('0x2a')]['id']}},_0x1bef3e={};_0x1bef3e[_0xaf03('0x2b')]=_[_0xaf03('0x2c')](db['FaxQueue'][_0xaf03('0x21')]);_0x1bef3e['query']=_[_0xaf03('0x2c')](_0x480a3b[_0xaf03('0x26')]);_0x1bef3e[_0xaf03('0x2d')]=_[_0xaf03('0x2e')](_0x1bef3e['model'],_0x1bef3e['query']);_0xced6d0['attributes']=_[_0xaf03('0x2e')](_0x1bef3e[_0xaf03('0x2b')],qs[_0xaf03('0x2f')](_0x480a3b[_0xaf03('0x26')]['fields']));_0xced6d0[_0xaf03('0x30')]=_0xced6d0[_0xaf03('0x30')][_0xaf03('0x31')]?_0xced6d0[_0xaf03('0x30')]:_0x1bef3e['model'];if(_0x480a3b[_0xaf03('0x26')]['includeAll']){_0xced6d0[_0xaf03('0x25')]=[{'all':!![]}];}_0xced6d0=_[_0xaf03('0x32')]({},_0xced6d0,_0x480a3b[_0xaf03('0x33')]);return db[_0xaf03('0x20')][_0xaf03('0x34')](_0xced6d0)[_0xaf03('0x16')](handleEntityNotFound(_0xfdaeb8,null))[_0xaf03('0x16')](respondWithResult(_0xfdaeb8,null))[_0xaf03('0x35')](handleError(_0xfdaeb8,null));};exports[_0xaf03('0x36')]=function(_0x5be50c,_0x2a72fd){return db[_0xaf03('0x20')][_0xaf03('0x36')](_0x5be50c[_0xaf03('0x37')],{})[_0xaf03('0x16')](function(_0x4e72e0){var _0x2e22c8=_0x5be50c['user'][_0xaf03('0x17')]({'plain':!![]});if(!_0x2e22c8)throw new Error(_0xaf03('0x38'));if(_0x2e22c8[_0xaf03('0x39')]===_0xaf03('0x3a')){var _0x4d25b8=_0x4e72e0[_0xaf03('0x17')]({'plain':!![]});var _0x369c20=_0xaf03('0x18');return db[_0xaf03('0x3b')][_0xaf03('0x34')]({'where':{'name':_0x369c20,'userProfileId':_0x2e22c8[_0xaf03('0x3c')]},'raw':!![]})[_0xaf03('0x16')](function(_0x49236c){if(_0x49236c&&_0x49236c['autoAssociation']===0x0){return db[_0xaf03('0x3d')]['create']({'name':_0x4d25b8[_0xaf03('0x1c')],'resourceId':_0x4d25b8['id'],'type':_0x49236c[_0xaf03('0x1c')],'sectionId':_0x49236c['id']},{})[_0xaf03('0x16')](function(){return _0x4e72e0;});}else{return _0x4e72e0;}})[_0xaf03('0x35')](function(_0x184a88){logger['error'](_0xaf03('0x3e'),_0x184a88);throw _0x184a88;});}return _0x4e72e0;})[_0xaf03('0x16')](respondWithResult(_0x2a72fd,0xc9))[_0xaf03('0x35')](handleError(_0x2a72fd,null));};exports[_0xaf03('0x15')]=function(_0x11c11e,_0x27ad10){if(_0x11c11e[_0xaf03('0x37')]['id']){delete _0x11c11e[_0xaf03('0x37')]['id'];}return db['FaxQueue'][_0xaf03('0x34')]({'where':{'id':_0x11c11e[_0xaf03('0x2a')]['id']}})[_0xaf03('0x16')](handleEntityNotFound(_0x27ad10,null))[_0xaf03('0x16')](saveUpdates(_0x11c11e['body'],null))[_0xaf03('0x16')](respondWithResult(_0x27ad10,null))[_0xaf03('0x35')](handleError(_0x27ad10,null));};exports[_0xaf03('0x19')]=function(_0x3150bf,_0x114792){return db[_0xaf03('0x20')]['find']({'where':{'id':_0x3150bf[_0xaf03('0x2a')]['id']}})[_0xaf03('0x16')](handleEntityNotFound(_0x114792,null))[_0xaf03('0x16')](removeEntity(_0x114792,null))[_0xaf03('0x35')](handleError(_0x114792,null));};exports['describe']=function(_0x246c6d,_0x2feb43){return db[_0xaf03('0x20')][_0xaf03('0x3f')]()[_0xaf03('0x16')](respondWithResult(_0x2feb43,null))[_0xaf03('0x35')](handleError(_0x2feb43,null));};exports[_0xaf03('0x40')]=function(_0x492759,_0x11cf1b){var _0x4466bc={'raw':!![],'where':{}},_0xc100cf={},_0x3cf586;return db['FaxQueue'][_0xaf03('0x41')]({'where':{'id':_0x492759['params']['id']}})['then'](handleEntityNotFound(_0x11cf1b,null))[_0xaf03('0x16')](function(_0x15fe5e){if(_0x15fe5e){_0x3cf586=_0x15fe5e[_0xaf03('0x17')]({'plain':!![]});_0xc100cf['model']=_[_0xaf03('0x2c')](db[_0xaf03('0x42')]['rawAttributes']);_0xc100cf['query']=_[_0xaf03('0x2c')](_0x492759[_0xaf03('0x26')]);_0xc100cf[_0xaf03('0x2d')]=_[_0xaf03('0x2e')](_0xc100cf[_0xaf03('0x2b')],_0xc100cf[_0xaf03('0x26')]);_0x4466bc[_0xaf03('0x30')]=_['intersection'](_0xc100cf[_0xaf03('0x2b')],qs['fields'](_0x492759['query'][_0xaf03('0x2f')]));_0x4466bc[_0xaf03('0x30')]=_0x4466bc[_0xaf03('0x30')][_0xaf03('0x31')]?_0x4466bc['attributes']:_0xc100cf[_0xaf03('0x2b')];if(!_0x492759[_0xaf03('0x26')][_0xaf03('0x43')](_0xaf03('0x44'))){_0x4466bc[_0xaf03('0x11')]=qs[_0xaf03('0x11')](_0x492759[_0xaf03('0x26')][_0xaf03('0x11')]);_0x4466bc[_0xaf03('0xf')]=qs[_0xaf03('0xf')](_0x492759[_0xaf03('0x26')][_0xaf03('0xf')]);}_0x4466bc['order']=qs[_0xaf03('0x45')](_0x492759['query']['sort']);_0x4466bc['where']=qs[_0xaf03('0x2d')](_['pick'](_0x492759['query'],_0xc100cf[_0xaf03('0x2d')]));_0x4466bc[_0xaf03('0x24')][_0xaf03('0x46')]=_0x15fe5e['id'];if(_0x492759[_0xaf03('0x26')][_0xaf03('0x47')]){_0x4466bc[_0xaf03('0x24')]=_[_0xaf03('0x32')](_0x4466bc[_0xaf03('0x24')],{'$or':_['map'](_0x4466bc[_0xaf03('0x30')],function(_0x3a4207){var _0xf8e158={};_0xf8e158[_0x3a4207]={'$like':'%'+_0x492759['query'][_0xaf03('0x47')]+'%'};return _0xf8e158;})});}_0x4466bc=_[_0xaf03('0x32')]({},_0x4466bc,_0x492759[_0xaf03('0x33')]);return db[_0xaf03('0x42')]['findAll'](_0x4466bc);}})[_0xaf03('0x16')](function(_0x18aea4){if(_0x18aea4){return db['User'][_0xaf03('0x48')]({'where':{'id':_[_0xaf03('0x1f')](_0x18aea4,_0xaf03('0x49')),'role':'agent'},'attributes':['id',_0xaf03('0x1c'),_0xaf03('0x4a'),_0xaf03('0x4b'),_0xaf03('0x4c')]});}})[_0xaf03('0x16')](function(_0x481aa4){if(_0x481aa4){return{'count':_0x481aa4[_0xaf03('0x12')],'rows':_[_0xaf03('0x1f')](_0x481aa4[_0xaf03('0x28')],function(_0x5d7043){return{'membername':_0x5d7043['name'],'UserId':_0x5d7043['id'],'queue_name':_0x3cf586[_0xaf03('0x1c')],'FaxQueueId':_0x3cf586['id'],'interface':util[_0xaf03('0x4d')](_0xaf03('0x4e'),_0xaf03('0x4f'),_0x5d7043[_0xaf03('0x1c')]),'penalty':0x0,'paused':_0x5d7043[_0xaf03('0x4a')],'createdAt':_0x5d7043['createdAt'],'updatedAt':_0x5d7043[_0xaf03('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xaf03('0x16')](respondWithFilteredResult(_0x11cf1b,_0x4466bc))['catch'](handleError(_0x11cf1b,null));};exports[_0xaf03('0x50')]=function(_0x490c63,_0x40e115){var _0x54034b={};var _0x342201={};var _0x47d9c6;var _0x4bcfdd;return db[_0xaf03('0x20')][_0xaf03('0x41')]({'where':{'id':_0x490c63[_0xaf03('0x2a')]['id']}})[_0xaf03('0x16')](handleEntityNotFound(_0x40e115,null))[_0xaf03('0x16')](function(_0x2a7e4d){if(_0x2a7e4d){_0x47d9c6=_0x2a7e4d;_0x342201[_0xaf03('0x2b')]=_[_0xaf03('0x2c')](db['Team'][_0xaf03('0x21')]);_0x342201[_0xaf03('0x26')]=_['keys'](_0x490c63['query']);_0x342201['filters']=_['intersection'](_0x342201[_0xaf03('0x2b')],_0x342201[_0xaf03('0x26')]);_0x54034b[_0xaf03('0x30')]=_[_0xaf03('0x2e')](_0x342201[_0xaf03('0x2b')],qs['fields'](_0x490c63[_0xaf03('0x26')]['fields']));_0x54034b[_0xaf03('0x30')]=_0x54034b[_0xaf03('0x30')]['length']?_0x54034b[_0xaf03('0x30')]:_0x342201[_0xaf03('0x2b')];_0x54034b[_0xaf03('0x51')]=qs['sort'](_0x490c63[_0xaf03('0x26')][_0xaf03('0x45')]);_0x54034b['where']=qs[_0xaf03('0x2d')](_['pick'](_0x490c63[_0xaf03('0x26')],_0x342201[_0xaf03('0x2d')]));if(_0x490c63[_0xaf03('0x26')][_0xaf03('0x47')]){_0x54034b['where']=_['merge'](_0x54034b[_0xaf03('0x24')],{'$or':_['map'](_0x54034b[_0xaf03('0x30')],function(_0x17cf6e){var _0x43e5cd={};_0x43e5cd[_0x17cf6e]={'$like':'%'+_0x490c63[_0xaf03('0x26')]['filter']+'%'};return _0x43e5cd;})});}_0x54034b=_['merge']({},_0x54034b,_0x490c63['options']);return _0x47d9c6[_0xaf03('0x50')](_0x54034b);}})[_0xaf03('0x16')](function(_0x163ee4){if(_0x163ee4){_0x4bcfdd=_0x163ee4[_0xaf03('0x31')];if(!_0x490c63[_0xaf03('0x26')][_0xaf03('0x43')]('nolimit')){_0x54034b[_0xaf03('0x11')]=qs[_0xaf03('0x11')](_0x490c63['query'][_0xaf03('0x11')]);_0x54034b['offset']=qs['offset'](_0x490c63[_0xaf03('0x26')]['offset']);}return _0x47d9c6[_0xaf03('0x50')](_0x54034b);}})[_0xaf03('0x16')](function(_0x246b32){if(_0x246b32){return _0x246b32?{'count':_0x4bcfdd,'rows':_0x246b32}:null;}})[_0xaf03('0x16')](respondWithResult(_0x40e115,null))['catch'](handleError(_0x40e115,null));};exports[_0xaf03('0x52')]=function(_0x183146,_0x1e0c95){var _0x13484b=_0x183146['body'][_0xaf03('0x53')];return db[_0xaf03('0x54')][_0xaf03('0x27')]({'where':{'id':_0x13484b},'attributes':['id'],'include':[{'model':db[_0xaf03('0x55')],'as':_0xaf03('0x56'),'attributes':['id',_0xaf03('0x1c'),'online',_0xaf03('0x57'),_0xaf03('0x58')],'raw':!![]}]})[_0xaf03('0x16')](function(_0x6780dd){if(_0x6780dd){var _0x282c54=_['flatMap'](_0x6780dd,function(_0x2faabe){var _0x5972e5=_0x2faabe[_0xaf03('0x17')]({'plain':!![]});return _0x5972e5[_0xaf03('0x56')];});return db[_0xaf03('0x20')][_0xaf03('0x34')]({'where':{'id':_0x183146[_0xaf03('0x2a')]['id']}})[_0xaf03('0x16')](function(_0x4dd99b){return db[_0xaf03('0x59')][_0xaf03('0x5a')](function(_0x505e5d){return _0x4dd99b[_0xaf03('0x52')](_0x13484b,{'transaction':_0x505e5d})[_0xaf03('0x16')](function(){return BPromise[_0xaf03('0x5b')](_0x282c54,function(_0x40bee5){return db['UserFaxQueue'][_0xaf03('0x5c')]({'where':{'UserId':_0x40bee5['id'],'FaxQueueId':_0x183146['params']['id']},'transaction':_0x505e5d});});})['then'](function(){_0x282c54[_0xaf03('0x5d')](function(_0x10ac09){socket[_0xaf03('0x5e')](_0xaf03('0x5f'),{'UserId':_0x10ac09['id'],'FaxQueueId':_0x4dd99b['id']});});});});});}})['then'](respondWithStatusCode(_0x1e0c95,null))['catch'](handleError(_0x1e0c95,null));};exports[_0xaf03('0x60')]=function(_0x1d73dc,_0x209a45){return db[_0xaf03('0x54')][_0xaf03('0x27')]({'where':{'id':_0x1d73dc[_0xaf03('0x26')][_0xaf03('0x53')]},'attributes':['id'],'include':[{'model':db[_0xaf03('0x55')],'as':_0xaf03('0x56'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x209a45,null))[_0xaf03('0x16')](function(_0x42c3aa){var _0xead01e=_[_0xaf03('0x1f')](_0x42c3aa,'id');var _0x3fcef3=[];var _0x423e1f=[];var _0x236f11=squel[_0xaf03('0x61')]();_0x236f11[_0xaf03('0x62')](_0xaf03('0x63'))[_0xaf03('0x64')](_0xaf03('0x65'),'tq')[_0xaf03('0x66')]('user_has_teams','ut',_0xaf03('0x67'))[_0xaf03('0x24')](_0xaf03('0x68'),_0x1d73dc[_0xaf03('0x2a')]['id']);for(var _0x403b48=0x0;_0x403b48<_0x42c3aa[_0xaf03('0x31')];_0x403b48+=0x1){let _0x31b476=_0x42c3aa[_0x403b48];for(var _0x3feeff=0x0;_0x3feeff<_0x31b476[_0xaf03('0x56')]['length'];_0x3feeff+=0x1){let _0x52c653=_0x31b476[_0xaf03('0x56')][_0x3feeff];var _0x4fd9b6=_0x236f11[_0xaf03('0x69')]();_0x4fd9b6['where'](_0xaf03('0x6a'),_0x52c653['id']);_0x423e1f[_0xaf03('0x6b')](db[_0xaf03('0x59')]['query'](_0x4fd9b6[_0xaf03('0x6c')](),{'type':db[_0xaf03('0x59')]['QueryTypes'][_0xaf03('0x6d')]})[_0xaf03('0x16')](function(_0x1ec879){if(_0x1ec879[_0xaf03('0x31')]===0x1){return _0x52c653['id'];}else{var _0x377f87=_[_0xaf03('0x6e')](_['map'](_0x1ec879,_0xaf03('0x6f')),function(_0x7aa07c){return _[_0xaf03('0x70')](_0xead01e,_0x7aa07c);});if(_0x377f87){return _0x52c653['id'];}}}));}}return BPromise[_0xaf03('0x71')](_0x423e1f)[_0xaf03('0x16')](function(_0x3afa23){_0x3fcef3=_(_0x3fcef3)[_0xaf03('0x72')](_0x3afa23)[_0xaf03('0x73')]()[_0xaf03('0x74')]();return db[_0xaf03('0x20')][_0xaf03('0x34')]({'where':{'id':_0x1d73dc[_0xaf03('0x2a')]['id']}})['then'](function(_0x280da1){return db['sequelize'][_0xaf03('0x5a')](function(_0x1af5cb){return _0x280da1[_0xaf03('0x60')](_0x1d73dc[_0xaf03('0x26')][_0xaf03('0x53')],{'transaction':_0x1af5cb})['then'](function(){if(!_['isEmpty'](_0x3fcef3)){return _0x280da1[_0xaf03('0x75')](_0x3fcef3,{'transaction':_0x1af5cb});}})[_0xaf03('0x16')](function(){_0x3fcef3[_0xaf03('0x5d')](function(_0x4a9003){socket[_0xaf03('0x5e')]('userFaxQueue:remove',{'UserId':_0x4a9003,'FaxQueueId':_0x280da1['id']});});});});});});})['then'](respondWithStatusCode(_0x209a45,null))[_0xaf03('0x35')](handleError(_0x209a45,null));};exports['addAgents']=function(_0x246101,_0x3c0f93){return db['FaxQueue'][_0xaf03('0x34')]({'where':{'id':_0x246101[_0xaf03('0x2a')]['id']}})['then'](handleEntityNotFound(_0x3c0f93,null))[_0xaf03('0x16')](function(_0x511d6f){if(_0x511d6f){return _0x511d6f[_0xaf03('0x76')](_0x246101[_0xaf03('0x37')]['ids'],_[_0xaf03('0x77')](_0x246101[_0xaf03('0x37')],[_0xaf03('0x53'),'id'])||{})[_0xaf03('0x78')](function(_0x38ba93){for(var _0x24c160=0x0;_0x24c160<_0x246101[_0xaf03('0x37')][_0xaf03('0x53')][_0xaf03('0x31')];_0x24c160+=0x1){socket['emit'](_0xaf03('0x5f'),{'UserId':Number(_0x246101[_0xaf03('0x37')]['ids'][_0x24c160]),'FaxQueueId':Number(_0x246101[_0xaf03('0x2a')]['id'])});}return _0x38ba93;});}})[_0xaf03('0x16')](respondWithResult(_0x3c0f93,null))[_0xaf03('0x35')](handleError(_0x3c0f93,null));};exports[_0xaf03('0x75')]=function(_0x28d4de,_0x550ea9){return db[_0xaf03('0x20')][_0xaf03('0x34')]({'where':{'id':_0x28d4de[_0xaf03('0x2a')]['id']}})[_0xaf03('0x16')](handleEntityNotFound(_0x550ea9,null))['then'](function(_0x2af7f0){if(_0x2af7f0){return _0x2af7f0[_0xaf03('0x75')](_0x28d4de[_0xaf03('0x26')][_0xaf03('0x53')])['then'](function(){if(_[_0xaf03('0x79')](_0x28d4de[_0xaf03('0x26')]['ids'])){for(var _0x3924b6=0x0;_0x3924b6<_0x28d4de[_0xaf03('0x26')]['ids'][_0xaf03('0x31')];_0x3924b6+=0x1){socket[_0xaf03('0x5e')]('userFaxQueue:remove',{'UserId':Number(_0x28d4de[_0xaf03('0x26')][_0xaf03('0x53')][_0x3924b6]),'FaxQueueId':Number(_0x28d4de['params']['id'])});}}else{socket['emit'](_0xaf03('0x7a'),{'UserId':Number(_0x28d4de[_0xaf03('0x26')][_0xaf03('0x53')]),'FaxQueueId':Number(_0x28d4de[_0xaf03('0x2a')]['id'])});}});}})[_0xaf03('0x16')](respondWithStatusCode(_0x550ea9,null))[_0xaf03('0x35')](handleError(_0x550ea9,null));};exports['getAgents']=function(_0xb193c7,_0x2d245f){var _0x359ef7={};var _0x522afe={};var _0x24f1b1;var _0x52d23f;return db[_0xaf03('0x20')][_0xaf03('0x41')]({'where':{'id':_0xb193c7[_0xaf03('0x2a')]['id']}})[_0xaf03('0x16')](handleEntityNotFound(_0x2d245f,null))[_0xaf03('0x16')](function(_0x26551a){if(_0x26551a){_0x24f1b1=_0x26551a;_0x522afe['model']=_[_0xaf03('0x2c')](db[_0xaf03('0x55')][_0xaf03('0x21')]);_0x522afe[_0xaf03('0x26')]=_[_0xaf03('0x2c')](_0xb193c7[_0xaf03('0x26')]);_0x522afe[_0xaf03('0x2d')]=_[_0xaf03('0x2e')](_0x522afe[_0xaf03('0x2b')],_0x522afe['query']);_0x359ef7[_0xaf03('0x30')]=_[_0xaf03('0x2e')](_0x522afe[_0xaf03('0x2b')],qs[_0xaf03('0x2f')](_0xb193c7['query'][_0xaf03('0x2f')]));_0x359ef7[_0xaf03('0x30')]=_0x359ef7['attributes'][_0xaf03('0x31')]?_0x359ef7[_0xaf03('0x30')]:_0x522afe[_0xaf03('0x2b')];_0x359ef7[_0xaf03('0x51')]=qs[_0xaf03('0x45')](_0xb193c7[_0xaf03('0x26')][_0xaf03('0x45')]);_0x359ef7['where']=qs[_0xaf03('0x2d')](_[_0xaf03('0x7b')](_0xb193c7['query'],_0x522afe[_0xaf03('0x2d')]));if(_0xb193c7[_0xaf03('0x26')]['filter']){_0x359ef7['where']=_[_0xaf03('0x32')](_0x359ef7['where'],{'$or':_[_0xaf03('0x1f')](_0x359ef7['attributes'],function(_0x16f223){var _0x233695={};_0x233695[_0x16f223]={'$like':'%'+_0xb193c7[_0xaf03('0x26')][_0xaf03('0x47')]+'%'};return _0x233695;})});}_0x359ef7=_[_0xaf03('0x32')]({},_0x359ef7,_0xb193c7[_0xaf03('0x33')]);return _0x24f1b1[_0xaf03('0x7c')](_0x359ef7);}})['then'](function(_0x2c2ca2){if(_0x2c2ca2){_0x52d23f=_0x2c2ca2[_0xaf03('0x31')];if(!_0xb193c7[_0xaf03('0x26')][_0xaf03('0x43')](_0xaf03('0x44'))){_0x359ef7[_0xaf03('0x11')]=qs[_0xaf03('0x11')](_0xb193c7[_0xaf03('0x26')]['limit']);_0x359ef7['offset']=qs[_0xaf03('0xf')](_0xb193c7[_0xaf03('0x26')]['offset']);}return _0x24f1b1[_0xaf03('0x7c')](_0x359ef7);}})[_0xaf03('0x16')](function(_0x3f63c1){if(_0x3f63c1){return _0x3f63c1?{'count':_0x52d23f,'rows':_0x3f63c1}:null;}})['then'](respondWithResult(_0x2d245f,null))['catch'](handleError(_0x2d245f,null));}; \ No newline at end of file +var _0xb242=['ids','Agents','online','voicePause','interface','flatMap','sequelize','findOrCreate','forEach','emit','field','tq.TeamId','from','team_has_fax_queues','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','transaction','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','spread','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','status','json','offset','undefined','count','Content-Range','then','destroy','FaxQueues','UserProfileResource','end','name','send','index','map','FaxQueue','fieldName','type','include','findAll','rows','catch','show','params','keys','rawAttributes','query','filters','model','attributes','fields','length','includeAll','options','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','update','body','describe','findOne','UserFaxQueue','intersection','hasOwnProperty','nolimit','limit','sort','where','pick','FaxQueueId','filter','merge','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','getTeams','Team','order','addTeams'];(function(_0xc3bdb8,_0x523f31){var _0x1c879e=function(_0x22ada7){while(--_0x22ada7){_0xc3bdb8['push'](_0xc3bdb8['shift']());}};_0x1c879e(++_0x523f31);}(_0xb242,0x1f3));var _0x2b24=function(_0xad57ee,_0x2823a6){_0xad57ee=_0xad57ee-0x0;var _0x3eaea9=_0xb242[_0xad57ee];return _0x3eaea9;};'use strict';var BPromise=require('bluebird');var util=require(_0x2b24('0x0'));var _=require(_0x2b24('0x1'));var squel=require(_0x2b24('0x2'));var Redis=require(_0x2b24('0x3'));var qs=require(_0x2b24('0x4'));var logger=require(_0x2b24('0x5'))(_0x2b24('0x6'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x2b24('0x7')]=_[_0x2b24('0x8')](config['redis'],{'host':_0x2b24('0x9'),'port':0x18eb});var socket=require(_0x2b24('0xa'))(new Redis(config[_0x2b24('0x7')]));require('./faxQueue.socket')[_0x2b24('0xb')](socket);function respondWithStatusCode(_0x56c14a,_0x20d5f6){_0x20d5f6=_0x20d5f6||0xcc;return function(_0x82681f){if(_0x82681f){return _0x56c14a['sendStatus'](_0x20d5f6);}return _0x56c14a[_0x2b24('0xc')](_0x20d5f6)['end']();};}function respondWithResult(_0x24efd2,_0x12a5cb){_0x12a5cb=_0x12a5cb||0xc8;return function(_0x5e219d){if(_0x5e219d){return _0x24efd2['status'](_0x12a5cb)[_0x2b24('0xd')](_0x5e219d);}};}function respondWithFilteredResult(_0x4ab047,_0x3bb441){return function(_0x2a23b6){if(_0x2a23b6){var _0x2aed32=typeof _0x3bb441[_0x2b24('0xe')]==='undefined'&&typeof _0x3bb441['limit']===_0x2b24('0xf');var _0x42ff81=_0x2a23b6[_0x2b24('0x10')];var _0x1e44db=_0x2aed32?0x0:_0x3bb441[_0x2b24('0xe')];var _0x5f5b96=_0x2aed32?_0x2a23b6[_0x2b24('0x10')]:_0x3bb441[_0x2b24('0xe')]+_0x3bb441['limit'];var _0x38cd5d;if(_0x5f5b96>=_0x42ff81){_0x5f5b96=_0x42ff81;_0x38cd5d=0xc8;}else{_0x38cd5d=0xce;}_0x4ab047[_0x2b24('0xc')](_0x38cd5d);return _0x4ab047['set'](_0x2b24('0x11'),_0x1e44db+'-'+_0x5f5b96+'/'+_0x42ff81)[_0x2b24('0xd')](_0x2a23b6);}return null;};}function saveUpdates(_0x2fdc73){return function(_0x2f5c76){if(_0x2f5c76){return _0x2f5c76['update'](_0x2fdc73)[_0x2b24('0x12')](function(_0x2815dc){return _0x2815dc;});}return null;};}function removeEntity(_0x135261){return function(_0x4951af){if(_0x4951af){return _0x4951af[_0x2b24('0x13')]()[_0x2b24('0x12')](function(){var _0x2e1fa2=_0x4951af['get']({'plain':!![]});var _0x58bff6=_0x2b24('0x14');return db[_0x2b24('0x15')][_0x2b24('0x13')]({'where':{'type':_0x58bff6,'resourceId':_0x2e1fa2['id']}})[_0x2b24('0x12')](function(){return _0x4951af;});})['then'](function(){_0x135261[_0x2b24('0xc')](0xcc)[_0x2b24('0x16')]();});}};}function handleEntityNotFound(_0x1cac48){return function(_0x2b94d3){if(!_0x2b94d3){_0x1cac48['sendStatus'](0x194);}return _0x2b94d3;};}function handleError(_0x504ecf,_0x22c8c5){_0x22c8c5=_0x22c8c5||0x1f4;return function(_0x5d97e1){logger['error'](_0x5d97e1['stack']);if(_0x5d97e1['name']){delete _0x5d97e1[_0x2b24('0x17')];}_0x504ecf[_0x2b24('0xc')](_0x22c8c5)[_0x2b24('0x18')](_0x5d97e1);};}exports[_0x2b24('0x19')]=function(_0x5cd375,_0x5042bf){var _0x4d25e4={};var _0x1fde97={'count':0x0,'rows':[]};var _0x20801c=_[_0x2b24('0x1a')](db[_0x2b24('0x1b')]['rawAttributes'],function(_0x5c9efb){return{'name':_0x5c9efb[_0x2b24('0x1c')],'type':_0x5c9efb[_0x2b24('0x1d')]['key']};});_0x4d25e4=qs['getOptions'](_0x20801c,_0x5cd375);var _0x2a0aea={'where':_0x4d25e4['where']};return db['FaxQueue'][_0x2b24('0x10')](_0x2a0aea)[_0x2b24('0x12')](function(_0x12604d){_0x1fde97[_0x2b24('0x10')]=_0x12604d;_0x4d25e4['include']=qs[_0x2b24('0x1e')](_0x5cd375['query']);return db[_0x2b24('0x1b')][_0x2b24('0x1f')](_0x4d25e4);})[_0x2b24('0x12')](function(_0x12c529){_0x1fde97[_0x2b24('0x20')]=_0x12c529;return _0x1fde97;})[_0x2b24('0x12')](respondWithFilteredResult(_0x5042bf,_0x4d25e4))[_0x2b24('0x21')](handleError(_0x5042bf,null));};exports[_0x2b24('0x22')]=function(_0x1cb530,_0x1ab4fe){var _0x42be50={'raw':!![],'where':{'id':_0x1cb530[_0x2b24('0x23')]['id']}},_0x562838={};_0x562838['model']=_[_0x2b24('0x24')](db['FaxQueue'][_0x2b24('0x25')]);_0x562838[_0x2b24('0x26')]=_['keys'](_0x1cb530[_0x2b24('0x26')]);_0x562838[_0x2b24('0x27')]=_['intersection'](_0x562838[_0x2b24('0x28')],_0x562838[_0x2b24('0x26')]);_0x42be50[_0x2b24('0x29')]=_['intersection'](_0x562838[_0x2b24('0x28')],qs[_0x2b24('0x2a')](_0x1cb530['query'][_0x2b24('0x2a')]));_0x42be50[_0x2b24('0x29')]=_0x42be50['attributes'][_0x2b24('0x2b')]?_0x42be50[_0x2b24('0x29')]:_0x562838['model'];if(_0x1cb530[_0x2b24('0x26')][_0x2b24('0x2c')]){_0x42be50[_0x2b24('0x1e')]=[{'all':!![]}];}_0x42be50=_['merge']({},_0x42be50,_0x1cb530[_0x2b24('0x2d')]);return db[_0x2b24('0x1b')][_0x2b24('0x2e')](_0x42be50)[_0x2b24('0x12')](handleEntityNotFound(_0x1ab4fe,null))['then'](respondWithResult(_0x1ab4fe,null))[_0x2b24('0x21')](handleError(_0x1ab4fe,null));};exports[_0x2b24('0x2f')]=function(_0x217eac,_0x1810b4){return db[_0x2b24('0x1b')][_0x2b24('0x2f')](_0x217eac['body'],{})[_0x2b24('0x12')](function(_0x258ca6){var _0x181da8=_0x217eac[_0x2b24('0x30')][_0x2b24('0x31')]({'plain':!![]});if(!_0x181da8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x181da8[_0x2b24('0x32')]===_0x2b24('0x30')){var _0x4c9182=_0x258ca6[_0x2b24('0x31')]({'plain':!![]});var _0x36d5c0='FaxQueues';return db[_0x2b24('0x33')][_0x2b24('0x2e')]({'where':{'name':_0x36d5c0,'userProfileId':_0x181da8[_0x2b24('0x34')]},'raw':!![]})[_0x2b24('0x12')](function(_0x1ff337){if(_0x1ff337&&_0x1ff337[_0x2b24('0x35')]===0x0){return db['UserProfileResource'][_0x2b24('0x2f')]({'name':_0x4c9182[_0x2b24('0x17')],'resourceId':_0x4c9182['id'],'type':_0x1ff337['name'],'sectionId':_0x1ff337['id']},{})['then'](function(){return _0x258ca6;});}else{return _0x258ca6;}})[_0x2b24('0x21')](function(_0x32c29b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32c29b);throw _0x32c29b;});}return _0x258ca6;})['then'](respondWithResult(_0x1810b4,0xc9))['catch'](handleError(_0x1810b4,null));};exports[_0x2b24('0x36')]=function(_0x30e8f8,_0x4672e6){if(_0x30e8f8[_0x2b24('0x37')]['id']){delete _0x30e8f8[_0x2b24('0x37')]['id'];}return db[_0x2b24('0x1b')]['find']({'where':{'id':_0x30e8f8['params']['id']}})['then'](handleEntityNotFound(_0x4672e6,null))[_0x2b24('0x12')](saveUpdates(_0x30e8f8[_0x2b24('0x37')],null))[_0x2b24('0x12')](respondWithResult(_0x4672e6,null))['catch'](handleError(_0x4672e6,null));};exports[_0x2b24('0x13')]=function(_0x4a6c67,_0x2ac49f){return db[_0x2b24('0x1b')][_0x2b24('0x2e')]({'where':{'id':_0x4a6c67[_0x2b24('0x23')]['id']}})[_0x2b24('0x12')](handleEntityNotFound(_0x2ac49f,null))[_0x2b24('0x12')](removeEntity(_0x2ac49f,null))['catch'](handleError(_0x2ac49f,null));};exports[_0x2b24('0x38')]=function(_0x37a538,_0x1f30cc){return db['FaxQueue'][_0x2b24('0x38')]()['then'](respondWithResult(_0x1f30cc,null))[_0x2b24('0x21')](handleError(_0x1f30cc,null));};exports['getMembers']=function(_0x19d816,_0x12dafe){var _0x18d504={'raw':!![],'where':{}},_0x30b123={},_0x3c7a9d;return db[_0x2b24('0x1b')][_0x2b24('0x39')]({'where':{'id':_0x19d816[_0x2b24('0x23')]['id']}})['then'](handleEntityNotFound(_0x12dafe,null))[_0x2b24('0x12')](function(_0xb2ebe5){if(_0xb2ebe5){_0x3c7a9d=_0xb2ebe5[_0x2b24('0x31')]({'plain':!![]});_0x30b123[_0x2b24('0x28')]=_['keys'](db[_0x2b24('0x3a')][_0x2b24('0x25')]);_0x30b123[_0x2b24('0x26')]=_[_0x2b24('0x24')](_0x19d816[_0x2b24('0x26')]);_0x30b123[_0x2b24('0x27')]=_['intersection'](_0x30b123[_0x2b24('0x28')],_0x30b123[_0x2b24('0x26')]);_0x18d504['attributes']=_[_0x2b24('0x3b')](_0x30b123['model'],qs[_0x2b24('0x2a')](_0x19d816[_0x2b24('0x26')][_0x2b24('0x2a')]));_0x18d504[_0x2b24('0x29')]=_0x18d504[_0x2b24('0x29')][_0x2b24('0x2b')]?_0x18d504[_0x2b24('0x29')]:_0x30b123['model'];if(!_0x19d816[_0x2b24('0x26')][_0x2b24('0x3c')](_0x2b24('0x3d'))){_0x18d504[_0x2b24('0x3e')]=qs[_0x2b24('0x3e')](_0x19d816[_0x2b24('0x26')]['limit']);_0x18d504[_0x2b24('0xe')]=qs[_0x2b24('0xe')](_0x19d816['query'][_0x2b24('0xe')]);}_0x18d504['order']=qs[_0x2b24('0x3f')](_0x19d816['query'][_0x2b24('0x3f')]);_0x18d504[_0x2b24('0x40')]=qs[_0x2b24('0x27')](_[_0x2b24('0x41')](_0x19d816['query'],_0x30b123['filters']));_0x18d504[_0x2b24('0x40')][_0x2b24('0x42')]=_0xb2ebe5['id'];if(_0x19d816[_0x2b24('0x26')][_0x2b24('0x43')]){_0x18d504[_0x2b24('0x40')]=_[_0x2b24('0x44')](_0x18d504[_0x2b24('0x40')],{'$or':_[_0x2b24('0x1a')](_0x18d504[_0x2b24('0x29')],function(_0x22b0af){var _0x38b199={};_0x38b199[_0x22b0af]={'$like':'%'+_0x19d816['query'][_0x2b24('0x43')]+'%'};return _0x38b199;})});}_0x18d504=_[_0x2b24('0x44')]({},_0x18d504,_0x19d816[_0x2b24('0x2d')]);return db[_0x2b24('0x3a')]['findAll'](_0x18d504);}})['then'](function(_0x37410c){if(_0x37410c){return db[_0x2b24('0x45')][_0x2b24('0x46')]({'where':{'id':_['map'](_0x37410c,_0x2b24('0x47')),'role':_0x2b24('0x48')},'attributes':['id',_0x2b24('0x17'),_0x2b24('0x49'),_0x2b24('0x4a'),_0x2b24('0x4b')]});}})[_0x2b24('0x12')](function(_0x212fa6){if(_0x212fa6){return{'count':_0x212fa6['count'],'rows':_['map'](_0x212fa6[_0x2b24('0x20')],function(_0x2b418f){return{'membername':_0x2b418f['name'],'UserId':_0x2b418f['id'],'queue_name':_0x3c7a9d['name'],'FaxQueueId':_0x3c7a9d['id'],'interface':util[_0x2b24('0x4c')]('%s/%s','SIP',_0x2b418f[_0x2b24('0x17')]),'penalty':0x0,'paused':_0x2b418f[_0x2b24('0x49')],'createdAt':_0x2b418f['createdAt'],'updatedAt':_0x2b418f[_0x2b24('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2b24('0x12')](respondWithFilteredResult(_0x12dafe,_0x18d504))[_0x2b24('0x21')](handleError(_0x12dafe,null));};exports[_0x2b24('0x4d')]=function(_0x455def,_0x21d137){var _0x429ef3={};var _0x174157={};var _0x3054de;var _0x54782e;return db['FaxQueue'][_0x2b24('0x39')]({'where':{'id':_0x455def[_0x2b24('0x23')]['id']}})['then'](handleEntityNotFound(_0x21d137,null))[_0x2b24('0x12')](function(_0x112546){if(_0x112546){_0x3054de=_0x112546;_0x174157[_0x2b24('0x28')]=_[_0x2b24('0x24')](db[_0x2b24('0x4e')][_0x2b24('0x25')]);_0x174157[_0x2b24('0x26')]=_['keys'](_0x455def[_0x2b24('0x26')]);_0x174157[_0x2b24('0x27')]=_[_0x2b24('0x3b')](_0x174157[_0x2b24('0x28')],_0x174157[_0x2b24('0x26')]);_0x429ef3[_0x2b24('0x29')]=_[_0x2b24('0x3b')](_0x174157['model'],qs[_0x2b24('0x2a')](_0x455def[_0x2b24('0x26')][_0x2b24('0x2a')]));_0x429ef3['attributes']=_0x429ef3[_0x2b24('0x29')]['length']?_0x429ef3[_0x2b24('0x29')]:_0x174157['model'];_0x429ef3[_0x2b24('0x4f')]=qs['sort'](_0x455def[_0x2b24('0x26')][_0x2b24('0x3f')]);_0x429ef3[_0x2b24('0x40')]=qs[_0x2b24('0x27')](_[_0x2b24('0x41')](_0x455def[_0x2b24('0x26')],_0x174157[_0x2b24('0x27')]));if(_0x455def[_0x2b24('0x26')][_0x2b24('0x43')]){_0x429ef3[_0x2b24('0x40')]=_['merge'](_0x429ef3[_0x2b24('0x40')],{'$or':_[_0x2b24('0x1a')](_0x429ef3[_0x2b24('0x29')],function(_0x19da15){var _0x3f08d7={};_0x3f08d7[_0x19da15]={'$like':'%'+_0x455def[_0x2b24('0x26')][_0x2b24('0x43')]+'%'};return _0x3f08d7;})});}_0x429ef3=_['merge']({},_0x429ef3,_0x455def['options']);return _0x3054de[_0x2b24('0x4d')](_0x429ef3);}})['then'](function(_0x402403){if(_0x402403){_0x54782e=_0x402403[_0x2b24('0x2b')];if(!_0x455def[_0x2b24('0x26')][_0x2b24('0x3c')](_0x2b24('0x3d'))){_0x429ef3[_0x2b24('0x3e')]=qs['limit'](_0x455def['query'][_0x2b24('0x3e')]);_0x429ef3[_0x2b24('0xe')]=qs[_0x2b24('0xe')](_0x455def[_0x2b24('0x26')][_0x2b24('0xe')]);}return _0x3054de[_0x2b24('0x4d')](_0x429ef3);}})[_0x2b24('0x12')](function(_0x22b054){if(_0x22b054){return _0x22b054?{'count':_0x54782e,'rows':_0x22b054}:null;}})[_0x2b24('0x12')](respondWithResult(_0x21d137,null))[_0x2b24('0x21')](handleError(_0x21d137,null));};exports[_0x2b24('0x50')]=function(_0x277098,_0x5d70db){var _0x39be27=_0x277098[_0x2b24('0x37')][_0x2b24('0x51')];return db[_0x2b24('0x4e')][_0x2b24('0x1f')]({'where':{'id':_0x39be27},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2b24('0x52'),'attributes':['id',_0x2b24('0x17'),_0x2b24('0x53'),_0x2b24('0x54'),_0x2b24('0x55')],'raw':!![]}]})[_0x2b24('0x12')](function(_0xae7950){if(_0xae7950){var _0x19d422=_[_0x2b24('0x56')](_0xae7950,function(_0x229dd0){var _0x39b340=_0x229dd0[_0x2b24('0x31')]({'plain':!![]});return _0x39b340[_0x2b24('0x52')];});return db[_0x2b24('0x1b')]['find']({'where':{'id':_0x277098[_0x2b24('0x23')]['id']}})[_0x2b24('0x12')](function(_0x578eeb){return db[_0x2b24('0x57')]['transaction'](function(_0x419f02){return _0x578eeb[_0x2b24('0x50')](_0x39be27,{'transaction':_0x419f02})[_0x2b24('0x12')](function(){return BPromise['each'](_0x19d422,function(_0x2c3460){return db[_0x2b24('0x3a')][_0x2b24('0x58')]({'where':{'UserId':_0x2c3460['id'],'FaxQueueId':_0x277098[_0x2b24('0x23')]['id']},'transaction':_0x419f02});});})[_0x2b24('0x12')](function(){_0x19d422[_0x2b24('0x59')](function(_0x2829d5){socket[_0x2b24('0x5a')]('userFaxQueue:save',{'UserId':_0x2829d5['id'],'FaxQueueId':_0x578eeb['id']});});});});});}})[_0x2b24('0x12')](respondWithStatusCode(_0x5d70db,null))['catch'](handleError(_0x5d70db,null));};exports['removeTeams']=function(_0x51eeae,_0x24cfca){return db['Team']['findAll']({'where':{'id':_0x51eeae[_0x2b24('0x26')][_0x2b24('0x51')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2b24('0x52'),'attributes':['id'],'raw':!![]}]})[_0x2b24('0x12')](handleEntityNotFound(_0x24cfca,null))['then'](function(_0x3d2dc6){var _0x2bb50d=_['map'](_0x3d2dc6,'id');var _0x367b47=[];var _0x3db907=[];var _0x3e4537=squel['select']();_0x3e4537[_0x2b24('0x5b')](_0x2b24('0x5c'))[_0x2b24('0x5d')](_0x2b24('0x5e'),'tq')['join']('user_has_teams','ut',_0x2b24('0x5f'))[_0x2b24('0x40')](_0x2b24('0x60'),_0x51eeae[_0x2b24('0x23')]['id']);for(var _0x565c3e=0x0;_0x565c3e<_0x3d2dc6[_0x2b24('0x2b')];_0x565c3e+=0x1){let _0x2309f5=_0x3d2dc6[_0x565c3e];for(var _0x2e9157=0x0;_0x2e9157<_0x2309f5[_0x2b24('0x52')]['length'];_0x2e9157+=0x1){let _0x220fe3=_0x2309f5[_0x2b24('0x52')][_0x2e9157];var _0x276a90=_0x3e4537[_0x2b24('0x61')]();_0x276a90[_0x2b24('0x40')](_0x2b24('0x62'),_0x220fe3['id']);_0x3db907[_0x2b24('0x63')](db[_0x2b24('0x57')][_0x2b24('0x26')](_0x276a90[_0x2b24('0x64')](),{'type':db[_0x2b24('0x57')][_0x2b24('0x65')][_0x2b24('0x66')]})['then'](function(_0x18e73f){if(_0x18e73f[_0x2b24('0x2b')]===0x1){return _0x220fe3['id'];}else{var _0x3d413b=_[_0x2b24('0x67')](_['map'](_0x18e73f,_0x2b24('0x68')),function(_0x14e9de){return _[_0x2b24('0x69')](_0x2bb50d,_0x14e9de);});if(_0x3d413b){return _0x220fe3['id'];}}}));}}return BPromise['all'](_0x3db907)['then'](function(_0x1483aa){_0x367b47=_(_0x367b47)[_0x2b24('0x6a')](_0x1483aa)['compact']()[_0x2b24('0x6b')]();return db[_0x2b24('0x1b')]['find']({'where':{'id':_0x51eeae[_0x2b24('0x23')]['id']}})['then'](function(_0x71cbc7){return db[_0x2b24('0x57')][_0x2b24('0x6c')](function(_0x43d2e8){return _0x71cbc7[_0x2b24('0x6d')](_0x51eeae['query'][_0x2b24('0x51')],{'transaction':_0x43d2e8})[_0x2b24('0x12')](function(){if(!_[_0x2b24('0x6e')](_0x367b47)){return _0x71cbc7[_0x2b24('0x6f')](_0x367b47,{'transaction':_0x43d2e8});}})[_0x2b24('0x12')](function(){_0x367b47['forEach'](function(_0xe832c7){socket[_0x2b24('0x5a')](_0x2b24('0x70'),{'UserId':_0xe832c7,'FaxQueueId':_0x71cbc7['id']});});});});});});})[_0x2b24('0x12')](respondWithStatusCode(_0x24cfca,null))[_0x2b24('0x21')](handleError(_0x24cfca,null));};exports[_0x2b24('0x71')]=function(_0x5852af,_0x52aa02){return db[_0x2b24('0x1b')]['find']({'where':{'id':_0x5852af[_0x2b24('0x23')]['id']}})['then'](handleEntityNotFound(_0x52aa02,null))[_0x2b24('0x12')](function(_0x182094){if(_0x182094){return _0x182094[_0x2b24('0x71')](_0x5852af[_0x2b24('0x37')][_0x2b24('0x51')],_['omit'](_0x5852af[_0x2b24('0x37')],['ids','id'])||{})[_0x2b24('0x72')](function(_0x2d6294){for(var _0x8ef4d4=0x0;_0x8ef4d4<_0x5852af['body'][_0x2b24('0x51')][_0x2b24('0x2b')];_0x8ef4d4+=0x1){socket[_0x2b24('0x5a')]('userFaxQueue:save',{'UserId':Number(_0x5852af[_0x2b24('0x37')][_0x2b24('0x51')][_0x8ef4d4]),'FaxQueueId':Number(_0x5852af[_0x2b24('0x23')]['id'])});}return _0x2d6294;});}})[_0x2b24('0x12')](respondWithResult(_0x52aa02,null))[_0x2b24('0x21')](handleError(_0x52aa02,null));};exports['removeAgents']=function(_0x2104b5,_0x30bfd7){return db[_0x2b24('0x1b')][_0x2b24('0x2e')]({'where':{'id':_0x2104b5[_0x2b24('0x23')]['id']}})[_0x2b24('0x12')](handleEntityNotFound(_0x30bfd7,null))['then'](function(_0x49610e){if(_0x49610e){return _0x49610e['removeAgents'](_0x2104b5[_0x2b24('0x26')]['ids'])[_0x2b24('0x12')](function(){if(_['isArray'](_0x2104b5[_0x2b24('0x26')][_0x2b24('0x51')])){for(var _0x17404b=0x0;_0x17404b<_0x2104b5['query'][_0x2b24('0x51')][_0x2b24('0x2b')];_0x17404b+=0x1){socket[_0x2b24('0x5a')](_0x2b24('0x70'),{'UserId':Number(_0x2104b5[_0x2b24('0x26')][_0x2b24('0x51')][_0x17404b]),'FaxQueueId':Number(_0x2104b5['params']['id'])});}}else{socket[_0x2b24('0x5a')](_0x2b24('0x70'),{'UserId':Number(_0x2104b5[_0x2b24('0x26')][_0x2b24('0x51')]),'FaxQueueId':Number(_0x2104b5[_0x2b24('0x23')]['id'])});}});}})[_0x2b24('0x12')](respondWithStatusCode(_0x30bfd7,null))[_0x2b24('0x21')](handleError(_0x30bfd7,null));};exports[_0x2b24('0x73')]=function(_0x5707bd,_0x2a34da){var _0x118288={};var _0x491f2e={};var _0x2f70d7;var _0x266990;return db['FaxQueue']['findOne']({'where':{'id':_0x5707bd[_0x2b24('0x23')]['id']}})['then'](handleEntityNotFound(_0x2a34da,null))[_0x2b24('0x12')](function(_0x8cbaba){if(_0x8cbaba){_0x2f70d7=_0x8cbaba;_0x491f2e[_0x2b24('0x28')]=_[_0x2b24('0x24')](db[_0x2b24('0x45')][_0x2b24('0x25')]);_0x491f2e[_0x2b24('0x26')]=_[_0x2b24('0x24')](_0x5707bd[_0x2b24('0x26')]);_0x491f2e[_0x2b24('0x27')]=_[_0x2b24('0x3b')](_0x491f2e['model'],_0x491f2e[_0x2b24('0x26')]);_0x118288[_0x2b24('0x29')]=_['intersection'](_0x491f2e[_0x2b24('0x28')],qs[_0x2b24('0x2a')](_0x5707bd[_0x2b24('0x26')][_0x2b24('0x2a')]));_0x118288[_0x2b24('0x29')]=_0x118288[_0x2b24('0x29')]['length']?_0x118288[_0x2b24('0x29')]:_0x491f2e[_0x2b24('0x28')];_0x118288[_0x2b24('0x4f')]=qs[_0x2b24('0x3f')](_0x5707bd[_0x2b24('0x26')][_0x2b24('0x3f')]);_0x118288[_0x2b24('0x40')]=qs['filters'](_[_0x2b24('0x41')](_0x5707bd[_0x2b24('0x26')],_0x491f2e[_0x2b24('0x27')]));if(_0x5707bd['query'][_0x2b24('0x43')]){_0x118288[_0x2b24('0x40')]=_['merge'](_0x118288[_0x2b24('0x40')],{'$or':_['map'](_0x118288[_0x2b24('0x29')],function(_0x708c97){var _0x1feedb={};_0x1feedb[_0x708c97]={'$like':'%'+_0x5707bd[_0x2b24('0x26')][_0x2b24('0x43')]+'%'};return _0x1feedb;})});}_0x118288=_[_0x2b24('0x44')]({},_0x118288,_0x5707bd[_0x2b24('0x2d')]);return _0x2f70d7[_0x2b24('0x73')](_0x118288);}})[_0x2b24('0x12')](function(_0x242371){if(_0x242371){_0x266990=_0x242371[_0x2b24('0x2b')];if(!_0x5707bd['query'][_0x2b24('0x3c')](_0x2b24('0x3d'))){_0x118288[_0x2b24('0x3e')]=qs[_0x2b24('0x3e')](_0x5707bd[_0x2b24('0x26')][_0x2b24('0x3e')]);_0x118288[_0x2b24('0xe')]=qs[_0x2b24('0xe')](_0x5707bd[_0x2b24('0x26')][_0x2b24('0xe')]);}return _0x2f70d7[_0x2b24('0x73')](_0x118288);}})[_0x2b24('0x12')](function(_0x35d1ba){if(_0x35d1ba){return _0x35d1ba?{'count':_0x266990,'rows':_0x35d1ba}:null;}})[_0x2b24('0x12')](respondWithResult(_0x2a34da,null))[_0x2b24('0x21')](handleError(_0x2a34da,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index f348ae5..2ea9f22 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 _0x2281=['FaxQueue','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x2281,0x85));var _0x1228=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2281[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x1228('0x0'));var FaxQueue=require(_0x1228('0x1'))['db'][_0x1228('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1228('0x3'),'afterUpdate':'update','afterDestroy':_0x1228('0x4')};function emitEvent(_0x1a2fb6){return function(_0x92ecd7,_0x4a19b3,_0x2a610e){FaxQueueEvents['emit'](_0x1a2fb6+':'+_0x92ecd7['id'],_0x92ecd7);FaxQueueEvents[_0x1228('0x5')](_0x1a2fb6,_0x92ecd7);_0x2a610e(null);};}for(var e in events){if(events[_0x1228('0x6')](e)){var event=events[e];FaxQueue[_0x1228('0x7')](e,emitEvent(event));}}module[_0x1228('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x9352=['setMaxListeners','remove','emit','events','FaxQueue'];(function(_0x4d5dfc,_0xd5042b){var _0x2c29f0=function(_0x2ae258){while(--_0x2ae258){_0x4d5dfc['push'](_0x4d5dfc['shift']());}};_0x2c29f0(++_0xd5042b);}(_0x9352,0x148));var _0x2935=function(_0x40ee3a,_0xe56a66){_0x40ee3a=_0x40ee3a-0x0;var _0x38b782=_0x9352[_0x40ee3a];return _0x38b782;};'use strict';var EventEmitter=require(_0x2935('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x2935('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x2935('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2935('0x3')};function emitEvent(_0x55258a){return function(_0x40d06f,_0x375bce,_0x41d476){FaxQueueEvents[_0x2935('0x4')](_0x55258a+':'+_0x40d06f['id'],_0x40d06f);FaxQueueEvents[_0x2935('0x4')](_0x55258a,_0x40d06f);_0x41d476(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 7aaa434..91300f2 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 _0x03fb=['../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0x03fb,0x7b));var _0xb03f=function(_0x5c118f,_0x31b475){_0x5c118f=_0x5c118f-0x0;var _0x1406f8=_0x03fb[_0x5c118f];return _0x1406f8;};'use strict';var _=require(_0xb03f('0x0'));var util=require(_0xb03f('0x1'));var logger=require(_0xb03f('0x2'))(_0xb03f('0x3'));var moment=require(_0xb03f('0x4'));var BPromise=require(_0xb03f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb03f('0x6'));var rimraf=require('rimraf');var config=require(_0xb03f('0x7'));var attributes=require(_0xb03f('0x8'));module[_0xb03f('0x9')]=function(_0x4342c4,_0x52ea94){return _0x4342c4[_0xb03f('0xa')](_0xb03f('0xb'),attributes,{'tableName':_0xb03f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cc5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','FaxQueue','fax_queues'];(function(_0x11c331,_0x523ccf){var _0x1b89e1=function(_0x33d7b6){while(--_0x33d7b6){_0x11c331['push'](_0x11c331['shift']());}};_0x1b89e1(++_0x523ccf);}(_0x5cc5,0xb6));var _0x55cc=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0x5cc5[_0x3e3bee];return _0x3ae14c;};'use strict';var _=require('lodash');var util=require(_0x55cc('0x0'));var logger=require(_0x55cc('0x1'))(_0x55cc('0x2'));var moment=require(_0x55cc('0x3'));var BPromise=require(_0x55cc('0x4'));var rp=require(_0x55cc('0x5'));var fs=require('fs');var path=require(_0x55cc('0x6'));var rimraf=require(_0x55cc('0x7'));var config=require(_0x55cc('0x8'));var attributes=require(_0x55cc('0x9'));module[_0x55cc('0xa')]=function(_0x57668a,_0x554f05){return _0x57668a['define'](_0x55cc('0xb'),attributes,{'tableName':_0x55cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index ee30fc1..ac3c7e8 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 _0xb699=['redis','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','include','map','model','info','ShowFaxQueue','lodash','util','moment','bluebird','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0xb699,0x15c));var _0x9b69=function(_0x458ac3,_0x1c09b4){_0x458ac3=_0x458ac3-0x0;var _0x5e337f=_0xb699[_0x458ac3];return _0x5e337f;};'use strict';var _=require(_0x9b69('0x0'));var util=require(_0x9b69('0x1'));var moment=require(_0x9b69('0x2'));var BPromise=require(_0x9b69('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9b69('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9b69('0x5'));var jayson=require(_0x9b69('0x6'));var client=jayson[_0x9b69('0x7')][_0x9b69('0x8')]({'port':0x232a});config['redis']=_[_0x9b69('0x9')](config['redis'],{'host':_0x9b69('0xa'),'port':0x18eb});var socket=require(_0x9b69('0xb'))(new Redis(config[_0x9b69('0xc')]));require(_0x9b69('0xd'))[_0x9b69('0xe')](socket);function respondWithRpcPromise(_0x5840e3,_0x63adeb,_0x2e927d){return new BPromise(function(_0x1164d8,_0x27fb04){return client[_0x9b69('0xf')](_0x5840e3,_0x2e927d)[_0x9b69('0x10')](function(_0x236e5c){logger['info'](_0x9b69('0x11'),_0x63adeb,_0x9b69('0x12'));logger[_0x9b69('0x13')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x63adeb,'request\x20sent',JSON[_0x9b69('0x14')](_0x236e5c));if(_0x236e5c[_0x9b69('0x15')]){if(_0x236e5c[_0x9b69('0x15')][_0x9b69('0x16')]===0x1f4){logger[_0x9b69('0x15')](_0x9b69('0x11'),_0x63adeb,_0x236e5c['error']['message']);return _0x27fb04(_0x236e5c['error'][_0x9b69('0x17')]);}logger[_0x9b69('0x15')](_0x9b69('0x11'),_0x63adeb,_0x236e5c[_0x9b69('0x15')]['message']);return _0x1164d8(_0x236e5c[_0x9b69('0x15')]['message']);}else{logger['info'](_0x9b69('0x11'),_0x63adeb,'request\x20sent');_0x1164d8(_0x236e5c['result']['message']);}})[_0x9b69('0x18')](function(_0xc7b5b4){logger[_0x9b69('0x15')](_0x9b69('0x11'),_0x63adeb,_0xc7b5b4);_0x27fb04(_0xc7b5b4);});});}exports[_0x9b69('0x19')]=function(_0x33894d){var _0x44f29a=this;return new Promise(function(_0x12a2d5,_0x19cc0d){return db[_0x9b69('0x1a')]['findAll']({'raw':_0x33894d[_0x9b69('0x1b')]?_0x33894d[_0x9b69('0x1b')][_0x9b69('0x1c')]===undefined?!![]:![]:!![],'where':_0x33894d[_0x9b69('0x1b')]?_0x33894d[_0x9b69('0x1b')][_0x9b69('0x1d')]||null:null,'attributes':_0x33894d[_0x9b69('0x1b')]?_0x33894d['options'][_0x9b69('0x1e')]||null:null,'limit':_0x33894d[_0x9b69('0x1b')]?_0x33894d['options']['limit']||null:null,'include':_0x33894d[_0x9b69('0x1b')]?_0x33894d[_0x9b69('0x1b')][_0x9b69('0x1f')]?_[_0x9b69('0x20')](_0x33894d['options'][_0x9b69('0x1f')],function(_0x2253d0){return{'model':db[_0x2253d0[_0x9b69('0x21')]],'as':_0x2253d0['as'],'attributes':_0x2253d0[_0x9b69('0x1e')],'include':_0x2253d0[_0x9b69('0x1f')]?_[_0x9b69('0x20')](_0x2253d0[_0x9b69('0x1f')],function(_0x38cb80){return{'model':db[_0x38cb80[_0x9b69('0x21')]],'as':_0x38cb80['as'],'attributes':_0x38cb80[_0x9b69('0x1e')],'include':_0x38cb80[_0x9b69('0x1f')]?_['map'](_0x38cb80['include'],function(_0x3e7d86){return{'model':db[_0x3e7d86[_0x9b69('0x21')]],'as':_0x3e7d86['as'],'attributes':_0x3e7d86['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a81cf){logger[_0x9b69('0x22')]('GetFaxQueue',_0x33894d);logger[_0x9b69('0x13')]('GetFaxQueue',_0x33894d,JSON['stringify'](_0x1a81cf));_0x12a2d5(_0x1a81cf);})[_0x9b69('0x18')](function(_0x4ee5b6){logger[_0x9b69('0x15')](_0x9b69('0x19'),_0x4ee5b6[_0x9b69('0x17')],_0x33894d);_0x19cc0d(_0x44f29a[_0x9b69('0x15')](0x1f4,_0x4ee5b6[_0x9b69('0x17')]));});});};exports[_0x9b69('0x23')]=function(_0x4acda1){var _0x92e7e1=this;return new Promise(function(_0x22d141,_0x339418){return db[_0x9b69('0x1a')]['find']({'raw':_0x4acda1['options']?_0x4acda1[_0x9b69('0x1b')][_0x9b69('0x1c')]===undefined?!![]:![]:!![],'where':_0x4acda1[_0x9b69('0x1b')]?_0x4acda1[_0x9b69('0x1b')][_0x9b69('0x1d')]||null:null,'attributes':_0x4acda1['options']?_0x4acda1['options']['attributes']||null:null,'include':_0x4acda1['options']?_0x4acda1[_0x9b69('0x1b')][_0x9b69('0x1f')]?_[_0x9b69('0x20')](_0x4acda1['options']['include'],function(_0x4340be){return{'model':db[_0x4340be[_0x9b69('0x21')]],'as':_0x4340be['as'],'attributes':_0x4340be[_0x9b69('0x1e')],'include':_0x4340be['include']?_[_0x9b69('0x20')](_0x4340be['include'],function(_0x2dbc3f){return{'model':db[_0x2dbc3f[_0x9b69('0x21')]],'as':_0x2dbc3f['as'],'attributes':_0x2dbc3f[_0x9b69('0x1e')],'include':_0x2dbc3f[_0x9b69('0x1f')]?_[_0x9b69('0x20')](_0x2dbc3f[_0x9b69('0x1f')],function(_0x3da574){return{'model':db[_0x3da574['model']],'as':_0x3da574['as'],'attributes':_0x3da574[_0x9b69('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9b69('0x10')](function(_0x526fad){logger[_0x9b69('0x22')](_0x9b69('0x23'),_0x4acda1);logger[_0x9b69('0x13')]('ShowFaxQueue',_0x4acda1,JSON[_0x9b69('0x14')](_0x526fad));_0x22d141(_0x526fad);})['catch'](function(_0x12ac2b){logger[_0x9b69('0x15')](_0x9b69('0x23'),_0x12ac2b['message'],_0x4acda1);_0x339418(_0x92e7e1['error'](0x1f4,_0x12ac2b[_0x9b69('0x17')]));});});}; \ No newline at end of file +var _0xa568=['localhost','./faxQueue.socket','register','request','info','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','catch','GetFaxQueue','FaxQueue','findAll','options','attributes','limit','include','map','model','debug','ShowFaxQueue','find','raw','where','then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x513b34,_0x5e150e){var _0x48a6d4=function(_0x2b9ae2){while(--_0x2b9ae2){_0x513b34['push'](_0x513b34['shift']());}};_0x48a6d4(++_0x5e150e);}(_0xa568,0xc0));var _0x8a56=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa568[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x8a56('0x0'));var util=require(_0x8a56('0x1'));var moment=require('moment');var BPromise=require(_0x8a56('0x2'));var rs=require(_0x8a56('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a56('0x4'))['db'];var utils=require(_0x8a56('0x5'));var logger=require(_0x8a56('0x6'))('rpc');var config=require(_0x8a56('0x7'));var jayson=require(_0x8a56('0x8'));var client=jayson[_0x8a56('0x9')][_0x8a56('0xa')]({'port':0x232a});config[_0x8a56('0xb')]=_[_0x8a56('0xc')](config[_0x8a56('0xb')],{'host':_0x8a56('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8a56('0xe'))[_0x8a56('0xf')](socket);function respondWithRpcPromise(_0x10a00c,_0x4b85ce,_0xe5eb4b){return new BPromise(function(_0x4d2ed0,_0x469f52){return client[_0x8a56('0x10')](_0x10a00c,_0xe5eb4b)['then'](function(_0x3cd3a6){logger[_0x8a56('0x11')]('FaxQueue,\x20%s,\x20%s',_0x4b85ce,_0x8a56('0x12'));logger['debug'](_0x8a56('0x13'),_0x4b85ce,'request\x20sent',JSON[_0x8a56('0x14')](_0x3cd3a6));if(_0x3cd3a6['error']){if(_0x3cd3a6[_0x8a56('0x15')][_0x8a56('0x16')]===0x1f4){logger[_0x8a56('0x15')](_0x8a56('0x17'),_0x4b85ce,_0x3cd3a6[_0x8a56('0x15')][_0x8a56('0x18')]);return _0x469f52(_0x3cd3a6['error']['message']);}logger[_0x8a56('0x15')](_0x8a56('0x17'),_0x4b85ce,_0x3cd3a6[_0x8a56('0x15')][_0x8a56('0x18')]);return _0x4d2ed0(_0x3cd3a6[_0x8a56('0x15')][_0x8a56('0x18')]);}else{logger[_0x8a56('0x11')]('FaxQueue,\x20%s,\x20%s',_0x4b85ce,_0x8a56('0x12'));_0x4d2ed0(_0x3cd3a6['result']['message']);}})[_0x8a56('0x19')](function(_0x25d449){logger[_0x8a56('0x15')](_0x8a56('0x17'),_0x4b85ce,_0x25d449);_0x469f52(_0x25d449);});});}exports[_0x8a56('0x1a')]=function(_0x49a7d3){var _0x13b5d8=this;return new Promise(function(_0x20c66f,_0x4a4c8f){return db[_0x8a56('0x1b')][_0x8a56('0x1c')]({'raw':_0x49a7d3[_0x8a56('0x1d')]?_0x49a7d3[_0x8a56('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x49a7d3['options']?_0x49a7d3[_0x8a56('0x1d')]['where']||null:null,'attributes':_0x49a7d3[_0x8a56('0x1d')]?_0x49a7d3['options'][_0x8a56('0x1e')]||null:null,'limit':_0x49a7d3[_0x8a56('0x1d')]?_0x49a7d3['options'][_0x8a56('0x1f')]||null:null,'include':_0x49a7d3[_0x8a56('0x1d')]?_0x49a7d3[_0x8a56('0x1d')][_0x8a56('0x20')]?_[_0x8a56('0x21')](_0x49a7d3[_0x8a56('0x1d')][_0x8a56('0x20')],function(_0x1943f7){return{'model':db[_0x1943f7['model']],'as':_0x1943f7['as'],'attributes':_0x1943f7[_0x8a56('0x1e')],'include':_0x1943f7[_0x8a56('0x20')]?_[_0x8a56('0x21')](_0x1943f7[_0x8a56('0x20')],function(_0x3630bf){return{'model':db[_0x3630bf[_0x8a56('0x22')]],'as':_0x3630bf['as'],'attributes':_0x3630bf[_0x8a56('0x1e')],'include':_0x3630bf[_0x8a56('0x20')]?_['map'](_0x3630bf[_0x8a56('0x20')],function(_0x16f040){return{'model':db[_0x16f040[_0x8a56('0x22')]],'as':_0x16f040['as'],'attributes':_0x16f040[_0x8a56('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e10e6){logger['info'](_0x8a56('0x1a'),_0x49a7d3);logger[_0x8a56('0x23')](_0x8a56('0x1a'),_0x49a7d3,JSON['stringify'](_0x3e10e6));_0x20c66f(_0x3e10e6);})[_0x8a56('0x19')](function(_0x1e7c28){logger[_0x8a56('0x15')](_0x8a56('0x1a'),_0x1e7c28[_0x8a56('0x18')],_0x49a7d3);_0x4a4c8f(_0x13b5d8[_0x8a56('0x15')](0x1f4,_0x1e7c28[_0x8a56('0x18')]));});});};exports[_0x8a56('0x24')]=function(_0x2b88cd){var _0x2b852e=this;return new Promise(function(_0x5c1d9f,_0xefc806){return db[_0x8a56('0x1b')][_0x8a56('0x25')]({'raw':_0x2b88cd[_0x8a56('0x1d')]?_0x2b88cd[_0x8a56('0x1d')][_0x8a56('0x26')]===undefined?!![]:![]:!![],'where':_0x2b88cd[_0x8a56('0x1d')]?_0x2b88cd[_0x8a56('0x1d')][_0x8a56('0x27')]||null:null,'attributes':_0x2b88cd[_0x8a56('0x1d')]?_0x2b88cd[_0x8a56('0x1d')][_0x8a56('0x1e')]||null:null,'include':_0x2b88cd['options']?_0x2b88cd[_0x8a56('0x1d')]['include']?_['map'](_0x2b88cd['options'][_0x8a56('0x20')],function(_0x2a08bc){return{'model':db[_0x2a08bc[_0x8a56('0x22')]],'as':_0x2a08bc['as'],'attributes':_0x2a08bc[_0x8a56('0x1e')],'include':_0x2a08bc[_0x8a56('0x20')]?_['map'](_0x2a08bc['include'],function(_0x341f59){return{'model':db[_0x341f59[_0x8a56('0x22')]],'as':_0x341f59['as'],'attributes':_0x341f59[_0x8a56('0x1e')],'include':_0x341f59[_0x8a56('0x20')]?_[_0x8a56('0x21')](_0x341f59[_0x8a56('0x20')],function(_0xfd48a){return{'model':db[_0xfd48a[_0x8a56('0x22')]],'as':_0xfd48a['as'],'attributes':_0xfd48a[_0x8a56('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8a56('0x28')](function(_0x3b230e){logger['info'](_0x8a56('0x24'),_0x2b88cd);logger['debug'](_0x8a56('0x24'),_0x2b88cd,JSON[_0x8a56('0x14')](_0x3b230e));_0x5c1d9f(_0x3b230e);})['catch'](function(_0x51ebbc){logger[_0x8a56('0x15')](_0x8a56('0x24'),_0x51ebbc[_0x8a56('0x18')],_0x2b88cd);_0xefc806(_0x2b852e[_0x8a56('0x15')](0x1f4,_0x51ebbc[_0x8a56('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index d7b31cb..cbcb10c 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 _0xb2ed=['save','remove','update','removeListener','register','length','faxQueue:','./faxQueue.events'];(function(_0xce6716,_0x3555ad){var _0x38be3a=function(_0xcbed8a){while(--_0xcbed8a){_0xce6716['push'](_0xce6716['shift']());}};_0x38be3a(++_0x3555ad);}(_0xb2ed,0x127));var _0xdb2e=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0xb2ed[_0x1bbc08];return _0x5d825b;};'use strict';var FaxQueueEvents=require(_0xdb2e('0x0'));var events=[_0xdb2e('0x1'),_0xdb2e('0x2'),_0xdb2e('0x3')];function createListener(_0x4bb9b6,_0x367ea6){return function(_0x1b8b66){_0x367ea6['emit'](_0x4bb9b6,_0x1b8b66);};}function removeListener(_0x325f03,_0x293e03){return function(){FaxQueueEvents[_0xdb2e('0x4')](_0x325f03,_0x293e03);};}exports[_0xdb2e('0x5')]=function(_0x2761f1){for(var _0x1dcc25=0x0,_0x4bbcb5=events[_0xdb2e('0x6')];_0x1dcc25<_0x4bbcb5;_0x1dcc25++){var _0x4f3a6a=events[_0x1dcc25];var _0x19147b=createListener(_0xdb2e('0x7')+_0x4f3a6a,_0x2761f1);FaxQueueEvents['on'](_0x4f3a6a,_0x19147b);}}; \ No newline at end of file +var _0xc164=['remove','update','emit','removeListener','register','faxQueue:','save'];(function(_0x579420,_0xe6de69){var _0x56c4b4=function(_0x2987f8){while(--_0x2987f8){_0x579420['push'](_0x579420['shift']());}};_0x56c4b4(++_0xe6de69);}(_0xc164,0x18e));var _0x4c16=function(_0x185aa6,_0x53c49e){_0x185aa6=_0x185aa6-0x0;var _0x2f786f=_0xc164[_0x185aa6];return _0x2f786f;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x4c16('0x0'),_0x4c16('0x1'),_0x4c16('0x2')];function createListener(_0x1cb967,_0x6e91f0){return function(_0x3edc2a){_0x6e91f0[_0x4c16('0x3')](_0x1cb967,_0x3edc2a);};}function removeListener(_0x3c12e5,_0x51f207){return function(){FaxQueueEvents[_0x4c16('0x4')](_0x3c12e5,_0x51f207);};}exports[_0x4c16('0x5')]=function(_0x37810f){for(var _0x45bcd5=0x0,_0x10525f=events['length'];_0x45bcd5<_0x10525f;_0x45bcd5++){var _0xa6488e=events[_0x45bcd5];var _0x236aa7=createListener(_0x4c16('0x6')+_0xa6488e,_0x37810f);FaxQueueEvents['on'](_0xa6488e,_0x236aa7);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index bc7972d..cf98e03 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 _0x96f2=['post','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create'];(function(_0x3173a5,_0x4d7458){var _0x2d4cf4=function(_0x138573){while(--_0x138573){_0x3173a5['push'](_0x3173a5['shift']());}};_0x2d4cf4(++_0x4d7458);}(_0x96f2,0xb0));var _0x296f=function(_0x4eb261,_0x7c7aca){_0x4eb261=_0x4eb261-0x0;var _0x5819aa=_0x96f2[_0x4eb261];return _0x5819aa;};'use strict';var multer=require(_0x296f('0x0'));var util=require('util');var path=require(_0x296f('0x1'));var timeout=require(_0x296f('0x2'));var express=require(_0x296f('0x3'));var router=express['Router']();var fs_extra=require(_0x296f('0x4'));var auth=require(_0x296f('0x5'));var interaction=require(_0x296f('0x6'));var config=require('../../config/environment');var controller=require(_0x296f('0x7'));router[_0x296f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x296f('0x8')](_0x296f('0x9'),auth[_0x296f('0xa')](),controller[_0x296f('0xb')]);router[_0x296f('0x8')](_0x296f('0xc'),auth[_0x296f('0xa')](),controller[_0x296f('0xd')]);router[_0x296f('0x8')](_0x296f('0xe'),auth['isAuthenticated'](),controller[_0x296f('0xf')]);router[_0x296f('0x8')](_0x296f('0x10'),auth['isAuthenticated'](),controller[_0x296f('0x11')]);router[_0x296f('0x8')](_0x296f('0x12'),auth[_0x296f('0xa')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x296f('0x13')]);router[_0x296f('0x14')](_0x296f('0x10'),auth[_0x296f('0xa')](),controller['addTeams']);router[_0x296f('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0x296f('0x15')]);router[_0x296f('0x16')](_0x296f('0xc'),auth[_0x296f('0xa')](),controller['update']);router['delete'](_0x296f('0xc'),auth['isAuthenticated'](),controller[_0x296f('0x17')]);router[_0x296f('0x18')](_0x296f('0x10'),auth['isAuthenticated'](),controller[_0x296f('0x19')]);router[_0x296f('0x18')]('/:id/users',auth[_0x296f('0xa')](),controller[_0x296f('0x1a')]);module[_0x296f('0x1b')]=router; \ No newline at end of file +var _0x1a37=['/describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0xc37e08,_0x274141){var _0x457aff=function(_0x301551){while(--_0x301551){_0xc37e08['push'](_0xc37e08['shift']());}};_0x457aff(++_0x274141);}(_0x1a37,0xb4));var _0x71a3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1a37[_0x2641f9];return _0x585741;};'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('./faxQueue.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['getTeams']);router['get']('/:id/users',auth[_0x71a3('0xd')](),controller[_0x71a3('0x12')]);router[_0x71a3('0x13')]('/',auth[_0x71a3('0xd')](),controller[_0x71a3('0x14')]);router[_0x71a3('0x13')](_0x71a3('0x11'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x15')]);router[_0x71a3('0x13')](_0x71a3('0x16'),auth['isAuthenticated'](),controller[_0x71a3('0x17')]);router[_0x71a3('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x71a3('0x19')]);router[_0x71a3('0x1a')](_0x71a3('0x1b'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x1c')]);router[_0x71a3('0x1a')]('/:id/teams',auth[_0x71a3('0xd')](),controller[_0x71a3('0x1d')]);router['delete']('/:id/users',auth[_0x71a3('0xd')](),controller[_0x71a3('0x1e')]);module[_0x71a3('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 66c6b9a..a2438f8 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 _0xf9d7=['sequelize','STRING','DATE','moment'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0xf9d7,0x12f));var _0x7f9d=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0xf9d7[_0x3f5dca];return _0x5b833a;};'use strict';var moment=require(_0x7f9d('0x0'));var Sequelize=require(_0x7f9d('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x7f9d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7f9d('0x2')]},'joinAt':{'type':Sequelize[_0x7f9d('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7f9d('0x3')]},'exitAt':{'type':Sequelize[_0x7f9d('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3a16=['moment','STRING','DATE'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3a16,0x192));var _0x63a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a16[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x63a1('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x63a1('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x63a1('0x1')]},'joinAt':{'type':Sequelize[_0x63a1('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x63a1('0x2')]},'exitAt':{'type':Sequelize[_0x63a1('0x2')]},'reason':{'type':Sequelize[_0x63a1('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 0be3ac6..247a158 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 _0x86dd=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','map','FaxQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','merge','options','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse'];(function(_0x2bb9fa,_0x33f63d){var _0x18a068=function(_0x1b89c3){while(--_0x1b89c3){_0x2bb9fa['push'](_0x2bb9fa['shift']());}};_0x18a068(++_0x33f63d);}(_0x86dd,0x1ee));var _0xd86d=function(_0x34df79,_0x593a50){_0x34df79=_0x34df79-0x0;var _0x4f302b=_0x86dd[_0x34df79];return _0x4f302b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd86d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd86d('0x1'));var rp=require(_0xd86d('0x2'));var moment=require(_0xd86d('0x3'));var BPromise=require(_0xd86d('0x4'));var Mustache=require(_0xd86d('0x5'));var util=require(_0xd86d('0x6'));var path=require(_0xd86d('0x7'));var sox=require(_0xd86d('0x8'));var csv=require(_0xd86d('0x9'));var ejs=require(_0xd86d('0xa'));var fs=require('fs');var fs_extra=require(_0xd86d('0xb'));var _=require(_0xd86d('0xc'));var squel=require('squel');var crypto=require(_0xd86d('0xd'));var jsforce=require(_0xd86d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd86d('0x9'));var querystring=require(_0xd86d('0xf'));var Papa=require(_0xd86d('0x10'));var Redis=require(_0xd86d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd86d('0x12'));var as=require(_0xd86d('0x13'));var hardwareService=require(_0xd86d('0x14'));var logger=require(_0xd86d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xd86d('0x16'));var licenseUtil=require(_0xd86d('0x17'));var db=require(_0xd86d('0x18'))['db'];function respondWithStatusCode(_0x77012b,_0x28a283){_0x28a283=_0x28a283||0xcc;return function(_0x4f911b){if(_0x4f911b){return _0x77012b['sendStatus'](_0x28a283);}return _0x77012b['status'](_0x28a283)[_0xd86d('0x19')]();};}function respondWithResult(_0x2b8ef4,_0x3863a8){_0x3863a8=_0x3863a8||0xc8;return function(_0x13f90e){if(_0x13f90e){return _0x2b8ef4[_0xd86d('0x1a')](_0x3863a8)[_0xd86d('0x1b')](_0x13f90e);}};}function respondWithFilteredResult(_0x3aa815,_0x570ed1){return function(_0x1d2b33){if(_0x1d2b33){var _0x2cc4d9=typeof _0x570ed1[_0xd86d('0x1c')]===_0xd86d('0x1d')&&typeof _0x570ed1[_0xd86d('0x1e')]===_0xd86d('0x1d');var _0x1b176e=_0x1d2b33[_0xd86d('0x1f')];var _0x3086a5=_0x2cc4d9?0x0:_0x570ed1[_0xd86d('0x1c')];var _0x5aabdb=_0x2cc4d9?_0x1d2b33['count']:_0x570ed1[_0xd86d('0x1c')]+_0x570ed1[_0xd86d('0x1e')];var _0xb74a5f;if(_0x5aabdb>=_0x1b176e){_0x5aabdb=_0x1b176e;_0xb74a5f=0xc8;}else{_0xb74a5f=0xce;}_0x3aa815['status'](_0xb74a5f);return _0x3aa815[_0xd86d('0x20')](_0xd86d('0x21'),_0x3086a5+'-'+_0x5aabdb+'/'+_0x1b176e)[_0xd86d('0x1b')](_0x1d2b33);}return null;};}function patchUpdates(_0x5a632c){return function(_0x2caf8b){try{jsonpatch[_0xd86d('0x22')](_0x2caf8b,_0x5a632c,!![]);}catch(_0x5a3b58){return BPromise[_0xd86d('0x23')](_0x5a3b58);}return _0x2caf8b[_0xd86d('0x24')]();};}function saveUpdates(_0x74f57e,_0x539c83){return function(_0x2faef6){if(_0x2faef6){return _0x2faef6[_0xd86d('0x25')](_0x74f57e)[_0xd86d('0x26')](function(_0xb71958){return _0xb71958;});}return null;};}function removeEntity(_0x49845b,_0x2c33f0){return function(_0x3a5799){if(_0x3a5799){return _0x3a5799['destroy']()['then'](function(){_0x49845b['status'](0xcc)[_0xd86d('0x19')]();});}};}function handleEntityNotFound(_0x5d0e0c,_0x158dcb){return function(_0x4b42ca){if(!_0x4b42ca){_0x5d0e0c['sendStatus'](0x194);}return _0x4b42ca;};}function handleError(_0x327a2e,_0x3e4e3f){_0x3e4e3f=_0x3e4e3f||0x1f4;return function(_0x48dd45){logger[_0xd86d('0x27')](_0x48dd45['stack']);if(_0x48dd45[_0xd86d('0x28')]){delete _0x48dd45['name'];}_0x327a2e['status'](_0x3e4e3f)['send'](_0x48dd45);};}exports['index']=function(_0x345bb7,_0x5daa94){var _0x2897b5={},_0x525a87={},_0x3236a4={'count':0x0,'rows':[]};var _0x2fc237=_[_0xd86d('0x29')](db[_0xd86d('0x2a')]['rawAttributes'],function(_0x2be14e){return{'name':_0x2be14e[_0xd86d('0x2b')],'type':_0x2be14e[_0xd86d('0x2c')][_0xd86d('0x2d')]};});_0x525a87[_0xd86d('0x2e')]=_[_0xd86d('0x29')](_0x2fc237,'name');_0x525a87[_0xd86d('0x2f')]=_[_0xd86d('0x30')](_0x345bb7[_0xd86d('0x2f')]);_0x525a87[_0xd86d('0x31')]=_['intersection'](_0x525a87['model'],_0x525a87[_0xd86d('0x2f')]);_0x2897b5['attributes']=_[_0xd86d('0x32')](_0x525a87[_0xd86d('0x2e')],qs[_0xd86d('0x33')](_0x345bb7[_0xd86d('0x2f')]['fields']));_0x2897b5[_0xd86d('0x34')]=_0x2897b5[_0xd86d('0x34')]['length']?_0x2897b5[_0xd86d('0x34')]:_0x525a87[_0xd86d('0x2e')];if(!_0x345bb7[_0xd86d('0x2f')]['hasOwnProperty'](_0xd86d('0x35'))){_0x2897b5['limit']=qs[_0xd86d('0x1e')](_0x345bb7[_0xd86d('0x2f')][_0xd86d('0x1e')]);_0x2897b5[_0xd86d('0x1c')]=qs[_0xd86d('0x1c')](_0x345bb7['query'][_0xd86d('0x1c')]);}_0x2897b5['order']=qs[_0xd86d('0x36')](_0x345bb7['query'][_0xd86d('0x36')]);_0x2897b5[_0xd86d('0x37')]=qs[_0xd86d('0x31')](_[_0xd86d('0x38')](_0x345bb7[_0xd86d('0x2f')],_0x525a87['filters']),_0x2fc237);if(_0x345bb7[_0xd86d('0x2f')]['filter']){_0x2897b5[_0xd86d('0x37')]=_['merge'](_0x2897b5[_0xd86d('0x37')],{'$or':_['map'](_0x2fc237,function(_0x95c82){if(_0x95c82['type']!=='VIRTUAL'){var _0x3f0c60={};_0x3f0c60[_0x95c82[_0xd86d('0x28')]]={'$like':'%'+_0x345bb7[_0xd86d('0x2f')][_0xd86d('0x39')]+'%'};return _0x3f0c60;}})});}_0x2897b5=_['merge']({},_0x2897b5,_0x345bb7['options']);var _0x35c2b6={'where':_0x2897b5[_0xd86d('0x37')]};return db[_0xd86d('0x2a')][_0xd86d('0x1f')](_0x35c2b6)['then'](function(_0x136d9f){_0x3236a4[_0xd86d('0x1f')]=_0x136d9f;if(_0x345bb7[_0xd86d('0x2f')][_0xd86d('0x3a')]){_0x2897b5[_0xd86d('0x3b')]=[{'all':!![]}];}return db[_0xd86d('0x2a')][_0xd86d('0x3c')](_0x2897b5);})[_0xd86d('0x26')](function(_0x5dc07c){_0x3236a4[_0xd86d('0x3d')]=_0x5dc07c;return _0x3236a4;})['then'](respondWithFilteredResult(_0x5daa94,_0x2897b5))[_0xd86d('0x3e')](handleError(_0x5daa94,null));};exports[_0xd86d('0x3f')]=function(_0x3f0bb7,_0x41b49f){var _0x4d2523={'raw':!![],'where':{'id':_0x3f0bb7[_0xd86d('0x40')]['id']}},_0x3fea7c={};_0x3fea7c[_0xd86d('0x2e')]=_[_0xd86d('0x30')](db[_0xd86d('0x2a')][_0xd86d('0x41')]);_0x3fea7c[_0xd86d('0x2f')]=_['keys'](_0x3f0bb7[_0xd86d('0x2f')]);_0x3fea7c[_0xd86d('0x31')]=_[_0xd86d('0x32')](_0x3fea7c[_0xd86d('0x2e')],_0x3fea7c[_0xd86d('0x2f')]);_0x4d2523[_0xd86d('0x34')]=_[_0xd86d('0x32')](_0x3fea7c['model'],qs[_0xd86d('0x33')](_0x3f0bb7[_0xd86d('0x2f')]['fields']));_0x4d2523['attributes']=_0x4d2523['attributes'][_0xd86d('0x42')]?_0x4d2523[_0xd86d('0x34')]:_0x3fea7c['model'];if(_0x3f0bb7[_0xd86d('0x2f')][_0xd86d('0x3a')]){_0x4d2523[_0xd86d('0x3b')]=[{'all':!![]}];}_0x4d2523=_[_0xd86d('0x43')]({},_0x4d2523,_0x3f0bb7[_0xd86d('0x44')]);return db[_0xd86d('0x2a')][_0xd86d('0x45')](_0x4d2523)['then'](handleEntityNotFound(_0x41b49f,null))['then'](respondWithResult(_0x41b49f,null))[_0xd86d('0x3e')](handleError(_0x41b49f,null));};exports[_0xd86d('0x46')]=function(_0x519509,_0x3bc9d3){return db[_0xd86d('0x2a')][_0xd86d('0x46')](_0x519509[_0xd86d('0x47')],{})['then'](respondWithResult(_0x3bc9d3,0xc9))[_0xd86d('0x3e')](handleError(_0x3bc9d3,null));};exports[_0xd86d('0x25')]=function(_0x184e0b,_0x551b49){if(_0x184e0b[_0xd86d('0x47')]['id']){delete _0x184e0b[_0xd86d('0x47')]['id'];}return db[_0xd86d('0x2a')]['find']({'where':{'id':_0x184e0b[_0xd86d('0x40')]['id']}})[_0xd86d('0x26')](handleEntityNotFound(_0x551b49,null))[_0xd86d('0x26')](saveUpdates(_0x184e0b['body'],null))[_0xd86d('0x26')](respondWithResult(_0x551b49,null))[_0xd86d('0x3e')](handleError(_0x551b49,null));};exports['destroy']=function(_0x36d17e,_0x387cdd){return db[_0xd86d('0x2a')][_0xd86d('0x45')]({'where':{'id':_0x36d17e[_0xd86d('0x40')]['id']}})['then'](handleEntityNotFound(_0x387cdd,null))['then'](removeEntity(_0x387cdd,null))[_0xd86d('0x3e')](handleError(_0x387cdd,null));};exports[_0xd86d('0x48')]=function(_0x1e6b4a,_0x3fce30){return db[_0xd86d('0x2a')][_0xd86d('0x48')]()[_0xd86d('0x26')](respondWithResult(_0x3fce30,null))['catch'](handleError(_0x3fce30,null));}; \ No newline at end of file +var _0x195e=['includeAll','include','findAll','catch','show','keys','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','FaxQueueReport','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options'];(function(_0x1d2064,_0x47aef1){var _0x269138=function(_0xe10ada){while(--_0xe10ada){_0x1d2064['push'](_0x1d2064['shift']());}};_0x269138(++_0x47aef1);}(_0x195e,0xfb));var _0xe195=function(_0x276403,_0x4c37ed){_0x276403=_0x276403-0x0;var _0x3958d9=_0x195e[_0x276403];return _0x3958d9;};'use strict';var emlformat=require(_0xe195('0x0'));var rimraf=require(_0xe195('0x1'));var zipdir=require(_0xe195('0x2'));var jsonpatch=require(_0xe195('0x3'));var rp=require(_0xe195('0x4'));var moment=require(_0xe195('0x5'));var BPromise=require(_0xe195('0x6'));var Mustache=require(_0xe195('0x7'));var util=require(_0xe195('0x8'));var path=require(_0xe195('0x9'));var sox=require(_0xe195('0xa'));var csv=require(_0xe195('0xb'));var ejs=require(_0xe195('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe195('0xd'));var squel=require(_0xe195('0xe'));var crypto=require(_0xe195('0xf'));var jsforce=require(_0xe195('0x10'));var deskjs=require(_0xe195('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe195('0x12'));var authService=require(_0xe195('0x13'));var qs=require(_0xe195('0x14'));var as=require(_0xe195('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe195('0x16'))(_0xe195('0x17'));var utils=require(_0xe195('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe195('0x19'));var db=require(_0xe195('0x1a'))['db'];function respondWithStatusCode(_0x5ae615,_0x3da7d9){_0x3da7d9=_0x3da7d9||0xcc;return function(_0x12fa0f){if(_0x12fa0f){return _0x5ae615[_0xe195('0x1b')](_0x3da7d9);}return _0x5ae615[_0xe195('0x1c')](_0x3da7d9)['end']();};}function respondWithResult(_0x52217d,_0x2e82d1){_0x2e82d1=_0x2e82d1||0xc8;return function(_0x555a6a){if(_0x555a6a){return _0x52217d['status'](_0x2e82d1)[_0xe195('0x1d')](_0x555a6a);}};}function respondWithFilteredResult(_0x5c444f,_0x232c57){return function(_0x542ac7){if(_0x542ac7){var _0x534879=typeof _0x232c57[_0xe195('0x1e')]===_0xe195('0x1f')&&typeof _0x232c57[_0xe195('0x20')]===_0xe195('0x1f');var _0x3a042f=_0x542ac7[_0xe195('0x21')];var _0x4784b1=_0x534879?0x0:_0x232c57[_0xe195('0x1e')];var _0x9c8ba5=_0x534879?_0x542ac7[_0xe195('0x21')]:_0x232c57['offset']+_0x232c57[_0xe195('0x20')];var _0x317d8b;if(_0x9c8ba5>=_0x3a042f){_0x9c8ba5=_0x3a042f;_0x317d8b=0xc8;}else{_0x317d8b=0xce;}_0x5c444f[_0xe195('0x1c')](_0x317d8b);return _0x5c444f[_0xe195('0x22')](_0xe195('0x23'),_0x4784b1+'-'+_0x9c8ba5+'/'+_0x3a042f)[_0xe195('0x1d')](_0x542ac7);}return null;};}function patchUpdates(_0x496722){return function(_0x1c5ac8){try{jsonpatch[_0xe195('0x24')](_0x1c5ac8,_0x496722,!![]);}catch(_0x334b4a){return BPromise[_0xe195('0x25')](_0x334b4a);}return _0x1c5ac8['save']();};}function saveUpdates(_0x4dab1a,_0x4e5f13){return function(_0x57ee33){if(_0x57ee33){return _0x57ee33[_0xe195('0x26')](_0x4dab1a)[_0xe195('0x27')](function(_0x2cb019){return _0x2cb019;});}return null;};}function removeEntity(_0x199148,_0x46b15b){return function(_0x40c6a2){if(_0x40c6a2){return _0x40c6a2[_0xe195('0x28')]()[_0xe195('0x27')](function(){_0x199148[_0xe195('0x1c')](0xcc)[_0xe195('0x29')]();});}};}function handleEntityNotFound(_0x55be2d,_0x36a566){return function(_0x58ea75){if(!_0x58ea75){_0x55be2d[_0xe195('0x1b')](0x194);}return _0x58ea75;};}function handleError(_0x334cb8,_0x147563){_0x147563=_0x147563||0x1f4;return function(_0x2a0504){logger[_0xe195('0x2a')](_0x2a0504[_0xe195('0x2b')]);if(_0x2a0504[_0xe195('0x2c')]){delete _0x2a0504[_0xe195('0x2c')];}_0x334cb8[_0xe195('0x1c')](_0x147563)[_0xe195('0x2d')](_0x2a0504);};}exports['index']=function(_0x33a08d,_0x3e228f){var _0x3199d0={},_0x1f72a2={},_0x283516={'count':0x0,'rows':[]};var _0x4e4d30=_['map'](db[_0xe195('0x2e')][_0xe195('0x2f')],function(_0x46b6f2){return{'name':_0x46b6f2[_0xe195('0x30')],'type':_0x46b6f2[_0xe195('0x31')][_0xe195('0x32')]};});_0x1f72a2['model']=_[_0xe195('0x33')](_0x4e4d30,_0xe195('0x2c'));_0x1f72a2[_0xe195('0x34')]=_['keys'](_0x33a08d[_0xe195('0x34')]);_0x1f72a2['filters']=_[_0xe195('0x35')](_0x1f72a2[_0xe195('0x36')],_0x1f72a2['query']);_0x3199d0[_0xe195('0x37')]=_[_0xe195('0x35')](_0x1f72a2[_0xe195('0x36')],qs['fields'](_0x33a08d[_0xe195('0x34')][_0xe195('0x38')]));_0x3199d0[_0xe195('0x37')]=_0x3199d0[_0xe195('0x37')][_0xe195('0x39')]?_0x3199d0[_0xe195('0x37')]:_0x1f72a2['model'];if(!_0x33a08d[_0xe195('0x34')][_0xe195('0x3a')](_0xe195('0x3b'))){_0x3199d0[_0xe195('0x20')]=qs[_0xe195('0x20')](_0x33a08d[_0xe195('0x34')][_0xe195('0x20')]);_0x3199d0['offset']=qs[_0xe195('0x1e')](_0x33a08d[_0xe195('0x34')]['offset']);}_0x3199d0[_0xe195('0x3c')]=qs[_0xe195('0x3d')](_0x33a08d['query'][_0xe195('0x3d')]);_0x3199d0['where']=qs[_0xe195('0x3e')](_[_0xe195('0x3f')](_0x33a08d[_0xe195('0x34')],_0x1f72a2[_0xe195('0x3e')]),_0x4e4d30);if(_0x33a08d[_0xe195('0x34')][_0xe195('0x40')]){_0x3199d0['where']=_[_0xe195('0x41')](_0x3199d0[_0xe195('0x42')],{'$or':_[_0xe195('0x33')](_0x4e4d30,function(_0x4d5b04){if(_0x4d5b04[_0xe195('0x31')]!==_0xe195('0x43')){var _0x5207e3={};_0x5207e3[_0x4d5b04[_0xe195('0x2c')]]={'$like':'%'+_0x33a08d[_0xe195('0x34')]['filter']+'%'};return _0x5207e3;}})});}_0x3199d0=_[_0xe195('0x41')]({},_0x3199d0,_0x33a08d[_0xe195('0x44')]);var _0x28ac42={'where':_0x3199d0['where']};return db[_0xe195('0x2e')][_0xe195('0x21')](_0x28ac42)[_0xe195('0x27')](function(_0x2ce54e){_0x283516[_0xe195('0x21')]=_0x2ce54e;if(_0x33a08d[_0xe195('0x34')][_0xe195('0x45')]){_0x3199d0[_0xe195('0x46')]=[{'all':!![]}];}return db[_0xe195('0x2e')][_0xe195('0x47')](_0x3199d0);})[_0xe195('0x27')](function(_0xff05fc){_0x283516['rows']=_0xff05fc;return _0x283516;})[_0xe195('0x27')](respondWithFilteredResult(_0x3e228f,_0x3199d0))[_0xe195('0x48')](handleError(_0x3e228f,null));};exports[_0xe195('0x49')]=function(_0x42a856,_0x15293a){var _0x4f66cd={'raw':!![],'where':{'id':_0x42a856['params']['id']}},_0x5d1059={};_0x5d1059['model']=_[_0xe195('0x4a')](db['FaxQueueReport'][_0xe195('0x2f')]);_0x5d1059['query']=_['keys'](_0x42a856[_0xe195('0x34')]);_0x5d1059[_0xe195('0x3e')]=_[_0xe195('0x35')](_0x5d1059[_0xe195('0x36')],_0x5d1059[_0xe195('0x34')]);_0x4f66cd[_0xe195('0x37')]=_[_0xe195('0x35')](_0x5d1059[_0xe195('0x36')],qs['fields'](_0x42a856['query'][_0xe195('0x38')]));_0x4f66cd[_0xe195('0x37')]=_0x4f66cd['attributes'][_0xe195('0x39')]?_0x4f66cd[_0xe195('0x37')]:_0x5d1059[_0xe195('0x36')];if(_0x42a856[_0xe195('0x34')][_0xe195('0x45')]){_0x4f66cd[_0xe195('0x46')]=[{'all':!![]}];}_0x4f66cd=_[_0xe195('0x41')]({},_0x4f66cd,_0x42a856[_0xe195('0x44')]);return db[_0xe195('0x2e')][_0xe195('0x4b')](_0x4f66cd)[_0xe195('0x27')](handleEntityNotFound(_0x15293a,null))[_0xe195('0x27')](respondWithResult(_0x15293a,null))['catch'](handleError(_0x15293a,null));};exports[_0xe195('0x4c')]=function(_0x3dc748,_0x1ebb32){return db[_0xe195('0x2e')][_0xe195('0x4c')](_0x3dc748[_0xe195('0x4d')],{})[_0xe195('0x27')](respondWithResult(_0x1ebb32,0xc9))[_0xe195('0x48')](handleError(_0x1ebb32,null));};exports[_0xe195('0x26')]=function(_0x19e744,_0x2b3d9b){if(_0x19e744['body']['id']){delete _0x19e744[_0xe195('0x4d')]['id'];}return db['FaxQueueReport'][_0xe195('0x4b')]({'where':{'id':_0x19e744[_0xe195('0x4e')]['id']}})[_0xe195('0x27')](handleEntityNotFound(_0x2b3d9b,null))['then'](saveUpdates(_0x19e744['body'],null))[_0xe195('0x27')](respondWithResult(_0x2b3d9b,null))[_0xe195('0x48')](handleError(_0x2b3d9b,null));};exports[_0xe195('0x28')]=function(_0x11aec8,_0x332126){return db[_0xe195('0x2e')][_0xe195('0x4b')]({'where':{'id':_0x11aec8[_0xe195('0x4e')]['id']}})[_0xe195('0x27')](handleEntityNotFound(_0x332126,null))[_0xe195('0x27')](removeEntity(_0x332126,null))[_0xe195('0x48')](handleError(_0x332126,null));};exports[_0xe195('0x4f')]=function(_0x68355f,_0x1b500e){return db[_0xe195('0x2e')][_0xe195('0x4f')]()[_0xe195('0x27')](respondWithResult(_0x1b500e,null))[_0xe195('0x48')](handleError(_0x1b500e,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 1c78055..d20d9b4 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 _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x2158b7,_0x35866b){var _0x56cf3e=function(_0x1b1f75){while(--_0x1b1f75){_0x2158b7['push'](_0x2158b7['shift']());}};_0x56cf3e(++_0x35866b);}(_0xabce,0x103));var _0xeabc=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xabce[_0x28d18d];return _0x470640;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x1e7159,_0x15e3ed){var _0x2e0dd8=function(_0x7b088f){while(--_0x7b088f){_0x1e7159['push'](_0x1e7159['shift']());}};_0x2e0dd8(++_0x15e3ed);}(_0xe14b,0x93));var _0xbe14=function(_0x5000f8,_0x142d82){_0x5000f8=_0x5000f8-0x0;var _0xab04e7=_0xe14b[_0x5000f8];return _0xab04e7;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 0a5efc6..3981d61 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 _0xe114=['code','message','result','catch','create','raw','then','CreateFaxQueueReport','UpdateFaxQueueReport','FaxQueueReport','update','body','options','where','limit','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4bab4c,_0x510ce1){var _0x402aa7=function(_0x52067a){while(--_0x52067a){_0x4bab4c['push'](_0x4bab4c['shift']());}};_0x402aa7(++_0x510ce1);}(_0xe114,0xe9));var _0x4e11=function(_0x3d6672,_0x279b87){_0x3d6672=_0x3d6672-0x0;var _0x15bb02=_0xe114[_0x3d6672];return _0x15bb02;};'use strict';var _=require(_0x4e11('0x0'));var util=require(_0x4e11('0x1'));var moment=require('moment');var BPromise=require(_0x4e11('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e11('0x3'));var db=require(_0x4e11('0x4'))['db'];var utils=require(_0x4e11('0x5'));var logger=require(_0x4e11('0x6'))('rpc');var config=require(_0x4e11('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4e11('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23b957,_0x43afe4,_0x153448){return new BPromise(function(_0x1aede3,_0x225b9f){return client['request'](_0x23b957,_0x153448)['then'](function(_0x4aab06){logger[_0x4e11('0x9')](_0x4e11('0xa'),_0x43afe4,_0x4e11('0xb'));logger['debug'](_0x4e11('0xc'),_0x43afe4,_0x4e11('0xb'),JSON[_0x4e11('0xd')](_0x4aab06));if(_0x4aab06[_0x4e11('0xe')]){if(_0x4aab06[_0x4e11('0xe')][_0x4e11('0xf')]===0x1f4){logger[_0x4e11('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x43afe4,_0x4aab06[_0x4e11('0xe')][_0x4e11('0x10')]);return _0x225b9f(_0x4aab06[_0x4e11('0xe')][_0x4e11('0x10')]);}logger[_0x4e11('0xe')](_0x4e11('0xa'),_0x43afe4,_0x4aab06[_0x4e11('0xe')][_0x4e11('0x10')]);return _0x1aede3(_0x4aab06[_0x4e11('0xe')]['message']);}else{logger[_0x4e11('0x9')](_0x4e11('0xa'),_0x43afe4,_0x4e11('0xb'));_0x1aede3(_0x4aab06[_0x4e11('0x11')][_0x4e11('0x10')]);}})[_0x4e11('0x12')](function(_0x26c290){logger[_0x4e11('0xe')](_0x4e11('0xa'),_0x43afe4,_0x26c290);_0x225b9f(_0x26c290);});});}exports['CreateFaxQueueReport']=function(_0x412351){var _0x4f0adf=this;return new Promise(function(_0x324c75,_0x270837){return db['FaxQueueReport'][_0x4e11('0x13')](_0x412351['body'],{'raw':_0x412351['options']?_0x412351['options'][_0x4e11('0x14')]===undefined?!![]:![]:!![]})[_0x4e11('0x15')](function(_0x32f184){logger[_0x4e11('0x9')]('CreateFaxQueueReport',_0x412351);logger['debug']('CreateFaxQueueReport',_0x412351,JSON[_0x4e11('0xd')](_0x32f184));_0x324c75(_0x32f184);})[_0x4e11('0x12')](function(_0x1f60ed){logger[_0x4e11('0xe')](_0x4e11('0x16'),_0x1f60ed[_0x4e11('0x10')],_0x412351);_0x270837(_0x4f0adf[_0x4e11('0xe')](0x1f4,_0x1f60ed[_0x4e11('0x10')]));});});};exports[_0x4e11('0x17')]=function(_0x63c5c7){var _0xf3c437=this;return new Promise(function(_0x362299,_0x475a3f){return db[_0x4e11('0x18')][_0x4e11('0x19')](_0x63c5c7[_0x4e11('0x1a')],{'raw':_0x63c5c7[_0x4e11('0x1b')]?_0x63c5c7[_0x4e11('0x1b')][_0x4e11('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x63c5c7[_0x4e11('0x1b')]?_0x63c5c7[_0x4e11('0x1b')][_0x4e11('0x1c')]||null:null,'attributes':_0x63c5c7[_0x4e11('0x1b')]?_0x63c5c7[_0x4e11('0x1b')]['attributes']||null:null,'limit':_0x63c5c7[_0x4e11('0x1b')]?_0x63c5c7[_0x4e11('0x1b')][_0x4e11('0x1d')]||null:null})[_0x4e11('0x15')](function(_0x366aa5){logger[_0x4e11('0x9')](_0x4e11('0x17'),_0x63c5c7);logger[_0x4e11('0x1e')](_0x4e11('0x17'),_0x63c5c7,JSON[_0x4e11('0xd')](_0x366aa5));_0x362299(_0x366aa5);})['catch'](function(_0x767950){logger[_0x4e11('0xe')](_0x4e11('0x17'),_0x767950[_0x4e11('0x10')],_0x63c5c7);_0x475a3f(_0xf3c437[_0x4e11('0xe')](0x1f4,_0x767950[_0x4e11('0x10')]));});});}; \ No newline at end of file +var _0x4645=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','create','body','options','raw','info','UpdateFaxQueueReport','FaxQueueReport','where','attributes','limit','lodash'];(function(_0x181707,_0x47d753){var _0x1d2b7a=function(_0x508991){while(--_0x508991){_0x181707['push'](_0x181707['shift']());}};_0x1d2b7a(++_0x47d753);}(_0x4645,0xbf));var _0x5464=function(_0x166172,_0x42a171){_0x166172=_0x166172-0x0;var _0x312ea5=_0x4645[_0x166172];return _0x312ea5;};'use strict';var _=require(_0x5464('0x0'));var util=require('util');var moment=require(_0x5464('0x1'));var BPromise=require('bluebird');var rs=require(_0x5464('0x2'));var fs=require('fs');var Redis=require(_0x5464('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5464('0x4'));var logger=require(_0x5464('0x5'))(_0x5464('0x6'));var config=require(_0x5464('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5464('0x8')][_0x5464('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x694fb9,_0x59de7d,_0x194547){return new BPromise(function(_0x495057,_0x370f12){return client['request'](_0x694fb9,_0x194547)[_0x5464('0xa')](function(_0x4cb91a){logger['info'](_0x5464('0xb'),_0x59de7d,_0x5464('0xc'));logger[_0x5464('0xd')](_0x5464('0xe'),_0x59de7d,_0x5464('0xc'),JSON[_0x5464('0xf')](_0x4cb91a));if(_0x4cb91a[_0x5464('0x10')]){if(_0x4cb91a[_0x5464('0x10')][_0x5464('0x11')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x59de7d,_0x4cb91a['error'][_0x5464('0x12')]);return _0x370f12(_0x4cb91a[_0x5464('0x10')]['message']);}logger[_0x5464('0x10')](_0x5464('0xb'),_0x59de7d,_0x4cb91a[_0x5464('0x10')][_0x5464('0x12')]);return _0x495057(_0x4cb91a[_0x5464('0x10')][_0x5464('0x12')]);}else{logger['info'](_0x5464('0xb'),_0x59de7d,'request\x20sent');_0x495057(_0x4cb91a[_0x5464('0x13')]['message']);}})[_0x5464('0x14')](function(_0x1d45a5){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x59de7d,_0x1d45a5);_0x370f12(_0x1d45a5);});});}exports[_0x5464('0x15')]=function(_0x13245d){var _0x50824a=this;return new Promise(function(_0x4b1885,_0x14840b){return db['FaxQueueReport'][_0x5464('0x16')](_0x13245d[_0x5464('0x17')],{'raw':_0x13245d[_0x5464('0x18')]?_0x13245d[_0x5464('0x18')][_0x5464('0x19')]===undefined?!![]:![]:!![]})[_0x5464('0xa')](function(_0x1d94f1){logger[_0x5464('0x1a')](_0x5464('0x15'),_0x13245d);logger[_0x5464('0xd')](_0x5464('0x15'),_0x13245d,JSON[_0x5464('0xf')](_0x1d94f1));_0x4b1885(_0x1d94f1);})[_0x5464('0x14')](function(_0x4d9db3){logger[_0x5464('0x10')](_0x5464('0x15'),_0x4d9db3[_0x5464('0x12')],_0x13245d);_0x14840b(_0x50824a[_0x5464('0x10')](0x1f4,_0x4d9db3[_0x5464('0x12')]));});});};exports[_0x5464('0x1b')]=function(_0x529bea){var _0x4da2b0=this;return new Promise(function(_0x214127,_0x104fa5){return db[_0x5464('0x1c')]['update'](_0x529bea[_0x5464('0x17')],{'raw':_0x529bea[_0x5464('0x18')]?_0x529bea['options'][_0x5464('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529bea['options']?_0x529bea[_0x5464('0x18')][_0x5464('0x1d')]||null:null,'attributes':_0x529bea[_0x5464('0x18')]?_0x529bea[_0x5464('0x18')][_0x5464('0x1e')]||null:null,'limit':_0x529bea['options']?_0x529bea[_0x5464('0x18')][_0x5464('0x1f')]||null:null})[_0x5464('0xa')](function(_0x425e17){logger['info'](_0x5464('0x1b'),_0x529bea);logger['debug'](_0x5464('0x1b'),_0x529bea,JSON[_0x5464('0xf')](_0x425e17));_0x214127(_0x425e17);})[_0x5464('0x14')](function(_0x5c13fb){logger[_0x5464('0x10')]('UpdateFaxQueueReport',_0x5c13fb[_0x5464('0x12')],_0x529bea);_0x104fa5(_0x4da2b0[_0x5464('0x10')](0x1f4,_0x5c13fb['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 7bf72af..eb1ec5e 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 _0x8d6e=['put','update','delete','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0xf5b16,_0x47cf1f){var _0x4dccad=function(_0x5f53fa){while(--_0x5f53fa){_0xf5b16['push'](_0xf5b16['shift']());}};_0x4dccad(++_0x47cf1f);}(_0x8d6e,0x1ce));var _0xe8d6=function(_0x5a01bb,_0x2f2427){_0x5a01bb=_0x5a01bb-0x0;var _0x285d1b=_0x8d6e[_0x5a01bb];return _0x285d1b;};'use strict';var multer=require(_0xe8d6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe8d6('0x1'));var router=express[_0xe8d6('0x2')]();var fs_extra=require(_0xe8d6('0x3'));var auth=require(_0xe8d6('0x4'));var interaction=require(_0xe8d6('0x5'));var config=require(_0xe8d6('0x6'));var controller=require(_0xe8d6('0x7'));router['get']('/',auth[_0xe8d6('0x8')](),controller[_0xe8d6('0x9')]);router[_0xe8d6('0xa')](_0xe8d6('0xb'),auth[_0xe8d6('0x8')](),controller['describe']);router[_0xe8d6('0xa')](_0xe8d6('0xc'),auth[_0xe8d6('0x8')](),controller[_0xe8d6('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe8d6('0xe')](_0xe8d6('0xc'),auth['isAuthenticated'](),controller[_0xe8d6('0xf')]);router[_0xe8d6('0x10')](_0xe8d6('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x421a=['isAuthenticated','get','/describe','describe','/:id','show','post','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xc5bd25,_0x25bd59){var _0x5862b9=function(_0x3d4563){while(--_0x3d4563){_0xc5bd25['push'](_0xc5bd25['shift']());}};_0x5862b9(++_0x25bd59);}(_0x421a,0xc6));var _0xa421=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x421a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xa421('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa421('0x1'));var router=express[_0xa421('0x2')]();var fs_extra=require(_0xa421('0x3'));var auth=require(_0xa421('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa421('0x5'));var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0xa421('0x6')](),controller['index']);router[_0xa421('0x7')](_0xa421('0x8'),auth[_0xa421('0x6')](),controller[_0xa421('0x9')]);router['get'](_0xa421('0xa'),auth[_0xa421('0x6')](),controller[_0xa421('0xb')]);router[_0xa421('0xc')]('/',auth[_0xa421('0x6')](),controller['create']);router['put'](_0xa421('0xa'),auth['isAuthenticated'](),controller[_0xa421('0xd')]);router[_0xa421('0xe')](_0xa421('0xa'),auth[_0xa421('0x6')](),controller[_0xa421('0xf')]);module[_0xa421('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 969084d..4935ae8 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x39cf70,_0x3ec55b){var _0x580424=function(_0x580a4e){while(--_0x580a4e){_0x39cf70['push'](_0x39cf70['shift']());}};_0x580424(++_0x3ec55b);}(_0x9bde,0xe1));var _0xe9bd=function(_0x595363,_0x1c2721){_0x595363=_0x595363-0x0;var _0xcae8ab=_0x9bde[_0x595363];return _0xcae8ab;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x4d135a,_0x39610a){var _0x456ac2=function(_0x4606a1){while(--_0x4606a1){_0x4d135a['push'](_0x4d135a['shift']());}};_0x456ac2(++_0x39610a);}(_0x70e0,0x17b));var _0x070e=function(_0x35664d,_0x1239a2){_0x35664d=_0x35664d-0x0;var _0x5d89fc=_0x70e0[_0x35664d];return _0x5d89fc;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index f76cd54..0fac6de 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 _0x4831=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x11ef39,_0x3aff15){var _0x4f7b09=function(_0xbaee45){while(--_0xbaee45){_0x11ef39['push'](_0x11ef39['shift']());}};_0x4f7b09(++_0x3aff15);}(_0x4831,0x16f));var _0x1483=function(_0x13fe17,_0x46e7ef){_0x13fe17=_0x13fe17-0x0;var _0x3af18d=_0x4831[_0x13fe17];return _0x3af18d;};'use strict';var emlformat=require(_0x1483('0x0'));var rimraf=require(_0x1483('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1483('0x2'));var rp=require(_0x1483('0x3'));var moment=require('moment');var BPromise=require(_0x1483('0x4'));var Mustache=require('mustache');var util=require(_0x1483('0x5'));var path=require('path');var sox=require(_0x1483('0x6'));var csv=require(_0x1483('0x7'));var ejs=require(_0x1483('0x8'));var fs=require('fs');var fs_extra=require(_0x1483('0x9'));var _=require(_0x1483('0xa'));var squel=require(_0x1483('0xb'));var crypto=require(_0x1483('0xc'));var jsforce=require(_0x1483('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1483('0x7'));var querystring=require(_0x1483('0xe'));var Papa=require('papaparse');var Redis=require(_0x1483('0xf'));var authService=require(_0x1483('0x10'));var qs=require(_0x1483('0x11'));var as=require(_0x1483('0x12'));var hardwareService=require(_0x1483('0x13'));var logger=require(_0x1483('0x14'))(_0x1483('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1483('0x16'));var db=require(_0x1483('0x17'))['db'];function respondWithStatusCode(_0x5a25be,_0x1f9f06){_0x1f9f06=_0x1f9f06||0xcc;return function(_0x87ce2e){if(_0x87ce2e){return _0x5a25be[_0x1483('0x18')](_0x1f9f06);}return _0x5a25be[_0x1483('0x19')](_0x1f9f06)[_0x1483('0x1a')]();};}function respondWithResult(_0x13e520,_0x1dda28){_0x1dda28=_0x1dda28||0xc8;return function(_0x246296){if(_0x246296){return _0x13e520['status'](_0x1dda28)[_0x1483('0x1b')](_0x246296);}};}function respondWithFilteredResult(_0x388c28,_0x35ecc4){return function(_0x480a59){if(_0x480a59){var _0x403c27=typeof _0x35ecc4[_0x1483('0x1c')]===_0x1483('0x1d')&&typeof _0x35ecc4[_0x1483('0x1e')]==='undefined';var _0x36325d=_0x480a59[_0x1483('0x1f')];var _0x3c2079=_0x403c27?0x0:_0x35ecc4['offset'];var _0x55aaec=_0x403c27?_0x480a59[_0x1483('0x1f')]:_0x35ecc4[_0x1483('0x1c')]+_0x35ecc4['limit'];var _0x5d1835;if(_0x55aaec>=_0x36325d){_0x55aaec=_0x36325d;_0x5d1835=0xc8;}else{_0x5d1835=0xce;}_0x388c28[_0x1483('0x19')](_0x5d1835);return _0x388c28[_0x1483('0x20')](_0x1483('0x21'),_0x3c2079+'-'+_0x55aaec+'/'+_0x36325d)[_0x1483('0x1b')](_0x480a59);}return null;};}function patchUpdates(_0x103562){return function(_0x321bce){try{jsonpatch[_0x1483('0x22')](_0x321bce,_0x103562,!![]);}catch(_0x266202){return BPromise['reject'](_0x266202);}return _0x321bce[_0x1483('0x23')]();};}function saveUpdates(_0x347311,_0x1e1306){return function(_0xac495f){if(_0xac495f){return _0xac495f[_0x1483('0x24')](_0x347311)[_0x1483('0x25')](function(_0x213a47){return _0x213a47;});}return null;};}function removeEntity(_0x176aae,_0x1abc19){return function(_0x5efea3){if(_0x5efea3){return _0x5efea3[_0x1483('0x26')]()[_0x1483('0x25')](function(){_0x176aae[_0x1483('0x19')](0xcc)[_0x1483('0x1a')]();});}};}function handleEntityNotFound(_0x421060,_0x5ddf85){return function(_0x6ad161){if(!_0x6ad161){_0x421060[_0x1483('0x18')](0x194);}return _0x6ad161;};}function handleError(_0x27c6ab,_0x4a95b5){_0x4a95b5=_0x4a95b5||0x1f4;return function(_0x19ed87){logger[_0x1483('0x27')](_0x19ed87['stack']);if(_0x19ed87['name']){delete _0x19ed87['name'];}_0x27c6ab[_0x1483('0x19')](_0x4a95b5)[_0x1483('0x28')](_0x19ed87);};}exports[_0x1483('0x29')]=function(_0x3bec2c,_0x41efe8){var _0xe42b27={},_0x4f2fa7={},_0x520b92={'count':0x0,'rows':[]};var _0x134e81=_[_0x1483('0x2a')](db[_0x1483('0x2b')][_0x1483('0x2c')],function(_0x1a03e0){return{'name':_0x1a03e0[_0x1483('0x2d')],'type':_0x1a03e0[_0x1483('0x2e')][_0x1483('0x2f')]};});_0x4f2fa7[_0x1483('0x30')]=_[_0x1483('0x2a')](_0x134e81,_0x1483('0x31'));_0x4f2fa7[_0x1483('0x32')]=_['keys'](_0x3bec2c[_0x1483('0x32')]);_0x4f2fa7[_0x1483('0x33')]=_[_0x1483('0x34')](_0x4f2fa7[_0x1483('0x30')],_0x4f2fa7['query']);_0xe42b27[_0x1483('0x35')]=_[_0x1483('0x34')](_0x4f2fa7[_0x1483('0x30')],qs[_0x1483('0x36')](_0x3bec2c[_0x1483('0x32')][_0x1483('0x36')]));_0xe42b27['attributes']=_0xe42b27[_0x1483('0x35')][_0x1483('0x37')]?_0xe42b27[_0x1483('0x35')]:_0x4f2fa7[_0x1483('0x30')];if(!_0x3bec2c[_0x1483('0x32')][_0x1483('0x38')](_0x1483('0x39'))){_0xe42b27[_0x1483('0x1e')]=qs[_0x1483('0x1e')](_0x3bec2c[_0x1483('0x32')]['limit']);_0xe42b27['offset']=qs[_0x1483('0x1c')](_0x3bec2c[_0x1483('0x32')][_0x1483('0x1c')]);}_0xe42b27[_0x1483('0x3a')]=qs[_0x1483('0x3b')](_0x3bec2c[_0x1483('0x32')][_0x1483('0x3b')]);_0xe42b27[_0x1483('0x3c')]=qs[_0x1483('0x33')](_[_0x1483('0x3d')](_0x3bec2c[_0x1483('0x32')],_0x4f2fa7[_0x1483('0x33')]),_0x134e81);if(_0x3bec2c[_0x1483('0x32')][_0x1483('0x3e')]){_0xe42b27[_0x1483('0x3c')]=_[_0x1483('0x3f')](_0xe42b27[_0x1483('0x3c')],{'$or':_[_0x1483('0x2a')](_0x134e81,function(_0x4ae9f1){if(_0x4ae9f1[_0x1483('0x2e')]!==_0x1483('0x40')){var _0x2a7ad4={};_0x2a7ad4[_0x4ae9f1[_0x1483('0x31')]]={'$like':'%'+_0x3bec2c[_0x1483('0x32')][_0x1483('0x3e')]+'%'};return _0x2a7ad4;}})});}_0xe42b27=_[_0x1483('0x3f')]({},_0xe42b27,_0x3bec2c[_0x1483('0x41')]);var _0x2431e9={'where':_0xe42b27[_0x1483('0x3c')]};return db[_0x1483('0x2b')]['count'](_0x2431e9)['then'](function(_0xa3ab53){_0x520b92[_0x1483('0x1f')]=_0xa3ab53;if(_0x3bec2c[_0x1483('0x32')][_0x1483('0x42')]){_0xe42b27[_0x1483('0x43')]=[{'all':!![]}];}return db[_0x1483('0x2b')]['findAll'](_0xe42b27);})[_0x1483('0x25')](function(_0x61c1d9){_0x520b92[_0x1483('0x44')]=_0x61c1d9;return _0x520b92;})[_0x1483('0x25')](respondWithFilteredResult(_0x41efe8,_0xe42b27))[_0x1483('0x45')](handleError(_0x41efe8,null));};exports[_0x1483('0x46')]=function(_0x1010ec,_0x4769ee){var _0x59026f={'raw':!![],'where':{'id':_0x1010ec[_0x1483('0x47')]['id']}},_0x633bda={};_0x633bda['model']=_[_0x1483('0x48')](db[_0x1483('0x2b')][_0x1483('0x2c')]);_0x633bda[_0x1483('0x32')]=_[_0x1483('0x48')](_0x1010ec[_0x1483('0x32')]);_0x633bda[_0x1483('0x33')]=_[_0x1483('0x34')](_0x633bda[_0x1483('0x30')],_0x633bda[_0x1483('0x32')]);_0x59026f['attributes']=_[_0x1483('0x34')](_0x633bda[_0x1483('0x30')],qs['fields'](_0x1010ec[_0x1483('0x32')][_0x1483('0x36')]));_0x59026f[_0x1483('0x35')]=_0x59026f['attributes'][_0x1483('0x37')]?_0x59026f[_0x1483('0x35')]:_0x633bda[_0x1483('0x30')];if(_0x1010ec[_0x1483('0x32')]['includeAll']){_0x59026f[_0x1483('0x43')]=[{'all':!![]}];}_0x59026f=_[_0x1483('0x3f')]({},_0x59026f,_0x1010ec[_0x1483('0x41')]);return db[_0x1483('0x2b')][_0x1483('0x49')](_0x59026f)[_0x1483('0x25')](handleEntityNotFound(_0x4769ee,null))['then'](respondWithResult(_0x4769ee,null))[_0x1483('0x45')](handleError(_0x4769ee,null));};exports[_0x1483('0x4a')]=function(_0x24cb8d,_0x290961){return db[_0x1483('0x2b')][_0x1483('0x4a')](_0x24cb8d['body'],{})[_0x1483('0x25')](respondWithResult(_0x290961,0xc9))[_0x1483('0x45')](handleError(_0x290961,null));};exports[_0x1483('0x24')]=function(_0x4067e9,_0x248a7a){if(_0x4067e9[_0x1483('0x4b')]['id']){delete _0x4067e9[_0x1483('0x4b')]['id'];}return db[_0x1483('0x2b')][_0x1483('0x49')]({'where':{'id':_0x4067e9[_0x1483('0x47')]['id']}})[_0x1483('0x25')](handleEntityNotFound(_0x248a7a,null))[_0x1483('0x25')](saveUpdates(_0x4067e9[_0x1483('0x4b')],null))['then'](respondWithResult(_0x248a7a,null))[_0x1483('0x45')](handleError(_0x248a7a,null));};exports[_0x1483('0x26')]=function(_0x3f41ac,_0x3c0991){return db[_0x1483('0x2b')][_0x1483('0x49')]({'where':{'id':_0x3f41ac[_0x1483('0x47')]['id']}})[_0x1483('0x25')](handleEntityNotFound(_0x3c0991,null))[_0x1483('0x25')](removeEntity(_0x3c0991,null))[_0x1483('0x45')](handleError(_0x3c0991,null));};exports[_0x1483('0x4c')]=function(_0x43d174,_0x584d9a){return db[_0x1483('0x2b')][_0x1483('0x4c')]()[_0x1483('0x25')](respondWithResult(_0x584d9a,null))[_0x1483('0x45')](handleError(_0x584d9a,null));}; \ No newline at end of file +var _0xc91d=['filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','fields','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','end','offset','limit','undefined','count','set','json','reject','save','then','destroy','status','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','keys','query'];(function(_0x3e2489,_0x41d9dd){var _0x2254ce=function(_0x227e46){while(--_0x227e46){_0x3e2489['push'](_0x3e2489['shift']());}};_0x2254ce(++_0x41d9dd);}(_0xc91d,0x195));var _0xdc91=function(_0x2787e3,_0x5311b2){_0x2787e3=_0x2787e3-0x0;var _0x4002fa=_0xc91d[_0x2787e3];return _0x4002fa;};'use strict';var emlformat=require(_0xdc91('0x0'));var rimraf=require(_0xdc91('0x1'));var zipdir=require(_0xdc91('0x2'));var jsonpatch=require(_0xdc91('0x3'));var rp=require('request-promise');var moment=require(_0xdc91('0x4'));var BPromise=require(_0xdc91('0x5'));var Mustache=require(_0xdc91('0x6'));var util=require(_0xdc91('0x7'));var path=require(_0xdc91('0x8'));var sox=require(_0xdc91('0x9'));var csv=require('to-csv');var ejs=require(_0xdc91('0xa'));var fs=require('fs');var fs_extra=require(_0xdc91('0xb'));var _=require(_0xdc91('0xc'));var squel=require(_0xdc91('0xd'));var crypto=require(_0xdc91('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdc91('0xf'));var querystring=require(_0xdc91('0x10'));var Papa=require(_0xdc91('0x11'));var Redis=require(_0xdc91('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xdc91('0x13'));var as=require(_0xdc91('0x14'));var hardwareService=require(_0xdc91('0x15'));var logger=require(_0xdc91('0x16'))(_0xdc91('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdc91('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3019da,_0x38bf29){_0x38bf29=_0x38bf29||0xcc;return function(_0x3037fd){if(_0x3037fd){return _0x3019da[_0xdc91('0x19')](_0x38bf29);}return _0x3019da['status'](_0x38bf29)[_0xdc91('0x1a')]();};}function respondWithResult(_0x22e9e1,_0x420615){_0x420615=_0x420615||0xc8;return function(_0x29bc36){if(_0x29bc36){return _0x22e9e1['status'](_0x420615)['json'](_0x29bc36);}};}function respondWithFilteredResult(_0x44df4b,_0x176c8e){return function(_0x440046){if(_0x440046){var _0x513987=typeof _0x176c8e[_0xdc91('0x1b')]==='undefined'&&typeof _0x176c8e[_0xdc91('0x1c')]===_0xdc91('0x1d');var _0x104c7c=_0x440046[_0xdc91('0x1e')];var _0x5b4a76=_0x513987?0x0:_0x176c8e[_0xdc91('0x1b')];var _0xc13298=_0x513987?_0x440046[_0xdc91('0x1e')]:_0x176c8e[_0xdc91('0x1b')]+_0x176c8e[_0xdc91('0x1c')];var _0x2dc411;if(_0xc13298>=_0x104c7c){_0xc13298=_0x104c7c;_0x2dc411=0xc8;}else{_0x2dc411=0xce;}_0x44df4b['status'](_0x2dc411);return _0x44df4b[_0xdc91('0x1f')]('Content-Range',_0x5b4a76+'-'+_0xc13298+'/'+_0x104c7c)[_0xdc91('0x20')](_0x440046);}return null;};}function patchUpdates(_0x5a0595){return function(_0x3ac956){try{jsonpatch['apply'](_0x3ac956,_0x5a0595,!![]);}catch(_0x35803c){return BPromise[_0xdc91('0x21')](_0x35803c);}return _0x3ac956[_0xdc91('0x22')]();};}function saveUpdates(_0x2ccced,_0x2d7e89){return function(_0x2a94fe){if(_0x2a94fe){return _0x2a94fe['update'](_0x2ccced)[_0xdc91('0x23')](function(_0x57ea77){return _0x57ea77;});}return null;};}function removeEntity(_0x5ef673,_0x50720a){return function(_0x338869){if(_0x338869){return _0x338869[_0xdc91('0x24')]()['then'](function(){_0x5ef673[_0xdc91('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x482543,_0x7ca771){return function(_0x546733){if(!_0x546733){_0x482543[_0xdc91('0x19')](0x194);}return _0x546733;};}function handleError(_0x5e10f1,_0x475220){_0x475220=_0x475220||0x1f4;return function(_0x6db4e){logger[_0xdc91('0x26')](_0x6db4e[_0xdc91('0x27')]);if(_0x6db4e[_0xdc91('0x28')]){delete _0x6db4e['name'];}_0x5e10f1[_0xdc91('0x25')](_0x475220)[_0xdc91('0x29')](_0x6db4e);};}exports[_0xdc91('0x2a')]=function(_0x2ae24a,_0xea5a3e){var _0x500068={},_0x349d97={},_0x5a8ff4={'count':0x0,'rows':[]};var _0x4adbb3=_[_0xdc91('0x2b')](db[_0xdc91('0x2c')][_0xdc91('0x2d')],function(_0x25ae1e){return{'name':_0x25ae1e[_0xdc91('0x2e')],'type':_0x25ae1e[_0xdc91('0x2f')]['key']};});_0x349d97[_0xdc91('0x30')]=_[_0xdc91('0x2b')](_0x4adbb3,_0xdc91('0x28'));_0x349d97['query']=_[_0xdc91('0x31')](_0x2ae24a[_0xdc91('0x32')]);_0x349d97[_0xdc91('0x33')]=_[_0xdc91('0x34')](_0x349d97[_0xdc91('0x30')],_0x349d97['query']);_0x500068['attributes']=_[_0xdc91('0x34')](_0x349d97['model'],qs['fields'](_0x2ae24a[_0xdc91('0x32')]['fields']));_0x500068[_0xdc91('0x35')]=_0x500068['attributes'][_0xdc91('0x36')]?_0x500068[_0xdc91('0x35')]:_0x349d97[_0xdc91('0x30')];if(!_0x2ae24a['query'][_0xdc91('0x37')](_0xdc91('0x38'))){_0x500068[_0xdc91('0x1c')]=qs[_0xdc91('0x1c')](_0x2ae24a[_0xdc91('0x32')][_0xdc91('0x1c')]);_0x500068['offset']=qs['offset'](_0x2ae24a[_0xdc91('0x32')][_0xdc91('0x1b')]);}_0x500068[_0xdc91('0x39')]=qs[_0xdc91('0x3a')](_0x2ae24a[_0xdc91('0x32')][_0xdc91('0x3a')]);_0x500068[_0xdc91('0x3b')]=qs['filters'](_['pick'](_0x2ae24a['query'],_0x349d97[_0xdc91('0x33')]),_0x4adbb3);if(_0x2ae24a[_0xdc91('0x32')][_0xdc91('0x3c')]){_0x500068[_0xdc91('0x3b')]=_[_0xdc91('0x3d')](_0x500068[_0xdc91('0x3b')],{'$or':_['map'](_0x4adbb3,function(_0xe5c076){if(_0xe5c076[_0xdc91('0x2f')]!==_0xdc91('0x3e')){var _0x3278b1={};_0x3278b1[_0xe5c076[_0xdc91('0x28')]]={'$like':'%'+_0x2ae24a[_0xdc91('0x32')][_0xdc91('0x3c')]+'%'};return _0x3278b1;}})});}_0x500068=_['merge']({},_0x500068,_0x2ae24a['options']);var _0x2032c1={'where':_0x500068[_0xdc91('0x3b')]};return db['FaxTransferReport'][_0xdc91('0x1e')](_0x2032c1)[_0xdc91('0x23')](function(_0x2ca8c6){_0x5a8ff4[_0xdc91('0x1e')]=_0x2ca8c6;if(_0x2ae24a['query'][_0xdc91('0x3f')]){_0x500068[_0xdc91('0x40')]=[{'all':!![]}];}return db[_0xdc91('0x2c')]['findAll'](_0x500068);})[_0xdc91('0x23')](function(_0x270fa2){_0x5a8ff4[_0xdc91('0x41')]=_0x270fa2;return _0x5a8ff4;})['then'](respondWithFilteredResult(_0xea5a3e,_0x500068))[_0xdc91('0x42')](handleError(_0xea5a3e,null));};exports[_0xdc91('0x43')]=function(_0x1d6f4d,_0x39212f){var _0xb6b988={'raw':!![],'where':{'id':_0x1d6f4d[_0xdc91('0x44')]['id']}},_0x9c4fff={};_0x9c4fff['model']=_['keys'](db['FaxTransferReport'][_0xdc91('0x2d')]);_0x9c4fff['query']=_[_0xdc91('0x31')](_0x1d6f4d[_0xdc91('0x32')]);_0x9c4fff['filters']=_[_0xdc91('0x34')](_0x9c4fff['model'],_0x9c4fff[_0xdc91('0x32')]);_0xb6b988[_0xdc91('0x35')]=_[_0xdc91('0x34')](_0x9c4fff[_0xdc91('0x30')],qs[_0xdc91('0x45')](_0x1d6f4d[_0xdc91('0x32')][_0xdc91('0x45')]));_0xb6b988[_0xdc91('0x35')]=_0xb6b988[_0xdc91('0x35')][_0xdc91('0x36')]?_0xb6b988[_0xdc91('0x35')]:_0x9c4fff[_0xdc91('0x30')];if(_0x1d6f4d[_0xdc91('0x32')][_0xdc91('0x3f')]){_0xb6b988[_0xdc91('0x40')]=[{'all':!![]}];}_0xb6b988=_[_0xdc91('0x3d')]({},_0xb6b988,_0x1d6f4d[_0xdc91('0x46')]);return db[_0xdc91('0x2c')][_0xdc91('0x47')](_0xb6b988)[_0xdc91('0x23')](handleEntityNotFound(_0x39212f,null))[_0xdc91('0x23')](respondWithResult(_0x39212f,null))[_0xdc91('0x42')](handleError(_0x39212f,null));};exports[_0xdc91('0x48')]=function(_0x382f41,_0x1031db){return db[_0xdc91('0x2c')][_0xdc91('0x48')](_0x382f41[_0xdc91('0x49')],{})[_0xdc91('0x23')](respondWithResult(_0x1031db,0xc9))[_0xdc91('0x42')](handleError(_0x1031db,null));};exports[_0xdc91('0x4a')]=function(_0x8dd741,_0x388cb3){if(_0x8dd741[_0xdc91('0x49')]['id']){delete _0x8dd741[_0xdc91('0x49')]['id'];}return db[_0xdc91('0x2c')][_0xdc91('0x47')]({'where':{'id':_0x8dd741['params']['id']}})[_0xdc91('0x23')](handleEntityNotFound(_0x388cb3,null))[_0xdc91('0x23')](saveUpdates(_0x8dd741[_0xdc91('0x49')],null))[_0xdc91('0x23')](respondWithResult(_0x388cb3,null))['catch'](handleError(_0x388cb3,null));};exports[_0xdc91('0x24')]=function(_0x1a91b0,_0x284119){return db[_0xdc91('0x2c')]['find']({'where':{'id':_0x1a91b0[_0xdc91('0x44')]['id']}})['then'](handleEntityNotFound(_0x284119,null))[_0xdc91('0x23')](removeEntity(_0x284119,null))[_0xdc91('0x42')](handleError(_0x284119,null));};exports[_0xdc91('0x4b')]=function(_0x24c9d3,_0x20f5e5){return db['FaxTransferReport'][_0xdc91('0x4b')]()['then'](respondWithResult(_0x20f5e5,null))[_0xdc91('0x42')](handleError(_0x20f5e5,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index a4b9e73..4eb1728 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 _0x2a4e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a4e,0x1df));var _0xe2a4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2a4e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe2a4('0x0'));var util=require('util');var logger=require(_0xe2a4('0x1'))(_0xe2a4('0x2'));var moment=require(_0xe2a4('0x3'));var BPromise=require(_0xe2a4('0x4'));var rp=require(_0xe2a4('0x5'));var fs=require('fs');var path=require(_0xe2a4('0x6'));var rimraf=require(_0xe2a4('0x7'));var config=require(_0xe2a4('0x8'));var attributes=require(_0xe2a4('0x9'));module[_0xe2a4('0xa')]=function(_0x20f1d0,_0x345e44){return _0x20f1d0[_0xe2a4('0xb')](_0xe2a4('0xc'),attributes,{'tableName':_0xe2a4('0xd'),'paranoid':![],'indexes':[{'name':_0xe2a4('0xe'),'fields':[_0xe2a4('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd3b0=['./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4db8d9,_0x100e73){var _0x1e1a49=function(_0x292d49){while(--_0x292d49){_0x4db8d9['push'](_0x4db8d9['shift']());}};_0x1e1a49(++_0x100e73);}(_0xd3b0,0x1f4));var _0x0d3b=function(_0xa938c8,_0x32c04f){_0xa938c8=_0xa938c8-0x0;var _0x2c9cdd=_0xd3b0[_0xa938c8];return _0x2c9cdd;};'use strict';var _=require(_0x0d3b('0x0'));var util=require(_0x0d3b('0x1'));var logger=require(_0x0d3b('0x2'))(_0x0d3b('0x3'));var moment=require(_0x0d3b('0x4'));var BPromise=require(_0x0d3b('0x5'));var rp=require(_0x0d3b('0x6'));var fs=require('fs');var path=require(_0x0d3b('0x7'));var rimraf=require(_0x0d3b('0x8'));var config=require(_0x0d3b('0x9'));var attributes=require(_0x0d3b('0xa'));module['exports']=function(_0x4bea5c,_0x192adf){return _0x4bea5c[_0x0d3b('0xb')](_0x0d3b('0xc'),attributes,{'tableName':_0x0d3b('0xd'),'paranoid':![],'indexes':[{'name':_0x0d3b('0xe'),'fields':[_0x0d3b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 8d797f1..da4c3a8 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 _0xda24=['../../config/logger','rpc','jayson/promise','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3db4df,_0x1e53fe){var _0x4c6ec4=function(_0x4225de){while(--_0x4225de){_0x3db4df['push'](_0x3db4df['shift']());}};_0x4c6ec4(++_0x1e53fe);}(_0xda24,0x10b));var _0x4da2=function(_0x4b1eda,_0x1ca265){_0x4b1eda=_0x4b1eda-0x0;var _0x520e6b=_0xda24[_0x4b1eda];return _0x520e6b;};'use strict';var _=require(_0x4da2('0x0'));var util=require(_0x4da2('0x1'));var moment=require(_0x4da2('0x2'));var BPromise=require(_0x4da2('0x3'));var rs=require(_0x4da2('0x4'));var fs=require('fs');var Redis=require(_0x4da2('0x5'));var db=require(_0x4da2('0x6'))['db'];var utils=require(_0x4da2('0x7'));var logger=require(_0x4da2('0x8'))(_0x4da2('0x9'));var config=require('../../config/environment');var jayson=require(_0x4da2('0xa'));var client=jayson[_0x4da2('0xb')][_0x4da2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x24a383,_0x296870,_0x45b726){return new BPromise(function(_0x430a34,_0xf72529){return client['request'](_0x24a383,_0x45b726)[_0x4da2('0xd')](function(_0x343e0c){logger[_0x4da2('0xe')](_0x4da2('0xf'),_0x296870,_0x4da2('0x10'));logger[_0x4da2('0x11')](_0x4da2('0x12'),_0x296870,_0x4da2('0x10'),JSON[_0x4da2('0x13')](_0x343e0c));if(_0x343e0c[_0x4da2('0x14')]){if(_0x343e0c[_0x4da2('0x14')][_0x4da2('0x15')]===0x1f4){logger[_0x4da2('0x14')](_0x4da2('0xf'),_0x296870,_0x343e0c[_0x4da2('0x14')][_0x4da2('0x16')]);return _0xf72529(_0x343e0c[_0x4da2('0x14')]['message']);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x296870,_0x343e0c[_0x4da2('0x14')][_0x4da2('0x16')]);return _0x430a34(_0x343e0c['error'][_0x4da2('0x16')]);}else{logger[_0x4da2('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x296870,_0x4da2('0x10'));_0x430a34(_0x343e0c[_0x4da2('0x17')][_0x4da2('0x16')]);}})[_0x4da2('0x18')](function(_0x488a66){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x296870,_0x488a66);_0xf72529(_0x488a66);});});} \ No newline at end of file +var _0x2034=['rpc','../../config/environment','jayson/promise','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x5a8d2c,_0x725a3){var _0x2086dc=function(_0x58d9ab){while(--_0x58d9ab){_0x5a8d2c['push'](_0x5a8d2c['shift']());}};_0x2086dc(++_0x725a3);}(_0x2034,0x83));var _0x4203=function(_0x378bca,_0x2533ca){_0x378bca=_0x378bca-0x0;var _0x290216=_0x2034[_0x378bca];return _0x290216;};'use strict';var _=require('lodash');var util=require(_0x4203('0x0'));var moment=require(_0x4203('0x1'));var BPromise=require(_0x4203('0x2'));var rs=require(_0x4203('0x3'));var fs=require('fs');var Redis=require(_0x4203('0x4'));var db=require(_0x4203('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4203('0x6'))(_0x4203('0x7'));var config=require(_0x4203('0x8'));var jayson=require(_0x4203('0x9'));var client=jayson[_0x4203('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dba7d,_0x2f9de8,_0x2c40cf){return new BPromise(function(_0x5eaf82,_0x21d401){return client[_0x4203('0xb')](_0x1dba7d,_0x2c40cf)[_0x4203('0xc')](function(_0x357bba){logger[_0x4203('0xd')](_0x4203('0xe'),_0x2f9de8,'request\x20sent');logger[_0x4203('0xf')](_0x4203('0x10'),_0x2f9de8,_0x4203('0x11'),JSON[_0x4203('0x12')](_0x357bba));if(_0x357bba['error']){if(_0x357bba[_0x4203('0x13')][_0x4203('0x14')]===0x1f4){logger[_0x4203('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x2f9de8,_0x357bba[_0x4203('0x13')][_0x4203('0x15')]);return _0x21d401(_0x357bba[_0x4203('0x13')][_0x4203('0x15')]);}logger[_0x4203('0x13')](_0x4203('0xe'),_0x2f9de8,_0x357bba['error'][_0x4203('0x15')]);return _0x5eaf82(_0x357bba[_0x4203('0x13')]['message']);}else{logger[_0x4203('0xd')](_0x4203('0xe'),_0x2f9de8,_0x4203('0x11'));_0x5eaf82(_0x357bba['result'][_0x4203('0x15')]);}})[_0x4203('0x16')](function(_0x3b68d6){logger[_0x4203('0x13')](_0x4203('0xe'),_0x2f9de8,_0x3b68d6);_0x21d401(_0x3b68d6);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 1176734..14d1454 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 _0xb466=['./faxTransferReport.controller','isAuthenticated','index','get','/:id','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5ecba8,_0x935c5d){var _0x46615f=function(_0x2fac1f){while(--_0x2fac1f){_0x5ecba8['push'](_0x5ecba8['shift']());}};_0x46615f(++_0x935c5d);}(_0xb466,0xd0));var _0x6b46=function(_0x27d563,_0x374b78){_0x27d563=_0x27d563-0x0;var _0x2fd1af=_0xb466[_0x27d563];return _0x2fd1af;};'use strict';var multer=require(_0x6b46('0x0'));var util=require(_0x6b46('0x1'));var path=require('path');var timeout=require(_0x6b46('0x2'));var express=require(_0x6b46('0x3'));var router=express[_0x6b46('0x4')]();var fs_extra=require(_0x6b46('0x5'));var auth=require(_0x6b46('0x6'));var interaction=require(_0x6b46('0x7'));var config=require('../../config/environment');var controller=require(_0x6b46('0x8'));router['get']('/',auth[_0x6b46('0x9')](),controller[_0x6b46('0xa')]);router[_0x6b46('0xb')]('/describe',auth[_0x6b46('0x9')](),controller['describe']);router[_0x6b46('0xb')](_0x6b46('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x6b46('0xd')]);router['put']('/:id',auth[_0x6b46('0x9')](),controller[_0x6b46('0xe')]);router[_0x6b46('0xf')](_0x6b46('0xc'),auth['isAuthenticated'](),controller[_0x6b46('0x10')]);module[_0x6b46('0x11')]=router; \ No newline at end of file +var _0x8afc=['index','/describe','describe','/:id','show','post','create','put','update','delete','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated'];(function(_0xc6b649,_0x4f7b62){var _0x9f2212=function(_0x10c0f4){while(--_0x10c0f4){_0xc6b649['push'](_0xc6b649['shift']());}};_0x9f2212(++_0x4f7b62);}(_0x8afc,0x7c));var _0xc8af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8afc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc8af('0x0'));var timeout=require('connect-timeout');var express=require(_0xc8af('0x1'));var router=express[_0xc8af('0x2')]();var fs_extra=require(_0xc8af('0x3'));var auth=require(_0xc8af('0x4'));var interaction=require(_0xc8af('0x5'));var config=require('../../config/environment');var controller=require(_0xc8af('0x6'));router[_0xc8af('0x7')]('/',auth[_0xc8af('0x8')](),controller[_0xc8af('0x9')]);router[_0xc8af('0x7')](_0xc8af('0xa'),auth[_0xc8af('0x8')](),controller[_0xc8af('0xb')]);router[_0xc8af('0x7')](_0xc8af('0xc'),auth[_0xc8af('0x8')](),controller[_0xc8af('0xd')]);router[_0xc8af('0xe')]('/',auth[_0xc8af('0x8')](),controller[_0xc8af('0xf')]);router[_0xc8af('0x10')](_0xc8af('0xc'),auth[_0xc8af('0x8')](),controller[_0xc8af('0x11')]);router[_0xc8af('0x12')](_0xc8af('0xc'),auth[_0xc8af('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 61df10c..c8fea5b 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 _0xca15=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x3c61b7,_0x36e756){var _0x399e6f=function(_0x506e95){while(--_0x506e95){_0x3c61b7['push'](_0x3c61b7['shift']());}};_0x399e6f(++_0x36e756);}(_0xca15,0xca));var _0x5ca1=function(_0x58f579,_0x232e82){_0x58f579=_0x58f579-0x0;var _0x5d294c=_0xca15[_0x58f579];return _0x5d294c;};'use strict';var multer=require(_0x5ca1('0x0'));var util=require(_0x5ca1('0x1'));var path=require(_0x5ca1('0x2'));var timeout=require('connect-timeout');var express=require(_0x5ca1('0x3'));var router=express[_0x5ca1('0x4')]();var fs_extra=require(_0x5ca1('0x5'));var auth=require(_0x5ca1('0x6'));var interaction=require(_0x5ca1('0x7'));var config=require(_0x5ca1('0x8'));var controller=require(_0x5ca1('0x9'));router[_0x5ca1('0xa')]('/',auth[_0x5ca1('0xb')](),controller[_0x5ca1('0xc')]);router[_0x5ca1('0xa')]('/:id',auth[_0x5ca1('0xb')](),controller[_0x5ca1('0xd')]);router[_0x5ca1('0xa')](_0x5ca1('0xe'),auth[_0x5ca1('0xb')](),controller[_0x5ca1('0xf')]);router[_0x5ca1('0xa')](_0x5ca1('0x10'),auth[_0x5ca1('0xb')](),controller['getFields']);router[_0x5ca1('0x11')]('/',auth['isAuthenticated'](),controller[_0x5ca1('0x12')]);router[_0x5ca1('0x11')](_0x5ca1('0xe'),auth[_0x5ca1('0xb')](),controller[_0x5ca1('0x13')]);router[_0x5ca1('0x14')](_0x5ca1('0x15'),auth[_0x5ca1('0xb')](),controller[_0x5ca1('0x16')]);router[_0x5ca1('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x5ca1('0x18')]);module[_0x5ca1('0x19')]=router; \ No newline at end of file +var _0xff3f=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','getConfigurations','getFields','post','create','/:id/configurations','put','update','destroy'];(function(_0xdc0968,_0x5f39f3){var _0x556838=function(_0x264db2){while(--_0x264db2){_0xdc0968['push'](_0xdc0968['shift']());}};_0x556838(++_0x5f39f3);}(_0xff3f,0xdd));var _0xfff3=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0xff3f[_0x2d126e];return _0xcb04d3;};'use strict';var multer=require(_0xfff3('0x0'));var util=require('util');var path=require(_0xfff3('0x1'));var timeout=require(_0xfff3('0x2'));var express=require(_0xfff3('0x3'));var router=express[_0xfff3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfff3('0x5'));var interaction=require(_0xfff3('0x6'));var config=require('../../config/environment');var controller=require(_0xfff3('0x7'));router[_0xfff3('0x8')]('/',auth['isAuthenticated'](),controller[_0xfff3('0x9')]);router[_0xfff3('0x8')](_0xfff3('0xa'),auth[_0xfff3('0xb')](),controller[_0xfff3('0xc')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0xfff3('0xd')]);router[_0xfff3('0x8')]('/:id/fields',auth[_0xfff3('0xb')](),controller[_0xfff3('0xe')]);router[_0xfff3('0xf')]('/',auth[_0xfff3('0xb')](),controller[_0xfff3('0x10')]);router[_0xfff3('0xf')](_0xfff3('0x11'),auth[_0xfff3('0xb')](),controller['addConfiguration']);router[_0xfff3('0x12')]('/:id',auth[_0xfff3('0xb')](),controller[_0xfff3('0x13')]);router['delete']('/:id',auth[_0xfff3('0xb')](),controller[_0xfff3('0x14')]);module[_0xfff3('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 26f0ef3..e5ce2b8 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 _0xaab4=['STRING','basic','integrationTab','newTab','exports'];(function(_0x4599b6,_0x40c254){var _0x2e014c=function(_0x3c4d90){while(--_0x3c4d90){_0x4599b6['push'](_0x4599b6['shift']());}};_0x2e014c(++_0x40c254);}(_0xaab4,0xa4));var _0x4aab=function(_0x26bcef,_0x4e2195){_0x26bcef=_0x26bcef-0x0;var _0x3d691b=_0xaab4[_0x26bcef];return _0x3d691b;};'use strict';var Sequelize=require('sequelize');module[_0x4aab('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4aab('0x1')]},'username':{'type':Sequelize[_0x4aab('0x1')]},'remoteUri':{'type':Sequelize[_0x4aab('0x1')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0x4aab('0x2')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x4aab('0x1')]},'token':{'type':Sequelize[_0x4aab('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x4aab('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4aab('0x3'),_0x4aab('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xbc10=['integrationTab','newTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x51ad45,_0x16860a){var _0x179af2=function(_0x1e48c3){while(--_0x1e48c3){_0x51ad45['push'](_0x51ad45['shift']());}};_0x179af2(++_0x16860a);}(_0xbc10,0x17c));var _0x0bc1=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xbc10[_0x8de54f];return _0x14cba4;};'use strict';var Sequelize=require(_0x0bc1('0x0'));module[_0x0bc1('0x1')]={'name':{'type':Sequelize[_0x0bc1('0x2')]},'description':{'type':Sequelize[_0x0bc1('0x2')]},'username':{'type':Sequelize[_0x0bc1('0x2')]},'remoteUri':{'type':Sequelize[_0x0bc1('0x2')]},'authType':{'type':Sequelize[_0x0bc1('0x3')](_0x0bc1('0x4')),'defaultValue':_0x0bc1('0x4')},'password':{'type':Sequelize[_0x0bc1('0x2')]},'consumerKey':{'type':Sequelize[_0x0bc1('0x2')]},'consumerSecret':{'type':Sequelize[_0x0bc1('0x2')]},'token':{'type':Sequelize[_0x0bc1('0x2')]},'tokenSecret':{'type':Sequelize[_0x0bc1('0x2')]},'serverUrl':{'type':Sequelize[_0x0bc1('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0bc1('0x5'),_0x0bc1('0x6')),'defaultValue':_0x0bc1('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 218cbde..a5adaa8 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 _0x6a2a=['moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','Content-Range','apply','save','update','then','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','include','DeskAccount','findAll','rows','show','options','find','create','body','params','catch','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','channel','getDescriptions','DeskField','Subjects','Descriptions','getFields','priority','authType','username','password','consumerKey','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','toString','base64','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x1cc3ce,_0x43791e){var _0x4ac6ac=function(_0x15d789){while(--_0x15d789){_0x1cc3ce['push'](_0x1cc3ce['shift']());}};_0x4ac6ac(++_0x43791e);}(_0x6a2a,0x15a));var _0xa6a2=function(_0x120900,_0x1b16c7){_0x120900=_0x120900-0x0;var _0x356528=_0x6a2a[_0x120900];return _0x356528;};'use strict';var emlformat=require(_0xa6a2('0x0'));var rimraf=require(_0xa6a2('0x1'));var zipdir=require(_0xa6a2('0x2'));var jsonpatch=require(_0xa6a2('0x3'));var rp=require(_0xa6a2('0x4'));var moment=require(_0xa6a2('0x5'));var BPromise=require(_0xa6a2('0x6'));var Mustache=require(_0xa6a2('0x7'));var util=require(_0xa6a2('0x8'));var path=require(_0xa6a2('0x9'));var sox=require(_0xa6a2('0xa'));var csv=require(_0xa6a2('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa6a2('0xc'));var squel=require(_0xa6a2('0xd'));var crypto=require(_0xa6a2('0xe'));var jsforce=require(_0xa6a2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa6a2('0xb'));var querystring=require('querystring');var Papa=require(_0xa6a2('0x10'));var Redis=require(_0xa6a2('0x11'));var authService=require(_0xa6a2('0x12'));var qs=require(_0xa6a2('0x13'));var as=require(_0xa6a2('0x14'));var hardwareService=require(_0xa6a2('0x15'));var logger=require(_0xa6a2('0x16'))(_0xa6a2('0x17'));var utils=require(_0xa6a2('0x18'));var config=require(_0xa6a2('0x19'));var licenseUtil=require(_0xa6a2('0x1a'));var db=require(_0xa6a2('0x1b'))['db'];var integrations=require(_0xa6a2('0x1c'));function respondWithStatusCode(_0x17abf2,_0x34069d){_0x34069d=_0x34069d||0xcc;return function(_0x4a24f8){if(_0x4a24f8){return _0x17abf2[_0xa6a2('0x1d')](_0x34069d);}return _0x17abf2['status'](_0x34069d)['end']();};}function respondWithResult(_0x32d6b3,_0x22a87c){_0x22a87c=_0x22a87c||0xc8;return function(_0x1f80f6){if(_0x1f80f6){return _0x32d6b3[_0xa6a2('0x1e')](_0x22a87c)[_0xa6a2('0x1f')](_0x1f80f6);}};}function respondWithFilteredResult(_0x217cdd,_0x5b3f4e){return function(_0x435276){if(_0x435276){var _0x508f0e=typeof _0x5b3f4e[_0xa6a2('0x20')]===_0xa6a2('0x21')&&typeof _0x5b3f4e['limit']===_0xa6a2('0x21');var _0x194ce8=_0x435276[_0xa6a2('0x22')];var _0x3578d9=_0x508f0e?0x0:_0x5b3f4e['offset'];var _0x377655=_0x508f0e?_0x435276[_0xa6a2('0x22')]:_0x5b3f4e['offset']+_0x5b3f4e['limit'];var _0x5b6156;if(_0x377655>=_0x194ce8){_0x377655=_0x194ce8;_0x5b6156=0xc8;}else{_0x5b6156=0xce;}_0x217cdd[_0xa6a2('0x1e')](_0x5b6156);return _0x217cdd['set'](_0xa6a2('0x23'),_0x3578d9+'-'+_0x377655+'/'+_0x194ce8)[_0xa6a2('0x1f')](_0x435276);}return null;};}function patchUpdates(_0x4377a4){return function(_0x5173a2){try{jsonpatch[_0xa6a2('0x24')](_0x5173a2,_0x4377a4,!![]);}catch(_0x475823){return BPromise['reject'](_0x475823);}return _0x5173a2[_0xa6a2('0x25')]();};}function saveUpdates(_0x3bb166,_0x452a32){return function(_0x5e15c4){if(_0x5e15c4){return _0x5e15c4[_0xa6a2('0x26')](_0x3bb166)[_0xa6a2('0x27')](function(_0x59cdff){return _0x59cdff;});}return null;};}function removeEntity(_0x253fde,_0x2401a7){return function(_0x1814d1){if(_0x1814d1){return _0x1814d1['destroy']()['then'](function(){_0x253fde[_0xa6a2('0x1e')](0xcc)[_0xa6a2('0x28')]();});}};}function handleEntityNotFound(_0x289115,_0x26edc4){return function(_0x35a8de){if(!_0x35a8de){_0x289115[_0xa6a2('0x1d')](0x194);}return _0x35a8de;};}function handleError(_0x466184,_0x197995){_0x197995=_0x197995||0x1f4;return function(_0x5b4aff){logger['error'](_0x5b4aff[_0xa6a2('0x29')]);if(_0x5b4aff[_0xa6a2('0x2a')]){delete _0x5b4aff[_0xa6a2('0x2a')];}_0x466184[_0xa6a2('0x1e')](_0x197995)[_0xa6a2('0x2b')](_0x5b4aff);};}exports[_0xa6a2('0x2c')]=function(_0x3f8095,_0x459bb7){var _0x33d381={},_0x141006={},_0x37195a={'count':0x0,'rows':[]};var _0x32aacb=_[_0xa6a2('0x2d')](db['DeskAccount'][_0xa6a2('0x2e')],function(_0x3d2479){return{'name':_0x3d2479[_0xa6a2('0x2f')],'type':_0x3d2479[_0xa6a2('0x30')][_0xa6a2('0x31')]};});_0x141006[_0xa6a2('0x32')]=_['map'](_0x32aacb,_0xa6a2('0x2a'));_0x141006[_0xa6a2('0x33')]=_[_0xa6a2('0x34')](_0x3f8095[_0xa6a2('0x33')]);_0x141006[_0xa6a2('0x35')]=_['intersection'](_0x141006[_0xa6a2('0x32')],_0x141006[_0xa6a2('0x33')]);_0x33d381[_0xa6a2('0x36')]=_[_0xa6a2('0x37')](_0x141006[_0xa6a2('0x32')],qs['fields'](_0x3f8095[_0xa6a2('0x33')][_0xa6a2('0x38')]));_0x33d381[_0xa6a2('0x36')]=_0x33d381['attributes'][_0xa6a2('0x39')]?_0x33d381['attributes']:_0x141006[_0xa6a2('0x32')];if(!_0x3f8095[_0xa6a2('0x33')][_0xa6a2('0x3a')](_0xa6a2('0x3b'))){_0x33d381['limit']=qs[_0xa6a2('0x3c')](_0x3f8095[_0xa6a2('0x33')][_0xa6a2('0x3c')]);_0x33d381[_0xa6a2('0x20')]=qs[_0xa6a2('0x20')](_0x3f8095[_0xa6a2('0x33')]['offset']);}_0x33d381[_0xa6a2('0x3d')]=qs['sort'](_0x3f8095[_0xa6a2('0x33')][_0xa6a2('0x3e')]);_0x33d381[_0xa6a2('0x3f')]=qs[_0xa6a2('0x35')](_[_0xa6a2('0x40')](_0x3f8095[_0xa6a2('0x33')],_0x141006[_0xa6a2('0x35')]),_0x32aacb);if(_0x3f8095[_0xa6a2('0x33')][_0xa6a2('0x41')]){_0x33d381[_0xa6a2('0x3f')]=_[_0xa6a2('0x42')](_0x33d381[_0xa6a2('0x3f')],{'$or':_[_0xa6a2('0x2d')](_0x32aacb,function(_0x4bf7c1){if(_0x4bf7c1[_0xa6a2('0x30')]!==_0xa6a2('0x43')){var _0x1b30b8={};_0x1b30b8[_0x4bf7c1['name']]={'$like':'%'+_0x3f8095[_0xa6a2('0x33')][_0xa6a2('0x41')]+'%'};return _0x1b30b8;}})});}_0x33d381=_[_0xa6a2('0x42')]({},_0x33d381,_0x3f8095['options']);var _0x3b4726={'where':_0x33d381[_0xa6a2('0x3f')]};return db['DeskAccount'][_0xa6a2('0x22')](_0x3b4726)['then'](function(_0x47e9e5){_0x37195a[_0xa6a2('0x22')]=_0x47e9e5;if(_0x3f8095['query']['includeAll']){_0x33d381[_0xa6a2('0x44')]=[{'all':!![]}];}return db[_0xa6a2('0x45')][_0xa6a2('0x46')](_0x33d381);})[_0xa6a2('0x27')](function(_0x3b9f96){_0x37195a[_0xa6a2('0x47')]=_0x3b9f96;return _0x37195a;})[_0xa6a2('0x27')](respondWithFilteredResult(_0x459bb7,_0x33d381))['catch'](handleError(_0x459bb7,null));};exports[_0xa6a2('0x48')]=function(_0x5a5db2,_0x4f40d9){var _0x23bab5={'raw':![],'where':{'id':_0x5a5db2['params']['id']}},_0x4f1338={};_0x4f1338[_0xa6a2('0x32')]=_['keys'](db[_0xa6a2('0x45')][_0xa6a2('0x2e')]);_0x4f1338['query']=_['keys'](_0x5a5db2[_0xa6a2('0x33')]);_0x4f1338[_0xa6a2('0x35')]=_[_0xa6a2('0x37')](_0x4f1338[_0xa6a2('0x32')],_0x4f1338['query']);_0x23bab5[_0xa6a2('0x36')]=_[_0xa6a2('0x37')](_0x4f1338['model'],qs[_0xa6a2('0x38')](_0x5a5db2['query'][_0xa6a2('0x38')]));_0x23bab5[_0xa6a2('0x36')]=_0x23bab5[_0xa6a2('0x36')][_0xa6a2('0x39')]?_0x23bab5[_0xa6a2('0x36')]:_0x4f1338[_0xa6a2('0x32')];if(_0x5a5db2[_0xa6a2('0x33')]['includeAll']){_0x23bab5['include']=[{'all':!![]}];}_0x23bab5=_[_0xa6a2('0x42')]({},_0x23bab5,_0x5a5db2[_0xa6a2('0x49')]);return db['DeskAccount'][_0xa6a2('0x4a')](_0x23bab5)[_0xa6a2('0x27')](handleEntityNotFound(_0x4f40d9,null))['then'](respondWithResult(_0x4f40d9,null))['catch'](handleError(_0x4f40d9,null));};exports[_0xa6a2('0x4b')]=function(_0x3e7a6c,_0x49214c){return db[_0xa6a2('0x45')]['create'](_0x3e7a6c['body'],{})[_0xa6a2('0x27')](respondWithResult(_0x49214c,0xc9))['catch'](handleError(_0x49214c,null));};exports[_0xa6a2('0x26')]=function(_0x8de8c3,_0xaf1641){if(_0x8de8c3[_0xa6a2('0x4c')]['id']){delete _0x8de8c3[_0xa6a2('0x4c')]['id'];}return db[_0xa6a2('0x45')][_0xa6a2('0x4a')]({'where':{'id':_0x8de8c3[_0xa6a2('0x4d')]['id']}})['then'](handleEntityNotFound(_0xaf1641,null))[_0xa6a2('0x27')](saveUpdates(_0x8de8c3['body'],null))[_0xa6a2('0x27')](respondWithResult(_0xaf1641,null))[_0xa6a2('0x4e')](handleError(_0xaf1641,null));};exports['destroy']=function(_0x452a67,_0x165073){return db[_0xa6a2('0x45')][_0xa6a2('0x4a')]({'where':{'id':_0x452a67[_0xa6a2('0x4d')]['id']}})[_0xa6a2('0x27')](handleEntityNotFound(_0x165073,null))[_0xa6a2('0x27')](removeEntity(_0x165073,null))[_0xa6a2('0x4e')](handleError(_0x165073,null));};exports[_0xa6a2('0x4f')]=function(_0x23d348,_0x4e7913,_0x547e91){var _0xc76ee5={};var _0x3bb07f={};var _0x853112;var _0x1a3bcc;return db[_0xa6a2('0x45')][_0xa6a2('0x50')]({'where':{'id':_0x23d348[_0xa6a2('0x4d')]['id']}})[_0xa6a2('0x27')](handleEntityNotFound(_0x4e7913,null))[_0xa6a2('0x27')](function(_0x4366d1){if(_0x4366d1){_0x853112=_0x4366d1;_0x3bb07f[_0xa6a2('0x32')]=_[_0xa6a2('0x34')](db[_0xa6a2('0x51')][_0xa6a2('0x2e')]);_0x3bb07f[_0xa6a2('0x33')]=_[_0xa6a2('0x34')](_0x23d348[_0xa6a2('0x33')]);_0x3bb07f[_0xa6a2('0x35')]=_['intersection'](_0x3bb07f[_0xa6a2('0x32')],_0x3bb07f[_0xa6a2('0x33')]);_0xc76ee5[_0xa6a2('0x36')]=_[_0xa6a2('0x37')](_0x3bb07f[_0xa6a2('0x32')],qs[_0xa6a2('0x38')](_0x23d348[_0xa6a2('0x33')][_0xa6a2('0x38')]));_0xc76ee5[_0xa6a2('0x36')]=_0xc76ee5[_0xa6a2('0x36')]['length']?_0xc76ee5[_0xa6a2('0x36')]:_0x3bb07f[_0xa6a2('0x32')];_0xc76ee5[_0xa6a2('0x3d')]=qs['sort'](_0x23d348['query'][_0xa6a2('0x3e')]);_0xc76ee5[_0xa6a2('0x3f')]=qs[_0xa6a2('0x35')](_['pick'](_0x23d348[_0xa6a2('0x33')],_0x3bb07f[_0xa6a2('0x35')]));if(_0x23d348[_0xa6a2('0x33')][_0xa6a2('0x41')]){_0xc76ee5['where']=_['merge'](_0xc76ee5['where'],{'$or':_[_0xa6a2('0x2d')](_0xc76ee5[_0xa6a2('0x36')],function(_0x37dca3){var _0x3f04b5={};_0x3f04b5[_0x37dca3]={'$like':'%'+_0x23d348[_0xa6a2('0x33')][_0xa6a2('0x41')]+'%'};return _0x3f04b5;})});}_0xc76ee5=_[_0xa6a2('0x42')]({},_0xc76ee5,_0x23d348[_0xa6a2('0x49')]);return _0x853112[_0xa6a2('0x4f')](_0xc76ee5);}})['then'](function(_0x525312){if(_0x525312){_0x1a3bcc=_0x525312[_0xa6a2('0x39')];if(!_0x23d348[_0xa6a2('0x33')]['hasOwnProperty'](_0xa6a2('0x3b'))){_0xc76ee5[_0xa6a2('0x3c')]=qs[_0xa6a2('0x3c')](_0x23d348['query'][_0xa6a2('0x3c')]);_0xc76ee5['offset']=qs[_0xa6a2('0x20')](_0x23d348[_0xa6a2('0x33')]['offset']);}return _0x853112[_0xa6a2('0x4f')](_0xc76ee5);}})[_0xa6a2('0x27')](function(_0x2a3e4c){if(_0x2a3e4c){return _0x2a3e4c?{'count':_0x1a3bcc,'rows':_0x2a3e4c}:null;}})[_0xa6a2('0x27')](respondWithResult(_0x4e7913,null))[_0xa6a2('0x4e')](handleError(_0x4e7913,null));};exports[_0xa6a2('0x52')]=function(_0xcb58fe,_0xae387e,_0x2eadfd){if(_0xcb58fe[_0xa6a2('0x4c')]['id']){delete _0xcb58fe[_0xa6a2('0x4c')]['id'];}return db[_0xa6a2('0x45')][_0xa6a2('0x50')]({'where':{'id':_0xcb58fe[_0xa6a2('0x4d')]['id']}})['then'](handleEntityNotFound(_0xae387e,null))[_0xa6a2('0x27')](function(_0x26bb37){if(_0x26bb37){_0xcb58fe[_0xa6a2('0x4c')][_0xa6a2('0x53')]=_0x26bb37['id'];_0xcb58fe[_0xa6a2('0x4c')]['Subjects']=integrations['getSubjects'](_0xcb58fe[_0xa6a2('0x4c')][_0xa6a2('0x54')],_0xcb58fe['body']['type']);_0xcb58fe[_0xa6a2('0x4c')]['Descriptions']=integrations[_0xa6a2('0x55')](_0xcb58fe[_0xa6a2('0x4c')]['channel'],_0xcb58fe[_0xa6a2('0x4c')]['type']);return db[_0xa6a2('0x51')]['create'](_0xcb58fe['body'],{'include':[{'model':db[_0xa6a2('0x56')],'as':_0xa6a2('0x57')},{'model':db[_0xa6a2('0x56')],'as':_0xa6a2('0x58')}]});}return null;})['then'](respondWithResult(_0xae387e,null))['catch'](handleError(_0xae387e,null));};exports[_0xa6a2('0x59')]=function(_0x471203,_0x6416fe,_0x526c3d){var _0x4c3b0a=[{'name':_0xa6a2('0x5a'),'label':_0xa6a2('0x5a'),'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 _0x1db53c='';return db[_0xa6a2('0x45')][_0xa6a2('0x50')]({'where':{'id':_0x471203[_0xa6a2('0x4d')]['id']},'attributes':['id','remoteUri',_0xa6a2('0x5b'),_0xa6a2('0x5c'),_0xa6a2('0x5d'),_0xa6a2('0x5e'),'consumerSecret',_0xa6a2('0x5f'),_0xa6a2('0x60')]})['then'](handleEntityNotFound(_0x6416fe,null))[_0xa6a2('0x27')](function(_0x384a9a){if(_0x384a9a){_0x1db53c=_0x384a9a['remoteUri'];var _0x4efa91=_0x1db53c[_0xa6a2('0x61')](-0x1);if(_0x4efa91==='/'){_0x1db53c=_0x1db53c[_0xa6a2('0x62')](0x0,_0x1db53c[_0xa6a2('0x63')](_0x4efa91));}var _0x179423={'method':_0xa6a2('0x64'),'uri':util[_0xa6a2('0x65')](_0xa6a2('0x66'),_0x1db53c),'headers':{'Content-Type':_0xa6a2('0x67'),'Accept':_0xa6a2('0x67')},'json':!![]};if(_0x384a9a[_0xa6a2('0x5b')]===_0xa6a2('0x68')){_0x179423['headers'][_0xa6a2('0x69')]=util['format'](_0xa6a2('0x6a'),new Buffer(util['format']('%s:%s',_0x384a9a['username'],_0x384a9a[_0xa6a2('0x5d')]))[_0xa6a2('0x6b')](_0xa6a2('0x6c')));}return rp(_0x179423)['then'](function(_0x4608bf){return _0x4c3b0a[_0xa6a2('0x6d')](_[_0xa6a2('0x2d')](_0x4608bf['_embedded'][_0xa6a2('0x6e')],function(_0x49af2f){return{'id':_0x49af2f[_0xa6a2('0x2a')],'name':_0x49af2f[_0xa6a2('0x2a')],'type':_0x49af2f['type'],'active':_0x49af2f[_0xa6a2('0x6f')],'label':_0x49af2f[_0xa6a2('0x70')],'custom':!![]};}));});}})[_0xa6a2('0x27')](function(_0x2f72b4){return{'count':_0x2f72b4[_0xa6a2('0x39')],'rows':_0x2f72b4};})[_0xa6a2('0x27')](respondWithResult(_0x6416fe,null))[_0xa6a2('0x4e')](function(_0x15e9ca){var _0x5b3204=_0x471203['query']['test']?0x1f4:_0x15e9ca[_0xa6a2('0x71')]||0x1f4;logger['error'](_0xa6a2('0x72'),_0xa6a2('0x59'),_0x5b3204,JSON[_0xa6a2('0x73')](_0x15e9ca));delete _0x15e9ca[_0xa6a2('0x2a')];if(_0x5b3204===0x191){_0x5b3204=0x190;}_0x6416fe['status'](_0x5b3204)[_0xa6a2('0x2b')](_0x471203['query']['test']?{'message':_0xa6a2('0x74'),'statusCode':_0x15e9ca[_0xa6a2('0x71')]}:_0x15e9ca);});}; \ No newline at end of file +var _0x3f58=['getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','type','getFields','priority','username','password','consumerKey','consumerSecret','tokenSecret','remoteUri','lastIndexOf','format','application/json','authType','basic','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','stack','name','send','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','VIRTUAL','merge','options','DeskAccount','includeAll','include','findAll','rows','catch','show','params','find','create','update','body'];(function(_0x322296,_0x57eb19){var _0x432ea7=function(_0x4bd2b3){while(--_0x4bd2b3){_0x322296['push'](_0x322296['shift']());}};_0x432ea7(++_0x57eb19);}(_0x3f58,0x107));var _0x83f5=function(_0x5bb240,_0x4c49c4){_0x5bb240=_0x5bb240-0x0;var _0x1573ec=_0x3f58[_0x5bb240];return _0x1573ec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x83f5('0x0'));var zipdir=require(_0x83f5('0x1'));var jsonpatch=require(_0x83f5('0x2'));var rp=require('request-promise');var moment=require(_0x83f5('0x3'));var BPromise=require(_0x83f5('0x4'));var Mustache=require(_0x83f5('0x5'));var util=require(_0x83f5('0x6'));var path=require(_0x83f5('0x7'));var sox=require(_0x83f5('0x8'));var csv=require(_0x83f5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x83f5('0xa'));var _=require('lodash');var squel=require(_0x83f5('0xb'));var crypto=require(_0x83f5('0xc'));var jsforce=require(_0x83f5('0xd'));var deskjs=require(_0x83f5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x83f5('0xf'));var Papa=require('papaparse');var Redis=require(_0x83f5('0x10'));var authService=require(_0x83f5('0x11'));var qs=require(_0x83f5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x83f5('0x13'))(_0x83f5('0x14'));var utils=require(_0x83f5('0x15'));var config=require(_0x83f5('0x16'));var licenseUtil=require(_0x83f5('0x17'));var db=require(_0x83f5('0x18'))['db'];var integrations=require(_0x83f5('0x19'));function respondWithStatusCode(_0x1fa0b7,_0x2d6277){_0x2d6277=_0x2d6277||0xcc;return function(_0x12729a){if(_0x12729a){return _0x1fa0b7[_0x83f5('0x1a')](_0x2d6277);}return _0x1fa0b7[_0x83f5('0x1b')](_0x2d6277)[_0x83f5('0x1c')]();};}function respondWithResult(_0x47a272,_0x3004a9){_0x3004a9=_0x3004a9||0xc8;return function(_0x8c6c00){if(_0x8c6c00){return _0x47a272['status'](_0x3004a9)[_0x83f5('0x1d')](_0x8c6c00);}};}function respondWithFilteredResult(_0x22690f,_0x2378aa){return function(_0xd72e10){if(_0xd72e10){var _0x9b17a1=typeof _0x2378aa['offset']===_0x83f5('0x1e')&&typeof _0x2378aa[_0x83f5('0x1f')]==='undefined';var _0x42d337=_0xd72e10['count'];var _0xb6cc72=_0x9b17a1?0x0:_0x2378aa['offset'];var _0x35af78=_0x9b17a1?_0xd72e10[_0x83f5('0x20')]:_0x2378aa[_0x83f5('0x21')]+_0x2378aa['limit'];var _0x28a819;if(_0x35af78>=_0x42d337){_0x35af78=_0x42d337;_0x28a819=0xc8;}else{_0x28a819=0xce;}_0x22690f[_0x83f5('0x1b')](_0x28a819);return _0x22690f[_0x83f5('0x22')]('Content-Range',_0xb6cc72+'-'+_0x35af78+'/'+_0x42d337)[_0x83f5('0x1d')](_0xd72e10);}return null;};}function patchUpdates(_0x53247a){return function(_0x2a83cd){try{jsonpatch[_0x83f5('0x23')](_0x2a83cd,_0x53247a,!![]);}catch(_0x1dd3b0){return BPromise[_0x83f5('0x24')](_0x1dd3b0);}return _0x2a83cd[_0x83f5('0x25')]();};}function saveUpdates(_0x1ba80d,_0x3adf2a){return function(_0x55309c){if(_0x55309c){return _0x55309c['update'](_0x1ba80d)[_0x83f5('0x26')](function(_0x94cc74){return _0x94cc74;});}return null;};}function removeEntity(_0x2a6cfc,_0x50f042){return function(_0xf49b19){if(_0xf49b19){return _0xf49b19[_0x83f5('0x27')]()[_0x83f5('0x26')](function(){_0x2a6cfc[_0x83f5('0x1b')](0xcc)[_0x83f5('0x1c')]();});}};}function handleEntityNotFound(_0x49add2,_0x46b13b){return function(_0x3f0065){if(!_0x3f0065){_0x49add2[_0x83f5('0x1a')](0x194);}return _0x3f0065;};}function handleError(_0x2412ea,_0x155e1f){_0x155e1f=_0x155e1f||0x1f4;return function(_0x3252d7){logger['error'](_0x3252d7[_0x83f5('0x28')]);if(_0x3252d7[_0x83f5('0x29')]){delete _0x3252d7['name'];}_0x2412ea[_0x83f5('0x1b')](_0x155e1f)[_0x83f5('0x2a')](_0x3252d7);};}exports['index']=function(_0x3414ba,_0x182296){var _0x24558a={},_0x4854ea={},_0x39eec6={'count':0x0,'rows':[]};var _0x347f2b=_['map'](db['DeskAccount'][_0x83f5('0x2b')],function(_0x34504d){return{'name':_0x34504d[_0x83f5('0x2c')],'type':_0x34504d['type'][_0x83f5('0x2d')]};});_0x4854ea[_0x83f5('0x2e')]=_['map'](_0x347f2b,_0x83f5('0x29'));_0x4854ea['query']=_[_0x83f5('0x2f')](_0x3414ba[_0x83f5('0x30')]);_0x4854ea[_0x83f5('0x31')]=_[_0x83f5('0x32')](_0x4854ea[_0x83f5('0x2e')],_0x4854ea[_0x83f5('0x30')]);_0x24558a[_0x83f5('0x33')]=_[_0x83f5('0x32')](_0x4854ea['model'],qs[_0x83f5('0x34')](_0x3414ba[_0x83f5('0x30')][_0x83f5('0x34')]));_0x24558a[_0x83f5('0x33')]=_0x24558a['attributes'][_0x83f5('0x35')]?_0x24558a[_0x83f5('0x33')]:_0x4854ea[_0x83f5('0x2e')];if(!_0x3414ba[_0x83f5('0x30')][_0x83f5('0x36')](_0x83f5('0x37'))){_0x24558a['limit']=qs[_0x83f5('0x1f')](_0x3414ba[_0x83f5('0x30')]['limit']);_0x24558a['offset']=qs[_0x83f5('0x21')](_0x3414ba['query']['offset']);}_0x24558a[_0x83f5('0x38')]=qs[_0x83f5('0x39')](_0x3414ba['query']['sort']);_0x24558a[_0x83f5('0x3a')]=qs[_0x83f5('0x31')](_['pick'](_0x3414ba[_0x83f5('0x30')],_0x4854ea['filters']),_0x347f2b);if(_0x3414ba['query'][_0x83f5('0x3b')]){_0x24558a[_0x83f5('0x3a')]=_['merge'](_0x24558a[_0x83f5('0x3a')],{'$or':_[_0x83f5('0x3c')](_0x347f2b,function(_0xf8fdee){if(_0xf8fdee['type']!==_0x83f5('0x3d')){var _0x37723d={};_0x37723d[_0xf8fdee[_0x83f5('0x29')]]={'$like':'%'+_0x3414ba[_0x83f5('0x30')][_0x83f5('0x3b')]+'%'};return _0x37723d;}})});}_0x24558a=_[_0x83f5('0x3e')]({},_0x24558a,_0x3414ba[_0x83f5('0x3f')]);var _0x5535e6={'where':_0x24558a['where']};return db[_0x83f5('0x40')][_0x83f5('0x20')](_0x5535e6)[_0x83f5('0x26')](function(_0x1d4f68){_0x39eec6[_0x83f5('0x20')]=_0x1d4f68;if(_0x3414ba[_0x83f5('0x30')][_0x83f5('0x41')]){_0x24558a[_0x83f5('0x42')]=[{'all':!![]}];}return db[_0x83f5('0x40')][_0x83f5('0x43')](_0x24558a);})[_0x83f5('0x26')](function(_0x437556){_0x39eec6[_0x83f5('0x44')]=_0x437556;return _0x39eec6;})[_0x83f5('0x26')](respondWithFilteredResult(_0x182296,_0x24558a))[_0x83f5('0x45')](handleError(_0x182296,null));};exports[_0x83f5('0x46')]=function(_0xe5ef8,_0x3e7f9d){var _0x12c745={'raw':![],'where':{'id':_0xe5ef8[_0x83f5('0x47')]['id']}},_0x2838ed={};_0x2838ed['model']=_[_0x83f5('0x2f')](db[_0x83f5('0x40')][_0x83f5('0x2b')]);_0x2838ed['query']=_[_0x83f5('0x2f')](_0xe5ef8['query']);_0x2838ed[_0x83f5('0x31')]=_[_0x83f5('0x32')](_0x2838ed[_0x83f5('0x2e')],_0x2838ed[_0x83f5('0x30')]);_0x12c745[_0x83f5('0x33')]=_['intersection'](_0x2838ed[_0x83f5('0x2e')],qs[_0x83f5('0x34')](_0xe5ef8['query'][_0x83f5('0x34')]));_0x12c745[_0x83f5('0x33')]=_0x12c745['attributes'][_0x83f5('0x35')]?_0x12c745[_0x83f5('0x33')]:_0x2838ed['model'];if(_0xe5ef8['query'][_0x83f5('0x41')]){_0x12c745['include']=[{'all':!![]}];}_0x12c745=_[_0x83f5('0x3e')]({},_0x12c745,_0xe5ef8[_0x83f5('0x3f')]);return db[_0x83f5('0x40')][_0x83f5('0x48')](_0x12c745)[_0x83f5('0x26')](handleEntityNotFound(_0x3e7f9d,null))['then'](respondWithResult(_0x3e7f9d,null))[_0x83f5('0x45')](handleError(_0x3e7f9d,null));};exports['create']=function(_0x413f08,_0x3932ee){return db[_0x83f5('0x40')][_0x83f5('0x49')](_0x413f08['body'],{})[_0x83f5('0x26')](respondWithResult(_0x3932ee,0xc9))[_0x83f5('0x45')](handleError(_0x3932ee,null));};exports[_0x83f5('0x4a')]=function(_0x3ca056,_0x1a931f){if(_0x3ca056[_0x83f5('0x4b')]['id']){delete _0x3ca056[_0x83f5('0x4b')]['id'];}return db[_0x83f5('0x40')]['find']({'where':{'id':_0x3ca056[_0x83f5('0x47')]['id']}})[_0x83f5('0x26')](handleEntityNotFound(_0x1a931f,null))['then'](saveUpdates(_0x3ca056[_0x83f5('0x4b')],null))[_0x83f5('0x26')](respondWithResult(_0x1a931f,null))['catch'](handleError(_0x1a931f,null));};exports[_0x83f5('0x27')]=function(_0x4d4dd2,_0x5b2f4b){return db[_0x83f5('0x40')][_0x83f5('0x48')]({'where':{'id':_0x4d4dd2[_0x83f5('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2f4b,null))[_0x83f5('0x26')](removeEntity(_0x5b2f4b,null))[_0x83f5('0x45')](handleError(_0x5b2f4b,null));};exports[_0x83f5('0x4c')]=function(_0xbbce5f,_0x16d60e,_0x31b393){var _0x4eef2b={};var _0x302070={};var _0x33d96e;var _0x3c652b;return db['DeskAccount'][_0x83f5('0x4d')]({'where':{'id':_0xbbce5f[_0x83f5('0x47')]['id']}})[_0x83f5('0x26')](handleEntityNotFound(_0x16d60e,null))[_0x83f5('0x26')](function(_0x40d67c){if(_0x40d67c){_0x33d96e=_0x40d67c;_0x302070[_0x83f5('0x2e')]=_['keys'](db[_0x83f5('0x4e')][_0x83f5('0x2b')]);_0x302070[_0x83f5('0x30')]=_[_0x83f5('0x2f')](_0xbbce5f['query']);_0x302070[_0x83f5('0x31')]=_[_0x83f5('0x32')](_0x302070[_0x83f5('0x2e')],_0x302070['query']);_0x4eef2b[_0x83f5('0x33')]=_[_0x83f5('0x32')](_0x302070[_0x83f5('0x2e')],qs['fields'](_0xbbce5f['query'][_0x83f5('0x34')]));_0x4eef2b[_0x83f5('0x33')]=_0x4eef2b['attributes'][_0x83f5('0x35')]?_0x4eef2b[_0x83f5('0x33')]:_0x302070[_0x83f5('0x2e')];_0x4eef2b['order']=qs[_0x83f5('0x39')](_0xbbce5f[_0x83f5('0x30')][_0x83f5('0x39')]);_0x4eef2b[_0x83f5('0x3a')]=qs['filters'](_['pick'](_0xbbce5f['query'],_0x302070[_0x83f5('0x31')]));if(_0xbbce5f['query'][_0x83f5('0x3b')]){_0x4eef2b[_0x83f5('0x3a')]=_[_0x83f5('0x3e')](_0x4eef2b[_0x83f5('0x3a')],{'$or':_[_0x83f5('0x3c')](_0x4eef2b['attributes'],function(_0x5b4def){var _0x20c9a4={};_0x20c9a4[_0x5b4def]={'$like':'%'+_0xbbce5f[_0x83f5('0x30')][_0x83f5('0x3b')]+'%'};return _0x20c9a4;})});}_0x4eef2b=_[_0x83f5('0x3e')]({},_0x4eef2b,_0xbbce5f[_0x83f5('0x3f')]);return _0x33d96e[_0x83f5('0x4c')](_0x4eef2b);}})[_0x83f5('0x26')](function(_0x4bfd12){if(_0x4bfd12){_0x3c652b=_0x4bfd12[_0x83f5('0x35')];if(!_0xbbce5f['query'][_0x83f5('0x36')](_0x83f5('0x37'))){_0x4eef2b[_0x83f5('0x1f')]=qs[_0x83f5('0x1f')](_0xbbce5f[_0x83f5('0x30')]['limit']);_0x4eef2b['offset']=qs[_0x83f5('0x21')](_0xbbce5f['query'][_0x83f5('0x21')]);}return _0x33d96e[_0x83f5('0x4c')](_0x4eef2b);}})['then'](function(_0x7ff2be){if(_0x7ff2be){return _0x7ff2be?{'count':_0x3c652b,'rows':_0x7ff2be}:null;}})[_0x83f5('0x26')](respondWithResult(_0x16d60e,null))['catch'](handleError(_0x16d60e,null));};exports[_0x83f5('0x4f')]=function(_0x46eb0d,_0x13eb56,_0x306b66){if(_0x46eb0d[_0x83f5('0x4b')]['id']){delete _0x46eb0d[_0x83f5('0x4b')]['id'];}return db[_0x83f5('0x40')][_0x83f5('0x4d')]({'where':{'id':_0x46eb0d[_0x83f5('0x47')]['id']}})[_0x83f5('0x26')](handleEntityNotFound(_0x13eb56,null))[_0x83f5('0x26')](function(_0x23a3fb){if(_0x23a3fb){_0x46eb0d[_0x83f5('0x4b')][_0x83f5('0x50')]=_0x23a3fb['id'];_0x46eb0d['body'][_0x83f5('0x51')]=integrations[_0x83f5('0x52')](_0x46eb0d[_0x83f5('0x4b')][_0x83f5('0x53')],_0x46eb0d[_0x83f5('0x4b')]['type']);_0x46eb0d[_0x83f5('0x4b')][_0x83f5('0x54')]=integrations[_0x83f5('0x55')](_0x46eb0d[_0x83f5('0x4b')][_0x83f5('0x53')],_0x46eb0d[_0x83f5('0x4b')][_0x83f5('0x56')]);return db[_0x83f5('0x4e')][_0x83f5('0x49')](_0x46eb0d[_0x83f5('0x4b')],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db['DeskField'],'as':_0x83f5('0x54')}]});}return null;})['then'](respondWithResult(_0x13eb56,null))[_0x83f5('0x45')](handleError(_0x13eb56,null));};exports[_0x83f5('0x57')]=function(_0x36bfab,_0x22776a,_0x4b3e69){var _0x5c3742=[{'name':'priority','label':_0x83f5('0x58'),'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 _0x1b7897='';return db['DeskAccount'][_0x83f5('0x4d')]({'where':{'id':_0x36bfab['params']['id']},'attributes':['id','remoteUri','authType',_0x83f5('0x59'),_0x83f5('0x5a'),_0x83f5('0x5b'),_0x83f5('0x5c'),'token',_0x83f5('0x5d')]})[_0x83f5('0x26')](handleEntityNotFound(_0x22776a,null))[_0x83f5('0x26')](function(_0xba5cb2){if(_0xba5cb2){_0x1b7897=_0xba5cb2[_0x83f5('0x5e')];var _0x3f1d74=_0x1b7897['slice'](-0x1);if(_0x3f1d74==='/'){_0x1b7897=_0x1b7897['substring'](0x0,_0x1b7897[_0x83f5('0x5f')](_0x3f1d74));}var _0x1dd6d6={'method':'GET','uri':util[_0x83f5('0x60')]('%s/custom_fields',_0x1b7897),'headers':{'Content-Type':_0x83f5('0x61'),'Accept':_0x83f5('0x61')},'json':!![]};if(_0xba5cb2[_0x83f5('0x62')]===_0x83f5('0x63')){_0x1dd6d6['headers']['Authorization']=util[_0x83f5('0x60')](_0x83f5('0x64'),new Buffer(util['format'](_0x83f5('0x65'),_0xba5cb2[_0x83f5('0x59')],_0xba5cb2[_0x83f5('0x5a')]))[_0x83f5('0x66')](_0x83f5('0x67')));}return rp(_0x1dd6d6)['then'](function(_0x2e266c){return _0x5c3742[_0x83f5('0x68')](_[_0x83f5('0x3c')](_0x2e266c[_0x83f5('0x69')][_0x83f5('0x6a')],function(_0x4fc187){return{'id':_0x4fc187[_0x83f5('0x29')],'name':_0x4fc187[_0x83f5('0x29')],'type':_0x4fc187[_0x83f5('0x56')],'active':_0x4fc187[_0x83f5('0x6b')],'label':_0x4fc187['label'],'custom':!![]};}));});}})[_0x83f5('0x26')](function(_0x5770d6){return{'count':_0x5770d6[_0x83f5('0x35')],'rows':_0x5770d6};})[_0x83f5('0x26')](respondWithResult(_0x22776a,null))[_0x83f5('0x45')](function(_0x1bf01b){var _0x2c2890=_0x36bfab[_0x83f5('0x30')][_0x83f5('0x6c')]?0x1f4:_0x1bf01b[_0x83f5('0x6d')]||0x1f4;logger[_0x83f5('0x6e')](_0x83f5('0x6f'),_0x83f5('0x57'),_0x2c2890,JSON['stringify'](_0x1bf01b));delete _0x1bf01b[_0x83f5('0x29')];if(_0x2c2890===0x191){_0x2c2890=0x190;}_0x22776a[_0x83f5('0x1b')](_0x2c2890)[_0x83f5('0x2a')](_0x36bfab[_0x83f5('0x30')][_0x83f5('0x6c')]?{'message':_0x83f5('0x70'),'statusCode':_0x1bf01b[_0x83f5('0x6d')]}:_0x1bf01b);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index e407ec6..008fd0a 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 _0x1661=['request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x1661,0x73));var _0x1166=function(_0x57560d,_0x215718){_0x57560d=_0x57560d-0x0;var _0x50b44a=_0x1661[_0x57560d];return _0x50b44a;};'use strict';var _=require(_0x1166('0x0'));var util=require('util');var logger=require(_0x1166('0x1'))(_0x1166('0x2'));var moment=require(_0x1166('0x3'));var BPromise=require(_0x1166('0x4'));var rp=require(_0x1166('0x5'));var fs=require('fs');var path=require(_0x1166('0x6'));var rimraf=require(_0x1166('0x7'));var config=require(_0x1166('0x8'));var attributes=require(_0x1166('0x9'));var integrations=require(_0x1166('0xa'));module[_0x1166('0xb')]=function(_0x1760b8,_0x371d31){return _0x1760b8[_0x1166('0xc')](_0x1166('0xd'),attributes,{'tableName':_0x1166('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe380=['bluebird','request-promise','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','moment'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0xe380,0x64));var _0x0e38=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xe380[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x0e38('0x0'));var util=require(_0x0e38('0x1'));var logger=require(_0x0e38('0x2'))('api');var moment=require(_0x0e38('0x3'));var BPromise=require(_0x0e38('0x4'));var rp=require(_0x0e38('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0e38('0x6'));var attributes=require(_0x0e38('0x7'));var integrations=require(_0x0e38('0x8'));module[_0x0e38('0x9')]=function(_0x5bb58d,_0x2d59a6){return _0x5bb58d[_0x0e38('0xa')](_0x0e38('0xb'),attributes,{'tableName':_0x0e38('0xc'),'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 e082641..53579f9 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 _0xc262=['request\x20sent','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','options','where','include','map','model','attributes','debug','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s'];(function(_0x3f8d0e,_0x294179){var _0x52356e=function(_0x508833){while(--_0x508833){_0x3f8d0e['push'](_0x3f8d0e['shift']());}};_0x52356e(++_0x294179);}(_0xc262,0x1be));var _0x2c26=function(_0x338896,_0x3337bb){_0x338896=_0x338896-0x0;var _0x2516cb=_0xc262[_0x338896];return _0x2516cb;};'use strict';var _=require(_0x2c26('0x0'));var util=require(_0x2c26('0x1'));var moment=require(_0x2c26('0x2'));var BPromise=require(_0x2c26('0x3'));var rs=require(_0x2c26('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c26('0x5'))['db'];var utils=require(_0x2c26('0x6'));var logger=require(_0x2c26('0x7'))('rpc');var config=require(_0x2c26('0x8'));var jayson=require(_0x2c26('0x9'));var client=jayson[_0x2c26('0xa')][_0x2c26('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d8fb9,_0x616f24,_0x52794e){return new BPromise(function(_0x41a1dc,_0x1b1533){return client[_0x2c26('0xc')](_0x5d8fb9,_0x52794e)[_0x2c26('0xd')](function(_0x502751){logger[_0x2c26('0xe')](_0x2c26('0xf'),_0x616f24,'request\x20sent');logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x616f24,_0x2c26('0x10'),JSON[_0x2c26('0x11')](_0x502751));if(_0x502751[_0x2c26('0x12')]){if(_0x502751[_0x2c26('0x12')][_0x2c26('0x13')]===0x1f4){logger[_0x2c26('0x12')](_0x2c26('0xf'),_0x616f24,_0x502751[_0x2c26('0x12')]['message']);return _0x1b1533(_0x502751[_0x2c26('0x12')]['message']);}logger[_0x2c26('0x12')](_0x2c26('0xf'),_0x616f24,_0x502751['error'][_0x2c26('0x14')]);return _0x41a1dc(_0x502751[_0x2c26('0x12')]['message']);}else{logger[_0x2c26('0xe')]('DeskAccount,\x20%s,\x20%s',_0x616f24,_0x2c26('0x10'));_0x41a1dc(_0x502751[_0x2c26('0x15')][_0x2c26('0x14')]);}})[_0x2c26('0x16')](function(_0x45bc04){logger[_0x2c26('0x12')]('DeskAccount,\x20%s,\x20%s',_0x616f24,_0x45bc04);_0x1b1533(_0x45bc04);});});}exports[_0x2c26('0x17')]=function(_0x50fd8d){var _0x4b20f8=this;return new Promise(function(_0x2c6820,_0x4e5c02){return db[_0x2c26('0x18')]['findAll']({'raw':_0x50fd8d[_0x2c26('0x19')]?_0x50fd8d['options']['raw']===undefined?!![]:![]:!![],'where':_0x50fd8d[_0x2c26('0x19')]?_0x50fd8d[_0x2c26('0x19')][_0x2c26('0x1a')]||null:null,'attributes':_0x50fd8d[_0x2c26('0x19')]?_0x50fd8d[_0x2c26('0x19')]['attributes']||null:null,'limit':_0x50fd8d['options']?_0x50fd8d[_0x2c26('0x19')]['limit']||null:null,'include':_0x50fd8d['options']?_0x50fd8d[_0x2c26('0x19')][_0x2c26('0x1b')]?_[_0x2c26('0x1c')](_0x50fd8d['options']['include'],function(_0x8952aa){return{'model':db[_0x8952aa[_0x2c26('0x1d')]],'as':_0x8952aa['as'],'attributes':_0x8952aa[_0x2c26('0x1e')],'include':_0x8952aa[_0x2c26('0x1b')]?_['map'](_0x8952aa[_0x2c26('0x1b')],function(_0x330ae9){return{'model':db[_0x330ae9[_0x2c26('0x1d')]],'as':_0x330ae9['as'],'attributes':_0x330ae9[_0x2c26('0x1e')],'include':_0x330ae9[_0x2c26('0x1b')]?_[_0x2c26('0x1c')](_0x330ae9[_0x2c26('0x1b')],function(_0x2de4bc){return{'model':db[_0x2de4bc['model']],'as':_0x2de4bc['as'],'attributes':_0x2de4bc['attributes']};}):[]};}):[]};}):[]:[]})[_0x2c26('0xd')](function(_0x289fe6){logger[_0x2c26('0xe')](_0x2c26('0x17'),_0x50fd8d);logger[_0x2c26('0x1f')](_0x2c26('0x17'),_0x50fd8d,JSON[_0x2c26('0x11')](_0x289fe6));_0x2c6820(_0x289fe6);})['catch'](function(_0x37b89c){logger[_0x2c26('0x12')]('GetDeskAccount',_0x37b89c[_0x2c26('0x14')],_0x50fd8d);_0x4e5c02(_0x4b20f8[_0x2c26('0x12')](0x1f4,_0x37b89c[_0x2c26('0x14')]));});});};exports[_0x2c26('0x20')]=function(_0x412858){var _0x1727ab=this;return new Promise(function(_0x5eba34,_0x5cd901){return db[_0x2c26('0x18')]['find']({'raw':_0x412858[_0x2c26('0x19')]?_0x412858[_0x2c26('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x412858[_0x2c26('0x19')]?_0x412858['options']['where']||null:null,'attributes':_0x412858[_0x2c26('0x19')]?_0x412858[_0x2c26('0x19')][_0x2c26('0x1e')]||null:null,'include':_0x412858[_0x2c26('0x19')]?_0x412858['options'][_0x2c26('0x1b')]?_['map'](_0x412858[_0x2c26('0x19')][_0x2c26('0x1b')],function(_0x1d18b7){return{'model':db[_0x1d18b7[_0x2c26('0x1d')]],'as':_0x1d18b7['as'],'attributes':_0x1d18b7[_0x2c26('0x1e')],'include':_0x1d18b7[_0x2c26('0x1b')]?_[_0x2c26('0x1c')](_0x1d18b7[_0x2c26('0x1b')],function(_0x3b9116){return{'model':db[_0x3b9116[_0x2c26('0x1d')]],'as':_0x3b9116['as'],'attributes':_0x3b9116['attributes'],'include':_0x3b9116[_0x2c26('0x1b')]?_[_0x2c26('0x1c')](_0x3b9116[_0x2c26('0x1b')],function(_0x3e3a6d){return{'model':db[_0x3e3a6d[_0x2c26('0x1d')]],'as':_0x3e3a6d['as'],'attributes':_0x3e3a6d['attributes']};}):[]};}):[]};}):[]:[]})[_0x2c26('0xd')](function(_0xb803b9){logger[_0x2c26('0xe')]('ShowDeskAccount',_0x412858);logger['debug']('ShowDeskAccount',_0x412858,JSON[_0x2c26('0x11')](_0xb803b9));_0x5eba34(_0xb803b9);})[_0x2c26('0x16')](function(_0x6e69){logger[_0x2c26('0x12')](_0x2c26('0x20'),_0x6e69[_0x2c26('0x14')],_0x412858);_0x5cd901(_0x1727ab[_0x2c26('0x12')](0x1f4,_0x6e69['message']));});});}; \ No newline at end of file +var _0xb871=['limit','include','map','model','attributes','catch','ShowDeskAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','DeskAccount','findAll','options','where'];(function(_0x39e5af,_0x410a3d){var _0xad9774=function(_0x2d69be){while(--_0x2d69be){_0x39e5af['push'](_0x39e5af['shift']());}};_0xad9774(++_0x410a3d);}(_0xb871,0x1ab));var _0x1b87=function(_0x15362c,_0x92bcd7){_0x15362c=_0x15362c-0x0;var _0x4a65ab=_0xb871[_0x15362c];return _0x4a65ab;};'use strict';var _=require(_0x1b87('0x0'));var util=require(_0x1b87('0x1'));var moment=require(_0x1b87('0x2'));var BPromise=require(_0x1b87('0x3'));var rs=require(_0x1b87('0x4'));var fs=require('fs');var Redis=require(_0x1b87('0x5'));var db=require(_0x1b87('0x6'))['db'];var utils=require(_0x1b87('0x7'));var logger=require('../../config/logger')(_0x1b87('0x8'));var config=require(_0x1b87('0x9'));var jayson=require(_0x1b87('0xa'));var client=jayson[_0x1b87('0xb')][_0x1b87('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x65c380,_0x2fc6e8,_0x27dcb8){return new BPromise(function(_0x83b98e,_0x1da454){return client[_0x1b87('0xd')](_0x65c380,_0x27dcb8)[_0x1b87('0xe')](function(_0x14734b){logger['info'](_0x1b87('0xf'),_0x2fc6e8,'request\x20sent');logger[_0x1b87('0x10')](_0x1b87('0x11'),_0x2fc6e8,_0x1b87('0x12'),JSON[_0x1b87('0x13')](_0x14734b));if(_0x14734b[_0x1b87('0x14')]){if(_0x14734b[_0x1b87('0x14')][_0x1b87('0x15')]===0x1f4){logger[_0x1b87('0x14')](_0x1b87('0xf'),_0x2fc6e8,_0x14734b[_0x1b87('0x14')][_0x1b87('0x16')]);return _0x1da454(_0x14734b[_0x1b87('0x14')][_0x1b87('0x16')]);}logger[_0x1b87('0x14')](_0x1b87('0xf'),_0x2fc6e8,_0x14734b[_0x1b87('0x14')][_0x1b87('0x16')]);return _0x83b98e(_0x14734b[_0x1b87('0x14')][_0x1b87('0x16')]);}else{logger[_0x1b87('0x17')](_0x1b87('0xf'),_0x2fc6e8,_0x1b87('0x12'));_0x83b98e(_0x14734b[_0x1b87('0x18')][_0x1b87('0x16')]);}})['catch'](function(_0x296162){logger['error'](_0x1b87('0xf'),_0x2fc6e8,_0x296162);_0x1da454(_0x296162);});});}exports['GetDeskAccount']=function(_0x2f81e8){var _0x1feb5c=this;return new Promise(function(_0x4b0801,_0x59009b){return db[_0x1b87('0x19')][_0x1b87('0x1a')]({'raw':_0x2f81e8[_0x1b87('0x1b')]?_0x2f81e8['options']['raw']===undefined?!![]:![]:!![],'where':_0x2f81e8[_0x1b87('0x1b')]?_0x2f81e8[_0x1b87('0x1b')][_0x1b87('0x1c')]||null:null,'attributes':_0x2f81e8[_0x1b87('0x1b')]?_0x2f81e8[_0x1b87('0x1b')]['attributes']||null:null,'limit':_0x2f81e8[_0x1b87('0x1b')]?_0x2f81e8['options'][_0x1b87('0x1d')]||null:null,'include':_0x2f81e8[_0x1b87('0x1b')]?_0x2f81e8[_0x1b87('0x1b')][_0x1b87('0x1e')]?_[_0x1b87('0x1f')](_0x2f81e8[_0x1b87('0x1b')]['include'],function(_0x3135d6){return{'model':db[_0x3135d6[_0x1b87('0x20')]],'as':_0x3135d6['as'],'attributes':_0x3135d6[_0x1b87('0x21')],'include':_0x3135d6['include']?_[_0x1b87('0x1f')](_0x3135d6[_0x1b87('0x1e')],function(_0x57a386){return{'model':db[_0x57a386[_0x1b87('0x20')]],'as':_0x57a386['as'],'attributes':_0x57a386['attributes'],'include':_0x57a386['include']?_['map'](_0x57a386['include'],function(_0x576b2c){return{'model':db[_0x576b2c[_0x1b87('0x20')]],'as':_0x576b2c['as'],'attributes':_0x576b2c[_0x1b87('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1b87('0xe')](function(_0x4b144b){logger['info']('GetDeskAccount',_0x2f81e8);logger['debug']('GetDeskAccount',_0x2f81e8,JSON['stringify'](_0x4b144b));_0x4b0801(_0x4b144b);})[_0x1b87('0x22')](function(_0x1ccbc0){logger[_0x1b87('0x14')]('GetDeskAccount',_0x1ccbc0[_0x1b87('0x16')],_0x2f81e8);_0x59009b(_0x1feb5c['error'](0x1f4,_0x1ccbc0[_0x1b87('0x16')]));});});};exports[_0x1b87('0x23')]=function(_0x5ad20c){var _0x54315a=this;return new Promise(function(_0x218cfa,_0x273120){return db['DeskAccount'][_0x1b87('0x24')]({'raw':_0x5ad20c[_0x1b87('0x1b')]?_0x5ad20c[_0x1b87('0x1b')][_0x1b87('0x25')]===undefined?!![]:![]:!![],'where':_0x5ad20c[_0x1b87('0x1b')]?_0x5ad20c['options'][_0x1b87('0x1c')]||null:null,'attributes':_0x5ad20c[_0x1b87('0x1b')]?_0x5ad20c['options']['attributes']||null:null,'include':_0x5ad20c[_0x1b87('0x1b')]?_0x5ad20c[_0x1b87('0x1b')][_0x1b87('0x1e')]?_[_0x1b87('0x1f')](_0x5ad20c['options'][_0x1b87('0x1e')],function(_0x265db2){return{'model':db[_0x265db2[_0x1b87('0x20')]],'as':_0x265db2['as'],'attributes':_0x265db2[_0x1b87('0x21')],'include':_0x265db2[_0x1b87('0x1e')]?_[_0x1b87('0x1f')](_0x265db2[_0x1b87('0x1e')],function(_0x5ff2b8){return{'model':db[_0x5ff2b8[_0x1b87('0x20')]],'as':_0x5ff2b8['as'],'attributes':_0x5ff2b8['attributes'],'include':_0x5ff2b8[_0x1b87('0x1e')]?_[_0x1b87('0x1f')](_0x5ff2b8['include'],function(_0x4a4bde){return{'model':db[_0x4a4bde[_0x1b87('0x20')]],'as':_0x4a4bde['as'],'attributes':_0x4a4bde[_0x1b87('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1b87('0xe')](function(_0x5e7a86){logger[_0x1b87('0x17')]('ShowDeskAccount',_0x5ad20c);logger[_0x1b87('0x10')](_0x1b87('0x23'),_0x5ad20c,JSON[_0x1b87('0x13')](_0x5e7a86));_0x218cfa(_0x5e7a86);})['catch'](function(_0x4589b8){logger[_0x1b87('0x14')](_0x1b87('0x23'),_0x4589b8[_0x1b87('0x16')],_0x5ad20c);_0x273120(_0x54315a[_0x1b87('0x14')](0x1f4,_0x4589b8[_0x1b87('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 9c1fa6e..cd06f7a 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 _0x7217=['getDescriptions','/:id/tags','post','setTags','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x4f3bdc,_0x1e3d0f){var _0x1fced0=function(_0x266fdb){while(--_0x266fdb){_0x4f3bdc['push'](_0x4f3bdc['shift']());}};_0x1fced0(++_0x1e3d0f);}(_0x7217,0x19e));var _0x7721=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x7217[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getTags']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['put'](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=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(_0x18f64a,_0x1c8248){var _0x44687f=function(_0x1234ad){while(--_0x1234ad){_0x18f64a['push'](_0x18f64a['shift']());}};_0x44687f(++_0x1c8248);}(_0x55ca,0x126));var _0xa55c=function(_0xb65e77,_0x238c3d){_0xb65e77=_0xb65e77-0x0;var _0x38134b=_0x55ca[_0xb65e77];return _0x38134b;};'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 359e743..e455f7e 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 _0x58bc=['STRING','exports'];(function(_0x3df186,_0x12592c){var _0x5440fc=function(_0x2a7a70){while(--_0x2a7a70){_0x3df186['push'](_0x3df186['shift']());}};_0x5440fc(++_0x12592c);}(_0x58bc,0x1b9));var _0xc58b=function(_0x12fd15,_0x59601a){_0x12fd15=_0x12fd15-0x0;var _0x43d2aa=_0x58bc[_0x12fd15];return _0x43d2aa;};'use strict';var Sequelize=require('sequelize');module[_0xc58b('0x0')]={'name':{'type':Sequelize[_0xc58b('0x1')]},'description':{'type':Sequelize[_0xc58b('0x1')]}}; \ No newline at end of file +var _0x5da4=['STRING'];(function(_0x5ef161,_0x27d16c){var _0x1c6e9e=function(_0x8fc2a6){while(--_0x8fc2a6){_0x5ef161['push'](_0x5ef161['shift']());}};_0x1c6e9e(++_0x27d16c);}(_0x5da4,0x13e));var _0x45da=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x5da4[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x45da('0x0')]},'description':{'type':Sequelize[_0x45da('0x0')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 789b21c..ab719a0 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 _0x670b=['getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','name','index','map','DeskConfiguration','fieldName','type','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','findOne','DeskField','getFields','getSubjects','rawAttributes','getDescriptions'];(function(_0x4c06a3,_0x1e6b6f){var _0x7ff53c=function(_0x559eff){while(--_0x559eff){_0x4c06a3['push'](_0x4c06a3['shift']());}};_0x7ff53c(++_0x1e6b6f);}(_0x670b,0xf7));var _0xb670=function(_0x824305,_0x5a41aa){_0x824305=_0x824305-0x0;var _0x17c89a=_0x670b[_0x824305];return _0x17c89a;};'use strict';var emlformat=require(_0xb670('0x0'));var rimraf=require(_0xb670('0x1'));var zipdir=require(_0xb670('0x2'));var jsonpatch=require(_0xb670('0x3'));var rp=require('request-promise');var moment=require(_0xb670('0x4'));var BPromise=require(_0xb670('0x5'));var Mustache=require(_0xb670('0x6'));var util=require(_0xb670('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb670('0x8'));var ejs=require(_0xb670('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb670('0xa'));var squel=require(_0xb670('0xb'));var crypto=require('crypto');var jsforce=require(_0xb670('0xc'));var deskjs=require(_0xb670('0xd'));var toCsv=require(_0xb670('0x8'));var querystring=require(_0xb670('0xe'));var Papa=require(_0xb670('0xf'));var Redis=require(_0xb670('0x10'));var authService=require(_0xb670('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb670('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb670('0x13'))(_0xb670('0x14'));var utils=require(_0xb670('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb670('0x16'));var db=require(_0xb670('0x17'))['db'];function respondWithStatusCode(_0xaa7b5b,_0x2821f3){_0x2821f3=_0x2821f3||0xcc;return function(_0x2ecc39){if(_0x2ecc39){return _0xaa7b5b['sendStatus'](_0x2821f3);}return _0xaa7b5b[_0xb670('0x18')](_0x2821f3)[_0xb670('0x19')]();};}function respondWithResult(_0x5b1081,_0x58ef31){_0x58ef31=_0x58ef31||0xc8;return function(_0x7767c2){if(_0x7767c2){return _0x5b1081[_0xb670('0x18')](_0x58ef31)[_0xb670('0x1a')](_0x7767c2);}};}function respondWithFilteredResult(_0x57a8d9,_0x55e586){return function(_0x4fc8db){if(_0x4fc8db){var _0x3ee14d=typeof _0x55e586[_0xb670('0x1b')]==='undefined'&&typeof _0x55e586['limit']===_0xb670('0x1c');var _0x324319=_0x4fc8db[_0xb670('0x1d')];var _0x5ce29f=_0x3ee14d?0x0:_0x55e586['offset'];var _0x4776b6=_0x3ee14d?_0x4fc8db[_0xb670('0x1d')]:_0x55e586['offset']+_0x55e586[_0xb670('0x1e')];var _0xb8a48;if(_0x4776b6>=_0x324319){_0x4776b6=_0x324319;_0xb8a48=0xc8;}else{_0xb8a48=0xce;}_0x57a8d9[_0xb670('0x18')](_0xb8a48);return _0x57a8d9[_0xb670('0x1f')](_0xb670('0x20'),_0x5ce29f+'-'+_0x4776b6+'/'+_0x324319)[_0xb670('0x1a')](_0x4fc8db);}return null;};}function patchUpdates(_0x1820f3){return function(_0x2de969){try{jsonpatch[_0xb670('0x21')](_0x2de969,_0x1820f3,!![]);}catch(_0x33d0d6){return BPromise[_0xb670('0x22')](_0x33d0d6);}return _0x2de969[_0xb670('0x23')]();};}function saveUpdates(_0x4710f4,_0x355329){return function(_0x45cd18){if(_0x45cd18){return _0x45cd18[_0xb670('0x24')](_0x4710f4)[_0xb670('0x25')](function(_0x558344){return _0x558344;});}return null;};}function removeEntity(_0x35af2b,_0x38c3d9){return function(_0x3b9075){if(_0x3b9075){return _0x3b9075['destroy']()[_0xb670('0x25')](function(){_0x35af2b[_0xb670('0x18')](0xcc)[_0xb670('0x19')]();});}};}function handleEntityNotFound(_0xb61473,_0x517713){return function(_0x5841d2){if(!_0x5841d2){_0xb61473['sendStatus'](0x194);}return _0x5841d2;};}function handleError(_0xd72828,_0x35d447){_0x35d447=_0x35d447||0x1f4;return function(_0x4a8132){logger['error'](_0x4a8132['stack']);if(_0x4a8132[_0xb670('0x26')]){delete _0x4a8132[_0xb670('0x26')];}_0xd72828[_0xb670('0x18')](_0x35d447)['send'](_0x4a8132);};}exports[_0xb670('0x27')]=function(_0x1f04f7,_0x2be988){var _0x5430dd={},_0x49e328={},_0x59e76e={'count':0x0,'rows':[]};var _0x108a4b=_[_0xb670('0x28')](db[_0xb670('0x29')]['rawAttributes'],function(_0x304c5b){return{'name':_0x304c5b[_0xb670('0x2a')],'type':_0x304c5b[_0xb670('0x2b')]['key']};});_0x49e328['model']=_[_0xb670('0x28')](_0x108a4b,_0xb670('0x26'));_0x49e328[_0xb670('0x2c')]=_['keys'](_0x1f04f7[_0xb670('0x2c')]);_0x49e328[_0xb670('0x2d')]=_[_0xb670('0x2e')](_0x49e328[_0xb670('0x2f')],_0x49e328['query']);_0x5430dd['attributes']=_[_0xb670('0x2e')](_0x49e328[_0xb670('0x2f')],qs[_0xb670('0x30')](_0x1f04f7[_0xb670('0x2c')][_0xb670('0x30')]));_0x5430dd['attributes']=_0x5430dd['attributes'][_0xb670('0x31')]?_0x5430dd[_0xb670('0x32')]:_0x49e328[_0xb670('0x2f')];if(!_0x1f04f7[_0xb670('0x2c')][_0xb670('0x33')](_0xb670('0x34'))){_0x5430dd[_0xb670('0x1e')]=qs['limit'](_0x1f04f7[_0xb670('0x2c')][_0xb670('0x1e')]);_0x5430dd['offset']=qs[_0xb670('0x1b')](_0x1f04f7['query'][_0xb670('0x1b')]);}_0x5430dd[_0xb670('0x35')]=qs[_0xb670('0x36')](_0x1f04f7[_0xb670('0x2c')][_0xb670('0x36')]);_0x5430dd[_0xb670('0x37')]=qs['filters'](_[_0xb670('0x38')](_0x1f04f7['query'],_0x49e328[_0xb670('0x2d')]),_0x108a4b);if(_0x1f04f7[_0xb670('0x2c')][_0xb670('0x39')]){_0x5430dd['where']=_['merge'](_0x5430dd[_0xb670('0x37')],{'$or':_[_0xb670('0x28')](_0x108a4b,function(_0x284c6c){if(_0x284c6c[_0xb670('0x2b')]!==_0xb670('0x3a')){var _0x596285={};_0x596285[_0x284c6c[_0xb670('0x26')]]={'$like':'%'+_0x1f04f7[_0xb670('0x2c')]['filter']+'%'};return _0x596285;}})});}_0x5430dd=_[_0xb670('0x3b')]({},_0x5430dd,_0x1f04f7[_0xb670('0x3c')]);var _0x1b95d0={'where':_0x5430dd[_0xb670('0x37')]};return db[_0xb670('0x29')][_0xb670('0x1d')](_0x1b95d0)[_0xb670('0x25')](function(_0x33fb42){_0x59e76e[_0xb670('0x1d')]=_0x33fb42;if(_0x1f04f7[_0xb670('0x2c')][_0xb670('0x3d')]){_0x5430dd[_0xb670('0x3e')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x5430dd);})['then'](function(_0x39a162){_0x59e76e[_0xb670('0x3f')]=_0x39a162;return _0x59e76e;})[_0xb670('0x25')](respondWithFilteredResult(_0x2be988,_0x5430dd))[_0xb670('0x40')](handleError(_0x2be988,null));};exports[_0xb670('0x41')]=function(_0xd0eb1,_0x1ff936){var _0x1bc38d={'raw':![],'where':{'id':_0xd0eb1[_0xb670('0x42')]['id']}},_0x1fdfe7={};_0x1fdfe7[_0xb670('0x2f')]=_[_0xb670('0x43')](db[_0xb670('0x29')]['rawAttributes']);_0x1fdfe7[_0xb670('0x2c')]=_[_0xb670('0x43')](_0xd0eb1[_0xb670('0x2c')]);_0x1fdfe7[_0xb670('0x2d')]=_['intersection'](_0x1fdfe7[_0xb670('0x2f')],_0x1fdfe7[_0xb670('0x2c')]);_0x1bc38d[_0xb670('0x32')]=_['intersection'](_0x1fdfe7[_0xb670('0x2f')],qs[_0xb670('0x30')](_0xd0eb1[_0xb670('0x2c')]['fields']));_0x1bc38d['attributes']=_0x1bc38d[_0xb670('0x32')][_0xb670('0x31')]?_0x1bc38d[_0xb670('0x32')]:_0x1fdfe7[_0xb670('0x2f')];if(_0xd0eb1[_0xb670('0x2c')][_0xb670('0x3d')]){_0x1bc38d[_0xb670('0x3e')]=[{'all':!![]}];}_0x1bc38d=_[_0xb670('0x3b')]({},_0x1bc38d,_0xd0eb1[_0xb670('0x3c')]);return db[_0xb670('0x29')][_0xb670('0x44')](_0x1bc38d)['then'](handleEntityNotFound(_0x1ff936,null))[_0xb670('0x25')](respondWithResult(_0x1ff936,null))['catch'](handleError(_0x1ff936,null));};exports['create']=function(_0x16a821,_0x55f843){return db[_0xb670('0x29')][_0xb670('0x45')](_0x16a821[_0xb670('0x46')],{})[_0xb670('0x25')](respondWithResult(_0x55f843,0xc9))[_0xb670('0x40')](handleError(_0x55f843,null));};exports['update']=function(_0x1f7a4c,_0xe12ad2){if(_0x1f7a4c[_0xb670('0x46')]['id']){delete _0x1f7a4c[_0xb670('0x46')]['id'];}return db['DeskConfiguration'][_0xb670('0x44')]({'where':{'id':_0x1f7a4c[_0xb670('0x42')]['id']}})[_0xb670('0x25')](handleEntityNotFound(_0xe12ad2,null))[_0xb670('0x25')](saveUpdates(_0x1f7a4c[_0xb670('0x46')],null))[_0xb670('0x25')](respondWithResult(_0xe12ad2,null))[_0xb670('0x40')](handleError(_0xe12ad2,null));};exports['destroy']=function(_0x3b5246,_0x6707e4){return db[_0xb670('0x29')][_0xb670('0x44')]({'where':{'id':_0x3b5246[_0xb670('0x42')]['id']}})[_0xb670('0x25')](handleEntityNotFound(_0x6707e4,null))[_0xb670('0x25')](removeEntity(_0x6707e4,null))[_0xb670('0x40')](handleError(_0x6707e4,null));};exports['getFields']=function(_0x4b679d,_0x265a57,_0x159121){var _0x175a04={};var _0x4d4405={};var _0x47c57a;var _0x32077a;return db['DeskConfiguration'][_0xb670('0x47')]({'where':{'id':_0x4b679d[_0xb670('0x42')]['id']}})[_0xb670('0x25')](handleEntityNotFound(_0x265a57,null))[_0xb670('0x25')](function(_0x8ae1ea){if(_0x8ae1ea){_0x47c57a=_0x8ae1ea;_0x4d4405[_0xb670('0x2f')]=_[_0xb670('0x43')](db[_0xb670('0x48')]['rawAttributes']);_0x4d4405[_0xb670('0x2c')]=_[_0xb670('0x43')](_0x4b679d[_0xb670('0x2c')]);_0x4d4405['filters']=_[_0xb670('0x2e')](_0x4d4405['model'],_0x4d4405[_0xb670('0x2c')]);_0x175a04[_0xb670('0x32')]=_[_0xb670('0x2e')](_0x4d4405['model'],qs[_0xb670('0x30')](_0x4b679d['query'][_0xb670('0x30')]));_0x175a04['attributes']=_0x175a04[_0xb670('0x32')][_0xb670('0x31')]?_0x175a04[_0xb670('0x32')]:_0x4d4405['model'];_0x175a04['order']=qs['sort'](_0x4b679d[_0xb670('0x2c')][_0xb670('0x36')]);_0x175a04[_0xb670('0x37')]=qs[_0xb670('0x2d')](_[_0xb670('0x38')](_0x4b679d[_0xb670('0x2c')],_0x4d4405[_0xb670('0x2d')]));if(_0x4b679d[_0xb670('0x2c')][_0xb670('0x39')]){_0x175a04['where']=_['merge'](_0x175a04[_0xb670('0x37')],{'$or':_[_0xb670('0x28')](_0x175a04[_0xb670('0x32')],function(_0x4075d4){var _0x1f6650={};_0x1f6650[_0x4075d4]={'$like':'%'+_0x4b679d[_0xb670('0x2c')][_0xb670('0x39')]+'%'};return _0x1f6650;})});}_0x175a04=_[_0xb670('0x3b')]({},_0x175a04,_0x4b679d[_0xb670('0x3c')]);return _0x47c57a[_0xb670('0x49')](_0x175a04);}})[_0xb670('0x25')](function(_0x13c7a8){if(_0x13c7a8){_0x32077a=_0x13c7a8[_0xb670('0x31')];if(!_0x4b679d[_0xb670('0x2c')][_0xb670('0x33')]('nolimit')){_0x175a04[_0xb670('0x1e')]=qs[_0xb670('0x1e')](_0x4b679d['query'][_0xb670('0x1e')]);_0x175a04[_0xb670('0x1b')]=qs[_0xb670('0x1b')](_0x4b679d[_0xb670('0x2c')][_0xb670('0x1b')]);}return _0x47c57a[_0xb670('0x49')](_0x175a04);}})[_0xb670('0x25')](function(_0x24745e){if(_0x24745e){return _0x24745e?{'count':_0x32077a,'rows':_0x24745e}:null;}})[_0xb670('0x25')](respondWithResult(_0x265a57,null))[_0xb670('0x40')](handleError(_0x265a57,null));};exports[_0xb670('0x4a')]=function(_0x4a3ff4,_0x1ecc11,_0x355c2f){var _0x37a7b0={};var _0x205bc6={};var _0x354e69;var _0x168988;return db[_0xb670('0x29')][_0xb670('0x47')]({'where':{'id':_0x4a3ff4[_0xb670('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ecc11,null))[_0xb670('0x25')](function(_0x4dc2d7){if(_0x4dc2d7){_0x354e69=_0x4dc2d7;_0x205bc6[_0xb670('0x2f')]=_['keys'](db[_0xb670('0x48')]['rawAttributes']);_0x205bc6[_0xb670('0x2c')]=_[_0xb670('0x43')](_0x4a3ff4[_0xb670('0x2c')]);_0x205bc6['filters']=_['intersection'](_0x205bc6[_0xb670('0x2f')],_0x205bc6[_0xb670('0x2c')]);_0x37a7b0[_0xb670('0x32')]=_['intersection'](_0x205bc6['model'],qs[_0xb670('0x30')](_0x4a3ff4[_0xb670('0x2c')][_0xb670('0x30')]));_0x37a7b0['attributes']=_0x37a7b0[_0xb670('0x32')][_0xb670('0x31')]?_0x37a7b0[_0xb670('0x32')]:_0x205bc6[_0xb670('0x2f')];_0x37a7b0[_0xb670('0x35')]=qs[_0xb670('0x36')](_0x4a3ff4['query'][_0xb670('0x36')]);_0x37a7b0['where']=qs[_0xb670('0x2d')](_[_0xb670('0x38')](_0x4a3ff4[_0xb670('0x2c')],_0x205bc6[_0xb670('0x2d')]));if(_0x4a3ff4[_0xb670('0x2c')][_0xb670('0x39')]){_0x37a7b0['where']=_[_0xb670('0x3b')](_0x37a7b0[_0xb670('0x37')],{'$or':_[_0xb670('0x28')](_0x37a7b0[_0xb670('0x32')],function(_0x278b50){var _0x24265c={};_0x24265c[_0x278b50]={'$like':'%'+_0x4a3ff4[_0xb670('0x2c')][_0xb670('0x39')]+'%'};return _0x24265c;})});}_0x37a7b0=_['merge']({},_0x37a7b0,_0x4a3ff4['options']);return _0x354e69[_0xb670('0x4a')](_0x37a7b0);}})[_0xb670('0x25')](function(_0x5c6799){if(_0x5c6799){_0x168988=_0x5c6799[_0xb670('0x31')];if(!_0x4a3ff4[_0xb670('0x2c')][_0xb670('0x33')](_0xb670('0x34'))){_0x37a7b0[_0xb670('0x1e')]=qs[_0xb670('0x1e')](_0x4a3ff4[_0xb670('0x2c')][_0xb670('0x1e')]);_0x37a7b0[_0xb670('0x1b')]=qs[_0xb670('0x1b')](_0x4a3ff4[_0xb670('0x2c')][_0xb670('0x1b')]);}return _0x354e69['getSubjects'](_0x37a7b0);}})[_0xb670('0x25')](function(_0x7a2aff){if(_0x7a2aff){return _0x7a2aff?{'count':_0x168988,'rows':_0x7a2aff}:null;}})[_0xb670('0x25')](respondWithResult(_0x1ecc11,null))[_0xb670('0x40')](handleError(_0x1ecc11,null));};exports['getDescriptions']=function(_0x109717,_0x369ae6,_0xe8ab19){var _0x507bf2={};var _0x544914={};var _0x429ef2;var _0x52fd6b;return db[_0xb670('0x29')][_0xb670('0x47')]({'where':{'id':_0x109717[_0xb670('0x42')]['id']}})[_0xb670('0x25')](handleEntityNotFound(_0x369ae6,null))['then'](function(_0x2b2e89){if(_0x2b2e89){_0x429ef2=_0x2b2e89;_0x544914[_0xb670('0x2f')]=_[_0xb670('0x43')](db[_0xb670('0x48')][_0xb670('0x4b')]);_0x544914[_0xb670('0x2c')]=_[_0xb670('0x43')](_0x109717['query']);_0x544914[_0xb670('0x2d')]=_[_0xb670('0x2e')](_0x544914[_0xb670('0x2f')],_0x544914[_0xb670('0x2c')]);_0x507bf2[_0xb670('0x32')]=_[_0xb670('0x2e')](_0x544914[_0xb670('0x2f')],qs[_0xb670('0x30')](_0x109717[_0xb670('0x2c')][_0xb670('0x30')]));_0x507bf2['attributes']=_0x507bf2['attributes'][_0xb670('0x31')]?_0x507bf2[_0xb670('0x32')]:_0x544914['model'];_0x507bf2[_0xb670('0x35')]=qs['sort'](_0x109717[_0xb670('0x2c')][_0xb670('0x36')]);_0x507bf2[_0xb670('0x37')]=qs['filters'](_[_0xb670('0x38')](_0x109717[_0xb670('0x2c')],_0x544914['filters']));if(_0x109717[_0xb670('0x2c')][_0xb670('0x39')]){_0x507bf2[_0xb670('0x37')]=_[_0xb670('0x3b')](_0x507bf2['where'],{'$or':_[_0xb670('0x28')](_0x507bf2[_0xb670('0x32')],function(_0x2ac1bb){var _0x652517={};_0x652517[_0x2ac1bb]={'$like':'%'+_0x109717[_0xb670('0x2c')][_0xb670('0x39')]+'%'};return _0x652517;})});}_0x507bf2=_[_0xb670('0x3b')]({},_0x507bf2,_0x109717[_0xb670('0x3c')]);return _0x429ef2[_0xb670('0x4c')](_0x507bf2);}})[_0xb670('0x25')](function(_0x934d44){if(_0x934d44){_0x52fd6b=_0x934d44['length'];if(!_0x109717[_0xb670('0x2c')]['hasOwnProperty'](_0xb670('0x34'))){_0x507bf2[_0xb670('0x1e')]=qs[_0xb670('0x1e')](_0x109717[_0xb670('0x2c')][_0xb670('0x1e')]);_0x507bf2['offset']=qs['offset'](_0x109717[_0xb670('0x2c')][_0xb670('0x1b')]);}return _0x429ef2[_0xb670('0x4c')](_0x507bf2);}})['then'](function(_0x46add8){if(_0x46add8){return _0x46add8?{'count':_0x52fd6b,'rows':_0x46add8}:null;}})['then'](respondWithResult(_0x369ae6,null))[_0xb670('0x40')](handleError(_0x369ae6,null));};exports[_0xb670('0x4d')]=function(_0x161bed,_0x5cbc3e,_0x345a33){var _0x3b9468={};var _0x2437a0={};var _0x37bce7;var _0x5545a2;return db[_0xb670('0x29')][_0xb670('0x47')]({'where':{'id':_0x161bed[_0xb670('0x42')]['id']}})['then'](handleEntityNotFound(_0x5cbc3e,null))[_0xb670('0x25')](function(_0x5e4218){if(_0x5e4218){_0x37bce7=_0x5e4218;_0x2437a0[_0xb670('0x2f')]=_[_0xb670('0x43')](db[_0xb670('0x4e')][_0xb670('0x4b')]);_0x2437a0[_0xb670('0x2c')]=_['keys'](_0x161bed['query']);_0x2437a0[_0xb670('0x2d')]=_[_0xb670('0x2e')](_0x2437a0[_0xb670('0x2f')],_0x2437a0[_0xb670('0x2c')]);_0x3b9468[_0xb670('0x32')]=_[_0xb670('0x2e')](_0x2437a0[_0xb670('0x2f')],qs[_0xb670('0x30')](_0x161bed[_0xb670('0x2c')][_0xb670('0x30')]));_0x3b9468['attributes']=_0x3b9468[_0xb670('0x32')][_0xb670('0x31')]?_0x3b9468[_0xb670('0x32')]:_0x2437a0['model'];_0x3b9468[_0xb670('0x35')]=qs[_0xb670('0x36')](_0x161bed[_0xb670('0x2c')][_0xb670('0x36')]);_0x3b9468['where']=qs[_0xb670('0x2d')](_[_0xb670('0x38')](_0x161bed['query'],_0x2437a0['filters']));if(_0x161bed[_0xb670('0x2c')][_0xb670('0x39')]){_0x3b9468[_0xb670('0x37')]=_[_0xb670('0x3b')](_0x3b9468['where'],{'$or':_[_0xb670('0x28')](_0x3b9468['attributes'],function(_0x16c40b){var _0xd3435e={};_0xd3435e[_0x16c40b]={'$like':'%'+_0x161bed[_0xb670('0x2c')][_0xb670('0x39')]+'%'};return _0xd3435e;})});}_0x3b9468=_['merge']({},_0x3b9468,_0x161bed[_0xb670('0x3c')]);return _0x37bce7[_0xb670('0x4d')](_0x3b9468);}})[_0xb670('0x25')](function(_0x1c44db){if(_0x1c44db){_0x5545a2=_0x1c44db[_0xb670('0x31')];if(!_0x161bed[_0xb670('0x2c')][_0xb670('0x33')](_0xb670('0x34'))){_0x3b9468[_0xb670('0x1e')]=qs['limit'](_0x161bed[_0xb670('0x2c')][_0xb670('0x1e')]);_0x3b9468[_0xb670('0x1b')]=qs[_0xb670('0x1b')](_0x161bed['query']['offset']);}return _0x37bce7[_0xb670('0x4d')](_0x3b9468);}})[_0xb670('0x25')](function(_0x19e37b){if(_0x19e37b){return _0x19e37b?{'count':_0x5545a2,'rows':_0x19e37b}:null;}})[_0xb670('0x25')](respondWithResult(_0x5cbc3e,null))['catch'](handleError(_0x5cbc3e,null));};exports[_0xb670('0x4f')]=function(_0x33567b,_0x205bc1,_0x27d436){if(_0x33567b[_0xb670('0x46')]['id']){delete _0x33567b[_0xb670('0x46')]['id'];}return db[_0xb670('0x29')][_0xb670('0x47')]({'where':{'id':_0x33567b['params']['id']}})['then'](handleEntityNotFound(_0x205bc1,null))[_0xb670('0x25')](function(_0x588093){if(_0x588093){return _0x588093[_0xb670('0x4f')](_0x33567b['body'][_0xb670('0x50')]||[]);}return null;})[_0xb670('0x25')](respondWithResult(_0x205bc1,null))[_0xb670('0x40')](handleError(_0x205bc1,null));}; \ No newline at end of file +var _0xaa5c=['show','create','body','find','params','findOne','DeskField','length','pick','merge','getFields','getSubjects','getDescriptions','Tag','getTags','setTags','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../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','Content-Range','apply','save','update','then','destroy','error','name','index','DeskConfiguration','rawAttributes','fieldName','map','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x2e26d0,_0x10115c){var _0x5e2915=function(_0xa592ab){while(--_0xa592ab){_0x2e26d0['push'](_0x2e26d0['shift']());}};_0x5e2915(++_0x10115c);}(_0xaa5c,0x65));var _0xcaa5=function(_0x5bdc76,_0x3981b9){_0x5bdc76=_0x5bdc76-0x0;var _0x55a116=_0xaa5c[_0x5bdc76];return _0x55a116;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcaa5('0x0'));var zipdir=require(_0xcaa5('0x1'));var jsonpatch=require(_0xcaa5('0x2'));var rp=require('request-promise');var moment=require(_0xcaa5('0x3'));var BPromise=require(_0xcaa5('0x4'));var Mustache=require(_0xcaa5('0x5'));var util=require(_0xcaa5('0x6'));var path=require(_0xcaa5('0x7'));var sox=require(_0xcaa5('0x8'));var csv=require(_0xcaa5('0x9'));var ejs=require(_0xcaa5('0xa'));var fs=require('fs');var fs_extra=require(_0xcaa5('0xb'));var _=require(_0xcaa5('0xc'));var squel=require(_0xcaa5('0xd'));var crypto=require('crypto');var jsforce=require(_0xcaa5('0xe'));var deskjs=require(_0xcaa5('0xf'));var toCsv=require(_0xcaa5('0x9'));var querystring=require(_0xcaa5('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcaa5('0x11'));var qs=require(_0xcaa5('0x12'));var as=require(_0xcaa5('0x13'));var hardwareService=require(_0xcaa5('0x14'));var logger=require(_0xcaa5('0x15'))('api');var utils=require(_0xcaa5('0x16'));var config=require(_0xcaa5('0x17'));var licenseUtil=require(_0xcaa5('0x18'));var db=require(_0xcaa5('0x19'))['db'];function respondWithStatusCode(_0x35f894,_0x185960){_0x185960=_0x185960||0xcc;return function(_0x531687){if(_0x531687){return _0x35f894[_0xcaa5('0x1a')](_0x185960);}return _0x35f894[_0xcaa5('0x1b')](_0x185960)[_0xcaa5('0x1c')]();};}function respondWithResult(_0x2f0d3c,_0x465c59){_0x465c59=_0x465c59||0xc8;return function(_0x3c6d39){if(_0x3c6d39){return _0x2f0d3c[_0xcaa5('0x1b')](_0x465c59)[_0xcaa5('0x1d')](_0x3c6d39);}};}function respondWithFilteredResult(_0x1bd74a,_0x238758){return function(_0x3c3de2){if(_0x3c3de2){var _0x4597ad=typeof _0x238758[_0xcaa5('0x1e')]===_0xcaa5('0x1f')&&typeof _0x238758[_0xcaa5('0x20')]===_0xcaa5('0x1f');var _0x330603=_0x3c3de2[_0xcaa5('0x21')];var _0xb1be10=_0x4597ad?0x0:_0x238758[_0xcaa5('0x1e')];var _0x3653cc=_0x4597ad?_0x3c3de2['count']:_0x238758[_0xcaa5('0x1e')]+_0x238758[_0xcaa5('0x20')];var _0x3d670c;if(_0x3653cc>=_0x330603){_0x3653cc=_0x330603;_0x3d670c=0xc8;}else{_0x3d670c=0xce;}_0x1bd74a[_0xcaa5('0x1b')](_0x3d670c);return _0x1bd74a[_0xcaa5('0x22')](_0xcaa5('0x23'),_0xb1be10+'-'+_0x3653cc+'/'+_0x330603)[_0xcaa5('0x1d')](_0x3c3de2);}return null;};}function patchUpdates(_0x427f43){return function(_0xd324fe){try{jsonpatch[_0xcaa5('0x24')](_0xd324fe,_0x427f43,!![]);}catch(_0x4d363a){return BPromise['reject'](_0x4d363a);}return _0xd324fe[_0xcaa5('0x25')]();};}function saveUpdates(_0x167ba4,_0x5f588f){return function(_0x1a0448){if(_0x1a0448){return _0x1a0448[_0xcaa5('0x26')](_0x167ba4)[_0xcaa5('0x27')](function(_0x214125){return _0x214125;});}return null;};}function removeEntity(_0x2f47be,_0x556c00){return function(_0x5dcbfc){if(_0x5dcbfc){return _0x5dcbfc[_0xcaa5('0x28')]()[_0xcaa5('0x27')](function(){_0x2f47be[_0xcaa5('0x1b')](0xcc)[_0xcaa5('0x1c')]();});}};}function handleEntityNotFound(_0x33ac45,_0x5d4053){return function(_0x5aa005){if(!_0x5aa005){_0x33ac45[_0xcaa5('0x1a')](0x194);}return _0x5aa005;};}function handleError(_0x412361,_0x4cee60){_0x4cee60=_0x4cee60||0x1f4;return function(_0x34cf4b){logger[_0xcaa5('0x29')](_0x34cf4b['stack']);if(_0x34cf4b[_0xcaa5('0x2a')]){delete _0x34cf4b[_0xcaa5('0x2a')];}_0x412361[_0xcaa5('0x1b')](_0x4cee60)['send'](_0x34cf4b);};}exports[_0xcaa5('0x2b')]=function(_0x1c8c85,_0x4ae277){var _0x17a231={},_0x2012f3={},_0x410a58={'count':0x0,'rows':[]};var _0x3e23ed=_['map'](db[_0xcaa5('0x2c')][_0xcaa5('0x2d')],function(_0x4b8a83){return{'name':_0x4b8a83[_0xcaa5('0x2e')],'type':_0x4b8a83['type']['key']};});_0x2012f3['model']=_[_0xcaa5('0x2f')](_0x3e23ed,_0xcaa5('0x2a'));_0x2012f3[_0xcaa5('0x30')]=_[_0xcaa5('0x31')](_0x1c8c85[_0xcaa5('0x30')]);_0x2012f3['filters']=_[_0xcaa5('0x32')](_0x2012f3[_0xcaa5('0x33')],_0x2012f3[_0xcaa5('0x30')]);_0x17a231[_0xcaa5('0x34')]=_[_0xcaa5('0x32')](_0x2012f3['model'],qs[_0xcaa5('0x35')](_0x1c8c85['query'][_0xcaa5('0x35')]));_0x17a231[_0xcaa5('0x34')]=_0x17a231['attributes']['length']?_0x17a231[_0xcaa5('0x34')]:_0x2012f3['model'];if(!_0x1c8c85[_0xcaa5('0x30')][_0xcaa5('0x36')](_0xcaa5('0x37'))){_0x17a231[_0xcaa5('0x20')]=qs[_0xcaa5('0x20')](_0x1c8c85[_0xcaa5('0x30')]['limit']);_0x17a231[_0xcaa5('0x1e')]=qs[_0xcaa5('0x1e')](_0x1c8c85[_0xcaa5('0x30')][_0xcaa5('0x1e')]);}_0x17a231[_0xcaa5('0x38')]=qs[_0xcaa5('0x39')](_0x1c8c85['query']['sort']);_0x17a231['where']=qs[_0xcaa5('0x3a')](_['pick'](_0x1c8c85[_0xcaa5('0x30')],_0x2012f3['filters']),_0x3e23ed);if(_0x1c8c85[_0xcaa5('0x30')][_0xcaa5('0x3b')]){_0x17a231[_0xcaa5('0x3c')]=_['merge'](_0x17a231[_0xcaa5('0x3c')],{'$or':_[_0xcaa5('0x2f')](_0x3e23ed,function(_0x1db19f){if(_0x1db19f[_0xcaa5('0x3d')]!==_0xcaa5('0x3e')){var _0x222286={};_0x222286[_0x1db19f['name']]={'$like':'%'+_0x1c8c85[_0xcaa5('0x30')][_0xcaa5('0x3b')]+'%'};return _0x222286;}})});}_0x17a231=_['merge']({},_0x17a231,_0x1c8c85[_0xcaa5('0x3f')]);var _0x31ac45={'where':_0x17a231['where']};return db[_0xcaa5('0x2c')][_0xcaa5('0x21')](_0x31ac45)['then'](function(_0x43452e){_0x410a58[_0xcaa5('0x21')]=_0x43452e;if(_0x1c8c85[_0xcaa5('0x30')][_0xcaa5('0x40')]){_0x17a231[_0xcaa5('0x41')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xcaa5('0x42')](_0x17a231);})[_0xcaa5('0x27')](function(_0x5746db){_0x410a58[_0xcaa5('0x43')]=_0x5746db;return _0x410a58;})[_0xcaa5('0x27')](respondWithFilteredResult(_0x4ae277,_0x17a231))[_0xcaa5('0x44')](handleError(_0x4ae277,null));};exports[_0xcaa5('0x45')]=function(_0x35265b,_0x33cc6e){var _0x4e0814={'raw':![],'where':{'id':_0x35265b['params']['id']}},_0x523dfb={};_0x523dfb['model']=_['keys'](db[_0xcaa5('0x2c')][_0xcaa5('0x2d')]);_0x523dfb['query']=_[_0xcaa5('0x31')](_0x35265b[_0xcaa5('0x30')]);_0x523dfb[_0xcaa5('0x3a')]=_[_0xcaa5('0x32')](_0x523dfb[_0xcaa5('0x33')],_0x523dfb[_0xcaa5('0x30')]);_0x4e0814['attributes']=_['intersection'](_0x523dfb[_0xcaa5('0x33')],qs['fields'](_0x35265b[_0xcaa5('0x30')][_0xcaa5('0x35')]));_0x4e0814[_0xcaa5('0x34')]=_0x4e0814[_0xcaa5('0x34')]['length']?_0x4e0814[_0xcaa5('0x34')]:_0x523dfb[_0xcaa5('0x33')];if(_0x35265b[_0xcaa5('0x30')][_0xcaa5('0x40')]){_0x4e0814['include']=[{'all':!![]}];}_0x4e0814=_['merge']({},_0x4e0814,_0x35265b[_0xcaa5('0x3f')]);return db[_0xcaa5('0x2c')]['find'](_0x4e0814)[_0xcaa5('0x27')](handleEntityNotFound(_0x33cc6e,null))[_0xcaa5('0x27')](respondWithResult(_0x33cc6e,null))['catch'](handleError(_0x33cc6e,null));};exports[_0xcaa5('0x46')]=function(_0x1ad289,_0x12166b){return db['DeskConfiguration']['create'](_0x1ad289[_0xcaa5('0x47')],{})[_0xcaa5('0x27')](respondWithResult(_0x12166b,0xc9))['catch'](handleError(_0x12166b,null));};exports['update']=function(_0x23c096,_0x537424){if(_0x23c096['body']['id']){delete _0x23c096['body']['id'];}return db[_0xcaa5('0x2c')][_0xcaa5('0x48')]({'where':{'id':_0x23c096[_0xcaa5('0x49')]['id']}})['then'](handleEntityNotFound(_0x537424,null))[_0xcaa5('0x27')](saveUpdates(_0x23c096['body'],null))[_0xcaa5('0x27')](respondWithResult(_0x537424,null))[_0xcaa5('0x44')](handleError(_0x537424,null));};exports[_0xcaa5('0x28')]=function(_0x16d8b7,_0x4379f8){return db[_0xcaa5('0x2c')]['find']({'where':{'id':_0x16d8b7['params']['id']}})['then'](handleEntityNotFound(_0x4379f8,null))[_0xcaa5('0x27')](removeEntity(_0x4379f8,null))[_0xcaa5('0x44')](handleError(_0x4379f8,null));};exports['getFields']=function(_0x41aa9e,_0x4dc8ba,_0x4e04c){var _0x4ed9c9={};var _0x1abf1d={};var _0x3420f6;var _0x5d0936;return db[_0xcaa5('0x2c')][_0xcaa5('0x4a')]({'where':{'id':_0x41aa9e[_0xcaa5('0x49')]['id']}})[_0xcaa5('0x27')](handleEntityNotFound(_0x4dc8ba,null))[_0xcaa5('0x27')](function(_0x15bbfe){if(_0x15bbfe){_0x3420f6=_0x15bbfe;_0x1abf1d[_0xcaa5('0x33')]=_[_0xcaa5('0x31')](db[_0xcaa5('0x4b')]['rawAttributes']);_0x1abf1d[_0xcaa5('0x30')]=_[_0xcaa5('0x31')](_0x41aa9e[_0xcaa5('0x30')]);_0x1abf1d[_0xcaa5('0x3a')]=_[_0xcaa5('0x32')](_0x1abf1d['model'],_0x1abf1d[_0xcaa5('0x30')]);_0x4ed9c9[_0xcaa5('0x34')]=_[_0xcaa5('0x32')](_0x1abf1d[_0xcaa5('0x33')],qs['fields'](_0x41aa9e['query'][_0xcaa5('0x35')]));_0x4ed9c9[_0xcaa5('0x34')]=_0x4ed9c9['attributes'][_0xcaa5('0x4c')]?_0x4ed9c9['attributes']:_0x1abf1d[_0xcaa5('0x33')];_0x4ed9c9['order']=qs[_0xcaa5('0x39')](_0x41aa9e[_0xcaa5('0x30')]['sort']);_0x4ed9c9[_0xcaa5('0x3c')]=qs[_0xcaa5('0x3a')](_[_0xcaa5('0x4d')](_0x41aa9e['query'],_0x1abf1d[_0xcaa5('0x3a')]));if(_0x41aa9e[_0xcaa5('0x30')][_0xcaa5('0x3b')]){_0x4ed9c9[_0xcaa5('0x3c')]=_[_0xcaa5('0x4e')](_0x4ed9c9[_0xcaa5('0x3c')],{'$or':_['map'](_0x4ed9c9[_0xcaa5('0x34')],function(_0x4aee87){var _0x339cad={};_0x339cad[_0x4aee87]={'$like':'%'+_0x41aa9e['query'][_0xcaa5('0x3b')]+'%'};return _0x339cad;})});}_0x4ed9c9=_[_0xcaa5('0x4e')]({},_0x4ed9c9,_0x41aa9e[_0xcaa5('0x3f')]);return _0x3420f6[_0xcaa5('0x4f')](_0x4ed9c9);}})['then'](function(_0x4055f3){if(_0x4055f3){_0x5d0936=_0x4055f3[_0xcaa5('0x4c')];if(!_0x41aa9e[_0xcaa5('0x30')][_0xcaa5('0x36')]('nolimit')){_0x4ed9c9[_0xcaa5('0x20')]=qs[_0xcaa5('0x20')](_0x41aa9e[_0xcaa5('0x30')][_0xcaa5('0x20')]);_0x4ed9c9[_0xcaa5('0x1e')]=qs[_0xcaa5('0x1e')](_0x41aa9e['query']['offset']);}return _0x3420f6[_0xcaa5('0x4f')](_0x4ed9c9);}})[_0xcaa5('0x27')](function(_0x362767){if(_0x362767){return _0x362767?{'count':_0x5d0936,'rows':_0x362767}:null;}})[_0xcaa5('0x27')](respondWithResult(_0x4dc8ba,null))[_0xcaa5('0x44')](handleError(_0x4dc8ba,null));};exports[_0xcaa5('0x50')]=function(_0x388973,_0x3c9e7c,_0x4a2054){var _0xa6312d={};var _0x543fa9={};var _0x32530a;var _0x2859ff;return db['DeskConfiguration'][_0xcaa5('0x4a')]({'where':{'id':_0x388973['params']['id']}})['then'](handleEntityNotFound(_0x3c9e7c,null))[_0xcaa5('0x27')](function(_0x3ff115){if(_0x3ff115){_0x32530a=_0x3ff115;_0x543fa9[_0xcaa5('0x33')]=_['keys'](db[_0xcaa5('0x4b')][_0xcaa5('0x2d')]);_0x543fa9[_0xcaa5('0x30')]=_['keys'](_0x388973[_0xcaa5('0x30')]);_0x543fa9['filters']=_[_0xcaa5('0x32')](_0x543fa9[_0xcaa5('0x33')],_0x543fa9[_0xcaa5('0x30')]);_0xa6312d[_0xcaa5('0x34')]=_[_0xcaa5('0x32')](_0x543fa9[_0xcaa5('0x33')],qs[_0xcaa5('0x35')](_0x388973[_0xcaa5('0x30')]['fields']));_0xa6312d[_0xcaa5('0x34')]=_0xa6312d[_0xcaa5('0x34')][_0xcaa5('0x4c')]?_0xa6312d[_0xcaa5('0x34')]:_0x543fa9[_0xcaa5('0x33')];_0xa6312d[_0xcaa5('0x38')]=qs['sort'](_0x388973[_0xcaa5('0x30')][_0xcaa5('0x39')]);_0xa6312d[_0xcaa5('0x3c')]=qs['filters'](_['pick'](_0x388973[_0xcaa5('0x30')],_0x543fa9['filters']));if(_0x388973[_0xcaa5('0x30')]['filter']){_0xa6312d[_0xcaa5('0x3c')]=_[_0xcaa5('0x4e')](_0xa6312d[_0xcaa5('0x3c')],{'$or':_[_0xcaa5('0x2f')](_0xa6312d[_0xcaa5('0x34')],function(_0x59b555){var _0x37c421={};_0x37c421[_0x59b555]={'$like':'%'+_0x388973[_0xcaa5('0x30')][_0xcaa5('0x3b')]+'%'};return _0x37c421;})});}_0xa6312d=_[_0xcaa5('0x4e')]({},_0xa6312d,_0x388973[_0xcaa5('0x3f')]);return _0x32530a[_0xcaa5('0x50')](_0xa6312d);}})[_0xcaa5('0x27')](function(_0x3e209a){if(_0x3e209a){_0x2859ff=_0x3e209a[_0xcaa5('0x4c')];if(!_0x388973[_0xcaa5('0x30')][_0xcaa5('0x36')](_0xcaa5('0x37'))){_0xa6312d[_0xcaa5('0x20')]=qs[_0xcaa5('0x20')](_0x388973['query']['limit']);_0xa6312d[_0xcaa5('0x1e')]=qs[_0xcaa5('0x1e')](_0x388973['query'][_0xcaa5('0x1e')]);}return _0x32530a[_0xcaa5('0x50')](_0xa6312d);}})[_0xcaa5('0x27')](function(_0x480add){if(_0x480add){return _0x480add?{'count':_0x2859ff,'rows':_0x480add}:null;}})['then'](respondWithResult(_0x3c9e7c,null))[_0xcaa5('0x44')](handleError(_0x3c9e7c,null));};exports[_0xcaa5('0x51')]=function(_0x111291,_0x379df2,_0x375c61){var _0x1e31db={};var _0x4b0c95={};var _0x45a7ce;var _0x227e94;return db[_0xcaa5('0x2c')][_0xcaa5('0x4a')]({'where':{'id':_0x111291[_0xcaa5('0x49')]['id']}})['then'](handleEntityNotFound(_0x379df2,null))[_0xcaa5('0x27')](function(_0x35899c){if(_0x35899c){_0x45a7ce=_0x35899c;_0x4b0c95[_0xcaa5('0x33')]=_['keys'](db[_0xcaa5('0x4b')][_0xcaa5('0x2d')]);_0x4b0c95[_0xcaa5('0x30')]=_['keys'](_0x111291[_0xcaa5('0x30')]);_0x4b0c95[_0xcaa5('0x3a')]=_[_0xcaa5('0x32')](_0x4b0c95[_0xcaa5('0x33')],_0x4b0c95[_0xcaa5('0x30')]);_0x1e31db['attributes']=_['intersection'](_0x4b0c95[_0xcaa5('0x33')],qs['fields'](_0x111291[_0xcaa5('0x30')]['fields']));_0x1e31db[_0xcaa5('0x34')]=_0x1e31db[_0xcaa5('0x34')][_0xcaa5('0x4c')]?_0x1e31db[_0xcaa5('0x34')]:_0x4b0c95[_0xcaa5('0x33')];_0x1e31db[_0xcaa5('0x38')]=qs[_0xcaa5('0x39')](_0x111291['query']['sort']);_0x1e31db[_0xcaa5('0x3c')]=qs[_0xcaa5('0x3a')](_[_0xcaa5('0x4d')](_0x111291['query'],_0x4b0c95[_0xcaa5('0x3a')]));if(_0x111291[_0xcaa5('0x30')][_0xcaa5('0x3b')]){_0x1e31db[_0xcaa5('0x3c')]=_[_0xcaa5('0x4e')](_0x1e31db['where'],{'$or':_['map'](_0x1e31db[_0xcaa5('0x34')],function(_0x2c921b){var _0x4bc5ea={};_0x4bc5ea[_0x2c921b]={'$like':'%'+_0x111291[_0xcaa5('0x30')][_0xcaa5('0x3b')]+'%'};return _0x4bc5ea;})});}_0x1e31db=_[_0xcaa5('0x4e')]({},_0x1e31db,_0x111291[_0xcaa5('0x3f')]);return _0x45a7ce['getDescriptions'](_0x1e31db);}})[_0xcaa5('0x27')](function(_0x5d0a5c){if(_0x5d0a5c){_0x227e94=_0x5d0a5c['length'];if(!_0x111291[_0xcaa5('0x30')]['hasOwnProperty'](_0xcaa5('0x37'))){_0x1e31db[_0xcaa5('0x20')]=qs['limit'](_0x111291[_0xcaa5('0x30')][_0xcaa5('0x20')]);_0x1e31db['offset']=qs[_0xcaa5('0x1e')](_0x111291[_0xcaa5('0x30')][_0xcaa5('0x1e')]);}return _0x45a7ce['getDescriptions'](_0x1e31db);}})[_0xcaa5('0x27')](function(_0x5df159){if(_0x5df159){return _0x5df159?{'count':_0x227e94,'rows':_0x5df159}:null;}})[_0xcaa5('0x27')](respondWithResult(_0x379df2,null))['catch'](handleError(_0x379df2,null));};exports['getTags']=function(_0x33bab5,_0x1a7bff,_0x321532){var _0x5760cc={};var _0x4cfff9={};var _0x2b8a9a;var _0x405424;return db[_0xcaa5('0x2c')][_0xcaa5('0x4a')]({'where':{'id':_0x33bab5[_0xcaa5('0x49')]['id']}})[_0xcaa5('0x27')](handleEntityNotFound(_0x1a7bff,null))[_0xcaa5('0x27')](function(_0x1fa2e6){if(_0x1fa2e6){_0x2b8a9a=_0x1fa2e6;_0x4cfff9[_0xcaa5('0x33')]=_[_0xcaa5('0x31')](db[_0xcaa5('0x52')][_0xcaa5('0x2d')]);_0x4cfff9['query']=_[_0xcaa5('0x31')](_0x33bab5[_0xcaa5('0x30')]);_0x4cfff9[_0xcaa5('0x3a')]=_[_0xcaa5('0x32')](_0x4cfff9[_0xcaa5('0x33')],_0x4cfff9[_0xcaa5('0x30')]);_0x5760cc[_0xcaa5('0x34')]=_[_0xcaa5('0x32')](_0x4cfff9[_0xcaa5('0x33')],qs[_0xcaa5('0x35')](_0x33bab5[_0xcaa5('0x30')][_0xcaa5('0x35')]));_0x5760cc[_0xcaa5('0x34')]=_0x5760cc[_0xcaa5('0x34')][_0xcaa5('0x4c')]?_0x5760cc[_0xcaa5('0x34')]:_0x4cfff9['model'];_0x5760cc['order']=qs['sort'](_0x33bab5[_0xcaa5('0x30')][_0xcaa5('0x39')]);_0x5760cc[_0xcaa5('0x3c')]=qs['filters'](_[_0xcaa5('0x4d')](_0x33bab5[_0xcaa5('0x30')],_0x4cfff9[_0xcaa5('0x3a')]));if(_0x33bab5[_0xcaa5('0x30')][_0xcaa5('0x3b')]){_0x5760cc[_0xcaa5('0x3c')]=_[_0xcaa5('0x4e')](_0x5760cc[_0xcaa5('0x3c')],{'$or':_[_0xcaa5('0x2f')](_0x5760cc[_0xcaa5('0x34')],function(_0x220062){var _0x8b453d={};_0x8b453d[_0x220062]={'$like':'%'+_0x33bab5['query'][_0xcaa5('0x3b')]+'%'};return _0x8b453d;})});}_0x5760cc=_['merge']({},_0x5760cc,_0x33bab5[_0xcaa5('0x3f')]);return _0x2b8a9a[_0xcaa5('0x53')](_0x5760cc);}})['then'](function(_0x4eb4cd){if(_0x4eb4cd){_0x405424=_0x4eb4cd['length'];if(!_0x33bab5[_0xcaa5('0x30')][_0xcaa5('0x36')]('nolimit')){_0x5760cc['limit']=qs[_0xcaa5('0x20')](_0x33bab5['query']['limit']);_0x5760cc[_0xcaa5('0x1e')]=qs[_0xcaa5('0x1e')](_0x33bab5[_0xcaa5('0x30')]['offset']);}return _0x2b8a9a[_0xcaa5('0x53')](_0x5760cc);}})[_0xcaa5('0x27')](function(_0x34046d){if(_0x34046d){return _0x34046d?{'count':_0x405424,'rows':_0x34046d}:null;}})[_0xcaa5('0x27')](respondWithResult(_0x1a7bff,null))[_0xcaa5('0x44')](handleError(_0x1a7bff,null));};exports['setTags']=function(_0x47d75a,_0x4ef088,_0x43693d){if(_0x47d75a[_0xcaa5('0x47')]['id']){delete _0x47d75a[_0xcaa5('0x47')]['id'];}return db[_0xcaa5('0x2c')][_0xcaa5('0x4a')]({'where':{'id':_0x47d75a[_0xcaa5('0x49')]['id']}})[_0xcaa5('0x27')](handleEntityNotFound(_0x4ef088,null))[_0xcaa5('0x27')](function(_0x362e49){if(_0x362e49){return _0x362e49[_0xcaa5('0x54')](_0x47d75a[_0xcaa5('0x47')]['ids']||[]);}return null;})[_0xcaa5('0x27')](respondWithResult(_0x4ef088,null))[_0xcaa5('0x44')](handleError(_0x4ef088,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 4f0879e..4913f72 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 _0x4655=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration'];(function(_0x291eda,_0x1a6630){var _0x305b71=function(_0x2f321c){while(--_0x2f321c){_0x291eda['push'](_0x291eda['shift']());}};_0x305b71(++_0x1a6630);}(_0x4655,0x11e));var _0x5465=function(_0x92bf2c,_0x479730){_0x92bf2c=_0x92bf2c-0x0;var _0x536d74=_0x4655[_0x92bf2c];return _0x536d74;};'use strict';var _=require('lodash');var util=require(_0x5465('0x0'));var logger=require(_0x5465('0x1'))(_0x5465('0x2'));var moment=require(_0x5465('0x3'));var BPromise=require(_0x5465('0x4'));var rp=require(_0x5465('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5465('0x6'));var config=require(_0x5465('0x7'));var attributes=require(_0x5465('0x8'));module['exports']=function(_0x23687e,_0x11d95f){return _0x23687e[_0x5465('0x9')](_0x5465('0xa'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0727=['bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','util','../../config/logger','api','moment'];(function(_0x1c06f4,_0x2feba6){var _0x1a727e=function(_0x2e83af){while(--_0x2e83af){_0x1c06f4['push'](_0x1c06f4['shift']());}};_0x1a727e(++_0x2feba6);}(_0x0727,0x110));var _0x7072=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0x0727[_0xf0bc07];return _0x1c50c2;};'use strict';var _=require('lodash');var util=require(_0x7072('0x0'));var logger=require(_0x7072('0x1'))(_0x7072('0x2'));var moment=require(_0x7072('0x3'));var BPromise=require(_0x7072('0x4'));var rp=require(_0x7072('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7072('0x6'));var config=require(_0x7072('0x7'));var attributes=require(_0x7072('0x8'));module[_0x7072('0x9')]=function(_0xc02184,_0x58f17a){return _0xc02184[_0x7072('0xa')]('DeskConfiguration',attributes,{'tableName':_0x7072('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 167b418..273ab6e 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 _0x45c2=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash'];(function(_0x4704f5,_0xe0fb47){var _0x442fe1=function(_0x2a76de){while(--_0x2a76de){_0x4704f5['push'](_0x4704f5['shift']());}};_0x442fe1(++_0xe0fb47);}(_0x45c2,0x68));var _0x245c=function(_0x5ac791,_0x504d37){_0x5ac791=_0x5ac791-0x0;var _0x9e3a19=_0x45c2[_0x5ac791];return _0x9e3a19;};'use strict';var _=require(_0x245c('0x0'));var util=require(_0x245c('0x1'));var moment=require(_0x245c('0x2'));var BPromise=require(_0x245c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x245c('0x4'));var db=require(_0x245c('0x5'))['db'];var utils=require(_0x245c('0x6'));var logger=require('../../config/logger')(_0x245c('0x7'));var config=require(_0x245c('0x8'));var jayson=require(_0x245c('0x9'));var client=jayson[_0x245c('0xa')][_0x245c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e1860,_0x20a6d7,_0x10da3e){return new BPromise(function(_0x20c72d,_0x40eab8){return client[_0x245c('0xc')](_0x2e1860,_0x10da3e)[_0x245c('0xd')](function(_0x558ef3){logger[_0x245c('0xe')](_0x245c('0xf'),_0x20a6d7,_0x245c('0x10'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x20a6d7,_0x245c('0x10'),JSON[_0x245c('0x11')](_0x558ef3));if(_0x558ef3['error']){if(_0x558ef3[_0x245c('0x12')]['code']===0x1f4){logger[_0x245c('0x12')](_0x245c('0xf'),_0x20a6d7,_0x558ef3[_0x245c('0x12')][_0x245c('0x13')]);return _0x40eab8(_0x558ef3[_0x245c('0x12')]['message']);}logger[_0x245c('0x12')](_0x245c('0xf'),_0x20a6d7,_0x558ef3[_0x245c('0x12')][_0x245c('0x13')]);return _0x20c72d(_0x558ef3['error'][_0x245c('0x13')]);}else{logger['info'](_0x245c('0xf'),_0x20a6d7,_0x245c('0x10'));_0x20c72d(_0x558ef3[_0x245c('0x14')][_0x245c('0x13')]);}})['catch'](function(_0x124e02){logger[_0x245c('0x12')](_0x245c('0xf'),_0x20a6d7,_0x124e02);_0x40eab8(_0x124e02);});});} \ No newline at end of file +var _0xc74c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0xc74c,0x163));var _0xcc74=function(_0x236323,_0x4cd264){_0x236323=_0x236323-0x0;var _0x18d49d=_0xc74c[_0x236323];return _0x18d49d;};'use strict';var _=require(_0xcc74('0x0'));var util=require(_0xcc74('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc74('0x2'));var fs=require('fs');var Redis=require(_0xcc74('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc74('0x4'));var logger=require(_0xcc74('0x5'))(_0xcc74('0x6'));var config=require(_0xcc74('0x7'));var jayson=require(_0xcc74('0x8'));var client=jayson[_0xcc74('0x9')][_0xcc74('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d46a6,_0x15248f,_0x86f429){return new BPromise(function(_0x1eb886,_0x473308){return client[_0xcc74('0xb')](_0x5d46a6,_0x86f429)['then'](function(_0x4b4534){logger[_0xcc74('0xc')](_0xcc74('0xd'),_0x15248f,_0xcc74('0xe'));logger['debug'](_0xcc74('0xf'),_0x15248f,_0xcc74('0xe'),JSON[_0xcc74('0x10')](_0x4b4534));if(_0x4b4534['error']){if(_0x4b4534[_0xcc74('0x11')]['code']===0x1f4){logger[_0xcc74('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x15248f,_0x4b4534['error']['message']);return _0x473308(_0x4b4534[_0xcc74('0x11')][_0xcc74('0x12')]);}logger[_0xcc74('0x11')](_0xcc74('0xd'),_0x15248f,_0x4b4534[_0xcc74('0x11')]['message']);return _0x1eb886(_0x4b4534[_0xcc74('0x11')][_0xcc74('0x12')]);}else{logger[_0xcc74('0xc')](_0xcc74('0xd'),_0x15248f,_0xcc74('0xe'));_0x1eb886(_0x4b4534['result'][_0xcc74('0x12')]);}})[_0xcc74('0x13')](function(_0xe44014){logger[_0xcc74('0x11')](_0xcc74('0xd'),_0x15248f,_0xe44014);_0x473308(_0xe44014);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index b673790..2ab90dc 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 _0xa3f2=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','update','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3f2,0x6c));var _0x2a3f=function(_0x144c83,_0x438f9d){_0x144c83=_0x144c83-0x0;var _0x294fd2=_0xa3f2[_0x144c83];return _0x294fd2;};'use strict';var multer=require(_0x2a3f('0x0'));var util=require(_0x2a3f('0x1'));var path=require(_0x2a3f('0x2'));var timeout=require(_0x2a3f('0x3'));var express=require(_0x2a3f('0x4'));var router=express[_0x2a3f('0x5')]();var fs_extra=require(_0x2a3f('0x6'));var auth=require(_0x2a3f('0x7'));var interaction=require(_0x2a3f('0x8'));var config=require(_0x2a3f('0x9'));var controller=require('./intDeskField.controller');router[_0x2a3f('0xa')]('/',auth[_0x2a3f('0xb')](),controller['index']);router['get'](_0x2a3f('0xc'),auth[_0x2a3f('0xb')](),controller[_0x2a3f('0xd')]);router[_0x2a3f('0xe')]('/',auth[_0x2a3f('0xb')](),controller['create']);router['put'](_0x2a3f('0xc'),auth[_0x2a3f('0xb')](),controller[_0x2a3f('0xf')]);router['delete']('/:id',auth[_0x2a3f('0xb')](),controller[_0x2a3f('0x10')]);module[_0x2a3f('0x11')]=router; \ No newline at end of file +var _0x8777=['delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','post','put','/:id','update'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8777,0xdb));var _0x7877=function(_0x225cb8,_0x5a5807){_0x225cb8=_0x225cb8-0x0;var _0x6dc37d=_0x8777[_0x225cb8];return _0x6dc37d;};'use strict';var multer=require(_0x7877('0x0'));var util=require(_0x7877('0x1'));var path=require('path');var timeout=require(_0x7877('0x2'));var express=require(_0x7877('0x3'));var router=express['Router']();var fs_extra=require(_0x7877('0x4'));var auth=require(_0x7877('0x5'));var interaction=require(_0x7877('0x6'));var config=require(_0x7877('0x7'));var controller=require(_0x7877('0x8'));router[_0x7877('0x9')]('/',auth[_0x7877('0xa')](),controller['index']);router[_0x7877('0x9')]('/:id',auth[_0x7877('0xa')](),controller['show']);router[_0x7877('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7877('0xc')](_0x7877('0xd'),auth[_0x7877('0xa')](),controller[_0x7877('0xe')]);router[_0x7877('0xf')]('/:id',auth[_0x7877('0xa')](),controller[_0x7877('0x10')]);module[_0x7877('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index d23e00e..c4866c4 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 _0xfb22=['sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN'];(function(_0x538c70,_0x35531f){var _0x42ae01=function(_0x5c7368){while(--_0x5c7368){_0x538c70['push'](_0x538c70['shift']());}};_0x42ae01(++_0x35531f);}(_0xfb22,0x6e));var _0x2fb2=function(_0x4c7410,_0x43bf77){_0x4c7410=_0x4c7410-0x0;var _0x2cf87d=_0xfb22[_0x4c7410];return _0x2cf87d;};'use strict';var Sequelize=require(_0x2fb2('0x0'));module[_0x2fb2('0x1')]={'type':{'type':Sequelize[_0x2fb2('0x2')]('string',_0x2fb2('0x3'),_0x2fb2('0x4'),_0x2fb2('0x5'),_0x2fb2('0x6')),'defaultValue':_0x2fb2('0x7')},'content':{'type':Sequelize[_0x2fb2('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x2fb2('0x7'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x2fb2('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2fb2('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2fb2('0x8')]}}; \ No newline at end of file +var _0x7bd4=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x105e18,_0x3a85c2){var _0x30a4b=function(_0x30d93f){while(--_0x30d93f){_0x105e18['push'](_0x105e18['shift']());}};_0x30a4b(++_0x3a85c2);}(_0x7bd4,0x16b));var _0x47bd=function(_0x23d78a,_0x44c08a){_0x23d78a=_0x23d78a-0x0;var _0x4bb7e7=_0x7bd4[_0x23d78a];return _0x4bb7e7;};'use strict';var Sequelize=require(_0x47bd('0x0'));module[_0x47bd('0x1')]={'type':{'type':Sequelize[_0x47bd('0x2')](_0x47bd('0x3'),_0x47bd('0x4'),_0x47bd('0x5'),_0x47bd('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x47bd('0x7')]},'keyType':{'type':Sequelize[_0x47bd('0x2')](_0x47bd('0x3'),_0x47bd('0x4'),_0x47bd('0x5'))},'keyContent':{'type':Sequelize[_0x47bd('0x7')]},'idField':{'type':Sequelize[_0x47bd('0x7')]},'nameField':{'type':Sequelize[_0x47bd('0x7')]},'customField':{'type':Sequelize[_0x47bd('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index fdef1ad..02d8a55 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 _0xe384=['request-promise','mustache','util','to-csv','lodash','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','DeskField','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','findAll','rows','catch','rawAttributes','include','find','create','body','params','eml-format','zip-dir','fast-json-patch'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe384,0x160));var _0x4e38=function(_0xf406c3,_0xfb2e32){_0xf406c3=_0xf406c3-0x0;var _0x261c32=_0xe384[_0xf406c3];return _0x261c32;};'use strict';var emlformat=require(_0x4e38('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e38('0x1'));var jsonpatch=require(_0x4e38('0x2'));var rp=require(_0x4e38('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4e38('0x4'));var util=require(_0x4e38('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x4e38('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4e38('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4e38('0x8'));var deskjs=require(_0x4e38('0x9'));var toCsv=require(_0x4e38('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4e38('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x4e38('0xb'));var as=require(_0x4e38('0xc'));var hardwareService=require(_0x4e38('0xd'));var logger=require(_0x4e38('0xe'))(_0x4e38('0xf'));var utils=require(_0x4e38('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4e38('0x11'));var db=require(_0x4e38('0x12'))['db'];function respondWithStatusCode(_0x16b035,_0x4c02c9){_0x4c02c9=_0x4c02c9||0xcc;return function(_0x631e61){if(_0x631e61){return _0x16b035[_0x4e38('0x13')](_0x4c02c9);}return _0x16b035['status'](_0x4c02c9)[_0x4e38('0x14')]();};}function respondWithResult(_0x59f68a,_0x4d242e){_0x4d242e=_0x4d242e||0xc8;return function(_0x4433cc){if(_0x4433cc){return _0x59f68a[_0x4e38('0x15')](_0x4d242e)['json'](_0x4433cc);}};}function respondWithFilteredResult(_0x5bfc62,_0x216ce0){return function(_0x24d8c8){if(_0x24d8c8){var _0x5daca2=typeof _0x216ce0[_0x4e38('0x16')]===_0x4e38('0x17')&&typeof _0x216ce0[_0x4e38('0x18')]===_0x4e38('0x17');var _0x196470=_0x24d8c8['count'];var _0x37272e=_0x5daca2?0x0:_0x216ce0[_0x4e38('0x16')];var _0xb4e4b6=_0x5daca2?_0x24d8c8[_0x4e38('0x19')]:_0x216ce0[_0x4e38('0x16')]+_0x216ce0[_0x4e38('0x18')];var _0x1aca66;if(_0xb4e4b6>=_0x196470){_0xb4e4b6=_0x196470;_0x1aca66=0xc8;}else{_0x1aca66=0xce;}_0x5bfc62['status'](_0x1aca66);return _0x5bfc62[_0x4e38('0x1a')](_0x4e38('0x1b'),_0x37272e+'-'+_0xb4e4b6+'/'+_0x196470)[_0x4e38('0x1c')](_0x24d8c8);}return null;};}function patchUpdates(_0x8541f9){return function(_0x46e168){try{jsonpatch[_0x4e38('0x1d')](_0x46e168,_0x8541f9,!![]);}catch(_0xb3027a){return BPromise[_0x4e38('0x1e')](_0xb3027a);}return _0x46e168[_0x4e38('0x1f')]();};}function saveUpdates(_0x47ae97,_0x19c189){return function(_0x1db7ef){if(_0x1db7ef){return _0x1db7ef[_0x4e38('0x20')](_0x47ae97)[_0x4e38('0x21')](function(_0x404ad9){return _0x404ad9;});}return null;};}function removeEntity(_0x310ae7,_0x33bc64){return function(_0x1daccd){if(_0x1daccd){return _0x1daccd[_0x4e38('0x22')]()[_0x4e38('0x21')](function(){_0x310ae7['status'](0xcc)[_0x4e38('0x14')]();});}};}function handleEntityNotFound(_0x47b09b,_0x2c1006){return function(_0x33d49e){if(!_0x33d49e){_0x47b09b[_0x4e38('0x13')](0x194);}return _0x33d49e;};}function handleError(_0x2f8eae,_0x3a3a97){_0x3a3a97=_0x3a3a97||0x1f4;return function(_0x3eed38){logger[_0x4e38('0x23')](_0x3eed38['stack']);if(_0x3eed38['name']){delete _0x3eed38[_0x4e38('0x24')];}_0x2f8eae[_0x4e38('0x15')](_0x3a3a97)[_0x4e38('0x25')](_0x3eed38);};}exports[_0x4e38('0x26')]=function(_0xa81bc9,_0x5afd46){var _0xba37ff={},_0xf55f4f={},_0x57b0f9={'count':0x0,'rows':[]};var _0x2a66f1=_[_0x4e38('0x27')](db[_0x4e38('0x28')]['rawAttributes'],function(_0x4a673c){return{'name':_0x4a673c[_0x4e38('0x29')],'type':_0x4a673c['type'][_0x4e38('0x2a')]};});_0xf55f4f[_0x4e38('0x2b')]=_[_0x4e38('0x27')](_0x2a66f1,_0x4e38('0x24'));_0xf55f4f['query']=_[_0x4e38('0x2c')](_0xa81bc9[_0x4e38('0x2d')]);_0xf55f4f[_0x4e38('0x2e')]=_[_0x4e38('0x2f')](_0xf55f4f['model'],_0xf55f4f[_0x4e38('0x2d')]);_0xba37ff[_0x4e38('0x30')]=_[_0x4e38('0x2f')](_0xf55f4f['model'],qs['fields'](_0xa81bc9['query'][_0x4e38('0x31')]));_0xba37ff[_0x4e38('0x30')]=_0xba37ff[_0x4e38('0x30')][_0x4e38('0x32')]?_0xba37ff['attributes']:_0xf55f4f['model'];if(!_0xa81bc9[_0x4e38('0x2d')][_0x4e38('0x33')]('nolimit')){_0xba37ff[_0x4e38('0x18')]=qs['limit'](_0xa81bc9[_0x4e38('0x2d')][_0x4e38('0x18')]);_0xba37ff[_0x4e38('0x16')]=qs[_0x4e38('0x16')](_0xa81bc9[_0x4e38('0x2d')]['offset']);}_0xba37ff[_0x4e38('0x34')]=qs[_0x4e38('0x35')](_0xa81bc9[_0x4e38('0x2d')][_0x4e38('0x35')]);_0xba37ff['where']=qs[_0x4e38('0x2e')](_[_0x4e38('0x36')](_0xa81bc9[_0x4e38('0x2d')],_0xf55f4f[_0x4e38('0x2e')]),_0x2a66f1);if(_0xa81bc9[_0x4e38('0x2d')][_0x4e38('0x37')]){_0xba37ff['where']=_[_0x4e38('0x38')](_0xba37ff[_0x4e38('0x39')],{'$or':_['map'](_0x2a66f1,function(_0x7af284){if(_0x7af284[_0x4e38('0x3a')]!==_0x4e38('0x3b')){var _0x5e91ee={};_0x5e91ee[_0x7af284[_0x4e38('0x24')]]={'$like':'%'+_0xa81bc9[_0x4e38('0x2d')][_0x4e38('0x37')]+'%'};return _0x5e91ee;}})});}_0xba37ff=_[_0x4e38('0x38')]({},_0xba37ff,_0xa81bc9[_0x4e38('0x3c')]);var _0x4bda0d={'where':_0xba37ff[_0x4e38('0x39')]};return db['DeskField'][_0x4e38('0x19')](_0x4bda0d)[_0x4e38('0x21')](function(_0x5a9dfb){_0x57b0f9[_0x4e38('0x19')]=_0x5a9dfb;if(_0xa81bc9[_0x4e38('0x2d')][_0x4e38('0x3d')]){_0xba37ff['include']=[{'all':!![]}];}return db[_0x4e38('0x28')][_0x4e38('0x3e')](_0xba37ff);})['then'](function(_0x499d78){_0x57b0f9[_0x4e38('0x3f')]=_0x499d78;return _0x57b0f9;})['then'](respondWithFilteredResult(_0x5afd46,_0xba37ff))[_0x4e38('0x40')](handleError(_0x5afd46,null));};exports['show']=function(_0x432def,_0x358a26){var _0x3383af={'raw':!![],'where':{'id':_0x432def['params']['id']}},_0x14f940={};_0x14f940[_0x4e38('0x2b')]=_['keys'](db[_0x4e38('0x28')][_0x4e38('0x41')]);_0x14f940[_0x4e38('0x2d')]=_[_0x4e38('0x2c')](_0x432def[_0x4e38('0x2d')]);_0x14f940[_0x4e38('0x2e')]=_[_0x4e38('0x2f')](_0x14f940[_0x4e38('0x2b')],_0x14f940[_0x4e38('0x2d')]);_0x3383af['attributes']=_[_0x4e38('0x2f')](_0x14f940[_0x4e38('0x2b')],qs[_0x4e38('0x31')](_0x432def[_0x4e38('0x2d')][_0x4e38('0x31')]));_0x3383af[_0x4e38('0x30')]=_0x3383af[_0x4e38('0x30')]['length']?_0x3383af['attributes']:_0x14f940[_0x4e38('0x2b')];if(_0x432def['query'][_0x4e38('0x3d')]){_0x3383af[_0x4e38('0x42')]=[{'all':!![]}];}_0x3383af=_[_0x4e38('0x38')]({},_0x3383af,_0x432def[_0x4e38('0x3c')]);return db['DeskField'][_0x4e38('0x43')](_0x3383af)[_0x4e38('0x21')](handleEntityNotFound(_0x358a26,null))['then'](respondWithResult(_0x358a26,null))[_0x4e38('0x40')](handleError(_0x358a26,null));};exports['create']=function(_0xfb38d,_0x1cbc69){return db[_0x4e38('0x28')][_0x4e38('0x44')](_0xfb38d[_0x4e38('0x45')],{})['then'](respondWithResult(_0x1cbc69,0xc9))[_0x4e38('0x40')](handleError(_0x1cbc69,null));};exports[_0x4e38('0x20')]=function(_0x2a357d,_0x3ace84){if(_0x2a357d[_0x4e38('0x45')]['id']){delete _0x2a357d[_0x4e38('0x45')]['id'];}return db['DeskField'][_0x4e38('0x43')]({'where':{'id':_0x2a357d[_0x4e38('0x46')]['id']}})[_0x4e38('0x21')](handleEntityNotFound(_0x3ace84,null))['then'](saveUpdates(_0x2a357d[_0x4e38('0x45')],null))[_0x4e38('0x21')](respondWithResult(_0x3ace84,null))[_0x4e38('0x40')](handleError(_0x3ace84,null));};exports['destroy']=function(_0x4d3000,_0x1663a4){return db['DeskField'][_0x4e38('0x43')]({'where':{'id':_0x4d3000[_0x4e38('0x46')]['id']}})['then'](handleEntityNotFound(_0x1663a4,null))[_0x4e38('0x21')](removeEntity(_0x1663a4,null))[_0x4e38('0x40')](handleError(_0x1663a4,null));}; \ No newline at end of file +var _0x15c6=['set','Content-Range','save','update','then','destroy','stack','name','index','map','DeskField','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','fields','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count'];(function(_0x221a1f,_0x4eafa4){var _0x3d383e=function(_0x3e645f){while(--_0x3e645f){_0x221a1f['push'](_0x221a1f['shift']());}};_0x3d383e(++_0x4eafa4);}(_0x15c6,0x1cd));var _0x615c=function(_0x5cf3c0,_0x4363c1){_0x5cf3c0=_0x5cf3c0-0x0;var _0x39a680=_0x15c6[_0x5cf3c0];return _0x39a680;};'use strict';var emlformat=require(_0x615c('0x0'));var rimraf=require(_0x615c('0x1'));var zipdir=require(_0x615c('0x2'));var jsonpatch=require(_0x615c('0x3'));var rp=require(_0x615c('0x4'));var moment=require(_0x615c('0x5'));var BPromise=require(_0x615c('0x6'));var Mustache=require(_0x615c('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x615c('0x8'));var ejs=require(_0x615c('0x9'));var fs=require('fs');var fs_extra=require(_0x615c('0xa'));var _=require('lodash');var squel=require(_0x615c('0xb'));var crypto=require(_0x615c('0xc'));var jsforce=require(_0x615c('0xd'));var deskjs=require(_0x615c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x615c('0xf'));var Papa=require('papaparse');var Redis=require(_0x615c('0x10'));var authService=require(_0x615c('0x11'));var qs=require(_0x615c('0x12'));var as=require(_0x615c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x615c('0x14'));var utils=require(_0x615c('0x15'));var config=require(_0x615c('0x16'));var licenseUtil=require(_0x615c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x497ecb,_0x1c029d){_0x1c029d=_0x1c029d||0xcc;return function(_0x1b6e92){if(_0x1b6e92){return _0x497ecb['sendStatus'](_0x1c029d);}return _0x497ecb[_0x615c('0x18')](_0x1c029d)['end']();};}function respondWithResult(_0x525708,_0x31dca1){_0x31dca1=_0x31dca1||0xc8;return function(_0x11d751){if(_0x11d751){return _0x525708[_0x615c('0x18')](_0x31dca1)[_0x615c('0x19')](_0x11d751);}};}function respondWithFilteredResult(_0x146659,_0x1ab157){return function(_0x55ec9e){if(_0x55ec9e){var _0x2d10d2=typeof _0x1ab157[_0x615c('0x1a')]===_0x615c('0x1b')&&typeof _0x1ab157['limit']===_0x615c('0x1b');var _0x3953aa=_0x55ec9e[_0x615c('0x1c')];var _0x1e0d18=_0x2d10d2?0x0:_0x1ab157[_0x615c('0x1a')];var _0x374516=_0x2d10d2?_0x55ec9e[_0x615c('0x1c')]:_0x1ab157[_0x615c('0x1a')]+_0x1ab157['limit'];var _0x504e63;if(_0x374516>=_0x3953aa){_0x374516=_0x3953aa;_0x504e63=0xc8;}else{_0x504e63=0xce;}_0x146659['status'](_0x504e63);return _0x146659[_0x615c('0x1d')](_0x615c('0x1e'),_0x1e0d18+'-'+_0x374516+'/'+_0x3953aa)[_0x615c('0x19')](_0x55ec9e);}return null;};}function patchUpdates(_0x146c58){return function(_0x5c6e16){try{jsonpatch['apply'](_0x5c6e16,_0x146c58,!![]);}catch(_0x2f77cc){return BPromise['reject'](_0x2f77cc);}return _0x5c6e16[_0x615c('0x1f')]();};}function saveUpdates(_0x53638f,_0x23e4c5){return function(_0x508ea5){if(_0x508ea5){return _0x508ea5[_0x615c('0x20')](_0x53638f)[_0x615c('0x21')](function(_0x5d148b){return _0x5d148b;});}return null;};}function removeEntity(_0x4cca36,_0x5bba2f){return function(_0x4117f5){if(_0x4117f5){return _0x4117f5[_0x615c('0x22')]()[_0x615c('0x21')](function(){_0x4cca36[_0x615c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32635f,_0x2f1959){return function(_0x5968aa){if(!_0x5968aa){_0x32635f['sendStatus'](0x194);}return _0x5968aa;};}function handleError(_0x35ccef,_0x3bcff0){_0x3bcff0=_0x3bcff0||0x1f4;return function(_0x8671eb){logger['error'](_0x8671eb[_0x615c('0x23')]);if(_0x8671eb[_0x615c('0x24')]){delete _0x8671eb[_0x615c('0x24')];}_0x35ccef[_0x615c('0x18')](_0x3bcff0)['send'](_0x8671eb);};}exports[_0x615c('0x25')]=function(_0x174259,_0x2a4d37){var _0x263f90={},_0x41866b={},_0x266e46={'count':0x0,'rows':[]};var _0x2da5bb=_[_0x615c('0x26')](db[_0x615c('0x27')][_0x615c('0x28')],function(_0x1985a7){return{'name':_0x1985a7[_0x615c('0x29')],'type':_0x1985a7[_0x615c('0x2a')][_0x615c('0x2b')]};});_0x41866b['model']=_[_0x615c('0x26')](_0x2da5bb,_0x615c('0x24'));_0x41866b[_0x615c('0x2c')]=_[_0x615c('0x2d')](_0x174259[_0x615c('0x2c')]);_0x41866b[_0x615c('0x2e')]=_['intersection'](_0x41866b[_0x615c('0x2f')],_0x41866b[_0x615c('0x2c')]);_0x263f90[_0x615c('0x30')]=_[_0x615c('0x31')](_0x41866b[_0x615c('0x2f')],qs['fields'](_0x174259[_0x615c('0x2c')]['fields']));_0x263f90[_0x615c('0x30')]=_0x263f90[_0x615c('0x30')][_0x615c('0x32')]?_0x263f90[_0x615c('0x30')]:_0x41866b[_0x615c('0x2f')];if(!_0x174259[_0x615c('0x2c')]['hasOwnProperty'](_0x615c('0x33'))){_0x263f90[_0x615c('0x34')]=qs[_0x615c('0x34')](_0x174259[_0x615c('0x2c')][_0x615c('0x34')]);_0x263f90[_0x615c('0x1a')]=qs[_0x615c('0x1a')](_0x174259['query'][_0x615c('0x1a')]);}_0x263f90[_0x615c('0x35')]=qs[_0x615c('0x36')](_0x174259[_0x615c('0x2c')]['sort']);_0x263f90[_0x615c('0x37')]=qs[_0x615c('0x2e')](_[_0x615c('0x38')](_0x174259[_0x615c('0x2c')],_0x41866b['filters']),_0x2da5bb);if(_0x174259['query'][_0x615c('0x39')]){_0x263f90[_0x615c('0x37')]=_[_0x615c('0x3a')](_0x263f90['where'],{'$or':_[_0x615c('0x26')](_0x2da5bb,function(_0x3a6ced){if(_0x3a6ced[_0x615c('0x2a')]!==_0x615c('0x3b')){var _0x57b921={};_0x57b921[_0x3a6ced['name']]={'$like':'%'+_0x174259[_0x615c('0x2c')]['filter']+'%'};return _0x57b921;}})});}_0x263f90=_[_0x615c('0x3a')]({},_0x263f90,_0x174259[_0x615c('0x3c')]);var _0xa59935={'where':_0x263f90['where']};return db[_0x615c('0x27')][_0x615c('0x1c')](_0xa59935)[_0x615c('0x21')](function(_0x93e864){_0x266e46[_0x615c('0x1c')]=_0x93e864;if(_0x174259['query'][_0x615c('0x3d')]){_0x263f90[_0x615c('0x3e')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x263f90);})['then'](function(_0x1b8ce0){_0x266e46[_0x615c('0x3f')]=_0x1b8ce0;return _0x266e46;})['then'](respondWithFilteredResult(_0x2a4d37,_0x263f90))['catch'](handleError(_0x2a4d37,null));};exports[_0x615c('0x40')]=function(_0x210774,_0x46afa9){var _0x23ea59={'raw':!![],'where':{'id':_0x210774[_0x615c('0x41')]['id']}},_0x1f1d55={};_0x1f1d55[_0x615c('0x2f')]=_[_0x615c('0x2d')](db[_0x615c('0x27')][_0x615c('0x28')]);_0x1f1d55['query']=_[_0x615c('0x2d')](_0x210774[_0x615c('0x2c')]);_0x1f1d55[_0x615c('0x2e')]=_[_0x615c('0x31')](_0x1f1d55['model'],_0x1f1d55[_0x615c('0x2c')]);_0x23ea59[_0x615c('0x30')]=_[_0x615c('0x31')](_0x1f1d55[_0x615c('0x2f')],qs[_0x615c('0x42')](_0x210774[_0x615c('0x2c')]['fields']));_0x23ea59[_0x615c('0x30')]=_0x23ea59['attributes']['length']?_0x23ea59[_0x615c('0x30')]:_0x1f1d55['model'];if(_0x210774[_0x615c('0x2c')][_0x615c('0x3d')]){_0x23ea59[_0x615c('0x3e')]=[{'all':!![]}];}_0x23ea59=_[_0x615c('0x3a')]({},_0x23ea59,_0x210774[_0x615c('0x3c')]);return db[_0x615c('0x27')][_0x615c('0x43')](_0x23ea59)['then'](handleEntityNotFound(_0x46afa9,null))[_0x615c('0x21')](respondWithResult(_0x46afa9,null))[_0x615c('0x44')](handleError(_0x46afa9,null));};exports['create']=function(_0x38c3de,_0x343626){return db[_0x615c('0x27')]['create'](_0x38c3de[_0x615c('0x45')],{})[_0x615c('0x21')](respondWithResult(_0x343626,0xc9))[_0x615c('0x44')](handleError(_0x343626,null));};exports['update']=function(_0x1bd4f1,_0x546124){if(_0x1bd4f1[_0x615c('0x45')]['id']){delete _0x1bd4f1[_0x615c('0x45')]['id'];}return db[_0x615c('0x27')][_0x615c('0x43')]({'where':{'id':_0x1bd4f1[_0x615c('0x41')]['id']}})['then'](handleEntityNotFound(_0x546124,null))[_0x615c('0x21')](saveUpdates(_0x1bd4f1[_0x615c('0x45')],null))['then'](respondWithResult(_0x546124,null))[_0x615c('0x44')](handleError(_0x546124,null));};exports['destroy']=function(_0x25b4e7,_0x2800e2){return db[_0x615c('0x27')][_0x615c('0x43')]({'where':{'id':_0x25b4e7[_0x615c('0x41')]['id']}})[_0x615c('0x21')](handleEntityNotFound(_0x2800e2,null))[_0x615c('0x21')](removeEntity(_0x2800e2,null))[_0x615c('0x44')](handleError(_0x2800e2,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 9707fd3..b7c15fc 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 _0xeaec=['request-promise','path','rimraf','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','util','moment','bluebird'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xeaec,0x6d));var _0xceae=function(_0x48396f,_0x2303c2){_0x48396f=_0x48396f-0x0;var _0x37cb9e=_0xeaec[_0x48396f];return _0x37cb9e;};'use strict';var _=require('lodash');var util=require(_0xceae('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xceae('0x1'));var BPromise=require(_0xceae('0x2'));var rp=require(_0xceae('0x3'));var fs=require('fs');var path=require(_0xceae('0x4'));var rimraf=require(_0xceae('0x5'));var config=require('../../config/environment');var attributes=require(_0xceae('0x6'));module[_0xceae('0x7')]=function(_0x4944f0,_0x275be8){return _0x4944f0[_0xceae('0x8')](_0xceae('0x9'),attributes,{'tableName':_0xceae('0xa'),'paranoid':![],'indexes':[{'name':_0xceae('0xb'),'fields':[_0xceae('0xc'),_0xceae('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x86c5=['desk_unique_index','idField','FieldId','lodash','util','api','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define','DeskField','int_desk_fields'];(function(_0x1e59e9,_0x2083d0){var _0x468dd2=function(_0x41e4ba){while(--_0x41e4ba){_0x1e59e9['push'](_0x1e59e9['shift']());}};_0x468dd2(++_0x2083d0);}(_0x86c5,0x8f));var _0x586c=function(_0x331a5e,_0x557064){_0x331a5e=_0x331a5e-0x0;var _0x5629c0=_0x86c5[_0x331a5e];return _0x5629c0;};'use strict';var _=require(_0x586c('0x0'));var util=require(_0x586c('0x1'));var logger=require('../../config/logger')(_0x586c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x586c('0x3'));var fs=require('fs');var path=require(_0x586c('0x4'));var rimraf=require(_0x586c('0x5'));var config=require(_0x586c('0x6'));var attributes=require(_0x586c('0x7'));module['exports']=function(_0x30f4ba,_0x51aac3){return _0x30f4ba[_0x586c('0x8')](_0x586c('0x9'),attributes,{'tableName':_0x586c('0xa'),'paranoid':![],'indexes':[{'name':_0x586c('0xb'),'fields':[_0x586c('0xc'),_0x586c('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 9df34bd..382761c 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 _0xd97b=['http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x55adee,_0x4d9108){var _0x5f0455=function(_0x216c59){while(--_0x216c59){_0x55adee['push'](_0x55adee['shift']());}};_0x5f0455(++_0x4d9108);}(_0xd97b,0x1ea));var _0xbd97=function(_0x48c26e,_0x28625b){_0x48c26e=_0x48c26e-0x0;var _0x281d2b=_0xd97b[_0x48c26e];return _0x281d2b;};'use strict';var _=require('lodash');var util=require(_0xbd97('0x0'));var moment=require('moment');var BPromise=require(_0xbd97('0x1'));var rs=require(_0xbd97('0x2'));var fs=require('fs');var Redis=require(_0xbd97('0x3'));var db=require(_0xbd97('0x4'))['db'];var utils=require(_0xbd97('0x5'));var logger=require(_0xbd97('0x6'))('rpc');var config=require(_0xbd97('0x7'));var jayson=require(_0xbd97('0x8'));var client=jayson[_0xbd97('0x9')][_0xbd97('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x228eb7,_0x4b6bd6,_0x4a21ed){return new BPromise(function(_0x317c8c,_0xf38720){return client[_0xbd97('0xb')](_0x228eb7,_0x4a21ed)['then'](function(_0xdbb3e9){logger[_0xbd97('0xc')](_0xbd97('0xd'),_0x4b6bd6,_0xbd97('0xe'));logger[_0xbd97('0xf')]('DeskField,\x20%s,\x20%s,\x20%s',_0x4b6bd6,_0xbd97('0xe'),JSON['stringify'](_0xdbb3e9));if(_0xdbb3e9[_0xbd97('0x10')]){if(_0xdbb3e9['error'][_0xbd97('0x11')]===0x1f4){logger[_0xbd97('0x10')]('DeskField,\x20%s,\x20%s',_0x4b6bd6,_0xdbb3e9[_0xbd97('0x10')][_0xbd97('0x12')]);return _0xf38720(_0xdbb3e9[_0xbd97('0x10')][_0xbd97('0x12')]);}logger[_0xbd97('0x10')](_0xbd97('0xd'),_0x4b6bd6,_0xdbb3e9['error']['message']);return _0x317c8c(_0xdbb3e9[_0xbd97('0x10')][_0xbd97('0x12')]);}else{logger[_0xbd97('0xc')]('DeskField,\x20%s,\x20%s',_0x4b6bd6,_0xbd97('0xe'));_0x317c8c(_0xdbb3e9['result']['message']);}})[_0xbd97('0x13')](function(_0x1af1d0){logger[_0xbd97('0x10')](_0xbd97('0xd'),_0x4b6bd6,_0x1af1d0);_0xf38720(_0x1af1d0);});});} \ No newline at end of file +var _0xbb88=['request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x5942f1,_0x306515){var _0x34379a=function(_0x1827eb){while(--_0x1827eb){_0x5942f1['push'](_0x5942f1['shift']());}};_0x34379a(++_0x306515);}(_0xbb88,0xdd));var _0x8bb8=function(_0x7ee046,_0x248eb5){_0x7ee046=_0x7ee046-0x0;var _0x512015=_0xbb88[_0x7ee046];return _0x512015;};'use strict';var _=require(_0x8bb8('0x0'));var util=require(_0x8bb8('0x1'));var moment=require('moment');var BPromise=require(_0x8bb8('0x2'));var rs=require(_0x8bb8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8bb8('0x4'));var logger=require('../../config/logger')(_0x8bb8('0x5'));var config=require(_0x8bb8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8bb8('0x7')][_0x8bb8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc10c82,_0x8defb1,_0x1c1c97){return new BPromise(function(_0x4e45de,_0x2ca91b){return client[_0x8bb8('0x9')](_0xc10c82,_0x1c1c97)['then'](function(_0x389e3c){logger['info']('DeskField,\x20%s,\x20%s',_0x8defb1,_0x8bb8('0xa'));logger[_0x8bb8('0xb')](_0x8bb8('0xc'),_0x8defb1,_0x8bb8('0xa'),JSON[_0x8bb8('0xd')](_0x389e3c));if(_0x389e3c[_0x8bb8('0xe')]){if(_0x389e3c['error'][_0x8bb8('0xf')]===0x1f4){logger[_0x8bb8('0xe')](_0x8bb8('0x10'),_0x8defb1,_0x389e3c['error'][_0x8bb8('0x11')]);return _0x2ca91b(_0x389e3c[_0x8bb8('0xe')][_0x8bb8('0x11')]);}logger[_0x8bb8('0xe')](_0x8bb8('0x10'),_0x8defb1,_0x389e3c[_0x8bb8('0xe')][_0x8bb8('0x11')]);return _0x4e45de(_0x389e3c[_0x8bb8('0xe')][_0x8bb8('0x11')]);}else{logger[_0x8bb8('0x12')](_0x8bb8('0x10'),_0x8defb1,'request\x20sent');_0x4e45de(_0x389e3c[_0x8bb8('0x13')][_0x8bb8('0x11')]);}})[_0x8bb8('0x14')](function(_0x23f681){logger['error'](_0x8bb8('0x10'),_0x8defb1,_0x23f681);_0x2ca91b(_0x23f681);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index a6212e8..65345e7 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 _0x70ec=['./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4f41bd,_0x1c2004){var _0x11a075=function(_0x130bf2){while(--_0x130bf2){_0x4f41bd['push'](_0x4f41bd['shift']());}};_0x11a075(++_0x1c2004);}(_0x70ec,0x149));var _0xc70e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x70ec[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xc70e('0x0'));var util=require(_0xc70e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc70e('0x2'));var router=express[_0xc70e('0x3')]();var fs_extra=require(_0xc70e('0x4'));var auth=require(_0xc70e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc70e('0x6'));var controller=require(_0xc70e('0x7'));router[_0xc70e('0x8')]('/',auth[_0xc70e('0x9')](),controller[_0xc70e('0xa')]);router['get'](_0xc70e('0xb'),auth[_0xc70e('0x9')](),controller[_0xc70e('0xc')]);router[_0xc70e('0x8')](_0xc70e('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xc70e('0x8')](_0xc70e('0xe'),auth[_0xc70e('0x9')](),controller['getFields']);router[_0xc70e('0xf')]('/',auth[_0xc70e('0x9')](),controller[_0xc70e('0x10')]);router[_0xc70e('0xf')](_0xc70e('0xd'),auth[_0xc70e('0x9')](),controller[_0xc70e('0x11')]);router[_0xc70e('0x12')](_0xc70e('0xb'),auth[_0xc70e('0x9')](),controller['update']);router['delete'](_0xc70e('0xb'),auth[_0xc70e('0x9')](),controller[_0xc70e('0x13')]);module[_0xc70e('0x14')]=router; \ No newline at end of file +var _0xcab6=['isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','index','get','/:id'];(function(_0x593f13,_0x4301b0){var _0x5e702c=function(_0x4b16c7){while(--_0x4b16c7){_0x593f13['push'](_0x593f13['shift']());}};_0x5e702c(++_0x4301b0);}(_0xcab6,0x186));var _0x6cab=function(_0x50d75e,_0x22eac6){_0x50d75e=_0x50d75e-0x0;var _0x9879ca=_0xcab6[_0x50d75e];return _0x9879ca;};'use strict';var multer=require(_0x6cab('0x0'));var util=require(_0x6cab('0x1'));var path=require(_0x6cab('0x2'));var timeout=require(_0x6cab('0x3'));var express=require(_0x6cab('0x4'));var router=express[_0x6cab('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6cab('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6cab('0x7')]);router[_0x6cab('0x8')](_0x6cab('0x9'),auth[_0x6cab('0xa')](),controller[_0x6cab('0xb')]);router['get'](_0x6cab('0xc'),auth['isAuthenticated'](),controller[_0x6cab('0xd')]);router[_0x6cab('0x8')]('/:id/fields',auth[_0x6cab('0xa')](),controller[_0x6cab('0xe')]);router[_0x6cab('0xf')]('/',auth[_0x6cab('0xa')](),controller['create']);router[_0x6cab('0xf')](_0x6cab('0xc'),auth[_0x6cab('0xa')](),controller[_0x6cab('0x10')]);router['put']('/:id',auth[_0x6cab('0xa')](),controller[_0x6cab('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6cab('0x12')]);module[_0x6cab('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 33d9810..5d7ecbc 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 _0x0763=['sequelize','STRING','BOOLEAN'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0763,0x87));var _0x3076=function(_0x5b697a,_0x280202){_0x5b697a=_0x5b697a-0x0;var _0x5de43b=_0x0763[_0x5b697a];return _0x5de43b;};'use strict';var Sequelize=require(_0x3076('0x0'));module['exports']={'name':{'type':Sequelize[_0x3076('0x1')]},'username':{'type':Sequelize[_0x3076('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3076('0x1')]},'tenantId':{'type':Sequelize[_0x3076('0x1')]},'clientId':{'type':Sequelize[_0x3076('0x1')]},'clientSecret':{'type':Sequelize[_0x3076('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3076('0x1')]},'modernAuthentication':{'type':Sequelize[_0x3076('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5e11=['BOOLEAN','sequelize','STRING'];(function(_0x2bf790,_0x420554){var _0x55c4b9=function(_0x5e803){while(--_0x5e803){_0x2bf790['push'](_0x2bf790['shift']());}};_0x55c4b9(++_0x420554);}(_0x5e11,0x1c3));var _0x15e1=function(_0x1602fb,_0x20b6b3){_0x1602fb=_0x1602fb-0x0;var _0x461831=_0x5e11[_0x1602fb];return _0x461831;};'use strict';var Sequelize=require(_0x15e1('0x0'));module['exports']={'name':{'type':Sequelize[_0x15e1('0x1')]},'username':{'type':Sequelize[_0x15e1('0x1')]},'password':{'type':Sequelize[_0x15e1('0x1')]},'remoteUri':{'type':Sequelize[_0x15e1('0x1')]},'tenantId':{'type':Sequelize[_0x15e1('0x1')]},'clientId':{'type':Sequelize[_0x15e1('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x15e1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x15e1('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 5f1ca66..4708ff6 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 _0x9802=['description','customerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidyominame','productidname','sentimentvalue','slainvokedidname','statecode','statuscode','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','access_token','data7','POST','https://login.microsoftonline.com/','/oauth2/token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','GET','EntityDefinitions(','includes','forEach','PicklistAttributeMetadata','push','MetadataId','all','@odata.type','BooleanAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','DecimalAttributeMetadata','test','statusCode','send','OptionSet','Label','UserLocalizedLabel','DisplayName',')/Attributes(','LogicalName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','count','limit','status','set','then','destroy','end','sendStatus','error','stack','name','Dynamics365Account','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','keys','include','create','body','update','find','getConfigurations','findOne','map','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Configuration','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','getFields','Incident','PhoneCall','title'];(function(_0x34efe5,_0x26be46){var _0x3d5783=function(_0x582721){while(--_0x582721){_0x34efe5['push'](_0x34efe5['shift']());}};_0x3d5783(++_0x26be46);}(_0x9802,0x112));var _0x2980=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x9802[_0x4a747d];return _0x3a5b5c;};'use strict';var rp=require(_0x2980('0x0'));var util=require('util');var _=require('lodash');var qs=require(_0x2980('0x1'));var logger=require('../../config/logger')(_0x2980('0x2'));var db=require(_0x2980('0x3'))['db'];var integrations=require(_0x2980('0x4'));function respondWithResult(_0x46b7f9,_0x48880a){_0x48880a=_0x48880a||0xc8;return function(_0x2ca81b){if(_0x2ca81b){return _0x46b7f9['status'](_0x48880a)[_0x2980('0x5')](_0x2ca81b);}};}function respondWithFilteredResult(_0x5ad3e7,_0x4981d9){return function(_0x1c4375){if(_0x1c4375){var _0x5ff778=typeof _0x4981d9[_0x2980('0x6')]===_0x2980('0x7')&&typeof _0x4981d9['limit']===_0x2980('0x7');var _0x151b7b=_0x1c4375['count'];var _0x5baeb9=_0x5ff778?0x0:_0x4981d9[_0x2980('0x6')];var _0xb86a11=_0x5ff778?_0x1c4375[_0x2980('0x8')]:_0x4981d9[_0x2980('0x6')]+_0x4981d9[_0x2980('0x9')];var _0x292730;if(_0xb86a11>=_0x151b7b){_0xb86a11=_0x151b7b;_0x292730=0xc8;}else{_0x292730=0xce;}_0x5ad3e7[_0x2980('0xa')](_0x292730);return _0x5ad3e7[_0x2980('0xb')]('Content-Range',_0x5baeb9+'-'+_0xb86a11+'/'+_0x151b7b)[_0x2980('0x5')](_0x1c4375);}return null;};}function saveUpdates(_0x9345c1){return function(_0x2152a7){if(_0x2152a7){return _0x2152a7['update'](_0x9345c1)[_0x2980('0xc')](function(_0x4a44e6){return _0x4a44e6;});}return null;};}function removeEntity(_0x376952){return function(_0x3e1c51){if(_0x3e1c51){return _0x3e1c51[_0x2980('0xd')]()['then'](function(){_0x376952[_0x2980('0xa')](0xcc)[_0x2980('0xe')]();});}};}function handleEntityNotFound(_0x53593c){return function(_0x10474a){if(!_0x10474a){_0x53593c[_0x2980('0xf')](0x194);}return _0x10474a;};}function handleError(_0x373185,_0x21ff2b){_0x21ff2b=_0x21ff2b||0x1f4;return function(_0x34bf51){logger[_0x2980('0x10')](_0x34bf51[_0x2980('0x11')]);if(_0x34bf51[_0x2980('0x12')]){delete _0x34bf51[_0x2980('0x12')];}_0x373185[_0x2980('0xa')](_0x21ff2b)['send'](_0x34bf51);};}exports['index']=function(_0x53e529,_0x135904){var _0x176743={},_0xb85f82={},_0x29517b={'count':0x0,'rows':[]};var _0x1baea6=_['map'](db[_0x2980('0x13')][_0x2980('0x14')],function(_0x5cd6c3){return{'name':_0x5cd6c3['fieldName'],'type':_0x5cd6c3[_0x2980('0x15')]['key']};});_0xb85f82[_0x2980('0x16')]=_['map'](_0x1baea6,_0x2980('0x12'));_0xb85f82[_0x2980('0x17')]=_['keys'](_0x53e529[_0x2980('0x17')]);_0xb85f82[_0x2980('0x18')]=_[_0x2980('0x19')](_0xb85f82[_0x2980('0x16')],_0xb85f82[_0x2980('0x17')]);_0x176743[_0x2980('0x1a')]=_[_0x2980('0x19')](_0xb85f82[_0x2980('0x16')],qs[_0x2980('0x1b')](_0x53e529[_0x2980('0x17')][_0x2980('0x1b')]));_0x176743[_0x2980('0x1a')]=_0x176743[_0x2980('0x1a')][_0x2980('0x1c')]?_0x176743['attributes']:_0xb85f82[_0x2980('0x16')];if(!_0x53e529[_0x2980('0x17')]['hasOwnProperty'](_0x2980('0x1d'))){_0x176743[_0x2980('0x9')]=qs['limit'](_0x53e529['query'][_0x2980('0x9')]);_0x176743[_0x2980('0x6')]=qs['offset'](_0x53e529[_0x2980('0x17')][_0x2980('0x6')]);}_0x176743[_0x2980('0x1e')]=qs[_0x2980('0x1f')](_0x53e529[_0x2980('0x17')]['sort']);_0x176743[_0x2980('0x20')]=qs[_0x2980('0x18')](_[_0x2980('0x21')](_0x53e529['query'],_0xb85f82['filters']),_0x1baea6);if(_0x53e529[_0x2980('0x17')]['filter']){_0x176743[_0x2980('0x20')]=_[_0x2980('0x22')](_0x176743[_0x2980('0x20')],{'$or':_['map'](_0x1baea6,function(_0x3602c7){if(_0x3602c7[_0x2980('0x15')]!==_0x2980('0x23')){var _0x26178c={};_0x26178c[_0x3602c7[_0x2980('0x12')]]={'$like':'%'+_0x53e529[_0x2980('0x17')][_0x2980('0x24')]+'%'};return _0x26178c;}})});}_0x176743=_['merge']({},_0x176743,_0x53e529[_0x2980('0x25')]);var _0x37bc2c={'where':_0x176743[_0x2980('0x20')]};return db[_0x2980('0x13')][_0x2980('0x8')](_0x37bc2c)['then'](function(_0x2298d7){_0x29517b[_0x2980('0x8')]=_0x2298d7;if(_0x53e529[_0x2980('0x17')][_0x2980('0x26')]){_0x176743['include']=[{'all':!![]}];}return db[_0x2980('0x13')][_0x2980('0x27')](_0x176743);})[_0x2980('0xc')](function(_0x24bc0b){_0x29517b['rows']=_0x24bc0b;return _0x29517b;})['then'](respondWithFilteredResult(_0x135904,_0x176743))[_0x2980('0x28')](handleError(_0x135904,null));};exports[_0x2980('0x29')]=function(_0x38ef58,_0x418d56){var _0x3bae91={'raw':![],'where':{'id':_0x38ef58[_0x2980('0x2a')]['id']}},_0x3ec664={};_0x3ec664[_0x2980('0x16')]=_[_0x2980('0x2b')](db['Dynamics365Account'][_0x2980('0x14')]);_0x3ec664[_0x2980('0x17')]=_['keys'](_0x38ef58[_0x2980('0x17')]);_0x3ec664[_0x2980('0x18')]=_[_0x2980('0x19')](_0x3ec664[_0x2980('0x16')],_0x3ec664[_0x2980('0x17')]);_0x3bae91[_0x2980('0x1a')]=_[_0x2980('0x19')](_0x3ec664['model'],qs[_0x2980('0x1b')](_0x38ef58[_0x2980('0x17')][_0x2980('0x1b')]));_0x3bae91[_0x2980('0x1a')]=_0x3bae91['attributes'][_0x2980('0x1c')]?_0x3bae91[_0x2980('0x1a')]:_0x3ec664[_0x2980('0x16')];if(_0x38ef58[_0x2980('0x17')][_0x2980('0x26')]){_0x3bae91[_0x2980('0x2c')]=[{'all':!![]}];}_0x3bae91=_[_0x2980('0x22')]({},_0x3bae91,_0x38ef58[_0x2980('0x25')]);return db[_0x2980('0x13')]['find'](_0x3bae91)[_0x2980('0xc')](handleEntityNotFound(_0x418d56,null))['then'](respondWithResult(_0x418d56,null))['catch'](handleError(_0x418d56,null));};exports[_0x2980('0x2d')]=function(_0x207c76,_0x5f422b){return db[_0x2980('0x13')][_0x2980('0x2d')](_0x207c76[_0x2980('0x2e')],{})[_0x2980('0xc')](respondWithResult(_0x5f422b,0xc9))['catch'](handleError(_0x5f422b,null));};exports[_0x2980('0x2f')]=function(_0x16525f,_0x45eeb7){if(_0x16525f['body']['id']){delete _0x16525f['body']['id'];}return db['Dynamics365Account'][_0x2980('0x30')]({'where':{'id':_0x16525f[_0x2980('0x2a')]['id']}})[_0x2980('0xc')](handleEntityNotFound(_0x45eeb7,null))[_0x2980('0xc')](saveUpdates(_0x16525f[_0x2980('0x2e')],null))['then'](respondWithResult(_0x45eeb7,null))[_0x2980('0x28')](handleError(_0x45eeb7,null));};exports['destroy']=function(_0x30e4d4,_0x212482){return db[_0x2980('0x13')][_0x2980('0x30')]({'where':{'id':_0x30e4d4[_0x2980('0x2a')]['id']}})[_0x2980('0xc')](handleEntityNotFound(_0x212482,null))[_0x2980('0xc')](removeEntity(_0x212482,null))[_0x2980('0x28')](handleError(_0x212482,null));};exports[_0x2980('0x31')]=function(_0x38bb43,_0x45de0e){var _0x1e6232={};var _0x21b9ac={};var _0xc22fcb;var _0x3d3e96;return db[_0x2980('0x13')][_0x2980('0x32')]({'where':{'id':_0x38bb43[_0x2980('0x2a')]['id']}})[_0x2980('0xc')](handleEntityNotFound(_0x45de0e,null))[_0x2980('0xc')](function(_0x485d2d){if(_0x485d2d){_0xc22fcb=_0x485d2d;_0x21b9ac['model']=_['keys'](db['Dynamics365Configuration']['rawAttributes']);_0x21b9ac[_0x2980('0x17')]=_[_0x2980('0x2b')](_0x38bb43[_0x2980('0x17')]);_0x21b9ac[_0x2980('0x18')]=_[_0x2980('0x19')](_0x21b9ac[_0x2980('0x16')],_0x21b9ac[_0x2980('0x17')]);_0x1e6232[_0x2980('0x1a')]=_[_0x2980('0x19')](_0x21b9ac[_0x2980('0x16')],qs[_0x2980('0x1b')](_0x38bb43[_0x2980('0x17')][_0x2980('0x1b')]));_0x1e6232[_0x2980('0x1a')]=_0x1e6232[_0x2980('0x1a')][_0x2980('0x1c')]?_0x1e6232['attributes']:_0x21b9ac['model'];_0x1e6232[_0x2980('0x1e')]=qs[_0x2980('0x1f')](_0x38bb43['query'][_0x2980('0x1f')]);_0x1e6232[_0x2980('0x20')]=qs[_0x2980('0x18')](_[_0x2980('0x21')](_0x38bb43[_0x2980('0x17')],_0x21b9ac[_0x2980('0x18')]));if(_0x38bb43['query']['filter']){_0x1e6232['where']=_[_0x2980('0x22')](_0x1e6232[_0x2980('0x20')],{'$or':_[_0x2980('0x33')](_0x1e6232[_0x2980('0x1a')],function(_0x4285f9){var _0x5415c6={};_0x5415c6[_0x4285f9]={'$like':'%'+_0x38bb43[_0x2980('0x17')][_0x2980('0x24')]+'%'};return _0x5415c6;})});}_0x1e6232=_['merge']({},_0x1e6232,_0x38bb43[_0x2980('0x25')]);return _0xc22fcb[_0x2980('0x31')](_0x1e6232);}})[_0x2980('0xc')](function(_0x3b06b9){if(_0x3b06b9){_0x3d3e96=_0x3b06b9[_0x2980('0x1c')];if(!_0x38bb43[_0x2980('0x17')][_0x2980('0x34')](_0x2980('0x1d'))){_0x1e6232['limit']=qs['limit'](_0x38bb43[_0x2980('0x17')][_0x2980('0x9')]);_0x1e6232['offset']=qs[_0x2980('0x6')](_0x38bb43['query']['offset']);}return _0xc22fcb[_0x2980('0x31')](_0x1e6232);}})[_0x2980('0xc')](function(_0x315c08){if(_0x315c08){return _0x315c08?{'count':_0x3d3e96,'rows':_0x315c08}:null;}})[_0x2980('0xc')](respondWithResult(_0x45de0e,null))[_0x2980('0x28')](handleError(_0x45de0e,null));};exports[_0x2980('0x35')]=function(_0x23a93e,_0x908120){if(_0x23a93e[_0x2980('0x2e')]['id']){delete _0x23a93e['body']['id'];}return db[_0x2980('0x13')][_0x2980('0x32')]({'where':{'id':_0x23a93e[_0x2980('0x2a')]['id']}})[_0x2980('0xc')](handleEntityNotFound(_0x908120,null))['then'](function(_0x57eb8b){if(_0x57eb8b){_0x23a93e[_0x2980('0x2e')][_0x2980('0x36')]=_0x57eb8b['id'];_0x23a93e[_0x2980('0x2e')][_0x2980('0x37')]=integrations[_0x2980('0x38')](_0x23a93e[_0x2980('0x2e')][_0x2980('0x39')],_0x23a93e[_0x2980('0x2e')][_0x2980('0x15')]);_0x23a93e['body']['Descriptions']=integrations[_0x2980('0x3a')](_0x23a93e[_0x2980('0x2e')][_0x2980('0x39')],_0x23a93e[_0x2980('0x2e')][_0x2980('0x15')]);return db[_0x2980('0x3b')][_0x2980('0x2d')](_0x23a93e[_0x2980('0x2e')],{'include':[{'model':db[_0x2980('0x3c')],'as':_0x2980('0x37')},{'model':db['Dynamics365Field'],'as':_0x2980('0x3d')}]});}return null;})[_0x2980('0xc')](respondWithResult(_0x908120,null))[_0x2980('0x28')](handleError(_0x908120,null));};function sanitizeRemoteUri(_0x1c6173){var _0x236b3e=_0x1c6173[_0x2980('0x3e')](-0x1);if(_0x236b3e==='/')return _0x1c6173[_0x2980('0x3f')](0x0,_0x1c6173[_0x2980('0x40')](_0x236b3e));return _0x1c6173;}function getWebApiUrl(_0x11cad5){return util[_0x2980('0x41')]('%s/api/data/v9.0/',_0x11cad5);}exports[_0x2980('0x42')]=function(_0x390cb9,_0x34e300){var _0x26cd2a=_0x390cb9[_0x2980('0x17')]['ticketType'];var _0x34272c=_0x26cd2a==='incident'?_0x2980('0x43'):_0x2980('0x44');var _0xdd9483='';var _0x308514='';var _0x5bde34='';var _0x2e0202='';var _0x57d0be='';var _0x142dcd='';var _0x229dab='';var _0x9ec2e0='';var _0x5f1c40=[_0x2980('0x45'),_0x2980('0x46'),_0x2980('0x47'),'ownerid','caseorigincode',_0x2980('0x48'),_0x2980('0x49'),_0x2980('0x4a'),_0x2980('0x4b'),_0x2980('0x4c')];var _0x4cf7c0=['accountidname',_0x2980('0x4d'),_0x2980('0x4e'),_0x2980('0x4f'),_0x2980('0x50'),_0x2980('0x51'),_0x2980('0x52'),'contractidname','createdbyexternalpartyname',_0x2980('0x53'),_0x2980('0x54'),_0x2980('0x55'),_0x2980('0x56'),_0x2980('0x57'),_0x2980('0x58'),_0x2980('0x59'),_0x2980('0x5a'),_0x2980('0x5b'),_0x2980('0x5c'),'entitlementidname',_0x2980('0x5d'),_0x2980('0x5e'),_0x2980('0x5f'),_0x2980('0x60'),_0x2980('0x61'),_0x2980('0x62'),_0x2980('0x63'),_0x2980('0x64'),_0x2980('0x65'),'lastonholdtime',_0x2980('0x66'),_0x2980('0x67'),'modifiedbyexternalpartyyominame',_0x2980('0x68'),_0x2980('0x69'),_0x2980('0x6a'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0x2980('0x6b'),_0x2980('0x6c'),_0x2980('0x6d'),_0x2980('0x6e'),_0x2980('0x6f'),_0x2980('0x70'),_0x2980('0x71'),_0x2980('0x72'),_0x2980('0x73'),'primarycontactidname',_0x2980('0x74'),'prioritycodename',_0x2980('0x75'),'productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame',_0x2980('0x76'),_0x2980('0x77'),'slaname','socialprofileidname',_0x2980('0x78'),_0x2980('0x79'),'subjectidname',_0x2980('0x7a'),'timezoneruleversionnumber',_0x2980('0x7b'),_0x2980('0x7c'),_0x2980('0x7d'),_0x2980('0x7e')];var _0x402171=_0x5f1c40[_0x2980('0x7f')](_0x4cf7c0);return db['Dynamics365Account'][_0x2980('0x32')]({'where':{'id':_0x390cb9['params']['id']},'attributes':['id',_0x2980('0x80'),_0x2980('0x81'),_0x2980('0x82'),_0x2980('0x83'),_0x2980('0x84'),_0x2980('0x85'),_0x2980('0x86')],'include':[{'model':db[_0x2980('0x87')],'as':'CloudProvider','attributes':['id','data5','data7']}]})[_0x2980('0xc')](handleEntityNotFound(_0x34e300,null))[_0x2980('0xc')](function(_0x4b19b3){if(_0x4b19b3){if(_0x4b19b3['modernAuthentication']){_0x4b19b3[_0x2980('0x88')]=_0x4b19b3['CloudProvider']['data5'];_0x9ec2e0=sanitizeRemoteUri(_0x4b19b3[_0x2980('0x87')][_0x2980('0x89')]);_0x229dab=getWebApiUrl(_0x9ec2e0);return _0x4b19b3;}_0x9ec2e0=sanitizeRemoteUri(_0x4b19b3[_0x2980('0x82')]);_0x229dab=getWebApiUrl(_0x9ec2e0);var _0x209f1d={'method':_0x2980('0x8a'),'uri':_0x2980('0x8b')+_0x4b19b3['tenantId']+_0x2980('0x8c'),'form':{'client_id':_0x4b19b3[_0x2980('0x84')],'resource':_0x9ec2e0,'username':_0x4b19b3[_0x2980('0x80')],'password':_0x4b19b3[_0x2980('0x81')],'grant_type':_0x2980('0x81'),'client_secret':_0x4b19b3[_0x2980('0x85')]},'json':!![]};return rp(_0x209f1d);}})[_0x2980('0xc')](function(_0x31e01e){_0x142dcd=_0x31e01e[_0x2980('0x88')];var _0x509ffc={'method':'GET','uri':encodeURI(_0x229dab+_0x2980('0x8d')+_0x34272c+'\x27'),'headers':{'Authorization':_0x2980('0x8e')+_0x142dcd,'If-None-Match':null,'OData-Version':_0x2980('0x8f')},'json':!![]};return rp(_0x509ffc);})[_0x2980('0xc')](function(_0x18c680){var _0x2b1356=_0x18c680[_0x2980('0x90')][0x0];var _0x1c091e=_0x2b1356['MetadataId'];var _0x58627e={'method':_0x2980('0x91'),'uri':_0x229dab+_0x2980('0x92')+_0x1c091e+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x142dcd,'If-None-Match':null,'OData-Version':_0x2980('0x8f')},'json':!![]};return rp(_0x58627e);})[_0x2980('0xc')](function(_0x24226d){_0xdd9483=_0x24226d;_0x308514=_0xdd9483['Attributes'];_0x308514=_['remove'](_0x308514,function(_0x1b7cbf){return!_0x402171[_0x2980('0x93')](_0x1b7cbf['LogicalName']);});var _0x3f4598=[];var _0x43ec22=[];_0x308514[_0x2980('0x94')](function(_0x564b5c){if(_0x564b5c['@odata.type']){var _0x58678d=_0x564b5c['@odata.type'][_0x2980('0x3f')](_0x564b5c['@odata.type']['lastIndexOf']('.')+0x1);if(_0x58678d===_0x2980('0x95')){_0x3f4598[_0x2980('0x96')](getSelectList(_0x229dab,_0x26cd2a,_0x43ec22,_0xdd9483[_0x2980('0x97')],_0x564b5c[_0x2980('0x97')],_0x142dcd));}}});return Promise[_0x2980('0x98')](_0x3f4598);})[_0x2980('0xc')](function(_0xa47bd1){_0x5bde34=_0xa47bd1[0x0];var _0x290fc1=[];var _0x410189=[];_0x308514['forEach'](function(_0x3c9253){if(!_['isNil'](_0x3c9253[_0x2980('0x99')])){var _0x299be2=_0x3c9253[_0x2980('0x99')]['substring'](_0x3c9253[_0x2980('0x99')][_0x2980('0x40')]('.')+0x1);if(_0x299be2===_0x2980('0x9a')){_0x290fc1[_0x2980('0x96')](getBooleanList(_0x229dab,_0x26cd2a,_0x410189,_0xdd9483['MetadataId'],_0x3c9253[_0x2980('0x97')],_0x142dcd));}}});return Promise[_0x2980('0x98')](_0x290fc1);})[_0x2980('0xc')](function(_0x3d1761){_0x2e0202=_0x3d1761[0x0];var _0x554719=[];var _0x302d38=[];_0x308514[_0x2980('0x94')](function(_0x4cd014){if(_0x4cd014[_0x2980('0x99')]){var _0x4460c7=_0x4cd014[_0x2980('0x99')][_0x2980('0x3f')](_0x4cd014['@odata.type'][_0x2980('0x40')]('.')+0x1);if(_0x4460c7==='StringAttributeMetadata'||_0x4460c7===_0x2980('0x9b')||_0x4460c7===_0x2980('0x9c')||_0x4460c7===_0x2980('0x9d')||_0x4460c7==='MemoAttributeMetadata'||_0x4460c7===_0x2980('0x9e')||_0x4460c7===_0x2980('0x9f')||_0x4460c7==='EntityNameAttributeMetadata'||_0x4460c7==='StateAttributeMetadata'||_0x4460c7===_0x2980('0xa0')){_0x554719[_0x2980('0x96')](getInputList(_0x229dab,_0x26cd2a,_0x4460c7,_0x302d38,_0xdd9483[_0x2980('0x97')],_0x4cd014['MetadataId'],_0x142dcd));}}});return Promise[_0x2980('0x98')](_0x554719);})[_0x2980('0xc')](function(_0x3a6175){_0x57d0be=_0x3a6175[0x0];var _0x1dd2a6=_0x5bde34['concat'](_0x2e0202)['concat'](_0x57d0be);var _0x41a920={'count':_0x1dd2a6[_0x2980('0x1c')],'rows':_0x1dd2a6};return _0x41a920;})['then'](respondWithResult(_0x34e300,null))[_0x2980('0x28')](function(_0x3ba09b){var _0x3429be=_0x390cb9[_0x2980('0x17')][_0x2980('0xa1')]?0x1f4:_0x3ba09b[_0x2980('0xa2')]||0x1f4;logger['error'](_0x3ba09b[_0x2980('0x11')]);delete _0x3ba09b[_0x2980('0x12')];if(_0x3429be===0x191){_0x3429be=0x190;}_0x34e300[_0x2980('0xa')](_0x3429be)[_0x2980('0xa3')](_0x390cb9['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x3ba09b[_0x2980('0xa2')]}:_0x3ba09b);});};function getSelectList(_0x344de4,_0x291d6c,_0x56ece8,_0x1a3cdb,_0x1d778c,_0x5861b5){var _0x64a384={'method':_0x2980('0x91'),'uri':_0x344de4+_0x2980('0x92')+_0x1a3cdb+')/Attributes('+_0x1d778c+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x2980('0x8e')+_0x5861b5,'If-None-Match':null,'OData-Version':_0x2980('0x8f')},'json':!![]};return rp(_0x64a384)[_0x2980('0xc')](function(_0x5e6ddd){var _0x29065d=[];var _0x25126f=_0x5e6ddd[_0x2980('0xa4')]['Options'];_0x25126f[_0x2980('0x94')](function(_0x46e1a9){_0x29065d[_0x2980('0x96')]({'name':_0x46e1a9[_0x2980('0xa5')][_0x2980('0xa6')]['Label'],'value':String(_0x46e1a9['Value'])});});var _0x2f75cd={'id':_0x291d6c+'_'+_0x5e6ddd['LogicalName'],'name':_0x5e6ddd[_0x2980('0xa7')][_0x2980('0xa6')][_0x2980('0xa5')],'custom':![],'options':_0x29065d};_0x56ece8['push'](_0x2f75cd);return _0x56ece8;});}function getBooleanList(_0x2e3a40,_0x50e1d4,_0x48da86,_0x33d095,_0x220bd8,_0x201ac2){var _0x560dbc={'method':_0x2980('0x91'),'uri':_0x2e3a40+_0x2980('0x92')+_0x33d095+_0x2980('0xa8')+_0x220bd8+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x2980('0x8e')+_0x201ac2,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x560dbc)[_0x2980('0xc')](function(_0x895ad6){var _0x36e9bd=[];_0x36e9bd[_0x2980('0x96')]({'name':_0x895ad6[_0x2980('0xa4')]['TrueOption'][_0x2980('0xa5')][_0x2980('0xa6')]['Label'],'value':'true'},{'name':_0x895ad6[_0x2980('0xa4')]['FalseOption']['Label'][_0x2980('0xa6')]['Label'],'value':'false'});var _0x275a81={'id':_0x50e1d4+'_'+_0x895ad6[_0x2980('0xa9')],'name':_0x895ad6['DisplayName'][_0x2980('0xa6')][_0x2980('0xa5')],'custom':![],'options':_0x36e9bd};_0x48da86[_0x2980('0x96')](_0x275a81);return _0x48da86;});}function getInputList(_0x4fd8fd,_0x17b2c2,_0x4b842d,_0x3643ae,_0x1bb39d,_0x3e0907,_0x50d87a){var _0x91d9c6={'method':'GET','uri':_0x4fd8fd+_0x2980('0x92')+_0x1bb39d+_0x2980('0xa8')+_0x3e0907+_0x2980('0xaa')+_0x4b842d+_0x2980('0xab'),'headers':{'Authorization':'Bearer\x20'+_0x50d87a,'If-None-Match':null,'OData-Version':_0x2980('0x8f')},'json':!![]};return rp(_0x91d9c6)['then'](function(_0x355335){var _0x1becf4={'id':_0x17b2c2+'_'+_0x355335[_0x2980('0xa9')],'name':_0x355335[_0x2980('0xa7')][_0x2980('0xa6')]?_0x355335[_0x2980('0xa7')][_0x2980('0xa6')][_0x2980('0xa5')]:_0x355335['LogicalName'],'custom':![],'options':[]};_0x3643ae[_0x2980('0x96')](_0x1becf4);return _0x3643ae;});} \ No newline at end of file +var _0x832e=['MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials','GET',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','api','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','update','destroy','then','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','type','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','findOne','getConfigurations','addConfiguration','AccountId','Subjects','channel','getDescriptions','Dynamics365Configuration','Dynamics365Field','slice','format','%s/api/data/v9.0/','ticketType','incident','Incident','title','description','customerid','ownerid','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidyominame','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','transactioncurrencyidname','versionnumber','concat','password','clientId','clientSecret','modernAuthentication','CloudProvider','data5','access_token','data7','remoteUri','POST','https://login.microsoftonline.com/','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','Attributes','includes','LogicalName','forEach','@odata.type','substring','push','all','isNil','BooleanAttributeMetadata','lastIndexOf','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata'];(function(_0x355a5f,_0x4f3ac5){var _0x23e51d=function(_0x31b06c){while(--_0x31b06c){_0x355a5f['push'](_0x355a5f['shift']());}};_0x23e51d(++_0x4f3ac5);}(_0x832e,0x17b));var _0xe832=function(_0x5eb810,_0x353060){_0x5eb810=_0x5eb810-0x0;var _0x247643=_0x832e[_0x5eb810];return _0x247643;};'use strict';var rp=require('request-promise');var util=require(_0xe832('0x0'));var _=require(_0xe832('0x1'));var qs=require(_0xe832('0x2'));var logger=require('../../config/logger')(_0xe832('0x3'));var db=require('../../mysqldb')['db'];var integrations=require(_0xe832('0x4'));function respondWithResult(_0x123513,_0x479100){_0x479100=_0x479100||0xc8;return function(_0x55b417){if(_0x55b417){return _0x123513['status'](_0x479100)[_0xe832('0x5')](_0x55b417);}};}function respondWithFilteredResult(_0x460b13,_0x5c4c66){return function(_0x157f49){if(_0x157f49){var _0x34ac0d=typeof _0x5c4c66[_0xe832('0x6')]===_0xe832('0x7')&&typeof _0x5c4c66[_0xe832('0x8')]==='undefined';var _0x209759=_0x157f49['count'];var _0x481ce6=_0x34ac0d?0x0:_0x5c4c66[_0xe832('0x6')];var _0x5807a6=_0x34ac0d?_0x157f49[_0xe832('0x9')]:_0x5c4c66[_0xe832('0x6')]+_0x5c4c66[_0xe832('0x8')];var _0x174d80;if(_0x5807a6>=_0x209759){_0x5807a6=_0x209759;_0x174d80=0xc8;}else{_0x174d80=0xce;}_0x460b13[_0xe832('0xa')](_0x174d80);return _0x460b13[_0xe832('0xb')]('Content-Range',_0x481ce6+'-'+_0x5807a6+'/'+_0x209759)[_0xe832('0x5')](_0x157f49);}return null;};}function saveUpdates(_0x142d63){return function(_0xcbf4d9){if(_0xcbf4d9){return _0xcbf4d9[_0xe832('0xc')](_0x142d63)['then'](function(_0x283d03){return _0x283d03;});}return null;};}function removeEntity(_0x4c046e){return function(_0x4984ea){if(_0x4984ea){return _0x4984ea[_0xe832('0xd')]()[_0xe832('0xe')](function(){_0x4c046e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d5ee6){return function(_0x1c2cfa){if(!_0x1c2cfa){_0x3d5ee6[_0xe832('0xf')](0x194);}return _0x1c2cfa;};}function handleError(_0x25c0d3,_0x2d15bc){_0x2d15bc=_0x2d15bc||0x1f4;return function(_0x1bc4ab){logger[_0xe832('0x10')](_0x1bc4ab[_0xe832('0x11')]);if(_0x1bc4ab[_0xe832('0x12')]){delete _0x1bc4ab[_0xe832('0x12')];}_0x25c0d3['status'](_0x2d15bc)[_0xe832('0x13')](_0x1bc4ab);};}exports[_0xe832('0x14')]=function(_0x320bbd,_0x3748cf){var _0x20c935={},_0x533cd4={},_0x34a6ad={'count':0x0,'rows':[]};var _0x50a04a=_[_0xe832('0x15')](db[_0xe832('0x16')][_0xe832('0x17')],function(_0x7ace35){return{'name':_0x7ace35['fieldName'],'type':_0x7ace35[_0xe832('0x18')]['key']};});_0x533cd4['model']=_[_0xe832('0x15')](_0x50a04a,_0xe832('0x12'));_0x533cd4[_0xe832('0x19')]=_['keys'](_0x320bbd[_0xe832('0x19')]);_0x533cd4[_0xe832('0x1a')]=_['intersection'](_0x533cd4[_0xe832('0x1b')],_0x533cd4[_0xe832('0x19')]);_0x20c935['attributes']=_[_0xe832('0x1c')](_0x533cd4[_0xe832('0x1b')],qs[_0xe832('0x1d')](_0x320bbd[_0xe832('0x19')][_0xe832('0x1d')]));_0x20c935[_0xe832('0x1e')]=_0x20c935[_0xe832('0x1e')]['length']?_0x20c935[_0xe832('0x1e')]:_0x533cd4[_0xe832('0x1b')];if(!_0x320bbd[_0xe832('0x19')][_0xe832('0x1f')](_0xe832('0x20'))){_0x20c935[_0xe832('0x8')]=qs[_0xe832('0x8')](_0x320bbd[_0xe832('0x19')]['limit']);_0x20c935[_0xe832('0x6')]=qs[_0xe832('0x6')](_0x320bbd[_0xe832('0x19')][_0xe832('0x6')]);}_0x20c935[_0xe832('0x21')]=qs[_0xe832('0x22')](_0x320bbd[_0xe832('0x19')]['sort']);_0x20c935[_0xe832('0x23')]=qs[_0xe832('0x1a')](_[_0xe832('0x24')](_0x320bbd[_0xe832('0x19')],_0x533cd4[_0xe832('0x1a')]),_0x50a04a);if(_0x320bbd[_0xe832('0x19')][_0xe832('0x25')]){_0x20c935['where']=_[_0xe832('0x26')](_0x20c935[_0xe832('0x23')],{'$or':_[_0xe832('0x15')](_0x50a04a,function(_0x5ceec6){if(_0x5ceec6[_0xe832('0x18')]!==_0xe832('0x27')){var _0x32a1a0={};_0x32a1a0[_0x5ceec6['name']]={'$like':'%'+_0x320bbd['query']['filter']+'%'};return _0x32a1a0;}})});}_0x20c935=_[_0xe832('0x26')]({},_0x20c935,_0x320bbd[_0xe832('0x28')]);var _0x15d511={'where':_0x20c935['where']};return db[_0xe832('0x16')][_0xe832('0x9')](_0x15d511)[_0xe832('0xe')](function(_0x1ea9d6){_0x34a6ad[_0xe832('0x9')]=_0x1ea9d6;if(_0x320bbd[_0xe832('0x19')][_0xe832('0x29')]){_0x20c935[_0xe832('0x2a')]=[{'all':!![]}];}return db[_0xe832('0x16')][_0xe832('0x2b')](_0x20c935);})[_0xe832('0xe')](function(_0x36beb3){_0x34a6ad[_0xe832('0x2c')]=_0x36beb3;return _0x34a6ad;})['then'](respondWithFilteredResult(_0x3748cf,_0x20c935))[_0xe832('0x2d')](handleError(_0x3748cf,null));};exports[_0xe832('0x2e')]=function(_0xadcc0b,_0xec3b04){var _0x16b974={'raw':![],'where':{'id':_0xadcc0b[_0xe832('0x2f')]['id']}},_0x2c8a5e={};_0x2c8a5e[_0xe832('0x1b')]=_['keys'](db[_0xe832('0x16')][_0xe832('0x17')]);_0x2c8a5e[_0xe832('0x19')]=_[_0xe832('0x30')](_0xadcc0b[_0xe832('0x19')]);_0x2c8a5e[_0xe832('0x1a')]=_[_0xe832('0x1c')](_0x2c8a5e[_0xe832('0x1b')],_0x2c8a5e[_0xe832('0x19')]);_0x16b974['attributes']=_[_0xe832('0x1c')](_0x2c8a5e['model'],qs[_0xe832('0x1d')](_0xadcc0b[_0xe832('0x19')][_0xe832('0x1d')]));_0x16b974[_0xe832('0x1e')]=_0x16b974[_0xe832('0x1e')][_0xe832('0x31')]?_0x16b974[_0xe832('0x1e')]:_0x2c8a5e[_0xe832('0x1b')];if(_0xadcc0b[_0xe832('0x19')][_0xe832('0x29')]){_0x16b974['include']=[{'all':!![]}];}_0x16b974=_[_0xe832('0x26')]({},_0x16b974,_0xadcc0b[_0xe832('0x28')]);return db[_0xe832('0x16')][_0xe832('0x32')](_0x16b974)[_0xe832('0xe')](handleEntityNotFound(_0xec3b04,null))['then'](respondWithResult(_0xec3b04,null))['catch'](handleError(_0xec3b04,null));};exports[_0xe832('0x33')]=function(_0x41129a,_0x599850){return db[_0xe832('0x16')][_0xe832('0x33')](_0x41129a[_0xe832('0x34')],{})[_0xe832('0xe')](respondWithResult(_0x599850,0xc9))[_0xe832('0x2d')](handleError(_0x599850,null));};exports[_0xe832('0xc')]=function(_0x2bb3fe,_0x3b024d){if(_0x2bb3fe[_0xe832('0x34')]['id']){delete _0x2bb3fe[_0xe832('0x34')]['id'];}return db['Dynamics365Account'][_0xe832('0x32')]({'where':{'id':_0x2bb3fe[_0xe832('0x2f')]['id']}})[_0xe832('0xe')](handleEntityNotFound(_0x3b024d,null))[_0xe832('0xe')](saveUpdates(_0x2bb3fe[_0xe832('0x34')],null))[_0xe832('0xe')](respondWithResult(_0x3b024d,null))[_0xe832('0x2d')](handleError(_0x3b024d,null));};exports['destroy']=function(_0x14274b,_0x220616){return db['Dynamics365Account']['find']({'where':{'id':_0x14274b['params']['id']}})[_0xe832('0xe')](handleEntityNotFound(_0x220616,null))[_0xe832('0xe')](removeEntity(_0x220616,null))[_0xe832('0x2d')](handleError(_0x220616,null));};exports['getConfigurations']=function(_0x56c145,_0xb6a86){var _0x1d1f41={};var _0x23d41a={};var _0x69b4fb;var _0x2faef1;return db[_0xe832('0x16')][_0xe832('0x35')]({'where':{'id':_0x56c145[_0xe832('0x2f')]['id']}})[_0xe832('0xe')](handleEntityNotFound(_0xb6a86,null))['then'](function(_0x615537){if(_0x615537){_0x69b4fb=_0x615537;_0x23d41a['model']=_[_0xe832('0x30')](db['Dynamics365Configuration'][_0xe832('0x17')]);_0x23d41a[_0xe832('0x19')]=_['keys'](_0x56c145[_0xe832('0x19')]);_0x23d41a[_0xe832('0x1a')]=_[_0xe832('0x1c')](_0x23d41a[_0xe832('0x1b')],_0x23d41a['query']);_0x1d1f41['attributes']=_[_0xe832('0x1c')](_0x23d41a[_0xe832('0x1b')],qs['fields'](_0x56c145[_0xe832('0x19')][_0xe832('0x1d')]));_0x1d1f41[_0xe832('0x1e')]=_0x1d1f41[_0xe832('0x1e')][_0xe832('0x31')]?_0x1d1f41[_0xe832('0x1e')]:_0x23d41a[_0xe832('0x1b')];_0x1d1f41[_0xe832('0x21')]=qs[_0xe832('0x22')](_0x56c145[_0xe832('0x19')][_0xe832('0x22')]);_0x1d1f41[_0xe832('0x23')]=qs[_0xe832('0x1a')](_[_0xe832('0x24')](_0x56c145['query'],_0x23d41a[_0xe832('0x1a')]));if(_0x56c145[_0xe832('0x19')][_0xe832('0x25')]){_0x1d1f41[_0xe832('0x23')]=_[_0xe832('0x26')](_0x1d1f41[_0xe832('0x23')],{'$or':_['map'](_0x1d1f41['attributes'],function(_0x4b3054){var _0x108749={};_0x108749[_0x4b3054]={'$like':'%'+_0x56c145[_0xe832('0x19')][_0xe832('0x25')]+'%'};return _0x108749;})});}_0x1d1f41=_[_0xe832('0x26')]({},_0x1d1f41,_0x56c145[_0xe832('0x28')]);return _0x69b4fb[_0xe832('0x36')](_0x1d1f41);}})[_0xe832('0xe')](function(_0x1a8507){if(_0x1a8507){_0x2faef1=_0x1a8507['length'];if(!_0x56c145[_0xe832('0x19')]['hasOwnProperty'](_0xe832('0x20'))){_0x1d1f41['limit']=qs['limit'](_0x56c145[_0xe832('0x19')][_0xe832('0x8')]);_0x1d1f41[_0xe832('0x6')]=qs[_0xe832('0x6')](_0x56c145[_0xe832('0x19')][_0xe832('0x6')]);}return _0x69b4fb['getConfigurations'](_0x1d1f41);}})[_0xe832('0xe')](function(_0x1189c2){if(_0x1189c2){return _0x1189c2?{'count':_0x2faef1,'rows':_0x1189c2}:null;}})[_0xe832('0xe')](respondWithResult(_0xb6a86,null))['catch'](handleError(_0xb6a86,null));};exports[_0xe832('0x37')]=function(_0x31415c,_0x5bbafb){if(_0x31415c[_0xe832('0x34')]['id']){delete _0x31415c[_0xe832('0x34')]['id'];}return db[_0xe832('0x16')][_0xe832('0x35')]({'where':{'id':_0x31415c['params']['id']}})[_0xe832('0xe')](handleEntityNotFound(_0x5bbafb,null))[_0xe832('0xe')](function(_0x55fda4){if(_0x55fda4){_0x31415c[_0xe832('0x34')][_0xe832('0x38')]=_0x55fda4['id'];_0x31415c[_0xe832('0x34')][_0xe832('0x39')]=integrations['getSubjects'](_0x31415c[_0xe832('0x34')][_0xe832('0x3a')],_0x31415c[_0xe832('0x34')][_0xe832('0x18')]);_0x31415c[_0xe832('0x34')]['Descriptions']=integrations[_0xe832('0x3b')](_0x31415c[_0xe832('0x34')]['channel'],_0x31415c['body'][_0xe832('0x18')]);return db[_0xe832('0x3c')][_0xe832('0x33')](_0x31415c['body'],{'include':[{'model':db[_0xe832('0x3d')],'as':_0xe832('0x39')},{'model':db[_0xe832('0x3d')],'as':'Descriptions'}]});}return null;})[_0xe832('0xe')](respondWithResult(_0x5bbafb,null))[_0xe832('0x2d')](handleError(_0x5bbafb,null));};function sanitizeRemoteUri(_0x222dab){var _0x56236a=_0x222dab[_0xe832('0x3e')](-0x1);if(_0x56236a==='/')return _0x222dab['substring'](0x0,_0x222dab['lastIndexOf'](_0x56236a));return _0x222dab;}function getWebApiUrl(_0x3a8271){return util[_0xe832('0x3f')](_0xe832('0x40'),_0x3a8271);}exports['getFields']=function(_0x253cab,_0x1330c2){var _0x165b21=_0x253cab[_0xe832('0x19')][_0xe832('0x41')];var _0x20a262=_0x165b21===_0xe832('0x42')?_0xe832('0x43'):'PhoneCall';var _0x180730='';var _0x31437f='';var _0x2f01b2='';var _0x5083a7='';var _0x1309af='';var _0x3fac7c='';var _0x318585='';var _0x470771='';var _0x1d43b0=[_0xe832('0x44'),_0xe832('0x45'),_0xe832('0x46'),_0xe832('0x47'),'caseorigincode',_0xe832('0x48'),'phonenumber',_0xe832('0x49'),_0xe832('0x4a'),_0xe832('0x4b')];var _0x1aa8b8=[_0xe832('0x4c'),_0xe832('0x4d'),'actualserviceunits',_0xe832('0x4e'),_0xe832('0x4f'),_0xe832('0x50'),_0xe832('0x51'),'contractidname',_0xe832('0x52'),'createdbyexternalpartyyominame',_0xe832('0x53'),_0xe832('0x54'),_0xe832('0x55'),_0xe832('0x56'),'createdonbehalfbyyominame',_0xe832('0x57'),'customeridtype',_0xe832('0x58'),_0xe832('0x59'),_0xe832('0x5a'),_0xe832('0x5b'),_0xe832('0x5c'),_0xe832('0x5d'),_0xe832('0x5e'),'firstresponsebykpiidname',_0xe832('0x5f'),'importsequencenumber',_0xe832('0x60'),_0xe832('0x61'),_0xe832('0x62'),_0xe832('0x63'),_0xe832('0x64'),_0xe832('0x65'),'modifiedbyname',_0xe832('0x66'),_0xe832('0x67'),'modifiedonbehalfbyname',_0xe832('0x68'),'msdyn_incidenttypename',_0xe832('0x69'),_0xe832('0x6a'),'onholdtime',_0xe832('0x6b'),_0xe832('0x6c'),_0xe832('0x6d'),_0xe832('0x6e'),'parentcaseidname','primarycontactidname',_0xe832('0x6f'),'prioritycodename',_0xe832('0x70'),'productserialnumber',_0xe832('0x71'),_0xe832('0x72'),_0xe832('0x73'),_0xe832('0x74'),_0xe832('0x75'),_0xe832('0x76'),'slainvokedidname',_0xe832('0x77'),_0xe832('0x78'),'statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber',_0xe832('0x79'),'traversedpath','utcconversiontimezonecode',_0xe832('0x7a')];var _0x434665=_0x1d43b0[_0xe832('0x7b')](_0x1aa8b8);return db[_0xe832('0x16')][_0xe832('0x35')]({'where':{'id':_0x253cab[_0xe832('0x2f')]['id']},'attributes':['id','username',_0xe832('0x7c'),'remoteUri','tenantId',_0xe832('0x7d'),_0xe832('0x7e'),_0xe832('0x7f')],'include':[{'model':db[_0xe832('0x80')],'as':'CloudProvider','attributes':['id',_0xe832('0x81'),'data7']}]})['then'](handleEntityNotFound(_0x1330c2,null))[_0xe832('0xe')](function(_0x24462f){if(_0x24462f){if(_0x24462f['modernAuthentication']){_0x24462f[_0xe832('0x82')]=_0x24462f[_0xe832('0x80')][_0xe832('0x81')];_0x470771=sanitizeRemoteUri(_0x24462f[_0xe832('0x80')][_0xe832('0x83')]);_0x318585=getWebApiUrl(_0x470771);return _0x24462f;}_0x470771=sanitizeRemoteUri(_0x24462f[_0xe832('0x84')]);_0x318585=getWebApiUrl(_0x470771);var _0x281fe9={'method':_0xe832('0x85'),'uri':_0xe832('0x86')+_0x24462f['tenantId']+'/oauth2/token','form':{'client_id':_0x24462f[_0xe832('0x7d')],'resource':_0x470771,'username':_0x24462f['username'],'password':_0x24462f['password'],'grant_type':_0xe832('0x7c'),'client_secret':_0x24462f['clientSecret']},'json':!![]};return rp(_0x281fe9);}})[_0xe832('0xe')](function(_0x21acbd){_0x3fac7c=_0x21acbd[_0xe832('0x82')];var _0x18e189={'method':'GET','uri':encodeURI(_0x318585+_0xe832('0x87')+_0x20a262+'\x27'),'headers':{'Authorization':_0xe832('0x88')+_0x3fac7c,'If-None-Match':null,'OData-Version':_0xe832('0x89')},'json':!![]};return rp(_0x18e189);})[_0xe832('0xe')](function(_0x315dd5){var _0x58d978=_0x315dd5[_0xe832('0x8a')][0x0];var _0xad79a9=_0x58d978[_0xe832('0x8b')];var _0x24b462={'method':'GET','uri':_0x318585+_0xe832('0x8c')+_0xad79a9+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xe832('0x88')+_0x3fac7c,'If-None-Match':null,'OData-Version':_0xe832('0x89')},'json':!![]};return rp(_0x24b462);})['then'](function(_0x7d1afa){_0x180730=_0x7d1afa;_0x31437f=_0x180730[_0xe832('0x8d')];_0x31437f=_['remove'](_0x31437f,function(_0x4d62c6){return!_0x434665[_0xe832('0x8e')](_0x4d62c6[_0xe832('0x8f')]);});var _0x457d2e=[];var _0x42c88a=[];_0x31437f[_0xe832('0x90')](function(_0x160841){if(_0x160841[_0xe832('0x91')]){var _0x55d729=_0x160841[_0xe832('0x91')][_0xe832('0x92')](_0x160841[_0xe832('0x91')]['lastIndexOf']('.')+0x1);if(_0x55d729==='PicklistAttributeMetadata'){_0x457d2e[_0xe832('0x93')](getSelectList(_0x318585,_0x165b21,_0x42c88a,_0x180730['MetadataId'],_0x160841['MetadataId'],_0x3fac7c));}}});return Promise[_0xe832('0x94')](_0x457d2e);})[_0xe832('0xe')](function(_0x14dd2b){_0x2f01b2=_0x14dd2b[0x0];var _0x4b3d7a=[];var _0x8cd579=[];_0x31437f[_0xe832('0x90')](function(_0x53138a){if(!_[_0xe832('0x95')](_0x53138a[_0xe832('0x91')])){var _0x4a923b=_0x53138a[_0xe832('0x91')][_0xe832('0x92')](_0x53138a[_0xe832('0x91')]['lastIndexOf']('.')+0x1);if(_0x4a923b===_0xe832('0x96')){_0x4b3d7a[_0xe832('0x93')](getBooleanList(_0x318585,_0x165b21,_0x8cd579,_0x180730[_0xe832('0x8b')],_0x53138a['MetadataId'],_0x3fac7c));}}});return Promise[_0xe832('0x94')](_0x4b3d7a);})[_0xe832('0xe')](function(_0x3844b4){_0x5083a7=_0x3844b4[0x0];var _0x15b119=[];var _0x23aacc=[];_0x31437f['forEach'](function(_0x147a07){if(_0x147a07[_0xe832('0x91')]){var _0x117a50=_0x147a07['@odata.type'][_0xe832('0x92')](_0x147a07['@odata.type'][_0xe832('0x97')]('.')+0x1);if(_0x117a50===_0xe832('0x98')||_0x117a50===_0xe832('0x99')||_0x117a50==='BigIntAttributeMetadata'||_0x117a50===_0xe832('0x9a')||_0x117a50===_0xe832('0x9b')||_0x117a50===_0xe832('0x9c')||_0x117a50===_0xe832('0x9d')||_0x117a50===_0xe832('0x9e')||_0x117a50==='StateAttributeMetadata'||_0x117a50===_0xe832('0x9f')){_0x15b119[_0xe832('0x93')](getInputList(_0x318585,_0x165b21,_0x117a50,_0x23aacc,_0x180730[_0xe832('0x8b')],_0x147a07['MetadataId'],_0x3fac7c));}}});return Promise[_0xe832('0x94')](_0x15b119);})[_0xe832('0xe')](function(_0x1e3311){_0x1309af=_0x1e3311[0x0];var _0xe313fe=_0x2f01b2[_0xe832('0x7b')](_0x5083a7)[_0xe832('0x7b')](_0x1309af);var _0x549c8a={'count':_0xe313fe[_0xe832('0x31')],'rows':_0xe313fe};return _0x549c8a;})[_0xe832('0xe')](respondWithResult(_0x1330c2,null))[_0xe832('0x2d')](function(_0x3ad141){var _0x2597a9=_0x253cab[_0xe832('0x19')][_0xe832('0xa0')]?0x1f4:_0x3ad141[_0xe832('0xa1')]||0x1f4;logger[_0xe832('0x10')](_0x3ad141['stack']);delete _0x3ad141[_0xe832('0x12')];if(_0x2597a9===0x191){_0x2597a9=0x190;}_0x1330c2['status'](_0x2597a9)[_0xe832('0x13')](_0x253cab[_0xe832('0x19')][_0xe832('0xa0')]?{'message':_0xe832('0xa2'),'statusCode':_0x3ad141[_0xe832('0xa1')]}:_0x3ad141);});};function getSelectList(_0x63c36e,_0x589104,_0x206604,_0x2a304c,_0x37dce4,_0x446fbb){var _0x4c4397={'method':_0xe832('0xa3'),'uri':_0x63c36e+_0xe832('0x8c')+_0x2a304c+_0xe832('0xa4')+_0x37dce4+_0xe832('0xa5')+_0xe832('0xa6'),'headers':{'Authorization':'Bearer\x20'+_0x446fbb,'If-None-Match':null,'OData-Version':_0xe832('0x89')},'json':!![]};return rp(_0x4c4397)[_0xe832('0xe')](function(_0x50f09a){var _0x27601e=[];var _0x20c4e0=_0x50f09a[_0xe832('0xa7')]['Options'];_0x20c4e0['forEach'](function(_0x595408){_0x27601e[_0xe832('0x93')]({'name':_0x595408[_0xe832('0xa8')][_0xe832('0xa9')]['Label'],'value':String(_0x595408[_0xe832('0xaa')])});});var _0x55bb1a={'id':_0x589104+'_'+_0x50f09a[_0xe832('0x8f')],'name':_0x50f09a[_0xe832('0xab')][_0xe832('0xa9')][_0xe832('0xa8')],'custom':![],'options':_0x27601e};_0x206604[_0xe832('0x93')](_0x55bb1a);return _0x206604;});}function getBooleanList(_0x3baebe,_0x4d6985,_0xf544e9,_0x248ab4,_0x142a78,_0x359964){var _0x56911d={'method':_0xe832('0xa3'),'uri':_0x3baebe+_0xe832('0x8c')+_0x248ab4+_0xe832('0xa4')+_0x142a78+_0xe832('0xac'),'headers':{'Authorization':'Bearer\x20'+_0x359964,'If-None-Match':null,'OData-Version':_0xe832('0x89')},'json':!![]};return rp(_0x56911d)['then'](function(_0x2d34c7){var _0x316d95=[];_0x316d95[_0xe832('0x93')]({'name':_0x2d34c7[_0xe832('0xa7')][_0xe832('0xad')][_0xe832('0xa8')][_0xe832('0xa9')][_0xe832('0xa8')],'value':_0xe832('0xae')},{'name':_0x2d34c7[_0xe832('0xa7')][_0xe832('0xaf')]['Label'][_0xe832('0xa9')][_0xe832('0xa8')],'value':'false'});var _0xdc41c5={'id':_0x4d6985+'_'+_0x2d34c7[_0xe832('0x8f')],'name':_0x2d34c7['DisplayName'][_0xe832('0xa9')][_0xe832('0xa8')],'custom':![],'options':_0x316d95};_0xf544e9[_0xe832('0x93')](_0xdc41c5);return _0xf544e9;});}function getInputList(_0x494e1b,_0x440ac9,_0x2ba657,_0x4854d9,_0x260571,_0x19e9c1,_0x3fa4d2){var _0x268daf={'method':_0xe832('0xa3'),'uri':_0x494e1b+'EntityDefinitions('+_0x260571+_0xe832('0xa4')+_0x19e9c1+_0xe832('0xb0')+_0x2ba657+_0xe832('0xb1'),'headers':{'Authorization':_0xe832('0x88')+_0x3fa4d2,'If-None-Match':null,'OData-Version':_0xe832('0x89')},'json':!![]};return rp(_0x268daf)['then'](function(_0x3f1b49){var _0x356450={'id':_0x440ac9+'_'+_0x3f1b49['LogicalName'],'name':_0x3f1b49[_0xe832('0xab')][_0xe832('0xa9')]?_0x3f1b49['DisplayName'][_0xe832('0xa9')]['Label']:_0x3f1b49['LogicalName'],'custom':![],'options':[]};_0x4854d9['push'](_0x356450);return _0x4854d9;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index ecae96a..b8e5040 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x593d89,_0x45145f){var _0x4aa403=function(_0x21f674){while(--_0x21f674){_0x593d89['push'](_0x593d89['shift']());}};_0x4aa403(++_0x45145f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x3e5d78,_0x7b823f){var _0x22ced5=function(_0x283b15){while(--_0x283b15){_0x3e5d78['push'](_0x3e5d78['shift']());}};_0x22ced5(++_0x7b823f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','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 0761a11..1521307 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 _0xf5af=['include','map','model','catch','ShowDynamics365Account','find','where','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','message','Dynamics365Account,\x20%s,\x20%s','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','limit'];(function(_0x4c8833,_0x14e755){var _0x30df54=function(_0x197811){while(--_0x197811){_0x4c8833['push'](_0x4c8833['shift']());}};_0x30df54(++_0x14e755);}(_0xf5af,0x143));var _0xff5a=function(_0x20d404,_0x50dd47){_0x20d404=_0x20d404-0x0;var _0x1805e6=_0xf5af[_0x20d404];return _0x1805e6;};'use strict';var _=require(_0xff5a('0x0'));var util=require('util');var moment=require(_0xff5a('0x1'));var BPromise=require(_0xff5a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff5a('0x3'));var db=require(_0xff5a('0x4'))['db'];var utils=require(_0xff5a('0x5'));var logger=require('../../config/logger')(_0xff5a('0x6'));var config=require(_0xff5a('0x7'));var jayson=require(_0xff5a('0x8'));var client=jayson[_0xff5a('0x9')][_0xff5a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x457931,_0x497aa2,_0x197b7a){return new BPromise(function(_0x1f2a67,_0x59ad84){return client[_0xff5a('0xb')](_0x457931,_0x197b7a)[_0xff5a('0xc')](function(_0x5287e8){logger[_0xff5a('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x497aa2,_0xff5a('0xe'));logger[_0xff5a('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x497aa2,_0xff5a('0xe'),JSON['stringify'](_0x5287e8));if(_0x5287e8[_0xff5a('0x10')]){if(_0x5287e8[_0xff5a('0x10')][_0xff5a('0x11')]===0x1f4){logger[_0xff5a('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x497aa2,_0x5287e8[_0xff5a('0x10')][_0xff5a('0x12')]);return _0x59ad84(_0x5287e8[_0xff5a('0x10')]['message']);}logger[_0xff5a('0x10')](_0xff5a('0x13'),_0x497aa2,_0x5287e8[_0xff5a('0x10')][_0xff5a('0x12')]);return _0x1f2a67(_0x5287e8['error'][_0xff5a('0x12')]);}else{logger[_0xff5a('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x497aa2,'request\x20sent');_0x1f2a67(_0x5287e8['result']['message']);}})['catch'](function(_0x45c80a){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x497aa2,_0x45c80a);_0x59ad84(_0x45c80a);});});}exports[_0xff5a('0x14')]=function(_0x42de04){var _0x1017e4=this;return new Promise(function(_0x50b8e4,_0x1a0d4e){return db[_0xff5a('0x15')][_0xff5a('0x16')]({'raw':_0x42de04[_0xff5a('0x17')]?_0x42de04[_0xff5a('0x17')][_0xff5a('0x18')]===undefined?!![]:![]:!![],'where':_0x42de04[_0xff5a('0x17')]?_0x42de04[_0xff5a('0x17')]['where']||null:null,'attributes':_0x42de04[_0xff5a('0x17')]?_0x42de04['options'][_0xff5a('0x19')]||null:null,'limit':_0x42de04[_0xff5a('0x17')]?_0x42de04[_0xff5a('0x17')][_0xff5a('0x1a')]||null:null,'include':_0x42de04[_0xff5a('0x17')]?_0x42de04[_0xff5a('0x17')][_0xff5a('0x1b')]?_[_0xff5a('0x1c')](_0x42de04['options'][_0xff5a('0x1b')],function(_0x2e284a){return{'model':db[_0x2e284a[_0xff5a('0x1d')]],'as':_0x2e284a['as'],'attributes':_0x2e284a[_0xff5a('0x19')],'include':_0x2e284a['include']?_[_0xff5a('0x1c')](_0x2e284a['include'],function(_0x4140bf){return{'model':db[_0x4140bf[_0xff5a('0x1d')]],'as':_0x4140bf['as'],'attributes':_0x4140bf[_0xff5a('0x19')],'include':_0x4140bf[_0xff5a('0x1b')]?_[_0xff5a('0x1c')](_0x4140bf['include'],function(_0x3a4863){return{'model':db[_0x3a4863[_0xff5a('0x1d')]],'as':_0x3a4863['as'],'attributes':_0x3a4863[_0xff5a('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b6c18){logger['info'](_0xff5a('0x14'),_0x42de04);logger[_0xff5a('0xf')](_0xff5a('0x14'),_0x42de04,JSON['stringify'](_0x4b6c18));_0x50b8e4(_0x4b6c18);})[_0xff5a('0x1e')](function(_0x99379d){logger[_0xff5a('0x10')]('GetDynamics365Account',_0x99379d[_0xff5a('0x12')],_0x42de04);_0x1a0d4e(_0x1017e4[_0xff5a('0x10')](0x1f4,_0x99379d[_0xff5a('0x12')]));});});};exports[_0xff5a('0x1f')]=function(_0x4283f8){var _0x5a5d99=this;return new Promise(function(_0x5e81cb,_0x464579){return db[_0xff5a('0x15')][_0xff5a('0x20')]({'raw':_0x4283f8[_0xff5a('0x17')]?_0x4283f8[_0xff5a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4283f8[_0xff5a('0x17')]?_0x4283f8[_0xff5a('0x17')][_0xff5a('0x21')]||null:null,'attributes':_0x4283f8['options']?_0x4283f8[_0xff5a('0x17')]['attributes']||null:null,'include':_0x4283f8[_0xff5a('0x17')]?_0x4283f8[_0xff5a('0x17')][_0xff5a('0x1b')]?_[_0xff5a('0x1c')](_0x4283f8[_0xff5a('0x17')][_0xff5a('0x1b')],function(_0x5a2e80){return{'model':db[_0x5a2e80['model']],'as':_0x5a2e80['as'],'attributes':_0x5a2e80[_0xff5a('0x19')],'include':_0x5a2e80[_0xff5a('0x1b')]?_[_0xff5a('0x1c')](_0x5a2e80[_0xff5a('0x1b')],function(_0xed003d){return{'model':db[_0xed003d[_0xff5a('0x1d')]],'as':_0xed003d['as'],'attributes':_0xed003d['attributes'],'include':_0xed003d[_0xff5a('0x1b')]?_[_0xff5a('0x1c')](_0xed003d['include'],function(_0xb6b3e6){return{'model':db[_0xb6b3e6[_0xff5a('0x1d')]],'as':_0xb6b3e6['as'],'attributes':_0xb6b3e6[_0xff5a('0x19')]};}):[]};}):[]};}):[]:[]})[_0xff5a('0xc')](function(_0x33591e){logger[_0xff5a('0xd')]('ShowDynamics365Account',_0x4283f8);logger[_0xff5a('0xf')](_0xff5a('0x1f'),_0x4283f8,JSON[_0xff5a('0x22')](_0x33591e));_0x5e81cb(_0x33591e);})[_0xff5a('0x1e')](function(_0x2e5d05){logger[_0xff5a('0x10')](_0xff5a('0x1f'),_0x2e5d05['message'],_0x4283f8);_0x464579(_0x5a5d99[_0xff5a('0x10')](0x1f4,_0x2e5d05[_0xff5a('0x12')]));});});}; \ No newline at end of file +var _0x80f8=['message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','map','include','model','then','ShowDynamics365Account','find','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s'];(function(_0x550dc1,_0x354d20){var _0x1bed6c=function(_0x4d9980){while(--_0x4d9980){_0x550dc1['push'](_0x550dc1['shift']());}};_0x1bed6c(++_0x354d20);}(_0x80f8,0x1aa));var _0x880f=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x80f8[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x880f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x880f('0x1'));var db=require(_0x880f('0x2'))['db'];var utils=require(_0x880f('0x3'));var logger=require(_0x880f('0x4'))(_0x880f('0x5'));var config=require('../../config/environment');var jayson=require(_0x880f('0x6'));var client=jayson[_0x880f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf8db0a,_0x83cc4c,_0x406704){return new BPromise(function(_0x4c081e,_0x202c38){return client[_0x880f('0x8')](_0xf8db0a,_0x406704)['then'](function(_0x31357f){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x83cc4c,_0x880f('0x9'));logger[_0x880f('0xa')](_0x880f('0xb'),_0x83cc4c,_0x880f('0x9'),JSON[_0x880f('0xc')](_0x31357f));if(_0x31357f['error']){if(_0x31357f[_0x880f('0xd')][_0x880f('0xe')]===0x1f4){logger[_0x880f('0xd')](_0x880f('0xf'),_0x83cc4c,_0x31357f[_0x880f('0xd')][_0x880f('0x10')]);return _0x202c38(_0x31357f[_0x880f('0xd')][_0x880f('0x10')]);}logger[_0x880f('0xd')](_0x880f('0xf'),_0x83cc4c,_0x31357f[_0x880f('0xd')]['message']);return _0x4c081e(_0x31357f[_0x880f('0xd')]['message']);}else{logger[_0x880f('0x11')](_0x880f('0xf'),_0x83cc4c,'request\x20sent');_0x4c081e(_0x31357f[_0x880f('0x12')][_0x880f('0x10')]);}})[_0x880f('0x13')](function(_0x9e23ab){logger[_0x880f('0xd')](_0x880f('0xf'),_0x83cc4c,_0x9e23ab);_0x202c38(_0x9e23ab);});});}exports[_0x880f('0x14')]=function(_0x32c4cf){var _0x5cb260=this;return new Promise(function(_0x5a00a6,_0xd82912){return db[_0x880f('0x15')][_0x880f('0x16')]({'raw':_0x32c4cf[_0x880f('0x17')]?_0x32c4cf[_0x880f('0x17')][_0x880f('0x18')]===undefined?!![]:![]:!![],'where':_0x32c4cf[_0x880f('0x17')]?_0x32c4cf['options'][_0x880f('0x19')]||null:null,'attributes':_0x32c4cf[_0x880f('0x17')]?_0x32c4cf[_0x880f('0x17')][_0x880f('0x1a')]||null:null,'limit':_0x32c4cf['options']?_0x32c4cf[_0x880f('0x17')][_0x880f('0x1b')]||null:null,'include':_0x32c4cf[_0x880f('0x17')]?_0x32c4cf['options']['include']?_[_0x880f('0x1c')](_0x32c4cf[_0x880f('0x17')][_0x880f('0x1d')],function(_0xbb70c7){return{'model':db[_0xbb70c7['model']],'as':_0xbb70c7['as'],'attributes':_0xbb70c7[_0x880f('0x1a')],'include':_0xbb70c7[_0x880f('0x1d')]?_['map'](_0xbb70c7[_0x880f('0x1d')],function(_0x535ca3){return{'model':db[_0x535ca3['model']],'as':_0x535ca3['as'],'attributes':_0x535ca3['attributes'],'include':_0x535ca3['include']?_[_0x880f('0x1c')](_0x535ca3['include'],function(_0x138a01){return{'model':db[_0x138a01[_0x880f('0x1e')]],'as':_0x138a01['as'],'attributes':_0x138a01[_0x880f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x880f('0x1f')](function(_0x2321f2){logger[_0x880f('0x11')](_0x880f('0x14'),_0x32c4cf);logger[_0x880f('0xa')](_0x880f('0x14'),_0x32c4cf,JSON['stringify'](_0x2321f2));_0x5a00a6(_0x2321f2);})[_0x880f('0x13')](function(_0x10238b){logger[_0x880f('0xd')](_0x880f('0x14'),_0x10238b[_0x880f('0x10')],_0x32c4cf);_0xd82912(_0x5cb260[_0x880f('0xd')](0x1f4,_0x10238b[_0x880f('0x10')]));});});};exports[_0x880f('0x20')]=function(_0x1abf6b){var _0x54645e=this;return new Promise(function(_0x494d61,_0x465455){return db[_0x880f('0x15')][_0x880f('0x21')]({'raw':_0x1abf6b[_0x880f('0x17')]?_0x1abf6b[_0x880f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1abf6b['options']?_0x1abf6b[_0x880f('0x17')][_0x880f('0x19')]||null:null,'attributes':_0x1abf6b['options']?_0x1abf6b[_0x880f('0x17')][_0x880f('0x1a')]||null:null,'include':_0x1abf6b[_0x880f('0x17')]?_0x1abf6b['options'][_0x880f('0x1d')]?_[_0x880f('0x1c')](_0x1abf6b['options'][_0x880f('0x1d')],function(_0xaf907){return{'model':db[_0xaf907['model']],'as':_0xaf907['as'],'attributes':_0xaf907[_0x880f('0x1a')],'include':_0xaf907[_0x880f('0x1d')]?_[_0x880f('0x1c')](_0xaf907['include'],function(_0x42d4e6){return{'model':db[_0x42d4e6[_0x880f('0x1e')]],'as':_0x42d4e6['as'],'attributes':_0x42d4e6['attributes'],'include':_0x42d4e6[_0x880f('0x1d')]?_[_0x880f('0x1c')](_0x42d4e6['include'],function(_0x4e8ab7){return{'model':db[_0x4e8ab7[_0x880f('0x1e')]],'as':_0x4e8ab7['as'],'attributes':_0x4e8ab7[_0x880f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x880f('0x1f')](function(_0x5f1e8d){logger[_0x880f('0x11')](_0x880f('0x20'),_0x1abf6b);logger[_0x880f('0xa')](_0x880f('0x20'),_0x1abf6b,JSON[_0x880f('0xc')](_0x5f1e8d));_0x494d61(_0x5f1e8d);})[_0x880f('0x13')](function(_0x1ee05e){logger[_0x880f('0xd')]('ShowDynamics365Account',_0x1ee05e[_0x880f('0x10')],_0x1abf6b);_0x465455(_0x54645e[_0x880f('0xd')](0x1f4,_0x1ee05e['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index e9ab172..209117f 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 _0xe547=['destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete'];(function(_0x4057de,_0x4d57af){var _0x84d684=function(_0x4bf471){while(--_0x4bf471){_0x4057de['push'](_0x4057de['shift']());}};_0x84d684(++_0x4d57af);}(_0xe547,0x191));var _0x7e54=function(_0x2ac971,_0x2bd8df){_0x2ac971=_0x2ac971-0x0;var _0x26c886=_0xe547[_0x2ac971];return _0x26c886;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7e54('0x0'));var timeout=require(_0x7e54('0x1'));var express=require(_0x7e54('0x2'));var router=express[_0x7e54('0x3')]();var fs_extra=require(_0x7e54('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7e54('0x5'));var config=require(_0x7e54('0x6'));var controller=require(_0x7e54('0x7'));router[_0x7e54('0x8')]('/',auth[_0x7e54('0x9')](),controller[_0x7e54('0xa')]);router[_0x7e54('0x8')]('/:id',auth[_0x7e54('0x9')](),controller[_0x7e54('0xb')]);router[_0x7e54('0x8')](_0x7e54('0xc'),auth[_0x7e54('0x9')](),controller[_0x7e54('0xd')]);router[_0x7e54('0x8')](_0x7e54('0xe'),auth[_0x7e54('0x9')](),controller[_0x7e54('0xf')]);router[_0x7e54('0x8')](_0x7e54('0x10'),auth[_0x7e54('0x9')](),controller[_0x7e54('0x11')]);router[_0x7e54('0x12')]('/',auth['isAuthenticated'](),controller[_0x7e54('0x13')]);router[_0x7e54('0x14')](_0x7e54('0x15'),auth['isAuthenticated'](),controller[_0x7e54('0x16')]);router[_0x7e54('0x17')](_0x7e54('0x15'),auth[_0x7e54('0x9')](),controller[_0x7e54('0x18')]);module['exports']=router; \ No newline at end of file +var _0x8b09=['getFields','/:id/subjects','getDescriptions','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id'];(function(_0x4f3e4a,_0x6d741d){var _0x2e9202=function(_0xe380){while(--_0xe380){_0x4f3e4a['push'](_0x4f3e4a['shift']());}};_0x2e9202(++_0x6d741d);}(_0x8b09,0x153));var _0x98b0=function(_0x67fda8,_0x3a15c0){_0x67fda8=_0x67fda8-0x0;var _0x46569b=_0x8b09[_0x67fda8];return _0x46569b;};'use strict';var multer=require(_0x98b0('0x0'));var util=require(_0x98b0('0x1'));var path=require(_0x98b0('0x2'));var timeout=require(_0x98b0('0x3'));var express=require(_0x98b0('0x4'));var router=express[_0x98b0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x98b0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x98b0('0x7'));var controller=require(_0x98b0('0x8'));router[_0x98b0('0x9')]('/',auth[_0x98b0('0xa')](),controller[_0x98b0('0xb')]);router[_0x98b0('0x9')](_0x98b0('0xc'),auth[_0x98b0('0xa')](),controller['show']);router[_0x98b0('0x9')]('/:id/fields',auth[_0x98b0('0xa')](),controller[_0x98b0('0xd')]);router[_0x98b0('0x9')](_0x98b0('0xe'),auth[_0x98b0('0xa')](),controller['getSubjects']);router[_0x98b0('0x9')]('/:id/descriptions',auth[_0x98b0('0xa')](),controller[_0x98b0('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x98b0('0x10')]);router[_0x98b0('0x11')](_0x98b0('0xc'),auth[_0x98b0('0xa')](),controller[_0x98b0('0x12')]);router[_0x98b0('0x13')](_0x98b0('0xc'),auth[_0x98b0('0xa')](),controller[_0x98b0('0x14')]);module[_0x98b0('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 547bb34..3e37e8d 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 _0xde91=['incident','phonecall','nothing','sequelize','exports','STRING','ENUM'];(function(_0x2879e5,_0x428e73){var _0x5cc17e=function(_0x168aca){while(--_0x168aca){_0x2879e5['push'](_0x2879e5['shift']());}};_0x5cc17e(++_0x428e73);}(_0xde91,0x14c));var _0x1de9=function(_0xe719ec,_0x5a280e){_0xe719ec=_0xe719ec-0x0;var _0x4842a1=_0xde91[_0xe719ec];return _0x4842a1;};'use strict';var Sequelize=require(_0x1de9('0x0'));module[_0x1de9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1de9('0x2')]},'ticketType':{'type':Sequelize[_0x1de9('0x3')](_0x1de9('0x4'),_0x1de9('0x5')),'defaultValue':_0x1de9('0x4')},'moduleCreate':{'type':Sequelize['ENUM']('contact',_0x1de9('0x6')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x1de9('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xc288=['nothing','sequelize','exports','STRING','ENUM','incident','phonecall','contact'];(function(_0x36a94f,_0x3fcc6c){var _0x4ba69f=function(_0x362371){while(--_0x362371){_0x36a94f['push'](_0x36a94f['shift']());}};_0x4ba69f(++_0x3fcc6c);}(_0xc288,0xa9));var _0x8c28=function(_0x4d6739,_0x1457da){_0x4d6739=_0x4d6739-0x0;var _0x1d8aa2=_0xc288[_0x4d6739];return _0x1d8aa2;};'use strict';var Sequelize=require(_0x8c28('0x0'));module[_0x8c28('0x1')]={'name':{'type':Sequelize[_0x8c28('0x2')]},'description':{'type':Sequelize[_0x8c28('0x2')]},'ticketType':{'type':Sequelize[_0x8c28('0x3')](_0x8c28('0x4'),_0x8c28('0x5')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x8c28('0x3')](_0x8c28('0x6'),_0x8c28('0x7')),'defaultValue':_0x8c28('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x8c28('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 20e38d8..892a809 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 _0xd85f=['rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','catch','show','find','create','body','params','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel','crypto','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/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','name','map','Dynamics365Configuration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd85f,0x14e));var _0xfd85=function(_0x22db93,_0x550664){_0x22db93=_0x22db93-0x0;var _0x141424=_0xd85f[_0x22db93];return _0x141424;};'use strict';var emlformat=require(_0xfd85('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfd85('0x1'));var rp=require(_0xfd85('0x2'));var moment=require(_0xfd85('0x3'));var BPromise=require(_0xfd85('0x4'));var Mustache=require('mustache');var util=require(_0xfd85('0x5'));var path=require(_0xfd85('0x6'));var sox=require(_0xfd85('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfd85('0x8'));var squel=require(_0xfd85('0x9'));var crypto=require(_0xfd85('0xa'));var jsforce=require(_0xfd85('0xb'));var deskjs=require(_0xfd85('0xc'));var toCsv=require(_0xfd85('0xd'));var querystring=require(_0xfd85('0xe'));var Papa=require(_0xfd85('0xf'));var Redis=require('ioredis');var authService=require(_0xfd85('0x10'));var qs=require(_0xfd85('0x11'));var as=require(_0xfd85('0x12'));var hardwareService=require(_0xfd85('0x13'));var logger=require(_0xfd85('0x14'))(_0xfd85('0x15'));var utils=require(_0xfd85('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xfd85('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x135c3f,_0x356f06){_0x356f06=_0x356f06||0xcc;return function(_0x5baa9e){if(_0x5baa9e){return _0x135c3f[_0xfd85('0x18')](_0x356f06);}return _0x135c3f[_0xfd85('0x19')](_0x356f06)[_0xfd85('0x1a')]();};}function respondWithResult(_0x2614a8,_0x4a4931){_0x4a4931=_0x4a4931||0xc8;return function(_0x556411){if(_0x556411){return _0x2614a8[_0xfd85('0x19')](_0x4a4931)[_0xfd85('0x1b')](_0x556411);}};}function respondWithFilteredResult(_0x405752,_0x59ff4c){return function(_0x462a40){if(_0x462a40){var _0xbb5e9d=typeof _0x59ff4c[_0xfd85('0x1c')]===_0xfd85('0x1d')&&typeof _0x59ff4c[_0xfd85('0x1e')]===_0xfd85('0x1d');var _0x44f809=_0x462a40[_0xfd85('0x1f')];var _0xc7822d=_0xbb5e9d?0x0:_0x59ff4c['offset'];var _0xdbd8f9=_0xbb5e9d?_0x462a40[_0xfd85('0x1f')]:_0x59ff4c[_0xfd85('0x1c')]+_0x59ff4c[_0xfd85('0x1e')];var _0x359aa5;if(_0xdbd8f9>=_0x44f809){_0xdbd8f9=_0x44f809;_0x359aa5=0xc8;}else{_0x359aa5=0xce;}_0x405752[_0xfd85('0x19')](_0x359aa5);return _0x405752['set'](_0xfd85('0x20'),_0xc7822d+'-'+_0xdbd8f9+'/'+_0x44f809)[_0xfd85('0x1b')](_0x462a40);}return null;};}function patchUpdates(_0x4d4d1d){return function(_0x4ca1a9){try{jsonpatch[_0xfd85('0x21')](_0x4ca1a9,_0x4d4d1d,!![]);}catch(_0x3bc829){return BPromise[_0xfd85('0x22')](_0x3bc829);}return _0x4ca1a9['save']();};}function saveUpdates(_0x33983d,_0x1d25ad){return function(_0x181b34){if(_0x181b34){return _0x181b34[_0xfd85('0x23')](_0x33983d)[_0xfd85('0x24')](function(_0x45e314){return _0x45e314;});}return null;};}function removeEntity(_0x176d16,_0x3c68bf){return function(_0x22a5b9){if(_0x22a5b9){return _0x22a5b9[_0xfd85('0x25')]()[_0xfd85('0x24')](function(){_0x176d16[_0xfd85('0x19')](0xcc)[_0xfd85('0x1a')]();});}};}function handleEntityNotFound(_0x77013e,_0x358044){return function(_0x20fd10){if(!_0x20fd10){_0x77013e[_0xfd85('0x18')](0x194);}return _0x20fd10;};}function handleError(_0x5e9f65,_0x1bdca9){_0x1bdca9=_0x1bdca9||0x1f4;return function(_0x2c7603){logger['error'](_0x2c7603['stack']);if(_0x2c7603[_0xfd85('0x26')]){delete _0x2c7603[_0xfd85('0x26')];}_0x5e9f65[_0xfd85('0x19')](_0x1bdca9)['send'](_0x2c7603);};}exports['index']=function(_0x3c70bc,_0x23d26c){var _0x4b53ed={},_0x788947={},_0x5690f8={'count':0x0,'rows':[]};var _0x4dfc60=_[_0xfd85('0x27')](db[_0xfd85('0x28')][_0xfd85('0x29')],function(_0x56b2ff){return{'name':_0x56b2ff[_0xfd85('0x2a')],'type':_0x56b2ff[_0xfd85('0x2b')]['key']};});_0x788947[_0xfd85('0x2c')]=_[_0xfd85('0x27')](_0x4dfc60,_0xfd85('0x26'));_0x788947[_0xfd85('0x2d')]=_[_0xfd85('0x2e')](_0x3c70bc['query']);_0x788947[_0xfd85('0x2f')]=_['intersection'](_0x788947[_0xfd85('0x2c')],_0x788947[_0xfd85('0x2d')]);_0x4b53ed[_0xfd85('0x30')]=_[_0xfd85('0x31')](_0x788947[_0xfd85('0x2c')],qs['fields'](_0x3c70bc['query'][_0xfd85('0x32')]));_0x4b53ed['attributes']=_0x4b53ed[_0xfd85('0x30')][_0xfd85('0x33')]?_0x4b53ed[_0xfd85('0x30')]:_0x788947[_0xfd85('0x2c')];if(!_0x3c70bc[_0xfd85('0x2d')][_0xfd85('0x34')](_0xfd85('0x35'))){_0x4b53ed['limit']=qs[_0xfd85('0x1e')](_0x3c70bc[_0xfd85('0x2d')][_0xfd85('0x1e')]);_0x4b53ed[_0xfd85('0x1c')]=qs[_0xfd85('0x1c')](_0x3c70bc[_0xfd85('0x2d')][_0xfd85('0x1c')]);}_0x4b53ed[_0xfd85('0x36')]=qs[_0xfd85('0x37')](_0x3c70bc[_0xfd85('0x2d')][_0xfd85('0x37')]);_0x4b53ed['where']=qs['filters'](_[_0xfd85('0x38')](_0x3c70bc[_0xfd85('0x2d')],_0x788947['filters']),_0x4dfc60);if(_0x3c70bc[_0xfd85('0x2d')][_0xfd85('0x39')]){_0x4b53ed['where']=_[_0xfd85('0x3a')](_0x4b53ed[_0xfd85('0x3b')],{'$or':_[_0xfd85('0x27')](_0x4dfc60,function(_0x165ec0){if(_0x165ec0[_0xfd85('0x2b')]!==_0xfd85('0x3c')){var _0x2dba9a={};_0x2dba9a[_0x165ec0[_0xfd85('0x26')]]={'$like':'%'+_0x3c70bc[_0xfd85('0x2d')][_0xfd85('0x39')]+'%'};return _0x2dba9a;}})});}_0x4b53ed=_[_0xfd85('0x3a')]({},_0x4b53ed,_0x3c70bc[_0xfd85('0x3d')]);var _0x176efd={'where':_0x4b53ed['where']};return db[_0xfd85('0x28')]['count'](_0x176efd)[_0xfd85('0x24')](function(_0x593e27){_0x5690f8['count']=_0x593e27;if(_0x3c70bc[_0xfd85('0x2d')][_0xfd85('0x3e')]){_0x4b53ed['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xfd85('0x3f')](_0x4b53ed);})[_0xfd85('0x24')](function(_0x56ed7b){_0x5690f8['rows']=_0x56ed7b;return _0x5690f8;})[_0xfd85('0x24')](respondWithFilteredResult(_0x23d26c,_0x4b53ed))[_0xfd85('0x40')](handleError(_0x23d26c,null));};exports[_0xfd85('0x41')]=function(_0x271bfd,_0x19c88e){var _0xa182b2={'raw':![],'where':{'id':_0x271bfd['params']['id']}},_0x421933={};_0x421933[_0xfd85('0x2c')]=_[_0xfd85('0x2e')](db[_0xfd85('0x28')][_0xfd85('0x29')]);_0x421933[_0xfd85('0x2d')]=_[_0xfd85('0x2e')](_0x271bfd[_0xfd85('0x2d')]);_0x421933[_0xfd85('0x2f')]=_[_0xfd85('0x31')](_0x421933[_0xfd85('0x2c')],_0x421933[_0xfd85('0x2d')]);_0xa182b2[_0xfd85('0x30')]=_[_0xfd85('0x31')](_0x421933[_0xfd85('0x2c')],qs['fields'](_0x271bfd['query'][_0xfd85('0x32')]));_0xa182b2[_0xfd85('0x30')]=_0xa182b2['attributes']['length']?_0xa182b2[_0xfd85('0x30')]:_0x421933['model'];if(_0x271bfd[_0xfd85('0x2d')]['includeAll']){_0xa182b2['include']=[{'all':!![]}];}_0xa182b2=_[_0xfd85('0x3a')]({},_0xa182b2,_0x271bfd[_0xfd85('0x3d')]);return db[_0xfd85('0x28')][_0xfd85('0x42')](_0xa182b2)[_0xfd85('0x24')](handleEntityNotFound(_0x19c88e,null))[_0xfd85('0x24')](respondWithResult(_0x19c88e,null))[_0xfd85('0x40')](handleError(_0x19c88e,null));};exports[_0xfd85('0x43')]=function(_0x585fa8,_0x4e345e){return db[_0xfd85('0x28')][_0xfd85('0x43')](_0x585fa8[_0xfd85('0x44')],{})[_0xfd85('0x24')](respondWithResult(_0x4e345e,0xc9))[_0xfd85('0x40')](handleError(_0x4e345e,null));};exports[_0xfd85('0x23')]=function(_0x79c37b,_0x152890){if(_0x79c37b[_0xfd85('0x44')]['id']){delete _0x79c37b[_0xfd85('0x44')]['id'];}return db['Dynamics365Configuration'][_0xfd85('0x42')]({'where':{'id':_0x79c37b[_0xfd85('0x45')]['id']}})[_0xfd85('0x24')](handleEntityNotFound(_0x152890,null))[_0xfd85('0x24')](saveUpdates(_0x79c37b[_0xfd85('0x44')],null))[_0xfd85('0x24')](respondWithResult(_0x152890,null))[_0xfd85('0x40')](handleError(_0x152890,null));};exports[_0xfd85('0x25')]=function(_0x411457,_0x353701){return db[_0xfd85('0x28')][_0xfd85('0x42')]({'where':{'id':_0x411457['params']['id']}})[_0xfd85('0x24')](handleEntityNotFound(_0x353701,null))[_0xfd85('0x24')](removeEntity(_0x353701,null))[_0xfd85('0x40')](handleError(_0x353701,null));};exports[_0xfd85('0x46')]=function(_0x1276fe,_0x4b9aa4,_0x35998e){var _0xa24db8={};var _0x13670a={};var _0x341183;var _0x2f3648;return db[_0xfd85('0x28')][_0xfd85('0x47')]({'where':{'id':_0x1276fe[_0xfd85('0x45')]['id']}})[_0xfd85('0x24')](handleEntityNotFound(_0x4b9aa4,null))[_0xfd85('0x24')](function(_0x55a169){if(_0x55a169){_0x341183=_0x55a169;_0x13670a[_0xfd85('0x2c')]=_[_0xfd85('0x2e')](db[_0xfd85('0x48')]['rawAttributes']);_0x13670a[_0xfd85('0x2d')]=_[_0xfd85('0x2e')](_0x1276fe['query']);_0x13670a[_0xfd85('0x2f')]=_[_0xfd85('0x31')](_0x13670a[_0xfd85('0x2c')],_0x13670a[_0xfd85('0x2d')]);_0xa24db8[_0xfd85('0x30')]=_[_0xfd85('0x31')](_0x13670a[_0xfd85('0x2c')],qs[_0xfd85('0x32')](_0x1276fe[_0xfd85('0x2d')][_0xfd85('0x32')]));_0xa24db8[_0xfd85('0x30')]=_0xa24db8[_0xfd85('0x30')][_0xfd85('0x33')]?_0xa24db8[_0xfd85('0x30')]:_0x13670a[_0xfd85('0x2c')];_0xa24db8['order']=qs[_0xfd85('0x37')](_0x1276fe[_0xfd85('0x2d')][_0xfd85('0x37')]);_0xa24db8[_0xfd85('0x3b')]=qs['filters'](_[_0xfd85('0x38')](_0x1276fe[_0xfd85('0x2d')],_0x13670a[_0xfd85('0x2f')]));if(_0x1276fe[_0xfd85('0x2d')][_0xfd85('0x39')]){_0xa24db8[_0xfd85('0x3b')]=_[_0xfd85('0x3a')](_0xa24db8[_0xfd85('0x3b')],{'$or':_['map'](_0xa24db8[_0xfd85('0x30')],function(_0xb198aa){var _0x248326={};_0x248326[_0xb198aa]={'$like':'%'+_0x1276fe['query']['filter']+'%'};return _0x248326;})});}_0xa24db8=_[_0xfd85('0x3a')]({},_0xa24db8,_0x1276fe[_0xfd85('0x3d')]);return _0x341183['getFields'](_0xa24db8);}})[_0xfd85('0x24')](function(_0x18d290){if(_0x18d290){_0x2f3648=_0x18d290[_0xfd85('0x33')];if(!_0x1276fe['query'][_0xfd85('0x34')](_0xfd85('0x35'))){_0xa24db8[_0xfd85('0x1e')]=qs[_0xfd85('0x1e')](_0x1276fe[_0xfd85('0x2d')][_0xfd85('0x1e')]);_0xa24db8[_0xfd85('0x1c')]=qs[_0xfd85('0x1c')](_0x1276fe['query'][_0xfd85('0x1c')]);}return _0x341183[_0xfd85('0x46')](_0xa24db8);}})[_0xfd85('0x24')](function(_0x252bbe){if(_0x252bbe){return _0x252bbe?{'count':_0x2f3648,'rows':_0x252bbe}:null;}})[_0xfd85('0x24')](respondWithResult(_0x4b9aa4,null))['catch'](handleError(_0x4b9aa4,null));};exports[_0xfd85('0x49')]=function(_0x5d018e,_0x57a04d,_0x1b2238){var _0x3845b4={};var _0x4ecd2c={};var _0x5701bc;var _0x456ed6;return db['Dynamics365Configuration'][_0xfd85('0x47')]({'where':{'id':_0x5d018e[_0xfd85('0x45')]['id']}})['then'](handleEntityNotFound(_0x57a04d,null))[_0xfd85('0x24')](function(_0x523591){if(_0x523591){_0x5701bc=_0x523591;_0x4ecd2c[_0xfd85('0x2c')]=_[_0xfd85('0x2e')](db['Dynamics365Field'][_0xfd85('0x29')]);_0x4ecd2c['query']=_['keys'](_0x5d018e['query']);_0x4ecd2c['filters']=_[_0xfd85('0x31')](_0x4ecd2c['model'],_0x4ecd2c[_0xfd85('0x2d')]);_0x3845b4[_0xfd85('0x30')]=_[_0xfd85('0x31')](_0x4ecd2c[_0xfd85('0x2c')],qs[_0xfd85('0x32')](_0x5d018e[_0xfd85('0x2d')][_0xfd85('0x32')]));_0x3845b4[_0xfd85('0x30')]=_0x3845b4[_0xfd85('0x30')][_0xfd85('0x33')]?_0x3845b4[_0xfd85('0x30')]:_0x4ecd2c[_0xfd85('0x2c')];_0x3845b4[_0xfd85('0x36')]=qs[_0xfd85('0x37')](_0x5d018e[_0xfd85('0x2d')][_0xfd85('0x37')]);_0x3845b4[_0xfd85('0x3b')]=qs[_0xfd85('0x2f')](_['pick'](_0x5d018e[_0xfd85('0x2d')],_0x4ecd2c['filters']));if(_0x5d018e[_0xfd85('0x2d')][_0xfd85('0x39')]){_0x3845b4[_0xfd85('0x3b')]=_[_0xfd85('0x3a')](_0x3845b4[_0xfd85('0x3b')],{'$or':_[_0xfd85('0x27')](_0x3845b4[_0xfd85('0x30')],function(_0x19c6ea){var _0x5ebb70={};_0x5ebb70[_0x19c6ea]={'$like':'%'+_0x5d018e[_0xfd85('0x2d')][_0xfd85('0x39')]+'%'};return _0x5ebb70;})});}_0x3845b4=_[_0xfd85('0x3a')]({},_0x3845b4,_0x5d018e['options']);return _0x5701bc[_0xfd85('0x49')](_0x3845b4);}})['then'](function(_0x5eb353){if(_0x5eb353){_0x456ed6=_0x5eb353[_0xfd85('0x33')];if(!_0x5d018e[_0xfd85('0x2d')][_0xfd85('0x34')](_0xfd85('0x35'))){_0x3845b4[_0xfd85('0x1e')]=qs['limit'](_0x5d018e['query'][_0xfd85('0x1e')]);_0x3845b4[_0xfd85('0x1c')]=qs[_0xfd85('0x1c')](_0x5d018e[_0xfd85('0x2d')][_0xfd85('0x1c')]);}return _0x5701bc[_0xfd85('0x49')](_0x3845b4);}})[_0xfd85('0x24')](function(_0x52955e){if(_0x52955e){return _0x52955e?{'count':_0x456ed6,'rows':_0x52955e}:null;}})['then'](respondWithResult(_0x57a04d,null))[_0xfd85('0x40')](handleError(_0x57a04d,null));};exports['getDescriptions']=function(_0x8a696e,_0x1ab81b,_0x365f1b){var _0x28277d={};var _0x3ca55f={};var _0xd1477f;var _0x1ca6be;return db[_0xfd85('0x28')][_0xfd85('0x47')]({'where':{'id':_0x8a696e['params']['id']}})[_0xfd85('0x24')](handleEntityNotFound(_0x1ab81b,null))['then'](function(_0x105f41){if(_0x105f41){_0xd1477f=_0x105f41;_0x3ca55f[_0xfd85('0x2c')]=_[_0xfd85('0x2e')](db[_0xfd85('0x48')][_0xfd85('0x29')]);_0x3ca55f['query']=_['keys'](_0x8a696e[_0xfd85('0x2d')]);_0x3ca55f['filters']=_['intersection'](_0x3ca55f[_0xfd85('0x2c')],_0x3ca55f[_0xfd85('0x2d')]);_0x28277d[_0xfd85('0x30')]=_[_0xfd85('0x31')](_0x3ca55f[_0xfd85('0x2c')],qs[_0xfd85('0x32')](_0x8a696e[_0xfd85('0x2d')]['fields']));_0x28277d[_0xfd85('0x30')]=_0x28277d['attributes']['length']?_0x28277d[_0xfd85('0x30')]:_0x3ca55f['model'];_0x28277d[_0xfd85('0x36')]=qs[_0xfd85('0x37')](_0x8a696e[_0xfd85('0x2d')][_0xfd85('0x37')]);_0x28277d['where']=qs['filters'](_[_0xfd85('0x38')](_0x8a696e[_0xfd85('0x2d')],_0x3ca55f[_0xfd85('0x2f')]));if(_0x8a696e[_0xfd85('0x2d')]['filter']){_0x28277d[_0xfd85('0x3b')]=_[_0xfd85('0x3a')](_0x28277d[_0xfd85('0x3b')],{'$or':_['map'](_0x28277d[_0xfd85('0x30')],function(_0x449a8a){var _0x19bceb={};_0x19bceb[_0x449a8a]={'$like':'%'+_0x8a696e[_0xfd85('0x2d')][_0xfd85('0x39')]+'%'};return _0x19bceb;})});}_0x28277d=_[_0xfd85('0x3a')]({},_0x28277d,_0x8a696e[_0xfd85('0x3d')]);return _0xd1477f[_0xfd85('0x4a')](_0x28277d);}})[_0xfd85('0x24')](function(_0x3db28e){if(_0x3db28e){_0x1ca6be=_0x3db28e['length'];if(!_0x8a696e[_0xfd85('0x2d')][_0xfd85('0x34')](_0xfd85('0x35'))){_0x28277d[_0xfd85('0x1e')]=qs[_0xfd85('0x1e')](_0x8a696e[_0xfd85('0x2d')][_0xfd85('0x1e')]);_0x28277d[_0xfd85('0x1c')]=qs['offset'](_0x8a696e['query']['offset']);}return _0xd1477f[_0xfd85('0x4a')](_0x28277d);}})[_0xfd85('0x24')](function(_0x2a6686){if(_0x2a6686){return _0x2a6686?{'count':_0x1ca6be,'rows':_0x2a6686}:null;}})['then'](respondWithResult(_0x1ab81b,null))[_0xfd85('0x40')](handleError(_0x1ab81b,null));}; \ No newline at end of file +var _0x4188=['filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','catch','params','rawAttributes','keys','include','find','create','body','getFields','Dynamics365Field','findOne','options','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','error','stack','name','index','map','Dynamics365Configuration','fieldName','type','key','query'];(function(_0xd2c4f9,_0xd778c2){var _0xbb64eb=function(_0x31613f){while(--_0x31613f){_0xd2c4f9['push'](_0xd2c4f9['shift']());}};_0xbb64eb(++_0xd778c2);}(_0x4188,0xf5));var _0x8418=function(_0x3772a3,_0x56ba91){_0x3772a3=_0x3772a3-0x0;var _0x370e49=_0x4188[_0x3772a3];return _0x370e49;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8418('0x0'));var zipdir=require(_0x8418('0x1'));var jsonpatch=require(_0x8418('0x2'));var rp=require('request-promise');var moment=require(_0x8418('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8418('0x4'));var csv=require(_0x8418('0x5'));var ejs=require(_0x8418('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8418('0x7'));var squel=require(_0x8418('0x8'));var crypto=require(_0x8418('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8418('0xa'));var toCsv=require(_0x8418('0x5'));var querystring=require('querystring');var Papa=require(_0x8418('0xb'));var Redis=require(_0x8418('0xc'));var authService=require(_0x8418('0xd'));var qs=require(_0x8418('0xe'));var as=require(_0x8418('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8418('0x10'))('api');var utils=require(_0x8418('0x11'));var config=require(_0x8418('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52b280,_0x23b283){_0x23b283=_0x23b283||0xcc;return function(_0x2627b2){if(_0x2627b2){return _0x52b280[_0x8418('0x13')](_0x23b283);}return _0x52b280[_0x8418('0x14')](_0x23b283)[_0x8418('0x15')]();};}function respondWithResult(_0x381f83,_0x43d772){_0x43d772=_0x43d772||0xc8;return function(_0x45b3da){if(_0x45b3da){return _0x381f83['status'](_0x43d772)['json'](_0x45b3da);}};}function respondWithFilteredResult(_0x261789,_0x37fb96){return function(_0xdccc91){if(_0xdccc91){var _0xdc2501=typeof _0x37fb96[_0x8418('0x16')]===_0x8418('0x17')&&typeof _0x37fb96[_0x8418('0x18')]==='undefined';var _0x36fbec=_0xdccc91[_0x8418('0x19')];var _0x39e7dc=_0xdc2501?0x0:_0x37fb96[_0x8418('0x16')];var _0x12289a=_0xdc2501?_0xdccc91[_0x8418('0x19')]:_0x37fb96[_0x8418('0x16')]+_0x37fb96[_0x8418('0x18')];var _0x1a8ded;if(_0x12289a>=_0x36fbec){_0x12289a=_0x36fbec;_0x1a8ded=0xc8;}else{_0x1a8ded=0xce;}_0x261789[_0x8418('0x14')](_0x1a8ded);return _0x261789[_0x8418('0x1a')]('Content-Range',_0x39e7dc+'-'+_0x12289a+'/'+_0x36fbec)[_0x8418('0x1b')](_0xdccc91);}return null;};}function patchUpdates(_0x52e613){return function(_0x3e6fcc){try{jsonpatch[_0x8418('0x1c')](_0x3e6fcc,_0x52e613,!![]);}catch(_0x3e6118){return BPromise[_0x8418('0x1d')](_0x3e6118);}return _0x3e6fcc['save']();};}function saveUpdates(_0x36450b,_0x4fe521){return function(_0x26a195){if(_0x26a195){return _0x26a195[_0x8418('0x1e')](_0x36450b)[_0x8418('0x1f')](function(_0x56f0ad){return _0x56f0ad;});}return null;};}function removeEntity(_0x5b139a,_0x1e2aed){return function(_0x4239de){if(_0x4239de){return _0x4239de[_0x8418('0x20')]()[_0x8418('0x1f')](function(){_0x5b139a['status'](0xcc)[_0x8418('0x15')]();});}};}function handleEntityNotFound(_0xde7f0c,_0x2674ec){return function(_0x12b550){if(!_0x12b550){_0xde7f0c[_0x8418('0x13')](0x194);}return _0x12b550;};}function handleError(_0x5016e3,_0x5e9e41){_0x5e9e41=_0x5e9e41||0x1f4;return function(_0x11bfa9){logger[_0x8418('0x21')](_0x11bfa9[_0x8418('0x22')]);if(_0x11bfa9[_0x8418('0x23')]){delete _0x11bfa9[_0x8418('0x23')];}_0x5016e3[_0x8418('0x14')](_0x5e9e41)['send'](_0x11bfa9);};}exports[_0x8418('0x24')]=function(_0x2f9b41,_0x5995e3){var _0x7f0a4f={},_0x48ef31={},_0x2e3110={'count':0x0,'rows':[]};var _0x195e06=_[_0x8418('0x25')](db[_0x8418('0x26')]['rawAttributes'],function(_0x45244e){return{'name':_0x45244e[_0x8418('0x27')],'type':_0x45244e[_0x8418('0x28')][_0x8418('0x29')]};});_0x48ef31['model']=_[_0x8418('0x25')](_0x195e06,_0x8418('0x23'));_0x48ef31[_0x8418('0x2a')]=_['keys'](_0x2f9b41[_0x8418('0x2a')]);_0x48ef31[_0x8418('0x2b')]=_['intersection'](_0x48ef31[_0x8418('0x2c')],_0x48ef31[_0x8418('0x2a')]);_0x7f0a4f[_0x8418('0x2d')]=_[_0x8418('0x2e')](_0x48ef31['model'],qs[_0x8418('0x2f')](_0x2f9b41[_0x8418('0x2a')][_0x8418('0x2f')]));_0x7f0a4f[_0x8418('0x2d')]=_0x7f0a4f[_0x8418('0x2d')][_0x8418('0x30')]?_0x7f0a4f['attributes']:_0x48ef31[_0x8418('0x2c')];if(!_0x2f9b41[_0x8418('0x2a')][_0x8418('0x31')](_0x8418('0x32'))){_0x7f0a4f[_0x8418('0x18')]=qs[_0x8418('0x18')](_0x2f9b41[_0x8418('0x2a')]['limit']);_0x7f0a4f[_0x8418('0x16')]=qs[_0x8418('0x16')](_0x2f9b41[_0x8418('0x2a')][_0x8418('0x16')]);}_0x7f0a4f[_0x8418('0x33')]=qs[_0x8418('0x34')](_0x2f9b41[_0x8418('0x2a')]['sort']);_0x7f0a4f['where']=qs[_0x8418('0x2b')](_[_0x8418('0x35')](_0x2f9b41['query'],_0x48ef31[_0x8418('0x2b')]),_0x195e06);if(_0x2f9b41['query'][_0x8418('0x36')]){_0x7f0a4f[_0x8418('0x37')]=_[_0x8418('0x38')](_0x7f0a4f['where'],{'$or':_['map'](_0x195e06,function(_0x442283){if(_0x442283[_0x8418('0x28')]!=='VIRTUAL'){var _0x11564d={};_0x11564d[_0x442283[_0x8418('0x23')]]={'$like':'%'+_0x2f9b41[_0x8418('0x2a')][_0x8418('0x36')]+'%'};return _0x11564d;}})});}_0x7f0a4f=_[_0x8418('0x38')]({},_0x7f0a4f,_0x2f9b41['options']);var _0x4d06a9={'where':_0x7f0a4f[_0x8418('0x37')]};return db[_0x8418('0x26')][_0x8418('0x19')](_0x4d06a9)[_0x8418('0x1f')](function(_0x4a51f8){_0x2e3110[_0x8418('0x19')]=_0x4a51f8;if(_0x2f9b41[_0x8418('0x2a')][_0x8418('0x39')]){_0x7f0a4f['include']=[{'all':!![]}];}return db[_0x8418('0x26')]['findAll'](_0x7f0a4f);})[_0x8418('0x1f')](function(_0x3f6639){_0x2e3110['rows']=_0x3f6639;return _0x2e3110;})['then'](respondWithFilteredResult(_0x5995e3,_0x7f0a4f))[_0x8418('0x3a')](handleError(_0x5995e3,null));};exports['show']=function(_0x583e85,_0x582013){var _0x3ec25a={'raw':![],'where':{'id':_0x583e85[_0x8418('0x3b')]['id']}},_0x57f23d={};_0x57f23d[_0x8418('0x2c')]=_['keys'](db[_0x8418('0x26')][_0x8418('0x3c')]);_0x57f23d[_0x8418('0x2a')]=_[_0x8418('0x3d')](_0x583e85[_0x8418('0x2a')]);_0x57f23d[_0x8418('0x2b')]=_[_0x8418('0x2e')](_0x57f23d[_0x8418('0x2c')],_0x57f23d['query']);_0x3ec25a[_0x8418('0x2d')]=_[_0x8418('0x2e')](_0x57f23d['model'],qs['fields'](_0x583e85['query'][_0x8418('0x2f')]));_0x3ec25a[_0x8418('0x2d')]=_0x3ec25a[_0x8418('0x2d')][_0x8418('0x30')]?_0x3ec25a[_0x8418('0x2d')]:_0x57f23d['model'];if(_0x583e85[_0x8418('0x2a')][_0x8418('0x39')]){_0x3ec25a[_0x8418('0x3e')]=[{'all':!![]}];}_0x3ec25a=_[_0x8418('0x38')]({},_0x3ec25a,_0x583e85['options']);return db[_0x8418('0x26')][_0x8418('0x3f')](_0x3ec25a)[_0x8418('0x1f')](handleEntityNotFound(_0x582013,null))[_0x8418('0x1f')](respondWithResult(_0x582013,null))[_0x8418('0x3a')](handleError(_0x582013,null));};exports[_0x8418('0x40')]=function(_0x255472,_0x143b1d){return db['Dynamics365Configuration']['create'](_0x255472[_0x8418('0x41')],{})['then'](respondWithResult(_0x143b1d,0xc9))[_0x8418('0x3a')](handleError(_0x143b1d,null));};exports[_0x8418('0x1e')]=function(_0x11e961,_0x44e7ba){if(_0x11e961['body']['id']){delete _0x11e961[_0x8418('0x41')]['id'];}return db[_0x8418('0x26')][_0x8418('0x3f')]({'where':{'id':_0x11e961[_0x8418('0x3b')]['id']}})[_0x8418('0x1f')](handleEntityNotFound(_0x44e7ba,null))[_0x8418('0x1f')](saveUpdates(_0x11e961[_0x8418('0x41')],null))['then'](respondWithResult(_0x44e7ba,null))['catch'](handleError(_0x44e7ba,null));};exports[_0x8418('0x20')]=function(_0x210831,_0x3c0e9a){return db['Dynamics365Configuration']['find']({'where':{'id':_0x210831['params']['id']}})[_0x8418('0x1f')](handleEntityNotFound(_0x3c0e9a,null))['then'](removeEntity(_0x3c0e9a,null))[_0x8418('0x3a')](handleError(_0x3c0e9a,null));};exports[_0x8418('0x42')]=function(_0x4fd0fe,_0x16c748,_0x5141e9){var _0x56ceac={};var _0x507e5e={};var _0x434921;var _0x48c8e4;return db[_0x8418('0x26')]['findOne']({'where':{'id':_0x4fd0fe[_0x8418('0x3b')]['id']}})[_0x8418('0x1f')](handleEntityNotFound(_0x16c748,null))['then'](function(_0x24f18f){if(_0x24f18f){_0x434921=_0x24f18f;_0x507e5e[_0x8418('0x2c')]=_[_0x8418('0x3d')](db[_0x8418('0x43')]['rawAttributes']);_0x507e5e[_0x8418('0x2a')]=_[_0x8418('0x3d')](_0x4fd0fe[_0x8418('0x2a')]);_0x507e5e[_0x8418('0x2b')]=_[_0x8418('0x2e')](_0x507e5e[_0x8418('0x2c')],_0x507e5e[_0x8418('0x2a')]);_0x56ceac[_0x8418('0x2d')]=_['intersection'](_0x507e5e[_0x8418('0x2c')],qs[_0x8418('0x2f')](_0x4fd0fe[_0x8418('0x2a')][_0x8418('0x2f')]));_0x56ceac[_0x8418('0x2d')]=_0x56ceac['attributes'][_0x8418('0x30')]?_0x56ceac[_0x8418('0x2d')]:_0x507e5e[_0x8418('0x2c')];_0x56ceac['order']=qs[_0x8418('0x34')](_0x4fd0fe[_0x8418('0x2a')][_0x8418('0x34')]);_0x56ceac['where']=qs[_0x8418('0x2b')](_[_0x8418('0x35')](_0x4fd0fe[_0x8418('0x2a')],_0x507e5e['filters']));if(_0x4fd0fe[_0x8418('0x2a')][_0x8418('0x36')]){_0x56ceac[_0x8418('0x37')]=_[_0x8418('0x38')](_0x56ceac[_0x8418('0x37')],{'$or':_[_0x8418('0x25')](_0x56ceac['attributes'],function(_0x4d3a34){var _0x233515={};_0x233515[_0x4d3a34]={'$like':'%'+_0x4fd0fe['query'][_0x8418('0x36')]+'%'};return _0x233515;})});}_0x56ceac=_[_0x8418('0x38')]({},_0x56ceac,_0x4fd0fe['options']);return _0x434921['getFields'](_0x56ceac);}})[_0x8418('0x1f')](function(_0x5671de){if(_0x5671de){_0x48c8e4=_0x5671de[_0x8418('0x30')];if(!_0x4fd0fe['query'][_0x8418('0x31')]('nolimit')){_0x56ceac['limit']=qs[_0x8418('0x18')](_0x4fd0fe['query'][_0x8418('0x18')]);_0x56ceac['offset']=qs[_0x8418('0x16')](_0x4fd0fe[_0x8418('0x2a')][_0x8418('0x16')]);}return _0x434921['getFields'](_0x56ceac);}})[_0x8418('0x1f')](function(_0xbd2836){if(_0xbd2836){return _0xbd2836?{'count':_0x48c8e4,'rows':_0xbd2836}:null;}})['then'](respondWithResult(_0x16c748,null))['catch'](handleError(_0x16c748,null));};exports['getSubjects']=function(_0xb567ff,_0xbaa26,_0x2ba2ad){var _0x4a5580={};var _0x5cf75d={};var _0x23c37d;var _0x21da58;return db[_0x8418('0x26')][_0x8418('0x44')]({'where':{'id':_0xb567ff[_0x8418('0x3b')]['id']}})[_0x8418('0x1f')](handleEntityNotFound(_0xbaa26,null))[_0x8418('0x1f')](function(_0x5a7ee6){if(_0x5a7ee6){_0x23c37d=_0x5a7ee6;_0x5cf75d[_0x8418('0x2c')]=_[_0x8418('0x3d')](db[_0x8418('0x43')]['rawAttributes']);_0x5cf75d[_0x8418('0x2a')]=_[_0x8418('0x3d')](_0xb567ff[_0x8418('0x2a')]);_0x5cf75d[_0x8418('0x2b')]=_['intersection'](_0x5cf75d[_0x8418('0x2c')],_0x5cf75d[_0x8418('0x2a')]);_0x4a5580[_0x8418('0x2d')]=_['intersection'](_0x5cf75d['model'],qs[_0x8418('0x2f')](_0xb567ff[_0x8418('0x2a')]['fields']));_0x4a5580[_0x8418('0x2d')]=_0x4a5580['attributes']['length']?_0x4a5580[_0x8418('0x2d')]:_0x5cf75d[_0x8418('0x2c')];_0x4a5580[_0x8418('0x33')]=qs[_0x8418('0x34')](_0xb567ff[_0x8418('0x2a')][_0x8418('0x34')]);_0x4a5580[_0x8418('0x37')]=qs['filters'](_[_0x8418('0x35')](_0xb567ff[_0x8418('0x2a')],_0x5cf75d[_0x8418('0x2b')]));if(_0xb567ff['query'][_0x8418('0x36')]){_0x4a5580[_0x8418('0x37')]=_[_0x8418('0x38')](_0x4a5580[_0x8418('0x37')],{'$or':_['map'](_0x4a5580[_0x8418('0x2d')],function(_0x4fc8d8){var _0x8565a3={};_0x8565a3[_0x4fc8d8]={'$like':'%'+_0xb567ff[_0x8418('0x2a')]['filter']+'%'};return _0x8565a3;})});}_0x4a5580=_[_0x8418('0x38')]({},_0x4a5580,_0xb567ff[_0x8418('0x45')]);return _0x23c37d[_0x8418('0x46')](_0x4a5580);}})[_0x8418('0x1f')](function(_0xd38d82){if(_0xd38d82){_0x21da58=_0xd38d82[_0x8418('0x30')];if(!_0xb567ff[_0x8418('0x2a')][_0x8418('0x31')](_0x8418('0x32'))){_0x4a5580[_0x8418('0x18')]=qs[_0x8418('0x18')](_0xb567ff[_0x8418('0x2a')]['limit']);_0x4a5580[_0x8418('0x16')]=qs[_0x8418('0x16')](_0xb567ff[_0x8418('0x2a')][_0x8418('0x16')]);}return _0x23c37d[_0x8418('0x46')](_0x4a5580);}})[_0x8418('0x1f')](function(_0x43b918){if(_0x43b918){return _0x43b918?{'count':_0x21da58,'rows':_0x43b918}:null;}})[_0x8418('0x1f')](respondWithResult(_0xbaa26,null))[_0x8418('0x3a')](handleError(_0xbaa26,null));};exports[_0x8418('0x47')]=function(_0x317a9f,_0x273b93,_0x5993b3){var _0x195952={};var _0x125a96={};var _0x5b386a;var _0x272c0c;return db[_0x8418('0x26')][_0x8418('0x44')]({'where':{'id':_0x317a9f['params']['id']}})[_0x8418('0x1f')](handleEntityNotFound(_0x273b93,null))[_0x8418('0x1f')](function(_0xb0b0a2){if(_0xb0b0a2){_0x5b386a=_0xb0b0a2;_0x125a96['model']=_[_0x8418('0x3d')](db[_0x8418('0x43')]['rawAttributes']);_0x125a96[_0x8418('0x2a')]=_[_0x8418('0x3d')](_0x317a9f[_0x8418('0x2a')]);_0x125a96[_0x8418('0x2b')]=_[_0x8418('0x2e')](_0x125a96['model'],_0x125a96[_0x8418('0x2a')]);_0x195952[_0x8418('0x2d')]=_[_0x8418('0x2e')](_0x125a96[_0x8418('0x2c')],qs[_0x8418('0x2f')](_0x317a9f[_0x8418('0x2a')][_0x8418('0x2f')]));_0x195952[_0x8418('0x2d')]=_0x195952[_0x8418('0x2d')][_0x8418('0x30')]?_0x195952[_0x8418('0x2d')]:_0x125a96[_0x8418('0x2c')];_0x195952[_0x8418('0x33')]=qs[_0x8418('0x34')](_0x317a9f['query'][_0x8418('0x34')]);_0x195952[_0x8418('0x37')]=qs[_0x8418('0x2b')](_[_0x8418('0x35')](_0x317a9f[_0x8418('0x2a')],_0x125a96[_0x8418('0x2b')]));if(_0x317a9f[_0x8418('0x2a')][_0x8418('0x36')]){_0x195952[_0x8418('0x37')]=_['merge'](_0x195952[_0x8418('0x37')],{'$or':_[_0x8418('0x25')](_0x195952[_0x8418('0x2d')],function(_0x11a4bf){var _0x2db67c={};_0x2db67c[_0x11a4bf]={'$like':'%'+_0x317a9f[_0x8418('0x2a')][_0x8418('0x36')]+'%'};return _0x2db67c;})});}_0x195952=_[_0x8418('0x38')]({},_0x195952,_0x317a9f[_0x8418('0x45')]);return _0x5b386a[_0x8418('0x47')](_0x195952);}})[_0x8418('0x1f')](function(_0xdb9347){if(_0xdb9347){_0x272c0c=_0xdb9347['length'];if(!_0x317a9f[_0x8418('0x2a')]['hasOwnProperty'](_0x8418('0x32'))){_0x195952[_0x8418('0x18')]=qs[_0x8418('0x18')](_0x317a9f[_0x8418('0x2a')][_0x8418('0x18')]);_0x195952['offset']=qs[_0x8418('0x16')](_0x317a9f[_0x8418('0x2a')]['offset']);}return _0x5b386a[_0x8418('0x47')](_0x195952);}})[_0x8418('0x1f')](function(_0x32cd10){if(_0x32cd10){return _0x32cd10?{'count':_0x272c0c,'rows':_0x32cd10}:null;}})[_0x8418('0x1f')](respondWithResult(_0x273b93,null))[_0x8418('0x3a')](handleError(_0x273b93,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index f6b3c10..0067515 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 _0x6f0d=['./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x4f0184,_0x40d853){_0x4f0184=_0x4f0184-0x0;var _0x3280d2=_0x6f0d[_0x4f0184];return _0x3280d2;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var fs=require('fs');var path=require(_0xd6f0('0x5'));var rimraf=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module['exports']=function(_0x2d2ce6,_0x4a8b0c){return _0x2d2ce6[_0xd6f0('0x9')](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb43b=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird','path'];(function(_0x14db04,_0x39df19){var _0x95efdd=function(_0x7ad392){while(--_0x7ad392){_0x14db04['push'](_0x14db04['shift']());}};_0x95efdd(++_0x39df19);}(_0xb43b,0x1b2));var _0xbb43=function(_0x58a4be,_0x38e4ac){_0x58a4be=_0x58a4be-0x0;var _0x4cf072=_0xb43b[_0x58a4be];return _0x4cf072;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index d6ca113..b02d782 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 _0xd169=['stringify','error','code','message','result','catch','Dynamics365Configuration,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x50aec5,_0x12464c){var _0x3b86c4=function(_0x4d457b){while(--_0x4d457b){_0x50aec5['push'](_0x50aec5['shift']());}};_0x3b86c4(++_0x12464c);}(_0xd169,0x1cf));var _0x9d16=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd169[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9d16('0x0'));var util=require(_0x9d16('0x1'));var moment=require(_0x9d16('0x2'));var BPromise=require(_0x9d16('0x3'));var rs=require(_0x9d16('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9d16('0x5'));var logger=require(_0x9d16('0x6'))(_0x9d16('0x7'));var config=require(_0x9d16('0x8'));var jayson=require(_0x9d16('0x9'));var client=jayson[_0x9d16('0xa')][_0x9d16('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3189a0,_0x2089c2,_0x4bae03){return new BPromise(function(_0x2b74ff,_0x5e796a){return client[_0x9d16('0xc')](_0x3189a0,_0x4bae03)['then'](function(_0x110d40){logger[_0x9d16('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2089c2,'request\x20sent');logger[_0x9d16('0xe')](_0x9d16('0xf'),_0x2089c2,_0x9d16('0x10'),JSON[_0x9d16('0x11')](_0x110d40));if(_0x110d40['error']){if(_0x110d40[_0x9d16('0x12')][_0x9d16('0x13')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x2089c2,_0x110d40['error'][_0x9d16('0x14')]);return _0x5e796a(_0x110d40[_0x9d16('0x12')][_0x9d16('0x14')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x2089c2,_0x110d40['error'][_0x9d16('0x14')]);return _0x2b74ff(_0x110d40['error'][_0x9d16('0x14')]);}else{logger[_0x9d16('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2089c2,_0x9d16('0x10'));_0x2b74ff(_0x110d40[_0x9d16('0x15')][_0x9d16('0x14')]);}})[_0x9d16('0x16')](function(_0x11af63){logger[_0x9d16('0x12')](_0x9d16('0x17'),_0x2089c2,_0x11af63);_0x5e796a(_0x11af63);});});} \ No newline at end of file +var _0x0ad4=['request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x13348a,_0x37af64){var _0x26e7f9=function(_0x70aba6){while(--_0x70aba6){_0x13348a['push'](_0x13348a['shift']());}};_0x26e7f9(++_0x37af64);}(_0x0ad4,0xc3));var _0x40ad=function(_0x4dd673,_0x8000b){_0x4dd673=_0x4dd673-0x0;var _0x523713=_0x0ad4[_0x4dd673];return _0x523713;};'use strict';var _=require(_0x40ad('0x0'));var util=require(_0x40ad('0x1'));var moment=require(_0x40ad('0x2'));var BPromise=require(_0x40ad('0x3'));var rs=require(_0x40ad('0x4'));var fs=require('fs');var Redis=require(_0x40ad('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x40ad('0x6'))(_0x40ad('0x7'));var config=require(_0x40ad('0x8'));var jayson=require(_0x40ad('0x9'));var client=jayson[_0x40ad('0xa')][_0x40ad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x568fbb,_0x724009,_0x123f29){return new BPromise(function(_0x324c15,_0x5a6c2f){return client[_0x40ad('0xc')](_0x568fbb,_0x123f29)[_0x40ad('0xd')](function(_0x2c8c2a){logger['info'](_0x40ad('0xe'),_0x724009,_0x40ad('0xf'));logger['debug'](_0x40ad('0x10'),_0x724009,'request\x20sent',JSON[_0x40ad('0x11')](_0x2c8c2a));if(_0x2c8c2a['error']){if(_0x2c8c2a['error'][_0x40ad('0x12')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x724009,_0x2c8c2a[_0x40ad('0x13')][_0x40ad('0x14')]);return _0x5a6c2f(_0x2c8c2a[_0x40ad('0x13')][_0x40ad('0x14')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x724009,_0x2c8c2a[_0x40ad('0x13')]['message']);return _0x324c15(_0x2c8c2a[_0x40ad('0x13')][_0x40ad('0x14')]);}else{logger[_0x40ad('0x15')](_0x40ad('0xe'),_0x724009,'request\x20sent');_0x324c15(_0x2c8c2a['result'][_0x40ad('0x14')]);}})[_0x40ad('0x16')](function(_0x2291f8){logger['error'](_0x40ad('0xe'),_0x724009,_0x2291f8);_0x5a6c2f(_0x2291f8);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index f760c85..57d6141 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 _0x3ce8=['./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','post','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x2ee745,_0x156da9){var _0x1940d6=function(_0x57d903){while(--_0x57d903){_0x2ee745['push'](_0x2ee745['shift']());}};_0x1940d6(++_0x156da9);}(_0x3ce8,0x64));var _0x83ce=function(_0x2cbe9a,_0x33fa23){_0x2cbe9a=_0x2cbe9a-0x0;var _0x118b64=_0x3ce8[_0x2cbe9a];return _0x118b64;};'use strict';var multer=require('multer');var util=require(_0x83ce('0x0'));var path=require('path');var timeout=require(_0x83ce('0x1'));var express=require('express');var router=express[_0x83ce('0x2')]();var fs_extra=require(_0x83ce('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x83ce('0x4'));var config=require('../../config/environment');var controller=require(_0x83ce('0x5'));router[_0x83ce('0x6')]('/',auth['isAuthenticated'](),controller[_0x83ce('0x7')]);router[_0x83ce('0x6')](_0x83ce('0x8'),auth[_0x83ce('0x9')](),controller[_0x83ce('0xa')]);router[_0x83ce('0xb')]('/',auth[_0x83ce('0x9')](),controller['create']);router['put'](_0x83ce('0x8'),auth[_0x83ce('0x9')](),controller['update']);router[_0x83ce('0xc')](_0x83ce('0x8'),auth['isAuthenticated'](),controller[_0x83ce('0xd')]);module[_0x83ce('0xe')]=router; \ No newline at end of file +var _0xbd4f=['Router','fs-extra','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','create','put','update','/:id','destroy','exports','multer','connect-timeout','express'];(function(_0x73e491,_0x83d943){var _0x44240b=function(_0x5571cc){while(--_0x5571cc){_0x73e491['push'](_0x73e491['shift']());}};_0x44240b(++_0x83d943);}(_0xbd4f,0x16d));var _0xfbd4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbd4f[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0xfbd4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfbd4('0x1'));var express=require(_0xfbd4('0x2'));var router=express[_0xfbd4('0x3')]();var fs_extra=require(_0xfbd4('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfbd4('0x5'));var controller=require(_0xfbd4('0x6'));router[_0xfbd4('0x7')]('/',auth[_0xfbd4('0x8')](),controller[_0xfbd4('0x9')]);router[_0xfbd4('0x7')]('/:id',auth[_0xfbd4('0x8')](),controller['show']);router['post']('/',auth[_0xfbd4('0x8')](),controller[_0xfbd4('0xa')]);router[_0xfbd4('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xfbd4('0xc')]);router['delete'](_0xfbd4('0xd'),auth[_0xfbd4('0x8')](),controller[_0xfbd4('0xe')]);module[_0xfbd4('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 2852d6f..ad6f50e 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 _0x40a1=['keyValue','picklist','string','STRING','ENUM','variable','sequelize','exports','customVariable'];(function(_0x480f3a,_0x2b89a1){var _0x3c84e0=function(_0x1b071b){while(--_0x1b071b){_0x480f3a['push'](_0x480f3a['shift']());}};_0x3c84e0(++_0x2b89a1);}(_0x40a1,0xc3));var _0x140a=function(_0x467c49,_0x854408){_0x467c49=_0x467c49-0x0;var _0x43bea0=_0x40a1[_0x467c49];return _0x43bea0;};'use strict';var Sequelize=require(_0x140a('0x0'));module[_0x140a('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x140a('0x2'),_0x140a('0x3'),_0x140a('0x4')),'defaultValue':_0x140a('0x5')},'content':{'type':Sequelize[_0x140a('0x6')]},'key':{'type':Sequelize[_0x140a('0x6')]},'keyType':{'type':Sequelize[_0x140a('0x7')](_0x140a('0x5'),_0x140a('0x8'),_0x140a('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x140a('0x6')]},'nameField':{'type':Sequelize[_0x140a('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4cfe=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x4cfe,0x1ac));var _0xe4cf=function(_0xab9c97,_0x10e4dc){_0xab9c97=_0xab9c97-0x0;var _0x1301a5=_0x4cfe[_0xab9c97];return _0x1301a5;};'use strict';var Sequelize=require(_0xe4cf('0x0'));module[_0xe4cf('0x1')]={'type':{'type':Sequelize[_0xe4cf('0x2')](_0xe4cf('0x3'),_0xe4cf('0x4'),_0xe4cf('0x5'),_0xe4cf('0x6'),_0xe4cf('0x7')),'defaultValue':_0xe4cf('0x3')},'content':{'type':Sequelize[_0xe4cf('0x8')]},'key':{'type':Sequelize[_0xe4cf('0x8')]},'keyType':{'type':Sequelize[_0xe4cf('0x2')]('string',_0xe4cf('0x4'),_0xe4cf('0x5'))},'keyContent':{'type':Sequelize[_0xe4cf('0x8')]},'idField':{'type':Sequelize[_0xe4cf('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe4cf('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe4cf('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 3b010b8..5dc4cea 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 _0x1701=['rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','Dynamics365Field','includeAll','rows','show','params','length','include','catch','body','find'];(function(_0x1d7b04,_0x7109e2){var _0x1d4c6e=function(_0x50508a){while(--_0x50508a){_0x1d7b04['push'](_0x1d7b04['shift']());}};_0x1d4c6e(++_0x7109e2);}(_0x1701,0x16d));var _0x1170=function(_0x2a2fdb,_0x5b5d57){_0x2a2fdb=_0x2a2fdb-0x0;var _0x34fbbf=_0x1701[_0x2a2fdb];return _0x34fbbf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1170('0x0'));var zipdir=require(_0x1170('0x1'));var jsonpatch=require(_0x1170('0x2'));var rp=require('request-promise');var moment=require(_0x1170('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1170('0x4'));var path=require('path');var sox=require(_0x1170('0x5'));var csv=require(_0x1170('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1170('0x7'));var _=require(_0x1170('0x8'));var squel=require(_0x1170('0x9'));var crypto=require(_0x1170('0xa'));var jsforce=require(_0x1170('0xb'));var deskjs=require(_0x1170('0xc'));var toCsv=require(_0x1170('0x6'));var querystring=require('querystring');var Papa=require(_0x1170('0xd'));var Redis=require(_0x1170('0xe'));var authService=require(_0x1170('0xf'));var qs=require(_0x1170('0x10'));var as=require(_0x1170('0x11'));var hardwareService=require(_0x1170('0x12'));var logger=require('../../config/logger')(_0x1170('0x13'));var utils=require(_0x1170('0x14'));var config=require(_0x1170('0x15'));var licenseUtil=require(_0x1170('0x16'));var db=require(_0x1170('0x17'))['db'];function respondWithStatusCode(_0xf0e502,_0x58d290){_0x58d290=_0x58d290||0xcc;return function(_0x1203c3){if(_0x1203c3){return _0xf0e502[_0x1170('0x18')](_0x58d290);}return _0xf0e502[_0x1170('0x19')](_0x58d290)[_0x1170('0x1a')]();};}function respondWithResult(_0x222ac5,_0x2317fe){_0x2317fe=_0x2317fe||0xc8;return function(_0x36c105){if(_0x36c105){return _0x222ac5[_0x1170('0x19')](_0x2317fe)[_0x1170('0x1b')](_0x36c105);}};}function respondWithFilteredResult(_0x94c1e2,_0x3ebb64){return function(_0x22e0e3){if(_0x22e0e3){var _0xc9f3f7=typeof _0x3ebb64[_0x1170('0x1c')]===_0x1170('0x1d')&&typeof _0x3ebb64['limit']==='undefined';var _0x22faeb=_0x22e0e3[_0x1170('0x1e')];var _0x11d56a=_0xc9f3f7?0x0:_0x3ebb64[_0x1170('0x1c')];var _0x5d3e00=_0xc9f3f7?_0x22e0e3['count']:_0x3ebb64['offset']+_0x3ebb64[_0x1170('0x1f')];var _0x586191;if(_0x5d3e00>=_0x22faeb){_0x5d3e00=_0x22faeb;_0x586191=0xc8;}else{_0x586191=0xce;}_0x94c1e2['status'](_0x586191);return _0x94c1e2[_0x1170('0x20')]('Content-Range',_0x11d56a+'-'+_0x5d3e00+'/'+_0x22faeb)[_0x1170('0x1b')](_0x22e0e3);}return null;};}function patchUpdates(_0x563906){return function(_0x4961ff){try{jsonpatch[_0x1170('0x21')](_0x4961ff,_0x563906,!![]);}catch(_0x27b5fc){return BPromise['reject'](_0x27b5fc);}return _0x4961ff[_0x1170('0x22')]();};}function saveUpdates(_0x3a3e5d,_0x375a82){return function(_0x3620fe){if(_0x3620fe){return _0x3620fe[_0x1170('0x23')](_0x3a3e5d)[_0x1170('0x24')](function(_0x2565bb){return _0x2565bb;});}return null;};}function removeEntity(_0x3ce6b7,_0x6694b8){return function(_0x3e0e5b){if(_0x3e0e5b){return _0x3e0e5b[_0x1170('0x25')]()[_0x1170('0x24')](function(){_0x3ce6b7[_0x1170('0x19')](0xcc)[_0x1170('0x1a')]();});}};}function handleEntityNotFound(_0x1a3e4a,_0x5d109f){return function(_0x31257f){if(!_0x31257f){_0x1a3e4a[_0x1170('0x18')](0x194);}return _0x31257f;};}function handleError(_0x54aec2,_0x5df892){_0x5df892=_0x5df892||0x1f4;return function(_0x18d290){logger[_0x1170('0x26')](_0x18d290[_0x1170('0x27')]);if(_0x18d290[_0x1170('0x28')]){delete _0x18d290[_0x1170('0x28')];}_0x54aec2[_0x1170('0x19')](_0x5df892)[_0x1170('0x29')](_0x18d290);};}exports['index']=function(_0x471a9e,_0x19563c){var _0x4a90f0={},_0x3a7145={},_0x328207={'count':0x0,'rows':[]};var _0x11fe2a=_['map'](db['Dynamics365Field'][_0x1170('0x2a')],function(_0x34101d){return{'name':_0x34101d[_0x1170('0x2b')],'type':_0x34101d[_0x1170('0x2c')]['key']};});_0x3a7145[_0x1170('0x2d')]=_[_0x1170('0x2e')](_0x11fe2a,_0x1170('0x28'));_0x3a7145[_0x1170('0x2f')]=_[_0x1170('0x30')](_0x471a9e[_0x1170('0x2f')]);_0x3a7145['filters']=_[_0x1170('0x31')](_0x3a7145[_0x1170('0x2d')],_0x3a7145[_0x1170('0x2f')]);_0x4a90f0[_0x1170('0x32')]=_[_0x1170('0x31')](_0x3a7145[_0x1170('0x2d')],qs[_0x1170('0x33')](_0x471a9e[_0x1170('0x2f')][_0x1170('0x33')]));_0x4a90f0[_0x1170('0x32')]=_0x4a90f0[_0x1170('0x32')]['length']?_0x4a90f0[_0x1170('0x32')]:_0x3a7145[_0x1170('0x2d')];if(!_0x471a9e[_0x1170('0x2f')][_0x1170('0x34')](_0x1170('0x35'))){_0x4a90f0['limit']=qs[_0x1170('0x1f')](_0x471a9e[_0x1170('0x2f')][_0x1170('0x1f')]);_0x4a90f0['offset']=qs[_0x1170('0x1c')](_0x471a9e[_0x1170('0x2f')][_0x1170('0x1c')]);}_0x4a90f0[_0x1170('0x36')]=qs[_0x1170('0x37')](_0x471a9e['query'][_0x1170('0x37')]);_0x4a90f0['where']=qs[_0x1170('0x38')](_[_0x1170('0x39')](_0x471a9e[_0x1170('0x2f')],_0x3a7145[_0x1170('0x38')]),_0x11fe2a);if(_0x471a9e[_0x1170('0x2f')][_0x1170('0x3a')]){_0x4a90f0[_0x1170('0x3b')]=_[_0x1170('0x3c')](_0x4a90f0[_0x1170('0x3b')],{'$or':_[_0x1170('0x2e')](_0x11fe2a,function(_0x8cc4e){if(_0x8cc4e[_0x1170('0x2c')]!==_0x1170('0x3d')){var _0x14cfe4={};_0x14cfe4[_0x8cc4e[_0x1170('0x28')]]={'$like':'%'+_0x471a9e[_0x1170('0x2f')]['filter']+'%'};return _0x14cfe4;}})});}_0x4a90f0=_[_0x1170('0x3c')]({},_0x4a90f0,_0x471a9e[_0x1170('0x3e')]);var _0x22e077={'where':_0x4a90f0[_0x1170('0x3b')]};return db[_0x1170('0x3f')][_0x1170('0x1e')](_0x22e077)[_0x1170('0x24')](function(_0x31867b){_0x328207['count']=_0x31867b;if(_0x471a9e['query'][_0x1170('0x40')]){_0x4a90f0['include']=[{'all':!![]}];}return db[_0x1170('0x3f')]['findAll'](_0x4a90f0);})[_0x1170('0x24')](function(_0x3411fa){_0x328207[_0x1170('0x41')]=_0x3411fa;return _0x328207;})[_0x1170('0x24')](respondWithFilteredResult(_0x19563c,_0x4a90f0))['catch'](handleError(_0x19563c,null));};exports[_0x1170('0x42')]=function(_0x1ff452,_0xe1a1d5){var _0x1baa2e={'raw':!![],'where':{'id':_0x1ff452[_0x1170('0x43')]['id']}},_0x1047cb={};_0x1047cb['model']=_[_0x1170('0x30')](db['Dynamics365Field'][_0x1170('0x2a')]);_0x1047cb['query']=_[_0x1170('0x30')](_0x1ff452[_0x1170('0x2f')]);_0x1047cb[_0x1170('0x38')]=_['intersection'](_0x1047cb[_0x1170('0x2d')],_0x1047cb[_0x1170('0x2f')]);_0x1baa2e[_0x1170('0x32')]=_['intersection'](_0x1047cb[_0x1170('0x2d')],qs[_0x1170('0x33')](_0x1ff452['query'][_0x1170('0x33')]));_0x1baa2e[_0x1170('0x32')]=_0x1baa2e[_0x1170('0x32')][_0x1170('0x44')]?_0x1baa2e[_0x1170('0x32')]:_0x1047cb[_0x1170('0x2d')];if(_0x1ff452[_0x1170('0x2f')][_0x1170('0x40')]){_0x1baa2e[_0x1170('0x45')]=[{'all':!![]}];}_0x1baa2e=_[_0x1170('0x3c')]({},_0x1baa2e,_0x1ff452[_0x1170('0x3e')]);return db[_0x1170('0x3f')]['find'](_0x1baa2e)['then'](handleEntityNotFound(_0xe1a1d5,null))[_0x1170('0x24')](respondWithResult(_0xe1a1d5,null))[_0x1170('0x46')](handleError(_0xe1a1d5,null));};exports['create']=function(_0x2f1bca,_0x401c24){return db[_0x1170('0x3f')]['create'](_0x2f1bca[_0x1170('0x47')],{})[_0x1170('0x24')](respondWithResult(_0x401c24,0xc9))[_0x1170('0x46')](handleError(_0x401c24,null));};exports[_0x1170('0x23')]=function(_0x453ab6,_0xab78fe){if(_0x453ab6['body']['id']){delete _0x453ab6[_0x1170('0x47')]['id'];}return db[_0x1170('0x3f')][_0x1170('0x48')]({'where':{'id':_0x453ab6[_0x1170('0x43')]['id']}})[_0x1170('0x24')](handleEntityNotFound(_0xab78fe,null))['then'](saveUpdates(_0x453ab6[_0x1170('0x47')],null))['then'](respondWithResult(_0xab78fe,null))['catch'](handleError(_0xab78fe,null));};exports[_0x1170('0x25')]=function(_0xd0bded,_0x317f33){return db['Dynamics365Field'][_0x1170('0x48')]({'where':{'id':_0xd0bded[_0x1170('0x43')]['id']}})[_0x1170('0x24')](handleEntityNotFound(_0x317f33,null))[_0x1170('0x24')](removeEntity(_0x317f33,null))[_0x1170('0x46')](handleError(_0x317f33,null));}; \ No newline at end of file +var _0x0e9d=['VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','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','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x4bbfeb,_0x2bd851){var _0x2df4a3=function(_0x445864){while(--_0x445864){_0x4bbfeb['push'](_0x4bbfeb['shift']());}};_0x2df4a3(++_0x2bd851);}(_0x0e9d,0x193));var _0xd0e9=function(_0x53a3e6,_0x20d262){_0x53a3e6=_0x53a3e6-0x0;var _0x4a56e2=_0x0e9d[_0x53a3e6];return _0x4a56e2;};'use strict';var emlformat=require(_0xd0e9('0x0'));var rimraf=require(_0xd0e9('0x1'));var zipdir=require(_0xd0e9('0x2'));var jsonpatch=require(_0xd0e9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd0e9('0x4'));var Mustache=require(_0xd0e9('0x5'));var util=require('util');var path=require(_0xd0e9('0x6'));var sox=require(_0xd0e9('0x7'));var csv=require('to-csv');var ejs=require(_0xd0e9('0x8'));var fs=require('fs');var fs_extra=require(_0xd0e9('0x9'));var _=require(_0xd0e9('0xa'));var squel=require('squel');var crypto=require(_0xd0e9('0xb'));var jsforce=require(_0xd0e9('0xc'));var deskjs=require(_0xd0e9('0xd'));var toCsv=require(_0xd0e9('0xe'));var querystring=require(_0xd0e9('0xf'));var Papa=require('papaparse');var Redis=require(_0xd0e9('0x10'));var authService=require(_0xd0e9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd0e9('0x12'));var hardwareService=require(_0xd0e9('0x13'));var logger=require('../../config/logger')(_0xd0e9('0x14'));var utils=require(_0xd0e9('0x15'));var config=require(_0xd0e9('0x16'));var licenseUtil=require(_0xd0e9('0x17'));var db=require(_0xd0e9('0x18'))['db'];function respondWithStatusCode(_0x2867b6,_0x143cfe){_0x143cfe=_0x143cfe||0xcc;return function(_0x5d8a02){if(_0x5d8a02){return _0x2867b6[_0xd0e9('0x19')](_0x143cfe);}return _0x2867b6[_0xd0e9('0x1a')](_0x143cfe)[_0xd0e9('0x1b')]();};}function respondWithResult(_0x5484ad,_0x57b4f4){_0x57b4f4=_0x57b4f4||0xc8;return function(_0x3487b8){if(_0x3487b8){return _0x5484ad['status'](_0x57b4f4)[_0xd0e9('0x1c')](_0x3487b8);}};}function respondWithFilteredResult(_0x396083,_0x2af622){return function(_0x5eb4a9){if(_0x5eb4a9){var _0xaf1f12=typeof _0x2af622[_0xd0e9('0x1d')]==='undefined'&&typeof _0x2af622[_0xd0e9('0x1e')]===_0xd0e9('0x1f');var _0x235d51=_0x5eb4a9[_0xd0e9('0x20')];var _0x1888bb=_0xaf1f12?0x0:_0x2af622[_0xd0e9('0x1d')];var _0x475b0b=_0xaf1f12?_0x5eb4a9[_0xd0e9('0x20')]:_0x2af622[_0xd0e9('0x1d')]+_0x2af622[_0xd0e9('0x1e')];var _0x403eb9;if(_0x475b0b>=_0x235d51){_0x475b0b=_0x235d51;_0x403eb9=0xc8;}else{_0x403eb9=0xce;}_0x396083[_0xd0e9('0x1a')](_0x403eb9);return _0x396083[_0xd0e9('0x21')](_0xd0e9('0x22'),_0x1888bb+'-'+_0x475b0b+'/'+_0x235d51)['json'](_0x5eb4a9);}return null;};}function patchUpdates(_0x213ec7){return function(_0x316ec){try{jsonpatch[_0xd0e9('0x23')](_0x316ec,_0x213ec7,!![]);}catch(_0x112010){return BPromise[_0xd0e9('0x24')](_0x112010);}return _0x316ec[_0xd0e9('0x25')]();};}function saveUpdates(_0x4af6dc,_0x1ddfc2){return function(_0xa9b6e7){if(_0xa9b6e7){return _0xa9b6e7[_0xd0e9('0x26')](_0x4af6dc)[_0xd0e9('0x27')](function(_0x346098){return _0x346098;});}return null;};}function removeEntity(_0x22778b,_0x97c169){return function(_0x41803b){if(_0x41803b){return _0x41803b[_0xd0e9('0x28')]()['then'](function(){_0x22778b[_0xd0e9('0x1a')](0xcc)[_0xd0e9('0x1b')]();});}};}function handleEntityNotFound(_0xc57183,_0x1c27f8){return function(_0x4ddd61){if(!_0x4ddd61){_0xc57183['sendStatus'](0x194);}return _0x4ddd61;};}function handleError(_0xf4f333,_0x5c54d5){_0x5c54d5=_0x5c54d5||0x1f4;return function(_0x22ec7e){logger['error'](_0x22ec7e[_0xd0e9('0x29')]);if(_0x22ec7e[_0xd0e9('0x2a')]){delete _0x22ec7e[_0xd0e9('0x2a')];}_0xf4f333['status'](_0x5c54d5)[_0xd0e9('0x2b')](_0x22ec7e);};}exports[_0xd0e9('0x2c')]=function(_0x2255fb,_0x380ba1){var _0xf56a56={},_0x222b7f={},_0x3a3c22={'count':0x0,'rows':[]};var _0x1ec88e=_[_0xd0e9('0x2d')](db[_0xd0e9('0x2e')][_0xd0e9('0x2f')],function(_0x1347ec){return{'name':_0x1347ec[_0xd0e9('0x30')],'type':_0x1347ec[_0xd0e9('0x31')]['key']};});_0x222b7f[_0xd0e9('0x32')]=_[_0xd0e9('0x2d')](_0x1ec88e,'name');_0x222b7f[_0xd0e9('0x33')]=_[_0xd0e9('0x34')](_0x2255fb[_0xd0e9('0x33')]);_0x222b7f[_0xd0e9('0x35')]=_['intersection'](_0x222b7f['model'],_0x222b7f[_0xd0e9('0x33')]);_0xf56a56[_0xd0e9('0x36')]=_[_0xd0e9('0x37')](_0x222b7f[_0xd0e9('0x32')],qs[_0xd0e9('0x38')](_0x2255fb[_0xd0e9('0x33')][_0xd0e9('0x38')]));_0xf56a56['attributes']=_0xf56a56[_0xd0e9('0x36')]['length']?_0xf56a56['attributes']:_0x222b7f[_0xd0e9('0x32')];if(!_0x2255fb['query'][_0xd0e9('0x39')](_0xd0e9('0x3a'))){_0xf56a56[_0xd0e9('0x1e')]=qs[_0xd0e9('0x1e')](_0x2255fb[_0xd0e9('0x33')][_0xd0e9('0x1e')]);_0xf56a56[_0xd0e9('0x1d')]=qs[_0xd0e9('0x1d')](_0x2255fb[_0xd0e9('0x33')]['offset']);}_0xf56a56[_0xd0e9('0x3b')]=qs[_0xd0e9('0x3c')](_0x2255fb[_0xd0e9('0x33')][_0xd0e9('0x3c')]);_0xf56a56[_0xd0e9('0x3d')]=qs[_0xd0e9('0x35')](_[_0xd0e9('0x3e')](_0x2255fb[_0xd0e9('0x33')],_0x222b7f[_0xd0e9('0x35')]),_0x1ec88e);if(_0x2255fb[_0xd0e9('0x33')][_0xd0e9('0x3f')]){_0xf56a56['where']=_[_0xd0e9('0x40')](_0xf56a56[_0xd0e9('0x3d')],{'$or':_['map'](_0x1ec88e,function(_0x191a83){if(_0x191a83[_0xd0e9('0x31')]!==_0xd0e9('0x41')){var _0x53f054={};_0x53f054[_0x191a83[_0xd0e9('0x2a')]]={'$like':'%'+_0x2255fb[_0xd0e9('0x33')]['filter']+'%'};return _0x53f054;}})});}_0xf56a56=_['merge']({},_0xf56a56,_0x2255fb[_0xd0e9('0x42')]);var _0x335ae3={'where':_0xf56a56[_0xd0e9('0x3d')]};return db[_0xd0e9('0x2e')][_0xd0e9('0x20')](_0x335ae3)[_0xd0e9('0x27')](function(_0x14b942){_0x3a3c22[_0xd0e9('0x20')]=_0x14b942;if(_0x2255fb[_0xd0e9('0x33')][_0xd0e9('0x43')]){_0xf56a56[_0xd0e9('0x44')]=[{'all':!![]}];}return db[_0xd0e9('0x2e')][_0xd0e9('0x45')](_0xf56a56);})['then'](function(_0x30fa38){_0x3a3c22[_0xd0e9('0x46')]=_0x30fa38;return _0x3a3c22;})[_0xd0e9('0x27')](respondWithFilteredResult(_0x380ba1,_0xf56a56))[_0xd0e9('0x47')](handleError(_0x380ba1,null));};exports[_0xd0e9('0x48')]=function(_0x15493c,_0x1f09db){var _0x4bfaab={'raw':!![],'where':{'id':_0x15493c[_0xd0e9('0x49')]['id']}},_0x1b78c8={};_0x1b78c8[_0xd0e9('0x32')]=_[_0xd0e9('0x34')](db[_0xd0e9('0x2e')]['rawAttributes']);_0x1b78c8[_0xd0e9('0x33')]=_[_0xd0e9('0x34')](_0x15493c['query']);_0x1b78c8[_0xd0e9('0x35')]=_[_0xd0e9('0x37')](_0x1b78c8[_0xd0e9('0x32')],_0x1b78c8[_0xd0e9('0x33')]);_0x4bfaab['attributes']=_[_0xd0e9('0x37')](_0x1b78c8[_0xd0e9('0x32')],qs[_0xd0e9('0x38')](_0x15493c[_0xd0e9('0x33')][_0xd0e9('0x38')]));_0x4bfaab[_0xd0e9('0x36')]=_0x4bfaab[_0xd0e9('0x36')][_0xd0e9('0x4a')]?_0x4bfaab[_0xd0e9('0x36')]:_0x1b78c8[_0xd0e9('0x32')];if(_0x15493c['query']['includeAll']){_0x4bfaab[_0xd0e9('0x44')]=[{'all':!![]}];}_0x4bfaab=_[_0xd0e9('0x40')]({},_0x4bfaab,_0x15493c[_0xd0e9('0x42')]);return db['Dynamics365Field'][_0xd0e9('0x4b')](_0x4bfaab)[_0xd0e9('0x27')](handleEntityNotFound(_0x1f09db,null))[_0xd0e9('0x27')](respondWithResult(_0x1f09db,null))[_0xd0e9('0x47')](handleError(_0x1f09db,null));};exports[_0xd0e9('0x4c')]=function(_0x39cb6c,_0x5cc441){return db['Dynamics365Field'][_0xd0e9('0x4c')](_0x39cb6c[_0xd0e9('0x4d')],{})[_0xd0e9('0x27')](respondWithResult(_0x5cc441,0xc9))[_0xd0e9('0x47')](handleError(_0x5cc441,null));};exports[_0xd0e9('0x26')]=function(_0x450ec9,_0x37a7d1){if(_0x450ec9[_0xd0e9('0x4d')]['id']){delete _0x450ec9[_0xd0e9('0x4d')]['id'];}return db[_0xd0e9('0x2e')]['find']({'where':{'id':_0x450ec9['params']['id']}})[_0xd0e9('0x27')](handleEntityNotFound(_0x37a7d1,null))[_0xd0e9('0x27')](saveUpdates(_0x450ec9[_0xd0e9('0x4d')],null))[_0xd0e9('0x27')](respondWithResult(_0x37a7d1,null))[_0xd0e9('0x47')](handleError(_0x37a7d1,null));};exports['destroy']=function(_0x1558fc,_0x4377df){return db[_0xd0e9('0x2e')][_0xd0e9('0x4b')]({'where':{'id':_0x1558fc[_0xd0e9('0x49')]['id']}})[_0xd0e9('0x27')](handleEntityNotFound(_0x4377df,null))[_0xd0e9('0x27')](removeEntity(_0x4377df,null))[_0xd0e9('0x47')](handleError(_0x4377df,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 6396054..d3cc0c3 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 _0x8f35=['../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','lodash','util','api','moment','bluebird','rimraf'];(function(_0x561049,_0x330926){var _0x52f109=function(_0x1a5d24){while(--_0x1a5d24){_0x561049['push'](_0x561049['shift']());}};_0x52f109(++_0x330926);}(_0x8f35,0x14c));var _0x58f3=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x8f35[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x58f3('0x0'));var util=require(_0x58f3('0x1'));var logger=require('../../config/logger')(_0x58f3('0x2'));var moment=require(_0x58f3('0x3'));var BPromise=require(_0x58f3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x58f3('0x5'));var config=require(_0x58f3('0x6'));var attributes=require(_0x58f3('0x7'));module[_0x58f3('0x8')]=function(_0x2b0c5f,_0x319d55){return _0x2b0c5f[_0x58f3('0x9')]('Dynamics365Field',attributes,{'tableName':_0x58f3('0xa'),'paranoid':![],'indexes':[{'name':_0x58f3('0xb'),'fields':[_0x58f3('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5ff7=['./intDynamics365Field.attributes','exports','define','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1bba25,_0x17b3ee){var _0x3a58af=function(_0x2deabd){while(--_0x2deabd){_0x1bba25['push'](_0x1bba25['shift']());}};_0x3a58af(++_0x17b3ee);}(_0x5ff7,0x1e1));var _0x75ff=function(_0x50e40c,_0x2689c8){_0x50e40c=_0x50e40c-0x0;var _0x201c44=_0x5ff7[_0x50e40c];return _0x201c44;};'use strict';var _=require(_0x75ff('0x0'));var util=require(_0x75ff('0x1'));var logger=require(_0x75ff('0x2'))(_0x75ff('0x3'));var moment=require(_0x75ff('0x4'));var BPromise=require(_0x75ff('0x5'));var rp=require(_0x75ff('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75ff('0x7'));var config=require(_0x75ff('0x8'));var attributes=require(_0x75ff('0x9'));module[_0x75ff('0xa')]=function(_0x124f11,_0x4ed69b){return _0x124f11[_0x75ff('0xb')]('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x75ff('0xc'),_0x75ff('0xd')],'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 aa1224f..ede9343 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 _0x55db=['bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment'];(function(_0xb86b17,_0x2e1437){var _0x5e562e=function(_0x39ea82){while(--_0x39ea82){_0xb86b17['push'](_0xb86b17['shift']());}};_0x5e562e(++_0x2e1437);}(_0x55db,0xda));var _0xb55d=function(_0xad30ba,_0x3f7e67){_0xad30ba=_0xad30ba-0x0;var _0x233532=_0x55db[_0xad30ba];return _0x233532;};'use strict';var _=require('lodash');var util=require(_0xb55d('0x0'));var moment=require(_0xb55d('0x1'));var BPromise=require(_0xb55d('0x2'));var rs=require(_0xb55d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb55d('0x4'))['db'];var utils=require(_0xb55d('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb55d('0x6'));var client=jayson[_0xb55d('0x7')][_0xb55d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x76fe76,_0x2f653e,_0x47cfea){return new BPromise(function(_0x5b0279,_0x435f1e){return client['request'](_0x76fe76,_0x47cfea)[_0xb55d('0x9')](function(_0x4bee08){logger[_0xb55d('0xa')](_0xb55d('0xb'),_0x2f653e,_0xb55d('0xc'));logger[_0xb55d('0xd')](_0xb55d('0xe'),_0x2f653e,_0xb55d('0xc'),JSON[_0xb55d('0xf')](_0x4bee08));if(_0x4bee08['error']){if(_0x4bee08[_0xb55d('0x10')]['code']===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x2f653e,_0x4bee08[_0xb55d('0x10')][_0xb55d('0x11')]);return _0x435f1e(_0x4bee08[_0xb55d('0x10')][_0xb55d('0x11')]);}logger[_0xb55d('0x10')](_0xb55d('0xb'),_0x2f653e,_0x4bee08[_0xb55d('0x10')][_0xb55d('0x11')]);return _0x5b0279(_0x4bee08['error'][_0xb55d('0x11')]);}else{logger[_0xb55d('0xa')](_0xb55d('0xb'),_0x2f653e,_0xb55d('0xc'));_0x5b0279(_0x4bee08[_0xb55d('0x12')][_0xb55d('0x11')]);}})[_0xb55d('0x13')](function(_0x16c64e){logger[_0xb55d('0x10')](_0xb55d('0xb'),_0x2f653e,_0x16c64e);_0x435f1e(_0x16c64e);});});} \ No newline at end of file +var _0x63c6=['http','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x4fd1c1,_0x31e0b4){var _0x22fe21=function(_0x1d3f8a){while(--_0x1d3f8a){_0x4fd1c1['push'](_0x4fd1c1['shift']());}};_0x22fe21(++_0x31e0b4);}(_0x63c6,0x1c4));var _0x663c=function(_0x1b8223,_0x4b0bbd){_0x1b8223=_0x1b8223-0x0;var _0xee0c9=_0x63c6[_0x1b8223];return _0xee0c9;};'use strict';var _=require(_0x663c('0x0'));var util=require(_0x663c('0x1'));var moment=require(_0x663c('0x2'));var BPromise=require('bluebird');var rs=require(_0x663c('0x3'));var fs=require('fs');var Redis=require(_0x663c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x663c('0x5'));var logger=require('../../config/logger')(_0x663c('0x6'));var config=require(_0x663c('0x7'));var jayson=require(_0x663c('0x8'));var client=jayson[_0x663c('0x9')][_0x663c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3484e4,_0x296955,_0x253464){return new BPromise(function(_0x2bbf1a,_0xf7b490){return client['request'](_0x3484e4,_0x253464)[_0x663c('0xb')](function(_0x2132c3){logger['info'](_0x663c('0xc'),_0x296955,_0x663c('0xd'));logger['debug'](_0x663c('0xe'),_0x296955,_0x663c('0xd'),JSON[_0x663c('0xf')](_0x2132c3));if(_0x2132c3['error']){if(_0x2132c3['error'][_0x663c('0x10')]===0x1f4){logger['error'](_0x663c('0xc'),_0x296955,_0x2132c3[_0x663c('0x11')][_0x663c('0x12')]);return _0xf7b490(_0x2132c3['error'][_0x663c('0x12')]);}logger[_0x663c('0x11')](_0x663c('0xc'),_0x296955,_0x2132c3['error'][_0x663c('0x12')]);return _0x2bbf1a(_0x2132c3['error']['message']);}else{logger[_0x663c('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x296955,_0x663c('0xd'));_0x2bbf1a(_0x2132c3[_0x663c('0x14')][_0x663c('0x12')]);}})['catch'](function(_0x2472fa){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x296955,_0x2472fa);_0xf7b490(_0x2472fa);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 3ea1dbf..4db5a83 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 _0xf57f=['isAuthenticated','/:id','/:id/configurations','getConfigurations','getFields','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get'];(function(_0x122da6,_0x1b1737){var _0x233b82=function(_0x445871){while(--_0x445871){_0x122da6['push'](_0x122da6['shift']());}};_0x233b82(++_0x1b1737);}(_0xf57f,0xa3));var _0xff57=function(_0x1b3a09,_0x20c774){_0x1b3a09=_0x1b3a09-0x0;var _0x357bb8=_0xf57f[_0x1b3a09];return _0x357bb8;};'use strict';var multer=require(_0xff57('0x0'));var util=require(_0xff57('0x1'));var path=require(_0xff57('0x2'));var timeout=require(_0xff57('0x3'));var express=require('express');var router=express[_0xff57('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xff57('0x5'));var interaction=require(_0xff57('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router[_0xff57('0x7')]('/',auth[_0xff57('0x8')](),controller['index']);router[_0xff57('0x7')](_0xff57('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xff57('0x7')](_0xff57('0xa'),auth['isAuthenticated'](),controller[_0xff57('0xb')]);router[_0xff57('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0xff57('0xc')]);router[_0xff57('0xd')]('/',auth[_0xff57('0x8')](),controller[_0xff57('0xe')]);router[_0xff57('0xd')]('/:id/configurations',auth[_0xff57('0x8')](),controller['addConfiguration']);router[_0xff57('0xf')](_0xff57('0x9'),auth[_0xff57('0x8')](),controller[_0xff57('0x10')]);router[_0xff57('0x11')](_0xff57('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xff57('0x12')]=router; \ No newline at end of file +var _0xbe0d=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','/:id','show','getConfigurations','get','getFields','post','addConfiguration','put','delete','destroy','exports','multer','util','path'];(function(_0x3a6b24,_0x517a93){var _0x5c075c=function(_0x22da97){while(--_0x22da97){_0x3a6b24['push'](_0x3a6b24['shift']());}};_0x5c075c(++_0x517a93);}(_0xbe0d,0x97));var _0xdbe0=function(_0x36fc99,_0xe2ad98){_0x36fc99=_0x36fc99-0x0;var _0xbabbab=_0xbe0d[_0x36fc99];return _0xbabbab;};'use strict';var multer=require(_0xdbe0('0x0'));var util=require(_0xdbe0('0x1'));var path=require(_0xdbe0('0x2'));var timeout=require(_0xdbe0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdbe0('0x4'));var auth=require(_0xdbe0('0x5'));var interaction=require(_0xdbe0('0x6'));var config=require(_0xdbe0('0x7'));var controller=require(_0xdbe0('0x8'));router['get']('/',auth[_0xdbe0('0x9')](),controller[_0xdbe0('0xa')]);router['get'](_0xdbe0('0xb'),auth[_0xdbe0('0x9')](),controller[_0xdbe0('0xc')]);router['get']('/:id/configurations',auth[_0xdbe0('0x9')](),controller[_0xdbe0('0xd')]);router[_0xdbe0('0xe')]('/:id/fields',auth[_0xdbe0('0x9')](),controller[_0xdbe0('0xf')]);router[_0xdbe0('0x10')]('/',auth[_0xdbe0('0x9')](),controller['create']);router[_0xdbe0('0x10')]('/:id/configurations',auth[_0xdbe0('0x9')](),controller[_0xdbe0('0x11')]);router[_0xdbe0('0x12')](_0xdbe0('0xb'),auth[_0xdbe0('0x9')](),controller['update']);router[_0xdbe0('0x13')]('/:id',auth[_0xdbe0('0x9')](),controller[_0xdbe0('0x14')]);module[_0xdbe0('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 3fc9ed9..4a34058 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 _0x6343=['STRING','remoteUri'];(function(_0xc62c17,_0x4ad1f9){var _0x2d214b=function(_0x1569dc){while(--_0x1569dc){_0xc62c17['push'](_0xc62c17['shift']());}};_0x2d214b(++_0x4ad1f9);}(_0x6343,0x168));var _0x3634=function(_0x54adef,_0xb0b38e){_0x54adef=_0x54adef-0x0;var _0x2a88f4=_0x6343[_0x54adef];return _0x2a88f4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3634('0x0')]},'description':{'type':Sequelize[_0x3634('0x0')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3634('0x1')},'serverUrl':{'type':Sequelize[_0x3634('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0xc2c7=['exports','STRING','username','remoteUri'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xc2c7,0x134));var _0x7c2c=function(_0x239731,_0xdd2d54){_0x239731=_0x239731-0x0;var _0x1143cc=_0xc2c7[_0x239731];return _0x1143cc;};'use strict';var Sequelize=require('sequelize');module[_0x7c2c('0x0')]={'name':{'type':Sequelize[_0x7c2c('0x1')]},'description':{'type':Sequelize[_0x7c2c('0x1')]},'username':{'type':Sequelize[_0x7c2c('0x1')],'unique':_0x7c2c('0x2')},'apiKey':{'type':Sequelize[_0x7c2c('0x1')]},'remoteUri':{'type':Sequelize[_0x7c2c('0x1')],'unique':_0x7c2c('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 9cf3baa..ec931f5 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 _0xc577=['merge','VIRTUAL','includeAll','rows','show','params','length','include','find','catch','create','body','getConfigurations','findOne','FreshdeskConfiguration','order','options','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','remoteUri','apiKey','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','subject','agent','group','source','ticket_type','remove','custom_text','custom_dropdown','default','choices','test','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','statusCode','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','sendStatus','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x24b88f,_0x22ea38){var _0x34a652=function(_0xa0fb48){while(--_0xa0fb48){_0x24b88f['push'](_0x24b88f['shift']());}};_0x34a652(++_0x22ea38);}(_0xc577,0x172));var _0x7c57=function(_0x5ec09a,_0x35b386){_0x5ec09a=_0x5ec09a-0x0;var _0x1f3c39=_0xc577[_0x5ec09a];return _0x1f3c39;};'use strict';var emlformat=require(_0x7c57('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c57('0x1'));var rp=require(_0x7c57('0x2'));var moment=require(_0x7c57('0x3'));var BPromise=require(_0x7c57('0x4'));var Mustache=require(_0x7c57('0x5'));var util=require(_0x7c57('0x6'));var path=require(_0x7c57('0x7'));var sox=require('sox');var csv=require(_0x7c57('0x8'));var ejs=require(_0x7c57('0x9'));var fs=require('fs');var fs_extra=require(_0x7c57('0xa'));var _=require(_0x7c57('0xb'));var squel=require(_0x7c57('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7c57('0x8'));var querystring=require('querystring');var Papa=require(_0x7c57('0xd'));var Redis=require(_0x7c57('0xe'));var authService=require(_0x7c57('0xf'));var qs=require(_0x7c57('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c57('0x11'));var logger=require(_0x7c57('0x12'))('api');var utils=require(_0x7c57('0x13'));var config=require(_0x7c57('0x14'));var licenseUtil=require(_0x7c57('0x15'));var db=require(_0x7c57('0x16'))['db'];var integrations=require(_0x7c57('0x17'));function respondWithStatusCode(_0x10a675,_0x296cef){_0x296cef=_0x296cef||0xcc;return function(_0x4ea220){if(_0x4ea220){return _0x10a675['sendStatus'](_0x296cef);}return _0x10a675['status'](_0x296cef)[_0x7c57('0x18')]();};}function respondWithResult(_0x373a4b,_0x4c5af2){_0x4c5af2=_0x4c5af2||0xc8;return function(_0x43d1fd){if(_0x43d1fd){return _0x373a4b[_0x7c57('0x19')](_0x4c5af2)[_0x7c57('0x1a')](_0x43d1fd);}};}function respondWithFilteredResult(_0x1ba2d0,_0x14ce67){return function(_0x517d8a){if(_0x517d8a){var _0x532e93=typeof _0x14ce67[_0x7c57('0x1b')]===_0x7c57('0x1c')&&typeof _0x14ce67[_0x7c57('0x1d')]===_0x7c57('0x1c');var _0x27577c=_0x517d8a['count'];var _0x20dd80=_0x532e93?0x0:_0x14ce67[_0x7c57('0x1b')];var _0x1f0eaf=_0x532e93?_0x517d8a[_0x7c57('0x1e')]:_0x14ce67[_0x7c57('0x1b')]+_0x14ce67[_0x7c57('0x1d')];var _0x2931c4;if(_0x1f0eaf>=_0x27577c){_0x1f0eaf=_0x27577c;_0x2931c4=0xc8;}else{_0x2931c4=0xce;}_0x1ba2d0[_0x7c57('0x19')](_0x2931c4);return _0x1ba2d0[_0x7c57('0x1f')]('Content-Range',_0x20dd80+'-'+_0x1f0eaf+'/'+_0x27577c)[_0x7c57('0x1a')](_0x517d8a);}return null;};}function patchUpdates(_0x3472b8){return function(_0x21a199){try{jsonpatch[_0x7c57('0x20')](_0x21a199,_0x3472b8,!![]);}catch(_0x5795b6){return BPromise['reject'](_0x5795b6);}return _0x21a199['save']();};}function saveUpdates(_0x140376,_0x368bb6){return function(_0x47970a){if(_0x47970a){return _0x47970a[_0x7c57('0x21')](_0x140376)[_0x7c57('0x22')](function(_0x260d58){return _0x260d58;});}return null;};}function removeEntity(_0xfb0f2e,_0x4734de){return function(_0x1f8776){if(_0x1f8776){return _0x1f8776[_0x7c57('0x23')]()['then'](function(){_0xfb0f2e[_0x7c57('0x19')](0xcc)[_0x7c57('0x18')]();});}};}function handleEntityNotFound(_0x16a517,_0x1641f1){return function(_0x119e5f){if(!_0x119e5f){_0x16a517[_0x7c57('0x24')](0x194);}return _0x119e5f;};}function handleError(_0x41125b,_0x1219f2){_0x1219f2=_0x1219f2||0x1f4;return function(_0x1edf4d){logger['error'](_0x1edf4d['stack']);if(_0x1edf4d[_0x7c57('0x25')]){delete _0x1edf4d[_0x7c57('0x25')];}_0x41125b[_0x7c57('0x19')](_0x1219f2)['send'](_0x1edf4d);};}exports[_0x7c57('0x26')]=function(_0x59ae2f,_0x5acc20){var _0x5ad979={},_0x1d5b54={},_0x50c5fa={'count':0x0,'rows':[]};var _0x4b183a=_[_0x7c57('0x27')](db[_0x7c57('0x28')][_0x7c57('0x29')],function(_0x5e2836){return{'name':_0x5e2836[_0x7c57('0x2a')],'type':_0x5e2836[_0x7c57('0x2b')][_0x7c57('0x2c')]};});_0x1d5b54['model']=_[_0x7c57('0x27')](_0x4b183a,_0x7c57('0x25'));_0x1d5b54[_0x7c57('0x2d')]=_[_0x7c57('0x2e')](_0x59ae2f[_0x7c57('0x2d')]);_0x1d5b54[_0x7c57('0x2f')]=_[_0x7c57('0x30')](_0x1d5b54[_0x7c57('0x31')],_0x1d5b54[_0x7c57('0x2d')]);_0x5ad979[_0x7c57('0x32')]=_['intersection'](_0x1d5b54[_0x7c57('0x31')],qs[_0x7c57('0x33')](_0x59ae2f['query'][_0x7c57('0x33')]));_0x5ad979[_0x7c57('0x32')]=_0x5ad979[_0x7c57('0x32')]['length']?_0x5ad979[_0x7c57('0x32')]:_0x1d5b54[_0x7c57('0x31')];if(!_0x59ae2f['query'][_0x7c57('0x34')](_0x7c57('0x35'))){_0x5ad979['limit']=qs[_0x7c57('0x1d')](_0x59ae2f[_0x7c57('0x2d')][_0x7c57('0x1d')]);_0x5ad979[_0x7c57('0x1b')]=qs['offset'](_0x59ae2f[_0x7c57('0x2d')]['offset']);}_0x5ad979['order']=qs[_0x7c57('0x36')](_0x59ae2f[_0x7c57('0x2d')][_0x7c57('0x36')]);_0x5ad979[_0x7c57('0x37')]=qs['filters'](_[_0x7c57('0x38')](_0x59ae2f[_0x7c57('0x2d')],_0x1d5b54[_0x7c57('0x2f')]),_0x4b183a);if(_0x59ae2f[_0x7c57('0x2d')][_0x7c57('0x39')]){_0x5ad979[_0x7c57('0x37')]=_[_0x7c57('0x3a')](_0x5ad979['where'],{'$or':_[_0x7c57('0x27')](_0x4b183a,function(_0x3ff2f9){if(_0x3ff2f9[_0x7c57('0x2b')]!==_0x7c57('0x3b')){var _0x4f089b={};_0x4f089b[_0x3ff2f9[_0x7c57('0x25')]]={'$like':'%'+_0x59ae2f[_0x7c57('0x2d')][_0x7c57('0x39')]+'%'};return _0x4f089b;}})});}_0x5ad979=_[_0x7c57('0x3a')]({},_0x5ad979,_0x59ae2f['options']);var _0x46beba={'where':_0x5ad979[_0x7c57('0x37')]};return db[_0x7c57('0x28')][_0x7c57('0x1e')](_0x46beba)[_0x7c57('0x22')](function(_0x29e138){_0x50c5fa[_0x7c57('0x1e')]=_0x29e138;if(_0x59ae2f[_0x7c57('0x2d')][_0x7c57('0x3c')]){_0x5ad979['include']=[{'all':!![]}];}return db[_0x7c57('0x28')]['findAll'](_0x5ad979);})[_0x7c57('0x22')](function(_0x19ba23){_0x50c5fa[_0x7c57('0x3d')]=_0x19ba23;return _0x50c5fa;})[_0x7c57('0x22')](respondWithFilteredResult(_0x5acc20,_0x5ad979))['catch'](handleError(_0x5acc20,null));};exports[_0x7c57('0x3e')]=function(_0x54982b,_0x286cd2){var _0x2f59c0={'raw':![],'where':{'id':_0x54982b[_0x7c57('0x3f')]['id']}},_0x77810={};_0x77810[_0x7c57('0x31')]=_[_0x7c57('0x2e')](db[_0x7c57('0x28')]['rawAttributes']);_0x77810[_0x7c57('0x2d')]=_[_0x7c57('0x2e')](_0x54982b['query']);_0x77810[_0x7c57('0x2f')]=_['intersection'](_0x77810[_0x7c57('0x31')],_0x77810[_0x7c57('0x2d')]);_0x2f59c0[_0x7c57('0x32')]=_['intersection'](_0x77810[_0x7c57('0x31')],qs[_0x7c57('0x33')](_0x54982b['query'][_0x7c57('0x33')]));_0x2f59c0['attributes']=_0x2f59c0['attributes'][_0x7c57('0x40')]?_0x2f59c0[_0x7c57('0x32')]:_0x77810[_0x7c57('0x31')];if(_0x54982b['query'][_0x7c57('0x3c')]){_0x2f59c0[_0x7c57('0x41')]=[{'all':!![]}];}_0x2f59c0=_[_0x7c57('0x3a')]({},_0x2f59c0,_0x54982b['options']);return db[_0x7c57('0x28')][_0x7c57('0x42')](_0x2f59c0)[_0x7c57('0x22')](handleEntityNotFound(_0x286cd2,null))['then'](respondWithResult(_0x286cd2,null))[_0x7c57('0x43')](handleError(_0x286cd2,null));};exports[_0x7c57('0x44')]=function(_0x1d2ed4,_0x37e311){return db['FreshdeskAccount'][_0x7c57('0x44')](_0x1d2ed4[_0x7c57('0x45')],{})[_0x7c57('0x22')](respondWithResult(_0x37e311,0xc9))['catch'](handleError(_0x37e311,null));};exports[_0x7c57('0x21')]=function(_0x35b350,_0x403322){if(_0x35b350[_0x7c57('0x45')]['id']){delete _0x35b350['body']['id'];}return db[_0x7c57('0x28')]['find']({'where':{'id':_0x35b350[_0x7c57('0x3f')]['id']}})[_0x7c57('0x22')](handleEntityNotFound(_0x403322,null))[_0x7c57('0x22')](saveUpdates(_0x35b350[_0x7c57('0x45')],null))[_0x7c57('0x22')](respondWithResult(_0x403322,null))['catch'](handleError(_0x403322,null));};exports[_0x7c57('0x23')]=function(_0x4f6d05,_0x5be52f){return db[_0x7c57('0x28')][_0x7c57('0x42')]({'where':{'id':_0x4f6d05['params']['id']}})[_0x7c57('0x22')](handleEntityNotFound(_0x5be52f,null))['then'](removeEntity(_0x5be52f,null))[_0x7c57('0x43')](handleError(_0x5be52f,null));};exports[_0x7c57('0x46')]=function(_0x422bd6,_0x564f9c,_0x2dc67e){var _0x4208db={};var _0x11cafd={};var _0x32d0f6;var _0x1b36dd;return db['FreshdeskAccount'][_0x7c57('0x47')]({'where':{'id':_0x422bd6[_0x7c57('0x3f')]['id']}})[_0x7c57('0x22')](handleEntityNotFound(_0x564f9c,null))[_0x7c57('0x22')](function(_0x3e1048){if(_0x3e1048){_0x32d0f6=_0x3e1048;_0x11cafd[_0x7c57('0x31')]=_[_0x7c57('0x2e')](db[_0x7c57('0x48')]['rawAttributes']);_0x11cafd['query']=_[_0x7c57('0x2e')](_0x422bd6['query']);_0x11cafd['filters']=_[_0x7c57('0x30')](_0x11cafd[_0x7c57('0x31')],_0x11cafd[_0x7c57('0x2d')]);_0x4208db[_0x7c57('0x32')]=_['intersection'](_0x11cafd[_0x7c57('0x31')],qs['fields'](_0x422bd6[_0x7c57('0x2d')]['fields']));_0x4208db[_0x7c57('0x32')]=_0x4208db[_0x7c57('0x32')][_0x7c57('0x40')]?_0x4208db[_0x7c57('0x32')]:_0x11cafd[_0x7c57('0x31')];_0x4208db[_0x7c57('0x49')]=qs[_0x7c57('0x36')](_0x422bd6[_0x7c57('0x2d')]['sort']);_0x4208db[_0x7c57('0x37')]=qs['filters'](_[_0x7c57('0x38')](_0x422bd6['query'],_0x11cafd[_0x7c57('0x2f')]));if(_0x422bd6[_0x7c57('0x2d')][_0x7c57('0x39')]){_0x4208db[_0x7c57('0x37')]=_[_0x7c57('0x3a')](_0x4208db[_0x7c57('0x37')],{'$or':_[_0x7c57('0x27')](_0x4208db['attributes'],function(_0xdbddfa){var _0x4045c9={};_0x4045c9[_0xdbddfa]={'$like':'%'+_0x422bd6[_0x7c57('0x2d')]['filter']+'%'};return _0x4045c9;})});}_0x4208db=_['merge']({},_0x4208db,_0x422bd6[_0x7c57('0x4a')]);return _0x32d0f6[_0x7c57('0x46')](_0x4208db);}})[_0x7c57('0x22')](function(_0x225627){if(_0x225627){_0x1b36dd=_0x225627[_0x7c57('0x40')];if(!_0x422bd6['query']['hasOwnProperty'](_0x7c57('0x35'))){_0x4208db['limit']=qs[_0x7c57('0x1d')](_0x422bd6[_0x7c57('0x2d')][_0x7c57('0x1d')]);_0x4208db[_0x7c57('0x1b')]=qs[_0x7c57('0x1b')](_0x422bd6[_0x7c57('0x2d')][_0x7c57('0x1b')]);}return _0x32d0f6['getConfigurations'](_0x4208db);}})[_0x7c57('0x22')](function(_0x4407ef){if(_0x4407ef){return _0x4407ef?{'count':_0x1b36dd,'rows':_0x4407ef}:null;}})[_0x7c57('0x22')](respondWithResult(_0x564f9c,null))[_0x7c57('0x43')](handleError(_0x564f9c,null));};exports['addConfiguration']=function(_0x209545,_0x4a88a1,_0x15820b){if(_0x209545['body']['id']){delete _0x209545[_0x7c57('0x45')]['id'];}return db[_0x7c57('0x28')][_0x7c57('0x47')]({'where':{'id':_0x209545[_0x7c57('0x3f')]['id']}})[_0x7c57('0x22')](handleEntityNotFound(_0x4a88a1,null))[_0x7c57('0x22')](function(_0xa3b052){if(_0xa3b052){_0x209545[_0x7c57('0x45')][_0x7c57('0x4b')]=_0xa3b052['id'];_0x209545[_0x7c57('0x45')][_0x7c57('0x4c')]=integrations[_0x7c57('0x4d')](_0x209545[_0x7c57('0x45')][_0x7c57('0x4e')],_0x209545[_0x7c57('0x45')]['type']);_0x209545['body'][_0x7c57('0x4f')]=integrations['getDescriptions'](_0x209545['body'][_0x7c57('0x4e')],_0x209545[_0x7c57('0x45')][_0x7c57('0x2b')]);return db[_0x7c57('0x48')][_0x7c57('0x44')](_0x209545[_0x7c57('0x45')],{'include':[{'model':db[_0x7c57('0x50')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0x7c57('0x4f')}]});}return null;})['then'](respondWithResult(_0x4a88a1,null))[_0x7c57('0x43')](handleError(_0x4a88a1,null));};exports['getFields']=function(_0x9b0eb4,_0x516be3,_0x48d408){var _0x315854='';return db['FreshdeskAccount'][_0x7c57('0x47')]({'where':{'id':_0x9b0eb4[_0x7c57('0x3f')]['id']},'attributes':['id',_0x7c57('0x51'),_0x7c57('0x52')]})[_0x7c57('0x22')](handleEntityNotFound(_0x516be3,null))['then'](function(_0x193756){if(_0x193756){_0x315854=_0x193756[_0x7c57('0x51')];var _0x529c4a=_0x315854['slice'](-0x1);if(_0x529c4a==='/'){_0x315854=_0x315854['substring'](0x0,_0x315854[_0x7c57('0x53')](_0x529c4a));}return rp({'method':_0x7c57('0x54'),'uri':util[_0x7c57('0x55')](_0x7c57('0x56'),_0x315854,_0x7c57('0x57')),'headers':{'Authorization':util[_0x7c57('0x55')](_0x7c57('0x58'),new Buffer(util[_0x7c57('0x55')](_0x7c57('0x59'),_0x193756['apiKey']))['toString']('base64'))},'json':!![]});}})[_0x7c57('0x22')](function(_0x46ea6d){if(_0x46ea6d){var _0x5d0787=['requester',_0x7c57('0x5a'),_0x7c57('0x5b'),'description',_0x7c57('0x19'),'priority',_0x7c57('0x5c'),_0x7c57('0x5d'),_0x7c57('0x5e'),_0x7c57('0x5c'),'company'];_[_0x7c57('0x5f')](_0x46ea6d,function(_0x852b1c){return _0x5d0787['includes'](_0x852b1c[_0x7c57('0x25')])||!_0x852b1c['default']&&_0x852b1c[_0x7c57('0x2b')]!==_0x7c57('0x60')&&_0x852b1c['type']!==_0x7c57('0x61');});return{'count':_0x46ea6d['length'],'rows':_['map'](_0x46ea6d,function(_0x106c37){return{'id':_0x106c37[_0x7c57('0x25')],'name':_0x106c37['label'],'custom':!_0x106c37[_0x7c57('0x62')],'options':_0x106c37[_0x7c57('0x63')]?_[_0x7c57('0x27')](_0x106c37['choices'],function(_0x5422f2){return{'name':_['capitalize'](_0x5422f2),'value':_0x5422f2};}):[]};})};}})['then'](respondWithResult(_0x516be3,null))[_0x7c57('0x43')](function(_0x251955){var _0x2211f9=_0x9b0eb4[_0x7c57('0x2d')][_0x7c57('0x64')]?0x1f4:_0x251955['statusCode']||0x1f4;logger[_0x7c57('0x65')](_0x7c57('0x66'),_0x7c57('0x67'),_0x2211f9,JSON[_0x7c57('0x68')](_0x251955));delete _0x251955['name'];if(_0x2211f9===0x191){_0x2211f9=0x190;}_0x516be3[_0x7c57('0x19')](_0x2211f9)[_0x7c57('0x69')](_0x9b0eb4[_0x7c57('0x2d')][_0x7c57('0x64')]?{'message':'Wrong\x20credentials','statusCode':_0x251955[_0x7c57('0x6a')]}:_0x251955);});}; \ No newline at end of file +var _0x2572=['getDescriptions','FreshdeskConfiguration','FreshdeskField','Subjects','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','toString','subject','description','priority','group','source','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','getConfigurations','findOne','order','pick','addConfiguration','AccountId','channel','Descriptions'];(function(_0x2518c6,_0x44d911){var _0x3eed9c=function(_0x34e950){while(--_0x34e950){_0x2518c6['push'](_0x2518c6['shift']());}};_0x3eed9c(++_0x44d911);}(_0x2572,0x110));var _0x2257=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x2572[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x2257('0x0'));var rimraf=require(_0x2257('0x1'));var zipdir=require(_0x2257('0x2'));var jsonpatch=require(_0x2257('0x3'));var rp=require(_0x2257('0x4'));var moment=require(_0x2257('0x5'));var BPromise=require(_0x2257('0x6'));var Mustache=require(_0x2257('0x7'));var util=require(_0x2257('0x8'));var path=require('path');var sox=require(_0x2257('0x9'));var csv=require(_0x2257('0xa'));var ejs=require(_0x2257('0xb'));var fs=require('fs');var fs_extra=require(_0x2257('0xc'));var _=require(_0x2257('0xd'));var squel=require(_0x2257('0xe'));var crypto=require(_0x2257('0xf'));var jsforce=require(_0x2257('0x10'));var deskjs=require(_0x2257('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2257('0x12'));var Papa=require(_0x2257('0x13'));var Redis=require('ioredis');var authService=require(_0x2257('0x14'));var qs=require(_0x2257('0x15'));var as=require(_0x2257('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2257('0x17'))(_0x2257('0x18'));var utils=require(_0x2257('0x19'));var config=require(_0x2257('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x2257('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x578d2f,_0x7f8b71){_0x7f8b71=_0x7f8b71||0xcc;return function(_0x4537d2){if(_0x4537d2){return _0x578d2f[_0x2257('0x1c')](_0x7f8b71);}return _0x578d2f[_0x2257('0x1d')](_0x7f8b71)[_0x2257('0x1e')]();};}function respondWithResult(_0x32fdfe,_0x1738a3){_0x1738a3=_0x1738a3||0xc8;return function(_0x4c13fe){if(_0x4c13fe){return _0x32fdfe['status'](_0x1738a3)[_0x2257('0x1f')](_0x4c13fe);}};}function respondWithFilteredResult(_0x45efee,_0x2b4102){return function(_0x156d68){if(_0x156d68){var _0x591021=typeof _0x2b4102['offset']===_0x2257('0x20')&&typeof _0x2b4102['limit']==='undefined';var _0x5c8153=_0x156d68[_0x2257('0x21')];var _0x2d51e7=_0x591021?0x0:_0x2b4102[_0x2257('0x22')];var _0x2c3c79=_0x591021?_0x156d68[_0x2257('0x21')]:_0x2b4102[_0x2257('0x22')]+_0x2b4102[_0x2257('0x23')];var _0x3f3c83;if(_0x2c3c79>=_0x5c8153){_0x2c3c79=_0x5c8153;_0x3f3c83=0xc8;}else{_0x3f3c83=0xce;}_0x45efee[_0x2257('0x1d')](_0x3f3c83);return _0x45efee[_0x2257('0x24')](_0x2257('0x25'),_0x2d51e7+'-'+_0x2c3c79+'/'+_0x5c8153)[_0x2257('0x1f')](_0x156d68);}return null;};}function patchUpdates(_0x482240){return function(_0xe08b33){try{jsonpatch[_0x2257('0x26')](_0xe08b33,_0x482240,!![]);}catch(_0x5a62a3){return BPromise['reject'](_0x5a62a3);}return _0xe08b33[_0x2257('0x27')]();};}function saveUpdates(_0x5ae577,_0x31cd98){return function(_0x44a2da){if(_0x44a2da){return _0x44a2da[_0x2257('0x28')](_0x5ae577)[_0x2257('0x29')](function(_0x137d53){return _0x137d53;});}return null;};}function removeEntity(_0x1e220c,_0x1549aa){return function(_0x18fec2){if(_0x18fec2){return _0x18fec2[_0x2257('0x2a')]()[_0x2257('0x29')](function(){_0x1e220c['status'](0xcc)[_0x2257('0x1e')]();});}};}function handleEntityNotFound(_0x227155,_0x58e30d){return function(_0x37caa6){if(!_0x37caa6){_0x227155[_0x2257('0x1c')](0x194);}return _0x37caa6;};}function handleError(_0x4e0eaf,_0x1c1a76){_0x1c1a76=_0x1c1a76||0x1f4;return function(_0x1fdd82){logger['error'](_0x1fdd82[_0x2257('0x2b')]);if(_0x1fdd82[_0x2257('0x2c')]){delete _0x1fdd82[_0x2257('0x2c')];}_0x4e0eaf[_0x2257('0x1d')](_0x1c1a76)['send'](_0x1fdd82);};}exports[_0x2257('0x2d')]=function(_0x8952ad,_0x508cad){var _0x38e581={},_0x1c19c6={},_0x28403e={'count':0x0,'rows':[]};var _0x21931d=_[_0x2257('0x2e')](db[_0x2257('0x2f')][_0x2257('0x30')],function(_0x43f0b2){return{'name':_0x43f0b2[_0x2257('0x31')],'type':_0x43f0b2['type'][_0x2257('0x32')]};});_0x1c19c6[_0x2257('0x33')]=_['map'](_0x21931d,'name');_0x1c19c6[_0x2257('0x34')]=_[_0x2257('0x35')](_0x8952ad[_0x2257('0x34')]);_0x1c19c6[_0x2257('0x36')]=_[_0x2257('0x37')](_0x1c19c6[_0x2257('0x33')],_0x1c19c6['query']);_0x38e581[_0x2257('0x38')]=_[_0x2257('0x37')](_0x1c19c6[_0x2257('0x33')],qs[_0x2257('0x39')](_0x8952ad['query'][_0x2257('0x39')]));_0x38e581['attributes']=_0x38e581['attributes'][_0x2257('0x3a')]?_0x38e581[_0x2257('0x38')]:_0x1c19c6[_0x2257('0x33')];if(!_0x8952ad[_0x2257('0x34')][_0x2257('0x3b')](_0x2257('0x3c'))){_0x38e581[_0x2257('0x23')]=qs[_0x2257('0x23')](_0x8952ad[_0x2257('0x34')][_0x2257('0x23')]);_0x38e581[_0x2257('0x22')]=qs[_0x2257('0x22')](_0x8952ad[_0x2257('0x34')][_0x2257('0x22')]);}_0x38e581['order']=qs[_0x2257('0x3d')](_0x8952ad[_0x2257('0x34')][_0x2257('0x3d')]);_0x38e581[_0x2257('0x3e')]=qs[_0x2257('0x36')](_['pick'](_0x8952ad[_0x2257('0x34')],_0x1c19c6[_0x2257('0x36')]),_0x21931d);if(_0x8952ad[_0x2257('0x34')][_0x2257('0x3f')]){_0x38e581[_0x2257('0x3e')]=_[_0x2257('0x40')](_0x38e581[_0x2257('0x3e')],{'$or':_[_0x2257('0x2e')](_0x21931d,function(_0x33adbf){if(_0x33adbf[_0x2257('0x41')]!==_0x2257('0x42')){var _0x392104={};_0x392104[_0x33adbf[_0x2257('0x2c')]]={'$like':'%'+_0x8952ad['query'][_0x2257('0x3f')]+'%'};return _0x392104;}})});}_0x38e581=_[_0x2257('0x40')]({},_0x38e581,_0x8952ad[_0x2257('0x43')]);var _0x1e4541={'where':_0x38e581[_0x2257('0x3e')]};return db[_0x2257('0x2f')][_0x2257('0x21')](_0x1e4541)[_0x2257('0x29')](function(_0x41db20){_0x28403e[_0x2257('0x21')]=_0x41db20;if(_0x8952ad['query'][_0x2257('0x44')]){_0x38e581[_0x2257('0x45')]=[{'all':!![]}];}return db[_0x2257('0x2f')]['findAll'](_0x38e581);})[_0x2257('0x29')](function(_0x907312){_0x28403e[_0x2257('0x46')]=_0x907312;return _0x28403e;})[_0x2257('0x29')](respondWithFilteredResult(_0x508cad,_0x38e581))[_0x2257('0x47')](handleError(_0x508cad,null));};exports[_0x2257('0x48')]=function(_0x5d010c,_0x2fc24b){var _0x2be2ee={'raw':![],'where':{'id':_0x5d010c[_0x2257('0x49')]['id']}},_0x3ef686={};_0x3ef686['model']=_['keys'](db['FreshdeskAccount']['rawAttributes']);_0x3ef686[_0x2257('0x34')]=_['keys'](_0x5d010c['query']);_0x3ef686[_0x2257('0x36')]=_['intersection'](_0x3ef686['model'],_0x3ef686['query']);_0x2be2ee[_0x2257('0x38')]=_[_0x2257('0x37')](_0x3ef686[_0x2257('0x33')],qs[_0x2257('0x39')](_0x5d010c[_0x2257('0x34')][_0x2257('0x39')]));_0x2be2ee[_0x2257('0x38')]=_0x2be2ee['attributes'][_0x2257('0x3a')]?_0x2be2ee['attributes']:_0x3ef686[_0x2257('0x33')];if(_0x5d010c[_0x2257('0x34')][_0x2257('0x44')]){_0x2be2ee[_0x2257('0x45')]=[{'all':!![]}];}_0x2be2ee=_[_0x2257('0x40')]({},_0x2be2ee,_0x5d010c[_0x2257('0x43')]);return db[_0x2257('0x2f')]['find'](_0x2be2ee)[_0x2257('0x29')](handleEntityNotFound(_0x2fc24b,null))[_0x2257('0x29')](respondWithResult(_0x2fc24b,null))['catch'](handleError(_0x2fc24b,null));};exports[_0x2257('0x4a')]=function(_0x496696,_0x10d8b2){return db[_0x2257('0x2f')][_0x2257('0x4a')](_0x496696[_0x2257('0x4b')],{})[_0x2257('0x29')](respondWithResult(_0x10d8b2,0xc9))[_0x2257('0x47')](handleError(_0x10d8b2,null));};exports[_0x2257('0x28')]=function(_0x50c5cb,_0x404e8c){if(_0x50c5cb[_0x2257('0x4b')]['id']){delete _0x50c5cb['body']['id'];}return db[_0x2257('0x2f')]['find']({'where':{'id':_0x50c5cb[_0x2257('0x49')]['id']}})[_0x2257('0x29')](handleEntityNotFound(_0x404e8c,null))[_0x2257('0x29')](saveUpdates(_0x50c5cb[_0x2257('0x4b')],null))['then'](respondWithResult(_0x404e8c,null))[_0x2257('0x47')](handleError(_0x404e8c,null));};exports['destroy']=function(_0x456020,_0x53644a){return db[_0x2257('0x2f')][_0x2257('0x4c')]({'where':{'id':_0x456020[_0x2257('0x49')]['id']}})[_0x2257('0x29')](handleEntityNotFound(_0x53644a,null))[_0x2257('0x29')](removeEntity(_0x53644a,null))[_0x2257('0x47')](handleError(_0x53644a,null));};exports[_0x2257('0x4d')]=function(_0x3cd031,_0x5e8a15,_0x17343c){var _0x117a8c={};var _0x3a8600={};var _0x333638;var _0x3ae279;return db[_0x2257('0x2f')][_0x2257('0x4e')]({'where':{'id':_0x3cd031[_0x2257('0x49')]['id']}})[_0x2257('0x29')](handleEntityNotFound(_0x5e8a15,null))[_0x2257('0x29')](function(_0x194d90){if(_0x194d90){_0x333638=_0x194d90;_0x3a8600[_0x2257('0x33')]=_[_0x2257('0x35')](db['FreshdeskConfiguration'][_0x2257('0x30')]);_0x3a8600[_0x2257('0x34')]=_[_0x2257('0x35')](_0x3cd031['query']);_0x3a8600[_0x2257('0x36')]=_[_0x2257('0x37')](_0x3a8600[_0x2257('0x33')],_0x3a8600['query']);_0x117a8c[_0x2257('0x38')]=_[_0x2257('0x37')](_0x3a8600[_0x2257('0x33')],qs[_0x2257('0x39')](_0x3cd031[_0x2257('0x34')][_0x2257('0x39')]));_0x117a8c['attributes']=_0x117a8c['attributes'][_0x2257('0x3a')]?_0x117a8c[_0x2257('0x38')]:_0x3a8600[_0x2257('0x33')];_0x117a8c[_0x2257('0x4f')]=qs[_0x2257('0x3d')](_0x3cd031[_0x2257('0x34')][_0x2257('0x3d')]);_0x117a8c[_0x2257('0x3e')]=qs[_0x2257('0x36')](_[_0x2257('0x50')](_0x3cd031[_0x2257('0x34')],_0x3a8600[_0x2257('0x36')]));if(_0x3cd031[_0x2257('0x34')][_0x2257('0x3f')]){_0x117a8c[_0x2257('0x3e')]=_[_0x2257('0x40')](_0x117a8c[_0x2257('0x3e')],{'$or':_[_0x2257('0x2e')](_0x117a8c[_0x2257('0x38')],function(_0x4bf731){var _0x5f4965={};_0x5f4965[_0x4bf731]={'$like':'%'+_0x3cd031['query'][_0x2257('0x3f')]+'%'};return _0x5f4965;})});}_0x117a8c=_[_0x2257('0x40')]({},_0x117a8c,_0x3cd031[_0x2257('0x43')]);return _0x333638[_0x2257('0x4d')](_0x117a8c);}})[_0x2257('0x29')](function(_0x412efa){if(_0x412efa){_0x3ae279=_0x412efa[_0x2257('0x3a')];if(!_0x3cd031[_0x2257('0x34')]['hasOwnProperty']('nolimit')){_0x117a8c[_0x2257('0x23')]=qs['limit'](_0x3cd031[_0x2257('0x34')]['limit']);_0x117a8c[_0x2257('0x22')]=qs['offset'](_0x3cd031[_0x2257('0x34')][_0x2257('0x22')]);}return _0x333638[_0x2257('0x4d')](_0x117a8c);}})[_0x2257('0x29')](function(_0x22c4ea){if(_0x22c4ea){return _0x22c4ea?{'count':_0x3ae279,'rows':_0x22c4ea}:null;}})[_0x2257('0x29')](respondWithResult(_0x5e8a15,null))[_0x2257('0x47')](handleError(_0x5e8a15,null));};exports[_0x2257('0x51')]=function(_0x553947,_0x3b2da6,_0x28f948){if(_0x553947[_0x2257('0x4b')]['id']){delete _0x553947[_0x2257('0x4b')]['id'];}return db[_0x2257('0x2f')][_0x2257('0x4e')]({'where':{'id':_0x553947[_0x2257('0x49')]['id']}})['then'](handleEntityNotFound(_0x3b2da6,null))[_0x2257('0x29')](function(_0xa07de9){if(_0xa07de9){_0x553947[_0x2257('0x4b')][_0x2257('0x52')]=_0xa07de9['id'];_0x553947[_0x2257('0x4b')]['Subjects']=integrations['getSubjects'](_0x553947['body'][_0x2257('0x53')],_0x553947[_0x2257('0x4b')][_0x2257('0x41')]);_0x553947[_0x2257('0x4b')][_0x2257('0x54')]=integrations[_0x2257('0x55')](_0x553947[_0x2257('0x4b')][_0x2257('0x53')],_0x553947['body'][_0x2257('0x41')]);return db[_0x2257('0x56')]['create'](_0x553947[_0x2257('0x4b')],{'include':[{'model':db[_0x2257('0x57')],'as':_0x2257('0x58')},{'model':db[_0x2257('0x57')],'as':_0x2257('0x54')}]});}return null;})[_0x2257('0x29')](respondWithResult(_0x3b2da6,null))[_0x2257('0x47')](handleError(_0x3b2da6,null));};exports[_0x2257('0x59')]=function(_0x5b1972,_0x46c88e,_0x375a2b){var _0x56b1d0='';return db[_0x2257('0x2f')]['findOne']({'where':{'id':_0x5b1972[_0x2257('0x49')]['id']},'attributes':['id',_0x2257('0x5a'),_0x2257('0x5b')]})[_0x2257('0x29')](handleEntityNotFound(_0x46c88e,null))[_0x2257('0x29')](function(_0x2005e1){if(_0x2005e1){_0x56b1d0=_0x2005e1['remoteUri'];var _0x498f1f=_0x56b1d0[_0x2257('0x5c')](-0x1);if(_0x498f1f==='/'){_0x56b1d0=_0x56b1d0[_0x2257('0x5d')](0x0,_0x56b1d0[_0x2257('0x5e')](_0x498f1f));}return rp({'method':_0x2257('0x5f'),'uri':util[_0x2257('0x60')](_0x2257('0x61'),_0x56b1d0,_0x2257('0x62')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util['format']('%s:X',_0x2005e1[_0x2257('0x5b')]))[_0x2257('0x63')]('base64'))},'json':!![]});}})[_0x2257('0x29')](function(_0x1dd412){if(_0x1dd412){var _0x3aafa1=['requester',_0x2257('0x64'),'agent',_0x2257('0x65'),_0x2257('0x1d'),_0x2257('0x66'),_0x2257('0x67'),_0x2257('0x68'),'ticket_type',_0x2257('0x67'),'company'];_[_0x2257('0x69')](_0x1dd412,function(_0x4c5ad0){return _0x3aafa1[_0x2257('0x6a')](_0x4c5ad0[_0x2257('0x2c')])||!_0x4c5ad0[_0x2257('0x6b')]&&_0x4c5ad0[_0x2257('0x41')]!==_0x2257('0x6c')&&_0x4c5ad0[_0x2257('0x41')]!==_0x2257('0x6d');});return{'count':_0x1dd412[_0x2257('0x3a')],'rows':_[_0x2257('0x2e')](_0x1dd412,function(_0x495705){return{'id':_0x495705[_0x2257('0x2c')],'name':_0x495705['label'],'custom':!_0x495705[_0x2257('0x6b')],'options':_0x495705[_0x2257('0x6e')]?_[_0x2257('0x2e')](_0x495705[_0x2257('0x6e')],function(_0x45cb75){return{'name':_[_0x2257('0x6f')](_0x45cb75),'value':_0x45cb75};}):[]};})};}})[_0x2257('0x29')](respondWithResult(_0x46c88e,null))['catch'](function(_0x4b26ba){var _0x4684a0=_0x5b1972[_0x2257('0x34')][_0x2257('0x70')]?0x1f4:_0x4b26ba['statusCode']||0x1f4;logger[_0x2257('0x71')](_0x2257('0x72'),_0x2257('0x59'),_0x4684a0,JSON[_0x2257('0x73')](_0x4b26ba));delete _0x4b26ba['name'];if(_0x4684a0===0x191){_0x4684a0=0x190;}_0x46c88e[_0x2257('0x1d')](_0x4684a0)[_0x2257('0x74')](_0x5b1972[_0x2257('0x34')][_0x2257('0x70')]?{'message':_0x2257('0x75'),'statusCode':_0x4b26ba[_0x2257('0x76')]}:_0x4b26ba);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index e93b911..e45ebe1 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 _0xfe5f=['lodash','api','moment','bluebird','request-promise','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xfe5f,0x6c));var _0xffe5=function(_0x284330,_0xeba324){_0x284330=_0x284330-0x0;var _0x12b57a=_0xfe5f[_0x284330];return _0x12b57a;};'use strict';var _=require(_0xffe5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xffe5('0x1'));var moment=require(_0xffe5('0x2'));var BPromise=require(_0xffe5('0x3'));var rp=require(_0xffe5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xffe5('0x5'));var config=require('../../config/environment');var attributes=require(_0xffe5('0x6'));var integrations=require(_0xffe5('0x7'));module[_0xffe5('0x8')]=function(_0x2fc091,_0x4c2831){return _0x2fc091[_0xffe5('0x9')](_0xffe5('0xa'),attributes,{'tableName':_0xffe5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdcc5=['define','int_freshdesk_accounts','util','../../config/logger','api','moment','bluebird','path','../../config/environment','../../components/integrations/configuration'];(function(_0x19b140,_0x2d11aa){var _0x1f32ac=function(_0x3df05c){while(--_0x3df05c){_0x19b140['push'](_0x19b140['shift']());}};_0x1f32ac(++_0x2d11aa);}(_0xdcc5,0x12e));var _0x5dcc=function(_0x10d93c,_0x6b081a){_0x10d93c=_0x10d93c-0x0;var _0x3a1ae5=_0xdcc5[_0x10d93c];return _0x3a1ae5;};'use strict';var _=require('lodash');var util=require(_0x5dcc('0x0'));var logger=require(_0x5dcc('0x1'))(_0x5dcc('0x2'));var moment=require(_0x5dcc('0x3'));var BPromise=require(_0x5dcc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5dcc('0x5'));var rimraf=require('rimraf');var config=require(_0x5dcc('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x5dcc('0x7'));module['exports']=function(_0xf500fd,_0x474bed){return _0xf500fd[_0x5dcc('0x8')]('FreshdeskAccount',attributes,{'tableName':_0x5dcc('0x9'),'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 627a62c..0e27c07 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 _0x8ba1=['stringify','ShowFreshdeskAccount','FreshdeskAccount','find','raw','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetFreshdeskAccount','findAll','options','where','attributes','limit','include','map','model'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x8ba1,0x19e));var _0x18ba=function(_0x53fef3,_0x248968){_0x53fef3=_0x53fef3-0x0;var _0xc7bb8c=_0x8ba1[_0x53fef3];return _0xc7bb8c;};'use strict';var _=require('lodash');var util=require(_0x18ba('0x0'));var moment=require(_0x18ba('0x1'));var BPromise=require('bluebird');var rs=require(_0x18ba('0x2'));var fs=require('fs');var Redis=require(_0x18ba('0x3'));var db=require(_0x18ba('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x18ba('0x5'))(_0x18ba('0x6'));var config=require('../../config/environment');var jayson=require(_0x18ba('0x7'));var client=jayson[_0x18ba('0x8')][_0x18ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b08da,_0x11703b,_0xc61236){return new BPromise(function(_0xc3030a,_0x997350){return client['request'](_0x1b08da,_0xc61236)[_0x18ba('0xa')](function(_0x42d05f){logger[_0x18ba('0xb')](_0x18ba('0xc'),_0x11703b,_0x18ba('0xd'));logger[_0x18ba('0xe')](_0x18ba('0xf'),_0x11703b,_0x18ba('0xd'),JSON['stringify'](_0x42d05f));if(_0x42d05f[_0x18ba('0x10')]){if(_0x42d05f['error']['code']===0x1f4){logger[_0x18ba('0x10')](_0x18ba('0xc'),_0x11703b,_0x42d05f[_0x18ba('0x10')][_0x18ba('0x11')]);return _0x997350(_0x42d05f['error'][_0x18ba('0x11')]);}logger[_0x18ba('0x10')](_0x18ba('0xc'),_0x11703b,_0x42d05f[_0x18ba('0x10')][_0x18ba('0x11')]);return _0xc3030a(_0x42d05f[_0x18ba('0x10')][_0x18ba('0x11')]);}else{logger[_0x18ba('0xb')](_0x18ba('0xc'),_0x11703b,_0x18ba('0xd'));_0xc3030a(_0x42d05f[_0x18ba('0x12')][_0x18ba('0x11')]);}})['catch'](function(_0x531cb7){logger[_0x18ba('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x11703b,_0x531cb7);_0x997350(_0x531cb7);});});}exports[_0x18ba('0x13')]=function(_0xe14379){var _0x417c71=this;return new Promise(function(_0x403826,_0x4c521b){return db['FreshdeskAccount'][_0x18ba('0x14')]({'raw':_0xe14379[_0x18ba('0x15')]?_0xe14379['options']['raw']===undefined?!![]:![]:!![],'where':_0xe14379[_0x18ba('0x15')]?_0xe14379['options'][_0x18ba('0x16')]||null:null,'attributes':_0xe14379[_0x18ba('0x15')]?_0xe14379[_0x18ba('0x15')][_0x18ba('0x17')]||null:null,'limit':_0xe14379[_0x18ba('0x15')]?_0xe14379['options'][_0x18ba('0x18')]||null:null,'include':_0xe14379[_0x18ba('0x15')]?_0xe14379[_0x18ba('0x15')][_0x18ba('0x19')]?_[_0x18ba('0x1a')](_0xe14379[_0x18ba('0x15')][_0x18ba('0x19')],function(_0x3d92b3){return{'model':db[_0x3d92b3[_0x18ba('0x1b')]],'as':_0x3d92b3['as'],'attributes':_0x3d92b3[_0x18ba('0x17')],'include':_0x3d92b3[_0x18ba('0x19')]?_[_0x18ba('0x1a')](_0x3d92b3[_0x18ba('0x19')],function(_0x11e2f7){return{'model':db[_0x11e2f7[_0x18ba('0x1b')]],'as':_0x11e2f7['as'],'attributes':_0x11e2f7[_0x18ba('0x17')],'include':_0x11e2f7[_0x18ba('0x19')]?_[_0x18ba('0x1a')](_0x11e2f7[_0x18ba('0x19')],function(_0x101c4e){return{'model':db[_0x101c4e[_0x18ba('0x1b')]],'as':_0x101c4e['as'],'attributes':_0x101c4e[_0x18ba('0x17')]};}):[]};}):[]};}):[]:[]})[_0x18ba('0xa')](function(_0x2c2a4f){logger[_0x18ba('0xb')](_0x18ba('0x13'),_0xe14379);logger[_0x18ba('0xe')](_0x18ba('0x13'),_0xe14379,JSON[_0x18ba('0x1c')](_0x2c2a4f));_0x403826(_0x2c2a4f);})['catch'](function(_0x3e66c1){logger[_0x18ba('0x10')]('GetFreshdeskAccount',_0x3e66c1[_0x18ba('0x11')],_0xe14379);_0x4c521b(_0x417c71[_0x18ba('0x10')](0x1f4,_0x3e66c1['message']));});});};exports[_0x18ba('0x1d')]=function(_0x10950b){var _0x54c821=this;return new Promise(function(_0x398764,_0x5458b3){return db[_0x18ba('0x1e')][_0x18ba('0x1f')]({'raw':_0x10950b[_0x18ba('0x15')]?_0x10950b[_0x18ba('0x15')][_0x18ba('0x20')]===undefined?!![]:![]:!![],'where':_0x10950b[_0x18ba('0x15')]?_0x10950b['options'][_0x18ba('0x16')]||null:null,'attributes':_0x10950b[_0x18ba('0x15')]?_0x10950b[_0x18ba('0x15')]['attributes']||null:null,'include':_0x10950b[_0x18ba('0x15')]?_0x10950b['options'][_0x18ba('0x19')]?_['map'](_0x10950b[_0x18ba('0x15')][_0x18ba('0x19')],function(_0x2e6b56){return{'model':db[_0x2e6b56[_0x18ba('0x1b')]],'as':_0x2e6b56['as'],'attributes':_0x2e6b56[_0x18ba('0x17')],'include':_0x2e6b56[_0x18ba('0x19')]?_['map'](_0x2e6b56[_0x18ba('0x19')],function(_0x42480d){return{'model':db[_0x42480d['model']],'as':_0x42480d['as'],'attributes':_0x42480d[_0x18ba('0x17')],'include':_0x42480d[_0x18ba('0x19')]?_[_0x18ba('0x1a')](_0x42480d[_0x18ba('0x19')],function(_0x437796){return{'model':db[_0x437796['model']],'as':_0x437796['as'],'attributes':_0x437796[_0x18ba('0x17')]};}):[]};}):[]};}):[]:[]})[_0x18ba('0xa')](function(_0x190148){logger[_0x18ba('0xb')]('ShowFreshdeskAccount',_0x10950b);logger[_0x18ba('0xe')](_0x18ba('0x1d'),_0x10950b,JSON[_0x18ba('0x1c')](_0x190148));_0x398764(_0x190148);})[_0x18ba('0x21')](function(_0x2b10e5){logger[_0x18ba('0x10')](_0x18ba('0x1d'),_0x2b10e5[_0x18ba('0x11')],_0x10950b);_0x5458b3(_0x54c821[_0x18ba('0x10')](0x1f4,_0x2b10e5[_0x18ba('0x11')]));});});}; \ No newline at end of file +var _0x5a24=['where','attributes','limit','map','include','model','GetFreshdeskAccount','ShowFreshdeskAccount','then','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FreshdeskAccount','findAll','options','raw'];(function(_0x25983c,_0x3aabc8){var _0x4814e2=function(_0xdb069e){while(--_0xdb069e){_0x25983c['push'](_0x25983c['shift']());}};_0x4814e2(++_0x3aabc8);}(_0x5a24,0x6f));var _0x45a2=function(_0x565e8e,_0xd87e30){_0x565e8e=_0x565e8e-0x0;var _0x4eac87=_0x5a24[_0x565e8e];return _0x4eac87;};'use strict';var _=require(_0x45a2('0x0'));var util=require(_0x45a2('0x1'));var moment=require(_0x45a2('0x2'));var BPromise=require(_0x45a2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45a2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x45a2('0x5'));var logger=require(_0x45a2('0x6'))('rpc');var config=require(_0x45a2('0x7'));var jayson=require(_0x45a2('0x8'));var client=jayson[_0x45a2('0x9')][_0x45a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2454cf,_0x177058,_0x2349ad){return new BPromise(function(_0x50d383,_0x28174a){return client['request'](_0x2454cf,_0x2349ad)['then'](function(_0x5f4d0c){logger[_0x45a2('0xb')](_0x45a2('0xc'),_0x177058,_0x45a2('0xd'));logger[_0x45a2('0xe')](_0x45a2('0xf'),_0x177058,_0x45a2('0xd'),JSON[_0x45a2('0x10')](_0x5f4d0c));if(_0x5f4d0c[_0x45a2('0x11')]){if(_0x5f4d0c['error']['code']===0x1f4){logger[_0x45a2('0x11')](_0x45a2('0xc'),_0x177058,_0x5f4d0c[_0x45a2('0x11')][_0x45a2('0x12')]);return _0x28174a(_0x5f4d0c[_0x45a2('0x11')]['message']);}logger[_0x45a2('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x177058,_0x5f4d0c[_0x45a2('0x11')][_0x45a2('0x12')]);return _0x50d383(_0x5f4d0c[_0x45a2('0x11')]['message']);}else{logger[_0x45a2('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x177058,_0x45a2('0xd'));_0x50d383(_0x5f4d0c[_0x45a2('0x13')][_0x45a2('0x12')]);}})[_0x45a2('0x14')](function(_0x5ab45d){logger[_0x45a2('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x177058,_0x5ab45d);_0x28174a(_0x5ab45d);});});}exports['GetFreshdeskAccount']=function(_0x5f522b){var _0x26a31b=this;return new Promise(function(_0x47518e,_0xcb86d5){return db[_0x45a2('0x15')][_0x45a2('0x16')]({'raw':_0x5f522b[_0x45a2('0x17')]?_0x5f522b[_0x45a2('0x17')][_0x45a2('0x18')]===undefined?!![]:![]:!![],'where':_0x5f522b['options']?_0x5f522b[_0x45a2('0x17')][_0x45a2('0x19')]||null:null,'attributes':_0x5f522b[_0x45a2('0x17')]?_0x5f522b['options'][_0x45a2('0x1a')]||null:null,'limit':_0x5f522b['options']?_0x5f522b[_0x45a2('0x17')][_0x45a2('0x1b')]||null:null,'include':_0x5f522b['options']?_0x5f522b[_0x45a2('0x17')]['include']?_[_0x45a2('0x1c')](_0x5f522b[_0x45a2('0x17')][_0x45a2('0x1d')],function(_0x1682d7){return{'model':db[_0x1682d7['model']],'as':_0x1682d7['as'],'attributes':_0x1682d7[_0x45a2('0x1a')],'include':_0x1682d7[_0x45a2('0x1d')]?_[_0x45a2('0x1c')](_0x1682d7['include'],function(_0x59c285){return{'model':db[_0x59c285[_0x45a2('0x1e')]],'as':_0x59c285['as'],'attributes':_0x59c285[_0x45a2('0x1a')],'include':_0x59c285[_0x45a2('0x1d')]?_[_0x45a2('0x1c')](_0x59c285[_0x45a2('0x1d')],function(_0x4401d4){return{'model':db[_0x4401d4[_0x45a2('0x1e')]],'as':_0x4401d4['as'],'attributes':_0x4401d4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x68c797){logger[_0x45a2('0xb')](_0x45a2('0x1f'),_0x5f522b);logger['debug'](_0x45a2('0x1f'),_0x5f522b,JSON['stringify'](_0x68c797));_0x47518e(_0x68c797);})[_0x45a2('0x14')](function(_0x1aad56){logger[_0x45a2('0x11')](_0x45a2('0x1f'),_0x1aad56[_0x45a2('0x12')],_0x5f522b);_0xcb86d5(_0x26a31b[_0x45a2('0x11')](0x1f4,_0x1aad56[_0x45a2('0x12')]));});});};exports[_0x45a2('0x20')]=function(_0xddc56b){var _0x3086da=this;return new Promise(function(_0x4e3188,_0x360c5e){return db[_0x45a2('0x15')]['find']({'raw':_0xddc56b['options']?_0xddc56b[_0x45a2('0x17')][_0x45a2('0x18')]===undefined?!![]:![]:!![],'where':_0xddc56b[_0x45a2('0x17')]?_0xddc56b[_0x45a2('0x17')][_0x45a2('0x19')]||null:null,'attributes':_0xddc56b['options']?_0xddc56b[_0x45a2('0x17')][_0x45a2('0x1a')]||null:null,'include':_0xddc56b[_0x45a2('0x17')]?_0xddc56b['options'][_0x45a2('0x1d')]?_[_0x45a2('0x1c')](_0xddc56b[_0x45a2('0x17')][_0x45a2('0x1d')],function(_0x2511cb){return{'model':db[_0x2511cb[_0x45a2('0x1e')]],'as':_0x2511cb['as'],'attributes':_0x2511cb['attributes'],'include':_0x2511cb[_0x45a2('0x1d')]?_['map'](_0x2511cb['include'],function(_0x3f050d){return{'model':db[_0x3f050d['model']],'as':_0x3f050d['as'],'attributes':_0x3f050d[_0x45a2('0x1a')],'include':_0x3f050d[_0x45a2('0x1d')]?_['map'](_0x3f050d[_0x45a2('0x1d')],function(_0x487aae){return{'model':db[_0x487aae[_0x45a2('0x1e')]],'as':_0x487aae['as'],'attributes':_0x487aae[_0x45a2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x45a2('0x21')](function(_0x4e9af2){logger[_0x45a2('0xb')](_0x45a2('0x20'),_0xddc56b);logger[_0x45a2('0xe')](_0x45a2('0x20'),_0xddc56b,JSON['stringify'](_0x4e9af2));_0x4e3188(_0x4e9af2);})[_0x45a2('0x14')](function(_0xb02ef0){logger[_0x45a2('0x11')](_0x45a2('0x20'),_0xb02ef0['message'],_0xddc56b);_0x360c5e(_0x3086da[_0x45a2('0x11')](0x1f4,_0xb02ef0[_0x45a2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index afdc6d1..6a6cdb8 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 _0x1e4d=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','setTags','put','update'];(function(_0x29b3a2,_0x319af1){var _0x478ed2=function(_0x32ea1b){while(--_0x32ea1b){_0x29b3a2['push'](_0x29b3a2['shift']());}};_0x478ed2(++_0x319af1);}(_0x1e4d,0xab));var _0xd1e4=function(_0x468bd6,_0x1f06c4){_0x468bd6=_0x468bd6-0x0;var _0x11d7bb=_0x1e4d[_0x468bd6];return _0x11d7bb;};'use strict';var multer=require(_0xd1e4('0x0'));var util=require(_0xd1e4('0x1'));var path=require(_0xd1e4('0x2'));var timeout=require(_0xd1e4('0x3'));var express=require(_0xd1e4('0x4'));var router=express[_0xd1e4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd1e4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd1e4('0x7'));var controller=require(_0xd1e4('0x8'));router[_0xd1e4('0x9')]('/',auth[_0xd1e4('0xa')](),controller[_0xd1e4('0xb')]);router[_0xd1e4('0x9')](_0xd1e4('0xc'),auth[_0xd1e4('0xa')](),controller[_0xd1e4('0xd')]);router[_0xd1e4('0x9')](_0xd1e4('0xe'),auth[_0xd1e4('0xa')](),controller[_0xd1e4('0xf')]);router[_0xd1e4('0x9')](_0xd1e4('0x10'),auth['isAuthenticated'](),controller[_0xd1e4('0x11')]);router[_0xd1e4('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xd1e4('0x12')]);router[_0xd1e4('0x9')](_0xd1e4('0x13'),auth[_0xd1e4('0xa')](),controller['getTags']);router[_0xd1e4('0x14')]('/',auth[_0xd1e4('0xa')](),controller[_0xd1e4('0x15')]);router[_0xd1e4('0x14')]('/:id/tags',auth[_0xd1e4('0xa')](),controller[_0xd1e4('0x16')]);router[_0xd1e4('0x17')](_0xd1e4('0xc'),auth[_0xd1e4('0xa')](),controller[_0xd1e4('0x18')]);router[_0xd1e4('0x19')](_0xd1e4('0xc'),auth['isAuthenticated'](),controller[_0xd1e4('0x1a')]);module[_0xd1e4('0x1b')]=router; \ No newline at end of file +var _0xfba0=['fs-extra','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xfba0,0x1c3));var _0x0fba=function(_0x58c9a6,_0x2df332){_0x58c9a6=_0x58c9a6-0x0;var _0x3ceb24=_0xfba0[_0x58c9a6];return _0x3ceb24;};'use strict';var multer=require(_0x0fba('0x0'));var util=require(_0x0fba('0x1'));var path=require(_0x0fba('0x2'));var timeout=require(_0x0fba('0x3'));var express=require(_0x0fba('0x4'));var router=express['Router']();var fs_extra=require(_0x0fba('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0fba('0x6'));var controller=require(_0x0fba('0x7'));router[_0x0fba('0x8')]('/',auth[_0x0fba('0x9')](),controller['index']);router[_0x0fba('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0fba('0xa')]);router[_0x0fba('0x8')](_0x0fba('0xb'),auth[_0x0fba('0x9')](),controller['getFields']);router[_0x0fba('0x8')](_0x0fba('0xc'),auth[_0x0fba('0x9')](),controller['getSubjects']);router[_0x0fba('0x8')](_0x0fba('0xd'),auth[_0x0fba('0x9')](),controller[_0x0fba('0xe')]);router['get'](_0x0fba('0xf'),auth[_0x0fba('0x9')](),controller[_0x0fba('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0fba('0x11')]);router[_0x0fba('0x12')](_0x0fba('0xf'),auth[_0x0fba('0x9')](),controller['setTags']);router[_0x0fba('0x13')](_0x0fba('0x14'),auth['isAuthenticated'](),controller[_0x0fba('0x15')]);router[_0x0fba('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x0fba('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 8d93e30..ce1a278 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 _0x1436=['exports','STRING'];(function(_0x257a28,_0x2cd00d){var _0x13bccc=function(_0x32c46f){while(--_0x32c46f){_0x257a28['push'](_0x257a28['shift']());}};_0x13bccc(++_0x2cd00d);}(_0x1436,0x1ba));var _0x6143=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1436[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module[_0x6143('0x0')]={'name':{'type':Sequelize[_0x6143('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb9e0=['exports','STRING','sequelize'];(function(_0x27b938,_0x4a7743){var _0x27788d=function(_0x353764){while(--_0x353764){_0x27b938['push'](_0x27b938['shift']());}};_0x27788d(++_0x4a7743);}(_0xb9e0,0x1b8));var _0x0b9e=function(_0x587125,_0x30ba05){_0x587125=_0x587125-0x0;var _0xb037dc=_0xb9e0[_0x587125];return _0xb037dc;};'use strict';var Sequelize=require(_0x0b9e('0x0'));module[_0x0b9e('0x1')]={'name':{'type':Sequelize[_0x0b9e('0x2')]},'description':{'type':Sequelize[_0x0b9e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 11594e1..7634bf9 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 _0xf331=['Content-Range','json','apply','reject','save','update','then','error','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','catch','show','params','includeAll','find','create','body','destroy','findOne','FreshdeskField','getFields','getSubjects','order','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','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','sendStatus','status','end','offset','limit','count'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0xf331,0x125));var _0x1f33=function(_0x1e84d8,_0x564e9b){_0x1e84d8=_0x1e84d8-0x0;var _0x1fed3f=_0xf331[_0x1e84d8];return _0x1fed3f;};'use strict';var emlformat=require(_0x1f33('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1f33('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f33('0x2'));var moment=require(_0x1f33('0x3'));var BPromise=require(_0x1f33('0x4'));var Mustache=require('mustache');var util=require(_0x1f33('0x5'));var path=require(_0x1f33('0x6'));var sox=require('sox');var csv=require(_0x1f33('0x7'));var ejs=require(_0x1f33('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f33('0x9'));var squel=require(_0x1f33('0xa'));var crypto=require(_0x1f33('0xb'));var jsforce=require(_0x1f33('0xc'));var deskjs=require(_0x1f33('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1f33('0xe'));var Papa=require(_0x1f33('0xf'));var Redis=require(_0x1f33('0x10'));var authService=require(_0x1f33('0x11'));var qs=require(_0x1f33('0x12'));var as=require(_0x1f33('0x13'));var hardwareService=require(_0x1f33('0x14'));var logger=require(_0x1f33('0x15'))(_0x1f33('0x16'));var utils=require(_0x1f33('0x17'));var config=require(_0x1f33('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a0d7d,_0x1dda78){_0x1dda78=_0x1dda78||0xcc;return function(_0x156f18){if(_0x156f18){return _0x4a0d7d[_0x1f33('0x19')](_0x1dda78);}return _0x4a0d7d[_0x1f33('0x1a')](_0x1dda78)[_0x1f33('0x1b')]();};}function respondWithResult(_0x498a56,_0xe127f2){_0xe127f2=_0xe127f2||0xc8;return function(_0x4183b4){if(_0x4183b4){return _0x498a56['status'](_0xe127f2)['json'](_0x4183b4);}};}function respondWithFilteredResult(_0x38c45f,_0x53bbab){return function(_0x5193e5){if(_0x5193e5){var _0x524147=typeof _0x53bbab[_0x1f33('0x1c')]==='undefined'&&typeof _0x53bbab[_0x1f33('0x1d')]==='undefined';var _0x4102be=_0x5193e5[_0x1f33('0x1e')];var _0x8a4087=_0x524147?0x0:_0x53bbab[_0x1f33('0x1c')];var _0x2dd3eb=_0x524147?_0x5193e5[_0x1f33('0x1e')]:_0x53bbab['offset']+_0x53bbab[_0x1f33('0x1d')];var _0x21d495;if(_0x2dd3eb>=_0x4102be){_0x2dd3eb=_0x4102be;_0x21d495=0xc8;}else{_0x21d495=0xce;}_0x38c45f['status'](_0x21d495);return _0x38c45f['set'](_0x1f33('0x1f'),_0x8a4087+'-'+_0x2dd3eb+'/'+_0x4102be)[_0x1f33('0x20')](_0x5193e5);}return null;};}function patchUpdates(_0x10bca9){return function(_0x422b1f){try{jsonpatch[_0x1f33('0x21')](_0x422b1f,_0x10bca9,!![]);}catch(_0x284056){return BPromise[_0x1f33('0x22')](_0x284056);}return _0x422b1f[_0x1f33('0x23')]();};}function saveUpdates(_0x1a6894,_0xe124f6){return function(_0xa5effe){if(_0xa5effe){return _0xa5effe[_0x1f33('0x24')](_0x1a6894)[_0x1f33('0x25')](function(_0x3a59a3){return _0x3a59a3;});}return null;};}function removeEntity(_0x1c8824,_0x306c9c){return function(_0x5b3cf0){if(_0x5b3cf0){return _0x5b3cf0['destroy']()[_0x1f33('0x25')](function(){_0x1c8824['status'](0xcc)[_0x1f33('0x1b')]();});}};}function handleEntityNotFound(_0x282f1d,_0x206fea){return function(_0x135a54){if(!_0x135a54){_0x282f1d[_0x1f33('0x19')](0x194);}return _0x135a54;};}function handleError(_0x5da6ce,_0x29967f){_0x29967f=_0x29967f||0x1f4;return function(_0xa1e634){logger[_0x1f33('0x26')](_0xa1e634['stack']);if(_0xa1e634[_0x1f33('0x27')]){delete _0xa1e634['name'];}_0x5da6ce[_0x1f33('0x1a')](_0x29967f)[_0x1f33('0x28')](_0xa1e634);};}exports[_0x1f33('0x29')]=function(_0x3cb973,_0x370a1c){var _0x138e61={},_0x22b1bc={},_0x1ff069={'count':0x0,'rows':[]};var _0x14f957=_[_0x1f33('0x2a')](db[_0x1f33('0x2b')][_0x1f33('0x2c')],function(_0x3f0c60){return{'name':_0x3f0c60['fieldName'],'type':_0x3f0c60[_0x1f33('0x2d')][_0x1f33('0x2e')]};});_0x22b1bc[_0x1f33('0x2f')]=_[_0x1f33('0x2a')](_0x14f957,_0x1f33('0x27'));_0x22b1bc[_0x1f33('0x30')]=_[_0x1f33('0x31')](_0x3cb973['query']);_0x22b1bc[_0x1f33('0x32')]=_[_0x1f33('0x33')](_0x22b1bc[_0x1f33('0x2f')],_0x22b1bc['query']);_0x138e61['attributes']=_[_0x1f33('0x33')](_0x22b1bc['model'],qs['fields'](_0x3cb973[_0x1f33('0x30')][_0x1f33('0x34')]));_0x138e61[_0x1f33('0x35')]=_0x138e61[_0x1f33('0x35')][_0x1f33('0x36')]?_0x138e61[_0x1f33('0x35')]:_0x22b1bc[_0x1f33('0x2f')];if(!_0x3cb973[_0x1f33('0x30')][_0x1f33('0x37')](_0x1f33('0x38'))){_0x138e61[_0x1f33('0x1d')]=qs[_0x1f33('0x1d')](_0x3cb973[_0x1f33('0x30')][_0x1f33('0x1d')]);_0x138e61['offset']=qs['offset'](_0x3cb973[_0x1f33('0x30')][_0x1f33('0x1c')]);}_0x138e61['order']=qs[_0x1f33('0x39')](_0x3cb973[_0x1f33('0x30')]['sort']);_0x138e61[_0x1f33('0x3a')]=qs[_0x1f33('0x32')](_[_0x1f33('0x3b')](_0x3cb973[_0x1f33('0x30')],_0x22b1bc[_0x1f33('0x32')]),_0x14f957);if(_0x3cb973['query'][_0x1f33('0x3c')]){_0x138e61[_0x1f33('0x3a')]=_[_0x1f33('0x3d')](_0x138e61['where'],{'$or':_[_0x1f33('0x2a')](_0x14f957,function(_0x438f36){if(_0x438f36['type']!==_0x1f33('0x3e')){var _0x100a44={};_0x100a44[_0x438f36[_0x1f33('0x27')]]={'$like':'%'+_0x3cb973['query'][_0x1f33('0x3c')]+'%'};return _0x100a44;}})});}_0x138e61=_['merge']({},_0x138e61,_0x3cb973[_0x1f33('0x3f')]);var _0x4ea119={'where':_0x138e61['where']};return db[_0x1f33('0x2b')][_0x1f33('0x1e')](_0x4ea119)['then'](function(_0x46e3e4){_0x1ff069[_0x1f33('0x1e')]=_0x46e3e4;if(_0x3cb973[_0x1f33('0x30')]['includeAll']){_0x138e61['include']=[{'all':!![]}];}return db[_0x1f33('0x2b')]['findAll'](_0x138e61);})[_0x1f33('0x25')](function(_0x114bed){_0x1ff069['rows']=_0x114bed;return _0x1ff069;})[_0x1f33('0x25')](respondWithFilteredResult(_0x370a1c,_0x138e61))[_0x1f33('0x40')](handleError(_0x370a1c,null));};exports[_0x1f33('0x41')]=function(_0x7fc138,_0x168581){var _0x1ec023={'raw':![],'where':{'id':_0x7fc138[_0x1f33('0x42')]['id']}},_0x5a6685={};_0x5a6685[_0x1f33('0x2f')]=_[_0x1f33('0x31')](db[_0x1f33('0x2b')][_0x1f33('0x2c')]);_0x5a6685['query']=_[_0x1f33('0x31')](_0x7fc138['query']);_0x5a6685[_0x1f33('0x32')]=_[_0x1f33('0x33')](_0x5a6685['model'],_0x5a6685[_0x1f33('0x30')]);_0x1ec023[_0x1f33('0x35')]=_[_0x1f33('0x33')](_0x5a6685['model'],qs[_0x1f33('0x34')](_0x7fc138[_0x1f33('0x30')][_0x1f33('0x34')]));_0x1ec023['attributes']=_0x1ec023['attributes'][_0x1f33('0x36')]?_0x1ec023[_0x1f33('0x35')]:_0x5a6685[_0x1f33('0x2f')];if(_0x7fc138['query'][_0x1f33('0x43')]){_0x1ec023['include']=[{'all':!![]}];}_0x1ec023=_[_0x1f33('0x3d')]({},_0x1ec023,_0x7fc138[_0x1f33('0x3f')]);return db[_0x1f33('0x2b')][_0x1f33('0x44')](_0x1ec023)[_0x1f33('0x25')](handleEntityNotFound(_0x168581,null))[_0x1f33('0x25')](respondWithResult(_0x168581,null))[_0x1f33('0x40')](handleError(_0x168581,null));};exports['create']=function(_0x36c1c6,_0x5e7d29){return db['FreshdeskConfiguration'][_0x1f33('0x45')](_0x36c1c6[_0x1f33('0x46')],{})[_0x1f33('0x25')](respondWithResult(_0x5e7d29,0xc9))[_0x1f33('0x40')](handleError(_0x5e7d29,null));};exports[_0x1f33('0x24')]=function(_0x2c094d,_0x15cb44){if(_0x2c094d['body']['id']){delete _0x2c094d[_0x1f33('0x46')]['id'];}return db[_0x1f33('0x2b')][_0x1f33('0x44')]({'where':{'id':_0x2c094d[_0x1f33('0x42')]['id']}})['then'](handleEntityNotFound(_0x15cb44,null))[_0x1f33('0x25')](saveUpdates(_0x2c094d[_0x1f33('0x46')],null))[_0x1f33('0x25')](respondWithResult(_0x15cb44,null))['catch'](handleError(_0x15cb44,null));};exports[_0x1f33('0x47')]=function(_0x23bcc4,_0x100476){return db['FreshdeskConfiguration'][_0x1f33('0x44')]({'where':{'id':_0x23bcc4[_0x1f33('0x42')]['id']}})['then'](handleEntityNotFound(_0x100476,null))['then'](removeEntity(_0x100476,null))['catch'](handleError(_0x100476,null));};exports['getFields']=function(_0x4b3adf,_0x50924c,_0xad1a48){var _0x3682ff={};var _0x5c3c53={};var _0x1c9970;var _0x588550;return db[_0x1f33('0x2b')][_0x1f33('0x48')]({'where':{'id':_0x4b3adf[_0x1f33('0x42')]['id']}})[_0x1f33('0x25')](handleEntityNotFound(_0x50924c,null))[_0x1f33('0x25')](function(_0x5051b9){if(_0x5051b9){_0x1c9970=_0x5051b9;_0x5c3c53['model']=_[_0x1f33('0x31')](db[_0x1f33('0x49')]['rawAttributes']);_0x5c3c53[_0x1f33('0x30')]=_[_0x1f33('0x31')](_0x4b3adf[_0x1f33('0x30')]);_0x5c3c53['filters']=_[_0x1f33('0x33')](_0x5c3c53[_0x1f33('0x2f')],_0x5c3c53['query']);_0x3682ff['attributes']=_[_0x1f33('0x33')](_0x5c3c53[_0x1f33('0x2f')],qs[_0x1f33('0x34')](_0x4b3adf[_0x1f33('0x30')]['fields']));_0x3682ff[_0x1f33('0x35')]=_0x3682ff[_0x1f33('0x35')][_0x1f33('0x36')]?_0x3682ff[_0x1f33('0x35')]:_0x5c3c53['model'];_0x3682ff['order']=qs[_0x1f33('0x39')](_0x4b3adf[_0x1f33('0x30')][_0x1f33('0x39')]);_0x3682ff[_0x1f33('0x3a')]=qs[_0x1f33('0x32')](_[_0x1f33('0x3b')](_0x4b3adf[_0x1f33('0x30')],_0x5c3c53[_0x1f33('0x32')]));if(_0x4b3adf[_0x1f33('0x30')]['filter']){_0x3682ff['where']=_[_0x1f33('0x3d')](_0x3682ff[_0x1f33('0x3a')],{'$or':_['map'](_0x3682ff['attributes'],function(_0x491edf){var _0xa98d2b={};_0xa98d2b[_0x491edf]={'$like':'%'+_0x4b3adf[_0x1f33('0x30')][_0x1f33('0x3c')]+'%'};return _0xa98d2b;})});}_0x3682ff=_['merge']({},_0x3682ff,_0x4b3adf[_0x1f33('0x3f')]);return _0x1c9970[_0x1f33('0x4a')](_0x3682ff);}})['then'](function(_0x3f730b){if(_0x3f730b){_0x588550=_0x3f730b[_0x1f33('0x36')];if(!_0x4b3adf[_0x1f33('0x30')][_0x1f33('0x37')](_0x1f33('0x38'))){_0x3682ff[_0x1f33('0x1d')]=qs[_0x1f33('0x1d')](_0x4b3adf[_0x1f33('0x30')][_0x1f33('0x1d')]);_0x3682ff['offset']=qs[_0x1f33('0x1c')](_0x4b3adf[_0x1f33('0x30')][_0x1f33('0x1c')]);}return _0x1c9970[_0x1f33('0x4a')](_0x3682ff);}})[_0x1f33('0x25')](function(_0x3ce7ff){if(_0x3ce7ff){return _0x3ce7ff?{'count':_0x588550,'rows':_0x3ce7ff}:null;}})['then'](respondWithResult(_0x50924c,null))[_0x1f33('0x40')](handleError(_0x50924c,null));};exports[_0x1f33('0x4b')]=function(_0x4a2172,_0x180a0d,_0x1f4609){var _0x499c85={};var _0x3733c0={};var _0x1d5068;var _0x75f528;return db['FreshdeskConfiguration'][_0x1f33('0x48')]({'where':{'id':_0x4a2172[_0x1f33('0x42')]['id']}})[_0x1f33('0x25')](handleEntityNotFound(_0x180a0d,null))[_0x1f33('0x25')](function(_0x369b0c){if(_0x369b0c){_0x1d5068=_0x369b0c;_0x3733c0[_0x1f33('0x2f')]=_[_0x1f33('0x31')](db[_0x1f33('0x49')][_0x1f33('0x2c')]);_0x3733c0['query']=_[_0x1f33('0x31')](_0x4a2172[_0x1f33('0x30')]);_0x3733c0[_0x1f33('0x32')]=_[_0x1f33('0x33')](_0x3733c0[_0x1f33('0x2f')],_0x3733c0[_0x1f33('0x30')]);_0x499c85[_0x1f33('0x35')]=_[_0x1f33('0x33')](_0x3733c0[_0x1f33('0x2f')],qs[_0x1f33('0x34')](_0x4a2172[_0x1f33('0x30')][_0x1f33('0x34')]));_0x499c85[_0x1f33('0x35')]=_0x499c85[_0x1f33('0x35')]['length']?_0x499c85[_0x1f33('0x35')]:_0x3733c0[_0x1f33('0x2f')];_0x499c85[_0x1f33('0x4c')]=qs[_0x1f33('0x39')](_0x4a2172[_0x1f33('0x30')][_0x1f33('0x39')]);_0x499c85[_0x1f33('0x3a')]=qs[_0x1f33('0x32')](_[_0x1f33('0x3b')](_0x4a2172[_0x1f33('0x30')],_0x3733c0[_0x1f33('0x32')]));if(_0x4a2172[_0x1f33('0x30')][_0x1f33('0x3c')]){_0x499c85['where']=_[_0x1f33('0x3d')](_0x499c85[_0x1f33('0x3a')],{'$or':_[_0x1f33('0x2a')](_0x499c85['attributes'],function(_0x2028d1){var _0x2b2719={};_0x2b2719[_0x2028d1]={'$like':'%'+_0x4a2172[_0x1f33('0x30')][_0x1f33('0x3c')]+'%'};return _0x2b2719;})});}_0x499c85=_[_0x1f33('0x3d')]({},_0x499c85,_0x4a2172[_0x1f33('0x3f')]);return _0x1d5068['getSubjects'](_0x499c85);}})[_0x1f33('0x25')](function(_0x9eb72f){if(_0x9eb72f){_0x75f528=_0x9eb72f['length'];if(!_0x4a2172['query']['hasOwnProperty'](_0x1f33('0x38'))){_0x499c85[_0x1f33('0x1d')]=qs[_0x1f33('0x1d')](_0x4a2172['query'][_0x1f33('0x1d')]);_0x499c85[_0x1f33('0x1c')]=qs[_0x1f33('0x1c')](_0x4a2172['query']['offset']);}return _0x1d5068['getSubjects'](_0x499c85);}})[_0x1f33('0x25')](function(_0x340b2a){if(_0x340b2a){return _0x340b2a?{'count':_0x75f528,'rows':_0x340b2a}:null;}})[_0x1f33('0x25')](respondWithResult(_0x180a0d,null))[_0x1f33('0x40')](handleError(_0x180a0d,null));};exports[_0x1f33('0x4d')]=function(_0x317fab,_0x100cb7,_0x38b7b9){var _0x4b35d5={};var _0x41bee8={};var _0x392d3c;var _0x366873;return db[_0x1f33('0x2b')][_0x1f33('0x48')]({'where':{'id':_0x317fab[_0x1f33('0x42')]['id']}})[_0x1f33('0x25')](handleEntityNotFound(_0x100cb7,null))[_0x1f33('0x25')](function(_0x2fd9ad){if(_0x2fd9ad){_0x392d3c=_0x2fd9ad;_0x41bee8[_0x1f33('0x2f')]=_['keys'](db['FreshdeskField'][_0x1f33('0x2c')]);_0x41bee8['query']=_[_0x1f33('0x31')](_0x317fab[_0x1f33('0x30')]);_0x41bee8[_0x1f33('0x32')]=_[_0x1f33('0x33')](_0x41bee8['model'],_0x41bee8[_0x1f33('0x30')]);_0x4b35d5[_0x1f33('0x35')]=_[_0x1f33('0x33')](_0x41bee8[_0x1f33('0x2f')],qs['fields'](_0x317fab[_0x1f33('0x30')][_0x1f33('0x34')]));_0x4b35d5[_0x1f33('0x35')]=_0x4b35d5['attributes'][_0x1f33('0x36')]?_0x4b35d5[_0x1f33('0x35')]:_0x41bee8['model'];_0x4b35d5[_0x1f33('0x4c')]=qs[_0x1f33('0x39')](_0x317fab['query'][_0x1f33('0x39')]);_0x4b35d5[_0x1f33('0x3a')]=qs['filters'](_[_0x1f33('0x3b')](_0x317fab[_0x1f33('0x30')],_0x41bee8[_0x1f33('0x32')]));if(_0x317fab['query'][_0x1f33('0x3c')]){_0x4b35d5[_0x1f33('0x3a')]=_[_0x1f33('0x3d')](_0x4b35d5[_0x1f33('0x3a')],{'$or':_['map'](_0x4b35d5[_0x1f33('0x35')],function(_0x2ec3d5){var _0x28aff8={};_0x28aff8[_0x2ec3d5]={'$like':'%'+_0x317fab['query'][_0x1f33('0x3c')]+'%'};return _0x28aff8;})});}_0x4b35d5=_[_0x1f33('0x3d')]({},_0x4b35d5,_0x317fab[_0x1f33('0x3f')]);return _0x392d3c['getDescriptions'](_0x4b35d5);}})['then'](function(_0x448a83){if(_0x448a83){_0x366873=_0x448a83[_0x1f33('0x36')];if(!_0x317fab[_0x1f33('0x30')][_0x1f33('0x37')](_0x1f33('0x38'))){_0x4b35d5[_0x1f33('0x1d')]=qs['limit'](_0x317fab[_0x1f33('0x30')]['limit']);_0x4b35d5['offset']=qs['offset'](_0x317fab[_0x1f33('0x30')][_0x1f33('0x1c')]);}return _0x392d3c['getDescriptions'](_0x4b35d5);}})[_0x1f33('0x25')](function(_0x537ebe){if(_0x537ebe){return _0x537ebe?{'count':_0x366873,'rows':_0x537ebe}:null;}})[_0x1f33('0x25')](respondWithResult(_0x100cb7,null))['catch'](handleError(_0x100cb7,null));};exports[_0x1f33('0x4e')]=function(_0x3c50c7,_0x4f439e,_0x1519c7){var _0xc2f4c0={};var _0x83fa10={};var _0x346859;var _0x1ce1d0;return db[_0x1f33('0x2b')][_0x1f33('0x48')]({'where':{'id':_0x3c50c7[_0x1f33('0x42')]['id']}})[_0x1f33('0x25')](handleEntityNotFound(_0x4f439e,null))[_0x1f33('0x25')](function(_0x264ab3){if(_0x264ab3){_0x346859=_0x264ab3;_0x83fa10[_0x1f33('0x2f')]=_[_0x1f33('0x31')](db['Tag']['rawAttributes']);_0x83fa10[_0x1f33('0x30')]=_['keys'](_0x3c50c7[_0x1f33('0x30')]);_0x83fa10[_0x1f33('0x32')]=_[_0x1f33('0x33')](_0x83fa10[_0x1f33('0x2f')],_0x83fa10['query']);_0xc2f4c0['attributes']=_[_0x1f33('0x33')](_0x83fa10['model'],qs[_0x1f33('0x34')](_0x3c50c7['query'][_0x1f33('0x34')]));_0xc2f4c0[_0x1f33('0x35')]=_0xc2f4c0[_0x1f33('0x35')]['length']?_0xc2f4c0[_0x1f33('0x35')]:_0x83fa10[_0x1f33('0x2f')];_0xc2f4c0[_0x1f33('0x4c')]=qs[_0x1f33('0x39')](_0x3c50c7['query'][_0x1f33('0x39')]);_0xc2f4c0[_0x1f33('0x3a')]=qs[_0x1f33('0x32')](_['pick'](_0x3c50c7[_0x1f33('0x30')],_0x83fa10['filters']));if(_0x3c50c7[_0x1f33('0x30')][_0x1f33('0x3c')]){_0xc2f4c0[_0x1f33('0x3a')]=_['merge'](_0xc2f4c0['where'],{'$or':_['map'](_0xc2f4c0['attributes'],function(_0x3861b8){var _0x3d1602={};_0x3d1602[_0x3861b8]={'$like':'%'+_0x3c50c7[_0x1f33('0x30')][_0x1f33('0x3c')]+'%'};return _0x3d1602;})});}_0xc2f4c0=_[_0x1f33('0x3d')]({},_0xc2f4c0,_0x3c50c7['options']);return _0x346859['getTags'](_0xc2f4c0);}})[_0x1f33('0x25')](function(_0x41aefa){if(_0x41aefa){_0x1ce1d0=_0x41aefa['length'];if(!_0x3c50c7[_0x1f33('0x30')][_0x1f33('0x37')](_0x1f33('0x38'))){_0xc2f4c0[_0x1f33('0x1d')]=qs[_0x1f33('0x1d')](_0x3c50c7[_0x1f33('0x30')][_0x1f33('0x1d')]);_0xc2f4c0[_0x1f33('0x1c')]=qs[_0x1f33('0x1c')](_0x3c50c7[_0x1f33('0x30')][_0x1f33('0x1c')]);}return _0x346859[_0x1f33('0x4e')](_0xc2f4c0);}})[_0x1f33('0x25')](function(_0xcadc83){if(_0xcadc83){return _0xcadc83?{'count':_0x1ce1d0,'rows':_0xcadc83}:null;}})[_0x1f33('0x25')](respondWithResult(_0x4f439e,null))[_0x1f33('0x40')](handleError(_0x4f439e,null));};exports[_0x1f33('0x4f')]=function(_0xbbec1c,_0x4907e5,_0xa6a03d){if(_0xbbec1c[_0x1f33('0x46')]['id']){delete _0xbbec1c[_0x1f33('0x46')]['id'];}return db[_0x1f33('0x2b')][_0x1f33('0x48')]({'where':{'id':_0xbbec1c[_0x1f33('0x42')]['id']}})[_0x1f33('0x25')](handleEntityNotFound(_0x4907e5,null))['then'](function(_0x40e008){if(_0x40e008){return _0x40e008[_0x1f33('0x4f')](_0xbbec1c[_0x1f33('0x46')][_0x1f33('0x50')]||[]);}return null;})[_0x1f33('0x25')](respondWithResult(_0x4907e5,null))['catch'](handleError(_0x4907e5,null));}; \ No newline at end of file +var _0xd12a=['to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','destroy','sendStatus','error','stack','name','map','FreshdeskConfiguration','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','rows','catch','show','params','keys','include','find','create','body','getFields','findOne','pick','getSubjects','FreshdeskField','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x106d12,_0x3ae8c5){var _0x7912da=function(_0x6c0c9c){while(--_0x6c0c9c){_0x106d12['push'](_0x106d12['shift']());}};_0x7912da(++_0x3ae8c5);}(_0xd12a,0x180));var _0xad12=function(_0x4ab42f,_0x437617){_0x4ab42f=_0x4ab42f-0x0;var _0xbdf43=_0xd12a[_0x4ab42f];return _0xbdf43;};'use strict';var emlformat=require(_0xad12('0x0'));var rimraf=require(_0xad12('0x1'));var zipdir=require(_0xad12('0x2'));var jsonpatch=require(_0xad12('0x3'));var rp=require(_0xad12('0x4'));var moment=require(_0xad12('0x5'));var BPromise=require(_0xad12('0x6'));var Mustache=require(_0xad12('0x7'));var util=require(_0xad12('0x8'));var path=require('path');var sox=require(_0xad12('0x9'));var csv=require('to-csv');var ejs=require(_0xad12('0xa'));var fs=require('fs');var fs_extra=require(_0xad12('0xb'));var _=require(_0xad12('0xc'));var squel=require(_0xad12('0xd'));var crypto=require('crypto');var jsforce=require(_0xad12('0xe'));var deskjs=require(_0xad12('0xf'));var toCsv=require(_0xad12('0x10'));var querystring=require(_0xad12('0x11'));var Papa=require(_0xad12('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xad12('0x13'));var as=require(_0xad12('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad12('0x15'))(_0xad12('0x16'));var utils=require('../../config/utils');var config=require(_0xad12('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8ce070,_0x288a1d){_0x288a1d=_0x288a1d||0xcc;return function(_0x5afbe7){if(_0x5afbe7){return _0x8ce070['sendStatus'](_0x288a1d);}return _0x8ce070[_0xad12('0x18')](_0x288a1d)[_0xad12('0x19')]();};}function respondWithResult(_0x511075,_0x5da78b){_0x5da78b=_0x5da78b||0xc8;return function(_0x32e24f){if(_0x32e24f){return _0x511075[_0xad12('0x18')](_0x5da78b)['json'](_0x32e24f);}};}function respondWithFilteredResult(_0x561afc,_0x48f383){return function(_0x19bd15){if(_0x19bd15){var _0x4d199f=typeof _0x48f383['offset']===_0xad12('0x1a')&&typeof _0x48f383[_0xad12('0x1b')]===_0xad12('0x1a');var _0x1dc31c=_0x19bd15[_0xad12('0x1c')];var _0x494e8b=_0x4d199f?0x0:_0x48f383[_0xad12('0x1d')];var _0x4587db=_0x4d199f?_0x19bd15[_0xad12('0x1c')]:_0x48f383['offset']+_0x48f383[_0xad12('0x1b')];var _0x3bedf8;if(_0x4587db>=_0x1dc31c){_0x4587db=_0x1dc31c;_0x3bedf8=0xc8;}else{_0x3bedf8=0xce;}_0x561afc['status'](_0x3bedf8);return _0x561afc[_0xad12('0x1e')]('Content-Range',_0x494e8b+'-'+_0x4587db+'/'+_0x1dc31c)[_0xad12('0x1f')](_0x19bd15);}return null;};}function patchUpdates(_0x13180a){return function(_0x2dfd05){try{jsonpatch[_0xad12('0x20')](_0x2dfd05,_0x13180a,!![]);}catch(_0x2d69fa){return BPromise['reject'](_0x2d69fa);}return _0x2dfd05[_0xad12('0x21')]();};}function saveUpdates(_0x18ad76,_0x31d5ad){return function(_0xbe07d3){if(_0xbe07d3){return _0xbe07d3[_0xad12('0x22')](_0x18ad76)[_0xad12('0x23')](function(_0x331a46){return _0x331a46;});}return null;};}function removeEntity(_0x1318e1,_0x594458){return function(_0x1f0eb2){if(_0x1f0eb2){return _0x1f0eb2[_0xad12('0x24')]()[_0xad12('0x23')](function(){_0x1318e1['status'](0xcc)[_0xad12('0x19')]();});}};}function handleEntityNotFound(_0x590d77,_0x58ea48){return function(_0xd595a){if(!_0xd595a){_0x590d77[_0xad12('0x25')](0x194);}return _0xd595a;};}function handleError(_0x477fdb,_0x436c8a){_0x436c8a=_0x436c8a||0x1f4;return function(_0x4238a4){logger[_0xad12('0x26')](_0x4238a4[_0xad12('0x27')]);if(_0x4238a4[_0xad12('0x28')]){delete _0x4238a4[_0xad12('0x28')];}_0x477fdb[_0xad12('0x18')](_0x436c8a)['send'](_0x4238a4);};}exports['index']=function(_0x2623ce,_0x1c9b78){var _0x250fd9={},_0x1fcc78={},_0x18e43f={'count':0x0,'rows':[]};var _0x42f4e8=_[_0xad12('0x29')](db[_0xad12('0x2a')][_0xad12('0x2b')],function(_0x55ebd9){return{'name':_0x55ebd9[_0xad12('0x2c')],'type':_0x55ebd9[_0xad12('0x2d')]['key']};});_0x1fcc78[_0xad12('0x2e')]=_[_0xad12('0x29')](_0x42f4e8,_0xad12('0x28'));_0x1fcc78[_0xad12('0x2f')]=_['keys'](_0x2623ce[_0xad12('0x2f')]);_0x1fcc78['filters']=_[_0xad12('0x30')](_0x1fcc78[_0xad12('0x2e')],_0x1fcc78[_0xad12('0x2f')]);_0x250fd9['attributes']=_[_0xad12('0x30')](_0x1fcc78[_0xad12('0x2e')],qs[_0xad12('0x31')](_0x2623ce[_0xad12('0x2f')][_0xad12('0x31')]));_0x250fd9['attributes']=_0x250fd9[_0xad12('0x32')][_0xad12('0x33')]?_0x250fd9[_0xad12('0x32')]:_0x1fcc78[_0xad12('0x2e')];if(!_0x2623ce[_0xad12('0x2f')][_0xad12('0x34')](_0xad12('0x35'))){_0x250fd9[_0xad12('0x1b')]=qs['limit'](_0x2623ce['query'][_0xad12('0x1b')]);_0x250fd9[_0xad12('0x1d')]=qs[_0xad12('0x1d')](_0x2623ce[_0xad12('0x2f')][_0xad12('0x1d')]);}_0x250fd9[_0xad12('0x36')]=qs[_0xad12('0x37')](_0x2623ce[_0xad12('0x2f')][_0xad12('0x37')]);_0x250fd9[_0xad12('0x38')]=qs[_0xad12('0x39')](_['pick'](_0x2623ce['query'],_0x1fcc78[_0xad12('0x39')]),_0x42f4e8);if(_0x2623ce[_0xad12('0x2f')]['filter']){_0x250fd9[_0xad12('0x38')]=_[_0xad12('0x3a')](_0x250fd9[_0xad12('0x38')],{'$or':_[_0xad12('0x29')](_0x42f4e8,function(_0x2d40a5){if(_0x2d40a5[_0xad12('0x2d')]!==_0xad12('0x3b')){var _0x415aae={};_0x415aae[_0x2d40a5[_0xad12('0x28')]]={'$like':'%'+_0x2623ce[_0xad12('0x2f')][_0xad12('0x3c')]+'%'};return _0x415aae;}})});}_0x250fd9=_['merge']({},_0x250fd9,_0x2623ce[_0xad12('0x3d')]);var _0x129709={'where':_0x250fd9['where']};return db[_0xad12('0x2a')][_0xad12('0x1c')](_0x129709)['then'](function(_0x55a8ad){_0x18e43f[_0xad12('0x1c')]=_0x55a8ad;if(_0x2623ce[_0xad12('0x2f')]['includeAll']){_0x250fd9['include']=[{'all':!![]}];}return db[_0xad12('0x2a')]['findAll'](_0x250fd9);})[_0xad12('0x23')](function(_0x4fc098){_0x18e43f[_0xad12('0x3e')]=_0x4fc098;return _0x18e43f;})[_0xad12('0x23')](respondWithFilteredResult(_0x1c9b78,_0x250fd9))[_0xad12('0x3f')](handleError(_0x1c9b78,null));};exports[_0xad12('0x40')]=function(_0x3a0b1e,_0x262cba){var _0x14c0fb={'raw':![],'where':{'id':_0x3a0b1e[_0xad12('0x41')]['id']}},_0x590ad2={};_0x590ad2[_0xad12('0x2e')]=_[_0xad12('0x42')](db[_0xad12('0x2a')][_0xad12('0x2b')]);_0x590ad2['query']=_[_0xad12('0x42')](_0x3a0b1e[_0xad12('0x2f')]);_0x590ad2['filters']=_[_0xad12('0x30')](_0x590ad2['model'],_0x590ad2['query']);_0x14c0fb[_0xad12('0x32')]=_[_0xad12('0x30')](_0x590ad2[_0xad12('0x2e')],qs['fields'](_0x3a0b1e[_0xad12('0x2f')][_0xad12('0x31')]));_0x14c0fb[_0xad12('0x32')]=_0x14c0fb[_0xad12('0x32')][_0xad12('0x33')]?_0x14c0fb[_0xad12('0x32')]:_0x590ad2[_0xad12('0x2e')];if(_0x3a0b1e['query']['includeAll']){_0x14c0fb[_0xad12('0x43')]=[{'all':!![]}];}_0x14c0fb=_[_0xad12('0x3a')]({},_0x14c0fb,_0x3a0b1e[_0xad12('0x3d')]);return db[_0xad12('0x2a')][_0xad12('0x44')](_0x14c0fb)['then'](handleEntityNotFound(_0x262cba,null))[_0xad12('0x23')](respondWithResult(_0x262cba,null))[_0xad12('0x3f')](handleError(_0x262cba,null));};exports[_0xad12('0x45')]=function(_0x195ae8,_0x2f39c4){return db[_0xad12('0x2a')][_0xad12('0x45')](_0x195ae8['body'],{})[_0xad12('0x23')](respondWithResult(_0x2f39c4,0xc9))[_0xad12('0x3f')](handleError(_0x2f39c4,null));};exports['update']=function(_0x4e6e60,_0x257729){if(_0x4e6e60[_0xad12('0x46')]['id']){delete _0x4e6e60[_0xad12('0x46')]['id'];}return db[_0xad12('0x2a')][_0xad12('0x44')]({'where':{'id':_0x4e6e60[_0xad12('0x41')]['id']}})[_0xad12('0x23')](handleEntityNotFound(_0x257729,null))[_0xad12('0x23')](saveUpdates(_0x4e6e60[_0xad12('0x46')],null))[_0xad12('0x23')](respondWithResult(_0x257729,null))[_0xad12('0x3f')](handleError(_0x257729,null));};exports['destroy']=function(_0x2f90b3,_0x303254){return db[_0xad12('0x2a')][_0xad12('0x44')]({'where':{'id':_0x2f90b3['params']['id']}})[_0xad12('0x23')](handleEntityNotFound(_0x303254,null))[_0xad12('0x23')](removeEntity(_0x303254,null))[_0xad12('0x3f')](handleError(_0x303254,null));};exports[_0xad12('0x47')]=function(_0x3d185a,_0x15ce78,_0x24bffd){var _0x55a414={};var _0x1bf39b={};var _0x324e40;var _0x15c393;return db[_0xad12('0x2a')][_0xad12('0x48')]({'where':{'id':_0x3d185a[_0xad12('0x41')]['id']}})[_0xad12('0x23')](handleEntityNotFound(_0x15ce78,null))[_0xad12('0x23')](function(_0x5e3f89){if(_0x5e3f89){_0x324e40=_0x5e3f89;_0x1bf39b['model']=_[_0xad12('0x42')](db['FreshdeskField']['rawAttributes']);_0x1bf39b[_0xad12('0x2f')]=_[_0xad12('0x42')](_0x3d185a[_0xad12('0x2f')]);_0x1bf39b[_0xad12('0x39')]=_[_0xad12('0x30')](_0x1bf39b[_0xad12('0x2e')],_0x1bf39b[_0xad12('0x2f')]);_0x55a414[_0xad12('0x32')]=_['intersection'](_0x1bf39b[_0xad12('0x2e')],qs['fields'](_0x3d185a[_0xad12('0x2f')][_0xad12('0x31')]));_0x55a414['attributes']=_0x55a414[_0xad12('0x32')][_0xad12('0x33')]?_0x55a414[_0xad12('0x32')]:_0x1bf39b[_0xad12('0x2e')];_0x55a414[_0xad12('0x36')]=qs[_0xad12('0x37')](_0x3d185a['query']['sort']);_0x55a414[_0xad12('0x38')]=qs['filters'](_[_0xad12('0x49')](_0x3d185a[_0xad12('0x2f')],_0x1bf39b[_0xad12('0x39')]));if(_0x3d185a[_0xad12('0x2f')][_0xad12('0x3c')]){_0x55a414[_0xad12('0x38')]=_[_0xad12('0x3a')](_0x55a414[_0xad12('0x38')],{'$or':_[_0xad12('0x29')](_0x55a414[_0xad12('0x32')],function(_0x92aa93){var _0x4e5126={};_0x4e5126[_0x92aa93]={'$like':'%'+_0x3d185a[_0xad12('0x2f')][_0xad12('0x3c')]+'%'};return _0x4e5126;})});}_0x55a414=_[_0xad12('0x3a')]({},_0x55a414,_0x3d185a[_0xad12('0x3d')]);return _0x324e40[_0xad12('0x47')](_0x55a414);}})[_0xad12('0x23')](function(_0x2268cb){if(_0x2268cb){_0x15c393=_0x2268cb[_0xad12('0x33')];if(!_0x3d185a[_0xad12('0x2f')][_0xad12('0x34')](_0xad12('0x35'))){_0x55a414[_0xad12('0x1b')]=qs[_0xad12('0x1b')](_0x3d185a[_0xad12('0x2f')][_0xad12('0x1b')]);_0x55a414[_0xad12('0x1d')]=qs[_0xad12('0x1d')](_0x3d185a['query'][_0xad12('0x1d')]);}return _0x324e40[_0xad12('0x47')](_0x55a414);}})[_0xad12('0x23')](function(_0x221086){if(_0x221086){return _0x221086?{'count':_0x15c393,'rows':_0x221086}:null;}})[_0xad12('0x23')](respondWithResult(_0x15ce78,null))['catch'](handleError(_0x15ce78,null));};exports['getSubjects']=function(_0x494438,_0x3b24d5,_0x3010f7){var _0x3c1da9={};var _0x37fe3d={};var _0x4f1ad1;var _0x2e5429;return db[_0xad12('0x2a')]['findOne']({'where':{'id':_0x494438[_0xad12('0x41')]['id']}})[_0xad12('0x23')](handleEntityNotFound(_0x3b24d5,null))[_0xad12('0x23')](function(_0x512ea3){if(_0x512ea3){_0x4f1ad1=_0x512ea3;_0x37fe3d[_0xad12('0x2e')]=_[_0xad12('0x42')](db['FreshdeskField']['rawAttributes']);_0x37fe3d[_0xad12('0x2f')]=_[_0xad12('0x42')](_0x494438[_0xad12('0x2f')]);_0x37fe3d[_0xad12('0x39')]=_[_0xad12('0x30')](_0x37fe3d[_0xad12('0x2e')],_0x37fe3d[_0xad12('0x2f')]);_0x3c1da9[_0xad12('0x32')]=_[_0xad12('0x30')](_0x37fe3d[_0xad12('0x2e')],qs['fields'](_0x494438[_0xad12('0x2f')]['fields']));_0x3c1da9['attributes']=_0x3c1da9[_0xad12('0x32')][_0xad12('0x33')]?_0x3c1da9[_0xad12('0x32')]:_0x37fe3d[_0xad12('0x2e')];_0x3c1da9['order']=qs[_0xad12('0x37')](_0x494438[_0xad12('0x2f')]['sort']);_0x3c1da9[_0xad12('0x38')]=qs[_0xad12('0x39')](_['pick'](_0x494438[_0xad12('0x2f')],_0x37fe3d['filters']));if(_0x494438['query'][_0xad12('0x3c')]){_0x3c1da9['where']=_['merge'](_0x3c1da9[_0xad12('0x38')],{'$or':_[_0xad12('0x29')](_0x3c1da9[_0xad12('0x32')],function(_0x56e43b){var _0x55b3be={};_0x55b3be[_0x56e43b]={'$like':'%'+_0x494438[_0xad12('0x2f')][_0xad12('0x3c')]+'%'};return _0x55b3be;})});}_0x3c1da9=_[_0xad12('0x3a')]({},_0x3c1da9,_0x494438['options']);return _0x4f1ad1[_0xad12('0x4a')](_0x3c1da9);}})[_0xad12('0x23')](function(_0x1d7ef6){if(_0x1d7ef6){_0x2e5429=_0x1d7ef6[_0xad12('0x33')];if(!_0x494438[_0xad12('0x2f')][_0xad12('0x34')]('nolimit')){_0x3c1da9[_0xad12('0x1b')]=qs[_0xad12('0x1b')](_0x494438[_0xad12('0x2f')]['limit']);_0x3c1da9[_0xad12('0x1d')]=qs[_0xad12('0x1d')](_0x494438[_0xad12('0x2f')][_0xad12('0x1d')]);}return _0x4f1ad1['getSubjects'](_0x3c1da9);}})[_0xad12('0x23')](function(_0x1a49f9){if(_0x1a49f9){return _0x1a49f9?{'count':_0x2e5429,'rows':_0x1a49f9}:null;}})['then'](respondWithResult(_0x3b24d5,null))[_0xad12('0x3f')](handleError(_0x3b24d5,null));};exports['getDescriptions']=function(_0x3bd8e6,_0x4a0201,_0x3acba5){var _0x64cbb9={};var _0x544b17={};var _0x16c3f2;var _0x6ffb95;return db[_0xad12('0x2a')][_0xad12('0x48')]({'where':{'id':_0x3bd8e6[_0xad12('0x41')]['id']}})[_0xad12('0x23')](handleEntityNotFound(_0x4a0201,null))[_0xad12('0x23')](function(_0x14699b){if(_0x14699b){_0x16c3f2=_0x14699b;_0x544b17[_0xad12('0x2e')]=_[_0xad12('0x42')](db[_0xad12('0x4b')][_0xad12('0x2b')]);_0x544b17[_0xad12('0x2f')]=_['keys'](_0x3bd8e6['query']);_0x544b17['filters']=_[_0xad12('0x30')](_0x544b17['model'],_0x544b17['query']);_0x64cbb9[_0xad12('0x32')]=_[_0xad12('0x30')](_0x544b17[_0xad12('0x2e')],qs[_0xad12('0x31')](_0x3bd8e6[_0xad12('0x2f')][_0xad12('0x31')]));_0x64cbb9[_0xad12('0x32')]=_0x64cbb9[_0xad12('0x32')][_0xad12('0x33')]?_0x64cbb9[_0xad12('0x32')]:_0x544b17[_0xad12('0x2e')];_0x64cbb9[_0xad12('0x36')]=qs[_0xad12('0x37')](_0x3bd8e6[_0xad12('0x2f')][_0xad12('0x37')]);_0x64cbb9[_0xad12('0x38')]=qs[_0xad12('0x39')](_[_0xad12('0x49')](_0x3bd8e6[_0xad12('0x2f')],_0x544b17[_0xad12('0x39')]));if(_0x3bd8e6[_0xad12('0x2f')][_0xad12('0x3c')]){_0x64cbb9[_0xad12('0x38')]=_[_0xad12('0x3a')](_0x64cbb9[_0xad12('0x38')],{'$or':_[_0xad12('0x29')](_0x64cbb9[_0xad12('0x32')],function(_0x3d3372){var _0x454432={};_0x454432[_0x3d3372]={'$like':'%'+_0x3bd8e6[_0xad12('0x2f')]['filter']+'%'};return _0x454432;})});}_0x64cbb9=_[_0xad12('0x3a')]({},_0x64cbb9,_0x3bd8e6[_0xad12('0x3d')]);return _0x16c3f2[_0xad12('0x4c')](_0x64cbb9);}})['then'](function(_0x1b0e08){if(_0x1b0e08){_0x6ffb95=_0x1b0e08[_0xad12('0x33')];if(!_0x3bd8e6[_0xad12('0x2f')]['hasOwnProperty'](_0xad12('0x35'))){_0x64cbb9[_0xad12('0x1b')]=qs[_0xad12('0x1b')](_0x3bd8e6[_0xad12('0x2f')][_0xad12('0x1b')]);_0x64cbb9[_0xad12('0x1d')]=qs['offset'](_0x3bd8e6[_0xad12('0x2f')]['offset']);}return _0x16c3f2[_0xad12('0x4c')](_0x64cbb9);}})[_0xad12('0x23')](function(_0x4820cc){if(_0x4820cc){return _0x4820cc?{'count':_0x6ffb95,'rows':_0x4820cc}:null;}})[_0xad12('0x23')](respondWithResult(_0x4a0201,null))[_0xad12('0x3f')](handleError(_0x4a0201,null));};exports[_0xad12('0x4d')]=function(_0x4d0404,_0x5da5a8,_0x448a72){var _0x3a8e81={};var _0x44bfed={};var _0x35ca79;var _0x23144b;return db['FreshdeskConfiguration'][_0xad12('0x48')]({'where':{'id':_0x4d0404[_0xad12('0x41')]['id']}})[_0xad12('0x23')](handleEntityNotFound(_0x5da5a8,null))['then'](function(_0x275aaa){if(_0x275aaa){_0x35ca79=_0x275aaa;_0x44bfed['model']=_[_0xad12('0x42')](db['Tag'][_0xad12('0x2b')]);_0x44bfed[_0xad12('0x2f')]=_['keys'](_0x4d0404[_0xad12('0x2f')]);_0x44bfed[_0xad12('0x39')]=_[_0xad12('0x30')](_0x44bfed['model'],_0x44bfed[_0xad12('0x2f')]);_0x3a8e81[_0xad12('0x32')]=_['intersection'](_0x44bfed[_0xad12('0x2e')],qs[_0xad12('0x31')](_0x4d0404[_0xad12('0x2f')][_0xad12('0x31')]));_0x3a8e81[_0xad12('0x32')]=_0x3a8e81['attributes'][_0xad12('0x33')]?_0x3a8e81[_0xad12('0x32')]:_0x44bfed[_0xad12('0x2e')];_0x3a8e81[_0xad12('0x36')]=qs[_0xad12('0x37')](_0x4d0404['query'][_0xad12('0x37')]);_0x3a8e81[_0xad12('0x38')]=qs['filters'](_['pick'](_0x4d0404[_0xad12('0x2f')],_0x44bfed[_0xad12('0x39')]));if(_0x4d0404[_0xad12('0x2f')][_0xad12('0x3c')]){_0x3a8e81[_0xad12('0x38')]=_[_0xad12('0x3a')](_0x3a8e81['where'],{'$or':_['map'](_0x3a8e81[_0xad12('0x32')],function(_0x17ccde){var _0x44186e={};_0x44186e[_0x17ccde]={'$like':'%'+_0x4d0404[_0xad12('0x2f')][_0xad12('0x3c')]+'%'};return _0x44186e;})});}_0x3a8e81=_[_0xad12('0x3a')]({},_0x3a8e81,_0x4d0404[_0xad12('0x3d')]);return _0x35ca79[_0xad12('0x4d')](_0x3a8e81);}})[_0xad12('0x23')](function(_0x5b49e8){if(_0x5b49e8){_0x23144b=_0x5b49e8[_0xad12('0x33')];if(!_0x4d0404['query'][_0xad12('0x34')](_0xad12('0x35'))){_0x3a8e81[_0xad12('0x1b')]=qs[_0xad12('0x1b')](_0x4d0404[_0xad12('0x2f')]['limit']);_0x3a8e81['offset']=qs[_0xad12('0x1d')](_0x4d0404[_0xad12('0x2f')]['offset']);}return _0x35ca79[_0xad12('0x4d')](_0x3a8e81);}})['then'](function(_0x2f12ee){if(_0x2f12ee){return _0x2f12ee?{'count':_0x23144b,'rows':_0x2f12ee}:null;}})[_0xad12('0x23')](respondWithResult(_0x5da5a8,null))[_0xad12('0x3f')](handleError(_0x5da5a8,null));};exports[_0xad12('0x4e')]=function(_0x3af396,_0x27d2b3,_0xe5d175){if(_0x3af396['body']['id']){delete _0x3af396[_0xad12('0x46')]['id'];}return db['FreshdeskConfiguration'][_0xad12('0x48')]({'where':{'id':_0x3af396[_0xad12('0x41')]['id']}})['then'](handleEntityNotFound(_0x27d2b3,null))[_0xad12('0x23')](function(_0x453364){if(_0x453364){return _0x453364[_0xad12('0x4e')](_0x3af396[_0xad12('0x46')][_0xad12('0x4f')]||[]);}return null;})[_0xad12('0x23')](respondWithResult(_0x27d2b3,null))[_0xad12('0x3f')](handleError(_0x27d2b3,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index a44a1f8..7bea4f8 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 _0x25c9=['int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration'];(function(_0x529a26,_0x4a48c6){var _0x372bdf=function(_0x38d5f8){while(--_0x38d5f8){_0x529a26['push'](_0x529a26['shift']());}};_0x372bdf(++_0x4a48c6);}(_0x25c9,0x1bb));var _0x925c=function(_0x25050c,_0xab0ea9){_0x25050c=_0x25050c-0x0;var _0xd6fdf=_0x25c9[_0x25050c];return _0xd6fdf;};'use strict';var _=require(_0x925c('0x0'));var util=require(_0x925c('0x1'));var logger=require(_0x925c('0x2'))(_0x925c('0x3'));var moment=require(_0x925c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x925c('0x5'));var rimraf=require(_0x925c('0x6'));var config=require(_0x925c('0x7'));var attributes=require(_0x925c('0x8'));module[_0x925c('0x9')]=function(_0xd5d8f0,_0x3d55af){return _0xd5d8f0[_0x925c('0xa')](_0x925c('0xb'),attributes,{'tableName':_0x925c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2564=['define','FreshdeskConfiguration','lodash','util','api','moment','bluebird','path','exports'];(function(_0x4b26a2,_0x3c86e3){var _0x2675cb=function(_0x2be9df){while(--_0x2be9df){_0x4b26a2['push'](_0x4b26a2['shift']());}};_0x2675cb(++_0x3c86e3);}(_0x2564,0x65));var _0x4256=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2564[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4256('0x0'));var util=require(_0x4256('0x1'));var logger=require('../../config/logger')(_0x4256('0x2'));var moment=require(_0x4256('0x3'));var BPromise=require(_0x4256('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4256('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x4256('0x6')]=function(_0x3dd77c,_0x1d76fe){return _0x3dd77c[_0x4256('0x7')](_0x4256('0x8'),attributes,{'tableName':'int_freshdesk_configurations','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 8a11f4e..0f87f0f 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 _0x7532=['error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4bf018,_0x332650){var _0x4e4504=function(_0x132753){while(--_0x132753){_0x4bf018['push'](_0x4bf018['shift']());}};_0x4e4504(++_0x332650);}(_0x7532,0x12e));var _0x2753=function(_0x584308,_0x1379b3){_0x584308=_0x584308-0x0;var _0x45865b=_0x7532[_0x584308];return _0x45865b;};'use strict';var _=require(_0x2753('0x0'));var util=require(_0x2753('0x1'));var moment=require(_0x2753('0x2'));var BPromise=require(_0x2753('0x3'));var rs=require(_0x2753('0x4'));var fs=require('fs');var Redis=require(_0x2753('0x5'));var db=require(_0x2753('0x6'))['db'];var utils=require(_0x2753('0x7'));var logger=require(_0x2753('0x8'))(_0x2753('0x9'));var config=require(_0x2753('0xa'));var jayson=require(_0x2753('0xb'));var client=jayson[_0x2753('0xc')][_0x2753('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3ea0ff,_0x490abe,_0x1be821){return new BPromise(function(_0x2e08c7,_0x437677){return client['request'](_0x3ea0ff,_0x1be821)['then'](function(_0x3cf3b1){logger[_0x2753('0xe')](_0x2753('0xf'),_0x490abe,_0x2753('0x10'));logger[_0x2753('0x11')](_0x2753('0x12'),_0x490abe,_0x2753('0x10'),JSON[_0x2753('0x13')](_0x3cf3b1));if(_0x3cf3b1[_0x2753('0x14')]){if(_0x3cf3b1[_0x2753('0x14')]['code']===0x1f4){logger[_0x2753('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x490abe,_0x3cf3b1['error'][_0x2753('0x15')]);return _0x437677(_0x3cf3b1[_0x2753('0x14')][_0x2753('0x15')]);}logger[_0x2753('0x14')](_0x2753('0xf'),_0x490abe,_0x3cf3b1['error'][_0x2753('0x15')]);return _0x2e08c7(_0x3cf3b1[_0x2753('0x14')][_0x2753('0x15')]);}else{logger[_0x2753('0xe')](_0x2753('0xf'),_0x490abe,'request\x20sent');_0x2e08c7(_0x3cf3b1[_0x2753('0x16')][_0x2753('0x15')]);}})['catch'](function(_0xf1a053){logger[_0x2753('0x14')](_0x2753('0xf'),_0x490abe,_0xf1a053);_0x437677(_0xf1a053);});});} \ No newline at end of file +var _0x632b=['client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1c019b,_0x5f048d){var _0x4031fe=function(_0x188bbd){while(--_0x188bbd){_0x1c019b['push'](_0x1c019b['shift']());}};_0x4031fe(++_0x5f048d);}(_0x632b,0x1c4));var _0xb632=function(_0x550303,_0x5ad944){_0x550303=_0x550303-0x0;var _0x21c6b0=_0x632b[_0x550303];return _0x21c6b0;};'use strict';var _=require(_0xb632('0x0'));var util=require(_0xb632('0x1'));var moment=require(_0xb632('0x2'));var BPromise=require('bluebird');var rs=require(_0xb632('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb632('0x4'))['db'];var utils=require(_0xb632('0x5'));var logger=require(_0xb632('0x6'))(_0xb632('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb632('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e213f,_0x35b89d,_0x4e9c6f){return new BPromise(function(_0x1685b1,_0x5cb575){return client[_0xb632('0x9')](_0x1e213f,_0x4e9c6f)[_0xb632('0xa')](function(_0x48719f){logger[_0xb632('0xb')](_0xb632('0xc'),_0x35b89d,'request\x20sent');logger[_0xb632('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x35b89d,_0xb632('0xe'),JSON[_0xb632('0xf')](_0x48719f));if(_0x48719f[_0xb632('0x10')]){if(_0x48719f[_0xb632('0x10')][_0xb632('0x11')]===0x1f4){logger['error'](_0xb632('0xc'),_0x35b89d,_0x48719f['error'][_0xb632('0x12')]);return _0x5cb575(_0x48719f[_0xb632('0x10')]['message']);}logger[_0xb632('0x10')](_0xb632('0xc'),_0x35b89d,_0x48719f[_0xb632('0x10')][_0xb632('0x12')]);return _0x1685b1(_0x48719f[_0xb632('0x10')][_0xb632('0x12')]);}else{logger[_0xb632('0xb')](_0xb632('0xc'),_0x35b89d,'request\x20sent');_0x1685b1(_0x48719f['result'][_0xb632('0x12')]);}})[_0xb632('0x13')](function(_0x4f8bdc){logger[_0xb632('0x10')](_0xb632('0xc'),_0x35b89d,_0x4f8bdc);_0x5cb575(_0x4f8bdc);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 27496f8..1dada8b 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 _0x4733=['get','isAuthenticated','index','show','create','put','update','delete','/:id','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller'];(function(_0x26d2ea,_0x59d2d1){var _0x4084da=function(_0x463ee9){while(--_0x463ee9){_0x26d2ea['push'](_0x26d2ea['shift']());}};_0x4084da(++_0x59d2d1);}(_0x4733,0x1cc));var _0x3473=function(_0x487ab4,_0x1e24e8){_0x487ab4=_0x487ab4-0x0;var _0x3bef77=_0x4733[_0x487ab4];return _0x3bef77;};'use strict';var multer=require('multer');var util=require(_0x3473('0x0'));var path=require(_0x3473('0x1'));var timeout=require(_0x3473('0x2'));var express=require(_0x3473('0x3'));var router=express[_0x3473('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3473('0x5'));var config=require(_0x3473('0x6'));var controller=require(_0x3473('0x7'));router[_0x3473('0x8')]('/',auth[_0x3473('0x9')](),controller[_0x3473('0xa')]);router[_0x3473('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3473('0xb')]);router['post']('/',auth[_0x3473('0x9')](),controller[_0x3473('0xc')]);router[_0x3473('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x3473('0xe')]);router[_0x3473('0xf')](_0x3473('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x3473('0x11')]=router; \ No newline at end of file +var _0xf5c3=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','put','update','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x3582de,_0x4cd6d1){var _0x202b18=function(_0x31e140){while(--_0x31e140){_0x3582de['push'](_0x3582de['shift']());}};_0x202b18(++_0x4cd6d1);}(_0xf5c3,0x12d));var _0x3f5c=function(_0x4d1c84,_0x58563a){_0x4d1c84=_0x4d1c84-0x0;var _0x238fa6=_0xf5c3[_0x4d1c84];return _0x238fa6;};'use strict';var multer=require(_0x3f5c('0x0'));var util=require('util');var path=require(_0x3f5c('0x1'));var timeout=require('connect-timeout');var express=require(_0x3f5c('0x2'));var router=express[_0x3f5c('0x3')]();var fs_extra=require(_0x3f5c('0x4'));var auth=require(_0x3f5c('0x5'));var interaction=require(_0x3f5c('0x6'));var config=require(_0x3f5c('0x7'));var controller=require('./intFreshdeskField.controller');router[_0x3f5c('0x8')]('/',auth[_0x3f5c('0x9')](),controller['index']);router[_0x3f5c('0x8')](_0x3f5c('0xa'),auth[_0x3f5c('0x9')](),controller[_0x3f5c('0xb')]);router[_0x3f5c('0xc')]('/',auth[_0x3f5c('0x9')](),controller['create']);router[_0x3f5c('0xd')](_0x3f5c('0xa'),auth[_0x3f5c('0x9')](),controller[_0x3f5c('0xe')]);router['delete']('/:id',auth[_0x3f5c('0x9')](),controller[_0x3f5c('0xf')]);module[_0x3f5c('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index df05728..1ba4f34 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 _0xe7e1=['customVariable','picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x52dd6c,_0x323c5e){var _0x22979a=function(_0x449af2){while(--_0x449af2){_0x52dd6c['push'](_0x52dd6c['shift']());}};_0x22979a(++_0x323c5e);}(_0xe7e1,0x11c));var _0x1e7e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe7e1[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x1e7e('0x0'));module['exports']={'type':{'type':Sequelize[_0x1e7e('0x1')](_0x1e7e('0x2'),_0x1e7e('0x3'),_0x1e7e('0x4'),'keyValue',_0x1e7e('0x5')),'defaultValue':_0x1e7e('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1e7e('0x6')]},'keyType':{'type':Sequelize[_0x1e7e('0x1')](_0x1e7e('0x2'),_0x1e7e('0x3'),_0x1e7e('0x4'))},'keyContent':{'type':Sequelize[_0x1e7e('0x6')]},'idField':{'type':Sequelize[_0x1e7e('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1e7e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1e7e('0x6')]}}; \ No newline at end of file +var _0x0969=['customVariable','keyValue','picklist','STRING','variable','BOOLEAN','exports','ENUM','string'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0x0969,0x7b));var _0x9096=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0969[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require('sequelize');module[_0x9096('0x0')]={'type':{'type':Sequelize[_0x9096('0x1')](_0x9096('0x2'),'variable',_0x9096('0x3'),_0x9096('0x4'),_0x9096('0x5')),'defaultValue':_0x9096('0x2')},'content':{'type':Sequelize[_0x9096('0x6')]},'key':{'type':Sequelize[_0x9096('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x9096('0x7'),_0x9096('0x3'))},'keyContent':{'type':Sequelize[_0x9096('0x6')]},'idField':{'type':Sequelize[_0x9096('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9096('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9096('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 4746b3f..f02817e 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 _0x9c5e=['body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','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','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FreshdeskField','includeAll','include','findAll','rows','catch','show','keys','find','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x44b434,_0x87eeb5){_0x44b434=_0x44b434-0x0;var _0x414d34=_0x9c5e[_0x44b434];return _0x414d34;};'use strict';var emlformat=require(_0xe9c5('0x0'));var rimraf=require(_0xe9c5('0x1'));var zipdir=require(_0xe9c5('0x2'));var jsonpatch=require(_0xe9c5('0x3'));var rp=require(_0xe9c5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe9c5('0x5'));var path=require(_0xe9c5('0x6'));var sox=require('sox');var csv=require(_0xe9c5('0x7'));var ejs=require(_0xe9c5('0x8'));var fs=require('fs');var fs_extra=require(_0xe9c5('0x9'));var _=require(_0xe9c5('0xa'));var squel=require('squel');var crypto=require(_0xe9c5('0xb'));var jsforce=require(_0xe9c5('0xc'));var deskjs=require(_0xe9c5('0xd'));var toCsv=require(_0xe9c5('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe9c5('0xe'));var authService=require(_0xe9c5('0xf'));var qs=require(_0xe9c5('0x10'));var as=require(_0xe9c5('0x11'));var hardwareService=require(_0xe9c5('0x12'));var logger=require(_0xe9c5('0x13'))(_0xe9c5('0x14'));var utils=require(_0xe9c5('0x15'));var config=require(_0xe9c5('0x16'));var licenseUtil=require(_0xe9c5('0x17'));var db=require(_0xe9c5('0x18'))['db'];function respondWithStatusCode(_0x27f3e1,_0x471401){_0x471401=_0x471401||0xcc;return function(_0x25ff11){if(_0x25ff11){return _0x27f3e1[_0xe9c5('0x19')](_0x471401);}return _0x27f3e1[_0xe9c5('0x1a')](_0x471401)['end']();};}function respondWithResult(_0x3cce36,_0xe98b11){_0xe98b11=_0xe98b11||0xc8;return function(_0x5eb474){if(_0x5eb474){return _0x3cce36[_0xe9c5('0x1a')](_0xe98b11)[_0xe9c5('0x1b')](_0x5eb474);}};}function respondWithFilteredResult(_0x232584,_0x5d8236){return function(_0x163253){if(_0x163253){var _0x14eb41=typeof _0x5d8236['offset']===_0xe9c5('0x1c')&&typeof _0x5d8236[_0xe9c5('0x1d')]===_0xe9c5('0x1c');var _0x154390=_0x163253[_0xe9c5('0x1e')];var _0x4d9c7d=_0x14eb41?0x0:_0x5d8236[_0xe9c5('0x1f')];var _0x1cecae=_0x14eb41?_0x163253[_0xe9c5('0x1e')]:_0x5d8236[_0xe9c5('0x1f')]+_0x5d8236['limit'];var _0x26492a;if(_0x1cecae>=_0x154390){_0x1cecae=_0x154390;_0x26492a=0xc8;}else{_0x26492a=0xce;}_0x232584[_0xe9c5('0x1a')](_0x26492a);return _0x232584[_0xe9c5('0x20')](_0xe9c5('0x21'),_0x4d9c7d+'-'+_0x1cecae+'/'+_0x154390)[_0xe9c5('0x1b')](_0x163253);}return null;};}function patchUpdates(_0x58fbad){return function(_0x51e860){try{jsonpatch[_0xe9c5('0x22')](_0x51e860,_0x58fbad,!![]);}catch(_0x57818d){return BPromise[_0xe9c5('0x23')](_0x57818d);}return _0x51e860[_0xe9c5('0x24')]();};}function saveUpdates(_0x21b02a,_0x4d16bc){return function(_0x5750ff){if(_0x5750ff){return _0x5750ff[_0xe9c5('0x25')](_0x21b02a)[_0xe9c5('0x26')](function(_0x37fb90){return _0x37fb90;});}return null;};}function removeEntity(_0x189a13,_0x34a7c8){return function(_0x245161){if(_0x245161){return _0x245161[_0xe9c5('0x27')]()[_0xe9c5('0x26')](function(){_0x189a13[_0xe9c5('0x1a')](0xcc)[_0xe9c5('0x28')]();});}};}function handleEntityNotFound(_0x5a3caa,_0x5c8bb7){return function(_0x250e1c){if(!_0x250e1c){_0x5a3caa[_0xe9c5('0x19')](0x194);}return _0x250e1c;};}function handleError(_0x298dca,_0x3bf679){_0x3bf679=_0x3bf679||0x1f4;return function(_0x33fe71){logger[_0xe9c5('0x29')](_0x33fe71['stack']);if(_0x33fe71[_0xe9c5('0x2a')]){delete _0x33fe71['name'];}_0x298dca[_0xe9c5('0x1a')](_0x3bf679)['send'](_0x33fe71);};}exports[_0xe9c5('0x2b')]=function(_0x2112a6,_0x52d008){var _0x36d145={},_0x46d253={},_0x334f5a={'count':0x0,'rows':[]};var _0x37cfa5=_[_0xe9c5('0x2c')](db['FreshdeskField'][_0xe9c5('0x2d')],function(_0x4fcabd){return{'name':_0x4fcabd[_0xe9c5('0x2e')],'type':_0x4fcabd['type'][_0xe9c5('0x2f')]};});_0x46d253[_0xe9c5('0x30')]=_[_0xe9c5('0x2c')](_0x37cfa5,_0xe9c5('0x2a'));_0x46d253[_0xe9c5('0x31')]=_['keys'](_0x2112a6[_0xe9c5('0x31')]);_0x46d253[_0xe9c5('0x32')]=_[_0xe9c5('0x33')](_0x46d253[_0xe9c5('0x30')],_0x46d253[_0xe9c5('0x31')]);_0x36d145['attributes']=_['intersection'](_0x46d253[_0xe9c5('0x30')],qs[_0xe9c5('0x34')](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x34')]));_0x36d145[_0xe9c5('0x35')]=_0x36d145[_0xe9c5('0x35')][_0xe9c5('0x36')]?_0x36d145[_0xe9c5('0x35')]:_0x46d253['model'];if(!_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x37')]('nolimit')){_0x36d145[_0xe9c5('0x1d')]=qs['limit'](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x1d')]);_0x36d145[_0xe9c5('0x1f')]=qs[_0xe9c5('0x1f')](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x1f')]);}_0x36d145[_0xe9c5('0x38')]=qs[_0xe9c5('0x39')](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x39')]);_0x36d145[_0xe9c5('0x3a')]=qs[_0xe9c5('0x32')](_[_0xe9c5('0x3b')](_0x2112a6[_0xe9c5('0x31')],_0x46d253[_0xe9c5('0x32')]),_0x37cfa5);if(_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x3c')]){_0x36d145[_0xe9c5('0x3a')]=_[_0xe9c5('0x3d')](_0x36d145['where'],{'$or':_[_0xe9c5('0x2c')](_0x37cfa5,function(_0x2e3f15){if(_0x2e3f15[_0xe9c5('0x3e')]!==_0xe9c5('0x3f')){var _0x204b53={};_0x204b53[_0x2e3f15[_0xe9c5('0x2a')]]={'$like':'%'+_0x2112a6['query'][_0xe9c5('0x3c')]+'%'};return _0x204b53;}})});}_0x36d145=_[_0xe9c5('0x3d')]({},_0x36d145,_0x2112a6[_0xe9c5('0x40')]);var _0x480b83={'where':_0x36d145[_0xe9c5('0x3a')]};return db[_0xe9c5('0x41')][_0xe9c5('0x1e')](_0x480b83)[_0xe9c5('0x26')](function(_0x2c1615){_0x334f5a[_0xe9c5('0x1e')]=_0x2c1615;if(_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x42')]){_0x36d145[_0xe9c5('0x43')]=[{'all':!![]}];}return db[_0xe9c5('0x41')][_0xe9c5('0x44')](_0x36d145);})['then'](function(_0x51dd18){_0x334f5a[_0xe9c5('0x45')]=_0x51dd18;return _0x334f5a;})[_0xe9c5('0x26')](respondWithFilteredResult(_0x52d008,_0x36d145))[_0xe9c5('0x46')](handleError(_0x52d008,null));};exports[_0xe9c5('0x47')]=function(_0x4ca4b0,_0x4a3fc5){var _0x382405={'raw':!![],'where':{'id':_0x4ca4b0['params']['id']}},_0x144e85={};_0x144e85[_0xe9c5('0x30')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x144e85[_0xe9c5('0x31')]=_[_0xe9c5('0x48')](_0x4ca4b0[_0xe9c5('0x31')]);_0x144e85[_0xe9c5('0x32')]=_['intersection'](_0x144e85[_0xe9c5('0x30')],_0x144e85[_0xe9c5('0x31')]);_0x382405[_0xe9c5('0x35')]=_[_0xe9c5('0x33')](_0x144e85[_0xe9c5('0x30')],qs[_0xe9c5('0x34')](_0x4ca4b0[_0xe9c5('0x31')][_0xe9c5('0x34')]));_0x382405['attributes']=_0x382405[_0xe9c5('0x35')][_0xe9c5('0x36')]?_0x382405[_0xe9c5('0x35')]:_0x144e85[_0xe9c5('0x30')];if(_0x4ca4b0[_0xe9c5('0x31')][_0xe9c5('0x42')]){_0x382405['include']=[{'all':!![]}];}_0x382405=_['merge']({},_0x382405,_0x4ca4b0['options']);return db['FreshdeskField'][_0xe9c5('0x49')](_0x382405)[_0xe9c5('0x26')](handleEntityNotFound(_0x4a3fc5,null))[_0xe9c5('0x26')](respondWithResult(_0x4a3fc5,null))['catch'](handleError(_0x4a3fc5,null));};exports[_0xe9c5('0x4a')]=function(_0x520248,_0x1ed99e){return db[_0xe9c5('0x41')][_0xe9c5('0x4a')](_0x520248[_0xe9c5('0x4b')],{})['then'](respondWithResult(_0x1ed99e,0xc9))[_0xe9c5('0x46')](handleError(_0x1ed99e,null));};exports[_0xe9c5('0x25')]=function(_0x1da6a3,_0x249940){if(_0x1da6a3['body']['id']){delete _0x1da6a3[_0xe9c5('0x4b')]['id'];}return db[_0xe9c5('0x41')][_0xe9c5('0x49')]({'where':{'id':_0x1da6a3[_0xe9c5('0x4c')]['id']}})[_0xe9c5('0x26')](handleEntityNotFound(_0x249940,null))[_0xe9c5('0x26')](saveUpdates(_0x1da6a3['body'],null))[_0xe9c5('0x26')](respondWithResult(_0x249940,null))[_0xe9c5('0x46')](handleError(_0x249940,null));};exports[_0xe9c5('0x27')]=function(_0x9d0154,_0x5e7c24){return db[_0xe9c5('0x41')][_0xe9c5('0x49')]({'where':{'id':_0x9d0154[_0xe9c5('0x4c')]['id']}})[_0xe9c5('0x26')](handleEntityNotFound(_0x5e7c24,null))[_0xe9c5('0x26')](removeEntity(_0x5e7c24,null))[_0xe9c5('0x46')](handleError(_0x5e7c24,null));}; \ No newline at end of file +var _0x6f2f=['Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','update','body','eml-format','rimraf','moment','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count'];(function(_0x4d770d,_0x5af4ce){var _0x11dc7a=function(_0x27d3f7){while(--_0x27d3f7){_0x4d770d['push'](_0x4d770d['shift']());}};_0x11dc7a(++_0x5af4ce);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6f2f[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0xf6f2('0x0'));var rimraf=require(_0xf6f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf6f2('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf6f2('0x3'));var path=require(_0xf6f2('0x4'));var sox=require(_0xf6f2('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6f2('0x6'));var _=require(_0xf6f2('0x7'));var squel=require(_0xf6f2('0x8'));var crypto=require(_0xf6f2('0x9'));var jsforce=require(_0xf6f2('0xa'));var deskjs=require(_0xf6f2('0xb'));var toCsv=require(_0xf6f2('0xc'));var querystring=require(_0xf6f2('0xd'));var Papa=require(_0xf6f2('0xe'));var Redis=require(_0xf6f2('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf6f2('0x10'));var as=require(_0xf6f2('0x11'));var hardwareService=require(_0xf6f2('0x12'));var logger=require(_0xf6f2('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf6f2('0x14'));var db=require(_0xf6f2('0x15'))['db'];function respondWithStatusCode(_0x131a18,_0x4afa2){_0x4afa2=_0x4afa2||0xcc;return function(_0x1626ce){if(_0x1626ce){return _0x131a18[_0xf6f2('0x16')](_0x4afa2);}return _0x131a18['status'](_0x4afa2)[_0xf6f2('0x17')]();};}function respondWithResult(_0x5ef5ac,_0xccf687){_0xccf687=_0xccf687||0xc8;return function(_0x3cf95f){if(_0x3cf95f){return _0x5ef5ac[_0xf6f2('0x18')](_0xccf687)['json'](_0x3cf95f);}};}function respondWithFilteredResult(_0x2b28c1,_0x27c0dc){return function(_0x314f9a){if(_0x314f9a){var _0x26c176=typeof _0x27c0dc[_0xf6f2('0x19')]===_0xf6f2('0x1a')&&typeof _0x27c0dc[_0xf6f2('0x1b')]===_0xf6f2('0x1a');var _0x4115dd=_0x314f9a[_0xf6f2('0x1c')];var _0x400055=_0x26c176?0x0:_0x27c0dc[_0xf6f2('0x19')];var _0x42b93b=_0x26c176?_0x314f9a[_0xf6f2('0x1c')]:_0x27c0dc[_0xf6f2('0x19')]+_0x27c0dc['limit'];var _0x4de8bd;if(_0x42b93b>=_0x4115dd){_0x42b93b=_0x4115dd;_0x4de8bd=0xc8;}else{_0x4de8bd=0xce;}_0x2b28c1[_0xf6f2('0x18')](_0x4de8bd);return _0x2b28c1['set'](_0xf6f2('0x1d'),_0x400055+'-'+_0x42b93b+'/'+_0x4115dd)[_0xf6f2('0x1e')](_0x314f9a);}return null;};}function patchUpdates(_0x312429){return function(_0x1ad76b){try{jsonpatch['apply'](_0x1ad76b,_0x312429,!![]);}catch(_0xd020e6){return BPromise[_0xf6f2('0x1f')](_0xd020e6);}return _0x1ad76b[_0xf6f2('0x20')]();};}function saveUpdates(_0x3321a0,_0x5dce4f){return function(_0x19be8e){if(_0x19be8e){return _0x19be8e['update'](_0x3321a0)[_0xf6f2('0x21')](function(_0x56b97a){return _0x56b97a;});}return null;};}function removeEntity(_0x1e33c,_0x151905){return function(_0x582862){if(_0x582862){return _0x582862[_0xf6f2('0x22')]()[_0xf6f2('0x21')](function(){_0x1e33c[_0xf6f2('0x18')](0xcc)[_0xf6f2('0x17')]();});}};}function handleEntityNotFound(_0x219a12,_0x1f3500){return function(_0x3304ec){if(!_0x3304ec){_0x219a12[_0xf6f2('0x16')](0x194);}return _0x3304ec;};}function handleError(_0x5dac6a,_0x2b233f){_0x2b233f=_0x2b233f||0x1f4;return function(_0x2081f6){logger[_0xf6f2('0x23')](_0x2081f6[_0xf6f2('0x24')]);if(_0x2081f6[_0xf6f2('0x25')]){delete _0x2081f6[_0xf6f2('0x25')];}_0x5dac6a[_0xf6f2('0x18')](_0x2b233f)[_0xf6f2('0x26')](_0x2081f6);};}exports[_0xf6f2('0x27')]=function(_0x40243e,_0x2c643d){var _0x4accfe={},_0x2aa645={},_0x26c4dc={'count':0x0,'rows':[]};var _0x17c63f=_[_0xf6f2('0x28')](db[_0xf6f2('0x29')][_0xf6f2('0x2a')],function(_0x228b24){return{'name':_0x228b24[_0xf6f2('0x2b')],'type':_0x228b24[_0xf6f2('0x2c')][_0xf6f2('0x2d')]};});_0x2aa645[_0xf6f2('0x2e')]=_[_0xf6f2('0x28')](_0x17c63f,'name');_0x2aa645[_0xf6f2('0x2f')]=_[_0xf6f2('0x30')](_0x40243e[_0xf6f2('0x2f')]);_0x2aa645[_0xf6f2('0x31')]=_[_0xf6f2('0x32')](_0x2aa645[_0xf6f2('0x2e')],_0x2aa645[_0xf6f2('0x2f')]);_0x4accfe[_0xf6f2('0x33')]=_[_0xf6f2('0x32')](_0x2aa645[_0xf6f2('0x2e')],qs[_0xf6f2('0x34')](_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x34')]));_0x4accfe['attributes']=_0x4accfe['attributes']['length']?_0x4accfe[_0xf6f2('0x33')]:_0x2aa645[_0xf6f2('0x2e')];if(!_0x40243e['query']['hasOwnProperty'](_0xf6f2('0x35'))){_0x4accfe[_0xf6f2('0x1b')]=qs[_0xf6f2('0x1b')](_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x1b')]);_0x4accfe[_0xf6f2('0x19')]=qs['offset'](_0x40243e[_0xf6f2('0x2f')]['offset']);}_0x4accfe[_0xf6f2('0x36')]=qs[_0xf6f2('0x37')](_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x37')]);_0x4accfe['where']=qs[_0xf6f2('0x31')](_[_0xf6f2('0x38')](_0x40243e[_0xf6f2('0x2f')],_0x2aa645['filters']),_0x17c63f);if(_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x39')]){_0x4accfe[_0xf6f2('0x3a')]=_['merge'](_0x4accfe[_0xf6f2('0x3a')],{'$or':_['map'](_0x17c63f,function(_0x38b20d){if(_0x38b20d[_0xf6f2('0x2c')]!==_0xf6f2('0x3b')){var _0x55e44d={};_0x55e44d[_0x38b20d[_0xf6f2('0x25')]]={'$like':'%'+_0x40243e[_0xf6f2('0x2f')][_0xf6f2('0x39')]+'%'};return _0x55e44d;}})});}_0x4accfe=_[_0xf6f2('0x3c')]({},_0x4accfe,_0x40243e[_0xf6f2('0x3d')]);var _0x4ee53f={'where':_0x4accfe[_0xf6f2('0x3a')]};return db[_0xf6f2('0x29')][_0xf6f2('0x1c')](_0x4ee53f)[_0xf6f2('0x21')](function(_0x3986f1){_0x26c4dc[_0xf6f2('0x1c')]=_0x3986f1;if(_0x40243e[_0xf6f2('0x2f')]['includeAll']){_0x4accfe[_0xf6f2('0x3e')]=[{'all':!![]}];}return db[_0xf6f2('0x29')][_0xf6f2('0x3f')](_0x4accfe);})['then'](function(_0x244a8c){_0x26c4dc[_0xf6f2('0x40')]=_0x244a8c;return _0x26c4dc;})[_0xf6f2('0x21')](respondWithFilteredResult(_0x2c643d,_0x4accfe))[_0xf6f2('0x41')](handleError(_0x2c643d,null));};exports[_0xf6f2('0x42')]=function(_0x4c4f17,_0x47090b){var _0x31f367={'raw':!![],'where':{'id':_0x4c4f17[_0xf6f2('0x43')]['id']}},_0x34ba3a={};_0x34ba3a[_0xf6f2('0x2e')]=_['keys'](db[_0xf6f2('0x29')]['rawAttributes']);_0x34ba3a[_0xf6f2('0x2f')]=_[_0xf6f2('0x30')](_0x4c4f17[_0xf6f2('0x2f')]);_0x34ba3a[_0xf6f2('0x31')]=_[_0xf6f2('0x32')](_0x34ba3a[_0xf6f2('0x2e')],_0x34ba3a[_0xf6f2('0x2f')]);_0x31f367[_0xf6f2('0x33')]=_[_0xf6f2('0x32')](_0x34ba3a[_0xf6f2('0x2e')],qs[_0xf6f2('0x34')](_0x4c4f17['query'][_0xf6f2('0x34')]));_0x31f367[_0xf6f2('0x33')]=_0x31f367[_0xf6f2('0x33')]['length']?_0x31f367['attributes']:_0x34ba3a['model'];if(_0x4c4f17[_0xf6f2('0x2f')][_0xf6f2('0x44')]){_0x31f367['include']=[{'all':!![]}];}_0x31f367=_['merge']({},_0x31f367,_0x4c4f17[_0xf6f2('0x3d')]);return db[_0xf6f2('0x29')][_0xf6f2('0x45')](_0x31f367)[_0xf6f2('0x21')](handleEntityNotFound(_0x47090b,null))[_0xf6f2('0x21')](respondWithResult(_0x47090b,null))[_0xf6f2('0x41')](handleError(_0x47090b,null));};exports['create']=function(_0x5b4737,_0x5daa2c){return db['FreshdeskField'][_0xf6f2('0x46')](_0x5b4737['body'],{})[_0xf6f2('0x21')](respondWithResult(_0x5daa2c,0xc9))[_0xf6f2('0x41')](handleError(_0x5daa2c,null));};exports[_0xf6f2('0x47')]=function(_0x3b7d67,_0x28da53){if(_0x3b7d67['body']['id']){delete _0x3b7d67['body']['id'];}return db[_0xf6f2('0x29')]['find']({'where':{'id':_0x3b7d67['params']['id']}})[_0xf6f2('0x21')](handleEntityNotFound(_0x28da53,null))[_0xf6f2('0x21')](saveUpdates(_0x3b7d67[_0xf6f2('0x48')],null))[_0xf6f2('0x21')](respondWithResult(_0x28da53,null))[_0xf6f2('0x41')](handleError(_0x28da53,null));};exports[_0xf6f2('0x22')]=function(_0x5351f5,_0x443277){return db[_0xf6f2('0x29')]['find']({'where':{'id':_0x5351f5[_0xf6f2('0x43')]['id']}})[_0xf6f2('0x21')](handleEntityNotFound(_0x443277,null))[_0xf6f2('0x21')](removeEntity(_0x443277,null))['catch'](handleError(_0x443277,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index ce0e64e..bfca3b5 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 _0x5c42=['rimraf','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x5bb095,_0x3ec75e){var _0x1779fb=function(_0x59ccf5){while(--_0x59ccf5){_0x5bb095['push'](_0x5bb095['shift']());}};_0x1779fb(++_0x3ec75e);}(_0x5c42,0x182));var _0x25c4=function(_0x583794,_0xb03ff1){_0x583794=_0x583794-0x0;var _0x484672=_0x5c42[_0x583794];return _0x484672;};'use strict';var _=require(_0x25c4('0x0'));var util=require('util');var logger=require(_0x25c4('0x1'))(_0x25c4('0x2'));var moment=require(_0x25c4('0x3'));var BPromise=require(_0x25c4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x25c4('0x5'));var rimraf=require(_0x25c4('0x6'));var config=require(_0x25c4('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0x25c4('0x8')]=function(_0x1b6c22,_0x82d8e6){return _0x1b6c22[_0x25c4('0x9')](_0x25c4('0xa'),attributes,{'tableName':_0x25c4('0xb'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x25c4('0xc'),_0x25c4('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x577e=['../../config/environment','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','idField','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x408130,_0x5e9764){var _0x305b96=function(_0x1abfbc){while(--_0x1abfbc){_0x408130['push'](_0x408130['shift']());}};_0x305b96(++_0x5e9764);}(_0x577e,0x1f2));var _0xe577=function(_0x27d8bc,_0x19e010){_0x27d8bc=_0x27d8bc-0x0;var _0x4b04cb=_0x577e[_0x27d8bc];return _0x4b04cb;};'use strict';var _=require('lodash');var util=require(_0xe577('0x0'));var logger=require(_0xe577('0x1'))('api');var moment=require(_0xe577('0x2'));var BPromise=require(_0xe577('0x3'));var rp=require(_0xe577('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe577('0x5'));var config=require(_0xe577('0x6'));var attributes=require(_0xe577('0x7'));module[_0xe577('0x8')]=function(_0x2e929e,_0x38856b){return _0x2e929e[_0xe577('0x9')]('FreshdeskField',attributes,{'tableName':_0xe577('0xa'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xe577('0xb'),'FieldId'],'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 d07c25c..92ad3a1 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 _0x9545=['http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9545,0x141));var _0x5954=function(_0x526046,_0x154040){_0x526046=_0x526046-0x0;var _0x5b92a2=_0x9545[_0x526046];return _0x5b92a2;};'use strict';var _=require('lodash');var util=require(_0x5954('0x0'));var moment=require(_0x5954('0x1'));var BPromise=require(_0x5954('0x2'));var rs=require(_0x5954('0x3'));var fs=require('fs');var Redis=require(_0x5954('0x4'));var db=require(_0x5954('0x5'))['db'];var utils=require(_0x5954('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5954('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5954('0x8')][_0x5954('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2dfe95,_0x1488c3,_0x569ae5){return new BPromise(function(_0xb3c10e,_0x418368){return client[_0x5954('0xa')](_0x2dfe95,_0x569ae5)[_0x5954('0xb')](function(_0x36a3d8){logger[_0x5954('0xc')](_0x5954('0xd'),_0x1488c3,_0x5954('0xe'));logger[_0x5954('0xf')](_0x5954('0x10'),_0x1488c3,_0x5954('0xe'),JSON[_0x5954('0x11')](_0x36a3d8));if(_0x36a3d8[_0x5954('0x12')]){if(_0x36a3d8[_0x5954('0x12')][_0x5954('0x13')]===0x1f4){logger[_0x5954('0x12')](_0x5954('0xd'),_0x1488c3,_0x36a3d8['error'][_0x5954('0x14')]);return _0x418368(_0x36a3d8['error'][_0x5954('0x14')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x1488c3,_0x36a3d8[_0x5954('0x12')][_0x5954('0x14')]);return _0xb3c10e(_0x36a3d8[_0x5954('0x12')][_0x5954('0x14')]);}else{logger[_0x5954('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x1488c3,_0x5954('0xe'));_0xb3c10e(_0x36a3d8['result']['message']);}})[_0x5954('0x15')](function(_0x26f78f){logger[_0x5954('0x12')](_0x5954('0xd'),_0x1488c3,_0x26f78f);_0x418368(_0x26f78f);});});} \ No newline at end of file +var _0x852a=['FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x4016c3,_0x196822){var _0xf2052d=function(_0x1db30c){while(--_0x1db30c){_0x4016c3['push'](_0x4016c3['shift']());}};_0xf2052d(++_0x196822);}(_0x852a,0x1b9));var _0xa852=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x852a[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0xa852('0x0'));var util=require(_0xa852('0x1'));var moment=require(_0xa852('0x2'));var BPromise=require(_0xa852('0x3'));var rs=require(_0xa852('0x4'));var fs=require('fs');var Redis=require(_0xa852('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa852('0x6'));var logger=require(_0xa852('0x7'))(_0xa852('0x8'));var config=require(_0xa852('0x9'));var jayson=require(_0xa852('0xa'));var client=jayson[_0xa852('0xb')][_0xa852('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e045d,_0x305a1a,_0x1bcb7b){return new BPromise(function(_0x5e6b1b,_0x3831bb){return client[_0xa852('0xd')](_0x4e045d,_0x1bcb7b)['then'](function(_0x3c6b75){logger[_0xa852('0xe')](_0xa852('0xf'),_0x305a1a,'request\x20sent');logger[_0xa852('0x10')](_0xa852('0x11'),_0x305a1a,'request\x20sent',JSON[_0xa852('0x12')](_0x3c6b75));if(_0x3c6b75[_0xa852('0x13')]){if(_0x3c6b75[_0xa852('0x13')][_0xa852('0x14')]===0x1f4){logger[_0xa852('0x13')]('FreshdeskField,\x20%s,\x20%s',_0x305a1a,_0x3c6b75[_0xa852('0x13')]['message']);return _0x3831bb(_0x3c6b75[_0xa852('0x13')][_0xa852('0x15')]);}logger[_0xa852('0x13')](_0xa852('0xf'),_0x305a1a,_0x3c6b75[_0xa852('0x13')][_0xa852('0x15')]);return _0x5e6b1b(_0x3c6b75[_0xa852('0x13')][_0xa852('0x15')]);}else{logger[_0xa852('0xe')](_0xa852('0xf'),_0x305a1a,'request\x20sent');_0x5e6b1b(_0x3c6b75[_0xa852('0x16')][_0xa852('0x15')]);}})[_0xa852('0x17')](function(_0x4cee10){logger[_0xa852('0x13')](_0xa852('0xf'),_0x305a1a,_0x4cee10);_0x3831bb(_0x4cee10);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index afaae17..061db50 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 _0xac4a=['show','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','get'];(function(_0x397127,_0x31429d){var _0x1d5516=function(_0x5c557f){while(--_0x5c557f){_0x397127['push'](_0x397127['shift']());}};_0x1d5516(++_0x31429d);}(_0xac4a,0x13f));var _0xaac4=function(_0x5514e8,_0x587b66){_0x5514e8=_0x5514e8-0x0;var _0x798aac=_0xac4a[_0x5514e8];return _0x798aac;};'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['get']('/:id/configurations',auth[_0xaac4('0x9')](),controller['getConfigurations']);router[_0xaac4('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xd')]('/',auth[_0xaac4('0x9')](),controller[_0xaac4('0xe')]);router[_0xaac4('0xd')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xaac4('0xf')]);router[_0xaac4('0x10')](_0xaac4('0x11'),auth['isAuthenticated'](),controller[_0xaac4('0x12')]);router[_0xaac4('0x13')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0x14')]);module[_0xaac4('0x15')]=router; \ No newline at end of file +var _0x5423=['create','post','addConfiguration','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields'];(function(_0x42c7d2,_0x536e9e){var _0x3f5a0f=function(_0x41db58){while(--_0x41db58){_0x42c7d2['push'](_0x42c7d2['shift']());}};_0x3f5a0f(++_0x536e9e);}(_0x5423,0xe3));var _0x3542=function(_0x1ed211,_0x3f5cb2){_0x1ed211=_0x1ed211-0x0;var _0x42a45d=_0x5423[_0x1ed211];return _0x42a45d;};'use strict';var multer=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var path=require('path');var timeout=require(_0x3542('0x2'));var express=require(_0x3542('0x3'));var router=express['Router']();var fs_extra=require(_0x3542('0x4'));var auth=require(_0x3542('0x5'));var interaction=require(_0x3542('0x6'));var config=require(_0x3542('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x3542('0x8')]('/',auth[_0x3542('0x9')](),controller[_0x3542('0xa')]);router[_0x3542('0x8')](_0x3542('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x3542('0x8')](_0x3542('0xc'),auth['isAuthenticated'](),controller[_0x3542('0xd')]);router[_0x3542('0x8')]('/:id/fields',auth[_0x3542('0x9')](),controller[_0x3542('0xe')]);router['post']('/',auth[_0x3542('0x9')](),controller[_0x3542('0xf')]);router[_0x3542('0x10')](_0x3542('0xc'),auth[_0x3542('0x9')](),controller[_0x3542('0x11')]);router[_0x3542('0x12')](_0x3542('0xb'),auth[_0x3542('0x9')](),controller[_0x3542('0x13')]);router[_0x3542('0x14')](_0x3542('0xb'),auth[_0x3542('0x9')](),controller['destroy']);module[_0x3542('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 4b22c36..279c002 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 _0xb44a=['STRING'];(function(_0x1ce4d1,_0xea0bcb){var _0x1b270e=function(_0x584e49){while(--_0x584e49){_0x1ce4d1['push'](_0x1ce4d1['shift']());}};_0x1b270e(++_0xea0bcb);}(_0xb44a,0x1c2));var _0xab44=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0xb44a[_0x5c2e5e];return _0x46a5da;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xab44('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xab44('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xab44('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xab44('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x8e3f=['STRING','username','remoteUri','sequelize','exports'];(function(_0x80e5b5,_0x1a4219){var _0x36d3b1=function(_0x2d72cc){while(--_0x2d72cc){_0x80e5b5['push'](_0x80e5b5['shift']());}};_0x36d3b1(++_0x1a4219);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e3f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xf8e3('0x0'));module[_0xf8e3('0x1')]={'name':{'type':Sequelize[_0xf8e3('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf8e3('0x2')],'unique':_0xf8e3('0x3')},'apiKey':{'type':Sequelize[_0xf8e3('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xf8e3('0x4')},'serverUrl':{'type':Sequelize[_0xf8e3('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 ba62c7d..e51e95f 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 _0xf4d9=['status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','FreshsalesAccount','include','rows','catch','params','keys','intersection','includeAll','find','create','body','findOne','getConfigurations','addConfiguration','Subjects','getSubjects','channel','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','apiKey','remoteUri','substring','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus'];(function(_0x23eac7,_0x4e3e16){var _0x101eab=function(_0x3dd808){while(--_0x3dd808){_0x23eac7['push'](_0x23eac7['shift']());}};_0x101eab(++_0x4e3e16);}(_0xf4d9,0xae));var _0x9f4d=function(_0xf25015,_0x1a3392){_0xf25015=_0xf25015-0x0;var _0xdedbc0=_0xf4d9[_0xf25015];return _0xdedbc0;};'use strict';var emlformat=require(_0x9f4d('0x0'));var rimraf=require(_0x9f4d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9f4d('0x2'));var moment=require(_0x9f4d('0x3'));var BPromise=require(_0x9f4d('0x4'));var Mustache=require(_0x9f4d('0x5'));var util=require('util');var path=require(_0x9f4d('0x6'));var sox=require(_0x9f4d('0x7'));var csv=require(_0x9f4d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9f4d('0x9'));var deskjs=require(_0x9f4d('0xa'));var toCsv=require('to-csv');var querystring=require(_0x9f4d('0xb'));var Papa=require('papaparse');var Redis=require(_0x9f4d('0xc'));var authService=require(_0x9f4d('0xd'));var qs=require(_0x9f4d('0xe'));var as=require(_0x9f4d('0xf'));var hardwareService=require(_0x9f4d('0x10'));var logger=require(_0x9f4d('0x11'))(_0x9f4d('0x12'));var utils=require(_0x9f4d('0x13'));var config=require(_0x9f4d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f4d('0x15'))['db'];var integrations=require(_0x9f4d('0x16'));function respondWithStatusCode(_0x2bb486,_0x47eca0){_0x47eca0=_0x47eca0||0xcc;return function(_0x213fbc){if(_0x213fbc){return _0x2bb486[_0x9f4d('0x17')](_0x47eca0);}return _0x2bb486[_0x9f4d('0x18')](_0x47eca0)[_0x9f4d('0x19')]();};}function respondWithResult(_0xd90a60,_0x59a524){_0x59a524=_0x59a524||0xc8;return function(_0x443d7b){if(_0x443d7b){return _0xd90a60[_0x9f4d('0x18')](_0x59a524)[_0x9f4d('0x1a')](_0x443d7b);}};}function respondWithFilteredResult(_0x4d20ed,_0x233521){return function(_0x449a50){if(_0x449a50){var _0xca3c0e=typeof _0x233521['offset']===_0x9f4d('0x1b')&&typeof _0x233521[_0x9f4d('0x1c')]===_0x9f4d('0x1b');var _0x205d97=_0x449a50[_0x9f4d('0x1d')];var _0x58767b=_0xca3c0e?0x0:_0x233521[_0x9f4d('0x1e')];var _0x2a247f=_0xca3c0e?_0x449a50[_0x9f4d('0x1d')]:_0x233521['offset']+_0x233521[_0x9f4d('0x1c')];var _0x312cc9;if(_0x2a247f>=_0x205d97){_0x2a247f=_0x205d97;_0x312cc9=0xc8;}else{_0x312cc9=0xce;}_0x4d20ed[_0x9f4d('0x18')](_0x312cc9);return _0x4d20ed[_0x9f4d('0x1f')]('Content-Range',_0x58767b+'-'+_0x2a247f+'/'+_0x205d97)[_0x9f4d('0x1a')](_0x449a50);}return null;};}function patchUpdates(_0x4ddf4a){return function(_0x3a46fb){try{jsonpatch[_0x9f4d('0x20')](_0x3a46fb,_0x4ddf4a,!![]);}catch(_0x1ef70a){return BPromise[_0x9f4d('0x21')](_0x1ef70a);}return _0x3a46fb[_0x9f4d('0x22')]();};}function saveUpdates(_0x4bc276,_0x359e99){return function(_0x56cc0f){if(_0x56cc0f){return _0x56cc0f[_0x9f4d('0x23')](_0x4bc276)[_0x9f4d('0x24')](function(_0x421dee){return _0x421dee;});}return null;};}function removeEntity(_0x1a377a,_0x41a14b){return function(_0x5821f1){if(_0x5821f1){return _0x5821f1[_0x9f4d('0x25')]()['then'](function(){_0x1a377a[_0x9f4d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aa045,_0x4478f6){return function(_0x2e7e08){if(!_0x2e7e08){_0x4aa045[_0x9f4d('0x17')](0x194);}return _0x2e7e08;};}function handleError(_0x21d651,_0x2dc20a){_0x2dc20a=_0x2dc20a||0x1f4;return function(_0x2cfcfe){logger[_0x9f4d('0x26')](_0x2cfcfe['stack']);if(_0x2cfcfe[_0x9f4d('0x27')]){delete _0x2cfcfe[_0x9f4d('0x27')];}_0x21d651['status'](_0x2dc20a)[_0x9f4d('0x28')](_0x2cfcfe);};}exports[_0x9f4d('0x29')]=function(_0x49c89b,_0x2970a0){var _0x5297a0={},_0x405568={},_0x3ad84b={'count':0x0,'rows':[]};var _0xfc9842=_[_0x9f4d('0x2a')](db['FreshsalesAccount'][_0x9f4d('0x2b')],function(_0x10b97f){return{'name':_0x10b97f['fieldName'],'type':_0x10b97f[_0x9f4d('0x2c')][_0x9f4d('0x2d')]};});_0x405568[_0x9f4d('0x2e')]=_[_0x9f4d('0x2a')](_0xfc9842,_0x9f4d('0x27'));_0x405568['query']=_['keys'](_0x49c89b[_0x9f4d('0x2f')]);_0x405568[_0x9f4d('0x30')]=_['intersection'](_0x405568[_0x9f4d('0x2e')],_0x405568[_0x9f4d('0x2f')]);_0x5297a0[_0x9f4d('0x31')]=_['intersection'](_0x405568[_0x9f4d('0x2e')],qs['fields'](_0x49c89b[_0x9f4d('0x2f')][_0x9f4d('0x32')]));_0x5297a0[_0x9f4d('0x31')]=_0x5297a0[_0x9f4d('0x31')][_0x9f4d('0x33')]?_0x5297a0['attributes']:_0x405568[_0x9f4d('0x2e')];if(!_0x49c89b['query'][_0x9f4d('0x34')](_0x9f4d('0x35'))){_0x5297a0[_0x9f4d('0x1c')]=qs[_0x9f4d('0x1c')](_0x49c89b[_0x9f4d('0x2f')][_0x9f4d('0x1c')]);_0x5297a0['offset']=qs[_0x9f4d('0x1e')](_0x49c89b[_0x9f4d('0x2f')]['offset']);}_0x5297a0[_0x9f4d('0x36')]=qs['sort'](_0x49c89b[_0x9f4d('0x2f')][_0x9f4d('0x37')]);_0x5297a0['where']=qs[_0x9f4d('0x30')](_[_0x9f4d('0x38')](_0x49c89b[_0x9f4d('0x2f')],_0x405568[_0x9f4d('0x30')]),_0xfc9842);if(_0x49c89b[_0x9f4d('0x2f')][_0x9f4d('0x39')]){_0x5297a0[_0x9f4d('0x3a')]=_[_0x9f4d('0x3b')](_0x5297a0[_0x9f4d('0x3a')],{'$or':_[_0x9f4d('0x2a')](_0xfc9842,function(_0x456c74){if(_0x456c74[_0x9f4d('0x2c')]!==_0x9f4d('0x3c')){var _0x2aa413={};_0x2aa413[_0x456c74[_0x9f4d('0x27')]]={'$like':'%'+_0x49c89b[_0x9f4d('0x2f')][_0x9f4d('0x39')]+'%'};return _0x2aa413;}})});}_0x5297a0=_[_0x9f4d('0x3b')]({},_0x5297a0,_0x49c89b[_0x9f4d('0x3d')]);var _0x171c8f={'where':_0x5297a0['where']};return db[_0x9f4d('0x3e')][_0x9f4d('0x1d')](_0x171c8f)[_0x9f4d('0x24')](function(_0x4f7090){_0x3ad84b[_0x9f4d('0x1d')]=_0x4f7090;if(_0x49c89b[_0x9f4d('0x2f')]['includeAll']){_0x5297a0[_0x9f4d('0x3f')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x5297a0);})[_0x9f4d('0x24')](function(_0x2da315){_0x3ad84b[_0x9f4d('0x40')]=_0x2da315;return _0x3ad84b;})[_0x9f4d('0x24')](respondWithFilteredResult(_0x2970a0,_0x5297a0))[_0x9f4d('0x41')](handleError(_0x2970a0,null));};exports['show']=function(_0x1e94de,_0x421cc5){var _0x3cba81={'raw':![],'where':{'id':_0x1e94de[_0x9f4d('0x42')]['id']}},_0x47b2ab={};_0x47b2ab['model']=_['keys'](db[_0x9f4d('0x3e')]['rawAttributes']);_0x47b2ab['query']=_[_0x9f4d('0x43')](_0x1e94de[_0x9f4d('0x2f')]);_0x47b2ab['filters']=_['intersection'](_0x47b2ab[_0x9f4d('0x2e')],_0x47b2ab['query']);_0x3cba81[_0x9f4d('0x31')]=_[_0x9f4d('0x44')](_0x47b2ab['model'],qs[_0x9f4d('0x32')](_0x1e94de[_0x9f4d('0x2f')][_0x9f4d('0x32')]));_0x3cba81['attributes']=_0x3cba81[_0x9f4d('0x31')][_0x9f4d('0x33')]?_0x3cba81['attributes']:_0x47b2ab[_0x9f4d('0x2e')];if(_0x1e94de[_0x9f4d('0x2f')][_0x9f4d('0x45')]){_0x3cba81[_0x9f4d('0x3f')]=[{'all':!![]}];}_0x3cba81=_[_0x9f4d('0x3b')]({},_0x3cba81,_0x1e94de[_0x9f4d('0x3d')]);return db['FreshsalesAccount'][_0x9f4d('0x46')](_0x3cba81)['then'](handleEntityNotFound(_0x421cc5,null))[_0x9f4d('0x24')](respondWithResult(_0x421cc5,null))[_0x9f4d('0x41')](handleError(_0x421cc5,null));};exports[_0x9f4d('0x47')]=function(_0x1cc7ad,_0x26b312){return db[_0x9f4d('0x3e')]['create'](_0x1cc7ad[_0x9f4d('0x48')],{})['then'](respondWithResult(_0x26b312,0xc9))[_0x9f4d('0x41')](handleError(_0x26b312,null));};exports[_0x9f4d('0x23')]=function(_0x256850,_0x2c9bd8){if(_0x256850['body']['id']){delete _0x256850[_0x9f4d('0x48')]['id'];}return db[_0x9f4d('0x3e')][_0x9f4d('0x46')]({'where':{'id':_0x256850[_0x9f4d('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c9bd8,null))[_0x9f4d('0x24')](saveUpdates(_0x256850['body'],null))[_0x9f4d('0x24')](respondWithResult(_0x2c9bd8,null))[_0x9f4d('0x41')](handleError(_0x2c9bd8,null));};exports[_0x9f4d('0x25')]=function(_0x3752d6,_0x2940a8){return db[_0x9f4d('0x3e')]['find']({'where':{'id':_0x3752d6[_0x9f4d('0x42')]['id']}})[_0x9f4d('0x24')](handleEntityNotFound(_0x2940a8,null))[_0x9f4d('0x24')](removeEntity(_0x2940a8,null))['catch'](handleError(_0x2940a8,null));};exports['getConfigurations']=function(_0x56a671,_0x140619,_0x2050dd){var _0x58cf7d={};var _0x20a89e={};var _0x465c0c;var _0x1de437;return db[_0x9f4d('0x3e')][_0x9f4d('0x49')]({'where':{'id':_0x56a671[_0x9f4d('0x42')]['id']}})[_0x9f4d('0x24')](handleEntityNotFound(_0x140619,null))[_0x9f4d('0x24')](function(_0x555c9f){if(_0x555c9f){_0x465c0c=_0x555c9f;_0x20a89e[_0x9f4d('0x2e')]=_[_0x9f4d('0x43')](db['FreshsalesConfiguration'][_0x9f4d('0x2b')]);_0x20a89e[_0x9f4d('0x2f')]=_[_0x9f4d('0x43')](_0x56a671[_0x9f4d('0x2f')]);_0x20a89e[_0x9f4d('0x30')]=_['intersection'](_0x20a89e[_0x9f4d('0x2e')],_0x20a89e['query']);_0x58cf7d['attributes']=_[_0x9f4d('0x44')](_0x20a89e[_0x9f4d('0x2e')],qs[_0x9f4d('0x32')](_0x56a671[_0x9f4d('0x2f')][_0x9f4d('0x32')]));_0x58cf7d[_0x9f4d('0x31')]=_0x58cf7d[_0x9f4d('0x31')][_0x9f4d('0x33')]?_0x58cf7d[_0x9f4d('0x31')]:_0x20a89e['model'];_0x58cf7d[_0x9f4d('0x36')]=qs['sort'](_0x56a671['query'][_0x9f4d('0x37')]);_0x58cf7d[_0x9f4d('0x3a')]=qs[_0x9f4d('0x30')](_[_0x9f4d('0x38')](_0x56a671['query'],_0x20a89e['filters']));if(_0x56a671[_0x9f4d('0x2f')][_0x9f4d('0x39')]){_0x58cf7d[_0x9f4d('0x3a')]=_['merge'](_0x58cf7d[_0x9f4d('0x3a')],{'$or':_['map'](_0x58cf7d[_0x9f4d('0x31')],function(_0x484d58){var _0x5da7c9={};_0x5da7c9[_0x484d58]={'$like':'%'+_0x56a671[_0x9f4d('0x2f')]['filter']+'%'};return _0x5da7c9;})});}_0x58cf7d=_['merge']({},_0x58cf7d,_0x56a671['options']);return _0x465c0c[_0x9f4d('0x4a')](_0x58cf7d);}})[_0x9f4d('0x24')](function(_0x38ac87){if(_0x38ac87){_0x1de437=_0x38ac87['length'];if(!_0x56a671[_0x9f4d('0x2f')][_0x9f4d('0x34')](_0x9f4d('0x35'))){_0x58cf7d[_0x9f4d('0x1c')]=qs['limit'](_0x56a671[_0x9f4d('0x2f')][_0x9f4d('0x1c')]);_0x58cf7d[_0x9f4d('0x1e')]=qs[_0x9f4d('0x1e')](_0x56a671[_0x9f4d('0x2f')][_0x9f4d('0x1e')]);}return _0x465c0c[_0x9f4d('0x4a')](_0x58cf7d);}})['then'](function(_0x5b7405){if(_0x5b7405){return _0x5b7405?{'count':_0x1de437,'rows':_0x5b7405}:null;}})['then'](respondWithResult(_0x140619,null))[_0x9f4d('0x41')](handleError(_0x140619,null));};exports[_0x9f4d('0x4b')]=function(_0x3718d5,_0x137fb3,_0x52a851){if(_0x3718d5[_0x9f4d('0x48')]['id']){delete _0x3718d5['body']['id'];}return db[_0x9f4d('0x3e')][_0x9f4d('0x49')]({'where':{'id':_0x3718d5[_0x9f4d('0x42')]['id']}})[_0x9f4d('0x24')](handleEntityNotFound(_0x137fb3,null))[_0x9f4d('0x24')](function(_0x372504){if(_0x372504){_0x3718d5['body']['AccountId']=_0x372504['id'];_0x3718d5[_0x9f4d('0x48')][_0x9f4d('0x4c')]=integrations[_0x9f4d('0x4d')](_0x3718d5[_0x9f4d('0x48')][_0x9f4d('0x4e')],_0x3718d5[_0x9f4d('0x48')]['type']);_0x3718d5[_0x9f4d('0x48')]['Descriptions']=integrations[_0x9f4d('0x4f')](_0x3718d5[_0x9f4d('0x48')]['channel'],_0x3718d5[_0x9f4d('0x48')]['type']);return db[_0x9f4d('0x50')][_0x9f4d('0x47')](_0x3718d5[_0x9f4d('0x48')],{'include':[{'model':db[_0x9f4d('0x51')],'as':_0x9f4d('0x4c')},{'model':db[_0x9f4d('0x51')],'as':'Descriptions'}]});}return null;})[_0x9f4d('0x24')](respondWithResult(_0x137fb3,null))['catch'](handleError(_0x137fb3,null));};exports[_0x9f4d('0x52')]=function(_0x4265fb,_0x7cdc92,_0x5e287b){var _0x11a132='';var _0x3ee112='';return db[_0x9f4d('0x3e')][_0x9f4d('0x49')]({'where':{'id':_0x4265fb['params']['id']},'attributes':['id',_0x9f4d('0x53'),'remoteUri',_0x9f4d('0x54')]})['then'](handleEntityNotFound(_0x7cdc92,null))['then'](function(_0x45d93f){if(_0x45d93f){_0x3ee112=_0x45d93f['username'];_0x11a132=_0x45d93f['remoteUri'];var _0x26860=_0x45d93f[_0x9f4d('0x55')]['slice'](-0x1);if(_0x26860==='/'){_0x11a132=_0x11a132[_0x9f4d('0x56')](0x0,_0x11a132['lastIndexOf'](_0x26860));}return rp({'method':_0x9f4d('0x57'),'uri':util[_0x9f4d('0x58')](_0x9f4d('0x59'),_0x11a132,_0x9f4d('0x5a')),'headers':{'Authorization':_0x9f4d('0x5b')+_0x45d93f[_0x9f4d('0x54')]},'json':!![]});}})[_0x9f4d('0x24')](function(_0xd751bd){if(_0xd751bd){var _0x4f08d3=_0xd751bd[_0x9f4d('0x5c')];var _0x4d40f1=![];var _0x815331=null;for(_0x815331=0x0;_0x815331<_0x4f08d3['length'];_0x815331++){if(_0x4f08d3[_0x815331][_0x9f4d('0x5d')]===_0x3ee112){_0x4d40f1=!![];}}if(_0x4d40f1){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x9f4d('0x5e')});}}})[_0x9f4d('0x24')](respondWithResult(_0x7cdc92,null))['catch'](function(_0x6673bd){var _0x6302cf=_0x4265fb[_0x9f4d('0x2f')][_0x9f4d('0x5f')]?0x1f4:_0x6673bd[_0x9f4d('0x60')]||0x1f4;logger[_0x9f4d('0x26')](_0x9f4d('0x61'),_0x9f4d('0x52'),_0x6302cf,JSON['stringify'](_0x6673bd));delete _0x6673bd['name'];if(_0x6302cf===0x191){_0x6302cf=0x190;}_0x7cdc92['status'](_0x6302cf)[_0x9f4d('0x28')](_0x4265fb[_0x9f4d('0x2f')][_0x9f4d('0x5f')]?{'message':_0x9f4d('0x62'),'statusCode':_0x6673bd[_0x9f4d('0x60')]}:_0x6673bd);});}; \ No newline at end of file +var _0xa712=['FreshsalesField','username','remoteUri','apiKey','lastIndexOf','GET','format','/api/selector/owners','Token\x20token=','users','test','statusCode','getFields','stringify','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','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','save','destroy','error','stack','send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','VIRTUAL','name','filter','options','then','includeAll','FreshsalesAccount','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','rawAttributes','where','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xa712,0x140));var _0x2a71=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa712[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2a71('0x0'));var zipdir=require(_0x2a71('0x1'));var jsonpatch=require(_0x2a71('0x2'));var rp=require('request-promise');var moment=require(_0x2a71('0x3'));var BPromise=require(_0x2a71('0x4'));var Mustache=require(_0x2a71('0x5'));var util=require(_0x2a71('0x6'));var path=require(_0x2a71('0x7'));var sox=require(_0x2a71('0x8'));var csv=require(_0x2a71('0x9'));var ejs=require(_0x2a71('0xa'));var fs=require('fs');var fs_extra=require(_0x2a71('0xb'));var _=require('lodash');var squel=require(_0x2a71('0xc'));var crypto=require('crypto');var jsforce=require(_0x2a71('0xd'));var deskjs=require(_0x2a71('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2a71('0xf'));var Papa=require(_0x2a71('0x10'));var Redis=require(_0x2a71('0x11'));var authService=require(_0x2a71('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2a71('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a71('0x14'))(_0x2a71('0x15'));var utils=require(_0x2a71('0x16'));var config=require(_0x2a71('0x17'));var licenseUtil=require(_0x2a71('0x18'));var db=require(_0x2a71('0x19'))['db'];var integrations=require(_0x2a71('0x1a'));function respondWithStatusCode(_0x16a27b,_0x1facb8){_0x1facb8=_0x1facb8||0xcc;return function(_0x141f36){if(_0x141f36){return _0x16a27b[_0x2a71('0x1b')](_0x1facb8);}return _0x16a27b[_0x2a71('0x1c')](_0x1facb8)[_0x2a71('0x1d')]();};}function respondWithResult(_0x57e085,_0x4aab28){_0x4aab28=_0x4aab28||0xc8;return function(_0x15d499){if(_0x15d499){return _0x57e085[_0x2a71('0x1c')](_0x4aab28)[_0x2a71('0x1e')](_0x15d499);}};}function respondWithFilteredResult(_0x18215e,_0x2c2968){return function(_0x13b099){if(_0x13b099){var _0x1f4319=typeof _0x2c2968[_0x2a71('0x1f')]===_0x2a71('0x20')&&typeof _0x2c2968[_0x2a71('0x21')]==='undefined';var _0x5efa04=_0x13b099[_0x2a71('0x22')];var _0x2cc6ab=_0x1f4319?0x0:_0x2c2968[_0x2a71('0x1f')];var _0x10668a=_0x1f4319?_0x13b099[_0x2a71('0x22')]:_0x2c2968[_0x2a71('0x1f')]+_0x2c2968[_0x2a71('0x21')];var _0x59fd94;if(_0x10668a>=_0x5efa04){_0x10668a=_0x5efa04;_0x59fd94=0xc8;}else{_0x59fd94=0xce;}_0x18215e[_0x2a71('0x1c')](_0x59fd94);return _0x18215e[_0x2a71('0x23')](_0x2a71('0x24'),_0x2cc6ab+'-'+_0x10668a+'/'+_0x5efa04)[_0x2a71('0x1e')](_0x13b099);}return null;};}function patchUpdates(_0x5e8823){return function(_0x4b3056){try{jsonpatch[_0x2a71('0x25')](_0x4b3056,_0x5e8823,!![]);}catch(_0x51f65f){return BPromise[_0x2a71('0x26')](_0x51f65f);}return _0x4b3056[_0x2a71('0x27')]();};}function saveUpdates(_0x27255,_0x1437fc){return function(_0x22b000){if(_0x22b000){return _0x22b000['update'](_0x27255)['then'](function(_0x114059){return _0x114059;});}return null;};}function removeEntity(_0x963884,_0x24b781){return function(_0x230b40){if(_0x230b40){return _0x230b40[_0x2a71('0x28')]()['then'](function(){_0x963884['status'](0xcc)[_0x2a71('0x1d')]();});}};}function handleEntityNotFound(_0x45c2b9,_0x2f75f7){return function(_0xed60dd){if(!_0xed60dd){_0x45c2b9[_0x2a71('0x1b')](0x194);}return _0xed60dd;};}function handleError(_0x4298ed,_0x218a2){_0x218a2=_0x218a2||0x1f4;return function(_0xa5a643){logger[_0x2a71('0x29')](_0xa5a643[_0x2a71('0x2a')]);if(_0xa5a643['name']){delete _0xa5a643['name'];}_0x4298ed['status'](_0x218a2)[_0x2a71('0x2b')](_0xa5a643);};}exports[_0x2a71('0x2c')]=function(_0x11a3b5,_0x5ea84f){var _0x2e957a={},_0x3e8969={},_0x5c9402={'count':0x0,'rows':[]};var _0x5ed4bf=_[_0x2a71('0x2d')](db['FreshsalesAccount']['rawAttributes'],function(_0x459f03){return{'name':_0x459f03['fieldName'],'type':_0x459f03[_0x2a71('0x2e')][_0x2a71('0x2f')]};});_0x3e8969[_0x2a71('0x30')]=_[_0x2a71('0x2d')](_0x5ed4bf,'name');_0x3e8969[_0x2a71('0x31')]=_[_0x2a71('0x32')](_0x11a3b5[_0x2a71('0x31')]);_0x3e8969[_0x2a71('0x33')]=_[_0x2a71('0x34')](_0x3e8969[_0x2a71('0x30')],_0x3e8969[_0x2a71('0x31')]);_0x2e957a[_0x2a71('0x35')]=_[_0x2a71('0x34')](_0x3e8969['model'],qs['fields'](_0x11a3b5[_0x2a71('0x31')][_0x2a71('0x36')]));_0x2e957a['attributes']=_0x2e957a[_0x2a71('0x35')][_0x2a71('0x37')]?_0x2e957a[_0x2a71('0x35')]:_0x3e8969[_0x2a71('0x30')];if(!_0x11a3b5[_0x2a71('0x31')][_0x2a71('0x38')](_0x2a71('0x39'))){_0x2e957a[_0x2a71('0x21')]=qs[_0x2a71('0x21')](_0x11a3b5[_0x2a71('0x31')][_0x2a71('0x21')]);_0x2e957a['offset']=qs['offset'](_0x11a3b5[_0x2a71('0x31')][_0x2a71('0x1f')]);}_0x2e957a['order']=qs[_0x2a71('0x3a')](_0x11a3b5[_0x2a71('0x31')]['sort']);_0x2e957a['where']=qs[_0x2a71('0x33')](_[_0x2a71('0x3b')](_0x11a3b5[_0x2a71('0x31')],_0x3e8969[_0x2a71('0x33')]),_0x5ed4bf);if(_0x11a3b5[_0x2a71('0x31')]['filter']){_0x2e957a['where']=_[_0x2a71('0x3c')](_0x2e957a['where'],{'$or':_['map'](_0x5ed4bf,function(_0x1ddefa){if(_0x1ddefa[_0x2a71('0x2e')]!==_0x2a71('0x3d')){var _0x2651c7={};_0x2651c7[_0x1ddefa[_0x2a71('0x3e')]]={'$like':'%'+_0x11a3b5['query'][_0x2a71('0x3f')]+'%'};return _0x2651c7;}})});}_0x2e957a=_[_0x2a71('0x3c')]({},_0x2e957a,_0x11a3b5[_0x2a71('0x40')]);var _0x55cc44={'where':_0x2e957a['where']};return db['FreshsalesAccount'][_0x2a71('0x22')](_0x55cc44)[_0x2a71('0x41')](function(_0x1b1652){_0x5c9402[_0x2a71('0x22')]=_0x1b1652;if(_0x11a3b5[_0x2a71('0x31')][_0x2a71('0x42')]){_0x2e957a['include']=[{'all':!![]}];}return db[_0x2a71('0x43')][_0x2a71('0x44')](_0x2e957a);})[_0x2a71('0x41')](function(_0x19ee39){_0x5c9402[_0x2a71('0x45')]=_0x19ee39;return _0x5c9402;})[_0x2a71('0x41')](respondWithFilteredResult(_0x5ea84f,_0x2e957a))[_0x2a71('0x46')](handleError(_0x5ea84f,null));};exports[_0x2a71('0x47')]=function(_0x4d0b0d,_0x2f46b1){var _0x50f515={'raw':![],'where':{'id':_0x4d0b0d[_0x2a71('0x48')]['id']}},_0x60c513={};_0x60c513[_0x2a71('0x30')]=_[_0x2a71('0x32')](db[_0x2a71('0x43')]['rawAttributes']);_0x60c513['query']=_['keys'](_0x4d0b0d[_0x2a71('0x31')]);_0x60c513[_0x2a71('0x33')]=_[_0x2a71('0x34')](_0x60c513['model'],_0x60c513[_0x2a71('0x31')]);_0x50f515[_0x2a71('0x35')]=_[_0x2a71('0x34')](_0x60c513[_0x2a71('0x30')],qs['fields'](_0x4d0b0d[_0x2a71('0x31')][_0x2a71('0x36')]));_0x50f515[_0x2a71('0x35')]=_0x50f515[_0x2a71('0x35')][_0x2a71('0x37')]?_0x50f515[_0x2a71('0x35')]:_0x60c513[_0x2a71('0x30')];if(_0x4d0b0d[_0x2a71('0x31')][_0x2a71('0x42')]){_0x50f515['include']=[{'all':!![]}];}_0x50f515=_[_0x2a71('0x3c')]({},_0x50f515,_0x4d0b0d[_0x2a71('0x40')]);return db['FreshsalesAccount'][_0x2a71('0x49')](_0x50f515)['then'](handleEntityNotFound(_0x2f46b1,null))[_0x2a71('0x41')](respondWithResult(_0x2f46b1,null))[_0x2a71('0x46')](handleError(_0x2f46b1,null));};exports[_0x2a71('0x4a')]=function(_0x2042cd,_0x4a7c17){return db['FreshsalesAccount'][_0x2a71('0x4a')](_0x2042cd[_0x2a71('0x4b')],{})[_0x2a71('0x41')](respondWithResult(_0x4a7c17,0xc9))[_0x2a71('0x46')](handleError(_0x4a7c17,null));};exports['update']=function(_0x5532ff,_0xd29cd1){if(_0x5532ff['body']['id']){delete _0x5532ff[_0x2a71('0x4b')]['id'];}return db[_0x2a71('0x43')][_0x2a71('0x49')]({'where':{'id':_0x5532ff[_0x2a71('0x48')]['id']}})['then'](handleEntityNotFound(_0xd29cd1,null))[_0x2a71('0x41')](saveUpdates(_0x5532ff[_0x2a71('0x4b')],null))[_0x2a71('0x41')](respondWithResult(_0xd29cd1,null))[_0x2a71('0x46')](handleError(_0xd29cd1,null));};exports['destroy']=function(_0x522d61,_0x2691db){return db[_0x2a71('0x43')]['find']({'where':{'id':_0x522d61[_0x2a71('0x48')]['id']}})[_0x2a71('0x41')](handleEntityNotFound(_0x2691db,null))[_0x2a71('0x41')](removeEntity(_0x2691db,null))['catch'](handleError(_0x2691db,null));};exports[_0x2a71('0x4c')]=function(_0x53a50b,_0x16e9f6,_0x39f689){var _0xc8784d={};var _0x3218c3={};var _0xe1b667;var _0x5353b2;return db[_0x2a71('0x43')][_0x2a71('0x4d')]({'where':{'id':_0x53a50b['params']['id']}})['then'](handleEntityNotFound(_0x16e9f6,null))[_0x2a71('0x41')](function(_0x5d27b2){if(_0x5d27b2){_0xe1b667=_0x5d27b2;_0x3218c3[_0x2a71('0x30')]=_['keys'](db['FreshsalesConfiguration'][_0x2a71('0x4e')]);_0x3218c3[_0x2a71('0x31')]=_[_0x2a71('0x32')](_0x53a50b[_0x2a71('0x31')]);_0x3218c3[_0x2a71('0x33')]=_[_0x2a71('0x34')](_0x3218c3[_0x2a71('0x30')],_0x3218c3[_0x2a71('0x31')]);_0xc8784d[_0x2a71('0x35')]=_['intersection'](_0x3218c3[_0x2a71('0x30')],qs[_0x2a71('0x36')](_0x53a50b[_0x2a71('0x31')]['fields']));_0xc8784d[_0x2a71('0x35')]=_0xc8784d[_0x2a71('0x35')][_0x2a71('0x37')]?_0xc8784d[_0x2a71('0x35')]:_0x3218c3[_0x2a71('0x30')];_0xc8784d['order']=qs[_0x2a71('0x3a')](_0x53a50b['query'][_0x2a71('0x3a')]);_0xc8784d[_0x2a71('0x4f')]=qs[_0x2a71('0x33')](_['pick'](_0x53a50b['query'],_0x3218c3[_0x2a71('0x33')]));if(_0x53a50b[_0x2a71('0x31')]['filter']){_0xc8784d[_0x2a71('0x4f')]=_[_0x2a71('0x3c')](_0xc8784d[_0x2a71('0x4f')],{'$or':_[_0x2a71('0x2d')](_0xc8784d['attributes'],function(_0x1be9bb){var _0x4098d1={};_0x4098d1[_0x1be9bb]={'$like':'%'+_0x53a50b[_0x2a71('0x31')]['filter']+'%'};return _0x4098d1;})});}_0xc8784d=_['merge']({},_0xc8784d,_0x53a50b[_0x2a71('0x40')]);return _0xe1b667[_0x2a71('0x4c')](_0xc8784d);}})[_0x2a71('0x41')](function(_0x579ee5){if(_0x579ee5){_0x5353b2=_0x579ee5[_0x2a71('0x37')];if(!_0x53a50b[_0x2a71('0x31')][_0x2a71('0x38')](_0x2a71('0x39'))){_0xc8784d[_0x2a71('0x21')]=qs[_0x2a71('0x21')](_0x53a50b[_0x2a71('0x31')]['limit']);_0xc8784d['offset']=qs[_0x2a71('0x1f')](_0x53a50b[_0x2a71('0x31')][_0x2a71('0x1f')]);}return _0xe1b667['getConfigurations'](_0xc8784d);}})[_0x2a71('0x41')](function(_0x57ddf6){if(_0x57ddf6){return _0x57ddf6?{'count':_0x5353b2,'rows':_0x57ddf6}:null;}})[_0x2a71('0x41')](respondWithResult(_0x16e9f6,null))[_0x2a71('0x46')](handleError(_0x16e9f6,null));};exports[_0x2a71('0x50')]=function(_0x391add,_0x23731e,_0x3730dd){if(_0x391add[_0x2a71('0x4b')]['id']){delete _0x391add[_0x2a71('0x4b')]['id'];}return db[_0x2a71('0x43')]['findOne']({'where':{'id':_0x391add['params']['id']}})[_0x2a71('0x41')](handleEntityNotFound(_0x23731e,null))['then'](function(_0x53d78b){if(_0x53d78b){_0x391add[_0x2a71('0x4b')][_0x2a71('0x51')]=_0x53d78b['id'];_0x391add[_0x2a71('0x4b')][_0x2a71('0x52')]=integrations[_0x2a71('0x53')](_0x391add[_0x2a71('0x4b')][_0x2a71('0x54')],_0x391add[_0x2a71('0x4b')]['type']);_0x391add['body'][_0x2a71('0x55')]=integrations[_0x2a71('0x56')](_0x391add[_0x2a71('0x4b')][_0x2a71('0x54')],_0x391add[_0x2a71('0x4b')][_0x2a71('0x2e')]);return db[_0x2a71('0x57')][_0x2a71('0x4a')](_0x391add[_0x2a71('0x4b')],{'include':[{'model':db[_0x2a71('0x58')],'as':'Subjects'},{'model':db[_0x2a71('0x58')],'as':_0x2a71('0x55')}]});}return null;})[_0x2a71('0x41')](respondWithResult(_0x23731e,null))[_0x2a71('0x46')](handleError(_0x23731e,null));};exports['getFields']=function(_0x1ade01,_0xcdd2f5,_0x2d39b5){var _0x5ec06a='';var _0x22cde0='';return db[_0x2a71('0x43')][_0x2a71('0x4d')]({'where':{'id':_0x1ade01[_0x2a71('0x48')]['id']},'attributes':['id',_0x2a71('0x59'),_0x2a71('0x5a'),_0x2a71('0x5b')]})['then'](handleEntityNotFound(_0xcdd2f5,null))[_0x2a71('0x41')](function(_0x3ba76e){if(_0x3ba76e){_0x22cde0=_0x3ba76e[_0x2a71('0x59')];_0x5ec06a=_0x3ba76e['remoteUri'];var _0x2bb4a6=_0x3ba76e[_0x2a71('0x5a')]['slice'](-0x1);if(_0x2bb4a6==='/'){_0x5ec06a=_0x5ec06a['substring'](0x0,_0x5ec06a[_0x2a71('0x5c')](_0x2bb4a6));}return rp({'method':_0x2a71('0x5d'),'uri':util[_0x2a71('0x5e')]('%s%s',_0x5ec06a,_0x2a71('0x5f')),'headers':{'Authorization':_0x2a71('0x60')+_0x3ba76e[_0x2a71('0x5b')]},'json':!![]});}})[_0x2a71('0x41')](function(_0x20b81e){if(_0x20b81e){var _0x291871=_0x20b81e[_0x2a71('0x61')];var _0xad14f2=![];var _0xd91172=null;for(_0xd91172=0x0;_0xd91172<_0x291871[_0x2a71('0x37')];_0xd91172++){if(_0x291871[_0xd91172]['email']===_0x22cde0){_0xad14f2=!![];}}if(_0xad14f2){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x2a71('0x41')](respondWithResult(_0xcdd2f5,null))[_0x2a71('0x46')](function(_0x1ff532){var _0x12ce05=_0x1ade01[_0x2a71('0x31')][_0x2a71('0x62')]?0x1f4:_0x1ff532[_0x2a71('0x63')]||0x1f4;logger[_0x2a71('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0x2a71('0x64'),_0x12ce05,JSON[_0x2a71('0x65')](_0x1ff532));delete _0x1ff532[_0x2a71('0x3e')];if(_0x12ce05===0x191){_0x12ce05=0x190;}_0xcdd2f5[_0x2a71('0x1c')](_0x12ce05)['send'](_0x1ade01[_0x2a71('0x31')][_0x2a71('0x62')]?{'message':'Wrong\x20credentials','statusCode':_0x1ff532[_0x2a71('0x63')]}:_0x1ff532);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 233d26d..646cdb3 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 _0x5fab=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts'];(function(_0x279ab1,_0x527374){var _0x8ba87c=function(_0x2c0898){while(--_0x2c0898){_0x279ab1['push'](_0x279ab1['shift']());}};_0x8ba87c(++_0x527374);}(_0x5fab,0x177));var _0xb5fa=function(_0x35c1cf,_0x197400){_0x35c1cf=_0x35c1cf-0x0;var _0x56bc59=_0x5fab[_0x35c1cf];return _0x56bc59;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));var integrations=require(_0xb5fa('0xa'));module[_0xb5fa('0xb')]=function(_0x4a0249,_0x5d70f6){return _0x4a0249[_0xb5fa('0xc')](_0xb5fa('0xd'),attributes,{'tableName':_0xb5fa('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','FreshsalesAccount','int_freshsales_accounts','lodash'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0x5496,0x175));var _0x6549=function(_0x543852,_0xe0aaec){_0x543852=_0x543852-0x0;var _0x40525b=_0x5496[_0x543852];return _0x40525b;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x43cb17,_0x1d8cea){return _0x43cb17['define'](_0x6549('0x9'),attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 600340d..9c7c67a 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 _0x524e=['http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetFreshsalesAccount','catch','ShowFreshsalesAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2e1a16,_0x4bb327){var _0x59b8cd=function(_0x5f0e97){while(--_0x5f0e97){_0x2e1a16['push'](_0x2e1a16['shift']());}};_0x59b8cd(++_0x4bb327);}(_0x524e,0x15e));var _0xe524=function(_0x667600,_0x106deb){_0x667600=_0x667600-0x0;var _0x28c067=_0x524e[_0x667600];return _0x28c067;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});}exports['GetFreshsalesAccount']=function(_0x3a4027){var _0x4f1dfb=this;return new Promise(function(_0x11b2a1,_0x238f8f){return db[_0xe524('0x16')][_0xe524('0x17')]({'raw':_0x3a4027['options']?_0x3a4027[_0xe524('0x18')][_0xe524('0x19')]===undefined?!![]:![]:!![],'where':_0x3a4027['options']?_0x3a4027[_0xe524('0x18')][_0xe524('0x1a')]||null:null,'attributes':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x1b')]||null:null,'limit':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')][_0xe524('0x1c')]||null:null,'include':_0x3a4027[_0xe524('0x18')]?_0x3a4027['options'][_0xe524('0x1d')]?_['map'](_0x3a4027['options'][_0xe524('0x1d')],function(_0x23df5e){return{'model':db[_0x23df5e[_0xe524('0x1e')]],'as':_0x23df5e['as'],'attributes':_0x23df5e[_0xe524('0x1b')],'include':_0x23df5e['include']?_[_0xe524('0x1f')](_0x23df5e['include'],function(_0x17e245){return{'model':db[_0x17e245[_0xe524('0x1e')]],'as':_0x17e245['as'],'attributes':_0x17e245[_0xe524('0x1b')],'include':_0x17e245[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x17e245[_0xe524('0x1d')],function(_0x2141db){return{'model':db[_0x2141db['model']],'as':_0x2141db['as'],'attributes':_0x2141db['attributes']};}):[]};}):[]};}):[]:[]})[_0xe524('0xc')](function(_0x45abad){logger[_0xe524('0xd')](_0xe524('0x20'),_0x3a4027);logger[_0xe524('0x10')]('GetFreshsalesAccount',_0x3a4027,JSON['stringify'](_0x45abad));_0x11b2a1(_0x45abad);})[_0xe524('0x21')](function(_0x25e7a7){logger[_0xe524('0x13')](_0xe524('0x20'),_0x25e7a7[_0xe524('0x15')],_0x3a4027);_0x238f8f(_0x4f1dfb['error'](0x1f4,_0x25e7a7[_0xe524('0x15')]));});});};exports[_0xe524('0x22')]=function(_0x4a4e15){var _0x5b7ded=this;return new Promise(function(_0x20688e,_0x376324){return db['FreshsalesAccount'][_0xe524('0x23')]({'raw':_0x4a4e15['options']?_0x4a4e15[_0xe524('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4a4e15[_0xe524('0x18')]?_0x4a4e15[_0xe524('0x18')][_0xe524('0x1a')]||null:null,'attributes':_0x4a4e15['options']?_0x4a4e15[_0xe524('0x18')]['attributes']||null:null,'include':_0x4a4e15[_0xe524('0x18')]?_0x4a4e15[_0xe524('0x18')][_0xe524('0x1d')]?_['map'](_0x4a4e15[_0xe524('0x18')][_0xe524('0x1d')],function(_0x49c43e){return{'model':db[_0x49c43e[_0xe524('0x1e')]],'as':_0x49c43e['as'],'attributes':_0x49c43e[_0xe524('0x1b')],'include':_0x49c43e[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x49c43e['include'],function(_0x415450){return{'model':db[_0x415450[_0xe524('0x1e')]],'as':_0x415450['as'],'attributes':_0x415450[_0xe524('0x1b')],'include':_0x415450[_0xe524('0x1d')]?_[_0xe524('0x1f')](_0x415450[_0xe524('0x1d')],function(_0x2741e8){return{'model':db[_0x2741e8[_0xe524('0x1e')]],'as':_0x2741e8['as'],'attributes':_0x2741e8['attributes']};}):[]};}):[]};}):[]:[]})[_0xe524('0xc')](function(_0x56f371){logger[_0xe524('0xd')](_0xe524('0x22'),_0x4a4e15);logger['debug'](_0xe524('0x22'),_0x4a4e15,JSON['stringify'](_0x56f371));_0x20688e(_0x56f371);})[_0xe524('0x21')](function(_0x41af26){logger[_0xe524('0x13')](_0xe524('0x22'),_0x41af26[_0xe524('0x15')],_0x4a4e15);_0x376324(_0x5b7ded[_0xe524('0x13')](0x1f4,_0x41af26[_0xe524('0x15')]));});});}; \ No newline at end of file +var _0x32f4=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit','include','model','map','find','ShowFreshsalesAccount'];(function(_0x514bd1,_0x25ea3e){var _0x58a281=function(_0x25567a){while(--_0x25567a){_0x514bd1['push'](_0x514bd1['shift']());}};_0x58a281(++_0x25ea3e);}(_0x32f4,0x154));var _0x432f=function(_0x4a9cdc,_0x1a9aec){_0x4a9cdc=_0x4a9cdc-0x0;var _0x261ee2=_0x32f4[_0x4a9cdc];return _0x261ee2;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x432f('0x4'));var db=require(_0x432f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x432f('0x6'))(_0x432f('0x7'));var config=require(_0x432f('0x8'));var jayson=require(_0x432f('0x9'));var client=jayson[_0x432f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5f08,_0x2f66fd,_0x32b062){return new BPromise(function(_0x4a5b56,_0x2a2ef6){return client['request'](_0x5b5f08,_0x32b062)[_0x432f('0xb')](function(_0x340fe9){logger[_0x432f('0xc')](_0x432f('0xd'),_0x2f66fd,_0x432f('0xe'));logger['debug'](_0x432f('0xf'),_0x2f66fd,'request\x20sent',JSON[_0x432f('0x10')](_0x340fe9));if(_0x340fe9['error']){if(_0x340fe9[_0x432f('0x11')][_0x432f('0x12')]===0x1f4){logger['error'](_0x432f('0xd'),_0x2f66fd,_0x340fe9[_0x432f('0x11')]['message']);return _0x2a2ef6(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x2f66fd,_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);return _0x4a5b56(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}else{logger[_0x432f('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x2f66fd,_0x432f('0xe'));_0x4a5b56(_0x340fe9[_0x432f('0x14')][_0x432f('0x13')]);}})[_0x432f('0x15')](function(_0x5bae29){logger[_0x432f('0x11')](_0x432f('0xd'),_0x2f66fd,_0x5bae29);_0x2a2ef6(_0x5bae29);});});}exports[_0x432f('0x16')]=function(_0x243cf){var _0x3cd5da=this;return new Promise(function(_0x129582,_0x5ae24e){return db[_0x432f('0x17')]['findAll']({'raw':_0x243cf[_0x432f('0x18')]?_0x243cf[_0x432f('0x18')][_0x432f('0x19')]===undefined?!![]:![]:!![],'where':_0x243cf[_0x432f('0x18')]?_0x243cf[_0x432f('0x18')][_0x432f('0x1a')]||null:null,'attributes':_0x243cf[_0x432f('0x18')]?_0x243cf[_0x432f('0x18')][_0x432f('0x1b')]||null:null,'limit':_0x243cf[_0x432f('0x18')]?_0x243cf[_0x432f('0x18')][_0x432f('0x1c')]||null:null,'include':_0x243cf['options']?_0x243cf['options'][_0x432f('0x1d')]?_['map'](_0x243cf[_0x432f('0x18')]['include'],function(_0x37f136){return{'model':db[_0x37f136[_0x432f('0x1e')]],'as':_0x37f136['as'],'attributes':_0x37f136[_0x432f('0x1b')],'include':_0x37f136[_0x432f('0x1d')]?_[_0x432f('0x1f')](_0x37f136[_0x432f('0x1d')],function(_0x59f352){return{'model':db[_0x59f352[_0x432f('0x1e')]],'as':_0x59f352['as'],'attributes':_0x59f352[_0x432f('0x1b')],'include':_0x59f352['include']?_[_0x432f('0x1f')](_0x59f352[_0x432f('0x1d')],function(_0x2bcbb4){return{'model':db[_0x2bcbb4[_0x432f('0x1e')]],'as':_0x2bcbb4['as'],'attributes':_0x2bcbb4[_0x432f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x432f('0xb')](function(_0x138a6a){logger['info'](_0x432f('0x16'),_0x243cf);logger['debug'](_0x432f('0x16'),_0x243cf,JSON['stringify'](_0x138a6a));_0x129582(_0x138a6a);})[_0x432f('0x15')](function(_0x5a2c14){logger[_0x432f('0x11')]('GetFreshsalesAccount',_0x5a2c14[_0x432f('0x13')],_0x243cf);_0x5ae24e(_0x3cd5da[_0x432f('0x11')](0x1f4,_0x5a2c14[_0x432f('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0x6a116e){var _0x24406a=this;return new Promise(function(_0x48139b,_0x5ee0fa){return db[_0x432f('0x17')][_0x432f('0x20')]({'raw':_0x6a116e[_0x432f('0x18')]?_0x6a116e[_0x432f('0x18')][_0x432f('0x19')]===undefined?!![]:![]:!![],'where':_0x6a116e[_0x432f('0x18')]?_0x6a116e['options']['where']||null:null,'attributes':_0x6a116e[_0x432f('0x18')]?_0x6a116e[_0x432f('0x18')][_0x432f('0x1b')]||null:null,'include':_0x6a116e['options']?_0x6a116e[_0x432f('0x18')][_0x432f('0x1d')]?_[_0x432f('0x1f')](_0x6a116e[_0x432f('0x18')][_0x432f('0x1d')],function(_0x3ad632){return{'model':db[_0x3ad632[_0x432f('0x1e')]],'as':_0x3ad632['as'],'attributes':_0x3ad632[_0x432f('0x1b')],'include':_0x3ad632['include']?_['map'](_0x3ad632[_0x432f('0x1d')],function(_0xa5e0d){return{'model':db[_0xa5e0d['model']],'as':_0xa5e0d['as'],'attributes':_0xa5e0d['attributes'],'include':_0xa5e0d['include']?_[_0x432f('0x1f')](_0xa5e0d[_0x432f('0x1d')],function(_0x5648a7){return{'model':db[_0x5648a7[_0x432f('0x1e')]],'as':_0x5648a7['as'],'attributes':_0x5648a7[_0x432f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x432f('0xb')](function(_0x5903f6){logger[_0x432f('0xc')](_0x432f('0x21'),_0x6a116e);logger['debug'](_0x432f('0x21'),_0x6a116e,JSON[_0x432f('0x10')](_0x5903f6));_0x48139b(_0x5903f6);})['catch'](function(_0x28da2e){logger[_0x432f('0x11')](_0x432f('0x21'),_0x28da2e[_0x432f('0x13')],_0x6a116e);_0x5ee0fa(_0x24406a[_0x432f('0x11')](0x1f4,_0x28da2e[_0x432f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index eb37597..ef2cb91 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 _0x7edc=['show','getDescriptions','/:id/fields','getFields','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x24d727,_0x3d60d3){var _0x83a316=function(_0x47f1a1){while(--_0x47f1a1){_0x24d727['push'](_0x24d727['shift']());}};_0x83a316(++_0x3d60d3);}(_0x7edc,0x78));var _0xc7ed=function(_0x507403,_0x3f954d){_0x507403=_0x507403-0x0;var _0x1327c=_0x7edc[_0x507403];return _0x1327c;};'use strict';var multer=require('multer');var util=require(_0xc7ed('0x0'));var path=require(_0xc7ed('0x1'));var timeout=require(_0xc7ed('0x2'));var express=require(_0xc7ed('0x3'));var router=express[_0xc7ed('0x4')]();var fs_extra=require(_0xc7ed('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc7ed('0x6'));var controller=require(_0xc7ed('0x7'));router[_0xc7ed('0x8')]('/',auth[_0xc7ed('0x9')](),controller[_0xc7ed('0xa')]);router[_0xc7ed('0x8')](_0xc7ed('0xb'),auth[_0xc7ed('0x9')](),controller[_0xc7ed('0xc')]);router[_0xc7ed('0x8')]('/:id/subjects',auth[_0xc7ed('0x9')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0xc7ed('0x9')](),controller[_0xc7ed('0xd')]);router[_0xc7ed('0x8')](_0xc7ed('0xe'),auth['isAuthenticated'](),controller[_0xc7ed('0xf')]);router[_0xc7ed('0x10')]('/',auth['isAuthenticated'](),controller[_0xc7ed('0x11')]);router[_0xc7ed('0x12')](_0xc7ed('0xb'),auth[_0xc7ed('0x9')](),controller[_0xc7ed('0x13')]);router['delete']('/:id',auth[_0xc7ed('0x9')](),controller[_0xc7ed('0x14')]);module[_0xc7ed('0x15')]=router; \ No newline at end of file +var _0x444d=['connect-timeout','express','fs-extra','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/descriptions','getFields','post','create','put','update','destroy','exports','multer'];(function(_0x1d677f,_0x5a1cd8){var _0x343dd2=function(_0xfcce7d){while(--_0xfcce7d){_0x1d677f['push'](_0x1d677f['shift']());}};_0x343dd2(++_0x5a1cd8);}(_0x444d,0x1f3));var _0xd444=function(_0x125ddd,_0x2cd297){_0x125ddd=_0x125ddd-0x0;var _0x136ade=_0x444d[_0x125ddd];return _0x136ade;};'use strict';var multer=require(_0xd444('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd444('0x1'));var express=require(_0xd444('0x2'));var router=express['Router']();var fs_extra=require(_0xd444('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd444('0x4'));var controller=require(_0xd444('0x5'));router[_0xd444('0x6')]('/',auth[_0xd444('0x7')](),controller[_0xd444('0x8')]);router[_0xd444('0x6')](_0xd444('0x9'),auth[_0xd444('0x7')](),controller['show']);router[_0xd444('0x6')](_0xd444('0xa'),auth['isAuthenticated'](),controller[_0xd444('0xb')]);router[_0xd444('0x6')](_0xd444('0xc'),auth[_0xd444('0x7')](),controller['getDescriptions']);router[_0xd444('0x6')]('/:id/fields',auth[_0xd444('0x7')](),controller[_0xd444('0xd')]);router[_0xd444('0xe')]('/',auth[_0xd444('0x7')](),controller[_0xd444('0xf')]);router[_0xd444('0x10')]('/:id',auth[_0xd444('0x7')](),controller[_0xd444('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd444('0x12')]);module[_0xd444('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index b231102..61e1454 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 _0x96fa=['sequelize','exports','STRING'];(function(_0x2f0458,_0x3b9a7a){var _0x2d923d=function(_0x28d118){while(--_0x28d118){_0x2f0458['push'](_0x2f0458['shift']());}};_0x2d923d(++_0x3b9a7a);}(_0x96fa,0x13b));var _0xa96f=function(_0x229d30,_0x3ea3be){_0x229d30=_0x229d30-0x0;var _0x49cf1d=_0x96fa[_0x229d30];return _0x49cf1d;};'use strict';var Sequelize=require(_0xa96f('0x0'));module[_0xa96f('0x1')]={'name':{'type':Sequelize[_0xa96f('0x2')]},'description':{'type':Sequelize[_0xa96f('0x2')]}}; \ No newline at end of file +var _0x2de2=['sequelize','exports','STRING'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x2de2,0x150));var _0x22de=function(_0x2f1e6c,_0x21a756){_0x2f1e6c=_0x2f1e6c-0x0;var _0x108121=_0x2de2[_0x2f1e6c];return _0x108121;};'use strict';var Sequelize=require(_0x22de('0x0'));module[_0x22de('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x22de('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index cad5488..7916dd4 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 _0x50dc=['key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','options','includeAll','include','findAll','show','params','find','create','body','catch','findOne','FreshsalesField','getSubjects','getDescriptions','getFields','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','FreshsalesConfiguration','rawAttributes','fieldName','type'];(function(_0x4d9bbb,_0x284069){var _0x55080e=function(_0x2c3435){while(--_0x2c3435){_0x4d9bbb['push'](_0x4d9bbb['shift']());}};_0x55080e(++_0x284069);}(_0x50dc,0x1a3));var _0xc50d=function(_0x42f104,_0x21f8a8){_0x42f104=_0x42f104-0x0;var _0x51c407=_0x50dc[_0x42f104];return _0x51c407;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc50d('0x0'));var zipdir=require(_0xc50d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc50d('0x2'));var moment=require(_0xc50d('0x3'));var BPromise=require(_0xc50d('0x4'));var Mustache=require(_0xc50d('0x5'));var util=require(_0xc50d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc50d('0x7'));var ejs=require(_0xc50d('0x8'));var fs=require('fs');var fs_extra=require(_0xc50d('0x9'));var _=require(_0xc50d('0xa'));var squel=require(_0xc50d('0xb'));var crypto=require(_0xc50d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc50d('0xd'));var toCsv=require(_0xc50d('0x7'));var querystring=require(_0xc50d('0xe'));var Papa=require(_0xc50d('0xf'));var Redis=require(_0xc50d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc50d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc50d('0x12'))('api');var utils=require(_0xc50d('0x13'));var config=require(_0xc50d('0x14'));var licenseUtil=require(_0xc50d('0x15'));var db=require(_0xc50d('0x16'))['db'];function respondWithStatusCode(_0x4905e2,_0x54c25f){_0x54c25f=_0x54c25f||0xcc;return function(_0x434036){if(_0x434036){return _0x4905e2[_0xc50d('0x17')](_0x54c25f);}return _0x4905e2[_0xc50d('0x18')](_0x54c25f)[_0xc50d('0x19')]();};}function respondWithResult(_0x19b58b,_0xe532a2){_0xe532a2=_0xe532a2||0xc8;return function(_0x3a7612){if(_0x3a7612){return _0x19b58b[_0xc50d('0x18')](_0xe532a2)['json'](_0x3a7612);}};}function respondWithFilteredResult(_0x1b9ed0,_0x2904e1){return function(_0x57a787){if(_0x57a787){var _0x5e2d81=typeof _0x2904e1[_0xc50d('0x1a')]==='undefined'&&typeof _0x2904e1['limit']===_0xc50d('0x1b');var _0x2f9e91=_0x57a787[_0xc50d('0x1c')];var _0x1b4f4e=_0x5e2d81?0x0:_0x2904e1[_0xc50d('0x1a')];var _0x5e8bee=_0x5e2d81?_0x57a787[_0xc50d('0x1c')]:_0x2904e1[_0xc50d('0x1a')]+_0x2904e1['limit'];var _0x4a5b67;if(_0x5e8bee>=_0x2f9e91){_0x5e8bee=_0x2f9e91;_0x4a5b67=0xc8;}else{_0x4a5b67=0xce;}_0x1b9ed0[_0xc50d('0x18')](_0x4a5b67);return _0x1b9ed0[_0xc50d('0x1d')](_0xc50d('0x1e'),_0x1b4f4e+'-'+_0x5e8bee+'/'+_0x2f9e91)['json'](_0x57a787);}return null;};}function patchUpdates(_0x596142){return function(_0x389bc){try{jsonpatch[_0xc50d('0x1f')](_0x389bc,_0x596142,!![]);}catch(_0x10cfe1){return BPromise['reject'](_0x10cfe1);}return _0x389bc[_0xc50d('0x20')]();};}function saveUpdates(_0x585344,_0x45b3e9){return function(_0x2bd246){if(_0x2bd246){return _0x2bd246[_0xc50d('0x21')](_0x585344)[_0xc50d('0x22')](function(_0x2fc5b3){return _0x2fc5b3;});}return null;};}function removeEntity(_0x288c1f,_0x9e7791){return function(_0x400ad1){if(_0x400ad1){return _0x400ad1[_0xc50d('0x23')]()['then'](function(){_0x288c1f['status'](0xcc)[_0xc50d('0x19')]();});}};}function handleEntityNotFound(_0x273079,_0x438af4){return function(_0x586a28){if(!_0x586a28){_0x273079[_0xc50d('0x17')](0x194);}return _0x586a28;};}function handleError(_0x10958a,_0xa1b11f){_0xa1b11f=_0xa1b11f||0x1f4;return function(_0x404c76){logger[_0xc50d('0x24')](_0x404c76['stack']);if(_0x404c76['name']){delete _0x404c76[_0xc50d('0x25')];}_0x10958a[_0xc50d('0x18')](_0xa1b11f)[_0xc50d('0x26')](_0x404c76);};}exports['index']=function(_0x1b61b5,_0x2c8c8e){var _0x312715={},_0x496cc7={},_0x4b91ca={'count':0x0,'rows':[]};var _0x4f7866=_['map'](db[_0xc50d('0x27')][_0xc50d('0x28')],function(_0x253a71){return{'name':_0x253a71[_0xc50d('0x29')],'type':_0x253a71[_0xc50d('0x2a')][_0xc50d('0x2b')]};});_0x496cc7['model']=_['map'](_0x4f7866,_0xc50d('0x25'));_0x496cc7['query']=_[_0xc50d('0x2c')](_0x1b61b5[_0xc50d('0x2d')]);_0x496cc7['filters']=_[_0xc50d('0x2e')](_0x496cc7[_0xc50d('0x2f')],_0x496cc7[_0xc50d('0x2d')]);_0x312715['attributes']=_[_0xc50d('0x2e')](_0x496cc7[_0xc50d('0x2f')],qs['fields'](_0x1b61b5['query'][_0xc50d('0x30')]));_0x312715[_0xc50d('0x31')]=_0x312715['attributes'][_0xc50d('0x32')]?_0x312715[_0xc50d('0x31')]:_0x496cc7[_0xc50d('0x2f')];if(!_0x1b61b5[_0xc50d('0x2d')][_0xc50d('0x33')](_0xc50d('0x34'))){_0x312715['limit']=qs[_0xc50d('0x35')](_0x1b61b5['query']['limit']);_0x312715[_0xc50d('0x1a')]=qs[_0xc50d('0x1a')](_0x1b61b5[_0xc50d('0x2d')][_0xc50d('0x1a')]);}_0x312715[_0xc50d('0x36')]=qs[_0xc50d('0x37')](_0x1b61b5['query'][_0xc50d('0x37')]);_0x312715[_0xc50d('0x38')]=qs[_0xc50d('0x39')](_[_0xc50d('0x3a')](_0x1b61b5[_0xc50d('0x2d')],_0x496cc7[_0xc50d('0x39')]),_0x4f7866);if(_0x1b61b5[_0xc50d('0x2d')][_0xc50d('0x3b')]){_0x312715[_0xc50d('0x38')]=_[_0xc50d('0x3c')](_0x312715[_0xc50d('0x38')],{'$or':_[_0xc50d('0x3d')](_0x4f7866,function(_0x3ff0f4){if(_0x3ff0f4['type']!=='VIRTUAL'){var _0x4c0e07={};_0x4c0e07[_0x3ff0f4[_0xc50d('0x25')]]={'$like':'%'+_0x1b61b5['query']['filter']+'%'};return _0x4c0e07;}})});}_0x312715=_['merge']({},_0x312715,_0x1b61b5[_0xc50d('0x3e')]);var _0x1b14ba={'where':_0x312715['where']};return db['FreshsalesConfiguration'][_0xc50d('0x1c')](_0x1b14ba)[_0xc50d('0x22')](function(_0x62c7f9){_0x4b91ca[_0xc50d('0x1c')]=_0x62c7f9;if(_0x1b61b5['query'][_0xc50d('0x3f')]){_0x312715[_0xc50d('0x40')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xc50d('0x41')](_0x312715);})[_0xc50d('0x22')](function(_0x5521f6){_0x4b91ca['rows']=_0x5521f6;return _0x4b91ca;})[_0xc50d('0x22')](respondWithFilteredResult(_0x2c8c8e,_0x312715))['catch'](handleError(_0x2c8c8e,null));};exports[_0xc50d('0x42')]=function(_0x19b36a,_0x530fa0){var _0x5059a1={'raw':![],'where':{'id':_0x19b36a[_0xc50d('0x43')]['id']}},_0xae32de={};_0xae32de['model']=_[_0xc50d('0x2c')](db['FreshsalesConfiguration']['rawAttributes']);_0xae32de[_0xc50d('0x2d')]=_[_0xc50d('0x2c')](_0x19b36a[_0xc50d('0x2d')]);_0xae32de[_0xc50d('0x39')]=_['intersection'](_0xae32de[_0xc50d('0x2f')],_0xae32de[_0xc50d('0x2d')]);_0x5059a1['attributes']=_[_0xc50d('0x2e')](_0xae32de[_0xc50d('0x2f')],qs[_0xc50d('0x30')](_0x19b36a[_0xc50d('0x2d')][_0xc50d('0x30')]));_0x5059a1[_0xc50d('0x31')]=_0x5059a1[_0xc50d('0x31')]['length']?_0x5059a1[_0xc50d('0x31')]:_0xae32de[_0xc50d('0x2f')];if(_0x19b36a[_0xc50d('0x2d')][_0xc50d('0x3f')]){_0x5059a1['include']=[{'all':!![]}];}_0x5059a1=_[_0xc50d('0x3c')]({},_0x5059a1,_0x19b36a[_0xc50d('0x3e')]);return db['FreshsalesConfiguration'][_0xc50d('0x44')](_0x5059a1)['then'](handleEntityNotFound(_0x530fa0,null))[_0xc50d('0x22')](respondWithResult(_0x530fa0,null))['catch'](handleError(_0x530fa0,null));};exports[_0xc50d('0x45')]=function(_0x113f95,_0x385c6f){return db['FreshsalesConfiguration'][_0xc50d('0x45')](_0x113f95[_0xc50d('0x46')],{})[_0xc50d('0x22')](respondWithResult(_0x385c6f,0xc9))['catch'](handleError(_0x385c6f,null));};exports[_0xc50d('0x21')]=function(_0x5c5514,_0x320a55){if(_0x5c5514[_0xc50d('0x46')]['id']){delete _0x5c5514['body']['id'];}return db[_0xc50d('0x27')][_0xc50d('0x44')]({'where':{'id':_0x5c5514['params']['id']}})[_0xc50d('0x22')](handleEntityNotFound(_0x320a55,null))['then'](saveUpdates(_0x5c5514[_0xc50d('0x46')],null))[_0xc50d('0x22')](respondWithResult(_0x320a55,null))['catch'](handleError(_0x320a55,null));};exports[_0xc50d('0x23')]=function(_0x105902,_0x2484a2){return db[_0xc50d('0x27')][_0xc50d('0x44')]({'where':{'id':_0x105902['params']['id']}})[_0xc50d('0x22')](handleEntityNotFound(_0x2484a2,null))[_0xc50d('0x22')](removeEntity(_0x2484a2,null))[_0xc50d('0x47')](handleError(_0x2484a2,null));};exports['getSubjects']=function(_0x50a8c3,_0x536013,_0x40a7e1){var _0x5af3a2={};var _0x584c5a={};var _0x396df3;var _0x8d1cca;return db[_0xc50d('0x27')][_0xc50d('0x48')]({'where':{'id':_0x50a8c3['params']['id']}})['then'](handleEntityNotFound(_0x536013,null))[_0xc50d('0x22')](function(_0x58b6d7){if(_0x58b6d7){_0x396df3=_0x58b6d7;_0x584c5a['model']=_['keys'](db[_0xc50d('0x49')]['rawAttributes']);_0x584c5a['query']=_['keys'](_0x50a8c3[_0xc50d('0x2d')]);_0x584c5a['filters']=_[_0xc50d('0x2e')](_0x584c5a[_0xc50d('0x2f')],_0x584c5a[_0xc50d('0x2d')]);_0x5af3a2['attributes']=_['intersection'](_0x584c5a[_0xc50d('0x2f')],qs['fields'](_0x50a8c3[_0xc50d('0x2d')]['fields']));_0x5af3a2[_0xc50d('0x31')]=_0x5af3a2[_0xc50d('0x31')][_0xc50d('0x32')]?_0x5af3a2['attributes']:_0x584c5a['model'];_0x5af3a2[_0xc50d('0x36')]=qs[_0xc50d('0x37')](_0x50a8c3['query'][_0xc50d('0x37')]);_0x5af3a2[_0xc50d('0x38')]=qs[_0xc50d('0x39')](_[_0xc50d('0x3a')](_0x50a8c3[_0xc50d('0x2d')],_0x584c5a[_0xc50d('0x39')]));if(_0x50a8c3[_0xc50d('0x2d')]['filter']){_0x5af3a2['where']=_[_0xc50d('0x3c')](_0x5af3a2[_0xc50d('0x38')],{'$or':_['map'](_0x5af3a2['attributes'],function(_0x287fcf){var _0x28313e={};_0x28313e[_0x287fcf]={'$like':'%'+_0x50a8c3['query']['filter']+'%'};return _0x28313e;})});}_0x5af3a2=_['merge']({},_0x5af3a2,_0x50a8c3[_0xc50d('0x3e')]);return _0x396df3[_0xc50d('0x4a')](_0x5af3a2);}})[_0xc50d('0x22')](function(_0x454319){if(_0x454319){_0x8d1cca=_0x454319[_0xc50d('0x32')];if(!_0x50a8c3['query'][_0xc50d('0x33')](_0xc50d('0x34'))){_0x5af3a2['limit']=qs[_0xc50d('0x35')](_0x50a8c3['query'][_0xc50d('0x35')]);_0x5af3a2[_0xc50d('0x1a')]=qs[_0xc50d('0x1a')](_0x50a8c3[_0xc50d('0x2d')][_0xc50d('0x1a')]);}return _0x396df3[_0xc50d('0x4a')](_0x5af3a2);}})[_0xc50d('0x22')](function(_0x49d6dc){if(_0x49d6dc){return _0x49d6dc?{'count':_0x8d1cca,'rows':_0x49d6dc}:null;}})['then'](respondWithResult(_0x536013,null))[_0xc50d('0x47')](handleError(_0x536013,null));};exports[_0xc50d('0x4b')]=function(_0x1374b0,_0xa41f8d,_0x47582f){var _0x186fc7={};var _0x2d2fe0={};var _0x13123c;var _0x41d350;return db[_0xc50d('0x27')][_0xc50d('0x48')]({'where':{'id':_0x1374b0[_0xc50d('0x43')]['id']}})['then'](handleEntityNotFound(_0xa41f8d,null))[_0xc50d('0x22')](function(_0x224b89){if(_0x224b89){_0x13123c=_0x224b89;_0x2d2fe0[_0xc50d('0x2f')]=_[_0xc50d('0x2c')](db[_0xc50d('0x49')]['rawAttributes']);_0x2d2fe0[_0xc50d('0x2d')]=_[_0xc50d('0x2c')](_0x1374b0[_0xc50d('0x2d')]);_0x2d2fe0[_0xc50d('0x39')]=_['intersection'](_0x2d2fe0[_0xc50d('0x2f')],_0x2d2fe0[_0xc50d('0x2d')]);_0x186fc7['attributes']=_[_0xc50d('0x2e')](_0x2d2fe0[_0xc50d('0x2f')],qs['fields'](_0x1374b0['query'][_0xc50d('0x30')]));_0x186fc7[_0xc50d('0x31')]=_0x186fc7[_0xc50d('0x31')][_0xc50d('0x32')]?_0x186fc7[_0xc50d('0x31')]:_0x2d2fe0[_0xc50d('0x2f')];_0x186fc7[_0xc50d('0x36')]=qs[_0xc50d('0x37')](_0x1374b0[_0xc50d('0x2d')][_0xc50d('0x37')]);_0x186fc7[_0xc50d('0x38')]=qs[_0xc50d('0x39')](_[_0xc50d('0x3a')](_0x1374b0[_0xc50d('0x2d')],_0x2d2fe0[_0xc50d('0x39')]));if(_0x1374b0[_0xc50d('0x2d')]['filter']){_0x186fc7['where']=_[_0xc50d('0x3c')](_0x186fc7['where'],{'$or':_[_0xc50d('0x3d')](_0x186fc7[_0xc50d('0x31')],function(_0x376233){var _0x2de615={};_0x2de615[_0x376233]={'$like':'%'+_0x1374b0[_0xc50d('0x2d')]['filter']+'%'};return _0x2de615;})});}_0x186fc7=_[_0xc50d('0x3c')]({},_0x186fc7,_0x1374b0[_0xc50d('0x3e')]);return _0x13123c[_0xc50d('0x4b')](_0x186fc7);}})[_0xc50d('0x22')](function(_0x40d962){if(_0x40d962){_0x41d350=_0x40d962[_0xc50d('0x32')];if(!_0x1374b0[_0xc50d('0x2d')]['hasOwnProperty']('nolimit')){_0x186fc7['limit']=qs[_0xc50d('0x35')](_0x1374b0[_0xc50d('0x2d')][_0xc50d('0x35')]);_0x186fc7[_0xc50d('0x1a')]=qs[_0xc50d('0x1a')](_0x1374b0[_0xc50d('0x2d')][_0xc50d('0x1a')]);}return _0x13123c[_0xc50d('0x4b')](_0x186fc7);}})[_0xc50d('0x22')](function(_0x2211a7){if(_0x2211a7){return _0x2211a7?{'count':_0x41d350,'rows':_0x2211a7}:null;}})[_0xc50d('0x22')](respondWithResult(_0xa41f8d,null))[_0xc50d('0x47')](handleError(_0xa41f8d,null));};exports[_0xc50d('0x4c')]=function(_0x39ae79,_0x52bed5,_0x4b4302){var _0x16417c={};var _0x1ecc5b={};var _0x476b4c;var _0x1dd633;return db[_0xc50d('0x27')][_0xc50d('0x48')]({'where':{'id':_0x39ae79[_0xc50d('0x43')]['id']}})[_0xc50d('0x22')](handleEntityNotFound(_0x52bed5,null))[_0xc50d('0x22')](function(_0x1633a3){if(_0x1633a3){_0x476b4c=_0x1633a3;_0x1ecc5b[_0xc50d('0x2f')]=_[_0xc50d('0x2c')](db['FreshsalesField']['rawAttributes']);_0x1ecc5b[_0xc50d('0x2d')]=_[_0xc50d('0x2c')](_0x39ae79['query']);_0x1ecc5b['filters']=_[_0xc50d('0x2e')](_0x1ecc5b[_0xc50d('0x2f')],_0x1ecc5b[_0xc50d('0x2d')]);_0x16417c[_0xc50d('0x31')]=_[_0xc50d('0x2e')](_0x1ecc5b[_0xc50d('0x2f')],qs['fields'](_0x39ae79['query'][_0xc50d('0x30')]));_0x16417c[_0xc50d('0x31')]=_0x16417c[_0xc50d('0x31')][_0xc50d('0x32')]?_0x16417c[_0xc50d('0x31')]:_0x1ecc5b[_0xc50d('0x2f')];_0x16417c[_0xc50d('0x36')]=qs[_0xc50d('0x37')](_0x39ae79[_0xc50d('0x2d')][_0xc50d('0x37')]);_0x16417c[_0xc50d('0x38')]=qs[_0xc50d('0x39')](_[_0xc50d('0x3a')](_0x39ae79['query'],_0x1ecc5b[_0xc50d('0x39')]));if(_0x39ae79[_0xc50d('0x2d')][_0xc50d('0x3b')]){_0x16417c[_0xc50d('0x38')]=_[_0xc50d('0x3c')](_0x16417c[_0xc50d('0x38')],{'$or':_[_0xc50d('0x3d')](_0x16417c['attributes'],function(_0x491320){var _0x5740f3={};_0x5740f3[_0x491320]={'$like':'%'+_0x39ae79[_0xc50d('0x2d')]['filter']+'%'};return _0x5740f3;})});}_0x16417c=_[_0xc50d('0x3c')]({},_0x16417c,_0x39ae79[_0xc50d('0x3e')]);return _0x476b4c[_0xc50d('0x4c')](_0x16417c);}})[_0xc50d('0x22')](function(_0x1a4447){if(_0x1a4447){_0x1dd633=_0x1a4447[_0xc50d('0x32')];if(!_0x39ae79[_0xc50d('0x2d')][_0xc50d('0x33')]('nolimit')){_0x16417c[_0xc50d('0x35')]=qs[_0xc50d('0x35')](_0x39ae79['query'][_0xc50d('0x35')]);_0x16417c[_0xc50d('0x1a')]=qs[_0xc50d('0x1a')](_0x39ae79[_0xc50d('0x2d')][_0xc50d('0x1a')]);}return _0x476b4c[_0xc50d('0x4c')](_0x16417c);}})['then'](function(_0x1aef26){if(_0x1aef26){return _0x1aef26?{'count':_0x1dd633,'rows':_0x1aef26}:null;}})['then'](respondWithResult(_0x52bed5,null))['catch'](handleError(_0x52bed5,null));}; \ No newline at end of file +var _0x2d87=['stack','name','index','map','FreshsalesConfiguration','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','options','find','create','body','getSubjects','findOne','FreshsalesField','rawAttributes','getDescriptions','getFields','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then'];(function(_0x2a73aa,_0x4f9349){var _0x45d561=function(_0x3b902a){while(--_0x3b902a){_0x2a73aa['push'](_0x2a73aa['shift']());}};_0x45d561(++_0x4f9349);}(_0x2d87,0xc6));var _0x72d8=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x2d87[_0x465028];return _0xb783d4;};'use strict';var emlformat=require(_0x72d8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x72d8('0x1'));var rp=require(_0x72d8('0x2'));var moment=require(_0x72d8('0x3'));var BPromise=require(_0x72d8('0x4'));var Mustache=require(_0x72d8('0x5'));var util=require('util');var path=require(_0x72d8('0x6'));var sox=require(_0x72d8('0x7'));var csv=require(_0x72d8('0x8'));var ejs=require(_0x72d8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72d8('0xa'));var squel=require('squel');var crypto=require(_0x72d8('0xb'));var jsforce=require(_0x72d8('0xc'));var deskjs=require(_0x72d8('0xd'));var toCsv=require('to-csv');var querystring=require(_0x72d8('0xe'));var Papa=require('papaparse');var Redis=require(_0x72d8('0xf'));var authService=require(_0x72d8('0x10'));var qs=require(_0x72d8('0x11'));var as=require(_0x72d8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x72d8('0x13'))(_0x72d8('0x14'));var utils=require('../../config/utils');var config=require(_0x72d8('0x15'));var licenseUtil=require(_0x72d8('0x16'));var db=require(_0x72d8('0x17'))['db'];function respondWithStatusCode(_0x199271,_0x2c278e){_0x2c278e=_0x2c278e||0xcc;return function(_0x5a0502){if(_0x5a0502){return _0x199271[_0x72d8('0x18')](_0x2c278e);}return _0x199271[_0x72d8('0x19')](_0x2c278e)[_0x72d8('0x1a')]();};}function respondWithResult(_0x43e721,_0x4eb132){_0x4eb132=_0x4eb132||0xc8;return function(_0x53171f){if(_0x53171f){return _0x43e721['status'](_0x4eb132)[_0x72d8('0x1b')](_0x53171f);}};}function respondWithFilteredResult(_0x3b54a6,_0x29fd63){return function(_0x217470){if(_0x217470){var _0xe41236=typeof _0x29fd63['offset']===_0x72d8('0x1c')&&typeof _0x29fd63[_0x72d8('0x1d')]===_0x72d8('0x1c');var _0x856551=_0x217470[_0x72d8('0x1e')];var _0x418098=_0xe41236?0x0:_0x29fd63[_0x72d8('0x1f')];var _0x49df1c=_0xe41236?_0x217470['count']:_0x29fd63['offset']+_0x29fd63[_0x72d8('0x1d')];var _0x23b8d2;if(_0x49df1c>=_0x856551){_0x49df1c=_0x856551;_0x23b8d2=0xc8;}else{_0x23b8d2=0xce;}_0x3b54a6[_0x72d8('0x19')](_0x23b8d2);return _0x3b54a6[_0x72d8('0x20')]('Content-Range',_0x418098+'-'+_0x49df1c+'/'+_0x856551)[_0x72d8('0x1b')](_0x217470);}return null;};}function patchUpdates(_0x181fe4){return function(_0x3f18f2){try{jsonpatch[_0x72d8('0x21')](_0x3f18f2,_0x181fe4,!![]);}catch(_0x14e1c6){return BPromise[_0x72d8('0x22')](_0x14e1c6);}return _0x3f18f2[_0x72d8('0x23')]();};}function saveUpdates(_0x11d321,_0x4c3d19){return function(_0xcc0e56){if(_0xcc0e56){return _0xcc0e56[_0x72d8('0x24')](_0x11d321)['then'](function(_0x3ed978){return _0x3ed978;});}return null;};}function removeEntity(_0x2f01f4,_0x3d8980){return function(_0x57c660){if(_0x57c660){return _0x57c660[_0x72d8('0x25')]()[_0x72d8('0x26')](function(){_0x2f01f4[_0x72d8('0x19')](0xcc)[_0x72d8('0x1a')]();});}};}function handleEntityNotFound(_0x2e2c93,_0x4fecd3){return function(_0x438a01){if(!_0x438a01){_0x2e2c93[_0x72d8('0x18')](0x194);}return _0x438a01;};}function handleError(_0xf367be,_0x3cea49){_0x3cea49=_0x3cea49||0x1f4;return function(_0x305018){logger['error'](_0x305018[_0x72d8('0x27')]);if(_0x305018[_0x72d8('0x28')]){delete _0x305018[_0x72d8('0x28')];}_0xf367be[_0x72d8('0x19')](_0x3cea49)['send'](_0x305018);};}exports[_0x72d8('0x29')]=function(_0x4262d0,_0x4479fe){var _0x3daa7b={},_0x51e8fa={},_0x3237aa={'count':0x0,'rows':[]};var _0x2bacde=_[_0x72d8('0x2a')](db[_0x72d8('0x2b')]['rawAttributes'],function(_0x4c761b){return{'name':_0x4c761b[_0x72d8('0x2c')],'type':_0x4c761b[_0x72d8('0x2d')][_0x72d8('0x2e')]};});_0x51e8fa['model']=_[_0x72d8('0x2a')](_0x2bacde,'name');_0x51e8fa[_0x72d8('0x2f')]=_[_0x72d8('0x30')](_0x4262d0[_0x72d8('0x2f')]);_0x51e8fa[_0x72d8('0x31')]=_[_0x72d8('0x32')](_0x51e8fa['model'],_0x51e8fa['query']);_0x3daa7b[_0x72d8('0x33')]=_['intersection'](_0x51e8fa[_0x72d8('0x34')],qs[_0x72d8('0x35')](_0x4262d0[_0x72d8('0x2f')][_0x72d8('0x35')]));_0x3daa7b['attributes']=_0x3daa7b['attributes'][_0x72d8('0x36')]?_0x3daa7b[_0x72d8('0x33')]:_0x51e8fa[_0x72d8('0x34')];if(!_0x4262d0[_0x72d8('0x2f')][_0x72d8('0x37')](_0x72d8('0x38'))){_0x3daa7b[_0x72d8('0x1d')]=qs[_0x72d8('0x1d')](_0x4262d0['query'][_0x72d8('0x1d')]);_0x3daa7b[_0x72d8('0x1f')]=qs['offset'](_0x4262d0[_0x72d8('0x2f')]['offset']);}_0x3daa7b[_0x72d8('0x39')]=qs[_0x72d8('0x3a')](_0x4262d0[_0x72d8('0x2f')][_0x72d8('0x3a')]);_0x3daa7b[_0x72d8('0x3b')]=qs[_0x72d8('0x31')](_[_0x72d8('0x3c')](_0x4262d0['query'],_0x51e8fa[_0x72d8('0x31')]),_0x2bacde);if(_0x4262d0[_0x72d8('0x2f')][_0x72d8('0x3d')]){_0x3daa7b[_0x72d8('0x3b')]=_[_0x72d8('0x3e')](_0x3daa7b[_0x72d8('0x3b')],{'$or':_[_0x72d8('0x2a')](_0x2bacde,function(_0x5c2770){if(_0x5c2770[_0x72d8('0x2d')]!=='VIRTUAL'){var _0x2bd2ca={};_0x2bd2ca[_0x5c2770['name']]={'$like':'%'+_0x4262d0[_0x72d8('0x2f')]['filter']+'%'};return _0x2bd2ca;}})});}_0x3daa7b=_[_0x72d8('0x3e')]({},_0x3daa7b,_0x4262d0['options']);var _0x483775={'where':_0x3daa7b['where']};return db[_0x72d8('0x2b')][_0x72d8('0x1e')](_0x483775)[_0x72d8('0x26')](function(_0x598a1a){_0x3237aa[_0x72d8('0x1e')]=_0x598a1a;if(_0x4262d0[_0x72d8('0x2f')][_0x72d8('0x3f')]){_0x3daa7b[_0x72d8('0x40')]=[{'all':!![]}];}return db[_0x72d8('0x2b')]['findAll'](_0x3daa7b);})[_0x72d8('0x26')](function(_0x3f35dc){_0x3237aa[_0x72d8('0x41')]=_0x3f35dc;return _0x3237aa;})[_0x72d8('0x26')](respondWithFilteredResult(_0x4479fe,_0x3daa7b))[_0x72d8('0x42')](handleError(_0x4479fe,null));};exports[_0x72d8('0x43')]=function(_0x66f735,_0x232b79){var _0x5044b0={'raw':![],'where':{'id':_0x66f735[_0x72d8('0x44')]['id']}},_0x2deae5={};_0x2deae5['model']=_[_0x72d8('0x30')](db[_0x72d8('0x2b')]['rawAttributes']);_0x2deae5['query']=_[_0x72d8('0x30')](_0x66f735[_0x72d8('0x2f')]);_0x2deae5[_0x72d8('0x31')]=_[_0x72d8('0x32')](_0x2deae5[_0x72d8('0x34')],_0x2deae5[_0x72d8('0x2f')]);_0x5044b0[_0x72d8('0x33')]=_[_0x72d8('0x32')](_0x2deae5[_0x72d8('0x34')],qs[_0x72d8('0x35')](_0x66f735['query'][_0x72d8('0x35')]));_0x5044b0[_0x72d8('0x33')]=_0x5044b0[_0x72d8('0x33')][_0x72d8('0x36')]?_0x5044b0[_0x72d8('0x33')]:_0x2deae5[_0x72d8('0x34')];if(_0x66f735[_0x72d8('0x2f')][_0x72d8('0x3f')]){_0x5044b0[_0x72d8('0x40')]=[{'all':!![]}];}_0x5044b0=_['merge']({},_0x5044b0,_0x66f735[_0x72d8('0x45')]);return db[_0x72d8('0x2b')][_0x72d8('0x46')](_0x5044b0)[_0x72d8('0x26')](handleEntityNotFound(_0x232b79,null))[_0x72d8('0x26')](respondWithResult(_0x232b79,null))[_0x72d8('0x42')](handleError(_0x232b79,null));};exports[_0x72d8('0x47')]=function(_0xc16473,_0xaf0114){return db[_0x72d8('0x2b')][_0x72d8('0x47')](_0xc16473['body'],{})['then'](respondWithResult(_0xaf0114,0xc9))[_0x72d8('0x42')](handleError(_0xaf0114,null));};exports[_0x72d8('0x24')]=function(_0x8786f9,_0x57c260){if(_0x8786f9[_0x72d8('0x48')]['id']){delete _0x8786f9['body']['id'];}return db[_0x72d8('0x2b')][_0x72d8('0x46')]({'where':{'id':_0x8786f9['params']['id']}})[_0x72d8('0x26')](handleEntityNotFound(_0x57c260,null))[_0x72d8('0x26')](saveUpdates(_0x8786f9[_0x72d8('0x48')],null))[_0x72d8('0x26')](respondWithResult(_0x57c260,null))[_0x72d8('0x42')](handleError(_0x57c260,null));};exports[_0x72d8('0x25')]=function(_0x8f91a1,_0x156c9b){return db[_0x72d8('0x2b')][_0x72d8('0x46')]({'where':{'id':_0x8f91a1[_0x72d8('0x44')]['id']}})[_0x72d8('0x26')](handleEntityNotFound(_0x156c9b,null))['then'](removeEntity(_0x156c9b,null))[_0x72d8('0x42')](handleError(_0x156c9b,null));};exports[_0x72d8('0x49')]=function(_0x184541,_0x4a2a4a,_0xbd5bd7){var _0x558ddb={};var _0x33b003={};var _0x15d03d;var _0x45cd15;return db[_0x72d8('0x2b')][_0x72d8('0x4a')]({'where':{'id':_0x184541[_0x72d8('0x44')]['id']}})['then'](handleEntityNotFound(_0x4a2a4a,null))[_0x72d8('0x26')](function(_0x11766c){if(_0x11766c){_0x15d03d=_0x11766c;_0x33b003[_0x72d8('0x34')]=_[_0x72d8('0x30')](db[_0x72d8('0x4b')][_0x72d8('0x4c')]);_0x33b003['query']=_[_0x72d8('0x30')](_0x184541[_0x72d8('0x2f')]);_0x33b003[_0x72d8('0x31')]=_['intersection'](_0x33b003[_0x72d8('0x34')],_0x33b003[_0x72d8('0x2f')]);_0x558ddb['attributes']=_['intersection'](_0x33b003[_0x72d8('0x34')],qs[_0x72d8('0x35')](_0x184541[_0x72d8('0x2f')][_0x72d8('0x35')]));_0x558ddb[_0x72d8('0x33')]=_0x558ddb[_0x72d8('0x33')][_0x72d8('0x36')]?_0x558ddb['attributes']:_0x33b003[_0x72d8('0x34')];_0x558ddb[_0x72d8('0x39')]=qs[_0x72d8('0x3a')](_0x184541[_0x72d8('0x2f')]['sort']);_0x558ddb[_0x72d8('0x3b')]=qs['filters'](_[_0x72d8('0x3c')](_0x184541['query'],_0x33b003[_0x72d8('0x31')]));if(_0x184541['query']['filter']){_0x558ddb[_0x72d8('0x3b')]=_[_0x72d8('0x3e')](_0x558ddb['where'],{'$or':_[_0x72d8('0x2a')](_0x558ddb[_0x72d8('0x33')],function(_0x3efad){var _0x916328={};_0x916328[_0x3efad]={'$like':'%'+_0x184541[_0x72d8('0x2f')]['filter']+'%'};return _0x916328;})});}_0x558ddb=_[_0x72d8('0x3e')]({},_0x558ddb,_0x184541['options']);return _0x15d03d[_0x72d8('0x49')](_0x558ddb);}})['then'](function(_0x1af25){if(_0x1af25){_0x45cd15=_0x1af25[_0x72d8('0x36')];if(!_0x184541['query'][_0x72d8('0x37')](_0x72d8('0x38'))){_0x558ddb[_0x72d8('0x1d')]=qs['limit'](_0x184541['query'][_0x72d8('0x1d')]);_0x558ddb[_0x72d8('0x1f')]=qs[_0x72d8('0x1f')](_0x184541[_0x72d8('0x2f')]['offset']);}return _0x15d03d[_0x72d8('0x49')](_0x558ddb);}})[_0x72d8('0x26')](function(_0x3bbe5c){if(_0x3bbe5c){return _0x3bbe5c?{'count':_0x45cd15,'rows':_0x3bbe5c}:null;}})[_0x72d8('0x26')](respondWithResult(_0x4a2a4a,null))[_0x72d8('0x42')](handleError(_0x4a2a4a,null));};exports['getDescriptions']=function(_0x39ddf5,_0xb45265,_0x5b3e71){var _0x3b9dfa={};var _0x54ae03={};var _0x262162;var _0x217893;return db[_0x72d8('0x2b')][_0x72d8('0x4a')]({'where':{'id':_0x39ddf5[_0x72d8('0x44')]['id']}})[_0x72d8('0x26')](handleEntityNotFound(_0xb45265,null))[_0x72d8('0x26')](function(_0xbadcf8){if(_0xbadcf8){_0x262162=_0xbadcf8;_0x54ae03['model']=_[_0x72d8('0x30')](db[_0x72d8('0x4b')]['rawAttributes']);_0x54ae03[_0x72d8('0x2f')]=_[_0x72d8('0x30')](_0x39ddf5[_0x72d8('0x2f')]);_0x54ae03[_0x72d8('0x31')]=_[_0x72d8('0x32')](_0x54ae03[_0x72d8('0x34')],_0x54ae03['query']);_0x3b9dfa[_0x72d8('0x33')]=_['intersection'](_0x54ae03[_0x72d8('0x34')],qs[_0x72d8('0x35')](_0x39ddf5[_0x72d8('0x2f')]['fields']));_0x3b9dfa['attributes']=_0x3b9dfa[_0x72d8('0x33')][_0x72d8('0x36')]?_0x3b9dfa[_0x72d8('0x33')]:_0x54ae03['model'];_0x3b9dfa[_0x72d8('0x39')]=qs['sort'](_0x39ddf5[_0x72d8('0x2f')][_0x72d8('0x3a')]);_0x3b9dfa[_0x72d8('0x3b')]=qs[_0x72d8('0x31')](_[_0x72d8('0x3c')](_0x39ddf5['query'],_0x54ae03['filters']));if(_0x39ddf5['query'][_0x72d8('0x3d')]){_0x3b9dfa['where']=_[_0x72d8('0x3e')](_0x3b9dfa[_0x72d8('0x3b')],{'$or':_['map'](_0x3b9dfa['attributes'],function(_0x4402c8){var _0x28b788={};_0x28b788[_0x4402c8]={'$like':'%'+_0x39ddf5[_0x72d8('0x2f')][_0x72d8('0x3d')]+'%'};return _0x28b788;})});}_0x3b9dfa=_['merge']({},_0x3b9dfa,_0x39ddf5[_0x72d8('0x45')]);return _0x262162['getDescriptions'](_0x3b9dfa);}})[_0x72d8('0x26')](function(_0x23cdc4){if(_0x23cdc4){_0x217893=_0x23cdc4['length'];if(!_0x39ddf5[_0x72d8('0x2f')][_0x72d8('0x37')]('nolimit')){_0x3b9dfa[_0x72d8('0x1d')]=qs[_0x72d8('0x1d')](_0x39ddf5[_0x72d8('0x2f')][_0x72d8('0x1d')]);_0x3b9dfa[_0x72d8('0x1f')]=qs['offset'](_0x39ddf5['query']['offset']);}return _0x262162[_0x72d8('0x4d')](_0x3b9dfa);}})[_0x72d8('0x26')](function(_0x4bce70){if(_0x4bce70){return _0x4bce70?{'count':_0x217893,'rows':_0x4bce70}:null;}})['then'](respondWithResult(_0xb45265,null))[_0x72d8('0x42')](handleError(_0xb45265,null));};exports[_0x72d8('0x4e')]=function(_0x5cd0c9,_0x43c75c,_0x4cef3c){var _0x5c1498={};var _0x112717={};var _0x46b5ad;var _0x3f74cf;return db['FreshsalesConfiguration'][_0x72d8('0x4a')]({'where':{'id':_0x5cd0c9[_0x72d8('0x44')]['id']}})['then'](handleEntityNotFound(_0x43c75c,null))[_0x72d8('0x26')](function(_0x5a3ae0){if(_0x5a3ae0){_0x46b5ad=_0x5a3ae0;_0x112717['model']=_[_0x72d8('0x30')](db[_0x72d8('0x4b')]['rawAttributes']);_0x112717['query']=_[_0x72d8('0x30')](_0x5cd0c9[_0x72d8('0x2f')]);_0x112717['filters']=_[_0x72d8('0x32')](_0x112717[_0x72d8('0x34')],_0x112717[_0x72d8('0x2f')]);_0x5c1498[_0x72d8('0x33')]=_['intersection'](_0x112717['model'],qs[_0x72d8('0x35')](_0x5cd0c9[_0x72d8('0x2f')][_0x72d8('0x35')]));_0x5c1498[_0x72d8('0x33')]=_0x5c1498[_0x72d8('0x33')]['length']?_0x5c1498[_0x72d8('0x33')]:_0x112717[_0x72d8('0x34')];_0x5c1498[_0x72d8('0x39')]=qs[_0x72d8('0x3a')](_0x5cd0c9[_0x72d8('0x2f')]['sort']);_0x5c1498[_0x72d8('0x3b')]=qs[_0x72d8('0x31')](_[_0x72d8('0x3c')](_0x5cd0c9['query'],_0x112717[_0x72d8('0x31')]));if(_0x5cd0c9[_0x72d8('0x2f')][_0x72d8('0x3d')]){_0x5c1498['where']=_[_0x72d8('0x3e')](_0x5c1498[_0x72d8('0x3b')],{'$or':_['map'](_0x5c1498[_0x72d8('0x33')],function(_0x3e7d2d){var _0x46d309={};_0x46d309[_0x3e7d2d]={'$like':'%'+_0x5cd0c9['query'][_0x72d8('0x3d')]+'%'};return _0x46d309;})});}_0x5c1498=_[_0x72d8('0x3e')]({},_0x5c1498,_0x5cd0c9[_0x72d8('0x45')]);return _0x46b5ad['getFields'](_0x5c1498);}})[_0x72d8('0x26')](function(_0x256784){if(_0x256784){_0x3f74cf=_0x256784[_0x72d8('0x36')];if(!_0x5cd0c9['query'][_0x72d8('0x37')](_0x72d8('0x38'))){_0x5c1498[_0x72d8('0x1d')]=qs['limit'](_0x5cd0c9['query']['limit']);_0x5c1498[_0x72d8('0x1f')]=qs[_0x72d8('0x1f')](_0x5cd0c9['query'][_0x72d8('0x1f')]);}return _0x46b5ad[_0x72d8('0x4e')](_0x5c1498);}})[_0x72d8('0x26')](function(_0x24132b){if(_0x24132b){return _0x24132b?{'count':_0x3f74cf,'rows':_0x24132b}:null;}})[_0x72d8('0x26')](respondWithResult(_0x43c75c,null))[_0x72d8('0x42')](handleError(_0x43c75c,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 5c5b4ed..497bd0c 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 _0xb346=['util','api','moment','bluebird','path','rimraf','../../config/environment','exports','FreshsalesConfiguration','int_freshsales_configurations','lodash'];(function(_0x1461e2,_0x3db7f7){var _0x3ab23e=function(_0x4911f6){while(--_0x4911f6){_0x1461e2['push'](_0x1461e2['shift']());}};_0x3ab23e(++_0x3db7f7);}(_0xb346,0x180));var _0x6b34=function(_0x4aa73c,_0x1d3473){_0x4aa73c=_0x4aa73c-0x0;var _0x34ab43=_0xb346[_0x4aa73c];return _0x34ab43;};'use strict';var _=require(_0x6b34('0x0'));var util=require(_0x6b34('0x1'));var logger=require('../../config/logger')(_0x6b34('0x2'));var moment=require(_0x6b34('0x3'));var BPromise=require(_0x6b34('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b34('0x5'));var rimraf=require(_0x6b34('0x6'));var config=require(_0x6b34('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x6b34('0x8')]=function(_0x368d23,_0x20e172){return _0x368d23['define'](_0x6b34('0x9'),attributes,{'tableName':_0x6b34('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb933=['bluebird','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x3b11cb,_0x4318b8){var _0x4fca32=function(_0x5d2b67){while(--_0x5d2b67){_0x3b11cb['push'](_0x3b11cb['shift']());}};_0x4fca32(++_0x4318b8);}(_0xb933,0x79));var _0x3b93=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0xb933[_0x4953da];return _0x2d3780;};'use strict';var _=require(_0x3b93('0x0'));var util=require(_0x3b93('0x1'));var logger=require(_0x3b93('0x2'))(_0x3b93('0x3'));var moment=require(_0x3b93('0x4'));var BPromise=require(_0x3b93('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b93('0x6'));var rimraf=require(_0x3b93('0x7'));var config=require(_0x3b93('0x8'));var attributes=require(_0x3b93('0x9'));module[_0x3b93('0xa')]=function(_0xe800b9,_0x85a96b){return _0xe800b9[_0x3b93('0xb')](_0x3b93('0xc'),attributes,{'tableName':_0x3b93('0xd'),'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 7e90bd6..cc6b6f0 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 _0x597c=['lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x3ccdf5,_0x3c3d1a){var _0xa6f7e9=function(_0x4ea164){while(--_0x4ea164){_0x3ccdf5['push'](_0x3ccdf5['shift']());}};_0xa6f7e9(++_0x3c3d1a);}(_0x597c,0x1ce));var _0xc597=function(_0x51a9b7,_0x5ce85a){_0x51a9b7=_0x51a9b7-0x0;var _0x4e8e07=_0x597c[_0x51a9b7];return _0x4e8e07;};'use strict';var _=require(_0xc597('0x0'));var util=require(_0xc597('0x1'));var moment=require(_0xc597('0x2'));var BPromise=require(_0xc597('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc597('0x4'));var logger=require(_0xc597('0x5'))('rpc');var config=require(_0xc597('0x6'));var jayson=require(_0xc597('0x7'));var client=jayson[_0xc597('0x8')][_0xc597('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33e3e4,_0x4036ff,_0x348d27){return new BPromise(function(_0x1a763a,_0x57539b){return client[_0xc597('0xa')](_0x33e3e4,_0x348d27)[_0xc597('0xb')](function(_0x260965){logger[_0xc597('0xc')](_0xc597('0xd'),_0x4036ff,_0xc597('0xe'));logger[_0xc597('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x4036ff,_0xc597('0xe'),JSON[_0xc597('0x10')](_0x260965));if(_0x260965[_0xc597('0x11')]){if(_0x260965[_0xc597('0x11')][_0xc597('0x12')]===0x1f4){logger['error'](_0xc597('0xd'),_0x4036ff,_0x260965[_0xc597('0x11')]['message']);return _0x57539b(_0x260965['error']['message']);}logger['error'](_0xc597('0xd'),_0x4036ff,_0x260965[_0xc597('0x11')][_0xc597('0x13')]);return _0x1a763a(_0x260965['error']['message']);}else{logger['info'](_0xc597('0xd'),_0x4036ff,_0xc597('0xe'));_0x1a763a(_0x260965[_0xc597('0x14')][_0xc597('0x13')]);}})['catch'](function(_0x3f6a17){logger[_0xc597('0x11')](_0xc597('0xd'),_0x4036ff,_0x3f6a17);_0x57539b(_0x3f6a17);});});} \ No newline at end of file +var _0xa7ec=['info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','code','error','message'];(function(_0x5f58da,_0x1f9d4a){var _0x4f667c=function(_0x195c41){while(--_0x195c41){_0x5f58da['push'](_0x5f58da['shift']());}};_0x4f667c(++_0x1f9d4a);}(_0xa7ec,0x11f));var _0xca7e=function(_0x4d3a2b,_0x2f8e97){_0x4d3a2b=_0x4d3a2b-0x0;var _0x131a42=_0xa7ec[_0x4d3a2b];return _0x131a42;};'use strict';var _=require(_0xca7e('0x0'));var util=require(_0xca7e('0x1'));var moment=require(_0xca7e('0x2'));var BPromise=require(_0xca7e('0x3'));var rs=require(_0xca7e('0x4'));var fs=require('fs');var Redis=require(_0xca7e('0x5'));var db=require(_0xca7e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xca7e('0x7'))(_0xca7e('0x8'));var config=require(_0xca7e('0x9'));var jayson=require(_0xca7e('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x185e05,_0x1bf79e,_0x3812f0){return new BPromise(function(_0x51d057,_0x52e345){return client['request'](_0x185e05,_0x3812f0)['then'](function(_0x5212da){logger['info'](_0xca7e('0xb'),_0x1bf79e,_0xca7e('0xc'));logger['debug'](_0xca7e('0xd'),_0x1bf79e,_0xca7e('0xc'),JSON['stringify'](_0x5212da));if(_0x5212da['error']){if(_0x5212da['error'][_0xca7e('0xe')]===0x1f4){logger[_0xca7e('0xf')](_0xca7e('0xb'),_0x1bf79e,_0x5212da[_0xca7e('0xf')]['message']);return _0x52e345(_0x5212da['error'][_0xca7e('0x10')]);}logger[_0xca7e('0xf')](_0xca7e('0xb'),_0x1bf79e,_0x5212da[_0xca7e('0xf')][_0xca7e('0x10')]);return _0x51d057(_0x5212da['error'][_0xca7e('0x10')]);}else{logger[_0xca7e('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1bf79e,'request\x20sent');_0x51d057(_0x5212da['result'][_0xca7e('0x10')]);}})[_0xca7e('0x12')](function(_0x5644e8){logger['error'](_0xca7e('0xb'),_0x1bf79e,_0x5644e8);_0x52e345(_0x5644e8);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 2f8d81c..38d7272 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 _0x35aa=['isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get'];(function(_0x5a34ae,_0x5682d8){var _0x2841d7=function(_0x2ef934){while(--_0x2ef934){_0x5a34ae['push'](_0x5a34ae['shift']());}};_0x2841d7(++_0x5682d8);}(_0x35aa,0xbe));var _0xa35a=function(_0x48168a,_0xf9dfe5){_0x48168a=_0x48168a-0x0;var _0x346d98=_0x35aa[_0x48168a];return _0x346d98;};'use strict';var multer=require('multer');var util=require(_0xa35a('0x0'));var path=require(_0xa35a('0x1'));var timeout=require(_0xa35a('0x2'));var express=require(_0xa35a('0x3'));var router=express['Router']();var fs_extra=require(_0xa35a('0x4'));var auth=require(_0xa35a('0x5'));var interaction=require(_0xa35a('0x6'));var config=require(_0xa35a('0x7'));var controller=require(_0xa35a('0x8'));router[_0xa35a('0x9')]('/',auth[_0xa35a('0xa')](),controller[_0xa35a('0xb')]);router['get'](_0xa35a('0xc'),auth['isAuthenticated'](),controller[_0xa35a('0xd')]);router[_0xa35a('0xe')]('/',auth[_0xa35a('0xa')](),controller[_0xa35a('0xf')]);router[_0xa35a('0x10')](_0xa35a('0xc'),auth['isAuthenticated'](),controller[_0xa35a('0x11')]);router[_0xa35a('0x12')](_0xa35a('0xc'),auth[_0xa35a('0xa')](),controller['destroy']);module[_0xa35a('0x13')]=router; \ No newline at end of file +var _0x402f=['/:id','post','create','put','update','delete','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x166352,_0x5168e0){var _0xf5e585=function(_0x1df256){while(--_0x1df256){_0x166352['push'](_0x166352['shift']());}};_0xf5e585(++_0x5168e0);}(_0x402f,0x6f));var _0xf402=function(_0x60746,_0x5d12e1){_0x60746=_0x60746-0x0;var _0x1113e4=_0x402f[_0x60746];return _0x1113e4;};'use strict';var multer=require(_0xf402('0x0'));var util=require('util');var path=require(_0xf402('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf402('0x2')]();var fs_extra=require(_0xf402('0x3'));var auth=require(_0xf402('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf402('0x5'));var controller=require('./intFreshsalesField.controller');router[_0xf402('0x6')]('/',auth[_0xf402('0x7')](),controller[_0xf402('0x8')]);router[_0xf402('0x6')](_0xf402('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xf402('0xa')]('/',auth[_0xf402('0x7')](),controller[_0xf402('0xb')]);router[_0xf402('0xc')](_0xf402('0x9'),auth[_0xf402('0x7')](),controller[_0xf402('0xd')]);router[_0xf402('0xe')]('/:id',auth[_0xf402('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 5ee2c15..5d2eb45 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 _0x06af=['exports','ENUM','customVariable','keyValue','STRING','sequelize'];(function(_0x261038,_0x2fab28){var _0x2fd230=function(_0x429660){while(--_0x429660){_0x261038['push'](_0x261038['shift']());}};_0x2fd230(++_0x2fab28);}(_0x06af,0x10d));var _0xf06a=function(_0x5c80eb,_0x46c063){_0x5c80eb=_0x5c80eb-0x0;var _0x89686c=_0x06af[_0x5c80eb];return _0x89686c;};'use strict';var Sequelize=require(_0xf06a('0x0'));module[_0xf06a('0x1')]={'type':{'type':Sequelize[_0xf06a('0x2')]('string','variable',_0xf06a('0x3'),_0xf06a('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xf06a('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf06a('0x5')]},'nameField':{'type':Sequelize[_0xf06a('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf06a('0x5')]}}; \ No newline at end of file +var _0xdfe6=['keyValue','picklist','string','STRING','variable','BOOLEAN','ENUM','customVariable'];(function(_0x51ff26,_0x1e3134){var _0x23304f=function(_0x1dd9dd){while(--_0x1dd9dd){_0x51ff26['push'](_0x51ff26['shift']());}};_0x23304f(++_0x1e3134);}(_0xdfe6,0x146));var _0x6dfe=function(_0x590be1,_0x1a3fbc){_0x590be1=_0x590be1-0x0;var _0x269f3f=_0xdfe6[_0x590be1];return _0x269f3f;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x6dfe('0x0')]('string','variable',_0x6dfe('0x1'),_0x6dfe('0x2'),_0x6dfe('0x3')),'defaultValue':_0x6dfe('0x4')},'content':{'type':Sequelize[_0x6dfe('0x5')]},'key':{'type':Sequelize[_0x6dfe('0x5')]},'keyType':{'type':Sequelize[_0x6dfe('0x0')](_0x6dfe('0x4'),_0x6dfe('0x6'),_0x6dfe('0x1'))},'keyContent':{'type':Sequelize[_0x6dfe('0x5')]},'idField':{'type':Sequelize[_0x6dfe('0x5')]},'nameField':{'type':Sequelize[_0x6dfe('0x5')]},'customField':{'type':Sequelize[_0x6dfe('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6dfe('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 304d567..8c14eb1 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 _0x44ad=['status','offset','undefined','limit','json','reject','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','where','filter','merge','options','count','includeAll','include','rows','show','keys','rawAttributes','length','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0xe1fcfb,_0x24fcee){var _0x21528f=function(_0x1ca0bf){while(--_0x1ca0bf){_0xe1fcfb['push'](_0xe1fcfb['shift']());}};_0x21528f(++_0x24fcee);}(_0x44ad,0x1d8));var _0xd44a=function(_0x287f3c,_0x1b7746){_0x287f3c=_0x287f3c-0x0;var _0x16af7b=_0x44ad[_0x287f3c];return _0x16af7b;};'use strict';var emlformat=require(_0xd44a('0x0'));var rimraf=require(_0xd44a('0x1'));var zipdir=require(_0xd44a('0x2'));var jsonpatch=require(_0xd44a('0x3'));var rp=require('request-promise');var moment=require(_0xd44a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd44a('0x5'));var util=require(_0xd44a('0x6'));var path=require(_0xd44a('0x7'));var sox=require(_0xd44a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd44a('0x9'));var _=require(_0xd44a('0xa'));var squel=require(_0xd44a('0xb'));var crypto=require(_0xd44a('0xc'));var jsforce=require(_0xd44a('0xd'));var deskjs=require(_0xd44a('0xe'));var toCsv=require(_0xd44a('0xf'));var querystring=require(_0xd44a('0x10'));var Papa=require('papaparse');var Redis=require(_0xd44a('0x11'));var authService=require(_0xd44a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd44a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd44a('0x14'))('api');var utils=require(_0xd44a('0x15'));var config=require(_0xd44a('0x16'));var licenseUtil=require(_0xd44a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f10a9,_0x4b55cb){_0x4b55cb=_0x4b55cb||0xcc;return function(_0xf9bc27){if(_0xf9bc27){return _0x5f10a9[_0xd44a('0x18')](_0x4b55cb);}return _0x5f10a9[_0xd44a('0x19')](_0x4b55cb)['end']();};}function respondWithResult(_0x3b915e,_0x1209cd){_0x1209cd=_0x1209cd||0xc8;return function(_0x4fd1ac){if(_0x4fd1ac){return _0x3b915e[_0xd44a('0x19')](_0x1209cd)['json'](_0x4fd1ac);}};}function respondWithFilteredResult(_0x457824,_0x2e2b23){return function(_0x53e54c){if(_0x53e54c){var _0x930795=typeof _0x2e2b23[_0xd44a('0x1a')]===_0xd44a('0x1b')&&typeof _0x2e2b23[_0xd44a('0x1c')]==='undefined';var _0x38d09f=_0x53e54c['count'];var _0x230a5b=_0x930795?0x0:_0x2e2b23[_0xd44a('0x1a')];var _0x524ace=_0x930795?_0x53e54c['count']:_0x2e2b23[_0xd44a('0x1a')]+_0x2e2b23[_0xd44a('0x1c')];var _0xbe0d32;if(_0x524ace>=_0x38d09f){_0x524ace=_0x38d09f;_0xbe0d32=0xc8;}else{_0xbe0d32=0xce;}_0x457824[_0xd44a('0x19')](_0xbe0d32);return _0x457824['set']('Content-Range',_0x230a5b+'-'+_0x524ace+'/'+_0x38d09f)[_0xd44a('0x1d')](_0x53e54c);}return null;};}function patchUpdates(_0x56ce69){return function(_0x3a70c7){try{jsonpatch['apply'](_0x3a70c7,_0x56ce69,!![]);}catch(_0x2a05c){return BPromise[_0xd44a('0x1e')](_0x2a05c);}return _0x3a70c7['save']();};}function saveUpdates(_0x3f0bee,_0x5e883d){return function(_0x29ce5d){if(_0x29ce5d){return _0x29ce5d[_0xd44a('0x1f')](_0x3f0bee)[_0xd44a('0x20')](function(_0x38d7f9){return _0x38d7f9;});}return null;};}function removeEntity(_0x6903ac,_0x532acc){return function(_0x334ae0){if(_0x334ae0){return _0x334ae0[_0xd44a('0x21')]()[_0xd44a('0x20')](function(){_0x6903ac[_0xd44a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39165c,_0x123292){return function(_0x42e18b){if(!_0x42e18b){_0x39165c[_0xd44a('0x18')](0x194);}return _0x42e18b;};}function handleError(_0x4b2db8,_0x4e7be9){_0x4e7be9=_0x4e7be9||0x1f4;return function(_0x5a07b3){logger[_0xd44a('0x22')](_0x5a07b3[_0xd44a('0x23')]);if(_0x5a07b3['name']){delete _0x5a07b3[_0xd44a('0x24')];}_0x4b2db8[_0xd44a('0x19')](_0x4e7be9)[_0xd44a('0x25')](_0x5a07b3);};}exports[_0xd44a('0x26')]=function(_0x3af757,_0x5d78e8){var _0x43b7a2={},_0x3cdbc4={},_0x32d8c3={'count':0x0,'rows':[]};var _0x2be5f1=_[_0xd44a('0x27')](db[_0xd44a('0x28')]['rawAttributes'],function(_0xf223e1){return{'name':_0xf223e1[_0xd44a('0x29')],'type':_0xf223e1[_0xd44a('0x2a')][_0xd44a('0x2b')]};});_0x3cdbc4[_0xd44a('0x2c')]=_['map'](_0x2be5f1,_0xd44a('0x24'));_0x3cdbc4[_0xd44a('0x2d')]=_['keys'](_0x3af757[_0xd44a('0x2d')]);_0x3cdbc4[_0xd44a('0x2e')]=_[_0xd44a('0x2f')](_0x3cdbc4[_0xd44a('0x2c')],_0x3cdbc4[_0xd44a('0x2d')]);_0x43b7a2[_0xd44a('0x30')]=_[_0xd44a('0x2f')](_0x3cdbc4[_0xd44a('0x2c')],qs[_0xd44a('0x31')](_0x3af757['query']['fields']));_0x43b7a2[_0xd44a('0x30')]=_0x43b7a2[_0xd44a('0x30')]['length']?_0x43b7a2[_0xd44a('0x30')]:_0x3cdbc4[_0xd44a('0x2c')];if(!_0x3af757[_0xd44a('0x2d')]['hasOwnProperty'](_0xd44a('0x32'))){_0x43b7a2[_0xd44a('0x1c')]=qs[_0xd44a('0x1c')](_0x3af757[_0xd44a('0x2d')][_0xd44a('0x1c')]);_0x43b7a2[_0xd44a('0x1a')]=qs[_0xd44a('0x1a')](_0x3af757['query'][_0xd44a('0x1a')]);}_0x43b7a2[_0xd44a('0x33')]=qs['sort'](_0x3af757[_0xd44a('0x2d')][_0xd44a('0x34')]);_0x43b7a2['where']=qs[_0xd44a('0x2e')](_[_0xd44a('0x35')](_0x3af757['query'],_0x3cdbc4[_0xd44a('0x2e')]),_0x2be5f1);if(_0x3af757[_0xd44a('0x2d')]['filter']){_0x43b7a2[_0xd44a('0x36')]=_['merge'](_0x43b7a2['where'],{'$or':_['map'](_0x2be5f1,function(_0x1f6831){if(_0x1f6831[_0xd44a('0x2a')]!=='VIRTUAL'){var _0xc21d70={};_0xc21d70[_0x1f6831[_0xd44a('0x24')]]={'$like':'%'+_0x3af757['query'][_0xd44a('0x37')]+'%'};return _0xc21d70;}})});}_0x43b7a2=_[_0xd44a('0x38')]({},_0x43b7a2,_0x3af757[_0xd44a('0x39')]);var _0x555180={'where':_0x43b7a2[_0xd44a('0x36')]};return db[_0xd44a('0x28')][_0xd44a('0x3a')](_0x555180)[_0xd44a('0x20')](function(_0x52abe9){_0x32d8c3['count']=_0x52abe9;if(_0x3af757['query'][_0xd44a('0x3b')]){_0x43b7a2[_0xd44a('0x3c')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x43b7a2);})[_0xd44a('0x20')](function(_0x28067a){_0x32d8c3[_0xd44a('0x3d')]=_0x28067a;return _0x32d8c3;})[_0xd44a('0x20')](respondWithFilteredResult(_0x5d78e8,_0x43b7a2))['catch'](handleError(_0x5d78e8,null));};exports[_0xd44a('0x3e')]=function(_0x25e2a9,_0x19cdc8){var _0x5b9d80={'raw':!![],'where':{'id':_0x25e2a9['params']['id']}},_0x23575e={};_0x23575e[_0xd44a('0x2c')]=_[_0xd44a('0x3f')](db[_0xd44a('0x28')][_0xd44a('0x40')]);_0x23575e[_0xd44a('0x2d')]=_[_0xd44a('0x3f')](_0x25e2a9[_0xd44a('0x2d')]);_0x23575e[_0xd44a('0x2e')]=_[_0xd44a('0x2f')](_0x23575e[_0xd44a('0x2c')],_0x23575e[_0xd44a('0x2d')]);_0x5b9d80['attributes']=_[_0xd44a('0x2f')](_0x23575e[_0xd44a('0x2c')],qs[_0xd44a('0x31')](_0x25e2a9[_0xd44a('0x2d')][_0xd44a('0x31')]));_0x5b9d80[_0xd44a('0x30')]=_0x5b9d80[_0xd44a('0x30')][_0xd44a('0x41')]?_0x5b9d80[_0xd44a('0x30')]:_0x23575e['model'];if(_0x25e2a9[_0xd44a('0x2d')][_0xd44a('0x3b')]){_0x5b9d80[_0xd44a('0x3c')]=[{'all':!![]}];}_0x5b9d80=_[_0xd44a('0x38')]({},_0x5b9d80,_0x25e2a9[_0xd44a('0x39')]);return db[_0xd44a('0x28')][_0xd44a('0x42')](_0x5b9d80)['then'](handleEntityNotFound(_0x19cdc8,null))[_0xd44a('0x20')](respondWithResult(_0x19cdc8,null))[_0xd44a('0x43')](handleError(_0x19cdc8,null));};exports[_0xd44a('0x44')]=function(_0x2b8f36,_0x55b4e5){return db[_0xd44a('0x28')]['create'](_0x2b8f36[_0xd44a('0x45')],{})[_0xd44a('0x20')](respondWithResult(_0x55b4e5,0xc9))[_0xd44a('0x43')](handleError(_0x55b4e5,null));};exports['update']=function(_0x252926,_0x1f7eb1){if(_0x252926[_0xd44a('0x45')]['id']){delete _0x252926[_0xd44a('0x45')]['id'];}return db[_0xd44a('0x28')][_0xd44a('0x42')]({'where':{'id':_0x252926[_0xd44a('0x46')]['id']}})[_0xd44a('0x20')](handleEntityNotFound(_0x1f7eb1,null))[_0xd44a('0x20')](saveUpdates(_0x252926[_0xd44a('0x45')],null))['then'](respondWithResult(_0x1f7eb1,null))[_0xd44a('0x43')](handleError(_0x1f7eb1,null));};exports[_0xd44a('0x21')]=function(_0x1b1490,_0x45c531){return db['FreshsalesField'][_0xd44a('0x42')]({'where':{'id':_0x1b1490[_0xd44a('0x46')]['id']}})[_0xd44a('0x20')](handleEntityNotFound(_0x45c531,null))[_0xd44a('0x20')](removeEntity(_0x45c531,null))[_0xd44a('0x43')](handleError(_0x45c531,null));}; \ No newline at end of file +var _0x375c=['catch','show','params','length','options','create','body','find','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','json','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','map','FreshsalesField','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows'];(function(_0x23b9ba,_0x453399){var _0x3ac207=function(_0x157b2a){while(--_0x157b2a){_0x23b9ba['push'](_0x23b9ba['shift']());}};_0x3ac207(++_0x453399);}(_0x375c,0xda));var _0xc375=function(_0x1e9c41,_0x2357b2){_0x1e9c41=_0x1e9c41-0x0;var _0xf0bb94=_0x375c[_0x1e9c41];return _0xf0bb94;};'use strict';var emlformat=require(_0xc375('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc375('0x1'));var rp=require('request-promise');var moment=require(_0xc375('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc375('0x3'));var util=require(_0xc375('0x4'));var path=require(_0xc375('0x5'));var sox=require(_0xc375('0x6'));var csv=require(_0xc375('0x7'));var ejs=require(_0xc375('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc375('0x9'));var crypto=require('crypto');var jsforce=require(_0xc375('0xa'));var deskjs=require(_0xc375('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc375('0xc'));var Papa=require('papaparse');var Redis=require(_0xc375('0xd'));var authService=require(_0xc375('0xe'));var qs=require(_0xc375('0xf'));var as=require(_0xc375('0x10'));var hardwareService=require(_0xc375('0x11'));var logger=require(_0xc375('0x12'))(_0xc375('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc375('0x14'));var db=require(_0xc375('0x15'))['db'];function respondWithStatusCode(_0x4c9bd5,_0xeae210){_0xeae210=_0xeae210||0xcc;return function(_0x51fd3c){if(_0x51fd3c){return _0x4c9bd5['sendStatus'](_0xeae210);}return _0x4c9bd5[_0xc375('0x16')](_0xeae210)[_0xc375('0x17')]();};}function respondWithResult(_0x5e611d,_0x238884){_0x238884=_0x238884||0xc8;return function(_0x17216a){if(_0x17216a){return _0x5e611d[_0xc375('0x16')](_0x238884)['json'](_0x17216a);}};}function respondWithFilteredResult(_0x54b930,_0x155862){return function(_0x40738e){if(_0x40738e){var _0x343216=typeof _0x155862[_0xc375('0x18')]===_0xc375('0x19')&&typeof _0x155862[_0xc375('0x1a')]==='undefined';var _0x584b58=_0x40738e[_0xc375('0x1b')];var _0x562376=_0x343216?0x0:_0x155862[_0xc375('0x18')];var _0x346aad=_0x343216?_0x40738e['count']:_0x155862[_0xc375('0x18')]+_0x155862[_0xc375('0x1a')];var _0x5c63a1;if(_0x346aad>=_0x584b58){_0x346aad=_0x584b58;_0x5c63a1=0xc8;}else{_0x5c63a1=0xce;}_0x54b930[_0xc375('0x16')](_0x5c63a1);return _0x54b930['set']('Content-Range',_0x562376+'-'+_0x346aad+'/'+_0x584b58)[_0xc375('0x1c')](_0x40738e);}return null;};}function patchUpdates(_0x5d222d){return function(_0x949afb){try{jsonpatch[_0xc375('0x1d')](_0x949afb,_0x5d222d,!![]);}catch(_0x3e8bf9){return BPromise[_0xc375('0x1e')](_0x3e8bf9);}return _0x949afb['save']();};}function saveUpdates(_0x2cb957,_0x231cf8){return function(_0x1b8784){if(_0x1b8784){return _0x1b8784[_0xc375('0x1f')](_0x2cb957)['then'](function(_0x44544c){return _0x44544c;});}return null;};}function removeEntity(_0x30cb73,_0x485d3e){return function(_0xff348c){if(_0xff348c){return _0xff348c[_0xc375('0x20')]()[_0xc375('0x21')](function(){_0x30cb73[_0xc375('0x16')](0xcc)[_0xc375('0x17')]();});}};}function handleEntityNotFound(_0x389fc9,_0x293fad){return function(_0x147f90){if(!_0x147f90){_0x389fc9[_0xc375('0x22')](0x194);}return _0x147f90;};}function handleError(_0x1adf0f,_0x9e650a){_0x9e650a=_0x9e650a||0x1f4;return function(_0x423546){logger[_0xc375('0x23')](_0x423546[_0xc375('0x24')]);if(_0x423546['name']){delete _0x423546[_0xc375('0x25')];}_0x1adf0f[_0xc375('0x16')](_0x9e650a)[_0xc375('0x26')](_0x423546);};}exports[_0xc375('0x27')]=function(_0x13c43a,_0x7a0fdb){var _0x224eaa={},_0x2bcd67={},_0x2b98c7={'count':0x0,'rows':[]};var _0x2d85c3=_[_0xc375('0x28')](db[_0xc375('0x29')][_0xc375('0x2a')],function(_0x23c18d){return{'name':_0x23c18d['fieldName'],'type':_0x23c18d[_0xc375('0x2b')][_0xc375('0x2c')]};});_0x2bcd67[_0xc375('0x2d')]=_[_0xc375('0x28')](_0x2d85c3,_0xc375('0x25'));_0x2bcd67[_0xc375('0x2e')]=_[_0xc375('0x2f')](_0x13c43a[_0xc375('0x2e')]);_0x2bcd67['filters']=_['intersection'](_0x2bcd67[_0xc375('0x2d')],_0x2bcd67[_0xc375('0x2e')]);_0x224eaa[_0xc375('0x30')]=_[_0xc375('0x31')](_0x2bcd67[_0xc375('0x2d')],qs[_0xc375('0x32')](_0x13c43a['query'][_0xc375('0x32')]));_0x224eaa[_0xc375('0x30')]=_0x224eaa[_0xc375('0x30')]['length']?_0x224eaa[_0xc375('0x30')]:_0x2bcd67[_0xc375('0x2d')];if(!_0x13c43a['query']['hasOwnProperty'](_0xc375('0x33'))){_0x224eaa[_0xc375('0x1a')]=qs[_0xc375('0x1a')](_0x13c43a[_0xc375('0x2e')]['limit']);_0x224eaa[_0xc375('0x18')]=qs[_0xc375('0x18')](_0x13c43a['query'][_0xc375('0x18')]);}_0x224eaa['order']=qs['sort'](_0x13c43a[_0xc375('0x2e')][_0xc375('0x34')]);_0x224eaa[_0xc375('0x35')]=qs[_0xc375('0x36')](_[_0xc375('0x37')](_0x13c43a[_0xc375('0x2e')],_0x2bcd67['filters']),_0x2d85c3);if(_0x13c43a[_0xc375('0x2e')][_0xc375('0x38')]){_0x224eaa[_0xc375('0x35')]=_[_0xc375('0x39')](_0x224eaa['where'],{'$or':_[_0xc375('0x28')](_0x2d85c3,function(_0x25c3af){if(_0x25c3af[_0xc375('0x2b')]!==_0xc375('0x3a')){var _0x50358b={};_0x50358b[_0x25c3af[_0xc375('0x25')]]={'$like':'%'+_0x13c43a[_0xc375('0x2e')][_0xc375('0x38')]+'%'};return _0x50358b;}})});}_0x224eaa=_[_0xc375('0x39')]({},_0x224eaa,_0x13c43a['options']);var _0x2a4624={'where':_0x224eaa['where']};return db[_0xc375('0x29')][_0xc375('0x1b')](_0x2a4624)[_0xc375('0x21')](function(_0x360e29){_0x2b98c7[_0xc375('0x1b')]=_0x360e29;if(_0x13c43a[_0xc375('0x2e')][_0xc375('0x3b')]){_0x224eaa[_0xc375('0x3c')]=[{'all':!![]}];}return db[_0xc375('0x29')]['findAll'](_0x224eaa);})[_0xc375('0x21')](function(_0x1fdb53){_0x2b98c7[_0xc375('0x3d')]=_0x1fdb53;return _0x2b98c7;})[_0xc375('0x21')](respondWithFilteredResult(_0x7a0fdb,_0x224eaa))[_0xc375('0x3e')](handleError(_0x7a0fdb,null));};exports[_0xc375('0x3f')]=function(_0x19a355,_0x2e91c2){var _0x28d5e6={'raw':!![],'where':{'id':_0x19a355[_0xc375('0x40')]['id']}},_0x4d4f2d={};_0x4d4f2d['model']=_[_0xc375('0x2f')](db[_0xc375('0x29')][_0xc375('0x2a')]);_0x4d4f2d['query']=_[_0xc375('0x2f')](_0x19a355[_0xc375('0x2e')]);_0x4d4f2d[_0xc375('0x36')]=_[_0xc375('0x31')](_0x4d4f2d[_0xc375('0x2d')],_0x4d4f2d[_0xc375('0x2e')]);_0x28d5e6[_0xc375('0x30')]=_['intersection'](_0x4d4f2d[_0xc375('0x2d')],qs[_0xc375('0x32')](_0x19a355[_0xc375('0x2e')]['fields']));_0x28d5e6[_0xc375('0x30')]=_0x28d5e6[_0xc375('0x30')][_0xc375('0x41')]?_0x28d5e6[_0xc375('0x30')]:_0x4d4f2d[_0xc375('0x2d')];if(_0x19a355[_0xc375('0x2e')][_0xc375('0x3b')]){_0x28d5e6[_0xc375('0x3c')]=[{'all':!![]}];}_0x28d5e6=_[_0xc375('0x39')]({},_0x28d5e6,_0x19a355[_0xc375('0x42')]);return db[_0xc375('0x29')]['find'](_0x28d5e6)[_0xc375('0x21')](handleEntityNotFound(_0x2e91c2,null))['then'](respondWithResult(_0x2e91c2,null))[_0xc375('0x3e')](handleError(_0x2e91c2,null));};exports[_0xc375('0x43')]=function(_0x41d2c7,_0x219cdc){return db[_0xc375('0x29')][_0xc375('0x43')](_0x41d2c7[_0xc375('0x44')],{})[_0xc375('0x21')](respondWithResult(_0x219cdc,0xc9))[_0xc375('0x3e')](handleError(_0x219cdc,null));};exports[_0xc375('0x1f')]=function(_0x4a91a9,_0x3c1984){if(_0x4a91a9['body']['id']){delete _0x4a91a9['body']['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x4a91a9[_0xc375('0x40')]['id']}})[_0xc375('0x21')](handleEntityNotFound(_0x3c1984,null))[_0xc375('0x21')](saveUpdates(_0x4a91a9[_0xc375('0x44')],null))[_0xc375('0x21')](respondWithResult(_0x3c1984,null))[_0xc375('0x3e')](handleError(_0x3c1984,null));};exports[_0xc375('0x20')]=function(_0x2830db,_0x163e78){return db[_0xc375('0x29')][_0xc375('0x45')]({'where':{'id':_0x2830db[_0xc375('0x40')]['id']}})['then'](handleEntityNotFound(_0x163e78,null))['then'](removeEntity(_0x163e78,null))['catch'](handleError(_0x163e78,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index edebcd8..269cadf 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 _0x79e2=['int_freshsales_fields','freshsales_unique_index','idField','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField'];(function(_0x3a15f8,_0x48b474){var _0x6e4f41=function(_0x2e5d32){while(--_0x2e5d32){_0x3a15f8['push'](_0x3a15f8['shift']());}};_0x6e4f41(++_0x48b474);}(_0x79e2,0x1c3));var _0x279e=function(_0x3f8e83,_0x457fd5){_0x3f8e83=_0x3f8e83-0x0;var _0x1a1b44=_0x79e2[_0x3f8e83];return _0x1a1b44;};'use strict';var _=require(_0x279e('0x0'));var util=require('util');var logger=require(_0x279e('0x1'))(_0x279e('0x2'));var moment=require(_0x279e('0x3'));var BPromise=require('bluebird');var rp=require(_0x279e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x279e('0x5'));var config=require(_0x279e('0x6'));var attributes=require(_0x279e('0x7'));module[_0x279e('0x8')]=function(_0x4b7028,_0x5a2f72){return _0x4b7028[_0x279e('0x9')](_0x279e('0xa'),attributes,{'tableName':_0x279e('0xb'),'paranoid':![],'indexes':[{'name':_0x279e('0xc'),'fields':[_0x279e('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xde46=['request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','../../config/logger','api'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xde46,0x14e));var _0x6de4=function(_0x21eaf4,_0x55a046){_0x21eaf4=_0x21eaf4-0x0;var _0x1ad94d=_0xde46[_0x21eaf4];return _0x1ad94d;};'use strict';var _=require(_0x6de4('0x0'));var util=require(_0x6de4('0x1'));var logger=require(_0x6de4('0x2'))(_0x6de4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6de4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6de4('0x5'));var config=require(_0x6de4('0x6'));var attributes=require(_0x6de4('0x7'));module[_0x6de4('0x8')]=function(_0x525dcc,_0x47eb32){return _0x525dcc[_0x6de4('0x9')]('FreshsalesField',attributes,{'tableName':_0x6de4('0xa'),'paranoid':![],'indexes':[{'name':_0x6de4('0xb'),'fields':['idField',_0x6de4('0xc')],'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 a3d4934..b81962b 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 _0x2bd8=['info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x138b21,_0x3c08ae){var _0xad1913=function(_0x4efc49){while(--_0x4efc49){_0x138b21['push'](_0x138b21['shift']());}};_0xad1913(++_0x3c08ae);}(_0x2bd8,0x130));var _0x82bd=function(_0x2a49d8,_0x4d8a48){_0x2a49d8=_0x2a49d8-0x0;var _0x4ce342=_0x2bd8[_0x2a49d8];return _0x4ce342;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var moment=require(_0x82bd('0x1'));var BPromise=require(_0x82bd('0x2'));var rs=require(_0x82bd('0x3'));var fs=require('fs');var Redis=require(_0x82bd('0x4'));var db=require(_0x82bd('0x5'))['db'];var utils=require(_0x82bd('0x6'));var logger=require(_0x82bd('0x7'))('rpc');var config=require(_0x82bd('0x8'));var jayson=require(_0x82bd('0x9'));var client=jayson[_0x82bd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19dbb1,_0x77d7a9,_0x226f60){return new BPromise(function(_0x1f7463,_0x4dc3a6){return client[_0x82bd('0xb')](_0x19dbb1,_0x226f60)['then'](function(_0x4a9b2c){logger['info'](_0x82bd('0xc'),_0x77d7a9,'request\x20sent');logger['debug'](_0x82bd('0xd'),_0x77d7a9,'request\x20sent',JSON['stringify'](_0x4a9b2c));if(_0x4a9b2c[_0x82bd('0xe')]){if(_0x4a9b2c[_0x82bd('0xe')]['code']===0x1f4){logger[_0x82bd('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x4a9b2c[_0x82bd('0xe')]['message']);return _0x4dc3a6(_0x4a9b2c[_0x82bd('0xe')][_0x82bd('0xf')]);}logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x4a9b2c['error'][_0x82bd('0xf')]);return _0x1f7463(_0x4a9b2c[_0x82bd('0xe')]['message']);}else{logger[_0x82bd('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x82bd('0x11'));_0x1f7463(_0x4a9b2c[_0x82bd('0x12')][_0x82bd('0xf')]);}})[_0x82bd('0x13')](function(_0x209081){logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x209081);_0x4dc3a6(_0x209081);});});} \ No newline at end of file +var _0xbd51=['FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xbd51,0x1a8));var _0x1bd5=function(_0xd470ca,_0x537863){_0xd470ca=_0xd470ca-0x0;var _0xbe1376=_0xbd51[_0xd470ca];return _0xbe1376;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var moment=require(_0x1bd5('0x1'));var BPromise=require(_0x1bd5('0x2'));var rs=require(_0x1bd5('0x3'));var fs=require('fs');var Redis=require(_0x1bd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1bd5('0x5'));var jayson=require(_0x1bd5('0x6'));var client=jayson[_0x1bd5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29abea,_0x30a385,_0x19077c){return new BPromise(function(_0x27d58f,_0xd8418f){return client['request'](_0x29abea,_0x19077c)[_0x1bd5('0x8')](function(_0x5c8e0d){logger[_0x1bd5('0x9')](_0x1bd5('0xa'),_0x30a385,_0x1bd5('0xb'));logger[_0x1bd5('0xc')](_0x1bd5('0xd'),_0x30a385,_0x1bd5('0xb'),JSON['stringify'](_0x5c8e0d));if(_0x5c8e0d[_0x1bd5('0xe')]){if(_0x5c8e0d['error'][_0x1bd5('0xf')]===0x1f4){logger[_0x1bd5('0xe')](_0x1bd5('0xa'),_0x30a385,_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);return _0xd8418f(_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x30a385,_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);return _0x27d58f(_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x30a385,_0x1bd5('0xb'));_0x27d58f(_0x5c8e0d[_0x1bd5('0x11')][_0x1bd5('0x10')]);}})[_0x1bd5('0x12')](function(_0x43ea3e){logger[_0x1bd5('0xe')](_0x1bd5('0xa'),_0x30a385,_0x43ea3e);_0xd8418f(_0x43ea3e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 4353511..a0d2f4d 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x173f30,_0x2adb15){var _0x1ab03a=function(_0x3df124){while(--_0x3df124){_0x173f30['push'](_0x173f30['shift']());}};_0x1ab03a(++_0x2adb15);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x2fa0c6,_0x45fbeb){var _0x36ffb0=function(_0x3e82f1){while(--_0x3e82f1){_0x2fa0c6['push'](_0x2fa0c6['shift']());}};_0x36ffb0(++_0x45fbeb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index ab35fd5..fd57c59 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 _0x84c6=['ENUM','integrationTab','newTab','STRING'];(function(_0x5c61b4,_0x483671){var _0x34f806=function(_0x135ebc){while(--_0x135ebc){_0x5c61b4['push'](_0x5c61b4['shift']());}};_0x34f806(++_0x483671);}(_0x84c6,0xe7));var _0x684c=function(_0x31faa3,_0x29c83b){_0x31faa3=_0x31faa3-0x0;var _0x539ac2=_0x84c6[_0x31faa3];return _0x539ac2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x684c('0x0')]},'description':{'type':Sequelize[_0x684c('0x0')]},'username':{'type':Sequelize[_0x684c('0x0')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x684c('0x0')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x684c('0x0')]},'clientSecret':{'type':Sequelize[_0x684c('0x0')]},'securityToken':{'type':Sequelize[_0x684c('0x0')]},'serverUrl':{'type':Sequelize[_0x684c('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x684c('0x1')](_0x684c('0x2'),_0x684c('0x3')),'defaultValue':_0x684c('0x2')}}; \ No newline at end of file +var _0x0c2b=['STRING','username','ENUM','newTab','integrationTab','sequelize','exports'];(function(_0x58a18a,_0x1d948a){var _0x504330=function(_0x2be3d2){while(--_0x2be3d2){_0x58a18a['push'](_0x58a18a['shift']());}};_0x504330(++_0x1d948a);}(_0x0c2b,0x194));var _0xb0c2=function(_0x1fa1f0,_0x2d3bcf){_0x1fa1f0=_0x1fa1f0-0x0;var _0x4c9d80=_0x0c2b[_0x1fa1f0];return _0x4c9d80;};'use strict';var Sequelize=require(_0xb0c2('0x0'));module[_0xb0c2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb0c2('0x2')]},'username':{'type':Sequelize[_0xb0c2('0x2')],'unique':_0xb0c2('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb0c2('0x2')]},'clientSecret':{'type':Sequelize[_0xb0c2('0x2')]},'securityToken':{'type':Sequelize[_0xb0c2('0x2')]},'serverUrl':{'type':Sequelize[_0xb0c2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb0c2('0x4')]('integrationTab',_0xb0c2('0x5')),'defaultValue':_0xb0c2('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index af5c1dc..b4a426d 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 _0xe373=['params','rawAttributes','options','create','body','getConfigurations','findOne','SalesforceConfiguration','nolimit','Subjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','substring','Connection','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Subject','Description','picklist','boolean','textarea','remove','includes','label','picklistValues','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','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/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','SalesforceAccount','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','rows','catch','show'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xe373,0x129));var _0x3e37=function(_0x58b4d2,_0x376ce5){_0x58b4d2=_0x58b4d2-0x0;var _0x58570f=_0xe373[_0x58b4d2];return _0x58570f;};'use strict';var emlformat=require(_0x3e37('0x0'));var rimraf=require(_0x3e37('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e37('0x2'));var rp=require(_0x3e37('0x3'));var moment=require(_0x3e37('0x4'));var BPromise=require(_0x3e37('0x5'));var Mustache=require(_0x3e37('0x6'));var util=require(_0x3e37('0x7'));var path=require(_0x3e37('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3e37('0x9'));var fs=require('fs');var fs_extra=require(_0x3e37('0xa'));var _=require(_0x3e37('0xb'));var squel=require(_0x3e37('0xc'));var crypto=require(_0x3e37('0xd'));var jsforce=require(_0x3e37('0xe'));var deskjs=require(_0x3e37('0xf'));var toCsv=require(_0x3e37('0x10'));var querystring=require(_0x3e37('0x11'));var Papa=require(_0x3e37('0x12'));var Redis=require('ioredis');var authService=require(_0x3e37('0x13'));var qs=require(_0x3e37('0x14'));var as=require(_0x3e37('0x15'));var hardwareService=require(_0x3e37('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x3e37('0x17'));var config=require(_0x3e37('0x18'));var licenseUtil=require(_0x3e37('0x19'));var db=require(_0x3e37('0x1a'))['db'];var integrations=require(_0x3e37('0x1b'));function respondWithStatusCode(_0x22f1d0,_0x4dbde6){_0x4dbde6=_0x4dbde6||0xcc;return function(_0x56fbf5){if(_0x56fbf5){return _0x22f1d0[_0x3e37('0x1c')](_0x4dbde6);}return _0x22f1d0[_0x3e37('0x1d')](_0x4dbde6)[_0x3e37('0x1e')]();};}function respondWithResult(_0x15bb65,_0x10921e){_0x10921e=_0x10921e||0xc8;return function(_0x595884){if(_0x595884){return _0x15bb65['status'](_0x10921e)[_0x3e37('0x1f')](_0x595884);}};}function respondWithFilteredResult(_0x1f25e2,_0xc913c7){return function(_0x1fc476){if(_0x1fc476){var _0x8fc9ea=typeof _0xc913c7[_0x3e37('0x20')]===_0x3e37('0x21')&&typeof _0xc913c7[_0x3e37('0x22')]===_0x3e37('0x21');var _0x3ec39f=_0x1fc476[_0x3e37('0x23')];var _0x22e27f=_0x8fc9ea?0x0:_0xc913c7[_0x3e37('0x20')];var _0x2b32e7=_0x8fc9ea?_0x1fc476['count']:_0xc913c7[_0x3e37('0x20')]+_0xc913c7[_0x3e37('0x22')];var _0x584ab6;if(_0x2b32e7>=_0x3ec39f){_0x2b32e7=_0x3ec39f;_0x584ab6=0xc8;}else{_0x584ab6=0xce;}_0x1f25e2['status'](_0x584ab6);return _0x1f25e2[_0x3e37('0x24')](_0x3e37('0x25'),_0x22e27f+'-'+_0x2b32e7+'/'+_0x3ec39f)[_0x3e37('0x1f')](_0x1fc476);}return null;};}function patchUpdates(_0x4727b5){return function(_0x50960a){try{jsonpatch[_0x3e37('0x26')](_0x50960a,_0x4727b5,!![]);}catch(_0x52bea1){return BPromise[_0x3e37('0x27')](_0x52bea1);}return _0x50960a[_0x3e37('0x28')]();};}function saveUpdates(_0xf46b43,_0x461a53){return function(_0x509ad4){if(_0x509ad4){return _0x509ad4[_0x3e37('0x29')](_0xf46b43)[_0x3e37('0x2a')](function(_0x177622){return _0x177622;});}return null;};}function removeEntity(_0x2d7dec,_0x313557){return function(_0x57f4d3){if(_0x57f4d3){return _0x57f4d3[_0x3e37('0x2b')]()[_0x3e37('0x2a')](function(){_0x2d7dec[_0x3e37('0x1d')](0xcc)[_0x3e37('0x1e')]();});}};}function handleEntityNotFound(_0x470741,_0xfd9914){return function(_0x3878dc){if(!_0x3878dc){_0x470741[_0x3e37('0x1c')](0x194);}return _0x3878dc;};}function handleError(_0x49f097,_0x34eb97){_0x34eb97=_0x34eb97||0x1f4;return function(_0x460c63){logger[_0x3e37('0x2c')](_0x460c63['stack']);if(_0x460c63[_0x3e37('0x2d')]){delete _0x460c63[_0x3e37('0x2d')];}_0x49f097[_0x3e37('0x1d')](_0x34eb97)[_0x3e37('0x2e')](_0x460c63);};}exports[_0x3e37('0x2f')]=function(_0x6e6313,_0x1e1705){var _0x3252a4={},_0x151255={},_0x58f8ce={'count':0x0,'rows':[]};var _0x4cf7e3=_[_0x3e37('0x30')](db[_0x3e37('0x31')]['rawAttributes'],function(_0x5b751b){return{'name':_0x5b751b['fieldName'],'type':_0x5b751b['type'][_0x3e37('0x32')]};});_0x151255['model']=_[_0x3e37('0x30')](_0x4cf7e3,_0x3e37('0x2d'));_0x151255['query']=_[_0x3e37('0x33')](_0x6e6313[_0x3e37('0x34')]);_0x151255[_0x3e37('0x35')]=_[_0x3e37('0x36')](_0x151255[_0x3e37('0x37')],_0x151255['query']);_0x3252a4[_0x3e37('0x38')]=_[_0x3e37('0x36')](_0x151255[_0x3e37('0x37')],qs[_0x3e37('0x39')](_0x6e6313['query'][_0x3e37('0x39')]));_0x3252a4[_0x3e37('0x38')]=_0x3252a4[_0x3e37('0x38')][_0x3e37('0x3a')]?_0x3252a4[_0x3e37('0x38')]:_0x151255['model'];if(!_0x6e6313[_0x3e37('0x34')][_0x3e37('0x3b')]('nolimit')){_0x3252a4['limit']=qs[_0x3e37('0x22')](_0x6e6313[_0x3e37('0x34')][_0x3e37('0x22')]);_0x3252a4[_0x3e37('0x20')]=qs[_0x3e37('0x20')](_0x6e6313[_0x3e37('0x34')][_0x3e37('0x20')]);}_0x3252a4[_0x3e37('0x3c')]=qs['sort'](_0x6e6313[_0x3e37('0x34')][_0x3e37('0x3d')]);_0x3252a4[_0x3e37('0x3e')]=qs[_0x3e37('0x35')](_[_0x3e37('0x3f')](_0x6e6313[_0x3e37('0x34')],_0x151255[_0x3e37('0x35')]),_0x4cf7e3);if(_0x6e6313[_0x3e37('0x34')][_0x3e37('0x40')]){_0x3252a4[_0x3e37('0x3e')]=_[_0x3e37('0x41')](_0x3252a4['where'],{'$or':_[_0x3e37('0x30')](_0x4cf7e3,function(_0x39ad24){if(_0x39ad24[_0x3e37('0x42')]!==_0x3e37('0x43')){var _0x375a61={};_0x375a61[_0x39ad24[_0x3e37('0x2d')]]={'$like':'%'+_0x6e6313['query']['filter']+'%'};return _0x375a61;}})});}_0x3252a4=_[_0x3e37('0x41')]({},_0x3252a4,_0x6e6313['options']);var _0x47db5e={'where':_0x3252a4[_0x3e37('0x3e')]};return db[_0x3e37('0x31')][_0x3e37('0x23')](_0x47db5e)[_0x3e37('0x2a')](function(_0x3b483b){_0x58f8ce[_0x3e37('0x23')]=_0x3b483b;if(_0x6e6313['query'][_0x3e37('0x44')]){_0x3252a4['include']=[{'all':!![]}];}return db[_0x3e37('0x31')]['findAll'](_0x3252a4);})[_0x3e37('0x2a')](function(_0x423174){_0x58f8ce[_0x3e37('0x45')]=_0x423174;return _0x58f8ce;})[_0x3e37('0x2a')](respondWithFilteredResult(_0x1e1705,_0x3252a4))[_0x3e37('0x46')](handleError(_0x1e1705,null));};exports[_0x3e37('0x47')]=function(_0x52569a,_0xafae4c){var _0x4b6d3e={'raw':![],'where':{'id':_0x52569a[_0x3e37('0x48')]['id']}},_0x2bd756={};_0x2bd756[_0x3e37('0x37')]=_[_0x3e37('0x33')](db[_0x3e37('0x31')][_0x3e37('0x49')]);_0x2bd756[_0x3e37('0x34')]=_[_0x3e37('0x33')](_0x52569a[_0x3e37('0x34')]);_0x2bd756[_0x3e37('0x35')]=_[_0x3e37('0x36')](_0x2bd756[_0x3e37('0x37')],_0x2bd756[_0x3e37('0x34')]);_0x4b6d3e['attributes']=_[_0x3e37('0x36')](_0x2bd756['model'],qs[_0x3e37('0x39')](_0x52569a[_0x3e37('0x34')]['fields']));_0x4b6d3e[_0x3e37('0x38')]=_0x4b6d3e[_0x3e37('0x38')][_0x3e37('0x3a')]?_0x4b6d3e[_0x3e37('0x38')]:_0x2bd756[_0x3e37('0x37')];if(_0x52569a['query']['includeAll']){_0x4b6d3e['include']=[{'all':!![]}];}_0x4b6d3e=_[_0x3e37('0x41')]({},_0x4b6d3e,_0x52569a[_0x3e37('0x4a')]);return db['SalesforceAccount']['find'](_0x4b6d3e)['then'](handleEntityNotFound(_0xafae4c,null))[_0x3e37('0x2a')](respondWithResult(_0xafae4c,null))['catch'](handleError(_0xafae4c,null));};exports['create']=function(_0xed5a4c,_0x103236){return db[_0x3e37('0x31')][_0x3e37('0x4b')](_0xed5a4c[_0x3e37('0x4c')],{})['then'](respondWithResult(_0x103236,0xc9))['catch'](handleError(_0x103236,null));};exports[_0x3e37('0x29')]=function(_0x37351e,_0x14ebd9){if(_0x37351e[_0x3e37('0x4c')]['id']){delete _0x37351e[_0x3e37('0x4c')]['id'];}return db[_0x3e37('0x31')]['find']({'where':{'id':_0x37351e['params']['id']}})[_0x3e37('0x2a')](handleEntityNotFound(_0x14ebd9,null))[_0x3e37('0x2a')](saveUpdates(_0x37351e['body'],null))[_0x3e37('0x2a')](respondWithResult(_0x14ebd9,null))['catch'](handleError(_0x14ebd9,null));};exports[_0x3e37('0x2b')]=function(_0x1a813c,_0x138dd5){return db['SalesforceAccount']['find']({'where':{'id':_0x1a813c['params']['id']}})[_0x3e37('0x2a')](handleEntityNotFound(_0x138dd5,null))[_0x3e37('0x2a')](removeEntity(_0x138dd5,null))[_0x3e37('0x46')](handleError(_0x138dd5,null));};exports[_0x3e37('0x4d')]=function(_0xfaeea9,_0x48a58b,_0x1ad997){var _0x452fe6={};var _0x579cfa={};var _0x24aa72;var _0x493edd;return db[_0x3e37('0x31')][_0x3e37('0x4e')]({'where':{'id':_0xfaeea9[_0x3e37('0x48')]['id']}})['then'](handleEntityNotFound(_0x48a58b,null))[_0x3e37('0x2a')](function(_0x302f1c){if(_0x302f1c){_0x24aa72=_0x302f1c;_0x579cfa[_0x3e37('0x37')]=_[_0x3e37('0x33')](db[_0x3e37('0x4f')]['rawAttributes']);_0x579cfa[_0x3e37('0x34')]=_['keys'](_0xfaeea9['query']);_0x579cfa[_0x3e37('0x35')]=_[_0x3e37('0x36')](_0x579cfa[_0x3e37('0x37')],_0x579cfa[_0x3e37('0x34')]);_0x452fe6[_0x3e37('0x38')]=_[_0x3e37('0x36')](_0x579cfa[_0x3e37('0x37')],qs[_0x3e37('0x39')](_0xfaeea9['query'][_0x3e37('0x39')]));_0x452fe6[_0x3e37('0x38')]=_0x452fe6[_0x3e37('0x38')][_0x3e37('0x3a')]?_0x452fe6['attributes']:_0x579cfa[_0x3e37('0x37')];_0x452fe6['order']=qs[_0x3e37('0x3d')](_0xfaeea9[_0x3e37('0x34')][_0x3e37('0x3d')]);_0x452fe6['where']=qs['filters'](_[_0x3e37('0x3f')](_0xfaeea9['query'],_0x579cfa['filters']));if(_0xfaeea9[_0x3e37('0x34')]['filter']){_0x452fe6[_0x3e37('0x3e')]=_[_0x3e37('0x41')](_0x452fe6['where'],{'$or':_[_0x3e37('0x30')](_0x452fe6['attributes'],function(_0x459831){var _0x5eaa08={};_0x5eaa08[_0x459831]={'$like':'%'+_0xfaeea9[_0x3e37('0x34')][_0x3e37('0x40')]+'%'};return _0x5eaa08;})});}_0x452fe6=_[_0x3e37('0x41')]({},_0x452fe6,_0xfaeea9['options']);return _0x24aa72[_0x3e37('0x4d')](_0x452fe6);}})[_0x3e37('0x2a')](function(_0x504b2b){if(_0x504b2b){_0x493edd=_0x504b2b[_0x3e37('0x3a')];if(!_0xfaeea9[_0x3e37('0x34')][_0x3e37('0x3b')](_0x3e37('0x50'))){_0x452fe6[_0x3e37('0x22')]=qs[_0x3e37('0x22')](_0xfaeea9[_0x3e37('0x34')]['limit']);_0x452fe6[_0x3e37('0x20')]=qs[_0x3e37('0x20')](_0xfaeea9[_0x3e37('0x34')][_0x3e37('0x20')]);}return _0x24aa72[_0x3e37('0x4d')](_0x452fe6);}})[_0x3e37('0x2a')](function(_0x5d6673){if(_0x5d6673){return _0x5d6673?{'count':_0x493edd,'rows':_0x5d6673}:null;}})[_0x3e37('0x2a')](respondWithResult(_0x48a58b,null))['catch'](handleError(_0x48a58b,null));};exports['addConfiguration']=function(_0x3d1c90,_0x4eb3c2,_0x449df4){if(_0x3d1c90['body']['id']){delete _0x3d1c90[_0x3e37('0x4c')]['id'];}return db[_0x3e37('0x31')][_0x3e37('0x4e')]({'where':{'id':_0x3d1c90['params']['id']}})[_0x3e37('0x2a')](handleEntityNotFound(_0x4eb3c2,null))[_0x3e37('0x2a')](function(_0x51c0b5){if(_0x51c0b5){_0x3d1c90['body']['AccountId']=_0x51c0b5['id'];_0x3d1c90[_0x3e37('0x4c')][_0x3e37('0x51')]=integrations['getSubjects'](_0x3d1c90['body'][_0x3e37('0x52')],_0x3d1c90[_0x3e37('0x4c')][_0x3e37('0x42')]);_0x3d1c90[_0x3e37('0x4c')]['Descriptions']=integrations[_0x3e37('0x53')](_0x3d1c90[_0x3e37('0x4c')][_0x3e37('0x52')],_0x3d1c90[_0x3e37('0x4c')]['type']);return db[_0x3e37('0x4f')][_0x3e37('0x4b')](_0x3d1c90[_0x3e37('0x4c')],{'include':[{'model':db[_0x3e37('0x54')],'as':_0x3e37('0x51')},{'model':db['SalesforceField'],'as':_0x3e37('0x55')}]});}return null;})[_0x3e37('0x2a')](respondWithResult(_0x4eb3c2,null))[_0x3e37('0x46')](handleError(_0x4eb3c2,null));};exports[_0x3e37('0x56')]=function(_0x34ce04,_0x45612d,_0x371c65){var _0x4bb93d;var _0x682cc7='';var _0x4b48e9=_0x3e37('0x57');return db['SalesforceAccount'][_0x3e37('0x4e')]({'where':{'id':_0x34ce04['params']['id']},'attributes':['id',_0x3e37('0x58'),_0x3e37('0x59'),_0x3e37('0x5a'),_0x3e37('0x5b'),_0x3e37('0x5c'),_0x3e37('0x5d')]})[_0x3e37('0x2a')](handleEntityNotFound(_0x45612d,null))[_0x3e37('0x2a')](function(_0x1fae1a){if(_0x1fae1a){_0x682cc7=_0x1fae1a[_0x3e37('0x58')];var _0x5e02f9=_0x682cc7['slice'](-0x1);if(_0x5e02f9==='/'){_0x682cc7=_0x682cc7[_0x3e37('0x5e')](0x0,_0x682cc7['lastIndexOf'](_0x5e02f9));}_0x4bb93d=new jsforce[(_0x3e37('0x5f'))]({'oauth2':{'loginUrl':_0x682cc7,'clientId':_0x1fae1a[_0x3e37('0x59')],'clientSecret':_0x1fae1a['clientSecret']}});return _0x4bb93d[_0x3e37('0x60')](_0x1fae1a[_0x3e37('0x5b')],_0x1fae1a[_0x3e37('0x5c')][_0x3e37('0x61')](_0x1fae1a[_0x3e37('0x5d')]));}})[_0x3e37('0x2a')](function(_0x524a4e){if(_0x524a4e){if(!_[_0x3e37('0x62')](_0x34ce04['query'][_0x3e37('0x63')])){_0x4b48e9=_0x34ce04[_0x3e37('0x34')][_0x3e37('0x63')];}return _0x4bb93d[_0x3e37('0x64')](_0x4b48e9)[_0x3e37('0x65')]();}})['then'](function(_0x235a14){var _0x437398=[_0x3e37('0x66'),_0x3e37('0x67'),'IsReminderSet',_0x3e37('0x68'),_0x3e37('0x69'),_0x3e37('0x6a')];var _0x4ebbe6=['string','int',_0x3e37('0x6b'),_0x3e37('0x6c'),'email',_0x3e37('0x6d'),'phone'];if(_0x235a14){_[_0x3e37('0x6e')](_0x235a14[_0x3e37('0x39')],function(_0x524e62){return _0x437398['includes'](_0x524e62['name'])||!_0x4ebbe6[_0x3e37('0x6f')](_0x524e62[_0x3e37('0x42')]);});return{'count':_0x235a14['fields']['length'],'rows':_[_0x3e37('0x30')](_0x235a14[_0x3e37('0x39')],function(_0x402273){return{'id':_0x402273[_0x3e37('0x2d')],'name':_0x402273[_0x3e37('0x70')],'custom':_0x402273['custom'],'options':_0x402273[_0x3e37('0x71')][_0x3e37('0x3a')]>0x0?_[_0x3e37('0x30')](_0x402273['picklistValues'],function(_0xdb3c96){return{'name':_0xdb3c96[_0x3e37('0x70')],'value':_0xdb3c96[_0x3e37('0x72')]};}):_0x402273[_0x3e37('0x42')]==_0x3e37('0x6c')?[{'name':_0x3e37('0x73'),'value':_0x3e37('0x74')},{'name':_0x3e37('0x75'),'value':_0x3e37('0x76')}]:[]};})};}})[_0x3e37('0x2a')](respondWithResult(_0x45612d,null))[_0x3e37('0x46')](function(_0x4aed84){var _0x84c6ce=_0x34ce04[_0x3e37('0x34')][_0x3e37('0x77')]?0x1f4:_0x4aed84[_0x3e37('0x78')]||0x1f4;logger[_0x3e37('0x2c')](_0x3e37('0x79'),'getFields',_0x84c6ce,JSON[_0x3e37('0x7a')](_0x4aed84));delete _0x4aed84[_0x3e37('0x2d')];if(_0x84c6ce===0x191){_0x84c6ce=0x190;}_0x45612d[_0x3e37('0x1d')](_0x84c6ce)[_0x3e37('0x2e')](_0x34ce04[_0x3e37('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x4aed84['statusCode']}:_0x4aed84);});}; \ No newline at end of file +var _0xbea5=['length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','getFields','Task','securityToken','remoteUri','lastIndexOf','Connection','clientId','clientSecret','login','username','password','concat','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','email','textarea','phone','remove','includes','custom','picklistValues','label','value','boolean','true','False','false','test','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','SalesforceAccount','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields'];(function(_0x19903c,_0x5192e4){var _0x222a6c=function(_0x2121ae){while(--_0x2121ae){_0x19903c['push'](_0x19903c['shift']());}};_0x222a6c(++_0x5192e4);}(_0xbea5,0x13c));var _0x5bea=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0xbea5[_0x26f1b2];return _0x1624a4;};'use strict';var emlformat=require(_0x5bea('0x0'));var rimraf=require(_0x5bea('0x1'));var zipdir=require(_0x5bea('0x2'));var jsonpatch=require(_0x5bea('0x3'));var rp=require(_0x5bea('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5bea('0x5'));var path=require(_0x5bea('0x6'));var sox=require(_0x5bea('0x7'));var csv=require(_0x5bea('0x8'));var ejs=require(_0x5bea('0x9'));var fs=require('fs');var fs_extra=require(_0x5bea('0xa'));var _=require(_0x5bea('0xb'));var squel=require(_0x5bea('0xc'));var crypto=require(_0x5bea('0xd'));var jsforce=require(_0x5bea('0xe'));var deskjs=require(_0x5bea('0xf'));var toCsv=require(_0x5bea('0x8'));var querystring=require('querystring');var Papa=require(_0x5bea('0x10'));var Redis=require(_0x5bea('0x11'));var authService=require(_0x5bea('0x12'));var qs=require(_0x5bea('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bea('0x14'));var logger=require('../../config/logger')(_0x5bea('0x15'));var utils=require(_0x5bea('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5bea('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3bbec9,_0x33822d){_0x33822d=_0x33822d||0xcc;return function(_0x5f1367){if(_0x5f1367){return _0x3bbec9[_0x5bea('0x18')](_0x33822d);}return _0x3bbec9['status'](_0x33822d)[_0x5bea('0x19')]();};}function respondWithResult(_0x3efedc,_0x455295){_0x455295=_0x455295||0xc8;return function(_0x3d0ed0){if(_0x3d0ed0){return _0x3efedc[_0x5bea('0x1a')](_0x455295)[_0x5bea('0x1b')](_0x3d0ed0);}};}function respondWithFilteredResult(_0x43279e,_0x31820a){return function(_0x5ab9b2){if(_0x5ab9b2){var _0x2cdecc=typeof _0x31820a[_0x5bea('0x1c')]===_0x5bea('0x1d')&&typeof _0x31820a[_0x5bea('0x1e')]===_0x5bea('0x1d');var _0xe17113=_0x5ab9b2[_0x5bea('0x1f')];var _0x151024=_0x2cdecc?0x0:_0x31820a[_0x5bea('0x1c')];var _0x21dae2=_0x2cdecc?_0x5ab9b2[_0x5bea('0x1f')]:_0x31820a['offset']+_0x31820a[_0x5bea('0x1e')];var _0x49cc10;if(_0x21dae2>=_0xe17113){_0x21dae2=_0xe17113;_0x49cc10=0xc8;}else{_0x49cc10=0xce;}_0x43279e['status'](_0x49cc10);return _0x43279e['set']('Content-Range',_0x151024+'-'+_0x21dae2+'/'+_0xe17113)['json'](_0x5ab9b2);}return null;};}function patchUpdates(_0x452d5c){return function(_0x4a6d18){try{jsonpatch[_0x5bea('0x20')](_0x4a6d18,_0x452d5c,!![]);}catch(_0x1de2a3){return BPromise[_0x5bea('0x21')](_0x1de2a3);}return _0x4a6d18[_0x5bea('0x22')]();};}function saveUpdates(_0x5c7629,_0x27410c){return function(_0x5e6eeb){if(_0x5e6eeb){return _0x5e6eeb[_0x5bea('0x23')](_0x5c7629)[_0x5bea('0x24')](function(_0x2889da){return _0x2889da;});}return null;};}function removeEntity(_0x4a7b1f,_0x453213){return function(_0x5c9ff6){if(_0x5c9ff6){return _0x5c9ff6[_0x5bea('0x25')]()[_0x5bea('0x24')](function(){_0x4a7b1f[_0x5bea('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a4fee,_0x522575){return function(_0x72aa91){if(!_0x72aa91){_0x4a4fee[_0x5bea('0x18')](0x194);}return _0x72aa91;};}function handleError(_0x4f9b98,_0x4d8995){_0x4d8995=_0x4d8995||0x1f4;return function(_0x5500ba){logger[_0x5bea('0x26')](_0x5500ba[_0x5bea('0x27')]);if(_0x5500ba['name']){delete _0x5500ba[_0x5bea('0x28')];}_0x4f9b98[_0x5bea('0x1a')](_0x4d8995)[_0x5bea('0x29')](_0x5500ba);};}exports[_0x5bea('0x2a')]=function(_0x11d2ee,_0x39a9ae){var _0x4bc790={},_0x52f805={},_0x16d085={'count':0x0,'rows':[]};var _0x933eb8=_['map'](db[_0x5bea('0x2b')][_0x5bea('0x2c')],function(_0x48a28e){return{'name':_0x48a28e[_0x5bea('0x2d')],'type':_0x48a28e[_0x5bea('0x2e')][_0x5bea('0x2f')]};});_0x52f805[_0x5bea('0x30')]=_[_0x5bea('0x31')](_0x933eb8,_0x5bea('0x28'));_0x52f805['query']=_[_0x5bea('0x32')](_0x11d2ee[_0x5bea('0x33')]);_0x52f805[_0x5bea('0x34')]=_['intersection'](_0x52f805[_0x5bea('0x30')],_0x52f805[_0x5bea('0x33')]);_0x4bc790[_0x5bea('0x35')]=_[_0x5bea('0x36')](_0x52f805['model'],qs[_0x5bea('0x37')](_0x11d2ee[_0x5bea('0x33')]['fields']));_0x4bc790[_0x5bea('0x35')]=_0x4bc790[_0x5bea('0x35')][_0x5bea('0x38')]?_0x4bc790[_0x5bea('0x35')]:_0x52f805[_0x5bea('0x30')];if(!_0x11d2ee[_0x5bea('0x33')][_0x5bea('0x39')](_0x5bea('0x3a'))){_0x4bc790[_0x5bea('0x1e')]=qs[_0x5bea('0x1e')](_0x11d2ee[_0x5bea('0x33')][_0x5bea('0x1e')]);_0x4bc790[_0x5bea('0x1c')]=qs['offset'](_0x11d2ee[_0x5bea('0x33')]['offset']);}_0x4bc790[_0x5bea('0x3b')]=qs[_0x5bea('0x3c')](_0x11d2ee[_0x5bea('0x33')][_0x5bea('0x3c')]);_0x4bc790['where']=qs[_0x5bea('0x34')](_[_0x5bea('0x3d')](_0x11d2ee['query'],_0x52f805[_0x5bea('0x34')]),_0x933eb8);if(_0x11d2ee[_0x5bea('0x33')][_0x5bea('0x3e')]){_0x4bc790['where']=_[_0x5bea('0x3f')](_0x4bc790['where'],{'$or':_[_0x5bea('0x31')](_0x933eb8,function(_0x40b01d){if(_0x40b01d['type']!==_0x5bea('0x40')){var _0x2be5bc={};_0x2be5bc[_0x40b01d[_0x5bea('0x28')]]={'$like':'%'+_0x11d2ee[_0x5bea('0x33')][_0x5bea('0x3e')]+'%'};return _0x2be5bc;}})});}_0x4bc790=_['merge']({},_0x4bc790,_0x11d2ee[_0x5bea('0x41')]);var _0x2d3070={'where':_0x4bc790[_0x5bea('0x42')]};return db[_0x5bea('0x2b')][_0x5bea('0x1f')](_0x2d3070)[_0x5bea('0x24')](function(_0x55bafe){_0x16d085['count']=_0x55bafe;if(_0x11d2ee[_0x5bea('0x33')][_0x5bea('0x43')]){_0x4bc790[_0x5bea('0x44')]=[{'all':!![]}];}return db[_0x5bea('0x2b')]['findAll'](_0x4bc790);})[_0x5bea('0x24')](function(_0x190f87){_0x16d085[_0x5bea('0x45')]=_0x190f87;return _0x16d085;})[_0x5bea('0x24')](respondWithFilteredResult(_0x39a9ae,_0x4bc790))[_0x5bea('0x46')](handleError(_0x39a9ae,null));};exports[_0x5bea('0x47')]=function(_0x1b5392,_0x2af8ec){var _0x586b25={'raw':![],'where':{'id':_0x1b5392[_0x5bea('0x48')]['id']}},_0x529501={};_0x529501[_0x5bea('0x30')]=_[_0x5bea('0x32')](db[_0x5bea('0x2b')]['rawAttributes']);_0x529501[_0x5bea('0x33')]=_[_0x5bea('0x32')](_0x1b5392[_0x5bea('0x33')]);_0x529501[_0x5bea('0x34')]=_[_0x5bea('0x36')](_0x529501[_0x5bea('0x30')],_0x529501[_0x5bea('0x33')]);_0x586b25[_0x5bea('0x35')]=_['intersection'](_0x529501[_0x5bea('0x30')],qs['fields'](_0x1b5392[_0x5bea('0x33')][_0x5bea('0x37')]));_0x586b25[_0x5bea('0x35')]=_0x586b25[_0x5bea('0x35')]['length']?_0x586b25[_0x5bea('0x35')]:_0x529501[_0x5bea('0x30')];if(_0x1b5392['query'][_0x5bea('0x43')]){_0x586b25['include']=[{'all':!![]}];}_0x586b25=_['merge']({},_0x586b25,_0x1b5392[_0x5bea('0x41')]);return db[_0x5bea('0x2b')][_0x5bea('0x49')](_0x586b25)[_0x5bea('0x24')](handleEntityNotFound(_0x2af8ec,null))[_0x5bea('0x24')](respondWithResult(_0x2af8ec,null))[_0x5bea('0x46')](handleError(_0x2af8ec,null));};exports[_0x5bea('0x4a')]=function(_0x447a5d,_0x506a70){return db['SalesforceAccount'][_0x5bea('0x4a')](_0x447a5d[_0x5bea('0x4b')],{})['then'](respondWithResult(_0x506a70,0xc9))['catch'](handleError(_0x506a70,null));};exports[_0x5bea('0x23')]=function(_0x73fccd,_0x62c74c){if(_0x73fccd[_0x5bea('0x4b')]['id']){delete _0x73fccd['body']['id'];}return db['SalesforceAccount'][_0x5bea('0x49')]({'where':{'id':_0x73fccd[_0x5bea('0x48')]['id']}})[_0x5bea('0x24')](handleEntityNotFound(_0x62c74c,null))[_0x5bea('0x24')](saveUpdates(_0x73fccd[_0x5bea('0x4b')],null))['then'](respondWithResult(_0x62c74c,null))[_0x5bea('0x46')](handleError(_0x62c74c,null));};exports[_0x5bea('0x25')]=function(_0x27746b,_0x9747ce){return db['SalesforceAccount']['find']({'where':{'id':_0x27746b[_0x5bea('0x48')]['id']}})[_0x5bea('0x24')](handleEntityNotFound(_0x9747ce,null))[_0x5bea('0x24')](removeEntity(_0x9747ce,null))[_0x5bea('0x46')](handleError(_0x9747ce,null));};exports[_0x5bea('0x4c')]=function(_0x1d7770,_0x4a2a17,_0x9047e0){var _0x5a660f={};var _0x36f4da={};var _0x26c866;var _0x3cec1d;return db[_0x5bea('0x2b')][_0x5bea('0x4d')]({'where':{'id':_0x1d7770[_0x5bea('0x48')]['id']}})[_0x5bea('0x24')](handleEntityNotFound(_0x4a2a17,null))[_0x5bea('0x24')](function(_0xd6494b){if(_0xd6494b){_0x26c866=_0xd6494b;_0x36f4da[_0x5bea('0x30')]=_['keys'](db['SalesforceConfiguration'][_0x5bea('0x2c')]);_0x36f4da[_0x5bea('0x33')]=_['keys'](_0x1d7770[_0x5bea('0x33')]);_0x36f4da['filters']=_[_0x5bea('0x36')](_0x36f4da[_0x5bea('0x30')],_0x36f4da[_0x5bea('0x33')]);_0x5a660f[_0x5bea('0x35')]=_[_0x5bea('0x36')](_0x36f4da[_0x5bea('0x30')],qs[_0x5bea('0x37')](_0x1d7770[_0x5bea('0x33')][_0x5bea('0x37')]));_0x5a660f[_0x5bea('0x35')]=_0x5a660f[_0x5bea('0x35')]['length']?_0x5a660f[_0x5bea('0x35')]:_0x36f4da[_0x5bea('0x30')];_0x5a660f[_0x5bea('0x3b')]=qs[_0x5bea('0x3c')](_0x1d7770[_0x5bea('0x33')][_0x5bea('0x3c')]);_0x5a660f[_0x5bea('0x42')]=qs[_0x5bea('0x34')](_['pick'](_0x1d7770[_0x5bea('0x33')],_0x36f4da[_0x5bea('0x34')]));if(_0x1d7770[_0x5bea('0x33')][_0x5bea('0x3e')]){_0x5a660f['where']=_[_0x5bea('0x3f')](_0x5a660f['where'],{'$or':_['map'](_0x5a660f[_0x5bea('0x35')],function(_0x23e603){var _0x47c349={};_0x47c349[_0x23e603]={'$like':'%'+_0x1d7770['query']['filter']+'%'};return _0x47c349;})});}_0x5a660f=_[_0x5bea('0x3f')]({},_0x5a660f,_0x1d7770[_0x5bea('0x41')]);return _0x26c866[_0x5bea('0x4c')](_0x5a660f);}})['then'](function(_0x7f4c12){if(_0x7f4c12){_0x3cec1d=_0x7f4c12[_0x5bea('0x38')];if(!_0x1d7770[_0x5bea('0x33')][_0x5bea('0x39')](_0x5bea('0x3a'))){_0x5a660f[_0x5bea('0x1e')]=qs['limit'](_0x1d7770[_0x5bea('0x33')][_0x5bea('0x1e')]);_0x5a660f[_0x5bea('0x1c')]=qs[_0x5bea('0x1c')](_0x1d7770['query']['offset']);}return _0x26c866[_0x5bea('0x4c')](_0x5a660f);}})[_0x5bea('0x24')](function(_0xbd2ddc){if(_0xbd2ddc){return _0xbd2ddc?{'count':_0x3cec1d,'rows':_0xbd2ddc}:null;}})['then'](respondWithResult(_0x4a2a17,null))[_0x5bea('0x46')](handleError(_0x4a2a17,null));};exports[_0x5bea('0x4e')]=function(_0x16e10c,_0x3f35c1,_0x15e220){if(_0x16e10c[_0x5bea('0x4b')]['id']){delete _0x16e10c[_0x5bea('0x4b')]['id'];}return db[_0x5bea('0x2b')]['findOne']({'where':{'id':_0x16e10c[_0x5bea('0x48')]['id']}})[_0x5bea('0x24')](handleEntityNotFound(_0x3f35c1,null))[_0x5bea('0x24')](function(_0x52b1c0){if(_0x52b1c0){_0x16e10c[_0x5bea('0x4b')]['AccountId']=_0x52b1c0['id'];_0x16e10c[_0x5bea('0x4b')][_0x5bea('0x4f')]=integrations[_0x5bea('0x50')](_0x16e10c[_0x5bea('0x4b')][_0x5bea('0x51')],_0x16e10c[_0x5bea('0x4b')][_0x5bea('0x2e')]);_0x16e10c[_0x5bea('0x4b')][_0x5bea('0x52')]=integrations[_0x5bea('0x53')](_0x16e10c[_0x5bea('0x4b')][_0x5bea('0x51')],_0x16e10c[_0x5bea('0x4b')][_0x5bea('0x2e')]);return db[_0x5bea('0x54')][_0x5bea('0x4a')](_0x16e10c['body'],{'include':[{'model':db['SalesforceField'],'as':_0x5bea('0x4f')},{'model':db['SalesforceField'],'as':_0x5bea('0x52')}]});}return null;})[_0x5bea('0x24')](respondWithResult(_0x3f35c1,null))['catch'](handleError(_0x3f35c1,null));};exports[_0x5bea('0x55')]=function(_0x118f06,_0x1c51f8,_0xd62e21){var _0x47c88c;var _0x1ac1ed='';var _0x4fcf51=_0x5bea('0x56');return db[_0x5bea('0x2b')][_0x5bea('0x4d')]({'where':{'id':_0x118f06['params']['id']},'attributes':['id','remoteUri','clientId','clientSecret','username','password',_0x5bea('0x57')]})[_0x5bea('0x24')](handleEntityNotFound(_0x1c51f8,null))['then'](function(_0x13ae6f){if(_0x13ae6f){_0x1ac1ed=_0x13ae6f[_0x5bea('0x58')];var _0x5d7d61=_0x1ac1ed['slice'](-0x1);if(_0x5d7d61==='/'){_0x1ac1ed=_0x1ac1ed['substring'](0x0,_0x1ac1ed[_0x5bea('0x59')](_0x5d7d61));}_0x47c88c=new jsforce[(_0x5bea('0x5a'))]({'oauth2':{'loginUrl':_0x1ac1ed,'clientId':_0x13ae6f[_0x5bea('0x5b')],'clientSecret':_0x13ae6f[_0x5bea('0x5c')]}});return _0x47c88c[_0x5bea('0x5d')](_0x13ae6f[_0x5bea('0x5e')],_0x13ae6f[_0x5bea('0x5f')][_0x5bea('0x60')](_0x13ae6f[_0x5bea('0x57')]));}})[_0x5bea('0x24')](function(_0x637a40){if(_0x637a40){if(!_[_0x5bea('0x61')](_0x118f06[_0x5bea('0x33')][_0x5bea('0x62')])){_0x4fcf51=_0x118f06[_0x5bea('0x33')][_0x5bea('0x62')];}return _0x47c88c[_0x5bea('0x63')](_0x4fcf51)[_0x5bea('0x64')]();}})[_0x5bea('0x24')](function(_0x415faa){var _0x4d2b19=['OwnerId',_0x5bea('0x65'),_0x5bea('0x66'),_0x5bea('0x67'),_0x5bea('0x68'),_0x5bea('0x69')];var _0x484037=[_0x5bea('0x6a'),_0x5bea('0x6b'),_0x5bea('0x6c'),'boolean',_0x5bea('0x6d'),_0x5bea('0x6e'),_0x5bea('0x6f')];if(_0x415faa){_[_0x5bea('0x70')](_0x415faa[_0x5bea('0x37')],function(_0x41666e){return _0x4d2b19[_0x5bea('0x71')](_0x41666e['name'])||!_0x484037[_0x5bea('0x71')](_0x41666e[_0x5bea('0x2e')]);});return{'count':_0x415faa[_0x5bea('0x37')][_0x5bea('0x38')],'rows':_['map'](_0x415faa[_0x5bea('0x37')],function(_0x109b48){return{'id':_0x109b48[_0x5bea('0x28')],'name':_0x109b48['label'],'custom':_0x109b48[_0x5bea('0x72')],'options':_0x109b48[_0x5bea('0x73')][_0x5bea('0x38')]>0x0?_['map'](_0x109b48[_0x5bea('0x73')],function(_0x21ea96){return{'name':_0x21ea96[_0x5bea('0x74')],'value':_0x21ea96[_0x5bea('0x75')]};}):_0x109b48[_0x5bea('0x2e')]==_0x5bea('0x76')?[{'name':'True','value':_0x5bea('0x77')},{'name':_0x5bea('0x78'),'value':_0x5bea('0x79')}]:[]};})};}})[_0x5bea('0x24')](respondWithResult(_0x1c51f8,null))[_0x5bea('0x46')](function(_0x447d0d){var _0x57e234=_0x118f06[_0x5bea('0x33')][_0x5bea('0x7a')]?0x1f4:_0x447d0d['statusCode']||0x1f4;logger[_0x5bea('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x5bea('0x55'),_0x57e234,JSON['stringify'](_0x447d0d));delete _0x447d0d['name'];if(_0x57e234===0x191){_0x57e234=0x190;}_0x1c51f8[_0x5bea('0x1a')](_0x57e234)[_0x5bea('0x29')](_0x118f06[_0x5bea('0x33')][_0x5bea('0x7a')]?{'message':'Wrong\x20credentials','statusCode':_0x447d0d[_0x5bea('0x7b')]}:_0x447d0d);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index c3f674e..164feff 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 _0x500f=['int_salesforce_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','define','SalesforceAccount'];(function(_0x15704b,_0xb94688){var _0x5c54b3=function(_0x447db4){while(--_0x447db4){_0x15704b['push'](_0x15704b['shift']());}};_0x5c54b3(++_0xb94688);}(_0x500f,0x1d5));var _0xf500=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x500f[_0x15c421];return _0x5e5ed5;};'use strict';var _=require(_0xf500('0x0'));var util=require(_0xf500('0x1'));var logger=require('../../config/logger')(_0xf500('0x2'));var moment=require(_0xf500('0x3'));var BPromise=require(_0xf500('0x4'));var rp=require(_0xf500('0x5'));var fs=require('fs');var path=require(_0xf500('0x6'));var rimraf=require(_0xf500('0x7'));var config=require('../../config/environment');var attributes=require(_0xf500('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4703c4,_0x105652){return _0x4703c4[_0xf500('0x9')](_0xf500('0xa'),attributes,{'tableName':_0xf500('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2953=['exports','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes'];(function(_0x4b8978,_0x5015da){var _0x1ee755=function(_0x254ec9){while(--_0x254ec9){_0x4b8978['push'](_0x4b8978['shift']());}};_0x1ee755(++_0x5015da);}(_0x2953,0x1cc));var _0x3295=function(_0x121195,_0x277af4){_0x121195=_0x121195-0x0;var _0xf0b9df=_0x2953[_0x121195];return _0xf0b9df;};'use strict';var _=require(_0x3295('0x0'));var util=require('util');var logger=require(_0x3295('0x1'))(_0x3295('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3295('0x3'));var fs=require('fs');var path=require(_0x3295('0x4'));var rimraf=require(_0x3295('0x5'));var config=require(_0x3295('0x6'));var attributes=require(_0x3295('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x3295('0x8')]=function(_0x37063b,_0x4d9f22){return _0x37063b['define']('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','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 c780d6e..65d9f8d 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 _0xfdf9=['../../config/environment','client','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','limit','include','map','model','attributes','ShowSalesforceAccount','where','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4525ea,_0x4247d7){var _0x162cdf=function(_0x15ccc3){while(--_0x15ccc3){_0x4525ea['push'](_0x4525ea['shift']());}};_0x162cdf(++_0x4247d7);}(_0xfdf9,0x16e));var _0x9fdf=function(_0x290bd9,_0xad9d87){_0x290bd9=_0x290bd9-0x0;var _0x226fe2=_0xfdf9[_0x290bd9];return _0x226fe2;};'use strict';var _=require(_0x9fdf('0x0'));var util=require(_0x9fdf('0x1'));var moment=require(_0x9fdf('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9fdf('0x3'))['db'];var utils=require(_0x9fdf('0x4'));var logger=require(_0x9fdf('0x5'))('rpc');var config=require(_0x9fdf('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9fdf('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d6c52,_0xef334b,_0x46b377){return new BPromise(function(_0x5c12cc,_0x1e4d43){return client['request'](_0x1d6c52,_0x46b377)[_0x9fdf('0x8')](function(_0xc1ce93){logger[_0x9fdf('0x9')](_0x9fdf('0xa'),_0xef334b,_0x9fdf('0xb'));logger[_0x9fdf('0xc')](_0x9fdf('0xd'),_0xef334b,_0x9fdf('0xb'),JSON[_0x9fdf('0xe')](_0xc1ce93));if(_0xc1ce93['error']){if(_0xc1ce93[_0x9fdf('0xf')][_0x9fdf('0x10')]===0x1f4){logger[_0x9fdf('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0xef334b,_0xc1ce93[_0x9fdf('0xf')]['message']);return _0x1e4d43(_0xc1ce93[_0x9fdf('0xf')][_0x9fdf('0x11')]);}logger[_0x9fdf('0xf')](_0x9fdf('0xa'),_0xef334b,_0xc1ce93[_0x9fdf('0xf')][_0x9fdf('0x11')]);return _0x5c12cc(_0xc1ce93['error']['message']);}else{logger['info'](_0x9fdf('0xa'),_0xef334b,_0x9fdf('0xb'));_0x5c12cc(_0xc1ce93['result'][_0x9fdf('0x11')]);}})[_0x9fdf('0x12')](function(_0x31ece5){logger[_0x9fdf('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0xef334b,_0x31ece5);_0x1e4d43(_0x31ece5);});});}exports[_0x9fdf('0x13')]=function(_0x17a24c){var _0xb0e6ae=this;return new Promise(function(_0x4db528,_0x92187){return db[_0x9fdf('0x14')][_0x9fdf('0x15')]({'raw':_0x17a24c[_0x9fdf('0x16')]?_0x17a24c[_0x9fdf('0x16')][_0x9fdf('0x17')]===undefined?!![]:![]:!![],'where':_0x17a24c[_0x9fdf('0x16')]?_0x17a24c[_0x9fdf('0x16')]['where']||null:null,'attributes':_0x17a24c[_0x9fdf('0x16')]?_0x17a24c[_0x9fdf('0x16')]['attributes']||null:null,'limit':_0x17a24c[_0x9fdf('0x16')]?_0x17a24c[_0x9fdf('0x16')][_0x9fdf('0x18')]||null:null,'include':_0x17a24c[_0x9fdf('0x16')]?_0x17a24c[_0x9fdf('0x16')][_0x9fdf('0x19')]?_[_0x9fdf('0x1a')](_0x17a24c[_0x9fdf('0x16')][_0x9fdf('0x19')],function(_0x77ab31){return{'model':db[_0x77ab31[_0x9fdf('0x1b')]],'as':_0x77ab31['as'],'attributes':_0x77ab31[_0x9fdf('0x1c')],'include':_0x77ab31[_0x9fdf('0x19')]?_['map'](_0x77ab31[_0x9fdf('0x19')],function(_0x5b7e8e){return{'model':db[_0x5b7e8e[_0x9fdf('0x1b')]],'as':_0x5b7e8e['as'],'attributes':_0x5b7e8e['attributes'],'include':_0x5b7e8e['include']?_[_0x9fdf('0x1a')](_0x5b7e8e[_0x9fdf('0x19')],function(_0x290c7f){return{'model':db[_0x290c7f['model']],'as':_0x290c7f['as'],'attributes':_0x290c7f[_0x9fdf('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49b087){logger[_0x9fdf('0x9')](_0x9fdf('0x13'),_0x17a24c);logger[_0x9fdf('0xc')](_0x9fdf('0x13'),_0x17a24c,JSON[_0x9fdf('0xe')](_0x49b087));_0x4db528(_0x49b087);})['catch'](function(_0x3a374d){logger[_0x9fdf('0xf')](_0x9fdf('0x13'),_0x3a374d[_0x9fdf('0x11')],_0x17a24c);_0x92187(_0xb0e6ae['error'](0x1f4,_0x3a374d['message']));});});};exports[_0x9fdf('0x1d')]=function(_0x22e3a5){var _0x2776c8=this;return new Promise(function(_0x406275,_0x4308d0){return db[_0x9fdf('0x14')]['find']({'raw':_0x22e3a5[_0x9fdf('0x16')]?_0x22e3a5[_0x9fdf('0x16')][_0x9fdf('0x17')]===undefined?!![]:![]:!![],'where':_0x22e3a5['options']?_0x22e3a5[_0x9fdf('0x16')][_0x9fdf('0x1e')]||null:null,'attributes':_0x22e3a5['options']?_0x22e3a5[_0x9fdf('0x16')][_0x9fdf('0x1c')]||null:null,'include':_0x22e3a5['options']?_0x22e3a5[_0x9fdf('0x16')]['include']?_['map'](_0x22e3a5[_0x9fdf('0x16')][_0x9fdf('0x19')],function(_0x294594){return{'model':db[_0x294594['model']],'as':_0x294594['as'],'attributes':_0x294594['attributes'],'include':_0x294594[_0x9fdf('0x19')]?_[_0x9fdf('0x1a')](_0x294594['include'],function(_0x118b82){return{'model':db[_0x118b82[_0x9fdf('0x1b')]],'as':_0x118b82['as'],'attributes':_0x118b82[_0x9fdf('0x1c')],'include':_0x118b82[_0x9fdf('0x19')]?_['map'](_0x118b82[_0x9fdf('0x19')],function(_0x1a717f){return{'model':db[_0x1a717f['model']],'as':_0x1a717f['as'],'attributes':_0x1a717f[_0x9fdf('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14684e){logger['info'](_0x9fdf('0x1d'),_0x22e3a5);logger[_0x9fdf('0xc')](_0x9fdf('0x1d'),_0x22e3a5,JSON[_0x9fdf('0xe')](_0x14684e));_0x406275(_0x14684e);})[_0x9fdf('0x12')](function(_0x12cff3){logger['error'](_0x9fdf('0x1d'),_0x12cff3[_0x9fdf('0x11')],_0x22e3a5);_0x4308d0(_0x2776c8[_0x9fdf('0xf')](0x1f4,_0x12cff3[_0x9fdf('0x11')]));});});}; \ No newline at end of file +var _0x71d8=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetSalesforceAccount','SalesforceAccount','options','attributes','limit','include','map','model','ShowSalesforceAccount','find','raw','where'];(function(_0x2714ec,_0x36daa4){var _0x2608e5=function(_0x408468){while(--_0x408468){_0x2714ec['push'](_0x2714ec['shift']());}};_0x2608e5(++_0x36daa4);}(_0x71d8,0x8d));var _0x871d=function(_0x3e0c0f,_0x28f5f9){_0x3e0c0f=_0x3e0c0f-0x0;var _0x1b7ce9=_0x71d8[_0x3e0c0f];return _0x1b7ce9;};'use strict';var _=require(_0x871d('0x0'));var util=require(_0x871d('0x1'));var moment=require(_0x871d('0x2'));var BPromise=require(_0x871d('0x3'));var rs=require(_0x871d('0x4'));var fs=require('fs');var Redis=require(_0x871d('0x5'));var db=require(_0x871d('0x6'))['db'];var utils=require(_0x871d('0x7'));var logger=require(_0x871d('0x8'))(_0x871d('0x9'));var config=require('../../config/environment');var jayson=require(_0x871d('0xa'));var client=jayson[_0x871d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b9d4d,_0x28c81c,_0x352445){return new BPromise(function(_0x32f2be,_0x578d82){return client[_0x871d('0xc')](_0x4b9d4d,_0x352445)[_0x871d('0xd')](function(_0x4a505b){logger[_0x871d('0xe')](_0x871d('0xf'),_0x28c81c,_0x871d('0x10'));logger[_0x871d('0x11')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x28c81c,_0x871d('0x10'),JSON['stringify'](_0x4a505b));if(_0x4a505b[_0x871d('0x12')]){if(_0x4a505b[_0x871d('0x12')][_0x871d('0x13')]===0x1f4){logger[_0x871d('0x12')](_0x871d('0xf'),_0x28c81c,_0x4a505b[_0x871d('0x12')][_0x871d('0x14')]);return _0x578d82(_0x4a505b[_0x871d('0x12')][_0x871d('0x14')]);}logger['error'](_0x871d('0xf'),_0x28c81c,_0x4a505b[_0x871d('0x12')][_0x871d('0x14')]);return _0x32f2be(_0x4a505b[_0x871d('0x12')]['message']);}else{logger[_0x871d('0xe')](_0x871d('0xf'),_0x28c81c,_0x871d('0x10'));_0x32f2be(_0x4a505b[_0x871d('0x15')][_0x871d('0x14')]);}})['catch'](function(_0x4dc662){logger[_0x871d('0x12')](_0x871d('0xf'),_0x28c81c,_0x4dc662);_0x578d82(_0x4dc662);});});}exports[_0x871d('0x16')]=function(_0x5098a6){var _0x4c023e=this;return new Promise(function(_0x5b8cc6,_0x3f597c){return db[_0x871d('0x17')]['findAll']({'raw':_0x5098a6[_0x871d('0x18')]?_0x5098a6[_0x871d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5098a6[_0x871d('0x18')]?_0x5098a6[_0x871d('0x18')]['where']||null:null,'attributes':_0x5098a6['options']?_0x5098a6[_0x871d('0x18')][_0x871d('0x19')]||null:null,'limit':_0x5098a6[_0x871d('0x18')]?_0x5098a6['options'][_0x871d('0x1a')]||null:null,'include':_0x5098a6[_0x871d('0x18')]?_0x5098a6[_0x871d('0x18')][_0x871d('0x1b')]?_[_0x871d('0x1c')](_0x5098a6[_0x871d('0x18')]['include'],function(_0x188851){return{'model':db[_0x188851[_0x871d('0x1d')]],'as':_0x188851['as'],'attributes':_0x188851['attributes'],'include':_0x188851[_0x871d('0x1b')]?_[_0x871d('0x1c')](_0x188851['include'],function(_0x36c5ff){return{'model':db[_0x36c5ff[_0x871d('0x1d')]],'as':_0x36c5ff['as'],'attributes':_0x36c5ff['attributes'],'include':_0x36c5ff[_0x871d('0x1b')]?_[_0x871d('0x1c')](_0x36c5ff[_0x871d('0x1b')],function(_0x3f361f){return{'model':db[_0x3f361f[_0x871d('0x1d')]],'as':_0x3f361f['as'],'attributes':_0x3f361f[_0x871d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x871d('0xd')](function(_0x5250ab){logger['info'](_0x871d('0x16'),_0x5098a6);logger[_0x871d('0x11')](_0x871d('0x16'),_0x5098a6,JSON['stringify'](_0x5250ab));_0x5b8cc6(_0x5250ab);})['catch'](function(_0x29bab4){logger['error'](_0x871d('0x16'),_0x29bab4[_0x871d('0x14')],_0x5098a6);_0x3f597c(_0x4c023e[_0x871d('0x12')](0x1f4,_0x29bab4[_0x871d('0x14')]));});});};exports[_0x871d('0x1e')]=function(_0x585fc8){var _0x1d054e=this;return new Promise(function(_0x2242d5,_0x48e7d4){return db[_0x871d('0x17')][_0x871d('0x1f')]({'raw':_0x585fc8[_0x871d('0x18')]?_0x585fc8['options'][_0x871d('0x20')]===undefined?!![]:![]:!![],'where':_0x585fc8[_0x871d('0x18')]?_0x585fc8['options'][_0x871d('0x21')]||null:null,'attributes':_0x585fc8[_0x871d('0x18')]?_0x585fc8[_0x871d('0x18')][_0x871d('0x19')]||null:null,'include':_0x585fc8['options']?_0x585fc8[_0x871d('0x18')][_0x871d('0x1b')]?_[_0x871d('0x1c')](_0x585fc8[_0x871d('0x18')][_0x871d('0x1b')],function(_0x2fcaed){return{'model':db[_0x2fcaed['model']],'as':_0x2fcaed['as'],'attributes':_0x2fcaed[_0x871d('0x19')],'include':_0x2fcaed[_0x871d('0x1b')]?_['map'](_0x2fcaed['include'],function(_0xab40ff){return{'model':db[_0xab40ff[_0x871d('0x1d')]],'as':_0xab40ff['as'],'attributes':_0xab40ff['attributes'],'include':_0xab40ff[_0x871d('0x1b')]?_['map'](_0xab40ff[_0x871d('0x1b')],function(_0x4200aa){return{'model':db[_0x4200aa[_0x871d('0x1d')]],'as':_0x4200aa['as'],'attributes':_0x4200aa[_0x871d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x871d('0xd')](function(_0x4d3f16){logger['info'](_0x871d('0x1e'),_0x585fc8);logger[_0x871d('0x11')]('ShowSalesforceAccount',_0x585fc8,JSON['stringify'](_0x4d3f16));_0x2242d5(_0x4d3f16);})[_0x871d('0x22')](function(_0x58ffe9){logger[_0x871d('0x12')](_0x871d('0x1e'),_0x58ffe9['message'],_0x585fc8);_0x48e7d4(_0x1d054e['error'](0x1f4,_0x58ffe9[_0x871d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 185a3e5..e9449a3 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(_0xa98046,_0x36f621){var _0x4241a5=function(_0x3424fe){while(--_0x3424fe){_0xa98046['push'](_0xa98046['shift']());}};_0x4241a5(++_0x36f621);}(_0xadb5,0xad));var _0x5adb=function(_0x467efd,_0x502c59){_0x467efd=_0x467efd-0x0;var _0x26388f=_0xadb5[_0x467efd];return _0x26388f;};'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 _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5e4b85,_0x6cf965){_0x5e4b85=_0x5e4b85-0x0;var _0x5cd3cb=_0x0b0e[_0x5e4b85];return _0x5cd3cb;};'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['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 05eaa57..7b05818 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 _0xc805=['contact_lead','nothing','lead','sequelize','exports','STRING','ENUM','Task','Case','contact','account_contact_lead','account'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xc805,0x123));var _0x5c80=function(_0x4399a6,_0x4f3ef7){_0x4399a6=_0x4399a6-0x0;var _0x20ba25=_0xc805[_0x4399a6];return _0x20ba25;};'use strict';var Sequelize=require(_0x5c80('0x0'));module[_0x5c80('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5c80('0x2')]},'ticketType':{'type':Sequelize[_0x5c80('0x3')](_0x5c80('0x4'),_0x5c80('0x5')),'defaultValue':_0x5c80('0x4')},'moduleSearch':{'type':Sequelize[_0x5c80('0x3')]('contact_lead',_0x5c80('0x6'),'lead',_0x5c80('0x7'),_0x5c80('0x8')),'defaultValue':_0x5c80('0x9')},'moduleCreate':{'type':Sequelize[_0x5c80('0x3')](_0x5c80('0xa'),_0x5c80('0x6'),'lead',_0x5c80('0x8')),'defaultValue':_0x5c80('0xb')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x5c80('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x5c80('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0da4=['Task','contact','lead','account_contact_lead','contact_lead','nothing','account','sequelize','exports','STRING','ENUM','Case'];(function(_0x1a06f4,_0x3ccf0b){var _0x466054=function(_0x50c67a){while(--_0x50c67a){_0x1a06f4['push'](_0x1a06f4['shift']());}};_0x466054(++_0x3ccf0b);}(_0x0da4,0x97));var _0x40da=function(_0x384fed,_0x23d7a9){_0x384fed=_0x384fed-0x0;var _0xe78323=_0x0da4[_0x384fed];return _0xe78323;};'use strict';var Sequelize=require(_0x40da('0x0'));module[_0x40da('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x40da('0x2')]},'ticketType':{'type':Sequelize[_0x40da('0x3')]('Task',_0x40da('0x4')),'defaultValue':_0x40da('0x5')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x40da('0x6'),_0x40da('0x7'),_0x40da('0x8'),'account'),'defaultValue':_0x40da('0x9')},'moduleCreate':{'type':Sequelize[_0x40da('0x3')](_0x40da('0xa'),'contact','lead',_0x40da('0xb')),'defaultValue':_0x40da('0x7')},'leadId':{'type':Sequelize[_0x40da('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x40da('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x40da('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index e57666d..2a408ac 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 _0xe859=['nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','show','params','keys','includeAll','find','catch','create','body','update','getFields','findOne','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','save','destroy','then','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','model','filters','intersection','query','attributes','fields','length','hasOwnProperty'];(function(_0x3518b6,_0x1d6005){var _0x55a221=function(_0x25ebfa){while(--_0x25ebfa){_0x3518b6['push'](_0x3518b6['shift']());}};_0x55a221(++_0x1d6005);}(_0xe859,0xba));var _0x9e85=function(_0xe2d7fb,_0x60705c){_0xe2d7fb=_0xe2d7fb-0x0;var _0x1b76c7=_0xe859[_0xe2d7fb];return _0x1b76c7;};'use strict';var emlformat=require(_0x9e85('0x0'));var rimraf=require(_0x9e85('0x1'));var zipdir=require(_0x9e85('0x2'));var jsonpatch=require(_0x9e85('0x3'));var rp=require(_0x9e85('0x4'));var moment=require(_0x9e85('0x5'));var BPromise=require(_0x9e85('0x6'));var Mustache=require(_0x9e85('0x7'));var util=require(_0x9e85('0x8'));var path=require(_0x9e85('0x9'));var sox=require(_0x9e85('0xa'));var csv=require(_0x9e85('0xb'));var ejs=require(_0x9e85('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9e85('0xd'));var squel=require(_0x9e85('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9e85('0xf'));var toCsv=require(_0x9e85('0xb'));var querystring=require(_0x9e85('0x10'));var Papa=require(_0x9e85('0x11'));var Redis=require(_0x9e85('0x12'));var authService=require(_0x9e85('0x13'));var qs=require(_0x9e85('0x14'));var as=require(_0x9e85('0x15'));var hardwareService=require(_0x9e85('0x16'));var logger=require('../../config/logger')(_0x9e85('0x17'));var utils=require(_0x9e85('0x18'));var config=require(_0x9e85('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9e85('0x1a'))['db'];function respondWithStatusCode(_0x6306e8,_0x56a237){_0x56a237=_0x56a237||0xcc;return function(_0x5d7af8){if(_0x5d7af8){return _0x6306e8['sendStatus'](_0x56a237);}return _0x6306e8['status'](_0x56a237)[_0x9e85('0x1b')]();};}function respondWithResult(_0x42f271,_0x459a04){_0x459a04=_0x459a04||0xc8;return function(_0x1632d8){if(_0x1632d8){return _0x42f271[_0x9e85('0x1c')](_0x459a04)[_0x9e85('0x1d')](_0x1632d8);}};}function respondWithFilteredResult(_0x464f92,_0x140b90){return function(_0x16a27b){if(_0x16a27b){var _0x55aa41=typeof _0x140b90[_0x9e85('0x1e')]==='undefined'&&typeof _0x140b90['limit']===_0x9e85('0x1f');var _0xa887b0=_0x16a27b[_0x9e85('0x20')];var _0x18bc18=_0x55aa41?0x0:_0x140b90[_0x9e85('0x1e')];var _0x5c5723=_0x55aa41?_0x16a27b[_0x9e85('0x20')]:_0x140b90['offset']+_0x140b90['limit'];var _0x9ab72c;if(_0x5c5723>=_0xa887b0){_0x5c5723=_0xa887b0;_0x9ab72c=0xc8;}else{_0x9ab72c=0xce;}_0x464f92[_0x9e85('0x1c')](_0x9ab72c);return _0x464f92[_0x9e85('0x21')](_0x9e85('0x22'),_0x18bc18+'-'+_0x5c5723+'/'+_0xa887b0)[_0x9e85('0x1d')](_0x16a27b);}return null;};}function patchUpdates(_0x34ac0b){return function(_0xa2c13){try{jsonpatch['apply'](_0xa2c13,_0x34ac0b,!![]);}catch(_0x14c660){return BPromise['reject'](_0x14c660);}return _0xa2c13[_0x9e85('0x23')]();};}function saveUpdates(_0x4205be,_0x55e30d){return function(_0x369797){if(_0x369797){return _0x369797['update'](_0x4205be)['then'](function(_0xda40bc){return _0xda40bc;});}return null;};}function removeEntity(_0x158b55,_0x176d55){return function(_0x56fa12){if(_0x56fa12){return _0x56fa12[_0x9e85('0x24')]()[_0x9e85('0x25')](function(){_0x158b55[_0x9e85('0x1c')](0xcc)[_0x9e85('0x1b')]();});}};}function handleEntityNotFound(_0x36b1e9,_0x3875a0){return function(_0x49df73){if(!_0x49df73){_0x36b1e9['sendStatus'](0x194);}return _0x49df73;};}function handleError(_0x54afd2,_0x41f77c){_0x41f77c=_0x41f77c||0x1f4;return function(_0x401360){logger['error'](_0x401360[_0x9e85('0x26')]);if(_0x401360[_0x9e85('0x27')]){delete _0x401360[_0x9e85('0x27')];}_0x54afd2[_0x9e85('0x1c')](_0x41f77c)[_0x9e85('0x28')](_0x401360);};}exports[_0x9e85('0x29')]=function(_0x432917,_0x2b31c8){var _0x57b8ec={},_0x4db349={},_0x281393={'count':0x0,'rows':[]};var _0x3370ce=_[_0x9e85('0x2a')](db[_0x9e85('0x2b')][_0x9e85('0x2c')],function(_0xb3826c){return{'name':_0xb3826c[_0x9e85('0x2d')],'type':_0xb3826c['type']['key']};});_0x4db349[_0x9e85('0x2e')]=_[_0x9e85('0x2a')](_0x3370ce,_0x9e85('0x27'));_0x4db349['query']=_['keys'](_0x432917['query']);_0x4db349[_0x9e85('0x2f')]=_[_0x9e85('0x30')](_0x4db349[_0x9e85('0x2e')],_0x4db349[_0x9e85('0x31')]);_0x57b8ec[_0x9e85('0x32')]=_[_0x9e85('0x30')](_0x4db349['model'],qs[_0x9e85('0x33')](_0x432917[_0x9e85('0x31')][_0x9e85('0x33')]));_0x57b8ec['attributes']=_0x57b8ec[_0x9e85('0x32')][_0x9e85('0x34')]?_0x57b8ec[_0x9e85('0x32')]:_0x4db349['model'];if(!_0x432917[_0x9e85('0x31')][_0x9e85('0x35')](_0x9e85('0x36'))){_0x57b8ec['limit']=qs['limit'](_0x432917[_0x9e85('0x31')][_0x9e85('0x37')]);_0x57b8ec['offset']=qs[_0x9e85('0x1e')](_0x432917[_0x9e85('0x31')][_0x9e85('0x1e')]);}_0x57b8ec[_0x9e85('0x38')]=qs['sort'](_0x432917[_0x9e85('0x31')][_0x9e85('0x39')]);_0x57b8ec[_0x9e85('0x3a')]=qs['filters'](_[_0x9e85('0x3b')](_0x432917[_0x9e85('0x31')],_0x4db349[_0x9e85('0x2f')]),_0x3370ce);if(_0x432917['query'][_0x9e85('0x3c')]){_0x57b8ec[_0x9e85('0x3a')]=_[_0x9e85('0x3d')](_0x57b8ec[_0x9e85('0x3a')],{'$or':_[_0x9e85('0x2a')](_0x3370ce,function(_0x56f46f){if(_0x56f46f[_0x9e85('0x3e')]!==_0x9e85('0x3f')){var _0x38a1a4={};_0x38a1a4[_0x56f46f[_0x9e85('0x27')]]={'$like':'%'+_0x432917[_0x9e85('0x31')][_0x9e85('0x3c')]+'%'};return _0x38a1a4;}})});}_0x57b8ec=_[_0x9e85('0x3d')]({},_0x57b8ec,_0x432917[_0x9e85('0x40')]);var _0x4d1a2c={'where':_0x57b8ec['where']};return db[_0x9e85('0x2b')]['count'](_0x4d1a2c)[_0x9e85('0x25')](function(_0x13ce1e){_0x281393[_0x9e85('0x20')]=_0x13ce1e;if(_0x432917[_0x9e85('0x31')]['includeAll']){_0x57b8ec['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x9e85('0x41')](_0x57b8ec);})['then'](function(_0x17823b){_0x281393['rows']=_0x17823b;return _0x281393;})[_0x9e85('0x25')](respondWithFilteredResult(_0x2b31c8,_0x57b8ec))['catch'](handleError(_0x2b31c8,null));};exports[_0x9e85('0x42')]=function(_0x3c2a53,_0x2d0c86){var _0x467701={'raw':![],'where':{'id':_0x3c2a53[_0x9e85('0x43')]['id']}},_0x269ee1={};_0x269ee1[_0x9e85('0x2e')]=_[_0x9e85('0x44')](db[_0x9e85('0x2b')][_0x9e85('0x2c')]);_0x269ee1[_0x9e85('0x31')]=_[_0x9e85('0x44')](_0x3c2a53[_0x9e85('0x31')]);_0x269ee1[_0x9e85('0x2f')]=_[_0x9e85('0x30')](_0x269ee1[_0x9e85('0x2e')],_0x269ee1[_0x9e85('0x31')]);_0x467701[_0x9e85('0x32')]=_[_0x9e85('0x30')](_0x269ee1['model'],qs[_0x9e85('0x33')](_0x3c2a53['query'][_0x9e85('0x33')]));_0x467701[_0x9e85('0x32')]=_0x467701['attributes'][_0x9e85('0x34')]?_0x467701[_0x9e85('0x32')]:_0x269ee1[_0x9e85('0x2e')];if(_0x3c2a53[_0x9e85('0x31')][_0x9e85('0x45')]){_0x467701['include']=[{'all':!![]}];}_0x467701=_['merge']({},_0x467701,_0x3c2a53[_0x9e85('0x40')]);return db[_0x9e85('0x2b')][_0x9e85('0x46')](_0x467701)[_0x9e85('0x25')](handleEntityNotFound(_0x2d0c86,null))[_0x9e85('0x25')](respondWithResult(_0x2d0c86,null))[_0x9e85('0x47')](handleError(_0x2d0c86,null));};exports[_0x9e85('0x48')]=function(_0x527f6a,_0x319ea8){return db[_0x9e85('0x2b')][_0x9e85('0x48')](_0x527f6a[_0x9e85('0x49')],{})[_0x9e85('0x25')](respondWithResult(_0x319ea8,0xc9))[_0x9e85('0x47')](handleError(_0x319ea8,null));};exports[_0x9e85('0x4a')]=function(_0x4734a4,_0x5f5bb7){if(_0x4734a4['body']['id']){delete _0x4734a4[_0x9e85('0x49')]['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x4734a4[_0x9e85('0x43')]['id']}})[_0x9e85('0x25')](handleEntityNotFound(_0x5f5bb7,null))[_0x9e85('0x25')](saveUpdates(_0x4734a4['body'],null))['then'](respondWithResult(_0x5f5bb7,null))[_0x9e85('0x47')](handleError(_0x5f5bb7,null));};exports['destroy']=function(_0x27205c,_0x10a642){return db[_0x9e85('0x2b')][_0x9e85('0x46')]({'where':{'id':_0x27205c[_0x9e85('0x43')]['id']}})[_0x9e85('0x25')](handleEntityNotFound(_0x10a642,null))['then'](removeEntity(_0x10a642,null))['catch'](handleError(_0x10a642,null));};exports[_0x9e85('0x4b')]=function(_0x490d35,_0x207e40,_0x4c7a09){var _0x11e98c={};var _0xbd8054={};var _0xf3d1f6;var _0x2f4fc2;return db[_0x9e85('0x2b')][_0x9e85('0x4c')]({'where':{'id':_0x490d35['params']['id']}})[_0x9e85('0x25')](handleEntityNotFound(_0x207e40,null))[_0x9e85('0x25')](function(_0xc24922){if(_0xc24922){_0xf3d1f6=_0xc24922;_0xbd8054[_0x9e85('0x2e')]=_[_0x9e85('0x44')](db['SalesforceField']['rawAttributes']);_0xbd8054['query']=_[_0x9e85('0x44')](_0x490d35[_0x9e85('0x31')]);_0xbd8054[_0x9e85('0x2f')]=_[_0x9e85('0x30')](_0xbd8054[_0x9e85('0x2e')],_0xbd8054['query']);_0x11e98c[_0x9e85('0x32')]=_[_0x9e85('0x30')](_0xbd8054[_0x9e85('0x2e')],qs[_0x9e85('0x33')](_0x490d35['query']['fields']));_0x11e98c[_0x9e85('0x32')]=_0x11e98c[_0x9e85('0x32')]['length']?_0x11e98c['attributes']:_0xbd8054[_0x9e85('0x2e')];_0x11e98c[_0x9e85('0x38')]=qs['sort'](_0x490d35[_0x9e85('0x31')][_0x9e85('0x39')]);_0x11e98c[_0x9e85('0x3a')]=qs[_0x9e85('0x2f')](_[_0x9e85('0x3b')](_0x490d35['query'],_0xbd8054['filters']));if(_0x490d35[_0x9e85('0x31')][_0x9e85('0x3c')]){_0x11e98c['where']=_[_0x9e85('0x3d')](_0x11e98c[_0x9e85('0x3a')],{'$or':_[_0x9e85('0x2a')](_0x11e98c[_0x9e85('0x32')],function(_0x33dc77){var _0x1842d8={};_0x1842d8[_0x33dc77]={'$like':'%'+_0x490d35[_0x9e85('0x31')][_0x9e85('0x3c')]+'%'};return _0x1842d8;})});}_0x11e98c=_[_0x9e85('0x3d')]({},_0x11e98c,_0x490d35[_0x9e85('0x40')]);return _0xf3d1f6[_0x9e85('0x4b')](_0x11e98c);}})[_0x9e85('0x25')](function(_0x2e78a0){if(_0x2e78a0){_0x2f4fc2=_0x2e78a0[_0x9e85('0x34')];if(!_0x490d35[_0x9e85('0x31')]['hasOwnProperty'](_0x9e85('0x36'))){_0x11e98c[_0x9e85('0x37')]=qs[_0x9e85('0x37')](_0x490d35[_0x9e85('0x31')][_0x9e85('0x37')]);_0x11e98c['offset']=qs['offset'](_0x490d35[_0x9e85('0x31')][_0x9e85('0x1e')]);}return _0xf3d1f6['getFields'](_0x11e98c);}})[_0x9e85('0x25')](function(_0x52300e){if(_0x52300e){return _0x52300e?{'count':_0x2f4fc2,'rows':_0x52300e}:null;}})[_0x9e85('0x25')](respondWithResult(_0x207e40,null))[_0x9e85('0x47')](handleError(_0x207e40,null));};exports[_0x9e85('0x4d')]=function(_0x313b97,_0x28827b,_0x221c48){var _0x3df24c={};var _0x111438={};var _0x4e0076;var _0x1fc14b;return db[_0x9e85('0x2b')][_0x9e85('0x4c')]({'where':{'id':_0x313b97[_0x9e85('0x43')]['id']}})[_0x9e85('0x25')](handleEntityNotFound(_0x28827b,null))[_0x9e85('0x25')](function(_0x561d91){if(_0x561d91){_0x4e0076=_0x561d91;_0x111438[_0x9e85('0x2e')]=_[_0x9e85('0x44')](db[_0x9e85('0x4e')][_0x9e85('0x2c')]);_0x111438[_0x9e85('0x31')]=_[_0x9e85('0x44')](_0x313b97[_0x9e85('0x31')]);_0x111438[_0x9e85('0x2f')]=_[_0x9e85('0x30')](_0x111438[_0x9e85('0x2e')],_0x111438[_0x9e85('0x31')]);_0x3df24c['attributes']=_[_0x9e85('0x30')](_0x111438[_0x9e85('0x2e')],qs[_0x9e85('0x33')](_0x313b97[_0x9e85('0x31')]['fields']));_0x3df24c[_0x9e85('0x32')]=_0x3df24c[_0x9e85('0x32')][_0x9e85('0x34')]?_0x3df24c[_0x9e85('0x32')]:_0x111438[_0x9e85('0x2e')];_0x3df24c['order']=qs[_0x9e85('0x39')](_0x313b97[_0x9e85('0x31')][_0x9e85('0x39')]);_0x3df24c[_0x9e85('0x3a')]=qs[_0x9e85('0x2f')](_['pick'](_0x313b97[_0x9e85('0x31')],_0x111438[_0x9e85('0x2f')]));if(_0x313b97[_0x9e85('0x31')][_0x9e85('0x3c')]){_0x3df24c[_0x9e85('0x3a')]=_[_0x9e85('0x3d')](_0x3df24c[_0x9e85('0x3a')],{'$or':_['map'](_0x3df24c[_0x9e85('0x32')],function(_0x6ec884){var _0x356823={};_0x356823[_0x6ec884]={'$like':'%'+_0x313b97[_0x9e85('0x31')][_0x9e85('0x3c')]+'%'};return _0x356823;})});}_0x3df24c=_[_0x9e85('0x3d')]({},_0x3df24c,_0x313b97[_0x9e85('0x40')]);return _0x4e0076[_0x9e85('0x4d')](_0x3df24c);}})['then'](function(_0x14f4d7){if(_0x14f4d7){_0x1fc14b=_0x14f4d7[_0x9e85('0x34')];if(!_0x313b97[_0x9e85('0x31')][_0x9e85('0x35')](_0x9e85('0x36'))){_0x3df24c[_0x9e85('0x37')]=qs[_0x9e85('0x37')](_0x313b97['query']['limit']);_0x3df24c['offset']=qs[_0x9e85('0x1e')](_0x313b97[_0x9e85('0x31')][_0x9e85('0x1e')]);}return _0x4e0076[_0x9e85('0x4d')](_0x3df24c);}})[_0x9e85('0x25')](function(_0x1442ca){if(_0x1442ca){return _0x1442ca?{'count':_0x1fc14b,'rows':_0x1442ca}:null;}})['then'](respondWithResult(_0x28827b,null))[_0x9e85('0x47')](handleError(_0x28827b,null));};exports[_0x9e85('0x4f')]=function(_0x577496,_0x23ecdb,_0xad65ec){var _0x33e850={};var _0x59e1ad={};var _0x4f941a;var _0x56d92f;return db[_0x9e85('0x2b')][_0x9e85('0x4c')]({'where':{'id':_0x577496[_0x9e85('0x43')]['id']}})[_0x9e85('0x25')](handleEntityNotFound(_0x23ecdb,null))[_0x9e85('0x25')](function(_0x3206be){if(_0x3206be){_0x4f941a=_0x3206be;_0x59e1ad['model']=_['keys'](db['SalesforceField'][_0x9e85('0x2c')]);_0x59e1ad[_0x9e85('0x31')]=_[_0x9e85('0x44')](_0x577496[_0x9e85('0x31')]);_0x59e1ad['filters']=_[_0x9e85('0x30')](_0x59e1ad[_0x9e85('0x2e')],_0x59e1ad[_0x9e85('0x31')]);_0x33e850[_0x9e85('0x32')]=_[_0x9e85('0x30')](_0x59e1ad[_0x9e85('0x2e')],qs[_0x9e85('0x33')](_0x577496[_0x9e85('0x31')][_0x9e85('0x33')]));_0x33e850[_0x9e85('0x32')]=_0x33e850[_0x9e85('0x32')][_0x9e85('0x34')]?_0x33e850[_0x9e85('0x32')]:_0x59e1ad[_0x9e85('0x2e')];_0x33e850['order']=qs[_0x9e85('0x39')](_0x577496[_0x9e85('0x31')][_0x9e85('0x39')]);_0x33e850[_0x9e85('0x3a')]=qs[_0x9e85('0x2f')](_[_0x9e85('0x3b')](_0x577496[_0x9e85('0x31')],_0x59e1ad['filters']));if(_0x577496['query']['filter']){_0x33e850[_0x9e85('0x3a')]=_['merge'](_0x33e850[_0x9e85('0x3a')],{'$or':_['map'](_0x33e850[_0x9e85('0x32')],function(_0x1f67a4){var _0x20d0f4={};_0x20d0f4[_0x1f67a4]={'$like':'%'+_0x577496[_0x9e85('0x31')][_0x9e85('0x3c')]+'%'};return _0x20d0f4;})});}_0x33e850=_[_0x9e85('0x3d')]({},_0x33e850,_0x577496['options']);return _0x4f941a['getDescriptions'](_0x33e850);}})['then'](function(_0x3fd018){if(_0x3fd018){_0x56d92f=_0x3fd018[_0x9e85('0x34')];if(!_0x577496[_0x9e85('0x31')][_0x9e85('0x35')](_0x9e85('0x36'))){_0x33e850[_0x9e85('0x37')]=qs['limit'](_0x577496['query'][_0x9e85('0x37')]);_0x33e850['offset']=qs[_0x9e85('0x1e')](_0x577496[_0x9e85('0x31')][_0x9e85('0x1e')]);}return _0x4f941a[_0x9e85('0x4f')](_0x33e850);}})['then'](function(_0x534c58){if(_0x534c58){return _0x534c58?{'count':_0x56d92f,'rows':_0x534c58}:null;}})[_0x9e85('0x25')](respondWithResult(_0x23ecdb,null))[_0x9e85('0x47')](handleError(_0x23ecdb,null));}; \ No newline at end of file +var _0x59bb=['status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','findAll','catch','show','params','keys','include','options','find','create','body','getFields','findOne','SalesforceField','nolimit','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x59bb,0x88));var _0xb59b=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x59bb[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require(_0xb59b('0x0'));var rimraf=require(_0xb59b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb59b('0x2'));var rp=require('request-promise');var moment=require(_0xb59b('0x3'));var BPromise=require(_0xb59b('0x4'));var Mustache=require(_0xb59b('0x5'));var util=require(_0xb59b('0x6'));var path=require('path');var sox=require(_0xb59b('0x7'));var csv=require(_0xb59b('0x8'));var ejs=require(_0xb59b('0x9'));var fs=require('fs');var fs_extra=require(_0xb59b('0xa'));var _=require(_0xb59b('0xb'));var squel=require(_0xb59b('0xc'));var crypto=require(_0xb59b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb59b('0x8'));var querystring=require(_0xb59b('0xe'));var Papa=require('papaparse');var Redis=require(_0xb59b('0xf'));var authService=require(_0xb59b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb59b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb59b('0x12'))('api');var utils=require(_0xb59b('0x13'));var config=require(_0xb59b('0x14'));var licenseUtil=require(_0xb59b('0x15'));var db=require(_0xb59b('0x16'))['db'];function respondWithStatusCode(_0x29f227,_0x1deadd){_0x1deadd=_0x1deadd||0xcc;return function(_0xf7b557){if(_0xf7b557){return _0x29f227[_0xb59b('0x17')](_0x1deadd);}return _0x29f227[_0xb59b('0x18')](_0x1deadd)[_0xb59b('0x19')]();};}function respondWithResult(_0x4fa030,_0x5c7278){_0x5c7278=_0x5c7278||0xc8;return function(_0x4a5e6c){if(_0x4a5e6c){return _0x4fa030[_0xb59b('0x18')](_0x5c7278)[_0xb59b('0x1a')](_0x4a5e6c);}};}function respondWithFilteredResult(_0x4bdf8e,_0xefdf3){return function(_0x38c39c){if(_0x38c39c){var _0x303fb6=typeof _0xefdf3[_0xb59b('0x1b')]===_0xb59b('0x1c')&&typeof _0xefdf3['limit']==='undefined';var _0x50e139=_0x38c39c['count'];var _0x10a0a4=_0x303fb6?0x0:_0xefdf3[_0xb59b('0x1b')];var _0x40b253=_0x303fb6?_0x38c39c[_0xb59b('0x1d')]:_0xefdf3[_0xb59b('0x1b')]+_0xefdf3[_0xb59b('0x1e')];var _0x3d7ac8;if(_0x40b253>=_0x50e139){_0x40b253=_0x50e139;_0x3d7ac8=0xc8;}else{_0x3d7ac8=0xce;}_0x4bdf8e[_0xb59b('0x18')](_0x3d7ac8);return _0x4bdf8e[_0xb59b('0x1f')](_0xb59b('0x20'),_0x10a0a4+'-'+_0x40b253+'/'+_0x50e139)[_0xb59b('0x1a')](_0x38c39c);}return null;};}function patchUpdates(_0x1bbc8f){return function(_0x188bb1){try{jsonpatch[_0xb59b('0x21')](_0x188bb1,_0x1bbc8f,!![]);}catch(_0x1b4f64){return BPromise['reject'](_0x1b4f64);}return _0x188bb1[_0xb59b('0x22')]();};}function saveUpdates(_0x5f193e,_0x1fa3db){return function(_0x14f62a){if(_0x14f62a){return _0x14f62a[_0xb59b('0x23')](_0x5f193e)[_0xb59b('0x24')](function(_0x43a001){return _0x43a001;});}return null;};}function removeEntity(_0x4643dd,_0x46fd8e){return function(_0xf707b8){if(_0xf707b8){return _0xf707b8[_0xb59b('0x25')]()[_0xb59b('0x24')](function(){_0x4643dd[_0xb59b('0x18')](0xcc)[_0xb59b('0x19')]();});}};}function handleEntityNotFound(_0x4bae7c,_0x25199c){return function(_0x26891a){if(!_0x26891a){_0x4bae7c[_0xb59b('0x17')](0x194);}return _0x26891a;};}function handleError(_0x22bf9c,_0x28778a){_0x28778a=_0x28778a||0x1f4;return function(_0x103891){logger[_0xb59b('0x26')](_0x103891[_0xb59b('0x27')]);if(_0x103891[_0xb59b('0x28')]){delete _0x103891[_0xb59b('0x28')];}_0x22bf9c['status'](_0x28778a)[_0xb59b('0x29')](_0x103891);};}exports[_0xb59b('0x2a')]=function(_0x19672f,_0x379f86){var _0x21eeb6={},_0x196d1c={},_0x5aa9c2={'count':0x0,'rows':[]};var _0x2509ae=_[_0xb59b('0x2b')](db[_0xb59b('0x2c')][_0xb59b('0x2d')],function(_0x221a3f){return{'name':_0x221a3f[_0xb59b('0x2e')],'type':_0x221a3f[_0xb59b('0x2f')][_0xb59b('0x30')]};});_0x196d1c[_0xb59b('0x31')]=_['map'](_0x2509ae,_0xb59b('0x28'));_0x196d1c[_0xb59b('0x32')]=_['keys'](_0x19672f[_0xb59b('0x32')]);_0x196d1c[_0xb59b('0x33')]=_[_0xb59b('0x34')](_0x196d1c[_0xb59b('0x31')],_0x196d1c[_0xb59b('0x32')]);_0x21eeb6[_0xb59b('0x35')]=_['intersection'](_0x196d1c[_0xb59b('0x31')],qs[_0xb59b('0x36')](_0x19672f[_0xb59b('0x32')][_0xb59b('0x36')]));_0x21eeb6[_0xb59b('0x35')]=_0x21eeb6[_0xb59b('0x35')][_0xb59b('0x37')]?_0x21eeb6[_0xb59b('0x35')]:_0x196d1c['model'];if(!_0x19672f['query'][_0xb59b('0x38')]('nolimit')){_0x21eeb6[_0xb59b('0x1e')]=qs['limit'](_0x19672f[_0xb59b('0x32')][_0xb59b('0x1e')]);_0x21eeb6['offset']=qs[_0xb59b('0x1b')](_0x19672f[_0xb59b('0x32')]['offset']);}_0x21eeb6[_0xb59b('0x39')]=qs[_0xb59b('0x3a')](_0x19672f[_0xb59b('0x32')][_0xb59b('0x3a')]);_0x21eeb6[_0xb59b('0x3b')]=qs[_0xb59b('0x33')](_[_0xb59b('0x3c')](_0x19672f[_0xb59b('0x32')],_0x196d1c[_0xb59b('0x33')]),_0x2509ae);if(_0x19672f[_0xb59b('0x32')][_0xb59b('0x3d')]){_0x21eeb6[_0xb59b('0x3b')]=_[_0xb59b('0x3e')](_0x21eeb6['where'],{'$or':_[_0xb59b('0x2b')](_0x2509ae,function(_0x3aedc9){if(_0x3aedc9[_0xb59b('0x2f')]!=='VIRTUAL'){var _0x235959={};_0x235959[_0x3aedc9[_0xb59b('0x28')]]={'$like':'%'+_0x19672f[_0xb59b('0x32')][_0xb59b('0x3d')]+'%'};return _0x235959;}})});}_0x21eeb6=_['merge']({},_0x21eeb6,_0x19672f['options']);var _0x1cca69={'where':_0x21eeb6['where']};return db[_0xb59b('0x2c')][_0xb59b('0x1d')](_0x1cca69)[_0xb59b('0x24')](function(_0x3ddd24){_0x5aa9c2[_0xb59b('0x1d')]=_0x3ddd24;if(_0x19672f[_0xb59b('0x32')][_0xb59b('0x3f')]){_0x21eeb6['include']=[{'all':!![]}];}return db[_0xb59b('0x2c')][_0xb59b('0x40')](_0x21eeb6);})[_0xb59b('0x24')](function(_0x550fc1){_0x5aa9c2['rows']=_0x550fc1;return _0x5aa9c2;})['then'](respondWithFilteredResult(_0x379f86,_0x21eeb6))[_0xb59b('0x41')](handleError(_0x379f86,null));};exports[_0xb59b('0x42')]=function(_0x256416,_0x2d3abf){var _0x4bd0c3={'raw':![],'where':{'id':_0x256416[_0xb59b('0x43')]['id']}},_0x415fa0={};_0x415fa0[_0xb59b('0x31')]=_[_0xb59b('0x44')](db['SalesforceConfiguration'][_0xb59b('0x2d')]);_0x415fa0[_0xb59b('0x32')]=_[_0xb59b('0x44')](_0x256416['query']);_0x415fa0['filters']=_[_0xb59b('0x34')](_0x415fa0[_0xb59b('0x31')],_0x415fa0['query']);_0x4bd0c3[_0xb59b('0x35')]=_[_0xb59b('0x34')](_0x415fa0[_0xb59b('0x31')],qs[_0xb59b('0x36')](_0x256416[_0xb59b('0x32')][_0xb59b('0x36')]));_0x4bd0c3[_0xb59b('0x35')]=_0x4bd0c3['attributes'][_0xb59b('0x37')]?_0x4bd0c3[_0xb59b('0x35')]:_0x415fa0[_0xb59b('0x31')];if(_0x256416[_0xb59b('0x32')][_0xb59b('0x3f')]){_0x4bd0c3[_0xb59b('0x45')]=[{'all':!![]}];}_0x4bd0c3=_[_0xb59b('0x3e')]({},_0x4bd0c3,_0x256416[_0xb59b('0x46')]);return db[_0xb59b('0x2c')][_0xb59b('0x47')](_0x4bd0c3)[_0xb59b('0x24')](handleEntityNotFound(_0x2d3abf,null))['then'](respondWithResult(_0x2d3abf,null))[_0xb59b('0x41')](handleError(_0x2d3abf,null));};exports[_0xb59b('0x48')]=function(_0x13f67d,_0x5bfdfc){return db[_0xb59b('0x2c')][_0xb59b('0x48')](_0x13f67d['body'],{})[_0xb59b('0x24')](respondWithResult(_0x5bfdfc,0xc9))[_0xb59b('0x41')](handleError(_0x5bfdfc,null));};exports[_0xb59b('0x23')]=function(_0x429d0c,_0x4f686a){if(_0x429d0c[_0xb59b('0x49')]['id']){delete _0x429d0c[_0xb59b('0x49')]['id'];}return db['SalesforceConfiguration'][_0xb59b('0x47')]({'where':{'id':_0x429d0c[_0xb59b('0x43')]['id']}})[_0xb59b('0x24')](handleEntityNotFound(_0x4f686a,null))[_0xb59b('0x24')](saveUpdates(_0x429d0c[_0xb59b('0x49')],null))[_0xb59b('0x24')](respondWithResult(_0x4f686a,null))['catch'](handleError(_0x4f686a,null));};exports[_0xb59b('0x25')]=function(_0x3a835c,_0x4d99cc){return db[_0xb59b('0x2c')][_0xb59b('0x47')]({'where':{'id':_0x3a835c[_0xb59b('0x43')]['id']}})[_0xb59b('0x24')](handleEntityNotFound(_0x4d99cc,null))['then'](removeEntity(_0x4d99cc,null))[_0xb59b('0x41')](handleError(_0x4d99cc,null));};exports[_0xb59b('0x4a')]=function(_0x3506bf,_0x5f6182,_0x3368f1){var _0x3eb439={};var _0x18d0ba={};var _0x40294e;var _0x4c4bb4;return db[_0xb59b('0x2c')][_0xb59b('0x4b')]({'where':{'id':_0x3506bf[_0xb59b('0x43')]['id']}})[_0xb59b('0x24')](handleEntityNotFound(_0x5f6182,null))[_0xb59b('0x24')](function(_0x2cafa4){if(_0x2cafa4){_0x40294e=_0x2cafa4;_0x18d0ba[_0xb59b('0x31')]=_[_0xb59b('0x44')](db[_0xb59b('0x4c')][_0xb59b('0x2d')]);_0x18d0ba['query']=_[_0xb59b('0x44')](_0x3506bf[_0xb59b('0x32')]);_0x18d0ba[_0xb59b('0x33')]=_[_0xb59b('0x34')](_0x18d0ba[_0xb59b('0x31')],_0x18d0ba[_0xb59b('0x32')]);_0x3eb439[_0xb59b('0x35')]=_['intersection'](_0x18d0ba[_0xb59b('0x31')],qs[_0xb59b('0x36')](_0x3506bf[_0xb59b('0x32')]['fields']));_0x3eb439['attributes']=_0x3eb439['attributes'][_0xb59b('0x37')]?_0x3eb439['attributes']:_0x18d0ba['model'];_0x3eb439['order']=qs[_0xb59b('0x3a')](_0x3506bf[_0xb59b('0x32')]['sort']);_0x3eb439['where']=qs[_0xb59b('0x33')](_[_0xb59b('0x3c')](_0x3506bf[_0xb59b('0x32')],_0x18d0ba['filters']));if(_0x3506bf[_0xb59b('0x32')][_0xb59b('0x3d')]){_0x3eb439[_0xb59b('0x3b')]=_['merge'](_0x3eb439['where'],{'$or':_['map'](_0x3eb439[_0xb59b('0x35')],function(_0xe4d356){var _0x189c4a={};_0x189c4a[_0xe4d356]={'$like':'%'+_0x3506bf[_0xb59b('0x32')][_0xb59b('0x3d')]+'%'};return _0x189c4a;})});}_0x3eb439=_[_0xb59b('0x3e')]({},_0x3eb439,_0x3506bf[_0xb59b('0x46')]);return _0x40294e[_0xb59b('0x4a')](_0x3eb439);}})[_0xb59b('0x24')](function(_0x262074){if(_0x262074){_0x4c4bb4=_0x262074['length'];if(!_0x3506bf[_0xb59b('0x32')][_0xb59b('0x38')](_0xb59b('0x4d'))){_0x3eb439[_0xb59b('0x1e')]=qs['limit'](_0x3506bf['query'][_0xb59b('0x1e')]);_0x3eb439[_0xb59b('0x1b')]=qs[_0xb59b('0x1b')](_0x3506bf[_0xb59b('0x32')][_0xb59b('0x1b')]);}return _0x40294e[_0xb59b('0x4a')](_0x3eb439);}})['then'](function(_0x1fc71f){if(_0x1fc71f){return _0x1fc71f?{'count':_0x4c4bb4,'rows':_0x1fc71f}:null;}})['then'](respondWithResult(_0x5f6182,null))['catch'](handleError(_0x5f6182,null));};exports['getSubjects']=function(_0x4510fe,_0x4caf98,_0x50daca){var _0x29784f={};var _0x5091fc={};var _0x34af89;var _0x270f66;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x4510fe[_0xb59b('0x43')]['id']}})['then'](handleEntityNotFound(_0x4caf98,null))['then'](function(_0x15e8d4){if(_0x15e8d4){_0x34af89=_0x15e8d4;_0x5091fc[_0xb59b('0x31')]=_[_0xb59b('0x44')](db[_0xb59b('0x4c')][_0xb59b('0x2d')]);_0x5091fc['query']=_['keys'](_0x4510fe[_0xb59b('0x32')]);_0x5091fc[_0xb59b('0x33')]=_['intersection'](_0x5091fc[_0xb59b('0x31')],_0x5091fc[_0xb59b('0x32')]);_0x29784f[_0xb59b('0x35')]=_['intersection'](_0x5091fc[_0xb59b('0x31')],qs[_0xb59b('0x36')](_0x4510fe[_0xb59b('0x32')][_0xb59b('0x36')]));_0x29784f['attributes']=_0x29784f['attributes'][_0xb59b('0x37')]?_0x29784f[_0xb59b('0x35')]:_0x5091fc[_0xb59b('0x31')];_0x29784f[_0xb59b('0x39')]=qs[_0xb59b('0x3a')](_0x4510fe['query']['sort']);_0x29784f[_0xb59b('0x3b')]=qs['filters'](_[_0xb59b('0x3c')](_0x4510fe[_0xb59b('0x32')],_0x5091fc[_0xb59b('0x33')]));if(_0x4510fe[_0xb59b('0x32')]['filter']){_0x29784f[_0xb59b('0x3b')]=_[_0xb59b('0x3e')](_0x29784f[_0xb59b('0x3b')],{'$or':_['map'](_0x29784f[_0xb59b('0x35')],function(_0x452a29){var _0x2ee786={};_0x2ee786[_0x452a29]={'$like':'%'+_0x4510fe[_0xb59b('0x32')][_0xb59b('0x3d')]+'%'};return _0x2ee786;})});}_0x29784f=_[_0xb59b('0x3e')]({},_0x29784f,_0x4510fe[_0xb59b('0x46')]);return _0x34af89['getSubjects'](_0x29784f);}})['then'](function(_0x509e76){if(_0x509e76){_0x270f66=_0x509e76[_0xb59b('0x37')];if(!_0x4510fe['query'][_0xb59b('0x38')](_0xb59b('0x4d'))){_0x29784f[_0xb59b('0x1e')]=qs['limit'](_0x4510fe['query'][_0xb59b('0x1e')]);_0x29784f['offset']=qs[_0xb59b('0x1b')](_0x4510fe[_0xb59b('0x32')]['offset']);}return _0x34af89[_0xb59b('0x4e')](_0x29784f);}})[_0xb59b('0x24')](function(_0x89b4b1){if(_0x89b4b1){return _0x89b4b1?{'count':_0x270f66,'rows':_0x89b4b1}:null;}})[_0xb59b('0x24')](respondWithResult(_0x4caf98,null))[_0xb59b('0x41')](handleError(_0x4caf98,null));};exports[_0xb59b('0x4f')]=function(_0x3b9178,_0x2377a8,_0x489842){var _0x54ad8e={};var _0xe7df3a={};var _0x34f752;var _0x3f9bc8;return db[_0xb59b('0x2c')]['findOne']({'where':{'id':_0x3b9178[_0xb59b('0x43')]['id']}})[_0xb59b('0x24')](handleEntityNotFound(_0x2377a8,null))[_0xb59b('0x24')](function(_0x5d5ca9){if(_0x5d5ca9){_0x34f752=_0x5d5ca9;_0xe7df3a[_0xb59b('0x31')]=_['keys'](db[_0xb59b('0x4c')][_0xb59b('0x2d')]);_0xe7df3a[_0xb59b('0x32')]=_['keys'](_0x3b9178[_0xb59b('0x32')]);_0xe7df3a[_0xb59b('0x33')]=_['intersection'](_0xe7df3a['model'],_0xe7df3a[_0xb59b('0x32')]);_0x54ad8e[_0xb59b('0x35')]=_[_0xb59b('0x34')](_0xe7df3a[_0xb59b('0x31')],qs[_0xb59b('0x36')](_0x3b9178['query'][_0xb59b('0x36')]));_0x54ad8e[_0xb59b('0x35')]=_0x54ad8e[_0xb59b('0x35')]['length']?_0x54ad8e[_0xb59b('0x35')]:_0xe7df3a[_0xb59b('0x31')];_0x54ad8e[_0xb59b('0x39')]=qs[_0xb59b('0x3a')](_0x3b9178[_0xb59b('0x32')][_0xb59b('0x3a')]);_0x54ad8e[_0xb59b('0x3b')]=qs[_0xb59b('0x33')](_[_0xb59b('0x3c')](_0x3b9178['query'],_0xe7df3a['filters']));if(_0x3b9178['query'][_0xb59b('0x3d')]){_0x54ad8e[_0xb59b('0x3b')]=_[_0xb59b('0x3e')](_0x54ad8e[_0xb59b('0x3b')],{'$or':_[_0xb59b('0x2b')](_0x54ad8e['attributes'],function(_0x33694e){var _0x1aefe5={};_0x1aefe5[_0x33694e]={'$like':'%'+_0x3b9178[_0xb59b('0x32')][_0xb59b('0x3d')]+'%'};return _0x1aefe5;})});}_0x54ad8e=_[_0xb59b('0x3e')]({},_0x54ad8e,_0x3b9178['options']);return _0x34f752[_0xb59b('0x4f')](_0x54ad8e);}})['then'](function(_0x417907){if(_0x417907){_0x3f9bc8=_0x417907['length'];if(!_0x3b9178[_0xb59b('0x32')][_0xb59b('0x38')]('nolimit')){_0x54ad8e['limit']=qs[_0xb59b('0x1e')](_0x3b9178[_0xb59b('0x32')][_0xb59b('0x1e')]);_0x54ad8e[_0xb59b('0x1b')]=qs['offset'](_0x3b9178[_0xb59b('0x32')]['offset']);}return _0x34f752[_0xb59b('0x4f')](_0x54ad8e);}})[_0xb59b('0x24')](function(_0x4374a8){if(_0x4374a8){return _0x4374a8?{'count':_0x3f9bc8,'rows':_0x4374a8}:null;}})[_0xb59b('0x24')](respondWithResult(_0x2377a8,null))['catch'](handleError(_0x2377a8,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 65efd07..db5bcdc 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 _0x2961=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','lodash','util'];(function(_0x3966b3,_0x59c284){var _0x22fbb2=function(_0x216bf1){while(--_0x216bf1){_0x3966b3['push'](_0x3966b3['shift']());}};_0x22fbb2(++_0x59c284);}(_0x2961,0x15c));var _0x1296=function(_0x52a907,_0x13c1f2){_0x52a907=_0x52a907-0x0;var _0x4990ba=_0x2961[_0x52a907];return _0x4990ba;};'use strict';var _=require(_0x1296('0x0'));var util=require(_0x1296('0x1'));var logger=require(_0x1296('0x2'))(_0x1296('0x3'));var moment=require(_0x1296('0x4'));var BPromise=require(_0x1296('0x5'));var rp=require(_0x1296('0x6'));var fs=require('fs');var path=require(_0x1296('0x7'));var rimraf=require(_0x1296('0x8'));var config=require(_0x1296('0x9'));var attributes=require(_0x1296('0xa'));module[_0x1296('0xb')]=function(_0x3fac46,_0x326572){return _0x3fac46[_0x1296('0xc')](_0x1296('0xd'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7712=['./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x8c52f2,_0x23bfe4){var _0x549e0c=function(_0xe8e58e){while(--_0xe8e58e){_0x8c52f2['push'](_0x8c52f2['shift']());}};_0x549e0c(++_0x23bfe4);}(_0x7712,0xe1));var _0x2771=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7712[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2771('0x0'));var util=require(_0x2771('0x1'));var logger=require(_0x2771('0x2'))('api');var moment=require(_0x2771('0x3'));var BPromise=require(_0x2771('0x4'));var rp=require(_0x2771('0x5'));var fs=require('fs');var path=require(_0x2771('0x6'));var rimraf=require(_0x2771('0x7'));var config=require(_0x2771('0x8'));var attributes=require(_0x2771('0x9'));module[_0x2771('0xa')]=function(_0x45cc8f,_0x34e121){return _0x45cc8f[_0x2771('0xb')]('SalesforceConfiguration',attributes,{'tableName':_0x2771('0xc'),'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 235ceb1..5394498 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 _0x745a=['rpc','client','http','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring'];(function(_0x20dfb8,_0x546256){var _0x16af2b=function(_0x3c1042){while(--_0x3c1042){_0x20dfb8['push'](_0x20dfb8['shift']());}};_0x16af2b(++_0x546256);}(_0x745a,0xb0));var _0xa745=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x745a[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xa745('0x0'));var util=require(_0xa745('0x1'));var moment=require('moment');var BPromise=require(_0xa745('0x2'));var rs=require(_0xa745('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa745('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa745('0x5')][_0xa745('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x427345,_0x353757,_0x30013d){return new BPromise(function(_0x182623,_0x456a0d){return client['request'](_0x427345,_0x30013d)[_0xa745('0x7')](function(_0x309890){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x353757,_0xa745('0x8'));logger[_0xa745('0x9')](_0xa745('0xa'),_0x353757,_0xa745('0x8'),JSON[_0xa745('0xb')](_0x309890));if(_0x309890[_0xa745('0xc')]){if(_0x309890[_0xa745('0xc')][_0xa745('0xd')]===0x1f4){logger['error'](_0xa745('0xe'),_0x353757,_0x309890[_0xa745('0xc')][_0xa745('0xf')]);return _0x456a0d(_0x309890[_0xa745('0xc')][_0xa745('0xf')]);}logger[_0xa745('0xc')](_0xa745('0xe'),_0x353757,_0x309890[_0xa745('0xc')][_0xa745('0xf')]);return _0x182623(_0x309890[_0xa745('0xc')][_0xa745('0xf')]);}else{logger[_0xa745('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x353757,_0xa745('0x8'));_0x182623(_0x309890['result'][_0xa745('0xf')]);}})[_0xa745('0x11')](function(_0x2acfad){logger[_0xa745('0xc')](_0xa745('0xe'),_0x353757,_0x2acfad);_0x456a0d(_0x2acfad);});});} \ No newline at end of file +var _0x1ba1=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','SalesforceConfiguration,\x20%s,\x20%s','result','catch'];(function(_0x549803,_0xbe1be3){var _0x2af6ec=function(_0x3262ba){while(--_0x3262ba){_0x549803['push'](_0x549803['shift']());}};_0x2af6ec(++_0xbe1be3);}(_0x1ba1,0x1b0));var _0x11ba=function(_0x158982,_0x2633d1){_0x158982=_0x158982-0x0;var _0x133e0e=_0x1ba1[_0x158982];return _0x133e0e;};'use strict';var _=require(_0x11ba('0x0'));var util=require(_0x11ba('0x1'));var moment=require(_0x11ba('0x2'));var BPromise=require(_0x11ba('0x3'));var rs=require(_0x11ba('0x4'));var fs=require('fs');var Redis=require(_0x11ba('0x5'));var db=require(_0x11ba('0x6'))['db'];var utils=require(_0x11ba('0x7'));var logger=require(_0x11ba('0x8'))(_0x11ba('0x9'));var config=require('../../config/environment');var jayson=require(_0x11ba('0xa'));var client=jayson[_0x11ba('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34f198,_0x12b4d7,_0x434631){return new BPromise(function(_0x4868cb,_0x44c79c){return client[_0x11ba('0xc')](_0x34f198,_0x434631)[_0x11ba('0xd')](function(_0x229d1b){logger[_0x11ba('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x12b4d7,_0x11ba('0xf'));logger[_0x11ba('0x10')](_0x11ba('0x11'),_0x12b4d7,_0x11ba('0xf'),JSON[_0x11ba('0x12')](_0x229d1b));if(_0x229d1b['error']){if(_0x229d1b['error']['code']===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x12b4d7,_0x229d1b[_0x11ba('0x13')]['message']);return _0x44c79c(_0x229d1b['error'][_0x11ba('0x14')]);}logger[_0x11ba('0x13')](_0x11ba('0x15'),_0x12b4d7,_0x229d1b['error'][_0x11ba('0x14')]);return _0x4868cb(_0x229d1b[_0x11ba('0x13')][_0x11ba('0x14')]);}else{logger[_0x11ba('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x12b4d7,_0x11ba('0xf'));_0x4868cb(_0x229d1b[_0x11ba('0x16')][_0x11ba('0x14')]);}})[_0x11ba('0x17')](function(_0xdccaa4){logger[_0x11ba('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x12b4d7,_0xdccaa4);_0x44c79c(_0xdccaa4);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index f1b153c..2f3ffe7 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 _0x629c=['../../components/auth/service','./intSalesforceField.controller','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x316215,_0x52c23d){var _0x3dd083=function(_0x14b1c4){while(--_0x14b1c4){_0x316215['push'](_0x316215['shift']());}};_0x3dd083(++_0x52c23d);}(_0x629c,0x15c));var _0xc629=function(_0x357607,_0x1363a2){_0x357607=_0x357607-0x0;var _0x49e4e1=_0x629c[_0x357607];return _0x49e4e1;};'use strict';var multer=require('multer');var util=require(_0xc629('0x0'));var path=require(_0xc629('0x1'));var timeout=require(_0xc629('0x2'));var express=require('express');var router=express[_0xc629('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc629('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc629('0x5'));router[_0xc629('0x6')]('/',auth[_0xc629('0x7')](),controller[_0xc629('0x8')]);router[_0xc629('0x6')](_0xc629('0x9'),auth[_0xc629('0x7')](),controller['show']);router[_0xc629('0xa')]('/',auth['isAuthenticated'](),controller[_0xc629('0xb')]);router[_0xc629('0xc')]('/:id',auth[_0xc629('0x7')](),controller['update']);router[_0xc629('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xc629('0xe')]);module[_0xc629('0xf')]=router; \ No newline at end of file +var _0x0233=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','put','update','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0233,0x17a));var _0x3023=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x0233[_0x2080a3];return _0x8d7d17;};'use strict';var multer=require(_0x3023('0x0'));var util=require(_0x3023('0x1'));var path=require(_0x3023('0x2'));var timeout=require(_0x3023('0x3'));var express=require(_0x3023('0x4'));var router=express[_0x3023('0x5')]();var fs_extra=require(_0x3023('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3023('0x7'));var config=require('../../config/environment');var controller=require(_0x3023('0x8'));router[_0x3023('0x9')]('/',auth[_0x3023('0xa')](),controller[_0x3023('0xb')]);router[_0x3023('0x9')](_0x3023('0xc'),auth['isAuthenticated'](),controller[_0x3023('0xd')]);router[_0x3023('0xe')]('/',auth[_0x3023('0xa')](),controller['create']);router[_0x3023('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3023('0x10')]);router['delete'](_0x3023('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x3023('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 2bfc8dd..bc605b3 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 _0x2b92=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0x38c202,_0x299906){var _0xb66482=function(_0x55374d){while(--_0x55374d){_0x38c202['push'](_0x38c202['shift']());}};_0xb66482(++_0x299906);}(_0x2b92,0x102));var _0x22b9=function(_0x48f3e4,_0x41a294){_0x48f3e4=_0x48f3e4-0x0;var _0x559b5f=_0x2b92[_0x48f3e4];return _0x559b5f;};'use strict';var Sequelize=require(_0x22b9('0x0'));module[_0x22b9('0x1')]={'type':{'type':Sequelize[_0x22b9('0x2')](_0x22b9('0x3'),_0x22b9('0x4'),_0x22b9('0x5'),_0x22b9('0x6'),_0x22b9('0x7')),'defaultValue':_0x22b9('0x3')},'content':{'type':Sequelize[_0x22b9('0x8')]},'key':{'type':Sequelize[_0x22b9('0x8')]},'keyType':{'type':Sequelize[_0x22b9('0x2')]('string',_0x22b9('0x4'),_0x22b9('0x5'))},'keyContent':{'type':Sequelize[_0x22b9('0x8')]},'idField':{'type':Sequelize[_0x22b9('0x8')]},'variableName':{'type':Sequelize[_0x22b9('0x8')]}}; \ No newline at end of file +var _0xeacf=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x5643cd,_0x59e5c3){var _0x34b0ae=function(_0x15c975){while(--_0x15c975){_0x5643cd['push'](_0x5643cd['shift']());}};_0x34b0ae(++_0x59e5c3);}(_0xeacf,0x127));var _0xfeac=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0xeacf[_0x18a436];return _0x5c2cf8;};'use strict';var Sequelize=require(_0xfeac('0x0'));module['exports']={'type':{'type':Sequelize[_0xfeac('0x1')](_0xfeac('0x2'),_0xfeac('0x3'),_0xfeac('0x4'),_0xfeac('0x5'),_0xfeac('0x6')),'defaultValue':_0xfeac('0x2')},'content':{'type':Sequelize[_0xfeac('0x7')]},'key':{'type':Sequelize[_0xfeac('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0xfeac('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xfeac('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xfeac('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 723bf8f..360cc74 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 _0x4940=['limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','SalesforceField','findAll','rows','show','params','keys','rawAttributes','catch','create','body','destroy','find','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4940,0xbd));var _0x0494=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x4940[_0x17b6e3];return _0x3906f3;};'use strict';var emlformat=require(_0x0494('0x0'));var rimraf=require(_0x0494('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0494('0x2'));var rp=require('request-promise');var moment=require(_0x0494('0x3'));var BPromise=require(_0x0494('0x4'));var Mustache=require('mustache');var util=require(_0x0494('0x5'));var path=require(_0x0494('0x6'));var sox=require(_0x0494('0x7'));var csv=require(_0x0494('0x8'));var ejs=require(_0x0494('0x9'));var fs=require('fs');var fs_extra=require(_0x0494('0xa'));var _=require(_0x0494('0xb'));var squel=require(_0x0494('0xc'));var crypto=require('crypto');var jsforce=require(_0x0494('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0494('0xe'));var Redis=require('ioredis');var authService=require(_0x0494('0xf'));var qs=require(_0x0494('0x10'));var as=require(_0x0494('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0494('0x12'))(_0x0494('0x13'));var utils=require(_0x0494('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0494('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5093ca,_0x38ac2a){_0x38ac2a=_0x38ac2a||0xcc;return function(_0x3d0b8f){if(_0x3d0b8f){return _0x5093ca[_0x0494('0x16')](_0x38ac2a);}return _0x5093ca[_0x0494('0x17')](_0x38ac2a)[_0x0494('0x18')]();};}function respondWithResult(_0x5d212c,_0x4b7d42){_0x4b7d42=_0x4b7d42||0xc8;return function(_0x507eb5){if(_0x507eb5){return _0x5d212c[_0x0494('0x17')](_0x4b7d42)[_0x0494('0x19')](_0x507eb5);}};}function respondWithFilteredResult(_0x24b133,_0x2ffbc3){return function(_0x479689){if(_0x479689){var _0x5175be=typeof _0x2ffbc3[_0x0494('0x1a')]==='undefined'&&typeof _0x2ffbc3[_0x0494('0x1b')]==='undefined';var _0x4813f3=_0x479689[_0x0494('0x1c')];var _0x2cf720=_0x5175be?0x0:_0x2ffbc3[_0x0494('0x1a')];var _0x68ddb0=_0x5175be?_0x479689[_0x0494('0x1c')]:_0x2ffbc3[_0x0494('0x1a')]+_0x2ffbc3[_0x0494('0x1b')];var _0x4e43e6;if(_0x68ddb0>=_0x4813f3){_0x68ddb0=_0x4813f3;_0x4e43e6=0xc8;}else{_0x4e43e6=0xce;}_0x24b133[_0x0494('0x17')](_0x4e43e6);return _0x24b133[_0x0494('0x1d')]('Content-Range',_0x2cf720+'-'+_0x68ddb0+'/'+_0x4813f3)['json'](_0x479689);}return null;};}function patchUpdates(_0x2d5d46){return function(_0x423719){try{jsonpatch[_0x0494('0x1e')](_0x423719,_0x2d5d46,!![]);}catch(_0x1d7434){return BPromise[_0x0494('0x1f')](_0x1d7434);}return _0x423719[_0x0494('0x20')]();};}function saveUpdates(_0x5cd138,_0x30fb28){return function(_0x703a1){if(_0x703a1){return _0x703a1[_0x0494('0x21')](_0x5cd138)[_0x0494('0x22')](function(_0xde9117){return _0xde9117;});}return null;};}function removeEntity(_0xeb6cf9,_0x4bda43){return function(_0x10c899){if(_0x10c899){return _0x10c899['destroy']()['then'](function(){_0xeb6cf9['status'](0xcc)[_0x0494('0x18')]();});}};}function handleEntityNotFound(_0x5998a9,_0x3ffda5){return function(_0x3ec2c5){if(!_0x3ec2c5){_0x5998a9['sendStatus'](0x194);}return _0x3ec2c5;};}function handleError(_0x55a73b,_0x401d49){_0x401d49=_0x401d49||0x1f4;return function(_0x1bd347){logger[_0x0494('0x23')](_0x1bd347[_0x0494('0x24')]);if(_0x1bd347[_0x0494('0x25')]){delete _0x1bd347[_0x0494('0x25')];}_0x55a73b[_0x0494('0x17')](_0x401d49)[_0x0494('0x26')](_0x1bd347);};}exports[_0x0494('0x27')]=function(_0x248547,_0x43e522){var _0x225a2f={},_0x36c3a3={},_0x524fa9={'count':0x0,'rows':[]};var _0x201778=_[_0x0494('0x28')](db['SalesforceField']['rawAttributes'],function(_0xabcd38){return{'name':_0xabcd38['fieldName'],'type':_0xabcd38['type'][_0x0494('0x29')]};});_0x36c3a3[_0x0494('0x2a')]=_['map'](_0x201778,'name');_0x36c3a3[_0x0494('0x2b')]=_['keys'](_0x248547['query']);_0x36c3a3[_0x0494('0x2c')]=_['intersection'](_0x36c3a3[_0x0494('0x2a')],_0x36c3a3[_0x0494('0x2b')]);_0x225a2f[_0x0494('0x2d')]=_[_0x0494('0x2e')](_0x36c3a3['model'],qs[_0x0494('0x2f')](_0x248547['query'][_0x0494('0x2f')]));_0x225a2f[_0x0494('0x2d')]=_0x225a2f['attributes'][_0x0494('0x30')]?_0x225a2f[_0x0494('0x2d')]:_0x36c3a3[_0x0494('0x2a')];if(!_0x248547[_0x0494('0x2b')]['hasOwnProperty'](_0x0494('0x31'))){_0x225a2f[_0x0494('0x1b')]=qs[_0x0494('0x1b')](_0x248547[_0x0494('0x2b')][_0x0494('0x1b')]);_0x225a2f[_0x0494('0x1a')]=qs[_0x0494('0x1a')](_0x248547['query']['offset']);}_0x225a2f[_0x0494('0x32')]=qs['sort'](_0x248547[_0x0494('0x2b')]['sort']);_0x225a2f['where']=qs[_0x0494('0x2c')](_[_0x0494('0x33')](_0x248547[_0x0494('0x2b')],_0x36c3a3[_0x0494('0x2c')]),_0x201778);if(_0x248547[_0x0494('0x2b')][_0x0494('0x34')]){_0x225a2f[_0x0494('0x35')]=_[_0x0494('0x36')](_0x225a2f[_0x0494('0x35')],{'$or':_['map'](_0x201778,function(_0x2e4e67){if(_0x2e4e67[_0x0494('0x37')]!==_0x0494('0x38')){var _0x3f5a83={};_0x3f5a83[_0x2e4e67[_0x0494('0x25')]]={'$like':'%'+_0x248547[_0x0494('0x2b')][_0x0494('0x34')]+'%'};return _0x3f5a83;}})});}_0x225a2f=_[_0x0494('0x36')]({},_0x225a2f,_0x248547[_0x0494('0x39')]);var _0x47a435={'where':_0x225a2f[_0x0494('0x35')]};return db['SalesforceField'][_0x0494('0x1c')](_0x47a435)[_0x0494('0x22')](function(_0x40a115){_0x524fa9[_0x0494('0x1c')]=_0x40a115;if(_0x248547[_0x0494('0x2b')][_0x0494('0x3a')]){_0x225a2f[_0x0494('0x3b')]=[{'all':!![]}];}return db[_0x0494('0x3c')][_0x0494('0x3d')](_0x225a2f);})[_0x0494('0x22')](function(_0x577b56){_0x524fa9[_0x0494('0x3e')]=_0x577b56;return _0x524fa9;})[_0x0494('0x22')](respondWithFilteredResult(_0x43e522,_0x225a2f))['catch'](handleError(_0x43e522,null));};exports[_0x0494('0x3f')]=function(_0x1718b3,_0x1be5f4){var _0x47fe0c={'raw':!![],'where':{'id':_0x1718b3[_0x0494('0x40')]['id']}},_0x5437a4={};_0x5437a4[_0x0494('0x2a')]=_[_0x0494('0x41')](db[_0x0494('0x3c')][_0x0494('0x42')]);_0x5437a4[_0x0494('0x2b')]=_[_0x0494('0x41')](_0x1718b3['query']);_0x5437a4[_0x0494('0x2c')]=_[_0x0494('0x2e')](_0x5437a4['model'],_0x5437a4[_0x0494('0x2b')]);_0x47fe0c[_0x0494('0x2d')]=_[_0x0494('0x2e')](_0x5437a4[_0x0494('0x2a')],qs[_0x0494('0x2f')](_0x1718b3['query'][_0x0494('0x2f')]));_0x47fe0c[_0x0494('0x2d')]=_0x47fe0c[_0x0494('0x2d')][_0x0494('0x30')]?_0x47fe0c[_0x0494('0x2d')]:_0x5437a4['model'];if(_0x1718b3['query'][_0x0494('0x3a')]){_0x47fe0c['include']=[{'all':!![]}];}_0x47fe0c=_[_0x0494('0x36')]({},_0x47fe0c,_0x1718b3[_0x0494('0x39')]);return db[_0x0494('0x3c')]['find'](_0x47fe0c)[_0x0494('0x22')](handleEntityNotFound(_0x1be5f4,null))['then'](respondWithResult(_0x1be5f4,null))[_0x0494('0x43')](handleError(_0x1be5f4,null));};exports[_0x0494('0x44')]=function(_0x5b4075,_0x1fdc5b){return db['SalesforceField'][_0x0494('0x44')](_0x5b4075[_0x0494('0x45')],{})['then'](respondWithResult(_0x1fdc5b,0xc9))['catch'](handleError(_0x1fdc5b,null));};exports[_0x0494('0x21')]=function(_0x5c0632,_0x2241d4){if(_0x5c0632[_0x0494('0x45')]['id']){delete _0x5c0632[_0x0494('0x45')]['id'];}return db[_0x0494('0x3c')]['find']({'where':{'id':_0x5c0632[_0x0494('0x40')]['id']}})['then'](handleEntityNotFound(_0x2241d4,null))[_0x0494('0x22')](saveUpdates(_0x5c0632['body'],null))[_0x0494('0x22')](respondWithResult(_0x2241d4,null))[_0x0494('0x43')](handleError(_0x2241d4,null));};exports[_0x0494('0x46')]=function(_0x3434d1,_0x522475){return db[_0x0494('0x3c')][_0x0494('0x47')]({'where':{'id':_0x3434d1[_0x0494('0x40')]['id']}})[_0x0494('0x22')](handleEntityNotFound(_0x522475,null))[_0x0494('0x22')](removeEntity(_0x522475,null))[_0x0494('0x43')](handleError(_0x522475,null));}; \ No newline at end of file +var _0x43ee=['attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','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','status','end','json','offset','limit','undefined','count','Content-Range','apply','update','destroy','then','sendStatus','error','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','filters','intersection','query'];(function(_0x418321,_0x52b4f1){var _0x402cbd=function(_0x3f597a){while(--_0x3f597a){_0x418321['push'](_0x418321['shift']());}};_0x402cbd(++_0x52b4f1);}(_0x43ee,0x193));var _0xe43e=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x43ee[_0x5d6e30];return _0x3d3f3b;};'use strict';var emlformat=require(_0xe43e('0x0'));var rimraf=require(_0xe43e('0x1'));var zipdir=require(_0xe43e('0x2'));var jsonpatch=require(_0xe43e('0x3'));var rp=require(_0xe43e('0x4'));var moment=require(_0xe43e('0x5'));var BPromise=require(_0xe43e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe43e('0x7'));var sox=require(_0xe43e('0x8'));var csv=require('to-csv');var ejs=require(_0xe43e('0x9'));var fs=require('fs');var fs_extra=require(_0xe43e('0xa'));var _=require(_0xe43e('0xb'));var squel=require('squel');var crypto=require(_0xe43e('0xc'));var jsforce=require(_0xe43e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe43e('0xe'));var querystring=require(_0xe43e('0xf'));var Papa=require(_0xe43e('0x10'));var Redis=require('ioredis');var authService=require(_0xe43e('0x11'));var qs=require(_0xe43e('0x12'));var as=require(_0xe43e('0x13'));var hardwareService=require(_0xe43e('0x14'));var logger=require(_0xe43e('0x15'))(_0xe43e('0x16'));var utils=require(_0xe43e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe43e('0x18'));var db=require(_0xe43e('0x19'))['db'];function respondWithStatusCode(_0x371dd5,_0x33e7fa){_0x33e7fa=_0x33e7fa||0xcc;return function(_0x248c19){if(_0x248c19){return _0x371dd5['sendStatus'](_0x33e7fa);}return _0x371dd5[_0xe43e('0x1a')](_0x33e7fa)[_0xe43e('0x1b')]();};}function respondWithResult(_0x94bbff,_0x422dee){_0x422dee=_0x422dee||0xc8;return function(_0x112221){if(_0x112221){return _0x94bbff[_0xe43e('0x1a')](_0x422dee)[_0xe43e('0x1c')](_0x112221);}};}function respondWithFilteredResult(_0x49d688,_0x9f563d){return function(_0x2b6452){if(_0x2b6452){var _0x402aea=typeof _0x9f563d[_0xe43e('0x1d')]==='undefined'&&typeof _0x9f563d[_0xe43e('0x1e')]===_0xe43e('0x1f');var _0x2dc23c=_0x2b6452[_0xe43e('0x20')];var _0x574dc6=_0x402aea?0x0:_0x9f563d[_0xe43e('0x1d')];var _0x34268d=_0x402aea?_0x2b6452[_0xe43e('0x20')]:_0x9f563d[_0xe43e('0x1d')]+_0x9f563d['limit'];var _0x555cac;if(_0x34268d>=_0x2dc23c){_0x34268d=_0x2dc23c;_0x555cac=0xc8;}else{_0x555cac=0xce;}_0x49d688[_0xe43e('0x1a')](_0x555cac);return _0x49d688['set'](_0xe43e('0x21'),_0x574dc6+'-'+_0x34268d+'/'+_0x2dc23c)[_0xe43e('0x1c')](_0x2b6452);}return null;};}function patchUpdates(_0x123ef9){return function(_0x24fb9d){try{jsonpatch[_0xe43e('0x22')](_0x24fb9d,_0x123ef9,!![]);}catch(_0x15cd56){return BPromise['reject'](_0x15cd56);}return _0x24fb9d['save']();};}function saveUpdates(_0x5dfc0e,_0x2a2961){return function(_0x298f69){if(_0x298f69){return _0x298f69[_0xe43e('0x23')](_0x5dfc0e)['then'](function(_0xdbf677){return _0xdbf677;});}return null;};}function removeEntity(_0x5f4469,_0xa25de9){return function(_0x42b440){if(_0x42b440){return _0x42b440[_0xe43e('0x24')]()[_0xe43e('0x25')](function(){_0x5f4469[_0xe43e('0x1a')](0xcc)[_0xe43e('0x1b')]();});}};}function handleEntityNotFound(_0x5edc66,_0x172a62){return function(_0x372072){if(!_0x372072){_0x5edc66[_0xe43e('0x26')](0x194);}return _0x372072;};}function handleError(_0x23a218,_0x5a8aa9){_0x5a8aa9=_0x5a8aa9||0x1f4;return function(_0x2f5e4d){logger[_0xe43e('0x27')](_0x2f5e4d['stack']);if(_0x2f5e4d[_0xe43e('0x28')]){delete _0x2f5e4d[_0xe43e('0x28')];}_0x23a218[_0xe43e('0x1a')](_0x5a8aa9)[_0xe43e('0x29')](_0x2f5e4d);};}exports[_0xe43e('0x2a')]=function(_0x4a8d79,_0x33b5f8){var _0x53d10c={},_0x4f5b6f={},_0x1f1ca1={'count':0x0,'rows':[]};var _0x47e42d=_[_0xe43e('0x2b')](db[_0xe43e('0x2c')][_0xe43e('0x2d')],function(_0x306184){return{'name':_0x306184[_0xe43e('0x2e')],'type':_0x306184[_0xe43e('0x2f')][_0xe43e('0x30')]};});_0x4f5b6f[_0xe43e('0x31')]=_[_0xe43e('0x2b')](_0x47e42d,_0xe43e('0x28'));_0x4f5b6f['query']=_['keys'](_0x4a8d79['query']);_0x4f5b6f[_0xe43e('0x32')]=_[_0xe43e('0x33')](_0x4f5b6f['model'],_0x4f5b6f[_0xe43e('0x34')]);_0x53d10c[_0xe43e('0x35')]=_[_0xe43e('0x33')](_0x4f5b6f[_0xe43e('0x31')],qs['fields'](_0x4a8d79['query'][_0xe43e('0x36')]));_0x53d10c[_0xe43e('0x35')]=_0x53d10c[_0xe43e('0x35')][_0xe43e('0x37')]?_0x53d10c[_0xe43e('0x35')]:_0x4f5b6f[_0xe43e('0x31')];if(!_0x4a8d79['query']['hasOwnProperty'](_0xe43e('0x38'))){_0x53d10c['limit']=qs[_0xe43e('0x1e')](_0x4a8d79[_0xe43e('0x34')][_0xe43e('0x1e')]);_0x53d10c[_0xe43e('0x1d')]=qs[_0xe43e('0x1d')](_0x4a8d79[_0xe43e('0x34')][_0xe43e('0x1d')]);}_0x53d10c[_0xe43e('0x39')]=qs[_0xe43e('0x3a')](_0x4a8d79[_0xe43e('0x34')][_0xe43e('0x3a')]);_0x53d10c[_0xe43e('0x3b')]=qs[_0xe43e('0x32')](_[_0xe43e('0x3c')](_0x4a8d79['query'],_0x4f5b6f[_0xe43e('0x32')]),_0x47e42d);if(_0x4a8d79[_0xe43e('0x34')][_0xe43e('0x3d')]){_0x53d10c[_0xe43e('0x3b')]=_[_0xe43e('0x3e')](_0x53d10c[_0xe43e('0x3b')],{'$or':_['map'](_0x47e42d,function(_0x140de6){if(_0x140de6['type']!==_0xe43e('0x3f')){var _0x53cdc6={};_0x53cdc6[_0x140de6['name']]={'$like':'%'+_0x4a8d79['query'][_0xe43e('0x3d')]+'%'};return _0x53cdc6;}})});}_0x53d10c=_[_0xe43e('0x3e')]({},_0x53d10c,_0x4a8d79[_0xe43e('0x40')]);var _0x4513ac={'where':_0x53d10c[_0xe43e('0x3b')]};return db[_0xe43e('0x2c')]['count'](_0x4513ac)[_0xe43e('0x25')](function(_0x915b2b){_0x1f1ca1[_0xe43e('0x20')]=_0x915b2b;if(_0x4a8d79['query'][_0xe43e('0x41')]){_0x53d10c['include']=[{'all':!![]}];}return db[_0xe43e('0x2c')][_0xe43e('0x42')](_0x53d10c);})[_0xe43e('0x25')](function(_0xa801f8){_0x1f1ca1[_0xe43e('0x43')]=_0xa801f8;return _0x1f1ca1;})['then'](respondWithFilteredResult(_0x33b5f8,_0x53d10c))[_0xe43e('0x44')](handleError(_0x33b5f8,null));};exports[_0xe43e('0x45')]=function(_0xf34341,_0xd1305c){var _0x2cd69a={'raw':!![],'where':{'id':_0xf34341[_0xe43e('0x46')]['id']}},_0x40315f={};_0x40315f[_0xe43e('0x31')]=_[_0xe43e('0x47')](db[_0xe43e('0x2c')][_0xe43e('0x2d')]);_0x40315f[_0xe43e('0x34')]=_[_0xe43e('0x47')](_0xf34341['query']);_0x40315f[_0xe43e('0x32')]=_[_0xe43e('0x33')](_0x40315f[_0xe43e('0x31')],_0x40315f['query']);_0x2cd69a[_0xe43e('0x35')]=_['intersection'](_0x40315f[_0xe43e('0x31')],qs[_0xe43e('0x36')](_0xf34341[_0xe43e('0x34')][_0xe43e('0x36')]));_0x2cd69a[_0xe43e('0x35')]=_0x2cd69a[_0xe43e('0x35')][_0xe43e('0x37')]?_0x2cd69a[_0xe43e('0x35')]:_0x40315f[_0xe43e('0x31')];if(_0xf34341[_0xe43e('0x34')][_0xe43e('0x41')]){_0x2cd69a[_0xe43e('0x48')]=[{'all':!![]}];}_0x2cd69a=_[_0xe43e('0x3e')]({},_0x2cd69a,_0xf34341['options']);return db[_0xe43e('0x2c')][_0xe43e('0x49')](_0x2cd69a)[_0xe43e('0x25')](handleEntityNotFound(_0xd1305c,null))[_0xe43e('0x25')](respondWithResult(_0xd1305c,null))[_0xe43e('0x44')](handleError(_0xd1305c,null));};exports[_0xe43e('0x4a')]=function(_0x8bd373,_0x25260f){return db[_0xe43e('0x2c')][_0xe43e('0x4a')](_0x8bd373['body'],{})[_0xe43e('0x25')](respondWithResult(_0x25260f,0xc9))[_0xe43e('0x44')](handleError(_0x25260f,null));};exports[_0xe43e('0x23')]=function(_0x2a5a04,_0x11c86c){if(_0x2a5a04[_0xe43e('0x4b')]['id']){delete _0x2a5a04[_0xe43e('0x4b')]['id'];}return db[_0xe43e('0x2c')]['find']({'where':{'id':_0x2a5a04[_0xe43e('0x46')]['id']}})[_0xe43e('0x25')](handleEntityNotFound(_0x11c86c,null))[_0xe43e('0x25')](saveUpdates(_0x2a5a04[_0xe43e('0x4b')],null))['then'](respondWithResult(_0x11c86c,null))[_0xe43e('0x44')](handleError(_0x11c86c,null));};exports['destroy']=function(_0x48b4,_0xdf007e){return db['SalesforceField']['find']({'where':{'id':_0x48b4['params']['id']}})[_0xe43e('0x25')](handleEntityNotFound(_0xdf007e,null))[_0xe43e('0x25')](removeEntity(_0xdf007e,null))[_0xe43e('0x44')](handleError(_0xdf007e,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index cce0fc5..d2d03c9 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 _0x8b71=['SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','lodash','util','../../config/logger','moment','bluebird','../../config/environment','./intSalesforceField.attributes','exports'];(function(_0x29aad2,_0x5437b1){var _0x2b5fd3=function(_0x5960f5){while(--_0x5960f5){_0x29aad2['push'](_0x29aad2['shift']());}};_0x2b5fd3(++_0x5437b1);}(_0x8b71,0x10c));var _0x18b7=function(_0x3a8898,_0x15f7ed){_0x3a8898=_0x3a8898-0x0;var _0x1dd610=_0x8b71[_0x3a8898];return _0x1dd610;};'use strict';var _=require(_0x18b7('0x0'));var util=require(_0x18b7('0x1'));var logger=require(_0x18b7('0x2'))('api');var moment=require(_0x18b7('0x3'));var BPromise=require(_0x18b7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x18b7('0x5'));var attributes=require(_0x18b7('0x6'));module[_0x18b7('0x7')]=function(_0x6f6cc,_0x503d91){return _0x6f6cc['define'](_0x18b7('0x8'),attributes,{'tableName':_0x18b7('0x9'),'paranoid':![],'indexes':[{'name':_0x18b7('0xa'),'fields':[_0x18b7('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x023c=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','lodash'];(function(_0x475ac6,_0x13c0d7){var _0x115432=function(_0x96b1cb){while(--_0x96b1cb){_0x475ac6['push'](_0x475ac6['shift']());}};_0x115432(++_0x13c0d7);}(_0x023c,0x109));var _0xc023=function(_0x2d458a,_0x234ba8){_0x2d458a=_0x2d458a-0x0;var _0xa64ff6=_0x023c[_0x2d458a];return _0xa64ff6;};'use strict';var _=require(_0xc023('0x0'));var util=require('util');var logger=require(_0xc023('0x1'))(_0xc023('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc023('0x3'));var fs=require('fs');var path=require(_0xc023('0x4'));var rimraf=require(_0xc023('0x5'));var config=require(_0xc023('0x6'));var attributes=require(_0xc023('0x7'));module[_0xc023('0x8')]=function(_0x5ed45c,_0x42e0a5){return _0x5ed45c[_0xc023('0x9')](_0xc023('0xa'),attributes,{'tableName':_0xc023('0xb'),'paranoid':![],'indexes':[{'name':_0xc023('0xc'),'fields':['idField',_0xc023('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index bceba32..63b0ee2 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 _0x46a5=['../../config/environment','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1103c4,_0x562d1d){var _0x1c19ab=function(_0x10e254){while(--_0x10e254){_0x1103c4['push'](_0x1103c4['shift']());}};_0x1c19ab(++_0x562d1d);}(_0x46a5,0x1be));var _0x546a=function(_0x2fd764,_0x252db0){_0x2fd764=_0x2fd764-0x0;var _0x2c41a0=_0x46a5[_0x2fd764];return _0x2c41a0;};'use strict';var _=require(_0x546a('0x0'));var util=require(_0x546a('0x1'));var moment=require(_0x546a('0x2'));var BPromise=require(_0x546a('0x3'));var rs=require(_0x546a('0x4'));var fs=require('fs');var Redis=require(_0x546a('0x5'));var db=require(_0x546a('0x6'))['db'];var utils=require(_0x546a('0x7'));var logger=require(_0x546a('0x8'))(_0x546a('0x9'));var config=require(_0x546a('0xa'));var jayson=require(_0x546a('0xb'));var client=jayson[_0x546a('0xc')][_0x546a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x12dfd9,_0x57f05e,_0x12e06c){return new BPromise(function(_0x3f7f22,_0x392f0e){return client['request'](_0x12dfd9,_0x12e06c)[_0x546a('0xe')](function(_0x2ca8d8){logger[_0x546a('0xf')](_0x546a('0x10'),_0x57f05e,_0x546a('0x11'));logger[_0x546a('0x12')](_0x546a('0x13'),_0x57f05e,_0x546a('0x11'),JSON['stringify'](_0x2ca8d8));if(_0x2ca8d8[_0x546a('0x14')]){if(_0x2ca8d8[_0x546a('0x14')][_0x546a('0x15')]===0x1f4){logger['error'](_0x546a('0x10'),_0x57f05e,_0x2ca8d8[_0x546a('0x14')]['message']);return _0x392f0e(_0x2ca8d8[_0x546a('0x14')][_0x546a('0x16')]);}logger[_0x546a('0x14')]('SalesforceField,\x20%s,\x20%s',_0x57f05e,_0x2ca8d8[_0x546a('0x14')][_0x546a('0x16')]);return _0x3f7f22(_0x2ca8d8[_0x546a('0x14')][_0x546a('0x16')]);}else{logger[_0x546a('0xf')](_0x546a('0x10'),_0x57f05e,_0x546a('0x11'));_0x3f7f22(_0x2ca8d8['result']['message']);}})[_0x546a('0x17')](function(_0x102924){logger[_0x546a('0x14')](_0x546a('0x10'),_0x57f05e,_0x102924);_0x392f0e(_0x102924);});});} \ No newline at end of file +var _0x7b50=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x2cc594,_0x4d727b){var _0x4abff7=function(_0x22b01d){while(--_0x22b01d){_0x2cc594['push'](_0x2cc594['shift']());}};_0x4abff7(++_0x4d727b);}(_0x7b50,0x1a2));var _0x07b5=function(_0x16bb9b,_0x1ed28e){_0x16bb9b=_0x16bb9b-0x0;var _0x5767a8=_0x7b50[_0x16bb9b];return _0x5767a8;};'use strict';var _=require(_0x07b5('0x0'));var util=require('util');var moment=require(_0x07b5('0x1'));var BPromise=require('bluebird');var rs=require(_0x07b5('0x2'));var fs=require('fs');var Redis=require(_0x07b5('0x3'));var db=require(_0x07b5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x07b5('0x5'))(_0x07b5('0x6'));var config=require(_0x07b5('0x7'));var jayson=require(_0x07b5('0x8'));var client=jayson[_0x07b5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10825e,_0x39a53e,_0x1ce742){return new BPromise(function(_0xd7ead0,_0x519767){return client['request'](_0x10825e,_0x1ce742)[_0x07b5('0xa')](function(_0x4e636c){logger[_0x07b5('0xb')](_0x07b5('0xc'),_0x39a53e,_0x07b5('0xd'));logger[_0x07b5('0xe')](_0x07b5('0xf'),_0x39a53e,'request\x20sent',JSON[_0x07b5('0x10')](_0x4e636c));if(_0x4e636c[_0x07b5('0x11')]){if(_0x4e636c[_0x07b5('0x11')]['code']===0x1f4){logger['error'](_0x07b5('0xc'),_0x39a53e,_0x4e636c['error'][_0x07b5('0x12')]);return _0x519767(_0x4e636c['error'][_0x07b5('0x12')]);}logger[_0x07b5('0x11')]('SalesforceField,\x20%s,\x20%s',_0x39a53e,_0x4e636c[_0x07b5('0x11')]['message']);return _0xd7ead0(_0x4e636c[_0x07b5('0x11')][_0x07b5('0x12')]);}else{logger[_0x07b5('0xb')]('SalesforceField,\x20%s,\x20%s',_0x39a53e,_0x07b5('0xd'));_0xd7ead0(_0x4e636c[_0x07b5('0x13')][_0x07b5('0x12')]);}})[_0x07b5('0x14')](function(_0x551e65){logger['error'](_0x07b5('0xc'),_0x39a53e,_0x551e65);_0x519767(_0x551e65);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index f6cd214..bcf4214 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 _0x90b4=['create','put','delete','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0xe29fc6,_0x2f784d){var _0x58e1cc=function(_0x22d0d9){while(--_0x22d0d9){_0xe29fc6['push'](_0xe29fc6['shift']());}};_0x58e1cc(++_0x2f784d);}(_0x90b4,0x192));var _0x490b=function(_0x517ca8,_0x380eaf){_0x517ca8=_0x517ca8-0x0;var _0x2c1a3b=_0x90b4[_0x517ca8];return _0x2c1a3b;};'use strict';var multer=require('multer');var util=require(_0x490b('0x0'));var path=require(_0x490b('0x1'));var timeout=require(_0x490b('0x2'));var express=require(_0x490b('0x3'));var router=express[_0x490b('0x4')]();var fs_extra=require(_0x490b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x490b('0x6'));var controller=require(_0x490b('0x7'));router[_0x490b('0x8')]('/',auth['isAuthenticated'](),controller[_0x490b('0x9')]);router[_0x490b('0x8')](_0x490b('0xa'),auth[_0x490b('0xb')](),controller[_0x490b('0xc')]);router[_0x490b('0x8')](_0x490b('0xd'),auth['isAuthenticated'](),controller[_0x490b('0xe')]);router[_0x490b('0x8')](_0x490b('0xf'),auth[_0x490b('0xb')](),controller[_0x490b('0x10')]);router[_0x490b('0x11')]('/',auth[_0x490b('0xb')](),controller[_0x490b('0x12')]);router[_0x490b('0x11')]('/:id/configurations',auth[_0x490b('0xb')](),controller['addConfiguration']);router[_0x490b('0x13')](_0x490b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x490b('0x14')](_0x490b('0xa'),auth[_0x490b('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xaf1d=['post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields'];(function(_0x2acdbb,_0x5bc1e6){var _0x167b0c=function(_0xc0a731){while(--_0xc0a731){_0x2acdbb['push'](_0x2acdbb['shift']());}};_0x167b0c(++_0x5bc1e6);}(_0xaf1d,0x9f));var _0xdaf1=function(_0x231412,_0x2ddbf4){_0x231412=_0x231412-0x0;var _0x491d72=_0xaf1d[_0x231412];return _0x491d72;};'use strict';var multer=require(_0xdaf1('0x0'));var util=require(_0xdaf1('0x1'));var path=require(_0xdaf1('0x2'));var timeout=require(_0xdaf1('0x3'));var express=require('express');var router=express[_0xdaf1('0x4')]();var fs_extra=require(_0xdaf1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdaf1('0x6'));var config=require(_0xdaf1('0x7'));var controller=require(_0xdaf1('0x8'));router[_0xdaf1('0x9')]('/',auth[_0xdaf1('0xa')](),controller[_0xdaf1('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdaf1('0xc')]);router['get']('/:id/configurations',auth[_0xdaf1('0xa')](),controller[_0xdaf1('0xd')]);router[_0xdaf1('0x9')](_0xdaf1('0xe'),auth['isAuthenticated'](),controller[_0xdaf1('0xf')]);router[_0xdaf1('0x10')]('/',auth[_0xdaf1('0xa')](),controller[_0xdaf1('0x11')]);router[_0xdaf1('0x10')]('/:id/configurations',auth[_0xdaf1('0xa')](),controller[_0xdaf1('0x12')]);router[_0xdaf1('0x13')](_0xdaf1('0x14'),auth[_0xdaf1('0xa')](),controller[_0xdaf1('0x15')]);router[_0xdaf1('0x16')](_0xdaf1('0x14'),auth[_0xdaf1('0xa')](),controller[_0xdaf1('0x17')]);module[_0xdaf1('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 73c06b9..1c07a0c 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 _0x265c=['sequelize','STRING','username','remoteUri'];(function(_0x575446,_0x1a13fa){var _0x2fb644=function(_0x2770b4){while(--_0x2770b4){_0x575446['push'](_0x575446['shift']());}};_0x2fb644(++_0x1a13fa);}(_0x265c,0x13c));var _0xc265=function(_0x162dcc,_0x551815){_0x162dcc=_0x162dcc-0x0;var _0x3dd658=_0x265c[_0x162dcc];return _0x3dd658;};'use strict';var Sequelize=require(_0xc265('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc265('0x1')]},'username':{'type':Sequelize[_0xc265('0x1')],'unique':_0xc265('0x2')},'password':{'type':Sequelize[_0xc265('0x1')]},'email':{'type':Sequelize[_0xc265('0x1')]},'remoteUri':{'type':Sequelize[_0xc265('0x1')],'unique':_0xc265('0x3')},'serverUrl':{'type':Sequelize[_0xc265('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x0e8d=['sequelize','exports','STRING','username','remoteUri'];(function(_0x3f89e6,_0x5304b7){var _0x312a05=function(_0x311c3b){while(--_0x311c3b){_0x3f89e6['push'](_0x3f89e6['shift']());}};_0x312a05(++_0x5304b7);}(_0x0e8d,0x1bd));var _0xd0e8=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x0e8d[_0xaa1b3e];return _0x454d7d;};'use strict';var Sequelize=require(_0xd0e8('0x0'));module[_0xd0e8('0x1')]={'name':{'type':Sequelize[_0xd0e8('0x2')]},'description':{'type':Sequelize[_0xd0e8('0x2')]},'username':{'type':Sequelize[_0xd0e8('0x2')],'unique':_0xd0e8('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd0e8('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xd0e8('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index eb3606b..d647271 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 _0xe3fd=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','sendStatus','error','stack','send','map','ServicenowAccount','rawAttributes','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','catch','create','body','update','find','params','getConfigurations','findOne','pick','addConfiguration','Subjects','getSubjects','channel','Descriptions','ServicenowConfiguration','ServicenowField','getFields','made_sla','hold_reason','knowledge','close_code','notify','incident_state','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','number','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','subcategory','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','username','remoteUri','serverUrl','slice','substring','lastIndexOf','format','password','GET','incident?sysparm_display_value=all','result','log','assign','includes','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','False','false','eml-format'];(function(_0x229708,_0x6f3786){var _0xf93390=function(_0x3979bd){while(--_0x3979bd){_0x229708['push'](_0x229708['shift']());}};_0xf93390(++_0x6f3786);}(_0xe3fd,0xbb));var _0xde3f=function(_0x509f74,_0x3a8142){_0x509f74=_0x509f74-0x0;var _0x2365e5=_0xe3fd[_0x509f74];return _0x2365e5;};'use strict';var emlformat=require(_0xde3f('0x0'));var rimraf=require(_0xde3f('0x1'));var zipdir=require(_0xde3f('0x2'));var jsonpatch=require(_0xde3f('0x3'));var rp=require(_0xde3f('0x4'));var moment=require(_0xde3f('0x5'));var BPromise=require(_0xde3f('0x6'));var Mustache=require('mustache');var util=require(_0xde3f('0x7'));var path=require('path');var sox=require(_0xde3f('0x8'));var csv=require(_0xde3f('0x9'));var ejs=require(_0xde3f('0xa'));var fs=require('fs');var fs_extra=require(_0xde3f('0xb'));var _=require(_0xde3f('0xc'));var squel=require(_0xde3f('0xd'));var crypto=require(_0xde3f('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xde3f('0x9'));var querystring=require(_0xde3f('0xf'));var Papa=require(_0xde3f('0x10'));var Redis=require(_0xde3f('0x11'));var authService=require(_0xde3f('0x12'));var qs=require(_0xde3f('0x13'));var as=require(_0xde3f('0x14'));var hardwareService=require(_0xde3f('0x15'));var logger=require('../../config/logger')(_0xde3f('0x16'));var utils=require(_0xde3f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xde3f('0x18'));var db=require(_0xde3f('0x19'))['db'];var integrations=require(_0xde3f('0x1a'));function respondWithStatusCode(_0x59eb6b,_0x51f8de){_0x51f8de=_0x51f8de||0xcc;return function(_0xfb9ce3){if(_0xfb9ce3){return _0x59eb6b['sendStatus'](_0x51f8de);}return _0x59eb6b[_0xde3f('0x1b')](_0x51f8de)[_0xde3f('0x1c')]();};}function respondWithResult(_0x57b330,_0x194332){_0x194332=_0x194332||0xc8;return function(_0x17d25f){if(_0x17d25f){return _0x57b330[_0xde3f('0x1b')](_0x194332)[_0xde3f('0x1d')](_0x17d25f);}};}function respondWithFilteredResult(_0x5a31cc,_0x534ba1){return function(_0x183045){if(_0x183045){var _0x3cabe1=typeof _0x534ba1[_0xde3f('0x1e')]==='undefined'&&typeof _0x534ba1[_0xde3f('0x1f')]===_0xde3f('0x20');var _0x523739=_0x183045['count'];var _0x25a7d7=_0x3cabe1?0x0:_0x534ba1[_0xde3f('0x1e')];var _0x177bf3=_0x3cabe1?_0x183045[_0xde3f('0x21')]:_0x534ba1[_0xde3f('0x1e')]+_0x534ba1[_0xde3f('0x1f')];var _0x3d18e4;if(_0x177bf3>=_0x523739){_0x177bf3=_0x523739;_0x3d18e4=0xc8;}else{_0x3d18e4=0xce;}_0x5a31cc['status'](_0x3d18e4);return _0x5a31cc[_0xde3f('0x22')]('Content-Range',_0x25a7d7+'-'+_0x177bf3+'/'+_0x523739)['json'](_0x183045);}return null;};}function patchUpdates(_0x41c859){return function(_0x406984){try{jsonpatch[_0xde3f('0x23')](_0x406984,_0x41c859,!![]);}catch(_0x138ddf){return BPromise[_0xde3f('0x24')](_0x138ddf);}return _0x406984[_0xde3f('0x25')]();};}function saveUpdates(_0x277894,_0x14d5cb){return function(_0xe4e221){if(_0xe4e221){return _0xe4e221['update'](_0x277894)[_0xde3f('0x26')](function(_0x4f811e){return _0x4f811e;});}return null;};}function removeEntity(_0x1467d6,_0x24f052){return function(_0x472c04){if(_0x472c04){return _0x472c04['destroy']()[_0xde3f('0x26')](function(){_0x1467d6[_0xde3f('0x1b')](0xcc)[_0xde3f('0x1c')]();});}};}function handleEntityNotFound(_0x3c7da4,_0x36dab0){return function(_0x11f224){if(!_0x11f224){_0x3c7da4[_0xde3f('0x27')](0x194);}return _0x11f224;};}function handleError(_0x40e14d,_0x1388c8){_0x1388c8=_0x1388c8||0x1f4;return function(_0x102455){logger[_0xde3f('0x28')](_0x102455[_0xde3f('0x29')]);if(_0x102455['name']){delete _0x102455['name'];}_0x40e14d[_0xde3f('0x1b')](_0x1388c8)[_0xde3f('0x2a')](_0x102455);};}exports['index']=function(_0x2ffce0,_0x3d3c06){var _0xa7f759={},_0x56320d={},_0x1d37ca={'count':0x0,'rows':[]};var _0x573425=_[_0xde3f('0x2b')](db[_0xde3f('0x2c')][_0xde3f('0x2d')],function(_0x240fe9){return{'name':_0x240fe9['fieldName'],'type':_0x240fe9[_0xde3f('0x2e')][_0xde3f('0x2f')]};});_0x56320d[_0xde3f('0x30')]=_[_0xde3f('0x2b')](_0x573425,_0xde3f('0x31'));_0x56320d[_0xde3f('0x32')]=_['keys'](_0x2ffce0[_0xde3f('0x32')]);_0x56320d[_0xde3f('0x33')]=_[_0xde3f('0x34')](_0x56320d['model'],_0x56320d[_0xde3f('0x32')]);_0xa7f759[_0xde3f('0x35')]=_[_0xde3f('0x34')](_0x56320d[_0xde3f('0x30')],qs[_0xde3f('0x36')](_0x2ffce0[_0xde3f('0x32')][_0xde3f('0x36')]));_0xa7f759['attributes']=_0xa7f759[_0xde3f('0x35')][_0xde3f('0x37')]?_0xa7f759[_0xde3f('0x35')]:_0x56320d[_0xde3f('0x30')];if(!_0x2ffce0[_0xde3f('0x32')][_0xde3f('0x38')](_0xde3f('0x39'))){_0xa7f759[_0xde3f('0x1f')]=qs[_0xde3f('0x1f')](_0x2ffce0[_0xde3f('0x32')][_0xde3f('0x1f')]);_0xa7f759[_0xde3f('0x1e')]=qs[_0xde3f('0x1e')](_0x2ffce0[_0xde3f('0x32')][_0xde3f('0x1e')]);}_0xa7f759[_0xde3f('0x3a')]=qs[_0xde3f('0x3b')](_0x2ffce0['query'][_0xde3f('0x3b')]);_0xa7f759[_0xde3f('0x3c')]=qs[_0xde3f('0x33')](_['pick'](_0x2ffce0['query'],_0x56320d[_0xde3f('0x33')]),_0x573425);if(_0x2ffce0[_0xde3f('0x32')][_0xde3f('0x3d')]){_0xa7f759[_0xde3f('0x3c')]=_[_0xde3f('0x3e')](_0xa7f759[_0xde3f('0x3c')],{'$or':_[_0xde3f('0x2b')](_0x573425,function(_0x24a316){if(_0x24a316[_0xde3f('0x2e')]!==_0xde3f('0x3f')){var _0x1e91d7={};_0x1e91d7[_0x24a316[_0xde3f('0x31')]]={'$like':'%'+_0x2ffce0[_0xde3f('0x32')][_0xde3f('0x3d')]+'%'};return _0x1e91d7;}})});}_0xa7f759=_[_0xde3f('0x3e')]({},_0xa7f759,_0x2ffce0[_0xde3f('0x40')]);var _0x518c28={'where':_0xa7f759[_0xde3f('0x3c')]};return db['ServicenowAccount']['count'](_0x518c28)[_0xde3f('0x26')](function(_0x61b65b){_0x1d37ca['count']=_0x61b65b;if(_0x2ffce0['query'][_0xde3f('0x41')]){_0xa7f759[_0xde3f('0x42')]=[{'all':!![]}];}return db[_0xde3f('0x2c')][_0xde3f('0x43')](_0xa7f759);})[_0xde3f('0x26')](function(_0x1354b7){_0x1d37ca[_0xde3f('0x44')]=_0x1354b7;return _0x1d37ca;})[_0xde3f('0x26')](respondWithFilteredResult(_0x3d3c06,_0xa7f759))['catch'](handleError(_0x3d3c06,null));};exports[_0xde3f('0x45')]=function(_0x191c23,_0x271852){var _0x183b7b={'raw':![],'where':{'id':_0x191c23['params']['id']}},_0x4e239c={};_0x4e239c[_0xde3f('0x30')]=_['keys'](db[_0xde3f('0x2c')][_0xde3f('0x2d')]);_0x4e239c[_0xde3f('0x32')]=_[_0xde3f('0x46')](_0x191c23[_0xde3f('0x32')]);_0x4e239c[_0xde3f('0x33')]=_[_0xde3f('0x34')](_0x4e239c[_0xde3f('0x30')],_0x4e239c[_0xde3f('0x32')]);_0x183b7b[_0xde3f('0x35')]=_[_0xde3f('0x34')](_0x4e239c[_0xde3f('0x30')],qs[_0xde3f('0x36')](_0x191c23[_0xde3f('0x32')][_0xde3f('0x36')]));_0x183b7b['attributes']=_0x183b7b[_0xde3f('0x35')]['length']?_0x183b7b[_0xde3f('0x35')]:_0x4e239c['model'];if(_0x191c23['query'][_0xde3f('0x41')]){_0x183b7b[_0xde3f('0x42')]=[{'all':!![]}];}_0x183b7b=_[_0xde3f('0x3e')]({},_0x183b7b,_0x191c23[_0xde3f('0x40')]);return db[_0xde3f('0x2c')]['find'](_0x183b7b)['then'](handleEntityNotFound(_0x271852,null))['then'](respondWithResult(_0x271852,null))[_0xde3f('0x47')](handleError(_0x271852,null));};exports[_0xde3f('0x48')]=function(_0x303614,_0x35ef66){return db[_0xde3f('0x2c')][_0xde3f('0x48')](_0x303614[_0xde3f('0x49')],{})[_0xde3f('0x26')](respondWithResult(_0x35ef66,0xc9))[_0xde3f('0x47')](handleError(_0x35ef66,null));};exports[_0xde3f('0x4a')]=function(_0x37b5fa,_0x5a3eac){if(_0x37b5fa[_0xde3f('0x49')]['id']){delete _0x37b5fa['body']['id'];}return db[_0xde3f('0x2c')][_0xde3f('0x4b')]({'where':{'id':_0x37b5fa[_0xde3f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5a3eac,null))[_0xde3f('0x26')](saveUpdates(_0x37b5fa[_0xde3f('0x49')],null))[_0xde3f('0x26')](respondWithResult(_0x5a3eac,null))['catch'](handleError(_0x5a3eac,null));};exports['destroy']=function(_0xb99a4e,_0x12600c){return db[_0xde3f('0x2c')][_0xde3f('0x4b')]({'where':{'id':_0xb99a4e[_0xde3f('0x4c')]['id']}})[_0xde3f('0x26')](handleEntityNotFound(_0x12600c,null))[_0xde3f('0x26')](removeEntity(_0x12600c,null))[_0xde3f('0x47')](handleError(_0x12600c,null));};exports[_0xde3f('0x4d')]=function(_0x5abed3,_0x4df5b0,_0x438929){var _0x42f662={};var _0x3b0929={};var _0x246e61;var _0x4e4303;return db[_0xde3f('0x2c')][_0xde3f('0x4e')]({'where':{'id':_0x5abed3['params']['id']}})[_0xde3f('0x26')](handleEntityNotFound(_0x4df5b0,null))[_0xde3f('0x26')](function(_0xa2bc4c){if(_0xa2bc4c){_0x246e61=_0xa2bc4c;_0x3b0929[_0xde3f('0x30')]=_[_0xde3f('0x46')](db['ServicenowConfiguration']['rawAttributes']);_0x3b0929[_0xde3f('0x32')]=_[_0xde3f('0x46')](_0x5abed3[_0xde3f('0x32')]);_0x3b0929[_0xde3f('0x33')]=_[_0xde3f('0x34')](_0x3b0929[_0xde3f('0x30')],_0x3b0929[_0xde3f('0x32')]);_0x42f662[_0xde3f('0x35')]=_[_0xde3f('0x34')](_0x3b0929[_0xde3f('0x30')],qs[_0xde3f('0x36')](_0x5abed3[_0xde3f('0x32')]['fields']));_0x42f662[_0xde3f('0x35')]=_0x42f662[_0xde3f('0x35')][_0xde3f('0x37')]?_0x42f662[_0xde3f('0x35')]:_0x3b0929[_0xde3f('0x30')];_0x42f662[_0xde3f('0x3a')]=qs[_0xde3f('0x3b')](_0x5abed3[_0xde3f('0x32')][_0xde3f('0x3b')]);_0x42f662[_0xde3f('0x3c')]=qs[_0xde3f('0x33')](_[_0xde3f('0x4f')](_0x5abed3['query'],_0x3b0929[_0xde3f('0x33')]));if(_0x5abed3[_0xde3f('0x32')]['filter']){_0x42f662[_0xde3f('0x3c')]=_[_0xde3f('0x3e')](_0x42f662[_0xde3f('0x3c')],{'$or':_[_0xde3f('0x2b')](_0x42f662[_0xde3f('0x35')],function(_0x3c92fb){var _0x16ebe9={};_0x16ebe9[_0x3c92fb]={'$like':'%'+_0x5abed3['query'][_0xde3f('0x3d')]+'%'};return _0x16ebe9;})});}_0x42f662=_[_0xde3f('0x3e')]({},_0x42f662,_0x5abed3['options']);return _0x246e61['getConfigurations'](_0x42f662);}})[_0xde3f('0x26')](function(_0xd4b630){if(_0xd4b630){_0x4e4303=_0xd4b630[_0xde3f('0x37')];if(!_0x5abed3['query'][_0xde3f('0x38')](_0xde3f('0x39'))){_0x42f662[_0xde3f('0x1f')]=qs['limit'](_0x5abed3[_0xde3f('0x32')]['limit']);_0x42f662['offset']=qs[_0xde3f('0x1e')](_0x5abed3[_0xde3f('0x32')][_0xde3f('0x1e')]);}return _0x246e61['getConfigurations'](_0x42f662);}})[_0xde3f('0x26')](function(_0x58d745){if(_0x58d745){return _0x58d745?{'count':_0x4e4303,'rows':_0x58d745}:null;}})['then'](respondWithResult(_0x4df5b0,null))[_0xde3f('0x47')](handleError(_0x4df5b0,null));};exports[_0xde3f('0x50')]=function(_0x3c400b,_0x41f8b0,_0x29407b){if(_0x3c400b[_0xde3f('0x49')]['id']){delete _0x3c400b[_0xde3f('0x49')]['id'];}return db[_0xde3f('0x2c')][_0xde3f('0x4e')]({'where':{'id':_0x3c400b[_0xde3f('0x4c')]['id']}})[_0xde3f('0x26')](handleEntityNotFound(_0x41f8b0,null))[_0xde3f('0x26')](function(_0x49a085){if(_0x49a085){_0x3c400b[_0xde3f('0x49')]['AccountId']=_0x49a085['id'];_0x3c400b[_0xde3f('0x49')][_0xde3f('0x51')]=integrations[_0xde3f('0x52')](_0x3c400b[_0xde3f('0x49')][_0xde3f('0x53')],_0x3c400b[_0xde3f('0x49')]['type']);_0x3c400b['body'][_0xde3f('0x54')]=integrations['getDescriptions'](_0x3c400b[_0xde3f('0x49')]['channel'],_0x3c400b['body']['type']);return db[_0xde3f('0x55')][_0xde3f('0x48')](_0x3c400b[_0xde3f('0x49')],{'include':[{'model':db[_0xde3f('0x56')],'as':_0xde3f('0x51')},{'model':db[_0xde3f('0x56')],'as':_0xde3f('0x54')}]});}return null;})[_0xde3f('0x26')](respondWithResult(_0x41f8b0,null))['catch'](handleError(_0x41f8b0,null));};exports[_0xde3f('0x57')]=function(_0x1308ef,_0x640129,_0x2cabab){var _0x36dab1=[_0xde3f('0x58'),_0xde3f('0x59'),_0xde3f('0x5a'),'subcategory',_0xde3f('0x5b'),_0xde3f('0x5c'),_0xde3f('0x5d'),'severity',_0xde3f('0x5e')];var _0x44b87e=[_0xde3f('0x5f'),_0xde3f('0x58'),_0xde3f('0x60'),_0xde3f('0x61'),_0xde3f('0x62'),_0xde3f('0x63'),_0xde3f('0x64'),'hold_reason','approval_history',_0xde3f('0x65'),'resolved_by',_0xde3f('0x66'),_0xde3f('0x67'),_0xde3f('0x68'),_0xde3f('0x69'),_0xde3f('0x6a'),_0xde3f('0x6b'),_0xde3f('0x6c'),'knowledge',_0xde3f('0x3a'),_0xde3f('0x6d'),_0xde3f('0x6e'),_0xde3f('0x6f'),_0xde3f('0x70'),_0xde3f('0x71'),_0xde3f('0x72'),_0xde3f('0x73'),_0xde3f('0x74'),_0xde3f('0x75'),_0xde3f('0x76'),'rfc',_0xde3f('0x77'),_0xde3f('0x78'),'opened_at',_0xde3f('0x79'),_0xde3f('0x7a'),'work_end',_0xde3f('0x7b'),_0xde3f('0x7c'),_0xde3f('0x7d'),_0xde3f('0x7e'),_0xde3f('0x7f'),'work_notes',_0xde3f('0x80'),'close_code',_0xde3f('0x81'),_0xde3f('0x82'),_0xde3f('0x83'),_0xde3f('0x84'),_0xde3f('0x85'),_0xde3f('0x86'),'description',_0xde3f('0x87'),'notify',_0xde3f('0x88'),'close_notes',_0xde3f('0x89'),_0xde3f('0x8a'),_0xde3f('0x8b'),_0xde3f('0x8c'),_0xde3f('0x8d'),_0xde3f('0x8e'),_0xde3f('0x5d'),_0xde3f('0x8f'),_0xde3f('0x90'),_0xde3f('0x91'),_0xde3f('0x92'),_0xde3f('0x93'),_0xde3f('0x94'),'severity',_0xde3f('0x95'),_0xde3f('0x96'),_0xde3f('0x97'),_0xde3f('0x98'),_0xde3f('0x99'),_0xde3f('0x9a'),_0xde3f('0x9b'),_0xde3f('0x9c'),_0xde3f('0x9d'),'upon_approval',_0xde3f('0x9e'),'location',_0xde3f('0x5e')];var _0x2f2949='';var _0x12c707='';var _0x55a314=[];var _0x29e8c5='';var _0x219717='';var _0x2f406a=[];var _0x1f4264='';var _0x586de3='';var _0x5c0ccb={};var _0x5a45b0='';return db[_0xde3f('0x2c')][_0xde3f('0x4e')]({'where':{'id':_0x1308ef['params']['id']},'attributes':['id',_0xde3f('0x9f'),'password','email',_0xde3f('0xa0'),_0xde3f('0xa1')]})[_0xde3f('0x26')](handleEntityNotFound(_0x640129,null))[_0xde3f('0x26')](function(_0x349b01){if(_0x349b01){_0x5a45b0=_0x349b01[_0xde3f('0xa0')];var _0x5b0a19=_0x5a45b0[_0xde3f('0xa2')](-0x1);if(_0x5b0a19==='/'){_0x5a45b0=_0x5a45b0[_0xde3f('0xa3')](0x0,_0x5a45b0[_0xde3f('0xa4')](_0x5b0a19));}_0x586de3=util[_0xde3f('0xa5')]('%s/api/now/doc/table/schema/',_0x5a45b0);_0x1f4264=util[_0xde3f('0xa5')]('%s/api/now/table/',_0x5a45b0);_0x5c0ccb={'user':_0x349b01[_0xde3f('0x9f')],'pass':_0x349b01[_0xde3f('0xa6')]};var _0x117dd3={'method':_0xde3f('0xa7'),'uri':_0x586de3+_0xde3f('0xa8'),'auth':_0x5c0ccb,'json':!![]};return rp(_0x117dd3);}})['then'](function(_0x322134){if(_0x322134['result'][_0xde3f('0x37')]>0x0){_0x2f2949=_0x322134[_0xde3f('0xa9')];}console[_0xde3f('0xaa')]('incident\x20table\x20objects',_0x2f2949);_0x2f406a=[];_0x12c707=Object[_0xde3f('0xab')]([],_0x2f2949);_['remove'](_0x12c707,function(_0x5c6644){return!_0x36dab1[_0xde3f('0xac')](_0x5c6644[_0xde3f('0x31')]);});_0x12c707['forEach'](function(_0x4f1335){var _0xbf5156=createFieldObject(_0x1f4264,_0x5c0ccb,_0x4f1335[_0xde3f('0xad')],_0x4f1335[_0xde3f('0x31')],_0x4f1335[_0xde3f('0xae')],![]);_0x2f406a[_0xde3f('0xaf')](_0xbf5156);});return Promise[_0xde3f('0xb0')](_0x2f406a);})[_0xde3f('0x26')](function(_0x29d387){_0x55a314=_0x29d387;_0x29e8c5=Object[_0xde3f('0xab')]([],_0x2f2949);console[_0xde3f('0xaa')](_0xde3f('0xb1'),_0x2f2949);_['remove'](_0x29e8c5,function(_0x4458f9){return _0x44b87e[_0xde3f('0xac')](_0x4458f9[_0xde3f('0x31')]);});console['log'](_0xde3f('0xb2'),_0x29e8c5);_0x2f406a=[];_0x29e8c5['forEach'](function(_0x22fa32){var _0x4b5197=createFieldObject(_0x1f4264,_0x5c0ccb,_0x22fa32[_0xde3f('0xad')],_0x22fa32[_0xde3f('0x31')],_0x22fa32['label'],!![]);_0x2f406a['push'](_0x4b5197);});return Promise[_0xde3f('0xb0')](_0x2f406a);})[_0xde3f('0x26')](function(_0x156668){_0x219717=_0x156668;var _0x50170a=_0x55a314[_0xde3f('0xb3')](_0x219717);return{'count':_0x50170a[_0xde3f('0x37')],'rows':_0x50170a};})[_0xde3f('0x26')](respondWithResult(_0x640129,null))[_0xde3f('0x47')](function(_0x1b7099){console[_0xde3f('0xaa')](_0xde3f('0xb4')+_0x1b7099);var _0x594630=_0x1308ef['query'][_0xde3f('0xb5')]?0x1f4:_0x1b7099[_0xde3f('0xb6')]||0x1f4;logger[_0xde3f('0x28')](_0x1b7099['stack']);delete _0x1b7099['name'];if(_0x594630===0x191){_0x594630=0x190;}_0x640129['status'](_0x594630)['send'](_0x1308ef[_0xde3f('0x32')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x1b7099[_0xde3f('0xb6')]}:_0x1b7099);});};function createFieldObject(_0x53be28,_0x2b7788,_0x4a7aaa,_0xf1c679,_0xab0480,_0x1e77bb){return new Promise(function(_0x42b1d2,_0x43d91b){var _0x5e7abf={'id':_0xf1c679,'name':_0xab0480,'custom':_0x1e77bb};if(_0x4a7aaa===_0xde3f('0xb7')){_0x5e7abf[_0xde3f('0x40')]=[{'name':_0xde3f('0xb8'),'value':_0xde3f('0xb9')},{'name':_0xde3f('0xba'),'value':_0xde3f('0xbb')}];_0x42b1d2(_0x5e7abf);}else{var _0x46334a={'method':_0xde3f('0xa7'),'uri':_0x53be28+'sys_choice?sysparm_query=name=incident^element='+_0xf1c679,'auth':_0x2b7788,'json':!![]};return rp(_0x46334a)[_0xde3f('0x26')](function(_0x2d01d1){var _0x2d7c4f=[];if(_0x2d01d1[_0xde3f('0xa9')][_0xde3f('0x37')]>0x0){_0x2d01d1[_0xde3f('0xa9')]['forEach'](function(_0x5ed258){if(_0x5ed258['inactive']===_0xde3f('0xbb')){var _0x1a1b15={'name':_0x5ed258[_0xde3f('0xae')],'value':_0x5ed258['value']};_0x2d7c4f[_0xde3f('0xaf')](_0x1a1b15);}});}_0x5e7abf[_0xde3f('0x40')]=_0x2d7c4f;if(_0x5e7abf[_0xde3f('0x40')][_0xde3f('0x37')]>0x0){_0x42b1d2(_0x5e7abf);}else{if(_0x1e77bb==![]){_0x42b1d2();}else{_0x42b1d2(_0x5e7abf);}}});}});} \ No newline at end of file +var _0x9c78=['closed_by','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','location','password','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','username','GET','result','log','incident\x20table\x20objects','assign','remove','includes','internalType','label','push','all','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','statusCode','stack','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','save','update','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ServicenowAccount','include','findAll','catch','show','params','options','find','create','body','getConfigurations','findOne','AccountId','getSubjects','channel','getDescriptions','ServicenowConfiguration','Subjects','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','watch_list','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','approval_set','work_notes','short_description','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration'];(function(_0x3c43f6,_0x429058){var _0x5677a4=function(_0x13b06b){while(--_0x13b06b){_0x3c43f6['push'](_0x3c43f6['shift']());}};_0x5677a4(++_0x429058);}(_0x9c78,0x191));var _0x89c7=function(_0x3018bb,_0x52f29a){_0x3018bb=_0x3018bb-0x0;var _0x5cd2e4=_0x9c78[_0x3018bb];return _0x5cd2e4;};'use strict';var emlformat=require(_0x89c7('0x0'));var rimraf=require(_0x89c7('0x1'));var zipdir=require(_0x89c7('0x2'));var jsonpatch=require(_0x89c7('0x3'));var rp=require('request-promise');var moment=require(_0x89c7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x89c7('0x5'));var util=require('util');var path=require('path');var sox=require(_0x89c7('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x89c7('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x89c7('0x8'));var jsforce=require(_0x89c7('0x9'));var deskjs=require(_0x89c7('0xa'));var toCsv=require(_0x89c7('0xb'));var querystring=require(_0x89c7('0xc'));var Papa=require(_0x89c7('0xd'));var Redis=require(_0x89c7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x89c7('0xf'));var as=require(_0x89c7('0x10'));var hardwareService=require(_0x89c7('0x11'));var logger=require('../../config/logger')(_0x89c7('0x12'));var utils=require(_0x89c7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x89c7('0x14'));var db=require(_0x89c7('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x14f732,_0x7119d1){_0x7119d1=_0x7119d1||0xcc;return function(_0x206d41){if(_0x206d41){return _0x14f732[_0x89c7('0x16')](_0x7119d1);}return _0x14f732[_0x89c7('0x17')](_0x7119d1)[_0x89c7('0x18')]();};}function respondWithResult(_0x460e87,_0xb86965){_0xb86965=_0xb86965||0xc8;return function(_0x6c26c2){if(_0x6c26c2){return _0x460e87[_0x89c7('0x17')](_0xb86965)['json'](_0x6c26c2);}};}function respondWithFilteredResult(_0x5b0f73,_0x20b1e3){return function(_0x251bec){if(_0x251bec){var _0xb70d07=typeof _0x20b1e3[_0x89c7('0x19')]===_0x89c7('0x1a')&&typeof _0x20b1e3[_0x89c7('0x1b')]==='undefined';var _0x4d2916=_0x251bec[_0x89c7('0x1c')];var _0x95a488=_0xb70d07?0x0:_0x20b1e3[_0x89c7('0x19')];var _0x5068b4=_0xb70d07?_0x251bec[_0x89c7('0x1c')]:_0x20b1e3[_0x89c7('0x19')]+_0x20b1e3[_0x89c7('0x1b')];var _0x344fee;if(_0x5068b4>=_0x4d2916){_0x5068b4=_0x4d2916;_0x344fee=0xc8;}else{_0x344fee=0xce;}_0x5b0f73[_0x89c7('0x17')](_0x344fee);return _0x5b0f73['set']('Content-Range',_0x95a488+'-'+_0x5068b4+'/'+_0x4d2916)['json'](_0x251bec);}return null;};}function patchUpdates(_0x3b806d){return function(_0x27bd85){try{jsonpatch['apply'](_0x27bd85,_0x3b806d,!![]);}catch(_0x2942ac){return BPromise['reject'](_0x2942ac);}return _0x27bd85[_0x89c7('0x1d')]();};}function saveUpdates(_0x20f42c,_0x5b2e07){return function(_0x17398f){if(_0x17398f){return _0x17398f[_0x89c7('0x1e')](_0x20f42c)[_0x89c7('0x1f')](function(_0x109b72){return _0x109b72;});}return null;};}function removeEntity(_0x5c30d9,_0x57bc59){return function(_0x56a7d8){if(_0x56a7d8){return _0x56a7d8[_0x89c7('0x20')]()[_0x89c7('0x1f')](function(){_0x5c30d9[_0x89c7('0x17')](0xcc)[_0x89c7('0x18')]();});}};}function handleEntityNotFound(_0x3b8cdb,_0x46ef8a){return function(_0x273f66){if(!_0x273f66){_0x3b8cdb[_0x89c7('0x16')](0x194);}return _0x273f66;};}function handleError(_0x3955b4,_0x5710aa){_0x5710aa=_0x5710aa||0x1f4;return function(_0x54a456){logger[_0x89c7('0x21')](_0x54a456['stack']);if(_0x54a456[_0x89c7('0x22')]){delete _0x54a456[_0x89c7('0x22')];}_0x3955b4[_0x89c7('0x17')](_0x5710aa)[_0x89c7('0x23')](_0x54a456);};}exports['index']=function(_0xb99dc4,_0x50c053){var _0x21214a={},_0x24e3a5={},_0x3d4056={'count':0x0,'rows':[]};var _0x31c5b7=_[_0x89c7('0x24')](db['ServicenowAccount'][_0x89c7('0x25')],function(_0x18fc02){return{'name':_0x18fc02[_0x89c7('0x26')],'type':_0x18fc02[_0x89c7('0x27')][_0x89c7('0x28')]};});_0x24e3a5['model']=_[_0x89c7('0x24')](_0x31c5b7,_0x89c7('0x22'));_0x24e3a5[_0x89c7('0x29')]=_[_0x89c7('0x2a')](_0xb99dc4['query']);_0x24e3a5[_0x89c7('0x2b')]=_[_0x89c7('0x2c')](_0x24e3a5[_0x89c7('0x2d')],_0x24e3a5[_0x89c7('0x29')]);_0x21214a[_0x89c7('0x2e')]=_['intersection'](_0x24e3a5[_0x89c7('0x2d')],qs['fields'](_0xb99dc4[_0x89c7('0x29')][_0x89c7('0x2f')]));_0x21214a[_0x89c7('0x2e')]=_0x21214a[_0x89c7('0x2e')][_0x89c7('0x30')]?_0x21214a[_0x89c7('0x2e')]:_0x24e3a5[_0x89c7('0x2d')];if(!_0xb99dc4[_0x89c7('0x29')][_0x89c7('0x31')](_0x89c7('0x32'))){_0x21214a[_0x89c7('0x1b')]=qs['limit'](_0xb99dc4[_0x89c7('0x29')][_0x89c7('0x1b')]);_0x21214a[_0x89c7('0x19')]=qs[_0x89c7('0x19')](_0xb99dc4[_0x89c7('0x29')][_0x89c7('0x19')]);}_0x21214a[_0x89c7('0x33')]=qs[_0x89c7('0x34')](_0xb99dc4[_0x89c7('0x29')][_0x89c7('0x34')]);_0x21214a[_0x89c7('0x35')]=qs[_0x89c7('0x2b')](_[_0x89c7('0x36')](_0xb99dc4[_0x89c7('0x29')],_0x24e3a5['filters']),_0x31c5b7);if(_0xb99dc4[_0x89c7('0x29')][_0x89c7('0x37')]){_0x21214a[_0x89c7('0x35')]=_[_0x89c7('0x38')](_0x21214a[_0x89c7('0x35')],{'$or':_[_0x89c7('0x24')](_0x31c5b7,function(_0xf12ae8){if(_0xf12ae8[_0x89c7('0x27')]!==_0x89c7('0x39')){var _0x42cc9c={};_0x42cc9c[_0xf12ae8[_0x89c7('0x22')]]={'$like':'%'+_0xb99dc4[_0x89c7('0x29')][_0x89c7('0x37')]+'%'};return _0x42cc9c;}})});}_0x21214a=_[_0x89c7('0x38')]({},_0x21214a,_0xb99dc4['options']);var _0x267c92={'where':_0x21214a['where']};return db[_0x89c7('0x3a')][_0x89c7('0x1c')](_0x267c92)[_0x89c7('0x1f')](function(_0x5851db){_0x3d4056[_0x89c7('0x1c')]=_0x5851db;if(_0xb99dc4['query']['includeAll']){_0x21214a[_0x89c7('0x3b')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x89c7('0x3c')](_0x21214a);})[_0x89c7('0x1f')](function(_0x4737f9){_0x3d4056['rows']=_0x4737f9;return _0x3d4056;})[_0x89c7('0x1f')](respondWithFilteredResult(_0x50c053,_0x21214a))[_0x89c7('0x3d')](handleError(_0x50c053,null));};exports[_0x89c7('0x3e')]=function(_0x5bc5ba,_0x214224){var _0x9c09ea={'raw':![],'where':{'id':_0x5bc5ba[_0x89c7('0x3f')]['id']}},_0x3052bf={};_0x3052bf[_0x89c7('0x2d')]=_[_0x89c7('0x2a')](db[_0x89c7('0x3a')][_0x89c7('0x25')]);_0x3052bf[_0x89c7('0x29')]=_['keys'](_0x5bc5ba['query']);_0x3052bf[_0x89c7('0x2b')]=_[_0x89c7('0x2c')](_0x3052bf[_0x89c7('0x2d')],_0x3052bf[_0x89c7('0x29')]);_0x9c09ea[_0x89c7('0x2e')]=_[_0x89c7('0x2c')](_0x3052bf['model'],qs[_0x89c7('0x2f')](_0x5bc5ba[_0x89c7('0x29')][_0x89c7('0x2f')]));_0x9c09ea[_0x89c7('0x2e')]=_0x9c09ea[_0x89c7('0x2e')]['length']?_0x9c09ea['attributes']:_0x3052bf[_0x89c7('0x2d')];if(_0x5bc5ba[_0x89c7('0x29')]['includeAll']){_0x9c09ea['include']=[{'all':!![]}];}_0x9c09ea=_[_0x89c7('0x38')]({},_0x9c09ea,_0x5bc5ba[_0x89c7('0x40')]);return db[_0x89c7('0x3a')][_0x89c7('0x41')](_0x9c09ea)[_0x89c7('0x1f')](handleEntityNotFound(_0x214224,null))['then'](respondWithResult(_0x214224,null))['catch'](handleError(_0x214224,null));};exports[_0x89c7('0x42')]=function(_0x56120e,_0x116e7b){return db[_0x89c7('0x3a')][_0x89c7('0x42')](_0x56120e[_0x89c7('0x43')],{})[_0x89c7('0x1f')](respondWithResult(_0x116e7b,0xc9))[_0x89c7('0x3d')](handleError(_0x116e7b,null));};exports[_0x89c7('0x1e')]=function(_0x1f08ff,_0x4338fc){if(_0x1f08ff[_0x89c7('0x43')]['id']){delete _0x1f08ff[_0x89c7('0x43')]['id'];}return db[_0x89c7('0x3a')][_0x89c7('0x41')]({'where':{'id':_0x1f08ff['params']['id']}})[_0x89c7('0x1f')](handleEntityNotFound(_0x4338fc,null))['then'](saveUpdates(_0x1f08ff['body'],null))[_0x89c7('0x1f')](respondWithResult(_0x4338fc,null))[_0x89c7('0x3d')](handleError(_0x4338fc,null));};exports[_0x89c7('0x20')]=function(_0x10d13b,_0x1bda0d){return db['ServicenowAccount'][_0x89c7('0x41')]({'where':{'id':_0x10d13b[_0x89c7('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1bda0d,null))[_0x89c7('0x1f')](removeEntity(_0x1bda0d,null))[_0x89c7('0x3d')](handleError(_0x1bda0d,null));};exports[_0x89c7('0x44')]=function(_0x256038,_0x198ed6,_0x2a72fd){var _0x34687f={};var _0xa5ed48={};var _0x16477e;var _0x4acd80;return db[_0x89c7('0x3a')][_0x89c7('0x45')]({'where':{'id':_0x256038[_0x89c7('0x3f')]['id']}})[_0x89c7('0x1f')](handleEntityNotFound(_0x198ed6,null))[_0x89c7('0x1f')](function(_0x4c7180){if(_0x4c7180){_0x16477e=_0x4c7180;_0xa5ed48[_0x89c7('0x2d')]=_['keys'](db['ServicenowConfiguration']['rawAttributes']);_0xa5ed48[_0x89c7('0x29')]=_[_0x89c7('0x2a')](_0x256038[_0x89c7('0x29')]);_0xa5ed48[_0x89c7('0x2b')]=_[_0x89c7('0x2c')](_0xa5ed48[_0x89c7('0x2d')],_0xa5ed48[_0x89c7('0x29')]);_0x34687f[_0x89c7('0x2e')]=_[_0x89c7('0x2c')](_0xa5ed48[_0x89c7('0x2d')],qs[_0x89c7('0x2f')](_0x256038[_0x89c7('0x29')][_0x89c7('0x2f')]));_0x34687f[_0x89c7('0x2e')]=_0x34687f[_0x89c7('0x2e')][_0x89c7('0x30')]?_0x34687f['attributes']:_0xa5ed48[_0x89c7('0x2d')];_0x34687f[_0x89c7('0x33')]=qs[_0x89c7('0x34')](_0x256038[_0x89c7('0x29')][_0x89c7('0x34')]);_0x34687f[_0x89c7('0x35')]=qs[_0x89c7('0x2b')](_['pick'](_0x256038[_0x89c7('0x29')],_0xa5ed48[_0x89c7('0x2b')]));if(_0x256038[_0x89c7('0x29')][_0x89c7('0x37')]){_0x34687f[_0x89c7('0x35')]=_[_0x89c7('0x38')](_0x34687f[_0x89c7('0x35')],{'$or':_[_0x89c7('0x24')](_0x34687f[_0x89c7('0x2e')],function(_0x4a4bb2){var _0xf72cc9={};_0xf72cc9[_0x4a4bb2]={'$like':'%'+_0x256038['query'][_0x89c7('0x37')]+'%'};return _0xf72cc9;})});}_0x34687f=_[_0x89c7('0x38')]({},_0x34687f,_0x256038['options']);return _0x16477e[_0x89c7('0x44')](_0x34687f);}})[_0x89c7('0x1f')](function(_0xc1b2c5){if(_0xc1b2c5){_0x4acd80=_0xc1b2c5[_0x89c7('0x30')];if(!_0x256038['query'][_0x89c7('0x31')](_0x89c7('0x32'))){_0x34687f[_0x89c7('0x1b')]=qs[_0x89c7('0x1b')](_0x256038[_0x89c7('0x29')][_0x89c7('0x1b')]);_0x34687f['offset']=qs[_0x89c7('0x19')](_0x256038[_0x89c7('0x29')][_0x89c7('0x19')]);}return _0x16477e[_0x89c7('0x44')](_0x34687f);}})[_0x89c7('0x1f')](function(_0x4e8b2d){if(_0x4e8b2d){return _0x4e8b2d?{'count':_0x4acd80,'rows':_0x4e8b2d}:null;}})[_0x89c7('0x1f')](respondWithResult(_0x198ed6,null))[_0x89c7('0x3d')](handleError(_0x198ed6,null));};exports['addConfiguration']=function(_0x5c7405,_0x37b6ce,_0x49571c){if(_0x5c7405[_0x89c7('0x43')]['id']){delete _0x5c7405[_0x89c7('0x43')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x5c7405[_0x89c7('0x3f')]['id']}})[_0x89c7('0x1f')](handleEntityNotFound(_0x37b6ce,null))[_0x89c7('0x1f')](function(_0x102ac2){if(_0x102ac2){_0x5c7405[_0x89c7('0x43')][_0x89c7('0x46')]=_0x102ac2['id'];_0x5c7405['body']['Subjects']=integrations[_0x89c7('0x47')](_0x5c7405[_0x89c7('0x43')][_0x89c7('0x48')],_0x5c7405['body'][_0x89c7('0x27')]);_0x5c7405[_0x89c7('0x43')]['Descriptions']=integrations[_0x89c7('0x49')](_0x5c7405[_0x89c7('0x43')]['channel'],_0x5c7405[_0x89c7('0x43')]['type']);return db[_0x89c7('0x4a')][_0x89c7('0x42')](_0x5c7405['body'],{'include':[{'model':db['ServicenowField'],'as':_0x89c7('0x4b')},{'model':db[_0x89c7('0x4c')],'as':'Descriptions'}]});}return null;})[_0x89c7('0x1f')](respondWithResult(_0x37b6ce,null))[_0x89c7('0x3d')](handleError(_0x37b6ce,null));};exports[_0x89c7('0x4d')]=function(_0x4f39b0,_0x293902,_0x633f72){var _0x16f76a=[_0x89c7('0x4e'),_0x89c7('0x4f'),_0x89c7('0x50'),_0x89c7('0x51'),_0x89c7('0x52'),_0x89c7('0x53'),_0x89c7('0x54'),_0x89c7('0x55'),_0x89c7('0x56')];var _0x1c521b=['parent',_0x89c7('0x4e'),'caused_by',_0x89c7('0x57'),'upon_reject',_0x89c7('0x58'),_0x89c7('0x59'),'hold_reason',_0x89c7('0x5a'),_0x89c7('0x5b'),_0x89c7('0x5c'),'sys_updated_by',_0x89c7('0x5d'),_0x89c7('0x5e'),'sys_created_on',_0x89c7('0x5f'),_0x89c7('0x60'),_0x89c7('0x61'),_0x89c7('0x50'),_0x89c7('0x33'),_0x89c7('0x62'),'closed_at','cmdb_ci',_0x89c7('0x63'),_0x89c7('0x64'),_0x89c7('0x65'),_0x89c7('0x66'),'business_service',_0x89c7('0x67'),_0x89c7('0x68'),_0x89c7('0x69'),_0x89c7('0x6a'),_0x89c7('0x6b'),_0x89c7('0x6c'),_0x89c7('0x6d'),_0x89c7('0x6e'),_0x89c7('0x6f'),_0x89c7('0x70'),_0x89c7('0x71'),'caller_id',_0x89c7('0x72'),_0x89c7('0x51'),_0x89c7('0x73'),_0x89c7('0x74'),'close_code','correlation_display',_0x89c7('0x75'),_0x89c7('0x76'),_0x89c7('0x77'),_0x89c7('0x78'),_0x89c7('0x79'),_0x89c7('0x7a'),_0x89c7('0x7b'),_0x89c7('0x53'),'sys_class_name','close_notes',_0x89c7('0x7c'),'follow_up',_0x89c7('0x7d'),_0x89c7('0x7e'),_0x89c7('0x7f'),'reopened_by',_0x89c7('0x54'),_0x89c7('0x80'),_0x89c7('0x81'),_0x89c7('0x82'),_0x89c7('0x83'),'activity_due','assigned_to','severity',_0x89c7('0x84'),'sla_due',_0x89c7('0x85'),_0x89c7('0x86'),_0x89c7('0x87'),_0x89c7('0x88'),_0x89c7('0x89'),'sys_tags',_0x89c7('0x8a'),_0x89c7('0x8b'),_0x89c7('0x8c'),_0x89c7('0x8d'),'category'];var _0x47a03b='';var _0x1c7aee='';var _0x994939=[];var _0x1f7add='';var _0xb67dd4='';var _0x25d0ef=[];var _0x6003ef='';var _0x257ff='';var _0x53e2aa={};var _0x1184d1='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x4f39b0['params']['id']},'attributes':['id','username',_0x89c7('0x8e'),_0x89c7('0x8f'),'remoteUri','serverUrl']})[_0x89c7('0x1f')](handleEntityNotFound(_0x293902,null))[_0x89c7('0x1f')](function(_0x43f5b7){if(_0x43f5b7){_0x1184d1=_0x43f5b7[_0x89c7('0x90')];var _0x382719=_0x1184d1[_0x89c7('0x91')](-0x1);if(_0x382719==='/'){_0x1184d1=_0x1184d1[_0x89c7('0x92')](0x0,_0x1184d1[_0x89c7('0x93')](_0x382719));}_0x257ff=util[_0x89c7('0x94')](_0x89c7('0x95'),_0x1184d1);_0x6003ef=util[_0x89c7('0x94')]('%s/api/now/table/',_0x1184d1);_0x53e2aa={'user':_0x43f5b7[_0x89c7('0x96')],'pass':_0x43f5b7[_0x89c7('0x8e')]};var _0x263631={'method':_0x89c7('0x97'),'uri':_0x257ff+'incident?sysparm_display_value=all','auth':_0x53e2aa,'json':!![]};return rp(_0x263631);}})[_0x89c7('0x1f')](function(_0x5292cb){if(_0x5292cb[_0x89c7('0x98')][_0x89c7('0x30')]>0x0){_0x47a03b=_0x5292cb[_0x89c7('0x98')];}console[_0x89c7('0x99')](_0x89c7('0x9a'),_0x47a03b);_0x25d0ef=[];_0x1c7aee=Object[_0x89c7('0x9b')]([],_0x47a03b);_[_0x89c7('0x9c')](_0x1c7aee,function(_0x2d1fec){return!_0x16f76a[_0x89c7('0x9d')](_0x2d1fec[_0x89c7('0x22')]);});_0x1c7aee['forEach'](function(_0x3f0133){var _0x560b7c=createFieldObject(_0x6003ef,_0x53e2aa,_0x3f0133[_0x89c7('0x9e')],_0x3f0133['name'],_0x3f0133[_0x89c7('0x9f')],![]);_0x25d0ef[_0x89c7('0xa0')](_0x560b7c);});return Promise[_0x89c7('0xa1')](_0x25d0ef);})[_0x89c7('0x1f')](function(_0x3ad2f1){_0x994939=_0x3ad2f1;_0x1f7add=Object['assign']([],_0x47a03b);console['log']('TCL:\x20_object',_0x47a03b);_[_0x89c7('0x9c')](_0x1f7add,function(_0xb68c3b){return _0x1c521b[_0x89c7('0x9d')](_0xb68c3b['name']);});console['log'](_0x89c7('0xa2'),_0x1f7add);_0x25d0ef=[];_0x1f7add[_0x89c7('0xa3')](function(_0x299d5d){var _0x387e2b=createFieldObject(_0x6003ef,_0x53e2aa,_0x299d5d['internalType'],_0x299d5d[_0x89c7('0x22')],_0x299d5d['label'],!![]);_0x25d0ef[_0x89c7('0xa0')](_0x387e2b);});return Promise[_0x89c7('0xa1')](_0x25d0ef);})[_0x89c7('0x1f')](function(_0x542c39){_0xb67dd4=_0x542c39;var _0x1120b9=_0x994939['concat'](_0xb67dd4);return{'count':_0x1120b9[_0x89c7('0x30')],'rows':_0x1120b9};})[_0x89c7('0x1f')](respondWithResult(_0x293902,null))[_0x89c7('0x3d')](function(_0x19da36){console[_0x89c7('0x99')]('ServiceNow\x20error:\x20'+_0x19da36);var _0x5ddbf6=_0x4f39b0['query']['test']?0x1f4:_0x19da36[_0x89c7('0xa4')]||0x1f4;logger[_0x89c7('0x21')](_0x19da36[_0x89c7('0xa5')]);delete _0x19da36[_0x89c7('0x22')];if(_0x5ddbf6===0x191){_0x5ddbf6=0x190;}_0x293902['status'](_0x5ddbf6)[_0x89c7('0x23')](_0x4f39b0[_0x89c7('0x29')]['test']?{'message':_0x89c7('0xa6'),'statusCode':_0x19da36[_0x89c7('0xa4')]}:_0x19da36);});};function createFieldObject(_0x491a92,_0x4316b8,_0x48aa7e,_0x51d1cb,_0x395eb2,_0x1bc40c){return new Promise(function(_0x568e58,_0x23a5bb){var _0x28108e={'id':_0x51d1cb,'name':_0x395eb2,'custom':_0x1bc40c};if(_0x48aa7e===_0x89c7('0xa7')){_0x28108e[_0x89c7('0x40')]=[{'name':_0x89c7('0xa8'),'value':_0x89c7('0xa9')},{'name':_0x89c7('0xaa'),'value':_0x89c7('0xab')}];_0x568e58(_0x28108e);}else{var _0x27c789={'method':_0x89c7('0x97'),'uri':_0x491a92+_0x89c7('0xac')+_0x51d1cb,'auth':_0x4316b8,'json':!![]};return rp(_0x27c789)[_0x89c7('0x1f')](function(_0x884f37){var _0x463811=[];if(_0x884f37[_0x89c7('0x98')][_0x89c7('0x30')]>0x0){_0x884f37[_0x89c7('0x98')][_0x89c7('0xa3')](function(_0x55b1b1){if(_0x55b1b1[_0x89c7('0xad')]===_0x89c7('0xab')){var _0x56532f={'name':_0x55b1b1['label'],'value':_0x55b1b1[_0x89c7('0xae')]};_0x463811['push'](_0x56532f);}});}_0x28108e[_0x89c7('0x40')]=_0x463811;if(_0x28108e[_0x89c7('0x40')][_0x89c7('0x30')]>0x0){_0x568e58(_0x28108e);}else{if(_0x1bc40c==![]){_0x568e58();}else{_0x568e58(_0x28108e);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index a68fb98..b295c39 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 _0x3f8a=['exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x35b558,_0xeb7d5c){_0x35b558=_0x35b558-0x0;var _0x481909=_0x3f8a[_0x35b558];return _0x481909;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var logger=require(_0xa3f8('0x2'))(_0xa3f8('0x3'));var moment=require('moment');var BPromise=require(_0xa3f8('0x4'));var rp=require(_0xa3f8('0x5'));var fs=require('fs');var path=require(_0xa3f8('0x6'));var rimraf=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var attributes=require(_0xa3f8('0x9'));var integrations=require(_0xa3f8('0xa'));module[_0xa3f8('0xb')]=function(_0x1f160a,_0xf895d9){return _0x1f160a[_0xa3f8('0xc')](_0xa3f8('0xd'),attributes,{'tableName':_0xa3f8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd51=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1d8f42,_0x246a11){var _0x31d7b3=function(_0x266690){while(--_0x266690){_0x1d8f42['push'](_0x1d8f42['shift']());}};_0x31d7b3(++_0x246a11);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x17bc32,_0x18b186){_0x17bc32=_0x17bc32-0x0;var _0x4b74f4=_0xbd51[_0x17bc32];return _0x4b74f4;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('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(_0x1bd5('0x5'));var integrations=require(_0x1bd5('0x6'));module[_0x1bd5('0x7')]=function(_0x59ddfb,_0x29abea){return _0x59ddfb[_0x1bd5('0x8')](_0x1bd5('0x9'),attributes,{'tableName':_0x1bd5('0xa'),'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 45e1d12..7fd905f 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 _0x4316=['limit','map','include','model','debug','ShowServicenowAccount','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','attributes'];(function(_0x37a505,_0x319129){var _0x5d094e=function(_0x5b78ea){while(--_0x5b78ea){_0x37a505['push'](_0x37a505['shift']());}};_0x5d094e(++_0x319129);}(_0x4316,0x194));var _0x6431=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4316[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x6431('0x0'));var moment=require(_0x6431('0x1'));var BPromise=require(_0x6431('0x2'));var rs=require(_0x6431('0x3'));var fs=require('fs');var Redis=require(_0x6431('0x4'));var db=require(_0x6431('0x5'))['db'];var utils=require(_0x6431('0x6'));var logger=require(_0x6431('0x7'))(_0x6431('0x8'));var config=require(_0x6431('0x9'));var jayson=require(_0x6431('0xa'));var client=jayson[_0x6431('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29b924,_0x3b2e8d,_0x13b446){return new BPromise(function(_0x300f0d,_0x168a4b){return client[_0x6431('0xc')](_0x29b924,_0x13b446)[_0x6431('0xd')](function(_0x5bd31c){logger[_0x6431('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x3b2e8d,_0x6431('0xf'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x3b2e8d,'request\x20sent',JSON[_0x6431('0x10')](_0x5bd31c));if(_0x5bd31c[_0x6431('0x11')]){if(_0x5bd31c['error'][_0x6431('0x12')]===0x1f4){logger[_0x6431('0x11')](_0x6431('0x13'),_0x3b2e8d,_0x5bd31c['error'][_0x6431('0x14')]);return _0x168a4b(_0x5bd31c['error']['message']);}logger[_0x6431('0x11')](_0x6431('0x13'),_0x3b2e8d,_0x5bd31c[_0x6431('0x11')][_0x6431('0x14')]);return _0x300f0d(_0x5bd31c[_0x6431('0x11')][_0x6431('0x14')]);}else{logger[_0x6431('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x3b2e8d,'request\x20sent');_0x300f0d(_0x5bd31c[_0x6431('0x15')][_0x6431('0x14')]);}})[_0x6431('0x16')](function(_0x13557a){logger[_0x6431('0x11')](_0x6431('0x13'),_0x3b2e8d,_0x13557a);_0x168a4b(_0x13557a);});});}exports[_0x6431('0x17')]=function(_0x1a25ab){var _0x290753=this;return new Promise(function(_0x386cf7,_0x35baa6){return db[_0x6431('0x18')]['findAll']({'raw':_0x1a25ab[_0x6431('0x19')]?_0x1a25ab[_0x6431('0x19')][_0x6431('0x1a')]===undefined?!![]:![]:!![],'where':_0x1a25ab[_0x6431('0x19')]?_0x1a25ab[_0x6431('0x19')]['where']||null:null,'attributes':_0x1a25ab['options']?_0x1a25ab['options'][_0x6431('0x1b')]||null:null,'limit':_0x1a25ab[_0x6431('0x19')]?_0x1a25ab[_0x6431('0x19')][_0x6431('0x1c')]||null:null,'include':_0x1a25ab[_0x6431('0x19')]?_0x1a25ab[_0x6431('0x19')]['include']?_[_0x6431('0x1d')](_0x1a25ab['options'][_0x6431('0x1e')],function(_0x1e17e3){return{'model':db[_0x1e17e3[_0x6431('0x1f')]],'as':_0x1e17e3['as'],'attributes':_0x1e17e3[_0x6431('0x1b')],'include':_0x1e17e3[_0x6431('0x1e')]?_[_0x6431('0x1d')](_0x1e17e3[_0x6431('0x1e')],function(_0x192b05){return{'model':db[_0x192b05[_0x6431('0x1f')]],'as':_0x192b05['as'],'attributes':_0x192b05[_0x6431('0x1b')],'include':_0x192b05[_0x6431('0x1e')]?_[_0x6431('0x1d')](_0x192b05[_0x6431('0x1e')],function(_0x59261f){return{'model':db[_0x59261f[_0x6431('0x1f')]],'as':_0x59261f['as'],'attributes':_0x59261f[_0x6431('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d80f0){logger[_0x6431('0xe')](_0x6431('0x17'),_0x1a25ab);logger[_0x6431('0x20')](_0x6431('0x17'),_0x1a25ab,JSON[_0x6431('0x10')](_0x4d80f0));_0x386cf7(_0x4d80f0);})[_0x6431('0x16')](function(_0x3da334){logger[_0x6431('0x11')](_0x6431('0x17'),_0x3da334['message'],_0x1a25ab);_0x35baa6(_0x290753[_0x6431('0x11')](0x1f4,_0x3da334[_0x6431('0x14')]));});});};exports[_0x6431('0x21')]=function(_0x270d41){var _0x349aa2=this;return new Promise(function(_0x2e0123,_0x173060){return db[_0x6431('0x18')][_0x6431('0x22')]({'raw':_0x270d41[_0x6431('0x19')]?_0x270d41['options'][_0x6431('0x1a')]===undefined?!![]:![]:!![],'where':_0x270d41[_0x6431('0x19')]?_0x270d41['options'][_0x6431('0x23')]||null:null,'attributes':_0x270d41['options']?_0x270d41[_0x6431('0x19')][_0x6431('0x1b')]||null:null,'include':_0x270d41[_0x6431('0x19')]?_0x270d41[_0x6431('0x19')][_0x6431('0x1e')]?_[_0x6431('0x1d')](_0x270d41[_0x6431('0x19')][_0x6431('0x1e')],function(_0x45d254){return{'model':db[_0x45d254['model']],'as':_0x45d254['as'],'attributes':_0x45d254[_0x6431('0x1b')],'include':_0x45d254[_0x6431('0x1e')]?_[_0x6431('0x1d')](_0x45d254[_0x6431('0x1e')],function(_0x2349f0){return{'model':db[_0x2349f0[_0x6431('0x1f')]],'as':_0x2349f0['as'],'attributes':_0x2349f0[_0x6431('0x1b')],'include':_0x2349f0[_0x6431('0x1e')]?_[_0x6431('0x1d')](_0x2349f0[_0x6431('0x1e')],function(_0x2172ad){return{'model':db[_0x2172ad[_0x6431('0x1f')]],'as':_0x2172ad['as'],'attributes':_0x2172ad[_0x6431('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6431('0xd')](function(_0x57dad1){logger[_0x6431('0xe')]('ShowServicenowAccount',_0x270d41);logger['debug'](_0x6431('0x21'),_0x270d41,JSON[_0x6431('0x10')](_0x57dad1));_0x2e0123(_0x57dad1);})[_0x6431('0x16')](function(_0x588038){logger[_0x6431('0x11')](_0x6431('0x21'),_0x588038[_0x6431('0x14')],_0x270d41);_0x173060(_0x349aa2[_0x6431('0x11')](0x1f4,_0x588038[_0x6431('0x14')]));});});}; \ No newline at end of file +var _0x7c9f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowServicenowAccount','find','util'];(function(_0x40e28e,_0x49f458){var _0x40fcda=function(_0x288d8d){while(--_0x288d8d){_0x40e28e['push'](_0x40e28e['shift']());}};_0x40fcda(++_0x49f458);}(_0x7c9f,0x8f));var _0xf7c9=function(_0x594d9d,_0x264beb){_0x594d9d=_0x594d9d-0x0;var _0x483050=_0x7c9f[_0x594d9d];return _0x483050;};'use strict';var _=require('lodash');var util=require(_0xf7c9('0x0'));var moment=require('moment');var BPromise=require(_0xf7c9('0x1'));var rs=require(_0xf7c9('0x2'));var fs=require('fs');var Redis=require(_0xf7c9('0x3'));var db=require(_0xf7c9('0x4'))['db'];var utils=require(_0xf7c9('0x5'));var logger=require(_0xf7c9('0x6'))(_0xf7c9('0x7'));var config=require(_0xf7c9('0x8'));var jayson=require(_0xf7c9('0x9'));var client=jayson[_0xf7c9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x222f05,_0x2b8a7d,_0x54214f){return new BPromise(function(_0x3ae96e,_0x422dc3){return client[_0xf7c9('0xb')](_0x222f05,_0x54214f)[_0xf7c9('0xc')](function(_0x14ec92){logger[_0xf7c9('0xd')](_0xf7c9('0xe'),_0x2b8a7d,_0xf7c9('0xf'));logger[_0xf7c9('0x10')](_0xf7c9('0x11'),_0x2b8a7d,_0xf7c9('0xf'),JSON[_0xf7c9('0x12')](_0x14ec92));if(_0x14ec92[_0xf7c9('0x13')]){if(_0x14ec92['error']['code']===0x1f4){logger[_0xf7c9('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x2b8a7d,_0x14ec92[_0xf7c9('0x13')]['message']);return _0x422dc3(_0x14ec92[_0xf7c9('0x13')]['message']);}logger[_0xf7c9('0x13')](_0xf7c9('0xe'),_0x2b8a7d,_0x14ec92[_0xf7c9('0x13')][_0xf7c9('0x14')]);return _0x3ae96e(_0x14ec92['error'][_0xf7c9('0x14')]);}else{logger[_0xf7c9('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x2b8a7d,_0xf7c9('0xf'));_0x3ae96e(_0x14ec92[_0xf7c9('0x15')]['message']);}})['catch'](function(_0x376d00){logger[_0xf7c9('0x13')](_0xf7c9('0xe'),_0x2b8a7d,_0x376d00);_0x422dc3(_0x376d00);});});}exports[_0xf7c9('0x16')]=function(_0x335e58){var _0xf965d=this;return new Promise(function(_0x412df6,_0x158425){return db[_0xf7c9('0x17')][_0xf7c9('0x18')]({'raw':_0x335e58[_0xf7c9('0x19')]?_0x335e58['options'][_0xf7c9('0x1a')]===undefined?!![]:![]:!![],'where':_0x335e58['options']?_0x335e58[_0xf7c9('0x19')][_0xf7c9('0x1b')]||null:null,'attributes':_0x335e58[_0xf7c9('0x19')]?_0x335e58[_0xf7c9('0x19')][_0xf7c9('0x1c')]||null:null,'limit':_0x335e58[_0xf7c9('0x19')]?_0x335e58[_0xf7c9('0x19')][_0xf7c9('0x1d')]||null:null,'include':_0x335e58['options']?_0x335e58[_0xf7c9('0x19')][_0xf7c9('0x1e')]?_[_0xf7c9('0x1f')](_0x335e58[_0xf7c9('0x19')]['include'],function(_0xc49dd1){return{'model':db[_0xc49dd1['model']],'as':_0xc49dd1['as'],'attributes':_0xc49dd1[_0xf7c9('0x1c')],'include':_0xc49dd1[_0xf7c9('0x1e')]?_[_0xf7c9('0x1f')](_0xc49dd1['include'],function(_0x5e544a){return{'model':db[_0x5e544a['model']],'as':_0x5e544a['as'],'attributes':_0x5e544a[_0xf7c9('0x1c')],'include':_0x5e544a['include']?_[_0xf7c9('0x1f')](_0x5e544a[_0xf7c9('0x1e')],function(_0x270bab){return{'model':db[_0x270bab[_0xf7c9('0x20')]],'as':_0x270bab['as'],'attributes':_0x270bab[_0xf7c9('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x371c98){logger[_0xf7c9('0xd')](_0xf7c9('0x16'),_0x335e58);logger[_0xf7c9('0x10')](_0xf7c9('0x16'),_0x335e58,JSON[_0xf7c9('0x12')](_0x371c98));_0x412df6(_0x371c98);})[_0xf7c9('0x21')](function(_0x2793d3){logger['error'](_0xf7c9('0x16'),_0x2793d3[_0xf7c9('0x14')],_0x335e58);_0x158425(_0xf965d[_0xf7c9('0x13')](0x1f4,_0x2793d3[_0xf7c9('0x14')]));});});};exports[_0xf7c9('0x22')]=function(_0x3a30be){var _0x4cb4f4=this;return new Promise(function(_0x38d5d9,_0x1b3a60){return db[_0xf7c9('0x17')][_0xf7c9('0x23')]({'raw':_0x3a30be[_0xf7c9('0x19')]?_0x3a30be[_0xf7c9('0x19')][_0xf7c9('0x1a')]===undefined?!![]:![]:!![],'where':_0x3a30be['options']?_0x3a30be['options']['where']||null:null,'attributes':_0x3a30be['options']?_0x3a30be[_0xf7c9('0x19')][_0xf7c9('0x1c')]||null:null,'include':_0x3a30be[_0xf7c9('0x19')]?_0x3a30be[_0xf7c9('0x19')][_0xf7c9('0x1e')]?_[_0xf7c9('0x1f')](_0x3a30be[_0xf7c9('0x19')][_0xf7c9('0x1e')],function(_0x1f8ba0){return{'model':db[_0x1f8ba0[_0xf7c9('0x20')]],'as':_0x1f8ba0['as'],'attributes':_0x1f8ba0[_0xf7c9('0x1c')],'include':_0x1f8ba0[_0xf7c9('0x1e')]?_['map'](_0x1f8ba0['include'],function(_0x2a9e33){return{'model':db[_0x2a9e33[_0xf7c9('0x20')]],'as':_0x2a9e33['as'],'attributes':_0x2a9e33[_0xf7c9('0x1c')],'include':_0x2a9e33[_0xf7c9('0x1e')]?_[_0xf7c9('0x1f')](_0x2a9e33[_0xf7c9('0x1e')],function(_0x56226c){return{'model':db[_0x56226c['model']],'as':_0x56226c['as'],'attributes':_0x56226c[_0xf7c9('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34318d){logger['info']('ShowServicenowAccount',_0x3a30be);logger[_0xf7c9('0x10')](_0xf7c9('0x22'),_0x3a30be,JSON['stringify'](_0x34318d));_0x38d5d9(_0x34318d);})[_0xf7c9('0x21')](function(_0x393019){logger[_0xf7c9('0x13')](_0xf7c9('0x22'),_0x393019['message'],_0x3a30be);_0x1b3a60(_0x4cb4f4[_0xf7c9('0x13')](0x1f4,_0x393019['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 44191ea..e06fb43 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 _0x6980=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','destroy','exports','multer'];(function(_0x42f3a5,_0x3a4470){var _0x1a7d74=function(_0x43cc36){while(--_0x43cc36){_0x42f3a5['push'](_0x42f3a5['shift']());}};_0x1a7d74(++_0x3a4470);}(_0x6980,0xc7));var _0x0698=function(_0x461c18,_0x5605b9){_0x461c18=_0x461c18-0x0;var _0x35501c=_0x6980[_0x461c18];return _0x35501c;};'use strict';var multer=require(_0x0698('0x0'));var util=require(_0x0698('0x1'));var path=require(_0x0698('0x2'));var timeout=require(_0x0698('0x3'));var express=require(_0x0698('0x4'));var router=express[_0x0698('0x5')]();var fs_extra=require(_0x0698('0x6'));var auth=require(_0x0698('0x7'));var interaction=require(_0x0698('0x8'));var config=require(_0x0698('0x9'));var controller=require(_0x0698('0xa'));router[_0x0698('0xb')]('/',auth[_0x0698('0xc')](),controller[_0x0698('0xd')]);router[_0x0698('0xb')]('/:id',auth[_0x0698('0xc')](),controller['show']);router[_0x0698('0xb')](_0x0698('0xe'),auth[_0x0698('0xc')](),controller['getFields']);router[_0x0698('0xb')](_0x0698('0xf'),auth['isAuthenticated'](),controller[_0x0698('0x10')]);router[_0x0698('0xb')](_0x0698('0x11'),auth[_0x0698('0xc')](),controller[_0x0698('0x12')]);router[_0x0698('0x13')]('/',auth[_0x0698('0xc')](),controller[_0x0698('0x14')]);router[_0x0698('0x15')]('/:id',auth[_0x0698('0xc')](),controller['update']);router['delete'](_0x0698('0x16'),auth[_0x0698('0xc')](),controller[_0x0698('0x17')]);module[_0x0698('0x18')]=router; \ No newline at end of file +var _0xbb9b=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post'];(function(_0x53b555,_0x5edc73){var _0x275ef8=function(_0x4d9b69){while(--_0x4d9b69){_0x53b555['push'](_0x53b555['shift']());}};_0x275ef8(++_0x5edc73);}(_0xbb9b,0xad));var _0xbbb9=function(_0x1d52d3,_0x2a0df0){_0x1d52d3=_0x1d52d3-0x0;var _0x1ad74b=_0xbb9b[_0x1d52d3];return _0x1ad74b;};'use strict';var multer=require(_0xbbb9('0x0'));var util=require(_0xbbb9('0x1'));var path=require(_0xbbb9('0x2'));var timeout=require(_0xbbb9('0x3'));var express=require(_0xbbb9('0x4'));var router=express[_0xbbb9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbbb9('0x6'));var interaction=require(_0xbbb9('0x7'));var config=require(_0xbbb9('0x8'));var controller=require('./intServicenowConfiguration.controller');router[_0xbbb9('0x9')]('/',auth['isAuthenticated'](),controller[_0xbbb9('0xa')]);router[_0xbbb9('0x9')](_0xbbb9('0xb'),auth[_0xbbb9('0xc')](),controller[_0xbbb9('0xd')]);router[_0xbbb9('0x9')](_0xbbb9('0xe'),auth['isAuthenticated'](),controller[_0xbbb9('0xf')]);router[_0xbbb9('0x9')]('/:id/subjects',auth[_0xbbb9('0xc')](),controller['getSubjects']);router[_0xbbb9('0x9')](_0xbbb9('0x10'),auth['isAuthenticated'](),controller[_0xbbb9('0x11')]);router[_0xbbb9('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbbb9('0x13')](_0xbbb9('0xb'),auth[_0xbbb9('0xc')](),controller[_0xbbb9('0x14')]);router[_0xbbb9('0x15')](_0xbbb9('0xb'),auth[_0xbbb9('0xc')](),controller[_0xbbb9('0x16')]);module[_0xbbb9('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 3929c2e..80180b0 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 _0x8aa9=['sequelize','exports','STRING'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x8aa9,0x156));var _0x98aa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8aa9[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x98aa('0x0'));module[_0x98aa('0x1')]={'name':{'type':Sequelize[_0x98aa('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4751=['sequelize','exports','STRING'];(function(_0x13036b,_0x3be86e){var _0x1dbde4=function(_0xbb03a8){while(--_0xbb03a8){_0x13036b['push'](_0x13036b['shift']());}};_0x1dbde4(++_0x3be86e);}(_0x4751,0xba));var _0x1475=function(_0x198f3d,_0x3f850c){_0x198f3d=_0x198f3d-0x0;var _0x320202=_0x4751[_0x198f3d];return _0x320202;};'use strict';var Sequelize=require(_0x1475('0x0'));module[_0x1475('0x1')]={'name':{'type':Sequelize[_0x1475('0x2')]},'description':{'type':Sequelize[_0x1475('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 8fcbd96..58d649f 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 _0xed19=['getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','end','sendStatus','stack','name','send','index','map','ServicenowConfiguration','fieldName','type','keys','filters','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','params','include','options','find','catch','create','body','update','findOne','ServicenowField','rawAttributes','pick','getFields','hasOwnProperty'];(function(_0x2af160,_0x765b1){var _0x439d67=function(_0x4d26af){while(--_0x4d26af){_0x2af160['push'](_0x2af160['shift']());}};_0x439d67(++_0x765b1);}(_0xed19,0xdd));var _0x9ed1=function(_0x7825f0,_0x565f99){_0x7825f0=_0x7825f0-0x0;var _0xabb65a=_0xed19[_0x7825f0];return _0xabb65a;};'use strict';var emlformat=require(_0x9ed1('0x0'));var rimraf=require(_0x9ed1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9ed1('0x2'));var rp=require(_0x9ed1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9ed1('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9ed1('0x5'));var ejs=require(_0x9ed1('0x6'));var fs=require('fs');var fs_extra=require(_0x9ed1('0x7'));var _=require(_0x9ed1('0x8'));var squel=require(_0x9ed1('0x9'));var crypto=require(_0x9ed1('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9ed1('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9ed1('0xc'));var qs=require(_0x9ed1('0xd'));var as=require(_0x9ed1('0xe'));var hardwareService=require(_0x9ed1('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x9ed1('0x10'));var config=require(_0x9ed1('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x340670,_0x5f5dc2){_0x5f5dc2=_0x5f5dc2||0xcc;return function(_0x44dde1){if(_0x44dde1){return _0x340670['sendStatus'](_0x5f5dc2);}return _0x340670[_0x9ed1('0x12')](_0x5f5dc2)['end']();};}function respondWithResult(_0x4dc9d3,_0x36963b){_0x36963b=_0x36963b||0xc8;return function(_0xd58c10){if(_0xd58c10){return _0x4dc9d3[_0x9ed1('0x12')](_0x36963b)[_0x9ed1('0x13')](_0xd58c10);}};}function respondWithFilteredResult(_0xa3df0a,_0x42aac4){return function(_0x5faf6f){if(_0x5faf6f){var _0x5b02a6=typeof _0x42aac4[_0x9ed1('0x14')]===_0x9ed1('0x15')&&typeof _0x42aac4[_0x9ed1('0x16')]===_0x9ed1('0x15');var _0x3cd6a8=_0x5faf6f[_0x9ed1('0x17')];var _0x235289=_0x5b02a6?0x0:_0x42aac4[_0x9ed1('0x14')];var _0x1559e8=_0x5b02a6?_0x5faf6f[_0x9ed1('0x17')]:_0x42aac4[_0x9ed1('0x14')]+_0x42aac4[_0x9ed1('0x16')];var _0x47d596;if(_0x1559e8>=_0x3cd6a8){_0x1559e8=_0x3cd6a8;_0x47d596=0xc8;}else{_0x47d596=0xce;}_0xa3df0a[_0x9ed1('0x12')](_0x47d596);return _0xa3df0a[_0x9ed1('0x18')](_0x9ed1('0x19'),_0x235289+'-'+_0x1559e8+'/'+_0x3cd6a8)['json'](_0x5faf6f);}return null;};}function patchUpdates(_0x51f804){return function(_0x1b2371){try{jsonpatch['apply'](_0x1b2371,_0x51f804,!![]);}catch(_0x5425b1){return BPromise[_0x9ed1('0x1a')](_0x5425b1);}return _0x1b2371['save']();};}function saveUpdates(_0x4468f9,_0x36af18){return function(_0x5cbba2){if(_0x5cbba2){return _0x5cbba2['update'](_0x4468f9)[_0x9ed1('0x1b')](function(_0x4d2702){return _0x4d2702;});}return null;};}function removeEntity(_0x1d4726,_0x5dded1){return function(_0x454c8c){if(_0x454c8c){return _0x454c8c[_0x9ed1('0x1c')]()[_0x9ed1('0x1b')](function(){_0x1d4726[_0x9ed1('0x12')](0xcc)[_0x9ed1('0x1d')]();});}};}function handleEntityNotFound(_0x2fca01,_0x58fbb8){return function(_0x56051c){if(!_0x56051c){_0x2fca01[_0x9ed1('0x1e')](0x194);}return _0x56051c;};}function handleError(_0x319ac6,_0x503622){_0x503622=_0x503622||0x1f4;return function(_0x3a5290){logger['error'](_0x3a5290[_0x9ed1('0x1f')]);if(_0x3a5290[_0x9ed1('0x20')]){delete _0x3a5290['name'];}_0x319ac6[_0x9ed1('0x12')](_0x503622)[_0x9ed1('0x21')](_0x3a5290);};}exports[_0x9ed1('0x22')]=function(_0x4dbedb,_0x44acfa){var _0x4c503e={},_0x2de522={},_0x14856a={'count':0x0,'rows':[]};var _0x235c44=_[_0x9ed1('0x23')](db[_0x9ed1('0x24')]['rawAttributes'],function(_0x5615cd){return{'name':_0x5615cd[_0x9ed1('0x25')],'type':_0x5615cd[_0x9ed1('0x26')]['key']};});_0x2de522['model']=_[_0x9ed1('0x23')](_0x235c44,_0x9ed1('0x20'));_0x2de522['query']=_[_0x9ed1('0x27')](_0x4dbedb['query']);_0x2de522[_0x9ed1('0x28')]=_['intersection'](_0x2de522[_0x9ed1('0x29')],_0x2de522[_0x9ed1('0x2a')]);_0x4c503e[_0x9ed1('0x2b')]=_[_0x9ed1('0x2c')](_0x2de522['model'],qs['fields'](_0x4dbedb[_0x9ed1('0x2a')][_0x9ed1('0x2d')]));_0x4c503e[_0x9ed1('0x2b')]=_0x4c503e[_0x9ed1('0x2b')][_0x9ed1('0x2e')]?_0x4c503e['attributes']:_0x2de522['model'];if(!_0x4dbedb[_0x9ed1('0x2a')]['hasOwnProperty'](_0x9ed1('0x2f'))){_0x4c503e['limit']=qs['limit'](_0x4dbedb[_0x9ed1('0x2a')][_0x9ed1('0x16')]);_0x4c503e['offset']=qs[_0x9ed1('0x14')](_0x4dbedb['query'][_0x9ed1('0x14')]);}_0x4c503e[_0x9ed1('0x30')]=qs[_0x9ed1('0x31')](_0x4dbedb[_0x9ed1('0x2a')][_0x9ed1('0x31')]);_0x4c503e[_0x9ed1('0x32')]=qs['filters'](_['pick'](_0x4dbedb[_0x9ed1('0x2a')],_0x2de522[_0x9ed1('0x28')]),_0x235c44);if(_0x4dbedb['query'][_0x9ed1('0x33')]){_0x4c503e[_0x9ed1('0x32')]=_[_0x9ed1('0x34')](_0x4c503e[_0x9ed1('0x32')],{'$or':_['map'](_0x235c44,function(_0x5a49c5){if(_0x5a49c5[_0x9ed1('0x26')]!==_0x9ed1('0x35')){var _0x5b3d2d={};_0x5b3d2d[_0x5a49c5[_0x9ed1('0x20')]]={'$like':'%'+_0x4dbedb[_0x9ed1('0x2a')][_0x9ed1('0x33')]+'%'};return _0x5b3d2d;}})});}_0x4c503e=_['merge']({},_0x4c503e,_0x4dbedb['options']);var _0x58b33e={'where':_0x4c503e[_0x9ed1('0x32')]};return db[_0x9ed1('0x24')][_0x9ed1('0x17')](_0x58b33e)[_0x9ed1('0x1b')](function(_0x1c7e1d){_0x14856a[_0x9ed1('0x17')]=_0x1c7e1d;if(_0x4dbedb[_0x9ed1('0x2a')][_0x9ed1('0x36')]){_0x4c503e['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x9ed1('0x37')](_0x4c503e);})['then'](function(_0x159645){_0x14856a[_0x9ed1('0x38')]=_0x159645;return _0x14856a;})[_0x9ed1('0x1b')](respondWithFilteredResult(_0x44acfa,_0x4c503e))['catch'](handleError(_0x44acfa,null));};exports['show']=function(_0x4252cd,_0x4a5f64){var _0x378671={'raw':![],'where':{'id':_0x4252cd[_0x9ed1('0x39')]['id']}},_0x41942d={};_0x41942d[_0x9ed1('0x29')]=_['keys'](db[_0x9ed1('0x24')]['rawAttributes']);_0x41942d[_0x9ed1('0x2a')]=_[_0x9ed1('0x27')](_0x4252cd[_0x9ed1('0x2a')]);_0x41942d[_0x9ed1('0x28')]=_['intersection'](_0x41942d[_0x9ed1('0x29')],_0x41942d[_0x9ed1('0x2a')]);_0x378671[_0x9ed1('0x2b')]=_[_0x9ed1('0x2c')](_0x41942d['model'],qs[_0x9ed1('0x2d')](_0x4252cd[_0x9ed1('0x2a')][_0x9ed1('0x2d')]));_0x378671[_0x9ed1('0x2b')]=_0x378671[_0x9ed1('0x2b')]['length']?_0x378671['attributes']:_0x41942d[_0x9ed1('0x29')];if(_0x4252cd['query'][_0x9ed1('0x36')]){_0x378671[_0x9ed1('0x3a')]=[{'all':!![]}];}_0x378671=_[_0x9ed1('0x34')]({},_0x378671,_0x4252cd[_0x9ed1('0x3b')]);return db[_0x9ed1('0x24')][_0x9ed1('0x3c')](_0x378671)[_0x9ed1('0x1b')](handleEntityNotFound(_0x4a5f64,null))[_0x9ed1('0x1b')](respondWithResult(_0x4a5f64,null))[_0x9ed1('0x3d')](handleError(_0x4a5f64,null));};exports[_0x9ed1('0x3e')]=function(_0xf1f2ae,_0x30abb9){return db[_0x9ed1('0x24')]['create'](_0xf1f2ae[_0x9ed1('0x3f')],{})[_0x9ed1('0x1b')](respondWithResult(_0x30abb9,0xc9))[_0x9ed1('0x3d')](handleError(_0x30abb9,null));};exports[_0x9ed1('0x40')]=function(_0x3f31f3,_0x276909){if(_0x3f31f3[_0x9ed1('0x3f')]['id']){delete _0x3f31f3[_0x9ed1('0x3f')]['id'];}return db[_0x9ed1('0x24')][_0x9ed1('0x3c')]({'where':{'id':_0x3f31f3[_0x9ed1('0x39')]['id']}})['then'](handleEntityNotFound(_0x276909,null))[_0x9ed1('0x1b')](saveUpdates(_0x3f31f3[_0x9ed1('0x3f')],null))[_0x9ed1('0x1b')](respondWithResult(_0x276909,null))['catch'](handleError(_0x276909,null));};exports['destroy']=function(_0x30031f,_0x27750d){return db[_0x9ed1('0x24')][_0x9ed1('0x3c')]({'where':{'id':_0x30031f[_0x9ed1('0x39')]['id']}})[_0x9ed1('0x1b')](handleEntityNotFound(_0x27750d,null))['then'](removeEntity(_0x27750d,null))[_0x9ed1('0x3d')](handleError(_0x27750d,null));};exports['getFields']=function(_0x3e4666,_0x507947,_0x382277){var _0x4b2b77={};var _0x348791={};var _0x3e4064;var _0x10278c;return db[_0x9ed1('0x24')][_0x9ed1('0x41')]({'where':{'id':_0x3e4666[_0x9ed1('0x39')]['id']}})[_0x9ed1('0x1b')](handleEntityNotFound(_0x507947,null))['then'](function(_0x95a0ca){if(_0x95a0ca){_0x3e4064=_0x95a0ca;_0x348791[_0x9ed1('0x29')]=_[_0x9ed1('0x27')](db[_0x9ed1('0x42')][_0x9ed1('0x43')]);_0x348791[_0x9ed1('0x2a')]=_['keys'](_0x3e4666[_0x9ed1('0x2a')]);_0x348791['filters']=_[_0x9ed1('0x2c')](_0x348791['model'],_0x348791['query']);_0x4b2b77['attributes']=_['intersection'](_0x348791[_0x9ed1('0x29')],qs[_0x9ed1('0x2d')](_0x3e4666[_0x9ed1('0x2a')][_0x9ed1('0x2d')]));_0x4b2b77['attributes']=_0x4b2b77[_0x9ed1('0x2b')]['length']?_0x4b2b77[_0x9ed1('0x2b')]:_0x348791[_0x9ed1('0x29')];_0x4b2b77['order']=qs[_0x9ed1('0x31')](_0x3e4666[_0x9ed1('0x2a')][_0x9ed1('0x31')]);_0x4b2b77['where']=qs[_0x9ed1('0x28')](_[_0x9ed1('0x44')](_0x3e4666['query'],_0x348791[_0x9ed1('0x28')]));if(_0x3e4666[_0x9ed1('0x2a')][_0x9ed1('0x33')]){_0x4b2b77[_0x9ed1('0x32')]=_[_0x9ed1('0x34')](_0x4b2b77['where'],{'$or':_[_0x9ed1('0x23')](_0x4b2b77[_0x9ed1('0x2b')],function(_0x43e164){var _0x1f8df7={};_0x1f8df7[_0x43e164]={'$like':'%'+_0x3e4666[_0x9ed1('0x2a')][_0x9ed1('0x33')]+'%'};return _0x1f8df7;})});}_0x4b2b77=_[_0x9ed1('0x34')]({},_0x4b2b77,_0x3e4666['options']);return _0x3e4064[_0x9ed1('0x45')](_0x4b2b77);}})['then'](function(_0x221b2f){if(_0x221b2f){_0x10278c=_0x221b2f[_0x9ed1('0x2e')];if(!_0x3e4666[_0x9ed1('0x2a')][_0x9ed1('0x46')](_0x9ed1('0x2f'))){_0x4b2b77[_0x9ed1('0x16')]=qs[_0x9ed1('0x16')](_0x3e4666[_0x9ed1('0x2a')][_0x9ed1('0x16')]);_0x4b2b77[_0x9ed1('0x14')]=qs[_0x9ed1('0x14')](_0x3e4666['query'][_0x9ed1('0x14')]);}return _0x3e4064[_0x9ed1('0x45')](_0x4b2b77);}})[_0x9ed1('0x1b')](function(_0x47a6dc){if(_0x47a6dc){return _0x47a6dc?{'count':_0x10278c,'rows':_0x47a6dc}:null;}})['then'](respondWithResult(_0x507947,null))[_0x9ed1('0x3d')](handleError(_0x507947,null));};exports[_0x9ed1('0x47')]=function(_0x565986,_0x531dc3,_0x1dea35){var _0x5aa556={};var _0x3052f9={};var _0x3d5ef3;var _0x99236c;return db[_0x9ed1('0x24')][_0x9ed1('0x41')]({'where':{'id':_0x565986[_0x9ed1('0x39')]['id']}})['then'](handleEntityNotFound(_0x531dc3,null))[_0x9ed1('0x1b')](function(_0x4b8c7f){if(_0x4b8c7f){_0x3d5ef3=_0x4b8c7f;_0x3052f9[_0x9ed1('0x29')]=_[_0x9ed1('0x27')](db[_0x9ed1('0x42')][_0x9ed1('0x43')]);_0x3052f9[_0x9ed1('0x2a')]=_[_0x9ed1('0x27')](_0x565986['query']);_0x3052f9[_0x9ed1('0x28')]=_[_0x9ed1('0x2c')](_0x3052f9[_0x9ed1('0x29')],_0x3052f9[_0x9ed1('0x2a')]);_0x5aa556[_0x9ed1('0x2b')]=_[_0x9ed1('0x2c')](_0x3052f9['model'],qs[_0x9ed1('0x2d')](_0x565986['query'][_0x9ed1('0x2d')]));_0x5aa556[_0x9ed1('0x2b')]=_0x5aa556[_0x9ed1('0x2b')][_0x9ed1('0x2e')]?_0x5aa556['attributes']:_0x3052f9[_0x9ed1('0x29')];_0x5aa556[_0x9ed1('0x30')]=qs['sort'](_0x565986['query']['sort']);_0x5aa556[_0x9ed1('0x32')]=qs[_0x9ed1('0x28')](_[_0x9ed1('0x44')](_0x565986[_0x9ed1('0x2a')],_0x3052f9[_0x9ed1('0x28')]));if(_0x565986[_0x9ed1('0x2a')][_0x9ed1('0x33')]){_0x5aa556['where']=_[_0x9ed1('0x34')](_0x5aa556[_0x9ed1('0x32')],{'$or':_['map'](_0x5aa556[_0x9ed1('0x2b')],function(_0x3338a5){var _0x5e81ce={};_0x5e81ce[_0x3338a5]={'$like':'%'+_0x565986[_0x9ed1('0x2a')][_0x9ed1('0x33')]+'%'};return _0x5e81ce;})});}_0x5aa556=_['merge']({},_0x5aa556,_0x565986[_0x9ed1('0x3b')]);return _0x3d5ef3['getSubjects'](_0x5aa556);}})[_0x9ed1('0x1b')](function(_0x2d6abc){if(_0x2d6abc){_0x99236c=_0x2d6abc['length'];if(!_0x565986['query']['hasOwnProperty'](_0x9ed1('0x2f'))){_0x5aa556[_0x9ed1('0x16')]=qs['limit'](_0x565986['query'][_0x9ed1('0x16')]);_0x5aa556[_0x9ed1('0x14')]=qs[_0x9ed1('0x14')](_0x565986[_0x9ed1('0x2a')][_0x9ed1('0x14')]);}return _0x3d5ef3['getSubjects'](_0x5aa556);}})[_0x9ed1('0x1b')](function(_0xcf19b5){if(_0xcf19b5){return _0xcf19b5?{'count':_0x99236c,'rows':_0xcf19b5}:null;}})[_0x9ed1('0x1b')](respondWithResult(_0x531dc3,null))[_0x9ed1('0x3d')](handleError(_0x531dc3,null));};exports['getDescriptions']=function(_0x1a3520,_0x18604c,_0x30f7c5){var _0x8442c9={};var _0x348486={};var _0x22cb01;var _0x154b2b;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x1a3520[_0x9ed1('0x39')]['id']}})['then'](handleEntityNotFound(_0x18604c,null))[_0x9ed1('0x1b')](function(_0x39e7f0){if(_0x39e7f0){_0x22cb01=_0x39e7f0;_0x348486[_0x9ed1('0x29')]=_['keys'](db[_0x9ed1('0x42')][_0x9ed1('0x43')]);_0x348486['query']=_['keys'](_0x1a3520[_0x9ed1('0x2a')]);_0x348486[_0x9ed1('0x28')]=_['intersection'](_0x348486[_0x9ed1('0x29')],_0x348486['query']);_0x8442c9[_0x9ed1('0x2b')]=_[_0x9ed1('0x2c')](_0x348486[_0x9ed1('0x29')],qs[_0x9ed1('0x2d')](_0x1a3520[_0x9ed1('0x2a')]['fields']));_0x8442c9[_0x9ed1('0x2b')]=_0x8442c9[_0x9ed1('0x2b')]['length']?_0x8442c9[_0x9ed1('0x2b')]:_0x348486[_0x9ed1('0x29')];_0x8442c9[_0x9ed1('0x30')]=qs[_0x9ed1('0x31')](_0x1a3520[_0x9ed1('0x2a')][_0x9ed1('0x31')]);_0x8442c9[_0x9ed1('0x32')]=qs[_0x9ed1('0x28')](_['pick'](_0x1a3520[_0x9ed1('0x2a')],_0x348486[_0x9ed1('0x28')]));if(_0x1a3520[_0x9ed1('0x2a')][_0x9ed1('0x33')]){_0x8442c9[_0x9ed1('0x32')]=_[_0x9ed1('0x34')](_0x8442c9[_0x9ed1('0x32')],{'$or':_[_0x9ed1('0x23')](_0x8442c9[_0x9ed1('0x2b')],function(_0x2fa5df){var _0x1f984c={};_0x1f984c[_0x2fa5df]={'$like':'%'+_0x1a3520[_0x9ed1('0x2a')][_0x9ed1('0x33')]+'%'};return _0x1f984c;})});}_0x8442c9=_[_0x9ed1('0x34')]({},_0x8442c9,_0x1a3520['options']);return _0x22cb01[_0x9ed1('0x48')](_0x8442c9);}})[_0x9ed1('0x1b')](function(_0x4802e8){if(_0x4802e8){_0x154b2b=_0x4802e8[_0x9ed1('0x2e')];if(!_0x1a3520[_0x9ed1('0x2a')]['hasOwnProperty'](_0x9ed1('0x2f'))){_0x8442c9[_0x9ed1('0x16')]=qs[_0x9ed1('0x16')](_0x1a3520['query'][_0x9ed1('0x16')]);_0x8442c9[_0x9ed1('0x14')]=qs[_0x9ed1('0x14')](_0x1a3520[_0x9ed1('0x2a')]['offset']);}return _0x22cb01['getDescriptions'](_0x8442c9);}})[_0x9ed1('0x1b')](function(_0x1b2f28){if(_0x1b2f28){return _0x1b2f28?{'count':_0x154b2b,'rows':_0x1b2f28}:null;}})[_0x9ed1('0x1b')](respondWithResult(_0x18604c,null))[_0x9ed1('0x3d')](handleError(_0x18604c,null));}; \ No newline at end of file +var _0xc784=['destroy','end','stack','name','map','ServicenowConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','attributes','create','body','find','findOne','ServicenowField','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','limit','Content-Range','apply','reject','update','then'];(function(_0x292bab,_0x18b725){var _0x3a1de1=function(_0x8d52cf){while(--_0x8d52cf){_0x292bab['push'](_0x292bab['shift']());}};_0x3a1de1(++_0x18b725);}(_0xc784,0x1ba));var _0x4c78=function(_0x18b2c6,_0x5c4ed6){_0x18b2c6=_0x18b2c6-0x0;var _0x1f3834=_0xc784[_0x18b2c6];return _0x1f3834;};'use strict';var emlformat=require(_0x4c78('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c78('0x1'));var jsonpatch=require(_0x4c78('0x2'));var rp=require(_0x4c78('0x3'));var moment=require(_0x4c78('0x4'));var BPromise=require(_0x4c78('0x5'));var Mustache=require(_0x4c78('0x6'));var util=require(_0x4c78('0x7'));var path=require(_0x4c78('0x8'));var sox=require(_0x4c78('0x9'));var csv=require('to-csv');var ejs=require(_0x4c78('0xa'));var fs=require('fs');var fs_extra=require(_0x4c78('0xb'));var _=require(_0x4c78('0xc'));var squel=require(_0x4c78('0xd'));var crypto=require(_0x4c78('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4c78('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4c78('0x10'));var Papa=require(_0x4c78('0x11'));var Redis=require('ioredis');var authService=require(_0x4c78('0x12'));var qs=require(_0x4c78('0x13'));var as=require(_0x4c78('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c78('0x15'))(_0x4c78('0x16'));var utils=require(_0x4c78('0x17'));var config=require(_0x4c78('0x18'));var licenseUtil=require(_0x4c78('0x19'));var db=require(_0x4c78('0x1a'))['db'];function respondWithStatusCode(_0x57c1f4,_0x4bc2b9){_0x4bc2b9=_0x4bc2b9||0xcc;return function(_0xa27f17){if(_0xa27f17){return _0x57c1f4[_0x4c78('0x1b')](_0x4bc2b9);}return _0x57c1f4[_0x4c78('0x1c')](_0x4bc2b9)['end']();};}function respondWithResult(_0x386b6b,_0x3312d1){_0x3312d1=_0x3312d1||0xc8;return function(_0x158cfa){if(_0x158cfa){return _0x386b6b[_0x4c78('0x1c')](_0x3312d1)[_0x4c78('0x1d')](_0x158cfa);}};}function respondWithFilteredResult(_0x53b7c4,_0x317519){return function(_0x2ba64a){if(_0x2ba64a){var _0x44eb96=typeof _0x317519[_0x4c78('0x1e')]==='undefined'&&typeof _0x317519['limit']==='undefined';var _0x5cbbdd=_0x2ba64a[_0x4c78('0x1f')];var _0x3f6904=_0x44eb96?0x0:_0x317519['offset'];var _0x106803=_0x44eb96?_0x2ba64a[_0x4c78('0x1f')]:_0x317519[_0x4c78('0x1e')]+_0x317519[_0x4c78('0x20')];var _0x5672e4;if(_0x106803>=_0x5cbbdd){_0x106803=_0x5cbbdd;_0x5672e4=0xc8;}else{_0x5672e4=0xce;}_0x53b7c4[_0x4c78('0x1c')](_0x5672e4);return _0x53b7c4['set'](_0x4c78('0x21'),_0x3f6904+'-'+_0x106803+'/'+_0x5cbbdd)[_0x4c78('0x1d')](_0x2ba64a);}return null;};}function patchUpdates(_0x45692d){return function(_0x1eae2c){try{jsonpatch[_0x4c78('0x22')](_0x1eae2c,_0x45692d,!![]);}catch(_0x1544ad){return BPromise[_0x4c78('0x23')](_0x1544ad);}return _0x1eae2c['save']();};}function saveUpdates(_0x46a5fb,_0x7af435){return function(_0x12cdd6){if(_0x12cdd6){return _0x12cdd6[_0x4c78('0x24')](_0x46a5fb)[_0x4c78('0x25')](function(_0x389ef3){return _0x389ef3;});}return null;};}function removeEntity(_0x34224d,_0x1b1cdd){return function(_0xb79e8d){if(_0xb79e8d){return _0xb79e8d[_0x4c78('0x26')]()[_0x4c78('0x25')](function(){_0x34224d[_0x4c78('0x1c')](0xcc)[_0x4c78('0x27')]();});}};}function handleEntityNotFound(_0x26c183,_0x34d0b6){return function(_0x1b75f7){if(!_0x1b75f7){_0x26c183[_0x4c78('0x1b')](0x194);}return _0x1b75f7;};}function handleError(_0x3159cf,_0x4eca3c){_0x4eca3c=_0x4eca3c||0x1f4;return function(_0x112201){logger['error'](_0x112201[_0x4c78('0x28')]);if(_0x112201['name']){delete _0x112201[_0x4c78('0x29')];}_0x3159cf['status'](_0x4eca3c)['send'](_0x112201);};}exports['index']=function(_0x3b0c84,_0x3064e6){var _0x51fc1e={},_0x42c09b={},_0x3bfe9d={'count':0x0,'rows':[]};var _0x275881=_[_0x4c78('0x2a')](db[_0x4c78('0x2b')][_0x4c78('0x2c')],function(_0x3767d8){return{'name':_0x3767d8['fieldName'],'type':_0x3767d8[_0x4c78('0x2d')][_0x4c78('0x2e')]};});_0x42c09b[_0x4c78('0x2f')]=_[_0x4c78('0x2a')](_0x275881,'name');_0x42c09b[_0x4c78('0x30')]=_[_0x4c78('0x31')](_0x3b0c84[_0x4c78('0x30')]);_0x42c09b[_0x4c78('0x32')]=_[_0x4c78('0x33')](_0x42c09b[_0x4c78('0x2f')],_0x42c09b[_0x4c78('0x30')]);_0x51fc1e['attributes']=_[_0x4c78('0x33')](_0x42c09b['model'],qs['fields'](_0x3b0c84[_0x4c78('0x30')]['fields']));_0x51fc1e['attributes']=_0x51fc1e['attributes'][_0x4c78('0x34')]?_0x51fc1e['attributes']:_0x42c09b[_0x4c78('0x2f')];if(!_0x3b0c84[_0x4c78('0x30')][_0x4c78('0x35')](_0x4c78('0x36'))){_0x51fc1e[_0x4c78('0x20')]=qs[_0x4c78('0x20')](_0x3b0c84[_0x4c78('0x30')][_0x4c78('0x20')]);_0x51fc1e[_0x4c78('0x1e')]=qs[_0x4c78('0x1e')](_0x3b0c84[_0x4c78('0x30')][_0x4c78('0x1e')]);}_0x51fc1e[_0x4c78('0x37')]=qs[_0x4c78('0x38')](_0x3b0c84[_0x4c78('0x30')][_0x4c78('0x38')]);_0x51fc1e[_0x4c78('0x39')]=qs['filters'](_[_0x4c78('0x3a')](_0x3b0c84['query'],_0x42c09b[_0x4c78('0x32')]),_0x275881);if(_0x3b0c84[_0x4c78('0x30')][_0x4c78('0x3b')]){_0x51fc1e[_0x4c78('0x39')]=_['merge'](_0x51fc1e[_0x4c78('0x39')],{'$or':_[_0x4c78('0x2a')](_0x275881,function(_0x1ddb50){if(_0x1ddb50[_0x4c78('0x2d')]!==_0x4c78('0x3c')){var _0x58644a={};_0x58644a[_0x1ddb50[_0x4c78('0x29')]]={'$like':'%'+_0x3b0c84[_0x4c78('0x30')][_0x4c78('0x3b')]+'%'};return _0x58644a;}})});}_0x51fc1e=_[_0x4c78('0x3d')]({},_0x51fc1e,_0x3b0c84[_0x4c78('0x3e')]);var _0x35d02e={'where':_0x51fc1e[_0x4c78('0x39')]};return db[_0x4c78('0x2b')][_0x4c78('0x1f')](_0x35d02e)[_0x4c78('0x25')](function(_0x4e0c5f){_0x3bfe9d[_0x4c78('0x1f')]=_0x4e0c5f;if(_0x3b0c84[_0x4c78('0x30')][_0x4c78('0x3f')]){_0x51fc1e[_0x4c78('0x40')]=[{'all':!![]}];}return db[_0x4c78('0x2b')][_0x4c78('0x41')](_0x51fc1e);})[_0x4c78('0x25')](function(_0x23fab4){_0x3bfe9d[_0x4c78('0x42')]=_0x23fab4;return _0x3bfe9d;})[_0x4c78('0x25')](respondWithFilteredResult(_0x3064e6,_0x51fc1e))[_0x4c78('0x43')](handleError(_0x3064e6,null));};exports[_0x4c78('0x44')]=function(_0x57a60b,_0x4026cf){var _0x4a4e1d={'raw':![],'where':{'id':_0x57a60b[_0x4c78('0x45')]['id']}},_0x593db3={};_0x593db3[_0x4c78('0x2f')]=_[_0x4c78('0x31')](db[_0x4c78('0x2b')]['rawAttributes']);_0x593db3[_0x4c78('0x30')]=_[_0x4c78('0x31')](_0x57a60b[_0x4c78('0x30')]);_0x593db3[_0x4c78('0x32')]=_[_0x4c78('0x33')](_0x593db3[_0x4c78('0x2f')],_0x593db3[_0x4c78('0x30')]);_0x4a4e1d['attributes']=_['intersection'](_0x593db3['model'],qs[_0x4c78('0x46')](_0x57a60b[_0x4c78('0x30')][_0x4c78('0x46')]));_0x4a4e1d[_0x4c78('0x47')]=_0x4a4e1d[_0x4c78('0x47')][_0x4c78('0x34')]?_0x4a4e1d[_0x4c78('0x47')]:_0x593db3['model'];if(_0x57a60b['query'][_0x4c78('0x3f')]){_0x4a4e1d[_0x4c78('0x40')]=[{'all':!![]}];}_0x4a4e1d=_[_0x4c78('0x3d')]({},_0x4a4e1d,_0x57a60b['options']);return db[_0x4c78('0x2b')]['find'](_0x4a4e1d)[_0x4c78('0x25')](handleEntityNotFound(_0x4026cf,null))[_0x4c78('0x25')](respondWithResult(_0x4026cf,null))['catch'](handleError(_0x4026cf,null));};exports[_0x4c78('0x48')]=function(_0x26a2bf,_0x5ef701){return db[_0x4c78('0x2b')][_0x4c78('0x48')](_0x26a2bf[_0x4c78('0x49')],{})[_0x4c78('0x25')](respondWithResult(_0x5ef701,0xc9))[_0x4c78('0x43')](handleError(_0x5ef701,null));};exports[_0x4c78('0x24')]=function(_0x3a9a7f,_0x291b9d){if(_0x3a9a7f[_0x4c78('0x49')]['id']){delete _0x3a9a7f[_0x4c78('0x49')]['id'];}return db['ServicenowConfiguration'][_0x4c78('0x4a')]({'where':{'id':_0x3a9a7f[_0x4c78('0x45')]['id']}})['then'](handleEntityNotFound(_0x291b9d,null))['then'](saveUpdates(_0x3a9a7f[_0x4c78('0x49')],null))['then'](respondWithResult(_0x291b9d,null))[_0x4c78('0x43')](handleError(_0x291b9d,null));};exports[_0x4c78('0x26')]=function(_0x44f0d9,_0x366226){return db['ServicenowConfiguration'][_0x4c78('0x4a')]({'where':{'id':_0x44f0d9[_0x4c78('0x45')]['id']}})[_0x4c78('0x25')](handleEntityNotFound(_0x366226,null))[_0x4c78('0x25')](removeEntity(_0x366226,null))['catch'](handleError(_0x366226,null));};exports['getFields']=function(_0x10f4a4,_0x538155,_0xa5bd8d){var _0x3d3bf4={};var _0x1f57bc={};var _0x13b612;var _0x633515;return db[_0x4c78('0x2b')][_0x4c78('0x4b')]({'where':{'id':_0x10f4a4['params']['id']}})[_0x4c78('0x25')](handleEntityNotFound(_0x538155,null))[_0x4c78('0x25')](function(_0x4dffe7){if(_0x4dffe7){_0x13b612=_0x4dffe7;_0x1f57bc[_0x4c78('0x2f')]=_[_0x4c78('0x31')](db[_0x4c78('0x4c')][_0x4c78('0x2c')]);_0x1f57bc[_0x4c78('0x30')]=_[_0x4c78('0x31')](_0x10f4a4['query']);_0x1f57bc['filters']=_['intersection'](_0x1f57bc['model'],_0x1f57bc['query']);_0x3d3bf4[_0x4c78('0x47')]=_[_0x4c78('0x33')](_0x1f57bc['model'],qs['fields'](_0x10f4a4[_0x4c78('0x30')][_0x4c78('0x46')]));_0x3d3bf4['attributes']=_0x3d3bf4[_0x4c78('0x47')][_0x4c78('0x34')]?_0x3d3bf4['attributes']:_0x1f57bc['model'];_0x3d3bf4['order']=qs[_0x4c78('0x38')](_0x10f4a4[_0x4c78('0x30')][_0x4c78('0x38')]);_0x3d3bf4[_0x4c78('0x39')]=qs[_0x4c78('0x32')](_[_0x4c78('0x3a')](_0x10f4a4[_0x4c78('0x30')],_0x1f57bc[_0x4c78('0x32')]));if(_0x10f4a4[_0x4c78('0x30')][_0x4c78('0x3b')]){_0x3d3bf4[_0x4c78('0x39')]=_['merge'](_0x3d3bf4['where'],{'$or':_[_0x4c78('0x2a')](_0x3d3bf4[_0x4c78('0x47')],function(_0x478faf){var _0x16b300={};_0x16b300[_0x478faf]={'$like':'%'+_0x10f4a4[_0x4c78('0x30')][_0x4c78('0x3b')]+'%'};return _0x16b300;})});}_0x3d3bf4=_['merge']({},_0x3d3bf4,_0x10f4a4[_0x4c78('0x3e')]);return _0x13b612[_0x4c78('0x4d')](_0x3d3bf4);}})[_0x4c78('0x25')](function(_0x303047){if(_0x303047){_0x633515=_0x303047['length'];if(!_0x10f4a4[_0x4c78('0x30')]['hasOwnProperty'](_0x4c78('0x36'))){_0x3d3bf4['limit']=qs[_0x4c78('0x20')](_0x10f4a4['query'][_0x4c78('0x20')]);_0x3d3bf4['offset']=qs[_0x4c78('0x1e')](_0x10f4a4[_0x4c78('0x30')][_0x4c78('0x1e')]);}return _0x13b612[_0x4c78('0x4d')](_0x3d3bf4);}})[_0x4c78('0x25')](function(_0x344424){if(_0x344424){return _0x344424?{'count':_0x633515,'rows':_0x344424}:null;}})[_0x4c78('0x25')](respondWithResult(_0x538155,null))[_0x4c78('0x43')](handleError(_0x538155,null));};exports[_0x4c78('0x4e')]=function(_0x4f0e15,_0x4b3474,_0x292bb3){var _0x152334={};var _0x354aef={};var _0x52a024;var _0x3d8217;return db[_0x4c78('0x2b')][_0x4c78('0x4b')]({'where':{'id':_0x4f0e15['params']['id']}})[_0x4c78('0x25')](handleEntityNotFound(_0x4b3474,null))['then'](function(_0x6bf753){if(_0x6bf753){_0x52a024=_0x6bf753;_0x354aef['model']=_[_0x4c78('0x31')](db[_0x4c78('0x4c')][_0x4c78('0x2c')]);_0x354aef['query']=_['keys'](_0x4f0e15[_0x4c78('0x30')]);_0x354aef[_0x4c78('0x32')]=_[_0x4c78('0x33')](_0x354aef[_0x4c78('0x2f')],_0x354aef['query']);_0x152334[_0x4c78('0x47')]=_[_0x4c78('0x33')](_0x354aef[_0x4c78('0x2f')],qs['fields'](_0x4f0e15[_0x4c78('0x30')]['fields']));_0x152334[_0x4c78('0x47')]=_0x152334[_0x4c78('0x47')][_0x4c78('0x34')]?_0x152334['attributes']:_0x354aef[_0x4c78('0x2f')];_0x152334[_0x4c78('0x37')]=qs[_0x4c78('0x38')](_0x4f0e15[_0x4c78('0x30')][_0x4c78('0x38')]);_0x152334[_0x4c78('0x39')]=qs[_0x4c78('0x32')](_[_0x4c78('0x3a')](_0x4f0e15['query'],_0x354aef[_0x4c78('0x32')]));if(_0x4f0e15[_0x4c78('0x30')][_0x4c78('0x3b')]){_0x152334[_0x4c78('0x39')]=_[_0x4c78('0x3d')](_0x152334[_0x4c78('0x39')],{'$or':_['map'](_0x152334[_0x4c78('0x47')],function(_0x19202c){var _0x18c7a5={};_0x18c7a5[_0x19202c]={'$like':'%'+_0x4f0e15[_0x4c78('0x30')][_0x4c78('0x3b')]+'%'};return _0x18c7a5;})});}_0x152334=_[_0x4c78('0x3d')]({},_0x152334,_0x4f0e15[_0x4c78('0x3e')]);return _0x52a024[_0x4c78('0x4e')](_0x152334);}})[_0x4c78('0x25')](function(_0x3485e2){if(_0x3485e2){_0x3d8217=_0x3485e2[_0x4c78('0x34')];if(!_0x4f0e15['query'][_0x4c78('0x35')](_0x4c78('0x36'))){_0x152334[_0x4c78('0x20')]=qs[_0x4c78('0x20')](_0x4f0e15[_0x4c78('0x30')][_0x4c78('0x20')]);_0x152334[_0x4c78('0x1e')]=qs[_0x4c78('0x1e')](_0x4f0e15[_0x4c78('0x30')][_0x4c78('0x1e')]);}return _0x52a024[_0x4c78('0x4e')](_0x152334);}})[_0x4c78('0x25')](function(_0x2df667){if(_0x2df667){return _0x2df667?{'count':_0x3d8217,'rows':_0x2df667}:null;}})['then'](respondWithResult(_0x4b3474,null))[_0x4c78('0x43')](handleError(_0x4b3474,null));};exports[_0x4c78('0x4f')]=function(_0x116aa2,_0x364cda,_0x10c238){var _0x1f5ea5={};var _0x49f126={};var _0x5dedd0;var _0x480552;return db['ServicenowConfiguration'][_0x4c78('0x4b')]({'where':{'id':_0x116aa2[_0x4c78('0x45')]['id']}})[_0x4c78('0x25')](handleEntityNotFound(_0x364cda,null))['then'](function(_0x2deb19){if(_0x2deb19){_0x5dedd0=_0x2deb19;_0x49f126['model']=_[_0x4c78('0x31')](db[_0x4c78('0x4c')][_0x4c78('0x2c')]);_0x49f126['query']=_['keys'](_0x116aa2[_0x4c78('0x30')]);_0x49f126[_0x4c78('0x32')]=_['intersection'](_0x49f126['model'],_0x49f126[_0x4c78('0x30')]);_0x1f5ea5[_0x4c78('0x47')]=_[_0x4c78('0x33')](_0x49f126[_0x4c78('0x2f')],qs['fields'](_0x116aa2[_0x4c78('0x30')][_0x4c78('0x46')]));_0x1f5ea5[_0x4c78('0x47')]=_0x1f5ea5[_0x4c78('0x47')][_0x4c78('0x34')]?_0x1f5ea5['attributes']:_0x49f126[_0x4c78('0x2f')];_0x1f5ea5[_0x4c78('0x37')]=qs[_0x4c78('0x38')](_0x116aa2[_0x4c78('0x30')][_0x4c78('0x38')]);_0x1f5ea5[_0x4c78('0x39')]=qs[_0x4c78('0x32')](_['pick'](_0x116aa2[_0x4c78('0x30')],_0x49f126[_0x4c78('0x32')]));if(_0x116aa2['query'][_0x4c78('0x3b')]){_0x1f5ea5[_0x4c78('0x39')]=_['merge'](_0x1f5ea5['where'],{'$or':_[_0x4c78('0x2a')](_0x1f5ea5[_0x4c78('0x47')],function(_0x1f0605){var _0x312a16={};_0x312a16[_0x1f0605]={'$like':'%'+_0x116aa2['query'][_0x4c78('0x3b')]+'%'};return _0x312a16;})});}_0x1f5ea5=_[_0x4c78('0x3d')]({},_0x1f5ea5,_0x116aa2[_0x4c78('0x3e')]);return _0x5dedd0[_0x4c78('0x4f')](_0x1f5ea5);}})[_0x4c78('0x25')](function(_0x14cb3f){if(_0x14cb3f){_0x480552=_0x14cb3f[_0x4c78('0x34')];if(!_0x116aa2[_0x4c78('0x30')][_0x4c78('0x35')]('nolimit')){_0x1f5ea5[_0x4c78('0x20')]=qs[_0x4c78('0x20')](_0x116aa2['query'][_0x4c78('0x20')]);_0x1f5ea5[_0x4c78('0x1e')]=qs[_0x4c78('0x1e')](_0x116aa2[_0x4c78('0x30')]['offset']);}return _0x5dedd0['getDescriptions'](_0x1f5ea5);}})[_0x4c78('0x25')](function(_0x21763f){if(_0x21763f){return _0x21763f?{'count':_0x480552,'rows':_0x21763f}:null;}})[_0x4c78('0x25')](respondWithResult(_0x364cda,null))[_0x4c78('0x43')](handleError(_0x364cda,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 3e33234..95ea74f 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 _0x4dd3=['rimraf','../../config/environment','exports','define','ServicenowConfiguration','lodash','util','../../config/logger','bluebird','path'];(function(_0x40efb5,_0xb02aad){var _0x1efa21=function(_0x4101e7){while(--_0x4101e7){_0x40efb5['push'](_0x40efb5['shift']());}};_0x1efa21(++_0xb02aad);}(_0x4dd3,0xf5));var _0x34dd=function(_0x2300c7,_0x255f74){_0x2300c7=_0x2300c7-0x0;var _0x23f720=_0x4dd3[_0x2300c7];return _0x23f720;};'use strict';var _=require(_0x34dd('0x0'));var util=require(_0x34dd('0x1'));var logger=require(_0x34dd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x34dd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34dd('0x4'));var rimraf=require(_0x34dd('0x5'));var config=require(_0x34dd('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x34dd('0x7')]=function(_0x704165,_0x37ce1d){return _0x704165[_0x34dd('0x8')](_0x34dd('0x9'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f2f=['request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','../../config/logger','api','bluebird'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0x4f2f,0x1cb));var _0xf4f2=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x4f2f[_0xa6cc5c];return _0x44803d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf4f2('0x0'))(_0xf4f2('0x1'));var moment=require('moment');var BPromise=require(_0xf4f2('0x2'));var rp=require(_0xf4f2('0x3'));var fs=require('fs');var path=require(_0xf4f2('0x4'));var rimraf=require(_0xf4f2('0x5'));var config=require(_0xf4f2('0x6'));var attributes=require(_0xf4f2('0x7'));module[_0xf4f2('0x8')]=function(_0x2d7c29,_0x1e0ceb){return _0x2d7c29[_0xf4f2('0x9')](_0xf4f2('0xa'),attributes,{'tableName':'int_servicenow_configurations','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 4516a26..0ff5311 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 _0x3e1f=['../../config/utils','rpc','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x57641b,_0x52aeb2){var _0x16497f=function(_0x5ee945){while(--_0x5ee945){_0x57641b['push'](_0x57641b['shift']());}};_0x16497f(++_0x52aeb2);}(_0x3e1f,0x127));var _0xf3e1=function(_0x43e4b3,_0x1444de){_0x43e4b3=_0x43e4b3-0x0;var _0x10c655=_0x3e1f[_0x43e4b3];return _0x10c655;};'use strict';var _=require(_0xf3e1('0x0'));var util=require(_0xf3e1('0x1'));var moment=require(_0xf3e1('0x2'));var BPromise=require(_0xf3e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf3e1('0x4'))['db'];var utils=require(_0xf3e1('0x5'));var logger=require('../../config/logger')(_0xf3e1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf3e1('0x7')][_0xf3e1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x384b3e,_0x1d1a41,_0x5e0b42){return new BPromise(function(_0x4c95b7,_0x3662d1){return client[_0xf3e1('0x9')](_0x384b3e,_0x5e0b42)[_0xf3e1('0xa')](function(_0xaeea4c){logger['info'](_0xf3e1('0xb'),_0x1d1a41,_0xf3e1('0xc'));logger[_0xf3e1('0xd')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x1d1a41,_0xf3e1('0xc'),JSON['stringify'](_0xaeea4c));if(_0xaeea4c[_0xf3e1('0xe')]){if(_0xaeea4c['error'][_0xf3e1('0xf')]===0x1f4){logger[_0xf3e1('0xe')](_0xf3e1('0xb'),_0x1d1a41,_0xaeea4c['error'][_0xf3e1('0x10')]);return _0x3662d1(_0xaeea4c[_0xf3e1('0xe')]['message']);}logger[_0xf3e1('0xe')](_0xf3e1('0xb'),_0x1d1a41,_0xaeea4c[_0xf3e1('0xe')]['message']);return _0x4c95b7(_0xaeea4c[_0xf3e1('0xe')]['message']);}else{logger[_0xf3e1('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1d1a41,_0xf3e1('0xc'));_0x4c95b7(_0xaeea4c[_0xf3e1('0x12')][_0xf3e1('0x10')]);}})[_0xf3e1('0x13')](function(_0x6da250){logger[_0xf3e1('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1d1a41,_0x6da250);_0x3662d1(_0x6da250);});});} \ No newline at end of file +var _0x5c91=['code','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5c91,0x1e9));var _0x15c9=function(_0x3e7c63,_0x50abe9){_0x3e7c63=_0x3e7c63-0x0;var _0x156116=_0x5c91[_0x3e7c63];return _0x156116;};'use strict';var _=require(_0x15c9('0x0'));var util=require(_0x15c9('0x1'));var moment=require(_0x15c9('0x2'));var BPromise=require('bluebird');var rs=require(_0x15c9('0x3'));var fs=require('fs');var Redis=require(_0x15c9('0x4'));var db=require(_0x15c9('0x5'))['db'];var utils=require(_0x15c9('0x6'));var logger=require(_0x15c9('0x7'))(_0x15c9('0x8'));var config=require('../../config/environment');var jayson=require(_0x15c9('0x9'));var client=jayson[_0x15c9('0xa')][_0x15c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42bcb6,_0x2c213e,_0x51a779){return new BPromise(function(_0x191695,_0x114775){return client[_0x15c9('0xc')](_0x42bcb6,_0x51a779)['then'](function(_0x23adaf){logger[_0x15c9('0xd')](_0x15c9('0xe'),_0x2c213e,'request\x20sent');logger['debug'](_0x15c9('0xf'),_0x2c213e,_0x15c9('0x10'),JSON['stringify'](_0x23adaf));if(_0x23adaf['error']){if(_0x23adaf['error'][_0x15c9('0x11')]===0x1f4){logger[_0x15c9('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2c213e,_0x23adaf[_0x15c9('0x12')][_0x15c9('0x13')]);return _0x114775(_0x23adaf[_0x15c9('0x12')]['message']);}logger['error'](_0x15c9('0xe'),_0x2c213e,_0x23adaf[_0x15c9('0x12')]['message']);return _0x191695(_0x23adaf[_0x15c9('0x12')]['message']);}else{logger[_0x15c9('0xd')](_0x15c9('0xe'),_0x2c213e,_0x15c9('0x10'));_0x191695(_0x23adaf[_0x15c9('0x14')][_0x15c9('0x13')]);}})[_0x15c9('0x15')](function(_0x5eb50e){logger[_0x15c9('0x12')](_0x15c9('0xe'),_0x2c213e,_0x5eb50e);_0x114775(_0x5eb50e);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 20e2399..a857cd2 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 _0x0cb7=['Router','fs-extra','../../components/auth/service','./intServicenowField.controller','get','isAuthenticated','show','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3768ec,_0xcb51b7){var _0x5cf7d6=function(_0x7cb2b4){while(--_0x7cb2b4){_0x3768ec['push'](_0x3768ec['shift']());}};_0x5cf7d6(++_0xcb51b7);}(_0x0cb7,0x109));var _0x70cb=function(_0xf3d379,_0x6ce552){_0xf3d379=_0xf3d379-0x0;var _0x4107a1=_0x0cb7[_0xf3d379];return _0x4107a1;};'use strict';var multer=require(_0x70cb('0x0'));var util=require(_0x70cb('0x1'));var path=require(_0x70cb('0x2'));var timeout=require(_0x70cb('0x3'));var express=require(_0x70cb('0x4'));var router=express[_0x70cb('0x5')]();var fs_extra=require(_0x70cb('0x6'));var auth=require(_0x70cb('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x70cb('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x70cb('0x9')]('/:id',auth[_0x70cb('0xa')](),controller[_0x70cb('0xb')]);router['post']('/',auth[_0x70cb('0xa')](),controller[_0x70cb('0xc')]);router['put'](_0x70cb('0xd'),auth['isAuthenticated'](),controller[_0x70cb('0xe')]);router[_0x70cb('0xf')](_0x70cb('0xd'),auth[_0x70cb('0xa')](),controller[_0x70cb('0x10')]);module[_0x70cb('0x11')]=router; \ No newline at end of file +var _0xea1b=['fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','isAuthenticated','index','get','/:id','create','put','update','delete','destroy','multer','util','connect-timeout','Router'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xea1b,0x11d));var _0xbea1=function(_0x1b222a,_0x322af6){_0x1b222a=_0x1b222a-0x0;var _0x1ca16b=_0xea1b[_0x1b222a];return _0x1ca16b;};'use strict';var multer=require(_0xbea1('0x0'));var util=require(_0xbea1('0x1'));var path=require('path');var timeout=require(_0xbea1('0x2'));var express=require('express');var router=express[_0xbea1('0x3')]();var fs_extra=require(_0xbea1('0x4'));var auth=require(_0xbea1('0x5'));var interaction=require(_0xbea1('0x6'));var config=require('../../config/environment');var controller=require(_0xbea1('0x7'));router['get']('/',auth[_0xbea1('0x8')](),controller[_0xbea1('0x9')]);router[_0xbea1('0xa')](_0xbea1('0xb'),auth[_0xbea1('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbea1('0xc')]);router[_0xbea1('0xd')]('/:id',auth[_0xbea1('0x8')](),controller[_0xbea1('0xe')]);router[_0xbea1('0xf')](_0xbea1('0xb'),auth[_0xbea1('0x8')](),controller[_0xbea1('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 6a8db25..6c739d4 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 _0xdf2d=['STRING','customVariable','BOOLEAN','sequelize','ENUM','string','variable','keyValue'];(function(_0xf16b1,_0x33c637){var _0x26f94d=function(_0x5643d7){while(--_0x5643d7){_0xf16b1['push'](_0xf16b1['shift']());}};_0x26f94d(++_0x33c637);}(_0xdf2d,0x1db));var _0xddf2=function(_0x4910cc,_0x4d2b2c){_0x4910cc=_0x4910cc-0x0;var _0xdcffb8=_0xdf2d[_0x4910cc];return _0xdcffb8;};'use strict';var Sequelize=require(_0xddf2('0x0'));module['exports']={'type':{'type':Sequelize[_0xddf2('0x1')](_0xddf2('0x2'),_0xddf2('0x3'),'customVariable',_0xddf2('0x4'),'picklist'),'defaultValue':_0xddf2('0x2')},'content':{'type':Sequelize[_0xddf2('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xddf2('0x1')]('string',_0xddf2('0x3'),_0xddf2('0x6'))},'keyContent':{'type':Sequelize[_0xddf2('0x5')]},'idField':{'type':Sequelize[_0xddf2('0x5')]},'nameField':{'type':Sequelize[_0xddf2('0x5')]},'customField':{'type':Sequelize[_0xddf2('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xddf2('0x5')]}}; \ No newline at end of file +var _0xaa71=['customVariable','keyValue','picklist','STRING','BOOLEAN','ENUM','string','variable'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xaa71,0xc5));var _0x1aa7=function(_0x5271bf,_0x2b3a4a){_0x5271bf=_0x5271bf-0x0;var _0x376191=_0xaa71[_0x5271bf];return _0x376191;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x1aa7('0x0')](_0x1aa7('0x1'),_0x1aa7('0x2'),_0x1aa7('0x3'),_0x1aa7('0x4'),_0x1aa7('0x5')),'defaultValue':_0x1aa7('0x1')},'content':{'type':Sequelize[_0x1aa7('0x6')]},'key':{'type':Sequelize[_0x1aa7('0x6')]},'keyType':{'type':Sequelize[_0x1aa7('0x0')](_0x1aa7('0x1'),_0x1aa7('0x2'),_0x1aa7('0x3'))},'keyContent':{'type':Sequelize[_0x1aa7('0x6')]},'idField':{'type':Sequelize[_0x1aa7('0x6')]},'nameField':{'type':Sequelize[_0x1aa7('0x6')]},'customField':{'type':Sequelize[_0x1aa7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1aa7('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index e34ab47..644329b 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 _0x1c87=['send','index','map','rawAttributes','fieldName','model','keys','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','ServicenowField','includeAll','include','findAll','catch','show','create','body','update','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','stack','name'];(function(_0x4c9e58,_0x469fea){var _0x413b0a=function(_0x5270d6){while(--_0x5270d6){_0x4c9e58['push'](_0x4c9e58['shift']());}};_0x413b0a(++_0x469fea);}(_0x1c87,0x70));var _0x71c8=function(_0xa2f006,_0x11c4aa){_0xa2f006=_0xa2f006-0x0;var _0x280e02=_0x1c87[_0xa2f006];return _0x280e02;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x71c8('0x0'));var zipdir=require(_0x71c8('0x1'));var jsonpatch=require(_0x71c8('0x2'));var rp=require(_0x71c8('0x3'));var moment=require(_0x71c8('0x4'));var BPromise=require(_0x71c8('0x5'));var Mustache=require(_0x71c8('0x6'));var util=require(_0x71c8('0x7'));var path=require(_0x71c8('0x8'));var sox=require(_0x71c8('0x9'));var csv=require(_0x71c8('0xa'));var ejs=require(_0x71c8('0xb'));var fs=require('fs');var fs_extra=require(_0x71c8('0xc'));var _=require(_0x71c8('0xd'));var squel=require(_0x71c8('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x71c8('0xf'));var toCsv=require(_0x71c8('0xa'));var querystring=require(_0x71c8('0x10'));var Papa=require(_0x71c8('0x11'));var Redis=require(_0x71c8('0x12'));var authService=require(_0x71c8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x71c8('0x14'));var hardwareService=require(_0x71c8('0x15'));var logger=require(_0x71c8('0x16'))(_0x71c8('0x17'));var utils=require('../../config/utils');var config=require(_0x71c8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x71c8('0x19'))['db'];function respondWithStatusCode(_0x2135dc,_0xe61b9c){_0xe61b9c=_0xe61b9c||0xcc;return function(_0x59548a){if(_0x59548a){return _0x2135dc[_0x71c8('0x1a')](_0xe61b9c);}return _0x2135dc['status'](_0xe61b9c)[_0x71c8('0x1b')]();};}function respondWithResult(_0x4f5697,_0x34eb95){_0x34eb95=_0x34eb95||0xc8;return function(_0xafaee2){if(_0xafaee2){return _0x4f5697[_0x71c8('0x1c')](_0x34eb95)[_0x71c8('0x1d')](_0xafaee2);}};}function respondWithFilteredResult(_0x140b98,_0x4e35f7){return function(_0x38cc0d){if(_0x38cc0d){var _0x343013=typeof _0x4e35f7[_0x71c8('0x1e')]===_0x71c8('0x1f')&&typeof _0x4e35f7[_0x71c8('0x20')]===_0x71c8('0x1f');var _0x4be767=_0x38cc0d[_0x71c8('0x21')];var _0x55eb45=_0x343013?0x0:_0x4e35f7['offset'];var _0x46113e=_0x343013?_0x38cc0d[_0x71c8('0x21')]:_0x4e35f7['offset']+_0x4e35f7['limit'];var _0xec064a;if(_0x46113e>=_0x4be767){_0x46113e=_0x4be767;_0xec064a=0xc8;}else{_0xec064a=0xce;}_0x140b98[_0x71c8('0x1c')](_0xec064a);return _0x140b98[_0x71c8('0x22')](_0x71c8('0x23'),_0x55eb45+'-'+_0x46113e+'/'+_0x4be767)[_0x71c8('0x1d')](_0x38cc0d);}return null;};}function patchUpdates(_0x3e8ac3){return function(_0x2ca474){try{jsonpatch[_0x71c8('0x24')](_0x2ca474,_0x3e8ac3,!![]);}catch(_0x3686e7){return BPromise[_0x71c8('0x25')](_0x3686e7);}return _0x2ca474['save']();};}function saveUpdates(_0x2bf4eb,_0x1f31e1){return function(_0x87d1e3){if(_0x87d1e3){return _0x87d1e3['update'](_0x2bf4eb)['then'](function(_0x11b24b){return _0x11b24b;});}return null;};}function removeEntity(_0x1f2922,_0xfc983a){return function(_0x334658){if(_0x334658){return _0x334658[_0x71c8('0x26')]()[_0x71c8('0x27')](function(){_0x1f2922['status'](0xcc)[_0x71c8('0x1b')]();});}};}function handleEntityNotFound(_0x447a73,_0x11b641){return function(_0x328c30){if(!_0x328c30){_0x447a73[_0x71c8('0x1a')](0x194);}return _0x328c30;};}function handleError(_0xd391a5,_0x567f27){_0x567f27=_0x567f27||0x1f4;return function(_0x19261f){logger['error'](_0x19261f[_0x71c8('0x28')]);if(_0x19261f['name']){delete _0x19261f[_0x71c8('0x29')];}_0xd391a5[_0x71c8('0x1c')](_0x567f27)[_0x71c8('0x2a')](_0x19261f);};}exports[_0x71c8('0x2b')]=function(_0x626355,_0x105be8){var _0x1fb4c3={},_0x51bc7e={},_0x1b7437={'count':0x0,'rows':[]};var _0x19a0ca=_[_0x71c8('0x2c')](db['ServicenowField'][_0x71c8('0x2d')],function(_0xe856fd){return{'name':_0xe856fd[_0x71c8('0x2e')],'type':_0xe856fd['type']['key']};});_0x51bc7e[_0x71c8('0x2f')]=_[_0x71c8('0x2c')](_0x19a0ca,'name');_0x51bc7e['query']=_[_0x71c8('0x30')](_0x626355['query']);_0x51bc7e['filters']=_['intersection'](_0x51bc7e['model'],_0x51bc7e[_0x71c8('0x31')]);_0x1fb4c3['attributes']=_[_0x71c8('0x32')](_0x51bc7e['model'],qs[_0x71c8('0x33')](_0x626355[_0x71c8('0x31')]['fields']));_0x1fb4c3['attributes']=_0x1fb4c3['attributes'][_0x71c8('0x34')]?_0x1fb4c3[_0x71c8('0x35')]:_0x51bc7e['model'];if(!_0x626355[_0x71c8('0x31')][_0x71c8('0x36')](_0x71c8('0x37'))){_0x1fb4c3[_0x71c8('0x20')]=qs[_0x71c8('0x20')](_0x626355[_0x71c8('0x31')][_0x71c8('0x20')]);_0x1fb4c3[_0x71c8('0x1e')]=qs['offset'](_0x626355[_0x71c8('0x31')]['offset']);}_0x1fb4c3[_0x71c8('0x38')]=qs[_0x71c8('0x39')](_0x626355[_0x71c8('0x31')]['sort']);_0x1fb4c3[_0x71c8('0x3a')]=qs[_0x71c8('0x3b')](_[_0x71c8('0x3c')](_0x626355[_0x71c8('0x31')],_0x51bc7e['filters']),_0x19a0ca);if(_0x626355[_0x71c8('0x31')][_0x71c8('0x3d')]){_0x1fb4c3[_0x71c8('0x3a')]=_[_0x71c8('0x3e')](_0x1fb4c3[_0x71c8('0x3a')],{'$or':_[_0x71c8('0x2c')](_0x19a0ca,function(_0x5e81d1){if(_0x5e81d1[_0x71c8('0x3f')]!==_0x71c8('0x40')){var _0x19ff26={};_0x19ff26[_0x5e81d1[_0x71c8('0x29')]]={'$like':'%'+_0x626355[_0x71c8('0x31')][_0x71c8('0x3d')]+'%'};return _0x19ff26;}})});}_0x1fb4c3=_[_0x71c8('0x3e')]({},_0x1fb4c3,_0x626355[_0x71c8('0x41')]);var _0x989f4e={'where':_0x1fb4c3[_0x71c8('0x3a')]};return db[_0x71c8('0x42')][_0x71c8('0x21')](_0x989f4e)[_0x71c8('0x27')](function(_0x16c3b6){_0x1b7437[_0x71c8('0x21')]=_0x16c3b6;if(_0x626355['query'][_0x71c8('0x43')]){_0x1fb4c3[_0x71c8('0x44')]=[{'all':!![]}];}return db[_0x71c8('0x42')][_0x71c8('0x45')](_0x1fb4c3);})[_0x71c8('0x27')](function(_0x5ef4d0){_0x1b7437['rows']=_0x5ef4d0;return _0x1b7437;})[_0x71c8('0x27')](respondWithFilteredResult(_0x105be8,_0x1fb4c3))[_0x71c8('0x46')](handleError(_0x105be8,null));};exports[_0x71c8('0x47')]=function(_0x4b5c95,_0x30013f){var _0x3ab938={'raw':!![],'where':{'id':_0x4b5c95['params']['id']}},_0x46a96d={};_0x46a96d['model']=_['keys'](db[_0x71c8('0x42')]['rawAttributes']);_0x46a96d[_0x71c8('0x31')]=_[_0x71c8('0x30')](_0x4b5c95[_0x71c8('0x31')]);_0x46a96d[_0x71c8('0x3b')]=_[_0x71c8('0x32')](_0x46a96d[_0x71c8('0x2f')],_0x46a96d['query']);_0x3ab938[_0x71c8('0x35')]=_[_0x71c8('0x32')](_0x46a96d[_0x71c8('0x2f')],qs[_0x71c8('0x33')](_0x4b5c95['query'][_0x71c8('0x33')]));_0x3ab938[_0x71c8('0x35')]=_0x3ab938[_0x71c8('0x35')]['length']?_0x3ab938[_0x71c8('0x35')]:_0x46a96d[_0x71c8('0x2f')];if(_0x4b5c95[_0x71c8('0x31')][_0x71c8('0x43')]){_0x3ab938['include']=[{'all':!![]}];}_0x3ab938=_[_0x71c8('0x3e')]({},_0x3ab938,_0x4b5c95[_0x71c8('0x41')]);return db[_0x71c8('0x42')]['find'](_0x3ab938)['then'](handleEntityNotFound(_0x30013f,null))[_0x71c8('0x27')](respondWithResult(_0x30013f,null))['catch'](handleError(_0x30013f,null));};exports['create']=function(_0x46b58c,_0x142f6e){return db['ServicenowField'][_0x71c8('0x48')](_0x46b58c[_0x71c8('0x49')],{})['then'](respondWithResult(_0x142f6e,0xc9))[_0x71c8('0x46')](handleError(_0x142f6e,null));};exports[_0x71c8('0x4a')]=function(_0x5470ed,_0xed62e6){if(_0x5470ed['body']['id']){delete _0x5470ed[_0x71c8('0x49')]['id'];}return db['ServicenowField'][_0x71c8('0x4b')]({'where':{'id':_0x5470ed[_0x71c8('0x4c')]['id']}})['then'](handleEntityNotFound(_0xed62e6,null))[_0x71c8('0x27')](saveUpdates(_0x5470ed[_0x71c8('0x49')],null))[_0x71c8('0x27')](respondWithResult(_0xed62e6,null))[_0x71c8('0x46')](handleError(_0xed62e6,null));};exports[_0x71c8('0x26')]=function(_0x51b36c,_0x323da0){return db[_0x71c8('0x42')][_0x71c8('0x4b')]({'where':{'id':_0x51b36c['params']['id']}})[_0x71c8('0x27')](handleEntityNotFound(_0x323da0,null))[_0x71c8('0x27')](removeEntity(_0x323da0,null))[_0x71c8('0x46')](handleError(_0x323da0,null));}; \ No newline at end of file +var _0x864f=['status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','end','error','stack','name','map','ServicenowField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','body','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x57a0e2,_0x34d072){var _0xd9e589=function(_0xdd9aa5){while(--_0xdd9aa5){_0x57a0e2['push'](_0x57a0e2['shift']());}};_0xd9e589(++_0x34d072);}(_0x864f,0x1ab));var _0xf864=function(_0x2f522f,_0x57e8c){_0x2f522f=_0x2f522f-0x0;var _0x4f1daa=_0x864f[_0x2f522f];return _0x4f1daa;};'use strict';var emlformat=require(_0xf864('0x0'));var rimraf=require(_0xf864('0x1'));var zipdir=require(_0xf864('0x2'));var jsonpatch=require(_0xf864('0x3'));var rp=require(_0xf864('0x4'));var moment=require(_0xf864('0x5'));var BPromise=require(_0xf864('0x6'));var Mustache=require(_0xf864('0x7'));var util=require(_0xf864('0x8'));var path=require(_0xf864('0x9'));var sox=require(_0xf864('0xa'));var csv=require('to-csv');var ejs=require(_0xf864('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf864('0xc'));var squel=require(_0xf864('0xd'));var crypto=require(_0xf864('0xe'));var jsforce=require(_0xf864('0xf'));var deskjs=require(_0xf864('0x10'));var toCsv=require(_0xf864('0x11'));var querystring=require(_0xf864('0x12'));var Papa=require(_0xf864('0x13'));var Redis=require(_0xf864('0x14'));var authService=require(_0xf864('0x15'));var qs=require(_0xf864('0x16'));var as=require(_0xf864('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf864('0x18'))(_0xf864('0x19'));var utils=require('../../config/utils');var config=require(_0xf864('0x1a'));var licenseUtil=require(_0xf864('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38aedb,_0x357a7f){_0x357a7f=_0x357a7f||0xcc;return function(_0x715d6d){if(_0x715d6d){return _0x38aedb[_0xf864('0x1c')](_0x357a7f);}return _0x38aedb[_0xf864('0x1d')](_0x357a7f)['end']();};}function respondWithResult(_0x2205a4,_0x4b9f0e){_0x4b9f0e=_0x4b9f0e||0xc8;return function(_0x58bd20){if(_0x58bd20){return _0x2205a4[_0xf864('0x1d')](_0x4b9f0e)['json'](_0x58bd20);}};}function respondWithFilteredResult(_0x21e9b7,_0x534c2c){return function(_0x5d17d5){if(_0x5d17d5){var _0x435c19=typeof _0x534c2c[_0xf864('0x1e')]===_0xf864('0x1f')&&typeof _0x534c2c[_0xf864('0x20')]===_0xf864('0x1f');var _0x3a7534=_0x5d17d5[_0xf864('0x21')];var _0x1b82cf=_0x435c19?0x0:_0x534c2c[_0xf864('0x1e')];var _0x80e031=_0x435c19?_0x5d17d5[_0xf864('0x21')]:_0x534c2c['offset']+_0x534c2c[_0xf864('0x20')];var _0x33b7d8;if(_0x80e031>=_0x3a7534){_0x80e031=_0x3a7534;_0x33b7d8=0xc8;}else{_0x33b7d8=0xce;}_0x21e9b7[_0xf864('0x1d')](_0x33b7d8);return _0x21e9b7[_0xf864('0x22')]('Content-Range',_0x1b82cf+'-'+_0x80e031+'/'+_0x3a7534)[_0xf864('0x23')](_0x5d17d5);}return null;};}function patchUpdates(_0x11cbf2){return function(_0x140247){try{jsonpatch[_0xf864('0x24')](_0x140247,_0x11cbf2,!![]);}catch(_0x5ea840){return BPromise[_0xf864('0x25')](_0x5ea840);}return _0x140247[_0xf864('0x26')]();};}function saveUpdates(_0x18d447,_0x1831b9){return function(_0x3fc635){if(_0x3fc635){return _0x3fc635[_0xf864('0x27')](_0x18d447)[_0xf864('0x28')](function(_0x49e7a3){return _0x49e7a3;});}return null;};}function removeEntity(_0x45ef71,_0x3cd313){return function(_0x2e890b){if(_0x2e890b){return _0x2e890b['destroy']()['then'](function(){_0x45ef71[_0xf864('0x1d')](0xcc)[_0xf864('0x29')]();});}};}function handleEntityNotFound(_0x24c407,_0x1ec043){return function(_0x5a748c){if(!_0x5a748c){_0x24c407[_0xf864('0x1c')](0x194);}return _0x5a748c;};}function handleError(_0x30916f,_0x129324){_0x129324=_0x129324||0x1f4;return function(_0x40c9f4){logger[_0xf864('0x2a')](_0x40c9f4[_0xf864('0x2b')]);if(_0x40c9f4['name']){delete _0x40c9f4[_0xf864('0x2c')];}_0x30916f[_0xf864('0x1d')](_0x129324)['send'](_0x40c9f4);};}exports['index']=function(_0x157714,_0x1236f1){var _0x132c73={},_0x74574e={},_0x2847aa={'count':0x0,'rows':[]};var _0x176cdb=_[_0xf864('0x2d')](db[_0xf864('0x2e')][_0xf864('0x2f')],function(_0x15dd4f){return{'name':_0x15dd4f[_0xf864('0x30')],'type':_0x15dd4f[_0xf864('0x31')]['key']};});_0x74574e[_0xf864('0x32')]=_[_0xf864('0x2d')](_0x176cdb,_0xf864('0x2c'));_0x74574e[_0xf864('0x33')]=_[_0xf864('0x34')](_0x157714['query']);_0x74574e[_0xf864('0x35')]=_[_0xf864('0x36')](_0x74574e[_0xf864('0x32')],_0x74574e[_0xf864('0x33')]);_0x132c73['attributes']=_[_0xf864('0x36')](_0x74574e[_0xf864('0x32')],qs['fields'](_0x157714[_0xf864('0x33')][_0xf864('0x37')]));_0x132c73[_0xf864('0x38')]=_0x132c73['attributes'][_0xf864('0x39')]?_0x132c73[_0xf864('0x38')]:_0x74574e[_0xf864('0x32')];if(!_0x157714[_0xf864('0x33')][_0xf864('0x3a')](_0xf864('0x3b'))){_0x132c73[_0xf864('0x20')]=qs['limit'](_0x157714['query'][_0xf864('0x20')]);_0x132c73[_0xf864('0x1e')]=qs[_0xf864('0x1e')](_0x157714['query']['offset']);}_0x132c73['order']=qs[_0xf864('0x3c')](_0x157714['query'][_0xf864('0x3c')]);_0x132c73[_0xf864('0x3d')]=qs[_0xf864('0x35')](_[_0xf864('0x3e')](_0x157714[_0xf864('0x33')],_0x74574e[_0xf864('0x35')]),_0x176cdb);if(_0x157714[_0xf864('0x33')][_0xf864('0x3f')]){_0x132c73[_0xf864('0x3d')]=_[_0xf864('0x40')](_0x132c73[_0xf864('0x3d')],{'$or':_[_0xf864('0x2d')](_0x176cdb,function(_0x22a434){if(_0x22a434[_0xf864('0x31')]!==_0xf864('0x41')){var _0x4aaa0e={};_0x4aaa0e[_0x22a434[_0xf864('0x2c')]]={'$like':'%'+_0x157714[_0xf864('0x33')][_0xf864('0x3f')]+'%'};return _0x4aaa0e;}})});}_0x132c73=_[_0xf864('0x40')]({},_0x132c73,_0x157714['options']);var _0x4a54a2={'where':_0x132c73[_0xf864('0x3d')]};return db[_0xf864('0x2e')][_0xf864('0x21')](_0x4a54a2)[_0xf864('0x28')](function(_0x280adc){_0x2847aa[_0xf864('0x21')]=_0x280adc;if(_0x157714[_0xf864('0x33')][_0xf864('0x42')]){_0x132c73[_0xf864('0x43')]=[{'all':!![]}];}return db[_0xf864('0x2e')][_0xf864('0x44')](_0x132c73);})['then'](function(_0xcac0a4){_0x2847aa[_0xf864('0x45')]=_0xcac0a4;return _0x2847aa;})[_0xf864('0x28')](respondWithFilteredResult(_0x1236f1,_0x132c73))['catch'](handleError(_0x1236f1,null));};exports[_0xf864('0x46')]=function(_0x10079c,_0x9a0373){var _0x39f0cd={'raw':!![],'where':{'id':_0x10079c[_0xf864('0x47')]['id']}},_0x22e863={};_0x22e863[_0xf864('0x32')]=_[_0xf864('0x34')](db[_0xf864('0x2e')][_0xf864('0x2f')]);_0x22e863[_0xf864('0x33')]=_[_0xf864('0x34')](_0x10079c[_0xf864('0x33')]);_0x22e863['filters']=_[_0xf864('0x36')](_0x22e863[_0xf864('0x32')],_0x22e863[_0xf864('0x33')]);_0x39f0cd['attributes']=_[_0xf864('0x36')](_0x22e863[_0xf864('0x32')],qs[_0xf864('0x37')](_0x10079c['query'][_0xf864('0x37')]));_0x39f0cd['attributes']=_0x39f0cd[_0xf864('0x38')][_0xf864('0x39')]?_0x39f0cd[_0xf864('0x38')]:_0x22e863[_0xf864('0x32')];if(_0x10079c[_0xf864('0x33')][_0xf864('0x42')]){_0x39f0cd[_0xf864('0x43')]=[{'all':!![]}];}_0x39f0cd=_[_0xf864('0x40')]({},_0x39f0cd,_0x10079c[_0xf864('0x48')]);return db['ServicenowField'][_0xf864('0x49')](_0x39f0cd)['then'](handleEntityNotFound(_0x9a0373,null))[_0xf864('0x28')](respondWithResult(_0x9a0373,null))[_0xf864('0x4a')](handleError(_0x9a0373,null));};exports['create']=function(_0x39fcbf,_0x4c0faf){return db[_0xf864('0x2e')]['create'](_0x39fcbf[_0xf864('0x4b')],{})['then'](respondWithResult(_0x4c0faf,0xc9))[_0xf864('0x4a')](handleError(_0x4c0faf,null));};exports['update']=function(_0x5ca194,_0x3f0b53){if(_0x5ca194[_0xf864('0x4b')]['id']){delete _0x5ca194[_0xf864('0x4b')]['id'];}return db[_0xf864('0x2e')][_0xf864('0x49')]({'where':{'id':_0x5ca194[_0xf864('0x47')]['id']}})[_0xf864('0x28')](handleEntityNotFound(_0x3f0b53,null))[_0xf864('0x28')](saveUpdates(_0x5ca194['body'],null))[_0xf864('0x28')](respondWithResult(_0x3f0b53,null))[_0xf864('0x4a')](handleError(_0x3f0b53,null));};exports['destroy']=function(_0x56ecf5,_0x10108b){return db[_0xf864('0x2e')][_0xf864('0x49')]({'where':{'id':_0x56ecf5['params']['id']}})['then'](handleEntityNotFound(_0x10108b,null))['then'](removeEntity(_0x10108b,null))['catch'](handleError(_0x10108b,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index f1aa5b6..92752c4 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 _0x3876=['bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','util','api','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3876,0x1a1));var _0x6387=function(_0x433448,_0x24bba5){_0x433448=_0x433448-0x0;var _0x5a0f03=_0x3876[_0x433448];return _0x5a0f03;};'use strict';var _=require('lodash');var util=require(_0x6387('0x0'));var logger=require('../../config/logger')(_0x6387('0x1'));var moment=require(_0x6387('0x2'));var BPromise=require(_0x6387('0x3'));var rp=require(_0x6387('0x4'));var fs=require('fs');var path=require(_0x6387('0x5'));var rimraf=require(_0x6387('0x6'));var config=require(_0x6387('0x7'));var attributes=require(_0x6387('0x8'));module[_0x6387('0x9')]=function(_0x5a5589,_0x55f4e9){return _0x5a5589['define'](_0x6387('0xa'),attributes,{'tableName':_0x6387('0xb'),'paranoid':![],'indexes':[{'name':_0x6387('0xc'),'fields':[_0x6387('0xd'),_0x6387('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d0c=['int_servicenow_fields','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x8d0c,0x169));var _0xc8d0=function(_0xfec94,_0xff75ca){_0xfec94=_0xfec94-0x0;var _0x4858cc=_0x8d0c[_0xfec94];return _0x4858cc;};'use strict';var _=require(_0xc8d0('0x0'));var util=require(_0xc8d0('0x1'));var logger=require(_0xc8d0('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc8d0('0x3'));var fs=require('fs');var path=require(_0xc8d0('0x4'));var rimraf=require(_0xc8d0('0x5'));var config=require(_0xc8d0('0x6'));var attributes=require(_0xc8d0('0x7'));module[_0xc8d0('0x8')]=function(_0x5a5d5c,_0x2d9168){return _0x5a5d5c[_0xc8d0('0x9')](_0xc8d0('0xa'),attributes,{'tableName':_0xc8d0('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField','FieldId'],'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 8f815e5..ced4433 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x156e99,_0x2bf27e){var _0x18870e=function(_0x3e6c3b){while(--_0x3e6c3b){_0x156e99['push'](_0x156e99['shift']());}};_0x18870e(++_0x2bf27e);}(_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 moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0x9bde=['code','message','ServicenowField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x51b229,_0x3254a9){var _0x2726c2=function(_0x982c50){while(--_0x982c50){_0x51b229['push'](_0x51b229['shift']());}};_0x2726c2(++_0x3254a9);}(_0x9bde,0xe1));var _0xe9bd=function(_0x24a493,_0x4ce9ec){_0x24a493=_0x24a493-0x0;var _0x3c676d=_0x9bde[_0x24a493];return _0x3c676d;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('ServicenowField,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index d0c9a94..9537457 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(_0x1233ed,_0x1e4366){var _0xffb63d=function(_0x3e4119){while(--_0x3e4119){_0x1233ed['push'](_0x1233ed['shift']());}};_0xffb63d(++_0x1e4366);}(_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('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0xa52dbd,_0x386625){var _0x3fa0a2=function(_0x392864){while(--_0x392864){_0xa52dbd['push'](_0xa52dbd['shift']());}};_0x3fa0a2(++_0x386625);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 90c3228..82a3774 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(_0x54424e,_0x5ac5cd){var _0x3fdb60=function(_0x2fc0e9){while(--_0x2fc0e9){_0x54424e['push'](_0x54424e['shift']());}};_0x3fdb60(++_0x5ac5cd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x32cd07,_0x431e6a){var _0x546bf7=function(_0x28c3bd){while(--_0x28c3bd){_0x32cd07['push'](_0x32cd07['shift']());}};_0x546bf7(++_0x431e6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 2f5816d..c3e275a 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 _0x552a=['Calls','values','module_fields','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','update','then','error','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','destroy','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','username','password','remoteUri','slice','POST','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','format','%s%s','get_module_fields'];(function(_0x5810f0,_0x52406d){var _0x526565=function(_0x2bdfef){while(--_0x2bdfef){_0x5810f0['push'](_0x5810f0['shift']());}};_0x526565(++_0x52406d);}(_0x552a,0xfd));var _0xa552=function(_0x364106,_0x7c7fff){_0x364106=_0x364106-0x0;var _0x39dc9e=_0x552a[_0x364106];return _0x39dc9e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa552('0x0'));var zipdir=require(_0xa552('0x1'));var jsonpatch=require(_0xa552('0x2'));var rp=require(_0xa552('0x3'));var moment=require(_0xa552('0x4'));var BPromise=require(_0xa552('0x5'));var Mustache=require(_0xa552('0x6'));var util=require('util');var path=require(_0xa552('0x7'));var sox=require(_0xa552('0x8'));var csv=require('to-csv');var ejs=require(_0xa552('0x9'));var fs=require('fs');var fs_extra=require(_0xa552('0xa'));var _=require(_0xa552('0xb'));var squel=require('squel');var crypto=require(_0xa552('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa552('0xd'));var toCsv=require(_0xa552('0xe'));var querystring=require(_0xa552('0xf'));var Papa=require(_0xa552('0x10'));var Redis=require(_0xa552('0x11'));var authService=require(_0xa552('0x12'));var qs=require(_0xa552('0x13'));var as=require(_0xa552('0x14'));var hardwareService=require(_0xa552('0x15'));var logger=require(_0xa552('0x16'))(_0xa552('0x17'));var utils=require(_0xa552('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa552('0x19'))['db'];var integrations=require(_0xa552('0x1a'));function respondWithStatusCode(_0x44fe04,_0x393c18){_0x393c18=_0x393c18||0xcc;return function(_0x23bc95){if(_0x23bc95){return _0x44fe04[_0xa552('0x1b')](_0x393c18);}return _0x44fe04['status'](_0x393c18)[_0xa552('0x1c')]();};}function respondWithResult(_0x2ed25c,_0x11a158){_0x11a158=_0x11a158||0xc8;return function(_0x53d6c4){if(_0x53d6c4){return _0x2ed25c[_0xa552('0x1d')](_0x11a158)[_0xa552('0x1e')](_0x53d6c4);}};}function respondWithFilteredResult(_0x599fb5,_0x32e5c5){return function(_0x592622){if(_0x592622){var _0xb35227=typeof _0x32e5c5['offset']==='undefined'&&typeof _0x32e5c5[_0xa552('0x1f')]===_0xa552('0x20');var _0x3dbb55=_0x592622['count'];var _0x41f602=_0xb35227?0x0:_0x32e5c5['offset'];var _0x2fcc9d=_0xb35227?_0x592622[_0xa552('0x21')]:_0x32e5c5[_0xa552('0x22')]+_0x32e5c5[_0xa552('0x1f')];var _0x35a131;if(_0x2fcc9d>=_0x3dbb55){_0x2fcc9d=_0x3dbb55;_0x35a131=0xc8;}else{_0x35a131=0xce;}_0x599fb5[_0xa552('0x1d')](_0x35a131);return _0x599fb5[_0xa552('0x23')](_0xa552('0x24'),_0x41f602+'-'+_0x2fcc9d+'/'+_0x3dbb55)[_0xa552('0x1e')](_0x592622);}return null;};}function patchUpdates(_0x520d9f){return function(_0x204a22){try{jsonpatch[_0xa552('0x25')](_0x204a22,_0x520d9f,!![]);}catch(_0x2afc46){return BPromise['reject'](_0x2afc46);}return _0x204a22['save']();};}function saveUpdates(_0xc91beb,_0x516cd5){return function(_0x2bfc78){if(_0x2bfc78){return _0x2bfc78[_0xa552('0x26')](_0xc91beb)[_0xa552('0x27')](function(_0x5ed5e7){return _0x5ed5e7;});}return null;};}function removeEntity(_0x3f2f55,_0x20ba59){return function(_0x51ff8e){if(_0x51ff8e){return _0x51ff8e['destroy']()[_0xa552('0x27')](function(){_0x3f2f55['status'](0xcc)[_0xa552('0x1c')]();});}};}function handleEntityNotFound(_0x149e10,_0x37117e){return function(_0x11319c){if(!_0x11319c){_0x149e10[_0xa552('0x1b')](0x194);}return _0x11319c;};}function handleError(_0x6795c4,_0x20c52a){_0x20c52a=_0x20c52a||0x1f4;return function(_0x5bd200){logger[_0xa552('0x28')](_0x5bd200['stack']);if(_0x5bd200['name']){delete _0x5bd200[_0xa552('0x29')];}_0x6795c4[_0xa552('0x1d')](_0x20c52a)[_0xa552('0x2a')](_0x5bd200);};}exports[_0xa552('0x2b')]=function(_0x5ae88f,_0x554f79){var _0x20ef76={},_0x1ff53c={},_0x5482ee={'count':0x0,'rows':[]};var _0x55cc9d=_[_0xa552('0x2c')](db[_0xa552('0x2d')][_0xa552('0x2e')],function(_0xb703dd){return{'name':_0xb703dd[_0xa552('0x2f')],'type':_0xb703dd[_0xa552('0x30')][_0xa552('0x31')]};});_0x1ff53c[_0xa552('0x32')]=_['map'](_0x55cc9d,'name');_0x1ff53c[_0xa552('0x33')]=_['keys'](_0x5ae88f[_0xa552('0x33')]);_0x1ff53c[_0xa552('0x34')]=_[_0xa552('0x35')](_0x1ff53c[_0xa552('0x32')],_0x1ff53c['query']);_0x20ef76[_0xa552('0x36')]=_[_0xa552('0x35')](_0x1ff53c[_0xa552('0x32')],qs[_0xa552('0x37')](_0x5ae88f[_0xa552('0x33')]['fields']));_0x20ef76[_0xa552('0x36')]=_0x20ef76[_0xa552('0x36')]['length']?_0x20ef76[_0xa552('0x36')]:_0x1ff53c['model'];if(!_0x5ae88f[_0xa552('0x33')][_0xa552('0x38')]('nolimit')){_0x20ef76['limit']=qs[_0xa552('0x1f')](_0x5ae88f[_0xa552('0x33')][_0xa552('0x1f')]);_0x20ef76['offset']=qs['offset'](_0x5ae88f['query'][_0xa552('0x22')]);}_0x20ef76[_0xa552('0x39')]=qs[_0xa552('0x3a')](_0x5ae88f[_0xa552('0x33')][_0xa552('0x3a')]);_0x20ef76[_0xa552('0x3b')]=qs[_0xa552('0x34')](_[_0xa552('0x3c')](_0x5ae88f[_0xa552('0x33')],_0x1ff53c['filters']),_0x55cc9d);if(_0x5ae88f[_0xa552('0x33')][_0xa552('0x3d')]){_0x20ef76[_0xa552('0x3b')]=_[_0xa552('0x3e')](_0x20ef76[_0xa552('0x3b')],{'$or':_[_0xa552('0x2c')](_0x55cc9d,function(_0x293fd0){if(_0x293fd0[_0xa552('0x30')]!==_0xa552('0x3f')){var _0x3b937d={};_0x3b937d[_0x293fd0[_0xa552('0x29')]]={'$like':'%'+_0x5ae88f['query'][_0xa552('0x3d')]+'%'};return _0x3b937d;}})});}_0x20ef76=_['merge']({},_0x20ef76,_0x5ae88f[_0xa552('0x40')]);var _0x4abe55={'where':_0x20ef76[_0xa552('0x3b')]};return db[_0xa552('0x2d')][_0xa552('0x21')](_0x4abe55)['then'](function(_0x5b3c39){_0x5482ee[_0xa552('0x21')]=_0x5b3c39;if(_0x5ae88f[_0xa552('0x33')][_0xa552('0x41')]){_0x20ef76[_0xa552('0x42')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xa552('0x43')](_0x20ef76);})[_0xa552('0x27')](function(_0x5e5e42){_0x5482ee[_0xa552('0x44')]=_0x5e5e42;return _0x5482ee;})[_0xa552('0x27')](respondWithFilteredResult(_0x554f79,_0x20ef76))[_0xa552('0x45')](handleError(_0x554f79,null));};exports[_0xa552('0x46')]=function(_0x129b56,_0x5659e3){var _0x729dc6={'raw':![],'where':{'id':_0x129b56[_0xa552('0x47')]['id']}},_0x51959f={};_0x51959f['model']=_['keys'](db[_0xa552('0x2d')]['rawAttributes']);_0x51959f['query']=_[_0xa552('0x48')](_0x129b56['query']);_0x51959f[_0xa552('0x34')]=_[_0xa552('0x35')](_0x51959f[_0xa552('0x32')],_0x51959f[_0xa552('0x33')]);_0x729dc6[_0xa552('0x36')]=_[_0xa552('0x35')](_0x51959f[_0xa552('0x32')],qs[_0xa552('0x37')](_0x129b56[_0xa552('0x33')][_0xa552('0x37')]));_0x729dc6[_0xa552('0x36')]=_0x729dc6['attributes'][_0xa552('0x49')]?_0x729dc6[_0xa552('0x36')]:_0x51959f['model'];if(_0x129b56[_0xa552('0x33')]['includeAll']){_0x729dc6['include']=[{'all':!![]}];}_0x729dc6=_[_0xa552('0x3e')]({},_0x729dc6,_0x129b56[_0xa552('0x40')]);return db[_0xa552('0x2d')][_0xa552('0x4a')](_0x729dc6)['then'](handleEntityNotFound(_0x5659e3,null))[_0xa552('0x27')](respondWithResult(_0x5659e3,null))['catch'](handleError(_0x5659e3,null));};exports['create']=function(_0x29d5bd,_0x15c470){return db[_0xa552('0x2d')][_0xa552('0x4b')](_0x29d5bd[_0xa552('0x4c')],{})[_0xa552('0x27')](respondWithResult(_0x15c470,0xc9))['catch'](handleError(_0x15c470,null));};exports[_0xa552('0x26')]=function(_0x10253a,_0x56498a){if(_0x10253a['body']['id']){delete _0x10253a[_0xa552('0x4c')]['id'];}return db[_0xa552('0x2d')][_0xa552('0x4a')]({'where':{'id':_0x10253a['params']['id']}})['then'](handleEntityNotFound(_0x56498a,null))[_0xa552('0x27')](saveUpdates(_0x10253a[_0xa552('0x4c')],null))[_0xa552('0x27')](respondWithResult(_0x56498a,null))[_0xa552('0x45')](handleError(_0x56498a,null));};exports[_0xa552('0x4d')]=function(_0x133c19,_0x415e91){return db[_0xa552('0x2d')][_0xa552('0x4a')]({'where':{'id':_0x133c19['params']['id']}})[_0xa552('0x27')](handleEntityNotFound(_0x415e91,null))[_0xa552('0x27')](removeEntity(_0x415e91,null))['catch'](handleError(_0x415e91,null));};exports['getConfigurations']=function(_0x34a865,_0x17a270,_0x5b1f0a){var _0x55d02c={};var _0x43eab5={};var _0x31cd38;var _0x5cddf5;return db[_0xa552('0x2d')][_0xa552('0x4e')]({'where':{'id':_0x34a865[_0xa552('0x47')]['id']}})[_0xa552('0x27')](handleEntityNotFound(_0x17a270,null))['then'](function(_0x5c7b71){if(_0x5c7b71){_0x31cd38=_0x5c7b71;_0x43eab5[_0xa552('0x32')]=_[_0xa552('0x48')](db[_0xa552('0x4f')][_0xa552('0x2e')]);_0x43eab5[_0xa552('0x33')]=_['keys'](_0x34a865[_0xa552('0x33')]);_0x43eab5[_0xa552('0x34')]=_[_0xa552('0x35')](_0x43eab5['model'],_0x43eab5[_0xa552('0x33')]);_0x55d02c[_0xa552('0x36')]=_[_0xa552('0x35')](_0x43eab5[_0xa552('0x32')],qs[_0xa552('0x37')](_0x34a865[_0xa552('0x33')][_0xa552('0x37')]));_0x55d02c['attributes']=_0x55d02c[_0xa552('0x36')][_0xa552('0x49')]?_0x55d02c['attributes']:_0x43eab5[_0xa552('0x32')];_0x55d02c[_0xa552('0x39')]=qs[_0xa552('0x3a')](_0x34a865['query'][_0xa552('0x3a')]);_0x55d02c[_0xa552('0x3b')]=qs[_0xa552('0x34')](_['pick'](_0x34a865[_0xa552('0x33')],_0x43eab5[_0xa552('0x34')]));if(_0x34a865[_0xa552('0x33')][_0xa552('0x3d')]){_0x55d02c[_0xa552('0x3b')]=_['merge'](_0x55d02c[_0xa552('0x3b')],{'$or':_[_0xa552('0x2c')](_0x55d02c['attributes'],function(_0x5de193){var _0x2d5adc={};_0x2d5adc[_0x5de193]={'$like':'%'+_0x34a865[_0xa552('0x33')]['filter']+'%'};return _0x2d5adc;})});}_0x55d02c=_[_0xa552('0x3e')]({},_0x55d02c,_0x34a865[_0xa552('0x40')]);return _0x31cd38['getConfigurations'](_0x55d02c);}})[_0xa552('0x27')](function(_0xbe827d){if(_0xbe827d){_0x5cddf5=_0xbe827d[_0xa552('0x49')];if(!_0x34a865[_0xa552('0x33')][_0xa552('0x38')]('nolimit')){_0x55d02c[_0xa552('0x1f')]=qs[_0xa552('0x1f')](_0x34a865['query'][_0xa552('0x1f')]);_0x55d02c[_0xa552('0x22')]=qs[_0xa552('0x22')](_0x34a865[_0xa552('0x33')]['offset']);}return _0x31cd38[_0xa552('0x50')](_0x55d02c);}})[_0xa552('0x27')](function(_0xacaab8){if(_0xacaab8){return _0xacaab8?{'count':_0x5cddf5,'rows':_0xacaab8}:null;}})[_0xa552('0x27')](respondWithResult(_0x17a270,null))[_0xa552('0x45')](handleError(_0x17a270,null));};exports[_0xa552('0x51')]=function(_0x596d98,_0x24b2f7,_0x2cf58a){if(_0x596d98[_0xa552('0x4c')]['id']){delete _0x596d98['body']['id'];}return db[_0xa552('0x2d')][_0xa552('0x4e')]({'where':{'id':_0x596d98['params']['id']}})[_0xa552('0x27')](handleEntityNotFound(_0x24b2f7,null))[_0xa552('0x27')](function(_0x3c69b5){if(_0x3c69b5){_0x596d98[_0xa552('0x4c')][_0xa552('0x52')]=_0x3c69b5['id'];_0x596d98['body'][_0xa552('0x53')]=integrations[_0xa552('0x54')](_0x596d98[_0xa552('0x4c')]['channel'],_0x596d98[_0xa552('0x4c')][_0xa552('0x30')]);_0x596d98['body'][_0xa552('0x55')]=integrations[_0xa552('0x56')](_0x596d98[_0xa552('0x4c')][_0xa552('0x57')],_0x596d98[_0xa552('0x4c')]['type']);return db[_0xa552('0x4f')][_0xa552('0x4b')](_0x596d98[_0xa552('0x4c')],{'include':[{'model':db[_0xa552('0x58')],'as':_0xa552('0x53')},{'model':db[_0xa552('0x58')],'as':_0xa552('0x55')}]});}return null;})[_0xa552('0x27')](respondWithResult(_0x24b2f7,null))[_0xa552('0x45')](handleError(_0x24b2f7,null));};exports[_0xa552('0x59')]=function(_0x1b823b,_0x36e944,_0x35e79d){var _0x3e9e1b='';var _0x4f4d6f=['id','name',_0xa552('0x5a'),_0xa552('0x5b'),_0xa552('0x5c'),_0xa552('0x5d'),_0xa552('0x5e'),_0xa552('0x5f'),_0xa552('0x60'),_0xa552('0x61'),'parent_name','direction'];return db[_0xa552('0x2d')][_0xa552('0x4e')]({'where':{'id':_0x1b823b[_0xa552('0x47')]['id']},'attributes':['id',_0xa552('0x62'),_0xa552('0x63'),_0xa552('0x64')]})[_0xa552('0x27')](handleEntityNotFound(_0x36e944,null))[_0xa552('0x27')](function(_0x206121){if(_0x206121){_0x3e9e1b=_0x206121[_0xa552('0x64')];var _0x68e867=_0x3e9e1b[_0xa552('0x65')](-0x1);if(_0x68e867==='/'){_0x3e9e1b=_0x3e9e1b['substring'](0x0,_0x3e9e1b['lastIndexOf'](_0x68e867));}return rp({'method':_0xa552('0x66'),'uri':util['format']('%s%s',_0x3e9e1b,_0xa552('0x67')),'json':!![],'form':{'method':_0xa552('0x68'),'input_type':_0xa552('0x69'),'response_type':_0xa552('0x69'),'rest_data':JSON[_0xa552('0x6a')]({'user_auth':{'user_name':_0x206121[_0xa552('0x62')],'password':_0x206121[_0xa552('0x63')],'encryption':_0xa552('0x6b')},'application':_0xa552('0x6c')})}});}})[_0xa552('0x27')](function(_0x269503){if(_0x269503&&_0x269503[_0xa552('0x29')]!=='Invalid\x20Login'&&_0x269503[_0xa552('0x29')]!==_0xa552('0x6d')){return rp({'method':_0xa552('0x66'),'uri':util[_0xa552('0x6e')](_0xa552('0x6f'),_0x3e9e1b,_0xa552('0x67')),'json':!![],'form':{'method':_0xa552('0x70'),'input_type':_0xa552('0x69'),'response_type':_0xa552('0x69'),'rest_data':JSON['stringify']({'session':_0x269503['id'],'module_name':_0xa552('0x71')})}})[_0xa552('0x27')](function(_0x5dc30e){if(_0x5dc30e){var _0x16032a=_[_0xa552('0x72')](_0x5dc30e[_0xa552('0x73')]);_['remove'](_0x16032a,function(_0x29c7e3){return _0x4f4d6f['includes'](_0x29c7e3['name']);});return{'count':_0x16032a['length'],'rows':_[_0xa552('0x2c')](_0x16032a,function(_0xf6a367){return{'id':_0xf6a367['name'],'name':_0xf6a367[_0xa552('0x74')],'custom':_[_0xa552('0x75')](_0xf6a367['name'],'_c')?!![]:![],'options':_0xf6a367[_0xa552('0x40')]?_['map'](_[_0xa552('0x72')](_0xf6a367[_0xa552('0x40')]),function(_0x2689aa){return{'name':_0x2689aa[_0xa552('0x76')],'value':_0x2689aa[_0xa552('0x29')]};}):[]};})};}})['then'](respondWithResult(_0x36e944,null))[_0xa552('0x45')](function(_0x3d0be7){var _0x5ab9b6=_0x1b823b[_0xa552('0x33')][_0xa552('0x77')]?0x1f4:_0x3d0be7[_0xa552('0x78')]||0x1f4;logger[_0xa552('0x28')](_0xa552('0x79'),_0xa552('0x59'),_0x5ab9b6,JSON['stringify'](_0x3d0be7));delete _0x3d0be7[_0xa552('0x29')];if(_0x5ab9b6===0x191){_0x5ab9b6=0x190;}_0x36e944[_0xa552('0x1d')](_0x5ab9b6)[_0xa552('0x2a')](_0x1b823b['query'][_0xa552('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x3d0be7[_0xa552('0x78')]}:_0x3d0be7);});}else{var _0x1e0c3e=0x1f4;_0x36e944[_0xa552('0x1d')](_0x1e0c3e)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xe06c=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','SugarcrmAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','map','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','params','fields','create','body','find','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','channel','getDescriptions','SugarcrmField','Subjects','Descriptions','getFields','assigned_user_id','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','username','password','remoteUri','slice','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset'];(function(_0x15d5af,_0x47e20f){var _0x94d2de=function(_0x42c802){while(--_0x42c802){_0x15d5af['push'](_0x15d5af['shift']());}};_0x94d2de(++_0x47e20f);}(_0xe06c,0xd2));var _0xce06=function(_0x22634f,_0x47120f){_0x22634f=_0x22634f-0x0;var _0x27a216=_0xe06c[_0x22634f];return _0x27a216;};'use strict';var emlformat=require(_0xce06('0x0'));var rimraf=require(_0xce06('0x1'));var zipdir=require(_0xce06('0x2'));var jsonpatch=require(_0xce06('0x3'));var rp=require('request-promise');var moment=require(_0xce06('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xce06('0x5'));var util=require(_0xce06('0x6'));var path=require(_0xce06('0x7'));var sox=require(_0xce06('0x8'));var csv=require('to-csv');var ejs=require(_0xce06('0x9'));var fs=require('fs');var fs_extra=require(_0xce06('0xa'));var _=require('lodash');var squel=require(_0xce06('0xb'));var crypto=require(_0xce06('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xce06('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xce06('0xe'));var qs=require(_0xce06('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xce06('0x10'))(_0xce06('0x11'));var utils=require(_0xce06('0x12'));var config=require(_0xce06('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2dc798,_0x4ccdbf){_0x4ccdbf=_0x4ccdbf||0xcc;return function(_0x227634){if(_0x227634){return _0x2dc798['sendStatus'](_0x4ccdbf);}return _0x2dc798[_0xce06('0x14')](_0x4ccdbf)[_0xce06('0x15')]();};}function respondWithResult(_0x57fd5a,_0x25299c){_0x25299c=_0x25299c||0xc8;return function(_0x5d5380){if(_0x5d5380){return _0x57fd5a[_0xce06('0x14')](_0x25299c)[_0xce06('0x16')](_0x5d5380);}};}function respondWithFilteredResult(_0x4bea5e,_0x5aaeb7){return function(_0x2bbf3b){if(_0x2bbf3b){var _0x7d8cde=typeof _0x5aaeb7[_0xce06('0x17')]===_0xce06('0x18')&&typeof _0x5aaeb7[_0xce06('0x19')]==='undefined';var _0x46558c=_0x2bbf3b[_0xce06('0x1a')];var _0x4e1d3d=_0x7d8cde?0x0:_0x5aaeb7['offset'];var _0x40d629=_0x7d8cde?_0x2bbf3b['count']:_0x5aaeb7[_0xce06('0x17')]+_0x5aaeb7[_0xce06('0x19')];var _0x1db89e;if(_0x40d629>=_0x46558c){_0x40d629=_0x46558c;_0x1db89e=0xc8;}else{_0x1db89e=0xce;}_0x4bea5e[_0xce06('0x14')](_0x1db89e);return _0x4bea5e[_0xce06('0x1b')](_0xce06('0x1c'),_0x4e1d3d+'-'+_0x40d629+'/'+_0x46558c)[_0xce06('0x16')](_0x2bbf3b);}return null;};}function patchUpdates(_0x55ba50){return function(_0x4f773d){try{jsonpatch[_0xce06('0x1d')](_0x4f773d,_0x55ba50,!![]);}catch(_0x564389){return BPromise[_0xce06('0x1e')](_0x564389);}return _0x4f773d[_0xce06('0x1f')]();};}function saveUpdates(_0x4511ad,_0x15bf5f){return function(_0x2c39f2){if(_0x2c39f2){return _0x2c39f2[_0xce06('0x20')](_0x4511ad)[_0xce06('0x21')](function(_0x37fe48){return _0x37fe48;});}return null;};}function removeEntity(_0x18e9ed,_0x4a6492){return function(_0x550e43){if(_0x550e43){return _0x550e43[_0xce06('0x22')]()[_0xce06('0x21')](function(){_0x18e9ed['status'](0xcc)[_0xce06('0x15')]();});}};}function handleEntityNotFound(_0x17658b,_0x4dcc8d){return function(_0x242501){if(!_0x242501){_0x17658b['sendStatus'](0x194);}return _0x242501;};}function handleError(_0x34add3,_0x4ac109){_0x4ac109=_0x4ac109||0x1f4;return function(_0x296a36){logger[_0xce06('0x23')](_0x296a36[_0xce06('0x24')]);if(_0x296a36['name']){delete _0x296a36[_0xce06('0x25')];}_0x34add3['status'](_0x4ac109)[_0xce06('0x26')](_0x296a36);};}exports['index']=function(_0x31ded8,_0x26cfe9){var _0x923a8d={},_0x2e22c5={},_0x3ab98c={'count':0x0,'rows':[]};var _0xcce945=_['map'](db[_0xce06('0x27')][_0xce06('0x28')],function(_0x5ee9b1){return{'name':_0x5ee9b1[_0xce06('0x29')],'type':_0x5ee9b1[_0xce06('0x2a')]['key']};});_0x2e22c5[_0xce06('0x2b')]=_['map'](_0xcce945,_0xce06('0x25'));_0x2e22c5[_0xce06('0x2c')]=_[_0xce06('0x2d')](_0x31ded8[_0xce06('0x2c')]);_0x2e22c5['filters']=_[_0xce06('0x2e')](_0x2e22c5[_0xce06('0x2b')],_0x2e22c5[_0xce06('0x2c')]);_0x923a8d[_0xce06('0x2f')]=_[_0xce06('0x2e')](_0x2e22c5['model'],qs['fields'](_0x31ded8['query']['fields']));_0x923a8d[_0xce06('0x2f')]=_0x923a8d[_0xce06('0x2f')][_0xce06('0x30')]?_0x923a8d[_0xce06('0x2f')]:_0x2e22c5[_0xce06('0x2b')];if(!_0x31ded8[_0xce06('0x2c')][_0xce06('0x31')](_0xce06('0x32'))){_0x923a8d[_0xce06('0x19')]=qs[_0xce06('0x19')](_0x31ded8[_0xce06('0x2c')][_0xce06('0x19')]);_0x923a8d['offset']=qs[_0xce06('0x17')](_0x31ded8[_0xce06('0x2c')]['offset']);}_0x923a8d[_0xce06('0x33')]=qs[_0xce06('0x34')](_0x31ded8[_0xce06('0x2c')][_0xce06('0x34')]);_0x923a8d['where']=qs[_0xce06('0x35')](_[_0xce06('0x36')](_0x31ded8['query'],_0x2e22c5[_0xce06('0x35')]),_0xcce945);if(_0x31ded8['query'][_0xce06('0x37')]){_0x923a8d['where']=_[_0xce06('0x38')](_0x923a8d['where'],{'$or':_[_0xce06('0x39')](_0xcce945,function(_0x1103f4){if(_0x1103f4[_0xce06('0x2a')]!==_0xce06('0x3a')){var _0x23f57b={};_0x23f57b[_0x1103f4[_0xce06('0x25')]]={'$like':'%'+_0x31ded8['query']['filter']+'%'};return _0x23f57b;}})});}_0x923a8d=_['merge']({},_0x923a8d,_0x31ded8[_0xce06('0x3b')]);var _0x341838={'where':_0x923a8d[_0xce06('0x3c')]};return db[_0xce06('0x27')][_0xce06('0x1a')](_0x341838)[_0xce06('0x21')](function(_0x5682b2){_0x3ab98c[_0xce06('0x1a')]=_0x5682b2;if(_0x31ded8[_0xce06('0x2c')][_0xce06('0x3d')]){_0x923a8d[_0xce06('0x3e')]=[{'all':!![]}];}return db[_0xce06('0x27')][_0xce06('0x3f')](_0x923a8d);})[_0xce06('0x21')](function(_0xe2b89a){_0x3ab98c[_0xce06('0x40')]=_0xe2b89a;return _0x3ab98c;})[_0xce06('0x21')](respondWithFilteredResult(_0x26cfe9,_0x923a8d))[_0xce06('0x41')](handleError(_0x26cfe9,null));};exports['show']=function(_0x3a3cf3,_0x428904){var _0x130717={'raw':![],'where':{'id':_0x3a3cf3[_0xce06('0x42')]['id']}},_0x55d7c={};_0x55d7c[_0xce06('0x2b')]=_['keys'](db['SugarcrmAccount'][_0xce06('0x28')]);_0x55d7c[_0xce06('0x2c')]=_['keys'](_0x3a3cf3[_0xce06('0x2c')]);_0x55d7c['filters']=_[_0xce06('0x2e')](_0x55d7c[_0xce06('0x2b')],_0x55d7c[_0xce06('0x2c')]);_0x130717[_0xce06('0x2f')]=_[_0xce06('0x2e')](_0x55d7c['model'],qs[_0xce06('0x43')](_0x3a3cf3[_0xce06('0x2c')][_0xce06('0x43')]));_0x130717[_0xce06('0x2f')]=_0x130717[_0xce06('0x2f')][_0xce06('0x30')]?_0x130717[_0xce06('0x2f')]:_0x55d7c['model'];if(_0x3a3cf3['query'][_0xce06('0x3d')]){_0x130717[_0xce06('0x3e')]=[{'all':!![]}];}_0x130717=_[_0xce06('0x38')]({},_0x130717,_0x3a3cf3['options']);return db[_0xce06('0x27')]['find'](_0x130717)[_0xce06('0x21')](handleEntityNotFound(_0x428904,null))[_0xce06('0x21')](respondWithResult(_0x428904,null))['catch'](handleError(_0x428904,null));};exports['create']=function(_0x31e0cf,_0x2c0630){return db[_0xce06('0x27')][_0xce06('0x44')](_0x31e0cf[_0xce06('0x45')],{})[_0xce06('0x21')](respondWithResult(_0x2c0630,0xc9))[_0xce06('0x41')](handleError(_0x2c0630,null));};exports[_0xce06('0x20')]=function(_0x1f63a0,_0x4a713e){if(_0x1f63a0[_0xce06('0x45')]['id']){delete _0x1f63a0[_0xce06('0x45')]['id'];}return db[_0xce06('0x27')]['find']({'where':{'id':_0x1f63a0[_0xce06('0x42')]['id']}})[_0xce06('0x21')](handleEntityNotFound(_0x4a713e,null))[_0xce06('0x21')](saveUpdates(_0x1f63a0['body'],null))[_0xce06('0x21')](respondWithResult(_0x4a713e,null))[_0xce06('0x41')](handleError(_0x4a713e,null));};exports[_0xce06('0x22')]=function(_0xc6457c,_0x321256){return db[_0xce06('0x27')][_0xce06('0x46')]({'where':{'id':_0xc6457c[_0xce06('0x42')]['id']}})[_0xce06('0x21')](handleEntityNotFound(_0x321256,null))[_0xce06('0x21')](removeEntity(_0x321256,null))[_0xce06('0x41')](handleError(_0x321256,null));};exports[_0xce06('0x47')]=function(_0x2b0445,_0x367d5a,_0x251206){var _0x3a2099={};var _0x242ae7={};var _0x3c14a4;var _0x179966;return db['SugarcrmAccount'][_0xce06('0x48')]({'where':{'id':_0x2b0445[_0xce06('0x42')]['id']}})['then'](handleEntityNotFound(_0x367d5a,null))['then'](function(_0x41ed50){if(_0x41ed50){_0x3c14a4=_0x41ed50;_0x242ae7[_0xce06('0x2b')]=_['keys'](db[_0xce06('0x49')][_0xce06('0x28')]);_0x242ae7[_0xce06('0x2c')]=_['keys'](_0x2b0445[_0xce06('0x2c')]);_0x242ae7[_0xce06('0x35')]=_[_0xce06('0x2e')](_0x242ae7[_0xce06('0x2b')],_0x242ae7[_0xce06('0x2c')]);_0x3a2099[_0xce06('0x2f')]=_[_0xce06('0x2e')](_0x242ae7[_0xce06('0x2b')],qs[_0xce06('0x43')](_0x2b0445[_0xce06('0x2c')]['fields']));_0x3a2099['attributes']=_0x3a2099[_0xce06('0x2f')][_0xce06('0x30')]?_0x3a2099[_0xce06('0x2f')]:_0x242ae7[_0xce06('0x2b')];_0x3a2099[_0xce06('0x33')]=qs['sort'](_0x2b0445[_0xce06('0x2c')]['sort']);_0x3a2099[_0xce06('0x3c')]=qs['filters'](_[_0xce06('0x36')](_0x2b0445[_0xce06('0x2c')],_0x242ae7['filters']));if(_0x2b0445[_0xce06('0x2c')][_0xce06('0x37')]){_0x3a2099[_0xce06('0x3c')]=_[_0xce06('0x38')](_0x3a2099['where'],{'$or':_[_0xce06('0x39')](_0x3a2099[_0xce06('0x2f')],function(_0x60441b){var _0x55d08f={};_0x55d08f[_0x60441b]={'$like':'%'+_0x2b0445['query']['filter']+'%'};return _0x55d08f;})});}_0x3a2099=_['merge']({},_0x3a2099,_0x2b0445['options']);return _0x3c14a4['getConfigurations'](_0x3a2099);}})['then'](function(_0x47dca7){if(_0x47dca7){_0x179966=_0x47dca7[_0xce06('0x30')];if(!_0x2b0445[_0xce06('0x2c')][_0xce06('0x31')](_0xce06('0x32'))){_0x3a2099[_0xce06('0x19')]=qs[_0xce06('0x19')](_0x2b0445[_0xce06('0x2c')][_0xce06('0x19')]);_0x3a2099[_0xce06('0x17')]=qs[_0xce06('0x17')](_0x2b0445['query'][_0xce06('0x17')]);}return _0x3c14a4['getConfigurations'](_0x3a2099);}})[_0xce06('0x21')](function(_0xc268d5){if(_0xc268d5){return _0xc268d5?{'count':_0x179966,'rows':_0xc268d5}:null;}})[_0xce06('0x21')](respondWithResult(_0x367d5a,null))['catch'](handleError(_0x367d5a,null));};exports[_0xce06('0x4a')]=function(_0x3c23f6,_0x469dde,_0x2bc3ff){if(_0x3c23f6[_0xce06('0x45')]['id']){delete _0x3c23f6[_0xce06('0x45')]['id'];}return db[_0xce06('0x27')][_0xce06('0x48')]({'where':{'id':_0x3c23f6[_0xce06('0x42')]['id']}})[_0xce06('0x21')](handleEntityNotFound(_0x469dde,null))[_0xce06('0x21')](function(_0x123608){if(_0x123608){_0x3c23f6[_0xce06('0x45')]['AccountId']=_0x123608['id'];_0x3c23f6[_0xce06('0x45')]['Subjects']=integrations['getSubjects'](_0x3c23f6[_0xce06('0x45')][_0xce06('0x4b')],_0x3c23f6['body']['type']);_0x3c23f6[_0xce06('0x45')]['Descriptions']=integrations[_0xce06('0x4c')](_0x3c23f6[_0xce06('0x45')][_0xce06('0x4b')],_0x3c23f6[_0xce06('0x45')]['type']);return db[_0xce06('0x49')][_0xce06('0x44')](_0x3c23f6[_0xce06('0x45')],{'include':[{'model':db[_0xce06('0x4d')],'as':_0xce06('0x4e')},{'model':db['SugarcrmField'],'as':_0xce06('0x4f')}]});}return null;})[_0xce06('0x21')](respondWithResult(_0x469dde,null))[_0xce06('0x41')](handleError(_0x469dde,null));};exports[_0xce06('0x50')]=function(_0x3045c8,_0x358396,_0x35f3dd){var _0x179e10='';var _0x37cb70=['id',_0xce06('0x25'),_0xce06('0x51'),'created_by','description',_0xce06('0x52'),_0xce06('0x53'),_0xce06('0x54'),_0xce06('0x55'),_0xce06('0x56'),_0xce06('0x57'),'direction'];return db[_0xce06('0x27')][_0xce06('0x48')]({'where':{'id':_0x3045c8['params']['id']},'attributes':['id',_0xce06('0x58'),_0xce06('0x59'),_0xce06('0x5a')]})[_0xce06('0x21')](handleEntityNotFound(_0x358396,null))[_0xce06('0x21')](function(_0x1967b3){if(_0x1967b3){_0x179e10=_0x1967b3['remoteUri'];var _0x2e7858=_0x179e10[_0xce06('0x5b')](-0x1);if(_0x2e7858==='/'){_0x179e10=_0x179e10[_0xce06('0x5c')](0x0,_0x179e10[_0xce06('0x5d')](_0x2e7858));}return rp({'method':'POST','uri':util[_0xce06('0x5e')](_0xce06('0x5f'),_0x179e10,_0xce06('0x60')),'json':!![],'form':{'method':_0xce06('0x61'),'input_type':_0xce06('0x62'),'response_type':_0xce06('0x62'),'rest_data':JSON[_0xce06('0x63')]({'user_auth':{'user_name':_0x1967b3[_0xce06('0x58')],'password':_0x1967b3[_0xce06('0x59')],'encryption':_0xce06('0x64')},'application':_0xce06('0x65')})}});}})[_0xce06('0x21')](function(_0x403e8d){if(_0x403e8d&&_0x403e8d[_0xce06('0x25')]!==_0xce06('0x66')&&_0x403e8d[_0xce06('0x25')]!==_0xce06('0x67')){return rp({'method':_0xce06('0x68'),'uri':util['format'](_0xce06('0x5f'),_0x179e10,_0xce06('0x60')),'json':!![],'form':{'method':_0xce06('0x69'),'input_type':_0xce06('0x62'),'response_type':_0xce06('0x62'),'rest_data':JSON[_0xce06('0x63')]({'session':_0x403e8d['id'],'module_name':_0xce06('0x6a')})}})[_0xce06('0x21')](function(_0x36e026){if(_0x36e026){var _0x59449c=_[_0xce06('0x6b')](_0x36e026[_0xce06('0x6c')]);_[_0xce06('0x6d')](_0x59449c,function(_0x5dbb97){return _0x37cb70[_0xce06('0x6e')](_0x5dbb97[_0xce06('0x25')]);});return{'count':_0x59449c[_0xce06('0x30')],'rows':_['map'](_0x59449c,function(_0x41b552){return{'id':_0x41b552[_0xce06('0x25')],'name':_0x41b552[_0xce06('0x6f')],'custom':_[_0xce06('0x70')](_0x41b552[_0xce06('0x25')],'_c')?!![]:![],'options':_0x41b552[_0xce06('0x3b')]?_[_0xce06('0x39')](_['values'](_0x41b552['options']),function(_0x2785b7){return{'name':_0x2785b7['value'],'value':_0x2785b7[_0xce06('0x25')]};}):[]};})};}})[_0xce06('0x21')](respondWithResult(_0x358396,null))[_0xce06('0x41')](function(_0x273e69){var _0x480971=_0x3045c8[_0xce06('0x2c')][_0xce06('0x71')]?0x1f4:_0x273e69['statusCode']||0x1f4;logger[_0xce06('0x23')](_0xce06('0x72'),_0xce06('0x50'),_0x480971,JSON[_0xce06('0x63')](_0x273e69));delete _0x273e69['name'];if(_0x480971===0x191){_0x480971=0x190;}_0x358396[_0xce06('0x14')](_0x480971)[_0xce06('0x26')](_0x3045c8['query'][_0xce06('0x71')]?{'message':_0xce06('0x73'),'statusCode':_0x273e69[_0xce06('0x74')]}:_0x273e69);});}else{var _0x4d8c39=0x1f4;_0x358396[_0xce06('0x14')](_0x4d8c39)[_0xce06('0x26')]({'message':_0xce06('0x73'),'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 58ca3d3..6bb626d 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 _0x6123=['moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','int_sugarcrm_accounts','util','../../config/logger'];(function(_0x2dc367,_0x591c8a){var _0x14845a=function(_0xaef88b){while(--_0xaef88b){_0x2dc367['push'](_0x2dc367['shift']());}};_0x14845a(++_0x591c8a);}(_0x6123,0x1e2));var _0x3612=function(_0x56baba,_0x22de9a){_0x56baba=_0x56baba-0x0;var _0x34f9ce=_0x6123[_0x56baba];return _0x34f9ce;};'use strict';var _=require('lodash');var util=require(_0x3612('0x0'));var logger=require(_0x3612('0x1'))('api');var moment=require(_0x3612('0x2'));var BPromise=require(_0x3612('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3612('0x4'));var rimraf=require(_0x3612('0x5'));var config=require(_0x3612('0x6'));var attributes=require(_0x3612('0x7'));var integrations=require(_0x3612('0x8'));module[_0x3612('0x9')]=function(_0x531191,_0x345812){return _0x531191['define']('SugarcrmAccount',attributes,{'tableName':_0x3612('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6972=['../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0x6972,0x173));var _0x2697=function(_0x5352de,_0x439801){_0x5352de=_0x5352de-0x0;var _0x3e8541=_0x6972[_0x5352de];return _0x3e8541;};'use strict';var _=require(_0x2697('0x0'));var util=require('util');var logger=require(_0x2697('0x1'))(_0x2697('0x2'));var moment=require(_0x2697('0x3'));var BPromise=require('bluebird');var rp=require(_0x2697('0x4'));var fs=require('fs');var path=require(_0x2697('0x5'));var rimraf=require('rimraf');var config=require(_0x2697('0x6'));var attributes=require(_0x2697('0x7'));var integrations=require(_0x2697('0x8'));module[_0x2697('0x9')]=function(_0xce424b,_0x332e99){return _0xce424b[_0x2697('0xa')](_0x2697('0xb'),attributes,{'tableName':_0x2697('0xc'),'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 108d149..66de700 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 _0x38a0=['attributes','limit','include','model','map','stringify','find','ShowSugarcrmAccount','debug','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetSugarcrmAccount','findAll','options','raw','where'];(function(_0x1421af,_0x1cd8a6){var _0x518ef2=function(_0x461e72){while(--_0x461e72){_0x1421af['push'](_0x1421af['shift']());}};_0x518ef2(++_0x1cd8a6);}(_0x38a0,0xb3));var _0x038a=function(_0x54750b,_0x19d837){_0x54750b=_0x54750b-0x0;var _0x45f416=_0x38a0[_0x54750b];return _0x45f416;};'use strict';var _=require(_0x038a('0x0'));var util=require('util');var moment=require(_0x038a('0x1'));var BPromise=require(_0x038a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x038a('0x3'))['db'];var utils=require(_0x038a('0x4'));var logger=require('../../config/logger')(_0x038a('0x5'));var config=require(_0x038a('0x6'));var jayson=require(_0x038a('0x7'));var client=jayson[_0x038a('0x8')][_0x038a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b8e64,_0x542d9e,_0x101acc){return new BPromise(function(_0x3b17d8,_0x511848){return client[_0x038a('0xa')](_0x3b8e64,_0x101acc)[_0x038a('0xb')](function(_0x5c5afa){logger[_0x038a('0xc')](_0x038a('0xd'),_0x542d9e,_0x038a('0xe'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x542d9e,_0x038a('0xe'),JSON['stringify'](_0x5c5afa));if(_0x5c5afa[_0x038a('0xf')]){if(_0x5c5afa[_0x038a('0xf')][_0x038a('0x10')]===0x1f4){logger[_0x038a('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x542d9e,_0x5c5afa[_0x038a('0xf')][_0x038a('0x11')]);return _0x511848(_0x5c5afa['error'][_0x038a('0x11')]);}logger[_0x038a('0xf')](_0x038a('0xd'),_0x542d9e,_0x5c5afa['error'][_0x038a('0x11')]);return _0x3b17d8(_0x5c5afa[_0x038a('0xf')][_0x038a('0x11')]);}else{logger[_0x038a('0xc')](_0x038a('0xd'),_0x542d9e,'request\x20sent');_0x3b17d8(_0x5c5afa[_0x038a('0x12')][_0x038a('0x11')]);}})[_0x038a('0x13')](function(_0x4c4932){logger[_0x038a('0xf')](_0x038a('0xd'),_0x542d9e,_0x4c4932);_0x511848(_0x4c4932);});});}exports[_0x038a('0x14')]=function(_0xf98430){var _0x3a25db=this;return new Promise(function(_0x57d621,_0x22fb3b){return db['SugarcrmAccount'][_0x038a('0x15')]({'raw':_0xf98430[_0x038a('0x16')]?_0xf98430[_0x038a('0x16')][_0x038a('0x17')]===undefined?!![]:![]:!![],'where':_0xf98430[_0x038a('0x16')]?_0xf98430[_0x038a('0x16')][_0x038a('0x18')]||null:null,'attributes':_0xf98430['options']?_0xf98430[_0x038a('0x16')][_0x038a('0x19')]||null:null,'limit':_0xf98430[_0x038a('0x16')]?_0xf98430[_0x038a('0x16')][_0x038a('0x1a')]||null:null,'include':_0xf98430[_0x038a('0x16')]?_0xf98430['options'][_0x038a('0x1b')]?_['map'](_0xf98430[_0x038a('0x16')][_0x038a('0x1b')],function(_0x48d7da){return{'model':db[_0x48d7da[_0x038a('0x1c')]],'as':_0x48d7da['as'],'attributes':_0x48d7da[_0x038a('0x19')],'include':_0x48d7da[_0x038a('0x1b')]?_[_0x038a('0x1d')](_0x48d7da['include'],function(_0x29457f){return{'model':db[_0x29457f['model']],'as':_0x29457f['as'],'attributes':_0x29457f['attributes'],'include':_0x29457f[_0x038a('0x1b')]?_[_0x038a('0x1d')](_0x29457f[_0x038a('0x1b')],function(_0x16148c){return{'model':db[_0x16148c[_0x038a('0x1c')]],'as':_0x16148c['as'],'attributes':_0x16148c[_0x038a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x038a('0xb')](function(_0x1b64a9){logger[_0x038a('0xc')](_0x038a('0x14'),_0xf98430);logger['debug'](_0x038a('0x14'),_0xf98430,JSON[_0x038a('0x1e')](_0x1b64a9));_0x57d621(_0x1b64a9);})[_0x038a('0x13')](function(_0x25e228){logger[_0x038a('0xf')](_0x038a('0x14'),_0x25e228[_0x038a('0x11')],_0xf98430);_0x22fb3b(_0x3a25db['error'](0x1f4,_0x25e228[_0x038a('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0x99b830){var _0x5d5063=this;return new Promise(function(_0x3dc0fc,_0x2ef447){return db['SugarcrmAccount'][_0x038a('0x1f')]({'raw':_0x99b830[_0x038a('0x16')]?_0x99b830['options']['raw']===undefined?!![]:![]:!![],'where':_0x99b830[_0x038a('0x16')]?_0x99b830[_0x038a('0x16')][_0x038a('0x18')]||null:null,'attributes':_0x99b830['options']?_0x99b830[_0x038a('0x16')][_0x038a('0x19')]||null:null,'include':_0x99b830[_0x038a('0x16')]?_0x99b830['options'][_0x038a('0x1b')]?_['map'](_0x99b830['options'][_0x038a('0x1b')],function(_0x125bf4){return{'model':db[_0x125bf4[_0x038a('0x1c')]],'as':_0x125bf4['as'],'attributes':_0x125bf4[_0x038a('0x19')],'include':_0x125bf4[_0x038a('0x1b')]?_['map'](_0x125bf4[_0x038a('0x1b')],function(_0x59fbaf){return{'model':db[_0x59fbaf[_0x038a('0x1c')]],'as':_0x59fbaf['as'],'attributes':_0x59fbaf[_0x038a('0x19')],'include':_0x59fbaf['include']?_['map'](_0x59fbaf[_0x038a('0x1b')],function(_0x4e37cb){return{'model':db[_0x4e37cb['model']],'as':_0x4e37cb['as'],'attributes':_0x4e37cb[_0x038a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x038a('0xb')](function(_0x475011){logger['info'](_0x038a('0x20'),_0x99b830);logger[_0x038a('0x21')](_0x038a('0x20'),_0x99b830,JSON[_0x038a('0x1e')](_0x475011));_0x3dc0fc(_0x475011);})[_0x038a('0x13')](function(_0x77f5a1){logger[_0x038a('0xf')](_0x038a('0x20'),_0x77f5a1['message'],_0x99b830);_0x2ef447(_0x5d5063[_0x038a('0xf')](0x1f4,_0x77f5a1[_0x038a('0x11')]));});});}; \ No newline at end of file +var _0xbddc=['message','info','catch','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowSugarcrmAccount','SugarcrmAccount','find','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x497394,_0x2dcbd3){var _0x693d42=function(_0x3578f6){while(--_0x3578f6){_0x497394['push'](_0x497394['shift']());}};_0x693d42(++_0x2dcbd3);}(_0xbddc,0xb0));var _0xcbdd=function(_0xbaa6dd,_0x5c1913){_0xbaa6dd=_0xbaa6dd-0x0;var _0x2cd689=_0xbddc[_0xbaa6dd];return _0x2cd689;};'use strict';var _=require('lodash');var util=require(_0xcbdd('0x0'));var moment=require('moment');var BPromise=require(_0xcbdd('0x1'));var rs=require(_0xcbdd('0x2'));var fs=require('fs');var Redis=require(_0xcbdd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcbdd('0x4'));var logger=require(_0xcbdd('0x5'))(_0xcbdd('0x6'));var config=require(_0xcbdd('0x7'));var jayson=require(_0xcbdd('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x309294,_0x3c2a34,_0x5088cb){return new BPromise(function(_0x31a5cc,_0x3e639f){return client['request'](_0x309294,_0x5088cb)[_0xcbdd('0x9')](function(_0x35b90f){logger['info'](_0xcbdd('0xa'),_0x3c2a34,_0xcbdd('0xb'));logger[_0xcbdd('0xc')](_0xcbdd('0xd'),_0x3c2a34,'request\x20sent',JSON[_0xcbdd('0xe')](_0x35b90f));if(_0x35b90f[_0xcbdd('0xf')]){if(_0x35b90f['error']['code']===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x3c2a34,_0x35b90f[_0xcbdd('0xf')][_0xcbdd('0x10')]);return _0x3e639f(_0x35b90f[_0xcbdd('0xf')][_0xcbdd('0x10')]);}logger[_0xcbdd('0xf')](_0xcbdd('0xa'),_0x3c2a34,_0x35b90f[_0xcbdd('0xf')]['message']);return _0x31a5cc(_0x35b90f[_0xcbdd('0xf')][_0xcbdd('0x10')]);}else{logger[_0xcbdd('0x11')](_0xcbdd('0xa'),_0x3c2a34,_0xcbdd('0xb'));_0x31a5cc(_0x35b90f['result'][_0xcbdd('0x10')]);}})[_0xcbdd('0x12')](function(_0x5be12a){logger[_0xcbdd('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x3c2a34,_0x5be12a);_0x3e639f(_0x5be12a);});});}exports[_0xcbdd('0x13')]=function(_0x36a4b5){var _0x100666=this;return new Promise(function(_0x19b941,_0x46d64e){return db['SugarcrmAccount'][_0xcbdd('0x14')]({'raw':_0x36a4b5[_0xcbdd('0x15')]?_0x36a4b5['options'][_0xcbdd('0x16')]===undefined?!![]:![]:!![],'where':_0x36a4b5['options']?_0x36a4b5[_0xcbdd('0x15')][_0xcbdd('0x17')]||null:null,'attributes':_0x36a4b5[_0xcbdd('0x15')]?_0x36a4b5[_0xcbdd('0x15')][_0xcbdd('0x18')]||null:null,'limit':_0x36a4b5[_0xcbdd('0x15')]?_0x36a4b5['options'][_0xcbdd('0x19')]||null:null,'include':_0x36a4b5[_0xcbdd('0x15')]?_0x36a4b5[_0xcbdd('0x15')][_0xcbdd('0x1a')]?_[_0xcbdd('0x1b')](_0x36a4b5[_0xcbdd('0x15')][_0xcbdd('0x1a')],function(_0x1be662){return{'model':db[_0x1be662['model']],'as':_0x1be662['as'],'attributes':_0x1be662[_0xcbdd('0x18')],'include':_0x1be662[_0xcbdd('0x1a')]?_['map'](_0x1be662[_0xcbdd('0x1a')],function(_0x18fd46){return{'model':db[_0x18fd46[_0xcbdd('0x1c')]],'as':_0x18fd46['as'],'attributes':_0x18fd46['attributes'],'include':_0x18fd46['include']?_[_0xcbdd('0x1b')](_0x18fd46[_0xcbdd('0x1a')],function(_0x4cca5d){return{'model':db[_0x4cca5d[_0xcbdd('0x1c')]],'as':_0x4cca5d['as'],'attributes':_0x4cca5d[_0xcbdd('0x18')]};}):[]};}):[]};}):[]:[]})[_0xcbdd('0x9')](function(_0x44eeb8){logger[_0xcbdd('0x11')](_0xcbdd('0x13'),_0x36a4b5);logger[_0xcbdd('0xc')](_0xcbdd('0x13'),_0x36a4b5,JSON[_0xcbdd('0xe')](_0x44eeb8));_0x19b941(_0x44eeb8);})[_0xcbdd('0x12')](function(_0x9a3dfd){logger[_0xcbdd('0xf')](_0xcbdd('0x13'),_0x9a3dfd[_0xcbdd('0x10')],_0x36a4b5);_0x46d64e(_0x100666['error'](0x1f4,_0x9a3dfd[_0xcbdd('0x10')]));});});};exports[_0xcbdd('0x1d')]=function(_0x29f39c){var _0x5eebb6=this;return new Promise(function(_0x1982a5,_0xf81c7e){return db[_0xcbdd('0x1e')][_0xcbdd('0x1f')]({'raw':_0x29f39c[_0xcbdd('0x15')]?_0x29f39c[_0xcbdd('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x29f39c[_0xcbdd('0x15')]?_0x29f39c[_0xcbdd('0x15')][_0xcbdd('0x17')]||null:null,'attributes':_0x29f39c[_0xcbdd('0x15')]?_0x29f39c[_0xcbdd('0x15')][_0xcbdd('0x18')]||null:null,'include':_0x29f39c['options']?_0x29f39c[_0xcbdd('0x15')][_0xcbdd('0x1a')]?_[_0xcbdd('0x1b')](_0x29f39c[_0xcbdd('0x15')]['include'],function(_0x2ebc8f){return{'model':db[_0x2ebc8f[_0xcbdd('0x1c')]],'as':_0x2ebc8f['as'],'attributes':_0x2ebc8f[_0xcbdd('0x18')],'include':_0x2ebc8f[_0xcbdd('0x1a')]?_[_0xcbdd('0x1b')](_0x2ebc8f[_0xcbdd('0x1a')],function(_0x9fb2b4){return{'model':db[_0x9fb2b4[_0xcbdd('0x1c')]],'as':_0x9fb2b4['as'],'attributes':_0x9fb2b4['attributes'],'include':_0x9fb2b4[_0xcbdd('0x1a')]?_[_0xcbdd('0x1b')](_0x9fb2b4[_0xcbdd('0x1a')],function(_0x2a847c){return{'model':db[_0x2a847c[_0xcbdd('0x1c')]],'as':_0x2a847c['as'],'attributes':_0x2a847c[_0xcbdd('0x18')]};}):[]};}):[]};}):[]:[]})[_0xcbdd('0x9')](function(_0x32afd8){logger['info']('ShowSugarcrmAccount',_0x29f39c);logger[_0xcbdd('0xc')]('ShowSugarcrmAccount',_0x29f39c,JSON[_0xcbdd('0xe')](_0x32afd8));_0x1982a5(_0x32afd8);})[_0xcbdd('0x12')](function(_0x3598a9){logger[_0xcbdd('0xf')](_0xcbdd('0x1d'),_0x3598a9[_0xcbdd('0x10')],_0x29f39c);_0xf81c7e(_0x5eebb6[_0xcbdd('0xf')](0x1f4,_0x3598a9[_0xcbdd('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 682ea97..403785c 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 _0x3607=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete'];(function(_0x552a08,_0x2fd13a){var _0x2eae33=function(_0x12a232){while(--_0x12a232){_0x552a08['push'](_0x552a08['shift']());}};_0x2eae33(++_0x2fd13a);}(_0x3607,0xf5));var _0x7360=function(_0x446179,_0x2e227e){_0x446179=_0x446179-0x0;var _0x4a89c3=_0x3607[_0x446179];return _0x4a89c3;};'use strict';var multer=require(_0x7360('0x0'));var util=require(_0x7360('0x1'));var path=require(_0x7360('0x2'));var timeout=require(_0x7360('0x3'));var express=require(_0x7360('0x4'));var router=express[_0x7360('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7360('0x6'));var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router[_0x7360('0x7')]('/',auth[_0x7360('0x8')](),controller['index']);router[_0x7360('0x7')]('/:id',auth[_0x7360('0x8')](),controller[_0x7360('0x9')]);router[_0x7360('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7360('0xa')]);router['get'](_0x7360('0xb'),auth[_0x7360('0x8')](),controller[_0x7360('0xc')]);router[_0x7360('0x7')](_0x7360('0xd'),auth['isAuthenticated'](),controller[_0x7360('0xe')]);router[_0x7360('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7360('0x10')]('/:id',auth[_0x7360('0x8')](),controller[_0x7360('0x11')]);router[_0x7360('0x12')](_0x7360('0x13'),auth[_0x7360('0x8')](),controller[_0x7360('0x14')]);module[_0x7360('0x15')]=router; \ No newline at end of file +var _0x2bc3=['create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x2bc3,0xff));var _0x32bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bc3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x32bc('0x0'));var util=require(_0x32bc('0x1'));var path=require(_0x32bc('0x2'));var timeout=require('connect-timeout');var express=require(_0x32bc('0x3'));var router=express[_0x32bc('0x4')]();var fs_extra=require(_0x32bc('0x5'));var auth=require(_0x32bc('0x6'));var interaction=require(_0x32bc('0x7'));var config=require(_0x32bc('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x32bc('0x9')]('/',auth[_0x32bc('0xa')](),controller[_0x32bc('0xb')]);router[_0x32bc('0x9')](_0x32bc('0xc'),auth['isAuthenticated'](),controller[_0x32bc('0xd')]);router[_0x32bc('0x9')](_0x32bc('0xe'),auth['isAuthenticated'](),controller[_0x32bc('0xf')]);router['get'](_0x32bc('0x10'),auth[_0x32bc('0xa')](),controller[_0x32bc('0x11')]);router['get'](_0x32bc('0x12'),auth[_0x32bc('0xa')](),controller[_0x32bc('0x13')]);router['post']('/',auth[_0x32bc('0xa')](),controller[_0x32bc('0x14')]);router['put']('/:id',auth[_0x32bc('0xa')](),controller[_0x32bc('0x15')]);router[_0x32bc('0x16')]('/:id',auth[_0x32bc('0xa')](),controller[_0x32bc('0x17')]);module[_0x32bc('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index dfbb72d..c685076 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 _0x6da1=['exports','STRING','sequelize'];(function(_0x4befa3,_0x5462a8){var _0x541966=function(_0x2c3da9){while(--_0x2c3da9){_0x4befa3['push'](_0x4befa3['shift']());}};_0x541966(++_0x5462a8);}(_0x6da1,0x131));var _0x16da=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x6da1[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0x16da('0x0'));module[_0x16da('0x1')]={'name':{'type':Sequelize[_0x16da('0x2')]},'description':{'type':Sequelize[_0x16da('0x2')]}}; \ No newline at end of file +var _0xe8ad=['exports','STRING','sequelize'];(function(_0xdecf55,_0x20eb8e){var _0x2aba83=function(_0x28a4de){while(--_0x28a4de){_0xdecf55['push'](_0xdecf55['shift']());}};_0x2aba83(++_0x20eb8e);}(_0xe8ad,0xc5));var _0xde8a=function(_0x43a41f,_0x12b084){_0x43a41f=_0x43a41f-0x0;var _0x11d515=_0xe8ad[_0x43a41f];return _0x11d515;};'use strict';var Sequelize=require(_0xde8a('0x0'));module[_0xde8a('0x1')]={'name':{'type':Sequelize[_0xde8a('0x2')]},'description':{'type':Sequelize[_0xde8a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 546efca..dda9de1 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 _0x96cc=['count','set','json','apply','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmConfiguration','include','rows','show','params','keys','includeAll','find','catch','create','body','getFields','SugarcrmField','nolimit','getSubjects','getDescriptions','findOne','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/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit'];(function(_0xeb07a0,_0x3f8849){var _0x2ba674=function(_0x4364c1){while(--_0x4364c1){_0xeb07a0['push'](_0xeb07a0['shift']());}};_0x2ba674(++_0x3f8849);}(_0x96cc,0x86));var _0xc96c=function(_0x5a12ff,_0x2e18db){_0x5a12ff=_0x5a12ff-0x0;var _0x285f8d=_0x96cc[_0x5a12ff];return _0x285f8d;};'use strict';var emlformat=require(_0xc96c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc96c('0x1'));var jsonpatch=require(_0xc96c('0x2'));var rp=require(_0xc96c('0x3'));var moment=require(_0xc96c('0x4'));var BPromise=require(_0xc96c('0x5'));var Mustache=require(_0xc96c('0x6'));var util=require(_0xc96c('0x7'));var path=require(_0xc96c('0x8'));var sox=require(_0xc96c('0x9'));var csv=require(_0xc96c('0xa'));var ejs=require(_0xc96c('0xb'));var fs=require('fs');var fs_extra=require(_0xc96c('0xc'));var _=require(_0xc96c('0xd'));var squel=require(_0xc96c('0xe'));var crypto=require(_0xc96c('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xc96c('0x10'));var toCsv=require(_0xc96c('0xa'));var querystring=require(_0xc96c('0x11'));var Papa=require(_0xc96c('0x12'));var Redis=require(_0xc96c('0x13'));var authService=require(_0xc96c('0x14'));var qs=require(_0xc96c('0x15'));var as=require(_0xc96c('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc96c('0x17'))(_0xc96c('0x18'));var utils=require('../../config/utils');var config=require(_0xc96c('0x19'));var licenseUtil=require(_0xc96c('0x1a'));var db=require(_0xc96c('0x1b'))['db'];function respondWithStatusCode(_0x5048d9,_0x3e7b68){_0x3e7b68=_0x3e7b68||0xcc;return function(_0x2ef27d){if(_0x2ef27d){return _0x5048d9[_0xc96c('0x1c')](_0x3e7b68);}return _0x5048d9[_0xc96c('0x1d')](_0x3e7b68)[_0xc96c('0x1e')]();};}function respondWithResult(_0x30afd8,_0x5882dd){_0x5882dd=_0x5882dd||0xc8;return function(_0x5a7306){if(_0x5a7306){return _0x30afd8[_0xc96c('0x1d')](_0x5882dd)['json'](_0x5a7306);}};}function respondWithFilteredResult(_0x52d3b0,_0x3acc83){return function(_0x47b0e9){if(_0x47b0e9){var _0x49c3ab=typeof _0x3acc83[_0xc96c('0x1f')]===_0xc96c('0x20')&&typeof _0x3acc83[_0xc96c('0x21')]===_0xc96c('0x20');var _0x1bdb3c=_0x47b0e9[_0xc96c('0x22')];var _0x2cb529=_0x49c3ab?0x0:_0x3acc83[_0xc96c('0x1f')];var _0x44f2d7=_0x49c3ab?_0x47b0e9[_0xc96c('0x22')]:_0x3acc83['offset']+_0x3acc83['limit'];var _0x2ed344;if(_0x44f2d7>=_0x1bdb3c){_0x44f2d7=_0x1bdb3c;_0x2ed344=0xc8;}else{_0x2ed344=0xce;}_0x52d3b0[_0xc96c('0x1d')](_0x2ed344);return _0x52d3b0[_0xc96c('0x23')]('Content-Range',_0x2cb529+'-'+_0x44f2d7+'/'+_0x1bdb3c)[_0xc96c('0x24')](_0x47b0e9);}return null;};}function patchUpdates(_0x27aeda){return function(_0x46c4be){try{jsonpatch[_0xc96c('0x25')](_0x46c4be,_0x27aeda,!![]);}catch(_0x1f2cf9){return BPromise[_0xc96c('0x26')](_0x1f2cf9);}return _0x46c4be[_0xc96c('0x27')]();};}function saveUpdates(_0x38e09e,_0x395c6a){return function(_0x5c1c12){if(_0x5c1c12){return _0x5c1c12['update'](_0x38e09e)[_0xc96c('0x28')](function(_0x103470){return _0x103470;});}return null;};}function removeEntity(_0x38811f,_0x45d644){return function(_0x5c5ebb){if(_0x5c5ebb){return _0x5c5ebb[_0xc96c('0x29')]()[_0xc96c('0x28')](function(){_0x38811f[_0xc96c('0x1d')](0xcc)[_0xc96c('0x1e')]();});}};}function handleEntityNotFound(_0x1e571f,_0x2de6b9){return function(_0x5b65b5){if(!_0x5b65b5){_0x1e571f[_0xc96c('0x1c')](0x194);}return _0x5b65b5;};}function handleError(_0x577c62,_0x552473){_0x552473=_0x552473||0x1f4;return function(_0x3146be){logger[_0xc96c('0x2a')](_0x3146be[_0xc96c('0x2b')]);if(_0x3146be[_0xc96c('0x2c')]){delete _0x3146be[_0xc96c('0x2c')];}_0x577c62[_0xc96c('0x1d')](_0x552473)[_0xc96c('0x2d')](_0x3146be);};}exports[_0xc96c('0x2e')]=function(_0x3cd990,_0x44bfbb){var _0x54f5d7={},_0x361291={},_0x57872d={'count':0x0,'rows':[]};var _0x524d15=_['map'](db['SugarcrmConfiguration'][_0xc96c('0x2f')],function(_0x2ad940){return{'name':_0x2ad940[_0xc96c('0x30')],'type':_0x2ad940[_0xc96c('0x31')][_0xc96c('0x32')]};});_0x361291[_0xc96c('0x33')]=_[_0xc96c('0x34')](_0x524d15,_0xc96c('0x2c'));_0x361291[_0xc96c('0x35')]=_['keys'](_0x3cd990[_0xc96c('0x35')]);_0x361291[_0xc96c('0x36')]=_[_0xc96c('0x37')](_0x361291[_0xc96c('0x33')],_0x361291[_0xc96c('0x35')]);_0x54f5d7[_0xc96c('0x38')]=_[_0xc96c('0x37')](_0x361291[_0xc96c('0x33')],qs['fields'](_0x3cd990[_0xc96c('0x35')][_0xc96c('0x39')]));_0x54f5d7[_0xc96c('0x38')]=_0x54f5d7[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x54f5d7['attributes']:_0x361291['model'];if(!_0x3cd990['query'][_0xc96c('0x3b')]('nolimit')){_0x54f5d7['limit']=qs[_0xc96c('0x21')](_0x3cd990[_0xc96c('0x35')][_0xc96c('0x21')]);_0x54f5d7['offset']=qs[_0xc96c('0x1f')](_0x3cd990[_0xc96c('0x35')][_0xc96c('0x1f')]);}_0x54f5d7['order']=qs[_0xc96c('0x3c')](_0x3cd990['query'][_0xc96c('0x3c')]);_0x54f5d7[_0xc96c('0x3d')]=qs[_0xc96c('0x36')](_[_0xc96c('0x3e')](_0x3cd990[_0xc96c('0x35')],_0x361291[_0xc96c('0x36')]),_0x524d15);if(_0x3cd990[_0xc96c('0x35')][_0xc96c('0x3f')]){_0x54f5d7['where']=_[_0xc96c('0x40')](_0x54f5d7[_0xc96c('0x3d')],{'$or':_['map'](_0x524d15,function(_0x6e8176){if(_0x6e8176[_0xc96c('0x31')]!==_0xc96c('0x41')){var _0xc6680b={};_0xc6680b[_0x6e8176[_0xc96c('0x2c')]]={'$like':'%'+_0x3cd990[_0xc96c('0x35')][_0xc96c('0x3f')]+'%'};return _0xc6680b;}})});}_0x54f5d7=_['merge']({},_0x54f5d7,_0x3cd990[_0xc96c('0x42')]);var _0x2d9cd3={'where':_0x54f5d7['where']};return db[_0xc96c('0x43')]['count'](_0x2d9cd3)[_0xc96c('0x28')](function(_0x48838e){_0x57872d[_0xc96c('0x22')]=_0x48838e;if(_0x3cd990[_0xc96c('0x35')]['includeAll']){_0x54f5d7[_0xc96c('0x44')]=[{'all':!![]}];}return db[_0xc96c('0x43')]['findAll'](_0x54f5d7);})[_0xc96c('0x28')](function(_0x469635){_0x57872d[_0xc96c('0x45')]=_0x469635;return _0x57872d;})[_0xc96c('0x28')](respondWithFilteredResult(_0x44bfbb,_0x54f5d7))['catch'](handleError(_0x44bfbb,null));};exports[_0xc96c('0x46')]=function(_0x39d131,_0x126120){var _0x163381={'raw':![],'where':{'id':_0x39d131[_0xc96c('0x47')]['id']}},_0x27c782={};_0x27c782[_0xc96c('0x33')]=_['keys'](db[_0xc96c('0x43')][_0xc96c('0x2f')]);_0x27c782['query']=_[_0xc96c('0x48')](_0x39d131[_0xc96c('0x35')]);_0x27c782['filters']=_['intersection'](_0x27c782['model'],_0x27c782[_0xc96c('0x35')]);_0x163381['attributes']=_[_0xc96c('0x37')](_0x27c782['model'],qs['fields'](_0x39d131[_0xc96c('0x35')][_0xc96c('0x39')]));_0x163381[_0xc96c('0x38')]=_0x163381[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x163381[_0xc96c('0x38')]:_0x27c782['model'];if(_0x39d131[_0xc96c('0x35')][_0xc96c('0x49')]){_0x163381[_0xc96c('0x44')]=[{'all':!![]}];}_0x163381=_[_0xc96c('0x40')]({},_0x163381,_0x39d131[_0xc96c('0x42')]);return db[_0xc96c('0x43')][_0xc96c('0x4a')](_0x163381)['then'](handleEntityNotFound(_0x126120,null))['then'](respondWithResult(_0x126120,null))[_0xc96c('0x4b')](handleError(_0x126120,null));};exports[_0xc96c('0x4c')]=function(_0x287301,_0x54178f){return db[_0xc96c('0x43')][_0xc96c('0x4c')](_0x287301['body'],{})[_0xc96c('0x28')](respondWithResult(_0x54178f,0xc9))['catch'](handleError(_0x54178f,null));};exports['update']=function(_0xdc1054,_0x3ff46d){if(_0xdc1054['body']['id']){delete _0xdc1054[_0xc96c('0x4d')]['id'];}return db[_0xc96c('0x43')][_0xc96c('0x4a')]({'where':{'id':_0xdc1054[_0xc96c('0x47')]['id']}})[_0xc96c('0x28')](handleEntityNotFound(_0x3ff46d,null))[_0xc96c('0x28')](saveUpdates(_0xdc1054[_0xc96c('0x4d')],null))[_0xc96c('0x28')](respondWithResult(_0x3ff46d,null))[_0xc96c('0x4b')](handleError(_0x3ff46d,null));};exports[_0xc96c('0x29')]=function(_0x19f9bb,_0xc9c46c){return db[_0xc96c('0x43')]['find']({'where':{'id':_0x19f9bb[_0xc96c('0x47')]['id']}})[_0xc96c('0x28')](handleEntityNotFound(_0xc9c46c,null))[_0xc96c('0x28')](removeEntity(_0xc9c46c,null))['catch'](handleError(_0xc9c46c,null));};exports[_0xc96c('0x4e')]=function(_0x10ca6b,_0x3fb73e,_0x97c604){var _0x423829={};var _0x2c0d0e={};var _0x44a5ce;var _0x520e5e;return db[_0xc96c('0x43')]['findOne']({'where':{'id':_0x10ca6b[_0xc96c('0x47')]['id']}})[_0xc96c('0x28')](handleEntityNotFound(_0x3fb73e,null))[_0xc96c('0x28')](function(_0x152a3c){if(_0x152a3c){_0x44a5ce=_0x152a3c;_0x2c0d0e[_0xc96c('0x33')]=_[_0xc96c('0x48')](db[_0xc96c('0x4f')][_0xc96c('0x2f')]);_0x2c0d0e[_0xc96c('0x35')]=_[_0xc96c('0x48')](_0x10ca6b[_0xc96c('0x35')]);_0x2c0d0e[_0xc96c('0x36')]=_[_0xc96c('0x37')](_0x2c0d0e[_0xc96c('0x33')],_0x2c0d0e[_0xc96c('0x35')]);_0x423829['attributes']=_[_0xc96c('0x37')](_0x2c0d0e[_0xc96c('0x33')],qs[_0xc96c('0x39')](_0x10ca6b[_0xc96c('0x35')][_0xc96c('0x39')]));_0x423829[_0xc96c('0x38')]=_0x423829[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x423829['attributes']:_0x2c0d0e[_0xc96c('0x33')];_0x423829['order']=qs['sort'](_0x10ca6b[_0xc96c('0x35')]['sort']);_0x423829[_0xc96c('0x3d')]=qs['filters'](_[_0xc96c('0x3e')](_0x10ca6b[_0xc96c('0x35')],_0x2c0d0e[_0xc96c('0x36')]));if(_0x10ca6b[_0xc96c('0x35')][_0xc96c('0x3f')]){_0x423829[_0xc96c('0x3d')]=_[_0xc96c('0x40')](_0x423829[_0xc96c('0x3d')],{'$or':_['map'](_0x423829[_0xc96c('0x38')],function(_0x425c03){var _0x3f0fe0={};_0x3f0fe0[_0x425c03]={'$like':'%'+_0x10ca6b[_0xc96c('0x35')][_0xc96c('0x3f')]+'%'};return _0x3f0fe0;})});}_0x423829=_[_0xc96c('0x40')]({},_0x423829,_0x10ca6b['options']);return _0x44a5ce[_0xc96c('0x4e')](_0x423829);}})[_0xc96c('0x28')](function(_0x265bba){if(_0x265bba){_0x520e5e=_0x265bba[_0xc96c('0x3a')];if(!_0x10ca6b[_0xc96c('0x35')]['hasOwnProperty'](_0xc96c('0x50'))){_0x423829[_0xc96c('0x21')]=qs['limit'](_0x10ca6b[_0xc96c('0x35')]['limit']);_0x423829[_0xc96c('0x1f')]=qs[_0xc96c('0x1f')](_0x10ca6b[_0xc96c('0x35')][_0xc96c('0x1f')]);}return _0x44a5ce['getFields'](_0x423829);}})[_0xc96c('0x28')](function(_0x179b32){if(_0x179b32){return _0x179b32?{'count':_0x520e5e,'rows':_0x179b32}:null;}})[_0xc96c('0x28')](respondWithResult(_0x3fb73e,null))[_0xc96c('0x4b')](handleError(_0x3fb73e,null));};exports[_0xc96c('0x51')]=function(_0x3a06c7,_0x8183db,_0x242138){var _0x99dad8={};var _0x2842e3={};var _0x4db9d6;var _0x1c502a;return db[_0xc96c('0x43')]['findOne']({'where':{'id':_0x3a06c7[_0xc96c('0x47')]['id']}})['then'](handleEntityNotFound(_0x8183db,null))[_0xc96c('0x28')](function(_0x5079dc){if(_0x5079dc){_0x4db9d6=_0x5079dc;_0x2842e3[_0xc96c('0x33')]=_[_0xc96c('0x48')](db['SugarcrmField'][_0xc96c('0x2f')]);_0x2842e3[_0xc96c('0x35')]=_['keys'](_0x3a06c7[_0xc96c('0x35')]);_0x2842e3[_0xc96c('0x36')]=_[_0xc96c('0x37')](_0x2842e3[_0xc96c('0x33')],_0x2842e3[_0xc96c('0x35')]);_0x99dad8[_0xc96c('0x38')]=_['intersection'](_0x2842e3[_0xc96c('0x33')],qs[_0xc96c('0x39')](_0x3a06c7['query'][_0xc96c('0x39')]));_0x99dad8[_0xc96c('0x38')]=_0x99dad8[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x99dad8[_0xc96c('0x38')]:_0x2842e3['model'];_0x99dad8['order']=qs[_0xc96c('0x3c')](_0x3a06c7[_0xc96c('0x35')]['sort']);_0x99dad8[_0xc96c('0x3d')]=qs[_0xc96c('0x36')](_[_0xc96c('0x3e')](_0x3a06c7['query'],_0x2842e3[_0xc96c('0x36')]));if(_0x3a06c7[_0xc96c('0x35')][_0xc96c('0x3f')]){_0x99dad8['where']=_[_0xc96c('0x40')](_0x99dad8['where'],{'$or':_[_0xc96c('0x34')](_0x99dad8[_0xc96c('0x38')],function(_0x506b79){var _0x2396ad={};_0x2396ad[_0x506b79]={'$like':'%'+_0x3a06c7[_0xc96c('0x35')][_0xc96c('0x3f')]+'%'};return _0x2396ad;})});}_0x99dad8=_[_0xc96c('0x40')]({},_0x99dad8,_0x3a06c7[_0xc96c('0x42')]);return _0x4db9d6[_0xc96c('0x51')](_0x99dad8);}})[_0xc96c('0x28')](function(_0x587922){if(_0x587922){_0x1c502a=_0x587922[_0xc96c('0x3a')];if(!_0x3a06c7['query'][_0xc96c('0x3b')](_0xc96c('0x50'))){_0x99dad8['limit']=qs['limit'](_0x3a06c7[_0xc96c('0x35')][_0xc96c('0x21')]);_0x99dad8[_0xc96c('0x1f')]=qs[_0xc96c('0x1f')](_0x3a06c7['query'][_0xc96c('0x1f')]);}return _0x4db9d6[_0xc96c('0x51')](_0x99dad8);}})[_0xc96c('0x28')](function(_0x383346){if(_0x383346){return _0x383346?{'count':_0x1c502a,'rows':_0x383346}:null;}})[_0xc96c('0x28')](respondWithResult(_0x8183db,null))[_0xc96c('0x4b')](handleError(_0x8183db,null));};exports[_0xc96c('0x52')]=function(_0x564e93,_0x4477b3,_0x875b58){var _0x4c33a8={};var _0x3fcff2={};var _0xe511c7;var _0x39bd12;return db[_0xc96c('0x43')][_0xc96c('0x53')]({'where':{'id':_0x564e93[_0xc96c('0x47')]['id']}})['then'](handleEntityNotFound(_0x4477b3,null))[_0xc96c('0x28')](function(_0x305181){if(_0x305181){_0xe511c7=_0x305181;_0x3fcff2['model']=_[_0xc96c('0x48')](db[_0xc96c('0x4f')]['rawAttributes']);_0x3fcff2[_0xc96c('0x35')]=_[_0xc96c('0x48')](_0x564e93[_0xc96c('0x35')]);_0x3fcff2[_0xc96c('0x36')]=_[_0xc96c('0x37')](_0x3fcff2[_0xc96c('0x33')],_0x3fcff2[_0xc96c('0x35')]);_0x4c33a8[_0xc96c('0x38')]=_[_0xc96c('0x37')](_0x3fcff2[_0xc96c('0x33')],qs[_0xc96c('0x39')](_0x564e93[_0xc96c('0x35')][_0xc96c('0x39')]));_0x4c33a8[_0xc96c('0x38')]=_0x4c33a8[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x4c33a8[_0xc96c('0x38')]:_0x3fcff2[_0xc96c('0x33')];_0x4c33a8['order']=qs[_0xc96c('0x3c')](_0x564e93[_0xc96c('0x35')][_0xc96c('0x3c')]);_0x4c33a8[_0xc96c('0x3d')]=qs[_0xc96c('0x36')](_[_0xc96c('0x3e')](_0x564e93[_0xc96c('0x35')],_0x3fcff2[_0xc96c('0x36')]));if(_0x564e93[_0xc96c('0x35')][_0xc96c('0x3f')]){_0x4c33a8[_0xc96c('0x3d')]=_['merge'](_0x4c33a8['where'],{'$or':_[_0xc96c('0x34')](_0x4c33a8[_0xc96c('0x38')],function(_0x50760c){var _0x56ae44={};_0x56ae44[_0x50760c]={'$like':'%'+_0x564e93[_0xc96c('0x35')][_0xc96c('0x3f')]+'%'};return _0x56ae44;})});}_0x4c33a8=_['merge']({},_0x4c33a8,_0x564e93[_0xc96c('0x42')]);return _0xe511c7[_0xc96c('0x52')](_0x4c33a8);}})['then'](function(_0x16fd43){if(_0x16fd43){_0x39bd12=_0x16fd43['length'];if(!_0x564e93['query'][_0xc96c('0x3b')](_0xc96c('0x50'))){_0x4c33a8['limit']=qs[_0xc96c('0x21')](_0x564e93[_0xc96c('0x35')][_0xc96c('0x21')]);_0x4c33a8[_0xc96c('0x1f')]=qs[_0xc96c('0x1f')](_0x564e93[_0xc96c('0x35')][_0xc96c('0x1f')]);}return _0xe511c7[_0xc96c('0x52')](_0x4c33a8);}})['then'](function(_0x5bd9f7){if(_0x5bd9f7){return _0x5bd9f7?{'count':_0x39bd12,'rows':_0x5bd9f7}:null;}})[_0xc96c('0x28')](respondWithResult(_0x4477b3,null))[_0xc96c('0x4b')](handleError(_0x4477b3,null));}; \ No newline at end of file +var _0xe1d8=['body','getFields','findOne','SugarcrmField','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','name','send','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','query','filters','model','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','fields','include','find','create'];(function(_0x57c5cb,_0x5f3e10){var _0x58d7cf=function(_0x16b455){while(--_0x16b455){_0x57c5cb['push'](_0x57c5cb['shift']());}};_0x58d7cf(++_0x5f3e10);}(_0xe1d8,0x1a1));var _0x8e1d=function(_0x3c5fba,_0x2dd4df){_0x3c5fba=_0x3c5fba-0x0;var _0x1fc038=_0xe1d8[_0x3c5fba];return _0x1fc038;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8e1d('0x0'));var zipdir=require(_0x8e1d('0x1'));var jsonpatch=require(_0x8e1d('0x2'));var rp=require('request-promise');var moment=require(_0x8e1d('0x3'));var BPromise=require(_0x8e1d('0x4'));var Mustache=require(_0x8e1d('0x5'));var util=require('util');var path=require(_0x8e1d('0x6'));var sox=require(_0x8e1d('0x7'));var csv=require(_0x8e1d('0x8'));var ejs=require(_0x8e1d('0x9'));var fs=require('fs');var fs_extra=require(_0x8e1d('0xa'));var _=require(_0x8e1d('0xb'));var squel=require(_0x8e1d('0xc'));var crypto=require(_0x8e1d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8e1d('0xe'));var toCsv=require(_0x8e1d('0x8'));var querystring=require(_0x8e1d('0xf'));var Papa=require(_0x8e1d('0x10'));var Redis=require(_0x8e1d('0x11'));var authService=require(_0x8e1d('0x12'));var qs=require(_0x8e1d('0x13'));var as=require(_0x8e1d('0x14'));var hardwareService=require(_0x8e1d('0x15'));var logger=require(_0x8e1d('0x16'))(_0x8e1d('0x17'));var utils=require(_0x8e1d('0x18'));var config=require(_0x8e1d('0x19'));var licenseUtil=require(_0x8e1d('0x1a'));var db=require(_0x8e1d('0x1b'))['db'];function respondWithStatusCode(_0x490766,_0x3f8614){_0x3f8614=_0x3f8614||0xcc;return function(_0x4a03c6){if(_0x4a03c6){return _0x490766[_0x8e1d('0x1c')](_0x3f8614);}return _0x490766[_0x8e1d('0x1d')](_0x3f8614)['end']();};}function respondWithResult(_0x408895,_0x1ab3d5){_0x1ab3d5=_0x1ab3d5||0xc8;return function(_0x196f5b){if(_0x196f5b){return _0x408895[_0x8e1d('0x1d')](_0x1ab3d5)[_0x8e1d('0x1e')](_0x196f5b);}};}function respondWithFilteredResult(_0x2a336f,_0x3b68ba){return function(_0x2f01f2){if(_0x2f01f2){var _0x275ea8=typeof _0x3b68ba['offset']==='undefined'&&typeof _0x3b68ba[_0x8e1d('0x1f')]==='undefined';var _0x451271=_0x2f01f2[_0x8e1d('0x20')];var _0x43eba9=_0x275ea8?0x0:_0x3b68ba[_0x8e1d('0x21')];var _0x2597b5=_0x275ea8?_0x2f01f2[_0x8e1d('0x20')]:_0x3b68ba[_0x8e1d('0x21')]+_0x3b68ba[_0x8e1d('0x1f')];var _0x5bee93;if(_0x2597b5>=_0x451271){_0x2597b5=_0x451271;_0x5bee93=0xc8;}else{_0x5bee93=0xce;}_0x2a336f['status'](_0x5bee93);return _0x2a336f[_0x8e1d('0x22')](_0x8e1d('0x23'),_0x43eba9+'-'+_0x2597b5+'/'+_0x451271)[_0x8e1d('0x1e')](_0x2f01f2);}return null;};}function patchUpdates(_0x1d2ce2){return function(_0x430ec5){try{jsonpatch[_0x8e1d('0x24')](_0x430ec5,_0x1d2ce2,!![]);}catch(_0x2e68c6){return BPromise[_0x8e1d('0x25')](_0x2e68c6);}return _0x430ec5[_0x8e1d('0x26')]();};}function saveUpdates(_0x544c35,_0x524806){return function(_0x9d0166){if(_0x9d0166){return _0x9d0166['update'](_0x544c35)[_0x8e1d('0x27')](function(_0xfd377c){return _0xfd377c;});}return null;};}function removeEntity(_0x3cab0a,_0x46dfdf){return function(_0x569d19){if(_0x569d19){return _0x569d19[_0x8e1d('0x28')]()[_0x8e1d('0x27')](function(){_0x3cab0a[_0x8e1d('0x1d')](0xcc)[_0x8e1d('0x29')]();});}};}function handleEntityNotFound(_0x65c398,_0x2cc84e){return function(_0x3cbc75){if(!_0x3cbc75){_0x65c398[_0x8e1d('0x1c')](0x194);}return _0x3cbc75;};}function handleError(_0x375856,_0x9dc9d3){_0x9dc9d3=_0x9dc9d3||0x1f4;return function(_0x2cd73c){logger['error'](_0x2cd73c['stack']);if(_0x2cd73c['name']){delete _0x2cd73c[_0x8e1d('0x2a')];}_0x375856[_0x8e1d('0x1d')](_0x9dc9d3)[_0x8e1d('0x2b')](_0x2cd73c);};}exports['index']=function(_0x1ed794,_0xd674b){var _0x1ff0cb={},_0x1bbcff={},_0x208040={'count':0x0,'rows':[]};var _0x501fe8=_[_0x8e1d('0x2c')](db[_0x8e1d('0x2d')][_0x8e1d('0x2e')],function(_0x1c245e){return{'name':_0x1c245e[_0x8e1d('0x2f')],'type':_0x1c245e[_0x8e1d('0x30')][_0x8e1d('0x31')]};});_0x1bbcff['model']=_[_0x8e1d('0x2c')](_0x501fe8,_0x8e1d('0x2a'));_0x1bbcff[_0x8e1d('0x32')]=_['keys'](_0x1ed794[_0x8e1d('0x32')]);_0x1bbcff[_0x8e1d('0x33')]=_['intersection'](_0x1bbcff[_0x8e1d('0x34')],_0x1bbcff['query']);_0x1ff0cb['attributes']=_[_0x8e1d('0x35')](_0x1bbcff[_0x8e1d('0x34')],qs['fields'](_0x1ed794[_0x8e1d('0x32')]['fields']));_0x1ff0cb[_0x8e1d('0x36')]=_0x1ff0cb[_0x8e1d('0x36')][_0x8e1d('0x37')]?_0x1ff0cb[_0x8e1d('0x36')]:_0x1bbcff[_0x8e1d('0x34')];if(!_0x1ed794['query']['hasOwnProperty'](_0x8e1d('0x38'))){_0x1ff0cb[_0x8e1d('0x1f')]=qs[_0x8e1d('0x1f')](_0x1ed794[_0x8e1d('0x32')]['limit']);_0x1ff0cb[_0x8e1d('0x21')]=qs[_0x8e1d('0x21')](_0x1ed794[_0x8e1d('0x32')][_0x8e1d('0x21')]);}_0x1ff0cb[_0x8e1d('0x39')]=qs[_0x8e1d('0x3a')](_0x1ed794[_0x8e1d('0x32')]['sort']);_0x1ff0cb[_0x8e1d('0x3b')]=qs[_0x8e1d('0x33')](_[_0x8e1d('0x3c')](_0x1ed794[_0x8e1d('0x32')],_0x1bbcff['filters']),_0x501fe8);if(_0x1ed794['query'][_0x8e1d('0x3d')]){_0x1ff0cb['where']=_[_0x8e1d('0x3e')](_0x1ff0cb[_0x8e1d('0x3b')],{'$or':_[_0x8e1d('0x2c')](_0x501fe8,function(_0x439026){if(_0x439026[_0x8e1d('0x30')]!==_0x8e1d('0x3f')){var _0x3bb48f={};_0x3bb48f[_0x439026[_0x8e1d('0x2a')]]={'$like':'%'+_0x1ed794[_0x8e1d('0x32')]['filter']+'%'};return _0x3bb48f;}})});}_0x1ff0cb=_[_0x8e1d('0x3e')]({},_0x1ff0cb,_0x1ed794[_0x8e1d('0x40')]);var _0x40bbb5={'where':_0x1ff0cb[_0x8e1d('0x3b')]};return db[_0x8e1d('0x2d')]['count'](_0x40bbb5)['then'](function(_0x204efe){_0x208040[_0x8e1d('0x20')]=_0x204efe;if(_0x1ed794[_0x8e1d('0x32')]['includeAll']){_0x1ff0cb['include']=[{'all':!![]}];}return db[_0x8e1d('0x2d')][_0x8e1d('0x41')](_0x1ff0cb);})['then'](function(_0x2cc746){_0x208040[_0x8e1d('0x42')]=_0x2cc746;return _0x208040;})[_0x8e1d('0x27')](respondWithFilteredResult(_0xd674b,_0x1ff0cb))[_0x8e1d('0x43')](handleError(_0xd674b,null));};exports[_0x8e1d('0x44')]=function(_0x558c07,_0x4071f4){var _0x176a83={'raw':![],'where':{'id':_0x558c07[_0x8e1d('0x45')]['id']}},_0x1db130={};_0x1db130[_0x8e1d('0x34')]=_[_0x8e1d('0x46')](db[_0x8e1d('0x2d')][_0x8e1d('0x2e')]);_0x1db130['query']=_[_0x8e1d('0x46')](_0x558c07[_0x8e1d('0x32')]);_0x1db130[_0x8e1d('0x33')]=_[_0x8e1d('0x35')](_0x1db130[_0x8e1d('0x34')],_0x1db130[_0x8e1d('0x32')]);_0x176a83[_0x8e1d('0x36')]=_[_0x8e1d('0x35')](_0x1db130[_0x8e1d('0x34')],qs[_0x8e1d('0x47')](_0x558c07[_0x8e1d('0x32')][_0x8e1d('0x47')]));_0x176a83[_0x8e1d('0x36')]=_0x176a83[_0x8e1d('0x36')]['length']?_0x176a83['attributes']:_0x1db130[_0x8e1d('0x34')];if(_0x558c07[_0x8e1d('0x32')]['includeAll']){_0x176a83[_0x8e1d('0x48')]=[{'all':!![]}];}_0x176a83=_['merge']({},_0x176a83,_0x558c07[_0x8e1d('0x40')]);return db['SugarcrmConfiguration'][_0x8e1d('0x49')](_0x176a83)[_0x8e1d('0x27')](handleEntityNotFound(_0x4071f4,null))[_0x8e1d('0x27')](respondWithResult(_0x4071f4,null))[_0x8e1d('0x43')](handleError(_0x4071f4,null));};exports[_0x8e1d('0x4a')]=function(_0x4fc0e1,_0x1c07ca){return db[_0x8e1d('0x2d')]['create'](_0x4fc0e1[_0x8e1d('0x4b')],{})[_0x8e1d('0x27')](respondWithResult(_0x1c07ca,0xc9))[_0x8e1d('0x43')](handleError(_0x1c07ca,null));};exports['update']=function(_0x531ae8,_0x515949){if(_0x531ae8[_0x8e1d('0x4b')]['id']){delete _0x531ae8[_0x8e1d('0x4b')]['id'];}return db[_0x8e1d('0x2d')][_0x8e1d('0x49')]({'where':{'id':_0x531ae8[_0x8e1d('0x45')]['id']}})[_0x8e1d('0x27')](handleEntityNotFound(_0x515949,null))['then'](saveUpdates(_0x531ae8[_0x8e1d('0x4b')],null))[_0x8e1d('0x27')](respondWithResult(_0x515949,null))[_0x8e1d('0x43')](handleError(_0x515949,null));};exports['destroy']=function(_0x4d9bcb,_0x45a2f9){return db[_0x8e1d('0x2d')][_0x8e1d('0x49')]({'where':{'id':_0x4d9bcb[_0x8e1d('0x45')]['id']}})['then'](handleEntityNotFound(_0x45a2f9,null))[_0x8e1d('0x27')](removeEntity(_0x45a2f9,null))[_0x8e1d('0x43')](handleError(_0x45a2f9,null));};exports[_0x8e1d('0x4c')]=function(_0x2ead6b,_0x558d8c,_0x26f0ee){var _0x491ac8={};var _0x3108b6={};var _0x2b9abc;var _0x3e9ddd;return db[_0x8e1d('0x2d')][_0x8e1d('0x4d')]({'where':{'id':_0x2ead6b[_0x8e1d('0x45')]['id']}})[_0x8e1d('0x27')](handleEntityNotFound(_0x558d8c,null))[_0x8e1d('0x27')](function(_0x1bb9a2){if(_0x1bb9a2){_0x2b9abc=_0x1bb9a2;_0x3108b6[_0x8e1d('0x34')]=_[_0x8e1d('0x46')](db[_0x8e1d('0x4e')][_0x8e1d('0x2e')]);_0x3108b6[_0x8e1d('0x32')]=_[_0x8e1d('0x46')](_0x2ead6b['query']);_0x3108b6['filters']=_[_0x8e1d('0x35')](_0x3108b6['model'],_0x3108b6[_0x8e1d('0x32')]);_0x491ac8[_0x8e1d('0x36')]=_[_0x8e1d('0x35')](_0x3108b6[_0x8e1d('0x34')],qs[_0x8e1d('0x47')](_0x2ead6b[_0x8e1d('0x32')][_0x8e1d('0x47')]));_0x491ac8[_0x8e1d('0x36')]=_0x491ac8[_0x8e1d('0x36')][_0x8e1d('0x37')]?_0x491ac8[_0x8e1d('0x36')]:_0x3108b6['model'];_0x491ac8[_0x8e1d('0x39')]=qs[_0x8e1d('0x3a')](_0x2ead6b[_0x8e1d('0x32')][_0x8e1d('0x3a')]);_0x491ac8['where']=qs[_0x8e1d('0x33')](_[_0x8e1d('0x3c')](_0x2ead6b['query'],_0x3108b6[_0x8e1d('0x33')]));if(_0x2ead6b[_0x8e1d('0x32')][_0x8e1d('0x3d')]){_0x491ac8[_0x8e1d('0x3b')]=_[_0x8e1d('0x3e')](_0x491ac8[_0x8e1d('0x3b')],{'$or':_[_0x8e1d('0x2c')](_0x491ac8[_0x8e1d('0x36')],function(_0x2000c5){var _0x4c9aec={};_0x4c9aec[_0x2000c5]={'$like':'%'+_0x2ead6b[_0x8e1d('0x32')][_0x8e1d('0x3d')]+'%'};return _0x4c9aec;})});}_0x491ac8=_['merge']({},_0x491ac8,_0x2ead6b['options']);return _0x2b9abc[_0x8e1d('0x4c')](_0x491ac8);}})[_0x8e1d('0x27')](function(_0x2cbc04){if(_0x2cbc04){_0x3e9ddd=_0x2cbc04[_0x8e1d('0x37')];if(!_0x2ead6b[_0x8e1d('0x32')][_0x8e1d('0x4f')](_0x8e1d('0x38'))){_0x491ac8[_0x8e1d('0x1f')]=qs[_0x8e1d('0x1f')](_0x2ead6b[_0x8e1d('0x32')]['limit']);_0x491ac8[_0x8e1d('0x21')]=qs[_0x8e1d('0x21')](_0x2ead6b[_0x8e1d('0x32')]['offset']);}return _0x2b9abc[_0x8e1d('0x4c')](_0x491ac8);}})[_0x8e1d('0x27')](function(_0x475b50){if(_0x475b50){return _0x475b50?{'count':_0x3e9ddd,'rows':_0x475b50}:null;}})[_0x8e1d('0x27')](respondWithResult(_0x558d8c,null))[_0x8e1d('0x43')](handleError(_0x558d8c,null));};exports['getSubjects']=function(_0x56e61a,_0x45839e,_0x3e9841){var _0x1fba99={};var _0x43833e={};var _0x2d3b51;var _0x482532;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x56e61a[_0x8e1d('0x45')]['id']}})['then'](handleEntityNotFound(_0x45839e,null))[_0x8e1d('0x27')](function(_0x3a3ad6){if(_0x3a3ad6){_0x2d3b51=_0x3a3ad6;_0x43833e[_0x8e1d('0x34')]=_[_0x8e1d('0x46')](db['SugarcrmField']['rawAttributes']);_0x43833e['query']=_[_0x8e1d('0x46')](_0x56e61a[_0x8e1d('0x32')]);_0x43833e['filters']=_['intersection'](_0x43833e[_0x8e1d('0x34')],_0x43833e[_0x8e1d('0x32')]);_0x1fba99[_0x8e1d('0x36')]=_[_0x8e1d('0x35')](_0x43833e['model'],qs[_0x8e1d('0x47')](_0x56e61a[_0x8e1d('0x32')][_0x8e1d('0x47')]));_0x1fba99['attributes']=_0x1fba99[_0x8e1d('0x36')]['length']?_0x1fba99[_0x8e1d('0x36')]:_0x43833e['model'];_0x1fba99[_0x8e1d('0x39')]=qs[_0x8e1d('0x3a')](_0x56e61a[_0x8e1d('0x32')]['sort']);_0x1fba99['where']=qs['filters'](_['pick'](_0x56e61a['query'],_0x43833e[_0x8e1d('0x33')]));if(_0x56e61a[_0x8e1d('0x32')][_0x8e1d('0x3d')]){_0x1fba99[_0x8e1d('0x3b')]=_['merge'](_0x1fba99['where'],{'$or':_[_0x8e1d('0x2c')](_0x1fba99[_0x8e1d('0x36')],function(_0x221a90){var _0x5e1503={};_0x5e1503[_0x221a90]={'$like':'%'+_0x56e61a['query'][_0x8e1d('0x3d')]+'%'};return _0x5e1503;})});}_0x1fba99=_['merge']({},_0x1fba99,_0x56e61a[_0x8e1d('0x40')]);return _0x2d3b51[_0x8e1d('0x50')](_0x1fba99);}})[_0x8e1d('0x27')](function(_0x722e1f){if(_0x722e1f){_0x482532=_0x722e1f[_0x8e1d('0x37')];if(!_0x56e61a['query'][_0x8e1d('0x4f')]('nolimit')){_0x1fba99[_0x8e1d('0x1f')]=qs[_0x8e1d('0x1f')](_0x56e61a[_0x8e1d('0x32')][_0x8e1d('0x1f')]);_0x1fba99['offset']=qs[_0x8e1d('0x21')](_0x56e61a[_0x8e1d('0x32')][_0x8e1d('0x21')]);}return _0x2d3b51[_0x8e1d('0x50')](_0x1fba99);}})['then'](function(_0x299dab){if(_0x299dab){return _0x299dab?{'count':_0x482532,'rows':_0x299dab}:null;}})[_0x8e1d('0x27')](respondWithResult(_0x45839e,null))['catch'](handleError(_0x45839e,null));};exports[_0x8e1d('0x51')]=function(_0x164a40,_0x4f1be7,_0x32a2e4){var _0x2fbe68={};var _0x1ce92a={};var _0x36e62a;var _0x45b0a2;return db[_0x8e1d('0x2d')]['findOne']({'where':{'id':_0x164a40[_0x8e1d('0x45')]['id']}})[_0x8e1d('0x27')](handleEntityNotFound(_0x4f1be7,null))['then'](function(_0xc84a){if(_0xc84a){_0x36e62a=_0xc84a;_0x1ce92a['model']=_[_0x8e1d('0x46')](db[_0x8e1d('0x4e')][_0x8e1d('0x2e')]);_0x1ce92a[_0x8e1d('0x32')]=_['keys'](_0x164a40[_0x8e1d('0x32')]);_0x1ce92a[_0x8e1d('0x33')]=_[_0x8e1d('0x35')](_0x1ce92a[_0x8e1d('0x34')],_0x1ce92a[_0x8e1d('0x32')]);_0x2fbe68['attributes']=_[_0x8e1d('0x35')](_0x1ce92a[_0x8e1d('0x34')],qs['fields'](_0x164a40[_0x8e1d('0x32')]['fields']));_0x2fbe68[_0x8e1d('0x36')]=_0x2fbe68[_0x8e1d('0x36')][_0x8e1d('0x37')]?_0x2fbe68[_0x8e1d('0x36')]:_0x1ce92a[_0x8e1d('0x34')];_0x2fbe68[_0x8e1d('0x39')]=qs['sort'](_0x164a40[_0x8e1d('0x32')][_0x8e1d('0x3a')]);_0x2fbe68[_0x8e1d('0x3b')]=qs[_0x8e1d('0x33')](_[_0x8e1d('0x3c')](_0x164a40['query'],_0x1ce92a['filters']));if(_0x164a40[_0x8e1d('0x32')][_0x8e1d('0x3d')]){_0x2fbe68[_0x8e1d('0x3b')]=_['merge'](_0x2fbe68['where'],{'$or':_['map'](_0x2fbe68[_0x8e1d('0x36')],function(_0x42458e){var _0x2d6dc6={};_0x2d6dc6[_0x42458e]={'$like':'%'+_0x164a40['query'][_0x8e1d('0x3d')]+'%'};return _0x2d6dc6;})});}_0x2fbe68=_[_0x8e1d('0x3e')]({},_0x2fbe68,_0x164a40[_0x8e1d('0x40')]);return _0x36e62a[_0x8e1d('0x51')](_0x2fbe68);}})[_0x8e1d('0x27')](function(_0x2f9a13){if(_0x2f9a13){_0x45b0a2=_0x2f9a13['length'];if(!_0x164a40[_0x8e1d('0x32')][_0x8e1d('0x4f')](_0x8e1d('0x38'))){_0x2fbe68[_0x8e1d('0x1f')]=qs[_0x8e1d('0x1f')](_0x164a40[_0x8e1d('0x32')]['limit']);_0x2fbe68[_0x8e1d('0x21')]=qs['offset'](_0x164a40[_0x8e1d('0x32')]['offset']);}return _0x36e62a[_0x8e1d('0x51')](_0x2fbe68);}})[_0x8e1d('0x27')](function(_0x578d92){if(_0x578d92){return _0x578d92?{'count':_0x45b0a2,'rows':_0x578d92}:null;}})[_0x8e1d('0x27')](respondWithResult(_0x4f1be7,null))[_0x8e1d('0x43')](handleError(_0x4f1be7,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 08e96ac..2b12d33 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 _0x23ce=['./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x23ce,0xc5));var _0xe23c=function(_0x35ac1c,_0x947004){_0x35ac1c=_0x35ac1c-0x0;var _0x3ebfc4=_0x23ce[_0x35ac1c];return _0x3ebfc4;};'use strict';var _=require(_0xe23c('0x0'));var util=require(_0xe23c('0x1'));var logger=require(_0xe23c('0x2'))(_0xe23c('0x3'));var moment=require('moment');var BPromise=require(_0xe23c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe23c('0x5'));var rimraf=require(_0xe23c('0x6'));var config=require('../../config/environment');var attributes=require(_0xe23c('0x7'));module[_0xe23c('0x8')]=function(_0x2dbc09,_0x4dc602){return _0x2dbc09[_0xe23c('0x9')](_0xe23c('0xa'),attributes,{'tableName':_0xe23c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a4f=['util','moment','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash'];(function(_0x24b04e,_0x167740){var _0x1fe2ae=function(_0x1d57b4){while(--_0x1d57b4){_0x24b04e['push'](_0x24b04e['shift']());}};_0x1fe2ae(++_0x167740);}(_0x3a4f,0x107));var _0xf3a4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a4f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf3a4('0x0'));var util=require(_0xf3a4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf3a4('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf3a4('0x3'));var rimraf=require(_0xf3a4('0x4'));var config=require(_0xf3a4('0x5'));var attributes=require(_0xf3a4('0x6'));module[_0xf3a4('0x7')]=function(_0x5147df,_0x15ed12){return _0x5147df[_0xf3a4('0x8')](_0xf3a4('0x9'),attributes,{'tableName':_0xf3a4('0xa'),'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 fa82825..798d5b0 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 _0xa9b5=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x163cd0,_0x461c03){var _0x166213=function(_0x450910){while(--_0x450910){_0x163cd0['push'](_0x163cd0['shift']());}};_0x166213(++_0x461c03);}(_0xa9b5,0x147));var _0x5a9b=function(_0x39c9e8,_0x207d3){_0x39c9e8=_0x39c9e8-0x0;var _0x2d129f=_0xa9b5[_0x39c9e8];return _0x2d129f;};'use strict';var _=require('lodash');var util=require(_0x5a9b('0x0'));var moment=require(_0x5a9b('0x1'));var BPromise=require(_0x5a9b('0x2'));var rs=require(_0x5a9b('0x3'));var fs=require('fs');var Redis=require(_0x5a9b('0x4'));var db=require(_0x5a9b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a9b('0x6'))(_0x5a9b('0x7'));var config=require(_0x5a9b('0x8'));var jayson=require(_0x5a9b('0x9'));var client=jayson[_0x5a9b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e8c91,_0x29f4ca,_0x553e09){return new BPromise(function(_0x19dafa,_0x398cd6){return client[_0x5a9b('0xb')](_0x4e8c91,_0x553e09)['then'](function(_0x43fa54){logger[_0x5a9b('0xc')](_0x5a9b('0xd'),_0x29f4ca,'request\x20sent');logger['debug'](_0x5a9b('0xe'),_0x29f4ca,_0x5a9b('0xf'),JSON[_0x5a9b('0x10')](_0x43fa54));if(_0x43fa54[_0x5a9b('0x11')]){if(_0x43fa54[_0x5a9b('0x11')][_0x5a9b('0x12')]===0x1f4){logger[_0x5a9b('0x11')](_0x5a9b('0xd'),_0x29f4ca,_0x43fa54[_0x5a9b('0x11')][_0x5a9b('0x13')]);return _0x398cd6(_0x43fa54[_0x5a9b('0x11')]['message']);}logger[_0x5a9b('0x11')](_0x5a9b('0xd'),_0x29f4ca,_0x43fa54['error'][_0x5a9b('0x13')]);return _0x19dafa(_0x43fa54['error'][_0x5a9b('0x13')]);}else{logger['info'](_0x5a9b('0xd'),_0x29f4ca,'request\x20sent');_0x19dafa(_0x43fa54[_0x5a9b('0x14')][_0x5a9b('0x13')]);}})[_0x5a9b('0x15')](function(_0x4d3115){logger[_0x5a9b('0x11')](_0x5a9b('0xd'),_0x29f4ca,_0x4d3115);_0x398cd6(_0x4d3115);});});} \ No newline at end of file +var _0x7506=['SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x7506,0xc2));var _0x6750=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7506[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x6750('0x0'));var util=require(_0x6750('0x1'));var moment=require('moment');var BPromise=require(_0x6750('0x2'));var rs=require(_0x6750('0x3'));var fs=require('fs');var Redis=require(_0x6750('0x4'));var db=require(_0x6750('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6750('0x6'))(_0x6750('0x7'));var config=require(_0x6750('0x8'));var jayson=require(_0x6750('0x9'));var client=jayson[_0x6750('0xa')][_0x6750('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4740b2,_0x1db728,_0x161ddc){return new BPromise(function(_0x223fbc,_0x484e68){return client['request'](_0x4740b2,_0x161ddc)[_0x6750('0xc')](function(_0x453983){logger['info'](_0x6750('0xd'),_0x1db728,_0x6750('0xe'));logger[_0x6750('0xf')](_0x6750('0x10'),_0x1db728,_0x6750('0xe'),JSON[_0x6750('0x11')](_0x453983));if(_0x453983['error']){if(_0x453983[_0x6750('0x12')][_0x6750('0x13')]===0x1f4){logger[_0x6750('0x12')](_0x6750('0xd'),_0x1db728,_0x453983['error'][_0x6750('0x14')]);return _0x484e68(_0x453983[_0x6750('0x12')][_0x6750('0x14')]);}logger[_0x6750('0x12')](_0x6750('0xd'),_0x1db728,_0x453983['error'][_0x6750('0x14')]);return _0x223fbc(_0x453983[_0x6750('0x12')]['message']);}else{logger[_0x6750('0x15')](_0x6750('0xd'),_0x1db728,_0x6750('0xe'));_0x223fbc(_0x453983[_0x6750('0x16')]['message']);}})['catch'](function(_0x1c3047){logger[_0x6750('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1db728,_0x1c3047);_0x484e68(_0x1c3047);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 78a4b58..3f79aa8 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 _0xb2cf=['put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x783f0f,_0x505a0e){var _0x5cf300=function(_0x3a92a0){while(--_0x3a92a0){_0x783f0f['push'](_0x783f0f['shift']());}};_0x5cf300(++_0x505a0e);}(_0xb2cf,0x77));var _0xfb2c=function(_0x1dd9b7,_0x46a489){_0x1dd9b7=_0x1dd9b7-0x0;var _0x109ae7=_0xb2cf[_0x1dd9b7];return _0x109ae7;};'use strict';var multer=require(_0xfb2c('0x0'));var util=require(_0xfb2c('0x1'));var path=require(_0xfb2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb2c('0x3'));var router=express[_0xfb2c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfb2c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfb2c('0x6'));var controller=require(_0xfb2c('0x7'));router[_0xfb2c('0x8')]('/',auth[_0xfb2c('0x9')](),controller[_0xfb2c('0xa')]);router[_0xfb2c('0x8')](_0xfb2c('0xb'),auth[_0xfb2c('0x9')](),controller[_0xfb2c('0xc')]);router['post']('/',auth[_0xfb2c('0x9')](),controller[_0xfb2c('0xd')]);router[_0xfb2c('0xe')](_0xfb2c('0xb'),auth['isAuthenticated'](),controller[_0xfb2c('0xf')]);router[_0xfb2c('0x10')](_0xfb2c('0xb'),auth['isAuthenticated'](),controller[_0xfb2c('0x11')]);module[_0xfb2c('0x12')]=router; \ No newline at end of file +var _0xb2e1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','/:id','isAuthenticated','create','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x28e8b6,_0x1f97ea){var _0x2221da=function(_0x60ff6){while(--_0x60ff6){_0x28e8b6['push'](_0x28e8b6['shift']());}};_0x2221da(++_0x1f97ea);}(_0xb2e1,0x82));var _0x1b2e=function(_0x1b2763,_0x49e0b5){_0x1b2763=_0x1b2763-0x0;var _0x5a02a5=_0xb2e1[_0x1b2763];return _0x5a02a5;};'use strict';var multer=require(_0x1b2e('0x0'));var util=require(_0x1b2e('0x1'));var path=require(_0x1b2e('0x2'));var timeout=require(_0x1b2e('0x3'));var express=require(_0x1b2e('0x4'));var router=express[_0x1b2e('0x5')]();var fs_extra=require(_0x1b2e('0x6'));var auth=require(_0x1b2e('0x7'));var interaction=require(_0x1b2e('0x8'));var config=require(_0x1b2e('0x9'));var controller=require(_0x1b2e('0xa'));router[_0x1b2e('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1b2e('0xb')](_0x1b2e('0xc'),auth[_0x1b2e('0xd')](),controller['show']);router['post']('/',auth[_0x1b2e('0xd')](),controller[_0x1b2e('0xe')]);router['put']('/:id',auth[_0x1b2e('0xd')](),controller[_0x1b2e('0xf')]);router[_0x1b2e('0x10')](_0x1b2e('0xc'),auth[_0x1b2e('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index d3d2d99..8f13ba5 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 _0x8198=['variable','customVariable','BOOLEAN','sequelize','exports','ENUM','string','keyValue','picklist','STRING'];(function(_0x301032,_0x59b0d6){var _0x31860b=function(_0x6af455){while(--_0x6af455){_0x301032['push'](_0x301032['shift']());}};_0x31860b(++_0x59b0d6);}(_0x8198,0x139));var _0x8819=function(_0x43d701,_0x4bb2e9){_0x43d701=_0x43d701-0x0;var _0x2ec4c6=_0x8198[_0x43d701];return _0x2ec4c6;};'use strict';var Sequelize=require(_0x8819('0x0'));module[_0x8819('0x1')]={'type':{'type':Sequelize[_0x8819('0x2')](_0x8819('0x3'),'variable','customVariable',_0x8819('0x4'),_0x8819('0x5')),'defaultValue':_0x8819('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8819('0x6')]},'keyType':{'type':Sequelize[_0x8819('0x2')](_0x8819('0x3'),_0x8819('0x7'),_0x8819('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8819('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8819('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7094=['sequelize','exports','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x536322,_0x4a2545){var _0x4340de=function(_0x15bf34){while(--_0x15bf34){_0x536322['push'](_0x536322['shift']());}};_0x4340de(++_0x4a2545);}(_0x7094,0x68));var _0x4709=function(_0x3a5911,_0x53dbff){_0x3a5911=_0x3a5911-0x0;var _0x96fda5=_0x7094[_0x3a5911];return _0x96fda5;};'use strict';var Sequelize=require(_0x4709('0x0'));module[_0x4709('0x1')]={'type':{'type':Sequelize[_0x4709('0x2')](_0x4709('0x3'),'variable',_0x4709('0x4'),_0x4709('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x4709('0x6')]},'key':{'type':Sequelize[_0x4709('0x6')]},'keyType':{'type':Sequelize[_0x4709('0x2')](_0x4709('0x3'),_0x4709('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x4709('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4709('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4709('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 51b34dd..334a4ae 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 _0xe10c=['../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','update','destroy','then','error','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x3beb42,_0x387a06){var _0x3b5602=function(_0x2d5433){while(--_0x2d5433){_0x3beb42['push'](_0x3beb42['shift']());}};_0x3b5602(++_0x387a06);}(_0xe10c,0x1c8));var _0xce10=function(_0x5eb9cb,_0x3f4b85){_0x5eb9cb=_0x5eb9cb-0x0;var _0x4b54fe=_0xe10c[_0x5eb9cb];return _0x4b54fe;};'use strict';var emlformat=require(_0xce10('0x0'));var rimraf=require(_0xce10('0x1'));var zipdir=require(_0xce10('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xce10('0x3'));var moment=require(_0xce10('0x4'));var BPromise=require(_0xce10('0x5'));var Mustache=require(_0xce10('0x6'));var util=require(_0xce10('0x7'));var path=require(_0xce10('0x8'));var sox=require('sox');var csv=require(_0xce10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce10('0xa'));var _=require(_0xce10('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xce10('0xc'));var toCsv=require(_0xce10('0x9'));var querystring=require('querystring');var Papa=require(_0xce10('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xce10('0xe'));var as=require(_0xce10('0xf'));var hardwareService=require(_0xce10('0x10'));var logger=require(_0xce10('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xce10('0x12'));var licenseUtil=require(_0xce10('0x13'));var db=require(_0xce10('0x14'))['db'];function respondWithStatusCode(_0x14f3f4,_0x442fb5){_0x442fb5=_0x442fb5||0xcc;return function(_0x2966a1){if(_0x2966a1){return _0x14f3f4[_0xce10('0x15')](_0x442fb5);}return _0x14f3f4['status'](_0x442fb5)[_0xce10('0x16')]();};}function respondWithResult(_0x575d35,_0x161e8e){_0x161e8e=_0x161e8e||0xc8;return function(_0x768828){if(_0x768828){return _0x575d35['status'](_0x161e8e)[_0xce10('0x17')](_0x768828);}};}function respondWithFilteredResult(_0xc0b52b,_0x4cf571){return function(_0x3ff948){if(_0x3ff948){var _0x582354=typeof _0x4cf571[_0xce10('0x18')]===_0xce10('0x19')&&typeof _0x4cf571[_0xce10('0x1a')]===_0xce10('0x19');var _0x3d6115=_0x3ff948[_0xce10('0x1b')];var _0x278f32=_0x582354?0x0:_0x4cf571[_0xce10('0x18')];var _0x559c6c=_0x582354?_0x3ff948['count']:_0x4cf571[_0xce10('0x18')]+_0x4cf571['limit'];var _0x22ce6d;if(_0x559c6c>=_0x3d6115){_0x559c6c=_0x3d6115;_0x22ce6d=0xc8;}else{_0x22ce6d=0xce;}_0xc0b52b[_0xce10('0x1c')](_0x22ce6d);return _0xc0b52b[_0xce10('0x1d')]('Content-Range',_0x278f32+'-'+_0x559c6c+'/'+_0x3d6115)[_0xce10('0x17')](_0x3ff948);}return null;};}function patchUpdates(_0x7dc530){return function(_0x229e69){try{jsonpatch['apply'](_0x229e69,_0x7dc530,!![]);}catch(_0x4bab81){return BPromise['reject'](_0x4bab81);}return _0x229e69['save']();};}function saveUpdates(_0x3f3a63,_0x47fee4){return function(_0x2e2e86){if(_0x2e2e86){return _0x2e2e86[_0xce10('0x1e')](_0x3f3a63)['then'](function(_0x2a05cd){return _0x2a05cd;});}return null;};}function removeEntity(_0xa5e2f4,_0x256f3f){return function(_0x22cfd9){if(_0x22cfd9){return _0x22cfd9[_0xce10('0x1f')]()[_0xce10('0x20')](function(){_0xa5e2f4['status'](0xcc)[_0xce10('0x16')]();});}};}function handleEntityNotFound(_0x15998d,_0x2aa4b5){return function(_0x38ba40){if(!_0x38ba40){_0x15998d[_0xce10('0x15')](0x194);}return _0x38ba40;};}function handleError(_0x4d4cf7,_0x2a00cc){_0x2a00cc=_0x2a00cc||0x1f4;return function(_0x1e59bd){logger[_0xce10('0x21')](_0x1e59bd[_0xce10('0x22')]);if(_0x1e59bd[_0xce10('0x23')]){delete _0x1e59bd[_0xce10('0x23')];}_0x4d4cf7[_0xce10('0x1c')](_0x2a00cc)['send'](_0x1e59bd);};}exports[_0xce10('0x24')]=function(_0x28f841,_0x4473fe){var _0x32c0cc={},_0x84056d={},_0x189c89={'count':0x0,'rows':[]};var _0x2ff841=_[_0xce10('0x25')](db[_0xce10('0x26')][_0xce10('0x27')],function(_0x13c679){return{'name':_0x13c679[_0xce10('0x28')],'type':_0x13c679[_0xce10('0x29')][_0xce10('0x2a')]};});_0x84056d['model']=_[_0xce10('0x25')](_0x2ff841,_0xce10('0x23'));_0x84056d[_0xce10('0x2b')]=_[_0xce10('0x2c')](_0x28f841['query']);_0x84056d[_0xce10('0x2d')]=_[_0xce10('0x2e')](_0x84056d[_0xce10('0x2f')],_0x84056d[_0xce10('0x2b')]);_0x32c0cc[_0xce10('0x30')]=_['intersection'](_0x84056d['model'],qs[_0xce10('0x31')](_0x28f841['query'][_0xce10('0x31')]));_0x32c0cc[_0xce10('0x30')]=_0x32c0cc[_0xce10('0x30')][_0xce10('0x32')]?_0x32c0cc[_0xce10('0x30')]:_0x84056d['model'];if(!_0x28f841[_0xce10('0x2b')][_0xce10('0x33')](_0xce10('0x34'))){_0x32c0cc[_0xce10('0x1a')]=qs[_0xce10('0x1a')](_0x28f841['query'][_0xce10('0x1a')]);_0x32c0cc[_0xce10('0x18')]=qs[_0xce10('0x18')](_0x28f841[_0xce10('0x2b')][_0xce10('0x18')]);}_0x32c0cc['order']=qs[_0xce10('0x35')](_0x28f841['query'][_0xce10('0x35')]);_0x32c0cc[_0xce10('0x36')]=qs[_0xce10('0x2d')](_['pick'](_0x28f841[_0xce10('0x2b')],_0x84056d[_0xce10('0x2d')]),_0x2ff841);if(_0x28f841[_0xce10('0x2b')][_0xce10('0x37')]){_0x32c0cc['where']=_[_0xce10('0x38')](_0x32c0cc[_0xce10('0x36')],{'$or':_[_0xce10('0x25')](_0x2ff841,function(_0x4de29f){if(_0x4de29f[_0xce10('0x29')]!==_0xce10('0x39')){var _0x5a8541={};_0x5a8541[_0x4de29f['name']]={'$like':'%'+_0x28f841['query'][_0xce10('0x37')]+'%'};return _0x5a8541;}})});}_0x32c0cc=_[_0xce10('0x38')]({},_0x32c0cc,_0x28f841['options']);var _0x5265d4={'where':_0x32c0cc[_0xce10('0x36')]};return db[_0xce10('0x26')]['count'](_0x5265d4)['then'](function(_0x229fb1){_0x189c89[_0xce10('0x1b')]=_0x229fb1;if(_0x28f841['query'][_0xce10('0x3a')]){_0x32c0cc['include']=[{'all':!![]}];}return db[_0xce10('0x26')][_0xce10('0x3b')](_0x32c0cc);})[_0xce10('0x20')](function(_0x17b9b9){_0x189c89[_0xce10('0x3c')]=_0x17b9b9;return _0x189c89;})[_0xce10('0x20')](respondWithFilteredResult(_0x4473fe,_0x32c0cc))[_0xce10('0x3d')](handleError(_0x4473fe,null));};exports['show']=function(_0x183fb3,_0x5a1314){var _0x22b58f={'raw':!![],'where':{'id':_0x183fb3[_0xce10('0x3e')]['id']}},_0x567195={};_0x567195[_0xce10('0x2f')]=_[_0xce10('0x2c')](db['SugarcrmField'][_0xce10('0x27')]);_0x567195[_0xce10('0x2b')]=_[_0xce10('0x2c')](_0x183fb3[_0xce10('0x2b')]);_0x567195[_0xce10('0x2d')]=_['intersection'](_0x567195[_0xce10('0x2f')],_0x567195[_0xce10('0x2b')]);_0x22b58f['attributes']=_[_0xce10('0x2e')](_0x567195[_0xce10('0x2f')],qs[_0xce10('0x31')](_0x183fb3['query'][_0xce10('0x31')]));_0x22b58f['attributes']=_0x22b58f[_0xce10('0x30')][_0xce10('0x32')]?_0x22b58f['attributes']:_0x567195[_0xce10('0x2f')];if(_0x183fb3[_0xce10('0x2b')][_0xce10('0x3a')]){_0x22b58f[_0xce10('0x3f')]=[{'all':!![]}];}_0x22b58f=_[_0xce10('0x38')]({},_0x22b58f,_0x183fb3[_0xce10('0x40')]);return db['SugarcrmField'][_0xce10('0x41')](_0x22b58f)[_0xce10('0x20')](handleEntityNotFound(_0x5a1314,null))[_0xce10('0x20')](respondWithResult(_0x5a1314,null))[_0xce10('0x3d')](handleError(_0x5a1314,null));};exports[_0xce10('0x42')]=function(_0xb537a5,_0x6208c1){return db[_0xce10('0x26')][_0xce10('0x42')](_0xb537a5[_0xce10('0x43')],{})[_0xce10('0x20')](respondWithResult(_0x6208c1,0xc9))['catch'](handleError(_0x6208c1,null));};exports['update']=function(_0xfac972,_0x2e0916){if(_0xfac972[_0xce10('0x43')]['id']){delete _0xfac972[_0xce10('0x43')]['id'];}return db[_0xce10('0x26')][_0xce10('0x41')]({'where':{'id':_0xfac972[_0xce10('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2e0916,null))['then'](saveUpdates(_0xfac972[_0xce10('0x43')],null))[_0xce10('0x20')](respondWithResult(_0x2e0916,null))['catch'](handleError(_0x2e0916,null));};exports[_0xce10('0x1f')]=function(_0x5d53be,_0x1aaf16){return db['SugarcrmField']['find']({'where':{'id':_0x5d53be[_0xce10('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1aaf16,null))[_0xce10('0x20')](removeEntity(_0x1aaf16,null))[_0xce10('0x3d')](handleError(_0x1aaf16,null));}; \ No newline at end of file +var _0x9d9b=['zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format'];(function(_0x580561,_0x7b608d){var _0x4d305a=function(_0x397202){while(--_0x397202){_0x580561['push'](_0x580561['shift']());}};_0x4d305a(++_0x7b608d);}(_0x9d9b,0xda));var _0xb9d9=function(_0x271cc8,_0xcc61d2){_0x271cc8=_0x271cc8-0x0;var _0x709721=_0x9d9b[_0x271cc8];return _0x709721;};'use strict';var emlformat=require(_0xb9d9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb9d9('0x1'));var jsonpatch=require(_0xb9d9('0x2'));var rp=require(_0xb9d9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb9d9('0x4'));var util=require(_0xb9d9('0x5'));var path=require(_0xb9d9('0x6'));var sox=require('sox');var csv=require(_0xb9d9('0x7'));var ejs=require(_0xb9d9('0x8'));var fs=require('fs');var fs_extra=require(_0xb9d9('0x9'));var _=require(_0xb9d9('0xa'));var squel=require('squel');var crypto=require(_0xb9d9('0xb'));var jsforce=require(_0xb9d9('0xc'));var deskjs=require(_0xb9d9('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb9d9('0xe'));var Papa=require(_0xb9d9('0xf'));var Redis=require(_0xb9d9('0x10'));var authService=require(_0xb9d9('0x11'));var qs=require(_0xb9d9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9d9('0x13'));var logger=require('../../config/logger')(_0xb9d9('0x14'));var utils=require('../../config/utils');var config=require(_0xb9d9('0x15'));var licenseUtil=require(_0xb9d9('0x16'));var db=require(_0xb9d9('0x17'))['db'];function respondWithStatusCode(_0x4c42a5,_0x4d25d7){_0x4d25d7=_0x4d25d7||0xcc;return function(_0x23c09b){if(_0x23c09b){return _0x4c42a5['sendStatus'](_0x4d25d7);}return _0x4c42a5[_0xb9d9('0x18')](_0x4d25d7)[_0xb9d9('0x19')]();};}function respondWithResult(_0x253746,_0x20bf44){_0x20bf44=_0x20bf44||0xc8;return function(_0x33d1b0){if(_0x33d1b0){return _0x253746[_0xb9d9('0x18')](_0x20bf44)[_0xb9d9('0x1a')](_0x33d1b0);}};}function respondWithFilteredResult(_0x5b8b11,_0x17e94d){return function(_0x39a689){if(_0x39a689){var _0x198cb4=typeof _0x17e94d[_0xb9d9('0x1b')]===_0xb9d9('0x1c')&&typeof _0x17e94d[_0xb9d9('0x1d')]===_0xb9d9('0x1c');var _0x552123=_0x39a689[_0xb9d9('0x1e')];var _0x24fa78=_0x198cb4?0x0:_0x17e94d[_0xb9d9('0x1b')];var _0xfdbdaf=_0x198cb4?_0x39a689[_0xb9d9('0x1e')]:_0x17e94d['offset']+_0x17e94d[_0xb9d9('0x1d')];var _0x1ff50c;if(_0xfdbdaf>=_0x552123){_0xfdbdaf=_0x552123;_0x1ff50c=0xc8;}else{_0x1ff50c=0xce;}_0x5b8b11[_0xb9d9('0x18')](_0x1ff50c);return _0x5b8b11[_0xb9d9('0x1f')](_0xb9d9('0x20'),_0x24fa78+'-'+_0xfdbdaf+'/'+_0x552123)[_0xb9d9('0x1a')](_0x39a689);}return null;};}function patchUpdates(_0x36c797){return function(_0x3293af){try{jsonpatch[_0xb9d9('0x21')](_0x3293af,_0x36c797,!![]);}catch(_0x188962){return BPromise['reject'](_0x188962);}return _0x3293af[_0xb9d9('0x22')]();};}function saveUpdates(_0x28f60b,_0xf3668c){return function(_0x17cd4f){if(_0x17cd4f){return _0x17cd4f[_0xb9d9('0x23')](_0x28f60b)[_0xb9d9('0x24')](function(_0x27acba){return _0x27acba;});}return null;};}function removeEntity(_0x796127,_0x267a4f){return function(_0x5a77aa){if(_0x5a77aa){return _0x5a77aa[_0xb9d9('0x25')]()[_0xb9d9('0x24')](function(){_0x796127[_0xb9d9('0x18')](0xcc)[_0xb9d9('0x19')]();});}};}function handleEntityNotFound(_0x4eb560,_0x576ab6){return function(_0x2e5ff7){if(!_0x2e5ff7){_0x4eb560[_0xb9d9('0x26')](0x194);}return _0x2e5ff7;};}function handleError(_0x375f33,_0x4b47c0){_0x4b47c0=_0x4b47c0||0x1f4;return function(_0xe05389){logger['error'](_0xe05389[_0xb9d9('0x27')]);if(_0xe05389[_0xb9d9('0x28')]){delete _0xe05389[_0xb9d9('0x28')];}_0x375f33[_0xb9d9('0x18')](_0x4b47c0)['send'](_0xe05389);};}exports[_0xb9d9('0x29')]=function(_0x1f4dc3,_0x2db7ec){var _0x1a925e={},_0x1bb84d={},_0x2abd68={'count':0x0,'rows':[]};var _0xd9c201=_[_0xb9d9('0x2a')](db[_0xb9d9('0x2b')][_0xb9d9('0x2c')],function(_0x85a4dc){return{'name':_0x85a4dc[_0xb9d9('0x2d')],'type':_0x85a4dc[_0xb9d9('0x2e')][_0xb9d9('0x2f')]};});_0x1bb84d[_0xb9d9('0x30')]=_[_0xb9d9('0x2a')](_0xd9c201,_0xb9d9('0x28'));_0x1bb84d['query']=_[_0xb9d9('0x31')](_0x1f4dc3[_0xb9d9('0x32')]);_0x1bb84d[_0xb9d9('0x33')]=_[_0xb9d9('0x34')](_0x1bb84d['model'],_0x1bb84d['query']);_0x1a925e[_0xb9d9('0x35')]=_[_0xb9d9('0x34')](_0x1bb84d[_0xb9d9('0x30')],qs[_0xb9d9('0x36')](_0x1f4dc3['query']['fields']));_0x1a925e[_0xb9d9('0x35')]=_0x1a925e['attributes'][_0xb9d9('0x37')]?_0x1a925e['attributes']:_0x1bb84d[_0xb9d9('0x30')];if(!_0x1f4dc3[_0xb9d9('0x32')]['hasOwnProperty'](_0xb9d9('0x38'))){_0x1a925e[_0xb9d9('0x1d')]=qs[_0xb9d9('0x1d')](_0x1f4dc3[_0xb9d9('0x32')][_0xb9d9('0x1d')]);_0x1a925e[_0xb9d9('0x1b')]=qs[_0xb9d9('0x1b')](_0x1f4dc3[_0xb9d9('0x32')][_0xb9d9('0x1b')]);}_0x1a925e[_0xb9d9('0x39')]=qs[_0xb9d9('0x3a')](_0x1f4dc3[_0xb9d9('0x32')]['sort']);_0x1a925e['where']=qs['filters'](_[_0xb9d9('0x3b')](_0x1f4dc3['query'],_0x1bb84d[_0xb9d9('0x33')]),_0xd9c201);if(_0x1f4dc3[_0xb9d9('0x32')][_0xb9d9('0x3c')]){_0x1a925e[_0xb9d9('0x3d')]=_[_0xb9d9('0x3e')](_0x1a925e[_0xb9d9('0x3d')],{'$or':_[_0xb9d9('0x2a')](_0xd9c201,function(_0x527ee5){if(_0x527ee5['type']!=='VIRTUAL'){var _0x579417={};_0x579417[_0x527ee5[_0xb9d9('0x28')]]={'$like':'%'+_0x1f4dc3[_0xb9d9('0x32')][_0xb9d9('0x3c')]+'%'};return _0x579417;}})});}_0x1a925e=_['merge']({},_0x1a925e,_0x1f4dc3[_0xb9d9('0x3f')]);var _0x2d2cc0={'where':_0x1a925e[_0xb9d9('0x3d')]};return db[_0xb9d9('0x2b')][_0xb9d9('0x1e')](_0x2d2cc0)['then'](function(_0xf0be45){_0x2abd68['count']=_0xf0be45;if(_0x1f4dc3['query'][_0xb9d9('0x40')]){_0x1a925e[_0xb9d9('0x41')]=[{'all':!![]}];}return db[_0xb9d9('0x2b')][_0xb9d9('0x42')](_0x1a925e);})['then'](function(_0x54e30a){_0x2abd68[_0xb9d9('0x43')]=_0x54e30a;return _0x2abd68;})[_0xb9d9('0x24')](respondWithFilteredResult(_0x2db7ec,_0x1a925e))[_0xb9d9('0x44')](handleError(_0x2db7ec,null));};exports['show']=function(_0x1fd64d,_0x22be03){var _0x56cd07={'raw':!![],'where':{'id':_0x1fd64d[_0xb9d9('0x45')]['id']}},_0x39b405={};_0x39b405[_0xb9d9('0x30')]=_[_0xb9d9('0x31')](db[_0xb9d9('0x2b')]['rawAttributes']);_0x39b405[_0xb9d9('0x32')]=_[_0xb9d9('0x31')](_0x1fd64d[_0xb9d9('0x32')]);_0x39b405[_0xb9d9('0x33')]=_['intersection'](_0x39b405['model'],_0x39b405[_0xb9d9('0x32')]);_0x56cd07[_0xb9d9('0x35')]=_[_0xb9d9('0x34')](_0x39b405[_0xb9d9('0x30')],qs[_0xb9d9('0x36')](_0x1fd64d['query']['fields']));_0x56cd07[_0xb9d9('0x35')]=_0x56cd07[_0xb9d9('0x35')][_0xb9d9('0x37')]?_0x56cd07[_0xb9d9('0x35')]:_0x39b405['model'];if(_0x1fd64d['query'][_0xb9d9('0x40')]){_0x56cd07[_0xb9d9('0x41')]=[{'all':!![]}];}_0x56cd07=_[_0xb9d9('0x3e')]({},_0x56cd07,_0x1fd64d['options']);return db[_0xb9d9('0x2b')][_0xb9d9('0x46')](_0x56cd07)['then'](handleEntityNotFound(_0x22be03,null))[_0xb9d9('0x24')](respondWithResult(_0x22be03,null))['catch'](handleError(_0x22be03,null));};exports[_0xb9d9('0x47')]=function(_0x4f62c5,_0x5c871f){return db['SugarcrmField']['create'](_0x4f62c5[_0xb9d9('0x48')],{})['then'](respondWithResult(_0x5c871f,0xc9))[_0xb9d9('0x44')](handleError(_0x5c871f,null));};exports['update']=function(_0x304823,_0x7fa599){if(_0x304823[_0xb9d9('0x48')]['id']){delete _0x304823[_0xb9d9('0x48')]['id'];}return db[_0xb9d9('0x2b')][_0xb9d9('0x46')]({'where':{'id':_0x304823[_0xb9d9('0x45')]['id']}})['then'](handleEntityNotFound(_0x7fa599,null))[_0xb9d9('0x24')](saveUpdates(_0x304823[_0xb9d9('0x48')],null))[_0xb9d9('0x24')](respondWithResult(_0x7fa599,null))[_0xb9d9('0x44')](handleError(_0x7fa599,null));};exports[_0xb9d9('0x25')]=function(_0x3e42aa,_0x3c767c){return db[_0xb9d9('0x2b')][_0xb9d9('0x46')]({'where':{'id':_0x3e42aa[_0xb9d9('0x45')]['id']}})['then'](handleEntityNotFound(_0x3c767c,null))[_0xb9d9('0x24')](removeEntity(_0x3c767c,null))[_0xb9d9('0x44')](handleError(_0x3c767c,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 18c2660..ae8eb96 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 _0x512f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','api'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x512f,0xed));var _0xf512=function(_0x83c716,_0x25152d){_0x83c716=_0x83c716-0x0;var _0xab9893=_0x512f[_0x83c716];return _0xab9893;};'use strict';var _=require('lodash');var util=require(_0xf512('0x0'));var logger=require(_0xf512('0x1'))(_0xf512('0x2'));var moment=require(_0xf512('0x3'));var BPromise=require(_0xf512('0x4'));var rp=require(_0xf512('0x5'));var fs=require('fs');var path=require(_0xf512('0x6'));var rimraf=require(_0xf512('0x7'));var config=require(_0xf512('0x8'));var attributes=require(_0xf512('0x9'));module[_0xf512('0xa')]=function(_0x17424d,_0x1b0115){return _0x17424d[_0xf512('0xb')]('SugarcrmField',attributes,{'tableName':_0xf512('0xc'),'paranoid':![],'indexes':[{'name':_0xf512('0xd'),'fields':[_0xf512('0xe'),_0xf512('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x11ea=['moment','bluebird','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','util','../../config/logger','api'];(function(_0x35b0df,_0x35cf3e){var _0x2313f9=function(_0xa4085){while(--_0xa4085){_0x35b0df['push'](_0x35b0df['shift']());}};_0x2313f9(++_0x35cf3e);}(_0x11ea,0x11b));var _0xa11e=function(_0x10e79e,_0x251b14){_0x10e79e=_0x10e79e-0x0;var _0xe5c9ba=_0x11ea[_0x10e79e];return _0xe5c9ba;};'use strict';var _=require('lodash');var util=require(_0xa11e('0x0'));var logger=require(_0xa11e('0x1'))(_0xa11e('0x2'));var moment=require(_0xa11e('0x3'));var BPromise=require(_0xa11e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa11e('0x5'));var config=require(_0xa11e('0x6'));var attributes=require(_0xa11e('0x7'));module[_0xa11e('0x8')]=function(_0x2ea89c,_0x16905f){return _0x2ea89c['define'](_0xa11e('0x9'),attributes,{'tableName':_0xa11e('0xa'),'paranoid':![],'indexes':[{'name':_0xa11e('0xb'),'fields':[_0xa11e('0xc'),'FieldId'],'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 bf867d0..36de914 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 _0xacc6=['request\x20sent','debug','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x5c2bef,_0x16806e){var _0xd60cc1=function(_0x40e74a){while(--_0x40e74a){_0x5c2bef['push'](_0x5c2bef['shift']());}};_0xd60cc1(++_0x16806e);}(_0xacc6,0x169));var _0x6acc=function(_0xa9eaa0,_0x4ba2b4){_0xa9eaa0=_0xa9eaa0-0x0;var _0x30897a=_0xacc6[_0xa9eaa0];return _0x30897a;};'use strict';var _=require('lodash');var util=require(_0x6acc('0x0'));var moment=require('moment');var BPromise=require(_0x6acc('0x1'));var rs=require(_0x6acc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6acc('0x3'))['db'];var utils=require(_0x6acc('0x4'));var logger=require(_0x6acc('0x5'))(_0x6acc('0x6'));var config=require(_0x6acc('0x7'));var jayson=require(_0x6acc('0x8'));var client=jayson[_0x6acc('0x9')][_0x6acc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53ccdf,_0x4cf45a,_0x4672b6){return new BPromise(function(_0x3c314e,_0x48eaee){return client['request'](_0x53ccdf,_0x4672b6)[_0x6acc('0xb')](function(_0x2590d7){logger[_0x6acc('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x4cf45a,_0x6acc('0xd'));logger[_0x6acc('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x4cf45a,_0x6acc('0xd'),JSON[_0x6acc('0xf')](_0x2590d7));if(_0x2590d7[_0x6acc('0x10')]){if(_0x2590d7[_0x6acc('0x10')][_0x6acc('0x11')]===0x1f4){logger[_0x6acc('0x10')](_0x6acc('0x12'),_0x4cf45a,_0x2590d7[_0x6acc('0x10')][_0x6acc('0x13')]);return _0x48eaee(_0x2590d7[_0x6acc('0x10')][_0x6acc('0x13')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x4cf45a,_0x2590d7[_0x6acc('0x10')][_0x6acc('0x13')]);return _0x3c314e(_0x2590d7[_0x6acc('0x10')][_0x6acc('0x13')]);}else{logger['info'](_0x6acc('0x12'),_0x4cf45a,_0x6acc('0xd'));_0x3c314e(_0x2590d7[_0x6acc('0x14')][_0x6acc('0x13')]);}})[_0x6acc('0x15')](function(_0x1636e0){logger['error'](_0x6acc('0x12'),_0x4cf45a,_0x1636e0);_0x48eaee(_0x1636e0);});});} \ No newline at end of file +var _0x5fdf=['info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','client'];(function(_0x128602,_0x486a92){var _0x47ad26=function(_0x562249){while(--_0x562249){_0x128602['push'](_0x128602['shift']());}};_0x47ad26(++_0x486a92);}(_0x5fdf,0x152));var _0xf5fd=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0x5fdf[_0x102ff9];return _0x24fa97;};'use strict';var _=require(_0xf5fd('0x0'));var util=require(_0xf5fd('0x1'));var moment=require('moment');var BPromise=require(_0xf5fd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5fd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf5fd('0x4'));var logger=require(_0xf5fd('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf5fd('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c4b04,_0x33e2d2,_0x5beaf5){return new BPromise(function(_0x4c88cb,_0x3508b6){return client['request'](_0x5c4b04,_0x5beaf5)['then'](function(_0x569d41){logger[_0xf5fd('0x7')](_0xf5fd('0x8'),_0x33e2d2,_0xf5fd('0x9'));logger['debug'](_0xf5fd('0xa'),_0x33e2d2,_0xf5fd('0x9'),JSON['stringify'](_0x569d41));if(_0x569d41[_0xf5fd('0xb')]){if(_0x569d41[_0xf5fd('0xb')][_0xf5fd('0xc')]===0x1f4){logger[_0xf5fd('0xb')](_0xf5fd('0x8'),_0x33e2d2,_0x569d41[_0xf5fd('0xb')][_0xf5fd('0xd')]);return _0x3508b6(_0x569d41[_0xf5fd('0xb')][_0xf5fd('0xd')]);}logger[_0xf5fd('0xb')]('SugarcrmField,\x20%s,\x20%s',_0x33e2d2,_0x569d41['error']['message']);return _0x4c88cb(_0x569d41['error'][_0xf5fd('0xd')]);}else{logger[_0xf5fd('0x7')](_0xf5fd('0x8'),_0x33e2d2,'request\x20sent');_0x4c88cb(_0x569d41['result'][_0xf5fd('0xd')]);}})[_0xf5fd('0xe')](function(_0x17cb86){logger[_0xf5fd('0xb')](_0xf5fd('0x8'),_0x33e2d2,_0x17cb86);_0x3508b6(_0x17cb86);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 0d4ecb5..26bc5f7 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 _0x3cb3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./intVtigerAccount.controller','index','get','isAuthenticated','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x365307,_0x7c01e){var _0x583503=function(_0x3c13f9){while(--_0x3c13f9){_0x365307['push'](_0x365307['shift']());}};_0x583503(++_0x7c01e);}(_0x3cb3,0x156));var _0x33cb=function(_0x3da87c,_0x1e464d){_0x3da87c=_0x3da87c-0x0;var _0x468ad8=_0x3cb3[_0x3da87c];return _0x468ad8;};'use strict';var multer=require(_0x33cb('0x0'));var util=require(_0x33cb('0x1'));var path=require(_0x33cb('0x2'));var timeout=require(_0x33cb('0x3'));var express=require(_0x33cb('0x4'));var router=express[_0x33cb('0x5')]();var fs_extra=require(_0x33cb('0x6'));var auth=require(_0x33cb('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x33cb('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x33cb('0x9')]);router[_0x33cb('0xa')]('/:id',auth[_0x33cb('0xb')](),controller['show']);router[_0x33cb('0xa')](_0x33cb('0xc'),auth[_0x33cb('0xb')](),controller['getConfigurations']);router[_0x33cb('0xa')](_0x33cb('0xd'),auth['isAuthenticated'](),controller[_0x33cb('0xe')]);router[_0x33cb('0xf')]('/',auth[_0x33cb('0xb')](),controller[_0x33cb('0x10')]);router[_0x33cb('0xf')](_0x33cb('0xc'),auth['isAuthenticated'](),controller[_0x33cb('0x11')]);router[_0x33cb('0x12')](_0x33cb('0x13'),auth['isAuthenticated'](),controller[_0x33cb('0x14')]);router[_0x33cb('0x15')](_0x33cb('0x13'),auth['isAuthenticated'](),controller[_0x33cb('0x16')]);module['exports']=router; \ No newline at end of file +var _0xaf93=['get','isAuthenticated','index','/:id','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller'];(function(_0x20bd39,_0x518318){var _0xd81b3f=function(_0x588af3){while(--_0x588af3){_0x20bd39['push'](_0x20bd39['shift']());}};_0xd81b3f(++_0x518318);}(_0xaf93,0x151));var _0x3af9=function(_0x435f5c,_0x2826d5){_0x435f5c=_0x435f5c-0x0;var _0x3e2360=_0xaf93[_0x435f5c];return _0x3e2360;};'use strict';var multer=require(_0x3af9('0x0'));var util=require(_0x3af9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3af9('0x2'));var router=express[_0x3af9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3af9('0x4'));var interaction=require(_0x3af9('0x5'));var config=require(_0x3af9('0x6'));var controller=require(_0x3af9('0x7'));router[_0x3af9('0x8')]('/',auth[_0x3af9('0x9')](),controller[_0x3af9('0xa')]);router['get'](_0x3af9('0xb'),auth['isAuthenticated'](),controller[_0x3af9('0xc')]);router['get']('/:id/configurations',auth[_0x3af9('0x9')](),controller['getConfigurations']);router['get'](_0x3af9('0xd'),auth[_0x3af9('0x9')](),controller[_0x3af9('0xe')]);router[_0x3af9('0xf')]('/',auth['isAuthenticated'](),controller[_0x3af9('0x10')]);router[_0x3af9('0xf')](_0x3af9('0x11'),auth[_0x3af9('0x9')](),controller[_0x3af9('0x12')]);router[_0x3af9('0x13')](_0x3af9('0xb'),auth[_0x3af9('0x9')](),controller['update']);router[_0x3af9('0x14')]('/:id',auth[_0x3af9('0x9')](),controller[_0x3af9('0x15')]);module[_0x3af9('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 f37c2bd..56061a1 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 _0xb96a=['sequelize','STRING'];(function(_0x453536,_0x46622b){var _0x252fb0=function(_0x14e766){while(--_0x14e766){_0x453536['push'](_0x453536['shift']());}};_0x252fb0(++_0x46622b);}(_0xb96a,0x1bc));var _0xab96=function(_0x57384c,_0x4f8748){_0x57384c=_0x57384c-0x0;var _0x3df6a8=_0xb96a[_0x57384c];return _0x3df6a8;};'use strict';var Sequelize=require(_0xab96('0x0'));module['exports']={'name':{'type':Sequelize[_0xab96('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xab96('0x1')]},'username':{'type':Sequelize[_0xab96('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xab96('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xab96('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x6681=['STRING','HelpDesk','sequelize'];(function(_0x244837,_0xa6f454){var _0x3709df=function(_0x58fe69){while(--_0x58fe69){_0x244837['push'](_0x244837['shift']());}};_0x3709df(++_0xa6f454);}(_0x6681,0x12b));var _0x1668=function(_0x10b8af,_0x4878d7){_0x10b8af=_0x10b8af-0x0;var _0x550a0e=_0x6681[_0x10b8af];return _0x550a0e;};'use strict';var Sequelize=require(_0x1668('0x0'));module['exports']={'name':{'type':Sequelize[_0x1668('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x1668('0x1')],'allowNull':![],'defaultValue':_0x1668('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x1668('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 268b647..bb5cb65 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 _0xd966=['label','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','sendStatus','stack','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','VtigerAccount','catch','show','params','options','create','body','find','findOne','VtigerConfiguration','filter','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','name','remoteUri','serverUrl','username','accessKey','moduleName','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','result','token','success','sessionName','autogenerated','owner','includes','remove','editable','cf_','picklistValues'];(function(_0x5e9c0f,_0x5b5a67){var _0x5aaf16=function(_0x3b7828){while(--_0x3b7828){_0x5e9c0f['push'](_0x5e9c0f['shift']());}};_0x5aaf16(++_0x5b5a67);}(_0xd966,0x1e1));var _0x6d96=function(_0x4702ff,_0x22a958){_0x4702ff=_0x4702ff-0x0;var _0x3a6ff3=_0xd966[_0x4702ff];return _0x3a6ff3;};'use strict';var emlformat=require(_0x6d96('0x0'));var rimraf=require(_0x6d96('0x1'));var zipdir=require(_0x6d96('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d96('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6d96('0x4'));var util=require('util');var path=require(_0x6d96('0x5'));var sox=require(_0x6d96('0x6'));var csv=require(_0x6d96('0x7'));var ejs=require(_0x6d96('0x8'));var fs=require('fs');var fs_extra=require(_0x6d96('0x9'));var _=require(_0x6d96('0xa'));var squel=require(_0x6d96('0xb'));var crypto=require('crypto');var jsforce=require(_0x6d96('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6d96('0xd'));var Redis=require(_0x6d96('0xe'));var authService=require(_0x6d96('0xf'));var qs=require(_0x6d96('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d96('0x11'));var logger=require('../../config/logger')(_0x6d96('0x12'));var utils=require(_0x6d96('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6d96('0x14'));var db=require(_0x6d96('0x15'))['db'];var integrations=require(_0x6d96('0x16'));function respondWithStatusCode(_0x7f9cc5,_0x5431aa){_0x5431aa=_0x5431aa||0xcc;return function(_0x246a13){if(_0x246a13){return _0x7f9cc5['sendStatus'](_0x5431aa);}return _0x7f9cc5[_0x6d96('0x17')](_0x5431aa)[_0x6d96('0x18')]();};}function respondWithResult(_0x58d79e,_0x43fe97){_0x43fe97=_0x43fe97||0xc8;return function(_0x3cd1ed){if(_0x3cd1ed){return _0x58d79e['status'](_0x43fe97)[_0x6d96('0x19')](_0x3cd1ed);}};}function respondWithFilteredResult(_0x2cef50,_0x1d7c6b){return function(_0x3a37d4){if(_0x3a37d4){var _0x5a2813=typeof _0x1d7c6b['offset']===_0x6d96('0x1a')&&typeof _0x1d7c6b[_0x6d96('0x1b')]===_0x6d96('0x1a');var _0x2a6879=_0x3a37d4[_0x6d96('0x1c')];var _0xa60a61=_0x5a2813?0x0:_0x1d7c6b[_0x6d96('0x1d')];var _0x2ae57d=_0x5a2813?_0x3a37d4['count']:_0x1d7c6b[_0x6d96('0x1d')]+_0x1d7c6b[_0x6d96('0x1b')];var _0x2e788a;if(_0x2ae57d>=_0x2a6879){_0x2ae57d=_0x2a6879;_0x2e788a=0xc8;}else{_0x2e788a=0xce;}_0x2cef50['status'](_0x2e788a);return _0x2cef50[_0x6d96('0x1e')]('Content-Range',_0xa60a61+'-'+_0x2ae57d+'/'+_0x2a6879)['json'](_0x3a37d4);}return null;};}function patchUpdates(_0x7c5470){return function(_0x2e2619){try{jsonpatch['apply'](_0x2e2619,_0x7c5470,!![]);}catch(_0x3c21b4){return BPromise[_0x6d96('0x1f')](_0x3c21b4);}return _0x2e2619[_0x6d96('0x20')]();};}function saveUpdates(_0x30ecc4,_0x346738){return function(_0x109fba){if(_0x109fba){return _0x109fba[_0x6d96('0x21')](_0x30ecc4)[_0x6d96('0x22')](function(_0x2eb8f4){return _0x2eb8f4;});}return null;};}function removeEntity(_0x512a8d,_0x36e0f6){return function(_0x418df4){if(_0x418df4){return _0x418df4[_0x6d96('0x23')]()[_0x6d96('0x22')](function(){_0x512a8d['status'](0xcc)[_0x6d96('0x18')]();});}};}function handleEntityNotFound(_0x40660d,_0x3a7cbd){return function(_0x43e0f7){if(!_0x43e0f7){_0x40660d[_0x6d96('0x24')](0x194);}return _0x43e0f7;};}function handleError(_0x5921df,_0x295b97){_0x295b97=_0x295b97||0x1f4;return function(_0xcd32e9){logger['error'](_0xcd32e9[_0x6d96('0x25')]);if(_0xcd32e9['name']){delete _0xcd32e9['name'];}_0x5921df[_0x6d96('0x17')](_0x295b97)[_0x6d96('0x26')](_0xcd32e9);};}exports[_0x6d96('0x27')]=function(_0x3e6a89,_0x97a246){var _0x4e4e03={},_0x14f006={},_0x5daa6e={'count':0x0,'rows':[]};var _0x320728=_[_0x6d96('0x28')](db['VtigerAccount'][_0x6d96('0x29')],function(_0x24984a){return{'name':_0x24984a[_0x6d96('0x2a')],'type':_0x24984a[_0x6d96('0x2b')]['key']};});_0x14f006[_0x6d96('0x2c')]=_[_0x6d96('0x28')](_0x320728,'name');_0x14f006[_0x6d96('0x2d')]=_[_0x6d96('0x2e')](_0x3e6a89[_0x6d96('0x2d')]);_0x14f006[_0x6d96('0x2f')]=_[_0x6d96('0x30')](_0x14f006['model'],_0x14f006[_0x6d96('0x2d')]);_0x4e4e03[_0x6d96('0x31')]=_[_0x6d96('0x30')](_0x14f006[_0x6d96('0x2c')],qs[_0x6d96('0x32')](_0x3e6a89[_0x6d96('0x2d')]['fields']));_0x4e4e03['attributes']=_0x4e4e03[_0x6d96('0x31')][_0x6d96('0x33')]?_0x4e4e03[_0x6d96('0x31')]:_0x14f006['model'];if(!_0x3e6a89[_0x6d96('0x2d')][_0x6d96('0x34')](_0x6d96('0x35'))){_0x4e4e03['limit']=qs[_0x6d96('0x1b')](_0x3e6a89[_0x6d96('0x2d')]['limit']);_0x4e4e03[_0x6d96('0x1d')]=qs['offset'](_0x3e6a89[_0x6d96('0x2d')][_0x6d96('0x1d')]);}_0x4e4e03[_0x6d96('0x36')]=qs[_0x6d96('0x37')](_0x3e6a89['query'][_0x6d96('0x37')]);_0x4e4e03[_0x6d96('0x38')]=qs['filters'](_[_0x6d96('0x39')](_0x3e6a89['query'],_0x14f006[_0x6d96('0x2f')]),_0x320728);if(_0x3e6a89[_0x6d96('0x2d')]['filter']){_0x4e4e03[_0x6d96('0x38')]=_[_0x6d96('0x3a')](_0x4e4e03['where'],{'$or':_[_0x6d96('0x28')](_0x320728,function(_0xc8b11a){if(_0xc8b11a[_0x6d96('0x2b')]!==_0x6d96('0x3b')){var _0x287b45={};_0x287b45[_0xc8b11a['name']]={'$like':'%'+_0x3e6a89[_0x6d96('0x2d')]['filter']+'%'};return _0x287b45;}})});}_0x4e4e03=_[_0x6d96('0x3a')]({},_0x4e4e03,_0x3e6a89['options']);var _0x118056={'where':_0x4e4e03['where']};return db['VtigerAccount']['count'](_0x118056)['then'](function(_0x326bda){_0x5daa6e[_0x6d96('0x1c')]=_0x326bda;if(_0x3e6a89[_0x6d96('0x2d')][_0x6d96('0x3c')]){_0x4e4e03[_0x6d96('0x3d')]=[{'all':!![]}];}return db[_0x6d96('0x3e')]['findAll'](_0x4e4e03);})['then'](function(_0x254858){_0x5daa6e['rows']=_0x254858;return _0x5daa6e;})[_0x6d96('0x22')](respondWithFilteredResult(_0x97a246,_0x4e4e03))[_0x6d96('0x3f')](handleError(_0x97a246,null));};exports[_0x6d96('0x40')]=function(_0x4cac8b,_0x2a56f5){var _0x46eac1={'raw':![],'where':{'id':_0x4cac8b[_0x6d96('0x41')]['id']}},_0x2a7027={};_0x2a7027['model']=_[_0x6d96('0x2e')](db['VtigerAccount'][_0x6d96('0x29')]);_0x2a7027[_0x6d96('0x2d')]=_['keys'](_0x4cac8b[_0x6d96('0x2d')]);_0x2a7027[_0x6d96('0x2f')]=_[_0x6d96('0x30')](_0x2a7027[_0x6d96('0x2c')],_0x2a7027[_0x6d96('0x2d')]);_0x46eac1[_0x6d96('0x31')]=_['intersection'](_0x2a7027[_0x6d96('0x2c')],qs[_0x6d96('0x32')](_0x4cac8b['query'][_0x6d96('0x32')]));_0x46eac1[_0x6d96('0x31')]=_0x46eac1[_0x6d96('0x31')]['length']?_0x46eac1['attributes']:_0x2a7027[_0x6d96('0x2c')];if(_0x4cac8b[_0x6d96('0x2d')]['includeAll']){_0x46eac1[_0x6d96('0x3d')]=[{'all':!![]}];}_0x46eac1=_['merge']({},_0x46eac1,_0x4cac8b[_0x6d96('0x42')]);return db[_0x6d96('0x3e')]['find'](_0x46eac1)[_0x6d96('0x22')](handleEntityNotFound(_0x2a56f5,null))[_0x6d96('0x22')](respondWithResult(_0x2a56f5,null))['catch'](handleError(_0x2a56f5,null));};exports[_0x6d96('0x43')]=function(_0x7f15a7,_0x188d50){return db['VtigerAccount'][_0x6d96('0x43')](_0x7f15a7[_0x6d96('0x44')],{})[_0x6d96('0x22')](respondWithResult(_0x188d50,0xc9))[_0x6d96('0x3f')](handleError(_0x188d50,null));};exports[_0x6d96('0x21')]=function(_0x4fe715,_0x4be8b2){if(_0x4fe715[_0x6d96('0x44')]['id']){delete _0x4fe715[_0x6d96('0x44')]['id'];}return db[_0x6d96('0x3e')][_0x6d96('0x45')]({'where':{'id':_0x4fe715[_0x6d96('0x41')]['id']}})[_0x6d96('0x22')](handleEntityNotFound(_0x4be8b2,null))[_0x6d96('0x22')](saveUpdates(_0x4fe715[_0x6d96('0x44')],null))[_0x6d96('0x22')](respondWithResult(_0x4be8b2,null))[_0x6d96('0x3f')](handleError(_0x4be8b2,null));};exports['destroy']=function(_0x411bfa,_0x3ef829){return db[_0x6d96('0x3e')][_0x6d96('0x45')]({'where':{'id':_0x411bfa['params']['id']}})[_0x6d96('0x22')](handleEntityNotFound(_0x3ef829,null))[_0x6d96('0x22')](removeEntity(_0x3ef829,null))[_0x6d96('0x3f')](handleError(_0x3ef829,null));};exports['getConfigurations']=function(_0x586206,_0x58b7ce,_0x53ba80){var _0x5a8a1a={};var _0x48fa63={};var _0x2d4f48;var _0x37c09f;return db['VtigerAccount'][_0x6d96('0x46')]({'where':{'id':_0x586206[_0x6d96('0x41')]['id']}})[_0x6d96('0x22')](handleEntityNotFound(_0x58b7ce,null))[_0x6d96('0x22')](function(_0x1771de){if(_0x1771de){_0x2d4f48=_0x1771de;_0x48fa63[_0x6d96('0x2c')]=_[_0x6d96('0x2e')](db[_0x6d96('0x47')]['rawAttributes']);_0x48fa63[_0x6d96('0x2d')]=_[_0x6d96('0x2e')](_0x586206[_0x6d96('0x2d')]);_0x48fa63[_0x6d96('0x2f')]=_['intersection'](_0x48fa63['model'],_0x48fa63[_0x6d96('0x2d')]);_0x5a8a1a[_0x6d96('0x31')]=_[_0x6d96('0x30')](_0x48fa63[_0x6d96('0x2c')],qs[_0x6d96('0x32')](_0x586206[_0x6d96('0x2d')][_0x6d96('0x32')]));_0x5a8a1a['attributes']=_0x5a8a1a[_0x6d96('0x31')][_0x6d96('0x33')]?_0x5a8a1a['attributes']:_0x48fa63[_0x6d96('0x2c')];_0x5a8a1a[_0x6d96('0x36')]=qs[_0x6d96('0x37')](_0x586206[_0x6d96('0x2d')][_0x6d96('0x37')]);_0x5a8a1a['where']=qs['filters'](_[_0x6d96('0x39')](_0x586206[_0x6d96('0x2d')],_0x48fa63['filters']));if(_0x586206[_0x6d96('0x2d')][_0x6d96('0x48')]){_0x5a8a1a[_0x6d96('0x38')]=_[_0x6d96('0x3a')](_0x5a8a1a['where'],{'$or':_[_0x6d96('0x28')](_0x5a8a1a[_0x6d96('0x31')],function(_0x632a05){var _0x4d1c86={};_0x4d1c86[_0x632a05]={'$like':'%'+_0x586206[_0x6d96('0x2d')]['filter']+'%'};return _0x4d1c86;})});}_0x5a8a1a=_[_0x6d96('0x3a')]({},_0x5a8a1a,_0x586206['options']);return _0x2d4f48[_0x6d96('0x49')](_0x5a8a1a);}})['then'](function(_0x25b2c5){if(_0x25b2c5){_0x37c09f=_0x25b2c5[_0x6d96('0x33')];if(!_0x586206[_0x6d96('0x2d')]['hasOwnProperty'](_0x6d96('0x35'))){_0x5a8a1a['limit']=qs[_0x6d96('0x1b')](_0x586206['query'][_0x6d96('0x1b')]);_0x5a8a1a[_0x6d96('0x1d')]=qs[_0x6d96('0x1d')](_0x586206['query'][_0x6d96('0x1d')]);}return _0x2d4f48[_0x6d96('0x49')](_0x5a8a1a);}})['then'](function(_0x2b19f5){if(_0x2b19f5){return _0x2b19f5?{'count':_0x37c09f,'rows':_0x2b19f5}:null;}})[_0x6d96('0x22')](respondWithResult(_0x58b7ce,null))[_0x6d96('0x3f')](handleError(_0x58b7ce,null));};exports[_0x6d96('0x4a')]=function(_0x594f1e,_0xaf8df2,_0x1246cd){if(_0x594f1e[_0x6d96('0x44')]['id']){delete _0x594f1e[_0x6d96('0x44')]['id'];}return db[_0x6d96('0x3e')][_0x6d96('0x46')]({'where':{'id':_0x594f1e[_0x6d96('0x41')]['id']}})[_0x6d96('0x22')](handleEntityNotFound(_0xaf8df2,null))[_0x6d96('0x22')](function(_0x3f1933){if(_0x3f1933){_0x594f1e[_0x6d96('0x44')][_0x6d96('0x4b')]=_0x3f1933['id'];_0x594f1e[_0x6d96('0x44')][_0x6d96('0x4c')]=integrations['getSubjects'](_0x594f1e['body'][_0x6d96('0x4d')],_0x594f1e[_0x6d96('0x44')]['type']);_0x594f1e[_0x6d96('0x44')][_0x6d96('0x4e')]=integrations[_0x6d96('0x4f')](_0x594f1e[_0x6d96('0x44')]['channel'],_0x594f1e[_0x6d96('0x44')][_0x6d96('0x2b')]);return db[_0x6d96('0x47')][_0x6d96('0x43')](_0x594f1e[_0x6d96('0x44')],{'include':[{'model':db[_0x6d96('0x50')],'as':_0x6d96('0x4c')},{'model':db['VtigerField'],'as':_0x6d96('0x4e')}]});}return null;})[_0x6d96('0x22')](respondWithResult(_0xaf8df2,null))[_0x6d96('0x3f')](handleError(_0xaf8df2,null));};var md5=require(_0x6d96('0x51'));exports[_0x6d96('0x52')]=function(_0x5e7408,_0x413191,_0x2b70e8){var _0x3b2a1c=null;var _0xfc8bcd=null;var _0x54e350=null;var _0x1f1e2e=null;var _0x589d30='';return db[_0x6d96('0x3e')]['findOne']({'where':{'id':_0x5e7408['params']['id']},'attributes':['id',_0x6d96('0x53'),'username','description','moduleName',_0x6d96('0x54'),_0x6d96('0x55'),'accessKey']})[_0x6d96('0x22')](handleEntityNotFound(_0x413191,null))[_0x6d96('0x22')](function(_0x263e61){if(_0x263e61){_0x3b2a1c=_0x263e61[_0x6d96('0x56')];_0xfc8bcd=_0x263e61[_0x6d96('0x57')];_0x54e350=_0x263e61[_0x6d96('0x58')];_0x589d30=_0x263e61[_0x6d96('0x54')];var _0x159de8=_0x589d30[_0x6d96('0x59')](-0x1);if(_0x159de8==='/'){_0x589d30=_0x589d30[_0x6d96('0x5a')](0x0,_0x589d30[_0x6d96('0x5b')](_0x159de8));}_0x1f1e2e=util[_0x6d96('0x5c')](_0x6d96('0x5d'),_0x589d30);var _0xecce7d={'method':_0x6d96('0x5e'),'uri':_0x1f1e2e,'qs':{'operation':_0x6d96('0x5f'),'username':_0x263e61[_0x6d96('0x56')]},'json':!![]};return rp(_0xecce7d);}})[_0x6d96('0x22')](function(_0x50ab23){if(_0x50ab23['success']){var _0x51b439={'method':_0x6d96('0x60'),'uri':_0x1f1e2e,'form':{'operation':_0x6d96('0x61'),'username':_0x3b2a1c,'accessKey':md5(_0x50ab23[_0x6d96('0x62')][_0x6d96('0x63')]+_0xfc8bcd)},'json':!![]};return rp(_0x51b439);}})[_0x6d96('0x22')](function(_0x2fa13c){if(_0x2fa13c[_0x6d96('0x64')]){var _0xfc4ed1={'method':_0x6d96('0x5e'),'uri':_0x1f1e2e,'qs':{'operation':'describe','username':_0x3b2a1c,'sessionName':_0x2fa13c[_0x6d96('0x62')][_0x6d96('0x65')],'elementType':_0x54e350},'json':!![]};return rp(_0xfc4ed1);}})[_0x6d96('0x22')](function(_0x1c42a2){if(_0x1c42a2[_0x6d96('0x64')]){var _0x30672f=[_0x6d96('0x66'),'reference',_0x6d96('0x67')];_['remove'](_0x1c42a2['result']['fields'],function(_0x2d0931){return _0x30672f[_0x6d96('0x68')](_0x2d0931['type'][_0x6d96('0x53')]);});_[_0x6d96('0x69')](_0x1c42a2[_0x6d96('0x62')][_0x6d96('0x32')],function(_0x3ece72){return _0x3ece72[_0x6d96('0x6a')]==='false';});return{'count':_0x1c42a2[_0x6d96('0x62')][_0x6d96('0x32')][_0x6d96('0x33')],'rows':_['map'](_0x1c42a2[_0x6d96('0x62')][_0x6d96('0x32')],function(_0xce2556){return{'id':_0xce2556['name'],'name':_0xce2556['label'],'custom':_['startsWith'](_0xce2556[_0x6d96('0x53')],_0x6d96('0x6b'))?!![]:![],'options':_0xce2556[_0x6d96('0x2b')][_0x6d96('0x53')]==='picklist'&&_0xce2556[_0x6d96('0x2b')][_0x6d96('0x6c')]['length']>0x0?_[_0x6d96('0x28')](_0xce2556[_0x6d96('0x2b')]['picklistValues'],function(_0x161111){return{'name':_0x161111[_0x6d96('0x6d')],'value':_0x161111['value']};}):[]};})};}})[_0x6d96('0x22')](respondWithResult(_0x413191,null))[_0x6d96('0x3f')](function(_0x1bcce4){console[_0x6d96('0x6e')](_0x6d96('0x6f')+_0x1bcce4);var _0x32f198=_0x5e7408[_0x6d96('0x2d')][_0x6d96('0x70')]?0x1f4:_0x1bcce4[_0x6d96('0x71')]||0x1f4;logger[_0x6d96('0x72')](_0x6d96('0x73'),_0x6d96('0x52'),_0x32f198,JSON[_0x6d96('0x74')](_0x1bcce4));delete _0x1bcce4[_0x6d96('0x53')];if(_0x32f198===0x191){_0x32f198=0x190;}_0x413191[_0x6d96('0x17')](_0x32f198)['send'](_0x5e7408[_0x6d96('0x2d')][_0x6d96('0x70')]?{'message':_0x6d96('0x75'),'statusCode':_0x1bcce4[_0x6d96('0x71')]}:_0x1bcce4);});}; \ No newline at end of file +var _0x0d9a=['create','body','getConfigurations','findOne','VtigerConfiguration','order','addConfiguration','AccountId','Subjects','channel','getDescriptions','VtigerField','Descriptions','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','substring','lastIndexOf','%s/webservice.php','getchallenge','success','login','result','GET','sessionName','reference','owner','remove','false','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','index','map','VtigerAccount','fieldName','type','keys','filters','intersection','model','attributes','fields','length','query','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','rawAttributes','includeAll','find'];(function(_0x4fd82a,_0x29d9d5){var _0x21d2a8=function(_0x11f85f){while(--_0x11f85f){_0x4fd82a['push'](_0x4fd82a['shift']());}};_0x21d2a8(++_0x29d9d5);}(_0x0d9a,0x11d));var _0xa0d9=function(_0x44979a,_0x57078e){_0x44979a=_0x44979a-0x0;var _0x2d6688=_0x0d9a[_0x44979a];return _0x2d6688;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa0d9('0x0'));var jsonpatch=require(_0xa0d9('0x1'));var rp=require(_0xa0d9('0x2'));var moment=require(_0xa0d9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa0d9('0x4'));var util=require(_0xa0d9('0x5'));var path=require(_0xa0d9('0x6'));var sox=require(_0xa0d9('0x7'));var csv=require(_0xa0d9('0x8'));var ejs=require(_0xa0d9('0x9'));var fs=require('fs');var fs_extra=require(_0xa0d9('0xa'));var _=require(_0xa0d9('0xb'));var squel=require(_0xa0d9('0xc'));var crypto=require(_0xa0d9('0xd'));var jsforce=require(_0xa0d9('0xe'));var deskjs=require(_0xa0d9('0xf'));var toCsv=require(_0xa0d9('0x8'));var querystring=require(_0xa0d9('0x10'));var Papa=require(_0xa0d9('0x11'));var Redis=require(_0xa0d9('0x12'));var authService=require(_0xa0d9('0x13'));var qs=require(_0xa0d9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0d9('0x15'));var logger=require('../../config/logger')(_0xa0d9('0x16'));var utils=require('../../config/utils');var config=require(_0xa0d9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa0d9('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x57e788,_0x1dca3c){_0x1dca3c=_0x1dca3c||0xcc;return function(_0x596903){if(_0x596903){return _0x57e788[_0xa0d9('0x19')](_0x1dca3c);}return _0x57e788['status'](_0x1dca3c)['end']();};}function respondWithResult(_0x76cb6f,_0x1efef0){_0x1efef0=_0x1efef0||0xc8;return function(_0x4d6e74){if(_0x4d6e74){return _0x76cb6f['status'](_0x1efef0)[_0xa0d9('0x1a')](_0x4d6e74);}};}function respondWithFilteredResult(_0x4ce006,_0x3c0bfc){return function(_0x2286a4){if(_0x2286a4){var _0x377105=typeof _0x3c0bfc[_0xa0d9('0x1b')]===_0xa0d9('0x1c')&&typeof _0x3c0bfc[_0xa0d9('0x1d')]===_0xa0d9('0x1c');var _0x5e162b=_0x2286a4[_0xa0d9('0x1e')];var _0x2b6440=_0x377105?0x0:_0x3c0bfc[_0xa0d9('0x1b')];var _0x26b461=_0x377105?_0x2286a4[_0xa0d9('0x1e')]:_0x3c0bfc[_0xa0d9('0x1b')]+_0x3c0bfc[_0xa0d9('0x1d')];var _0x5b5a72;if(_0x26b461>=_0x5e162b){_0x26b461=_0x5e162b;_0x5b5a72=0xc8;}else{_0x5b5a72=0xce;}_0x4ce006[_0xa0d9('0x1f')](_0x5b5a72);return _0x4ce006[_0xa0d9('0x20')](_0xa0d9('0x21'),_0x2b6440+'-'+_0x26b461+'/'+_0x5e162b)[_0xa0d9('0x1a')](_0x2286a4);}return null;};}function patchUpdates(_0x474d5a){return function(_0x864d21){try{jsonpatch[_0xa0d9('0x22')](_0x864d21,_0x474d5a,!![]);}catch(_0x59f327){return BPromise[_0xa0d9('0x23')](_0x59f327);}return _0x864d21['save']();};}function saveUpdates(_0x5a0952,_0x16df6d){return function(_0x24a7bb){if(_0x24a7bb){return _0x24a7bb[_0xa0d9('0x24')](_0x5a0952)[_0xa0d9('0x25')](function(_0x4dbd16){return _0x4dbd16;});}return null;};}function removeEntity(_0x36b4b5,_0x880da3){return function(_0x4776f0){if(_0x4776f0){return _0x4776f0[_0xa0d9('0x26')]()[_0xa0d9('0x25')](function(){_0x36b4b5[_0xa0d9('0x1f')](0xcc)[_0xa0d9('0x27')]();});}};}function handleEntityNotFound(_0x28764c,_0x5bc37c){return function(_0x4d8e2){if(!_0x4d8e2){_0x28764c[_0xa0d9('0x19')](0x194);}return _0x4d8e2;};}function handleError(_0x3a7f66,_0x4f3795){_0x4f3795=_0x4f3795||0x1f4;return function(_0x5655cd){logger[_0xa0d9('0x28')](_0x5655cd[_0xa0d9('0x29')]);if(_0x5655cd[_0xa0d9('0x2a')]){delete _0x5655cd[_0xa0d9('0x2a')];}_0x3a7f66[_0xa0d9('0x1f')](_0x4f3795)['send'](_0x5655cd);};}exports[_0xa0d9('0x2b')]=function(_0x4aec79,_0x214ee4){var _0x450592={},_0x48aa69={},_0x847074={'count':0x0,'rows':[]};var _0x4561a5=_[_0xa0d9('0x2c')](db[_0xa0d9('0x2d')]['rawAttributes'],function(_0x5914fc){return{'name':_0x5914fc[_0xa0d9('0x2e')],'type':_0x5914fc[_0xa0d9('0x2f')]['key']};});_0x48aa69['model']=_[_0xa0d9('0x2c')](_0x4561a5,'name');_0x48aa69['query']=_[_0xa0d9('0x30')](_0x4aec79['query']);_0x48aa69[_0xa0d9('0x31')]=_[_0xa0d9('0x32')](_0x48aa69[_0xa0d9('0x33')],_0x48aa69['query']);_0x450592[_0xa0d9('0x34')]=_[_0xa0d9('0x32')](_0x48aa69[_0xa0d9('0x33')],qs[_0xa0d9('0x35')](_0x4aec79['query'][_0xa0d9('0x35')]));_0x450592[_0xa0d9('0x34')]=_0x450592['attributes'][_0xa0d9('0x36')]?_0x450592[_0xa0d9('0x34')]:_0x48aa69[_0xa0d9('0x33')];if(!_0x4aec79[_0xa0d9('0x37')][_0xa0d9('0x38')](_0xa0d9('0x39'))){_0x450592[_0xa0d9('0x1d')]=qs[_0xa0d9('0x1d')](_0x4aec79[_0xa0d9('0x37')][_0xa0d9('0x1d')]);_0x450592[_0xa0d9('0x1b')]=qs[_0xa0d9('0x1b')](_0x4aec79[_0xa0d9('0x37')][_0xa0d9('0x1b')]);}_0x450592['order']=qs[_0xa0d9('0x3a')](_0x4aec79[_0xa0d9('0x37')]['sort']);_0x450592[_0xa0d9('0x3b')]=qs['filters'](_[_0xa0d9('0x3c')](_0x4aec79[_0xa0d9('0x37')],_0x48aa69[_0xa0d9('0x31')]),_0x4561a5);if(_0x4aec79['query'][_0xa0d9('0x3d')]){_0x450592['where']=_[_0xa0d9('0x3e')](_0x450592['where'],{'$or':_[_0xa0d9('0x2c')](_0x4561a5,function(_0x369b9d){if(_0x369b9d[_0xa0d9('0x2f')]!==_0xa0d9('0x3f')){var _0x451b4c={};_0x451b4c[_0x369b9d['name']]={'$like':'%'+_0x4aec79[_0xa0d9('0x37')][_0xa0d9('0x3d')]+'%'};return _0x451b4c;}})});}_0x450592=_[_0xa0d9('0x3e')]({},_0x450592,_0x4aec79[_0xa0d9('0x40')]);var _0xe1f73a={'where':_0x450592[_0xa0d9('0x3b')]};return db[_0xa0d9('0x2d')][_0xa0d9('0x1e')](_0xe1f73a)[_0xa0d9('0x25')](function(_0x3cebd7){_0x847074[_0xa0d9('0x1e')]=_0x3cebd7;if(_0x4aec79[_0xa0d9('0x37')]['includeAll']){_0x450592['include']=[{'all':!![]}];}return db['VtigerAccount'][_0xa0d9('0x41')](_0x450592);})[_0xa0d9('0x25')](function(_0x3a3977){_0x847074[_0xa0d9('0x42')]=_0x3a3977;return _0x847074;})['then'](respondWithFilteredResult(_0x214ee4,_0x450592))[_0xa0d9('0x43')](handleError(_0x214ee4,null));};exports['show']=function(_0x4ba1c8,_0x4770db){var _0xead487={'raw':![],'where':{'id':_0x4ba1c8[_0xa0d9('0x44')]['id']}},_0x2077a6={};_0x2077a6['model']=_['keys'](db[_0xa0d9('0x2d')][_0xa0d9('0x45')]);_0x2077a6[_0xa0d9('0x37')]=_['keys'](_0x4ba1c8[_0xa0d9('0x37')]);_0x2077a6[_0xa0d9('0x31')]=_['intersection'](_0x2077a6['model'],_0x2077a6[_0xa0d9('0x37')]);_0xead487['attributes']=_['intersection'](_0x2077a6[_0xa0d9('0x33')],qs['fields'](_0x4ba1c8[_0xa0d9('0x37')][_0xa0d9('0x35')]));_0xead487[_0xa0d9('0x34')]=_0xead487[_0xa0d9('0x34')][_0xa0d9('0x36')]?_0xead487[_0xa0d9('0x34')]:_0x2077a6[_0xa0d9('0x33')];if(_0x4ba1c8[_0xa0d9('0x37')][_0xa0d9('0x46')]){_0xead487['include']=[{'all':!![]}];}_0xead487=_[_0xa0d9('0x3e')]({},_0xead487,_0x4ba1c8[_0xa0d9('0x40')]);return db[_0xa0d9('0x2d')][_0xa0d9('0x47')](_0xead487)[_0xa0d9('0x25')](handleEntityNotFound(_0x4770db,null))[_0xa0d9('0x25')](respondWithResult(_0x4770db,null))[_0xa0d9('0x43')](handleError(_0x4770db,null));};exports[_0xa0d9('0x48')]=function(_0x2372fd,_0x1d7c1a){return db[_0xa0d9('0x2d')]['create'](_0x2372fd[_0xa0d9('0x49')],{})[_0xa0d9('0x25')](respondWithResult(_0x1d7c1a,0xc9))[_0xa0d9('0x43')](handleError(_0x1d7c1a,null));};exports[_0xa0d9('0x24')]=function(_0x343fe5,_0x3356cf){if(_0x343fe5[_0xa0d9('0x49')]['id']){delete _0x343fe5[_0xa0d9('0x49')]['id'];}return db[_0xa0d9('0x2d')][_0xa0d9('0x47')]({'where':{'id':_0x343fe5[_0xa0d9('0x44')]['id']}})['then'](handleEntityNotFound(_0x3356cf,null))['then'](saveUpdates(_0x343fe5[_0xa0d9('0x49')],null))[_0xa0d9('0x25')](respondWithResult(_0x3356cf,null))['catch'](handleError(_0x3356cf,null));};exports[_0xa0d9('0x26')]=function(_0x14a538,_0x559a08){return db[_0xa0d9('0x2d')]['find']({'where':{'id':_0x14a538[_0xa0d9('0x44')]['id']}})[_0xa0d9('0x25')](handleEntityNotFound(_0x559a08,null))[_0xa0d9('0x25')](removeEntity(_0x559a08,null))[_0xa0d9('0x43')](handleError(_0x559a08,null));};exports[_0xa0d9('0x4a')]=function(_0x32f0f0,_0x5eb655,_0x435f82){var _0x252175={};var _0x2bd110={};var _0x4e89ef;var _0x146a79;return db[_0xa0d9('0x2d')][_0xa0d9('0x4b')]({'where':{'id':_0x32f0f0['params']['id']}})[_0xa0d9('0x25')](handleEntityNotFound(_0x5eb655,null))[_0xa0d9('0x25')](function(_0x47a4e9){if(_0x47a4e9){_0x4e89ef=_0x47a4e9;_0x2bd110[_0xa0d9('0x33')]=_[_0xa0d9('0x30')](db[_0xa0d9('0x4c')][_0xa0d9('0x45')]);_0x2bd110[_0xa0d9('0x37')]=_[_0xa0d9('0x30')](_0x32f0f0[_0xa0d9('0x37')]);_0x2bd110[_0xa0d9('0x31')]=_[_0xa0d9('0x32')](_0x2bd110[_0xa0d9('0x33')],_0x2bd110[_0xa0d9('0x37')]);_0x252175['attributes']=_['intersection'](_0x2bd110[_0xa0d9('0x33')],qs['fields'](_0x32f0f0['query'][_0xa0d9('0x35')]));_0x252175['attributes']=_0x252175['attributes']['length']?_0x252175[_0xa0d9('0x34')]:_0x2bd110['model'];_0x252175[_0xa0d9('0x4d')]=qs[_0xa0d9('0x3a')](_0x32f0f0[_0xa0d9('0x37')][_0xa0d9('0x3a')]);_0x252175[_0xa0d9('0x3b')]=qs[_0xa0d9('0x31')](_[_0xa0d9('0x3c')](_0x32f0f0[_0xa0d9('0x37')],_0x2bd110[_0xa0d9('0x31')]));if(_0x32f0f0['query'][_0xa0d9('0x3d')]){_0x252175[_0xa0d9('0x3b')]=_[_0xa0d9('0x3e')](_0x252175['where'],{'$or':_[_0xa0d9('0x2c')](_0x252175['attributes'],function(_0x16ce90){var _0x178099={};_0x178099[_0x16ce90]={'$like':'%'+_0x32f0f0[_0xa0d9('0x37')][_0xa0d9('0x3d')]+'%'};return _0x178099;})});}_0x252175=_[_0xa0d9('0x3e')]({},_0x252175,_0x32f0f0[_0xa0d9('0x40')]);return _0x4e89ef[_0xa0d9('0x4a')](_0x252175);}})[_0xa0d9('0x25')](function(_0x5a8c30){if(_0x5a8c30){_0x146a79=_0x5a8c30['length'];if(!_0x32f0f0['query']['hasOwnProperty'](_0xa0d9('0x39'))){_0x252175[_0xa0d9('0x1d')]=qs[_0xa0d9('0x1d')](_0x32f0f0[_0xa0d9('0x37')][_0xa0d9('0x1d')]);_0x252175[_0xa0d9('0x1b')]=qs['offset'](_0x32f0f0['query'][_0xa0d9('0x1b')]);}return _0x4e89ef['getConfigurations'](_0x252175);}})[_0xa0d9('0x25')](function(_0xbbcc2d){if(_0xbbcc2d){return _0xbbcc2d?{'count':_0x146a79,'rows':_0xbbcc2d}:null;}})[_0xa0d9('0x25')](respondWithResult(_0x5eb655,null))[_0xa0d9('0x43')](handleError(_0x5eb655,null));};exports[_0xa0d9('0x4e')]=function(_0x373af1,_0x592bfc,_0x3dc7e9){if(_0x373af1[_0xa0d9('0x49')]['id']){delete _0x373af1[_0xa0d9('0x49')]['id'];}return db[_0xa0d9('0x2d')][_0xa0d9('0x4b')]({'where':{'id':_0x373af1[_0xa0d9('0x44')]['id']}})['then'](handleEntityNotFound(_0x592bfc,null))[_0xa0d9('0x25')](function(_0x50ef13){if(_0x50ef13){_0x373af1['body'][_0xa0d9('0x4f')]=_0x50ef13['id'];_0x373af1[_0xa0d9('0x49')][_0xa0d9('0x50')]=integrations['getSubjects'](_0x373af1['body'][_0xa0d9('0x51')],_0x373af1[_0xa0d9('0x49')]['type']);_0x373af1[_0xa0d9('0x49')]['Descriptions']=integrations[_0xa0d9('0x52')](_0x373af1[_0xa0d9('0x49')][_0xa0d9('0x51')],_0x373af1[_0xa0d9('0x49')][_0xa0d9('0x2f')]);return db[_0xa0d9('0x4c')]['create'](_0x373af1['body'],{'include':[{'model':db[_0xa0d9('0x53')],'as':_0xa0d9('0x50')},{'model':db[_0xa0d9('0x53')],'as':_0xa0d9('0x54')}]});}return null;})['then'](respondWithResult(_0x592bfc,null))[_0xa0d9('0x43')](handleError(_0x592bfc,null));};var md5=require('md5');exports[_0xa0d9('0x55')]=function(_0x31fe81,_0x80c828,_0x3e73d7){var _0x50fe22=null;var _0x3b7f0b=null;var _0x37c04e=null;var _0x53936c=null;var _0x41ac11='';return db[_0xa0d9('0x2d')][_0xa0d9('0x4b')]({'where':{'id':_0x31fe81[_0xa0d9('0x44')]['id']},'attributes':['id',_0xa0d9('0x2a'),_0xa0d9('0x56'),_0xa0d9('0x57'),_0xa0d9('0x58'),'remoteUri',_0xa0d9('0x59'),_0xa0d9('0x5a')]})[_0xa0d9('0x25')](handleEntityNotFound(_0x80c828,null))[_0xa0d9('0x25')](function(_0x4312b6){if(_0x4312b6){_0x50fe22=_0x4312b6['username'];_0x3b7f0b=_0x4312b6[_0xa0d9('0x5a')];_0x37c04e=_0x4312b6[_0xa0d9('0x58')];_0x41ac11=_0x4312b6[_0xa0d9('0x5b')];var _0x1ddd2e=_0x41ac11[_0xa0d9('0x5c')](-0x1);if(_0x1ddd2e==='/'){_0x41ac11=_0x41ac11[_0xa0d9('0x5d')](0x0,_0x41ac11[_0xa0d9('0x5e')](_0x1ddd2e));}_0x53936c=util['format'](_0xa0d9('0x5f'),_0x41ac11);var _0x383a40={'method':'GET','uri':_0x53936c,'qs':{'operation':_0xa0d9('0x60'),'username':_0x4312b6[_0xa0d9('0x56')]},'json':!![]};return rp(_0x383a40);}})['then'](function(_0xdb653c){if(_0xdb653c[_0xa0d9('0x61')]){var _0x4d4515={'method':'POST','uri':_0x53936c,'form':{'operation':_0xa0d9('0x62'),'username':_0x50fe22,'accessKey':md5(_0xdb653c[_0xa0d9('0x63')]['token']+_0x3b7f0b)},'json':!![]};return rp(_0x4d4515);}})[_0xa0d9('0x25')](function(_0x4a7d12){if(_0x4a7d12['success']){var _0x75093e={'method':_0xa0d9('0x64'),'uri':_0x53936c,'qs':{'operation':'describe','username':_0x50fe22,'sessionName':_0x4a7d12[_0xa0d9('0x63')][_0xa0d9('0x65')],'elementType':_0x37c04e},'json':!![]};return rp(_0x75093e);}})[_0xa0d9('0x25')](function(_0x590a42){if(_0x590a42[_0xa0d9('0x61')]){var _0x440c44=['autogenerated',_0xa0d9('0x66'),_0xa0d9('0x67')];_[_0xa0d9('0x68')](_0x590a42['result']['fields'],function(_0x551e44){return _0x440c44['includes'](_0x551e44[_0xa0d9('0x2f')]['name']);});_[_0xa0d9('0x68')](_0x590a42['result'][_0xa0d9('0x35')],function(_0x1d024c){return _0x1d024c['editable']===_0xa0d9('0x69');});return{'count':_0x590a42[_0xa0d9('0x63')][_0xa0d9('0x35')][_0xa0d9('0x36')],'rows':_[_0xa0d9('0x2c')](_0x590a42[_0xa0d9('0x63')][_0xa0d9('0x35')],function(_0x51e754){return{'id':_0x51e754['name'],'name':_0x51e754[_0xa0d9('0x6a')],'custom':_[_0xa0d9('0x6b')](_0x51e754['name'],'cf_')?!![]:![],'options':_0x51e754[_0xa0d9('0x2f')]['name']===_0xa0d9('0x6c')&&_0x51e754['type'][_0xa0d9('0x6d')][_0xa0d9('0x36')]>0x0?_[_0xa0d9('0x2c')](_0x51e754[_0xa0d9('0x2f')][_0xa0d9('0x6d')],function(_0x1b9956){return{'name':_0x1b9956[_0xa0d9('0x6a')],'value':_0x1b9956[_0xa0d9('0x6e')]};}):[]};})};}})[_0xa0d9('0x25')](respondWithResult(_0x80c828,null))[_0xa0d9('0x43')](function(_0xb89c00){console[_0xa0d9('0x6f')](_0xa0d9('0x70')+_0xb89c00);var _0x13b7ba=_0x31fe81[_0xa0d9('0x37')][_0xa0d9('0x71')]?0x1f4:_0xb89c00[_0xa0d9('0x72')]||0x1f4;logger['error'](_0xa0d9('0x73'),_0xa0d9('0x55'),_0x13b7ba,JSON[_0xa0d9('0x74')](_0xb89c00));delete _0xb89c00[_0xa0d9('0x2a')];if(_0x13b7ba===0x191){_0x13b7ba=0x190;}_0x80c828[_0xa0d9('0x1f')](_0x13b7ba)[_0xa0d9('0x75')](_0x31fe81[_0xa0d9('0x37')][_0xa0d9('0x71')]?{'message':_0xa0d9('0x76'),'statusCode':_0xb89c00['statusCode']}:_0xb89c00);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 0865084..b9d3819 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 _0xd512=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5eccde,_0x48b6a1){var _0x18283b=function(_0x26a8ef){while(--_0x26a8ef){_0x5eccde['push'](_0x5eccde['shift']());}};_0x18283b(++_0x48b6a1);}(_0xd512,0xc7));var _0x2d51=function(_0x473a3c,_0x29ad51){_0x473a3c=_0x473a3c-0x0;var _0x16bbb3=_0xd512[_0x473a3c];return _0x16bbb3;};'use strict';var _=require(_0x2d51('0x0'));var util=require(_0x2d51('0x1'));var logger=require(_0x2d51('0x2'))(_0x2d51('0x3'));var moment=require(_0x2d51('0x4'));var BPromise=require(_0x2d51('0x5'));var rp=require(_0x2d51('0x6'));var fs=require('fs');var path=require(_0x2d51('0x7'));var rimraf=require(_0x2d51('0x8'));var config=require(_0x2d51('0x9'));var attributes=require(_0x2d51('0xa'));var integrations=require(_0x2d51('0xb'));module[_0x2d51('0xc')]=function(_0x194b24,_0x596fb2){return _0x194b24[_0x2d51('0xd')](_0x2d51('0xe'),attributes,{'tableName':_0x2d51('0xf'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x451e=['moment','bluebird','request-promise','path','../../components/integrations/configuration','define','int_vtiger_accounts','lodash','util','../../config/logger','api'];(function(_0x4695ba,_0x5a7f2a){var _0x524b7d=function(_0xfc9707){while(--_0xfc9707){_0x4695ba['push'](_0x4695ba['shift']());}};_0x524b7d(++_0x5a7f2a);}(_0x451e,0x11a));var _0xe451=function(_0x448930,_0x483327){_0x448930=_0x448930-0x0;var _0x20e03a=_0x451e[_0x448930];return _0x20e03a;};'use strict';var _=require(_0xe451('0x0'));var util=require(_0xe451('0x1'));var logger=require(_0xe451('0x2'))(_0xe451('0x3'));var moment=require(_0xe451('0x4'));var BPromise=require(_0xe451('0x5'));var rp=require(_0xe451('0x6'));var fs=require('fs');var path=require(_0xe451('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0xe451('0x8'));module['exports']=function(_0x5452f,_0x16bdbc){return _0x5452f[_0xe451('0x9')]('VtigerAccount',attributes,{'tableName':_0xe451('0xa'),'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 6887ade..87de826 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 _0x0abf=['VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowVtigerAccount','then','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerAccount,\x20%s,\x20%s'];(function(_0x3add06,_0x1a1967){var _0x55e19e=function(_0x4e0e05){while(--_0x4e0e05){_0x3add06['push'](_0x3add06['shift']());}};_0x55e19e(++_0x1a1967);}(_0x0abf,0xe8));var _0xf0ab=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0abf[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233afe,_0x57ff3b,_0x2c4628){return new BPromise(function(_0x3f7e2b,_0x3ca099){return client[_0xf0ab('0xa')](_0x233afe,_0x2c4628)['then'](function(_0x472508){logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,'request\x20sent');logger['debug'](_0xf0ab('0xd'),_0x57ff3b,'request\x20sent',JSON[_0xf0ab('0xe')](_0x472508));if(_0x472508[_0xf0ab('0xf')]){if(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x10')]===0x1f4){logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')]['message']);return _0x3ca099(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);return _0x3f7e2b(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}else{logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,_0xf0ab('0x12'));_0x3f7e2b(_0x472508[_0xf0ab('0x13')][_0xf0ab('0x11')]);}})[_0xf0ab('0x14')](function(_0x230f40){logger['error'](_0xf0ab('0xc'),_0x57ff3b,_0x230f40);_0x3ca099(_0x230f40);});});}exports[_0xf0ab('0x15')]=function(_0x1803f0){var _0x1ffeb5=this;return new Promise(function(_0x776619,_0xb9a33){return db[_0xf0ab('0x16')][_0xf0ab('0x17')]({'raw':_0x1803f0[_0xf0ab('0x18')]?_0x1803f0[_0xf0ab('0x18')][_0xf0ab('0x19')]===undefined?!![]:![]:!![],'where':_0x1803f0[_0xf0ab('0x18')]?_0x1803f0[_0xf0ab('0x18')][_0xf0ab('0x1a')]||null:null,'attributes':_0x1803f0[_0xf0ab('0x18')]?_0x1803f0[_0xf0ab('0x18')]['attributes']||null:null,'limit':_0x1803f0[_0xf0ab('0x18')]?_0x1803f0[_0xf0ab('0x18')][_0xf0ab('0x1b')]||null:null,'include':_0x1803f0[_0xf0ab('0x18')]?_0x1803f0[_0xf0ab('0x18')][_0xf0ab('0x1c')]?_[_0xf0ab('0x1d')](_0x1803f0[_0xf0ab('0x18')][_0xf0ab('0x1c')],function(_0x18bb37){return{'model':db[_0x18bb37[_0xf0ab('0x1e')]],'as':_0x18bb37['as'],'attributes':_0x18bb37['attributes'],'include':_0x18bb37['include']?_['map'](_0x18bb37[_0xf0ab('0x1c')],function(_0x4f0caf){return{'model':db[_0x4f0caf[_0xf0ab('0x1e')]],'as':_0x4f0caf['as'],'attributes':_0x4f0caf[_0xf0ab('0x1f')],'include':_0x4f0caf['include']?_[_0xf0ab('0x1d')](_0x4f0caf[_0xf0ab('0x1c')],function(_0x10bf5f){return{'model':db[_0x10bf5f[_0xf0ab('0x1e')]],'as':_0x10bf5f['as'],'attributes':_0x10bf5f[_0xf0ab('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d0da7){logger['info']('GetVtigerAccount',_0x1803f0);logger[_0xf0ab('0x20')](_0xf0ab('0x15'),_0x1803f0,JSON[_0xf0ab('0xe')](_0x2d0da7));_0x776619(_0x2d0da7);})[_0xf0ab('0x14')](function(_0x43476c){logger[_0xf0ab('0xf')](_0xf0ab('0x15'),_0x43476c[_0xf0ab('0x11')],_0x1803f0);_0xb9a33(_0x1ffeb5[_0xf0ab('0xf')](0x1f4,_0x43476c[_0xf0ab('0x11')]));});});};exports[_0xf0ab('0x21')]=function(_0x199753){var _0x58cbe1=this;return new Promise(function(_0x1e1ffb,_0x35973a){return db['VtigerAccount']['find']({'raw':_0x199753[_0xf0ab('0x18')]?_0x199753[_0xf0ab('0x18')][_0xf0ab('0x19')]===undefined?!![]:![]:!![],'where':_0x199753['options']?_0x199753['options'][_0xf0ab('0x1a')]||null:null,'attributes':_0x199753['options']?_0x199753[_0xf0ab('0x18')]['attributes']||null:null,'include':_0x199753[_0xf0ab('0x18')]?_0x199753[_0xf0ab('0x18')]['include']?_['map'](_0x199753[_0xf0ab('0x18')][_0xf0ab('0x1c')],function(_0x2a3fac){return{'model':db[_0x2a3fac[_0xf0ab('0x1e')]],'as':_0x2a3fac['as'],'attributes':_0x2a3fac[_0xf0ab('0x1f')],'include':_0x2a3fac[_0xf0ab('0x1c')]?_[_0xf0ab('0x1d')](_0x2a3fac[_0xf0ab('0x1c')],function(_0x2a2f5d){return{'model':db[_0x2a2f5d[_0xf0ab('0x1e')]],'as':_0x2a2f5d['as'],'attributes':_0x2a2f5d[_0xf0ab('0x1f')],'include':_0x2a2f5d[_0xf0ab('0x1c')]?_[_0xf0ab('0x1d')](_0x2a2f5d[_0xf0ab('0x1c')],function(_0x5d8443){return{'model':db[_0x5d8443[_0xf0ab('0x1e')]],'as':_0x5d8443['as'],'attributes':_0x5d8443[_0xf0ab('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf0ab('0x22')](function(_0x5c9192){logger[_0xf0ab('0xb')](_0xf0ab('0x21'),_0x199753);logger[_0xf0ab('0x20')]('ShowVtigerAccount',_0x199753,JSON[_0xf0ab('0xe')](_0x5c9192));_0x1e1ffb(_0x5c9192);})['catch'](function(_0xda3971){logger['error'](_0xf0ab('0x21'),_0xda3971[_0xf0ab('0x11')],_0x199753);_0x35973a(_0x58cbe1[_0xf0ab('0xf')](0x1f4,_0xda3971[_0xf0ab('0x11')]));});});}; \ No newline at end of file +var _0xa478=['info','request\x20sent','debug','error','code','message','VtigerAccount,\x20%s,\x20%s','result','catch','GetVtigerAccount','findAll','options','raw','where','attributes','include','map','model','VtigerAccount','find','ShowVtigerAccount','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x5364a4,_0x16f25f){var _0x5bb9fc=function(_0x32531a){while(--_0x32531a){_0x5364a4['push'](_0x5364a4['shift']());}};_0x5bb9fc(++_0x16f25f);}(_0xa478,0x136));var _0x8a47=function(_0x50a463,_0x517a1a){_0x50a463=_0x50a463-0x0;var _0x2971df=_0xa478[_0x50a463];return _0x2971df;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var moment=require(_0x8a47('0x2'));var BPromise=require(_0x8a47('0x3'));var rs=require(_0x8a47('0x4'));var fs=require('fs');var Redis=require(_0x8a47('0x5'));var db=require(_0x8a47('0x6'))['db'];var utils=require(_0x8a47('0x7'));var logger=require(_0x8a47('0x8'))(_0x8a47('0x9'));var config=require(_0x8a47('0xa'));var jayson=require(_0x8a47('0xb'));var client=jayson['client'][_0x8a47('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d62a6,_0x3de815,_0x3cb340){return new BPromise(function(_0x56884b,_0x384886){return client['request'](_0x2d62a6,_0x3cb340)[_0x8a47('0xd')](function(_0x369fc9){logger[_0x8a47('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x3de815,_0x8a47('0xf'));logger[_0x8a47('0x10')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x3de815,_0x8a47('0xf'),JSON['stringify'](_0x369fc9));if(_0x369fc9[_0x8a47('0x11')]){if(_0x369fc9[_0x8a47('0x11')][_0x8a47('0x12')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x3de815,_0x369fc9['error'][_0x8a47('0x13')]);return _0x384886(_0x369fc9[_0x8a47('0x11')]['message']);}logger[_0x8a47('0x11')](_0x8a47('0x14'),_0x3de815,_0x369fc9[_0x8a47('0x11')][_0x8a47('0x13')]);return _0x56884b(_0x369fc9[_0x8a47('0x11')][_0x8a47('0x13')]);}else{logger[_0x8a47('0xe')](_0x8a47('0x14'),_0x3de815,_0x8a47('0xf'));_0x56884b(_0x369fc9[_0x8a47('0x15')][_0x8a47('0x13')]);}})[_0x8a47('0x16')](function(_0x2917d9){logger['error'](_0x8a47('0x14'),_0x3de815,_0x2917d9);_0x384886(_0x2917d9);});});}exports[_0x8a47('0x17')]=function(_0x3f9093){var _0x5f5884=this;return new Promise(function(_0x341089,_0x5c62eb){return db['VtigerAccount'][_0x8a47('0x18')]({'raw':_0x3f9093[_0x8a47('0x19')]?_0x3f9093[_0x8a47('0x19')][_0x8a47('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f9093[_0x8a47('0x19')]?_0x3f9093[_0x8a47('0x19')][_0x8a47('0x1b')]||null:null,'attributes':_0x3f9093[_0x8a47('0x19')]?_0x3f9093[_0x8a47('0x19')][_0x8a47('0x1c')]||null:null,'limit':_0x3f9093['options']?_0x3f9093[_0x8a47('0x19')]['limit']||null:null,'include':_0x3f9093[_0x8a47('0x19')]?_0x3f9093[_0x8a47('0x19')][_0x8a47('0x1d')]?_[_0x8a47('0x1e')](_0x3f9093['options'][_0x8a47('0x1d')],function(_0x5ae186){return{'model':db[_0x5ae186['model']],'as':_0x5ae186['as'],'attributes':_0x5ae186['attributes'],'include':_0x5ae186['include']?_[_0x8a47('0x1e')](_0x5ae186[_0x8a47('0x1d')],function(_0x5bed3e){return{'model':db[_0x5bed3e[_0x8a47('0x1f')]],'as':_0x5bed3e['as'],'attributes':_0x5bed3e[_0x8a47('0x1c')],'include':_0x5bed3e[_0x8a47('0x1d')]?_[_0x8a47('0x1e')](_0x5bed3e[_0x8a47('0x1d')],function(_0xd06be6){return{'model':db[_0xd06be6[_0x8a47('0x1f')]],'as':_0xd06be6['as'],'attributes':_0xd06be6['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a47('0xd')](function(_0x4a10c3){logger[_0x8a47('0xe')](_0x8a47('0x17'),_0x3f9093);logger['debug'](_0x8a47('0x17'),_0x3f9093,JSON['stringify'](_0x4a10c3));_0x341089(_0x4a10c3);})['catch'](function(_0x12470a){logger[_0x8a47('0x11')](_0x8a47('0x17'),_0x12470a[_0x8a47('0x13')],_0x3f9093);_0x5c62eb(_0x5f5884[_0x8a47('0x11')](0x1f4,_0x12470a[_0x8a47('0x13')]));});});};exports['ShowVtigerAccount']=function(_0x353576){var _0x4d78b5=this;return new Promise(function(_0x549913,_0x448459){return db[_0x8a47('0x20')][_0x8a47('0x21')]({'raw':_0x353576[_0x8a47('0x19')]?_0x353576[_0x8a47('0x19')][_0x8a47('0x1a')]===undefined?!![]:![]:!![],'where':_0x353576[_0x8a47('0x19')]?_0x353576[_0x8a47('0x19')][_0x8a47('0x1b')]||null:null,'attributes':_0x353576[_0x8a47('0x19')]?_0x353576['options'][_0x8a47('0x1c')]||null:null,'include':_0x353576[_0x8a47('0x19')]?_0x353576[_0x8a47('0x19')]['include']?_[_0x8a47('0x1e')](_0x353576[_0x8a47('0x19')]['include'],function(_0xa1a852){return{'model':db[_0xa1a852[_0x8a47('0x1f')]],'as':_0xa1a852['as'],'attributes':_0xa1a852[_0x8a47('0x1c')],'include':_0xa1a852[_0x8a47('0x1d')]?_['map'](_0xa1a852['include'],function(_0x145908){return{'model':db[_0x145908[_0x8a47('0x1f')]],'as':_0x145908['as'],'attributes':_0x145908[_0x8a47('0x1c')],'include':_0x145908[_0x8a47('0x1d')]?_[_0x8a47('0x1e')](_0x145908[_0x8a47('0x1d')],function(_0x1819ef){return{'model':db[_0x1819ef['model']],'as':_0x1819ef['as'],'attributes':_0x1819ef['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a47('0xd')](function(_0x3636af){logger[_0x8a47('0xe')](_0x8a47('0x22'),_0x353576);logger[_0x8a47('0x10')](_0x8a47('0x22'),_0x353576,JSON[_0x8a47('0x23')](_0x3636af));_0x549913(_0x3636af);})[_0x8a47('0x16')](function(_0xe178f1){logger[_0x8a47('0x11')](_0x8a47('0x22'),_0xe178f1['message'],_0x353576);_0x448459(_0x4d78b5[_0x8a47('0x11')](0x1f4,_0xe178f1['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 0f24a41..ccc2a01 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 _0xd7ab=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','post','create','put','destroy','exports','multer','util'];(function(_0x1b03dd,_0x289311){var _0xdacd57=function(_0x186c8d){while(--_0x186c8d){_0x1b03dd['push'](_0x1b03dd['shift']());}};_0xdacd57(++_0x289311);}(_0xd7ab,0x12a));var _0xbd7a=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd7ab[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xbd7a('0x0'));var util=require(_0xbd7a('0x1'));var path=require('path');var timeout=require(_0xbd7a('0x2'));var express=require(_0xbd7a('0x3'));var router=express[_0xbd7a('0x4')]();var fs_extra=require(_0xbd7a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbd7a('0x6'));var config=require(_0xbd7a('0x7'));var controller=require('./intVtigerConfiguration.controller');router[_0xbd7a('0x8')]('/',auth[_0xbd7a('0x9')](),controller[_0xbd7a('0xa')]);router[_0xbd7a('0x8')](_0xbd7a('0xb'),auth[_0xbd7a('0x9')](),controller[_0xbd7a('0xc')]);router['get'](_0xbd7a('0xd'),auth[_0xbd7a('0x9')](),controller['getFields']);router[_0xbd7a('0x8')]('/:id/subjects',auth[_0xbd7a('0x9')](),controller[_0xbd7a('0xe')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xbd7a('0xf')]('/',auth[_0xbd7a('0x9')](),controller[_0xbd7a('0x10')]);router[_0xbd7a('0x11')](_0xbd7a('0xb'),auth[_0xbd7a('0x9')](),controller['update']);router['delete'](_0xbd7a('0xb'),auth['isAuthenticated'](),controller[_0xbd7a('0x12')]);module[_0xbd7a('0x13')]=router; \ No newline at end of file +var _0x02e9=['./intVtigerConfiguration.controller','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','update','delete','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1afd2c,_0x3e27a1){var _0x5d685c=function(_0x4caa6f){while(--_0x4caa6f){_0x1afd2c['push'](_0x1afd2c['shift']());}};_0x5d685c(++_0x3e27a1);}(_0x02e9,0x162));var _0x902e=function(_0x10414e,_0x4ec9f4){_0x10414e=_0x10414e-0x0;var _0x155f8f=_0x02e9[_0x10414e];return _0x155f8f;};'use strict';var multer=require('multer');var util=require(_0x902e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x902e('0x1'));var router=express['Router']();var fs_extra=require(_0x902e('0x2'));var auth=require(_0x902e('0x3'));var interaction=require(_0x902e('0x4'));var config=require(_0x902e('0x5'));var controller=require(_0x902e('0x6'));router[_0x902e('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x902e('0x7')](_0x902e('0x8'),auth[_0x902e('0x9')](),controller['show']);router[_0x902e('0x7')](_0x902e('0xa'),auth[_0x902e('0x9')](),controller[_0x902e('0xb')]);router[_0x902e('0x7')](_0x902e('0xc'),auth[_0x902e('0x9')](),controller[_0x902e('0xd')]);router['get']('/:id/descriptions',auth[_0x902e('0x9')](),controller[_0x902e('0xe')]);router[_0x902e('0xf')]('/',auth[_0x902e('0x9')](),controller[_0x902e('0x10')]);router['put'](_0x902e('0x8'),auth['isAuthenticated'](),controller[_0x902e('0x11')]);router[_0x902e('0x12')]('/:id',auth[_0x902e('0x9')](),controller['destroy']);module[_0x902e('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 9700e79..8ed4149 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 _0x2f52=['exports','STRING'];(function(_0x39c7bc,_0x52cbca){var _0x3aaed4=function(_0x5a3478){while(--_0x5a3478){_0x39c7bc['push'](_0x39c7bc['shift']());}};_0x3aaed4(++_0x52cbca);}(_0x2f52,0xd2));var _0x22f5=function(_0x208b29,_0x5be5ed){_0x208b29=_0x208b29-0x0;var _0x29fc91=_0x2f52[_0x208b29];return _0x29fc91;};'use strict';var Sequelize=require('sequelize');module[_0x22f5('0x0')]={'name':{'type':Sequelize[_0x22f5('0x1')]},'description':{'type':Sequelize[_0x22f5('0x1')]}}; \ No newline at end of file +var _0x0bc8=['STRING','sequelize','exports'];(function(_0x59c764,_0x4b4a51){var _0x4e3290=function(_0x3ac72f){while(--_0x3ac72f){_0x59c764['push'](_0x59c764['shift']());}};_0x4e3290(++_0x4b4a51);}(_0x0bc8,0x1a5));var _0x80bc=function(_0x5a27d7,_0x564f00){_0x5a27d7=_0x5a27d7-0x0;var _0xea57d8=_0x0bc8[_0x5a27d7];return _0xea57d8;};'use strict';var Sequelize=require(_0x80bc('0x0'));module[_0x80bc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x80bc('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 8bc5247..38f76b1 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 _0xb545=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set','reject','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','VtigerConfiguration','include','rows','catch','show','keys','merge','find','create','body','params','getFields','findOne','VtigerField','nolimit','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x4d1cc6,_0x26bebe){var _0x1a6fee=function(_0x374f30){while(--_0x374f30){_0x4d1cc6['push'](_0x4d1cc6['shift']());}};_0x1a6fee(++_0x26bebe);}(_0xb545,0xcf));var _0x5b54=function(_0x243ced,_0x3f73d3){_0x243ced=_0x243ced-0x0;var _0x4cbd19=_0xb545[_0x243ced];return _0x4cbd19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b54('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5b54('0x1'));var rp=require(_0x5b54('0x2'));var moment=require(_0x5b54('0x3'));var BPromise=require(_0x5b54('0x4'));var Mustache=require(_0x5b54('0x5'));var util=require('util');var path=require(_0x5b54('0x6'));var sox=require(_0x5b54('0x7'));var csv=require(_0x5b54('0x8'));var ejs=require(_0x5b54('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5b54('0xa'));var crypto=require(_0x5b54('0xb'));var jsforce=require(_0x5b54('0xc'));var deskjs=require(_0x5b54('0xd'));var toCsv=require(_0x5b54('0x8'));var querystring=require(_0x5b54('0xe'));var Papa=require('papaparse');var Redis=require(_0x5b54('0xf'));var authService=require(_0x5b54('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5b54('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b54('0x12'))(_0x5b54('0x13'));var utils=require(_0x5b54('0x14'));var config=require(_0x5b54('0x15'));var licenseUtil=require(_0x5b54('0x16'));var db=require(_0x5b54('0x17'))['db'];function respondWithStatusCode(_0x46f2c2,_0x319108){_0x319108=_0x319108||0xcc;return function(_0x5635fd){if(_0x5635fd){return _0x46f2c2['sendStatus'](_0x319108);}return _0x46f2c2['status'](_0x319108)[_0x5b54('0x18')]();};}function respondWithResult(_0x272b62,_0x1c867b){_0x1c867b=_0x1c867b||0xc8;return function(_0x4e33b3){if(_0x4e33b3){return _0x272b62[_0x5b54('0x19')](_0x1c867b)[_0x5b54('0x1a')](_0x4e33b3);}};}function respondWithFilteredResult(_0x459e2f,_0x42b2ee){return function(_0x124abd){if(_0x124abd){var _0x54f56e=typeof _0x42b2ee[_0x5b54('0x1b')]==='undefined'&&typeof _0x42b2ee[_0x5b54('0x1c')]==='undefined';var _0xba7b44=_0x124abd[_0x5b54('0x1d')];var _0x333aaf=_0x54f56e?0x0:_0x42b2ee[_0x5b54('0x1b')];var _0x138360=_0x54f56e?_0x124abd[_0x5b54('0x1d')]:_0x42b2ee[_0x5b54('0x1b')]+_0x42b2ee[_0x5b54('0x1c')];var _0x15e554;if(_0x138360>=_0xba7b44){_0x138360=_0xba7b44;_0x15e554=0xc8;}else{_0x15e554=0xce;}_0x459e2f['status'](_0x15e554);return _0x459e2f[_0x5b54('0x1e')]('Content-Range',_0x333aaf+'-'+_0x138360+'/'+_0xba7b44)['json'](_0x124abd);}return null;};}function patchUpdates(_0x3f933d){return function(_0x4ee99b){try{jsonpatch['apply'](_0x4ee99b,_0x3f933d,!![]);}catch(_0x2689e5){return BPromise[_0x5b54('0x1f')](_0x2689e5);}return _0x4ee99b['save']();};}function saveUpdates(_0x3667fe,_0x5031f7){return function(_0x5c69fc){if(_0x5c69fc){return _0x5c69fc[_0x5b54('0x20')](_0x3667fe)[_0x5b54('0x21')](function(_0x3f529f){return _0x3f529f;});}return null;};}function removeEntity(_0x24d690,_0xb32fae){return function(_0xe954f5){if(_0xe954f5){return _0xe954f5[_0x5b54('0x22')]()[_0x5b54('0x21')](function(){_0x24d690[_0x5b54('0x19')](0xcc)[_0x5b54('0x18')]();});}};}function handleEntityNotFound(_0x55cf53,_0x5b8d07){return function(_0x65deaf){if(!_0x65deaf){_0x55cf53['sendStatus'](0x194);}return _0x65deaf;};}function handleError(_0x7de20,_0x498bc9){_0x498bc9=_0x498bc9||0x1f4;return function(_0x53d55e){logger[_0x5b54('0x23')](_0x53d55e['stack']);if(_0x53d55e[_0x5b54('0x24')]){delete _0x53d55e['name'];}_0x7de20['status'](_0x498bc9)['send'](_0x53d55e);};}exports[_0x5b54('0x25')]=function(_0x161cd0,_0x2fbc17){var _0x47cf2f={},_0x1ed936={},_0x138372={'count':0x0,'rows':[]};var _0x5b8e1a=_[_0x5b54('0x26')](db['VtigerConfiguration'][_0x5b54('0x27')],function(_0xc29324){return{'name':_0xc29324[_0x5b54('0x28')],'type':_0xc29324[_0x5b54('0x29')][_0x5b54('0x2a')]};});_0x1ed936[_0x5b54('0x2b')]=_[_0x5b54('0x26')](_0x5b8e1a,'name');_0x1ed936[_0x5b54('0x2c')]=_['keys'](_0x161cd0[_0x5b54('0x2c')]);_0x1ed936[_0x5b54('0x2d')]=_[_0x5b54('0x2e')](_0x1ed936[_0x5b54('0x2b')],_0x1ed936[_0x5b54('0x2c')]);_0x47cf2f[_0x5b54('0x2f')]=_[_0x5b54('0x2e')](_0x1ed936[_0x5b54('0x2b')],qs[_0x5b54('0x30')](_0x161cd0['query']['fields']));_0x47cf2f[_0x5b54('0x2f')]=_0x47cf2f[_0x5b54('0x2f')][_0x5b54('0x31')]?_0x47cf2f['attributes']:_0x1ed936[_0x5b54('0x2b')];if(!_0x161cd0[_0x5b54('0x2c')][_0x5b54('0x32')]('nolimit')){_0x47cf2f['limit']=qs[_0x5b54('0x1c')](_0x161cd0[_0x5b54('0x2c')]['limit']);_0x47cf2f[_0x5b54('0x1b')]=qs[_0x5b54('0x1b')](_0x161cd0[_0x5b54('0x2c')][_0x5b54('0x1b')]);}_0x47cf2f[_0x5b54('0x33')]=qs[_0x5b54('0x34')](_0x161cd0[_0x5b54('0x2c')][_0x5b54('0x34')]);_0x47cf2f['where']=qs['filters'](_[_0x5b54('0x35')](_0x161cd0[_0x5b54('0x2c')],_0x1ed936[_0x5b54('0x2d')]),_0x5b8e1a);if(_0x161cd0['query'][_0x5b54('0x36')]){_0x47cf2f[_0x5b54('0x37')]=_['merge'](_0x47cf2f[_0x5b54('0x37')],{'$or':_[_0x5b54('0x26')](_0x5b8e1a,function(_0x3a4cb4){if(_0x3a4cb4[_0x5b54('0x29')]!==_0x5b54('0x38')){var _0x21d25f={};_0x21d25f[_0x3a4cb4['name']]={'$like':'%'+_0x161cd0[_0x5b54('0x2c')][_0x5b54('0x36')]+'%'};return _0x21d25f;}})});}_0x47cf2f=_['merge']({},_0x47cf2f,_0x161cd0[_0x5b54('0x39')]);var _0x5d536f={'where':_0x47cf2f[_0x5b54('0x37')]};return db[_0x5b54('0x3a')][_0x5b54('0x1d')](_0x5d536f)['then'](function(_0x5a9717){_0x138372[_0x5b54('0x1d')]=_0x5a9717;if(_0x161cd0[_0x5b54('0x2c')]['includeAll']){_0x47cf2f[_0x5b54('0x3b')]=[{'all':!![]}];}return db[_0x5b54('0x3a')]['findAll'](_0x47cf2f);})[_0x5b54('0x21')](function(_0x42924d){_0x138372[_0x5b54('0x3c')]=_0x42924d;return _0x138372;})['then'](respondWithFilteredResult(_0x2fbc17,_0x47cf2f))[_0x5b54('0x3d')](handleError(_0x2fbc17,null));};exports[_0x5b54('0x3e')]=function(_0x4d48d9,_0x2d71e8){var _0xab236c={'raw':![],'where':{'id':_0x4d48d9['params']['id']}},_0x17c27f={};_0x17c27f[_0x5b54('0x2b')]=_[_0x5b54('0x3f')](db[_0x5b54('0x3a')][_0x5b54('0x27')]);_0x17c27f[_0x5b54('0x2c')]=_['keys'](_0x4d48d9[_0x5b54('0x2c')]);_0x17c27f[_0x5b54('0x2d')]=_[_0x5b54('0x2e')](_0x17c27f[_0x5b54('0x2b')],_0x17c27f['query']);_0xab236c[_0x5b54('0x2f')]=_[_0x5b54('0x2e')](_0x17c27f[_0x5b54('0x2b')],qs[_0x5b54('0x30')](_0x4d48d9[_0x5b54('0x2c')]['fields']));_0xab236c['attributes']=_0xab236c[_0x5b54('0x2f')]['length']?_0xab236c[_0x5b54('0x2f')]:_0x17c27f[_0x5b54('0x2b')];if(_0x4d48d9[_0x5b54('0x2c')]['includeAll']){_0xab236c[_0x5b54('0x3b')]=[{'all':!![]}];}_0xab236c=_[_0x5b54('0x40')]({},_0xab236c,_0x4d48d9['options']);return db['VtigerConfiguration'][_0x5b54('0x41')](_0xab236c)[_0x5b54('0x21')](handleEntityNotFound(_0x2d71e8,null))[_0x5b54('0x21')](respondWithResult(_0x2d71e8,null))[_0x5b54('0x3d')](handleError(_0x2d71e8,null));};exports[_0x5b54('0x42')]=function(_0x150b76,_0x135cba){return db[_0x5b54('0x3a')][_0x5b54('0x42')](_0x150b76[_0x5b54('0x43')],{})['then'](respondWithResult(_0x135cba,0xc9))['catch'](handleError(_0x135cba,null));};exports[_0x5b54('0x20')]=function(_0x213a10,_0xd366f){if(_0x213a10[_0x5b54('0x43')]['id']){delete _0x213a10[_0x5b54('0x43')]['id'];}return db[_0x5b54('0x3a')][_0x5b54('0x41')]({'where':{'id':_0x213a10[_0x5b54('0x44')]['id']}})['then'](handleEntityNotFound(_0xd366f,null))[_0x5b54('0x21')](saveUpdates(_0x213a10[_0x5b54('0x43')],null))[_0x5b54('0x21')](respondWithResult(_0xd366f,null))[_0x5b54('0x3d')](handleError(_0xd366f,null));};exports['destroy']=function(_0x18e448,_0x389136){return db[_0x5b54('0x3a')][_0x5b54('0x41')]({'where':{'id':_0x18e448[_0x5b54('0x44')]['id']}})[_0x5b54('0x21')](handleEntityNotFound(_0x389136,null))[_0x5b54('0x21')](removeEntity(_0x389136,null))[_0x5b54('0x3d')](handleError(_0x389136,null));};exports[_0x5b54('0x45')]=function(_0x3ad829,_0x58211f,_0x15d22a){var _0x1d2403={};var _0x562167={};var _0x1c5597;var _0x3741c2;return db[_0x5b54('0x3a')][_0x5b54('0x46')]({'where':{'id':_0x3ad829[_0x5b54('0x44')]['id']}})[_0x5b54('0x21')](handleEntityNotFound(_0x58211f,null))['then'](function(_0x3e892c){if(_0x3e892c){_0x1c5597=_0x3e892c;_0x562167[_0x5b54('0x2b')]=_[_0x5b54('0x3f')](db[_0x5b54('0x47')]['rawAttributes']);_0x562167[_0x5b54('0x2c')]=_[_0x5b54('0x3f')](_0x3ad829[_0x5b54('0x2c')]);_0x562167[_0x5b54('0x2d')]=_['intersection'](_0x562167[_0x5b54('0x2b')],_0x562167[_0x5b54('0x2c')]);_0x1d2403[_0x5b54('0x2f')]=_[_0x5b54('0x2e')](_0x562167[_0x5b54('0x2b')],qs[_0x5b54('0x30')](_0x3ad829[_0x5b54('0x2c')][_0x5b54('0x30')]));_0x1d2403[_0x5b54('0x2f')]=_0x1d2403[_0x5b54('0x2f')][_0x5b54('0x31')]?_0x1d2403['attributes']:_0x562167[_0x5b54('0x2b')];_0x1d2403['order']=qs[_0x5b54('0x34')](_0x3ad829[_0x5b54('0x2c')]['sort']);_0x1d2403[_0x5b54('0x37')]=qs['filters'](_[_0x5b54('0x35')](_0x3ad829[_0x5b54('0x2c')],_0x562167[_0x5b54('0x2d')]));if(_0x3ad829['query'][_0x5b54('0x36')]){_0x1d2403[_0x5b54('0x37')]=_[_0x5b54('0x40')](_0x1d2403[_0x5b54('0x37')],{'$or':_['map'](_0x1d2403['attributes'],function(_0xa8a79e){var _0x12c9bf={};_0x12c9bf[_0xa8a79e]={'$like':'%'+_0x3ad829[_0x5b54('0x2c')][_0x5b54('0x36')]+'%'};return _0x12c9bf;})});}_0x1d2403=_[_0x5b54('0x40')]({},_0x1d2403,_0x3ad829['options']);return _0x1c5597['getFields'](_0x1d2403);}})[_0x5b54('0x21')](function(_0x304da3){if(_0x304da3){_0x3741c2=_0x304da3['length'];if(!_0x3ad829[_0x5b54('0x2c')][_0x5b54('0x32')](_0x5b54('0x48'))){_0x1d2403['limit']=qs[_0x5b54('0x1c')](_0x3ad829[_0x5b54('0x2c')][_0x5b54('0x1c')]);_0x1d2403['offset']=qs[_0x5b54('0x1b')](_0x3ad829[_0x5b54('0x2c')][_0x5b54('0x1b')]);}return _0x1c5597[_0x5b54('0x45')](_0x1d2403);}})[_0x5b54('0x21')](function(_0x413a2b){if(_0x413a2b){return _0x413a2b?{'count':_0x3741c2,'rows':_0x413a2b}:null;}})[_0x5b54('0x21')](respondWithResult(_0x58211f,null))[_0x5b54('0x3d')](handleError(_0x58211f,null));};exports[_0x5b54('0x49')]=function(_0x5eb104,_0x2d234c,_0x29ea3c){var _0x3a1d9f={};var _0x37fa98={};var _0xc5e520;var _0x47eaf0;return db[_0x5b54('0x3a')][_0x5b54('0x46')]({'where':{'id':_0x5eb104[_0x5b54('0x44')]['id']}})[_0x5b54('0x21')](handleEntityNotFound(_0x2d234c,null))[_0x5b54('0x21')](function(_0x5e0ebc){if(_0x5e0ebc){_0xc5e520=_0x5e0ebc;_0x37fa98[_0x5b54('0x2b')]=_[_0x5b54('0x3f')](db[_0x5b54('0x47')][_0x5b54('0x27')]);_0x37fa98[_0x5b54('0x2c')]=_[_0x5b54('0x3f')](_0x5eb104[_0x5b54('0x2c')]);_0x37fa98['filters']=_['intersection'](_0x37fa98[_0x5b54('0x2b')],_0x37fa98[_0x5b54('0x2c')]);_0x3a1d9f[_0x5b54('0x2f')]=_[_0x5b54('0x2e')](_0x37fa98[_0x5b54('0x2b')],qs[_0x5b54('0x30')](_0x5eb104['query']['fields']));_0x3a1d9f[_0x5b54('0x2f')]=_0x3a1d9f[_0x5b54('0x2f')]['length']?_0x3a1d9f[_0x5b54('0x2f')]:_0x37fa98[_0x5b54('0x2b')];_0x3a1d9f[_0x5b54('0x33')]=qs['sort'](_0x5eb104['query']['sort']);_0x3a1d9f[_0x5b54('0x37')]=qs[_0x5b54('0x2d')](_['pick'](_0x5eb104[_0x5b54('0x2c')],_0x37fa98[_0x5b54('0x2d')]));if(_0x5eb104[_0x5b54('0x2c')][_0x5b54('0x36')]){_0x3a1d9f[_0x5b54('0x37')]=_[_0x5b54('0x40')](_0x3a1d9f[_0x5b54('0x37')],{'$or':_[_0x5b54('0x26')](_0x3a1d9f['attributes'],function(_0x305b85){var _0x2a2b48={};_0x2a2b48[_0x305b85]={'$like':'%'+_0x5eb104[_0x5b54('0x2c')][_0x5b54('0x36')]+'%'};return _0x2a2b48;})});}_0x3a1d9f=_[_0x5b54('0x40')]({},_0x3a1d9f,_0x5eb104['options']);return _0xc5e520[_0x5b54('0x49')](_0x3a1d9f);}})['then'](function(_0x1432e4){if(_0x1432e4){_0x47eaf0=_0x1432e4[_0x5b54('0x31')];if(!_0x5eb104[_0x5b54('0x2c')]['hasOwnProperty'](_0x5b54('0x48'))){_0x3a1d9f[_0x5b54('0x1c')]=qs[_0x5b54('0x1c')](_0x5eb104[_0x5b54('0x2c')][_0x5b54('0x1c')]);_0x3a1d9f[_0x5b54('0x1b')]=qs[_0x5b54('0x1b')](_0x5eb104[_0x5b54('0x2c')]['offset']);}return _0xc5e520['getSubjects'](_0x3a1d9f);}})['then'](function(_0x2be505){if(_0x2be505){return _0x2be505?{'count':_0x47eaf0,'rows':_0x2be505}:null;}})[_0x5b54('0x21')](respondWithResult(_0x2d234c,null))[_0x5b54('0x3d')](handleError(_0x2d234c,null));};exports[_0x5b54('0x4a')]=function(_0x1da347,_0x5ba2fc,_0x35d52f){var _0x72a76d={};var _0x488d2c={};var _0x58a05e;var _0xbb163d;return db['VtigerConfiguration'][_0x5b54('0x46')]({'where':{'id':_0x1da347[_0x5b54('0x44')]['id']}})['then'](handleEntityNotFound(_0x5ba2fc,null))[_0x5b54('0x21')](function(_0x26f607){if(_0x26f607){_0x58a05e=_0x26f607;_0x488d2c[_0x5b54('0x2b')]=_[_0x5b54('0x3f')](db[_0x5b54('0x47')][_0x5b54('0x27')]);_0x488d2c[_0x5b54('0x2c')]=_['keys'](_0x1da347[_0x5b54('0x2c')]);_0x488d2c['filters']=_['intersection'](_0x488d2c['model'],_0x488d2c[_0x5b54('0x2c')]);_0x72a76d[_0x5b54('0x2f')]=_[_0x5b54('0x2e')](_0x488d2c[_0x5b54('0x2b')],qs[_0x5b54('0x30')](_0x1da347['query'][_0x5b54('0x30')]));_0x72a76d['attributes']=_0x72a76d['attributes'][_0x5b54('0x31')]?_0x72a76d[_0x5b54('0x2f')]:_0x488d2c['model'];_0x72a76d['order']=qs[_0x5b54('0x34')](_0x1da347['query']['sort']);_0x72a76d[_0x5b54('0x37')]=qs['filters'](_[_0x5b54('0x35')](_0x1da347[_0x5b54('0x2c')],_0x488d2c[_0x5b54('0x2d')]));if(_0x1da347['query'][_0x5b54('0x36')]){_0x72a76d[_0x5b54('0x37')]=_[_0x5b54('0x40')](_0x72a76d[_0x5b54('0x37')],{'$or':_[_0x5b54('0x26')](_0x72a76d['attributes'],function(_0x525713){var _0x18613e={};_0x18613e[_0x525713]={'$like':'%'+_0x1da347['query'][_0x5b54('0x36')]+'%'};return _0x18613e;})});}_0x72a76d=_[_0x5b54('0x40')]({},_0x72a76d,_0x1da347[_0x5b54('0x39')]);return _0x58a05e['getDescriptions'](_0x72a76d);}})[_0x5b54('0x21')](function(_0xdd4b68){if(_0xdd4b68){_0xbb163d=_0xdd4b68[_0x5b54('0x31')];if(!_0x1da347[_0x5b54('0x2c')][_0x5b54('0x32')]('nolimit')){_0x72a76d['limit']=qs[_0x5b54('0x1c')](_0x1da347['query'][_0x5b54('0x1c')]);_0x72a76d[_0x5b54('0x1b')]=qs[_0x5b54('0x1b')](_0x1da347[_0x5b54('0x2c')]['offset']);}return _0x58a05e[_0x5b54('0x4a')](_0x72a76d);}})['then'](function(_0x560a5c){if(_0x560a5c){return _0x560a5c?{'count':_0xbb163d,'rows':_0x560a5c}:null;}})[_0x5b54('0x21')](respondWithResult(_0x5ba2fc,null))[_0x5b54('0x3d')](handleError(_0x5ba2fc,null));}; \ No newline at end of file +var _0xa15b=['order','sort','pick','where','merge','filter','VtigerConfiguration','includeAll','include','catch','show','params','keys','find','create','body','getFields','findOne','VtigerField','length','nolimit','getSubjects','options','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x453bd0,_0x334575){var _0x422c87=function(_0x24e8e7){while(--_0x24e8e7){_0x453bd0['push'](_0x453bd0['shift']());}};_0x422c87(++_0x334575);}(_0xa15b,0x1e6));var _0xba15=function(_0x389fd7,_0x35a786){_0x389fd7=_0x389fd7-0x0;var _0x3d1f7e=_0xa15b[_0x389fd7];return _0x3d1f7e;};'use strict';var emlformat=require(_0xba15('0x0'));var rimraf=require(_0xba15('0x1'));var zipdir=require(_0xba15('0x2'));var jsonpatch=require(_0xba15('0x3'));var rp=require(_0xba15('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xba15('0x5'));var util=require(_0xba15('0x6'));var path=require(_0xba15('0x7'));var sox=require(_0xba15('0x8'));var csv=require(_0xba15('0x9'));var ejs=require(_0xba15('0xa'));var fs=require('fs');var fs_extra=require(_0xba15('0xb'));var _=require(_0xba15('0xc'));var squel=require(_0xba15('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xba15('0xe'));var toCsv=require(_0xba15('0x9'));var querystring=require(_0xba15('0xf'));var Papa=require(_0xba15('0x10'));var Redis=require(_0xba15('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xba15('0x12'));var logger=require(_0xba15('0x13'))(_0xba15('0x14'));var utils=require('../../config/utils');var config=require(_0xba15('0x15'));var licenseUtil=require(_0xba15('0x16'));var db=require(_0xba15('0x17'))['db'];function respondWithStatusCode(_0x112e51,_0x2bd012){_0x2bd012=_0x2bd012||0xcc;return function(_0x53d830){if(_0x53d830){return _0x112e51['sendStatus'](_0x2bd012);}return _0x112e51[_0xba15('0x18')](_0x2bd012)['end']();};}function respondWithResult(_0x2ab799,_0x31a23a){_0x31a23a=_0x31a23a||0xc8;return function(_0x4f5f61){if(_0x4f5f61){return _0x2ab799[_0xba15('0x18')](_0x31a23a)[_0xba15('0x19')](_0x4f5f61);}};}function respondWithFilteredResult(_0x224c5b,_0x231051){return function(_0x152a79){if(_0x152a79){var _0x556e1f=typeof _0x231051['offset']===_0xba15('0x1a')&&typeof _0x231051[_0xba15('0x1b')]===_0xba15('0x1a');var _0x640ade=_0x152a79[_0xba15('0x1c')];var _0x3bf15e=_0x556e1f?0x0:_0x231051[_0xba15('0x1d')];var _0x244347=_0x556e1f?_0x152a79[_0xba15('0x1c')]:_0x231051[_0xba15('0x1d')]+_0x231051[_0xba15('0x1b')];var _0x2e14b4;if(_0x244347>=_0x640ade){_0x244347=_0x640ade;_0x2e14b4=0xc8;}else{_0x2e14b4=0xce;}_0x224c5b['status'](_0x2e14b4);return _0x224c5b['set'](_0xba15('0x1e'),_0x3bf15e+'-'+_0x244347+'/'+_0x640ade)[_0xba15('0x19')](_0x152a79);}return null;};}function patchUpdates(_0x11f604){return function(_0x306965){try{jsonpatch[_0xba15('0x1f')](_0x306965,_0x11f604,!![]);}catch(_0x346b9a){return BPromise[_0xba15('0x20')](_0x346b9a);}return _0x306965[_0xba15('0x21')]();};}function saveUpdates(_0x6576e6,_0x557d63){return function(_0x22d06f){if(_0x22d06f){return _0x22d06f[_0xba15('0x22')](_0x6576e6)['then'](function(_0x26b713){return _0x26b713;});}return null;};}function removeEntity(_0xfe42f8,_0x19e86d){return function(_0x5f2d36){if(_0x5f2d36){return _0x5f2d36[_0xba15('0x23')]()[_0xba15('0x24')](function(){_0xfe42f8[_0xba15('0x18')](0xcc)[_0xba15('0x25')]();});}};}function handleEntityNotFound(_0x530383,_0x1ea440){return function(_0x55e038){if(!_0x55e038){_0x530383[_0xba15('0x26')](0x194);}return _0x55e038;};}function handleError(_0x17f653,_0x3aa75c){_0x3aa75c=_0x3aa75c||0x1f4;return function(_0x2adb25){logger['error'](_0x2adb25['stack']);if(_0x2adb25[_0xba15('0x27')]){delete _0x2adb25['name'];}_0x17f653[_0xba15('0x18')](_0x3aa75c)[_0xba15('0x28')](_0x2adb25);};}exports[_0xba15('0x29')]=function(_0xbda9e5,_0x3d3de4){var _0x3965e9={},_0x46ce0e={},_0x53fa05={'count':0x0,'rows':[]};var _0x12344b=_['map'](db['VtigerConfiguration'][_0xba15('0x2a')],function(_0x4b624a){return{'name':_0x4b624a['fieldName'],'type':_0x4b624a[_0xba15('0x2b')][_0xba15('0x2c')]};});_0x46ce0e[_0xba15('0x2d')]=_[_0xba15('0x2e')](_0x12344b,'name');_0x46ce0e['query']=_['keys'](_0xbda9e5[_0xba15('0x2f')]);_0x46ce0e[_0xba15('0x30')]=_[_0xba15('0x31')](_0x46ce0e['model'],_0x46ce0e[_0xba15('0x2f')]);_0x3965e9['attributes']=_['intersection'](_0x46ce0e[_0xba15('0x2d')],qs[_0xba15('0x32')](_0xbda9e5['query'][_0xba15('0x32')]));_0x3965e9[_0xba15('0x33')]=_0x3965e9[_0xba15('0x33')]['length']?_0x3965e9['attributes']:_0x46ce0e[_0xba15('0x2d')];if(!_0xbda9e5['query'][_0xba15('0x34')]('nolimit')){_0x3965e9['limit']=qs[_0xba15('0x1b')](_0xbda9e5['query'][_0xba15('0x1b')]);_0x3965e9[_0xba15('0x1d')]=qs[_0xba15('0x1d')](_0xbda9e5[_0xba15('0x2f')][_0xba15('0x1d')]);}_0x3965e9[_0xba15('0x35')]=qs[_0xba15('0x36')](_0xbda9e5[_0xba15('0x2f')][_0xba15('0x36')]);_0x3965e9['where']=qs[_0xba15('0x30')](_[_0xba15('0x37')](_0xbda9e5['query'],_0x46ce0e[_0xba15('0x30')]),_0x12344b);if(_0xbda9e5[_0xba15('0x2f')]['filter']){_0x3965e9[_0xba15('0x38')]=_[_0xba15('0x39')](_0x3965e9[_0xba15('0x38')],{'$or':_[_0xba15('0x2e')](_0x12344b,function(_0x29d560){if(_0x29d560[_0xba15('0x2b')]!=='VIRTUAL'){var _0x3ae369={};_0x3ae369[_0x29d560[_0xba15('0x27')]]={'$like':'%'+_0xbda9e5[_0xba15('0x2f')][_0xba15('0x3a')]+'%'};return _0x3ae369;}})});}_0x3965e9=_[_0xba15('0x39')]({},_0x3965e9,_0xbda9e5['options']);var _0x424451={'where':_0x3965e9[_0xba15('0x38')]};return db[_0xba15('0x3b')][_0xba15('0x1c')](_0x424451)[_0xba15('0x24')](function(_0x3ac4e2){_0x53fa05[_0xba15('0x1c')]=_0x3ac4e2;if(_0xbda9e5[_0xba15('0x2f')][_0xba15('0x3c')]){_0x3965e9[_0xba15('0x3d')]=[{'all':!![]}];}return db[_0xba15('0x3b')]['findAll'](_0x3965e9);})[_0xba15('0x24')](function(_0x9a9180){_0x53fa05['rows']=_0x9a9180;return _0x53fa05;})['then'](respondWithFilteredResult(_0x3d3de4,_0x3965e9))[_0xba15('0x3e')](handleError(_0x3d3de4,null));};exports[_0xba15('0x3f')]=function(_0x8b8482,_0x90261e){var _0x400314={'raw':![],'where':{'id':_0x8b8482[_0xba15('0x40')]['id']}},_0x4c36db={};_0x4c36db[_0xba15('0x2d')]=_[_0xba15('0x41')](db['VtigerConfiguration']['rawAttributes']);_0x4c36db[_0xba15('0x2f')]=_[_0xba15('0x41')](_0x8b8482[_0xba15('0x2f')]);_0x4c36db[_0xba15('0x30')]=_[_0xba15('0x31')](_0x4c36db[_0xba15('0x2d')],_0x4c36db[_0xba15('0x2f')]);_0x400314[_0xba15('0x33')]=_[_0xba15('0x31')](_0x4c36db['model'],qs[_0xba15('0x32')](_0x8b8482[_0xba15('0x2f')][_0xba15('0x32')]));_0x400314[_0xba15('0x33')]=_0x400314['attributes']['length']?_0x400314[_0xba15('0x33')]:_0x4c36db[_0xba15('0x2d')];if(_0x8b8482[_0xba15('0x2f')][_0xba15('0x3c')]){_0x400314[_0xba15('0x3d')]=[{'all':!![]}];}_0x400314=_[_0xba15('0x39')]({},_0x400314,_0x8b8482['options']);return db[_0xba15('0x3b')][_0xba15('0x42')](_0x400314)[_0xba15('0x24')](handleEntityNotFound(_0x90261e,null))[_0xba15('0x24')](respondWithResult(_0x90261e,null))[_0xba15('0x3e')](handleError(_0x90261e,null));};exports[_0xba15('0x43')]=function(_0x423b8e,_0x5ba399){return db[_0xba15('0x3b')][_0xba15('0x43')](_0x423b8e[_0xba15('0x44')],{})[_0xba15('0x24')](respondWithResult(_0x5ba399,0xc9))[_0xba15('0x3e')](handleError(_0x5ba399,null));};exports[_0xba15('0x22')]=function(_0x4e02a0,_0x335c26){if(_0x4e02a0['body']['id']){delete _0x4e02a0[_0xba15('0x44')]['id'];}return db[_0xba15('0x3b')][_0xba15('0x42')]({'where':{'id':_0x4e02a0[_0xba15('0x40')]['id']}})['then'](handleEntityNotFound(_0x335c26,null))[_0xba15('0x24')](saveUpdates(_0x4e02a0['body'],null))[_0xba15('0x24')](respondWithResult(_0x335c26,null))['catch'](handleError(_0x335c26,null));};exports['destroy']=function(_0x1e3920,_0x3354d2){return db[_0xba15('0x3b')][_0xba15('0x42')]({'where':{'id':_0x1e3920[_0xba15('0x40')]['id']}})[_0xba15('0x24')](handleEntityNotFound(_0x3354d2,null))[_0xba15('0x24')](removeEntity(_0x3354d2,null))[_0xba15('0x3e')](handleError(_0x3354d2,null));};exports[_0xba15('0x45')]=function(_0x271388,_0x117a7d,_0x34185a){var _0x25a37c={};var _0x28144b={};var _0x33b9a8;var _0x59397f;return db['VtigerConfiguration'][_0xba15('0x46')]({'where':{'id':_0x271388[_0xba15('0x40')]['id']}})[_0xba15('0x24')](handleEntityNotFound(_0x117a7d,null))[_0xba15('0x24')](function(_0x2e2b80){if(_0x2e2b80){_0x33b9a8=_0x2e2b80;_0x28144b[_0xba15('0x2d')]=_['keys'](db[_0xba15('0x47')][_0xba15('0x2a')]);_0x28144b[_0xba15('0x2f')]=_[_0xba15('0x41')](_0x271388['query']);_0x28144b[_0xba15('0x30')]=_[_0xba15('0x31')](_0x28144b[_0xba15('0x2d')],_0x28144b[_0xba15('0x2f')]);_0x25a37c['attributes']=_[_0xba15('0x31')](_0x28144b['model'],qs[_0xba15('0x32')](_0x271388[_0xba15('0x2f')][_0xba15('0x32')]));_0x25a37c[_0xba15('0x33')]=_0x25a37c['attributes'][_0xba15('0x48')]?_0x25a37c['attributes']:_0x28144b[_0xba15('0x2d')];_0x25a37c[_0xba15('0x35')]=qs[_0xba15('0x36')](_0x271388[_0xba15('0x2f')][_0xba15('0x36')]);_0x25a37c[_0xba15('0x38')]=qs[_0xba15('0x30')](_[_0xba15('0x37')](_0x271388['query'],_0x28144b[_0xba15('0x30')]));if(_0x271388[_0xba15('0x2f')][_0xba15('0x3a')]){_0x25a37c[_0xba15('0x38')]=_[_0xba15('0x39')](_0x25a37c['where'],{'$or':_[_0xba15('0x2e')](_0x25a37c[_0xba15('0x33')],function(_0x58592b){var _0x37c033={};_0x37c033[_0x58592b]={'$like':'%'+_0x271388[_0xba15('0x2f')]['filter']+'%'};return _0x37c033;})});}_0x25a37c=_[_0xba15('0x39')]({},_0x25a37c,_0x271388['options']);return _0x33b9a8[_0xba15('0x45')](_0x25a37c);}})[_0xba15('0x24')](function(_0x168924){if(_0x168924){_0x59397f=_0x168924[_0xba15('0x48')];if(!_0x271388[_0xba15('0x2f')][_0xba15('0x34')](_0xba15('0x49'))){_0x25a37c['limit']=qs[_0xba15('0x1b')](_0x271388[_0xba15('0x2f')][_0xba15('0x1b')]);_0x25a37c[_0xba15('0x1d')]=qs[_0xba15('0x1d')](_0x271388[_0xba15('0x2f')][_0xba15('0x1d')]);}return _0x33b9a8[_0xba15('0x45')](_0x25a37c);}})[_0xba15('0x24')](function(_0x33a2dd){if(_0x33a2dd){return _0x33a2dd?{'count':_0x59397f,'rows':_0x33a2dd}:null;}})['then'](respondWithResult(_0x117a7d,null))['catch'](handleError(_0x117a7d,null));};exports[_0xba15('0x4a')]=function(_0xe782dc,_0x1af3e8,_0x1e7865){var _0x42b9be={};var _0x20d947={};var _0x3480d2;var _0x30aa38;return db[_0xba15('0x3b')][_0xba15('0x46')]({'where':{'id':_0xe782dc[_0xba15('0x40')]['id']}})[_0xba15('0x24')](handleEntityNotFound(_0x1af3e8,null))[_0xba15('0x24')](function(_0x3b2dd2){if(_0x3b2dd2){_0x3480d2=_0x3b2dd2;_0x20d947[_0xba15('0x2d')]=_['keys'](db[_0xba15('0x47')][_0xba15('0x2a')]);_0x20d947['query']=_['keys'](_0xe782dc['query']);_0x20d947[_0xba15('0x30')]=_[_0xba15('0x31')](_0x20d947[_0xba15('0x2d')],_0x20d947[_0xba15('0x2f')]);_0x42b9be[_0xba15('0x33')]=_[_0xba15('0x31')](_0x20d947['model'],qs[_0xba15('0x32')](_0xe782dc[_0xba15('0x2f')][_0xba15('0x32')]));_0x42b9be[_0xba15('0x33')]=_0x42b9be[_0xba15('0x33')][_0xba15('0x48')]?_0x42b9be[_0xba15('0x33')]:_0x20d947[_0xba15('0x2d')];_0x42b9be['order']=qs[_0xba15('0x36')](_0xe782dc[_0xba15('0x2f')][_0xba15('0x36')]);_0x42b9be[_0xba15('0x38')]=qs[_0xba15('0x30')](_[_0xba15('0x37')](_0xe782dc[_0xba15('0x2f')],_0x20d947['filters']));if(_0xe782dc[_0xba15('0x2f')][_0xba15('0x3a')]){_0x42b9be[_0xba15('0x38')]=_[_0xba15('0x39')](_0x42b9be['where'],{'$or':_[_0xba15('0x2e')](_0x42b9be[_0xba15('0x33')],function(_0x5db8ae){var _0x29a986={};_0x29a986[_0x5db8ae]={'$like':'%'+_0xe782dc[_0xba15('0x2f')]['filter']+'%'};return _0x29a986;})});}_0x42b9be=_[_0xba15('0x39')]({},_0x42b9be,_0xe782dc[_0xba15('0x4b')]);return _0x3480d2['getSubjects'](_0x42b9be);}})[_0xba15('0x24')](function(_0x5a420a){if(_0x5a420a){_0x30aa38=_0x5a420a[_0xba15('0x48')];if(!_0xe782dc['query'][_0xba15('0x34')](_0xba15('0x49'))){_0x42b9be[_0xba15('0x1b')]=qs[_0xba15('0x1b')](_0xe782dc['query'][_0xba15('0x1b')]);_0x42b9be['offset']=qs[_0xba15('0x1d')](_0xe782dc[_0xba15('0x2f')][_0xba15('0x1d')]);}return _0x3480d2[_0xba15('0x4a')](_0x42b9be);}})[_0xba15('0x24')](function(_0x5510cc){if(_0x5510cc){return _0x5510cc?{'count':_0x30aa38,'rows':_0x5510cc}:null;}})['then'](respondWithResult(_0x1af3e8,null))[_0xba15('0x3e')](handleError(_0x1af3e8,null));};exports[_0xba15('0x4c')]=function(_0x3f789f,_0x1e8adc,_0x3e2fa2){var _0x3ed171={};var _0xcc42fb={};var _0x1e90f2;var _0x27f00c;return db[_0xba15('0x3b')]['findOne']({'where':{'id':_0x3f789f[_0xba15('0x40')]['id']}})[_0xba15('0x24')](handleEntityNotFound(_0x1e8adc,null))[_0xba15('0x24')](function(_0x5da4fd){if(_0x5da4fd){_0x1e90f2=_0x5da4fd;_0xcc42fb[_0xba15('0x2d')]=_['keys'](db[_0xba15('0x47')]['rawAttributes']);_0xcc42fb[_0xba15('0x2f')]=_['keys'](_0x3f789f[_0xba15('0x2f')]);_0xcc42fb[_0xba15('0x30')]=_[_0xba15('0x31')](_0xcc42fb['model'],_0xcc42fb[_0xba15('0x2f')]);_0x3ed171[_0xba15('0x33')]=_['intersection'](_0xcc42fb[_0xba15('0x2d')],qs['fields'](_0x3f789f[_0xba15('0x2f')][_0xba15('0x32')]));_0x3ed171['attributes']=_0x3ed171[_0xba15('0x33')][_0xba15('0x48')]?_0x3ed171[_0xba15('0x33')]:_0xcc42fb['model'];_0x3ed171[_0xba15('0x35')]=qs[_0xba15('0x36')](_0x3f789f['query'][_0xba15('0x36')]);_0x3ed171['where']=qs[_0xba15('0x30')](_[_0xba15('0x37')](_0x3f789f['query'],_0xcc42fb[_0xba15('0x30')]));if(_0x3f789f[_0xba15('0x2f')][_0xba15('0x3a')]){_0x3ed171[_0xba15('0x38')]=_[_0xba15('0x39')](_0x3ed171[_0xba15('0x38')],{'$or':_[_0xba15('0x2e')](_0x3ed171[_0xba15('0x33')],function(_0x2c4cb0){var _0x32dddc={};_0x32dddc[_0x2c4cb0]={'$like':'%'+_0x3f789f[_0xba15('0x2f')][_0xba15('0x3a')]+'%'};return _0x32dddc;})});}_0x3ed171=_[_0xba15('0x39')]({},_0x3ed171,_0x3f789f[_0xba15('0x4b')]);return _0x1e90f2['getDescriptions'](_0x3ed171);}})['then'](function(_0x38539e){if(_0x38539e){_0x27f00c=_0x38539e[_0xba15('0x48')];if(!_0x3f789f['query'][_0xba15('0x34')](_0xba15('0x49'))){_0x3ed171['limit']=qs[_0xba15('0x1b')](_0x3f789f[_0xba15('0x2f')][_0xba15('0x1b')]);_0x3ed171[_0xba15('0x1d')]=qs[_0xba15('0x1d')](_0x3f789f[_0xba15('0x2f')][_0xba15('0x1d')]);}return _0x1e90f2[_0xba15('0x4c')](_0x3ed171);}})[_0xba15('0x24')](function(_0x3b1b3f){if(_0x3b1b3f){return _0x3b1b3f?{'count':_0x27f00c,'rows':_0x3b1b3f}:null;}})[_0xba15('0x24')](respondWithResult(_0x1e8adc,null))[_0xba15('0x3e')](handleError(_0x1e8adc,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 1ab449a..9d7d309 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 _0xa2c6=['define','VtigerConfiguration','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3815c2,_0x1f54e3){var _0x271f88=function(_0x53963c){while(--_0x53963c){_0x3815c2['push'](_0x3815c2['shift']());}};_0x271f88(++_0x1f54e3);}(_0xa2c6,0x15e));var _0x6a2c=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0xa2c6[_0x23b655];return _0x364b32;};'use strict';var _=require(_0x6a2c('0x0'));var util=require(_0x6a2c('0x1'));var logger=require('../../config/logger')(_0x6a2c('0x2'));var moment=require(_0x6a2c('0x3'));var BPromise=require(_0x6a2c('0x4'));var rp=require(_0x6a2c('0x5'));var fs=require('fs');var path=require(_0x6a2c('0x6'));var rimraf=require(_0x6a2c('0x7'));var config=require(_0x6a2c('0x8'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x6a2c('0x9')]=function(_0x2b881c,_0x1b1dd4){return _0x2b881c[_0x6a2c('0xa')](_0x6a2c('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdcdb=['../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','request-promise','path','rimraf'];(function(_0x22abf4,_0x356ddd){var _0x324670=function(_0x5e70fa){while(--_0x5e70fa){_0x22abf4['push'](_0x22abf4['shift']());}};_0x324670(++_0x356ddd);}(_0xdcdb,0x1c8));var _0xbdcd=function(_0x227507,_0x437fbe){_0x227507=_0x227507-0x0;var _0x22db63=_0xdcdb[_0x227507];return _0x22db63;};'use strict';var _=require(_0xbdcd('0x0'));var util=require(_0xbdcd('0x1'));var logger=require(_0xbdcd('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbdcd('0x3'));var fs=require('fs');var path=require(_0xbdcd('0x4'));var rimraf=require(_0xbdcd('0x5'));var config=require(_0xbdcd('0x6'));var attributes=require(_0xbdcd('0x7'));module['exports']=function(_0x3b2d07,_0x58d624){return _0x3b2d07[_0xbdcd('0x8')](_0xbdcd('0x9'),attributes,{'tableName':_0xbdcd('0xa'),'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 f3a97ff..37a6526 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 _0xf314=['http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3f6bcf,_0x531e79){var _0x1c5350=function(_0x282fc5){while(--_0x282fc5){_0x3f6bcf['push'](_0x3f6bcf['shift']());}};_0x1c5350(++_0x531e79);}(_0xf314,0xa9));var _0x4f31=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xf314[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0x4f31('0x0'));var util=require(_0x4f31('0x1'));var moment=require(_0x4f31('0x2'));var BPromise=require(_0x4f31('0x3'));var rs=require(_0x4f31('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f31('0x5'))['db'];var utils=require(_0x4f31('0x6'));var logger=require(_0x4f31('0x7'))('rpc');var config=require(_0x4f31('0x8'));var jayson=require(_0x4f31('0x9'));var client=jayson[_0x4f31('0xa')][_0x4f31('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2445e9,_0x5d5f6a,_0x1d4b95){return new BPromise(function(_0x24fea9,_0xbfe0ca){return client[_0x4f31('0xc')](_0x2445e9,_0x1d4b95)['then'](function(_0x2d0411){logger[_0x4f31('0xd')](_0x4f31('0xe'),_0x5d5f6a,_0x4f31('0xf'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x5d5f6a,_0x4f31('0xf'),JSON[_0x4f31('0x10')](_0x2d0411));if(_0x2d0411[_0x4f31('0x11')]){if(_0x2d0411[_0x4f31('0x11')]['code']===0x1f4){logger['error'](_0x4f31('0xe'),_0x5d5f6a,_0x2d0411[_0x4f31('0x11')][_0x4f31('0x12')]);return _0xbfe0ca(_0x2d0411['error']['message']);}logger[_0x4f31('0x11')](_0x4f31('0xe'),_0x5d5f6a,_0x2d0411['error'][_0x4f31('0x12')]);return _0x24fea9(_0x2d0411[_0x4f31('0x11')][_0x4f31('0x12')]);}else{logger[_0x4f31('0xd')](_0x4f31('0xe'),_0x5d5f6a,_0x4f31('0xf'));_0x24fea9(_0x2d0411['result'][_0x4f31('0x12')]);}})[_0x4f31('0x13')](function(_0x350d32){logger[_0x4f31('0x11')](_0x4f31('0xe'),_0x5d5f6a,_0x350d32);_0xbfe0ca(_0x350d32);});});} \ No newline at end of file +var _0x132a=['stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','result','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','debug'];(function(_0x1a0d52,_0x236750){var _0x50094e=function(_0xaed630){while(--_0xaed630){_0x1a0d52['push'](_0x1a0d52['shift']());}};_0x50094e(++_0x236750);}(_0x132a,0xda));var _0xa132=function(_0x2e9c78,_0x16f7db){_0x2e9c78=_0x2e9c78-0x0;var _0x3b04b9=_0x132a[_0x2e9c78];return _0x3b04b9;};'use strict';var _=require('lodash');var util=require(_0xa132('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa132('0x1'));var fs=require('fs');var Redis=require(_0xa132('0x2'));var db=require(_0xa132('0x3'))['db'];var utils=require(_0xa132('0x4'));var logger=require(_0xa132('0x5'))(_0xa132('0x6'));var config=require('../../config/environment');var jayson=require(_0xa132('0x7'));var client=jayson[_0xa132('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41c653,_0x3aea79,_0x53c404){return new BPromise(function(_0x590517,_0x5d7523){return client[_0xa132('0x9')](_0x41c653,_0x53c404)[_0xa132('0xa')](function(_0x57b938){logger[_0xa132('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x3aea79,'request\x20sent');logger[_0xa132('0xc')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x3aea79,'request\x20sent',JSON[_0xa132('0xd')](_0x57b938));if(_0x57b938[_0xa132('0xe')]){if(_0x57b938['error'][_0xa132('0xf')]===0x1f4){logger[_0xa132('0xe')](_0xa132('0x10'),_0x3aea79,_0x57b938['error']['message']);return _0x5d7523(_0x57b938['error']['message']);}logger[_0xa132('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x3aea79,_0x57b938[_0xa132('0xe')]['message']);return _0x590517(_0x57b938[_0xa132('0xe')]['message']);}else{logger[_0xa132('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x3aea79,_0xa132('0x11'));_0x590517(_0x57b938[_0xa132('0x12')][_0xa132('0x13')]);}})[_0xa132('0x14')](function(_0x8d8d6d){logger['error'](_0xa132('0x10'),_0x3aea79,_0x8d8d6d);_0x5d7523(_0x8d8d6d);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 6c23f8d..ce43603 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 _0x7058=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports'];(function(_0x30a4d0,_0x42190f){var _0x24e6f3=function(_0x71d633){while(--_0x71d633){_0x30a4d0['push'](_0x30a4d0['shift']());}};_0x24e6f3(++_0x42190f);}(_0x7058,0x156));var _0x8705=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x7058[_0x59d89e];return _0x554e93;};'use strict';var multer=require('multer');var util=require(_0x8705('0x0'));var path=require(_0x8705('0x1'));var timeout=require(_0x8705('0x2'));var express=require(_0x8705('0x3'));var router=express[_0x8705('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8705('0x5'));var config=require(_0x8705('0x6'));var controller=require(_0x8705('0x7'));router[_0x8705('0x8')]('/',auth[_0x8705('0x9')](),controller[_0x8705('0xa')]);router['get'](_0x8705('0xb'),auth[_0x8705('0x9')](),controller['show']);router[_0x8705('0xc')]('/',auth[_0x8705('0x9')](),controller['create']);router[_0x8705('0xd')](_0x8705('0xb'),auth[_0x8705('0x9')](),controller[_0x8705('0xe')]);router[_0x8705('0xf')](_0x8705('0xb'),auth[_0x8705('0x9')](),controller[_0x8705('0x10')]);module[_0x8705('0x11')]=router; \ No newline at end of file +var _0x5e13=['../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put','update','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x153239,_0x3023da){var _0x4eb1a8=function(_0x462472){while(--_0x462472){_0x153239['push'](_0x153239['shift']());}};_0x4eb1a8(++_0x3023da);}(_0x5e13,0x1cc));var _0x35e1=function(_0x5a8e42,_0x1bdf90){_0x5a8e42=_0x5a8e42-0x0;var _0x3939ef=_0x5e13[_0x5a8e42];return _0x3939ef;};'use strict';var multer=require(_0x35e1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x35e1('0x1'));var express=require(_0x35e1('0x2'));var router=express['Router']();var fs_extra=require(_0x35e1('0x3'));var auth=require(_0x35e1('0x4'));var interaction=require(_0x35e1('0x5'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router[_0x35e1('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35e1('0x6')](_0x35e1('0x7'),auth[_0x35e1('0x8')](),controller[_0x35e1('0x9')]);router[_0x35e1('0xa')]('/',auth['isAuthenticated'](),controller[_0x35e1('0xb')]);router[_0x35e1('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x35e1('0xd')]);router['delete'](_0x35e1('0x7'),auth[_0x35e1('0x8')](),controller['destroy']);module[_0x35e1('0xe')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 2eceedf..2cecbc7 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 _0xa551=['keyValue','picklist','string','STRING','customVariable','BOOLEAN','exports','ENUM','variable'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xa551,0x14a));var _0x1a55=function(_0x386435,_0x265915){_0x386435=_0x386435-0x0;var _0x3df179=_0xa551[_0x386435];return _0x3df179;};'use strict';var Sequelize=require('sequelize');module[_0x1a55('0x0')]={'type':{'type':Sequelize[_0x1a55('0x1')]('string',_0x1a55('0x2'),'customVariable',_0x1a55('0x3'),_0x1a55('0x4')),'defaultValue':_0x1a55('0x5')},'content':{'type':Sequelize[_0x1a55('0x6')]},'key':{'type':Sequelize[_0x1a55('0x6')]},'keyType':{'type':Sequelize[_0x1a55('0x1')](_0x1a55('0x5'),_0x1a55('0x2'),_0x1a55('0x7'))},'keyContent':{'type':Sequelize[_0x1a55('0x6')]},'idField':{'type':Sequelize[_0x1a55('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1a55('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1a55('0x6')]}}; \ No newline at end of file +var _0x6799=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x45313d,_0x1abeb5){var _0x26706f=function(_0x381755){while(--_0x381755){_0x45313d['push'](_0x45313d['shift']());}};_0x26706f(++_0x1abeb5);}(_0x6799,0x102));var _0x9679=function(_0x357736,_0x10a37b){_0x357736=_0x357736-0x0;var _0x3ec752=_0x6799[_0x357736];return _0x3ec752;};'use strict';var Sequelize=require(_0x9679('0x0'));module[_0x9679('0x1')]={'type':{'type':Sequelize[_0x9679('0x2')](_0x9679('0x3'),_0x9679('0x4'),_0x9679('0x5'),_0x9679('0x6'),'picklist'),'defaultValue':_0x9679('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9679('0x2')](_0x9679('0x3'),_0x9679('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x9679('0x7')]},'idField':{'type':Sequelize[_0x9679('0x7')]},'nameField':{'type':Sequelize[_0x9679('0x7')]},'customField':{'type':Sequelize[_0x9679('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9679('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 3ccb3d2..efb5e98 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 _0xb38d=['options','includeAll','VtigerField','findAll','rows','show','params','include','find','catch','create','body','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0x14c8c2,_0x553b1b){var _0x48b38c=function(_0x1f3393){while(--_0x1f3393){_0x14c8c2['push'](_0x14c8c2['shift']());}};_0x48b38c(++_0x553b1b);}(_0xb38d,0xff));var _0xdb38=function(_0x2c93e2,_0x4fb5e2){_0x2c93e2=_0x2c93e2-0x0;var _0x57264e=_0xb38d[_0x2c93e2];return _0x57264e;};'use strict';var emlformat=require(_0xdb38('0x0'));var rimraf=require(_0xdb38('0x1'));var zipdir=require(_0xdb38('0x2'));var jsonpatch=require(_0xdb38('0x3'));var rp=require(_0xdb38('0x4'));var moment=require(_0xdb38('0x5'));var BPromise=require(_0xdb38('0x6'));var Mustache=require(_0xdb38('0x7'));var util=require(_0xdb38('0x8'));var path=require(_0xdb38('0x9'));var sox=require(_0xdb38('0xa'));var csv=require(_0xdb38('0xb'));var ejs=require(_0xdb38('0xc'));var fs=require('fs');var fs_extra=require(_0xdb38('0xd'));var _=require('lodash');var squel=require(_0xdb38('0xe'));var crypto=require(_0xdb38('0xf'));var jsforce=require(_0xdb38('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdb38('0x11'));var Papa=require('papaparse');var Redis=require(_0xdb38('0x12'));var authService=require(_0xdb38('0x13'));var qs=require(_0xdb38('0x14'));var as=require(_0xdb38('0x15'));var hardwareService=require(_0xdb38('0x16'));var logger=require(_0xdb38('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xdb38('0x18'));var licenseUtil=require(_0xdb38('0x19'));var db=require(_0xdb38('0x1a'))['db'];function respondWithStatusCode(_0xb896f5,_0x277ffe){_0x277ffe=_0x277ffe||0xcc;return function(_0x3d1504){if(_0x3d1504){return _0xb896f5['sendStatus'](_0x277ffe);}return _0xb896f5[_0xdb38('0x1b')](_0x277ffe)['end']();};}function respondWithResult(_0x4990de,_0x1a9dc6){_0x1a9dc6=_0x1a9dc6||0xc8;return function(_0x488a99){if(_0x488a99){return _0x4990de[_0xdb38('0x1b')](_0x1a9dc6)[_0xdb38('0x1c')](_0x488a99);}};}function respondWithFilteredResult(_0x3f57d1,_0x34524a){return function(_0x1e8338){if(_0x1e8338){var _0x11d1f7=typeof _0x34524a[_0xdb38('0x1d')]===_0xdb38('0x1e')&&typeof _0x34524a[_0xdb38('0x1f')]==='undefined';var _0x254f30=_0x1e8338[_0xdb38('0x20')];var _0x828c3b=_0x11d1f7?0x0:_0x34524a[_0xdb38('0x1d')];var _0x26c1c7=_0x11d1f7?_0x1e8338['count']:_0x34524a[_0xdb38('0x1d')]+_0x34524a[_0xdb38('0x1f')];var _0x4e7e06;if(_0x26c1c7>=_0x254f30){_0x26c1c7=_0x254f30;_0x4e7e06=0xc8;}else{_0x4e7e06=0xce;}_0x3f57d1[_0xdb38('0x1b')](_0x4e7e06);return _0x3f57d1[_0xdb38('0x21')](_0xdb38('0x22'),_0x828c3b+'-'+_0x26c1c7+'/'+_0x254f30)[_0xdb38('0x1c')](_0x1e8338);}return null;};}function patchUpdates(_0x24c00b){return function(_0x3ec580){try{jsonpatch[_0xdb38('0x23')](_0x3ec580,_0x24c00b,!![]);}catch(_0x42effa){return BPromise[_0xdb38('0x24')](_0x42effa);}return _0x3ec580[_0xdb38('0x25')]();};}function saveUpdates(_0x3ed470,_0x38af8d){return function(_0x3c1b91){if(_0x3c1b91){return _0x3c1b91[_0xdb38('0x26')](_0x3ed470)['then'](function(_0x26a91c){return _0x26a91c;});}return null;};}function removeEntity(_0x27fc24,_0x29c115){return function(_0x321079){if(_0x321079){return _0x321079[_0xdb38('0x27')]()[_0xdb38('0x28')](function(){_0x27fc24[_0xdb38('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fe7d4,_0x3ed2e7){return function(_0xb173dd){if(!_0xb173dd){_0x2fe7d4[_0xdb38('0x29')](0x194);}return _0xb173dd;};}function handleError(_0x1e9a2d,_0x382d5d){_0x382d5d=_0x382d5d||0x1f4;return function(_0x5e8928){logger[_0xdb38('0x2a')](_0x5e8928[_0xdb38('0x2b')]);if(_0x5e8928[_0xdb38('0x2c')]){delete _0x5e8928[_0xdb38('0x2c')];}_0x1e9a2d[_0xdb38('0x1b')](_0x382d5d)[_0xdb38('0x2d')](_0x5e8928);};}exports[_0xdb38('0x2e')]=function(_0x485e0b,_0x2505bc){var _0x16f59d={},_0x3f3b2f={},_0x2f4679={'count':0x0,'rows':[]};var _0x5a1d86=_['map'](db['VtigerField'][_0xdb38('0x2f')],function(_0x2f12d1){return{'name':_0x2f12d1[_0xdb38('0x30')],'type':_0x2f12d1['type'][_0xdb38('0x31')]};});_0x3f3b2f[_0xdb38('0x32')]=_[_0xdb38('0x33')](_0x5a1d86,_0xdb38('0x2c'));_0x3f3b2f['query']=_[_0xdb38('0x34')](_0x485e0b[_0xdb38('0x35')]);_0x3f3b2f[_0xdb38('0x36')]=_['intersection'](_0x3f3b2f[_0xdb38('0x32')],_0x3f3b2f['query']);_0x16f59d[_0xdb38('0x37')]=_[_0xdb38('0x38')](_0x3f3b2f[_0xdb38('0x32')],qs[_0xdb38('0x39')](_0x485e0b[_0xdb38('0x35')][_0xdb38('0x39')]));_0x16f59d['attributes']=_0x16f59d[_0xdb38('0x37')][_0xdb38('0x3a')]?_0x16f59d['attributes']:_0x3f3b2f[_0xdb38('0x32')];if(!_0x485e0b[_0xdb38('0x35')][_0xdb38('0x3b')](_0xdb38('0x3c'))){_0x16f59d[_0xdb38('0x1f')]=qs[_0xdb38('0x1f')](_0x485e0b[_0xdb38('0x35')]['limit']);_0x16f59d[_0xdb38('0x1d')]=qs['offset'](_0x485e0b['query'][_0xdb38('0x1d')]);}_0x16f59d[_0xdb38('0x3d')]=qs[_0xdb38('0x3e')](_0x485e0b[_0xdb38('0x35')][_0xdb38('0x3e')]);_0x16f59d[_0xdb38('0x3f')]=qs[_0xdb38('0x36')](_[_0xdb38('0x40')](_0x485e0b[_0xdb38('0x35')],_0x3f3b2f['filters']),_0x5a1d86);if(_0x485e0b[_0xdb38('0x35')][_0xdb38('0x41')]){_0x16f59d[_0xdb38('0x3f')]=_[_0xdb38('0x42')](_0x16f59d[_0xdb38('0x3f')],{'$or':_[_0xdb38('0x33')](_0x5a1d86,function(_0x3e4260){if(_0x3e4260[_0xdb38('0x43')]!==_0xdb38('0x44')){var _0x144800={};_0x144800[_0x3e4260[_0xdb38('0x2c')]]={'$like':'%'+_0x485e0b[_0xdb38('0x35')][_0xdb38('0x41')]+'%'};return _0x144800;}})});}_0x16f59d=_['merge']({},_0x16f59d,_0x485e0b[_0xdb38('0x45')]);var _0xc4c752={'where':_0x16f59d[_0xdb38('0x3f')]};return db['VtigerField'][_0xdb38('0x20')](_0xc4c752)[_0xdb38('0x28')](function(_0x4aa0bf){_0x2f4679[_0xdb38('0x20')]=_0x4aa0bf;if(_0x485e0b[_0xdb38('0x35')][_0xdb38('0x46')]){_0x16f59d['include']=[{'all':!![]}];}return db[_0xdb38('0x47')][_0xdb38('0x48')](_0x16f59d);})[_0xdb38('0x28')](function(_0x301060){_0x2f4679[_0xdb38('0x49')]=_0x301060;return _0x2f4679;})['then'](respondWithFilteredResult(_0x2505bc,_0x16f59d))['catch'](handleError(_0x2505bc,null));};exports[_0xdb38('0x4a')]=function(_0x26dcfa,_0x1603f3){var _0x18ae71={'raw':!![],'where':{'id':_0x26dcfa[_0xdb38('0x4b')]['id']}},_0x503717={};_0x503717[_0xdb38('0x32')]=_[_0xdb38('0x34')](db[_0xdb38('0x47')][_0xdb38('0x2f')]);_0x503717[_0xdb38('0x35')]=_['keys'](_0x26dcfa[_0xdb38('0x35')]);_0x503717[_0xdb38('0x36')]=_[_0xdb38('0x38')](_0x503717[_0xdb38('0x32')],_0x503717['query']);_0x18ae71[_0xdb38('0x37')]=_[_0xdb38('0x38')](_0x503717['model'],qs[_0xdb38('0x39')](_0x26dcfa[_0xdb38('0x35')][_0xdb38('0x39')]));_0x18ae71['attributes']=_0x18ae71['attributes']['length']?_0x18ae71[_0xdb38('0x37')]:_0x503717[_0xdb38('0x32')];if(_0x26dcfa['query']['includeAll']){_0x18ae71[_0xdb38('0x4c')]=[{'all':!![]}];}_0x18ae71=_[_0xdb38('0x42')]({},_0x18ae71,_0x26dcfa[_0xdb38('0x45')]);return db[_0xdb38('0x47')][_0xdb38('0x4d')](_0x18ae71)[_0xdb38('0x28')](handleEntityNotFound(_0x1603f3,null))['then'](respondWithResult(_0x1603f3,null))[_0xdb38('0x4e')](handleError(_0x1603f3,null));};exports[_0xdb38('0x4f')]=function(_0x3bf9ee,_0x5660a3){return db['VtigerField']['create'](_0x3bf9ee[_0xdb38('0x50')],{})[_0xdb38('0x28')](respondWithResult(_0x5660a3,0xc9))[_0xdb38('0x4e')](handleError(_0x5660a3,null));};exports[_0xdb38('0x26')]=function(_0x72f0d8,_0x3f97f8){if(_0x72f0d8[_0xdb38('0x50')]['id']){delete _0x72f0d8['body']['id'];}return db[_0xdb38('0x47')][_0xdb38('0x4d')]({'where':{'id':_0x72f0d8[_0xdb38('0x4b')]['id']}})[_0xdb38('0x28')](handleEntityNotFound(_0x3f97f8,null))[_0xdb38('0x28')](saveUpdates(_0x72f0d8[_0xdb38('0x50')],null))[_0xdb38('0x28')](respondWithResult(_0x3f97f8,null))[_0xdb38('0x4e')](handleError(_0x3f97f8,null));};exports[_0xdb38('0x27')]=function(_0x32740c,_0x1e5b65){return db['VtigerField'][_0xdb38('0x4d')]({'where':{'id':_0x32740c[_0xdb38('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1e5b65,null))[_0xdb38('0x28')](removeEntity(_0x1e5b65,null))[_0xdb38('0x4e')](handleError(_0x1e5b65,null));}; \ No newline at end of file +var _0x0ed3=['request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','update','destroy','then','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','include','findAll','rows','show','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir'];(function(_0x842858,_0x3a3ca0){var _0x46c2a2=function(_0x47f795){while(--_0x47f795){_0x842858['push'](_0x842858['shift']());}};_0x46c2a2(++_0x3a3ca0);}(_0x0ed3,0x91));var _0x30ed=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0ed3[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x30ed('0x0'));var rimraf=require(_0x30ed('0x1'));var zipdir=require(_0x30ed('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x30ed('0x3'));var moment=require(_0x30ed('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x30ed('0x5'));var util=require('util');var path=require(_0x30ed('0x6'));var sox=require(_0x30ed('0x7'));var csv=require(_0x30ed('0x8'));var ejs=require(_0x30ed('0x9'));var fs=require('fs');var fs_extra=require(_0x30ed('0xa'));var _=require(_0x30ed('0xb'));var squel=require(_0x30ed('0xc'));var crypto=require(_0x30ed('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x30ed('0x8'));var querystring=require(_0x30ed('0xe'));var Papa=require(_0x30ed('0xf'));var Redis=require(_0x30ed('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x30ed('0x11'));var as=require(_0x30ed('0x12'));var hardwareService=require(_0x30ed('0x13'));var logger=require('../../config/logger')(_0x30ed('0x14'));var utils=require(_0x30ed('0x15'));var config=require(_0x30ed('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x30ed('0x17'))['db'];function respondWithStatusCode(_0x2f0de4,_0x19d6df){_0x19d6df=_0x19d6df||0xcc;return function(_0x5e7df0){if(_0x5e7df0){return _0x2f0de4[_0x30ed('0x18')](_0x19d6df);}return _0x2f0de4['status'](_0x19d6df)[_0x30ed('0x19')]();};}function respondWithResult(_0x1fdcfd,_0x1d5d9f){_0x1d5d9f=_0x1d5d9f||0xc8;return function(_0x8b442a){if(_0x8b442a){return _0x1fdcfd[_0x30ed('0x1a')](_0x1d5d9f)['json'](_0x8b442a);}};}function respondWithFilteredResult(_0x5bbae2,_0x1a0de7){return function(_0xc68930){if(_0xc68930){var _0x389e98=typeof _0x1a0de7['offset']===_0x30ed('0x1b')&&typeof _0x1a0de7[_0x30ed('0x1c')]===_0x30ed('0x1b');var _0x15d67d=_0xc68930[_0x30ed('0x1d')];var _0x9a2246=_0x389e98?0x0:_0x1a0de7['offset'];var _0x46ab93=_0x389e98?_0xc68930['count']:_0x1a0de7[_0x30ed('0x1e')]+_0x1a0de7['limit'];var _0x24f4eb;if(_0x46ab93>=_0x15d67d){_0x46ab93=_0x15d67d;_0x24f4eb=0xc8;}else{_0x24f4eb=0xce;}_0x5bbae2[_0x30ed('0x1a')](_0x24f4eb);return _0x5bbae2[_0x30ed('0x1f')](_0x30ed('0x20'),_0x9a2246+'-'+_0x46ab93+'/'+_0x15d67d)[_0x30ed('0x21')](_0xc68930);}return null;};}function patchUpdates(_0x5bae86){return function(_0x3e62dc){try{jsonpatch[_0x30ed('0x22')](_0x3e62dc,_0x5bae86,!![]);}catch(_0x4959cf){return BPromise['reject'](_0x4959cf);}return _0x3e62dc['save']();};}function saveUpdates(_0x430c2a,_0x3bb9ff){return function(_0x499720){if(_0x499720){return _0x499720[_0x30ed('0x23')](_0x430c2a)['then'](function(_0x2f40e9){return _0x2f40e9;});}return null;};}function removeEntity(_0x4f9f92,_0x25cc5b){return function(_0x456684){if(_0x456684){return _0x456684[_0x30ed('0x24')]()[_0x30ed('0x25')](function(){_0x4f9f92['status'](0xcc)[_0x30ed('0x19')]();});}};}function handleEntityNotFound(_0x578ca0,_0x3c9138){return function(_0x5602df){if(!_0x5602df){_0x578ca0['sendStatus'](0x194);}return _0x5602df;};}function handleError(_0x288ccc,_0x412cc1){_0x412cc1=_0x412cc1||0x1f4;return function(_0x4b57ad){logger[_0x30ed('0x26')](_0x4b57ad[_0x30ed('0x27')]);if(_0x4b57ad[_0x30ed('0x28')]){delete _0x4b57ad[_0x30ed('0x28')];}_0x288ccc[_0x30ed('0x1a')](_0x412cc1)[_0x30ed('0x29')](_0x4b57ad);};}exports[_0x30ed('0x2a')]=function(_0x250aac,_0x51f867){var _0xdc81bd={},_0x238dc4={},_0x5463f6={'count':0x0,'rows':[]};var _0x46dd94=_[_0x30ed('0x2b')](db[_0x30ed('0x2c')][_0x30ed('0x2d')],function(_0x5c5b94){return{'name':_0x5c5b94[_0x30ed('0x2e')],'type':_0x5c5b94['type'][_0x30ed('0x2f')]};});_0x238dc4[_0x30ed('0x30')]=_['map'](_0x46dd94,'name');_0x238dc4[_0x30ed('0x31')]=_[_0x30ed('0x32')](_0x250aac[_0x30ed('0x31')]);_0x238dc4['filters']=_[_0x30ed('0x33')](_0x238dc4[_0x30ed('0x30')],_0x238dc4['query']);_0xdc81bd[_0x30ed('0x34')]=_[_0x30ed('0x33')](_0x238dc4[_0x30ed('0x30')],qs[_0x30ed('0x35')](_0x250aac[_0x30ed('0x31')][_0x30ed('0x35')]));_0xdc81bd[_0x30ed('0x34')]=_0xdc81bd[_0x30ed('0x34')]['length']?_0xdc81bd['attributes']:_0x238dc4[_0x30ed('0x30')];if(!_0x250aac[_0x30ed('0x31')][_0x30ed('0x36')](_0x30ed('0x37'))){_0xdc81bd[_0x30ed('0x1c')]=qs[_0x30ed('0x1c')](_0x250aac[_0x30ed('0x31')][_0x30ed('0x1c')]);_0xdc81bd[_0x30ed('0x1e')]=qs[_0x30ed('0x1e')](_0x250aac[_0x30ed('0x31')][_0x30ed('0x1e')]);}_0xdc81bd[_0x30ed('0x38')]=qs[_0x30ed('0x39')](_0x250aac[_0x30ed('0x31')]['sort']);_0xdc81bd[_0x30ed('0x3a')]=qs[_0x30ed('0x3b')](_[_0x30ed('0x3c')](_0x250aac[_0x30ed('0x31')],_0x238dc4['filters']),_0x46dd94);if(_0x250aac[_0x30ed('0x31')][_0x30ed('0x3d')]){_0xdc81bd['where']=_[_0x30ed('0x3e')](_0xdc81bd[_0x30ed('0x3a')],{'$or':_[_0x30ed('0x2b')](_0x46dd94,function(_0x7d3f71){if(_0x7d3f71[_0x30ed('0x3f')]!=='VIRTUAL'){var _0x5acbad={};_0x5acbad[_0x7d3f71[_0x30ed('0x28')]]={'$like':'%'+_0x250aac['query'][_0x30ed('0x3d')]+'%'};return _0x5acbad;}})});}_0xdc81bd=_[_0x30ed('0x3e')]({},_0xdc81bd,_0x250aac[_0x30ed('0x40')]);var _0x36a8ed={'where':_0xdc81bd[_0x30ed('0x3a')]};return db[_0x30ed('0x2c')]['count'](_0x36a8ed)[_0x30ed('0x25')](function(_0x35d294){_0x5463f6[_0x30ed('0x1d')]=_0x35d294;if(_0x250aac[_0x30ed('0x31')]['includeAll']){_0xdc81bd[_0x30ed('0x41')]=[{'all':!![]}];}return db[_0x30ed('0x2c')][_0x30ed('0x42')](_0xdc81bd);})['then'](function(_0x76df6d){_0x5463f6[_0x30ed('0x43')]=_0x76df6d;return _0x5463f6;})[_0x30ed('0x25')](respondWithFilteredResult(_0x51f867,_0xdc81bd))['catch'](handleError(_0x51f867,null));};exports[_0x30ed('0x44')]=function(_0x7604d6,_0x215f3a){var _0x2012fe={'raw':!![],'where':{'id':_0x7604d6['params']['id']}},_0x429374={};_0x429374['model']=_[_0x30ed('0x32')](db[_0x30ed('0x2c')][_0x30ed('0x2d')]);_0x429374[_0x30ed('0x31')]=_['keys'](_0x7604d6[_0x30ed('0x31')]);_0x429374[_0x30ed('0x3b')]=_[_0x30ed('0x33')](_0x429374[_0x30ed('0x30')],_0x429374[_0x30ed('0x31')]);_0x2012fe[_0x30ed('0x34')]=_[_0x30ed('0x33')](_0x429374[_0x30ed('0x30')],qs[_0x30ed('0x35')](_0x7604d6[_0x30ed('0x31')][_0x30ed('0x35')]));_0x2012fe[_0x30ed('0x34')]=_0x2012fe[_0x30ed('0x34')]['length']?_0x2012fe[_0x30ed('0x34')]:_0x429374['model'];if(_0x7604d6[_0x30ed('0x31')][_0x30ed('0x45')]){_0x2012fe[_0x30ed('0x41')]=[{'all':!![]}];}_0x2012fe=_['merge']({},_0x2012fe,_0x7604d6['options']);return db[_0x30ed('0x2c')][_0x30ed('0x46')](_0x2012fe)[_0x30ed('0x25')](handleEntityNotFound(_0x215f3a,null))['then'](respondWithResult(_0x215f3a,null))[_0x30ed('0x47')](handleError(_0x215f3a,null));};exports[_0x30ed('0x48')]=function(_0x1ac9c3,_0x66a9b5){return db[_0x30ed('0x2c')]['create'](_0x1ac9c3['body'],{})[_0x30ed('0x25')](respondWithResult(_0x66a9b5,0xc9))['catch'](handleError(_0x66a9b5,null));};exports[_0x30ed('0x23')]=function(_0x2732bd,_0x5ebf4d){if(_0x2732bd[_0x30ed('0x49')]['id']){delete _0x2732bd[_0x30ed('0x49')]['id'];}return db[_0x30ed('0x2c')]['find']({'where':{'id':_0x2732bd['params']['id']}})['then'](handleEntityNotFound(_0x5ebf4d,null))[_0x30ed('0x25')](saveUpdates(_0x2732bd[_0x30ed('0x49')],null))[_0x30ed('0x25')](respondWithResult(_0x5ebf4d,null))[_0x30ed('0x47')](handleError(_0x5ebf4d,null));};exports[_0x30ed('0x24')]=function(_0x2e16f7,_0x420ebb){return db[_0x30ed('0x2c')][_0x30ed('0x46')]({'where':{'id':_0x2e16f7['params']['id']}})[_0x30ed('0x25')](handleEntityNotFound(_0x420ebb,null))['then'](removeEntity(_0x420ebb,null))[_0x30ed('0x47')](handleError(_0x420ebb,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 5549c78..cfef8e8 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 _0x4fc4=['./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x206205,_0xa9cf06){var _0x537ddf=function(_0x44966f){while(--_0x44966f){_0x206205['push'](_0x206205['shift']());}};_0x537ddf(++_0xa9cf06);}(_0x4fc4,0xbb));var _0x44fc=function(_0x4a64cc,_0x5ebf53){_0x4a64cc=_0x4a64cc-0x0;var _0x3a24b8=_0x4fc4[_0x4a64cc];return _0x3a24b8;};'use strict';var _=require(_0x44fc('0x0'));var util=require('util');var logger=require(_0x44fc('0x1'))(_0x44fc('0x2'));var moment=require(_0x44fc('0x3'));var BPromise=require(_0x44fc('0x4'));var rp=require(_0x44fc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44fc('0x6'));var config=require(_0x44fc('0x7'));var attributes=require(_0x44fc('0x8'));module[_0x44fc('0x9')]=function(_0x1b232f,_0x3e7077){return _0x1b232f[_0x44fc('0xa')](_0x44fc('0xb'),attributes,{'tableName':_0x44fc('0xc'),'paranoid':![],'indexes':[{'name':_0x44fc('0xd'),'fields':[_0x44fc('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4d44=['rimraf','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x4d44,0x1e7));var _0x44d4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x4d44[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x44d4('0x0'));var util=require(_0x44d4('0x1'));var logger=require(_0x44d4('0x2'))(_0x44d4('0x3'));var moment=require(_0x44d4('0x4'));var BPromise=require(_0x44d4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x44d4('0x6'));var rimraf=require(_0x44d4('0x7'));var config=require(_0x44d4('0x8'));var attributes=require(_0x44d4('0x9'));module['exports']=function(_0x57cc8e,_0x4aff68){return _0x57cc8e[_0x44d4('0xa')](_0x44d4('0xb'),attributes,{'tableName':_0x44d4('0xc'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField','FieldId'],'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 e74329c..fd802ac 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 _0x065b=['VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','debug'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x065b,0x150));var _0xb065=function(_0x56085e,_0x5c69e9){_0x56085e=_0x56085e-0x0;var _0x4de130=_0x065b[_0x56085e];return _0x4de130;};'use strict';var _=require(_0xb065('0x0'));var util=require('util');var moment=require(_0xb065('0x1'));var BPromise=require('bluebird');var rs=require(_0xb065('0x2'));var fs=require('fs');var Redis=require(_0xb065('0x3'));var db=require(_0xb065('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb065('0x5'))(_0xb065('0x6'));var config=require(_0xb065('0x7'));var jayson=require(_0xb065('0x8'));var client=jayson[_0xb065('0x9')][_0xb065('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e88e2,_0x4f7070,_0x2de927){return new BPromise(function(_0x57736c,_0xbcfcc2){return client[_0xb065('0xb')](_0x3e88e2,_0x2de927)[_0xb065('0xc')](function(_0x49de3b){logger[_0xb065('0xd')](_0xb065('0xe'),_0x4f7070,'request\x20sent');logger[_0xb065('0xf')](_0xb065('0x10'),_0x4f7070,_0xb065('0x11'),JSON[_0xb065('0x12')](_0x49de3b));if(_0x49de3b[_0xb065('0x13')]){if(_0x49de3b[_0xb065('0x13')]['code']===0x1f4){logger[_0xb065('0x13')]('VtigerField,\x20%s,\x20%s',_0x4f7070,_0x49de3b[_0xb065('0x13')][_0xb065('0x14')]);return _0xbcfcc2(_0x49de3b['error'][_0xb065('0x14')]);}logger[_0xb065('0x13')](_0xb065('0xe'),_0x4f7070,_0x49de3b[_0xb065('0x13')][_0xb065('0x14')]);return _0x57736c(_0x49de3b[_0xb065('0x13')][_0xb065('0x14')]);}else{logger[_0xb065('0xd')](_0xb065('0xe'),_0x4f7070,_0xb065('0x11'));_0x57736c(_0x49de3b['result'][_0xb065('0x14')]);}})[_0xb065('0x15')](function(_0x34cdcd){logger['error'](_0xb065('0xe'),_0x4f7070,_0x34cdcd);_0xbcfcc2(_0x34cdcd);});});} \ No newline at end of file +var _0x09c9=['VtigerField,\x20%s,\x20%s','request\x20sent','stringify','error','code','result','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0x2ac4b6,_0x4ae162){var _0xd09d13=function(_0x2e6fbf){while(--_0x2e6fbf){_0x2ac4b6['push'](_0x2ac4b6['shift']());}};_0xd09d13(++_0x4ae162);}(_0x09c9,0xda));var _0x909c=function(_0x365543,_0x570115){_0x365543=_0x365543-0x0;var _0x9b933c=_0x09c9[_0x365543];return _0x9b933c;};'use strict';var _=require(_0x909c('0x0'));var util=require(_0x909c('0x1'));var moment=require('moment');var BPromise=require(_0x909c('0x2'));var rs=require(_0x909c('0x3'));var fs=require('fs');var Redis=require(_0x909c('0x4'));var db=require(_0x909c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x909c('0x6'))(_0x909c('0x7'));var config=require('../../config/environment');var jayson=require(_0x909c('0x8'));var client=jayson['client'][_0x909c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x211576,_0x1e4f10,_0x950b21){return new BPromise(function(_0x5b1f03,_0x2ed604){return client[_0x909c('0xa')](_0x211576,_0x950b21)[_0x909c('0xb')](function(_0x22f119){logger[_0x909c('0xc')](_0x909c('0xd'),_0x1e4f10,_0x909c('0xe'));logger['debug']('VtigerField,\x20%s,\x20%s,\x20%s',_0x1e4f10,'request\x20sent',JSON[_0x909c('0xf')](_0x22f119));if(_0x22f119[_0x909c('0x10')]){if(_0x22f119['error'][_0x909c('0x11')]===0x1f4){logger[_0x909c('0x10')](_0x909c('0xd'),_0x1e4f10,_0x22f119[_0x909c('0x10')]['message']);return _0x2ed604(_0x22f119[_0x909c('0x10')]['message']);}logger['error'](_0x909c('0xd'),_0x1e4f10,_0x22f119[_0x909c('0x10')]['message']);return _0x5b1f03(_0x22f119['error']['message']);}else{logger[_0x909c('0xc')]('VtigerField,\x20%s,\x20%s',_0x1e4f10,'request\x20sent');_0x5b1f03(_0x22f119[_0x909c('0x12')][_0x909c('0x13')]);}})[_0x909c('0x14')](function(_0x57a207){logger['error']('VtigerField,\x20%s,\x20%s',_0x1e4f10,_0x57a207);_0x2ed604(_0x57a207);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index a1f32b2..3e380c9 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 _0x2295=['destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','/:id','get','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','update'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2295,0x17c));var _0x5229=function(_0x504857,_0x54191a){_0x504857=_0x504857-0x0;var _0x22e385=_0x2295[_0x504857];return _0x22e385;};'use strict';var multer=require('multer');var util=require(_0x5229('0x0'));var path=require(_0x5229('0x1'));var timeout=require(_0x5229('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5229('0x3'));var auth=require(_0x5229('0x4'));var interaction=require(_0x5229('0x5'));var config=require(_0x5229('0x6'));var controller=require(_0x5229('0x7'));router['get']('/',auth[_0x5229('0x8')](),controller['index']);router['get'](_0x5229('0x9'),auth[_0x5229('0x8')](),controller['show']);router[_0x5229('0xa')]('/:id/configurations',auth[_0x5229('0x8')](),controller[_0x5229('0xb')]);router[_0x5229('0xa')](_0x5229('0xc'),auth[_0x5229('0x8')](),controller[_0x5229('0xd')]);router[_0x5229('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5229('0xe')](_0x5229('0xf'),auth[_0x5229('0x8')](),controller[_0x5229('0x10')]);router[_0x5229('0x11')]('/:id',auth[_0x5229('0x8')](),controller[_0x5229('0x12')]);router['delete'](_0x5229('0x9'),auth['isAuthenticated'](),controller[_0x5229('0x13')]);module[_0x5229('0x14')]=router; \ No newline at end of file +var _0x3ab9=['/:id/configurations','getConfigurations','getFields','create','post','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show'];(function(_0x33411b,_0x6abe39){var _0x34e621=function(_0x3203f4){while(--_0x3203f4){_0x33411b['push'](_0x33411b['shift']());}};_0x34e621(++_0x6abe39);}(_0x3ab9,0x6d));var _0x93ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ab9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x93ab('0x0'));var util=require('util');var path=require(_0x93ab('0x1'));var timeout=require(_0x93ab('0x2'));var express=require(_0x93ab('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x93ab('0x4'));var config=require(_0x93ab('0x5'));var controller=require(_0x93ab('0x6'));router[_0x93ab('0x7')]('/',auth[_0x93ab('0x8')](),controller['index']);router[_0x93ab('0x7')](_0x93ab('0x9'),auth[_0x93ab('0x8')](),controller[_0x93ab('0xa')]);router[_0x93ab('0x7')](_0x93ab('0xb'),auth[_0x93ab('0x8')](),controller[_0x93ab('0xc')]);router[_0x93ab('0x7')]('/:id/fields',auth[_0x93ab('0x8')](),controller[_0x93ab('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x93ab('0xe')]);router[_0x93ab('0xf')]('/:id/configurations',auth[_0x93ab('0x8')](),controller['addConfiguration']);router[_0x93ab('0x10')](_0x93ab('0x9'),auth[_0x93ab('0x8')](),controller[_0x93ab('0x11')]);router['delete'](_0x93ab('0x9'),auth[_0x93ab('0x8')](),controller[_0x93ab('0x12')]);module[_0x93ab('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 c5f7de4..389e343 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 _0xafb9=['exports','STRING','username','password','integrationTab','newTab','sequelize'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0xafb9,0x68));var _0x9afb=function(_0x7bbb6d,_0x5c47e6){_0x7bbb6d=_0x7bbb6d-0x0;var _0x2135ad=_0xafb9[_0x7bbb6d];return _0x2135ad;};'use strict';var Sequelize=require(_0x9afb('0x0'));module[_0x9afb('0x1')]={'name':{'type':Sequelize[_0x9afb('0x2')]},'description':{'type':Sequelize[_0x9afb('0x2')]},'username':{'type':Sequelize[_0x9afb('0x2')],'unique':_0x9afb('0x3')},'password':{'type':Sequelize[_0x9afb('0x2')]},'token':{'type':Sequelize[_0x9afb('0x2')]},'remoteUri':{'type':Sequelize[_0x9afb('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM'](_0x9afb('0x4'),'token'),'defaultValue':_0x9afb('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x9afb('0x5'),_0x9afb('0x6')),'defaultValue':_0x9afb('0x5')}}; \ No newline at end of file +var _0xaf1b=['password','token','newTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x208992,_0x55ba40){_0x208992=_0x208992-0x0;var _0x5b287e=_0xaf1b[_0x208992];return _0x5b287e;};'use strict';var Sequelize=require(_0xbaf1('0x0'));module[_0xbaf1('0x1')]={'name':{'type':Sequelize[_0xbaf1('0x2')]},'description':{'type':Sequelize[_0xbaf1('0x2')]},'username':{'type':Sequelize[_0xbaf1('0x2')],'unique':_0xbaf1('0x3')},'password':{'type':Sequelize[_0xbaf1('0x2')]},'token':{'type':Sequelize[_0xbaf1('0x2')]},'remoteUri':{'type':Sequelize[_0xbaf1('0x2')],'unique':_0xbaf1('0x4')},'authType':{'type':Sequelize[_0xbaf1('0x5')](_0xbaf1('0x6'),_0xbaf1('0x7')),'defaultValue':_0xbaf1('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xbaf1('0x5')]('integrationTab',_0xbaf1('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 92c4580..a5790c4 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 _0xefda=['getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','group','assignee','remove','ticket_fields','includes','position','system_field_options','custom_field_options','test','statusCode','stringify','send','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','rawAttributes','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskAccount','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','ZendeskConfiguration','AccountId','Subjects','channel','type','Descriptions'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0xefda,0x96));var _0xaefd=function(_0x24bd96,_0x18072e){_0x24bd96=_0x24bd96-0x0;var _0x21828a=_0xefda[_0x24bd96];return _0x21828a;};'use strict';var emlformat=require(_0xaefd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaefd('0x1'));var rp=require(_0xaefd('0x2'));var moment=require('moment');var BPromise=require(_0xaefd('0x3'));var Mustache=require(_0xaefd('0x4'));var util=require(_0xaefd('0x5'));var path=require(_0xaefd('0x6'));var sox=require(_0xaefd('0x7'));var csv=require(_0xaefd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaefd('0x9'));var _=require(_0xaefd('0xa'));var squel=require(_0xaefd('0xb'));var crypto=require(_0xaefd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaefd('0xd'));var toCsv=require(_0xaefd('0x8'));var querystring=require(_0xaefd('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaefd('0xf'));var as=require(_0xaefd('0x10'));var hardwareService=require(_0xaefd('0x11'));var logger=require(_0xaefd('0x12'))(_0xaefd('0x13'));var utils=require(_0xaefd('0x14'));var config=require(_0xaefd('0x15'));var licenseUtil=require(_0xaefd('0x16'));var db=require(_0xaefd('0x17'))['db'];var integrations=require(_0xaefd('0x18'));function respondWithStatusCode(_0x2a310c,_0x4b2b5c){_0x4b2b5c=_0x4b2b5c||0xcc;return function(_0x3172d3){if(_0x3172d3){return _0x2a310c['sendStatus'](_0x4b2b5c);}return _0x2a310c[_0xaefd('0x19')](_0x4b2b5c)[_0xaefd('0x1a')]();};}function respondWithResult(_0x9dfdf6,_0x43b82a){_0x43b82a=_0x43b82a||0xc8;return function(_0x4ec92a){if(_0x4ec92a){return _0x9dfdf6[_0xaefd('0x19')](_0x43b82a)[_0xaefd('0x1b')](_0x4ec92a);}};}function respondWithFilteredResult(_0x41f345,_0x411701){return function(_0x10ee28){if(_0x10ee28){var _0x32f75e=typeof _0x411701[_0xaefd('0x1c')]===_0xaefd('0x1d')&&typeof _0x411701['limit']===_0xaefd('0x1d');var _0x109604=_0x10ee28[_0xaefd('0x1e')];var _0x1737a1=_0x32f75e?0x0:_0x411701[_0xaefd('0x1c')];var _0x244956=_0x32f75e?_0x10ee28['count']:_0x411701[_0xaefd('0x1c')]+_0x411701[_0xaefd('0x1f')];var _0x24f131;if(_0x244956>=_0x109604){_0x244956=_0x109604;_0x24f131=0xc8;}else{_0x24f131=0xce;}_0x41f345[_0xaefd('0x19')](_0x24f131);return _0x41f345[_0xaefd('0x20')](_0xaefd('0x21'),_0x1737a1+'-'+_0x244956+'/'+_0x109604)['json'](_0x10ee28);}return null;};}function patchUpdates(_0x463d48){return function(_0x18e71c){try{jsonpatch[_0xaefd('0x22')](_0x18e71c,_0x463d48,!![]);}catch(_0x3d9823){return BPromise[_0xaefd('0x23')](_0x3d9823);}return _0x18e71c['save']();};}function saveUpdates(_0x479486,_0x5b9967){return function(_0x21680a){if(_0x21680a){return _0x21680a[_0xaefd('0x24')](_0x479486)[_0xaefd('0x25')](function(_0x5a44ed){return _0x5a44ed;});}return null;};}function removeEntity(_0x23060f,_0x4cd9b2){return function(_0x3deec8){if(_0x3deec8){return _0x3deec8[_0xaefd('0x26')]()[_0xaefd('0x25')](function(){_0x23060f['status'](0xcc)[_0xaefd('0x1a')]();});}};}function handleEntityNotFound(_0x3ffc9c,_0x18e720){return function(_0x14cc9d){if(!_0x14cc9d){_0x3ffc9c[_0xaefd('0x27')](0x194);}return _0x14cc9d;};}function handleError(_0x5a170c,_0x2fe27e){_0x2fe27e=_0x2fe27e||0x1f4;return function(_0x58c008){logger[_0xaefd('0x28')](_0x58c008[_0xaefd('0x29')]);if(_0x58c008['name']){delete _0x58c008[_0xaefd('0x2a')];}_0x5a170c[_0xaefd('0x19')](_0x2fe27e)['send'](_0x58c008);};}exports[_0xaefd('0x2b')]=function(_0x114ec0,_0x36b6b7){var _0x4c0898={},_0x45f0e8={},_0x5c573b={'count':0x0,'rows':[]};var _0x109e19=_['map'](db['ZendeskAccount'][_0xaefd('0x2c')],function(_0x1b470c){return{'name':_0x1b470c['fieldName'],'type':_0x1b470c['type']['key']};});_0x45f0e8[_0xaefd('0x2d')]=_[_0xaefd('0x2e')](_0x109e19,'name');_0x45f0e8['query']=_[_0xaefd('0x2f')](_0x114ec0[_0xaefd('0x30')]);_0x45f0e8[_0xaefd('0x31')]=_[_0xaefd('0x32')](_0x45f0e8['model'],_0x45f0e8[_0xaefd('0x30')]);_0x4c0898[_0xaefd('0x33')]=_[_0xaefd('0x32')](_0x45f0e8[_0xaefd('0x2d')],qs[_0xaefd('0x34')](_0x114ec0[_0xaefd('0x30')][_0xaefd('0x34')]));_0x4c0898[_0xaefd('0x33')]=_0x4c0898[_0xaefd('0x33')][_0xaefd('0x35')]?_0x4c0898[_0xaefd('0x33')]:_0x45f0e8[_0xaefd('0x2d')];if(!_0x114ec0[_0xaefd('0x30')][_0xaefd('0x36')](_0xaefd('0x37'))){_0x4c0898[_0xaefd('0x1f')]=qs['limit'](_0x114ec0[_0xaefd('0x30')][_0xaefd('0x1f')]);_0x4c0898[_0xaefd('0x1c')]=qs['offset'](_0x114ec0[_0xaefd('0x30')]['offset']);}_0x4c0898[_0xaefd('0x38')]=qs[_0xaefd('0x39')](_0x114ec0[_0xaefd('0x30')][_0xaefd('0x39')]);_0x4c0898[_0xaefd('0x3a')]=qs[_0xaefd('0x31')](_[_0xaefd('0x3b')](_0x114ec0[_0xaefd('0x30')],_0x45f0e8[_0xaefd('0x31')]),_0x109e19);if(_0x114ec0[_0xaefd('0x30')][_0xaefd('0x3c')]){_0x4c0898[_0xaefd('0x3a')]=_[_0xaefd('0x3d')](_0x4c0898[_0xaefd('0x3a')],{'$or':_['map'](_0x109e19,function(_0x1cfd6d){if(_0x1cfd6d['type']!==_0xaefd('0x3e')){var _0x6562={};_0x6562[_0x1cfd6d[_0xaefd('0x2a')]]={'$like':'%'+_0x114ec0[_0xaefd('0x30')][_0xaefd('0x3c')]+'%'};return _0x6562;}})});}_0x4c0898=_[_0xaefd('0x3d')]({},_0x4c0898,_0x114ec0[_0xaefd('0x3f')]);var _0x145e9e={'where':_0x4c0898[_0xaefd('0x3a')]};return db[_0xaefd('0x40')]['count'](_0x145e9e)[_0xaefd('0x25')](function(_0x3296ac){_0x5c573b['count']=_0x3296ac;if(_0x114ec0[_0xaefd('0x30')][_0xaefd('0x41')]){_0x4c0898[_0xaefd('0x42')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x4c0898);})[_0xaefd('0x25')](function(_0x3d0abf){_0x5c573b[_0xaefd('0x43')]=_0x3d0abf;return _0x5c573b;})[_0xaefd('0x25')](respondWithFilteredResult(_0x36b6b7,_0x4c0898))[_0xaefd('0x44')](handleError(_0x36b6b7,null));};exports[_0xaefd('0x45')]=function(_0x2e17b5,_0x2e98aa){var _0x48a7af={'raw':![],'where':{'id':_0x2e17b5[_0xaefd('0x46')]['id']}},_0x26587e={};_0x26587e[_0xaefd('0x2d')]=_[_0xaefd('0x2f')](db[_0xaefd('0x40')][_0xaefd('0x2c')]);_0x26587e[_0xaefd('0x30')]=_[_0xaefd('0x2f')](_0x2e17b5['query']);_0x26587e['filters']=_[_0xaefd('0x32')](_0x26587e[_0xaefd('0x2d')],_0x26587e['query']);_0x48a7af['attributes']=_[_0xaefd('0x32')](_0x26587e[_0xaefd('0x2d')],qs[_0xaefd('0x34')](_0x2e17b5[_0xaefd('0x30')][_0xaefd('0x34')]));_0x48a7af[_0xaefd('0x33')]=_0x48a7af[_0xaefd('0x33')][_0xaefd('0x35')]?_0x48a7af[_0xaefd('0x33')]:_0x26587e['model'];if(_0x2e17b5[_0xaefd('0x30')][_0xaefd('0x41')]){_0x48a7af[_0xaefd('0x42')]=[{'all':!![]}];}_0x48a7af=_[_0xaefd('0x3d')]({},_0x48a7af,_0x2e17b5[_0xaefd('0x3f')]);return db[_0xaefd('0x40')][_0xaefd('0x47')](_0x48a7af)['then'](handleEntityNotFound(_0x2e98aa,null))[_0xaefd('0x25')](respondWithResult(_0x2e98aa,null))['catch'](handleError(_0x2e98aa,null));};exports[_0xaefd('0x48')]=function(_0x374845,_0x16c664){return db[_0xaefd('0x40')]['create'](_0x374845['body'],{})[_0xaefd('0x25')](respondWithResult(_0x16c664,0xc9))[_0xaefd('0x44')](handleError(_0x16c664,null));};exports[_0xaefd('0x24')]=function(_0x4eeb56,_0x2a836a){if(_0x4eeb56[_0xaefd('0x49')]['id']){delete _0x4eeb56['body']['id'];}return db[_0xaefd('0x40')][_0xaefd('0x47')]({'where':{'id':_0x4eeb56[_0xaefd('0x46')]['id']}})[_0xaefd('0x25')](handleEntityNotFound(_0x2a836a,null))[_0xaefd('0x25')](saveUpdates(_0x4eeb56[_0xaefd('0x49')],null))[_0xaefd('0x25')](respondWithResult(_0x2a836a,null))[_0xaefd('0x44')](handleError(_0x2a836a,null));};exports['destroy']=function(_0x567ceb,_0x1406b8){return db[_0xaefd('0x40')]['find']({'where':{'id':_0x567ceb[_0xaefd('0x46')]['id']}})['then'](handleEntityNotFound(_0x1406b8,null))[_0xaefd('0x25')](removeEntity(_0x1406b8,null))[_0xaefd('0x44')](handleError(_0x1406b8,null));};exports[_0xaefd('0x4a')]=function(_0x69185e,_0x27fd3f,_0xf727cd){var _0x4b709a={};var _0x56e180={};var _0x1fd0b0;var _0x338823;return db['ZendeskAccount'][_0xaefd('0x4b')]({'where':{'id':_0x69185e[_0xaefd('0x46')]['id']}})[_0xaefd('0x25')](handleEntityNotFound(_0x27fd3f,null))[_0xaefd('0x25')](function(_0x4a883b){if(_0x4a883b){_0x1fd0b0=_0x4a883b;_0x56e180['model']=_[_0xaefd('0x2f')](db[_0xaefd('0x4c')][_0xaefd('0x2c')]);_0x56e180[_0xaefd('0x30')]=_[_0xaefd('0x2f')](_0x69185e['query']);_0x56e180[_0xaefd('0x31')]=_[_0xaefd('0x32')](_0x56e180['model'],_0x56e180[_0xaefd('0x30')]);_0x4b709a[_0xaefd('0x33')]=_['intersection'](_0x56e180[_0xaefd('0x2d')],qs[_0xaefd('0x34')](_0x69185e[_0xaefd('0x30')]['fields']));_0x4b709a[_0xaefd('0x33')]=_0x4b709a[_0xaefd('0x33')]['length']?_0x4b709a[_0xaefd('0x33')]:_0x56e180[_0xaefd('0x2d')];_0x4b709a[_0xaefd('0x38')]=qs[_0xaefd('0x39')](_0x69185e['query']['sort']);_0x4b709a[_0xaefd('0x3a')]=qs[_0xaefd('0x31')](_[_0xaefd('0x3b')](_0x69185e[_0xaefd('0x30')],_0x56e180[_0xaefd('0x31')]));if(_0x69185e[_0xaefd('0x30')][_0xaefd('0x3c')]){_0x4b709a[_0xaefd('0x3a')]=_[_0xaefd('0x3d')](_0x4b709a[_0xaefd('0x3a')],{'$or':_['map'](_0x4b709a['attributes'],function(_0x324eb4){var _0x431c1a={};_0x431c1a[_0x324eb4]={'$like':'%'+_0x69185e[_0xaefd('0x30')][_0xaefd('0x3c')]+'%'};return _0x431c1a;})});}_0x4b709a=_['merge']({},_0x4b709a,_0x69185e[_0xaefd('0x3f')]);return _0x1fd0b0[_0xaefd('0x4a')](_0x4b709a);}})[_0xaefd('0x25')](function(_0x1ad04e){if(_0x1ad04e){_0x338823=_0x1ad04e[_0xaefd('0x35')];if(!_0x69185e[_0xaefd('0x30')][_0xaefd('0x36')](_0xaefd('0x37'))){_0x4b709a['limit']=qs[_0xaefd('0x1f')](_0x69185e[_0xaefd('0x30')][_0xaefd('0x1f')]);_0x4b709a[_0xaefd('0x1c')]=qs['offset'](_0x69185e[_0xaefd('0x30')]['offset']);}return _0x1fd0b0[_0xaefd('0x4a')](_0x4b709a);}})[_0xaefd('0x25')](function(_0x516913){if(_0x516913){return _0x516913?{'count':_0x338823,'rows':_0x516913}:null;}})['then'](respondWithResult(_0x27fd3f,null))[_0xaefd('0x44')](handleError(_0x27fd3f,null));};exports['addConfiguration']=function(_0x5e0068,_0x4e75bc,_0xe2397c){if(_0x5e0068[_0xaefd('0x49')]['id']){delete _0x5e0068[_0xaefd('0x49')]['id'];}return db[_0xaefd('0x40')][_0xaefd('0x4b')]({'where':{'id':_0x5e0068[_0xaefd('0x46')]['id']}})['then'](handleEntityNotFound(_0x4e75bc,null))['then'](function(_0x4f8e16){if(_0x4f8e16){_0x5e0068['body'][_0xaefd('0x4d')]=_0x4f8e16['id'];_0x5e0068['body'][_0xaefd('0x4e')]=integrations['getSubjects'](_0x5e0068[_0xaefd('0x49')][_0xaefd('0x4f')],_0x5e0068[_0xaefd('0x49')][_0xaefd('0x50')]);_0x5e0068[_0xaefd('0x49')][_0xaefd('0x51')]=integrations[_0xaefd('0x52')](_0x5e0068['body'][_0xaefd('0x4f')],_0x5e0068[_0xaefd('0x49')][_0xaefd('0x50')]);return db[_0xaefd('0x4c')]['create'](_0x5e0068[_0xaefd('0x49')],{'include':[{'model':db['ZendeskField'],'as':_0xaefd('0x4e')},{'model':db[_0xaefd('0x53')],'as':_0xaefd('0x51')}]});}return null;})[_0xaefd('0x25')](respondWithResult(_0x4e75bc,null))[_0xaefd('0x44')](handleError(_0x4e75bc,null));};exports[_0xaefd('0x54')]=function(_0x57776e,_0x1a6195,_0x3b39db){var _0x4a9fa5='';return db[_0xaefd('0x40')][_0xaefd('0x4b')]({'where':{'id':_0x57776e['params']['id']},'attributes':['id',_0xaefd('0x55'),_0xaefd('0x56'),_0xaefd('0x57'),_0xaefd('0x58'),_0xaefd('0x59')]})[_0xaefd('0x25')](handleEntityNotFound(_0x1a6195,null))[_0xaefd('0x25')](function(_0x6f99b0){if(_0x6f99b0){_0x4a9fa5=_0x6f99b0[_0xaefd('0x59')];var _0x1ec9be=_0x4a9fa5[_0xaefd('0x5a')](-0x1);if(_0x1ec9be==='/'){_0x4a9fa5=_0x4a9fa5[_0xaefd('0x5b')](0x0,_0x4a9fa5[_0xaefd('0x5c')](_0x1ec9be));}var _0x43338b={'method':_0xaefd('0x5d'),'uri':util[_0xaefd('0x5e')](_0xaefd('0x5f'),_0x4a9fa5,'ticket_fields'),'json':!![]};switch(_0x6f99b0[_0xaefd('0x58')]){case _0xaefd('0x56'):_0x43338b[_0xaefd('0x60')]={'Authorization':util['format'](_0xaefd('0x61'),new Buffer(util[_0xaefd('0x5e')](_0xaefd('0x62'),_0x6f99b0[_0xaefd('0x55')],_0x6f99b0['password']))[_0xaefd('0x63')]('base64'))};break;case _0xaefd('0x57'):_0x43338b['headers']={'Authorization':util[_0xaefd('0x5e')](_0xaefd('0x61'),new Buffer(util[_0xaefd('0x5e')]('%s/token:%s',_0x6f99b0['username'],_0x6f99b0[_0xaefd('0x57')]))[_0xaefd('0x63')](_0xaefd('0x64')))};break;default:throw new db[(_0xaefd('0x65'))][(_0xaefd('0x66'))](_0xaefd('0x67'));}return rp(_0x43338b);}})['then'](function(_0x499d7d){if(_0x499d7d){var _0x58c97c=['subject','description',_0xaefd('0x68'),_0xaefd('0x69')];_[_0xaefd('0x6a')](_0x499d7d[_0xaefd('0x6b')],function(_0x5ae635){return _0x58c97c[_0xaefd('0x6c')](_0x5ae635[_0xaefd('0x50')]);});return{'count':_0x499d7d['ticket_fields'][_0xaefd('0x35')],'rows':_['map'](_0x499d7d[_0xaefd('0x6b')],function(_0x51b6f1){return{'id':_0x51b6f1['id'],'name':_0x51b6f1[_0xaefd('0x6d')]>0x7?_0x51b6f1['title']:_0x51b6f1[_0xaefd('0x50')],'custom':_0x51b6f1['position']>0x7?!![]:![],'options':_0x51b6f1[_0xaefd('0x6e')]?_0x51b6f1[_0xaefd('0x6e')]:_0x51b6f1['custom_field_options']?_0x51b6f1[_0xaefd('0x6f')]:[]};})};}})[_0xaefd('0x25')](respondWithResult(_0x1a6195,null))[_0xaefd('0x44')](function(_0x564c89){var _0x42c55c=_0x57776e[_0xaefd('0x30')][_0xaefd('0x70')]?0x1f4:_0x564c89[_0xaefd('0x71')]||0x1f4;logger[_0xaefd('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0xaefd('0x54'),_0x42c55c,JSON[_0xaefd('0x72')](_0x564c89));delete _0x564c89['name'];if(_0x42c55c===0x191){_0x42c55c=0x190;}_0x1a6195[_0xaefd('0x19')](_0x42c55c)[_0xaefd('0x73')](_0x57776e[_0xaefd('0x30')][_0xaefd('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x564c89[_0xaefd('0x71')]}:_0x564c89);});}; \ No newline at end of file +var _0x96cc=['includes','position','title','system_field_options','custom_field_options','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','index','map','ZendeskAccount','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','options','find','create','body','ZendeskConfiguration','pick','getConfigurations','findOne','AccountId','Subjects','Descriptions','channel','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','format','%s/%s','ticket_fields','headers','%s:%s','base64','Basic\x20%s','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','subject','group','assignee'];(function(_0xc69434,_0x55e9a8){var _0x5223d5=function(_0x4cb8de){while(--_0x4cb8de){_0xc69434['push'](_0xc69434['shift']());}};_0x5223d5(++_0x55e9a8);}(_0x96cc,0x16c));var _0xc96c=function(_0x2f7cc0,_0xa7ddc9){_0x2f7cc0=_0x2f7cc0-0x0;var _0x42ac73=_0x96cc[_0x2f7cc0];return _0x42ac73;};'use strict';var emlformat=require(_0xc96c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc96c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc96c('0x2'));var moment=require(_0xc96c('0x3'));var BPromise=require(_0xc96c('0x4'));var Mustache=require(_0xc96c('0x5'));var util=require(_0xc96c('0x6'));var path=require(_0xc96c('0x7'));var sox=require(_0xc96c('0x8'));var csv=require(_0xc96c('0x9'));var ejs=require(_0xc96c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc96c('0xb'));var squel=require(_0xc96c('0xc'));var crypto=require(_0xc96c('0xd'));var jsforce=require(_0xc96c('0xe'));var deskjs=require(_0xc96c('0xf'));var toCsv=require(_0xc96c('0x9'));var querystring=require(_0xc96c('0x10'));var Papa=require('papaparse');var Redis=require(_0xc96c('0x11'));var authService=require(_0xc96c('0x12'));var qs=require(_0xc96c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc96c('0x14'));var logger=require('../../config/logger')(_0xc96c('0x15'));var utils=require('../../config/utils');var config=require(_0xc96c('0x16'));var licenseUtil=require(_0xc96c('0x17'));var db=require(_0xc96c('0x18'))['db'];var integrations=require(_0xc96c('0x19'));function respondWithStatusCode(_0x5f27f3,_0x3fe3d5){_0x3fe3d5=_0x3fe3d5||0xcc;return function(_0x43fcaa){if(_0x43fcaa){return _0x5f27f3[_0xc96c('0x1a')](_0x3fe3d5);}return _0x5f27f3[_0xc96c('0x1b')](_0x3fe3d5)['end']();};}function respondWithResult(_0x35da94,_0xbed0c9){_0xbed0c9=_0xbed0c9||0xc8;return function(_0x399267){if(_0x399267){return _0x35da94[_0xc96c('0x1b')](_0xbed0c9)[_0xc96c('0x1c')](_0x399267);}};}function respondWithFilteredResult(_0x46455a,_0x1765d9){return function(_0x23e357){if(_0x23e357){var _0x174852=typeof _0x1765d9[_0xc96c('0x1d')]===_0xc96c('0x1e')&&typeof _0x1765d9['limit']==='undefined';var _0x406791=_0x23e357[_0xc96c('0x1f')];var _0x16b6ce=_0x174852?0x0:_0x1765d9[_0xc96c('0x1d')];var _0x4aa6a3=_0x174852?_0x23e357[_0xc96c('0x1f')]:_0x1765d9[_0xc96c('0x1d')]+_0x1765d9[_0xc96c('0x20')];var _0x3c0864;if(_0x4aa6a3>=_0x406791){_0x4aa6a3=_0x406791;_0x3c0864=0xc8;}else{_0x3c0864=0xce;}_0x46455a[_0xc96c('0x1b')](_0x3c0864);return _0x46455a[_0xc96c('0x21')](_0xc96c('0x22'),_0x16b6ce+'-'+_0x4aa6a3+'/'+_0x406791)[_0xc96c('0x1c')](_0x23e357);}return null;};}function patchUpdates(_0x28d762){return function(_0x2f25a3){try{jsonpatch[_0xc96c('0x23')](_0x2f25a3,_0x28d762,!![]);}catch(_0x1203a1){return BPromise[_0xc96c('0x24')](_0x1203a1);}return _0x2f25a3[_0xc96c('0x25')]();};}function saveUpdates(_0x325c54,_0x3b5c6c){return function(_0x3e2615){if(_0x3e2615){return _0x3e2615['update'](_0x325c54)[_0xc96c('0x26')](function(_0x4be783){return _0x4be783;});}return null;};}function removeEntity(_0x4456bf,_0x10ae21){return function(_0x2b1df9){if(_0x2b1df9){return _0x2b1df9[_0xc96c('0x27')]()[_0xc96c('0x26')](function(){_0x4456bf[_0xc96c('0x1b')](0xcc)[_0xc96c('0x28')]();});}};}function handleEntityNotFound(_0x14f171,_0x50fc07){return function(_0x3a23cb){if(!_0x3a23cb){_0x14f171[_0xc96c('0x1a')](0x194);}return _0x3a23cb;};}function handleError(_0x3f87cc,_0x294fee){_0x294fee=_0x294fee||0x1f4;return function(_0x58fab3){logger['error'](_0x58fab3[_0xc96c('0x29')]);if(_0x58fab3[_0xc96c('0x2a')]){delete _0x58fab3[_0xc96c('0x2a')];}_0x3f87cc[_0xc96c('0x1b')](_0x294fee)[_0xc96c('0x2b')](_0x58fab3);};}exports[_0xc96c('0x2c')]=function(_0x427cb2,_0x1c911b){var _0xa0efbc={},_0x27925f={},_0x325cda={'count':0x0,'rows':[]};var _0x40c72b=_[_0xc96c('0x2d')](db[_0xc96c('0x2e')]['rawAttributes'],function(_0x3aa436){return{'name':_0x3aa436['fieldName'],'type':_0x3aa436[_0xc96c('0x2f')][_0xc96c('0x30')]};});_0x27925f[_0xc96c('0x31')]=_['map'](_0x40c72b,_0xc96c('0x2a'));_0x27925f[_0xc96c('0x32')]=_[_0xc96c('0x33')](_0x427cb2[_0xc96c('0x32')]);_0x27925f['filters']=_['intersection'](_0x27925f[_0xc96c('0x31')],_0x27925f[_0xc96c('0x32')]);_0xa0efbc[_0xc96c('0x34')]=_['intersection'](_0x27925f[_0xc96c('0x31')],qs[_0xc96c('0x35')](_0x427cb2[_0xc96c('0x32')][_0xc96c('0x35')]));_0xa0efbc['attributes']=_0xa0efbc[_0xc96c('0x34')][_0xc96c('0x36')]?_0xa0efbc['attributes']:_0x27925f[_0xc96c('0x31')];if(!_0x427cb2[_0xc96c('0x32')][_0xc96c('0x37')](_0xc96c('0x38'))){_0xa0efbc[_0xc96c('0x20')]=qs[_0xc96c('0x20')](_0x427cb2['query'][_0xc96c('0x20')]);_0xa0efbc[_0xc96c('0x1d')]=qs[_0xc96c('0x1d')](_0x427cb2[_0xc96c('0x32')][_0xc96c('0x1d')]);}_0xa0efbc[_0xc96c('0x39')]=qs['sort'](_0x427cb2['query'][_0xc96c('0x3a')]);_0xa0efbc[_0xc96c('0x3b')]=qs['filters'](_['pick'](_0x427cb2[_0xc96c('0x32')],_0x27925f[_0xc96c('0x3c')]),_0x40c72b);if(_0x427cb2[_0xc96c('0x32')][_0xc96c('0x3d')]){_0xa0efbc[_0xc96c('0x3b')]=_[_0xc96c('0x3e')](_0xa0efbc[_0xc96c('0x3b')],{'$or':_[_0xc96c('0x2d')](_0x40c72b,function(_0x3fc40d){if(_0x3fc40d[_0xc96c('0x2f')]!==_0xc96c('0x3f')){var _0x5ed343={};_0x5ed343[_0x3fc40d[_0xc96c('0x2a')]]={'$like':'%'+_0x427cb2[_0xc96c('0x32')][_0xc96c('0x3d')]+'%'};return _0x5ed343;}})});}_0xa0efbc=_[_0xc96c('0x3e')]({},_0xa0efbc,_0x427cb2['options']);var _0x167671={'where':_0xa0efbc[_0xc96c('0x3b')]};return db[_0xc96c('0x2e')]['count'](_0x167671)['then'](function(_0x311a9e){_0x325cda[_0xc96c('0x1f')]=_0x311a9e;if(_0x427cb2[_0xc96c('0x32')]['includeAll']){_0xa0efbc[_0xc96c('0x40')]=[{'all':!![]}];}return db[_0xc96c('0x2e')][_0xc96c('0x41')](_0xa0efbc);})[_0xc96c('0x26')](function(_0x1790a8){_0x325cda[_0xc96c('0x42')]=_0x1790a8;return _0x325cda;})[_0xc96c('0x26')](respondWithFilteredResult(_0x1c911b,_0xa0efbc))[_0xc96c('0x43')](handleError(_0x1c911b,null));};exports[_0xc96c('0x44')]=function(_0x4d5a1b,_0x4c3088){var _0x30b3ac={'raw':![],'where':{'id':_0x4d5a1b[_0xc96c('0x45')]['id']}},_0x2199c4={};_0x2199c4[_0xc96c('0x31')]=_['keys'](db['ZendeskAccount'][_0xc96c('0x46')]);_0x2199c4[_0xc96c('0x32')]=_[_0xc96c('0x33')](_0x4d5a1b[_0xc96c('0x32')]);_0x2199c4[_0xc96c('0x3c')]=_[_0xc96c('0x47')](_0x2199c4[_0xc96c('0x31')],_0x2199c4['query']);_0x30b3ac[_0xc96c('0x34')]=_[_0xc96c('0x47')](_0x2199c4[_0xc96c('0x31')],qs[_0xc96c('0x35')](_0x4d5a1b['query']['fields']));_0x30b3ac[_0xc96c('0x34')]=_0x30b3ac[_0xc96c('0x34')][_0xc96c('0x36')]?_0x30b3ac[_0xc96c('0x34')]:_0x2199c4[_0xc96c('0x31')];if(_0x4d5a1b[_0xc96c('0x32')][_0xc96c('0x48')]){_0x30b3ac[_0xc96c('0x40')]=[{'all':!![]}];}_0x30b3ac=_[_0xc96c('0x3e')]({},_0x30b3ac,_0x4d5a1b[_0xc96c('0x49')]);return db[_0xc96c('0x2e')][_0xc96c('0x4a')](_0x30b3ac)[_0xc96c('0x26')](handleEntityNotFound(_0x4c3088,null))['then'](respondWithResult(_0x4c3088,null))[_0xc96c('0x43')](handleError(_0x4c3088,null));};exports[_0xc96c('0x4b')]=function(_0x307d58,_0x305ebd){return db['ZendeskAccount'][_0xc96c('0x4b')](_0x307d58['body'],{})[_0xc96c('0x26')](respondWithResult(_0x305ebd,0xc9))[_0xc96c('0x43')](handleError(_0x305ebd,null));};exports['update']=function(_0x2581ae,_0x400fe6){if(_0x2581ae[_0xc96c('0x4c')]['id']){delete _0x2581ae[_0xc96c('0x4c')]['id'];}return db[_0xc96c('0x2e')][_0xc96c('0x4a')]({'where':{'id':_0x2581ae['params']['id']}})['then'](handleEntityNotFound(_0x400fe6,null))['then'](saveUpdates(_0x2581ae[_0xc96c('0x4c')],null))['then'](respondWithResult(_0x400fe6,null))[_0xc96c('0x43')](handleError(_0x400fe6,null));};exports[_0xc96c('0x27')]=function(_0x65a0a7,_0x17c764){return db[_0xc96c('0x2e')][_0xc96c('0x4a')]({'where':{'id':_0x65a0a7[_0xc96c('0x45')]['id']}})[_0xc96c('0x26')](handleEntityNotFound(_0x17c764,null))[_0xc96c('0x26')](removeEntity(_0x17c764,null))[_0xc96c('0x43')](handleError(_0x17c764,null));};exports['getConfigurations']=function(_0x3adefb,_0x15367d,_0x2b58c1){var _0x215cad={};var _0x1c7ea7={};var _0xcde9;var _0xad88c3;return db[_0xc96c('0x2e')]['findOne']({'where':{'id':_0x3adefb['params']['id']}})['then'](handleEntityNotFound(_0x15367d,null))['then'](function(_0x356ef3){if(_0x356ef3){_0xcde9=_0x356ef3;_0x1c7ea7[_0xc96c('0x31')]=_[_0xc96c('0x33')](db[_0xc96c('0x4d')][_0xc96c('0x46')]);_0x1c7ea7[_0xc96c('0x32')]=_[_0xc96c('0x33')](_0x3adefb['query']);_0x1c7ea7[_0xc96c('0x3c')]=_[_0xc96c('0x47')](_0x1c7ea7[_0xc96c('0x31')],_0x1c7ea7[_0xc96c('0x32')]);_0x215cad[_0xc96c('0x34')]=_[_0xc96c('0x47')](_0x1c7ea7[_0xc96c('0x31')],qs['fields'](_0x3adefb[_0xc96c('0x32')][_0xc96c('0x35')]));_0x215cad[_0xc96c('0x34')]=_0x215cad[_0xc96c('0x34')][_0xc96c('0x36')]?_0x215cad[_0xc96c('0x34')]:_0x1c7ea7[_0xc96c('0x31')];_0x215cad[_0xc96c('0x39')]=qs[_0xc96c('0x3a')](_0x3adefb[_0xc96c('0x32')][_0xc96c('0x3a')]);_0x215cad[_0xc96c('0x3b')]=qs[_0xc96c('0x3c')](_[_0xc96c('0x4e')](_0x3adefb['query'],_0x1c7ea7[_0xc96c('0x3c')]));if(_0x3adefb[_0xc96c('0x32')][_0xc96c('0x3d')]){_0x215cad[_0xc96c('0x3b')]=_[_0xc96c('0x3e')](_0x215cad['where'],{'$or':_[_0xc96c('0x2d')](_0x215cad[_0xc96c('0x34')],function(_0x9cd1fd){var _0x12bf27={};_0x12bf27[_0x9cd1fd]={'$like':'%'+_0x3adefb['query'][_0xc96c('0x3d')]+'%'};return _0x12bf27;})});}_0x215cad=_[_0xc96c('0x3e')]({},_0x215cad,_0x3adefb['options']);return _0xcde9['getConfigurations'](_0x215cad);}})['then'](function(_0x46de63){if(_0x46de63){_0xad88c3=_0x46de63[_0xc96c('0x36')];if(!_0x3adefb[_0xc96c('0x32')][_0xc96c('0x37')](_0xc96c('0x38'))){_0x215cad['limit']=qs['limit'](_0x3adefb[_0xc96c('0x32')][_0xc96c('0x20')]);_0x215cad[_0xc96c('0x1d')]=qs[_0xc96c('0x1d')](_0x3adefb[_0xc96c('0x32')]['offset']);}return _0xcde9[_0xc96c('0x4f')](_0x215cad);}})[_0xc96c('0x26')](function(_0x3a31bd){if(_0x3a31bd){return _0x3a31bd?{'count':_0xad88c3,'rows':_0x3a31bd}:null;}})[_0xc96c('0x26')](respondWithResult(_0x15367d,null))['catch'](handleError(_0x15367d,null));};exports['addConfiguration']=function(_0x443ed5,_0x229fae,_0x55bab7){if(_0x443ed5[_0xc96c('0x4c')]['id']){delete _0x443ed5['body']['id'];}return db[_0xc96c('0x2e')][_0xc96c('0x50')]({'where':{'id':_0x443ed5[_0xc96c('0x45')]['id']}})[_0xc96c('0x26')](handleEntityNotFound(_0x229fae,null))[_0xc96c('0x26')](function(_0x296e7d){if(_0x296e7d){_0x443ed5[_0xc96c('0x4c')][_0xc96c('0x51')]=_0x296e7d['id'];_0x443ed5[_0xc96c('0x4c')][_0xc96c('0x52')]=integrations['getSubjects'](_0x443ed5[_0xc96c('0x4c')]['channel'],_0x443ed5[_0xc96c('0x4c')][_0xc96c('0x2f')]);_0x443ed5['body'][_0xc96c('0x53')]=integrations['getDescriptions'](_0x443ed5[_0xc96c('0x4c')][_0xc96c('0x54')],_0x443ed5[_0xc96c('0x4c')][_0xc96c('0x2f')]);return db[_0xc96c('0x4d')][_0xc96c('0x4b')](_0x443ed5[_0xc96c('0x4c')],{'include':[{'model':db[_0xc96c('0x55')],'as':_0xc96c('0x52')},{'model':db['ZendeskField'],'as':_0xc96c('0x53')}]});}return null;})[_0xc96c('0x26')](respondWithResult(_0x229fae,null))[_0xc96c('0x43')](handleError(_0x229fae,null));};exports[_0xc96c('0x56')]=function(_0x5282cb,_0x4667f6,_0x1e927d){var _0x54f3fe='';return db['ZendeskAccount'][_0xc96c('0x50')]({'where':{'id':_0x5282cb['params']['id']},'attributes':['id',_0xc96c('0x57'),_0xc96c('0x58'),_0xc96c('0x59'),_0xc96c('0x5a'),_0xc96c('0x5b')]})[_0xc96c('0x26')](handleEntityNotFound(_0x4667f6,null))[_0xc96c('0x26')](function(_0x3fb9b9){if(_0x3fb9b9){_0x54f3fe=_0x3fb9b9[_0xc96c('0x5b')];var _0x54e2d3=_0x54f3fe[_0xc96c('0x5c')](-0x1);if(_0x54e2d3==='/'){_0x54f3fe=_0x54f3fe[_0xc96c('0x5d')](0x0,_0x54f3fe[_0xc96c('0x5e')](_0x54e2d3));}var _0x4831d3={'method':'GET','uri':util[_0xc96c('0x5f')](_0xc96c('0x60'),_0x54f3fe,_0xc96c('0x61')),'json':!![]};switch(_0x3fb9b9[_0xc96c('0x5a')]){case _0xc96c('0x58'):_0x4831d3[_0xc96c('0x62')]={'Authorization':util[_0xc96c('0x5f')]('Basic\x20%s',new Buffer(util[_0xc96c('0x5f')](_0xc96c('0x63'),_0x3fb9b9['username'],_0x3fb9b9[_0xc96c('0x58')]))['toString'](_0xc96c('0x64')))};break;case _0xc96c('0x59'):_0x4831d3[_0xc96c('0x62')]={'Authorization':util[_0xc96c('0x5f')](_0xc96c('0x65'),new Buffer(util[_0xc96c('0x5f')](_0xc96c('0x66'),_0x3fb9b9[_0xc96c('0x57')],_0x3fb9b9[_0xc96c('0x59')]))['toString'](_0xc96c('0x64')))};break;default:throw new db[(_0xc96c('0x67'))]['ValidationError'](_0xc96c('0x68'));}return rp(_0x4831d3);}})['then'](function(_0x3c0363){if(_0x3c0363){var _0x669dec=[_0xc96c('0x69'),'description',_0xc96c('0x6a'),_0xc96c('0x6b')];_['remove'](_0x3c0363[_0xc96c('0x61')],function(_0x46bf83){return _0x669dec[_0xc96c('0x6c')](_0x46bf83['type']);});return{'count':_0x3c0363[_0xc96c('0x61')][_0xc96c('0x36')],'rows':_[_0xc96c('0x2d')](_0x3c0363[_0xc96c('0x61')],function(_0x2f4254){return{'id':_0x2f4254['id'],'name':_0x2f4254[_0xc96c('0x6d')]>0x7?_0x2f4254[_0xc96c('0x6e')]:_0x2f4254[_0xc96c('0x2f')],'custom':_0x2f4254[_0xc96c('0x6d')]>0x7?!![]:![],'options':_0x2f4254[_0xc96c('0x6f')]?_0x2f4254[_0xc96c('0x6f')]:_0x2f4254[_0xc96c('0x70')]?_0x2f4254[_0xc96c('0x70')]:[]};})};}})[_0xc96c('0x26')](respondWithResult(_0x4667f6,null))[_0xc96c('0x43')](function(_0x54c9ad){var _0x2c5134=_0x5282cb[_0xc96c('0x32')][_0xc96c('0x71')]?0x1f4:_0x54c9ad[_0xc96c('0x72')]||0x1f4;logger[_0xc96c('0x73')]('getFields,\x20%s,\x20%s,\x20%s',_0xc96c('0x56'),_0x2c5134,JSON[_0xc96c('0x74')](_0x54c9ad));delete _0x54c9ad[_0xc96c('0x2a')];if(_0x2c5134===0x191){_0x2c5134=0x190;}_0x4667f6[_0xc96c('0x1b')](_0x2c5134)[_0xc96c('0x2b')](_0x5282cb['query']['test']?{'message':_0xc96c('0x75'),'statusCode':_0x54c9ad[_0xc96c('0x72')]}:_0x54c9ad);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 221b2fe..0072b01 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 _0xe46e=['../../config/logger','api','moment','request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','util'];(function(_0x556dbd,_0x43573f){var _0xb25eb9=function(_0x5d8d5f){while(--_0x5d8d5f){_0x556dbd['push'](_0x556dbd['shift']());}};_0xb25eb9(++_0x43573f);}(_0xe46e,0x8e));var _0xee46=function(_0x2ef8e8,_0x2d34e2){_0x2ef8e8=_0x2ef8e8-0x0;var _0x22b7ce=_0xe46e[_0x2ef8e8];return _0x22b7ce;};'use strict';var _=require('lodash');var util=require(_0xee46('0x0'));var logger=require(_0xee46('0x1'))(_0xee46('0x2'));var moment=require(_0xee46('0x3'));var BPromise=require('bluebird');var rp=require(_0xee46('0x4'));var fs=require('fs');var path=require(_0xee46('0x5'));var rimraf=require('rimraf');var config=require(_0xee46('0x6'));var attributes=require(_0xee46('0x7'));var integrations=require(_0xee46('0x8'));module['exports']=function(_0x2684ae,_0x23d0fa){return _0x2684ae[_0xee46('0x9')](_0xee46('0xa'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c24=['../../components/integrations/configuration','define','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes'];(function(_0x409dc0,_0x2508e3){var _0x37a328=function(_0x4ff28d){while(--_0x4ff28d){_0x409dc0['push'](_0x409dc0['shift']());}};_0x37a328(++_0x2508e3);}(_0x0c24,0x107));var _0x40c2=function(_0x42fc3e,_0xdc5885){_0x42fc3e=_0x42fc3e-0x0;var _0x52e1fa=_0x0c24[_0x42fc3e];return _0x52e1fa;};'use strict';var _=require(_0x40c2('0x0'));var util=require(_0x40c2('0x1'));var logger=require(_0x40c2('0x2'))(_0x40c2('0x3'));var moment=require(_0x40c2('0x4'));var BPromise=require(_0x40c2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x40c2('0x6'));var rimraf=require(_0x40c2('0x7'));var config=require(_0x40c2('0x8'));var attributes=require(_0x40c2('0x9'));var integrations=require(_0x40c2('0xa'));module['exports']=function(_0x1baa38,_0x104954){return _0x1baa38[_0x40c2('0xb')]('ZendeskAccount',attributes,{'tableName':_0x40c2('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 abefbd8..89f8238 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 _0xf321=['request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','map','model','include','stringify','ShowZendeskAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','ZendeskAccount,\x20%s,\x20%s'];(function(_0x38115f,_0x55aaa0){var _0x5920e4=function(_0x1edab7){while(--_0x1edab7){_0x38115f['push'](_0x38115f['shift']());}};_0x5920e4(++_0x55aaa0);}(_0xf321,0x1dd));var _0x1f32=function(_0x398501,_0x13a48d){_0x398501=_0x398501-0x0;var _0x537129=_0xf321[_0x398501];return _0x537129;};'use strict';var _=require('lodash');var util=require(_0x1f32('0x0'));var moment=require(_0x1f32('0x1'));var BPromise=require(_0x1f32('0x2'));var rs=require(_0x1f32('0x3'));var fs=require('fs');var Redis=require(_0x1f32('0x4'));var db=require(_0x1f32('0x5'))['db'];var utils=require(_0x1f32('0x6'));var logger=require('../../config/logger')(_0x1f32('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1f32('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cc7a8,_0x9577e8,_0x5dc552){return new BPromise(function(_0x2175ef,_0x3d8f67){return client[_0x1f32('0x9')](_0x4cc7a8,_0x5dc552)[_0x1f32('0xa')](function(_0x4979b5){logger[_0x1f32('0xb')](_0x1f32('0xc'),_0x9577e8,_0x1f32('0xd'));logger[_0x1f32('0xe')](_0x1f32('0xf'),_0x9577e8,_0x1f32('0xd'),JSON['stringify'](_0x4979b5));if(_0x4979b5[_0x1f32('0x10')]){if(_0x4979b5[_0x1f32('0x10')][_0x1f32('0x11')]===0x1f4){logger[_0x1f32('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x9577e8,_0x4979b5[_0x1f32('0x10')][_0x1f32('0x12')]);return _0x3d8f67(_0x4979b5[_0x1f32('0x10')][_0x1f32('0x12')]);}logger[_0x1f32('0x10')](_0x1f32('0xc'),_0x9577e8,_0x4979b5[_0x1f32('0x10')][_0x1f32('0x12')]);return _0x2175ef(_0x4979b5[_0x1f32('0x10')]['message']);}else{logger['info'](_0x1f32('0xc'),_0x9577e8,_0x1f32('0xd'));_0x2175ef(_0x4979b5[_0x1f32('0x13')][_0x1f32('0x12')]);}})[_0x1f32('0x14')](function(_0x3d8641){logger[_0x1f32('0x10')](_0x1f32('0xc'),_0x9577e8,_0x3d8641);_0x3d8f67(_0x3d8641);});});}exports[_0x1f32('0x15')]=function(_0x3e6af0){var _0x2b90a2=this;return new Promise(function(_0xc3cf5b,_0x3acceb){return db[_0x1f32('0x16')][_0x1f32('0x17')]({'raw':_0x3e6af0[_0x1f32('0x18')]?_0x3e6af0['options'][_0x1f32('0x19')]===undefined?!![]:![]:!![],'where':_0x3e6af0['options']?_0x3e6af0[_0x1f32('0x18')][_0x1f32('0x1a')]||null:null,'attributes':_0x3e6af0[_0x1f32('0x18')]?_0x3e6af0[_0x1f32('0x18')][_0x1f32('0x1b')]||null:null,'limit':_0x3e6af0['options']?_0x3e6af0[_0x1f32('0x18')][_0x1f32('0x1c')]||null:null,'include':_0x3e6af0[_0x1f32('0x18')]?_0x3e6af0[_0x1f32('0x18')]['include']?_[_0x1f32('0x1d')](_0x3e6af0['options']['include'],function(_0x186e2c){return{'model':db[_0x186e2c[_0x1f32('0x1e')]],'as':_0x186e2c['as'],'attributes':_0x186e2c[_0x1f32('0x1b')],'include':_0x186e2c['include']?_[_0x1f32('0x1d')](_0x186e2c[_0x1f32('0x1f')],function(_0x1e0308){return{'model':db[_0x1e0308[_0x1f32('0x1e')]],'as':_0x1e0308['as'],'attributes':_0x1e0308['attributes'],'include':_0x1e0308['include']?_[_0x1f32('0x1d')](_0x1e0308[_0x1f32('0x1f')],function(_0x4cc6a3){return{'model':db[_0x4cc6a3[_0x1f32('0x1e')]],'as':_0x4cc6a3['as'],'attributes':_0x4cc6a3[_0x1f32('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1f32('0xa')](function(_0xf987ce){logger[_0x1f32('0xb')]('GetZendeskAccount',_0x3e6af0);logger[_0x1f32('0xe')](_0x1f32('0x15'),_0x3e6af0,JSON[_0x1f32('0x20')](_0xf987ce));_0xc3cf5b(_0xf987ce);})[_0x1f32('0x14')](function(_0x4519a3){logger[_0x1f32('0x10')](_0x1f32('0x15'),_0x4519a3['message'],_0x3e6af0);_0x3acceb(_0x2b90a2['error'](0x1f4,_0x4519a3[_0x1f32('0x12')]));});});};exports[_0x1f32('0x21')]=function(_0x5ed3a9){var _0x20e2e6=this;return new Promise(function(_0x26f90,_0x383391){return db['ZendeskAccount'][_0x1f32('0x22')]({'raw':_0x5ed3a9[_0x1f32('0x18')]?_0x5ed3a9[_0x1f32('0x18')][_0x1f32('0x19')]===undefined?!![]:![]:!![],'where':_0x5ed3a9['options']?_0x5ed3a9['options']['where']||null:null,'attributes':_0x5ed3a9[_0x1f32('0x18')]?_0x5ed3a9['options'][_0x1f32('0x1b')]||null:null,'include':_0x5ed3a9[_0x1f32('0x18')]?_0x5ed3a9[_0x1f32('0x18')][_0x1f32('0x1f')]?_[_0x1f32('0x1d')](_0x5ed3a9[_0x1f32('0x18')][_0x1f32('0x1f')],function(_0x494604){return{'model':db[_0x494604[_0x1f32('0x1e')]],'as':_0x494604['as'],'attributes':_0x494604['attributes'],'include':_0x494604[_0x1f32('0x1f')]?_[_0x1f32('0x1d')](_0x494604[_0x1f32('0x1f')],function(_0xd14038){return{'model':db[_0xd14038['model']],'as':_0xd14038['as'],'attributes':_0xd14038['attributes'],'include':_0xd14038['include']?_[_0x1f32('0x1d')](_0xd14038['include'],function(_0xe870c0){return{'model':db[_0xe870c0['model']],'as':_0xe870c0['as'],'attributes':_0xe870c0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x31ae44){logger[_0x1f32('0xb')](_0x1f32('0x21'),_0x5ed3a9);logger[_0x1f32('0xe')](_0x1f32('0x21'),_0x5ed3a9,JSON['stringify'](_0x31ae44));_0x26f90(_0x31ae44);})[_0x1f32('0x14')](function(_0x433dc5){logger['error'](_0x1f32('0x21'),_0x433dc5[_0x1f32('0x12')],_0x5ed3a9);_0x383391(_0x20e2e6[_0x1f32('0x10')](0x1f4,_0x433dc5[_0x1f32('0x12')]));});});}; \ No newline at end of file +var _0xc009=['debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','ZendeskAccount','find','then','ShowZendeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x6b5ad3,_0x2d0827){var _0x1acb13=function(_0x2e9632){while(--_0x2e9632){_0x6b5ad3['push'](_0x6b5ad3['shift']());}};_0x1acb13(++_0x2d0827);}(_0xc009,0x1de));var _0x9c00=function(_0x5c4971,_0x343065){_0x5c4971=_0x5c4971-0x0;var _0x3e1a86=_0xc009[_0x5c4971];return _0x3e1a86;};'use strict';var _=require(_0x9c00('0x0'));var util=require(_0x9c00('0x1'));var moment=require(_0x9c00('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c00('0x3'));var fs=require('fs');var Redis=require(_0x9c00('0x4'));var db=require(_0x9c00('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c00('0x6'))(_0x9c00('0x7'));var config=require(_0x9c00('0x8'));var jayson=require(_0x9c00('0x9'));var client=jayson[_0x9c00('0xa')][_0x9c00('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x290084,_0x5f4406,_0x13b7a1){return new BPromise(function(_0x3fc589,_0x576f1b){return client[_0x9c00('0xc')](_0x290084,_0x13b7a1)['then'](function(_0x511c71){logger[_0x9c00('0xd')](_0x9c00('0xe'),_0x5f4406,_0x9c00('0xf'));logger[_0x9c00('0x10')](_0x9c00('0x11'),_0x5f4406,_0x9c00('0xf'),JSON[_0x9c00('0x12')](_0x511c71));if(_0x511c71[_0x9c00('0x13')]){if(_0x511c71[_0x9c00('0x13')][_0x9c00('0x14')]===0x1f4){logger[_0x9c00('0x13')](_0x9c00('0xe'),_0x5f4406,_0x511c71[_0x9c00('0x13')]['message']);return _0x576f1b(_0x511c71['error']['message']);}logger[_0x9c00('0x13')](_0x9c00('0xe'),_0x5f4406,_0x511c71[_0x9c00('0x13')][_0x9c00('0x15')]);return _0x3fc589(_0x511c71[_0x9c00('0x13')][_0x9c00('0x15')]);}else{logger[_0x9c00('0xd')](_0x9c00('0xe'),_0x5f4406,_0x9c00('0xf'));_0x3fc589(_0x511c71[_0x9c00('0x16')][_0x9c00('0x15')]);}})[_0x9c00('0x17')](function(_0x43bd26){logger[_0x9c00('0x13')](_0x9c00('0xe'),_0x5f4406,_0x43bd26);_0x576f1b(_0x43bd26);});});}exports[_0x9c00('0x18')]=function(_0x47c59d){var _0x2abf0e=this;return new Promise(function(_0xbb4db0,_0xad63e){return db['ZendeskAccount'][_0x9c00('0x19')]({'raw':_0x47c59d[_0x9c00('0x1a')]?_0x47c59d[_0x9c00('0x1a')][_0x9c00('0x1b')]===undefined?!![]:![]:!![],'where':_0x47c59d[_0x9c00('0x1a')]?_0x47c59d[_0x9c00('0x1a')][_0x9c00('0x1c')]||null:null,'attributes':_0x47c59d['options']?_0x47c59d[_0x9c00('0x1a')]['attributes']||null:null,'limit':_0x47c59d['options']?_0x47c59d[_0x9c00('0x1a')][_0x9c00('0x1d')]||null:null,'include':_0x47c59d[_0x9c00('0x1a')]?_0x47c59d['options'][_0x9c00('0x1e')]?_[_0x9c00('0x1f')](_0x47c59d[_0x9c00('0x1a')][_0x9c00('0x1e')],function(_0x45e03d){return{'model':db[_0x45e03d[_0x9c00('0x20')]],'as':_0x45e03d['as'],'attributes':_0x45e03d[_0x9c00('0x21')],'include':_0x45e03d[_0x9c00('0x1e')]?_[_0x9c00('0x1f')](_0x45e03d[_0x9c00('0x1e')],function(_0x495f92){return{'model':db[_0x495f92[_0x9c00('0x20')]],'as':_0x495f92['as'],'attributes':_0x495f92[_0x9c00('0x21')],'include':_0x495f92[_0x9c00('0x1e')]?_[_0x9c00('0x1f')](_0x495f92['include'],function(_0x56514d){return{'model':db[_0x56514d['model']],'as':_0x56514d['as'],'attributes':_0x56514d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x435a48){logger[_0x9c00('0xd')]('GetZendeskAccount',_0x47c59d);logger[_0x9c00('0x10')](_0x9c00('0x18'),_0x47c59d,JSON[_0x9c00('0x12')](_0x435a48));_0xbb4db0(_0x435a48);})[_0x9c00('0x17')](function(_0x197b28){logger[_0x9c00('0x13')](_0x9c00('0x18'),_0x197b28[_0x9c00('0x15')],_0x47c59d);_0xad63e(_0x2abf0e['error'](0x1f4,_0x197b28['message']));});});};exports['ShowZendeskAccount']=function(_0x94a275){var _0x242aa1=this;return new Promise(function(_0x55f2da,_0xdc087d){return db[_0x9c00('0x22')][_0x9c00('0x23')]({'raw':_0x94a275['options']?_0x94a275[_0x9c00('0x1a')][_0x9c00('0x1b')]===undefined?!![]:![]:!![],'where':_0x94a275[_0x9c00('0x1a')]?_0x94a275[_0x9c00('0x1a')][_0x9c00('0x1c')]||null:null,'attributes':_0x94a275[_0x9c00('0x1a')]?_0x94a275[_0x9c00('0x1a')][_0x9c00('0x21')]||null:null,'include':_0x94a275[_0x9c00('0x1a')]?_0x94a275[_0x9c00('0x1a')][_0x9c00('0x1e')]?_[_0x9c00('0x1f')](_0x94a275['options'][_0x9c00('0x1e')],function(_0x4d7098){return{'model':db[_0x4d7098['model']],'as':_0x4d7098['as'],'attributes':_0x4d7098[_0x9c00('0x21')],'include':_0x4d7098[_0x9c00('0x1e')]?_[_0x9c00('0x1f')](_0x4d7098[_0x9c00('0x1e')],function(_0x2fa0ae){return{'model':db[_0x2fa0ae['model']],'as':_0x2fa0ae['as'],'attributes':_0x2fa0ae[_0x9c00('0x21')],'include':_0x2fa0ae[_0x9c00('0x1e')]?_[_0x9c00('0x1f')](_0x2fa0ae[_0x9c00('0x1e')],function(_0x3e64da){return{'model':db[_0x3e64da[_0x9c00('0x20')]],'as':_0x3e64da['as'],'attributes':_0x3e64da['attributes']};}):[]};}):[]};}):[]:[]})[_0x9c00('0x24')](function(_0x259de9){logger['info'](_0x9c00('0x25'),_0x94a275);logger[_0x9c00('0x10')]('ShowZendeskAccount',_0x94a275,JSON[_0x9c00('0x12')](_0x259de9));_0x55f2da(_0x259de9);})[_0x9c00('0x17')](function(_0x9869a6){logger['error']('ShowZendeskAccount',_0x9869a6[_0x9c00('0x15')],_0x94a275);_0xdc087d(_0x242aa1['error'](0x1f4,_0x9869a6['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 8af3e6a..0f42bf2 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 _0xac4a=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','get','show','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xbef038,_0x4ad60f){var _0x477555=function(_0x1d93ea){while(--_0x1d93ea){_0xbef038['push'](_0xbef038['shift']());}};_0x477555(++_0x4ad60f);}(_0xac4a,0x13f));var _0xaac4=function(_0x78c2a5,_0x5a2b77){_0x78c2a5=_0x78c2a5-0x0;var _0x47bd8f=_0xac4a[_0x78c2a5];return _0x47bd8f;};'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['get']('/:id/fields',auth[_0xaac4('0x9')](),controller['getFields']);router[_0xaac4('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xa')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xe')]);router['get']('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);router[_0xaac4('0x10')]('/',auth['isAuthenticated'](),controller[_0xaac4('0x11')]);router[_0xaac4('0x10')]('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0x12')]);router[_0xaac4('0x13')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x15')]);router[_0xaac4('0x16')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x17')]);module[_0xaac4('0x18')]=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(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'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 c72dbf1..a800f33 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 _0x54f8=['exports','STRING','sequelize'];(function(_0x362d21,_0x279bd1){var _0x19a1a0=function(_0x33d736){while(--_0x33d736){_0x362d21['push'](_0x362d21['shift']());}};_0x19a1a0(++_0x279bd1);}(_0x54f8,0x110));var _0x854f=function(_0x2f20de,_0x1cf382){_0x2f20de=_0x2f20de-0x0;var _0x67a12f=_0x54f8[_0x2f20de];return _0x67a12f;};'use strict';var Sequelize=require(_0x854f('0x0'));module[_0x854f('0x1')]={'name':{'type':Sequelize[_0x854f('0x2')]},'description':{'type':Sequelize[_0x854f('0x2')]}}; \ No newline at end of file +var _0x8275=['sequelize','exports','STRING'];(function(_0x3216e9,_0x2c43d0){var _0x383e82=function(_0x510399){while(--_0x510399){_0x3216e9['push'](_0x3216e9['shift']());}};_0x383e82(++_0x2c43d0);}(_0x8275,0x93));var _0x5827=function(_0x56b254,_0x3306a8){_0x56b254=_0x56b254-0x0;var _0x364904=_0x8275[_0x56b254];return _0x364904;};'use strict';var Sequelize=require(_0x5827('0x0'));module[_0x5827('0x1')]={'name':{'type':Sequelize[_0x5827('0x2')]},'description':{'type':Sequelize[_0x5827('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index b261061..19b7401 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 _0xd7ca=['where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','params','include','catch','create','body','find','getFields','findOne','options','getSubjects','getDescriptions','ZendeskField','Tag','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','index','ZendeskConfiguration','rawAttributes','fieldName','model','map','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x14cc1,_0x2391fc){var _0x3d92a7=function(_0x359a9a){while(--_0x359a9a){_0x14cc1['push'](_0x14cc1['shift']());}};_0x3d92a7(++_0x2391fc);}(_0xd7ca,0x70));var _0xad7c=function(_0x3fa5a9,_0x541163){_0x3fa5a9=_0x3fa5a9-0x0;var _0x173c5b=_0xd7ca[_0x3fa5a9];return _0x173c5b;};'use strict';var emlformat=require(_0xad7c('0x0'));var rimraf=require(_0xad7c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad7c('0x2'));var rp=require(_0xad7c('0x3'));var moment=require(_0xad7c('0x4'));var BPromise=require(_0xad7c('0x5'));var Mustache=require(_0xad7c('0x6'));var util=require('util');var path=require(_0xad7c('0x7'));var sox=require(_0xad7c('0x8'));var csv=require(_0xad7c('0x9'));var ejs=require(_0xad7c('0xa'));var fs=require('fs');var fs_extra=require(_0xad7c('0xb'));var _=require(_0xad7c('0xc'));var squel=require(_0xad7c('0xd'));var crypto=require(_0xad7c('0xe'));var jsforce=require(_0xad7c('0xf'));var deskjs=require(_0xad7c('0x10'));var toCsv=require(_0xad7c('0x9'));var querystring=require(_0xad7c('0x11'));var Papa=require(_0xad7c('0x12'));var Redis=require(_0xad7c('0x13'));var authService=require(_0xad7c('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xad7c('0x15'));var hardwareService=require(_0xad7c('0x16'));var logger=require(_0xad7c('0x17'))(_0xad7c('0x18'));var utils=require(_0xad7c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xad7c('0x1a'));var db=require(_0xad7c('0x1b'))['db'];function respondWithStatusCode(_0x64c855,_0x3cb4ab){_0x3cb4ab=_0x3cb4ab||0xcc;return function(_0xad4770){if(_0xad4770){return _0x64c855['sendStatus'](_0x3cb4ab);}return _0x64c855[_0xad7c('0x1c')](_0x3cb4ab)[_0xad7c('0x1d')]();};}function respondWithResult(_0x487fe4,_0x10752d){_0x10752d=_0x10752d||0xc8;return function(_0x5649cb){if(_0x5649cb){return _0x487fe4[_0xad7c('0x1c')](_0x10752d)[_0xad7c('0x1e')](_0x5649cb);}};}function respondWithFilteredResult(_0x332ef9,_0x48dca7){return function(_0x228e91){if(_0x228e91){var _0x5943bf=typeof _0x48dca7['offset']===_0xad7c('0x1f')&&typeof _0x48dca7['limit']===_0xad7c('0x1f');var _0x2ae98c=_0x228e91[_0xad7c('0x20')];var _0x2df3da=_0x5943bf?0x0:_0x48dca7[_0xad7c('0x21')];var _0x317932=_0x5943bf?_0x228e91[_0xad7c('0x20')]:_0x48dca7[_0xad7c('0x21')]+_0x48dca7[_0xad7c('0x22')];var _0x4dcb49;if(_0x317932>=_0x2ae98c){_0x317932=_0x2ae98c;_0x4dcb49=0xc8;}else{_0x4dcb49=0xce;}_0x332ef9[_0xad7c('0x1c')](_0x4dcb49);return _0x332ef9['set'](_0xad7c('0x23'),_0x2df3da+'-'+_0x317932+'/'+_0x2ae98c)[_0xad7c('0x1e')](_0x228e91);}return null;};}function patchUpdates(_0x4760d5){return function(_0x1c40d0){try{jsonpatch[_0xad7c('0x24')](_0x1c40d0,_0x4760d5,!![]);}catch(_0x21f4c5){return BPromise[_0xad7c('0x25')](_0x21f4c5);}return _0x1c40d0[_0xad7c('0x26')]();};}function saveUpdates(_0x11a268,_0x16af53){return function(_0x67399c){if(_0x67399c){return _0x67399c[_0xad7c('0x27')](_0x11a268)[_0xad7c('0x28')](function(_0x385016){return _0x385016;});}return null;};}function removeEntity(_0x517cf6,_0x3f119f){return function(_0xf42563){if(_0xf42563){return _0xf42563[_0xad7c('0x29')]()['then'](function(){_0x517cf6[_0xad7c('0x1c')](0xcc)[_0xad7c('0x1d')]();});}};}function handleEntityNotFound(_0x342ef6,_0x19970f){return function(_0x1b80d2){if(!_0x1b80d2){_0x342ef6[_0xad7c('0x2a')](0x194);}return _0x1b80d2;};}function handleError(_0x38be9f,_0x10a6f6){_0x10a6f6=_0x10a6f6||0x1f4;return function(_0xb594b1){logger[_0xad7c('0x2b')](_0xb594b1[_0xad7c('0x2c')]);if(_0xb594b1['name']){delete _0xb594b1['name'];}_0x38be9f['status'](_0x10a6f6)[_0xad7c('0x2d')](_0xb594b1);};}exports[_0xad7c('0x2e')]=function(_0x3ad2bc,_0x16c83e){var _0x3967bf={},_0x3e42e1={},_0x975443={'count':0x0,'rows':[]};var _0x4a5db0=_['map'](db[_0xad7c('0x2f')][_0xad7c('0x30')],function(_0xbdb6b0){return{'name':_0xbdb6b0[_0xad7c('0x31')],'type':_0xbdb6b0['type']['key']};});_0x3e42e1[_0xad7c('0x32')]=_[_0xad7c('0x33')](_0x4a5db0,_0xad7c('0x34'));_0x3e42e1[_0xad7c('0x35')]=_[_0xad7c('0x36')](_0x3ad2bc['query']);_0x3e42e1[_0xad7c('0x37')]=_['intersection'](_0x3e42e1[_0xad7c('0x32')],_0x3e42e1['query']);_0x3967bf[_0xad7c('0x38')]=_[_0xad7c('0x39')](_0x3e42e1[_0xad7c('0x32')],qs[_0xad7c('0x3a')](_0x3ad2bc[_0xad7c('0x35')]['fields']));_0x3967bf[_0xad7c('0x38')]=_0x3967bf[_0xad7c('0x38')][_0xad7c('0x3b')]?_0x3967bf[_0xad7c('0x38')]:_0x3e42e1[_0xad7c('0x32')];if(!_0x3ad2bc['query'][_0xad7c('0x3c')](_0xad7c('0x3d'))){_0x3967bf[_0xad7c('0x22')]=qs[_0xad7c('0x22')](_0x3ad2bc[_0xad7c('0x35')][_0xad7c('0x22')]);_0x3967bf[_0xad7c('0x21')]=qs[_0xad7c('0x21')](_0x3ad2bc[_0xad7c('0x35')][_0xad7c('0x21')]);}_0x3967bf[_0xad7c('0x3e')]=qs['sort'](_0x3ad2bc['query'][_0xad7c('0x3f')]);_0x3967bf[_0xad7c('0x40')]=qs['filters'](_[_0xad7c('0x41')](_0x3ad2bc['query'],_0x3e42e1[_0xad7c('0x37')]),_0x4a5db0);if(_0x3ad2bc[_0xad7c('0x35')][_0xad7c('0x42')]){_0x3967bf['where']=_[_0xad7c('0x43')](_0x3967bf['where'],{'$or':_[_0xad7c('0x33')](_0x4a5db0,function(_0x218f3c){if(_0x218f3c['type']!==_0xad7c('0x44')){var _0x4016ed={};_0x4016ed[_0x218f3c[_0xad7c('0x34')]]={'$like':'%'+_0x3ad2bc[_0xad7c('0x35')][_0xad7c('0x42')]+'%'};return _0x4016ed;}})});}_0x3967bf=_[_0xad7c('0x43')]({},_0x3967bf,_0x3ad2bc['options']);var _0x2f6776={'where':_0x3967bf[_0xad7c('0x40')]};return db[_0xad7c('0x2f')][_0xad7c('0x20')](_0x2f6776)[_0xad7c('0x28')](function(_0x3d96f2){_0x975443['count']=_0x3d96f2;if(_0x3ad2bc[_0xad7c('0x35')][_0xad7c('0x45')]){_0x3967bf['include']=[{'all':!![]}];}return db[_0xad7c('0x2f')][_0xad7c('0x46')](_0x3967bf);})['then'](function(_0x1fcb17){_0x975443[_0xad7c('0x47')]=_0x1fcb17;return _0x975443;})[_0xad7c('0x28')](respondWithFilteredResult(_0x16c83e,_0x3967bf))['catch'](handleError(_0x16c83e,null));};exports['show']=function(_0x56030f,_0xc1287d){var _0x413885={'raw':![],'where':{'id':_0x56030f[_0xad7c('0x48')]['id']}},_0x5d1bfe={};_0x5d1bfe[_0xad7c('0x32')]=_[_0xad7c('0x36')](db[_0xad7c('0x2f')]['rawAttributes']);_0x5d1bfe[_0xad7c('0x35')]=_[_0xad7c('0x36')](_0x56030f['query']);_0x5d1bfe[_0xad7c('0x37')]=_[_0xad7c('0x39')](_0x5d1bfe[_0xad7c('0x32')],_0x5d1bfe[_0xad7c('0x35')]);_0x413885[_0xad7c('0x38')]=_[_0xad7c('0x39')](_0x5d1bfe[_0xad7c('0x32')],qs['fields'](_0x56030f[_0xad7c('0x35')][_0xad7c('0x3a')]));_0x413885[_0xad7c('0x38')]=_0x413885['attributes'][_0xad7c('0x3b')]?_0x413885[_0xad7c('0x38')]:_0x5d1bfe[_0xad7c('0x32')];if(_0x56030f[_0xad7c('0x35')][_0xad7c('0x45')]){_0x413885[_0xad7c('0x49')]=[{'all':!![]}];}_0x413885=_[_0xad7c('0x43')]({},_0x413885,_0x56030f['options']);return db[_0xad7c('0x2f')]['find'](_0x413885)[_0xad7c('0x28')](handleEntityNotFound(_0xc1287d,null))[_0xad7c('0x28')](respondWithResult(_0xc1287d,null))[_0xad7c('0x4a')](handleError(_0xc1287d,null));};exports[_0xad7c('0x4b')]=function(_0x5962e0,_0x3d5a6c){return db[_0xad7c('0x2f')][_0xad7c('0x4b')](_0x5962e0[_0xad7c('0x4c')],{})[_0xad7c('0x28')](respondWithResult(_0x3d5a6c,0xc9))[_0xad7c('0x4a')](handleError(_0x3d5a6c,null));};exports['update']=function(_0x1f9308,_0x52a3fe){if(_0x1f9308[_0xad7c('0x4c')]['id']){delete _0x1f9308[_0xad7c('0x4c')]['id'];}return db[_0xad7c('0x2f')]['find']({'where':{'id':_0x1f9308[_0xad7c('0x48')]['id']}})['then'](handleEntityNotFound(_0x52a3fe,null))[_0xad7c('0x28')](saveUpdates(_0x1f9308[_0xad7c('0x4c')],null))[_0xad7c('0x28')](respondWithResult(_0x52a3fe,null))['catch'](handleError(_0x52a3fe,null));};exports[_0xad7c('0x29')]=function(_0x544ad4,_0x222378){return db['ZendeskConfiguration'][_0xad7c('0x4d')]({'where':{'id':_0x544ad4[_0xad7c('0x48')]['id']}})['then'](handleEntityNotFound(_0x222378,null))['then'](removeEntity(_0x222378,null))[_0xad7c('0x4a')](handleError(_0x222378,null));};exports[_0xad7c('0x4e')]=function(_0x299397,_0x33aa5c,_0x476ece){var _0x4b49f3={};var _0x162acd={};var _0x343f7e;var _0x471a2a;return db[_0xad7c('0x2f')][_0xad7c('0x4f')]({'where':{'id':_0x299397[_0xad7c('0x48')]['id']}})[_0xad7c('0x28')](handleEntityNotFound(_0x33aa5c,null))[_0xad7c('0x28')](function(_0x53538c){if(_0x53538c){_0x343f7e=_0x53538c;_0x162acd[_0xad7c('0x32')]=_[_0xad7c('0x36')](db['ZendeskField'][_0xad7c('0x30')]);_0x162acd[_0xad7c('0x35')]=_[_0xad7c('0x36')](_0x299397[_0xad7c('0x35')]);_0x162acd[_0xad7c('0x37')]=_[_0xad7c('0x39')](_0x162acd[_0xad7c('0x32')],_0x162acd[_0xad7c('0x35')]);_0x4b49f3['attributes']=_[_0xad7c('0x39')](_0x162acd['model'],qs['fields'](_0x299397[_0xad7c('0x35')][_0xad7c('0x3a')]));_0x4b49f3['attributes']=_0x4b49f3[_0xad7c('0x38')][_0xad7c('0x3b')]?_0x4b49f3[_0xad7c('0x38')]:_0x162acd['model'];_0x4b49f3['order']=qs[_0xad7c('0x3f')](_0x299397['query'][_0xad7c('0x3f')]);_0x4b49f3[_0xad7c('0x40')]=qs[_0xad7c('0x37')](_[_0xad7c('0x41')](_0x299397[_0xad7c('0x35')],_0x162acd['filters']));if(_0x299397[_0xad7c('0x35')][_0xad7c('0x42')]){_0x4b49f3['where']=_[_0xad7c('0x43')](_0x4b49f3[_0xad7c('0x40')],{'$or':_[_0xad7c('0x33')](_0x4b49f3[_0xad7c('0x38')],function(_0x357857){var _0x20dcf4={};_0x20dcf4[_0x357857]={'$like':'%'+_0x299397['query']['filter']+'%'};return _0x20dcf4;})});}_0x4b49f3=_[_0xad7c('0x43')]({},_0x4b49f3,_0x299397[_0xad7c('0x50')]);return _0x343f7e[_0xad7c('0x4e')](_0x4b49f3);}})[_0xad7c('0x28')](function(_0x1275ce){if(_0x1275ce){_0x471a2a=_0x1275ce[_0xad7c('0x3b')];if(!_0x299397[_0xad7c('0x35')]['hasOwnProperty'](_0xad7c('0x3d'))){_0x4b49f3[_0xad7c('0x22')]=qs[_0xad7c('0x22')](_0x299397['query'][_0xad7c('0x22')]);_0x4b49f3['offset']=qs[_0xad7c('0x21')](_0x299397[_0xad7c('0x35')][_0xad7c('0x21')]);}return _0x343f7e[_0xad7c('0x4e')](_0x4b49f3);}})[_0xad7c('0x28')](function(_0x5afbd0){if(_0x5afbd0){return _0x5afbd0?{'count':_0x471a2a,'rows':_0x5afbd0}:null;}})[_0xad7c('0x28')](respondWithResult(_0x33aa5c,null))[_0xad7c('0x4a')](handleError(_0x33aa5c,null));};exports['getSubjects']=function(_0x54b6fa,_0xc12d6e,_0x11b5d5){var _0x275ea1={};var _0x3affc1={};var _0x5caf57;var _0xd555d3;return db['ZendeskConfiguration'][_0xad7c('0x4f')]({'where':{'id':_0x54b6fa[_0xad7c('0x48')]['id']}})['then'](handleEntityNotFound(_0xc12d6e,null))[_0xad7c('0x28')](function(_0x162289){if(_0x162289){_0x5caf57=_0x162289;_0x3affc1['model']=_[_0xad7c('0x36')](db['ZendeskField']['rawAttributes']);_0x3affc1[_0xad7c('0x35')]=_[_0xad7c('0x36')](_0x54b6fa[_0xad7c('0x35')]);_0x3affc1[_0xad7c('0x37')]=_[_0xad7c('0x39')](_0x3affc1[_0xad7c('0x32')],_0x3affc1[_0xad7c('0x35')]);_0x275ea1[_0xad7c('0x38')]=_[_0xad7c('0x39')](_0x3affc1[_0xad7c('0x32')],qs[_0xad7c('0x3a')](_0x54b6fa[_0xad7c('0x35')][_0xad7c('0x3a')]));_0x275ea1[_0xad7c('0x38')]=_0x275ea1[_0xad7c('0x38')][_0xad7c('0x3b')]?_0x275ea1[_0xad7c('0x38')]:_0x3affc1[_0xad7c('0x32')];_0x275ea1[_0xad7c('0x3e')]=qs[_0xad7c('0x3f')](_0x54b6fa[_0xad7c('0x35')][_0xad7c('0x3f')]);_0x275ea1[_0xad7c('0x40')]=qs[_0xad7c('0x37')](_[_0xad7c('0x41')](_0x54b6fa['query'],_0x3affc1[_0xad7c('0x37')]));if(_0x54b6fa[_0xad7c('0x35')][_0xad7c('0x42')]){_0x275ea1[_0xad7c('0x40')]=_[_0xad7c('0x43')](_0x275ea1['where'],{'$or':_['map'](_0x275ea1[_0xad7c('0x38')],function(_0x35f0a1){var _0x51ebc1={};_0x51ebc1[_0x35f0a1]={'$like':'%'+_0x54b6fa[_0xad7c('0x35')][_0xad7c('0x42')]+'%'};return _0x51ebc1;})});}_0x275ea1=_[_0xad7c('0x43')]({},_0x275ea1,_0x54b6fa['options']);return _0x5caf57[_0xad7c('0x51')](_0x275ea1);}})[_0xad7c('0x28')](function(_0x1c1ef3){if(_0x1c1ef3){_0xd555d3=_0x1c1ef3[_0xad7c('0x3b')];if(!_0x54b6fa[_0xad7c('0x35')][_0xad7c('0x3c')]('nolimit')){_0x275ea1['limit']=qs[_0xad7c('0x22')](_0x54b6fa[_0xad7c('0x35')]['limit']);_0x275ea1[_0xad7c('0x21')]=qs[_0xad7c('0x21')](_0x54b6fa[_0xad7c('0x35')][_0xad7c('0x21')]);}return _0x5caf57['getSubjects'](_0x275ea1);}})[_0xad7c('0x28')](function(_0x413012){if(_0x413012){return _0x413012?{'count':_0xd555d3,'rows':_0x413012}:null;}})[_0xad7c('0x28')](respondWithResult(_0xc12d6e,null))['catch'](handleError(_0xc12d6e,null));};exports[_0xad7c('0x52')]=function(_0x2b038b,_0xabacaf,_0x565be1){var _0x5ba9e2={};var _0x113734={};var _0x489c5f;var _0xcbc80b;return db[_0xad7c('0x2f')][_0xad7c('0x4f')]({'where':{'id':_0x2b038b[_0xad7c('0x48')]['id']}})[_0xad7c('0x28')](handleEntityNotFound(_0xabacaf,null))[_0xad7c('0x28')](function(_0x2256dd){if(_0x2256dd){_0x489c5f=_0x2256dd;_0x113734[_0xad7c('0x32')]=_[_0xad7c('0x36')](db[_0xad7c('0x53')][_0xad7c('0x30')]);_0x113734['query']=_['keys'](_0x2b038b['query']);_0x113734[_0xad7c('0x37')]=_[_0xad7c('0x39')](_0x113734[_0xad7c('0x32')],_0x113734[_0xad7c('0x35')]);_0x5ba9e2['attributes']=_[_0xad7c('0x39')](_0x113734['model'],qs[_0xad7c('0x3a')](_0x2b038b[_0xad7c('0x35')][_0xad7c('0x3a')]));_0x5ba9e2[_0xad7c('0x38')]=_0x5ba9e2[_0xad7c('0x38')][_0xad7c('0x3b')]?_0x5ba9e2[_0xad7c('0x38')]:_0x113734[_0xad7c('0x32')];_0x5ba9e2[_0xad7c('0x3e')]=qs[_0xad7c('0x3f')](_0x2b038b[_0xad7c('0x35')][_0xad7c('0x3f')]);_0x5ba9e2[_0xad7c('0x40')]=qs[_0xad7c('0x37')](_['pick'](_0x2b038b[_0xad7c('0x35')],_0x113734[_0xad7c('0x37')]));if(_0x2b038b['query'][_0xad7c('0x42')]){_0x5ba9e2[_0xad7c('0x40')]=_[_0xad7c('0x43')](_0x5ba9e2[_0xad7c('0x40')],{'$or':_[_0xad7c('0x33')](_0x5ba9e2[_0xad7c('0x38')],function(_0x1e9a35){var _0x595cc2={};_0x595cc2[_0x1e9a35]={'$like':'%'+_0x2b038b[_0xad7c('0x35')]['filter']+'%'};return _0x595cc2;})});}_0x5ba9e2=_[_0xad7c('0x43')]({},_0x5ba9e2,_0x2b038b['options']);return _0x489c5f[_0xad7c('0x52')](_0x5ba9e2);}})[_0xad7c('0x28')](function(_0x31e447){if(_0x31e447){_0xcbc80b=_0x31e447[_0xad7c('0x3b')];if(!_0x2b038b['query'][_0xad7c('0x3c')](_0xad7c('0x3d'))){_0x5ba9e2[_0xad7c('0x22')]=qs[_0xad7c('0x22')](_0x2b038b['query'][_0xad7c('0x22')]);_0x5ba9e2[_0xad7c('0x21')]=qs[_0xad7c('0x21')](_0x2b038b['query'][_0xad7c('0x21')]);}return _0x489c5f[_0xad7c('0x52')](_0x5ba9e2);}})[_0xad7c('0x28')](function(_0x500f7a){if(_0x500f7a){return _0x500f7a?{'count':_0xcbc80b,'rows':_0x500f7a}:null;}})[_0xad7c('0x28')](respondWithResult(_0xabacaf,null))[_0xad7c('0x4a')](handleError(_0xabacaf,null));};exports['getTags']=function(_0x243364,_0x3facc2,_0x54b0e3){var _0x30572c={};var _0x339468={};var _0x169ab3;var _0x3ad77f;return db[_0xad7c('0x2f')][_0xad7c('0x4f')]({'where':{'id':_0x243364[_0xad7c('0x48')]['id']}})[_0xad7c('0x28')](handleEntityNotFound(_0x3facc2,null))['then'](function(_0x4d4248){if(_0x4d4248){_0x169ab3=_0x4d4248;_0x339468[_0xad7c('0x32')]=_[_0xad7c('0x36')](db[_0xad7c('0x54')]['rawAttributes']);_0x339468[_0xad7c('0x35')]=_[_0xad7c('0x36')](_0x243364[_0xad7c('0x35')]);_0x339468['filters']=_['intersection'](_0x339468[_0xad7c('0x32')],_0x339468[_0xad7c('0x35')]);_0x30572c[_0xad7c('0x38')]=_['intersection'](_0x339468[_0xad7c('0x32')],qs['fields'](_0x243364['query'][_0xad7c('0x3a')]));_0x30572c[_0xad7c('0x38')]=_0x30572c[_0xad7c('0x38')]['length']?_0x30572c['attributes']:_0x339468[_0xad7c('0x32')];_0x30572c[_0xad7c('0x3e')]=qs['sort'](_0x243364[_0xad7c('0x35')][_0xad7c('0x3f')]);_0x30572c[_0xad7c('0x40')]=qs[_0xad7c('0x37')](_[_0xad7c('0x41')](_0x243364[_0xad7c('0x35')],_0x339468[_0xad7c('0x37')]));if(_0x243364[_0xad7c('0x35')]['filter']){_0x30572c['where']=_[_0xad7c('0x43')](_0x30572c[_0xad7c('0x40')],{'$or':_['map'](_0x30572c[_0xad7c('0x38')],function(_0x44851e){var _0x558d15={};_0x558d15[_0x44851e]={'$like':'%'+_0x243364[_0xad7c('0x35')][_0xad7c('0x42')]+'%'};return _0x558d15;})});}_0x30572c=_['merge']({},_0x30572c,_0x243364[_0xad7c('0x50')]);return _0x169ab3[_0xad7c('0x55')](_0x30572c);}})[_0xad7c('0x28')](function(_0x11a237){if(_0x11a237){_0x3ad77f=_0x11a237['length'];if(!_0x243364[_0xad7c('0x35')][_0xad7c('0x3c')](_0xad7c('0x3d'))){_0x30572c[_0xad7c('0x22')]=qs[_0xad7c('0x22')](_0x243364[_0xad7c('0x35')][_0xad7c('0x22')]);_0x30572c[_0xad7c('0x21')]=qs['offset'](_0x243364[_0xad7c('0x35')][_0xad7c('0x21')]);}return _0x169ab3[_0xad7c('0x55')](_0x30572c);}})['then'](function(_0x42bc1a){if(_0x42bc1a){return _0x42bc1a?{'count':_0x3ad77f,'rows':_0x42bc1a}:null;}})['then'](respondWithResult(_0x3facc2,null))[_0xad7c('0x4a')](handleError(_0x3facc2,null));};exports[_0xad7c('0x56')]=function(_0x5ad6c3,_0x4835af,_0x32a52d){if(_0x5ad6c3[_0xad7c('0x4c')]['id']){delete _0x5ad6c3[_0xad7c('0x4c')]['id'];}return db[_0xad7c('0x2f')][_0xad7c('0x4f')]({'where':{'id':_0x5ad6c3[_0xad7c('0x48')]['id']}})['then'](handleEntityNotFound(_0x4835af,null))[_0xad7c('0x28')](function(_0x3d54ca){if(_0x3d54ca){return _0x3d54ca[_0xad7c('0x56')](_0x5ad6c3[_0xad7c('0x4c')][_0xad7c('0x57')]||[]);}return null;})[_0xad7c('0x28')](respondWithResult(_0x4835af,null))['catch'](handleError(_0x4835af,null));}; \ No newline at end of file +var _0x912b=['create','body','getFields','ZendeskField','length','hasOwnProperty','nolimit','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ZendeskConfiguration','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x912b,0xb5));var _0xb912=function(_0x37b1d8,_0x614312){_0x37b1d8=_0x37b1d8-0x0;var _0x3739e7=_0x912b[_0x37b1d8];return _0x3739e7;};'use strict';var emlformat=require(_0xb912('0x0'));var rimraf=require(_0xb912('0x1'));var zipdir=require(_0xb912('0x2'));var jsonpatch=require(_0xb912('0x3'));var rp=require('request-promise');var moment=require(_0xb912('0x4'));var BPromise=require(_0xb912('0x5'));var Mustache=require('mustache');var util=require(_0xb912('0x6'));var path=require(_0xb912('0x7'));var sox=require(_0xb912('0x8'));var csv=require('to-csv');var ejs=require(_0xb912('0x9'));var fs=require('fs');var fs_extra=require(_0xb912('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb912('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb912('0xc'));var toCsv=require(_0xb912('0xd'));var querystring=require('querystring');var Papa=require(_0xb912('0xe'));var Redis=require(_0xb912('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb912('0x10'));var as=require(_0xb912('0x11'));var hardwareService=require(_0xb912('0x12'));var logger=require(_0xb912('0x13'))(_0xb912('0x14'));var utils=require('../../config/utils');var config=require(_0xb912('0x15'));var licenseUtil=require(_0xb912('0x16'));var db=require(_0xb912('0x17'))['db'];function respondWithStatusCode(_0x5688d1,_0x4ab7f9){_0x4ab7f9=_0x4ab7f9||0xcc;return function(_0x399770){if(_0x399770){return _0x5688d1[_0xb912('0x18')](_0x4ab7f9);}return _0x5688d1[_0xb912('0x19')](_0x4ab7f9)[_0xb912('0x1a')]();};}function respondWithResult(_0x1aa009,_0x3ec723){_0x3ec723=_0x3ec723||0xc8;return function(_0x3f8ae5){if(_0x3f8ae5){return _0x1aa009['status'](_0x3ec723)[_0xb912('0x1b')](_0x3f8ae5);}};}function respondWithFilteredResult(_0x2a09e1,_0x4cbad7){return function(_0x1a315d){if(_0x1a315d){var _0x4328b3=typeof _0x4cbad7[_0xb912('0x1c')]==='undefined'&&typeof _0x4cbad7[_0xb912('0x1d')]===_0xb912('0x1e');var _0x59193a=_0x1a315d[_0xb912('0x1f')];var _0x3a47f0=_0x4328b3?0x0:_0x4cbad7[_0xb912('0x1c')];var _0x15fac5=_0x4328b3?_0x1a315d[_0xb912('0x1f')]:_0x4cbad7[_0xb912('0x1c')]+_0x4cbad7[_0xb912('0x1d')];var _0x47b5b2;if(_0x15fac5>=_0x59193a){_0x15fac5=_0x59193a;_0x47b5b2=0xc8;}else{_0x47b5b2=0xce;}_0x2a09e1[_0xb912('0x19')](_0x47b5b2);return _0x2a09e1[_0xb912('0x20')](_0xb912('0x21'),_0x3a47f0+'-'+_0x15fac5+'/'+_0x59193a)[_0xb912('0x1b')](_0x1a315d);}return null;};}function patchUpdates(_0x37c942){return function(_0x81b020){try{jsonpatch['apply'](_0x81b020,_0x37c942,!![]);}catch(_0xe575f7){return BPromise[_0xb912('0x22')](_0xe575f7);}return _0x81b020[_0xb912('0x23')]();};}function saveUpdates(_0x3c065b,_0x105707){return function(_0x3a3498){if(_0x3a3498){return _0x3a3498[_0xb912('0x24')](_0x3c065b)[_0xb912('0x25')](function(_0x57a061){return _0x57a061;});}return null;};}function removeEntity(_0xab1166,_0xc0b271){return function(_0x49bef9){if(_0x49bef9){return _0x49bef9[_0xb912('0x26')]()['then'](function(){_0xab1166[_0xb912('0x19')](0xcc)[_0xb912('0x1a')]();});}};}function handleEntityNotFound(_0x2078bf,_0x16d205){return function(_0x3d97be){if(!_0x3d97be){_0x2078bf[_0xb912('0x18')](0x194);}return _0x3d97be;};}function handleError(_0x1c15c0,_0x1f5bba){_0x1f5bba=_0x1f5bba||0x1f4;return function(_0x1f4e17){logger[_0xb912('0x27')](_0x1f4e17[_0xb912('0x28')]);if(_0x1f4e17[_0xb912('0x29')]){delete _0x1f4e17['name'];}_0x1c15c0[_0xb912('0x19')](_0x1f5bba)[_0xb912('0x2a')](_0x1f4e17);};}exports[_0xb912('0x2b')]=function(_0x4b1e68,_0x2eb859){var _0xe26031={},_0x460d76={},_0x1b92dd={'count':0x0,'rows':[]};var _0x187b72=_['map'](db[_0xb912('0x2c')]['rawAttributes'],function(_0x55b58c){return{'name':_0x55b58c[_0xb912('0x2d')],'type':_0x55b58c[_0xb912('0x2e')][_0xb912('0x2f')]};});_0x460d76[_0xb912('0x30')]=_[_0xb912('0x31')](_0x187b72,_0xb912('0x29'));_0x460d76[_0xb912('0x32')]=_[_0xb912('0x33')](_0x4b1e68['query']);_0x460d76['filters']=_[_0xb912('0x34')](_0x460d76[_0xb912('0x30')],_0x460d76['query']);_0xe26031['attributes']=_[_0xb912('0x34')](_0x460d76[_0xb912('0x30')],qs[_0xb912('0x35')](_0x4b1e68[_0xb912('0x32')][_0xb912('0x35')]));_0xe26031['attributes']=_0xe26031[_0xb912('0x36')]['length']?_0xe26031[_0xb912('0x36')]:_0x460d76['model'];if(!_0x4b1e68[_0xb912('0x32')]['hasOwnProperty']('nolimit')){_0xe26031[_0xb912('0x1d')]=qs[_0xb912('0x1d')](_0x4b1e68[_0xb912('0x32')]['limit']);_0xe26031['offset']=qs[_0xb912('0x1c')](_0x4b1e68[_0xb912('0x32')][_0xb912('0x1c')]);}_0xe26031[_0xb912('0x37')]=qs[_0xb912('0x38')](_0x4b1e68[_0xb912('0x32')][_0xb912('0x38')]);_0xe26031['where']=qs[_0xb912('0x39')](_[_0xb912('0x3a')](_0x4b1e68[_0xb912('0x32')],_0x460d76[_0xb912('0x39')]),_0x187b72);if(_0x4b1e68[_0xb912('0x32')][_0xb912('0x3b')]){_0xe26031[_0xb912('0x3c')]=_[_0xb912('0x3d')](_0xe26031['where'],{'$or':_['map'](_0x187b72,function(_0x2d9d4e){if(_0x2d9d4e[_0xb912('0x2e')]!=='VIRTUAL'){var _0x561f2b={};_0x561f2b[_0x2d9d4e[_0xb912('0x29')]]={'$like':'%'+_0x4b1e68[_0xb912('0x32')][_0xb912('0x3b')]+'%'};return _0x561f2b;}})});}_0xe26031=_['merge']({},_0xe26031,_0x4b1e68[_0xb912('0x3e')]);var _0x3e2f37={'where':_0xe26031[_0xb912('0x3c')]};return db[_0xb912('0x2c')][_0xb912('0x1f')](_0x3e2f37)[_0xb912('0x25')](function(_0x1fd9fe){_0x1b92dd[_0xb912('0x1f')]=_0x1fd9fe;if(_0x4b1e68['query'][_0xb912('0x3f')]){_0xe26031[_0xb912('0x40')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xb912('0x41')](_0xe26031);})[_0xb912('0x25')](function(_0x4ad20f){_0x1b92dd['rows']=_0x4ad20f;return _0x1b92dd;})[_0xb912('0x25')](respondWithFilteredResult(_0x2eb859,_0xe26031))[_0xb912('0x42')](handleError(_0x2eb859,null));};exports[_0xb912('0x43')]=function(_0x1442b8,_0x14dc77){var _0xb242c9={'raw':![],'where':{'id':_0x1442b8[_0xb912('0x44')]['id']}},_0x398ebf={};_0x398ebf[_0xb912('0x30')]=_['keys'](db['ZendeskConfiguration'][_0xb912('0x45')]);_0x398ebf[_0xb912('0x32')]=_[_0xb912('0x33')](_0x1442b8[_0xb912('0x32')]);_0x398ebf['filters']=_[_0xb912('0x34')](_0x398ebf[_0xb912('0x30')],_0x398ebf[_0xb912('0x32')]);_0xb242c9[_0xb912('0x36')]=_[_0xb912('0x34')](_0x398ebf[_0xb912('0x30')],qs[_0xb912('0x35')](_0x1442b8[_0xb912('0x32')][_0xb912('0x35')]));_0xb242c9[_0xb912('0x36')]=_0xb242c9['attributes']['length']?_0xb242c9[_0xb912('0x36')]:_0x398ebf[_0xb912('0x30')];if(_0x1442b8[_0xb912('0x32')][_0xb912('0x3f')]){_0xb242c9[_0xb912('0x40')]=[{'all':!![]}];}_0xb242c9=_[_0xb912('0x3d')]({},_0xb242c9,_0x1442b8[_0xb912('0x3e')]);return db[_0xb912('0x2c')][_0xb912('0x46')](_0xb242c9)[_0xb912('0x25')](handleEntityNotFound(_0x14dc77,null))[_0xb912('0x25')](respondWithResult(_0x14dc77,null))[_0xb912('0x42')](handleError(_0x14dc77,null));};exports[_0xb912('0x47')]=function(_0xd85444,_0x3a70ab){return db[_0xb912('0x2c')][_0xb912('0x47')](_0xd85444[_0xb912('0x48')],{})[_0xb912('0x25')](respondWithResult(_0x3a70ab,0xc9))['catch'](handleError(_0x3a70ab,null));};exports[_0xb912('0x24')]=function(_0x33e6d3,_0x45f5e0){if(_0x33e6d3[_0xb912('0x48')]['id']){delete _0x33e6d3[_0xb912('0x48')]['id'];}return db[_0xb912('0x2c')]['find']({'where':{'id':_0x33e6d3[_0xb912('0x44')]['id']}})[_0xb912('0x25')](handleEntityNotFound(_0x45f5e0,null))['then'](saveUpdates(_0x33e6d3[_0xb912('0x48')],null))[_0xb912('0x25')](respondWithResult(_0x45f5e0,null))[_0xb912('0x42')](handleError(_0x45f5e0,null));};exports[_0xb912('0x26')]=function(_0x381ee2,_0x513e5d){return db[_0xb912('0x2c')][_0xb912('0x46')]({'where':{'id':_0x381ee2[_0xb912('0x44')]['id']}})['then'](handleEntityNotFound(_0x513e5d,null))[_0xb912('0x25')](removeEntity(_0x513e5d,null))['catch'](handleError(_0x513e5d,null));};exports[_0xb912('0x49')]=function(_0x46dcf7,_0x22af02,_0x4753d6){var _0x50489c={};var _0x19d7b3={};var _0x177043;var _0x10a46f;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x46dcf7['params']['id']}})['then'](handleEntityNotFound(_0x22af02,null))[_0xb912('0x25')](function(_0x439501){if(_0x439501){_0x177043=_0x439501;_0x19d7b3['model']=_[_0xb912('0x33')](db[_0xb912('0x4a')][_0xb912('0x45')]);_0x19d7b3['query']=_['keys'](_0x46dcf7[_0xb912('0x32')]);_0x19d7b3[_0xb912('0x39')]=_[_0xb912('0x34')](_0x19d7b3[_0xb912('0x30')],_0x19d7b3[_0xb912('0x32')]);_0x50489c[_0xb912('0x36')]=_['intersection'](_0x19d7b3[_0xb912('0x30')],qs['fields'](_0x46dcf7[_0xb912('0x32')][_0xb912('0x35')]));_0x50489c['attributes']=_0x50489c['attributes'][_0xb912('0x4b')]?_0x50489c[_0xb912('0x36')]:_0x19d7b3[_0xb912('0x30')];_0x50489c[_0xb912('0x37')]=qs[_0xb912('0x38')](_0x46dcf7['query'][_0xb912('0x38')]);_0x50489c[_0xb912('0x3c')]=qs[_0xb912('0x39')](_[_0xb912('0x3a')](_0x46dcf7['query'],_0x19d7b3[_0xb912('0x39')]));if(_0x46dcf7[_0xb912('0x32')]['filter']){_0x50489c[_0xb912('0x3c')]=_[_0xb912('0x3d')](_0x50489c['where'],{'$or':_[_0xb912('0x31')](_0x50489c[_0xb912('0x36')],function(_0x1949f5){var _0x432af0={};_0x432af0[_0x1949f5]={'$like':'%'+_0x46dcf7[_0xb912('0x32')][_0xb912('0x3b')]+'%'};return _0x432af0;})});}_0x50489c=_[_0xb912('0x3d')]({},_0x50489c,_0x46dcf7[_0xb912('0x3e')]);return _0x177043[_0xb912('0x49')](_0x50489c);}})[_0xb912('0x25')](function(_0x960fd6){if(_0x960fd6){_0x10a46f=_0x960fd6['length'];if(!_0x46dcf7[_0xb912('0x32')][_0xb912('0x4c')](_0xb912('0x4d'))){_0x50489c[_0xb912('0x1d')]=qs['limit'](_0x46dcf7['query'][_0xb912('0x1d')]);_0x50489c[_0xb912('0x1c')]=qs[_0xb912('0x1c')](_0x46dcf7[_0xb912('0x32')][_0xb912('0x1c')]);}return _0x177043['getFields'](_0x50489c);}})[_0xb912('0x25')](function(_0x154b08){if(_0x154b08){return _0x154b08?{'count':_0x10a46f,'rows':_0x154b08}:null;}})[_0xb912('0x25')](respondWithResult(_0x22af02,null))[_0xb912('0x42')](handleError(_0x22af02,null));};exports['getSubjects']=function(_0x35aecc,_0x31698b,_0x4d600c){var _0x19641b={};var _0x2a16c2={};var _0x2c3ee8;var _0x4781ba;return db['ZendeskConfiguration'][_0xb912('0x4e')]({'where':{'id':_0x35aecc[_0xb912('0x44')]['id']}})[_0xb912('0x25')](handleEntityNotFound(_0x31698b,null))['then'](function(_0x581d29){if(_0x581d29){_0x2c3ee8=_0x581d29;_0x2a16c2[_0xb912('0x30')]=_[_0xb912('0x33')](db[_0xb912('0x4a')]['rawAttributes']);_0x2a16c2[_0xb912('0x32')]=_[_0xb912('0x33')](_0x35aecc[_0xb912('0x32')]);_0x2a16c2[_0xb912('0x39')]=_['intersection'](_0x2a16c2[_0xb912('0x30')],_0x2a16c2[_0xb912('0x32')]);_0x19641b['attributes']=_[_0xb912('0x34')](_0x2a16c2['model'],qs[_0xb912('0x35')](_0x35aecc[_0xb912('0x32')][_0xb912('0x35')]));_0x19641b[_0xb912('0x36')]=_0x19641b[_0xb912('0x36')][_0xb912('0x4b')]?_0x19641b[_0xb912('0x36')]:_0x2a16c2[_0xb912('0x30')];_0x19641b[_0xb912('0x37')]=qs[_0xb912('0x38')](_0x35aecc[_0xb912('0x32')][_0xb912('0x38')]);_0x19641b[_0xb912('0x3c')]=qs[_0xb912('0x39')](_[_0xb912('0x3a')](_0x35aecc[_0xb912('0x32')],_0x2a16c2[_0xb912('0x39')]));if(_0x35aecc[_0xb912('0x32')][_0xb912('0x3b')]){_0x19641b[_0xb912('0x3c')]=_['merge'](_0x19641b['where'],{'$or':_[_0xb912('0x31')](_0x19641b['attributes'],function(_0x31ff71){var _0xbee0b5={};_0xbee0b5[_0x31ff71]={'$like':'%'+_0x35aecc[_0xb912('0x32')][_0xb912('0x3b')]+'%'};return _0xbee0b5;})});}_0x19641b=_['merge']({},_0x19641b,_0x35aecc[_0xb912('0x3e')]);return _0x2c3ee8[_0xb912('0x4f')](_0x19641b);}})[_0xb912('0x25')](function(_0x42f3cf){if(_0x42f3cf){_0x4781ba=_0x42f3cf['length'];if(!_0x35aecc[_0xb912('0x32')][_0xb912('0x4c')](_0xb912('0x4d'))){_0x19641b[_0xb912('0x1d')]=qs['limit'](_0x35aecc[_0xb912('0x32')][_0xb912('0x1d')]);_0x19641b[_0xb912('0x1c')]=qs[_0xb912('0x1c')](_0x35aecc[_0xb912('0x32')][_0xb912('0x1c')]);}return _0x2c3ee8[_0xb912('0x4f')](_0x19641b);}})[_0xb912('0x25')](function(_0x536247){if(_0x536247){return _0x536247?{'count':_0x4781ba,'rows':_0x536247}:null;}})[_0xb912('0x25')](respondWithResult(_0x31698b,null))[_0xb912('0x42')](handleError(_0x31698b,null));};exports[_0xb912('0x50')]=function(_0x16aaf6,_0x24f03c,_0x5b4575){var _0x50039f={};var _0xea7940={};var _0x2f266d;var _0x1c8da4;return db[_0xb912('0x2c')]['findOne']({'where':{'id':_0x16aaf6[_0xb912('0x44')]['id']}})[_0xb912('0x25')](handleEntityNotFound(_0x24f03c,null))[_0xb912('0x25')](function(_0x55d352){if(_0x55d352){_0x2f266d=_0x55d352;_0xea7940[_0xb912('0x30')]=_[_0xb912('0x33')](db['ZendeskField']['rawAttributes']);_0xea7940['query']=_[_0xb912('0x33')](_0x16aaf6[_0xb912('0x32')]);_0xea7940['filters']=_[_0xb912('0x34')](_0xea7940[_0xb912('0x30')],_0xea7940['query']);_0x50039f[_0xb912('0x36')]=_[_0xb912('0x34')](_0xea7940[_0xb912('0x30')],qs[_0xb912('0x35')](_0x16aaf6[_0xb912('0x32')]['fields']));_0x50039f[_0xb912('0x36')]=_0x50039f[_0xb912('0x36')][_0xb912('0x4b')]?_0x50039f[_0xb912('0x36')]:_0xea7940[_0xb912('0x30')];_0x50039f[_0xb912('0x37')]=qs['sort'](_0x16aaf6[_0xb912('0x32')]['sort']);_0x50039f[_0xb912('0x3c')]=qs['filters'](_[_0xb912('0x3a')](_0x16aaf6[_0xb912('0x32')],_0xea7940[_0xb912('0x39')]));if(_0x16aaf6[_0xb912('0x32')][_0xb912('0x3b')]){_0x50039f['where']=_[_0xb912('0x3d')](_0x50039f[_0xb912('0x3c')],{'$or':_[_0xb912('0x31')](_0x50039f[_0xb912('0x36')],function(_0x563274){var _0x307ef5={};_0x307ef5[_0x563274]={'$like':'%'+_0x16aaf6['query'][_0xb912('0x3b')]+'%'};return _0x307ef5;})});}_0x50039f=_[_0xb912('0x3d')]({},_0x50039f,_0x16aaf6['options']);return _0x2f266d[_0xb912('0x50')](_0x50039f);}})[_0xb912('0x25')](function(_0x1e04ff){if(_0x1e04ff){_0x1c8da4=_0x1e04ff[_0xb912('0x4b')];if(!_0x16aaf6[_0xb912('0x32')][_0xb912('0x4c')](_0xb912('0x4d'))){_0x50039f[_0xb912('0x1d')]=qs[_0xb912('0x1d')](_0x16aaf6[_0xb912('0x32')][_0xb912('0x1d')]);_0x50039f[_0xb912('0x1c')]=qs['offset'](_0x16aaf6[_0xb912('0x32')][_0xb912('0x1c')]);}return _0x2f266d[_0xb912('0x50')](_0x50039f);}})['then'](function(_0xd17c8f){if(_0xd17c8f){return _0xd17c8f?{'count':_0x1c8da4,'rows':_0xd17c8f}:null;}})[_0xb912('0x25')](respondWithResult(_0x24f03c,null))['catch'](handleError(_0x24f03c,null));};exports[_0xb912('0x51')]=function(_0x9af15a,_0x49b195,_0x4212cf){var _0x691a1c={};var _0x1607cc={};var _0x10c1a3;var _0x3ac8a3;return db[_0xb912('0x2c')][_0xb912('0x4e')]({'where':{'id':_0x9af15a[_0xb912('0x44')]['id']}})[_0xb912('0x25')](handleEntityNotFound(_0x49b195,null))[_0xb912('0x25')](function(_0x5739aa){if(_0x5739aa){_0x10c1a3=_0x5739aa;_0x1607cc['model']=_[_0xb912('0x33')](db[_0xb912('0x52')]['rawAttributes']);_0x1607cc['query']=_[_0xb912('0x33')](_0x9af15a['query']);_0x1607cc[_0xb912('0x39')]=_['intersection'](_0x1607cc['model'],_0x1607cc['query']);_0x691a1c['attributes']=_['intersection'](_0x1607cc['model'],qs[_0xb912('0x35')](_0x9af15a[_0xb912('0x32')]['fields']));_0x691a1c['attributes']=_0x691a1c['attributes'][_0xb912('0x4b')]?_0x691a1c[_0xb912('0x36')]:_0x1607cc[_0xb912('0x30')];_0x691a1c[_0xb912('0x37')]=qs['sort'](_0x9af15a['query'][_0xb912('0x38')]);_0x691a1c[_0xb912('0x3c')]=qs[_0xb912('0x39')](_[_0xb912('0x3a')](_0x9af15a[_0xb912('0x32')],_0x1607cc['filters']));if(_0x9af15a['query'][_0xb912('0x3b')]){_0x691a1c[_0xb912('0x3c')]=_['merge'](_0x691a1c[_0xb912('0x3c')],{'$or':_[_0xb912('0x31')](_0x691a1c[_0xb912('0x36')],function(_0x3a8f47){var _0x9fc0d6={};_0x9fc0d6[_0x3a8f47]={'$like':'%'+_0x9af15a[_0xb912('0x32')][_0xb912('0x3b')]+'%'};return _0x9fc0d6;})});}_0x691a1c=_['merge']({},_0x691a1c,_0x9af15a[_0xb912('0x3e')]);return _0x10c1a3[_0xb912('0x51')](_0x691a1c);}})[_0xb912('0x25')](function(_0x48b6f2){if(_0x48b6f2){_0x3ac8a3=_0x48b6f2[_0xb912('0x4b')];if(!_0x9af15a['query'][_0xb912('0x4c')](_0xb912('0x4d'))){_0x691a1c['limit']=qs[_0xb912('0x1d')](_0x9af15a[_0xb912('0x32')]['limit']);_0x691a1c['offset']=qs[_0xb912('0x1c')](_0x9af15a[_0xb912('0x32')][_0xb912('0x1c')]);}return _0x10c1a3[_0xb912('0x51')](_0x691a1c);}})[_0xb912('0x25')](function(_0x3e66fe){if(_0x3e66fe){return _0x3e66fe?{'count':_0x3ac8a3,'rows':_0x3e66fe}:null;}})[_0xb912('0x25')](respondWithResult(_0x49b195,null))[_0xb912('0x42')](handleError(_0x49b195,null));};exports[_0xb912('0x53')]=function(_0x49b22f,_0x193bc9,_0x1d2710){if(_0x49b22f[_0xb912('0x48')]['id']){delete _0x49b22f['body']['id'];}return db[_0xb912('0x2c')][_0xb912('0x4e')]({'where':{'id':_0x49b22f['params']['id']}})[_0xb912('0x25')](handleEntityNotFound(_0x193bc9,null))[_0xb912('0x25')](function(_0x47047e){if(_0x47047e){return _0x47047e[_0xb912('0x53')](_0x49b22f['body']['ids']||[]);}return null;})[_0xb912('0x25')](respondWithResult(_0x193bc9,null))[_0xb912('0x42')](handleError(_0x193bc9,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 33df0bf..e4d6536 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 _0xcf66=['exports','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment'];(function(_0x10af7c,_0x3b6945){var _0x1d5ab1=function(_0x366a1d){while(--_0x366a1d){_0x10af7c['push'](_0x10af7c['shift']());}};_0x1d5ab1(++_0x3b6945);}(_0xcf66,0x71));var _0x6cf6=function(_0x16d889,_0x34ffc2){_0x16d889=_0x16d889-0x0;var _0x5b49ab=_0xcf66[_0x16d889];return _0x5b49ab;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var logger=require(_0x6cf6('0x2'))('api');var moment=require(_0x6cf6('0x3'));var BPromise=require(_0x6cf6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6cf6('0x5'));var config=require(_0x6cf6('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x6cf6('0x7')]=function(_0x1fbedd,_0x2a573e){return _0x1fbedd['define'](_0x6cf6('0x8'),attributes,{'tableName':_0x6cf6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2cf=['request-promise','path','rimraf','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','util','api','bluebird'];(function(_0x30e0b7,_0x41927){var _0x6eca1c=function(_0x1b2ed4){while(--_0x1b2ed4){_0x30e0b7['push'](_0x30e0b7['shift']());}};_0x6eca1c(++_0x41927);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x2b71da,_0x1a6441){_0x2b71da=_0x2b71da-0x0;var _0x314281=_0xe2cf[_0x2b71da];return _0x314281;};'use strict';var _=require('lodash');var util=require(_0xfe2c('0x0'));var logger=require('../../config/logger')(_0xfe2c('0x1'));var moment=require('moment');var BPromise=require(_0xfe2c('0x2'));var rp=require(_0xfe2c('0x3'));var fs=require('fs');var path=require(_0xfe2c('0x4'));var rimraf=require(_0xfe2c('0x5'));var config=require('../../config/environment');var attributes=require(_0xfe2c('0x6'));module[_0xfe2c('0x7')]=function(_0x55bb12,_0x4fa079){return _0x55bb12[_0xfe2c('0x8')](_0xfe2c('0x9'),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 68c8520..8969a1d 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 _0x1807=['code','message','result','catch','moment','bluebird','ioredis','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x540160,_0x24c6b6){var _0x476120=function(_0x28046c){while(--_0x28046c){_0x540160['push'](_0x540160['shift']());}};_0x476120(++_0x24c6b6);}(_0x1807,0x15a));var _0x7180=function(_0x440ba5,_0x573515){_0x440ba5=_0x440ba5-0x0;var _0x218106=_0x1807[_0x440ba5];return _0x218106;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7180('0x0'));var BPromise=require(_0x7180('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7180('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7180('0x3'));var jayson=require(_0x7180('0x4'));var client=jayson[_0x7180('0x5')][_0x7180('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5cca64,_0x380567,_0x4d9651){return new BPromise(function(_0x3d8e28,_0x43576d){return client[_0x7180('0x7')](_0x5cca64,_0x4d9651)[_0x7180('0x8')](function(_0x521678){logger[_0x7180('0x9')](_0x7180('0xa'),_0x380567,_0x7180('0xb'));logger['debug'](_0x7180('0xc'),_0x380567,_0x7180('0xb'),JSON[_0x7180('0xd')](_0x521678));if(_0x521678[_0x7180('0xe')]){if(_0x521678[_0x7180('0xe')][_0x7180('0xf')]===0x1f4){logger[_0x7180('0xe')](_0x7180('0xa'),_0x380567,_0x521678[_0x7180('0xe')][_0x7180('0x10')]);return _0x43576d(_0x521678[_0x7180('0xe')]['message']);}logger[_0x7180('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x380567,_0x521678[_0x7180('0xe')][_0x7180('0x10')]);return _0x3d8e28(_0x521678[_0x7180('0xe')][_0x7180('0x10')]);}else{logger[_0x7180('0x9')]('ZendeskConfiguration,\x20%s,\x20%s',_0x380567,_0x7180('0xb'));_0x3d8e28(_0x521678[_0x7180('0x11')][_0x7180('0x10')]);}})[_0x7180('0x12')](function(_0x19840e){logger[_0x7180('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x380567,_0x19840e);_0x43576d(_0x19840e);});});} \ No newline at end of file +var _0x967b=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x967b,0xb1));var _0xb967=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x967b[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0xb967('0x0'));var util=require(_0xb967('0x1'));var moment=require('moment');var BPromise=require(_0xb967('0x2'));var rs=require(_0xb967('0x3'));var fs=require('fs');var Redis=require(_0xb967('0x4'));var db=require(_0xb967('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb967('0x6'))(_0xb967('0x7'));var config=require(_0xb967('0x8'));var jayson=require(_0xb967('0x9'));var client=jayson[_0xb967('0xa')][_0xb967('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x318c55,_0xd9eda9,_0x4eed3b){return new BPromise(function(_0x548bf5,_0x1660fd){return client['request'](_0x318c55,_0x4eed3b)['then'](function(_0x311a9c){logger[_0xb967('0xc')](_0xb967('0xd'),_0xd9eda9,_0xb967('0xe'));logger[_0xb967('0xf')](_0xb967('0x10'),_0xd9eda9,_0xb967('0xe'),JSON['stringify'](_0x311a9c));if(_0x311a9c['error']){if(_0x311a9c[_0xb967('0x11')][_0xb967('0x12')]===0x1f4){logger[_0xb967('0x11')](_0xb967('0xd'),_0xd9eda9,_0x311a9c[_0xb967('0x11')][_0xb967('0x13')]);return _0x1660fd(_0x311a9c['error'][_0xb967('0x13')]);}logger[_0xb967('0x11')](_0xb967('0xd'),_0xd9eda9,_0x311a9c['error'][_0xb967('0x13')]);return _0x548bf5(_0x311a9c['error'][_0xb967('0x13')]);}else{logger[_0xb967('0xc')](_0xb967('0xd'),_0xd9eda9,_0xb967('0xe'));_0x548bf5(_0x311a9c[_0xb967('0x14')]['message']);}})[_0xb967('0x15')](function(_0x3d4a2e){logger[_0xb967('0x11')](_0xb967('0xd'),_0xd9eda9,_0x3d4a2e);_0x1660fd(_0x3d4a2e);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 23f5252..1916d88 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 _0x74e0=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','/:id','show','post','create','update','exports','path'];(function(_0x56c4b3,_0x519a33){var _0x2162ed=function(_0x6a6c6b){while(--_0x6a6c6b){_0x56c4b3['push'](_0x56c4b3['shift']());}};_0x2162ed(++_0x519a33);}(_0x74e0,0x16b));var _0x074e=function(_0x311d45,_0xad8766){_0x311d45=_0x311d45-0x0;var _0x55ba6e=_0x74e0[_0x311d45];return _0x55ba6e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x074e('0x0'));var timeout=require(_0x074e('0x1'));var express=require('express');var router=express[_0x074e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x074e('0x3'));var interaction=require(_0x074e('0x4'));var config=require('../../config/environment');var controller=require(_0x074e('0x5'));router[_0x074e('0x6')]('/',auth[_0x074e('0x7')](),controller['index']);router[_0x074e('0x6')](_0x074e('0x8'),auth[_0x074e('0x7')](),controller[_0x074e('0x9')]);router[_0x074e('0xa')]('/',auth['isAuthenticated'](),controller[_0x074e('0xb')]);router['put'](_0x074e('0x8'),auth[_0x074e('0x7')](),controller[_0x074e('0xc')]);router['delete'](_0x074e('0x8'),auth[_0x074e('0x7')](),controller['destroy']);module[_0x074e('0xd')]=router; \ No newline at end of file +var _0xb13a=['show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x264407,_0x107385){var _0x31793d=function(_0x1ae95b){while(--_0x1ae95b){_0x264407['push'](_0x264407['shift']());}};_0x31793d(++_0x107385);}(_0xb13a,0x1d2));var _0xab13=function(_0x1ff0d3,_0x38c63d){_0x1ff0d3=_0x1ff0d3-0x0;var _0x38a1a3=_0xb13a[_0x1ff0d3];return _0x38a1a3;};'use strict';var multer=require(_0xab13('0x0'));var util=require(_0xab13('0x1'));var path=require(_0xab13('0x2'));var timeout=require(_0xab13('0x3'));var express=require(_0xab13('0x4'));var router=express[_0xab13('0x5')]();var fs_extra=require(_0xab13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xab13('0x7'));var config=require(_0xab13('0x8'));var controller=require(_0xab13('0x9'));router[_0xab13('0xa')]('/',auth[_0xab13('0xb')](),controller[_0xab13('0xc')]);router[_0xab13('0xa')](_0xab13('0xd'),auth[_0xab13('0xb')](),controller[_0xab13('0xe')]);router['post']('/',auth[_0xab13('0xb')](),controller[_0xab13('0xf')]);router[_0xab13('0x10')](_0xab13('0xd'),auth[_0xab13('0xb')](),controller[_0xab13('0x11')]);router['delete'](_0xab13('0xd'),auth[_0xab13('0xb')](),controller[_0xab13('0x12')]);module[_0xab13('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 8482d4c..bd5b973 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 _0x221c=['customVariable','keyValue','picklist','string','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x4b3086,_0x3615ee){var _0x27d411=function(_0x329b36){while(--_0x329b36){_0x4b3086['push'](_0x4b3086['shift']());}};_0x27d411(++_0x3615ee);}(_0x221c,0x101));var _0xc221=function(_0x4fe1e4,_0x3e3bf2){_0x4fe1e4=_0x4fe1e4-0x0;var _0x2edec8=_0x221c[_0x4fe1e4];return _0x2edec8;};'use strict';var Sequelize=require(_0xc221('0x0'));module[_0xc221('0x1')]={'type':{'type':Sequelize[_0xc221('0x2')]('string','variable',_0xc221('0x3'),_0xc221('0x4'),_0xc221('0x5')),'defaultValue':_0xc221('0x6')},'content':{'type':Sequelize[_0xc221('0x7')]},'key':{'type':Sequelize[_0xc221('0x7')]},'keyType':{'type':Sequelize[_0xc221('0x2')](_0xc221('0x6'),_0xc221('0x8'),_0xc221('0x3'))},'keyContent':{'type':Sequelize[_0xc221('0x7')]},'idField':{'type':Sequelize[_0xc221('0x7')]},'nameField':{'type':Sequelize[_0xc221('0x7')]},'customField':{'type':Sequelize[_0xc221('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc221('0x7')]}}; \ No newline at end of file +var _0x86eb=['string','variable','keyValue','picklist','STRING','ENUM','customVariable','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x86eb,0xe8));var _0xb86e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x86eb[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xb86e('0x0'));module[_0xb86e('0x1')]={'type':{'type':Sequelize['ENUM'](_0xb86e('0x2'),_0xb86e('0x3'),'customVariable',_0xb86e('0x4'),_0xb86e('0x5')),'defaultValue':_0xb86e('0x2')},'content':{'type':Sequelize[_0xb86e('0x6')]},'key':{'type':Sequelize[_0xb86e('0x6')]},'keyType':{'type':Sequelize[_0xb86e('0x7')](_0xb86e('0x2'),'variable',_0xb86e('0x8'))},'keyContent':{'type':Sequelize[_0xb86e('0x6')]},'idField':{'type':Sequelize[_0xb86e('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb86e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index b8ed366..031d7aa 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 _0xb4cd=['../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','error','name','index','map','ZendeskField','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','keys','includeAll','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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'];(function(_0x43b009,_0x11d4df){var _0x497ae1=function(_0x35da61){while(--_0x35da61){_0x43b009['push'](_0x43b009['shift']());}};_0x497ae1(++_0x11d4df);}(_0xb4cd,0x11b));var _0xdb4c=function(_0x3aa4f1,_0x4a4ee2){_0x3aa4f1=_0x3aa4f1-0x0;var _0x3b21ad=_0xb4cd[_0x3aa4f1];return _0x3b21ad;};'use strict';var emlformat=require(_0xdb4c('0x0'));var rimraf=require(_0xdb4c('0x1'));var zipdir=require(_0xdb4c('0x2'));var jsonpatch=require(_0xdb4c('0x3'));var rp=require(_0xdb4c('0x4'));var moment=require(_0xdb4c('0x5'));var BPromise=require(_0xdb4c('0x6'));var Mustache=require(_0xdb4c('0x7'));var util=require(_0xdb4c('0x8'));var path=require('path');var sox=require(_0xdb4c('0x9'));var csv=require('to-csv');var ejs=require(_0xdb4c('0xa'));var fs=require('fs');var fs_extra=require(_0xdb4c('0xb'));var _=require(_0xdb4c('0xc'));var squel=require(_0xdb4c('0xd'));var crypto=require(_0xdb4c('0xe'));var jsforce=require(_0xdb4c('0xf'));var deskjs=require(_0xdb4c('0x10'));var toCsv=require(_0xdb4c('0x11'));var querystring=require(_0xdb4c('0x12'));var Papa=require(_0xdb4c('0x13'));var Redis=require(_0xdb4c('0x14'));var authService=require(_0xdb4c('0x15'));var qs=require(_0xdb4c('0x16'));var as=require(_0xdb4c('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb4c('0x18'))(_0xdb4c('0x19'));var utils=require(_0xdb4c('0x1a'));var config=require(_0xdb4c('0x1b'));var licenseUtil=require(_0xdb4c('0x1c'));var db=require(_0xdb4c('0x1d'))['db'];function respondWithStatusCode(_0xb078cb,_0x283479){_0x283479=_0x283479||0xcc;return function(_0x23aca6){if(_0x23aca6){return _0xb078cb['sendStatus'](_0x283479);}return _0xb078cb[_0xdb4c('0x1e')](_0x283479)[_0xdb4c('0x1f')]();};}function respondWithResult(_0x4e804a,_0xff378f){_0xff378f=_0xff378f||0xc8;return function(_0x1118ae){if(_0x1118ae){return _0x4e804a[_0xdb4c('0x1e')](_0xff378f)[_0xdb4c('0x20')](_0x1118ae);}};}function respondWithFilteredResult(_0x255929,_0x11ec36){return function(_0x4cd070){if(_0x4cd070){var _0x859db9=typeof _0x11ec36['offset']==='undefined'&&typeof _0x11ec36[_0xdb4c('0x21')]===_0xdb4c('0x22');var _0x52c55a=_0x4cd070['count'];var _0x4b8ca8=_0x859db9?0x0:_0x11ec36['offset'];var _0x1e9642=_0x859db9?_0x4cd070[_0xdb4c('0x23')]:_0x11ec36[_0xdb4c('0x24')]+_0x11ec36['limit'];var _0x55c83f;if(_0x1e9642>=_0x52c55a){_0x1e9642=_0x52c55a;_0x55c83f=0xc8;}else{_0x55c83f=0xce;}_0x255929['status'](_0x55c83f);return _0x255929[_0xdb4c('0x25')](_0xdb4c('0x26'),_0x4b8ca8+'-'+_0x1e9642+'/'+_0x52c55a)[_0xdb4c('0x20')](_0x4cd070);}return null;};}function patchUpdates(_0x48e215){return function(_0x118307){try{jsonpatch[_0xdb4c('0x27')](_0x118307,_0x48e215,!![]);}catch(_0x19edf1){return BPromise[_0xdb4c('0x28')](_0x19edf1);}return _0x118307[_0xdb4c('0x29')]();};}function saveUpdates(_0x1c15ff,_0x1d892c){return function(_0x3e43a7){if(_0x3e43a7){return _0x3e43a7['update'](_0x1c15ff)[_0xdb4c('0x2a')](function(_0x2c550d){return _0x2c550d;});}return null;};}function removeEntity(_0x285725,_0x269c08){return function(_0x4faa00){if(_0x4faa00){return _0x4faa00['destroy']()[_0xdb4c('0x2a')](function(){_0x285725[_0xdb4c('0x1e')](0xcc)[_0xdb4c('0x1f')]();});}};}function handleEntityNotFound(_0x2a89e9,_0x4d4aec){return function(_0x1ccf21){if(!_0x1ccf21){_0x2a89e9['sendStatus'](0x194);}return _0x1ccf21;};}function handleError(_0x122392,_0x52d93b){_0x52d93b=_0x52d93b||0x1f4;return function(_0x8ea346){logger[_0xdb4c('0x2b')](_0x8ea346['stack']);if(_0x8ea346[_0xdb4c('0x2c')]){delete _0x8ea346[_0xdb4c('0x2c')];}_0x122392[_0xdb4c('0x1e')](_0x52d93b)['send'](_0x8ea346);};}exports[_0xdb4c('0x2d')]=function(_0x12b432,_0x53cea5){var _0x3fed44={},_0x93c61b={},_0xe9ff8c={'count':0x0,'rows':[]};var _0x2195b2=_[_0xdb4c('0x2e')](db[_0xdb4c('0x2f')]['rawAttributes'],function(_0x253679){return{'name':_0x253679[_0xdb4c('0x30')],'type':_0x253679[_0xdb4c('0x31')][_0xdb4c('0x32')]};});_0x93c61b[_0xdb4c('0x33')]=_[_0xdb4c('0x2e')](_0x2195b2,'name');_0x93c61b[_0xdb4c('0x34')]=_['keys'](_0x12b432['query']);_0x93c61b[_0xdb4c('0x35')]=_['intersection'](_0x93c61b['model'],_0x93c61b['query']);_0x3fed44[_0xdb4c('0x36')]=_[_0xdb4c('0x37')](_0x93c61b[_0xdb4c('0x33')],qs[_0xdb4c('0x38')](_0x12b432[_0xdb4c('0x34')][_0xdb4c('0x38')]));_0x3fed44[_0xdb4c('0x36')]=_0x3fed44[_0xdb4c('0x36')][_0xdb4c('0x39')]?_0x3fed44[_0xdb4c('0x36')]:_0x93c61b[_0xdb4c('0x33')];if(!_0x12b432['query'][_0xdb4c('0x3a')](_0xdb4c('0x3b'))){_0x3fed44[_0xdb4c('0x21')]=qs[_0xdb4c('0x21')](_0x12b432[_0xdb4c('0x34')][_0xdb4c('0x21')]);_0x3fed44['offset']=qs['offset'](_0x12b432[_0xdb4c('0x34')]['offset']);}_0x3fed44[_0xdb4c('0x3c')]=qs[_0xdb4c('0x3d')](_0x12b432[_0xdb4c('0x34')][_0xdb4c('0x3d')]);_0x3fed44[_0xdb4c('0x3e')]=qs[_0xdb4c('0x35')](_['pick'](_0x12b432[_0xdb4c('0x34')],_0x93c61b[_0xdb4c('0x35')]),_0x2195b2);if(_0x12b432[_0xdb4c('0x34')][_0xdb4c('0x3f')]){_0x3fed44[_0xdb4c('0x3e')]=_[_0xdb4c('0x40')](_0x3fed44[_0xdb4c('0x3e')],{'$or':_[_0xdb4c('0x2e')](_0x2195b2,function(_0x4d57c0){if(_0x4d57c0[_0xdb4c('0x31')]!==_0xdb4c('0x41')){var _0x45135f={};_0x45135f[_0x4d57c0[_0xdb4c('0x2c')]]={'$like':'%'+_0x12b432['query'][_0xdb4c('0x3f')]+'%'};return _0x45135f;}})});}_0x3fed44=_['merge']({},_0x3fed44,_0x12b432[_0xdb4c('0x42')]);var _0x3af1bb={'where':_0x3fed44[_0xdb4c('0x3e')]};return db[_0xdb4c('0x2f')]['count'](_0x3af1bb)[_0xdb4c('0x2a')](function(_0x3ee6f8){_0xe9ff8c['count']=_0x3ee6f8;if(_0x12b432[_0xdb4c('0x34')]['includeAll']){_0x3fed44[_0xdb4c('0x43')]=[{'all':!![]}];}return db['ZendeskField'][_0xdb4c('0x44')](_0x3fed44);})[_0xdb4c('0x2a')](function(_0x361511){_0xe9ff8c[_0xdb4c('0x45')]=_0x361511;return _0xe9ff8c;})['then'](respondWithFilteredResult(_0x53cea5,_0x3fed44))[_0xdb4c('0x46')](handleError(_0x53cea5,null));};exports['show']=function(_0x4ae0cf,_0x178f7b){var _0x2f7cb3={'raw':!![],'where':{'id':_0x4ae0cf['params']['id']}},_0x454d9b={};_0x454d9b['model']=_[_0xdb4c('0x47')](db[_0xdb4c('0x2f')]['rawAttributes']);_0x454d9b[_0xdb4c('0x34')]=_['keys'](_0x4ae0cf[_0xdb4c('0x34')]);_0x454d9b[_0xdb4c('0x35')]=_[_0xdb4c('0x37')](_0x454d9b[_0xdb4c('0x33')],_0x454d9b[_0xdb4c('0x34')]);_0x2f7cb3[_0xdb4c('0x36')]=_[_0xdb4c('0x37')](_0x454d9b['model'],qs['fields'](_0x4ae0cf[_0xdb4c('0x34')]['fields']));_0x2f7cb3[_0xdb4c('0x36')]=_0x2f7cb3[_0xdb4c('0x36')][_0xdb4c('0x39')]?_0x2f7cb3[_0xdb4c('0x36')]:_0x454d9b[_0xdb4c('0x33')];if(_0x4ae0cf[_0xdb4c('0x34')][_0xdb4c('0x48')]){_0x2f7cb3[_0xdb4c('0x43')]=[{'all':!![]}];}_0x2f7cb3=_[_0xdb4c('0x40')]({},_0x2f7cb3,_0x4ae0cf['options']);return db[_0xdb4c('0x2f')][_0xdb4c('0x49')](_0x2f7cb3)[_0xdb4c('0x2a')](handleEntityNotFound(_0x178f7b,null))[_0xdb4c('0x2a')](respondWithResult(_0x178f7b,null))['catch'](handleError(_0x178f7b,null));};exports[_0xdb4c('0x4a')]=function(_0x4a81b8,_0x460332){return db[_0xdb4c('0x2f')][_0xdb4c('0x4a')](_0x4a81b8['body'],{})['then'](respondWithResult(_0x460332,0xc9))[_0xdb4c('0x46')](handleError(_0x460332,null));};exports[_0xdb4c('0x4b')]=function(_0x1500a2,_0x38fdaf){if(_0x1500a2[_0xdb4c('0x4c')]['id']){delete _0x1500a2[_0xdb4c('0x4c')]['id'];}return db[_0xdb4c('0x2f')][_0xdb4c('0x49')]({'where':{'id':_0x1500a2[_0xdb4c('0x4d')]['id']}})[_0xdb4c('0x2a')](handleEntityNotFound(_0x38fdaf,null))[_0xdb4c('0x2a')](saveUpdates(_0x1500a2['body'],null))[_0xdb4c('0x2a')](respondWithResult(_0x38fdaf,null))[_0xdb4c('0x46')](handleError(_0x38fdaf,null));};exports['destroy']=function(_0x4bb23a,_0x4fbadb){return db[_0xdb4c('0x2f')]['find']({'where':{'id':_0x4bb23a[_0xdb4c('0x4d')]['id']}})[_0xdb4c('0x2a')](handleEntityNotFound(_0x4fbadb,null))[_0xdb4c('0x2a')](removeEntity(_0x4fbadb,null))['catch'](handleError(_0x4fbadb,null));}; \ No newline at end of file +var _0xb7ec=['options','includeAll','include','rows','params','merge','find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../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','sendStatus','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0xb7ec,0x137));var _0xcb7e=function(_0x493713,_0x1aa41f){_0x493713=_0x493713-0x0;var _0x3f66e0=_0xb7ec[_0x493713];return _0x3f66e0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcb7e('0x0'));var zipdir=require(_0xcb7e('0x1'));var jsonpatch=require(_0xcb7e('0x2'));var rp=require(_0xcb7e('0x3'));var moment=require(_0xcb7e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcb7e('0x5'));var util=require(_0xcb7e('0x6'));var path=require(_0xcb7e('0x7'));var sox=require(_0xcb7e('0x8'));var csv=require(_0xcb7e('0x9'));var ejs=require(_0xcb7e('0xa'));var fs=require('fs');var fs_extra=require(_0xcb7e('0xb'));var _=require('lodash');var squel=require(_0xcb7e('0xc'));var crypto=require('crypto');var jsforce=require(_0xcb7e('0xd'));var deskjs=require(_0xcb7e('0xe'));var toCsv=require(_0xcb7e('0x9'));var querystring=require('querystring');var Papa=require(_0xcb7e('0xf'));var Redis=require(_0xcb7e('0x10'));var authService=require(_0xcb7e('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb7e('0x12'))(_0xcb7e('0x13'));var utils=require(_0xcb7e('0x14'));var config=require(_0xcb7e('0x15'));var licenseUtil=require(_0xcb7e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f7086,_0x5d1ffb){_0x5d1ffb=_0x5d1ffb||0xcc;return function(_0x330dfb){if(_0x330dfb){return _0x4f7086['sendStatus'](_0x5d1ffb);}return _0x4f7086[_0xcb7e('0x17')](_0x5d1ffb)[_0xcb7e('0x18')]();};}function respondWithResult(_0x523e56,_0x5746b5){_0x5746b5=_0x5746b5||0xc8;return function(_0x4b7857){if(_0x4b7857){return _0x523e56[_0xcb7e('0x17')](_0x5746b5)[_0xcb7e('0x19')](_0x4b7857);}};}function respondWithFilteredResult(_0x50bbef,_0x2c8e42){return function(_0x1e594b){if(_0x1e594b){var _0x50bbb2=typeof _0x2c8e42[_0xcb7e('0x1a')]===_0xcb7e('0x1b')&&typeof _0x2c8e42['limit']==='undefined';var _0x1b0fa2=_0x1e594b[_0xcb7e('0x1c')];var _0x40e87a=_0x50bbb2?0x0:_0x2c8e42[_0xcb7e('0x1a')];var _0x557386=_0x50bbb2?_0x1e594b[_0xcb7e('0x1c')]:_0x2c8e42[_0xcb7e('0x1a')]+_0x2c8e42[_0xcb7e('0x1d')];var _0x1c2892;if(_0x557386>=_0x1b0fa2){_0x557386=_0x1b0fa2;_0x1c2892=0xc8;}else{_0x1c2892=0xce;}_0x50bbef['status'](_0x1c2892);return _0x50bbef[_0xcb7e('0x1e')](_0xcb7e('0x1f'),_0x40e87a+'-'+_0x557386+'/'+_0x1b0fa2)[_0xcb7e('0x19')](_0x1e594b);}return null;};}function patchUpdates(_0x146661){return function(_0x3919af){try{jsonpatch[_0xcb7e('0x20')](_0x3919af,_0x146661,!![]);}catch(_0x597524){return BPromise[_0xcb7e('0x21')](_0x597524);}return _0x3919af[_0xcb7e('0x22')]();};}function saveUpdates(_0x4c441e,_0x370c49){return function(_0x2b243b){if(_0x2b243b){return _0x2b243b[_0xcb7e('0x23')](_0x4c441e)[_0xcb7e('0x24')](function(_0x5d6aab){return _0x5d6aab;});}return null;};}function removeEntity(_0x2aeed7,_0x3a7f7f){return function(_0x16c576){if(_0x16c576){return _0x16c576['destroy']()['then'](function(){_0x2aeed7[_0xcb7e('0x17')](0xcc)[_0xcb7e('0x18')]();});}};}function handleEntityNotFound(_0x5b3998,_0x56a1a6){return function(_0x2f4199){if(!_0x2f4199){_0x5b3998[_0xcb7e('0x25')](0x194);}return _0x2f4199;};}function handleError(_0x35f543,_0x322381){_0x322381=_0x322381||0x1f4;return function(_0x265a88){logger[_0xcb7e('0x26')](_0x265a88[_0xcb7e('0x27')]);if(_0x265a88[_0xcb7e('0x28')]){delete _0x265a88[_0xcb7e('0x28')];}_0x35f543[_0xcb7e('0x17')](_0x322381)[_0xcb7e('0x29')](_0x265a88);};}exports[_0xcb7e('0x2a')]=function(_0x264de2,_0x593864){var _0x49f318={},_0xc0102e={},_0x37fdc5={'count':0x0,'rows':[]};var _0x34d51c=_[_0xcb7e('0x2b')](db[_0xcb7e('0x2c')][_0xcb7e('0x2d')],function(_0x211aac){return{'name':_0x211aac[_0xcb7e('0x2e')],'type':_0x211aac[_0xcb7e('0x2f')][_0xcb7e('0x30')]};});_0xc0102e[_0xcb7e('0x31')]=_[_0xcb7e('0x2b')](_0x34d51c,_0xcb7e('0x28'));_0xc0102e[_0xcb7e('0x32')]=_[_0xcb7e('0x33')](_0x264de2['query']);_0xc0102e[_0xcb7e('0x34')]=_[_0xcb7e('0x35')](_0xc0102e[_0xcb7e('0x31')],_0xc0102e[_0xcb7e('0x32')]);_0x49f318['attributes']=_[_0xcb7e('0x35')](_0xc0102e[_0xcb7e('0x31')],qs[_0xcb7e('0x36')](_0x264de2[_0xcb7e('0x32')]['fields']));_0x49f318[_0xcb7e('0x37')]=_0x49f318[_0xcb7e('0x37')][_0xcb7e('0x38')]?_0x49f318[_0xcb7e('0x37')]:_0xc0102e[_0xcb7e('0x31')];if(!_0x264de2[_0xcb7e('0x32')][_0xcb7e('0x39')]('nolimit')){_0x49f318['limit']=qs[_0xcb7e('0x1d')](_0x264de2[_0xcb7e('0x32')]['limit']);_0x49f318['offset']=qs['offset'](_0x264de2[_0xcb7e('0x32')][_0xcb7e('0x1a')]);}_0x49f318[_0xcb7e('0x3a')]=qs['sort'](_0x264de2[_0xcb7e('0x32')][_0xcb7e('0x3b')]);_0x49f318[_0xcb7e('0x3c')]=qs['filters'](_[_0xcb7e('0x3d')](_0x264de2['query'],_0xc0102e[_0xcb7e('0x34')]),_0x34d51c);if(_0x264de2[_0xcb7e('0x32')][_0xcb7e('0x3e')]){_0x49f318[_0xcb7e('0x3c')]=_['merge'](_0x49f318[_0xcb7e('0x3c')],{'$or':_[_0xcb7e('0x2b')](_0x34d51c,function(_0x3c2eee){if(_0x3c2eee['type']!==_0xcb7e('0x3f')){var _0xdb318e={};_0xdb318e[_0x3c2eee[_0xcb7e('0x28')]]={'$like':'%'+_0x264de2[_0xcb7e('0x32')][_0xcb7e('0x3e')]+'%'};return _0xdb318e;}})});}_0x49f318=_['merge']({},_0x49f318,_0x264de2[_0xcb7e('0x40')]);var _0x4944ab={'where':_0x49f318[_0xcb7e('0x3c')]};return db[_0xcb7e('0x2c')][_0xcb7e('0x1c')](_0x4944ab)[_0xcb7e('0x24')](function(_0x28104a){_0x37fdc5[_0xcb7e('0x1c')]=_0x28104a;if(_0x264de2[_0xcb7e('0x32')][_0xcb7e('0x41')]){_0x49f318[_0xcb7e('0x42')]=[{'all':!![]}];}return db[_0xcb7e('0x2c')]['findAll'](_0x49f318);})[_0xcb7e('0x24')](function(_0x56d76a){_0x37fdc5[_0xcb7e('0x43')]=_0x56d76a;return _0x37fdc5;})[_0xcb7e('0x24')](respondWithFilteredResult(_0x593864,_0x49f318))['catch'](handleError(_0x593864,null));};exports['show']=function(_0x592eab,_0x3b971f){var _0x3d27ed={'raw':!![],'where':{'id':_0x592eab[_0xcb7e('0x44')]['id']}},_0x3e1f3c={};_0x3e1f3c['model']=_[_0xcb7e('0x33')](db['ZendeskField'][_0xcb7e('0x2d')]);_0x3e1f3c[_0xcb7e('0x32')]=_[_0xcb7e('0x33')](_0x592eab['query']);_0x3e1f3c['filters']=_[_0xcb7e('0x35')](_0x3e1f3c[_0xcb7e('0x31')],_0x3e1f3c[_0xcb7e('0x32')]);_0x3d27ed[_0xcb7e('0x37')]=_['intersection'](_0x3e1f3c[_0xcb7e('0x31')],qs[_0xcb7e('0x36')](_0x592eab[_0xcb7e('0x32')][_0xcb7e('0x36')]));_0x3d27ed[_0xcb7e('0x37')]=_0x3d27ed[_0xcb7e('0x37')][_0xcb7e('0x38')]?_0x3d27ed[_0xcb7e('0x37')]:_0x3e1f3c[_0xcb7e('0x31')];if(_0x592eab[_0xcb7e('0x32')][_0xcb7e('0x41')]){_0x3d27ed[_0xcb7e('0x42')]=[{'all':!![]}];}_0x3d27ed=_[_0xcb7e('0x45')]({},_0x3d27ed,_0x592eab[_0xcb7e('0x40')]);return db[_0xcb7e('0x2c')][_0xcb7e('0x46')](_0x3d27ed)[_0xcb7e('0x24')](handleEntityNotFound(_0x3b971f,null))[_0xcb7e('0x24')](respondWithResult(_0x3b971f,null))[_0xcb7e('0x47')](handleError(_0x3b971f,null));};exports['create']=function(_0x539ca5,_0x41f0c8){return db[_0xcb7e('0x2c')][_0xcb7e('0x48')](_0x539ca5['body'],{})[_0xcb7e('0x24')](respondWithResult(_0x41f0c8,0xc9))['catch'](handleError(_0x41f0c8,null));};exports['update']=function(_0x41c9e3,_0x595fcf){if(_0x41c9e3[_0xcb7e('0x49')]['id']){delete _0x41c9e3[_0xcb7e('0x49')]['id'];}return db['ZendeskField'][_0xcb7e('0x46')]({'where':{'id':_0x41c9e3[_0xcb7e('0x44')]['id']}})[_0xcb7e('0x24')](handleEntityNotFound(_0x595fcf,null))[_0xcb7e('0x24')](saveUpdates(_0x41c9e3['body'],null))['then'](respondWithResult(_0x595fcf,null))[_0xcb7e('0x47')](handleError(_0x595fcf,null));};exports[_0xcb7e('0x4a')]=function(_0x257c3c,_0x3d1cba){return db[_0xcb7e('0x2c')][_0xcb7e('0x46')]({'where':{'id':_0x257c3c[_0xcb7e('0x44')]['id']}})[_0xcb7e('0x24')](handleEntityNotFound(_0x3d1cba,null))[_0xcb7e('0x24')](removeEntity(_0x3d1cba,null))[_0xcb7e('0x47')](handleError(_0x3d1cba,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 8951d0e..05179db 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 _0x43ac=['zendesk_unique_index','idField','FieldId','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x43ac,0x148));var _0xc43a=function(_0x39edb2,_0x6b06b7){_0x39edb2=_0x39edb2-0x0;var _0x461cbd=_0x43ac[_0x39edb2];return _0x461cbd;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc43a('0x0'));var moment=require(_0xc43a('0x1'));var BPromise=require(_0xc43a('0x2'));var rp=require(_0xc43a('0x3'));var fs=require('fs');var path=require(_0xc43a('0x4'));var rimraf=require(_0xc43a('0x5'));var config=require(_0xc43a('0x6'));var attributes=require(_0xc43a('0x7'));module[_0xc43a('0x8')]=function(_0x349c81,_0x101573){return _0x349c81['define'](_0xc43a('0x9'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0xc43a('0xa'),'fields':[_0xc43a('0xb'),_0xc43a('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa47b=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash'];(function(_0xe90170,_0x2b4c13){var _0x48d611=function(_0x2ca11a){while(--_0x2ca11a){_0xe90170['push'](_0xe90170['shift']());}};_0x48d611(++_0x2b4c13);}(_0xa47b,0x192));var _0xba47=function(_0x529f4e,_0xd8911a){_0x529f4e=_0x529f4e-0x0;var _0x1bb663=_0xa47b[_0x529f4e];return _0x1bb663;};'use strict';var _=require(_0xba47('0x0'));var util=require(_0xba47('0x1'));var logger=require(_0xba47('0x2'))(_0xba47('0x3'));var moment=require(_0xba47('0x4'));var BPromise=require('bluebird');var rp=require(_0xba47('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xba47('0x6'));var config=require(_0xba47('0x7'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0xb7b1f0,_0x3852a0){return _0xb7b1f0['define'](_0xba47('0x8'),attributes,{'tableName':_0xba47('0x9'),'paranoid':![],'indexes':[{'name':_0xba47('0xa'),'fields':[_0xba47('0xb'),_0xba47('0xc')],'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 ac97900..80648a8 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 _0xdf6e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment'];(function(_0x64aff8,_0x106082){var _0x5488a3=function(_0x36969c){while(--_0x36969c){_0x64aff8['push'](_0x64aff8['shift']());}};_0x5488a3(++_0x106082);}(_0xdf6e,0x70));var _0xedf6=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xdf6e[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xedf6('0x0'));var util=require(_0xedf6('0x1'));var moment=require(_0xedf6('0x2'));var BPromise=require(_0xedf6('0x3'));var rs=require(_0xedf6('0x4'));var fs=require('fs');var Redis=require(_0xedf6('0x5'));var db=require(_0xedf6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xedf6('0x7'))(_0xedf6('0x8'));var config=require(_0xedf6('0x9'));var jayson=require(_0xedf6('0xa'));var client=jayson[_0xedf6('0xb')][_0xedf6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ff347,_0x14c532,_0x24e70f){return new BPromise(function(_0x591d78,_0x4d48a3){return client['request'](_0x1ff347,_0x24e70f)[_0xedf6('0xd')](function(_0xdc310b){logger[_0xedf6('0xe')](_0xedf6('0xf'),_0x14c532,_0xedf6('0x10'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x14c532,_0xedf6('0x10'),JSON[_0xedf6('0x11')](_0xdc310b));if(_0xdc310b['error']){if(_0xdc310b['error'][_0xedf6('0x12')]===0x1f4){logger[_0xedf6('0x13')](_0xedf6('0xf'),_0x14c532,_0xdc310b[_0xedf6('0x13')][_0xedf6('0x14')]);return _0x4d48a3(_0xdc310b[_0xedf6('0x13')][_0xedf6('0x14')]);}logger[_0xedf6('0x13')](_0xedf6('0xf'),_0x14c532,_0xdc310b['error'][_0xedf6('0x14')]);return _0x591d78(_0xdc310b[_0xedf6('0x13')][_0xedf6('0x14')]);}else{logger[_0xedf6('0xe')]('ZendeskField,\x20%s,\x20%s',_0x14c532,'request\x20sent');_0x591d78(_0xdc310b[_0xedf6('0x15')][_0xedf6('0x14')]);}})[_0xedf6('0x16')](function(_0x22c900){logger['error'](_0xedf6('0xf'),_0x14c532,_0x22c900);_0x4d48a3(_0x22c900);});});} \ No newline at end of file +var _0x0707=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x1e2459,_0x40e30c){var _0x30c2e0=function(_0x11e070){while(--_0x11e070){_0x1e2459['push'](_0x1e2459['shift']());}};_0x30c2e0(++_0x40e30c);}(_0x0707,0x1c1));var _0x7070=function(_0x4a6c43,_0x263a12){_0x4a6c43=_0x4a6c43-0x0;var _0x436709=_0x0707[_0x4a6c43];return _0x436709;};'use strict';var _=require(_0x7070('0x0'));var util=require('util');var moment=require(_0x7070('0x1'));var BPromise=require('bluebird');var rs=require(_0x7070('0x2'));var fs=require('fs');var Redis=require(_0x7070('0x3'));var db=require(_0x7070('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7070('0x5'));var config=require(_0x7070('0x6'));var jayson=require(_0x7070('0x7'));var client=jayson['client'][_0x7070('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44cdf7,_0x42249c,_0x18f67f){return new BPromise(function(_0x3c9c95,_0x228a84){return client[_0x7070('0x9')](_0x44cdf7,_0x18f67f)['then'](function(_0x2a1040){logger[_0x7070('0xa')](_0x7070('0xb'),_0x42249c,_0x7070('0xc'));logger[_0x7070('0xd')](_0x7070('0xe'),_0x42249c,_0x7070('0xc'),JSON[_0x7070('0xf')](_0x2a1040));if(_0x2a1040['error']){if(_0x2a1040[_0x7070('0x10')][_0x7070('0x11')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x42249c,_0x2a1040['error'][_0x7070('0x12')]);return _0x228a84(_0x2a1040[_0x7070('0x10')][_0x7070('0x12')]);}logger[_0x7070('0x10')](_0x7070('0xb'),_0x42249c,_0x2a1040[_0x7070('0x10')][_0x7070('0x12')]);return _0x3c9c95(_0x2a1040[_0x7070('0x10')][_0x7070('0x12')]);}else{logger[_0x7070('0xa')](_0x7070('0xb'),_0x42249c,_0x7070('0xc'));_0x3c9c95(_0x2a1040[_0x7070('0x13')][_0x7070('0x12')]);}})[_0x7070('0x14')](function(_0x39fd5b){logger[_0x7070('0x10')]('ZendeskField,\x20%s,\x20%s',_0x42249c,_0x39fd5b);_0x228a84(_0x39fd5b);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 1b6ad4b..1bdda7f 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 _0x9da7=['./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2459d3,_0x13a3e1){var _0x5c7785=function(_0x4634bb){while(--_0x4634bb){_0x2459d3['push'](_0x2459d3['shift']());}};_0x5c7785(++_0x13a3e1);}(_0x9da7,0x1db));var _0x79da=function(_0x20b29c,_0xe22528){_0x20b29c=_0x20b29c-0x0;var _0x20d81b=_0x9da7[_0x20b29c];return _0x20d81b;};'use strict';var multer=require('multer');var util=require(_0x79da('0x0'));var path=require(_0x79da('0x1'));var timeout=require(_0x79da('0x2'));var express=require(_0x79da('0x3'));var router=express[_0x79da('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x79da('0x5'));var interaction=require(_0x79da('0x6'));var config=require(_0x79da('0x7'));var controller=require(_0x79da('0x8'));router['get']('/',auth[_0x79da('0x9')](),controller[_0x79da('0xa')]);router[_0x79da('0xb')](_0x79da('0xc'),auth[_0x79da('0x9')](),controller[_0x79da('0xd')]);router[_0x79da('0xb')]('/:id/configurations',auth[_0x79da('0x9')](),controller[_0x79da('0xe')]);router[_0x79da('0xb')](_0x79da('0xf'),auth[_0x79da('0x9')](),controller['getFields']);router[_0x79da('0x10')]('/',auth['isAuthenticated'](),controller[_0x79da('0x11')]);router[_0x79da('0x10')]('/:id/configurations',auth[_0x79da('0x9')](),controller[_0x79da('0x12')]);router[_0x79da('0x13')](_0x79da('0xc'),auth[_0x79da('0x9')](),controller[_0x79da('0x14')]);router[_0x79da('0x15')]('/:id',auth[_0x79da('0x9')](),controller[_0x79da('0x16')]);module['exports']=router; \ No newline at end of file +var _0x6817=['addConfiguration','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intZohoAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','post'];(function(_0x81e9da,_0x57c4de){var _0x3eef33=function(_0x246d9f){while(--_0x246d9f){_0x81e9da['push'](_0x81e9da['shift']());}};_0x3eef33(++_0x57c4de);}(_0x6817,0xcd));var _0x7681=function(_0x4dce23,_0x121525){_0x4dce23=_0x4dce23-0x0;var _0x338b71=_0x6817[_0x4dce23];return _0x338b71;};'use strict';var multer=require(_0x7681('0x0'));var util=require(_0x7681('0x1'));var path=require('path');var timeout=require(_0x7681('0x2'));var express=require(_0x7681('0x3'));var router=express[_0x7681('0x4')]();var fs_extra=require(_0x7681('0x5'));var auth=require(_0x7681('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7681('0x7'));router[_0x7681('0x8')]('/',auth[_0x7681('0x9')](),controller['index']);router[_0x7681('0x8')](_0x7681('0xa'),auth['isAuthenticated'](),controller[_0x7681('0xb')]);router['get'](_0x7681('0xc'),auth[_0x7681('0x9')](),controller['getConfigurations']);router['get'](_0x7681('0xd'),auth[_0x7681('0x9')](),controller['getFields']);router[_0x7681('0xe')]('/',auth[_0x7681('0x9')](),controller['create']);router[_0x7681('0xe')]('/:id/configurations',auth[_0x7681('0x9')](),controller[_0x7681('0xf')]);router[_0x7681('0x10')](_0x7681('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x7681('0x11')](_0x7681('0xa'),auth[_0x7681('0x9')](),controller[_0x7681('0x12')]);module[_0x7681('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 0698c1a..9cf3806 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 _0x5b02=['exports','STRING','sequelize'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x5b02,0xe9));var _0x25b0=function(_0x3ac7b6,_0x57cab2){_0x3ac7b6=_0x3ac7b6-0x0;var _0x2dda68=_0x5b02[_0x3ac7b6];return _0x2dda68;};'use strict';var Sequelize=require(_0x25b0('0x0'));module[_0x25b0('0x1')]={'name':{'type':Sequelize[_0x25b0('0x2')]},'description':{'type':Sequelize[_0x25b0('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x25b0('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x25b0('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x25b0('0x2')]},'refreshToken':{'type':Sequelize[_0x25b0('0x2')]}}; \ No newline at end of file +var _0xd64b=['STRING','sequelize'];(function(_0x1af575,_0x56cc06){var _0x1f2c36=function(_0x420c2e){while(--_0x420c2e){_0x1af575['push'](_0x1af575['shift']());}};_0x1f2c36(++_0x56cc06);}(_0xd64b,0xc1));var _0xbd64=function(_0x42880f,_0x4425a5){_0x42880f=_0x42880f-0x0;var _0x14054c=_0xd64b[_0x42880f];return _0x14054c;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd64('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xbd64('0x1')]},'zone':{'type':Sequelize[_0xbd64('0x1')]},'clientId':{'type':Sequelize[_0xbd64('0x1')]},'clientSecret':{'type':Sequelize[_0xbd64('0x1')]},'serverUrl':{'type':Sequelize[_0xbd64('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 5998fb5..93b8c0b 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 _0x46bb=['remove','includes','api_name','length','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','getConfigurations','findOne','ZohoConfiguration','nolimit','AccountId','Subjects','Descriptions','getDescriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','refreshToken','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type'];(function(_0x334492,_0x1d3e6a){var _0x3a83e6=function(_0x11fdb0){while(--_0x11fdb0){_0x334492['push'](_0x334492['shift']());}};_0x3a83e6(++_0x1d3e6a);}(_0x46bb,0x1a7));var _0xb46b=function(_0x248afa,_0xc057df){_0x248afa=_0x248afa-0x0;var _0x26d2d2=_0x46bb[_0x248afa];return _0x26d2d2;};'use strict';var emlformat=require(_0xb46b('0x0'));var rimraf=require(_0xb46b('0x1'));var zipdir=require(_0xb46b('0x2'));var jsonpatch=require(_0xb46b('0x3'));var rp=require(_0xb46b('0x4'));var moment=require(_0xb46b('0x5'));var BPromise=require(_0xb46b('0x6'));var Mustache=require(_0xb46b('0x7'));var util=require(_0xb46b('0x8'));var path=require(_0xb46b('0x9'));var sox=require(_0xb46b('0xa'));var csv=require(_0xb46b('0xb'));var ejs=require(_0xb46b('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb46b('0xd'));var squel=require(_0xb46b('0xe'));var crypto=require(_0xb46b('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xb46b('0x10'));var toCsv=require(_0xb46b('0xb'));var querystring=require('querystring');var Papa=require(_0xb46b('0x11'));var Redis=require(_0xb46b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb46b('0x13'));var as=require(_0xb46b('0x14'));var hardwareService=require(_0xb46b('0x15'));var logger=require('../../config/logger')(_0xb46b('0x16'));var utils=require(_0xb46b('0x17'));var config=require(_0xb46b('0x18'));var licenseUtil=require(_0xb46b('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb46b('0x1a'));function respondWithStatusCode(_0x588e89,_0x40bf43){_0x40bf43=_0x40bf43||0xcc;return function(_0x45b2d4){if(_0x45b2d4){return _0x588e89[_0xb46b('0x1b')](_0x40bf43);}return _0x588e89['status'](_0x40bf43)[_0xb46b('0x1c')]();};}function respondWithResult(_0x15577f,_0x294963){_0x294963=_0x294963||0xc8;return function(_0x9052d9){if(_0x9052d9){return _0x15577f[_0xb46b('0x1d')](_0x294963)[_0xb46b('0x1e')](_0x9052d9);}};}function respondWithFilteredResult(_0x4ab34f,_0x126d09){return function(_0x1e680b){if(_0x1e680b){var _0x141017=typeof _0x126d09[_0xb46b('0x1f')]===_0xb46b('0x20')&&typeof _0x126d09[_0xb46b('0x21')]===_0xb46b('0x20');var _0x5ef21f=_0x1e680b['count'];var _0x53d9e8=_0x141017?0x0:_0x126d09[_0xb46b('0x1f')];var _0x599381=_0x141017?_0x1e680b[_0xb46b('0x22')]:_0x126d09[_0xb46b('0x1f')]+_0x126d09[_0xb46b('0x21')];var _0x42fb8e;if(_0x599381>=_0x5ef21f){_0x599381=_0x5ef21f;_0x42fb8e=0xc8;}else{_0x42fb8e=0xce;}_0x4ab34f['status'](_0x42fb8e);return _0x4ab34f[_0xb46b('0x23')](_0xb46b('0x24'),_0x53d9e8+'-'+_0x599381+'/'+_0x5ef21f)[_0xb46b('0x1e')](_0x1e680b);}return null;};}function patchUpdates(_0x44db50){return function(_0x6eb664){try{jsonpatch[_0xb46b('0x25')](_0x6eb664,_0x44db50,!![]);}catch(_0x4d8231){return BPromise[_0xb46b('0x26')](_0x4d8231);}return _0x6eb664[_0xb46b('0x27')]();};}function saveUpdates(_0x47792a,_0x339773){return function(_0x2824d2){if(_0x2824d2){return _0x2824d2[_0xb46b('0x28')](_0x47792a)['then'](function(_0x1d25a6){return _0x1d25a6;});}return null;};}function removeEntity(_0x3857c4,_0x2e8183){return function(_0x2aef9b){if(_0x2aef9b){return _0x2aef9b[_0xb46b('0x29')]()[_0xb46b('0x2a')](function(){_0x3857c4[_0xb46b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x362d42,_0x9ba327){return function(_0x2a0cb1){if(!_0x2a0cb1){_0x362d42[_0xb46b('0x1b')](0x194);}return _0x2a0cb1;};}function handleError(_0x1ba599,_0x44eff7){_0x44eff7=_0x44eff7||0x1f4;return function(_0x29be94){logger[_0xb46b('0x2b')](_0x29be94[_0xb46b('0x2c')]);if(_0x29be94['name']){delete _0x29be94[_0xb46b('0x2d')];}_0x1ba599['status'](_0x44eff7)['send'](_0x29be94);};}exports[_0xb46b('0x2e')]=function(_0x21557d,_0x9b87c6){var _0xaaaa1d={},_0x2e71b8={},_0x5599ae={'count':0x0,'rows':[]};var _0x19067d=_[_0xb46b('0x2f')](db[_0xb46b('0x30')][_0xb46b('0x31')],function(_0x3d2602){return{'name':_0x3d2602[_0xb46b('0x32')],'type':_0x3d2602[_0xb46b('0x33')][_0xb46b('0x34')]};});_0x2e71b8[_0xb46b('0x35')]=_['map'](_0x19067d,_0xb46b('0x2d'));_0x2e71b8['query']=_[_0xb46b('0x36')](_0x21557d[_0xb46b('0x37')]);_0x2e71b8[_0xb46b('0x38')]=_['intersection'](_0x2e71b8[_0xb46b('0x35')],_0x2e71b8['query']);_0xaaaa1d[_0xb46b('0x39')]=_[_0xb46b('0x3a')](_0x2e71b8[_0xb46b('0x35')],qs[_0xb46b('0x3b')](_0x21557d[_0xb46b('0x37')][_0xb46b('0x3b')]));_0xaaaa1d[_0xb46b('0x39')]=_0xaaaa1d[_0xb46b('0x39')]['length']?_0xaaaa1d[_0xb46b('0x39')]:_0x2e71b8[_0xb46b('0x35')];if(!_0x21557d['query'][_0xb46b('0x3c')]('nolimit')){_0xaaaa1d[_0xb46b('0x21')]=qs[_0xb46b('0x21')](_0x21557d[_0xb46b('0x37')][_0xb46b('0x21')]);_0xaaaa1d[_0xb46b('0x1f')]=qs['offset'](_0x21557d[_0xb46b('0x37')][_0xb46b('0x1f')]);}_0xaaaa1d[_0xb46b('0x3d')]=qs['sort'](_0x21557d[_0xb46b('0x37')][_0xb46b('0x3e')]);_0xaaaa1d[_0xb46b('0x3f')]=qs[_0xb46b('0x38')](_[_0xb46b('0x40')](_0x21557d[_0xb46b('0x37')],_0x2e71b8['filters']),_0x19067d);if(_0x21557d[_0xb46b('0x37')][_0xb46b('0x41')]){_0xaaaa1d[_0xb46b('0x3f')]=_['merge'](_0xaaaa1d['where'],{'$or':_[_0xb46b('0x2f')](_0x19067d,function(_0x24ed12){if(_0x24ed12[_0xb46b('0x33')]!=='VIRTUAL'){var _0x3eed90={};_0x3eed90[_0x24ed12[_0xb46b('0x2d')]]={'$like':'%'+_0x21557d[_0xb46b('0x37')][_0xb46b('0x41')]+'%'};return _0x3eed90;}})});}_0xaaaa1d=_[_0xb46b('0x42')]({},_0xaaaa1d,_0x21557d['options']);var _0x265285={'where':_0xaaaa1d['where']};return db['ZohoAccount'][_0xb46b('0x22')](_0x265285)[_0xb46b('0x2a')](function(_0x4eaa29){_0x5599ae['count']=_0x4eaa29;if(_0x21557d[_0xb46b('0x37')][_0xb46b('0x43')]){_0xaaaa1d[_0xb46b('0x44')]=[{'all':!![]}];}return db[_0xb46b('0x30')][_0xb46b('0x45')](_0xaaaa1d);})['then'](function(_0x4480ab){_0x5599ae['rows']=_0x4480ab;return _0x5599ae;})['then'](respondWithFilteredResult(_0x9b87c6,_0xaaaa1d))[_0xb46b('0x46')](handleError(_0x9b87c6,null));};exports[_0xb46b('0x47')]=function(_0x5a5af6,_0x27bc15){var _0x4711c4={'raw':![],'where':{'id':_0x5a5af6['params']['id']}},_0x5478bf={};_0x5478bf[_0xb46b('0x35')]=_[_0xb46b('0x36')](db[_0xb46b('0x30')]['rawAttributes']);_0x5478bf[_0xb46b('0x37')]=_[_0xb46b('0x36')](_0x5a5af6[_0xb46b('0x37')]);_0x5478bf[_0xb46b('0x38')]=_[_0xb46b('0x3a')](_0x5478bf['model'],_0x5478bf[_0xb46b('0x37')]);_0x4711c4[_0xb46b('0x39')]=_['intersection'](_0x5478bf[_0xb46b('0x35')],qs[_0xb46b('0x3b')](_0x5a5af6[_0xb46b('0x37')][_0xb46b('0x3b')]));_0x4711c4[_0xb46b('0x39')]=_0x4711c4[_0xb46b('0x39')]['length']?_0x4711c4[_0xb46b('0x39')]:_0x5478bf[_0xb46b('0x35')];if(_0x5a5af6['query'][_0xb46b('0x43')]){_0x4711c4[_0xb46b('0x44')]=[{'all':!![]}];}_0x4711c4=_[_0xb46b('0x42')]({},_0x4711c4,_0x5a5af6[_0xb46b('0x48')]);return db[_0xb46b('0x30')][_0xb46b('0x49')](_0x4711c4)[_0xb46b('0x2a')](handleEntityNotFound(_0x27bc15,null))['then'](respondWithResult(_0x27bc15,null))[_0xb46b('0x46')](handleError(_0x27bc15,null));};exports[_0xb46b('0x4a')]=function(_0x5624a8,_0x339481){return db[_0xb46b('0x30')]['create'](_0x5624a8['body'],{})[_0xb46b('0x2a')](respondWithResult(_0x339481,0xc9))[_0xb46b('0x46')](handleError(_0x339481,null));};exports[_0xb46b('0x28')]=function(_0x1374f7,_0x4e3207){if(_0x1374f7[_0xb46b('0x4b')]['id']){delete _0x1374f7[_0xb46b('0x4b')]['id'];}return db[_0xb46b('0x30')][_0xb46b('0x49')]({'where':{'id':_0x1374f7[_0xb46b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4e3207,null))[_0xb46b('0x2a')](saveUpdates(_0x1374f7[_0xb46b('0x4b')],null))[_0xb46b('0x2a')](respondWithResult(_0x4e3207,null))[_0xb46b('0x46')](handleError(_0x4e3207,null));};exports[_0xb46b('0x29')]=function(_0x2caa9c,_0x18035c){return db[_0xb46b('0x30')][_0xb46b('0x49')]({'where':{'id':_0x2caa9c['params']['id']}})['then'](handleEntityNotFound(_0x18035c,null))[_0xb46b('0x2a')](removeEntity(_0x18035c,null))[_0xb46b('0x46')](handleError(_0x18035c,null));};exports[_0xb46b('0x4d')]=function(_0xd683d7,_0x384f09,_0xf8338){var _0x4d22e5={};var _0x94714e={};var _0x2abcb8;var _0x5d2ce2;return db[_0xb46b('0x30')][_0xb46b('0x4e')]({'where':{'id':_0xd683d7[_0xb46b('0x4c')]['id']}})[_0xb46b('0x2a')](handleEntityNotFound(_0x384f09,null))[_0xb46b('0x2a')](function(_0x413113){if(_0x413113){_0x2abcb8=_0x413113;_0x94714e[_0xb46b('0x35')]=_[_0xb46b('0x36')](db[_0xb46b('0x4f')][_0xb46b('0x31')]);_0x94714e[_0xb46b('0x37')]=_['keys'](_0xd683d7[_0xb46b('0x37')]);_0x94714e[_0xb46b('0x38')]=_[_0xb46b('0x3a')](_0x94714e[_0xb46b('0x35')],_0x94714e[_0xb46b('0x37')]);_0x4d22e5[_0xb46b('0x39')]=_['intersection'](_0x94714e[_0xb46b('0x35')],qs[_0xb46b('0x3b')](_0xd683d7['query'][_0xb46b('0x3b')]));_0x4d22e5[_0xb46b('0x39')]=_0x4d22e5['attributes']['length']?_0x4d22e5[_0xb46b('0x39')]:_0x94714e[_0xb46b('0x35')];_0x4d22e5[_0xb46b('0x3d')]=qs[_0xb46b('0x3e')](_0xd683d7[_0xb46b('0x37')]['sort']);_0x4d22e5[_0xb46b('0x3f')]=qs[_0xb46b('0x38')](_['pick'](_0xd683d7[_0xb46b('0x37')],_0x94714e[_0xb46b('0x38')]));if(_0xd683d7[_0xb46b('0x37')][_0xb46b('0x41')]){_0x4d22e5[_0xb46b('0x3f')]=_[_0xb46b('0x42')](_0x4d22e5[_0xb46b('0x3f')],{'$or':_['map'](_0x4d22e5[_0xb46b('0x39')],function(_0x384ef7){var _0x4c8dac={};_0x4c8dac[_0x384ef7]={'$like':'%'+_0xd683d7[_0xb46b('0x37')]['filter']+'%'};return _0x4c8dac;})});}_0x4d22e5=_[_0xb46b('0x42')]({},_0x4d22e5,_0xd683d7[_0xb46b('0x48')]);return _0x2abcb8[_0xb46b('0x4d')](_0x4d22e5);}})[_0xb46b('0x2a')](function(_0x470664){if(_0x470664){_0x5d2ce2=_0x470664['length'];if(!_0xd683d7[_0xb46b('0x37')][_0xb46b('0x3c')](_0xb46b('0x50'))){_0x4d22e5[_0xb46b('0x21')]=qs[_0xb46b('0x21')](_0xd683d7[_0xb46b('0x37')]['limit']);_0x4d22e5['offset']=qs['offset'](_0xd683d7[_0xb46b('0x37')][_0xb46b('0x1f')]);}return _0x2abcb8[_0xb46b('0x4d')](_0x4d22e5);}})[_0xb46b('0x2a')](function(_0x315dee){if(_0x315dee){return _0x315dee?{'count':_0x5d2ce2,'rows':_0x315dee}:null;}})['then'](respondWithResult(_0x384f09,null))[_0xb46b('0x46')](handleError(_0x384f09,null));};exports['addConfiguration']=function(_0x587aa3,_0x289a84,_0x5a61e9){if(_0x587aa3[_0xb46b('0x4b')]['id']){delete _0x587aa3[_0xb46b('0x4b')]['id'];}return db[_0xb46b('0x30')][_0xb46b('0x4e')]({'where':{'id':_0x587aa3[_0xb46b('0x4c')]['id']}})[_0xb46b('0x2a')](handleEntityNotFound(_0x289a84,null))['then'](function(_0x5873c3){if(_0x5873c3){_0x587aa3['body'][_0xb46b('0x51')]=_0x5873c3['id'];_0x587aa3[_0xb46b('0x4b')][_0xb46b('0x52')]=integrations['getSubjects'](_0x587aa3[_0xb46b('0x4b')]['channel'],_0x587aa3['body'][_0xb46b('0x33')]);_0x587aa3[_0xb46b('0x4b')][_0xb46b('0x53')]=integrations[_0xb46b('0x54')](_0x587aa3['body'][_0xb46b('0x55')],_0x587aa3[_0xb46b('0x4b')][_0xb46b('0x33')]);return db[_0xb46b('0x4f')][_0xb46b('0x4a')](_0x587aa3[_0xb46b('0x4b')],{'include':[{'model':db['ZohoField'],'as':_0xb46b('0x52')},{'model':db[_0xb46b('0x56')],'as':_0xb46b('0x53')}]});}return null;})[_0xb46b('0x2a')](respondWithResult(_0x289a84,null))[_0xb46b('0x46')](handleError(_0x289a84,null));};function getAccessToken(_0x1d2abe){return new Promise(function(_0x1fbe2c,_0x20dc39){var _0x3c5a20;switch(_0x1d2abe[_0xb46b('0x57')]){case'US':_0x3c5a20=_0xb46b('0x58');break;case'AU':_0x3c5a20=_0xb46b('0x59');break;case'EU':_0x3c5a20='https://accounts.zoho.eu';break;case'IN':_0x3c5a20=_0xb46b('0x5a');break;case'CN':_0x3c5a20=_0xb46b('0x5b');break;default:_0x3c5a20=_0xb46b('0x5c');break;}var _0x27af0c={'method':_0xb46b('0x5d'),'uri':_0x3c5a20+'/oauth/v2/token','qs':{'refresh_token':_0x1d2abe['refreshToken'],'client_id':_0x1d2abe[_0xb46b('0x5e')],'client_secret':_0x1d2abe[_0xb46b('0x5f')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x27af0c)['then'](function(_0x4d59f1){if(_0x4d59f1[_0xb46b('0x60')]){_0x1fbe2c(_0x4d59f1[_0xb46b('0x60')]);}else{_0x20dc39(_0xb46b('0x61'));}})[_0xb46b('0x46')](function(_0x1062e7){_0x20dc39(_0x1062e7);});});}exports[_0xb46b('0x62')]=function(_0x2b14ab,_0x1df0a3,_0x78200a){var _0x1eb8a5,_0x362402,_0x47638b,_0x4907d7,_0x1d3054;return db[_0xb46b('0x30')][_0xb46b('0x4e')]({'where':{'id':_0x2b14ab[_0xb46b('0x4c')]['id']},'attributes':['id',_0xb46b('0x63'),_0xb46b('0x57'),'clientId',_0xb46b('0x5f'),_0xb46b('0x64'),'code',_0xb46b('0x65')]})[_0xb46b('0x2a')](handleEntityNotFound(_0x1df0a3,null))['then'](function(_0x386b53){_0x1d3054=_0x386b53;_0x1eb8a5=_0x1d3054['host'];_0x362402=_0x1eb8a5===_0xb46b('0x66')?'eu':_0xb46b('0x67');_0x47638b=_0x1d3054[_0xb46b('0x64')];var _0x4b3f94=_0x47638b[_0xb46b('0x68')](-0x1);if(_0x4b3f94==='/'||_0x4b3f94==='\x5c'||_0x4b3f94===':'){_0x47638b=_0x47638b[_0xb46b('0x69')](0x0,_0x47638b[_0xb46b('0x6a')](_0x4b3f94));}if(!_0x1d3054[_0xb46b('0x65')]){throw new Error(_0xb46b('0x6b'));}return getAccessToken(_0x1d3054);})['then'](function(_0x3966e7){if(_0x3966e7){return rp({'method':_0xb46b('0x6c'),'uri':util[_0xb46b('0x6d')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x362402),'qs':{'module':_0xb46b('0x6e')},'headers':{'Authorization':_0xb46b('0x6f')+_0x3966e7},'json':!![]});}})[_0xb46b('0x2a')](function(_0x551a01){if(_0x551a01){if(_0x551a01[_0xb46b('0x70')]&&_0x551a01[_0xb46b('0x70')][_0xb46b('0x2b')]){throw new Error(_0x551a01[_0xb46b('0x70')][_0xb46b('0x2b')][_0xb46b('0x71')]);}var _0xb0dba4=[];var _0x321496=[];var _0x942b15=[_0xb46b('0x72'),'Subject',_0xb46b('0x73'),_0xb46b('0x74'),_0xb46b('0x75'),_0xb46b('0x76'),_0xb46b('0x77'),_0xb46b('0x78')];_0x321496=_[_0xb46b('0x79')](_0x551a01['fields'],function(_0x493be6){return _0x942b15[_0xb46b('0x7a')](_0x493be6[_0xb46b('0x7b')]);});for(var _0x67abcb=0x0;_0x67abcb<_0x321496[_0xb46b('0x7c')];_0x67abcb++){if(_0x321496[_0x67abcb]['system_mandatory']===![]){_0xb0dba4[_0xb46b('0x7d')]({'id':_0x321496[_0x67abcb]['id'],'name':_0x321496[_0x67abcb][_0xb46b('0x7e')],'custom':_0x321496[_0x67abcb][_0xb46b('0x7f')],'options':_0x321496[_0x67abcb][_0xb46b('0x80')]===_0xb46b('0x81')&&_0x321496[_0x67abcb]['pick_list_values'][_0xb46b('0x7c')]>-0x1?_[_0xb46b('0x2f')](_0x321496[_0x67abcb][_0xb46b('0x82')],function(_0x4c05b6){return{'name':_0x4c05b6,'value':_0x4c05b6};}):[]});}}return{'count':_0xb0dba4[_0xb46b('0x7c')],'rows':_0xb0dba4};}else{return{'count':0x0,'rows':[]};}})[_0xb46b('0x2a')](respondWithResult(_0x1df0a3,null))[_0xb46b('0x46')](function(_0x27d3c1){var _0x2cdcbf=_0x2b14ab[_0xb46b('0x37')][_0xb46b('0x83')]?0x1f4:_0x27d3c1[_0xb46b('0x84')]||0x1f4;logger[_0xb46b('0x2b')]('getFields,\x20%s,\x20%s,\x20%s',_0xb46b('0x62'),_0x2cdcbf,JSON[_0xb46b('0x85')](_0x27d3c1));delete _0x27d3c1['name'];if(_0x2cdcbf===0x191){_0x2cdcbf=0x190;}_0x1df0a3[_0xb46b('0x1d')](_0x2cdcbf)[_0xb46b('0x86')](_0x2b14ab[_0xb46b('0x37')][_0xb46b('0x83')]?{'message':_0xb46b('0x87'),'statusCode':_0x27d3c1[_0xb46b('0x84')]}:_0x27d3c1);});}; \ No newline at end of file +var _0x663a=['rows','catch','params','rawAttributes','fields','length','includeAll','include','find','create','body','getConfigurations','pick','filter','addConfiguration','AccountId','getSubjects','channel','getDescriptions','ZohoConfiguration','ZohoField','Descriptions','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','code','zoho.eu','com','serverUrl','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','Owner','Description','WhoId','Call_Type','includes','api_name','system_mandatory','push','custom_field','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','end','error','name','send','index','map','fieldName','type','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','ZohoAccount'];(function(_0x13c91a,_0x58fa37){var _0x17f2e4=function(_0x1660e0){while(--_0x1660e0){_0x13c91a['push'](_0x13c91a['shift']());}};_0x17f2e4(++_0x58fa37);}(_0x663a,0xb7));var _0xa663=function(_0x42fd33,_0x36c178){_0x42fd33=_0x42fd33-0x0;var _0x1493fb=_0x663a[_0x42fd33];return _0x1493fb;};'use strict';var emlformat=require(_0xa663('0x0'));var rimraf=require(_0xa663('0x1'));var zipdir=require(_0xa663('0x2'));var jsonpatch=require(_0xa663('0x3'));var rp=require(_0xa663('0x4'));var moment=require('moment');var BPromise=require(_0xa663('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa663('0x6'));var csv=require(_0xa663('0x7'));var ejs=require(_0xa663('0x8'));var fs=require('fs');var fs_extra=require(_0xa663('0x9'));var _=require('lodash');var squel=require(_0xa663('0xa'));var crypto=require(_0xa663('0xb'));var jsforce=require(_0xa663('0xc'));var deskjs=require(_0xa663('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa663('0xe'));var Papa=require(_0xa663('0xf'));var Redis=require(_0xa663('0x10'));var authService=require(_0xa663('0x11'));var qs=require(_0xa663('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa663('0x13'));var logger=require(_0xa663('0x14'))(_0xa663('0x15'));var utils=require(_0xa663('0x16'));var config=require(_0xa663('0x17'));var licenseUtil=require(_0xa663('0x18'));var db=require(_0xa663('0x19'))['db'];var integrations=require(_0xa663('0x1a'));function respondWithStatusCode(_0x2acfc9,_0x334b3f){_0x334b3f=_0x334b3f||0xcc;return function(_0x7146fe){if(_0x7146fe){return _0x2acfc9[_0xa663('0x1b')](_0x334b3f);}return _0x2acfc9['status'](_0x334b3f)['end']();};}function respondWithResult(_0x54f10b,_0x2ae364){_0x2ae364=_0x2ae364||0xc8;return function(_0x41513d){if(_0x41513d){return _0x54f10b[_0xa663('0x1c')](_0x2ae364)[_0xa663('0x1d')](_0x41513d);}};}function respondWithFilteredResult(_0x3be18c,_0x1dcc9c){return function(_0x2035ea){if(_0x2035ea){var _0x37a445=typeof _0x1dcc9c[_0xa663('0x1e')]==='undefined'&&typeof _0x1dcc9c[_0xa663('0x1f')]===_0xa663('0x20');var _0x257953=_0x2035ea[_0xa663('0x21')];var _0x7e3b28=_0x37a445?0x0:_0x1dcc9c[_0xa663('0x1e')];var _0x3c488e=_0x37a445?_0x2035ea[_0xa663('0x21')]:_0x1dcc9c[_0xa663('0x1e')]+_0x1dcc9c['limit'];var _0x4be5fe;if(_0x3c488e>=_0x257953){_0x3c488e=_0x257953;_0x4be5fe=0xc8;}else{_0x4be5fe=0xce;}_0x3be18c[_0xa663('0x1c')](_0x4be5fe);return _0x3be18c[_0xa663('0x22')](_0xa663('0x23'),_0x7e3b28+'-'+_0x3c488e+'/'+_0x257953)[_0xa663('0x1d')](_0x2035ea);}return null;};}function patchUpdates(_0x3531b0){return function(_0x266e8c){try{jsonpatch['apply'](_0x266e8c,_0x3531b0,!![]);}catch(_0xa44d2a){return BPromise['reject'](_0xa44d2a);}return _0x266e8c[_0xa663('0x24')]();};}function saveUpdates(_0x339de1,_0x2c9059){return function(_0x536b34){if(_0x536b34){return _0x536b34[_0xa663('0x25')](_0x339de1)[_0xa663('0x26')](function(_0x57cf3c){return _0x57cf3c;});}return null;};}function removeEntity(_0x2b93d7,_0x35b4ed){return function(_0x35eff8){if(_0x35eff8){return _0x35eff8[_0xa663('0x27')]()[_0xa663('0x26')](function(){_0x2b93d7[_0xa663('0x1c')](0xcc)[_0xa663('0x28')]();});}};}function handleEntityNotFound(_0x16793a,_0x4c8c14){return function(_0x19d13a){if(!_0x19d13a){_0x16793a[_0xa663('0x1b')](0x194);}return _0x19d13a;};}function handleError(_0x5c184a,_0x915bd9){_0x915bd9=_0x915bd9||0x1f4;return function(_0x4179bc){logger[_0xa663('0x29')](_0x4179bc['stack']);if(_0x4179bc[_0xa663('0x2a')]){delete _0x4179bc['name'];}_0x5c184a['status'](_0x915bd9)[_0xa663('0x2b')](_0x4179bc);};}exports[_0xa663('0x2c')]=function(_0x472dbc,_0x21e208){var _0x2814e4={},_0x3a9f21={},_0x4f36c4={'count':0x0,'rows':[]};var _0x38db05=_[_0xa663('0x2d')](db['ZohoAccount']['rawAttributes'],function(_0x494b68){return{'name':_0x494b68[_0xa663('0x2e')],'type':_0x494b68[_0xa663('0x2f')]['key']};});_0x3a9f21[_0xa663('0x30')]=_[_0xa663('0x2d')](_0x38db05,_0xa663('0x2a'));_0x3a9f21['query']=_[_0xa663('0x31')](_0x472dbc[_0xa663('0x32')]);_0x3a9f21[_0xa663('0x33')]=_['intersection'](_0x3a9f21[_0xa663('0x30')],_0x3a9f21['query']);_0x2814e4['attributes']=_[_0xa663('0x34')](_0x3a9f21['model'],qs['fields'](_0x472dbc[_0xa663('0x32')]['fields']));_0x2814e4[_0xa663('0x35')]=_0x2814e4[_0xa663('0x35')]['length']?_0x2814e4[_0xa663('0x35')]:_0x3a9f21['model'];if(!_0x472dbc[_0xa663('0x32')][_0xa663('0x36')](_0xa663('0x37'))){_0x2814e4[_0xa663('0x1f')]=qs[_0xa663('0x1f')](_0x472dbc[_0xa663('0x32')][_0xa663('0x1f')]);_0x2814e4[_0xa663('0x1e')]=qs[_0xa663('0x1e')](_0x472dbc[_0xa663('0x32')][_0xa663('0x1e')]);}_0x2814e4[_0xa663('0x38')]=qs[_0xa663('0x39')](_0x472dbc['query'][_0xa663('0x39')]);_0x2814e4[_0xa663('0x3a')]=qs['filters'](_['pick'](_0x472dbc['query'],_0x3a9f21[_0xa663('0x33')]),_0x38db05);if(_0x472dbc[_0xa663('0x32')]['filter']){_0x2814e4[_0xa663('0x3a')]=_['merge'](_0x2814e4[_0xa663('0x3a')],{'$or':_['map'](_0x38db05,function(_0x2bc7d8){if(_0x2bc7d8[_0xa663('0x2f')]!==_0xa663('0x3b')){var _0x11098b={};_0x11098b[_0x2bc7d8[_0xa663('0x2a')]]={'$like':'%'+_0x472dbc[_0xa663('0x32')]['filter']+'%'};return _0x11098b;}})});}_0x2814e4=_[_0xa663('0x3c')]({},_0x2814e4,_0x472dbc[_0xa663('0x3d')]);var _0x4d0265={'where':_0x2814e4['where']};return db[_0xa663('0x3e')][_0xa663('0x21')](_0x4d0265)[_0xa663('0x26')](function(_0x47fd3c){_0x4f36c4[_0xa663('0x21')]=_0x47fd3c;if(_0x472dbc[_0xa663('0x32')]['includeAll']){_0x2814e4['include']=[{'all':!![]}];}return db[_0xa663('0x3e')]['findAll'](_0x2814e4);})[_0xa663('0x26')](function(_0x26fedb){_0x4f36c4[_0xa663('0x3f')]=_0x26fedb;return _0x4f36c4;})[_0xa663('0x26')](respondWithFilteredResult(_0x21e208,_0x2814e4))[_0xa663('0x40')](handleError(_0x21e208,null));};exports['show']=function(_0x4467eb,_0x45012e){var _0xba16f8={'raw':![],'where':{'id':_0x4467eb[_0xa663('0x41')]['id']}},_0x248cea={};_0x248cea['model']=_[_0xa663('0x31')](db[_0xa663('0x3e')][_0xa663('0x42')]);_0x248cea[_0xa663('0x32')]=_['keys'](_0x4467eb[_0xa663('0x32')]);_0x248cea[_0xa663('0x33')]=_['intersection'](_0x248cea[_0xa663('0x30')],_0x248cea[_0xa663('0x32')]);_0xba16f8['attributes']=_['intersection'](_0x248cea[_0xa663('0x30')],qs[_0xa663('0x43')](_0x4467eb[_0xa663('0x32')][_0xa663('0x43')]));_0xba16f8['attributes']=_0xba16f8[_0xa663('0x35')][_0xa663('0x44')]?_0xba16f8['attributes']:_0x248cea[_0xa663('0x30')];if(_0x4467eb[_0xa663('0x32')][_0xa663('0x45')]){_0xba16f8[_0xa663('0x46')]=[{'all':!![]}];}_0xba16f8=_[_0xa663('0x3c')]({},_0xba16f8,_0x4467eb[_0xa663('0x3d')]);return db[_0xa663('0x3e')][_0xa663('0x47')](_0xba16f8)['then'](handleEntityNotFound(_0x45012e,null))[_0xa663('0x26')](respondWithResult(_0x45012e,null))[_0xa663('0x40')](handleError(_0x45012e,null));};exports[_0xa663('0x48')]=function(_0x4156a5,_0x44d8c1){return db[_0xa663('0x3e')][_0xa663('0x48')](_0x4156a5[_0xa663('0x49')],{})[_0xa663('0x26')](respondWithResult(_0x44d8c1,0xc9))['catch'](handleError(_0x44d8c1,null));};exports[_0xa663('0x25')]=function(_0x1556fc,_0x3ca52a){if(_0x1556fc[_0xa663('0x49')]['id']){delete _0x1556fc[_0xa663('0x49')]['id'];}return db[_0xa663('0x3e')]['find']({'where':{'id':_0x1556fc[_0xa663('0x41')]['id']}})[_0xa663('0x26')](handleEntityNotFound(_0x3ca52a,null))['then'](saveUpdates(_0x1556fc['body'],null))[_0xa663('0x26')](respondWithResult(_0x3ca52a,null))['catch'](handleError(_0x3ca52a,null));};exports[_0xa663('0x27')]=function(_0x51955a,_0x554d79){return db[_0xa663('0x3e')][_0xa663('0x47')]({'where':{'id':_0x51955a['params']['id']}})[_0xa663('0x26')](handleEntityNotFound(_0x554d79,null))[_0xa663('0x26')](removeEntity(_0x554d79,null))['catch'](handleError(_0x554d79,null));};exports[_0xa663('0x4a')]=function(_0xf708d2,_0x31ef2f,_0x2acc30){var _0x1eda8d={};var _0x5b6076={};var _0x161e17;var _0x1bbc22;return db[_0xa663('0x3e')]['findOne']({'where':{'id':_0xf708d2[_0xa663('0x41')]['id']}})[_0xa663('0x26')](handleEntityNotFound(_0x31ef2f,null))['then'](function(_0xc61047){if(_0xc61047){_0x161e17=_0xc61047;_0x5b6076[_0xa663('0x30')]=_[_0xa663('0x31')](db['ZohoConfiguration'][_0xa663('0x42')]);_0x5b6076[_0xa663('0x32')]=_[_0xa663('0x31')](_0xf708d2[_0xa663('0x32')]);_0x5b6076[_0xa663('0x33')]=_[_0xa663('0x34')](_0x5b6076[_0xa663('0x30')],_0x5b6076['query']);_0x1eda8d[_0xa663('0x35')]=_['intersection'](_0x5b6076[_0xa663('0x30')],qs['fields'](_0xf708d2[_0xa663('0x32')]['fields']));_0x1eda8d['attributes']=_0x1eda8d[_0xa663('0x35')][_0xa663('0x44')]?_0x1eda8d[_0xa663('0x35')]:_0x5b6076[_0xa663('0x30')];_0x1eda8d[_0xa663('0x38')]=qs['sort'](_0xf708d2['query'][_0xa663('0x39')]);_0x1eda8d[_0xa663('0x3a')]=qs[_0xa663('0x33')](_[_0xa663('0x4b')](_0xf708d2[_0xa663('0x32')],_0x5b6076[_0xa663('0x33')]));if(_0xf708d2[_0xa663('0x32')][_0xa663('0x4c')]){_0x1eda8d[_0xa663('0x3a')]=_[_0xa663('0x3c')](_0x1eda8d[_0xa663('0x3a')],{'$or':_[_0xa663('0x2d')](_0x1eda8d[_0xa663('0x35')],function(_0x444c78){var _0xcffcbc={};_0xcffcbc[_0x444c78]={'$like':'%'+_0xf708d2[_0xa663('0x32')][_0xa663('0x4c')]+'%'};return _0xcffcbc;})});}_0x1eda8d=_[_0xa663('0x3c')]({},_0x1eda8d,_0xf708d2[_0xa663('0x3d')]);return _0x161e17[_0xa663('0x4a')](_0x1eda8d);}})[_0xa663('0x26')](function(_0x163546){if(_0x163546){_0x1bbc22=_0x163546[_0xa663('0x44')];if(!_0xf708d2[_0xa663('0x32')][_0xa663('0x36')]('nolimit')){_0x1eda8d['limit']=qs[_0xa663('0x1f')](_0xf708d2[_0xa663('0x32')][_0xa663('0x1f')]);_0x1eda8d[_0xa663('0x1e')]=qs[_0xa663('0x1e')](_0xf708d2[_0xa663('0x32')][_0xa663('0x1e')]);}return _0x161e17['getConfigurations'](_0x1eda8d);}})[_0xa663('0x26')](function(_0x39b806){if(_0x39b806){return _0x39b806?{'count':_0x1bbc22,'rows':_0x39b806}:null;}})[_0xa663('0x26')](respondWithResult(_0x31ef2f,null))[_0xa663('0x40')](handleError(_0x31ef2f,null));};exports[_0xa663('0x4d')]=function(_0x550211,_0x2a19db,_0x447249){if(_0x550211[_0xa663('0x49')]['id']){delete _0x550211['body']['id'];}return db[_0xa663('0x3e')]['findOne']({'where':{'id':_0x550211[_0xa663('0x41')]['id']}})[_0xa663('0x26')](handleEntityNotFound(_0x2a19db,null))['then'](function(_0x189ede){if(_0x189ede){_0x550211[_0xa663('0x49')][_0xa663('0x4e')]=_0x189ede['id'];_0x550211[_0xa663('0x49')]['Subjects']=integrations[_0xa663('0x4f')](_0x550211[_0xa663('0x49')][_0xa663('0x50')],_0x550211[_0xa663('0x49')][_0xa663('0x2f')]);_0x550211[_0xa663('0x49')]['Descriptions']=integrations[_0xa663('0x51')](_0x550211['body'][_0xa663('0x50')],_0x550211[_0xa663('0x49')]['type']);return db[_0xa663('0x52')][_0xa663('0x48')](_0x550211[_0xa663('0x49')],{'include':[{'model':db[_0xa663('0x53')],'as':'Subjects'},{'model':db[_0xa663('0x53')],'as':_0xa663('0x54')}]});}return null;})[_0xa663('0x26')](respondWithResult(_0x2a19db,null))[_0xa663('0x40')](handleError(_0x2a19db,null));};function getAccessToken(_0x3de73e){return new Promise(function(_0xba899e,_0x13ce2a){var _0x3c1142;switch(_0x3de73e['zone']){case'US':_0x3c1142='https://accounts.zoho.com';break;case'AU':_0x3c1142=_0xa663('0x55');break;case'EU':_0x3c1142=_0xa663('0x56');break;case'IN':_0x3c1142='https://accounts.zoho.in';break;case'CN':_0x3c1142='https://accounts.zoho.com.cn';break;default:_0x3c1142='https://accounts.zoho.eu';break;}var _0x5e7804={'method':_0xa663('0x57'),'uri':_0x3c1142+_0xa663('0x58'),'qs':{'refresh_token':_0x3de73e[_0xa663('0x59')],'client_id':_0x3de73e[_0xa663('0x5a')],'client_secret':_0x3de73e[_0xa663('0x5b')],'grant_type':_0xa663('0x5c')},'json':!![]};return rp(_0x5e7804)[_0xa663('0x26')](function(_0x41abae){if(_0x41abae[_0xa663('0x5d')]){_0xba899e(_0x41abae[_0xa663('0x5d')]);}else{_0x13ce2a(_0xa663('0x5e'));}})[_0xa663('0x40')](function(_0x3c424d){_0x13ce2a(_0x3c424d);});});}exports[_0xa663('0x5f')]=function(_0x13668a,_0xe225f2,_0x3252a8){var _0x2e8ce9,_0x9397e9,_0x31c81a,_0x285f08,_0x5922c8;return db[_0xa663('0x3e')]['findOne']({'where':{'id':_0x13668a[_0xa663('0x41')]['id']},'attributes':['id',_0xa663('0x60'),'zone',_0xa663('0x5a'),_0xa663('0x5b'),'serverUrl',_0xa663('0x61'),_0xa663('0x59')]})[_0xa663('0x26')](handleEntityNotFound(_0xe225f2,null))[_0xa663('0x26')](function(_0x3ddef9){_0x5922c8=_0x3ddef9;_0x2e8ce9=_0x5922c8[_0xa663('0x60')];_0x9397e9=_0x2e8ce9===_0xa663('0x62')?'eu':_0xa663('0x63');_0x31c81a=_0x5922c8[_0xa663('0x64')];var _0x2c205b=_0x31c81a['slice'](-0x1);if(_0x2c205b==='/'||_0x2c205b==='\x5c'||_0x2c205b===':'){_0x31c81a=_0x31c81a['substring'](0x0,_0x31c81a['lastIndexOf'](_0x2c205b));}if(!_0x5922c8[_0xa663('0x59')]){throw new Error(_0xa663('0x65'));}return getAccessToken(_0x5922c8);})['then'](function(_0x278d13){if(_0x278d13){return rp({'method':_0xa663('0x66'),'uri':util[_0xa663('0x67')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x9397e9),'qs':{'module':_0xa663('0x68')},'headers':{'Authorization':_0xa663('0x69')+_0x278d13},'json':!![]});}})[_0xa663('0x26')](function(_0x1a6a77){if(_0x1a6a77){if(_0x1a6a77[_0xa663('0x6a')]&&_0x1a6a77[_0xa663('0x6a')][_0xa663('0x29')]){throw new Error(_0x1a6a77[_0xa663('0x6a')][_0xa663('0x29')]['message']);}var _0xde859=[];var _0x49b9bc=[];var _0x251c74=[_0xa663('0x6b'),'Subject',_0xa663('0x6c'),_0xa663('0x6d'),'Call_Duration','Call_Result','Call_Start_Time',_0xa663('0x6e')];_0x49b9bc=_['remove'](_0x1a6a77[_0xa663('0x43')],function(_0x1f46ac){return _0x251c74[_0xa663('0x6f')](_0x1f46ac[_0xa663('0x70')]);});for(var _0x5798c2=0x0;_0x5798c2<_0x49b9bc['length'];_0x5798c2++){if(_0x49b9bc[_0x5798c2][_0xa663('0x71')]===![]){_0xde859[_0xa663('0x72')]({'id':_0x49b9bc[_0x5798c2]['id'],'name':_0x49b9bc[_0x5798c2]['display_label'],'custom':_0x49b9bc[_0x5798c2][_0xa663('0x73')],'options':_0x49b9bc[_0x5798c2][_0xa663('0x74')]==='picklist'&&_0x49b9bc[_0x5798c2]['pick_list_values'][_0xa663('0x44')]>-0x1?_[_0xa663('0x2d')](_0x49b9bc[_0x5798c2][_0xa663('0x75')],function(_0x483609){return{'name':_0x483609,'value':_0x483609};}):[]});}}return{'count':_0xde859['length'],'rows':_0xde859};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0xe225f2,null))[_0xa663('0x40')](function(_0x41a8e4){var _0x42ec1a=_0x13668a[_0xa663('0x32')]['test']?0x1f4:_0x41a8e4[_0xa663('0x76')]||0x1f4;logger[_0xa663('0x29')](_0xa663('0x77'),_0xa663('0x5f'),_0x42ec1a,JSON[_0xa663('0x78')](_0x41a8e4));delete _0x41a8e4[_0xa663('0x2a')];if(_0x42ec1a===0x191){_0x42ec1a=0x190;}_0xe225f2[_0xa663('0x1c')](_0x42ec1a)[_0xa663('0x2b')](_0x13668a[_0xa663('0x32')][_0xa663('0x79')]?{'message':_0xa663('0x7a'),'statusCode':_0x41a8e4[_0xa663('0x76')]}:_0x41a8e4);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 952fed1..8b22f0d 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 _0x1c59=['refreshToken','info','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','format','inspect','code','lastIndexOf','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientId','host','slice','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token'];(function(_0x3b1630,_0x1043ad){var _0x1bffbf=function(_0x2decad){while(--_0x2decad){_0x3b1630['push'](_0x3b1630['shift']());}};_0x1bffbf(++_0x1043ad);}(_0x1c59,0x17b));var _0x91c5=function(_0x16f99e,_0x58867e){_0x16f99e=_0x16f99e-0x0;var _0x4a9e5f=_0x1c59[_0x16f99e];return _0x4a9e5f;};'use strict';var _=require('lodash');var util=require(_0x91c5('0x0'));var logger=require(_0x91c5('0x1'))(_0x91c5('0x2'));var moment=require(_0x91c5('0x3'));var BPromise=require(_0x91c5('0x4'));var rp=require(_0x91c5('0x5'));var fs=require('fs');var path=require(_0x91c5('0x6'));var rimraf=require(_0x91c5('0x7'));var config=require(_0x91c5('0x8'));var attributes=require(_0x91c5('0x9'));var integrations=require(_0x91c5('0xa'));module[_0x91c5('0xb')]=function(_0x260222,_0x5af57b){return _0x260222[_0x91c5('0xc')](_0x91c5('0xd'),attributes,{'tableName':_0x91c5('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4d6eb6,_0xb1c867,_0x25cf43){if(_0x4d6eb6['changed'](_0x91c5('0xf'))||_0x4d6eb6[_0x91c5('0x10')](_0x91c5('0x11'))||_0x4d6eb6[_0x91c5('0x10')](_0x91c5('0x12'))||_0x4d6eb6[_0x91c5('0x10')]('clientSecret')||_0x4d6eb6[_0x91c5('0x10')]('code')||_0x4d6eb6[_0x91c5('0x10')](_0x91c5('0x13'))){var _0x28d9b7,_0x49b33e;_0x28d9b7=_0x4d6eb6[_0x91c5('0x11')];var _0x360692=_0x28d9b7[_0x91c5('0x14')](-0x1);if(_0x360692==='/'||_0x360692==='\x5c'||_0x360692===':'){_0x28d9b7=_0x28d9b7[_0x91c5('0x15')](0x0,_0x28d9b7['lastIndexOf'](_0x360692));}switch(_0x4d6eb6['zone']){case'US':_0x49b33e=_0x91c5('0x16');break;case'AU':_0x49b33e=_0x91c5('0x17');break;case'IN':_0x49b33e=_0x91c5('0x18');break;case'CN':_0x49b33e=_0x91c5('0x19');break;default:_0x49b33e=_0x91c5('0x1a');break;}var _0x2f0460={'method':_0x91c5('0x1b'),'uri':_0x49b33e+_0x91c5('0x1c'),'form':{'grant_type':_0x91c5('0x1d'),'client_id':_0x4d6eb6[_0x91c5('0x12')],'client_secret':_0x4d6eb6[_0x91c5('0x1e')],'redirect_uri':_0x4d6eb6[_0x91c5('0x11')],'code':_0x4d6eb6['code']},'headers':{'Content-Type':_0x91c5('0x1f')}};return rp(_0x2f0460)[_0x91c5('0x20')](function(_0x53953f){var _0x52e229=JSON[_0x91c5('0x21')](_0x53953f);if(_0x52e229[_0x91c5('0x22')]){_0x4d6eb6[_0x91c5('0x23')]=_0x52e229[_0x91c5('0x22')];logger[_0x91c5('0x24')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4d6eb6[_0x91c5('0x25')],_0x4d6eb6['id']));}else{logger[_0x91c5('0x26')](util['format'](_0x91c5('0x27'),_0x4d6eb6[_0x91c5('0x25')],_0x4d6eb6['id']),util['inspect'](_0x52e229,{'showHidden':![],'depth':null}));}return _0x25cf43(null,_0xb1c867);})[_0x91c5('0x28')](function(_0x37f532){logger[_0x91c5('0x26')](util[_0x91c5('0x29')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4d6eb6[_0x91c5('0x25')],_0x4d6eb6['id']),util[_0x91c5('0x2a')](parsedResult,{'showHidden':![],'depth':null}));return _0x25cf43(_0x37f532);});}else{return _0x25cf43(null,_0xb1c867);}},'beforeUpdate':function(_0xa268ae,_0x1a1997,_0x56d202){if(_0xa268ae[_0x91c5('0x10')](_0x91c5('0xf'))||_0xa268ae[_0x91c5('0x10')](_0x91c5('0x11'))||_0xa268ae[_0x91c5('0x10')](_0x91c5('0x12'))||_0xa268ae[_0x91c5('0x10')](_0x91c5('0x1e'))||_0xa268ae[_0x91c5('0x10')](_0x91c5('0x2b'))||_0xa268ae[_0x91c5('0x10')](_0x91c5('0x13'))){var _0x55b7ac,_0x36b4b1;_0x55b7ac=_0xa268ae[_0x91c5('0x11')];var _0x9863ce=_0x55b7ac[_0x91c5('0x14')](-0x1);if(_0x9863ce==='/'||_0x9863ce==='\x5c'||_0x9863ce===':'){_0x55b7ac=_0x55b7ac[_0x91c5('0x15')](0x0,_0x55b7ac[_0x91c5('0x2c')](_0x9863ce));}switch(_0xa268ae[_0x91c5('0xf')]){case'US':_0x36b4b1='https://accounts.zoho.com';break;case'AU':_0x36b4b1='https://accounts.zoho.com.au';break;case'IN':_0x36b4b1=_0x91c5('0x18');break;case'CN':_0x36b4b1=_0x91c5('0x19');break;default:_0x36b4b1=_0x91c5('0x1a');break;}var _0x5b4be3={'method':_0x91c5('0x1b'),'uri':_0x36b4b1+_0x91c5('0x1c'),'form':{'grant_type':'authorization_code','client_id':_0xa268ae[_0x91c5('0x12')],'client_secret':_0xa268ae['clientSecret'],'redirect_uri':_0xa268ae[_0x91c5('0x11')],'code':_0xa268ae['code']},'headers':{'Content-Type':_0x91c5('0x1f')}};return rp(_0x5b4be3)[_0x91c5('0x20')](function(_0x22d1e0){var _0x142e57=JSON[_0x91c5('0x21')](_0x22d1e0);if(_0x142e57[_0x91c5('0x22')]){_0xa268ae[_0x91c5('0x23')]=_0x142e57[_0x91c5('0x22')];logger[_0x91c5('0x24')](util[_0x91c5('0x29')](_0x91c5('0x2d'),_0xa268ae[_0x91c5('0x25')],_0xa268ae['id']));}else{logger['error'](util[_0x91c5('0x29')](_0x91c5('0x27'),_0xa268ae[_0x91c5('0x25')],_0xa268ae['id']),util[_0x91c5('0x2a')](_0x142e57,{'showHidden':![],'depth':null}));}return _0x56d202(null,_0x1a1997);})[_0x91c5('0x28')](function(_0x6c2d38){logger['error'](util[_0x91c5('0x29')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xa268ae[_0x91c5('0x25')],_0xa268ae['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x56d202(_0x6c2d38);});}else{return _0x56d202(null,_0x1a1997);}}}});}; \ No newline at end of file +var _0x61b4=['lastIndexOf','https://accounts.zoho.com.cn','authorization_code','then','info','catch','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientId','clientSecret','slice','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','code','application/x-www-form-urlencoded','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','error','host'];(function(_0x33eca6,_0x891651){var _0x1ada39=function(_0x31ab8c){while(--_0x31ab8c){_0x33eca6['push'](_0x33eca6['shift']());}};_0x1ada39(++_0x891651);}(_0x61b4,0x13a));var _0x461b=function(_0x46aabc,_0x1b0b24){_0x46aabc=_0x46aabc-0x0;var _0x10c273=_0x61b4[_0x46aabc];return _0x10c273;};'use strict';var _=require(_0x461b('0x0'));var util=require(_0x461b('0x1'));var logger=require(_0x461b('0x2'))(_0x461b('0x3'));var moment=require(_0x461b('0x4'));var BPromise=require(_0x461b('0x5'));var rp=require(_0x461b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x461b('0x7'));var attributes=require(_0x461b('0x8'));var integrations=require(_0x461b('0x9'));module['exports']=function(_0x573d11,_0x42ef64){return _0x573d11[_0x461b('0xa')](_0x461b('0xb'),attributes,{'tableName':_0x461b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3def51,_0x490e74,_0x4930b1){if(_0x3def51['changed'](_0x461b('0xd'))||_0x3def51[_0x461b('0xe')](_0x461b('0xf'))||_0x3def51['changed'](_0x461b('0x10'))||_0x3def51['changed'](_0x461b('0x11'))||_0x3def51[_0x461b('0xe')]('code')||_0x3def51[_0x461b('0xe')]('host')){var _0x35be0d,_0x1a5c1a;_0x35be0d=_0x3def51['serverUrl'];var _0x3b483a=_0x35be0d[_0x461b('0x12')](-0x1);if(_0x3b483a==='/'||_0x3b483a==='\x5c'||_0x3b483a===':'){_0x35be0d=_0x35be0d[_0x461b('0x13')](0x0,_0x35be0d['lastIndexOf'](_0x3b483a));}switch(_0x3def51[_0x461b('0xd')]){case'US':_0x1a5c1a=_0x461b('0x14');break;case'AU':_0x1a5c1a=_0x461b('0x15');break;case'IN':_0x1a5c1a=_0x461b('0x16');break;case'CN':_0x1a5c1a='https://accounts.zoho.com.cn';break;default:_0x1a5c1a=_0x461b('0x17');break;}var _0xd42901={'method':_0x461b('0x18'),'uri':_0x1a5c1a+_0x461b('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x3def51[_0x461b('0x10')],'client_secret':_0x3def51['clientSecret'],'redirect_uri':_0x3def51[_0x461b('0xf')],'code':_0x3def51[_0x461b('0x1a')]},'headers':{'Content-Type':_0x461b('0x1b')}};return rp(_0xd42901)['then'](function(_0x530f49){var _0xfaab96=JSON[_0x461b('0x1c')](_0x530f49);if(_0xfaab96[_0x461b('0x1d')]){_0x3def51[_0x461b('0x1e')]=_0xfaab96[_0x461b('0x1d')];logger['info'](util[_0x461b('0x1f')](_0x461b('0x20'),_0x3def51['name'],_0x3def51['id']));}else{logger['error'](util[_0x461b('0x1f')](_0x461b('0x21'),_0x3def51[_0x461b('0x22')],_0x3def51['id']),util[_0x461b('0x23')](_0xfaab96,{'showHidden':![],'depth':null}));}return _0x4930b1(null,_0x490e74);})['catch'](function(_0x2aafe6){logger[_0x461b('0x24')](util['format'](_0x461b('0x21'),_0x3def51[_0x461b('0x22')],_0x3def51['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x4930b1(_0x2aafe6);});}else{return _0x4930b1(null,_0x490e74);}},'beforeUpdate':function(_0x4dcf6c,_0x529f69,_0x281f87){if(_0x4dcf6c[_0x461b('0xe')]('zone')||_0x4dcf6c[_0x461b('0xe')]('serverUrl')||_0x4dcf6c[_0x461b('0xe')](_0x461b('0x10'))||_0x4dcf6c[_0x461b('0xe')](_0x461b('0x11'))||_0x4dcf6c[_0x461b('0xe')](_0x461b('0x1a'))||_0x4dcf6c[_0x461b('0xe')](_0x461b('0x25'))){var _0x4a0282,_0x5e7fe8;_0x4a0282=_0x4dcf6c[_0x461b('0xf')];var _0x401ad1=_0x4a0282[_0x461b('0x12')](-0x1);if(_0x401ad1==='/'||_0x401ad1==='\x5c'||_0x401ad1===':'){_0x4a0282=_0x4a0282[_0x461b('0x13')](0x0,_0x4a0282[_0x461b('0x26')](_0x401ad1));}switch(_0x4dcf6c[_0x461b('0xd')]){case'US':_0x5e7fe8=_0x461b('0x14');break;case'AU':_0x5e7fe8=_0x461b('0x15');break;case'IN':_0x5e7fe8=_0x461b('0x16');break;case'CN':_0x5e7fe8=_0x461b('0x27');break;default:_0x5e7fe8=_0x461b('0x17');break;}var _0x39bec4={'method':_0x461b('0x18'),'uri':_0x5e7fe8+_0x461b('0x19'),'form':{'grant_type':_0x461b('0x28'),'client_id':_0x4dcf6c[_0x461b('0x10')],'client_secret':_0x4dcf6c[_0x461b('0x11')],'redirect_uri':_0x4dcf6c[_0x461b('0xf')],'code':_0x4dcf6c[_0x461b('0x1a')]},'headers':{'Content-Type':_0x461b('0x1b')}};return rp(_0x39bec4)[_0x461b('0x29')](function(_0x30e35c){var _0x4ff998=JSON['parse'](_0x30e35c);if(_0x4ff998['refresh_token']){_0x4dcf6c[_0x461b('0x1e')]=_0x4ff998[_0x461b('0x1d')];logger[_0x461b('0x2a')](util[_0x461b('0x1f')](_0x461b('0x20'),_0x4dcf6c['name'],_0x4dcf6c['id']));}else{logger[_0x461b('0x24')](util['format'](_0x461b('0x21'),_0x4dcf6c[_0x461b('0x22')],_0x4dcf6c['id']),util[_0x461b('0x23')](_0x4ff998,{'showHidden':![],'depth':null}));}return _0x281f87(null,_0x529f69);})[_0x461b('0x2b')](function(_0x1c4b41){logger[_0x461b('0x24')](util['format'](_0x461b('0x21'),_0x4dcf6c[_0x461b('0x22')],_0x4dcf6c['id']),util[_0x461b('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x281f87(_0x1c4b41);});}else{return _0x281f87(null,_0x529f69);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 96d95f8..72359b2 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 _0xef4d=['request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','ZohoAccount,\x20%s,\x20%s','result','catch','ZohoAccount','options','raw','where','attributes','limit','include','model','map','GetZohoAccount','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xef4d,0x165));var _0xdef4=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xef4d[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0xdef4('0x0'));var util=require(_0xdef4('0x1'));var moment=require(_0xdef4('0x2'));var BPromise=require(_0xdef4('0x3'));var rs=require(_0xdef4('0x4'));var fs=require('fs');var Redis=require(_0xdef4('0x5'));var db=require(_0xdef4('0x6'))['db'];var utils=require(_0xdef4('0x7'));var logger=require(_0xdef4('0x8'))(_0xdef4('0x9'));var config=require(_0xdef4('0xa'));var jayson=require(_0xdef4('0xb'));var client=jayson[_0xdef4('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x468dcd,_0x3b875f,_0x2cebfd){return new BPromise(function(_0x1dc5c9,_0x525707){return client[_0xdef4('0xd')](_0x468dcd,_0x2cebfd)[_0xdef4('0xe')](function(_0x87d8a3){logger[_0xdef4('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x3b875f,_0xdef4('0x10'));logger[_0xdef4('0x11')](_0xdef4('0x12'),_0x3b875f,_0xdef4('0x10'),JSON[_0xdef4('0x13')](_0x87d8a3));if(_0x87d8a3[_0xdef4('0x14')]){if(_0x87d8a3[_0xdef4('0x14')]['code']===0x1f4){logger[_0xdef4('0x14')]('ZohoAccount,\x20%s,\x20%s',_0x3b875f,_0x87d8a3['error'][_0xdef4('0x15')]);return _0x525707(_0x87d8a3['error'][_0xdef4('0x15')]);}logger['error'](_0xdef4('0x16'),_0x3b875f,_0x87d8a3[_0xdef4('0x14')][_0xdef4('0x15')]);return _0x1dc5c9(_0x87d8a3[_0xdef4('0x14')]['message']);}else{logger[_0xdef4('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x3b875f,_0xdef4('0x10'));_0x1dc5c9(_0x87d8a3[_0xdef4('0x17')]['message']);}})[_0xdef4('0x18')](function(_0x27463d){logger[_0xdef4('0x14')](_0xdef4('0x16'),_0x3b875f,_0x27463d);_0x525707(_0x27463d);});});}exports['GetZohoAccount']=function(_0x377beb){var _0x3b3a4=this;return new Promise(function(_0x469178,_0x18d3a0){return db[_0xdef4('0x19')]['findAll']({'raw':_0x377beb[_0xdef4('0x1a')]?_0x377beb[_0xdef4('0x1a')][_0xdef4('0x1b')]===undefined?!![]:![]:!![],'where':_0x377beb[_0xdef4('0x1a')]?_0x377beb[_0xdef4('0x1a')][_0xdef4('0x1c')]||null:null,'attributes':_0x377beb['options']?_0x377beb[_0xdef4('0x1a')][_0xdef4('0x1d')]||null:null,'limit':_0x377beb[_0xdef4('0x1a')]?_0x377beb[_0xdef4('0x1a')][_0xdef4('0x1e')]||null:null,'include':_0x377beb[_0xdef4('0x1a')]?_0x377beb['options'][_0xdef4('0x1f')]?_['map'](_0x377beb[_0xdef4('0x1a')][_0xdef4('0x1f')],function(_0x35c401){return{'model':db[_0x35c401[_0xdef4('0x20')]],'as':_0x35c401['as'],'attributes':_0x35c401['attributes'],'include':_0x35c401[_0xdef4('0x1f')]?_[_0xdef4('0x21')](_0x35c401[_0xdef4('0x1f')],function(_0xf43627){return{'model':db[_0xf43627[_0xdef4('0x20')]],'as':_0xf43627['as'],'attributes':_0xf43627[_0xdef4('0x1d')],'include':_0xf43627[_0xdef4('0x1f')]?_[_0xdef4('0x21')](_0xf43627['include'],function(_0x3e770f){return{'model':db[_0x3e770f[_0xdef4('0x20')]],'as':_0x3e770f['as'],'attributes':_0x3e770f['attributes']};}):[]};}):[]};}):[]:[]})[_0xdef4('0xe')](function(_0x26718b){logger[_0xdef4('0xf')](_0xdef4('0x22'),_0x377beb);logger[_0xdef4('0x11')](_0xdef4('0x22'),_0x377beb,JSON['stringify'](_0x26718b));_0x469178(_0x26718b);})[_0xdef4('0x18')](function(_0x256165){logger['error'](_0xdef4('0x22'),_0x256165[_0xdef4('0x15')],_0x377beb);_0x18d3a0(_0x3b3a4[_0xdef4('0x14')](0x1f4,_0x256165[_0xdef4('0x15')]));});});};exports[_0xdef4('0x23')]=function(_0x2cadc4){var _0x2f0f33=this;return new Promise(function(_0x25fc2c,_0xe92978){return db[_0xdef4('0x19')][_0xdef4('0x24')]({'raw':_0x2cadc4['options']?_0x2cadc4['options'][_0xdef4('0x1b')]===undefined?!![]:![]:!![],'where':_0x2cadc4[_0xdef4('0x1a')]?_0x2cadc4[_0xdef4('0x1a')]['where']||null:null,'attributes':_0x2cadc4[_0xdef4('0x1a')]?_0x2cadc4[_0xdef4('0x1a')][_0xdef4('0x1d')]||null:null,'include':_0x2cadc4[_0xdef4('0x1a')]?_0x2cadc4['options']['include']?_['map'](_0x2cadc4[_0xdef4('0x1a')][_0xdef4('0x1f')],function(_0x46d84a){return{'model':db[_0x46d84a[_0xdef4('0x20')]],'as':_0x46d84a['as'],'attributes':_0x46d84a[_0xdef4('0x1d')],'include':_0x46d84a['include']?_[_0xdef4('0x21')](_0x46d84a[_0xdef4('0x1f')],function(_0x46f3b2){return{'model':db[_0x46f3b2[_0xdef4('0x20')]],'as':_0x46f3b2['as'],'attributes':_0x46f3b2[_0xdef4('0x1d')],'include':_0x46f3b2['include']?_[_0xdef4('0x21')](_0x46f3b2[_0xdef4('0x1f')],function(_0x3c2028){return{'model':db[_0x3c2028['model']],'as':_0x3c2028['as'],'attributes':_0x3c2028[_0xdef4('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5822fe){logger[_0xdef4('0xf')]('ShowZohoAccount',_0x2cadc4);logger[_0xdef4('0x11')](_0xdef4('0x23'),_0x2cadc4,JSON[_0xdef4('0x13')](_0x5822fe));_0x25fc2c(_0x5822fe);})[_0xdef4('0x18')](function(_0x133e0d){logger[_0xdef4('0x14')](_0xdef4('0x23'),_0x133e0d[_0xdef4('0x15')],_0x2cadc4);_0xe92978(_0x2f0f33['error'](0x1f4,_0x133e0d['message']));});});}; \ No newline at end of file +var _0xce14=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','raw','options','where','attributes','limit','include','map','model','then','GetZohoAccount','debug','catch','ShowZohoAccount','find','util','bluebird'];(function(_0x366bd8,_0x34c564){var _0x32f6f3=function(_0x163bc3){while(--_0x163bc3){_0x366bd8['push'](_0x366bd8['shift']());}};_0x32f6f3(++_0x34c564);}(_0xce14,0x17f));var _0x4ce1=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xce14[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x4ce1('0x0'));var moment=require('moment');var BPromise=require(_0x4ce1('0x1'));var rs=require(_0x4ce1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ce1('0x3'))['db'];var utils=require(_0x4ce1('0x4'));var logger=require(_0x4ce1('0x5'))(_0x4ce1('0x6'));var config=require(_0x4ce1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4ce1('0x8')][_0x4ce1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f603d,_0x2b9923,_0x539c1d){return new BPromise(function(_0x256648,_0x2beed4){return client[_0x4ce1('0xa')](_0x1f603d,_0x539c1d)['then'](function(_0x1b5bd8){logger[_0x4ce1('0xb')](_0x4ce1('0xc'),_0x2b9923,_0x4ce1('0xd'));logger['debug'](_0x4ce1('0xe'),_0x2b9923,_0x4ce1('0xd'),JSON[_0x4ce1('0xf')](_0x1b5bd8));if(_0x1b5bd8[_0x4ce1('0x10')]){if(_0x1b5bd8['error'][_0x4ce1('0x11')]===0x1f4){logger[_0x4ce1('0x10')](_0x4ce1('0xc'),_0x2b9923,_0x1b5bd8[_0x4ce1('0x10')][_0x4ce1('0x12')]);return _0x2beed4(_0x1b5bd8[_0x4ce1('0x10')][_0x4ce1('0x12')]);}logger[_0x4ce1('0x10')](_0x4ce1('0xc'),_0x2b9923,_0x1b5bd8[_0x4ce1('0x10')][_0x4ce1('0x12')]);return _0x256648(_0x1b5bd8['error'][_0x4ce1('0x12')]);}else{logger['info'](_0x4ce1('0xc'),_0x2b9923,_0x4ce1('0xd'));_0x256648(_0x1b5bd8[_0x4ce1('0x13')][_0x4ce1('0x12')]);}})['catch'](function(_0x221306){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x2b9923,_0x221306);_0x2beed4(_0x221306);});});}exports['GetZohoAccount']=function(_0xafda9e){var _0x34295c=this;return new Promise(function(_0x3105a9,_0x37efef){return db['ZohoAccount'][_0x4ce1('0x14')]({'raw':_0xafda9e['options']?_0xafda9e['options'][_0x4ce1('0x15')]===undefined?!![]:![]:!![],'where':_0xafda9e[_0x4ce1('0x16')]?_0xafda9e[_0x4ce1('0x16')][_0x4ce1('0x17')]||null:null,'attributes':_0xafda9e[_0x4ce1('0x16')]?_0xafda9e[_0x4ce1('0x16')][_0x4ce1('0x18')]||null:null,'limit':_0xafda9e[_0x4ce1('0x16')]?_0xafda9e['options'][_0x4ce1('0x19')]||null:null,'include':_0xafda9e[_0x4ce1('0x16')]?_0xafda9e['options'][_0x4ce1('0x1a')]?_[_0x4ce1('0x1b')](_0xafda9e['options'][_0x4ce1('0x1a')],function(_0x2da360){return{'model':db[_0x2da360['model']],'as':_0x2da360['as'],'attributes':_0x2da360['attributes'],'include':_0x2da360['include']?_[_0x4ce1('0x1b')](_0x2da360['include'],function(_0x41f6ed){return{'model':db[_0x41f6ed[_0x4ce1('0x1c')]],'as':_0x41f6ed['as'],'attributes':_0x41f6ed['attributes'],'include':_0x41f6ed[_0x4ce1('0x1a')]?_[_0x4ce1('0x1b')](_0x41f6ed[_0x4ce1('0x1a')],function(_0x7bca8c){return{'model':db[_0x7bca8c[_0x4ce1('0x1c')]],'as':_0x7bca8c['as'],'attributes':_0x7bca8c[_0x4ce1('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4ce1('0x1d')](function(_0x1d5c0b){logger[_0x4ce1('0xb')](_0x4ce1('0x1e'),_0xafda9e);logger[_0x4ce1('0x1f')](_0x4ce1('0x1e'),_0xafda9e,JSON[_0x4ce1('0xf')](_0x1d5c0b));_0x3105a9(_0x1d5c0b);})[_0x4ce1('0x20')](function(_0x1ceb1e){logger[_0x4ce1('0x10')](_0x4ce1('0x1e'),_0x1ceb1e[_0x4ce1('0x12')],_0xafda9e);_0x37efef(_0x34295c['error'](0x1f4,_0x1ceb1e[_0x4ce1('0x12')]));});});};exports[_0x4ce1('0x21')]=function(_0x3241ca){var _0x1ae95b=this;return new Promise(function(_0x28f1fb,_0xd0a77f){return db['ZohoAccount'][_0x4ce1('0x22')]({'raw':_0x3241ca[_0x4ce1('0x16')]?_0x3241ca[_0x4ce1('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3241ca['options']?_0x3241ca[_0x4ce1('0x16')][_0x4ce1('0x17')]||null:null,'attributes':_0x3241ca[_0x4ce1('0x16')]?_0x3241ca[_0x4ce1('0x16')][_0x4ce1('0x18')]||null:null,'include':_0x3241ca[_0x4ce1('0x16')]?_0x3241ca['options']['include']?_[_0x4ce1('0x1b')](_0x3241ca[_0x4ce1('0x16')]['include'],function(_0xaf067c){return{'model':db[_0xaf067c[_0x4ce1('0x1c')]],'as':_0xaf067c['as'],'attributes':_0xaf067c[_0x4ce1('0x18')],'include':_0xaf067c[_0x4ce1('0x1a')]?_[_0x4ce1('0x1b')](_0xaf067c[_0x4ce1('0x1a')],function(_0x3099e1){return{'model':db[_0x3099e1[_0x4ce1('0x1c')]],'as':_0x3099e1['as'],'attributes':_0x3099e1[_0x4ce1('0x18')],'include':_0x3099e1[_0x4ce1('0x1a')]?_[_0x4ce1('0x1b')](_0x3099e1['include'],function(_0x2825ee){return{'model':db[_0x2825ee[_0x4ce1('0x1c')]],'as':_0x2825ee['as'],'attributes':_0x2825ee[_0x4ce1('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53048d){logger[_0x4ce1('0xb')]('ShowZohoAccount',_0x3241ca);logger[_0x4ce1('0x1f')](_0x4ce1('0x21'),_0x3241ca,JSON[_0x4ce1('0xf')](_0x53048d));_0x28f1fb(_0x53048d);})[_0x4ce1('0x20')](function(_0x13321e){logger[_0x4ce1('0x10')](_0x4ce1('0x21'),_0x13321e['message'],_0x3241ca);_0xd0a77f(_0x1ae95b['error'](0x1f4,_0x13321e[_0x4ce1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index fd0bae7..529f997 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 _0xe7e5=['/:id','show','/:id/fields','isAuthenticated','getFields','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','index'];(function(_0x550b93,_0x30b98d){var _0x264b8f=function(_0x7381ad){while(--_0x7381ad){_0x550b93['push'](_0x550b93['shift']());}};_0x264b8f(++_0x30b98d);}(_0xe7e5,0x185));var _0x5e7e=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0xe7e5[_0x1e393b];return _0x3d0bfe;};'use strict';var multer=require(_0x5e7e('0x0'));var util=require(_0x5e7e('0x1'));var path=require('path');var timeout=require(_0x5e7e('0x2'));var express=require(_0x5e7e('0x3'));var router=express['Router']();var fs_extra=require(_0x5e7e('0x4'));var auth=require(_0x5e7e('0x5'));var interaction=require(_0x5e7e('0x6'));var config=require('../../config/environment');var controller=require(_0x5e7e('0x7'));router[_0x5e7e('0x8')]('/',auth['isAuthenticated'](),controller[_0x5e7e('0x9')]);router['get'](_0x5e7e('0xa'),auth['isAuthenticated'](),controller[_0x5e7e('0xb')]);router[_0x5e7e('0x8')](_0x5e7e('0xc'),auth[_0x5e7e('0xd')](),controller[_0x5e7e('0xe')]);router['get']('/:id/subjects',auth[_0x5e7e('0xd')](),controller['getSubjects']);router[_0x5e7e('0x8')]('/:id/descriptions',auth[_0x5e7e('0xd')](),controller['getDescriptions']);router[_0x5e7e('0xf')]('/',auth[_0x5e7e('0xd')](),controller[_0x5e7e('0x10')]);router[_0x5e7e('0x11')]('/:id',auth[_0x5e7e('0xd')](),controller[_0x5e7e('0x12')]);router[_0x5e7e('0x13')](_0x5e7e('0xa'),auth[_0x5e7e('0xd')](),controller[_0x5e7e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xdc57=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','put','/:id','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x34fe71,_0x326466){var _0x8807c2=function(_0x5cdcda){while(--_0x5cdcda){_0x34fe71['push'](_0x34fe71['shift']());}};_0x8807c2(++_0x326466);}(_0xdc57,0x11c));var _0x7dc5=function(_0x4f64f7,_0x4bd9cf){_0x4f64f7=_0x4f64f7-0x0;var _0x521a34=_0xdc57[_0x4f64f7];return _0x521a34;};'use strict';var multer=require(_0x7dc5('0x0'));var util=require('util');var path=require(_0x7dc5('0x1'));var timeout=require(_0x7dc5('0x2'));var express=require(_0x7dc5('0x3'));var router=express[_0x7dc5('0x4')]();var fs_extra=require(_0x7dc5('0x5'));var auth=require(_0x7dc5('0x6'));var interaction=require(_0x7dc5('0x7'));var config=require(_0x7dc5('0x8'));var controller=require(_0x7dc5('0x9'));router[_0x7dc5('0xa')]('/',auth[_0x7dc5('0xb')](),controller[_0x7dc5('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7dc5('0xd')]);router[_0x7dc5('0xa')](_0x7dc5('0xe'),auth[_0x7dc5('0xb')](),controller[_0x7dc5('0xf')]);router['get'](_0x7dc5('0x10'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x7dc5('0xa')](_0x7dc5('0x11'),auth[_0x7dc5('0xb')](),controller['getDescriptions']);router[_0x7dc5('0x12')]('/',auth[_0x7dc5('0xb')](),controller['create']);router[_0x7dc5('0x13')](_0x7dc5('0x14'),auth[_0x7dc5('0xb')](),controller[_0x7dc5('0x15')]);router['delete'](_0x7dc5('0x14'),auth[_0x7dc5('0xb')](),controller[_0x7dc5('0x16')]);module[_0x7dc5('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index e76bb46..e1c34fb 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 _0x778f=['contact','nothing','sequelize','STRING','ENUM','lead'];(function(_0xe3b7bb,_0x263836){var _0x2df486=function(_0x527828){while(--_0x527828){_0xe3b7bb['push'](_0xe3b7bb['shift']());}};_0x2df486(++_0x263836);}(_0x778f,0x134));var _0xf778=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x778f[_0x4e7d25];return _0x526fe6;};'use strict';var Sequelize=require(_0xf778('0x0'));module['exports']={'name':{'type':Sequelize[_0xf778('0x1')]},'moduleCreate':{'type':Sequelize[_0xf778('0x2')](_0xf778('0x3'),_0xf778('0x4'),_0xf778('0x5')),'defaultValue':_0xf778('0x3')},'moduleSearch':{'type':Sequelize[_0xf778('0x2')]('contact_lead','contact',_0xf778('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xf778('0x1')]}}; \ No newline at end of file +var _0x5989=['exports','ENUM','lead','nothing','contact_lead','STRING','sequelize'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x5989,0xa0));var _0x9598=function(_0x22dae4,_0x51d7a4){_0x22dae4=_0x22dae4-0x0;var _0x5862ff=_0x5989[_0x22dae4];return _0x5862ff;};'use strict';var Sequelize=require(_0x9598('0x0'));module[_0x9598('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x9598('0x2')](_0x9598('0x3'),'contact',_0x9598('0x4')),'defaultValue':_0x9598('0x3')},'moduleSearch':{'type':Sequelize[_0x9598('0x2')](_0x9598('0x5'),'contact',_0x9598('0x3')),'defaultValue':_0x9598('0x5')},'description':{'type':Sequelize[_0x9598('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 948182c..4ee3972 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 _0xe00b=['show','length','options','find','catch','create','body','params','getFields','ZohoField','sort','pick','findOne','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x53c9a8,_0x5f3e3f){var _0x54b73a=function(_0x280408){while(--_0x280408){_0x53c9a8['push'](_0x53c9a8['shift']());}};_0x54b73a(++_0x5f3e3f);}(_0xe00b,0x103));var _0xbe00=function(_0x2d2ccc,_0x30f2fe){_0x2d2ccc=_0x2d2ccc-0x0;var _0x54dc55=_0xe00b[_0x2d2ccc];return _0x54dc55;};'use strict';var emlformat=require(_0xbe00('0x0'));var rimraf=require(_0xbe00('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbe00('0x2'));var rp=require('request-promise');var moment=require(_0xbe00('0x3'));var BPromise=require(_0xbe00('0x4'));var Mustache=require(_0xbe00('0x5'));var util=require(_0xbe00('0x6'));var path=require('path');var sox=require(_0xbe00('0x7'));var csv=require(_0xbe00('0x8'));var ejs=require(_0xbe00('0x9'));var fs=require('fs');var fs_extra=require(_0xbe00('0xa'));var _=require(_0xbe00('0xb'));var squel=require('squel');var crypto=require(_0xbe00('0xc'));var jsforce=require(_0xbe00('0xd'));var deskjs=require(_0xbe00('0xe'));var toCsv=require(_0xbe00('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbe00('0xf'));var authService=require(_0xbe00('0x10'));var qs=require(_0xbe00('0x11'));var as=require(_0xbe00('0x12'));var hardwareService=require(_0xbe00('0x13'));var logger=require(_0xbe00('0x14'))(_0xbe00('0x15'));var utils=require(_0xbe00('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbe00('0x17'))['db'];function respondWithStatusCode(_0x3e5d6f,_0x428211){_0x428211=_0x428211||0xcc;return function(_0x1a9769){if(_0x1a9769){return _0x3e5d6f[_0xbe00('0x18')](_0x428211);}return _0x3e5d6f[_0xbe00('0x19')](_0x428211)[_0xbe00('0x1a')]();};}function respondWithResult(_0x3bf3fc,_0x54a242){_0x54a242=_0x54a242||0xc8;return function(_0x47ea33){if(_0x47ea33){return _0x3bf3fc[_0xbe00('0x19')](_0x54a242)[_0xbe00('0x1b')](_0x47ea33);}};}function respondWithFilteredResult(_0x3cbce3,_0x3e1fec){return function(_0x2db50b){if(_0x2db50b){var _0x35ba38=typeof _0x3e1fec[_0xbe00('0x1c')]==='undefined'&&typeof _0x3e1fec[_0xbe00('0x1d')]===_0xbe00('0x1e');var _0x556cce=_0x2db50b[_0xbe00('0x1f')];var _0x54129a=_0x35ba38?0x0:_0x3e1fec[_0xbe00('0x1c')];var _0x1bb5ee=_0x35ba38?_0x2db50b['count']:_0x3e1fec[_0xbe00('0x1c')]+_0x3e1fec[_0xbe00('0x1d')];var _0x4f1c29;if(_0x1bb5ee>=_0x556cce){_0x1bb5ee=_0x556cce;_0x4f1c29=0xc8;}else{_0x4f1c29=0xce;}_0x3cbce3[_0xbe00('0x19')](_0x4f1c29);return _0x3cbce3['set'](_0xbe00('0x20'),_0x54129a+'-'+_0x1bb5ee+'/'+_0x556cce)[_0xbe00('0x1b')](_0x2db50b);}return null;};}function patchUpdates(_0x437e05){return function(_0x2f6835){try{jsonpatch[_0xbe00('0x21')](_0x2f6835,_0x437e05,!![]);}catch(_0x27202b){return BPromise[_0xbe00('0x22')](_0x27202b);}return _0x2f6835['save']();};}function saveUpdates(_0x2f682f,_0x8866d4){return function(_0x399b1e){if(_0x399b1e){return _0x399b1e[_0xbe00('0x23')](_0x2f682f)[_0xbe00('0x24')](function(_0x506c40){return _0x506c40;});}return null;};}function removeEntity(_0x4277e6,_0x21149f){return function(_0x17d2d7){if(_0x17d2d7){return _0x17d2d7[_0xbe00('0x25')]()['then'](function(){_0x4277e6[_0xbe00('0x19')](0xcc)[_0xbe00('0x1a')]();});}};}function handleEntityNotFound(_0x984f5a,_0x8aad3c){return function(_0x2c0e01){if(!_0x2c0e01){_0x984f5a['sendStatus'](0x194);}return _0x2c0e01;};}function handleError(_0x1c2134,_0x45f3ab){_0x45f3ab=_0x45f3ab||0x1f4;return function(_0x3b0243){logger[_0xbe00('0x26')](_0x3b0243['stack']);if(_0x3b0243[_0xbe00('0x27')]){delete _0x3b0243[_0xbe00('0x27')];}_0x1c2134[_0xbe00('0x19')](_0x45f3ab)[_0xbe00('0x28')](_0x3b0243);};}exports[_0xbe00('0x29')]=function(_0x46d0ef,_0x4b31c4){var _0x5dfd52={},_0x2a9106={},_0x140315={'count':0x0,'rows':[]};var _0x571860=_[_0xbe00('0x2a')](db[_0xbe00('0x2b')][_0xbe00('0x2c')],function(_0x18de66){return{'name':_0x18de66[_0xbe00('0x2d')],'type':_0x18de66[_0xbe00('0x2e')][_0xbe00('0x2f')]};});_0x2a9106[_0xbe00('0x30')]=_[_0xbe00('0x2a')](_0x571860,_0xbe00('0x27'));_0x2a9106[_0xbe00('0x31')]=_[_0xbe00('0x32')](_0x46d0ef[_0xbe00('0x31')]);_0x2a9106[_0xbe00('0x33')]=_[_0xbe00('0x34')](_0x2a9106[_0xbe00('0x30')],_0x2a9106[_0xbe00('0x31')]);_0x5dfd52[_0xbe00('0x35')]=_[_0xbe00('0x34')](_0x2a9106[_0xbe00('0x30')],qs[_0xbe00('0x36')](_0x46d0ef['query']['fields']));_0x5dfd52['attributes']=_0x5dfd52[_0xbe00('0x35')]['length']?_0x5dfd52[_0xbe00('0x35')]:_0x2a9106[_0xbe00('0x30')];if(!_0x46d0ef['query']['hasOwnProperty'](_0xbe00('0x37'))){_0x5dfd52['limit']=qs[_0xbe00('0x1d')](_0x46d0ef[_0xbe00('0x31')][_0xbe00('0x1d')]);_0x5dfd52[_0xbe00('0x1c')]=qs[_0xbe00('0x1c')](_0x46d0ef['query'][_0xbe00('0x1c')]);}_0x5dfd52[_0xbe00('0x38')]=qs['sort'](_0x46d0ef['query']['sort']);_0x5dfd52[_0xbe00('0x39')]=qs[_0xbe00('0x33')](_['pick'](_0x46d0ef[_0xbe00('0x31')],_0x2a9106[_0xbe00('0x33')]),_0x571860);if(_0x46d0ef[_0xbe00('0x31')][_0xbe00('0x3a')]){_0x5dfd52[_0xbe00('0x39')]=_[_0xbe00('0x3b')](_0x5dfd52[_0xbe00('0x39')],{'$or':_[_0xbe00('0x2a')](_0x571860,function(_0x573436){if(_0x573436[_0xbe00('0x2e')]!==_0xbe00('0x3c')){var _0x33706d={};_0x33706d[_0x573436['name']]={'$like':'%'+_0x46d0ef['query'][_0xbe00('0x3a')]+'%'};return _0x33706d;}})});}_0x5dfd52=_[_0xbe00('0x3b')]({},_0x5dfd52,_0x46d0ef['options']);var _0x4bf2c1={'where':_0x5dfd52[_0xbe00('0x39')]};return db[_0xbe00('0x2b')][_0xbe00('0x1f')](_0x4bf2c1)[_0xbe00('0x24')](function(_0x592285){_0x140315['count']=_0x592285;if(_0x46d0ef['query'][_0xbe00('0x3d')]){_0x5dfd52[_0xbe00('0x3e')]=[{'all':!![]}];}return db[_0xbe00('0x2b')][_0xbe00('0x3f')](_0x5dfd52);})[_0xbe00('0x24')](function(_0x16258f){_0x140315[_0xbe00('0x40')]=_0x16258f;return _0x140315;})['then'](respondWithFilteredResult(_0x4b31c4,_0x5dfd52))['catch'](handleError(_0x4b31c4,null));};exports[_0xbe00('0x41')]=function(_0x5326a6,_0x2a9ccd){var _0x213534={'raw':![],'where':{'id':_0x5326a6['params']['id']}},_0x5b20ab={};_0x5b20ab[_0xbe00('0x30')]=_['keys'](db[_0xbe00('0x2b')][_0xbe00('0x2c')]);_0x5b20ab['query']=_[_0xbe00('0x32')](_0x5326a6['query']);_0x5b20ab[_0xbe00('0x33')]=_[_0xbe00('0x34')](_0x5b20ab[_0xbe00('0x30')],_0x5b20ab[_0xbe00('0x31')]);_0x213534[_0xbe00('0x35')]=_[_0xbe00('0x34')](_0x5b20ab[_0xbe00('0x30')],qs[_0xbe00('0x36')](_0x5326a6[_0xbe00('0x31')][_0xbe00('0x36')]));_0x213534['attributes']=_0x213534[_0xbe00('0x35')][_0xbe00('0x42')]?_0x213534['attributes']:_0x5b20ab[_0xbe00('0x30')];if(_0x5326a6[_0xbe00('0x31')][_0xbe00('0x3d')]){_0x213534[_0xbe00('0x3e')]=[{'all':!![]}];}_0x213534=_[_0xbe00('0x3b')]({},_0x213534,_0x5326a6[_0xbe00('0x43')]);return db[_0xbe00('0x2b')][_0xbe00('0x44')](_0x213534)[_0xbe00('0x24')](handleEntityNotFound(_0x2a9ccd,null))['then'](respondWithResult(_0x2a9ccd,null))[_0xbe00('0x45')](handleError(_0x2a9ccd,null));};exports['create']=function(_0x5cb757,_0x444598){return db['ZohoConfiguration'][_0xbe00('0x46')](_0x5cb757[_0xbe00('0x47')],{})[_0xbe00('0x24')](respondWithResult(_0x444598,0xc9))[_0xbe00('0x45')](handleError(_0x444598,null));};exports[_0xbe00('0x23')]=function(_0x2f3aa0,_0x4df01a){if(_0x2f3aa0[_0xbe00('0x47')]['id']){delete _0x2f3aa0[_0xbe00('0x47')]['id'];}return db[_0xbe00('0x2b')][_0xbe00('0x44')]({'where':{'id':_0x2f3aa0['params']['id']}})['then'](handleEntityNotFound(_0x4df01a,null))[_0xbe00('0x24')](saveUpdates(_0x2f3aa0[_0xbe00('0x47')],null))[_0xbe00('0x24')](respondWithResult(_0x4df01a,null))[_0xbe00('0x45')](handleError(_0x4df01a,null));};exports['destroy']=function(_0x325354,_0x496863){return db['ZohoConfiguration'][_0xbe00('0x44')]({'where':{'id':_0x325354[_0xbe00('0x48')]['id']}})[_0xbe00('0x24')](handleEntityNotFound(_0x496863,null))['then'](removeEntity(_0x496863,null))['catch'](handleError(_0x496863,null));};exports[_0xbe00('0x49')]=function(_0x363361,_0x5dbb20,_0x2ba9ae){var _0x3c98ee={};var _0x112c24={};var _0x50dbb4;var _0x10d72c;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x363361['params']['id']}})[_0xbe00('0x24')](handleEntityNotFound(_0x5dbb20,null))[_0xbe00('0x24')](function(_0x80662c){if(_0x80662c){_0x50dbb4=_0x80662c;_0x112c24[_0xbe00('0x30')]=_[_0xbe00('0x32')](db[_0xbe00('0x4a')][_0xbe00('0x2c')]);_0x112c24[_0xbe00('0x31')]=_[_0xbe00('0x32')](_0x363361[_0xbe00('0x31')]);_0x112c24[_0xbe00('0x33')]=_[_0xbe00('0x34')](_0x112c24[_0xbe00('0x30')],_0x112c24[_0xbe00('0x31')]);_0x3c98ee[_0xbe00('0x35')]=_[_0xbe00('0x34')](_0x112c24['model'],qs[_0xbe00('0x36')](_0x363361[_0xbe00('0x31')][_0xbe00('0x36')]));_0x3c98ee[_0xbe00('0x35')]=_0x3c98ee[_0xbe00('0x35')]['length']?_0x3c98ee[_0xbe00('0x35')]:_0x112c24[_0xbe00('0x30')];_0x3c98ee[_0xbe00('0x38')]=qs[_0xbe00('0x4b')](_0x363361[_0xbe00('0x31')]['sort']);_0x3c98ee['where']=qs[_0xbe00('0x33')](_[_0xbe00('0x4c')](_0x363361[_0xbe00('0x31')],_0x112c24[_0xbe00('0x33')]));if(_0x363361[_0xbe00('0x31')][_0xbe00('0x3a')]){_0x3c98ee['where']=_['merge'](_0x3c98ee[_0xbe00('0x39')],{'$or':_[_0xbe00('0x2a')](_0x3c98ee['attributes'],function(_0x58d614){var _0x20eff7={};_0x20eff7[_0x58d614]={'$like':'%'+_0x363361[_0xbe00('0x31')][_0xbe00('0x3a')]+'%'};return _0x20eff7;})});}_0x3c98ee=_[_0xbe00('0x3b')]({},_0x3c98ee,_0x363361[_0xbe00('0x43')]);return _0x50dbb4[_0xbe00('0x49')](_0x3c98ee);}})[_0xbe00('0x24')](function(_0x1bb899){if(_0x1bb899){_0x10d72c=_0x1bb899['length'];if(!_0x363361[_0xbe00('0x31')]['hasOwnProperty']('nolimit')){_0x3c98ee[_0xbe00('0x1d')]=qs[_0xbe00('0x1d')](_0x363361[_0xbe00('0x31')][_0xbe00('0x1d')]);_0x3c98ee[_0xbe00('0x1c')]=qs[_0xbe00('0x1c')](_0x363361[_0xbe00('0x31')]['offset']);}return _0x50dbb4[_0xbe00('0x49')](_0x3c98ee);}})[_0xbe00('0x24')](function(_0x43da96){if(_0x43da96){return _0x43da96?{'count':_0x10d72c,'rows':_0x43da96}:null;}})[_0xbe00('0x24')](respondWithResult(_0x5dbb20,null))[_0xbe00('0x45')](handleError(_0x5dbb20,null));};exports['getSubjects']=function(_0x2e54f2,_0x2d8331,_0x155be5){var _0x888a52={};var _0x2dedc7={};var _0x7c479f;var _0x425f3d;return db[_0xbe00('0x2b')][_0xbe00('0x4d')]({'where':{'id':_0x2e54f2[_0xbe00('0x48')]['id']}})[_0xbe00('0x24')](handleEntityNotFound(_0x2d8331,null))[_0xbe00('0x24')](function(_0x58f784){if(_0x58f784){_0x7c479f=_0x58f784;_0x2dedc7[_0xbe00('0x30')]=_[_0xbe00('0x32')](db[_0xbe00('0x4a')][_0xbe00('0x2c')]);_0x2dedc7['query']=_['keys'](_0x2e54f2[_0xbe00('0x31')]);_0x2dedc7[_0xbe00('0x33')]=_[_0xbe00('0x34')](_0x2dedc7['model'],_0x2dedc7[_0xbe00('0x31')]);_0x888a52['attributes']=_['intersection'](_0x2dedc7[_0xbe00('0x30')],qs[_0xbe00('0x36')](_0x2e54f2[_0xbe00('0x31')][_0xbe00('0x36')]));_0x888a52[_0xbe00('0x35')]=_0x888a52['attributes'][_0xbe00('0x42')]?_0x888a52[_0xbe00('0x35')]:_0x2dedc7[_0xbe00('0x30')];_0x888a52[_0xbe00('0x38')]=qs['sort'](_0x2e54f2[_0xbe00('0x31')][_0xbe00('0x4b')]);_0x888a52[_0xbe00('0x39')]=qs[_0xbe00('0x33')](_['pick'](_0x2e54f2[_0xbe00('0x31')],_0x2dedc7['filters']));if(_0x2e54f2['query'][_0xbe00('0x3a')]){_0x888a52[_0xbe00('0x39')]=_[_0xbe00('0x3b')](_0x888a52[_0xbe00('0x39')],{'$or':_[_0xbe00('0x2a')](_0x888a52['attributes'],function(_0xd5633e){var _0x2650e3={};_0x2650e3[_0xd5633e]={'$like':'%'+_0x2e54f2[_0xbe00('0x31')][_0xbe00('0x3a')]+'%'};return _0x2650e3;})});}_0x888a52=_[_0xbe00('0x3b')]({},_0x888a52,_0x2e54f2[_0xbe00('0x43')]);return _0x7c479f[_0xbe00('0x4e')](_0x888a52);}})[_0xbe00('0x24')](function(_0x5f47be){if(_0x5f47be){_0x425f3d=_0x5f47be[_0xbe00('0x42')];if(!_0x2e54f2['query'][_0xbe00('0x4f')]('nolimit')){_0x888a52[_0xbe00('0x1d')]=qs[_0xbe00('0x1d')](_0x2e54f2[_0xbe00('0x31')][_0xbe00('0x1d')]);_0x888a52['offset']=qs['offset'](_0x2e54f2['query'][_0xbe00('0x1c')]);}return _0x7c479f[_0xbe00('0x4e')](_0x888a52);}})[_0xbe00('0x24')](function(_0x19965a){if(_0x19965a){return _0x19965a?{'count':_0x425f3d,'rows':_0x19965a}:null;}})['then'](respondWithResult(_0x2d8331,null))[_0xbe00('0x45')](handleError(_0x2d8331,null));};exports[_0xbe00('0x50')]=function(_0x3313b5,_0x43e597,_0x1d3cfc){var _0x42b7ec={};var _0xc83c4e={};var _0x2007bd;var _0x585dbd;return db[_0xbe00('0x2b')]['findOne']({'where':{'id':_0x3313b5[_0xbe00('0x48')]['id']}})['then'](handleEntityNotFound(_0x43e597,null))[_0xbe00('0x24')](function(_0x5b1cd6){if(_0x5b1cd6){_0x2007bd=_0x5b1cd6;_0xc83c4e['model']=_['keys'](db[_0xbe00('0x4a')][_0xbe00('0x2c')]);_0xc83c4e[_0xbe00('0x31')]=_[_0xbe00('0x32')](_0x3313b5[_0xbe00('0x31')]);_0xc83c4e[_0xbe00('0x33')]=_[_0xbe00('0x34')](_0xc83c4e[_0xbe00('0x30')],_0xc83c4e[_0xbe00('0x31')]);_0x42b7ec[_0xbe00('0x35')]=_[_0xbe00('0x34')](_0xc83c4e[_0xbe00('0x30')],qs['fields'](_0x3313b5[_0xbe00('0x31')][_0xbe00('0x36')]));_0x42b7ec[_0xbe00('0x35')]=_0x42b7ec[_0xbe00('0x35')][_0xbe00('0x42')]?_0x42b7ec[_0xbe00('0x35')]:_0xc83c4e[_0xbe00('0x30')];_0x42b7ec[_0xbe00('0x38')]=qs['sort'](_0x3313b5['query'][_0xbe00('0x4b')]);_0x42b7ec[_0xbe00('0x39')]=qs[_0xbe00('0x33')](_[_0xbe00('0x4c')](_0x3313b5['query'],_0xc83c4e[_0xbe00('0x33')]));if(_0x3313b5[_0xbe00('0x31')][_0xbe00('0x3a')]){_0x42b7ec[_0xbe00('0x39')]=_['merge'](_0x42b7ec[_0xbe00('0x39')],{'$or':_[_0xbe00('0x2a')](_0x42b7ec['attributes'],function(_0x33641b){var _0x228695={};_0x228695[_0x33641b]={'$like':'%'+_0x3313b5[_0xbe00('0x31')][_0xbe00('0x3a')]+'%'};return _0x228695;})});}_0x42b7ec=_['merge']({},_0x42b7ec,_0x3313b5[_0xbe00('0x43')]);return _0x2007bd[_0xbe00('0x50')](_0x42b7ec);}})[_0xbe00('0x24')](function(_0x364fd4){if(_0x364fd4){_0x585dbd=_0x364fd4[_0xbe00('0x42')];if(!_0x3313b5[_0xbe00('0x31')][_0xbe00('0x4f')](_0xbe00('0x37'))){_0x42b7ec[_0xbe00('0x1d')]=qs[_0xbe00('0x1d')](_0x3313b5[_0xbe00('0x31')][_0xbe00('0x1d')]);_0x42b7ec[_0xbe00('0x1c')]=qs['offset'](_0x3313b5[_0xbe00('0x31')][_0xbe00('0x1c')]);}return _0x2007bd[_0xbe00('0x50')](_0x42b7ec);}})[_0xbe00('0x24')](function(_0x8216e8){if(_0x8216e8){return _0x8216e8?{'count':_0x585dbd,'rows':_0x8216e8}:null;}})[_0xbe00('0x24')](respondWithResult(_0x43e597,null))[_0xbe00('0x45')](handleError(_0x43e597,null));}; \ No newline at end of file +var _0xfd4e=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','options','include','findAll','rows','catch','show','params','create','body','find','ZohoField','getFields','getSubjects','getDescriptions','findOne','eml-format','rimraf','zip-dir','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','reject','save','update','then','destroy','stack','name','index','map','ZohoConfiguration','rawAttributes','fieldName'];(function(_0x256859,_0x599dd6){var _0x172fb3=function(_0x5284dc){while(--_0x5284dc){_0x256859['push'](_0x256859['shift']());}};_0x172fb3(++_0x599dd6);}(_0xfd4e,0x1f4));var _0xefd4=function(_0x1c3314,_0x58c88e){_0x1c3314=_0x1c3314-0x0;var _0x3e24f4=_0xfd4e[_0x1c3314];return _0x3e24f4;};'use strict';var emlformat=require(_0xefd4('0x0'));var rimraf=require(_0xefd4('0x1'));var zipdir=require(_0xefd4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xefd4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xefd4('0x4'));var path=require(_0xefd4('0x5'));var sox=require(_0xefd4('0x6'));var csv=require(_0xefd4('0x7'));var ejs=require(_0xefd4('0x8'));var fs=require('fs');var fs_extra=require(_0xefd4('0x9'));var _=require(_0xefd4('0xa'));var squel=require('squel');var crypto=require(_0xefd4('0xb'));var jsforce=require(_0xefd4('0xc'));var deskjs=require(_0xefd4('0xd'));var toCsv=require(_0xefd4('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xefd4('0xe'));var authService=require(_0xefd4('0xf'));var qs=require(_0xefd4('0x10'));var as=require(_0xefd4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xefd4('0x12'))(_0xefd4('0x13'));var utils=require(_0xefd4('0x14'));var config=require(_0xefd4('0x15'));var licenseUtil=require(_0xefd4('0x16'));var db=require(_0xefd4('0x17'))['db'];function respondWithStatusCode(_0x18a23e,_0x34a59e){_0x34a59e=_0x34a59e||0xcc;return function(_0x42b746){if(_0x42b746){return _0x18a23e[_0xefd4('0x18')](_0x34a59e);}return _0x18a23e['status'](_0x34a59e)[_0xefd4('0x19')]();};}function respondWithResult(_0x43d562,_0x145fe4){_0x145fe4=_0x145fe4||0xc8;return function(_0x3af67c){if(_0x3af67c){return _0x43d562['status'](_0x145fe4)[_0xefd4('0x1a')](_0x3af67c);}};}function respondWithFilteredResult(_0x28497e,_0x11d961){return function(_0x6ce4cc){if(_0x6ce4cc){var _0x14b3fa=typeof _0x11d961[_0xefd4('0x1b')]===_0xefd4('0x1c')&&typeof _0x11d961['limit']==='undefined';var _0x3063df=_0x6ce4cc[_0xefd4('0x1d')];var _0x1de030=_0x14b3fa?0x0:_0x11d961[_0xefd4('0x1b')];var _0x547739=_0x14b3fa?_0x6ce4cc['count']:_0x11d961[_0xefd4('0x1b')]+_0x11d961[_0xefd4('0x1e')];var _0x2138f2;if(_0x547739>=_0x3063df){_0x547739=_0x3063df;_0x2138f2=0xc8;}else{_0x2138f2=0xce;}_0x28497e[_0xefd4('0x1f')](_0x2138f2);return _0x28497e[_0xefd4('0x20')]('Content-Range',_0x1de030+'-'+_0x547739+'/'+_0x3063df)[_0xefd4('0x1a')](_0x6ce4cc);}return null;};}function patchUpdates(_0x3a133c){return function(_0x1fe5d6){try{jsonpatch[_0xefd4('0x21')](_0x1fe5d6,_0x3a133c,!![]);}catch(_0x4e9789){return BPromise[_0xefd4('0x22')](_0x4e9789);}return _0x1fe5d6[_0xefd4('0x23')]();};}function saveUpdates(_0x515b1e,_0x8c2bcd){return function(_0xaf558a){if(_0xaf558a){return _0xaf558a[_0xefd4('0x24')](_0x515b1e)[_0xefd4('0x25')](function(_0xaa6451){return _0xaa6451;});}return null;};}function removeEntity(_0x244331,_0x358105){return function(_0x5a20de){if(_0x5a20de){return _0x5a20de[_0xefd4('0x26')]()[_0xefd4('0x25')](function(){_0x244331[_0xefd4('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12df6b,_0x3d6dfd){return function(_0x3545c7){if(!_0x3545c7){_0x12df6b[_0xefd4('0x18')](0x194);}return _0x3545c7;};}function handleError(_0x507ca2,_0x5daa5d){_0x5daa5d=_0x5daa5d||0x1f4;return function(_0x205f80){logger['error'](_0x205f80[_0xefd4('0x27')]);if(_0x205f80['name']){delete _0x205f80[_0xefd4('0x28')];}_0x507ca2[_0xefd4('0x1f')](_0x5daa5d)['send'](_0x205f80);};}exports[_0xefd4('0x29')]=function(_0x3e006d,_0x3b6494){var _0x2e8c74={},_0x4dcab={},_0x2f1fe7={'count':0x0,'rows':[]};var _0x2e8b10=_[_0xefd4('0x2a')](db[_0xefd4('0x2b')][_0xefd4('0x2c')],function(_0x531358){return{'name':_0x531358[_0xefd4('0x2d')],'type':_0x531358[_0xefd4('0x2e')][_0xefd4('0x2f')]};});_0x4dcab[_0xefd4('0x30')]=_['map'](_0x2e8b10,_0xefd4('0x28'));_0x4dcab[_0xefd4('0x31')]=_[_0xefd4('0x32')](_0x3e006d[_0xefd4('0x31')]);_0x4dcab[_0xefd4('0x33')]=_[_0xefd4('0x34')](_0x4dcab['model'],_0x4dcab[_0xefd4('0x31')]);_0x2e8c74[_0xefd4('0x35')]=_['intersection'](_0x4dcab['model'],qs[_0xefd4('0x36')](_0x3e006d[_0xefd4('0x31')][_0xefd4('0x36')]));_0x2e8c74[_0xefd4('0x35')]=_0x2e8c74[_0xefd4('0x35')][_0xefd4('0x37')]?_0x2e8c74['attributes']:_0x4dcab[_0xefd4('0x30')];if(!_0x3e006d[_0xefd4('0x31')][_0xefd4('0x38')](_0xefd4('0x39'))){_0x2e8c74['limit']=qs[_0xefd4('0x1e')](_0x3e006d['query']['limit']);_0x2e8c74[_0xefd4('0x1b')]=qs['offset'](_0x3e006d[_0xefd4('0x31')]['offset']);}_0x2e8c74['order']=qs[_0xefd4('0x3a')](_0x3e006d[_0xefd4('0x31')][_0xefd4('0x3a')]);_0x2e8c74['where']=qs[_0xefd4('0x33')](_[_0xefd4('0x3b')](_0x3e006d[_0xefd4('0x31')],_0x4dcab[_0xefd4('0x33')]),_0x2e8b10);if(_0x3e006d[_0xefd4('0x31')][_0xefd4('0x3c')]){_0x2e8c74['where']=_[_0xefd4('0x3d')](_0x2e8c74[_0xefd4('0x3e')],{'$or':_[_0xefd4('0x2a')](_0x2e8b10,function(_0x3ba167){if(_0x3ba167[_0xefd4('0x2e')]!=='VIRTUAL'){var _0x166da9={};_0x166da9[_0x3ba167[_0xefd4('0x28')]]={'$like':'%'+_0x3e006d[_0xefd4('0x31')][_0xefd4('0x3c')]+'%'};return _0x166da9;}})});}_0x2e8c74=_[_0xefd4('0x3d')]({},_0x2e8c74,_0x3e006d[_0xefd4('0x3f')]);var _0x565c19={'where':_0x2e8c74[_0xefd4('0x3e')]};return db[_0xefd4('0x2b')][_0xefd4('0x1d')](_0x565c19)[_0xefd4('0x25')](function(_0x31cb78){_0x2f1fe7['count']=_0x31cb78;if(_0x3e006d[_0xefd4('0x31')]['includeAll']){_0x2e8c74[_0xefd4('0x40')]=[{'all':!![]}];}return db[_0xefd4('0x2b')][_0xefd4('0x41')](_0x2e8c74);})[_0xefd4('0x25')](function(_0x369d35){_0x2f1fe7[_0xefd4('0x42')]=_0x369d35;return _0x2f1fe7;})[_0xefd4('0x25')](respondWithFilteredResult(_0x3b6494,_0x2e8c74))[_0xefd4('0x43')](handleError(_0x3b6494,null));};exports[_0xefd4('0x44')]=function(_0x1b6b1b,_0x120689){var _0x284a0a={'raw':![],'where':{'id':_0x1b6b1b[_0xefd4('0x45')]['id']}},_0x52eb43={};_0x52eb43[_0xefd4('0x30')]=_[_0xefd4('0x32')](db['ZohoConfiguration'][_0xefd4('0x2c')]);_0x52eb43[_0xefd4('0x31')]=_[_0xefd4('0x32')](_0x1b6b1b[_0xefd4('0x31')]);_0x52eb43[_0xefd4('0x33')]=_['intersection'](_0x52eb43[_0xefd4('0x30')],_0x52eb43['query']);_0x284a0a[_0xefd4('0x35')]=_['intersection'](_0x52eb43[_0xefd4('0x30')],qs[_0xefd4('0x36')](_0x1b6b1b[_0xefd4('0x31')]['fields']));_0x284a0a[_0xefd4('0x35')]=_0x284a0a[_0xefd4('0x35')]['length']?_0x284a0a[_0xefd4('0x35')]:_0x52eb43[_0xefd4('0x30')];if(_0x1b6b1b[_0xefd4('0x31')]['includeAll']){_0x284a0a['include']=[{'all':!![]}];}_0x284a0a=_[_0xefd4('0x3d')]({},_0x284a0a,_0x1b6b1b['options']);return db[_0xefd4('0x2b')]['find'](_0x284a0a)[_0xefd4('0x25')](handleEntityNotFound(_0x120689,null))[_0xefd4('0x25')](respondWithResult(_0x120689,null))[_0xefd4('0x43')](handleError(_0x120689,null));};exports[_0xefd4('0x46')]=function(_0x56cffe,_0xf9dcb3){return db[_0xefd4('0x2b')][_0xefd4('0x46')](_0x56cffe[_0xefd4('0x47')],{})['then'](respondWithResult(_0xf9dcb3,0xc9))[_0xefd4('0x43')](handleError(_0xf9dcb3,null));};exports[_0xefd4('0x24')]=function(_0x2731f3,_0x1f3477){if(_0x2731f3[_0xefd4('0x47')]['id']){delete _0x2731f3[_0xefd4('0x47')]['id'];}return db['ZohoConfiguration'][_0xefd4('0x48')]({'where':{'id':_0x2731f3['params']['id']}})[_0xefd4('0x25')](handleEntityNotFound(_0x1f3477,null))[_0xefd4('0x25')](saveUpdates(_0x2731f3[_0xefd4('0x47')],null))[_0xefd4('0x25')](respondWithResult(_0x1f3477,null))[_0xefd4('0x43')](handleError(_0x1f3477,null));};exports[_0xefd4('0x26')]=function(_0x33e589,_0x3420e0){return db['ZohoConfiguration'][_0xefd4('0x48')]({'where':{'id':_0x33e589[_0xefd4('0x45')]['id']}})['then'](handleEntityNotFound(_0x3420e0,null))[_0xefd4('0x25')](removeEntity(_0x3420e0,null))[_0xefd4('0x43')](handleError(_0x3420e0,null));};exports['getFields']=function(_0x59469b,_0x17ac31,_0x19eb3d){var _0x37897d={};var _0x1427ab={};var _0x260dc3;var _0x81ff08;return db[_0xefd4('0x2b')]['findOne']({'where':{'id':_0x59469b[_0xefd4('0x45')]['id']}})[_0xefd4('0x25')](handleEntityNotFound(_0x17ac31,null))[_0xefd4('0x25')](function(_0x4b3085){if(_0x4b3085){_0x260dc3=_0x4b3085;_0x1427ab[_0xefd4('0x30')]=_[_0xefd4('0x32')](db[_0xefd4('0x49')][_0xefd4('0x2c')]);_0x1427ab[_0xefd4('0x31')]=_[_0xefd4('0x32')](_0x59469b[_0xefd4('0x31')]);_0x1427ab[_0xefd4('0x33')]=_[_0xefd4('0x34')](_0x1427ab[_0xefd4('0x30')],_0x1427ab['query']);_0x37897d[_0xefd4('0x35')]=_[_0xefd4('0x34')](_0x1427ab['model'],qs[_0xefd4('0x36')](_0x59469b[_0xefd4('0x31')][_0xefd4('0x36')]));_0x37897d[_0xefd4('0x35')]=_0x37897d[_0xefd4('0x35')]['length']?_0x37897d['attributes']:_0x1427ab[_0xefd4('0x30')];_0x37897d['order']=qs[_0xefd4('0x3a')](_0x59469b[_0xefd4('0x31')][_0xefd4('0x3a')]);_0x37897d[_0xefd4('0x3e')]=qs[_0xefd4('0x33')](_[_0xefd4('0x3b')](_0x59469b[_0xefd4('0x31')],_0x1427ab[_0xefd4('0x33')]));if(_0x59469b[_0xefd4('0x31')][_0xefd4('0x3c')]){_0x37897d[_0xefd4('0x3e')]=_[_0xefd4('0x3d')](_0x37897d['where'],{'$or':_[_0xefd4('0x2a')](_0x37897d['attributes'],function(_0x3082af){var _0x50a35c={};_0x50a35c[_0x3082af]={'$like':'%'+_0x59469b[_0xefd4('0x31')][_0xefd4('0x3c')]+'%'};return _0x50a35c;})});}_0x37897d=_[_0xefd4('0x3d')]({},_0x37897d,_0x59469b[_0xefd4('0x3f')]);return _0x260dc3['getFields'](_0x37897d);}})[_0xefd4('0x25')](function(_0x5bfe1){if(_0x5bfe1){_0x81ff08=_0x5bfe1[_0xefd4('0x37')];if(!_0x59469b[_0xefd4('0x31')][_0xefd4('0x38')](_0xefd4('0x39'))){_0x37897d[_0xefd4('0x1e')]=qs['limit'](_0x59469b[_0xefd4('0x31')][_0xefd4('0x1e')]);_0x37897d[_0xefd4('0x1b')]=qs[_0xefd4('0x1b')](_0x59469b[_0xefd4('0x31')][_0xefd4('0x1b')]);}return _0x260dc3[_0xefd4('0x4a')](_0x37897d);}})['then'](function(_0x2890d4){if(_0x2890d4){return _0x2890d4?{'count':_0x81ff08,'rows':_0x2890d4}:null;}})['then'](respondWithResult(_0x17ac31,null))[_0xefd4('0x43')](handleError(_0x17ac31,null));};exports[_0xefd4('0x4b')]=function(_0x14806c,_0x36826a,_0x55ffcd){var _0x1a06c2={};var _0x471acf={};var _0x55cf11;var _0xc6ab63;return db[_0xefd4('0x2b')]['findOne']({'where':{'id':_0x14806c[_0xefd4('0x45')]['id']}})[_0xefd4('0x25')](handleEntityNotFound(_0x36826a,null))[_0xefd4('0x25')](function(_0x2c9c6b){if(_0x2c9c6b){_0x55cf11=_0x2c9c6b;_0x471acf[_0xefd4('0x30')]=_[_0xefd4('0x32')](db[_0xefd4('0x49')][_0xefd4('0x2c')]);_0x471acf['query']=_[_0xefd4('0x32')](_0x14806c[_0xefd4('0x31')]);_0x471acf[_0xefd4('0x33')]=_['intersection'](_0x471acf[_0xefd4('0x30')],_0x471acf[_0xefd4('0x31')]);_0x1a06c2['attributes']=_[_0xefd4('0x34')](_0x471acf[_0xefd4('0x30')],qs[_0xefd4('0x36')](_0x14806c[_0xefd4('0x31')][_0xefd4('0x36')]));_0x1a06c2[_0xefd4('0x35')]=_0x1a06c2['attributes'][_0xefd4('0x37')]?_0x1a06c2[_0xefd4('0x35')]:_0x471acf[_0xefd4('0x30')];_0x1a06c2['order']=qs['sort'](_0x14806c['query']['sort']);_0x1a06c2['where']=qs[_0xefd4('0x33')](_[_0xefd4('0x3b')](_0x14806c[_0xefd4('0x31')],_0x471acf['filters']));if(_0x14806c[_0xefd4('0x31')][_0xefd4('0x3c')]){_0x1a06c2[_0xefd4('0x3e')]=_[_0xefd4('0x3d')](_0x1a06c2[_0xefd4('0x3e')],{'$or':_[_0xefd4('0x2a')](_0x1a06c2['attributes'],function(_0x1355c3){var _0xff6586={};_0xff6586[_0x1355c3]={'$like':'%'+_0x14806c[_0xefd4('0x31')][_0xefd4('0x3c')]+'%'};return _0xff6586;})});}_0x1a06c2=_['merge']({},_0x1a06c2,_0x14806c[_0xefd4('0x3f')]);return _0x55cf11[_0xefd4('0x4b')](_0x1a06c2);}})[_0xefd4('0x25')](function(_0xfc61d6){if(_0xfc61d6){_0xc6ab63=_0xfc61d6['length'];if(!_0x14806c[_0xefd4('0x31')][_0xefd4('0x38')](_0xefd4('0x39'))){_0x1a06c2['limit']=qs['limit'](_0x14806c[_0xefd4('0x31')][_0xefd4('0x1e')]);_0x1a06c2['offset']=qs['offset'](_0x14806c[_0xefd4('0x31')][_0xefd4('0x1b')]);}return _0x55cf11['getSubjects'](_0x1a06c2);}})[_0xefd4('0x25')](function(_0x2ba9ab){if(_0x2ba9ab){return _0x2ba9ab?{'count':_0xc6ab63,'rows':_0x2ba9ab}:null;}})['then'](respondWithResult(_0x36826a,null))[_0xefd4('0x43')](handleError(_0x36826a,null));};exports[_0xefd4('0x4c')]=function(_0x7a1ce0,_0x36c82a,_0x1f657a){var _0x1f7745={};var _0x372099={};var _0x185c45;var _0x90f406;return db[_0xefd4('0x2b')][_0xefd4('0x4d')]({'where':{'id':_0x7a1ce0[_0xefd4('0x45')]['id']}})[_0xefd4('0x25')](handleEntityNotFound(_0x36c82a,null))[_0xefd4('0x25')](function(_0x432e7b){if(_0x432e7b){_0x185c45=_0x432e7b;_0x372099[_0xefd4('0x30')]=_[_0xefd4('0x32')](db[_0xefd4('0x49')][_0xefd4('0x2c')]);_0x372099[_0xefd4('0x31')]=_[_0xefd4('0x32')](_0x7a1ce0[_0xefd4('0x31')]);_0x372099[_0xefd4('0x33')]=_[_0xefd4('0x34')](_0x372099[_0xefd4('0x30')],_0x372099[_0xefd4('0x31')]);_0x1f7745[_0xefd4('0x35')]=_[_0xefd4('0x34')](_0x372099[_0xefd4('0x30')],qs[_0xefd4('0x36')](_0x7a1ce0['query'][_0xefd4('0x36')]));_0x1f7745[_0xefd4('0x35')]=_0x1f7745[_0xefd4('0x35')]['length']?_0x1f7745[_0xefd4('0x35')]:_0x372099[_0xefd4('0x30')];_0x1f7745['order']=qs[_0xefd4('0x3a')](_0x7a1ce0[_0xefd4('0x31')][_0xefd4('0x3a')]);_0x1f7745[_0xefd4('0x3e')]=qs['filters'](_[_0xefd4('0x3b')](_0x7a1ce0[_0xefd4('0x31')],_0x372099[_0xefd4('0x33')]));if(_0x7a1ce0[_0xefd4('0x31')][_0xefd4('0x3c')]){_0x1f7745[_0xefd4('0x3e')]=_[_0xefd4('0x3d')](_0x1f7745[_0xefd4('0x3e')],{'$or':_[_0xefd4('0x2a')](_0x1f7745['attributes'],function(_0x19748d){var _0x28267d={};_0x28267d[_0x19748d]={'$like':'%'+_0x7a1ce0['query']['filter']+'%'};return _0x28267d;})});}_0x1f7745=_[_0xefd4('0x3d')]({},_0x1f7745,_0x7a1ce0[_0xefd4('0x3f')]);return _0x185c45[_0xefd4('0x4c')](_0x1f7745);}})[_0xefd4('0x25')](function(_0x4a37ec){if(_0x4a37ec){_0x90f406=_0x4a37ec['length'];if(!_0x7a1ce0[_0xefd4('0x31')][_0xefd4('0x38')](_0xefd4('0x39'))){_0x1f7745[_0xefd4('0x1e')]=qs[_0xefd4('0x1e')](_0x7a1ce0[_0xefd4('0x31')][_0xefd4('0x1e')]);_0x1f7745[_0xefd4('0x1b')]=qs[_0xefd4('0x1b')](_0x7a1ce0['query']['offset']);}return _0x185c45[_0xefd4('0x4c')](_0x1f7745);}})[_0xefd4('0x25')](function(_0x58f3d9){if(_0x58f3d9){return _0x58f3d9?{'count':_0x90f406,'rows':_0x58f3d9}:null;}})[_0xefd4('0x25')](respondWithResult(_0x36c82a,null))[_0xefd4('0x43')](handleError(_0x36c82a,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 3e8cbf8..9dc7c01 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 _0xd3e4=['exports','define','ZohoConfiguration','int_zoho_configurations','lodash','moment','bluebird','path','./intZohoConfiguration.attributes'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xd3e4,0x100));var _0x4d3e=function(_0x3efd41,_0x21aac6){_0x3efd41=_0x3efd41-0x0;var _0x4ca5ba=_0xd3e4[_0x3efd41];return _0x4ca5ba;};'use strict';var _=require(_0x4d3e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4d3e('0x1'));var BPromise=require(_0x4d3e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d3e('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4d3e('0x4'));module[_0x4d3e('0x5')]=function(_0x10a974,_0x501612){return _0x10a974[_0x4d3e('0x6')](_0x4d3e('0x7'),attributes,{'tableName':_0x4d3e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x147b=['define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes'];(function(_0x4b9115,_0x3f6938){var _0x29c46d=function(_0x493aa9){while(--_0x493aa9){_0x4b9115['push'](_0x4b9115['shift']());}};_0x29c46d(++_0x3f6938);}(_0x147b,0x10b));var _0xb147=function(_0x3312a3,_0x3f9cdb){_0x3312a3=_0x3312a3-0x0;var _0x262560=_0x147b[_0x3312a3];return _0x262560;};'use strict';var _=require(_0xb147('0x0'));var util=require(_0xb147('0x1'));var logger=require(_0xb147('0x2'))(_0xb147('0x3'));var moment=require(_0xb147('0x4'));var BPromise=require('bluebird');var rp=require(_0xb147('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb147('0x6'));var config=require(_0xb147('0x7'));var attributes=require(_0xb147('0x8'));module['exports']=function(_0x1f88af,_0x28376a){return _0x1f88af[_0xb147('0x9')](_0xb147('0xa'),attributes,{'tableName':_0xb147('0xb'),'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 4f6f24c..a73d2fb 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 _0x1ee0=['then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x1ee0,0x1a7));var _0x01ee=function(_0x4e0f40,_0x21b348){_0x4e0f40=_0x4e0f40-0x0;var _0x3abdbf=_0x1ee0[_0x4e0f40];return _0x3abdbf;};'use strict';var _=require(_0x01ee('0x0'));var util=require(_0x01ee('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x01ee('0x2'));var fs=require('fs');var Redis=require(_0x01ee('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x01ee('0x4'));var logger=require('../../config/logger')(_0x01ee('0x5'));var config=require(_0x01ee('0x6'));var jayson=require(_0x01ee('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a281c,_0x1f03b4,_0x4829c6){return new BPromise(function(_0x2ca700,_0x4f8986){return client[_0x01ee('0x8')](_0x2a281c,_0x4829c6)[_0x01ee('0x9')](function(_0xe3d43e){logger['info'](_0x01ee('0xa'),_0x1f03b4,_0x01ee('0xb'));logger['debug'](_0x01ee('0xc'),_0x1f03b4,'request\x20sent',JSON['stringify'](_0xe3d43e));if(_0xe3d43e[_0x01ee('0xd')]){if(_0xe3d43e[_0x01ee('0xd')][_0x01ee('0xe')]===0x1f4){logger[_0x01ee('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x1f03b4,_0xe3d43e['error']['message']);return _0x4f8986(_0xe3d43e['error'][_0x01ee('0xf')]);}logger[_0x01ee('0xd')](_0x01ee('0xa'),_0x1f03b4,_0xe3d43e['error']['message']);return _0x2ca700(_0xe3d43e[_0x01ee('0xd')][_0x01ee('0xf')]);}else{logger[_0x01ee('0x10')](_0x01ee('0xa'),_0x1f03b4,_0x01ee('0xb'));_0x2ca700(_0xe3d43e['result'][_0x01ee('0xf')]);}})[_0x01ee('0x11')](function(_0x5a5e48){logger[_0x01ee('0xd')](_0x01ee('0xa'),_0x1f03b4,_0x5a5e48);_0x4f8986(_0x5a5e48);});});} \ No newline at end of file +var _0xf35e=['code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x15ece6,_0x51a965){var _0x3dc05c=function(_0x43e0c1){while(--_0x43e0c1){_0x15ece6['push'](_0x15ece6['shift']());}};_0x3dc05c(++_0x51a965);}(_0xf35e,0x1cf));var _0xef35=function(_0x327cc0,_0x407ee7){_0x327cc0=_0x327cc0-0x0;var _0x3fe343=_0xf35e[_0x327cc0];return _0x3fe343;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xef35('0x0'));var BPromise=require(_0xef35('0x1'));var rs=require(_0xef35('0x2'));var fs=require('fs');var Redis=require(_0xef35('0x3'));var db=require(_0xef35('0x4'))['db'];var utils=require(_0xef35('0x5'));var logger=require(_0xef35('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xef35('0x7'));var client=jayson[_0xef35('0x8')][_0xef35('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4be8a3,_0x4d3fc2,_0x24ecee){return new BPromise(function(_0x50014c,_0x31b462){return client[_0xef35('0xa')](_0x4be8a3,_0x24ecee)['then'](function(_0x371d3c){logger[_0xef35('0xb')](_0xef35('0xc'),_0x4d3fc2,_0xef35('0xd'));logger['debug'](_0xef35('0xe'),_0x4d3fc2,'request\x20sent',JSON[_0xef35('0xf')](_0x371d3c));if(_0x371d3c['error']){if(_0x371d3c[_0xef35('0x10')][_0xef35('0x11')]===0x1f4){logger[_0xef35('0x10')](_0xef35('0xc'),_0x4d3fc2,_0x371d3c[_0xef35('0x10')][_0xef35('0x12')]);return _0x31b462(_0x371d3c[_0xef35('0x10')][_0xef35('0x12')]);}logger[_0xef35('0x10')](_0xef35('0xc'),_0x4d3fc2,_0x371d3c[_0xef35('0x10')][_0xef35('0x12')]);return _0x50014c(_0x371d3c[_0xef35('0x10')][_0xef35('0x12')]);}else{logger[_0xef35('0xb')](_0xef35('0xc'),_0x4d3fc2,_0xef35('0xd'));_0x50014c(_0x371d3c[_0xef35('0x13')][_0xef35('0x12')]);}})['catch'](function(_0x27a084){logger[_0xef35('0x10')](_0xef35('0xc'),_0x4d3fc2,_0x27a084);_0x31b462(_0x27a084);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 1a11b6b..bca00d5 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 _0xb440=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','path','express','Router'];(function(_0x2b08e4,_0x25d3c8){var _0x5f0526=function(_0x14232f){while(--_0x14232f){_0x2b08e4['push'](_0x2b08e4['shift']());}};_0x5f0526(++_0x25d3c8);}(_0xb440,0x7b));var _0x0b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb440[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0b44('0x0'));var timeout=require('connect-timeout');var express=require(_0x0b44('0x1'));var router=express[_0x0b44('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0b44('0x3'));var interaction=require(_0x0b44('0x4'));var config=require(_0x0b44('0x5'));var controller=require(_0x0b44('0x6'));router[_0x0b44('0x7')]('/',auth[_0x0b44('0x8')](),controller[_0x0b44('0x9')]);router[_0x0b44('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x0b44('0xa')]);router[_0x0b44('0xb')]('/',auth[_0x0b44('0x8')](),controller[_0x0b44('0xc')]);router[_0x0b44('0xd')](_0x0b44('0xe'),auth[_0x0b44('0x8')](),controller[_0x0b44('0xf')]);router[_0x0b44('0x10')]('/:id',auth[_0x0b44('0x8')](),controller[_0x0b44('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8134=['isAuthenticated','show','post','create','put','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id'];(function(_0x717e65,_0x5c7caa){var _0x3b7f95=function(_0x587c5c){while(--_0x587c5c){_0x717e65['push'](_0x717e65['shift']());}};_0x3b7f95(++_0x5c7caa);}(_0x8134,0xf6));var _0x4813=function(_0x4b4c20,_0x44f51a){_0x4b4c20=_0x4b4c20-0x0;var _0x544117=_0x8134[_0x4b4c20];return _0x544117;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4813('0x0'));var timeout=require(_0x4813('0x1'));var express=require(_0x4813('0x2'));var router=express[_0x4813('0x3')]();var fs_extra=require(_0x4813('0x4'));var auth=require(_0x4813('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4813('0x6'));var controller=require('./intZohoField.controller');router[_0x4813('0x7')]('/',auth['isAuthenticated'](),controller[_0x4813('0x8')]);router[_0x4813('0x7')](_0x4813('0x9'),auth[_0x4813('0xa')](),controller[_0x4813('0xb')]);router[_0x4813('0xc')]('/',auth['isAuthenticated'](),controller[_0x4813('0xd')]);router[_0x4813('0xe')](_0x4813('0x9'),auth[_0x4813('0xa')](),controller['update']);router['delete'](_0x4813('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x4813('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 3011b29..f954bc6 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 _0xa5a3=['STRING','BOOLEAN','sequelize','exports','string','variable','customVariable'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa5a3,0x12f));var _0x3a5a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xa5a3[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x3a5a('0x0'));module[_0x3a5a('0x1')]={'type':{'type':Sequelize['ENUM'](_0x3a5a('0x2'),_0x3a5a('0x3'),_0x3a5a('0x4'),'keyValue','picklist'),'defaultValue':_0x3a5a('0x2')},'content':{'type':Sequelize[_0x3a5a('0x5')]},'key':{'type':Sequelize[_0x3a5a('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x3a5a('0x2'),_0x3a5a('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x3a5a('0x5')]},'idField':{'type':Sequelize[_0x3a5a('0x5')]},'nameField':{'type':Sequelize[_0x3a5a('0x5')]},'customField':{'type':Sequelize[_0x3a5a('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3a5a('0x5')]}}; \ No newline at end of file +var _0x1d4e=['exports','string','variable','keyValue','picklist','STRING','ENUM','customVariable','BOOLEAN'];(function(_0xcf307e,_0x2d7211){var _0x46f1a9=function(_0x19f338){while(--_0x19f338){_0xcf307e['push'](_0xcf307e['shift']());}};_0x46f1a9(++_0x2d7211);}(_0x1d4e,0x90));var _0xe1d4=function(_0x562164,_0x4dcfea){_0x562164=_0x562164-0x0;var _0x3dee44=_0x1d4e[_0x562164];return _0x3dee44;};'use strict';var Sequelize=require('sequelize');module[_0xe1d4('0x0')]={'type':{'type':Sequelize['ENUM'](_0xe1d4('0x1'),_0xe1d4('0x2'),'customVariable',_0xe1d4('0x3'),_0xe1d4('0x4')),'defaultValue':_0xe1d4('0x1')},'content':{'type':Sequelize[_0xe1d4('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe1d4('0x6')](_0xe1d4('0x1'),'variable',_0xe1d4('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe1d4('0x5')]},'nameField':{'type':Sequelize[_0xe1d4('0x5')]},'customField':{'type':Sequelize[_0xe1d4('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe1d4('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index ed38c36..8d4ab5e 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 _0x887b=['offset','undefined','limit','count','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x887b,0x185));var _0xb887=function(_0x3c25ad,_0x3b7eee){_0x3c25ad=_0x3c25ad-0x0;var _0x467be9=_0x887b[_0x3c25ad];return _0x467be9;};'use strict';var emlformat=require(_0xb887('0x0'));var rimraf=require(_0xb887('0x1'));var zipdir=require(_0xb887('0x2'));var jsonpatch=require(_0xb887('0x3'));var rp=require(_0xb887('0x4'));var moment=require(_0xb887('0x5'));var BPromise=require(_0xb887('0x6'));var Mustache=require(_0xb887('0x7'));var util=require(_0xb887('0x8'));var path=require('path');var sox=require(_0xb887('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb887('0xa'));var squel=require(_0xb887('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb887('0xc'));var toCsv=require(_0xb887('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb887('0xe'));var qs=require(_0xb887('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb887('0x10'));var logger=require('../../config/logger')(_0xb887('0x11'));var utils=require(_0xb887('0x12'));var config=require(_0xb887('0x13'));var licenseUtil=require(_0xb887('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x582f11,_0x2380d2){_0x2380d2=_0x2380d2||0xcc;return function(_0xa6d17b){if(_0xa6d17b){return _0x582f11[_0xb887('0x15')](_0x2380d2);}return _0x582f11[_0xb887('0x16')](_0x2380d2)[_0xb887('0x17')]();};}function respondWithResult(_0x5899bb,_0x387367){_0x387367=_0x387367||0xc8;return function(_0xae7291){if(_0xae7291){return _0x5899bb[_0xb887('0x16')](_0x387367)[_0xb887('0x18')](_0xae7291);}};}function respondWithFilteredResult(_0x7bac36,_0x1b193c){return function(_0x2008e4){if(_0x2008e4){var _0x2b0f05=typeof _0x1b193c[_0xb887('0x19')]===_0xb887('0x1a')&&typeof _0x1b193c[_0xb887('0x1b')]===_0xb887('0x1a');var _0x54df24=_0x2008e4['count'];var _0x279ab0=_0x2b0f05?0x0:_0x1b193c[_0xb887('0x19')];var _0x4aa052=_0x2b0f05?_0x2008e4[_0xb887('0x1c')]:_0x1b193c[_0xb887('0x19')]+_0x1b193c[_0xb887('0x1b')];var _0x115084;if(_0x4aa052>=_0x54df24){_0x4aa052=_0x54df24;_0x115084=0xc8;}else{_0x115084=0xce;}_0x7bac36[_0xb887('0x16')](_0x115084);return _0x7bac36['set'](_0xb887('0x1d'),_0x279ab0+'-'+_0x4aa052+'/'+_0x54df24)['json'](_0x2008e4);}return null;};}function patchUpdates(_0x5a9e68){return function(_0x68ef0a){try{jsonpatch[_0xb887('0x1e')](_0x68ef0a,_0x5a9e68,!![]);}catch(_0x42b1e4){return BPromise['reject'](_0x42b1e4);}return _0x68ef0a['save']();};}function saveUpdates(_0x101f64,_0x4af881){return function(_0x321cb6){if(_0x321cb6){return _0x321cb6[_0xb887('0x1f')](_0x101f64)[_0xb887('0x20')](function(_0x246669){return _0x246669;});}return null;};}function removeEntity(_0x49a401,_0x17dd2f){return function(_0x4653c7){if(_0x4653c7){return _0x4653c7[_0xb887('0x21')]()['then'](function(){_0x49a401[_0xb887('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x198351,_0x2b7b91){return function(_0x235c62){if(!_0x235c62){_0x198351['sendStatus'](0x194);}return _0x235c62;};}function handleError(_0x568e6f,_0x2fb6b7){_0x2fb6b7=_0x2fb6b7||0x1f4;return function(_0x1496cd){logger[_0xb887('0x22')](_0x1496cd[_0xb887('0x23')]);if(_0x1496cd[_0xb887('0x24')]){delete _0x1496cd[_0xb887('0x24')];}_0x568e6f['status'](_0x2fb6b7)[_0xb887('0x25')](_0x1496cd);};}exports[_0xb887('0x26')]=function(_0x113930,_0x33891e){var _0x52585e={},_0x25002c={},_0x482451={'count':0x0,'rows':[]};var _0x3530a1=_[_0xb887('0x27')](db[_0xb887('0x28')][_0xb887('0x29')],function(_0x53f211){return{'name':_0x53f211[_0xb887('0x2a')],'type':_0x53f211[_0xb887('0x2b')]['key']};});_0x25002c[_0xb887('0x2c')]=_[_0xb887('0x27')](_0x3530a1,_0xb887('0x24'));_0x25002c['query']=_[_0xb887('0x2d')](_0x113930['query']);_0x25002c[_0xb887('0x2e')]=_['intersection'](_0x25002c[_0xb887('0x2c')],_0x25002c[_0xb887('0x2f')]);_0x52585e[_0xb887('0x30')]=_[_0xb887('0x31')](_0x25002c['model'],qs[_0xb887('0x32')](_0x113930[_0xb887('0x2f')][_0xb887('0x32')]));_0x52585e[_0xb887('0x30')]=_0x52585e['attributes'][_0xb887('0x33')]?_0x52585e[_0xb887('0x30')]:_0x25002c[_0xb887('0x2c')];if(!_0x113930[_0xb887('0x2f')][_0xb887('0x34')](_0xb887('0x35'))){_0x52585e[_0xb887('0x1b')]=qs['limit'](_0x113930[_0xb887('0x2f')][_0xb887('0x1b')]);_0x52585e['offset']=qs[_0xb887('0x19')](_0x113930[_0xb887('0x2f')]['offset']);}_0x52585e[_0xb887('0x36')]=qs[_0xb887('0x37')](_0x113930[_0xb887('0x2f')]['sort']);_0x52585e['where']=qs['filters'](_['pick'](_0x113930[_0xb887('0x2f')],_0x25002c[_0xb887('0x2e')]),_0x3530a1);if(_0x113930['query'][_0xb887('0x38')]){_0x52585e[_0xb887('0x39')]=_[_0xb887('0x3a')](_0x52585e['where'],{'$or':_[_0xb887('0x27')](_0x3530a1,function(_0x1d01c4){if(_0x1d01c4[_0xb887('0x2b')]!==_0xb887('0x3b')){var _0x24a89c={};_0x24a89c[_0x1d01c4[_0xb887('0x24')]]={'$like':'%'+_0x113930[_0xb887('0x2f')][_0xb887('0x38')]+'%'};return _0x24a89c;}})});}_0x52585e=_[_0xb887('0x3a')]({},_0x52585e,_0x113930[_0xb887('0x3c')]);var _0x473bf9={'where':_0x52585e[_0xb887('0x39')]};return db['ZohoField']['count'](_0x473bf9)[_0xb887('0x20')](function(_0x252a19){_0x482451[_0xb887('0x1c')]=_0x252a19;if(_0x113930[_0xb887('0x2f')][_0xb887('0x3d')]){_0x52585e[_0xb887('0x3e')]=[{'all':!![]}];}return db[_0xb887('0x28')]['findAll'](_0x52585e);})['then'](function(_0x3d2014){_0x482451[_0xb887('0x3f')]=_0x3d2014;return _0x482451;})[_0xb887('0x20')](respondWithFilteredResult(_0x33891e,_0x52585e))[_0xb887('0x40')](handleError(_0x33891e,null));};exports['show']=function(_0x481b11,_0x2ca6dc){var _0x3ce41b={'raw':!![],'where':{'id':_0x481b11[_0xb887('0x41')]['id']}},_0x16446f={};_0x16446f[_0xb887('0x2c')]=_[_0xb887('0x2d')](db[_0xb887('0x28')][_0xb887('0x29')]);_0x16446f['query']=_[_0xb887('0x2d')](_0x481b11['query']);_0x16446f[_0xb887('0x2e')]=_[_0xb887('0x31')](_0x16446f['model'],_0x16446f['query']);_0x3ce41b[_0xb887('0x30')]=_[_0xb887('0x31')](_0x16446f[_0xb887('0x2c')],qs[_0xb887('0x32')](_0x481b11[_0xb887('0x2f')][_0xb887('0x32')]));_0x3ce41b[_0xb887('0x30')]=_0x3ce41b[_0xb887('0x30')][_0xb887('0x33')]?_0x3ce41b[_0xb887('0x30')]:_0x16446f[_0xb887('0x2c')];if(_0x481b11['query'][_0xb887('0x3d')]){_0x3ce41b['include']=[{'all':!![]}];}_0x3ce41b=_['merge']({},_0x3ce41b,_0x481b11[_0xb887('0x3c')]);return db[_0xb887('0x28')][_0xb887('0x42')](_0x3ce41b)[_0xb887('0x20')](handleEntityNotFound(_0x2ca6dc,null))[_0xb887('0x20')](respondWithResult(_0x2ca6dc,null))[_0xb887('0x40')](handleError(_0x2ca6dc,null));};exports['create']=function(_0x5438fb,_0x5a1457){return db[_0xb887('0x28')][_0xb887('0x43')](_0x5438fb[_0xb887('0x44')],{})[_0xb887('0x20')](respondWithResult(_0x5a1457,0xc9))['catch'](handleError(_0x5a1457,null));};exports['update']=function(_0x3949fc,_0x22867d){if(_0x3949fc[_0xb887('0x44')]['id']){delete _0x3949fc[_0xb887('0x44')]['id'];}return db[_0xb887('0x28')]['find']({'where':{'id':_0x3949fc[_0xb887('0x41')]['id']}})[_0xb887('0x20')](handleEntityNotFound(_0x22867d,null))[_0xb887('0x20')](saveUpdates(_0x3949fc[_0xb887('0x44')],null))[_0xb887('0x20')](respondWithResult(_0x22867d,null))[_0xb887('0x40')](handleError(_0x22867d,null));};exports[_0xb887('0x21')]=function(_0x592b12,_0x31cc47){return db['ZohoField'][_0xb887('0x42')]({'where':{'id':_0x592b12['params']['id']}})[_0xb887('0x20')](handleEntityNotFound(_0x31cc47,null))[_0xb887('0x20')](removeEntity(_0x31cc47,null))['catch'](handleError(_0x31cc47,null));}; \ No newline at end of file +var _0xb69c=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','options','ZohoField','includeAll','include','show','params','merge','find','create','body','catch','destroy','eml-format','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xb69c,0x1a6));var _0xcb69=function(_0x35c281,_0x2d02bb){_0x35c281=_0x35c281-0x0;var _0x57913f=_0xb69c[_0x35c281];return _0x57913f;};'use strict';var emlformat=require(_0xcb69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb69('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb69('0x2'));var moment=require(_0xcb69('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcb69('0x4'));var util=require(_0xcb69('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xcb69('0x6'));var ejs=require(_0xcb69('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb69('0x8'));var squel=require(_0xcb69('0x9'));var crypto=require(_0xcb69('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xcb69('0xb'));var toCsv=require(_0xcb69('0x6'));var querystring=require(_0xcb69('0xc'));var Papa=require(_0xcb69('0xd'));var Redis=require(_0xcb69('0xe'));var authService=require(_0xcb69('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xcb69('0x10'));var hardwareService=require(_0xcb69('0x11'));var logger=require(_0xcb69('0x12'))(_0xcb69('0x13'));var utils=require(_0xcb69('0x14'));var config=require(_0xcb69('0x15'));var licenseUtil=require(_0xcb69('0x16'));var db=require(_0xcb69('0x17'))['db'];function respondWithStatusCode(_0x3ab496,_0x3f00ae){_0x3f00ae=_0x3f00ae||0xcc;return function(_0x44f5c0){if(_0x44f5c0){return _0x3ab496[_0xcb69('0x18')](_0x3f00ae);}return _0x3ab496['status'](_0x3f00ae)[_0xcb69('0x19')]();};}function respondWithResult(_0x53617a,_0x134432){_0x134432=_0x134432||0xc8;return function(_0x5251f9){if(_0x5251f9){return _0x53617a[_0xcb69('0x1a')](_0x134432)[_0xcb69('0x1b')](_0x5251f9);}};}function respondWithFilteredResult(_0x57e60f,_0x10fcf4){return function(_0x995b38){if(_0x995b38){var _0x37811e=typeof _0x10fcf4[_0xcb69('0x1c')]===_0xcb69('0x1d')&&typeof _0x10fcf4[_0xcb69('0x1e')]===_0xcb69('0x1d');var _0x159ba1=_0x995b38[_0xcb69('0x1f')];var _0x50d380=_0x37811e?0x0:_0x10fcf4[_0xcb69('0x1c')];var _0x25b66c=_0x37811e?_0x995b38['count']:_0x10fcf4[_0xcb69('0x1c')]+_0x10fcf4[_0xcb69('0x1e')];var _0xd5c3fa;if(_0x25b66c>=_0x159ba1){_0x25b66c=_0x159ba1;_0xd5c3fa=0xc8;}else{_0xd5c3fa=0xce;}_0x57e60f['status'](_0xd5c3fa);return _0x57e60f[_0xcb69('0x20')](_0xcb69('0x21'),_0x50d380+'-'+_0x25b66c+'/'+_0x159ba1)[_0xcb69('0x1b')](_0x995b38);}return null;};}function patchUpdates(_0x2584fa){return function(_0x2c0a89){try{jsonpatch['apply'](_0x2c0a89,_0x2584fa,!![]);}catch(_0x33a6e0){return BPromise[_0xcb69('0x22')](_0x33a6e0);}return _0x2c0a89[_0xcb69('0x23')]();};}function saveUpdates(_0x5952b0,_0x71de81){return function(_0x410246){if(_0x410246){return _0x410246[_0xcb69('0x24')](_0x5952b0)['then'](function(_0xa9cc11){return _0xa9cc11;});}return null;};}function removeEntity(_0x3b1b0b,_0x2baf9c){return function(_0x2ae1ed){if(_0x2ae1ed){return _0x2ae1ed['destroy']()[_0xcb69('0x25')](function(){_0x3b1b0b[_0xcb69('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b2811,_0x557ab1){return function(_0x50f72a){if(!_0x50f72a){_0x1b2811[_0xcb69('0x18')](0x194);}return _0x50f72a;};}function handleError(_0x74fded,_0x41d7e4){_0x41d7e4=_0x41d7e4||0x1f4;return function(_0x4c27a4){logger[_0xcb69('0x26')](_0x4c27a4['stack']);if(_0x4c27a4[_0xcb69('0x27')]){delete _0x4c27a4['name'];}_0x74fded[_0xcb69('0x1a')](_0x41d7e4)[_0xcb69('0x28')](_0x4c27a4);};}exports[_0xcb69('0x29')]=function(_0xee3ac7,_0x5e046e){var _0x5d0ca5={},_0x4073b8={},_0x44ebd3={'count':0x0,'rows':[]};var _0x2bca8f=_[_0xcb69('0x2a')](db['ZohoField'][_0xcb69('0x2b')],function(_0x325a59){return{'name':_0x325a59[_0xcb69('0x2c')],'type':_0x325a59['type'][_0xcb69('0x2d')]};});_0x4073b8[_0xcb69('0x2e')]=_[_0xcb69('0x2a')](_0x2bca8f,_0xcb69('0x27'));_0x4073b8['query']=_[_0xcb69('0x2f')](_0xee3ac7[_0xcb69('0x30')]);_0x4073b8['filters']=_[_0xcb69('0x31')](_0x4073b8['model'],_0x4073b8[_0xcb69('0x30')]);_0x5d0ca5[_0xcb69('0x32')]=_[_0xcb69('0x31')](_0x4073b8[_0xcb69('0x2e')],qs['fields'](_0xee3ac7['query'][_0xcb69('0x33')]));_0x5d0ca5[_0xcb69('0x32')]=_0x5d0ca5[_0xcb69('0x32')][_0xcb69('0x34')]?_0x5d0ca5[_0xcb69('0x32')]:_0x4073b8[_0xcb69('0x2e')];if(!_0xee3ac7[_0xcb69('0x30')][_0xcb69('0x35')](_0xcb69('0x36'))){_0x5d0ca5[_0xcb69('0x1e')]=qs[_0xcb69('0x1e')](_0xee3ac7[_0xcb69('0x30')][_0xcb69('0x1e')]);_0x5d0ca5['offset']=qs['offset'](_0xee3ac7[_0xcb69('0x30')][_0xcb69('0x1c')]);}_0x5d0ca5['order']=qs[_0xcb69('0x37')](_0xee3ac7[_0xcb69('0x30')]['sort']);_0x5d0ca5['where']=qs[_0xcb69('0x38')](_[_0xcb69('0x39')](_0xee3ac7[_0xcb69('0x30')],_0x4073b8[_0xcb69('0x38')]),_0x2bca8f);if(_0xee3ac7[_0xcb69('0x30')][_0xcb69('0x3a')]){_0x5d0ca5['where']=_['merge'](_0x5d0ca5[_0xcb69('0x3b')],{'$or':_['map'](_0x2bca8f,function(_0x5b9e7a){if(_0x5b9e7a['type']!==_0xcb69('0x3c')){var _0x1d301a={};_0x1d301a[_0x5b9e7a[_0xcb69('0x27')]]={'$like':'%'+_0xee3ac7['query'][_0xcb69('0x3a')]+'%'};return _0x1d301a;}})});}_0x5d0ca5=_['merge']({},_0x5d0ca5,_0xee3ac7[_0xcb69('0x3d')]);var _0x3c8967={'where':_0x5d0ca5['where']};return db[_0xcb69('0x3e')]['count'](_0x3c8967)[_0xcb69('0x25')](function(_0x3bf158){_0x44ebd3['count']=_0x3bf158;if(_0xee3ac7[_0xcb69('0x30')][_0xcb69('0x3f')]){_0x5d0ca5[_0xcb69('0x40')]=[{'all':!![]}];}return db[_0xcb69('0x3e')]['findAll'](_0x5d0ca5);})['then'](function(_0x180fc9){_0x44ebd3['rows']=_0x180fc9;return _0x44ebd3;})[_0xcb69('0x25')](respondWithFilteredResult(_0x5e046e,_0x5d0ca5))['catch'](handleError(_0x5e046e,null));};exports[_0xcb69('0x41')]=function(_0x2752d6,_0x22d53b){var _0x1252fa={'raw':!![],'where':{'id':_0x2752d6[_0xcb69('0x42')]['id']}},_0x3e9114={};_0x3e9114[_0xcb69('0x2e')]=_[_0xcb69('0x2f')](db[_0xcb69('0x3e')][_0xcb69('0x2b')]);_0x3e9114[_0xcb69('0x30')]=_['keys'](_0x2752d6[_0xcb69('0x30')]);_0x3e9114[_0xcb69('0x38')]=_[_0xcb69('0x31')](_0x3e9114['model'],_0x3e9114['query']);_0x1252fa[_0xcb69('0x32')]=_[_0xcb69('0x31')](_0x3e9114[_0xcb69('0x2e')],qs[_0xcb69('0x33')](_0x2752d6[_0xcb69('0x30')]['fields']));_0x1252fa[_0xcb69('0x32')]=_0x1252fa[_0xcb69('0x32')][_0xcb69('0x34')]?_0x1252fa[_0xcb69('0x32')]:_0x3e9114[_0xcb69('0x2e')];if(_0x2752d6[_0xcb69('0x30')][_0xcb69('0x3f')]){_0x1252fa[_0xcb69('0x40')]=[{'all':!![]}];}_0x1252fa=_[_0xcb69('0x43')]({},_0x1252fa,_0x2752d6[_0xcb69('0x3d')]);return db[_0xcb69('0x3e')][_0xcb69('0x44')](_0x1252fa)[_0xcb69('0x25')](handleEntityNotFound(_0x22d53b,null))[_0xcb69('0x25')](respondWithResult(_0x22d53b,null))['catch'](handleError(_0x22d53b,null));};exports[_0xcb69('0x45')]=function(_0xb5af82,_0x21cd39){return db[_0xcb69('0x3e')]['create'](_0xb5af82[_0xcb69('0x46')],{})[_0xcb69('0x25')](respondWithResult(_0x21cd39,0xc9))['catch'](handleError(_0x21cd39,null));};exports[_0xcb69('0x24')]=function(_0x184fa7,_0x22ee8b){if(_0x184fa7[_0xcb69('0x46')]['id']){delete _0x184fa7[_0xcb69('0x46')]['id'];}return db[_0xcb69('0x3e')][_0xcb69('0x44')]({'where':{'id':_0x184fa7[_0xcb69('0x42')]['id']}})[_0xcb69('0x25')](handleEntityNotFound(_0x22ee8b,null))[_0xcb69('0x25')](saveUpdates(_0x184fa7[_0xcb69('0x46')],null))['then'](respondWithResult(_0x22ee8b,null))[_0xcb69('0x47')](handleError(_0x22ee8b,null));};exports[_0xcb69('0x48')]=function(_0x45ce13,_0x479530){return db[_0xcb69('0x3e')]['find']({'where':{'id':_0x45ce13[_0xcb69('0x42')]['id']}})['then'](handleEntityNotFound(_0x479530,null))[_0xcb69('0x25')](removeEntity(_0x479530,null))['catch'](handleError(_0x479530,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 8863454..72c276c 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 _0x5f66=['util','api','moment','bluebird','request-promise','path','../../config/environment','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId'];(function(_0x2b0ddd,_0xc2ca0a){var _0x5d1015=function(_0x51c9f1){while(--_0x51c9f1){_0x2b0ddd['push'](_0x2b0ddd['shift']());}};_0x5d1015(++_0xc2ca0a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var logger=require('../../config/logger')(_0x65f6('0x1'));var moment=require(_0x65f6('0x2'));var BPromise=require(_0x65f6('0x3'));var rp=require(_0x65f6('0x4'));var fs=require('fs');var path=require(_0x65f6('0x5'));var rimraf=require('rimraf');var config=require(_0x65f6('0x6'));var attributes=require('./intZohoField.attributes');module[_0x65f6('0x7')]=function(_0x22b017,_0x4ec221){return _0x22b017['define'](_0x65f6('0x8'),attributes,{'tableName':_0x65f6('0x9'),'paranoid':![],'indexes':[{'name':_0x65f6('0xa'),'fields':[_0x65f6('0xb'),_0x65f6('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb145=['api','moment','bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x5333ba,_0x22e1bb){var _0x20f9dc=function(_0x1956af){while(--_0x1956af){_0x5333ba['push'](_0x5333ba['shift']());}};_0x20f9dc(++_0x22e1bb);}(_0xb145,0xa3));var _0x5b14=function(_0x53f3ad,_0x2b4ac6){_0x53f3ad=_0x53f3ad-0x0;var _0x1dd9ca=_0xb145[_0x53f3ad];return _0x1dd9ca;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var logger=require(_0x5b14('0x1'))(_0x5b14('0x2'));var moment=require(_0x5b14('0x3'));var BPromise=require(_0x5b14('0x4'));var rp=require(_0x5b14('0x5'));var fs=require('fs');var path=require(_0x5b14('0x6'));var rimraf=require(_0x5b14('0x7'));var config=require('../../config/environment');var attributes=require(_0x5b14('0x8'));module[_0x5b14('0x9')]=function(_0x392425,_0x4d82ad){return _0x392425['define'](_0x5b14('0xa'),attributes,{'tableName':_0x5b14('0xb'),'paranoid':![],'indexes':[{'name':_0x5b14('0xc'),'fields':[_0x5b14('0xd'),_0x5b14('0xe')],'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 35aa5fc..6132f06 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 _0xca1e=['client','http','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0xca1e,0x133));var _0xeca1=function(_0x4aa1ae,_0x1ee884){_0x4aa1ae=_0x4aa1ae-0x0;var _0x31c1bb=_0xca1e[_0x4aa1ae];return _0x31c1bb;};'use strict';var _=require(_0xeca1('0x0'));var util=require('util');var moment=require(_0xeca1('0x1'));var BPromise=require(_0xeca1('0x2'));var rs=require(_0xeca1('0x3'));var fs=require('fs');var Redis=require(_0xeca1('0x4'));var db=require(_0xeca1('0x5'))['db'];var utils=require(_0xeca1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xeca1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xeca1('0x8')][_0xeca1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4fc0e1,_0x1fffe0,_0x2f90e5){return new BPromise(function(_0x4e9a0e,_0x378309){return client['request'](_0x4fc0e1,_0x2f90e5)[_0xeca1('0xa')](function(_0x271438){logger[_0xeca1('0xb')]('ZohoField,\x20%s,\x20%s',_0x1fffe0,_0xeca1('0xc'));logger[_0xeca1('0xd')](_0xeca1('0xe'),_0x1fffe0,_0xeca1('0xc'),JSON[_0xeca1('0xf')](_0x271438));if(_0x271438[_0xeca1('0x10')]){if(_0x271438[_0xeca1('0x10')][_0xeca1('0x11')]===0x1f4){logger[_0xeca1('0x10')](_0xeca1('0x12'),_0x1fffe0,_0x271438['error']['message']);return _0x378309(_0x271438[_0xeca1('0x10')]['message']);}logger['error'](_0xeca1('0x12'),_0x1fffe0,_0x271438[_0xeca1('0x10')]['message']);return _0x4e9a0e(_0x271438[_0xeca1('0x10')]['message']);}else{logger[_0xeca1('0xb')]('ZohoField,\x20%s,\x20%s',_0x1fffe0,_0xeca1('0xc'));_0x4e9a0e(_0x271438['result'][_0xeca1('0x13')]);}})[_0xeca1('0x14')](function(_0xcd4842){logger[_0xeca1('0x10')](_0xeca1('0x12'),_0x1fffe0,_0xcd4842);_0x378309(_0xcd4842);});});} \ No newline at end of file +var _0xe4da=['request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','http','info','ZohoField,\x20%s,\x20%s'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe4da,0x14b));var _0xae4d=function(_0x47b00d,_0x9195d4){_0x47b00d=_0x47b00d-0x0;var _0x25aa61=_0xe4da[_0x47b00d];return _0x25aa61;};'use strict';var _=require(_0xae4d('0x0'));var util=require(_0xae4d('0x1'));var moment=require(_0xae4d('0x2'));var BPromise=require(_0xae4d('0x3'));var rs=require(_0xae4d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xae4d('0x5'));var logger=require('../../config/logger')(_0xae4d('0x6'));var config=require('../../config/environment');var jayson=require(_0xae4d('0x7'));var client=jayson['client'][_0xae4d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26e3d2,_0x43c7ac,_0x2c93f2){return new BPromise(function(_0x56c825,_0x3ed0c5){return client['request'](_0x26e3d2,_0x2c93f2)['then'](function(_0xc77f0a){logger[_0xae4d('0x9')](_0xae4d('0xa'),_0x43c7ac,_0xae4d('0xb'));logger[_0xae4d('0xc')](_0xae4d('0xd'),_0x43c7ac,_0xae4d('0xb'),JSON[_0xae4d('0xe')](_0xc77f0a));if(_0xc77f0a['error']){if(_0xc77f0a['error'][_0xae4d('0xf')]===0x1f4){logger[_0xae4d('0x10')](_0xae4d('0xa'),_0x43c7ac,_0xc77f0a['error'][_0xae4d('0x11')]);return _0x3ed0c5(_0xc77f0a[_0xae4d('0x10')][_0xae4d('0x11')]);}logger['error']('ZohoField,\x20%s,\x20%s',_0x43c7ac,_0xc77f0a['error'][_0xae4d('0x11')]);return _0x56c825(_0xc77f0a[_0xae4d('0x10')][_0xae4d('0x11')]);}else{logger[_0xae4d('0x9')](_0xae4d('0xa'),_0x43c7ac,'request\x20sent');_0x56c825(_0xc77f0a[_0xae4d('0x12')][_0xae4d('0x11')]);}})['catch'](function(_0x200875){logger[_0xae4d('0x10')]('ZohoField,\x20%s,\x20%s',_0x43c7ac,_0x200875);_0x3ed0c5(_0x200875);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index b55835e..f1e03fa 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x58cc40,_0x183602){var _0x19f72b=function(_0x26cc96){while(--_0x26cc96){_0x58cc40['push'](_0x58cc40['shift']());}};_0x19f72b(++_0x183602);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x5f0c67,_0x2ed6d9){var _0x9de200=function(_0x32015e){while(--_0x32015e){_0x5f0c67['push'](_0x5f0c67['shift']());}};_0x9de200(++_0x2ed6d9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0xcb91[_0x3c4dad];return _0x1a4f49;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index b6a4bab..f6c6b62 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 _0xe76d=['app.js','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0xe76d,0x1bc));var _0xde76=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xe76d[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require(_0xde76('0x0'));module[_0xde76('0x1')]={'name':{'type':Sequelize[_0xde76('0x2')],'allowNull':![],'unique':_0xde76('0x3')},'version':{'type':Sequelize[_0xde76('0x2')],'allowNull':![],'unique':_0xde76('0x3')},'main':{'type':Sequelize[_0xde76('0x2')],'defaultValue':_0xde76('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xde76('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xde76('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xde76('0x2')]},'state':{'type':Sequelize[_0xde76('0x2')],'unique':_0xde76('0x6')},'description':{'type':Sequelize[_0xde76('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xde76('0x2')]},'link':{'type':Sequelize[_0xde76('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xf36d=['BOOLEAN','state','sequelize','exports','unique_name_and_version','STRING','INTEGER'];(function(_0x285dda,_0x524369){var _0x8a97d5=function(_0x3da13b){while(--_0x3da13b){_0x285dda['push'](_0x285dda['shift']());}};_0x8a97d5(++_0x524369);}(_0xf36d,0x160));var _0xdf36=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0xf36d[_0x26b8b5];return _0x2150a9;};'use strict';var Sequelize=require(_0xdf36('0x0'));module[_0xdf36('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdf36('0x2')},'version':{'type':Sequelize[_0xdf36('0x3')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xdf36('0x3')]},'type':{'type':Sequelize[_0xdf36('0x3')]},'size':{'type':Sequelize[_0xdf36('0x4')]},'active':{'type':Sequelize[_0xdf36('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xdf36('0x3')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xdf36('0x3')],'unique':_0xdf36('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xdf36('0x3')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index ca4a90b..b82c51e 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 _0x9536=['includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','length','options','find','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','Integration','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9536,0x179));var _0x6953=function(_0x421eeb,_0x3d3e3e){_0x421eeb=_0x421eeb-0x0;var _0x2c7371=_0x9536[_0x421eeb];return _0x2c7371;};'use strict';var emlformat=require(_0x6953('0x0'));var rimraf=require(_0x6953('0x1'));var zipdir=require(_0x6953('0x2'));var jsonpatch=require(_0x6953('0x3'));var rp=require('request-promise');var moment=require(_0x6953('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6953('0x5'));var util=require(_0x6953('0x6'));var path=require(_0x6953('0x7'));var sox=require(_0x6953('0x8'));var csv=require(_0x6953('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6953('0xa'));var _=require(_0x6953('0xb'));var squel=require(_0x6953('0xc'));var crypto=require(_0x6953('0xd'));var jsforce=require(_0x6953('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6953('0x9'));var querystring=require(_0x6953('0xf'));var Papa=require(_0x6953('0x10'));var Redis=require('ioredis');var authService=require(_0x6953('0x11'));var qs=require(_0x6953('0x12'));var as=require(_0x6953('0x13'));var hardwareService=require(_0x6953('0x14'));var logger=require(_0x6953('0x15'))(_0x6953('0x16'));var utils=require(_0x6953('0x17'));var config=require(_0x6953('0x18'));var licenseUtil=require(_0x6953('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358388,_0x513dd0){_0x513dd0=_0x513dd0||0xcc;return function(_0x8de91e){if(_0x8de91e){return _0x358388[_0x6953('0x1a')](_0x513dd0);}return _0x358388[_0x6953('0x1b')](_0x513dd0)[_0x6953('0x1c')]();};}function respondWithResult(_0x1b5221,_0x244713){_0x244713=_0x244713||0xc8;return function(_0x175fa9){if(_0x175fa9){return _0x1b5221[_0x6953('0x1b')](_0x244713)[_0x6953('0x1d')](_0x175fa9);}};}function respondWithFilteredResult(_0x31d182,_0xae5515){return function(_0x548473){if(_0x548473){var _0x5f49db=typeof _0xae5515[_0x6953('0x1e')]===_0x6953('0x1f')&&typeof _0xae5515[_0x6953('0x20')]===_0x6953('0x1f');var _0x510d46=_0x548473[_0x6953('0x21')];var _0x2da771=_0x5f49db?0x0:_0xae5515['offset'];var _0x10858a=_0x5f49db?_0x548473[_0x6953('0x21')]:_0xae5515[_0x6953('0x1e')]+_0xae5515[_0x6953('0x20')];var _0xc714d3;if(_0x10858a>=_0x510d46){_0x10858a=_0x510d46;_0xc714d3=0xc8;}else{_0xc714d3=0xce;}_0x31d182['status'](_0xc714d3);return _0x31d182[_0x6953('0x22')](_0x6953('0x23'),_0x2da771+'-'+_0x10858a+'/'+_0x510d46)[_0x6953('0x1d')](_0x548473);}return null;};}function patchUpdates(_0x2ba433){return function(_0x41f021){try{jsonpatch['apply'](_0x41f021,_0x2ba433,!![]);}catch(_0xf96d07){return BPromise[_0x6953('0x24')](_0xf96d07);}return _0x41f021['save']();};}function saveUpdates(_0x317979,_0x40c9d1){return function(_0xb92529){if(_0xb92529){return _0xb92529[_0x6953('0x25')](_0x317979)['then'](function(_0x37f339){return _0x37f339;});}return null;};}function removeEntity(_0x231cb2,_0x2a7f6a){return function(_0x508ea7){if(_0x508ea7){return _0x508ea7['destroy']()['then'](function(){_0x231cb2[_0x6953('0x1b')](0xcc)[_0x6953('0x1c')]();});}};}function handleEntityNotFound(_0x550be4,_0x1a32f4){return function(_0x587df0){if(!_0x587df0){_0x550be4[_0x6953('0x1a')](0x194);}return _0x587df0;};}function handleError(_0x2bf39b,_0xcdbce8){_0xcdbce8=_0xcdbce8||0x1f4;return function(_0x2cc01e){logger[_0x6953('0x26')](_0x2cc01e[_0x6953('0x27')]);if(_0x2cc01e['name']){delete _0x2cc01e[_0x6953('0x28')];}_0x2bf39b[_0x6953('0x1b')](_0xcdbce8)['send'](_0x2cc01e);};}exports[_0x6953('0x29')]=function(_0x4af39d,_0x173b3c){var _0x3b1175={},_0x426c7c={},_0x4b0325={'count':0x0,'rows':[]};var _0x131992=_[_0x6953('0x2a')](db[_0x6953('0x2b')]['rawAttributes'],function(_0x4c49fc){return{'name':_0x4c49fc[_0x6953('0x2c')],'type':_0x4c49fc['type']['key']};});_0x426c7c[_0x6953('0x2d')]=_[_0x6953('0x2a')](_0x131992,_0x6953('0x28'));_0x426c7c[_0x6953('0x2e')]=_[_0x6953('0x2f')](_0x4af39d['query']);_0x426c7c[_0x6953('0x30')]=_['intersection'](_0x426c7c[_0x6953('0x2d')],_0x426c7c[_0x6953('0x2e')]);_0x3b1175['attributes']=_['intersection'](_0x426c7c[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x4af39d[_0x6953('0x2e')]['fields']));_0x3b1175[_0x6953('0x32')]=_0x3b1175['attributes']['length']?_0x3b1175['attributes']:_0x426c7c['model'];if(!_0x4af39d[_0x6953('0x2e')][_0x6953('0x33')](_0x6953('0x34'))){_0x3b1175[_0x6953('0x20')]=qs[_0x6953('0x20')](_0x4af39d[_0x6953('0x2e')]['limit']);_0x3b1175[_0x6953('0x1e')]=qs['offset'](_0x4af39d[_0x6953('0x2e')]['offset']);}_0x3b1175[_0x6953('0x35')]=qs[_0x6953('0x36')](_0x4af39d[_0x6953('0x2e')][_0x6953('0x36')]);_0x3b1175['where']=qs[_0x6953('0x30')](_[_0x6953('0x37')](_0x4af39d[_0x6953('0x2e')],_0x426c7c[_0x6953('0x30')]),_0x131992);if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x38')]){_0x3b1175[_0x6953('0x39')]=_[_0x6953('0x3a')](_0x3b1175[_0x6953('0x39')],{'$or':_[_0x6953('0x2a')](_0x131992,function(_0x2d9d81){if(_0x2d9d81['type']!==_0x6953('0x3b')){var _0x3c03ab={};_0x3c03ab[_0x2d9d81[_0x6953('0x28')]]={'$like':'%'+_0x4af39d['query']['filter']+'%'};return _0x3c03ab;}})});}_0x3b1175=_[_0x6953('0x3a')]({},_0x3b1175,_0x4af39d['options']);var _0x5abaf2={'where':_0x3b1175[_0x6953('0x39')]};return db[_0x6953('0x2b')]['count'](_0x5abaf2)[_0x6953('0x3c')](function(_0x263728){_0x4b0325[_0x6953('0x21')]=_0x263728;if(_0x4af39d[_0x6953('0x2e')][_0x6953('0x3d')]){_0x3b1175[_0x6953('0x3e')]=[{'all':!![]}];}return db['Integration'][_0x6953('0x3f')](_0x3b1175);})[_0x6953('0x3c')](function(_0x30a27a){_0x4b0325[_0x6953('0x40')]=_0x30a27a;return _0x4b0325;})[_0x6953('0x3c')](respondWithFilteredResult(_0x173b3c,_0x3b1175))[_0x6953('0x41')](handleError(_0x173b3c,null));};exports['show']=function(_0x5a40de,_0xeef91a){var _0x54d7c2={'raw':![],'where':{'id':_0x5a40de[_0x6953('0x42')]['id']}},_0x588ff8={};_0x588ff8[_0x6953('0x2d')]=_[_0x6953('0x2f')](db[_0x6953('0x2b')][_0x6953('0x43')]);_0x588ff8['query']=_['keys'](_0x5a40de[_0x6953('0x2e')]);_0x588ff8[_0x6953('0x30')]=_['intersection'](_0x588ff8[_0x6953('0x2d')],_0x588ff8['query']);_0x54d7c2[_0x6953('0x32')]=_[_0x6953('0x44')](_0x588ff8[_0x6953('0x2d')],qs[_0x6953('0x31')](_0x5a40de['query'][_0x6953('0x31')]));_0x54d7c2[_0x6953('0x32')]=_0x54d7c2['attributes'][_0x6953('0x45')]?_0x54d7c2[_0x6953('0x32')]:_0x588ff8[_0x6953('0x2d')];if(_0x5a40de[_0x6953('0x2e')][_0x6953('0x3d')]){_0x54d7c2[_0x6953('0x3e')]=[{'all':!![]}];}_0x54d7c2=_[_0x6953('0x3a')]({},_0x54d7c2,_0x5a40de[_0x6953('0x46')]);return db[_0x6953('0x2b')][_0x6953('0x47')](_0x54d7c2)[_0x6953('0x3c')](handleEntityNotFound(_0xeef91a,null))['then'](respondWithResult(_0xeef91a,null))[_0x6953('0x41')](handleError(_0xeef91a,null));};exports['create']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['create'](_0x15c142[_0x6953('0x48')],{})[_0x6953('0x3c')](respondWithResult(_0x1d5979,0xc9))['catch'](handleError(_0x1d5979,null));};exports['update']=function(_0xbf5b61,_0x265b44){if(_0xbf5b61[_0x6953('0x48')]['id']){delete _0xbf5b61[_0x6953('0x48')]['id'];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0xbf5b61[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x265b44,null))[_0x6953('0x3c')](saveUpdates(_0xbf5b61[_0x6953('0x48')],null))[_0x6953('0x3c')](respondWithResult(_0x265b44,null))['catch'](handleError(_0x265b44,null));};exports['destroy']=function(_0x14a7bf,_0x38e3e8){return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0x14a7bf[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x38e3e8,null))[_0x6953('0x3c')](removeEntity(_0x38e3e8,null))[_0x6953('0x41')](handleError(_0x38e3e8,null));}; \ No newline at end of file +var _0xd943=['mustache','util','path','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','Integration','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','merge','includeAll','include','findAll','catch','show','params','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x2057cd,_0x2898f6){var _0x5545cb=function(_0x534a86){while(--_0x534a86){_0x2057cd['push'](_0x2057cd['shift']());}};_0x5545cb(++_0x2898f6);}(_0xd943,0x15d));var _0x3d94=function(_0x30bd89,_0x4543a1){_0x30bd89=_0x30bd89-0x0;var _0x52bf80=_0xd943[_0x30bd89];return _0x52bf80;};'use strict';var emlformat=require(_0x3d94('0x0'));var rimraf=require(_0x3d94('0x1'));var zipdir=require(_0x3d94('0x2'));var jsonpatch=require(_0x3d94('0x3'));var rp=require('request-promise');var moment=require(_0x3d94('0x4'));var BPromise=require(_0x3d94('0x5'));var Mustache=require(_0x3d94('0x6'));var util=require(_0x3d94('0x7'));var path=require(_0x3d94('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d94('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d94('0xa'));var jsforce=require(_0x3d94('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d94('0xc'));var Papa=require(_0x3d94('0xd'));var Redis=require(_0x3d94('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3d94('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3d94('0x10'));var logger=require(_0x3d94('0x11'))('api');var utils=require(_0x3d94('0x12'));var config=require(_0x3d94('0x13'));var licenseUtil=require(_0x3d94('0x14'));var db=require(_0x3d94('0x15'))['db'];function respondWithStatusCode(_0x15a392,_0x548b89){_0x548b89=_0x548b89||0xcc;return function(_0x96c54b){if(_0x96c54b){return _0x15a392[_0x3d94('0x16')](_0x548b89);}return _0x15a392[_0x3d94('0x17')](_0x548b89)['end']();};}function respondWithResult(_0x24e8b9,_0x29608d){_0x29608d=_0x29608d||0xc8;return function(_0x7d6969){if(_0x7d6969){return _0x24e8b9['status'](_0x29608d)[_0x3d94('0x18')](_0x7d6969);}};}function respondWithFilteredResult(_0x340818,_0x292419){return function(_0x34098e){if(_0x34098e){var _0xaf939a=typeof _0x292419[_0x3d94('0x19')]===_0x3d94('0x1a')&&typeof _0x292419[_0x3d94('0x1b')]==='undefined';var _0x22676a=_0x34098e[_0x3d94('0x1c')];var _0x2acee3=_0xaf939a?0x0:_0x292419[_0x3d94('0x19')];var _0x4afc92=_0xaf939a?_0x34098e[_0x3d94('0x1c')]:_0x292419[_0x3d94('0x19')]+_0x292419['limit'];var _0x9bca24;if(_0x4afc92>=_0x22676a){_0x4afc92=_0x22676a;_0x9bca24=0xc8;}else{_0x9bca24=0xce;}_0x340818['status'](_0x9bca24);return _0x340818[_0x3d94('0x1d')](_0x3d94('0x1e'),_0x2acee3+'-'+_0x4afc92+'/'+_0x22676a)[_0x3d94('0x18')](_0x34098e);}return null;};}function patchUpdates(_0x1e9ec2){return function(_0x35a3cc){try{jsonpatch['apply'](_0x35a3cc,_0x1e9ec2,!![]);}catch(_0x578002){return BPromise[_0x3d94('0x1f')](_0x578002);}return _0x35a3cc[_0x3d94('0x20')]();};}function saveUpdates(_0x9c2f2c,_0x4edee4){return function(_0x30af25){if(_0x30af25){return _0x30af25[_0x3d94('0x21')](_0x9c2f2c)[_0x3d94('0x22')](function(_0x384f76){return _0x384f76;});}return null;};}function removeEntity(_0x395133,_0x4093a4){return function(_0x295493){if(_0x295493){return _0x295493[_0x3d94('0x23')]()[_0x3d94('0x22')](function(){_0x395133[_0x3d94('0x17')](0xcc)[_0x3d94('0x24')]();});}};}function handleEntityNotFound(_0x192839,_0x292976){return function(_0x3496c3){if(!_0x3496c3){_0x192839[_0x3d94('0x16')](0x194);}return _0x3496c3;};}function handleError(_0x5b3b31,_0x123183){_0x123183=_0x123183||0x1f4;return function(_0x558fd2){logger[_0x3d94('0x25')](_0x558fd2[_0x3d94('0x26')]);if(_0x558fd2[_0x3d94('0x27')]){delete _0x558fd2[_0x3d94('0x27')];}_0x5b3b31[_0x3d94('0x17')](_0x123183)[_0x3d94('0x28')](_0x558fd2);};}exports[_0x3d94('0x29')]=function(_0x47d6ab,_0x584c4a){var _0x362642={},_0x4813e1={},_0x4dd410={'count':0x0,'rows':[]};var _0x23d20d=_['map'](db[_0x3d94('0x2a')][_0x3d94('0x2b')],function(_0x32403a){return{'name':_0x32403a['fieldName'],'type':_0x32403a[_0x3d94('0x2c')]['key']};});_0x4813e1[_0x3d94('0x2d')]=_['map'](_0x23d20d,_0x3d94('0x27'));_0x4813e1[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x47d6ab[_0x3d94('0x2e')]);_0x4813e1['filters']=_[_0x3d94('0x30')](_0x4813e1['model'],_0x4813e1[_0x3d94('0x2e')]);_0x362642[_0x3d94('0x31')]=_['intersection'](_0x4813e1['model'],qs[_0x3d94('0x32')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x32')]));_0x362642['attributes']=_0x362642[_0x3d94('0x31')][_0x3d94('0x33')]?_0x362642['attributes']:_0x4813e1[_0x3d94('0x2d')];if(!_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x34')](_0x3d94('0x35'))){_0x362642[_0x3d94('0x1b')]=qs['limit'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x1b')]);_0x362642[_0x3d94('0x19')]=qs[_0x3d94('0x19')](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x19')]);}_0x362642['order']=qs['sort'](_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x36')]);_0x362642[_0x3d94('0x37')]=qs[_0x3d94('0x38')](_[_0x3d94('0x39')](_0x47d6ab[_0x3d94('0x2e')],_0x4813e1[_0x3d94('0x38')]),_0x23d20d);if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]){_0x362642[_0x3d94('0x37')]=_['merge'](_0x362642[_0x3d94('0x37')],{'$or':_[_0x3d94('0x3b')](_0x23d20d,function(_0x361fbb){if(_0x361fbb[_0x3d94('0x2c')]!=='VIRTUAL'){var _0xcf7a73={};_0xcf7a73[_0x361fbb[_0x3d94('0x27')]]={'$like':'%'+_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3a')]+'%'};return _0xcf7a73;}})});}_0x362642=_[_0x3d94('0x3c')]({},_0x362642,_0x47d6ab['options']);var _0x217e5e={'where':_0x362642[_0x3d94('0x37')]};return db[_0x3d94('0x2a')]['count'](_0x217e5e)['then'](function(_0x4d8a8f){_0x4dd410['count']=_0x4d8a8f;if(_0x47d6ab[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x362642[_0x3d94('0x3e')]=[{'all':!![]}];}return db[_0x3d94('0x2a')][_0x3d94('0x3f')](_0x362642);})[_0x3d94('0x22')](function(_0x3a3898){_0x4dd410['rows']=_0x3a3898;return _0x4dd410;})['then'](respondWithFilteredResult(_0x584c4a,_0x362642))[_0x3d94('0x40')](handleError(_0x584c4a,null));};exports[_0x3d94('0x41')]=function(_0x512cef,_0x2d0aa2){var _0x4af4b6={'raw':![],'where':{'id':_0x512cef[_0x3d94('0x42')]['id']}},_0x1361fb={};_0x1361fb[_0x3d94('0x2d')]=_[_0x3d94('0x2f')](db[_0x3d94('0x2a')]['rawAttributes']);_0x1361fb[_0x3d94('0x2e')]=_[_0x3d94('0x2f')](_0x512cef[_0x3d94('0x2e')]);_0x1361fb['filters']=_[_0x3d94('0x30')](_0x1361fb['model'],_0x1361fb['query']);_0x4af4b6[_0x3d94('0x31')]=_[_0x3d94('0x30')](_0x1361fb[_0x3d94('0x2d')],qs[_0x3d94('0x32')](_0x512cef['query'][_0x3d94('0x32')]));_0x4af4b6['attributes']=_0x4af4b6[_0x3d94('0x31')][_0x3d94('0x33')]?_0x4af4b6[_0x3d94('0x31')]:_0x1361fb[_0x3d94('0x2d')];if(_0x512cef[_0x3d94('0x2e')][_0x3d94('0x3d')]){_0x4af4b6[_0x3d94('0x3e')]=[{'all':!![]}];}_0x4af4b6=_['merge']({},_0x4af4b6,_0x512cef[_0x3d94('0x43')]);return db[_0x3d94('0x2a')]['find'](_0x4af4b6)['then'](handleEntityNotFound(_0x2d0aa2,null))[_0x3d94('0x22')](respondWithResult(_0x2d0aa2,null))[_0x3d94('0x40')](handleError(_0x2d0aa2,null));};exports['create']=function(_0x3c8571,_0x13fda9){return db[_0x3d94('0x2a')][_0x3d94('0x44')](_0x3c8571[_0x3d94('0x45')],{})[_0x3d94('0x22')](respondWithResult(_0x13fda9,0xc9))[_0x3d94('0x40')](handleError(_0x13fda9,null));};exports[_0x3d94('0x21')]=function(_0x60279f,_0x2429bc){if(_0x60279f[_0x3d94('0x45')]['id']){delete _0x60279f[_0x3d94('0x45')]['id'];}return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x60279f[_0x3d94('0x42')]['id']}})['then'](handleEntityNotFound(_0x2429bc,null))[_0x3d94('0x22')](saveUpdates(_0x60279f[_0x3d94('0x45')],null))[_0x3d94('0x22')](respondWithResult(_0x2429bc,null))[_0x3d94('0x40')](handleError(_0x2429bc,null));};exports[_0x3d94('0x23')]=function(_0x3ce0be,_0x129783){return db[_0x3d94('0x2a')][_0x3d94('0x46')]({'where':{'id':_0x3ce0be['params']['id']}})[_0x3d94('0x22')](handleEntityNotFound(_0x129783,null))['then'](removeEntity(_0x129783,null))[_0x3d94('0x40')](handleError(_0x129783,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index abfa78f..d2d0a93 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 _0x594b=['../../config/environment','exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x27861e,_0x206498){var _0x49cb35=function(_0x5e1c69){while(--_0x5e1c69){_0x27861e['push'](_0x27861e['shift']());}};_0x49cb35(++_0x206498);}(_0x594b,0x1d3));var _0xb594=function(_0x147244,_0x471347){_0x147244=_0x147244-0x0;var _0x5bc82a=_0x594b[_0x147244];return _0x5bc82a;};'use strict';var _=require(_0xb594('0x0'));var util=require(_0xb594('0x1'));var logger=require(_0xb594('0x2'))(_0xb594('0x3'));var moment=require(_0xb594('0x4'));var BPromise=require(_0xb594('0x5'));var rp=require(_0xb594('0x6'));var fs=require('fs');var path=require(_0xb594('0x7'));var rimraf=require(_0xb594('0x8'));var config=require(_0xb594('0x9'));var attributes=require('./integration.attributes');module[_0xb594('0xa')]=function(_0x51969e,_0x2a9fe9){return _0x51969e[_0xb594('0xb')](_0xb594('0xc'),attributes,{'tableName':_0xb594('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07c0=['../../config/logger','moment','rimraf','exports','define','Integration','integrations','lodash'];(function(_0x1582f4,_0x180f2f){var _0x47ee8c=function(_0x29c46b){while(--_0x29c46b){_0x1582f4['push'](_0x1582f4['shift']());}};_0x47ee8c(++_0x180f2f);}(_0x07c0,0x137));var _0x007c=function(_0x2c0557,_0x4314fd){_0x2c0557=_0x2c0557-0x0;var _0x2878cd=_0x07c0[_0x2c0557];return _0x2878cd;};'use strict';var _=require(_0x007c('0x0'));var util=require('util');var logger=require(_0x007c('0x1'))('api');var moment=require(_0x007c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x007c('0x3'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0x007c('0x4')]=function(_0x246bd9,_0x4c2895){return _0x246bd9[_0x007c('0x5')](_0x007c('0x6'),attributes,{'tableName':_0x007c('0x7'),'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 73fd214..4493b53 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 _0xd943=['info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x50f929,_0x49bae9){var _0x2416c5=function(_0x55c7eb){while(--_0x55c7eb){_0x50f929['push'](_0x50f929['shift']());}};_0x2416c5(++_0x49bae9);}(_0xd943,0x15d));var _0x3d94=function(_0x1feb25,_0x3988fc){_0x1feb25=_0x1feb25-0x0;var _0x94a9f5=_0xd943[_0x1feb25];return _0x94a9f5;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('Integration,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});} \ No newline at end of file +var _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5361c7,_0x4ca922){var _0x50e943=function(_0x389a7b){while(--_0x389a7b){_0x5361c7['push'](_0x5361c7['shift']());}};_0x50e943(++_0x4ca922);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x3d28af,_0x47547c){_0x3d28af=_0x3d28af-0x0;var _0x495b50=_0xc6ac[_0x3d28af];return _0x495b50;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 26a2482..0f35632 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 _0xba34=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x58068d,_0x8699ff){var _0x56b5c0=function(_0x4da341){while(--_0x4da341){_0x58068d['push'](_0x58068d['shift']());}};_0x56b5c0(++_0x8699ff);}(_0xba34,0x119));var _0x4ba3=function(_0x24c45f,_0x2136c7){_0x24c45f=_0x24c45f-0x0;var _0x4b7ae7=_0xba34[_0x24c45f];return _0x4b7ae7;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xc'),auth['isAuthenticated'](),controller[_0x4ba3('0x11')]);router[_0x4ba3('0x12')]('/:id',auth[_0x4ba3('0x9')](),controller['destroy']);module[_0x4ba3('0x13')]=router; \ No newline at end of file +var _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','create','put','update','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./integrationReport.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['show']);router['post']('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router[_0x65f6('0xd')](_0x65f6('0xb'),auth['isAuthenticated'](),controller[_0x65f6('0xe')]);router['delete']('/:id',auth[_0x65f6('0x8')](),controller['destroy']);module[_0x65f6('0xf')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index d09dd0e..265993b 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 _0xbc51=['DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','STRING','INTEGER'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xbc51,0x1ca));var _0x1bc5=function(_0x15d18f,_0x126b0e){_0x15d18f=_0x15d18f-0x0;var _0xd12bf7=_0xbc51[_0x15d18f];return _0xd12bf7;};'use strict';var Sequelize=require('sequelize');module['exports']={'integration':{'type':Sequelize[_0x1bc5('0x0')]},'eventChannel':{'type':Sequelize[_0x1bc5('0x0')]},'exitStatus':{'type':Sequelize[_0x1bc5('0x0')]},'ticketId':{'type':Sequelize[_0x1bc5('0x0')]},'integrationId':{'type':Sequelize[_0x1bc5('0x1')]},'contacts':{'type':Sequelize[_0x1bc5('0x0')]},'uniqueid':{'type':Sequelize[_0x1bc5('0x0')]},'calleridnum':{'type':Sequelize[_0x1bc5('0x0')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x1bc5('0x0')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x1bc5('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x1bc5('0x2')]},'talktime':{'type':Sequelize[_0x1bc5('0x1')]},'agentacw':{'type':Sequelize[_0x1bc5('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x1bc5('0x1')]},'reason':{'type':Sequelize[_0x1bc5('0x0')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x1bc5('0x2')]},'agentdump':{'type':Sequelize[_0x1bc5('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x1bc5('0x2')]},'lastevent':{'type':Sequelize[_0x1bc5('0x0')]},'channel':{'type':Sequelize[_0x1bc5('0x0')]},'channelstate':{'type':Sequelize[_0x1bc5('0x1')]},'channelstatedesc':{'type':Sequelize[_0x1bc5('0x0')]},'connectedlinenum':{'type':Sequelize[_0x1bc5('0x0')]},'connectedlinename':{'type':Sequelize[_0x1bc5('0x0')]},'language':{'type':Sequelize[_0x1bc5('0x0')]},'accountcode':{'type':Sequelize[_0x1bc5('0x0')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x1bc5('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x1bc5('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x1bc5('0x0')]},'destcalleridnum':{'type':Sequelize[_0x1bc5('0x0')]},'destcalleridname':{'type':Sequelize[_0x1bc5('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x1bc5('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x1bc5('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x1bc5('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x1bc5('0x0')]},'destpriority':{'type':Sequelize[_0x1bc5('0x0')]},'destuniqueid':{'type':Sequelize[_0x1bc5('0x0')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x1bc5('0x0')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x1bc5('0x0')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x1bc5('0x0')]},'attachment':{'type':Sequelize[_0x1bc5('0x4')]},'html':{'type':Sequelize[_0x1bc5('0x4')]},'text':{'type':Sequelize[_0x1bc5('0x4')]},'status':{'type':Sequelize[_0x1bc5('0x5')](_0x1bc5('0x6'),_0x1bc5('0x7'),_0x1bc5('0x8'),_0x1bc5('0x9'))},'url':{'type':Sequelize[_0x1bc5('0x0')]},'app':{'type':Sequelize[_0x1bc5('0x0')]},'appdata':{'type':Sequelize[_0x1bc5('0x0')]},'projectId':{'type':Sequelize[_0x1bc5('0x1')]}}; \ No newline at end of file +var _0xdfa4=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','FAILED','exports'];(function(_0x37bff4,_0x3a9a16){var _0x5b64e7=function(_0x112b20){while(--_0x112b20){_0x37bff4['push'](_0x37bff4['shift']());}};_0x5b64e7(++_0x3a9a16);}(_0xdfa4,0x1cb));var _0x4dfa=function(_0x51d658,_0x448dd9){_0x51d658=_0x51d658-0x0;var _0x337e99=_0xdfa4[_0x51d658];return _0x337e99;};'use strict';var Sequelize=require('sequelize');module[_0x4dfa('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x4dfa('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x4dfa('0x1')]},'integrationId':{'type':Sequelize[_0x4dfa('0x2')]},'contacts':{'type':Sequelize[_0x4dfa('0x1')]},'uniqueid':{'type':Sequelize[_0x4dfa('0x1')]},'calleridnum':{'type':Sequelize[_0x4dfa('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x4dfa('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4dfa('0x1')]},'agentcalledAt':{'type':Sequelize[_0x4dfa('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x4dfa('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4dfa('0x3')]},'talktime':{'type':Sequelize[_0x4dfa('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4dfa('0x2')]},'reason':{'type':Sequelize[_0x4dfa('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x4dfa('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4dfa('0x3')]},'lastevent':{'type':Sequelize[_0x4dfa('0x1')]},'channel':{'type':Sequelize[_0x4dfa('0x1')]},'channelstate':{'type':Sequelize[_0x4dfa('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x4dfa('0x1')]},'connectedlinename':{'type':Sequelize[_0x4dfa('0x1')]},'language':{'type':Sequelize[_0x4dfa('0x1')]},'accountcode':{'type':Sequelize[_0x4dfa('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x4dfa('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x4dfa('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x4dfa('0x1')]},'destcalleridnum':{'type':Sequelize[_0x4dfa('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x4dfa('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x4dfa('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x4dfa('0x1')]},'destcontext':{'type':Sequelize[_0x4dfa('0x1')]},'destexten':{'type':Sequelize[_0x4dfa('0x1')]},'destpriority':{'type':Sequelize[_0x4dfa('0x1')]},'destuniqueid':{'type':Sequelize[_0x4dfa('0x1')]},'messageId':{'type':Sequelize[_0x4dfa('0x1')]},'inReplyTo':{'type':Sequelize[_0x4dfa('0x1')]},'subject':{'type':Sequelize[_0x4dfa('0x1')]},'from':{'type':Sequelize[_0x4dfa('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x4dfa('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x4dfa('0x5')]},'text':{'type':Sequelize[_0x4dfa('0x5')]},'status':{'type':Sequelize[_0x4dfa('0x6')](_0x4dfa('0x7'),_0x4dfa('0x8'),'RECEIVED',_0x4dfa('0x9'))},'url':{'type':Sequelize[_0x4dfa('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x4dfa('0x1')]},'projectId':{'type':Sequelize[_0x4dfa('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 95eb297..2713a3c 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 _0x5a56=['squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','update','destroy','then','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x41934a,_0x3caf8d){var _0x3331d3=function(_0xf82cd8){while(--_0xf82cd8){_0x41934a['push'](_0x41934a['shift']());}};_0x3331d3(++_0x3caf8d);}(_0x5a56,0x1b0));var _0x65a5=function(_0x40c9e9,_0x482019){_0x40c9e9=_0x40c9e9-0x0;var _0x365446=_0x5a56[_0x40c9e9];return _0x365446;};'use strict';var emlformat=require(_0x65a5('0x0'));var rimraf=require(_0x65a5('0x1'));var zipdir=require(_0x65a5('0x2'));var jsonpatch=require(_0x65a5('0x3'));var rp=require('request-promise');var moment=require(_0x65a5('0x4'));var BPromise=require(_0x65a5('0x5'));var Mustache=require(_0x65a5('0x6'));var util=require(_0x65a5('0x7'));var path=require(_0x65a5('0x8'));var sox=require(_0x65a5('0x9'));var csv=require(_0x65a5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x65a5('0xb'));var _=require('lodash');var squel=require(_0x65a5('0xc'));var crypto=require('crypto');var jsforce=require(_0x65a5('0xd'));var deskjs=require(_0x65a5('0xe'));var toCsv=require(_0x65a5('0xa'));var querystring=require('querystring');var Papa=require(_0x65a5('0xf'));var Redis=require(_0x65a5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x65a5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x65a5('0x12'))(_0x65a5('0x13'));var utils=require(_0x65a5('0x14'));var config=require(_0x65a5('0x15'));var licenseUtil=require(_0x65a5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b7c6e,_0x4da28c){_0x4da28c=_0x4da28c||0xcc;return function(_0x24f152){if(_0x24f152){return _0x1b7c6e[_0x65a5('0x17')](_0x4da28c);}return _0x1b7c6e[_0x65a5('0x18')](_0x4da28c)[_0x65a5('0x19')]();};}function respondWithResult(_0x4530b4,_0x501b93){_0x501b93=_0x501b93||0xc8;return function(_0x128606){if(_0x128606){return _0x4530b4['status'](_0x501b93)['json'](_0x128606);}};}function respondWithFilteredResult(_0x231e2e,_0x33d4df){return function(_0x59833b){if(_0x59833b){var _0x4c8583=typeof _0x33d4df[_0x65a5('0x1a')]===_0x65a5('0x1b')&&typeof _0x33d4df[_0x65a5('0x1c')]==='undefined';var _0x3f6457=_0x59833b[_0x65a5('0x1d')];var _0x43c01e=_0x4c8583?0x0:_0x33d4df[_0x65a5('0x1a')];var _0xbdb3d9=_0x4c8583?_0x59833b[_0x65a5('0x1d')]:_0x33d4df['offset']+_0x33d4df[_0x65a5('0x1c')];var _0x256bbe;if(_0xbdb3d9>=_0x3f6457){_0xbdb3d9=_0x3f6457;_0x256bbe=0xc8;}else{_0x256bbe=0xce;}_0x231e2e['status'](_0x256bbe);return _0x231e2e['set'](_0x65a5('0x1e'),_0x43c01e+'-'+_0xbdb3d9+'/'+_0x3f6457)[_0x65a5('0x1f')](_0x59833b);}return null;};}function patchUpdates(_0x19ab3e){return function(_0x459943){try{jsonpatch[_0x65a5('0x20')](_0x459943,_0x19ab3e,!![]);}catch(_0x40e58a){return BPromise['reject'](_0x40e58a);}return _0x459943['save']();};}function saveUpdates(_0x3bd5a3,_0x5de21c){return function(_0x443b8e){if(_0x443b8e){return _0x443b8e[_0x65a5('0x21')](_0x3bd5a3)['then'](function(_0x404459){return _0x404459;});}return null;};}function removeEntity(_0x44069b,_0x52ee9d){return function(_0xfc6359){if(_0xfc6359){return _0xfc6359[_0x65a5('0x22')]()[_0x65a5('0x23')](function(){_0x44069b[_0x65a5('0x18')](0xcc)[_0x65a5('0x19')]();});}};}function handleEntityNotFound(_0x3abe8d,_0xff5097){return function(_0x5cb5ee){if(!_0x5cb5ee){_0x3abe8d[_0x65a5('0x17')](0x194);}return _0x5cb5ee;};}function handleError(_0xabf42b,_0x17a372){_0x17a372=_0x17a372||0x1f4;return function(_0x57e351){logger['error'](_0x57e351[_0x65a5('0x24')]);if(_0x57e351[_0x65a5('0x25')]){delete _0x57e351[_0x65a5('0x25')];}_0xabf42b[_0x65a5('0x18')](_0x17a372)[_0x65a5('0x26')](_0x57e351);};}exports[_0x65a5('0x27')]=function(_0x1773b5,_0x2ca93b){var _0x58940f={},_0x1a06db={},_0xf819b1={'count':0x0,'rows':[]};var _0x2d579f=_[_0x65a5('0x28')](db[_0x65a5('0x29')][_0x65a5('0x2a')],function(_0x4c84bb){return{'name':_0x4c84bb[_0x65a5('0x2b')],'type':_0x4c84bb['type'][_0x65a5('0x2c')]};});_0x1a06db['model']=_[_0x65a5('0x28')](_0x2d579f,_0x65a5('0x25'));_0x1a06db[_0x65a5('0x2d')]=_[_0x65a5('0x2e')](_0x1773b5[_0x65a5('0x2d')]);_0x1a06db['filters']=_[_0x65a5('0x2f')](_0x1a06db[_0x65a5('0x30')],_0x1a06db['query']);_0x58940f[_0x65a5('0x31')]=_[_0x65a5('0x2f')](_0x1a06db[_0x65a5('0x30')],qs[_0x65a5('0x32')](_0x1773b5[_0x65a5('0x2d')][_0x65a5('0x32')]));_0x58940f[_0x65a5('0x31')]=_0x58940f['attributes'][_0x65a5('0x33')]?_0x58940f[_0x65a5('0x31')]:_0x1a06db['model'];if(!_0x1773b5['query'][_0x65a5('0x34')](_0x65a5('0x35'))){_0x58940f[_0x65a5('0x1c')]=qs[_0x65a5('0x1c')](_0x1773b5[_0x65a5('0x2d')][_0x65a5('0x1c')]);_0x58940f[_0x65a5('0x1a')]=qs[_0x65a5('0x1a')](_0x1773b5[_0x65a5('0x2d')][_0x65a5('0x1a')]);}_0x58940f[_0x65a5('0x36')]=qs[_0x65a5('0x37')](_0x1773b5['query']['sort']);_0x58940f[_0x65a5('0x38')]=qs[_0x65a5('0x39')](_[_0x65a5('0x3a')](_0x1773b5[_0x65a5('0x2d')],_0x1a06db['filters']),_0x2d579f);if(_0x1773b5[_0x65a5('0x2d')][_0x65a5('0x3b')]){_0x58940f[_0x65a5('0x38')]=_['merge'](_0x58940f[_0x65a5('0x38')],{'$or':_[_0x65a5('0x28')](_0x2d579f,function(_0x17215a){if(_0x17215a[_0x65a5('0x3c')]!==_0x65a5('0x3d')){var _0x2b8f7d={};_0x2b8f7d[_0x17215a[_0x65a5('0x25')]]={'$like':'%'+_0x1773b5[_0x65a5('0x2d')][_0x65a5('0x3b')]+'%'};return _0x2b8f7d;}})});}_0x58940f=_[_0x65a5('0x3e')]({},_0x58940f,_0x1773b5[_0x65a5('0x3f')]);var _0x429de8={'where':_0x58940f[_0x65a5('0x38')]};return db[_0x65a5('0x29')][_0x65a5('0x1d')](_0x429de8)[_0x65a5('0x23')](function(_0x374de3){_0xf819b1[_0x65a5('0x1d')]=_0x374de3;if(_0x1773b5[_0x65a5('0x2d')][_0x65a5('0x40')]){_0x58940f[_0x65a5('0x41')]=[{'all':!![]}];}return db[_0x65a5('0x29')]['findAll'](_0x58940f);})[_0x65a5('0x23')](function(_0x5d9b42){_0xf819b1[_0x65a5('0x42')]=_0x5d9b42;return _0xf819b1;})[_0x65a5('0x23')](respondWithFilteredResult(_0x2ca93b,_0x58940f))['catch'](handleError(_0x2ca93b,null));};exports[_0x65a5('0x43')]=function(_0x111959,_0x14ca72){var _0x2d8d14={'raw':![],'where':{'id':_0x111959[_0x65a5('0x44')]['id']}},_0x17c897={};_0x17c897[_0x65a5('0x30')]=_['keys'](db[_0x65a5('0x29')][_0x65a5('0x2a')]);_0x17c897['query']=_[_0x65a5('0x2e')](_0x111959[_0x65a5('0x2d')]);_0x17c897[_0x65a5('0x39')]=_['intersection'](_0x17c897[_0x65a5('0x30')],_0x17c897['query']);_0x2d8d14[_0x65a5('0x31')]=_[_0x65a5('0x2f')](_0x17c897[_0x65a5('0x30')],qs[_0x65a5('0x32')](_0x111959[_0x65a5('0x2d')][_0x65a5('0x32')]));_0x2d8d14[_0x65a5('0x31')]=_0x2d8d14[_0x65a5('0x31')][_0x65a5('0x33')]?_0x2d8d14[_0x65a5('0x31')]:_0x17c897[_0x65a5('0x30')];if(_0x111959[_0x65a5('0x2d')][_0x65a5('0x40')]){_0x2d8d14[_0x65a5('0x41')]=[{'all':!![]}];}_0x2d8d14=_[_0x65a5('0x3e')]({},_0x2d8d14,_0x111959[_0x65a5('0x3f')]);return db[_0x65a5('0x29')][_0x65a5('0x45')](_0x2d8d14)[_0x65a5('0x23')](handleEntityNotFound(_0x14ca72,null))[_0x65a5('0x23')](respondWithResult(_0x14ca72,null))[_0x65a5('0x46')](handleError(_0x14ca72,null));};exports[_0x65a5('0x47')]=function(_0x5dbab3,_0x5bdf06){return db['IntegrationReport'][_0x65a5('0x47')](_0x5dbab3[_0x65a5('0x48')],{})[_0x65a5('0x23')](respondWithResult(_0x5bdf06,0xc9))[_0x65a5('0x46')](handleError(_0x5bdf06,null));};exports[_0x65a5('0x21')]=function(_0x42b444,_0x5a9a45){if(_0x42b444[_0x65a5('0x48')]['id']){delete _0x42b444['body']['id'];}return db['IntegrationReport'][_0x65a5('0x45')]({'where':{'id':_0x42b444[_0x65a5('0x44')]['id']}})[_0x65a5('0x23')](handleEntityNotFound(_0x5a9a45,null))[_0x65a5('0x23')](saveUpdates(_0x42b444[_0x65a5('0x48')],null))['then'](respondWithResult(_0x5a9a45,null))[_0x65a5('0x46')](handleError(_0x5a9a45,null));};exports[_0x65a5('0x22')]=function(_0x543373,_0x43581c){return db['IntegrationReport'][_0x65a5('0x45')]({'where':{'id':_0x543373['params']['id']}})['then'](handleEntityNotFound(_0x43581c,null))['then'](removeEntity(_0x43581c,null))[_0x65a5('0x46')](handleError(_0x43581c,null));};exports[_0x65a5('0x49')]=function(_0x1ed3dd,_0x2b4a3b){return db['IntegrationReport']['describe']()[_0x65a5('0x23')](respondWithResult(_0x2b4a3b,null))[_0x65a5('0x46')](handleError(_0x2b4a3b,null));}; \ No newline at end of file +var _0x1cb0=['describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','IntegrationReport','type','key','query','keys','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','map','VIRTUAL','options','include','findAll','catch','params','rawAttributes','includeAll','find','create','body'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x1cb0,0x119));var _0x01cb=function(_0xec919c,_0x45c528){_0xec919c=_0xec919c-0x0;var _0x516869=_0x1cb0[_0xec919c];return _0x516869;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x01cb('0x0'));var zipdir=require(_0x01cb('0x1'));var jsonpatch=require(_0x01cb('0x2'));var rp=require(_0x01cb('0x3'));var moment=require(_0x01cb('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x01cb('0x5'));var sox=require(_0x01cb('0x6'));var csv=require(_0x01cb('0x7'));var ejs=require(_0x01cb('0x8'));var fs=require('fs');var fs_extra=require(_0x01cb('0x9'));var _=require('lodash');var squel=require(_0x01cb('0xa'));var crypto=require(_0x01cb('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x01cb('0x7'));var querystring=require(_0x01cb('0xc'));var Papa=require(_0x01cb('0xd'));var Redis=require(_0x01cb('0xe'));var authService=require(_0x01cb('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x01cb('0x10'));var logger=require(_0x01cb('0x11'))(_0x01cb('0x12'));var utils=require(_0x01cb('0x13'));var config=require(_0x01cb('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x454e2f,_0x114224){_0x114224=_0x114224||0xcc;return function(_0x141805){if(_0x141805){return _0x454e2f[_0x01cb('0x15')](_0x114224);}return _0x454e2f[_0x01cb('0x16')](_0x114224)[_0x01cb('0x17')]();};}function respondWithResult(_0x58967f,_0x1d58fd){_0x1d58fd=_0x1d58fd||0xc8;return function(_0x26a8ea){if(_0x26a8ea){return _0x58967f[_0x01cb('0x16')](_0x1d58fd)['json'](_0x26a8ea);}};}function respondWithFilteredResult(_0x414b0e,_0x26fea5){return function(_0x34ea57){if(_0x34ea57){var _0x128e27=typeof _0x26fea5[_0x01cb('0x18')]===_0x01cb('0x19')&&typeof _0x26fea5[_0x01cb('0x1a')]===_0x01cb('0x19');var _0x463fb1=_0x34ea57['count'];var _0x34f512=_0x128e27?0x0:_0x26fea5[_0x01cb('0x18')];var _0x207f2f=_0x128e27?_0x34ea57[_0x01cb('0x1b')]:_0x26fea5[_0x01cb('0x18')]+_0x26fea5[_0x01cb('0x1a')];var _0x3a2bf2;if(_0x207f2f>=_0x463fb1){_0x207f2f=_0x463fb1;_0x3a2bf2=0xc8;}else{_0x3a2bf2=0xce;}_0x414b0e[_0x01cb('0x16')](_0x3a2bf2);return _0x414b0e['set'](_0x01cb('0x1c'),_0x34f512+'-'+_0x207f2f+'/'+_0x463fb1)[_0x01cb('0x1d')](_0x34ea57);}return null;};}function patchUpdates(_0x6327af){return function(_0x1eeb15){try{jsonpatch[_0x01cb('0x1e')](_0x1eeb15,_0x6327af,!![]);}catch(_0xabdab1){return BPromise[_0x01cb('0x1f')](_0xabdab1);}return _0x1eeb15['save']();};}function saveUpdates(_0x3be001,_0xc8a7d8){return function(_0x7c6ded){if(_0x7c6ded){return _0x7c6ded[_0x01cb('0x20')](_0x3be001)[_0x01cb('0x21')](function(_0x40efb9){return _0x40efb9;});}return null;};}function removeEntity(_0x291cb1,_0x251f0d){return function(_0x23f0bd){if(_0x23f0bd){return _0x23f0bd[_0x01cb('0x22')]()[_0x01cb('0x21')](function(){_0x291cb1[_0x01cb('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x341866,_0x70f2f5){return function(_0x3475fb){if(!_0x3475fb){_0x341866[_0x01cb('0x15')](0x194);}return _0x3475fb;};}function handleError(_0x4a7644,_0x32c624){_0x32c624=_0x32c624||0x1f4;return function(_0x401877){logger[_0x01cb('0x23')](_0x401877[_0x01cb('0x24')]);if(_0x401877['name']){delete _0x401877[_0x01cb('0x25')];}_0x4a7644[_0x01cb('0x16')](_0x32c624)[_0x01cb('0x26')](_0x401877);};}exports[_0x01cb('0x27')]=function(_0x175844,_0x4b5079){var _0x251dff={},_0x22ae88={},_0x344c45={'count':0x0,'rows':[]};var _0x54c92a=_['map'](db[_0x01cb('0x28')]['rawAttributes'],function(_0x3c81b7){return{'name':_0x3c81b7['fieldName'],'type':_0x3c81b7[_0x01cb('0x29')][_0x01cb('0x2a')]};});_0x22ae88['model']=_['map'](_0x54c92a,_0x01cb('0x25'));_0x22ae88[_0x01cb('0x2b')]=_[_0x01cb('0x2c')](_0x175844[_0x01cb('0x2b')]);_0x22ae88['filters']=_[_0x01cb('0x2d')](_0x22ae88['model'],_0x22ae88[_0x01cb('0x2b')]);_0x251dff[_0x01cb('0x2e')]=_[_0x01cb('0x2d')](_0x22ae88[_0x01cb('0x2f')],qs[_0x01cb('0x30')](_0x175844['query'][_0x01cb('0x30')]));_0x251dff[_0x01cb('0x2e')]=_0x251dff[_0x01cb('0x2e')]['length']?_0x251dff[_0x01cb('0x2e')]:_0x22ae88[_0x01cb('0x2f')];if(!_0x175844[_0x01cb('0x2b')][_0x01cb('0x31')](_0x01cb('0x32'))){_0x251dff[_0x01cb('0x1a')]=qs[_0x01cb('0x1a')](_0x175844[_0x01cb('0x2b')][_0x01cb('0x1a')]);_0x251dff[_0x01cb('0x18')]=qs[_0x01cb('0x18')](_0x175844[_0x01cb('0x2b')][_0x01cb('0x18')]);}_0x251dff['order']=qs['sort'](_0x175844['query'][_0x01cb('0x33')]);_0x251dff['where']=qs['filters'](_[_0x01cb('0x34')](_0x175844[_0x01cb('0x2b')],_0x22ae88[_0x01cb('0x35')]),_0x54c92a);if(_0x175844['query'][_0x01cb('0x36')]){_0x251dff[_0x01cb('0x37')]=_[_0x01cb('0x38')](_0x251dff[_0x01cb('0x37')],{'$or':_[_0x01cb('0x39')](_0x54c92a,function(_0x38b14f){if(_0x38b14f[_0x01cb('0x29')]!==_0x01cb('0x3a')){var _0x504381={};_0x504381[_0x38b14f['name']]={'$like':'%'+_0x175844[_0x01cb('0x2b')][_0x01cb('0x36')]+'%'};return _0x504381;}})});}_0x251dff=_[_0x01cb('0x38')]({},_0x251dff,_0x175844[_0x01cb('0x3b')]);var _0x5a11dd={'where':_0x251dff['where']};return db[_0x01cb('0x28')]['count'](_0x5a11dd)[_0x01cb('0x21')](function(_0x15dfd2){_0x344c45[_0x01cb('0x1b')]=_0x15dfd2;if(_0x175844['query']['includeAll']){_0x251dff[_0x01cb('0x3c')]=[{'all':!![]}];}return db[_0x01cb('0x28')][_0x01cb('0x3d')](_0x251dff);})['then'](function(_0x40fd2e){_0x344c45['rows']=_0x40fd2e;return _0x344c45;})[_0x01cb('0x21')](respondWithFilteredResult(_0x4b5079,_0x251dff))[_0x01cb('0x3e')](handleError(_0x4b5079,null));};exports['show']=function(_0x5bea9e,_0x2c9267){var _0x13e377={'raw':![],'where':{'id':_0x5bea9e[_0x01cb('0x3f')]['id']}},_0x1b4727={};_0x1b4727['model']=_['keys'](db[_0x01cb('0x28')][_0x01cb('0x40')]);_0x1b4727[_0x01cb('0x2b')]=_[_0x01cb('0x2c')](_0x5bea9e[_0x01cb('0x2b')]);_0x1b4727[_0x01cb('0x35')]=_[_0x01cb('0x2d')](_0x1b4727['model'],_0x1b4727[_0x01cb('0x2b')]);_0x13e377['attributes']=_[_0x01cb('0x2d')](_0x1b4727[_0x01cb('0x2f')],qs['fields'](_0x5bea9e[_0x01cb('0x2b')][_0x01cb('0x30')]));_0x13e377[_0x01cb('0x2e')]=_0x13e377[_0x01cb('0x2e')]['length']?_0x13e377[_0x01cb('0x2e')]:_0x1b4727['model'];if(_0x5bea9e[_0x01cb('0x2b')][_0x01cb('0x41')]){_0x13e377[_0x01cb('0x3c')]=[{'all':!![]}];}_0x13e377=_['merge']({},_0x13e377,_0x5bea9e[_0x01cb('0x3b')]);return db[_0x01cb('0x28')][_0x01cb('0x42')](_0x13e377)[_0x01cb('0x21')](handleEntityNotFound(_0x2c9267,null))[_0x01cb('0x21')](respondWithResult(_0x2c9267,null))[_0x01cb('0x3e')](handleError(_0x2c9267,null));};exports[_0x01cb('0x43')]=function(_0x242ede,_0x2c7472){return db[_0x01cb('0x28')][_0x01cb('0x43')](_0x242ede['body'],{})['then'](respondWithResult(_0x2c7472,0xc9))[_0x01cb('0x3e')](handleError(_0x2c7472,null));};exports[_0x01cb('0x20')]=function(_0x48ecdc,_0x453f0d){if(_0x48ecdc[_0x01cb('0x44')]['id']){delete _0x48ecdc['body']['id'];}return db[_0x01cb('0x28')]['find']({'where':{'id':_0x48ecdc['params']['id']}})[_0x01cb('0x21')](handleEntityNotFound(_0x453f0d,null))[_0x01cb('0x21')](saveUpdates(_0x48ecdc[_0x01cb('0x44')],null))[_0x01cb('0x21')](respondWithResult(_0x453f0d,null))[_0x01cb('0x3e')](handleError(_0x453f0d,null));};exports[_0x01cb('0x22')]=function(_0x574408,_0x13ebb2){return db[_0x01cb('0x28')][_0x01cb('0x42')]({'where':{'id':_0x574408[_0x01cb('0x3f')]['id']}})[_0x01cb('0x21')](handleEntityNotFound(_0x13ebb2,null))[_0x01cb('0x21')](removeEntity(_0x13ebb2,null))[_0x01cb('0x3e')](handleError(_0x13ebb2,null));};exports[_0x01cb('0x45')]=function(_0x1af64b,_0x4a1439){return db[_0x01cb('0x28')][_0x01cb('0x45')]()[_0x01cb('0x21')](respondWithResult(_0x4a1439,null))['catch'](handleError(_0x4a1439,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index c26ab87..846ba79 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 _0x5b55=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','report_integration','lodash'];(function(_0x458eef,_0x551783){var _0x2fb384=function(_0x28465e){while(--_0x28465e){_0x458eef['push'](_0x458eef['shift']());}};_0x2fb384(++_0x551783);}(_0x5b55,0x128));var _0x55b5=function(_0x1d1a9c,_0x2274db){_0x1d1a9c=_0x1d1a9c-0x0;var _0x3e0c65=_0x5b55[_0x1d1a9c];return _0x3e0c65;};'use strict';var _=require(_0x55b5('0x0'));var util=require(_0x55b5('0x1'));var logger=require(_0x55b5('0x2'))(_0x55b5('0x3'));var moment=require(_0x55b5('0x4'));var BPromise=require(_0x55b5('0x5'));var rp=require(_0x55b5('0x6'));var fs=require('fs');var path=require(_0x55b5('0x7'));var rimraf=require(_0x55b5('0x8'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0x55b5('0x9')]=function(_0x12464a,_0x348f52){return _0x12464a['define']('IntegrationReport',attributes,{'tableName':_0x55b5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b8a=['rimraf','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','report_integration','util','moment','bluebird','request-promise','path'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x9b8a,0x1df));var _0xa9b8=function(_0xb8e1f2,_0x4c06a6){_0xb8e1f2=_0xb8e1f2-0x0;var _0xc37396=_0x9b8a[_0xb8e1f2];return _0xc37396;};'use strict';var _=require('lodash');var util=require(_0xa9b8('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa9b8('0x1'));var BPromise=require(_0xa9b8('0x2'));var rp=require(_0xa9b8('0x3'));var fs=require('fs');var path=require(_0xa9b8('0x4'));var rimraf=require(_0xa9b8('0x5'));var config=require(_0xa9b8('0x6'));var attributes=require(_0xa9b8('0x7'));module[_0xa9b8('0x8')]=function(_0x596b14,_0x365682){return _0x596b14['define'](_0xa9b8('0x9'),attributes,{'tableName':_0xa9b8('0xa'),'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 e4d7325..9348388 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 _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x4c8c4d,_0x170fc3){var _0x7c72d2=function(_0x249fd1){while(--_0x249fd1){_0x4c8c4d['push'](_0x4c8c4d['shift']());}};_0x7c72d2(++_0x170fc3);}(_0x524e,0x15e));var _0xe524=function(_0x47322a,_0x340ac0){_0x47322a=_0x47322a-0x0;var _0x269e63=_0x524e[_0x47322a];return _0x269e63;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file +var _0x1967=['then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0x1967,0x173));var _0x7196=function(_0x2579db,_0x5f5ce1){_0x2579db=_0x2579db-0x0;var _0x66b7cd=_0x1967[_0x2579db];return _0x66b7cd;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 5fb1679..3ebdb33 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 _0x195f=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','post','/:id/sub_intervals/create_many','addIntervals','/:id','delete'];(function(_0x3ce53b,_0x30bbcc){var _0x7fa584=function(_0x2250d7){while(--_0x2250d7){_0x3ce53b['push'](_0x3ce53b['shift']());}};_0x7fa584(++_0x30bbcc);}(_0x195f,0x113));var _0xf195=function(_0x34c4e1,_0x310387){_0x34c4e1=_0x34c4e1-0x0;var _0x5a11ef=_0x195f[_0x34c4e1];return _0x5a11ef;};'use strict';var multer=require(_0xf195('0x0'));var util=require(_0xf195('0x1'));var path=require('path');var timeout=require(_0xf195('0x2'));var express=require(_0xf195('0x3'));var router=express['Router']();var fs_extra=require(_0xf195('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf195('0x5'));var config=require(_0xf195('0x6'));var controller=require(_0xf195('0x7'));router[_0xf195('0x8')]('/',auth[_0xf195('0x9')](),controller[_0xf195('0xa')]);router[_0xf195('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf195('0xb')]);router[_0xf195('0x8')](_0xf195('0xc'),auth[_0xf195('0x9')](),controller[_0xf195('0xd')]);router[_0xf195('0xe')]('/',auth[_0xf195('0x9')](),controller['create']);router[_0xf195('0xe')](_0xf195('0xc'),auth[_0xf195('0x9')](),controller['addInterval']);router[_0xf195('0xe')](_0xf195('0xf'),auth[_0xf195('0x9')](),controller[_0xf195('0x10')]);router['put'](_0xf195('0x11'),auth[_0xf195('0x9')](),controller['update']);router[_0xf195('0x12')]('/:id',auth[_0xf195('0x9')](),controller[_0xf195('0x13')]);module[_0xf195('0x14')]=router; \ No newline at end of file +var _0x0b9b=['addIntervals','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many'];(function(_0x235f74,_0x5ac77f){var _0x4aa50f=function(_0x29b3dc){while(--_0x29b3dc){_0x235f74['push'](_0x235f74['shift']());}};_0x4aa50f(++_0x5ac77f);}(_0x0b9b,0x1b9));var _0xb0b9=function(_0x141c12,_0x419361){_0x141c12=_0x141c12-0x0;var _0x3de606=_0x0b9b[_0x141c12];return _0x3de606;};'use strict';var multer=require(_0xb0b9('0x0'));var util=require(_0xb0b9('0x1'));var path=require(_0xb0b9('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0b9('0x3'));var router=express[_0xb0b9('0x4')]();var fs_extra=require(_0xb0b9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb0b9('0x6'));var config=require(_0xb0b9('0x7'));var controller=require(_0xb0b9('0x8'));router[_0xb0b9('0x9')]('/',auth[_0xb0b9('0xa')](),controller[_0xb0b9('0xb')]);router['get'](_0xb0b9('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb0b9('0x9')](_0xb0b9('0xd'),auth['isAuthenticated'](),controller[_0xb0b9('0xe')]);router[_0xb0b9('0xf')]('/',auth['isAuthenticated'](),controller[_0xb0b9('0x10')]);router[_0xb0b9('0xf')](_0xb0b9('0xd'),auth['isAuthenticated'](),controller[_0xb0b9('0x11')]);router[_0xb0b9('0xf')](_0xb0b9('0x12'),auth['isAuthenticated'](),controller[_0xb0b9('0x13')]);router['put'](_0xb0b9('0xc'),auth[_0xb0b9('0xa')](),controller[_0xb0b9('0x14')]);router[_0xb0b9('0x15')](_0xb0b9('0xc'),auth[_0xb0b9('0xa')](),controller[_0xb0b9('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 063d648..92f9f08 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 _0x8feb=['sequelize','exports','STRING'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8feb,0x153));var _0xb8fe=function(_0x4e2766,_0x515f98){_0x4e2766=_0x4e2766-0x0;var _0x53d3e1=_0x8feb[_0x4e2766];return _0x53d3e1;};'use strict';var Sequelize=require(_0xb8fe('0x0'));module[_0xb8fe('0x1')]={'name':{'type':Sequelize[_0xb8fe('0x2')]},'description':{'type':Sequelize[_0xb8fe('0x2')]},'interval':{'type':Sequelize[_0xb8fe('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xf743=['STRING','sequelize','exports'];(function(_0x3483bc,_0x3b9d83){var _0x41ea1b=function(_0x4ca451){while(--_0x4ca451){_0x3483bc['push'](_0x3483bc['shift']());}};_0x41ea1b(++_0x3b9d83);}(_0xf743,0x1ab));var _0x3f74=function(_0x3e3854,_0x4d12ed){_0x3e3854=_0x3e3854-0x0;var _0x41bd24=_0xf743[_0x3e3854];return _0x41bd24;};'use strict';var Sequelize=require(_0x3f74('0x0'));module[_0x3f74('0x1')]={'name':{'type':Sequelize[_0x3f74('0x2')]},'description':{'type':Sequelize[_0x3f74('0x2')]},'interval':{'type':Sequelize[_0x3f74('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 9e30273..e3aed83 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 _0x78af=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','send','index','map','Interval','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','params','addInterval','IntervalId','keys','getIntervals','addIntervals','findOne','transaction','bulkCreate','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x233d84,_0x215212){var _0x36b467=function(_0x2fa4d9){while(--_0x2fa4d9){_0x233d84['push'](_0x233d84['shift']());}};_0x36b467(++_0x215212);}(_0x78af,0x9a));var _0xf78a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x78af[_0x82129b];return _0x2ae5dc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf78a('0x0'));var rp=require(_0xf78a('0x1'));var moment=require(_0xf78a('0x2'));var BPromise=require(_0xf78a('0x3'));var Mustache=require('mustache');var util=require(_0xf78a('0x4'));var path=require(_0xf78a('0x5'));var sox=require(_0xf78a('0x6'));var csv=require(_0xf78a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf78a('0x8'));var _=require(_0xf78a('0x9'));var squel=require(_0xf78a('0xa'));var crypto=require(_0xf78a('0xb'));var jsforce=require(_0xf78a('0xc'));var deskjs=require(_0xf78a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf78a('0xe'));var Papa=require(_0xf78a('0xf'));var Redis=require(_0xf78a('0x10'));var authService=require(_0xf78a('0x11'));var qs=require(_0xf78a('0x12'));var as=require(_0xf78a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf78a('0x14'))(_0xf78a('0x15'));var utils=require(_0xf78a('0x16'));var config=require(_0xf78a('0x17'));var licenseUtil=require(_0xf78a('0x18'));var db=require(_0xf78a('0x19'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x38df31,_0x679c9b){_0x679c9b=_0x679c9b||0xcc;return function(_0x5daaa6){if(_0x5daaa6){return _0x38df31[_0xf78a('0x1a')](_0x679c9b);}return _0x38df31[_0xf78a('0x1b')](_0x679c9b)[_0xf78a('0x1c')]();};}function respondWithResult(_0x14cec8,_0xbd6ef7){_0xbd6ef7=_0xbd6ef7||0xc8;return function(_0x12981f){if(_0x12981f){return _0x14cec8[_0xf78a('0x1b')](_0xbd6ef7)[_0xf78a('0x1d')](_0x12981f);}};}function respondWithFilteredResult(_0xf78e77,_0xa93c6){return function(_0x5bec7){if(_0x5bec7){var _0xf5fb71=typeof _0xa93c6[_0xf78a('0x1e')]===_0xf78a('0x1f')&&typeof _0xa93c6[_0xf78a('0x20')]===_0xf78a('0x1f');var _0x1904bb=_0x5bec7['count'];var _0x3b33a9=_0xf5fb71?0x0:_0xa93c6[_0xf78a('0x1e')];var _0x495c01=_0xf5fb71?_0x5bec7[_0xf78a('0x21')]:_0xa93c6[_0xf78a('0x1e')]+_0xa93c6[_0xf78a('0x20')];var _0x17094d;if(_0x495c01>=_0x1904bb){_0x495c01=_0x1904bb;_0x17094d=0xc8;}else{_0x17094d=0xce;}_0xf78e77['status'](_0x17094d);return _0xf78e77[_0xf78a('0x22')](_0xf78a('0x23'),_0x3b33a9+'-'+_0x495c01+'/'+_0x1904bb)[_0xf78a('0x1d')](_0x5bec7);}return null;};}function patchUpdates(_0x4747a9){return function(_0x5d1d69){try{jsonpatch[_0xf78a('0x24')](_0x5d1d69,_0x4747a9,!![]);}catch(_0x2a249a){return BPromise[_0xf78a('0x25')](_0x2a249a);}return _0x5d1d69[_0xf78a('0x26')]();};}function saveUpdates(_0x769722,_0x3fb377){return function(_0x229dad){if(_0x229dad){return _0x229dad[_0xf78a('0x27')](_0x769722)[_0xf78a('0x28')](function(_0x26e1dd){return _0x26e1dd;});}return null;};}function removeEntity(_0x2aed2c,_0x1de127){return function(_0x46c5e6){if(_0x46c5e6){return _0x46c5e6[_0xf78a('0x29')]()[_0xf78a('0x28')](function(){var _0x43e91b=_0x46c5e6[_0xf78a('0x2a')]({'plain':!![]});var _0x2c90f1=_0xf78a('0x2b');return db[_0xf78a('0x2c')][_0xf78a('0x29')]({'where':{'type':_0x2c90f1,'resourceId':_0x43e91b['id']}})[_0xf78a('0x28')](function(){return _0x46c5e6;});})[_0xf78a('0x28')](function(){_0x2aed2c[_0xf78a('0x1b')](0xcc)[_0xf78a('0x1c')]();});}};}function handleEntityNotFound(_0x2512ee,_0x108f52){return function(_0x4c05e7){if(!_0x4c05e7){_0x2512ee[_0xf78a('0x1a')](0x194);}return _0x4c05e7;};}function handleError(_0x271163,_0x213543){_0x213543=_0x213543||0x1f4;return function(_0xe9d510){logger[_0xf78a('0x2d')](_0xe9d510['stack']);if(_0xe9d510['name']){delete _0xe9d510['name'];}_0x271163[_0xf78a('0x1b')](_0x213543)[_0xf78a('0x2e')](_0xe9d510);};}exports[_0xf78a('0x2f')]=function(_0x231149,_0x15f220){var _0x513da3={},_0x2f1576={},_0x429126={'count':0x0,'rows':[]};var _0x4bc2cc=_[_0xf78a('0x30')](db[_0xf78a('0x31')][_0xf78a('0x32')],function(_0x18ee48){return{'name':_0x18ee48[_0xf78a('0x33')],'type':_0x18ee48['type'][_0xf78a('0x34')]};});_0x2f1576[_0xf78a('0x35')]=_[_0xf78a('0x30')](_0x4bc2cc,_0xf78a('0x36'));_0x2f1576['query']=_['keys'](_0x231149[_0xf78a('0x37')]);_0x2f1576[_0xf78a('0x38')]=_[_0xf78a('0x39')](_0x2f1576['model'],_0x2f1576[_0xf78a('0x37')]);_0x513da3[_0xf78a('0x3a')]=_[_0xf78a('0x39')](_0x2f1576[_0xf78a('0x35')],qs['fields'](_0x231149['query'][_0xf78a('0x3b')]));_0x513da3[_0xf78a('0x3a')]=_0x513da3[_0xf78a('0x3a')][_0xf78a('0x3c')]?_0x513da3[_0xf78a('0x3a')]:_0x2f1576[_0xf78a('0x35')];if(!_0x231149['query'][_0xf78a('0x3d')](_0xf78a('0x3e'))){_0x513da3[_0xf78a('0x20')]=qs['limit'](_0x231149['query'][_0xf78a('0x20')]);_0x513da3['offset']=qs[_0xf78a('0x1e')](_0x231149['query'][_0xf78a('0x1e')]);}_0x513da3[_0xf78a('0x3f')]=qs[_0xf78a('0x40')](_0x231149['query']['sort']);_0x513da3[_0xf78a('0x41')]=qs[_0xf78a('0x38')](_[_0xf78a('0x42')](_0x231149['query'],_0x2f1576[_0xf78a('0x38')]),_0x4bc2cc);if(_0x231149[_0xf78a('0x37')][_0xf78a('0x43')]){_0x513da3[_0xf78a('0x41')]=_['merge'](_0x513da3[_0xf78a('0x41')],{'$or':_[_0xf78a('0x30')](_0x4bc2cc,function(_0xb8f4a8){if(_0xb8f4a8[_0xf78a('0x44')]!==_0xf78a('0x45')){var _0x3f0a87={};_0x3f0a87[_0xb8f4a8[_0xf78a('0x36')]]={'$like':'%'+_0x231149['query'][_0xf78a('0x43')]+'%'};return _0x3f0a87;}})});}_0x513da3=_[_0xf78a('0x46')]({},_0x513da3,_0x231149[_0xf78a('0x47')]);var _0x5cb4e5={'where':_0x513da3['where']};return db['Interval'][_0xf78a('0x21')](_0x5cb4e5)[_0xf78a('0x28')](function(_0x2240cb){_0x429126[_0xf78a('0x21')]=_0x2240cb;if(_0x231149['query'][_0xf78a('0x48')]){_0x513da3[_0xf78a('0x49')]=[{'all':!![]}];}return db['Interval'][_0xf78a('0x4a')](_0x513da3);})['then'](function(_0x1c6a46){_0x429126['rows']=_0x1c6a46;return _0x429126;})[_0xf78a('0x28')](respondWithFilteredResult(_0x15f220,_0x513da3))['catch'](handleError(_0x15f220,null));};exports['show']=function(_0x6ebb41,_0x1b4c04){var _0x19a1e8={'raw':!![],'where':{'id':_0x6ebb41['params']['id']}},_0x4de6d5={};_0x4de6d5[_0xf78a('0x35')]=_['keys'](db['Interval'][_0xf78a('0x32')]);_0x4de6d5['query']=_['keys'](_0x6ebb41['query']);_0x4de6d5['filters']=_[_0xf78a('0x39')](_0x4de6d5[_0xf78a('0x35')],_0x4de6d5[_0xf78a('0x37')]);_0x19a1e8['attributes']=_[_0xf78a('0x39')](_0x4de6d5[_0xf78a('0x35')],qs[_0xf78a('0x3b')](_0x6ebb41[_0xf78a('0x37')]['fields']));_0x19a1e8[_0xf78a('0x3a')]=_0x19a1e8[_0xf78a('0x3a')][_0xf78a('0x3c')]?_0x19a1e8[_0xf78a('0x3a')]:_0x4de6d5[_0xf78a('0x35')];if(_0x6ebb41[_0xf78a('0x37')][_0xf78a('0x48')]){_0x19a1e8[_0xf78a('0x49')]=[{'all':!![]}];}_0x19a1e8=_[_0xf78a('0x46')]({},_0x19a1e8,_0x6ebb41[_0xf78a('0x47')]);return db[_0xf78a('0x31')][_0xf78a('0x4b')](_0x19a1e8)[_0xf78a('0x28')](handleEntityNotFound(_0x1b4c04,null))[_0xf78a('0x28')](respondWithResult(_0x1b4c04,null))[_0xf78a('0x4c')](handleError(_0x1b4c04,null));};exports[_0xf78a('0x4d')]=function(_0x379470,_0x2a6498){return db[_0xf78a('0x31')]['create'](_0x379470[_0xf78a('0x4e')],{})['then'](function(_0x5e8c4b){var _0x5205b1=_0x379470[_0xf78a('0x4f')]['get']({'plain':!![]});if(!_0x5205b1)throw new Error(_0xf78a('0x50'));if(_0x5205b1[_0xf78a('0x51')]===_0xf78a('0x4f')){var _0x41535e=_0x5e8c4b['get']({'plain':!![]});var _0xc0093a=_0xf78a('0x2b');return db[_0xf78a('0x52')][_0xf78a('0x4b')]({'where':{'name':_0xc0093a,'userProfileId':_0x5205b1['userProfileId']},'raw':!![]})[_0xf78a('0x28')](function(_0x22d939){if(_0x22d939&&_0x22d939['autoAssociation']===0x0){return db[_0xf78a('0x2c')][_0xf78a('0x4d')]({'name':_0x41535e[_0xf78a('0x36')],'resourceId':_0x41535e['id'],'type':_0x22d939['name'],'sectionId':_0x22d939['id']},{})['then'](function(){return _0x5e8c4b;});}else{return _0x5e8c4b;}})[_0xf78a('0x4c')](function(_0x37e2c3){logger[_0xf78a('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37e2c3);throw _0x37e2c3;});}return _0x5e8c4b;})[_0xf78a('0x28')](respondWithResult(_0x2a6498,0xc9))[_0xf78a('0x4c')](handleError(_0x2a6498,null));};exports['update']=function(_0xd4e11d,_0x49a7dc){if(_0xd4e11d[_0xf78a('0x4e')]['id']){delete _0xd4e11d[_0xf78a('0x4e')]['id'];}return db[_0xf78a('0x31')][_0xf78a('0x4b')]({'where':{'id':_0xd4e11d[_0xf78a('0x53')]['id']}})['then'](handleEntityNotFound(_0x49a7dc,null))[_0xf78a('0x28')](saveUpdates(_0xd4e11d[_0xf78a('0x4e')],null))[_0xf78a('0x28')](respondWithResult(_0x49a7dc,null))[_0xf78a('0x4c')](handleError(_0x49a7dc,null));};exports[_0xf78a('0x29')]=function(_0x5a37d,_0xc8a8f3){return db['Interval']['find']({'where':{'id':_0x5a37d[_0xf78a('0x53')]['id']}})['then'](handleEntityNotFound(_0xc8a8f3,null))[_0xf78a('0x28')](removeEntity(_0xc8a8f3,null))[_0xf78a('0x4c')](handleError(_0xc8a8f3,null));};exports[_0xf78a('0x54')]=function(_0x4302d6,_0x5a30ba,_0x5a294e){if(_0x4302d6[_0xf78a('0x4e')]['id']){delete _0x4302d6['body']['id'];}return db[_0xf78a('0x31')][_0xf78a('0x4b')]({'where':{'id':_0x4302d6[_0xf78a('0x53')]['id']}})[_0xf78a('0x28')](handleEntityNotFound(_0x5a30ba,null))[_0xf78a('0x28')](function(_0x33ff0b){if(_0x33ff0b){_0x4302d6['body'][_0xf78a('0x55')]=_0x33ff0b['id'];return db['Interval'][_0xf78a('0x4d')](_0x4302d6[_0xf78a('0x4e')]);}})[_0xf78a('0x28')](respondWithResult(_0x5a30ba,null))['catch'](handleError(_0x5a30ba,null));};exports['getIntervals']=function(_0x23f374,_0x49e84c,_0x5482b0){var _0x195164={};var _0x471014={};var _0x4e044e;var _0x6493d4;return db[_0xf78a('0x31')]['findOne']({'where':{'id':_0x23f374[_0xf78a('0x53')]['id']}})[_0xf78a('0x28')](handleEntityNotFound(_0x49e84c,null))[_0xf78a('0x28')](function(_0x473d37){if(_0x473d37){_0x4e044e=_0x473d37;_0x471014[_0xf78a('0x35')]=_[_0xf78a('0x56')](db[_0xf78a('0x31')][_0xf78a('0x32')]);_0x471014[_0xf78a('0x37')]=_[_0xf78a('0x56')](_0x23f374[_0xf78a('0x37')]);_0x471014[_0xf78a('0x38')]=_[_0xf78a('0x39')](_0x471014[_0xf78a('0x35')],_0x471014['query']);_0x195164[_0xf78a('0x3a')]=_[_0xf78a('0x39')](_0x471014['model'],qs[_0xf78a('0x3b')](_0x23f374[_0xf78a('0x37')]['fields']));_0x195164[_0xf78a('0x3a')]=_0x195164['attributes'][_0xf78a('0x3c')]?_0x195164[_0xf78a('0x3a')]:_0x471014['model'];_0x195164[_0xf78a('0x3f')]=qs[_0xf78a('0x40')](_0x23f374[_0xf78a('0x37')][_0xf78a('0x40')]);_0x195164['where']=qs['filters'](_[_0xf78a('0x42')](_0x23f374[_0xf78a('0x37')],_0x471014[_0xf78a('0x38')]));if(_0x23f374[_0xf78a('0x37')]['filter']){_0x195164['where']=_[_0xf78a('0x46')](_0x195164['where'],{'$or':_['map'](_0x195164[_0xf78a('0x3a')],function(_0xcdf6d){var _0x3274f2={};_0x3274f2[_0xcdf6d]={'$like':'%'+_0x23f374[_0xf78a('0x37')]['filter']+'%'};return _0x3274f2;})});}_0x195164=_[_0xf78a('0x46')]({},_0x195164,_0x23f374[_0xf78a('0x47')]);return _0x4e044e[_0xf78a('0x57')](_0x195164);}})['then'](function(_0x5d018d){if(_0x5d018d){_0x6493d4=_0x5d018d[_0xf78a('0x3c')];if(!_0x23f374[_0xf78a('0x37')][_0xf78a('0x3d')](_0xf78a('0x3e'))){_0x195164[_0xf78a('0x20')]=qs['limit'](_0x23f374[_0xf78a('0x37')][_0xf78a('0x20')]);_0x195164['offset']=qs[_0xf78a('0x1e')](_0x23f374['query']['offset']);}return _0x4e044e[_0xf78a('0x57')](_0x195164);}})[_0xf78a('0x28')](function(_0x5e96ee){if(_0x5e96ee){return _0x5e96ee?{'count':_0x6493d4,'rows':_0x5e96ee}:null;}})['then'](respondWithResult(_0x49e84c,null))[_0xf78a('0x4c')](handleError(_0x49e84c,null));};exports[_0xf78a('0x58')]=function(_0x5d342b,_0x248fd4,_0x2b8645){return db[_0xf78a('0x31')][_0xf78a('0x59')]({'where':{'id':_0x5d342b[_0xf78a('0x53')]['id']}})['then'](handleEntityNotFound(_0x248fd4,null))[_0xf78a('0x28')](function(_0x3ddc2f){if(_0x3ddc2f){return db['sequelize'][_0xf78a('0x5a')](function(_0x593fe3){return db['Interval']['destroy']({'where':{'IntervalId':_0x5d342b[_0xf78a('0x53')]['id']},'transaction':_0x593fe3})['then'](function(_0x2f6744){var _0x392984=_[_0xf78a('0x30')](_0x5d342b[_0xf78a('0x4e')],function(_0x17e707){delete _0x17e707['id'];_0x17e707['IntervalId']=_0x5d342b['params']['id'];return _0x17e707;});return db['Interval'][_0xf78a('0x5b')](_0x392984,{'transaction':_0x593fe3});});})[_0xf78a('0x28')](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x5d342b['params']['id']}});});}})[_0xf78a('0x28')](respondWithResult(_0x248fd4,null))[_0xf78a('0x4c')](handleError(_0x248fd4,null));}; \ No newline at end of file +var _0xa3af=['eml-format','fast-json-patch','moment','bluebird','mustache','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','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','then','get','Intervals','error','name','send','index','map','Interval','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','IntervalId','getIntervals','addIntervals','sequelize','transaction','bulkCreate'];(function(_0x18dd15,_0x252692){var _0x46719e=function(_0x29eba7){while(--_0x29eba7){_0x18dd15['push'](_0x18dd15['shift']());}};_0x46719e(++_0x252692);}(_0xa3af,0x11a));var _0xfa3a=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa3af[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0xfa3a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfa3a('0x1'));var rp=require('request-promise');var moment=require(_0xfa3a('0x2'));var BPromise=require(_0xfa3a('0x3'));var Mustache=require(_0xfa3a('0x4'));var util=require('util');var path=require(_0xfa3a('0x5'));var sox=require('sox');var csv=require(_0xfa3a('0x6'));var ejs=require(_0xfa3a('0x7'));var fs=require('fs');var fs_extra=require(_0xfa3a('0x8'));var _=require(_0xfa3a('0x9'));var squel=require(_0xfa3a('0xa'));var crypto=require(_0xfa3a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfa3a('0xc'));var toCsv=require(_0xfa3a('0x6'));var querystring=require('querystring');var Papa=require(_0xfa3a('0xd'));var Redis=require(_0xfa3a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfa3a('0xf'));var as=require(_0xfa3a('0x10'));var hardwareService=require(_0xfa3a('0x11'));var logger=require(_0xfa3a('0x12'))(_0xfa3a('0x13'));var utils=require(_0xfa3a('0x14'));var config=require(_0xfa3a('0x15'));var licenseUtil=require(_0xfa3a('0x16'));var db=require(_0xfa3a('0x17'))['db'];var extensions=require(_0xfa3a('0x18'));function respondWithStatusCode(_0x3408f5,_0x555d72){_0x555d72=_0x555d72||0xcc;return function(_0x4280ef){if(_0x4280ef){return _0x3408f5[_0xfa3a('0x19')](_0x555d72);}return _0x3408f5[_0xfa3a('0x1a')](_0x555d72)[_0xfa3a('0x1b')]();};}function respondWithResult(_0xa7e52a,_0x2cc2df){_0x2cc2df=_0x2cc2df||0xc8;return function(_0x2500bb){if(_0x2500bb){return _0xa7e52a[_0xfa3a('0x1a')](_0x2cc2df)[_0xfa3a('0x1c')](_0x2500bb);}};}function respondWithFilteredResult(_0x4e3f8e,_0x2204da){return function(_0x523328){if(_0x523328){var _0x2b6bc9=typeof _0x2204da[_0xfa3a('0x1d')]===_0xfa3a('0x1e')&&typeof _0x2204da[_0xfa3a('0x1f')]===_0xfa3a('0x1e');var _0x5f300=_0x523328['count'];var _0x44dac2=_0x2b6bc9?0x0:_0x2204da[_0xfa3a('0x1d')];var _0x3e71d7=_0x2b6bc9?_0x523328['count']:_0x2204da[_0xfa3a('0x1d')]+_0x2204da['limit'];var _0x1415e7;if(_0x3e71d7>=_0x5f300){_0x3e71d7=_0x5f300;_0x1415e7=0xc8;}else{_0x1415e7=0xce;}_0x4e3f8e['status'](_0x1415e7);return _0x4e3f8e[_0xfa3a('0x20')](_0xfa3a('0x21'),_0x44dac2+'-'+_0x3e71d7+'/'+_0x5f300)[_0xfa3a('0x1c')](_0x523328);}return null;};}function patchUpdates(_0x166365){return function(_0x4b4f34){try{jsonpatch[_0xfa3a('0x22')](_0x4b4f34,_0x166365,!![]);}catch(_0x49e9f8){return BPromise[_0xfa3a('0x23')](_0x49e9f8);}return _0x4b4f34[_0xfa3a('0x24')]();};}function saveUpdates(_0x5bfe1f,_0x540c6b){return function(_0x2ef083){if(_0x2ef083){return _0x2ef083['update'](_0x5bfe1f)['then'](function(_0x323109){return _0x323109;});}return null;};}function removeEntity(_0x2b88f7,_0x520875){return function(_0x2250ad){if(_0x2250ad){return _0x2250ad[_0xfa3a('0x25')]()[_0xfa3a('0x26')](function(){var _0x5d4fa5=_0x2250ad[_0xfa3a('0x27')]({'plain':!![]});var _0x33052d=_0xfa3a('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x33052d,'resourceId':_0x5d4fa5['id']}})[_0xfa3a('0x26')](function(){return _0x2250ad;});})[_0xfa3a('0x26')](function(){_0x2b88f7[_0xfa3a('0x1a')](0xcc)[_0xfa3a('0x1b')]();});}};}function handleEntityNotFound(_0x1f5257,_0x5909b4){return function(_0x8d047){if(!_0x8d047){_0x1f5257[_0xfa3a('0x19')](0x194);}return _0x8d047;};}function handleError(_0x5470a2,_0x435376){_0x435376=_0x435376||0x1f4;return function(_0x4bc3a3){logger[_0xfa3a('0x29')](_0x4bc3a3['stack']);if(_0x4bc3a3[_0xfa3a('0x2a')]){delete _0x4bc3a3[_0xfa3a('0x2a')];}_0x5470a2[_0xfa3a('0x1a')](_0x435376)[_0xfa3a('0x2b')](_0x4bc3a3);};}exports[_0xfa3a('0x2c')]=function(_0x587738,_0x317ef8){var _0x4a2524={},_0x1b8453={},_0x4014fa={'count':0x0,'rows':[]};var _0x136034=_[_0xfa3a('0x2d')](db[_0xfa3a('0x2e')]['rawAttributes'],function(_0x282f94){return{'name':_0x282f94[_0xfa3a('0x2f')],'type':_0x282f94[_0xfa3a('0x30')][_0xfa3a('0x31')]};});_0x1b8453[_0xfa3a('0x32')]=_[_0xfa3a('0x2d')](_0x136034,_0xfa3a('0x2a'));_0x1b8453[_0xfa3a('0x33')]=_[_0xfa3a('0x34')](_0x587738['query']);_0x1b8453[_0xfa3a('0x35')]=_['intersection'](_0x1b8453[_0xfa3a('0x32')],_0x1b8453[_0xfa3a('0x33')]);_0x4a2524['attributes']=_[_0xfa3a('0x36')](_0x1b8453[_0xfa3a('0x32')],qs[_0xfa3a('0x37')](_0x587738[_0xfa3a('0x33')][_0xfa3a('0x37')]));_0x4a2524['attributes']=_0x4a2524[_0xfa3a('0x38')][_0xfa3a('0x39')]?_0x4a2524['attributes']:_0x1b8453[_0xfa3a('0x32')];if(!_0x587738[_0xfa3a('0x33')][_0xfa3a('0x3a')](_0xfa3a('0x3b'))){_0x4a2524[_0xfa3a('0x1f')]=qs[_0xfa3a('0x1f')](_0x587738[_0xfa3a('0x33')][_0xfa3a('0x1f')]);_0x4a2524[_0xfa3a('0x1d')]=qs[_0xfa3a('0x1d')](_0x587738['query'][_0xfa3a('0x1d')]);}_0x4a2524[_0xfa3a('0x3c')]=qs[_0xfa3a('0x3d')](_0x587738[_0xfa3a('0x33')][_0xfa3a('0x3d')]);_0x4a2524[_0xfa3a('0x3e')]=qs[_0xfa3a('0x35')](_[_0xfa3a('0x3f')](_0x587738[_0xfa3a('0x33')],_0x1b8453['filters']),_0x136034);if(_0x587738[_0xfa3a('0x33')]['filter']){_0x4a2524[_0xfa3a('0x3e')]=_[_0xfa3a('0x40')](_0x4a2524[_0xfa3a('0x3e')],{'$or':_[_0xfa3a('0x2d')](_0x136034,function(_0x96eac4){if(_0x96eac4[_0xfa3a('0x30')]!==_0xfa3a('0x41')){var _0x43af45={};_0x43af45[_0x96eac4[_0xfa3a('0x2a')]]={'$like':'%'+_0x587738[_0xfa3a('0x33')][_0xfa3a('0x42')]+'%'};return _0x43af45;}})});}_0x4a2524=_[_0xfa3a('0x40')]({},_0x4a2524,_0x587738[_0xfa3a('0x43')]);var _0x282a1a={'where':_0x4a2524['where']};return db[_0xfa3a('0x2e')]['count'](_0x282a1a)['then'](function(_0xa1ffb2){_0x4014fa[_0xfa3a('0x44')]=_0xa1ffb2;if(_0x587738[_0xfa3a('0x33')][_0xfa3a('0x45')]){_0x4a2524[_0xfa3a('0x46')]=[{'all':!![]}];}return db['Interval'][_0xfa3a('0x47')](_0x4a2524);})[_0xfa3a('0x26')](function(_0x567974){_0x4014fa['rows']=_0x567974;return _0x4014fa;})[_0xfa3a('0x26')](respondWithFilteredResult(_0x317ef8,_0x4a2524))[_0xfa3a('0x48')](handleError(_0x317ef8,null));};exports['show']=function(_0x3c18af,_0x1ffc37){var _0x2c6837={'raw':!![],'where':{'id':_0x3c18af[_0xfa3a('0x49')]['id']}},_0xadd14a={};_0xadd14a[_0xfa3a('0x32')]=_['keys'](db[_0xfa3a('0x2e')][_0xfa3a('0x4a')]);_0xadd14a[_0xfa3a('0x33')]=_[_0xfa3a('0x34')](_0x3c18af[_0xfa3a('0x33')]);_0xadd14a['filters']=_[_0xfa3a('0x36')](_0xadd14a[_0xfa3a('0x32')],_0xadd14a[_0xfa3a('0x33')]);_0x2c6837[_0xfa3a('0x38')]=_[_0xfa3a('0x36')](_0xadd14a[_0xfa3a('0x32')],qs['fields'](_0x3c18af[_0xfa3a('0x33')][_0xfa3a('0x37')]));_0x2c6837[_0xfa3a('0x38')]=_0x2c6837[_0xfa3a('0x38')]['length']?_0x2c6837[_0xfa3a('0x38')]:_0xadd14a[_0xfa3a('0x32')];if(_0x3c18af[_0xfa3a('0x33')][_0xfa3a('0x45')]){_0x2c6837[_0xfa3a('0x46')]=[{'all':!![]}];}_0x2c6837=_[_0xfa3a('0x40')]({},_0x2c6837,_0x3c18af[_0xfa3a('0x43')]);return db['Interval'][_0xfa3a('0x4b')](_0x2c6837)[_0xfa3a('0x26')](handleEntityNotFound(_0x1ffc37,null))[_0xfa3a('0x26')](respondWithResult(_0x1ffc37,null))[_0xfa3a('0x48')](handleError(_0x1ffc37,null));};exports[_0xfa3a('0x4c')]=function(_0x49d348,_0x5bb364){return db[_0xfa3a('0x2e')][_0xfa3a('0x4c')](_0x49d348[_0xfa3a('0x4d')],{})[_0xfa3a('0x26')](function(_0x3e1be8){var _0x463653=_0x49d348[_0xfa3a('0x4e')]['get']({'plain':!![]});if(!_0x463653)throw new Error(_0xfa3a('0x4f'));if(_0x463653[_0xfa3a('0x50')]===_0xfa3a('0x4e')){var _0x9a95e7=_0x3e1be8[_0xfa3a('0x27')]({'plain':!![]});var _0x1cd121=_0xfa3a('0x28');return db[_0xfa3a('0x51')][_0xfa3a('0x4b')]({'where':{'name':_0x1cd121,'userProfileId':_0x463653[_0xfa3a('0x52')]},'raw':!![]})[_0xfa3a('0x26')](function(_0x9a053b){if(_0x9a053b&&_0x9a053b[_0xfa3a('0x53')]===0x0){return db[_0xfa3a('0x54')]['create']({'name':_0x9a95e7[_0xfa3a('0x2a')],'resourceId':_0x9a95e7['id'],'type':_0x9a053b['name'],'sectionId':_0x9a053b['id']},{})[_0xfa3a('0x26')](function(){return _0x3e1be8;});}else{return _0x3e1be8;}})[_0xfa3a('0x48')](function(_0x25611e){logger[_0xfa3a('0x29')](_0xfa3a('0x55'),_0x25611e);throw _0x25611e;});}return _0x3e1be8;})[_0xfa3a('0x26')](respondWithResult(_0x5bb364,0xc9))['catch'](handleError(_0x5bb364,null));};exports[_0xfa3a('0x56')]=function(_0x575967,_0x5e6ff8){if(_0x575967[_0xfa3a('0x4d')]['id']){delete _0x575967[_0xfa3a('0x4d')]['id'];}return db[_0xfa3a('0x2e')]['find']({'where':{'id':_0x575967['params']['id']}})[_0xfa3a('0x26')](handleEntityNotFound(_0x5e6ff8,null))['then'](saveUpdates(_0x575967[_0xfa3a('0x4d')],null))[_0xfa3a('0x26')](respondWithResult(_0x5e6ff8,null))['catch'](handleError(_0x5e6ff8,null));};exports[_0xfa3a('0x25')]=function(_0x42f933,_0x552d72){return db[_0xfa3a('0x2e')][_0xfa3a('0x4b')]({'where':{'id':_0x42f933[_0xfa3a('0x49')]['id']}})[_0xfa3a('0x26')](handleEntityNotFound(_0x552d72,null))[_0xfa3a('0x26')](removeEntity(_0x552d72,null))[_0xfa3a('0x48')](handleError(_0x552d72,null));};exports[_0xfa3a('0x57')]=function(_0x328cc2,_0x496dd8,_0x4368d8){if(_0x328cc2[_0xfa3a('0x4d')]['id']){delete _0x328cc2[_0xfa3a('0x4d')]['id'];}return db[_0xfa3a('0x2e')][_0xfa3a('0x4b')]({'where':{'id':_0x328cc2[_0xfa3a('0x49')]['id']}})[_0xfa3a('0x26')](handleEntityNotFound(_0x496dd8,null))['then'](function(_0x18e410){if(_0x18e410){_0x328cc2[_0xfa3a('0x4d')][_0xfa3a('0x58')]=_0x18e410['id'];return db['Interval'][_0xfa3a('0x4c')](_0x328cc2[_0xfa3a('0x4d')]);}})[_0xfa3a('0x26')](respondWithResult(_0x496dd8,null))[_0xfa3a('0x48')](handleError(_0x496dd8,null));};exports[_0xfa3a('0x59')]=function(_0x43172a,_0x441358,_0x220199){var _0xedafef={};var _0x1fd182={};var _0x420224;var _0x106e1b;return db[_0xfa3a('0x2e')]['findOne']({'where':{'id':_0x43172a[_0xfa3a('0x49')]['id']}})[_0xfa3a('0x26')](handleEntityNotFound(_0x441358,null))['then'](function(_0x3a31a8){if(_0x3a31a8){_0x420224=_0x3a31a8;_0x1fd182[_0xfa3a('0x32')]=_[_0xfa3a('0x34')](db[_0xfa3a('0x2e')][_0xfa3a('0x4a')]);_0x1fd182['query']=_['keys'](_0x43172a[_0xfa3a('0x33')]);_0x1fd182['filters']=_[_0xfa3a('0x36')](_0x1fd182[_0xfa3a('0x32')],_0x1fd182['query']);_0xedafef[_0xfa3a('0x38')]=_[_0xfa3a('0x36')](_0x1fd182[_0xfa3a('0x32')],qs[_0xfa3a('0x37')](_0x43172a[_0xfa3a('0x33')][_0xfa3a('0x37')]));_0xedafef['attributes']=_0xedafef[_0xfa3a('0x38')][_0xfa3a('0x39')]?_0xedafef[_0xfa3a('0x38')]:_0x1fd182[_0xfa3a('0x32')];_0xedafef['order']=qs[_0xfa3a('0x3d')](_0x43172a[_0xfa3a('0x33')][_0xfa3a('0x3d')]);_0xedafef[_0xfa3a('0x3e')]=qs[_0xfa3a('0x35')](_[_0xfa3a('0x3f')](_0x43172a[_0xfa3a('0x33')],_0x1fd182['filters']));if(_0x43172a[_0xfa3a('0x33')]['filter']){_0xedafef[_0xfa3a('0x3e')]=_[_0xfa3a('0x40')](_0xedafef[_0xfa3a('0x3e')],{'$or':_[_0xfa3a('0x2d')](_0xedafef['attributes'],function(_0x5041a6){var _0x2d6922={};_0x2d6922[_0x5041a6]={'$like':'%'+_0x43172a[_0xfa3a('0x33')]['filter']+'%'};return _0x2d6922;})});}_0xedafef=_[_0xfa3a('0x40')]({},_0xedafef,_0x43172a[_0xfa3a('0x43')]);return _0x420224[_0xfa3a('0x59')](_0xedafef);}})[_0xfa3a('0x26')](function(_0x124085){if(_0x124085){_0x106e1b=_0x124085[_0xfa3a('0x39')];if(!_0x43172a['query'][_0xfa3a('0x3a')](_0xfa3a('0x3b'))){_0xedafef['limit']=qs['limit'](_0x43172a[_0xfa3a('0x33')]['limit']);_0xedafef[_0xfa3a('0x1d')]=qs[_0xfa3a('0x1d')](_0x43172a['query']['offset']);}return _0x420224[_0xfa3a('0x59')](_0xedafef);}})[_0xfa3a('0x26')](function(_0x55c328){if(_0x55c328){return _0x55c328?{'count':_0x106e1b,'rows':_0x55c328}:null;}})[_0xfa3a('0x26')](respondWithResult(_0x441358,null))['catch'](handleError(_0x441358,null));};exports[_0xfa3a('0x5a')]=function(_0x52ca81,_0x35d0aa,_0x5204c2){return db[_0xfa3a('0x2e')]['findOne']({'where':{'id':_0x52ca81['params']['id']}})[_0xfa3a('0x26')](handleEntityNotFound(_0x35d0aa,null))[_0xfa3a('0x26')](function(_0x24ac9e){if(_0x24ac9e){return db[_0xfa3a('0x5b')][_0xfa3a('0x5c')](function(_0x381cb0){return db[_0xfa3a('0x2e')]['destroy']({'where':{'IntervalId':_0x52ca81[_0xfa3a('0x49')]['id']},'transaction':_0x381cb0})[_0xfa3a('0x26')](function(_0x34a75d){var _0x20b7cb=_[_0xfa3a('0x2d')](_0x52ca81[_0xfa3a('0x4d')],function(_0x4e0171){delete _0x4e0171['id'];_0x4e0171[_0xfa3a('0x58')]=_0x52ca81[_0xfa3a('0x49')]['id'];return _0x4e0171;});return db['Interval'][_0xfa3a('0x5d')](_0x20b7cb,{'transaction':_0x381cb0});});})[_0xfa3a('0x26')](function(){return db['Interval'][_0xfa3a('0x47')]({'where':{'IntervalId':_0x52ca81['params']['id']}});});}})[_0xfa3a('0x26')](respondWithResult(_0x35d0aa,null))[_0xfa3a('0x48')](handleError(_0x35d0aa,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index d61c9d8..1dfc969 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 _0xcdba=['../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','tools_intervals','rewrite','interval','string','getIntervals','then','all','map','ifTime'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcdba,0x10a));var _0xacdb=function(_0x2f4c6c,_0x50fe00){_0x2f4c6c=_0x2f4c6c-0x0;var _0x5eeb22=_0xcdba[_0x2f4c6c];return _0x5eeb22;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0xacdb('0x0'));var iftime=require(_0xacdb('0x1'))[_0xacdb('0x2')];module[_0xacdb('0x3')]=function(_0x3529ad){return _0x3529ad[_0xacdb('0x4')]('Interval',attributes,{'tableName':_0xacdb('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4415fd){extensions[_0xacdb('0x6')](_0x3529ad,_0x4415fd);},'afterBulkCreate':function(_0xc17e12,_0x3fcccb,_0x316997){_0x316997();extensions[_0xacdb('0x6')](_0x3529ad,_0xc17e12[0x0]);},'afterUpdate':function(_0x278cc9){extensions[_0xacdb('0x6')](_0x3529ad,_0x278cc9);},'afterDestroy':function(_0x4acf8c){extensions[_0xacdb('0x6')](_0x3529ad,_0x4acf8c);}},'instanceMethods':{'ifTime':function(_0x1198ed=undefined,_0x5c7873=new Date()){if(typeof this[_0xacdb('0x7')]===_0xacdb('0x8')){return iftime(this[_0xacdb('0x7')],_0x1198ed,_0x5c7873);}else{return this[_0xacdb('0x9')]()[_0xacdb('0xa')](function(_0x5b9de5){return Promise[_0xacdb('0xb')](_0x5b9de5[_0xacdb('0xc')](function(_0x1d07ed){return _0x1d07ed[_0xacdb('0xd')](_0x1198ed,_0x5c7873);}));})[_0xacdb('0xa')](function(_0x5b1a76){return _0x5b1a76['reduce'](function(_0x21921e,_0x24e0f0){return _0x21921e||_0x24e0f0;},![]);});}}}});}; \ No newline at end of file +var _0xdfee=['exports','Interval','tools_intervals','rewrite','interval','all','map','ifTime','./interval.attributes','../../utils/iftime','iftime'];(function(_0x4a4f5b,_0x3dd9f8){var _0x1a3657=function(_0x37aa12){while(--_0x37aa12){_0x4a4f5b['push'](_0x4a4f5b['shift']());}};_0x1a3657(++_0x3dd9f8);}(_0xdfee,0x131));var _0xedfe=function(_0x2af6fd,_0x5032d3){_0x2af6fd=_0x2af6fd-0x0;var _0x53a335=_0xdfee[_0x2af6fd];return _0x53a335;};'use strict';var attributes=require(_0xedfe('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require(_0xedfe('0x1'))[_0xedfe('0x2')];module[_0xedfe('0x3')]=function(_0x1a64ce){return _0x1a64ce['define'](_0xedfe('0x4'),attributes,{'tableName':_0xedfe('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c0eb9){extensions[_0xedfe('0x6')](_0x1a64ce,_0x2c0eb9);},'afterBulkCreate':function(_0x555bd6,_0x4a1efd,_0xd170bf){_0xd170bf();extensions['rewrite'](_0x1a64ce,_0x555bd6[0x0]);},'afterUpdate':function(_0x4d9573){extensions[_0xedfe('0x6')](_0x1a64ce,_0x4d9573);},'afterDestroy':function(_0x1323ec){extensions[_0xedfe('0x6')](_0x1a64ce,_0x1323ec);}},'instanceMethods':{'ifTime':function(_0x296647=undefined,_0x77ab18=new Date()){if(typeof this[_0xedfe('0x7')]==='string'){return iftime(this[_0xedfe('0x7')],_0x296647,_0x77ab18);}else{return this['getIntervals']()['then'](function(_0x42a20a){return Promise[_0xedfe('0x8')](_0x42a20a[_0xedfe('0x9')](function(_0x564171){return _0x564171[_0xedfe('0xa')](_0x296647,_0x77ab18);}));})['then'](function(_0x10e3a0){return _0x10e3a0['reduce'](function(_0x333e4d,_0x55ca6e){return _0x333e4d||_0x55ca6e;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 6a53438..100a2f0 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 _0xf4cb=['../../utils/iftime','iftime','../../config/logger','GetInterval','findAll','options','raw','attributes','limit','include','map','model','then','debug','catch','error','message','ShowInterval','Interval','where','info','stringify','all','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','isArray','intervals','timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','silly','resolve','lodash','util','../../mysqldb'];(function(_0x4839d0,_0x1f5c36){var _0xefa7c4=function(_0x37c902){while(--_0x37c902){_0x4839d0['push'](_0x4839d0['shift']());}};_0xefa7c4(++_0x1f5c36);}(_0xf4cb,0xa1));var _0xbf4c=function(_0x5b924f,_0x5202f3){_0x5b924f=_0x5b924f-0x0;var _0x15d639=_0xf4cb[_0x5b924f];return _0x15d639;};'use strict';var _=require(_0xbf4c('0x0'));var util=require(_0xbf4c('0x1'));var db=require(_0xbf4c('0x2'))['db'];var iftime=require(_0xbf4c('0x3'))[_0xbf4c('0x4')];var logger=require(_0xbf4c('0x5'))('rpc');exports[_0xbf4c('0x6')]=function(_0x2d34a9){var _0x3cbdfe=this;return new Promise(function(_0x4fa298,_0x16f783){return db['Interval'][_0xbf4c('0x7')]({'raw':_0x2d34a9['options']?_0x2d34a9[_0xbf4c('0x8')][_0xbf4c('0x9')]===undefined?!![]:![]:!![],'where':_0x2d34a9['options']?_0x2d34a9[_0xbf4c('0x8')]['where']||null:null,'attributes':_0x2d34a9['options']?_0x2d34a9[_0xbf4c('0x8')][_0xbf4c('0xa')]||null:null,'limit':_0x2d34a9['options']?_0x2d34a9[_0xbf4c('0x8')][_0xbf4c('0xb')]||null:null,'include':_0x2d34a9[_0xbf4c('0x8')]?_0x2d34a9['options'][_0xbf4c('0xc')]?_[_0xbf4c('0xd')](_0x2d34a9[_0xbf4c('0x8')][_0xbf4c('0xc')],function(_0x2ff332){return{'model':db[_0x2ff332[_0xbf4c('0xe')]],'as':_0x2ff332['as'],'attributes':_0x2ff332[_0xbf4c('0xa')],'include':_0x2ff332['include']?_['map'](_0x2ff332[_0xbf4c('0xc')],function(_0x1473be){return{'model':db[_0x1473be[_0xbf4c('0xe')]],'as':_0x1473be['as'],'attributes':_0x1473be[_0xbf4c('0xa')],'include':_0x1473be['include']?_[_0xbf4c('0xd')](_0x1473be[_0xbf4c('0xc')],function(_0x4aff23){return{'model':db[_0x4aff23[_0xbf4c('0xe')]],'as':_0x4aff23['as'],'attributes':_0x4aff23[_0xbf4c('0xa')]};}):[]};}):[]};}):[]:[]})[_0xbf4c('0xf')](function(_0x59f46a){logger['info'](_0xbf4c('0x6'),_0x2d34a9);logger[_0xbf4c('0x10')](_0xbf4c('0x6'),_0x2d34a9,JSON['stringify'](_0x59f46a));_0x4fa298(_0x59f46a);})[_0xbf4c('0x11')](function(_0x403b72){logger[_0xbf4c('0x12')](_0xbf4c('0x6'),_0x403b72[_0xbf4c('0x13')],_0x2d34a9);_0x16f783(_0x3cbdfe[_0xbf4c('0x12')](0x1f4,_0x403b72[_0xbf4c('0x13')]));});});};exports[_0xbf4c('0x14')]=function(_0x2a75bc){var _0x25b231=this;return new Promise(function(_0x3f3a60,_0x4cabd5){return db[_0xbf4c('0x15')]['find']({'raw':_0x2a75bc[_0xbf4c('0x8')]?_0x2a75bc[_0xbf4c('0x8')][_0xbf4c('0x9')]===undefined?!![]:![]:!![],'where':_0x2a75bc[_0xbf4c('0x8')]?_0x2a75bc['options'][_0xbf4c('0x16')]||null:null,'attributes':_0x2a75bc[_0xbf4c('0x8')]?_0x2a75bc[_0xbf4c('0x8')][_0xbf4c('0xa')]||null:null,'include':_0x2a75bc['options']?_0x2a75bc[_0xbf4c('0x8')][_0xbf4c('0xc')]?_[_0xbf4c('0xd')](_0x2a75bc[_0xbf4c('0x8')]['include'],function(_0x1e17c4){return{'model':db[_0x1e17c4[_0xbf4c('0xe')]],'as':_0x1e17c4['as'],'attributes':_0x1e17c4['attributes'],'include':_0x1e17c4[_0xbf4c('0xc')]?_[_0xbf4c('0xd')](_0x1e17c4[_0xbf4c('0xc')],function(_0x535fab){return{'model':db[_0x535fab[_0xbf4c('0xe')]],'as':_0x535fab['as'],'attributes':_0x535fab[_0xbf4c('0xa')],'include':_0x535fab[_0xbf4c('0xc')]?_[_0xbf4c('0xd')](_0x535fab['include'],function(_0xd096c8){return{'model':db[_0xd096c8[_0xbf4c('0xe')]],'as':_0xd096c8['as'],'attributes':_0xd096c8[_0xbf4c('0xa')]};}):[]};}):[]};}):[]:[]})[_0xbf4c('0xf')](function(_0x3dc6ee){logger[_0xbf4c('0x17')]('ShowInterval',_0x2a75bc);logger[_0xbf4c('0x10')](_0xbf4c('0x14'),_0x2a75bc,JSON[_0xbf4c('0x18')](_0x3dc6ee));_0x3f3a60(_0x3dc6ee);})['catch'](function(_0x4941a4){logger[_0xbf4c('0x12')](_0xbf4c('0x14'),_0x4941a4[_0xbf4c('0x13')],_0x2a75bc);_0x4cabd5(_0x25b231[_0xbf4c('0x12')](0x1f4,_0x4941a4[_0xbf4c('0x13')]));});});};function checkArrayOfIntervals(_0x13784c,_0x3b47c9){var _0x4de03c=[];return db[_0xbf4c('0x15')][_0xbf4c('0x7')]({'where':{'id':_0x13784c}})['then'](function(_0x130dcb){_0x4de03c=_0x130dcb;return Promise[_0xbf4c('0x19')](_0x4de03c[_0xbf4c('0xd')](function(_0x31ac6a){return _0x31ac6a['ifTime'](_0x3b47c9);}));})[_0xbf4c('0xf')](function(_0x1e154d){var _0x2cbb52=_0x1e154d[_0xbf4c('0x1a')](function(_0x4edf80,_0x28d8f8){return _0x4edf80||_0x28d8f8;},![]);logger[_0xbf4c('0x17')](util[_0xbf4c('0x1b')](_0xbf4c('0x1c'),_0x4de03c[_0xbf4c('0xd')](function(_0x1b2870){return _0x1b2870[_0xbf4c('0x1d')];})[_0xbf4c('0x1e')](',\x20'),_0x4de03c[_0xbf4c('0xd')](function(_0x4c8b5f){return _0x4c8b5f['id'];})[_0xbf4c('0x1e')](',\x20')));return _0x2cbb52;});}function checkSingleInterval(_0xea8e2c,_0x28d6a3){return db['Interval'][_0xbf4c('0x1f')](_0xea8e2c)[_0xbf4c('0xf')](function(_0x1b0dec){if(_0x1b0dec){logger[_0xbf4c('0x17')](util[_0xbf4c('0x1b')](_0xbf4c('0x20'),_0x1b0dec[_0xbf4c('0x1d')],_0x1b0dec['id']));return _0x1b0dec['ifTime'](_0x28d6a3);}});}exports[_0xbf4c('0x21')]=function(_0x11310b){var _0x4b03ae=_0x11310b['intervalIds'];var _0x15c2e2=Array[_0xbf4c('0x22')](_0x11310b[_0xbf4c('0x23')])?_0x11310b[_0xbf4c('0x23')]:typeof _0x11310b[_0xbf4c('0x23')]==='string'?[_0x11310b[_0xbf4c('0x23')]]:[];var _0x3c1011=_0x11310b[_0xbf4c('0x24')]||undefined;var _0x1e60a2=![];if(_0x15c2e2['length']){logger[_0xbf4c('0x17')](util['format'](_0xbf4c('0x25'),_0x15c2e2[_0xbf4c('0x1e')](';\x20')));}if(_0x3c1011){logger[_0xbf4c('0x17')](util[_0xbf4c('0x1b')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x3c1011));}logger[_0xbf4c('0x10')](_0xbf4c('0x26'),_0x1e60a2);logger[_0xbf4c('0x27')](_0xbf4c('0x21'),_0x11310b);return Promise[_0xbf4c('0x28')]()[_0xbf4c('0xf')](function(){if(Array[_0xbf4c('0x22')](_0x4b03ae)){return checkArrayOfIntervals(_0x4b03ae,_0x3c1011);}else if(_0x4b03ae){return checkSingleInterval(_0x4b03ae,_0x3c1011);}})[_0xbf4c('0xf')](function(_0x23c819){var _0x3249a9=_0x15c2e2[_0xbf4c('0x1a')](function(_0x2be256,_0x4f27c3){return _0x2be256||iftime(_0x4f27c3,_0x3c1011);},![]);_0x1e60a2=_0x23c819||_0x3249a9;return _0x1e60a2;})[_0xbf4c('0x11')](function(_0x127716){logger[_0xbf4c('0x12')](_0xbf4c('0x21'),_0x11310b,_0x127716);throw this[_0xbf4c('0x12')](0x1f4,_0x127716['message']);});}; \ No newline at end of file +var _0xf0b7=['attributes','limit','include','map','model','then','stringify','catch','error','message','info','ShowInterval','ifTime','format','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','IntervalIftime','resolve','reduce','lodash','../../mysqldb','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','where'];(function(_0x2837cb,_0x4adb84){var _0x5368e0=function(_0x503554){while(--_0x503554){_0x2837cb['push'](_0x2837cb['shift']());}};_0x5368e0(++_0x4adb84);}(_0xf0b7,0x9d));var _0x7f0b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf0b7[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x7f0b('0x0'));var util=require('util');var db=require(_0x7f0b('0x1'))['db'];var iftime=require('../../utils/iftime')[_0x7f0b('0x2')];var logger=require(_0x7f0b('0x3'))(_0x7f0b('0x4'));exports[_0x7f0b('0x5')]=function(_0x10f80d){var _0x42d855=this;return new Promise(function(_0x3611b2,_0xc8fdfa){return db[_0x7f0b('0x6')][_0x7f0b('0x7')]({'raw':_0x10f80d['options']?_0x10f80d[_0x7f0b('0x8')][_0x7f0b('0x9')]===undefined?!![]:![]:!![],'where':_0x10f80d['options']?_0x10f80d['options'][_0x7f0b('0xa')]||null:null,'attributes':_0x10f80d[_0x7f0b('0x8')]?_0x10f80d[_0x7f0b('0x8')][_0x7f0b('0xb')]||null:null,'limit':_0x10f80d[_0x7f0b('0x8')]?_0x10f80d[_0x7f0b('0x8')][_0x7f0b('0xc')]||null:null,'include':_0x10f80d[_0x7f0b('0x8')]?_0x10f80d['options'][_0x7f0b('0xd')]?_[_0x7f0b('0xe')](_0x10f80d[_0x7f0b('0x8')][_0x7f0b('0xd')],function(_0x2a6792){return{'model':db[_0x2a6792[_0x7f0b('0xf')]],'as':_0x2a6792['as'],'attributes':_0x2a6792['attributes'],'include':_0x2a6792['include']?_[_0x7f0b('0xe')](_0x2a6792[_0x7f0b('0xd')],function(_0x5cee06){return{'model':db[_0x5cee06[_0x7f0b('0xf')]],'as':_0x5cee06['as'],'attributes':_0x5cee06['attributes'],'include':_0x5cee06['include']?_[_0x7f0b('0xe')](_0x5cee06[_0x7f0b('0xd')],function(_0xe5d84e){return{'model':db[_0xe5d84e[_0x7f0b('0xf')]],'as':_0xe5d84e['as'],'attributes':_0xe5d84e['attributes']};}):[]};}):[]};}):[]:[]})[_0x7f0b('0x10')](function(_0x491a87){logger['info'](_0x7f0b('0x5'),_0x10f80d);logger['debug']('GetInterval',_0x10f80d,JSON[_0x7f0b('0x11')](_0x491a87));_0x3611b2(_0x491a87);})[_0x7f0b('0x12')](function(_0xe0d328){logger[_0x7f0b('0x13')](_0x7f0b('0x5'),_0xe0d328[_0x7f0b('0x14')],_0x10f80d);_0xc8fdfa(_0x42d855[_0x7f0b('0x13')](0x1f4,_0xe0d328[_0x7f0b('0x14')]));});});};exports['ShowInterval']=function(_0x15ed1c){var _0x10c7cc=this;return new Promise(function(_0x8732c8,_0x4c8331){return db[_0x7f0b('0x6')]['find']({'raw':_0x15ed1c[_0x7f0b('0x8')]?_0x15ed1c[_0x7f0b('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x15ed1c['options']?_0x15ed1c[_0x7f0b('0x8')][_0x7f0b('0xa')]||null:null,'attributes':_0x15ed1c[_0x7f0b('0x8')]?_0x15ed1c[_0x7f0b('0x8')][_0x7f0b('0xb')]||null:null,'include':_0x15ed1c['options']?_0x15ed1c[_0x7f0b('0x8')]['include']?_[_0x7f0b('0xe')](_0x15ed1c['options'][_0x7f0b('0xd')],function(_0x15b3f7){return{'model':db[_0x15b3f7[_0x7f0b('0xf')]],'as':_0x15b3f7['as'],'attributes':_0x15b3f7[_0x7f0b('0xb')],'include':_0x15b3f7['include']?_[_0x7f0b('0xe')](_0x15b3f7['include'],function(_0x28b334){return{'model':db[_0x28b334[_0x7f0b('0xf')]],'as':_0x28b334['as'],'attributes':_0x28b334[_0x7f0b('0xb')],'include':_0x28b334[_0x7f0b('0xd')]?_[_0x7f0b('0xe')](_0x28b334[_0x7f0b('0xd')],function(_0x15f2aa){return{'model':db[_0x15f2aa['model']],'as':_0x15f2aa['as'],'attributes':_0x15f2aa[_0x7f0b('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5efc78){logger[_0x7f0b('0x15')](_0x7f0b('0x16'),_0x15ed1c);logger['debug']('ShowInterval',_0x15ed1c,JSON['stringify'](_0x5efc78));_0x8732c8(_0x5efc78);})[_0x7f0b('0x12')](function(_0x27f5a5){logger[_0x7f0b('0x13')](_0x7f0b('0x16'),_0x27f5a5[_0x7f0b('0x14')],_0x15ed1c);_0x4c8331(_0x10c7cc[_0x7f0b('0x13')](0x1f4,_0x27f5a5['message']));});});};function checkArrayOfIntervals(_0x5ddc18,_0x10fa14){var _0x25a2ab=[];return db[_0x7f0b('0x6')]['findAll']({'where':{'id':_0x5ddc18}})[_0x7f0b('0x10')](function(_0x5da704){_0x25a2ab=_0x5da704;return Promise['all'](_0x25a2ab[_0x7f0b('0xe')](function(_0x2a5888){return _0x2a5888[_0x7f0b('0x17')](_0x10fa14);}));})[_0x7f0b('0x10')](function(_0x372ca5){var _0x49141c=_0x372ca5['reduce'](function(_0x2dccb,_0xb0bdd4){return _0x2dccb||_0xb0bdd4;},![]);logger[_0x7f0b('0x15')](util[_0x7f0b('0x18')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x25a2ab[_0x7f0b('0xe')](function(_0x1249dd){return _0x1249dd[_0x7f0b('0x19')];})['join'](',\x20'),_0x25a2ab['map'](function(_0x4aa8c2){return _0x4aa8c2['id'];})[_0x7f0b('0x1a')](',\x20')));return _0x49141c;});}function checkSingleInterval(_0x566512,_0x28dd8c){return db['Interval'][_0x7f0b('0x1b')](_0x566512)['then'](function(_0x5ddca8){if(_0x5ddca8){logger[_0x7f0b('0x15')](util[_0x7f0b('0x18')](_0x7f0b('0x1c'),_0x5ddca8[_0x7f0b('0x19')],_0x5ddca8['id']));return _0x5ddca8[_0x7f0b('0x17')](_0x28dd8c);}});}exports['IntervalIftime']=function(_0x2cc65f){var _0x56f876=_0x2cc65f[_0x7f0b('0x1d')];var _0x7cd894=Array[_0x7f0b('0x1e')](_0x2cc65f[_0x7f0b('0x1f')])?_0x2cc65f[_0x7f0b('0x1f')]:typeof _0x2cc65f[_0x7f0b('0x1f')]===_0x7f0b('0x20')?[_0x2cc65f['intervals']]:[];var _0x1a285f=_0x2cc65f[_0x7f0b('0x21')]||undefined;var _0x3616fe=![];if(_0x7cd894[_0x7f0b('0x22')]){logger[_0x7f0b('0x15')](util[_0x7f0b('0x18')](_0x7f0b('0x23'),_0x7cd894[_0x7f0b('0x1a')](';\x20')));}if(_0x1a285f){logger[_0x7f0b('0x15')](util[_0x7f0b('0x18')](_0x7f0b('0x24'),_0x1a285f));}logger['debug'](_0x7f0b('0x25'),_0x3616fe);logger[_0x7f0b('0x26')](_0x7f0b('0x27'),_0x2cc65f);return Promise[_0x7f0b('0x28')]()['then'](function(){if(Array['isArray'](_0x56f876)){return checkArrayOfIntervals(_0x56f876,_0x1a285f);}else if(_0x56f876){return checkSingleInterval(_0x56f876,_0x1a285f);}})[_0x7f0b('0x10')](function(_0xa04bb0){var _0x11ec19=_0x7cd894[_0x7f0b('0x29')](function(_0x3c77ec,_0x113a6e){return _0x3c77ec||iftime(_0x113a6e,_0x1a285f);},![]);_0x3616fe=_0xa04bb0||_0x11ec19;return _0x3616fe;})['catch'](function(_0x4475f7){logger[_0x7f0b('0x13')](_0x7f0b('0x27'),_0x2cc65f,_0x4475f7);throw this[_0x7f0b('0x13')](0x1f4,_0x4475f7[_0x7f0b('0x14')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index ff9127c..3984c38 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(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x392dc2,_0x47c3f3){_0x392dc2=_0x392dc2-0x0;var _0x14150f=_0x0b0e[_0x392dc2];return _0x14150f;};'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 _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x4f0e62,_0x28e44f){var _0x117ab8=function(_0x1a74bb){while(--_0x1a74bb){_0x4f0e62['push'](_0x4f0e62['shift']());}};_0x117ab8(++_0x28e44f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index aa27b4d..5ae78ca 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 _0x9ceb=['remoteAddress','socket','connection','bluebird','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','issuetype','fields','customfield_11500','customfield_11501','oldToken','customfield_11502','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','stringify','request','utf8','data','end','status','statusCode','parse','json','api.jira','write','openIssue','send','body','x-forwarded-for'];(function(_0x550a9f,_0x4784c6){var _0x2a8aa4=function(_0x31bb3b){while(--_0x31bb3b){_0x550a9f['push'](_0x550a9f['shift']());}};_0x2a8aa4(++_0x4784c6);}(_0x9ceb,0xda));var _0xb9ce=function(_0x4ef417,_0x467f3c){_0x4ef417=_0x4ef417-0x0;var _0x2ec0b7=_0x9ceb[_0x4ef417];return _0x2ec0b7;};'use strict';var BPromise=require(_0xb9ce('0x0'));var https=require('https');var logger=require('../../config/logger')(_0xb9ce('0x1'));var USERNAME=_0xb9ce('0x2');var PASSWORD=_0xb9ce('0x3');function openIssue(_0x4027b9,_0x4c4b23){var _0x3b0702={'fields':{'project':{'key':_0x4027b9[_0xb9ce('0x4')]||_0xb9ce('0x5')},'summary':(_0x4027b9[_0xb9ce('0x6')]||_0xb9ce('0x7'))+_0xb9ce('0x8')+_0x4027b9['ip'],'description':_0x4027b9[_0xb9ce('0x9')]||JSON['stringify'](_0x4027b9),'issuetype':{'name':_0x4027b9[_0xb9ce('0xa')]||'Bug'}}};_0x3b0702[_0xb9ce('0xb')][_0xb9ce('0xc')]=_0x4027b9['email'];_0x3b0702['fields'][_0xb9ce('0xd')]=_0x4027b9[_0xb9ce('0xe')];_0x3b0702['fields'][_0xb9ce('0xf')]=_0x4027b9['newToken'];_0x3b0702[_0xb9ce('0xb')]['customfield_11503']=_0x4027b9[_0xb9ce('0x10')];_0x3b0702[_0xb9ce('0xb')][_0xb9ce('0x11')]=_0x4027b9[_0xb9ce('0x12')];_0x3b0702[_0xb9ce('0xb')][_0xb9ce('0x13')]=_0x4027b9['ip'];var _0x200f7b={'host':_0xb9ce('0x14'),'port':0x1bb,'path':_0xb9ce('0x15'),'method':_0xb9ce('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0xb9ce('0x17'),'Authorization':_0xb9ce('0x18')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x3edf92=JSON[_0xb9ce('0x19')](_0x3b0702);var _0x5ee656=https[_0xb9ce('0x1a')](_0x200f7b,function(_0x32fe94){_0x32fe94['setEncoding'](_0xb9ce('0x1b'));var _0x2fd2f4='';_0x32fe94['on'](_0xb9ce('0x1c'),function(_0x3ba286){_0x2fd2f4+=_0x3ba286;});_0x32fe94['on'](_0xb9ce('0x1d'),function(){if(_0x4c4b23){return _0x4c4b23[_0xb9ce('0x1e')](_0x32fe94[_0xb9ce('0x1f')])['json'](JSON[_0xb9ce('0x20')](_0x2fd2f4));}});});_0x5ee656['on']('error',function(_0x350d89){if(_0x4c4b23){return _0x4c4b23[_0xb9ce('0x1e')](0x1f4)[_0xb9ce('0x21')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xb9ce('0x22')}]});}});_0x5ee656[_0xb9ce('0x23')](_0x3edf92);_0x5ee656[_0xb9ce('0x1d')]();}exports[_0xb9ce('0x24')]=openIssue;exports[_0xb9ce('0x25')]=function(_0x468ee0,_0x163dfa){_0x468ee0[_0xb9ce('0x26')]['ip']=_0x468ee0['headers'][_0xb9ce('0x27')]||_0x468ee0['connection'][_0xb9ce('0x28')]||_0x468ee0[_0xb9ce('0x29')][_0xb9ce('0x28')]||_0x468ee0[_0xb9ce('0x2a')][_0xb9ce('0x29')][_0xb9ce('0x28')];return openIssue(_0x468ee0['body'],_0x163dfa);}; \ No newline at end of file +var _0x7896=['error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','openIssue','body','headers','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','issuetype','Bug','fields','customfield_11500','email','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','base64','stringify','request','setEncoding','utf8','status','json'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7896,0x1a0));var _0x6789=function(_0x97385e,_0x17e853){_0x97385e=_0x97385e-0x0;var _0x5d337e=_0x7896[_0x97385e];return _0x5d337e;};'use strict';var BPromise=require(_0x6789('0x0'));var https=require(_0x6789('0x1'));var logger=require(_0x6789('0x2'))(_0x6789('0x3'));var USERNAME=_0x6789('0x4');var PASSWORD=_0x6789('0x5');function openIssue(_0x3bba25,_0x15d0f1){var _0x1b91ff={'fields':{'project':{'key':_0x3bba25[_0x6789('0x6')]||'MOTGUI'},'summary':(_0x3bba25[_0x6789('0x7')]||_0x6789('0x8'))+_0x6789('0x9')+_0x3bba25['ip'],'description':_0x3bba25['description']||JSON['stringify'](_0x3bba25),'issuetype':{'name':_0x3bba25[_0x6789('0xa')]||_0x6789('0xb')}}};_0x1b91ff[_0x6789('0xc')][_0x6789('0xd')]=_0x3bba25[_0x6789('0xe')];_0x1b91ff[_0x6789('0xc')]['customfield_11501']=_0x3bba25[_0x6789('0xf')];_0x1b91ff[_0x6789('0xc')][_0x6789('0x10')]=_0x3bba25[_0x6789('0x11')];_0x1b91ff['fields'][_0x6789('0x12')]=_0x3bba25[_0x6789('0x13')];_0x1b91ff['fields'][_0x6789('0x14')]=_0x3bba25['reason'];_0x1b91ff[_0x6789('0xc')][_0x6789('0x15')]=_0x3bba25['ip'];var _0x5ba3f2={'host':_0x6789('0x16'),'port':0x1bb,'path':_0x6789('0x17'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x6789('0x18'),'Authorization':_0x6789('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x6789('0x1a')](_0x6789('0x1b'))}};var _0x458d0a=JSON[_0x6789('0x1c')](_0x1b91ff);var _0x15c2e0=https[_0x6789('0x1d')](_0x5ba3f2,function(_0x245022){_0x245022[_0x6789('0x1e')](_0x6789('0x1f'));var _0x1092ed='';_0x245022['on']('data',function(_0x26f744){_0x1092ed+=_0x26f744;});_0x245022['on']('end',function(){if(_0x15d0f1){return _0x15d0f1[_0x6789('0x20')](_0x245022['statusCode'])[_0x6789('0x21')](JSON['parse'](_0x1092ed));}});});_0x15c2e0['on'](_0x6789('0x22'),function(_0x461600){if(_0x15d0f1){return _0x15d0f1[_0x6789('0x20')](0x1f4)[_0x6789('0x21')]({'errors':[{'message':_0x6789('0x23'),'type':_0x6789('0x24')}]});}});_0x15c2e0[_0x6789('0x25')](_0x458d0a);_0x15c2e0[_0x6789('0x26')]();}exports[_0x6789('0x27')]=openIssue;exports['send']=function(_0x336594,_0x18d990){_0x336594[_0x6789('0x28')]['ip']=_0x336594[_0x6789('0x29')]['x-forwarded-for']||_0x336594[_0x6789('0x2a')][_0x6789('0x2b')]||_0x336594[_0x6789('0x2c')]['remoteAddress']||_0x336594[_0x6789('0x2a')][_0x6789('0x2c')]['remoteAddress'];return openIssue(_0x336594[_0x6789('0x28')],_0x18d990);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 49eb914..f6af30d 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 _0x6f7a=['isAuthenticated','index','/describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get'];(function(_0x251042,_0x21016d){var _0x4eedc0=function(_0x224813){while(--_0x224813){_0x251042['push'](_0x251042['shift']());}};_0x4eedc0(++_0x21016d);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x1c9395,_0x23ae63){_0x1c9395=_0x1c9395-0x0;var _0xa52553=_0x6f7a[_0x1c9395];return _0xa52553;};'use strict';var multer=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var path=require(_0xa6f7('0x2'));var timeout=require(_0xa6f7('0x3'));var express=require('express');var router=express[_0xa6f7('0x4')]();var fs_extra=require(_0xa6f7('0x5'));var auth=require(_0xa6f7('0x6'));var interaction=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var controller=require(_0xa6f7('0x9'));router[_0xa6f7('0xa')]('/',auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xc')]);router[_0xa6f7('0xa')](_0xa6f7('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xa6f7('0xa')](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xf')]);router[_0xa6f7('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa6f7('0x11')](_0xa6f7('0xe'),auth['isAuthenticated'](),controller[_0xa6f7('0x12')]);router['delete'](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0x13')]);module[_0xa6f7('0x14')]=router; \ No newline at end of file +var _0x1339=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x189930,_0x42bdc0){var _0x52bb7b=function(_0x379833){while(--_0x379833){_0x189930['push'](_0x189930['shift']());}};_0x52bb7b(++_0x42bdc0);}(_0x1339,0x1ed));var _0x9133=function(_0x4aa28a,_0x269c64){_0x4aa28a=_0x4aa28a-0x0;var _0x18dfa2=_0x1339[_0x4aa28a];return _0x18dfa2;};'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('./jscriptyAnswerReport.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('0xf')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0x10')]);router['put'](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0x11')]);router[_0x9133('0x12')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller['destroy']);module[_0x9133('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index fcad58f..8949263 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(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x7a54,0x106));var _0x47a5=function(_0x1fcf22,_0x44fa26){_0x1fcf22=_0x1fcf22-0x0;var _0x3bc187=_0x7a54[_0x1fcf22];return _0x3bc187;};'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(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x7a54,0x106));var _0x47a5=function(_0x39c4fb,_0x565a04){_0x39c4fb=_0x39c4fb-0x0;var _0x49933a=_0x7a54[_0x39c4fb];return _0x49933a;};'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 db28b6b..657d6b4 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 _0x8098=['set','Content-Range','apply','reject','save','then','end','error','stack','name','send','map','rawAttributes','type','model','query','keys','attributes','intersection','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','show','fields','length','find','create','body','update','params','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','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','sendStatus','status','json','offset','undefined','count'];(function(_0x3091b4,_0x3068b9){var _0xb545f6=function(_0xcf417b){while(--_0xcf417b){_0x3091b4['push'](_0x3091b4['shift']());}};_0xb545f6(++_0x3068b9);}(_0x8098,0x1ba));var _0x8809=function(_0x123c03,_0x342a80){_0x123c03=_0x123c03-0x0;var _0x761f80=_0x8098[_0x123c03];return _0x761f80;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8809('0x0'));var jsonpatch=require(_0x8809('0x1'));var rp=require(_0x8809('0x2'));var moment=require(_0x8809('0x3'));var BPromise=require(_0x8809('0x4'));var Mustache=require('mustache');var util=require(_0x8809('0x5'));var path=require(_0x8809('0x6'));var sox=require(_0x8809('0x7'));var csv=require(_0x8809('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8809('0x9'));var _=require(_0x8809('0xa'));var squel=require('squel');var crypto=require(_0x8809('0xb'));var jsforce=require(_0x8809('0xc'));var deskjs=require(_0x8809('0xd'));var toCsv=require(_0x8809('0x8'));var querystring=require(_0x8809('0xe'));var Papa=require(_0x8809('0xf'));var Redis=require(_0x8809('0x10'));var authService=require(_0x8809('0x11'));var qs=require(_0x8809('0x12'));var as=require(_0x8809('0x13'));var hardwareService=require(_0x8809('0x14'));var logger=require(_0x8809('0x15'))(_0x8809('0x16'));var utils=require(_0x8809('0x17'));var config=require(_0x8809('0x18'));var licenseUtil=require(_0x8809('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x388b99,_0x455989){_0x455989=_0x455989||0xcc;return function(_0x4d3b4c){if(_0x4d3b4c){return _0x388b99[_0x8809('0x1a')](_0x455989);}return _0x388b99[_0x8809('0x1b')](_0x455989)['end']();};}function respondWithResult(_0x5d87df,_0x316f2c){_0x316f2c=_0x316f2c||0xc8;return function(_0x2e4279){if(_0x2e4279){return _0x5d87df[_0x8809('0x1b')](_0x316f2c)[_0x8809('0x1c')](_0x2e4279);}};}function respondWithFilteredResult(_0x131716,_0x3d4d7e){return function(_0x105bec){if(_0x105bec){var _0x5624b5=typeof _0x3d4d7e[_0x8809('0x1d')]===_0x8809('0x1e')&&typeof _0x3d4d7e['limit']===_0x8809('0x1e');var _0x369d58=_0x105bec['count'];var _0x3b0562=_0x5624b5?0x0:_0x3d4d7e[_0x8809('0x1d')];var _0x7ec1a6=_0x5624b5?_0x105bec[_0x8809('0x1f')]:_0x3d4d7e[_0x8809('0x1d')]+_0x3d4d7e['limit'];var _0x4826e2;if(_0x7ec1a6>=_0x369d58){_0x7ec1a6=_0x369d58;_0x4826e2=0xc8;}else{_0x4826e2=0xce;}_0x131716[_0x8809('0x1b')](_0x4826e2);return _0x131716[_0x8809('0x20')](_0x8809('0x21'),_0x3b0562+'-'+_0x7ec1a6+'/'+_0x369d58)[_0x8809('0x1c')](_0x105bec);}return null;};}function patchUpdates(_0x2ff4a1){return function(_0x91de1e){try{jsonpatch[_0x8809('0x22')](_0x91de1e,_0x2ff4a1,!![]);}catch(_0x404be9){return BPromise[_0x8809('0x23')](_0x404be9);}return _0x91de1e[_0x8809('0x24')]();};}function saveUpdates(_0x16893a,_0x1440aa){return function(_0x26b43e){if(_0x26b43e){return _0x26b43e['update'](_0x16893a)['then'](function(_0x34d2df){return _0x34d2df;});}return null;};}function removeEntity(_0x5984c6,_0x521840){return function(_0x54ddd8){if(_0x54ddd8){return _0x54ddd8['destroy']()[_0x8809('0x25')](function(){_0x5984c6[_0x8809('0x1b')](0xcc)[_0x8809('0x26')]();});}};}function handleEntityNotFound(_0x2bbf26,_0x2947f7){return function(_0x3d21fd){if(!_0x3d21fd){_0x2bbf26[_0x8809('0x1a')](0x194);}return _0x3d21fd;};}function handleError(_0x14f545,_0x125776){_0x125776=_0x125776||0x1f4;return function(_0x6e5dc8){logger[_0x8809('0x27')](_0x6e5dc8[_0x8809('0x28')]);if(_0x6e5dc8['name']){delete _0x6e5dc8[_0x8809('0x29')];}_0x14f545[_0x8809('0x1b')](_0x125776)[_0x8809('0x2a')](_0x6e5dc8);};}exports['index']=function(_0x13d74b,_0x443741){var _0xbba52b={},_0x296187={},_0xb9388f={'count':0x0,'rows':[]};var _0x539f32=_[_0x8809('0x2b')](db['JscriptyAnswerReport'][_0x8809('0x2c')],function(_0x197719){return{'name':_0x197719['fieldName'],'type':_0x197719[_0x8809('0x2d')]['key']};});_0x296187[_0x8809('0x2e')]=_[_0x8809('0x2b')](_0x539f32,_0x8809('0x29'));_0x296187[_0x8809('0x2f')]=_[_0x8809('0x30')](_0x13d74b[_0x8809('0x2f')]);_0x296187['filters']=_['intersection'](_0x296187[_0x8809('0x2e')],_0x296187[_0x8809('0x2f')]);_0xbba52b[_0x8809('0x31')]=_[_0x8809('0x32')](_0x296187[_0x8809('0x2e')],qs['fields'](_0x13d74b[_0x8809('0x2f')]['fields']));_0xbba52b['attributes']=_0xbba52b[_0x8809('0x31')]['length']?_0xbba52b[_0x8809('0x31')]:_0x296187['model'];if(!_0x13d74b[_0x8809('0x2f')][_0x8809('0x33')](_0x8809('0x34'))){_0xbba52b[_0x8809('0x35')]=qs[_0x8809('0x35')](_0x13d74b[_0x8809('0x2f')]['limit']);_0xbba52b[_0x8809('0x1d')]=qs[_0x8809('0x1d')](_0x13d74b['query'][_0x8809('0x1d')]);}_0xbba52b[_0x8809('0x36')]=qs[_0x8809('0x37')](_0x13d74b[_0x8809('0x2f')][_0x8809('0x37')]);_0xbba52b[_0x8809('0x38')]=qs['filters'](_[_0x8809('0x39')](_0x13d74b[_0x8809('0x2f')],_0x296187[_0x8809('0x3a')]),_0x539f32);if(_0x13d74b[_0x8809('0x2f')][_0x8809('0x3b')]){_0xbba52b[_0x8809('0x38')]=_[_0x8809('0x3c')](_0xbba52b[_0x8809('0x38')],{'$or':_['map'](_0x539f32,function(_0x13b530){if(_0x13b530[_0x8809('0x2d')]!==_0x8809('0x3d')){var _0x2b6380={};_0x2b6380[_0x13b530['name']]={'$like':'%'+_0x13d74b[_0x8809('0x2f')][_0x8809('0x3b')]+'%'};return _0x2b6380;}})});}_0xbba52b=_[_0x8809('0x3c')]({},_0xbba52b,_0x13d74b[_0x8809('0x3e')]);var _0x8e60e2={'where':_0xbba52b[_0x8809('0x38')]};return db[_0x8809('0x3f')][_0x8809('0x1f')](_0x8e60e2)[_0x8809('0x25')](function(_0x2319bb){_0xb9388f[_0x8809('0x1f')]=_0x2319bb;if(_0x13d74b[_0x8809('0x2f')][_0x8809('0x40')]){_0xbba52b[_0x8809('0x41')]=[{'all':!![]}];}return db[_0x8809('0x3f')][_0x8809('0x42')](_0xbba52b);})[_0x8809('0x25')](function(_0x16a0d1){_0xb9388f[_0x8809('0x43')]=_0x16a0d1;return _0xb9388f;})[_0x8809('0x25')](respondWithFilteredResult(_0x443741,_0xbba52b))[_0x8809('0x44')](handleError(_0x443741,null));};exports[_0x8809('0x45')]=function(_0x39a2d3,_0x5a346c){var _0x3aa95d={'raw':!![],'where':{'id':_0x39a2d3['params']['id']}},_0x2f1316={};_0x2f1316[_0x8809('0x2e')]=_[_0x8809('0x30')](db[_0x8809('0x3f')][_0x8809('0x2c')]);_0x2f1316[_0x8809('0x2f')]=_['keys'](_0x39a2d3['query']);_0x2f1316[_0x8809('0x3a')]=_[_0x8809('0x32')](_0x2f1316[_0x8809('0x2e')],_0x2f1316[_0x8809('0x2f')]);_0x3aa95d['attributes']=_['intersection'](_0x2f1316[_0x8809('0x2e')],qs[_0x8809('0x46')](_0x39a2d3['query'][_0x8809('0x46')]));_0x3aa95d[_0x8809('0x31')]=_0x3aa95d['attributes'][_0x8809('0x47')]?_0x3aa95d[_0x8809('0x31')]:_0x2f1316[_0x8809('0x2e')];if(_0x39a2d3[_0x8809('0x2f')]['includeAll']){_0x3aa95d[_0x8809('0x41')]=[{'all':!![]}];}_0x3aa95d=_['merge']({},_0x3aa95d,_0x39a2d3['options']);return db[_0x8809('0x3f')][_0x8809('0x48')](_0x3aa95d)[_0x8809('0x25')](handleEntityNotFound(_0x5a346c,null))[_0x8809('0x25')](respondWithResult(_0x5a346c,null))[_0x8809('0x44')](handleError(_0x5a346c,null));};exports[_0x8809('0x49')]=function(_0x47f7a2,_0x2bd916){return db[_0x8809('0x3f')][_0x8809('0x49')](_0x47f7a2[_0x8809('0x4a')],{})[_0x8809('0x25')](respondWithResult(_0x2bd916,0xc9))[_0x8809('0x44')](handleError(_0x2bd916,null));};exports[_0x8809('0x4b')]=function(_0x373bf4,_0x23f6f6){if(_0x373bf4[_0x8809('0x4a')]['id']){delete _0x373bf4['body']['id'];}return db[_0x8809('0x3f')][_0x8809('0x48')]({'where':{'id':_0x373bf4[_0x8809('0x4c')]['id']}})[_0x8809('0x25')](handleEntityNotFound(_0x23f6f6,null))[_0x8809('0x25')](saveUpdates(_0x373bf4[_0x8809('0x4a')],null))[_0x8809('0x25')](respondWithResult(_0x23f6f6,null))['catch'](handleError(_0x23f6f6,null));};exports[_0x8809('0x4d')]=function(_0x5496a3,_0x3ce100){return db[_0x8809('0x3f')][_0x8809('0x48')]({'where':{'id':_0x5496a3[_0x8809('0x4c')]['id']}})[_0x8809('0x25')](handleEntityNotFound(_0x3ce100,null))[_0x8809('0x25')](removeEntity(_0x3ce100,null))[_0x8809('0x44')](handleError(_0x3ce100,null));};exports[_0x8809('0x4e')]=function(_0x4dfa63,_0x46382e){return db[_0x8809('0x3f')]['describe']()['then'](respondWithResult(_0x46382e,null))[_0x8809('0x44')](handleError(_0x46382e,null));}; \ No newline at end of file +var _0x423b=['options','includeAll','include','rows','catch','show','params','find','create','body','describe','rimraf','fast-json-patch','moment','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','stack','name','send','index','JscriptyAnswerReport','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','VIRTUAL'];(function(_0x2baebf,_0x292099){var _0x1161f9=function(_0x477775){while(--_0x477775){_0x2baebf['push'](_0x2baebf['shift']());}};_0x1161f9(++_0x292099);}(_0x423b,0x12b));var _0xb423=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x423b[_0x5ddaac];return _0x2a9c58;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb423('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb423('0x1'));var rp=require('request-promise');var moment=require(_0xb423('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb423('0x3'));var sox=require(_0xb423('0x4'));var csv=require('to-csv');var ejs=require(_0xb423('0x5'));var fs=require('fs');var fs_extra=require(_0xb423('0x6'));var _=require(_0xb423('0x7'));var squel=require(_0xb423('0x8'));var crypto=require('crypto');var jsforce=require(_0xb423('0x9'));var deskjs=require(_0xb423('0xa'));var toCsv=require(_0xb423('0xb'));var querystring=require(_0xb423('0xc'));var Papa=require(_0xb423('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb423('0xe'));var as=require(_0xb423('0xf'));var hardwareService=require(_0xb423('0x10'));var logger=require(_0xb423('0x11'))(_0xb423('0x12'));var utils=require('../../config/utils');var config=require(_0xb423('0x13'));var licenseUtil=require(_0xb423('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26aea2,_0xe3016f){_0xe3016f=_0xe3016f||0xcc;return function(_0x40855a){if(_0x40855a){return _0x26aea2['sendStatus'](_0xe3016f);}return _0x26aea2[_0xb423('0x15')](_0xe3016f)['end']();};}function respondWithResult(_0x33aaf7,_0x582ae6){_0x582ae6=_0x582ae6||0xc8;return function(_0x4d7109){if(_0x4d7109){return _0x33aaf7['status'](_0x582ae6)[_0xb423('0x16')](_0x4d7109);}};}function respondWithFilteredResult(_0x4351e2,_0x222e41){return function(_0x5abab2){if(_0x5abab2){var _0x1b1586=typeof _0x222e41[_0xb423('0x17')]===_0xb423('0x18')&&typeof _0x222e41[_0xb423('0x19')]==='undefined';var _0x42b6fe=_0x5abab2[_0xb423('0x1a')];var _0x5d84a6=_0x1b1586?0x0:_0x222e41['offset'];var _0x340319=_0x1b1586?_0x5abab2['count']:_0x222e41[_0xb423('0x17')]+_0x222e41[_0xb423('0x19')];var _0x5e7ff5;if(_0x340319>=_0x42b6fe){_0x340319=_0x42b6fe;_0x5e7ff5=0xc8;}else{_0x5e7ff5=0xce;}_0x4351e2[_0xb423('0x15')](_0x5e7ff5);return _0x4351e2[_0xb423('0x1b')](_0xb423('0x1c'),_0x5d84a6+'-'+_0x340319+'/'+_0x42b6fe)[_0xb423('0x16')](_0x5abab2);}return null;};}function patchUpdates(_0x41b213){return function(_0x56ab9d){try{jsonpatch[_0xb423('0x1d')](_0x56ab9d,_0x41b213,!![]);}catch(_0x26f42f){return BPromise[_0xb423('0x1e')](_0x26f42f);}return _0x56ab9d['save']();};}function saveUpdates(_0x210cdb,_0x500eb6){return function(_0x5d4d21){if(_0x5d4d21){return _0x5d4d21[_0xb423('0x1f')](_0x210cdb)[_0xb423('0x20')](function(_0x10d8db){return _0x10d8db;});}return null;};}function removeEntity(_0x504a9d,_0x305232){return function(_0x4b6234){if(_0x4b6234){return _0x4b6234[_0xb423('0x21')]()['then'](function(){_0x504a9d[_0xb423('0x15')](0xcc)[_0xb423('0x22')]();});}};}function handleEntityNotFound(_0x56ed56,_0x2cdf54){return function(_0x1d3e39){if(!_0x1d3e39){_0x56ed56[_0xb423('0x23')](0x194);}return _0x1d3e39;};}function handleError(_0x4e361b,_0x5109a0){_0x5109a0=_0x5109a0||0x1f4;return function(_0x108f74){logger['error'](_0x108f74[_0xb423('0x24')]);if(_0x108f74['name']){delete _0x108f74[_0xb423('0x25')];}_0x4e361b[_0xb423('0x15')](_0x5109a0)[_0xb423('0x26')](_0x108f74);};}exports[_0xb423('0x27')]=function(_0x18e26a,_0x4a1adc){var _0x1de3ee={},_0x48a0ce={},_0x51da03={'count':0x0,'rows':[]};var _0x4a9c4e=_['map'](db[_0xb423('0x28')][_0xb423('0x29')],function(_0x1230d5){return{'name':_0x1230d5['fieldName'],'type':_0x1230d5['type'][_0xb423('0x2a')]};});_0x48a0ce[_0xb423('0x2b')]=_['map'](_0x4a9c4e,_0xb423('0x25'));_0x48a0ce[_0xb423('0x2c')]=_[_0xb423('0x2d')](_0x18e26a[_0xb423('0x2c')]);_0x48a0ce[_0xb423('0x2e')]=_['intersection'](_0x48a0ce[_0xb423('0x2b')],_0x48a0ce['query']);_0x1de3ee[_0xb423('0x2f')]=_[_0xb423('0x30')](_0x48a0ce[_0xb423('0x2b')],qs[_0xb423('0x31')](_0x18e26a[_0xb423('0x2c')][_0xb423('0x31')]));_0x1de3ee['attributes']=_0x1de3ee[_0xb423('0x2f')][_0xb423('0x32')]?_0x1de3ee['attributes']:_0x48a0ce[_0xb423('0x2b')];if(!_0x18e26a['query'][_0xb423('0x33')](_0xb423('0x34'))){_0x1de3ee['limit']=qs[_0xb423('0x19')](_0x18e26a['query'][_0xb423('0x19')]);_0x1de3ee[_0xb423('0x17')]=qs[_0xb423('0x17')](_0x18e26a[_0xb423('0x2c')][_0xb423('0x17')]);}_0x1de3ee['order']=qs['sort'](_0x18e26a[_0xb423('0x2c')][_0xb423('0x35')]);_0x1de3ee['where']=qs[_0xb423('0x2e')](_[_0xb423('0x36')](_0x18e26a['query'],_0x48a0ce[_0xb423('0x2e')]),_0x4a9c4e);if(_0x18e26a[_0xb423('0x2c')][_0xb423('0x37')]){_0x1de3ee[_0xb423('0x38')]=_[_0xb423('0x39')](_0x1de3ee[_0xb423('0x38')],{'$or':_[_0xb423('0x3a')](_0x4a9c4e,function(_0x19e207){if(_0x19e207[_0xb423('0x3b')]!==_0xb423('0x3c')){var _0x17eb60={};_0x17eb60[_0x19e207[_0xb423('0x25')]]={'$like':'%'+_0x18e26a[_0xb423('0x2c')][_0xb423('0x37')]+'%'};return _0x17eb60;}})});}_0x1de3ee=_['merge']({},_0x1de3ee,_0x18e26a[_0xb423('0x3d')]);var _0x5bd098={'where':_0x1de3ee['where']};return db['JscriptyAnswerReport']['count'](_0x5bd098)[_0xb423('0x20')](function(_0x162790){_0x51da03['count']=_0x162790;if(_0x18e26a[_0xb423('0x2c')][_0xb423('0x3e')]){_0x1de3ee[_0xb423('0x3f')]=[{'all':!![]}];}return db[_0xb423('0x28')]['findAll'](_0x1de3ee);})[_0xb423('0x20')](function(_0x18a80e){_0x51da03[_0xb423('0x40')]=_0x18a80e;return _0x51da03;})['then'](respondWithFilteredResult(_0x4a1adc,_0x1de3ee))[_0xb423('0x41')](handleError(_0x4a1adc,null));};exports[_0xb423('0x42')]=function(_0x555cdb,_0x590a92){var _0x41f7cd={'raw':!![],'where':{'id':_0x555cdb[_0xb423('0x43')]['id']}},_0x520744={};_0x520744[_0xb423('0x2b')]=_['keys'](db[_0xb423('0x28')]['rawAttributes']);_0x520744[_0xb423('0x2c')]=_[_0xb423('0x2d')](_0x555cdb[_0xb423('0x2c')]);_0x520744[_0xb423('0x2e')]=_[_0xb423('0x30')](_0x520744[_0xb423('0x2b')],_0x520744[_0xb423('0x2c')]);_0x41f7cd[_0xb423('0x2f')]=_[_0xb423('0x30')](_0x520744[_0xb423('0x2b')],qs[_0xb423('0x31')](_0x555cdb[_0xb423('0x2c')][_0xb423('0x31')]));_0x41f7cd[_0xb423('0x2f')]=_0x41f7cd[_0xb423('0x2f')][_0xb423('0x32')]?_0x41f7cd[_0xb423('0x2f')]:_0x520744[_0xb423('0x2b')];if(_0x555cdb[_0xb423('0x2c')]['includeAll']){_0x41f7cd[_0xb423('0x3f')]=[{'all':!![]}];}_0x41f7cd=_[_0xb423('0x39')]({},_0x41f7cd,_0x555cdb[_0xb423('0x3d')]);return db[_0xb423('0x28')][_0xb423('0x44')](_0x41f7cd)[_0xb423('0x20')](handleEntityNotFound(_0x590a92,null))['then'](respondWithResult(_0x590a92,null))['catch'](handleError(_0x590a92,null));};exports['create']=function(_0x2e3efa,_0x299bd9){return db[_0xb423('0x28')][_0xb423('0x45')](_0x2e3efa[_0xb423('0x46')],{})['then'](respondWithResult(_0x299bd9,0xc9))['catch'](handleError(_0x299bd9,null));};exports[_0xb423('0x1f')]=function(_0x4cbb9b,_0x52081f){if(_0x4cbb9b[_0xb423('0x46')]['id']){delete _0x4cbb9b[_0xb423('0x46')]['id'];}return db[_0xb423('0x28')]['find']({'where':{'id':_0x4cbb9b['params']['id']}})[_0xb423('0x20')](handleEntityNotFound(_0x52081f,null))[_0xb423('0x20')](saveUpdates(_0x4cbb9b[_0xb423('0x46')],null))[_0xb423('0x20')](respondWithResult(_0x52081f,null))[_0xb423('0x41')](handleError(_0x52081f,null));};exports['destroy']=function(_0x529046,_0xff5347){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x529046[_0xb423('0x43')]['id']}})['then'](handleEntityNotFound(_0xff5347,null))['then'](removeEntity(_0xff5347,null))['catch'](handleError(_0xff5347,null));};exports[_0xb423('0x47')]=function(_0x457150,_0x32f6a6){return db['JscriptyAnswerReport']['describe']()[_0xb423('0x20')](respondWithResult(_0x32f6a6,null))[_0xb423('0x41')](handleError(_0x32f6a6,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index befdc93..651245c 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 _0x80e4=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash'];(function(_0x2594e0,_0x1ee198){var _0x1eadb9=function(_0x52a325){while(--_0x52a325){_0x2594e0['push'](_0x2594e0['shift']());}};_0x1eadb9(++_0x1ee198);}(_0x80e4,0x103));var _0x480e=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0x80e4[_0x8ba19a];return _0x2bd8b4;};'use strict';var _=require(_0x480e('0x0'));var util=require(_0x480e('0x1'));var logger=require(_0x480e('0x2'))('api');var moment=require(_0x480e('0x3'));var BPromise=require(_0x480e('0x4'));var rp=require(_0x480e('0x5'));var fs=require('fs');var path=require(_0x480e('0x6'));var rimraf=require(_0x480e('0x7'));var config=require('../../config/environment');var attributes=require(_0x480e('0x8'));module[_0x480e('0x9')]=function(_0x14c268,_0x135a83){return _0x14c268[_0x480e('0xa')](_0x480e('0xb'),attributes,{'tableName':_0x480e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fdb=['./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0x4fdb,0xa1));var _0xb4fd=function(_0x5e3f02,_0x407aae){_0x5e3f02=_0x5e3f02-0x0;var _0x594f19=_0x4fdb[_0x5e3f02];return _0x594f19;};'use strict';var _=require(_0xb4fd('0x0'));var util=require('util');var logger=require(_0xb4fd('0x1'))('api');var moment=require(_0xb4fd('0x2'));var BPromise=require(_0xb4fd('0x3'));var rp=require(_0xb4fd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4fd('0x5'));var config=require(_0xb4fd('0x6'));var attributes=require(_0xb4fd('0x7'));module[_0xb4fd('0x8')]=function(_0x189cec,_0x43be37){return _0x189cec[_0xb4fd('0x9')](_0xb4fd('0xa'),attributes,{'tableName':_0xb4fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 0239d5e..7e58184 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 _0x56d9=['http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x56d9,0x79));var _0x956d=function(_0x73ba1f,_0x588ccb){_0x73ba1f=_0x73ba1f-0x0;var _0x2e2725=_0x56d9[_0x73ba1f];return _0x2e2725;};'use strict';var _=require(_0x956d('0x0'));var util=require(_0x956d('0x1'));var moment=require('moment');var BPromise=require(_0x956d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x956d('0x3'));var db=require(_0x956d('0x4'))['db'];var utils=require(_0x956d('0x5'));var logger=require(_0x956d('0x6'))(_0x956d('0x7'));var config=require(_0x956d('0x8'));var jayson=require(_0x956d('0x9'));var client=jayson[_0x956d('0xa')][_0x956d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47119d,_0xdf35a3,_0x47fee9){return new BPromise(function(_0xe170cd,_0x54f59f){return client[_0x956d('0xc')](_0x47119d,_0x47fee9)[_0x956d('0xd')](function(_0x4c9ad1){logger[_0x956d('0xe')](_0x956d('0xf'),_0xdf35a3,_0x956d('0x10'));logger['debug'](_0x956d('0x11'),_0xdf35a3,_0x956d('0x10'),JSON[_0x956d('0x12')](_0x4c9ad1));if(_0x4c9ad1[_0x956d('0x13')]){if(_0x4c9ad1[_0x956d('0x13')][_0x956d('0x14')]===0x1f4){logger[_0x956d('0x13')](_0x956d('0xf'),_0xdf35a3,_0x4c9ad1[_0x956d('0x13')][_0x956d('0x15')]);return _0x54f59f(_0x4c9ad1['error'][_0x956d('0x15')]);}logger[_0x956d('0x13')](_0x956d('0xf'),_0xdf35a3,_0x4c9ad1['error'][_0x956d('0x15')]);return _0xe170cd(_0x4c9ad1[_0x956d('0x13')][_0x956d('0x15')]);}else{logger[_0x956d('0xe')](_0x956d('0xf'),_0xdf35a3,_0x956d('0x10'));_0xe170cd(_0x4c9ad1['result'][_0x956d('0x15')]);}})['catch'](function(_0x1f692c){logger[_0x956d('0x13')](_0x956d('0xf'),_0xdf35a3,_0x1f692c);_0x54f59f(_0x1f692c);});});} \ No newline at end of file +var _0xe5a9=['message','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s'];(function(_0x43776a,_0x4eb74c){var _0x18eb8f=function(_0x319afb){while(--_0x319afb){_0x43776a['push'](_0x43776a['shift']());}};_0x18eb8f(++_0x4eb74c);}(_0xe5a9,0x135));var _0x9e5a=function(_0x1f15d4,_0x547ee1){_0x1f15d4=_0x1f15d4-0x0;var _0x407670=_0xe5a9[_0x1f15d4];return _0x407670;};'use strict';var _=require(_0x9e5a('0x0'));var util=require(_0x9e5a('0x1'));var moment=require(_0x9e5a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e5a('0x3'));var db=require(_0x9e5a('0x4'))['db'];var utils=require(_0x9e5a('0x5'));var logger=require(_0x9e5a('0x6'))(_0x9e5a('0x7'));var config=require(_0x9e5a('0x8'));var jayson=require(_0x9e5a('0x9'));var client=jayson['client'][_0x9e5a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32d0e4,_0x4a07b8,_0x1c2c25){return new BPromise(function(_0x50e5a9,_0x48aea3){return client[_0x9e5a('0xb')](_0x32d0e4,_0x1c2c25)[_0x9e5a('0xc')](function(_0x1440d9){logger[_0x9e5a('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4a07b8,_0x9e5a('0xe'));logger[_0x9e5a('0xf')](_0x9e5a('0x10'),_0x4a07b8,_0x9e5a('0xe'),JSON[_0x9e5a('0x11')](_0x1440d9));if(_0x1440d9[_0x9e5a('0x12')]){if(_0x1440d9[_0x9e5a('0x12')][_0x9e5a('0x13')]===0x1f4){logger[_0x9e5a('0x12')](_0x9e5a('0x14'),_0x4a07b8,_0x1440d9['error'][_0x9e5a('0x15')]);return _0x48aea3(_0x1440d9[_0x9e5a('0x12')]['message']);}logger[_0x9e5a('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4a07b8,_0x1440d9[_0x9e5a('0x12')]['message']);return _0x50e5a9(_0x1440d9[_0x9e5a('0x12')][_0x9e5a('0x15')]);}else{logger[_0x9e5a('0xd')](_0x9e5a('0x14'),_0x4a07b8,_0x9e5a('0xe'));_0x50e5a9(_0x1440d9['result'][_0x9e5a('0x15')]);}})['catch'](function(_0x128fc7){logger['error'](_0x9e5a('0x14'),_0x4a07b8,_0x128fc7);_0x48aea3(_0x128fc7);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index df25cc9..8fcddd6 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 _0x8feb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','create','post','/:id/clone','clone','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x3fe6bc,_0x3d0783){var _0x5aeea9=function(_0x48384c){while(--_0x48384c){_0x3fe6bc['push'](_0x3fe6bc['shift']());}};_0x5aeea9(++_0x3d0783);}(_0x8feb,0x1ef));var _0xb8fe=function(_0x4486af,_0x40460e){_0x4486af=_0x4486af-0x0;var _0x38dab3=_0x8feb[_0x4486af];return _0x38dab3;};'use strict';var multer=require(_0xb8fe('0x0'));var util=require(_0xb8fe('0x1'));var path=require(_0xb8fe('0x2'));var timeout=require(_0xb8fe('0x3'));var express=require(_0xb8fe('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb8fe('0x5'));var interaction=require(_0xb8fe('0x6'));var config=require(_0xb8fe('0x7'));var controller=require(_0xb8fe('0x8'));router[_0xb8fe('0x9')]('/',auth[_0xb8fe('0xa')](),controller['index']);router[_0xb8fe('0x9')](_0xb8fe('0xb'),auth[_0xb8fe('0xa')](),controller[_0xb8fe('0xc')]);router[_0xb8fe('0x9')](_0xb8fe('0xd'),auth[_0xb8fe('0xa')](),controller[_0xb8fe('0xe')]);router[_0xb8fe('0x9')](_0xb8fe('0xf'),auth['isAuthenticated'](),controller[_0xb8fe('0x10')]);router[_0xb8fe('0x9')]('/:id/summary',auth[_0xb8fe('0xa')](),timeout(_0xb8fe('0x11')),controller['getSummary']);router['post']('/',auth[_0xb8fe('0xa')](),controller[_0xb8fe('0x12')]);router[_0xb8fe('0x13')](_0xb8fe('0x14'),auth[_0xb8fe('0xa')](),controller[_0xb8fe('0x15')]);router['put'](_0xb8fe('0xb'),auth[_0xb8fe('0xa')](),controller[_0xb8fe('0x16')]);router[_0xb8fe('0x17')](_0xb8fe('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xb8fe('0x18')]=router; \ No newline at end of file +var _0x6a01=['destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','/:id','show','getSessions','/:id/answers','getAnswers','30s','post','create','/:id/clone','clone','put','delete'];(function(_0x5e953b,_0x22b43c){var _0x4a149d=function(_0x48584e){while(--_0x48584e){_0x5e953b['push'](_0x5e953b['shift']());}};_0x4a149d(++_0x22b43c);}(_0x6a01,0x152));var _0x16a0=function(_0x1e50fc,_0x3d2684){_0x1e50fc=_0x1e50fc-0x0;var _0x497f51=_0x6a01[_0x1e50fc];return _0x497f51;};'use strict';var multer=require(_0x16a0('0x0'));var util=require(_0x16a0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x16a0('0x2'));var router=express[_0x16a0('0x3')]();var fs_extra=require(_0x16a0('0x4'));var auth=require(_0x16a0('0x5'));var interaction=require(_0x16a0('0x6'));var config=require('../../config/environment');var controller=require(_0x16a0('0x7'));router[_0x16a0('0x8')]('/',auth[_0x16a0('0x9')](),controller['index']);router[_0x16a0('0x8')](_0x16a0('0xa'),auth[_0x16a0('0x9')](),controller[_0x16a0('0xb')]);router[_0x16a0('0x8')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x16a0('0xc')]);router[_0x16a0('0x8')](_0x16a0('0xd'),auth[_0x16a0('0x9')](),controller[_0x16a0('0xe')]);router['get']('/:id/summary',auth['isAuthenticated'](),timeout(_0x16a0('0xf')),controller['getSummary']);router[_0x16a0('0x10')]('/',auth['isAuthenticated'](),controller[_0x16a0('0x11')]);router[_0x16a0('0x10')](_0x16a0('0x12'),auth['isAuthenticated'](),controller[_0x16a0('0x13')]);router[_0x16a0('0x14')]('/:id',auth[_0x16a0('0x9')](),controller['update']);router[_0x16a0('0x15')]('/:id',auth[_0x16a0('0x9')](),controller[_0x16a0('0x16')]);module[_0x16a0('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 78e4788..a9aab99 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 _0x015f=['util','exports','STRING','name','TEXT','long','setDataValue','isString','formData','getDataValue','description','BOOLEAN','sequelize','lodash'];(function(_0x23439c,_0x5baf43){var _0x5f0922=function(_0x34406f){while(--_0x34406f){_0x23439c['push'](_0x23439c['shift']());}};_0x5f0922(++_0x5baf43);}(_0x015f,0x1da));var _0xf015=function(_0x4defd6,_0x37bbd3){_0x4defd6=_0x4defd6-0x0;var _0x4c9276=_0x015f[_0x4defd6];return _0x4c9276;};'use strict';var Sequelize=require(_0xf015('0x0'));var _=require(_0xf015('0x1'));var util=require(_0xf015('0x2'));module[_0xf015('0x3')]={'name':{'type':Sequelize[_0xf015('0x4')],'unique':_0xf015('0x5')},'description':{'type':Sequelize[_0xf015('0x4')]},'formData':{'type':Sequelize[_0xf015('0x6')](_0xf015('0x7')),'set':function(_0x59a520){if(_['isObjectLike'](_0x59a520)){this[_0xf015('0x8')]('formData',JSON['stringify'](_0x59a520));}else if(_[_0xf015('0x9')](_0x59a520)){this['setDataValue'](_0xf015('0xa'),_0x59a520);}else{this[_0xf015('0x8')]('formData',util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xf015('0xb')]('name')||'',this[_0xf015('0xb')](_0xf015('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xf015('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x69c7=['exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','getDataValue','BOOLEAN','sequelize','lodash','util'];(function(_0x76517f,_0x325017){var _0x43cc3a=function(_0xd1b968){while(--_0xd1b968){_0x76517f['push'](_0x76517f['shift']());}};_0x43cc3a(++_0x325017);}(_0x69c7,0x8d));var _0x769c=function(_0x2d572b,_0x14d892){_0x2d572b=_0x2d572b-0x0;var _0xa2f78a=_0x69c7[_0x2d572b];return _0xa2f78a;};'use strict';var Sequelize=require(_0x769c('0x0'));var _=require(_0x769c('0x1'));var util=require(_0x769c('0x2'));module[_0x769c('0x3')]={'name':{'type':Sequelize[_0x769c('0x4')],'unique':_0x769c('0x5')},'description':{'type':Sequelize[_0x769c('0x4')]},'formData':{'type':Sequelize[_0x769c('0x6')](_0x769c('0x7')),'set':function(_0x42b789){if(_[_0x769c('0x8')](_0x42b789)){this[_0x769c('0x9')](_0x769c('0xa'),JSON[_0x769c('0xb')](_0x42b789));}else if(_[_0x769c('0xc')](_0x42b789)){this[_0x769c('0x9')](_0x769c('0xa'),_0x42b789);}else{this[_0x769c('0x9')]('formData',util[_0x769c('0xd')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0x769c('0x5'))||'',this[_0x769c('0xe')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x769c('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x769c('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 4c285ef..a224f7d 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 _0x7a40=['findAll','rows','params','keys','fields','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','catch','clone','omit','createdAt','updatedAt','role','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getSessions','findOne','JscriptySessionReport','hasOwnProperty','ProjectId','getAnswers','JscriptyAnswerReport','number','indexOf','toString','replace','getSummary','startTime','starttime','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','Projects','error','stack','name','index','JscriptyProject','rawAttributes','key','model','map','query','intersection','attributes','nolimit','limit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include'];(function(_0x1c6bcd,_0x107272){var _0x16f7de=function(_0x52bf30){while(--_0x52bf30){_0x1c6bcd['push'](_0x1c6bcd['shift']());}};_0x16f7de(++_0x107272);}(_0x7a40,0x197));var _0x07a4=function(_0x4273d2,_0xf5cc7d){_0x4273d2=_0x4273d2-0x0;var _0x4309cf=_0x7a40[_0x4273d2];return _0x4309cf;};'use strict';var emlformat=require(_0x07a4('0x0'));var rimraf=require(_0x07a4('0x1'));var zipdir=require(_0x07a4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x07a4('0x3'));var moment=require(_0x07a4('0x4'));var BPromise=require(_0x07a4('0x5'));var Mustache=require(_0x07a4('0x6'));var util=require(_0x07a4('0x7'));var path=require('path');var sox=require(_0x07a4('0x8'));var csv=require(_0x07a4('0x9'));var ejs=require(_0x07a4('0xa'));var fs=require('fs');var fs_extra=require(_0x07a4('0xb'));var _=require(_0x07a4('0xc'));var squel=require('squel');var crypto=require(_0x07a4('0xd'));var jsforce=require(_0x07a4('0xe'));var deskjs=require(_0x07a4('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x07a4('0x10'));var Redis=require(_0x07a4('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x07a4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x07a4('0x13'))('api');var utils=require(_0x07a4('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x07a4('0x15'));var db=require(_0x07a4('0x16'))['db'];function respondWithStatusCode(_0x30cfee,_0x20d755){_0x20d755=_0x20d755||0xcc;return function(_0x5210ff){if(_0x5210ff){return _0x30cfee[_0x07a4('0x17')](_0x20d755);}return _0x30cfee[_0x07a4('0x18')](_0x20d755)[_0x07a4('0x19')]();};}function respondWithResult(_0x5a5b1d,_0x1de6b2){_0x1de6b2=_0x1de6b2||0xc8;return function(_0x4c1893){if(_0x4c1893){return _0x5a5b1d[_0x07a4('0x18')](_0x1de6b2)[_0x07a4('0x1a')](_0x4c1893);}};}function respondWithFilteredResult(_0x108eb7,_0x2d61cd){return function(_0x3a2b26){if(_0x3a2b26){var _0x97372b=typeof _0x2d61cd[_0x07a4('0x1b')]===_0x07a4('0x1c')&&typeof _0x2d61cd['limit']===_0x07a4('0x1c');var _0x1fbf2f=_0x3a2b26[_0x07a4('0x1d')];var _0xe8294b=_0x97372b?0x0:_0x2d61cd[_0x07a4('0x1b')];var _0x568b0a=_0x97372b?_0x3a2b26[_0x07a4('0x1d')]:_0x2d61cd['offset']+_0x2d61cd['limit'];var _0x47e86f;if(_0x568b0a>=_0x1fbf2f){_0x568b0a=_0x1fbf2f;_0x47e86f=0xc8;}else{_0x47e86f=0xce;}_0x108eb7[_0x07a4('0x18')](_0x47e86f);return _0x108eb7[_0x07a4('0x1e')](_0x07a4('0x1f'),_0xe8294b+'-'+_0x568b0a+'/'+_0x1fbf2f)['json'](_0x3a2b26);}return null;};}function patchUpdates(_0x2dcb30){return function(_0x464a98){try{jsonpatch[_0x07a4('0x20')](_0x464a98,_0x2dcb30,!![]);}catch(_0x26fa10){return BPromise[_0x07a4('0x21')](_0x26fa10);}return _0x464a98[_0x07a4('0x22')]();};}function saveUpdates(_0x110356,_0x38a411){return function(_0xdea92f){if(_0xdea92f){return _0xdea92f['update'](_0x110356)[_0x07a4('0x23')](function(_0x4e8094){return _0x4e8094;});}return null;};}function removeEntity(_0x5363ff,_0x13d1ee){return function(_0x36760b){if(_0x36760b){return _0x36760b[_0x07a4('0x24')]()['then'](function(){var _0x223dd2=_0x36760b[_0x07a4('0x25')]({'plain':!![]});var _0x2232d4=_0x07a4('0x26');return db['UserProfileResource'][_0x07a4('0x24')]({'where':{'type':_0x2232d4,'resourceId':_0x223dd2['id']}})['then'](function(){return _0x36760b;});})[_0x07a4('0x23')](function(){_0x5363ff[_0x07a4('0x18')](0xcc)[_0x07a4('0x19')]();});}};}function handleEntityNotFound(_0x4a0b36,_0x2e47b9){return function(_0x5db079){if(!_0x5db079){_0x4a0b36[_0x07a4('0x17')](0x194);}return _0x5db079;};}function handleError(_0x52e6e2,_0x570232){_0x570232=_0x570232||0x1f4;return function(_0x5593b9){logger[_0x07a4('0x27')](_0x5593b9[_0x07a4('0x28')]);if(_0x5593b9[_0x07a4('0x29')]){delete _0x5593b9['name'];}_0x52e6e2[_0x07a4('0x18')](_0x570232)['send'](_0x5593b9);};}exports[_0x07a4('0x2a')]=function(_0x1dcdf7,_0x32452a){var _0x4cca1d={},_0x173851={},_0x4d9308={'count':0x0,'rows':[]};var _0x506e45=_['map'](db[_0x07a4('0x2b')][_0x07a4('0x2c')],function(_0x35849c){return{'name':_0x35849c['fieldName'],'type':_0x35849c['type'][_0x07a4('0x2d')]};});_0x173851[_0x07a4('0x2e')]=_[_0x07a4('0x2f')](_0x506e45,_0x07a4('0x29'));_0x173851[_0x07a4('0x30')]=_['keys'](_0x1dcdf7[_0x07a4('0x30')]);_0x173851['filters']=_[_0x07a4('0x31')](_0x173851[_0x07a4('0x2e')],_0x173851[_0x07a4('0x30')]);_0x4cca1d[_0x07a4('0x32')]=_[_0x07a4('0x31')](_0x173851[_0x07a4('0x2e')],qs['fields'](_0x1dcdf7['query']['fields']));_0x4cca1d[_0x07a4('0x32')]=_0x4cca1d[_0x07a4('0x32')]['length']?_0x4cca1d[_0x07a4('0x32')]:_0x173851[_0x07a4('0x2e')];if(!_0x1dcdf7[_0x07a4('0x30')]['hasOwnProperty'](_0x07a4('0x33'))){_0x4cca1d[_0x07a4('0x34')]=qs[_0x07a4('0x34')](_0x1dcdf7['query'][_0x07a4('0x34')]);_0x4cca1d['offset']=qs[_0x07a4('0x1b')](_0x1dcdf7[_0x07a4('0x30')][_0x07a4('0x1b')]);}_0x4cca1d[_0x07a4('0x35')]=qs[_0x07a4('0x36')](_0x1dcdf7[_0x07a4('0x30')][_0x07a4('0x36')]);_0x4cca1d[_0x07a4('0x37')]=qs['filters'](_[_0x07a4('0x38')](_0x1dcdf7['query'],_0x173851[_0x07a4('0x39')]),_0x506e45);if(_0x1dcdf7[_0x07a4('0x30')][_0x07a4('0x3a')]){_0x4cca1d[_0x07a4('0x37')]=_[_0x07a4('0x3b')](_0x4cca1d[_0x07a4('0x37')],{'$or':_['map'](_0x506e45,function(_0x533392){if(_0x533392[_0x07a4('0x3c')]!==_0x07a4('0x3d')){var _0x4f286e={};_0x4f286e[_0x533392[_0x07a4('0x29')]]={'$like':'%'+_0x1dcdf7[_0x07a4('0x30')][_0x07a4('0x3a')]+'%'};return _0x4f286e;}})});}_0x4cca1d=_['merge']({},_0x4cca1d,_0x1dcdf7[_0x07a4('0x3e')]);var _0x39a3f0={'where':_0x4cca1d[_0x07a4('0x37')]};return db[_0x07a4('0x2b')][_0x07a4('0x1d')](_0x39a3f0)[_0x07a4('0x23')](function(_0x127fc5){_0x4d9308[_0x07a4('0x1d')]=_0x127fc5;if(_0x1dcdf7[_0x07a4('0x30')][_0x07a4('0x3f')]){_0x4cca1d[_0x07a4('0x40')]=[{'all':!![]}];}return db[_0x07a4('0x2b')][_0x07a4('0x41')](_0x4cca1d);})['then'](function(_0x109450){_0x4d9308[_0x07a4('0x42')]=_0x109450;return _0x4d9308;})[_0x07a4('0x23')](respondWithFilteredResult(_0x32452a,_0x4cca1d))['catch'](handleError(_0x32452a,null));};exports['show']=function(_0x25f153,_0x11c304){var _0x106f6d={'raw':![],'where':{'id':_0x25f153[_0x07a4('0x43')]['id']}},_0x297c1e={};_0x297c1e[_0x07a4('0x2e')]=_['keys'](db[_0x07a4('0x2b')][_0x07a4('0x2c')]);_0x297c1e['query']=_[_0x07a4('0x44')](_0x25f153['query']);_0x297c1e[_0x07a4('0x39')]=_[_0x07a4('0x31')](_0x297c1e[_0x07a4('0x2e')],_0x297c1e[_0x07a4('0x30')]);_0x106f6d[_0x07a4('0x32')]=_[_0x07a4('0x31')](_0x297c1e['model'],qs[_0x07a4('0x45')](_0x25f153[_0x07a4('0x30')]['fields']));_0x106f6d[_0x07a4('0x32')]=_0x106f6d[_0x07a4('0x32')][_0x07a4('0x46')]?_0x106f6d[_0x07a4('0x32')]:_0x297c1e['model'];if(_0x25f153[_0x07a4('0x30')][_0x07a4('0x3f')]){_0x106f6d[_0x07a4('0x40')]=[{'all':!![]}];}_0x106f6d=_[_0x07a4('0x3b')]({},_0x106f6d,_0x25f153[_0x07a4('0x3e')]);return db[_0x07a4('0x2b')][_0x07a4('0x47')](_0x106f6d)['then'](handleEntityNotFound(_0x11c304,null))['then'](respondWithResult(_0x11c304,null))['catch'](handleError(_0x11c304,null));};exports['create']=function(_0x26c936,_0x4d264e){return db[_0x07a4('0x2b')]['create'](_0x26c936[_0x07a4('0x48')],{})[_0x07a4('0x23')](function(_0x2d5b42){var _0x3299e7=_0x26c936[_0x07a4('0x49')][_0x07a4('0x25')]({'plain':!![]});if(!_0x3299e7)throw new Error(_0x07a4('0x4a'));if(_0x3299e7['role']===_0x07a4('0x49')){var _0x3ee1da=_0x2d5b42['get']({'plain':!![]});var _0x391185=_0x07a4('0x26');return db[_0x07a4('0x4b')][_0x07a4('0x47')]({'where':{'name':_0x391185,'userProfileId':_0x3299e7[_0x07a4('0x4c')]},'raw':!![]})[_0x07a4('0x23')](function(_0x328584){if(_0x328584&&_0x328584['autoAssociation']===0x0){return db[_0x07a4('0x4d')]['create']({'name':_0x3ee1da[_0x07a4('0x29')],'resourceId':_0x3ee1da['id'],'type':_0x328584[_0x07a4('0x29')],'sectionId':_0x328584['id']},{})[_0x07a4('0x23')](function(){return _0x2d5b42;});}else{return _0x2d5b42;}})['catch'](function(_0x20e06f){logger[_0x07a4('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20e06f);throw _0x20e06f;});}return _0x2d5b42;})[_0x07a4('0x23')](respondWithResult(_0x4d264e,0xc9))[_0x07a4('0x4e')](handleError(_0x4d264e,null));};exports[_0x07a4('0x4f')]=function(_0xb66dcf,_0x512f9a){var _0x4d392f={'where':{'id':_0xb66dcf[_0x07a4('0x43')]['id']}},_0x33d33b={};_0x33d33b[_0x07a4('0x2e')]=_[_0x07a4('0x44')](db['JscriptyProject'][_0x07a4('0x2c')]);_0x4d392f[_0x07a4('0x32')]=_[_0x07a4('0x31')](_0x33d33b[_0x07a4('0x2e')],qs[_0x07a4('0x45')](_0xb66dcf[_0x07a4('0x30')][_0x07a4('0x45')]));_0x4d392f['attributes']=_0x4d392f[_0x07a4('0x32')][_0x07a4('0x46')]?_0x4d392f[_0x07a4('0x32')]:_0x33d33b['model'];if(_0xb66dcf[_0x07a4('0x30')][_0x07a4('0x3f')]){_0x4d392f['include']=[{'all':!![]}];}_0x4d392f=_[_0x07a4('0x3b')]({},_0x4d392f,_0xb66dcf['options']);return db[_0x07a4('0x2b')]['find'](_0x4d392f)[_0x07a4('0x23')](handleEntityNotFound(_0x512f9a,null))[_0x07a4('0x23')](function(_0x2c5efb){if(_0x2c5efb){var _0x3211d8=_0x2c5efb[_0x07a4('0x25')]({'plain':!![]});_0x3211d8=qs[_0x07a4('0x50')](_0x3211d8,['id',_0x07a4('0x51'),_0x07a4('0x52')]);_0xb66dcf[_0x07a4('0x48')]=_[_0x07a4('0x50')](_0xb66dcf[_0x07a4('0x48')],['id','createdAt',_0x07a4('0x52')]);return db[_0x07a4('0x2b')]['create'](_['merge'](_0x3211d8,_0xb66dcf[_0x07a4('0x48')]),{'include':_0xb66dcf['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x4dd550){var _0x800cb7=_0xb66dcf[_0x07a4('0x49')][_0x07a4('0x25')]({'plain':!![]});if(!_0x800cb7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x800cb7[_0x07a4('0x53')]===_0x07a4('0x49')){var _0x55f3f6=_0x4dd550[_0x07a4('0x25')]({'plain':!![]});var _0x264836=_0x07a4('0x26');return db[_0x07a4('0x4b')]['find']({'where':{'name':_0x264836,'userProfileId':_0x800cb7[_0x07a4('0x4c')]},'raw':!![]})[_0x07a4('0x23')](function(_0x4bfe0b){if(_0x4bfe0b&&_0x4bfe0b['autoAssociation']===0x0){return db[_0x07a4('0x4d')][_0x07a4('0x54')]({'name':_0x55f3f6[_0x07a4('0x29')],'resourceId':_0x55f3f6['id'],'type':_0x4bfe0b[_0x07a4('0x29')],'sectionId':_0x4bfe0b['id']},{})[_0x07a4('0x23')](function(){return _0x4dd550;});}else{return _0x4dd550;}})[_0x07a4('0x4e')](function(_0x136d8b){logger[_0x07a4('0x27')](_0x07a4('0x55'),_0x136d8b);throw _0x136d8b;});}return _0x4dd550;});}})[_0x07a4('0x23')](respondWithResult(_0x512f9a,0xc9))[_0x07a4('0x4e')](handleError(_0x512f9a,null));};exports[_0x07a4('0x56')]=function(_0x549281,_0xe58db5){if(_0x549281[_0x07a4('0x48')]['id']){delete _0x549281['body']['id'];}return db['JscriptyProject'][_0x07a4('0x47')]({'where':{'id':_0x549281['params']['id']}})['then'](handleEntityNotFound(_0xe58db5,null))['then'](saveUpdates(_0x549281[_0x07a4('0x48')],null))[_0x07a4('0x23')](respondWithResult(_0xe58db5,null))[_0x07a4('0x4e')](handleError(_0xe58db5,null));};exports[_0x07a4('0x24')]=function(_0x45860e,_0x39857b){return db[_0x07a4('0x2b')][_0x07a4('0x47')]({'where':{'id':_0x45860e[_0x07a4('0x43')]['id']}})[_0x07a4('0x23')](handleEntityNotFound(_0x39857b,null))[_0x07a4('0x23')](removeEntity(_0x39857b,null))[_0x07a4('0x4e')](handleError(_0x39857b,null));};exports[_0x07a4('0x57')]=function(_0x559a52,_0x120662,_0x2003ec){var _0x4880fc={'raw':!![],'where':{}};var _0x4963e1={};var _0x2db9a9={'count':0x0,'rows':[]};return db[_0x07a4('0x2b')][_0x07a4('0x58')]({'where':{'id':_0x559a52[_0x07a4('0x43')]['id']}})[_0x07a4('0x23')](handleEntityNotFound(_0x120662,null))[_0x07a4('0x23')](function(_0x2f4e8c){if(_0x2f4e8c){_0x4963e1[_0x07a4('0x2e')]=_[_0x07a4('0x44')](db[_0x07a4('0x59')]['rawAttributes']);_0x4963e1[_0x07a4('0x30')]=_[_0x07a4('0x44')](_0x559a52[_0x07a4('0x30')]);_0x4963e1[_0x07a4('0x39')]=_[_0x07a4('0x31')](_0x4963e1[_0x07a4('0x2e')],_0x4963e1[_0x07a4('0x30')]);_0x4880fc['attributes']=_['intersection'](_0x4963e1[_0x07a4('0x2e')],qs[_0x07a4('0x45')](_0x559a52[_0x07a4('0x30')][_0x07a4('0x45')]));_0x4880fc['attributes']=_0x4880fc[_0x07a4('0x32')][_0x07a4('0x46')]?_0x4880fc['attributes']:_0x4963e1['model'];if(!_0x559a52['query'][_0x07a4('0x5a')](_0x07a4('0x33'))){_0x4880fc[_0x07a4('0x34')]=qs['limit'](_0x559a52[_0x07a4('0x30')][_0x07a4('0x34')]);_0x4880fc[_0x07a4('0x1b')]=qs[_0x07a4('0x1b')](_0x559a52[_0x07a4('0x30')][_0x07a4('0x1b')]);}_0x4880fc[_0x07a4('0x35')]=qs[_0x07a4('0x36')](_0x559a52['query'][_0x07a4('0x36')]);_0x4880fc['where']=qs[_0x07a4('0x39')](_[_0x07a4('0x38')](_0x559a52[_0x07a4('0x30')],_0x4963e1[_0x07a4('0x39')]));_0x4880fc[_0x07a4('0x37')][_0x07a4('0x5b')]=_0x2f4e8c['id'];if(_0x559a52['query'][_0x07a4('0x3a')]){_0x4880fc['where']=_[_0x07a4('0x3b')](_0x4880fc[_0x07a4('0x37')],{'$or':_[_0x07a4('0x2f')](_0x4880fc[_0x07a4('0x32')],function(_0x1e79e5){var _0x48ffa2={};_0x48ffa2[_0x1e79e5]={'$like':'%'+_0x559a52[_0x07a4('0x30')][_0x07a4('0x3a')]+'%'};return _0x48ffa2;})});}_0x4880fc=_[_0x07a4('0x3b')]({},_0x4880fc,_0x559a52['options']);return db[_0x07a4('0x59')][_0x07a4('0x1d')]({'where':_0x4880fc[_0x07a4('0x37')]})[_0x07a4('0x23')](function(_0x479166){_0x2db9a9[_0x07a4('0x1d')]=_0x479166;if(_0x559a52[_0x07a4('0x30')][_0x07a4('0x3f')]){_0x4880fc[_0x07a4('0x40')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x07a4('0x41')](_0x4880fc);})[_0x07a4('0x23')](function(_0x53fce3){_0x2db9a9[_0x07a4('0x42')]=_0x53fce3;return _0x2db9a9;});}})[_0x07a4('0x23')](respondWithFilteredResult(_0x120662,_0x4880fc))[_0x07a4('0x4e')](handleError(_0x120662,null));};exports[_0x07a4('0x5c')]=function(_0x4c9894,_0x5abea8,_0x48b741){var _0x29e918={'raw':!![],'where':{}};var _0xa32042={};var _0x35b811={'count':0x0,'rows':[]};return db[_0x07a4('0x2b')][_0x07a4('0x58')]({'where':{'id':_0x4c9894['params']['id']}})[_0x07a4('0x23')](handleEntityNotFound(_0x5abea8,null))[_0x07a4('0x23')](function(_0x422183){if(_0x422183){_0xa32042['model']=_[_0x07a4('0x44')](db[_0x07a4('0x5d')][_0x07a4('0x2c')]);_0xa32042[_0x07a4('0x30')]=_['keys'](_0x4c9894['query']);_0xa32042[_0x07a4('0x39')]=_[_0x07a4('0x31')](_0xa32042[_0x07a4('0x2e')],_0xa32042[_0x07a4('0x30')]);_0x29e918[_0x07a4('0x32')]=_[_0x07a4('0x31')](_0xa32042['model'],qs[_0x07a4('0x45')](_0x4c9894['query']['fields']));_0x29e918[_0x07a4('0x32')]=_0x29e918[_0x07a4('0x32')]['length']?_0x29e918[_0x07a4('0x32')]:_0xa32042[_0x07a4('0x2e')];if(!_0x4c9894[_0x07a4('0x30')][_0x07a4('0x5a')](_0x07a4('0x33'))){_0x29e918['limit']=qs[_0x07a4('0x34')](_0x4c9894[_0x07a4('0x30')][_0x07a4('0x34')]);_0x29e918[_0x07a4('0x1b')]=qs[_0x07a4('0x1b')](_0x4c9894['query']['offset']);}_0x29e918['order']=qs[_0x07a4('0x36')](_0x4c9894[_0x07a4('0x30')][_0x07a4('0x36')]);_0x29e918['where']=qs[_0x07a4('0x39')](_[_0x07a4('0x38')](_0x4c9894['query'],_0xa32042['filters']));_0x29e918[_0x07a4('0x37')][_0x07a4('0x5b')]=_0x422183['id'];if(_0x4c9894['query'][_0x07a4('0x3a')]){_0x29e918[_0x07a4('0x37')]=_[_0x07a4('0x3b')](_0x29e918['where'],{'$or':_[_0x07a4('0x2f')](_0x29e918[_0x07a4('0x32')],function(_0x2c57c9){var _0x48a8de={};_0x48a8de[_0x2c57c9]={'$like':'%'+_0x4c9894[_0x07a4('0x30')][_0x07a4('0x3a')]+'%'};return _0x48a8de;})});}_0x29e918=_[_0x07a4('0x3b')]({},_0x29e918,_0x4c9894[_0x07a4('0x3e')]);return db[_0x07a4('0x5d')]['count']({'where':_0x29e918[_0x07a4('0x37')]})[_0x07a4('0x23')](function(_0x5ea80b){_0x35b811[_0x07a4('0x1d')]=_0x5ea80b;if(_0x4c9894[_0x07a4('0x30')]['includeAll']){_0x29e918[_0x07a4('0x40')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x07a4('0x41')](_0x29e918);})[_0x07a4('0x23')](function(_0x5a475e){_0x35b811[_0x07a4('0x42')]=_0x5a475e;return _0x35b811;});}})[_0x07a4('0x23')](respondWithFilteredResult(_0x5abea8,_0x29e918))[_0x07a4('0x4e')](handleError(_0x5abea8,null));};function char(_0x427290){return _0x07a4('0x5e')===typeof _0x427290?String['fromCharCode'][_0x07a4('0x20')](null,arguments):_0x427290;}function needsEncapsulation(_0x756f7f){return!!_0x756f7f&&(_0x756f7f['toString']()[_0x07a4('0x5f')](char(0xd))>=0x0||_0x756f7f['toString']()[_0x07a4('0x5f')](char(0xa))>=0x0||_0x756f7f[_0x07a4('0x60')]()[_0x07a4('0x5f')](char(0x2c))>=0x0||_0x756f7f[_0x07a4('0x60')]()[_0x07a4('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x109b11){var _0x595a53=char(0x22),_0x5e3b72='\x5c'+char(0x22),_0x5edfa6=_0x109b11[_0x07a4('0x60')]()[_0x07a4('0x61')](new RegExp(_0x595a53,'g'),_0x5e3b72);return _0x595a53+_0x5edfa6+_0x595a53;}exports[_0x07a4('0x62')]=function(_0x1720d5,_0x429e27,_0x18e7cf){var _0x45a408,_0x292c2a;var _0x337461={'where':{'ProjectId':_0x1720d5[_0x07a4('0x43')]['id']}};if(_0x1720d5[_0x07a4('0x30')][_0x07a4('0x63')]){_0x337461[_0x07a4('0x37')][_0x07a4('0x64')]=JSON['parse'](_0x1720d5[_0x07a4('0x30')]['startTime']);}return db[_0x07a4('0x59')][_0x07a4('0x41')](_0x337461)[_0x07a4('0x23')](handleEntityNotFound(_0x429e27,null))[_0x07a4('0x23')](function(_0x126d1b){if(_0x126d1b){_0x45a408=_0x126d1b;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0x07a4('0x2f')](_0x45a408,'id')},'ProjectId':_0x1720d5[_0x07a4('0x43')]['id']},'order':_0x07a4('0x65')});}})['then'](handleEntityNotFound(_0x429e27,null))[_0x07a4('0x23')](function(_0x28606f){if(_0x28606f){_0x292c2a=_0x28606f;var _0x58bf03={};for(var _0x121a41=0x0,_0x2f2890=_0x292c2a[_0x07a4('0x46')];_0x121a41<_0x2f2890;_0x121a41++){if(!_0x58bf03['hasOwnProperty'](_0x292c2a[_0x121a41][_0x07a4('0x66')])){_0x58bf03[_0x292c2a[_0x121a41][_0x07a4('0x66')]]=needsEncapsulation(_0x292c2a[_0x121a41]['question'])?encapsulate(_0x292c2a[_0x121a41][_0x07a4('0x67')]):_0x292c2a[_0x121a41][_0x07a4('0x67')];}}var _0x112090=[],_0x1a2f50={};for(var _0x4e67e4=0x0,_0x20ada=_0x45a408['length'];_0x4e67e4<_0x20ada;_0x4e67e4++){_0x1a2f50={'ProjectId':_0x1720d5[_0x07a4('0x43')]['id'],'SessionId':_0x45a408[_0x4e67e4]['id'],'StartTime':moment(_0x45a408[_0x4e67e4][_0x07a4('0x64')])['format'](_0x07a4('0x68'))};for(var _0x78efb9=0x0,_0x4c2495=_0x292c2a[_0x07a4('0x46')];_0x78efb9<_0x4c2495;_0x78efb9++){if(_0x292c2a[_0x78efb9][_0x07a4('0x69')]==_0x45a408[_0x4e67e4]['id']&&_0x58bf03['hasOwnProperty'](_0x292c2a[_0x78efb9]['questionId'])){_0x1a2f50[_0x58bf03[_0x292c2a[_0x78efb9][_0x07a4('0x66')]]]=_0x292c2a[_0x78efb9][_0x07a4('0x6a')];}}for(var _0x9431ad in _0x58bf03){if(!_0x1a2f50['hasOwnProperty'](_0x58bf03[_0x9431ad])){_0x1a2f50[_0x58bf03[_0x9431ad]]=null;}}_0x112090[_0x07a4('0x6b')](_0x1a2f50);}return _0x112090;}})[_0x07a4('0x23')](function(_0x6ef497){if(!_[_0x07a4('0x6c')](_0x6ef497)){var _0x4a388e=toCsv(_0x6ef497);var _0x972a52=Date[_0x07a4('0x6d')]();fs['writeFileSync'](util[_0x07a4('0x6e')](_0x07a4('0x6f'),_0x1720d5[_0x07a4('0x43')]['id'],_0x972a52),_0x4a388e);_0x429e27['setHeader'](_0x07a4('0x70'),'attachment;\x20filename='+util[_0x07a4('0x6e')](_0x07a4('0x71'),_0x1720d5[_0x07a4('0x43')]['id'],_0x972a52));_0x429e27[_0x07a4('0x72')](_0x07a4('0x73'),_0x07a4('0x74'));return _0x429e27[_0x07a4('0x75')](util[_0x07a4('0x6e')](_0x07a4('0x6f'),_0x1720d5[_0x07a4('0x43')]['id'],_0x972a52));}else{return _0x429e27[_0x07a4('0x17')](0xcc);}})['catch'](handleError(_0x429e27,null));}; \ No newline at end of file +var _0xefd7=['catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','clone','options','omit','createdAt','updatedAt','params','getSessions','findOne','JscriptySessionReport','nolimit','getAnswers','JscriptyAnswerReport','order','ProjectId','number','toString','indexOf','replace','getSummary','starttime','parse','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','download','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','Projects','UserProfileResource','end','error','name','send','index','JscriptyProject','rawAttributes','model','query','keys','filters','intersection','attributes','hasOwnProperty','sort','where','pick','filter','map','merge','includeAll','include','findAll','rows','fields','length','find'];(function(_0x298dd7,_0x579273){var _0x995c4a=function(_0xccbb73){while(--_0xccbb73){_0x298dd7['push'](_0x298dd7['shift']());}};_0x995c4a(++_0x579273);}(_0xefd7,0x99));var _0x7efd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xefd7[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7efd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7efd('0x1'));var jsonpatch=require(_0x7efd('0x2'));var rp=require(_0x7efd('0x3'));var moment=require('moment');var BPromise=require(_0x7efd('0x4'));var Mustache=require(_0x7efd('0x5'));var util=require(_0x7efd('0x6'));var path=require(_0x7efd('0x7'));var sox=require('sox');var csv=require(_0x7efd('0x8'));var ejs=require(_0x7efd('0x9'));var fs=require('fs');var fs_extra=require(_0x7efd('0xa'));var _=require(_0x7efd('0xb'));var squel=require(_0x7efd('0xc'));var crypto=require(_0x7efd('0xd'));var jsforce=require(_0x7efd('0xe'));var deskjs=require(_0x7efd('0xf'));var toCsv=require(_0x7efd('0x8'));var querystring=require('querystring');var Papa=require(_0x7efd('0x10'));var Redis=require(_0x7efd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7efd('0x12'));var as=require(_0x7efd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7efd('0x14'))(_0x7efd('0x15'));var utils=require('../../config/utils');var config=require(_0x7efd('0x16'));var licenseUtil=require(_0x7efd('0x17'));var db=require(_0x7efd('0x18'))['db'];function respondWithStatusCode(_0x57269e,_0x5e017c){_0x5e017c=_0x5e017c||0xcc;return function(_0x424da9){if(_0x424da9){return _0x57269e[_0x7efd('0x19')](_0x5e017c);}return _0x57269e[_0x7efd('0x1a')](_0x5e017c)['end']();};}function respondWithResult(_0x17c1f4,_0x37e9f2){_0x37e9f2=_0x37e9f2||0xc8;return function(_0x237323){if(_0x237323){return _0x17c1f4['status'](_0x37e9f2)[_0x7efd('0x1b')](_0x237323);}};}function respondWithFilteredResult(_0x143cb2,_0x5280a2){return function(_0x196674){if(_0x196674){var _0x5affe3=typeof _0x5280a2[_0x7efd('0x1c')]===_0x7efd('0x1d')&&typeof _0x5280a2[_0x7efd('0x1e')]==='undefined';var _0x2a91e1=_0x196674[_0x7efd('0x1f')];var _0x3c0dc2=_0x5affe3?0x0:_0x5280a2[_0x7efd('0x1c')];var _0x47f98a=_0x5affe3?_0x196674['count']:_0x5280a2[_0x7efd('0x1c')]+_0x5280a2['limit'];var _0x58c994;if(_0x47f98a>=_0x2a91e1){_0x47f98a=_0x2a91e1;_0x58c994=0xc8;}else{_0x58c994=0xce;}_0x143cb2[_0x7efd('0x1a')](_0x58c994);return _0x143cb2[_0x7efd('0x20')](_0x7efd('0x21'),_0x3c0dc2+'-'+_0x47f98a+'/'+_0x2a91e1)[_0x7efd('0x1b')](_0x196674);}return null;};}function patchUpdates(_0x5db31e){return function(_0x4330dc){try{jsonpatch[_0x7efd('0x22')](_0x4330dc,_0x5db31e,!![]);}catch(_0x307568){return BPromise['reject'](_0x307568);}return _0x4330dc[_0x7efd('0x23')]();};}function saveUpdates(_0x45cc61,_0xbdd9f8){return function(_0x230714){if(_0x230714){return _0x230714[_0x7efd('0x24')](_0x45cc61)['then'](function(_0xd04f56){return _0xd04f56;});}return null;};}function removeEntity(_0x1dc48c,_0x127c86){return function(_0x35bdb6){if(_0x35bdb6){return _0x35bdb6[_0x7efd('0x25')]()[_0x7efd('0x26')](function(){var _0x3e3b74=_0x35bdb6[_0x7efd('0x27')]({'plain':!![]});var _0x4e604a=_0x7efd('0x28');return db[_0x7efd('0x29')][_0x7efd('0x25')]({'where':{'type':_0x4e604a,'resourceId':_0x3e3b74['id']}})['then'](function(){return _0x35bdb6;});})[_0x7efd('0x26')](function(){_0x1dc48c[_0x7efd('0x1a')](0xcc)[_0x7efd('0x2a')]();});}};}function handleEntityNotFound(_0x500b6e,_0x433588){return function(_0x563b1f){if(!_0x563b1f){_0x500b6e[_0x7efd('0x19')](0x194);}return _0x563b1f;};}function handleError(_0x81309e,_0x319feb){_0x319feb=_0x319feb||0x1f4;return function(_0x4d3c68){logger[_0x7efd('0x2b')](_0x4d3c68['stack']);if(_0x4d3c68['name']){delete _0x4d3c68[_0x7efd('0x2c')];}_0x81309e[_0x7efd('0x1a')](_0x319feb)[_0x7efd('0x2d')](_0x4d3c68);};}exports[_0x7efd('0x2e')]=function(_0x332967,_0x26cbee){var _0x38fa07={},_0x2fa66e={},_0x123c11={'count':0x0,'rows':[]};var _0x43aa5b=_['map'](db[_0x7efd('0x2f')][_0x7efd('0x30')],function(_0x13b057){return{'name':_0x13b057['fieldName'],'type':_0x13b057['type']['key']};});_0x2fa66e[_0x7efd('0x31')]=_['map'](_0x43aa5b,_0x7efd('0x2c'));_0x2fa66e[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x332967[_0x7efd('0x32')]);_0x2fa66e[_0x7efd('0x34')]=_[_0x7efd('0x35')](_0x2fa66e['model'],_0x2fa66e[_0x7efd('0x32')]);_0x38fa07['attributes']=_[_0x7efd('0x35')](_0x2fa66e[_0x7efd('0x31')],qs['fields'](_0x332967['query']['fields']));_0x38fa07['attributes']=_0x38fa07[_0x7efd('0x36')]['length']?_0x38fa07['attributes']:_0x2fa66e[_0x7efd('0x31')];if(!_0x332967[_0x7efd('0x32')][_0x7efd('0x37')]('nolimit')){_0x38fa07[_0x7efd('0x1e')]=qs[_0x7efd('0x1e')](_0x332967[_0x7efd('0x32')][_0x7efd('0x1e')]);_0x38fa07[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x332967[_0x7efd('0x32')][_0x7efd('0x1c')]);}_0x38fa07['order']=qs[_0x7efd('0x38')](_0x332967[_0x7efd('0x32')]['sort']);_0x38fa07[_0x7efd('0x39')]=qs['filters'](_[_0x7efd('0x3a')](_0x332967[_0x7efd('0x32')],_0x2fa66e['filters']),_0x43aa5b);if(_0x332967['query'][_0x7efd('0x3b')]){_0x38fa07[_0x7efd('0x39')]=_['merge'](_0x38fa07[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x43aa5b,function(_0x13481c){if(_0x13481c['type']!=='VIRTUAL'){var _0x57aa0b={};_0x57aa0b[_0x13481c[_0x7efd('0x2c')]]={'$like':'%'+_0x332967[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x57aa0b;}})});}_0x38fa07=_[_0x7efd('0x3d')]({},_0x38fa07,_0x332967['options']);var _0x53a63b={'where':_0x38fa07['where']};return db[_0x7efd('0x2f')][_0x7efd('0x1f')](_0x53a63b)['then'](function(_0x2ba456){_0x123c11['count']=_0x2ba456;if(_0x332967[_0x7efd('0x32')][_0x7efd('0x3e')]){_0x38fa07[_0x7efd('0x3f')]=[{'all':!![]}];}return db[_0x7efd('0x2f')][_0x7efd('0x40')](_0x38fa07);})[_0x7efd('0x26')](function(_0x34597a){_0x123c11[_0x7efd('0x41')]=_0x34597a;return _0x123c11;})[_0x7efd('0x26')](respondWithFilteredResult(_0x26cbee,_0x38fa07))['catch'](handleError(_0x26cbee,null));};exports['show']=function(_0x1fdd69,_0x13a533){var _0x5a47ac={'raw':![],'where':{'id':_0x1fdd69['params']['id']}},_0x47e86e={};_0x47e86e['model']=_[_0x7efd('0x33')](db['JscriptyProject']['rawAttributes']);_0x47e86e['query']=_[_0x7efd('0x33')](_0x1fdd69['query']);_0x47e86e['filters']=_[_0x7efd('0x35')](_0x47e86e[_0x7efd('0x31')],_0x47e86e['query']);_0x5a47ac[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x47e86e[_0x7efd('0x31')],qs[_0x7efd('0x42')](_0x1fdd69[_0x7efd('0x32')][_0x7efd('0x42')]));_0x5a47ac['attributes']=_0x5a47ac['attributes'][_0x7efd('0x43')]?_0x5a47ac[_0x7efd('0x36')]:_0x47e86e[_0x7efd('0x31')];if(_0x1fdd69['query'][_0x7efd('0x3e')]){_0x5a47ac[_0x7efd('0x3f')]=[{'all':!![]}];}_0x5a47ac=_[_0x7efd('0x3d')]({},_0x5a47ac,_0x1fdd69['options']);return db[_0x7efd('0x2f')][_0x7efd('0x44')](_0x5a47ac)[_0x7efd('0x26')](handleEntityNotFound(_0x13a533,null))[_0x7efd('0x26')](respondWithResult(_0x13a533,null))[_0x7efd('0x45')](handleError(_0x13a533,null));};exports[_0x7efd('0x46')]=function(_0x5b41dc,_0x320b6d){return db[_0x7efd('0x2f')][_0x7efd('0x46')](_0x5b41dc[_0x7efd('0x47')],{})[_0x7efd('0x26')](function(_0x306a44){var _0x2c1d24=_0x5b41dc[_0x7efd('0x48')]['get']({'plain':!![]});if(!_0x2c1d24)throw new Error(_0x7efd('0x49'));if(_0x2c1d24[_0x7efd('0x4a')]==='user'){var _0x42d37a=_0x306a44[_0x7efd('0x27')]({'plain':!![]});var _0x30706b=_0x7efd('0x28');return db[_0x7efd('0x4b')][_0x7efd('0x44')]({'where':{'name':_0x30706b,'userProfileId':_0x2c1d24['userProfileId']},'raw':!![]})[_0x7efd('0x26')](function(_0x25099e){if(_0x25099e&&_0x25099e[_0x7efd('0x4c')]===0x0){return db[_0x7efd('0x29')][_0x7efd('0x46')]({'name':_0x42d37a[_0x7efd('0x2c')],'resourceId':_0x42d37a['id'],'type':_0x25099e[_0x7efd('0x2c')],'sectionId':_0x25099e['id']},{})[_0x7efd('0x26')](function(){return _0x306a44;});}else{return _0x306a44;}})[_0x7efd('0x45')](function(_0x40773a){logger[_0x7efd('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40773a);throw _0x40773a;});}return _0x306a44;})[_0x7efd('0x26')](respondWithResult(_0x320b6d,0xc9))['catch'](handleError(_0x320b6d,null));};exports[_0x7efd('0x4d')]=function(_0x53e3f9,_0x4b8e29){var _0x48e111={'where':{'id':_0x53e3f9['params']['id']}},_0x4d01b9={};_0x4d01b9['model']=_['keys'](db['JscriptyProject'][_0x7efd('0x30')]);_0x48e111[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x4d01b9[_0x7efd('0x31')],qs[_0x7efd('0x42')](_0x53e3f9[_0x7efd('0x32')][_0x7efd('0x42')]));_0x48e111[_0x7efd('0x36')]=_0x48e111[_0x7efd('0x36')][_0x7efd('0x43')]?_0x48e111['attributes']:_0x4d01b9[_0x7efd('0x31')];if(_0x53e3f9[_0x7efd('0x32')]['includeAll']){_0x48e111['include']=[{'all':!![]}];}_0x48e111=_[_0x7efd('0x3d')]({},_0x48e111,_0x53e3f9[_0x7efd('0x4e')]);return db['JscriptyProject']['find'](_0x48e111)['then'](handleEntityNotFound(_0x4b8e29,null))[_0x7efd('0x26')](function(_0x548aa1){if(_0x548aa1){var _0x4a31c7=_0x548aa1['get']({'plain':!![]});_0x4a31c7=qs[_0x7efd('0x4f')](_0x4a31c7,['id',_0x7efd('0x50'),_0x7efd('0x51')]);_0x53e3f9[_0x7efd('0x47')]=_[_0x7efd('0x4f')](_0x53e3f9[_0x7efd('0x47')],['id',_0x7efd('0x50'),_0x7efd('0x51')]);return db[_0x7efd('0x2f')]['create'](_['merge'](_0x4a31c7,_0x53e3f9['body']),{'include':_0x53e3f9['query'][_0x7efd('0x3e')]?[{'all':!![]}]:undefined})[_0x7efd('0x26')](function(_0x39961c){var _0x54ba4d=_0x53e3f9[_0x7efd('0x48')]['get']({'plain':!![]});if(!_0x54ba4d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54ba4d[_0x7efd('0x4a')]==='user'){var _0x222b9e=_0x39961c[_0x7efd('0x27')]({'plain':!![]});var _0x5c126f=_0x7efd('0x28');return db['UserProfileSection'][_0x7efd('0x44')]({'where':{'name':_0x5c126f,'userProfileId':_0x54ba4d['userProfileId']},'raw':!![]})[_0x7efd('0x26')](function(_0x241709){if(_0x241709&&_0x241709[_0x7efd('0x4c')]===0x0){return db[_0x7efd('0x29')][_0x7efd('0x46')]({'name':_0x222b9e[_0x7efd('0x2c')],'resourceId':_0x222b9e['id'],'type':_0x241709['name'],'sectionId':_0x241709['id']},{})[_0x7efd('0x26')](function(){return _0x39961c;});}else{return _0x39961c;}})['catch'](function(_0x32e001){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32e001);throw _0x32e001;});}return _0x39961c;});}})[_0x7efd('0x26')](respondWithResult(_0x4b8e29,0xc9))[_0x7efd('0x45')](handleError(_0x4b8e29,null));};exports[_0x7efd('0x24')]=function(_0x162721,_0xc0fb5c){if(_0x162721['body']['id']){delete _0x162721[_0x7efd('0x47')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x162721[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0xc0fb5c,null))[_0x7efd('0x26')](saveUpdates(_0x162721[_0x7efd('0x47')],null))['then'](respondWithResult(_0xc0fb5c,null))[_0x7efd('0x45')](handleError(_0xc0fb5c,null));};exports[_0x7efd('0x25')]=function(_0x260888,_0x16737c){return db[_0x7efd('0x2f')][_0x7efd('0x44')]({'where':{'id':_0x260888[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x16737c,null))[_0x7efd('0x26')](removeEntity(_0x16737c,null))[_0x7efd('0x45')](handleError(_0x16737c,null));};exports[_0x7efd('0x53')]=function(_0x802460,_0x1a9232,_0x3fdbbc){var _0x5636dd={'raw':!![],'where':{}};var _0x58a6c2={};var _0x1175b2={'count':0x0,'rows':[]};return db[_0x7efd('0x2f')][_0x7efd('0x54')]({'where':{'id':_0x802460[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x1a9232,null))[_0x7efd('0x26')](function(_0x513de5){if(_0x513de5){_0x58a6c2[_0x7efd('0x31')]=_[_0x7efd('0x33')](db[_0x7efd('0x55')]['rawAttributes']);_0x58a6c2[_0x7efd('0x32')]=_['keys'](_0x802460[_0x7efd('0x32')]);_0x58a6c2['filters']=_[_0x7efd('0x35')](_0x58a6c2[_0x7efd('0x31')],_0x58a6c2['query']);_0x5636dd[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x58a6c2['model'],qs['fields'](_0x802460['query'][_0x7efd('0x42')]));_0x5636dd['attributes']=_0x5636dd[_0x7efd('0x36')][_0x7efd('0x43')]?_0x5636dd['attributes']:_0x58a6c2[_0x7efd('0x31')];if(!_0x802460[_0x7efd('0x32')][_0x7efd('0x37')](_0x7efd('0x56'))){_0x5636dd[_0x7efd('0x1e')]=qs['limit'](_0x802460[_0x7efd('0x32')][_0x7efd('0x1e')]);_0x5636dd[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x802460['query']['offset']);}_0x5636dd['order']=qs[_0x7efd('0x38')](_0x802460[_0x7efd('0x32')][_0x7efd('0x38')]);_0x5636dd['where']=qs[_0x7efd('0x34')](_[_0x7efd('0x3a')](_0x802460['query'],_0x58a6c2[_0x7efd('0x34')]));_0x5636dd['where']['ProjectId']=_0x513de5['id'];if(_0x802460[_0x7efd('0x32')]['filter']){_0x5636dd['where']=_[_0x7efd('0x3d')](_0x5636dd['where'],{'$or':_[_0x7efd('0x3c')](_0x5636dd[_0x7efd('0x36')],function(_0x1831d6){var _0x32d013={};_0x32d013[_0x1831d6]={'$like':'%'+_0x802460[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x32d013;})});}_0x5636dd=_[_0x7efd('0x3d')]({},_0x5636dd,_0x802460[_0x7efd('0x4e')]);return db[_0x7efd('0x55')][_0x7efd('0x1f')]({'where':_0x5636dd[_0x7efd('0x39')]})[_0x7efd('0x26')](function(_0x1281f7){_0x1175b2[_0x7efd('0x1f')]=_0x1281f7;if(_0x802460[_0x7efd('0x32')]['includeAll']){_0x5636dd[_0x7efd('0x3f')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x7efd('0x40')](_0x5636dd);})[_0x7efd('0x26')](function(_0x338df0){_0x1175b2[_0x7efd('0x41')]=_0x338df0;return _0x1175b2;});}})['then'](respondWithFilteredResult(_0x1a9232,_0x5636dd))[_0x7efd('0x45')](handleError(_0x1a9232,null));};exports[_0x7efd('0x57')]=function(_0x332383,_0xd864b,_0x3e7efb){var _0x1a541f={'raw':!![],'where':{}};var _0x5833a2={};var _0x46bf7f={'count':0x0,'rows':[]};return db[_0x7efd('0x2f')][_0x7efd('0x54')]({'where':{'id':_0x332383[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0xd864b,null))['then'](function(_0x453fef){if(_0x453fef){_0x5833a2[_0x7efd('0x31')]=_[_0x7efd('0x33')](db[_0x7efd('0x58')][_0x7efd('0x30')]);_0x5833a2[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x332383[_0x7efd('0x32')]);_0x5833a2[_0x7efd('0x34')]=_['intersection'](_0x5833a2[_0x7efd('0x31')],_0x5833a2['query']);_0x1a541f[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x5833a2['model'],qs[_0x7efd('0x42')](_0x332383['query'][_0x7efd('0x42')]));_0x1a541f['attributes']=_0x1a541f[_0x7efd('0x36')][_0x7efd('0x43')]?_0x1a541f[_0x7efd('0x36')]:_0x5833a2[_0x7efd('0x31')];if(!_0x332383[_0x7efd('0x32')]['hasOwnProperty'](_0x7efd('0x56'))){_0x1a541f[_0x7efd('0x1e')]=qs[_0x7efd('0x1e')](_0x332383[_0x7efd('0x32')][_0x7efd('0x1e')]);_0x1a541f[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x332383[_0x7efd('0x32')][_0x7efd('0x1c')]);}_0x1a541f[_0x7efd('0x59')]=qs[_0x7efd('0x38')](_0x332383[_0x7efd('0x32')]['sort']);_0x1a541f[_0x7efd('0x39')]=qs[_0x7efd('0x34')](_['pick'](_0x332383['query'],_0x5833a2[_0x7efd('0x34')]));_0x1a541f[_0x7efd('0x39')][_0x7efd('0x5a')]=_0x453fef['id'];if(_0x332383['query'][_0x7efd('0x3b')]){_0x1a541f[_0x7efd('0x39')]=_[_0x7efd('0x3d')](_0x1a541f[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x1a541f[_0x7efd('0x36')],function(_0x424d8d){var _0x5d5028={};_0x5d5028[_0x424d8d]={'$like':'%'+_0x332383[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x5d5028;})});}_0x1a541f=_[_0x7efd('0x3d')]({},_0x1a541f,_0x332383[_0x7efd('0x4e')]);return db['JscriptyAnswerReport'][_0x7efd('0x1f')]({'where':_0x1a541f['where']})[_0x7efd('0x26')](function(_0xbecabd){_0x46bf7f[_0x7efd('0x1f')]=_0xbecabd;if(_0x332383['query'][_0x7efd('0x3e')]){_0x1a541f[_0x7efd('0x3f')]=[{'all':!![]}];}return db[_0x7efd('0x58')][_0x7efd('0x40')](_0x1a541f);})[_0x7efd('0x26')](function(_0x4c31aa){_0x46bf7f['rows']=_0x4c31aa;return _0x46bf7f;});}})[_0x7efd('0x26')](respondWithFilteredResult(_0xd864b,_0x1a541f))[_0x7efd('0x45')](handleError(_0xd864b,null));};function char(_0x4b7a54){return _0x7efd('0x5b')===typeof _0x4b7a54?String['fromCharCode'][_0x7efd('0x22')](null,arguments):_0x4b7a54;}function needsEncapsulation(_0x1601a6){return!!_0x1601a6&&(_0x1601a6[_0x7efd('0x5c')]()[_0x7efd('0x5d')](char(0xd))>=0x0||_0x1601a6[_0x7efd('0x5c')]()[_0x7efd('0x5d')](char(0xa))>=0x0||_0x1601a6['toString']()[_0x7efd('0x5d')](char(0x2c))>=0x0||_0x1601a6[_0x7efd('0x5c')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x5ae229){var _0x23f820=char(0x22),_0x53b45a='\x5c'+char(0x22),_0x10667e=_0x5ae229[_0x7efd('0x5c')]()[_0x7efd('0x5e')](new RegExp(_0x23f820,'g'),_0x53b45a);return _0x23f820+_0x10667e+_0x23f820;}exports[_0x7efd('0x5f')]=function(_0x1397f5,_0x3361cd,_0x4c0809){var _0x50d98b,_0x20ec46;var _0x27fc3b={'where':{'ProjectId':_0x1397f5[_0x7efd('0x52')]['id']}};if(_0x1397f5[_0x7efd('0x32')]['startTime']){_0x27fc3b[_0x7efd('0x39')][_0x7efd('0x60')]=JSON[_0x7efd('0x61')](_0x1397f5[_0x7efd('0x32')]['startTime']);}return db[_0x7efd('0x55')][_0x7efd('0x40')](_0x27fc3b)[_0x7efd('0x26')](handleEntityNotFound(_0x3361cd,null))[_0x7efd('0x26')](function(_0x125a62){if(_0x125a62){_0x50d98b=_0x125a62;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0x7efd('0x3c')](_0x50d98b,'id')},'ProjectId':_0x1397f5[_0x7efd('0x52')]['id']},'order':_0x7efd('0x62')});}})[_0x7efd('0x26')](handleEntityNotFound(_0x3361cd,null))[_0x7efd('0x26')](function(_0x9cd2a){if(_0x9cd2a){_0x20ec46=_0x9cd2a;var _0x361016={};for(var _0x1c12b8=0x0,_0x5c384e=_0x20ec46[_0x7efd('0x43')];_0x1c12b8<_0x5c384e;_0x1c12b8++){if(!_0x361016[_0x7efd('0x37')](_0x20ec46[_0x1c12b8][_0x7efd('0x63')])){_0x361016[_0x20ec46[_0x1c12b8][_0x7efd('0x63')]]=needsEncapsulation(_0x20ec46[_0x1c12b8][_0x7efd('0x64')])?encapsulate(_0x20ec46[_0x1c12b8][_0x7efd('0x64')]):_0x20ec46[_0x1c12b8]['question'];}}var _0x4a7c7d=[],_0x21d200={};for(var _0x2b09b0=0x0,_0x263eb5=_0x50d98b[_0x7efd('0x43')];_0x2b09b0<_0x263eb5;_0x2b09b0++){_0x21d200={'ProjectId':_0x1397f5[_0x7efd('0x52')]['id'],'SessionId':_0x50d98b[_0x2b09b0]['id'],'StartTime':moment(_0x50d98b[_0x2b09b0][_0x7efd('0x60')])['format'](_0x7efd('0x65'))};for(var _0x1be505=0x0,_0x4308d5=_0x20ec46['length'];_0x1be505<_0x4308d5;_0x1be505++){if(_0x20ec46[_0x1be505][_0x7efd('0x66')]==_0x50d98b[_0x2b09b0]['id']&&_0x361016[_0x7efd('0x37')](_0x20ec46[_0x1be505][_0x7efd('0x63')])){_0x21d200[_0x361016[_0x20ec46[_0x1be505][_0x7efd('0x63')]]]=_0x20ec46[_0x1be505]['answer'];}}for(var _0x5ed761 in _0x361016){if(!_0x21d200[_0x7efd('0x37')](_0x361016[_0x5ed761])){_0x21d200[_0x361016[_0x5ed761]]=null;}}_0x4a7c7d[_0x7efd('0x67')](_0x21d200);}return _0x4a7c7d;}})[_0x7efd('0x26')](function(_0x3beb7a){if(!_[_0x7efd('0x68')](_0x3beb7a)){var _0x5ab0a5=toCsv(_0x3beb7a);var _0x1c1120=Date['now']();fs['writeFileSync'](util[_0x7efd('0x69')](_0x7efd('0x6a'),_0x1397f5[_0x7efd('0x52')]['id'],_0x1c1120),_0x5ab0a5);_0x3361cd[_0x7efd('0x6b')](_0x7efd('0x6c'),_0x7efd('0x6d')+util[_0x7efd('0x69')]('Jscripty_Project_%d_Summary_%s.csv',_0x1397f5[_0x7efd('0x52')]['id'],_0x1c1120));_0x3361cd[_0x7efd('0x6b')]('Content-type','text/csv');return _0x3361cd[_0x7efd('0x6e')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1397f5[_0x7efd('0x52')]['id'],_0x1c1120));}else{return _0x3361cd[_0x7efd('0x19')](0xcc);}})[_0x7efd('0x45')](handleError(_0x3361cd,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 5a7d3d5..3c27bb4 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 _0xa990=['path','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x535c9e,_0x1344b0){var _0x2f426e=function(_0x42b816){while(--_0x42b816){_0x535c9e['push'](_0x535c9e['shift']());}};_0x2f426e(++_0x1344b0);}(_0xa990,0xc9));var _0x0a99=function(_0x2729b8,_0x490775){_0x2729b8=_0x2729b8-0x0;var _0x485a8e=_0xa990[_0x2729b8];return _0x485a8e;};'use strict';var _=require(_0x0a99('0x0'));var util=require(_0x0a99('0x1'));var logger=require(_0x0a99('0x2'))(_0x0a99('0x3'));var moment=require(_0x0a99('0x4'));var BPromise=require(_0x0a99('0x5'));var rp=require(_0x0a99('0x6'));var fs=require('fs');var path=require(_0x0a99('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0a99('0x8'));module[_0x0a99('0x9')]=function(_0xfdb594,_0x320560){return _0xfdb594[_0x0a99('0xa')](_0x0a99('0xb'),attributes,{'tableName':_0x0a99('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5292=['bluebird','request-promise','path','rimraf','./jscriptyProject.attributes','define','JscriptyProject','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5292,0xf7));var _0x2529=function(_0x2c4bc3,_0x34f08b){_0x2c4bc3=_0x2c4bc3-0x0;var _0x31ca59=_0x5292[_0x2c4bc3];return _0x31ca59;};'use strict';var _=require(_0x2529('0x0'));var util=require(_0x2529('0x1'));var logger=require('../../config/logger')(_0x2529('0x2'));var moment=require('moment');var BPromise=require(_0x2529('0x3'));var rp=require(_0x2529('0x4'));var fs=require('fs');var path=require(_0x2529('0x5'));var rimraf=require(_0x2529('0x6'));var config=require('../../config/environment');var attributes=require(_0x2529('0x7'));module['exports']=function(_0x4c9b4c,_0x4e7a9e){return _0x4c9b4c[_0x2529('0x8')](_0x2529('0x9'),attributes,{'tableName':'jscripty_projects','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 b839c47..b4433c4 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3a04c6,_0x12a482){var _0xf4131a=function(_0x413ea2){while(--_0x413ea2){_0x3a04c6['push'](_0x3a04c6['shift']());}};_0xf4131a(++_0x12a482);}(_0xaa88,0x137));var _0x8aa8=function(_0x5d6e35,_0x4d1ac0){_0x5d6e35=_0x5d6e35-0x0;var _0x5d7ada=_0xaa88[_0x5d6e35];return _0x5d7ada;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xac4a,0x13f));var _0xaac4=function(_0x113a59,_0x5d635e){_0x113a59=_0x113a59-0x0;var _0x1204ba=_0xac4a[_0x113a59];return _0x1204ba;};'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 diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 0ed2b45..efac821 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 _0xfbd3=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','isAuthenticated','show','post','create','put','/:id','delete'];(function(_0x1db306,_0x19256a){var _0x15b19b=function(_0x4fa13d){while(--_0x4fa13d){_0x1db306['push'](_0x1db306['shift']());}};_0x15b19b(++_0x19256a);}(_0xfbd3,0x14c));var _0x3fbd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfbd3[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x3fbd('0x0'));var util=require('util');var path=require(_0x3fbd('0x1'));var timeout=require(_0x3fbd('0x2'));var express=require(_0x3fbd('0x3'));var router=express[_0x3fbd('0x4')]();var fs_extra=require(_0x3fbd('0x5'));var auth=require(_0x3fbd('0x6'));var interaction=require(_0x3fbd('0x7'));var config=require(_0x3fbd('0x8'));var controller=require('./jscriptyQuestionReport.controller');router[_0x3fbd('0x9')]('/',auth['isAuthenticated'](),controller[_0x3fbd('0xa')]);router[_0x3fbd('0x9')](_0x3fbd('0xb'),auth['isAuthenticated'](),controller[_0x3fbd('0xc')]);router['get']('/:id',auth[_0x3fbd('0xd')](),controller[_0x3fbd('0xe')]);router[_0x3fbd('0xf')]('/',auth[_0x3fbd('0xd')](),controller[_0x3fbd('0x10')]);router[_0x3fbd('0x11')](_0x3fbd('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x3fbd('0x13')](_0x3fbd('0x12'),auth[_0x3fbd('0xd')](),controller[_0x3fbd('0x14')]);module[_0x3fbd('0x15')]=router; \ No newline at end of file +var _0x4e52=['show','post','create','put','/:id','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x3b7b8a,_0x52c3b0){var _0x441206=function(_0x5d34d3){while(--_0x5d34d3){_0x3b7b8a['push'](_0x3b7b8a['shift']());}};_0x441206(++_0x52c3b0);}(_0x4e52,0xf0));var _0x24e5=function(_0x5417ca,_0x54e9ec){_0x5417ca=_0x5417ca-0x0;var _0x4c978d=_0x4e52[_0x5417ca];return _0x4c978d;};'use strict';var multer=require('multer');var util=require(_0x24e5('0x0'));var path=require(_0x24e5('0x1'));var timeout=require(_0x24e5('0x2'));var express=require(_0x24e5('0x3'));var router=express[_0x24e5('0x4')]();var fs_extra=require(_0x24e5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x24e5('0x6'));var config=require(_0x24e5('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0x24e5('0x8')]('/',auth[_0x24e5('0x9')](),controller[_0x24e5('0xa')]);router['get']('/describe',auth[_0x24e5('0x9')](),controller[_0x24e5('0xb')]);router[_0x24e5('0x8')]('/:id',auth[_0x24e5('0x9')](),controller[_0x24e5('0xc')]);router[_0x24e5('0xd')]('/',auth[_0x24e5('0x9')](),controller[_0x24e5('0xe')]);router[_0x24e5('0xf')](_0x24e5('0x10'),auth[_0x24e5('0x9')](),controller['update']);router['delete'](_0x24e5('0x10'),auth[_0x24e5('0x9')](),controller[_0x24e5('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index e23034e..ea264c0 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(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x7a54,0x106));var _0x47a5=function(_0x3bce6f,_0x14dd5e){_0x3bce6f=_0x3bce6f-0x0;var _0x1327cc=_0x7a54[_0x3bce6f];return _0x1327cc;};'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(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7a54,0x106));var _0x47a5=function(_0x21ac85,_0x217c92){_0x21ac85=_0x21ac85-0x0;var _0x502142=_0x7a54[_0x21ac85];return _0x502142;};'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 ab0e31c..9ec5cab 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 _0xb997=['fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','merge','VIRTUAL','includeAll','include','JscriptyQuestionReport','findAll','rows','catch','show','params','rawAttributes','options','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','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map'];(function(_0x338990,_0x4755d9){var _0x14f156=function(_0xfb48d5){while(--_0xfb48d5){_0x338990['push'](_0x338990['shift']());}};_0x14f156(++_0x4755d9);}(_0xb997,0xb8));var _0x7b99=function(_0x1e0144,_0x1528e3){_0x1e0144=_0x1e0144-0x0;var _0x172a14=_0xb997[_0x1e0144];return _0x172a14;};'use strict';var emlformat=require(_0x7b99('0x0'));var rimraf=require(_0x7b99('0x1'));var zipdir=require(_0x7b99('0x2'));var jsonpatch=require(_0x7b99('0x3'));var rp=require(_0x7b99('0x4'));var moment=require(_0x7b99('0x5'));var BPromise=require(_0x7b99('0x6'));var Mustache=require(_0x7b99('0x7'));var util=require(_0x7b99('0x8'));var path=require(_0x7b99('0x9'));var sox=require(_0x7b99('0xa'));var csv=require(_0x7b99('0xb'));var ejs=require(_0x7b99('0xc'));var fs=require('fs');var fs_extra=require(_0x7b99('0xd'));var _=require(_0x7b99('0xe'));var squel=require('squel');var crypto=require(_0x7b99('0xf'));var jsforce=require(_0x7b99('0x10'));var deskjs=require(_0x7b99('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7b99('0x12'));var Redis=require('ioredis');var authService=require(_0x7b99('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7b99('0x14'));var hardwareService=require(_0x7b99('0x15'));var logger=require(_0x7b99('0x16'))(_0x7b99('0x17'));var utils=require('../../config/utils');var config=require(_0x7b99('0x18'));var licenseUtil=require(_0x7b99('0x19'));var db=require(_0x7b99('0x1a'))['db'];function respondWithStatusCode(_0x243a0a,_0x4699f9){_0x4699f9=_0x4699f9||0xcc;return function(_0x4034ac){if(_0x4034ac){return _0x243a0a[_0x7b99('0x1b')](_0x4699f9);}return _0x243a0a[_0x7b99('0x1c')](_0x4699f9)[_0x7b99('0x1d')]();};}function respondWithResult(_0x4a5e86,_0x564e36){_0x564e36=_0x564e36||0xc8;return function(_0x46b252){if(_0x46b252){return _0x4a5e86[_0x7b99('0x1c')](_0x564e36)[_0x7b99('0x1e')](_0x46b252);}};}function respondWithFilteredResult(_0x77688f,_0x121934){return function(_0x3feae4){if(_0x3feae4){var _0x2366a1=typeof _0x121934[_0x7b99('0x1f')]===_0x7b99('0x20')&&typeof _0x121934['limit']==='undefined';var _0x482fc1=_0x3feae4[_0x7b99('0x21')];var _0x16fd9f=_0x2366a1?0x0:_0x121934['offset'];var _0x2bcce5=_0x2366a1?_0x3feae4[_0x7b99('0x21')]:_0x121934[_0x7b99('0x1f')]+_0x121934[_0x7b99('0x22')];var _0x3fae28;if(_0x2bcce5>=_0x482fc1){_0x2bcce5=_0x482fc1;_0x3fae28=0xc8;}else{_0x3fae28=0xce;}_0x77688f[_0x7b99('0x1c')](_0x3fae28);return _0x77688f[_0x7b99('0x23')](_0x7b99('0x24'),_0x16fd9f+'-'+_0x2bcce5+'/'+_0x482fc1)[_0x7b99('0x1e')](_0x3feae4);}return null;};}function patchUpdates(_0x7191a0){return function(_0x703734){try{jsonpatch[_0x7b99('0x25')](_0x703734,_0x7191a0,!![]);}catch(_0x2a78e2){return BPromise[_0x7b99('0x26')](_0x2a78e2);}return _0x703734['save']();};}function saveUpdates(_0x7f5ee8,_0x22a027){return function(_0x25bdc2){if(_0x25bdc2){return _0x25bdc2[_0x7b99('0x27')](_0x7f5ee8)[_0x7b99('0x28')](function(_0x4391c2){return _0x4391c2;});}return null;};}function removeEntity(_0x4b94b2,_0x3e90d2){return function(_0x187946){if(_0x187946){return _0x187946[_0x7b99('0x29')]()['then'](function(){_0x4b94b2[_0x7b99('0x1c')](0xcc)[_0x7b99('0x1d')]();});}};}function handleEntityNotFound(_0xab279c,_0x3d735a){return function(_0x2dc51c){if(!_0x2dc51c){_0xab279c[_0x7b99('0x1b')](0x194);}return _0x2dc51c;};}function handleError(_0x33aa12,_0x3ce087){_0x3ce087=_0x3ce087||0x1f4;return function(_0x5cdc8b){logger[_0x7b99('0x2a')](_0x5cdc8b[_0x7b99('0x2b')]);if(_0x5cdc8b['name']){delete _0x5cdc8b[_0x7b99('0x2c')];}_0x33aa12[_0x7b99('0x1c')](_0x3ce087)[_0x7b99('0x2d')](_0x5cdc8b);};}exports['index']=function(_0x373a42,_0x3839c4){var _0x135a97={},_0x569676={},_0x82abd1={'count':0x0,'rows':[]};var _0x368eda=_[_0x7b99('0x2e')](db['JscriptyQuestionReport']['rawAttributes'],function(_0x432e87){return{'name':_0x432e87[_0x7b99('0x2f')],'type':_0x432e87[_0x7b99('0x30')][_0x7b99('0x31')]};});_0x569676[_0x7b99('0x32')]=_[_0x7b99('0x2e')](_0x368eda,_0x7b99('0x2c'));_0x569676[_0x7b99('0x33')]=_[_0x7b99('0x34')](_0x373a42[_0x7b99('0x33')]);_0x569676[_0x7b99('0x35')]=_[_0x7b99('0x36')](_0x569676[_0x7b99('0x32')],_0x569676[_0x7b99('0x33')]);_0x135a97['attributes']=_[_0x7b99('0x36')](_0x569676['model'],qs[_0x7b99('0x37')](_0x373a42[_0x7b99('0x33')][_0x7b99('0x37')]));_0x135a97[_0x7b99('0x38')]=_0x135a97[_0x7b99('0x38')][_0x7b99('0x39')]?_0x135a97[_0x7b99('0x38')]:_0x569676[_0x7b99('0x32')];if(!_0x373a42['query']['hasOwnProperty']('nolimit')){_0x135a97[_0x7b99('0x22')]=qs['limit'](_0x373a42[_0x7b99('0x33')][_0x7b99('0x22')]);_0x135a97[_0x7b99('0x1f')]=qs[_0x7b99('0x1f')](_0x373a42['query'][_0x7b99('0x1f')]);}_0x135a97[_0x7b99('0x3a')]=qs[_0x7b99('0x3b')](_0x373a42[_0x7b99('0x33')]['sort']);_0x135a97['where']=qs[_0x7b99('0x35')](_['pick'](_0x373a42[_0x7b99('0x33')],_0x569676[_0x7b99('0x35')]),_0x368eda);if(_0x373a42[_0x7b99('0x33')]['filter']){_0x135a97[_0x7b99('0x3c')]=_[_0x7b99('0x3d')](_0x135a97[_0x7b99('0x3c')],{'$or':_[_0x7b99('0x2e')](_0x368eda,function(_0x31b7ed){if(_0x31b7ed['type']!==_0x7b99('0x3e')){var _0x36429c={};_0x36429c[_0x31b7ed[_0x7b99('0x2c')]]={'$like':'%'+_0x373a42[_0x7b99('0x33')]['filter']+'%'};return _0x36429c;}})});}_0x135a97=_['merge']({},_0x135a97,_0x373a42['options']);var _0xd68892={'where':_0x135a97['where']};return db['JscriptyQuestionReport'][_0x7b99('0x21')](_0xd68892)['then'](function(_0x3bec79){_0x82abd1[_0x7b99('0x21')]=_0x3bec79;if(_0x373a42['query'][_0x7b99('0x3f')]){_0x135a97[_0x7b99('0x40')]=[{'all':!![]}];}return db[_0x7b99('0x41')][_0x7b99('0x42')](_0x135a97);})[_0x7b99('0x28')](function(_0xd925b5){_0x82abd1[_0x7b99('0x43')]=_0xd925b5;return _0x82abd1;})[_0x7b99('0x28')](respondWithFilteredResult(_0x3839c4,_0x135a97))[_0x7b99('0x44')](handleError(_0x3839c4,null));};exports[_0x7b99('0x45')]=function(_0x15fccc,_0x1f1100){var _0x32c522={'raw':!![],'where':{'id':_0x15fccc[_0x7b99('0x46')]['id']}},_0x101c6f={};_0x101c6f[_0x7b99('0x32')]=_[_0x7b99('0x34')](db['JscriptyQuestionReport'][_0x7b99('0x47')]);_0x101c6f[_0x7b99('0x33')]=_['keys'](_0x15fccc[_0x7b99('0x33')]);_0x101c6f[_0x7b99('0x35')]=_[_0x7b99('0x36')](_0x101c6f[_0x7b99('0x32')],_0x101c6f[_0x7b99('0x33')]);_0x32c522['attributes']=_[_0x7b99('0x36')](_0x101c6f[_0x7b99('0x32')],qs['fields'](_0x15fccc[_0x7b99('0x33')][_0x7b99('0x37')]));_0x32c522['attributes']=_0x32c522['attributes']['length']?_0x32c522[_0x7b99('0x38')]:_0x101c6f[_0x7b99('0x32')];if(_0x15fccc[_0x7b99('0x33')]['includeAll']){_0x32c522[_0x7b99('0x40')]=[{'all':!![]}];}_0x32c522=_[_0x7b99('0x3d')]({},_0x32c522,_0x15fccc[_0x7b99('0x48')]);return db[_0x7b99('0x41')][_0x7b99('0x49')](_0x32c522)['then'](handleEntityNotFound(_0x1f1100,null))[_0x7b99('0x28')](respondWithResult(_0x1f1100,null))[_0x7b99('0x44')](handleError(_0x1f1100,null));};exports['create']=function(_0x410de8,_0x272b2f){return db[_0x7b99('0x41')][_0x7b99('0x4a')](_0x410de8[_0x7b99('0x4b')],{})['then'](respondWithResult(_0x272b2f,0xc9))[_0x7b99('0x44')](handleError(_0x272b2f,null));};exports['update']=function(_0xd6add5,_0x207ad1){if(_0xd6add5[_0x7b99('0x4b')]['id']){delete _0xd6add5[_0x7b99('0x4b')]['id'];}return db[_0x7b99('0x41')][_0x7b99('0x49')]({'where':{'id':_0xd6add5[_0x7b99('0x46')]['id']}})[_0x7b99('0x28')](handleEntityNotFound(_0x207ad1,null))[_0x7b99('0x28')](saveUpdates(_0xd6add5['body'],null))[_0x7b99('0x28')](respondWithResult(_0x207ad1,null))[_0x7b99('0x44')](handleError(_0x207ad1,null));};exports[_0x7b99('0x29')]=function(_0x1c454b,_0x384ec1){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x1c454b[_0x7b99('0x46')]['id']}})['then'](handleEntityNotFound(_0x384ec1,null))['then'](removeEntity(_0x384ec1,null))['catch'](handleError(_0x384ec1,null));};exports['describe']=function(_0x4e252a,_0xee9ab1){return db['JscriptyQuestionReport'][_0x7b99('0x4c')]()[_0x7b99('0x28')](respondWithResult(_0xee9ab1,null))[_0x7b99('0x44')](handleError(_0xee9ab1,null));}; \ No newline at end of file +var _0x9d2b=['stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','key','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x4b5cf4,_0x23a41d){var _0xed5b22=function(_0xdbb65){while(--_0xdbb65){_0x4b5cf4['push'](_0x4b5cf4['shift']());}};_0xed5b22(++_0x23a41d);}(_0x9d2b,0x15d));var _0xb9d2=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x9d2b[_0x39c734];return _0xb2a2f9;};'use strict';var emlformat=require(_0xb9d2('0x0'));var rimraf=require(_0xb9d2('0x1'));var zipdir=require(_0xb9d2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9d2('0x3'));var moment=require('moment');var BPromise=require(_0xb9d2('0x4'));var Mustache=require(_0xb9d2('0x5'));var util=require('util');var path=require(_0xb9d2('0x6'));var sox=require(_0xb9d2('0x7'));var csv=require(_0xb9d2('0x8'));var ejs=require(_0xb9d2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb9d2('0xa'));var squel=require(_0xb9d2('0xb'));var crypto=require(_0xb9d2('0xc'));var jsforce=require(_0xb9d2('0xd'));var deskjs=require(_0xb9d2('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb9d2('0xf'));var qs=require(_0xb9d2('0x10'));var as=require(_0xb9d2('0x11'));var hardwareService=require(_0xb9d2('0x12'));var logger=require(_0xb9d2('0x13'))(_0xb9d2('0x14'));var utils=require(_0xb9d2('0x15'));var config=require(_0xb9d2('0x16'));var licenseUtil=require(_0xb9d2('0x17'));var db=require(_0xb9d2('0x18'))['db'];function respondWithStatusCode(_0x1b4535,_0x381216){_0x381216=_0x381216||0xcc;return function(_0xfd625d){if(_0xfd625d){return _0x1b4535[_0xb9d2('0x19')](_0x381216);}return _0x1b4535[_0xb9d2('0x1a')](_0x381216)[_0xb9d2('0x1b')]();};}function respondWithResult(_0xbfe12,_0x215fe1){_0x215fe1=_0x215fe1||0xc8;return function(_0x3b0d4f){if(_0x3b0d4f){return _0xbfe12[_0xb9d2('0x1a')](_0x215fe1)[_0xb9d2('0x1c')](_0x3b0d4f);}};}function respondWithFilteredResult(_0xd2d92d,_0x4b7836){return function(_0x3e4ce5){if(_0x3e4ce5){var _0x21016a=typeof _0x4b7836[_0xb9d2('0x1d')]===_0xb9d2('0x1e')&&typeof _0x4b7836['limit']==='undefined';var _0x590c2b=_0x3e4ce5[_0xb9d2('0x1f')];var _0x6a8d68=_0x21016a?0x0:_0x4b7836[_0xb9d2('0x1d')];var _0x5cf558=_0x21016a?_0x3e4ce5[_0xb9d2('0x1f')]:_0x4b7836[_0xb9d2('0x1d')]+_0x4b7836[_0xb9d2('0x20')];var _0x360b31;if(_0x5cf558>=_0x590c2b){_0x5cf558=_0x590c2b;_0x360b31=0xc8;}else{_0x360b31=0xce;}_0xd2d92d['status'](_0x360b31);return _0xd2d92d[_0xb9d2('0x21')](_0xb9d2('0x22'),_0x6a8d68+'-'+_0x5cf558+'/'+_0x590c2b)['json'](_0x3e4ce5);}return null;};}function patchUpdates(_0x5e7e0a){return function(_0x490aab){try{jsonpatch[_0xb9d2('0x23')](_0x490aab,_0x5e7e0a,!![]);}catch(_0x120bf4){return BPromise[_0xb9d2('0x24')](_0x120bf4);}return _0x490aab[_0xb9d2('0x25')]();};}function saveUpdates(_0x59379d,_0x118c55){return function(_0x5e423a){if(_0x5e423a){return _0x5e423a[_0xb9d2('0x26')](_0x59379d)[_0xb9d2('0x27')](function(_0x5a46f6){return _0x5a46f6;});}return null;};}function removeEntity(_0x3c11b2,_0x225f84){return function(_0x1cfb3b){if(_0x1cfb3b){return _0x1cfb3b[_0xb9d2('0x28')]()[_0xb9d2('0x27')](function(){_0x3c11b2[_0xb9d2('0x1a')](0xcc)[_0xb9d2('0x1b')]();});}};}function handleEntityNotFound(_0xc7d770,_0x4fdb74){return function(_0x1ad5c7){if(!_0x1ad5c7){_0xc7d770[_0xb9d2('0x19')](0x194);}return _0x1ad5c7;};}function handleError(_0x44b52b,_0x6e9f9b){_0x6e9f9b=_0x6e9f9b||0x1f4;return function(_0x3695ae){logger['error'](_0x3695ae[_0xb9d2('0x29')]);if(_0x3695ae[_0xb9d2('0x2a')]){delete _0x3695ae['name'];}_0x44b52b[_0xb9d2('0x1a')](_0x6e9f9b)[_0xb9d2('0x2b')](_0x3695ae);};}exports[_0xb9d2('0x2c')]=function(_0x4bd696,_0x5d37e1){var _0x231ef2={},_0x3fed60={},_0x1a667e={'count':0x0,'rows':[]};var _0x509a5f=_[_0xb9d2('0x2d')](db[_0xb9d2('0x2e')][_0xb9d2('0x2f')],function(_0x2e8dfd){return{'name':_0x2e8dfd[_0xb9d2('0x30')],'type':_0x2e8dfd['type'][_0xb9d2('0x31')]};});_0x3fed60['model']=_['map'](_0x509a5f,'name');_0x3fed60[_0xb9d2('0x32')]=_['keys'](_0x4bd696['query']);_0x3fed60[_0xb9d2('0x33')]=_[_0xb9d2('0x34')](_0x3fed60[_0xb9d2('0x35')],_0x3fed60[_0xb9d2('0x32')]);_0x231ef2['attributes']=_['intersection'](_0x3fed60[_0xb9d2('0x35')],qs[_0xb9d2('0x36')](_0x4bd696[_0xb9d2('0x32')][_0xb9d2('0x36')]));_0x231ef2['attributes']=_0x231ef2['attributes'][_0xb9d2('0x37')]?_0x231ef2[_0xb9d2('0x38')]:_0x3fed60['model'];if(!_0x4bd696['query'][_0xb9d2('0x39')](_0xb9d2('0x3a'))){_0x231ef2[_0xb9d2('0x20')]=qs[_0xb9d2('0x20')](_0x4bd696[_0xb9d2('0x32')][_0xb9d2('0x20')]);_0x231ef2[_0xb9d2('0x1d')]=qs[_0xb9d2('0x1d')](_0x4bd696[_0xb9d2('0x32')]['offset']);}_0x231ef2['order']=qs[_0xb9d2('0x3b')](_0x4bd696[_0xb9d2('0x32')][_0xb9d2('0x3b')]);_0x231ef2[_0xb9d2('0x3c')]=qs[_0xb9d2('0x33')](_[_0xb9d2('0x3d')](_0x4bd696[_0xb9d2('0x32')],_0x3fed60[_0xb9d2('0x33')]),_0x509a5f);if(_0x4bd696[_0xb9d2('0x32')][_0xb9d2('0x3e')]){_0x231ef2[_0xb9d2('0x3c')]=_[_0xb9d2('0x3f')](_0x231ef2[_0xb9d2('0x3c')],{'$or':_[_0xb9d2('0x2d')](_0x509a5f,function(_0x532a09){if(_0x532a09['type']!==_0xb9d2('0x40')){var _0x458269={};_0x458269[_0x532a09['name']]={'$like':'%'+_0x4bd696[_0xb9d2('0x32')][_0xb9d2('0x3e')]+'%'};return _0x458269;}})});}_0x231ef2=_[_0xb9d2('0x3f')]({},_0x231ef2,_0x4bd696[_0xb9d2('0x41')]);var _0x399c36={'where':_0x231ef2[_0xb9d2('0x3c')]};return db[_0xb9d2('0x2e')][_0xb9d2('0x1f')](_0x399c36)[_0xb9d2('0x27')](function(_0x436ee1){_0x1a667e['count']=_0x436ee1;if(_0x4bd696[_0xb9d2('0x32')][_0xb9d2('0x42')]){_0x231ef2[_0xb9d2('0x43')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xb9d2('0x44')](_0x231ef2);})['then'](function(_0x5ce7b8){_0x1a667e[_0xb9d2('0x45')]=_0x5ce7b8;return _0x1a667e;})[_0xb9d2('0x27')](respondWithFilteredResult(_0x5d37e1,_0x231ef2))['catch'](handleError(_0x5d37e1,null));};exports[_0xb9d2('0x46')]=function(_0x2bf800,_0x1a83f9){var _0x28929e={'raw':!![],'where':{'id':_0x2bf800[_0xb9d2('0x47')]['id']}},_0x267d7c={};_0x267d7c[_0xb9d2('0x35')]=_['keys'](db[_0xb9d2('0x2e')]['rawAttributes']);_0x267d7c[_0xb9d2('0x32')]=_[_0xb9d2('0x48')](_0x2bf800[_0xb9d2('0x32')]);_0x267d7c[_0xb9d2('0x33')]=_['intersection'](_0x267d7c[_0xb9d2('0x35')],_0x267d7c[_0xb9d2('0x32')]);_0x28929e[_0xb9d2('0x38')]=_[_0xb9d2('0x34')](_0x267d7c[_0xb9d2('0x35')],qs[_0xb9d2('0x36')](_0x2bf800[_0xb9d2('0x32')][_0xb9d2('0x36')]));_0x28929e[_0xb9d2('0x38')]=_0x28929e[_0xb9d2('0x38')][_0xb9d2('0x37')]?_0x28929e[_0xb9d2('0x38')]:_0x267d7c['model'];if(_0x2bf800[_0xb9d2('0x32')][_0xb9d2('0x42')]){_0x28929e[_0xb9d2('0x43')]=[{'all':!![]}];}_0x28929e=_[_0xb9d2('0x3f')]({},_0x28929e,_0x2bf800[_0xb9d2('0x41')]);return db[_0xb9d2('0x2e')][_0xb9d2('0x49')](_0x28929e)[_0xb9d2('0x27')](handleEntityNotFound(_0x1a83f9,null))[_0xb9d2('0x27')](respondWithResult(_0x1a83f9,null))['catch'](handleError(_0x1a83f9,null));};exports[_0xb9d2('0x4a')]=function(_0x21e1b6,_0x704924){return db[_0xb9d2('0x2e')][_0xb9d2('0x4a')](_0x21e1b6[_0xb9d2('0x4b')],{})[_0xb9d2('0x27')](respondWithResult(_0x704924,0xc9))[_0xb9d2('0x4c')](handleError(_0x704924,null));};exports[_0xb9d2('0x26')]=function(_0x3bf264,_0xd13b87){if(_0x3bf264[_0xb9d2('0x4b')]['id']){delete _0x3bf264[_0xb9d2('0x4b')]['id'];}return db[_0xb9d2('0x2e')]['find']({'where':{'id':_0x3bf264[_0xb9d2('0x47')]['id']}})[_0xb9d2('0x27')](handleEntityNotFound(_0xd13b87,null))[_0xb9d2('0x27')](saveUpdates(_0x3bf264['body'],null))[_0xb9d2('0x27')](respondWithResult(_0xd13b87,null))['catch'](handleError(_0xd13b87,null));};exports['destroy']=function(_0x32cc54,_0x2fb812){return db[_0xb9d2('0x2e')][_0xb9d2('0x49')]({'where':{'id':_0x32cc54[_0xb9d2('0x47')]['id']}})['then'](handleEntityNotFound(_0x2fb812,null))['then'](removeEntity(_0x2fb812,null))[_0xb9d2('0x4c')](handleError(_0x2fb812,null));};exports[_0xb9d2('0x4d')]=function(_0x98baf5,_0x1f7023){return db[_0xb9d2('0x2e')][_0xb9d2('0x4d')]()['then'](respondWithResult(_0x1f7023,null))[_0xb9d2('0x4c')](handleError(_0x1f7023,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 547d0a1..a364af7 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 _0x4a54=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x4efddb,_0x536476){var _0x3142e4=function(_0xd1eed9){while(--_0xd1eed9){_0x4efddb['push'](_0x4efddb['shift']());}};_0x3142e4(++_0x536476);}(_0x4a54,0x19a));var _0x44a5=function(_0x1a9e9e,_0x4e02c0){_0x1a9e9e=_0x1a9e9e-0x0;var _0x461061=_0x4a54[_0x1a9e9e];return _0x461061;};'use strict';var _=require('lodash');var util=require(_0x44a5('0x0'));var logger=require(_0x44a5('0x1'))(_0x44a5('0x2'));var moment=require(_0x44a5('0x3'));var BPromise=require(_0x44a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x44a5('0x5'));var config=require(_0x44a5('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x44a5('0x7')]=function(_0x12ed39,_0x368be6){return _0x12ed39['define'](_0x44a5('0x8'),attributes,{'tableName':_0x44a5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77ff=['JscriptyQuestionReport','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x494fa2,_0x84b5d8){var _0xf013c7=function(_0x348859){while(--_0x348859){_0x494fa2['push'](_0x494fa2['shift']());}};_0xf013c7(++_0x84b5d8);}(_0x77ff,0x159));var _0xf77f=function(_0x259d51,_0x451716){_0x259d51=_0x259d51-0x0;var _0x5bd48b=_0x77ff[_0x259d51];return _0x5bd48b;};'use strict';var _=require(_0xf77f('0x0'));var util=require('util');var logger=require(_0xf77f('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf77f('0x2'));var rp=require(_0xf77f('0x3'));var fs=require('fs');var path=require(_0xf77f('0x4'));var rimraf=require(_0xf77f('0x5'));var config=require(_0xf77f('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x287b69,_0x52e0b6){return _0x287b69['define'](_0xf77f('0x7'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index f3dd881..02ec7b8 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 _0xf384=['debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0xf384,0xc4));var _0x4f38=function(_0x1670d5,_0x557233){_0x1670d5=_0x1670d5-0x0;var _0x1ce4a6=_0xf384[_0x1670d5];return _0x1ce4a6;};'use strict';var _=require('lodash');var util=require(_0x4f38('0x0'));var moment=require(_0x4f38('0x1'));var BPromise=require(_0x4f38('0x2'));var rs=require(_0x4f38('0x3'));var fs=require('fs');var Redis=require(_0x4f38('0x4'));var db=require(_0x4f38('0x5'))['db'];var utils=require(_0x4f38('0x6'));var logger=require('../../config/logger')(_0x4f38('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f38('0x8'));var client=jayson[_0x4f38('0x9')][_0x4f38('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2eff0e,_0x465f79,_0x55b481){return new BPromise(function(_0x4b0f33,_0x4ec4be){return client['request'](_0x2eff0e,_0x55b481)[_0x4f38('0xb')](function(_0x20634c){logger['info'](_0x4f38('0xc'),_0x465f79,_0x4f38('0xd'));logger[_0x4f38('0xe')](_0x4f38('0xf'),_0x465f79,_0x4f38('0xd'),JSON['stringify'](_0x20634c));if(_0x20634c[_0x4f38('0x10')]){if(_0x20634c[_0x4f38('0x10')][_0x4f38('0x11')]===0x1f4){logger[_0x4f38('0x10')](_0x4f38('0xc'),_0x465f79,_0x20634c[_0x4f38('0x10')][_0x4f38('0x12')]);return _0x4ec4be(_0x20634c['error'][_0x4f38('0x12')]);}logger[_0x4f38('0x10')](_0x4f38('0xc'),_0x465f79,_0x20634c['error'][_0x4f38('0x12')]);return _0x4b0f33(_0x20634c[_0x4f38('0x10')][_0x4f38('0x12')]);}else{logger[_0x4f38('0x13')](_0x4f38('0xc'),_0x465f79,'request\x20sent');_0x4b0f33(_0x20634c[_0x4f38('0x14')]['message']);}})['catch'](function(_0x218a3e){logger[_0x4f38('0x10')](_0x4f38('0xc'),_0x465f79,_0x218a3e);_0x4ec4be(_0x218a3e);});});} \ No newline at end of file +var _0x7817=['code','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1ee04b,_0x554b3d){var _0x412848=function(_0x11917a){while(--_0x11917a){_0x1ee04b['push'](_0x1ee04b['shift']());}};_0x412848(++_0x554b3d);}(_0x7817,0x1f1));var _0x7781=function(_0x3b13e2,_0x3cd43d){_0x3b13e2=_0x3b13e2-0x0;var _0x29dd1f=_0x7817[_0x3b13e2];return _0x29dd1f;};'use strict';var _=require(_0x7781('0x0'));var util=require(_0x7781('0x1'));var moment=require(_0x7781('0x2'));var BPromise=require('bluebird');var rs=require(_0x7781('0x3'));var fs=require('fs');var Redis=require(_0x7781('0x4'));var db=require(_0x7781('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7781('0x6'));var client=jayson[_0x7781('0x7')][_0x7781('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a21eb,_0x201e8d,_0x508e0b){return new BPromise(function(_0x5bb360,_0x44af52){return client['request'](_0x2a21eb,_0x508e0b)['then'](function(_0x1db810){logger[_0x7781('0x9')](_0x7781('0xa'),_0x201e8d,_0x7781('0xb'));logger[_0x7781('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x201e8d,_0x7781('0xb'),JSON['stringify'](_0x1db810));if(_0x1db810['error']){if(_0x1db810['error'][_0x7781('0xd')]===0x1f4){logger['error'](_0x7781('0xa'),_0x201e8d,_0x1db810[_0x7781('0xe')][_0x7781('0xf')]);return _0x44af52(_0x1db810[_0x7781('0xe')][_0x7781('0xf')]);}logger[_0x7781('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x201e8d,_0x1db810[_0x7781('0xe')][_0x7781('0xf')]);return _0x5bb360(_0x1db810['error'][_0x7781('0xf')]);}else{logger['info'](_0x7781('0xa'),_0x201e8d,_0x7781('0xb'));_0x5bb360(_0x1db810['result'][_0x7781('0xf')]);}})[_0x7781('0x10')](function(_0x3c3a09){logger[_0x7781('0xe')](_0x7781('0xa'),_0x201e8d,_0x3c3a09);_0x44af52(_0x3c3a09);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 12440b7..0022fc3 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 _0x3812=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/questions','post','create','put','update','delete'];(function(_0x24104f,_0x2fbb92){var _0x524d2b=function(_0x165d6a){while(--_0x165d6a){_0x24104f['push'](_0x24104f['shift']());}};_0x524d2b(++_0x2fbb92);}(_0x3812,0x8b));var _0x2381=function(_0x3f10a7,_0x300319){_0x3f10a7=_0x3f10a7-0x0;var _0xbf99b3=_0x3812[_0x3f10a7];return _0xbf99b3;};'use strict';var multer=require(_0x2381('0x0'));var util=require(_0x2381('0x1'));var path=require(_0x2381('0x2'));var timeout=require(_0x2381('0x3'));var express=require(_0x2381('0x4'));var router=express[_0x2381('0x5')]();var fs_extra=require(_0x2381('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2381('0x7'));var config=require(_0x2381('0x8'));var controller=require(_0x2381('0x9'));router[_0x2381('0xa')]('/',auth[_0x2381('0xb')](),controller['index']);router[_0x2381('0xa')](_0x2381('0xc'),auth[_0x2381('0xb')](),controller[_0x2381('0xd')]);router['get'](_0x2381('0xe'),auth['isAuthenticated'](),controller[_0x2381('0xf')]);router[_0x2381('0xa')](_0x2381('0x10'),auth[_0x2381('0xb')](),controller['getQuestions']);router[_0x2381('0x11')]('/',auth[_0x2381('0xb')](),controller[_0x2381('0x12')]);router[_0x2381('0x13')](_0x2381('0xe'),auth[_0x2381('0xb')](),controller[_0x2381('0x14')]);router[_0x2381('0x15')](_0x2381('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x2381('0x16')]=router; \ No newline at end of file +var _0x613f=['put','util','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/questions','getQuestions','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x613f,0x1b1));var _0xf613=function(_0x590aa1,_0x338f24){_0x590aa1=_0x590aa1-0x0;var _0x4150de=_0x613f[_0x590aa1];return _0x4150de;};'use strict';var multer=require('multer');var util=require(_0xf613('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf613('0x1'));var router=express[_0xf613('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf613('0x3'));var interaction=require(_0xf613('0x4'));var config=require('../../config/environment');var controller=require(_0xf613('0x5'));router['get']('/',auth[_0xf613('0x6')](),controller[_0xf613('0x7')]);router[_0xf613('0x8')](_0xf613('0x9'),auth['isAuthenticated'](),controller[_0xf613('0xa')]);router['get'](_0xf613('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xf613('0xc'),auth['isAuthenticated'](),controller[_0xf613('0xd')]);router[_0xf613('0xe')]('/',auth[_0xf613('0x6')](),controller['create']);router[_0xf613('0xf')](_0xf613('0xb'),auth[_0xf613('0x6')](),controller['update']);router['delete'](_0xf613('0xb'),auth[_0xf613('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index b0638b2..c22e763 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 _0x6113=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports','DATE','setDataValue','starttime'];(function(_0x5a7112,_0x1f9492){var _0x3147f7=function(_0x4d2329){while(--_0x4d2329){_0x5a7112['push'](_0x5a7112['shift']());}};_0x3147f7(++_0x1f9492);}(_0x6113,0x13e));var _0x3611=function(_0x6a9287,_0x4e8bed){_0x6a9287=_0x6a9287-0x0;var _0x15c92a=_0x6113[_0x6a9287];return _0x15c92a;};'use strict';var moment=require(_0x3611('0x0'));var Sequelize=require(_0x3611('0x1'));module[_0x3611('0x2')]={'starttime':{'type':Sequelize[_0x3611('0x3')],'set':function(_0x3c6e31){this[_0x3611('0x4')](_0x3611('0x5'),_0x3c6e31);this['setDataValue']('endtime',moment()[_0x3611('0x6')](_0x3611('0x7')));}},'endtime':{'type':Sequelize[_0x3611('0x3')]},'membername':{'type':Sequelize[_0x3611('0x8')]},'projectname':{'type':Sequelize[_0x3611('0x8')]},'queue':{'type':Sequelize[_0x3611('0x8')]},'uniqueid':{'type':Sequelize[_0x3611('0x8')]},'calleridname':{'type':Sequelize[_0x3611('0x8')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x3c55=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE','setDataValue'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3c55,0x163));var _0x53c5=function(_0x2c45e9,_0x2ac84a){_0x2c45e9=_0x2c45e9-0x0;var _0x3c5afc=_0x3c55[_0x2c45e9];return _0x3c5afc;};'use strict';var moment=require(_0x53c5('0x0'));var Sequelize=require(_0x53c5('0x1'));module[_0x53c5('0x2')]={'starttime':{'type':Sequelize[_0x53c5('0x3')],'set':function(_0x49b30b){this['setDataValue']('starttime',_0x49b30b);this[_0x53c5('0x4')](_0x53c5('0x5'),moment()[_0x53c5('0x6')](_0x53c5('0x7')));}},'endtime':{'type':Sequelize[_0x53c5('0x3')]},'membername':{'type':Sequelize[_0x53c5('0x8')]},'projectname':{'type':Sequelize[_0x53c5('0x8')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x53c5('0x8')]},'calleridname':{'type':Sequelize[_0x53c5('0x8')]},'calleridnum':{'type':Sequelize[_0x53c5('0x8')]},'completed':{'type':Sequelize[_0x53c5('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index d14c0d4..c4a3768 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 _0x22f0=['../../config/license/util','sendStatus','end','status','json','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','JscriptySessionReport','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','eml-format','zip-dir','fast-json-patch','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment'];(function(_0x509273,_0x13fc9f){var _0x38ef40=function(_0xf8d4c9){while(--_0xf8d4c9){_0x509273['push'](_0x509273['shift']());}};_0x38ef40(++_0x13fc9f);}(_0x22f0,0x11a));var _0x022f=function(_0x1e7701,_0x13fd0f){_0x1e7701=_0x1e7701-0x0;var _0x3ab707=_0x22f0[_0x1e7701];return _0x3ab707;};'use strict';var emlformat=require(_0x022f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x022f('0x1'));var jsonpatch=require(_0x022f('0x2'));var rp=require('request-promise');var moment=require(_0x022f('0x3'));var BPromise=require(_0x022f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x022f('0x5'));var ejs=require(_0x022f('0x6'));var fs=require('fs');var fs_extra=require(_0x022f('0x7'));var _=require(_0x022f('0x8'));var squel=require(_0x022f('0x9'));var crypto=require(_0x022f('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x022f('0x5'));var querystring=require('querystring');var Papa=require(_0x022f('0xb'));var Redis=require(_0x022f('0xc'));var authService=require(_0x022f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x022f('0xe'));var hardwareService=require(_0x022f('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x022f('0x10'));var config=require(_0x022f('0x11'));var licenseUtil=require(_0x022f('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3346f3,_0x24f46d){_0x24f46d=_0x24f46d||0xcc;return function(_0x3cb8d7){if(_0x3cb8d7){return _0x3346f3[_0x022f('0x13')](_0x24f46d);}return _0x3346f3['status'](_0x24f46d)[_0x022f('0x14')]();};}function respondWithResult(_0xe5fa7e,_0x2ebbcc){_0x2ebbcc=_0x2ebbcc||0xc8;return function(_0x5a2df2){if(_0x5a2df2){return _0xe5fa7e[_0x022f('0x15')](_0x2ebbcc)[_0x022f('0x16')](_0x5a2df2);}};}function respondWithFilteredResult(_0x29b52a,_0x3b4f5d){return function(_0x391f48){if(_0x391f48){var _0x31de7e=typeof _0x3b4f5d['offset']==='undefined'&&typeof _0x3b4f5d[_0x022f('0x17')]===_0x022f('0x18');var _0x583cc8=_0x391f48[_0x022f('0x19')];var _0x1d086d=_0x31de7e?0x0:_0x3b4f5d['offset'];var _0x4821aa=_0x31de7e?_0x391f48[_0x022f('0x19')]:_0x3b4f5d['offset']+_0x3b4f5d['limit'];var _0xf1a2f1;if(_0x4821aa>=_0x583cc8){_0x4821aa=_0x583cc8;_0xf1a2f1=0xc8;}else{_0xf1a2f1=0xce;}_0x29b52a[_0x022f('0x15')](_0xf1a2f1);return _0x29b52a['set'](_0x022f('0x1a'),_0x1d086d+'-'+_0x4821aa+'/'+_0x583cc8)['json'](_0x391f48);}return null;};}function patchUpdates(_0x18f707){return function(_0x4bafb8){try{jsonpatch[_0x022f('0x1b')](_0x4bafb8,_0x18f707,!![]);}catch(_0x126f79){return BPromise[_0x022f('0x1c')](_0x126f79);}return _0x4bafb8[_0x022f('0x1d')]();};}function saveUpdates(_0xe0d86a,_0xf3bd5f){return function(_0x4fb792){if(_0x4fb792){return _0x4fb792[_0x022f('0x1e')](_0xe0d86a)[_0x022f('0x1f')](function(_0x2533fd){return _0x2533fd;});}return null;};}function removeEntity(_0x3c591e,_0x521f01){return function(_0x2c1243){if(_0x2c1243){return _0x2c1243[_0x022f('0x20')]()[_0x022f('0x1f')](function(){_0x3c591e[_0x022f('0x15')](0xcc)[_0x022f('0x14')]();});}};}function handleEntityNotFound(_0x418658,_0x5da01b){return function(_0x4fbe53){if(!_0x4fbe53){_0x418658[_0x022f('0x13')](0x194);}return _0x4fbe53;};}function handleError(_0x37c3ec,_0x304fa3){_0x304fa3=_0x304fa3||0x1f4;return function(_0x5ef025){logger['error'](_0x5ef025[_0x022f('0x21')]);if(_0x5ef025['name']){delete _0x5ef025[_0x022f('0x22')];}_0x37c3ec['status'](_0x304fa3)[_0x022f('0x23')](_0x5ef025);};}exports[_0x022f('0x24')]=function(_0x30738b,_0x597acf){var _0x5ccade={},_0x2b07b7={},_0x2b524b={'count':0x0,'rows':[]};var _0x5e6843=_['map'](db[_0x022f('0x25')][_0x022f('0x26')],function(_0x4383b5){return{'name':_0x4383b5['fieldName'],'type':_0x4383b5[_0x022f('0x27')][_0x022f('0x28')]};});_0x2b07b7[_0x022f('0x29')]=_[_0x022f('0x2a')](_0x5e6843,'name');_0x2b07b7[_0x022f('0x2b')]=_[_0x022f('0x2c')](_0x30738b[_0x022f('0x2b')]);_0x2b07b7[_0x022f('0x2d')]=_['intersection'](_0x2b07b7[_0x022f('0x29')],_0x2b07b7[_0x022f('0x2b')]);_0x5ccade[_0x022f('0x2e')]=_[_0x022f('0x2f')](_0x2b07b7[_0x022f('0x29')],qs['fields'](_0x30738b[_0x022f('0x2b')][_0x022f('0x30')]));_0x5ccade[_0x022f('0x2e')]=_0x5ccade[_0x022f('0x2e')][_0x022f('0x31')]?_0x5ccade[_0x022f('0x2e')]:_0x2b07b7[_0x022f('0x29')];if(!_0x30738b[_0x022f('0x2b')][_0x022f('0x32')](_0x022f('0x33'))){_0x5ccade[_0x022f('0x17')]=qs[_0x022f('0x17')](_0x30738b['query']['limit']);_0x5ccade[_0x022f('0x34')]=qs[_0x022f('0x34')](_0x30738b[_0x022f('0x2b')][_0x022f('0x34')]);}_0x5ccade[_0x022f('0x35')]=qs[_0x022f('0x36')](_0x30738b[_0x022f('0x2b')][_0x022f('0x36')]);_0x5ccade[_0x022f('0x37')]=qs['filters'](_[_0x022f('0x38')](_0x30738b[_0x022f('0x2b')],_0x2b07b7[_0x022f('0x2d')]),_0x5e6843);if(_0x30738b[_0x022f('0x2b')][_0x022f('0x39')]){_0x5ccade[_0x022f('0x37')]=_[_0x022f('0x3a')](_0x5ccade['where'],{'$or':_[_0x022f('0x2a')](_0x5e6843,function(_0x1b7268){if(_0x1b7268[_0x022f('0x27')]!=='VIRTUAL'){var _0xb27e36={};_0xb27e36[_0x1b7268[_0x022f('0x22')]]={'$like':'%'+_0x30738b[_0x022f('0x2b')][_0x022f('0x39')]+'%'};return _0xb27e36;}})});}_0x5ccade=_[_0x022f('0x3a')]({},_0x5ccade,_0x30738b[_0x022f('0x3b')]);var _0x15475e={'where':_0x5ccade['where']};return db[_0x022f('0x25')][_0x022f('0x19')](_0x15475e)['then'](function(_0x4f5917){_0x2b524b[_0x022f('0x19')]=_0x4f5917;if(_0x30738b['query'][_0x022f('0x3c')]){_0x5ccade[_0x022f('0x3d')]=[{'all':!![]}];}return db[_0x022f('0x25')][_0x022f('0x3e')](_0x5ccade);})[_0x022f('0x1f')](function(_0x28ddd6){_0x2b524b[_0x022f('0x3f')]=_0x28ddd6;return _0x2b524b;})[_0x022f('0x1f')](respondWithFilteredResult(_0x597acf,_0x5ccade))[_0x022f('0x40')](handleError(_0x597acf,null));};exports[_0x022f('0x41')]=function(_0x39db74,_0xf5ca0f){var _0x3cb7f6={'raw':!![],'where':{'id':_0x39db74[_0x022f('0x42')]['id']}},_0x114426={};_0x114426['model']=_['keys'](db[_0x022f('0x25')][_0x022f('0x26')]);_0x114426[_0x022f('0x2b')]=_[_0x022f('0x2c')](_0x39db74[_0x022f('0x2b')]);_0x114426[_0x022f('0x2d')]=_[_0x022f('0x2f')](_0x114426['model'],_0x114426[_0x022f('0x2b')]);_0x3cb7f6[_0x022f('0x2e')]=_['intersection'](_0x114426[_0x022f('0x29')],qs[_0x022f('0x30')](_0x39db74['query']['fields']));_0x3cb7f6[_0x022f('0x2e')]=_0x3cb7f6[_0x022f('0x2e')][_0x022f('0x31')]?_0x3cb7f6[_0x022f('0x2e')]:_0x114426['model'];if(_0x39db74[_0x022f('0x2b')][_0x022f('0x3c')]){_0x3cb7f6[_0x022f('0x3d')]=[{'all':!![]}];}_0x3cb7f6=_[_0x022f('0x3a')]({},_0x3cb7f6,_0x39db74[_0x022f('0x3b')]);return db[_0x022f('0x25')][_0x022f('0x43')](_0x3cb7f6)['then'](handleEntityNotFound(_0xf5ca0f,null))['then'](respondWithResult(_0xf5ca0f,null))[_0x022f('0x40')](handleError(_0xf5ca0f,null));};exports[_0x022f('0x44')]=function(_0x1ad23f,_0x5897d3){return db[_0x022f('0x25')]['create'](_0x1ad23f[_0x022f('0x45')],{})['then'](respondWithResult(_0x5897d3,0xc9))[_0x022f('0x40')](handleError(_0x5897d3,null));};exports[_0x022f('0x1e')]=function(_0x28d413,_0x4c959d){if(_0x28d413['body']['id']){delete _0x28d413['body']['id'];}return db['JscriptySessionReport'][_0x022f('0x43')]({'where':{'id':_0x28d413[_0x022f('0x42')]['id']}})[_0x022f('0x1f')](handleEntityNotFound(_0x4c959d,null))[_0x022f('0x1f')](saveUpdates(_0x28d413[_0x022f('0x45')],null))[_0x022f('0x1f')](respondWithResult(_0x4c959d,null))[_0x022f('0x40')](handleError(_0x4c959d,null));};exports[_0x022f('0x20')]=function(_0x1866cf,_0xb75978){return db[_0x022f('0x25')][_0x022f('0x43')]({'where':{'id':_0x1866cf[_0x022f('0x42')]['id']}})[_0x022f('0x1f')](handleEntityNotFound(_0xb75978,null))[_0x022f('0x1f')](removeEntity(_0xb75978,null))[_0x022f('0x40')](handleError(_0xb75978,null));};exports[_0x022f('0x46')]=function(_0x49c96e,_0x3e0bfc){return db[_0x022f('0x25')][_0x022f('0x46')]()[_0x022f('0x1f')](respondWithResult(_0x3e0bfc,null))[_0x022f('0x40')](handleError(_0x3e0bfc,null));};exports[_0x022f('0x47')]=function(_0x191ca9,_0x24f336,_0x5c6b01){var _0x3a612f={'raw':!![],'where':{}};var _0x12ee8f={};var _0x1d036e={'count':0x0,'rows':[]};return db[_0x022f('0x25')][_0x022f('0x48')]({'where':{'id':_0x191ca9['params']['id']}})[_0x022f('0x1f')](handleEntityNotFound(_0x24f336,null))[_0x022f('0x1f')](function(_0x2f828d){if(_0x2f828d){_0x12ee8f['model']=_[_0x022f('0x2c')](db[_0x022f('0x49')][_0x022f('0x26')]);_0x12ee8f[_0x022f('0x2b')]=_[_0x022f('0x2c')](_0x191ca9[_0x022f('0x2b')]);_0x12ee8f[_0x022f('0x2d')]=_['intersection'](_0x12ee8f[_0x022f('0x29')],_0x12ee8f['query']);_0x3a612f['attributes']=_[_0x022f('0x2f')](_0x12ee8f[_0x022f('0x29')],qs['fields'](_0x191ca9[_0x022f('0x2b')]['fields']));_0x3a612f['attributes']=_0x3a612f[_0x022f('0x2e')]['length']?_0x3a612f[_0x022f('0x2e')]:_0x12ee8f[_0x022f('0x29')];if(!_0x191ca9['query'][_0x022f('0x32')](_0x022f('0x33'))){_0x3a612f[_0x022f('0x17')]=qs['limit'](_0x191ca9[_0x022f('0x2b')][_0x022f('0x17')]);_0x3a612f[_0x022f('0x34')]=qs[_0x022f('0x34')](_0x191ca9['query'][_0x022f('0x34')]);}_0x3a612f[_0x022f('0x35')]=qs[_0x022f('0x36')](_0x191ca9[_0x022f('0x2b')][_0x022f('0x36')]);_0x3a612f['where']=qs[_0x022f('0x2d')](_[_0x022f('0x38')](_0x191ca9[_0x022f('0x2b')],_0x12ee8f[_0x022f('0x2d')]));_0x3a612f['where'][_0x022f('0x4a')]=_0x2f828d['id'];if(_0x191ca9[_0x022f('0x2b')]['filter']){_0x3a612f[_0x022f('0x37')]=_[_0x022f('0x3a')](_0x3a612f[_0x022f('0x37')],{'$or':_[_0x022f('0x2a')](_0x3a612f['attributes'],function(_0x340672){var _0x358859={};_0x358859[_0x340672]={'$like':'%'+_0x191ca9[_0x022f('0x2b')]['filter']+'%'};return _0x358859;})});}_0x3a612f=_['merge']({},_0x3a612f,_0x191ca9['options']);return db[_0x022f('0x49')][_0x022f('0x19')]({'where':_0x3a612f[_0x022f('0x37')]})[_0x022f('0x1f')](function(_0x57cbd5){_0x1d036e['count']=_0x57cbd5;if(_0x191ca9['query'][_0x022f('0x3c')]){_0x3a612f['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x022f('0x3e')](_0x3a612f);})[_0x022f('0x1f')](function(_0x3a0cde){_0x1d036e['rows']=_0x3a0cde;return _0x1d036e;});}})[_0x022f('0x1f')](respondWithFilteredResult(_0x24f336,_0x3a612f))[_0x022f('0x40')](handleError(_0x24f336,null));}; \ No newline at end of file +var _0xa5f8=['end','error','stack','name','send','index','map','JscriptySessionReport','fieldName','type','model','keys','filters','intersection','attributes','length','query','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','fields','include','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then'];(function(_0x570afc,_0x3746d4){var _0x408c2f=function(_0x2c3910){while(--_0x2c3910){_0x570afc['push'](_0x570afc['shift']());}};_0x408c2f(++_0x3746d4);}(_0xa5f8,0x1ba));var _0x8a5f=function(_0x2f6168,_0x564bcc){_0x2f6168=_0x2f6168-0x0;var _0xe4f30d=_0xa5f8[_0x2f6168];return _0xe4f30d;};'use strict';var emlformat=require(_0x8a5f('0x0'));var rimraf=require(_0x8a5f('0x1'));var zipdir=require(_0x8a5f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a5f('0x3'));var moment=require(_0x8a5f('0x4'));var BPromise=require(_0x8a5f('0x5'));var Mustache=require(_0x8a5f('0x6'));var util=require(_0x8a5f('0x7'));var path=require(_0x8a5f('0x8'));var sox=require(_0x8a5f('0x9'));var csv=require(_0x8a5f('0xa'));var ejs=require(_0x8a5f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8a5f('0xc'));var crypto=require(_0x8a5f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8a5f('0xe'));var toCsv=require(_0x8a5f('0xa'));var querystring=require(_0x8a5f('0xf'));var Papa=require('papaparse');var Redis=require(_0x8a5f('0x10'));var authService=require(_0x8a5f('0x11'));var qs=require(_0x8a5f('0x12'));var as=require(_0x8a5f('0x13'));var hardwareService=require(_0x8a5f('0x14'));var logger=require(_0x8a5f('0x15'))('api');var utils=require(_0x8a5f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8a5f('0x17'))['db'];function respondWithStatusCode(_0x16b1c3,_0x1ea301){_0x1ea301=_0x1ea301||0xcc;return function(_0x1b2d35){if(_0x1b2d35){return _0x16b1c3[_0x8a5f('0x18')](_0x1ea301);}return _0x16b1c3[_0x8a5f('0x19')](_0x1ea301)['end']();};}function respondWithResult(_0x28117d,_0x2b715f){_0x2b715f=_0x2b715f||0xc8;return function(_0x214afd){if(_0x214afd){return _0x28117d[_0x8a5f('0x19')](_0x2b715f)[_0x8a5f('0x1a')](_0x214afd);}};}function respondWithFilteredResult(_0x55d316,_0x3e4a65){return function(_0x446529){if(_0x446529){var _0x354e1f=typeof _0x3e4a65['offset']===_0x8a5f('0x1b')&&typeof _0x3e4a65[_0x8a5f('0x1c')]===_0x8a5f('0x1b');var _0x3ff825=_0x446529[_0x8a5f('0x1d')];var _0x2047a4=_0x354e1f?0x0:_0x3e4a65[_0x8a5f('0x1e')];var _0x1dce98=_0x354e1f?_0x446529[_0x8a5f('0x1d')]:_0x3e4a65[_0x8a5f('0x1e')]+_0x3e4a65[_0x8a5f('0x1c')];var _0x38b6fc;if(_0x1dce98>=_0x3ff825){_0x1dce98=_0x3ff825;_0x38b6fc=0xc8;}else{_0x38b6fc=0xce;}_0x55d316[_0x8a5f('0x19')](_0x38b6fc);return _0x55d316[_0x8a5f('0x1f')](_0x8a5f('0x20'),_0x2047a4+'-'+_0x1dce98+'/'+_0x3ff825)['json'](_0x446529);}return null;};}function patchUpdates(_0x5311a9){return function(_0x5b4fb8){try{jsonpatch[_0x8a5f('0x21')](_0x5b4fb8,_0x5311a9,!![]);}catch(_0x1c77ae){return BPromise['reject'](_0x1c77ae);}return _0x5b4fb8[_0x8a5f('0x22')]();};}function saveUpdates(_0x4c1add,_0x586a36){return function(_0x3b402d){if(_0x3b402d){return _0x3b402d[_0x8a5f('0x23')](_0x4c1add)['then'](function(_0xfead9a){return _0xfead9a;});}return null;};}function removeEntity(_0x139a76,_0x33d573){return function(_0x3ce3c7){if(_0x3ce3c7){return _0x3ce3c7[_0x8a5f('0x24')]()[_0x8a5f('0x25')](function(){_0x139a76[_0x8a5f('0x19')](0xcc)[_0x8a5f('0x26')]();});}};}function handleEntityNotFound(_0x58beb8,_0x506b03){return function(_0xe03648){if(!_0xe03648){_0x58beb8[_0x8a5f('0x18')](0x194);}return _0xe03648;};}function handleError(_0x36f363,_0x5b0273){_0x5b0273=_0x5b0273||0x1f4;return function(_0x260d81){logger[_0x8a5f('0x27')](_0x260d81[_0x8a5f('0x28')]);if(_0x260d81[_0x8a5f('0x29')]){delete _0x260d81['name'];}_0x36f363[_0x8a5f('0x19')](_0x5b0273)[_0x8a5f('0x2a')](_0x260d81);};}exports[_0x8a5f('0x2b')]=function(_0x487545,_0x2a5f1f){var _0x4c1369={},_0xae4c87={},_0x2d5614={'count':0x0,'rows':[]};var _0x42b58b=_[_0x8a5f('0x2c')](db[_0x8a5f('0x2d')]['rawAttributes'],function(_0x31d192){return{'name':_0x31d192[_0x8a5f('0x2e')],'type':_0x31d192[_0x8a5f('0x2f')]['key']};});_0xae4c87[_0x8a5f('0x30')]=_['map'](_0x42b58b,_0x8a5f('0x29'));_0xae4c87['query']=_[_0x8a5f('0x31')](_0x487545['query']);_0xae4c87[_0x8a5f('0x32')]=_[_0x8a5f('0x33')](_0xae4c87['model'],_0xae4c87['query']);_0x4c1369['attributes']=_[_0x8a5f('0x33')](_0xae4c87['model'],qs['fields'](_0x487545['query']['fields']));_0x4c1369[_0x8a5f('0x34')]=_0x4c1369[_0x8a5f('0x34')][_0x8a5f('0x35')]?_0x4c1369[_0x8a5f('0x34')]:_0xae4c87[_0x8a5f('0x30')];if(!_0x487545[_0x8a5f('0x36')]['hasOwnProperty'](_0x8a5f('0x37'))){_0x4c1369[_0x8a5f('0x1c')]=qs[_0x8a5f('0x1c')](_0x487545[_0x8a5f('0x36')][_0x8a5f('0x1c')]);_0x4c1369[_0x8a5f('0x1e')]=qs[_0x8a5f('0x1e')](_0x487545[_0x8a5f('0x36')]['offset']);}_0x4c1369[_0x8a5f('0x38')]=qs[_0x8a5f('0x39')](_0x487545[_0x8a5f('0x36')][_0x8a5f('0x39')]);_0x4c1369[_0x8a5f('0x3a')]=qs['filters'](_[_0x8a5f('0x3b')](_0x487545[_0x8a5f('0x36')],_0xae4c87['filters']),_0x42b58b);if(_0x487545[_0x8a5f('0x36')][_0x8a5f('0x3c')]){_0x4c1369[_0x8a5f('0x3a')]=_[_0x8a5f('0x3d')](_0x4c1369['where'],{'$or':_['map'](_0x42b58b,function(_0x1716d3){if(_0x1716d3[_0x8a5f('0x2f')]!==_0x8a5f('0x3e')){var _0x1a7d22={};_0x1a7d22[_0x1716d3[_0x8a5f('0x29')]]={'$like':'%'+_0x487545[_0x8a5f('0x36')]['filter']+'%'};return _0x1a7d22;}})});}_0x4c1369=_['merge']({},_0x4c1369,_0x487545[_0x8a5f('0x3f')]);var _0xd2a388={'where':_0x4c1369[_0x8a5f('0x3a')]};return db['JscriptySessionReport'][_0x8a5f('0x1d')](_0xd2a388)['then'](function(_0x16d687){_0x2d5614[_0x8a5f('0x1d')]=_0x16d687;if(_0x487545[_0x8a5f('0x36')][_0x8a5f('0x40')]){_0x4c1369['include']=[{'all':!![]}];}return db[_0x8a5f('0x2d')][_0x8a5f('0x41')](_0x4c1369);})[_0x8a5f('0x25')](function(_0x5b5d76){_0x2d5614[_0x8a5f('0x42')]=_0x5b5d76;return _0x2d5614;})[_0x8a5f('0x25')](respondWithFilteredResult(_0x2a5f1f,_0x4c1369))[_0x8a5f('0x43')](handleError(_0x2a5f1f,null));};exports[_0x8a5f('0x44')]=function(_0x202123,_0x4083f3){var _0xc29bad={'raw':!![],'where':{'id':_0x202123[_0x8a5f('0x45')]['id']}},_0x429179={};_0x429179[_0x8a5f('0x30')]=_[_0x8a5f('0x31')](db['JscriptySessionReport'][_0x8a5f('0x46')]);_0x429179['query']=_[_0x8a5f('0x31')](_0x202123[_0x8a5f('0x36')]);_0x429179[_0x8a5f('0x32')]=_[_0x8a5f('0x33')](_0x429179['model'],_0x429179[_0x8a5f('0x36')]);_0xc29bad[_0x8a5f('0x34')]=_[_0x8a5f('0x33')](_0x429179[_0x8a5f('0x30')],qs['fields'](_0x202123[_0x8a5f('0x36')][_0x8a5f('0x47')]));_0xc29bad['attributes']=_0xc29bad[_0x8a5f('0x34')][_0x8a5f('0x35')]?_0xc29bad['attributes']:_0x429179['model'];if(_0x202123[_0x8a5f('0x36')][_0x8a5f('0x40')]){_0xc29bad[_0x8a5f('0x48')]=[{'all':!![]}];}_0xc29bad=_[_0x8a5f('0x3d')]({},_0xc29bad,_0x202123['options']);return db[_0x8a5f('0x2d')][_0x8a5f('0x49')](_0xc29bad)[_0x8a5f('0x25')](handleEntityNotFound(_0x4083f3,null))[_0x8a5f('0x25')](respondWithResult(_0x4083f3,null))[_0x8a5f('0x43')](handleError(_0x4083f3,null));};exports[_0x8a5f('0x4a')]=function(_0x4b7bec,_0xfb6f81){return db[_0x8a5f('0x2d')][_0x8a5f('0x4a')](_0x4b7bec['body'],{})[_0x8a5f('0x25')](respondWithResult(_0xfb6f81,0xc9))[_0x8a5f('0x43')](handleError(_0xfb6f81,null));};exports[_0x8a5f('0x23')]=function(_0x2ea6a9,_0x18cb1e){if(_0x2ea6a9[_0x8a5f('0x4b')]['id']){delete _0x2ea6a9[_0x8a5f('0x4b')]['id'];}return db[_0x8a5f('0x2d')][_0x8a5f('0x49')]({'where':{'id':_0x2ea6a9[_0x8a5f('0x45')]['id']}})[_0x8a5f('0x25')](handleEntityNotFound(_0x18cb1e,null))[_0x8a5f('0x25')](saveUpdates(_0x2ea6a9[_0x8a5f('0x4b')],null))[_0x8a5f('0x25')](respondWithResult(_0x18cb1e,null))[_0x8a5f('0x43')](handleError(_0x18cb1e,null));};exports[_0x8a5f('0x24')]=function(_0x1d9b39,_0x3d995b){return db[_0x8a5f('0x2d')][_0x8a5f('0x49')]({'where':{'id':_0x1d9b39[_0x8a5f('0x45')]['id']}})[_0x8a5f('0x25')](handleEntityNotFound(_0x3d995b,null))[_0x8a5f('0x25')](removeEntity(_0x3d995b,null))['catch'](handleError(_0x3d995b,null));};exports[_0x8a5f('0x4c')]=function(_0xe6cc3a,_0x489c45){return db['JscriptySessionReport'][_0x8a5f('0x4c')]()[_0x8a5f('0x25')](respondWithResult(_0x489c45,null))[_0x8a5f('0x43')](handleError(_0x489c45,null));};exports[_0x8a5f('0x4d')]=function(_0x17074b,_0x645fed,_0xb66762){var _0x5395de={'raw':!![],'where':{}};var _0x11437b={};var _0x1a6b41={'count':0x0,'rows':[]};return db[_0x8a5f('0x2d')][_0x8a5f('0x4e')]({'where':{'id':_0x17074b[_0x8a5f('0x45')]['id']}})['then'](handleEntityNotFound(_0x645fed,null))[_0x8a5f('0x25')](function(_0x2ae57c){if(_0x2ae57c){_0x11437b['model']=_[_0x8a5f('0x31')](db['JscriptyQuestionReport'][_0x8a5f('0x46')]);_0x11437b[_0x8a5f('0x36')]=_[_0x8a5f('0x31')](_0x17074b[_0x8a5f('0x36')]);_0x11437b[_0x8a5f('0x32')]=_['intersection'](_0x11437b[_0x8a5f('0x30')],_0x11437b[_0x8a5f('0x36')]);_0x5395de['attributes']=_[_0x8a5f('0x33')](_0x11437b[_0x8a5f('0x30')],qs[_0x8a5f('0x47')](_0x17074b[_0x8a5f('0x36')][_0x8a5f('0x47')]));_0x5395de['attributes']=_0x5395de[_0x8a5f('0x34')][_0x8a5f('0x35')]?_0x5395de['attributes']:_0x11437b['model'];if(!_0x17074b[_0x8a5f('0x36')]['hasOwnProperty'](_0x8a5f('0x37'))){_0x5395de[_0x8a5f('0x1c')]=qs[_0x8a5f('0x1c')](_0x17074b[_0x8a5f('0x36')][_0x8a5f('0x1c')]);_0x5395de['offset']=qs[_0x8a5f('0x1e')](_0x17074b[_0x8a5f('0x36')]['offset']);}_0x5395de[_0x8a5f('0x38')]=qs['sort'](_0x17074b[_0x8a5f('0x36')][_0x8a5f('0x39')]);_0x5395de[_0x8a5f('0x3a')]=qs['filters'](_[_0x8a5f('0x3b')](_0x17074b[_0x8a5f('0x36')],_0x11437b['filters']));_0x5395de[_0x8a5f('0x3a')]['SessionId']=_0x2ae57c['id'];if(_0x17074b[_0x8a5f('0x36')]['filter']){_0x5395de[_0x8a5f('0x3a')]=_['merge'](_0x5395de[_0x8a5f('0x3a')],{'$or':_['map'](_0x5395de[_0x8a5f('0x34')],function(_0x521df2){var _0x24c95e={};_0x24c95e[_0x521df2]={'$like':'%'+_0x17074b['query'][_0x8a5f('0x3c')]+'%'};return _0x24c95e;})});}_0x5395de=_[_0x8a5f('0x3d')]({},_0x5395de,_0x17074b['options']);return db[_0x8a5f('0x4f')]['count']({'where':_0x5395de[_0x8a5f('0x3a')]})[_0x8a5f('0x25')](function(_0x21eb1c){_0x1a6b41[_0x8a5f('0x1d')]=_0x21eb1c;if(_0x17074b[_0x8a5f('0x36')][_0x8a5f('0x40')]){_0x5395de[_0x8a5f('0x48')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x8a5f('0x41')](_0x5395de);})['then'](function(_0x1a66df){_0x1a6b41[_0x8a5f('0x42')]=_0x1a66df;return _0x1a6b41;});}})['then'](respondWithFilteredResult(_0x645fed,_0x5395de))[_0x8a5f('0x43')](handleError(_0x645fed,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 7f552bf..35777ba 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 _0x187d=['define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x1f146c,_0xfb86d6){var _0x2354fb=function(_0x2078d0){while(--_0x2078d0){_0x1f146c['push'](_0x1f146c['shift']());}};_0x2354fb(++_0xfb86d6);}(_0x187d,0x93));var _0xd187=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x187d[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d17=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x45c08e,_0x522740){var _0xc85dbd=function(_0xb614bd){while(--_0xb614bd){_0x45c08e['push'](_0x45c08e['shift']());}};_0xc85dbd(++_0x522740);}(_0x5d17,0x114));var _0x75d1=function(_0x818500,_0xe7620c){_0x818500=_0x818500-0x0;var _0x342023=_0x5d17[_0x818500];return _0x342023;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75d1('0x2'));var BPromise=require(_0x75d1('0x3'));var rp=require(_0x75d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var attributes=require(_0x75d1('0x7'));module[_0x75d1('0x8')]=function(_0x56ac0a,_0x458681){return _0x56ac0a[_0x75d1('0x9')](_0x75d1('0xa'),attributes,{'tableName':_0x75d1('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 dc0a1b6..c11122a 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 _0x0295=['client','http','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x48a2ba,_0xe3a804){var _0x52b1a3=function(_0x320232){while(--_0x320232){_0x48a2ba['push'](_0x48a2ba['shift']());}};_0x52b1a3(++_0xe3a804);}(_0x0295,0x1f0));var _0x5029=function(_0x3d823b,_0x245c0d){_0x3d823b=_0x3d823b-0x0;var _0x1c23cd=_0x0295[_0x3d823b];return _0x1c23cd;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file +var _0xe3da=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s'];(function(_0x148a81,_0x144e37){var _0x3d72dc=function(_0x1d5573){while(--_0x1d5573){_0x148a81['push'](_0x148a81['shift']());}};_0x3d72dc(++_0x144e37);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'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);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 5c28337..c6b158e 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 _0x40fb=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile'];(function(_0x393592,_0x29fecb){var _0x5eeb35=function(_0x55dde5){while(--_0x55dde5){_0x393592['push'](_0x393592['shift']());}};_0x5eeb35(++_0x29fecb);}(_0x40fb,0x16a));var _0xb40f=function(_0x4eee80,_0x4a0b9a){_0x4eee80=_0x4eee80-0x0;var _0x10d6f0=_0x40fb[_0x4eee80];return _0x10d6f0;};'use strict';var multer=require(_0xb40f('0x0'));var util=require(_0xb40f('0x1'));var path=require(_0xb40f('0x2'));var timeout=require(_0xb40f('0x3'));var express=require('express');var router=express[_0xb40f('0x4')]();var fs_extra=require(_0xb40f('0x5'));var auth=require(_0xb40f('0x6'));var interaction=require(_0xb40f('0x7'));var config=require(_0xb40f('0x8'));var controller=require(_0xb40f('0x9'));router[_0xb40f('0xa')]('/',controller[_0xb40f('0xb')]);router[_0xb40f('0xc')](_0xb40f('0xd'),auth[_0xb40f('0xe')](),controller[_0xb40f('0xf')]);router[_0xb40f('0xa')](_0xb40f('0x10'),auth['isAuthenticated'](),controller[_0xb40f('0x11')]);module[_0xb40f('0x12')]=router; \ No newline at end of file +var _0x660d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','put','/:id','isAuthenticated','update','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x660d,0xaf));var _0xd660=function(_0x35181c,_0x82694a){_0x35181c=_0x35181c-0x0;var _0xe14bf9=_0x660d[_0x35181c];return _0xe14bf9;};'use strict';var multer=require(_0xd660('0x0'));var util=require(_0xd660('0x1'));var path=require(_0xd660('0x2'));var timeout=require(_0xd660('0x3'));var express=require(_0xd660('0x4'));var router=express[_0xd660('0x5')]();var fs_extra=require(_0xd660('0x6'));var auth=require(_0xd660('0x7'));var interaction=require(_0xd660('0x8'));var config=require('../../config/environment');var controller=require('./license.controller');router[_0xd660('0x9')]('/',controller[_0xd660('0xa')]);router[_0xd660('0xb')](_0xd660('0xc'),auth[_0xd660('0xd')](),controller[_0xd660('0xe')]);router[_0xd660('0x9')]('/download_log_file',auth[_0xd660('0xd')](),controller['downloadLogFile']);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index b4067c1..fddd914 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 _0x5b36=['TEXT','STRING'];(function(_0x1573b1,_0x403e1a){var _0x2d1a3f=function(_0x4e6974){while(--_0x4e6974){_0x1573b1['push'](_0x1573b1['shift']());}};_0x2d1a3f(++_0x403e1a);}(_0x5b36,0x6c));var _0x65b3=function(_0x4a8099,_0x178a95){_0x4a8099=_0x4a8099-0x0;var _0x2e804e=_0x5b36[_0x4a8099];return _0x2e804e;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0x65b3('0x0')]},'data1':{'type':Sequelize[_0x65b3('0x1')]},'data2':{'type':Sequelize[_0x65b3('0x1')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x76b4=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0xe5b349,_0x5f06e4){var _0x26b0ad=function(_0x1a97f1){while(--_0x1a97f1){_0xe5b349['push'](_0xe5b349['shift']());}};_0x26b0ad(++_0x5f06e4);}(_0x76b4,0x126));var _0x476b=function(_0x4a3378,_0x23bb06){_0x4a3378=_0x4a3378-0x0;var _0x359a26=_0x76b4[_0x4a3378];return _0x359a26;};'use strict';var Sequelize=require(_0x476b('0x0'));module[_0x476b('0x1')]={'license':{'type':Sequelize[_0x476b('0x2')]},'data1':{'type':Sequelize[_0x476b('0x3')]},'data2':{'type':Sequelize[_0x476b('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x476b('0x4')],'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 93f5f25..565da4d 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 _0x7588=['body','find','params','downloadLogFile','join','/var','setHeader','Content-disposition','set','text/plain','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','model','License','rawAttributes','query','keys','filters','intersection','attributes','fields','length','options','getLicense','catch'];(function(_0x2a7ed7,_0x150264){var _0x7c9aed=function(_0x538425){while(--_0x538425){_0x2a7ed7['push'](_0x2a7ed7['shift']());}};_0x7c9aed(++_0x150264);}(_0x7588,0x88));var _0x8758=function(_0x37070f,_0x5390d1){_0x37070f=_0x37070f-0x0;var _0x1d3506=_0x7588[_0x37070f];return _0x1d3506;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8758('0x0'));var zipdir=require(_0x8758('0x1'));var jsonpatch=require(_0x8758('0x2'));var rp=require(_0x8758('0x3'));var moment=require('moment');var BPromise=require(_0x8758('0x4'));var Mustache=require('mustache');var util=require(_0x8758('0x5'));var path=require(_0x8758('0x6'));var sox=require('sox');var csv=require(_0x8758('0x7'));var ejs=require(_0x8758('0x8'));var fs=require('fs');var fs_extra=require(_0x8758('0x9'));var _=require(_0x8758('0xa'));var squel=require(_0x8758('0xb'));var crypto=require('crypto');var jsforce=require(_0x8758('0xc'));var deskjs=require(_0x8758('0xd'));var toCsv=require(_0x8758('0x7'));var querystring=require(_0x8758('0xe'));var Papa=require(_0x8758('0xf'));var Redis=require(_0x8758('0x10'));var authService=require(_0x8758('0x11'));var qs=require(_0x8758('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8758('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8758('0x14'));var licenseUtil=require(_0x8758('0x15'));var db=require(_0x8758('0x16'))['db'];function respondWithStatusCode(_0x481bc6,_0x350b31){_0x350b31=_0x350b31||0xcc;return function(_0x4c7435){if(_0x4c7435){return _0x481bc6['sendStatus'](_0x350b31);}return _0x481bc6[_0x8758('0x17')](_0x350b31)[_0x8758('0x18')]();};}function respondWithResult(_0x46a3fb,_0x43942c){_0x43942c=_0x43942c||0xc8;return function(_0xd02725){if(_0xd02725){return _0x46a3fb[_0x8758('0x17')](_0x43942c)['json'](_0xd02725);}};}function respondWithFilteredResult(_0x179da1,_0x336550){return function(_0xd3afe5){if(_0xd3afe5){var _0x3b01b5=typeof _0x336550[_0x8758('0x19')]===_0x8758('0x1a')&&typeof _0x336550[_0x8758('0x1b')]===_0x8758('0x1a');var _0x59c579=_0xd3afe5[_0x8758('0x1c')];var _0x277274=_0x3b01b5?0x0:_0x336550['offset'];var _0xb9150e=_0x3b01b5?_0xd3afe5[_0x8758('0x1c')]:_0x336550[_0x8758('0x19')]+_0x336550[_0x8758('0x1b')];var _0x4d8f8c;if(_0xb9150e>=_0x59c579){_0xb9150e=_0x59c579;_0x4d8f8c=0xc8;}else{_0x4d8f8c=0xce;}_0x179da1[_0x8758('0x17')](_0x4d8f8c);return _0x179da1['set'](_0x8758('0x1d'),_0x277274+'-'+_0xb9150e+'/'+_0x59c579)['json'](_0xd3afe5);}return null;};}function patchUpdates(_0x4a8b1a){return function(_0x4ceb59){try{jsonpatch[_0x8758('0x1e')](_0x4ceb59,_0x4a8b1a,!![]);}catch(_0x1972b3){return BPromise['reject'](_0x1972b3);}return _0x4ceb59[_0x8758('0x1f')]();};}function saveUpdates(_0x57a97c,_0x20634f){return function(_0x157ae3){if(_0x157ae3){return _0x157ae3[_0x8758('0x20')](_0x57a97c)[_0x8758('0x21')](function(_0x4ae1aa){return _0x4ae1aa;});}return null;};}function removeEntity(_0x4942a0,_0x1f4e75){return function(_0x2e80b5){if(_0x2e80b5){return _0x2e80b5[_0x8758('0x22')]()[_0x8758('0x21')](function(){_0x4942a0[_0x8758('0x17')](0xcc)[_0x8758('0x18')]();});}};}function handleEntityNotFound(_0x307357,_0x10a622){return function(_0x5cacf6){if(!_0x5cacf6){_0x307357[_0x8758('0x23')](0x194);}return _0x5cacf6;};}function handleError(_0x15dd42,_0x1a1746){_0x1a1746=_0x1a1746||0x1f4;return function(_0xb8eff8){logger[_0x8758('0x24')](_0xb8eff8[_0x8758('0x25')]);if(_0xb8eff8[_0x8758('0x26')]){delete _0xb8eff8[_0x8758('0x26')];}_0x15dd42[_0x8758('0x17')](_0x1a1746)[_0x8758('0x27')](_0xb8eff8);};}var utilLicense=require(_0x8758('0x15'));exports['index']=function(_0x518ae4,_0x4590ee){var _0x21ecf0={'raw':!![],'where':{'id':0x1}},_0x7bfee1={};_0x7bfee1[_0x8758('0x28')]=_['keys'](db[_0x8758('0x29')][_0x8758('0x2a')]);_0x7bfee1[_0x8758('0x2b')]=_[_0x8758('0x2c')](_0x518ae4[_0x8758('0x2b')]);_0x7bfee1[_0x8758('0x2d')]=_[_0x8758('0x2e')](_0x7bfee1[_0x8758('0x28')],_0x7bfee1['query']);_0x21ecf0[_0x8758('0x2f')]=_[_0x8758('0x2e')](_0x7bfee1['model'],qs[_0x8758('0x30')](_0x518ae4[_0x8758('0x2b')]['fields']));_0x21ecf0[_0x8758('0x2f')]=_0x21ecf0[_0x8758('0x2f')][_0x8758('0x31')]?_0x21ecf0[_0x8758('0x2f')]:_0x7bfee1[_0x8758('0x28')];_0x21ecf0=_['merge']({},_0x21ecf0,_0x518ae4[_0x8758('0x32')]);return utilLicense[_0x8758('0x33')](_0x21ecf0)[_0x8758('0x21')](respondWithResult(_0x4590ee,null))[_0x8758('0x34')](handleError(_0x4590ee,null));};exports[_0x8758('0x20')]=function(_0x1c2418,_0x1c1058){if(_0x1c2418['body']['id']){delete _0x1c2418[_0x8758('0x35')]['id'];}return db[_0x8758('0x29')][_0x8758('0x36')]({'where':{'id':_0x1c2418[_0x8758('0x37')]['id']}})['then'](handleEntityNotFound(_0x1c1058,null))[_0x8758('0x21')](function(_0x47da5e){var _0x12c74a=_0x47da5e['get']({'plain':!![]});return utilLicense['checkLicense'](_0x12c74a,_0x1c2418['body']['key']);})[_0x8758('0x21')](function(_0xe85190){if(!_0xe85190['demo']){return saveUpdates(_0x1c2418[_0x8758('0x35')],null);}return _0xe85190;})[_0x8758('0x21')](respondWithResult(_0x1c1058,null))['catch'](handleError(_0x1c1058,null));};exports[_0x8758('0x38')]=function(_0x5099db,_0x22db43){var _0x2cefa8='license-info.log';var _0x5e9b9c=path[_0x8758('0x39')](_0x8758('0x3a'),'log','xcally',_0x2cefa8);_0x22db43[_0x8758('0x3b')](_0x8758('0x3c'),'attachment;\x20filename='+_0x2cefa8);_0x22db43[_0x8758('0x3d')]('Content-Type',_0x8758('0x3e'));_0x22db43['download'](_0x5e9b9c);}; \ No newline at end of file +var _0x8ea3=['fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','reject','then','destroy','stack','name','send','index','model','keys','License','rawAttributes','query','intersection','fields','attributes','length','merge','getLicense','update','body','find','params','get','checkLicense','demo','catch','downloadLogFile','join','/var','xcally','attachment;\x20filename=','Content-Type','rimraf','zip-dir','mustache','util','path','to-csv','ejs'];(function(_0x46b5b6,_0x531dfd){var _0x2eed89=function(_0x4d7233){while(--_0x4d7233){_0x46b5b6['push'](_0x46b5b6['shift']());}};_0x2eed89(++_0x531dfd);}(_0x8ea3,0x12a));var _0x38ea=function(_0x33ff24,_0x587984){_0x33ff24=_0x33ff24-0x0;var _0x503f31=_0x8ea3[_0x33ff24];return _0x503f31;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x38ea('0x0'));var zipdir=require(_0x38ea('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x38ea('0x2'));var util=require(_0x38ea('0x3'));var path=require(_0x38ea('0x4'));var sox=require('sox');var csv=require(_0x38ea('0x5'));var ejs=require(_0x38ea('0x6'));var fs=require('fs');var fs_extra=require(_0x38ea('0x7'));var _=require('lodash');var squel=require(_0x38ea('0x8'));var crypto=require(_0x38ea('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x38ea('0xa'));var toCsv=require(_0x38ea('0x5'));var querystring=require(_0x38ea('0xb'));var Papa=require(_0x38ea('0xc'));var Redis=require(_0x38ea('0xd'));var authService=require(_0x38ea('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x38ea('0xf'));var hardwareService=require(_0x38ea('0x10'));var logger=require(_0x38ea('0x11'))(_0x38ea('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x38ea('0x13'))['db'];function respondWithStatusCode(_0x4c1c15,_0x2d8158){_0x2d8158=_0x2d8158||0xcc;return function(_0x41cd5d){if(_0x41cd5d){return _0x4c1c15[_0x38ea('0x14')](_0x2d8158);}return _0x4c1c15[_0x38ea('0x15')](_0x2d8158)[_0x38ea('0x16')]();};}function respondWithResult(_0x4ab115,_0x2fc35b){_0x2fc35b=_0x2fc35b||0xc8;return function(_0xcef40f){if(_0xcef40f){return _0x4ab115[_0x38ea('0x15')](_0x2fc35b)[_0x38ea('0x17')](_0xcef40f);}};}function respondWithFilteredResult(_0x23862c,_0x1761fe){return function(_0x49333c){if(_0x49333c){var _0x21f67f=typeof _0x1761fe['offset']===_0x38ea('0x18')&&typeof _0x1761fe['limit']===_0x38ea('0x18');var _0x40c992=_0x49333c[_0x38ea('0x19')];var _0x42b4d0=_0x21f67f?0x0:_0x1761fe[_0x38ea('0x1a')];var _0x3e3108=_0x21f67f?_0x49333c[_0x38ea('0x19')]:_0x1761fe[_0x38ea('0x1a')]+_0x1761fe['limit'];var _0x3d738b;if(_0x3e3108>=_0x40c992){_0x3e3108=_0x40c992;_0x3d738b=0xc8;}else{_0x3d738b=0xce;}_0x23862c['status'](_0x3d738b);return _0x23862c['set'](_0x38ea('0x1b'),_0x42b4d0+'-'+_0x3e3108+'/'+_0x40c992)[_0x38ea('0x17')](_0x49333c);}return null;};}function patchUpdates(_0x22ea7d){return function(_0x426ae4){try{jsonpatch[_0x38ea('0x1c')](_0x426ae4,_0x22ea7d,!![]);}catch(_0x5ba4fb){return BPromise[_0x38ea('0x1d')](_0x5ba4fb);}return _0x426ae4['save']();};}function saveUpdates(_0x1ed242,_0x5f0ad0){return function(_0x27ae7a){if(_0x27ae7a){return _0x27ae7a['update'](_0x1ed242)[_0x38ea('0x1e')](function(_0x1d33c7){return _0x1d33c7;});}return null;};}function removeEntity(_0x527e8f,_0x4829ee){return function(_0x25316f){if(_0x25316f){return _0x25316f[_0x38ea('0x1f')]()['then'](function(){_0x527e8f[_0x38ea('0x15')](0xcc)[_0x38ea('0x16')]();});}};}function handleEntityNotFound(_0x2e03d4,_0x5505ba){return function(_0xad8886){if(!_0xad8886){_0x2e03d4[_0x38ea('0x14')](0x194);}return _0xad8886;};}function handleError(_0x200e9b,_0x19b517){_0x19b517=_0x19b517||0x1f4;return function(_0xd9ef76){logger['error'](_0xd9ef76[_0x38ea('0x20')]);if(_0xd9ef76['name']){delete _0xd9ef76[_0x38ea('0x21')];}_0x200e9b[_0x38ea('0x15')](_0x19b517)[_0x38ea('0x22')](_0xd9ef76);};}var utilLicense=require('../../config/license/util');exports[_0x38ea('0x23')]=function(_0xa3d62,_0x47139e){var _0x17c2f4={'raw':!![],'where':{'id':0x1}},_0x302f24={};_0x302f24[_0x38ea('0x24')]=_[_0x38ea('0x25')](db[_0x38ea('0x26')][_0x38ea('0x27')]);_0x302f24[_0x38ea('0x28')]=_[_0x38ea('0x25')](_0xa3d62['query']);_0x302f24['filters']=_[_0x38ea('0x29')](_0x302f24['model'],_0x302f24[_0x38ea('0x28')]);_0x17c2f4['attributes']=_[_0x38ea('0x29')](_0x302f24[_0x38ea('0x24')],qs['fields'](_0xa3d62[_0x38ea('0x28')][_0x38ea('0x2a')]));_0x17c2f4[_0x38ea('0x2b')]=_0x17c2f4[_0x38ea('0x2b')][_0x38ea('0x2c')]?_0x17c2f4['attributes']:_0x302f24['model'];_0x17c2f4=_[_0x38ea('0x2d')]({},_0x17c2f4,_0xa3d62['options']);return utilLicense[_0x38ea('0x2e')](_0x17c2f4)['then'](respondWithResult(_0x47139e,null))['catch'](handleError(_0x47139e,null));};exports[_0x38ea('0x2f')]=function(_0x5cc162,_0x244c06){if(_0x5cc162[_0x38ea('0x30')]['id']){delete _0x5cc162[_0x38ea('0x30')]['id'];}return db['License'][_0x38ea('0x31')]({'where':{'id':_0x5cc162[_0x38ea('0x32')]['id']}})[_0x38ea('0x1e')](handleEntityNotFound(_0x244c06,null))[_0x38ea('0x1e')](function(_0x3bb283){var _0x20010c=_0x3bb283[_0x38ea('0x33')]({'plain':!![]});return utilLicense[_0x38ea('0x34')](_0x20010c,_0x5cc162[_0x38ea('0x30')]['key']);})['then'](function(_0x331f1c){if(!_0x331f1c[_0x38ea('0x35')]){return saveUpdates(_0x5cc162[_0x38ea('0x30')],null);}return _0x331f1c;})[_0x38ea('0x1e')](respondWithResult(_0x244c06,null))[_0x38ea('0x36')](handleError(_0x244c06,null));};exports[_0x38ea('0x37')]=function(_0x344c51,_0x1d7649){var _0x345186='license-info.log';var _0x2e7580=path[_0x38ea('0x38')](_0x38ea('0x39'),'log',_0x38ea('0x3a'),_0x345186);_0x1d7649['setHeader']('Content-disposition',_0x38ea('0x3b')+_0x345186);_0x1d7649['set'](_0x38ea('0x3c'),'text/plain');_0x1d7649['download'](_0x2e7580);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 4b6d87b..b2296cb 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 _0xc7e0=['License','license','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./license.attributes','exports','define'];(function(_0x1131b2,_0x1cd5b8){var _0x487778=function(_0x39c3d6){while(--_0x39c3d6){_0x1131b2['push'](_0x1131b2['shift']());}};_0x487778(++_0x1cd5b8);}(_0xc7e0,0x84));var _0x0c7e=function(_0x522b07,_0x11882c){_0x522b07=_0x522b07-0x0;var _0x1ef761=_0xc7e0[_0x522b07];return _0x1ef761;};'use strict';var _=require(_0x0c7e('0x0'));var util=require('util');var logger=require(_0x0c7e('0x1'))(_0x0c7e('0x2'));var moment=require(_0x0c7e('0x3'));var BPromise=require(_0x0c7e('0x4'));var rp=require(_0x0c7e('0x5'));var fs=require('fs');var path=require(_0x0c7e('0x6'));var rimraf=require('rimraf');var config=require(_0x0c7e('0x7'));var attributes=require(_0x0c7e('0x8'));module[_0x0c7e('0x9')]=function(_0x5173fa,_0x59e219){return _0x5173fa[_0x0c7e('0xa')](_0x0c7e('0xb'),attributes,{'tableName':_0x0c7e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb929=['api','moment','request-promise','path','rimraf','exports','define','License','license','lodash','util','../../config/logger'];(function(_0x40a708,_0x539153){var _0x1edd46=function(_0x4fcc79){while(--_0x4fcc79){_0x40a708['push'](_0x40a708['shift']());}};_0x1edd46(++_0x539153);}(_0xb929,0xbd));var _0x9b92=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb929[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9b92('0x0'));var util=require(_0x9b92('0x1'));var logger=require(_0x9b92('0x2'))(_0x9b92('0x3'));var moment=require(_0x9b92('0x4'));var BPromise=require('bluebird');var rp=require(_0x9b92('0x5'));var fs=require('fs');var path=require(_0x9b92('0x6'));var rimraf=require(_0x9b92('0x7'));var config=require('../../config/environment');var attributes=require('./license.attributes');module[_0x9b92('0x8')]=function(_0x48dc16,_0x542799){return _0x48dc16[_0x9b92('0x9')](_0x9b92('0xa'),attributes,{'tableName':_0x9b92('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 5e52b75..a9a944a 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 _0x90af=['info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x90af,0x191));var _0xf90a=function(_0x529c0c,_0x30fa10){_0x529c0c=_0x529c0c-0x0;var _0x3263c6=_0x90af[_0x529c0c];return _0x3263c6;};'use strict';var _=require(_0xf90a('0x0'));var util=require(_0xf90a('0x1'));var moment=require(_0xf90a('0x2'));var BPromise=require(_0xf90a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf90a('0x4'));var db=require(_0xf90a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf90a('0x6'))('rpc');var config=require(_0xf90a('0x7'));var jayson=require(_0xf90a('0x8'));var client=jayson[_0xf90a('0x9')][_0xf90a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cb5c4,_0x1256ea,_0x20cd05){return new BPromise(function(_0x3fdcc8,_0x1b5dcd){return client[_0xf90a('0xb')](_0x5cb5c4,_0x20cd05)[_0xf90a('0xc')](function(_0x210964){logger[_0xf90a('0xd')](_0xf90a('0xe'),_0x1256ea,_0xf90a('0xf'));logger[_0xf90a('0x10')](_0xf90a('0x11'),_0x1256ea,'request\x20sent',JSON[_0xf90a('0x12')](_0x210964));if(_0x210964['error']){if(_0x210964[_0xf90a('0x13')][_0xf90a('0x14')]===0x1f4){logger[_0xf90a('0x13')]('License,\x20%s,\x20%s',_0x1256ea,_0x210964[_0xf90a('0x13')]['message']);return _0x1b5dcd(_0x210964[_0xf90a('0x13')][_0xf90a('0x15')]);}logger[_0xf90a('0x13')]('License,\x20%s,\x20%s',_0x1256ea,_0x210964[_0xf90a('0x13')][_0xf90a('0x15')]);return _0x3fdcc8(_0x210964[_0xf90a('0x13')]['message']);}else{logger[_0xf90a('0xd')]('License,\x20%s,\x20%s',_0x1256ea,_0xf90a('0xf'));_0x3fdcc8(_0x210964['result'][_0xf90a('0x15')]);}})[_0xf90a('0x16')](function(_0x2b10e1){logger[_0xf90a('0x13')](_0xf90a('0xe'),_0x1256ea,_0x2b10e1);_0x1b5dcd(_0x2b10e1);});});} \ No newline at end of file +var _0x3e55=['License,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0xb52a30,_0x9b4336){var _0x160875=function(_0xd23d7a){while(--_0xd23d7a){_0xb52a30['push'](_0xb52a30['shift']());}};_0x160875(++_0x9b4336);}(_0x3e55,0xdb));var _0x53e5=function(_0x224ad9,_0x5d97a7){_0x224ad9=_0x224ad9-0x0;var _0x532997=_0x3e55[_0x224ad9];return _0x532997;};'use strict';var _=require('lodash');var util=require(_0x53e5('0x0'));var moment=require(_0x53e5('0x1'));var BPromise=require(_0x53e5('0x2'));var rs=require(_0x53e5('0x3'));var fs=require('fs');var Redis=require(_0x53e5('0x4'));var db=require(_0x53e5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x53e5('0x6'))(_0x53e5('0x7'));var config=require(_0x53e5('0x8'));var jayson=require(_0x53e5('0x9'));var client=jayson[_0x53e5('0xa')][_0x53e5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4384df,_0x41006b,_0x4eadf3){return new BPromise(function(_0x5c9d96,_0x29ea4e){return client[_0x53e5('0xc')](_0x4384df,_0x4eadf3)[_0x53e5('0xd')](function(_0x505c92){logger[_0x53e5('0xe')]('License,\x20%s,\x20%s',_0x41006b,_0x53e5('0xf'));logger[_0x53e5('0x10')](_0x53e5('0x11'),_0x41006b,_0x53e5('0xf'),JSON[_0x53e5('0x12')](_0x505c92));if(_0x505c92['error']){if(_0x505c92['error'][_0x53e5('0x13')]===0x1f4){logger[_0x53e5('0x14')](_0x53e5('0x15'),_0x41006b,_0x505c92[_0x53e5('0x14')][_0x53e5('0x16')]);return _0x29ea4e(_0x505c92[_0x53e5('0x14')][_0x53e5('0x16')]);}logger[_0x53e5('0x14')](_0x53e5('0x15'),_0x41006b,_0x505c92[_0x53e5('0x14')][_0x53e5('0x16')]);return _0x5c9d96(_0x505c92['error']['message']);}else{logger['info']('License,\x20%s,\x20%s',_0x41006b,_0x53e5('0xf'));_0x5c9d96(_0x505c92['result'][_0x53e5('0x16')]);}})[_0x53e5('0x17')](function(_0x39a096){logger[_0x53e5('0x14')](_0x53e5('0x15'),_0x41006b,_0x39a096);_0x29ea4e(_0x39a096);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index b7333a8..9b2430e 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 _0xef5d=['/:id/verify','/:id/users','getAgents','addAnswer','post','create','/:id/in_servers','addImap','addSmtp','addInteraction','/:id/send','send','addAgents','put','update','delete','removeAnswers','removeImap','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','./mailAccount.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages'];(function(_0x96a519,_0x1de251){var _0xf31872=function(_0x20b4a3){while(--_0x20b4a3){_0x96a519['push'](_0x96a519['shift']());}};_0xf31872(++_0x1de251);}(_0xef5d,0x122));var _0xdef5=function(_0x15f50f,_0xbe3d11){_0x15f50f=_0x15f50f-0x0;var _0x156224=_0xef5d[_0x15f50f];return _0x156224;};'use strict';var multer=require(_0xdef5('0x0'));var util=require('util');var path=require(_0xdef5('0x1'));var timeout=require('connect-timeout');var express=require(_0xdef5('0x2'));var router=express[_0xdef5('0x3')]();var fs_extra=require(_0xdef5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdef5('0x5'));var config=require('../../config/environment');var controller=require(_0xdef5('0x6'));router[_0xdef5('0x7')]('/',auth['isAuthenticated'](),controller[_0xdef5('0x8')]);router[_0xdef5('0x7')](_0xdef5('0x9'),auth[_0xdef5('0xa')](),controller['describe']);router[_0xdef5('0x7')](_0xdef5('0xb'),auth[_0xdef5('0xa')](),controller[_0xdef5('0xc')]);router[_0xdef5('0x7')](_0xdef5('0xd'),auth[_0xdef5('0xa')](),controller[_0xdef5('0xe')]);router[_0xdef5('0x7')](_0xdef5('0xf'),auth[_0xdef5('0xa')](),controller[_0xdef5('0x10')]);router[_0xdef5('0x7')]('/:id/in_servers',auth[_0xdef5('0xa')](),controller[_0xdef5('0x11')]);router['get'](_0xdef5('0x12'),auth[_0xdef5('0xa')](),controller[_0xdef5('0x13')]);router[_0xdef5('0x7')](_0xdef5('0x14'),auth[_0xdef5('0xa')](),controller[_0xdef5('0x15')]);router[_0xdef5('0x7')](_0xdef5('0x16'),auth[_0xdef5('0xa')](),controller['getApplications']);router['get'](_0xdef5('0x17'),auth['isAuthenticated'](),controller[_0xdef5('0x18')]);router[_0xdef5('0x7')](_0xdef5('0x19'),auth[_0xdef5('0xa')](),controller['verifySmtp']);router[_0xdef5('0x7')](_0xdef5('0x1a'),auth[_0xdef5('0xa')](),controller[_0xdef5('0x1b')]);router['post']('/:id/dispositions',auth[_0xdef5('0xa')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xdef5('0x1c')]);router[_0xdef5('0x1d')]('/',auth['isAuthenticated'](),controller[_0xdef5('0x1e')]);router[_0xdef5('0x1d')](_0xdef5('0x1f'),auth[_0xdef5('0xa')](),controller[_0xdef5('0x20')]);router[_0xdef5('0x1d')](_0xdef5('0x12'),auth[_0xdef5('0xa')](),controller[_0xdef5('0x21')]);router[_0xdef5('0x1d')](_0xdef5('0x14'),auth[_0xdef5('0xa')](),controller[_0xdef5('0x22')]);router[_0xdef5('0x1d')](_0xdef5('0x16'),auth[_0xdef5('0xa')](),controller['addApplications']);router['post'](_0xdef5('0x23'),auth['isAuthenticated'](),controller[_0xdef5('0x24')]);router[_0xdef5('0x1d')](_0xdef5('0x1a'),auth[_0xdef5('0xa')](),controller[_0xdef5('0x25')]);router[_0xdef5('0x26')]('/:id',auth[_0xdef5('0xa')](),controller[_0xdef5('0x27')]);router[_0xdef5('0x28')]('/:id/dispositions',auth[_0xdef5('0xa')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0xdef5('0xa')](),controller[_0xdef5('0x29')]);router['delete'](_0xdef5('0x1f'),auth['isAuthenticated'](),controller[_0xdef5('0x2a')]);router[_0xdef5('0x28')](_0xdef5('0x12'),auth[_0xdef5('0xa')](),controller['removeSmtp']);router[_0xdef5('0x28')](_0xdef5('0xb'),auth[_0xdef5('0xa')](),controller[_0xdef5('0x2b')]);router[_0xdef5('0x28')]('/:id/users',auth[_0xdef5('0xa')](),controller['removeAgents']);module[_0xdef5('0x2c')]=router; \ No newline at end of file +var _0x4351=['update','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','post','/:id/dispositions','addDisposition','addAnswer','create','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','send','addAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4351,0x95));var _0x1435=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x4351[_0x1d9aa0];return _0x226868;};'use strict';var multer=require(_0x1435('0x0'));var util=require(_0x1435('0x1'));var path=require('path');var timeout=require(_0x1435('0x2'));var express=require(_0x1435('0x3'));var router=express[_0x1435('0x4')]();var fs_extra=require(_0x1435('0x5'));var auth=require(_0x1435('0x6'));var interaction=require(_0x1435('0x7'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0x1435('0x8')]('/',auth[_0x1435('0x9')](),controller[_0x1435('0xa')]);router[_0x1435('0x8')]('/describe',auth[_0x1435('0x9')](),controller[_0x1435('0xb')]);router[_0x1435('0x8')](_0x1435('0xc'),auth[_0x1435('0x9')](),controller[_0x1435('0xd')]);router['get']('/:id/dispositions',auth[_0x1435('0x9')](),controller[_0x1435('0xe')]);router[_0x1435('0x8')](_0x1435('0xf'),auth[_0x1435('0x9')](),controller[_0x1435('0x10')]);router['get'](_0x1435('0x11'),auth['isAuthenticated'](),controller[_0x1435('0x12')]);router[_0x1435('0x8')](_0x1435('0x13'),auth[_0x1435('0x9')](),controller[_0x1435('0x14')]);router[_0x1435('0x8')]('/:id/interactions',auth[_0x1435('0x9')](),controller['getInteractions']);router[_0x1435('0x8')](_0x1435('0x15'),auth[_0x1435('0x9')](),controller[_0x1435('0x16')]);router['get'](_0x1435('0x17'),auth[_0x1435('0x9')](),controller[_0x1435('0x18')]);router[_0x1435('0x8')]('/:id/verify',auth[_0x1435('0x9')](),controller[_0x1435('0x19')]);router[_0x1435('0x8')](_0x1435('0x1a'),auth['isAuthenticated'](),controller['getAgents']);router[_0x1435('0x1b')](_0x1435('0x1c'),auth[_0x1435('0x9')](),controller[_0x1435('0x1d')]);router['post'](_0x1435('0xf'),auth['isAuthenticated'](),controller[_0x1435('0x1e')]);router[_0x1435('0x1b')]('/',auth['isAuthenticated'](),controller[_0x1435('0x1f')]);router[_0x1435('0x1b')](_0x1435('0x11'),auth[_0x1435('0x9')](),controller[_0x1435('0x20')]);router[_0x1435('0x1b')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x1435('0x21')]);router[_0x1435('0x1b')](_0x1435('0x22'),auth[_0x1435('0x9')](),controller[_0x1435('0x23')]);router[_0x1435('0x1b')](_0x1435('0x15'),auth[_0x1435('0x9')](),controller[_0x1435('0x24')]);router[_0x1435('0x1b')]('/:id/send',auth[_0x1435('0x9')](),controller[_0x1435('0x25')]);router[_0x1435('0x1b')](_0x1435('0x1a'),auth['isAuthenticated'](),controller[_0x1435('0x26')]);router['put']('/:id',auth[_0x1435('0x9')](),controller[_0x1435('0x27')]);router[_0x1435('0x28')](_0x1435('0x1c'),auth['isAuthenticated'](),controller[_0x1435('0x29')]);router[_0x1435('0x28')](_0x1435('0xf'),auth[_0x1435('0x9')](),controller['removeAnswers']);router[_0x1435('0x28')](_0x1435('0x11'),auth[_0x1435('0x9')](),controller[_0x1435('0x2a')]);router['delete'](_0x1435('0x13'),auth[_0x1435('0x9')](),controller[_0x1435('0x2b')]);router[_0x1435('0x28')](_0x1435('0xc'),auth['isAuthenticated'](),controller[_0x1435('0x2c')]);router['delete'](_0x1435('0x1a'),auth[_0x1435('0x9')](),controller[_0x1435('0x2d')]);module[_0x1435('0x2e')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 7d4bc15..5c4c5ab 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 _0x4850=['custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','yahoo','outlook365','provider','getDataValue'];(function(_0x1c20de,_0x1be127){var _0x47ab0b=function(_0x537d6e){while(--_0x537d6e){_0x1c20de['push'](_0x1c20de['shift']());}};_0x47ab0b(++_0x1be127);}(_0x4850,0x1b6));var _0x0485=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4850[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x0485('0x0'));module[_0x0485('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x0485('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x0485('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x0485('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x0485('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x0485('0x4')]},'markAsUnread':{'type':Sequelize[_0x0485('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x0485('0x2')],'allowNull':![],'defaultValue':_0x0485('0x5')},'fontSize':{'type':Sequelize[_0x0485('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x0485('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x0485('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0485('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x0485('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0485('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0485('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0485('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0485('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x0485('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0485('0x8'),'set':function(_0x5215d9){if(!_0x5215d9)this[_0x0485('0x9')](_0x0485('0xa'),null);this[_0x0485('0x9')](_0x0485('0xb'),_0x5215d9);}},'provider':{'type':Sequelize[_0x0485('0xc')](_0x0485('0xd'),'hotmail',_0x0485('0xe'),_0x0485('0xf')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x0485('0x10')))return'custom';return this[_0x0485('0x11')](_0x0485('0x10'));},'set':function(_0x137176){if(_0x137176===_0x0485('0x12'))_0x137176=null;return this[_0x0485('0x9')](_0x0485('0x10'),_0x137176);}}}; \ No newline at end of file +var _0x75c9=['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}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN'];(function(_0x5a9017,_0x4312fc){var _0x596e52=function(_0x35843d){while(--_0x35843d){_0x5a9017['push'](_0x5a9017['shift']());}};_0x596e52(++_0x4312fc);}(_0x75c9,0x9e));var _0x975c=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0x75c9[_0x4394b6];return _0x360244;};'use strict';var Sequelize=require(_0x975c('0x0'));module[_0x975c('0x1')]={'description':{'type':Sequelize[_0x975c('0x2')]},'name':{'type':Sequelize[_0x975c('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x975c('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x975c('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x975c('0x4')]},'markAsUnread':{'type':Sequelize[_0x975c('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x975c('0x5')},'fontSize':{'type':Sequelize[_0x975c('0x6')](0x2)[_0x975c('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x975c('0x4')],'defaultValue':function(){return _0x975c('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x975c('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x975c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x975c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x975c('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x975c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x975c('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x975c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x975c('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x975c('0x3')],'defaultValue':![],'comment':_0x975c('0x9'),'set':function(_0x46e152){if(!_0x46e152)this[_0x975c('0xa')](_0x975c('0xb'),null);this[_0x975c('0xa')](_0x975c('0xc'),_0x46e152);}},'provider':{'type':Sequelize[_0x975c('0xd')]('gmail','hotmail','yahoo',_0x975c('0xe')),'defaultValue':null,'get':function(){if(!this[_0x975c('0xf')](_0x975c('0x10')))return _0x975c('0x11');return this[_0x975c('0xf')](_0x975c('0x10'));},'set':function(_0x511bca){if(_0x511bca===_0x975c('0x11'))_0x511bca=null;return this['setDataValue'](_0x975c('0x10'),_0x511bca);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 31eed29..3788651 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 _0xd084=['ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','sendStatus','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmContact','updatedAt','DESC','CloudProvider','from','%s\x20<%s>','attachments','join','getSmtpOptions','SendMail','sendMail','List','List\x20not\x20found','Contacts','ListId','subject','attach','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','bluebird','util','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./mailAccount.socket','register','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','stack','name','send','gmail','yahoo','hotmail','outlook365','smtp.gmail.com','smtp.mail.yahoo.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','username','pass','password','modernAuthentication','CloudProviderId','port','host','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','body','provider','secure','params','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','length','merge','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','key','email','isNil','active','description','get','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','getImap','removeImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction'];(function(_0x375532,_0x2556ae){var _0x2b520=function(_0x3f57cc){while(--_0x3f57cc){_0x375532['push'](_0x375532['shift']());}};_0x2b520(++_0x2556ae);}(_0xd084,0xea));var _0x4d08=function(_0x161875,_0x4a9adc){_0x161875=_0x161875-0x0;var _0x919175=_0xd084[_0x161875];return _0x919175;};'use strict';var moment=require(_0x4d08('0x0'));var BPromise=require(_0x4d08('0x1'));var util=require(_0x4d08('0x2'));var path=require('path');var _=require('lodash');var juice=require('juice');var Redis=require('ioredis');var qs=require(_0x4d08('0x3'));var logger=require(_0x4d08('0x4'))(_0x4d08('0x5'));var config=require(_0x4d08('0x6'));var db=require(_0x4d08('0x7'))['db'];config[_0x4d08('0x8')]=_[_0x4d08('0x9')](config[_0x4d08('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d08('0x8')]));require(_0x4d08('0xa'))[_0x4d08('0xb')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4d08('0xc')][_0x4d08('0xd')]({'port':0x232b});function respondWithRpcPromise(_0x369f71,_0x20e512,_0x26df69,_0x1c6682){return new BPromise(function(_0x31a5fb,_0x5c4694){var _0x562509=_0x1c6682||client;return _0x562509[_0x4d08('0xe')](_0x369f71,_0x26df69)[_0x4d08('0xf')](function(_0x475449){logger[_0x4d08('0x10')](_0x4d08('0x11'),_0x20e512,_0x4d08('0x12'));logger['debug'](_0x4d08('0x13'),_0x20e512,'request\x20sent',JSON[_0x4d08('0x14')](_0x475449));if(_0x475449['error']){if(_0x475449[_0x4d08('0x15')][_0x4d08('0x16')]===0x1f4){logger[_0x4d08('0x15')]('MailAccount,\x20%s,\x20%s',_0x20e512,_0x475449[_0x4d08('0x15')]['message']);return _0x5c4694(_0x475449[_0x4d08('0x15')][_0x4d08('0x17')]);}logger['error'](_0x4d08('0x11'),_0x20e512,_0x475449[_0x4d08('0x15')][_0x4d08('0x17')]);return _0x31a5fb(_0x475449[_0x4d08('0x15')][_0x4d08('0x17')]);}else{logger[_0x4d08('0x10')]('MailAccount,\x20%s,\x20%s',_0x20e512,_0x4d08('0x12'));_0x31a5fb(_0x475449['result'][_0x4d08('0x17')]);}})[_0x4d08('0x18')](function(_0x569767){logger['error'](_0x4d08('0x11'),_0x20e512,_0x569767);_0x5c4694(_0x569767);});});}function respondWithStatusCode(_0x401b4d,_0x366444){_0x366444=_0x366444||0xcc;return function(_0xf58542){if(_0xf58542){return _0x401b4d['sendStatus'](_0x366444);}return _0x401b4d[_0x4d08('0x19')](_0x366444)[_0x4d08('0x1a')]();};}function respondWithResult(_0x23f53e,_0x4eedc6){_0x4eedc6=_0x4eedc6||0xc8;return function(_0x178f4e){if(_0x178f4e){return _0x23f53e[_0x4d08('0x19')](_0x4eedc6)[_0x4d08('0x1b')](_0x178f4e);}};}function respondWithFilteredResult(_0x3bb3f9,_0x260f14){return function(_0x43931c){if(_0x43931c){var _0x1838e6=typeof _0x260f14[_0x4d08('0x1c')]===_0x4d08('0x1d')&&typeof _0x260f14['limit']===_0x4d08('0x1d');var _0x2c8fcb=_0x43931c[_0x4d08('0x1e')];var _0x18f703=_0x1838e6?0x0:_0x260f14[_0x4d08('0x1c')];var _0x5cccb5=_0x1838e6?_0x43931c['count']:_0x260f14[_0x4d08('0x1c')]+_0x260f14[_0x4d08('0x1f')];var _0x49df61;if(_0x5cccb5>=_0x2c8fcb){_0x5cccb5=_0x2c8fcb;_0x49df61=0xc8;}else{_0x49df61=0xce;}_0x3bb3f9[_0x4d08('0x19')](_0x49df61);return _0x3bb3f9[_0x4d08('0x20')](_0x4d08('0x21'),_0x18f703+'-'+_0x5cccb5+'/'+_0x2c8fcb)[_0x4d08('0x1b')](_0x43931c);}return null;};}function saveUpdates(_0x4377b7){return function(_0x1deaa2){if(_0x1deaa2){return _0x1deaa2[_0x4d08('0x22')](_0x4377b7)['then'](function(_0x1fa3eb){return _0x1fa3eb;});}return null;};}function removeEntity(_0x3d8655){return function(_0x1b3df0){if(_0x1b3df0){return _0x1b3df0['destroy']()[_0x4d08('0xf')](function(){var _0x500801=_0x1b3df0['get']({'plain':!![]});var _0x5bc40f='MailAccounts';return db['UserProfileResource'][_0x4d08('0x23')]({'where':{'type':_0x5bc40f,'resourceId':_0x500801['id']}})['then'](function(){return _0x1b3df0;});})['then'](function(){_0x3d8655[_0x4d08('0x19')](0xcc)[_0x4d08('0x1a')]();});}};}function handleEntityNotFound(_0xcddaff){return function(_0x4fc203){if(!_0x4fc203){_0xcddaff['sendStatus'](0x194);}return _0x4fc203;};}function handleError(_0x4e8822,_0x36c4b2){_0x36c4b2=_0x36c4b2||0x1f4;return function(_0x645e40){logger[_0x4d08('0x15')](_0x645e40[_0x4d08('0x24')]);if(_0x645e40['name']){delete _0x645e40[_0x4d08('0x25')];}_0x4e8822[_0x4d08('0x19')](_0x36c4b2)[_0x4d08('0x26')](_0x645e40);};}function getImapHost(_0x29bb2b){switch(_0x29bb2b){case _0x4d08('0x27'):return'imap.gmail.com';case _0x4d08('0x28'):return'imap.mail.yahoo.com';case _0x4d08('0x29'):return'imap-mail.outlook.com';case _0x4d08('0x2a'):return'outlook.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x29bb2b);}function getSmtpHost(_0x2183b3){switch(_0x2183b3){case _0x4d08('0x27'):return _0x4d08('0x2b');case'yahoo':return _0x4d08('0x2c');case _0x4d08('0x29'):return'smtp-mail.outlook.com';case'outlook365':return _0x4d08('0x2d');}throw new Error(_0x4d08('0x2e'),_0x2183b3);}function getAuthenticationOptions(_0x1ea771,_0x5caac6){var _0x451618={};var _0x126f6f={};if(_0x1ea771){_0x451618[_0x4d08('0x2f')]=_0x126f6f[_0x4d08('0x2f')]=_0x5caac6[_0x4d08('0x30')];_0x451618['password']=_0x126f6f[_0x4d08('0x31')]=_0x5caac6[_0x4d08('0x32')];if(_0x5caac6[_0x4d08('0x33')]){_0x451618[_0x4d08('0x33')]=_0x126f6f[_0x4d08('0x33')]=!![];_0x451618['CloudProviderId']=_0x126f6f[_0x4d08('0x34')]=_0x5caac6[_0x4d08('0x34')];_0x451618['password']=_0x126f6f[_0x4d08('0x31')]=null;}else{_0x451618[_0x4d08('0x34')]=_0x126f6f[_0x4d08('0x34')]=null;}_0x451618['host']=getImapHost(_0x1ea771);_0x451618[_0x4d08('0x35')]=0x3e1;_0x126f6f[_0x4d08('0x36')]=getSmtpHost(_0x1ea771);_0x126f6f['port']=0x24b;_0x126f6f['secure']=![];_0x451618[_0x4d08('0x37')]=_0x126f6f[_0x4d08('0x37')]=null;}else{if(_0x5caac6[_0x4d08('0x38')]){_0x451618['user']=_0x126f6f[_0x4d08('0x2f')]=_0x5caac6[_0x4d08('0x30')];_0x451618[_0x4d08('0x32')]=_0x126f6f[_0x4d08('0x31')]=_0x5caac6[_0x4d08('0x32')];}else{_0x451618[_0x4d08('0x38')]=_0x126f6f[_0x4d08('0x38')]=![];_0x451618[_0x4d08('0x2f')]=_0x126f6f[_0x4d08('0x2f')]=null;_0x451618[_0x4d08('0x32')]=_0x126f6f[_0x4d08('0x31')]=null;}_0x451618['host']=_0x5caac6[_0x4d08('0x39')][_0x4d08('0x36')];_0x451618[_0x4d08('0x35')]=_0x5caac6[_0x4d08('0x39')][_0x4d08('0x35')];_0x126f6f[_0x4d08('0x36')]=_0x5caac6[_0x4d08('0x3a')][_0x4d08('0x36')];_0x126f6f[_0x4d08('0x35')]=_0x5caac6['Smtp'][_0x4d08('0x35')];}return{'Imap':_0x451618,'Smtp':_0x126f6f};}exports[_0x4d08('0x3b')]=function(_0x236048,_0x5bcb89){var _0x9641c1={'include':[{'model':db[_0x4d08('0x3c')],'as':_0x4d08('0x39')},{'model':db[_0x4d08('0x3d')],'as':_0x4d08('0x3a')},{'model':db[_0x4d08('0x3e')],'as':_0x4d08('0x3f')}]},_0x5bb4a5={},_0x23bae5={'count':0x0,'rows':[]};var _0x35098e=_['map'](db[_0x4d08('0x40')][_0x4d08('0x41')],function(_0x59c335){return{'name':_0x59c335[_0x4d08('0x42')],'type':_0x59c335[_0x4d08('0x43')]['key']};});_0x5bb4a5[_0x4d08('0x44')]=_[_0x4d08('0x45')](_0x35098e,_0x4d08('0x25'));_0x5bb4a5['query']=_['keys'](_0x236048[_0x4d08('0x46')]);_0x5bb4a5[_0x4d08('0x47')]=_[_0x4d08('0x48')](_0x5bb4a5[_0x4d08('0x44')],_0x5bb4a5[_0x4d08('0x46')]);_0x9641c1[_0x4d08('0x49')]=_['intersection'](_0x5bb4a5[_0x4d08('0x44')],qs[_0x4d08('0x4a')](_0x236048[_0x4d08('0x46')][_0x4d08('0x4a')]));_0x9641c1[_0x4d08('0x49')]=_0x9641c1[_0x4d08('0x49')]['length']?_0x9641c1['attributes']:_0x5bb4a5[_0x4d08('0x44')];if(!_0x236048['query'][_0x4d08('0x4b')](_0x4d08('0x4c'))){_0x9641c1[_0x4d08('0x1f')]=qs[_0x4d08('0x1f')](_0x236048[_0x4d08('0x46')][_0x4d08('0x1f')]);_0x9641c1['offset']=qs[_0x4d08('0x1c')](_0x236048[_0x4d08('0x46')][_0x4d08('0x1c')]);}_0x9641c1[_0x4d08('0x4d')]=qs[_0x4d08('0x4e')](_0x236048[_0x4d08('0x46')][_0x4d08('0x4e')]);_0x9641c1[_0x4d08('0x4f')]=qs[_0x4d08('0x47')](_[_0x4d08('0x50')](_0x236048[_0x4d08('0x46')],_0x5bb4a5[_0x4d08('0x47')]),_0x35098e);if(_0x236048[_0x4d08('0x46')][_0x4d08('0x51')]){_0x9641c1['where']=_['merge'](_0x9641c1[_0x4d08('0x4f')],{'$or':_[_0x4d08('0x45')](_0x35098e,function(_0x561b2f){if(_0x561b2f[_0x4d08('0x43')]!==_0x4d08('0x52')){var _0x7e525a={};_0x7e525a[_0x561b2f['name']]={'$like':'%'+_0x236048[_0x4d08('0x46')][_0x4d08('0x51')]+'%'};return _0x7e525a;}})});}_0x9641c1=_['merge']({},_0x9641c1,_0x236048[_0x4d08('0x53')]);var _0x46b21c={'where':_0x9641c1['where']};return db[_0x4d08('0x40')][_0x4d08('0x1e')](_0x46b21c)[_0x4d08('0xf')](function(_0x3be71a){_0x23bae5[_0x4d08('0x1e')]=_0x3be71a;if(_0x236048[_0x4d08('0x46')][_0x4d08('0x54')]){_0x9641c1[_0x4d08('0x55')]=[{'all':!![]}];}return db['MailAccount'][_0x4d08('0x56')](_0x9641c1);})[_0x4d08('0xf')](function(_0x1ca6a1){_0x23bae5[_0x4d08('0x57')]=_0x1ca6a1;return _0x23bae5;})[_0x4d08('0xf')](respondWithFilteredResult(_0x5bcb89,_0x9641c1))[_0x4d08('0x18')](handleError(_0x5bcb89,null));};exports[_0x4d08('0x58')]=function(_0x198b8a,_0x5e278b){var _0x1cdfcd={'raw':![],'where':{'id':_0x198b8a['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x4d08('0x39')},{'model':db[_0x4d08('0x3d')],'as':_0x4d08('0x3a')},{'model':db['Pause'],'as':_0x4d08('0x3f')}]},_0x347754={};_0x347754[_0x4d08('0x44')]=_[_0x4d08('0x59')](db['MailAccount'][_0x4d08('0x41')]);_0x347754[_0x4d08('0x46')]=_['keys'](_0x198b8a[_0x4d08('0x46')]);_0x347754[_0x4d08('0x47')]=_[_0x4d08('0x48')](_0x347754[_0x4d08('0x44')],_0x347754['query']);_0x1cdfcd[_0x4d08('0x49')]=_['intersection'](_0x347754[_0x4d08('0x44')],qs[_0x4d08('0x4a')](_0x198b8a[_0x4d08('0x46')][_0x4d08('0x4a')]));_0x1cdfcd[_0x4d08('0x49')]=_0x1cdfcd['attributes']['length']?_0x1cdfcd['attributes']:_0x347754['model'];if(_0x198b8a[_0x4d08('0x46')][_0x4d08('0x54')]){_0x1cdfcd[_0x4d08('0x55')]=[{'all':!![]}];}_0x1cdfcd=_['merge']({},_0x1cdfcd,_0x198b8a['options']);return db[_0x4d08('0x40')][_0x4d08('0x5a')](_0x1cdfcd)[_0x4d08('0xf')](handleEntityNotFound(_0x5e278b,null))['then'](respondWithResult(_0x5e278b,null))[_0x4d08('0x18')](handleError(_0x5e278b,null));};exports[_0x4d08('0x22')]=function(_0x23c219,_0x44c3ee){if(_0x23c219[_0x4d08('0x5b')]['id']){delete _0x23c219['body']['id'];}var _0x3a23f6=_0x23c219['body'][_0x4d08('0x5c')]==='custom'?null:_0x23c219[_0x4d08('0x5b')][_0x4d08('0x5c')];var _0x41b786=_0x23c219[_0x4d08('0x5b')][_0x4d08('0x39')]||{};var _0x5c3a61=_0x23c219[_0x4d08('0x5b')]['Smtp']||{};if(_0x3a23f6){_0x41b786['host']=getImapHost(_0x3a23f6);_0x41b786[_0x4d08('0x35')]=0x3e1;_0x5c3a61[_0x4d08('0x36')]=getSmtpHost(_0x3a23f6);_0x5c3a61[_0x4d08('0x35')]=0x24b;_0x5c3a61['secure']=![];}if(_0x5c3a61['modernAuthentication']){_0x5c3a61[_0x4d08('0x5d')]=![];}else{_0x5c3a61[_0x4d08('0x34')]=null;}if(!_0x41b786['modernAuthentication'])_0x41b786[_0x4d08('0x34')]=null;_0x23c219[_0x4d08('0x5b')][_0x4d08('0x39')]=_0x41b786;_0x23c219['body'][_0x4d08('0x3a')]=_0x5c3a61;return db['MailAccount'][_0x4d08('0x5a')]({'where':{'id':_0x23c219[_0x4d08('0x5e')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x4d08('0x3d')],'as':_0x4d08('0x3a')},{'model':db[_0x4d08('0x3e')],'as':_0x4d08('0x3f')}]})['then'](handleEntityNotFound(_0x44c3ee,null))[_0x4d08('0xf')](function(_0x33f265){if(!_0x33f265)throw new Error(_0x4d08('0x5f'));if(_0x33f265[_0x4d08('0x37')])delete _0x23c219[_0x4d08('0x5b')]['Imap'];return _0x33f265;})[_0x4d08('0xf')](saveUpdates(_0x23c219[_0x4d08('0x5b')],null))[_0x4d08('0xf')](function(_0x27f92d){if(!_0x23c219[_0x4d08('0x5b')][_0x4d08('0x39')])return _0x27f92d;return db[_0x4d08('0x3c')][_0x4d08('0x22')](_0x23c219['body'][_0x4d08('0x39')],{'where':{'MailAccountId':_0x27f92d['id']}})['then'](function(){return _0x27f92d;});})[_0x4d08('0xf')](function(_0x1192b8){if(!_0x23c219['body'][_0x4d08('0x3a')])return _0x1192b8;return db[_0x4d08('0x3d')][_0x4d08('0x22')](_0x23c219[_0x4d08('0x5b')][_0x4d08('0x3a')],{'where':{'MailAccountId':_0x1192b8['id']}})[_0x4d08('0xf')](function(){return _0x1192b8;});})[_0x4d08('0xf')](respondWithResult(_0x44c3ee,null))[_0x4d08('0x18')](handleError(_0x44c3ee,null));};exports[_0x4d08('0x60')]=function(_0x1323f5,_0x2ca1b8){return db[_0x4d08('0x40')][_0x4d08('0x60')]()['then'](respondWithResult(_0x2ca1b8,null))['catch'](handleError(_0x2ca1b8,null));};exports[_0x4d08('0x61')]=function(_0xe14986,_0x3e5e65){if(_0xe14986[_0x4d08('0x5b')]['id']){delete _0xe14986['body']['id'];}return db[_0x4d08('0x40')][_0x4d08('0x5a')]({'where':{'id':_0xe14986[_0x4d08('0x5e')]['id']}})[_0x4d08('0xf')](handleEntityNotFound(_0x3e5e65,null))[_0x4d08('0xf')](function(_0x3ae91a){if(_0x3ae91a){_0xe14986[_0x4d08('0x5b')][_0x4d08('0x62')]=_0x3ae91a['id'];return db[_0x4d08('0x63')]['create'](_0xe14986[_0x4d08('0x5b')]);}})[_0x4d08('0xf')](respondWithResult(_0x3e5e65,null))['catch'](handleError(_0x3e5e65,null));};exports[_0x4d08('0x64')]=function(_0x4f6cf8,_0x2168d4){var _0x5015ed={'raw':![],'where':{}};var _0x4c381f={};var _0x2a91b4={'count':0x0,'rows':[]};return db[_0x4d08('0x40')][_0x4d08('0x65')]({'where':{'id':_0x4f6cf8[_0x4d08('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2168d4,null))[_0x4d08('0xf')](function(_0x4c56c6){if(_0x4c56c6){_0x4c381f['model']=_[_0x4d08('0x59')](db[_0x4d08('0x63')]['rawAttributes']);_0x4c381f[_0x4d08('0x46')]=_[_0x4d08('0x59')](_0x4f6cf8['query']);_0x4c381f[_0x4d08('0x47')]=_[_0x4d08('0x48')](_0x4c381f['model'],_0x4c381f[_0x4d08('0x46')]);_0x5015ed[_0x4d08('0x49')]=_[_0x4d08('0x48')](_0x4c381f['model'],qs['fields'](_0x4f6cf8[_0x4d08('0x46')][_0x4d08('0x4a')]));_0x5015ed[_0x4d08('0x49')]=_0x5015ed[_0x4d08('0x49')][_0x4d08('0x66')]?_0x5015ed[_0x4d08('0x49')]:_0x4c381f[_0x4d08('0x44')];if(!_0x4f6cf8[_0x4d08('0x46')][_0x4d08('0x4b')](_0x4d08('0x4c'))){_0x5015ed['limit']=qs[_0x4d08('0x1f')](_0x4f6cf8['query'][_0x4d08('0x1f')]);_0x5015ed[_0x4d08('0x1c')]=qs[_0x4d08('0x1c')](_0x4f6cf8[_0x4d08('0x46')][_0x4d08('0x1c')]);}_0x5015ed[_0x4d08('0x4d')]=qs['sort'](_0x4f6cf8[_0x4d08('0x46')][_0x4d08('0x4e')]);_0x5015ed[_0x4d08('0x4f')]=qs['filters'](_[_0x4d08('0x50')](_0x4f6cf8[_0x4d08('0x46')],_0x4c381f[_0x4d08('0x47')]));_0x5015ed[_0x4d08('0x4f')][_0x4d08('0x62')]=_0x4c56c6['id'];if(_0x4f6cf8[_0x4d08('0x46')]['filter']){_0x5015ed[_0x4d08('0x4f')]=_[_0x4d08('0x67')](_0x5015ed[_0x4d08('0x4f')],{'$or':_[_0x4d08('0x45')](_0x5015ed[_0x4d08('0x49')],function(_0x4c671c){var _0x5ccba4={};_0x5ccba4[_0x4c671c]={'$like':'%'+_0x4f6cf8[_0x4d08('0x46')][_0x4d08('0x51')]+'%'};return _0x5ccba4;})});}_0x5015ed=_[_0x4d08('0x67')]({},_0x5015ed,_0x4f6cf8[_0x4d08('0x53')]);return db['Disposition']['count']({'where':_0x5015ed[_0x4d08('0x4f')]})[_0x4d08('0xf')](function(_0x5ea784){_0x2a91b4[_0x4d08('0x1e')]=_0x5ea784;if(_0x4f6cf8['query'][_0x4d08('0x54')]){_0x5015ed[_0x4d08('0x55')]=[{'all':!![]}];}return db[_0x4d08('0x63')]['findAll'](_0x5015ed);})[_0x4d08('0xf')](function(_0x377c53){_0x2a91b4[_0x4d08('0x57')]=_0x377c53;return _0x2a91b4;});}})[_0x4d08('0xf')](respondWithFilteredResult(_0x2168d4,_0x5015ed))[_0x4d08('0x18')](handleError(_0x2168d4,null));};exports[_0x4d08('0x68')]=function(_0x1cf903,_0x4fee4f){return db[_0x4d08('0x40')][_0x4d08('0x5a')]({'where':{'id':_0x1cf903['params']['id']}})['then'](handleEntityNotFound(_0x4fee4f,null))[_0x4d08('0xf')](function(_0x5284e8){if(_0x5284e8){return _0x5284e8[_0x4d08('0x68')](_0x1cf903[_0x4d08('0x46')][_0x4d08('0x69')]);}})[_0x4d08('0xf')](respondWithStatusCode(_0x4fee4f,null))[_0x4d08('0x18')](handleError(_0x4fee4f,null));};exports[_0x4d08('0x6a')]=function(_0x214e55,_0x23bdd2){if(_0x214e55['body']['id']){delete _0x214e55[_0x4d08('0x5b')]['id'];}return db[_0x4d08('0x40')][_0x4d08('0x5a')]({'where':{'id':_0x214e55[_0x4d08('0x5e')]['id']}})['then'](handleEntityNotFound(_0x23bdd2,null))[_0x4d08('0xf')](function(_0x7c589c){if(_0x7c589c){_0x214e55['body'][_0x4d08('0x62')]=_0x7c589c['id'];return db[_0x4d08('0x6b')][_0x4d08('0x6c')](_0x214e55[_0x4d08('0x5b')]);}})[_0x4d08('0xf')](respondWithResult(_0x23bdd2,null))[_0x4d08('0x18')](handleError(_0x23bdd2,null));};exports[_0x4d08('0x6d')]=function(_0x3b507c,_0x347b88){var _0x26c931={'raw':![],'where':{}};var _0x395e32={};var _0xf2639={'count':0x0,'rows':[]};return db[_0x4d08('0x40')]['findOne']({'where':{'id':_0x3b507c['params']['id']}})[_0x4d08('0xf')](handleEntityNotFound(_0x347b88,null))['then'](function(_0xf27f97){if(_0xf27f97){_0x395e32[_0x4d08('0x44')]=_[_0x4d08('0x59')](db[_0x4d08('0x6b')]['rawAttributes']);_0x395e32[_0x4d08('0x46')]=_[_0x4d08('0x59')](_0x3b507c[_0x4d08('0x46')]);_0x395e32[_0x4d08('0x47')]=_[_0x4d08('0x48')](_0x395e32['model'],_0x395e32[_0x4d08('0x46')]);_0x26c931['attributes']=_[_0x4d08('0x48')](_0x395e32[_0x4d08('0x44')],qs['fields'](_0x3b507c[_0x4d08('0x46')][_0x4d08('0x4a')]));_0x26c931[_0x4d08('0x49')]=_0x26c931['attributes'][_0x4d08('0x66')]?_0x26c931['attributes']:_0x395e32['model'];if(!_0x3b507c[_0x4d08('0x46')][_0x4d08('0x4b')](_0x4d08('0x4c'))){_0x26c931[_0x4d08('0x1f')]=qs[_0x4d08('0x1f')](_0x3b507c[_0x4d08('0x46')][_0x4d08('0x1f')]);_0x26c931[_0x4d08('0x1c')]=qs['offset'](_0x3b507c['query'][_0x4d08('0x1c')]);}_0x26c931[_0x4d08('0x4d')]=qs[_0x4d08('0x4e')](_0x3b507c[_0x4d08('0x46')][_0x4d08('0x4e')]);_0x26c931[_0x4d08('0x4f')]=qs[_0x4d08('0x47')](_[_0x4d08('0x50')](_0x3b507c[_0x4d08('0x46')],_0x395e32[_0x4d08('0x47')]));_0x26c931[_0x4d08('0x4f')][_0x4d08('0x62')]=_0xf27f97['id'];if(_0x3b507c['query'][_0x4d08('0x51')]){_0x26c931[_0x4d08('0x4f')]=_['merge'](_0x26c931['where'],{'$or':_['map'](_0x26c931[_0x4d08('0x49')],function(_0x4f1076){var _0x206f0e={};_0x206f0e[_0x4f1076]={'$like':'%'+_0x3b507c[_0x4d08('0x46')]['filter']+'%'};return _0x206f0e;})});}_0x26c931=_[_0x4d08('0x67')]({},_0x26c931,_0x3b507c[_0x4d08('0x53')]);return db['CannedAnswer'][_0x4d08('0x1e')]({'where':_0x26c931[_0x4d08('0x4f')]})['then'](function(_0x3d9797){_0xf2639[_0x4d08('0x1e')]=_0x3d9797;if(_0x3b507c[_0x4d08('0x46')][_0x4d08('0x54')]){_0x26c931[_0x4d08('0x55')]=[{'all':!![]}];}return db[_0x4d08('0x6b')]['findAll'](_0x26c931);})[_0x4d08('0xf')](function(_0xac867){_0xf2639[_0x4d08('0x57')]=_0xac867;return _0xf2639;});}})[_0x4d08('0xf')](respondWithFilteredResult(_0x347b88,_0x26c931))[_0x4d08('0x18')](handleError(_0x347b88,null));};exports[_0x4d08('0x6e')]=function(_0x1aa57a,_0x4023ce){return db[_0x4d08('0x40')]['find']({'where':{'id':_0x1aa57a['params']['id']}})[_0x4d08('0xf')](handleEntityNotFound(_0x4023ce,null))[_0x4d08('0xf')](function(_0x22b979){if(_0x22b979){return _0x22b979[_0x4d08('0x6e')](_0x1aa57a['query'][_0x4d08('0x69')]);}})[_0x4d08('0xf')](respondWithStatusCode(_0x4023ce,null))['catch'](handleError(_0x4023ce,null));};exports[_0x4d08('0x6c')]=function(_0x315385,_0x58bb73){var _0x278795={'name':_0x315385[_0x4d08('0x5b')]['name'],'key':_0x315385[_0x4d08('0x5b')][_0x4d08('0x6f')],'provider':_0x315385[_0x4d08('0x5b')]['provider']==='custom'?null:_0x315385['body'][_0x4d08('0x5c')],'email':_0x315385[_0x4d08('0x5b')][_0x4d08('0x70')],'ListId':_0x315385['body']['ListId'],'active':!_[_0x4d08('0x71')](_0x315385[_0x4d08('0x5b')][_0x4d08('0x72')])?_0x315385[_0x4d08('0x5b')][_0x4d08('0x72')]:!![],'description':_0x315385[_0x4d08('0x5b')][_0x4d08('0x73')]||null};var _0x48b14a=getAuthenticationOptions(_0x278795[_0x4d08('0x5c')],_0x315385[_0x4d08('0x5b')]);_0x278795[_0x4d08('0x39')]=_0x48b14a['Imap'];_0x278795[_0x4d08('0x3a')]=_0x48b14a[_0x4d08('0x3a')];return db[_0x4d08('0x40')][_0x4d08('0x6c')](_0x278795,{'include':[{'model':db[_0x4d08('0x3d')],'as':_0x4d08('0x3a')},{'model':db[_0x4d08('0x3c')],'as':_0x4d08('0x39')}]})['then'](function(_0x5f69ee){var _0x4ca8ed=_0x315385['user'][_0x4d08('0x74')]({'plain':!![]});if(!_0x4ca8ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ca8ed[_0x4d08('0x75')]===_0x4d08('0x2f')){var _0x1ee4ef=_0x5f69ee[_0x4d08('0x74')]({'plain':!![]});return db[_0x4d08('0x76')][_0x4d08('0x5a')]({'where':{'name':_0x4d08('0x77'),'userProfileId':_0x4ca8ed[_0x4d08('0x78')]},'raw':!![]})[_0x4d08('0xf')](function(_0x14b24f){if(_0x14b24f&&_0x14b24f[_0x4d08('0x79')]===0x0){return db['UserProfileResource'][_0x4d08('0x6c')]({'name':_0x1ee4ef['name'],'resourceId':_0x1ee4ef['id'],'type':_0x14b24f[_0x4d08('0x25')],'sectionId':_0x14b24f['id']},{})[_0x4d08('0xf')](function(){return _0x5f69ee;});}else{return _0x5f69ee;}})[_0x4d08('0x18')](function(_0x465d10){logger[_0x4d08('0x15')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x465d10);throw _0x465d10;});}return _0x5f69ee;})[_0x4d08('0xf')](respondWithResult(_0x58bb73,0xc9))['catch'](handleError(_0x58bb73,null));};exports[_0x4d08('0x7a')]=function(_0x3af3ba,_0x1d03a5){return db[_0x4d08('0x40')][_0x4d08('0x65')]({'where':{'id':_0x3af3ba[_0x4d08('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1d03a5,null))[_0x4d08('0xf')](function(_0x441478){if(_0x441478){return _0x441478[_0x4d08('0x7a')]();}return null;})['then'](respondWithResult(_0x1d03a5,null))[_0x4d08('0x18')](handleError(_0x1d03a5,null));};exports['addImap']=function(_0x3627f2,_0x2b36e9){if(_0x3627f2['body']['id']){delete _0x3627f2['body']['id'];}return db[_0x4d08('0x40')][_0x4d08('0x5a')]({'where':{'id':_0x3627f2[_0x4d08('0x5e')]['id']}})[_0x4d08('0xf')](handleEntityNotFound(_0x2b36e9,null))['then'](function(_0x8f99f1){if(_0x8f99f1){_0x3627f2['body'][_0x4d08('0x62')]=_0x8f99f1['id'];return db['MailServerIn']['create'](_0x3627f2[_0x4d08('0x5b')]);}})[_0x4d08('0xf')](respondWithResult(_0x2b36e9,null))[_0x4d08('0x18')](handleError(_0x2b36e9,null));};exports[_0x4d08('0x7b')]=function(_0x4198b2,_0xb78f62){return db[_0x4d08('0x40')][_0x4d08('0x65')]({'where':{'id':_0x4198b2[_0x4d08('0x5e')]['id']}})[_0x4d08('0xf')](handleEntityNotFound(_0xb78f62,null))[_0x4d08('0xf')](function(_0x150325){if(_0x150325){return _0x150325[_0x4d08('0x7c')](null);}return null;})[_0x4d08('0xf')](respondWithStatusCode(_0xb78f62,null))[_0x4d08('0x18')](handleError(_0xb78f62,null));};exports[_0x4d08('0x7d')]=function(_0x296ca5,_0x1fe294){return db[_0x4d08('0x40')]['findOne']({'where':{'id':_0x296ca5[_0x4d08('0x5e')]['id']}})[_0x4d08('0xf')](handleEntityNotFound(_0x1fe294,null))[_0x4d08('0xf')](function(_0x43b691){if(_0x43b691){return _0x43b691[_0x4d08('0x7d')]();}return null;})[_0x4d08('0xf')](respondWithResult(_0x1fe294,null))[_0x4d08('0x18')](handleError(_0x1fe294,null));};exports[_0x4d08('0x7e')]=function(_0x8df1ae,_0x3a0e6){if(_0x8df1ae[_0x4d08('0x5b')]['id']){delete _0x8df1ae['body']['id'];}return db[_0x4d08('0x40')][_0x4d08('0x5a')]({'where':{'id':_0x8df1ae[_0x4d08('0x5e')]['id']}})[_0x4d08('0xf')](handleEntityNotFound(_0x3a0e6,null))[_0x4d08('0xf')](function(_0x24916a){if(_0x24916a){_0x8df1ae[_0x4d08('0x5b')][_0x4d08('0x62')]=_0x24916a['id'];return db[_0x4d08('0x3d')]['create'](_0x8df1ae[_0x4d08('0x5b')]);}})[_0x4d08('0xf')](respondWithResult(_0x3a0e6,null))[_0x4d08('0x18')](handleError(_0x3a0e6,null));};exports['removeSmtp']=function(_0x3158ab,_0x152e18){return db[_0x4d08('0x40')][_0x4d08('0x65')]({'where':{'id':_0x3158ab[_0x4d08('0x5e')]['id']}})[_0x4d08('0xf')](handleEntityNotFound(_0x152e18,null))['then'](function(_0x3e1d10){if(_0x3e1d10){return _0x3e1d10[_0x4d08('0x7f')](null);}return null;})[_0x4d08('0xf')](respondWithStatusCode(_0x152e18,null))[_0x4d08('0x18')](handleError(_0x152e18,null));};exports[_0x4d08('0x80')]=function(_0x4c47c6,_0x2ff058){return db['MailInteraction'][_0x4d08('0x5a')]({'where':{'id':_0x4c47c6[_0x4d08('0x5e')]['id']}})[_0x4d08('0xf')](handleEntityNotFound(_0x2ff058,null))['then'](function(_0x45ad32){if(_0x45ad32){return _0x45ad32[_0x4d08('0x80')](_0x4c47c6['body'][_0x4d08('0x69')],_[_0x4d08('0x81')](_0x4c47c6[_0x4d08('0x5b')],[_0x4d08('0x69'),'id'])||{});}})[_0x4d08('0xf')](respondWithResult(_0x2ff058,null))['catch'](handleError(_0x2ff058,null));};exports[_0x4d08('0x82')]=function(_0x3d0e93,_0x379aa2){var _0x5a9eb1={'raw':![],'where':{}};var _0x246fb7={};var _0x179e6d={'count':0x0,'rows':[]};return db[_0x4d08('0x40')][_0x4d08('0x65')]({'where':{'id':_0x3d0e93['params']['id']}})[_0x4d08('0xf')](handleEntityNotFound(_0x379aa2,null))[_0x4d08('0xf')](function(_0x39d9cc){if(_0x39d9cc){_0x246fb7[_0x4d08('0x44')]=_[_0x4d08('0x59')](db[_0x4d08('0x83')][_0x4d08('0x41')]);_0x246fb7[_0x4d08('0x46')]=_['keys'](_0x3d0e93[_0x4d08('0x46')]);_0x246fb7[_0x4d08('0x47')]=_[_0x4d08('0x48')](_0x246fb7[_0x4d08('0x44')],_0x246fb7[_0x4d08('0x46')]);_0x5a9eb1[_0x4d08('0x49')]=_['intersection'](_0x246fb7[_0x4d08('0x44')],qs[_0x4d08('0x4a')](_0x3d0e93[_0x4d08('0x46')][_0x4d08('0x4a')]));_0x5a9eb1[_0x4d08('0x49')]=_0x5a9eb1['attributes'][_0x4d08('0x66')]?_0x5a9eb1[_0x4d08('0x49')]:_0x246fb7[_0x4d08('0x44')];if(!_0x3d0e93['query'][_0x4d08('0x4b')](_0x4d08('0x4c'))){_0x5a9eb1[_0x4d08('0x1f')]=qs[_0x4d08('0x1f')](_0x3d0e93[_0x4d08('0x46')][_0x4d08('0x1f')]);_0x5a9eb1[_0x4d08('0x1c')]=qs[_0x4d08('0x1c')](_0x3d0e93['query'][_0x4d08('0x1c')]);}_0x5a9eb1['order']=qs[_0x4d08('0x4e')](_0x3d0e93[_0x4d08('0x46')][_0x4d08('0x4e')]);_0x5a9eb1[_0x4d08('0x4f')]=qs[_0x4d08('0x47')](_['pick'](_0x3d0e93[_0x4d08('0x46')],_0x246fb7[_0x4d08('0x47')]));_0x5a9eb1['where'][_0x4d08('0x62')]=_0x39d9cc['id'];if(_0x3d0e93[_0x4d08('0x46')][_0x4d08('0x51')]){_0x5a9eb1[_0x4d08('0x4f')]=_[_0x4d08('0x67')](_0x5a9eb1[_0x4d08('0x4f')],{'$or':_[_0x4d08('0x45')](_0x5a9eb1[_0x4d08('0x49')],function(_0x3c5117){var _0x4f6717={};_0x4f6717[_0x3c5117]={'$like':'%'+_0x3d0e93[_0x4d08('0x46')]['filter']+'%'};return _0x4f6717;})});}_0x5a9eb1=_[_0x4d08('0x67')]({},_0x5a9eb1,_0x3d0e93[_0x4d08('0x53')]);return db['MailInteraction'][_0x4d08('0x1e')]({'where':_0x5a9eb1['where']})[_0x4d08('0xf')](function(_0x29e243){_0x179e6d[_0x4d08('0x1e')]=_0x29e243;if(_0x3d0e93[_0x4d08('0x46')][_0x4d08('0x54')]){_0x5a9eb1[_0x4d08('0x55')]=[{'model':db['CmContact'],'as':_0x4d08('0x84'),'required':![]},{'model':db[_0x4d08('0x85')],'as':_0x4d08('0x86'),'attributes':[_0x4d08('0x25'),_0x4d08('0x87'),_0x4d08('0x88')],'required':![]},{'model':db[_0x4d08('0x89')],'as':_0x4d08('0x8a'),'attributes':['id',_0x4d08('0x25'),'color'],'where':_0x3d0e93[_0x4d08('0x46')][_0x4d08('0x8b')]?{'id':_0x3d0e93[_0x4d08('0x46')][_0x4d08('0x8b')]}:undefined,'required':_0x3d0e93[_0x4d08('0x46')][_0x4d08('0x8b')]?!![]:![]}];}return db[_0x4d08('0x83')][_0x4d08('0x56')](_0x5a9eb1);})['then'](function(_0x7c0ff8){_0x179e6d[_0x4d08('0x57')]=_0x7c0ff8;return _0x179e6d;});}})[_0x4d08('0xf')](respondWithFilteredResult(_0x379aa2,_0x5a9eb1))['catch'](handleError(_0x379aa2,null));};exports[_0x4d08('0x8c')]=function addApplications(_0x10fcd0,_0x21259d){var _0x57c18a=_0x10fcd0[_0x4d08('0x5e')]['id'];var _0x599be9=_0x10fcd0['body'];var _0x1c06d7=0xc8;var _0x20c4eb=null;return db[_0x4d08('0x8d')][_0x4d08('0x8e')]({'isolationLevel':db[_0x4d08('0x8d')][_0x4d08('0x8f')][_0x4d08('0x90')][_0x4d08('0x91')]},function(_0x1bec43){return db[_0x4d08('0x40')][_0x4d08('0x65')]({'where':{'id':_0x57c18a},'transaction':_0x1bec43})[_0x4d08('0xf')](function(_0x44ef43){if(_0x44ef43){return db[_0x4d08('0x92')][_0x4d08('0x23')]({'where':{'MailAccountId':_0x57c18a},'transaction':_0x1bec43})[_0x4d08('0xf')](function(){var _0x2b63da=_[_0x4d08('0x45')](_0x599be9,function(_0x31c526){_0x31c526['MailAccountId']=_0x57c18a;return _0x31c526;});return db['MailApplication'][_0x4d08('0x93')](_0x2b63da,{'transaction':_0x1bec43});});}else{_0x1c06d7=0x194;_0x20c4eb=[];}});})['then'](function(){if(_0x1c06d7!==0x194){return db['MailApplication'][_0x4d08('0x94')]({'where':{'MailAccountId':_0x57c18a},'order':'priority'})[_0x4d08('0xf')](function(_0xc51c0a){_0x20c4eb=_0xc51c0a;});}})[_0x4d08('0x18')](function(_0x3a795b){_0x1c06d7=0x1f4;logger['error'](_0x3a795b[_0x4d08('0x24')]);if(_0x3a795b[_0x4d08('0x25')]){delete _0x3a795b[_0x4d08('0x25')];}_0x20c4eb=_0x3a795b;})['finally'](function(){if(_0x20c4eb===null){_0x21259d[_0x4d08('0x95')](_0x1c06d7);}else{if(_0x1c06d7===0x1f4){_0x21259d[_0x4d08('0x19')](_0x1c06d7)[_0x4d08('0x26')](_0x20c4eb);}else{_0x21259d[_0x4d08('0x19')](_0x1c06d7)[_0x4d08('0x1b')](_0x20c4eb);}}});};exports[_0x4d08('0x96')]=function(_0xfa38d0,_0x3a51ff){var _0x18866b={};var _0x41a4cc={};var _0x1eac57;var _0x21561b;return db[_0x4d08('0x40')]['findOne']({'where':{'id':_0xfa38d0[_0x4d08('0x5e')]['id']}})[_0x4d08('0xf')](handleEntityNotFound(_0x3a51ff,null))[_0x4d08('0xf')](function(_0x414bd1){if(_0x414bd1){_0x1eac57=_0x414bd1;_0x41a4cc[_0x4d08('0x44')]=_[_0x4d08('0x59')](db['MailApplication'][_0x4d08('0x41')]);_0x41a4cc['query']=_['keys'](_0xfa38d0[_0x4d08('0x46')]);_0x41a4cc[_0x4d08('0x47')]=_[_0x4d08('0x48')](_0x41a4cc[_0x4d08('0x44')],_0x41a4cc[_0x4d08('0x46')]);_0x18866b['attributes']=_[_0x4d08('0x48')](_0x41a4cc[_0x4d08('0x44')],qs['fields'](_0xfa38d0[_0x4d08('0x46')][_0x4d08('0x4a')]));_0x18866b['attributes']=_0x18866b['attributes']['length']?_0x18866b[_0x4d08('0x49')]:_0x41a4cc[_0x4d08('0x44')];_0x18866b['order']=qs[_0x4d08('0x4e')](_0xfa38d0[_0x4d08('0x46')][_0x4d08('0x4e')]);_0x18866b[_0x4d08('0x4f')]=qs[_0x4d08('0x47')](_[_0x4d08('0x50')](_0xfa38d0[_0x4d08('0x46')],_0x41a4cc['filters']));if(_0xfa38d0[_0x4d08('0x46')][_0x4d08('0x51')]){_0x18866b[_0x4d08('0x4f')]=_['merge'](_0x18866b[_0x4d08('0x4f')],{'$or':_['map'](_0x18866b[_0x4d08('0x49')],function(_0x320c08){var _0x30895e={};_0x30895e[_0x320c08]={'$like':'%'+_0xfa38d0[_0x4d08('0x46')][_0x4d08('0x51')]+'%'};return _0x30895e;})});}_0x18866b=_[_0x4d08('0x67')]({},_0x18866b,_0xfa38d0[_0x4d08('0x53')]);return _0x1eac57[_0x4d08('0x96')](_0x18866b);}})['then'](function(_0x367d1f){if(_0x367d1f){_0x21561b=_0x367d1f[_0x4d08('0x66')];if(!_0xfa38d0[_0x4d08('0x46')]['hasOwnProperty'](_0x4d08('0x4c'))){_0x18866b[_0x4d08('0x1f')]=qs[_0x4d08('0x1f')](_0xfa38d0[_0x4d08('0x46')][_0x4d08('0x1f')]);_0x18866b[_0x4d08('0x1c')]=qs[_0x4d08('0x1c')](_0xfa38d0[_0x4d08('0x46')][_0x4d08('0x1c')]);}return _0x1eac57[_0x4d08('0x96')](_0x18866b);}})[_0x4d08('0xf')](function(_0x177e48){if(_0x177e48){return _0x177e48?{'count':_0x21561b,'rows':_0x177e48}:null;}})[_0x4d08('0xf')](respondWithResult(_0x3a51ff,null))['catch'](handleError(_0x3a51ff,null));};exports['getMessages']=function(_0x1aff43,_0x4c8b4b){var _0x5d2552={'raw':!![],'where':{}};var _0x46de7a={};var _0x360e6d={'count':0x0,'rows':[]};return db[_0x4d08('0x40')][_0x4d08('0x65')]({'where':{'id':_0x1aff43['params']['id']}})[_0x4d08('0xf')](handleEntityNotFound(_0x4c8b4b,null))[_0x4d08('0xf')](function(_0xa9de5c){if(_0xa9de5c){_0x46de7a['model']=_[_0x4d08('0x59')](db[_0x4d08('0x97')]['rawAttributes']);_0x46de7a['query']=_[_0x4d08('0x59')](_0x1aff43['query']);_0x46de7a['filters']=_[_0x4d08('0x48')](_0x46de7a[_0x4d08('0x44')],_0x46de7a[_0x4d08('0x46')]);_0x5d2552[_0x4d08('0x49')]=_[_0x4d08('0x48')](_0x46de7a[_0x4d08('0x44')],qs[_0x4d08('0x4a')](_0x1aff43['query'][_0x4d08('0x4a')]));_0x5d2552[_0x4d08('0x49')]=_0x5d2552[_0x4d08('0x49')][_0x4d08('0x66')]?_0x5d2552[_0x4d08('0x49')]:_0x46de7a[_0x4d08('0x44')];if(!_0x1aff43[_0x4d08('0x46')][_0x4d08('0x4b')](_0x4d08('0x4c'))){_0x5d2552[_0x4d08('0x1f')]=qs[_0x4d08('0x1f')](_0x1aff43[_0x4d08('0x46')]['limit']);_0x5d2552['offset']=qs[_0x4d08('0x1c')](_0x1aff43[_0x4d08('0x46')]['offset']);}_0x5d2552['order']=qs[_0x4d08('0x4e')](_0x1aff43[_0x4d08('0x46')][_0x4d08('0x4e')]);_0x5d2552[_0x4d08('0x4f')]=qs[_0x4d08('0x47')](_[_0x4d08('0x50')](_0x1aff43[_0x4d08('0x46')],_0x46de7a[_0x4d08('0x47')]));_0x5d2552[_0x4d08('0x4f')]['MailAccountId']=_0xa9de5c['id'];if(_0x1aff43[_0x4d08('0x46')][_0x4d08('0x51')]){_0x5d2552['where']=_['merge'](_0x5d2552[_0x4d08('0x4f')],{'$or':_['map'](_0x5d2552['attributes'],function(_0x2ee1ea){var _0x293a4f={};_0x293a4f[_0x2ee1ea]={'$like':'%'+_0x1aff43[_0x4d08('0x46')]['filter']+'%'};return _0x293a4f;})});}if(_0x1aff43[_0x4d08('0x46')][_0x4d08('0x98')]){var _0x1c3f13=_0x1aff43[_0x4d08('0x46')][_0x4d08('0x98')][_0x4d08('0x99')](',');var _0x1d314e={};_0x1d314e[_0x1c3f13[0x0]]={'$gte':moment(_0x1c3f13[0x1])[_0x4d08('0x9a')](_0x4d08('0x9b'))};_0x5d2552[_0x4d08('0x4f')]=_[_0x4d08('0x67')](_0x5d2552[_0x4d08('0x4f')],_0x1d314e);}_0x5d2552=_[_0x4d08('0x67')]({},_0x5d2552,_0x1aff43[_0x4d08('0x53')]);return db[_0x4d08('0x97')][_0x4d08('0x1e')]({'where':_0x5d2552[_0x4d08('0x4f')]})[_0x4d08('0xf')](function(_0x518c8e){_0x360e6d[_0x4d08('0x1e')]=_0x518c8e;if(_0x1aff43['query']['includeAll']){_0x5d2552[_0x4d08('0x55')]=[{'all':!![]}];}return db[_0x4d08('0x97')]['findAll'](_0x5d2552);})[_0x4d08('0xf')](function(_0x4b767a){if(_0x1aff43[_0x4d08('0x46')][_0x4d08('0x9c')]===_0x4d08('0x9d')){for(var _0x5675c3=0x0;_0x5675c3<_0x4b767a[_0x4d08('0x66')];_0x5675c3++){_0x4b767a[_0x5675c3][_0x4d08('0x5b')]=juice(_0x4b767a[_0x5675c3][_0x4d08('0x5b')]);}}_0x360e6d['rows']=_0x4b767a;return _0x360e6d;});}})[_0x4d08('0xf')](respondWithFilteredResult(_0x4c8b4b,_0x5d2552))[_0x4d08('0x18')](handleError(_0x4c8b4b,null));};exports[_0x4d08('0x26')]=function(_0x2ec4b3,_0x1f7bd8){var _0x5c87a4,_0x5a1f56={},_0x111a2c;if(_0x2ec4b3[_0x4d08('0x5b')]['to']){_0x111a2c=_0x2ec4b3[_0x4d08('0x5b')]['to'][_0x4d08('0x99')](',')[0x0];}return db['MailAccount'][_0x4d08('0x5a')]({'where':{'id':_0x2ec4b3[_0x4d08('0x5e')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x4d08('0x9e')],'as':'Contacts','where':{'email':_0x111a2c},'limit':0x1,'order':[[_0x4d08('0x9f'),_0x4d08('0xa0')]]}]},{'model':db[_0x4d08('0x3d')],'as':_0x4d08('0x3a'),'raw':!![],'include':[{'model':db[_0x4d08('0xa1')],'as':_0x4d08('0xa1'),'raw':!![]}]}]})[_0x4d08('0xf')](handleEntityNotFound(_0x1f7bd8,null))[_0x4d08('0xf')](function(_0x5bf33f){if(!_0x5bf33f)return;_0x5c87a4=_0x5bf33f;if(!_0x5bf33f[_0x4d08('0x3a')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x4d08('0x71')](_0x2ec4b3['body'][_0x4d08('0xa2')])){_0x2ec4b3['body'][_0x4d08('0xa2')]=util[_0x4d08('0x9a')](_0x4d08('0xa3'),_0x5bf33f[_0x4d08('0x25')],_0x5bf33f[_0x4d08('0x70')]||_0x5bf33f[_0x4d08('0x3a')][_0x4d08('0x2f')]);}if(_0x2ec4b3[_0x4d08('0x5b')][_0x4d08('0xa4')]&&_0x2ec4b3[_0x4d08('0x5b')][_0x4d08('0xa4')][_0x4d08('0x66')]){for(var _0x4bff8b=0x0;_0x4bff8b<_0x2ec4b3[_0x4d08('0x5b')][_0x4d08('0xa4')]['length'];_0x4bff8b+=0x1){_0x2ec4b3[_0x4d08('0x5b')][_0x4d08('0xa4')][_0x4bff8b]={'filename':_0x2ec4b3['body'][_0x4d08('0xa4')][_0x4bff8b][_0x4d08('0x25')],'path':path[_0x4d08('0xa5')](config['root'],'server/files/attachments',_0x2ec4b3[_0x4d08('0x5b')]['attachments'][_0x4bff8b]['basename'])};}}var _0x4a3895=_0x5bf33f[_0x4d08('0xa6')]();return respondWithRpcPromise(_0x4d08('0xa7'),_0x4d08('0xa8'),{'account':_0x4a3895,'message':_0x2ec4b3[_0x4d08('0x5b')]});})[_0x4d08('0xf')](function(_0x159b01){if(!_0x159b01)return;_0x5a1f56=_0x159b01;if(!_0x5c87a4[_0x4d08('0xa9')])throw new Error(_0x4d08('0xaa'));if(_0x5c87a4['List'][_0x4d08('0xab')][_0x4d08('0x66')])return _0x5c87a4[_0x4d08('0xa9')][_0x4d08('0xab')][0x0];return db[_0x4d08('0x9e')][_0x4d08('0x6c')](_[_0x4d08('0x9')](_0x2ec4b3[_0x4d08('0x5b')],{'firstName':_0x2ec4b3['body']['to'],'email':_0x2ec4b3[_0x4d08('0x5b')]['to'],'phone':_0x2ec4b3[_0x4d08('0x5b')]['to'],'ListId':_0x5c87a4[_0x4d08('0xac')]}));})[_0x4d08('0xf')](function(_0x3f5cbf){if(!_0x3f5cbf)return;var _0x46dcb9={'UserId':_0x2ec4b3['user']['id'],'ContactId':_0x3f5cbf['id'],'MailAccountId':_0x5c87a4['id'],'inReplyTo':_0x5a1f56['messageId'],'to':_0x2ec4b3['body']['from'],'cc':_0x2ec4b3['body']['cc'],'subject':_0x2ec4b3[_0x4d08('0x5b')][_0x4d08('0xad')],'attach':_0x2ec4b3[_0x4d08('0x5b')][_0x4d08('0xae')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x4d08('0x9a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_[_0x4d08('0x67')](_0x2ec4b3[_0x4d08('0x5b')],{'messageId':_0x5a1f56['messageId'],'sentAt':moment()['format'](_0x4d08('0x9b')),'read':!![],'MailAccountId':_0x5c87a4['id'],'UserId':_0x2ec4b3[_0x4d08('0x2f')]['id'],'ContactId':_0x3f5cbf['id']})]};if(_0x2ec4b3[_0x4d08('0x5b')][_0x4d08('0xaf')]){_0x46dcb9=_[_0x4d08('0x67')](_0x46dcb9,_0x2ec4b3[_0x4d08('0x5b')][_0x4d08('0xaf')]);}return db[_0x4d08('0x83')][_0x4d08('0x6c')](_0x46dcb9,{'include':[{'model':db[_0x4d08('0x97')],'as':_0x4d08('0xb0')}]});})['then'](respondWithResult(_0x1f7bd8,null))[_0x4d08('0x18')](handleError(_0x1f7bd8,null));};exports[_0x4d08('0xb1')]=function(_0xadbffa,_0x1c456c){return db[_0x4d08('0x40')][_0x4d08('0x5a')]({'where':{'id':_0xadbffa[_0x4d08('0x5e')]['id']},'include':[{'model':db[_0x4d08('0x3d')],'as':_0x4d08('0x3a'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x4d08('0xa1'),'raw':!![]}]}]})[_0x4d08('0xf')](handleEntityNotFound(_0x1c456c,null))[_0x4d08('0xf')](function(_0x5e9873){if(!_0x5e9873[_0x4d08('0x3a')])return;var _0x51d7b4=_0x5e9873[_0x4d08('0xa6')]();return respondWithRpcPromise(_0x4d08('0xb2'),_0x4d08('0xb1'),{'account':_0x51d7b4});})[_0x4d08('0xf')](respondWithResult(_0x1c456c,null))[_0x4d08('0x18')](handleError(_0x1c456c,null));};exports[_0x4d08('0x23')]=function(_0x35a359,_0x3a1ed8){return db[_0x4d08('0x40')]['find']({'where':{'id':_0x35a359['params']['id']}})['then'](handleEntityNotFound(_0x3a1ed8,null))['then'](function(_0x23727a){if(_0x23727a&&_0x23727a[_0x4d08('0x37')]){throw new db[(_0x4d08('0xb3'))]['ValidationError'](_0x4d08('0xb4'));}return _0x23727a;})[_0x4d08('0xf')](removeEntity(_0x3a1ed8,null))[_0x4d08('0x18')](handleError(_0x3a1ed8,null));};exports[_0x4d08('0xb5')]=function(_0x1ab68b,_0x22355b){return db[_0x4d08('0x40')][_0x4d08('0x5a')]({'where':{'id':_0x1ab68b[_0x4d08('0x5e')]['id']}})[_0x4d08('0xf')](handleEntityNotFound(_0x22355b,null))[_0x4d08('0xf')](function(_0x1efa9c){if(_0x1efa9c){return _0x1efa9c[_0x4d08('0xb5')](_0x1ab68b['body'][_0x4d08('0x69')],_['omit'](_0x1ab68b[_0x4d08('0x5b')],[_0x4d08('0x69'),'id'])||{})[_0x4d08('0xb6')](function(_0x186508){for(var _0x122413=0x0;_0x122413<_0x1ab68b[_0x4d08('0x5b')][_0x4d08('0x69')][_0x4d08('0x66')];_0x122413+=0x1){socket['emit'](_0x4d08('0xb7'),{'UserId':Number(_0x1ab68b[_0x4d08('0x5b')][_0x4d08('0x69')][_0x122413]),'MailAccountId':Number(_0x1ab68b[_0x4d08('0x5e')]['id'])});}return _0x186508;});}})[_0x4d08('0xf')](respondWithResult(_0x22355b,null))['catch'](handleError(_0x22355b,null));};exports[_0x4d08('0xb8')]=function(_0x59bcaf,_0x191323){return db[_0x4d08('0x40')][_0x4d08('0x5a')]({'where':{'id':_0x59bcaf[_0x4d08('0x5e')]['id']}})[_0x4d08('0xf')](handleEntityNotFound(_0x191323,null))['then'](function(_0x31780f){if(_0x31780f){return _0x31780f[_0x4d08('0xb8')](_0x59bcaf[_0x4d08('0x46')][_0x4d08('0x69')])[_0x4d08('0xf')](function(){if(_[_0x4d08('0xb9')](_0x59bcaf[_0x4d08('0x46')][_0x4d08('0x69')])){for(var _0x14269b=0x0;_0x14269b<_0x59bcaf['query'][_0x4d08('0x69')][_0x4d08('0x66')];_0x14269b+=0x1){socket[_0x4d08('0xba')](_0x4d08('0xbb'),{'UserId':Number(_0x59bcaf[_0x4d08('0x46')]['ids'][_0x14269b]),'MailAccountId':Number(_0x59bcaf[_0x4d08('0x5e')]['id'])});}}else{socket['emit'](_0x4d08('0xbb'),{'UserId':Number(_0x59bcaf[_0x4d08('0x46')][_0x4d08('0x69')]),'MailAccountId':Number(_0x59bcaf['params']['id'])});}});}})[_0x4d08('0xf')](respondWithStatusCode(_0x191323,null))[_0x4d08('0x18')](handleError(_0x191323,null));};exports[_0x4d08('0xbc')]=function(_0x597f29,_0x3bda84){var _0x4dd2fd={};var _0x2543a9={};var _0x5ac8bb;var _0x2f29d3;return db['MailAccount'][_0x4d08('0x65')]({'where':{'id':_0x597f29[_0x4d08('0x5e')]['id']}})[_0x4d08('0xf')](handleEntityNotFound(_0x3bda84,null))[_0x4d08('0xf')](function(_0x4e9c10){if(_0x4e9c10){_0x5ac8bb=_0x4e9c10;_0x2543a9['model']=_[_0x4d08('0x59')](db['User'][_0x4d08('0x41')]);_0x2543a9[_0x4d08('0x46')]=_[_0x4d08('0x59')](_0x597f29['query']);_0x2543a9[_0x4d08('0x47')]=_['intersection'](_0x2543a9[_0x4d08('0x44')],_0x2543a9[_0x4d08('0x46')]);_0x4dd2fd[_0x4d08('0x49')]=_[_0x4d08('0x48')](_0x2543a9['model'],qs[_0x4d08('0x4a')](_0x597f29[_0x4d08('0x46')]['fields']));_0x4dd2fd[_0x4d08('0x49')]=_0x4dd2fd[_0x4d08('0x49')][_0x4d08('0x66')]?_0x4dd2fd[_0x4d08('0x49')]:_0x2543a9[_0x4d08('0x44')];_0x4dd2fd[_0x4d08('0x4d')]=qs[_0x4d08('0x4e')](_0x597f29['query']['sort']);_0x4dd2fd[_0x4d08('0x4f')]=qs[_0x4d08('0x47')](_['pick'](_0x597f29['query'],_0x2543a9['filters']));if(_0x597f29[_0x4d08('0x46')][_0x4d08('0x51')]){_0x4dd2fd[_0x4d08('0x4f')]=_['merge'](_0x4dd2fd['where'],{'$or':_['map'](_0x4dd2fd[_0x4d08('0x49')],function(_0x264bcb){var _0xfdf782={};_0xfdf782[_0x264bcb]={'$like':'%'+_0x597f29[_0x4d08('0x46')][_0x4d08('0x51')]+'%'};return _0xfdf782;})});}_0x4dd2fd=_[_0x4d08('0x67')]({},_0x4dd2fd,_0x597f29[_0x4d08('0x53')]);return _0x5ac8bb[_0x4d08('0xbc')](_0x4dd2fd);}})['then'](function(_0x3e566c){if(_0x3e566c){_0x2f29d3=_0x3e566c[_0x4d08('0x66')];if(!_0x597f29[_0x4d08('0x46')][_0x4d08('0x4b')]('nolimit')){_0x4dd2fd[_0x4d08('0x1f')]=qs[_0x4d08('0x1f')](_0x597f29[_0x4d08('0x46')][_0x4d08('0x1f')]);_0x4dd2fd[_0x4d08('0x1c')]=qs[_0x4d08('0x1c')](_0x597f29[_0x4d08('0x46')][_0x4d08('0x1c')]);}return _0x5ac8bb[_0x4d08('0xbc')](_0x4dd2fd);}})['then'](function(_0x1485db){if(_0x1485db){return _0x1485db?{'count':_0x2f29d3,'rows':_0x1485db}:null;}})[_0x4d08('0xf')](respondWithResult(_0x3bda84,null))['catch'](handleError(_0x3bda84,null));}; \ No newline at end of file +var _0xdb3f=['query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','keys','body','provider','custom','secure','Mail\x20Account\x20not\x20found','describe','Disposition','create','getDispositions','findOne','length','hasOwnProperty','findAll','removeDispositions','find','ids','addAnswer','CannedAnswer','MailAccountId','removeAnswers','key','email','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','getImap','removeImap','setImap','getSmtp','removeSmtp','addInteraction','omit','MailInteraction','Contact','Owner','internal','Tags','color','tag','addApplications','sequelize','transaction','Transaction','MailApplication','bulkCreate','priority','finally','getApplications','getMessages','MailMessage','$gte','split','format','inlineCss','true','CmContact','Contacts','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','List','ListId','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','isArray','userMailAccount:remove','getAgents','moment','bluebird','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','username','password','modernAuthentication','CloudProviderId','pass','host','port','service','authentication','user','Imap','Smtp','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','model'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xdb3f,0x130));var _0xfdb3=function(_0x1c1566,_0x36b365){_0x1c1566=_0x1c1566-0x0;var _0x461fae=_0xdb3f[_0x1c1566];return _0x461fae;};'use strict';var moment=require(_0xfdb3('0x0'));var BPromise=require(_0xfdb3('0x1'));var util=require('util');var path=require('path');var _=require(_0xfdb3('0x2'));var juice=require(_0xfdb3('0x3'));var Redis=require(_0xfdb3('0x4'));var qs=require(_0xfdb3('0x5'));var logger=require(_0xfdb3('0x6'))(_0xfdb3('0x7'));var config=require(_0xfdb3('0x8'));var db=require(_0xfdb3('0x9'))['db'];config[_0xfdb3('0xa')]=_[_0xfdb3('0xb')](config[_0xfdb3('0xa')],{'host':_0xfdb3('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfdb3('0xa')]));require(_0xfdb3('0xd'))[_0xfdb3('0xe')](socket);var jayson=require(_0xfdb3('0xf'));var client=jayson[_0xfdb3('0x10')][_0xfdb3('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x1c2f8c,_0x218d07,_0x58f259,_0x11c789){return new BPromise(function(_0x403028,_0x27cbed){var _0x1d078c=_0x11c789||client;return _0x1d078c[_0xfdb3('0x12')](_0x1c2f8c,_0x58f259)[_0xfdb3('0x13')](function(_0x2ed307){logger[_0xfdb3('0x14')]('MailAccount,\x20%s,\x20%s',_0x218d07,_0xfdb3('0x15'));logger[_0xfdb3('0x16')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x218d07,_0xfdb3('0x15'),JSON['stringify'](_0x2ed307));if(_0x2ed307[_0xfdb3('0x17')]){if(_0x2ed307[_0xfdb3('0x17')]['code']===0x1f4){logger[_0xfdb3('0x17')](_0xfdb3('0x18'),_0x218d07,_0x2ed307[_0xfdb3('0x17')]['message']);return _0x27cbed(_0x2ed307[_0xfdb3('0x17')][_0xfdb3('0x19')]);}logger['error'](_0xfdb3('0x18'),_0x218d07,_0x2ed307[_0xfdb3('0x17')][_0xfdb3('0x19')]);return _0x403028(_0x2ed307['error']['message']);}else{logger[_0xfdb3('0x14')](_0xfdb3('0x18'),_0x218d07,_0xfdb3('0x15'));_0x403028(_0x2ed307[_0xfdb3('0x1a')][_0xfdb3('0x19')]);}})[_0xfdb3('0x1b')](function(_0x43507e){logger[_0xfdb3('0x17')](_0xfdb3('0x18'),_0x218d07,_0x43507e);_0x27cbed(_0x43507e);});});}function respondWithStatusCode(_0xa06451,_0x300380){_0x300380=_0x300380||0xcc;return function(_0x39187b){if(_0x39187b){return _0xa06451[_0xfdb3('0x1c')](_0x300380);}return _0xa06451[_0xfdb3('0x1d')](_0x300380)[_0xfdb3('0x1e')]();};}function respondWithResult(_0x508fa0,_0x784d03){_0x784d03=_0x784d03||0xc8;return function(_0x313ba0){if(_0x313ba0){return _0x508fa0['status'](_0x784d03)[_0xfdb3('0x1f')](_0x313ba0);}};}function respondWithFilteredResult(_0x48ec8b,_0x57785d){return function(_0x28176c){if(_0x28176c){var _0x548d8f=typeof _0x57785d[_0xfdb3('0x20')]===_0xfdb3('0x21')&&typeof _0x57785d['limit']==='undefined';var _0x201c1c=_0x28176c['count'];var _0x236a6e=_0x548d8f?0x0:_0x57785d[_0xfdb3('0x20')];var _0x1d73b1=_0x548d8f?_0x28176c[_0xfdb3('0x22')]:_0x57785d[_0xfdb3('0x20')]+_0x57785d[_0xfdb3('0x23')];var _0x2c731a;if(_0x1d73b1>=_0x201c1c){_0x1d73b1=_0x201c1c;_0x2c731a=0xc8;}else{_0x2c731a=0xce;}_0x48ec8b['status'](_0x2c731a);return _0x48ec8b['set'](_0xfdb3('0x24'),_0x236a6e+'-'+_0x1d73b1+'/'+_0x201c1c)[_0xfdb3('0x1f')](_0x28176c);}return null;};}function saveUpdates(_0x58cfdc){return function(_0x18cf67){if(_0x18cf67){return _0x18cf67[_0xfdb3('0x25')](_0x58cfdc)['then'](function(_0x3d1008){return _0x3d1008;});}return null;};}function removeEntity(_0x4a82fe){return function(_0xec05a6){if(_0xec05a6){return _0xec05a6[_0xfdb3('0x26')]()[_0xfdb3('0x13')](function(){var _0x20ab23=_0xec05a6[_0xfdb3('0x27')]({'plain':!![]});var _0x46e8a3=_0xfdb3('0x28');return db[_0xfdb3('0x29')][_0xfdb3('0x26')]({'where':{'type':_0x46e8a3,'resourceId':_0x20ab23['id']}})[_0xfdb3('0x13')](function(){return _0xec05a6;});})[_0xfdb3('0x13')](function(){_0x4a82fe[_0xfdb3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cb57c){return function(_0x592e95){if(!_0x592e95){_0x4cb57c[_0xfdb3('0x1c')](0x194);}return _0x592e95;};}function handleError(_0x406b46,_0x18a4d3){_0x18a4d3=_0x18a4d3||0x1f4;return function(_0x2f5985){logger[_0xfdb3('0x17')](_0x2f5985[_0xfdb3('0x2a')]);if(_0x2f5985[_0xfdb3('0x2b')]){delete _0x2f5985[_0xfdb3('0x2b')];}_0x406b46[_0xfdb3('0x1d')](_0x18a4d3)[_0xfdb3('0x2c')](_0x2f5985);};}function getImapHost(_0x4d819d){switch(_0x4d819d){case _0xfdb3('0x2d'):return _0xfdb3('0x2e');case _0xfdb3('0x2f'):return'imap.mail.yahoo.com';case _0xfdb3('0x30'):return _0xfdb3('0x31');case'outlook365':return _0xfdb3('0x32');}throw new Error(_0xfdb3('0x33'),_0x4d819d);}function getSmtpHost(_0x5ea9b4){switch(_0x5ea9b4){case _0xfdb3('0x2d'):return _0xfdb3('0x34');case'yahoo':return _0xfdb3('0x35');case _0xfdb3('0x30'):return _0xfdb3('0x36');case _0xfdb3('0x37'):return _0xfdb3('0x38');}throw new Error(_0xfdb3('0x33'),_0x5ea9b4);}function getAuthenticationOptions(_0x6e5f7e,_0x3788a4){var _0x557dec={};var _0x6244fc={};if(_0x6e5f7e){_0x557dec['user']=_0x6244fc['user']=_0x3788a4[_0xfdb3('0x39')];_0x557dec[_0xfdb3('0x3a')]=_0x6244fc['pass']=_0x3788a4[_0xfdb3('0x3a')];if(_0x3788a4['modernAuthentication']){_0x557dec[_0xfdb3('0x3b')]=_0x6244fc[_0xfdb3('0x3b')]=!![];_0x557dec[_0xfdb3('0x3c')]=_0x6244fc['CloudProviderId']=_0x3788a4['CloudProviderId'];_0x557dec['password']=_0x6244fc[_0xfdb3('0x3d')]=null;}else{_0x557dec[_0xfdb3('0x3c')]=_0x6244fc['CloudProviderId']=null;}_0x557dec[_0xfdb3('0x3e')]=getImapHost(_0x6e5f7e);_0x557dec[_0xfdb3('0x3f')]=0x3e1;_0x6244fc['host']=getSmtpHost(_0x6e5f7e);_0x6244fc[_0xfdb3('0x3f')]=0x24b;_0x6244fc['secure']=![];_0x557dec[_0xfdb3('0x40')]=_0x6244fc[_0xfdb3('0x40')]=null;}else{if(_0x3788a4[_0xfdb3('0x41')]){_0x557dec['user']=_0x6244fc['user']=_0x3788a4[_0xfdb3('0x39')];_0x557dec[_0xfdb3('0x3a')]=_0x6244fc[_0xfdb3('0x3d')]=_0x3788a4[_0xfdb3('0x3a')];}else{_0x557dec['authentication']=_0x6244fc[_0xfdb3('0x41')]=![];_0x557dec[_0xfdb3('0x42')]=_0x6244fc['user']=null;_0x557dec[_0xfdb3('0x3a')]=_0x6244fc[_0xfdb3('0x3d')]=null;}_0x557dec[_0xfdb3('0x3e')]=_0x3788a4[_0xfdb3('0x43')][_0xfdb3('0x3e')];_0x557dec[_0xfdb3('0x3f')]=_0x3788a4[_0xfdb3('0x43')][_0xfdb3('0x3f')];_0x6244fc[_0xfdb3('0x3e')]=_0x3788a4[_0xfdb3('0x44')][_0xfdb3('0x3e')];_0x6244fc[_0xfdb3('0x3f')]=_0x3788a4[_0xfdb3('0x44')][_0xfdb3('0x3f')];}return{'Imap':_0x557dec,'Smtp':_0x6244fc};}exports['index']=function(_0x34cc47,_0x48a42e){var _0x179e0f={'include':[{'model':db[_0xfdb3('0x45')],'as':'Imap'},{'model':db[_0xfdb3('0x46')],'as':_0xfdb3('0x44')},{'model':db[_0xfdb3('0x47')],'as':_0xfdb3('0x48')}]},_0x88ad70={},_0x535bb4={'count':0x0,'rows':[]};var _0x20a7c9=_[_0xfdb3('0x49')](db[_0xfdb3('0x4a')][_0xfdb3('0x4b')],function(_0x58a09f){return{'name':_0x58a09f[_0xfdb3('0x4c')],'type':_0x58a09f['type']['key']};});_0x88ad70[_0xfdb3('0x4d')]=_[_0xfdb3('0x49')](_0x20a7c9,_0xfdb3('0x2b'));_0x88ad70[_0xfdb3('0x4e')]=_['keys'](_0x34cc47[_0xfdb3('0x4e')]);_0x88ad70[_0xfdb3('0x4f')]=_[_0xfdb3('0x50')](_0x88ad70[_0xfdb3('0x4d')],_0x88ad70[_0xfdb3('0x4e')]);_0x179e0f[_0xfdb3('0x51')]=_[_0xfdb3('0x50')](_0x88ad70['model'],qs['fields'](_0x34cc47[_0xfdb3('0x4e')][_0xfdb3('0x52')]));_0x179e0f[_0xfdb3('0x51')]=_0x179e0f[_0xfdb3('0x51')]['length']?_0x179e0f[_0xfdb3('0x51')]:_0x88ad70['model'];if(!_0x34cc47[_0xfdb3('0x4e')]['hasOwnProperty'](_0xfdb3('0x53'))){_0x179e0f[_0xfdb3('0x23')]=qs[_0xfdb3('0x23')](_0x34cc47[_0xfdb3('0x4e')][_0xfdb3('0x23')]);_0x179e0f[_0xfdb3('0x20')]=qs['offset'](_0x34cc47[_0xfdb3('0x4e')][_0xfdb3('0x20')]);}_0x179e0f[_0xfdb3('0x54')]=qs[_0xfdb3('0x55')](_0x34cc47[_0xfdb3('0x4e')][_0xfdb3('0x55')]);_0x179e0f[_0xfdb3('0x56')]=qs['filters'](_[_0xfdb3('0x57')](_0x34cc47['query'],_0x88ad70[_0xfdb3('0x4f')]),_0x20a7c9);if(_0x34cc47[_0xfdb3('0x4e')][_0xfdb3('0x58')]){_0x179e0f['where']=_[_0xfdb3('0x59')](_0x179e0f[_0xfdb3('0x56')],{'$or':_[_0xfdb3('0x49')](_0x20a7c9,function(_0x275bb5){if(_0x275bb5[_0xfdb3('0x5a')]!==_0xfdb3('0x5b')){var _0xa3f4f6={};_0xa3f4f6[_0x275bb5[_0xfdb3('0x2b')]]={'$like':'%'+_0x34cc47[_0xfdb3('0x4e')]['filter']+'%'};return _0xa3f4f6;}})});}_0x179e0f=_[_0xfdb3('0x59')]({},_0x179e0f,_0x34cc47[_0xfdb3('0x5c')]);var _0x1c3f67={'where':_0x179e0f['where']};return db[_0xfdb3('0x4a')][_0xfdb3('0x22')](_0x1c3f67)[_0xfdb3('0x13')](function(_0x32c655){_0x535bb4['count']=_0x32c655;if(_0x34cc47['query'][_0xfdb3('0x5d')]){_0x179e0f[_0xfdb3('0x5e')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x179e0f);})[_0xfdb3('0x13')](function(_0x1ac56e){_0x535bb4[_0xfdb3('0x5f')]=_0x1ac56e;return _0x535bb4;})[_0xfdb3('0x13')](respondWithFilteredResult(_0x48a42e,_0x179e0f))[_0xfdb3('0x1b')](handleError(_0x48a42e,null));};exports[_0xfdb3('0x60')]=function(_0x5dd631,_0x19eca7){var _0x57d084={'raw':![],'where':{'id':_0x5dd631[_0xfdb3('0x61')]['id']},'include':[{'model':db[_0xfdb3('0x45')],'as':_0xfdb3('0x43')},{'model':db[_0xfdb3('0x46')],'as':_0xfdb3('0x44')},{'model':db[_0xfdb3('0x47')],'as':_0xfdb3('0x48')}]},_0x2dc395={};_0x2dc395[_0xfdb3('0x4d')]=_[_0xfdb3('0x62')](db[_0xfdb3('0x4a')]['rawAttributes']);_0x2dc395[_0xfdb3('0x4e')]=_['keys'](_0x5dd631[_0xfdb3('0x4e')]);_0x2dc395[_0xfdb3('0x4f')]=_[_0xfdb3('0x50')](_0x2dc395[_0xfdb3('0x4d')],_0x2dc395[_0xfdb3('0x4e')]);_0x57d084['attributes']=_['intersection'](_0x2dc395[_0xfdb3('0x4d')],qs[_0xfdb3('0x52')](_0x5dd631[_0xfdb3('0x4e')][_0xfdb3('0x52')]));_0x57d084['attributes']=_0x57d084['attributes']['length']?_0x57d084[_0xfdb3('0x51')]:_0x2dc395[_0xfdb3('0x4d')];if(_0x5dd631[_0xfdb3('0x4e')][_0xfdb3('0x5d')]){_0x57d084[_0xfdb3('0x5e')]=[{'all':!![]}];}_0x57d084=_[_0xfdb3('0x59')]({},_0x57d084,_0x5dd631[_0xfdb3('0x5c')]);return db['MailAccount']['find'](_0x57d084)['then'](handleEntityNotFound(_0x19eca7,null))[_0xfdb3('0x13')](respondWithResult(_0x19eca7,null))[_0xfdb3('0x1b')](handleError(_0x19eca7,null));};exports[_0xfdb3('0x25')]=function(_0x14e44d,_0x131620){if(_0x14e44d[_0xfdb3('0x63')]['id']){delete _0x14e44d[_0xfdb3('0x63')]['id'];}var _0x12b2f8=_0x14e44d[_0xfdb3('0x63')][_0xfdb3('0x64')]===_0xfdb3('0x65')?null:_0x14e44d[_0xfdb3('0x63')][_0xfdb3('0x64')];var _0x14626b=_0x14e44d[_0xfdb3('0x63')]['Imap']||{};var _0x2ecf36=_0x14e44d[_0xfdb3('0x63')]['Smtp']||{};if(_0x12b2f8){_0x14626b[_0xfdb3('0x3e')]=getImapHost(_0x12b2f8);_0x14626b[_0xfdb3('0x3f')]=0x3e1;_0x2ecf36[_0xfdb3('0x3e')]=getSmtpHost(_0x12b2f8);_0x2ecf36[_0xfdb3('0x3f')]=0x24b;_0x2ecf36[_0xfdb3('0x66')]=![];}if(_0x2ecf36[_0xfdb3('0x3b')]){_0x2ecf36[_0xfdb3('0x66')]=![];}else{_0x2ecf36[_0xfdb3('0x3c')]=null;}if(!_0x14626b[_0xfdb3('0x3b')])_0x14626b[_0xfdb3('0x3c')]=null;_0x14e44d['body']['Imap']=_0x14626b;_0x14e44d[_0xfdb3('0x63')][_0xfdb3('0x44')]=_0x2ecf36;return db['MailAccount']['find']({'where':{'id':_0x14e44d[_0xfdb3('0x61')]['id']},'include':[{'model':db[_0xfdb3('0x45')],'as':_0xfdb3('0x43')},{'model':db[_0xfdb3('0x46')],'as':_0xfdb3('0x44')},{'model':db[_0xfdb3('0x47')],'as':_0xfdb3('0x48')}]})[_0xfdb3('0x13')](handleEntityNotFound(_0x131620,null))[_0xfdb3('0x13')](function(_0x13c6cf){if(!_0x13c6cf)throw new Error(_0xfdb3('0x67'));if(_0x13c6cf['service'])delete _0x14e44d[_0xfdb3('0x63')][_0xfdb3('0x43')];return _0x13c6cf;})['then'](saveUpdates(_0x14e44d[_0xfdb3('0x63')],null))[_0xfdb3('0x13')](function(_0x4e3dda){if(!_0x14e44d[_0xfdb3('0x63')][_0xfdb3('0x43')])return _0x4e3dda;return db['MailServerIn']['update'](_0x14e44d[_0xfdb3('0x63')][_0xfdb3('0x43')],{'where':{'MailAccountId':_0x4e3dda['id']}})[_0xfdb3('0x13')](function(){return _0x4e3dda;});})[_0xfdb3('0x13')](function(_0x412339){if(!_0x14e44d[_0xfdb3('0x63')][_0xfdb3('0x44')])return _0x412339;return db[_0xfdb3('0x46')][_0xfdb3('0x25')](_0x14e44d[_0xfdb3('0x63')][_0xfdb3('0x44')],{'where':{'MailAccountId':_0x412339['id']}})[_0xfdb3('0x13')](function(){return _0x412339;});})[_0xfdb3('0x13')](respondWithResult(_0x131620,null))['catch'](handleError(_0x131620,null));};exports[_0xfdb3('0x68')]=function(_0x2cb329,_0x13ed0d){return db[_0xfdb3('0x4a')][_0xfdb3('0x68')]()['then'](respondWithResult(_0x13ed0d,null))[_0xfdb3('0x1b')](handleError(_0x13ed0d,null));};exports['addDisposition']=function(_0xc6d6a7,_0x1b973f){if(_0xc6d6a7[_0xfdb3('0x63')]['id']){delete _0xc6d6a7[_0xfdb3('0x63')]['id'];}return db[_0xfdb3('0x4a')]['find']({'where':{'id':_0xc6d6a7['params']['id']}})[_0xfdb3('0x13')](handleEntityNotFound(_0x1b973f,null))[_0xfdb3('0x13')](function(_0x48606e){if(_0x48606e){_0xc6d6a7[_0xfdb3('0x63')]['MailAccountId']=_0x48606e['id'];return db[_0xfdb3('0x69')][_0xfdb3('0x6a')](_0xc6d6a7['body']);}})[_0xfdb3('0x13')](respondWithResult(_0x1b973f,null))[_0xfdb3('0x1b')](handleError(_0x1b973f,null));};exports[_0xfdb3('0x6b')]=function(_0xcf88c1,_0x46f729){var _0x41d290={'raw':![],'where':{}};var _0x1c9ff9={};var _0x49b5be={'count':0x0,'rows':[]};return db[_0xfdb3('0x4a')][_0xfdb3('0x6c')]({'where':{'id':_0xcf88c1[_0xfdb3('0x61')]['id']}})[_0xfdb3('0x13')](handleEntityNotFound(_0x46f729,null))[_0xfdb3('0x13')](function(_0xd8c298){if(_0xd8c298){_0x1c9ff9['model']=_[_0xfdb3('0x62')](db[_0xfdb3('0x69')]['rawAttributes']);_0x1c9ff9[_0xfdb3('0x4e')]=_[_0xfdb3('0x62')](_0xcf88c1[_0xfdb3('0x4e')]);_0x1c9ff9['filters']=_[_0xfdb3('0x50')](_0x1c9ff9[_0xfdb3('0x4d')],_0x1c9ff9['query']);_0x41d290[_0xfdb3('0x51')]=_[_0xfdb3('0x50')](_0x1c9ff9['model'],qs[_0xfdb3('0x52')](_0xcf88c1[_0xfdb3('0x4e')][_0xfdb3('0x52')]));_0x41d290[_0xfdb3('0x51')]=_0x41d290[_0xfdb3('0x51')][_0xfdb3('0x6d')]?_0x41d290[_0xfdb3('0x51')]:_0x1c9ff9[_0xfdb3('0x4d')];if(!_0xcf88c1[_0xfdb3('0x4e')][_0xfdb3('0x6e')](_0xfdb3('0x53'))){_0x41d290['limit']=qs[_0xfdb3('0x23')](_0xcf88c1[_0xfdb3('0x4e')][_0xfdb3('0x23')]);_0x41d290[_0xfdb3('0x20')]=qs[_0xfdb3('0x20')](_0xcf88c1['query'][_0xfdb3('0x20')]);}_0x41d290['order']=qs[_0xfdb3('0x55')](_0xcf88c1['query'][_0xfdb3('0x55')]);_0x41d290[_0xfdb3('0x56')]=qs[_0xfdb3('0x4f')](_[_0xfdb3('0x57')](_0xcf88c1['query'],_0x1c9ff9[_0xfdb3('0x4f')]));_0x41d290[_0xfdb3('0x56')]['MailAccountId']=_0xd8c298['id'];if(_0xcf88c1['query'][_0xfdb3('0x58')]){_0x41d290['where']=_[_0xfdb3('0x59')](_0x41d290['where'],{'$or':_['map'](_0x41d290[_0xfdb3('0x51')],function(_0x30a21c){var _0x56b315={};_0x56b315[_0x30a21c]={'$like':'%'+_0xcf88c1[_0xfdb3('0x4e')][_0xfdb3('0x58')]+'%'};return _0x56b315;})});}_0x41d290=_[_0xfdb3('0x59')]({},_0x41d290,_0xcf88c1['options']);return db[_0xfdb3('0x69')][_0xfdb3('0x22')]({'where':_0x41d290[_0xfdb3('0x56')]})['then'](function(_0x3bf8c5){_0x49b5be['count']=_0x3bf8c5;if(_0xcf88c1['query'][_0xfdb3('0x5d')]){_0x41d290[_0xfdb3('0x5e')]=[{'all':!![]}];}return db[_0xfdb3('0x69')][_0xfdb3('0x6f')](_0x41d290);})[_0xfdb3('0x13')](function(_0x1955db){_0x49b5be[_0xfdb3('0x5f')]=_0x1955db;return _0x49b5be;});}})[_0xfdb3('0x13')](respondWithFilteredResult(_0x46f729,_0x41d290))[_0xfdb3('0x1b')](handleError(_0x46f729,null));};exports[_0xfdb3('0x70')]=function(_0x122a6d,_0x5bb4e9){return db[_0xfdb3('0x4a')][_0xfdb3('0x71')]({'where':{'id':_0x122a6d[_0xfdb3('0x61')]['id']}})[_0xfdb3('0x13')](handleEntityNotFound(_0x5bb4e9,null))[_0xfdb3('0x13')](function(_0x2b6bcc){if(_0x2b6bcc){return _0x2b6bcc[_0xfdb3('0x70')](_0x122a6d['query'][_0xfdb3('0x72')]);}})[_0xfdb3('0x13')](respondWithStatusCode(_0x5bb4e9,null))[_0xfdb3('0x1b')](handleError(_0x5bb4e9,null));};exports[_0xfdb3('0x73')]=function(_0x178ff5,_0x5f01c6){if(_0x178ff5[_0xfdb3('0x63')]['id']){delete _0x178ff5[_0xfdb3('0x63')]['id'];}return db['MailAccount'][_0xfdb3('0x71')]({'where':{'id':_0x178ff5['params']['id']}})[_0xfdb3('0x13')](handleEntityNotFound(_0x5f01c6,null))[_0xfdb3('0x13')](function(_0x5900f4){if(_0x5900f4){_0x178ff5[_0xfdb3('0x63')]['MailAccountId']=_0x5900f4['id'];return db[_0xfdb3('0x74')][_0xfdb3('0x6a')](_0x178ff5[_0xfdb3('0x63')]);}})['then'](respondWithResult(_0x5f01c6,null))[_0xfdb3('0x1b')](handleError(_0x5f01c6,null));};exports['getAnswers']=function(_0x2b7fbf,_0xece09b){var _0x52a76c={'raw':![],'where':{}};var _0x3c98ad={};var _0x9d5256={'count':0x0,'rows':[]};return db[_0xfdb3('0x4a')]['findOne']({'where':{'id':_0x2b7fbf[_0xfdb3('0x61')]['id']}})['then'](handleEntityNotFound(_0xece09b,null))[_0xfdb3('0x13')](function(_0x906630){if(_0x906630){_0x3c98ad[_0xfdb3('0x4d')]=_[_0xfdb3('0x62')](db['CannedAnswer']['rawAttributes']);_0x3c98ad['query']=_[_0xfdb3('0x62')](_0x2b7fbf[_0xfdb3('0x4e')]);_0x3c98ad[_0xfdb3('0x4f')]=_[_0xfdb3('0x50')](_0x3c98ad[_0xfdb3('0x4d')],_0x3c98ad[_0xfdb3('0x4e')]);_0x52a76c[_0xfdb3('0x51')]=_[_0xfdb3('0x50')](_0x3c98ad[_0xfdb3('0x4d')],qs[_0xfdb3('0x52')](_0x2b7fbf['query']['fields']));_0x52a76c['attributes']=_0x52a76c['attributes'][_0xfdb3('0x6d')]?_0x52a76c['attributes']:_0x3c98ad[_0xfdb3('0x4d')];if(!_0x2b7fbf[_0xfdb3('0x4e')][_0xfdb3('0x6e')](_0xfdb3('0x53'))){_0x52a76c[_0xfdb3('0x23')]=qs[_0xfdb3('0x23')](_0x2b7fbf[_0xfdb3('0x4e')][_0xfdb3('0x23')]);_0x52a76c['offset']=qs[_0xfdb3('0x20')](_0x2b7fbf[_0xfdb3('0x4e')][_0xfdb3('0x20')]);}_0x52a76c[_0xfdb3('0x54')]=qs['sort'](_0x2b7fbf[_0xfdb3('0x4e')][_0xfdb3('0x55')]);_0x52a76c[_0xfdb3('0x56')]=qs[_0xfdb3('0x4f')](_['pick'](_0x2b7fbf[_0xfdb3('0x4e')],_0x3c98ad[_0xfdb3('0x4f')]));_0x52a76c[_0xfdb3('0x56')][_0xfdb3('0x75')]=_0x906630['id'];if(_0x2b7fbf['query']['filter']){_0x52a76c[_0xfdb3('0x56')]=_['merge'](_0x52a76c[_0xfdb3('0x56')],{'$or':_[_0xfdb3('0x49')](_0x52a76c[_0xfdb3('0x51')],function(_0x1fdc95){var _0x4f479a={};_0x4f479a[_0x1fdc95]={'$like':'%'+_0x2b7fbf[_0xfdb3('0x4e')][_0xfdb3('0x58')]+'%'};return _0x4f479a;})});}_0x52a76c=_['merge']({},_0x52a76c,_0x2b7fbf[_0xfdb3('0x5c')]);return db[_0xfdb3('0x74')][_0xfdb3('0x22')]({'where':_0x52a76c[_0xfdb3('0x56')]})['then'](function(_0x4f104e){_0x9d5256['count']=_0x4f104e;if(_0x2b7fbf[_0xfdb3('0x4e')][_0xfdb3('0x5d')]){_0x52a76c[_0xfdb3('0x5e')]=[{'all':!![]}];}return db['CannedAnswer'][_0xfdb3('0x6f')](_0x52a76c);})[_0xfdb3('0x13')](function(_0x167cd9){_0x9d5256[_0xfdb3('0x5f')]=_0x167cd9;return _0x9d5256;});}})[_0xfdb3('0x13')](respondWithFilteredResult(_0xece09b,_0x52a76c))[_0xfdb3('0x1b')](handleError(_0xece09b,null));};exports['removeAnswers']=function(_0x20719b,_0x368ef9){return db['MailAccount'][_0xfdb3('0x71')]({'where':{'id':_0x20719b['params']['id']}})['then'](handleEntityNotFound(_0x368ef9,null))[_0xfdb3('0x13')](function(_0x4a3f3e){if(_0x4a3f3e){return _0x4a3f3e[_0xfdb3('0x76')](_0x20719b[_0xfdb3('0x4e')][_0xfdb3('0x72')]);}})['then'](respondWithStatusCode(_0x368ef9,null))[_0xfdb3('0x1b')](handleError(_0x368ef9,null));};exports[_0xfdb3('0x6a')]=function(_0x152bb9,_0x163ea8){var _0x602709={'name':_0x152bb9[_0xfdb3('0x63')][_0xfdb3('0x2b')],'key':_0x152bb9[_0xfdb3('0x63')][_0xfdb3('0x77')],'provider':_0x152bb9['body'][_0xfdb3('0x64')]===_0xfdb3('0x65')?null:_0x152bb9['body'][_0xfdb3('0x64')],'email':_0x152bb9[_0xfdb3('0x63')][_0xfdb3('0x78')],'ListId':_0x152bb9[_0xfdb3('0x63')]['ListId'],'active':!_[_0xfdb3('0x79')](_0x152bb9[_0xfdb3('0x63')][_0xfdb3('0x7a')])?_0x152bb9[_0xfdb3('0x63')][_0xfdb3('0x7a')]:!![],'description':_0x152bb9['body'][_0xfdb3('0x7b')]||null};var _0xb71d03=getAuthenticationOptions(_0x602709['provider'],_0x152bb9[_0xfdb3('0x63')]);_0x602709[_0xfdb3('0x43')]=_0xb71d03[_0xfdb3('0x43')];_0x602709[_0xfdb3('0x44')]=_0xb71d03[_0xfdb3('0x44')];return db[_0xfdb3('0x4a')][_0xfdb3('0x6a')](_0x602709,{'include':[{'model':db[_0xfdb3('0x46')],'as':_0xfdb3('0x44')},{'model':db['MailServerIn'],'as':_0xfdb3('0x43')}]})[_0xfdb3('0x13')](function(_0x4e5e82){var _0x2b99ed=_0x152bb9[_0xfdb3('0x42')][_0xfdb3('0x27')]({'plain':!![]});if(!_0x2b99ed)throw new Error(_0xfdb3('0x7c'));if(_0x2b99ed[_0xfdb3('0x7d')]==='user'){var _0x50b55b=_0x4e5e82[_0xfdb3('0x27')]({'plain':!![]});return db[_0xfdb3('0x7e')][_0xfdb3('0x71')]({'where':{'name':_0xfdb3('0x28'),'userProfileId':_0x2b99ed[_0xfdb3('0x7f')]},'raw':!![]})[_0xfdb3('0x13')](function(_0x1d6b91){if(_0x1d6b91&&_0x1d6b91[_0xfdb3('0x80')]===0x0){return db[_0xfdb3('0x29')][_0xfdb3('0x6a')]({'name':_0x50b55b[_0xfdb3('0x2b')],'resourceId':_0x50b55b['id'],'type':_0x1d6b91['name'],'sectionId':_0x1d6b91['id']},{})['then'](function(){return _0x4e5e82;});}else{return _0x4e5e82;}})[_0xfdb3('0x1b')](function(_0x3fe8c8){logger[_0xfdb3('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fe8c8);throw _0x3fe8c8;});}return _0x4e5e82;})[_0xfdb3('0x13')](respondWithResult(_0x163ea8,0xc9))[_0xfdb3('0x1b')](handleError(_0x163ea8,null));};exports[_0xfdb3('0x81')]=function(_0x3deab3,_0x56c324){return db['MailAccount'][_0xfdb3('0x6c')]({'where':{'id':_0x3deab3[_0xfdb3('0x61')]['id']}})[_0xfdb3('0x13')](handleEntityNotFound(_0x56c324,null))[_0xfdb3('0x13')](function(_0x1da094){if(_0x1da094){return _0x1da094[_0xfdb3('0x81')]();}return null;})['then'](respondWithResult(_0x56c324,null))[_0xfdb3('0x1b')](handleError(_0x56c324,null));};exports['addImap']=function(_0x4a5691,_0x23e639){if(_0x4a5691[_0xfdb3('0x63')]['id']){delete _0x4a5691[_0xfdb3('0x63')]['id'];}return db[_0xfdb3('0x4a')][_0xfdb3('0x71')]({'where':{'id':_0x4a5691[_0xfdb3('0x61')]['id']}})[_0xfdb3('0x13')](handleEntityNotFound(_0x23e639,null))[_0xfdb3('0x13')](function(_0x3f1a30){if(_0x3f1a30){_0x4a5691[_0xfdb3('0x63')][_0xfdb3('0x75')]=_0x3f1a30['id'];return db[_0xfdb3('0x45')]['create'](_0x4a5691[_0xfdb3('0x63')]);}})[_0xfdb3('0x13')](respondWithResult(_0x23e639,null))[_0xfdb3('0x1b')](handleError(_0x23e639,null));};exports[_0xfdb3('0x82')]=function(_0x116005,_0x32eecf){return db['MailAccount'][_0xfdb3('0x6c')]({'where':{'id':_0x116005[_0xfdb3('0x61')]['id']}})['then'](handleEntityNotFound(_0x32eecf,null))[_0xfdb3('0x13')](function(_0x18b3f2){if(_0x18b3f2){return _0x18b3f2[_0xfdb3('0x83')](null);}return null;})[_0xfdb3('0x13')](respondWithStatusCode(_0x32eecf,null))[_0xfdb3('0x1b')](handleError(_0x32eecf,null));};exports[_0xfdb3('0x84')]=function(_0x317b67,_0x48e90c){return db[_0xfdb3('0x4a')][_0xfdb3('0x6c')]({'where':{'id':_0x317b67[_0xfdb3('0x61')]['id']}})['then'](handleEntityNotFound(_0x48e90c,null))['then'](function(_0x11c6f8){if(_0x11c6f8){return _0x11c6f8[_0xfdb3('0x84')]();}return null;})['then'](respondWithResult(_0x48e90c,null))[_0xfdb3('0x1b')](handleError(_0x48e90c,null));};exports['addSmtp']=function(_0x541536,_0x7c3a91){if(_0x541536[_0xfdb3('0x63')]['id']){delete _0x541536[_0xfdb3('0x63')]['id'];}return db[_0xfdb3('0x4a')][_0xfdb3('0x71')]({'where':{'id':_0x541536[_0xfdb3('0x61')]['id']}})[_0xfdb3('0x13')](handleEntityNotFound(_0x7c3a91,null))[_0xfdb3('0x13')](function(_0x28a750){if(_0x28a750){_0x541536[_0xfdb3('0x63')][_0xfdb3('0x75')]=_0x28a750['id'];return db[_0xfdb3('0x46')]['create'](_0x541536[_0xfdb3('0x63')]);}})[_0xfdb3('0x13')](respondWithResult(_0x7c3a91,null))[_0xfdb3('0x1b')](handleError(_0x7c3a91,null));};exports[_0xfdb3('0x85')]=function(_0x18f36a,_0x482ad6){return db[_0xfdb3('0x4a')][_0xfdb3('0x6c')]({'where':{'id':_0x18f36a[_0xfdb3('0x61')]['id']}})[_0xfdb3('0x13')](handleEntityNotFound(_0x482ad6,null))[_0xfdb3('0x13')](function(_0x1c2135){if(_0x1c2135){return _0x1c2135['setSmtp'](null);}return null;})[_0xfdb3('0x13')](respondWithStatusCode(_0x482ad6,null))[_0xfdb3('0x1b')](handleError(_0x482ad6,null));};exports[_0xfdb3('0x86')]=function(_0x4e61df,_0x1eccca){return db['MailInteraction'][_0xfdb3('0x71')]({'where':{'id':_0x4e61df['params']['id']}})[_0xfdb3('0x13')](handleEntityNotFound(_0x1eccca,null))['then'](function(_0x20a160){if(_0x20a160){return _0x20a160[_0xfdb3('0x86')](_0x4e61df[_0xfdb3('0x63')][_0xfdb3('0x72')],_[_0xfdb3('0x87')](_0x4e61df[_0xfdb3('0x63')],[_0xfdb3('0x72'),'id'])||{});}})['then'](respondWithResult(_0x1eccca,null))['catch'](handleError(_0x1eccca,null));};exports['getInteractions']=function(_0x1aac5d,_0x461f21){var _0x5362f3={'raw':![],'where':{}};var _0x147b3d={};var _0x461408={'count':0x0,'rows':[]};return db['MailAccount'][_0xfdb3('0x6c')]({'where':{'id':_0x1aac5d[_0xfdb3('0x61')]['id']}})['then'](handleEntityNotFound(_0x461f21,null))['then'](function(_0x3af9cb){if(_0x3af9cb){_0x147b3d['model']=_[_0xfdb3('0x62')](db[_0xfdb3('0x88')][_0xfdb3('0x4b')]);_0x147b3d[_0xfdb3('0x4e')]=_[_0xfdb3('0x62')](_0x1aac5d[_0xfdb3('0x4e')]);_0x147b3d['filters']=_[_0xfdb3('0x50')](_0x147b3d[_0xfdb3('0x4d')],_0x147b3d[_0xfdb3('0x4e')]);_0x5362f3[_0xfdb3('0x51')]=_[_0xfdb3('0x50')](_0x147b3d[_0xfdb3('0x4d')],qs['fields'](_0x1aac5d['query'][_0xfdb3('0x52')]));_0x5362f3[_0xfdb3('0x51')]=_0x5362f3['attributes'][_0xfdb3('0x6d')]?_0x5362f3['attributes']:_0x147b3d[_0xfdb3('0x4d')];if(!_0x1aac5d[_0xfdb3('0x4e')][_0xfdb3('0x6e')]('nolimit')){_0x5362f3['limit']=qs[_0xfdb3('0x23')](_0x1aac5d['query'][_0xfdb3('0x23')]);_0x5362f3[_0xfdb3('0x20')]=qs['offset'](_0x1aac5d[_0xfdb3('0x4e')]['offset']);}_0x5362f3['order']=qs[_0xfdb3('0x55')](_0x1aac5d['query']['sort']);_0x5362f3['where']=qs[_0xfdb3('0x4f')](_[_0xfdb3('0x57')](_0x1aac5d[_0xfdb3('0x4e')],_0x147b3d[_0xfdb3('0x4f')]));_0x5362f3[_0xfdb3('0x56')][_0xfdb3('0x75')]=_0x3af9cb['id'];if(_0x1aac5d[_0xfdb3('0x4e')][_0xfdb3('0x58')]){_0x5362f3[_0xfdb3('0x56')]=_[_0xfdb3('0x59')](_0x5362f3[_0xfdb3('0x56')],{'$or':_[_0xfdb3('0x49')](_0x5362f3['attributes'],function(_0x31f7bd){var _0x298985={};_0x298985[_0x31f7bd]={'$like':'%'+_0x1aac5d['query'][_0xfdb3('0x58')]+'%'};return _0x298985;})});}_0x5362f3=_[_0xfdb3('0x59')]({},_0x5362f3,_0x1aac5d[_0xfdb3('0x5c')]);return db['MailInteraction'][_0xfdb3('0x22')]({'where':_0x5362f3[_0xfdb3('0x56')]})[_0xfdb3('0x13')](function(_0x52d8e){_0x461408[_0xfdb3('0x22')]=_0x52d8e;if(_0x1aac5d[_0xfdb3('0x4e')][_0xfdb3('0x5d')]){_0x5362f3[_0xfdb3('0x5e')]=[{'model':db['CmContact'],'as':_0xfdb3('0x89'),'required':![]},{'model':db['User'],'as':_0xfdb3('0x8a'),'attributes':[_0xfdb3('0x2b'),'fullname',_0xfdb3('0x8b')],'required':![]},{'model':db['Tag'],'as':_0xfdb3('0x8c'),'attributes':['id','name',_0xfdb3('0x8d')],'where':_0x1aac5d[_0xfdb3('0x4e')]['tag']?{'id':_0x1aac5d[_0xfdb3('0x4e')][_0xfdb3('0x8e')]}:undefined,'required':_0x1aac5d[_0xfdb3('0x4e')]['tag']?!![]:![]}];}return db[_0xfdb3('0x88')][_0xfdb3('0x6f')](_0x5362f3);})[_0xfdb3('0x13')](function(_0x2a07d3){_0x461408[_0xfdb3('0x5f')]=_0x2a07d3;return _0x461408;});}})['then'](respondWithFilteredResult(_0x461f21,_0x5362f3))[_0xfdb3('0x1b')](handleError(_0x461f21,null));};exports[_0xfdb3('0x8f')]=function addApplications(_0x127f25,_0x74ee5e){var _0x59d213=_0x127f25['params']['id'];var _0x18e2df=_0x127f25['body'];var _0x2d9f95=0xc8;var _0x10c756=null;return db[_0xfdb3('0x90')][_0xfdb3('0x91')]({'isolationLevel':db['sequelize'][_0xfdb3('0x92')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x16d216){return db[_0xfdb3('0x4a')][_0xfdb3('0x6c')]({'where':{'id':_0x59d213},'transaction':_0x16d216})[_0xfdb3('0x13')](function(_0x169e9c){if(_0x169e9c){return db[_0xfdb3('0x93')][_0xfdb3('0x26')]({'where':{'MailAccountId':_0x59d213},'transaction':_0x16d216})[_0xfdb3('0x13')](function(){var _0x13c9f5=_[_0xfdb3('0x49')](_0x18e2df,function(_0x165c79){_0x165c79[_0xfdb3('0x75')]=_0x59d213;return _0x165c79;});return db[_0xfdb3('0x93')][_0xfdb3('0x94')](_0x13c9f5,{'transaction':_0x16d216});});}else{_0x2d9f95=0x194;_0x10c756=[];}});})[_0xfdb3('0x13')](function(){if(_0x2d9f95!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x59d213},'order':_0xfdb3('0x95')})['then'](function(_0x5e3afc){_0x10c756=_0x5e3afc;});}})[_0xfdb3('0x1b')](function(_0x14437b){_0x2d9f95=0x1f4;logger[_0xfdb3('0x17')](_0x14437b[_0xfdb3('0x2a')]);if(_0x14437b[_0xfdb3('0x2b')]){delete _0x14437b[_0xfdb3('0x2b')];}_0x10c756=_0x14437b;})[_0xfdb3('0x96')](function(){if(_0x10c756===null){_0x74ee5e['sendStatus'](_0x2d9f95);}else{if(_0x2d9f95===0x1f4){_0x74ee5e[_0xfdb3('0x1d')](_0x2d9f95)[_0xfdb3('0x2c')](_0x10c756);}else{_0x74ee5e[_0xfdb3('0x1d')](_0x2d9f95)[_0xfdb3('0x1f')](_0x10c756);}}});};exports['getApplications']=function(_0x356cfc,_0x2099a9){var _0x1b7af8={};var _0x519e83={};var _0x30cb8e;var _0x54b2a2;return db['MailAccount'][_0xfdb3('0x6c')]({'where':{'id':_0x356cfc[_0xfdb3('0x61')]['id']}})[_0xfdb3('0x13')](handleEntityNotFound(_0x2099a9,null))[_0xfdb3('0x13')](function(_0x293ab3){if(_0x293ab3){_0x30cb8e=_0x293ab3;_0x519e83['model']=_[_0xfdb3('0x62')](db[_0xfdb3('0x93')][_0xfdb3('0x4b')]);_0x519e83[_0xfdb3('0x4e')]=_[_0xfdb3('0x62')](_0x356cfc[_0xfdb3('0x4e')]);_0x519e83[_0xfdb3('0x4f')]=_[_0xfdb3('0x50')](_0x519e83[_0xfdb3('0x4d')],_0x519e83['query']);_0x1b7af8[_0xfdb3('0x51')]=_[_0xfdb3('0x50')](_0x519e83[_0xfdb3('0x4d')],qs[_0xfdb3('0x52')](_0x356cfc[_0xfdb3('0x4e')][_0xfdb3('0x52')]));_0x1b7af8[_0xfdb3('0x51')]=_0x1b7af8[_0xfdb3('0x51')]['length']?_0x1b7af8[_0xfdb3('0x51')]:_0x519e83[_0xfdb3('0x4d')];_0x1b7af8['order']=qs[_0xfdb3('0x55')](_0x356cfc[_0xfdb3('0x4e')][_0xfdb3('0x55')]);_0x1b7af8[_0xfdb3('0x56')]=qs[_0xfdb3('0x4f')](_[_0xfdb3('0x57')](_0x356cfc['query'],_0x519e83['filters']));if(_0x356cfc[_0xfdb3('0x4e')]['filter']){_0x1b7af8[_0xfdb3('0x56')]=_['merge'](_0x1b7af8[_0xfdb3('0x56')],{'$or':_[_0xfdb3('0x49')](_0x1b7af8[_0xfdb3('0x51')],function(_0x417466){var _0x9f4655={};_0x9f4655[_0x417466]={'$like':'%'+_0x356cfc['query'][_0xfdb3('0x58')]+'%'};return _0x9f4655;})});}_0x1b7af8=_[_0xfdb3('0x59')]({},_0x1b7af8,_0x356cfc[_0xfdb3('0x5c')]);return _0x30cb8e['getApplications'](_0x1b7af8);}})[_0xfdb3('0x13')](function(_0x27b4e3){if(_0x27b4e3){_0x54b2a2=_0x27b4e3['length'];if(!_0x356cfc[_0xfdb3('0x4e')][_0xfdb3('0x6e')](_0xfdb3('0x53'))){_0x1b7af8['limit']=qs[_0xfdb3('0x23')](_0x356cfc[_0xfdb3('0x4e')][_0xfdb3('0x23')]);_0x1b7af8[_0xfdb3('0x20')]=qs['offset'](_0x356cfc[_0xfdb3('0x4e')]['offset']);}return _0x30cb8e[_0xfdb3('0x97')](_0x1b7af8);}})[_0xfdb3('0x13')](function(_0x236e11){if(_0x236e11){return _0x236e11?{'count':_0x54b2a2,'rows':_0x236e11}:null;}})['then'](respondWithResult(_0x2099a9,null))[_0xfdb3('0x1b')](handleError(_0x2099a9,null));};exports[_0xfdb3('0x98')]=function(_0x215cb2,_0x479d48){var _0x43548a={'raw':!![],'where':{}};var _0x158cbf={};var _0x8cb801={'count':0x0,'rows':[]};return db[_0xfdb3('0x4a')][_0xfdb3('0x6c')]({'where':{'id':_0x215cb2[_0xfdb3('0x61')]['id']}})[_0xfdb3('0x13')](handleEntityNotFound(_0x479d48,null))[_0xfdb3('0x13')](function(_0x1642df){if(_0x1642df){_0x158cbf[_0xfdb3('0x4d')]=_[_0xfdb3('0x62')](db[_0xfdb3('0x99')][_0xfdb3('0x4b')]);_0x158cbf[_0xfdb3('0x4e')]=_[_0xfdb3('0x62')](_0x215cb2['query']);_0x158cbf[_0xfdb3('0x4f')]=_[_0xfdb3('0x50')](_0x158cbf[_0xfdb3('0x4d')],_0x158cbf[_0xfdb3('0x4e')]);_0x43548a[_0xfdb3('0x51')]=_['intersection'](_0x158cbf['model'],qs[_0xfdb3('0x52')](_0x215cb2['query']['fields']));_0x43548a[_0xfdb3('0x51')]=_0x43548a[_0xfdb3('0x51')][_0xfdb3('0x6d')]?_0x43548a[_0xfdb3('0x51')]:_0x158cbf[_0xfdb3('0x4d')];if(!_0x215cb2[_0xfdb3('0x4e')][_0xfdb3('0x6e')](_0xfdb3('0x53'))){_0x43548a[_0xfdb3('0x23')]=qs[_0xfdb3('0x23')](_0x215cb2[_0xfdb3('0x4e')]['limit']);_0x43548a['offset']=qs[_0xfdb3('0x20')](_0x215cb2[_0xfdb3('0x4e')][_0xfdb3('0x20')]);}_0x43548a['order']=qs[_0xfdb3('0x55')](_0x215cb2[_0xfdb3('0x4e')]['sort']);_0x43548a['where']=qs[_0xfdb3('0x4f')](_[_0xfdb3('0x57')](_0x215cb2['query'],_0x158cbf[_0xfdb3('0x4f')]));_0x43548a['where'][_0xfdb3('0x75')]=_0x1642df['id'];if(_0x215cb2['query'][_0xfdb3('0x58')]){_0x43548a['where']=_['merge'](_0x43548a[_0xfdb3('0x56')],{'$or':_[_0xfdb3('0x49')](_0x43548a['attributes'],function(_0x2caf09){var _0x44993e={};_0x44993e[_0x2caf09]={'$like':'%'+_0x215cb2[_0xfdb3('0x4e')][_0xfdb3('0x58')]+'%'};return _0x44993e;})});}if(_0x215cb2[_0xfdb3('0x4e')][_0xfdb3('0x9a')]){var _0x2bb602=_0x215cb2['query']['$gte'][_0xfdb3('0x9b')](',');var _0x4597f3={};_0x4597f3[_0x2bb602[0x0]]={'$gte':moment(_0x2bb602[0x1])[_0xfdb3('0x9c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x43548a['where']=_['merge'](_0x43548a[_0xfdb3('0x56')],_0x4597f3);}_0x43548a=_[_0xfdb3('0x59')]({},_0x43548a,_0x215cb2['options']);return db[_0xfdb3('0x99')][_0xfdb3('0x22')]({'where':_0x43548a[_0xfdb3('0x56')]})[_0xfdb3('0x13')](function(_0x38d953){_0x8cb801['count']=_0x38d953;if(_0x215cb2['query'][_0xfdb3('0x5d')]){_0x43548a['include']=[{'all':!![]}];}return db[_0xfdb3('0x99')]['findAll'](_0x43548a);})[_0xfdb3('0x13')](function(_0x53373b){if(_0x215cb2[_0xfdb3('0x4e')][_0xfdb3('0x9d')]===_0xfdb3('0x9e')){for(var _0xb016b1=0x0;_0xb016b1<_0x53373b[_0xfdb3('0x6d')];_0xb016b1++){_0x53373b[_0xb016b1][_0xfdb3('0x63')]=juice(_0x53373b[_0xb016b1][_0xfdb3('0x63')]);}}_0x8cb801[_0xfdb3('0x5f')]=_0x53373b;return _0x8cb801;});}})[_0xfdb3('0x13')](respondWithFilteredResult(_0x479d48,_0x43548a))[_0xfdb3('0x1b')](handleError(_0x479d48,null));};exports[_0xfdb3('0x2c')]=function(_0x3d8e09,_0x287fec){var _0x710cd7,_0x579c1e={},_0x322cba;if(_0x3d8e09[_0xfdb3('0x63')]['to']){_0x322cba=_0x3d8e09[_0xfdb3('0x63')]['to'][_0xfdb3('0x9b')](',')[0x0];}return db[_0xfdb3('0x4a')][_0xfdb3('0x71')]({'where':{'id':_0x3d8e09[_0xfdb3('0x61')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xfdb3('0x9f')],'as':_0xfdb3('0xa0'),'where':{'email':_0x322cba},'limit':0x1,'order':[[_0xfdb3('0xa1'),'DESC']]}]},{'model':db[_0xfdb3('0x46')],'as':_0xfdb3('0x44'),'raw':!![],'include':[{'model':db[_0xfdb3('0xa2')],'as':'CloudProvider','raw':!![]}]}]})[_0xfdb3('0x13')](handleEntityNotFound(_0x287fec,null))[_0xfdb3('0x13')](function(_0x31eeb0){if(!_0x31eeb0)return;_0x710cd7=_0x31eeb0;if(!_0x31eeb0[_0xfdb3('0x44')])throw new Error(_0xfdb3('0xa3'));if(_[_0xfdb3('0x79')](_0x3d8e09['body'][_0xfdb3('0xa4')])){_0x3d8e09[_0xfdb3('0x63')][_0xfdb3('0xa4')]=util[_0xfdb3('0x9c')](_0xfdb3('0xa5'),_0x31eeb0['name'],_0x31eeb0[_0xfdb3('0x78')]||_0x31eeb0[_0xfdb3('0x44')][_0xfdb3('0x42')]);}if(_0x3d8e09['body'][_0xfdb3('0xa6')]&&_0x3d8e09['body'][_0xfdb3('0xa6')][_0xfdb3('0x6d')]){for(var _0xfe12f0=0x0;_0xfe12f0<_0x3d8e09[_0xfdb3('0x63')]['attachments']['length'];_0xfe12f0+=0x1){_0x3d8e09[_0xfdb3('0x63')][_0xfdb3('0xa6')][_0xfe12f0]={'filename':_0x3d8e09[_0xfdb3('0x63')][_0xfdb3('0xa6')][_0xfe12f0][_0xfdb3('0x2b')],'path':path[_0xfdb3('0xa7')](config[_0xfdb3('0xa8')],'server/files/attachments',_0x3d8e09[_0xfdb3('0x63')][_0xfdb3('0xa6')][_0xfe12f0][_0xfdb3('0xa9')])};}}var _0x20806b=_0x31eeb0[_0xfdb3('0xaa')]();return respondWithRpcPromise(_0xfdb3('0xab'),_0xfdb3('0xac'),{'account':_0x20806b,'message':_0x3d8e09[_0xfdb3('0x63')]});})[_0xfdb3('0x13')](function(_0x18c85e){if(!_0x18c85e)return;_0x579c1e=_0x18c85e;if(!_0x710cd7['List'])throw new Error(_0xfdb3('0xad'));if(_0x710cd7[_0xfdb3('0xae')][_0xfdb3('0xa0')][_0xfdb3('0x6d')])return _0x710cd7['List'][_0xfdb3('0xa0')][0x0];return db[_0xfdb3('0x9f')]['create'](_['defaults'](_0x3d8e09[_0xfdb3('0x63')],{'firstName':_0x3d8e09[_0xfdb3('0x63')]['to'],'email':_0x3d8e09[_0xfdb3('0x63')]['to'],'phone':_0x3d8e09[_0xfdb3('0x63')]['to'],'ListId':_0x710cd7[_0xfdb3('0xaf')]}));})[_0xfdb3('0x13')](function(_0x5edaf4){if(!_0x5edaf4)return;var _0x15434b={'UserId':_0x3d8e09[_0xfdb3('0x42')]['id'],'ContactId':_0x5edaf4['id'],'MailAccountId':_0x710cd7['id'],'inReplyTo':_0x579c1e[_0xfdb3('0xb0')],'to':_0x3d8e09[_0xfdb3('0x63')][_0xfdb3('0xa4')],'cc':_0x3d8e09[_0xfdb3('0x63')]['cc'],'subject':_0x3d8e09[_0xfdb3('0x63')][_0xfdb3('0xb1')],'attach':_0x3d8e09[_0xfdb3('0x63')][_0xfdb3('0xb2')],'firstMsgDirection':_0xfdb3('0xb3'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_['merge'](_0x3d8e09[_0xfdb3('0x63')],{'messageId':_0x579c1e['messageId'],'sentAt':moment()[_0xfdb3('0x9c')](_0xfdb3('0xb4')),'read':!![],'MailAccountId':_0x710cd7['id'],'UserId':_0x3d8e09[_0xfdb3('0x42')]['id'],'ContactId':_0x5edaf4['id']})]};if(_0x3d8e09['body']['Interaction']){_0x15434b=_[_0xfdb3('0x59')](_0x15434b,_0x3d8e09[_0xfdb3('0x63')]['Interaction']);}return db[_0xfdb3('0x88')][_0xfdb3('0x6a')](_0x15434b,{'include':[{'model':db[_0xfdb3('0x99')],'as':_0xfdb3('0xb5')}]});})['then'](respondWithResult(_0x287fec,null))[_0xfdb3('0x1b')](handleError(_0x287fec,null));};exports[_0xfdb3('0xb6')]=function(_0x31ded1,_0x238e9e){return db[_0xfdb3('0x4a')][_0xfdb3('0x71')]({'where':{'id':_0x31ded1[_0xfdb3('0x61')]['id']},'include':[{'model':db[_0xfdb3('0x46')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0xfdb3('0x13')](handleEntityNotFound(_0x238e9e,null))[_0xfdb3('0x13')](function(_0x39e82b){if(!_0x39e82b[_0xfdb3('0x44')])return;var _0x2f0635=_0x39e82b['getSmtpOptions']();return respondWithRpcPromise(_0xfdb3('0xb7'),_0xfdb3('0xb6'),{'account':_0x2f0635});})['then'](respondWithResult(_0x238e9e,null))['catch'](handleError(_0x238e9e,null));};exports[_0xfdb3('0x26')]=function(_0x3ecd4f,_0x53b0f1){return db['MailAccount']['find']({'where':{'id':_0x3ecd4f[_0xfdb3('0x61')]['id']}})[_0xfdb3('0x13')](handleEntityNotFound(_0x53b0f1,null))[_0xfdb3('0x13')](function(_0x43f4ca){if(_0x43f4ca&&_0x43f4ca['service']){throw new db[(_0xfdb3('0xb8'))]['ValidationError'](_0xfdb3('0xb9'));}return _0x43f4ca;})['then'](removeEntity(_0x53b0f1,null))[_0xfdb3('0x1b')](handleError(_0x53b0f1,null));};exports[_0xfdb3('0xba')]=function(_0x3b4a5e,_0x29af31){return db['MailAccount'][_0xfdb3('0x71')]({'where':{'id':_0x3b4a5e[_0xfdb3('0x61')]['id']}})['then'](handleEntityNotFound(_0x29af31,null))['then'](function(_0x2894ea){if(_0x2894ea){return _0x2894ea[_0xfdb3('0xba')](_0x3b4a5e[_0xfdb3('0x63')][_0xfdb3('0x72')],_[_0xfdb3('0x87')](_0x3b4a5e['body'],['ids','id'])||{})[_0xfdb3('0xbb')](function(_0x20ce89){for(var _0x41f4c1=0x0;_0x41f4c1<_0x3b4a5e[_0xfdb3('0x63')]['ids']['length'];_0x41f4c1+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x3b4a5e[_0xfdb3('0x63')][_0xfdb3('0x72')][_0x41f4c1]),'MailAccountId':Number(_0x3b4a5e['params']['id'])});}return _0x20ce89;});}})['then'](respondWithResult(_0x29af31,null))[_0xfdb3('0x1b')](handleError(_0x29af31,null));};exports['removeAgents']=function(_0x54cb31,_0x44d0a3){return db['MailAccount'][_0xfdb3('0x71')]({'where':{'id':_0x54cb31[_0xfdb3('0x61')]['id']}})[_0xfdb3('0x13')](handleEntityNotFound(_0x44d0a3,null))[_0xfdb3('0x13')](function(_0x93a986){if(_0x93a986){return _0x93a986['removeAgents'](_0x54cb31[_0xfdb3('0x4e')][_0xfdb3('0x72')])[_0xfdb3('0x13')](function(){if(_[_0xfdb3('0xbc')](_0x54cb31['query']['ids'])){for(var _0x2918f1=0x0;_0x2918f1<_0x54cb31[_0xfdb3('0x4e')][_0xfdb3('0x72')][_0xfdb3('0x6d')];_0x2918f1+=0x1){socket['emit'](_0xfdb3('0xbd'),{'UserId':Number(_0x54cb31[_0xfdb3('0x4e')][_0xfdb3('0x72')][_0x2918f1]),'MailAccountId':Number(_0x54cb31[_0xfdb3('0x61')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x54cb31['query'][_0xfdb3('0x72')]),'MailAccountId':Number(_0x54cb31[_0xfdb3('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x44d0a3,null))[_0xfdb3('0x1b')](handleError(_0x44d0a3,null));};exports[_0xfdb3('0xbe')]=function(_0x8b85c1,_0x3292fe){var _0xc4fd27={};var _0x1d6b28={};var _0x522b1b;var _0x27e5ce;return db[_0xfdb3('0x4a')]['findOne']({'where':{'id':_0x8b85c1['params']['id']}})[_0xfdb3('0x13')](handleEntityNotFound(_0x3292fe,null))[_0xfdb3('0x13')](function(_0x1efe48){if(_0x1efe48){_0x522b1b=_0x1efe48;_0x1d6b28['model']=_[_0xfdb3('0x62')](db['User'][_0xfdb3('0x4b')]);_0x1d6b28[_0xfdb3('0x4e')]=_[_0xfdb3('0x62')](_0x8b85c1[_0xfdb3('0x4e')]);_0x1d6b28[_0xfdb3('0x4f')]=_[_0xfdb3('0x50')](_0x1d6b28[_0xfdb3('0x4d')],_0x1d6b28[_0xfdb3('0x4e')]);_0xc4fd27['attributes']=_[_0xfdb3('0x50')](_0x1d6b28[_0xfdb3('0x4d')],qs[_0xfdb3('0x52')](_0x8b85c1[_0xfdb3('0x4e')][_0xfdb3('0x52')]));_0xc4fd27[_0xfdb3('0x51')]=_0xc4fd27[_0xfdb3('0x51')][_0xfdb3('0x6d')]?_0xc4fd27[_0xfdb3('0x51')]:_0x1d6b28[_0xfdb3('0x4d')];_0xc4fd27['order']=qs['sort'](_0x8b85c1[_0xfdb3('0x4e')]['sort']);_0xc4fd27[_0xfdb3('0x56')]=qs['filters'](_[_0xfdb3('0x57')](_0x8b85c1[_0xfdb3('0x4e')],_0x1d6b28[_0xfdb3('0x4f')]));if(_0x8b85c1[_0xfdb3('0x4e')][_0xfdb3('0x58')]){_0xc4fd27[_0xfdb3('0x56')]=_[_0xfdb3('0x59')](_0xc4fd27[_0xfdb3('0x56')],{'$or':_[_0xfdb3('0x49')](_0xc4fd27['attributes'],function(_0x1c4277){var _0x1181f5={};_0x1181f5[_0x1c4277]={'$like':'%'+_0x8b85c1[_0xfdb3('0x4e')][_0xfdb3('0x58')]+'%'};return _0x1181f5;})});}_0xc4fd27=_[_0xfdb3('0x59')]({},_0xc4fd27,_0x8b85c1[_0xfdb3('0x5c')]);return _0x522b1b['getAgents'](_0xc4fd27);}})['then'](function(_0xa7c3c){if(_0xa7c3c){_0x27e5ce=_0xa7c3c['length'];if(!_0x8b85c1[_0xfdb3('0x4e')]['hasOwnProperty'](_0xfdb3('0x53'))){_0xc4fd27[_0xfdb3('0x23')]=qs[_0xfdb3('0x23')](_0x8b85c1[_0xfdb3('0x4e')][_0xfdb3('0x23')]);_0xc4fd27['offset']=qs['offset'](_0x8b85c1['query'][_0xfdb3('0x20')]);}return _0x522b1b['getAgents'](_0xc4fd27);}})[_0xfdb3('0x13')](function(_0x5bf77c){if(_0x5bf77c){return _0x5bf77c?{'count':_0x27e5ce,'rows':_0x5bf77c}:null;}})[_0xfdb3('0x13')](respondWithResult(_0x3292fe,null))[_0xfdb3('0x1b')](handleError(_0x3292fe,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 924fb7e..2c400a3 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 _0xc15b=['remove','emit','hook','events','save','update'];(function(_0x29ebe1,_0x1d717f){var _0x57ebce=function(_0x3acea4){while(--_0x3acea4){_0x29ebe1['push'](_0x29ebe1['shift']());}};_0x57ebce(++_0x1d717f);}(_0xc15b,0x159));var _0xbc15=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xc15b[_0x4b055c];return _0x4b62bb;};'use strict';var EventEmitter=require(_0xbc15('0x0'));var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbc15('0x1'),'afterUpdate':_0xbc15('0x2'),'afterDestroy':_0xbc15('0x3')};function emitEvent(_0x2819fd){return function(_0x2c3f99,_0x7d9dc7,_0x3c1cf4){MailAccountEvents[_0xbc15('0x4')](_0x2819fd+':'+_0x2c3f99['id'],_0x2c3f99);MailAccountEvents[_0xbc15('0x4')](_0x2819fd,_0x2c3f99);_0x3c1cf4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xbc15('0x5')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0xca84=['hook','exports','events','../../mysqldb','MailAccount','save','update','emit','hasOwnProperty'];(function(_0x8a41e7,_0x1227c1){var _0x2ba973=function(_0x5a9b4b){while(--_0x5a9b4b){_0x8a41e7['push'](_0x8a41e7['shift']());}};_0x2ba973(++_0x1227c1);}(_0xca84,0xf5));var _0x4ca8=function(_0x108b03,_0x2a183a){_0x108b03=_0x108b03-0x0;var _0x5a3f97=_0xca84[_0x108b03];return _0x5a3f97;};'use strict';var EventEmitter=require(_0x4ca8('0x0'));var MailAccount=require(_0x4ca8('0x1'))['db'][_0x4ca8('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4ca8('0x3'),'afterUpdate':_0x4ca8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x356f27){return function(_0x45236d,_0x2bc818,_0x6f7a23){MailAccountEvents[_0x4ca8('0x5')](_0x356f27+':'+_0x45236d['id'],_0x45236d);MailAccountEvents[_0x4ca8('0x5')](_0x356f27,_0x45236d);_0x6f7a23(null);};}for(var e in events){if(events[_0x4ca8('0x6')](e)){var event=events[e];MailAccount[_0x4ca8('0x7')](e,emitEvent(event));}}module[_0x4ca8('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 80ae2d2..d1e4c6d 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 _0x6875=['port','secure','Smtp','authentication','modernAuthentication','auth','OAuth2','user','CloudProvider','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','custom','service','provider','host'];(function(_0x17f716,_0x4a06c7){var _0x31f0de=function(_0x5476e4){while(--_0x5476e4){_0x17f716['push'](_0x17f716['shift']());}};_0x31f0de(++_0x4a06c7);}(_0x6875,0x75));var _0x5687=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6875[_0x3947c9];return _0x2e7871;};'use strict';var attributes=require(_0x5687('0x0'));module[_0x5687('0x1')]=function(_0x2efb94){return _0x2efb94[_0x5687('0x2')](_0x5687('0x3'),attributes,{'tableName':_0x5687('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x33781c=this;var _0x5bf165={'id':_0x33781c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x33781c['provider']!==_0x5687('0x5')){_0x5bf165[_0x5687('0x6')]=_0x33781c[_0x5687('0x7')];}else{_0x5bf165[_0x5687('0x8')]=_0x33781c['Smtp'][_0x5687('0x8')];_0x5bf165['port']=_0x33781c['Smtp'][_0x5687('0x9')];_0x5bf165[_0x5687('0xa')]=_0x33781c[_0x5687('0xb')][_0x5687('0xa')];}if(_0x33781c[_0x5687('0xb')][_0x5687('0xc')]){if(_0x33781c[_0x5687('0xb')][_0x5687('0xd')]){if(!_0x33781c[_0x5687('0xb')]['CloudProvider'])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x5bf165[_0x5687('0xe')]={'type':_0x5687('0xf'),'user':_0x33781c[_0x5687('0xb')][_0x5687('0x10')],'accessToken':_0x33781c['Smtp'][_0x5687('0x11')]['data5']};}else{_0x5bf165[_0x5687('0xe')]={'user':_0x33781c[_0x5687('0xb')][_0x5687('0x10')],'pass':_0x33781c[_0x5687('0xb')]['pass']};}}return _0x5bf165;}}});}; \ No newline at end of file +var _0x6f4f=['OAuth2','user','pass','./mailAccount.attributes','exports','define','provider','custom','service','host','port','Smtp','secure','authentication','modernAuthentication','CloudProvider','auth'];(function(_0x407c37,_0x19e6a0){var _0x46d2fc=function(_0x22442c){while(--_0x22442c){_0x407c37['push'](_0x407c37['shift']());}};_0x46d2fc(++_0x19e6a0);}(_0x6f4f,0x102));var _0xf6f4=function(_0xa43d0a,_0x591caf){_0xa43d0a=_0xa43d0a-0x0;var _0x49c1cd=_0x6f4f[_0xa43d0a];return _0x49c1cd;};'use strict';var attributes=require(_0xf6f4('0x0'));module[_0xf6f4('0x1')]=function(_0x445d7f){return _0x445d7f[_0xf6f4('0x2')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2ca58b=this;var _0x43e5c6={'id':_0x2ca58b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2ca58b[_0xf6f4('0x3')]!==_0xf6f4('0x4')){_0x43e5c6[_0xf6f4('0x5')]=_0x2ca58b['provider'];}else{_0x43e5c6['host']=_0x2ca58b['Smtp'][_0xf6f4('0x6')];_0x43e5c6[_0xf6f4('0x7')]=_0x2ca58b[_0xf6f4('0x8')]['port'];_0x43e5c6[_0xf6f4('0x9')]=_0x2ca58b[_0xf6f4('0x8')]['secure'];}if(_0x2ca58b['Smtp'][_0xf6f4('0xa')]){if(_0x2ca58b['Smtp'][_0xf6f4('0xb')]){if(!_0x2ca58b['Smtp'][_0xf6f4('0xc')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x43e5c6[_0xf6f4('0xd')]={'type':_0xf6f4('0xe'),'user':_0x2ca58b[_0xf6f4('0x8')][_0xf6f4('0xf')],'accessToken':_0x2ca58b[_0xf6f4('0x8')][_0xf6f4('0xc')]['data5']};}else{_0x43e5c6['auth']={'user':_0x2ca58b[_0xf6f4('0x8')][_0xf6f4('0xf')],'pass':_0x2ca58b[_0xf6f4('0x8')][_0xf6f4('0x10')]};}}return _0x43e5c6;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 4dad2ed..66348ee 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 _0x4873=['format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','interaction','created','contact','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','waitForTheAssignedAgent','queueId','MailQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','lodash','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailAccount','findAll','options','where','attributes','limit','map','include','model','then','GetMailAccount','ShowMailAccount','raw','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','CmContact','updatedAt','CompanyId','body','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','List','get','applications','list','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','ListId','create','List\x20not\x20found','messageId','subject','attach'];(function(_0xefcea5,_0xfa12b5){var _0x36764c=function(_0x5c93bc){while(--_0x5c93bc){_0xefcea5['push'](_0xefcea5['shift']());}};_0x36764c(++_0xfa12b5);}(_0x4873,0x1df));var _0x3487=function(_0x526713,_0x16b178){_0x526713=_0x526713-0x0;var _0x47a20f=_0x4873[_0x526713];return _0x47a20f;};'use strict';var _=require(_0x3487('0x0'));var moment=require(_0x3487('0x1'));var BPromise=require(_0x3487('0x2'));var rs=require('randomstring');var Redis=require(_0x3487('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x3487('0x4'));var config=require(_0x3487('0x5'));var jayson=require(_0x3487('0x6'));var client=jayson[_0x3487('0x7')][_0x3487('0x8')]({'port':0x232c});config[_0x3487('0x9')]=_[_0x3487('0xa')](config[_0x3487('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x3487('0xb'))(new Redis(config[_0x3487('0x9')]));require(_0x3487('0xc'))[_0x3487('0xd')](socket);function respondWithRpcPromise(_0x17b90c,_0x5a50e8,_0x365727){return new BPromise(function(_0x5e2cca,_0x1a5a7a){return client[_0x3487('0xe')](_0x17b90c,_0x365727)['then'](function(_0x56b795){logger[_0x3487('0xf')](_0x3487('0x10'),_0x5a50e8,'request\x20sent');logger[_0x3487('0x11')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x5a50e8,'request\x20sent',JSON[_0x3487('0x12')](_0x56b795));if(_0x56b795[_0x3487('0x13')]){if(_0x56b795[_0x3487('0x13')][_0x3487('0x14')]===0x1f4){logger[_0x3487('0x13')](_0x3487('0x10'),_0x5a50e8,_0x56b795['error'][_0x3487('0x15')]);return _0x1a5a7a(_0x56b795[_0x3487('0x13')][_0x3487('0x15')]);}logger['error'](_0x3487('0x10'),_0x5a50e8,_0x56b795[_0x3487('0x13')][_0x3487('0x15')]);return _0x5e2cca(_0x56b795[_0x3487('0x13')][_0x3487('0x15')]);}else{logger[_0x3487('0xf')](_0x3487('0x10'),_0x5a50e8,_0x3487('0x16'));_0x5e2cca(_0x56b795[_0x3487('0x17')][_0x3487('0x15')]);}})[_0x3487('0x18')](function(_0x41795b){logger[_0x3487('0x13')](_0x3487('0x10'),_0x5a50e8,_0x41795b);_0x1a5a7a(_0x41795b);});});}exports['GetMailAccount']=function(_0x320349){var _0x594ff6=this;return new Promise(function(_0x2fd2e8,_0x20eae9){return db[_0x3487('0x19')][_0x3487('0x1a')]({'raw':_0x320349[_0x3487('0x1b')]?_0x320349[_0x3487('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x320349[_0x3487('0x1b')]?_0x320349[_0x3487('0x1b')][_0x3487('0x1c')]||null:null,'attributes':_0x320349[_0x3487('0x1b')]?_0x320349[_0x3487('0x1b')][_0x3487('0x1d')]||null:null,'limit':_0x320349['options']?_0x320349[_0x3487('0x1b')][_0x3487('0x1e')]||null:null,'include':_0x320349[_0x3487('0x1b')]?_0x320349['options']['include']?_[_0x3487('0x1f')](_0x320349[_0x3487('0x1b')][_0x3487('0x20')],function(_0x3a9d76){return{'model':db[_0x3a9d76['model']],'as':_0x3a9d76['as'],'attributes':_0x3a9d76[_0x3487('0x1d')],'include':_0x3a9d76[_0x3487('0x20')]?_['map'](_0x3a9d76[_0x3487('0x20')],function(_0x3fb245){return{'model':db[_0x3fb245['model']],'as':_0x3fb245['as'],'attributes':_0x3fb245['attributes'],'include':_0x3fb245[_0x3487('0x20')]?_[_0x3487('0x1f')](_0x3fb245[_0x3487('0x20')],function(_0x23a76e){return{'model':db[_0x23a76e[_0x3487('0x21')]],'as':_0x23a76e['as'],'attributes':_0x23a76e[_0x3487('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3487('0x22')](function(_0x38af4a){logger[_0x3487('0xf')](_0x3487('0x23'),_0x320349);logger[_0x3487('0x11')]('GetMailAccount',_0x320349,JSON['stringify'](_0x38af4a));_0x2fd2e8(_0x38af4a);})[_0x3487('0x18')](function(_0x56ee54){logger['error'](_0x3487('0x23'),_0x56ee54[_0x3487('0x15')],_0x320349);_0x20eae9(_0x594ff6['error'](0x1f4,_0x56ee54['message']));});});};exports[_0x3487('0x24')]=function(_0x3a89ba){var _0x46df42=this;return new Promise(function(_0x531dd3,_0x3bb44f){return db['MailAccount']['find']({'raw':_0x3a89ba['options']?_0x3a89ba[_0x3487('0x1b')][_0x3487('0x25')]===undefined?!![]:![]:!![],'where':_0x3a89ba['options']?_0x3a89ba['options'][_0x3487('0x1c')]||null:null,'attributes':_0x3a89ba['options']?_0x3a89ba['options'][_0x3487('0x1d')]||null:null,'include':_0x3a89ba[_0x3487('0x1b')]?_0x3a89ba[_0x3487('0x1b')]['include']?_[_0x3487('0x1f')](_0x3a89ba[_0x3487('0x1b')][_0x3487('0x20')],function(_0x27c28f){return{'model':db[_0x27c28f['model']],'as':_0x27c28f['as'],'attributes':_0x27c28f[_0x3487('0x1d')],'include':_0x27c28f[_0x3487('0x20')]?_['map'](_0x27c28f[_0x3487('0x20')],function(_0x325a3a){return{'model':db[_0x325a3a[_0x3487('0x21')]],'as':_0x325a3a['as'],'attributes':_0x325a3a[_0x3487('0x1d')],'include':_0x325a3a[_0x3487('0x20')]?_[_0x3487('0x1f')](_0x325a3a[_0x3487('0x20')],function(_0x299172){return{'model':db[_0x299172[_0x3487('0x21')]],'as':_0x299172['as'],'attributes':_0x299172['attributes']};}):[]};}):[]};}):[]:[]})[_0x3487('0x22')](function(_0x3c9fa6){if(_0x3a89ba['options']['smtp']===!![])_0x3c9fa6[_0x3487('0x26')](_0x3487('0x27'),_0x3c9fa6[_0x3487('0x28')]());logger['info']('ShowMailAccount',_0x3a89ba);logger['debug'](_0x3487('0x24'),_0x3a89ba,JSON[_0x3487('0x12')](_0x3c9fa6));_0x531dd3(_0x3c9fa6);})['catch'](function(_0xbd0668){logger[_0x3487('0x13')](_0x3487('0x24'),_0xbd0668[_0x3487('0x15')],_0x3a89ba);_0x3bb44f(_0x46df42[_0x3487('0x13')](0x1f4,_0xbd0668[_0x3487('0x15')]));});});};exports[_0x3487('0x29')]=function(_0xc2e2ab){var _0x3cb013=this;return new Promise(function(_0x565cb2,_0x5c4f06){var _0x24a4ec={'body':_0xc2e2ab['body'],'channel':'mail'};var _0x8bb8c2=_['difference'](_['keys'](db[_0x3487('0x2a')]['rawAttributes']),['createdAt',_0x3487('0x2b'),_0x3487('0x2c'),'ListId']);var _0x51b69c=![];if(_0xc2e2ab[_0x3487('0x2d')]['id']){delete _0xc2e2ab[_0x3487('0x2d')]['id'];}if(_['isNil'](_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x2e')])){return _0x5c4f06(_0x3cb013['error'](0x1f4,_0x3487('0x2f')));}if(_[_0x3487('0x30')](_0xc2e2ab[_0x3487('0x2d')]['body'])||_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x2d')]===''){return _0x5c4f06(_0x3cb013[_0x3487('0x13')](0x1f4,_0x3487('0x31')));}if(_[_0x3487('0x30')](_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x32')])){return _0x5c4f06(_0x3cb013[_0x3487('0x13')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x8bb8c2));}if(!_[_0x3487('0x33')](_0x8bb8c2,_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x32')])){return _0x5c4f06(_0x3cb013[_0x3487('0x13')](0x1f4,_0x3487('0x34')+_0x8bb8c2));}var _0x31e766={};_0x31e766[_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x32')]]=_0xc2e2ab['body']['from'];return db[_0x3487('0x19')][_0x3487('0x35')]({'where':{'id':_0xc2e2ab[_0x3487('0x36')]['id']},'include':[{'model':db[_0x3487('0x37')],'as':'List','include':[{'model':db['CmContact'],'as':_0x3487('0x38'),'where':_0x31e766,'limit':0x1,'order':[[_0x3487('0x2b'),_0x3487('0x39')]]}]},{'model':db[_0x3487('0x3a')],'as':_0x3487('0x3b')},{'model':db[_0x3487('0x3c')],'as':_0x3487('0x3d'),'include':[{'model':db[_0x3487('0x3e')],'as':'CloudProvider'}]}]})['then'](function(_0x320351){if(_0x320351&&_0x320351[_0x3487('0x3f')]){var _0x58e50c=_0x320351[_0x3487('0x40')]({'plain':!![]});_0x24a4ec['account']=_['omit'](_0x58e50c,[_0x3487('0x3b'),_0x3487('0x3f')]);_0x24a4ec['account'][_0x3487('0x27')]=_0x320351[_0x3487('0x28')]();_0x24a4ec[_0x3487('0x41')]=_0x58e50c['Applications'];_0x24a4ec[_0x3487('0x42')]=_0x58e50c[_0x3487('0x3f')];_0x24a4ec[_0x3487('0x41')]=_[_0x3487('0x43')](_0x24a4ec['applications'],[_0x3487('0x44')],[_0x3487('0x45')]);if(_0x24a4ec[_0x3487('0x36')]&&_0x24a4ec[_0x3487('0x36')][_0x3487('0x46')]){_0x24a4ec[_0x3487('0x41')][_0x3487('0x47')]({'id':0x0,'priority':_0x24a4ec['applications'][_0x3487('0x48')]+0x1,'app':_0x3487('0x49'),'appdata':'autoclose','interval':_0x3487('0x4a')});}if(_0x24a4ec[_0x3487('0x36')][_0x3487('0x3b')]){delete _0x24a4ec[_0x3487('0x36')][_0x3487('0x3b')];}if(_0x24a4ec[_0x3487('0x36')][_0x3487('0x3f')]){delete _0x24a4ec[_0x3487('0x36')][_0x3487('0x3f')];}if(_0x58e50c[_0x3487('0x3f')]['Contacts'][_0x3487('0x48')]){return _0x58e50c[_0x3487('0x3f')][_0x3487('0x38')][0x0];}var _0x478b67=_[_0x3487('0xa')](_0xc2e2ab[_0x3487('0x2d')],{'firstName':_0xc2e2ab['body'][_0x3487('0x2e')],'ListId':_0x58e50c[_0x3487('0x4b')]});_0x478b67[_0xc2e2ab['body']['mapKey']]=_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x2e')];return db[_0x3487('0x2a')][_0x3487('0x4c')](_0x478b67);}else{throw new Error(_0x3487('0x4d'));}})[_0x3487('0x22')](function(_0x4fac20){_0x24a4ec['contact']=_0x4fac20;if(_0x4fac20){if(!_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x15')]['messageId']){_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x15')][_0x3487('0x4e')]=rs['generate']()+'\x20'+_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x15')]['from'];}var _0x504fac={'ContactId':_0x4fac20['id'],'MailAccountId':_0xc2e2ab[_0x3487('0x36')]['id'],'inReplyTo':_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x15')][_0x3487('0x4e')],'to':_0xc2e2ab['body'][_0x3487('0x15')][_0x3487('0x2e')],'cc':_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x15')]['cc'],'subject':_0xc2e2ab['body']['message'][_0x3487('0x4f')],'attach':_0xc2e2ab['body'][_0x3487('0x15')][_0x3487('0x50')],'lastMsgAt':moment()[_0x3487('0x51')](_0x3487('0x52')),'lastMsgDirection':'in'};return db[_0x3487('0x53')][_0x3487('0x35')]({'where':{'closed':![],'MailAccountId':_0xc2e2ab[_0x3487('0x36')]['id']},'include':[{'model':db[_0x3487('0x54')],'as':_0x3487('0x55'),'attributes':[_0x3487('0x4e')],'where':{'messageId':_0xc2e2ab[_0x3487('0x2d')]['message'][_0x3487('0x56')]}}]})[_0x3487('0x22')](function(_0x57b0e4){if(_0x57b0e4){return[_0x57b0e4,![]];}return db[_0x3487('0x53')]['create'](_0x504fac)['then'](function(_0x2e724d){return[_0x2e724d,!![]];});});}else{throw new Error(_0x3487('0x57'));}})[_0x3487('0x58')](function(_0x177fc0,_0x3d47c3){if(_0x177fc0){_0x51b69c=_0x3d47c3;if(!_0x3d47c3){return _0x177fc0[_0x3487('0x59')]({'inReplyTo':_0xc2e2ab[_0x3487('0x2d')]['message'][_0x3487('0x4e')],'to':_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x15')][_0x3487('0x2e')],'cc':_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x15')]['cc'],'subject':_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x15')][_0x3487('0x4f')],'attach':_0x177fc0[_0x3487('0x50')]?_0x177fc0['attach']:_0xc2e2ab['body'][_0x3487('0x15')]['attach'],'substatus':null,'substatusAt':moment()[_0x3487('0x51')](_0x3487('0x52')),'lastMsgAt':moment()[_0x3487('0x51')](_0x3487('0x52')),'lastMsgDirection':'in'});}else{return _0x177fc0;}}})['then'](function(_0x17ac4a){_0x24a4ec[_0x3487('0x5a')]=_0x17ac4a[_0x3487('0x40')]({'plain':!![]});_0x24a4ec[_0x3487('0x5a')][_0x3487('0x5b')]=_0x51b69c;return db[_0x3487('0x54')]['create']({'body':_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x2d')],'MailAccountId':_0xc2e2ab['account']['id'],'MailInteractionId':_0x17ac4a['id'],'direction':'in','ContactId':_0x24a4ec[_0x3487('0x5c')]['id'],'messageId':_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x15')][_0x3487('0x4e')],'from':_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x15')][_0x3487('0x2e')],'to':_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x15')]['to'],'cc':_0xc2e2ab[_0x3487('0x2d')]['message']['cc'],'subject':_0xc2e2ab[_0x3487('0x2d')]['message']['subject'],'attach':_0xc2e2ab[_0x3487('0x2d')]['message'][_0x3487('0x50')],'Attachments':_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x15')]['attachments'],'originTo':_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x15')][_0x3487('0x5d')],'originCc':_0xc2e2ab['body'][_0x3487('0x15')][_0x3487('0x5e')],'bcc':_0xc2e2ab[_0x3487('0x2d')]['message']['bcc'],'ChatWebsiteId':_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x15')][_0x3487('0x5f')]||null,'originChannel':_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x15')][_0x3487('0x60')]||_0x3487('0x61'),'ChatOfflineMessageId':_0xc2e2ab[_0x3487('0x2d')][_0x3487('0x15')][_0x3487('0x62')]||null},{'include':[{'model':db[_0x3487('0x63')],'as':_0x3487('0x64')}]});})[_0x3487('0x22')](function(_0x3d26eb){_0x24a4ec[_0x3487('0x15')]=_0x3d26eb;if(!_0x24a4ec[_0x3487('0x5a')][_0x3487('0x65')]){return;}return db[_0x3487('0x66')][_0x3487('0x35')]({'attributes':['id','name'],'where':{'id':_0x24a4ec[_0x3487('0x5a')][_0x3487('0x65')]}});})[_0x3487('0x22')](function(_0x9bbb2e){if(_0x9bbb2e){_0x24a4ec[_0x3487('0x41')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x9bbb2e[_0x3487('0x67')]+','+(_0x24a4ec[_0x3487('0x36')][_0x3487('0x68')]||0xa),'interval':_0x3487('0x4a')});}if(!_0x24a4ec[_0x3487('0x5a')][_0x3487('0x69')]){return;}return db[_0x3487('0x6a')]['find']({'attributes':['id',_0x3487('0x67')],'where':{'id':_0x24a4ec['interaction']['queueId']}});})[_0x3487('0x22')](function(_0x20ba2b){if(_0x20ba2b){_0x24a4ec[_0x3487('0x41')][_0x3487('0x6b')]({'id':0x0,'priority':0x1,'app':_0x3487('0x6c'),'appdata':_0x20ba2b[_0x3487('0x67')]+','+(_0x24a4ec[_0x3487('0x36')][_0x3487('0x6d')]||0x12c),'interval':_0x3487('0x4a')});}return respondWithRpcPromise(_0x3487('0x6e'),_0x3487('0x6f'),_0x24a4ec);})[_0x3487('0x22')](function(_0xd45305){_0x565cb2(_0xd45305);})[_0x3487('0x18')](function(_0x178b4f){_0x5c4f06(_0x3cb013['error'](0x1f4,_0x178b4f[_0x3487('0x15')]));});});}; \ No newline at end of file +var _0xaa37=['Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','update','interaction','created','attachments','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','waitForTheAssignedAgent','MailQueue','queueId','queue','waitForTheAssignedQueue','*,*,*,*','Start','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./mailAccount.socket','request','info','request\x20sent','debug','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','get','Applications','List','smtpOptions','applications','list','priority','asc','autoclose','length','close','create','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailMessage'];(function(_0x5eab66,_0x1a2d72){var _0x1dfe27=function(_0x38cc5a){while(--_0x38cc5a){_0x5eab66['push'](_0x5eab66['shift']());}};_0x1dfe27(++_0x1a2d72);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xaa37[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x7aa3('0x0'));var moment=require(_0x7aa3('0x1'));var BPromise=require(_0x7aa3('0x2'));var rs=require(_0x7aa3('0x3'));var Redis=require('ioredis');var db=require(_0x7aa3('0x4'))['db'];var logger=require(_0x7aa3('0x5'))(_0x7aa3('0x6'));var config=require(_0x7aa3('0x7'));var jayson=require(_0x7aa3('0x8'));var client=jayson[_0x7aa3('0x9')][_0x7aa3('0xa')]({'port':0x232c});config['redis']=_[_0x7aa3('0xb')](config[_0x7aa3('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7aa3('0xd'))(new Redis(config[_0x7aa3('0xc')]));require(_0x7aa3('0xe'))['register'](socket);function respondWithRpcPromise(_0x36e783,_0xd0fe4,_0x321fd3){return new BPromise(function(_0x1725d1,_0x10aa91){return client[_0x7aa3('0xf')](_0x36e783,_0x321fd3)['then'](function(_0x4c8ac8){logger[_0x7aa3('0x10')]('MailAccount,\x20%s,\x20%s',_0xd0fe4,_0x7aa3('0x11'));logger[_0x7aa3('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0xd0fe4,_0x7aa3('0x11'),JSON[_0x7aa3('0x13')](_0x4c8ac8));if(_0x4c8ac8['error']){if(_0x4c8ac8['error']['code']===0x1f4){logger[_0x7aa3('0x14')](_0x7aa3('0x15'),_0xd0fe4,_0x4c8ac8[_0x7aa3('0x14')][_0x7aa3('0x16')]);return _0x10aa91(_0x4c8ac8[_0x7aa3('0x14')]['message']);}logger[_0x7aa3('0x14')](_0x7aa3('0x15'),_0xd0fe4,_0x4c8ac8[_0x7aa3('0x14')][_0x7aa3('0x16')]);return _0x1725d1(_0x4c8ac8['error']['message']);}else{logger[_0x7aa3('0x10')]('MailAccount,\x20%s,\x20%s',_0xd0fe4,_0x7aa3('0x11'));_0x1725d1(_0x4c8ac8[_0x7aa3('0x17')]['message']);}})[_0x7aa3('0x18')](function(_0xe5e683){logger[_0x7aa3('0x14')](_0x7aa3('0x15'),_0xd0fe4,_0xe5e683);_0x10aa91(_0xe5e683);});});}exports[_0x7aa3('0x19')]=function(_0x5994b6){var _0x22e93b=this;return new Promise(function(_0x266529,_0x5defea){return db[_0x7aa3('0x1a')][_0x7aa3('0x1b')]({'raw':_0x5994b6[_0x7aa3('0x1c')]?_0x5994b6['options'][_0x7aa3('0x1d')]===undefined?!![]:![]:!![],'where':_0x5994b6[_0x7aa3('0x1c')]?_0x5994b6[_0x7aa3('0x1c')][_0x7aa3('0x1e')]||null:null,'attributes':_0x5994b6[_0x7aa3('0x1c')]?_0x5994b6['options'][_0x7aa3('0x1f')]||null:null,'limit':_0x5994b6[_0x7aa3('0x1c')]?_0x5994b6[_0x7aa3('0x1c')][_0x7aa3('0x20')]||null:null,'include':_0x5994b6[_0x7aa3('0x1c')]?_0x5994b6[_0x7aa3('0x1c')][_0x7aa3('0x21')]?_[_0x7aa3('0x22')](_0x5994b6[_0x7aa3('0x1c')][_0x7aa3('0x21')],function(_0x44377a){return{'model':db[_0x44377a[_0x7aa3('0x23')]],'as':_0x44377a['as'],'attributes':_0x44377a[_0x7aa3('0x1f')],'include':_0x44377a['include']?_[_0x7aa3('0x22')](_0x44377a[_0x7aa3('0x21')],function(_0x3c1422){return{'model':db[_0x3c1422[_0x7aa3('0x23')]],'as':_0x3c1422['as'],'attributes':_0x3c1422[_0x7aa3('0x1f')],'include':_0x3c1422[_0x7aa3('0x21')]?_['map'](_0x3c1422[_0x7aa3('0x21')],function(_0x183567){return{'model':db[_0x183567[_0x7aa3('0x23')]],'as':_0x183567['as'],'attributes':_0x183567['attributes']};}):[]};}):[]};}):[]:[]})[_0x7aa3('0x24')](function(_0x25c611){logger['info'](_0x7aa3('0x19'),_0x5994b6);logger[_0x7aa3('0x12')](_0x7aa3('0x19'),_0x5994b6,JSON[_0x7aa3('0x13')](_0x25c611));_0x266529(_0x25c611);})[_0x7aa3('0x18')](function(_0x24a38d){logger[_0x7aa3('0x14')](_0x7aa3('0x19'),_0x24a38d[_0x7aa3('0x16')],_0x5994b6);_0x5defea(_0x22e93b[_0x7aa3('0x14')](0x1f4,_0x24a38d[_0x7aa3('0x16')]));});});};exports[_0x7aa3('0x25')]=function(_0xb8d253){var _0xc3976c=this;return new Promise(function(_0x260caf,_0x1e5b7b){return db[_0x7aa3('0x1a')][_0x7aa3('0x26')]({'raw':_0xb8d253[_0x7aa3('0x1c')]?_0xb8d253[_0x7aa3('0x1c')][_0x7aa3('0x1d')]===undefined?!![]:![]:!![],'where':_0xb8d253['options']?_0xb8d253[_0x7aa3('0x1c')][_0x7aa3('0x1e')]||null:null,'attributes':_0xb8d253[_0x7aa3('0x1c')]?_0xb8d253[_0x7aa3('0x1c')][_0x7aa3('0x1f')]||null:null,'include':_0xb8d253[_0x7aa3('0x1c')]?_0xb8d253[_0x7aa3('0x1c')][_0x7aa3('0x21')]?_[_0x7aa3('0x22')](_0xb8d253[_0x7aa3('0x1c')][_0x7aa3('0x21')],function(_0x589abc){return{'model':db[_0x589abc[_0x7aa3('0x23')]],'as':_0x589abc['as'],'attributes':_0x589abc[_0x7aa3('0x1f')],'include':_0x589abc[_0x7aa3('0x21')]?_[_0x7aa3('0x22')](_0x589abc[_0x7aa3('0x21')],function(_0x1029eb){return{'model':db[_0x1029eb[_0x7aa3('0x23')]],'as':_0x1029eb['as'],'attributes':_0x1029eb[_0x7aa3('0x1f')],'include':_0x1029eb[_0x7aa3('0x21')]?_[_0x7aa3('0x22')](_0x1029eb[_0x7aa3('0x21')],function(_0x287572){return{'model':db[_0x287572[_0x7aa3('0x23')]],'as':_0x287572['as'],'attributes':_0x287572[_0x7aa3('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1effcb){if(_0xb8d253[_0x7aa3('0x1c')][_0x7aa3('0x27')]===!![])_0x1effcb[_0x7aa3('0x28')]('smtpOptions',_0x1effcb[_0x7aa3('0x29')]());logger['info'](_0x7aa3('0x25'),_0xb8d253);logger[_0x7aa3('0x12')](_0x7aa3('0x25'),_0xb8d253,JSON[_0x7aa3('0x13')](_0x1effcb));_0x260caf(_0x1effcb);})[_0x7aa3('0x18')](function(_0x20ae76){logger[_0x7aa3('0x14')](_0x7aa3('0x25'),_0x20ae76[_0x7aa3('0x16')],_0xb8d253);_0x1e5b7b(_0xc3976c[_0x7aa3('0x14')](0x1f4,_0x20ae76['message']));});});};exports[_0x7aa3('0x2a')]=function(_0x1062f4){var _0x119098=this;return new Promise(function(_0x11111a,_0x3d41bf){var _0x143d77={'body':_0x1062f4[_0x7aa3('0x2b')],'channel':_0x7aa3('0x2c')};var _0x5202ed=_[_0x7aa3('0x2d')](_[_0x7aa3('0x2e')](db[_0x7aa3('0x2f')][_0x7aa3('0x30')]),[_0x7aa3('0x31'),'updatedAt',_0x7aa3('0x32'),_0x7aa3('0x33')]);var _0x4999d5=![];if(_0x1062f4[_0x7aa3('0x2b')]['id']){delete _0x1062f4[_0x7aa3('0x2b')]['id'];}if(_['isNil'](_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x34')])){return _0x3d41bf(_0x119098[_0x7aa3('0x14')](0x1f4,_0x7aa3('0x35')));}if(_['isNil'](_0x1062f4['body'][_0x7aa3('0x2b')])||_0x1062f4['body'][_0x7aa3('0x2b')]===''){return _0x3d41bf(_0x119098['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x7aa3('0x36')](_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x37')])){return _0x3d41bf(_0x119098[_0x7aa3('0x14')](0x1f4,_0x7aa3('0x38')+_0x5202ed));}if(!_['includes'](_0x5202ed,_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x37')])){return _0x3d41bf(_0x119098['error'](0x1f4,_0x7aa3('0x39')+_0x5202ed));}var _0xcf97e0={};_0xcf97e0[_0x1062f4[_0x7aa3('0x2b')]['mapKey']]=_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x34')];return db['MailAccount'][_0x7aa3('0x26')]({'where':{'id':_0x1062f4[_0x7aa3('0x3a')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x7aa3('0x2f')],'as':_0x7aa3('0x3b'),'where':_0xcf97e0,'limit':0x1,'order':[[_0x7aa3('0x3c'),_0x7aa3('0x3d')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0x7aa3('0x3e')],'as':_0x7aa3('0x3f'),'include':[{'model':db[_0x7aa3('0x40')],'as':_0x7aa3('0x40')}]}]})['then'](function(_0x49b1e2){if(_0x49b1e2&&_0x49b1e2['List']){var _0x3e9d63=_0x49b1e2[_0x7aa3('0x41')]({'plain':!![]});_0x143d77[_0x7aa3('0x3a')]=_['omit'](_0x3e9d63,[_0x7aa3('0x42'),_0x7aa3('0x43')]);_0x143d77[_0x7aa3('0x3a')][_0x7aa3('0x44')]=_0x49b1e2[_0x7aa3('0x29')]();_0x143d77[_0x7aa3('0x45')]=_0x3e9d63['Applications'];_0x143d77[_0x7aa3('0x46')]=_0x3e9d63['List'];_0x143d77['applications']=_['orderBy'](_0x143d77['applications'],[_0x7aa3('0x47')],[_0x7aa3('0x48')]);if(_0x143d77['account']&&_0x143d77[_0x7aa3('0x3a')][_0x7aa3('0x49')]){_0x143d77[_0x7aa3('0x45')]['push']({'id':0x0,'priority':_0x143d77['applications'][_0x7aa3('0x4a')]+0x1,'app':_0x7aa3('0x4b'),'appdata':_0x7aa3('0x49'),'interval':'*,*,*,*'});}if(_0x143d77['account']['Applications']){delete _0x143d77['account'][_0x7aa3('0x42')];}if(_0x143d77[_0x7aa3('0x3a')][_0x7aa3('0x43')]){delete _0x143d77[_0x7aa3('0x3a')]['List'];}if(_0x3e9d63[_0x7aa3('0x43')][_0x7aa3('0x3b')][_0x7aa3('0x4a')]){return _0x3e9d63[_0x7aa3('0x43')][_0x7aa3('0x3b')][0x0];}var _0x572f97=_[_0x7aa3('0xb')](_0x1062f4[_0x7aa3('0x2b')],{'firstName':_0x1062f4['body'][_0x7aa3('0x34')],'ListId':_0x3e9d63[_0x7aa3('0x33')]});_0x572f97[_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x37')]]=_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x34')];return db[_0x7aa3('0x2f')][_0x7aa3('0x4c')](_0x572f97);}else{throw new Error('List\x20not\x20found');}})[_0x7aa3('0x24')](function(_0xcc67fd){_0x143d77['contact']=_0xcc67fd;if(_0xcc67fd){if(!_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x16')][_0x7aa3('0x4d')]){_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x16')][_0x7aa3('0x4d')]=rs[_0x7aa3('0x4e')]()+'\x20'+_0x1062f4[_0x7aa3('0x2b')]['message'][_0x7aa3('0x34')];}var _0x13eabe={'ContactId':_0xcc67fd['id'],'MailAccountId':_0x1062f4[_0x7aa3('0x3a')]['id'],'inReplyTo':_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x16')][_0x7aa3('0x4d')],'to':_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x16')][_0x7aa3('0x34')],'cc':_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x16')]['cc'],'subject':_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x16')][_0x7aa3('0x4f')],'attach':_0x1062f4['body']['message'][_0x7aa3('0x50')],'lastMsgAt':moment()['format'](_0x7aa3('0x51')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x1062f4['account']['id']},'include':[{'model':db[_0x7aa3('0x52')],'as':_0x7aa3('0x53'),'attributes':[_0x7aa3('0x4d')],'where':{'messageId':_0x1062f4[_0x7aa3('0x2b')]['message'][_0x7aa3('0x54')]}}]})['then'](function(_0x546b13){if(_0x546b13){return[_0x546b13,![]];}return db[_0x7aa3('0x55')][_0x7aa3('0x4c')](_0x13eabe)[_0x7aa3('0x24')](function(_0xcb6180){return[_0xcb6180,!![]];});});}else{throw new Error(_0x7aa3('0x56'));}})[_0x7aa3('0x57')](function(_0x44d400,_0x16724c){if(_0x44d400){_0x4999d5=_0x16724c;if(!_0x16724c){return _0x44d400[_0x7aa3('0x58')]({'inReplyTo':_0x1062f4['body'][_0x7aa3('0x16')][_0x7aa3('0x4d')],'to':_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x16')][_0x7aa3('0x34')],'cc':_0x1062f4['body'][_0x7aa3('0x16')]['cc'],'subject':_0x1062f4['body']['message'][_0x7aa3('0x4f')],'attach':_0x44d400[_0x7aa3('0x50')]?_0x44d400['attach']:_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x16')][_0x7aa3('0x50')],'substatus':null,'substatusAt':moment()['format'](_0x7aa3('0x51')),'lastMsgAt':moment()['format'](_0x7aa3('0x51')),'lastMsgDirection':'in'});}else{return _0x44d400;}}})[_0x7aa3('0x24')](function(_0x48d2f0){_0x143d77[_0x7aa3('0x59')]=_0x48d2f0[_0x7aa3('0x41')]({'plain':!![]});_0x143d77[_0x7aa3('0x59')][_0x7aa3('0x5a')]=_0x4999d5;return db['MailMessage'][_0x7aa3('0x4c')]({'body':_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x2b')],'MailAccountId':_0x1062f4[_0x7aa3('0x3a')]['id'],'MailInteractionId':_0x48d2f0['id'],'direction':'in','ContactId':_0x143d77['contact']['id'],'messageId':_0x1062f4[_0x7aa3('0x2b')]['message'][_0x7aa3('0x4d')],'from':_0x1062f4['body'][_0x7aa3('0x16')][_0x7aa3('0x34')],'to':_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x16')]['to'],'cc':_0x1062f4['body']['message']['cc'],'subject':_0x1062f4['body']['message'][_0x7aa3('0x4f')],'attach':_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x16')][_0x7aa3('0x50')],'Attachments':_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x16')][_0x7aa3('0x5b')],'originTo':_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x16')]['originTo'],'originCc':_0x1062f4['body'][_0x7aa3('0x16')]['originCc'],'bcc':_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x16')][_0x7aa3('0x5c')],'ChatWebsiteId':_0x1062f4['body'][_0x7aa3('0x16')][_0x7aa3('0x5d')]||null,'originChannel':_0x1062f4['body']['message'][_0x7aa3('0x5e')]||_0x7aa3('0x5f'),'ChatOfflineMessageId':_0x1062f4[_0x7aa3('0x2b')][_0x7aa3('0x16')][_0x7aa3('0x60')]||null},{'include':[{'model':db[_0x7aa3('0x61')],'as':_0x7aa3('0x62')}]});})[_0x7aa3('0x24')](function(_0x43bd8b){_0x143d77[_0x7aa3('0x16')]=_0x43bd8b;if(!_0x143d77[_0x7aa3('0x59')][_0x7aa3('0x63')]){return;}return db[_0x7aa3('0x64')][_0x7aa3('0x26')]({'attributes':['id',_0x7aa3('0x65')],'where':{'id':_0x143d77['interaction'][_0x7aa3('0x63')]}});})[_0x7aa3('0x24')](function(_0x42ef94){if(_0x42ef94){_0x143d77[_0x7aa3('0x45')][_0x7aa3('0x66')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x42ef94[_0x7aa3('0x65')]+','+(_0x143d77[_0x7aa3('0x3a')][_0x7aa3('0x67')]||0xa),'interval':'*,*,*,*'});}if(!_0x143d77[_0x7aa3('0x59')]['queueId']){return;}return db[_0x7aa3('0x68')][_0x7aa3('0x26')]({'attributes':['id',_0x7aa3('0x65')],'where':{'id':_0x143d77[_0x7aa3('0x59')][_0x7aa3('0x69')]}});})[_0x7aa3('0x24')](function(_0x1db954){if(_0x1db954){_0x143d77[_0x7aa3('0x45')][_0x7aa3('0x66')]({'id':0x0,'priority':0x1,'app':_0x7aa3('0x6a'),'appdata':_0x1db954['name']+','+(_0x143d77[_0x7aa3('0x3a')][_0x7aa3('0x6b')]||0x12c),'interval':_0x7aa3('0x6c')});}return respondWithRpcPromise(_0x7aa3('0x6d'),'startRouting',_0x143d77);})[_0x7aa3('0x24')](function(_0x419d70){_0x11111a(_0x419d70);})[_0x7aa3('0x18')](function(_0x3bb4d8){_0x3d41bf(_0x119098[_0x7aa3('0x14')](0x1f4,_0x3bb4d8[_0x7aa3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index afd1e67..ba9fb35 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 _0xfe13=['./mailAccount.events','remove','update','emit','removeListener','register','length','mailAccount:'];(function(_0x3489cf,_0x4b7a68){var _0x3fef23=function(_0x3fb320){while(--_0x3fb320){_0x3489cf['push'](_0x3489cf['shift']());}};_0x3fef23(++_0x4b7a68);}(_0xfe13,0x178));var _0x3fe1=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xfe13[_0x18ab2a];return _0x16dcee;};'use strict';var MailAccountEvents=require(_0x3fe1('0x0'));var events=['save',_0x3fe1('0x1'),_0x3fe1('0x2')];function createListener(_0x1d6495,_0x45ea4f){return function(_0x314639){_0x45ea4f[_0x3fe1('0x3')](_0x1d6495,_0x314639);};}function removeListener(_0x4b3537,_0x5074c4){return function(){MailAccountEvents[_0x3fe1('0x4')](_0x4b3537,_0x5074c4);};}exports[_0x3fe1('0x5')]=function(_0x2c5ed2){for(var _0x5caa2e=0x0,_0xe33444=events[_0x3fe1('0x6')];_0x5caa2e<_0xe33444;_0x5caa2e++){var _0x1c3fac=events[_0x5caa2e];var _0x22fe4b=createListener(_0x3fe1('0x7')+_0x1c3fac,_0x2c5ed2);MailAccountEvents['on'](_0x1c3fac,_0x22fe4b);}}; \ No newline at end of file +var _0x7889=['emit','removeListener','register','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7889,0x1cc));var _0x9788=function(_0x45ce7d,_0xd04127){_0x45ce7d=_0x45ce7d-0x0;var _0x3547d=_0x7889[_0x45ce7d];return _0x3547d;};'use strict';var MailAccountEvents=require(_0x9788('0x0'));var events=[_0x9788('0x1'),_0x9788('0x2'),_0x9788('0x3')];function createListener(_0x36701,_0x11384a){return function(_0x488dd8){_0x11384a[_0x9788('0x4')](_0x36701,_0x488dd8);};}function removeListener(_0x512778,_0x3d0c1f){return function(){MailAccountEvents[_0x9788('0x5')](_0x512778,_0x3d0c1f);};}exports[_0x9788('0x6')]=function(_0x5750e7){for(var _0x13ffcc=0x0,_0x422af7=events['length'];_0x13ffcc<_0x422af7;_0x13ffcc++){var _0x59dea1=events[_0x13ffcc];var _0x280169=createListener(_0x9788('0x7')+_0x59dea1,_0x5750e7);MailAccountEvents['on'](_0x59dea1,_0x280169);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 1e35b67..1e29453 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 _0x9c5d=['./mailApplication.controller','get','/:id','show','put','isAuthenticated','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2e89cf,_0x2e3121){var _0x154a0e=function(_0x3f12b3){while(--_0x3f12b3){_0x2e89cf['push'](_0x2e89cf['shift']());}};_0x154a0e(++_0x2e3121);}(_0x9c5d,0x118));var _0xd9c5=function(_0x50d249,_0x564d13){_0x50d249=_0x50d249-0x0;var _0x267287=_0x9c5d[_0x50d249];return _0x267287;};'use strict';var multer=require(_0xd9c5('0x0'));var util=require(_0xd9c5('0x1'));var path=require(_0xd9c5('0x2'));var timeout=require(_0xd9c5('0x3'));var express=require(_0xd9c5('0x4'));var router=express['Router']();var fs_extra=require(_0xd9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd9c5('0x6'));var config=require(_0xd9c5('0x7'));var controller=require(_0xd9c5('0x8'));router[_0xd9c5('0x9')](_0xd9c5('0xa'),auth['isAuthenticated'](),controller[_0xd9c5('0xb')]);router[_0xd9c5('0xc')](_0xd9c5('0xa'),auth[_0xd9c5('0xd')](),controller[_0xd9c5('0xe')]);router[_0xd9c5('0xf')](_0xd9c5('0xa'),auth[_0xd9c5('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1c85=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x5aebf6,_0x2b3e87){var _0x5b4215=function(_0x46af24){while(--_0x46af24){_0x5aebf6['push'](_0x5aebf6['shift']());}};_0x5b4215(++_0x2b3e87);}(_0x1c85,0x1f3));var _0x51c8=function(_0x4b1c0c,_0x5c9c50){_0x4b1c0c=_0x4b1c0c-0x0;var _0x8f4bbc=_0x1c85[_0x4b1c0c];return _0x8f4bbc;};'use strict';var multer=require(_0x51c8('0x0'));var util=require('util');var path=require(_0x51c8('0x1'));var timeout=require(_0x51c8('0x2'));var express=require(_0x51c8('0x3'));var router=express[_0x51c8('0x4')]();var fs_extra=require(_0x51c8('0x5'));var auth=require(_0x51c8('0x6'));var interaction=require(_0x51c8('0x7'));var config=require(_0x51c8('0x8'));var controller=require(_0x51c8('0x9'));router[_0x51c8('0xa')](_0x51c8('0xb'),auth[_0x51c8('0xc')](),controller[_0x51c8('0xd')]);router[_0x51c8('0xe')](_0x51c8('0xb'),auth[_0x51c8('0xc')](),controller[_0x51c8('0xf')]);router['delete']('/:id',auth[_0x51c8('0xc')](),controller[_0x51c8('0x10')]);module[_0x51c8('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 4edbc1d..51ea175 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 _0x09bf=['INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x3d91bc,_0x2e7f6e){var _0x90b4fe=function(_0x15c209){while(--_0x15c209){_0x3d91bc['push'](_0x3d91bc['shift']());}};_0x90b4fe(++_0x2e7f6e);}(_0x09bf,0xb4));var _0xf09b=function(_0x4a25d8,_0x1b623f){_0x4a25d8=_0x4a25d8-0x0;var _0x1a3024=_0x09bf[_0x4a25d8];return _0x1a3024;};'use strict';var Sequelize=require(_0xf09b('0x0'));module[_0xf09b('0x1')]={'priority':{'type':Sequelize[_0xf09b('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf09b('0x3')},'appdata':{'type':Sequelize[_0xf09b('0x4')]()},'description':{'type':Sequelize[_0xf09b('0x5')]},'interval':{'type':Sequelize[_0xf09b('0x5')],'defaultValue':_0xf09b('0x6')}}; \ No newline at end of file +var _0x8858=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x538a93,_0x236bc1){var _0x11127c=function(_0x2fa3d8){while(--_0x2fa3d8){_0x538a93['push'](_0x538a93['shift']());}};_0x11127c(++_0x236bc1);}(_0x8858,0xea));var _0x8885=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x8858[_0x2a6809];return _0x11c371;};'use strict';var Sequelize=require(_0x8885('0x0'));module[_0x8885('0x1')]={'priority':{'type':Sequelize[_0x8885('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8885('0x3')},'appdata':{'type':Sequelize[_0x8885('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8885('0x5')],'defaultValue':_0x8885('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 5fbd4b5..f6465a7 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(_0x294b71,_0x4c47d4){var _0x1b5689=function(_0x1755e5){while(--_0x1755e5){_0x294b71['push'](_0x294b71['shift']());}};_0x1b5689(++_0x4c47d4);}(_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 _0xbdb7=['update','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0xc87d08,_0x59c9be){var _0x30a714=function(_0x437c0d){while(--_0x437c0d){_0xc87d08['push'](_0xc87d08['shift']());}};_0x30a714(++_0x59c9be);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3a0633,_0x120c59){_0x3a0633=_0x3a0633-0x0;var _0x58341e=_0xbdb7[_0x3a0633];return _0x58341e;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['MailApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index c2f20ad..0f87c56 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 _0x46d1=['mail_applications','utf8mb4','utf8mb4_unicode_ci','api','bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication'];(function(_0x4d7c86,_0x9b62a6){var _0x59443d=function(_0x5af971){while(--_0x5af971){_0x4d7c86['push'](_0x4d7c86['shift']());}};_0x59443d(++_0x9b62a6);}(_0x46d1,0x1a7));var _0x146d=function(_0x25b0be,_0x5dfbc8){_0x25b0be=_0x25b0be-0x0;var _0x578357=_0x46d1[_0x25b0be];return _0x578357;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x146d('0x0'));var moment=require('moment');var BPromise=require(_0x146d('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x146d('0x2'));var rimraf=require(_0x146d('0x3'));var config=require(_0x146d('0x4'));var attributes=require(_0x146d('0x5'));module[_0x146d('0x6')]=function(_0x508ecf,_0x2137dd){return _0x508ecf[_0x146d('0x7')](_0x146d('0x8'),attributes,{'tableName':_0x146d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x146d('0xa'),'collate':_0x146d('0xb')});}; \ No newline at end of file +var _0x4fc1=['api','moment','bluebird','rimraf','../../config/environment','./mailApplication.attributes','MailApplication','mail_applications','utf8mb4','lodash','../../config/logger'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4fc1,0x15e));var _0x14fc=function(_0x2c2f29,_0x2a1c3b){_0x2c2f29=_0x2c2f29-0x0;var _0x1cc345=_0x4fc1[_0x2c2f29];return _0x1cc345;};'use strict';var _=require(_0x14fc('0x0'));var util=require('util');var logger=require(_0x14fc('0x1'))(_0x14fc('0x2'));var moment=require(_0x14fc('0x3'));var BPromise=require(_0x14fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x14fc('0x5'));var config=require(_0x14fc('0x6'));var attributes=require(_0x14fc('0x7'));module['exports']=function(_0x7a8403,_0x3faa91){return _0x7a8403['define'](_0x14fc('0x8'),attributes,{'tableName':_0x14fc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x14fc('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index bb6b190..4426a7d 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 _0x044f=['debug','request\x20sent','stringify','code','error','message','info','catch','UpdateMailApplication','MailApplication','update','options','where','attributes','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','MailApplication,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x044f,0x108));var _0xf044=function(_0x458ed6,_0x504646){_0x458ed6=_0x458ed6-0x0;var _0xa5dfd9=_0x044f[_0x458ed6];return _0xa5dfd9;};'use strict';var _=require(_0xf044('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf044('0x1'));var db=require(_0xf044('0x2'))['db'];var utils=require(_0xf044('0x3'));var logger=require(_0xf044('0x4'))(_0xf044('0x5'));var config=require(_0xf044('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf044('0x7')][_0xf044('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa5b671,_0x1525b0,_0x6a4b1f){return new BPromise(function(_0x1cfa91,_0x43e764){return client['request'](_0xa5b671,_0x6a4b1f)[_0xf044('0x9')](function(_0x5bd21e){logger['info'](_0xf044('0xa'),_0x1525b0,'request\x20sent');logger[_0xf044('0xb')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x1525b0,_0xf044('0xc'),JSON[_0xf044('0xd')](_0x5bd21e));if(_0x5bd21e['error']){if(_0x5bd21e['error'][_0xf044('0xe')]===0x1f4){logger[_0xf044('0xf')]('MailApplication,\x20%s,\x20%s',_0x1525b0,_0x5bd21e['error'][_0xf044('0x10')]);return _0x43e764(_0x5bd21e[_0xf044('0xf')]['message']);}logger['error'](_0xf044('0xa'),_0x1525b0,_0x5bd21e[_0xf044('0xf')][_0xf044('0x10')]);return _0x1cfa91(_0x5bd21e['error'][_0xf044('0x10')]);}else{logger[_0xf044('0x11')](_0xf044('0xa'),_0x1525b0,_0xf044('0xc'));_0x1cfa91(_0x5bd21e['result'][_0xf044('0x10')]);}})[_0xf044('0x12')](function(_0x5c9a81){logger[_0xf044('0xf')](_0xf044('0xa'),_0x1525b0,_0x5c9a81);_0x43e764(_0x5c9a81);});});}exports[_0xf044('0x13')]=function(_0x14f9d9){var _0x5cff28=this;return new Promise(function(_0x5910a1,_0x30a579){return db[_0xf044('0x14')][_0xf044('0x15')](_0x14f9d9['body'],{'raw':_0x14f9d9[_0xf044('0x16')]?_0x14f9d9[_0xf044('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14f9d9['options']?_0x14f9d9[_0xf044('0x16')][_0xf044('0x17')]||null:null,'attributes':_0x14f9d9[_0xf044('0x16')]?_0x14f9d9['options'][_0xf044('0x18')]||null:null,'limit':_0x14f9d9[_0xf044('0x16')]?_0x14f9d9[_0xf044('0x16')]['limit']||null:null})['then'](function(_0xd644b7){logger['info'](_0xf044('0x13'),_0x14f9d9);logger[_0xf044('0xb')]('UpdateMailApplication',_0x14f9d9,JSON[_0xf044('0xd')](_0xd644b7));_0x5910a1(_0xd644b7);})[_0xf044('0x12')](function(_0x1ef8b3){logger[_0xf044('0xf')](_0xf044('0x13'),_0x1ef8b3[_0xf044('0x10')],_0x14f9d9);_0x30a579(_0x5cff28[_0xf044('0xf')](0x1f4,_0x1ef8b3[_0xf044('0x10')]));});});}; \ No newline at end of file +var _0xfb32=['request','then','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailApplication','update','options','raw','attributes','limit','info','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1b8300,_0x472f39){var _0x49deb2=function(_0x150f25){while(--_0x150f25){_0x1b8300['push'](_0x1b8300['shift']());}};_0x49deb2(++_0x472f39);}(_0xfb32,0x118));var _0x2fb3=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0xfb32[_0x57975f];return _0x4793b8;};'use strict';var _=require('lodash');var util=require(_0x2fb3('0x0'));var moment=require(_0x2fb3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2fb3('0x2'))['db'];var utils=require(_0x2fb3('0x3'));var logger=require(_0x2fb3('0x4'))(_0x2fb3('0x5'));var config=require(_0x2fb3('0x6'));var jayson=require(_0x2fb3('0x7'));var client=jayson[_0x2fb3('0x8')][_0x2fb3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc81297,_0x4b3c9f,_0x29474a){return new BPromise(function(_0xf59d90,_0x1d437c){return client[_0x2fb3('0xa')](_0xc81297,_0x29474a)[_0x2fb3('0xb')](function(_0x2e3d7d){logger['info'](_0x2fb3('0xc'),_0x4b3c9f,'request\x20sent');logger[_0x2fb3('0xd')](_0x2fb3('0xe'),_0x4b3c9f,_0x2fb3('0xf'),JSON[_0x2fb3('0x10')](_0x2e3d7d));if(_0x2e3d7d[_0x2fb3('0x11')]){if(_0x2e3d7d[_0x2fb3('0x11')][_0x2fb3('0x12')]===0x1f4){logger[_0x2fb3('0x11')](_0x2fb3('0xc'),_0x4b3c9f,_0x2e3d7d['error'][_0x2fb3('0x13')]);return _0x1d437c(_0x2e3d7d[_0x2fb3('0x11')][_0x2fb3('0x13')]);}logger['error'](_0x2fb3('0xc'),_0x4b3c9f,_0x2e3d7d['error'][_0x2fb3('0x13')]);return _0xf59d90(_0x2e3d7d[_0x2fb3('0x11')][_0x2fb3('0x13')]);}else{logger['info'](_0x2fb3('0xc'),_0x4b3c9f,_0x2fb3('0xf'));_0xf59d90(_0x2e3d7d[_0x2fb3('0x14')]['message']);}})[_0x2fb3('0x15')](function(_0x83fa9c){logger[_0x2fb3('0x11')]('MailApplication,\x20%s,\x20%s',_0x4b3c9f,_0x83fa9c);_0x1d437c(_0x83fa9c);});});}exports[_0x2fb3('0x16')]=function(_0x1fec14){var _0x25726d=this;return new Promise(function(_0x51197f,_0x5d557f){return db['MailApplication'][_0x2fb3('0x17')](_0x1fec14['body'],{'raw':_0x1fec14[_0x2fb3('0x18')]?_0x1fec14[_0x2fb3('0x18')][_0x2fb3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fec14['options']?_0x1fec14[_0x2fb3('0x18')]['where']||null:null,'attributes':_0x1fec14[_0x2fb3('0x18')]?_0x1fec14[_0x2fb3('0x18')][_0x2fb3('0x1a')]||null:null,'limit':_0x1fec14[_0x2fb3('0x18')]?_0x1fec14['options'][_0x2fb3('0x1b')]||null:null})[_0x2fb3('0xb')](function(_0x19fe52){logger[_0x2fb3('0x1c')](_0x2fb3('0x16'),_0x1fec14);logger[_0x2fb3('0xd')]('UpdateMailApplication',_0x1fec14,JSON[_0x2fb3('0x10')](_0x19fe52));_0x51197f(_0x19fe52);})[_0x2fb3('0x15')](function(_0x275b71){logger[_0x2fb3('0x11')](_0x2fb3('0x16'),_0x275b71[_0x2fb3('0x13')],_0x1fec14);_0x5d557f(_0x25726d['error'](0x1f4,_0x275b71[_0x2fb3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index ba364cd..8af0e86 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 _0x64f0=['mailinteraction:destroy','destroy','/:id/tags','exports','express','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','tracked','mail','mailinteraction:addtags','addTags','put','/:id','mailinteraction:update','update','delete'];(function(_0x12b7b4,_0x155cfc){var _0x3b2a3e=function(_0x5b2c9e){while(--_0x5b2c9e){_0x12b7b4['push'](_0x12b7b4['shift']());}};_0x3b2a3e(++_0x155cfc);}(_0x64f0,0x1b4));var _0x064f=function(_0x512c83,_0x42a67a){_0x512c83=_0x512c83-0x0;var _0x1f7f25=_0x64f0[_0x512c83];return _0x1f7f25;};'use strict';var express=require(_0x064f('0x0'));var router=express[_0x064f('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x064f('0x2'));var controller=require(_0x064f('0x3'));router[_0x064f('0x4')]('/',auth[_0x064f('0x5')](),controller['index']);router[_0x064f('0x4')](_0x064f('0x6'),auth[_0x064f('0x5')](),controller['describe']);router[_0x064f('0x4')]('/:id',auth[_0x064f('0x5')](),controller[_0x064f('0x7')]);router[_0x064f('0x4')](_0x064f('0x8'),auth[_0x064f('0x5')](),controller[_0x064f('0x9')]);router[_0x064f('0x4')](_0x064f('0xa'),auth[_0x064f('0x5')](),controller['download']);router[_0x064f('0xb')]('/',auth['isAuthenticated'](),controller[_0x064f('0xc')]);router[_0x064f('0xb')](_0x064f('0x8'),auth[_0x064f('0x5')](),controller[_0x064f('0xd')]);router[_0x064f('0xb')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x064f('0xe')](_0x064f('0xf'),_0x064f('0x10')),controller[_0x064f('0x11')]);router[_0x064f('0x12')](_0x064f('0x13'),auth[_0x064f('0x5')](),interaction[_0x064f('0xe')](_0x064f('0xf'),_0x064f('0x14')),controller[_0x064f('0x15')]);router[_0x064f('0x16')](_0x064f('0x13'),auth[_0x064f('0x5')](),interaction[_0x064f('0xe')](_0x064f('0xf'),_0x064f('0x17')),controller[_0x064f('0x18')]);router[_0x064f('0x16')](_0x064f('0x19'),auth[_0x064f('0x5')](),controller['removeTags']);module[_0x064f('0x1a')]=router; \ No newline at end of file +var _0x5c95=['./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','mailinteraction:update','delete','destroy','removeTags','Router','../../components/interaction/service'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x5c95,0x76));var _0x55c9=function(_0x6e672e,_0x9ac198){_0x6e672e=_0x6e672e-0x0;var _0x117627=_0x5c95[_0x6e672e];return _0x117627;};'use strict';var express=require('express');var router=express[_0x55c9('0x0')]();var auth=require('../../components/auth/service');var interaction=require(_0x55c9('0x1'));var controller=require(_0x55c9('0x2'));router[_0x55c9('0x3')]('/',auth[_0x55c9('0x4')](),controller[_0x55c9('0x5')]);router[_0x55c9('0x3')](_0x55c9('0x6'),auth[_0x55c9('0x4')](),controller[_0x55c9('0x7')]);router[_0x55c9('0x3')](_0x55c9('0x8'),auth['isAuthenticated'](),controller[_0x55c9('0x9')]);router[_0x55c9('0x3')](_0x55c9('0xa'),auth[_0x55c9('0x4')](),controller[_0x55c9('0xb')]);router['get']('/:id/download',auth[_0x55c9('0x4')](),controller[_0x55c9('0xc')]);router[_0x55c9('0xd')]('/',auth['isAuthenticated'](),controller[_0x55c9('0xe')]);router[_0x55c9('0xd')]('/:id/messages',auth[_0x55c9('0x4')](),controller[_0x55c9('0xf')]);router[_0x55c9('0xd')](_0x55c9('0x10'),auth['isAuthenticated'](),interaction[_0x55c9('0x11')](_0x55c9('0x12'),_0x55c9('0x13')),controller['addTags']);router['put']('/:id',auth[_0x55c9('0x4')](),interaction['tracked'](_0x55c9('0x12'),_0x55c9('0x14')),controller['update']);router[_0x55c9('0x15')]('/:id',auth['isAuthenticated'](),interaction[_0x55c9('0x11')](_0x55c9('0x12'),'mailinteraction:destroy'),controller[_0x55c9('0x16')]);router[_0x55c9('0x15')](_0x55c9('0x10'),auth[_0x55c9('0x4')](),controller[_0x55c9('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index e594391..ea3230c 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 _0xf723=['out','INTEGER','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf723,0xa7));var _0x3f72=function(_0x3861f7,_0x995b22){_0x3861f7=_0x3861f7-0x0;var _0x50879f=_0xf723[_0x3861f7];return _0x50879f;};'use strict';var Sequelize=require(_0x3f72('0x0'));var iconv=require(_0x3f72('0x1'));module[_0x3f72('0x2')]={'closed':{'type':Sequelize[_0x3f72('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3f72('0x4')]},'disposition':{'type':Sequelize[_0x3f72('0x5')]},'secondDisposition':{'type':Sequelize[_0x3f72('0x5')]},'thirdDisposition':{'type':Sequelize[_0x3f72('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x3f72('0x5')]},'cc':{'type':Sequelize[_0x3f72('0x6')](_0x3f72('0x7'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3f72('0x4')]},'substatus':{'type':Sequelize[_0x3f72('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x3f72('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3f72('0x8')]('in',_0x3f72('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3f72('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x3f72('0x8')]('in',_0x3f72('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x3f72('0xa')]}}; \ No newline at end of file +var _0xa4b8=['ENUM','INTEGER','sequelize','iconv','exports','BOOLEAN','STRING','TEXT','DATE'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xa4b8,0x89));var _0x8a4b=function(_0x531980,_0x5c9867){_0x531980=_0x531980-0x0;var _0x35963e=_0xa4b8[_0x531980];return _0x35963e;};'use strict';var Sequelize=require(_0x8a4b('0x0'));var iconv=require(_0x8a4b('0x1'));module[_0x8a4b('0x2')]={'closed':{'type':Sequelize[_0x8a4b('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8a4b('0x4')]},'secondDisposition':{'type':Sequelize[_0x8a4b('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8a4b('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x8a4b('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x8a4b('0x5')]('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x8a4b('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x8a4b('0x6')]},'firstMsgDirection':{'type':Sequelize[_0x8a4b('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8a4b('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x8a4b('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8a4b('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x8a4b('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index dbbce4d..a9a28ee 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 _0x4e11=['intersection','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','MailMessage','hasOwnProperty','nolimit','sort','where','pick','MailInteractionId','filter','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','count','inlineCss','true','rows','setTags','spread','Tag','mailInteractionTags:save','removeTags','unix','join','root','server','tmp','files','attachments','Attachment','Attachments','Messages','from','bcc','subject','createdAt','mkdirSync','each','missing.recipient@your.company.com','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','push','readFileSync','build','message%d.eml','download','unlinkSync','eml-format','rimraf','moment','juice','ioredis','../../components/parsers/qs','../../config/logger','api','html-entities','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','json','then','destroy','name','index','MailInteraction','rawAttributes','fieldName','key','mail','user','catch','params','model','keys','filters','query','attributes'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x4e11,0xa6));var _0x14e1=function(_0x4a3d08,_0x30f5cf){_0x4a3d08=_0x4a3d08-0x0;var _0x2b9519=_0x4e11[_0x4a3d08];return _0x2b9519;};'use strict';var emlformat=require(_0x14e1('0x0'));var rimraf=require(_0x14e1('0x1'));var zipdir=require('zip-dir');var moment=require(_0x14e1('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require('path');var fs=require('fs');var _=require('lodash');var juice=require(_0x14e1('0x3'));var Redis=require(_0x14e1('0x4'));var interaction=require('../../components/interaction/service');var qs=require(_0x14e1('0x5'));var logger=require(_0x14e1('0x6'))(_0x14e1('0x7'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x14e1('0x8'));config[_0x14e1('0x9')]=_[_0x14e1('0xa')](config[_0x14e1('0x9')],{'host':_0x14e1('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x14e1('0x9')]));require(_0x14e1('0xc'))[_0x14e1('0xd')](socket);function respondWithStatusCode(_0x51fad9,_0x3d32c4){_0x3d32c4=_0x3d32c4||0xcc;return function(_0x37c5b9){if(_0x37c5b9){return _0x51fad9[_0x14e1('0xe')](_0x3d32c4);}return _0x51fad9[_0x14e1('0xf')](_0x3d32c4)[_0x14e1('0x10')]();};}function respondWithResult(_0x501601,_0x3d5b4b){_0x3d5b4b=_0x3d5b4b||0xc8;return function(_0x42b1a4){if(_0x42b1a4){return _0x501601[_0x14e1('0xf')](_0x3d5b4b)['json'](_0x42b1a4);}};}function respondWithFilteredResult(_0x10b38d,_0x172758){return function(_0x2efbf9){if(_0x2efbf9){var _0x30bea8=typeof _0x172758[_0x14e1('0x11')]==='undefined'&&typeof _0x172758['limit']===_0x14e1('0x12');var _0xbd716e=_0x2efbf9['count'];var _0x3f5155=_0x30bea8?0x0:_0x172758[_0x14e1('0x11')];var _0x1fcd87=_0x30bea8?_0x2efbf9['count']:_0x172758[_0x14e1('0x11')]+_0x172758[_0x14e1('0x13')];var _0x8423a4;if(_0x1fcd87>=_0xbd716e){_0x1fcd87=_0xbd716e;_0x8423a4=0xc8;}else{_0x8423a4=0xce;}_0x10b38d[_0x14e1('0xf')](_0x8423a4);return _0x10b38d['set']('Content-Range',_0x3f5155+'-'+_0x1fcd87+'/'+_0xbd716e)[_0x14e1('0x14')](_0x2efbf9);}return null;};}function saveUpdates(_0x40e5fa){return function(_0xde089c){if(_0xde089c){return _0xde089c['update'](_0x40e5fa)[_0x14e1('0x15')](function(_0x58904d){return _0x58904d;});}return null;};}function removeEntity(_0x5ce825){return function(_0x1ffa9e){if(_0x1ffa9e){return _0x1ffa9e[_0x14e1('0x16')]()[_0x14e1('0x15')](function(){_0x5ce825[_0x14e1('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a5639){return function(_0x446157){if(!_0x446157){_0x2a5639[_0x14e1('0xe')](0x194);}return _0x446157;};}function handleError(_0x196412,_0x36d25d){_0x36d25d=_0x36d25d||0x1f4;return function(_0x994562){logger['error'](_0x994562['stack']);if(_0x994562[_0x14e1('0x17')]){delete _0x994562['name'];}_0x196412[_0x14e1('0xf')](_0x36d25d)['send'](_0x994562);};}exports[_0x14e1('0x18')]=function(_0x449f66,_0x489385){var _0x280b68={};var _0x1e51b2=_['map'](db[_0x14e1('0x19')][_0x14e1('0x1a')],function(_0x34de2b){return{'name':_0x34de2b[_0x14e1('0x1b')],'type':_0x34de2b['type'][_0x14e1('0x1c')]};});_0x280b68=qs['getOptions'](_0x1e51b2,_0x449f66);return interaction['findAll'](_0x14e1('0x1d'),_0x449f66['query'],_0x449f66[_0x14e1('0x1e')],_0x280b68,_0x1e51b2)['then'](respondWithFilteredResult(_0x489385,_0x280b68))[_0x14e1('0x1f')](handleError(_0x489385,null));};exports['show']=function(_0x2a5821,_0xcc334f){var _0x288201={'raw':![],'where':{'id':_0x2a5821[_0x14e1('0x20')]['id']}},_0x5e5fcb={};_0x5e5fcb[_0x14e1('0x21')]=_[_0x14e1('0x22')](db[_0x14e1('0x19')][_0x14e1('0x1a')]);_0x5e5fcb['query']=_[_0x14e1('0x22')](_0x2a5821['query']);_0x5e5fcb[_0x14e1('0x23')]=_['intersection'](_0x5e5fcb['model'],_0x5e5fcb[_0x14e1('0x24')]);_0x288201[_0x14e1('0x25')]=_[_0x14e1('0x26')](_0x5e5fcb['model'],qs[_0x14e1('0x27')](_0x2a5821['query']['fields']));_0x288201['attributes']=_0x288201['attributes'][_0x14e1('0x28')]?_0x288201[_0x14e1('0x25')]:_0x5e5fcb[_0x14e1('0x21')];if(_0x2a5821[_0x14e1('0x24')][_0x14e1('0x29')]){_0x288201[_0x14e1('0x2a')]=[{'all':!![]}];}_0x288201=_[_0x14e1('0x2b')]({},_0x288201,_0x2a5821[_0x14e1('0x2c')]);return db[_0x14e1('0x19')][_0x14e1('0x2d')](_0x288201)[_0x14e1('0x15')](handleEntityNotFound(_0xcc334f,null))[_0x14e1('0x15')](respondWithResult(_0xcc334f,null))[_0x14e1('0x1f')](handleError(_0xcc334f,null));};exports[_0x14e1('0x2e')]=function(_0x54fa83,_0x58ef18){return db[_0x14e1('0x19')][_0x14e1('0x2e')](_0x54fa83[_0x14e1('0x2f')],{})[_0x14e1('0x15')](respondWithResult(_0x58ef18,0xc9))[_0x14e1('0x1f')](handleError(_0x58ef18,null));};exports['update']=function(_0x2667f4,_0x1b4be2){if(_0x2667f4['body']['id']){delete _0x2667f4[_0x14e1('0x2f')]['id'];}return db[_0x14e1('0x19')][_0x14e1('0x2d')]({'where':{'id':_0x2667f4[_0x14e1('0x20')]['id']}})['then'](handleEntityNotFound(_0x1b4be2,null))[_0x14e1('0x15')](saveUpdates(_0x2667f4[_0x14e1('0x2f')],null))[_0x14e1('0x15')](respondWithResult(_0x1b4be2,null))[_0x14e1('0x1f')](handleError(_0x1b4be2,null));};exports[_0x14e1('0x16')]=function(_0x447bfe,_0x27e993){return db[_0x14e1('0x19')][_0x14e1('0x2d')]({'where':{'id':_0x447bfe['params']['id']}})[_0x14e1('0x15')](handleEntityNotFound(_0x27e993,null))[_0x14e1('0x15')](removeEntity(_0x27e993,null))[_0x14e1('0x1f')](handleError(_0x27e993,null));};exports[_0x14e1('0x30')]=function(_0x2cf0d9,_0x4def3f){return db[_0x14e1('0x19')][_0x14e1('0x30')]()['then'](respondWithResult(_0x4def3f,null))[_0x14e1('0x1f')](handleError(_0x4def3f,null));};exports[_0x14e1('0x31')]=function(_0x48acc6,_0x5b4346){return db['MailMessage']['find']({'where':{'id':_0x48acc6['params']['id']}})[_0x14e1('0x15')](handleEntityNotFound(_0x5b4346,null))[_0x14e1('0x15')](function(_0x591d20){if(_0x591d20){return _0x591d20['addMessage'](_0x48acc6['body'][_0x14e1('0x32')],_[_0x14e1('0x33')](_0x48acc6[_0x14e1('0x2f')],[_0x14e1('0x32'),'id'])||{});}})[_0x14e1('0x15')](respondWithResult(_0x5b4346,null))['catch'](handleError(_0x5b4346,null));};exports[_0x14e1('0x34')]=function(_0x52a05d,_0x30ae78){var _0x127fcf={'raw':![],'where':{}};var _0x3de14d={};var _0x151e41={'count':0x0,'rows':[]};return db['MailInteraction'][_0x14e1('0x35')]({'where':{'id':_0x52a05d[_0x14e1('0x20')]['id']}})[_0x14e1('0x15')](handleEntityNotFound(_0x30ae78,null))[_0x14e1('0x15')](function(_0x20dc99){if(_0x20dc99){_0x3de14d[_0x14e1('0x21')]=_[_0x14e1('0x22')](db[_0x14e1('0x36')][_0x14e1('0x1a')]);_0x3de14d['query']=_['keys'](_0x52a05d[_0x14e1('0x24')]);_0x3de14d[_0x14e1('0x23')]=_['intersection'](_0x3de14d[_0x14e1('0x21')],_0x3de14d[_0x14e1('0x24')]);_0x127fcf['attributes']=_['intersection'](_0x3de14d['model'],qs[_0x14e1('0x27')](_0x52a05d['query']['fields']));_0x127fcf[_0x14e1('0x25')]=_0x127fcf[_0x14e1('0x25')][_0x14e1('0x28')]?_0x127fcf['attributes']:_0x3de14d[_0x14e1('0x21')];if(!_0x52a05d[_0x14e1('0x24')][_0x14e1('0x37')](_0x14e1('0x38'))){_0x127fcf[_0x14e1('0x13')]=qs[_0x14e1('0x13')](_0x52a05d['query'][_0x14e1('0x13')]);_0x127fcf[_0x14e1('0x11')]=qs['offset'](_0x52a05d[_0x14e1('0x24')][_0x14e1('0x11')]);}_0x127fcf['order']=qs[_0x14e1('0x39')](_0x52a05d[_0x14e1('0x24')][_0x14e1('0x39')]);_0x127fcf[_0x14e1('0x3a')]=qs[_0x14e1('0x23')](_[_0x14e1('0x3b')](_0x52a05d['query'],_0x3de14d['filters']));_0x127fcf[_0x14e1('0x3a')][_0x14e1('0x3c')]=_0x20dc99['id'];if(_0x52a05d[_0x14e1('0x24')][_0x14e1('0x3d')]){_0x127fcf[_0x14e1('0x3a')]=_[_0x14e1('0x2b')](_0x127fcf['where'],{'$or':_[_0x14e1('0x3e')](_0x127fcf[_0x14e1('0x25')],function(_0x8a6fc5){var _0x252900={};_0x252900[_0x8a6fc5]={'$like':'%'+_0x52a05d[_0x14e1('0x24')][_0x14e1('0x3d')]+'%'};return _0x252900;})});}if(_0x52a05d[_0x14e1('0x24')][_0x14e1('0x3f')]){var _0x3b00f2=_0x52a05d['query'][_0x14e1('0x3f')]['split'](',');var _0x4d5b05={};_0x4d5b05[_0x3b00f2[0x0]]={'$gte':moment(_0x3b00f2[0x1])[_0x14e1('0x40')](_0x14e1('0x41'))};_0x127fcf[_0x14e1('0x3a')]=_[_0x14e1('0x2b')](_0x127fcf[_0x14e1('0x3a')],_0x4d5b05);}_0x127fcf=_[_0x14e1('0x2b')]({},_0x127fcf,_0x52a05d[_0x14e1('0x2c')]);return db[_0x14e1('0x36')]['count']({'where':_0x127fcf[_0x14e1('0x3a')]})[_0x14e1('0x15')](function(_0x243223){_0x151e41[_0x14e1('0x42')]=_0x243223;if(_0x52a05d['query'][_0x14e1('0x29')]){_0x127fcf[_0x14e1('0x2a')]=[{'all':!![]}];}return db[_0x14e1('0x36')]['findAll'](_0x127fcf);})[_0x14e1('0x15')](function(_0x1ee8c7){if(_0x52a05d[_0x14e1('0x24')][_0x14e1('0x43')]===_0x14e1('0x44')){for(var _0x322562=0x0;_0x322562<_0x1ee8c7[_0x14e1('0x28')];_0x322562++){_0x1ee8c7[_0x322562][_0x14e1('0x2f')]=juice(_0x1ee8c7[_0x322562][_0x14e1('0x2f')]);}}_0x151e41[_0x14e1('0x45')]=_0x1ee8c7;return _0x151e41;});}})[_0x14e1('0x15')](respondWithFilteredResult(_0x30ae78,_0x127fcf))[_0x14e1('0x1f')](handleError(_0x30ae78,null));};exports['addTags']=function(_0x4a6aa7,_0x28b536){return db['MailInteraction'][_0x14e1('0x2d')]({'where':{'id':_0x4a6aa7[_0x14e1('0x20')]['id']}})[_0x14e1('0x15')](handleEntityNotFound(_0x28b536,null))[_0x14e1('0x15')](function(_0x4a0fbb){if(_0x4a0fbb){return _0x4a0fbb[_0x14e1('0x46')](_0x4a6aa7['body'][_0x14e1('0x32')],_[_0x14e1('0x33')](_0x4a6aa7[_0x14e1('0x2f')],[_0x14e1('0x32'),'id'])||{})[_0x14e1('0x47')](function(){return db[_0x14e1('0x48')]['findAll']({'attributes':['id',_0x14e1('0x17'),'color'],'where':{'id':_0x4a6aa7[_0x14e1('0x2f')][_0x14e1('0x32')]}});})[_0x14e1('0x15')](function(_0x488999){socket['emit'](_0x14e1('0x49'),{'id':Number(_0x4a6aa7[_0x14e1('0x20')]['id']),'tags':_0x488999||[]});return{'id':Number(_0x4a6aa7['params']['id']),'tags':_0x488999||[]};});}})['then'](respondWithResult(_0x28b536,null))[_0x14e1('0x1f')](handleError(_0x28b536,null));};exports[_0x14e1('0x4a')]=function(_0x3010a8,_0x28a61e){return db['MailInteraction'][_0x14e1('0x2d')]({'where':{'id':_0x3010a8[_0x14e1('0x20')]['id']}})[_0x14e1('0x15')](handleEntityNotFound(_0x28a61e,null))['then'](function(_0x18893e){if(_0x18893e){return _0x18893e[_0x14e1('0x4a')](_0x3010a8[_0x14e1('0x24')][_0x14e1('0x32')]);}})[_0x14e1('0x15')](respondWithStatusCode(_0x28a61e,null))['catch'](handleError(_0x28a61e,null));};exports['download']=function(_0x18da1a,_0x53e5d4){var _0x5afea5=moment()[_0x14e1('0x4b')]()['toString']();var _0x2fa49f=path[_0x14e1('0x4c')](config[_0x14e1('0x4d')],_0x14e1('0x4e'),'files',_0x14e1('0x4f'));var _0x50aa6d=path[_0x14e1('0x4c')](config['root'],'server',_0x14e1('0x50'),_0x14e1('0x51'));var _0x3ebc85=path[_0x14e1('0x4c')](_0x2fa49f,_0x5afea5);var _0x2face3=util[_0x14e1('0x40')]('transcript-%d-%s.zip',_0x18da1a[_0x14e1('0x20')]['id'],_0x5afea5);var _0x371f6f=path[_0x14e1('0x4c')](_0x2fa49f,_0x2face3);var _0x2f5ecb=[];if(_0x18da1a[_0x14e1('0x24')][_0x14e1('0x51')]){_0x2f5ecb['push']({'model':db[_0x14e1('0x52')],'as':_0x14e1('0x53'),'raw':!![]});}var _0x3cc4f5=[{'model':db[_0x14e1('0x36')],'as':_0x14e1('0x54'),'attributes':['id','body',_0x14e1('0x55'),'to','cc',_0x14e1('0x56'),_0x14e1('0x57'),_0x14e1('0x58')],'where':{'secret':![]},'order':qs[_0x14e1('0x39')]('id'),'include':_0x2f5ecb}];return db[_0x14e1('0x19')][_0x14e1('0x2d')]({'where':{'id':_0x18da1a[_0x14e1('0x20')]['id']},'include':_0x3cc4f5})['then'](handleEntityNotFound(_0x53e5d4,null))['then'](function(_0x1dee82){if(_0x1dee82&&_0x1dee82['Messages']){var _0xcf0def=_0x1dee82['get']({'plain':!![]});fs[_0x14e1('0x59')](_0x3ebc85);return BPromise[_0x14e1('0x5a')](_0xcf0def['Messages'],function(_0x5a87c4,_0x37a5c6){var _0x17ccdb={'from':_0x5a87c4[_0x14e1('0x55')],'to':_0x5a87c4['to']||_0x14e1('0x5b'),'subject':_0x5a87c4['subject'],'html':htmlEntities['decode'](_0x5a87c4['body']),'headers':{'Date':moment(_0x5a87c4[_0x14e1('0x58')])[_0x14e1('0x40')](_0x14e1('0x5c'))},'attachments':[]};if(_0x5a87c4['cc']){_0x17ccdb[_0x14e1('0x5d')]['Cc']=_0x5a87c4['cc'];}if(_0x5a87c4[_0x14e1('0x56')]){_0x17ccdb[_0x14e1('0x5d')][_0x14e1('0x5e')]=_0x5a87c4[_0x14e1('0x56')];}return new BPromise(function(_0x59d712,_0x18374b){if(_0x5a87c4[_0x14e1('0x53')]){for(var _0x211bd1=0x0;_0x211bd1<_0x5a87c4[_0x14e1('0x53')][_0x14e1('0x28')];_0x211bd1++){var _0x2df1d9=_0x5a87c4[_0x14e1('0x53')][_0x211bd1];var _0x466871=path[_0x14e1('0x4c')](_0x50aa6d,_0x2df1d9[_0x14e1('0x5f')]);if(fs['existsSync'](_0x466871)){_0x17ccdb[_0x14e1('0x51')][_0x14e1('0x60')]({'name':_0x2df1d9[_0x14e1('0x17')],'contentType':_0x2df1d9['type'],'data':fs[_0x14e1('0x61')](_0x466871)});}}}emlformat[_0x14e1('0x62')](_0x17ccdb,function(_0x3c66ad,_0x493c54){if(_0x3c66ad)return _0x18374b(_0x3c66ad);fs['writeFileSync'](path[_0x14e1('0x4c')](_0x3ebc85,util[_0x14e1('0x40')](_0x14e1('0x63'),_0x37a5c6)),_0x493c54);return _0x59d712(_0x493c54);});});})[_0x14e1('0x15')](function(){return new BPromise(function(_0x3f8903,_0x5f3119){zipdir(_0x3ebc85,{'saveTo':_0x371f6f},function(_0x1dcf86,_0x4e288a){if(_0x1dcf86)return _0x5f3119(_0x1dcf86);return _0x3f8903(_0x4e288a);});})[_0x14e1('0x15')](function(){return new BPromise(function(_0x5aea13,_0x45fb5f){rimraf(_0x3ebc85,function(_0x3218c1){if(_0x3218c1)_0x45fb5f(_0x3218c1);return _0x5aea13();});});})[_0x14e1('0x15')](function(){return _0x53e5d4[_0x14e1('0x64')](_0x371f6f,_0x2face3,function(_0x59c724){if(!_0x59c724)fs[_0x14e1('0x65')](_0x371f6f);});});});}else{return _0x53e5d4[_0x14e1('0xe')](0xc8);}})[_0x14e1('0x1f')](handleError(_0x53e5d4,null));}; \ No newline at end of file +var _0xfc2b=['get','mkdirSync','each','missing.recipient@your.company.com','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','then','destroy','error','stack','name','index','map','MailInteraction','rawAttributes','fieldName','type','getOptions','findAll','query','params','model','keys','filters','attributes','intersection','fields','includeAll','include','merge','catch','create','body','describe','addMessage','MailMessage','find','ids','omit','getMessages','findOne','length','hasOwnProperty','nolimit','sort','where','MailInteractionId','filter','$gte','split','format','count','inlineCss','true','addTags','setTags','Tag','color','emit','mailInteractionTags:save','removeTags','download','toString','join','root','files','tmp','server','attachments','push','Attachment','Attachments','Messages','from','bcc'];(function(_0x5ddedc,_0x4f6e32){var _0x3d5fc8=function(_0x3c9ed7){while(--_0x3c9ed7){_0x5ddedc['push'](_0x5ddedc['shift']());}};_0x3d5fc8(++_0x4f6e32);}(_0xfc2b,0x155));var _0xbfc2=function(_0x952282,_0x51a614){_0x952282=_0x952282-0x0;var _0x613507=_0xfc2b[_0x952282];return _0x613507;};'use strict';var emlformat=require(_0xbfc2('0x0'));var rimraf=require(_0xbfc2('0x1'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xbfc2('0x2'));var path=require('path');var fs=require('fs');var _=require(_0xbfc2('0x3'));var juice=require('juice');var Redis=require(_0xbfc2('0x4'));var interaction=require(_0xbfc2('0x5'));var qs=require(_0xbfc2('0x6'));var logger=require('../../config/logger')(_0xbfc2('0x7'));var config=require(_0xbfc2('0x8'));var db=require(_0xbfc2('0x9'))['db'];var htmlEntities=require(_0xbfc2('0xa'));config[_0xbfc2('0xb')]=_[_0xbfc2('0xc')](config[_0xbfc2('0xb')],{'host':_0xbfc2('0xd'),'port':0x18eb});var socket=require(_0xbfc2('0xe'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0xbfc2('0xf')](socket);function respondWithStatusCode(_0x33a70a,_0x5270d6){_0x5270d6=_0x5270d6||0xcc;return function(_0x349963){if(_0x349963){return _0x33a70a[_0xbfc2('0x10')](_0x5270d6);}return _0x33a70a[_0xbfc2('0x11')](_0x5270d6)[_0xbfc2('0x12')]();};}function respondWithResult(_0x22261f,_0x2aea17){_0x2aea17=_0x2aea17||0xc8;return function(_0xbdb150){if(_0xbdb150){return _0x22261f[_0xbfc2('0x11')](_0x2aea17)[_0xbfc2('0x13')](_0xbdb150);}};}function respondWithFilteredResult(_0x331677,_0x46a287){return function(_0x39abb1){if(_0x39abb1){var _0x2bf784=typeof _0x46a287[_0xbfc2('0x14')]===_0xbfc2('0x15')&&typeof _0x46a287[_0xbfc2('0x16')]==='undefined';var _0x1b7272=_0x39abb1['count'];var _0x53f1ae=_0x2bf784?0x0:_0x46a287['offset'];var _0x12380b=_0x2bf784?_0x39abb1['count']:_0x46a287[_0xbfc2('0x14')]+_0x46a287[_0xbfc2('0x16')];var _0x43d319;if(_0x12380b>=_0x1b7272){_0x12380b=_0x1b7272;_0x43d319=0xc8;}else{_0x43d319=0xce;}_0x331677[_0xbfc2('0x11')](_0x43d319);return _0x331677[_0xbfc2('0x17')](_0xbfc2('0x18'),_0x53f1ae+'-'+_0x12380b+'/'+_0x1b7272)[_0xbfc2('0x13')](_0x39abb1);}return null;};}function saveUpdates(_0x5e5954){return function(_0x4d543a){if(_0x4d543a){return _0x4d543a[_0xbfc2('0x19')](_0x5e5954)[_0xbfc2('0x1a')](function(_0x3f57db){return _0x3f57db;});}return null;};}function removeEntity(_0x469b7c){return function(_0x2e156d){if(_0x2e156d){return _0x2e156d[_0xbfc2('0x1b')]()[_0xbfc2('0x1a')](function(){_0x469b7c['status'](0xcc)[_0xbfc2('0x12')]();});}};}function handleEntityNotFound(_0x303b73){return function(_0x1876c6){if(!_0x1876c6){_0x303b73[_0xbfc2('0x10')](0x194);}return _0x1876c6;};}function handleError(_0x10e1a4,_0x3bcd46){_0x3bcd46=_0x3bcd46||0x1f4;return function(_0x1c18cf){logger[_0xbfc2('0x1c')](_0x1c18cf[_0xbfc2('0x1d')]);if(_0x1c18cf[_0xbfc2('0x1e')]){delete _0x1c18cf[_0xbfc2('0x1e')];}_0x10e1a4[_0xbfc2('0x11')](_0x3bcd46)['send'](_0x1c18cf);};}exports[_0xbfc2('0x1f')]=function(_0xd2c395,_0x1ca408){var _0x4431a5={};var _0x4f623a=_[_0xbfc2('0x20')](db[_0xbfc2('0x21')][_0xbfc2('0x22')],function(_0x3dd747){return{'name':_0x3dd747[_0xbfc2('0x23')],'type':_0x3dd747[_0xbfc2('0x24')]['key']};});_0x4431a5=qs[_0xbfc2('0x25')](_0x4f623a,_0xd2c395);return interaction[_0xbfc2('0x26')]('mail',_0xd2c395[_0xbfc2('0x27')],_0xd2c395['user'],_0x4431a5,_0x4f623a)['then'](respondWithFilteredResult(_0x1ca408,_0x4431a5))['catch'](handleError(_0x1ca408,null));};exports['show']=function(_0x581de4,_0x5060c9){var _0x91454e={'raw':![],'where':{'id':_0x581de4[_0xbfc2('0x28')]['id']}},_0x865a9={};_0x865a9[_0xbfc2('0x29')]=_[_0xbfc2('0x2a')](db[_0xbfc2('0x21')][_0xbfc2('0x22')]);_0x865a9[_0xbfc2('0x27')]=_[_0xbfc2('0x2a')](_0x581de4['query']);_0x865a9[_0xbfc2('0x2b')]=_['intersection'](_0x865a9[_0xbfc2('0x29')],_0x865a9['query']);_0x91454e[_0xbfc2('0x2c')]=_[_0xbfc2('0x2d')](_0x865a9[_0xbfc2('0x29')],qs['fields'](_0x581de4[_0xbfc2('0x27')][_0xbfc2('0x2e')]));_0x91454e[_0xbfc2('0x2c')]=_0x91454e[_0xbfc2('0x2c')]['length']?_0x91454e[_0xbfc2('0x2c')]:_0x865a9['model'];if(_0x581de4[_0xbfc2('0x27')][_0xbfc2('0x2f')]){_0x91454e[_0xbfc2('0x30')]=[{'all':!![]}];}_0x91454e=_[_0xbfc2('0x31')]({},_0x91454e,_0x581de4['options']);return db[_0xbfc2('0x21')]['find'](_0x91454e)[_0xbfc2('0x1a')](handleEntityNotFound(_0x5060c9,null))['then'](respondWithResult(_0x5060c9,null))[_0xbfc2('0x32')](handleError(_0x5060c9,null));};exports[_0xbfc2('0x33')]=function(_0x5cf5cf,_0x3b62cb){return db[_0xbfc2('0x21')][_0xbfc2('0x33')](_0x5cf5cf['body'],{})[_0xbfc2('0x1a')](respondWithResult(_0x3b62cb,0xc9))[_0xbfc2('0x32')](handleError(_0x3b62cb,null));};exports[_0xbfc2('0x19')]=function(_0x4a003b,_0x11c693){if(_0x4a003b[_0xbfc2('0x34')]['id']){delete _0x4a003b[_0xbfc2('0x34')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x4a003b[_0xbfc2('0x28')]['id']}})['then'](handleEntityNotFound(_0x11c693,null))[_0xbfc2('0x1a')](saveUpdates(_0x4a003b[_0xbfc2('0x34')],null))[_0xbfc2('0x1a')](respondWithResult(_0x11c693,null))[_0xbfc2('0x32')](handleError(_0x11c693,null));};exports['destroy']=function(_0x3223a6,_0x1fc4f2){return db['MailInteraction']['find']({'where':{'id':_0x3223a6['params']['id']}})[_0xbfc2('0x1a')](handleEntityNotFound(_0x1fc4f2,null))[_0xbfc2('0x1a')](removeEntity(_0x1fc4f2,null))[_0xbfc2('0x32')](handleError(_0x1fc4f2,null));};exports['describe']=function(_0x501095,_0x4a6b90){return db[_0xbfc2('0x21')][_0xbfc2('0x35')]()[_0xbfc2('0x1a')](respondWithResult(_0x4a6b90,null))[_0xbfc2('0x32')](handleError(_0x4a6b90,null));};exports[_0xbfc2('0x36')]=function(_0x468dfe,_0x580693){return db[_0xbfc2('0x37')][_0xbfc2('0x38')]({'where':{'id':_0x468dfe[_0xbfc2('0x28')]['id']}})['then'](handleEntityNotFound(_0x580693,null))[_0xbfc2('0x1a')](function(_0x14e4b4){if(_0x14e4b4){return _0x14e4b4[_0xbfc2('0x36')](_0x468dfe[_0xbfc2('0x34')][_0xbfc2('0x39')],_[_0xbfc2('0x3a')](_0x468dfe[_0xbfc2('0x34')],['ids','id'])||{});}})[_0xbfc2('0x1a')](respondWithResult(_0x580693,null))[_0xbfc2('0x32')](handleError(_0x580693,null));};exports[_0xbfc2('0x3b')]=function(_0x30a405,_0x64ae1f){var _0x14ad72={'raw':![],'where':{}};var _0xb48c29={};var _0x30e603={'count':0x0,'rows':[]};return db['MailInteraction'][_0xbfc2('0x3c')]({'where':{'id':_0x30a405[_0xbfc2('0x28')]['id']}})[_0xbfc2('0x1a')](handleEntityNotFound(_0x64ae1f,null))[_0xbfc2('0x1a')](function(_0x37b04a){if(_0x37b04a){_0xb48c29[_0xbfc2('0x29')]=_[_0xbfc2('0x2a')](db['MailMessage'][_0xbfc2('0x22')]);_0xb48c29[_0xbfc2('0x27')]=_['keys'](_0x30a405[_0xbfc2('0x27')]);_0xb48c29[_0xbfc2('0x2b')]=_[_0xbfc2('0x2d')](_0xb48c29[_0xbfc2('0x29')],_0xb48c29['query']);_0x14ad72['attributes']=_[_0xbfc2('0x2d')](_0xb48c29[_0xbfc2('0x29')],qs['fields'](_0x30a405[_0xbfc2('0x27')][_0xbfc2('0x2e')]));_0x14ad72['attributes']=_0x14ad72[_0xbfc2('0x2c')][_0xbfc2('0x3d')]?_0x14ad72[_0xbfc2('0x2c')]:_0xb48c29[_0xbfc2('0x29')];if(!_0x30a405['query'][_0xbfc2('0x3e')](_0xbfc2('0x3f'))){_0x14ad72['limit']=qs['limit'](_0x30a405[_0xbfc2('0x27')][_0xbfc2('0x16')]);_0x14ad72['offset']=qs['offset'](_0x30a405['query'][_0xbfc2('0x14')]);}_0x14ad72['order']=qs[_0xbfc2('0x40')](_0x30a405[_0xbfc2('0x27')]['sort']);_0x14ad72[_0xbfc2('0x41')]=qs[_0xbfc2('0x2b')](_['pick'](_0x30a405[_0xbfc2('0x27')],_0xb48c29[_0xbfc2('0x2b')]));_0x14ad72[_0xbfc2('0x41')][_0xbfc2('0x42')]=_0x37b04a['id'];if(_0x30a405[_0xbfc2('0x27')][_0xbfc2('0x43')]){_0x14ad72[_0xbfc2('0x41')]=_[_0xbfc2('0x31')](_0x14ad72[_0xbfc2('0x41')],{'$or':_[_0xbfc2('0x20')](_0x14ad72[_0xbfc2('0x2c')],function(_0x43ae40){var _0x5bcf1d={};_0x5bcf1d[_0x43ae40]={'$like':'%'+_0x30a405[_0xbfc2('0x27')]['filter']+'%'};return _0x5bcf1d;})});}if(_0x30a405[_0xbfc2('0x27')][_0xbfc2('0x44')]){var _0x4d48ab=_0x30a405[_0xbfc2('0x27')]['$gte'][_0xbfc2('0x45')](',');var _0x327991={};_0x327991[_0x4d48ab[0x0]]={'$gte':moment(_0x4d48ab[0x1])[_0xbfc2('0x46')]('YYYY-MM-DD\x20HH:mm:ss')};_0x14ad72['where']=_['merge'](_0x14ad72['where'],_0x327991);}_0x14ad72=_['merge']({},_0x14ad72,_0x30a405['options']);return db[_0xbfc2('0x37')][_0xbfc2('0x47')]({'where':_0x14ad72[_0xbfc2('0x41')]})[_0xbfc2('0x1a')](function(_0x1dfc30){_0x30e603['count']=_0x1dfc30;if(_0x30a405[_0xbfc2('0x27')][_0xbfc2('0x2f')]){_0x14ad72[_0xbfc2('0x30')]=[{'all':!![]}];}return db[_0xbfc2('0x37')][_0xbfc2('0x26')](_0x14ad72);})[_0xbfc2('0x1a')](function(_0xcb990c){if(_0x30a405[_0xbfc2('0x27')][_0xbfc2('0x48')]===_0xbfc2('0x49')){for(var _0xcdd0a4=0x0;_0xcdd0a4<_0xcb990c['length'];_0xcdd0a4++){_0xcb990c[_0xcdd0a4][_0xbfc2('0x34')]=juice(_0xcb990c[_0xcdd0a4]['body']);}}_0x30e603['rows']=_0xcb990c;return _0x30e603;});}})['then'](respondWithFilteredResult(_0x64ae1f,_0x14ad72))[_0xbfc2('0x32')](handleError(_0x64ae1f,null));};exports[_0xbfc2('0x4a')]=function(_0x5bec7a,_0x15e109){return db['MailInteraction'][_0xbfc2('0x38')]({'where':{'id':_0x5bec7a['params']['id']}})[_0xbfc2('0x1a')](handleEntityNotFound(_0x15e109,null))[_0xbfc2('0x1a')](function(_0x3954f2){if(_0x3954f2){return _0x3954f2[_0xbfc2('0x4b')](_0x5bec7a[_0xbfc2('0x34')][_0xbfc2('0x39')],_[_0xbfc2('0x3a')](_0x5bec7a[_0xbfc2('0x34')],[_0xbfc2('0x39'),'id'])||{})['spread'](function(){return db[_0xbfc2('0x4c')][_0xbfc2('0x26')]({'attributes':['id','name',_0xbfc2('0x4d')],'where':{'id':_0x5bec7a['body'][_0xbfc2('0x39')]}});})[_0xbfc2('0x1a')](function(_0x2c338a){socket[_0xbfc2('0x4e')](_0xbfc2('0x4f'),{'id':Number(_0x5bec7a[_0xbfc2('0x28')]['id']),'tags':_0x2c338a||[]});return{'id':Number(_0x5bec7a['params']['id']),'tags':_0x2c338a||[]};});}})[_0xbfc2('0x1a')](respondWithResult(_0x15e109,null))[_0xbfc2('0x32')](handleError(_0x15e109,null));};exports[_0xbfc2('0x50')]=function(_0x5ac5d3,_0x105f8e){return db[_0xbfc2('0x21')][_0xbfc2('0x38')]({'where':{'id':_0x5ac5d3['params']['id']}})[_0xbfc2('0x1a')](handleEntityNotFound(_0x105f8e,null))[_0xbfc2('0x1a')](function(_0x5dbcf6){if(_0x5dbcf6){return _0x5dbcf6[_0xbfc2('0x50')](_0x5ac5d3[_0xbfc2('0x27')][_0xbfc2('0x39')]);}})[_0xbfc2('0x1a')](respondWithStatusCode(_0x105f8e,null))[_0xbfc2('0x32')](handleError(_0x105f8e,null));};exports[_0xbfc2('0x51')]=function(_0x15a93f,_0x14da5e){var _0x2589a5=moment()['unix']()[_0xbfc2('0x52')]();var _0x57fc9b=path[_0xbfc2('0x53')](config[_0xbfc2('0x54')],'server',_0xbfc2('0x55'),_0xbfc2('0x56'));var _0x11eadd=path['join'](config[_0xbfc2('0x54')],_0xbfc2('0x57'),_0xbfc2('0x55'),_0xbfc2('0x58'));var _0x678b54=path[_0xbfc2('0x53')](_0x57fc9b,_0x2589a5);var _0x189386=util[_0xbfc2('0x46')]('transcript-%d-%s.zip',_0x15a93f[_0xbfc2('0x28')]['id'],_0x2589a5);var _0x3af586=path[_0xbfc2('0x53')](_0x57fc9b,_0x189386);var _0x205369=[];if(_0x15a93f[_0xbfc2('0x27')][_0xbfc2('0x58')]){_0x205369[_0xbfc2('0x59')]({'model':db[_0xbfc2('0x5a')],'as':_0xbfc2('0x5b'),'raw':!![]});}var _0x2121bb=[{'model':db[_0xbfc2('0x37')],'as':_0xbfc2('0x5c'),'attributes':['id',_0xbfc2('0x34'),_0xbfc2('0x5d'),'to','cc',_0xbfc2('0x5e'),'subject','createdAt'],'where':{'secret':![]},'order':qs[_0xbfc2('0x40')]('id'),'include':_0x205369}];return db['MailInteraction']['find']({'where':{'id':_0x15a93f[_0xbfc2('0x28')]['id']},'include':_0x2121bb})['then'](handleEntityNotFound(_0x14da5e,null))['then'](function(_0x1c9055){if(_0x1c9055&&_0x1c9055['Messages']){var _0x53a6ab=_0x1c9055[_0xbfc2('0x5f')]({'plain':!![]});fs[_0xbfc2('0x60')](_0x678b54);return BPromise[_0xbfc2('0x61')](_0x53a6ab[_0xbfc2('0x5c')],function(_0x3c481f,_0x3b59db){var _0x41629f={'from':_0x3c481f[_0xbfc2('0x5d')],'to':_0x3c481f['to']||_0xbfc2('0x62'),'subject':_0x3c481f[_0xbfc2('0x63')],'html':htmlEntities[_0xbfc2('0x64')](_0x3c481f[_0xbfc2('0x34')]),'headers':{'Date':moment(_0x3c481f['createdAt'])[_0xbfc2('0x46')](_0xbfc2('0x65'))},'attachments':[]};if(_0x3c481f['cc']){_0x41629f[_0xbfc2('0x66')]['Cc']=_0x3c481f['cc'];}if(_0x3c481f[_0xbfc2('0x5e')]){_0x41629f[_0xbfc2('0x66')]['Bcc']=_0x3c481f[_0xbfc2('0x5e')];}return new BPromise(function(_0x476fb5,_0x1f22b8){if(_0x3c481f[_0xbfc2('0x5b')]){for(var _0x14da55=0x0;_0x14da55<_0x3c481f[_0xbfc2('0x5b')][_0xbfc2('0x3d')];_0x14da55++){var _0x57cf40=_0x3c481f[_0xbfc2('0x5b')][_0x14da55];var _0x111f9c=path[_0xbfc2('0x53')](_0x11eadd,_0x57cf40[_0xbfc2('0x67')]);if(fs[_0xbfc2('0x68')](_0x111f9c)){_0x41629f[_0xbfc2('0x58')][_0xbfc2('0x59')]({'name':_0x57cf40[_0xbfc2('0x1e')],'contentType':_0x57cf40[_0xbfc2('0x24')],'data':fs['readFileSync'](_0x111f9c)});}}}emlformat[_0xbfc2('0x69')](_0x41629f,function(_0x33da93,_0x2dd7af){if(_0x33da93)return _0x1f22b8(_0x33da93);fs[_0xbfc2('0x6a')](path['join'](_0x678b54,util[_0xbfc2('0x46')](_0xbfc2('0x6b'),_0x3b59db)),_0x2dd7af);return _0x476fb5(_0x2dd7af);});});})[_0xbfc2('0x1a')](function(){return new BPromise(function(_0x22888b,_0x5ba9bc){zipdir(_0x678b54,{'saveTo':_0x3af586},function(_0xc8626b,_0x14ba5c){if(_0xc8626b)return _0x5ba9bc(_0xc8626b);return _0x22888b(_0x14ba5c);});})['then'](function(){return new BPromise(function(_0x5f5020,_0x53f749){rimraf(_0x678b54,function(_0x72607f){if(_0x72607f)_0x53f749(_0x72607f);return _0x5f5020();});});})[_0xbfc2('0x1a')](function(){return _0x14da5e[_0xbfc2('0x51')](_0x3af586,_0x189386,function(_0x3cbc46){if(!_0x3cbc46)fs[_0xbfc2('0x6c')](_0x3af586);});});});}else{return _0x14da5e[_0xbfc2('0x10')](0xc8);}})[_0xbfc2('0x32')](handleError(_0x14da5e,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index d1a202c..df02d7e 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 _0xd44e=['Users','map','unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','MailInteraction','setMaxListeners','save','update','remove','then','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd44e,0x68));var _0xed44=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd44e[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xed44('0x0'))['db'][_0xed44('0x1')];var MailMessage=require(_0xed44('0x0'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xed44('0x2')](0x0);var events={'afterCreate':_0xed44('0x3'),'afterUpdate':_0xed44('0x4'),'afterDestroy':_0xed44('0x5')};function emitEvent(_0x3eed45){return function(_0x5da30a,_0x549658,_0xc41d6a){_0x5da30a['getUsers']({'attributes':['id'],'raw':!![]})[_0xed44('0x6')](function(_0x2d22d1){_0x5da30a[_0xed44('0x7')](_0xed44('0x8'),_0x2d22d1[_0xed44('0x9')](function(_0x219943){return{'id':_0x219943['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x5da30a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xed44('0x6')](function(_0x5b801a){_0x5da30a['setDataValue'](_0xed44('0xa'),_0x5b801a['length']);MailInteractionEvents[_0xed44('0xb')](_0x3eed45+':'+_0x5da30a['id'],_0x5da30a);MailInteractionEvents['emit'](_0x3eed45,_0x5da30a);_0xc41d6a(null);})[_0xed44('0xc')](_0xc41d6a(null));};}for(var e in events){if(events[_0xed44('0xd')](e)){var event=events[e];MailInteraction[_0xed44('0xe')](e,emitEvent(event));}}module[_0xed44('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0xb776=['catch','hasOwnProperty','hook','exports','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x1858d1,_0xe16bfb){var _0x3a4ea7=function(_0x2685d3){while(--_0x2685d3){_0x1858d1['push'](_0x1858d1['shift']());}};_0x3a4ea7(++_0xe16bfb);}(_0xb776,0x1b9));var _0x6b77=function(_0x21760b,_0x5865b2){_0x21760b=_0x21760b-0x0;var _0xdbaae0=_0xb776[_0x21760b];return _0xdbaae0;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0x6b77('0x0')];var MailMessage=require(_0x6b77('0x1'))['db'][_0x6b77('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6b77('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6b77('0x4'),'afterDestroy':_0x6b77('0x5')};function emitEvent(_0x1354bc){return function(_0x1ea418,_0x5b5ea4,_0x3b9e1c){_0x1ea418[_0x6b77('0x6')]({'attributes':['id'],'raw':!![]})[_0x6b77('0x7')](function(_0x2f8f06){_0x1ea418[_0x6b77('0x8')](_0x6b77('0x9'),_0x2f8f06[_0x6b77('0xa')](function(_0x19e67b){return{'id':_0x19e67b['id']};}));return MailMessage[_0x6b77('0xb')]({'where':{'MailInteractionId':_0x1ea418['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6b77('0x7')](function(_0x9c34a8){_0x1ea418[_0x6b77('0x8')](_0x6b77('0xc'),_0x9c34a8[_0x6b77('0xd')]);MailInteractionEvents['emit'](_0x1354bc+':'+_0x1ea418['id'],_0x1ea418);MailInteractionEvents[_0x6b77('0xe')](_0x1354bc,_0x1ea418);_0x3b9e1c(null);})[_0x6b77('0xf')](_0x3b9e1c(null));};}for(var e in events){if(events[_0x6b77('0x10')](e)){var event=events[e];MailInteraction[_0x6b77('0x11')](e,emitEvent(event));}}module[_0x6b77('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 792bc44..6006cf2 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 _0xddb4=['update','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','./mailInteraction.attributes','exports','define','fti_mail_interactions','subject','FULLTEXT','substatus','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','substatusAt','changed','models'];(function(_0x272d1d,_0x3ec10e){var _0x35f59b=function(_0x4ffd51){while(--_0x4ffd51){_0x272d1d['push'](_0x272d1d['shift']());}};_0x35f59b(++_0x3ec10e);}(_0xddb4,0x123));var _0x4ddb=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0xddb4[_0x2f62aa];return _0x1a341f;};'use strict';var _=require(_0x4ddb('0x0'));var util=require(_0x4ddb('0x1'));var logger=require(_0x4ddb('0x2'))(_0x4ddb('0x3'));var moment=require('moment');var BPromise=require(_0x4ddb('0x4'));var rp=require(_0x4ddb('0x5'));var fs=require('fs');var path=require(_0x4ddb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4ddb('0x7'));module[_0x4ddb('0x8')]=function(_0x4d94dd,_0x237b1a){return _0x4d94dd[_0x4ddb('0x9')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x4ddb('0xa'),'fields':[_0x4ddb('0xb'),'to'],'type':_0x4ddb('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x970f7c,_0x224405,_0x441675){if(_0x970f7c[_0x4ddb('0xd')]){_0x970f7c['substatusAt']=moment()[_0x4ddb('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x970f7c[_0x4ddb('0xf')]){_0x970f7c[_0x4ddb('0x10')]=moment()[_0x4ddb('0xe')](_0x4ddb('0x11'));}_0x441675(null,_0x224405);},'beforeUpdate':function(_0x40cfde,_0x713d80,_0x2ade45){if(_0x40cfde['changed']('substatus')){_0x40cfde[_0x4ddb('0x12')]=_0x40cfde[_0x4ddb('0xd')]?moment()[_0x4ddb('0xe')](_0x4ddb('0x11')):null;}if(_0x40cfde[_0x4ddb('0x13')](_0x4ddb('0xf'))){_0x40cfde[_0x4ddb('0x10')]=moment()[_0x4ddb('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0x40cfde[_0x4ddb('0xd')]=null;_0x40cfde[_0x4ddb('0x12')]=null;}_0x2ade45(null,_0x40cfde);},'afterUpdate':function(_0x8f83d2,_0x5c0e09,_0x15939f){var _0x29e3de=_0x4d94dd[_0x4ddb('0x14')];var _0x107858=_0x8f83d2['get']({'plain':!![]});if(_0x107858[_0x4ddb('0xf')]){return _0x29e3de['MailMessage'][_0x4ddb('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x107858['id']}})['then'](function(){_0x15939f();})['catch'](function(_0x3c5cbc){_0x15939f(_0x3c5cbc);});}else{_0x15939f();}}},'charset':_0x4ddb('0x16'),'collate':_0x4ddb('0x17')});}; \ No newline at end of file +var _0x916f=['get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','define','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','closedAt','models'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x916f,0x1c1));var _0xf916=function(_0x599eee,_0x154fb0){_0x599eee=_0x599eee-0x0;var _0x266943=_0x916f[_0x599eee];return _0x266943;};'use strict';var _=require(_0xf916('0x0'));var util=require('util');var logger=require(_0xf916('0x1'))('api');var moment=require(_0xf916('0x2'));var BPromise=require(_0xf916('0x3'));var rp=require(_0xf916('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf916('0x5'));var config=require(_0xf916('0x6'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x29544d,_0x55dd54){return _0x29544d[_0xf916('0x7')]('MailInteraction',attributes,{'tableName':_0xf916('0x8'),'paranoid':![],'indexes':[{'name':_0xf916('0x9'),'fields':[_0xf916('0xa'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4fb93e,_0x2f4c30,_0x59224b){if(_0x4fb93e[_0xf916('0xb')]){_0x4fb93e[_0xf916('0xc')]=moment()[_0xf916('0xd')](_0xf916('0xe'));}if(_0x4fb93e[_0xf916('0xf')]){_0x4fb93e['closedAt']=moment()['format'](_0xf916('0xe'));}_0x59224b(null,_0x2f4c30);},'beforeUpdate':function(_0x2c29d6,_0x5c82cc,_0x33a3e5){if(_0x2c29d6[_0xf916('0x10')](_0xf916('0xb'))){_0x2c29d6[_0xf916('0xc')]=_0x2c29d6[_0xf916('0xb')]?moment()[_0xf916('0xd')](_0xf916('0xe')):null;}if(_0x2c29d6[_0xf916('0x10')](_0xf916('0xf'))){_0x2c29d6[_0xf916('0x11')]=moment()[_0xf916('0xd')](_0xf916('0xe'));_0x2c29d6[_0xf916('0xb')]=null;_0x2c29d6[_0xf916('0xc')]=null;}_0x33a3e5(null,_0x2c29d6);},'afterUpdate':function(_0x17f379,_0x13e042,_0x5867fb){var _0x22792f=_0x29544d[_0xf916('0x12')];var _0x22e393=_0x17f379[_0xf916('0x13')]({'plain':!![]});if(_0x22e393[_0xf916('0xf')]){return _0x22792f[_0xf916('0x14')][_0xf916('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x22e393['id']}})[_0xf916('0x16')](function(){_0x5867fb();})[_0xf916('0x17')](function(_0x310c18){_0x5867fb(_0x310c18);});}else{_0x5867fb();}}},'charset':_0xf916('0x18'),'collate':_0xf916('0x19')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index ed455ff..97dd7fb 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 _0xf446=['find','ids','omit','spread','AddTags','debug','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','redis','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailInteraction','body','options','raw','where','limit','UpdateMailInteraction','AddTagsToMailInteraction'];(function(_0x39e6fb,_0xb28aaa){var _0x15fd8f=function(_0x1790ed){while(--_0x1790ed){_0x39e6fb['push'](_0x39e6fb['shift']());}};_0x15fd8f(++_0xb28aaa);}(_0xf446,0x1c0));var _0x6f44=function(_0x244e02,_0xca80c3){_0x244e02=_0x244e02-0x0;var _0x35ea64=_0xf446[_0x244e02];return _0x35ea64;};'use strict';var _=require(_0x6f44('0x0'));var util=require('util');var moment=require(_0x6f44('0x1'));var BPromise=require(_0x6f44('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f44('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f44('0x4'));var logger=require(_0x6f44('0x5'))('rpc');var config=require(_0x6f44('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x6f44('0x7')]=_['defaults'](config[_0x6f44('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6f44('0x7')]));require('./mailInteraction.socket')[_0x6f44('0x8')](socket);function respondWithRpcPromise(_0x290e60,_0x3879cb,_0x2dfe9d){return new BPromise(function(_0xf9405a,_0x35ec9b){return client[_0x6f44('0x9')](_0x290e60,_0x2dfe9d)[_0x6f44('0xa')](function(_0x4b5907){logger[_0x6f44('0xb')](_0x6f44('0xc'),_0x3879cb,_0x6f44('0xd'));logger['debug'](_0x6f44('0xe'),_0x3879cb,_0x6f44('0xd'),JSON[_0x6f44('0xf')](_0x4b5907));if(_0x4b5907[_0x6f44('0x10')]){if(_0x4b5907['error'][_0x6f44('0x11')]===0x1f4){logger['error'](_0x6f44('0xc'),_0x3879cb,_0x4b5907['error']['message']);return _0x35ec9b(_0x4b5907[_0x6f44('0x10')][_0x6f44('0x12')]);}logger[_0x6f44('0x10')](_0x6f44('0xc'),_0x3879cb,_0x4b5907[_0x6f44('0x10')][_0x6f44('0x12')]);return _0xf9405a(_0x4b5907[_0x6f44('0x10')][_0x6f44('0x12')]);}else{logger[_0x6f44('0xb')](_0x6f44('0xc'),_0x3879cb,_0x6f44('0xd'));_0xf9405a(_0x4b5907['result'][_0x6f44('0x12')]);}})[_0x6f44('0x13')](function(_0x40f74c){logger[_0x6f44('0x10')](_0x6f44('0xc'),_0x3879cb,_0x40f74c);_0x35ec9b(_0x40f74c);});});}exports['UpdateMailInteraction']=function(_0x1f4411){var _0x596924=this;return new Promise(function(_0x43ca38,_0x57d6a2){return db[_0x6f44('0x14')]['update'](_0x1f4411[_0x6f44('0x15')],{'raw':_0x1f4411[_0x6f44('0x16')]?_0x1f4411[_0x6f44('0x16')][_0x6f44('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f4411[_0x6f44('0x16')]?_0x1f4411[_0x6f44('0x16')][_0x6f44('0x18')]||null:null,'attributes':_0x1f4411[_0x6f44('0x16')]?_0x1f4411[_0x6f44('0x16')]['attributes']||null:null,'limit':_0x1f4411['options']?_0x1f4411[_0x6f44('0x16')][_0x6f44('0x19')]||null:null})[_0x6f44('0xa')](function(_0x3cdc68){logger[_0x6f44('0xb')](_0x6f44('0x1a'),_0x1f4411);logger['debug'](_0x6f44('0x1a'),_0x1f4411,JSON[_0x6f44('0xf')](_0x3cdc68));_0x43ca38(_0x3cdc68);})['catch'](function(_0x568f8b){logger[_0x6f44('0x10')](_0x6f44('0x1a'),_0x568f8b[_0x6f44('0x12')],_0x1f4411);_0x57d6a2(_0x596924[_0x6f44('0x10')](0x1f4,_0x568f8b[_0x6f44('0x12')]));});});};exports[_0x6f44('0x1b')]=function(_0x4c994b){return new Promise(function(_0x2de691,_0x47feea){return db[_0x6f44('0x14')][_0x6f44('0x1c')]({'where':_0x4c994b[_0x6f44('0x16')]?_0x4c994b['options'][_0x6f44('0x18')]||null:null})[_0x6f44('0xa')](function(_0x4351ff){if(_0x4351ff){return _0x4351ff['addTags'](_0x4c994b['body'][_0x6f44('0x1d')],_[_0x6f44('0x1e')](_0x4c994b[_0x6f44('0x15')],['ids','id'])||{});}})[_0x6f44('0x1f')](function(_0x2a7c8b){logger[_0x6f44('0xb')](_0x6f44('0x20'),_0x4c994b);logger[_0x6f44('0x21')](_0x6f44('0x20'),_0x4c994b,JSON[_0x6f44('0xf')](_0x2a7c8b));_0x2de691(_0x2a7c8b);})[_0x6f44('0x13')](function(_0x222297){logger[_0x6f44('0x10')](_0x6f44('0x20'),_0x222297[_0x6f44('0x12')],_0x4c994b);_0x47feea(_this['error'](0x1f4,_0x222297['message']));});});}; \ No newline at end of file +var _0x3f2b=['MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','limit','AddTagsToMailInteraction','body','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info'];(function(_0x26d561,_0x32d756){var _0x1c8f0=function(_0x2301e5){while(--_0x2301e5){_0x26d561['push'](_0x26d561['shift']());}};_0x1c8f0(++_0x32d756);}(_0x3f2b,0x13c));var _0xb3f2=function(_0x135089,_0x510599){_0x135089=_0x135089-0x0;var _0x309b93=_0x3f2b[_0x135089];return _0x309b93;};'use strict';var _=require(_0xb3f2('0x0'));var util=require(_0xb3f2('0x1'));var moment=require(_0xb3f2('0x2'));var BPromise=require(_0xb3f2('0x3'));var rs=require(_0xb3f2('0x4'));var fs=require('fs');var Redis=require(_0xb3f2('0x5'));var db=require(_0xb3f2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb3f2('0x7'))(_0xb3f2('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb3f2('0x9')][_0xb3f2('0xa')]({'port':0x232a});config[_0xb3f2('0xb')]=_[_0xb3f2('0xc')](config[_0xb3f2('0xb')],{'host':_0xb3f2('0xd'),'port':0x18eb});var socket=require(_0xb3f2('0xe'))(new Redis(config['redis']));require(_0xb3f2('0xf'))[_0xb3f2('0x10')](socket);function respondWithRpcPromise(_0x145546,_0x419597,_0x162b49){return new BPromise(function(_0xf0f91e,_0xbd4ea2){return client[_0xb3f2('0x11')](_0x145546,_0x162b49)[_0xb3f2('0x12')](function(_0x4355e1){logger[_0xb3f2('0x13')](_0xb3f2('0x14'),_0x419597,_0xb3f2('0x15'));logger[_0xb3f2('0x16')](_0xb3f2('0x17'),_0x419597,_0xb3f2('0x15'),JSON[_0xb3f2('0x18')](_0x4355e1));if(_0x4355e1[_0xb3f2('0x19')]){if(_0x4355e1['error'][_0xb3f2('0x1a')]===0x1f4){logger[_0xb3f2('0x19')]('MailInteraction,\x20%s,\x20%s',_0x419597,_0x4355e1['error'][_0xb3f2('0x1b')]);return _0xbd4ea2(_0x4355e1['error']['message']);}logger[_0xb3f2('0x19')]('MailInteraction,\x20%s,\x20%s',_0x419597,_0x4355e1[_0xb3f2('0x19')]['message']);return _0xf0f91e(_0x4355e1['error'][_0xb3f2('0x1b')]);}else{logger[_0xb3f2('0x13')]('MailInteraction,\x20%s,\x20%s',_0x419597,_0xb3f2('0x15'));_0xf0f91e(_0x4355e1[_0xb3f2('0x1c')][_0xb3f2('0x1b')]);}})[_0xb3f2('0x1d')](function(_0x10cf35){logger[_0xb3f2('0x19')](_0xb3f2('0x14'),_0x419597,_0x10cf35);_0xbd4ea2(_0x10cf35);});});}exports[_0xb3f2('0x1e')]=function(_0x16b811){var _0x557b86=this;return new Promise(function(_0x30726f,_0x50cf53){return db[_0xb3f2('0x1f')][_0xb3f2('0x20')](_0x16b811['body'],{'raw':_0x16b811['options']?_0x16b811[_0xb3f2('0x21')][_0xb3f2('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16b811[_0xb3f2('0x21')]?_0x16b811[_0xb3f2('0x21')][_0xb3f2('0x23')]||null:null,'attributes':_0x16b811[_0xb3f2('0x21')]?_0x16b811[_0xb3f2('0x21')]['attributes']||null:null,'limit':_0x16b811[_0xb3f2('0x21')]?_0x16b811['options'][_0xb3f2('0x24')]||null:null})[_0xb3f2('0x12')](function(_0x378ebb){logger[_0xb3f2('0x13')](_0xb3f2('0x1e'),_0x16b811);logger[_0xb3f2('0x16')](_0xb3f2('0x1e'),_0x16b811,JSON['stringify'](_0x378ebb));_0x30726f(_0x378ebb);})['catch'](function(_0x1b5a6b){logger[_0xb3f2('0x19')](_0xb3f2('0x1e'),_0x1b5a6b['message'],_0x16b811);_0x50cf53(_0x557b86[_0xb3f2('0x19')](0x1f4,_0x1b5a6b[_0xb3f2('0x1b')]));});});};exports[_0xb3f2('0x25')]=function(_0x416cf5){return new Promise(function(_0x2f0ec8,_0x1e05cd){return db[_0xb3f2('0x1f')]['find']({'where':_0x416cf5[_0xb3f2('0x21')]?_0x416cf5['options'][_0xb3f2('0x23')]||null:null})[_0xb3f2('0x12')](function(_0x23ff7c){if(_0x23ff7c){return _0x23ff7c['addTags'](_0x416cf5[_0xb3f2('0x26')][_0xb3f2('0x27')],_['omit'](_0x416cf5[_0xb3f2('0x26')],[_0xb3f2('0x27'),'id'])||{});}})[_0xb3f2('0x28')](function(_0xd35cc6){logger[_0xb3f2('0x13')](_0xb3f2('0x29'),_0x416cf5);logger['debug'](_0xb3f2('0x29'),_0x416cf5,JSON[_0xb3f2('0x18')](_0xd35cc6));_0x2f0ec8(_0xd35cc6);})[_0xb3f2('0x1d')](function(_0x37e63c){logger[_0xb3f2('0x19')](_0xb3f2('0x29'),_0x37e63c[_0xb3f2('0x1b')],_0x416cf5);_0x1e05cd(_this[_0xb3f2('0x19')](0x1f4,_0x37e63c[_0xb3f2('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 7471342..33f2cbd 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 _0xb283=['emit','removeListener','register','length','./mailInteraction.events','save','remove','update'];(function(_0x6e66d7,_0x2ea0f3){var _0x94ff03=function(_0x5bbb04){while(--_0x5bbb04){_0x6e66d7['push'](_0x6e66d7['shift']());}};_0x94ff03(++_0x2ea0f3);}(_0xb283,0x164));var _0x3b28=function(_0x4d7293,_0x185712){_0x4d7293=_0x4d7293-0x0;var _0x55a59d=_0xb283[_0x4d7293];return _0x55a59d;};'use strict';var MailInteractionEvents=require(_0x3b28('0x0'));var events=[_0x3b28('0x1'),_0x3b28('0x2'),_0x3b28('0x3')];function createListener(_0x815932,_0x29ab23){return function(_0x19e1da){_0x29ab23[_0x3b28('0x4')](_0x815932,_0x19e1da);};}function removeListener(_0x5ab7f4,_0x34d1d7){return function(){MailInteractionEvents[_0x3b28('0x5')](_0x5ab7f4,_0x34d1d7);};}exports[_0x3b28('0x6')]=function(_0x5f5395){for(var _0x226343=0x0,_0x1d4be5=events[_0x3b28('0x7')];_0x226343<_0x1d4be5;_0x226343++){var _0x525404=events[_0x226343];var _0x3bce57=createListener('mailInteraction:'+_0x525404,_0x5f5395);MailInteractionEvents['on'](_0x525404,_0x3bce57);}}; \ No newline at end of file +var _0x3afc=['save','update','emit','removeListener','register','length'];(function(_0xb4fcb5,_0x3eab2f){var _0x300bdd=function(_0x246d9c){while(--_0x246d9c){_0xb4fcb5['push'](_0xb4fcb5['shift']());}};_0x300bdd(++_0x3eab2f);}(_0x3afc,0x174));var _0xc3af=function(_0x15d183,_0x54eb01){_0x15d183=_0x15d183-0x0;var _0x246a4c=_0x3afc[_0x15d183];return _0x246a4c;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xc3af('0x0'),'remove',_0xc3af('0x1')];function createListener(_0x59edca,_0x187912){return function(_0x2a5987){_0x187912[_0xc3af('0x2')](_0x59edca,_0x2a5987);};}function removeListener(_0x4c3efa,_0x10429e){return function(){MailInteractionEvents[_0xc3af('0x3')](_0x4c3efa,_0x10429e);};}exports[_0xc3af('0x4')]=function(_0x260ac2){for(var _0x1623d=0x0,_0x56ff6a=events[_0xc3af('0x5')];_0x1623d<_0x56ff6a;_0x1623d++){var _0x1f8763=events[_0x1623d];var _0x413750=createListener('mailInteraction:'+_0x1f8763,_0x260ac2);MailInteractionEvents['on'](_0x1f8763,_0x413750);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 72c1735..fdd65dd 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 _0x423c=['fs-extra','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','show','/:id/download','post','tracked','mailmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x2a7849,_0x4adc0e){var _0x39f133=function(_0x1f8aef){while(--_0x1f8aef){_0x2a7849['push'](_0x2a7849['shift']());}};_0x39f133(++_0x4adc0e);}(_0x423c,0x91));var _0xc423=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x423c[_0x68c979];return _0x4f0001;};'use strict';var multer=require(_0xc423('0x0'));var util=require('util');var path=require(_0xc423('0x1'));var timeout=require(_0xc423('0x2'));var express=require(_0xc423('0x3'));var router=express[_0xc423('0x4')]();var fs_extra=require(_0xc423('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc423('0x6'));var controller=require(_0xc423('0x7'));router[_0xc423('0x8')]('/',auth[_0xc423('0x9')](),controller['index']);router[_0xc423('0x8')](_0xc423('0xa'),auth[_0xc423('0x9')](),controller['describe']);router['get']('/:id',auth[_0xc423('0x9')](),controller[_0xc423('0xb')]);router['get'](_0xc423('0xc'),auth[_0xc423('0x9')](),controller['download']);router[_0xc423('0xd')]('/',auth['isAuthenticated'](),interaction[_0xc423('0xe')]('mail',_0xc423('0xf')),controller['create']);router[_0xc423('0x10')]('/:id',auth[_0xc423('0x9')](),controller[_0xc423('0x11')]);router[_0xc423('0x10')](_0xc423('0x12'),auth[_0xc423('0x9')](),controller[_0xc423('0x13')]);router[_0xc423('0x10')](_0xc423('0x14'),auth[_0xc423('0x9')](),controller[_0xc423('0x15')]);router[_0xc423('0x16')]('/:id',auth[_0xc423('0x9')](),controller[_0xc423('0x17')]);module[_0xc423('0x18')]=router; \ No newline at end of file +var _0x4133=['../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','mailmessage:create','create','put','accept','/:id/reject','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2576bc,_0x40be2c){var _0x5038f1=function(_0x4c6334){while(--_0x4c6334){_0x2576bc['push'](_0x2576bc['shift']());}};_0x5038f1(++_0x40be2c);}(_0x4133,0x17a));var _0x3413=function(_0x484a09,_0x31b700){_0x484a09=_0x484a09-0x0;var _0x16ea35=_0x4133[_0x484a09];return _0x16ea35;};'use strict';var multer=require(_0x3413('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3413('0x1'));var express=require(_0x3413('0x2'));var router=express[_0x3413('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3413('0x4'));var interaction=require(_0x3413('0x5'));var config=require(_0x3413('0x6'));var controller=require(_0x3413('0x7'));router[_0x3413('0x8')]('/',auth[_0x3413('0x9')](),controller[_0x3413('0xa')]);router[_0x3413('0x8')](_0x3413('0xb'),auth[_0x3413('0x9')](),controller[_0x3413('0xc')]);router[_0x3413('0x8')](_0x3413('0xd'),auth[_0x3413('0x9')](),controller[_0x3413('0xe')]);router[_0x3413('0x8')](_0x3413('0xf'),auth[_0x3413('0x9')](),controller['download']);router[_0x3413('0x10')]('/',auth['isAuthenticated'](),interaction['tracked']('mail',_0x3413('0x11')),controller[_0x3413('0x12')]);router[_0x3413('0x13')](_0x3413('0xd'),auth['isAuthenticated'](),controller['update']);router['put']('/:id/accept',auth[_0x3413('0x9')](),controller[_0x3413('0x14')]);router[_0x3413('0x13')](_0x3413('0x15'),auth['isAuthenticated'](),controller['reject']);router[_0x3413('0x16')]('/:id',auth[_0x3413('0x9')](),controller['destroy']);module[_0x3413('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index fcc553c..8320c4b 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 _0x4b17=['out','STRING','DATE','INTEGER','ENUM','Email','Chat','sequelize','exports','long','TEXT','BOOLEAN'];(function(_0x26926b,_0x9c46d5){var _0x10f236=function(_0x36a610){while(--_0x36a610){_0x26926b['push'](_0x26926b['shift']());}};_0x10f236(++_0x9c46d5);}(_0x4b17,0x10f));var _0x74b1=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x4b17[_0x1477ef];return _0x164acd;};'use strict';var Sequelize=require(_0x74b1('0x0'));var _=require('lodash');module[_0x74b1('0x1')]={'body':{'type':Sequelize['TEXT'](_0x74b1('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x74b1('0x3')]('medium')},'read':{'type':Sequelize[_0x74b1('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x74b1('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x74b1('0x6')](0x1fe)},'from':{'type':Sequelize[_0x74b1('0x6')]},'to':{'type':Sequelize[_0x74b1('0x3')](_0x74b1('0x2'))},'cc':{'type':Sequelize[_0x74b1('0x3')](_0x74b1('0x2'))},'bcc':{'type':Sequelize['TEXT'](_0x74b1('0x2'))},'subject':{'type':Sequelize[_0x74b1('0x3')]},'sentAt':{'type':Sequelize[_0x74b1('0x7')]},'attach':{'type':Sequelize[_0x74b1('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x74b1('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x74b1('0x3')](_0x74b1('0x2'))},'originCc':{'type':Sequelize['TEXT'](_0x74b1('0x2'))},'originChannel':{'type':Sequelize[_0x74b1('0x9')](_0x74b1('0xa'),_0x74b1('0xb')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x1e35=['ENUM','out','STRING','long','DATE','INTEGER','Chat','Email','sequelize','lodash','exports','TEXT','medium','BOOLEAN'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x1e35,0xbe));var _0x51e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e35[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x51e3('0x0'));var _=require(_0x51e3('0x1'));module[_0x51e3('0x2')]={'body':{'type':Sequelize[_0x51e3('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x51e3('0x3')](_0x51e3('0x4'))},'read':{'type':Sequelize[_0x51e3('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x51e3('0x6')]('in','out'),'defaultValue':_0x51e3('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x51e3('0x8')](0x1fe)},'from':{'type':Sequelize[_0x51e3('0x8')]},'to':{'type':Sequelize['TEXT'](_0x51e3('0x9'))},'cc':{'type':Sequelize[_0x51e3('0x3')](_0x51e3('0x9'))},'bcc':{'type':Sequelize[_0x51e3('0x3')](_0x51e3('0x9'))},'subject':{'type':Sequelize[_0x51e3('0x3')]},'sentAt':{'type':Sequelize[_0x51e3('0xa')]},'attach':{'type':Sequelize[_0x51e3('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x51e3('0xa')]},'originTo':{'type':Sequelize['TEXT'](_0x51e3('0x9'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize['ENUM']('Email',_0x51e3('0xc')),'defaultValue':_0x51e3('0xd'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 2bbac65..f2b4bb5 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 _0x0104=['where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','rawAttributes','fields','body','find','describe','create','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','attachments','join','root','server/files/attachments','defaults','ListId','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','readAt','format','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','reject','mail','RejectMessage','Sequelize','motionChannel','rejectmessage','download','unix','tmp','server','files','message-%s.eml','subject','createdAt','Attachment','from','headers','Bcc','bcc','Attachments','basename','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','bluebird','util','lodash','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','html-entities','register','jayson/promise','client','http','then','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','status','offset','limit','undefined','count','set','Content-Range','json','update','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','type','key','keys','filters','query','attributes','intersection','model','length','hasOwnProperty','nolimit','order','sort'];(function(_0x188edb,_0x19fed6){var _0x669a3d=function(_0x40b5d9){while(--_0x40b5d9){_0x188edb['push'](_0x188edb['shift']());}};_0x669a3d(++_0x19fed6);}(_0x0104,0x64));var _0x4010=function(_0x5d2ee6,_0x172461){_0x5d2ee6=_0x5d2ee6-0x0;var _0x148dc1=_0x0104[_0x5d2ee6];return _0x148dc1;};'use strict';var emlformat=require(_0x4010('0x0'));var moment=require('moment');var BPromise=require(_0x4010('0x1'));var util=require(_0x4010('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x4010('0x3'));var Redis=require(_0x4010('0x4'));var htmlToText=require(_0x4010('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x4010('0x6'))(_0x4010('0x7'));var interaction_log=require(_0x4010('0x6'))(_0x4010('0x8'));var config=require(_0x4010('0x9'));var db=require(_0x4010('0xa'))['db'];config[_0x4010('0xb')]=_['defaults'](config[_0x4010('0xb')],{'host':_0x4010('0xc'),'port':0x18eb});var socket=require(_0x4010('0xd'))(new Redis(config[_0x4010('0xb')]));var htmlEntities=require(_0x4010('0xe'));require('./mailMessage.socket')[_0x4010('0xf')](socket);var jayson=require(_0x4010('0x10'));var client=jayson[_0x4010('0x11')][_0x4010('0x12')]({'port':0x232c});var client9003=jayson['client'][_0x4010('0x12')]({'port':0x232b});var client9002=jayson[_0x4010('0x11')][_0x4010('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x27ab70,_0xce310b,_0x590ae7,_0x48c7a8){return new BPromise(function(_0x1b4ce6,_0x4c85f8){var _0x28d33d=_0x48c7a8||client;return _0x28d33d['request'](_0x27ab70,_0x590ae7)[_0x4010('0x13')](function(_0x484e13){logger['info'](_0x4010('0x14'),_0xce310b,'request\x20sent');logger[_0x4010('0x15')](_0x4010('0x16'),_0xce310b,_0x4010('0x17'),JSON['stringify'](_0x484e13));if(_0x484e13[_0x4010('0x18')]){if(_0x484e13[_0x4010('0x18')]['code']===0x1f4){logger[_0x4010('0x18')](_0x4010('0x14'),_0xce310b,_0x484e13[_0x4010('0x18')]['message']);return _0x4c85f8(_0x484e13[_0x4010('0x18')][_0x4010('0x19')]);}logger['error'](_0x4010('0x14'),_0xce310b,_0x484e13['error'][_0x4010('0x19')]);return _0x1b4ce6(_0x484e13['error']['message']);}else{logger[_0x4010('0x1a')]('MailMessage,\x20%s,\x20%s',_0xce310b,_0x4010('0x17'));_0x1b4ce6(_0x484e13[_0x4010('0x1b')][_0x4010('0x19')]);}})[_0x4010('0x1c')](function(_0x11df67){logger[_0x4010('0x18')](_0x4010('0x14'),_0xce310b,_0x11df67);_0x4c85f8(_0x11df67);});});}function respondWithResult(_0x1abd75,_0x25fceb){_0x25fceb=_0x25fceb||0xc8;return function(_0x25b0ee){if(_0x25b0ee){return _0x1abd75[_0x4010('0x1d')](_0x25fceb)['json'](_0x25b0ee);}};}function respondWithFilteredResult(_0x11be5c,_0x4d3d95){return function(_0x3baef8){if(_0x3baef8){var _0x3d8e92=typeof _0x4d3d95[_0x4010('0x1e')]==='undefined'&&typeof _0x4d3d95[_0x4010('0x1f')]===_0x4010('0x20');var _0x522cc2=_0x3baef8[_0x4010('0x21')];var _0x2280a4=_0x3d8e92?0x0:_0x4d3d95[_0x4010('0x1e')];var _0x310837=_0x3d8e92?_0x3baef8['count']:_0x4d3d95[_0x4010('0x1e')]+_0x4d3d95[_0x4010('0x1f')];var _0x5368b3;if(_0x310837>=_0x522cc2){_0x310837=_0x522cc2;_0x5368b3=0xc8;}else{_0x5368b3=0xce;}_0x11be5c['status'](_0x5368b3);return _0x11be5c[_0x4010('0x22')](_0x4010('0x23'),_0x2280a4+'-'+_0x310837+'/'+_0x522cc2)[_0x4010('0x24')](_0x3baef8);}return null;};}function saveUpdates(_0x2feadd){return function(_0x59f004){if(_0x59f004){return _0x59f004[_0x4010('0x25')](_0x2feadd)[_0x4010('0x13')](function(_0x4717be){return _0x4717be;});}return null;};}function removeEntity(_0x4ab654){return function(_0x2f4719){if(_0x2f4719){return _0x2f4719[_0x4010('0x26')]()['then'](function(){_0x4ab654[_0x4010('0x1d')](0xcc)[_0x4010('0x27')]();});}};}function handleEntityNotFound(_0x41e3e6){return function(_0x2d87e1){if(!_0x2d87e1){_0x41e3e6[_0x4010('0x28')](0x194);}return _0x2d87e1;};}function handleError(_0xd46ad0,_0x374321){_0x374321=_0x374321||0x1f4;return function(_0x3f3101){logger[_0x4010('0x18')](_0x3f3101[_0x4010('0x29')]);if(_0x3f3101[_0x4010('0x2a')]){delete _0x3f3101[_0x4010('0x2a')];}_0xd46ad0['status'](_0x374321)[_0x4010('0x2b')](_0x3f3101);};}exports[_0x4010('0x2c')]=function(_0x362f23,_0x437a43){var _0x261e70={},_0x452d47={},_0x220a1e={'count':0x0,'rows':[]};var _0x5c9b15=_[_0x4010('0x2d')](db[_0x4010('0x2e')]['rawAttributes'],function(_0x567a70){return{'name':_0x567a70['fieldName'],'type':_0x567a70[_0x4010('0x2f')][_0x4010('0x30')]};});_0x452d47['model']=_[_0x4010('0x2d')](_0x5c9b15,_0x4010('0x2a'));_0x452d47['query']=_[_0x4010('0x31')](_0x362f23['query']);_0x452d47[_0x4010('0x32')]=_['intersection'](_0x452d47['model'],_0x452d47[_0x4010('0x33')]);_0x261e70[_0x4010('0x34')]=_[_0x4010('0x35')](_0x452d47[_0x4010('0x36')],qs['fields'](_0x362f23[_0x4010('0x33')]['fields']));_0x261e70[_0x4010('0x34')]=_0x261e70['attributes'][_0x4010('0x37')]?_0x261e70[_0x4010('0x34')]:_0x452d47[_0x4010('0x36')];if(!_0x362f23[_0x4010('0x33')][_0x4010('0x38')](_0x4010('0x39'))){_0x261e70[_0x4010('0x1f')]=qs['limit'](_0x362f23[_0x4010('0x33')]['limit']);_0x261e70[_0x4010('0x1e')]=qs[_0x4010('0x1e')](_0x362f23[_0x4010('0x33')][_0x4010('0x1e')]);}_0x261e70[_0x4010('0x3a')]=qs['sort'](_0x362f23[_0x4010('0x33')][_0x4010('0x3b')]);_0x261e70[_0x4010('0x3c')]=qs[_0x4010('0x32')](_[_0x4010('0x3d')](_0x362f23[_0x4010('0x33')],_0x452d47['filters']),_0x5c9b15);if(_0x362f23[_0x4010('0x33')][_0x4010('0x3e')]){_0x261e70[_0x4010('0x3c')]=_[_0x4010('0x3f')](_0x261e70['where'],{'$or':_[_0x4010('0x2d')](_0x5c9b15,function(_0xc1ddf2){if(_0xc1ddf2[_0x4010('0x2f')]!==_0x4010('0x40')){var _0x2ee09e={};_0x2ee09e[_0xc1ddf2['name']]={'$like':'%'+_0x362f23[_0x4010('0x33')][_0x4010('0x3e')]+'%'};return _0x2ee09e;}})});}_0x261e70=_[_0x4010('0x3f')]({},_0x261e70,_0x362f23['options']);var _0x1d98ba={'where':_0x261e70[_0x4010('0x3c')]};return db['MailMessage'][_0x4010('0x21')](_0x1d98ba)[_0x4010('0x13')](function(_0x1f5f67){_0x220a1e[_0x4010('0x21')]=_0x1f5f67;if(_0x362f23[_0x4010('0x33')][_0x4010('0x41')]){_0x261e70[_0x4010('0x42')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x261e70);})[_0x4010('0x13')](function(_0x1323e2){_0x220a1e[_0x4010('0x43')]=_0x1323e2;return _0x220a1e;})[_0x4010('0x13')](respondWithFilteredResult(_0x437a43,_0x261e70))['catch'](handleError(_0x437a43,null));};exports[_0x4010('0x44')]=function(_0x1c3023,_0x3ffa47){var _0x2b9534={'raw':!![],'where':{'id':_0x1c3023[_0x4010('0x45')]['id']}},_0x38787c={};_0x38787c[_0x4010('0x36')]=_['keys'](db[_0x4010('0x2e')][_0x4010('0x46')]);_0x38787c[_0x4010('0x33')]=_[_0x4010('0x31')](_0x1c3023[_0x4010('0x33')]);_0x38787c[_0x4010('0x32')]=_[_0x4010('0x35')](_0x38787c[_0x4010('0x36')],_0x38787c[_0x4010('0x33')]);_0x2b9534[_0x4010('0x34')]=_[_0x4010('0x35')](_0x38787c[_0x4010('0x36')],qs[_0x4010('0x47')](_0x1c3023['query']['fields']));_0x2b9534[_0x4010('0x34')]=_0x2b9534['attributes']['length']?_0x2b9534[_0x4010('0x34')]:_0x38787c['model'];if(_0x1c3023[_0x4010('0x33')]['includeAll']){_0x2b9534[_0x4010('0x42')]=[{'all':!![]}];}_0x2b9534=_[_0x4010('0x3f')]({},_0x2b9534,_0x1c3023['options']);return db[_0x4010('0x2e')]['find'](_0x2b9534)[_0x4010('0x13')](handleEntityNotFound(_0x3ffa47,null))[_0x4010('0x13')](respondWithResult(_0x3ffa47,null))['catch'](handleError(_0x3ffa47,null));};exports[_0x4010('0x25')]=function(_0x13b91b,_0x4d2c09){if(_0x13b91b[_0x4010('0x48')]['id']){delete _0x13b91b[_0x4010('0x48')]['id'];}return db[_0x4010('0x2e')][_0x4010('0x49')]({'where':{'id':_0x13b91b[_0x4010('0x45')]['id']}})[_0x4010('0x13')](handleEntityNotFound(_0x4d2c09,null))[_0x4010('0x13')](saveUpdates(_0x13b91b[_0x4010('0x48')],null))[_0x4010('0x13')](respondWithResult(_0x4d2c09,null))[_0x4010('0x1c')](handleError(_0x4d2c09,null));};exports[_0x4010('0x26')]=function(_0x567aca,_0x42870b){return db[_0x4010('0x2e')][_0x4010('0x49')]({'where':{'id':_0x567aca['params']['id']}})[_0x4010('0x13')](handleEntityNotFound(_0x42870b,null))[_0x4010('0x13')](removeEntity(_0x42870b,null))[_0x4010('0x1c')](handleError(_0x42870b,null));};exports[_0x4010('0x4a')]=function(_0x216a3e,_0x3f47a1){return db[_0x4010('0x2e')][_0x4010('0x4a')]()[_0x4010('0x13')](respondWithResult(_0x3f47a1,null))['catch'](handleError(_0x3f47a1,null));};exports[_0x4010('0x4b')]=function(_0x2777d8,_0x4a2d64){return db['MailMessage'][_0x4010('0x4b')](_0x2777d8['body'])[_0x4010('0x13')](function(_0x183102){if(_0x183102){if(_0x183102['direction']===_0x4010('0x4c')&&!_0x183102[_0x4010('0x4d')]){var _0x4947e3,_0x55236e,_0x2a629f;if(_0x2777d8[_0x4010('0x48')]['to']){_0x55236e=_0x2777d8[_0x4010('0x48')]['to'][_0x4010('0x4e')](',')[0x0];}return db[_0x4010('0x4f')][_0x4010('0x50')]({'where':{'id':_0x183102[_0x4010('0x51')]},'include':[{'model':db[_0x4010('0x52')],'as':_0x4010('0x53'),'include':[{'model':db[_0x4010('0x54')],'as':_0x4010('0x55'),'where':{'email':_0x55236e},'limit':0x1,'order':[[_0x4010('0x56'),'DESC']]}]},{'model':db[_0x4010('0x57')],'as':_0x4010('0x58'),'raw':!![],'include':[{'model':db[_0x4010('0x59')],'as':_0x4010('0x59'),'raw':!![]}]}]})['then'](function(_0x421783){_0x4947e3=_0x421783;if(!_0x4947e3||!_0x4947e3[_0x4010('0x58')])return;var _0x542b74=_0x4947e3['getSmtpOptions']();if(_0x2777d8[_0x4010('0x48')][_0x4010('0x5a')]&&_0x2777d8['body'][_0x4010('0x5a')][_0x4010('0x37')]){for(var _0x658d5b=0x0;_0x658d5b<_0x2777d8[_0x4010('0x48')][_0x4010('0x5a')][_0x4010('0x37')];_0x658d5b+=0x1){_0x2777d8[_0x4010('0x48')][_0x4010('0x5a')][_0x658d5b]={'filename':_0x2777d8[_0x4010('0x48')][_0x4010('0x5a')][_0x658d5b][_0x4010('0x2a')],'path':path[_0x4010('0x5b')](config[_0x4010('0x5c')],_0x4010('0x5d'),_0x2777d8['body']['attachments'][_0x658d5b]['basename'])};}}_0x2a629f={'account':_0x542b74,'message':_0x2777d8['body']};return;})['then'](function(){if(_0x4947e3[_0x4010('0x53')]){if(_0x4947e3['List'][_0x4010('0x55')][_0x4010('0x37')]){return _0x4947e3[_0x4010('0x53')]['Contacts'][0x0];}else{return db[_0x4010('0x54')]['create'](_[_0x4010('0x5e')](_0x2777d8['body'],{'firstName':_0x2777d8['body']['to'],'email':_0x2777d8[_0x4010('0x48')]['to'],'phone':_0x2777d8[_0x4010('0x48')]['to'],'ListId':_0x4947e3[_0x4010('0x5f')]}));}}else{throw new Error(_0x4010('0x60'));}})[_0x4010('0x13')](function(){if(_0x2a629f){return respondWithRpcPromise(_0x4010('0x61'),_0x4010('0x62'),_0x2a629f,client9003)[_0x4010('0x13')](function(_0x5d46a6){return _0x183102[_0x4010('0x25')]({'read':!![],'messageId':_0x5d46a6[_0x4010('0x63')],'sentAt':moment()['format'](_0x4010('0x64'))});})[_0x4010('0x1c')](function(_0x5851a7){logger[_0x4010('0x18')]('%s',JSON[_0x4010('0x65')](_0x5851a7));return _0x183102;});}return _0x183102;});}return _0x183102;}})[_0x4010('0x13')](respondWithResult(_0x4a2d64,0xc9))[_0x4010('0x1c')](handleError(_0x4a2d64,null));};exports[_0x4010('0x66')]=function(_0x15e30d,_0x5a9a97){var _0x1ced9b={'agent':{},'channel':'mail'};if(_0x15e30d[_0x4010('0x48')]['id']){delete _0x15e30d['body']['id'];}_0x15e30d[_0x4010('0x48')]['read']=!![];_0x15e30d[_0x4010('0x48')][_0x4010('0x67')]=moment()[_0x4010('0x68')]('YYYY-MM-DD\x20HH:mm:ss');_0x15e30d[_0x4010('0x48')][_0x4010('0x69')]=_0x15e30d[_0x4010('0x48')][_0x4010('0x69')]||_0x15e30d[_0x4010('0x6a')]['id'];_0x1ced9b[_0x4010('0x6b')]['id']=_0x15e30d['body'][_0x4010('0x69')];return db[_0x4010('0x2e')][_0x4010('0x49')]({'where':{'id':_0x15e30d[_0x4010('0x45')]['id'],'UserId':null}})[_0x4010('0x13')](handleEntityNotFound(_0x5a9a97,null))[_0x4010('0x13')](saveUpdates(_0x15e30d[_0x4010('0x48')],null))[_0x4010('0x13')](function(_0x5c1760){if(_0x5c1760){_0x1ced9b['message']=_0x5c1760[_0x4010('0x6c')]({'plain':!![]});return db[_0x4010('0x6d')][_0x4010('0x49')]({'where':{'id':_0x5c1760[_0x4010('0x6e')]}});}return null;})[_0x4010('0x13')](handleEntityNotFound(_0x5a9a97,null))['then'](function(_0x332a18){if(_0x332a18){return _0x332a18[_0x4010('0x25')]({'UserId':_0x15e30d[_0x4010('0x48')][_0x4010('0x69')],'read1stAt':_[_0x4010('0x6f')](_0x332a18[_0x4010('0x70')])?moment()[_0x4010('0x68')](_0x4010('0x64')):undefined});}return null;})[_0x4010('0x13')](function(_0x32d683){if(_0x32d683){_0x1ced9b[_0x4010('0x71')]=_0x32d683['get']({'plain':!![]});interaction_log[_0x4010('0x1a')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x15e30d[_0x4010('0x6a')]['id'],_0x15e30d[_0x4010('0x6a')][_0x4010('0x2a')],_0x15e30d[_0x4010('0x6a')]['role'],_0x1ced9b[_0x4010('0x71')]['id'],_0x15e30d[_0x4010('0x48')]?JSON['stringify'](_0x15e30d[_0x4010('0x48')]):_0x4010('0x72'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x1ced9b);}return null;})[_0x4010('0x13')](function(_0x4b5482){var _0x19d260=_0x4010('0x73')+_0x4b5482[_0x4010('0x19')][_0x4010('0x74')];return db[_0x4010('0x75')]['query'](_0x19d260,{'type':db['Sequelize'][_0x4010('0x76')][_0x4010('0x77')],'raw':!![]})[_0x4010('0x13')](function(_0x33306c){return _0x33306c;});})['then'](function(_0x1a4159){if(_0x1a4159){_0x1ced9b[_0x4010('0x19')][_0x4010('0x78')]=_0x1a4159[0x0];if(!_0x15e30d[_0x4010('0x48')][_0x4010('0x69')])return;return db[_0x4010('0x79')][_0x4010('0x49')]({'where':{'id':_0x15e30d[_0x4010('0x48')][_0x4010('0x69')],'role':_0x4010('0x6b')},'attributes':['id','name',_0x4010('0x7a'),_0x4010('0x7b'),_0x4010('0x7c')],'raw':!![]});}return null;})[_0x4010('0x13')](function(_0xffde30){if(!_0xffde30)return null;_0x1ced9b[_0x4010('0x19')][_0x4010('0x6b')]=_0xffde30;return _0x1ced9b;})[_0x4010('0x13')](function(_0x21c4d1){if(_0x21c4d1){if(_0x15e30d[_0x4010('0x48')][_0x4010('0x7d')]){_0x1ced9b[_0x4010('0x19')][_0x4010('0x7e')]=util[_0x4010('0x68')](_0x4010('0x7f'),_0x15e30d[_0x4010('0x6a')][_0x4010('0x2a')]);_0x1ced9b[_0x4010('0x19')][_0x4010('0x80')]=_0x1ced9b[_0x4010('0x80')];_0x1ced9b[_0x4010('0x19')]['motionChannel']=_0x1ced9b[_0x4010('0x80')];_0x1ced9b[_0x4010('0x19')][_0x4010('0x81')]='accept';_0x1ced9b['message'][_0x4010('0x48')]=htmlToText[_0x4010('0x82')](_0x1ced9b['message'][_0x4010('0x48')]);return respondWithRpcPromise(_0x4010('0x83'),'EventManager',{'event':_0x4010('0x84'),'message':_0x1ced9b['message']},client9002)[_0x4010('0x13')](function(){return _0x1ced9b;});}return _0x1ced9b;}return null;})[_0x4010('0x13')](respondWithResult(_0x5a9a97,null))[_0x4010('0x1c')](handleError(_0x5a9a97,null));};exports[_0x4010('0x85')]=function(_0x5a63c9,_0x222672){var _0xb095fc={'agent':{},'channel':_0x4010('0x86')};if(_0x5a63c9[_0x4010('0x48')]['id']){delete _0x5a63c9[_0x4010('0x48')]['id'];}_0x5a63c9['body'][_0x4010('0x69')]=_0x5a63c9[_0x4010('0x48')][_0x4010('0x69')]||_0x5a63c9[_0x4010('0x6a')]['id'];_0xb095fc[_0x4010('0x6b')]['id']=_0x5a63c9[_0x4010('0x48')][_0x4010('0x69')];return db['MailMessage']['find']({'where':{'id':_0x5a63c9['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x222672,null))[_0x4010('0x13')](function(_0x5cb28e){if(_0x5cb28e){_0xb095fc['message']=_0x5cb28e[_0x4010('0x6c')]({'plain':!![]});return db[_0x4010('0x6d')][_0x4010('0x49')]({'where':{'id':_0x5cb28e[_0x4010('0x6e')]}});}return null;})['then'](handleEntityNotFound(_0x222672,null))[_0x4010('0x13')](function(_0x231aee){if(_0x231aee){_0xb095fc['interaction']=_0x231aee[_0x4010('0x6c')]({'plain':!![]});interaction_log[_0x4010('0x1a')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5a63c9[_0x4010('0x6a')]['id'],_0x5a63c9[_0x4010('0x6a')][_0x4010('0x2a')],_0x5a63c9[_0x4010('0x6a')]['role'],_0xb095fc[_0x4010('0x71')]['id'],_0x5a63c9[_0x4010('0x48')]?JSON['stringify'](_0x5a63c9[_0x4010('0x48')]):_0x4010('0x72'));return respondWithRpcPromise(_0x4010('0x87'),'rejectMessage',_0xb095fc);}return null;})[_0x4010('0x13')](function(_0x5e2fb1){var _0x3b128c=_0x4010('0x73')+_0x5e2fb1[_0x4010('0x19')][_0x4010('0x74')];return db['sequelize'][_0x4010('0x33')](_0x3b128c,{'type':db[_0x4010('0x88')][_0x4010('0x76')]['SELECT'],'raw':!![]})[_0x4010('0x13')](function(_0x2e9d0b){return _0x2e9d0b;});})['then'](function(_0x2c07e8){if(_0x2c07e8){_0xb095fc['message'][_0x4010('0x78')]=_0x2c07e8[0x0];if(!_0x5a63c9[_0x4010('0x48')]['UserId'])return;return db[_0x4010('0x79')][_0x4010('0x49')]({'where':{'id':_0x5a63c9[_0x4010('0x48')][_0x4010('0x69')],'role':_0x4010('0x6b')},'attributes':['id',_0x4010('0x2a'),_0x4010('0x7a'),_0x4010('0x7b'),'internal'],'raw':!![]});}return null;})['then'](function(_0xf00b09){if(!_0xf00b09)return null;_0xb095fc['message'][_0x4010('0x6b')]=_0xf00b09;return _0xb095fc;})[_0x4010('0x13')](function(_0x33d43b){if(_0x33d43b){_0x33d43b['message'][_0x4010('0x7e')]=util[_0x4010('0x68')](_0x4010('0x7f'),_0x5a63c9[_0x4010('0x6a')][_0x4010('0x2a')]);_0x33d43b[_0x4010('0x19')][_0x4010('0x80')]=_0xb095fc[_0x4010('0x80')];_0x33d43b['message'][_0x4010('0x89')]=_0xb095fc[_0x4010('0x80')];_0x33d43b['message'][_0x4010('0x81')]=_0x4010('0x85');_0x33d43b['message']['body']=htmlToText['fromString'](_0xb095fc['message'][_0x4010('0x48')]);respondWithRpcPromise(_0x4010('0x83'),'EventManager',{'event':_0x4010('0x8a'),'message':_0x33d43b[_0x4010('0x19')]},client9002);return _0xb095fc;}return null;})[_0x4010('0x13')](respondWithResult(_0x222672,null))[_0x4010('0x1c')](handleError(_0x222672,null));};exports[_0x4010('0x8b')]=function(_0x10858a,_0x3380bd){var _0x18f42b=moment()[_0x4010('0x8c')]()['toString']();var _0x436060=path[_0x4010('0x5b')](config['root'],'server','files',_0x4010('0x8d'));var _0x1816c5=path[_0x4010('0x5b')](config[_0x4010('0x5c')],_0x4010('0x8e'),_0x4010('0x8f'),_0x4010('0x5a'));var _0x36977a=util[_0x4010('0x68')](_0x4010('0x90'),_0x18f42b);return db['MailMessage']['find']({'where':{'id':_0x10858a[_0x4010('0x45')]['id']},'attributes':['id',_0x4010('0x48'),'from','to','cc','bcc',_0x4010('0x91'),_0x4010('0x92')],'include':_0x10858a[_0x4010('0x33')]['attachments']?[{'model':db[_0x4010('0x93')],'as':'Attachments'}]:undefined})[_0x4010('0x13')](handleEntityNotFound(_0x3380bd,null))[_0x4010('0x13')](function(_0x55b525){if(_0x55b525){var _0x37f47c=_0x55b525;var _0x1abcac={'from':_0x37f47c[_0x4010('0x94')],'to':_0x37f47c['to'],'subject':_0x37f47c[_0x4010('0x91')],'html':htmlEntities['decode'](_0x37f47c[_0x4010('0x48')]),'headers':{'Date':moment(_0x37f47c[_0x4010('0x92')])[_0x4010('0x68')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x55b525['cc']){_0x1abcac[_0x4010('0x95')]['Cc']=_0x55b525['cc'];}if(_0x55b525['bcc']){_0x1abcac[_0x4010('0x95')][_0x4010('0x96')]=_0x55b525[_0x4010('0x97')];}return new BPromise(function(_0x37a2f3,_0x3f17cb){if(_0x55b525[_0x4010('0x98')]){for(var _0x27a04d=0x0;_0x27a04d<_0x55b525[_0x4010('0x98')][_0x4010('0x37')];_0x27a04d++){var _0x37b771=_0x55b525[_0x4010('0x98')][_0x27a04d];var _0x486c6c=path[_0x4010('0x5b')](_0x1816c5,_0x37b771[_0x4010('0x99')]);if(fs[_0x4010('0x9a')](_0x486c6c)){_0x1abcac[_0x4010('0x5a')][_0x4010('0x9b')]({'name':_0x37b771['name'],'contentType':_0x37b771['type'],'data':fs[_0x4010('0x9c')](_0x486c6c)});}}}emlformat[_0x4010('0x9d')](_0x1abcac,function(_0x49dcac,_0x280079){if(_0x49dcac)return _0x3f17cb(_0x49dcac);fs[_0x4010('0x9e')](path[_0x4010('0x5b')](_0x436060,_0x36977a),_0x280079);return _0x37a2f3(_0x280079);});});}})[_0x4010('0x13')](function(_0x44ed2c){if(_0x44ed2c){return _0x3380bd[_0x4010('0x8b')](path['join'](_0x436060,_0x36977a),_0x36977a,function(_0x355486){if(!_0x355486)fs[_0x4010('0x9f')](path[_0x4010('0x5b')](_0x436060,_0x36977a));});}})[_0x4010('0x1c')](handleError(_0x3380bd,null));}; \ No newline at end of file +var _0xfbbd=['fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','rows','include','find','update','body','destroy','params','describe','create','direction','out','secret','split','MailAccount','MailAccountId','CmContact','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','basename','List','Contacts','defaults','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','MailInteraction','MailInteractionId','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','fullname','email','internal','channel','event','fromString','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','contact','interface','SIP/%s','rejectmessage','download','unix','toString','server','files','tmp','from','bcc','createdAt','Attachment','Attachments','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','localhost','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','then','end','sendStatus','name','index','map','MailMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes'];(function(_0x327ad8,_0x5f490b){var _0x2e6b26=function(_0x36df04){while(--_0x36df04){_0x327ad8['push'](_0x327ad8['shift']());}};_0x2e6b26(++_0x5f490b);}(_0xfbbd,0x10d));var _0xdfbb=function(_0x2a31fe,_0x7b59d0){_0x2a31fe=_0x2a31fe-0x0;var _0xe03d80=_0xfbbd[_0x2a31fe];return _0xe03d80;};'use strict';var emlformat=require(_0xdfbb('0x0'));var moment=require(_0xdfbb('0x1'));var BPromise=require('bluebird');var util=require(_0xdfbb('0x2'));var path=require(_0xdfbb('0x3'));var fs=require('fs');var _=require(_0xdfbb('0x4'));var Redis=require(_0xdfbb('0x5'));var htmlToText=require(_0xdfbb('0x6'));var qs=require(_0xdfbb('0x7'));var logger=require(_0xdfbb('0x8'))(_0xdfbb('0x9'));var interaction_log=require(_0xdfbb('0x8'))(_0xdfbb('0xa'));var config=require(_0xdfbb('0xb'));var db=require(_0xdfbb('0xc'))['db'];config[_0xdfbb('0xd')]=_['defaults'](config['redis'],{'host':_0xdfbb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdfbb('0xd')]));var htmlEntities=require(_0xdfbb('0xf'));require(_0xdfbb('0x10'))[_0xdfbb('0x11')](socket);var jayson=require(_0xdfbb('0x12'));var client=jayson[_0xdfbb('0x13')][_0xdfbb('0x14')]({'port':0x232c});var client9003=jayson[_0xdfbb('0x13')]['http']({'port':0x232b});var client9002=jayson[_0xdfbb('0x13')][_0xdfbb('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x3bd984,_0x216015,_0x2cde11,_0x2a1303){return new BPromise(function(_0x163353,_0x5c730f){var _0x28ba8=_0x2a1303||client;return _0x28ba8[_0xdfbb('0x15')](_0x3bd984,_0x2cde11)['then'](function(_0x4b2757){logger[_0xdfbb('0x16')](_0xdfbb('0x17'),_0x216015,_0xdfbb('0x18'));logger['debug'](_0xdfbb('0x19'),_0x216015,_0xdfbb('0x18'),JSON['stringify'](_0x4b2757));if(_0x4b2757[_0xdfbb('0x1a')]){if(_0x4b2757[_0xdfbb('0x1a')][_0xdfbb('0x1b')]===0x1f4){logger[_0xdfbb('0x1a')](_0xdfbb('0x17'),_0x216015,_0x4b2757[_0xdfbb('0x1a')][_0xdfbb('0x1c')]);return _0x5c730f(_0x4b2757[_0xdfbb('0x1a')]['message']);}logger[_0xdfbb('0x1a')]('MailMessage,\x20%s,\x20%s',_0x216015,_0x4b2757['error'][_0xdfbb('0x1c')]);return _0x163353(_0x4b2757[_0xdfbb('0x1a')]['message']);}else{logger[_0xdfbb('0x16')]('MailMessage,\x20%s,\x20%s',_0x216015,_0xdfbb('0x18'));_0x163353(_0x4b2757[_0xdfbb('0x1d')][_0xdfbb('0x1c')]);}})[_0xdfbb('0x1e')](function(_0xd6a261){logger['error']('MailMessage,\x20%s,\x20%s',_0x216015,_0xd6a261);_0x5c730f(_0xd6a261);});});}function respondWithResult(_0x54b8cf,_0x13107f){_0x13107f=_0x13107f||0xc8;return function(_0x34f1ca){if(_0x34f1ca){return _0x54b8cf[_0xdfbb('0x1f')](_0x13107f)[_0xdfbb('0x20')](_0x34f1ca);}};}function respondWithFilteredResult(_0x2a0829,_0xec2c7){return function(_0x479d36){if(_0x479d36){var _0x196d26=typeof _0xec2c7['offset']===_0xdfbb('0x21')&&typeof _0xec2c7[_0xdfbb('0x22')]===_0xdfbb('0x21');var _0x5bbe67=_0x479d36[_0xdfbb('0x23')];var _0x3bf4a7=_0x196d26?0x0:_0xec2c7[_0xdfbb('0x24')];var _0x47df53=_0x196d26?_0x479d36[_0xdfbb('0x23')]:_0xec2c7[_0xdfbb('0x24')]+_0xec2c7[_0xdfbb('0x22')];var _0x4e4f6d;if(_0x47df53>=_0x5bbe67){_0x47df53=_0x5bbe67;_0x4e4f6d=0xc8;}else{_0x4e4f6d=0xce;}_0x2a0829[_0xdfbb('0x1f')](_0x4e4f6d);return _0x2a0829[_0xdfbb('0x25')](_0xdfbb('0x26'),_0x3bf4a7+'-'+_0x47df53+'/'+_0x5bbe67)[_0xdfbb('0x20')](_0x479d36);}return null;};}function saveUpdates(_0x3bcb88){return function(_0x16b1d8){if(_0x16b1d8){return _0x16b1d8['update'](_0x3bcb88)[_0xdfbb('0x27')](function(_0x1fcb94){return _0x1fcb94;});}return null;};}function removeEntity(_0x2e17b6){return function(_0x4d1697){if(_0x4d1697){return _0x4d1697['destroy']()['then'](function(){_0x2e17b6[_0xdfbb('0x1f')](0xcc)[_0xdfbb('0x28')]();});}};}function handleEntityNotFound(_0xef1bd0){return function(_0x3d473a){if(!_0x3d473a){_0xef1bd0[_0xdfbb('0x29')](0x194);}return _0x3d473a;};}function handleError(_0x4b77cc,_0x40e104){_0x40e104=_0x40e104||0x1f4;return function(_0x2e1445){logger[_0xdfbb('0x1a')](_0x2e1445['stack']);if(_0x2e1445['name']){delete _0x2e1445[_0xdfbb('0x2a')];}_0x4b77cc[_0xdfbb('0x1f')](_0x40e104)['send'](_0x2e1445);};}exports[_0xdfbb('0x2b')]=function(_0x47bf3b,_0x4f0520){var _0x19f644={},_0x3fb214={},_0xec85e5={'count':0x0,'rows':[]};var _0x438559=_[_0xdfbb('0x2c')](db[_0xdfbb('0x2d')][_0xdfbb('0x2e')],function(_0x5cf141){return{'name':_0x5cf141[_0xdfbb('0x2f')],'type':_0x5cf141[_0xdfbb('0x30')]['key']};});_0x3fb214[_0xdfbb('0x31')]=_['map'](_0x438559,_0xdfbb('0x2a'));_0x3fb214[_0xdfbb('0x32')]=_[_0xdfbb('0x33')](_0x47bf3b['query']);_0x3fb214[_0xdfbb('0x34')]=_[_0xdfbb('0x35')](_0x3fb214[_0xdfbb('0x31')],_0x3fb214['query']);_0x19f644[_0xdfbb('0x36')]=_['intersection'](_0x3fb214[_0xdfbb('0x31')],qs[_0xdfbb('0x37')](_0x47bf3b[_0xdfbb('0x32')]['fields']));_0x19f644[_0xdfbb('0x36')]=_0x19f644[_0xdfbb('0x36')][_0xdfbb('0x38')]?_0x19f644[_0xdfbb('0x36')]:_0x3fb214[_0xdfbb('0x31')];if(!_0x47bf3b[_0xdfbb('0x32')][_0xdfbb('0x39')]('nolimit')){_0x19f644['limit']=qs[_0xdfbb('0x22')](_0x47bf3b[_0xdfbb('0x32')][_0xdfbb('0x22')]);_0x19f644[_0xdfbb('0x24')]=qs[_0xdfbb('0x24')](_0x47bf3b[_0xdfbb('0x32')][_0xdfbb('0x24')]);}_0x19f644[_0xdfbb('0x3a')]=qs['sort'](_0x47bf3b[_0xdfbb('0x32')][_0xdfbb('0x3b')]);_0x19f644['where']=qs[_0xdfbb('0x34')](_[_0xdfbb('0x3c')](_0x47bf3b[_0xdfbb('0x32')],_0x3fb214[_0xdfbb('0x34')]),_0x438559);if(_0x47bf3b[_0xdfbb('0x32')][_0xdfbb('0x3d')]){_0x19f644['where']=_[_0xdfbb('0x3e')](_0x19f644[_0xdfbb('0x3f')],{'$or':_[_0xdfbb('0x2c')](_0x438559,function(_0x80e84e){if(_0x80e84e[_0xdfbb('0x30')]!==_0xdfbb('0x40')){var _0x5897ef={};_0x5897ef[_0x80e84e[_0xdfbb('0x2a')]]={'$like':'%'+_0x47bf3b['query'][_0xdfbb('0x3d')]+'%'};return _0x5897ef;}})});}_0x19f644=_[_0xdfbb('0x3e')]({},_0x19f644,_0x47bf3b[_0xdfbb('0x41')]);var _0x4b1b8b={'where':_0x19f644[_0xdfbb('0x3f')]};return db[_0xdfbb('0x2d')][_0xdfbb('0x23')](_0x4b1b8b)[_0xdfbb('0x27')](function(_0x3a1c6a){_0xec85e5[_0xdfbb('0x23')]=_0x3a1c6a;if(_0x47bf3b[_0xdfbb('0x32')][_0xdfbb('0x42')]){_0x19f644['include']=[{'all':!![]}];}return db[_0xdfbb('0x2d')]['findAll'](_0x19f644);})[_0xdfbb('0x27')](function(_0x48417d){_0xec85e5[_0xdfbb('0x43')]=_0x48417d;return _0xec85e5;})[_0xdfbb('0x27')](respondWithFilteredResult(_0x4f0520,_0x19f644))[_0xdfbb('0x1e')](handleError(_0x4f0520,null));};exports['show']=function(_0x45c9b8,_0xb132b5){var _0x5205f5={'raw':!![],'where':{'id':_0x45c9b8['params']['id']}},_0x5deb2a={};_0x5deb2a[_0xdfbb('0x31')]=_[_0xdfbb('0x33')](db[_0xdfbb('0x2d')][_0xdfbb('0x2e')]);_0x5deb2a['query']=_[_0xdfbb('0x33')](_0x45c9b8[_0xdfbb('0x32')]);_0x5deb2a[_0xdfbb('0x34')]=_[_0xdfbb('0x35')](_0x5deb2a[_0xdfbb('0x31')],_0x5deb2a['query']);_0x5205f5['attributes']=_[_0xdfbb('0x35')](_0x5deb2a['model'],qs[_0xdfbb('0x37')](_0x45c9b8[_0xdfbb('0x32')][_0xdfbb('0x37')]));_0x5205f5[_0xdfbb('0x36')]=_0x5205f5[_0xdfbb('0x36')][_0xdfbb('0x38')]?_0x5205f5['attributes']:_0x5deb2a['model'];if(_0x45c9b8[_0xdfbb('0x32')][_0xdfbb('0x42')]){_0x5205f5[_0xdfbb('0x44')]=[{'all':!![]}];}_0x5205f5=_[_0xdfbb('0x3e')]({},_0x5205f5,_0x45c9b8[_0xdfbb('0x41')]);return db[_0xdfbb('0x2d')][_0xdfbb('0x45')](_0x5205f5)[_0xdfbb('0x27')](handleEntityNotFound(_0xb132b5,null))[_0xdfbb('0x27')](respondWithResult(_0xb132b5,null))['catch'](handleError(_0xb132b5,null));};exports[_0xdfbb('0x46')]=function(_0x47d2c3,_0x1fdaa6){if(_0x47d2c3['body']['id']){delete _0x47d2c3[_0xdfbb('0x47')]['id'];}return db['MailMessage'][_0xdfbb('0x45')]({'where':{'id':_0x47d2c3['params']['id']}})[_0xdfbb('0x27')](handleEntityNotFound(_0x1fdaa6,null))[_0xdfbb('0x27')](saveUpdates(_0x47d2c3[_0xdfbb('0x47')],null))[_0xdfbb('0x27')](respondWithResult(_0x1fdaa6,null))[_0xdfbb('0x1e')](handleError(_0x1fdaa6,null));};exports[_0xdfbb('0x48')]=function(_0x31a2ee,_0x27f855){return db[_0xdfbb('0x2d')][_0xdfbb('0x45')]({'where':{'id':_0x31a2ee[_0xdfbb('0x49')]['id']}})[_0xdfbb('0x27')](handleEntityNotFound(_0x27f855,null))['then'](removeEntity(_0x27f855,null))[_0xdfbb('0x1e')](handleError(_0x27f855,null));};exports[_0xdfbb('0x4a')]=function(_0x4b827d,_0xa1c269){return db[_0xdfbb('0x2d')][_0xdfbb('0x4a')]()[_0xdfbb('0x27')](respondWithResult(_0xa1c269,null))[_0xdfbb('0x1e')](handleError(_0xa1c269,null));};exports[_0xdfbb('0x4b')]=function(_0x427505,_0x38b917){return db['MailMessage']['create'](_0x427505[_0xdfbb('0x47')])[_0xdfbb('0x27')](function(_0x168ce7){if(_0x168ce7){if(_0x168ce7[_0xdfbb('0x4c')]===_0xdfbb('0x4d')&&!_0x168ce7[_0xdfbb('0x4e')]){var _0x11cab1,_0x57e630,_0xd8da71;if(_0x427505[_0xdfbb('0x47')]['to']){_0x57e630=_0x427505['body']['to'][_0xdfbb('0x4f')](',')[0x0];}return db[_0xdfbb('0x50')]['findOne']({'where':{'id':_0x168ce7[_0xdfbb('0x51')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xdfbb('0x52')],'as':'Contacts','where':{'email':_0x57e630},'limit':0x1,'order':[[_0xdfbb('0x53'),_0xdfbb('0x54')]]}]},{'model':db[_0xdfbb('0x55')],'as':_0xdfbb('0x56'),'raw':!![],'include':[{'model':db[_0xdfbb('0x57')],'as':_0xdfbb('0x57'),'raw':!![]}]}]})[_0xdfbb('0x27')](function(_0x24f894){_0x11cab1=_0x24f894;if(!_0x11cab1||!_0x11cab1[_0xdfbb('0x56')])return;var _0x4b5969=_0x11cab1[_0xdfbb('0x58')]();if(_0x427505['body'][_0xdfbb('0x59')]&&_0x427505['body'][_0xdfbb('0x59')][_0xdfbb('0x38')]){for(var _0x21f8f7=0x0;_0x21f8f7<_0x427505[_0xdfbb('0x47')][_0xdfbb('0x59')][_0xdfbb('0x38')];_0x21f8f7+=0x1){_0x427505[_0xdfbb('0x47')][_0xdfbb('0x59')][_0x21f8f7]={'filename':_0x427505[_0xdfbb('0x47')][_0xdfbb('0x59')][_0x21f8f7][_0xdfbb('0x2a')],'path':path[_0xdfbb('0x5a')](config[_0xdfbb('0x5b')],'server/files/attachments',_0x427505[_0xdfbb('0x47')][_0xdfbb('0x59')][_0x21f8f7][_0xdfbb('0x5c')])};}}_0xd8da71={'account':_0x4b5969,'message':_0x427505['body']};return;})[_0xdfbb('0x27')](function(){if(_0x11cab1[_0xdfbb('0x5d')]){if(_0x11cab1[_0xdfbb('0x5d')][_0xdfbb('0x5e')]['length']){return _0x11cab1[_0xdfbb('0x5d')][_0xdfbb('0x5e')][0x0];}else{return db[_0xdfbb('0x52')]['create'](_[_0xdfbb('0x5f')](_0x427505[_0xdfbb('0x47')],{'firstName':_0x427505['body']['to'],'email':_0x427505['body']['to'],'phone':_0x427505['body']['to'],'ListId':_0x11cab1[_0xdfbb('0x60')]}));}}else{throw new Error(_0xdfbb('0x61'));}})[_0xdfbb('0x27')](function(){if(_0xd8da71){return respondWithRpcPromise(_0xdfbb('0x62'),_0xdfbb('0x63'),_0xd8da71,client9003)[_0xdfbb('0x27')](function(_0x5c1db5){return _0x168ce7[_0xdfbb('0x46')]({'read':!![],'messageId':_0x5c1db5[_0xdfbb('0x64')],'sentAt':moment()[_0xdfbb('0x65')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xdfbb('0x1e')](function(_0x2dfcc1){logger[_0xdfbb('0x1a')]('%s',JSON['stringify'](_0x2dfcc1));return _0x168ce7;});}return _0x168ce7;});}return _0x168ce7;}})[_0xdfbb('0x27')](respondWithResult(_0x38b917,0xc9))['catch'](handleError(_0x38b917,null));};exports[_0xdfbb('0x66')]=function(_0x415563,_0x16ce93){var _0x2ceb1a={'agent':{},'channel':'mail'};if(_0x415563[_0xdfbb('0x47')]['id']){delete _0x415563[_0xdfbb('0x47')]['id'];}_0x415563[_0xdfbb('0x47')]['read']=!![];_0x415563[_0xdfbb('0x47')][_0xdfbb('0x67')]=moment()[_0xdfbb('0x65')](_0xdfbb('0x68'));_0x415563[_0xdfbb('0x47')]['UserId']=_0x415563['body'][_0xdfbb('0x69')]||_0x415563[_0xdfbb('0x6a')]['id'];_0x2ceb1a[_0xdfbb('0x6b')]['id']=_0x415563[_0xdfbb('0x47')]['UserId'];return db[_0xdfbb('0x2d')][_0xdfbb('0x45')]({'where':{'id':_0x415563[_0xdfbb('0x49')]['id'],'UserId':null}})[_0xdfbb('0x27')](handleEntityNotFound(_0x16ce93,null))[_0xdfbb('0x27')](saveUpdates(_0x415563[_0xdfbb('0x47')],null))[_0xdfbb('0x27')](function(_0x2b7253){if(_0x2b7253){_0x2ceb1a[_0xdfbb('0x1c')]=_0x2b7253['get']({'plain':!![]});return db[_0xdfbb('0x6c')]['find']({'where':{'id':_0x2b7253[_0xdfbb('0x6d')]}});}return null;})[_0xdfbb('0x27')](handleEntityNotFound(_0x16ce93,null))[_0xdfbb('0x27')](function(_0x1843ea){if(_0x1843ea){return _0x1843ea[_0xdfbb('0x46')]({'UserId':_0x415563[_0xdfbb('0x47')][_0xdfbb('0x69')],'read1stAt':_['isNil'](_0x1843ea['read1stAt'])?moment()['format'](_0xdfbb('0x68')):undefined});}return null;})[_0xdfbb('0x27')](function(_0x210504){if(_0x210504){_0x2ceb1a[_0xdfbb('0x6e')]=_0x210504[_0xdfbb('0x6f')]({'plain':!![]});interaction_log[_0xdfbb('0x16')](_0xdfbb('0x70'),_0x415563['user']['id'],_0x415563['user'][_0xdfbb('0x2a')],_0x415563[_0xdfbb('0x6a')][_0xdfbb('0x71')],_0x2ceb1a[_0xdfbb('0x6e')]['id'],_0x415563[_0xdfbb('0x47')]?JSON[_0xdfbb('0x72')](_0x415563[_0xdfbb('0x47')]):_0xdfbb('0x73'));return respondWithRpcPromise(_0xdfbb('0x74'),_0xdfbb('0x75'),_0x2ceb1a);}return null;})[_0xdfbb('0x27')](function(_0x357200){var _0x35a7a8=_0xdfbb('0x76')+_0x357200[_0xdfbb('0x1c')][_0xdfbb('0x77')];return db[_0xdfbb('0x78')][_0xdfbb('0x32')](_0x35a7a8,{'type':db['Sequelize'][_0xdfbb('0x79')][_0xdfbb('0x7a')],'raw':!![]})['then'](function(_0x33d254){return _0x33d254;});})[_0xdfbb('0x27')](function(_0x2a548e){if(_0x2a548e){_0x2ceb1a[_0xdfbb('0x1c')]['contact']=_0x2a548e[0x0];if(!_0x415563[_0xdfbb('0x47')][_0xdfbb('0x69')])return;return db[_0xdfbb('0x7b')][_0xdfbb('0x45')]({'where':{'id':_0x415563[_0xdfbb('0x47')][_0xdfbb('0x69')],'role':'agent'},'attributes':['id',_0xdfbb('0x2a'),_0xdfbb('0x7c'),_0xdfbb('0x7d'),_0xdfbb('0x7e')],'raw':!![]});}return null;})[_0xdfbb('0x27')](function(_0x3b670c){if(!_0x3b670c)return null;_0x2ceb1a[_0xdfbb('0x1c')][_0xdfbb('0x6b')]=_0x3b670c;return _0x2ceb1a;})[_0xdfbb('0x27')](function(_0x42d9c1){if(_0x42d9c1){if(_0x415563[_0xdfbb('0x47')]['manual']){_0x2ceb1a[_0xdfbb('0x1c')]['interface']=util[_0xdfbb('0x65')]('SIP/%s',_0x415563[_0xdfbb('0x6a')][_0xdfbb('0x2a')]);_0x2ceb1a[_0xdfbb('0x1c')]['channel']=_0x2ceb1a['channel'];_0x2ceb1a[_0xdfbb('0x1c')]['motionChannel']=_0x2ceb1a[_0xdfbb('0x7f')];_0x2ceb1a[_0xdfbb('0x1c')][_0xdfbb('0x80')]=_0xdfbb('0x66');_0x2ceb1a[_0xdfbb('0x1c')][_0xdfbb('0x47')]=htmlToText[_0xdfbb('0x81')](_0x2ceb1a[_0xdfbb('0x1c')][_0xdfbb('0x47')]);return respondWithRpcPromise(_0xdfbb('0x82'),_0xdfbb('0x82'),{'event':'acceptmessage','message':_0x2ceb1a[_0xdfbb('0x1c')]},client9002)['then'](function(){return _0x2ceb1a;});}return _0x2ceb1a;}return null;})[_0xdfbb('0x27')](respondWithResult(_0x16ce93,null))[_0xdfbb('0x1e')](handleError(_0x16ce93,null));};exports[_0xdfbb('0x83')]=function(_0x8bb598,_0x6d802c){var _0x5b18fc={'agent':{},'channel':'mail'};if(_0x8bb598['body']['id']){delete _0x8bb598[_0xdfbb('0x47')]['id'];}_0x8bb598['body']['UserId']=_0x8bb598[_0xdfbb('0x47')][_0xdfbb('0x69')]||_0x8bb598[_0xdfbb('0x6a')]['id'];_0x5b18fc['agent']['id']=_0x8bb598[_0xdfbb('0x47')][_0xdfbb('0x69')];return db['MailMessage']['find']({'where':{'id':_0x8bb598[_0xdfbb('0x49')]['id'],'UserId':null}})[_0xdfbb('0x27')](handleEntityNotFound(_0x6d802c,null))[_0xdfbb('0x27')](function(_0x24d13e){if(_0x24d13e){_0x5b18fc[_0xdfbb('0x1c')]=_0x24d13e['get']({'plain':!![]});return db['MailInteraction'][_0xdfbb('0x45')]({'where':{'id':_0x24d13e[_0xdfbb('0x6d')]}});}return null;})[_0xdfbb('0x27')](handleEntityNotFound(_0x6d802c,null))[_0xdfbb('0x27')](function(_0xedf901){if(_0xedf901){_0x5b18fc[_0xdfbb('0x6e')]=_0xedf901[_0xdfbb('0x6f')]({'plain':!![]});interaction_log['info'](_0xdfbb('0x84'),_0x8bb598['user']['id'],_0x8bb598['user'][_0xdfbb('0x2a')],_0x8bb598[_0xdfbb('0x6a')]['role'],_0x5b18fc[_0xdfbb('0x6e')]['id'],_0x8bb598[_0xdfbb('0x47')]?JSON['stringify'](_0x8bb598['body']):'null');return respondWithRpcPromise(_0xdfbb('0x85'),_0xdfbb('0x86'),_0x5b18fc);}return null;})[_0xdfbb('0x27')](function(_0x4d16e9){var _0x32b1c0=_0xdfbb('0x76')+_0x4d16e9[_0xdfbb('0x1c')][_0xdfbb('0x77')];return db[_0xdfbb('0x78')][_0xdfbb('0x32')](_0x32b1c0,{'type':db[_0xdfbb('0x87')][_0xdfbb('0x79')][_0xdfbb('0x7a')],'raw':!![]})[_0xdfbb('0x27')](function(_0x46255a){return _0x46255a;});})['then'](function(_0x2703de){if(_0x2703de){_0x5b18fc[_0xdfbb('0x1c')][_0xdfbb('0x88')]=_0x2703de[0x0];if(!_0x8bb598[_0xdfbb('0x47')]['UserId'])return;return db[_0xdfbb('0x7b')][_0xdfbb('0x45')]({'where':{'id':_0x8bb598[_0xdfbb('0x47')][_0xdfbb('0x69')],'role':'agent'},'attributes':['id',_0xdfbb('0x2a'),'fullname','email',_0xdfbb('0x7e')],'raw':!![]});}return null;})[_0xdfbb('0x27')](function(_0xd5c9a9){if(!_0xd5c9a9)return null;_0x5b18fc[_0xdfbb('0x1c')][_0xdfbb('0x6b')]=_0xd5c9a9;return _0x5b18fc;})[_0xdfbb('0x27')](function(_0x537d56){if(_0x537d56){_0x537d56[_0xdfbb('0x1c')][_0xdfbb('0x89')]=util[_0xdfbb('0x65')](_0xdfbb('0x8a'),_0x8bb598[_0xdfbb('0x6a')][_0xdfbb('0x2a')]);_0x537d56[_0xdfbb('0x1c')][_0xdfbb('0x7f')]=_0x5b18fc[_0xdfbb('0x7f')];_0x537d56[_0xdfbb('0x1c')]['motionChannel']=_0x5b18fc[_0xdfbb('0x7f')];_0x537d56[_0xdfbb('0x1c')][_0xdfbb('0x80')]=_0xdfbb('0x83');_0x537d56[_0xdfbb('0x1c')][_0xdfbb('0x47')]=htmlToText[_0xdfbb('0x81')](_0x5b18fc[_0xdfbb('0x1c')][_0xdfbb('0x47')]);respondWithRpcPromise(_0xdfbb('0x82'),_0xdfbb('0x82'),{'event':_0xdfbb('0x8b'),'message':_0x537d56[_0xdfbb('0x1c')]},client9002);return _0x5b18fc;}return null;})[_0xdfbb('0x27')](respondWithResult(_0x6d802c,null))[_0xdfbb('0x1e')](handleError(_0x6d802c,null));};exports[_0xdfbb('0x8c')]=function(_0x5380a7,_0x27ccfb){var _0x40113b=moment()[_0xdfbb('0x8d')]()[_0xdfbb('0x8e')]();var _0x3b04c3=path['join'](config[_0xdfbb('0x5b')],_0xdfbb('0x8f'),_0xdfbb('0x90'),_0xdfbb('0x91'));var _0x57f1a3=path[_0xdfbb('0x5a')](config[_0xdfbb('0x5b')],_0xdfbb('0x8f'),_0xdfbb('0x90'),_0xdfbb('0x59'));var _0x34fae1=util[_0xdfbb('0x65')]('message-%s.eml',_0x40113b);return db[_0xdfbb('0x2d')][_0xdfbb('0x45')]({'where':{'id':_0x5380a7[_0xdfbb('0x49')]['id']},'attributes':['id',_0xdfbb('0x47'),_0xdfbb('0x92'),'to','cc',_0xdfbb('0x93'),'subject',_0xdfbb('0x94')],'include':_0x5380a7[_0xdfbb('0x32')][_0xdfbb('0x59')]?[{'model':db[_0xdfbb('0x95')],'as':_0xdfbb('0x96')}]:undefined})[_0xdfbb('0x27')](handleEntityNotFound(_0x27ccfb,null))[_0xdfbb('0x27')](function(_0x3f8e68){if(_0x3f8e68){var _0x64da0f=_0x3f8e68;var _0x9e1c0d={'from':_0x64da0f[_0xdfbb('0x92')],'to':_0x64da0f['to'],'subject':_0x64da0f[_0xdfbb('0x97')],'html':htmlEntities[_0xdfbb('0x98')](_0x64da0f['body']),'headers':{'Date':moment(_0x64da0f[_0xdfbb('0x94')])['format'](_0xdfbb('0x99'))},'attachments':[]};if(_0x3f8e68['cc']){_0x9e1c0d[_0xdfbb('0x9a')]['Cc']=_0x3f8e68['cc'];}if(_0x3f8e68[_0xdfbb('0x93')]){_0x9e1c0d[_0xdfbb('0x9a')][_0xdfbb('0x9b')]=_0x3f8e68[_0xdfbb('0x93')];}return new BPromise(function(_0x3abfd9,_0x4b3091){if(_0x3f8e68[_0xdfbb('0x96')]){for(var _0x61a2f8=0x0;_0x61a2f8<_0x3f8e68[_0xdfbb('0x96')][_0xdfbb('0x38')];_0x61a2f8++){var _0x18f317=_0x3f8e68[_0xdfbb('0x96')][_0x61a2f8];var _0x8b509=path[_0xdfbb('0x5a')](_0x57f1a3,_0x18f317[_0xdfbb('0x5c')]);if(fs[_0xdfbb('0x9c')](_0x8b509)){_0x9e1c0d[_0xdfbb('0x59')][_0xdfbb('0x9d')]({'name':_0x18f317[_0xdfbb('0x2a')],'contentType':_0x18f317['type'],'data':fs[_0xdfbb('0x9e')](_0x8b509)});}}}emlformat[_0xdfbb('0x9f')](_0x9e1c0d,function(_0x34acdb,_0x307393){if(_0x34acdb)return _0x4b3091(_0x34acdb);fs[_0xdfbb('0xa0')](path[_0xdfbb('0x5a')](_0x3b04c3,_0x34fae1),_0x307393);return _0x3abfd9(_0x307393);});});}})['then'](function(_0x2dbf14){if(_0x2dbf14){return _0x27ccfb[_0xdfbb('0x8c')](path[_0xdfbb('0x5a')](_0x3b04c3,_0x34fae1),_0x34fae1,function(_0x352673){if(!_0x352673)fs[_0xdfbb('0xa1')](path['join'](_0x3b04c3,_0x34fae1));});}})[_0xdfbb('0x1e')](handleError(_0x27ccfb,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 3536268..426f077 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 _0x7690=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage'];(function(_0x3e0667,_0xafa54c){var _0x13ef0a=function(_0x192707){while(--_0x192707){_0x3e0667['push'](_0x3e0667['shift']());}};_0x13ef0a(++_0xafa54c);}(_0x7690,0x14a));var _0x0769=function(_0x39a5f3,_0x2d783a){_0x39a5f3=_0x39a5f3-0x0;var _0x2c42c2=_0x7690[_0x39a5f3];return _0x2c42c2;};'use strict';var EventEmitter=require(_0x0769('0x0'));var MailMessage=require(_0x0769('0x1'))['db'][_0x0769('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0769('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0769('0x4')};function emitEvent(_0x28712c){return function(_0x7ec218,_0x116818,_0x14b37a){MailMessageEvents['emit'](_0x28712c+':'+_0x7ec218['id'],_0x7ec218);MailMessageEvents[_0x0769('0x5')](_0x28712c,_0x7ec218);_0x14b37a(null);};}for(var e in events){if(events[_0x0769('0x6')](e)){var event=events[e];MailMessage[_0x0769('0x7')](e,emitEvent(event));}}module[_0x0769('0x8')]=MailMessageEvents; \ No newline at end of file +var _0xd2ce=['save','update','emit','hook','events','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x5c692e,_0x454490){var _0x2ab4d1=function(_0x529423){while(--_0x529423){_0x5c692e['push'](_0x5c692e['shift']());}};_0x2ab4d1(++_0x454490);}(_0xd2ce,0x174));var _0xed2c=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xd2ce[_0x3054be];return _0x3df150;};'use strict';var EventEmitter=require(_0xed2c('0x0'));var MailMessage=require(_0xed2c('0x1'))['db'][_0xed2c('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xed2c('0x3')](0x0);var events={'afterCreate':_0xed2c('0x4'),'afterUpdate':_0xed2c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x157d4c){return function(_0x5dc7d8,_0x3fef09,_0x425645){MailMessageEvents[_0xed2c('0x6')](_0x157d4c+':'+_0x5dc7d8['id'],_0x5dc7d8);MailMessageEvents[_0xed2c('0x6')](_0x157d4c,_0x5dc7d8);_0x425645(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xed2c('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 51ce30c..5dbc592 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 _0xf19f=['secret','UserId','MailInteraction','findOne','MailInteractionId','then','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','path','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','fromString','get','direction','toLowerCase','out'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf19f,0x140));var _0xff19=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0xf19f[_0x382e89];return _0x3a1318;};'use strict';var _=require(_0xff19('0x0'));var util=require('util');var logger=require(_0xff19('0x1'))(_0xff19('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xff19('0x3'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xff19('0x4'));var rimraf=require('rimraf');var config=require(_0xff19('0x5'));var attributes=require(_0xff19('0x6'));module[_0xff19('0x7')]=function(_0xe75fd6,_0x28cc59){return _0xe75fd6[_0xff19('0x8')]('MailMessage',attributes,{'tableName':_0xff19('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xff19('0xa')]},{'name':_0xff19('0xb'),'fields':['plainBody',_0xff19('0xc')],'type':_0xff19('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x50fc48,_0x52e915,_0x3cffba){if(_0x50fc48[_0xff19('0xe')]){_0x50fc48[_0xff19('0xf')]=htmlToText[_0xff19('0x10')](_0x50fc48[_0xff19('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3cffba(null,_0x52e915);},'afterCreate':function(_0x527516,_0x2860c3,_0x5c2270){var _0x5baa47=_0xe75fd6['models'];var _0x1a5af0=_0x527516[_0xff19('0x11')]({'plain':!![]});if(_0x1a5af0[_0xff19('0x12')][_0xff19('0x13')]()==='in'||_0x1a5af0[_0xff19('0x12')][_0xff19('0x13')]()===_0xff19('0x14')&&!_0x1a5af0[_0xff19('0x15')]&&!_['isNil'](_0x1a5af0[_0xff19('0x16')])){_0x5baa47[_0xff19('0x17')][_0xff19('0x18')]({'where':{'id':_0x1a5af0[_0xff19('0x19')]}})[_0xff19('0x1a')](function(_0xea122b){if(_0xea122b){_0xea122b[_0xff19('0x1b')]({'lastMsgAt':_0x1a5af0['createdAt'],'lastMsgDirection':_0x1a5af0[_0xff19('0x12')][_0xff19('0x13')]()});}})[_0xff19('0x1c')](function(_0x4733e7){console['error'](_0x4733e7);});}_0x5c2270();}},'charset':_0xff19('0x1d'),'collate':_0xff19('0x1e')});}; \ No newline at end of file +var _0xf074=['rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','fromString','get','direction','toLowerCase','out','UserId','MailInteraction','findOne','MailInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path'];(function(_0x2135f3,_0x12fda0){var _0x1740b7=function(_0x486c52){while(--_0x486c52){_0x2135f3['push'](_0x2135f3['shift']());}};_0x1740b7(++_0x12fda0);}(_0xf074,0x1b2));var _0x4f07=function(_0x32179c,_0x32fb68){_0x32179c=_0x32179c-0x0;var _0xad3766=_0xf074[_0x32179c];return _0xad3766;};'use strict';var _=require('lodash');var util=require(_0x4f07('0x0'));var logger=require(_0x4f07('0x1'))(_0x4f07('0x2'));var moment=require(_0x4f07('0x3'));var BPromise=require(_0x4f07('0x4'));var rp=require(_0x4f07('0x5'));var htmlToText=require(_0x4f07('0x6'));var fs=require('fs');var path=require(_0x4f07('0x7'));var rimraf=require(_0x4f07('0x8'));var config=require('../../config/environment');var attributes=require(_0x4f07('0x9'));module[_0x4f07('0xa')]=function(_0x51f42f,_0x302463){return _0x51f42f[_0x4f07('0xb')](_0x4f07('0xc'),attributes,{'tableName':_0x4f07('0xd'),'paranoid':![],'indexes':[{'name':_0x4f07('0xe'),'fields':[_0x4f07('0xe')]},{'name':_0x4f07('0xf'),'fields':[_0x4f07('0x10'),_0x4f07('0x11')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x141c0c,_0x217382,_0x292020){if(_0x141c0c[_0x4f07('0x12')]){_0x141c0c[_0x4f07('0x10')]=htmlToText[_0x4f07('0x13')](_0x141c0c[_0x4f07('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x292020(null,_0x217382);},'afterCreate':function(_0x142af6,_0x9ba367,_0x472b18){var _0xe48e34=_0x51f42f['models'];var _0x33bd0a=_0x142af6[_0x4f07('0x14')]({'plain':!![]});if(_0x33bd0a[_0x4f07('0x15')][_0x4f07('0x16')]()==='in'||_0x33bd0a[_0x4f07('0x15')][_0x4f07('0x16')]()===_0x4f07('0x17')&&!_0x33bd0a['secret']&&!_['isNil'](_0x33bd0a[_0x4f07('0x18')])){_0xe48e34[_0x4f07('0x19')][_0x4f07('0x1a')]({'where':{'id':_0x33bd0a[_0x4f07('0x1b')]}})['then'](function(_0x4fb166){if(_0x4fb166){_0x4fb166[_0x4f07('0x1c')]({'lastMsgAt':_0x33bd0a[_0x4f07('0x1d')],'lastMsgDirection':_0x33bd0a[_0x4f07('0x15')][_0x4f07('0x16')]()});}})[_0x4f07('0x1e')](function(_0x34cc05){console[_0x4f07('0x1f')](_0x34cc05);});}_0x472b18();}},'charset':_0x4f07('0x20'),'collate':_0x4f07('0x21')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index e12b08b..6de9f45 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 _0xefda=['redis','defaults','socket.io-emitter','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','body','options','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x542d80,_0x150561){var _0x1f4492=function(_0x542215){while(--_0x542215){_0x542d80['push'](_0x542d80['shift']());}};_0x1f4492(++_0x150561);}(_0xefda,0x96));var _0xaefd=function(_0x3e9c1b,_0x29f936){_0x3e9c1b=_0x3e9c1b-0x0;var _0x1a3e1f=_0xefda[_0x3e9c1b];return _0x1a3e1f;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});config[_0xaefd('0xa')]=_[_0xaefd('0xb')](config[_0xaefd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xaefd('0xc'))(new Redis(config[_0xaefd('0xa')]));require(_0xaefd('0xd'))['register'](socket);function respondWithRpcPromise(_0x48a255,_0x54a3b1,_0xa6239d){return new BPromise(function(_0x16b36e,_0x20135c){return client[_0xaefd('0xe')](_0x48a255,_0xa6239d)[_0xaefd('0xf')](function(_0x1e00fb){logger[_0xaefd('0x10')](_0xaefd('0x11'),_0x54a3b1,_0xaefd('0x12'));logger[_0xaefd('0x13')](_0xaefd('0x14'),_0x54a3b1,'request\x20sent',JSON[_0xaefd('0x15')](_0x1e00fb));if(_0x1e00fb['error']){if(_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x17')]===0x1f4){logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x1e00fb['error'][_0xaefd('0x18')]);return _0x20135c(_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x18')]);}logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x1e00fb[_0xaefd('0x16')][_0xaefd('0x18')]);return _0x16b36e(_0x1e00fb[_0xaefd('0x16')]['message']);}else{logger[_0xaefd('0x10')](_0xaefd('0x11'),_0x54a3b1,_0xaefd('0x12'));_0x16b36e(_0x1e00fb[_0xaefd('0x19')][_0xaefd('0x18')]);}})[_0xaefd('0x1a')](function(_0x516e84){logger[_0xaefd('0x16')](_0xaefd('0x11'),_0x54a3b1,_0x516e84);_0x20135c(_0x516e84);});});}exports[_0xaefd('0x1b')]=function(_0x1260dd){var _0x45ebf2=this;return new Promise(function(_0x1f302c,_0x5282ed){return db[_0xaefd('0x1c')][_0xaefd('0x1d')](_0x1260dd[_0xaefd('0x1e')],{'raw':_0x1260dd[_0xaefd('0x1f')]?_0x1260dd[_0xaefd('0x1f')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5b9967){logger[_0xaefd('0x10')](_0xaefd('0x1b'),_0x1260dd);logger[_0xaefd('0x13')]('CreateMailMessage',_0x1260dd,JSON[_0xaefd('0x15')](_0x5b9967));_0x1f302c(_0x5b9967);})['catch'](function(_0x3deec8){logger[_0xaefd('0x16')](_0xaefd('0x1b'),_0x3deec8['message'],_0x1260dd);_0x5282ed(_0x45ebf2[_0xaefd('0x16')](0x1f4,_0x3deec8[_0xaefd('0x18')]));});});}; \ No newline at end of file +var _0xb9be=['redis','localhost','socket.io-emitter','./mailMessage.socket','register','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateMailMessage','MailMessage','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0xb9be,0xc5));var _0xeb9b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb9be[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var moment=require(_0xeb9b('0x2'));var BPromise=require(_0xeb9b('0x3'));var rs=require(_0xeb9b('0x4'));var fs=require('fs');var Redis=require(_0xeb9b('0x5'));var db=require(_0xeb9b('0x6'))['db'];var utils=require(_0xeb9b('0x7'));var logger=require(_0xeb9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb9b('0x9'));var client=jayson[_0xeb9b('0xa')][_0xeb9b('0xb')]({'port':0x232a});config['redis']=_[_0xeb9b('0xc')](config[_0xeb9b('0xd')],{'host':_0xeb9b('0xe'),'port':0x18eb});var socket=require(_0xeb9b('0xf'))(new Redis(config[_0xeb9b('0xd')]));require(_0xeb9b('0x10'))[_0xeb9b('0x11')](socket);function respondWithRpcPromise(_0x16761a,_0x32f0c4,_0x4f4952){return new BPromise(function(_0x20c855,_0x58d6a4){return client['request'](_0x16761a,_0x4f4952)[_0xeb9b('0x12')](function(_0x4236c0){logger['info'](_0xeb9b('0x13'),_0x32f0c4,_0xeb9b('0x14'));logger[_0xeb9b('0x15')](_0xeb9b('0x16'),_0x32f0c4,'request\x20sent',JSON['stringify'](_0x4236c0));if(_0x4236c0['error']){if(_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x18')]===0x1f4){logger[_0xeb9b('0x17')]('MailMessage,\x20%s,\x20%s',_0x32f0c4,_0x4236c0['error']['message']);return _0x58d6a4(_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x19')]);}logger[_0xeb9b('0x17')](_0xeb9b('0x13'),_0x32f0c4,_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x19')]);return _0x20c855(_0x4236c0[_0xeb9b('0x17')]['message']);}else{logger[_0xeb9b('0x1a')](_0xeb9b('0x13'),_0x32f0c4,_0xeb9b('0x14'));_0x20c855(_0x4236c0[_0xeb9b('0x1b')][_0xeb9b('0x19')]);}})[_0xeb9b('0x1c')](function(_0x21010e){logger[_0xeb9b('0x17')](_0xeb9b('0x13'),_0x32f0c4,_0x21010e);_0x58d6a4(_0x21010e);});});}exports[_0xeb9b('0x1d')]=function(_0x4f436e){var _0x43dc48=this;return new Promise(function(_0x5a7ffd,_0x5d5f54){return db[_0xeb9b('0x1e')][_0xeb9b('0x1f')](_0x4f436e['body'],{'raw':_0x4f436e[_0xeb9b('0x20')]?_0x4f436e[_0xeb9b('0x20')][_0xeb9b('0x21')]===undefined?!![]:![]:!![]})[_0xeb9b('0x12')](function(_0x3c8be7){logger[_0xeb9b('0x1a')](_0xeb9b('0x1d'),_0x4f436e);logger[_0xeb9b('0x15')](_0xeb9b('0x1d'),_0x4f436e,JSON[_0xeb9b('0x22')](_0x3c8be7));_0x5a7ffd(_0x3c8be7);})[_0xeb9b('0x1c')](function(_0x296f95){logger[_0xeb9b('0x17')](_0xeb9b('0x1d'),_0x296f95[_0xeb9b('0x19')],_0x4f436e);_0x5d5f54(_0x43dc48[_0xeb9b('0x17')](0x1f4,_0x296f95['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 986139f..b2f93a4 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 _0x9828=['update','removeListener','register','length','mailMessage:','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9828,0x1af));var _0x8982=function(_0x39ed63,_0x1050f){_0x39ed63=_0x39ed63-0x0;var _0x5023a8=_0x9828[_0x39ed63];return _0x5023a8;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x8982('0x0'),'remove',_0x8982('0x1')];function createListener(_0x449cdb,_0x22f5d8){return function(_0x5b7658){_0x22f5d8['emit'](_0x449cdb,_0x5b7658);};}function removeListener(_0x4e7bf2,_0x3a089e){return function(){MailMessageEvents[_0x8982('0x2')](_0x4e7bf2,_0x3a089e);};}exports[_0x8982('0x3')]=function(_0x130c94){for(var _0x49dc34=0x0,_0x17d45c=events[_0x8982('0x4')];_0x49dc34<_0x17d45c;_0x49dc34++){var _0x2d3901=events[_0x49dc34];var _0x3ff2d6=createListener(_0x8982('0x5')+_0x2d3901,_0x130c94);MailMessageEvents['on'](_0x2d3901,_0x3ff2d6);}}; \ No newline at end of file +var _0x87e7=['update','emit','removeListener','register','length','mailMessage:','./mailMessage.events','remove'];(function(_0x3048ea,_0x3838c2){var _0x1a13c4=function(_0x2c6a6b){while(--_0x2c6a6b){_0x3048ea['push'](_0x3048ea['shift']());}};_0x1a13c4(++_0x3838c2);}(_0x87e7,0x11e));var _0x787e=function(_0x1c443f,_0x51319d){_0x1c443f=_0x1c443f-0x0;var _0x4a4a71=_0x87e7[_0x1c443f];return _0x4a4a71;};'use strict';var MailMessageEvents=require(_0x787e('0x0'));var events=['save',_0x787e('0x1'),_0x787e('0x2')];function createListener(_0x5bd83a,_0x1309d2){return function(_0x5609b9){_0x1309d2[_0x787e('0x3')](_0x5bd83a,_0x5609b9);};}function removeListener(_0x3c571d,_0x26e9ec){return function(){MailMessageEvents[_0x787e('0x4')](_0x3c571d,_0x26e9ec);};}exports[_0x787e('0x5')]=function(_0x189256){for(var _0x14b6bf=0x0,_0x2f65da=events[_0x787e('0x6')];_0x14b6bf<_0x2f65da;_0x14b6bf++){var _0x36bc02=events[_0x14b6bf];var _0x5dd8e6=createListener(_0x787e('0x7')+_0x36bc02,_0x189256);MailMessageEvents['on'](_0x36bc02,_0x5dd8e6);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 48a8092..81478f8 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 _0x2387=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','util','connect-timeout'];(function(_0x58e2d2,_0x4ff59b){var _0x249768=function(_0x1c9e31){while(--_0x1c9e31){_0x58e2d2['push'](_0x58e2d2['shift']());}};_0x249768(++_0x4ff59b);}(_0x2387,0x184));var _0x7238=function(_0x5997e9,_0x3f1e0c){_0x5997e9=_0x5997e9-0x0;var _0x111fe2=_0x2387[_0x5997e9];return _0x111fe2;};'use strict';var multer=require('multer');var util=require(_0x7238('0x0'));var path=require('path');var timeout=require(_0x7238('0x1'));var express=require(_0x7238('0x2'));var router=express[_0x7238('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7238('0x4'));var interaction=require(_0x7238('0x5'));var config=require(_0x7238('0x6'));var controller=require(_0x7238('0x7'));router[_0x7238('0x8')]('/',auth[_0x7238('0x9')](),controller[_0x7238('0xa')]);router[_0x7238('0x8')](_0x7238('0xb'),auth[_0x7238('0x9')](),controller[_0x7238('0xc')]);router['get'](_0x7238('0xd'),auth[_0x7238('0x9')](),controller[_0x7238('0xe')]);router[_0x7238('0x8')](_0x7238('0xf'),auth['isAuthenticated'](),controller['getMembers']);router[_0x7238('0x8')](_0x7238('0x10'),auth[_0x7238('0x9')](),controller[_0x7238('0x11')]);router[_0x7238('0x8')]('/:id/users',auth[_0x7238('0x9')](),controller[_0x7238('0x12')]);router[_0x7238('0x13')]('/',auth['isAuthenticated'](),controller[_0x7238('0x14')]);router[_0x7238('0x13')](_0x7238('0x10'),auth[_0x7238('0x9')](),controller[_0x7238('0x15')]);router[_0x7238('0x13')](_0x7238('0x16'),auth[_0x7238('0x9')](),controller[_0x7238('0x17')]);router[_0x7238('0x18')](_0x7238('0xd'),auth[_0x7238('0x9')](),controller[_0x7238('0x19')]);router[_0x7238('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x7238('0x1b')]);router[_0x7238('0x1a')]('/:id/teams',auth[_0x7238('0x9')](),controller[_0x7238('0x1c')]);router['delete'](_0x7238('0x16'),auth[_0x7238('0x9')](),controller[_0x7238('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x68af=['post','create','addTeams','addAgents','/:id','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','/:id/users'];(function(_0x352b7c,_0xf3c28b){var _0x2f96ff=function(_0x393352){while(--_0x393352){_0x352b7c['push'](_0x352b7c['shift']());}};_0x2f96ff(++_0xf3c28b);}(_0x68af,0xf2));var _0xf68a=function(_0x219632,_0x476c58){_0x219632=_0x219632-0x0;var _0x192b37=_0x68af[_0x219632];return _0x192b37;};'use strict';var multer=require(_0xf68a('0x0'));var util=require(_0xf68a('0x1'));var path=require(_0xf68a('0x2'));var timeout=require(_0xf68a('0x3'));var express=require(_0xf68a('0x4'));var router=express[_0xf68a('0x5')]();var fs_extra=require(_0xf68a('0x6'));var auth=require(_0xf68a('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf68a('0x8'));router[_0xf68a('0x9')]('/',auth[_0xf68a('0xa')](),controller[_0xf68a('0xb')]);router[_0xf68a('0x9')](_0xf68a('0xc'),auth[_0xf68a('0xa')](),controller[_0xf68a('0xd')]);router[_0xf68a('0x9')]('/:id',auth[_0xf68a('0xa')](),controller[_0xf68a('0xe')]);router[_0xf68a('0x9')](_0xf68a('0xf'),auth['isAuthenticated'](),controller[_0xf68a('0x10')]);router[_0xf68a('0x9')](_0xf68a('0x11'),auth['isAuthenticated'](),controller['getTeams']);router[_0xf68a('0x9')](_0xf68a('0x12'),auth[_0xf68a('0xa')](),controller['getAgents']);router[_0xf68a('0x13')]('/',auth[_0xf68a('0xa')](),controller[_0xf68a('0x14')]);router[_0xf68a('0x13')](_0xf68a('0x11'),auth[_0xf68a('0xa')](),controller[_0xf68a('0x15')]);router[_0xf68a('0x13')](_0xf68a('0x12'),auth[_0xf68a('0xa')](),controller[_0xf68a('0x16')]);router['put'](_0xf68a('0x17'),auth[_0xf68a('0xa')](),controller[_0xf68a('0x18')]);router['delete'](_0xf68a('0x17'),auth[_0xf68a('0xa')](),controller['destroy']);router[_0xf68a('0x19')](_0xf68a('0x11'),auth[_0xf68a('0xa')](),controller[_0xf68a('0x1a')]);router[_0xf68a('0x19')](_0xf68a('0x12'),auth[_0xf68a('0xa')](),controller[_0xf68a('0x1b')]);module[_0xf68a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index ec435cb..1978178 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 _0x38e9=['name','INTEGER','ENUM','beepall','exports'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x38e9,0x19e));var _0x938e=function(_0x44a3b0,_0x352810){_0x44a3b0=_0x44a3b0-0x0;var _0x39e6f6=_0x38e9[_0x44a3b0];return _0x39e6f6;};'use strict';var Sequelize=require('sequelize');module[_0x938e('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x938e('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x938e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x938e('0x3')]('rrmemory',_0x938e('0x4'),'roundrobin')}}; \ No newline at end of file +var _0xb7df=['INTEGER','ENUM','sequelize','exports','STRING'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xb7df,0x13d));var _0xfb7d=function(_0x3691af,_0x536a8b){_0x3691af=_0x3691af-0x0;var _0x50a129=_0xb7df[_0x3691af];return _0x50a129;};'use strict';var Sequelize=require(_0xfb7d('0x0'));module[_0xfb7d('0x1')]={'name':{'type':Sequelize[_0xfb7d('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfb7d('0x2')]},'timeout':{'type':Sequelize[_0xfb7d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfb7d('0x4')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index fb8de11..4959914 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 _0x4306=['length','hasOwnProperty','nolimit','limit','order','sort','pick','MailQueueId','filter','findAll','User','findAndCountAll','UserId','mailPause','updatedAt','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','union','compact','value','transaction','isEmpty','addAgents','omit','removeAgents','isArray','userMailQueue:remove','getAgents','options','bluebird','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','count','offset','set','Content-Range','then','get','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','include','query','MailQueue','rows','catch','show','params','keys','filters','intersection','model','fields','attributes','includeAll','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','MailQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','body','describe','UserMailQueue'];(function(_0x2470fb,_0x4ccd34){var _0x2d781d=function(_0x34c310){while(--_0x34c310){_0x2470fb['push'](_0x2470fb['shift']());}};_0x2d781d(++_0x4ccd34);}(_0x4306,0xaf));var _0x6430=function(_0x37e900,_0x32919c){_0x37e900=_0x37e900-0x0;var _0x2a7a7c=_0x4306[_0x37e900];return _0x2a7a7c;};'use strict';var BPromise=require(_0x6430('0x0'));var util=require('util');var _=require('lodash');var squel=require('squel');var Redis=require('ioredis');var qs=require(_0x6430('0x1'));var logger=require(_0x6430('0x2'))('api');var config=require(_0x6430('0x3'));var db=require(_0x6430('0x4'))['db'];config[_0x6430('0x5')]=_['defaults'](config[_0x6430('0x5')],{'host':_0x6430('0x6'),'port':0x18eb});var socket=require(_0x6430('0x7'))(new Redis(config[_0x6430('0x5')]));require('./mailQueue.socket')[_0x6430('0x8')](socket);function respondWithStatusCode(_0x3f94b2,_0x552283){_0x552283=_0x552283||0xcc;return function(_0x5c65f8){if(_0x5c65f8){return _0x3f94b2[_0x6430('0x9')](_0x552283);}return _0x3f94b2['status'](_0x552283)['end']();};}function respondWithResult(_0x5955ae,_0x2a50f1){_0x2a50f1=_0x2a50f1||0xc8;return function(_0x73687c){if(_0x73687c){return _0x5955ae[_0x6430('0xa')](_0x2a50f1)[_0x6430('0xb')](_0x73687c);}};}function respondWithFilteredResult(_0x4097d7,_0x42c7ee){return function(_0x5bad3c){if(_0x5bad3c){var _0x11eb91=typeof _0x42c7ee['offset']===_0x6430('0xc')&&typeof _0x42c7ee['limit']==='undefined';var _0x3fb29e=_0x5bad3c[_0x6430('0xd')];var _0xf1b53=_0x11eb91?0x0:_0x42c7ee[_0x6430('0xe')];var _0x311917=_0x11eb91?_0x5bad3c[_0x6430('0xd')]:_0x42c7ee['offset']+_0x42c7ee['limit'];var _0x37cb1d;if(_0x311917>=_0x3fb29e){_0x311917=_0x3fb29e;_0x37cb1d=0xc8;}else{_0x37cb1d=0xce;}_0x4097d7[_0x6430('0xa')](_0x37cb1d);return _0x4097d7[_0x6430('0xf')](_0x6430('0x10'),_0xf1b53+'-'+_0x311917+'/'+_0x3fb29e)[_0x6430('0xb')](_0x5bad3c);}return null;};}function saveUpdates(_0x1baa04){return function(_0x2092c7){if(_0x2092c7){return _0x2092c7['update'](_0x1baa04)[_0x6430('0x11')](function(_0x2c2ee8){return _0x2c2ee8;});}return null;};}function removeEntity(_0x59ac8e){return function(_0x42ebc7){if(_0x42ebc7){return _0x42ebc7['destroy']()[_0x6430('0x11')](function(){var _0x5ee2af=_0x42ebc7[_0x6430('0x12')]({'plain':!![]});var _0x2ea1a2='MailQueues';return db['UserProfileResource'][_0x6430('0x13')]({'where':{'type':_0x2ea1a2,'resourceId':_0x5ee2af['id']}})[_0x6430('0x11')](function(){return _0x42ebc7;});})[_0x6430('0x11')](function(){_0x59ac8e[_0x6430('0xa')](0xcc)[_0x6430('0x14')]();});}};}function handleEntityNotFound(_0x46e1a8){return function(_0x274305){if(!_0x274305){_0x46e1a8['sendStatus'](0x194);}return _0x274305;};}function handleError(_0x1f6364,_0x369310){_0x369310=_0x369310||0x1f4;return function(_0x3c53a4){logger[_0x6430('0x15')](_0x3c53a4[_0x6430('0x16')]);if(_0x3c53a4[_0x6430('0x17')]){delete _0x3c53a4[_0x6430('0x17')];}_0x1f6364[_0x6430('0xa')](_0x369310)[_0x6430('0x18')](_0x3c53a4);};}exports[_0x6430('0x19')]=function(_0x3c53ff,_0x64967b){var _0x32c4be={};var _0x3fc4a0={'count':0x0,'rows':[]};var _0x4f5d95=_[_0x6430('0x1a')](db['MailQueue'][_0x6430('0x1b')],function(_0x20f77f){return{'name':_0x20f77f[_0x6430('0x1c')],'type':_0x20f77f[_0x6430('0x1d')][_0x6430('0x1e')]};});_0x32c4be=qs[_0x6430('0x1f')](_0x4f5d95,_0x3c53ff);var _0x3c0edd={'where':_0x32c4be[_0x6430('0x20')]};return db['MailQueue'][_0x6430('0xd')](_0x3c0edd)[_0x6430('0x11')](function(_0x1d18da){_0x3fc4a0[_0x6430('0xd')]=_0x1d18da;_0x32c4be[_0x6430('0x21')]=qs['include'](_0x3c53ff[_0x6430('0x22')]);return db[_0x6430('0x23')]['findAll'](_0x32c4be);})[_0x6430('0x11')](function(_0x12cce4){_0x3fc4a0[_0x6430('0x24')]=_0x12cce4;return _0x3fc4a0;})[_0x6430('0x11')](respondWithFilteredResult(_0x64967b,_0x32c4be))[_0x6430('0x25')](handleError(_0x64967b,null));};exports[_0x6430('0x26')]=function(_0x1ffcd6,_0x8de278){var _0xd94d85={'raw':!![],'where':{'id':_0x1ffcd6[_0x6430('0x27')]['id']}},_0x4d26ce={};_0x4d26ce['model']=_[_0x6430('0x28')](db[_0x6430('0x23')][_0x6430('0x1b')]);_0x4d26ce[_0x6430('0x22')]=_[_0x6430('0x28')](_0x1ffcd6[_0x6430('0x22')]);_0x4d26ce[_0x6430('0x29')]=_[_0x6430('0x2a')](_0x4d26ce['model'],_0x4d26ce[_0x6430('0x22')]);_0xd94d85['attributes']=_[_0x6430('0x2a')](_0x4d26ce[_0x6430('0x2b')],qs[_0x6430('0x2c')](_0x1ffcd6[_0x6430('0x22')][_0x6430('0x2c')]));_0xd94d85[_0x6430('0x2d')]=_0xd94d85['attributes']['length']?_0xd94d85[_0x6430('0x2d')]:_0x4d26ce[_0x6430('0x2b')];if(_0x1ffcd6[_0x6430('0x22')][_0x6430('0x2e')]){_0xd94d85[_0x6430('0x21')]=[{'all':!![]}];}_0xd94d85=_[_0x6430('0x2f')]({},_0xd94d85,_0x1ffcd6['options']);return db[_0x6430('0x23')][_0x6430('0x30')](_0xd94d85)[_0x6430('0x11')](handleEntityNotFound(_0x8de278,null))[_0x6430('0x11')](respondWithResult(_0x8de278,null))['catch'](handleError(_0x8de278,null));};exports['create']=function(_0x13b16b,_0x4998bc){return db[_0x6430('0x23')][_0x6430('0x31')](_0x13b16b['body'],{})['then'](function(_0x160368){var _0x2f2ebc=_0x13b16b[_0x6430('0x32')]['get']({'plain':!![]});if(!_0x2f2ebc)throw new Error(_0x6430('0x33'));if(_0x2f2ebc['role']==='user'){var _0x336ab2=_0x160368[_0x6430('0x12')]({'plain':!![]});var _0xfec9e0=_0x6430('0x34');return db[_0x6430('0x35')][_0x6430('0x30')]({'where':{'name':_0xfec9e0,'userProfileId':_0x2f2ebc[_0x6430('0x36')]},'raw':!![]})[_0x6430('0x11')](function(_0x126bd3){if(_0x126bd3&&_0x126bd3[_0x6430('0x37')]===0x0){return db[_0x6430('0x38')][_0x6430('0x31')]({'name':_0x336ab2['name'],'resourceId':_0x336ab2['id'],'type':_0x126bd3[_0x6430('0x17')],'sectionId':_0x126bd3['id']},{})[_0x6430('0x11')](function(){return _0x160368;});}else{return _0x160368;}})[_0x6430('0x25')](function(_0x33d4ea){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33d4ea);throw _0x33d4ea;});}return _0x160368;})[_0x6430('0x11')](respondWithResult(_0x4998bc,0xc9))[_0x6430('0x25')](handleError(_0x4998bc,null));};exports[_0x6430('0x39')]=function(_0xea83d8,_0x43fca9){if(_0xea83d8[_0x6430('0x3a')]['id']){delete _0xea83d8[_0x6430('0x3a')]['id'];}return db[_0x6430('0x23')]['find']({'where':{'id':_0xea83d8[_0x6430('0x27')]['id']}})['then'](handleEntityNotFound(_0x43fca9,null))['then'](saveUpdates(_0xea83d8[_0x6430('0x3a')],null))['then'](respondWithResult(_0x43fca9,null))[_0x6430('0x25')](handleError(_0x43fca9,null));};exports[_0x6430('0x13')]=function(_0x220534,_0x5533a8){return db[_0x6430('0x23')][_0x6430('0x30')]({'where':{'id':_0x220534[_0x6430('0x27')]['id']}})['then'](handleEntityNotFound(_0x5533a8,null))[_0x6430('0x11')](removeEntity(_0x5533a8,null))[_0x6430('0x25')](handleError(_0x5533a8,null));};exports[_0x6430('0x3b')]=function(_0x668a47,_0x41c166){return db[_0x6430('0x23')][_0x6430('0x3b')]()[_0x6430('0x11')](respondWithResult(_0x41c166,null))['catch'](handleError(_0x41c166,null));};exports['getMembers']=function(_0x266038,_0x181efe){var _0x1866a4={'raw':!![],'where':{}},_0x84c0d2={},_0x2e9ce3;return db[_0x6430('0x23')]['findOne']({'where':{'id':_0x266038['params']['id']}})[_0x6430('0x11')](handleEntityNotFound(_0x181efe,null))[_0x6430('0x11')](function(_0x4a771d){if(_0x4a771d){_0x2e9ce3=_0x4a771d[_0x6430('0x12')]({'plain':!![]});_0x84c0d2[_0x6430('0x2b')]=_[_0x6430('0x28')](db[_0x6430('0x3c')][_0x6430('0x1b')]);_0x84c0d2[_0x6430('0x22')]=_[_0x6430('0x28')](_0x266038['query']);_0x84c0d2[_0x6430('0x29')]=_[_0x6430('0x2a')](_0x84c0d2[_0x6430('0x2b')],_0x84c0d2['query']);_0x1866a4[_0x6430('0x2d')]=_[_0x6430('0x2a')](_0x84c0d2[_0x6430('0x2b')],qs[_0x6430('0x2c')](_0x266038[_0x6430('0x22')][_0x6430('0x2c')]));_0x1866a4[_0x6430('0x2d')]=_0x1866a4[_0x6430('0x2d')][_0x6430('0x3d')]?_0x1866a4[_0x6430('0x2d')]:_0x84c0d2[_0x6430('0x2b')];if(!_0x266038[_0x6430('0x22')][_0x6430('0x3e')](_0x6430('0x3f'))){_0x1866a4[_0x6430('0x40')]=qs[_0x6430('0x40')](_0x266038[_0x6430('0x22')][_0x6430('0x40')]);_0x1866a4[_0x6430('0xe')]=qs[_0x6430('0xe')](_0x266038['query'][_0x6430('0xe')]);}_0x1866a4[_0x6430('0x41')]=qs[_0x6430('0x42')](_0x266038[_0x6430('0x22')]['sort']);_0x1866a4[_0x6430('0x20')]=qs[_0x6430('0x29')](_[_0x6430('0x43')](_0x266038[_0x6430('0x22')],_0x84c0d2['filters']));_0x1866a4[_0x6430('0x20')][_0x6430('0x44')]=_0x4a771d['id'];if(_0x266038[_0x6430('0x22')][_0x6430('0x45')]){_0x1866a4['where']=_[_0x6430('0x2f')](_0x1866a4[_0x6430('0x20')],{'$or':_[_0x6430('0x1a')](_0x1866a4['attributes'],function(_0x99a605){var _0x58cf0a={};_0x58cf0a[_0x99a605]={'$like':'%'+_0x266038[_0x6430('0x22')][_0x6430('0x45')]+'%'};return _0x58cf0a;})});}_0x1866a4=_[_0x6430('0x2f')]({},_0x1866a4,_0x266038['options']);return db[_0x6430('0x3c')][_0x6430('0x46')](_0x1866a4);}})[_0x6430('0x11')](function(_0xf29eaf){if(_0xf29eaf){return db[_0x6430('0x47')][_0x6430('0x48')]({'where':{'id':_[_0x6430('0x1a')](_0xf29eaf,_0x6430('0x49')),'role':'agent'},'attributes':['id',_0x6430('0x17'),_0x6430('0x4a'),_0x6430('0x4b'),'createdAt']});}})[_0x6430('0x11')](function(_0x47a185){if(_0x47a185){return{'count':_0x47a185[_0x6430('0xd')],'rows':_[_0x6430('0x1a')](_0x47a185[_0x6430('0x24')],function(_0x276a52){return{'membername':_0x276a52['name'],'UserId':_0x276a52['id'],'queue_name':_0x2e9ce3[_0x6430('0x17')],'MailQueueId':_0x2e9ce3['id'],'interface':util['format'](_0x6430('0x4c'),_0x6430('0x4d'),_0x276a52[_0x6430('0x17')]),'penalty':0x0,'paused':_0x276a52[_0x6430('0x4a')],'createdAt':_0x276a52['createdAt'],'updatedAt':_0x276a52[_0x6430('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6430('0x11')](respondWithFilteredResult(_0x181efe,_0x1866a4))[_0x6430('0x25')](handleError(_0x181efe,null));};exports[_0x6430('0x4e')]=function(_0x4e6652,_0x1b5483){var _0x4fb524={};var _0x55fd48={};var _0xdc9e3a;var _0x570281;return db[_0x6430('0x23')][_0x6430('0x4f')]({'where':{'id':_0x4e6652['params']['id']}})['then'](handleEntityNotFound(_0x1b5483,null))[_0x6430('0x11')](function(_0x2add3){if(_0x2add3){_0xdc9e3a=_0x2add3;_0x55fd48['model']=_[_0x6430('0x28')](db[_0x6430('0x50')]['rawAttributes']);_0x55fd48[_0x6430('0x22')]=_['keys'](_0x4e6652[_0x6430('0x22')]);_0x55fd48[_0x6430('0x29')]=_[_0x6430('0x2a')](_0x55fd48[_0x6430('0x2b')],_0x55fd48[_0x6430('0x22')]);_0x4fb524[_0x6430('0x2d')]=_[_0x6430('0x2a')](_0x55fd48[_0x6430('0x2b')],qs[_0x6430('0x2c')](_0x4e6652[_0x6430('0x22')]['fields']));_0x4fb524[_0x6430('0x2d')]=_0x4fb524[_0x6430('0x2d')][_0x6430('0x3d')]?_0x4fb524[_0x6430('0x2d')]:_0x55fd48[_0x6430('0x2b')];_0x4fb524['order']=qs['sort'](_0x4e6652[_0x6430('0x22')][_0x6430('0x42')]);_0x4fb524[_0x6430('0x20')]=qs[_0x6430('0x29')](_[_0x6430('0x43')](_0x4e6652['query'],_0x55fd48['filters']));if(_0x4e6652[_0x6430('0x22')][_0x6430('0x45')]){_0x4fb524['where']=_[_0x6430('0x2f')](_0x4fb524[_0x6430('0x20')],{'$or':_[_0x6430('0x1a')](_0x4fb524[_0x6430('0x2d')],function(_0x47b230){var _0x32d77b={};_0x32d77b[_0x47b230]={'$like':'%'+_0x4e6652['query']['filter']+'%'};return _0x32d77b;})});}_0x4fb524=_[_0x6430('0x2f')]({},_0x4fb524,_0x4e6652['options']);return _0xdc9e3a[_0x6430('0x4e')](_0x4fb524);}})['then'](function(_0x3fbe7f){if(_0x3fbe7f){_0x570281=_0x3fbe7f['length'];if(!_0x4e6652[_0x6430('0x22')][_0x6430('0x3e')]('nolimit')){_0x4fb524[_0x6430('0x40')]=qs[_0x6430('0x40')](_0x4e6652[_0x6430('0x22')][_0x6430('0x40')]);_0x4fb524[_0x6430('0xe')]=qs[_0x6430('0xe')](_0x4e6652[_0x6430('0x22')]['offset']);}return _0xdc9e3a['getTeams'](_0x4fb524);}})[_0x6430('0x11')](function(_0x774e8c){if(_0x774e8c){return _0x774e8c?{'count':_0x570281,'rows':_0x774e8c}:null;}})[_0x6430('0x11')](respondWithResult(_0x1b5483,null))[_0x6430('0x25')](handleError(_0x1b5483,null));};exports[_0x6430('0x51')]=function(_0x13038a,_0x1a96ba){var _0x1d7f23=_0x13038a['body'][_0x6430('0x52')];return db[_0x6430('0x50')][_0x6430('0x46')]({'where':{'id':_0x1d7f23},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6430('0x53'),'attributes':['id',_0x6430('0x17'),_0x6430('0x54'),_0x6430('0x55'),_0x6430('0x56')],'raw':!![]}]})['then'](function(_0x5e6e91){if(_0x5e6e91){var _0x6e819b=_[_0x6430('0x57')](_0x5e6e91,function(_0xd0065e){var _0x37c5fc=_0xd0065e['get']({'plain':!![]});return _0x37c5fc[_0x6430('0x53')];});return db['MailQueue'][_0x6430('0x30')]({'where':{'id':_0x13038a[_0x6430('0x27')]['id']}})[_0x6430('0x11')](function(_0x1290e6){return db[_0x6430('0x58')]['transaction'](function(_0x3f29e6){return _0x1290e6[_0x6430('0x51')](_0x1d7f23,{'transaction':_0x3f29e6})[_0x6430('0x11')](function(){return BPromise[_0x6430('0x59')](_0x6e819b,function(_0x4f44a8){return db[_0x6430('0x3c')][_0x6430('0x5a')]({'where':{'UserId':_0x4f44a8['id'],'MailQueueId':_0x13038a[_0x6430('0x27')]['id']},'transaction':_0x3f29e6});});})[_0x6430('0x11')](function(){_0x6e819b[_0x6430('0x5b')](function(_0x15ed94){socket[_0x6430('0x5c')](_0x6430('0x5d'),{'UserId':_0x15ed94['id'],'MailQueueId':_0x1290e6['id']});});});});});}})[_0x6430('0x11')](respondWithStatusCode(_0x1a96ba,null))[_0x6430('0x25')](handleError(_0x1a96ba,null));};exports[_0x6430('0x5e')]=function(_0x5072bb,_0x47b909){return db[_0x6430('0x50')][_0x6430('0x46')]({'where':{'id':_0x5072bb['query'][_0x6430('0x52')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6430('0x53'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x47b909,null))[_0x6430('0x11')](function(_0xbfd20f){var _0xc17ad3=_[_0x6430('0x1a')](_0xbfd20f,'id');var _0x1d80ed=[];var _0x35c3ac=[];var _0x312598=squel[_0x6430('0x5f')]();_0x312598['field'](_0x6430('0x60'))[_0x6430('0x61')](_0x6430('0x62'),'tq')['join'](_0x6430('0x63'),'ut',_0x6430('0x64'))[_0x6430('0x20')](_0x6430('0x65'),_0x5072bb[_0x6430('0x27')]['id']);for(var _0x214684=0x0;_0x214684<_0xbfd20f[_0x6430('0x3d')];_0x214684+=0x1){let _0x4fa763=_0xbfd20f[_0x214684];for(var _0x42e336=0x0;_0x42e336<_0x4fa763[_0x6430('0x53')]['length'];_0x42e336+=0x1){let _0x5c1a67=_0x4fa763[_0x6430('0x53')][_0x42e336];var _0xc46f8a=_0x312598[_0x6430('0x66')]();_0xc46f8a[_0x6430('0x20')](_0x6430('0x67'),_0x5c1a67['id']);_0x35c3ac['push'](db[_0x6430('0x58')][_0x6430('0x22')](_0xc46f8a[_0x6430('0x68')](),{'type':db[_0x6430('0x58')]['QueryTypes'][_0x6430('0x69')]})[_0x6430('0x11')](function(_0x45242b){if(_0x45242b[_0x6430('0x3d')]===0x1){return _0x5c1a67['id'];}else{var _0x73d99=_['every'](_[_0x6430('0x1a')](_0x45242b,'TeamId'),function(_0x40073e){return _['includes'](_0xc17ad3,_0x40073e);});if(_0x73d99){return _0x5c1a67['id'];}}}));}}return BPromise['all'](_0x35c3ac)[_0x6430('0x11')](function(_0x5952cb){_0x1d80ed=_(_0x1d80ed)[_0x6430('0x6a')](_0x5952cb)[_0x6430('0x6b')]()[_0x6430('0x6c')]();return db['MailQueue'][_0x6430('0x30')]({'where':{'id':_0x5072bb[_0x6430('0x27')]['id']}})[_0x6430('0x11')](function(_0x538574){return db['sequelize'][_0x6430('0x6d')](function(_0x190778){return _0x538574[_0x6430('0x5e')](_0x5072bb['query'][_0x6430('0x52')],{'transaction':_0x190778})[_0x6430('0x11')](function(){if(!_[_0x6430('0x6e')](_0x1d80ed)){return _0x538574['removeAgents'](_0x1d80ed,{'transaction':_0x190778});}})[_0x6430('0x11')](function(){_0x1d80ed[_0x6430('0x5b')](function(_0x19bf6c){socket['emit']('userMailQueue:remove',{'UserId':_0x19bf6c,'MailQueueId':_0x538574['id']});});});});});});})[_0x6430('0x11')](respondWithStatusCode(_0x47b909,null))[_0x6430('0x25')](handleError(_0x47b909,null));};exports[_0x6430('0x6f')]=function(_0x402855,_0xe3993b){return db[_0x6430('0x23')][_0x6430('0x30')]({'where':{'id':_0x402855[_0x6430('0x27')]['id']}})[_0x6430('0x11')](handleEntityNotFound(_0xe3993b,null))[_0x6430('0x11')](function(_0x3a06b6){if(_0x3a06b6){return _0x3a06b6[_0x6430('0x6f')](_0x402855['body'][_0x6430('0x52')],_[_0x6430('0x70')](_0x402855[_0x6430('0x3a')],['ids','id'])||{})['spread'](function(_0x3f6969){for(var _0x23675c=0x0;_0x23675c<_0x402855[_0x6430('0x3a')][_0x6430('0x52')][_0x6430('0x3d')];_0x23675c+=0x1){socket[_0x6430('0x5c')](_0x6430('0x5d'),{'UserId':Number(_0x402855['body']['ids'][_0x23675c]),'MailQueueId':Number(_0x402855[_0x6430('0x27')]['id'])});}return _0x3f6969;});}})[_0x6430('0x11')](respondWithResult(_0xe3993b,null))[_0x6430('0x25')](handleError(_0xe3993b,null));};exports[_0x6430('0x71')]=function(_0x5b0276,_0x6d712b){return db[_0x6430('0x23')][_0x6430('0x30')]({'where':{'id':_0x5b0276[_0x6430('0x27')]['id']}})[_0x6430('0x11')](handleEntityNotFound(_0x6d712b,null))[_0x6430('0x11')](function(_0x470e92){if(_0x470e92){return _0x470e92[_0x6430('0x71')](_0x5b0276[_0x6430('0x22')][_0x6430('0x52')])['then'](function(){if(_[_0x6430('0x72')](_0x5b0276[_0x6430('0x22')][_0x6430('0x52')])){for(var _0xc54d0f=0x0;_0xc54d0f<_0x5b0276['query']['ids'][_0x6430('0x3d')];_0xc54d0f+=0x1){socket[_0x6430('0x5c')](_0x6430('0x73'),{'UserId':Number(_0x5b0276['query']['ids'][_0xc54d0f]),'MailQueueId':Number(_0x5b0276['params']['id'])});}}else{socket['emit']('userMailQueue:remove',{'UserId':Number(_0x5b0276[_0x6430('0x22')][_0x6430('0x52')]),'MailQueueId':Number(_0x5b0276[_0x6430('0x27')]['id'])});}});}})[_0x6430('0x11')](respondWithStatusCode(_0x6d712b,null))[_0x6430('0x25')](handleError(_0x6d712b,null));};exports[_0x6430('0x74')]=function(_0x1302c7,_0x14d51f){var _0x276378={};var _0x48dc9f={};var _0x4556ac;var _0xd279e0;return db[_0x6430('0x23')][_0x6430('0x4f')]({'where':{'id':_0x1302c7[_0x6430('0x27')]['id']}})[_0x6430('0x11')](handleEntityNotFound(_0x14d51f,null))[_0x6430('0x11')](function(_0x5ec162){if(_0x5ec162){_0x4556ac=_0x5ec162;_0x48dc9f[_0x6430('0x2b')]=_['keys'](db[_0x6430('0x47')][_0x6430('0x1b')]);_0x48dc9f[_0x6430('0x22')]=_[_0x6430('0x28')](_0x1302c7[_0x6430('0x22')]);_0x48dc9f[_0x6430('0x29')]=_[_0x6430('0x2a')](_0x48dc9f[_0x6430('0x2b')],_0x48dc9f[_0x6430('0x22')]);_0x276378[_0x6430('0x2d')]=_[_0x6430('0x2a')](_0x48dc9f[_0x6430('0x2b')],qs[_0x6430('0x2c')](_0x1302c7['query'][_0x6430('0x2c')]));_0x276378[_0x6430('0x2d')]=_0x276378[_0x6430('0x2d')][_0x6430('0x3d')]?_0x276378[_0x6430('0x2d')]:_0x48dc9f[_0x6430('0x2b')];_0x276378['order']=qs[_0x6430('0x42')](_0x1302c7[_0x6430('0x22')][_0x6430('0x42')]);_0x276378[_0x6430('0x20')]=qs['filters'](_['pick'](_0x1302c7[_0x6430('0x22')],_0x48dc9f[_0x6430('0x29')]));if(_0x1302c7[_0x6430('0x22')][_0x6430('0x45')]){_0x276378[_0x6430('0x20')]=_[_0x6430('0x2f')](_0x276378[_0x6430('0x20')],{'$or':_[_0x6430('0x1a')](_0x276378[_0x6430('0x2d')],function(_0x92b61){var _0x3996c8={};_0x3996c8[_0x92b61]={'$like':'%'+_0x1302c7['query']['filter']+'%'};return _0x3996c8;})});}_0x276378=_[_0x6430('0x2f')]({},_0x276378,_0x1302c7[_0x6430('0x75')]);return _0x4556ac[_0x6430('0x74')](_0x276378);}})[_0x6430('0x11')](function(_0x49fd63){if(_0x49fd63){_0xd279e0=_0x49fd63[_0x6430('0x3d')];if(!_0x1302c7['query']['hasOwnProperty'](_0x6430('0x3f'))){_0x276378['limit']=qs[_0x6430('0x40')](_0x1302c7['query'][_0x6430('0x40')]);_0x276378[_0x6430('0xe')]=qs[_0x6430('0xe')](_0x1302c7[_0x6430('0x22')][_0x6430('0xe')]);}return _0x4556ac[_0x6430('0x74')](_0x276378);}})[_0x6430('0x11')](function(_0x57a60b){if(_0x57a60b){return _0x57a60b?{'count':_0xd279e0,'rows':_0x57a60b}:null;}})['then'](respondWithResult(_0x14d51f,null))[_0x6430('0x25')](handleError(_0x14d51f,null));}; \ No newline at end of file +var _0x82d2=['emit','userMailQueue:save','removeTeams','select','field','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','union','compact','value','transaction','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','get','MailQueues','UserProfileResource','destroy','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','key','getOptions','where','include','findAll','rows','catch','params','model','keys','query','filters','intersection','fields','attributes','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','findOne','UserMailQueue','hasOwnProperty','nolimit','order','sort','pick','filter','User','findAndCountAll','UserId','agent','mailPause','updatedAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','each','findOrCreate','forEach'];(function(_0x10e8d6,_0x1ca6ad){var _0x5ea71b=function(_0x2ffef8){while(--_0x2ffef8){_0x10e8d6['push'](_0x10e8d6['shift']());}};_0x5ea71b(++_0x1ca6ad);}(_0x82d2,0x19c));var _0x282d=function(_0x5b59ee,_0xe7449e){_0x5b59ee=_0x5b59ee-0x0;var _0x5a09c0=_0x82d2[_0x5b59ee];return _0x5a09c0;};'use strict';var BPromise=require(_0x282d('0x0'));var util=require(_0x282d('0x1'));var _=require(_0x282d('0x2'));var squel=require('squel');var Redis=require(_0x282d('0x3'));var qs=require(_0x282d('0x4'));var logger=require(_0x282d('0x5'))(_0x282d('0x6'));var config=require(_0x282d('0x7'));var db=require(_0x282d('0x8'))['db'];config['redis']=_[_0x282d('0x9')](config[_0x282d('0xa')],{'host':_0x282d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x282d('0xa')]));require(_0x282d('0xc'))[_0x282d('0xd')](socket);function respondWithStatusCode(_0x10c2e5,_0x1143dc){_0x1143dc=_0x1143dc||0xcc;return function(_0x440b0f){if(_0x440b0f){return _0x10c2e5[_0x282d('0xe')](_0x1143dc);}return _0x10c2e5[_0x282d('0xf')](_0x1143dc)[_0x282d('0x10')]();};}function respondWithResult(_0x2bc4f0,_0x1692c1){_0x1692c1=_0x1692c1||0xc8;return function(_0xf3e64a){if(_0xf3e64a){return _0x2bc4f0[_0x282d('0xf')](_0x1692c1)[_0x282d('0x11')](_0xf3e64a);}};}function respondWithFilteredResult(_0x1bb707,_0x2bb18b){return function(_0x3117a1){if(_0x3117a1){var _0x21bc78=typeof _0x2bb18b[_0x282d('0x12')]===_0x282d('0x13')&&typeof _0x2bb18b[_0x282d('0x14')]==='undefined';var _0x1f68ed=_0x3117a1['count'];var _0x466979=_0x21bc78?0x0:_0x2bb18b[_0x282d('0x12')];var _0x13341e=_0x21bc78?_0x3117a1[_0x282d('0x15')]:_0x2bb18b[_0x282d('0x12')]+_0x2bb18b[_0x282d('0x14')];var _0x53236c;if(_0x13341e>=_0x1f68ed){_0x13341e=_0x1f68ed;_0x53236c=0xc8;}else{_0x53236c=0xce;}_0x1bb707[_0x282d('0xf')](_0x53236c);return _0x1bb707[_0x282d('0x16')](_0x282d('0x17'),_0x466979+'-'+_0x13341e+'/'+_0x1f68ed)['json'](_0x3117a1);}return null;};}function saveUpdates(_0x53ba5c){return function(_0x45c93c){if(_0x45c93c){return _0x45c93c[_0x282d('0x18')](_0x53ba5c)[_0x282d('0x19')](function(_0x31c481){return _0x31c481;});}return null;};}function removeEntity(_0x1ea6d7){return function(_0x3d2ee2){if(_0x3d2ee2){return _0x3d2ee2['destroy']()[_0x282d('0x19')](function(){var _0x22e60f=_0x3d2ee2[_0x282d('0x1a')]({'plain':!![]});var _0x4009ef=_0x282d('0x1b');return db[_0x282d('0x1c')][_0x282d('0x1d')]({'where':{'type':_0x4009ef,'resourceId':_0x22e60f['id']}})[_0x282d('0x19')](function(){return _0x3d2ee2;});})[_0x282d('0x19')](function(){_0x1ea6d7['status'](0xcc)[_0x282d('0x10')]();});}};}function handleEntityNotFound(_0x2e3269){return function(_0x503d55){if(!_0x503d55){_0x2e3269[_0x282d('0xe')](0x194);}return _0x503d55;};}function handleError(_0x51a34d,_0x23efff){_0x23efff=_0x23efff||0x1f4;return function(_0x3f29b6){logger[_0x282d('0x1e')](_0x3f29b6[_0x282d('0x1f')]);if(_0x3f29b6['name']){delete _0x3f29b6[_0x282d('0x20')];}_0x51a34d['status'](_0x23efff)[_0x282d('0x21')](_0x3f29b6);};}exports[_0x282d('0x22')]=function(_0x451af5,_0x2f1299){var _0x18a361={};var _0x4dea46={'count':0x0,'rows':[]};var _0x1345a9=_[_0x282d('0x23')](db[_0x282d('0x24')][_0x282d('0x25')],function(_0x38df7a){return{'name':_0x38df7a[_0x282d('0x26')],'type':_0x38df7a['type'][_0x282d('0x27')]};});_0x18a361=qs[_0x282d('0x28')](_0x1345a9,_0x451af5);var _0xf4fd84={'where':_0x18a361[_0x282d('0x29')]};return db[_0x282d('0x24')]['count'](_0xf4fd84)[_0x282d('0x19')](function(_0x49cb19){_0x4dea46[_0x282d('0x15')]=_0x49cb19;_0x18a361[_0x282d('0x2a')]=qs[_0x282d('0x2a')](_0x451af5['query']);return db[_0x282d('0x24')][_0x282d('0x2b')](_0x18a361);})['then'](function(_0xeb5b6e){_0x4dea46[_0x282d('0x2c')]=_0xeb5b6e;return _0x4dea46;})[_0x282d('0x19')](respondWithFilteredResult(_0x2f1299,_0x18a361))[_0x282d('0x2d')](handleError(_0x2f1299,null));};exports['show']=function(_0x112d7e,_0x205772){var _0x52973b={'raw':!![],'where':{'id':_0x112d7e[_0x282d('0x2e')]['id']}},_0x4d4680={};_0x4d4680[_0x282d('0x2f')]=_[_0x282d('0x30')](db[_0x282d('0x24')]['rawAttributes']);_0x4d4680[_0x282d('0x31')]=_[_0x282d('0x30')](_0x112d7e['query']);_0x4d4680[_0x282d('0x32')]=_[_0x282d('0x33')](_0x4d4680[_0x282d('0x2f')],_0x4d4680[_0x282d('0x31')]);_0x52973b['attributes']=_[_0x282d('0x33')](_0x4d4680[_0x282d('0x2f')],qs['fields'](_0x112d7e[_0x282d('0x31')][_0x282d('0x34')]));_0x52973b[_0x282d('0x35')]=_0x52973b[_0x282d('0x35')][_0x282d('0x36')]?_0x52973b[_0x282d('0x35')]:_0x4d4680[_0x282d('0x2f')];if(_0x112d7e[_0x282d('0x31')]['includeAll']){_0x52973b['include']=[{'all':!![]}];}_0x52973b=_[_0x282d('0x37')]({},_0x52973b,_0x112d7e[_0x282d('0x38')]);return db[_0x282d('0x24')][_0x282d('0x39')](_0x52973b)[_0x282d('0x19')](handleEntityNotFound(_0x205772,null))[_0x282d('0x19')](respondWithResult(_0x205772,null))['catch'](handleError(_0x205772,null));};exports[_0x282d('0x3a')]=function(_0x3db40a,_0x131706){return db[_0x282d('0x24')][_0x282d('0x3a')](_0x3db40a[_0x282d('0x3b')],{})['then'](function(_0x2ef781){var _0x2c1f25=_0x3db40a[_0x282d('0x3c')][_0x282d('0x1a')]({'plain':!![]});if(!_0x2c1f25)throw new Error(_0x282d('0x3d'));if(_0x2c1f25[_0x282d('0x3e')]===_0x282d('0x3c')){var _0x5170bd=_0x2ef781[_0x282d('0x1a')]({'plain':!![]});var _0x482840=_0x282d('0x1b');return db[_0x282d('0x3f')][_0x282d('0x39')]({'where':{'name':_0x482840,'userProfileId':_0x2c1f25[_0x282d('0x40')]},'raw':!![]})[_0x282d('0x19')](function(_0x5108a5){if(_0x5108a5&&_0x5108a5[_0x282d('0x41')]===0x0){return db['UserProfileResource']['create']({'name':_0x5170bd[_0x282d('0x20')],'resourceId':_0x5170bd['id'],'type':_0x5108a5[_0x282d('0x20')],'sectionId':_0x5108a5['id']},{})[_0x282d('0x19')](function(){return _0x2ef781;});}else{return _0x2ef781;}})[_0x282d('0x2d')](function(_0x38f18d){logger[_0x282d('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38f18d);throw _0x38f18d;});}return _0x2ef781;})[_0x282d('0x19')](respondWithResult(_0x131706,0xc9))[_0x282d('0x2d')](handleError(_0x131706,null));};exports[_0x282d('0x18')]=function(_0xf355bc,_0x190315){if(_0xf355bc[_0x282d('0x3b')]['id']){delete _0xf355bc['body']['id'];}return db[_0x282d('0x24')]['find']({'where':{'id':_0xf355bc['params']['id']}})['then'](handleEntityNotFound(_0x190315,null))[_0x282d('0x19')](saveUpdates(_0xf355bc[_0x282d('0x3b')],null))[_0x282d('0x19')](respondWithResult(_0x190315,null))[_0x282d('0x2d')](handleError(_0x190315,null));};exports[_0x282d('0x1d')]=function(_0x24bca8,_0x56831b){return db[_0x282d('0x24')][_0x282d('0x39')]({'where':{'id':_0x24bca8[_0x282d('0x2e')]['id']}})[_0x282d('0x19')](handleEntityNotFound(_0x56831b,null))[_0x282d('0x19')](removeEntity(_0x56831b,null))['catch'](handleError(_0x56831b,null));};exports['describe']=function(_0x2c8557,_0x404e67){return db[_0x282d('0x24')][_0x282d('0x42')]()['then'](respondWithResult(_0x404e67,null))['catch'](handleError(_0x404e67,null));};exports['getMembers']=function(_0x5e08ba,_0x39624d){var _0x5db352={'raw':!![],'where':{}},_0x4be135={},_0x1e7e9a;return db[_0x282d('0x24')][_0x282d('0x43')]({'where':{'id':_0x5e08ba[_0x282d('0x2e')]['id']}})['then'](handleEntityNotFound(_0x39624d,null))[_0x282d('0x19')](function(_0x440d65){if(_0x440d65){_0x1e7e9a=_0x440d65[_0x282d('0x1a')]({'plain':!![]});_0x4be135[_0x282d('0x2f')]=_[_0x282d('0x30')](db[_0x282d('0x44')][_0x282d('0x25')]);_0x4be135['query']=_[_0x282d('0x30')](_0x5e08ba[_0x282d('0x31')]);_0x4be135[_0x282d('0x32')]=_[_0x282d('0x33')](_0x4be135[_0x282d('0x2f')],_0x4be135[_0x282d('0x31')]);_0x5db352['attributes']=_[_0x282d('0x33')](_0x4be135['model'],qs[_0x282d('0x34')](_0x5e08ba['query'][_0x282d('0x34')]));_0x5db352[_0x282d('0x35')]=_0x5db352[_0x282d('0x35')][_0x282d('0x36')]?_0x5db352[_0x282d('0x35')]:_0x4be135['model'];if(!_0x5e08ba[_0x282d('0x31')][_0x282d('0x45')](_0x282d('0x46'))){_0x5db352[_0x282d('0x14')]=qs[_0x282d('0x14')](_0x5e08ba['query'][_0x282d('0x14')]);_0x5db352[_0x282d('0x12')]=qs[_0x282d('0x12')](_0x5e08ba['query'][_0x282d('0x12')]);}_0x5db352[_0x282d('0x47')]=qs[_0x282d('0x48')](_0x5e08ba[_0x282d('0x31')][_0x282d('0x48')]);_0x5db352[_0x282d('0x29')]=qs[_0x282d('0x32')](_[_0x282d('0x49')](_0x5e08ba[_0x282d('0x31')],_0x4be135[_0x282d('0x32')]));_0x5db352[_0x282d('0x29')]['MailQueueId']=_0x440d65['id'];if(_0x5e08ba[_0x282d('0x31')][_0x282d('0x4a')]){_0x5db352[_0x282d('0x29')]=_[_0x282d('0x37')](_0x5db352[_0x282d('0x29')],{'$or':_[_0x282d('0x23')](_0x5db352[_0x282d('0x35')],function(_0x12601f){var _0x3f211f={};_0x3f211f[_0x12601f]={'$like':'%'+_0x5e08ba['query']['filter']+'%'};return _0x3f211f;})});}_0x5db352=_['merge']({},_0x5db352,_0x5e08ba[_0x282d('0x38')]);return db['UserMailQueue']['findAll'](_0x5db352);}})[_0x282d('0x19')](function(_0x1eb164){if(_0x1eb164){return db[_0x282d('0x4b')][_0x282d('0x4c')]({'where':{'id':_[_0x282d('0x23')](_0x1eb164,_0x282d('0x4d')),'role':_0x282d('0x4e')},'attributes':['id',_0x282d('0x20'),_0x282d('0x4f'),_0x282d('0x50'),'createdAt']});}})[_0x282d('0x19')](function(_0x4da7c){if(_0x4da7c){return{'count':_0x4da7c[_0x282d('0x15')],'rows':_[_0x282d('0x23')](_0x4da7c[_0x282d('0x2c')],function(_0x11f421){return{'membername':_0x11f421[_0x282d('0x20')],'UserId':_0x11f421['id'],'queue_name':_0x1e7e9a[_0x282d('0x20')],'MailQueueId':_0x1e7e9a['id'],'interface':util[_0x282d('0x51')](_0x282d('0x52'),_0x282d('0x53'),_0x11f421['name']),'penalty':0x0,'paused':_0x11f421[_0x282d('0x4f')],'createdAt':_0x11f421['createdAt'],'updatedAt':_0x11f421[_0x282d('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x39624d,_0x5db352))[_0x282d('0x2d')](handleError(_0x39624d,null));};exports[_0x282d('0x54')]=function(_0x5ce73e,_0x33bbcc){var _0x24722f={};var _0x58cec4={};var _0x177bab;var _0x35251c;return db['MailQueue'][_0x282d('0x43')]({'where':{'id':_0x5ce73e[_0x282d('0x2e')]['id']}})[_0x282d('0x19')](handleEntityNotFound(_0x33bbcc,null))[_0x282d('0x19')](function(_0x15268a){if(_0x15268a){_0x177bab=_0x15268a;_0x58cec4[_0x282d('0x2f')]=_[_0x282d('0x30')](db[_0x282d('0x55')][_0x282d('0x25')]);_0x58cec4[_0x282d('0x31')]=_[_0x282d('0x30')](_0x5ce73e[_0x282d('0x31')]);_0x58cec4[_0x282d('0x32')]=_[_0x282d('0x33')](_0x58cec4[_0x282d('0x2f')],_0x58cec4['query']);_0x24722f[_0x282d('0x35')]=_[_0x282d('0x33')](_0x58cec4['model'],qs[_0x282d('0x34')](_0x5ce73e[_0x282d('0x31')]['fields']));_0x24722f[_0x282d('0x35')]=_0x24722f['attributes'][_0x282d('0x36')]?_0x24722f['attributes']:_0x58cec4['model'];_0x24722f[_0x282d('0x47')]=qs[_0x282d('0x48')](_0x5ce73e[_0x282d('0x31')][_0x282d('0x48')]);_0x24722f[_0x282d('0x29')]=qs[_0x282d('0x32')](_['pick'](_0x5ce73e[_0x282d('0x31')],_0x58cec4[_0x282d('0x32')]));if(_0x5ce73e['query'][_0x282d('0x4a')]){_0x24722f[_0x282d('0x29')]=_['merge'](_0x24722f[_0x282d('0x29')],{'$or':_[_0x282d('0x23')](_0x24722f['attributes'],function(_0x1b1d94){var _0x4e8ab4={};_0x4e8ab4[_0x1b1d94]={'$like':'%'+_0x5ce73e[_0x282d('0x31')][_0x282d('0x4a')]+'%'};return _0x4e8ab4;})});}_0x24722f=_['merge']({},_0x24722f,_0x5ce73e[_0x282d('0x38')]);return _0x177bab[_0x282d('0x54')](_0x24722f);}})[_0x282d('0x19')](function(_0x12ca06){if(_0x12ca06){_0x35251c=_0x12ca06[_0x282d('0x36')];if(!_0x5ce73e[_0x282d('0x31')]['hasOwnProperty'](_0x282d('0x46'))){_0x24722f[_0x282d('0x14')]=qs[_0x282d('0x14')](_0x5ce73e['query'][_0x282d('0x14')]);_0x24722f['offset']=qs[_0x282d('0x12')](_0x5ce73e[_0x282d('0x31')][_0x282d('0x12')]);}return _0x177bab[_0x282d('0x54')](_0x24722f);}})[_0x282d('0x19')](function(_0x467c1f){if(_0x467c1f){return _0x467c1f?{'count':_0x35251c,'rows':_0x467c1f}:null;}})[_0x282d('0x19')](respondWithResult(_0x33bbcc,null))[_0x282d('0x2d')](handleError(_0x33bbcc,null));};exports[_0x282d('0x56')]=function(_0x282fe3,_0x178ddf){var _0x39a8dd=_0x282fe3[_0x282d('0x3b')][_0x282d('0x57')];return db[_0x282d('0x55')][_0x282d('0x2b')]({'where':{'id':_0x39a8dd},'attributes':['id'],'include':[{'model':db[_0x282d('0x4b')],'as':_0x282d('0x58'),'attributes':['id','name',_0x282d('0x59'),_0x282d('0x5a'),_0x282d('0x5b')],'raw':!![]}]})[_0x282d('0x19')](function(_0x419f13){if(_0x419f13){var _0x42c301=_['flatMap'](_0x419f13,function(_0x10938f){var _0x34c21a=_0x10938f[_0x282d('0x1a')]({'plain':!![]});return _0x34c21a[_0x282d('0x58')];});return db[_0x282d('0x24')][_0x282d('0x39')]({'where':{'id':_0x282fe3['params']['id']}})[_0x282d('0x19')](function(_0xd02ce7){return db[_0x282d('0x5c')]['transaction'](function(_0x4eee7e){return _0xd02ce7['addTeams'](_0x39a8dd,{'transaction':_0x4eee7e})[_0x282d('0x19')](function(){return BPromise[_0x282d('0x5d')](_0x42c301,function(_0x1de5ef){return db[_0x282d('0x44')][_0x282d('0x5e')]({'where':{'UserId':_0x1de5ef['id'],'MailQueueId':_0x282fe3[_0x282d('0x2e')]['id']},'transaction':_0x4eee7e});});})['then'](function(){_0x42c301[_0x282d('0x5f')](function(_0x42617e){socket[_0x282d('0x60')](_0x282d('0x61'),{'UserId':_0x42617e['id'],'MailQueueId':_0xd02ce7['id']});});});});});}})[_0x282d('0x19')](respondWithStatusCode(_0x178ddf,null))[_0x282d('0x2d')](handleError(_0x178ddf,null));};exports[_0x282d('0x62')]=function(_0x474f24,_0x262e19){return db[_0x282d('0x55')][_0x282d('0x2b')]({'where':{'id':_0x474f24[_0x282d('0x31')][_0x282d('0x57')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x282d('0x19')](handleEntityNotFound(_0x262e19,null))[_0x282d('0x19')](function(_0x337ea0){var _0x31f1b6=_[_0x282d('0x23')](_0x337ea0,'id');var _0x469961=[];var _0x5a5864=[];var _0x4cdf25=squel[_0x282d('0x63')]();_0x4cdf25[_0x282d('0x64')]('tq.TeamId')[_0x282d('0x65')](_0x282d('0x66'),'tq')[_0x282d('0x67')](_0x282d('0x68'),'ut',_0x282d('0x69'))['where'](_0x282d('0x6a'),_0x474f24['params']['id']);for(var _0x470610=0x0;_0x470610<_0x337ea0[_0x282d('0x36')];_0x470610+=0x1){let _0x1ac4f4=_0x337ea0[_0x470610];for(var _0x2c3649=0x0;_0x2c3649<_0x1ac4f4[_0x282d('0x58')][_0x282d('0x36')];_0x2c3649+=0x1){let _0xd7528d=_0x1ac4f4['Agents'][_0x2c3649];var _0x1b4a20=_0x4cdf25[_0x282d('0x6b')]();_0x1b4a20['where'](_0x282d('0x6c'),_0xd7528d['id']);_0x5a5864[_0x282d('0x6d')](db[_0x282d('0x5c')][_0x282d('0x31')](_0x1b4a20[_0x282d('0x6e')](),{'type':db[_0x282d('0x5c')][_0x282d('0x6f')][_0x282d('0x70')]})[_0x282d('0x19')](function(_0x108fe0){if(_0x108fe0[_0x282d('0x36')]===0x1){return _0xd7528d['id'];}else{var _0x218aa5=_[_0x282d('0x71')](_[_0x282d('0x23')](_0x108fe0,_0x282d('0x72')),function(_0x21eb07){return _['includes'](_0x31f1b6,_0x21eb07);});if(_0x218aa5){return _0xd7528d['id'];}}}));}}return BPromise['all'](_0x5a5864)[_0x282d('0x19')](function(_0x2dbc82){_0x469961=_(_0x469961)[_0x282d('0x73')](_0x2dbc82)[_0x282d('0x74')]()[_0x282d('0x75')]();return db['MailQueue'][_0x282d('0x39')]({'where':{'id':_0x474f24[_0x282d('0x2e')]['id']}})[_0x282d('0x19')](function(_0x11e4a3){return db['sequelize'][_0x282d('0x76')](function(_0x5aa63c){return _0x11e4a3[_0x282d('0x62')](_0x474f24[_0x282d('0x31')][_0x282d('0x57')],{'transaction':_0x5aa63c})[_0x282d('0x19')](function(){if(!_[_0x282d('0x77')](_0x469961)){return _0x11e4a3[_0x282d('0x78')](_0x469961,{'transaction':_0x5aa63c});}})[_0x282d('0x19')](function(){_0x469961[_0x282d('0x5f')](function(_0x6403e3){socket[_0x282d('0x60')](_0x282d('0x79'),{'UserId':_0x6403e3,'MailQueueId':_0x11e4a3['id']});});});});});});})['then'](respondWithStatusCode(_0x262e19,null))[_0x282d('0x2d')](handleError(_0x262e19,null));};exports[_0x282d('0x7a')]=function(_0xccf0af,_0x29fc61){return db[_0x282d('0x24')][_0x282d('0x39')]({'where':{'id':_0xccf0af[_0x282d('0x2e')]['id']}})[_0x282d('0x19')](handleEntityNotFound(_0x29fc61,null))[_0x282d('0x19')](function(_0x11c120){if(_0x11c120){return _0x11c120[_0x282d('0x7a')](_0xccf0af[_0x282d('0x3b')][_0x282d('0x57')],_[_0x282d('0x7b')](_0xccf0af['body'],[_0x282d('0x57'),'id'])||{})[_0x282d('0x7c')](function(_0x120d61){for(var _0x50d584=0x0;_0x50d584<_0xccf0af['body']['ids'][_0x282d('0x36')];_0x50d584+=0x1){socket['emit'](_0x282d('0x61'),{'UserId':Number(_0xccf0af[_0x282d('0x3b')]['ids'][_0x50d584]),'MailQueueId':Number(_0xccf0af[_0x282d('0x2e')]['id'])});}return _0x120d61;});}})[_0x282d('0x19')](respondWithResult(_0x29fc61,null))[_0x282d('0x2d')](handleError(_0x29fc61,null));};exports[_0x282d('0x78')]=function(_0x49ab8e,_0x38f94a){return db[_0x282d('0x24')]['find']({'where':{'id':_0x49ab8e['params']['id']}})[_0x282d('0x19')](handleEntityNotFound(_0x38f94a,null))['then'](function(_0x295cd9){if(_0x295cd9){return _0x295cd9['removeAgents'](_0x49ab8e[_0x282d('0x31')][_0x282d('0x57')])[_0x282d('0x19')](function(){if(_[_0x282d('0x7d')](_0x49ab8e['query'][_0x282d('0x57')])){for(var _0x2249a7=0x0;_0x2249a7<_0x49ab8e[_0x282d('0x31')][_0x282d('0x57')]['length'];_0x2249a7+=0x1){socket[_0x282d('0x60')](_0x282d('0x79'),{'UserId':Number(_0x49ab8e[_0x282d('0x31')][_0x282d('0x57')][_0x2249a7]),'MailQueueId':Number(_0x49ab8e[_0x282d('0x2e')]['id'])});}}else{socket['emit']('userMailQueue:remove',{'UserId':Number(_0x49ab8e[_0x282d('0x31')][_0x282d('0x57')]),'MailQueueId':Number(_0x49ab8e[_0x282d('0x2e')]['id'])});}});}})[_0x282d('0x19')](respondWithStatusCode(_0x38f94a,null))[_0x282d('0x2d')](handleError(_0x38f94a,null));};exports[_0x282d('0x7e')]=function(_0xba69f4,_0x51cd9e){var _0x5ef49f={};var _0xce362e={};var _0x4f483c;var _0x25748a;return db[_0x282d('0x24')][_0x282d('0x43')]({'where':{'id':_0xba69f4['params']['id']}})['then'](handleEntityNotFound(_0x51cd9e,null))[_0x282d('0x19')](function(_0xe54d20){if(_0xe54d20){_0x4f483c=_0xe54d20;_0xce362e[_0x282d('0x2f')]=_[_0x282d('0x30')](db[_0x282d('0x4b')][_0x282d('0x25')]);_0xce362e['query']=_[_0x282d('0x30')](_0xba69f4[_0x282d('0x31')]);_0xce362e['filters']=_[_0x282d('0x33')](_0xce362e[_0x282d('0x2f')],_0xce362e[_0x282d('0x31')]);_0x5ef49f[_0x282d('0x35')]=_[_0x282d('0x33')](_0xce362e[_0x282d('0x2f')],qs[_0x282d('0x34')](_0xba69f4[_0x282d('0x31')][_0x282d('0x34')]));_0x5ef49f[_0x282d('0x35')]=_0x5ef49f[_0x282d('0x35')]['length']?_0x5ef49f[_0x282d('0x35')]:_0xce362e['model'];_0x5ef49f['order']=qs[_0x282d('0x48')](_0xba69f4[_0x282d('0x31')]['sort']);_0x5ef49f['where']=qs[_0x282d('0x32')](_[_0x282d('0x49')](_0xba69f4['query'],_0xce362e[_0x282d('0x32')]));if(_0xba69f4['query']['filter']){_0x5ef49f[_0x282d('0x29')]=_[_0x282d('0x37')](_0x5ef49f[_0x282d('0x29')],{'$or':_[_0x282d('0x23')](_0x5ef49f['attributes'],function(_0x37d638){var _0x563bed={};_0x563bed[_0x37d638]={'$like':'%'+_0xba69f4[_0x282d('0x31')][_0x282d('0x4a')]+'%'};return _0x563bed;})});}_0x5ef49f=_['merge']({},_0x5ef49f,_0xba69f4['options']);return _0x4f483c['getAgents'](_0x5ef49f);}})['then'](function(_0x322db7){if(_0x322db7){_0x25748a=_0x322db7['length'];if(!_0xba69f4[_0x282d('0x31')][_0x282d('0x45')]('nolimit')){_0x5ef49f[_0x282d('0x14')]=qs['limit'](_0xba69f4[_0x282d('0x31')][_0x282d('0x14')]);_0x5ef49f[_0x282d('0x12')]=qs[_0x282d('0x12')](_0xba69f4['query']['offset']);}return _0x4f483c[_0x282d('0x7e')](_0x5ef49f);}})[_0x282d('0x19')](function(_0x3ba114){if(_0x3ba114){return _0x3ba114?{'count':_0x25748a,'rows':_0x3ba114}:null;}})[_0x282d('0x19')](respondWithResult(_0x51cd9e,null))[_0x282d('0x2d')](handleError(_0x51cd9e,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 442c9b2..9130683 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 _0x736e=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailQueue','save','update'];(function(_0x557f74,_0x3443fd){var _0x597f0b=function(_0x4ec6ff){while(--_0x4ec6ff){_0x557f74['push'](_0x557f74['shift']());}};_0x597f0b(++_0x3443fd);}(_0x736e,0xf7));var _0xe736=function(_0x434ee5,_0x1842dc){_0x434ee5=_0x434ee5-0x0;var _0x472e16=_0x736e[_0x434ee5];return _0x472e16;};'use strict';var EventEmitter=require(_0xe736('0x0'));var MailQueue=require(_0xe736('0x1'))['db'][_0xe736('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe736('0x3'),'afterUpdate':_0xe736('0x4'),'afterDestroy':_0xe736('0x5')};function emitEvent(_0x509008){return function(_0x21518a,_0x27c7b2,_0x29b101){MailQueueEvents['emit'](_0x509008+':'+_0x21518a['id'],_0x21518a);MailQueueEvents[_0xe736('0x6')](_0x509008,_0x21518a);_0x29b101(null);};}for(var e in events){if(events[_0xe736('0x7')](e)){var event=events[e];MailQueue[_0xe736('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x653e=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x407abe,_0x25cde9){var _0x3c3597=function(_0x527a92){while(--_0x527a92){_0x407abe['push'](_0x407abe['shift']());}};_0x3c3597(++_0x25cde9);}(_0x653e,0x7f));var _0xe653=function(_0x237da8,_0x37b77a){_0x237da8=_0x237da8-0x0;var _0x558825=_0x653e[_0x237da8];return _0x558825;};'use strict';var EventEmitter=require(_0xe653('0x0'));var MailQueue=require(_0xe653('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe653('0x2'),'afterUpdate':_0xe653('0x3'),'afterDestroy':_0xe653('0x4')};function emitEvent(_0x23be7f){return function(_0x47b7ef,_0x2e16cb,_0x3a0733){MailQueueEvents['emit'](_0x23be7f+':'+_0x47b7ef['id'],_0x47b7ef);MailQueueEvents[_0xe653('0x5')](_0x23be7f,_0x47b7ef);_0x3a0733(null);};}for(var e in events){if(events[_0xe653('0x6')](e)){var event=events[e];MailQueue[_0xe653('0x7')](e,emitEvent(event));}}module[_0xe653('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index d0c3c8e..eb09129 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 _0x09d5=['./mailQueue.attributes','exports','define','MailQueue','mail_queues','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5e1c66,_0x4c7aad){var _0x29b22c=function(_0x1702df){while(--_0x1702df){_0x5e1c66['push'](_0x5e1c66['shift']());}};_0x29b22c(++_0x4c7aad);}(_0x09d5,0x198));var _0x509d=function(_0x380b6b,_0x2d7838){_0x380b6b=_0x380b6b-0x0;var _0x52aee8=_0x09d5[_0x380b6b];return _0x52aee8;};'use strict';var _=require('lodash');var util=require(_0x509d('0x0'));var logger=require(_0x509d('0x1'))(_0x509d('0x2'));var moment=require(_0x509d('0x3'));var BPromise=require(_0x509d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x509d('0x5'));var rimraf=require(_0x509d('0x6'));var config=require(_0x509d('0x7'));var attributes=require(_0x509d('0x8'));module[_0x509d('0x9')]=function(_0x38f115,_0x4c8aee){return _0x38f115[_0x509d('0xa')](_0x509d('0xb'),attributes,{'tableName':_0x509d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x635d=['define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailQueue.attributes','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x635d,0x16f));var _0xd635=function(_0x24e509,_0x25db6a){_0x24e509=_0x24e509-0x0;var _0x414e34=_0x635d[_0x24e509];return _0x414e34;};'use strict';var _=require(_0xd635('0x0'));var util=require(_0xd635('0x1'));var logger=require(_0xd635('0x2'))(_0xd635('0x3'));var moment=require(_0xd635('0x4'));var BPromise=require(_0xd635('0x5'));var rp=require(_0xd635('0x6'));var fs=require('fs');var path=require(_0xd635('0x7'));var rimraf=require('rimraf');var config=require(_0xd635('0x8'));var attributes=require(_0xd635('0x9'));module[_0xd635('0xa')]=function(_0x528ec9,_0x4098e6){return _0x528ec9[_0xd635('0xb')](_0xd635('0xc'),attributes,{'tableName':_0xd635('0xd'),'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 9312c12..32bf7a8 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 _0x149e=['code','message','info','result','GetMailQueue','findAll','raw','options','where','attributes','limit','include','map','model','catch','ShowMailQueue','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','./mailQueue.socket','request','then','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x149e,0x83));var _0xe149=function(_0x4f57db,_0x3f2217){_0x4f57db=_0x4f57db-0x0;var _0x3cddb7=_0x149e[_0x4f57db];return _0x3cddb7;};'use strict';var _=require('lodash');var util=require(_0xe149('0x0'));var moment=require(_0xe149('0x1'));var BPromise=require(_0xe149('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe149('0x3'));var db=require(_0xe149('0x4'))['db'];var utils=require(_0xe149('0x5'));var logger=require(_0xe149('0x6'))(_0xe149('0x7'));var config=require('../../config/environment');var jayson=require(_0xe149('0x8'));var client=jayson[_0xe149('0x9')]['http']({'port':0x232a});config[_0xe149('0xa')]=_['defaults'](config[_0xe149('0xa')],{'host':_0xe149('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe149('0xa')]));require(_0xe149('0xc'))['register'](socket);function respondWithRpcPromise(_0x5c020d,_0xbce99d,_0x479145){return new BPromise(function(_0x58f8ea,_0xecbdea){return client[_0xe149('0xd')](_0x5c020d,_0x479145)[_0xe149('0xe')](function(_0x5c9a8b){logger['info'](_0xe149('0xf'),_0xbce99d,'request\x20sent');logger[_0xe149('0x10')](_0xe149('0x11'),_0xbce99d,_0xe149('0x12'),JSON[_0xe149('0x13')](_0x5c9a8b));if(_0x5c9a8b[_0xe149('0x14')]){if(_0x5c9a8b[_0xe149('0x14')][_0xe149('0x15')]===0x1f4){logger[_0xe149('0x14')](_0xe149('0xf'),_0xbce99d,_0x5c9a8b[_0xe149('0x14')][_0xe149('0x16')]);return _0xecbdea(_0x5c9a8b[_0xe149('0x14')][_0xe149('0x16')]);}logger[_0xe149('0x14')]('MailQueue,\x20%s,\x20%s',_0xbce99d,_0x5c9a8b[_0xe149('0x14')][_0xe149('0x16')]);return _0x58f8ea(_0x5c9a8b[_0xe149('0x14')][_0xe149('0x16')]);}else{logger[_0xe149('0x17')](_0xe149('0xf'),_0xbce99d,'request\x20sent');_0x58f8ea(_0x5c9a8b[_0xe149('0x18')]['message']);}})['catch'](function(_0x39ae95){logger[_0xe149('0x14')](_0xe149('0xf'),_0xbce99d,_0x39ae95);_0xecbdea(_0x39ae95);});});}exports[_0xe149('0x19')]=function(_0x148911){var _0x316ca3=this;return new Promise(function(_0xe81bad,_0x2f448a){return db['MailQueue'][_0xe149('0x1a')]({'raw':_0x148911['options']?_0x148911['options'][_0xe149('0x1b')]===undefined?!![]:![]:!![],'where':_0x148911['options']?_0x148911[_0xe149('0x1c')][_0xe149('0x1d')]||null:null,'attributes':_0x148911[_0xe149('0x1c')]?_0x148911[_0xe149('0x1c')][_0xe149('0x1e')]||null:null,'limit':_0x148911[_0xe149('0x1c')]?_0x148911[_0xe149('0x1c')][_0xe149('0x1f')]||null:null,'include':_0x148911['options']?_0x148911[_0xe149('0x1c')][_0xe149('0x20')]?_[_0xe149('0x21')](_0x148911[_0xe149('0x1c')][_0xe149('0x20')],function(_0x31d7d5){return{'model':db[_0x31d7d5[_0xe149('0x22')]],'as':_0x31d7d5['as'],'attributes':_0x31d7d5[_0xe149('0x1e')],'include':_0x31d7d5[_0xe149('0x20')]?_[_0xe149('0x21')](_0x31d7d5[_0xe149('0x20')],function(_0x1d6ec0){return{'model':db[_0x1d6ec0[_0xe149('0x22')]],'as':_0x1d6ec0['as'],'attributes':_0x1d6ec0[_0xe149('0x1e')],'include':_0x1d6ec0[_0xe149('0x20')]?_['map'](_0x1d6ec0[_0xe149('0x20')],function(_0x596d60){return{'model':db[_0x596d60[_0xe149('0x22')]],'as':_0x596d60['as'],'attributes':_0x596d60['attributes']};}):[]};}):[]};}):[]:[]})[_0xe149('0xe')](function(_0x314025){logger[_0xe149('0x17')](_0xe149('0x19'),_0x148911);logger[_0xe149('0x10')]('GetMailQueue',_0x148911,JSON[_0xe149('0x13')](_0x314025));_0xe81bad(_0x314025);})[_0xe149('0x23')](function(_0x2eab07){logger[_0xe149('0x14')](_0xe149('0x19'),_0x2eab07[_0xe149('0x16')],_0x148911);_0x2f448a(_0x316ca3[_0xe149('0x14')](0x1f4,_0x2eab07['message']));});});};exports[_0xe149('0x24')]=function(_0x11f824){var _0x196916=this;return new Promise(function(_0x45473b,_0x215890){return db['MailQueue'][_0xe149('0x25')]({'raw':_0x11f824['options']?_0x11f824[_0xe149('0x1c')][_0xe149('0x1b')]===undefined?!![]:![]:!![],'where':_0x11f824[_0xe149('0x1c')]?_0x11f824['options'][_0xe149('0x1d')]||null:null,'attributes':_0x11f824[_0xe149('0x1c')]?_0x11f824[_0xe149('0x1c')][_0xe149('0x1e')]||null:null,'include':_0x11f824[_0xe149('0x1c')]?_0x11f824[_0xe149('0x1c')]['include']?_[_0xe149('0x21')](_0x11f824['options'][_0xe149('0x20')],function(_0x16297f){return{'model':db[_0x16297f['model']],'as':_0x16297f['as'],'attributes':_0x16297f[_0xe149('0x1e')],'include':_0x16297f[_0xe149('0x20')]?_[_0xe149('0x21')](_0x16297f[_0xe149('0x20')],function(_0x3f8ad8){return{'model':db[_0x3f8ad8[_0xe149('0x22')]],'as':_0x3f8ad8['as'],'attributes':_0x3f8ad8['attributes'],'include':_0x3f8ad8[_0xe149('0x20')]?_['map'](_0x3f8ad8['include'],function(_0x1a21ca){return{'model':db[_0x1a21ca[_0xe149('0x22')]],'as':_0x1a21ca['as'],'attributes':_0x1a21ca[_0xe149('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe149('0xe')](function(_0x4954f0){logger[_0xe149('0x17')]('ShowMailQueue',_0x11f824);logger['debug'](_0xe149('0x24'),_0x11f824,JSON['stringify'](_0x4954f0));_0x45473b(_0x4954f0);})[_0xe149('0x23')](function(_0x226461){logger[_0xe149('0x14')](_0xe149('0x24'),_0x226461[_0xe149('0x16')],_0x11f824);_0x215890(_0x196916[_0xe149('0x14')](0x1f4,_0x226461[_0xe149('0x16')]));});});}; \ No newline at end of file +var _0x3ab0=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','MailQueue,\x20%s,\x20%s','result','GetMailQueue','MailQueue','findAll','options','where','include','map','attributes','debug','catch','ShowMailQueue','find','raw','model','stringify','lodash','util','moment'];(function(_0x5ab905,_0x11c9e5){var _0x125804=function(_0x15e5d4){while(--_0x15e5d4){_0x5ab905['push'](_0x5ab905['shift']());}};_0x125804(++_0x11c9e5);}(_0x3ab0,0xa9));var _0x03ab=function(_0x56a866,_0x4729c4){_0x56a866=_0x56a866-0x0;var _0x1d71ed=_0x3ab0[_0x56a866];return _0x1d71ed;};'use strict';var _=require(_0x03ab('0x0'));var util=require(_0x03ab('0x1'));var moment=require(_0x03ab('0x2'));var BPromise=require('bluebird');var rs=require(_0x03ab('0x3'));var fs=require('fs');var Redis=require(_0x03ab('0x4'));var db=require(_0x03ab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x03ab('0x6'))(_0x03ab('0x7'));var config=require(_0x03ab('0x8'));var jayson=require(_0x03ab('0x9'));var client=jayson[_0x03ab('0xa')][_0x03ab('0xb')]({'port':0x232a});config[_0x03ab('0xc')]=_[_0x03ab('0xd')](config[_0x03ab('0xc')],{'host':_0x03ab('0xe'),'port':0x18eb});var socket=require(_0x03ab('0xf'))(new Redis(config[_0x03ab('0xc')]));require(_0x03ab('0x10'))[_0x03ab('0x11')](socket);function respondWithRpcPromise(_0x4e39da,_0x32125a,_0x496e2b){return new BPromise(function(_0x180122,_0x17bee9){return client[_0x03ab('0x12')](_0x4e39da,_0x496e2b)[_0x03ab('0x13')](function(_0x5663eb){logger[_0x03ab('0x14')]('MailQueue,\x20%s,\x20%s',_0x32125a,_0x03ab('0x15'));logger['debug'](_0x03ab('0x16'),_0x32125a,'request\x20sent',JSON['stringify'](_0x5663eb));if(_0x5663eb['error']){if(_0x5663eb[_0x03ab('0x17')][_0x03ab('0x18')]===0x1f4){logger[_0x03ab('0x17')]('MailQueue,\x20%s,\x20%s',_0x32125a,_0x5663eb['error'][_0x03ab('0x19')]);return _0x17bee9(_0x5663eb['error'][_0x03ab('0x19')]);}logger[_0x03ab('0x17')](_0x03ab('0x1a'),_0x32125a,_0x5663eb[_0x03ab('0x17')]['message']);return _0x180122(_0x5663eb[_0x03ab('0x17')]['message']);}else{logger['info'](_0x03ab('0x1a'),_0x32125a,_0x03ab('0x15'));_0x180122(_0x5663eb[_0x03ab('0x1b')]['message']);}})['catch'](function(_0x46c476){logger[_0x03ab('0x17')](_0x03ab('0x1a'),_0x32125a,_0x46c476);_0x17bee9(_0x46c476);});});}exports[_0x03ab('0x1c')]=function(_0x2ea506){var _0x1af8f6=this;return new Promise(function(_0x2ff9a3,_0x22c5d6){return db[_0x03ab('0x1d')][_0x03ab('0x1e')]({'raw':_0x2ea506[_0x03ab('0x1f')]?_0x2ea506[_0x03ab('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2ea506['options']?_0x2ea506[_0x03ab('0x1f')][_0x03ab('0x20')]||null:null,'attributes':_0x2ea506[_0x03ab('0x1f')]?_0x2ea506[_0x03ab('0x1f')]['attributes']||null:null,'limit':_0x2ea506[_0x03ab('0x1f')]?_0x2ea506[_0x03ab('0x1f')]['limit']||null:null,'include':_0x2ea506[_0x03ab('0x1f')]?_0x2ea506[_0x03ab('0x1f')][_0x03ab('0x21')]?_[_0x03ab('0x22')](_0x2ea506[_0x03ab('0x1f')][_0x03ab('0x21')],function(_0x2cce0a){return{'model':db[_0x2cce0a['model']],'as':_0x2cce0a['as'],'attributes':_0x2cce0a[_0x03ab('0x23')],'include':_0x2cce0a[_0x03ab('0x21')]?_[_0x03ab('0x22')](_0x2cce0a[_0x03ab('0x21')],function(_0x238c95){return{'model':db[_0x238c95['model']],'as':_0x238c95['as'],'attributes':_0x238c95[_0x03ab('0x23')],'include':_0x238c95[_0x03ab('0x21')]?_['map'](_0x238c95[_0x03ab('0x21')],function(_0x5de95d){return{'model':db[_0x5de95d['model']],'as':_0x5de95d['as'],'attributes':_0x5de95d['attributes']};}):[]};}):[]};}):[]:[]})[_0x03ab('0x13')](function(_0x68eb29){logger[_0x03ab('0x14')](_0x03ab('0x1c'),_0x2ea506);logger[_0x03ab('0x24')](_0x03ab('0x1c'),_0x2ea506,JSON['stringify'](_0x68eb29));_0x2ff9a3(_0x68eb29);})[_0x03ab('0x25')](function(_0x53c104){logger['error'](_0x03ab('0x1c'),_0x53c104[_0x03ab('0x19')],_0x2ea506);_0x22c5d6(_0x1af8f6[_0x03ab('0x17')](0x1f4,_0x53c104[_0x03ab('0x19')]));});});};exports[_0x03ab('0x26')]=function(_0x558e24){var _0x20b420=this;return new Promise(function(_0xf30bc,_0xb5cb2d){return db['MailQueue'][_0x03ab('0x27')]({'raw':_0x558e24[_0x03ab('0x1f')]?_0x558e24[_0x03ab('0x1f')][_0x03ab('0x28')]===undefined?!![]:![]:!![],'where':_0x558e24['options']?_0x558e24[_0x03ab('0x1f')][_0x03ab('0x20')]||null:null,'attributes':_0x558e24[_0x03ab('0x1f')]?_0x558e24['options'][_0x03ab('0x23')]||null:null,'include':_0x558e24['options']?_0x558e24[_0x03ab('0x1f')][_0x03ab('0x21')]?_[_0x03ab('0x22')](_0x558e24[_0x03ab('0x1f')][_0x03ab('0x21')],function(_0x169b87){return{'model':db[_0x169b87['model']],'as':_0x169b87['as'],'attributes':_0x169b87['attributes'],'include':_0x169b87[_0x03ab('0x21')]?_[_0x03ab('0x22')](_0x169b87[_0x03ab('0x21')],function(_0x513489){return{'model':db[_0x513489[_0x03ab('0x29')]],'as':_0x513489['as'],'attributes':_0x513489[_0x03ab('0x23')],'include':_0x513489[_0x03ab('0x21')]?_['map'](_0x513489[_0x03ab('0x21')],function(_0x476f04){return{'model':db[_0x476f04['model']],'as':_0x476f04['as'],'attributes':_0x476f04[_0x03ab('0x23')]};}):[]};}):[]};}):[]:[]})[_0x03ab('0x13')](function(_0x2503b6){logger[_0x03ab('0x14')](_0x03ab('0x26'),_0x558e24);logger['debug'](_0x03ab('0x26'),_0x558e24,JSON[_0x03ab('0x2a')](_0x2503b6));_0xf30bc(_0x2503b6);})[_0x03ab('0x25')](function(_0x3c6449){logger[_0x03ab('0x17')]('ShowMailQueue',_0x3c6449[_0x03ab('0x19')],_0x558e24);_0xb5cb2d(_0x20b420[_0x03ab('0x17')](0x1f4,_0x3c6449[_0x03ab('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index c0f708b..83b8087 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 _0x9e2a=['./mailQueue.events','emit','length'];(function(_0x993f24,_0x227b78){var _0x3064db=function(_0x5c0d9e){while(--_0x5c0d9e){_0x993f24['push'](_0x993f24['shift']());}};_0x3064db(++_0x227b78);}(_0x9e2a,0xe1));var _0xa9e2=function(_0x36132c,_0x452c4c){_0x36132c=_0x36132c-0x0;var _0x405204=_0x9e2a[_0x36132c];return _0x405204;};'use strict';var MailQueueEvents=require(_0xa9e2('0x0'));var events=['save','remove','update'];function createListener(_0x541e1d,_0x26fb7e){return function(_0xc1c3c6){_0x26fb7e[_0xa9e2('0x1')](_0x541e1d,_0xc1c3c6);};}function removeListener(_0x14632d,_0x574b52){return function(){MailQueueEvents['removeListener'](_0x14632d,_0x574b52);};}exports['register']=function(_0x2d2d03){for(var _0x2a1c84=0x0,_0xde042e=events[_0xa9e2('0x2')];_0x2a1c84<_0xde042e;_0x2a1c84++){var _0x2d2bd1=events[_0x2a1c84];var _0x30b222=createListener('mailQueue:'+_0x2d2bd1,_0x2d2d03);MailQueueEvents['on'](_0x2d2bd1,_0x30b222);}}; \ No newline at end of file +var _0x0e6c=['remove','update','emit','register','length'];(function(_0x4336c9,_0x2a18a9){var _0x39668c=function(_0x44f273){while(--_0x44f273){_0x4336c9['push'](_0x4336c9['shift']());}};_0x39668c(++_0x2a18a9);}(_0x0e6c,0x64));var _0xc0e6=function(_0x5d13f6,_0x2aa719){_0x5d13f6=_0x5d13f6-0x0;var _0x5b91ca=_0x0e6c[_0x5d13f6];return _0x5b91ca;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0xc0e6('0x0'),_0xc0e6('0x1')];function createListener(_0x4185a4,_0x5f24d8){return function(_0x4237a3){_0x5f24d8[_0xc0e6('0x2')](_0x4185a4,_0x4237a3);};}function removeListener(_0xcc5037,_0x118f14){return function(){MailQueueEvents['removeListener'](_0xcc5037,_0x118f14);};}exports[_0xc0e6('0x3')]=function(_0x5e7759){for(var _0x3f8f68=0x0,_0x2ffbf1=events[_0xc0e6('0x4')];_0x3f8f68<_0x2ffbf1;_0x3f8f68++){var _0x494a08=events[_0x3f8f68];var _0x5c3c0f=createListener('mailQueue:'+_0x494a08,_0x5e7759);MailQueueEvents['on'](_0x494a08,_0x5c3c0f);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 7c3a37f..713d429 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 _0xe070=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put','update','exports','multer'];(function(_0x14f168,_0xb2a8f3){var _0x2fbd50=function(_0xef651){while(--_0xef651){_0x14f168['push'](_0x14f168['shift']());}};_0x2fbd50(++_0xb2a8f3);}(_0xe070,0x1a1));var _0x0e07=function(_0x347541,_0x137cf){_0x347541=_0x347541-0x0;var _0x5c0e38=_0xe070[_0x347541];return _0x5c0e38;};'use strict';var multer=require(_0x0e07('0x0'));var util=require(_0x0e07('0x1'));var path=require('path');var timeout=require(_0x0e07('0x2'));var express=require('express');var router=express[_0x0e07('0x3')]();var fs_extra=require(_0x0e07('0x4'));var auth=require(_0x0e07('0x5'));var interaction=require(_0x0e07('0x6'));var config=require(_0x0e07('0x7'));var controller=require(_0x0e07('0x8'));router['get']('/',auth[_0x0e07('0x9')](),controller[_0x0e07('0xa')]);router[_0x0e07('0xb')](_0x0e07('0xc'),auth[_0x0e07('0x9')](),controller['describe']);router['get'](_0x0e07('0xd'),auth[_0x0e07('0x9')](),controller[_0x0e07('0xe')]);router['post']('/',auth[_0x0e07('0x9')](),controller[_0x0e07('0xf')]);router[_0x0e07('0x10')](_0x0e07('0xd'),auth[_0x0e07('0x9')](),controller[_0x0e07('0x11')]);router['delete'](_0x0e07('0xd'),auth[_0x0e07('0x9')](),controller['destroy']);module[_0x0e07('0x12')]=router; \ No newline at end of file +var _0x6c1f=['index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated'];(function(_0x560597,_0x170c46){var _0x15dfb5=function(_0x315586){while(--_0x315586){_0x560597['push'](_0x560597['shift']());}};_0x15dfb5(++_0x170c46);}(_0x6c1f,0x166));var _0xf6c1=function(_0x44511e,_0x2242ba){_0x44511e=_0x44511e-0x0;var _0x243798=_0x6c1f[_0x44511e];return _0x243798;};'use strict';var multer=require(_0xf6c1('0x0'));var util=require('util');var path=require(_0xf6c1('0x1'));var timeout=require(_0xf6c1('0x2'));var express=require(_0xf6c1('0x3'));var router=express['Router']();var fs_extra=require(_0xf6c1('0x4'));var auth=require(_0xf6c1('0x5'));var interaction=require(_0xf6c1('0x6'));var config=require(_0xf6c1('0x7'));var controller=require(_0xf6c1('0x8'));router['get']('/',auth[_0xf6c1('0x9')](),controller[_0xf6c1('0xa')]);router[_0xf6c1('0xb')](_0xf6c1('0xc'),auth[_0xf6c1('0x9')](),controller[_0xf6c1('0xd')]);router[_0xf6c1('0xb')](_0xf6c1('0xe'),auth[_0xf6c1('0x9')](),controller[_0xf6c1('0xf')]);router[_0xf6c1('0x10')]('/',auth[_0xf6c1('0x9')](),controller[_0xf6c1('0x11')]);router[_0xf6c1('0x12')](_0xf6c1('0xe'),auth['isAuthenticated'](),controller[_0xf6c1('0x13')]);router[_0xf6c1('0x14')](_0xf6c1('0xe'),auth[_0xf6c1('0x9')](),controller[_0xf6c1('0x15')]);module[_0xf6c1('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 59bbb2f..7e7721e 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 _0xc534=['STRING','DATE','moment','sequelize','exports'];(function(_0x19ce02,_0x17ed5e){var _0x334b81=function(_0x5335b8){while(--_0x5335b8){_0x19ce02['push'](_0x19ce02['shift']());}};_0x334b81(++_0x17ed5e);}(_0xc534,0x11f));var _0x4c53=function(_0x491faa,_0x4f2907){_0x491faa=_0x491faa-0x0;var _0x414440=_0xc534[_0x491faa];return _0x414440;};'use strict';var moment=require(_0x4c53('0x0'));var Sequelize=require(_0x4c53('0x1'));module[_0x4c53('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x4c53('0x3')]},'joinAt':{'type':Sequelize[_0x4c53('0x4')]},'leaveAt':{'type':Sequelize[_0x4c53('0x4')]},'acceptAt':{'type':Sequelize[_0x4c53('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x34ab=['DATE','moment','sequelize','exports','STRING'];(function(_0x1ca1e6,_0x7f383e){var _0x4a3a82=function(_0x3b5e42){while(--_0x3b5e42){_0x1ca1e6['push'](_0x1ca1e6['shift']());}};_0x4a3a82(++_0x7f383e);}(_0x34ab,0xf1));var _0xb34a=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0x34ab[_0x65c50e];return _0x4573e7;};'use strict';var moment=require(_0xb34a('0x0'));var Sequelize=require(_0xb34a('0x1'));module[_0xb34a('0x2')]={'uniqueid':{'type':Sequelize[_0xb34a('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb34a('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb34a('0x4')]},'reason':{'type':Sequelize[_0xb34a('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 71a0181..ffeef7d 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 _0x0b0e=['merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','MailQueueReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter'];(function(_0x1eda99,_0x26972e){var _0x301c32=function(_0x59e666){while(--_0x59e666){_0x1eda99['push'](_0x1eda99['shift']());}};_0x301c32(++_0x26972e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0x0b0e[_0x533e4e];return _0x1f14bb;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['MailQueueReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['MailQueueReport'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['MailQueueReport']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));};exports[_0xe0b0('0x4a')]=function(_0x54cf7b,_0x4b65d1){return db[_0xe0b0('0x2a')][_0xe0b0('0x4a')]()[_0xe0b0('0x23')](respondWithResult(_0x4b65d1,null))[_0xe0b0('0x43')](handleError(_0x4b65d1,null));}; \ No newline at end of file +var _0x77d4=['save','update','then','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','filter','options','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','describe','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject'];(function(_0x4caf4f,_0x1f9d37){var _0xf64dd9=function(_0x37507){while(--_0x37507){_0x4caf4f['push'](_0x4caf4f['shift']());}};_0xf64dd9(++_0x1f9d37);}(_0x77d4,0x108));var _0x477d=function(_0x3a3fcc,_0x38afb3){_0x3a3fcc=_0x3a3fcc-0x0;var _0xe16438=_0x77d4[_0x3a3fcc];return _0xe16438;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x477d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x477d('0x1'));var rp=require('request-promise');var moment=require(_0x477d('0x2'));var BPromise=require(_0x477d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x477d('0x4'));var sox=require(_0x477d('0x5'));var csv=require(_0x477d('0x6'));var ejs=require(_0x477d('0x7'));var fs=require('fs');var fs_extra=require(_0x477d('0x8'));var _=require(_0x477d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x477d('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x477d('0xb'));var Papa=require(_0x477d('0xc'));var Redis=require(_0x477d('0xd'));var authService=require(_0x477d('0xe'));var qs=require(_0x477d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x477d('0x10'));var logger=require('../../config/logger')(_0x477d('0x11'));var utils=require(_0x477d('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x477d('0x13'));var db=require(_0x477d('0x14'))['db'];function respondWithStatusCode(_0x5a190c,_0x5dd33c){_0x5dd33c=_0x5dd33c||0xcc;return function(_0x6ff724){if(_0x6ff724){return _0x5a190c[_0x477d('0x15')](_0x5dd33c);}return _0x5a190c['status'](_0x5dd33c)[_0x477d('0x16')]();};}function respondWithResult(_0x1d5699,_0x48c73a){_0x48c73a=_0x48c73a||0xc8;return function(_0x4b2021){if(_0x4b2021){return _0x1d5699[_0x477d('0x17')](_0x48c73a)['json'](_0x4b2021);}};}function respondWithFilteredResult(_0x30481f,_0x234b99){return function(_0x25fc02){if(_0x25fc02){var _0x5985b5=typeof _0x234b99[_0x477d('0x18')]===_0x477d('0x19')&&typeof _0x234b99[_0x477d('0x1a')]===_0x477d('0x19');var _0x57b38e=_0x25fc02[_0x477d('0x1b')];var _0x5d5553=_0x5985b5?0x0:_0x234b99[_0x477d('0x18')];var _0x1399d7=_0x5985b5?_0x25fc02[_0x477d('0x1b')]:_0x234b99[_0x477d('0x18')]+_0x234b99[_0x477d('0x1a')];var _0x2145ce;if(_0x1399d7>=_0x57b38e){_0x1399d7=_0x57b38e;_0x2145ce=0xc8;}else{_0x2145ce=0xce;}_0x30481f['status'](_0x2145ce);return _0x30481f[_0x477d('0x1c')]('Content-Range',_0x5d5553+'-'+_0x1399d7+'/'+_0x57b38e)[_0x477d('0x1d')](_0x25fc02);}return null;};}function patchUpdates(_0x24a6d5){return function(_0x40256e){try{jsonpatch[_0x477d('0x1e')](_0x40256e,_0x24a6d5,!![]);}catch(_0x27b3aa){return BPromise[_0x477d('0x1f')](_0x27b3aa);}return _0x40256e[_0x477d('0x20')]();};}function saveUpdates(_0x17154d,_0x45a8bd){return function(_0x5981a){if(_0x5981a){return _0x5981a[_0x477d('0x21')](_0x17154d)[_0x477d('0x22')](function(_0x43c845){return _0x43c845;});}return null;};}function removeEntity(_0x1f3868,_0x4e6a44){return function(_0x4481b0){if(_0x4481b0){return _0x4481b0['destroy']()[_0x477d('0x22')](function(){_0x1f3868[_0x477d('0x17')](0xcc)[_0x477d('0x16')]();});}};}function handleEntityNotFound(_0x2287b4,_0x4bb50e){return function(_0xd6dca5){if(!_0xd6dca5){_0x2287b4[_0x477d('0x15')](0x194);}return _0xd6dca5;};}function handleError(_0x1ca4fe,_0x48ee5e){_0x48ee5e=_0x48ee5e||0x1f4;return function(_0x585648){logger[_0x477d('0x23')](_0x585648[_0x477d('0x24')]);if(_0x585648[_0x477d('0x25')]){delete _0x585648['name'];}_0x1ca4fe[_0x477d('0x17')](_0x48ee5e)[_0x477d('0x26')](_0x585648);};}exports[_0x477d('0x27')]=function(_0xe4dd40,_0x37b332){var _0x537fc4={},_0x2fc959={},_0xeb02f5={'count':0x0,'rows':[]};var _0x17dd16=_[_0x477d('0x28')](db[_0x477d('0x29')][_0x477d('0x2a')],function(_0x180046){return{'name':_0x180046[_0x477d('0x2b')],'type':_0x180046[_0x477d('0x2c')][_0x477d('0x2d')]};});_0x2fc959[_0x477d('0x2e')]=_[_0x477d('0x28')](_0x17dd16,_0x477d('0x25'));_0x2fc959[_0x477d('0x2f')]=_[_0x477d('0x30')](_0xe4dd40[_0x477d('0x2f')]);_0x2fc959[_0x477d('0x31')]=_[_0x477d('0x32')](_0x2fc959[_0x477d('0x2e')],_0x2fc959[_0x477d('0x2f')]);_0x537fc4['attributes']=_[_0x477d('0x32')](_0x2fc959['model'],qs[_0x477d('0x33')](_0xe4dd40[_0x477d('0x2f')][_0x477d('0x33')]));_0x537fc4['attributes']=_0x537fc4[_0x477d('0x34')][_0x477d('0x35')]?_0x537fc4[_0x477d('0x34')]:_0x2fc959[_0x477d('0x2e')];if(!_0xe4dd40[_0x477d('0x2f')][_0x477d('0x36')](_0x477d('0x37'))){_0x537fc4[_0x477d('0x1a')]=qs[_0x477d('0x1a')](_0xe4dd40[_0x477d('0x2f')]['limit']);_0x537fc4[_0x477d('0x18')]=qs[_0x477d('0x18')](_0xe4dd40[_0x477d('0x2f')]['offset']);}_0x537fc4[_0x477d('0x38')]=qs[_0x477d('0x39')](_0xe4dd40[_0x477d('0x2f')]['sort']);_0x537fc4['where']=qs[_0x477d('0x31')](_[_0x477d('0x3a')](_0xe4dd40[_0x477d('0x2f')],_0x2fc959[_0x477d('0x31')]),_0x17dd16);if(_0xe4dd40[_0x477d('0x2f')]['filter']){_0x537fc4[_0x477d('0x3b')]=_['merge'](_0x537fc4[_0x477d('0x3b')],{'$or':_[_0x477d('0x28')](_0x17dd16,function(_0x356f41){if(_0x356f41['type']!=='VIRTUAL'){var _0x184d50={};_0x184d50[_0x356f41[_0x477d('0x25')]]={'$like':'%'+_0xe4dd40[_0x477d('0x2f')][_0x477d('0x3c')]+'%'};return _0x184d50;}})});}_0x537fc4=_['merge']({},_0x537fc4,_0xe4dd40[_0x477d('0x3d')]);var _0xc091e={'where':_0x537fc4[_0x477d('0x3b')]};return db[_0x477d('0x29')][_0x477d('0x1b')](_0xc091e)['then'](function(_0x472149){_0xeb02f5[_0x477d('0x1b')]=_0x472149;if(_0xe4dd40['query'][_0x477d('0x3e')]){_0x537fc4['include']=[{'all':!![]}];}return db[_0x477d('0x29')][_0x477d('0x3f')](_0x537fc4);})[_0x477d('0x22')](function(_0x335b2a){_0xeb02f5[_0x477d('0x40')]=_0x335b2a;return _0xeb02f5;})[_0x477d('0x22')](respondWithFilteredResult(_0x37b332,_0x537fc4))[_0x477d('0x41')](handleError(_0x37b332,null));};exports[_0x477d('0x42')]=function(_0x43ffd1,_0x4c22f5){var _0x5759f={'raw':!![],'where':{'id':_0x43ffd1[_0x477d('0x43')]['id']}},_0x31c9a1={};_0x31c9a1[_0x477d('0x2e')]=_['keys'](db['MailQueueReport'][_0x477d('0x2a')]);_0x31c9a1[_0x477d('0x2f')]=_['keys'](_0x43ffd1[_0x477d('0x2f')]);_0x31c9a1['filters']=_['intersection'](_0x31c9a1[_0x477d('0x2e')],_0x31c9a1[_0x477d('0x2f')]);_0x5759f[_0x477d('0x34')]=_[_0x477d('0x32')](_0x31c9a1[_0x477d('0x2e')],qs[_0x477d('0x33')](_0x43ffd1['query'][_0x477d('0x33')]));_0x5759f[_0x477d('0x34')]=_0x5759f[_0x477d('0x34')][_0x477d('0x35')]?_0x5759f[_0x477d('0x34')]:_0x31c9a1['model'];if(_0x43ffd1['query'][_0x477d('0x3e')]){_0x5759f[_0x477d('0x44')]=[{'all':!![]}];}_0x5759f=_[_0x477d('0x45')]({},_0x5759f,_0x43ffd1['options']);return db[_0x477d('0x29')][_0x477d('0x46')](_0x5759f)[_0x477d('0x22')](handleEntityNotFound(_0x4c22f5,null))[_0x477d('0x22')](respondWithResult(_0x4c22f5,null))[_0x477d('0x41')](handleError(_0x4c22f5,null));};exports[_0x477d('0x47')]=function(_0x13f606,_0x4d4e19){return db[_0x477d('0x29')][_0x477d('0x47')](_0x13f606[_0x477d('0x48')],{})[_0x477d('0x22')](respondWithResult(_0x4d4e19,0xc9))[_0x477d('0x41')](handleError(_0x4d4e19,null));};exports[_0x477d('0x21')]=function(_0x2aad84,_0x30e474){if(_0x2aad84[_0x477d('0x48')]['id']){delete _0x2aad84[_0x477d('0x48')]['id'];}return db[_0x477d('0x29')][_0x477d('0x46')]({'where':{'id':_0x2aad84[_0x477d('0x43')]['id']}})[_0x477d('0x22')](handleEntityNotFound(_0x30e474,null))[_0x477d('0x22')](saveUpdates(_0x2aad84['body'],null))[_0x477d('0x22')](respondWithResult(_0x30e474,null))[_0x477d('0x41')](handleError(_0x30e474,null));};exports['destroy']=function(_0x566ba0,_0x5cb3ca){return db[_0x477d('0x29')][_0x477d('0x46')]({'where':{'id':_0x566ba0[_0x477d('0x43')]['id']}})[_0x477d('0x22')](handleEntityNotFound(_0x5cb3ca,null))[_0x477d('0x22')](removeEntity(_0x5cb3ca,null))[_0x477d('0x41')](handleError(_0x5cb3ca,null));};exports[_0x477d('0x49')]=function(_0x342f18,_0x593faf){return db[_0x477d('0x29')][_0x477d('0x49')]()[_0x477d('0x22')](respondWithResult(_0x593faf,null))[_0x477d('0x41')](handleError(_0x593faf,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 1a7d7df..0fc9125 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 _0x5295=['./mailQueueReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x41c31b,_0xdda69e){var _0x356ace=function(_0x7f680d){while(--_0x7f680d){_0x41c31b['push'](_0x41c31b['shift']());}};_0x356ace(++_0xdda69e);}(_0x5295,0x6c));var _0x5529=function(_0x246ef8,_0xc7d0ba){_0x246ef8=_0x246ef8-0x0;var _0x3d6707=_0x5295[_0x246ef8];return _0x3d6707;};'use strict';var _=require(_0x5529('0x0'));var util=require(_0x5529('0x1'));var logger=require(_0x5529('0x2'))(_0x5529('0x3'));var moment=require(_0x5529('0x4'));var BPromise=require(_0x5529('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5529('0x6'));var rimraf=require(_0x5529('0x7'));var config=require(_0x5529('0x8'));var attributes=require(_0x5529('0x9'));module[_0x5529('0xa')]=function(_0x30390c,_0x597f8f){return _0x30390c[_0x5529('0xb')]('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5529('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x69bf=['util','../../config/logger','bluebird','path','../../config/environment','exports','define','MailQueueReport','uniqueid','lodash'];(function(_0xab842,_0x3a34c9){var _0x1044e2=function(_0x50a187){while(--_0x50a187){_0xab842['push'](_0xab842['shift']());}};_0x1044e2(++_0x3a34c9);}(_0x69bf,0x1cb));var _0xf69b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x69bf[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf69b('0x0'));var util=require(_0xf69b('0x1'));var logger=require(_0xf69b('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf69b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf69b('0x4'));var rimraf=require('rimraf');var config=require(_0xf69b('0x5'));var attributes=require('./mailQueueReport.attributes');module[_0xf69b('0x6')]=function(_0x544dd7,_0x71a80a){return _0x544dd7[_0xf69b('0x7')](_0xf69b('0x8'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf69b('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index e01d1b9..6f17c50 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x3b4922,_0x2fa365){var _0x239729=function(_0x82fd7){while(--_0x82fd7){_0x3b4922['push'](_0x3b4922['shift']());}};_0x239729(++_0x2fa365);}(_0x2ef3,0xba));var _0x32ef=function(_0x3fe9f8,_0x4d9014){_0x3fe9f8=_0x3fe9f8-0x0;var _0x286e78=_0x2ef3[_0x3fe9f8];return _0x286e78;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x3165bb,_0x2174ce){var _0x20999f=function(_0x3a760c){while(--_0x3a760c){_0x3165bb['push'](_0x3165bb['shift']());}};_0x20999f(++_0x2174ce);}(_0x7a54,0x106));var _0x47a5=function(_0x300ddb,_0x224bc2){_0x300ddb=_0x300ddb-0x0;var _0x4d1bbd=_0x7a54[_0x300ddb];return _0x4d1bbd;};'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 acb705b..bb23884 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4536fc,_0x579536){var _0x1af01e=function(_0xfa4adf){while(--_0xfa4adf){_0x4536fc['push'](_0x4536fc['shift']());}};_0x1af01e(++_0x579536);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0xcb91[_0x4da356];return _0x321b07;};'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(_0x444975,_0x44aaf0){var _0x45cc12=function(_0x5ddd31){while(--_0x5ddd31){_0x444975['push'](_0x444975['shift']());}};_0x45cc12(++_0x44aaf0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 0844f7d..4f101f5 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 _0xcf59=['sequelize','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x1a2bb6,_0x2c8451){var _0x41abbb=function(_0x2af33c){while(--_0x2af33c){_0x1a2bb6['push'](_0x1a2bb6['shift']());}};_0x41abbb(++_0x2c8451);}(_0xcf59,0x1ea));var _0x9cf5=function(_0x3b6a6d,_0x3ba7df){_0x3b6a6d=_0x3b6a6d-0x0;var _0x13268d=_0xcf59[_0x3b6a6d];return _0x13268d;};'use strict';var Sequelize=require(_0x9cf5('0x0'));module['exports']={'description':{'type':Sequelize[_0x9cf5('0x1')]},'host':{'type':Sequelize[_0x9cf5('0x1')]},'authentication':{'type':Sequelize[_0x9cf5('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x9cf5('0x1')]},'password':{'type':Sequelize[_0x9cf5('0x1')]},'port':{'type':Sequelize[_0x9cf5('0x3')]},'tls':{'type':Sequelize[_0x9cf5('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x9cf5('0x1')],'defaultValue':_0x9cf5('0x4')},'connTimeout':{'type':Sequelize[_0x9cf5('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9cf5('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x62a7=['STRING','BOOLEAN','INTEGER','INBOX','sequelize','exports'];(function(_0x27acb0,_0x4bc9eb){var _0x2c3e10=function(_0x5e81ae){while(--_0x5e81ae){_0x27acb0['push'](_0x27acb0['shift']());}};_0x2c3e10(++_0x4bc9eb);}(_0x62a7,0x1d8));var _0x762a=function(_0x21ee11,_0x172225){_0x21ee11=_0x21ee11-0x0;var _0xb4c64e=_0x62a7[_0x21ee11];return _0xb4c64e;};'use strict';var Sequelize=require(_0x762a('0x0'));module[_0x762a('0x1')]={'description':{'type':Sequelize[_0x762a('0x2')]},'host':{'type':Sequelize[_0x762a('0x2')]},'authentication':{'type':Sequelize[_0x762a('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x762a('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x762a('0x4')]},'tls':{'type':Sequelize[_0x762a('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x762a('0x2')],'defaultValue':_0x762a('0x5')},'connTimeout':{'type':Sequelize[_0x762a('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x762a('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x762a('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 2f05946..e6e4a59 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 _0x62f0=['./mailServerIn.attributes','exports','define','mail_servers_in','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1fa56c,_0x42d719){var _0x1553b8=function(_0x2f6447){while(--_0x2f6447){_0x1fa56c['push'](_0x1fa56c['shift']());}};_0x1553b8(++_0x42d719);}(_0x62f0,0x138));var _0x062f=function(_0x2f1114,_0x4561f1){_0x2f1114=_0x2f1114-0x0;var _0x2fe856=_0x62f0[_0x2f1114];return _0x2fe856;};'use strict';var _=require(_0x062f('0x0'));var util=require(_0x062f('0x1'));var logger=require(_0x062f('0x2'))('api');var moment=require(_0x062f('0x3'));var BPromise=require(_0x062f('0x4'));var rp=require(_0x062f('0x5'));var fs=require('fs');var path=require(_0x062f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x062f('0x7'));module[_0x062f('0x8')]=function(_0x4c6644,_0x16f0e4){return _0x4c6644[_0x062f('0x9')]('MailServerIn',attributes,{'tableName':_0x062f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54db=['request-promise','path','../../config/environment','./mailServerIn.attributes','exports','mail_servers_in','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3966c7,_0x31e828){var _0x5bcd3b=function(_0x1914da){while(--_0x1914da){_0x3966c7['push'](_0x3966c7['shift']());}};_0x5bcd3b(++_0x31e828);}(_0x54db,0x124));var _0xb54d=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x54db[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0xb54d('0x0'));var util=require('util');var logger=require(_0xb54d('0x1'))(_0xb54d('0x2'));var moment=require(_0xb54d('0x3'));var BPromise=require(_0xb54d('0x4'));var rp=require(_0xb54d('0x5'));var fs=require('fs');var path=require(_0xb54d('0x6'));var rimraf=require('rimraf');var config=require(_0xb54d('0x7'));var attributes=require(_0xb54d('0x8'));module[_0xb54d('0x9')]=function(_0x1066b8,_0x3cfa27){return _0x1066b8['define']('MailServerIn',attributes,{'tableName':_0xb54d('0xa'),'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 2d7e710..c6608d4 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 _0x7a57=['limit','include','model','map','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes'];(function(_0x5385e9,_0x9398){var _0x29334e=function(_0x511caf){while(--_0x511caf){_0x5385e9['push'](_0x5385e9['shift']());}};_0x29334e(++_0x9398);}(_0x7a57,0x89));var _0x77a5=function(_0x11faa7,_0x35f3d9){_0x11faa7=_0x11faa7-0x0;var _0x48f18b=_0x7a57[_0x11faa7];return _0x48f18b;};'use strict';var _=require(_0x77a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x77a5('0x1'));var rs=require(_0x77a5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x77a5('0x3'));var logger=require(_0x77a5('0x4'))(_0x77a5('0x5'));var config=require(_0x77a5('0x6'));var jayson=require(_0x77a5('0x7'));var client=jayson[_0x77a5('0x8')][_0x77a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a1c80,_0x146d1d,_0x103a2f){return new BPromise(function(_0x15215e,_0x1e9e81){return client[_0x77a5('0xa')](_0x5a1c80,_0x103a2f)[_0x77a5('0xb')](function(_0x33b32a){logger[_0x77a5('0xc')](_0x77a5('0xd'),_0x146d1d,_0x77a5('0xe'));logger[_0x77a5('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x146d1d,'request\x20sent',JSON[_0x77a5('0x10')](_0x33b32a));if(_0x33b32a[_0x77a5('0x11')]){if(_0x33b32a['error'][_0x77a5('0x12')]===0x1f4){logger[_0x77a5('0x11')](_0x77a5('0xd'),_0x146d1d,_0x33b32a['error'][_0x77a5('0x13')]);return _0x1e9e81(_0x33b32a['error'][_0x77a5('0x13')]);}logger[_0x77a5('0x11')](_0x77a5('0xd'),_0x146d1d,_0x33b32a[_0x77a5('0x11')]['message']);return _0x15215e(_0x33b32a[_0x77a5('0x11')][_0x77a5('0x13')]);}else{logger[_0x77a5('0xc')](_0x77a5('0xd'),_0x146d1d,_0x77a5('0xe'));_0x15215e(_0x33b32a[_0x77a5('0x14')][_0x77a5('0x13')]);}})['catch'](function(_0x485cf5){logger[_0x77a5('0x11')](_0x77a5('0xd'),_0x146d1d,_0x485cf5);_0x1e9e81(_0x485cf5);});});}exports[_0x77a5('0x15')]=function(_0x41e8de){var _0x1018a4=this;return new Promise(function(_0x4b2e56,_0x1893c6){return db[_0x77a5('0x16')][_0x77a5('0x17')]({'raw':_0x41e8de[_0x77a5('0x18')]?_0x41e8de[_0x77a5('0x18')][_0x77a5('0x19')]===undefined?!![]:![]:!![],'where':_0x41e8de[_0x77a5('0x18')]?_0x41e8de[_0x77a5('0x18')][_0x77a5('0x1a')]||null:null,'attributes':_0x41e8de['options']?_0x41e8de[_0x77a5('0x18')][_0x77a5('0x1b')]||null:null,'limit':_0x41e8de[_0x77a5('0x18')]?_0x41e8de[_0x77a5('0x18')][_0x77a5('0x1c')]||null:null,'include':_0x41e8de[_0x77a5('0x18')]?_0x41e8de['options'][_0x77a5('0x1d')]?_['map'](_0x41e8de[_0x77a5('0x18')][_0x77a5('0x1d')],function(_0x39d875){return{'model':db[_0x39d875[_0x77a5('0x1e')]],'as':_0x39d875['as'],'attributes':_0x39d875[_0x77a5('0x1b')],'include':_0x39d875[_0x77a5('0x1d')]?_[_0x77a5('0x1f')](_0x39d875[_0x77a5('0x1d')],function(_0x43620e){return{'model':db[_0x43620e[_0x77a5('0x1e')]],'as':_0x43620e['as'],'attributes':_0x43620e[_0x77a5('0x1b')],'include':_0x43620e[_0x77a5('0x1d')]?_[_0x77a5('0x1f')](_0x43620e[_0x77a5('0x1d')],function(_0x51453f){return{'model':db[_0x51453f[_0x77a5('0x1e')]],'as':_0x51453f['as'],'attributes':_0x51453f[_0x77a5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x77a5('0xb')](function(_0x4dfb26){logger[_0x77a5('0xc')]('GetMailServerIn',_0x41e8de);logger['debug'](_0x77a5('0x15'),_0x41e8de,JSON['stringify'](_0x4dfb26));_0x4b2e56(_0x4dfb26);})[_0x77a5('0x20')](function(_0xd90a34){logger[_0x77a5('0x11')](_0x77a5('0x15'),_0xd90a34[_0x77a5('0x13')],_0x41e8de);_0x1893c6(_0x1018a4[_0x77a5('0x11')](0x1f4,_0xd90a34[_0x77a5('0x13')]));});});}; \ No newline at end of file +var _0x4157=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','model','map','lodash','util'];(function(_0x3a1ea5,_0x349f01){var _0xfac9b2=function(_0xd5310c){while(--_0xd5310c){_0x3a1ea5['push'](_0x3a1ea5['shift']());}};_0xfac9b2(++_0x349f01);}(_0x4157,0xf3));var _0x7415=function(_0x44b6d8,_0x533378){_0x44b6d8=_0x44b6d8-0x0;var _0x2434d9=_0x4157[_0x44b6d8];return _0x2434d9;};'use strict';var _=require(_0x7415('0x0'));var util=require(_0x7415('0x1'));var moment=require(_0x7415('0x2'));var BPromise=require(_0x7415('0x3'));var rs=require(_0x7415('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7415('0x5'))['db'];var utils=require(_0x7415('0x6'));var logger=require(_0x7415('0x7'))(_0x7415('0x8'));var config=require(_0x7415('0x9'));var jayson=require(_0x7415('0xa'));var client=jayson[_0x7415('0xb')][_0x7415('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c7980,_0x49b694,_0x26fe93){return new BPromise(function(_0x588c5a,_0x972b02){return client['request'](_0x3c7980,_0x26fe93)[_0x7415('0xd')](function(_0x1a42df){logger[_0x7415('0xe')](_0x7415('0xf'),_0x49b694,_0x7415('0x10'));logger[_0x7415('0x11')](_0x7415('0x12'),_0x49b694,'request\x20sent',JSON[_0x7415('0x13')](_0x1a42df));if(_0x1a42df[_0x7415('0x14')]){if(_0x1a42df[_0x7415('0x14')][_0x7415('0x15')]===0x1f4){logger[_0x7415('0x14')]('MailServerIn,\x20%s,\x20%s',_0x49b694,_0x1a42df[_0x7415('0x14')][_0x7415('0x16')]);return _0x972b02(_0x1a42df[_0x7415('0x14')][_0x7415('0x16')]);}logger[_0x7415('0x14')](_0x7415('0xf'),_0x49b694,_0x1a42df[_0x7415('0x14')][_0x7415('0x16')]);return _0x588c5a(_0x1a42df[_0x7415('0x14')][_0x7415('0x16')]);}else{logger[_0x7415('0xe')](_0x7415('0xf'),_0x49b694,_0x7415('0x10'));_0x588c5a(_0x1a42df['result'][_0x7415('0x16')]);}})[_0x7415('0x17')](function(_0x2398d1){logger[_0x7415('0x14')]('MailServerIn,\x20%s,\x20%s',_0x49b694,_0x2398d1);_0x972b02(_0x2398d1);});});}exports[_0x7415('0x18')]=function(_0x2543f1){var _0x51efee=this;return new Promise(function(_0x302a2b,_0x510ae1){return db[_0x7415('0x19')][_0x7415('0x1a')]({'raw':_0x2543f1[_0x7415('0x1b')]?_0x2543f1[_0x7415('0x1b')][_0x7415('0x1c')]===undefined?!![]:![]:!![],'where':_0x2543f1[_0x7415('0x1b')]?_0x2543f1[_0x7415('0x1b')][_0x7415('0x1d')]||null:null,'attributes':_0x2543f1[_0x7415('0x1b')]?_0x2543f1[_0x7415('0x1b')][_0x7415('0x1e')]||null:null,'limit':_0x2543f1['options']?_0x2543f1['options'][_0x7415('0x1f')]||null:null,'include':_0x2543f1[_0x7415('0x1b')]?_0x2543f1[_0x7415('0x1b')][_0x7415('0x20')]?_['map'](_0x2543f1[_0x7415('0x1b')]['include'],function(_0x478abe){return{'model':db[_0x478abe[_0x7415('0x21')]],'as':_0x478abe['as'],'attributes':_0x478abe[_0x7415('0x1e')],'include':_0x478abe[_0x7415('0x20')]?_[_0x7415('0x22')](_0x478abe[_0x7415('0x20')],function(_0x24a554){return{'model':db[_0x24a554[_0x7415('0x21')]],'as':_0x24a554['as'],'attributes':_0x24a554[_0x7415('0x1e')],'include':_0x24a554[_0x7415('0x20')]?_[_0x7415('0x22')](_0x24a554['include'],function(_0x464f49){return{'model':db[_0x464f49[_0x7415('0x21')]],'as':_0x464f49['as'],'attributes':_0x464f49[_0x7415('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7415('0xd')](function(_0x28792b){logger['info'](_0x7415('0x18'),_0x2543f1);logger['debug'](_0x7415('0x18'),_0x2543f1,JSON[_0x7415('0x13')](_0x28792b));_0x302a2b(_0x28792b);})[_0x7415('0x17')](function(_0x31588b){logger['error'](_0x7415('0x18'),_0x31588b['message'],_0x2543f1);_0x510ae1(_0x51efee['error'](0x1f4,_0x31588b[_0x7415('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 024399f..deb1702 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 _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x7a54,0x106));var _0x47a5=function(_0x112d73,_0x1e6644){_0x112d73=_0x112d73-0x0;var _0x2c869e=_0x7a54[_0x112d73];return _0x2c869e;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +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(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 2559d1f..da85dd0 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 _0xbaf0=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x40edbb,_0x4b8e85){var _0x1c34e1=function(_0x4cb6dc){while(--_0x4cb6dc){_0x40edbb['push'](_0x40edbb['shift']());}};_0x1c34e1(++_0x4b8e85);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'description':{'type':Sequelize[_0x0baf('0x1')]},'host':{'type':Sequelize[_0x0baf('0x1')]},'user':{'type':Sequelize[_0x0baf('0x1')]},'pass':{'type':Sequelize[_0x0baf('0x1')]},'port':{'type':Sequelize[_0x0baf('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x0baf('0x1')]},'authentication':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xd4f4=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x54bdbc,_0x893959){var _0x4ee490=function(_0x5d58b0){while(--_0x5d58b0){_0x54bdbc['push'](_0x54bdbc['shift']());}};_0x4ee490(++_0x893959);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x222b78,_0x3c8166){_0x222b78=_0x222b78-0x0;var _0x5c05ee=_0xd4f4[_0x222b78];return _0x5c05ee;};'use strict';var Sequelize=require(_0x4d4f('0x0'));module[_0x4d4f('0x1')]={'description':{'type':Sequelize[_0x4d4f('0x2')]},'host':{'type':Sequelize[_0x4d4f('0x2')]},'user':{'type':Sequelize[_0x4d4f('0x2')]},'pass':{'type':Sequelize[_0x4d4f('0x2')]},'port':{'type':Sequelize[_0x4d4f('0x3')]},'secure':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x4d4f('0x2')]},'authentication':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x4d4f('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 54ca536..476027f 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 _0x95c6=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','end','name','send','map','MailServerOut','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','find','create','body','destroy','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/logger'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x95c6,0x1e8));var _0x695c=function(_0x3b7f67,_0x369790){_0x3b7f67=_0x3b7f67-0x0;var _0x10aed7=_0x95c6[_0x3b7f67];return _0x10aed7;};'use strict';var emlformat=require(_0x695c('0x0'));var rimraf=require(_0x695c('0x1'));var zipdir=require(_0x695c('0x2'));var jsonpatch=require(_0x695c('0x3'));var rp=require(_0x695c('0x4'));var moment=require(_0x695c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x695c('0x6'));var util=require('util');var path=require(_0x695c('0x7'));var sox=require(_0x695c('0x8'));var csv=require(_0x695c('0x9'));var ejs=require(_0x695c('0xa'));var fs=require('fs');var fs_extra=require(_0x695c('0xb'));var _=require(_0x695c('0xc'));var squel=require(_0x695c('0xd'));var crypto=require(_0x695c('0xe'));var jsforce=require(_0x695c('0xf'));var deskjs=require(_0x695c('0x10'));var toCsv=require('to-csv');var querystring=require(_0x695c('0x11'));var Papa=require(_0x695c('0x12'));var Redis=require('ioredis');var authService=require(_0x695c('0x13'));var qs=require(_0x695c('0x14'));var as=require(_0x695c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x695c('0x16'))(_0x695c('0x17'));var utils=require(_0x695c('0x18'));var config=require(_0x695c('0x19'));var licenseUtil=require(_0x695c('0x1a'));var db=require(_0x695c('0x1b'))['db'];function respondWithStatusCode(_0x4420ef,_0x4be071){_0x4be071=_0x4be071||0xcc;return function(_0x2068e1){if(_0x2068e1){return _0x4420ef[_0x695c('0x1c')](_0x4be071);}return _0x4420ef[_0x695c('0x1d')](_0x4be071)['end']();};}function respondWithResult(_0x30fa17,_0x5cab44){_0x5cab44=_0x5cab44||0xc8;return function(_0x1b939f){if(_0x1b939f){return _0x30fa17[_0x695c('0x1d')](_0x5cab44)[_0x695c('0x1e')](_0x1b939f);}};}function respondWithFilteredResult(_0x587252,_0x44d131){return function(_0x192e43){if(_0x192e43){var _0x49d8a7=typeof _0x44d131[_0x695c('0x1f')]===_0x695c('0x20')&&typeof _0x44d131['limit']===_0x695c('0x20');var _0x4fcea5=_0x192e43['count'];var _0x26a5ab=_0x49d8a7?0x0:_0x44d131[_0x695c('0x1f')];var _0xdd10f7=_0x49d8a7?_0x192e43['count']:_0x44d131[_0x695c('0x1f')]+_0x44d131[_0x695c('0x21')];var _0x13ea9b;if(_0xdd10f7>=_0x4fcea5){_0xdd10f7=_0x4fcea5;_0x13ea9b=0xc8;}else{_0x13ea9b=0xce;}_0x587252[_0x695c('0x1d')](_0x13ea9b);return _0x587252[_0x695c('0x22')](_0x695c('0x23'),_0x26a5ab+'-'+_0xdd10f7+'/'+_0x4fcea5)[_0x695c('0x1e')](_0x192e43);}return null;};}function patchUpdates(_0xbc1c9c){return function(_0x1b71c0){try{jsonpatch['apply'](_0x1b71c0,_0xbc1c9c,!![]);}catch(_0x5638f9){return BPromise[_0x695c('0x24')](_0x5638f9);}return _0x1b71c0[_0x695c('0x25')]();};}function saveUpdates(_0x47646b,_0x1ddd63){return function(_0x2ea27d){if(_0x2ea27d){return _0x2ea27d[_0x695c('0x26')](_0x47646b)['then'](function(_0x501448){return _0x501448;});}return null;};}function removeEntity(_0x5c9473,_0x3e762e){return function(_0x44ca06){if(_0x44ca06){return _0x44ca06['destroy']()[_0x695c('0x27')](function(){_0x5c9473[_0x695c('0x1d')](0xcc)[_0x695c('0x28')]();});}};}function handleEntityNotFound(_0x4d77c9,_0x4875b6){return function(_0x5709ce){if(!_0x5709ce){_0x4d77c9['sendStatus'](0x194);}return _0x5709ce;};}function handleError(_0x251f54,_0x24f909){_0x24f909=_0x24f909||0x1f4;return function(_0x50985d){logger['error'](_0x50985d['stack']);if(_0x50985d[_0x695c('0x29')]){delete _0x50985d[_0x695c('0x29')];}_0x251f54[_0x695c('0x1d')](_0x24f909)[_0x695c('0x2a')](_0x50985d);};}exports['index']=function(_0x355470,_0x117441){var _0x49b680={},_0x1b30cc={},_0x1e931b={'count':0x0,'rows':[]};var _0x3aeb05=_[_0x695c('0x2b')](db[_0x695c('0x2c')][_0x695c('0x2d')],function(_0x3d2046){return{'name':_0x3d2046['fieldName'],'type':_0x3d2046[_0x695c('0x2e')]['key']};});_0x1b30cc[_0x695c('0x2f')]=_[_0x695c('0x2b')](_0x3aeb05,'name');_0x1b30cc[_0x695c('0x30')]=_[_0x695c('0x31')](_0x355470[_0x695c('0x30')]);_0x1b30cc[_0x695c('0x32')]=_[_0x695c('0x33')](_0x1b30cc[_0x695c('0x2f')],_0x1b30cc['query']);_0x49b680[_0x695c('0x34')]=_[_0x695c('0x33')](_0x1b30cc[_0x695c('0x2f')],qs['fields'](_0x355470[_0x695c('0x30')][_0x695c('0x35')]));_0x49b680[_0x695c('0x34')]=_0x49b680[_0x695c('0x34')][_0x695c('0x36')]?_0x49b680[_0x695c('0x34')]:_0x1b30cc[_0x695c('0x2f')];if(!_0x355470[_0x695c('0x30')]['hasOwnProperty']('nolimit')){_0x49b680[_0x695c('0x21')]=qs[_0x695c('0x21')](_0x355470[_0x695c('0x30')][_0x695c('0x21')]);_0x49b680['offset']=qs[_0x695c('0x1f')](_0x355470['query'][_0x695c('0x1f')]);}_0x49b680[_0x695c('0x37')]=qs[_0x695c('0x38')](_0x355470['query'][_0x695c('0x38')]);_0x49b680[_0x695c('0x39')]=qs[_0x695c('0x32')](_[_0x695c('0x3a')](_0x355470[_0x695c('0x30')],_0x1b30cc[_0x695c('0x32')]),_0x3aeb05);if(_0x355470['query'][_0x695c('0x3b')]){_0x49b680['where']=_[_0x695c('0x3c')](_0x49b680[_0x695c('0x39')],{'$or':_[_0x695c('0x2b')](_0x3aeb05,function(_0x35d9c3){if(_0x35d9c3[_0x695c('0x2e')]!==_0x695c('0x3d')){var _0x49abe3={};_0x49abe3[_0x35d9c3['name']]={'$like':'%'+_0x355470[_0x695c('0x30')]['filter']+'%'};return _0x49abe3;}})});}_0x49b680=_[_0x695c('0x3c')]({},_0x49b680,_0x355470[_0x695c('0x3e')]);var _0x48cfbf={'where':_0x49b680[_0x695c('0x39')]};return db[_0x695c('0x2c')][_0x695c('0x3f')](_0x48cfbf)[_0x695c('0x27')](function(_0x325f85){_0x1e931b[_0x695c('0x3f')]=_0x325f85;if(_0x355470[_0x695c('0x30')][_0x695c('0x40')]){_0x49b680['include']=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x49b680);})[_0x695c('0x27')](function(_0x2692e5){_0x1e931b[_0x695c('0x41')]=_0x2692e5;return _0x1e931b;})[_0x695c('0x27')](respondWithFilteredResult(_0x117441,_0x49b680))[_0x695c('0x42')](handleError(_0x117441,null));};exports[_0x695c('0x43')]=function(_0x36fb8d,_0x150f59){var _0x304a1f={'raw':!![],'where':{'id':_0x36fb8d[_0x695c('0x44')]['id']}},_0x2d6148={};_0x2d6148[_0x695c('0x2f')]=_[_0x695c('0x31')](db[_0x695c('0x2c')][_0x695c('0x2d')]);_0x2d6148[_0x695c('0x30')]=_[_0x695c('0x31')](_0x36fb8d[_0x695c('0x30')]);_0x2d6148[_0x695c('0x32')]=_[_0x695c('0x33')](_0x2d6148[_0x695c('0x2f')],_0x2d6148[_0x695c('0x30')]);_0x304a1f[_0x695c('0x34')]=_[_0x695c('0x33')](_0x2d6148[_0x695c('0x2f')],qs[_0x695c('0x35')](_0x36fb8d[_0x695c('0x30')][_0x695c('0x35')]));_0x304a1f[_0x695c('0x34')]=_0x304a1f[_0x695c('0x34')][_0x695c('0x36')]?_0x304a1f['attributes']:_0x2d6148['model'];if(_0x36fb8d[_0x695c('0x30')][_0x695c('0x40')]){_0x304a1f['include']=[{'all':!![]}];}_0x304a1f=_[_0x695c('0x3c')]({},_0x304a1f,_0x36fb8d['options']);return db[_0x695c('0x2c')][_0x695c('0x45')](_0x304a1f)[_0x695c('0x27')](handleEntityNotFound(_0x150f59,null))[_0x695c('0x27')](respondWithResult(_0x150f59,null))['catch'](handleError(_0x150f59,null));};exports[_0x695c('0x46')]=function(_0xd7739b,_0x278845){return db[_0x695c('0x2c')][_0x695c('0x46')](_0xd7739b[_0x695c('0x47')],{})[_0x695c('0x27')](respondWithResult(_0x278845,0xc9))[_0x695c('0x42')](handleError(_0x278845,null));};exports[_0x695c('0x26')]=function(_0x24efaa,_0xbebb10){if(_0x24efaa[_0x695c('0x47')]['id']){delete _0x24efaa[_0x695c('0x47')]['id'];}return db[_0x695c('0x2c')]['find']({'where':{'id':_0x24efaa['params']['id']}})[_0x695c('0x27')](handleEntityNotFound(_0xbebb10,null))[_0x695c('0x27')](saveUpdates(_0x24efaa[_0x695c('0x47')],null))[_0x695c('0x27')](respondWithResult(_0xbebb10,null))[_0x695c('0x42')](handleError(_0xbebb10,null));};exports[_0x695c('0x48')]=function(_0x407a07,_0xd4b5a4){return db[_0x695c('0x2c')]['find']({'where':{'id':_0x407a07[_0x695c('0x44')]['id']}})[_0x695c('0x27')](handleEntityNotFound(_0xd4b5a4,null))[_0x695c('0x27')](removeEntity(_0xd4b5a4,null))[_0x695c('0x42')](handleError(_0xd4b5a4,null));}; \ No newline at end of file +var _0x74b8=['querystring','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','json','offset','undefined','limit','count','Content-Range','save','then','end','error','name','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x516e7d,_0x5f14f2){var _0x4e3fad=function(_0x226853){while(--_0x226853){_0x516e7d['push'](_0x516e7d['shift']());}};_0x4e3fad(++_0x5f14f2);}(_0x74b8,0x81));var _0x874b=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x74b8[_0x5447fd];return _0x15b28a;};'use strict';var emlformat=require(_0x874b('0x0'));var rimraf=require(_0x874b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x874b('0x2'));var rp=require(_0x874b('0x3'));var moment=require('moment');var BPromise=require(_0x874b('0x4'));var Mustache=require(_0x874b('0x5'));var util=require('util');var path=require(_0x874b('0x6'));var sox=require('sox');var csv=require(_0x874b('0x7'));var ejs=require(_0x874b('0x8'));var fs=require('fs');var fs_extra=require(_0x874b('0x9'));var _=require(_0x874b('0xa'));var squel=require(_0x874b('0xb'));var crypto=require(_0x874b('0xc'));var jsforce=require(_0x874b('0xd'));var deskjs=require(_0x874b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x874b('0xf'));var Papa=require('papaparse');var Redis=require(_0x874b('0x10'));var authService=require(_0x874b('0x11'));var qs=require(_0x874b('0x12'));var as=require(_0x874b('0x13'));var hardwareService=require(_0x874b('0x14'));var logger=require(_0x874b('0x15'))('api');var utils=require(_0x874b('0x16'));var config=require(_0x874b('0x17'));var licenseUtil=require(_0x874b('0x18'));var db=require(_0x874b('0x19'))['db'];function respondWithStatusCode(_0x1c8221,_0x5a1802){_0x5a1802=_0x5a1802||0xcc;return function(_0x1d2441){if(_0x1d2441){return _0x1c8221[_0x874b('0x1a')](_0x5a1802);}return _0x1c8221[_0x874b('0x1b')](_0x5a1802)['end']();};}function respondWithResult(_0x1443d6,_0x1118e5){_0x1118e5=_0x1118e5||0xc8;return function(_0x139a56){if(_0x139a56){return _0x1443d6[_0x874b('0x1b')](_0x1118e5)[_0x874b('0x1c')](_0x139a56);}};}function respondWithFilteredResult(_0x4a361d,_0x385f76){return function(_0x18e0ce){if(_0x18e0ce){var _0x12e6aa=typeof _0x385f76[_0x874b('0x1d')]===_0x874b('0x1e')&&typeof _0x385f76[_0x874b('0x1f')]==='undefined';var _0x204b66=_0x18e0ce[_0x874b('0x20')];var _0x4bcf65=_0x12e6aa?0x0:_0x385f76[_0x874b('0x1d')];var _0x3b8586=_0x12e6aa?_0x18e0ce[_0x874b('0x20')]:_0x385f76[_0x874b('0x1d')]+_0x385f76['limit'];var _0x7341b9;if(_0x3b8586>=_0x204b66){_0x3b8586=_0x204b66;_0x7341b9=0xc8;}else{_0x7341b9=0xce;}_0x4a361d[_0x874b('0x1b')](_0x7341b9);return _0x4a361d['set'](_0x874b('0x21'),_0x4bcf65+'-'+_0x3b8586+'/'+_0x204b66)[_0x874b('0x1c')](_0x18e0ce);}return null;};}function patchUpdates(_0x296c5){return function(_0x5b75ed){try{jsonpatch['apply'](_0x5b75ed,_0x296c5,!![]);}catch(_0x2d1f52){return BPromise['reject'](_0x2d1f52);}return _0x5b75ed[_0x874b('0x22')]();};}function saveUpdates(_0x2fb0b5,_0x577559){return function(_0x35122e){if(_0x35122e){return _0x35122e['update'](_0x2fb0b5)[_0x874b('0x23')](function(_0x48d790){return _0x48d790;});}return null;};}function removeEntity(_0x2fb1b5,_0x337247){return function(_0x54e3f1){if(_0x54e3f1){return _0x54e3f1['destroy']()[_0x874b('0x23')](function(){_0x2fb1b5[_0x874b('0x1b')](0xcc)[_0x874b('0x24')]();});}};}function handleEntityNotFound(_0x402df4,_0x275d95){return function(_0x1f0157){if(!_0x1f0157){_0x402df4['sendStatus'](0x194);}return _0x1f0157;};}function handleError(_0x3b5556,_0x2a9023){_0x2a9023=_0x2a9023||0x1f4;return function(_0x59b22b){logger[_0x874b('0x25')](_0x59b22b['stack']);if(_0x59b22b[_0x874b('0x26')]){delete _0x59b22b[_0x874b('0x26')];}_0x3b5556[_0x874b('0x1b')](_0x2a9023)['send'](_0x59b22b);};}exports[_0x874b('0x27')]=function(_0x55a8f3,_0x336c2f){var _0x5ab6c8={},_0x37cbb8={},_0x4fc6e4={'count':0x0,'rows':[]};var _0x8175ad=_[_0x874b('0x28')](db[_0x874b('0x29')][_0x874b('0x2a')],function(_0x3816ab){return{'name':_0x3816ab[_0x874b('0x2b')],'type':_0x3816ab[_0x874b('0x2c')][_0x874b('0x2d')]};});_0x37cbb8[_0x874b('0x2e')]=_[_0x874b('0x28')](_0x8175ad,_0x874b('0x26'));_0x37cbb8[_0x874b('0x2f')]=_[_0x874b('0x30')](_0x55a8f3['query']);_0x37cbb8[_0x874b('0x31')]=_[_0x874b('0x32')](_0x37cbb8[_0x874b('0x2e')],_0x37cbb8[_0x874b('0x2f')]);_0x5ab6c8[_0x874b('0x33')]=_['intersection'](_0x37cbb8[_0x874b('0x2e')],qs[_0x874b('0x34')](_0x55a8f3[_0x874b('0x2f')][_0x874b('0x34')]));_0x5ab6c8[_0x874b('0x33')]=_0x5ab6c8[_0x874b('0x33')][_0x874b('0x35')]?_0x5ab6c8[_0x874b('0x33')]:_0x37cbb8[_0x874b('0x2e')];if(!_0x55a8f3[_0x874b('0x2f')][_0x874b('0x36')](_0x874b('0x37'))){_0x5ab6c8['limit']=qs['limit'](_0x55a8f3['query'][_0x874b('0x1f')]);_0x5ab6c8['offset']=qs['offset'](_0x55a8f3[_0x874b('0x2f')][_0x874b('0x1d')]);}_0x5ab6c8[_0x874b('0x38')]=qs[_0x874b('0x39')](_0x55a8f3[_0x874b('0x2f')][_0x874b('0x39')]);_0x5ab6c8[_0x874b('0x3a')]=qs[_0x874b('0x31')](_[_0x874b('0x3b')](_0x55a8f3[_0x874b('0x2f')],_0x37cbb8['filters']),_0x8175ad);if(_0x55a8f3[_0x874b('0x2f')][_0x874b('0x3c')]){_0x5ab6c8['where']=_[_0x874b('0x3d')](_0x5ab6c8[_0x874b('0x3a')],{'$or':_['map'](_0x8175ad,function(_0x122a8f){if(_0x122a8f[_0x874b('0x2c')]!==_0x874b('0x3e')){var _0x5258cd={};_0x5258cd[_0x122a8f['name']]={'$like':'%'+_0x55a8f3[_0x874b('0x2f')]['filter']+'%'};return _0x5258cd;}})});}_0x5ab6c8=_[_0x874b('0x3d')]({},_0x5ab6c8,_0x55a8f3['options']);var _0x5f2133={'where':_0x5ab6c8[_0x874b('0x3a')]};return db[_0x874b('0x29')]['count'](_0x5f2133)['then'](function(_0x4fad29){_0x4fc6e4['count']=_0x4fad29;if(_0x55a8f3['query'][_0x874b('0x3f')]){_0x5ab6c8['include']=[{'all':!![]}];}return db[_0x874b('0x29')]['findAll'](_0x5ab6c8);})[_0x874b('0x23')](function(_0x261f8e){_0x4fc6e4[_0x874b('0x40')]=_0x261f8e;return _0x4fc6e4;})[_0x874b('0x23')](respondWithFilteredResult(_0x336c2f,_0x5ab6c8))[_0x874b('0x41')](handleError(_0x336c2f,null));};exports[_0x874b('0x42')]=function(_0x5653f5,_0x4e4fcd){var _0x263fd1={'raw':!![],'where':{'id':_0x5653f5[_0x874b('0x43')]['id']}},_0x2e841e={};_0x2e841e['model']=_['keys'](db[_0x874b('0x29')]['rawAttributes']);_0x2e841e[_0x874b('0x2f')]=_[_0x874b('0x30')](_0x5653f5[_0x874b('0x2f')]);_0x2e841e[_0x874b('0x31')]=_[_0x874b('0x32')](_0x2e841e[_0x874b('0x2e')],_0x2e841e['query']);_0x263fd1['attributes']=_['intersection'](_0x2e841e[_0x874b('0x2e')],qs[_0x874b('0x34')](_0x5653f5[_0x874b('0x2f')]['fields']));_0x263fd1[_0x874b('0x33')]=_0x263fd1[_0x874b('0x33')]['length']?_0x263fd1[_0x874b('0x33')]:_0x2e841e[_0x874b('0x2e')];if(_0x5653f5[_0x874b('0x2f')][_0x874b('0x3f')]){_0x263fd1['include']=[{'all':!![]}];}_0x263fd1=_[_0x874b('0x3d')]({},_0x263fd1,_0x5653f5['options']);return db[_0x874b('0x29')][_0x874b('0x44')](_0x263fd1)[_0x874b('0x23')](handleEntityNotFound(_0x4e4fcd,null))[_0x874b('0x23')](respondWithResult(_0x4e4fcd,null))['catch'](handleError(_0x4e4fcd,null));};exports['create']=function(_0xde6cc9,_0x599414){return db['MailServerOut'][_0x874b('0x45')](_0xde6cc9[_0x874b('0x46')],{})[_0x874b('0x23')](respondWithResult(_0x599414,0xc9))[_0x874b('0x41')](handleError(_0x599414,null));};exports[_0x874b('0x47')]=function(_0x1e0786,_0x2f427d){if(_0x1e0786[_0x874b('0x46')]['id']){delete _0x1e0786[_0x874b('0x46')]['id'];}return db[_0x874b('0x29')][_0x874b('0x44')]({'where':{'id':_0x1e0786['params']['id']}})[_0x874b('0x23')](handleEntityNotFound(_0x2f427d,null))['then'](saveUpdates(_0x1e0786[_0x874b('0x46')],null))[_0x874b('0x23')](respondWithResult(_0x2f427d,null))['catch'](handleError(_0x2f427d,null));};exports['destroy']=function(_0x54cb9e,_0x5316d){return db[_0x874b('0x29')][_0x874b('0x44')]({'where':{'id':_0x54cb9e[_0x874b('0x43')]['id']}})[_0x874b('0x23')](handleEntityNotFound(_0x5316d,null))[_0x874b('0x23')](removeEntity(_0x5316d,null))[_0x874b('0x41')](handleError(_0x5316d,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index c908ba7..732763b 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 _0x5367=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','define','MailServerOut','lodash'];(function(_0x51557b,_0x521c80){var _0x83171=function(_0x17bd85){while(--_0x17bd85){_0x51557b['push'](_0x51557b['shift']());}};_0x83171(++_0x521c80);}(_0x5367,0xe6));var _0x7536=function(_0x3b6b33,_0x2dfb02){_0x3b6b33=_0x3b6b33-0x0;var _0x3e19f6=_0x5367[_0x3b6b33];return _0x3e19f6;};'use strict';var _=require(_0x7536('0x0'));var util=require(_0x7536('0x1'));var logger=require(_0x7536('0x2'))(_0x7536('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7536('0x4'));var fs=require('fs');var path=require(_0x7536('0x5'));var rimraf=require(_0x7536('0x6'));var config=require(_0x7536('0x7'));var attributes=require(_0x7536('0x8'));module['exports']=function(_0x5148e8,_0x3984f2){return _0x5148e8[_0x7536('0x9')](_0x7536('0xa'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e2d=['request-promise','path','rimraf','./mailServerOut.attributes','define','mail_servers_out','lodash','util','../../config/logger','api','moment'];(function(_0x29aeb2,_0x48d202){var _0x381f10=function(_0x241ed4){while(--_0x241ed4){_0x29aeb2['push'](_0x29aeb2['shift']());}};_0x381f10(++_0x48d202);}(_0x0e2d,0xab));var _0xd0e2=function(_0x1dc779,_0x362048){_0x1dc779=_0x1dc779-0x0;var _0x41976d=_0x0e2d[_0x1dc779];return _0x41976d;};'use strict';var _=require(_0xd0e2('0x0'));var util=require(_0xd0e2('0x1'));var logger=require(_0xd0e2('0x2'))(_0xd0e2('0x3'));var moment=require(_0xd0e2('0x4'));var BPromise=require('bluebird');var rp=require(_0xd0e2('0x5'));var fs=require('fs');var path=require(_0xd0e2('0x6'));var rimraf=require(_0xd0e2('0x7'));var config=require('../../config/environment');var attributes=require(_0xd0e2('0x8'));module['exports']=function(_0x5f3df6,_0xd0f5b8){return _0x5f3df6[_0xd0e2('0x9')]('MailServerOut',attributes,{'tableName':_0xd0e2('0xa'),'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 a6bc1f7..5a78ed5 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 _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\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(_0x733c8c,_0x1562e3){var _0x3bc24d=function(_0x25a97a){while(--_0x25a97a){_0x733c8c['push'](_0x733c8c['shift']());}};_0x3bc24d(++_0x1562e3);}(_0x1261,0x144));var _0x1126=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x1261[_0x75f869];return _0x10af8b;};'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')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x230078,_0x40e1b4){var _0x379ab7=function(_0x39675e){while(--_0x39675e){_0x230078['push'](_0x230078['shift']());}};_0x379ab7(++_0x40e1b4);}(_0xadb5,0xad));var _0x5adb=function(_0x36b0a6,_0x1b581e){_0x36b0a6=_0x36b0a6-0x0;var _0x3935ce=_0xadb5[_0x36b0a6];return _0x3935ce;};'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']('MailServerOut,\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/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 3632d14..372ed2f 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 _0xcf20=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0xcf20,0x144));var _0x0cf2=function(_0x14dc6e,_0x3c0135){_0x14dc6e=_0x14dc6e-0x0;var _0x4e7989=_0xcf20[_0x14dc6e];return _0x4e7989;};'use strict';var multer=require(_0x0cf2('0x0'));var util=require(_0x0cf2('0x1'));var path=require(_0x0cf2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0cf2('0x3')]();var fs_extra=require(_0x0cf2('0x4'));var auth=require(_0x0cf2('0x5'));var interaction=require(_0x0cf2('0x6'));var config=require(_0x0cf2('0x7'));var controller=require('./mailSubstatus.controller');router['get']('/',auth[_0x0cf2('0x8')](),controller['index']);router['get'](_0x0cf2('0x9'),auth[_0x0cf2('0x8')](),controller['describe']);router['get'](_0x0cf2('0xa'),auth[_0x0cf2('0x8')](),controller[_0x0cf2('0xb')]);router[_0x0cf2('0xc')]('/',auth[_0x0cf2('0x8')](),controller[_0x0cf2('0xd')]);router[_0x0cf2('0xe')](_0x0cf2('0xa'),auth[_0x0cf2('0x8')](),controller[_0x0cf2('0xf')]);router[_0x0cf2('0x10')](_0x0cf2('0xa'),auth[_0x0cf2('0x8')](),controller[_0x0cf2('0x11')]);module['exports']=router; \ No newline at end of file +var _0x54a4=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','exports','multer'];(function(_0x58f8a7,_0xbd36a7){var _0x149b97=function(_0x1def61){while(--_0x1def61){_0x58f8a7['push'](_0x58f8a7['shift']());}};_0x149b97(++_0xbd36a7);}(_0x54a4,0x125));var _0x454a=function(_0x1af1ba,_0xbd3104){_0x1af1ba=_0x1af1ba-0x0;var _0x37d83b=_0x54a4[_0x1af1ba];return _0x37d83b;};'use strict';var multer=require(_0x454a('0x0'));var util=require(_0x454a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x454a('0x2'));var router=express[_0x454a('0x3')]();var fs_extra=require(_0x454a('0x4'));var auth=require(_0x454a('0x5'));var interaction=require(_0x454a('0x6'));var config=require(_0x454a('0x7'));var controller=require(_0x454a('0x8'));router[_0x454a('0x9')]('/',auth[_0x454a('0xa')](),controller[_0x454a('0xb')]);router[_0x454a('0x9')](_0x454a('0xc'),auth[_0x454a('0xa')](),controller[_0x454a('0xd')]);router['get'](_0x454a('0xe'),auth[_0x454a('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x454a('0xf')]);router[_0x454a('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x454a('0x11')]);router[_0x454a('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x454a('0x13')]);module[_0x454a('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 9f38e49..4bf29ec 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 _0xc21e=['STRING','name','exports'];(function(_0x2af0bd,_0x30c3ac){var _0x1f52cd=function(_0x3101ee){while(--_0x3101ee){_0x2af0bd['push'](_0x2af0bd['shift']());}};_0x1f52cd(++_0x30c3ac);}(_0xc21e,0x1ca));var _0xec21=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc21e[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require('sequelize');module[_0xec21('0x0')]={'name':{'type':Sequelize[_0xec21('0x1')],'unique':_0xec21('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xec21('0x1')]}}; \ No newline at end of file +var _0x687b=['STRING','name','sequelize','exports'];(function(_0x312cc0,_0x1e801f){var _0xb557f8=function(_0x145655){while(--_0x145655){_0x312cc0['push'](_0x312cc0['shift']());}};_0xb557f8(++_0x1e801f);}(_0x687b,0x14a));var _0xb687=function(_0x38e8b0,_0x5b8cb5){_0x38e8b0=_0x38e8b0-0x0;var _0x139697=_0x687b[_0x38e8b0];return _0x139697;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')],'unique':_0xb687('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 8d36064..bc5dedb 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 _0x929f=['MailSubstatus','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','includeAll','find','create','body','update','params','describe','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','status','end','error','stack','name','send','map'];(function(_0x579f5d,_0x4de225){var _0x11db8e=function(_0x2968e3){while(--_0x2968e3){_0x579f5d['push'](_0x579f5d['shift']());}};_0x11db8e(++_0x4de225);}(_0x929f,0x65));var _0xf929=function(_0x264716,_0x34ffe6){_0x264716=_0x264716-0x0;var _0x528eaa=_0x929f[_0x264716];return _0x528eaa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf929('0x0'));var zipdir=require(_0xf929('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf929('0x2'));var BPromise=require(_0xf929('0x3'));var Mustache=require(_0xf929('0x4'));var util=require('util');var path=require('path');var sox=require(_0xf929('0x5'));var csv=require(_0xf929('0x6'));var ejs=require(_0xf929('0x7'));var fs=require('fs');var fs_extra=require(_0xf929('0x8'));var _=require(_0xf929('0x9'));var squel=require(_0xf929('0xa'));var crypto=require(_0xf929('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf929('0x6'));var querystring=require(_0xf929('0xc'));var Papa=require('papaparse');var Redis=require(_0xf929('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf929('0xe'));var hardwareService=require(_0xf929('0xf'));var logger=require('../../config/logger')(_0xf929('0x10'));var utils=require(_0xf929('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54be9f,_0x1db7fa){_0x1db7fa=_0x1db7fa||0xcc;return function(_0x393a98){if(_0x393a98){return _0x54be9f[_0xf929('0x12')](_0x1db7fa);}return _0x54be9f['status'](_0x1db7fa)['end']();};}function respondWithResult(_0x3566bd,_0x1c3f63){_0x1c3f63=_0x1c3f63||0xc8;return function(_0x553f7a){if(_0x553f7a){return _0x3566bd['status'](_0x1c3f63)['json'](_0x553f7a);}};}function respondWithFilteredResult(_0x4fc618,_0x2f64c0){return function(_0x4067a3){if(_0x4067a3){var _0x1bd787=typeof _0x2f64c0[_0xf929('0x13')]===_0xf929('0x14')&&typeof _0x2f64c0['limit']===_0xf929('0x14');var _0x2eda90=_0x4067a3[_0xf929('0x15')];var _0x4d8f4e=_0x1bd787?0x0:_0x2f64c0[_0xf929('0x13')];var _0x4c098e=_0x1bd787?_0x4067a3[_0xf929('0x15')]:_0x2f64c0[_0xf929('0x13')]+_0x2f64c0[_0xf929('0x16')];var _0x5035bd;if(_0x4c098e>=_0x2eda90){_0x4c098e=_0x2eda90;_0x5035bd=0xc8;}else{_0x5035bd=0xce;}_0x4fc618['status'](_0x5035bd);return _0x4fc618[_0xf929('0x17')](_0xf929('0x18'),_0x4d8f4e+'-'+_0x4c098e+'/'+_0x2eda90)[_0xf929('0x19')](_0x4067a3);}return null;};}function patchUpdates(_0x7c2b05){return function(_0x13946c){try{jsonpatch[_0xf929('0x1a')](_0x13946c,_0x7c2b05,!![]);}catch(_0x45981f){return BPromise['reject'](_0x45981f);}return _0x13946c[_0xf929('0x1b')]();};}function saveUpdates(_0x3600d1,_0x1ec8ad){return function(_0x8a916c){if(_0x8a916c){return _0x8a916c['update'](_0x3600d1)[_0xf929('0x1c')](function(_0x1c8b16){return _0x1c8b16;});}return null;};}function removeEntity(_0x41214a,_0x33c6c0){return function(_0x437b5e){if(_0x437b5e){return _0x437b5e[_0xf929('0x1d')]()[_0xf929('0x1c')](function(){_0x41214a[_0xf929('0x1e')](0xcc)[_0xf929('0x1f')]();});}};}function handleEntityNotFound(_0x522b0a,_0x31affd){return function(_0x454697){if(!_0x454697){_0x522b0a[_0xf929('0x12')](0x194);}return _0x454697;};}function handleError(_0x46ac2a,_0x335de4){_0x335de4=_0x335de4||0x1f4;return function(_0x7af885){logger[_0xf929('0x20')](_0x7af885[_0xf929('0x21')]);if(_0x7af885[_0xf929('0x22')]){delete _0x7af885[_0xf929('0x22')];}_0x46ac2a[_0xf929('0x1e')](_0x335de4)[_0xf929('0x23')](_0x7af885);};}exports['index']=function(_0x39fc06,_0x5530da){var _0x34c455={},_0x3e57c5={},_0x1220a8={'count':0x0,'rows':[]};var _0x56730e=_[_0xf929('0x24')](db[_0xf929('0x25')][_0xf929('0x26')],function(_0x3173ce){return{'name':_0x3173ce[_0xf929('0x27')],'type':_0x3173ce[_0xf929('0x28')][_0xf929('0x29')]};});_0x3e57c5[_0xf929('0x2a')]=_[_0xf929('0x24')](_0x56730e,'name');_0x3e57c5['query']=_[_0xf929('0x2b')](_0x39fc06[_0xf929('0x2c')]);_0x3e57c5[_0xf929('0x2d')]=_[_0xf929('0x2e')](_0x3e57c5[_0xf929('0x2a')],_0x3e57c5[_0xf929('0x2c')]);_0x34c455[_0xf929('0x2f')]=_[_0xf929('0x2e')](_0x3e57c5[_0xf929('0x2a')],qs[_0xf929('0x30')](_0x39fc06['query']['fields']));_0x34c455[_0xf929('0x2f')]=_0x34c455[_0xf929('0x2f')][_0xf929('0x31')]?_0x34c455['attributes']:_0x3e57c5[_0xf929('0x2a')];if(!_0x39fc06[_0xf929('0x2c')][_0xf929('0x32')](_0xf929('0x33'))){_0x34c455['limit']=qs['limit'](_0x39fc06['query']['limit']);_0x34c455[_0xf929('0x13')]=qs[_0xf929('0x13')](_0x39fc06[_0xf929('0x2c')][_0xf929('0x13')]);}_0x34c455[_0xf929('0x34')]=qs[_0xf929('0x35')](_0x39fc06['query'][_0xf929('0x35')]);_0x34c455[_0xf929('0x36')]=qs['filters'](_[_0xf929('0x37')](_0x39fc06[_0xf929('0x2c')],_0x3e57c5[_0xf929('0x2d')]),_0x56730e);if(_0x39fc06['query']['filter']){_0x34c455[_0xf929('0x36')]=_[_0xf929('0x38')](_0x34c455[_0xf929('0x36')],{'$or':_['map'](_0x56730e,function(_0xc5681c){if(_0xc5681c[_0xf929('0x28')]!=='VIRTUAL'){var _0x48574a={};_0x48574a[_0xc5681c[_0xf929('0x22')]]={'$like':'%'+_0x39fc06[_0xf929('0x2c')]['filter']+'%'};return _0x48574a;}})});}_0x34c455=_[_0xf929('0x38')]({},_0x34c455,_0x39fc06[_0xf929('0x39')]);var _0xeb4972={'where':_0x34c455[_0xf929('0x36')]};return db[_0xf929('0x25')][_0xf929('0x15')](_0xeb4972)[_0xf929('0x1c')](function(_0x17ccf6){_0x1220a8['count']=_0x17ccf6;if(_0x39fc06[_0xf929('0x2c')]['includeAll']){_0x34c455[_0xf929('0x3a')]=[{'all':!![]}];}return db[_0xf929('0x25')][_0xf929('0x3b')](_0x34c455);})[_0xf929('0x1c')](function(_0x40be08){_0x1220a8[_0xf929('0x3c')]=_0x40be08;return _0x1220a8;})[_0xf929('0x1c')](respondWithFilteredResult(_0x5530da,_0x34c455))[_0xf929('0x3d')](handleError(_0x5530da,null));};exports['show']=function(_0x1596f8,_0x8de1d0){var _0x3c8039={'raw':!![],'where':{'id':_0x1596f8['params']['id']}},_0x585e4d={};_0x585e4d[_0xf929('0x2a')]=_[_0xf929('0x2b')](db['MailSubstatus']['rawAttributes']);_0x585e4d[_0xf929('0x2c')]=_[_0xf929('0x2b')](_0x1596f8[_0xf929('0x2c')]);_0x585e4d[_0xf929('0x2d')]=_[_0xf929('0x2e')](_0x585e4d[_0xf929('0x2a')],_0x585e4d[_0xf929('0x2c')]);_0x3c8039['attributes']=_['intersection'](_0x585e4d[_0xf929('0x2a')],qs[_0xf929('0x30')](_0x1596f8['query'][_0xf929('0x30')]));_0x3c8039[_0xf929('0x2f')]=_0x3c8039[_0xf929('0x2f')][_0xf929('0x31')]?_0x3c8039['attributes']:_0x585e4d[_0xf929('0x2a')];if(_0x1596f8['query'][_0xf929('0x3e')]){_0x3c8039[_0xf929('0x3a')]=[{'all':!![]}];}_0x3c8039=_[_0xf929('0x38')]({},_0x3c8039,_0x1596f8['options']);return db[_0xf929('0x25')][_0xf929('0x3f')](_0x3c8039)[_0xf929('0x1c')](handleEntityNotFound(_0x8de1d0,null))[_0xf929('0x1c')](respondWithResult(_0x8de1d0,null))[_0xf929('0x3d')](handleError(_0x8de1d0,null));};exports[_0xf929('0x40')]=function(_0x3443c0,_0x20ef7a){return db[_0xf929('0x25')]['create'](_0x3443c0[_0xf929('0x41')],{})[_0xf929('0x1c')](respondWithResult(_0x20ef7a,0xc9))[_0xf929('0x3d')](handleError(_0x20ef7a,null));};exports[_0xf929('0x42')]=function(_0x3c1075,_0xfda7f6){if(_0x3c1075[_0xf929('0x41')]['id']){delete _0x3c1075['body']['id'];}return db[_0xf929('0x25')][_0xf929('0x3f')]({'where':{'id':_0x3c1075['params']['id']}})['then'](handleEntityNotFound(_0xfda7f6,null))[_0xf929('0x1c')](saveUpdates(_0x3c1075['body'],null))['then'](respondWithResult(_0xfda7f6,null))[_0xf929('0x3d')](handleError(_0xfda7f6,null));};exports[_0xf929('0x1d')]=function(_0x52aef0,_0x54c390){return db['MailSubstatus'][_0xf929('0x3f')]({'where':{'id':_0x52aef0[_0xf929('0x43')]['id']}})['then'](handleEntityNotFound(_0x54c390,null))['then'](removeEntity(_0x54c390,null))[_0xf929('0x3d')](handleError(_0x54c390,null));};exports['describe']=function(_0x3e4d9d,_0x2254c3){return db['MailSubstatus'][_0xf929('0x44')]()[_0xf929('0x1c')](respondWithResult(_0x2254c3,null))[_0xf929('0x3d')](handleError(_0x2254c3,null));}; \ No newline at end of file +var _0x3d91=['destroy','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','save','update','then'];(function(_0x3dea7d,_0x2cd4ea){var _0x53919a=function(_0x1554e2){while(--_0x1554e2){_0x3dea7d['push'](_0x3dea7d['shift']());}};_0x53919a(++_0x2cd4ea);}(_0x3d91,0x6f));var _0x13d9=function(_0x20f08b,_0x646ea0){_0x20f08b=_0x20f08b-0x0;var _0x675062=_0x3d91[_0x20f08b];return _0x675062;};'use strict';var emlformat=require(_0x13d9('0x0'));var rimraf=require(_0x13d9('0x1'));var zipdir=require(_0x13d9('0x2'));var jsonpatch=require(_0x13d9('0x3'));var rp=require(_0x13d9('0x4'));var moment=require(_0x13d9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x13d9('0x6'));var util=require('util');var path=require(_0x13d9('0x7'));var sox=require(_0x13d9('0x8'));var csv=require(_0x13d9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x13d9('0xa'));var _=require('lodash');var squel=require(_0x13d9('0xb'));var crypto=require(_0x13d9('0xc'));var jsforce=require(_0x13d9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x13d9('0xe'));var Papa=require(_0x13d9('0xf'));var Redis=require('ioredis');var authService=require(_0x13d9('0x10'));var qs=require(_0x13d9('0x11'));var as=require(_0x13d9('0x12'));var hardwareService=require(_0x13d9('0x13'));var logger=require('../../config/logger')(_0x13d9('0x14'));var utils=require(_0x13d9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x13d9('0x16'))['db'];function respondWithStatusCode(_0x7a0ec,_0x514c2c){_0x514c2c=_0x514c2c||0xcc;return function(_0x51fd20){if(_0x51fd20){return _0x7a0ec[_0x13d9('0x17')](_0x514c2c);}return _0x7a0ec[_0x13d9('0x18')](_0x514c2c)[_0x13d9('0x19')]();};}function respondWithResult(_0x5e89c0,_0x41d3cf){_0x41d3cf=_0x41d3cf||0xc8;return function(_0x8ec2e0){if(_0x8ec2e0){return _0x5e89c0[_0x13d9('0x18')](_0x41d3cf)[_0x13d9('0x1a')](_0x8ec2e0);}};}function respondWithFilteredResult(_0x492a9b,_0x591cfb){return function(_0x26fee4){if(_0x26fee4){var _0x20fa73=typeof _0x591cfb[_0x13d9('0x1b')]===_0x13d9('0x1c')&&typeof _0x591cfb['limit']==='undefined';var _0x18228c=_0x26fee4[_0x13d9('0x1d')];var _0x51911e=_0x20fa73?0x0:_0x591cfb[_0x13d9('0x1b')];var _0x295904=_0x20fa73?_0x26fee4[_0x13d9('0x1d')]:_0x591cfb[_0x13d9('0x1b')]+_0x591cfb[_0x13d9('0x1e')];var _0x54a59e;if(_0x295904>=_0x18228c){_0x295904=_0x18228c;_0x54a59e=0xc8;}else{_0x54a59e=0xce;}_0x492a9b[_0x13d9('0x18')](_0x54a59e);return _0x492a9b[_0x13d9('0x1f')]('Content-Range',_0x51911e+'-'+_0x295904+'/'+_0x18228c)['json'](_0x26fee4);}return null;};}function patchUpdates(_0x39f07e){return function(_0x37ac09){try{jsonpatch['apply'](_0x37ac09,_0x39f07e,!![]);}catch(_0x363b99){return BPromise['reject'](_0x363b99);}return _0x37ac09[_0x13d9('0x20')]();};}function saveUpdates(_0x20cbbd,_0xecca5a){return function(_0x2ccad9){if(_0x2ccad9){return _0x2ccad9[_0x13d9('0x21')](_0x20cbbd)[_0x13d9('0x22')](function(_0x2a0076){return _0x2a0076;});}return null;};}function removeEntity(_0x481329,_0x2321ec){return function(_0xd9f0f7){if(_0xd9f0f7){return _0xd9f0f7[_0x13d9('0x23')]()[_0x13d9('0x22')](function(){_0x481329[_0x13d9('0x18')](0xcc)[_0x13d9('0x19')]();});}};}function handleEntityNotFound(_0x47f917,_0x59ba13){return function(_0x48b633){if(!_0x48b633){_0x47f917['sendStatus'](0x194);}return _0x48b633;};}function handleError(_0x4214ab,_0x190184){_0x190184=_0x190184||0x1f4;return function(_0x251186){logger['error'](_0x251186[_0x13d9('0x24')]);if(_0x251186['name']){delete _0x251186[_0x13d9('0x25')];}_0x4214ab[_0x13d9('0x18')](_0x190184)[_0x13d9('0x26')](_0x251186);};}exports[_0x13d9('0x27')]=function(_0x57722a,_0x4adf3b){var _0x969a09={},_0x59475a={},_0x56619e={'count':0x0,'rows':[]};var _0x391087=_[_0x13d9('0x28')](db[_0x13d9('0x29')][_0x13d9('0x2a')],function(_0x3ffc47){return{'name':_0x3ffc47[_0x13d9('0x2b')],'type':_0x3ffc47[_0x13d9('0x2c')]['key']};});_0x59475a[_0x13d9('0x2d')]=_[_0x13d9('0x28')](_0x391087,_0x13d9('0x25'));_0x59475a[_0x13d9('0x2e')]=_['keys'](_0x57722a[_0x13d9('0x2e')]);_0x59475a['filters']=_[_0x13d9('0x2f')](_0x59475a[_0x13d9('0x2d')],_0x59475a[_0x13d9('0x2e')]);_0x969a09[_0x13d9('0x30')]=_[_0x13d9('0x2f')](_0x59475a[_0x13d9('0x2d')],qs[_0x13d9('0x31')](_0x57722a['query'][_0x13d9('0x31')]));_0x969a09[_0x13d9('0x30')]=_0x969a09[_0x13d9('0x30')][_0x13d9('0x32')]?_0x969a09['attributes']:_0x59475a['model'];if(!_0x57722a[_0x13d9('0x2e')][_0x13d9('0x33')](_0x13d9('0x34'))){_0x969a09['limit']=qs[_0x13d9('0x1e')](_0x57722a[_0x13d9('0x2e')][_0x13d9('0x1e')]);_0x969a09['offset']=qs['offset'](_0x57722a['query'][_0x13d9('0x1b')]);}_0x969a09[_0x13d9('0x35')]=qs['sort'](_0x57722a[_0x13d9('0x2e')][_0x13d9('0x36')]);_0x969a09['where']=qs[_0x13d9('0x37')](_[_0x13d9('0x38')](_0x57722a[_0x13d9('0x2e')],_0x59475a[_0x13d9('0x37')]),_0x391087);if(_0x57722a[_0x13d9('0x2e')][_0x13d9('0x39')]){_0x969a09[_0x13d9('0x3a')]=_['merge'](_0x969a09[_0x13d9('0x3a')],{'$or':_[_0x13d9('0x28')](_0x391087,function(_0x35fc60){if(_0x35fc60['type']!==_0x13d9('0x3b')){var _0x3ce31d={};_0x3ce31d[_0x35fc60[_0x13d9('0x25')]]={'$like':'%'+_0x57722a[_0x13d9('0x2e')][_0x13d9('0x39')]+'%'};return _0x3ce31d;}})});}_0x969a09=_[_0x13d9('0x3c')]({},_0x969a09,_0x57722a[_0x13d9('0x3d')]);var _0x491631={'where':_0x969a09[_0x13d9('0x3a')]};return db[_0x13d9('0x29')]['count'](_0x491631)['then'](function(_0x3cca98){_0x56619e[_0x13d9('0x1d')]=_0x3cca98;if(_0x57722a[_0x13d9('0x2e')]['includeAll']){_0x969a09[_0x13d9('0x3e')]=[{'all':!![]}];}return db[_0x13d9('0x29')][_0x13d9('0x3f')](_0x969a09);})[_0x13d9('0x22')](function(_0x2fd098){_0x56619e[_0x13d9('0x40')]=_0x2fd098;return _0x56619e;})[_0x13d9('0x22')](respondWithFilteredResult(_0x4adf3b,_0x969a09))[_0x13d9('0x41')](handleError(_0x4adf3b,null));};exports['show']=function(_0x4d2642,_0x17a4c2){var _0x2a1a8d={'raw':!![],'where':{'id':_0x4d2642[_0x13d9('0x42')]['id']}},_0x133d50={};_0x133d50[_0x13d9('0x2d')]=_[_0x13d9('0x43')](db['MailSubstatus'][_0x13d9('0x2a')]);_0x133d50['query']=_[_0x13d9('0x43')](_0x4d2642['query']);_0x133d50['filters']=_['intersection'](_0x133d50[_0x13d9('0x2d')],_0x133d50['query']);_0x2a1a8d[_0x13d9('0x30')]=_[_0x13d9('0x2f')](_0x133d50[_0x13d9('0x2d')],qs[_0x13d9('0x31')](_0x4d2642[_0x13d9('0x2e')]['fields']));_0x2a1a8d[_0x13d9('0x30')]=_0x2a1a8d[_0x13d9('0x30')][_0x13d9('0x32')]?_0x2a1a8d[_0x13d9('0x30')]:_0x133d50[_0x13d9('0x2d')];if(_0x4d2642['query'][_0x13d9('0x44')]){_0x2a1a8d['include']=[{'all':!![]}];}_0x2a1a8d=_[_0x13d9('0x3c')]({},_0x2a1a8d,_0x4d2642[_0x13d9('0x3d')]);return db[_0x13d9('0x29')][_0x13d9('0x45')](_0x2a1a8d)[_0x13d9('0x22')](handleEntityNotFound(_0x17a4c2,null))[_0x13d9('0x22')](respondWithResult(_0x17a4c2,null))['catch'](handleError(_0x17a4c2,null));};exports[_0x13d9('0x46')]=function(_0x506156,_0x35ca09){return db[_0x13d9('0x29')][_0x13d9('0x46')](_0x506156[_0x13d9('0x47')],{})['then'](respondWithResult(_0x35ca09,0xc9))[_0x13d9('0x41')](handleError(_0x35ca09,null));};exports[_0x13d9('0x21')]=function(_0x22dead,_0x161c14){if(_0x22dead[_0x13d9('0x47')]['id']){delete _0x22dead[_0x13d9('0x47')]['id'];}return db[_0x13d9('0x29')]['find']({'where':{'id':_0x22dead['params']['id']}})[_0x13d9('0x22')](handleEntityNotFound(_0x161c14,null))[_0x13d9('0x22')](saveUpdates(_0x22dead['body'],null))[_0x13d9('0x22')](respondWithResult(_0x161c14,null))[_0x13d9('0x41')](handleError(_0x161c14,null));};exports['destroy']=function(_0x12e7e7,_0x3b79bb){return db[_0x13d9('0x29')][_0x13d9('0x45')]({'where':{'id':_0x12e7e7[_0x13d9('0x42')]['id']}})['then'](handleEntityNotFound(_0x3b79bb,null))[_0x13d9('0x22')](removeEntity(_0x3b79bb,null))[_0x13d9('0x41')](handleError(_0x3b79bb,null));};exports[_0x13d9('0x48')]=function(_0x13a071,_0x913d9c){return db[_0x13d9('0x29')]['describe']()[_0x13d9('0x22')](respondWithResult(_0x913d9c,null))['catch'](handleError(_0x913d9c,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 399e396..5f578b8 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2330=['update','emit','hasOwnProperty','hook','exports','events','MailSubstatus','setMaxListeners'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0x2330,0x175));var _0x0233=function(_0x32a516,_0x44695b){_0x32a516=_0x32a516-0x0;var _0x3625f6=_0x2330[_0x32a516];return _0x3625f6;};'use strict';var EventEmitter=require(_0x0233('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x0233('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x0233('0x2')](0x0);var events={'afterUpdate':_0x0233('0x3')};function emitEvent(_0x52e2b8){return function(_0x53fa14,_0x143548,_0x3a9d2f){MailSubstatusEvents[_0x0233('0x4')](_0x52e2b8+':'+_0x53fa14['id'],_0x53fa14);MailSubstatusEvents[_0x0233('0x4')](_0x52e2b8,_0x53fa14);_0x3a9d2f(null);};}for(var e in events){if(events[_0x0233('0x5')](e)){var event=events[e];MailSubstatus[_0x0233('0x6')](e,emitEvent(event));}}module[_0x0233('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x0a9f=['setMaxListeners','update','emit','hook','events','../../mysqldb','MailSubstatus'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0a9f,0x17e));var _0xf0a9=function(_0x5622b2,_0x5dc268){_0x5622b2=_0x5622b2-0x0;var _0x2c441b=_0x0a9f[_0x5622b2];return _0x2c441b;};'use strict';var EventEmitter=require(_0xf0a9('0x0'));var MailSubstatus=require(_0xf0a9('0x1'))['db'][_0xf0a9('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xf0a9('0x3')](0x0);var events={'afterUpdate':_0xf0a9('0x4')};function emitEvent(_0x4ae716){return function(_0x123981,_0x425f54,_0x403482){MailSubstatusEvents[_0xf0a9('0x5')](_0x4ae716+':'+_0x123981['id'],_0x123981);MailSubstatusEvents[_0xf0a9('0x5')](_0x4ae716,_0x123981);_0x403482(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xf0a9('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index fb8ea6f..ee1dacc 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 _0x86f1=['Condition','name','mailSubstatus','_previousDataValues','then','exports','models','define','MailSubstatus'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x86f1,0xf8));var _0x186f=function(_0x170d9c,_0x4c3a6c){_0x170d9c=_0x170d9c-0x0;var _0x1a985b=_0x86f1[_0x170d9c];return _0x1a985b;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x186f('0x0')]=function(_0x3e2d16){var _0x223542=_0x3e2d16[_0x186f('0x1')];return _0x3e2d16[_0x186f('0x2')](_0x186f('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x54a40c,_0x52fd7e,_0x3da5ae){return _0x223542[_0x186f('0x4')]['update']({'value':_0x54a40c[_0x186f('0x5')]},{'where':{'field':_0x186f('0x6'),'value':_0x54a40c[_0x186f('0x7')][_0x186f('0x5')]}})[_0x186f('0x8')](function(){_0x3da5ae();})['catch'](function(_0x1bffd2){_0x3da5ae(_0x1bffd2);});}}});}; \ No newline at end of file +var _0x3ea3=['./mailSubstatus.attributes','exports','models','define','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x3ea3,0xb0));var _0x33ea=function(_0x2f55e7,_0x582fd6){_0x2f55e7=_0x2f55e7-0x0;var _0x53f494=_0x3ea3[_0x2f55e7];return _0x53f494;};'use strict';var attributes=require(_0x33ea('0x0'));module[_0x33ea('0x1')]=function(_0x449fe2){var _0x5c8fdf=_0x449fe2[_0x33ea('0x2')];return _0x449fe2[_0x33ea('0x3')]('MailSubstatus',attributes,{'tableName':_0x33ea('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x541324,_0x2f2a2f,_0x4316c2){return _0x5c8fdf[_0x33ea('0x5')][_0x33ea('0x6')]({'value':_0x541324[_0x33ea('0x7')]},{'where':{'field':_0x33ea('0x8'),'value':_0x541324[_0x33ea('0x9')][_0x33ea('0x7')]}})[_0x33ea('0xa')](function(){_0x4316c2();})['catch'](function(_0x479dde){_0x4316c2(_0x479dde);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 189fe2b..786fe08 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 _0xc232=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','lodash','moment'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0xc232,0x1ca));var _0x2c23=function(_0x1e63fa,_0x1acec2){_0x1e63fa=_0x1e63fa-0x0;var _0x44ece3=_0xc232[_0x1e63fa];return _0x44ece3;};'use strict';var _=require(_0x2c23('0x0'));var util=require('util');var moment=require(_0x2c23('0x1'));var BPromise=require(_0x2c23('0x2'));var rs=require(_0x2c23('0x3'));var fs=require('fs');var Redis=require(_0x2c23('0x4'));var db=require(_0x2c23('0x5'))['db'];var utils=require(_0x2c23('0x6'));var logger=require(_0x2c23('0x7'))(_0x2c23('0x8'));var config=require('../../config/environment');var jayson=require(_0x2c23('0x9'));var client=jayson[_0x2c23('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24ee8f,_0x1411d3,_0x46c670){return new BPromise(function(_0x3cf36f,_0x212811){return client['request'](_0x24ee8f,_0x46c670)[_0x2c23('0xb')](function(_0x1eea62){logger['info'](_0x2c23('0xc'),_0x1411d3,_0x2c23('0xd'));logger[_0x2c23('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x1411d3,_0x2c23('0xd'),JSON['stringify'](_0x1eea62));if(_0x1eea62[_0x2c23('0xf')]){if(_0x1eea62[_0x2c23('0xf')]['code']===0x1f4){logger[_0x2c23('0xf')](_0x2c23('0xc'),_0x1411d3,_0x1eea62[_0x2c23('0xf')][_0x2c23('0x10')]);return _0x212811(_0x1eea62[_0x2c23('0xf')][_0x2c23('0x10')]);}logger[_0x2c23('0xf')](_0x2c23('0xc'),_0x1411d3,_0x1eea62[_0x2c23('0xf')][_0x2c23('0x10')]);return _0x3cf36f(_0x1eea62[_0x2c23('0xf')]['message']);}else{logger[_0x2c23('0x11')](_0x2c23('0xc'),_0x1411d3,_0x2c23('0xd'));_0x3cf36f(_0x1eea62[_0x2c23('0x12')][_0x2c23('0x10')]);}})[_0x2c23('0x13')](function(_0x1c6582){logger['error'](_0x2c23('0xc'),_0x1411d3,_0x1c6582);_0x212811(_0x1c6582);});});} \ No newline at end of file +var _0xa7dc=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x197123,_0x52021d){var _0x2dd1d8=function(_0x1a9b6e){while(--_0x1a9b6e){_0x197123['push'](_0x197123['shift']());}};_0x2dd1d8(++_0x52021d);}(_0xa7dc,0x1ba));var _0xca7d=function(_0x1f0d41,_0x4f76a3){_0x1f0d41=_0x1f0d41-0x0;var _0xd08f0b=_0xa7dc[_0x1f0d41];return _0xd08f0b;};'use strict';var _=require('lodash');var util=require(_0xca7d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xca7d('0x1'));var fs=require('fs');var Redis=require(_0xca7d('0x2'));var db=require(_0xca7d('0x3'))['db'];var utils=require(_0xca7d('0x4'));var logger=require(_0xca7d('0x5'))(_0xca7d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xca7d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5bc6b9,_0x2516a4,_0xf09cfc){return new BPromise(function(_0xc5cbf7,_0x4803ed){return client[_0xca7d('0x8')](_0x5bc6b9,_0xf09cfc)['then'](function(_0x3e5d51){logger[_0xca7d('0x9')](_0xca7d('0xa'),_0x2516a4,'request\x20sent');logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x2516a4,_0xca7d('0xb'),JSON[_0xca7d('0xc')](_0x3e5d51));if(_0x3e5d51['error']){if(_0x3e5d51[_0xca7d('0xd')][_0xca7d('0xe')]===0x1f4){logger[_0xca7d('0xd')](_0xca7d('0xa'),_0x2516a4,_0x3e5d51[_0xca7d('0xd')][_0xca7d('0xf')]);return _0x4803ed(_0x3e5d51['error'][_0xca7d('0xf')]);}logger['error'](_0xca7d('0xa'),_0x2516a4,_0x3e5d51['error'][_0xca7d('0xf')]);return _0xc5cbf7(_0x3e5d51['error'][_0xca7d('0xf')]);}else{logger[_0xca7d('0x9')](_0xca7d('0xa'),_0x2516a4,_0xca7d('0xb'));_0xc5cbf7(_0x3e5d51['result']['message']);}})[_0xca7d('0x10')](function(_0x95cfea){logger[_0xca7d('0xd')](_0xca7d('0xa'),_0x2516a4,_0x95cfea);_0x4803ed(_0x95cfea);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 3f9db6d..0aa8fae 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 _0x0850=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','describe','post','create','put','/:id','update'];(function(_0x2f5a22,_0x5e9f03){var _0x326b70=function(_0x1b7bf9){while(--_0x1b7bf9){_0x2f5a22['push'](_0x2f5a22['shift']());}};_0x326b70(++_0x5e9f03);}(_0x0850,0x193));var _0x0085=function(_0x5be327,_0x447811){_0x5be327=_0x5be327-0x0;var _0x53d1d4=_0x0850[_0x5be327];return _0x53d1d4;};'use strict';var multer=require(_0x0085('0x0'));var util=require(_0x0085('0x1'));var path=require(_0x0085('0x2'));var timeout=require(_0x0085('0x3'));var express=require(_0x0085('0x4'));var router=express[_0x0085('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0085('0x6'));var interaction=require(_0x0085('0x7'));var config=require('../../config/environment');var controller=require(_0x0085('0x8'));router[_0x0085('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0085('0x9')]('/describe',auth[_0x0085('0xa')](),controller[_0x0085('0xb')]);router[_0x0085('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0085('0xc')]('/',auth[_0x0085('0xa')](),controller[_0x0085('0xd')]);router[_0x0085('0xe')](_0x0085('0xf'),auth['isAuthenticated'](),controller[_0x0085('0x10')]);router[_0x0085('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x0085('0x12')]);module[_0x0085('0x13')]=router; \ No newline at end of file +var _0xa626=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','destroy','multer','util','path'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xa626,0x1cb));var _0x6a62=function(_0x14879f,_0x45e022){_0x14879f=_0x14879f-0x0;var _0x4c349b=_0xa626[_0x14879f];return _0x4c349b;};'use strict';var multer=require(_0x6a62('0x0'));var util=require(_0x6a62('0x1'));var path=require(_0x6a62('0x2'));var timeout=require(_0x6a62('0x3'));var express=require(_0x6a62('0x4'));var router=express['Router']();var fs_extra=require(_0x6a62('0x5'));var auth=require(_0x6a62('0x6'));var interaction=require(_0x6a62('0x7'));var config=require(_0x6a62('0x8'));var controller=require(_0x6a62('0x9'));router[_0x6a62('0xa')]('/',auth[_0x6a62('0xb')](),controller[_0x6a62('0xc')]);router[_0x6a62('0xa')](_0x6a62('0xd'),auth[_0x6a62('0xb')](),controller[_0x6a62('0xe')]);router[_0x6a62('0xa')](_0x6a62('0xf'),auth[_0x6a62('0xb')](),controller[_0x6a62('0x10')]);router[_0x6a62('0x11')]('/',auth[_0x6a62('0xb')](),controller['create']);router[_0x6a62('0x12')]('/:id',auth[_0x6a62('0xb')](),controller[_0x6a62('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6a62('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 5d92df9..4a91e5a 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4c5664,_0x170d12){var _0x380651=function(_0x3b3834){while(--_0x3b3834){_0x4c5664['push'](_0x4c5664['shift']());}};_0x380651(++_0x170d12);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x51d365,_0x529b0b){var _0xbfea18=function(_0x22b12d){while(--_0x22b12d){_0x51d365['push'](_0x51d365['shift']());}};_0xbfea18(++_0x529b0b);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2731f0,_0x126b1b){_0x2731f0=_0x2731f0-0x0;var _0x36a180=_0xf3cd[_0x2731f0];return _0x36a180;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 653c54a..458af42 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 _0x4020=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','create','body','describe','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields'];(function(_0x1f914d,_0x2f24a5){var _0x5d37db=function(_0x5ce44b){while(--_0x5ce44b){_0x1f914d['push'](_0x1f914d['shift']());}};_0x5d37db(++_0x2f24a5);}(_0x4020,0x1dc));var _0x0402=function(_0x52adce,_0x5fe2fe){_0x52adce=_0x52adce-0x0;var _0x1d9490=_0x4020[_0x52adce];return _0x1d9490;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0402('0x0'));var zipdir=require(_0x0402('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0402('0x2'));var BPromise=require(_0x0402('0x3'));var Mustache=require(_0x0402('0x4'));var util=require('util');var path=require(_0x0402('0x5'));var sox=require(_0x0402('0x6'));var csv=require('to-csv');var ejs=require(_0x0402('0x7'));var fs=require('fs');var fs_extra=require(_0x0402('0x8'));var _=require(_0x0402('0x9'));var squel=require(_0x0402('0xa'));var crypto=require(_0x0402('0xb'));var jsforce=require(_0x0402('0xc'));var deskjs=require(_0x0402('0xd'));var toCsv=require(_0x0402('0xe'));var querystring=require(_0x0402('0xf'));var Papa=require(_0x0402('0x10'));var Redis=require('ioredis');var authService=require(_0x0402('0x11'));var qs=require(_0x0402('0x12'));var as=require(_0x0402('0x13'));var hardwareService=require(_0x0402('0x14'));var logger=require(_0x0402('0x15'))(_0x0402('0x16'));var utils=require(_0x0402('0x17'));var config=require(_0x0402('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0402('0x19'))['db'];function respondWithStatusCode(_0x13d91e,_0x23eea3){_0x23eea3=_0x23eea3||0xcc;return function(_0x459a43){if(_0x459a43){return _0x13d91e[_0x0402('0x1a')](_0x23eea3);}return _0x13d91e['status'](_0x23eea3)['end']();};}function respondWithResult(_0x339ad4,_0x5648b6){_0x5648b6=_0x5648b6||0xc8;return function(_0x1dc64b){if(_0x1dc64b){return _0x339ad4[_0x0402('0x1b')](_0x5648b6)[_0x0402('0x1c')](_0x1dc64b);}};}function respondWithFilteredResult(_0x33f43b,_0x15075e){return function(_0x352ff5){if(_0x352ff5){var _0x83cbab=typeof _0x15075e[_0x0402('0x1d')]===_0x0402('0x1e')&&typeof _0x15075e[_0x0402('0x1f')]===_0x0402('0x1e');var _0x41498c=_0x352ff5[_0x0402('0x20')];var _0x18ef1e=_0x83cbab?0x0:_0x15075e['offset'];var _0x2ec566=_0x83cbab?_0x352ff5[_0x0402('0x20')]:_0x15075e[_0x0402('0x1d')]+_0x15075e[_0x0402('0x1f')];var _0x2cae65;if(_0x2ec566>=_0x41498c){_0x2ec566=_0x41498c;_0x2cae65=0xc8;}else{_0x2cae65=0xce;}_0x33f43b[_0x0402('0x1b')](_0x2cae65);return _0x33f43b[_0x0402('0x21')](_0x0402('0x22'),_0x18ef1e+'-'+_0x2ec566+'/'+_0x41498c)['json'](_0x352ff5);}return null;};}function patchUpdates(_0x4beb5b){return function(_0x8b2642){try{jsonpatch[_0x0402('0x23')](_0x8b2642,_0x4beb5b,!![]);}catch(_0x5d87dd){return BPromise['reject'](_0x5d87dd);}return _0x8b2642[_0x0402('0x24')]();};}function saveUpdates(_0x535c51,_0xd32d40){return function(_0x15e451){if(_0x15e451){return _0x15e451[_0x0402('0x25')](_0x535c51)[_0x0402('0x26')](function(_0x2a9fd5){return _0x2a9fd5;});}return null;};}function removeEntity(_0x3f4edb,_0xe209ab){return function(_0x25cc7e){if(_0x25cc7e){return _0x25cc7e[_0x0402('0x27')]()[_0x0402('0x26')](function(){_0x3f4edb[_0x0402('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a34b0,_0x2e7014){return function(_0x1bc5b6){if(!_0x1bc5b6){_0x4a34b0[_0x0402('0x1a')](0x194);}return _0x1bc5b6;};}function handleError(_0x48f27a,_0x5321e7){_0x5321e7=_0x5321e7||0x1f4;return function(_0x375ae1){logger['error'](_0x375ae1[_0x0402('0x28')]);if(_0x375ae1[_0x0402('0x29')]){delete _0x375ae1[_0x0402('0x29')];}_0x48f27a[_0x0402('0x1b')](_0x5321e7)[_0x0402('0x2a')](_0x375ae1);};}exports['index']=function(_0x157161,_0x325c73){var _0x598579={},_0x1cd78d={},_0x555c43={'count':0x0,'rows':[]};var _0x2a3f78=_[_0x0402('0x2b')](db[_0x0402('0x2c')][_0x0402('0x2d')],function(_0x15909b){return{'name':_0x15909b[_0x0402('0x2e')],'type':_0x15909b[_0x0402('0x2f')][_0x0402('0x30')]};});_0x1cd78d[_0x0402('0x31')]=_[_0x0402('0x2b')](_0x2a3f78,_0x0402('0x29'));_0x1cd78d[_0x0402('0x32')]=_[_0x0402('0x33')](_0x157161[_0x0402('0x32')]);_0x1cd78d[_0x0402('0x34')]=_['intersection'](_0x1cd78d[_0x0402('0x31')],_0x1cd78d[_0x0402('0x32')]);_0x598579[_0x0402('0x35')]=_[_0x0402('0x36')](_0x1cd78d['model'],qs[_0x0402('0x37')](_0x157161[_0x0402('0x32')][_0x0402('0x37')]));_0x598579[_0x0402('0x35')]=_0x598579[_0x0402('0x35')][_0x0402('0x38')]?_0x598579['attributes']:_0x1cd78d[_0x0402('0x31')];if(!_0x157161['query'][_0x0402('0x39')](_0x0402('0x3a'))){_0x598579[_0x0402('0x1f')]=qs['limit'](_0x157161[_0x0402('0x32')]['limit']);_0x598579[_0x0402('0x1d')]=qs[_0x0402('0x1d')](_0x157161['query'][_0x0402('0x1d')]);}_0x598579[_0x0402('0x3b')]=qs[_0x0402('0x3c')](_0x157161[_0x0402('0x32')][_0x0402('0x3c')]);_0x598579[_0x0402('0x3d')]=qs[_0x0402('0x34')](_[_0x0402('0x3e')](_0x157161[_0x0402('0x32')],_0x1cd78d[_0x0402('0x34')]),_0x2a3f78);if(_0x157161['query'][_0x0402('0x3f')]){_0x598579[_0x0402('0x3d')]=_[_0x0402('0x40')](_0x598579['where'],{'$or':_[_0x0402('0x2b')](_0x2a3f78,function(_0xe31524){if(_0xe31524[_0x0402('0x2f')]!==_0x0402('0x41')){var _0xa5b5d7={};_0xa5b5d7[_0xe31524['name']]={'$like':'%'+_0x157161[_0x0402('0x32')][_0x0402('0x3f')]+'%'};return _0xa5b5d7;}})});}_0x598579=_[_0x0402('0x40')]({},_0x598579,_0x157161[_0x0402('0x42')]);var _0x504f51={'where':_0x598579[_0x0402('0x3d')]};return db['MailTransferReport'][_0x0402('0x20')](_0x504f51)[_0x0402('0x26')](function(_0x36f363){_0x555c43['count']=_0x36f363;if(_0x157161['query'][_0x0402('0x43')]){_0x598579['include']=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x598579);})[_0x0402('0x26')](function(_0x5de426){_0x555c43[_0x0402('0x44')]=_0x5de426;return _0x555c43;})[_0x0402('0x26')](respondWithFilteredResult(_0x325c73,_0x598579))[_0x0402('0x45')](handleError(_0x325c73,null));};exports['show']=function(_0xedbd12,_0x2f7ef1){var _0x3a751f={'raw':!![],'where':{'id':_0xedbd12[_0x0402('0x46')]['id']}},_0x7c0c25={};_0x7c0c25['model']=_[_0x0402('0x33')](db[_0x0402('0x2c')][_0x0402('0x2d')]);_0x7c0c25[_0x0402('0x32')]=_['keys'](_0xedbd12['query']);_0x7c0c25[_0x0402('0x34')]=_['intersection'](_0x7c0c25[_0x0402('0x31')],_0x7c0c25[_0x0402('0x32')]);_0x3a751f[_0x0402('0x35')]=_[_0x0402('0x36')](_0x7c0c25[_0x0402('0x31')],qs[_0x0402('0x37')](_0xedbd12[_0x0402('0x32')]['fields']));_0x3a751f[_0x0402('0x35')]=_0x3a751f[_0x0402('0x35')][_0x0402('0x38')]?_0x3a751f[_0x0402('0x35')]:_0x7c0c25['model'];if(_0xedbd12[_0x0402('0x32')][_0x0402('0x43')]){_0x3a751f[_0x0402('0x47')]=[{'all':!![]}];}_0x3a751f=_[_0x0402('0x40')]({},_0x3a751f,_0xedbd12[_0x0402('0x42')]);return db[_0x0402('0x2c')][_0x0402('0x48')](_0x3a751f)['then'](handleEntityNotFound(_0x2f7ef1,null))[_0x0402('0x26')](respondWithResult(_0x2f7ef1,null))['catch'](handleError(_0x2f7ef1,null));};exports[_0x0402('0x49')]=function(_0xb9d497,_0x2db12a){return db[_0x0402('0x2c')]['create'](_0xb9d497[_0x0402('0x4a')],{})[_0x0402('0x26')](respondWithResult(_0x2db12a,0xc9))['catch'](handleError(_0x2db12a,null));};exports[_0x0402('0x25')]=function(_0x47a7f3,_0x50c98a){if(_0x47a7f3['body']['id']){delete _0x47a7f3['body']['id'];}return db[_0x0402('0x2c')]['find']({'where':{'id':_0x47a7f3[_0x0402('0x46')]['id']}})[_0x0402('0x26')](handleEntityNotFound(_0x50c98a,null))[_0x0402('0x26')](saveUpdates(_0x47a7f3[_0x0402('0x4a')],null))['then'](respondWithResult(_0x50c98a,null))['catch'](handleError(_0x50c98a,null));};exports[_0x0402('0x27')]=function(_0x4bf6f4,_0x303f9a){return db['MailTransferReport'][_0x0402('0x48')]({'where':{'id':_0x4bf6f4[_0x0402('0x46')]['id']}})[_0x0402('0x26')](handleEntityNotFound(_0x303f9a,null))[_0x0402('0x26')](removeEntity(_0x303f9a,null))[_0x0402('0x45')](handleError(_0x303f9a,null));};exports[_0x0402('0x4b')]=function(_0x280056,_0x9626e8){return db['MailTransferReport'][_0x0402('0x4b')]()['then'](respondWithResult(_0x9626e8,null))[_0x0402('0x45')](handleError(_0x9626e8,null));}; \ No newline at end of file +var _0x25a8=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','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','update','then','destroy','name','send','index','MailTransferReport','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x25a8,0x168));var _0x825a=function(_0x30f05c,_0x4b254c){_0x30f05c=_0x30f05c-0x0;var _0x127943=_0x25a8[_0x30f05c];return _0x127943;};'use strict';var emlformat=require(_0x825a('0x0'));var rimraf=require(_0x825a('0x1'));var zipdir=require(_0x825a('0x2'));var jsonpatch=require(_0x825a('0x3'));var rp=require(_0x825a('0x4'));var moment=require(_0x825a('0x5'));var BPromise=require(_0x825a('0x6'));var Mustache=require('mustache');var util=require(_0x825a('0x7'));var path=require('path');var sox=require(_0x825a('0x8'));var csv=require(_0x825a('0x9'));var ejs=require(_0x825a('0xa'));var fs=require('fs');var fs_extra=require(_0x825a('0xb'));var _=require(_0x825a('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x825a('0xd'));var deskjs=require(_0x825a('0xe'));var toCsv=require(_0x825a('0x9'));var querystring=require('querystring');var Papa=require(_0x825a('0xf'));var Redis=require('ioredis');var authService=require(_0x825a('0x10'));var qs=require(_0x825a('0x11'));var as=require(_0x825a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x825a('0x13'))('api');var utils=require(_0x825a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x825a('0x15'));var db=require(_0x825a('0x16'))['db'];function respondWithStatusCode(_0x55b9a9,_0x54983e){_0x54983e=_0x54983e||0xcc;return function(_0x229320){if(_0x229320){return _0x55b9a9[_0x825a('0x17')](_0x54983e);}return _0x55b9a9[_0x825a('0x18')](_0x54983e)[_0x825a('0x19')]();};}function respondWithResult(_0x395c52,_0x21d5f1){_0x21d5f1=_0x21d5f1||0xc8;return function(_0xbc68f0){if(_0xbc68f0){return _0x395c52[_0x825a('0x18')](_0x21d5f1)[_0x825a('0x1a')](_0xbc68f0);}};}function respondWithFilteredResult(_0x2042ce,_0x4969dd){return function(_0x4a3bb8){if(_0x4a3bb8){var _0x2466c4=typeof _0x4969dd[_0x825a('0x1b')]===_0x825a('0x1c')&&typeof _0x4969dd[_0x825a('0x1d')]===_0x825a('0x1c');var _0x11720e=_0x4a3bb8['count'];var _0x27c274=_0x2466c4?0x0:_0x4969dd[_0x825a('0x1b')];var _0x22254d=_0x2466c4?_0x4a3bb8[_0x825a('0x1e')]:_0x4969dd[_0x825a('0x1b')]+_0x4969dd['limit'];var _0x170d6e;if(_0x22254d>=_0x11720e){_0x22254d=_0x11720e;_0x170d6e=0xc8;}else{_0x170d6e=0xce;}_0x2042ce[_0x825a('0x18')](_0x170d6e);return _0x2042ce[_0x825a('0x1f')](_0x825a('0x20'),_0x27c274+'-'+_0x22254d+'/'+_0x11720e)[_0x825a('0x1a')](_0x4a3bb8);}return null;};}function patchUpdates(_0x259446){return function(_0x41d3a9){try{jsonpatch[_0x825a('0x21')](_0x41d3a9,_0x259446,!![]);}catch(_0x3178c8){return BPromise['reject'](_0x3178c8);}return _0x41d3a9['save']();};}function saveUpdates(_0x4efbfe,_0x530645){return function(_0x4b9b67){if(_0x4b9b67){return _0x4b9b67[_0x825a('0x22')](_0x4efbfe)[_0x825a('0x23')](function(_0x289a4e){return _0x289a4e;});}return null;};}function removeEntity(_0x4d48d0,_0x114bc2){return function(_0x2a5ded){if(_0x2a5ded){return _0x2a5ded[_0x825a('0x24')]()[_0x825a('0x23')](function(){_0x4d48d0[_0x825a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4712b6,_0x1b29a5){return function(_0x31b942){if(!_0x31b942){_0x4712b6[_0x825a('0x17')](0x194);}return _0x31b942;};}function handleError(_0x19e8b1,_0xeec0e3){_0xeec0e3=_0xeec0e3||0x1f4;return function(_0x40fd56){logger['error'](_0x40fd56['stack']);if(_0x40fd56[_0x825a('0x25')]){delete _0x40fd56[_0x825a('0x25')];}_0x19e8b1['status'](_0xeec0e3)[_0x825a('0x26')](_0x40fd56);};}exports[_0x825a('0x27')]=function(_0x41bc73,_0xc5d59b){var _0x408476={},_0x96a13e={},_0x1de5e1={'count':0x0,'rows':[]};var _0x95fe4f=_['map'](db[_0x825a('0x28')][_0x825a('0x29')],function(_0x371ad7){return{'name':_0x371ad7[_0x825a('0x2a')],'type':_0x371ad7['type']['key']};});_0x96a13e[_0x825a('0x2b')]=_[_0x825a('0x2c')](_0x95fe4f,_0x825a('0x25'));_0x96a13e[_0x825a('0x2d')]=_[_0x825a('0x2e')](_0x41bc73['query']);_0x96a13e['filters']=_[_0x825a('0x2f')](_0x96a13e[_0x825a('0x2b')],_0x96a13e[_0x825a('0x2d')]);_0x408476[_0x825a('0x30')]=_[_0x825a('0x2f')](_0x96a13e[_0x825a('0x2b')],qs[_0x825a('0x31')](_0x41bc73[_0x825a('0x2d')][_0x825a('0x31')]));_0x408476[_0x825a('0x30')]=_0x408476[_0x825a('0x30')]['length']?_0x408476[_0x825a('0x30')]:_0x96a13e[_0x825a('0x2b')];if(!_0x41bc73[_0x825a('0x2d')][_0x825a('0x32')]('nolimit')){_0x408476['limit']=qs[_0x825a('0x1d')](_0x41bc73[_0x825a('0x2d')][_0x825a('0x1d')]);_0x408476[_0x825a('0x1b')]=qs[_0x825a('0x1b')](_0x41bc73[_0x825a('0x2d')][_0x825a('0x1b')]);}_0x408476[_0x825a('0x33')]=qs[_0x825a('0x34')](_0x41bc73[_0x825a('0x2d')][_0x825a('0x34')]);_0x408476[_0x825a('0x35')]=qs[_0x825a('0x36')](_[_0x825a('0x37')](_0x41bc73['query'],_0x96a13e[_0x825a('0x36')]),_0x95fe4f);if(_0x41bc73[_0x825a('0x2d')][_0x825a('0x38')]){_0x408476['where']=_['merge'](_0x408476[_0x825a('0x35')],{'$or':_['map'](_0x95fe4f,function(_0x1a6f4b){if(_0x1a6f4b[_0x825a('0x39')]!==_0x825a('0x3a')){var _0x2b01c9={};_0x2b01c9[_0x1a6f4b[_0x825a('0x25')]]={'$like':'%'+_0x41bc73[_0x825a('0x2d')][_0x825a('0x38')]+'%'};return _0x2b01c9;}})});}_0x408476=_[_0x825a('0x3b')]({},_0x408476,_0x41bc73['options']);var _0x2c4ec5={'where':_0x408476[_0x825a('0x35')]};return db[_0x825a('0x28')][_0x825a('0x1e')](_0x2c4ec5)[_0x825a('0x23')](function(_0x502565){_0x1de5e1[_0x825a('0x1e')]=_0x502565;if(_0x41bc73[_0x825a('0x2d')][_0x825a('0x3c')]){_0x408476[_0x825a('0x3d')]=[{'all':!![]}];}return db['MailTransferReport'][_0x825a('0x3e')](_0x408476);})[_0x825a('0x23')](function(_0x46af71){_0x1de5e1[_0x825a('0x3f')]=_0x46af71;return _0x1de5e1;})[_0x825a('0x23')](respondWithFilteredResult(_0xc5d59b,_0x408476))[_0x825a('0x40')](handleError(_0xc5d59b,null));};exports[_0x825a('0x41')]=function(_0x586e9f,_0x28494d){var _0x551a53={'raw':!![],'where':{'id':_0x586e9f[_0x825a('0x42')]['id']}},_0x7eaa8={};_0x7eaa8[_0x825a('0x2b')]=_[_0x825a('0x2e')](db[_0x825a('0x28')][_0x825a('0x29')]);_0x7eaa8[_0x825a('0x2d')]=_[_0x825a('0x2e')](_0x586e9f['query']);_0x7eaa8['filters']=_[_0x825a('0x2f')](_0x7eaa8[_0x825a('0x2b')],_0x7eaa8[_0x825a('0x2d')]);_0x551a53[_0x825a('0x30')]=_[_0x825a('0x2f')](_0x7eaa8[_0x825a('0x2b')],qs[_0x825a('0x31')](_0x586e9f[_0x825a('0x2d')]['fields']));_0x551a53[_0x825a('0x30')]=_0x551a53[_0x825a('0x30')]['length']?_0x551a53[_0x825a('0x30')]:_0x7eaa8[_0x825a('0x2b')];if(_0x586e9f[_0x825a('0x2d')][_0x825a('0x3c')]){_0x551a53[_0x825a('0x3d')]=[{'all':!![]}];}_0x551a53=_[_0x825a('0x3b')]({},_0x551a53,_0x586e9f[_0x825a('0x43')]);return db['MailTransferReport'][_0x825a('0x44')](_0x551a53)[_0x825a('0x23')](handleEntityNotFound(_0x28494d,null))['then'](respondWithResult(_0x28494d,null))[_0x825a('0x40')](handleError(_0x28494d,null));};exports[_0x825a('0x45')]=function(_0x18dc6e,_0x28d2d4){return db[_0x825a('0x28')][_0x825a('0x45')](_0x18dc6e[_0x825a('0x46')],{})['then'](respondWithResult(_0x28d2d4,0xc9))['catch'](handleError(_0x28d2d4,null));};exports[_0x825a('0x22')]=function(_0x59f940,_0x3d4065){if(_0x59f940[_0x825a('0x46')]['id']){delete _0x59f940[_0x825a('0x46')]['id'];}return db[_0x825a('0x28')][_0x825a('0x44')]({'where':{'id':_0x59f940['params']['id']}})['then'](handleEntityNotFound(_0x3d4065,null))['then'](saveUpdates(_0x59f940['body'],null))[_0x825a('0x23')](respondWithResult(_0x3d4065,null))[_0x825a('0x40')](handleError(_0x3d4065,null));};exports[_0x825a('0x24')]=function(_0x1c023c,_0x110e08){return db['MailTransferReport'][_0x825a('0x44')]({'where':{'id':_0x1c023c[_0x825a('0x42')]['id']}})[_0x825a('0x23')](handleEntityNotFound(_0x110e08,null))[_0x825a('0x23')](removeEntity(_0x110e08,null))['catch'](handleError(_0x110e08,null));};exports[_0x825a('0x47')]=function(_0x349f25,_0x4bfab2){return db[_0x825a('0x28')][_0x825a('0x47')]()['then'](respondWithResult(_0x4bfab2,null))[_0x825a('0x40')](handleError(_0x4bfab2,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 55adbf3..e93e66f 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 _0xad36=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','util','../../config/logger'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0xad36,0x11c));var _0x6ad3=function(_0x5d5349,_0x3fa22e){_0x5d5349=_0x5d5349-0x0;var _0x3443c8=_0xad36[_0x5d5349];return _0x3443c8;};'use strict';var _=require('lodash');var util=require(_0x6ad3('0x0'));var logger=require(_0x6ad3('0x1'))(_0x6ad3('0x2'));var moment=require(_0x6ad3('0x3'));var BPromise=require(_0x6ad3('0x4'));var rp=require(_0x6ad3('0x5'));var fs=require('fs');var path=require(_0x6ad3('0x6'));var rimraf=require(_0x6ad3('0x7'));var config=require(_0x6ad3('0x8'));var attributes=require('./mailTransferReport.attributes');module[_0x6ad3('0x9')]=function(_0x3d669f,_0x3c3041){return _0x3d669f[_0x6ad3('0xa')]('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc737=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','MailTransferReport','lodash'];(function(_0x623028,_0x5c3eb7){var _0x5ca7c6=function(_0x3f36cb){while(--_0x3f36cb){_0x623028['push'](_0x623028['shift']());}};_0x5ca7c6(++_0x5c3eb7);}(_0xc737,0x8e));var _0x7c73=function(_0x1b9c08,_0x375d1e){_0x1b9c08=_0x1b9c08-0x0;var _0x3c0e37=_0xc737[_0x1b9c08];return _0x3c0e37;};'use strict';var _=require(_0x7c73('0x0'));var util=require(_0x7c73('0x1'));var logger=require('../../config/logger')(_0x7c73('0x2'));var moment=require(_0x7c73('0x3'));var BPromise=require(_0x7c73('0x4'));var rp=require(_0x7c73('0x5'));var fs=require('fs');var path=require(_0x7c73('0x6'));var rimraf=require(_0x7c73('0x7'));var config=require(_0x7c73('0x8'));var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x1eb29f,_0x2f09f7){return _0x1eb29f[_0x7c73('0x9')](_0x7c73('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index c767ab6..4e14cac 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 _0x8259=['MailTransferReport,\x20%s,\x20%s','message','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3990d9,_0x2816f5){var _0x3bc2ab=function(_0x44dc08){while(--_0x44dc08){_0x3990d9['push'](_0x3990d9['shift']());}};_0x3bc2ab(++_0x2816f5);}(_0x8259,0xd5));var _0x9825=function(_0xfc8a45,_0x4af05d){_0xfc8a45=_0xfc8a45-0x0;var _0x18fd52=_0x8259[_0xfc8a45];return _0x18fd52;};'use strict';var _=require('lodash');var util=require(_0x9825('0x0'));var moment=require('moment');var BPromise=require(_0x9825('0x1'));var rs=require(_0x9825('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9825('0x3'));var logger=require(_0x9825('0x4'))(_0x9825('0x5'));var config=require(_0x9825('0x6'));var jayson=require(_0x9825('0x7'));var client=jayson['client'][_0x9825('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d8757,_0x30d1b1,_0x96884e){return new BPromise(function(_0x9ea8e0,_0x24ffc2){return client[_0x9825('0x9')](_0x1d8757,_0x96884e)[_0x9825('0xa')](function(_0x29ef93){logger[_0x9825('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x30d1b1,'request\x20sent');logger[_0x9825('0xc')](_0x9825('0xd'),_0x30d1b1,_0x9825('0xe'),JSON[_0x9825('0xf')](_0x29ef93));if(_0x29ef93[_0x9825('0x10')]){if(_0x29ef93['error'][_0x9825('0x11')]===0x1f4){logger[_0x9825('0x10')](_0x9825('0x12'),_0x30d1b1,_0x29ef93['error']['message']);return _0x24ffc2(_0x29ef93[_0x9825('0x10')][_0x9825('0x13')]);}logger[_0x9825('0x10')](_0x9825('0x12'),_0x30d1b1,_0x29ef93[_0x9825('0x10')]['message']);return _0x9ea8e0(_0x29ef93[_0x9825('0x10')][_0x9825('0x13')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x30d1b1,_0x9825('0xe'));_0x9ea8e0(_0x29ef93['result']['message']);}})[_0x9825('0x14')](function(_0x32cf9f){logger[_0x9825('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x30d1b1,_0x32cf9f);_0x24ffc2(_0x32cf9f);});});} \ No newline at end of file +var _0xb3d5=['error','code','MailTransferReport,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify'];(function(_0x140a60,_0xe96b8a){var _0x4876fc=function(_0x1a48f8){while(--_0x1a48f8){_0x140a60['push'](_0x140a60['shift']());}};_0x4876fc(++_0xe96b8a);}(_0xb3d5,0x1f3));var _0x5b3d=function(_0x4b90f3,_0x147233){_0x4b90f3=_0x4b90f3-0x0;var _0x75eb5a=_0xb3d5[_0x4b90f3];return _0x75eb5a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5b3d('0x0'));var BPromise=require(_0x5b3d('0x1'));var rs=require(_0x5b3d('0x2'));var fs=require('fs');var Redis=require(_0x5b3d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5b3d('0x4'));var logger=require(_0x5b3d('0x5'))('rpc');var config=require(_0x5b3d('0x6'));var jayson=require(_0x5b3d('0x7'));var client=jayson[_0x5b3d('0x8')][_0x5b3d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x189906,_0x361495,_0x2a4ae3){return new BPromise(function(_0x4b769d,_0x18a9b1){return client['request'](_0x189906,_0x2a4ae3)[_0x5b3d('0xa')](function(_0x4fd980){logger[_0x5b3d('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x361495,_0x5b3d('0xc'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x361495,_0x5b3d('0xc'),JSON[_0x5b3d('0xd')](_0x4fd980));if(_0x4fd980[_0x5b3d('0xe')]){if(_0x4fd980[_0x5b3d('0xe')][_0x5b3d('0xf')]===0x1f4){logger[_0x5b3d('0xe')](_0x5b3d('0x10'),_0x361495,_0x4fd980[_0x5b3d('0xe')][_0x5b3d('0x11')]);return _0x18a9b1(_0x4fd980[_0x5b3d('0xe')][_0x5b3d('0x11')]);}logger[_0x5b3d('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x361495,_0x4fd980[_0x5b3d('0xe')][_0x5b3d('0x11')]);return _0x4b769d(_0x4fd980[_0x5b3d('0xe')]['message']);}else{logger[_0x5b3d('0xb')](_0x5b3d('0x10'),_0x361495,'request\x20sent');_0x4b769d(_0x4fd980['result'][_0x5b3d('0x11')]);}})[_0x5b3d('0x12')](function(_0x1a4979){logger[_0x5b3d('0xe')](_0x5b3d('0x10'),_0x361495,_0x1a4979);_0x18a9b1(_0x1a4979);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 8bf5eb2..df91ee7 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 _0xb898=['../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2e5069,_0x3a1115){var _0x2f00ad=function(_0x3cba4f){while(--_0x3cba4f){_0x2e5069['push'](_0x2e5069['shift']());}};_0x2f00ad(++_0x3a1115);}(_0xb898,0x1db));var _0x8b89=function(_0x249d99,_0x16b584){_0x249d99=_0x249d99-0x0;var _0x5bfb05=_0xb898[_0x249d99];return _0x5bfb05;};'use strict';var multer=require(_0x8b89('0x0'));var util=require(_0x8b89('0x1'));var path=require(_0x8b89('0x2'));var timeout=require(_0x8b89('0x3'));var express=require(_0x8b89('0x4'));var router=express[_0x8b89('0x5')]();var fs_extra=require(_0x8b89('0x6'));var auth=require(_0x8b89('0x7'));var interaction=require(_0x8b89('0x8'));var config=require(_0x8b89('0x9'));var controller=require(_0x8b89('0xa'));router[_0x8b89('0xb')]('/',auth[_0x8b89('0xc')](),controller[_0x8b89('0xd')]);router[_0x8b89('0xb')](_0x8b89('0xe'),auth[_0x8b89('0xc')](),controller[_0x8b89('0xf')]);router[_0x8b89('0xb')](_0x8b89('0x10'),auth[_0x8b89('0xc')](),controller[_0x8b89('0x11')]);router[_0x8b89('0x12')]('/',auth[_0x8b89('0xc')](),controller[_0x8b89('0x13')]);router['put'](_0x8b89('0x10'),auth[_0x8b89('0xc')](),controller[_0x8b89('0x14')]);router[_0x8b89('0x15')](_0x8b89('0x10'),auth[_0x8b89('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5a7b=['update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x4d34fe,_0x2373e2){var _0x18f30d=function(_0x1e3177){while(--_0x1e3177){_0x4d34fe['push'](_0x4d34fe['shift']());}};_0x18f30d(++_0x2373e2);}(_0x5a7b,0xd5));var _0xb5a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a7b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb5a7('0x0'));var util=require(_0xb5a7('0x1'));var path=require('path');var timeout=require(_0xb5a7('0x2'));var express=require('express');var router=express[_0xb5a7('0x3')]();var fs_extra=require(_0xb5a7('0x4'));var auth=require(_0xb5a7('0x5'));var interaction=require(_0xb5a7('0x6'));var config=require(_0xb5a7('0x7'));var controller=require('./memberReport.controller');router['get']('/',auth[_0xb5a7('0x8')](),controller[_0xb5a7('0x9')]);router[_0xb5a7('0xa')](_0xb5a7('0xb'),auth[_0xb5a7('0x8')](),controller[_0xb5a7('0xc')]);router['get'](_0xb5a7('0xd'),auth['isAuthenticated'](),controller[_0xb5a7('0xe')]);router[_0xb5a7('0xf')]('/',auth[_0xb5a7('0x8')](),controller[_0xb5a7('0x10')]);router[_0xb5a7('0x11')](_0xb5a7('0xd'),auth[_0xb5a7('0x8')](),controller[_0xb5a7('0x12')]);router[_0xb5a7('0x13')]('/:id',auth[_0xb5a7('0x8')](),controller[_0xb5a7('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index a777d5e..6fdaeab 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 _0xb950=['enterAt','diff','seconds','setDataValue','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE'];(function(_0x4fb061,_0x5c61f5){var _0x29e0df=function(_0x160130){while(--_0x160130){_0x4fb061['push'](_0x4fb061['shift']());}};_0x29e0df(++_0x5c61f5);}(_0xb950,0xa9));var _0x0b95=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xb950[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0b95('0x0'));module[_0x0b95('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0b95('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0x0b95('0x3'),'comment':_0x0b95('0x4')},'duration':{'type':Sequelize[_0x0b95('0x5')]},'enterAt':{'type':Sequelize[_0x0b95('0x6')]},'exitAt':{'type':Sequelize[_0x0b95('0x6')],'set':function(_0x3c68c7){var _0x26cc64=moment(_0x3c68c7);var _0x4ecdfe=moment(this['getDataValue'](_0x0b95('0x7')));var _0x4bf8e5=_0x26cc64[_0x0b95('0x8')](_0x4ecdfe,_0x0b95('0x9'));this['setDataValue']('exitAt',_0x3c68c7);this[_0x0b95('0xa')](_0x0b95('0xb'),_0x4bf8e5>=0x0?_0x4bf8e5:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x0b95('0x2')],'comment':_0x0b95('0xc')},'data3':{'type':Sequelize['STRING'],'comment':_0x0b95('0xd')},'data4':{'type':Sequelize[_0x0b95('0x2')],'comment':_0x0b95('0xe')},'data5':{'type':Sequelize['STRING'],'comment':_0x0b95('0xf')},'role':{'type':Sequelize[_0x0b95('0x2')]},'internal':{'type':Sequelize[_0x0b95('0x5')]},'uniqueid':{'type':Sequelize[_0x0b95('0x2')]}}; \ No newline at end of file +var _0xe203=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff','setDataValue','exitAt','duration'];(function(_0x545bed,_0x221e96){var _0x16c79c=function(_0x465346){while(--_0x465346){_0x545bed['push'](_0x545bed['shift']());}};_0x16c79c(++_0x221e96);}(_0xe203,0xfe));var _0x3e20=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe203[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3e20('0x0'));module[_0x3e20('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x3e20('0x2')]},'interface':{'type':Sequelize[_0x3e20('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x3e20('0x3'),'comment':_0x3e20('0x4')},'duration':{'type':Sequelize[_0x3e20('0x5')]},'enterAt':{'type':Sequelize[_0x3e20('0x6')]},'exitAt':{'type':Sequelize[_0x3e20('0x6')],'set':function(_0x1abfe3){var _0x215406=moment(_0x1abfe3);var _0x139915=moment(this[_0x3e20('0x7')]('enterAt'));var _0x4f840e=_0x215406[_0x3e20('0x8')](_0x139915,'seconds');this[_0x3e20('0x9')](_0x3e20('0xa'),_0x1abfe3);this[_0x3e20('0x9')](_0x3e20('0xb'),_0x4f840e>=0x0?_0x4f840e:null);}},'data1':{'type':Sequelize[_0x3e20('0x2')],'comment':_0x3e20('0xc')},'data2':{'type':Sequelize[_0x3e20('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x3e20('0x2')],'comment':_0x3e20('0xd')},'data4':{'type':Sequelize[_0x3e20('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x3e20('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x3e20('0x5')]},'uniqueid':{'type':Sequelize[_0x3e20('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 688e426..61cfb21 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 _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','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'];(function(_0x1293fa,_0x446d6b){var _0x1dd054=function(_0x1b2d93){while(--_0x1b2d93){_0x1293fa['push'](_0x1293fa['shift']());}};_0x1dd054(++_0x446d6b);}(_0x008c,0x188));var _0xc008=function(_0x39782f,_0x4aa931){_0x39782f=_0x39782f-0x0;var _0x47768c=_0x008c[_0x39782f];return _0x47768c;};'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')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file +var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x591c61,_0x38bdf0){var _0x519b5e=function(_0x2595f9){while(--_0x2595f9){_0x591c61['push'](_0x591c61['shift']());}};_0x519b5e(++_0x38bdf0);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index eda324d..8eabdad 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 _0x4d07=['./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','../../config/logger','path','rimraf','../../config/environment'];(function(_0x6923ea,_0x4b5785){var _0x37b5d1=function(_0x3dd161){while(--_0x3dd161){_0x6923ea['push'](_0x6923ea['shift']());}};_0x37b5d1(++_0x4b5785);}(_0x4d07,0x18e));var _0x74d0=function(_0x9586c7,_0x5abe16){_0x9586c7=_0x9586c7-0x0;var _0x268ad0=_0x4d07[_0x9586c7];return _0x268ad0;};'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('0xb'),_0x74d0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4473=['path','exports','define','MemberReport','report_member','membername_interface','membername','interface','bluebird','request-promise'];(function(_0x5b306d,_0x498446){var _0x55bfc0=function(_0x589c50){while(--_0x589c50){_0x5b306d['push'](_0x5b306d['shift']());}};_0x55bfc0(++_0x498446);}(_0x4473,0x15c));var _0x3447=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x4473[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3447('0x0'));var rp=require(_0x3447('0x1'));var fs=require('fs');var path=require(_0x3447('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0x3447('0x3')]=function(_0x3a82c7,_0x27f3c8){return _0x3a82c7[_0x3447('0x4')](_0x3447('0x5'),attributes,{'tableName':_0x3447('0x6'),'paranoid':![],'indexes':[{'name':_0x3447('0x7'),'fields':[_0x3447('0x8'),_0x3447('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 0e5864c..6589e0c 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 _0xd819=['info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetMemberReport','options','raw','where','attributes','limit','include','map','model','stringify','CreateMemberReport','MemberReport','create','body','UpdateMemberReport','update','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0xc65be9,_0x11c689){var _0x559622=function(_0x2ef999){while(--_0x2ef999){_0xc65be9['push'](_0xc65be9['shift']());}};_0x559622(++_0x11c689);}(_0xd819,0x181));var _0x9d81=function(_0x4e29f1,_0x3da155){_0x4e29f1=_0x4e29f1-0x0;var _0x4bc72f=_0xd819[_0x4e29f1];return _0x4bc72f;};'use strict';var _=require('lodash');var util=require(_0x9d81('0x0'));var moment=require(_0x9d81('0x1'));var BPromise=require(_0x9d81('0x2'));var rs=require(_0x9d81('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d81('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9d81('0x5'))('rpc');var config=require(_0x9d81('0x6'));var jayson=require(_0x9d81('0x7'));var client=jayson[_0x9d81('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfc583e,_0x28ab9c,_0x1be93f){return new BPromise(function(_0x1e1329,_0x2bdd23){return client[_0x9d81('0x9')](_0xfc583e,_0x1be93f)[_0x9d81('0xa')](function(_0x21e4f7){logger[_0x9d81('0xb')](_0x9d81('0xc'),_0x28ab9c,_0x9d81('0xd'));logger[_0x9d81('0xe')](_0x9d81('0xf'),_0x28ab9c,_0x9d81('0xd'),JSON['stringify'](_0x21e4f7));if(_0x21e4f7[_0x9d81('0x10')]){if(_0x21e4f7[_0x9d81('0x10')]['code']===0x1f4){logger[_0x9d81('0x10')](_0x9d81('0xc'),_0x28ab9c,_0x21e4f7[_0x9d81('0x10')][_0x9d81('0x11')]);return _0x2bdd23(_0x21e4f7['error'][_0x9d81('0x11')]);}logger['error'](_0x9d81('0xc'),_0x28ab9c,_0x21e4f7['error'][_0x9d81('0x11')]);return _0x1e1329(_0x21e4f7[_0x9d81('0x10')]['message']);}else{logger[_0x9d81('0xb')](_0x9d81('0xc'),_0x28ab9c,_0x9d81('0xd'));_0x1e1329(_0x21e4f7[_0x9d81('0x12')][_0x9d81('0x11')]);}})[_0x9d81('0x13')](function(_0x446994){logger[_0x9d81('0x10')]('MemberReport,\x20%s,\x20%s',_0x28ab9c,_0x446994);_0x2bdd23(_0x446994);});});}exports[_0x9d81('0x14')]=function(_0x1bb0d7){var _0x3309c3=this;return new Promise(function(_0x406588,_0x3fd093){return db['MemberReport']['findAll']({'raw':_0x1bb0d7[_0x9d81('0x15')]?_0x1bb0d7[_0x9d81('0x15')][_0x9d81('0x16')]===undefined?!![]:![]:!![],'where':_0x1bb0d7[_0x9d81('0x15')]?_0x1bb0d7[_0x9d81('0x15')][_0x9d81('0x17')]||null:null,'attributes':_0x1bb0d7[_0x9d81('0x15')]?_0x1bb0d7[_0x9d81('0x15')][_0x9d81('0x18')]||null:null,'limit':_0x1bb0d7[_0x9d81('0x15')]?_0x1bb0d7[_0x9d81('0x15')][_0x9d81('0x19')]||null:null,'include':_0x1bb0d7[_0x9d81('0x15')]?_0x1bb0d7['options'][_0x9d81('0x1a')]?_[_0x9d81('0x1b')](_0x1bb0d7[_0x9d81('0x15')][_0x9d81('0x1a')],function(_0x46d0b5){return{'model':db[_0x46d0b5[_0x9d81('0x1c')]],'as':_0x46d0b5['as'],'attributes':_0x46d0b5[_0x9d81('0x18')],'include':_0x46d0b5[_0x9d81('0x1a')]?_['map'](_0x46d0b5[_0x9d81('0x1a')],function(_0xcb0df5){return{'model':db[_0xcb0df5[_0x9d81('0x1c')]],'as':_0xcb0df5['as'],'attributes':_0xcb0df5[_0x9d81('0x18')],'include':_0xcb0df5['include']?_[_0x9d81('0x1b')](_0xcb0df5['include'],function(_0x213a73){return{'model':db[_0x213a73['model']],'as':_0x213a73['as'],'attributes':_0x213a73[_0x9d81('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f44c0){logger[_0x9d81('0xb')](_0x9d81('0x14'),_0x1bb0d7);logger[_0x9d81('0xe')](_0x9d81('0x14'),_0x1bb0d7,JSON[_0x9d81('0x1d')](_0x3f44c0));_0x406588(_0x3f44c0);})[_0x9d81('0x13')](function(_0x385606){logger[_0x9d81('0x10')](_0x9d81('0x14'),_0x385606[_0x9d81('0x11')],_0x1bb0d7);_0x3fd093(_0x3309c3[_0x9d81('0x10')](0x1f4,_0x385606[_0x9d81('0x11')]));});});};exports[_0x9d81('0x1e')]=function(_0x25a9e0){var _0xe0cf0d=this;return new Promise(function(_0x494226,_0x593041){return db[_0x9d81('0x1f')][_0x9d81('0x20')](_0x25a9e0[_0x9d81('0x21')],{'raw':_0x25a9e0['options']?_0x25a9e0[_0x9d81('0x15')][_0x9d81('0x16')]===undefined?!![]:![]:!![]})[_0x9d81('0xa')](function(_0x494696){logger[_0x9d81('0xb')](_0x9d81('0x1e'),_0x25a9e0);logger[_0x9d81('0xe')](_0x9d81('0x1e'),_0x25a9e0,JSON[_0x9d81('0x1d')](_0x494696));_0x494226(_0x494696);})[_0x9d81('0x13')](function(_0x1bfb8b){logger[_0x9d81('0x10')](_0x9d81('0x1e'),_0x1bfb8b[_0x9d81('0x11')],_0x25a9e0);_0x593041(_0xe0cf0d[_0x9d81('0x10')](0x1f4,_0x1bfb8b[_0x9d81('0x11')]));});});};exports[_0x9d81('0x22')]=function(_0x4cad90){var _0x40020a=this;return new Promise(function(_0x10d26a,_0x3e4818){return db[_0x9d81('0x1f')][_0x9d81('0x23')](_0x4cad90['body'],{'raw':_0x4cad90[_0x9d81('0x15')]?_0x4cad90[_0x9d81('0x15')][_0x9d81('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cad90[_0x9d81('0x15')]?_0x4cad90[_0x9d81('0x15')][_0x9d81('0x17')]||null:null,'attributes':_0x4cad90[_0x9d81('0x15')]?_0x4cad90[_0x9d81('0x15')]['attributes']||null:null,'limit':_0x4cad90[_0x9d81('0x15')]?_0x4cad90[_0x9d81('0x15')][_0x9d81('0x19')]||null:null})['then'](function(_0xab5778){logger['info'](_0x9d81('0x22'),_0x4cad90);logger['debug'](_0x9d81('0x22'),_0x4cad90,JSON[_0x9d81('0x1d')](_0xab5778));_0x10d26a(_0xab5778);})[_0x9d81('0x13')](function(_0x5e5e33){logger[_0x9d81('0x10')](_0x9d81('0x22'),_0x5e5e33[_0x9d81('0x11')],_0x4cad90);_0x3e4818(_0x40020a[_0x9d81('0x10')](0x1f4,_0x5e5e33[_0x9d81('0x11')]));});});}; \ No newline at end of file +var _0x96fd=['model','map','CreateMemberReport','MemberReport','body','update','raw','UpdateMemberReport','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','findAll','options','where','attributes','limit','include'];(function(_0x587333,_0x393113){var _0x2a7ea4=function(_0x24df34){while(--_0x24df34){_0x587333['push'](_0x587333['shift']());}};_0x2a7ea4(++_0x393113);}(_0x96fd,0x1e9));var _0xd96f=function(_0x11d544,_0x3947f2){_0x11d544=_0x11d544-0x0;var _0x2a2883=_0x96fd[_0x11d544];return _0x2a2883;};'use strict';var _=require('lodash');var util=require(_0xd96f('0x0'));var moment=require('moment');var BPromise=require(_0xd96f('0x1'));var rs=require(_0xd96f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd96f('0x3'))['db'];var utils=require(_0xd96f('0x4'));var logger=require(_0xd96f('0x5'))(_0xd96f('0x6'));var config=require('../../config/environment');var jayson=require(_0xd96f('0x7'));var client=jayson[_0xd96f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe6000a,_0x446862,_0x3ae72a){return new BPromise(function(_0xb32b34,_0x10a4f3){return client[_0xd96f('0x9')](_0xe6000a,_0x3ae72a)[_0xd96f('0xa')](function(_0x1f1543){logger[_0xd96f('0xb')](_0xd96f('0xc'),_0x446862,_0xd96f('0xd'));logger[_0xd96f('0xe')](_0xd96f('0xf'),_0x446862,_0xd96f('0xd'),JSON[_0xd96f('0x10')](_0x1f1543));if(_0x1f1543[_0xd96f('0x11')]){if(_0x1f1543[_0xd96f('0x11')][_0xd96f('0x12')]===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x446862,_0x1f1543[_0xd96f('0x11')][_0xd96f('0x13')]);return _0x10a4f3(_0x1f1543['error']['message']);}logger[_0xd96f('0x11')](_0xd96f('0xc'),_0x446862,_0x1f1543[_0xd96f('0x11')][_0xd96f('0x13')]);return _0xb32b34(_0x1f1543[_0xd96f('0x11')][_0xd96f('0x13')]);}else{logger[_0xd96f('0xb')](_0xd96f('0xc'),_0x446862,_0xd96f('0xd'));_0xb32b34(_0x1f1543[_0xd96f('0x14')]['message']);}})[_0xd96f('0x15')](function(_0x569e1){logger['error'](_0xd96f('0xc'),_0x446862,_0x569e1);_0x10a4f3(_0x569e1);});});}exports[_0xd96f('0x16')]=function(_0x45c990){var _0x15d2d5=this;return new Promise(function(_0x7663e3,_0x1f1c2e){return db['MemberReport'][_0xd96f('0x17')]({'raw':_0x45c990[_0xd96f('0x18')]?_0x45c990[_0xd96f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x45c990[_0xd96f('0x18')]?_0x45c990[_0xd96f('0x18')][_0xd96f('0x19')]||null:null,'attributes':_0x45c990[_0xd96f('0x18')]?_0x45c990[_0xd96f('0x18')][_0xd96f('0x1a')]||null:null,'limit':_0x45c990[_0xd96f('0x18')]?_0x45c990['options'][_0xd96f('0x1b')]||null:null,'include':_0x45c990[_0xd96f('0x18')]?_0x45c990['options'][_0xd96f('0x1c')]?_['map'](_0x45c990[_0xd96f('0x18')]['include'],function(_0x5ade3f){return{'model':db[_0x5ade3f[_0xd96f('0x1d')]],'as':_0x5ade3f['as'],'attributes':_0x5ade3f['attributes'],'include':_0x5ade3f['include']?_[_0xd96f('0x1e')](_0x5ade3f[_0xd96f('0x1c')],function(_0x1b4b26){return{'model':db[_0x1b4b26[_0xd96f('0x1d')]],'as':_0x1b4b26['as'],'attributes':_0x1b4b26[_0xd96f('0x1a')],'include':_0x1b4b26[_0xd96f('0x1c')]?_['map'](_0x1b4b26[_0xd96f('0x1c')],function(_0x24d81a){return{'model':db[_0x24d81a[_0xd96f('0x1d')]],'as':_0x24d81a['as'],'attributes':_0x24d81a[_0xd96f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd96f('0xa')](function(_0x3725cd){logger[_0xd96f('0xb')](_0xd96f('0x16'),_0x45c990);logger[_0xd96f('0xe')](_0xd96f('0x16'),_0x45c990,JSON[_0xd96f('0x10')](_0x3725cd));_0x7663e3(_0x3725cd);})[_0xd96f('0x15')](function(_0x1e2ade){logger[_0xd96f('0x11')](_0xd96f('0x16'),_0x1e2ade[_0xd96f('0x13')],_0x45c990);_0x1f1c2e(_0x15d2d5[_0xd96f('0x11')](0x1f4,_0x1e2ade[_0xd96f('0x13')]));});});};exports[_0xd96f('0x1f')]=function(_0x1738dd){var _0x497b02=this;return new Promise(function(_0x3abf3d,_0x390863){return db[_0xd96f('0x20')]['create'](_0x1738dd[_0xd96f('0x21')],{'raw':_0x1738dd[_0xd96f('0x18')]?_0x1738dd[_0xd96f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xd96f('0xa')](function(_0x5cea25){logger[_0xd96f('0xb')]('CreateMemberReport',_0x1738dd);logger[_0xd96f('0xe')](_0xd96f('0x1f'),_0x1738dd,JSON[_0xd96f('0x10')](_0x5cea25));_0x3abf3d(_0x5cea25);})[_0xd96f('0x15')](function(_0x239506){logger[_0xd96f('0x11')](_0xd96f('0x1f'),_0x239506['message'],_0x1738dd);_0x390863(_0x497b02['error'](0x1f4,_0x239506[_0xd96f('0x13')]));});});};exports['UpdateMemberReport']=function(_0x541b33){var _0x56fa1d=this;return new Promise(function(_0x38c05f,_0x31db2c){return db[_0xd96f('0x20')][_0xd96f('0x22')](_0x541b33['body'],{'raw':_0x541b33[_0xd96f('0x18')]?_0x541b33[_0xd96f('0x18')][_0xd96f('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x541b33[_0xd96f('0x18')]?_0x541b33[_0xd96f('0x18')][_0xd96f('0x19')]||null:null,'attributes':_0x541b33[_0xd96f('0x18')]?_0x541b33[_0xd96f('0x18')][_0xd96f('0x1a')]||null:null,'limit':_0x541b33[_0xd96f('0x18')]?_0x541b33[_0xd96f('0x18')][_0xd96f('0x1b')]||null:null})['then'](function(_0x13579f){logger[_0xd96f('0xb')](_0xd96f('0x24'),_0x541b33);logger[_0xd96f('0xe')]('UpdateMemberReport',_0x541b33,JSON[_0xd96f('0x10')](_0x13579f));_0x38c05f(_0x13579f);})[_0xd96f('0x15')](function(_0x7dff88){logger[_0xd96f('0x11')]('UpdateMemberReport',_0x7dff88['message'],_0x541b33);_0x31db2c(_0x56fa1d[_0xd96f('0x11')](0x1f4,_0x7dff88[_0xd96f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 9788539..5bd97fc 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 _0x4a33=['../../components/interaction/service','../../config/environment','./migration.controller','index','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x4a33,0x199));var _0x34a3=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4a33[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x34a3('0x0'));var path=require(_0x34a3('0x1'));var timeout=require(_0x34a3('0x2'));var express=require(_0x34a3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x34a3('0x4'));var interaction=require(_0x34a3('0x5'));var config=require(_0x34a3('0x6'));var controller=require(_0x34a3('0x7'));router['get']('/',controller[_0x34a3('0x8')]);module['exports']=router; \ No newline at end of file +var _0x7852=['fs-extra','../../components/auth/service','../../config/environment','./migration.controller','get','multer','path','connect-timeout','Router'];(function(_0x5b6e9c,_0x5ad208){var _0x5b3a24=function(_0xc7b9ba){while(--_0xc7b9ba){_0x5b6e9c['push'](_0x5b6e9c['shift']());}};_0x5b3a24(++_0x5ad208);}(_0x7852,0x137));var _0x2785=function(_0x5963cf,_0x3064d6){_0x5963cf=_0x5963cf-0x0;var _0x1a4f67=_0x7852[_0x5963cf];return _0x1a4f67;};'use strict';var multer=require(_0x2785('0x0'));var util=require('util');var path=require(_0x2785('0x1'));var timeout=require(_0x2785('0x2'));var express=require('express');var router=express[_0x2785('0x3')]();var fs_extra=require(_0x2785('0x4'));var auth=require(_0x2785('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2785('0x6'));var controller=require(_0x2785('0x7'));router[_0x2785('0x8')]('/',controller['index']);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 68e68ac..df2007e 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 _0xe320=['sequelize','exports','STRING'];(function(_0x2ca5c3,_0x5184e6){var _0xa527c9=function(_0x451fff){while(--_0x451fff){_0x2ca5c3['push'](_0x2ca5c3['shift']());}};_0xa527c9(++_0x5184e6);}(_0xe320,0xa5));var _0x0e32=function(_0x5749b0,_0x88ef0f){_0x5749b0=_0x5749b0-0x0;var _0x10de61=_0xe320[_0x5749b0];return _0x10de61;};'use strict';var Sequelize=require(_0x0e32('0x0'));module[_0x0e32('0x1')]={'version':{'type':Sequelize[_0x0e32('0x2')],'unique':'version'}}; \ No newline at end of file +var _0x7ed2=['exports','STRING','sequelize'];(function(_0x44b431,_0x538c94){var _0xe6dcbe=function(_0x298188){while(--_0x298188){_0x44b431['push'](_0x44b431['shift']());}};_0xe6dcbe(++_0x538c94);}(_0x7ed2,0x173));var _0x27ed=function(_0x5697ef,_0x2b870a){_0x5697ef=_0x5697ef-0x0;var _0x4fe292=_0x7ed2[_0x5697ef];return _0x4fe292;};'use strict';var Sequelize=require(_0x27ed('0x0'));module[_0x27ed('0x1')]={'version':{'type':Sequelize[_0x27ed('0x2')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 2a065b6..34b8922 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 _0xbdf9=['name','send','index','map','Migration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','pick','filter','where','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','destroy','error'];(function(_0x3c7ecb,_0xfe99d5){var _0x3c8a56=function(_0x916ea1){while(--_0x916ea1){_0x3c7ecb['push'](_0x3c7ecb['shift']());}};_0x3c8a56(++_0xfe99d5);}(_0xbdf9,0x129));var _0x9bdf=function(_0x49fcfb,_0x504dec){_0x49fcfb=_0x49fcfb-0x0;var _0x964926=_0xbdf9[_0x49fcfb];return _0x964926;};'use strict';var emlformat=require(_0x9bdf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9bdf('0x1'));var jsonpatch=require(_0x9bdf('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9bdf('0x3'));var Mustache=require('mustache');var util=require(_0x9bdf('0x4'));var path=require(_0x9bdf('0x5'));var sox=require(_0x9bdf('0x6'));var csv=require(_0x9bdf('0x7'));var ejs=require(_0x9bdf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9bdf('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9bdf('0xa'));var deskjs=require(_0x9bdf('0xb'));var toCsv=require(_0x9bdf('0x7'));var querystring=require(_0x9bdf('0xc'));var Papa=require(_0x9bdf('0xd'));var Redis=require(_0x9bdf('0xe'));var authService=require(_0x9bdf('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9bdf('0x10'));var hardwareService=require(_0x9bdf('0x11'));var logger=require(_0x9bdf('0x12'))(_0x9bdf('0x13'));var utils=require(_0x9bdf('0x14'));var config=require(_0x9bdf('0x15'));var licenseUtil=require(_0x9bdf('0x16'));var db=require(_0x9bdf('0x17'))['db'];function respondWithStatusCode(_0xc641a0,_0xeed0bc){_0xeed0bc=_0xeed0bc||0xcc;return function(_0x36ca2b){if(_0x36ca2b){return _0xc641a0[_0x9bdf('0x18')](_0xeed0bc);}return _0xc641a0[_0x9bdf('0x19')](_0xeed0bc)[_0x9bdf('0x1a')]();};}function respondWithResult(_0x1be995,_0x22f66a){_0x22f66a=_0x22f66a||0xc8;return function(_0x8bbbcc){if(_0x8bbbcc){return _0x1be995['status'](_0x22f66a)[_0x9bdf('0x1b')](_0x8bbbcc);}};}function respondWithFilteredResult(_0x29b03a,_0x59bca7){return function(_0x41d728){if(_0x41d728){var _0x32e198=typeof _0x59bca7[_0x9bdf('0x1c')]===_0x9bdf('0x1d')&&typeof _0x59bca7['limit']==='undefined';var _0x561185=_0x41d728['count'];var _0xc3c913=_0x32e198?0x0:_0x59bca7[_0x9bdf('0x1c')];var _0x5c5f89=_0x32e198?_0x41d728['count']:_0x59bca7[_0x9bdf('0x1c')]+_0x59bca7[_0x9bdf('0x1e')];var _0x35f5dd;if(_0x5c5f89>=_0x561185){_0x5c5f89=_0x561185;_0x35f5dd=0xc8;}else{_0x35f5dd=0xce;}_0x29b03a[_0x9bdf('0x19')](_0x35f5dd);return _0x29b03a[_0x9bdf('0x1f')](_0x9bdf('0x20'),_0xc3c913+'-'+_0x5c5f89+'/'+_0x561185)[_0x9bdf('0x1b')](_0x41d728);}return null;};}function patchUpdates(_0x2fea7f){return function(_0x42a1fc){try{jsonpatch[_0x9bdf('0x21')](_0x42a1fc,_0x2fea7f,!![]);}catch(_0x2712e2){return BPromise[_0x9bdf('0x22')](_0x2712e2);}return _0x42a1fc['save']();};}function saveUpdates(_0x5b3e1d,_0x320ad1){return function(_0x4a7ece){if(_0x4a7ece){return _0x4a7ece['update'](_0x5b3e1d)[_0x9bdf('0x23')](function(_0x426a56){return _0x426a56;});}return null;};}function removeEntity(_0x43143a,_0x529660){return function(_0x567d64){if(_0x567d64){return _0x567d64[_0x9bdf('0x24')]()[_0x9bdf('0x23')](function(){_0x43143a[_0x9bdf('0x19')](0xcc)[_0x9bdf('0x1a')]();});}};}function handleEntityNotFound(_0x5bf826,_0x12479e){return function(_0x47c363){if(!_0x47c363){_0x5bf826[_0x9bdf('0x18')](0x194);}return _0x47c363;};}function handleError(_0x331e9b,_0x1a9e19){_0x1a9e19=_0x1a9e19||0x1f4;return function(_0x2e29c1){logger[_0x9bdf('0x25')](_0x2e29c1['stack']);if(_0x2e29c1[_0x9bdf('0x26')]){delete _0x2e29c1[_0x9bdf('0x26')];}_0x331e9b['status'](_0x1a9e19)[_0x9bdf('0x27')](_0x2e29c1);};}exports[_0x9bdf('0x28')]=function(_0x41ed06,_0x27c214){var _0x525e0f={},_0x5f3d55={},_0x1f296d={'count':0x0,'rows':[]};var _0x403695=_[_0x9bdf('0x29')](db[_0x9bdf('0x2a')][_0x9bdf('0x2b')],function(_0x5d7046){return{'name':_0x5d7046['fieldName'],'type':_0x5d7046[_0x9bdf('0x2c')][_0x9bdf('0x2d')]};});_0x5f3d55[_0x9bdf('0x2e')]=_['map'](_0x403695,_0x9bdf('0x26'));_0x5f3d55[_0x9bdf('0x2f')]=_[_0x9bdf('0x30')](_0x41ed06[_0x9bdf('0x2f')]);_0x5f3d55[_0x9bdf('0x31')]=_[_0x9bdf('0x32')](_0x5f3d55['model'],_0x5f3d55['query']);_0x525e0f[_0x9bdf('0x33')]=_[_0x9bdf('0x32')](_0x5f3d55[_0x9bdf('0x2e')],qs['fields'](_0x41ed06[_0x9bdf('0x2f')][_0x9bdf('0x34')]));_0x525e0f[_0x9bdf('0x33')]=_0x525e0f[_0x9bdf('0x33')][_0x9bdf('0x35')]?_0x525e0f[_0x9bdf('0x33')]:_0x5f3d55[_0x9bdf('0x2e')];if(!_0x41ed06[_0x9bdf('0x2f')]['hasOwnProperty'](_0x9bdf('0x36'))){_0x525e0f[_0x9bdf('0x1e')]=qs['limit'](_0x41ed06[_0x9bdf('0x2f')][_0x9bdf('0x1e')]);_0x525e0f[_0x9bdf('0x1c')]=qs['offset'](_0x41ed06[_0x9bdf('0x2f')][_0x9bdf('0x1c')]);}_0x525e0f[_0x9bdf('0x37')]=qs['sort'](_0x41ed06[_0x9bdf('0x2f')]['sort']);_0x525e0f['where']=qs[_0x9bdf('0x31')](_[_0x9bdf('0x38')](_0x41ed06[_0x9bdf('0x2f')],_0x5f3d55['filters']),_0x403695);if(_0x41ed06['query'][_0x9bdf('0x39')]){_0x525e0f[_0x9bdf('0x3a')]=_[_0x9bdf('0x3b')](_0x525e0f[_0x9bdf('0x3a')],{'$or':_[_0x9bdf('0x29')](_0x403695,function(_0x20eae2){if(_0x20eae2['type']!==_0x9bdf('0x3c')){var _0x310b44={};_0x310b44[_0x20eae2[_0x9bdf('0x26')]]={'$like':'%'+_0x41ed06[_0x9bdf('0x2f')][_0x9bdf('0x39')]+'%'};return _0x310b44;}})});}_0x525e0f=_[_0x9bdf('0x3b')]({},_0x525e0f,_0x41ed06['options']);var _0x59d65a={'where':_0x525e0f[_0x9bdf('0x3a')]};return db[_0x9bdf('0x2a')][_0x9bdf('0x3d')](_0x59d65a)[_0x9bdf('0x23')](function(_0x5f02b3){_0x1f296d[_0x9bdf('0x3d')]=_0x5f02b3;if(_0x41ed06[_0x9bdf('0x2f')][_0x9bdf('0x3e')]){_0x525e0f[_0x9bdf('0x3f')]=[{'all':!![]}];}return db['Migration'][_0x9bdf('0x40')](_0x525e0f);})[_0x9bdf('0x23')](function(_0x264385){_0x1f296d[_0x9bdf('0x41')]=_0x264385;return _0x1f296d;})[_0x9bdf('0x23')](respondWithFilteredResult(_0x27c214,_0x525e0f))[_0x9bdf('0x42')](handleError(_0x27c214,null));}; \ No newline at end of file +var _0x2032=['pick','filter','merge','VIRTUAL','options','Migration','includeAll','include','findAll','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where'];(function(_0xde1c77,_0x3a7049){var _0x4be9de=function(_0x401a99){while(--_0x401a99){_0xde1c77['push'](_0xde1c77['shift']());}};_0x4be9de(++_0x3a7049);}(_0x2032,0xe2));var _0x2203=function(_0x3fadd1,_0x330846){_0x3fadd1=_0x3fadd1-0x0;var _0x1b03ee=_0x2032[_0x3fadd1];return _0x1b03ee;};'use strict';var emlformat=require(_0x2203('0x0'));var rimraf=require(_0x2203('0x1'));var zipdir=require(_0x2203('0x2'));var jsonpatch=require(_0x2203('0x3'));var rp=require('request-promise');var moment=require(_0x2203('0x4'));var BPromise=require(_0x2203('0x5'));var Mustache=require(_0x2203('0x6'));var util=require(_0x2203('0x7'));var path=require(_0x2203('0x8'));var sox=require(_0x2203('0x9'));var csv=require(_0x2203('0xa'));var ejs=require(_0x2203('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2203('0xc'));var deskjs=require(_0x2203('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2203('0xe'));var Papa=require(_0x2203('0xf'));var Redis=require(_0x2203('0x10'));var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require(_0x2203('0x14'));var logger=require(_0x2203('0x15'))(_0x2203('0x16'));var utils=require(_0x2203('0x17'));var config=require(_0x2203('0x18'));var licenseUtil=require(_0x2203('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17f382,_0xa2249d){_0xa2249d=_0xa2249d||0xcc;return function(_0x1195a8){if(_0x1195a8){return _0x17f382[_0x2203('0x1a')](_0xa2249d);}return _0x17f382['status'](_0xa2249d)[_0x2203('0x1b')]();};}function respondWithResult(_0x164914,_0x2e35ad){_0x2e35ad=_0x2e35ad||0xc8;return function(_0x1f2ed3){if(_0x1f2ed3){return _0x164914[_0x2203('0x1c')](_0x2e35ad)[_0x2203('0x1d')](_0x1f2ed3);}};}function respondWithFilteredResult(_0x2b19e1,_0x19522f){return function(_0x12e5e7){if(_0x12e5e7){var _0x12322d=typeof _0x19522f[_0x2203('0x1e')]===_0x2203('0x1f')&&typeof _0x19522f[_0x2203('0x20')]===_0x2203('0x1f');var _0x4668e5=_0x12e5e7[_0x2203('0x21')];var _0x5873d6=_0x12322d?0x0:_0x19522f[_0x2203('0x1e')];var _0x1f2261=_0x12322d?_0x12e5e7[_0x2203('0x21')]:_0x19522f[_0x2203('0x1e')]+_0x19522f[_0x2203('0x20')];var _0x2169f0;if(_0x1f2261>=_0x4668e5){_0x1f2261=_0x4668e5;_0x2169f0=0xc8;}else{_0x2169f0=0xce;}_0x2b19e1[_0x2203('0x1c')](_0x2169f0);return _0x2b19e1[_0x2203('0x22')](_0x2203('0x23'),_0x5873d6+'-'+_0x1f2261+'/'+_0x4668e5)['json'](_0x12e5e7);}return null;};}function patchUpdates(_0x1fdb84){return function(_0x5a4ebf){try{jsonpatch['apply'](_0x5a4ebf,_0x1fdb84,!![]);}catch(_0x4092fc){return BPromise[_0x2203('0x24')](_0x4092fc);}return _0x5a4ebf[_0x2203('0x25')]();};}function saveUpdates(_0x4748da,_0x36c363){return function(_0x59fff0){if(_0x59fff0){return _0x59fff0[_0x2203('0x26')](_0x4748da)[_0x2203('0x27')](function(_0x2e5d12){return _0x2e5d12;});}return null;};}function removeEntity(_0x600cf6,_0x42a041){return function(_0x12a8d9){if(_0x12a8d9){return _0x12a8d9[_0x2203('0x28')]()['then'](function(){_0x600cf6[_0x2203('0x1c')](0xcc)[_0x2203('0x1b')]();});}};}function handleEntityNotFound(_0x325684,_0xb49398){return function(_0x339847){if(!_0x339847){_0x325684[_0x2203('0x1a')](0x194);}return _0x339847;};}function handleError(_0x18c48c,_0xe8f833){_0xe8f833=_0xe8f833||0x1f4;return function(_0x26fce9){logger[_0x2203('0x29')](_0x26fce9[_0x2203('0x2a')]);if(_0x26fce9['name']){delete _0x26fce9[_0x2203('0x2b')];}_0x18c48c['status'](_0xe8f833)['send'](_0x26fce9);};}exports[_0x2203('0x2c')]=function(_0x31aeaf,_0x51ee88){var _0x1da2b3={},_0x9a35c9={},_0x10deaa={'count':0x0,'rows':[]};var _0x4798a8=_[_0x2203('0x2d')](db['Migration'][_0x2203('0x2e')],function(_0x517095){return{'name':_0x517095[_0x2203('0x2f')],'type':_0x517095[_0x2203('0x30')][_0x2203('0x31')]};});_0x9a35c9[_0x2203('0x32')]=_['map'](_0x4798a8,_0x2203('0x2b'));_0x9a35c9[_0x2203('0x33')]=_[_0x2203('0x34')](_0x31aeaf[_0x2203('0x33')]);_0x9a35c9[_0x2203('0x35')]=_[_0x2203('0x36')](_0x9a35c9[_0x2203('0x32')],_0x9a35c9[_0x2203('0x33')]);_0x1da2b3[_0x2203('0x37')]=_[_0x2203('0x36')](_0x9a35c9[_0x2203('0x32')],qs[_0x2203('0x38')](_0x31aeaf['query'][_0x2203('0x38')]));_0x1da2b3[_0x2203('0x37')]=_0x1da2b3[_0x2203('0x37')][_0x2203('0x39')]?_0x1da2b3[_0x2203('0x37')]:_0x9a35c9[_0x2203('0x32')];if(!_0x31aeaf['query']['hasOwnProperty'](_0x2203('0x3a'))){_0x1da2b3[_0x2203('0x20')]=qs[_0x2203('0x20')](_0x31aeaf[_0x2203('0x33')]['limit']);_0x1da2b3['offset']=qs[_0x2203('0x1e')](_0x31aeaf[_0x2203('0x33')][_0x2203('0x1e')]);}_0x1da2b3[_0x2203('0x3b')]=qs[_0x2203('0x3c')](_0x31aeaf[_0x2203('0x33')][_0x2203('0x3c')]);_0x1da2b3[_0x2203('0x3d')]=qs['filters'](_[_0x2203('0x3e')](_0x31aeaf[_0x2203('0x33')],_0x9a35c9[_0x2203('0x35')]),_0x4798a8);if(_0x31aeaf[_0x2203('0x33')][_0x2203('0x3f')]){_0x1da2b3[_0x2203('0x3d')]=_[_0x2203('0x40')](_0x1da2b3[_0x2203('0x3d')],{'$or':_[_0x2203('0x2d')](_0x4798a8,function(_0x1b71f0){if(_0x1b71f0[_0x2203('0x30')]!==_0x2203('0x41')){var _0x3776aa={};_0x3776aa[_0x1b71f0[_0x2203('0x2b')]]={'$like':'%'+_0x31aeaf['query']['filter']+'%'};return _0x3776aa;}})});}_0x1da2b3=_[_0x2203('0x40')]({},_0x1da2b3,_0x31aeaf[_0x2203('0x42')]);var _0x432adb={'where':_0x1da2b3['where']};return db[_0x2203('0x43')][_0x2203('0x21')](_0x432adb)[_0x2203('0x27')](function(_0x25abd9){_0x10deaa[_0x2203('0x21')]=_0x25abd9;if(_0x31aeaf[_0x2203('0x33')][_0x2203('0x44')]){_0x1da2b3[_0x2203('0x45')]=[{'all':!![]}];}return db['Migration'][_0x2203('0x46')](_0x1da2b3);})[_0x2203('0x27')](function(_0x31600a){_0x10deaa['rows']=_0x31600a;return _0x10deaa;})['then'](respondWithFilteredResult(_0x51ee88,_0x1da2b3))[_0x2203('0x47')](handleError(_0x51ee88,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 7190d6d..a152bf1 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 _0x07a7=['bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','lodash','util','../../config/logger','api'];(function(_0x4280b2,_0xff2b7){var _0x36b8cb=function(_0x575ee5){while(--_0x575ee5){_0x4280b2['push'](_0x4280b2['shift']());}};_0x36b8cb(++_0xff2b7);}(_0x07a7,0x167));var _0x707a=function(_0x5103ff,_0x262121){_0x5103ff=_0x5103ff-0x0;var _0x317c78=_0x07a7[_0x5103ff];return _0x317c78;};'use strict';var _=require(_0x707a('0x0'));var util=require(_0x707a('0x1'));var logger=require(_0x707a('0x2'))(_0x707a('0x3'));var moment=require('moment');var BPromise=require(_0x707a('0x4'));var rp=require(_0x707a('0x5'));var fs=require('fs');var path=require(_0x707a('0x6'));var rimraf=require(_0x707a('0x7'));var config=require(_0x707a('0x8'));var attributes=require(_0x707a('0x9'));module[_0x707a('0xa')]=function(_0xfd0f3a,_0x6206d3){return _0xfd0f3a['define']('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0763=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','migrations','lodash','util'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0763,0x150));var _0x3076=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x0763[_0x4b73a2];return _0x383c66;};'use strict';var _=require(_0x3076('0x0'));var util=require(_0x3076('0x1'));var logger=require(_0x3076('0x2'))(_0x3076('0x3'));var moment=require(_0x3076('0x4'));var BPromise=require(_0x3076('0x5'));var rp=require(_0x3076('0x6'));var fs=require('fs');var path=require(_0x3076('0x7'));var rimraf=require(_0x3076('0x8'));var config=require(_0x3076('0x9'));var attributes=require(_0x3076('0xa'));module[_0x3076('0xb')]=function(_0x509f58,_0x630254){return _0x509f58['define']('Migration',attributes,{'tableName':_0x3076('0xc'),'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 1ab7cb8..641def1 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 _0x76bc=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','result','lodash'];(function(_0x33a3e5,_0x1dc1aa){var _0x4bb571=function(_0x2f4439){while(--_0x2f4439){_0x33a3e5['push'](_0x33a3e5['shift']());}};_0x4bb571(++_0x1dc1aa);}(_0x76bc,0x17f));var _0xc76b=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0x76bc[_0x1b64dd];return _0xeb464c;};'use strict';var _=require(_0xc76b('0x0'));var util=require(_0xc76b('0x1'));var moment=require(_0xc76b('0x2'));var BPromise=require(_0xc76b('0x3'));var rs=require(_0xc76b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc76b('0x5'));var logger=require(_0xc76b('0x6'))(_0xc76b('0x7'));var config=require(_0xc76b('0x8'));var jayson=require(_0xc76b('0x9'));var client=jayson[_0xc76b('0xa')][_0xc76b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cbe53,_0x110f3b,_0x1cb174){return new BPromise(function(_0x235ff3,_0xaf195c){return client[_0xc76b('0xc')](_0x2cbe53,_0x1cb174)[_0xc76b('0xd')](function(_0x2803e9){logger[_0xc76b('0xe')]('Migration,\x20%s,\x20%s',_0x110f3b,_0xc76b('0xf'));logger[_0xc76b('0x10')](_0xc76b('0x11'),_0x110f3b,_0xc76b('0xf'),JSON[_0xc76b('0x12')](_0x2803e9));if(_0x2803e9[_0xc76b('0x13')]){if(_0x2803e9['error'][_0xc76b('0x14')]===0x1f4){logger[_0xc76b('0x13')](_0xc76b('0x15'),_0x110f3b,_0x2803e9[_0xc76b('0x13')][_0xc76b('0x16')]);return _0xaf195c(_0x2803e9[_0xc76b('0x13')][_0xc76b('0x16')]);}logger['error']('Migration,\x20%s,\x20%s',_0x110f3b,_0x2803e9[_0xc76b('0x13')][_0xc76b('0x16')]);return _0x235ff3(_0x2803e9[_0xc76b('0x13')][_0xc76b('0x16')]);}else{logger[_0xc76b('0xe')]('Migration,\x20%s,\x20%s',_0x110f3b,_0xc76b('0xf'));_0x235ff3(_0x2803e9[_0xc76b('0x17')][_0xc76b('0x16')]);}})['catch'](function(_0x4e759e){logger[_0xc76b('0x13')](_0xc76b('0x15'),_0x110f3b,_0x4e759e);_0xaf195c(_0x4e759e);});});} \ No newline at end of file +var _0xea1a=['info','Migration,\x20%s,\x20%s,\x20%s','error','Migration,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x117696,_0x18926a){var _0x5bef49=function(_0x1662cb){while(--_0x1662cb){_0x117696['push'](_0x117696['shift']());}};_0x5bef49(++_0x18926a);}(_0xea1a,0x158));var _0xaea1=function(_0xd90015,_0x5aaa2b){_0xd90015=_0xd90015-0x0;var _0x68d03d=_0xea1a[_0xd90015];return _0x68d03d;};'use strict';var _=require(_0xaea1('0x0'));var util=require(_0xaea1('0x1'));var moment=require(_0xaea1('0x2'));var BPromise=require(_0xaea1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaea1('0x4'));var db=require(_0xaea1('0x5'))['db'];var utils=require(_0xaea1('0x6'));var logger=require(_0xaea1('0x7'))(_0xaea1('0x8'));var config=require(_0xaea1('0x9'));var jayson=require(_0xaea1('0xa'));var client=jayson[_0xaea1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x884233,_0x8883ab,_0x3359a9){return new BPromise(function(_0x51ca63,_0x1b5adf){return client['request'](_0x884233,_0x3359a9)[_0xaea1('0xc')](function(_0x4892e0){logger[_0xaea1('0xd')]('Migration,\x20%s,\x20%s',_0x8883ab,'request\x20sent');logger['debug'](_0xaea1('0xe'),_0x8883ab,'request\x20sent',JSON['stringify'](_0x4892e0));if(_0x4892e0[_0xaea1('0xf')]){if(_0x4892e0[_0xaea1('0xf')]['code']===0x1f4){logger[_0xaea1('0xf')](_0xaea1('0x10'),_0x8883ab,_0x4892e0[_0xaea1('0xf')][_0xaea1('0x11')]);return _0x1b5adf(_0x4892e0[_0xaea1('0xf')][_0xaea1('0x11')]);}logger[_0xaea1('0xf')]('Migration,\x20%s,\x20%s',_0x8883ab,_0x4892e0[_0xaea1('0xf')][_0xaea1('0x11')]);return _0x51ca63(_0x4892e0[_0xaea1('0xf')][_0xaea1('0x11')]);}else{logger[_0xaea1('0xd')](_0xaea1('0x10'),_0x8883ab,_0xaea1('0x12'));_0x51ca63(_0x4892e0[_0xaea1('0x13')][_0xaea1('0x11')]);}})[_0xaea1('0x14')](function(_0x2920f7){logger[_0xaea1('0xf')](_0xaea1('0x10'),_0x8883ab,_0x2920f7);_0x1b5adf(_0x2920f7);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 75c38fb..42cbf06 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 _0x7795=['update','delete','destroy','exports','util','express','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put'];(function(_0x19cb08,_0x4764fc){var _0x1b28d1=function(_0x2868a3){while(--_0x2868a3){_0x19cb08['push'](_0x19cb08['shift']());}};_0x1b28d1(++_0x4764fc);}(_0x7795,0x1a4));var _0x5779=function(_0x4bb16e,_0x4fdf1b){_0x4bb16e=_0x4bb16e-0x0;var _0x24901c=_0x7795[_0x4bb16e];return _0x24901c;};'use strict';var multer=require('multer');var util=require(_0x5779('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5779('0x1'));var router=express[_0x5779('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5779('0x3'));var config=require(_0x5779('0x4'));var controller=require('./network.controller');router[_0x5779('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5779('0x5')](_0x5779('0x6'),auth[_0x5779('0x7')](),controller[_0x5779('0x8')]);router[_0x5779('0x9')]('/',auth['isAuthenticated'](),controller[_0x5779('0xa')]);router[_0x5779('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x5779('0xc')]);router[_0x5779('0xd')](_0x5779('0x6'),auth[_0x5779('0x7')](),controller[_0x5779('0xe')]);module[_0x5779('0xf')]=router; \ No newline at end of file +var _0x6dc0=['get','/:id','show','post','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','isAuthenticated'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x6dc0,0xb6));var _0x06dc=function(_0x81aad8,_0x11602d){_0x81aad8=_0x81aad8-0x0;var _0x587403=_0x6dc0[_0x81aad8];return _0x587403;};'use strict';var multer=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var path=require(_0x06dc('0x2'));var timeout=require('connect-timeout');var express=require(_0x06dc('0x3'));var router=express[_0x06dc('0x4')]();var fs_extra=require(_0x06dc('0x5'));var auth=require(_0x06dc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x06dc('0x7'));var controller=require(_0x06dc('0x8'));router['get']('/',auth[_0x06dc('0x9')](),controller['index']);router[_0x06dc('0xa')](_0x06dc('0xb'),auth[_0x06dc('0x9')](),controller[_0x06dc('0xc')]);router[_0x06dc('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x06dc('0xb'),auth[_0x06dc('0x9')](),controller['update']);router[_0x06dc('0xe')](_0x06dc('0xb'),auth[_0x06dc('0x9')](),controller[_0x06dc('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 6561a16..bab1f05 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 _0x9249=['STRING','sequelize','exports','ENUM'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x9249,0x185));var _0x9924=function(_0x3f8759,_0x3fe6fb){_0x3f8759=_0x3f8759-0x0;var _0x2d33ca=_0x9249[_0x3f8759];return _0x2d33ca;};'use strict';var Sequelize=require(_0x9924('0x0'));module[_0x9924('0x1')]={'type':{'type':Sequelize[_0x9924('0x2')]('localnet','externip','stun','turn')},'value':{'type':Sequelize[_0x9924('0x3')]},'username':{'type':Sequelize[_0x9924('0x3')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7042=['localnet','externip','stun','turn','STRING','exports','ENUM'];(function(_0x28add6,_0x1c1430){var _0x2e4b89=function(_0x2aa051){while(--_0x2aa051){_0x28add6['push'](_0x28add6['shift']());}};_0x2e4b89(++_0x1c1430);}(_0x7042,0x1b0));var _0x2704=function(_0x115a47,_0x4a140f){_0x115a47=_0x115a47-0x0;var _0x2070bf=_0x7042[_0x115a47];return _0x2070bf;};'use strict';var Sequelize=require('sequelize');module[_0x2704('0x0')]={'type':{'type':Sequelize[_0x2704('0x1')](_0x2704('0x2'),_0x2704('0x3'),_0x2704('0x4'),_0x2704('0x5'))},'value':{'type':Sequelize[_0x2704('0x6')]},'username':{'type':Sequelize[_0x2704('0x6')]},'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 924d254..9277980 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 _0x0270=['path','ejs','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','Network,\x20%s,\x20%s','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','json','offset','count','limit','status','set','Content-Range','destroy','end','stack','name','send','Network','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','findAll','show','params','rawAttributes','include','options','find','create','body','STUN','join','server/files/templates/stun_multiple.ejs','utf8','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','root','server/files/templates/turn_multiple.ejs','render','writeFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','toUpperCase','util'];(function(_0x35387d,_0x1ba72f){var _0x3aba56=function(_0x42cd08){while(--_0x42cd08){_0x35387d['push'](_0x35387d['shift']());}};_0x3aba56(++_0x1ba72f);}(_0x0270,0xa5));var _0x0027=function(_0x5d73b7,_0x1341f0){_0x5d73b7=_0x5d73b7-0x0;var _0x539a95=_0x0270[_0x5d73b7];return _0x539a95;};'use strict';var util=require(_0x0027('0x0'));var path=require(_0x0027('0x1'));var ejs=require(_0x0027('0x2'));var fs=require('fs');var _=require(_0x0027('0x3'));var qs=require(_0x0027('0x4'));var logger=require('../../config/logger')(_0x0027('0x5'));var config=require(_0x0027('0x6'));var db=require(_0x0027('0x7'))['db'];var jayson=require(_0x0027('0x8'));var client=jayson['client'][_0x0027('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3af7a1,_0x19281d,_0x59b430,_0x362599){return new Promise(function(_0x4eb475,_0x13c15b){var _0xa96beb=_0x362599||client;return _0xa96beb[_0x0027('0xa')](_0x3af7a1,_0x59b430)[_0x0027('0xb')](function(_0x4ff82f){logger[_0x0027('0xc')](_0x0027('0xd'),_0x19281d,'request\x20sent');logger['debug'](_0x0027('0xe'),_0x19281d,_0x0027('0xf'),JSON[_0x0027('0x10')](_0x4ff82f));if(_0x4ff82f[_0x0027('0x11')]){if(_0x4ff82f[_0x0027('0x11')][_0x0027('0x12')]===0x1f4){logger['error'](_0x0027('0xd'),_0x19281d,_0x4ff82f['error'][_0x0027('0x13')]);return _0x13c15b(_0x4ff82f[_0x0027('0x11')][_0x0027('0x13')]);}logger[_0x0027('0x11')](_0x0027('0xd'),_0x19281d,_0x4ff82f[_0x0027('0x11')][_0x0027('0x13')]);return _0x4eb475(_0x4ff82f[_0x0027('0x11')][_0x0027('0x13')]);}else{logger[_0x0027('0xc')](_0x0027('0xd'),_0x19281d,_0x0027('0xf'));_0x4eb475(_0x4ff82f[_0x0027('0x14')]['message']);}})[_0x0027('0x15')](function(_0x1de25c){logger['error'](_0x0027('0xd'),_0x19281d,_0x1de25c);_0x13c15b(_0x1de25c);});});}function respondWithResult(_0x1d4ac4,_0x27f224){_0x27f224=_0x27f224||0xc8;return function(_0x2bea77){if(_0x2bea77){return _0x1d4ac4['status'](_0x27f224)[_0x0027('0x16')](_0x2bea77);}};}function respondWithFilteredResult(_0x1053c9,_0x53956b){return function(_0x57bdad){if(_0x57bdad){var _0x39fd35=typeof _0x53956b[_0x0027('0x17')]==='undefined'&&typeof _0x53956b['limit']==='undefined';var _0x31d357=_0x57bdad[_0x0027('0x18')];var _0x230c1e=_0x39fd35?0x0:_0x53956b['offset'];var _0xcb8118=_0x39fd35?_0x57bdad[_0x0027('0x18')]:_0x53956b[_0x0027('0x17')]+_0x53956b[_0x0027('0x19')];var _0x46e3c7;if(_0xcb8118>=_0x31d357){_0xcb8118=_0x31d357;_0x46e3c7=0xc8;}else{_0x46e3c7=0xce;}_0x1053c9[_0x0027('0x1a')](_0x46e3c7);return _0x1053c9[_0x0027('0x1b')](_0x0027('0x1c'),_0x230c1e+'-'+_0xcb8118+'/'+_0x31d357)[_0x0027('0x16')](_0x57bdad);}return null;};}function saveUpdates(_0x58248b){return function(_0x182c46){if(_0x182c46){return _0x182c46['update'](_0x58248b)[_0x0027('0xb')](function(_0x262b00){return _0x262b00;});}return null;};}function removeEntity(_0x25164b){return function(_0x4cfacd){if(_0x4cfacd){return _0x4cfacd[_0x0027('0x1d')]()[_0x0027('0xb')](function(){_0x25164b[_0x0027('0x1a')](0xcc)[_0x0027('0x1e')]();});}};}function handleEntityNotFound(_0xe250e7){return function(_0x424d65){if(!_0x424d65){_0xe250e7['sendStatus'](0x194);}return _0x424d65;};}function handleError(_0x23a4d0,_0x3f0d2a){_0x3f0d2a=_0x3f0d2a||0x1f4;return function(_0x47be11){logger[_0x0027('0x11')](_0x47be11[_0x0027('0x1f')]);if(_0x47be11[_0x0027('0x20')]){delete _0x47be11['name'];}_0x23a4d0[_0x0027('0x1a')](_0x3f0d2a)[_0x0027('0x21')](_0x47be11);};}exports['index']=function(_0x1a40e1,_0x4bbd51){var _0x4eef91={},_0x1dcbaa={},_0x3c546b={'count':0x0,'rows':[]};var _0x2bad14=_['map'](db[_0x0027('0x22')]['rawAttributes'],function(_0x8e9b5d){return{'name':_0x8e9b5d['fieldName'],'type':_0x8e9b5d['type']['key']};});_0x1dcbaa[_0x0027('0x23')]=_[_0x0027('0x24')](_0x2bad14,_0x0027('0x20'));_0x1dcbaa[_0x0027('0x25')]=_[_0x0027('0x26')](_0x1a40e1['query']);_0x1dcbaa['filters']=_['intersection'](_0x1dcbaa[_0x0027('0x23')],_0x1dcbaa[_0x0027('0x25')]);_0x4eef91[_0x0027('0x27')]=_[_0x0027('0x28')](_0x1dcbaa[_0x0027('0x23')],qs[_0x0027('0x29')](_0x1a40e1[_0x0027('0x25')]['fields']));_0x4eef91['attributes']=_0x4eef91[_0x0027('0x27')][_0x0027('0x2a')]?_0x4eef91[_0x0027('0x27')]:_0x1dcbaa[_0x0027('0x23')];if(!_0x1a40e1['query'][_0x0027('0x2b')]('nolimit')){_0x4eef91[_0x0027('0x19')]=qs[_0x0027('0x19')](_0x1a40e1[_0x0027('0x25')][_0x0027('0x19')]);_0x4eef91['offset']=qs[_0x0027('0x17')](_0x1a40e1[_0x0027('0x25')]['offset']);}_0x4eef91[_0x0027('0x2c')]=qs[_0x0027('0x2d')](_0x1a40e1[_0x0027('0x25')][_0x0027('0x2d')]);_0x4eef91[_0x0027('0x2e')]=qs[_0x0027('0x2f')](_['pick'](_0x1a40e1[_0x0027('0x25')],_0x1dcbaa[_0x0027('0x2f')]),_0x2bad14);if(_0x1a40e1[_0x0027('0x25')][_0x0027('0x30')]){_0x4eef91[_0x0027('0x2e')]=_[_0x0027('0x31')](_0x4eef91[_0x0027('0x2e')],{'$or':_[_0x0027('0x24')](_0x2bad14,function(_0x2a60c2){if(_0x2a60c2[_0x0027('0x32')]!==_0x0027('0x33')){var _0x4a89eb={};_0x4a89eb[_0x2a60c2[_0x0027('0x20')]]={'$like':'%'+_0x1a40e1['query'][_0x0027('0x30')]+'%'};return _0x4a89eb;}})});}_0x4eef91=_[_0x0027('0x31')]({},_0x4eef91,_0x1a40e1['options']);var _0x51ea45={'where':_0x4eef91[_0x0027('0x2e')]};return db[_0x0027('0x22')][_0x0027('0x18')](_0x51ea45)['then'](function(_0xa6b683){_0x3c546b[_0x0027('0x18')]=_0xa6b683;if(_0x1a40e1['query'][_0x0027('0x34')]){_0x4eef91['include']=[{'all':!![]}];}return db['Network'][_0x0027('0x35')](_0x4eef91);})[_0x0027('0xb')](function(_0x1e235d){_0x3c546b['rows']=_0x1e235d;return _0x3c546b;})[_0x0027('0xb')](respondWithFilteredResult(_0x4bbd51,_0x4eef91))[_0x0027('0x15')](handleError(_0x4bbd51,null));};exports[_0x0027('0x36')]=function(_0x258d95,_0x403439){var _0x2f47ac={'raw':!![],'where':{'id':_0x258d95[_0x0027('0x37')]['id']}},_0x4f218b={};_0x4f218b[_0x0027('0x23')]=_[_0x0027('0x26')](db['Network'][_0x0027('0x38')]);_0x4f218b[_0x0027('0x25')]=_[_0x0027('0x26')](_0x258d95[_0x0027('0x25')]);_0x4f218b[_0x0027('0x2f')]=_[_0x0027('0x28')](_0x4f218b[_0x0027('0x23')],_0x4f218b[_0x0027('0x25')]);_0x2f47ac[_0x0027('0x27')]=_['intersection'](_0x4f218b['model'],qs[_0x0027('0x29')](_0x258d95[_0x0027('0x25')][_0x0027('0x29')]));_0x2f47ac[_0x0027('0x27')]=_0x2f47ac[_0x0027('0x27')][_0x0027('0x2a')]?_0x2f47ac[_0x0027('0x27')]:_0x4f218b[_0x0027('0x23')];if(_0x258d95[_0x0027('0x25')][_0x0027('0x34')]){_0x2f47ac[_0x0027('0x39')]=[{'all':!![]}];}_0x2f47ac=_['merge']({},_0x2f47ac,_0x258d95[_0x0027('0x3a')]);return db['Network'][_0x0027('0x3b')](_0x2f47ac)[_0x0027('0xb')](handleEntityNotFound(_0x403439,null))[_0x0027('0xb')](respondWithResult(_0x403439,null))[_0x0027('0x15')](handleError(_0x403439,null));};exports[_0x0027('0x3c')]=function(_0x161ab9,_0x419b2f){var _0x339c24;return db[_0x0027('0x22')]['create'](_0x161ab9[_0x0027('0x3d')],{'raw':!![]})[_0x0027('0xb')](function(_0xd758bd){_0x339c24=_0xd758bd;return db['Network'][_0x0027('0x35')]({'where':{'type':_0x161ab9[_0x0027('0x3d')][_0x0027('0x32')]},'raw':!![]});})[_0x0027('0xb')](function(_0x374d6d){if(_0x339c24[_0x0027('0x32')]['toUpperCase']()==_0x0027('0x3e')){var _0x4ed06c=fs['readFileSync'](path[_0x0027('0x3f')](config['root'],_0x0027('0x40')),_0x0027('0x41'));var _0x33bd34=ejs['render'](_0x4ed06c,{'networks':_0x374d6d||[]});fs['writeFileSync'](_0x0027('0x42'),_0x33bd34);return respondWithRpcPromise(_0x0027('0x43'),'create',{'module':_0x0027('0x44')});}else if(_0x339c24[_0x0027('0x32')]['toUpperCase']()==_0x0027('0x45')){var _0x59f03a=fs[_0x0027('0x46')](path[_0x0027('0x3f')](config[_0x0027('0x47')],_0x0027('0x48')),_0x0027('0x41'));var _0xa25279=ejs[_0x0027('0x49')](_0x59f03a,{'networks':_0x374d6d||[]});fs[_0x0027('0x4a')](_0x0027('0x4b'),_0xa25279);return respondWithRpcPromise('Reload',_0x0027('0x3c'),{'module':_0x0027('0x44')});}else{var _0x3dbe55=fs[_0x0027('0x46')](path[_0x0027('0x3f')](config['root'],_0x0027('0x4c')),_0x0027('0x41'));var _0x437b7b=ejs['render'](_0x3dbe55,{'networks':_0x374d6d||[]});fs[_0x0027('0x4a')](util[_0x0027('0x4d')](_0x0027('0x4e'),_0x161ab9[_0x0027('0x3d')][_0x0027('0x32')][_0x0027('0x4f')]()),_0x437b7b);return respondWithRpcPromise(_0x0027('0x43'),_0x0027('0x3c'),{'module':_0x0027('0x50')});}})['then'](function(){return _0x339c24;})[_0x0027('0xb')](respondWithResult(_0x419b2f,0xc9))[_0x0027('0x15')](handleError(_0x419b2f,null));};exports[_0x0027('0x51')]=function(_0x28dc29,_0x2cc314){var _0x5016a1;return db[_0x0027('0x22')][_0x0027('0x3b')]({'where':{'id':_0x28dc29['params']['id']}})[_0x0027('0xb')](handleEntityNotFound(_0x2cc314,null))[_0x0027('0xb')](saveUpdates(_0x28dc29['body'],null))['then'](function(_0x3f23eb){if(_0x3f23eb){_0x5016a1=_0x3f23eb;return db[_0x0027('0x22')][_0x0027('0x35')]({'where':{'type':_0x5016a1['type']},'raw':!![]});}return null;})[_0x0027('0xb')](function(_0x139765){if(_0x5016a1['type'][_0x0027('0x52')]()=='STUN'){var _0x39b12=fs[_0x0027('0x46')](path[_0x0027('0x3f')](config[_0x0027('0x47')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x35104e=ejs['render'](_0x39b12,{'networks':_0x139765||[]});fs[_0x0027('0x4a')]('/etc/asterisk/stun_xcally.conf',_0x35104e);return respondWithRpcPromise(_0x0027('0x43'),_0x0027('0x51'),{'module':_0x0027('0x44')});}else if(_0x5016a1[_0x0027('0x32')][_0x0027('0x52')]()=='TURN'){var _0x47f396=fs[_0x0027('0x46')](path[_0x0027('0x3f')](config[_0x0027('0x47')],_0x0027('0x48')),_0x0027('0x41'));var _0x4ca3fc=ejs[_0x0027('0x49')](_0x47f396,{'networks':_0x139765||[]});fs[_0x0027('0x4a')](_0x0027('0x4b'),_0x4ca3fc);return respondWithRpcPromise(_0x0027('0x43'),_0x0027('0x51'),{'module':'res_stun_monitor.so'});}else{var _0x3c881b=fs[_0x0027('0x46')](path[_0x0027('0x3f')](config[_0x0027('0x47')],_0x0027('0x4c')),_0x0027('0x41'));var _0x2acc28=ejs[_0x0027('0x49')](_0x3c881b,{'networks':_0x139765||[]});fs[_0x0027('0x4a')](util[_0x0027('0x4d')](_0x0027('0x4e'),_0x28dc29[_0x0027('0x3d')]['type'][_0x0027('0x4f')]()),_0x2acc28);return respondWithRpcPromise(_0x0027('0x43'),'update',{'module':_0x0027('0x50')});}})['then'](function(_0x403bb6){if(_0x403bb6){return _0x5016a1;}return null;})[_0x0027('0xb')](respondWithResult(_0x2cc314,null))[_0x0027('0x15')](handleError(_0x2cc314,null));};exports[_0x0027('0x1d')]=function(_0x17f535,_0x46839b){var _0x41f6c3;return db[_0x0027('0x22')][_0x0027('0x3b')]({'where':{'id':_0x17f535[_0x0027('0x37')]['id']}})['then'](function(_0x5d31af){_0x41f6c3=_0x5d31af;return _0x5d31af;})['then'](handleEntityNotFound(_0x46839b,null))['then'](removeEntity(_0x46839b,null))['then'](function(){if(_0x41f6c3){return db['Network'][_0x0027('0x35')]({'where':{'type':_0x41f6c3[_0x0027('0x32')]},'raw':!![]});}})[_0x0027('0xb')](function(_0x2a9976){if(_0x41f6c3[_0x0027('0x32')][_0x0027('0x52')]()==_0x0027('0x3e')){var _0x44335c=fs[_0x0027('0x46')](path['join'](config[_0x0027('0x47')],_0x0027('0x40')),_0x0027('0x41'));var _0x30695a=ejs[_0x0027('0x49')](_0x44335c,{'networks':_0x2a9976||[]});fs['writeFileSync'](_0x0027('0x42'),_0x30695a);return respondWithRpcPromise(_0x0027('0x43'),'destroy',{'module':_0x0027('0x44')});}else if(_0x41f6c3[_0x0027('0x32')]['toUpperCase']()=='TURN'){var _0x2bab82=fs['readFileSync'](path[_0x0027('0x3f')](config['root'],_0x0027('0x48')),_0x0027('0x41'));var _0x425a5f=ejs['render'](_0x2bab82,{'networks':_0x2a9976||[]});fs['writeFileSync'](_0x0027('0x4b'),_0x425a5f);return respondWithRpcPromise(_0x0027('0x43'),_0x0027('0x1d'),{'module':_0x0027('0x44')});}else{var _0x71519a=fs[_0x0027('0x46')](path['join'](config[_0x0027('0x47')],_0x0027('0x4c')),_0x0027('0x41'));var _0x172b3d=ejs[_0x0027('0x49')](_0x71519a,{'networks':_0x2a9976||[]});fs['writeFileSync'](util[_0x0027('0x4d')](_0x0027('0x4e'),_0x41f6c3[_0x0027('0x32')][_0x0027('0x4f')]()),_0x172b3d);return respondWithRpcPromise(_0x0027('0x43'),'destroy',{'module':_0x0027('0x50')});}})[_0x0027('0x15')](handleError(_0x46839b,null));}; \ No newline at end of file +var _0x2fd7=['toUpperCase','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','readFileSync','server/files/templates/turn_multiple.ejs','res_stun_monitor.so','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','catch','find','params','/etc/asterisk/turn_xcally.conf','format','util','ejs','lodash','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','end','sendStatus','name','send','index','map','Network','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','rawAttributes','length','create','body'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x2fd7,0x1b0));var _0x72fd=function(_0x35ff61,_0x3e388a){_0x35ff61=_0x35ff61-0x0;var _0x4c02ab=_0x2fd7[_0x35ff61];return _0x4c02ab;};'use strict';var util=require(_0x72fd('0x0'));var path=require('path');var ejs=require(_0x72fd('0x1'));var fs=require('fs');var _=require(_0x72fd('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x72fd('0x3'))['db'];var jayson=require(_0x72fd('0x4'));var client=jayson[_0x72fd('0x5')][_0x72fd('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x662bd1,_0x16405e,_0x2457ec,_0x41a214){return new Promise(function(_0x427f9c,_0x7149ea){var _0x1c6e7e=_0x41a214||client;return _0x1c6e7e[_0x72fd('0x7')](_0x662bd1,_0x2457ec)[_0x72fd('0x8')](function(_0x3fb7a1){logger[_0x72fd('0x9')](_0x72fd('0xa'),_0x16405e,_0x72fd('0xb'));logger[_0x72fd('0xc')](_0x72fd('0xd'),_0x16405e,_0x72fd('0xb'),JSON[_0x72fd('0xe')](_0x3fb7a1));if(_0x3fb7a1['error']){if(_0x3fb7a1['error']['code']===0x1f4){logger[_0x72fd('0xf')]('Network,\x20%s,\x20%s',_0x16405e,_0x3fb7a1['error']['message']);return _0x7149ea(_0x3fb7a1[_0x72fd('0xf')][_0x72fd('0x10')]);}logger['error'](_0x72fd('0xa'),_0x16405e,_0x3fb7a1['error'][_0x72fd('0x10')]);return _0x427f9c(_0x3fb7a1[_0x72fd('0xf')]['message']);}else{logger[_0x72fd('0x9')]('Network,\x20%s,\x20%s',_0x16405e,_0x72fd('0xb'));_0x427f9c(_0x3fb7a1[_0x72fd('0x11')][_0x72fd('0x10')]);}})['catch'](function(_0x35eb5a){logger['error'](_0x72fd('0xa'),_0x16405e,_0x35eb5a);_0x7149ea(_0x35eb5a);});});}function respondWithResult(_0x5bfe94,_0x2c9b73){_0x2c9b73=_0x2c9b73||0xc8;return function(_0x195114){if(_0x195114){return _0x5bfe94[_0x72fd('0x12')](_0x2c9b73)[_0x72fd('0x13')](_0x195114);}};}function respondWithFilteredResult(_0x4a489a,_0x51dd9f){return function(_0x1eff33){if(_0x1eff33){var _0x353045=typeof _0x51dd9f['offset']===_0x72fd('0x14')&&typeof _0x51dd9f[_0x72fd('0x15')]===_0x72fd('0x14');var _0x37d2a6=_0x1eff33[_0x72fd('0x16')];var _0x44a7d9=_0x353045?0x0:_0x51dd9f['offset'];var _0x5f2409=_0x353045?_0x1eff33[_0x72fd('0x16')]:_0x51dd9f[_0x72fd('0x17')]+_0x51dd9f['limit'];var _0x45c1cd;if(_0x5f2409>=_0x37d2a6){_0x5f2409=_0x37d2a6;_0x45c1cd=0xc8;}else{_0x45c1cd=0xce;}_0x4a489a[_0x72fd('0x12')](_0x45c1cd);return _0x4a489a[_0x72fd('0x18')](_0x72fd('0x19'),_0x44a7d9+'-'+_0x5f2409+'/'+_0x37d2a6)[_0x72fd('0x13')](_0x1eff33);}return null;};}function saveUpdates(_0x14097f){return function(_0x7d5d75){if(_0x7d5d75){return _0x7d5d75[_0x72fd('0x1a')](_0x14097f)[_0x72fd('0x8')](function(_0x3d158f){return _0x3d158f;});}return null;};}function removeEntity(_0x2b3340){return function(_0xa93622){if(_0xa93622){return _0xa93622[_0x72fd('0x1b')]()[_0x72fd('0x8')](function(){_0x2b3340['status'](0xcc)[_0x72fd('0x1c')]();});}};}function handleEntityNotFound(_0x48f56d){return function(_0x53a19d){if(!_0x53a19d){_0x48f56d[_0x72fd('0x1d')](0x194);}return _0x53a19d;};}function handleError(_0x5b09f7,_0x254f1c){_0x254f1c=_0x254f1c||0x1f4;return function(_0x55172d){logger['error'](_0x55172d['stack']);if(_0x55172d['name']){delete _0x55172d[_0x72fd('0x1e')];}_0x5b09f7[_0x72fd('0x12')](_0x254f1c)[_0x72fd('0x1f')](_0x55172d);};}exports[_0x72fd('0x20')]=function(_0x1ca08a,_0xd7cd76){var _0x5d19e8={},_0xd27b13={},_0x2d9c60={'count':0x0,'rows':[]};var _0xa2e625=_[_0x72fd('0x21')](db[_0x72fd('0x22')]['rawAttributes'],function(_0x467a2c){return{'name':_0x467a2c[_0x72fd('0x23')],'type':_0x467a2c[_0x72fd('0x24')]['key']};});_0xd27b13[_0x72fd('0x25')]=_['map'](_0xa2e625,'name');_0xd27b13[_0x72fd('0x26')]=_[_0x72fd('0x27')](_0x1ca08a[_0x72fd('0x26')]);_0xd27b13['filters']=_[_0x72fd('0x28')](_0xd27b13[_0x72fd('0x25')],_0xd27b13[_0x72fd('0x26')]);_0x5d19e8[_0x72fd('0x29')]=_[_0x72fd('0x28')](_0xd27b13[_0x72fd('0x25')],qs['fields'](_0x1ca08a[_0x72fd('0x26')][_0x72fd('0x2a')]));_0x5d19e8[_0x72fd('0x29')]=_0x5d19e8[_0x72fd('0x29')]['length']?_0x5d19e8['attributes']:_0xd27b13['model'];if(!_0x1ca08a[_0x72fd('0x26')][_0x72fd('0x2b')]('nolimit')){_0x5d19e8['limit']=qs['limit'](_0x1ca08a[_0x72fd('0x26')][_0x72fd('0x15')]);_0x5d19e8['offset']=qs[_0x72fd('0x17')](_0x1ca08a[_0x72fd('0x26')]['offset']);}_0x5d19e8[_0x72fd('0x2c')]=qs[_0x72fd('0x2d')](_0x1ca08a[_0x72fd('0x26')][_0x72fd('0x2d')]);_0x5d19e8[_0x72fd('0x2e')]=qs[_0x72fd('0x2f')](_[_0x72fd('0x30')](_0x1ca08a[_0x72fd('0x26')],_0xd27b13['filters']),_0xa2e625);if(_0x1ca08a[_0x72fd('0x26')][_0x72fd('0x31')]){_0x5d19e8[_0x72fd('0x2e')]=_[_0x72fd('0x32')](_0x5d19e8[_0x72fd('0x2e')],{'$or':_['map'](_0xa2e625,function(_0x105aee){if(_0x105aee[_0x72fd('0x24')]!==_0x72fd('0x33')){var _0x58298c={};_0x58298c[_0x105aee[_0x72fd('0x1e')]]={'$like':'%'+_0x1ca08a[_0x72fd('0x26')][_0x72fd('0x31')]+'%'};return _0x58298c;}})});}_0x5d19e8=_[_0x72fd('0x32')]({},_0x5d19e8,_0x1ca08a[_0x72fd('0x34')]);var _0x513d06={'where':_0x5d19e8[_0x72fd('0x2e')]};return db[_0x72fd('0x22')][_0x72fd('0x16')](_0x513d06)[_0x72fd('0x8')](function(_0x222982){_0x2d9c60['count']=_0x222982;if(_0x1ca08a['query'][_0x72fd('0x35')]){_0x5d19e8['include']=[{'all':!![]}];}return db[_0x72fd('0x22')][_0x72fd('0x36')](_0x5d19e8);})[_0x72fd('0x8')](function(_0x36bcff){_0x2d9c60[_0x72fd('0x37')]=_0x36bcff;return _0x2d9c60;})[_0x72fd('0x8')](respondWithFilteredResult(_0xd7cd76,_0x5d19e8))['catch'](handleError(_0xd7cd76,null));};exports['show']=function(_0x11f8eb,_0x59c638){var _0x3dea49={'raw':!![],'where':{'id':_0x11f8eb['params']['id']}},_0x1bfa76={};_0x1bfa76[_0x72fd('0x25')]=_[_0x72fd('0x27')](db[_0x72fd('0x22')][_0x72fd('0x38')]);_0x1bfa76['query']=_[_0x72fd('0x27')](_0x11f8eb[_0x72fd('0x26')]);_0x1bfa76['filters']=_[_0x72fd('0x28')](_0x1bfa76[_0x72fd('0x25')],_0x1bfa76[_0x72fd('0x26')]);_0x3dea49[_0x72fd('0x29')]=_[_0x72fd('0x28')](_0x1bfa76['model'],qs['fields'](_0x11f8eb[_0x72fd('0x26')][_0x72fd('0x2a')]));_0x3dea49[_0x72fd('0x29')]=_0x3dea49[_0x72fd('0x29')][_0x72fd('0x39')]?_0x3dea49[_0x72fd('0x29')]:_0x1bfa76['model'];if(_0x11f8eb[_0x72fd('0x26')][_0x72fd('0x35')]){_0x3dea49['include']=[{'all':!![]}];}_0x3dea49=_[_0x72fd('0x32')]({},_0x3dea49,_0x11f8eb['options']);return db[_0x72fd('0x22')]['find'](_0x3dea49)['then'](handleEntityNotFound(_0x59c638,null))[_0x72fd('0x8')](respondWithResult(_0x59c638,null))['catch'](handleError(_0x59c638,null));};exports[_0x72fd('0x3a')]=function(_0x508a25,_0x5e1b94){var _0x94fe18;return db[_0x72fd('0x22')][_0x72fd('0x3a')](_0x508a25[_0x72fd('0x3b')],{'raw':!![]})[_0x72fd('0x8')](function(_0x36d468){_0x94fe18=_0x36d468;return db[_0x72fd('0x22')][_0x72fd('0x36')]({'where':{'type':_0x508a25[_0x72fd('0x3b')]['type']},'raw':!![]});})['then'](function(_0xc2a5b8){if(_0x94fe18[_0x72fd('0x24')][_0x72fd('0x3c')]()=='STUN'){var _0x5a7234=fs['readFileSync'](path[_0x72fd('0x3d')](config[_0x72fd('0x3e')],_0x72fd('0x3f')),_0x72fd('0x40'));var _0x32f3bc=ejs[_0x72fd('0x41')](_0x5a7234,{'networks':_0xc2a5b8||[]});fs[_0x72fd('0x42')](_0x72fd('0x43'),_0x32f3bc);return respondWithRpcPromise(_0x72fd('0x44'),'create',{'module':'res_stun_monitor.so'});}else if(_0x94fe18[_0x72fd('0x24')][_0x72fd('0x3c')]()==_0x72fd('0x45')){var _0x41799f=fs[_0x72fd('0x46')](path['join'](config[_0x72fd('0x3e')],_0x72fd('0x47')),_0x72fd('0x40'));var _0x44f000=ejs[_0x72fd('0x41')](_0x41799f,{'networks':_0xc2a5b8||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x44f000);return respondWithRpcPromise(_0x72fd('0x44'),'create',{'module':_0x72fd('0x48')});}else{var _0x1a5367=fs[_0x72fd('0x46')](path[_0x72fd('0x3d')](config[_0x72fd('0x3e')],_0x72fd('0x49')),_0x72fd('0x40'));var _0x417fe4=ejs['render'](_0x1a5367,{'networks':_0xc2a5b8||[]});fs['writeFileSync'](util['format'](_0x72fd('0x4a'),_0x508a25[_0x72fd('0x3b')][_0x72fd('0x24')][_0x72fd('0x4b')]()),_0x417fe4);return respondWithRpcPromise(_0x72fd('0x44'),_0x72fd('0x3a'),{'module':_0x72fd('0x4c')});}})[_0x72fd('0x8')](function(){return _0x94fe18;})[_0x72fd('0x8')](respondWithResult(_0x5e1b94,0xc9))[_0x72fd('0x4d')](handleError(_0x5e1b94,null));};exports['update']=function(_0xba5a71,_0x3d019a){var _0x26e19b;return db[_0x72fd('0x22')][_0x72fd('0x4e')]({'where':{'id':_0xba5a71[_0x72fd('0x4f')]['id']}})[_0x72fd('0x8')](handleEntityNotFound(_0x3d019a,null))[_0x72fd('0x8')](saveUpdates(_0xba5a71['body'],null))[_0x72fd('0x8')](function(_0x3666a9){if(_0x3666a9){_0x26e19b=_0x3666a9;return db['Network'][_0x72fd('0x36')]({'where':{'type':_0x26e19b[_0x72fd('0x24')]},'raw':!![]});}return null;})[_0x72fd('0x8')](function(_0x18d39d){if(_0x26e19b['type'][_0x72fd('0x3c')]()=='STUN'){var _0x544166=fs[_0x72fd('0x46')](path[_0x72fd('0x3d')](config[_0x72fd('0x3e')],'server/files/templates/stun_multiple.ejs'),_0x72fd('0x40'));var _0x16326d=ejs[_0x72fd('0x41')](_0x544166,{'networks':_0x18d39d||[]});fs[_0x72fd('0x42')](_0x72fd('0x43'),_0x16326d);return respondWithRpcPromise('Reload',_0x72fd('0x1a'),{'module':'res_stun_monitor.so'});}else if(_0x26e19b[_0x72fd('0x24')][_0x72fd('0x3c')]()==_0x72fd('0x45')){var _0x5f2d9e=fs[_0x72fd('0x46')](path['join'](config[_0x72fd('0x3e')],_0x72fd('0x47')),_0x72fd('0x40'));var _0x27a585=ejs[_0x72fd('0x41')](_0x5f2d9e,{'networks':_0x18d39d||[]});fs[_0x72fd('0x42')](_0x72fd('0x50'),_0x27a585);return respondWithRpcPromise('Reload',_0x72fd('0x1a'),{'module':_0x72fd('0x48')});}else{var _0x71d4a5=fs[_0x72fd('0x46')](path['join'](config['root'],_0x72fd('0x49')),_0x72fd('0x40'));var _0x416359=ejs[_0x72fd('0x41')](_0x71d4a5,{'networks':_0x18d39d||[]});fs[_0x72fd('0x42')](util[_0x72fd('0x51')](_0x72fd('0x4a'),_0xba5a71[_0x72fd('0x3b')][_0x72fd('0x24')]['toLowerCase']()),_0x416359);return respondWithRpcPromise('Reload','update',{'module':_0x72fd('0x4c')});}})['then'](function(_0x55f55b){if(_0x55f55b){return _0x26e19b;}return null;})[_0x72fd('0x8')](respondWithResult(_0x3d019a,null))[_0x72fd('0x4d')](handleError(_0x3d019a,null));};exports[_0x72fd('0x1b')]=function(_0x2f9653,_0xb78b5a){var _0x34da8f;return db[_0x72fd('0x22')]['find']({'where':{'id':_0x2f9653[_0x72fd('0x4f')]['id']}})[_0x72fd('0x8')](function(_0xb3a1f4){_0x34da8f=_0xb3a1f4;return _0xb3a1f4;})[_0x72fd('0x8')](handleEntityNotFound(_0xb78b5a,null))['then'](removeEntity(_0xb78b5a,null))[_0x72fd('0x8')](function(){if(_0x34da8f){return db['Network'][_0x72fd('0x36')]({'where':{'type':_0x34da8f['type']},'raw':!![]});}})[_0x72fd('0x8')](function(_0x5aa226){if(_0x34da8f[_0x72fd('0x24')][_0x72fd('0x3c')]()=='STUN'){var _0x20476b=fs[_0x72fd('0x46')](path['join'](config[_0x72fd('0x3e')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x1d4c8b=ejs[_0x72fd('0x41')](_0x20476b,{'networks':_0x5aa226||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x1d4c8b);return respondWithRpcPromise(_0x72fd('0x44'),_0x72fd('0x1b'),{'module':'res_stun_monitor.so'});}else if(_0x34da8f[_0x72fd('0x24')]['toUpperCase']()==_0x72fd('0x45')){var _0x1ba280=fs[_0x72fd('0x46')](path[_0x72fd('0x3d')](config['root'],_0x72fd('0x47')),_0x72fd('0x40'));var _0x4f3389=ejs[_0x72fd('0x41')](_0x1ba280,{'networks':_0x5aa226||[]});fs[_0x72fd('0x42')]('/etc/asterisk/turn_xcally.conf',_0x4f3389);return respondWithRpcPromise(_0x72fd('0x44'),_0x72fd('0x1b'),{'module':_0x72fd('0x48')});}else{var _0x46223c=fs[_0x72fd('0x46')](path[_0x72fd('0x3d')](config[_0x72fd('0x3e')],_0x72fd('0x49')),_0x72fd('0x40'));var _0x3649e2=ejs[_0x72fd('0x41')](_0x46223c,{'networks':_0x5aa226||[]});fs[_0x72fd('0x42')](util[_0x72fd('0x51')]('/etc/asterisk/sip_xcally_%s.conf',_0x34da8f[_0x72fd('0x24')][_0x72fd('0x4b')]()),_0x3649e2);return respondWithRpcPromise(_0x72fd('0x44'),'destroy',{'module':'chan_sip.so'});}})[_0x72fd('0x4d')](handleError(_0xb78b5a,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index de40b0b..ebcb742 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 _0x9434=['api','moment','bluebird','path','rimraf','./network.attributes','exports','network','lodash','util','../../config/logger'];(function(_0x1d2e4b,_0x3e2d3c){var _0x2d0701=function(_0x1a788e){while(--_0x1a788e){_0x1d2e4b['push'](_0x1d2e4b['shift']());}};_0x2d0701(++_0x3e2d3c);}(_0x9434,0x168));var _0x4943=function(_0x1d2bd8,_0x42fee0){_0x1d2bd8=_0x1d2bd8-0x0;var _0x1581fd=_0x9434[_0x1d2bd8];return _0x1581fd;};'use strict';var _=require(_0x4943('0x0'));var util=require(_0x4943('0x1'));var logger=require(_0x4943('0x2'))(_0x4943('0x3'));var moment=require(_0x4943('0x4'));var BPromise=require(_0x4943('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4943('0x6'));var rimraf=require(_0x4943('0x7'));var config=require('../../config/environment');var attributes=require(_0x4943('0x8'));module[_0x4943('0x9')]=function(_0x4f930e,_0x394d9d){return _0x4f930e['define']('Network',attributes,{'tableName':_0x4943('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x073e=['rimraf','../../config/environment','define','Network','network','lodash','util','../../config/logger','api','path'];(function(_0x1fcffc,_0x526d4e){var _0x1b69c6=function(_0x8e8d41){while(--_0x8e8d41){_0x1fcffc['push'](_0x1fcffc['shift']());}};_0x1b69c6(++_0x526d4e);}(_0x073e,0x181));var _0xe073=function(_0x2db0fa,_0x4c06c0){_0x2db0fa=_0x2db0fa-0x0;var _0x4f2b48=_0x073e[_0x2db0fa];return _0x4f2b48;};'use strict';var _=require(_0xe073('0x0'));var util=require(_0xe073('0x1'));var logger=require(_0xe073('0x2'))(_0xe073('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe073('0x4'));var rimraf=require(_0xe073('0x5'));var config=require(_0xe073('0x6'));var attributes=require('./network.attributes');module['exports']=function(_0x4bc6b3,_0x45995e){return _0x4bc6b3[_0xe073('0x7')](_0xe073('0x8'),attributes,{'tableName':_0xe073('0x9'),'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 d4f0a92..25d08f5 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 _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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x504c25,_0x288879){_0x504c25=_0x504c25-0x0;var _0x573ba3=_0x7a54[_0x504c25];return _0x573ba3;};'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 +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(_0x3c8cde,_0x3065d9){var _0x1b587e=function(_0x5e34f3){while(--_0x5e34f3){_0x3c8cde['push'](_0x3c8cde['shift']());}};_0x1b587e(++_0x3065d9);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index dda4d49..d41824e 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 _0x6bd4=['addApplications','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addAnswer','/:id/notify'];(function(_0x431b40,_0x59411a){var _0x6a007=function(_0x3cfedc){while(--_0x3cfedc){_0x431b40['push'](_0x431b40['shift']());}};_0x6a007(++_0x59411a);}(_0x6bd4,0x1b9));var _0x46bd=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6bd4[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x46bd('0x0'));var util=require(_0x46bd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x46bd('0x2'));var router=express[_0x46bd('0x3')]();var fs_extra=require(_0x46bd('0x4'));var auth=require(_0x46bd('0x5'));var interaction=require(_0x46bd('0x6'));var config=require('../../config/environment');var controller=require(_0x46bd('0x7'));router[_0x46bd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x46bd('0x8')](_0x46bd('0x9'),auth[_0x46bd('0xa')](),controller[_0x46bd('0xb')]);router[_0x46bd('0x8')](_0x46bd('0xc'),auth[_0x46bd('0xa')](),controller[_0x46bd('0xd')]);router[_0x46bd('0x8')](_0x46bd('0xe'),auth[_0x46bd('0xa')](),controller[_0x46bd('0xf')]);router[_0x46bd('0x8')](_0x46bd('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x46bd('0x8')](_0x46bd('0x11'),auth['isAuthenticated'](),controller[_0x46bd('0x12')]);router[_0x46bd('0x8')](_0x46bd('0x13'),auth[_0x46bd('0xa')](),controller[_0x46bd('0x14')]);router['get'](_0x46bd('0x15'),auth[_0x46bd('0xa')](),controller[_0x46bd('0x16')]);router[_0x46bd('0x17')]('/',auth['isAuthenticated'](),controller[_0x46bd('0x18')]);router[_0x46bd('0x17')](_0x46bd('0xe'),auth[_0x46bd('0xa')](),controller['addDisposition']);router[_0x46bd('0x17')](_0x46bd('0x10'),auth['isAuthenticated'](),controller[_0x46bd('0x19')]);router[_0x46bd('0x17')](_0x46bd('0x1a'),controller['notify']);router[_0x46bd('0x17')]('/:id/applications',auth[_0x46bd('0xa')](),controller[_0x46bd('0x1b')]);router[_0x46bd('0x17')](_0x46bd('0x15'),auth['isAuthenticated'](),controller[_0x46bd('0x1c')]);router[_0x46bd('0x17')](_0x46bd('0x1d'),auth[_0x46bd('0xa')](),controller[_0x46bd('0x1e')]);router[_0x46bd('0x1f')](_0x46bd('0xc'),auth['isAuthenticated'](),controller[_0x46bd('0x20')]);router[_0x46bd('0x21')](_0x46bd('0xc'),auth['isAuthenticated'](),controller[_0x46bd('0x22')]);router[_0x46bd('0x21')]('/:id/dispositions',auth[_0x46bd('0xa')](),controller[_0x46bd('0x23')]);router[_0x46bd('0x21')](_0x46bd('0x10'),auth[_0x46bd('0xa')](),controller[_0x46bd('0x24')]);router[_0x46bd('0x21')]('/:id/users',auth[_0x46bd('0xa')](),controller[_0x46bd('0x25')]);module[_0x46bd('0x26')]=router; \ No newline at end of file +var _0x5f60=['addApplications','/:id/users','addAgents','/:id/send','send','put','delete','destroy','removeAnswers','removeAgents','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','create','post','addAnswer','notify'];(function(_0x49852d,_0x56ed57){var _0x552388=function(_0x185718){while(--_0x185718){_0x49852d['push'](_0x49852d['shift']());}};_0x552388(++_0x56ed57);}(_0x5f60,0xbe));var _0x05f6=function(_0x2c93e2,_0x4fb5e2){_0x2c93e2=_0x2c93e2-0x0;var _0x57264e=_0x5f60[_0x2c93e2];return _0x57264e;};'use strict';var multer=require(_0x05f6('0x0'));var util=require(_0x05f6('0x1'));var path=require(_0x05f6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x05f6('0x3'));var auth=require(_0x05f6('0x4'));var interaction=require(_0x05f6('0x5'));var config=require(_0x05f6('0x6'));var controller=require(_0x05f6('0x7'));router[_0x05f6('0x8')]('/',auth[_0x05f6('0x9')](),controller[_0x05f6('0xa')]);router[_0x05f6('0x8')](_0x05f6('0xb'),auth[_0x05f6('0x9')](),controller['describe']);router['get'](_0x05f6('0xc'),auth[_0x05f6('0x9')](),controller[_0x05f6('0xd')]);router[_0x05f6('0x8')](_0x05f6('0xe'),auth[_0x05f6('0x9')](),controller['getDispositions']);router['get'](_0x05f6('0xf'),auth[_0x05f6('0x9')](),controller[_0x05f6('0x10')]);router['get'](_0x05f6('0x11'),auth[_0x05f6('0x9')](),controller[_0x05f6('0x12')]);router[_0x05f6('0x8')](_0x05f6('0x13'),auth['isAuthenticated'](),controller[_0x05f6('0x14')]);router['get']('/:id/users',auth[_0x05f6('0x9')](),controller[_0x05f6('0x15')]);router['post']('/',auth[_0x05f6('0x9')](),controller[_0x05f6('0x16')]);router[_0x05f6('0x17')](_0x05f6('0xe'),auth[_0x05f6('0x9')](),controller['addDisposition']);router[_0x05f6('0x17')](_0x05f6('0xf'),auth[_0x05f6('0x9')](),controller[_0x05f6('0x18')]);router['post']('/:id/notify',controller[_0x05f6('0x19')]);router[_0x05f6('0x17')]('/:id/applications',auth[_0x05f6('0x9')](),controller[_0x05f6('0x1a')]);router[_0x05f6('0x17')](_0x05f6('0x1b'),auth[_0x05f6('0x9')](),controller[_0x05f6('0x1c')]);router[_0x05f6('0x17')](_0x05f6('0x1d'),auth[_0x05f6('0x9')](),controller[_0x05f6('0x1e')]);router[_0x05f6('0x1f')](_0x05f6('0xc'),auth[_0x05f6('0x9')](),controller['update']);router[_0x05f6('0x20')](_0x05f6('0xc'),auth[_0x05f6('0x9')](),controller[_0x05f6('0x21')]);router[_0x05f6('0x20')]('/:id/dispositions',auth[_0x05f6('0x9')](),controller['removeDispositions']);router[_0x05f6('0x20')]('/:id/canned_answers',auth[_0x05f6('0x9')](),controller[_0x05f6('0x22')]);router[_0x05f6('0x20')]('/:id/users',auth[_0x05f6('0x9')](),controller[_0x05f6('0x23')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 63e8030..a03f5e2 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 _0x3c26=['TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate'];(function(_0x27baa5,_0x1f5ddf){var _0x467edc=function(_0x49f7d2){while(--_0x49f7d2){_0x27baa5['push'](_0x27baa5['shift']());}};_0x467edc(++_0x1f5ddf);}(_0x3c26,0x10c));var _0x63c2=function(_0x3a5412,_0x1a4b98){_0x3a5412=_0x3a5412-0x0;var _0x56b238=_0x3c26[_0x3a5412];return _0x56b238;};'use strict';var Sequelize=require(_0x63c2('0x0'));var rs=require(_0x63c2('0x1'));module[_0x63c2('0x2')]={'name':{'type':Sequelize[_0x63c2('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x63c2('0x3')]},'token':{'type':Sequelize[_0x63c2('0x3')],'defaultValue':function(){return rs[_0x63c2('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x63c2('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x63c2('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x63c2('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x63c2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x63c2('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x63c2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x63c2('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x63c2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x63c2('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x63c2('0x6')],'defaultValue':![],'comment':_0x63c2('0x9'),'set':function(_0x5e4344){if(!_0x5e4344)this[_0x63c2('0xa')](_0x63c2('0xb'),null);this[_0x63c2('0xa')](_0x63c2('0xc'),_0x5e4344);}}}; \ No newline at end of file +var _0x7d05=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','TEXT'];(function(_0x33377c,_0x13a2fa){var _0x3cc735=function(_0x40cf97){while(--_0x40cf97){_0x33377c['push'](_0x33377c['shift']());}};_0x3cc735(++_0x13a2fa);}(_0x7d05,0xe8));var _0x57d0=function(_0x829c5c,_0x5515bc){_0x829c5c=_0x829c5c-0x0;var _0x280f4f=_0x7d05[_0x829c5c];return _0x280f4f;};'use strict';var Sequelize=require(_0x57d0('0x0'));var rs=require(_0x57d0('0x1'));module[_0x57d0('0x2')]={'name':{'type':Sequelize[_0x57d0('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x57d0('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x57d0('0x4')]();}},'replyUri':{'type':Sequelize[_0x57d0('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x57d0('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x57d0('0x5')],'defaultValue':function(){return _0x57d0('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x57d0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x57d0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x57d0('0x3')]},'queueTransfer':{'type':Sequelize[_0x57d0('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x57d0('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x57d0('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x57d0('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x57d0('0x8')],'defaultValue':![],'comment':_0x57d0('0xa'),'set':function(_0x173808){if(!_0x173808)this[_0x57d0('0xb')](_0x57d0('0xc'),null);this[_0x57d0('0xb')](_0x57d0('0xd'),_0x173808);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 55f52c1..270a06e 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 _0x3a4a=['waitForTheAssignedQueue','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','spread','userOpenchannelAccount:save','removeAgents','emit','userOpenchannelAccount:remove','getAgents','Contacts','out','Messages','dataValues','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','reject','save','update','destroy','get','UserProfileResource','then','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','type','key','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','OpenchannelAccount','includeAll','include','rows','options','find','create','body','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','isNil','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','OpenchannelApplication','Applications','account','applications','list','List','orderBy','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','created','push','OpenchannelMessage','UserId','User','interaction','unshift','waitForTheAssignedAgent','*,*,*,*','OpenchannelQueue','queue'];(function(_0x3c0ada,_0x533995){var _0x55fc93=function(_0x5b8bb6){while(--_0x5b8bb6){_0x3c0ada['push'](_0x3c0ada['shift']());}};_0x55fc93(++_0x533995);}(_0x3a4a,0xe6));var _0xa3a4=function(_0x239875,_0x52a793){_0x239875=_0x239875-0x0;var _0x55a8d6=_0x3a4a[_0x239875];return _0x55a8d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa3a4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa3a4('0x1'));var rp=require(_0xa3a4('0x2'));var moment=require(_0xa3a4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa3a4('0x4'));var util=require(_0xa3a4('0x5'));var path=require(_0xa3a4('0x6'));var sox=require(_0xa3a4('0x7'));var csv=require(_0xa3a4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa3a4('0x9'));var _=require(_0xa3a4('0xa'));var squel=require('squel');var crypto=require(_0xa3a4('0xb'));var jsforce=require(_0xa3a4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa3a4('0x8'));var querystring=require(_0xa3a4('0xd'));var Papa=require('papaparse');var Redis=require(_0xa3a4('0xe'));var authService=require(_0xa3a4('0xf'));var qs=require(_0xa3a4('0x10'));var as=require(_0xa3a4('0x11'));var hardwareService=require(_0xa3a4('0x12'));var logger=require(_0xa3a4('0x13'))(_0xa3a4('0x14'));var utils=require('../../config/utils');var config=require(_0xa3a4('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa3a4('0x16')]=_[_0xa3a4('0x17')](config[_0xa3a4('0x16')],{'host':_0xa3a4('0x18'),'port':0x18eb});var socket=require(_0xa3a4('0x19'))(new Redis(config['redis']));require(_0xa3a4('0x1a'))[_0xa3a4('0x1b')](socket);var jayson=require(_0xa3a4('0x1c'));var client=jayson[_0xa3a4('0x1d')][_0xa3a4('0x1e')]({'port':0x232c});var client9002=jayson[_0xa3a4('0x1d')][_0xa3a4('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x40e4cb,_0x4b1d5b,_0x4f42b8,_0x1ff220){return new BPromise(function(_0x595c8f,_0x3978e0){var _0x4da56f=_0x1ff220||client;return _0x4da56f['request'](_0x40e4cb,_0x4f42b8)['then'](function(_0x530e8b){logger[_0xa3a4('0x1f')](_0xa3a4('0x20'),_0x4b1d5b,_0xa3a4('0x21'));logger[_0xa3a4('0x22')](_0xa3a4('0x23'),_0x4b1d5b,'request\x20sent',JSON[_0xa3a4('0x24')](_0x530e8b));if(_0x530e8b['error']){if(_0x530e8b['error'][_0xa3a4('0x25')]===0x1f4){logger[_0xa3a4('0x26')](_0xa3a4('0x20'),_0x4b1d5b,_0x530e8b[_0xa3a4('0x26')][_0xa3a4('0x27')]);return _0x3978e0(_0x530e8b[_0xa3a4('0x26')]['message']);}logger['error'](_0xa3a4('0x20'),_0x4b1d5b,_0x530e8b['error']['message']);return _0x595c8f(_0x530e8b['error'][_0xa3a4('0x27')]);}else{logger[_0xa3a4('0x1f')](_0xa3a4('0x20'),_0x4b1d5b,'request\x20sent');_0x595c8f(_0x530e8b[_0xa3a4('0x28')]['message']);}})[_0xa3a4('0x29')](function(_0x1a6d98){logger[_0xa3a4('0x26')](_0xa3a4('0x20'),_0x4b1d5b,_0x1a6d98);_0x3978e0(_0x1a6d98);});});}function respondWithStatusCode(_0xbee73d,_0x182be7){_0x182be7=_0x182be7||0xcc;return function(_0x560b09){if(_0x560b09){return _0xbee73d[_0xa3a4('0x2a')](_0x182be7);}return _0xbee73d[_0xa3a4('0x2b')](_0x182be7)[_0xa3a4('0x2c')]();};}function respondWithResult(_0x53dd3f,_0x47da23){_0x47da23=_0x47da23||0xc8;return function(_0x43efd9){if(_0x43efd9){return _0x53dd3f[_0xa3a4('0x2b')](_0x47da23)['json'](_0x43efd9);}};}function respondWithFilteredResult(_0x461700,_0x5c4df0){return function(_0x3aa2fb){if(_0x3aa2fb){var _0x3783cd=typeof _0x5c4df0[_0xa3a4('0x2d')]===_0xa3a4('0x2e')&&typeof _0x5c4df0['limit']===_0xa3a4('0x2e');var _0x262431=_0x3aa2fb[_0xa3a4('0x2f')];var _0x4d766b=_0x3783cd?0x0:_0x5c4df0[_0xa3a4('0x2d')];var _0x3bd3e0=_0x3783cd?_0x3aa2fb[_0xa3a4('0x2f')]:_0x5c4df0[_0xa3a4('0x2d')]+_0x5c4df0[_0xa3a4('0x30')];var _0x4c354a;if(_0x3bd3e0>=_0x262431){_0x3bd3e0=_0x262431;_0x4c354a=0xc8;}else{_0x4c354a=0xce;}_0x461700[_0xa3a4('0x2b')](_0x4c354a);return _0x461700['set'](_0xa3a4('0x31'),_0x4d766b+'-'+_0x3bd3e0+'/'+_0x262431)[_0xa3a4('0x32')](_0x3aa2fb);}return null;};}function patchUpdates(_0x29df39){return function(_0xb19d94){try{jsonpatch['apply'](_0xb19d94,_0x29df39,!![]);}catch(_0x325635){return BPromise[_0xa3a4('0x33')](_0x325635);}return _0xb19d94[_0xa3a4('0x34')]();};}function saveUpdates(_0x103744,_0x5ee4ef){return function(_0x4bc5f1){if(_0x4bc5f1){return _0x4bc5f1[_0xa3a4('0x35')](_0x103744)['then'](function(_0x2a7a75){return _0x2a7a75;});}return null;};}function removeEntity(_0x455ba9,_0x1102b7){return function(_0x3c404f){if(_0x3c404f){return _0x3c404f[_0xa3a4('0x36')]()['then'](function(){var _0x295283=_0x3c404f[_0xa3a4('0x37')]({'plain':!![]});var _0x36350f='OpenchannelAccounts';return db[_0xa3a4('0x38')][_0xa3a4('0x36')]({'where':{'type':_0x36350f,'resourceId':_0x295283['id']}})[_0xa3a4('0x39')](function(){return _0x3c404f;});})[_0xa3a4('0x39')](function(){_0x455ba9[_0xa3a4('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41c7d5,_0x5cf927){return function(_0x5eba61){if(!_0x5eba61){_0x41c7d5[_0xa3a4('0x2a')](0x194);}return _0x5eba61;};}function handleError(_0xb90902,_0x4a3378){_0x4a3378=_0x4a3378||0x1f4;return function(_0x397e27){logger[_0xa3a4('0x26')](_0x397e27['stack']);if(_0x397e27['name']){delete _0x397e27[_0xa3a4('0x3a')];}_0xb90902[_0xa3a4('0x2b')](_0x4a3378)[_0xa3a4('0x3b')](_0x397e27);};}exports[_0xa3a4('0x3c')]=function(_0x3b4074,_0x1bd297){var _0x303991={'include':[{'model':db[_0xa3a4('0x3d')],'as':_0xa3a4('0x3e')}]},_0xadddaa={},_0x5c0a20={'count':0x0,'rows':[]};var _0x9e7644=_['map'](db['OpenchannelAccount'][_0xa3a4('0x3f')],function(_0x31537c){return{'name':_0x31537c['fieldName'],'type':_0x31537c[_0xa3a4('0x40')][_0xa3a4('0x41')]};});_0xadddaa[_0xa3a4('0x42')]=_[_0xa3a4('0x43')](_0x9e7644,_0xa3a4('0x3a'));_0xadddaa['query']=_[_0xa3a4('0x44')](_0x3b4074['query']);_0xadddaa[_0xa3a4('0x45')]=_['intersection'](_0xadddaa[_0xa3a4('0x42')],_0xadddaa[_0xa3a4('0x46')]);_0x303991[_0xa3a4('0x47')]=_[_0xa3a4('0x48')](_0xadddaa[_0xa3a4('0x42')],qs['fields'](_0x3b4074['query'][_0xa3a4('0x49')]));_0x303991[_0xa3a4('0x47')]=_0x303991['attributes'][_0xa3a4('0x4a')]?_0x303991[_0xa3a4('0x47')]:_0xadddaa[_0xa3a4('0x42')];if(!_0x3b4074[_0xa3a4('0x46')][_0xa3a4('0x4b')](_0xa3a4('0x4c'))){_0x303991[_0xa3a4('0x30')]=qs[_0xa3a4('0x30')](_0x3b4074[_0xa3a4('0x46')][_0xa3a4('0x30')]);_0x303991['offset']=qs[_0xa3a4('0x2d')](_0x3b4074[_0xa3a4('0x46')][_0xa3a4('0x2d')]);}_0x303991[_0xa3a4('0x4d')]=qs['sort'](_0x3b4074[_0xa3a4('0x46')][_0xa3a4('0x4e')]);_0x303991[_0xa3a4('0x4f')]=qs['filters'](_[_0xa3a4('0x50')](_0x3b4074[_0xa3a4('0x46')],_0xadddaa[_0xa3a4('0x45')]),_0x9e7644);if(_0x3b4074[_0xa3a4('0x46')][_0xa3a4('0x51')]){_0x303991['where']=_[_0xa3a4('0x52')](_0x303991['where'],{'$or':_['map'](_0x9e7644,function(_0x46717d){if(_0x46717d[_0xa3a4('0x40')]!==_0xa3a4('0x53')){var _0x34ed06={};_0x34ed06[_0x46717d['name']]={'$like':'%'+_0x3b4074[_0xa3a4('0x46')][_0xa3a4('0x51')]+'%'};return _0x34ed06;}})});}_0x303991=_[_0xa3a4('0x52')]({},_0x303991,_0x3b4074['options']);var _0x842330={'where':_0x303991[_0xa3a4('0x4f')]};return db[_0xa3a4('0x54')][_0xa3a4('0x2f')](_0x842330)[_0xa3a4('0x39')](function(_0x4f13ab){_0x5c0a20[_0xa3a4('0x2f')]=_0x4f13ab;if(_0x3b4074['query'][_0xa3a4('0x55')]){_0x303991[_0xa3a4('0x56')]=[{'all':!![]}];}return db[_0xa3a4('0x54')]['findAll'](_0x303991);})[_0xa3a4('0x39')](function(_0x3cbbf2){_0x5c0a20[_0xa3a4('0x57')]=_0x3cbbf2;return _0x5c0a20;})[_0xa3a4('0x39')](respondWithFilteredResult(_0x1bd297,_0x303991))['catch'](handleError(_0x1bd297,null));};exports['show']=function(_0x3c59df,_0x3e896a){var _0x34642f={'raw':![],'where':{'id':_0x3c59df['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5bfaa1={};_0x5bfaa1['model']=_[_0xa3a4('0x44')](db[_0xa3a4('0x54')][_0xa3a4('0x3f')]);_0x5bfaa1[_0xa3a4('0x46')]=_[_0xa3a4('0x44')](_0x3c59df[_0xa3a4('0x46')]);_0x5bfaa1[_0xa3a4('0x45')]=_[_0xa3a4('0x48')](_0x5bfaa1[_0xa3a4('0x42')],_0x5bfaa1['query']);_0x34642f[_0xa3a4('0x47')]=_[_0xa3a4('0x48')](_0x5bfaa1[_0xa3a4('0x42')],qs[_0xa3a4('0x49')](_0x3c59df[_0xa3a4('0x46')]['fields']));_0x34642f['attributes']=_0x34642f[_0xa3a4('0x47')][_0xa3a4('0x4a')]?_0x34642f[_0xa3a4('0x47')]:_0x5bfaa1['model'];if(_0x3c59df['query'][_0xa3a4('0x55')]){_0x34642f[_0xa3a4('0x56')]=[{'all':!![]}];}_0x34642f=_[_0xa3a4('0x52')]({},_0x34642f,_0x3c59df[_0xa3a4('0x58')]);return db[_0xa3a4('0x54')][_0xa3a4('0x59')](_0x34642f)[_0xa3a4('0x39')](handleEntityNotFound(_0x3e896a,null))[_0xa3a4('0x39')](respondWithResult(_0x3e896a,null))['catch'](handleError(_0x3e896a,null));};exports['create']=function(_0x67e4d5,_0x323bca){return db[_0xa3a4('0x54')][_0xa3a4('0x5a')](_0x67e4d5[_0xa3a4('0x5b')],{})[_0xa3a4('0x39')](function(_0x1691b3){var _0x13114d=_0x67e4d5['user'][_0xa3a4('0x37')]({'plain':!![]});if(!_0x13114d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13114d[_0xa3a4('0x5c')]===_0xa3a4('0x5d')){var _0x2b0ede=_0x1691b3['get']({'plain':!![]});var _0x201038='OpenchannelAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x201038,'userProfileId':_0x13114d[_0xa3a4('0x5e')]},'raw':!![]})[_0xa3a4('0x39')](function(_0x18079b){if(_0x18079b&&_0x18079b[_0xa3a4('0x5f')]===0x0){return db['UserProfileResource']['create']({'name':_0x2b0ede[_0xa3a4('0x3a')],'resourceId':_0x2b0ede['id'],'type':_0x18079b[_0xa3a4('0x3a')],'sectionId':_0x18079b['id']},{})[_0xa3a4('0x39')](function(){return _0x1691b3;});}else{return _0x1691b3;}})['catch'](function(_0x138842){logger[_0xa3a4('0x26')](_0xa3a4('0x60'),_0x138842);throw _0x138842;});}return _0x1691b3;})[_0xa3a4('0x39')](respondWithResult(_0x323bca,0xc9))[_0xa3a4('0x29')](handleError(_0x323bca,null));};exports[_0xa3a4('0x35')]=function(_0x291c9f,_0x16bb9a){if(_0x291c9f['body']['id']){delete _0x291c9f[_0xa3a4('0x5b')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x291c9f['params']['id']},'include':[{'model':db[_0xa3a4('0x3d')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x16bb9a,null))[_0xa3a4('0x39')](saveUpdates(_0x291c9f['body'],null))[_0xa3a4('0x39')](respondWithResult(_0x16bb9a,null))[_0xa3a4('0x29')](handleError(_0x16bb9a,null));};exports['destroy']=function(_0x4c999b,_0x54149f){return db['OpenchannelAccount']['find']({'where':{'id':_0x4c999b[_0xa3a4('0x61')]['id']}})['then'](handleEntityNotFound(_0x54149f,null))[_0xa3a4('0x39')](removeEntity(_0x54149f,null))[_0xa3a4('0x29')](handleError(_0x54149f,null));};exports['describe']=function(_0x4adde5,_0xc2f687){return db['OpenchannelAccount'][_0xa3a4('0x62')]()[_0xa3a4('0x39')](respondWithResult(_0xc2f687,null))[_0xa3a4('0x29')](handleError(_0xc2f687,null));};exports[_0xa3a4('0x63')]=function(_0x648259,_0x7453c4,_0x2eb3bc){if(_0x648259[_0xa3a4('0x5b')]['id']){delete _0x648259['body']['id'];}return db['OpenchannelAccount'][_0xa3a4('0x59')]({'where':{'id':_0x648259[_0xa3a4('0x61')]['id']}})['then'](handleEntityNotFound(_0x7453c4,null))['then'](function(_0x16b999){if(_0x16b999){_0x648259[_0xa3a4('0x5b')][_0xa3a4('0x64')]=_0x16b999['id'];return db[_0xa3a4('0x65')][_0xa3a4('0x5a')](_0x648259[_0xa3a4('0x5b')]);}})[_0xa3a4('0x39')](respondWithResult(_0x7453c4,null))['catch'](handleError(_0x7453c4,null));};exports[_0xa3a4('0x66')]=function(_0x367052,_0x501217,_0xe9302f){var _0x3b8757={'raw':![],'where':{}};var _0x14cde6={};var _0x3a2e87={'count':0x0,'rows':[]};return db[_0xa3a4('0x54')][_0xa3a4('0x67')]({'where':{'id':_0x367052[_0xa3a4('0x61')]['id']}})[_0xa3a4('0x39')](handleEntityNotFound(_0x501217,null))[_0xa3a4('0x39')](function(_0x3cc8e1){if(_0x3cc8e1){_0x14cde6[_0xa3a4('0x42')]=_['keys'](db[_0xa3a4('0x65')][_0xa3a4('0x3f')]);_0x14cde6[_0xa3a4('0x46')]=_[_0xa3a4('0x44')](_0x367052[_0xa3a4('0x46')]);_0x14cde6[_0xa3a4('0x45')]=_[_0xa3a4('0x48')](_0x14cde6[_0xa3a4('0x42')],_0x14cde6[_0xa3a4('0x46')]);_0x3b8757[_0xa3a4('0x47')]=_[_0xa3a4('0x48')](_0x14cde6[_0xa3a4('0x42')],qs[_0xa3a4('0x49')](_0x367052[_0xa3a4('0x46')][_0xa3a4('0x49')]));_0x3b8757[_0xa3a4('0x47')]=_0x3b8757['attributes'][_0xa3a4('0x4a')]?_0x3b8757['attributes']:_0x14cde6[_0xa3a4('0x42')];if(!_0x367052[_0xa3a4('0x46')][_0xa3a4('0x4b')]('nolimit')){_0x3b8757[_0xa3a4('0x30')]=qs['limit'](_0x367052[_0xa3a4('0x46')][_0xa3a4('0x30')]);_0x3b8757[_0xa3a4('0x2d')]=qs[_0xa3a4('0x2d')](_0x367052['query']['offset']);}_0x3b8757[_0xa3a4('0x4d')]=qs[_0xa3a4('0x4e')](_0x367052[_0xa3a4('0x46')][_0xa3a4('0x4e')]);_0x3b8757[_0xa3a4('0x4f')]=qs['filters'](_[_0xa3a4('0x50')](_0x367052[_0xa3a4('0x46')],_0x14cde6[_0xa3a4('0x45')]));_0x3b8757[_0xa3a4('0x4f')]['OpenchannelAccountId']=_0x3cc8e1['id'];if(_0x367052[_0xa3a4('0x46')][_0xa3a4('0x51')]){_0x3b8757['where']=_['merge'](_0x3b8757[_0xa3a4('0x4f')],{'$or':_['map'](_0x3b8757[_0xa3a4('0x47')],function(_0x145c3d){var _0x574635={};_0x574635[_0x145c3d]={'$like':'%'+_0x367052[_0xa3a4('0x46')][_0xa3a4('0x51')]+'%'};return _0x574635;})});}_0x3b8757=_['merge']({},_0x3b8757,_0x367052[_0xa3a4('0x58')]);return db[_0xa3a4('0x65')]['count']({'where':_0x3b8757[_0xa3a4('0x4f')]})[_0xa3a4('0x39')](function(_0x315278){_0x3a2e87[_0xa3a4('0x2f')]=_0x315278;if(_0x367052[_0xa3a4('0x46')][_0xa3a4('0x55')]){_0x3b8757[_0xa3a4('0x56')]=[{'all':!![]}];}return db[_0xa3a4('0x65')][_0xa3a4('0x68')](_0x3b8757);})[_0xa3a4('0x39')](function(_0x26d48f){_0x3a2e87['rows']=_0x26d48f;return _0x3a2e87;});}})[_0xa3a4('0x39')](respondWithFilteredResult(_0x501217,_0x3b8757))['catch'](handleError(_0x501217,null));};exports[_0xa3a4('0x69')]=function(_0x4d9a11,_0x505c92,_0x240ca3){return db[_0xa3a4('0x54')][_0xa3a4('0x59')]({'where':{'id':_0x4d9a11[_0xa3a4('0x61')]['id']}})[_0xa3a4('0x39')](handleEntityNotFound(_0x505c92,null))[_0xa3a4('0x39')](function(_0x4c5ddf){if(_0x4c5ddf){return _0x4c5ddf[_0xa3a4('0x69')](_0x4d9a11[_0xa3a4('0x46')][_0xa3a4('0x6a')]);}})['then'](respondWithStatusCode(_0x505c92,null))['catch'](handleError(_0x505c92,null));};exports[_0xa3a4('0x6b')]=function(_0x33f750,_0x376979,_0x23f9d4){if(_0x33f750[_0xa3a4('0x5b')]['id']){delete _0x33f750['body']['id'];}return db[_0xa3a4('0x54')][_0xa3a4('0x59')]({'where':{'id':_0x33f750[_0xa3a4('0x61')]['id']}})[_0xa3a4('0x39')](handleEntityNotFound(_0x376979,null))[_0xa3a4('0x39')](function(_0xbd27f9){if(_0xbd27f9){_0x33f750[_0xa3a4('0x5b')][_0xa3a4('0x64')]=_0xbd27f9['id'];return db['CannedAnswer'][_0xa3a4('0x5a')](_0x33f750[_0xa3a4('0x5b')]);}})['then'](respondWithResult(_0x376979,null))[_0xa3a4('0x29')](handleError(_0x376979,null));};exports[_0xa3a4('0x6c')]=function(_0x70aece,_0x2e57db,_0x3ccfa7){var _0x19f4b2={'raw':![],'where':{}};var _0x7df663={};var _0x3d1248={'count':0x0,'rows':[]};return db[_0xa3a4('0x54')][_0xa3a4('0x67')]({'where':{'id':_0x70aece[_0xa3a4('0x61')]['id']}})[_0xa3a4('0x39')](handleEntityNotFound(_0x2e57db,null))[_0xa3a4('0x39')](function(_0xd19237){if(_0xd19237){_0x7df663['model']=_[_0xa3a4('0x44')](db[_0xa3a4('0x6d')][_0xa3a4('0x3f')]);_0x7df663['query']=_['keys'](_0x70aece[_0xa3a4('0x46')]);_0x7df663[_0xa3a4('0x45')]=_[_0xa3a4('0x48')](_0x7df663[_0xa3a4('0x42')],_0x7df663[_0xa3a4('0x46')]);_0x19f4b2[_0xa3a4('0x47')]=_['intersection'](_0x7df663[_0xa3a4('0x42')],qs[_0xa3a4('0x49')](_0x70aece[_0xa3a4('0x46')][_0xa3a4('0x49')]));_0x19f4b2['attributes']=_0x19f4b2[_0xa3a4('0x47')][_0xa3a4('0x4a')]?_0x19f4b2[_0xa3a4('0x47')]:_0x7df663[_0xa3a4('0x42')];if(!_0x70aece[_0xa3a4('0x46')]['hasOwnProperty']('nolimit')){_0x19f4b2[_0xa3a4('0x30')]=qs[_0xa3a4('0x30')](_0x70aece['query'][_0xa3a4('0x30')]);_0x19f4b2[_0xa3a4('0x2d')]=qs[_0xa3a4('0x2d')](_0x70aece['query'][_0xa3a4('0x2d')]);}_0x19f4b2[_0xa3a4('0x4d')]=qs[_0xa3a4('0x4e')](_0x70aece[_0xa3a4('0x46')][_0xa3a4('0x4e')]);_0x19f4b2['where']=qs[_0xa3a4('0x45')](_['pick'](_0x70aece[_0xa3a4('0x46')],_0x7df663[_0xa3a4('0x45')]));_0x19f4b2[_0xa3a4('0x4f')][_0xa3a4('0x64')]=_0xd19237['id'];if(_0x70aece[_0xa3a4('0x46')][_0xa3a4('0x51')]){_0x19f4b2['where']=_[_0xa3a4('0x52')](_0x19f4b2[_0xa3a4('0x4f')],{'$or':_['map'](_0x19f4b2[_0xa3a4('0x47')],function(_0x141715){var _0x1c2bae={};_0x1c2bae[_0x141715]={'$like':'%'+_0x70aece[_0xa3a4('0x46')][_0xa3a4('0x51')]+'%'};return _0x1c2bae;})});}_0x19f4b2=_[_0xa3a4('0x52')]({},_0x19f4b2,_0x70aece[_0xa3a4('0x58')]);return db['CannedAnswer'][_0xa3a4('0x2f')]({'where':_0x19f4b2[_0xa3a4('0x4f')]})[_0xa3a4('0x39')](function(_0x24ceed){_0x3d1248[_0xa3a4('0x2f')]=_0x24ceed;if(_0x70aece['query']['includeAll']){_0x19f4b2[_0xa3a4('0x56')]=[{'all':!![]}];}return db[_0xa3a4('0x6d')][_0xa3a4('0x68')](_0x19f4b2);})[_0xa3a4('0x39')](function(_0x529b38){_0x3d1248[_0xa3a4('0x57')]=_0x529b38;return _0x3d1248;});}})[_0xa3a4('0x39')](respondWithFilteredResult(_0x2e57db,_0x19f4b2))[_0xa3a4('0x29')](handleError(_0x2e57db,null));};exports[_0xa3a4('0x6e')]=function(_0x5861c7,_0x36c618,_0x48e9e3){return db[_0xa3a4('0x54')][_0xa3a4('0x59')]({'where':{'id':_0x5861c7[_0xa3a4('0x61')]['id']}})[_0xa3a4('0x39')](handleEntityNotFound(_0x36c618,null))[_0xa3a4('0x39')](function(_0x1073d7){if(_0x1073d7){return _0x1073d7[_0xa3a4('0x6e')](_0x5861c7[_0xa3a4('0x46')][_0xa3a4('0x6a')]);}})[_0xa3a4('0x39')](respondWithStatusCode(_0x36c618,null))[_0xa3a4('0x29')](handleError(_0x36c618,null));};exports['notify']=function(_0xe563e1,_0x1ade75,_0x455337){var _0x31009d={'body':_0xe563e1[_0xa3a4('0x5b')],'channel':_0xa3a4('0x6f')};var _0x14dbd4=[];var _0x49d380=[];var _0x1bec32={};var _0x13628d=![];return db[_0xa3a4('0x70')]['describe']()[_0xa3a4('0x39')](function(_0x27eeb9){if(!_0x27eeb9){throw new db[(_0xa3a4('0x71'))][(_0xa3a4('0x72'))](_0xa3a4('0x73'));}_0x14dbd4=_[_0xa3a4('0x74')](_['keys'](_0x27eeb9),['createdAt',_0xa3a4('0x75')]);_0x49d380=_[_0xa3a4('0x74')](_[_0xa3a4('0x44')](_0x27eeb9),[_0xa3a4('0x76'),_0xa3a4('0x75'),_0xa3a4('0x77'),_0xa3a4('0x78')]);if(_0xe563e1[_0xa3a4('0x5b')]['id']){delete _0xe563e1[_0xa3a4('0x5b')]['id'];}if(_[_0xa3a4('0x79')](_0xe563e1[_0xa3a4('0x5b')][_0xa3a4('0x7a')])){throw new db['Sequelize'][(_0xa3a4('0x72'))](_0xa3a4('0x7b'));}if(_[_0xa3a4('0x79')](_0xe563e1[_0xa3a4('0x5b')]['body'])||_0xe563e1[_0xa3a4('0x5b')][_0xa3a4('0x5b')]===''){throw new db[(_0xa3a4('0x71'))][(_0xa3a4('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa3a4('0x79')](_0xe563e1['body'][_0xa3a4('0x7c')])){throw new db['Sequelize'][(_0xa3a4('0x72'))](_0xa3a4('0x7d')+_0x49d380);}if(!_[_0xa3a4('0x7e')](_0x49d380,_0xe563e1['body'][_0xa3a4('0x7c')])){throw new db[(_0xa3a4('0x71'))][(_0xa3a4('0x72'))](_0xa3a4('0x7f')+_0x49d380);}_0x1bec32[_0xe563e1[_0xa3a4('0x5b')][_0xa3a4('0x7c')]]=_0xe563e1[_0xa3a4('0x5b')][_0xa3a4('0x7a')];})[_0xa3a4('0x39')](function(){return db[_0xa3a4('0x54')][_0xa3a4('0x59')]({'where':{'id':_0xe563e1[_0xa3a4('0x61')]['id']},'include':[{'model':db[_0xa3a4('0x80')],'as':'List','include':[{'model':db[_0xa3a4('0x70')],'as':'Contacts','where':_0x1bec32,'limit':0x1,'order':[[_0xa3a4('0x75'),_0xa3a4('0x81')]]}]},{'model':db[_0xa3a4('0x82')],'as':_0xa3a4('0x83')}]});})[_0xa3a4('0x39')](handleEntityNotFound(_0x1ade75,null))[_0xa3a4('0x39')](function(_0x341d22){if(_0x341d22&&_0x341d22['List']){_0x31009d[_0xa3a4('0x84')]=_0x341d22;_0x31009d[_0xa3a4('0x85')]=_0x341d22[_0xa3a4('0x83')];_0x31009d[_0xa3a4('0x86')]=_0x341d22[_0xa3a4('0x87')];_0x31009d['applications']=_[_0xa3a4('0x88')](_0x31009d['applications'],['priority'],['asc']);if(_0x31009d[_0xa3a4('0x84')][_0xa3a4('0x83')]){delete _0x31009d[_0xa3a4('0x84')][_0xa3a4('0x83')];}if(_0x31009d[_0xa3a4('0x84')][_0xa3a4('0x87')]&&_0x31009d[_0xa3a4('0x84')][_0xa3a4('0x87')]['Contacts'][_0xa3a4('0x4a')]){return _0x31009d[_0xa3a4('0x84')][_0xa3a4('0x87')]['Contacts'][0x0];}var _0x134b7c=_[_0xa3a4('0x17')](_0xe563e1[_0xa3a4('0x5b')],{'firstName':_0xe563e1[_0xa3a4('0x5b')][_0xa3a4('0x7a')],'ListId':_0x341d22['ListId']});_0x134b7c[_0xe563e1[_0xa3a4('0x5b')][_0xa3a4('0x7c')]]=_0xe563e1['body'][_0xa3a4('0x7a')];return db[_0xa3a4('0x70')][_0xa3a4('0x5a')](_0x134b7c,{'fields':_0x14dbd4,'raw':!![]});}})[_0xa3a4('0x39')](handleEntityNotFound(_0x1ade75,null))[_0xa3a4('0x39')](function(_0x23fd43){_0x31009d[_0xa3a4('0x89')]=_0x23fd43;if(_0x23fd43){var _0x354ff4={'ContactId':_0x23fd43['id'],'OpenchannelAccountId':_0xe563e1[_0xa3a4('0x61')]['id'],'from':(_0x23fd43[_0xa3a4('0x8a')]||'')+'\x20'+(_0x23fd43[_0xa3a4('0x8b')]||'')};var _0xb5de97={'OpenchannelAccountId':_0xe563e1[_0xa3a4('0x61')]['id'],'closed':![]};if(_0xe563e1[_0xa3a4('0x5b')][_0xa3a4('0x8c')]){_0xb5de97['threadId']=_0xe563e1[_0xa3a4('0x5b')][_0xa3a4('0x8c')];return db[_0xa3a4('0x8d')][_0xa3a4('0x59')]({'where':_0xb5de97})[_0xa3a4('0x39')](function(_0x3b5984){if(_0x3b5984){return[_0x3b5984,![]];}_0x354ff4[_0xa3a4('0x8c')]=_0xe563e1[_0xa3a4('0x5b')][_0xa3a4('0x8c')];_0x354ff4[_0xa3a4('0x8e')]=_0xe563e1['body']['externalUrl'];return db[_0xa3a4('0x8d')][_0xa3a4('0x5a')](_0x354ff4)[_0xa3a4('0x39')](function(_0x370177){return[_0x370177,!![]];});});}else{_0xb5de97[_0xa3a4('0x8c')]=null;}_0xb5de97[_0xa3a4('0x8f')]=_0x23fd43['id'];return db[_0xa3a4('0x8d')]['find']({'where':_0xb5de97})[_0xa3a4('0x39')](function(_0x73e30a){if(_0x73e30a){return[_0x73e30a,![]];}return db[_0xa3a4('0x8d')][_0xa3a4('0x5a')](_0x354ff4)[_0xa3a4('0x39')](function(_0x31fb73){return[_0x31fb73,!![]];});});}})['spread'](function(_0x2a5b71,_0x45c663){if(_0x2a5b71){_0x13628d=_0x45c663;if(!_0x45c663){var _0x2761e0={'from':(_0x31009d['contact'][_0xa3a4('0x8a')]||'')+'\x20'+(_0x31009d[_0xa3a4('0x89')][_0xa3a4('0x8b')]||'')};if(_0xe563e1[_0xa3a4('0x5b')][_0xa3a4('0x8c')]&&_0xe563e1['body'][_0xa3a4('0x90')]&&_0xe563e1[_0xa3a4('0x5b')][_0xa3a4('0x8c')]!=_0xe563e1[_0xa3a4('0x5b')][_0xa3a4('0x90')]){_0x2761e0['threadId']=_0xe563e1['body'][_0xa3a4('0x90')];}return _0x2a5b71[_0xa3a4('0x35')](_0x2761e0);}else{return _0x2a5b71;}}})['then'](function(_0xcc9e4a){_0x31009d['interaction']=_0xcc9e4a[_0xa3a4('0x37')]({'plain':!![]});_0x31009d['interaction'][_0xa3a4('0x91')]=_0x13628d;if(_0x31009d['interaction']['created']){if(_0x31009d['account']['autoclose']){_0x31009d['applications'][_0xa3a4('0x92')]({'id':0x0,'priority':_0x31009d[_0xa3a4('0x85')][_0xa3a4('0x4a')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xa3a4('0x93')][_0xa3a4('0x5a')]({'body':_0xe563e1[_0xa3a4('0x5b')][_0xa3a4('0x5b')],'OpenchannelAccountId':_0xe563e1[_0xa3a4('0x61')]['id'],'OpenchannelInteractionId':_0xcc9e4a['id'],'direction':'in','ContactId':_0x31009d[_0xa3a4('0x89')]['id'],'AttachmentId':_0xe563e1[_0xa3a4('0x5b')]['AttachmentId']});})[_0xa3a4('0x39')](function(_0x3e4d29){_0x31009d[_0xa3a4('0x27')]=_0x3e4d29;if(!_0x31009d['interaction'][_0xa3a4('0x94')])return;return db[_0xa3a4('0x95')][_0xa3a4('0x59')]({'attributes':['id','name'],'where':{'id':_0x31009d[_0xa3a4('0x96')][_0xa3a4('0x94')]}});})[_0xa3a4('0x39')](function(_0x177d39){if(_0x177d39){_0x31009d[_0xa3a4('0x85')][_0xa3a4('0x97')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x177d39[_0xa3a4('0x3a')]+','+(_0x31009d[_0xa3a4('0x84')][_0xa3a4('0x98')]||0xa),'interval':_0xa3a4('0x99')});}if(!_0x31009d[_0xa3a4('0x96')]['queueId'])return;return db[_0xa3a4('0x9a')][_0xa3a4('0x59')]({'attributes':['id',_0xa3a4('0x3a')],'where':{'id':_0x31009d[_0xa3a4('0x96')]['queueId']}});})[_0xa3a4('0x39')](function(_0x38ec48){if(_0x38ec48){_0x31009d['applications'][_0xa3a4('0x97')]({'id':0x0,'priority':0x1,'app':_0xa3a4('0x9b'),'appdata':_0x38ec48[_0xa3a4('0x3a')]+','+(_0x31009d[_0xa3a4('0x84')][_0xa3a4('0x9c')]||0x12c),'interval':_0xa3a4('0x99')});}return respondWithRpcPromise(_0xa3a4('0x9d'),_0xa3a4('0x9e'),_0x31009d);})['then'](function(_0x144506){respondWithRpcPromise(_0xa3a4('0x9f'),_0xa3a4('0x9f'),{'event':_0xa3a4('0xa0'),'message':_0x144506},client9002);return _0x144506;})['then'](respondWithResult(_0x1ade75,null))[_0xa3a4('0x29')](handleError(_0x1ade75,null));};exports[_0xa3a4('0xa1')]=function(_0x1f013c,_0x2dab67){var _0x3b9ac0=_0x1f013c[_0xa3a4('0x61')]['id'];var _0x13762c=_0x1f013c[_0xa3a4('0x5b')];var _0x3667ca=0xc8;var _0x53809b=null;return db[_0xa3a4('0xa2')][_0xa3a4('0xa3')]({'isolationLevel':db[_0xa3a4('0xa2')][_0xa3a4('0xa4')][_0xa3a4('0xa5')][_0xa3a4('0xa6')]},function(_0x33b0ba){return db[_0xa3a4('0x54')][_0xa3a4('0x67')]({'where':{'id':_0x3b9ac0},'transaction':_0x33b0ba})['then'](function(_0x3caa5b){if(_0x3caa5b){return db[_0xa3a4('0x82')][_0xa3a4('0x36')]({'where':{'OpenchannelAccountId':_0x3b9ac0},'transaction':_0x33b0ba})[_0xa3a4('0x39')](function(){var _0x421f79=_[_0xa3a4('0x43')](_0x13762c,function(_0x376bbb){_0x376bbb['OpenchannelAccountId']=_0x3b9ac0;return _0x376bbb;});return db[_0xa3a4('0x82')][_0xa3a4('0xa7')](_0x421f79,{'transaction':_0x33b0ba});});}else{_0x3667ca=0x194;_0x53809b=[];}});})[_0xa3a4('0x39')](function(){if(_0x3667ca!==0x194){return db['OpenchannelApplication'][_0xa3a4('0xa8')]({'where':{'OpenchannelAccountId':_0x3b9ac0},'order':_0xa3a4('0xa9')})['then'](function(_0x355b83){_0x53809b=_0x355b83;});}})[_0xa3a4('0x29')](function(_0x4a20c8){_0x3667ca=0x1f4;logger[_0xa3a4('0x26')](_0x4a20c8[_0xa3a4('0xaa')]);if(_0x4a20c8[_0xa3a4('0x3a')]){delete _0x4a20c8[_0xa3a4('0x3a')];}_0x53809b=_0x4a20c8;})[_0xa3a4('0xab')](function(){if(_0x53809b===null){_0x2dab67[_0xa3a4('0x2a')](_0x3667ca);}else{if(_0x3667ca===0x1f4){_0x2dab67['status'](_0x3667ca)['send'](_0x53809b);}else{_0x2dab67['status'](_0x3667ca)[_0xa3a4('0x32')](_0x53809b);}}});};exports[_0xa3a4('0xac')]=function(_0x5bdee1,_0x247d39,_0x353bd6){var _0x4bc5af={};var _0xf997f5={};var _0x4a9674;var _0x2854bb;return db[_0xa3a4('0x54')][_0xa3a4('0x67')]({'where':{'id':_0x5bdee1['params']['id']}})[_0xa3a4('0x39')](handleEntityNotFound(_0x247d39,null))['then'](function(_0x411355){if(_0x411355){_0x4a9674=_0x411355;_0xf997f5[_0xa3a4('0x42')]=_[_0xa3a4('0x44')](db[_0xa3a4('0x82')]['rawAttributes']);_0xf997f5['query']=_[_0xa3a4('0x44')](_0x5bdee1['query']);_0xf997f5[_0xa3a4('0x45')]=_[_0xa3a4('0x48')](_0xf997f5[_0xa3a4('0x42')],_0xf997f5[_0xa3a4('0x46')]);_0x4bc5af[_0xa3a4('0x47')]=_[_0xa3a4('0x48')](_0xf997f5[_0xa3a4('0x42')],qs[_0xa3a4('0x49')](_0x5bdee1[_0xa3a4('0x46')][_0xa3a4('0x49')]));_0x4bc5af[_0xa3a4('0x47')]=_0x4bc5af[_0xa3a4('0x47')][_0xa3a4('0x4a')]?_0x4bc5af[_0xa3a4('0x47')]:_0xf997f5[_0xa3a4('0x42')];_0x4bc5af[_0xa3a4('0x4d')]=qs[_0xa3a4('0x4e')](_0x5bdee1[_0xa3a4('0x46')][_0xa3a4('0x4e')]);_0x4bc5af[_0xa3a4('0x4f')]=qs[_0xa3a4('0x45')](_[_0xa3a4('0x50')](_0x5bdee1[_0xa3a4('0x46')],_0xf997f5[_0xa3a4('0x45')]));if(_0x5bdee1[_0xa3a4('0x46')][_0xa3a4('0x51')]){_0x4bc5af[_0xa3a4('0x4f')]=_[_0xa3a4('0x52')](_0x4bc5af['where'],{'$or':_[_0xa3a4('0x43')](_0x4bc5af['attributes'],function(_0x1e015a){var _0x1a2798={};_0x1a2798[_0x1e015a]={'$like':'%'+_0x5bdee1['query']['filter']+'%'};return _0x1a2798;})});}_0x4bc5af=_['merge']({},_0x4bc5af,_0x5bdee1[_0xa3a4('0x58')]);return _0x4a9674['getApplications'](_0x4bc5af);}})['then'](function(_0x4557cd){if(_0x4557cd){_0x2854bb=_0x4557cd['length'];if(!_0x5bdee1[_0xa3a4('0x46')][_0xa3a4('0x4b')](_0xa3a4('0x4c'))){_0x4bc5af[_0xa3a4('0x30')]=qs[_0xa3a4('0x30')](_0x5bdee1[_0xa3a4('0x46')][_0xa3a4('0x30')]);_0x4bc5af[_0xa3a4('0x2d')]=qs[_0xa3a4('0x2d')](_0x5bdee1[_0xa3a4('0x46')][_0xa3a4('0x2d')]);}return _0x4a9674[_0xa3a4('0xac')](_0x4bc5af);}})[_0xa3a4('0x39')](function(_0x35de39){if(_0x35de39){return _0x35de39?{'count':_0x2854bb,'rows':_0x35de39}:null;}})[_0xa3a4('0x39')](respondWithResult(_0x247d39,null))[_0xa3a4('0x29')](handleError(_0x247d39,null));};exports[_0xa3a4('0xad')]=function(_0x206ad5,_0x5031de,_0x16c42b){var _0x4596b5={'raw':![],'where':{}};var _0x17cbf8={};var _0xc625b9={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xa3a4('0x67')]({'where':{'id':_0x206ad5['params']['id']}})[_0xa3a4('0x39')](handleEntityNotFound(_0x5031de,null))['then'](function(_0x393d14){if(_0x393d14){_0x17cbf8[_0xa3a4('0x42')]=_['keys'](db[_0xa3a4('0x8d')][_0xa3a4('0x3f')]);_0x17cbf8[_0xa3a4('0x46')]=_['keys'](_0x206ad5[_0xa3a4('0x46')]);_0x17cbf8[_0xa3a4('0x45')]=_[_0xa3a4('0x48')](_0x17cbf8['model'],_0x17cbf8[_0xa3a4('0x46')]);_0x4596b5[_0xa3a4('0x47')]=_['intersection'](_0x17cbf8[_0xa3a4('0x42')],qs[_0xa3a4('0x49')](_0x206ad5[_0xa3a4('0x46')][_0xa3a4('0x49')]));_0x4596b5[_0xa3a4('0x47')]=_0x4596b5[_0xa3a4('0x47')][_0xa3a4('0x4a')]?_0x4596b5[_0xa3a4('0x47')]:_0x17cbf8['model'];if(!_0x206ad5[_0xa3a4('0x46')][_0xa3a4('0x4b')](_0xa3a4('0x4c'))){_0x4596b5['limit']=qs['limit'](_0x206ad5[_0xa3a4('0x46')]['limit']);_0x4596b5[_0xa3a4('0x2d')]=qs['offset'](_0x206ad5[_0xa3a4('0x46')]['offset']);}_0x4596b5[_0xa3a4('0x4d')]=qs['sort'](_0x206ad5[_0xa3a4('0x46')]['sort']);_0x4596b5['where']=qs[_0xa3a4('0x45')](_[_0xa3a4('0x50')](_0x206ad5[_0xa3a4('0x46')],_0x17cbf8[_0xa3a4('0x45')]));_0x4596b5['where'][_0xa3a4('0x64')]=_0x393d14['id'];if(_0x206ad5[_0xa3a4('0x46')][_0xa3a4('0x51')]){_0x4596b5['where']=_[_0xa3a4('0x52')](_0x4596b5[_0xa3a4('0x4f')],{'$or':_['map'](_0x4596b5[_0xa3a4('0x47')],function(_0x36256b){var _0x41f8f6={};_0x41f8f6[_0x36256b]={'$like':'%'+_0x206ad5[_0xa3a4('0x46')][_0xa3a4('0x51')]+'%'};return _0x41f8f6;})});}_0x4596b5=_[_0xa3a4('0x52')]({},_0x4596b5,_0x206ad5['options']);return db[_0xa3a4('0x8d')][_0xa3a4('0x2f')]({'where':_0x4596b5['where']})[_0xa3a4('0x39')](function(_0x385bee){_0xc625b9['count']=_0x385bee;if(_0x206ad5[_0xa3a4('0x46')][_0xa3a4('0x55')]){_0x4596b5[_0xa3a4('0x56')]=[{'model':db[_0xa3a4('0x70')],'as':'Contact','required':![]},{'model':db[_0xa3a4('0x95')],'as':_0xa3a4('0xae'),'attributes':['name',_0xa3a4('0xaf'),_0xa3a4('0xb0')],'required':![]},{'model':db[_0xa3a4('0xb1')],'as':_0xa3a4('0xb2'),'attributes':['id',_0xa3a4('0x3a'),_0xa3a4('0xb3')],'where':_0x206ad5[_0xa3a4('0x46')][_0xa3a4('0xb4')]?{'id':_0x206ad5['query'][_0xa3a4('0xb4')]}:undefined,'required':_0x206ad5[_0xa3a4('0x46')]['tag']?!![]:![]}];}return db['OpenchannelInteraction'][_0xa3a4('0x68')](_0x4596b5);})[_0xa3a4('0x39')](function(_0x245a8e){_0xc625b9[_0xa3a4('0x57')]=_0x245a8e;return _0xc625b9;});}})['then'](respondWithFilteredResult(_0x5031de,_0x4596b5))[_0xa3a4('0x29')](handleError(_0x5031de,null));};exports[_0xa3a4('0xb5')]=function(_0x5220f2,_0x296cb0,_0x4b8838){return db['OpenchannelAccount']['find']({'where':{'id':_0x5220f2[_0xa3a4('0x61')]['id']}})[_0xa3a4('0x39')](handleEntityNotFound(_0x296cb0,null))[_0xa3a4('0x39')](function(_0xf857c8){if(_0xf857c8){return _0xf857c8[_0xa3a4('0xb5')](_0x5220f2[_0xa3a4('0x5b')][_0xa3a4('0x6a')],_[_0xa3a4('0xb6')](_0x5220f2[_0xa3a4('0x5b')],[_0xa3a4('0x6a'),'id'])||{})[_0xa3a4('0xb7')](function(_0x4dc812){for(var _0x2f9027=0x0;_0x2f9027<_0x5220f2[_0xa3a4('0x5b')][_0xa3a4('0x6a')][_0xa3a4('0x4a')];_0x2f9027+=0x1){socket['emit'](_0xa3a4('0xb8'),{'UserId':Number(_0x5220f2[_0xa3a4('0x5b')][_0xa3a4('0x6a')][_0x2f9027]),'OpenchannelAccountId':Number(_0x5220f2['params']['id'])});}return _0x4dc812;});}})[_0xa3a4('0x39')](respondWithResult(_0x296cb0,null))[_0xa3a4('0x29')](handleError(_0x296cb0,null));};exports[_0xa3a4('0xb9')]=function(_0xd2fd8c,_0xe227c0,_0x35bb61){return db[_0xa3a4('0x54')][_0xa3a4('0x59')]({'where':{'id':_0xd2fd8c['params']['id']}})[_0xa3a4('0x39')](handleEntityNotFound(_0xe227c0,null))[_0xa3a4('0x39')](function(_0x2e0b33){if(_0x2e0b33){return _0x2e0b33[_0xa3a4('0xb9')](_0xd2fd8c[_0xa3a4('0x46')][_0xa3a4('0x6a')])['then'](function(){if(_['isArray'](_0xd2fd8c[_0xa3a4('0x46')][_0xa3a4('0x6a')])){for(var _0x58e2ad=0x0;_0x58e2ad<_0xd2fd8c[_0xa3a4('0x46')][_0xa3a4('0x6a')][_0xa3a4('0x4a')];_0x58e2ad+=0x1){socket[_0xa3a4('0xba')](_0xa3a4('0xbb'),{'UserId':Number(_0xd2fd8c[_0xa3a4('0x46')]['ids'][_0x58e2ad]),'OpenchannelAccountId':Number(_0xd2fd8c[_0xa3a4('0x61')]['id'])});}}else{socket[_0xa3a4('0xba')]('userOpenchannelAccount:remove',{'UserId':Number(_0xd2fd8c[_0xa3a4('0x46')][_0xa3a4('0x6a')]),'OpenchannelAccountId':Number(_0xd2fd8c[_0xa3a4('0x61')]['id'])});}});}})[_0xa3a4('0x39')](respondWithStatusCode(_0xe227c0,null))[_0xa3a4('0x29')](handleError(_0xe227c0,null));};exports[_0xa3a4('0xbc')]=function(_0x28dca8,_0x399e76,_0x125660){var _0x3985fc={};var _0xbeb41={};var _0x5eb622;var _0x361515;return db[_0xa3a4('0x54')][_0xa3a4('0x67')]({'where':{'id':_0x28dca8[_0xa3a4('0x61')]['id']}})['then'](handleEntityNotFound(_0x399e76,null))[_0xa3a4('0x39')](function(_0x3b7cb3){if(_0x3b7cb3){_0x5eb622=_0x3b7cb3;_0xbeb41['model']=_['keys'](db['User'][_0xa3a4('0x3f')]);_0xbeb41[_0xa3a4('0x46')]=_[_0xa3a4('0x44')](_0x28dca8['query']);_0xbeb41[_0xa3a4('0x45')]=_[_0xa3a4('0x48')](_0xbeb41[_0xa3a4('0x42')],_0xbeb41['query']);_0x3985fc[_0xa3a4('0x47')]=_[_0xa3a4('0x48')](_0xbeb41['model'],qs[_0xa3a4('0x49')](_0x28dca8[_0xa3a4('0x46')]['fields']));_0x3985fc[_0xa3a4('0x47')]=_0x3985fc['attributes']['length']?_0x3985fc[_0xa3a4('0x47')]:_0xbeb41[_0xa3a4('0x42')];_0x3985fc[_0xa3a4('0x4d')]=qs[_0xa3a4('0x4e')](_0x28dca8[_0xa3a4('0x46')][_0xa3a4('0x4e')]);_0x3985fc[_0xa3a4('0x4f')]=qs[_0xa3a4('0x45')](_['pick'](_0x28dca8['query'],_0xbeb41[_0xa3a4('0x45')]));if(_0x28dca8[_0xa3a4('0x46')]['filter']){_0x3985fc[_0xa3a4('0x4f')]=_[_0xa3a4('0x52')](_0x3985fc[_0xa3a4('0x4f')],{'$or':_[_0xa3a4('0x43')](_0x3985fc['attributes'],function(_0x23d692){var _0x1fd02d={};_0x1fd02d[_0x23d692]={'$like':'%'+_0x28dca8[_0xa3a4('0x46')][_0xa3a4('0x51')]+'%'};return _0x1fd02d;})});}_0x3985fc=_[_0xa3a4('0x52')]({},_0x3985fc,_0x28dca8['options']);return _0x5eb622[_0xa3a4('0xbc')](_0x3985fc);}})[_0xa3a4('0x39')](function(_0x15f6f4){if(_0x15f6f4){_0x361515=_0x15f6f4['length'];if(!_0x28dca8['query']['hasOwnProperty']('nolimit')){_0x3985fc[_0xa3a4('0x30')]=qs[_0xa3a4('0x30')](_0x28dca8[_0xa3a4('0x46')][_0xa3a4('0x30')]);_0x3985fc[_0xa3a4('0x2d')]=qs[_0xa3a4('0x2d')](_0x28dca8[_0xa3a4('0x46')][_0xa3a4('0x2d')]);}return _0x5eb622[_0xa3a4('0xbc')](_0x3985fc);}})['then'](function(_0x1ac5b9){if(_0x1ac5b9){return _0x1ac5b9?{'count':_0x361515,'rows':_0x1ac5b9}:null;}})[_0xa3a4('0x39')](respondWithResult(_0x399e76,null))['catch'](handleError(_0x399e76,null));};exports[_0xa3a4('0x3b')]=function(_0x3b89e9,_0x2da233,_0xef4bbb){var _0x4ef920,_0x54f418,_0x150a0a;if(_['isNil'](_0x3b89e9[_0xa3a4('0x5b')][_0xa3a4('0x5b')])||_0x3b89e9[_0xa3a4('0x5b')][_0xa3a4('0x5b')]===''){throw new db[(_0xa3a4('0x71'))][(_0xa3a4('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa3a4('0x79')](_0x3b89e9['body']['to'])){}_0x4ef920=_0x3b89e9[_0xa3a4('0x5b')]['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3b89e9[_0xa3a4('0x61')]['id']}})[_0xa3a4('0x39')](handleEntityNotFound(_0x2da233,null))['then'](function(_0x4e8d37){if(_0x4e8d37){return db[_0xa3a4('0x54')][_0xa3a4('0x59')]({'where':{'id':_0x4e8d37['id']},'include':[{'model':db[_0xa3a4('0x80')],'as':_0xa3a4('0x87'),'include':[{'model':db['CmContact'],'as':_0xa3a4('0xbd'),'where':{[_0x4e8d37[_0xa3a4('0x7c')]]:_0x4ef920},'limit':0x1,'order':[[_0xa3a4('0x75'),_0xa3a4('0x81')]]}]}]})[_0xa3a4('0x39')](handleEntityNotFound(_0x2da233,null))[_0xa3a4('0x39')](function(_0x296d66){if(_0x296d66&&_0x296d66[_0xa3a4('0x87')]){_0x54f418=_0x296d66[_0xa3a4('0x37')]({'plain':!![]});if(_0x54f418[_0xa3a4('0x87')]&&_0x54f418[_0xa3a4('0x87')][_0xa3a4('0xbd')]['length']){return _0x54f418[_0xa3a4('0x87')][_0xa3a4('0xbd')][0x0];}return db['CmContact'][_0xa3a4('0x5a')](_['defaults'](_0x3b89e9[_0xa3a4('0x5b')],{'firstName':_0x4ef920,[_0x296d66[_0xa3a4('0x7c')]]:_0x4ef920,'phone':_0x4ef920,'ListId':_0x54f418['ListId']}));}})[_0xa3a4('0x39')](handleEntityNotFound(_0x2da233,null))['then'](function(_0x4a3781){if(_0x4a3781){_0x150a0a=_0x4a3781;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x150a0a['id'],'closed':![],'OpenchannelAccountId':_0x54f418['id']}})[_0xa3a4('0x39')](function(_0xe20b73){if(_0xe20b73){return[_0xe20b73,![]];}return db[_0xa3a4('0x8d')][_0xa3a4('0x5a')]({'UserId':_0x3b89e9['user']['id'],'ContactId':_0x150a0a['id'],'OpenchannelAccountId':_0x54f418['id'],'lastMsgDirection':_0xa3a4('0xbe'),'firstMsgDirection':'out','Messages':[_[_0xa3a4('0x52')](_0x3b89e9['body'],{'read':![],'body':_0x3b89e9['body'][_0xa3a4('0x5b')],'OpenchannelAccountId':_0x54f418['id'],'UserId':_0x3b89e9['user']['id'],'ContactId':_0x150a0a['id']})]},{'include':[{'model':db[_0xa3a4('0x93')],'as':_0xa3a4('0xbf')}]})[_0xa3a4('0x39')](function(_0xb70438){return[_0xb70438,!![]];});});}})[_0xa3a4('0xb7')](function(_0x58de1a,_0x1be789){if(_0x1be789){return _0x58de1a;}return db[_0xa3a4('0x93')][_0xa3a4('0x5a')](_['merge'](_0x3b89e9['body'],{'read':![],'body':_0x3b89e9[_0xa3a4('0x5b')]['body'],'OpenchannelAccountId':_0x54f418['id'],'OpenchannelInteractionId':_0x58de1a['id'],'UserId':_0x3b89e9[_0xa3a4('0x5d')]['id'],'ContactId':_0x150a0a['id']}))['then'](function(_0x4f2d3f){_0x58de1a[_0xa3a4('0xc0')][_0xa3a4('0xbf')]=[];_0x58de1a['dataValues'][_0xa3a4('0xbf')][_0xa3a4('0x92')](_0x4f2d3f[_0xa3a4('0xc0')]);return _0x58de1a;});});}})[_0xa3a4('0x39')](respondWithResult(_0x2da233,null))['catch'](handleError(_0x2da233,null));}; \ No newline at end of file +var _0x3787=['getApplications','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','name','send','Pause','map','OpenchannelAccount','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','offset','order','sort','where','filter','merge','options','findAll','show','params','mandatoryDispositionPause','keys','rawAttributes','includeAll','include','find','create','user','role','OpenchannelAccounts','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','filters','length','hasOwnProperty','pick','rows','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','notify','CmContact','difference','createdAt','updatedAt','CompanyId','isNil','from','Sequelize','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','List','Contacts','DESC','Applications','account','applications','list','orderBy','priority','defaults','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','stack','finally'];(function(_0x23d369,_0x4d2f85){var _0x1e711b=function(_0x4829ec){while(--_0x4829ec){_0x23d369['push'](_0x23d369['shift']());}};_0x1e711b(++_0x4d2f85);}(_0x3787,0xd3));var _0x7378=function(_0x10e52c,_0xcb0072){_0x10e52c=_0x10e52c-0x0;var _0x8ca261=_0x3787[_0x10e52c];return _0x8ca261;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7378('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7378('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7378('0x2'));var util=require(_0x7378('0x3'));var path=require(_0x7378('0x4'));var sox=require(_0x7378('0x5'));var csv=require(_0x7378('0x6'));var ejs=require(_0x7378('0x7'));var fs=require('fs');var fs_extra=require(_0x7378('0x8'));var _=require(_0x7378('0x9'));var squel=require(_0x7378('0xa'));var crypto=require(_0x7378('0xb'));var jsforce=require(_0x7378('0xc'));var deskjs=require(_0x7378('0xd'));var toCsv=require(_0x7378('0x6'));var querystring=require(_0x7378('0xe'));var Papa=require(_0x7378('0xf'));var Redis=require(_0x7378('0x10'));var authService=require(_0x7378('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7378('0x12'));var hardwareService=require(_0x7378('0x13'));var logger=require('../../config/logger')(_0x7378('0x14'));var utils=require(_0x7378('0x15'));var config=require(_0x7378('0x16'));var licenseUtil=require(_0x7378('0x17'));var db=require(_0x7378('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x7378('0x19'),'port':0x18eb});var socket=require(_0x7378('0x1a'))(new Redis(config['redis']));require(_0x7378('0x1b'))[_0x7378('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7378('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x7378('0x1d')][_0x7378('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x873f4f,_0x7dd3bf,_0x406a4c,_0x4303ff){return new BPromise(function(_0x582ca4,_0x5af7d2){var _0x13141b=_0x4303ff||client;return _0x13141b[_0x7378('0x1f')](_0x873f4f,_0x406a4c)[_0x7378('0x20')](function(_0xc2d9fa){logger[_0x7378('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x7dd3bf,_0x7378('0x22'));logger[_0x7378('0x23')](_0x7378('0x24'),_0x7dd3bf,_0x7378('0x22'),JSON['stringify'](_0xc2d9fa));if(_0xc2d9fa[_0x7378('0x25')]){if(_0xc2d9fa[_0x7378('0x25')][_0x7378('0x26')]===0x1f4){logger['error'](_0x7378('0x27'),_0x7dd3bf,_0xc2d9fa['error'][_0x7378('0x28')]);return _0x5af7d2(_0xc2d9fa[_0x7378('0x25')][_0x7378('0x28')]);}logger[_0x7378('0x25')](_0x7378('0x27'),_0x7dd3bf,_0xc2d9fa[_0x7378('0x25')]['message']);return _0x582ca4(_0xc2d9fa['error'][_0x7378('0x28')]);}else{logger[_0x7378('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x7dd3bf,_0x7378('0x22'));_0x582ca4(_0xc2d9fa[_0x7378('0x29')][_0x7378('0x28')]);}})[_0x7378('0x2a')](function(_0x4293f3){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x7dd3bf,_0x4293f3);_0x5af7d2(_0x4293f3);});});}function respondWithStatusCode(_0x1e8727,_0x1f7341){_0x1f7341=_0x1f7341||0xcc;return function(_0x2f1c82){if(_0x2f1c82){return _0x1e8727[_0x7378('0x2b')](_0x1f7341);}return _0x1e8727[_0x7378('0x2c')](_0x1f7341)[_0x7378('0x2d')]();};}function respondWithResult(_0x44696d,_0x437023){_0x437023=_0x437023||0xc8;return function(_0x1c1b20){if(_0x1c1b20){return _0x44696d['status'](_0x437023)[_0x7378('0x2e')](_0x1c1b20);}};}function respondWithFilteredResult(_0x3d72ac,_0x149c49){return function(_0x3227d6){if(_0x3227d6){var _0x1b3e19=typeof _0x149c49['offset']==='undefined'&&typeof _0x149c49[_0x7378('0x2f')]===_0x7378('0x30');var _0xa55adc=_0x3227d6[_0x7378('0x31')];var _0x9e22e6=_0x1b3e19?0x0:_0x149c49['offset'];var _0x4760ce=_0x1b3e19?_0x3227d6[_0x7378('0x31')]:_0x149c49['offset']+_0x149c49[_0x7378('0x2f')];var _0x29d663;if(_0x4760ce>=_0xa55adc){_0x4760ce=_0xa55adc;_0x29d663=0xc8;}else{_0x29d663=0xce;}_0x3d72ac[_0x7378('0x2c')](_0x29d663);return _0x3d72ac[_0x7378('0x32')](_0x7378('0x33'),_0x9e22e6+'-'+_0x4760ce+'/'+_0xa55adc)['json'](_0x3227d6);}return null;};}function patchUpdates(_0x5d0a62){return function(_0x1107fc){try{jsonpatch[_0x7378('0x34')](_0x1107fc,_0x5d0a62,!![]);}catch(_0x17ff22){return BPromise[_0x7378('0x35')](_0x17ff22);}return _0x1107fc[_0x7378('0x36')]();};}function saveUpdates(_0x4bfbab,_0x3f5eef){return function(_0x1ab88d){if(_0x1ab88d){return _0x1ab88d[_0x7378('0x37')](_0x4bfbab)[_0x7378('0x20')](function(_0x271eb1){return _0x271eb1;});}return null;};}function removeEntity(_0x5d739a,_0x16e3b5){return function(_0x5f05b3){if(_0x5f05b3){return _0x5f05b3[_0x7378('0x38')]()[_0x7378('0x20')](function(){var _0x5f003f=_0x5f05b3[_0x7378('0x39')]({'plain':!![]});var _0x5e07dc='OpenchannelAccounts';return db['UserProfileResource'][_0x7378('0x38')]({'where':{'type':_0x5e07dc,'resourceId':_0x5f003f['id']}})[_0x7378('0x20')](function(){return _0x5f05b3;});})[_0x7378('0x20')](function(){_0x5d739a[_0x7378('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1136b7,_0x701c19){return function(_0x40f85d){if(!_0x40f85d){_0x1136b7[_0x7378('0x2b')](0x194);}return _0x40f85d;};}function handleError(_0x3a8ac0,_0x330845){_0x330845=_0x330845||0x1f4;return function(_0x190827){logger['error'](_0x190827['stack']);if(_0x190827[_0x7378('0x3a')]){delete _0x190827[_0x7378('0x3a')];}_0x3a8ac0['status'](_0x330845)[_0x7378('0x3b')](_0x190827);};}exports['index']=function(_0x5ff3c2,_0x1523c6){var _0x265aaf={'include':[{'model':db[_0x7378('0x3c')],'as':'mandatoryDispositionPause'}]},_0x32e300={},_0x1b74a7={'count':0x0,'rows':[]};var _0x392cab=_[_0x7378('0x3d')](db[_0x7378('0x3e')]['rawAttributes'],function(_0x26a218){return{'name':_0x26a218[_0x7378('0x3f')],'type':_0x26a218[_0x7378('0x40')][_0x7378('0x41')]};});_0x32e300[_0x7378('0x42')]=_['map'](_0x392cab,_0x7378('0x3a'));_0x32e300['query']=_['keys'](_0x5ff3c2[_0x7378('0x43')]);_0x32e300['filters']=_[_0x7378('0x44')](_0x32e300['model'],_0x32e300[_0x7378('0x43')]);_0x265aaf[_0x7378('0x45')]=_[_0x7378('0x44')](_0x32e300[_0x7378('0x42')],qs[_0x7378('0x46')](_0x5ff3c2[_0x7378('0x43')][_0x7378('0x46')]));_0x265aaf[_0x7378('0x45')]=_0x265aaf[_0x7378('0x45')]['length']?_0x265aaf[_0x7378('0x45')]:_0x32e300[_0x7378('0x42')];if(!_0x5ff3c2[_0x7378('0x43')]['hasOwnProperty'](_0x7378('0x47'))){_0x265aaf['limit']=qs[_0x7378('0x2f')](_0x5ff3c2[_0x7378('0x43')][_0x7378('0x2f')]);_0x265aaf[_0x7378('0x48')]=qs[_0x7378('0x48')](_0x5ff3c2['query']['offset']);}_0x265aaf[_0x7378('0x49')]=qs[_0x7378('0x4a')](_0x5ff3c2['query'][_0x7378('0x4a')]);_0x265aaf[_0x7378('0x4b')]=qs['filters'](_['pick'](_0x5ff3c2[_0x7378('0x43')],_0x32e300['filters']),_0x392cab);if(_0x5ff3c2[_0x7378('0x43')][_0x7378('0x4c')]){_0x265aaf[_0x7378('0x4b')]=_[_0x7378('0x4d')](_0x265aaf[_0x7378('0x4b')],{'$or':_[_0x7378('0x3d')](_0x392cab,function(_0x17c6da){if(_0x17c6da[_0x7378('0x40')]!=='VIRTUAL'){var _0x1a4d30={};_0x1a4d30[_0x17c6da[_0x7378('0x3a')]]={'$like':'%'+_0x5ff3c2[_0x7378('0x43')][_0x7378('0x4c')]+'%'};return _0x1a4d30;}})});}_0x265aaf=_[_0x7378('0x4d')]({},_0x265aaf,_0x5ff3c2[_0x7378('0x4e')]);var _0xb39228={'where':_0x265aaf['where']};return db[_0x7378('0x3e')][_0x7378('0x31')](_0xb39228)[_0x7378('0x20')](function(_0x41b65b){_0x1b74a7[_0x7378('0x31')]=_0x41b65b;if(_0x5ff3c2[_0x7378('0x43')]['includeAll']){_0x265aaf['include']=[{'all':!![]}];}return db[_0x7378('0x3e')][_0x7378('0x4f')](_0x265aaf);})['then'](function(_0x687f1f){_0x1b74a7['rows']=_0x687f1f;return _0x1b74a7;})[_0x7378('0x20')](respondWithFilteredResult(_0x1523c6,_0x265aaf))[_0x7378('0x2a')](handleError(_0x1523c6,null));};exports[_0x7378('0x50')]=function(_0x303f28,_0x156be4){var _0x5021b3={'raw':![],'where':{'id':_0x303f28[_0x7378('0x51')]['id']},'include':[{'model':db[_0x7378('0x3c')],'as':_0x7378('0x52')}]},_0x1d2c6d={};_0x1d2c6d[_0x7378('0x42')]=_[_0x7378('0x53')](db[_0x7378('0x3e')][_0x7378('0x54')]);_0x1d2c6d[_0x7378('0x43')]=_['keys'](_0x303f28[_0x7378('0x43')]);_0x1d2c6d['filters']=_[_0x7378('0x44')](_0x1d2c6d[_0x7378('0x42')],_0x1d2c6d['query']);_0x5021b3[_0x7378('0x45')]=_[_0x7378('0x44')](_0x1d2c6d[_0x7378('0x42')],qs[_0x7378('0x46')](_0x303f28[_0x7378('0x43')][_0x7378('0x46')]));_0x5021b3[_0x7378('0x45')]=_0x5021b3[_0x7378('0x45')]['length']?_0x5021b3['attributes']:_0x1d2c6d['model'];if(_0x303f28[_0x7378('0x43')][_0x7378('0x55')]){_0x5021b3[_0x7378('0x56')]=[{'all':!![]}];}_0x5021b3=_[_0x7378('0x4d')]({},_0x5021b3,_0x303f28[_0x7378('0x4e')]);return db[_0x7378('0x3e')][_0x7378('0x57')](_0x5021b3)['then'](handleEntityNotFound(_0x156be4,null))[_0x7378('0x20')](respondWithResult(_0x156be4,null))[_0x7378('0x2a')](handleError(_0x156be4,null));};exports[_0x7378('0x58')]=function(_0x5dca38,_0x5c9f02){return db[_0x7378('0x3e')][_0x7378('0x58')](_0x5dca38['body'],{})[_0x7378('0x20')](function(_0x239a32){var _0x3e7b0c=_0x5dca38[_0x7378('0x59')][_0x7378('0x39')]({'plain':!![]});if(!_0x3e7b0c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e7b0c[_0x7378('0x5a')]===_0x7378('0x59')){var _0x7e6487=_0x239a32[_0x7378('0x39')]({'plain':!![]});var _0x273cde=_0x7378('0x5b');return db[_0x7378('0x5c')][_0x7378('0x57')]({'where':{'name':_0x273cde,'userProfileId':_0x3e7b0c['userProfileId']},'raw':!![]})['then'](function(_0x453f95){if(_0x453f95&&_0x453f95[_0x7378('0x5d')]===0x0){return db[_0x7378('0x5e')][_0x7378('0x58')]({'name':_0x7e6487['name'],'resourceId':_0x7e6487['id'],'type':_0x453f95['name'],'sectionId':_0x453f95['id']},{})['then'](function(){return _0x239a32;});}else{return _0x239a32;}})[_0x7378('0x2a')](function(_0x2258fc){logger[_0x7378('0x25')](_0x7378('0x5f'),_0x2258fc);throw _0x2258fc;});}return _0x239a32;})[_0x7378('0x20')](respondWithResult(_0x5c9f02,0xc9))[_0x7378('0x2a')](handleError(_0x5c9f02,null));};exports[_0x7378('0x37')]=function(_0x3d2a4d,_0xc9f8b4){if(_0x3d2a4d['body']['id']){delete _0x3d2a4d[_0x7378('0x60')]['id'];}return db[_0x7378('0x3e')]['find']({'where':{'id':_0x3d2a4d['params']['id']},'include':[{'model':db[_0x7378('0x3c')],'as':_0x7378('0x52')}]})[_0x7378('0x20')](handleEntityNotFound(_0xc9f8b4,null))[_0x7378('0x20')](saveUpdates(_0x3d2a4d[_0x7378('0x60')],null))['then'](respondWithResult(_0xc9f8b4,null))['catch'](handleError(_0xc9f8b4,null));};exports['destroy']=function(_0x242943,_0x2a1855){return db[_0x7378('0x3e')]['find']({'where':{'id':_0x242943[_0x7378('0x51')]['id']}})[_0x7378('0x20')](handleEntityNotFound(_0x2a1855,null))[_0x7378('0x20')](removeEntity(_0x2a1855,null))['catch'](handleError(_0x2a1855,null));};exports['describe']=function(_0x577f7f,_0x43c8bb){return db['OpenchannelAccount'][_0x7378('0x61')]()[_0x7378('0x20')](respondWithResult(_0x43c8bb,null))[_0x7378('0x2a')](handleError(_0x43c8bb,null));};exports[_0x7378('0x62')]=function(_0x7b8c66,_0x343e16,_0x86b0e){if(_0x7b8c66[_0x7378('0x60')]['id']){delete _0x7b8c66[_0x7378('0x60')]['id'];}return db[_0x7378('0x3e')][_0x7378('0x57')]({'where':{'id':_0x7b8c66[_0x7378('0x51')]['id']}})[_0x7378('0x20')](handleEntityNotFound(_0x343e16,null))[_0x7378('0x20')](function(_0x1e08f0){if(_0x1e08f0){_0x7b8c66[_0x7378('0x60')][_0x7378('0x63')]=_0x1e08f0['id'];return db[_0x7378('0x64')][_0x7378('0x58')](_0x7b8c66[_0x7378('0x60')]);}})['then'](respondWithResult(_0x343e16,null))[_0x7378('0x2a')](handleError(_0x343e16,null));};exports[_0x7378('0x65')]=function(_0x2f616d,_0x324776,_0x23ccb9){var _0x25b0c8={'raw':![],'where':{}};var _0x182cf2={};var _0x236135={'count':0x0,'rows':[]};return db[_0x7378('0x3e')][_0x7378('0x66')]({'where':{'id':_0x2f616d[_0x7378('0x51')]['id']}})[_0x7378('0x20')](handleEntityNotFound(_0x324776,null))[_0x7378('0x20')](function(_0x40f4b0){if(_0x40f4b0){_0x182cf2['model']=_[_0x7378('0x53')](db[_0x7378('0x64')][_0x7378('0x54')]);_0x182cf2[_0x7378('0x43')]=_['keys'](_0x2f616d[_0x7378('0x43')]);_0x182cf2[_0x7378('0x67')]=_['intersection'](_0x182cf2['model'],_0x182cf2[_0x7378('0x43')]);_0x25b0c8['attributes']=_['intersection'](_0x182cf2[_0x7378('0x42')],qs[_0x7378('0x46')](_0x2f616d[_0x7378('0x43')][_0x7378('0x46')]));_0x25b0c8['attributes']=_0x25b0c8[_0x7378('0x45')][_0x7378('0x68')]?_0x25b0c8[_0x7378('0x45')]:_0x182cf2[_0x7378('0x42')];if(!_0x2f616d[_0x7378('0x43')][_0x7378('0x69')](_0x7378('0x47'))){_0x25b0c8[_0x7378('0x2f')]=qs[_0x7378('0x2f')](_0x2f616d['query'][_0x7378('0x2f')]);_0x25b0c8[_0x7378('0x48')]=qs[_0x7378('0x48')](_0x2f616d['query'][_0x7378('0x48')]);}_0x25b0c8['order']=qs[_0x7378('0x4a')](_0x2f616d[_0x7378('0x43')][_0x7378('0x4a')]);_0x25b0c8[_0x7378('0x4b')]=qs[_0x7378('0x67')](_[_0x7378('0x6a')](_0x2f616d[_0x7378('0x43')],_0x182cf2[_0x7378('0x67')]));_0x25b0c8[_0x7378('0x4b')][_0x7378('0x63')]=_0x40f4b0['id'];if(_0x2f616d[_0x7378('0x43')][_0x7378('0x4c')]){_0x25b0c8['where']=_[_0x7378('0x4d')](_0x25b0c8['where'],{'$or':_[_0x7378('0x3d')](_0x25b0c8[_0x7378('0x45')],function(_0x32f95b){var _0x2efaca={};_0x2efaca[_0x32f95b]={'$like':'%'+_0x2f616d['query'][_0x7378('0x4c')]+'%'};return _0x2efaca;})});}_0x25b0c8=_[_0x7378('0x4d')]({},_0x25b0c8,_0x2f616d[_0x7378('0x4e')]);return db[_0x7378('0x64')][_0x7378('0x31')]({'where':_0x25b0c8[_0x7378('0x4b')]})[_0x7378('0x20')](function(_0x28a852){_0x236135[_0x7378('0x31')]=_0x28a852;if(_0x2f616d[_0x7378('0x43')][_0x7378('0x55')]){_0x25b0c8[_0x7378('0x56')]=[{'all':!![]}];}return db[_0x7378('0x64')]['findAll'](_0x25b0c8);})['then'](function(_0x4c52fb){_0x236135[_0x7378('0x6b')]=_0x4c52fb;return _0x236135;});}})[_0x7378('0x20')](respondWithFilteredResult(_0x324776,_0x25b0c8))[_0x7378('0x2a')](handleError(_0x324776,null));};exports[_0x7378('0x6c')]=function(_0x4230ac,_0x25bfdc,_0x568e2d){return db[_0x7378('0x3e')][_0x7378('0x57')]({'where':{'id':_0x4230ac['params']['id']}})[_0x7378('0x20')](handleEntityNotFound(_0x25bfdc,null))[_0x7378('0x20')](function(_0x2ba843){if(_0x2ba843){return _0x2ba843[_0x7378('0x6c')](_0x4230ac[_0x7378('0x43')]['ids']);}})[_0x7378('0x20')](respondWithStatusCode(_0x25bfdc,null))[_0x7378('0x2a')](handleError(_0x25bfdc,null));};exports['addAnswer']=function(_0xf8420f,_0x38e984,_0x5829af){if(_0xf8420f[_0x7378('0x60')]['id']){delete _0xf8420f[_0x7378('0x60')]['id'];}return db[_0x7378('0x3e')][_0x7378('0x57')]({'where':{'id':_0xf8420f[_0x7378('0x51')]['id']}})[_0x7378('0x20')](handleEntityNotFound(_0x38e984,null))[_0x7378('0x20')](function(_0x7f53c8){if(_0x7f53c8){_0xf8420f[_0x7378('0x60')]['OpenchannelAccountId']=_0x7f53c8['id'];return db[_0x7378('0x6d')][_0x7378('0x58')](_0xf8420f[_0x7378('0x60')]);}})[_0x7378('0x20')](respondWithResult(_0x38e984,null))[_0x7378('0x2a')](handleError(_0x38e984,null));};exports[_0x7378('0x6e')]=function(_0x471494,_0x4eded4,_0x859cfa){var _0x52b111={'raw':![],'where':{}};var _0x16f758={};var _0x5851f3={'count':0x0,'rows':[]};return db[_0x7378('0x3e')]['findOne']({'where':{'id':_0x471494[_0x7378('0x51')]['id']}})['then'](handleEntityNotFound(_0x4eded4,null))[_0x7378('0x20')](function(_0x2e8011){if(_0x2e8011){_0x16f758[_0x7378('0x42')]=_[_0x7378('0x53')](db['CannedAnswer'][_0x7378('0x54')]);_0x16f758[_0x7378('0x43')]=_['keys'](_0x471494['query']);_0x16f758[_0x7378('0x67')]=_[_0x7378('0x44')](_0x16f758[_0x7378('0x42')],_0x16f758[_0x7378('0x43')]);_0x52b111[_0x7378('0x45')]=_['intersection'](_0x16f758[_0x7378('0x42')],qs[_0x7378('0x46')](_0x471494[_0x7378('0x43')]['fields']));_0x52b111['attributes']=_0x52b111['attributes'][_0x7378('0x68')]?_0x52b111[_0x7378('0x45')]:_0x16f758[_0x7378('0x42')];if(!_0x471494['query'][_0x7378('0x69')]('nolimit')){_0x52b111[_0x7378('0x2f')]=qs[_0x7378('0x2f')](_0x471494[_0x7378('0x43')][_0x7378('0x2f')]);_0x52b111[_0x7378('0x48')]=qs[_0x7378('0x48')](_0x471494['query'][_0x7378('0x48')]);}_0x52b111[_0x7378('0x49')]=qs[_0x7378('0x4a')](_0x471494['query']['sort']);_0x52b111[_0x7378('0x4b')]=qs[_0x7378('0x67')](_[_0x7378('0x6a')](_0x471494[_0x7378('0x43')],_0x16f758['filters']));_0x52b111[_0x7378('0x4b')][_0x7378('0x63')]=_0x2e8011['id'];if(_0x471494[_0x7378('0x43')][_0x7378('0x4c')]){_0x52b111[_0x7378('0x4b')]=_[_0x7378('0x4d')](_0x52b111['where'],{'$or':_[_0x7378('0x3d')](_0x52b111['attributes'],function(_0x5b7dee){var _0x5adeee={};_0x5adeee[_0x5b7dee]={'$like':'%'+_0x471494['query'][_0x7378('0x4c')]+'%'};return _0x5adeee;})});}_0x52b111=_[_0x7378('0x4d')]({},_0x52b111,_0x471494[_0x7378('0x4e')]);return db[_0x7378('0x6d')][_0x7378('0x31')]({'where':_0x52b111[_0x7378('0x4b')]})[_0x7378('0x20')](function(_0xf142cf){_0x5851f3['count']=_0xf142cf;if(_0x471494[_0x7378('0x43')]['includeAll']){_0x52b111[_0x7378('0x56')]=[{'all':!![]}];}return db[_0x7378('0x6d')][_0x7378('0x4f')](_0x52b111);})[_0x7378('0x20')](function(_0x342df5){_0x5851f3[_0x7378('0x6b')]=_0x342df5;return _0x5851f3;});}})[_0x7378('0x20')](respondWithFilteredResult(_0x4eded4,_0x52b111))[_0x7378('0x2a')](handleError(_0x4eded4,null));};exports[_0x7378('0x6f')]=function(_0x5859cb,_0x2f605e,_0x57e059){return db['OpenchannelAccount']['find']({'where':{'id':_0x5859cb[_0x7378('0x51')]['id']}})[_0x7378('0x20')](handleEntityNotFound(_0x2f605e,null))['then'](function(_0x9c208b){if(_0x9c208b){return _0x9c208b[_0x7378('0x6f')](_0x5859cb['query'][_0x7378('0x70')]);}})[_0x7378('0x20')](respondWithStatusCode(_0x2f605e,null))['catch'](handleError(_0x2f605e,null));};exports[_0x7378('0x71')]=function(_0x3b43aa,_0x3d08ee,_0x348f7a){var _0x4d8381={'body':_0x3b43aa['body'],'channel':'openchannel'};var _0x315be3=[];var _0x42a4ff=[];var _0x201f7f={};var _0x25f08e=![];return db[_0x7378('0x72')]['describe']()[_0x7378('0x20')](function(_0x2cf8db){if(!_0x2cf8db){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x315be3=_[_0x7378('0x73')](_[_0x7378('0x53')](_0x2cf8db),[_0x7378('0x74'),_0x7378('0x75')]);_0x42a4ff=_[_0x7378('0x73')](_['keys'](_0x2cf8db),[_0x7378('0x74'),_0x7378('0x75'),_0x7378('0x76'),'ListId']);if(_0x3b43aa['body']['id']){delete _0x3b43aa[_0x7378('0x60')]['id'];}if(_[_0x7378('0x77')](_0x3b43aa[_0x7378('0x60')][_0x7378('0x78')])){throw new db[(_0x7378('0x79'))][(_0x7378('0x7a'))]('from\x20is\x20mandatory');}if(_[_0x7378('0x77')](_0x3b43aa[_0x7378('0x60')][_0x7378('0x60')])||_0x3b43aa['body'][_0x7378('0x60')]===''){throw new db[(_0x7378('0x79'))][(_0x7378('0x7a'))](_0x7378('0x7b'));}if(_[_0x7378('0x77')](_0x3b43aa['body']['mapKey'])){throw new db[(_0x7378('0x79'))][(_0x7378('0x7a'))](_0x7378('0x7c')+_0x42a4ff);}if(!_['includes'](_0x42a4ff,_0x3b43aa['body'][_0x7378('0x7d')])){throw new db[(_0x7378('0x79'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x42a4ff);}_0x201f7f[_0x3b43aa['body'][_0x7378('0x7d')]]=_0x3b43aa['body']['from'];})[_0x7378('0x20')](function(){return db[_0x7378('0x3e')][_0x7378('0x57')]({'where':{'id':_0x3b43aa[_0x7378('0x51')]['id']},'include':[{'model':db['CmList'],'as':_0x7378('0x7e'),'include':[{'model':db[_0x7378('0x72')],'as':_0x7378('0x7f'),'where':_0x201f7f,'limit':0x1,'order':[['updatedAt',_0x7378('0x80')]]}]},{'model':db['OpenchannelApplication'],'as':_0x7378('0x81')}]});})[_0x7378('0x20')](handleEntityNotFound(_0x3d08ee,null))[_0x7378('0x20')](function(_0x11e82a){if(_0x11e82a&&_0x11e82a[_0x7378('0x7e')]){_0x4d8381[_0x7378('0x82')]=_0x11e82a;_0x4d8381[_0x7378('0x83')]=_0x11e82a[_0x7378('0x81')];_0x4d8381[_0x7378('0x84')]=_0x11e82a['List'];_0x4d8381[_0x7378('0x83')]=_[_0x7378('0x85')](_0x4d8381[_0x7378('0x83')],[_0x7378('0x86')],['asc']);if(_0x4d8381[_0x7378('0x82')]['Applications']){delete _0x4d8381[_0x7378('0x82')][_0x7378('0x81')];}if(_0x4d8381[_0x7378('0x82')][_0x7378('0x7e')]&&_0x4d8381[_0x7378('0x82')][_0x7378('0x7e')][_0x7378('0x7f')][_0x7378('0x68')]){return _0x4d8381[_0x7378('0x82')][_0x7378('0x7e')][_0x7378('0x7f')][0x0];}var _0x14d699=_[_0x7378('0x87')](_0x3b43aa[_0x7378('0x60')],{'firstName':_0x3b43aa['body']['from'],'ListId':_0x11e82a[_0x7378('0x88')]});_0x14d699[_0x3b43aa['body'][_0x7378('0x7d')]]=_0x3b43aa[_0x7378('0x60')][_0x7378('0x78')];return db[_0x7378('0x72')]['create'](_0x14d699,{'fields':_0x315be3,'raw':!![]});}})[_0x7378('0x20')](handleEntityNotFound(_0x3d08ee,null))[_0x7378('0x20')](function(_0x39c756){_0x4d8381[_0x7378('0x89')]=_0x39c756;if(_0x39c756){var _0x2af7b8={'ContactId':_0x39c756['id'],'OpenchannelAccountId':_0x3b43aa[_0x7378('0x51')]['id'],'from':(_0x39c756[_0x7378('0x8a')]||'')+'\x20'+(_0x39c756[_0x7378('0x8b')]||'')};var _0xcb8db7={'OpenchannelAccountId':_0x3b43aa['params']['id'],'closed':![]};if(_0x3b43aa[_0x7378('0x60')][_0x7378('0x8c')]){_0xcb8db7[_0x7378('0x8c')]=_0x3b43aa[_0x7378('0x60')][_0x7378('0x8c')];return db[_0x7378('0x8d')][_0x7378('0x57')]({'where':_0xcb8db7})[_0x7378('0x20')](function(_0x1bcbc8){if(_0x1bcbc8){return[_0x1bcbc8,![]];}_0x2af7b8[_0x7378('0x8c')]=_0x3b43aa['body'][_0x7378('0x8c')];_0x2af7b8[_0x7378('0x8e')]=_0x3b43aa[_0x7378('0x60')][_0x7378('0x8e')];return db[_0x7378('0x8d')][_0x7378('0x58')](_0x2af7b8)[_0x7378('0x20')](function(_0x2bd600){return[_0x2bd600,!![]];});});}else{_0xcb8db7[_0x7378('0x8c')]=null;}_0xcb8db7['ContactId']=_0x39c756['id'];return db['OpenchannelInteraction'][_0x7378('0x57')]({'where':_0xcb8db7})['then'](function(_0x34fe3f){if(_0x34fe3f){return[_0x34fe3f,![]];}return db[_0x7378('0x8d')][_0x7378('0x58')](_0x2af7b8)['then'](function(_0x4f820b){return[_0x4f820b,!![]];});});}})['spread'](function(_0x4e3ea7,_0x3f1951){if(_0x4e3ea7){_0x25f08e=_0x3f1951;if(!_0x3f1951){var _0x385eae={'from':(_0x4d8381[_0x7378('0x89')][_0x7378('0x8a')]||'')+'\x20'+(_0x4d8381[_0x7378('0x89')][_0x7378('0x8b')]||'')};if(_0x3b43aa[_0x7378('0x60')][_0x7378('0x8c')]&&_0x3b43aa[_0x7378('0x60')]['messageId']&&_0x3b43aa['body'][_0x7378('0x8c')]!=_0x3b43aa[_0x7378('0x60')][_0x7378('0x8f')]){_0x385eae[_0x7378('0x8c')]=_0x3b43aa['body']['messageId'];}return _0x4e3ea7[_0x7378('0x37')](_0x385eae);}else{return _0x4e3ea7;}}})['then'](function(_0x57b5fb){_0x4d8381[_0x7378('0x90')]=_0x57b5fb[_0x7378('0x39')]({'plain':!![]});_0x4d8381[_0x7378('0x90')][_0x7378('0x91')]=_0x25f08e;if(_0x4d8381[_0x7378('0x90')][_0x7378('0x91')]){if(_0x4d8381['account']['autoclose']){_0x4d8381[_0x7378('0x83')][_0x7378('0x92')]({'id':0x0,'priority':_0x4d8381[_0x7378('0x83')][_0x7378('0x68')]+0x1,'app':_0x7378('0x93'),'appdata':_0x7378('0x94'),'interval':_0x7378('0x95')});}}return db[_0x7378('0x96')][_0x7378('0x58')]({'body':_0x3b43aa[_0x7378('0x60')][_0x7378('0x60')],'OpenchannelAccountId':_0x3b43aa[_0x7378('0x51')]['id'],'OpenchannelInteractionId':_0x57b5fb['id'],'direction':'in','ContactId':_0x4d8381[_0x7378('0x89')]['id'],'AttachmentId':_0x3b43aa[_0x7378('0x60')][_0x7378('0x97')]});})['then'](function(_0x3e9703){_0x4d8381[_0x7378('0x28')]=_0x3e9703;if(!_0x4d8381[_0x7378('0x90')][_0x7378('0x98')])return;return db[_0x7378('0x99')][_0x7378('0x57')]({'attributes':['id','name'],'where':{'id':_0x4d8381[_0x7378('0x90')][_0x7378('0x98')]}});})[_0x7378('0x20')](function(_0x3aa515){if(_0x3aa515){_0x4d8381[_0x7378('0x83')][_0x7378('0x9a')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3aa515[_0x7378('0x3a')]+','+(_0x4d8381[_0x7378('0x82')][_0x7378('0x9b')]||0xa),'interval':'*,*,*,*'});}if(!_0x4d8381[_0x7378('0x90')][_0x7378('0x9c')])return;return db['OpenchannelQueue'][_0x7378('0x57')]({'attributes':['id','name'],'where':{'id':_0x4d8381[_0x7378('0x90')]['queueId']}});})[_0x7378('0x20')](function(_0x479d15){if(_0x479d15){_0x4d8381['applications'][_0x7378('0x9a')]({'id':0x0,'priority':0x1,'app':_0x7378('0x9d'),'appdata':_0x479d15['name']+','+(_0x4d8381[_0x7378('0x82')][_0x7378('0x9e')]||0x12c),'interval':_0x7378('0x95')});}return respondWithRpcPromise(_0x7378('0x9f'),_0x7378('0xa0'),_0x4d8381);})[_0x7378('0x20')](function(_0x4e4104){respondWithRpcPromise(_0x7378('0xa1'),'EventManager',{'event':_0x7378('0x71'),'message':_0x4e4104},client9002);return _0x4e4104;})[_0x7378('0x20')](respondWithResult(_0x3d08ee,null))['catch'](handleError(_0x3d08ee,null));};exports['addApplications']=function(_0x51c5c0,_0x5141d5){var _0x2db335=_0x51c5c0[_0x7378('0x51')]['id'];var _0x54964e=_0x51c5c0[_0x7378('0x60')];var _0x20af04=0xc8;var _0x36b816=null;return db['sequelize'][_0x7378('0xa2')]({'isolationLevel':db[_0x7378('0xa3')]['Transaction'][_0x7378('0xa4')][_0x7378('0xa5')]},function(_0x1dce44){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x2db335},'transaction':_0x1dce44})[_0x7378('0x20')](function(_0xae2e4a){if(_0xae2e4a){return db[_0x7378('0xa6')][_0x7378('0x38')]({'where':{'OpenchannelAccountId':_0x2db335},'transaction':_0x1dce44})[_0x7378('0x20')](function(){var _0x2b8a92=_[_0x7378('0x3d')](_0x54964e,function(_0x1bf5d){_0x1bf5d[_0x7378('0x63')]=_0x2db335;return _0x1bf5d;});return db['OpenchannelApplication'][_0x7378('0xa7')](_0x2b8a92,{'transaction':_0x1dce44});});}else{_0x20af04=0x194;_0x36b816=[];}});})['then'](function(){if(_0x20af04!==0x194){return db[_0x7378('0xa6')][_0x7378('0xa8')]({'where':{'OpenchannelAccountId':_0x2db335},'order':'priority'})['then'](function(_0x14d10f){_0x36b816=_0x14d10f;});}})[_0x7378('0x2a')](function(_0x17a8d1){_0x20af04=0x1f4;logger[_0x7378('0x25')](_0x17a8d1[_0x7378('0xa9')]);if(_0x17a8d1[_0x7378('0x3a')]){delete _0x17a8d1[_0x7378('0x3a')];}_0x36b816=_0x17a8d1;})[_0x7378('0xaa')](function(){if(_0x36b816===null){_0x5141d5[_0x7378('0x2b')](_0x20af04);}else{if(_0x20af04===0x1f4){_0x5141d5[_0x7378('0x2c')](_0x20af04)['send'](_0x36b816);}else{_0x5141d5[_0x7378('0x2c')](_0x20af04)[_0x7378('0x2e')](_0x36b816);}}});};exports[_0x7378('0xab')]=function(_0x369617,_0x4ec61a,_0x4c25c8){var _0x342879={};var _0x4489f6={};var _0x1609c1;var _0x213454;return db[_0x7378('0x3e')][_0x7378('0x66')]({'where':{'id':_0x369617[_0x7378('0x51')]['id']}})[_0x7378('0x20')](handleEntityNotFound(_0x4ec61a,null))['then'](function(_0x2d90c4){if(_0x2d90c4){_0x1609c1=_0x2d90c4;_0x4489f6[_0x7378('0x42')]=_[_0x7378('0x53')](db[_0x7378('0xa6')][_0x7378('0x54')]);_0x4489f6['query']=_[_0x7378('0x53')](_0x369617[_0x7378('0x43')]);_0x4489f6[_0x7378('0x67')]=_[_0x7378('0x44')](_0x4489f6[_0x7378('0x42')],_0x4489f6[_0x7378('0x43')]);_0x342879[_0x7378('0x45')]=_[_0x7378('0x44')](_0x4489f6[_0x7378('0x42')],qs[_0x7378('0x46')](_0x369617[_0x7378('0x43')][_0x7378('0x46')]));_0x342879[_0x7378('0x45')]=_0x342879['attributes']['length']?_0x342879['attributes']:_0x4489f6[_0x7378('0x42')];_0x342879[_0x7378('0x49')]=qs[_0x7378('0x4a')](_0x369617[_0x7378('0x43')][_0x7378('0x4a')]);_0x342879[_0x7378('0x4b')]=qs[_0x7378('0x67')](_[_0x7378('0x6a')](_0x369617['query'],_0x4489f6[_0x7378('0x67')]));if(_0x369617[_0x7378('0x43')][_0x7378('0x4c')]){_0x342879[_0x7378('0x4b')]=_[_0x7378('0x4d')](_0x342879['where'],{'$or':_[_0x7378('0x3d')](_0x342879['attributes'],function(_0x2789ca){var _0x161576={};_0x161576[_0x2789ca]={'$like':'%'+_0x369617[_0x7378('0x43')]['filter']+'%'};return _0x161576;})});}_0x342879=_[_0x7378('0x4d')]({},_0x342879,_0x369617[_0x7378('0x4e')]);return _0x1609c1[_0x7378('0xab')](_0x342879);}})[_0x7378('0x20')](function(_0x2cca76){if(_0x2cca76){_0x213454=_0x2cca76[_0x7378('0x68')];if(!_0x369617[_0x7378('0x43')][_0x7378('0x69')](_0x7378('0x47'))){_0x342879[_0x7378('0x2f')]=qs[_0x7378('0x2f')](_0x369617[_0x7378('0x43')]['limit']);_0x342879[_0x7378('0x48')]=qs[_0x7378('0x48')](_0x369617['query'][_0x7378('0x48')]);}return _0x1609c1[_0x7378('0xab')](_0x342879);}})[_0x7378('0x20')](function(_0x4f7373){if(_0x4f7373){return _0x4f7373?{'count':_0x213454,'rows':_0x4f7373}:null;}})['then'](respondWithResult(_0x4ec61a,null))[_0x7378('0x2a')](handleError(_0x4ec61a,null));};exports[_0x7378('0xac')]=function(_0x2759d7,_0x20f0ed,_0x1290f5){var _0x34d409={'raw':![],'where':{}};var _0x5a1b05={};var _0x4098eb={'count':0x0,'rows':[]};return db[_0x7378('0x3e')][_0x7378('0x66')]({'where':{'id':_0x2759d7[_0x7378('0x51')]['id']}})[_0x7378('0x20')](handleEntityNotFound(_0x20f0ed,null))[_0x7378('0x20')](function(_0x547efa){if(_0x547efa){_0x5a1b05['model']=_[_0x7378('0x53')](db['OpenchannelInteraction'][_0x7378('0x54')]);_0x5a1b05[_0x7378('0x43')]=_['keys'](_0x2759d7[_0x7378('0x43')]);_0x5a1b05[_0x7378('0x67')]=_[_0x7378('0x44')](_0x5a1b05[_0x7378('0x42')],_0x5a1b05[_0x7378('0x43')]);_0x34d409[_0x7378('0x45')]=_[_0x7378('0x44')](_0x5a1b05[_0x7378('0x42')],qs[_0x7378('0x46')](_0x2759d7[_0x7378('0x43')][_0x7378('0x46')]));_0x34d409[_0x7378('0x45')]=_0x34d409[_0x7378('0x45')][_0x7378('0x68')]?_0x34d409['attributes']:_0x5a1b05[_0x7378('0x42')];if(!_0x2759d7[_0x7378('0x43')][_0x7378('0x69')](_0x7378('0x47'))){_0x34d409[_0x7378('0x2f')]=qs[_0x7378('0x2f')](_0x2759d7[_0x7378('0x43')]['limit']);_0x34d409['offset']=qs['offset'](_0x2759d7[_0x7378('0x43')][_0x7378('0x48')]);}_0x34d409[_0x7378('0x49')]=qs[_0x7378('0x4a')](_0x2759d7[_0x7378('0x43')]['sort']);_0x34d409[_0x7378('0x4b')]=qs['filters'](_[_0x7378('0x6a')](_0x2759d7[_0x7378('0x43')],_0x5a1b05[_0x7378('0x67')]));_0x34d409[_0x7378('0x4b')][_0x7378('0x63')]=_0x547efa['id'];if(_0x2759d7['query'][_0x7378('0x4c')]){_0x34d409[_0x7378('0x4b')]=_[_0x7378('0x4d')](_0x34d409['where'],{'$or':_['map'](_0x34d409[_0x7378('0x45')],function(_0x34423f){var _0x16d838={};_0x16d838[_0x34423f]={'$like':'%'+_0x2759d7[_0x7378('0x43')][_0x7378('0x4c')]+'%'};return _0x16d838;})});}_0x34d409=_['merge']({},_0x34d409,_0x2759d7[_0x7378('0x4e')]);return db[_0x7378('0x8d')][_0x7378('0x31')]({'where':_0x34d409[_0x7378('0x4b')]})[_0x7378('0x20')](function(_0x29d60b){_0x4098eb[_0x7378('0x31')]=_0x29d60b;if(_0x2759d7['query']['includeAll']){_0x34d409[_0x7378('0x56')]=[{'model':db[_0x7378('0x72')],'as':_0x7378('0xad'),'required':![]},{'model':db['User'],'as':_0x7378('0xae'),'attributes':[_0x7378('0x3a'),_0x7378('0xaf'),_0x7378('0xb0')],'required':![]},{'model':db['Tag'],'as':_0x7378('0xb1'),'attributes':['id',_0x7378('0x3a'),_0x7378('0xb2')],'where':_0x2759d7[_0x7378('0x43')]['tag']?{'id':_0x2759d7[_0x7378('0x43')][_0x7378('0xb3')]}:undefined,'required':_0x2759d7['query'][_0x7378('0xb3')]?!![]:![]}];}return db[_0x7378('0x8d')][_0x7378('0x4f')](_0x34d409);})['then'](function(_0x5b6fa7){_0x4098eb[_0x7378('0x6b')]=_0x5b6fa7;return _0x4098eb;});}})['then'](respondWithFilteredResult(_0x20f0ed,_0x34d409))[_0x7378('0x2a')](handleError(_0x20f0ed,null));};exports['addAgents']=function(_0x3a1178,_0x4bba5b,_0x3ccedb){return db[_0x7378('0x3e')][_0x7378('0x57')]({'where':{'id':_0x3a1178[_0x7378('0x51')]['id']}})['then'](handleEntityNotFound(_0x4bba5b,null))[_0x7378('0x20')](function(_0x27cb96){if(_0x27cb96){return _0x27cb96[_0x7378('0xb4')](_0x3a1178[_0x7378('0x60')][_0x7378('0x70')],_[_0x7378('0xb5')](_0x3a1178['body'],[_0x7378('0x70'),'id'])||{})[_0x7378('0xb6')](function(_0x6eec8c){for(var _0x39586c=0x0;_0x39586c<_0x3a1178[_0x7378('0x60')][_0x7378('0x70')]['length'];_0x39586c+=0x1){socket[_0x7378('0xb7')](_0x7378('0xb8'),{'UserId':Number(_0x3a1178['body']['ids'][_0x39586c]),'OpenchannelAccountId':Number(_0x3a1178['params']['id'])});}return _0x6eec8c;});}})[_0x7378('0x20')](respondWithResult(_0x4bba5b,null))[_0x7378('0x2a')](handleError(_0x4bba5b,null));};exports[_0x7378('0xb9')]=function(_0x5a4651,_0x28940a,_0x13fa7d){return db['OpenchannelAccount']['find']({'where':{'id':_0x5a4651[_0x7378('0x51')]['id']}})[_0x7378('0x20')](handleEntityNotFound(_0x28940a,null))[_0x7378('0x20')](function(_0xc35e23){if(_0xc35e23){return _0xc35e23[_0x7378('0xb9')](_0x5a4651[_0x7378('0x43')][_0x7378('0x70')])[_0x7378('0x20')](function(){if(_['isArray'](_0x5a4651[_0x7378('0x43')]['ids'])){for(var _0x575178=0x0;_0x575178<_0x5a4651[_0x7378('0x43')][_0x7378('0x70')][_0x7378('0x68')];_0x575178+=0x1){socket[_0x7378('0xb7')](_0x7378('0xba'),{'UserId':Number(_0x5a4651[_0x7378('0x43')][_0x7378('0x70')][_0x575178]),'OpenchannelAccountId':Number(_0x5a4651[_0x7378('0x51')]['id'])});}}else{socket['emit'](_0x7378('0xba'),{'UserId':Number(_0x5a4651[_0x7378('0x43')]['ids']),'OpenchannelAccountId':Number(_0x5a4651['params']['id'])});}});}})[_0x7378('0x20')](respondWithStatusCode(_0x28940a,null))['catch'](handleError(_0x28940a,null));};exports[_0x7378('0xbb')]=function(_0x2d4718,_0x249652,_0x529ef4){var _0x2d0ef7={};var _0x588936={};var _0x2b0690;var _0x24c16f;return db[_0x7378('0x3e')]['findOne']({'where':{'id':_0x2d4718[_0x7378('0x51')]['id']}})[_0x7378('0x20')](handleEntityNotFound(_0x249652,null))[_0x7378('0x20')](function(_0x517677){if(_0x517677){_0x2b0690=_0x517677;_0x588936[_0x7378('0x42')]=_[_0x7378('0x53')](db['User'][_0x7378('0x54')]);_0x588936[_0x7378('0x43')]=_['keys'](_0x2d4718[_0x7378('0x43')]);_0x588936[_0x7378('0x67')]=_[_0x7378('0x44')](_0x588936[_0x7378('0x42')],_0x588936[_0x7378('0x43')]);_0x2d0ef7['attributes']=_['intersection'](_0x588936[_0x7378('0x42')],qs['fields'](_0x2d4718[_0x7378('0x43')][_0x7378('0x46')]));_0x2d0ef7[_0x7378('0x45')]=_0x2d0ef7[_0x7378('0x45')][_0x7378('0x68')]?_0x2d0ef7[_0x7378('0x45')]:_0x588936['model'];_0x2d0ef7[_0x7378('0x49')]=qs[_0x7378('0x4a')](_0x2d4718[_0x7378('0x43')][_0x7378('0x4a')]);_0x2d0ef7[_0x7378('0x4b')]=qs['filters'](_[_0x7378('0x6a')](_0x2d4718[_0x7378('0x43')],_0x588936['filters']));if(_0x2d4718['query']['filter']){_0x2d0ef7[_0x7378('0x4b')]=_[_0x7378('0x4d')](_0x2d0ef7[_0x7378('0x4b')],{'$or':_[_0x7378('0x3d')](_0x2d0ef7['attributes'],function(_0x5cf949){var _0x29a42d={};_0x29a42d[_0x5cf949]={'$like':'%'+_0x2d4718['query'][_0x7378('0x4c')]+'%'};return _0x29a42d;})});}_0x2d0ef7=_[_0x7378('0x4d')]({},_0x2d0ef7,_0x2d4718['options']);return _0x2b0690[_0x7378('0xbb')](_0x2d0ef7);}})['then'](function(_0x5d492b){if(_0x5d492b){_0x24c16f=_0x5d492b[_0x7378('0x68')];if(!_0x2d4718[_0x7378('0x43')][_0x7378('0x69')](_0x7378('0x47'))){_0x2d0ef7['limit']=qs['limit'](_0x2d4718[_0x7378('0x43')][_0x7378('0x2f')]);_0x2d0ef7[_0x7378('0x48')]=qs['offset'](_0x2d4718[_0x7378('0x43')][_0x7378('0x48')]);}return _0x2b0690[_0x7378('0xbb')](_0x2d0ef7);}})['then'](function(_0x280f2a){if(_0x280f2a){return _0x280f2a?{'count':_0x24c16f,'rows':_0x280f2a}:null;}})[_0x7378('0x20')](respondWithResult(_0x249652,null))['catch'](handleError(_0x249652,null));};exports['send']=function(_0x13dbde,_0xdf6a63,_0x44a96a){var _0x42b5b7,_0x131750,_0x14b13c;if(_['isNil'](_0x13dbde[_0x7378('0x60')][_0x7378('0x60')])||_0x13dbde['body'][_0x7378('0x60')]===''){throw new db[(_0x7378('0x79'))][(_0x7378('0x7a'))](_0x7378('0x7b'));}if(_[_0x7378('0x77')](_0x13dbde[_0x7378('0x60')]['to'])){}_0x42b5b7=_0x13dbde[_0x7378('0x60')]['to'];return db[_0x7378('0x3e')][_0x7378('0x66')]({'where':{'id':_0x13dbde[_0x7378('0x51')]['id']}})['then'](handleEntityNotFound(_0xdf6a63,null))['then'](function(_0x5b4873){if(_0x5b4873){return db['OpenchannelAccount'][_0x7378('0x57')]({'where':{'id':_0x5b4873['id']},'include':[{'model':db['CmList'],'as':_0x7378('0x7e'),'include':[{'model':db[_0x7378('0x72')],'as':_0x7378('0x7f'),'where':{[_0x5b4873[_0x7378('0x7d')]]:_0x42b5b7},'limit':0x1,'order':[[_0x7378('0x75'),_0x7378('0x80')]]}]}]})[_0x7378('0x20')](handleEntityNotFound(_0xdf6a63,null))[_0x7378('0x20')](function(_0x1652e9){if(_0x1652e9&&_0x1652e9['List']){_0x131750=_0x1652e9[_0x7378('0x39')]({'plain':!![]});if(_0x131750[_0x7378('0x7e')]&&_0x131750[_0x7378('0x7e')][_0x7378('0x7f')][_0x7378('0x68')]){return _0x131750[_0x7378('0x7e')][_0x7378('0x7f')][0x0];}return db[_0x7378('0x72')][_0x7378('0x58')](_[_0x7378('0x87')](_0x13dbde[_0x7378('0x60')],{'firstName':_0x42b5b7,[_0x1652e9[_0x7378('0x7d')]]:_0x42b5b7,'phone':_0x42b5b7,'ListId':_0x131750[_0x7378('0x88')]}));}})[_0x7378('0x20')](handleEntityNotFound(_0xdf6a63,null))['then'](function(_0x3083ae){if(_0x3083ae){_0x14b13c=_0x3083ae;return db[_0x7378('0x8d')]['find']({'where':{'ContactId':_0x14b13c['id'],'closed':![],'OpenchannelAccountId':_0x131750['id']}})[_0x7378('0x20')](function(_0x3680d8){if(_0x3680d8){return[_0x3680d8,![]];}return db[_0x7378('0x8d')][_0x7378('0x58')]({'UserId':_0x13dbde[_0x7378('0x59')]['id'],'ContactId':_0x14b13c['id'],'OpenchannelAccountId':_0x131750['id'],'lastMsgDirection':_0x7378('0xbc'),'firstMsgDirection':_0x7378('0xbc'),'Messages':[_[_0x7378('0x4d')](_0x13dbde[_0x7378('0x60')],{'read':![],'body':_0x13dbde['body'][_0x7378('0x60')],'OpenchannelAccountId':_0x131750['id'],'UserId':_0x13dbde['user']['id'],'ContactId':_0x14b13c['id']})]},{'include':[{'model':db[_0x7378('0x96')],'as':_0x7378('0xbd')}]})[_0x7378('0x20')](function(_0x4bb28b){return[_0x4bb28b,!![]];});});}})[_0x7378('0xb6')](function(_0x218cd0,_0x209fa8){if(_0x209fa8){return _0x218cd0;}return db[_0x7378('0x96')][_0x7378('0x58')](_[_0x7378('0x4d')](_0x13dbde[_0x7378('0x60')],{'read':![],'body':_0x13dbde[_0x7378('0x60')][_0x7378('0x60')],'OpenchannelAccountId':_0x131750['id'],'OpenchannelInteractionId':_0x218cd0['id'],'UserId':_0x13dbde['user']['id'],'ContactId':_0x14b13c['id']}))['then'](function(_0x22228b){_0x218cd0[_0x7378('0xbe')]['Messages']=[];_0x218cd0[_0x7378('0xbe')][_0x7378('0xbd')]['push'](_0x22228b['dataValues']);return _0x218cd0;});});}})[_0x7378('0x20')](respondWithResult(_0xdf6a63,null))['catch'](handleError(_0xdf6a63,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index b263899..2a13be7 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 _0x9c44=['save','update','remove','emit','hasOwnProperty','hook','exports','OpenchannelAccount','setMaxListeners'];(function(_0x350351,_0x3b66ef){var _0x8e7c3f=function(_0x1c083e){while(--_0x1c083e){_0x350351['push'](_0x350351['shift']());}};_0x8e7c3f(++_0x3b66ef);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x49c4('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x49c4('0x1')](0x0);var events={'afterCreate':_0x49c4('0x2'),'afterUpdate':_0x49c4('0x3'),'afterDestroy':_0x49c4('0x4')};function emitEvent(_0x2ad237){return function(_0x4e0313,_0x4941f1,_0x41a183){OpenchannelAccountEvents['emit'](_0x2ad237+':'+_0x4e0313['id'],_0x4e0313);OpenchannelAccountEvents[_0x49c4('0x5')](_0x2ad237,_0x4e0313);_0x41a183(null);};}for(var e in events){if(events[_0x49c4('0x6')](e)){var event=events[e];OpenchannelAccount[_0x49c4('0x7')](e,emitEvent(event));}}module[_0x49c4('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xf4eb=['hook','events','update','emit','hasOwnProperty'];(function(_0x2143da,_0xca44ca){var _0x564668=function(_0x24bfaa){while(--_0x24bfaa){_0x2143da['push'](_0x2143da['shift']());}};_0x564668(++_0xca44ca);}(_0xf4eb,0xec));var _0xbf4e=function(_0x449295,_0x1986f0){_0x449295=_0x449295-0x0;var _0x2b81f8=_0xf4eb[_0x449295];return _0x2b81f8;};'use strict';var EventEmitter=require(_0xbf4e('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbf4e('0x1'),'afterDestroy':'remove'};function emitEvent(_0x4e7fa7){return function(_0x2e3070,_0x1c7606,_0x32d1d7){OpenchannelAccountEvents[_0xbf4e('0x2')](_0x4e7fa7+':'+_0x2e3070['id'],_0x2e3070);OpenchannelAccountEvents[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070);_0x32d1d7(null);};}for(var e in events){if(events[_0xbf4e('0x3')](e)){var event=events[e];OpenchannelAccount[_0xbf4e('0x4')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index f62ae12..50a0998 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(_0x23f7e0,_0x1320f4){var _0x278602=function(_0x46b4e4){while(--_0x46b4e4){_0x23f7e0['push'](_0x23f7e0['shift']());}};_0x278602(++_0x1320f4);}(_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 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(_0x5d57cd,_0x13c181){var _0x1b4453=function(_0x5b3b11){while(--_0x5b3b11){_0x5d57cd['push'](_0x5d57cd['shift']());}};_0x1b4453(++_0x13c181);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 467ce7b..364a1ed 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 _0xbf6e=['client','http','redis','defaults','socket.io-emitter','./openchannelAccount.socket','request','then','info','request\x20sent','debug','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x484d64,_0x19dc03){var _0x7c41e4=function(_0x450883){while(--_0x450883){_0x484d64['push'](_0x484d64['shift']());}};_0x7c41e4(++_0x19dc03);}(_0xbf6e,0x149));var _0xebf6=function(_0x282f90,_0x415511){_0x282f90=_0x282f90-0x0;var _0x4aaa1e=_0xbf6e[_0x282f90];return _0x4aaa1e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xebf6('0x0'));var BPromise=require(_0xebf6('0x1'));var rs=require(_0xebf6('0x2'));var fs=require('fs');var Redis=require(_0xebf6('0x3'));var db=require(_0xebf6('0x4'))['db'];var utils=require(_0xebf6('0x5'));var logger=require(_0xebf6('0x6'))('rpc');var config=require(_0xebf6('0x7'));var jayson=require(_0xebf6('0x8'));var client=jayson[_0xebf6('0x9')][_0xebf6('0xa')]({'port':0x232a});config[_0xebf6('0xb')]=_[_0xebf6('0xc')](config[_0xebf6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xebf6('0xd'))(new Redis(config[_0xebf6('0xb')]));require(_0xebf6('0xe'))['register'](socket);function respondWithRpcPromise(_0x38cee4,_0x14f41e,_0x5c6727){return new BPromise(function(_0x3d4b60,_0x231d6b){return client[_0xebf6('0xf')](_0x38cee4,_0x5c6727)[_0xebf6('0x10')](function(_0x1bd481){logger[_0xebf6('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x14f41e,_0xebf6('0x12'));logger[_0xebf6('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x14f41e,_0xebf6('0x12'),JSON[_0xebf6('0x14')](_0x1bd481));if(_0x1bd481[_0xebf6('0x15')]){if(_0x1bd481[_0xebf6('0x15')][_0xebf6('0x16')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x14f41e,_0x1bd481['error'][_0xebf6('0x17')]);return _0x231d6b(_0x1bd481[_0xebf6('0x15')]['message']);}logger[_0xebf6('0x15')](_0xebf6('0x18'),_0x14f41e,_0x1bd481[_0xebf6('0x15')][_0xebf6('0x17')]);return _0x3d4b60(_0x1bd481[_0xebf6('0x15')][_0xebf6('0x17')]);}else{logger[_0xebf6('0x11')](_0xebf6('0x18'),_0x14f41e,_0xebf6('0x12'));_0x3d4b60(_0x1bd481[_0xebf6('0x19')]['message']);}})['catch'](function(_0xe03844){logger[_0xebf6('0x15')](_0xebf6('0x18'),_0x14f41e,_0xe03844);_0x231d6b(_0xe03844);});});} \ No newline at end of file +var _0xa74f=['info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','then'];(function(_0x51ef19,_0x3d7a48){var _0x502bc8=function(_0x1c27e7){while(--_0x1c27e7){_0x51ef19['push'](_0x51ef19['shift']());}};_0x502bc8(++_0x3d7a48);}(_0xa74f,0x9a));var _0xfa74=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0xa74f[_0x54c9dd];return _0x855156;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});config[_0xfa74('0x7')]=_[_0xfa74('0x8')](config[_0xfa74('0x7')],{'host':_0xfa74('0x9'),'port':0x18eb});var socket=require(_0xfa74('0xa'))(new Redis(config['redis']));require(_0xfa74('0xb'))[_0xfa74('0xc')](socket);function respondWithRpcPromise(_0x355e37,_0x2a405e,_0x4d118c){return new BPromise(function(_0x46117e,_0x4f8891){return client['request'](_0x355e37,_0x4d118c)[_0xfa74('0xd')](function(_0x1d919d){logger[_0xfa74('0xe')](_0xfa74('0xf'),_0x2a405e,'request\x20sent');logger[_0xfa74('0x10')](_0xfa74('0x11'),_0x2a405e,_0xfa74('0x12'),JSON[_0xfa74('0x13')](_0x1d919d));if(_0x1d919d['error']){if(_0x1d919d[_0xfa74('0x14')][_0xfa74('0x15')]===0x1f4){logger[_0xfa74('0x14')](_0xfa74('0xf'),_0x2a405e,_0x1d919d[_0xfa74('0x14')]['message']);return _0x4f8891(_0x1d919d[_0xfa74('0x14')][_0xfa74('0x16')]);}logger[_0xfa74('0x14')](_0xfa74('0xf'),_0x2a405e,_0x1d919d[_0xfa74('0x14')][_0xfa74('0x16')]);return _0x46117e(_0x1d919d[_0xfa74('0x14')]['message']);}else{logger[_0xfa74('0xe')](_0xfa74('0xf'),_0x2a405e,'request\x20sent');_0x46117e(_0x1d919d['result'][_0xfa74('0x16')]);}})[_0xfa74('0x17')](function(_0xb8fe6b){logger['error'](_0xfa74('0xf'),_0x2a405e,_0xb8fe6b);_0x4f8891(_0xb8fe6b);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 93e5dc3..4825c24 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 _0x8b2b=['remove','emit','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x259d91,_0x2a2185){var _0x2844f9=function(_0x5aad72){while(--_0x5aad72){_0x259d91['push'](_0x259d91['shift']());}};_0x2844f9(++_0x2a2185);}(_0x8b2b,0x1c0));var _0xb8b2=function(_0x35569d,_0x5798d1){_0x35569d=_0x35569d-0x0;var _0x13ff0=_0x8b2b[_0x35569d];return _0x13ff0;};'use strict';var OpenchannelAccountEvents=require(_0xb8b2('0x0'));var events=[_0xb8b2('0x1'),_0xb8b2('0x2'),'update'];function createListener(_0x199e25,_0x415a60){return function(_0x3beb9e){_0x415a60[_0xb8b2('0x3')](_0x199e25,_0x3beb9e);};}function removeListener(_0x1199f8,_0x2928a7){return function(){OpenchannelAccountEvents['removeListener'](_0x1199f8,_0x2928a7);};}exports['register']=function(_0xba7734){for(var _0x31b3f9=0x0,_0x2f0032=events[_0xb8b2('0x4')];_0x31b3f9<_0x2f0032;_0x31b3f9++){var _0x4a4c69=events[_0x31b3f9];var _0x541b1b=createListener(_0xb8b2('0x5')+_0x4a4c69,_0xba7734);OpenchannelAccountEvents['on'](_0x4a4c69,_0x541b1b);}}; \ No newline at end of file +var _0x3a79=['emit','removeListener','length','openchannelAccount:','save','remove'];(function(_0xa3daf7,_0x1cf62c){var _0x2d4ffc=function(_0x25558d){while(--_0x25558d){_0xa3daf7['push'](_0xa3daf7['shift']());}};_0x2d4ffc(++_0x1cf62c);}(_0x3a79,0xca));var _0x93a7=function(_0x486b56,_0x141308){_0x486b56=_0x486b56-0x0;var _0x232f60=_0x3a79[_0x486b56];return _0x232f60;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x93a7('0x0'),_0x93a7('0x1'),'update'];function createListener(_0x109b5e,_0x8e64e2){return function(_0x31fb0d){_0x8e64e2[_0x93a7('0x2')](_0x109b5e,_0x31fb0d);};}function removeListener(_0x2a6b2b,_0x1e43e0){return function(){OpenchannelAccountEvents[_0x93a7('0x3')](_0x2a6b2b,_0x1e43e0);};}exports['register']=function(_0x2976b2){for(var _0x4efb20=0x0,_0x2579e5=events[_0x93a7('0x4')];_0x4efb20<_0x2579e5;_0x4efb20++){var _0x1b59d1=events[_0x4efb20];var _0x2417da=createListener(_0x93a7('0x5')+_0x1b59d1,_0x2976b2);OpenchannelAccountEvents['on'](_0x1b59d1,_0x2417da);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 0461368..0ac8ae5 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 _0x298a=['isAuthenticated','index','post','put','/:id','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x18db56,_0xe8c98b){var _0x3be018=function(_0x1fa6fa){while(--_0x1fa6fa){_0x18db56['push'](_0x18db56['shift']());}};_0x3be018(++_0xe8c98b);}(_0x298a,0x158));var _0xa298=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x298a[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xa298('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa298('0x1'));var express=require(_0xa298('0x2'));var router=express[_0xa298('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa298('0x4'));var interaction=require(_0xa298('0x5'));var config=require(_0xa298('0x6'));var controller=require('./openchannelApplication.controller');router[_0xa298('0x7')]('/',auth[_0xa298('0x8')](),controller[_0xa298('0x9')]);router['get']('/:id',auth[_0xa298('0x8')](),controller['show']);router[_0xa298('0xa')]('/',auth[_0xa298('0x8')](),controller['create']);router[_0xa298('0xb')](_0xa298('0xc'),auth[_0xa298('0x8')](),controller[_0xa298('0xd')]);router[_0xa298('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xa298('0xf')]);module['exports']=router; \ No newline at end of file +var _0x545f=['../../components/auth/service','../../config/environment','get','index','/:id','post','isAuthenticated','create','put','delete','destroy','exports','multer','path','connect-timeout','fs-extra'];(function(_0x464771,_0x3df5de){var _0x224ba7=function(_0x5c505a){while(--_0x5c505a){_0x464771['push'](_0x464771['shift']());}};_0x224ba7(++_0x3df5de);}(_0x545f,0x14c));var _0xf545=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x545f[_0x1e3671];return _0x48d5f5;};'use strict';var multer=require(_0xf545('0x0'));var util=require('util');var path=require(_0xf545('0x1'));var timeout=require(_0xf545('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf545('0x3'));var auth=require(_0xf545('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf545('0x5'));var controller=require('./openchannelApplication.controller');router[_0xf545('0x6')]('/',auth['isAuthenticated'](),controller[_0xf545('0x7')]);router[_0xf545('0x6')](_0xf545('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xf545('0x9')]('/',auth[_0xf545('0xa')](),controller[_0xf545('0xb')]);router[_0xf545('0xc')](_0xf545('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xf545('0xd')](_0xf545('0x8'),auth[_0xf545('0xa')](),controller[_0xf545('0xe')]);module[_0xf545('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 148a4fa..90c7d0a 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 _0x3869=['sequelize','exports','STRING','TEXT'];(function(_0x13175f,_0x4133d6){var _0x1f127c=function(_0x536b62){while(--_0x536b62){_0x13175f['push'](_0x13175f['shift']());}};_0x1f127c(++_0x4133d6);}(_0x3869,0x1a0));var _0x9386=function(_0x43ffca,_0x3bb3c0){_0x43ffca=_0x43ffca-0x0;var _0x514f04=_0x3869[_0x43ffca];return _0x514f04;};'use strict';var Sequelize=require(_0x9386('0x0'));module[_0x9386('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9386('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9386('0x3')]()},'description':{'type':Sequelize[_0x9386('0x2')]},'interval':{'type':Sequelize[_0x9386('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x152e=['STRING','noop','sequelize','exports'];(function(_0x2aab19,_0x2808de){var _0x42736c=function(_0x25772c){while(--_0x25772c){_0x2aab19['push'](_0x2aab19['shift']());}};_0x42736c(++_0x2808de);}(_0x152e,0x10e));var _0xe152=function(_0x297fe8,_0x2c9c7e){_0x297fe8=_0x297fe8-0x0;var _0x337023=_0x152e[_0x297fe8];return _0x337023;};'use strict';var Sequelize=require(_0xe152('0x0'));module[_0xe152('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xe152('0x2')],'allowNull':![],'defaultValue':_0xe152('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe152('0x2')]},'interval':{'type':Sequelize[_0xe152('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index af0ecb9..6c16909 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 _0xcf26=['sendStatus','end','status','json','undefined','count','offset','set','Content-Range','apply','update','then','destroy','stack','name','send','index','map','OpenchannelApplication','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','include','options','body','find','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x1cfe78,_0x451783){var _0x512d9a=function(_0x48fccf){while(--_0x48fccf){_0x1cfe78['push'](_0x1cfe78['shift']());}};_0x512d9a(++_0x451783);}(_0xcf26,0xc3));var _0x6cf2=function(_0x9ec221,_0x2594a6){_0x9ec221=_0x9ec221-0x0;var _0xdbe55e=_0xcf26[_0x9ec221];return _0xdbe55e;};'use strict';var emlformat=require(_0x6cf2('0x0'));var rimraf=require(_0x6cf2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6cf2('0x2'));var moment=require(_0x6cf2('0x3'));var BPromise=require(_0x6cf2('0x4'));var Mustache=require('mustache');var util=require(_0x6cf2('0x5'));var path=require(_0x6cf2('0x6'));var sox=require('sox');var csv=require(_0x6cf2('0x7'));var ejs=require(_0x6cf2('0x8'));var fs=require('fs');var fs_extra=require(_0x6cf2('0x9'));var _=require(_0x6cf2('0xa'));var squel=require(_0x6cf2('0xb'));var crypto=require('crypto');var jsforce=require(_0x6cf2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6cf2('0x7'));var querystring=require(_0x6cf2('0xd'));var Papa=require(_0x6cf2('0xe'));var Redis=require('ioredis');var authService=require(_0x6cf2('0xf'));var qs=require(_0x6cf2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf2('0x11'));var logger=require(_0x6cf2('0x12'))('api');var utils=require(_0x6cf2('0x13'));var config=require(_0x6cf2('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26e576,_0x5f195b){_0x5f195b=_0x5f195b||0xcc;return function(_0x4c1252){if(_0x4c1252){return _0x26e576[_0x6cf2('0x15')](_0x5f195b);}return _0x26e576['status'](_0x5f195b)[_0x6cf2('0x16')]();};}function respondWithResult(_0x261e5a,_0x27aaf1){_0x27aaf1=_0x27aaf1||0xc8;return function(_0x113cbe){if(_0x113cbe){return _0x261e5a[_0x6cf2('0x17')](_0x27aaf1)[_0x6cf2('0x18')](_0x113cbe);}};}function respondWithFilteredResult(_0x488cf1,_0x1b4a92){return function(_0x29ef5d){if(_0x29ef5d){var _0x1442cb=typeof _0x1b4a92['offset']===_0x6cf2('0x19')&&typeof _0x1b4a92['limit']===_0x6cf2('0x19');var _0x4efc21=_0x29ef5d[_0x6cf2('0x1a')];var _0x424dad=_0x1442cb?0x0:_0x1b4a92[_0x6cf2('0x1b')];var _0x32b5bb=_0x1442cb?_0x29ef5d['count']:_0x1b4a92[_0x6cf2('0x1b')]+_0x1b4a92['limit'];var _0x29f3a1;if(_0x32b5bb>=_0x4efc21){_0x32b5bb=_0x4efc21;_0x29f3a1=0xc8;}else{_0x29f3a1=0xce;}_0x488cf1[_0x6cf2('0x17')](_0x29f3a1);return _0x488cf1[_0x6cf2('0x1c')](_0x6cf2('0x1d'),_0x424dad+'-'+_0x32b5bb+'/'+_0x4efc21)[_0x6cf2('0x18')](_0x29ef5d);}return null;};}function patchUpdates(_0x3efd37){return function(_0x4459f9){try{jsonpatch[_0x6cf2('0x1e')](_0x4459f9,_0x3efd37,!![]);}catch(_0x1e1803){return BPromise['reject'](_0x1e1803);}return _0x4459f9['save']();};}function saveUpdates(_0x2f9d74,_0x412786){return function(_0x1c8476){if(_0x1c8476){return _0x1c8476[_0x6cf2('0x1f')](_0x2f9d74)[_0x6cf2('0x20')](function(_0x4b1706){return _0x4b1706;});}return null;};}function removeEntity(_0x39f074,_0x3ccecf){return function(_0x100d88){if(_0x100d88){return _0x100d88[_0x6cf2('0x21')]()['then'](function(){_0x39f074[_0x6cf2('0x17')](0xcc)[_0x6cf2('0x16')]();});}};}function handleEntityNotFound(_0x503650,_0x2ee97f){return function(_0x1c157d){if(!_0x1c157d){_0x503650[_0x6cf2('0x15')](0x194);}return _0x1c157d;};}function handleError(_0x47294d,_0x12e128){_0x12e128=_0x12e128||0x1f4;return function(_0x1d63f6){logger['error'](_0x1d63f6[_0x6cf2('0x22')]);if(_0x1d63f6['name']){delete _0x1d63f6[_0x6cf2('0x23')];}_0x47294d[_0x6cf2('0x17')](_0x12e128)[_0x6cf2('0x24')](_0x1d63f6);};}exports[_0x6cf2('0x25')]=function(_0x204933,_0x3ef461){var _0x2fb2bf={},_0x388612={},_0x2db94b={'count':0x0,'rows':[]};var _0x1f83eb=_[_0x6cf2('0x26')](db[_0x6cf2('0x27')]['rawAttributes'],function(_0x3be6dd){return{'name':_0x3be6dd[_0x6cf2('0x28')],'type':_0x3be6dd['type'][_0x6cf2('0x29')]};});_0x388612[_0x6cf2('0x2a')]=_['map'](_0x1f83eb,_0x6cf2('0x23'));_0x388612['query']=_['keys'](_0x204933[_0x6cf2('0x2b')]);_0x388612[_0x6cf2('0x2c')]=_['intersection'](_0x388612['model'],_0x388612[_0x6cf2('0x2b')]);_0x2fb2bf[_0x6cf2('0x2d')]=_[_0x6cf2('0x2e')](_0x388612[_0x6cf2('0x2a')],qs[_0x6cf2('0x2f')](_0x204933['query'][_0x6cf2('0x2f')]));_0x2fb2bf[_0x6cf2('0x2d')]=_0x2fb2bf[_0x6cf2('0x2d')][_0x6cf2('0x30')]?_0x2fb2bf['attributes']:_0x388612[_0x6cf2('0x2a')];if(!_0x204933[_0x6cf2('0x2b')][_0x6cf2('0x31')](_0x6cf2('0x32'))){_0x2fb2bf[_0x6cf2('0x33')]=qs[_0x6cf2('0x33')](_0x204933[_0x6cf2('0x2b')][_0x6cf2('0x33')]);_0x2fb2bf['offset']=qs[_0x6cf2('0x1b')](_0x204933[_0x6cf2('0x2b')][_0x6cf2('0x1b')]);}_0x2fb2bf[_0x6cf2('0x34')]=qs[_0x6cf2('0x35')](_0x204933[_0x6cf2('0x2b')][_0x6cf2('0x35')]);_0x2fb2bf[_0x6cf2('0x36')]=qs[_0x6cf2('0x2c')](_[_0x6cf2('0x37')](_0x204933[_0x6cf2('0x2b')],_0x388612[_0x6cf2('0x2c')]),_0x1f83eb);if(_0x204933[_0x6cf2('0x2b')][_0x6cf2('0x38')]){_0x2fb2bf[_0x6cf2('0x36')]=_[_0x6cf2('0x39')](_0x2fb2bf[_0x6cf2('0x36')],{'$or':_[_0x6cf2('0x26')](_0x1f83eb,function(_0x3d2515){if(_0x3d2515[_0x6cf2('0x3a')]!==_0x6cf2('0x3b')){var _0x1c4ff4={};_0x1c4ff4[_0x3d2515[_0x6cf2('0x23')]]={'$like':'%'+_0x204933[_0x6cf2('0x2b')][_0x6cf2('0x38')]+'%'};return _0x1c4ff4;}})});}_0x2fb2bf=_[_0x6cf2('0x39')]({},_0x2fb2bf,_0x204933['options']);var _0x14b224={'where':_0x2fb2bf[_0x6cf2('0x36')]};return db['OpenchannelApplication'][_0x6cf2('0x1a')](_0x14b224)[_0x6cf2('0x20')](function(_0x4da801){_0x2db94b[_0x6cf2('0x1a')]=_0x4da801;if(_0x204933[_0x6cf2('0x2b')]['includeAll']){_0x2fb2bf['include']=[{'all':!![]}];}return db[_0x6cf2('0x27')][_0x6cf2('0x3c')](_0x2fb2bf);})['then'](function(_0x3c11b2){_0x2db94b[_0x6cf2('0x3d')]=_0x3c11b2;return _0x2db94b;})[_0x6cf2('0x20')](respondWithFilteredResult(_0x3ef461,_0x2fb2bf))[_0x6cf2('0x3e')](handleError(_0x3ef461,null));};exports[_0x6cf2('0x3f')]=function(_0x5527d2,_0x43a661){var _0x50d8f1={'raw':!![],'where':{'id':_0x5527d2[_0x6cf2('0x40')]['id']}},_0x598e44={};_0x598e44[_0x6cf2('0x2a')]=_[_0x6cf2('0x41')](db[_0x6cf2('0x27')][_0x6cf2('0x42')]);_0x598e44[_0x6cf2('0x2b')]=_['keys'](_0x5527d2[_0x6cf2('0x2b')]);_0x598e44['filters']=_['intersection'](_0x598e44[_0x6cf2('0x2a')],_0x598e44[_0x6cf2('0x2b')]);_0x50d8f1[_0x6cf2('0x2d')]=_[_0x6cf2('0x2e')](_0x598e44[_0x6cf2('0x2a')],qs[_0x6cf2('0x2f')](_0x5527d2[_0x6cf2('0x2b')][_0x6cf2('0x2f')]));_0x50d8f1[_0x6cf2('0x2d')]=_0x50d8f1[_0x6cf2('0x2d')][_0x6cf2('0x30')]?_0x50d8f1[_0x6cf2('0x2d')]:_0x598e44['model'];if(_0x5527d2[_0x6cf2('0x2b')][_0x6cf2('0x43')]){_0x50d8f1[_0x6cf2('0x44')]=[{'all':!![]}];}_0x50d8f1=_[_0x6cf2('0x39')]({},_0x50d8f1,_0x5527d2[_0x6cf2('0x45')]);return db[_0x6cf2('0x27')]['find'](_0x50d8f1)[_0x6cf2('0x20')](handleEntityNotFound(_0x43a661,null))['then'](respondWithResult(_0x43a661,null))[_0x6cf2('0x3e')](handleError(_0x43a661,null));};exports['create']=function(_0x51e16e,_0x4ddd10){return db[_0x6cf2('0x27')]['create'](_0x51e16e[_0x6cf2('0x46')],{})['then'](respondWithResult(_0x4ddd10,0xc9))[_0x6cf2('0x3e')](handleError(_0x4ddd10,null));};exports[_0x6cf2('0x1f')]=function(_0x4907d0,_0x5ce13d){if(_0x4907d0['body']['id']){delete _0x4907d0['body']['id'];}return db[_0x6cf2('0x27')][_0x6cf2('0x47')]({'where':{'id':_0x4907d0['params']['id']}})[_0x6cf2('0x20')](handleEntityNotFound(_0x5ce13d,null))[_0x6cf2('0x20')](saveUpdates(_0x4907d0[_0x6cf2('0x46')],null))[_0x6cf2('0x20')](respondWithResult(_0x5ce13d,null))[_0x6cf2('0x3e')](handleError(_0x5ce13d,null));};exports['destroy']=function(_0xdba99e,_0x76706f){return db[_0x6cf2('0x27')][_0x6cf2('0x47')]({'where':{'id':_0xdba99e[_0x6cf2('0x40')]['id']}})[_0x6cf2('0x20')](handleEntityNotFound(_0x76706f,null))[_0x6cf2('0x20')](removeEntity(_0x76706f,null))[_0x6cf2('0x3e')](handleError(_0x76706f,null));}; \ No newline at end of file +var _0x5009=['util','path','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','error','stack','name','send','index','map','OpenchannelApplication','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','includeAll','then','catch','rawAttributes','include','options','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x2a102d,_0x1a851a){var _0xac258f=function(_0x38dfd0){while(--_0x38dfd0){_0x2a102d['push'](_0x2a102d['shift']());}};_0xac258f(++_0x1a851a);}(_0x5009,0x113));var _0x9500=function(_0x4ef880,_0x3148a7){_0x4ef880=_0x4ef880-0x0;var _0x28ddca=_0x5009[_0x4ef880];return _0x28ddca;};'use strict';var emlformat=require(_0x9500('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9500('0x1'));var jsonpatch=require(_0x9500('0x2'));var rp=require(_0x9500('0x3'));var moment=require(_0x9500('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9500('0x5'));var path=require(_0x9500('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9500('0x7'));var fs=require('fs');var fs_extra=require(_0x9500('0x8'));var _=require('lodash');var squel=require(_0x9500('0x9'));var crypto=require(_0x9500('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9500('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9500('0xc'));var Papa=require(_0x9500('0xd'));var Redis=require('ioredis');var authService=require(_0x9500('0xe'));var qs=require(_0x9500('0xf'));var as=require(_0x9500('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9500('0x11'))('api');var utils=require(_0x9500('0x12'));var config=require(_0x9500('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9500('0x14'))['db'];function respondWithStatusCode(_0x1005a9,_0x326342){_0x326342=_0x326342||0xcc;return function(_0x319ad9){if(_0x319ad9){return _0x1005a9[_0x9500('0x15')](_0x326342);}return _0x1005a9['status'](_0x326342)[_0x9500('0x16')]();};}function respondWithResult(_0x3b7c01,_0x2cc221){_0x2cc221=_0x2cc221||0xc8;return function(_0x45b6fe){if(_0x45b6fe){return _0x3b7c01[_0x9500('0x17')](_0x2cc221)[_0x9500('0x18')](_0x45b6fe);}};}function respondWithFilteredResult(_0x2c2ced,_0x5c5a34){return function(_0x327264){if(_0x327264){var _0x3cd713=typeof _0x5c5a34['offset']===_0x9500('0x19')&&typeof _0x5c5a34[_0x9500('0x1a')]===_0x9500('0x19');var _0x4d753d=_0x327264[_0x9500('0x1b')];var _0x3f77ce=_0x3cd713?0x0:_0x5c5a34[_0x9500('0x1c')];var _0x42c5d1=_0x3cd713?_0x327264['count']:_0x5c5a34[_0x9500('0x1c')]+_0x5c5a34[_0x9500('0x1a')];var _0xe2f5bf;if(_0x42c5d1>=_0x4d753d){_0x42c5d1=_0x4d753d;_0xe2f5bf=0xc8;}else{_0xe2f5bf=0xce;}_0x2c2ced[_0x9500('0x17')](_0xe2f5bf);return _0x2c2ced[_0x9500('0x1d')]('Content-Range',_0x3f77ce+'-'+_0x42c5d1+'/'+_0x4d753d)[_0x9500('0x18')](_0x327264);}return null;};}function patchUpdates(_0x12a20e){return function(_0x4624ab){try{jsonpatch[_0x9500('0x1e')](_0x4624ab,_0x12a20e,!![]);}catch(_0xf04ace){return BPromise[_0x9500('0x1f')](_0xf04ace);}return _0x4624ab[_0x9500('0x20')]();};}function saveUpdates(_0xdd1658,_0x1e2775){return function(_0x23d983){if(_0x23d983){return _0x23d983[_0x9500('0x21')](_0xdd1658)['then'](function(_0x395906){return _0x395906;});}return null;};}function removeEntity(_0x54b6af,_0x570214){return function(_0x49e35a){if(_0x49e35a){return _0x49e35a[_0x9500('0x22')]()['then'](function(){_0x54b6af['status'](0xcc)[_0x9500('0x16')]();});}};}function handleEntityNotFound(_0x140c07,_0x326440){return function(_0x19fbb9){if(!_0x19fbb9){_0x140c07[_0x9500('0x15')](0x194);}return _0x19fbb9;};}function handleError(_0xbfea9f,_0x207b39){_0x207b39=_0x207b39||0x1f4;return function(_0x218537){logger[_0x9500('0x23')](_0x218537[_0x9500('0x24')]);if(_0x218537[_0x9500('0x25')]){delete _0x218537['name'];}_0xbfea9f[_0x9500('0x17')](_0x207b39)[_0x9500('0x26')](_0x218537);};}exports[_0x9500('0x27')]=function(_0x5151b2,_0x15830c){var _0xdb0dfc={},_0x19a1cd={},_0x38b7f0={'count':0x0,'rows':[]};var _0xde1e5b=_[_0x9500('0x28')](db[_0x9500('0x29')]['rawAttributes'],function(_0x48c103){return{'name':_0x48c103[_0x9500('0x2a')],'type':_0x48c103['type'][_0x9500('0x2b')]};});_0x19a1cd['model']=_[_0x9500('0x28')](_0xde1e5b,_0x9500('0x25'));_0x19a1cd[_0x9500('0x2c')]=_[_0x9500('0x2d')](_0x5151b2[_0x9500('0x2c')]);_0x19a1cd[_0x9500('0x2e')]=_['intersection'](_0x19a1cd[_0x9500('0x2f')],_0x19a1cd[_0x9500('0x2c')]);_0xdb0dfc[_0x9500('0x30')]=_[_0x9500('0x31')](_0x19a1cd['model'],qs[_0x9500('0x32')](_0x5151b2[_0x9500('0x2c')][_0x9500('0x32')]));_0xdb0dfc[_0x9500('0x30')]=_0xdb0dfc[_0x9500('0x30')][_0x9500('0x33')]?_0xdb0dfc[_0x9500('0x30')]:_0x19a1cd['model'];if(!_0x5151b2['query'][_0x9500('0x34')]('nolimit')){_0xdb0dfc[_0x9500('0x1a')]=qs['limit'](_0x5151b2[_0x9500('0x2c')][_0x9500('0x1a')]);_0xdb0dfc[_0x9500('0x1c')]=qs['offset'](_0x5151b2['query'][_0x9500('0x1c')]);}_0xdb0dfc[_0x9500('0x35')]=qs['sort'](_0x5151b2[_0x9500('0x2c')][_0x9500('0x36')]);_0xdb0dfc[_0x9500('0x37')]=qs[_0x9500('0x2e')](_['pick'](_0x5151b2[_0x9500('0x2c')],_0x19a1cd[_0x9500('0x2e')]),_0xde1e5b);if(_0x5151b2[_0x9500('0x2c')][_0x9500('0x38')]){_0xdb0dfc[_0x9500('0x37')]=_[_0x9500('0x39')](_0xdb0dfc[_0x9500('0x37')],{'$or':_[_0x9500('0x28')](_0xde1e5b,function(_0x3af646){if(_0x3af646[_0x9500('0x3a')]!==_0x9500('0x3b')){var _0x368b0c={};_0x368b0c[_0x3af646['name']]={'$like':'%'+_0x5151b2[_0x9500('0x2c')][_0x9500('0x38')]+'%'};return _0x368b0c;}})});}_0xdb0dfc=_[_0x9500('0x39')]({},_0xdb0dfc,_0x5151b2['options']);var _0x3cad75={'where':_0xdb0dfc['where']};return db[_0x9500('0x29')][_0x9500('0x1b')](_0x3cad75)['then'](function(_0x5c6d56){_0x38b7f0['count']=_0x5c6d56;if(_0x5151b2['query'][_0x9500('0x3c')]){_0xdb0dfc['include']=[{'all':!![]}];}return db[_0x9500('0x29')]['findAll'](_0xdb0dfc);})[_0x9500('0x3d')](function(_0x2f76dd){_0x38b7f0['rows']=_0x2f76dd;return _0x38b7f0;})[_0x9500('0x3d')](respondWithFilteredResult(_0x15830c,_0xdb0dfc))[_0x9500('0x3e')](handleError(_0x15830c,null));};exports['show']=function(_0x5abf60,_0x25dfdb){var _0x247a2b={'raw':!![],'where':{'id':_0x5abf60['params']['id']}},_0x393973={};_0x393973[_0x9500('0x2f')]=_[_0x9500('0x2d')](db[_0x9500('0x29')][_0x9500('0x3f')]);_0x393973[_0x9500('0x2c')]=_[_0x9500('0x2d')](_0x5abf60[_0x9500('0x2c')]);_0x393973['filters']=_[_0x9500('0x31')](_0x393973['model'],_0x393973[_0x9500('0x2c')]);_0x247a2b[_0x9500('0x30')]=_[_0x9500('0x31')](_0x393973[_0x9500('0x2f')],qs[_0x9500('0x32')](_0x5abf60[_0x9500('0x2c')][_0x9500('0x32')]));_0x247a2b[_0x9500('0x30')]=_0x247a2b[_0x9500('0x30')][_0x9500('0x33')]?_0x247a2b[_0x9500('0x30')]:_0x393973['model'];if(_0x5abf60[_0x9500('0x2c')][_0x9500('0x3c')]){_0x247a2b[_0x9500('0x40')]=[{'all':!![]}];}_0x247a2b=_[_0x9500('0x39')]({},_0x247a2b,_0x5abf60[_0x9500('0x41')]);return db[_0x9500('0x29')][_0x9500('0x42')](_0x247a2b)[_0x9500('0x3d')](handleEntityNotFound(_0x25dfdb,null))[_0x9500('0x3d')](respondWithResult(_0x25dfdb,null))[_0x9500('0x3e')](handleError(_0x25dfdb,null));};exports['create']=function(_0x39820b,_0x7dc51d){return db[_0x9500('0x29')][_0x9500('0x43')](_0x39820b['body'],{})[_0x9500('0x3d')](respondWithResult(_0x7dc51d,0xc9))['catch'](handleError(_0x7dc51d,null));};exports[_0x9500('0x21')]=function(_0x1028fc,_0x1f13a1){if(_0x1028fc[_0x9500('0x44')]['id']){delete _0x1028fc[_0x9500('0x44')]['id'];}return db['OpenchannelApplication'][_0x9500('0x42')]({'where':{'id':_0x1028fc['params']['id']}})[_0x9500('0x3d')](handleEntityNotFound(_0x1f13a1,null))['then'](saveUpdates(_0x1028fc[_0x9500('0x44')],null))[_0x9500('0x3d')](respondWithResult(_0x1f13a1,null))[_0x9500('0x3e')](handleError(_0x1f13a1,null));};exports[_0x9500('0x22')]=function(_0x2142e7,_0x8cd3fd){return db['OpenchannelApplication']['find']({'where':{'id':_0x2142e7[_0x9500('0x45')]['id']}})[_0x9500('0x3d')](handleEntityNotFound(_0x8cd3fd,null))['then'](removeEntity(_0x8cd3fd,null))[_0x9500('0x3e')](handleError(_0x8cd3fd,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index c4fc891..6b6ef10 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 _0xb3da=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./openchannelApplication.attributes','define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1abb61,_0x475834){var _0x2d71e7=function(_0x46a3d8){while(--_0x46a3d8){_0x1abb61['push'](_0x1abb61['shift']());}};_0x2d71e7(++_0x475834);}(_0xb3da,0x12b));var _0xab3d=function(_0x333151,_0x8965a3){_0x333151=_0x333151-0x0;var _0x57154c=_0xb3da[_0x333151];return _0x57154c;};'use strict';var _=require(_0xab3d('0x0'));var util=require(_0xab3d('0x1'));var logger=require(_0xab3d('0x2'))(_0xab3d('0x3'));var moment=require(_0xab3d('0x4'));var BPromise=require(_0xab3d('0x5'));var rp=require(_0xab3d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xab3d('0x7'));var attributes=require(_0xab3d('0x8'));module['exports']=function(_0x30724a,_0x5c823a){return _0x30724a[_0xab3d('0x9')]('OpenchannelApplication',attributes,{'tableName':_0xab3d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xab3d('0xb'),'collate':_0xab3d('0xc')});}; \ No newline at end of file +var _0x7c7d=['api','moment','request-promise','path','./openchannelApplication.attributes','define','openchannel_applications','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0xa417ff,_0x2ab57c){var _0x2c0a82=function(_0x118e47){while(--_0x118e47){_0xa417ff['push'](_0xa417ff['shift']());}};_0x2c0a82(++_0x2ab57c);}(_0x7c7d,0xe4));var _0xd7c7=function(_0x4307a5,_0x148615){_0x4307a5=_0x4307a5-0x0;var _0x6c146e=_0x7c7d[_0x4307a5];return _0x6c146e;};'use strict';var _=require('lodash');var util=require(_0xd7c7('0x0'));var logger=require(_0xd7c7('0x1'))(_0xd7c7('0x2'));var moment=require(_0xd7c7('0x3'));var BPromise=require('bluebird');var rp=require(_0xd7c7('0x4'));var fs=require('fs');var path=require(_0xd7c7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd7c7('0x6'));module['exports']=function(_0x4062fc,_0x15b740){return _0x4062fc[_0xd7c7('0x7')]('OpenchannelApplication',attributes,{'tableName':_0xd7c7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd7c7('0x9')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 835aa2f..50f5fbc 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 _0xd341=['../../config/utils','../../config/logger','../../config/environment','request','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','OpenchannelApplication','update','body','options','raw','limit','UpdateOpenchannelApplication','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x442e55,_0x5c6404){var _0x547168=function(_0x5658fd){while(--_0x5658fd){_0x442e55['push'](_0x442e55['shift']());}};_0x547168(++_0x5c6404);}(_0xd341,0xd3));var _0x1d34=function(_0x2711fa,_0x1aa9db){_0x2711fa=_0x2711fa-0x0;var _0x2b2ab6=_0xd341[_0x2711fa];return _0x2b2ab6;};'use strict';var _=require('lodash');var util=require(_0x1d34('0x0'));var moment=require(_0x1d34('0x1'));var BPromise=require('bluebird');var rs=require(_0x1d34('0x2'));var fs=require('fs');var Redis=require(_0x1d34('0x3'));var db=require(_0x1d34('0x4'))['db'];var utils=require(_0x1d34('0x5'));var logger=require(_0x1d34('0x6'))('rpc');var config=require(_0x1d34('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1284aa,_0x261a14,_0x76885){return new BPromise(function(_0x4ef05f,_0x14d7be){return client[_0x1d34('0x8')](_0x1284aa,_0x76885)[_0x1d34('0x9')](function(_0x560d1e){logger[_0x1d34('0xa')](_0x1d34('0xb'),_0x261a14,'request\x20sent');logger[_0x1d34('0xc')](_0x1d34('0xd'),_0x261a14,_0x1d34('0xe'),JSON['stringify'](_0x560d1e));if(_0x560d1e[_0x1d34('0xf')]){if(_0x560d1e[_0x1d34('0xf')][_0x1d34('0x10')]===0x1f4){logger[_0x1d34('0xf')](_0x1d34('0xb'),_0x261a14,_0x560d1e[_0x1d34('0xf')]['message']);return _0x14d7be(_0x560d1e['error'][_0x1d34('0x11')]);}logger[_0x1d34('0xf')](_0x1d34('0xb'),_0x261a14,_0x560d1e[_0x1d34('0xf')][_0x1d34('0x11')]);return _0x4ef05f(_0x560d1e[_0x1d34('0xf')][_0x1d34('0x11')]);}else{logger[_0x1d34('0xa')](_0x1d34('0xb'),_0x261a14,_0x1d34('0xe'));_0x4ef05f(_0x560d1e[_0x1d34('0x12')][_0x1d34('0x11')]);}})['catch'](function(_0x3753ee){logger[_0x1d34('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x261a14,_0x3753ee);_0x14d7be(_0x3753ee);});});}exports['UpdateOpenchannelApplication']=function(_0xc1bc56){var _0x2dc566=this;return new Promise(function(_0x1efb14,_0x272b4f){return db[_0x1d34('0x13')][_0x1d34('0x14')](_0xc1bc56[_0x1d34('0x15')],{'raw':_0xc1bc56[_0x1d34('0x16')]?_0xc1bc56[_0x1d34('0x16')][_0x1d34('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc1bc56[_0x1d34('0x16')]?_0xc1bc56[_0x1d34('0x16')]['where']||null:null,'attributes':_0xc1bc56[_0x1d34('0x16')]?_0xc1bc56[_0x1d34('0x16')]['attributes']||null:null,'limit':_0xc1bc56[_0x1d34('0x16')]?_0xc1bc56[_0x1d34('0x16')][_0x1d34('0x18')]||null:null})['then'](function(_0x1f3c85){logger[_0x1d34('0xa')](_0x1d34('0x19'),_0xc1bc56);logger[_0x1d34('0xc')]('UpdateOpenchannelApplication',_0xc1bc56,JSON['stringify'](_0x1f3c85));_0x1efb14(_0x1f3c85);})[_0x1d34('0x1a')](function(_0x2263d){logger[_0x1d34('0xf')](_0x1d34('0x19'),_0x2263d[_0x1d34('0x11')],_0xc1bc56);_0x272b4f(_0x2dc566[_0x1d34('0xf')](0x1f4,_0x2263d[_0x1d34('0x11')]));});});}; \ No newline at end of file +var _0x2b6c=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateOpenchannelApplication','OpenchannelApplication','body','options','where','attributes','limit','util','moment','bluebird','randomstring'];(function(_0x4cbc66,_0x563ba5){var _0x3ee478=function(_0x2b576a){while(--_0x2b576a){_0x4cbc66['push'](_0x4cbc66['shift']());}};_0x3ee478(++_0x563ba5);}(_0x2b6c,0x158));var _0xc2b6=function(_0x1aecdc,_0x522a27){_0x1aecdc=_0x1aecdc-0x0;var _0xef638b=_0x2b6c[_0x1aecdc];return _0xef638b;};'use strict';var _=require('lodash');var util=require(_0xc2b6('0x0'));var moment=require(_0xc2b6('0x1'));var BPromise=require(_0xc2b6('0x2'));var rs=require(_0xc2b6('0x3'));var fs=require('fs');var Redis=require(_0xc2b6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc2b6('0x5'));var logger=require(_0xc2b6('0x6'))(_0xc2b6('0x7'));var config=require(_0xc2b6('0x8'));var jayson=require(_0xc2b6('0x9'));var client=jayson[_0xc2b6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5835ef,_0x928bf4,_0x3d1453){return new BPromise(function(_0x352e8b,_0x4ef2b8){return client[_0xc2b6('0xb')](_0x5835ef,_0x3d1453)[_0xc2b6('0xc')](function(_0x4df050){logger[_0xc2b6('0xd')](_0xc2b6('0xe'),_0x928bf4,_0xc2b6('0xf'));logger[_0xc2b6('0x10')](_0xc2b6('0x11'),_0x928bf4,_0xc2b6('0xf'),JSON[_0xc2b6('0x12')](_0x4df050));if(_0x4df050[_0xc2b6('0x13')]){if(_0x4df050['error'][_0xc2b6('0x14')]===0x1f4){logger[_0xc2b6('0x13')](_0xc2b6('0xe'),_0x928bf4,_0x4df050[_0xc2b6('0x13')][_0xc2b6('0x15')]);return _0x4ef2b8(_0x4df050['error'][_0xc2b6('0x15')]);}logger[_0xc2b6('0x13')](_0xc2b6('0xe'),_0x928bf4,_0x4df050['error'][_0xc2b6('0x15')]);return _0x352e8b(_0x4df050[_0xc2b6('0x13')][_0xc2b6('0x15')]);}else{logger[_0xc2b6('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x928bf4,_0xc2b6('0xf'));_0x352e8b(_0x4df050['result']['message']);}})['catch'](function(_0x119396){logger[_0xc2b6('0x13')](_0xc2b6('0xe'),_0x928bf4,_0x119396);_0x4ef2b8(_0x119396);});});}exports[_0xc2b6('0x16')]=function(_0x576a03){var _0x47e8c6=this;return new Promise(function(_0x50c6c8,_0x3474f2){return db[_0xc2b6('0x17')]['update'](_0x576a03[_0xc2b6('0x18')],{'raw':_0x576a03[_0xc2b6('0x19')]?_0x576a03[_0xc2b6('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x576a03[_0xc2b6('0x19')]?_0x576a03[_0xc2b6('0x19')][_0xc2b6('0x1a')]||null:null,'attributes':_0x576a03[_0xc2b6('0x19')]?_0x576a03[_0xc2b6('0x19')][_0xc2b6('0x1b')]||null:null,'limit':_0x576a03[_0xc2b6('0x19')]?_0x576a03[_0xc2b6('0x19')][_0xc2b6('0x1c')]||null:null})[_0xc2b6('0xc')](function(_0x3aaf75){logger[_0xc2b6('0xd')](_0xc2b6('0x16'),_0x576a03);logger[_0xc2b6('0x10')](_0xc2b6('0x16'),_0x576a03,JSON[_0xc2b6('0x12')](_0x3aaf75));_0x50c6c8(_0x3aaf75);})['catch'](function(_0x681bbf){logger[_0xc2b6('0x13')](_0xc2b6('0x16'),_0x681bbf[_0xc2b6('0x15')],_0x576a03);_0x3474f2(_0x47e8c6[_0xc2b6('0x13')](0x1f4,_0x681bbf[_0xc2b6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 441a295..bcfa5b3 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 _0x38a9=['/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','put','/:id','openchannelinteraction:update','openchannel','openchannelinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','index','get','isAuthenticated','show'];(function(_0x20a655,_0x1d37f0){var _0x15471e=function(_0x470727){while(--_0x470727){_0x20a655['push'](_0x20a655['shift']());}};_0x15471e(++_0x1d37f0);}(_0x38a9,0x10a));var _0x938a=function(_0xecebff,_0x28ddd5){_0xecebff=_0xecebff-0x0;var _0xc6db13=_0x38a9[_0xecebff];return _0xc6db13;};'use strict';var multer=require(_0x938a('0x0'));var util=require(_0x938a('0x1'));var path=require('path');var timeout=require(_0x938a('0x2'));var express=require(_0x938a('0x3'));var router=express[_0x938a('0x4')]();var fs_extra=require(_0x938a('0x5'));var auth=require(_0x938a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x938a('0x7'));var controller=require(_0x938a('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x938a('0x9')]);router[_0x938a('0xa')]('/describe',auth[_0x938a('0xb')](),controller['describe']);router[_0x938a('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x938a('0xc')]);router[_0x938a('0xa')](_0x938a('0xd'),auth['isAuthenticated'](),controller[_0x938a('0xe')]);router['get'](_0x938a('0xf'),auth['isAuthenticated'](),controller[_0x938a('0x10')]);router[_0x938a('0x11')]('/',auth[_0x938a('0xb')](),controller[_0x938a('0x12')]);router[_0x938a('0x11')](_0x938a('0xd'),auth[_0x938a('0xb')](),controller[_0x938a('0x13')]);router[_0x938a('0x11')]('/:id/tags',auth[_0x938a('0xb')](),interaction[_0x938a('0x14')]('openchannel','openchannelinteraction:addtags'),controller['addTags']);router[_0x938a('0x15')](_0x938a('0x16'),auth[_0x938a('0xb')](),interaction[_0x938a('0x14')]('openchannel',_0x938a('0x17')),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x938a('0x18'),_0x938a('0x19')),controller[_0x938a('0x1a')]);router[_0x938a('0x1b')](_0x938a('0x1c'),auth[_0x938a('0xb')](),controller[_0x938a('0x1d')]);module[_0x938a('0x1e')]=router; \ No newline at end of file +var _0x2de9=['removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','/describe','describe','/:id','isAuthenticated','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy'];(function(_0x441a8b,_0x443d8b){var _0x23a72f=function(_0x472df4){while(--_0x472df4){_0x441a8b['push'](_0x441a8b['shift']());}};_0x23a72f(++_0x443d8b);}(_0x2de9,0x1ae));var _0x92de=function(_0x38c6db,_0x54e36f){_0x38c6db=_0x38c6db-0x0;var _0x19638d=_0x2de9[_0x38c6db];return _0x19638d;};'use strict';var multer=require(_0x92de('0x0'));var util=require(_0x92de('0x1'));var path=require(_0x92de('0x2'));var timeout=require(_0x92de('0x3'));var express=require(_0x92de('0x4'));var router=express[_0x92de('0x5')]();var fs_extra=require(_0x92de('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x92de('0x7'));var config=require(_0x92de('0x8'));var controller=require(_0x92de('0x9'));router[_0x92de('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x92de('0xb'),auth['isAuthenticated'](),controller[_0x92de('0xc')]);router[_0x92de('0xa')](_0x92de('0xd'),auth[_0x92de('0xe')](),controller[_0x92de('0xf')]);router[_0x92de('0xa')]('/:id/messages',auth[_0x92de('0xe')](),controller[_0x92de('0x10')]);router[_0x92de('0xa')](_0x92de('0x11'),auth[_0x92de('0xe')](),controller[_0x92de('0x12')]);router[_0x92de('0x13')]('/',auth['isAuthenticated'](),controller[_0x92de('0x14')]);router[_0x92de('0x13')](_0x92de('0x15'),auth[_0x92de('0xe')](),controller[_0x92de('0x16')]);router[_0x92de('0x13')](_0x92de('0x17'),auth[_0x92de('0xe')](),interaction[_0x92de('0x18')](_0x92de('0x19'),_0x92de('0x1a')),controller['addTags']);router[_0x92de('0x1b')](_0x92de('0xd'),auth['isAuthenticated'](),interaction[_0x92de('0x18')](_0x92de('0x19'),_0x92de('0x1c')),controller[_0x92de('0x1d')]);router[_0x92de('0x1e')]('/:id',auth[_0x92de('0xe')](),interaction[_0x92de('0x18')](_0x92de('0x19'),_0x92de('0x1f')),controller['destroy']);router[_0x92de('0x1e')](_0x92de('0x17'),auth[_0x92de('0xe')](),controller[_0x92de('0x20')]);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 678384d..53738ae 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 _0xaac0=['ENUM','out','BOOLEAN','INTEGER','sequelize','exports','DATE','STRING'];(function(_0xf5a4c9,_0x5cf70e){var _0x23b68f=function(_0x35e79a){while(--_0x35e79a){_0xf5a4c9['push'](_0xf5a4c9['shift']());}};_0x23b68f(++_0x5cf70e);}(_0xaac0,0x10c));var _0x0aac=function(_0x3550b4,_0x59b309){_0x3550b4=_0x3550b4-0x0;var _0x237bca=_0xaac0[_0x3550b4];return _0x237bca;};'use strict';var Sequelize=require(_0x0aac('0x0'));module[_0x0aac('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0aac('0x2')]},'disposition':{'type':Sequelize[_0x0aac('0x3')]},'secondDisposition':{'type':Sequelize[_0x0aac('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0aac('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x0aac('0x3')]},'externalUrl':{'type':Sequelize[_0x0aac('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x0aac('0x4')]('in',_0x0aac('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x0aac('0x4')]('in',_0x0aac('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0aac('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x0aac('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x0aac('0x7')]}}; \ No newline at end of file +var _0xbdb7=['BOOLEAN','DATE','STRING','out','ENUM','INTEGER','sequelize','exports'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x223b0c,_0x371c5a){_0x223b0c=_0x223b0c-0x0;var _0x4ce5ed=_0xbdb7[_0x223b0c];return _0x4ce5ed;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'closed':{'type':Sequelize[_0x7bdb('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7bdb('0x3')]},'disposition':{'type':Sequelize[_0x7bdb('0x4')]},'secondDisposition':{'type':Sequelize[_0x7bdb('0x4')]},'thirdDisposition':{'type':Sequelize[_0x7bdb('0x4')]},'note':{'type':Sequelize[_0x7bdb('0x4')]},'read1stAt':{'type':Sequelize[_0x7bdb('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x7bdb('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7bdb('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x7bdb('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x7bdb('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x7bdb('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 6bb341c..f0ec10c 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 _0x1803=['unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','secret','Account','Owner','get','Openchannel','closed','threadId','Public','Private','basename','pipe','createWriteStream','out','System','read','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','moment','util','path','lodash','ioredis','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','status','json','offset','undefined','count','limit','Content-Range','update','destroy','end','sendStatus','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','user','then','catch','show','from','params','keys','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','create','body','find','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','hasOwnProperty','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','Tag','color','emit','openchannelInteractionTags:save','removeTags','download'];(function(_0x4832df,_0x25f966){var _0x212038=function(_0xc86c0b){while(--_0xc86c0b){_0x4832df['push'](_0x4832df['shift']());}};_0x212038(++_0x25f966);}(_0x1803,0xa9));var _0x3180=function(_0x3a8c1b,_0x5d4e5d){_0x3a8c1b=_0x3a8c1b-0x0;var _0x2f3c39=_0x1803[_0x3a8c1b];return _0x2f3c39;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x3180('0x0'));var util=require(_0x3180('0x1'));var path=require(_0x3180('0x2'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3180('0x3'));var Redis=require(_0x3180('0x4'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x3180('0x5'))(_0x3180('0x6'));var config=require('../../config/environment');var db=require(_0x3180('0x7'))['db'];config[_0x3180('0x8')]=_[_0x3180('0x9')](config[_0x3180('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x3180('0xa'))(new Redis(config['redis']));require(_0x3180('0xb'))['register'](socket);function respondWithStatusCode(_0xaca1e6,_0x4fb161){_0x4fb161=_0x4fb161||0xcc;return function(_0x1f36d8){if(_0x1f36d8){return _0xaca1e6['sendStatus'](_0x4fb161);}return _0xaca1e6[_0x3180('0xc')](_0x4fb161)['end']();};}function respondWithResult(_0x6e4ef8,_0x3e9cd2){_0x3e9cd2=_0x3e9cd2||0xc8;return function(_0x27b9f0){if(_0x27b9f0){return _0x6e4ef8[_0x3180('0xc')](_0x3e9cd2)[_0x3180('0xd')](_0x27b9f0);}};}function respondWithFilteredResult(_0x7ea2cb,_0x3bd2f6){return function(_0x529965){if(_0x529965){var _0x5ac542=typeof _0x3bd2f6[_0x3180('0xe')]===_0x3180('0xf')&&typeof _0x3bd2f6['limit']===_0x3180('0xf');var _0x2f6922=_0x529965['count'];var _0xd0ef53=_0x5ac542?0x0:_0x3bd2f6[_0x3180('0xe')];var _0x2a084a=_0x5ac542?_0x529965[_0x3180('0x10')]:_0x3bd2f6['offset']+_0x3bd2f6[_0x3180('0x11')];var _0x4d76ab;if(_0x2a084a>=_0x2f6922){_0x2a084a=_0x2f6922;_0x4d76ab=0xc8;}else{_0x4d76ab=0xce;}_0x7ea2cb[_0x3180('0xc')](_0x4d76ab);return _0x7ea2cb['set'](_0x3180('0x12'),_0xd0ef53+'-'+_0x2a084a+'/'+_0x2f6922)[_0x3180('0xd')](_0x529965);}return null;};}function saveUpdates(_0xbe7cf6){return function(_0x209ab8){if(_0x209ab8){return _0x209ab8[_0x3180('0x13')](_0xbe7cf6)['then'](function(_0x3cb81d){return _0x3cb81d;});}return null;};}function removeEntity(_0x527eb3){return function(_0x8b19dc){if(_0x8b19dc){return _0x8b19dc[_0x3180('0x14')]()['then'](function(){_0x527eb3['status'](0xcc)[_0x3180('0x15')]();});}};}function handleEntityNotFound(_0x543df2){return function(_0xabddf6){if(!_0xabddf6){_0x543df2[_0x3180('0x16')](0x194);}return _0xabddf6;};}function handleError(_0x1d246d,_0x2917e5){_0x2917e5=_0x2917e5||0x1f4;return function(_0x4b9a78){logger['error'](_0x4b9a78['stack']);if(_0x4b9a78[_0x3180('0x17')]){delete _0x4b9a78['name'];}_0x1d246d[_0x3180('0xc')](_0x2917e5)[_0x3180('0x18')](_0x4b9a78);};}exports[_0x3180('0x19')]=function(_0x178718,_0x350781){var _0x421aff={};var _0x19d41f=_[_0x3180('0x1a')](db[_0x3180('0x1b')][_0x3180('0x1c')],function(_0x483c3a){return{'name':_0x483c3a[_0x3180('0x1d')],'type':_0x483c3a[_0x3180('0x1e')][_0x3180('0x1f')]};});_0x421aff=qs[_0x3180('0x20')](_0x19d41f,_0x178718);return interaction[_0x3180('0x21')](_0x3180('0x22'),_0x178718[_0x3180('0x23')],_0x178718[_0x3180('0x24')],_0x421aff,_0x19d41f)[_0x3180('0x25')](respondWithFilteredResult(_0x350781,_0x421aff))[_0x3180('0x26')](handleError(_0x350781,null));};exports[_0x3180('0x27')]=function(_0x297134,_0x50ea46){var _0x3eb649={};if(_0x297134['query'][_0x3180('0x1e')]&&_0x297134[_0x3180('0x23')][_0x3180('0x1e')]==='from'){_0x3eb649[_0x3180('0x28')]=_0x297134[_0x3180('0x29')]['id'];}else{_0x3eb649['id']=_0x297134['params']['id'];}var _0x573502={'raw':![],'where':_0x3eb649},_0x33919b={};_0x33919b['model']=_[_0x3180('0x2a')](db[_0x3180('0x1b')][_0x3180('0x1c')]);_0x33919b['query']=_[_0x3180('0x2a')](_0x297134[_0x3180('0x23')]);_0x33919b[_0x3180('0x2b')]=_[_0x3180('0x2c')](_0x33919b[_0x3180('0x2d')],_0x33919b['query']);_0x573502[_0x3180('0x2e')]=_[_0x3180('0x2c')](_0x33919b['model'],qs['fields'](_0x297134[_0x3180('0x23')][_0x3180('0x2f')]));_0x573502[_0x3180('0x2e')]=_0x573502[_0x3180('0x2e')][_0x3180('0x30')]?_0x573502[_0x3180('0x2e')]:_0x33919b[_0x3180('0x2d')];if(_0x297134['query'][_0x3180('0x31')]){_0x573502[_0x3180('0x32')]=[{'all':!![]}];}_0x573502=_[_0x3180('0x33')]({},_0x573502,_0x297134[_0x3180('0x34')]);return db[_0x3180('0x1b')]['find'](_0x573502)[_0x3180('0x25')](handleEntityNotFound(_0x50ea46,null))[_0x3180('0x25')](respondWithResult(_0x50ea46,null))[_0x3180('0x26')](handleError(_0x50ea46,null));};exports[_0x3180('0x35')]=function(_0x4b82b2,_0x469d4c){return db[_0x3180('0x1b')]['create'](_0x4b82b2['body'],{})['then'](respondWithResult(_0x469d4c,0xc9))[_0x3180('0x26')](handleError(_0x469d4c,null));};exports['update']=function(_0x56374f,_0x1d3b94){if(_0x56374f[_0x3180('0x36')]['id']){delete _0x56374f[_0x3180('0x36')]['id'];}return db[_0x3180('0x1b')][_0x3180('0x37')]({'where':{'id':_0x56374f[_0x3180('0x29')]['id']}})[_0x3180('0x25')](handleEntityNotFound(_0x1d3b94,null))['then'](saveUpdates(_0x56374f[_0x3180('0x36')],null))[_0x3180('0x25')](respondWithResult(_0x1d3b94,null))[_0x3180('0x26')](handleError(_0x1d3b94,null));};exports[_0x3180('0x14')]=function(_0x37c5ef,_0x59bd79){return db[_0x3180('0x1b')][_0x3180('0x37')]({'where':{'id':_0x37c5ef['params']['id']}})['then'](handleEntityNotFound(_0x59bd79,null))[_0x3180('0x25')](removeEntity(_0x59bd79,null))['catch'](handleError(_0x59bd79,null));};exports[_0x3180('0x38')]=function(_0x3afc03,_0x3042bb){return db[_0x3180('0x1b')][_0x3180('0x38')]()[_0x3180('0x25')](respondWithResult(_0x3042bb,null))['catch'](handleError(_0x3042bb,null));};exports[_0x3180('0x39')]=function(_0x4b7203,_0xacede0){return db[_0x3180('0x3a')]['find']({'where':{'id':_0x4b7203[_0x3180('0x29')]['id']}})[_0x3180('0x25')](handleEntityNotFound(_0xacede0,null))[_0x3180('0x25')](function(_0x2914ee){if(_0x2914ee){return _0x2914ee[_0x3180('0x39')](_0x4b7203[_0x3180('0x36')][_0x3180('0x3b')],_[_0x3180('0x3c')](_0x4b7203[_0x3180('0x36')],[_0x3180('0x3b'),'id'])||{});}})[_0x3180('0x25')](respondWithResult(_0xacede0,null))[_0x3180('0x26')](handleError(_0xacede0,null));};exports[_0x3180('0x3d')]=function(_0x3f4265,_0x3b5f3a){var _0x2609ef={'raw':![],'where':{}};var _0x2936a0={};var _0x1f6567={'count':0x0,'rows':[]};return db[_0x3180('0x1b')][_0x3180('0x3e')]({'where':{'id':_0x3f4265[_0x3180('0x29')]['id']}})[_0x3180('0x25')](handleEntityNotFound(_0x3b5f3a,null))[_0x3180('0x25')](function(_0x1634b9){if(_0x1634b9){_0x2936a0[_0x3180('0x2d')]=_[_0x3180('0x2a')](db[_0x3180('0x3a')]['rawAttributes']);_0x2936a0[_0x3180('0x23')]=_[_0x3180('0x2a')](_0x3f4265[_0x3180('0x23')]);_0x2936a0['filters']=_[_0x3180('0x2c')](_0x2936a0[_0x3180('0x2d')],_0x2936a0[_0x3180('0x23')]);_0x2609ef[_0x3180('0x2e')]=_[_0x3180('0x2c')](_0x2936a0[_0x3180('0x2d')],qs[_0x3180('0x2f')](_0x3f4265['query'][_0x3180('0x2f')]));_0x2609ef['attributes']=_0x2609ef[_0x3180('0x2e')][_0x3180('0x30')]?_0x2609ef[_0x3180('0x2e')]:_0x2936a0[_0x3180('0x2d')];if(!_0x3f4265[_0x3180('0x23')][_0x3180('0x3f')]('nolimit')){_0x2609ef[_0x3180('0x11')]=qs[_0x3180('0x11')](_0x3f4265['query'][_0x3180('0x11')]);_0x2609ef[_0x3180('0xe')]=qs[_0x3180('0xe')](_0x3f4265[_0x3180('0x23')][_0x3180('0xe')]);}_0x2609ef['order']=qs[_0x3180('0x40')](_0x3f4265[_0x3180('0x23')][_0x3180('0x40')]);_0x2609ef[_0x3180('0x41')]=qs['filters'](_[_0x3180('0x42')](_0x3f4265[_0x3180('0x23')],_0x2936a0['filters']));_0x2609ef[_0x3180('0x41')][_0x3180('0x43')]=_0x1634b9['id'];if(_0x3f4265[_0x3180('0x23')][_0x3180('0x44')]){_0x2609ef[_0x3180('0x41')]=_[_0x3180('0x33')](_0x2609ef[_0x3180('0x41')],{'$or':_[_0x3180('0x1a')](_0x2609ef['attributes'],function(_0x4100ac){var _0x5e4604={};_0x5e4604[_0x4100ac]={'$like':'%'+_0x3f4265['query'][_0x3180('0x44')]+'%'};return _0x5e4604;})});}if(_0x3f4265[_0x3180('0x23')][_0x3180('0x45')]){var _0x53b424=_0x3f4265[_0x3180('0x23')][_0x3180('0x45')][_0x3180('0x46')](',');var _0x43a26d={};_0x43a26d[_0x53b424[0x0]]={'$gte':moment(_0x53b424[0x1])[_0x3180('0x47')](_0x3180('0x48'))};_0x2609ef[_0x3180('0x41')]=_[_0x3180('0x33')](_0x2609ef[_0x3180('0x41')],_0x43a26d);}_0x2609ef=_[_0x3180('0x33')]({},_0x2609ef,_0x3f4265[_0x3180('0x34')]);return db['OpenchannelMessage'][_0x3180('0x10')]({'where':_0x2609ef['where']})[_0x3180('0x25')](function(_0x3d1086){_0x1f6567[_0x3180('0x10')]=_0x3d1086;if(_0x3f4265[_0x3180('0x23')][_0x3180('0x31')]){_0x2609ef[_0x3180('0x32')]=[{'all':!![]}];}return db[_0x3180('0x3a')][_0x3180('0x21')](_0x2609ef);})[_0x3180('0x25')](function(_0xf1715f){_0x1f6567[_0x3180('0x49')]=_0xf1715f;return _0x1f6567;});}})[_0x3180('0x25')](respondWithFilteredResult(_0x3b5f3a,_0x2609ef))[_0x3180('0x26')](handleError(_0x3b5f3a,null));};exports['addTags']=function(_0x5ae2dd,_0x364b2b){return db[_0x3180('0x1b')][_0x3180('0x37')]({'where':{'id':_0x5ae2dd[_0x3180('0x29')]['id']}})[_0x3180('0x25')](handleEntityNotFound(_0x364b2b,null))[_0x3180('0x25')](function(_0x52e83d){if(_0x52e83d){return _0x52e83d[_0x3180('0x4a')](_0x5ae2dd[_0x3180('0x36')][_0x3180('0x3b')],_['omit'](_0x5ae2dd[_0x3180('0x36')],[_0x3180('0x3b'),'id'])||{})['spread'](function(){return db[_0x3180('0x4b')][_0x3180('0x21')]({'attributes':['id',_0x3180('0x17'),_0x3180('0x4c')],'where':{'id':_0x5ae2dd[_0x3180('0x36')][_0x3180('0x3b')]}});})[_0x3180('0x25')](function(_0x23805d){socket[_0x3180('0x4d')](_0x3180('0x4e'),{'id':Number(_0x5ae2dd[_0x3180('0x29')]['id']),'tags':_0x23805d||[]});return{'id':Number(_0x5ae2dd[_0x3180('0x29')]['id']),'tags':_0x23805d||[]};});}})[_0x3180('0x25')](respondWithResult(_0x364b2b,null))[_0x3180('0x26')](handleError(_0x364b2b,null));};exports['removeTags']=function(_0x1df4fb,_0x312a7d){return db[_0x3180('0x1b')][_0x3180('0x37')]({'where':{'id':_0x1df4fb['params']['id']}})['then'](handleEntityNotFound(_0x312a7d,null))[_0x3180('0x25')](function(_0x2c47e8){if(_0x2c47e8){return _0x2c47e8[_0x3180('0x4f')](_0x1df4fb[_0x3180('0x23')]['ids']);}})[_0x3180('0x25')](respondWithStatusCode(_0x312a7d,null))[_0x3180('0x26')](handleError(_0x312a7d,null));};exports[_0x3180('0x50')]=function(_0x1577f3,_0x18840f){var _0xf7d969=moment()[_0x3180('0x51')]()[_0x3180('0x52')]();var _0x472891=path[_0x3180('0x53')](config[_0x3180('0x54')],_0x3180('0x55'),_0x3180('0x56'),_0x3180('0x57'));var _0x322a4e=path[_0x3180('0x53')](config['root'],_0x3180('0x55'),'files','attachments');var _0x37c7b2=path[_0x3180('0x53')](_0x472891,_0xf7d969);var _0x1c915f=util['format'](_0x3180('0x58'),_0x1577f3[_0x3180('0x29')]['id'],_0xf7d969);var _0x5805da=path[_0x3180('0x53')](_0x472891,_0x1c915f);var _0x2f188e=[];_0x2f188e[_0x3180('0x59')]({'model':db[_0x3180('0x5a')],'as':_0x3180('0x5a'),'attributes':['id',_0x3180('0x5b')],'raw':!![]});_0x2f188e[_0x3180('0x59')]({'model':db[_0x3180('0x5c')],'as':_0x3180('0x5d'),'attributes':['id',_0x3180('0x5e'),_0x3180('0x5f')],'raw':!![]});if(_0x1577f3[_0x3180('0x23')][_0x3180('0x60')]){_0x2f188e[_0x3180('0x59')]({'model':db[_0x3180('0x61')],'as':_0x3180('0x61'),'raw':!![]});}var _0x5b92ad=[{'model':db[_0x3180('0x3a')],'as':_0x3180('0x62'),'attributes':['id',_0x3180('0x36'),_0x3180('0x63'),_0x3180('0x64'),_0x3180('0x65'),'read'],'include':_0x2f188e}];_0x5b92ad[_0x3180('0x59')]({'model':db['OpenchannelAccount'],'as':_0x3180('0x66'),'attributes':['id',_0x3180('0x17')]});_0x5b92ad[_0x3180('0x59')]({'model':db[_0x3180('0x5a')],'as':_0x3180('0x67'),'attributes':['id','fullname']});return db[_0x3180('0x1b')][_0x3180('0x37')]({'where':{'id':_0x1577f3['params']['id']},'include':_0x5b92ad})[_0x3180('0x25')](handleEntityNotFound(_0x18840f,null))[_0x3180('0x25')](function(_0x406b07){if(_0x406b07){var _0x327453=_0x406b07[_0x3180('0x68')]({'plain':!![]});fs['mkdirSync'](_0x37c7b2);var _0x3d319b={'channel':_0x3180('0x69'),'account':_0x327453[_0x3180('0x66')][_0x3180('0x17')],'agent':_0x327453[_0x3180('0x67')]?_0x327453[_0x3180('0x67')]['fullname']:'N.A.','createdAt':moment(_0x327453[_0x3180('0x63')])[_0x3180('0x47')](_0x3180('0x48'))[_0x3180('0x52')](),'closedAt':_0x327453[_0x3180('0x6a')]?moment(_0x327453['closedAt'])[_0x3180('0x47')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x327453['disposition'],'visibility':_0x327453[_0x3180('0x6b')]?_0x3180('0x6c'):_0x3180('0x6d'),'messages':_(_0x327453['Messages'])[_0x3180('0x44')]({'secret':![]})['map'](function(_0xfabd94){if(_0xfabd94['Attachment']){var _0x5a894b=path[_0x3180('0x53')](_0x322a4e,_0xfabd94['Attachment'][_0x3180('0x6e')]);if(fs['existsSync'](_0x5a894b)){fs['createReadStream'](_0x5a894b)[_0x3180('0x6f')](fs[_0x3180('0x70')](path['join'](_0x37c7b2,_0xfabd94[_0x3180('0x61')][_0x3180('0x6e')])));}}return{'date':moment(_0xfabd94[_0x3180('0x63')])[_0x3180('0x47')](_0x3180('0x48'))[_0x3180('0x52')](),'sender':_0xfabd94[_0x3180('0x64')]===_0x3180('0x71')?_0xfabd94[_0x3180('0x5a')]?_0xfabd94[_0x3180('0x5a')][_0x3180('0x5b')]:_0x3180('0x72'):_0xfabd94[_0x3180('0x5d')][_0x3180('0x5e')]+(_0xfabd94[_0x3180('0x5d')]['lastName']?'\x20'+_0xfabd94[_0x3180('0x5d')][_0x3180('0x5f')]:''),'body':_0xfabd94['Attachment']?_0xfabd94[_0x3180('0x61')][_0x3180('0x6e')]:_0xfabd94['body'],'direction':_0xfabd94[_0x3180('0x64')]==='out'?'A':'C','secret':_0xfabd94['secret'],'read':_0xfabd94[_0x3180('0x73')],'attachment':_0xfabd94[_0x3180('0x61')]};})[_0x3180('0x74')]()};return ejs[_0x3180('0x75')](path[_0x3180('0x53')](config[_0x3180('0x54')],_0x3180('0x55'),'views',_0x3180('0x76')),{'interaction':_0x3d319b})[_0x3180('0x25')](function(_0x5bdaad){var _0x574b08=path['join'](_0x37c7b2,_0x3180('0x77')+_0x327453['id']+'-'+_0xf7d969+_0x3180('0x78'));var _0x308389={'path':_0x574b08,'channel':_0x3180('0x69'),'interactionId':_0x327453['id']};return pdf[_0x3180('0x79')](_0x5bdaad,_0x308389);})[_0x3180('0x25')](function(){return new Promise(function(_0x3078b0,_0x56b1d5){zipdir(_0x37c7b2,{'saveTo':_0x5805da},function(_0x383189,_0x2cffb6){if(_0x383189)return _0x56b1d5(_0x383189);return _0x3078b0(_0x2cffb6);});})[_0x3180('0x25')](function(){return new Promise(function(_0x509024,_0x2e3eed){rimraf(_0x37c7b2,function(_0x21a027){if(_0x21a027)_0x2e3eed(_0x21a027);return _0x509024();});});})[_0x3180('0x25')](function(){return _0x18840f['download'](_0x5805da,_0x1c915f,function(_0x3df21e){if(_0x3df21e){logger[_0x3180('0x7a')](_0x3180('0x7b'),_0x3df21e);}else{fs[_0x3180('0x7c')](_0x5805da);}});});});}else{return _0x18840f[_0x3180('0x16')](0xc8);}})[_0x3180('0x26')](handleError(_0x18840f,null));}; \ No newline at end of file +var _0x6a22=['createReadStream','pipe','createWriteStream','out','Contact','read','value','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','update','destroy','then','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','user','catch','show','from','params','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','color','openchannelInteractionTags:save','removeTags','toString','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','User','fullname','CmContact','firstName','lastName','push','Attachment','createdAt','direction','secret','OpenchannelAccount','Account','Owner','get','Openchannel','closed','closedAt','disposition','Public','Private','Messages','basename','existsSync'];(function(_0x54d49e,_0x5d9911){var _0x4af0f1=function(_0xf117b3){while(--_0xf117b3){_0x54d49e['push'](_0x54d49e['shift']());}};_0x4af0f1(++_0x5d9911);}(_0x6a22,0x11b));var _0x26a2=function(_0x39ce5a,_0x260622){_0x39ce5a=_0x39ce5a-0x0;var _0x46cd9a=_0x6a22[_0x39ce5a];return _0x46cd9a;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x26a2('0x0'));var moment=require(_0x26a2('0x1'));var util=require(_0x26a2('0x2'));var path=require(_0x26a2('0x3'));var ejs=require(_0x26a2('0x4'));var fs=require('fs');var _=require(_0x26a2('0x5'));var Redis=require(_0x26a2('0x6'));var interaction=require(_0x26a2('0x7'));var qs=require(_0x26a2('0x8'));var pdf=require(_0x26a2('0x9'));var logger=require(_0x26a2('0xa'))(_0x26a2('0xb'));var config=require(_0x26a2('0xc'));var db=require(_0x26a2('0xd'))['db'];config[_0x26a2('0xe')]=_['defaults'](config['redis'],{'host':_0x26a2('0xf'),'port':0x18eb});var socket=require(_0x26a2('0x10'))(new Redis(config[_0x26a2('0xe')]));require(_0x26a2('0x11'))[_0x26a2('0x12')](socket);function respondWithStatusCode(_0x422707,_0x373823){_0x373823=_0x373823||0xcc;return function(_0x4aa477){if(_0x4aa477){return _0x422707[_0x26a2('0x13')](_0x373823);}return _0x422707[_0x26a2('0x14')](_0x373823)[_0x26a2('0x15')]();};}function respondWithResult(_0x5a02eb,_0x5f5d4c){_0x5f5d4c=_0x5f5d4c||0xc8;return function(_0x5850e4){if(_0x5850e4){return _0x5a02eb[_0x26a2('0x14')](_0x5f5d4c)['json'](_0x5850e4);}};}function respondWithFilteredResult(_0x267ab3,_0x57b9a7){return function(_0xb23e4c){if(_0xb23e4c){var _0x41b565=typeof _0x57b9a7[_0x26a2('0x16')]===_0x26a2('0x17')&&typeof _0x57b9a7[_0x26a2('0x18')]===_0x26a2('0x17');var _0x588c9c=_0xb23e4c[_0x26a2('0x19')];var _0x43b916=_0x41b565?0x0:_0x57b9a7[_0x26a2('0x16')];var _0x149c81=_0x41b565?_0xb23e4c[_0x26a2('0x19')]:_0x57b9a7[_0x26a2('0x16')]+_0x57b9a7['limit'];var _0xe98017;if(_0x149c81>=_0x588c9c){_0x149c81=_0x588c9c;_0xe98017=0xc8;}else{_0xe98017=0xce;}_0x267ab3[_0x26a2('0x14')](_0xe98017);return _0x267ab3[_0x26a2('0x1a')]('Content-Range',_0x43b916+'-'+_0x149c81+'/'+_0x588c9c)[_0x26a2('0x1b')](_0xb23e4c);}return null;};}function saveUpdates(_0x1bc385){return function(_0x27c0dc){if(_0x27c0dc){return _0x27c0dc[_0x26a2('0x1c')](_0x1bc385)['then'](function(_0x510355){return _0x510355;});}return null;};}function removeEntity(_0x407b1d){return function(_0x401f97){if(_0x401f97){return _0x401f97[_0x26a2('0x1d')]()[_0x26a2('0x1e')](function(){_0x407b1d[_0x26a2('0x14')](0xcc)[_0x26a2('0x15')]();});}};}function handleEntityNotFound(_0x55c0b6){return function(_0x309bdd){if(!_0x309bdd){_0x55c0b6[_0x26a2('0x13')](0x194);}return _0x309bdd;};}function handleError(_0x415cf9,_0x1b54f5){_0x1b54f5=_0x1b54f5||0x1f4;return function(_0x3629f5){logger['error'](_0x3629f5[_0x26a2('0x1f')]);if(_0x3629f5[_0x26a2('0x20')]){delete _0x3629f5[_0x26a2('0x20')];}_0x415cf9['status'](_0x1b54f5)[_0x26a2('0x21')](_0x3629f5);};}exports[_0x26a2('0x22')]=function(_0x27d686,_0x302acd){var _0x31b3c5={};var _0xaa1ab9=_[_0x26a2('0x23')](db[_0x26a2('0x24')][_0x26a2('0x25')],function(_0x37467e){return{'name':_0x37467e[_0x26a2('0x26')],'type':_0x37467e[_0x26a2('0x27')][_0x26a2('0x28')]};});_0x31b3c5=qs[_0x26a2('0x29')](_0xaa1ab9,_0x27d686);return interaction[_0x26a2('0x2a')](_0x26a2('0x2b'),_0x27d686[_0x26a2('0x2c')],_0x27d686[_0x26a2('0x2d')],_0x31b3c5,_0xaa1ab9)[_0x26a2('0x1e')](respondWithFilteredResult(_0x302acd,_0x31b3c5))[_0x26a2('0x2e')](handleError(_0x302acd,null));};exports[_0x26a2('0x2f')]=function(_0x141300,_0x4c03d1){var _0x237386={};if(_0x141300['query'][_0x26a2('0x27')]&&_0x141300[_0x26a2('0x2c')][_0x26a2('0x27')]===_0x26a2('0x30')){_0x237386['from']=_0x141300[_0x26a2('0x31')]['id'];}else{_0x237386['id']=_0x141300[_0x26a2('0x31')]['id'];}var _0x3dcd24={'raw':![],'where':_0x237386},_0x4c607c={};_0x4c607c['model']=_[_0x26a2('0x32')](db['OpenchannelInteraction'][_0x26a2('0x25')]);_0x4c607c['query']=_[_0x26a2('0x32')](_0x141300['query']);_0x4c607c[_0x26a2('0x33')]=_[_0x26a2('0x34')](_0x4c607c[_0x26a2('0x35')],_0x4c607c[_0x26a2('0x2c')]);_0x3dcd24[_0x26a2('0x36')]=_['intersection'](_0x4c607c['model'],qs[_0x26a2('0x37')](_0x141300[_0x26a2('0x2c')][_0x26a2('0x37')]));_0x3dcd24[_0x26a2('0x36')]=_0x3dcd24[_0x26a2('0x36')][_0x26a2('0x38')]?_0x3dcd24['attributes']:_0x4c607c[_0x26a2('0x35')];if(_0x141300[_0x26a2('0x2c')][_0x26a2('0x39')]){_0x3dcd24['include']=[{'all':!![]}];}_0x3dcd24=_[_0x26a2('0x3a')]({},_0x3dcd24,_0x141300[_0x26a2('0x3b')]);return db['OpenchannelInteraction'][_0x26a2('0x3c')](_0x3dcd24)[_0x26a2('0x1e')](handleEntityNotFound(_0x4c03d1,null))[_0x26a2('0x1e')](respondWithResult(_0x4c03d1,null))['catch'](handleError(_0x4c03d1,null));};exports[_0x26a2('0x3d')]=function(_0x531f01,_0x277369){return db[_0x26a2('0x24')][_0x26a2('0x3d')](_0x531f01[_0x26a2('0x3e')],{})[_0x26a2('0x1e')](respondWithResult(_0x277369,0xc9))['catch'](handleError(_0x277369,null));};exports[_0x26a2('0x1c')]=function(_0x226952,_0x309f2e){if(_0x226952[_0x26a2('0x3e')]['id']){delete _0x226952[_0x26a2('0x3e')]['id'];}return db[_0x26a2('0x24')][_0x26a2('0x3c')]({'where':{'id':_0x226952[_0x26a2('0x31')]['id']}})[_0x26a2('0x1e')](handleEntityNotFound(_0x309f2e,null))[_0x26a2('0x1e')](saveUpdates(_0x226952[_0x26a2('0x3e')],null))[_0x26a2('0x1e')](respondWithResult(_0x309f2e,null))[_0x26a2('0x2e')](handleError(_0x309f2e,null));};exports[_0x26a2('0x1d')]=function(_0x3d7896,_0x5dd120){return db['OpenchannelInteraction'][_0x26a2('0x3c')]({'where':{'id':_0x3d7896[_0x26a2('0x31')]['id']}})[_0x26a2('0x1e')](handleEntityNotFound(_0x5dd120,null))[_0x26a2('0x1e')](removeEntity(_0x5dd120,null))['catch'](handleError(_0x5dd120,null));};exports[_0x26a2('0x3f')]=function(_0x47a2a1,_0x25939f){return db[_0x26a2('0x24')]['describe']()['then'](respondWithResult(_0x25939f,null))[_0x26a2('0x2e')](handleError(_0x25939f,null));};exports[_0x26a2('0x40')]=function(_0x55818e,_0x59167b){return db[_0x26a2('0x41')][_0x26a2('0x3c')]({'where':{'id':_0x55818e[_0x26a2('0x31')]['id']}})[_0x26a2('0x1e')](handleEntityNotFound(_0x59167b,null))['then'](function(_0x4aa3ac){if(_0x4aa3ac){return _0x4aa3ac[_0x26a2('0x40')](_0x55818e['body'][_0x26a2('0x42')],_[_0x26a2('0x43')](_0x55818e[_0x26a2('0x3e')],[_0x26a2('0x42'),'id'])||{});}})['then'](respondWithResult(_0x59167b,null))['catch'](handleError(_0x59167b,null));};exports[_0x26a2('0x44')]=function(_0x1f60fb,_0x1b095e){var _0x306491={'raw':![],'where':{}};var _0x4c3977={};var _0x54acdd={'count':0x0,'rows':[]};return db[_0x26a2('0x24')][_0x26a2('0x45')]({'where':{'id':_0x1f60fb['params']['id']}})[_0x26a2('0x1e')](handleEntityNotFound(_0x1b095e,null))[_0x26a2('0x1e')](function(_0xe3a381){if(_0xe3a381){_0x4c3977[_0x26a2('0x35')]=_['keys'](db[_0x26a2('0x41')][_0x26a2('0x25')]);_0x4c3977['query']=_[_0x26a2('0x32')](_0x1f60fb[_0x26a2('0x2c')]);_0x4c3977[_0x26a2('0x33')]=_[_0x26a2('0x34')](_0x4c3977[_0x26a2('0x35')],_0x4c3977[_0x26a2('0x2c')]);_0x306491[_0x26a2('0x36')]=_['intersection'](_0x4c3977[_0x26a2('0x35')],qs[_0x26a2('0x37')](_0x1f60fb[_0x26a2('0x2c')][_0x26a2('0x37')]));_0x306491[_0x26a2('0x36')]=_0x306491['attributes'][_0x26a2('0x38')]?_0x306491[_0x26a2('0x36')]:_0x4c3977['model'];if(!_0x1f60fb[_0x26a2('0x2c')]['hasOwnProperty'](_0x26a2('0x46'))){_0x306491[_0x26a2('0x18')]=qs[_0x26a2('0x18')](_0x1f60fb[_0x26a2('0x2c')]['limit']);_0x306491['offset']=qs[_0x26a2('0x16')](_0x1f60fb[_0x26a2('0x2c')][_0x26a2('0x16')]);}_0x306491[_0x26a2('0x47')]=qs[_0x26a2('0x48')](_0x1f60fb[_0x26a2('0x2c')]['sort']);_0x306491[_0x26a2('0x49')]=qs['filters'](_[_0x26a2('0x4a')](_0x1f60fb[_0x26a2('0x2c')],_0x4c3977[_0x26a2('0x33')]));_0x306491['where'][_0x26a2('0x4b')]=_0xe3a381['id'];if(_0x1f60fb[_0x26a2('0x2c')][_0x26a2('0x4c')]){_0x306491[_0x26a2('0x49')]=_['merge'](_0x306491[_0x26a2('0x49')],{'$or':_[_0x26a2('0x23')](_0x306491[_0x26a2('0x36')],function(_0x28a736){var _0x1e48b1={};_0x1e48b1[_0x28a736]={'$like':'%'+_0x1f60fb['query']['filter']+'%'};return _0x1e48b1;})});}if(_0x1f60fb[_0x26a2('0x2c')][_0x26a2('0x4d')]){var _0x5450be=_0x1f60fb[_0x26a2('0x2c')]['$gte'][_0x26a2('0x4e')](',');var _0x447655={};_0x447655[_0x5450be[0x0]]={'$gte':moment(_0x5450be[0x1])[_0x26a2('0x4f')](_0x26a2('0x50'))};_0x306491['where']=_[_0x26a2('0x3a')](_0x306491['where'],_0x447655);}_0x306491=_[_0x26a2('0x3a')]({},_0x306491,_0x1f60fb[_0x26a2('0x3b')]);return db[_0x26a2('0x41')][_0x26a2('0x19')]({'where':_0x306491['where']})[_0x26a2('0x1e')](function(_0x1fa3ba){_0x54acdd[_0x26a2('0x19')]=_0x1fa3ba;if(_0x1f60fb[_0x26a2('0x2c')]['includeAll']){_0x306491[_0x26a2('0x51')]=[{'all':!![]}];}return db[_0x26a2('0x41')][_0x26a2('0x2a')](_0x306491);})[_0x26a2('0x1e')](function(_0x5ccf29){_0x54acdd[_0x26a2('0x52')]=_0x5ccf29;return _0x54acdd;});}})[_0x26a2('0x1e')](respondWithFilteredResult(_0x1b095e,_0x306491))[_0x26a2('0x2e')](handleError(_0x1b095e,null));};exports[_0x26a2('0x53')]=function(_0x2b2db7,_0x355e3e){return db[_0x26a2('0x24')]['find']({'where':{'id':_0x2b2db7[_0x26a2('0x31')]['id']}})[_0x26a2('0x1e')](handleEntityNotFound(_0x355e3e,null))[_0x26a2('0x1e')](function(_0x419ae8){if(_0x419ae8){return _0x419ae8[_0x26a2('0x54')](_0x2b2db7[_0x26a2('0x3e')]['ids'],_['omit'](_0x2b2db7['body'],['ids','id'])||{})['spread'](function(){return db['Tag'][_0x26a2('0x2a')]({'attributes':['id',_0x26a2('0x20'),_0x26a2('0x55')],'where':{'id':_0x2b2db7[_0x26a2('0x3e')][_0x26a2('0x42')]}});})[_0x26a2('0x1e')](function(_0x44ac74){socket['emit'](_0x26a2('0x56'),{'id':Number(_0x2b2db7[_0x26a2('0x31')]['id']),'tags':_0x44ac74||[]});return{'id':Number(_0x2b2db7[_0x26a2('0x31')]['id']),'tags':_0x44ac74||[]};});}})[_0x26a2('0x1e')](respondWithResult(_0x355e3e,null))[_0x26a2('0x2e')](handleError(_0x355e3e,null));};exports[_0x26a2('0x57')]=function(_0x3df5c0,_0x4f298c){return db['OpenchannelInteraction']['find']({'where':{'id':_0x3df5c0[_0x26a2('0x31')]['id']}})['then'](handleEntityNotFound(_0x4f298c,null))[_0x26a2('0x1e')](function(_0x4e3630){if(_0x4e3630){return _0x4e3630[_0x26a2('0x57')](_0x3df5c0[_0x26a2('0x2c')][_0x26a2('0x42')]);}})[_0x26a2('0x1e')](respondWithStatusCode(_0x4f298c,null))[_0x26a2('0x2e')](handleError(_0x4f298c,null));};exports['download']=function(_0x5c3394,_0x207567){var _0x4a5ff4=moment()['unix']()[_0x26a2('0x58')]();var _0x5d70c8=path[_0x26a2('0x59')](config[_0x26a2('0x5a')],'server',_0x26a2('0x5b'),_0x26a2('0x5c'));var _0x35b85b=path['join'](config[_0x26a2('0x5a')],_0x26a2('0x5d'),_0x26a2('0x5b'),_0x26a2('0x5e'));var _0x526b06=path[_0x26a2('0x59')](_0x5d70c8,_0x4a5ff4);var _0xb84566=util[_0x26a2('0x4f')](_0x26a2('0x5f'),_0x5c3394['params']['id'],_0x4a5ff4);var _0x4365f6=path[_0x26a2('0x59')](_0x5d70c8,_0xb84566);var _0x2b4d04=[];_0x2b4d04['push']({'model':db[_0x26a2('0x60')],'as':_0x26a2('0x60'),'attributes':['id',_0x26a2('0x61')],'raw':!![]});_0x2b4d04['push']({'model':db[_0x26a2('0x62')],'as':'Contact','attributes':['id',_0x26a2('0x63'),_0x26a2('0x64')],'raw':!![]});if(_0x5c3394[_0x26a2('0x2c')][_0x26a2('0x5e')]){_0x2b4d04[_0x26a2('0x65')]({'model':db['Attachment'],'as':_0x26a2('0x66'),'raw':!![]});}var _0x2ebb96=[{'model':db[_0x26a2('0x41')],'as':'Messages','attributes':['id',_0x26a2('0x3e'),_0x26a2('0x67'),_0x26a2('0x68'),_0x26a2('0x69'),'read'],'include':_0x2b4d04}];_0x2ebb96[_0x26a2('0x65')]({'model':db[_0x26a2('0x6a')],'as':_0x26a2('0x6b'),'attributes':['id',_0x26a2('0x20')]});_0x2ebb96[_0x26a2('0x65')]({'model':db[_0x26a2('0x60')],'as':_0x26a2('0x6c'),'attributes':['id',_0x26a2('0x61')]});return db[_0x26a2('0x24')][_0x26a2('0x3c')]({'where':{'id':_0x5c3394[_0x26a2('0x31')]['id']},'include':_0x2ebb96})['then'](handleEntityNotFound(_0x207567,null))[_0x26a2('0x1e')](function(_0x3df7ea){if(_0x3df7ea){var _0x55e9b6=_0x3df7ea[_0x26a2('0x6d')]({'plain':!![]});fs['mkdirSync'](_0x526b06);var _0x57539d={'channel':_0x26a2('0x6e'),'account':_0x55e9b6[_0x26a2('0x6b')][_0x26a2('0x20')],'agent':_0x55e9b6[_0x26a2('0x6c')]?_0x55e9b6[_0x26a2('0x6c')]['fullname']:'N.A.','createdAt':moment(_0x55e9b6['createdAt'])['format'](_0x26a2('0x50'))['toString'](),'closedAt':_0x55e9b6[_0x26a2('0x6f')]?moment(_0x55e9b6[_0x26a2('0x70')])[_0x26a2('0x4f')](_0x26a2('0x50'))[_0x26a2('0x58')]():'','disposition':_0x55e9b6[_0x26a2('0x71')],'visibility':_0x55e9b6['threadId']?_0x26a2('0x72'):_0x26a2('0x73'),'messages':_(_0x55e9b6[_0x26a2('0x74')])[_0x26a2('0x4c')]({'secret':![]})[_0x26a2('0x23')](function(_0x20fe10){if(_0x20fe10[_0x26a2('0x66')]){var _0x547102=path['join'](_0x35b85b,_0x20fe10[_0x26a2('0x66')][_0x26a2('0x75')]);if(fs[_0x26a2('0x76')](_0x547102)){fs[_0x26a2('0x77')](_0x547102)[_0x26a2('0x78')](fs[_0x26a2('0x79')](path[_0x26a2('0x59')](_0x526b06,_0x20fe10[_0x26a2('0x66')][_0x26a2('0x75')])));}}return{'date':moment(_0x20fe10[_0x26a2('0x67')])[_0x26a2('0x4f')](_0x26a2('0x50'))[_0x26a2('0x58')](),'sender':_0x20fe10[_0x26a2('0x68')]===_0x26a2('0x7a')?_0x20fe10[_0x26a2('0x60')]?_0x20fe10[_0x26a2('0x60')]['fullname']:'System':_0x20fe10[_0x26a2('0x7b')][_0x26a2('0x63')]+(_0x20fe10[_0x26a2('0x7b')][_0x26a2('0x64')]?'\x20'+_0x20fe10['Contact']['lastName']:''),'body':_0x20fe10['Attachment']?_0x20fe10[_0x26a2('0x66')]['basename']:_0x20fe10[_0x26a2('0x3e')],'direction':_0x20fe10[_0x26a2('0x68')]===_0x26a2('0x7a')?'A':'C','secret':_0x20fe10[_0x26a2('0x69')],'read':_0x20fe10[_0x26a2('0x7c')],'attachment':_0x20fe10[_0x26a2('0x66')]};})[_0x26a2('0x7d')]()};return ejs['renderFile'](path['join'](config[_0x26a2('0x5a')],_0x26a2('0x5d'),'views',_0x26a2('0x7e')),{'interaction':_0x57539d})[_0x26a2('0x1e')](function(_0x5886a3){var _0x17421d=path[_0x26a2('0x59')](_0x526b06,_0x26a2('0x7f')+_0x55e9b6['id']+'-'+_0x4a5ff4+_0x26a2('0x80'));var _0x564ba5={'path':_0x17421d,'channel':_0x26a2('0x6e'),'interactionId':_0x55e9b6['id']};return pdf[_0x26a2('0x81')](_0x5886a3,_0x564ba5);})['then'](function(){return new Promise(function(_0x2b6c35,_0x18c54b){zipdir(_0x526b06,{'saveTo':_0x4365f6},function(_0x3d6a64,_0x4d1822){if(_0x3d6a64)return _0x18c54b(_0x3d6a64);return _0x2b6c35(_0x4d1822);});})[_0x26a2('0x1e')](function(){return new Promise(function(_0x3dc154,_0x480dbe){rimraf(_0x526b06,function(_0x4b617e){if(_0x4b617e)_0x480dbe(_0x4b617e);return _0x3dc154();});});})[_0x26a2('0x1e')](function(){return _0x207567[_0x26a2('0x82')](_0x4365f6,_0xb84566,function(_0x5ddb64){if(_0x5ddb64){logger[_0x26a2('0x83')](_0x26a2('0x84'),_0x5ddb64);}else{fs[_0x26a2('0x85')](_0x4365f6);}});});});}else{return _0x207567[_0x26a2('0x13')](0xc8);}})[_0x26a2('0x2e')](handleError(_0x207567,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 53c4e51..8d6c4dc 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 _0xf87e=['hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','catch'];(function(_0xe0c36f,_0x4e2f07){var _0x439214=function(_0x17a64d){while(--_0x17a64d){_0xe0c36f['push'](_0xe0c36f['shift']());}};_0x439214(++_0x4e2f07);}(_0xf87e,0x158));var _0xef87=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xf87e[_0x4fde08];return _0x12e725;};'use strict';var EventEmitter=require(_0xef87('0x0'));var OpenchannelInteraction=require(_0xef87('0x1'))['db'][_0xef87('0x2')];var OpenchannelMessage=require(_0xef87('0x1'))['db'][_0xef87('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xef87('0x4')](0x0);var events={'afterCreate':_0xef87('0x5'),'afterUpdate':_0xef87('0x6'),'afterDestroy':'remove'};function emitEvent(_0x39a352){return function(_0x17ed4b,_0x524fba,_0x1e3942){_0x17ed4b[_0xef87('0x7')]({'attributes':['id'],'raw':!![]})[_0xef87('0x8')](function(_0x3fb2c4){_0x17ed4b[_0xef87('0x9')](_0xef87('0xa'),_0x3fb2c4[_0xef87('0xb')](function(_0x1b571b){return{'id':_0x1b571b['id']};}));return OpenchannelMessage[_0xef87('0xc')]({'where':{'OpenchannelInteractionId':_0x17ed4b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xef87('0x8')](function(_0x958fa2){_0x17ed4b['setDataValue'](_0xef87('0xd'),_0x958fa2[_0xef87('0xe')]);OpenchannelInteractionEvents['emit'](_0x39a352+':'+_0x17ed4b['id'],_0x17ed4b);OpenchannelInteractionEvents['emit'](_0x39a352,_0x17ed4b);_0x1e3942(null);})[_0xef87('0xf')](_0x1e3942(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xef87('0x10')](e,emitEvent(event));}}module[_0xef87('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x9a6e=['setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then'];(function(_0x48ffda,_0x27b8b5){var _0x1f9eab=function(_0x16f871){while(--_0x16f871){_0x48ffda['push'](_0x48ffda['shift']());}};_0x1f9eab(++_0x27b8b5);}(_0x9a6e,0xd2));var _0xe9a6=function(_0x2f2cb6,_0x5f5576){_0x2f2cb6=_0x2f2cb6-0x0;var _0x33c4a7=_0x9a6e[_0x2f2cb6];return _0x33c4a7;};'use strict';var EventEmitter=require(_0xe9a6('0x0'));var OpenchannelInteraction=require(_0xe9a6('0x1'))['db'][_0xe9a6('0x2')];var OpenchannelMessage=require(_0xe9a6('0x1'))['db'][_0xe9a6('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe9a6('0x4')](0x0);var events={'afterCreate':_0xe9a6('0x5'),'afterUpdate':_0xe9a6('0x6'),'afterDestroy':_0xe9a6('0x7')};function emitEvent(_0x9d4a4){return function(_0x3b24f7,_0x443892,_0x3c6291){_0x3b24f7[_0xe9a6('0x8')]({'attributes':['id'],'raw':!![]})[_0xe9a6('0x9')](function(_0xfd6c4c){_0x3b24f7[_0xe9a6('0xa')](_0xe9a6('0xb'),_0xfd6c4c[_0xe9a6('0xc')](function(_0x515254){return{'id':_0x515254['id']};}));return OpenchannelMessage[_0xe9a6('0xd')]({'where':{'OpenchannelInteractionId':_0x3b24f7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe9a6('0x9')](function(_0x1d7860){_0x3b24f7[_0xe9a6('0xa')](_0xe9a6('0xe'),_0x1d7860[_0xe9a6('0xf')]);OpenchannelInteractionEvents['emit'](_0x9d4a4+':'+_0x3b24f7['id'],_0x3b24f7);OpenchannelInteractionEvents[_0xe9a6('0x10')](_0x9d4a4,_0x3b24f7);_0x3c6291(null);})['catch'](_0x3c6291(null));};}for(var e in events){if(events[_0xe9a6('0x11')](e)){var event=events[e];OpenchannelInteraction[_0xe9a6('0x12')](e,emitEvent(event));}}module[_0xe9a6('0x13')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index f053bae..6b2e1f0 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 _0xa992=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x17786e,_0x47b00e){var _0x4c9aef=function(_0x102f1d){while(--_0x102f1d){_0x17786e['push'](_0x17786e['shift']());}};_0x4c9aef(++_0x47b00e);}(_0xa992,0x18c));var _0x2a99=function(_0x131a9f,_0x4d7e08){_0x131a9f=_0x131a9f-0x0;var _0x3ba082=_0xa992[_0x131a9f];return _0x3ba082;};'use strict';var _=require(_0x2a99('0x0'));var util=require(_0x2a99('0x1'));var logger=require(_0x2a99('0x2'))(_0x2a99('0x3'));var moment=require('moment');var BPromise=require(_0x2a99('0x4'));var rp=require(_0x2a99('0x5'));var fs=require('fs');var path=require(_0x2a99('0x6'));var rimraf=require(_0x2a99('0x7'));var config=require(_0x2a99('0x8'));var attributes=require(_0x2a99('0x9'));module[_0x2a99('0xa')]=function(_0x90fbc9,_0x11c36a){return _0x90fbc9[_0x2a99('0xb')]('OpenchannelInteraction',attributes,{'tableName':_0x2a99('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2a99('0xd'),'collate':_0x2a99('0xe'),'hooks':{'beforeUpdate':function(_0xdc2714,_0x44d494,_0x243164){if(_0xdc2714[_0x2a99('0xf')](_0x2a99('0x10'))){_0xdc2714[_0x2a99('0x11')]=moment()[_0x2a99('0x12')](_0x2a99('0x13'));}_0x243164(null,_0xdc2714);}}});}; \ No newline at end of file +var _0x3308=['openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction'];(function(_0x2f8357,_0x10480f){var _0x235b63=function(_0x3d9087){while(--_0x3d9087){_0x2f8357['push'](_0x2f8357['shift']());}};_0x235b63(++_0x10480f);}(_0x3308,0x16b));var _0x8330=function(_0xee591,_0x1437ac){_0xee591=_0xee591-0x0;var _0x182fbd=_0x3308[_0xee591];return _0x182fbd;};'use strict';var _=require(_0x8330('0x0'));var util=require(_0x8330('0x1'));var logger=require(_0x8330('0x2'))(_0x8330('0x3'));var moment=require(_0x8330('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8330('0x5'));var rimraf=require('rimraf');var config=require(_0x8330('0x6'));var attributes=require(_0x8330('0x7'));module[_0x8330('0x8')]=function(_0x498340,_0x5b2bb3){return _0x498340[_0x8330('0x9')](_0x8330('0xa'),attributes,{'tableName':_0x8330('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8330('0xc'),'collate':_0x8330('0xd'),'hooks':{'beforeUpdate':function(_0x39bb7d,_0x33a4f1,_0x2e9760){if(_0x39bb7d[_0x8330('0xe')](_0x8330('0xf'))){_0x39bb7d['closedAt']=moment()['format'](_0x8330('0x10'));}_0x2e9760(null,_0x39bb7d);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index e1e07d2..39da2bd 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 _0x5283=['catch','update','body','options','raw','where','attributes','limit','info','UpdateOpenchannelInteraction','debug','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','then','addTags','ids','spread','AddTags','lodash','util','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x3f7654,_0x2a9cf4){var _0x5cf7a8=function(_0x4e0d17){while(--_0x4e0d17){_0x3f7654['push'](_0x3f7654['shift']());}};_0x5cf7a8(++_0x2a9cf4);}(_0x5283,0x153));var _0x3528=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x5283[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x3528('0x0'));var util=require(_0x3528('0x1'));var moment=require('moment');var BPromise=require(_0x3528('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3528('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3528('0x4'))('rpc');var config=require(_0x3528('0x5'));var jayson=require(_0x3528('0x6'));var client=jayson[_0x3528('0x7')]['http']({'port':0x232a});config[_0x3528('0x8')]=_[_0x3528('0x9')](config[_0x3528('0x8')],{'host':_0x3528('0xa'),'port':0x18eb});var socket=require(_0x3528('0xb'))(new Redis(config[_0x3528('0x8')]));require(_0x3528('0xc'))[_0x3528('0xd')](socket);function respondWithRpcPromise(_0xe6156,_0x3635cf,_0x10f152){return new BPromise(function(_0xd62855,_0x46e0fa){return client[_0x3528('0xe')](_0xe6156,_0x10f152)['then'](function(_0x4ae865){logger['info'](_0x3528('0xf'),_0x3635cf,_0x3528('0x10'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x3635cf,_0x3528('0x10'),JSON[_0x3528('0x11')](_0x4ae865));if(_0x4ae865[_0x3528('0x12')]){if(_0x4ae865[_0x3528('0x12')]['code']===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3635cf,_0x4ae865[_0x3528('0x12')][_0x3528('0x13')]);return _0x46e0fa(_0x4ae865[_0x3528('0x12')][_0x3528('0x13')]);}logger[_0x3528('0x12')](_0x3528('0xf'),_0x3635cf,_0x4ae865[_0x3528('0x12')][_0x3528('0x13')]);return _0xd62855(_0x4ae865[_0x3528('0x12')][_0x3528('0x13')]);}else{logger['info'](_0x3528('0xf'),_0x3635cf,_0x3528('0x10'));_0xd62855(_0x4ae865[_0x3528('0x14')]['message']);}})[_0x3528('0x15')](function(_0x4ff4dd){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3635cf,_0x4ff4dd);_0x46e0fa(_0x4ff4dd);});});}exports['UpdateOpenchannelInteraction']=function(_0x3b54bd){var _0xa53459=this;return new Promise(function(_0x15608e,_0x564772){return db['OpenchannelInteraction'][_0x3528('0x16')](_0x3b54bd[_0x3528('0x17')],{'raw':_0x3b54bd[_0x3528('0x18')]?_0x3b54bd[_0x3528('0x18')][_0x3528('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b54bd[_0x3528('0x18')]?_0x3b54bd['options'][_0x3528('0x1a')]||null:null,'attributes':_0x3b54bd['options']?_0x3b54bd[_0x3528('0x18')][_0x3528('0x1b')]||null:null,'limit':_0x3b54bd[_0x3528('0x18')]?_0x3b54bd[_0x3528('0x18')][_0x3528('0x1c')]||null:null})['then'](function(_0x16638a){logger[_0x3528('0x1d')](_0x3528('0x1e'),_0x3b54bd);logger[_0x3528('0x1f')](_0x3528('0x1e'),_0x3b54bd,JSON['stringify'](_0x16638a));_0x15608e(_0x16638a);})['catch'](function(_0x5dba2a){logger[_0x3528('0x12')](_0x3528('0x1e'),_0x5dba2a['message'],_0x3b54bd);_0x564772(_0xa53459[_0x3528('0x12')](0x1f4,_0x5dba2a[_0x3528('0x13')]));});});};exports[_0x3528('0x20')]=function(_0xe2f6f0){return new Promise(function(_0x47f902,_0x116796){return db[_0x3528('0x21')][_0x3528('0x22')]({'where':_0xe2f6f0[_0x3528('0x18')]?_0xe2f6f0['options']['where']||null:null})[_0x3528('0x23')](function(_0x506774){if(_0x506774){return _0x506774[_0x3528('0x24')](_0xe2f6f0[_0x3528('0x17')][_0x3528('0x25')],_['omit'](_0xe2f6f0['body'],[_0x3528('0x25'),'id'])||{});}})[_0x3528('0x26')](function(_0x2918eb){logger[_0x3528('0x1d')](_0x3528('0x27'),_0xe2f6f0);logger[_0x3528('0x1f')](_0x3528('0x27'),_0xe2f6f0,JSON[_0x3528('0x11')](_0x2918eb));_0x47f902(_0x2918eb);})[_0x3528('0x15')](function(_0x274ed3){logger[_0x3528('0x12')](_0x3528('0x27'),_0x274ed3[_0x3528('0x13')],_0xe2f6f0);_0x116796(_this['error'](0x1f4,_0x274ed3[_0x3528('0x13')]));});});}; \ No newline at end of file +var _0x8971=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToOpenchannelInteraction','find','addTags','omit','ids','spread','AddTags'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8971,0x1b8));var _0x1897=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x8971[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0x1897('0x0'));var util=require(_0x1897('0x1'));var moment=require(_0x1897('0x2'));var BPromise=require(_0x1897('0x3'));var rs=require(_0x1897('0x4'));var fs=require('fs');var Redis=require(_0x1897('0x5'));var db=require(_0x1897('0x6'))['db'];var utils=require(_0x1897('0x7'));var logger=require(_0x1897('0x8'))('rpc');var config=require(_0x1897('0x9'));var jayson=require(_0x1897('0xa'));var client=jayson[_0x1897('0xb')][_0x1897('0xc')]({'port':0x232a});config[_0x1897('0xd')]=_[_0x1897('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1897('0xd')]));require('./openchannelInteraction.socket')[_0x1897('0xf')](socket);function respondWithRpcPromise(_0x5a66dc,_0x517666,_0x433fc1){return new BPromise(function(_0x23fe59,_0x354a68){return client[_0x1897('0x10')](_0x5a66dc,_0x433fc1)['then'](function(_0x54afee){logger[_0x1897('0x11')](_0x1897('0x12'),_0x517666,'request\x20sent');logger[_0x1897('0x13')](_0x1897('0x14'),_0x517666,_0x1897('0x15'),JSON[_0x1897('0x16')](_0x54afee));if(_0x54afee[_0x1897('0x17')]){if(_0x54afee[_0x1897('0x17')]['code']===0x1f4){logger[_0x1897('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x517666,_0x54afee[_0x1897('0x17')][_0x1897('0x18')]);return _0x354a68(_0x54afee[_0x1897('0x17')][_0x1897('0x18')]);}logger[_0x1897('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x517666,_0x54afee[_0x1897('0x17')][_0x1897('0x18')]);return _0x23fe59(_0x54afee[_0x1897('0x17')]['message']);}else{logger[_0x1897('0x11')](_0x1897('0x12'),_0x517666,'request\x20sent');_0x23fe59(_0x54afee[_0x1897('0x19')][_0x1897('0x18')]);}})[_0x1897('0x1a')](function(_0x7fec3a){logger[_0x1897('0x17')](_0x1897('0x12'),_0x517666,_0x7fec3a);_0x354a68(_0x7fec3a);});});}exports[_0x1897('0x1b')]=function(_0x23a1c7){var _0x244062=this;return new Promise(function(_0x407304,_0x9d8f3e){return db[_0x1897('0x1c')][_0x1897('0x1d')](_0x23a1c7[_0x1897('0x1e')],{'raw':_0x23a1c7[_0x1897('0x1f')]?_0x23a1c7['options'][_0x1897('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23a1c7[_0x1897('0x1f')]?_0x23a1c7[_0x1897('0x1f')][_0x1897('0x21')]||null:null,'attributes':_0x23a1c7['options']?_0x23a1c7[_0x1897('0x1f')][_0x1897('0x22')]||null:null,'limit':_0x23a1c7[_0x1897('0x1f')]?_0x23a1c7[_0x1897('0x1f')][_0x1897('0x23')]||null:null})[_0x1897('0x24')](function(_0x52e1f0){logger[_0x1897('0x11')]('UpdateOpenchannelInteraction',_0x23a1c7);logger[_0x1897('0x13')](_0x1897('0x1b'),_0x23a1c7,JSON[_0x1897('0x16')](_0x52e1f0));_0x407304(_0x52e1f0);})[_0x1897('0x1a')](function(_0xe9f089){logger[_0x1897('0x17')]('UpdateOpenchannelInteraction',_0xe9f089[_0x1897('0x18')],_0x23a1c7);_0x9d8f3e(_0x244062[_0x1897('0x17')](0x1f4,_0xe9f089[_0x1897('0x18')]));});});};exports[_0x1897('0x25')]=function(_0x9fc8a2){return new Promise(function(_0x4abde9,_0x1809a9){return db['OpenchannelInteraction'][_0x1897('0x26')]({'where':_0x9fc8a2[_0x1897('0x1f')]?_0x9fc8a2[_0x1897('0x1f')]['where']||null:null})[_0x1897('0x24')](function(_0x543377){if(_0x543377){return _0x543377[_0x1897('0x27')](_0x9fc8a2[_0x1897('0x1e')]['ids'],_[_0x1897('0x28')](_0x9fc8a2['body'],[_0x1897('0x29'),'id'])||{});}})[_0x1897('0x2a')](function(_0x3d4b46){logger[_0x1897('0x11')](_0x1897('0x2b'),_0x9fc8a2);logger[_0x1897('0x13')]('AddTags',_0x9fc8a2,JSON[_0x1897('0x16')](_0x3d4b46));_0x4abde9(_0x3d4b46);})['catch'](function(_0x43489a){logger[_0x1897('0x17')](_0x1897('0x2b'),_0x43489a['message'],_0x9fc8a2);_0x1809a9(_this['error'](0x1f4,_0x43489a[_0x1897('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index a097251..6e4f91f 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 _0x86d1=['openchannelInteraction:','save','remove','update','emit','register'];(function(_0x3159c0,_0x592776){var _0x12411f=function(_0x3b7d17){while(--_0x3b7d17){_0x3159c0['push'](_0x3159c0['shift']());}};_0x12411f(++_0x592776);}(_0x86d1,0x1cf));var _0x186d=function(_0x52564a,_0x1fd80c){_0x52564a=_0x52564a-0x0;var _0x78d9c4=_0x86d1[_0x52564a];return _0x78d9c4;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x186d('0x0'),_0x186d('0x1'),_0x186d('0x2')];function createListener(_0x1e67ef,_0x4fc4f3){return function(_0x383c48){_0x4fc4f3[_0x186d('0x3')](_0x1e67ef,_0x383c48);};}function removeListener(_0xb2b2d0,_0x7f7814){return function(){OpenchannelInteractionEvents['removeListener'](_0xb2b2d0,_0x7f7814);};}exports[_0x186d('0x4')]=function(_0x2057df){for(var _0x43dc6c=0x0,_0x5087d0=events['length'];_0x43dc6c<_0x5087d0;_0x43dc6c++){var _0x56c9de=events[_0x43dc6c];var _0x177277=createListener(_0x186d('0x5')+_0x56c9de,_0x2057df);OpenchannelInteractionEvents['on'](_0x56c9de,_0x177277);}}; \ No newline at end of file +var _0x532a=['removeListener','register','./openchannelInteraction.events','save','update','emit'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x532a,0x1ee));var _0xa532=function(_0x4d2583,_0x52bd89){_0x4d2583=_0x4d2583-0x0;var _0x57fa3a=_0x532a[_0x4d2583];return _0x57fa3a;};'use strict';var OpenchannelInteractionEvents=require(_0xa532('0x0'));var events=[_0xa532('0x1'),'remove',_0xa532('0x2')];function createListener(_0x160c24,_0x553e80){return function(_0x208758){_0x553e80[_0xa532('0x3')](_0x160c24,_0x208758);};}function removeListener(_0x3e4f3a,_0x3f6617){return function(){OpenchannelInteractionEvents[_0xa532('0x4')](_0x3e4f3a,_0x3f6617);};}exports[_0xa532('0x5')]=function(_0x130c8d){for(var _0x7e79cc=0x0,_0x118416=events['length'];_0x7e79cc<_0x118416;_0x7e79cc++){var _0x54e67d=events[_0x7e79cc];var _0x2b9381=createListener('openchannelInteraction:'+_0x54e67d,_0x130c8d);OpenchannelInteractionEvents['on'](_0x54e67d,_0x2b9381);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index f30d0f3..feb15e1 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(_0x557701,_0x180f95){var _0x4c6d09=function(_0x241b67){while(--_0x241b67){_0x557701['push'](_0x557701['shift']());}};_0x4c6d09(++_0x180f95);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'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 _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x13392b,_0x165387){_0x13392b=_0x13392b-0x0;var _0x37693e=_0x70e0[_0x13392b];return _0x37693e;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 08cf08e..d30c1e5 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 _0x01d3=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x01d3,0xa2));var _0x301d=function(_0x937ba2,_0x13032a){_0x937ba2=_0x937ba2-0x0;var _0x3b6e7e=_0x01d3[_0x937ba2];return _0x3b6e7e;};'use strict';var Sequelize=require(_0x301d('0x0'));module[_0x301d('0x1')]={'body':{'type':Sequelize[_0x301d('0x2')](_0x301d('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x301d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x301d('0x5')]('in','out'),'defaultValue':_0x301d('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x301d('0x7')]},'providerName':{'type':Sequelize[_0x301d('0x8')]},'providerResponse':{'type':Sequelize[_0x301d('0x2')]}}; \ No newline at end of file +var _0x574d=['out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x574d,0xc0));var _0xd574=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x574d[_0x3b0731];return _0x4204d7;};'use strict';var Sequelize=require(_0xd574('0x0'));module[_0xd574('0x1')]={'body':{'type':Sequelize[_0xd574('0x2')](_0xd574('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd574('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd574('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd574('0x5')]('in','out'),'defaultValue':_0xd574('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd574('0x7')]},'providerName':{'type':Sequelize[_0xd574('0x8')]},'providerResponse':{'type':Sequelize[_0xd574('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 1f90365..80c1f73 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 _0xa60b=['../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','create','find','body','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','read1stAt','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','rejectMessage','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x17461e,_0x46ba13){var _0x32eb55=function(_0x2f6645){while(--_0x2f6645){_0x17461e['push'](_0x17461e['shift']());}};_0x32eb55(++_0x46ba13);}(_0xa60b,0x171));var _0xba60=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa60b[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xba60('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba60('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba60('0x2'));var moment=require(_0xba60('0x3'));var BPromise=require(_0xba60('0x4'));var Mustache=require(_0xba60('0x5'));var util=require(_0xba60('0x6'));var path=require('path');var sox=require(_0xba60('0x7'));var csv=require(_0xba60('0x8'));var ejs=require(_0xba60('0x9'));var fs=require('fs');var fs_extra=require(_0xba60('0xa'));var _=require(_0xba60('0xb'));var squel=require(_0xba60('0xc'));var crypto=require('crypto');var jsforce=require(_0xba60('0xd'));var deskjs=require(_0xba60('0xe'));var toCsv=require('to-csv');var querystring=require(_0xba60('0xf'));var Papa=require('papaparse');var Redis=require(_0xba60('0x10'));var authService=require(_0xba60('0x11'));var qs=require(_0xba60('0x12'));var as=require(_0xba60('0x13'));var hardwareService=require(_0xba60('0x14'));var logger=require(_0xba60('0x15'))(_0xba60('0x16'));var utils=require(_0xba60('0x17'));var config=require(_0xba60('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xba60('0x19')],{'host':_0xba60('0x1a'),'port':0x18eb});var socket=require(_0xba60('0x1b'))(new Redis(config['redis']));require(_0xba60('0x1c'))[_0xba60('0x1d')](socket);var jayson=require(_0xba60('0x1e'));var client=jayson[_0xba60('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0xba60('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4de020,_0x22b580,_0x32d7e1,_0x49f54d){return new BPromise(function(_0x132f9a,_0x571313){var _0x1df6c2=_0x49f54d||client;return _0x1df6c2['request'](_0x4de020,_0x32d7e1)['then'](function(_0x2c08f5){logger[_0xba60('0x20')](_0xba60('0x21'),_0x22b580,_0xba60('0x22'));logger[_0xba60('0x23')](_0xba60('0x24'),_0x22b580,_0xba60('0x22'),JSON[_0xba60('0x25')](_0x2c08f5));if(_0x2c08f5[_0xba60('0x26')]){if(_0x2c08f5[_0xba60('0x26')][_0xba60('0x27')]===0x1f4){logger[_0xba60('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x22b580,_0x2c08f5[_0xba60('0x26')][_0xba60('0x28')]);return _0x571313(_0x2c08f5[_0xba60('0x26')][_0xba60('0x28')]);}logger[_0xba60('0x26')](_0xba60('0x21'),_0x22b580,_0x2c08f5['error'][_0xba60('0x28')]);return _0x132f9a(_0x2c08f5[_0xba60('0x26')][_0xba60('0x28')]);}else{logger['info'](_0xba60('0x21'),_0x22b580,_0xba60('0x22'));_0x132f9a(_0x2c08f5[_0xba60('0x29')][_0xba60('0x28')]);}})['catch'](function(_0x344388){logger[_0xba60('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x22b580,_0x344388);_0x571313(_0x344388);});});}function respondWithStatusCode(_0x36740f,_0x1edc76){_0x1edc76=_0x1edc76||0xcc;return function(_0x51abcb){if(_0x51abcb){return _0x36740f[_0xba60('0x2a')](_0x1edc76);}return _0x36740f[_0xba60('0x2b')](_0x1edc76)[_0xba60('0x2c')]();};}function respondWithResult(_0x1c80c4,_0x118b70){_0x118b70=_0x118b70||0xc8;return function(_0xb86268){if(_0xb86268){return _0x1c80c4[_0xba60('0x2b')](_0x118b70)[_0xba60('0x2d')](_0xb86268);}};}function respondWithFilteredResult(_0x3abab9,_0x576424){return function(_0x33afd1){if(_0x33afd1){var _0x10968b=typeof _0x576424[_0xba60('0x2e')]===_0xba60('0x2f')&&typeof _0x576424[_0xba60('0x30')]===_0xba60('0x2f');var _0x4c8906=_0x33afd1[_0xba60('0x31')];var _0x1b2ff2=_0x10968b?0x0:_0x576424[_0xba60('0x2e')];var _0xda4c01=_0x10968b?_0x33afd1[_0xba60('0x31')]:_0x576424[_0xba60('0x2e')]+_0x576424[_0xba60('0x30')];var _0xb3e42a;if(_0xda4c01>=_0x4c8906){_0xda4c01=_0x4c8906;_0xb3e42a=0xc8;}else{_0xb3e42a=0xce;}_0x3abab9[_0xba60('0x2b')](_0xb3e42a);return _0x3abab9[_0xba60('0x32')]('Content-Range',_0x1b2ff2+'-'+_0xda4c01+'/'+_0x4c8906)[_0xba60('0x2d')](_0x33afd1);}return null;};}function patchUpdates(_0x275450){return function(_0x274b95){try{jsonpatch['apply'](_0x274b95,_0x275450,!![]);}catch(_0x1bd664){return BPromise[_0xba60('0x33')](_0x1bd664);}return _0x274b95[_0xba60('0x34')]();};}function saveUpdates(_0x13c4a4,_0x40c3cf){return function(_0x208209){if(_0x208209){return _0x208209[_0xba60('0x35')](_0x13c4a4)[_0xba60('0x36')](function(_0x2d9699){return _0x2d9699;});}return null;};}function removeEntity(_0x29436f,_0x596b49){return function(_0xbaed0){if(_0xbaed0){return _0xbaed0[_0xba60('0x37')]()[_0xba60('0x36')](function(){_0x29436f[_0xba60('0x2b')](0xcc)[_0xba60('0x2c')]();});}};}function handleEntityNotFound(_0x5401cb,_0x3434ac){return function(_0x400c9e){if(!_0x400c9e){_0x5401cb[_0xba60('0x2a')](0x194);}return _0x400c9e;};}function handleError(_0x2a2aa4,_0x4127e2){_0x4127e2=_0x4127e2||0x1f4;return function(_0x70362b){logger['error'](_0x70362b['stack']);if(_0x70362b[_0xba60('0x38')]){delete _0x70362b[_0xba60('0x38')];}_0x2a2aa4[_0xba60('0x2b')](_0x4127e2)[_0xba60('0x39')](_0x70362b);};}exports[_0xba60('0x3a')]=function(_0x427043,_0x203aa8){var _0x414a8d={},_0x564b35={},_0x214a98={'count':0x0,'rows':[]};var _0xbd2b37=_[_0xba60('0x3b')](db[_0xba60('0x3c')][_0xba60('0x3d')],function(_0xe62076){return{'name':_0xe62076[_0xba60('0x3e')],'type':_0xe62076[_0xba60('0x3f')][_0xba60('0x40')]};});_0x564b35['model']=_[_0xba60('0x3b')](_0xbd2b37,_0xba60('0x38'));_0x564b35[_0xba60('0x41')]=_[_0xba60('0x42')](_0x427043[_0xba60('0x41')]);_0x564b35['filters']=_['intersection'](_0x564b35['model'],_0x564b35[_0xba60('0x41')]);_0x414a8d['attributes']=_[_0xba60('0x43')](_0x564b35[_0xba60('0x44')],qs[_0xba60('0x45')](_0x427043['query'][_0xba60('0x45')]));_0x414a8d[_0xba60('0x46')]=_0x414a8d[_0xba60('0x46')][_0xba60('0x47')]?_0x414a8d['attributes']:_0x564b35[_0xba60('0x44')];if(!_0x427043[_0xba60('0x41')][_0xba60('0x48')]('nolimit')){_0x414a8d['limit']=qs['limit'](_0x427043[_0xba60('0x41')]['limit']);_0x414a8d['offset']=qs['offset'](_0x427043[_0xba60('0x41')][_0xba60('0x2e')]);}_0x414a8d[_0xba60('0x49')]=qs[_0xba60('0x4a')](_0x427043[_0xba60('0x41')][_0xba60('0x4a')]);_0x414a8d[_0xba60('0x4b')]=qs[_0xba60('0x4c')](_[_0xba60('0x4d')](_0x427043['query'],_0x564b35[_0xba60('0x4c')]),_0xbd2b37);if(_0x427043['query']['filter']){_0x414a8d[_0xba60('0x4b')]=_[_0xba60('0x4e')](_0x414a8d[_0xba60('0x4b')],{'$or':_[_0xba60('0x3b')](_0xbd2b37,function(_0x29da0e){if(_0x29da0e[_0xba60('0x3f')]!==_0xba60('0x4f')){var _0x49caf8={};_0x49caf8[_0x29da0e[_0xba60('0x38')]]={'$like':'%'+_0x427043[_0xba60('0x41')]['filter']+'%'};return _0x49caf8;}})});}_0x414a8d=_[_0xba60('0x4e')]({},_0x414a8d,_0x427043[_0xba60('0x50')]);var _0x210bce={'where':_0x414a8d[_0xba60('0x4b')]};return db[_0xba60('0x3c')][_0xba60('0x31')](_0x210bce)[_0xba60('0x36')](function(_0x27bfd3){_0x214a98[_0xba60('0x31')]=_0x27bfd3;if(_0x427043[_0xba60('0x41')]['includeAll']){_0x414a8d[_0xba60('0x51')]=[{'all':!![]}];}return db[_0xba60('0x3c')]['findAll'](_0x414a8d);})['then'](function(_0x3d6cbd){_0x214a98[_0xba60('0x52')]=_0x3d6cbd;return _0x214a98;})[_0xba60('0x36')](respondWithFilteredResult(_0x203aa8,_0x414a8d))[_0xba60('0x53')](handleError(_0x203aa8,null));};exports[_0xba60('0x54')]=function(_0x139b6f,_0x5d9ceb){var _0x45f6aa={'raw':!![],'where':{'id':_0x139b6f[_0xba60('0x55')]['id']}},_0x125c9f={};_0x125c9f['model']=_['keys'](db[_0xba60('0x3c')][_0xba60('0x3d')]);_0x125c9f[_0xba60('0x41')]=_['keys'](_0x139b6f[_0xba60('0x41')]);_0x125c9f['filters']=_[_0xba60('0x43')](_0x125c9f['model'],_0x125c9f[_0xba60('0x41')]);_0x45f6aa[_0xba60('0x46')]=_[_0xba60('0x43')](_0x125c9f[_0xba60('0x44')],qs['fields'](_0x139b6f[_0xba60('0x41')][_0xba60('0x45')]));_0x45f6aa[_0xba60('0x46')]=_0x45f6aa['attributes'][_0xba60('0x47')]?_0x45f6aa[_0xba60('0x46')]:_0x125c9f['model'];if(_0x139b6f[_0xba60('0x41')][_0xba60('0x56')]){_0x45f6aa['include']=[{'all':!![]}];}_0x45f6aa=_['merge']({},_0x45f6aa,_0x139b6f[_0xba60('0x50')]);return db[_0xba60('0x3c')]['find'](_0x45f6aa)[_0xba60('0x36')](handleEntityNotFound(_0x5d9ceb,null))[_0xba60('0x36')](respondWithResult(_0x5d9ceb,null))['catch'](handleError(_0x5d9ceb,null));};exports['create']=function(_0x26bde7,_0x4ff7d2){return db['OpenchannelMessage'][_0xba60('0x57')](_0x26bde7['body'],{})[_0xba60('0x36')](respondWithResult(_0x4ff7d2,0xc9))[_0xba60('0x53')](handleError(_0x4ff7d2,null));};exports[_0xba60('0x35')]=function(_0x539f61,_0x45c5f3){if(_0x539f61['body']['id']){delete _0x539f61['body']['id'];}return db[_0xba60('0x3c')][_0xba60('0x58')]({'where':{'id':_0x539f61[_0xba60('0x55')]['id']}})[_0xba60('0x36')](handleEntityNotFound(_0x45c5f3,null))['then'](saveUpdates(_0x539f61[_0xba60('0x59')],null))[_0xba60('0x36')](respondWithResult(_0x45c5f3,null))[_0xba60('0x53')](handleError(_0x45c5f3,null));};exports[_0xba60('0x37')]=function(_0x542950,_0x526685){return db[_0xba60('0x3c')][_0xba60('0x58')]({'where':{'id':_0x542950[_0xba60('0x55')]['id']}})['then'](handleEntityNotFound(_0x526685,null))[_0xba60('0x36')](removeEntity(_0x526685,null))['catch'](handleError(_0x526685,null));};exports[_0xba60('0x5a')]=function(_0x295d0f,_0xcc555e){return db[_0xba60('0x3c')][_0xba60('0x5a')]()[_0xba60('0x36')](respondWithResult(_0xcc555e,null))[_0xba60('0x53')](handleError(_0xcc555e,null));};var interaction_log=require(_0xba60('0x15'))(_0xba60('0x5b'));exports['accept']=function(_0x49339f,_0xa0172a,_0x1e2ba9){var _0x3ce48d={'agent':{},'channel':_0xba60('0x5c')};if(_0x49339f[_0xba60('0x59')]['id']){delete _0x49339f[_0xba60('0x59')]['id'];}_0x49339f[_0xba60('0x59')][_0xba60('0x5d')]=!![];_0x49339f[_0xba60('0x59')][_0xba60('0x5e')]=moment()[_0xba60('0x5f')](_0xba60('0x60'));_0x49339f['body'][_0xba60('0x61')]=_0x49339f[_0xba60('0x59')]['UserId']||_0x49339f[_0xba60('0x62')]['id'];_0x3ce48d[_0xba60('0x63')]['id']=_0x49339f[_0xba60('0x59')]['UserId'];return db[_0xba60('0x3c')][_0xba60('0x58')]({'where':{'id':_0x49339f['params']['id'],'UserId':null}})[_0xba60('0x36')](handleEntityNotFound(_0xa0172a,null))['then'](saveUpdates(_0x49339f[_0xba60('0x59')],null))[_0xba60('0x36')](function(_0x458e37){if(_0x458e37){_0x3ce48d[_0xba60('0x28')]=_0x458e37['get']({'plain':!![]});return db[_0xba60('0x64')][_0xba60('0x58')]({'where':{'id':_0x458e37['OpenchannelInteractionId']}});}return null;})[_0xba60('0x36')](handleEntityNotFound(_0xa0172a,null))[_0xba60('0x36')](function(_0x46f416){if(_0x46f416){return _0x46f416[_0xba60('0x35')]({'UserId':_0x49339f[_0xba60('0x59')][_0xba60('0x61')],'read1stAt':_['isNil'](_0x46f416[_0xba60('0x65')])?moment()[_0xba60('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x3ee57d){if(_0x3ee57d){_0x3ce48d['interaction']=_0x3ee57d[_0xba60('0x66')]({'plain':!![]});interaction_log[_0xba60('0x20')](_0xba60('0x67'),_0x49339f[_0xba60('0x62')]['id'],_0x49339f[_0xba60('0x62')][_0xba60('0x38')],_0x49339f[_0xba60('0x62')]['role'],_0x3ce48d[_0xba60('0x68')]['id'],_0x49339f[_0xba60('0x59')]?JSON[_0xba60('0x25')](_0x49339f[_0xba60('0x59')]):'null');return respondWithRpcPromise('AcceptMessage',_0xba60('0x69'),_0x3ce48d);}return null;})[_0xba60('0x36')](function(_0x236f16){var _0x2ef03e=_0xba60('0x6a')+_0x236f16[_0xba60('0x28')][_0xba60('0x6b')];return db[_0xba60('0x6c')][_0xba60('0x41')](_0x2ef03e,{'type':db[_0xba60('0x6d')][_0xba60('0x6e')][_0xba60('0x6f')],'raw':!![]})[_0xba60('0x36')](function(_0x2576ec){return _0x2576ec;});})[_0xba60('0x36')](function(_0x28e4c5){if(_0x28e4c5){_0x3ce48d[_0xba60('0x28')][_0xba60('0x70')]=_0x28e4c5[0x0];if(!_0x49339f['body'][_0xba60('0x61')])return;return db[_0xba60('0x71')]['find']({'where':{'id':_0x49339f[_0xba60('0x59')][_0xba60('0x61')],'role':'agent'},'attributes':['id',_0xba60('0x38'),'fullname',_0xba60('0x72'),_0xba60('0x73')],'raw':!![]});}return null;})['then'](function(_0x90654e){if(!_0x90654e)return null;_0x3ce48d['message'][_0xba60('0x63')]=_0x90654e;return _0x3ce48d;})[_0xba60('0x36')](function(_0xeaa769){if(_0xeaa769){if(_0x49339f[_0xba60('0x59')][_0xba60('0x74')]){_0x3ce48d[_0xba60('0x28')][_0xba60('0x75')]=util[_0xba60('0x5f')](_0xba60('0x76'),_0x49339f['user'][_0xba60('0x38')]);_0x3ce48d[_0xba60('0x28')][_0xba60('0x77')]=_0x3ce48d[_0xba60('0x77')];_0x3ce48d['message'][_0xba60('0x78')]=_0x3ce48d[_0xba60('0x77')];_0x3ce48d[_0xba60('0x28')][_0xba60('0x79')]=_0xba60('0x7a');return respondWithRpcPromise(_0xba60('0x7b'),_0xba60('0x7b'),{'event':_0xba60('0x7c'),'message':_0x3ce48d[_0xba60('0x28')]},client9002)[_0xba60('0x36')](function(){return _0x3ce48d;});}return _0x3ce48d;}return null;})[_0xba60('0x36')](respondWithResult(_0xa0172a,null))[_0xba60('0x53')](handleError(_0xa0172a,null));};var interaction_log=require(_0xba60('0x15'))(_0xba60('0x5b'));exports['reject']=function(_0x49ce6c,_0x4e1871,_0x447362){var _0x176584={'agent':{},'channel':_0xba60('0x5c')};if(_0x49ce6c[_0xba60('0x59')]['id']){delete _0x49ce6c[_0xba60('0x59')]['id'];}_0x49ce6c['body']['UserId']=_0x49ce6c[_0xba60('0x59')][_0xba60('0x61')]||_0x49ce6c['user']['id'];_0x176584[_0xba60('0x63')]['id']=_0x49ce6c['body'][_0xba60('0x61')];return db[_0xba60('0x3c')][_0xba60('0x58')]({'where':{'id':_0x49ce6c[_0xba60('0x55')]['id'],'UserId':null}})[_0xba60('0x36')](handleEntityNotFound(_0x4e1871,null))[_0xba60('0x36')](function(_0x231b8d){if(_0x231b8d){_0x176584[_0xba60('0x28')]=_0x231b8d[_0xba60('0x66')]({'plain':!![]});return db[_0xba60('0x64')]['find']({'where':{'id':_0x231b8d[_0xba60('0x7d')]}});}return null;})[_0xba60('0x36')](handleEntityNotFound(_0x4e1871,null))[_0xba60('0x36')](function(_0x188447){if(_0x188447){_0x176584[_0xba60('0x68')]=_0x188447[_0xba60('0x66')]({'plain':!![]});interaction_log[_0xba60('0x20')](_0xba60('0x7e'),_0x49ce6c[_0xba60('0x62')]['id'],_0x49ce6c[_0xba60('0x62')][_0xba60('0x38')],_0x49ce6c[_0xba60('0x62')][_0xba60('0x7f')],_0x176584[_0xba60('0x68')]['id'],_0x49ce6c['body']?JSON['stringify'](_0x49ce6c[_0xba60('0x59')]):_0xba60('0x80'));return respondWithRpcPromise('RejectMessage',_0xba60('0x81'),_0x176584);}return null;})[_0xba60('0x36')](function(_0x5d65ee){var _0x4ad032=_0xba60('0x6a')+_0x5d65ee['message'][_0xba60('0x6b')];return db['sequelize'][_0xba60('0x41')](_0x4ad032,{'type':db['Sequelize'][_0xba60('0x6e')][_0xba60('0x6f')],'raw':!![]})['then'](function(_0x13cd2e){return _0x13cd2e;});})[_0xba60('0x36')](function(_0x5246f7){if(_0x5246f7){_0x176584[_0xba60('0x28')]['contact']=_0x5246f7[0x0];if(!_0x49ce6c[_0xba60('0x59')][_0xba60('0x61')])return;return db[_0xba60('0x71')]['find']({'where':{'id':_0x49ce6c[_0xba60('0x59')][_0xba60('0x61')],'role':_0xba60('0x63')},'attributes':['id',_0xba60('0x38'),'fullname',_0xba60('0x72'),_0xba60('0x73')],'raw':!![]});}return null;})['then'](function(_0x3df3fb){if(!_0x3df3fb)return null;_0x176584[_0xba60('0x28')][_0xba60('0x63')]=_0x3df3fb;return _0x176584;})[_0xba60('0x36')](function(_0x54f22e){if(_0x54f22e){_0x54f22e[_0xba60('0x28')]['interface']=util['format'](_0xba60('0x76'),_0x49ce6c['user'][_0xba60('0x38')]);_0x54f22e[_0xba60('0x28')][_0xba60('0x77')]=_0x176584[_0xba60('0x77')];_0x54f22e[_0xba60('0x28')][_0xba60('0x78')]=_0x176584[_0xba60('0x77')];_0x54f22e[_0xba60('0x28')][_0xba60('0x79')]=_0xba60('0x33');respondWithRpcPromise(_0xba60('0x7b'),_0xba60('0x7b'),{'event':'rejectmessage','message':_0x54f22e[_0xba60('0x28')]},client9002);return _0x176584;}return null;})['then'](respondWithResult(_0x4e1871,null))[_0xba60('0x53')](handleError(_0x4e1871,null));}; \ No newline at end of file +var _0x8b19=['register','jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','undefined','limit','offset','set','Content-Range','apply','reject','save','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','length','sort','where','filters','pick','filter','merge','VIRTUAL','options','OpenchannelMessage','count','includeAll','include','findAll','rows','show','fields','find','create','body','update','params','describe','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','openchannel-interactions','RejectMessage','rejectMessage','email','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter'];(function(_0x4be797,_0x98238d){var _0x5b0c57=function(_0x465e77){while(--_0x465e77){_0x4be797['push'](_0x4be797['shift']());}};_0x5b0c57(++_0x98238d);}(_0x8b19,0xec));var _0x98b1=function(_0x536d6a,_0x1b5e9f){_0x536d6a=_0x536d6a-0x0;var _0x26ded3=_0x8b19[_0x536d6a];return _0x26ded3;};'use strict';var emlformat=require(_0x98b1('0x0'));var rimraf=require(_0x98b1('0x1'));var zipdir=require(_0x98b1('0x2'));var jsonpatch=require(_0x98b1('0x3'));var rp=require(_0x98b1('0x4'));var moment=require(_0x98b1('0x5'));var BPromise=require(_0x98b1('0x6'));var Mustache=require('mustache');var util=require(_0x98b1('0x7'));var path=require(_0x98b1('0x8'));var sox=require(_0x98b1('0x9'));var csv=require(_0x98b1('0xa'));var ejs=require(_0x98b1('0xb'));var fs=require('fs');var fs_extra=require(_0x98b1('0xc'));var _=require(_0x98b1('0xd'));var squel=require('squel');var crypto=require(_0x98b1('0xe'));var jsforce=require(_0x98b1('0xf'));var deskjs=require(_0x98b1('0x10'));var toCsv=require(_0x98b1('0xa'));var querystring=require(_0x98b1('0x11'));var Papa=require(_0x98b1('0x12'));var Redis=require('ioredis');var authService=require(_0x98b1('0x13'));var qs=require(_0x98b1('0x14'));var as=require(_0x98b1('0x15'));var hardwareService=require(_0x98b1('0x16'));var logger=require(_0x98b1('0x17'))(_0x98b1('0x18'));var utils=require(_0x98b1('0x19'));var config=require(_0x98b1('0x1a'));var licenseUtil=require(_0x98b1('0x1b'));var db=require(_0x98b1('0x1c'))['db'];config[_0x98b1('0x1d')]=_['defaults'](config[_0x98b1('0x1d')],{'host':_0x98b1('0x1e'),'port':0x18eb});var socket=require(_0x98b1('0x1f'))(new Redis(config[_0x98b1('0x1d')]));require('./openchannelMessage.socket')[_0x98b1('0x20')](socket);var jayson=require(_0x98b1('0x21'));var client=jayson[_0x98b1('0x22')]['http']({'port':0x232c});var client9002=jayson[_0x98b1('0x22')][_0x98b1('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x14620d,_0xb30f93,_0x160bea,_0x4c882f){return new BPromise(function(_0x525f77,_0x3a0922){var _0x4d04b7=_0x4c882f||client;return _0x4d04b7['request'](_0x14620d,_0x160bea)[_0x98b1('0x24')](function(_0xcf020f){logger[_0x98b1('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0xb30f93,_0x98b1('0x26'));logger[_0x98b1('0x27')](_0x98b1('0x28'),_0xb30f93,_0x98b1('0x26'),JSON['stringify'](_0xcf020f));if(_0xcf020f[_0x98b1('0x29')]){if(_0xcf020f[_0x98b1('0x29')][_0x98b1('0x2a')]===0x1f4){logger[_0x98b1('0x29')](_0x98b1('0x2b'),_0xb30f93,_0xcf020f[_0x98b1('0x29')][_0x98b1('0x2c')]);return _0x3a0922(_0xcf020f[_0x98b1('0x29')][_0x98b1('0x2c')]);}logger[_0x98b1('0x29')](_0x98b1('0x2b'),_0xb30f93,_0xcf020f['error'][_0x98b1('0x2c')]);return _0x525f77(_0xcf020f['error'][_0x98b1('0x2c')]);}else{logger['info'](_0x98b1('0x2b'),_0xb30f93,_0x98b1('0x26'));_0x525f77(_0xcf020f[_0x98b1('0x2d')][_0x98b1('0x2c')]);}})[_0x98b1('0x2e')](function(_0x29fc74){logger[_0x98b1('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0xb30f93,_0x29fc74);_0x3a0922(_0x29fc74);});});}function respondWithStatusCode(_0x30cd2f,_0x3ffe71){_0x3ffe71=_0x3ffe71||0xcc;return function(_0x102e28){if(_0x102e28){return _0x30cd2f[_0x98b1('0x2f')](_0x3ffe71);}return _0x30cd2f[_0x98b1('0x30')](_0x3ffe71)[_0x98b1('0x31')]();};}function respondWithResult(_0x3ed3df,_0x546e81){_0x546e81=_0x546e81||0xc8;return function(_0x3cb40a){if(_0x3cb40a){return _0x3ed3df[_0x98b1('0x30')](_0x546e81)['json'](_0x3cb40a);}};}function respondWithFilteredResult(_0x18a544,_0x23bc5f){return function(_0x1acf7b){if(_0x1acf7b){var _0x1deafc=typeof _0x23bc5f['offset']===_0x98b1('0x32')&&typeof _0x23bc5f[_0x98b1('0x33')]==='undefined';var _0x446b7f=_0x1acf7b['count'];var _0x233edf=_0x1deafc?0x0:_0x23bc5f['offset'];var _0x56d5b4=_0x1deafc?_0x1acf7b['count']:_0x23bc5f[_0x98b1('0x34')]+_0x23bc5f[_0x98b1('0x33')];var _0x4e0217;if(_0x56d5b4>=_0x446b7f){_0x56d5b4=_0x446b7f;_0x4e0217=0xc8;}else{_0x4e0217=0xce;}_0x18a544['status'](_0x4e0217);return _0x18a544[_0x98b1('0x35')](_0x98b1('0x36'),_0x233edf+'-'+_0x56d5b4+'/'+_0x446b7f)['json'](_0x1acf7b);}return null;};}function patchUpdates(_0xb4348c){return function(_0x46cbb2){try{jsonpatch[_0x98b1('0x37')](_0x46cbb2,_0xb4348c,!![]);}catch(_0x376b31){return BPromise[_0x98b1('0x38')](_0x376b31);}return _0x46cbb2[_0x98b1('0x39')]();};}function saveUpdates(_0x4be3c4,_0x18f4cd){return function(_0x4e9e7b){if(_0x4e9e7b){return _0x4e9e7b['update'](_0x4be3c4)[_0x98b1('0x24')](function(_0x379554){return _0x379554;});}return null;};}function removeEntity(_0x19a8c3,_0x47fca1){return function(_0x311763){if(_0x311763){return _0x311763['destroy']()[_0x98b1('0x24')](function(){_0x19a8c3[_0x98b1('0x30')](0xcc)[_0x98b1('0x31')]();});}};}function handleEntityNotFound(_0x5f1c56,_0x1d5165){return function(_0x2a625b){if(!_0x2a625b){_0x5f1c56[_0x98b1('0x2f')](0x194);}return _0x2a625b;};}function handleError(_0x4ab3ed,_0x558b4b){_0x558b4b=_0x558b4b||0x1f4;return function(_0x3446d6){logger[_0x98b1('0x29')](_0x3446d6[_0x98b1('0x3a')]);if(_0x3446d6[_0x98b1('0x3b')]){delete _0x3446d6[_0x98b1('0x3b')];}_0x4ab3ed[_0x98b1('0x30')](_0x558b4b)['send'](_0x3446d6);};}exports[_0x98b1('0x3c')]=function(_0x5a6e0b,_0x2cda3a){var _0xfcfc7d={},_0x11a981={},_0x5280a7={'count':0x0,'rows':[]};var _0x2f79be=_['map'](db['OpenchannelMessage'][_0x98b1('0x3d')],function(_0x54fcb3){return{'name':_0x54fcb3[_0x98b1('0x3e')],'type':_0x54fcb3[_0x98b1('0x3f')][_0x98b1('0x40')]};});_0x11a981[_0x98b1('0x41')]=_[_0x98b1('0x42')](_0x2f79be,_0x98b1('0x3b'));_0x11a981[_0x98b1('0x43')]=_[_0x98b1('0x44')](_0x5a6e0b[_0x98b1('0x43')]);_0x11a981['filters']=_['intersection'](_0x11a981['model'],_0x11a981['query']);_0xfcfc7d[_0x98b1('0x45')]=_[_0x98b1('0x46')](_0x11a981[_0x98b1('0x41')],qs['fields'](_0x5a6e0b[_0x98b1('0x43')]['fields']));_0xfcfc7d[_0x98b1('0x45')]=_0xfcfc7d[_0x98b1('0x45')][_0x98b1('0x47')]?_0xfcfc7d[_0x98b1('0x45')]:_0x11a981[_0x98b1('0x41')];if(!_0x5a6e0b[_0x98b1('0x43')]['hasOwnProperty']('nolimit')){_0xfcfc7d[_0x98b1('0x33')]=qs[_0x98b1('0x33')](_0x5a6e0b['query']['limit']);_0xfcfc7d[_0x98b1('0x34')]=qs[_0x98b1('0x34')](_0x5a6e0b['query']['offset']);}_0xfcfc7d['order']=qs['sort'](_0x5a6e0b[_0x98b1('0x43')][_0x98b1('0x48')]);_0xfcfc7d[_0x98b1('0x49')]=qs[_0x98b1('0x4a')](_[_0x98b1('0x4b')](_0x5a6e0b['query'],_0x11a981['filters']),_0x2f79be);if(_0x5a6e0b['query'][_0x98b1('0x4c')]){_0xfcfc7d[_0x98b1('0x49')]=_[_0x98b1('0x4d')](_0xfcfc7d[_0x98b1('0x49')],{'$or':_[_0x98b1('0x42')](_0x2f79be,function(_0x12c5e2){if(_0x12c5e2[_0x98b1('0x3f')]!==_0x98b1('0x4e')){var _0x12cfd8={};_0x12cfd8[_0x12c5e2[_0x98b1('0x3b')]]={'$like':'%'+_0x5a6e0b[_0x98b1('0x43')][_0x98b1('0x4c')]+'%'};return _0x12cfd8;}})});}_0xfcfc7d=_[_0x98b1('0x4d')]({},_0xfcfc7d,_0x5a6e0b[_0x98b1('0x4f')]);var _0xe7de86={'where':_0xfcfc7d[_0x98b1('0x49')]};return db[_0x98b1('0x50')][_0x98b1('0x51')](_0xe7de86)[_0x98b1('0x24')](function(_0x18146b){_0x5280a7[_0x98b1('0x51')]=_0x18146b;if(_0x5a6e0b['query'][_0x98b1('0x52')]){_0xfcfc7d[_0x98b1('0x53')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x98b1('0x54')](_0xfcfc7d);})[_0x98b1('0x24')](function(_0x5de28a){_0x5280a7[_0x98b1('0x55')]=_0x5de28a;return _0x5280a7;})[_0x98b1('0x24')](respondWithFilteredResult(_0x2cda3a,_0xfcfc7d))[_0x98b1('0x2e')](handleError(_0x2cda3a,null));};exports[_0x98b1('0x56')]=function(_0x2b49ba,_0x4d7f64){var _0x12dae1={'raw':!![],'where':{'id':_0x2b49ba['params']['id']}},_0x1327b2={};_0x1327b2[_0x98b1('0x41')]=_[_0x98b1('0x44')](db['OpenchannelMessage']['rawAttributes']);_0x1327b2[_0x98b1('0x43')]=_[_0x98b1('0x44')](_0x2b49ba['query']);_0x1327b2[_0x98b1('0x4a')]=_['intersection'](_0x1327b2[_0x98b1('0x41')],_0x1327b2['query']);_0x12dae1['attributes']=_[_0x98b1('0x46')](_0x1327b2[_0x98b1('0x41')],qs['fields'](_0x2b49ba[_0x98b1('0x43')][_0x98b1('0x57')]));_0x12dae1[_0x98b1('0x45')]=_0x12dae1[_0x98b1('0x45')][_0x98b1('0x47')]?_0x12dae1[_0x98b1('0x45')]:_0x1327b2['model'];if(_0x2b49ba['query'][_0x98b1('0x52')]){_0x12dae1['include']=[{'all':!![]}];}_0x12dae1=_['merge']({},_0x12dae1,_0x2b49ba[_0x98b1('0x4f')]);return db[_0x98b1('0x50')][_0x98b1('0x58')](_0x12dae1)[_0x98b1('0x24')](handleEntityNotFound(_0x4d7f64,null))[_0x98b1('0x24')](respondWithResult(_0x4d7f64,null))[_0x98b1('0x2e')](handleError(_0x4d7f64,null));};exports[_0x98b1('0x59')]=function(_0x488cb3,_0x11cf2){return db['OpenchannelMessage'][_0x98b1('0x59')](_0x488cb3[_0x98b1('0x5a')],{})[_0x98b1('0x24')](respondWithResult(_0x11cf2,0xc9))[_0x98b1('0x2e')](handleError(_0x11cf2,null));};exports[_0x98b1('0x5b')]=function(_0x4dfe72,_0x4b9148){if(_0x4dfe72[_0x98b1('0x5a')]['id']){delete _0x4dfe72[_0x98b1('0x5a')]['id'];}return db[_0x98b1('0x50')]['find']({'where':{'id':_0x4dfe72[_0x98b1('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4b9148,null))[_0x98b1('0x24')](saveUpdates(_0x4dfe72[_0x98b1('0x5a')],null))['then'](respondWithResult(_0x4b9148,null))['catch'](handleError(_0x4b9148,null));};exports['destroy']=function(_0x193f3c,_0x47b66){return db['OpenchannelMessage'][_0x98b1('0x58')]({'where':{'id':_0x193f3c[_0x98b1('0x5c')]['id']}})[_0x98b1('0x24')](handleEntityNotFound(_0x47b66,null))[_0x98b1('0x24')](removeEntity(_0x47b66,null))[_0x98b1('0x2e')](handleError(_0x47b66,null));};exports[_0x98b1('0x5d')]=function(_0x228a35,_0x2fee53){return db[_0x98b1('0x50')][_0x98b1('0x5d')]()[_0x98b1('0x24')](respondWithResult(_0x2fee53,null))['catch'](handleError(_0x2fee53,null));};var interaction_log=require(_0x98b1('0x17'))('openchannel-interactions');exports['accept']=function(_0xebd54d,_0x2194bf,_0x1576a8){var _0x2cb426={'agent':{},'channel':_0x98b1('0x5e')};if(_0xebd54d[_0x98b1('0x5a')]['id']){delete _0xebd54d[_0x98b1('0x5a')]['id'];}_0xebd54d[_0x98b1('0x5a')]['read']=!![];_0xebd54d['body'][_0x98b1('0x5f')]=moment()[_0x98b1('0x60')](_0x98b1('0x61'));_0xebd54d[_0x98b1('0x5a')][_0x98b1('0x62')]=_0xebd54d[_0x98b1('0x5a')][_0x98b1('0x62')]||_0xebd54d['user']['id'];_0x2cb426['agent']['id']=_0xebd54d[_0x98b1('0x5a')][_0x98b1('0x62')];return db[_0x98b1('0x50')][_0x98b1('0x58')]({'where':{'id':_0xebd54d['params']['id'],'UserId':null}})[_0x98b1('0x24')](handleEntityNotFound(_0x2194bf,null))['then'](saveUpdates(_0xebd54d[_0x98b1('0x5a')],null))[_0x98b1('0x24')](function(_0x4df248){if(_0x4df248){_0x2cb426[_0x98b1('0x2c')]=_0x4df248[_0x98b1('0x63')]({'plain':!![]});return db[_0x98b1('0x64')][_0x98b1('0x58')]({'where':{'id':_0x4df248[_0x98b1('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x2194bf,null))[_0x98b1('0x24')](function(_0x2b7c8a){if(_0x2b7c8a){return _0x2b7c8a[_0x98b1('0x5b')]({'UserId':_0xebd54d[_0x98b1('0x5a')][_0x98b1('0x62')],'read1stAt':_['isNil'](_0x2b7c8a[_0x98b1('0x66')])?moment()['format'](_0x98b1('0x61')):undefined});}return null;})[_0x98b1('0x24')](function(_0x16e962){if(_0x16e962){_0x2cb426['interaction']=_0x16e962['get']({'plain':!![]});interaction_log[_0x98b1('0x25')](_0x98b1('0x67'),_0xebd54d[_0x98b1('0x68')]['id'],_0xebd54d[_0x98b1('0x68')][_0x98b1('0x3b')],_0xebd54d[_0x98b1('0x68')][_0x98b1('0x69')],_0x2cb426[_0x98b1('0x6a')]['id'],_0xebd54d[_0x98b1('0x5a')]?JSON[_0x98b1('0x6b')](_0xebd54d[_0x98b1('0x5a')]):_0x98b1('0x6c'));return respondWithRpcPromise(_0x98b1('0x6d'),'acceptMessage',_0x2cb426);}return null;})[_0x98b1('0x24')](function(_0x3dc8d4){var _0x2955ed=_0x98b1('0x6e')+_0x3dc8d4[_0x98b1('0x2c')][_0x98b1('0x6f')];return db[_0x98b1('0x70')][_0x98b1('0x43')](_0x2955ed,{'type':db[_0x98b1('0x71')][_0x98b1('0x72')][_0x98b1('0x73')],'raw':!![]})[_0x98b1('0x24')](function(_0x500287){return _0x500287;});})[_0x98b1('0x24')](function(_0x37ab40){if(_0x37ab40){_0x2cb426[_0x98b1('0x2c')][_0x98b1('0x74')]=_0x37ab40[0x0];if(!_0xebd54d[_0x98b1('0x5a')][_0x98b1('0x62')])return;return db[_0x98b1('0x75')][_0x98b1('0x58')]({'where':{'id':_0xebd54d[_0x98b1('0x5a')][_0x98b1('0x62')],'role':_0x98b1('0x76')},'attributes':['id',_0x98b1('0x3b'),_0x98b1('0x77'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x12e9ee){if(!_0x12e9ee)return null;_0x2cb426[_0x98b1('0x2c')][_0x98b1('0x76')]=_0x12e9ee;return _0x2cb426;})[_0x98b1('0x24')](function(_0x2b388c){if(_0x2b388c){if(_0xebd54d[_0x98b1('0x5a')][_0x98b1('0x78')]){_0x2cb426[_0x98b1('0x2c')][_0x98b1('0x79')]=util[_0x98b1('0x60')](_0x98b1('0x7a'),_0xebd54d['user'][_0x98b1('0x3b')]);_0x2cb426[_0x98b1('0x2c')][_0x98b1('0x7b')]=_0x2cb426[_0x98b1('0x7b')];_0x2cb426['message'][_0x98b1('0x7c')]=_0x2cb426[_0x98b1('0x7b')];_0x2cb426['message'][_0x98b1('0x7d')]=_0x98b1('0x7e');return respondWithRpcPromise(_0x98b1('0x7f'),_0x98b1('0x7f'),{'event':_0x98b1('0x80'),'message':_0x2cb426[_0x98b1('0x2c')]},client9002)[_0x98b1('0x24')](function(){return _0x2cb426;});}return _0x2cb426;}return null;})[_0x98b1('0x24')](respondWithResult(_0x2194bf,null))[_0x98b1('0x2e')](handleError(_0x2194bf,null));};var interaction_log=require(_0x98b1('0x17'))(_0x98b1('0x81'));exports[_0x98b1('0x38')]=function(_0x1f2798,_0x35c2f0,_0x1f8ad9){var _0x5a3d69={'agent':{},'channel':_0x98b1('0x5e')};if(_0x1f2798[_0x98b1('0x5a')]['id']){delete _0x1f2798[_0x98b1('0x5a')]['id'];}_0x1f2798[_0x98b1('0x5a')][_0x98b1('0x62')]=_0x1f2798['body'][_0x98b1('0x62')]||_0x1f2798[_0x98b1('0x68')]['id'];_0x5a3d69['agent']['id']=_0x1f2798[_0x98b1('0x5a')][_0x98b1('0x62')];return db['OpenchannelMessage'][_0x98b1('0x58')]({'where':{'id':_0x1f2798[_0x98b1('0x5c')]['id'],'UserId':null}})[_0x98b1('0x24')](handleEntityNotFound(_0x35c2f0,null))[_0x98b1('0x24')](function(_0x7ec062){if(_0x7ec062){_0x5a3d69[_0x98b1('0x2c')]=_0x7ec062[_0x98b1('0x63')]({'plain':!![]});return db[_0x98b1('0x64')]['find']({'where':{'id':_0x7ec062[_0x98b1('0x65')]}});}return null;})[_0x98b1('0x24')](handleEntityNotFound(_0x35c2f0,null))[_0x98b1('0x24')](function(_0x3400f1){if(_0x3400f1){_0x5a3d69[_0x98b1('0x6a')]=_0x3400f1['get']({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1f2798[_0x98b1('0x68')]['id'],_0x1f2798[_0x98b1('0x68')][_0x98b1('0x3b')],_0x1f2798[_0x98b1('0x68')][_0x98b1('0x69')],_0x5a3d69[_0x98b1('0x6a')]['id'],_0x1f2798['body']?JSON[_0x98b1('0x6b')](_0x1f2798[_0x98b1('0x5a')]):_0x98b1('0x6c'));return respondWithRpcPromise(_0x98b1('0x82'),_0x98b1('0x83'),_0x5a3d69);}return null;})[_0x98b1('0x24')](function(_0x1b50c7){var _0x583cfe=_0x98b1('0x6e')+_0x1b50c7[_0x98b1('0x2c')][_0x98b1('0x6f')];return db[_0x98b1('0x70')][_0x98b1('0x43')](_0x583cfe,{'type':db[_0x98b1('0x71')][_0x98b1('0x72')][_0x98b1('0x73')],'raw':!![]})['then'](function(_0x33cb17){return _0x33cb17;});})[_0x98b1('0x24')](function(_0x50b4bc){if(_0x50b4bc){_0x5a3d69['message'][_0x98b1('0x74')]=_0x50b4bc[0x0];if(!_0x1f2798[_0x98b1('0x5a')][_0x98b1('0x62')])return;return db[_0x98b1('0x75')]['find']({'where':{'id':_0x1f2798['body'][_0x98b1('0x62')],'role':_0x98b1('0x76')},'attributes':['id',_0x98b1('0x3b'),'fullname',_0x98b1('0x84'),'internal'],'raw':!![]});}return null;})['then'](function(_0x4e7ac8){if(!_0x4e7ac8)return null;_0x5a3d69[_0x98b1('0x2c')][_0x98b1('0x76')]=_0x4e7ac8;return _0x5a3d69;})[_0x98b1('0x24')](function(_0x544169){if(_0x544169){_0x544169[_0x98b1('0x2c')][_0x98b1('0x79')]=util['format']('SIP/%s',_0x1f2798[_0x98b1('0x68')]['name']);_0x544169[_0x98b1('0x2c')][_0x98b1('0x7b')]=_0x5a3d69[_0x98b1('0x7b')];_0x544169['message']['motionChannel']=_0x5a3d69['channel'];_0x544169[_0x98b1('0x2c')][_0x98b1('0x7d')]=_0x98b1('0x38');respondWithRpcPromise(_0x98b1('0x7f'),'EventManager',{'event':_0x98b1('0x85'),'message':_0x544169[_0x98b1('0x2c')]},client9002);return _0x5a3d69;}return null;})[_0x98b1('0x24')](respondWithResult(_0x35c2f0,null))[_0x98b1('0x2e')](handleError(_0x35c2f0,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 46a7c04..6e2fa33 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 _0x3f4e=['exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x45872f,_0x589377){var _0x39650f=function(_0x71409f){while(--_0x71409f){_0x45872f['push'](_0x45872f['shift']());}};_0x39650f(++_0x589377);}(_0x3f4e,0x196));var _0xe3f4=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x3f4e[_0x2112d4];return _0x434972;};'use strict';var EventEmitter=require(_0xe3f4('0x0'));var OpenchannelMessage=require(_0xe3f4('0x1'))['db'][_0xe3f4('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xe3f4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe3f4('0x4')};function emitEvent(_0x202335){return function(_0x25f91a,_0xd0924a,_0x5724b5){OpenchannelMessageEvents[_0xe3f4('0x5')](_0x202335+':'+_0x25f91a['id'],_0x25f91a);OpenchannelMessageEvents[_0xe3f4('0x5')](_0x202335,_0x25f91a);_0x5724b5(null);};}for(var e in events){if(events[_0xe3f4('0x6')](e)){var event=events[e];OpenchannelMessage[_0xe3f4('0x7')](e,emitEvent(event));}}module[_0xe3f4('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xbbd8=['exports','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xbbd8,0x19f));var _0x8bbd=function(_0x234de6,_0x3ad980){_0x234de6=_0x234de6-0x0;var _0xd39c7e=_0xbbd8[_0x234de6];return _0xd39c7e;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0x8bbd('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8bbd('0x1')](0x0);var events={'afterCreate':_0x8bbd('0x2'),'afterUpdate':_0x8bbd('0x3'),'afterDestroy':_0x8bbd('0x4')};function emitEvent(_0x19724d){return function(_0x2c4439,_0x425e3d,_0x3e1241){OpenchannelMessageEvents[_0x8bbd('0x5')](_0x19724d+':'+_0x2c4439['id'],_0x2c4439);OpenchannelMessageEvents['emit'](_0x19724d,_0x2c4439);_0x3e1241(null);};}for(var e in events){if(events[_0x8bbd('0x6')](e)){var event=events[e];OpenchannelMessage[_0x8bbd('0x7')](e,emitEvent(event));}}module[_0x8bbd('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index def55c3..e24696f 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 _0xded9=['FULLTEXT','models','get','direction','toLowerCase','isNil','UserId','findOne','OpenchannelInteractionId','createdAt','error','secret','CmContact','describe','then','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','replyUri','Interactions','length','Interaction','omit','POST','method','GET','body','threadId','update','catch','inspect','finally','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages'];(function(_0x41b9b1,_0x2189f6){var _0x6e0254=function(_0xba790e){while(--_0xba790e){_0x41b9b1['push'](_0x41b9b1['shift']());}};_0x6e0254(++_0x2189f6);}(_0xded9,0xff));var _0x9ded=function(_0x1cc27e,_0x366571){_0x1cc27e=_0x1cc27e-0x0;var _0x3a91fd=_0xded9[_0x1cc27e];return _0x3a91fd;};'use strict';var _=require(_0x9ded('0x0'));var util=require(_0x9ded('0x1'));var logger=require(_0x9ded('0x2'))(_0x9ded('0x3'));var moment=require('moment');var BPromise=require(_0x9ded('0x4'));var rp=require(_0x9ded('0x5'));var fs=require('fs');var path=require(_0x9ded('0x6'));var rimraf=require(_0x9ded('0x7'));var config=require(_0x9ded('0x8'));var attributes=require(_0x9ded('0x9'));module[_0x9ded('0xa')]=function(_0x4d8d23,_0x5c1cf4){return _0x4d8d23[_0x9ded('0xb')](_0x9ded('0xc'),attributes,{'tableName':_0x9ded('0xd'),'paranoid':![],'indexes':[{'name':_0x9ded('0xe'),'fields':['body'],'type':_0x9ded('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c2114,_0x11266a,_0x503187){var _0x555fb2=_0x4d8d23[_0x9ded('0x10')];var _0x4d3959=_0x5c2114[_0x9ded('0x11')]({'plain':!![]});if(_0x4d3959['direction']['toLowerCase']()==='in'||_0x4d3959[_0x9ded('0x12')][_0x9ded('0x13')]()==='out'&&!_0x4d3959['secret']&&!_[_0x9ded('0x14')](_0x4d3959[_0x9ded('0x15')])){_0x555fb2['OpenchannelInteraction'][_0x9ded('0x16')]({'where':{'id':_0x4d3959[_0x9ded('0x17')]}})['then'](function(_0xfb3e5d){if(_0xfb3e5d){_0xfb3e5d['update']({'lastMsgAt':_0x4d3959[_0x9ded('0x18')],'lastMsgDirection':_0x4d3959[_0x9ded('0x12')]['toLowerCase']()});}})['catch'](function(_0x3c4ada){console[_0x9ded('0x19')](_0x3c4ada);});}if(_0x4d3959[_0x9ded('0x12')]==='out'&&!_0x4d3959[_0x9ded('0x1a')]){var _0x450318;_0x555fb2[_0x9ded('0x1b')][_0x9ded('0x1c')]()[_0x9ded('0x1d')](function(_0x4e3615){return _0x555fb2[_0x9ded('0x1e')][_0x9ded('0x1f')]({'where':{'id':_0x4d3959[_0x9ded('0x20')]},'include':[{'model':_0x555fb2[_0x9ded('0x21')],'as':'Interactions','where':{'id':_0x4d3959[_0x9ded('0x17')]},'limit':0x1,'include':[{'model':_0x555fb2['CmContact'],'as':_0x9ded('0x22'),'attributes':_[_0x9ded('0x23')](_0x4e3615)}]}]});})['then'](function(_0x4bee17){_0x450318=_0x4bee17['get']({'plain':!![]});if(_0x450318&&_0x450318['replyUri']){logger[_0x9ded('0x24')](_0x9ded('0x25'),_0x9ded('0x26'),util[_0x9ded('0x27')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x4d3959['id'],_0x450318[_0x9ded('0x28')]));if(_0x450318[_0x9ded('0x29')]&&_0x450318[_0x9ded('0x29')][_0x9ded('0x2a')]){_0x4d3959[_0x9ded('0x2b')]=_[_0x9ded('0x2c')](_0x450318['Interactions'][0x0],'Contact');_0x4d3959[_0x9ded('0x22')]=_0x450318[_0x9ded('0x29')][0x0][_0x9ded('0x22')];}var _0x11266a={'method':_0x9ded('0x2d'),'uri':encodeURI(_0x450318['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x11266a[_0x9ded('0x2e')]){case _0x9ded('0x2f'):_0x11266a['qs']=_0x4d3959;break;case _0x9ded('0x2d'):_0x11266a[_0x9ded('0x30')]=_0x4d3959;break;}return rp(_0x11266a)[_0x9ded('0x1d')](function(_0x46565e){logger[_0x9ded('0x24')](_0x9ded('0x25'),_0x9ded('0x26'),util[_0x9ded('0x27')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x4d3959['id'],_0x450318[_0x9ded('0x28')]));if(_0x46565e[_0x9ded('0x30')][_0x9ded('0x31')]&&_0x46565e[_0x9ded('0x30')][_0x9ded('0x31')]!=_0x4d3959[_0x9ded('0x2b')][_0x9ded('0x31')]){return _0x555fb2[_0x9ded('0x21')][_0x9ded('0x32')]({'threadId':_0x46565e[_0x9ded('0x30')][_0x9ded('0x31')]},{'where':{'id':_0x4d3959[_0x9ded('0x2b')]['id']}});}else{return;}})[_0x9ded('0x1d')](function(){return _0x5c2114[_0x9ded('0x32')]({'read':!![]});})[_0x9ded('0x33')](function(_0x6ec1a1){logger[_0x9ded('0x19')]('OpenchannelMessage,\x20%s,\x20%s',_0x9ded('0x26'),util[_0x9ded('0x34')](_0x6ec1a1,{'showHidden':![],'depth':null}));_0x503187();});}else{_0x503187();}})[_0x9ded('0x35')](function(){_0x503187();});}else{_0x503187();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe649=['threadId','OpenchannelMessage,\x20%s,\x20%s','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','fti_openchannel_messages','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','GET','body','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s'];(function(_0x279fc8,_0x1ba427){var _0x4521a5=function(_0xbd2f4c){while(--_0xbd2f4c){_0x279fc8['push'](_0x279fc8['shift']());}};_0x4521a5(++_0x1ba427);}(_0xe649,0x198));var _0x9e64=function(_0x35decb,_0x2c7932){_0x35decb=_0x35decb-0x0;var _0xca0580=_0xe649[_0x35decb];return _0xca0580;};'use strict';var _=require(_0x9e64('0x0'));var util=require(_0x9e64('0x1'));var logger=require(_0x9e64('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9e64('0x3'));var rp=require(_0x9e64('0x4'));var fs=require('fs');var path=require(_0x9e64('0x5'));var rimraf=require(_0x9e64('0x6'));var config=require('../../config/environment');var attributes=require(_0x9e64('0x7'));module['exports']=function(_0x4a42b8,_0x29aab5){return _0x4a42b8['define']('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x9e64('0x8'),'fields':['body'],'type':_0x9e64('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3cec11,_0x5d54a1,_0x57918f){var _0x37ea9=_0x4a42b8['models'];var _0x4f3d5e=_0x3cec11[_0x9e64('0xa')]({'plain':!![]});if(_0x4f3d5e[_0x9e64('0xb')][_0x9e64('0xc')]()==='in'||_0x4f3d5e[_0x9e64('0xb')][_0x9e64('0xc')]()==='out'&&!_0x4f3d5e[_0x9e64('0xd')]&&!_[_0x9e64('0xe')](_0x4f3d5e[_0x9e64('0xf')])){_0x37ea9[_0x9e64('0x10')][_0x9e64('0x11')]({'where':{'id':_0x4f3d5e[_0x9e64('0x12')]}})[_0x9e64('0x13')](function(_0x3f22ba){if(_0x3f22ba){_0x3f22ba[_0x9e64('0x14')]({'lastMsgAt':_0x4f3d5e[_0x9e64('0x15')],'lastMsgDirection':_0x4f3d5e[_0x9e64('0xb')]['toLowerCase']()});}})[_0x9e64('0x16')](function(_0x16c98f){console[_0x9e64('0x17')](_0x16c98f);});}if(_0x4f3d5e[_0x9e64('0xb')]==='out'&&!_0x4f3d5e[_0x9e64('0xd')]){var _0x80bab3;_0x37ea9[_0x9e64('0x18')]['describe']()[_0x9e64('0x13')](function(_0x756902){return _0x37ea9[_0x9e64('0x19')][_0x9e64('0x1a')]({'where':{'id':_0x4f3d5e[_0x9e64('0x1b')]},'include':[{'model':_0x37ea9[_0x9e64('0x10')],'as':_0x9e64('0x1c'),'where':{'id':_0x4f3d5e[_0x9e64('0x12')]},'limit':0x1,'include':[{'model':_0x37ea9['CmContact'],'as':_0x9e64('0x1d'),'attributes':_[_0x9e64('0x1e')](_0x756902)}]}]});})[_0x9e64('0x13')](function(_0x1194a8){_0x80bab3=_0x1194a8[_0x9e64('0xa')]({'plain':!![]});if(_0x80bab3&&_0x80bab3[_0x9e64('0x1f')]){logger[_0x9e64('0x20')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['format'](_0x9e64('0x21'),_0x4f3d5e['id'],_0x80bab3[_0x9e64('0x1f')]));if(_0x80bab3[_0x9e64('0x1c')]&&_0x80bab3[_0x9e64('0x1c')][_0x9e64('0x22')]){_0x4f3d5e[_0x9e64('0x23')]=_[_0x9e64('0x24')](_0x80bab3[_0x9e64('0x1c')][0x0],'Contact');_0x4f3d5e[_0x9e64('0x1d')]=_0x80bab3[_0x9e64('0x1c')][0x0][_0x9e64('0x1d')];}var _0x5d54a1={'method':_0x9e64('0x25'),'uri':encodeURI(_0x80bab3[_0x9e64('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5d54a1['method']){case _0x9e64('0x26'):_0x5d54a1['qs']=_0x4f3d5e;break;case _0x9e64('0x25'):_0x5d54a1[_0x9e64('0x27')]=_0x4f3d5e;break;}return rp(_0x5d54a1)[_0x9e64('0x13')](function(_0x23f860){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x9e64('0x28'),util['format'](_0x9e64('0x29'),_0x4f3d5e['id'],_0x80bab3[_0x9e64('0x1f')]));if(_0x23f860[_0x9e64('0x27')][_0x9e64('0x2a')]&&_0x23f860[_0x9e64('0x27')][_0x9e64('0x2a')]!=_0x4f3d5e[_0x9e64('0x23')][_0x9e64('0x2a')]){return _0x37ea9['OpenchannelInteraction'][_0x9e64('0x14')]({'threadId':_0x23f860[_0x9e64('0x27')][_0x9e64('0x2a')]},{'where':{'id':_0x4f3d5e[_0x9e64('0x23')]['id']}});}else{return;}})['then'](function(){return _0x3cec11[_0x9e64('0x14')]({'read':!![]});})['catch'](function(_0x23e38a){logger[_0x9e64('0x17')](_0x9e64('0x2b'),_0x9e64('0x28'),util['inspect'](_0x23e38a,{'showHidden':![],'depth':null}));_0x57918f();});}else{_0x57918f();}})['finally'](function(){_0x57918f();});}else{_0x57918f();}}},'charset':'utf8mb4','collate':_0x9e64('0x2c')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 6bed223..2b3ad1e 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 _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x82afde,_0x24c68b){var _0xa47fe7=function(_0x586f5d){while(--_0x586f5d){_0x82afde['push'](_0x82afde['shift']());}};_0xa47fe7(++_0x24c68b);}(_0xadb5,0xad));var _0x5adb=function(_0x34f791,_0x390246){_0x34f791=_0x34f791-0x0;var _0x238441=_0xadb5[_0x34f791];return _0x238441;};'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});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x34ba7e,_0xc0222e){var _0x38bd64=function(_0x503b57){while(--_0x503b57){_0x34ba7e['push'](_0x34ba7e['shift']());}};_0x38bd64(++_0xc0222e);}(_0x2ef3,0xba));var _0x32ef=function(_0x313b2a,_0x4629bb){_0x313b2a=_0x313b2a-0x0;var _0x374f4b=_0x2ef3[_0x313b2a];return _0x374f4b;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index fb0c93e..e7511c0 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 _0xb079=['save','remove','emit','removeListener','register','openchannelMessage:','./openchannelMessage.events'];(function(_0x405936,_0x2b8651){var _0x1b823d=function(_0x4e04cf){while(--_0x4e04cf){_0x405936['push'](_0x405936['shift']());}};_0x1b823d(++_0x2b8651);}(_0xb079,0x133));var _0x9b07=function(_0x184955,_0x4f6236){_0x184955=_0x184955-0x0;var _0x244562=_0xb079[_0x184955];return _0x244562;};'use strict';var OpenchannelMessageEvents=require(_0x9b07('0x0'));var events=[_0x9b07('0x1'),_0x9b07('0x2'),'update'];function createListener(_0x1c80f5,_0x732ff8){return function(_0x197870){_0x732ff8[_0x9b07('0x3')](_0x1c80f5,_0x197870);};}function removeListener(_0x5a5dda,_0x22dab1){return function(){OpenchannelMessageEvents[_0x9b07('0x4')](_0x5a5dda,_0x22dab1);};}exports[_0x9b07('0x5')]=function(_0x5866d3){for(var _0x333cb0=0x0,_0x59237b=events['length'];_0x333cb0<_0x59237b;_0x333cb0++){var _0x5621ea=events[_0x333cb0];var _0x239384=createListener(_0x9b07('0x6')+_0x5621ea,_0x5866d3);OpenchannelMessageEvents['on'](_0x5621ea,_0x239384);}}; \ No newline at end of file +var _0xc77b=['save','remove','emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x1ea97d,_0x5f599a){var _0x9beb7c=function(_0x1f6202){while(--_0x1f6202){_0x1ea97d['push'](_0x1ea97d['shift']());}};_0x9beb7c(++_0x5f599a);}(_0xc77b,0x187));var _0xbc77=function(_0x39f00e,_0x3e67c2){_0x39f00e=_0x39f00e-0x0;var _0x54b762=_0xc77b[_0x39f00e];return _0x54b762;};'use strict';var OpenchannelMessageEvents=require(_0xbc77('0x0'));var events=[_0xbc77('0x1'),_0xbc77('0x2'),'update'];function createListener(_0x65b0af,_0x185649){return function(_0x1e388a){_0x185649[_0xbc77('0x3')](_0x65b0af,_0x1e388a);};}function removeListener(_0x337316,_0x279473){return function(){OpenchannelMessageEvents[_0xbc77('0x4')](_0x337316,_0x279473);};}exports[_0xbc77('0x5')]=function(_0x4783d4){for(var _0x378251=0x0,_0x40a25d=events[_0xbc77('0x6')];_0x378251<_0x40a25d;_0x378251++){var _0x22e6c8=events[_0x378251];var _0x6f5ae7=createListener(_0xbc77('0x7')+_0x22e6c8,_0x4783d4);OpenchannelMessageEvents['on'](_0x22e6c8,_0x6f5ae7);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index fefcf5f..2897a7a 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 _0xa2e5=['getAgents','post','create','addTeams','put','update','destroy','removeAgents','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x20c3cf,_0x2270af){var _0xfdcbe4=function(_0x18f50e){while(--_0x18f50e){_0x20c3cf['push'](_0x20c3cf['shift']());}};_0xfdcbe4(++_0x2270af);}(_0xa2e5,0x1d4));var _0x5a2e=function(_0x18b24e,_0xb9dc2e){_0x18b24e=_0x18b24e-0x0;var _0x2715a8=_0xa2e5[_0x18b24e];return _0x2715a8;};'use strict';var multer=require(_0x5a2e('0x0'));var util=require(_0x5a2e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5a2e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5a2e('0x3'));var interaction=require(_0x5a2e('0x4'));var config=require(_0x5a2e('0x5'));var controller=require(_0x5a2e('0x6'));router[_0x5a2e('0x7')]('/',auth[_0x5a2e('0x8')](),controller[_0x5a2e('0x9')]);router['get'](_0x5a2e('0xa'),auth['isAuthenticated'](),controller[_0x5a2e('0xb')]);router['get'](_0x5a2e('0xc'),auth[_0x5a2e('0x8')](),controller[_0x5a2e('0xd')]);router[_0x5a2e('0x7')]('/:id/members',auth[_0x5a2e('0x8')](),controller[_0x5a2e('0xe')]);router[_0x5a2e('0x7')](_0x5a2e('0xf'),auth[_0x5a2e('0x8')](),controller[_0x5a2e('0x10')]);router[_0x5a2e('0x7')](_0x5a2e('0x11'),auth[_0x5a2e('0x8')](),controller[_0x5a2e('0x12')]);router[_0x5a2e('0x13')]('/',auth[_0x5a2e('0x8')](),controller[_0x5a2e('0x14')]);router[_0x5a2e('0x13')](_0x5a2e('0xf'),auth[_0x5a2e('0x8')](),controller[_0x5a2e('0x15')]);router[_0x5a2e('0x13')](_0x5a2e('0x11'),auth[_0x5a2e('0x8')](),controller['addAgents']);router[_0x5a2e('0x16')]('/:id',auth[_0x5a2e('0x8')](),controller[_0x5a2e('0x17')]);router['delete'](_0x5a2e('0xc'),auth[_0x5a2e('0x8')](),controller[_0x5a2e('0x18')]);router['delete'](_0x5a2e('0xf'),auth[_0x5a2e('0x8')](),controller['removeTeams']);router['delete'](_0x5a2e('0x11'),auth['isAuthenticated'](),controller[_0x5a2e('0x19')]);module[_0x5a2e('0x1a')]=router; \ No newline at end of file +var _0xa077=['removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','/:id/members','getMembers','getTeams','/:id/users','post','create','/:id/teams','addAgents','put','update','delete'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa077,0xb8));var _0x7a07=function(_0x2ecb2e,_0x47e095){_0x2ecb2e=_0x2ecb2e-0x0;var _0x5109e1=_0xa077[_0x2ecb2e];return _0x5109e1;};'use strict';var multer=require(_0x7a07('0x0'));var util=require('util');var path=require(_0x7a07('0x1'));var timeout=require(_0x7a07('0x2'));var express=require(_0x7a07('0x3'));var router=express[_0x7a07('0x4')]();var fs_extra=require(_0x7a07('0x5'));var auth=require(_0x7a07('0x6'));var interaction=require(_0x7a07('0x7'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0x7a07('0x8')]('/',auth[_0x7a07('0x9')](),controller['index']);router[_0x7a07('0x8')](_0x7a07('0xa'),auth[_0x7a07('0x9')](),controller[_0x7a07('0xb')]);router[_0x7a07('0x8')](_0x7a07('0xc'),auth[_0x7a07('0x9')](),controller['show']);router['get'](_0x7a07('0xd'),auth['isAuthenticated'](),controller[_0x7a07('0xe')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x7a07('0xf')]);router[_0x7a07('0x8')](_0x7a07('0x10'),auth[_0x7a07('0x9')](),controller['getAgents']);router[_0x7a07('0x11')]('/',auth[_0x7a07('0x9')](),controller[_0x7a07('0x12')]);router[_0x7a07('0x11')](_0x7a07('0x13'),auth['isAuthenticated'](),controller['addTeams']);router[_0x7a07('0x11')](_0x7a07('0x10'),auth[_0x7a07('0x9')](),controller[_0x7a07('0x14')]);router[_0x7a07('0x15')](_0x7a07('0xc'),auth[_0x7a07('0x9')](),controller[_0x7a07('0x16')]);router[_0x7a07('0x17')](_0x7a07('0xc'),auth[_0x7a07('0x9')](),controller['destroy']);router[_0x7a07('0x17')](_0x7a07('0x13'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x7a07('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0x7a07('0x18')]);module[_0x7a07('0x19')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 0f331cc..3caf5a9 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 _0xa5c3=['exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x4e4f0e,_0x1c3892){var _0x1a7219=function(_0x3821ad){while(--_0x3821ad){_0x4e4f0e['push'](_0x4e4f0e['shift']());}};_0x1a7219(++_0x1c3892);}(_0xa5c3,0x1d7));var _0x3a5c=function(_0xbb613e,_0x39ac7c){_0xbb613e=_0xbb613e-0x0;var _0x248ef5=_0xa5c3[_0xbb613e];return _0x248ef5;};'use strict';var Sequelize=require(_0x3a5c('0x0'));module[_0x3a5c('0x1')]={'name':{'type':Sequelize[_0x3a5c('0x2')],'unique':_0x3a5c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3a5c('0x2')]},'timeout':{'type':Sequelize[_0x3a5c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3a5c('0x5')](_0x3a5c('0x6'),'beepall',_0x3a5c('0x7'))}}; \ No newline at end of file +var _0x318d=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x2ed25c,_0x20bf6a){var _0x5983f0=function(_0x229290){while(--_0x229290){_0x2ed25c['push'](_0x2ed25c['shift']());}};_0x5983f0(++_0x20bf6a);}(_0x318d,0xe5));var _0xd318=function(_0x12c4cd,_0xdebe29){_0x12c4cd=_0x12c4cd-0x0;var _0x18a029=_0x318d[_0x12c4cd];return _0x18a029;};'use strict';var Sequelize=require(_0xd318('0x0'));module[_0xd318('0x1')]={'name':{'type':Sequelize[_0xd318('0x2')],'unique':_0xd318('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd318('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd318('0x5')](_0xd318('0x6'),_0xd318('0x7'),_0xd318('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index f93391d..a04389c 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 _0xf456=['spread','isArray','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','destroy','get','OpenchannelQueues','then','error','name','send','index','map','OpenchannelQueue','rawAttributes','key','getOptions','where','include','findAll','rows','catch','show','params','model','keys','intersection','query','fields','attributes','length','includeAll','merge','options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','getMembers','findOne','filters','nolimit','order','sort','pick','OpenchannelQueueId','filter','UserId','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','ids','User','voicePause','interface','Agents','sequelize','transaction','UserOpenchannelQueue','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','all','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit'];(function(_0x18a610,_0x5a0d62){var _0x1f3184=function(_0x9222b1){while(--_0x9222b1){_0x18a610['push'](_0x18a610['shift']());}};_0x1f3184(++_0x5a0d62);}(_0xf456,0x7b));var _0x6f45=function(_0xa04c88,_0x210509){_0xa04c88=_0xa04c88-0x0;var _0x2006b8=_0xf456[_0xa04c88];return _0x2006b8;};'use strict';var BPromise=require('bluebird');var util=require(_0x6f45('0x0'));var _=require(_0x6f45('0x1'));var squel=require(_0x6f45('0x2'));var Redis=require(_0x6f45('0x3'));var qs=require(_0x6f45('0x4'));var logger=require(_0x6f45('0x5'))(_0x6f45('0x6'));var config=require(_0x6f45('0x7'));var db=require(_0x6f45('0x8'))['db'];config[_0x6f45('0x9')]=_[_0x6f45('0xa')](config[_0x6f45('0x9')],{'host':_0x6f45('0xb'),'port':0x18eb});var socket=require(_0x6f45('0xc'))(new Redis(config[_0x6f45('0x9')]));require(_0x6f45('0xd'))[_0x6f45('0xe')](socket);function respondWithStatusCode(_0x40bfd8,_0x174797){_0x174797=_0x174797||0xcc;return function(_0x267372){if(_0x267372){return _0x40bfd8[_0x6f45('0xf')](_0x174797);}return _0x40bfd8[_0x6f45('0x10')](_0x174797)[_0x6f45('0x11')]();};}function respondWithResult(_0x3259dc,_0x47d0ff){_0x47d0ff=_0x47d0ff||0xc8;return function(_0x4cb0d1){if(_0x4cb0d1){return _0x3259dc[_0x6f45('0x10')](_0x47d0ff)[_0x6f45('0x12')](_0x4cb0d1);}};}function respondWithFilteredResult(_0x1db845,_0x3dd3d1){return function(_0x2ce97b){if(_0x2ce97b){var _0x5301dd=typeof _0x3dd3d1[_0x6f45('0x13')]===_0x6f45('0x14')&&typeof _0x3dd3d1[_0x6f45('0x15')]===_0x6f45('0x14');var _0x5e2ea5=_0x2ce97b[_0x6f45('0x16')];var _0x2f6ba1=_0x5301dd?0x0:_0x3dd3d1[_0x6f45('0x13')];var _0x41515f=_0x5301dd?_0x2ce97b[_0x6f45('0x16')]:_0x3dd3d1[_0x6f45('0x13')]+_0x3dd3d1[_0x6f45('0x15')];var _0x8142c2;if(_0x41515f>=_0x5e2ea5){_0x41515f=_0x5e2ea5;_0x8142c2=0xc8;}else{_0x8142c2=0xce;}_0x1db845[_0x6f45('0x10')](_0x8142c2);return _0x1db845['set'](_0x6f45('0x17'),_0x2f6ba1+'-'+_0x41515f+'/'+_0x5e2ea5)[_0x6f45('0x12')](_0x2ce97b);}return null;};}function saveUpdates(_0x330424){return function(_0x1ebf0f){if(_0x1ebf0f){return _0x1ebf0f[_0x6f45('0x18')](_0x330424)['then'](function(_0xfc9d6f){return _0xfc9d6f;});}return null;};}function removeEntity(_0xb919b7){return function(_0x35ba0f){if(_0x35ba0f){return _0x35ba0f[_0x6f45('0x19')]()['then'](function(){var _0x3e9a3c=_0x35ba0f[_0x6f45('0x1a')]({'plain':!![]});var _0x52eced=_0x6f45('0x1b');return db['UserProfileResource'][_0x6f45('0x19')]({'where':{'type':_0x52eced,'resourceId':_0x3e9a3c['id']}})[_0x6f45('0x1c')](function(){return _0x35ba0f;});})[_0x6f45('0x1c')](function(){_0xb919b7[_0x6f45('0x10')](0xcc)[_0x6f45('0x11')]();});}};}function handleEntityNotFound(_0x1ad528){return function(_0x51080d){if(!_0x51080d){_0x1ad528[_0x6f45('0xf')](0x194);}return _0x51080d;};}function handleError(_0x1d7365,_0x2f2dc0){_0x2f2dc0=_0x2f2dc0||0x1f4;return function(_0x182328){logger[_0x6f45('0x1d')](_0x182328['stack']);if(_0x182328[_0x6f45('0x1e')]){delete _0x182328[_0x6f45('0x1e')];}_0x1d7365[_0x6f45('0x10')](_0x2f2dc0)[_0x6f45('0x1f')](_0x182328);};}exports[_0x6f45('0x20')]=function(_0x5ed55d,_0x35d1a2){var _0x1e4186={};var _0x4f4a92={'count':0x0,'rows':[]};var _0x53f759=_[_0x6f45('0x21')](db[_0x6f45('0x22')][_0x6f45('0x23')],function(_0x33c14d){return{'name':_0x33c14d['fieldName'],'type':_0x33c14d['type'][_0x6f45('0x24')]};});_0x1e4186=qs[_0x6f45('0x25')](_0x53f759,_0x5ed55d);var _0x9de2e6={'where':_0x1e4186[_0x6f45('0x26')]};return db[_0x6f45('0x22')][_0x6f45('0x16')](_0x9de2e6)['then'](function(_0xeef820){_0x4f4a92['count']=_0xeef820;_0x1e4186[_0x6f45('0x27')]=qs[_0x6f45('0x27')](_0x5ed55d['query']);return db[_0x6f45('0x22')][_0x6f45('0x28')](_0x1e4186);})['then'](function(_0x3e6618){_0x4f4a92[_0x6f45('0x29')]=_0x3e6618;return _0x4f4a92;})['then'](respondWithFilteredResult(_0x35d1a2,_0x1e4186))[_0x6f45('0x2a')](handleError(_0x35d1a2,null));};exports[_0x6f45('0x2b')]=function(_0x78ed2e,_0x521a9f){var _0x4d3f88={'raw':!![],'where':{'id':_0x78ed2e[_0x6f45('0x2c')]['id']}},_0x21ddba={};_0x21ddba[_0x6f45('0x2d')]=_[_0x6f45('0x2e')](db[_0x6f45('0x22')][_0x6f45('0x23')]);_0x21ddba['query']=_['keys'](_0x78ed2e['query']);_0x21ddba['filters']=_[_0x6f45('0x2f')](_0x21ddba[_0x6f45('0x2d')],_0x21ddba[_0x6f45('0x30')]);_0x4d3f88['attributes']=_[_0x6f45('0x2f')](_0x21ddba[_0x6f45('0x2d')],qs[_0x6f45('0x31')](_0x78ed2e[_0x6f45('0x30')][_0x6f45('0x31')]));_0x4d3f88[_0x6f45('0x32')]=_0x4d3f88['attributes'][_0x6f45('0x33')]?_0x4d3f88[_0x6f45('0x32')]:_0x21ddba['model'];if(_0x78ed2e[_0x6f45('0x30')][_0x6f45('0x34')]){_0x4d3f88['include']=[{'all':!![]}];}_0x4d3f88=_[_0x6f45('0x35')]({},_0x4d3f88,_0x78ed2e[_0x6f45('0x36')]);return db[_0x6f45('0x22')][_0x6f45('0x37')](_0x4d3f88)[_0x6f45('0x1c')](handleEntityNotFound(_0x521a9f,null))[_0x6f45('0x1c')](respondWithResult(_0x521a9f,null))[_0x6f45('0x2a')](handleError(_0x521a9f,null));};exports['create']=function(_0x1edf3a,_0x5f2cf2){return db[_0x6f45('0x22')][_0x6f45('0x38')](_0x1edf3a[_0x6f45('0x39')],{})[_0x6f45('0x1c')](function(_0x404442){var _0x3f7598=_0x1edf3a[_0x6f45('0x3a')][_0x6f45('0x1a')]({'plain':!![]});if(!_0x3f7598)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f7598['role']==='user'){var _0x7802e0=_0x404442[_0x6f45('0x1a')]({'plain':!![]});var _0x541e6a=_0x6f45('0x1b');return db[_0x6f45('0x3b')]['find']({'where':{'name':_0x541e6a,'userProfileId':_0x3f7598[_0x6f45('0x3c')]},'raw':!![]})[_0x6f45('0x1c')](function(_0x21b429){if(_0x21b429&&_0x21b429[_0x6f45('0x3d')]===0x0){return db[_0x6f45('0x3e')][_0x6f45('0x38')]({'name':_0x7802e0[_0x6f45('0x1e')],'resourceId':_0x7802e0['id'],'type':_0x21b429[_0x6f45('0x1e')],'sectionId':_0x21b429['id']},{})[_0x6f45('0x1c')](function(){return _0x404442;});}else{return _0x404442;}})[_0x6f45('0x2a')](function(_0x2b0496){logger[_0x6f45('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b0496);throw _0x2b0496;});}return _0x404442;})[_0x6f45('0x1c')](respondWithResult(_0x5f2cf2,0xc9))[_0x6f45('0x2a')](handleError(_0x5f2cf2,null));};exports[_0x6f45('0x18')]=function(_0x4b070b,_0x13a699){if(_0x4b070b['body']['id']){delete _0x4b070b[_0x6f45('0x39')]['id'];}return db[_0x6f45('0x22')][_0x6f45('0x37')]({'where':{'id':_0x4b070b[_0x6f45('0x2c')]['id']}})[_0x6f45('0x1c')](handleEntityNotFound(_0x13a699,null))[_0x6f45('0x1c')](saveUpdates(_0x4b070b[_0x6f45('0x39')],null))[_0x6f45('0x1c')](respondWithResult(_0x13a699,null))['catch'](handleError(_0x13a699,null));};exports[_0x6f45('0x19')]=function(_0x39f9c1,_0x66a237){return db[_0x6f45('0x22')][_0x6f45('0x37')]({'where':{'id':_0x39f9c1[_0x6f45('0x2c')]['id']}})[_0x6f45('0x1c')](handleEntityNotFound(_0x66a237,null))[_0x6f45('0x1c')](removeEntity(_0x66a237,null))[_0x6f45('0x2a')](handleError(_0x66a237,null));};exports[_0x6f45('0x3f')]=function(_0x317464,_0x4e09d8){return db[_0x6f45('0x22')][_0x6f45('0x3f')]()[_0x6f45('0x1c')](respondWithResult(_0x4e09d8,null))[_0x6f45('0x2a')](handleError(_0x4e09d8,null));};exports[_0x6f45('0x40')]=function(_0x49782d,_0x1760ff){var _0x4908d0={'raw':!![],'where':{}},_0x49536a={},_0x136224;return db[_0x6f45('0x22')][_0x6f45('0x41')]({'where':{'id':_0x49782d[_0x6f45('0x2c')]['id']}})[_0x6f45('0x1c')](handleEntityNotFound(_0x1760ff,null))[_0x6f45('0x1c')](function(_0x5f32db){if(_0x5f32db){_0x136224=_0x5f32db['get']({'plain':!![]});_0x49536a['model']=_['keys'](db['UserOpenchannelQueue'][_0x6f45('0x23')]);_0x49536a['query']=_['keys'](_0x49782d[_0x6f45('0x30')]);_0x49536a[_0x6f45('0x42')]=_[_0x6f45('0x2f')](_0x49536a[_0x6f45('0x2d')],_0x49536a[_0x6f45('0x30')]);_0x4908d0[_0x6f45('0x32')]=_['intersection'](_0x49536a[_0x6f45('0x2d')],qs[_0x6f45('0x31')](_0x49782d[_0x6f45('0x30')][_0x6f45('0x31')]));_0x4908d0[_0x6f45('0x32')]=_0x4908d0[_0x6f45('0x32')][_0x6f45('0x33')]?_0x4908d0[_0x6f45('0x32')]:_0x49536a['model'];if(!_0x49782d[_0x6f45('0x30')]['hasOwnProperty'](_0x6f45('0x43'))){_0x4908d0['limit']=qs[_0x6f45('0x15')](_0x49782d['query'][_0x6f45('0x15')]);_0x4908d0[_0x6f45('0x13')]=qs[_0x6f45('0x13')](_0x49782d[_0x6f45('0x30')]['offset']);}_0x4908d0[_0x6f45('0x44')]=qs[_0x6f45('0x45')](_0x49782d[_0x6f45('0x30')]['sort']);_0x4908d0[_0x6f45('0x26')]=qs['filters'](_[_0x6f45('0x46')](_0x49782d[_0x6f45('0x30')],_0x49536a[_0x6f45('0x42')]));_0x4908d0[_0x6f45('0x26')][_0x6f45('0x47')]=_0x5f32db['id'];if(_0x49782d[_0x6f45('0x30')][_0x6f45('0x48')]){_0x4908d0['where']=_['merge'](_0x4908d0[_0x6f45('0x26')],{'$or':_[_0x6f45('0x21')](_0x4908d0[_0x6f45('0x32')],function(_0x3882e9){var _0x3c0d1d={};_0x3c0d1d[_0x3882e9]={'$like':'%'+_0x49782d[_0x6f45('0x30')][_0x6f45('0x48')]+'%'};return _0x3c0d1d;})});}_0x4908d0=_[_0x6f45('0x35')]({},_0x4908d0,_0x49782d[_0x6f45('0x36')]);return db['UserOpenchannelQueue'][_0x6f45('0x28')](_0x4908d0);}})['then'](function(_0x102770){if(_0x102770){return db['User']['findAndCountAll']({'where':{'id':_[_0x6f45('0x21')](_0x102770,_0x6f45('0x49')),'role':'agent'},'attributes':['id',_0x6f45('0x1e'),_0x6f45('0x4a'),_0x6f45('0x4b'),_0x6f45('0x4c')]});}})[_0x6f45('0x1c')](function(_0x3f2f1b){if(_0x3f2f1b){return{'count':_0x3f2f1b[_0x6f45('0x16')],'rows':_['map'](_0x3f2f1b[_0x6f45('0x29')],function(_0x5c7335){return{'membername':_0x5c7335[_0x6f45('0x1e')],'UserId':_0x5c7335['id'],'queue_name':_0x136224[_0x6f45('0x1e')],'OpenchannelQueueId':_0x136224['id'],'interface':util[_0x6f45('0x4d')](_0x6f45('0x4e'),_0x6f45('0x4f'),_0x5c7335[_0x6f45('0x1e')]),'penalty':0x0,'paused':_0x5c7335['openchannelPause'],'createdAt':_0x5c7335[_0x6f45('0x4c')],'updatedAt':_0x5c7335[_0x6f45('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6f45('0x1c')](respondWithFilteredResult(_0x1760ff,_0x4908d0))['catch'](handleError(_0x1760ff,null));};exports[_0x6f45('0x50')]=function(_0x2a1340,_0x23c89c){var _0x287e8a={};var _0x4d3896={};var _0x517290;var _0xb79914;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x2a1340[_0x6f45('0x2c')]['id']}})[_0x6f45('0x1c')](handleEntityNotFound(_0x23c89c,null))[_0x6f45('0x1c')](function(_0x40f813){if(_0x40f813){_0x517290=_0x40f813;_0x4d3896[_0x6f45('0x2d')]=_[_0x6f45('0x2e')](db[_0x6f45('0x51')]['rawAttributes']);_0x4d3896['query']=_[_0x6f45('0x2e')](_0x2a1340[_0x6f45('0x30')]);_0x4d3896['filters']=_['intersection'](_0x4d3896[_0x6f45('0x2d')],_0x4d3896['query']);_0x287e8a['attributes']=_[_0x6f45('0x2f')](_0x4d3896[_0x6f45('0x2d')],qs[_0x6f45('0x31')](_0x2a1340[_0x6f45('0x30')][_0x6f45('0x31')]));_0x287e8a[_0x6f45('0x32')]=_0x287e8a['attributes']['length']?_0x287e8a[_0x6f45('0x32')]:_0x4d3896['model'];_0x287e8a['order']=qs[_0x6f45('0x45')](_0x2a1340[_0x6f45('0x30')][_0x6f45('0x45')]);_0x287e8a[_0x6f45('0x26')]=qs['filters'](_[_0x6f45('0x46')](_0x2a1340[_0x6f45('0x30')],_0x4d3896[_0x6f45('0x42')]));if(_0x2a1340[_0x6f45('0x30')][_0x6f45('0x48')]){_0x287e8a[_0x6f45('0x26')]=_['merge'](_0x287e8a[_0x6f45('0x26')],{'$or':_['map'](_0x287e8a['attributes'],function(_0x8472c7){var _0x1a8992={};_0x1a8992[_0x8472c7]={'$like':'%'+_0x2a1340['query'][_0x6f45('0x48')]+'%'};return _0x1a8992;})});}_0x287e8a=_[_0x6f45('0x35')]({},_0x287e8a,_0x2a1340[_0x6f45('0x36')]);return _0x517290[_0x6f45('0x50')](_0x287e8a);}})[_0x6f45('0x1c')](function(_0x585b5a){if(_0x585b5a){_0xb79914=_0x585b5a['length'];if(!_0x2a1340[_0x6f45('0x30')][_0x6f45('0x52')](_0x6f45('0x43'))){_0x287e8a[_0x6f45('0x15')]=qs[_0x6f45('0x15')](_0x2a1340[_0x6f45('0x30')][_0x6f45('0x15')]);_0x287e8a[_0x6f45('0x13')]=qs['offset'](_0x2a1340['query'][_0x6f45('0x13')]);}return _0x517290[_0x6f45('0x50')](_0x287e8a);}})[_0x6f45('0x1c')](function(_0x1fa071){if(_0x1fa071){return _0x1fa071?{'count':_0xb79914,'rows':_0x1fa071}:null;}})[_0x6f45('0x1c')](respondWithResult(_0x23c89c,null))[_0x6f45('0x2a')](handleError(_0x23c89c,null));};exports[_0x6f45('0x53')]=function(_0x3a42b4,_0x3647fa){var _0x16f34b=_0x3a42b4['body'][_0x6f45('0x54')];return db[_0x6f45('0x51')][_0x6f45('0x28')]({'where':{'id':_0x16f34b},'attributes':['id'],'include':[{'model':db[_0x6f45('0x55')],'as':'Agents','attributes':['id',_0x6f45('0x1e'),'online',_0x6f45('0x56'),_0x6f45('0x57')],'raw':!![]}]})['then'](function(_0x55a261){if(_0x55a261){var _0x25711a=_['flatMap'](_0x55a261,function(_0x39570e){var _0x2a216a=_0x39570e['get']({'plain':!![]});return _0x2a216a[_0x6f45('0x58')];});return db[_0x6f45('0x22')][_0x6f45('0x37')]({'where':{'id':_0x3a42b4[_0x6f45('0x2c')]['id']}})[_0x6f45('0x1c')](function(_0x58cad4){return db[_0x6f45('0x59')][_0x6f45('0x5a')](function(_0x26efde){return _0x58cad4['addTeams'](_0x16f34b,{'transaction':_0x26efde})[_0x6f45('0x1c')](function(){return BPromise['each'](_0x25711a,function(_0x545cb2){return db[_0x6f45('0x5b')][_0x6f45('0x5c')]({'where':{'UserId':_0x545cb2['id'],'OpenchannelQueueId':_0x3a42b4[_0x6f45('0x2c')]['id']},'transaction':_0x26efde});});})['then'](function(){_0x25711a[_0x6f45('0x5d')](function(_0x218126){socket[_0x6f45('0x5e')](_0x6f45('0x5f'),{'UserId':_0x218126['id'],'OpenchannelQueueId':_0x58cad4['id']});});});});});}})['then'](respondWithStatusCode(_0x3647fa,null))[_0x6f45('0x2a')](handleError(_0x3647fa,null));};exports[_0x6f45('0x60')]=function(_0x4b6cb1,_0x194b76){return db[_0x6f45('0x51')][_0x6f45('0x28')]({'where':{'id':_0x4b6cb1['query'][_0x6f45('0x54')]},'attributes':['id'],'include':[{'model':db[_0x6f45('0x55')],'as':_0x6f45('0x58'),'attributes':['id'],'raw':!![]}]})[_0x6f45('0x1c')](handleEntityNotFound(_0x194b76,null))['then'](function(_0x4532c2){var _0x4544e7=_[_0x6f45('0x21')](_0x4532c2,'id');var _0x5275de=[];var _0x4d7274=[];var _0x5ed2ff=squel[_0x6f45('0x61')]();_0x5ed2ff[_0x6f45('0x62')](_0x6f45('0x63'))[_0x6f45('0x64')]('team_has_openchannel_queues','tq')[_0x6f45('0x65')]('user_has_teams','ut',_0x6f45('0x66'))[_0x6f45('0x26')](_0x6f45('0x67'),_0x4b6cb1['params']['id']);for(var _0x69f66c=0x0;_0x69f66c<_0x4532c2[_0x6f45('0x33')];_0x69f66c+=0x1){let _0x213b9a=_0x4532c2[_0x69f66c];for(var _0x877bad=0x0;_0x877bad<_0x213b9a[_0x6f45('0x58')][_0x6f45('0x33')];_0x877bad+=0x1){let _0x54ee83=_0x213b9a[_0x6f45('0x58')][_0x877bad];var _0x261983=_0x5ed2ff['clone']();_0x261983['where'](_0x6f45('0x68'),_0x54ee83['id']);_0x4d7274[_0x6f45('0x69')](db[_0x6f45('0x59')][_0x6f45('0x30')](_0x261983['toString'](),{'type':db[_0x6f45('0x59')][_0x6f45('0x6a')][_0x6f45('0x6b')]})[_0x6f45('0x1c')](function(_0x58f3e7){if(_0x58f3e7['length']===0x1){return _0x54ee83['id'];}else{var _0x586c1c=_['every'](_[_0x6f45('0x21')](_0x58f3e7,_0x6f45('0x6c')),function(_0x22d94d){return _['includes'](_0x4544e7,_0x22d94d);});if(_0x586c1c){return _0x54ee83['id'];}}}));}}return BPromise[_0x6f45('0x6d')](_0x4d7274)[_0x6f45('0x1c')](function(_0x1a3a7b){_0x5275de=_(_0x5275de)['union'](_0x1a3a7b)[_0x6f45('0x6e')]()[_0x6f45('0x6f')]();return db['OpenchannelQueue'][_0x6f45('0x37')]({'where':{'id':_0x4b6cb1[_0x6f45('0x2c')]['id']}})[_0x6f45('0x1c')](function(_0x114b08){return db[_0x6f45('0x59')][_0x6f45('0x5a')](function(_0x172f7f){return _0x114b08[_0x6f45('0x60')](_0x4b6cb1['query'][_0x6f45('0x54')],{'transaction':_0x172f7f})[_0x6f45('0x1c')](function(){if(!_[_0x6f45('0x70')](_0x5275de)){return _0x114b08[_0x6f45('0x71')](_0x5275de,{'transaction':_0x172f7f});}})['then'](function(){_0x5275de[_0x6f45('0x5d')](function(_0x19d4ef){socket[_0x6f45('0x5e')](_0x6f45('0x72'),{'UserId':_0x19d4ef,'OpenchannelQueueId':_0x114b08['id']});});});});});});})[_0x6f45('0x1c')](respondWithStatusCode(_0x194b76,null))['catch'](handleError(_0x194b76,null));};exports[_0x6f45('0x73')]=function(_0x4e3056,_0x439cb6){return db[_0x6f45('0x22')][_0x6f45('0x37')]({'where':{'id':_0x4e3056[_0x6f45('0x2c')]['id']}})['then'](handleEntityNotFound(_0x439cb6,null))[_0x6f45('0x1c')](function(_0x264f6a){if(_0x264f6a){return _0x264f6a[_0x6f45('0x73')](_0x4e3056[_0x6f45('0x39')][_0x6f45('0x54')],_[_0x6f45('0x74')](_0x4e3056[_0x6f45('0x39')],[_0x6f45('0x54'),'id'])||{})[_0x6f45('0x75')](function(_0x24b14d){for(var _0x368cfc=0x0;_0x368cfc<_0x4e3056[_0x6f45('0x39')][_0x6f45('0x54')][_0x6f45('0x33')];_0x368cfc+=0x1){socket[_0x6f45('0x5e')](_0x6f45('0x5f'),{'UserId':Number(_0x4e3056[_0x6f45('0x39')]['ids'][_0x368cfc]),'OpenchannelQueueId':Number(_0x4e3056[_0x6f45('0x2c')]['id'])});}return _0x24b14d;});}})[_0x6f45('0x1c')](respondWithResult(_0x439cb6,null))[_0x6f45('0x2a')](handleError(_0x439cb6,null));};exports['removeAgents']=function(_0x455101,_0x4fc16a){return db['OpenchannelQueue'][_0x6f45('0x37')]({'where':{'id':_0x455101[_0x6f45('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4fc16a,null))[_0x6f45('0x1c')](function(_0x3fd6e8){if(_0x3fd6e8){return _0x3fd6e8[_0x6f45('0x71')](_0x455101[_0x6f45('0x30')]['ids'])[_0x6f45('0x1c')](function(){if(_[_0x6f45('0x76')](_0x455101[_0x6f45('0x30')]['ids'])){for(var _0x2cc05e=0x0;_0x2cc05e<_0x455101['query'][_0x6f45('0x54')][_0x6f45('0x33')];_0x2cc05e+=0x1){socket['emit'](_0x6f45('0x72'),{'UserId':Number(_0x455101[_0x6f45('0x30')]['ids'][_0x2cc05e]),'OpenchannelQueueId':Number(_0x455101[_0x6f45('0x2c')]['id'])});}}else{socket[_0x6f45('0x5e')]('userOpenchannelQueue:remove',{'UserId':Number(_0x455101[_0x6f45('0x30')][_0x6f45('0x54')]),'OpenchannelQueueId':Number(_0x455101[_0x6f45('0x2c')]['id'])});}});}})[_0x6f45('0x1c')](respondWithStatusCode(_0x4fc16a,null))[_0x6f45('0x2a')](handleError(_0x4fc16a,null));};exports[_0x6f45('0x77')]=function(_0x4b8ca9,_0x1212db){var _0x2b1c2a={};var _0xa71d1e={};var _0x75db58;var _0xe8f9b4;return db[_0x6f45('0x22')][_0x6f45('0x41')]({'where':{'id':_0x4b8ca9[_0x6f45('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1212db,null))[_0x6f45('0x1c')](function(_0x2242c9){if(_0x2242c9){_0x75db58=_0x2242c9;_0xa71d1e[_0x6f45('0x2d')]=_[_0x6f45('0x2e')](db[_0x6f45('0x55')]['rawAttributes']);_0xa71d1e[_0x6f45('0x30')]=_['keys'](_0x4b8ca9[_0x6f45('0x30')]);_0xa71d1e[_0x6f45('0x42')]=_['intersection'](_0xa71d1e['model'],_0xa71d1e['query']);_0x2b1c2a[_0x6f45('0x32')]=_[_0x6f45('0x2f')](_0xa71d1e[_0x6f45('0x2d')],qs[_0x6f45('0x31')](_0x4b8ca9['query'][_0x6f45('0x31')]));_0x2b1c2a[_0x6f45('0x32')]=_0x2b1c2a['attributes']['length']?_0x2b1c2a['attributes']:_0xa71d1e['model'];_0x2b1c2a['order']=qs[_0x6f45('0x45')](_0x4b8ca9[_0x6f45('0x30')]['sort']);_0x2b1c2a[_0x6f45('0x26')]=qs[_0x6f45('0x42')](_[_0x6f45('0x46')](_0x4b8ca9[_0x6f45('0x30')],_0xa71d1e[_0x6f45('0x42')]));if(_0x4b8ca9[_0x6f45('0x30')][_0x6f45('0x48')]){_0x2b1c2a[_0x6f45('0x26')]=_['merge'](_0x2b1c2a[_0x6f45('0x26')],{'$or':_['map'](_0x2b1c2a['attributes'],function(_0x1a44d1){var _0x3f5f34={};_0x3f5f34[_0x1a44d1]={'$like':'%'+_0x4b8ca9[_0x6f45('0x30')][_0x6f45('0x48')]+'%'};return _0x3f5f34;})});}_0x2b1c2a=_['merge']({},_0x2b1c2a,_0x4b8ca9[_0x6f45('0x36')]);return _0x75db58['getAgents'](_0x2b1c2a);}})['then'](function(_0x432456){if(_0x432456){_0xe8f9b4=_0x432456['length'];if(!_0x4b8ca9['query'][_0x6f45('0x52')](_0x6f45('0x43'))){_0x2b1c2a[_0x6f45('0x15')]=qs['limit'](_0x4b8ca9[_0x6f45('0x30')]['limit']);_0x2b1c2a[_0x6f45('0x13')]=qs['offset'](_0x4b8ca9['query'][_0x6f45('0x13')]);}return _0x75db58[_0x6f45('0x77')](_0x2b1c2a);}})[_0x6f45('0x1c')](function(_0x3faaed){if(_0x3faaed){return _0x3faaed?{'count':_0xe8f9b4,'rows':_0x3faaed}:null;}})[_0x6f45('0x1c')](respondWithResult(_0x1212db,null))[_0x6f45('0x2a')](handleError(_0x1212db,null));}; \ No newline at end of file +var _0x0fb4=['socket.io-emitter','./openchannelQueue.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','then','destroy','get','OpenchannelQueues','UserProfileResource','sendStatus','stack','name','send','index','key','where','OpenchannelQueue','include','query','rows','catch','show','params','model','keys','rawAttributes','intersection','attributes','fields','length','includeAll','merge','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','error','update','describe','findOne','UserOpenchannelQueue','filters','nolimit','order','sort','pick','OpenchannelQueueId','map','options','findAll','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','filter','hasOwnProperty','addTeams','ids','Agents','voicePause','interface','transaction','each','findOrCreate','forEach','userOpenchannelQueue:save','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','emit','addAgents','omit','isArray','userOpenchannelQueue:remove','getAgents','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost'];(function(_0x10c532,_0x44566d){var _0x10dfec=function(_0x291f87){while(--_0x291f87){_0x10c532['push'](_0x10c532['shift']());}};_0x10dfec(++_0x44566d);}(_0x0fb4,0x166));var _0x40fb=function(_0x4c184d,_0x4278ab){_0x4c184d=_0x4c184d-0x0;var _0x23d997=_0x0fb4[_0x4c184d];return _0x23d997;};'use strict';var BPromise=require(_0x40fb('0x0'));var util=require('util');var _=require(_0x40fb('0x1'));var squel=require('squel');var Redis=require(_0x40fb('0x2'));var qs=require(_0x40fb('0x3'));var logger=require(_0x40fb('0x4'))('api');var config=require('../../config/environment');var db=require(_0x40fb('0x5'))['db'];config[_0x40fb('0x6')]=_['defaults'](config[_0x40fb('0x6')],{'host':_0x40fb('0x7'),'port':0x18eb});var socket=require(_0x40fb('0x8'))(new Redis(config[_0x40fb('0x6')]));require(_0x40fb('0x9'))[_0x40fb('0xa')](socket);function respondWithStatusCode(_0x48541f,_0xcb14f7){_0xcb14f7=_0xcb14f7||0xcc;return function(_0x169054){if(_0x169054){return _0x48541f['sendStatus'](_0xcb14f7);}return _0x48541f[_0x40fb('0xb')](_0xcb14f7)[_0x40fb('0xc')]();};}function respondWithResult(_0x261808,_0x3eb151){_0x3eb151=_0x3eb151||0xc8;return function(_0x24d8e3){if(_0x24d8e3){return _0x261808['status'](_0x3eb151)[_0x40fb('0xd')](_0x24d8e3);}};}function respondWithFilteredResult(_0x341b64,_0x296a0c){return function(_0x254727){if(_0x254727){var _0x9837c4=typeof _0x296a0c['offset']===_0x40fb('0xe')&&typeof _0x296a0c[_0x40fb('0xf')]===_0x40fb('0xe');var _0x14a35a=_0x254727[_0x40fb('0x10')];var _0x3e4eac=_0x9837c4?0x0:_0x296a0c[_0x40fb('0x11')];var _0x4db57f=_0x9837c4?_0x254727['count']:_0x296a0c['offset']+_0x296a0c[_0x40fb('0xf')];var _0x59556c;if(_0x4db57f>=_0x14a35a){_0x4db57f=_0x14a35a;_0x59556c=0xc8;}else{_0x59556c=0xce;}_0x341b64[_0x40fb('0xb')](_0x59556c);return _0x341b64[_0x40fb('0x12')](_0x40fb('0x13'),_0x3e4eac+'-'+_0x4db57f+'/'+_0x14a35a)[_0x40fb('0xd')](_0x254727);}return null;};}function saveUpdates(_0xe471db){return function(_0x3d2b37){if(_0x3d2b37){return _0x3d2b37['update'](_0xe471db)[_0x40fb('0x14')](function(_0x5fdf6a){return _0x5fdf6a;});}return null;};}function removeEntity(_0x3c3a05){return function(_0x2742be){if(_0x2742be){return _0x2742be[_0x40fb('0x15')]()[_0x40fb('0x14')](function(){var _0x399a2d=_0x2742be[_0x40fb('0x16')]({'plain':!![]});var _0x2ecd13=_0x40fb('0x17');return db[_0x40fb('0x18')][_0x40fb('0x15')]({'where':{'type':_0x2ecd13,'resourceId':_0x399a2d['id']}})[_0x40fb('0x14')](function(){return _0x2742be;});})[_0x40fb('0x14')](function(){_0x3c3a05[_0x40fb('0xb')](0xcc)[_0x40fb('0xc')]();});}};}function handleEntityNotFound(_0x5c173d){return function(_0x167795){if(!_0x167795){_0x5c173d[_0x40fb('0x19')](0x194);}return _0x167795;};}function handleError(_0x5605f2,_0x241e36){_0x241e36=_0x241e36||0x1f4;return function(_0x435e3a){logger['error'](_0x435e3a[_0x40fb('0x1a')]);if(_0x435e3a[_0x40fb('0x1b')]){delete _0x435e3a['name'];}_0x5605f2[_0x40fb('0xb')](_0x241e36)[_0x40fb('0x1c')](_0x435e3a);};}exports[_0x40fb('0x1d')]=function(_0x38ae59,_0x436113){var _0x5d22c7={};var _0x21d6f9={'count':0x0,'rows':[]};var _0x8fd4f2=_['map'](db['OpenchannelQueue']['rawAttributes'],function(_0x494252){return{'name':_0x494252['fieldName'],'type':_0x494252['type'][_0x40fb('0x1e')]};});_0x5d22c7=qs['getOptions'](_0x8fd4f2,_0x38ae59);var _0x3eb697={'where':_0x5d22c7[_0x40fb('0x1f')]};return db[_0x40fb('0x20')][_0x40fb('0x10')](_0x3eb697)['then'](function(_0x42e32e){_0x21d6f9[_0x40fb('0x10')]=_0x42e32e;_0x5d22c7[_0x40fb('0x21')]=qs[_0x40fb('0x21')](_0x38ae59[_0x40fb('0x22')]);return db['OpenchannelQueue']['findAll'](_0x5d22c7);})[_0x40fb('0x14')](function(_0x1e71c9){_0x21d6f9[_0x40fb('0x23')]=_0x1e71c9;return _0x21d6f9;})[_0x40fb('0x14')](respondWithFilteredResult(_0x436113,_0x5d22c7))[_0x40fb('0x24')](handleError(_0x436113,null));};exports[_0x40fb('0x25')]=function(_0x3b1eed,_0x5c1f69){var _0x113c29={'raw':!![],'where':{'id':_0x3b1eed[_0x40fb('0x26')]['id']}},_0x4cd314={};_0x4cd314[_0x40fb('0x27')]=_[_0x40fb('0x28')](db[_0x40fb('0x20')][_0x40fb('0x29')]);_0x4cd314[_0x40fb('0x22')]=_['keys'](_0x3b1eed[_0x40fb('0x22')]);_0x4cd314['filters']=_[_0x40fb('0x2a')](_0x4cd314['model'],_0x4cd314[_0x40fb('0x22')]);_0x113c29[_0x40fb('0x2b')]=_[_0x40fb('0x2a')](_0x4cd314[_0x40fb('0x27')],qs[_0x40fb('0x2c')](_0x3b1eed[_0x40fb('0x22')][_0x40fb('0x2c')]));_0x113c29[_0x40fb('0x2b')]=_0x113c29[_0x40fb('0x2b')][_0x40fb('0x2d')]?_0x113c29[_0x40fb('0x2b')]:_0x4cd314[_0x40fb('0x27')];if(_0x3b1eed['query'][_0x40fb('0x2e')]){_0x113c29['include']=[{'all':!![]}];}_0x113c29=_[_0x40fb('0x2f')]({},_0x113c29,_0x3b1eed['options']);return db['OpenchannelQueue'][_0x40fb('0x30')](_0x113c29)[_0x40fb('0x14')](handleEntityNotFound(_0x5c1f69,null))['then'](respondWithResult(_0x5c1f69,null))[_0x40fb('0x24')](handleError(_0x5c1f69,null));};exports['create']=function(_0x213b59,_0x5ab0f8){return db[_0x40fb('0x20')]['create'](_0x213b59[_0x40fb('0x31')],{})[_0x40fb('0x14')](function(_0x3860f4){var _0x5827c9=_0x213b59[_0x40fb('0x32')][_0x40fb('0x16')]({'plain':!![]});if(!_0x5827c9)throw new Error(_0x40fb('0x33'));if(_0x5827c9['role']===_0x40fb('0x32')){var _0x5eebc7=_0x3860f4[_0x40fb('0x16')]({'plain':!![]});var _0x26f277=_0x40fb('0x17');return db[_0x40fb('0x34')][_0x40fb('0x30')]({'where':{'name':_0x26f277,'userProfileId':_0x5827c9[_0x40fb('0x35')]},'raw':!![]})[_0x40fb('0x14')](function(_0x5daf00){if(_0x5daf00&&_0x5daf00[_0x40fb('0x36')]===0x0){return db[_0x40fb('0x18')][_0x40fb('0x37')]({'name':_0x5eebc7[_0x40fb('0x1b')],'resourceId':_0x5eebc7['id'],'type':_0x5daf00[_0x40fb('0x1b')],'sectionId':_0x5daf00['id']},{})['then'](function(){return _0x3860f4;});}else{return _0x3860f4;}})[_0x40fb('0x24')](function(_0x297566){logger[_0x40fb('0x38')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x297566);throw _0x297566;});}return _0x3860f4;})[_0x40fb('0x14')](respondWithResult(_0x5ab0f8,0xc9))['catch'](handleError(_0x5ab0f8,null));};exports[_0x40fb('0x39')]=function(_0x57aac3,_0x184b43){if(_0x57aac3[_0x40fb('0x31')]['id']){delete _0x57aac3[_0x40fb('0x31')]['id'];}return db[_0x40fb('0x20')][_0x40fb('0x30')]({'where':{'id':_0x57aac3[_0x40fb('0x26')]['id']}})[_0x40fb('0x14')](handleEntityNotFound(_0x184b43,null))['then'](saveUpdates(_0x57aac3[_0x40fb('0x31')],null))[_0x40fb('0x14')](respondWithResult(_0x184b43,null))[_0x40fb('0x24')](handleError(_0x184b43,null));};exports['destroy']=function(_0x2036d7,_0x3823bb){return db[_0x40fb('0x20')][_0x40fb('0x30')]({'where':{'id':_0x2036d7['params']['id']}})[_0x40fb('0x14')](handleEntityNotFound(_0x3823bb,null))[_0x40fb('0x14')](removeEntity(_0x3823bb,null))[_0x40fb('0x24')](handleError(_0x3823bb,null));};exports['describe']=function(_0x2f5fb3,_0x3ccac0){return db[_0x40fb('0x20')][_0x40fb('0x3a')]()[_0x40fb('0x14')](respondWithResult(_0x3ccac0,null))[_0x40fb('0x24')](handleError(_0x3ccac0,null));};exports['getMembers']=function(_0x492571,_0x1b4ec6){var _0x14abee={'raw':!![],'where':{}},_0x2cb2f4={},_0x21f7ae;return db[_0x40fb('0x20')][_0x40fb('0x3b')]({'where':{'id':_0x492571[_0x40fb('0x26')]['id']}})['then'](handleEntityNotFound(_0x1b4ec6,null))['then'](function(_0x501091){if(_0x501091){_0x21f7ae=_0x501091[_0x40fb('0x16')]({'plain':!![]});_0x2cb2f4[_0x40fb('0x27')]=_['keys'](db[_0x40fb('0x3c')][_0x40fb('0x29')]);_0x2cb2f4[_0x40fb('0x22')]=_[_0x40fb('0x28')](_0x492571['query']);_0x2cb2f4[_0x40fb('0x3d')]=_[_0x40fb('0x2a')](_0x2cb2f4[_0x40fb('0x27')],_0x2cb2f4[_0x40fb('0x22')]);_0x14abee['attributes']=_[_0x40fb('0x2a')](_0x2cb2f4[_0x40fb('0x27')],qs[_0x40fb('0x2c')](_0x492571['query'][_0x40fb('0x2c')]));_0x14abee['attributes']=_0x14abee[_0x40fb('0x2b')][_0x40fb('0x2d')]?_0x14abee[_0x40fb('0x2b')]:_0x2cb2f4[_0x40fb('0x27')];if(!_0x492571['query']['hasOwnProperty'](_0x40fb('0x3e'))){_0x14abee[_0x40fb('0xf')]=qs[_0x40fb('0xf')](_0x492571[_0x40fb('0x22')][_0x40fb('0xf')]);_0x14abee[_0x40fb('0x11')]=qs['offset'](_0x492571[_0x40fb('0x22')][_0x40fb('0x11')]);}_0x14abee[_0x40fb('0x3f')]=qs[_0x40fb('0x40')](_0x492571['query'][_0x40fb('0x40')]);_0x14abee[_0x40fb('0x1f')]=qs['filters'](_[_0x40fb('0x41')](_0x492571['query'],_0x2cb2f4[_0x40fb('0x3d')]));_0x14abee['where'][_0x40fb('0x42')]=_0x501091['id'];if(_0x492571[_0x40fb('0x22')]['filter']){_0x14abee[_0x40fb('0x1f')]=_[_0x40fb('0x2f')](_0x14abee[_0x40fb('0x1f')],{'$or':_[_0x40fb('0x43')](_0x14abee['attributes'],function(_0xbb2912){var _0x52158f={};_0x52158f[_0xbb2912]={'$like':'%'+_0x492571[_0x40fb('0x22')]['filter']+'%'};return _0x52158f;})});}_0x14abee=_[_0x40fb('0x2f')]({},_0x14abee,_0x492571[_0x40fb('0x44')]);return db[_0x40fb('0x3c')][_0x40fb('0x45')](_0x14abee);}})[_0x40fb('0x14')](function(_0xe3b88e){if(_0xe3b88e){return db[_0x40fb('0x46')][_0x40fb('0x47')]({'where':{'id':_['map'](_0xe3b88e,_0x40fb('0x48')),'role':_0x40fb('0x49')},'attributes':['id',_0x40fb('0x1b'),_0x40fb('0x4a'),_0x40fb('0x4b'),_0x40fb('0x4c')]});}})[_0x40fb('0x14')](function(_0xcada67){if(_0xcada67){return{'count':_0xcada67['count'],'rows':_[_0x40fb('0x43')](_0xcada67['rows'],function(_0x26f1fb){return{'membername':_0x26f1fb[_0x40fb('0x1b')],'UserId':_0x26f1fb['id'],'queue_name':_0x21f7ae['name'],'OpenchannelQueueId':_0x21f7ae['id'],'interface':util[_0x40fb('0x4d')](_0x40fb('0x4e'),_0x40fb('0x4f'),_0x26f1fb[_0x40fb('0x1b')]),'penalty':0x0,'paused':_0x26f1fb[_0x40fb('0x4a')],'createdAt':_0x26f1fb['createdAt'],'updatedAt':_0x26f1fb[_0x40fb('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x40fb('0x14')](respondWithFilteredResult(_0x1b4ec6,_0x14abee))[_0x40fb('0x24')](handleError(_0x1b4ec6,null));};exports[_0x40fb('0x50')]=function(_0x10b0b7,_0x1e8c73){var _0x34f194={};var _0x4cf727={};var _0x13643a;var _0x1666fd;return db[_0x40fb('0x20')][_0x40fb('0x3b')]({'where':{'id':_0x10b0b7[_0x40fb('0x26')]['id']}})[_0x40fb('0x14')](handleEntityNotFound(_0x1e8c73,null))[_0x40fb('0x14')](function(_0x336ddf){if(_0x336ddf){_0x13643a=_0x336ddf;_0x4cf727[_0x40fb('0x27')]=_[_0x40fb('0x28')](db[_0x40fb('0x51')][_0x40fb('0x29')]);_0x4cf727[_0x40fb('0x22')]=_['keys'](_0x10b0b7['query']);_0x4cf727[_0x40fb('0x3d')]=_[_0x40fb('0x2a')](_0x4cf727['model'],_0x4cf727[_0x40fb('0x22')]);_0x34f194[_0x40fb('0x2b')]=_[_0x40fb('0x2a')](_0x4cf727[_0x40fb('0x27')],qs[_0x40fb('0x2c')](_0x10b0b7[_0x40fb('0x22')][_0x40fb('0x2c')]));_0x34f194['attributes']=_0x34f194[_0x40fb('0x2b')][_0x40fb('0x2d')]?_0x34f194[_0x40fb('0x2b')]:_0x4cf727[_0x40fb('0x27')];_0x34f194[_0x40fb('0x3f')]=qs[_0x40fb('0x40')](_0x10b0b7[_0x40fb('0x22')]['sort']);_0x34f194[_0x40fb('0x1f')]=qs['filters'](_[_0x40fb('0x41')](_0x10b0b7[_0x40fb('0x22')],_0x4cf727[_0x40fb('0x3d')]));if(_0x10b0b7[_0x40fb('0x22')][_0x40fb('0x52')]){_0x34f194[_0x40fb('0x1f')]=_[_0x40fb('0x2f')](_0x34f194[_0x40fb('0x1f')],{'$or':_[_0x40fb('0x43')](_0x34f194[_0x40fb('0x2b')],function(_0x58d061){var _0x3bb329={};_0x3bb329[_0x58d061]={'$like':'%'+_0x10b0b7[_0x40fb('0x22')]['filter']+'%'};return _0x3bb329;})});}_0x34f194=_['merge']({},_0x34f194,_0x10b0b7[_0x40fb('0x44')]);return _0x13643a[_0x40fb('0x50')](_0x34f194);}})[_0x40fb('0x14')](function(_0x238d83){if(_0x238d83){_0x1666fd=_0x238d83[_0x40fb('0x2d')];if(!_0x10b0b7['query'][_0x40fb('0x53')](_0x40fb('0x3e'))){_0x34f194[_0x40fb('0xf')]=qs[_0x40fb('0xf')](_0x10b0b7[_0x40fb('0x22')][_0x40fb('0xf')]);_0x34f194[_0x40fb('0x11')]=qs['offset'](_0x10b0b7[_0x40fb('0x22')][_0x40fb('0x11')]);}return _0x13643a[_0x40fb('0x50')](_0x34f194);}})[_0x40fb('0x14')](function(_0x47b029){if(_0x47b029){return _0x47b029?{'count':_0x1666fd,'rows':_0x47b029}:null;}})[_0x40fb('0x14')](respondWithResult(_0x1e8c73,null))[_0x40fb('0x24')](handleError(_0x1e8c73,null));};exports[_0x40fb('0x54')]=function(_0x2385d0,_0x170992){var _0x2e3b7d=_0x2385d0[_0x40fb('0x31')][_0x40fb('0x55')];return db[_0x40fb('0x51')][_0x40fb('0x45')]({'where':{'id':_0x2e3b7d},'attributes':['id'],'include':[{'model':db[_0x40fb('0x46')],'as':_0x40fb('0x56'),'attributes':['id','name','online',_0x40fb('0x57'),_0x40fb('0x58')],'raw':!![]}]})[_0x40fb('0x14')](function(_0xb88c4e){if(_0xb88c4e){var _0x1b6e36=_['flatMap'](_0xb88c4e,function(_0x37dead){var _0x413090=_0x37dead['get']({'plain':!![]});return _0x413090['Agents'];});return db[_0x40fb('0x20')][_0x40fb('0x30')]({'where':{'id':_0x2385d0['params']['id']}})[_0x40fb('0x14')](function(_0x3ff12c){return db['sequelize'][_0x40fb('0x59')](function(_0x345edd){return _0x3ff12c['addTeams'](_0x2e3b7d,{'transaction':_0x345edd})[_0x40fb('0x14')](function(){return BPromise[_0x40fb('0x5a')](_0x1b6e36,function(_0x3d9a98){return db['UserOpenchannelQueue'][_0x40fb('0x5b')]({'where':{'UserId':_0x3d9a98['id'],'OpenchannelQueueId':_0x2385d0[_0x40fb('0x26')]['id']},'transaction':_0x345edd});});})['then'](function(){_0x1b6e36[_0x40fb('0x5c')](function(_0x50457c){socket['emit'](_0x40fb('0x5d'),{'UserId':_0x50457c['id'],'OpenchannelQueueId':_0x3ff12c['id']});});});});});}})['then'](respondWithStatusCode(_0x170992,null))[_0x40fb('0x24')](handleError(_0x170992,null));};exports['removeTeams']=function(_0x5a70f8,_0x6b9484){return db[_0x40fb('0x51')][_0x40fb('0x45')]({'where':{'id':_0x5a70f8['query'][_0x40fb('0x55')]},'attributes':['id'],'include':[{'model':db[_0x40fb('0x46')],'as':_0x40fb('0x56'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x6b9484,null))[_0x40fb('0x14')](function(_0x54a5c6){var _0x2f3dd0=_['map'](_0x54a5c6,'id');var _0x1a7032=[];var _0x311370=[];var _0x10ab43=squel[_0x40fb('0x5e')]();_0x10ab43[_0x40fb('0x5f')](_0x40fb('0x60'))[_0x40fb('0x61')]('team_has_openchannel_queues','tq')[_0x40fb('0x62')](_0x40fb('0x63'),'ut',_0x40fb('0x64'))[_0x40fb('0x1f')](_0x40fb('0x65'),_0x5a70f8['params']['id']);for(var _0x546a38=0x0;_0x546a38<_0x54a5c6[_0x40fb('0x2d')];_0x546a38+=0x1){let _0x4e02ea=_0x54a5c6[_0x546a38];for(var _0x3d4e97=0x0;_0x3d4e97<_0x4e02ea[_0x40fb('0x56')][_0x40fb('0x2d')];_0x3d4e97+=0x1){let _0x2d5f8e=_0x4e02ea[_0x40fb('0x56')][_0x3d4e97];var _0x35819d=_0x10ab43[_0x40fb('0x66')]();_0x35819d['where'](_0x40fb('0x67'),_0x2d5f8e['id']);_0x311370[_0x40fb('0x68')](db[_0x40fb('0x69')][_0x40fb('0x22')](_0x35819d[_0x40fb('0x6a')](),{'type':db[_0x40fb('0x69')]['QueryTypes'][_0x40fb('0x6b')]})[_0x40fb('0x14')](function(_0x3bb40e){if(_0x3bb40e[_0x40fb('0x2d')]===0x1){return _0x2d5f8e['id'];}else{var _0x41a7d0=_[_0x40fb('0x6c')](_[_0x40fb('0x43')](_0x3bb40e,'TeamId'),function(_0x38864a){return _[_0x40fb('0x6d')](_0x2f3dd0,_0x38864a);});if(_0x41a7d0){return _0x2d5f8e['id'];}}}));}}return BPromise[_0x40fb('0x6e')](_0x311370)[_0x40fb('0x14')](function(_0x5340a8){_0x1a7032=_(_0x1a7032)[_0x40fb('0x6f')](_0x5340a8)[_0x40fb('0x70')]()[_0x40fb('0x71')]();return db[_0x40fb('0x20')][_0x40fb('0x30')]({'where':{'id':_0x5a70f8[_0x40fb('0x26')]['id']}})[_0x40fb('0x14')](function(_0x32d403){return db['sequelize'][_0x40fb('0x59')](function(_0x47e8e8){return _0x32d403['removeTeams'](_0x5a70f8[_0x40fb('0x22')]['ids'],{'transaction':_0x47e8e8})[_0x40fb('0x14')](function(){if(!_[_0x40fb('0x72')](_0x1a7032)){return _0x32d403[_0x40fb('0x73')](_0x1a7032,{'transaction':_0x47e8e8});}})[_0x40fb('0x14')](function(){_0x1a7032[_0x40fb('0x5c')](function(_0x2775b8){socket[_0x40fb('0x74')]('userOpenchannelQueue:remove',{'UserId':_0x2775b8,'OpenchannelQueueId':_0x32d403['id']});});});});});});})[_0x40fb('0x14')](respondWithStatusCode(_0x6b9484,null))['catch'](handleError(_0x6b9484,null));};exports[_0x40fb('0x75')]=function(_0x4898eb,_0x50a315){return db[_0x40fb('0x20')][_0x40fb('0x30')]({'where':{'id':_0x4898eb['params']['id']}})[_0x40fb('0x14')](handleEntityNotFound(_0x50a315,null))['then'](function(_0x4bdbb4){if(_0x4bdbb4){return _0x4bdbb4[_0x40fb('0x75')](_0x4898eb[_0x40fb('0x31')]['ids'],_[_0x40fb('0x76')](_0x4898eb[_0x40fb('0x31')],[_0x40fb('0x55'),'id'])||{})['spread'](function(_0x2cf0ae){for(var _0x2bc85f=0x0;_0x2bc85f<_0x4898eb[_0x40fb('0x31')][_0x40fb('0x55')][_0x40fb('0x2d')];_0x2bc85f+=0x1){socket[_0x40fb('0x74')](_0x40fb('0x5d'),{'UserId':Number(_0x4898eb[_0x40fb('0x31')][_0x40fb('0x55')][_0x2bc85f]),'OpenchannelQueueId':Number(_0x4898eb[_0x40fb('0x26')]['id'])});}return _0x2cf0ae;});}})['then'](respondWithResult(_0x50a315,null))[_0x40fb('0x24')](handleError(_0x50a315,null));};exports[_0x40fb('0x73')]=function(_0x37ad6d,_0x24610d){return db['OpenchannelQueue'][_0x40fb('0x30')]({'where':{'id':_0x37ad6d[_0x40fb('0x26')]['id']}})[_0x40fb('0x14')](handleEntityNotFound(_0x24610d,null))['then'](function(_0x34db3c){if(_0x34db3c){return _0x34db3c[_0x40fb('0x73')](_0x37ad6d[_0x40fb('0x22')][_0x40fb('0x55')])[_0x40fb('0x14')](function(){if(_[_0x40fb('0x77')](_0x37ad6d['query'][_0x40fb('0x55')])){for(var _0x36499b=0x0;_0x36499b<_0x37ad6d[_0x40fb('0x22')][_0x40fb('0x55')][_0x40fb('0x2d')];_0x36499b+=0x1){socket[_0x40fb('0x74')](_0x40fb('0x78'),{'UserId':Number(_0x37ad6d[_0x40fb('0x22')][_0x40fb('0x55')][_0x36499b]),'OpenchannelQueueId':Number(_0x37ad6d[_0x40fb('0x26')]['id'])});}}else{socket[_0x40fb('0x74')](_0x40fb('0x78'),{'UserId':Number(_0x37ad6d[_0x40fb('0x22')][_0x40fb('0x55')]),'OpenchannelQueueId':Number(_0x37ad6d['params']['id'])});}});}})[_0x40fb('0x14')](respondWithStatusCode(_0x24610d,null))[_0x40fb('0x24')](handleError(_0x24610d,null));};exports[_0x40fb('0x79')]=function(_0x1f8d78,_0xa90789){var _0x23bef8={};var _0x2aa26a={};var _0x1929bc;var _0xb5104d;return db[_0x40fb('0x20')][_0x40fb('0x3b')]({'where':{'id':_0x1f8d78[_0x40fb('0x26')]['id']}})[_0x40fb('0x14')](handleEntityNotFound(_0xa90789,null))[_0x40fb('0x14')](function(_0x3c008c){if(_0x3c008c){_0x1929bc=_0x3c008c;_0x2aa26a[_0x40fb('0x27')]=_['keys'](db['User'][_0x40fb('0x29')]);_0x2aa26a[_0x40fb('0x22')]=_['keys'](_0x1f8d78[_0x40fb('0x22')]);_0x2aa26a[_0x40fb('0x3d')]=_[_0x40fb('0x2a')](_0x2aa26a['model'],_0x2aa26a[_0x40fb('0x22')]);_0x23bef8[_0x40fb('0x2b')]=_[_0x40fb('0x2a')](_0x2aa26a[_0x40fb('0x27')],qs[_0x40fb('0x2c')](_0x1f8d78[_0x40fb('0x22')][_0x40fb('0x2c')]));_0x23bef8[_0x40fb('0x2b')]=_0x23bef8[_0x40fb('0x2b')][_0x40fb('0x2d')]?_0x23bef8[_0x40fb('0x2b')]:_0x2aa26a['model'];_0x23bef8[_0x40fb('0x3f')]=qs['sort'](_0x1f8d78['query'][_0x40fb('0x40')]);_0x23bef8[_0x40fb('0x1f')]=qs[_0x40fb('0x3d')](_['pick'](_0x1f8d78[_0x40fb('0x22')],_0x2aa26a['filters']));if(_0x1f8d78[_0x40fb('0x22')]['filter']){_0x23bef8[_0x40fb('0x1f')]=_[_0x40fb('0x2f')](_0x23bef8['where'],{'$or':_[_0x40fb('0x43')](_0x23bef8[_0x40fb('0x2b')],function(_0x2a5e11){var _0x24eb32={};_0x24eb32[_0x2a5e11]={'$like':'%'+_0x1f8d78[_0x40fb('0x22')][_0x40fb('0x52')]+'%'};return _0x24eb32;})});}_0x23bef8=_[_0x40fb('0x2f')]({},_0x23bef8,_0x1f8d78['options']);return _0x1929bc[_0x40fb('0x79')](_0x23bef8);}})[_0x40fb('0x14')](function(_0x18f2d7){if(_0x18f2d7){_0xb5104d=_0x18f2d7[_0x40fb('0x2d')];if(!_0x1f8d78[_0x40fb('0x22')][_0x40fb('0x53')](_0x40fb('0x3e'))){_0x23bef8[_0x40fb('0xf')]=qs[_0x40fb('0xf')](_0x1f8d78['query']['limit']);_0x23bef8[_0x40fb('0x11')]=qs[_0x40fb('0x11')](_0x1f8d78[_0x40fb('0x22')]['offset']);}return _0x1929bc[_0x40fb('0x79')](_0x23bef8);}})['then'](function(_0x74cee9){if(_0x74cee9){return _0x74cee9?{'count':_0xb5104d,'rows':_0x74cee9}:null;}})[_0x40fb('0x14')](respondWithResult(_0xa90789,null))[_0x40fb('0x24')](handleError(_0xa90789,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index c0e1d54..7012145 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 _0x844a=['hasOwnProperty','hook','events','OpenchannelQueue','setMaxListeners','remove','emit'];(function(_0x3a4503,_0x4660e5){var _0x355e59=function(_0x33245b){while(--_0x33245b){_0x3a4503['push'](_0x3a4503['shift']());}};_0x355e59(++_0x4660e5);}(_0x844a,0xbf));var _0xa844=function(_0x5def2d,_0x27f637){_0x5def2d=_0x5def2d-0x0;var _0x1a7757=_0x844a[_0x5def2d];return _0x1a7757;};'use strict';var EventEmitter=require(_0xa844('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xa844('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xa844('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa844('0x3')};function emitEvent(_0x251f48){return function(_0x4993ab,_0xf5e6ff,_0x31816e){OpenchannelQueueEvents[_0xa844('0x4')](_0x251f48+':'+_0x4993ab['id'],_0x4993ab);OpenchannelQueueEvents[_0xa844('0x4')](_0x251f48,_0x4993ab);_0x31816e(null);};}for(var e in events){if(events[_0xa844('0x5')](e)){var event=events[e];OpenchannelQueue[_0xa844('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xa405=['hook','exports','events','../../mysqldb','OpenchannelQueue','save','remove','emit','hasOwnProperty'];(function(_0x40015a,_0x415db5){var _0x42f8a4=function(_0x5685ad){while(--_0x5685ad){_0x40015a['push'](_0x40015a['shift']());}};_0x42f8a4(++_0x415db5);}(_0xa405,0x1d6));var _0x5a40=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa405[_0x167cc1];return _0x10bc4b;};'use strict';var EventEmitter=require(_0x5a40('0x0'));var OpenchannelQueue=require(_0x5a40('0x1'))['db'][_0x5a40('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5a40('0x3'),'afterUpdate':'update','afterDestroy':_0x5a40('0x4')};function emitEvent(_0x4e6c95){return function(_0x3dcfdf,_0x257c0a,_0x2ab7b1){OpenchannelQueueEvents[_0x5a40('0x5')](_0x4e6c95+':'+_0x3dcfdf['id'],_0x3dcfdf);OpenchannelQueueEvents[_0x5a40('0x5')](_0x4e6c95,_0x3dcfdf);_0x2ab7b1(null);};}for(var e in events){if(events[_0x5a40('0x6')](e)){var event=events[e];OpenchannelQueue[_0x5a40('0x7')](e,emitEvent(event));}}module[_0x5a40('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 9725809..f879333 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 _0x6dd4=['util','../../config/logger','request-promise','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues'];(function(_0x36c98a,_0x78f79e){var _0xaad26d=function(_0x4a6402){while(--_0x4a6402){_0x36c98a['push'](_0x36c98a['shift']());}};_0xaad26d(++_0x78f79e);}(_0x6dd4,0x90));var _0x46dd=function(_0x37dd04,_0x5e79e4){_0x37dd04=_0x37dd04-0x0;var _0x13f64f=_0x6dd4[_0x37dd04];return _0x13f64f;};'use strict';var _=require('lodash');var util=require(_0x46dd('0x0'));var logger=require(_0x46dd('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x46dd('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46dd('0x3'));var config=require('../../config/environment');var attributes=require(_0x46dd('0x4'));module[_0x46dd('0x5')]=function(_0x53fd63,_0x159735){return _0x53fd63[_0x46dd('0x6')](_0x46dd('0x7'),attributes,{'tableName':_0x46dd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe196=['openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0xe196,0x1b4));var _0x6e19=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe196[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x6e19('0x0'));var util=require(_0x6e19('0x1'));var logger=require(_0x6e19('0x2'))(_0x6e19('0x3'));var moment=require(_0x6e19('0x4'));var BPromise=require(_0x6e19('0x5'));var rp=require(_0x6e19('0x6'));var fs=require('fs');var path=require(_0x6e19('0x7'));var rimraf=require(_0x6e19('0x8'));var config=require(_0x6e19('0x9'));var attributes=require(_0x6e19('0xa'));module[_0x6e19('0xb')]=function(_0x28e29a,_0xe80bea){return _0x28e29a[_0x6e19('0xc')](_0x6e19('0xd'),attributes,{'tableName':_0x6e19('0xe'),'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 7a3900f..424ae03 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 _0x94cf=['client','http','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelQueue,\x20%s,\x20%s','result','catch','options','where','attributes','limit','include','map','model','then','GetOpenchannelQueue','ShowOpenchannelQueue','find','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3b0aab,_0x486c62){var _0x39efb2=function(_0x34d18c){while(--_0x34d18c){_0x3b0aab['push'](_0x3b0aab['shift']());}};_0x39efb2(++_0x486c62);}(_0x94cf,0x156));var _0xf94c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94cf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf94c('0x0'));var BPromise=require(_0xf94c('0x1'));var rs=require(_0xf94c('0x2'));var fs=require('fs');var Redis=require(_0xf94c('0x3'));var db=require(_0xf94c('0x4'))['db'];var utils=require(_0xf94c('0x5'));var logger=require(_0xf94c('0x6'))(_0xf94c('0x7'));var config=require('../../config/environment');var jayson=require(_0xf94c('0x8'));var client=jayson[_0xf94c('0x9')][_0xf94c('0xa')]({'port':0x232a});config[_0xf94c('0xb')]=_['defaults'](config[_0xf94c('0xb')],{'host':_0xf94c('0xc'),'port':0x18eb});var socket=require(_0xf94c('0xd'))(new Redis(config[_0xf94c('0xb')]));require('./openchannelQueue.socket')[_0xf94c('0xe')](socket);function respondWithRpcPromise(_0x1f1d8b,_0x313a7e,_0x49d121){return new BPromise(function(_0x52622f,_0x40e06b){return client[_0xf94c('0xf')](_0x1f1d8b,_0x49d121)['then'](function(_0xa7a49d){logger[_0xf94c('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x313a7e,_0xf94c('0x11'));logger[_0xf94c('0x12')](_0xf94c('0x13'),_0x313a7e,_0xf94c('0x11'),JSON[_0xf94c('0x14')](_0xa7a49d));if(_0xa7a49d[_0xf94c('0x15')]){if(_0xa7a49d[_0xf94c('0x15')][_0xf94c('0x16')]===0x1f4){logger[_0xf94c('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x313a7e,_0xa7a49d['error'][_0xf94c('0x17')]);return _0x40e06b(_0xa7a49d[_0xf94c('0x15')]['message']);}logger['error'](_0xf94c('0x18'),_0x313a7e,_0xa7a49d[_0xf94c('0x15')][_0xf94c('0x17')]);return _0x52622f(_0xa7a49d[_0xf94c('0x15')][_0xf94c('0x17')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x313a7e,_0xf94c('0x11'));_0x52622f(_0xa7a49d[_0xf94c('0x19')][_0xf94c('0x17')]);}})[_0xf94c('0x1a')](function(_0x20c295){logger[_0xf94c('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x313a7e,_0x20c295);_0x40e06b(_0x20c295);});});}exports['GetOpenchannelQueue']=function(_0x3a542b){var _0x334c55=this;return new Promise(function(_0x45ba6b,_0x739bd){return db['OpenchannelQueue']['findAll']({'raw':_0x3a542b[_0xf94c('0x1b')]?_0x3a542b[_0xf94c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3a542b[_0xf94c('0x1b')]?_0x3a542b[_0xf94c('0x1b')][_0xf94c('0x1c')]||null:null,'attributes':_0x3a542b[_0xf94c('0x1b')]?_0x3a542b['options'][_0xf94c('0x1d')]||null:null,'limit':_0x3a542b[_0xf94c('0x1b')]?_0x3a542b[_0xf94c('0x1b')][_0xf94c('0x1e')]||null:null,'include':_0x3a542b[_0xf94c('0x1b')]?_0x3a542b[_0xf94c('0x1b')][_0xf94c('0x1f')]?_[_0xf94c('0x20')](_0x3a542b[_0xf94c('0x1b')][_0xf94c('0x1f')],function(_0xd2b2f7){return{'model':db[_0xd2b2f7[_0xf94c('0x21')]],'as':_0xd2b2f7['as'],'attributes':_0xd2b2f7[_0xf94c('0x1d')],'include':_0xd2b2f7[_0xf94c('0x1f')]?_[_0xf94c('0x20')](_0xd2b2f7[_0xf94c('0x1f')],function(_0x470ae3){return{'model':db[_0x470ae3[_0xf94c('0x21')]],'as':_0x470ae3['as'],'attributes':_0x470ae3[_0xf94c('0x1d')],'include':_0x470ae3[_0xf94c('0x1f')]?_[_0xf94c('0x20')](_0x470ae3[_0xf94c('0x1f')],function(_0x38236b){return{'model':db[_0x38236b[_0xf94c('0x21')]],'as':_0x38236b['as'],'attributes':_0x38236b[_0xf94c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf94c('0x22')](function(_0x18793b){logger[_0xf94c('0x10')](_0xf94c('0x23'),_0x3a542b);logger[_0xf94c('0x12')](_0xf94c('0x23'),_0x3a542b,JSON[_0xf94c('0x14')](_0x18793b));_0x45ba6b(_0x18793b);})[_0xf94c('0x1a')](function(_0x39e98f){logger[_0xf94c('0x15')]('GetOpenchannelQueue',_0x39e98f['message'],_0x3a542b);_0x739bd(_0x334c55[_0xf94c('0x15')](0x1f4,_0x39e98f[_0xf94c('0x17')]));});});};exports[_0xf94c('0x24')]=function(_0x4d0920){var _0x49d00d=this;return new Promise(function(_0x39ebe9,_0x1c041f){return db['OpenchannelQueue'][_0xf94c('0x25')]({'raw':_0x4d0920[_0xf94c('0x1b')]?_0x4d0920['options'][_0xf94c('0x26')]===undefined?!![]:![]:!![],'where':_0x4d0920[_0xf94c('0x1b')]?_0x4d0920[_0xf94c('0x1b')]['where']||null:null,'attributes':_0x4d0920['options']?_0x4d0920['options'][_0xf94c('0x1d')]||null:null,'include':_0x4d0920[_0xf94c('0x1b')]?_0x4d0920[_0xf94c('0x1b')][_0xf94c('0x1f')]?_[_0xf94c('0x20')](_0x4d0920[_0xf94c('0x1b')]['include'],function(_0x4369e0){return{'model':db[_0x4369e0[_0xf94c('0x21')]],'as':_0x4369e0['as'],'attributes':_0x4369e0[_0xf94c('0x1d')],'include':_0x4369e0['include']?_[_0xf94c('0x20')](_0x4369e0[_0xf94c('0x1f')],function(_0x25fe3f){return{'model':db[_0x25fe3f[_0xf94c('0x21')]],'as':_0x25fe3f['as'],'attributes':_0x25fe3f[_0xf94c('0x1d')],'include':_0x25fe3f[_0xf94c('0x1f')]?_['map'](_0x25fe3f[_0xf94c('0x1f')],function(_0x3004cc){return{'model':db[_0x3004cc[_0xf94c('0x21')]],'as':_0x3004cc['as'],'attributes':_0x3004cc[_0xf94c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf94c('0x22')](function(_0x3fc318){logger['info'](_0xf94c('0x24'),_0x4d0920);logger[_0xf94c('0x12')](_0xf94c('0x24'),_0x4d0920,JSON[_0xf94c('0x14')](_0x3fc318));_0x39ebe9(_0x3fc318);})['catch'](function(_0x2eec99){logger[_0xf94c('0x15')]('ShowOpenchannelQueue',_0x2eec99[_0xf94c('0x17')],_0x4d0920);_0x1c041f(_0x49d00d[_0xf94c('0x15')](0x1f4,_0x2eec99[_0xf94c('0x17')]));});});}; \ No newline at end of file +var _0xe2ca=['options','raw','where','attributes','limit','include','map','model','GetOpenchannelQueue','ShowOpenchannelQueue','find','moment','bluebird','randomstring','../../mysqldb','../../config/logger','client','redis','localhost','./openchannelQueue.socket','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueue','findAll'];(function(_0x5c01ee,_0x53f4ff){var _0x151230=function(_0x3d3a21){while(--_0x3d3a21){_0x5c01ee['push'](_0x5c01ee['shift']());}};_0x151230(++_0x53f4ff);}(_0xe2ca,0x71));var _0xae2c=function(_0x593c6e,_0xc03d0e){_0x593c6e=_0x593c6e-0x0;var _0x6fb15a=_0xe2ca[_0x593c6e];return _0x6fb15a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae2c('0x0'));var BPromise=require(_0xae2c('0x1'));var rs=require(_0xae2c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae2c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xae2c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae2c('0x5')]['http']({'port':0x232a});config[_0xae2c('0x6')]=_['defaults'](config[_0xae2c('0x6')],{'host':_0xae2c('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xae2c('0x6')]));require(_0xae2c('0x8'))['register'](socket);function respondWithRpcPromise(_0x409810,_0xdbc82,_0x580954){return new BPromise(function(_0x2e8b0b,_0x530a2a){return client['request'](_0x409810,_0x580954)[_0xae2c('0x9')](function(_0x5dd0f8){logger[_0xae2c('0xa')](_0xae2c('0xb'),_0xdbc82,_0xae2c('0xc'));logger[_0xae2c('0xd')](_0xae2c('0xe'),_0xdbc82,'request\x20sent',JSON[_0xae2c('0xf')](_0x5dd0f8));if(_0x5dd0f8[_0xae2c('0x10')]){if(_0x5dd0f8[_0xae2c('0x10')][_0xae2c('0x11')]===0x1f4){logger[_0xae2c('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0xdbc82,_0x5dd0f8['error'][_0xae2c('0x12')]);return _0x530a2a(_0x5dd0f8[_0xae2c('0x10')][_0xae2c('0x12')]);}logger[_0xae2c('0x10')](_0xae2c('0xb'),_0xdbc82,_0x5dd0f8[_0xae2c('0x10')][_0xae2c('0x12')]);return _0x2e8b0b(_0x5dd0f8[_0xae2c('0x10')][_0xae2c('0x12')]);}else{logger[_0xae2c('0xa')](_0xae2c('0xb'),_0xdbc82,'request\x20sent');_0x2e8b0b(_0x5dd0f8[_0xae2c('0x13')]['message']);}})[_0xae2c('0x14')](function(_0x4fcf7a){logger[_0xae2c('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0xdbc82,_0x4fcf7a);_0x530a2a(_0x4fcf7a);});});}exports['GetOpenchannelQueue']=function(_0x568441){var _0x2e797a=this;return new Promise(function(_0xc46925,_0x5869c8){return db[_0xae2c('0x15')][_0xae2c('0x16')]({'raw':_0x568441[_0xae2c('0x17')]?_0x568441[_0xae2c('0x17')][_0xae2c('0x18')]===undefined?!![]:![]:!![],'where':_0x568441['options']?_0x568441[_0xae2c('0x17')][_0xae2c('0x19')]||null:null,'attributes':_0x568441[_0xae2c('0x17')]?_0x568441['options'][_0xae2c('0x1a')]||null:null,'limit':_0x568441[_0xae2c('0x17')]?_0x568441['options'][_0xae2c('0x1b')]||null:null,'include':_0x568441[_0xae2c('0x17')]?_0x568441[_0xae2c('0x17')]['include']?_['map'](_0x568441[_0xae2c('0x17')][_0xae2c('0x1c')],function(_0x1612d4){return{'model':db[_0x1612d4['model']],'as':_0x1612d4['as'],'attributes':_0x1612d4[_0xae2c('0x1a')],'include':_0x1612d4[_0xae2c('0x1c')]?_[_0xae2c('0x1d')](_0x1612d4[_0xae2c('0x1c')],function(_0x4ed5fb){return{'model':db[_0x4ed5fb[_0xae2c('0x1e')]],'as':_0x4ed5fb['as'],'attributes':_0x4ed5fb[_0xae2c('0x1a')],'include':_0x4ed5fb[_0xae2c('0x1c')]?_[_0xae2c('0x1d')](_0x4ed5fb[_0xae2c('0x1c')],function(_0x3fa0bf){return{'model':db[_0x3fa0bf[_0xae2c('0x1e')]],'as':_0x3fa0bf['as'],'attributes':_0x3fa0bf['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x275d72){logger[_0xae2c('0xa')]('GetOpenchannelQueue',_0x568441);logger['debug']('GetOpenchannelQueue',_0x568441,JSON[_0xae2c('0xf')](_0x275d72));_0xc46925(_0x275d72);})[_0xae2c('0x14')](function(_0x2f1f72){logger[_0xae2c('0x10')](_0xae2c('0x1f'),_0x2f1f72[_0xae2c('0x12')],_0x568441);_0x5869c8(_0x2e797a[_0xae2c('0x10')](0x1f4,_0x2f1f72[_0xae2c('0x12')]));});});};exports[_0xae2c('0x20')]=function(_0x4e0475){var _0x57d752=this;return new Promise(function(_0x52de61,_0x25246b){return db[_0xae2c('0x15')][_0xae2c('0x21')]({'raw':_0x4e0475[_0xae2c('0x17')]?_0x4e0475[_0xae2c('0x17')][_0xae2c('0x18')]===undefined?!![]:![]:!![],'where':_0x4e0475['options']?_0x4e0475['options'][_0xae2c('0x19')]||null:null,'attributes':_0x4e0475[_0xae2c('0x17')]?_0x4e0475['options'][_0xae2c('0x1a')]||null:null,'include':_0x4e0475[_0xae2c('0x17')]?_0x4e0475['options'][_0xae2c('0x1c')]?_[_0xae2c('0x1d')](_0x4e0475[_0xae2c('0x17')][_0xae2c('0x1c')],function(_0x13219a){return{'model':db[_0x13219a[_0xae2c('0x1e')]],'as':_0x13219a['as'],'attributes':_0x13219a[_0xae2c('0x1a')],'include':_0x13219a[_0xae2c('0x1c')]?_['map'](_0x13219a['include'],function(_0x35de11){return{'model':db[_0x35de11['model']],'as':_0x35de11['as'],'attributes':_0x35de11[_0xae2c('0x1a')],'include':_0x35de11['include']?_['map'](_0x35de11[_0xae2c('0x1c')],function(_0x474e31){return{'model':db[_0x474e31[_0xae2c('0x1e')]],'as':_0x474e31['as'],'attributes':_0x474e31['attributes']};}):[]};}):[]};}):[]:[]})[_0xae2c('0x9')](function(_0x2e38f3){logger[_0xae2c('0xa')]('ShowOpenchannelQueue',_0x4e0475);logger[_0xae2c('0xd')](_0xae2c('0x20'),_0x4e0475,JSON[_0xae2c('0xf')](_0x2e38f3));_0x52de61(_0x2e38f3);})[_0xae2c('0x14')](function(_0x2f82c2){logger[_0xae2c('0x10')]('ShowOpenchannelQueue',_0x2f82c2[_0xae2c('0x12')],_0x4e0475);_0x25246b(_0x57d752[_0xae2c('0x10')](0x1f4,_0x2f82c2[_0xae2c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index a135d4c..d3fa08a 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 _0xb1a4=['remove','emit','register','length','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x2ba2d8,_0x317124){var _0x4f10c7=function(_0x3c423b){while(--_0x3c423b){_0x2ba2d8['push'](_0x2ba2d8['shift']());}};_0x4f10c7(++_0x317124);}(_0xb1a4,0x16a));var _0x4b1a=function(_0x58510f,_0x2dde59){_0x58510f=_0x58510f-0x0;var _0xbe3788=_0xb1a4[_0x58510f];return _0xbe3788;};'use strict';var OpenchannelQueueEvents=require(_0x4b1a('0x0'));var events=[_0x4b1a('0x1'),_0x4b1a('0x2'),'update'];function createListener(_0x5141eb,_0x54a109){return function(_0x1ee07c){_0x54a109[_0x4b1a('0x3')](_0x5141eb,_0x1ee07c);};}function removeListener(_0x56135a,_0x1f2ed8){return function(){OpenchannelQueueEvents['removeListener'](_0x56135a,_0x1f2ed8);};}exports[_0x4b1a('0x4')]=function(_0x349b65){for(var _0x5e1826=0x0,_0x14411d=events[_0x4b1a('0x5')];_0x5e1826<_0x14411d;_0x5e1826++){var _0x312e2f=events[_0x5e1826];var _0x371066=createListener(_0x4b1a('0x6')+_0x312e2f,_0x349b65);OpenchannelQueueEvents['on'](_0x312e2f,_0x371066);}}; \ No newline at end of file +var _0x2101=['./openchannelQueue.events','remove','length','openchannelQueue:'];(function(_0x23e126,_0x2b3e0a){var _0x448983=function(_0x45765b){while(--_0x45765b){_0x23e126['push'](_0x23e126['shift']());}};_0x448983(++_0x2b3e0a);}(_0x2101,0xec));var _0x1210=function(_0x228bce,_0x4b71ad){_0x228bce=_0x228bce-0x0;var _0x3cc7c5=_0x2101[_0x228bce];return _0x3cc7c5;};'use strict';var OpenchannelQueueEvents=require(_0x1210('0x0'));var events=['save',_0x1210('0x1'),'update'];function createListener(_0x182ace,_0x544a89){return function(_0x1d30f4){_0x544a89['emit'](_0x182ace,_0x1d30f4);};}function removeListener(_0x1f8bd7,_0x365099){return function(){OpenchannelQueueEvents['removeListener'](_0x1f8bd7,_0x365099);};}exports['register']=function(_0x19c5ae){for(var _0x4a5981=0x0,_0x39b8e5=events[_0x1210('0x2')];_0x4a5981<_0x39b8e5;_0x4a5981++){var _0x271fe4=events[_0x4a5981];var _0x354a07=createListener(_0x1210('0x3')+_0x271fe4,_0x19c5ae);OpenchannelQueueEvents['on'](_0x271fe4,_0x354a07);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 8ad2ce0..b793c18 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 _0xbb36=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbb36,0x181));var _0x6bb3=function(_0x47050f,_0x3b22b6){_0x47050f=_0x47050f-0x0;var _0x3cdd21=_0xbb36[_0x47050f];return _0x3cdd21;};'use strict';var multer=require(_0x6bb3('0x0'));var util=require(_0x6bb3('0x1'));var path=require(_0x6bb3('0x2'));var timeout=require(_0x6bb3('0x3'));var express=require('express');var router=express[_0x6bb3('0x4')]();var fs_extra=require(_0x6bb3('0x5'));var auth=require(_0x6bb3('0x6'));var interaction=require(_0x6bb3('0x7'));var config=require(_0x6bb3('0x8'));var controller=require(_0x6bb3('0x9'));router[_0x6bb3('0xa')]('/',auth[_0x6bb3('0xb')](),controller[_0x6bb3('0xc')]);router[_0x6bb3('0xa')](_0x6bb3('0xd'),auth['isAuthenticated'](),controller[_0x6bb3('0xe')]);router[_0x6bb3('0xa')](_0x6bb3('0xf'),auth[_0x6bb3('0xb')](),controller[_0x6bb3('0x10')]);router[_0x6bb3('0x11')]('/',auth['isAuthenticated'](),controller[_0x6bb3('0x12')]);router[_0x6bb3('0x13')](_0x6bb3('0xf'),auth[_0x6bb3('0xb')](),controller[_0x6bb3('0x14')]);router[_0x6bb3('0x15')](_0x6bb3('0xf'),auth[_0x6bb3('0xb')](),controller['destroy']);module[_0x6bb3('0x16')]=router; \ No newline at end of file +var _0xfdc2=['isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get'];(function(_0x19f0ec,_0x364bc8){var _0x28f328=function(_0x573508){while(--_0x573508){_0x19f0ec['push'](_0x19f0ec['shift']());}};_0x28f328(++_0x364bc8);}(_0xfdc2,0x64));var _0x2fdc=function(_0x313bc3,_0x35a7e6){_0x313bc3=_0x313bc3-0x0;var _0x5b3795=_0xfdc2[_0x313bc3];return _0x5b3795;};'use strict';var multer=require(_0x2fdc('0x0'));var util=require(_0x2fdc('0x1'));var path=require(_0x2fdc('0x2'));var timeout=require('connect-timeout');var express=require(_0x2fdc('0x3'));var router=express[_0x2fdc('0x4')]();var fs_extra=require(_0x2fdc('0x5'));var auth=require(_0x2fdc('0x6'));var interaction=require(_0x2fdc('0x7'));var config=require('../../config/environment');var controller=require(_0x2fdc('0x8'));router[_0x2fdc('0x9')]('/',auth[_0x2fdc('0xa')](),controller['index']);router['get'](_0x2fdc('0xb'),auth[_0x2fdc('0xa')](),controller[_0x2fdc('0xc')]);router['get'](_0x2fdc('0xd'),auth[_0x2fdc('0xa')](),controller[_0x2fdc('0xe')]);router[_0x2fdc('0xf')]('/',auth[_0x2fdc('0xa')](),controller[_0x2fdc('0x10')]);router[_0x2fdc('0x11')]('/:id',auth[_0x2fdc('0xa')](),controller[_0x2fdc('0x12')]);router[_0x2fdc('0x13')](_0x2fdc('0xd'),auth[_0x2fdc('0xa')](),controller[_0x2fdc('0x14')]);module[_0x2fdc('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 7f7640e..198e094 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 _0x072d=['moment','exports','STRING','DATE'];(function(_0x7682dd,_0x2a4ceb){var _0xf1002f=function(_0x3a841b){while(--_0x3a841b){_0x7682dd['push'](_0x7682dd['shift']());}};_0xf1002f(++_0x2a4ceb);}(_0x072d,0x1d0));var _0xd072=function(_0x2adb42,_0xed8b12){_0x2adb42=_0x2adb42-0x0;var _0x101363=_0x072d[_0x2adb42];return _0x101363;};'use strict';var moment=require(_0xd072('0x0'));var Sequelize=require('sequelize');module[_0xd072('0x1')]={'uniqueid':{'type':Sequelize[_0xd072('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd072('0x2')]},'joinAt':{'type':Sequelize[_0xd072('0x3')]},'leaveAt':{'type':Sequelize[_0xd072('0x3')]},'acceptAt':{'type':Sequelize[_0xd072('0x3')]},'exitAt':{'type':Sequelize[_0xd072('0x3')]},'reason':{'type':Sequelize[_0xd072('0x2')]}}; \ No newline at end of file +var _0x352d=['moment','sequelize','exports','STRING','DATE'];(function(_0x2370db,_0x592999){var _0x47585c=function(_0xb6899e){while(--_0xb6899e){_0x2370db['push'](_0x2370db['shift']());}};_0x47585c(++_0x592999);}(_0x352d,0xe1));var _0xd352=function(_0x554431,_0x4d4b0a){_0x554431=_0x554431-0x0;var _0x4d421a=_0x352d[_0x554431];return _0x4d421a;};'use strict';var moment=require(_0xd352('0x0'));var Sequelize=require(_0xd352('0x1'));module[_0xd352('0x2')]={'uniqueid':{'type':Sequelize[_0xd352('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd352('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd352('0x4')]},'reason':{'type':Sequelize[_0xd352('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 9c70ada..2ee6ff5 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 _0x2057=['squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x4f32de,_0x5bd4a){var _0x149821=function(_0x205885){while(--_0x205885){_0x4f32de['push'](_0x4f32de['shift']());}};_0x149821(++_0x5bd4a);}(_0x2057,0x1c7));var _0x7205=function(_0x57d986,_0x588068){_0x57d986=_0x57d986-0x0;var _0x4e110f=_0x2057[_0x57d986];return _0x4e110f;};'use strict';var emlformat=require(_0x7205('0x0'));var rimraf=require(_0x7205('0x1'));var zipdir=require(_0x7205('0x2'));var jsonpatch=require(_0x7205('0x3'));var rp=require(_0x7205('0x4'));var moment=require('moment');var BPromise=require(_0x7205('0x5'));var Mustache=require(_0x7205('0x6'));var util=require(_0x7205('0x7'));var path=require(_0x7205('0x8'));var sox=require(_0x7205('0x9'));var csv=require(_0x7205('0xa'));var ejs=require(_0x7205('0xb'));var fs=require('fs');var fs_extra=require(_0x7205('0xc'));var _=require('lodash');var squel=require(_0x7205('0xd'));var crypto=require(_0x7205('0xe'));var jsforce=require(_0x7205('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7205('0xa'));var querystring=require('querystring');var Papa=require(_0x7205('0x10'));var Redis=require(_0x7205('0x11'));var authService=require(_0x7205('0x12'));var qs=require(_0x7205('0x13'));var as=require(_0x7205('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7205('0x15'))(_0x7205('0x16'));var utils=require(_0x7205('0x17'));var config=require(_0x7205('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7205('0x19'))['db'];function respondWithStatusCode(_0x4841fe,_0x2f76c7){_0x2f76c7=_0x2f76c7||0xcc;return function(_0x572efc){if(_0x572efc){return _0x4841fe[_0x7205('0x1a')](_0x2f76c7);}return _0x4841fe[_0x7205('0x1b')](_0x2f76c7)[_0x7205('0x1c')]();};}function respondWithResult(_0x14e1a1,_0x5db8a8){_0x5db8a8=_0x5db8a8||0xc8;return function(_0x3f8f16){if(_0x3f8f16){return _0x14e1a1['status'](_0x5db8a8)[_0x7205('0x1d')](_0x3f8f16);}};}function respondWithFilteredResult(_0x1ed222,_0x52cc68){return function(_0x3d332b){if(_0x3d332b){var _0xab0072=typeof _0x52cc68[_0x7205('0x1e')]===_0x7205('0x1f')&&typeof _0x52cc68[_0x7205('0x20')]===_0x7205('0x1f');var _0x2eef6d=_0x3d332b[_0x7205('0x21')];var _0x4af208=_0xab0072?0x0:_0x52cc68[_0x7205('0x1e')];var _0x55f319=_0xab0072?_0x3d332b[_0x7205('0x21')]:_0x52cc68['offset']+_0x52cc68['limit'];var _0x553007;if(_0x55f319>=_0x2eef6d){_0x55f319=_0x2eef6d;_0x553007=0xc8;}else{_0x553007=0xce;}_0x1ed222['status'](_0x553007);return _0x1ed222[_0x7205('0x22')](_0x7205('0x23'),_0x4af208+'-'+_0x55f319+'/'+_0x2eef6d)[_0x7205('0x1d')](_0x3d332b);}return null;};}function patchUpdates(_0x4300f8){return function(_0x5e6933){try{jsonpatch[_0x7205('0x24')](_0x5e6933,_0x4300f8,!![]);}catch(_0x4e594c){return BPromise['reject'](_0x4e594c);}return _0x5e6933[_0x7205('0x25')]();};}function saveUpdates(_0x1168ec,_0x3cccf1){return function(_0xbd3cad){if(_0xbd3cad){return _0xbd3cad['update'](_0x1168ec)[_0x7205('0x26')](function(_0x49c724){return _0x49c724;});}return null;};}function removeEntity(_0x2787b1,_0x3f531c){return function(_0x419ec9){if(_0x419ec9){return _0x419ec9[_0x7205('0x27')]()[_0x7205('0x26')](function(){_0x2787b1[_0x7205('0x1b')](0xcc)[_0x7205('0x1c')]();});}};}function handleEntityNotFound(_0x33c705,_0x3a53aa){return function(_0x1d3ea4){if(!_0x1d3ea4){_0x33c705[_0x7205('0x1a')](0x194);}return _0x1d3ea4;};}function handleError(_0x51a25b,_0x1204de){_0x1204de=_0x1204de||0x1f4;return function(_0x45c7d5){logger[_0x7205('0x28')](_0x45c7d5[_0x7205('0x29')]);if(_0x45c7d5[_0x7205('0x2a')]){delete _0x45c7d5[_0x7205('0x2a')];}_0x51a25b[_0x7205('0x1b')](_0x1204de)[_0x7205('0x2b')](_0x45c7d5);};}exports[_0x7205('0x2c')]=function(_0x197d4b,_0x3f967e){var _0x37bf85={},_0x4b2c47={},_0x51a784={'count':0x0,'rows':[]};var _0x1f9fff=_[_0x7205('0x2d')](db[_0x7205('0x2e')][_0x7205('0x2f')],function(_0x14420c){return{'name':_0x14420c[_0x7205('0x30')],'type':_0x14420c['type'][_0x7205('0x31')]};});_0x4b2c47[_0x7205('0x32')]=_[_0x7205('0x2d')](_0x1f9fff,_0x7205('0x2a'));_0x4b2c47[_0x7205('0x33')]=_['keys'](_0x197d4b['query']);_0x4b2c47[_0x7205('0x34')]=_[_0x7205('0x35')](_0x4b2c47[_0x7205('0x32')],_0x4b2c47[_0x7205('0x33')]);_0x37bf85['attributes']=_[_0x7205('0x35')](_0x4b2c47[_0x7205('0x32')],qs[_0x7205('0x36')](_0x197d4b[_0x7205('0x33')][_0x7205('0x36')]));_0x37bf85['attributes']=_0x37bf85[_0x7205('0x37')][_0x7205('0x38')]?_0x37bf85[_0x7205('0x37')]:_0x4b2c47[_0x7205('0x32')];if(!_0x197d4b['query']['hasOwnProperty'](_0x7205('0x39'))){_0x37bf85[_0x7205('0x20')]=qs[_0x7205('0x20')](_0x197d4b[_0x7205('0x33')]['limit']);_0x37bf85[_0x7205('0x1e')]=qs[_0x7205('0x1e')](_0x197d4b['query'][_0x7205('0x1e')]);}_0x37bf85[_0x7205('0x3a')]=qs[_0x7205('0x3b')](_0x197d4b[_0x7205('0x33')][_0x7205('0x3b')]);_0x37bf85[_0x7205('0x3c')]=qs['filters'](_[_0x7205('0x3d')](_0x197d4b[_0x7205('0x33')],_0x4b2c47[_0x7205('0x34')]),_0x1f9fff);if(_0x197d4b[_0x7205('0x33')][_0x7205('0x3e')]){_0x37bf85[_0x7205('0x3c')]=_[_0x7205('0x3f')](_0x37bf85[_0x7205('0x3c')],{'$or':_['map'](_0x1f9fff,function(_0x3521e7){if(_0x3521e7[_0x7205('0x40')]!==_0x7205('0x41')){var _0x3bae15={};_0x3bae15[_0x3521e7[_0x7205('0x2a')]]={'$like':'%'+_0x197d4b[_0x7205('0x33')]['filter']+'%'};return _0x3bae15;}})});}_0x37bf85=_['merge']({},_0x37bf85,_0x197d4b[_0x7205('0x42')]);var _0x35d0f0={'where':_0x37bf85[_0x7205('0x3c')]};return db[_0x7205('0x2e')][_0x7205('0x21')](_0x35d0f0)[_0x7205('0x26')](function(_0x1dc5ed){_0x51a784[_0x7205('0x21')]=_0x1dc5ed;if(_0x197d4b[_0x7205('0x33')][_0x7205('0x43')]){_0x37bf85[_0x7205('0x44')]=[{'all':!![]}];}return db[_0x7205('0x2e')][_0x7205('0x45')](_0x37bf85);})['then'](function(_0x42f7bb){_0x51a784['rows']=_0x42f7bb;return _0x51a784;})[_0x7205('0x26')](respondWithFilteredResult(_0x3f967e,_0x37bf85))[_0x7205('0x46')](handleError(_0x3f967e,null));};exports[_0x7205('0x47')]=function(_0x1ce773,_0x93d526){var _0xef78c4={'raw':!![],'where':{'id':_0x1ce773[_0x7205('0x48')]['id']}},_0x307f0d={};_0x307f0d[_0x7205('0x32')]=_[_0x7205('0x49')](db[_0x7205('0x2e')][_0x7205('0x2f')]);_0x307f0d[_0x7205('0x33')]=_[_0x7205('0x49')](_0x1ce773[_0x7205('0x33')]);_0x307f0d[_0x7205('0x34')]=_[_0x7205('0x35')](_0x307f0d[_0x7205('0x32')],_0x307f0d[_0x7205('0x33')]);_0xef78c4[_0x7205('0x37')]=_[_0x7205('0x35')](_0x307f0d['model'],qs[_0x7205('0x36')](_0x1ce773[_0x7205('0x33')][_0x7205('0x36')]));_0xef78c4['attributes']=_0xef78c4[_0x7205('0x37')]['length']?_0xef78c4[_0x7205('0x37')]:_0x307f0d['model'];if(_0x1ce773[_0x7205('0x33')][_0x7205('0x43')]){_0xef78c4[_0x7205('0x44')]=[{'all':!![]}];}_0xef78c4=_[_0x7205('0x3f')]({},_0xef78c4,_0x1ce773['options']);return db[_0x7205('0x2e')][_0x7205('0x4a')](_0xef78c4)[_0x7205('0x26')](handleEntityNotFound(_0x93d526,null))[_0x7205('0x26')](respondWithResult(_0x93d526,null))[_0x7205('0x46')](handleError(_0x93d526,null));};exports['create']=function(_0x2aa4f9,_0x3fbcad){return db[_0x7205('0x2e')][_0x7205('0x4b')](_0x2aa4f9[_0x7205('0x4c')],{})[_0x7205('0x26')](respondWithResult(_0x3fbcad,0xc9))[_0x7205('0x46')](handleError(_0x3fbcad,null));};exports['update']=function(_0x2cd6de,_0x539ccd){if(_0x2cd6de[_0x7205('0x4c')]['id']){delete _0x2cd6de[_0x7205('0x4c')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x2cd6de[_0x7205('0x48')]['id']}})[_0x7205('0x26')](handleEntityNotFound(_0x539ccd,null))['then'](saveUpdates(_0x2cd6de[_0x7205('0x4c')],null))[_0x7205('0x26')](respondWithResult(_0x539ccd,null))[_0x7205('0x46')](handleError(_0x539ccd,null));};exports['destroy']=function(_0x356185,_0x1d17a5){return db['OpenchannelQueueReport'][_0x7205('0x4a')]({'where':{'id':_0x356185['params']['id']}})[_0x7205('0x26')](handleEntityNotFound(_0x1d17a5,null))['then'](removeEntity(_0x1d17a5,null))[_0x7205('0x46')](handleError(_0x1d17a5,null));};exports[_0x7205('0x4d')]=function(_0x11f6b8,_0x35129a){return db[_0x7205('0x2e')][_0x7205('0x4d')]()['then'](respondWithResult(_0x35129a,null))['catch'](handleError(_0x35129a,null));}; \ No newline at end of file +var _0x11b7=['count','set','Content-Range','json','apply','reject','then','destroy','sendStatus','error','stack','name','index','map','OpenchannelQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','update','describe','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit'];(function(_0x1ee6fd,_0x33f3ff){var _0x141b5d=function(_0x33566c){while(--_0x33566c){_0x1ee6fd['push'](_0x1ee6fd['shift']());}};_0x141b5d(++_0x33f3ff);}(_0x11b7,0x196));var _0x711b=function(_0xad11b4,_0x1c6e20){_0xad11b4=_0xad11b4-0x0;var _0x3567f3=_0x11b7[_0xad11b4];return _0x3567f3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x711b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x711b('0x1'));var util=require(_0x711b('0x2'));var path=require('path');var sox=require(_0x711b('0x3'));var csv=require(_0x711b('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x711b('0x5'));var _=require(_0x711b('0x6'));var squel=require('squel');var crypto=require(_0x711b('0x7'));var jsforce=require(_0x711b('0x8'));var deskjs=require(_0x711b('0x9'));var toCsv=require(_0x711b('0x4'));var querystring=require(_0x711b('0xa'));var Papa=require(_0x711b('0xb'));var Redis=require(_0x711b('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x711b('0xd'));var as=require(_0x711b('0xe'));var hardwareService=require(_0x711b('0xf'));var logger=require(_0x711b('0x10'))(_0x711b('0x11'));var utils=require(_0x711b('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x711b('0x13'));var db=require(_0x711b('0x14'))['db'];function respondWithStatusCode(_0x55cfa1,_0x3c554e){_0x3c554e=_0x3c554e||0xcc;return function(_0x28eb1b){if(_0x28eb1b){return _0x55cfa1['sendStatus'](_0x3c554e);}return _0x55cfa1[_0x711b('0x15')](_0x3c554e)[_0x711b('0x16')]();};}function respondWithResult(_0x8cb06d,_0x222d61){_0x222d61=_0x222d61||0xc8;return function(_0x272a7f){if(_0x272a7f){return _0x8cb06d['status'](_0x222d61)['json'](_0x272a7f);}};}function respondWithFilteredResult(_0x5cecec,_0x5827aa){return function(_0x211864){if(_0x211864){var _0x58dba4=typeof _0x5827aa[_0x711b('0x17')]===_0x711b('0x18')&&typeof _0x5827aa[_0x711b('0x19')]===_0x711b('0x18');var _0x3e4181=_0x211864[_0x711b('0x1a')];var _0x30004e=_0x58dba4?0x0:_0x5827aa[_0x711b('0x17')];var _0x4d93a5=_0x58dba4?_0x211864[_0x711b('0x1a')]:_0x5827aa[_0x711b('0x17')]+_0x5827aa['limit'];var _0x588112;if(_0x4d93a5>=_0x3e4181){_0x4d93a5=_0x3e4181;_0x588112=0xc8;}else{_0x588112=0xce;}_0x5cecec[_0x711b('0x15')](_0x588112);return _0x5cecec[_0x711b('0x1b')](_0x711b('0x1c'),_0x30004e+'-'+_0x4d93a5+'/'+_0x3e4181)[_0x711b('0x1d')](_0x211864);}return null;};}function patchUpdates(_0x55fe0d){return function(_0x5bdd90){try{jsonpatch[_0x711b('0x1e')](_0x5bdd90,_0x55fe0d,!![]);}catch(_0x375d15){return BPromise[_0x711b('0x1f')](_0x375d15);}return _0x5bdd90['save']();};}function saveUpdates(_0x33a5f9,_0x255653){return function(_0x5375c6){if(_0x5375c6){return _0x5375c6['update'](_0x33a5f9)[_0x711b('0x20')](function(_0x26701c){return _0x26701c;});}return null;};}function removeEntity(_0x3e2777,_0x672b29){return function(_0x2b15ef){if(_0x2b15ef){return _0x2b15ef[_0x711b('0x21')]()[_0x711b('0x20')](function(){_0x3e2777['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b66c5,_0x1f4474){return function(_0x5aa41d){if(!_0x5aa41d){_0x1b66c5[_0x711b('0x22')](0x194);}return _0x5aa41d;};}function handleError(_0x4d9fe0,_0x37e16e){_0x37e16e=_0x37e16e||0x1f4;return function(_0x593483){logger[_0x711b('0x23')](_0x593483[_0x711b('0x24')]);if(_0x593483[_0x711b('0x25')]){delete _0x593483['name'];}_0x4d9fe0[_0x711b('0x15')](_0x37e16e)['send'](_0x593483);};}exports[_0x711b('0x26')]=function(_0x3f0e58,_0x2c256d){var _0x18ad76={},_0x1de08e={},_0x30e758={'count':0x0,'rows':[]};var _0x5dab84=_[_0x711b('0x27')](db[_0x711b('0x28')]['rawAttributes'],function(_0x16653f){return{'name':_0x16653f[_0x711b('0x29')],'type':_0x16653f[_0x711b('0x2a')][_0x711b('0x2b')]};});_0x1de08e[_0x711b('0x2c')]=_[_0x711b('0x27')](_0x5dab84,_0x711b('0x25'));_0x1de08e[_0x711b('0x2d')]=_[_0x711b('0x2e')](_0x3f0e58['query']);_0x1de08e[_0x711b('0x2f')]=_[_0x711b('0x30')](_0x1de08e[_0x711b('0x2c')],_0x1de08e[_0x711b('0x2d')]);_0x18ad76['attributes']=_[_0x711b('0x30')](_0x1de08e[_0x711b('0x2c')],qs['fields'](_0x3f0e58[_0x711b('0x2d')][_0x711b('0x31')]));_0x18ad76[_0x711b('0x32')]=_0x18ad76[_0x711b('0x32')][_0x711b('0x33')]?_0x18ad76[_0x711b('0x32')]:_0x1de08e[_0x711b('0x2c')];if(!_0x3f0e58[_0x711b('0x2d')][_0x711b('0x34')]('nolimit')){_0x18ad76[_0x711b('0x19')]=qs[_0x711b('0x19')](_0x3f0e58[_0x711b('0x2d')]['limit']);_0x18ad76['offset']=qs[_0x711b('0x17')](_0x3f0e58[_0x711b('0x2d')]['offset']);}_0x18ad76['order']=qs[_0x711b('0x35')](_0x3f0e58[_0x711b('0x2d')][_0x711b('0x35')]);_0x18ad76[_0x711b('0x36')]=qs['filters'](_['pick'](_0x3f0e58[_0x711b('0x2d')],_0x1de08e[_0x711b('0x2f')]),_0x5dab84);if(_0x3f0e58[_0x711b('0x2d')]['filter']){_0x18ad76[_0x711b('0x36')]=_[_0x711b('0x37')](_0x18ad76['where'],{'$or':_[_0x711b('0x27')](_0x5dab84,function(_0x2dbda3){if(_0x2dbda3[_0x711b('0x2a')]!==_0x711b('0x38')){var _0x4c1d6e={};_0x4c1d6e[_0x2dbda3[_0x711b('0x25')]]={'$like':'%'+_0x3f0e58[_0x711b('0x2d')][_0x711b('0x39')]+'%'};return _0x4c1d6e;}})});}_0x18ad76=_['merge']({},_0x18ad76,_0x3f0e58['options']);var _0x551f1f={'where':_0x18ad76[_0x711b('0x36')]};return db[_0x711b('0x28')][_0x711b('0x1a')](_0x551f1f)[_0x711b('0x20')](function(_0x52eb3a){_0x30e758[_0x711b('0x1a')]=_0x52eb3a;if(_0x3f0e58[_0x711b('0x2d')][_0x711b('0x3a')]){_0x18ad76[_0x711b('0x3b')]=[{'all':!![]}];}return db[_0x711b('0x28')][_0x711b('0x3c')](_0x18ad76);})['then'](function(_0xc26f12){_0x30e758[_0x711b('0x3d')]=_0xc26f12;return _0x30e758;})[_0x711b('0x20')](respondWithFilteredResult(_0x2c256d,_0x18ad76))[_0x711b('0x3e')](handleError(_0x2c256d,null));};exports[_0x711b('0x3f')]=function(_0x5403d4,_0x52420a){var _0x1e7b0c={'raw':!![],'where':{'id':_0x5403d4[_0x711b('0x40')]['id']}},_0x3cf2e7={};_0x3cf2e7['model']=_[_0x711b('0x2e')](db[_0x711b('0x28')][_0x711b('0x41')]);_0x3cf2e7[_0x711b('0x2d')]=_[_0x711b('0x2e')](_0x5403d4[_0x711b('0x2d')]);_0x3cf2e7[_0x711b('0x2f')]=_[_0x711b('0x30')](_0x3cf2e7[_0x711b('0x2c')],_0x3cf2e7[_0x711b('0x2d')]);_0x1e7b0c[_0x711b('0x32')]=_[_0x711b('0x30')](_0x3cf2e7[_0x711b('0x2c')],qs[_0x711b('0x31')](_0x5403d4['query']['fields']));_0x1e7b0c[_0x711b('0x32')]=_0x1e7b0c[_0x711b('0x32')][_0x711b('0x33')]?_0x1e7b0c['attributes']:_0x3cf2e7[_0x711b('0x2c')];if(_0x5403d4[_0x711b('0x2d')][_0x711b('0x3a')]){_0x1e7b0c[_0x711b('0x3b')]=[{'all':!![]}];}_0x1e7b0c=_[_0x711b('0x37')]({},_0x1e7b0c,_0x5403d4[_0x711b('0x42')]);return db[_0x711b('0x28')][_0x711b('0x43')](_0x1e7b0c)[_0x711b('0x20')](handleEntityNotFound(_0x52420a,null))[_0x711b('0x20')](respondWithResult(_0x52420a,null))[_0x711b('0x3e')](handleError(_0x52420a,null));};exports[_0x711b('0x44')]=function(_0x3ee75c,_0x20ecd2){return db[_0x711b('0x28')][_0x711b('0x44')](_0x3ee75c[_0x711b('0x45')],{})[_0x711b('0x20')](respondWithResult(_0x20ecd2,0xc9))[_0x711b('0x3e')](handleError(_0x20ecd2,null));};exports[_0x711b('0x46')]=function(_0x5ed9a9,_0x41cad6){if(_0x5ed9a9[_0x711b('0x45')]['id']){delete _0x5ed9a9['body']['id'];}return db['OpenchannelQueueReport'][_0x711b('0x43')]({'where':{'id':_0x5ed9a9[_0x711b('0x40')]['id']}})[_0x711b('0x20')](handleEntityNotFound(_0x41cad6,null))[_0x711b('0x20')](saveUpdates(_0x5ed9a9['body'],null))[_0x711b('0x20')](respondWithResult(_0x41cad6,null))[_0x711b('0x3e')](handleError(_0x41cad6,null));};exports[_0x711b('0x21')]=function(_0x2c33f4,_0xf880b8){return db[_0x711b('0x28')]['find']({'where':{'id':_0x2c33f4['params']['id']}})[_0x711b('0x20')](handleEntityNotFound(_0xf880b8,null))[_0x711b('0x20')](removeEntity(_0xf880b8,null))[_0x711b('0x3e')](handleError(_0xf880b8,null));};exports['describe']=function(_0x419213,_0x505932){return db[_0x711b('0x28')][_0x711b('0x47')]()[_0x711b('0x20')](respondWithResult(_0x505932,null))[_0x711b('0x3e')](handleError(_0x505932,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index efccedd..3ba9a3b 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x814b,0x1a2));var _0xb814=function(_0x40a77f,_0x1d5f8d){_0x40a77f=_0x40a77f-0x0;var _0x415aa1=_0x814b[_0x40a77f];return _0x415aa1;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0x814b,0x1a2));var _0xb814=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x814b[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 1593af0..07d58d5 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 _0x49db=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','where','attributes','lodash'];(function(_0x309ee3,_0x26c85f){var _0x2268e0=function(_0x330f5c){while(--_0x330f5c){_0x309ee3['push'](_0x309ee3['shift']());}};_0x2268e0(++_0x26c85f);}(_0x49db,0xc5));var _0xb49d=function(_0x396e72,_0x789bc0){_0x396e72=_0x396e72-0x0;var _0x4eb2b4=_0x49db[_0x396e72];return _0x4eb2b4;};'use strict';var _=require(_0xb49d('0x0'));var util=require(_0xb49d('0x1'));var moment=require(_0xb49d('0x2'));var BPromise=require(_0xb49d('0x3'));var rs=require(_0xb49d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb49d('0x5'))['db'];var utils=require(_0xb49d('0x6'));var logger=require(_0xb49d('0x7'))('rpc');var config=require(_0xb49d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb49d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4180c8,_0x15f52f,_0x572ee4){return new BPromise(function(_0x12e114,_0x128caa){return client[_0xb49d('0xa')](_0x4180c8,_0x572ee4)[_0xb49d('0xb')](function(_0x3d4825){logger[_0xb49d('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x15f52f,'request\x20sent');logger[_0xb49d('0xd')](_0xb49d('0xe'),_0x15f52f,_0xb49d('0xf'),JSON[_0xb49d('0x10')](_0x3d4825));if(_0x3d4825[_0xb49d('0x11')]){if(_0x3d4825[_0xb49d('0x11')][_0xb49d('0x12')]===0x1f4){logger[_0xb49d('0x11')](_0xb49d('0x13'),_0x15f52f,_0x3d4825['error'][_0xb49d('0x14')]);return _0x128caa(_0x3d4825[_0xb49d('0x11')][_0xb49d('0x14')]);}logger[_0xb49d('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x15f52f,_0x3d4825[_0xb49d('0x11')][_0xb49d('0x14')]);return _0x12e114(_0x3d4825['error'][_0xb49d('0x14')]);}else{logger[_0xb49d('0xc')](_0xb49d('0x13'),_0x15f52f,_0xb49d('0xf'));_0x12e114(_0x3d4825[_0xb49d('0x15')][_0xb49d('0x14')]);}})[_0xb49d('0x16')](function(_0x584ade){logger[_0xb49d('0x11')](_0xb49d('0x13'),_0x15f52f,_0x584ade);_0x128caa(_0x584ade);});});}exports[_0xb49d('0x17')]=function(_0xf0bdff){var _0x4abce4=this;return new Promise(function(_0x4f3988,_0xfd7a95){return db[_0xb49d('0x18')][_0xb49d('0x19')](_0xf0bdff[_0xb49d('0x1a')],{'raw':_0xf0bdff[_0xb49d('0x1b')]?_0xf0bdff['options'][_0xb49d('0x1c')]===undefined?!![]:![]:!![]})[_0xb49d('0xb')](function(_0x3bf7a2){logger[_0xb49d('0xc')](_0xb49d('0x17'),_0xf0bdff);logger[_0xb49d('0xd')](_0xb49d('0x17'),_0xf0bdff,JSON[_0xb49d('0x10')](_0x3bf7a2));_0x4f3988(_0x3bf7a2);})[_0xb49d('0x16')](function(_0x38be04){logger[_0xb49d('0x11')](_0xb49d('0x17'),_0x38be04[_0xb49d('0x14')],_0xf0bdff);_0xfd7a95(_0x4abce4[_0xb49d('0x11')](0x1f4,_0x38be04[_0xb49d('0x14')]));});});};exports[_0xb49d('0x1d')]=function(_0x26db55){var _0x21c0e1=this;return new Promise(function(_0x165ec2,_0x1ae086){return db[_0xb49d('0x18')][_0xb49d('0x1e')](_0x26db55['body'],{'raw':_0x26db55[_0xb49d('0x1b')]?_0x26db55['options'][_0xb49d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26db55[_0xb49d('0x1b')]?_0x26db55['options'][_0xb49d('0x1f')]||null:null,'attributes':_0x26db55[_0xb49d('0x1b')]?_0x26db55[_0xb49d('0x1b')][_0xb49d('0x20')]||null:null,'limit':_0x26db55[_0xb49d('0x1b')]?_0x26db55[_0xb49d('0x1b')]['limit']||null:null})[_0xb49d('0xb')](function(_0xf734e1){logger[_0xb49d('0xc')](_0xb49d('0x1d'),_0x26db55);logger[_0xb49d('0xd')](_0xb49d('0x1d'),_0x26db55,JSON[_0xb49d('0x10')](_0xf734e1));_0x165ec2(_0xf734e1);})['catch'](function(_0x3f1796){logger['error'](_0xb49d('0x1d'),_0x3f1796[_0xb49d('0x14')],_0x26db55);_0x1ae086(_0x21c0e1[_0xb49d('0x11')](0x1f4,_0x3f1796[_0xb49d('0x14')]));});});}; \ No newline at end of file +var _0xfcbb=['body','raw','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','UpdateOpenchannelQueueReport','update'];(function(_0x218445,_0x1e241e){var _0x303561=function(_0xc7b9be){while(--_0xc7b9be){_0x218445['push'](_0x218445['shift']());}};_0x303561(++_0x1e241e);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x56e399,_0x592bc6){_0x56e399=_0x56e399-0x0;var _0x16f4c6=_0xfcbb[_0x56e399];return _0x16f4c6;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfcb('0x3'));var db=require(_0xbfcb('0x4'))['db'];var utils=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))(_0xbfcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfcb('0x8')][_0xbfcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d4e6a,_0x2df839,_0x288ee5){return new BPromise(function(_0x2f875c,_0x49717b){return client['request'](_0x8d4e6a,_0x288ee5)[_0xbfcb('0xa')](function(_0x331173){logger[_0xbfcb('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2df839,_0xbfcb('0xc'));logger[_0xbfcb('0xd')](_0xbfcb('0xe'),_0x2df839,_0xbfcb('0xc'),JSON[_0xbfcb('0xf')](_0x331173));if(_0x331173[_0xbfcb('0x10')]){if(_0x331173['error'][_0xbfcb('0x11')]===0x1f4){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')]['message']);return _0x49717b(_0x331173[_0xbfcb('0x10')]['message']);}logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);return _0x2f875c(_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);}else{logger[_0xbfcb('0xb')](_0xbfcb('0x12'),_0x2df839,_0xbfcb('0xc'));_0x2f875c(_0x331173[_0xbfcb('0x14')][_0xbfcb('0x13')]);}})[_0xbfcb('0x15')](function(_0x26f335){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x26f335);_0x49717b(_0x26f335);});});}exports[_0xbfcb('0x16')]=function(_0xba1d6){var _0x38689e=this;return new Promise(function(_0x3404aa,_0x46b8d2){return db[_0xbfcb('0x17')][_0xbfcb('0x18')](_0xba1d6['body'],{'raw':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xbfcb('0xa')](function(_0x1a7225){logger['info']('CreateOpenchannelQueueReport',_0xba1d6);logger[_0xbfcb('0xd')](_0xbfcb('0x16'),_0xba1d6,JSON[_0xbfcb('0xf')](_0x1a7225));_0x3404aa(_0x1a7225);})[_0xbfcb('0x15')](function(_0x1c5924){logger['error'](_0xbfcb('0x16'),_0x1c5924[_0xbfcb('0x13')],_0xba1d6);_0x46b8d2(_0x38689e[_0xbfcb('0x10')](0x1f4,_0x1c5924[_0xbfcb('0x13')]));});});};exports[_0xbfcb('0x1a')]=function(_0x19616c){var _0x69c8e9=this;return new Promise(function(_0x14e43c,_0x11f6f7){return db[_0xbfcb('0x17')][_0xbfcb('0x1b')](_0x19616c[_0xbfcb('0x1c')],{'raw':_0x19616c[_0xbfcb('0x19')]?_0x19616c[_0xbfcb('0x19')][_0xbfcb('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19616c[_0xbfcb('0x19')]?_0x19616c['options'][_0xbfcb('0x1e')]||null:null,'attributes':_0x19616c[_0xbfcb('0x19')]?_0x19616c['options'][_0xbfcb('0x1f')]||null:null,'limit':_0x19616c[_0xbfcb('0x19')]?_0x19616c[_0xbfcb('0x19')][_0xbfcb('0x20')]||null:null})[_0xbfcb('0xa')](function(_0x3542e9){logger[_0xbfcb('0xb')](_0xbfcb('0x1a'),_0x19616c);logger[_0xbfcb('0xd')](_0xbfcb('0x1a'),_0x19616c,JSON['stringify'](_0x3542e9));_0x14e43c(_0x3542e9);})[_0xbfcb('0x15')](function(_0x3aa3cd){logger[_0xbfcb('0x10')](_0xbfcb('0x1a'),_0x3aa3cd[_0xbfcb('0x13')],_0x19616c);_0x11f6f7(_0x69c8e9[_0xbfcb('0x10')](0x1f4,_0x3aa3cd[_0xbfcb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index dfa2366..a084d94 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 _0x2ec2=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2ec2,0x133));var _0x22ec=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0x2ec2[_0x23c6f2];return _0x4c270b;};'use strict';var multer=require(_0x22ec('0x0'));var util=require(_0x22ec('0x1'));var path=require(_0x22ec('0x2'));var timeout=require(_0x22ec('0x3'));var express=require(_0x22ec('0x4'));var router=express[_0x22ec('0x5')]();var fs_extra=require(_0x22ec('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x22ec('0x7'));var controller=require(_0x22ec('0x8'));router['get']('/',auth[_0x22ec('0x9')](),controller[_0x22ec('0xa')]);router[_0x22ec('0xb')](_0x22ec('0xc'),auth['isAuthenticated'](),controller[_0x22ec('0xd')]);router[_0x22ec('0xb')](_0x22ec('0xe'),auth['isAuthenticated'](),controller[_0x22ec('0xf')]);router[_0x22ec('0x10')]('/',auth[_0x22ec('0x9')](),controller[_0x22ec('0x11')]);router[_0x22ec('0x12')](_0x22ec('0xe'),auth['isAuthenticated'](),controller[_0x22ec('0x13')]);router[_0x22ec('0x14')]('/:id',auth[_0x22ec('0x9')](),controller[_0x22ec('0x15')]);module[_0x22ec('0x16')]=router; \ No newline at end of file +var _0x0fa4=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x43330e,_0x3ddaae){var _0x9fedf4=function(_0x3b0708){while(--_0x3b0708){_0x43330e['push'](_0x43330e['shift']());}};_0x9fedf4(++_0x3ddaae);}(_0x0fa4,0x17b));var _0x40fa=function(_0x5326dc,_0x526083){_0x5326dc=_0x5326dc-0x0;var _0x27da77=_0x0fa4[_0x5326dc];return _0x27da77;};'use strict';var multer=require(_0x40fa('0x0'));var util=require(_0x40fa('0x1'));var path=require(_0x40fa('0x2'));var timeout=require(_0x40fa('0x3'));var express=require(_0x40fa('0x4'));var router=express[_0x40fa('0x5')]();var fs_extra=require(_0x40fa('0x6'));var auth=require(_0x40fa('0x7'));var interaction=require(_0x40fa('0x8'));var config=require(_0x40fa('0x9'));var controller=require(_0x40fa('0xa'));router[_0x40fa('0xb')]('/',auth[_0x40fa('0xc')](),controller[_0x40fa('0xd')]);router['get'](_0x40fa('0xe'),auth[_0x40fa('0xc')](),controller[_0x40fa('0xf')]);router[_0x40fa('0xb')](_0x40fa('0x10'),auth[_0x40fa('0xc')](),controller[_0x40fa('0x11')]);router[_0x40fa('0x12')]('/',auth[_0x40fa('0xc')](),controller[_0x40fa('0x13')]);router[_0x40fa('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x40fa('0x15')]);router['delete'](_0x40fa('0x10'),auth[_0x40fa('0xc')](),controller[_0x40fa('0x16')]);module[_0x40fa('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 71dd8fb..feeb081 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x2c6810,_0x23c079){var _0x213881=function(_0x528021){while(--_0x528021){_0x2c6810['push'](_0x2c6810['shift']());}};_0x213881(++_0x23c079);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4e59fd,_0x3e34f8){_0x4e59fd=_0x4e59fd-0x0;var _0x4cabd0=_0x9bde[_0x4e59fd];return _0x4cabd0;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x4833e2,_0x521235){var _0x5e8b2a=function(_0x566a59){while(--_0x566a59){_0x4833e2['push'](_0x4833e2['shift']());}};_0x5e8b2a(++_0x521235);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x00bb[_0x1e7b16];return _0x37fadc;};'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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index ee060b3..f5b4d0d 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 _0xadd1=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','catch','show','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','name','send','index','map','OpenchannelTransferReport','rawAttributes'];(function(_0xc80186,_0x1dcc98){var _0x37e8d6=function(_0x2d387f){while(--_0x2d387f){_0xc80186['push'](_0xc80186['shift']());}};_0x37e8d6(++_0x1dcc98);}(_0xadd1,0x1ce));var _0x1add=function(_0x84c9ac,_0x1b5a7d){_0x84c9ac=_0x84c9ac-0x0;var _0x1001d5=_0xadd1[_0x84c9ac];return _0x1001d5;};'use strict';var emlformat=require(_0x1add('0x0'));var rimraf=require(_0x1add('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1add('0x2'));var rp=require(_0x1add('0x3'));var moment=require(_0x1add('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1add('0x5'));var util=require(_0x1add('0x6'));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(_0x1add('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1add('0x8'));var jsforce=require(_0x1add('0x9'));var deskjs=require(_0x1add('0xa'));var toCsv=require('to-csv');var querystring=require(_0x1add('0xb'));var Papa=require(_0x1add('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1add('0xd'));var as=require(_0x1add('0xe'));var hardwareService=require(_0x1add('0xf'));var logger=require(_0x1add('0x10'))(_0x1add('0x11'));var utils=require(_0x1add('0x12'));var config=require(_0x1add('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6b41eb,_0x50c091){_0x50c091=_0x50c091||0xcc;return function(_0x29c5ae){if(_0x29c5ae){return _0x6b41eb[_0x1add('0x14')](_0x50c091);}return _0x6b41eb['status'](_0x50c091)['end']();};}function respondWithResult(_0x34af55,_0x32a8b6){_0x32a8b6=_0x32a8b6||0xc8;return function(_0x38eba9){if(_0x38eba9){return _0x34af55[_0x1add('0x15')](_0x32a8b6)[_0x1add('0x16')](_0x38eba9);}};}function respondWithFilteredResult(_0x53fb61,_0x43bfd8){return function(_0x152c3e){if(_0x152c3e){var _0x591524=typeof _0x43bfd8[_0x1add('0x17')]===_0x1add('0x18')&&typeof _0x43bfd8[_0x1add('0x19')]===_0x1add('0x18');var _0x33f851=_0x152c3e[_0x1add('0x1a')];var _0x58a131=_0x591524?0x0:_0x43bfd8[_0x1add('0x17')];var _0x7a8666=_0x591524?_0x152c3e[_0x1add('0x1a')]:_0x43bfd8['offset']+_0x43bfd8[_0x1add('0x19')];var _0x2ecd83;if(_0x7a8666>=_0x33f851){_0x7a8666=_0x33f851;_0x2ecd83=0xc8;}else{_0x2ecd83=0xce;}_0x53fb61[_0x1add('0x15')](_0x2ecd83);return _0x53fb61[_0x1add('0x1b')]('Content-Range',_0x58a131+'-'+_0x7a8666+'/'+_0x33f851)[_0x1add('0x16')](_0x152c3e);}return null;};}function patchUpdates(_0x2c74fa){return function(_0x59777b){try{jsonpatch[_0x1add('0x1c')](_0x59777b,_0x2c74fa,!![]);}catch(_0x2ebb6a){return BPromise[_0x1add('0x1d')](_0x2ebb6a);}return _0x59777b[_0x1add('0x1e')]();};}function saveUpdates(_0x4e3269,_0x2d7beb){return function(_0x2f485f){if(_0x2f485f){return _0x2f485f[_0x1add('0x1f')](_0x4e3269)[_0x1add('0x20')](function(_0xc0bb89){return _0xc0bb89;});}return null;};}function removeEntity(_0x1b268f,_0x137cc3){return function(_0x1ebe89){if(_0x1ebe89){return _0x1ebe89[_0x1add('0x21')]()['then'](function(){_0x1b268f[_0x1add('0x15')](0xcc)[_0x1add('0x22')]();});}};}function handleEntityNotFound(_0x5aeded,_0x3b4109){return function(_0x4758d2){if(!_0x4758d2){_0x5aeded['sendStatus'](0x194);}return _0x4758d2;};}function handleError(_0xf3d5d0,_0x2c32de){_0x2c32de=_0x2c32de||0x1f4;return function(_0x395860){logger[_0x1add('0x23')](_0x395860['stack']);if(_0x395860[_0x1add('0x24')]){delete _0x395860[_0x1add('0x24')];}_0xf3d5d0[_0x1add('0x15')](_0x2c32de)[_0x1add('0x25')](_0x395860);};}exports[_0x1add('0x26')]=function(_0x5b26ee,_0x1b23b2){var _0x28eb2a={},_0x6249ad={},_0x59f705={'count':0x0,'rows':[]};var _0x41d177=_[_0x1add('0x27')](db[_0x1add('0x28')][_0x1add('0x29')],function(_0x31be8a){return{'name':_0x31be8a[_0x1add('0x2a')],'type':_0x31be8a[_0x1add('0x2b')][_0x1add('0x2c')]};});_0x6249ad[_0x1add('0x2d')]=_[_0x1add('0x27')](_0x41d177,_0x1add('0x24'));_0x6249ad[_0x1add('0x2e')]=_[_0x1add('0x2f')](_0x5b26ee[_0x1add('0x2e')]);_0x6249ad[_0x1add('0x30')]=_[_0x1add('0x31')](_0x6249ad[_0x1add('0x2d')],_0x6249ad[_0x1add('0x2e')]);_0x28eb2a[_0x1add('0x32')]=_[_0x1add('0x31')](_0x6249ad[_0x1add('0x2d')],qs[_0x1add('0x33')](_0x5b26ee['query']['fields']));_0x28eb2a[_0x1add('0x32')]=_0x28eb2a[_0x1add('0x32')][_0x1add('0x34')]?_0x28eb2a[_0x1add('0x32')]:_0x6249ad[_0x1add('0x2d')];if(!_0x5b26ee[_0x1add('0x2e')][_0x1add('0x35')](_0x1add('0x36'))){_0x28eb2a[_0x1add('0x19')]=qs[_0x1add('0x19')](_0x5b26ee[_0x1add('0x2e')][_0x1add('0x19')]);_0x28eb2a[_0x1add('0x17')]=qs[_0x1add('0x17')](_0x5b26ee[_0x1add('0x2e')]['offset']);}_0x28eb2a[_0x1add('0x37')]=qs[_0x1add('0x38')](_0x5b26ee[_0x1add('0x2e')][_0x1add('0x38')]);_0x28eb2a[_0x1add('0x39')]=qs[_0x1add('0x30')](_[_0x1add('0x3a')](_0x5b26ee[_0x1add('0x2e')],_0x6249ad['filters']),_0x41d177);if(_0x5b26ee[_0x1add('0x2e')]['filter']){_0x28eb2a[_0x1add('0x39')]=_['merge'](_0x28eb2a[_0x1add('0x39')],{'$or':_[_0x1add('0x27')](_0x41d177,function(_0x5dd159){if(_0x5dd159[_0x1add('0x2b')]!==_0x1add('0x3b')){var _0x2ae80e={};_0x2ae80e[_0x5dd159[_0x1add('0x24')]]={'$like':'%'+_0x5b26ee['query'][_0x1add('0x3c')]+'%'};return _0x2ae80e;}})});}_0x28eb2a=_[_0x1add('0x3d')]({},_0x28eb2a,_0x5b26ee['options']);var _0x2f29a6={'where':_0x28eb2a[_0x1add('0x39')]};return db[_0x1add('0x28')]['count'](_0x2f29a6)[_0x1add('0x20')](function(_0xa26bfc){_0x59f705[_0x1add('0x1a')]=_0xa26bfc;if(_0x5b26ee[_0x1add('0x2e')][_0x1add('0x3e')]){_0x28eb2a[_0x1add('0x3f')]=[{'all':!![]}];}return db[_0x1add('0x28')][_0x1add('0x40')](_0x28eb2a);})[_0x1add('0x20')](function(_0x466bba){_0x59f705['rows']=_0x466bba;return _0x59f705;})[_0x1add('0x20')](respondWithFilteredResult(_0x1b23b2,_0x28eb2a))[_0x1add('0x41')](handleError(_0x1b23b2,null));};exports[_0x1add('0x42')]=function(_0x27028c,_0x4d1bd6){var _0x2d40a8={'raw':!![],'where':{'id':_0x27028c['params']['id']}},_0x15271b={};_0x15271b['model']=_[_0x1add('0x2f')](db[_0x1add('0x28')][_0x1add('0x29')]);_0x15271b[_0x1add('0x2e')]=_['keys'](_0x27028c[_0x1add('0x2e')]);_0x15271b[_0x1add('0x30')]=_[_0x1add('0x31')](_0x15271b['model'],_0x15271b[_0x1add('0x2e')]);_0x2d40a8['attributes']=_[_0x1add('0x31')](_0x15271b[_0x1add('0x2d')],qs[_0x1add('0x33')](_0x27028c[_0x1add('0x2e')][_0x1add('0x33')]));_0x2d40a8[_0x1add('0x32')]=_0x2d40a8['attributes'][_0x1add('0x34')]?_0x2d40a8[_0x1add('0x32')]:_0x15271b[_0x1add('0x2d')];if(_0x27028c[_0x1add('0x2e')][_0x1add('0x3e')]){_0x2d40a8[_0x1add('0x3f')]=[{'all':!![]}];}_0x2d40a8=_[_0x1add('0x3d')]({},_0x2d40a8,_0x27028c['options']);return db[_0x1add('0x28')][_0x1add('0x43')](_0x2d40a8)['then'](handleEntityNotFound(_0x4d1bd6,null))['then'](respondWithResult(_0x4d1bd6,null))['catch'](handleError(_0x4d1bd6,null));};exports[_0x1add('0x44')]=function(_0x1b5ac7,_0x5d949c){return db[_0x1add('0x28')]['create'](_0x1b5ac7[_0x1add('0x45')],{})[_0x1add('0x20')](respondWithResult(_0x5d949c,0xc9))[_0x1add('0x41')](handleError(_0x5d949c,null));};exports[_0x1add('0x1f')]=function(_0x34f13d,_0x3ae1f2){if(_0x34f13d[_0x1add('0x45')]['id']){delete _0x34f13d['body']['id'];}return db[_0x1add('0x28')][_0x1add('0x43')]({'where':{'id':_0x34f13d['params']['id']}})['then'](handleEntityNotFound(_0x3ae1f2,null))[_0x1add('0x20')](saveUpdates(_0x34f13d[_0x1add('0x45')],null))['then'](respondWithResult(_0x3ae1f2,null))[_0x1add('0x41')](handleError(_0x3ae1f2,null));};exports[_0x1add('0x21')]=function(_0x2dbcd5,_0x37c105){return db[_0x1add('0x28')][_0x1add('0x43')]({'where':{'id':_0x2dbcd5[_0x1add('0x46')]['id']}})[_0x1add('0x20')](handleEntityNotFound(_0x37c105,null))[_0x1add('0x20')](removeEntity(_0x37c105,null))[_0x1add('0x41')](handleError(_0x37c105,null));};exports[_0x1add('0x47')]=function(_0x1afb02,_0x369942){return db[_0x1add('0x28')][_0x1add('0x47')]()[_0x1add('0x20')](respondWithResult(_0x369942,null))[_0x1add('0x41')](handleError(_0x369942,null));}; \ No newline at end of file +var _0x742f=['path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','then','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','key','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','catch','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5680b1,_0x4ffb1d){var _0x336629=function(_0x4de39a){while(--_0x4de39a){_0x5680b1['push'](_0x5680b1['shift']());}};_0x336629(++_0x4ffb1d);}(_0x742f,0x131));var _0xf742=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x742f[_0x9cd4c3];return _0x4c9025;};'use strict';var emlformat=require(_0xf742('0x0'));var rimraf=require(_0xf742('0x1'));var zipdir=require(_0xf742('0x2'));var jsonpatch=require(_0xf742('0x3'));var rp=require(_0xf742('0x4'));var moment=require(_0xf742('0x5'));var BPromise=require(_0xf742('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf742('0x7'));var sox=require(_0xf742('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf742('0x9'));var _=require(_0xf742('0xa'));var squel=require(_0xf742('0xb'));var crypto=require(_0xf742('0xc'));var jsforce=require(_0xf742('0xd'));var deskjs=require(_0xf742('0xe'));var toCsv=require(_0xf742('0xf'));var querystring=require(_0xf742('0x10'));var Papa=require(_0xf742('0x11'));var Redis=require(_0xf742('0x12'));var authService=require(_0xf742('0x13'));var qs=require(_0xf742('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf742('0x15'));var logger=require('../../config/logger')(_0xf742('0x16'));var utils=require(_0xf742('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf742('0x18'));var db=require(_0xf742('0x19'))['db'];function respondWithStatusCode(_0x2cfb2e,_0x256482){_0x256482=_0x256482||0xcc;return function(_0x47af88){if(_0x47af88){return _0x2cfb2e[_0xf742('0x1a')](_0x256482);}return _0x2cfb2e['status'](_0x256482)[_0xf742('0x1b')]();};}function respondWithResult(_0x2c5ac3,_0x4e716f){_0x4e716f=_0x4e716f||0xc8;return function(_0xa6878e){if(_0xa6878e){return _0x2c5ac3[_0xf742('0x1c')](_0x4e716f)[_0xf742('0x1d')](_0xa6878e);}};}function respondWithFilteredResult(_0x230acb,_0x5b394f){return function(_0x56878e){if(_0x56878e){var _0x52586f=typeof _0x5b394f['offset']===_0xf742('0x1e')&&typeof _0x5b394f[_0xf742('0x1f')]===_0xf742('0x1e');var _0x502e34=_0x56878e[_0xf742('0x20')];var _0x395678=_0x52586f?0x0:_0x5b394f[_0xf742('0x21')];var _0x385b10=_0x52586f?_0x56878e[_0xf742('0x20')]:_0x5b394f[_0xf742('0x21')]+_0x5b394f[_0xf742('0x1f')];var _0x3b4310;if(_0x385b10>=_0x502e34){_0x385b10=_0x502e34;_0x3b4310=0xc8;}else{_0x3b4310=0xce;}_0x230acb[_0xf742('0x1c')](_0x3b4310);return _0x230acb[_0xf742('0x22')]('Content-Range',_0x395678+'-'+_0x385b10+'/'+_0x502e34)[_0xf742('0x1d')](_0x56878e);}return null;};}function patchUpdates(_0x59e908){return function(_0x1ba741){try{jsonpatch[_0xf742('0x23')](_0x1ba741,_0x59e908,!![]);}catch(_0x2a2cbb){return BPromise[_0xf742('0x24')](_0x2a2cbb);}return _0x1ba741['save']();};}function saveUpdates(_0x1df8c2,_0x4cada8){return function(_0x430bc5){if(_0x430bc5){return _0x430bc5['update'](_0x1df8c2)[_0xf742('0x25')](function(_0x8c322){return _0x8c322;});}return null;};}function removeEntity(_0x5a4aec,_0x4e47e1){return function(_0xa04293){if(_0xa04293){return _0xa04293['destroy']()[_0xf742('0x25')](function(){_0x5a4aec['status'](0xcc)[_0xf742('0x1b')]();});}};}function handleEntityNotFound(_0x51e099,_0x16f895){return function(_0x5c74d4){if(!_0x5c74d4){_0x51e099[_0xf742('0x1a')](0x194);}return _0x5c74d4;};}function handleError(_0x57dede,_0x5d188f){_0x5d188f=_0x5d188f||0x1f4;return function(_0x27c770){logger[_0xf742('0x26')](_0x27c770[_0xf742('0x27')]);if(_0x27c770[_0xf742('0x28')]){delete _0x27c770[_0xf742('0x28')];}_0x57dede[_0xf742('0x1c')](_0x5d188f)[_0xf742('0x29')](_0x27c770);};}exports[_0xf742('0x2a')]=function(_0xf64017,_0x3ab10a){var _0x3e9963={},_0x291a5f={},_0x72331f={'count':0x0,'rows':[]};var _0x1078bb=_[_0xf742('0x2b')](db[_0xf742('0x2c')][_0xf742('0x2d')],function(_0x32477e){return{'name':_0x32477e[_0xf742('0x2e')],'type':_0x32477e['type'][_0xf742('0x2f')]};});_0x291a5f['model']=_[_0xf742('0x2b')](_0x1078bb,_0xf742('0x28'));_0x291a5f['query']=_['keys'](_0xf64017['query']);_0x291a5f[_0xf742('0x30')]=_[_0xf742('0x31')](_0x291a5f[_0xf742('0x32')],_0x291a5f['query']);_0x3e9963[_0xf742('0x33')]=_[_0xf742('0x31')](_0x291a5f[_0xf742('0x32')],qs[_0xf742('0x34')](_0xf64017[_0xf742('0x35')][_0xf742('0x34')]));_0x3e9963[_0xf742('0x33')]=_0x3e9963['attributes'][_0xf742('0x36')]?_0x3e9963[_0xf742('0x33')]:_0x291a5f['model'];if(!_0xf64017[_0xf742('0x35')][_0xf742('0x37')](_0xf742('0x38'))){_0x3e9963[_0xf742('0x1f')]=qs[_0xf742('0x1f')](_0xf64017[_0xf742('0x35')][_0xf742('0x1f')]);_0x3e9963[_0xf742('0x21')]=qs[_0xf742('0x21')](_0xf64017['query'][_0xf742('0x21')]);}_0x3e9963[_0xf742('0x39')]=qs[_0xf742('0x3a')](_0xf64017[_0xf742('0x35')][_0xf742('0x3a')]);_0x3e9963[_0xf742('0x3b')]=qs[_0xf742('0x30')](_[_0xf742('0x3c')](_0xf64017['query'],_0x291a5f[_0xf742('0x30')]),_0x1078bb);if(_0xf64017[_0xf742('0x35')][_0xf742('0x3d')]){_0x3e9963[_0xf742('0x3b')]=_[_0xf742('0x3e')](_0x3e9963['where'],{'$or':_['map'](_0x1078bb,function(_0x2436cd){if(_0x2436cd[_0xf742('0x3f')]!==_0xf742('0x40')){var _0x29ecc3={};_0x29ecc3[_0x2436cd[_0xf742('0x28')]]={'$like':'%'+_0xf64017[_0xf742('0x35')][_0xf742('0x3d')]+'%'};return _0x29ecc3;}})});}_0x3e9963=_[_0xf742('0x3e')]({},_0x3e9963,_0xf64017[_0xf742('0x41')]);var _0x4dca88={'where':_0x3e9963[_0xf742('0x3b')]};return db[_0xf742('0x2c')]['count'](_0x4dca88)[_0xf742('0x25')](function(_0x310a50){_0x72331f[_0xf742('0x20')]=_0x310a50;if(_0xf64017['query'][_0xf742('0x42')]){_0x3e9963[_0xf742('0x43')]=[{'all':!![]}];}return db[_0xf742('0x2c')][_0xf742('0x44')](_0x3e9963);})[_0xf742('0x25')](function(_0x99cdea){_0x72331f[_0xf742('0x45')]=_0x99cdea;return _0x72331f;})[_0xf742('0x25')](respondWithFilteredResult(_0x3ab10a,_0x3e9963))['catch'](handleError(_0x3ab10a,null));};exports['show']=function(_0x3b8f03,_0x2f49b4){var _0x5df404={'raw':!![],'where':{'id':_0x3b8f03[_0xf742('0x46')]['id']}},_0x1b9786={};_0x1b9786[_0xf742('0x32')]=_[_0xf742('0x47')](db[_0xf742('0x2c')][_0xf742('0x2d')]);_0x1b9786['query']=_[_0xf742('0x47')](_0x3b8f03['query']);_0x1b9786[_0xf742('0x30')]=_[_0xf742('0x31')](_0x1b9786[_0xf742('0x32')],_0x1b9786['query']);_0x5df404[_0xf742('0x33')]=_[_0xf742('0x31')](_0x1b9786[_0xf742('0x32')],qs[_0xf742('0x34')](_0x3b8f03[_0xf742('0x35')][_0xf742('0x34')]));_0x5df404[_0xf742('0x33')]=_0x5df404['attributes'][_0xf742('0x36')]?_0x5df404[_0xf742('0x33')]:_0x1b9786['model'];if(_0x3b8f03[_0xf742('0x35')]['includeAll']){_0x5df404[_0xf742('0x43')]=[{'all':!![]}];}_0x5df404=_[_0xf742('0x3e')]({},_0x5df404,_0x3b8f03[_0xf742('0x41')]);return db[_0xf742('0x2c')][_0xf742('0x48')](_0x5df404)[_0xf742('0x25')](handleEntityNotFound(_0x2f49b4,null))[_0xf742('0x25')](respondWithResult(_0x2f49b4,null))[_0xf742('0x49')](handleError(_0x2f49b4,null));};exports['create']=function(_0x5e3a11,_0x5165e8){return db[_0xf742('0x2c')][_0xf742('0x4a')](_0x5e3a11['body'],{})['then'](respondWithResult(_0x5165e8,0xc9))[_0xf742('0x49')](handleError(_0x5165e8,null));};exports[_0xf742('0x4b')]=function(_0x466267,_0xd36475){if(_0x466267[_0xf742('0x4c')]['id']){delete _0x466267[_0xf742('0x4c')]['id'];}return db[_0xf742('0x2c')][_0xf742('0x48')]({'where':{'id':_0x466267['params']['id']}})[_0xf742('0x25')](handleEntityNotFound(_0xd36475,null))[_0xf742('0x25')](saveUpdates(_0x466267[_0xf742('0x4c')],null))[_0xf742('0x25')](respondWithResult(_0xd36475,null))['catch'](handleError(_0xd36475,null));};exports['destroy']=function(_0x4f3b06,_0x5b56c5){return db['OpenchannelTransferReport'][_0xf742('0x48')]({'where':{'id':_0x4f3b06['params']['id']}})[_0xf742('0x25')](handleEntityNotFound(_0x5b56c5,null))[_0xf742('0x25')](removeEntity(_0x5b56c5,null))[_0xf742('0x49')](handleError(_0x5b56c5,null));};exports[_0xf742('0x4d')]=function(_0x32e2ab,_0x31da1b){return db[_0xf742('0x2c')][_0xf742('0x4d')]()[_0xf742('0x25')](respondWithResult(_0x31da1b,null))['catch'](handleError(_0x31da1b,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 1c29069..f8ff7d7 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 _0x0488=['exports','define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x5bfea8,_0x234a6d){var _0x38009c=function(_0xea7171){while(--_0xea7171){_0x5bfea8['push'](_0x5bfea8['shift']());}};_0x38009c(++_0x234a6d);}(_0x0488,0x159));var _0x8048=function(_0x340c13,_0x595d66){_0x340c13=_0x340c13-0x0;var _0x5a7d96=_0x0488[_0x340c13];return _0x5a7d96;};'use strict';var _=require(_0x8048('0x0'));var util=require(_0x8048('0x1'));var logger=require(_0x8048('0x2'))('api');var moment=require(_0x8048('0x3'));var BPromise=require(_0x8048('0x4'));var rp=require(_0x8048('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8048('0x6'));var attributes=require('./openchannelTransferReport.attributes');module[_0x8048('0x7')]=function(_0x54184b,_0x8cbbc3){return _0x54184b[_0x8048('0x8')]('OpenchannelTransferReport',attributes,{'tableName':_0x8048('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8048('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa6be=['api','moment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x34012c,_0x4979a2){var _0x5cee29=function(_0x18c089){while(--_0x18c089){_0x34012c['push'](_0x34012c['shift']());}};_0x5cee29(++_0x4979a2);}(_0xa6be,0xc3));var _0xea6b=function(_0x29ca34,_0x3ff9fd){_0x29ca34=_0x29ca34-0x0;var _0x14a0be=_0xa6be[_0x29ca34];return _0x14a0be;};'use strict';var _=require(_0xea6b('0x0'));var util=require(_0xea6b('0x1'));var logger=require(_0xea6b('0x2'))(_0xea6b('0x3'));var moment=require(_0xea6b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xea6b('0x5'));module[_0xea6b('0x6')]=function(_0x81ca14,_0x32de24){return _0x81ca14[_0xea6b('0x7')](_0xea6b('0x8'),attributes,{'tableName':_0xea6b('0x9'),'paranoid':![],'indexes':[{'name':_0xea6b('0xa'),'fields':[_0xea6b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 7002768..edf74c8 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 _0x31c2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x31c2,0x1e1));var _0x231c=function(_0x1209b2,_0x29e710){_0x1209b2=_0x1209b2-0x0;var _0x530836=_0x31c2[_0x1209b2];return _0x530836;};'use strict';var _=require(_0x231c('0x0'));var util=require(_0x231c('0x1'));var moment=require(_0x231c('0x2'));var BPromise=require(_0x231c('0x3'));var rs=require(_0x231c('0x4'));var fs=require('fs');var Redis=require(_0x231c('0x5'));var db=require(_0x231c('0x6'))['db'];var utils=require(_0x231c('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x231c('0x8'));var jayson=require(_0x231c('0x9'));var client=jayson[_0x231c('0xa')][_0x231c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48bfb2,_0x111bf9,_0x49ff9e){return new BPromise(function(_0x439df8,_0x38b3b9){return client[_0x231c('0xc')](_0x48bfb2,_0x49ff9e)['then'](function(_0x2524bf){logger[_0x231c('0xd')](_0x231c('0xe'),_0x111bf9,_0x231c('0xf'));logger[_0x231c('0x10')](_0x231c('0x11'),_0x111bf9,_0x231c('0xf'),JSON['stringify'](_0x2524bf));if(_0x2524bf[_0x231c('0x12')]){if(_0x2524bf[_0x231c('0x12')]['code']===0x1f4){logger[_0x231c('0x12')](_0x231c('0xe'),_0x111bf9,_0x2524bf[_0x231c('0x12')][_0x231c('0x13')]);return _0x38b3b9(_0x2524bf[_0x231c('0x12')][_0x231c('0x13')]);}logger[_0x231c('0x12')](_0x231c('0xe'),_0x111bf9,_0x2524bf[_0x231c('0x12')][_0x231c('0x13')]);return _0x439df8(_0x2524bf[_0x231c('0x12')][_0x231c('0x13')]);}else{logger[_0x231c('0xd')](_0x231c('0xe'),_0x111bf9,_0x231c('0xf'));_0x439df8(_0x2524bf[_0x231c('0x14')][_0x231c('0x13')]);}})[_0x231c('0x15')](function(_0x1852e5){logger[_0x231c('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x111bf9,_0x1852e5);_0x38b3b9(_0x1852e5);});});} \ No newline at end of file +var _0xa1f6=['client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','jayson/promise'];(function(_0x571c1e,_0x3b5f56){var _0x4b2fd9=function(_0x1994f3){while(--_0x1994f3){_0x571c1e['push'](_0x571c1e['shift']());}};_0x4b2fd9(++_0x3b5f56);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x3daa8c,_0x388a87){_0x3daa8c=_0x3daa8c-0x0;var _0x2b1bd7=_0xa1f6[_0x3daa8c];return _0x2b1bd7;};'use strict';var _=require(_0x6a1f('0x0'));var util=require(_0x6a1f('0x1'));var moment=require(_0x6a1f('0x2'));var BPromise=require(_0x6a1f('0x3'));var rs=require(_0x6a1f('0x4'));var fs=require('fs');var Redis=require(_0x6a1f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6a1f('0x6'));var client=jayson[_0x6a1f('0x7')][_0x6a1f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a772b,_0x328033,_0x3ecd63){return new BPromise(function(_0x36c00b,_0x56bf63){return client[_0x6a1f('0x9')](_0x3a772b,_0x3ecd63)[_0x6a1f('0xa')](function(_0x2300b1){logger[_0x6a1f('0xb')](_0x6a1f('0xc'),_0x328033,'request\x20sent');logger[_0x6a1f('0xd')](_0x6a1f('0xe'),_0x328033,_0x6a1f('0xf'),JSON[_0x6a1f('0x10')](_0x2300b1));if(_0x2300b1['error']){if(_0x2300b1[_0x6a1f('0x11')]['code']===0x1f4){logger[_0x6a1f('0x11')](_0x6a1f('0xc'),_0x328033,_0x2300b1[_0x6a1f('0x11')][_0x6a1f('0x12')]);return _0x56bf63(_0x2300b1[_0x6a1f('0x11')][_0x6a1f('0x12')]);}logger[_0x6a1f('0x11')](_0x6a1f('0xc'),_0x328033,_0x2300b1[_0x6a1f('0x11')][_0x6a1f('0x12')]);return _0x36c00b(_0x2300b1[_0x6a1f('0x11')][_0x6a1f('0x12')]);}else{logger[_0x6a1f('0xb')](_0x6a1f('0xc'),_0x328033,_0x6a1f('0xf'));_0x36c00b(_0x2300b1[_0x6a1f('0x13')][_0x6a1f('0x12')]);}})[_0x6a1f('0x14')](function(_0x2c44a0){logger['error'](_0x6a1f('0xc'),_0x328033,_0x2c44a0);_0x56bf63(_0x2c44a0);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 2064bed..e297f97 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 _0x6d5e=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','multer','util','connect-timeout'];(function(_0x16568c,_0x251f9f){var _0x1e2d53=function(_0x437c43){while(--_0x437c43){_0x16568c['push'](_0x16568c['shift']());}};_0x1e2d53(++_0x251f9f);}(_0x6d5e,0xf4));var _0xe6d5=function(_0x218791,_0xeb7ba4){_0x218791=_0x218791-0x0;var _0x3e7abc=_0x6d5e[_0x218791];return _0x3e7abc;};'use strict';var multer=require(_0xe6d5('0x0'));var util=require(_0xe6d5('0x1'));var path=require('path');var timeout=require(_0xe6d5('0x2'));var express=require(_0xe6d5('0x3'));var router=express[_0xe6d5('0x4')]();var fs_extra=require(_0xe6d5('0x5'));var auth=require(_0xe6d5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe6d5('0x7'));var controller=require(_0xe6d5('0x8'));router['get']('/',auth[_0xe6d5('0x9')](),controller[_0xe6d5('0xa')]);router[_0xe6d5('0xb')](_0xe6d5('0xc'),auth[_0xe6d5('0x9')](),controller[_0xe6d5('0xd')]);router[_0xe6d5('0xe')]('/',auth['isAuthenticated'](),controller[_0xe6d5('0xf')]);router[_0xe6d5('0x10')](_0xe6d5('0xc'),auth[_0xe6d5('0x9')](),controller[_0xe6d5('0x11')]);router[_0xe6d5('0x12')](_0xe6d5('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6a13=['/:id','show','isAuthenticated','create','put','update','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get'];(function(_0x7ee9d3,_0x52b266){var _0xd27e87=function(_0x1503a0){while(--_0x1503a0){_0x7ee9d3['push'](_0x7ee9d3['shift']());}};_0xd27e87(++_0x52b266);}(_0x6a13,0xf4));var _0x36a1=function(_0x3fd997,_0x9e79d7){_0x3fd997=_0x3fd997-0x0;var _0x291a1d=_0x6a13[_0x3fd997];return _0x291a1d;};'use strict';var multer=require('multer');var util=require(_0x36a1('0x0'));var path=require('path');var timeout=require(_0x36a1('0x1'));var express=require(_0x36a1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x36a1('0x3'));var interaction=require(_0x36a1('0x4'));var config=require(_0x36a1('0x5'));var controller=require('./pause.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x36a1('0x6')]);router[_0x36a1('0x7')](_0x36a1('0x8'),auth['isAuthenticated'](),controller[_0x36a1('0x9')]);router['post']('/',auth[_0x36a1('0xa')](),controller[_0x36a1('0xb')]);router[_0x36a1('0xc')](_0x36a1('0x8'),auth[_0x36a1('0xa')](),controller[_0x36a1('0xd')]);router['delete'](_0x36a1('0x8'),auth[_0x36a1('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 005e82e..184e1a7 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 _0xb6cf=['name','sequelize','exports','STRING'];(function(_0x5b8310,_0x77ea6f){var _0xd3ebc1=function(_0x9dfb29){while(--_0x9dfb29){_0x5b8310['push'](_0x5b8310['shift']());}};_0xd3ebc1(++_0x77ea6f);}(_0xb6cf,0x161));var _0xfb6c=function(_0x50d471,_0x2d9086){_0x50d471=_0x50d471-0x0;var _0x214900=_0xb6cf[_0x50d471];return _0x214900;};'use strict';var Sequelize=require(_0xfb6c('0x0'));module[_0xfb6c('0x1')]={'name':{'type':Sequelize[_0xfb6c('0x2')],'unique':_0xfb6c('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xfb6c('0x2')]}}; \ No newline at end of file +var _0x0293=['name','STRING','sequelize'];(function(_0x5b441a,_0x36c84e){var _0x26f90b=function(_0x432ecd){while(--_0x432ecd){_0x5b441a['push'](_0x5b441a['shift']());}};_0x26f90b(++_0x36c84e);}(_0x0293,0x116));var _0x3029=function(_0x679d60,_0x57d85d){_0x679d60=_0x679d60-0x0;var _0xc057d1=_0x0293[_0x679d60];return _0xc057d1;};'use strict';var Sequelize=require(_0x3029('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3029('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x3029('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index f1df930..fec7528 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 _0x0b93=['squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','end','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','Pause','includeAll','include','rows','catch','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0b93,0x199));var _0x30b9=function(_0x49a15,_0x6c14e3){_0x49a15=_0x49a15-0x0;var _0x20f915=_0x0b93[_0x49a15];return _0x20f915;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x30b9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x30b9('0x1'));var rp=require(_0x30b9('0x2'));var moment=require(_0x30b9('0x3'));var BPromise=require(_0x30b9('0x4'));var Mustache=require(_0x30b9('0x5'));var util=require(_0x30b9('0x6'));var path=require(_0x30b9('0x7'));var sox=require(_0x30b9('0x8'));var csv=require('to-csv');var ejs=require(_0x30b9('0x9'));var fs=require('fs');var fs_extra=require(_0x30b9('0xa'));var _=require('lodash');var squel=require(_0x30b9('0xb'));var crypto=require(_0x30b9('0xc'));var jsforce=require(_0x30b9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x30b9('0xe'));var querystring=require(_0x30b9('0xf'));var Papa=require(_0x30b9('0x10'));var Redis=require(_0x30b9('0x11'));var authService=require(_0x30b9('0x12'));var qs=require(_0x30b9('0x13'));var as=require(_0x30b9('0x14'));var hardwareService=require(_0x30b9('0x15'));var logger=require(_0x30b9('0x16'))(_0x30b9('0x17'));var utils=require(_0x30b9('0x18'));var config=require(_0x30b9('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x30b9('0x1a'))['db'];function respondWithStatusCode(_0x424f67,_0x2fc1a8){_0x2fc1a8=_0x2fc1a8||0xcc;return function(_0x4e5967){if(_0x4e5967){return _0x424f67[_0x30b9('0x1b')](_0x2fc1a8);}return _0x424f67['status'](_0x2fc1a8)['end']();};}function respondWithResult(_0x56ec89,_0x3ba539){_0x3ba539=_0x3ba539||0xc8;return function(_0x347e50){if(_0x347e50){return _0x56ec89['status'](_0x3ba539)[_0x30b9('0x1c')](_0x347e50);}};}function respondWithFilteredResult(_0x290b08,_0xcf3524){return function(_0x5ad4e3){if(_0x5ad4e3){var _0x16a1dc=typeof _0xcf3524[_0x30b9('0x1d')]==='undefined'&&typeof _0xcf3524[_0x30b9('0x1e')]===_0x30b9('0x1f');var _0x4997cd=_0x5ad4e3[_0x30b9('0x20')];var _0x6eacab=_0x16a1dc?0x0:_0xcf3524[_0x30b9('0x1d')];var _0x2928ea=_0x16a1dc?_0x5ad4e3[_0x30b9('0x20')]:_0xcf3524['offset']+_0xcf3524[_0x30b9('0x1e')];var _0xd6e16;if(_0x2928ea>=_0x4997cd){_0x2928ea=_0x4997cd;_0xd6e16=0xc8;}else{_0xd6e16=0xce;}_0x290b08[_0x30b9('0x21')](_0xd6e16);return _0x290b08['set'](_0x30b9('0x22'),_0x6eacab+'-'+_0x2928ea+'/'+_0x4997cd)['json'](_0x5ad4e3);}return null;};}function patchUpdates(_0x428c24){return function(_0x55308d){try{jsonpatch[_0x30b9('0x23')](_0x55308d,_0x428c24,!![]);}catch(_0x171117){return BPromise[_0x30b9('0x24')](_0x171117);}return _0x55308d[_0x30b9('0x25')]();};}function saveUpdates(_0x579f0e,_0x186b1c){return function(_0x4499df){if(_0x4499df){return _0x4499df[_0x30b9('0x26')](_0x579f0e)[_0x30b9('0x27')](function(_0x17e25b){return _0x17e25b;});}return null;};}function removeEntity(_0x47b02d,_0x549ddd){return function(_0x24e8ee){if(_0x24e8ee){return _0x24e8ee[_0x30b9('0x28')]()[_0x30b9('0x27')](function(){var _0x638cdd=_0x24e8ee[_0x30b9('0x29')]({'plain':!![]});var _0x5e3c06=_0x30b9('0x2a');return db['UserProfileResource'][_0x30b9('0x28')]({'where':{'type':_0x5e3c06,'resourceId':_0x638cdd['id']}})[_0x30b9('0x27')](function(){return _0x24e8ee;});})[_0x30b9('0x27')](function(){_0x47b02d[_0x30b9('0x21')](0xcc)[_0x30b9('0x2b')]();});}};}function handleEntityNotFound(_0x473d06,_0x114a0a){return function(_0x55f1c1){if(!_0x55f1c1){_0x473d06[_0x30b9('0x1b')](0x194);}return _0x55f1c1;};}function handleError(_0x2c6eca,_0x150ebc){_0x150ebc=_0x150ebc||0x1f4;return function(_0x98b957){logger['error'](_0x98b957[_0x30b9('0x2c')]);if(_0x98b957['name']){delete _0x98b957[_0x30b9('0x2d')];}_0x2c6eca[_0x30b9('0x21')](_0x150ebc)[_0x30b9('0x2e')](_0x98b957);};}exports[_0x30b9('0x2f')]=function(_0x3c1394,_0x3efffd){var _0x3438d5={},_0x36af55={},_0x4bfca9={'count':0x0,'rows':[]};var _0x1b65e3=_[_0x30b9('0x30')](db['Pause'][_0x30b9('0x31')],function(_0x7ef18){return{'name':_0x7ef18['fieldName'],'type':_0x7ef18['type'][_0x30b9('0x32')]};});_0x36af55[_0x30b9('0x33')]=_['map'](_0x1b65e3,_0x30b9('0x2d'));_0x36af55[_0x30b9('0x34')]=_[_0x30b9('0x35')](_0x3c1394[_0x30b9('0x34')]);_0x36af55[_0x30b9('0x36')]=_[_0x30b9('0x37')](_0x36af55[_0x30b9('0x33')],_0x36af55['query']);_0x3438d5[_0x30b9('0x38')]=_[_0x30b9('0x37')](_0x36af55[_0x30b9('0x33')],qs[_0x30b9('0x39')](_0x3c1394[_0x30b9('0x34')][_0x30b9('0x39')]));_0x3438d5[_0x30b9('0x38')]=_0x3438d5['attributes'][_0x30b9('0x3a')]?_0x3438d5[_0x30b9('0x38')]:_0x36af55[_0x30b9('0x33')];if(!_0x3c1394[_0x30b9('0x34')][_0x30b9('0x3b')]('nolimit')){_0x3438d5[_0x30b9('0x1e')]=qs[_0x30b9('0x1e')](_0x3c1394[_0x30b9('0x34')]['limit']);_0x3438d5[_0x30b9('0x1d')]=qs['offset'](_0x3c1394[_0x30b9('0x34')][_0x30b9('0x1d')]);}_0x3438d5[_0x30b9('0x3c')]=qs['sort'](_0x3c1394[_0x30b9('0x34')][_0x30b9('0x3d')]);_0x3438d5['where']=qs[_0x30b9('0x36')](_[_0x30b9('0x3e')](_0x3c1394[_0x30b9('0x34')],_0x36af55[_0x30b9('0x36')]),_0x1b65e3);if(_0x3c1394[_0x30b9('0x34')]['filter']){_0x3438d5[_0x30b9('0x3f')]=_[_0x30b9('0x40')](_0x3438d5[_0x30b9('0x3f')],{'$or':_[_0x30b9('0x30')](_0x1b65e3,function(_0x1d8f99){if(_0x1d8f99['type']!==_0x30b9('0x41')){var _0x59a7d4={};_0x59a7d4[_0x1d8f99[_0x30b9('0x2d')]]={'$like':'%'+_0x3c1394[_0x30b9('0x34')][_0x30b9('0x42')]+'%'};return _0x59a7d4;}})});}_0x3438d5=_[_0x30b9('0x40')]({},_0x3438d5,_0x3c1394['options']);var _0x264a64={'where':_0x3438d5['where']};return db[_0x30b9('0x43')][_0x30b9('0x20')](_0x264a64)['then'](function(_0x56c705){_0x4bfca9[_0x30b9('0x20')]=_0x56c705;if(_0x3c1394['query'][_0x30b9('0x44')]){_0x3438d5[_0x30b9('0x45')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x3438d5);})[_0x30b9('0x27')](function(_0x3f03c9){_0x4bfca9[_0x30b9('0x46')]=_0x3f03c9;return _0x4bfca9;})[_0x30b9('0x27')](respondWithFilteredResult(_0x3efffd,_0x3438d5))[_0x30b9('0x47')](handleError(_0x3efffd,null));};exports[_0x30b9('0x48')]=function(_0x15fdad,_0x19b76a){var _0x4855fb={'raw':!![],'where':{'id':_0x15fdad['params']['id']}},_0x1fd91d={};_0x1fd91d[_0x30b9('0x33')]=_[_0x30b9('0x35')](db[_0x30b9('0x43')]['rawAttributes']);_0x1fd91d[_0x30b9('0x34')]=_[_0x30b9('0x35')](_0x15fdad[_0x30b9('0x34')]);_0x1fd91d['filters']=_[_0x30b9('0x37')](_0x1fd91d[_0x30b9('0x33')],_0x1fd91d[_0x30b9('0x34')]);_0x4855fb[_0x30b9('0x38')]=_[_0x30b9('0x37')](_0x1fd91d['model'],qs['fields'](_0x15fdad[_0x30b9('0x34')]['fields']));_0x4855fb[_0x30b9('0x38')]=_0x4855fb[_0x30b9('0x38')][_0x30b9('0x3a')]?_0x4855fb[_0x30b9('0x38')]:_0x1fd91d[_0x30b9('0x33')];if(_0x15fdad['query'][_0x30b9('0x44')]){_0x4855fb[_0x30b9('0x45')]=[{'all':!![]}];}_0x4855fb=_[_0x30b9('0x40')]({},_0x4855fb,_0x15fdad['options']);return db[_0x30b9('0x43')]['find'](_0x4855fb)[_0x30b9('0x27')](handleEntityNotFound(_0x19b76a,null))[_0x30b9('0x27')](respondWithResult(_0x19b76a,null))['catch'](handleError(_0x19b76a,null));};exports[_0x30b9('0x49')]=function(_0x20c29c,_0x59efd0){return db['Pause'][_0x30b9('0x49')](_0x20c29c[_0x30b9('0x4a')],{})[_0x30b9('0x27')](function(_0x46ae4c){var _0x1e9e9c=_0x20c29c['user']['get']({'plain':!![]});if(!_0x1e9e9c)throw new Error(_0x30b9('0x4b'));if(_0x1e9e9c[_0x30b9('0x4c')]==='user'){var _0x6e1c73=_0x46ae4c[_0x30b9('0x29')]({'plain':!![]});var _0x5906d2=_0x30b9('0x2a');return db[_0x30b9('0x4d')][_0x30b9('0x4e')]({'where':{'name':_0x5906d2,'userProfileId':_0x1e9e9c['userProfileId']},'raw':!![]})['then'](function(_0x53171b){if(_0x53171b&&_0x53171b[_0x30b9('0x4f')]===0x0){return db[_0x30b9('0x50')]['create']({'name':_0x6e1c73[_0x30b9('0x2d')],'resourceId':_0x6e1c73['id'],'type':_0x53171b[_0x30b9('0x2d')],'sectionId':_0x53171b['id']},{})[_0x30b9('0x27')](function(){return _0x46ae4c;});}else{return _0x46ae4c;}})[_0x30b9('0x47')](function(_0x3cccf4){logger[_0x30b9('0x51')](_0x30b9('0x52'),_0x3cccf4);throw _0x3cccf4;});}return _0x46ae4c;})['then'](respondWithResult(_0x59efd0,0xc9))['catch'](handleError(_0x59efd0,null));};exports[_0x30b9('0x26')]=function(_0xac30b,_0x426aae){if(_0xac30b['body']['id']){delete _0xac30b['body']['id'];}return db[_0x30b9('0x43')]['find']({'where':{'id':_0xac30b[_0x30b9('0x53')]['id']}})[_0x30b9('0x27')](handleEntityNotFound(_0x426aae,null))[_0x30b9('0x27')](saveUpdates(_0xac30b[_0x30b9('0x4a')],null))[_0x30b9('0x27')](respondWithResult(_0x426aae,null))[_0x30b9('0x47')](handleError(_0x426aae,null));};exports[_0x30b9('0x28')]=function(_0x18fb0d,_0x572418){return db['Pause'][_0x30b9('0x4e')]({'where':{'id':_0x18fb0d[_0x30b9('0x53')]['id']}})[_0x30b9('0x27')](handleEntityNotFound(_0x572418,null))[_0x30b9('0x27')](removeEntity(_0x572418,null))['catch'](handleError(_0x572418,null));}; \ No newline at end of file +var _0x9a8c=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','fast-json-patch','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','set','reject','update','then','get','Pauses','UserProfileResource','destroy','error','stack','name','send','index','Pause','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation'];(function(_0x2d61ac,_0x18ff36){var _0x3f7d3c=function(_0x2ba7e5){while(--_0x2ba7e5){_0x2d61ac['push'](_0x2d61ac['shift']());}};_0x3f7d3c(++_0x18ff36);}(_0x9a8c,0x1e8));var _0xc9a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a8c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9a8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc9a8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc9a8('0x2'));var util=require(_0xc9a8('0x3'));var path=require(_0xc9a8('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc9a8('0x5'));var fs=require('fs');var fs_extra=require(_0xc9a8('0x6'));var _=require(_0xc9a8('0x7'));var squel=require(_0xc9a8('0x8'));var crypto=require(_0xc9a8('0x9'));var jsforce=require(_0xc9a8('0xa'));var deskjs=require(_0xc9a8('0xb'));var toCsv=require(_0xc9a8('0xc'));var querystring=require(_0xc9a8('0xd'));var Papa=require(_0xc9a8('0xe'));var Redis=require('ioredis');var authService=require(_0xc9a8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc9a8('0x10'));var hardwareService=require(_0xc9a8('0x11'));var logger=require(_0xc9a8('0x12'))(_0xc9a8('0x13'));var utils=require('../../config/utils');var config=require(_0xc9a8('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb39f49,_0x2db2eb){_0x2db2eb=_0x2db2eb||0xcc;return function(_0x42b3c7){if(_0x42b3c7){return _0xb39f49[_0xc9a8('0x15')](_0x2db2eb);}return _0xb39f49[_0xc9a8('0x16')](_0x2db2eb)[_0xc9a8('0x17')]();};}function respondWithResult(_0x3e8f81,_0x52b4fe){_0x52b4fe=_0x52b4fe||0xc8;return function(_0x211af1){if(_0x211af1){return _0x3e8f81[_0xc9a8('0x16')](_0x52b4fe)[_0xc9a8('0x18')](_0x211af1);}};}function respondWithFilteredResult(_0x27ab7e,_0x2945d2){return function(_0x342556){if(_0x342556){var _0x2786c3=typeof _0x2945d2[_0xc9a8('0x19')]===_0xc9a8('0x1a')&&typeof _0x2945d2[_0xc9a8('0x1b')]===_0xc9a8('0x1a');var _0x2c06a4=_0x342556['count'];var _0x152c2c=_0x2786c3?0x0:_0x2945d2[_0xc9a8('0x19')];var _0x5d0d08=_0x2786c3?_0x342556['count']:_0x2945d2['offset']+_0x2945d2[_0xc9a8('0x1b')];var _0x2503f9;if(_0x5d0d08>=_0x2c06a4){_0x5d0d08=_0x2c06a4;_0x2503f9=0xc8;}else{_0x2503f9=0xce;}_0x27ab7e[_0xc9a8('0x16')](_0x2503f9);return _0x27ab7e[_0xc9a8('0x1c')]('Content-Range',_0x152c2c+'-'+_0x5d0d08+'/'+_0x2c06a4)['json'](_0x342556);}return null;};}function patchUpdates(_0x552811){return function(_0x12e7be){try{jsonpatch['apply'](_0x12e7be,_0x552811,!![]);}catch(_0x298a75){return BPromise[_0xc9a8('0x1d')](_0x298a75);}return _0x12e7be['save']();};}function saveUpdates(_0x34b40d,_0x3ab23c){return function(_0x2ad423){if(_0x2ad423){return _0x2ad423[_0xc9a8('0x1e')](_0x34b40d)[_0xc9a8('0x1f')](function(_0x5dd020){return _0x5dd020;});}return null;};}function removeEntity(_0x4b43d8,_0xdda3e5){return function(_0x7d2858){if(_0x7d2858){return _0x7d2858['destroy']()[_0xc9a8('0x1f')](function(){var _0x163496=_0x7d2858[_0xc9a8('0x20')]({'plain':!![]});var _0x17fab8=_0xc9a8('0x21');return db[_0xc9a8('0x22')][_0xc9a8('0x23')]({'where':{'type':_0x17fab8,'resourceId':_0x163496['id']}})[_0xc9a8('0x1f')](function(){return _0x7d2858;});})[_0xc9a8('0x1f')](function(){_0x4b43d8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5455a7,_0x362913){return function(_0x4f5b50){if(!_0x4f5b50){_0x5455a7[_0xc9a8('0x15')](0x194);}return _0x4f5b50;};}function handleError(_0x596345,_0x55f609){_0x55f609=_0x55f609||0x1f4;return function(_0x5e7100){logger[_0xc9a8('0x24')](_0x5e7100[_0xc9a8('0x25')]);if(_0x5e7100[_0xc9a8('0x26')]){delete _0x5e7100[_0xc9a8('0x26')];}_0x596345[_0xc9a8('0x16')](_0x55f609)[_0xc9a8('0x27')](_0x5e7100);};}exports[_0xc9a8('0x28')]=function(_0x3f5e1c,_0x592f0f){var _0x2e3e1d={},_0x4a991c={},_0xf414df={'count':0x0,'rows':[]};var _0x20ddf3=_['map'](db[_0xc9a8('0x29')][_0xc9a8('0x2a')],function(_0x58bd4b){return{'name':_0x58bd4b[_0xc9a8('0x2b')],'type':_0x58bd4b[_0xc9a8('0x2c')][_0xc9a8('0x2d')]};});_0x4a991c[_0xc9a8('0x2e')]=_[_0xc9a8('0x2f')](_0x20ddf3,_0xc9a8('0x26'));_0x4a991c[_0xc9a8('0x30')]=_[_0xc9a8('0x31')](_0x3f5e1c['query']);_0x4a991c[_0xc9a8('0x32')]=_[_0xc9a8('0x33')](_0x4a991c['model'],_0x4a991c[_0xc9a8('0x30')]);_0x2e3e1d[_0xc9a8('0x34')]=_[_0xc9a8('0x33')](_0x4a991c[_0xc9a8('0x2e')],qs['fields'](_0x3f5e1c[_0xc9a8('0x30')][_0xc9a8('0x35')]));_0x2e3e1d[_0xc9a8('0x34')]=_0x2e3e1d[_0xc9a8('0x34')][_0xc9a8('0x36')]?_0x2e3e1d['attributes']:_0x4a991c[_0xc9a8('0x2e')];if(!_0x3f5e1c[_0xc9a8('0x30')][_0xc9a8('0x37')](_0xc9a8('0x38'))){_0x2e3e1d[_0xc9a8('0x1b')]=qs[_0xc9a8('0x1b')](_0x3f5e1c['query']['limit']);_0x2e3e1d[_0xc9a8('0x19')]=qs[_0xc9a8('0x19')](_0x3f5e1c['query'][_0xc9a8('0x19')]);}_0x2e3e1d[_0xc9a8('0x39')]=qs[_0xc9a8('0x3a')](_0x3f5e1c[_0xc9a8('0x30')]['sort']);_0x2e3e1d[_0xc9a8('0x3b')]=qs['filters'](_[_0xc9a8('0x3c')](_0x3f5e1c[_0xc9a8('0x30')],_0x4a991c[_0xc9a8('0x32')]),_0x20ddf3);if(_0x3f5e1c[_0xc9a8('0x30')][_0xc9a8('0x3d')]){_0x2e3e1d[_0xc9a8('0x3b')]=_[_0xc9a8('0x3e')](_0x2e3e1d['where'],{'$or':_[_0xc9a8('0x2f')](_0x20ddf3,function(_0x2ebc2b){if(_0x2ebc2b[_0xc9a8('0x2c')]!=='VIRTUAL'){var _0x1287aa={};_0x1287aa[_0x2ebc2b[_0xc9a8('0x26')]]={'$like':'%'+_0x3f5e1c[_0xc9a8('0x30')][_0xc9a8('0x3d')]+'%'};return _0x1287aa;}})});}_0x2e3e1d=_[_0xc9a8('0x3e')]({},_0x2e3e1d,_0x3f5e1c[_0xc9a8('0x3f')]);var _0x5766ae={'where':_0x2e3e1d[_0xc9a8('0x3b')]};return db[_0xc9a8('0x29')][_0xc9a8('0x40')](_0x5766ae)['then'](function(_0x18f644){_0xf414df[_0xc9a8('0x40')]=_0x18f644;if(_0x3f5e1c[_0xc9a8('0x30')]['includeAll']){_0x2e3e1d[_0xc9a8('0x41')]=[{'all':!![]}];}return db['Pause'][_0xc9a8('0x42')](_0x2e3e1d);})[_0xc9a8('0x1f')](function(_0x4a2a7b){_0xf414df[_0xc9a8('0x43')]=_0x4a2a7b;return _0xf414df;})['then'](respondWithFilteredResult(_0x592f0f,_0x2e3e1d))[_0xc9a8('0x44')](handleError(_0x592f0f,null));};exports[_0xc9a8('0x45')]=function(_0x3e8f38,_0x1c0c7c){var _0x193b19={'raw':!![],'where':{'id':_0x3e8f38[_0xc9a8('0x46')]['id']}},_0x44e327={};_0x44e327[_0xc9a8('0x2e')]=_[_0xc9a8('0x31')](db['Pause'][_0xc9a8('0x2a')]);_0x44e327['query']=_[_0xc9a8('0x31')](_0x3e8f38[_0xc9a8('0x30')]);_0x44e327['filters']=_[_0xc9a8('0x33')](_0x44e327[_0xc9a8('0x2e')],_0x44e327['query']);_0x193b19[_0xc9a8('0x34')]=_[_0xc9a8('0x33')](_0x44e327[_0xc9a8('0x2e')],qs[_0xc9a8('0x35')](_0x3e8f38[_0xc9a8('0x30')][_0xc9a8('0x35')]));_0x193b19['attributes']=_0x193b19['attributes']['length']?_0x193b19[_0xc9a8('0x34')]:_0x44e327[_0xc9a8('0x2e')];if(_0x3e8f38[_0xc9a8('0x30')][_0xc9a8('0x47')]){_0x193b19[_0xc9a8('0x41')]=[{'all':!![]}];}_0x193b19=_[_0xc9a8('0x3e')]({},_0x193b19,_0x3e8f38[_0xc9a8('0x3f')]);return db[_0xc9a8('0x29')][_0xc9a8('0x48')](_0x193b19)[_0xc9a8('0x1f')](handleEntityNotFound(_0x1c0c7c,null))['then'](respondWithResult(_0x1c0c7c,null))[_0xc9a8('0x44')](handleError(_0x1c0c7c,null));};exports[_0xc9a8('0x49')]=function(_0x47a702,_0x3bfb4c){return db[_0xc9a8('0x29')][_0xc9a8('0x49')](_0x47a702['body'],{})[_0xc9a8('0x1f')](function(_0x400a84){var _0x16657c=_0x47a702[_0xc9a8('0x4a')][_0xc9a8('0x20')]({'plain':!![]});if(!_0x16657c)throw new Error(_0xc9a8('0x4b'));if(_0x16657c[_0xc9a8('0x4c')]===_0xc9a8('0x4a')){var _0x6261b4=_0x400a84['get']({'plain':!![]});var _0x13464c=_0xc9a8('0x21');return db[_0xc9a8('0x4d')][_0xc9a8('0x48')]({'where':{'name':_0x13464c,'userProfileId':_0x16657c['userProfileId']},'raw':!![]})[_0xc9a8('0x1f')](function(_0x335a8c){if(_0x335a8c&&_0x335a8c[_0xc9a8('0x4e')]===0x0){return db[_0xc9a8('0x22')]['create']({'name':_0x6261b4['name'],'resourceId':_0x6261b4['id'],'type':_0x335a8c[_0xc9a8('0x26')],'sectionId':_0x335a8c['id']},{})[_0xc9a8('0x1f')](function(){return _0x400a84;});}else{return _0x400a84;}})[_0xc9a8('0x44')](function(_0x1627ea){logger['error'](_0xc9a8('0x4f'),_0x1627ea);throw _0x1627ea;});}return _0x400a84;})[_0xc9a8('0x1f')](respondWithResult(_0x3bfb4c,0xc9))[_0xc9a8('0x44')](handleError(_0x3bfb4c,null));};exports[_0xc9a8('0x1e')]=function(_0x1965ac,_0x3a7cca){if(_0x1965ac[_0xc9a8('0x50')]['id']){delete _0x1965ac[_0xc9a8('0x50')]['id'];}return db[_0xc9a8('0x29')][_0xc9a8('0x48')]({'where':{'id':_0x1965ac[_0xc9a8('0x46')]['id']}})[_0xc9a8('0x1f')](handleEntityNotFound(_0x3a7cca,null))[_0xc9a8('0x1f')](saveUpdates(_0x1965ac[_0xc9a8('0x50')],null))[_0xc9a8('0x1f')](respondWithResult(_0x3a7cca,null))[_0xc9a8('0x44')](handleError(_0x3a7cca,null));};exports[_0xc9a8('0x23')]=function(_0xb410a7,_0x39b65e){return db[_0xc9a8('0x29')][_0xc9a8('0x48')]({'where':{'id':_0xb410a7[_0xc9a8('0x46')]['id']}})[_0xc9a8('0x1f')](handleEntityNotFound(_0x39b65e,null))[_0xc9a8('0x1f')](removeEntity(_0x39b65e,null))[_0xc9a8('0x44')](handleError(_0x39b65e,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index e7cb1ed..a18f164 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 _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x16dc2f,_0x4c9a15){var _0x3eb083=function(_0x342af4){while(--_0x342af4){_0x16dc2f['push'](_0x16dc2f['shift']());}};_0x3eb083(++_0x4c9a15);}(_0x1cb9,0x14e));var _0x91cb=function(_0x55e5e2,_0x2d427b){_0x55e5e2=_0x55e5e2-0x0;var _0x10d938=_0x1cb9[_0x55e5e2];return _0x10d938;};'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':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x4f640b,_0x4d5b33){var _0x6c0f0e=function(_0x200f27){while(--_0x200f27){_0x4f640b['push'](_0x4f640b['shift']());}};_0x6c0f0e(++_0x4d5b33);}(_0x326f,0xd1));var _0xf326=function(_0x45a649,_0x598a82){_0x45a649=_0x45a649-0x0;var _0x3bb99b=_0x326f[_0x45a649];return _0x3bb99b;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 5b1dbd5..0684992 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(_0x28ecc3,_0x5eac50){var _0x3fcec2=function(_0x266066){while(--_0x266066){_0x28ecc3['push'](_0x28ecc3['shift']());}};_0x3fcec2(++_0x5eac50);}(_0x7a54,0x106));var _0x47a5=function(_0x5d3114,_0x2acdf4){_0x5d3114=_0x5d3114-0x0;var _0x3b2bd7=_0x7a54[_0x5d3114];return _0x3b2bd7;};'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(_0x9c8be3,_0x2e3b5c){var _0x402af1=function(_0x580ec8){while(--_0x580ec8){_0x9c8be3['push'](_0x9c8be3['shift']());}};_0x402af1(++_0x2e3b5c);}(_0xb10b,0x12a));var _0xbb10=function(_0x44f280,_0x4a1dad){_0x44f280=_0x44f280-0x0;var _0x4ee19d=_0xb10b[_0x44f280];return _0x4ee19d;};'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 dd921ad..198be68 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 _0x3e74=['originalname','format','%s-%s%s','basename','now','extname','file','upload','post','put','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','download','diskStorage','join','root'];(function(_0x3f6b85,_0x5f4450){var _0x2ea993=function(_0x2954d2){while(--_0x2954d2){_0x3f6b85['push'](_0x3f6b85['shift']());}};_0x2ea993(++_0x5f4450);}(_0x3e74,0x175));var _0x43e7=function(_0x5cb744,_0x32fdc3){_0x5cb744=_0x5cb744-0x0;var _0x4532bc=_0x3e74[_0x5cb744];return _0x4532bc;};'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'),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['show']);router[_0x43e7('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x43e7('0xd')]);var upload=multer({'storage':multer[_0x43e7('0xe')]({'destination':function(_0x5c34f4,_0x2803d9,_0x513707){_0x513707(null,path[_0x43e7('0xf')](config[_0x43e7('0x10')],'server/files/plugins'));},'filename':function(_0x3eb206,_0xc960ea,_0x2718d3){_0xc960ea[_0x43e7('0x11')]=_0xc960ea['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2718d3(null,util[_0x43e7('0x12')](_0x43e7('0x13'),path[_0x43e7('0x14')](_0xc960ea['originalname'],path['extname'](_0xc960ea[_0x43e7('0x11')])),Date[_0x43e7('0x15')](),path[_0x43e7('0x16')](_0xc960ea[_0x43e7('0x11')])));}})});router['post']('/',upload['single'](_0x43e7('0x17')),controller[_0x43e7('0x18')]);router[_0x43e7('0x19')]('/webhook',controller['webhookPost']);router[_0x43e7('0x1a')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x1b')]);router[_0x43e7('0x1c')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x1c')]);module[_0x43e7('0x1d')]=router; \ No newline at end of file +var _0x303a=['show','/:id/download','download','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','/:id','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook'];(function(_0x2b0875,_0x21ff12){var _0xedb8d7=function(_0x33ebf6){while(--_0x33ebf6){_0x2b0875['push'](_0x2b0875['shift']());}};_0xedb8d7(++_0x21ff12);}(_0x303a,0x1a0));var _0xa303=function(_0x17f9f4,_0x212dda){_0x17f9f4=_0x17f9f4-0x0;var _0x4dc32c=_0x303a[_0x17f9f4];return _0x4dc32c;};'use strict';var multer=require(_0xa303('0x0'));var util=require('util');var path=require(_0xa303('0x1'));var timeout=require(_0xa303('0x2'));var express=require(_0xa303('0x3'));var router=express[_0xa303('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa303('0x5'));var interaction=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var controller=require(_0xa303('0x8'));router[_0xa303('0x9')]('/',auth[_0xa303('0xa')](),controller[_0xa303('0xb')]);router[_0xa303('0x9')](_0xa303('0xc'),controller['webhookGet']);router['get']('/:id',auth[_0xa303('0xa')](),controller[_0xa303('0xd')]);router['get'](_0xa303('0xe'),auth['isAuthenticated'](),controller[_0xa303('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x29cd60,_0x17dfcd,_0x382cfd){_0x382cfd(null,path[_0xa303('0x10')](config['root'],_0xa303('0x11')));},'filename':function(_0x4c0169,_0xf5df1e,_0x43a054){_0xf5df1e[_0xa303('0x12')]=_0xf5df1e['originalname'][_0xa303('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x43a054(null,util[_0xa303('0x14')](_0xa303('0x15'),path[_0xa303('0x16')](_0xf5df1e[_0xa303('0x12')],path[_0xa303('0x17')](_0xf5df1e[_0xa303('0x12')])),Date[_0xa303('0x18')](),path['extname'](_0xf5df1e[_0xa303('0x12')])));}})});router[_0xa303('0x19')]('/',upload[_0xa303('0x1a')](_0xa303('0x1b')),controller[_0xa303('0x1c')]);router[_0xa303('0x19')]('/webhook',controller[_0xa303('0x1d')]);router['put'](_0xa303('0x1e'),auth['isAuthenticated'](),controller[_0xa303('0x1f')]);router['delete'](_0xa303('0x1e'),auth[_0xa303('0xa')](),controller[_0xa303('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index d40c9a7..570d6ac 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 _0xfe98=['adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','html','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x470bfb,_0x389787){var _0x2f5d97=function(_0x3431b4){while(--_0x3431b4){_0x470bfb['push'](_0x470bfb['shift']());}};_0x2f5d97(++_0x389787);}(_0xfe98,0x1c0));var _0x8fe9=function(_0xfc0976,_0x33776f){_0xfc0976=_0xfc0976-0x0;var _0x23579f=_0xfe98[_0xfc0976];return _0x23579f;};'use strict';var Sequelize=require(_0x8fe9('0x0'));module[_0x8fe9('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8fe9('0x2')](_0x8fe9('0x3'),'script')},'description':{'type':Sequelize[_0x8fe9('0x4')]},'version':{'type':Sequelize[_0x8fe9('0x4')]},'path':{'type':Sequelize[_0x8fe9('0x5')],'comment':_0x8fe9('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8fe9('0x7')},'sidebar':{'type':Sequelize[_0x8fe9('0x2')](_0x8fe9('0x8'),_0x8fe9('0x9'),'always','never'),'defaultValue':_0x8fe9('0xa'),'comment':_0x8fe9('0xb')},'icon':{'type':Sequelize[_0x8fe9('0x5')]},'adminUrl':{'type':Sequelize[_0x8fe9('0x5')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x8fe9('0x5')]},'scriptPath':{'type':Sequelize[_0x8fe9('0x5')]}}; \ No newline at end of file +var _0xaeb7=['adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xaeb7,0xad));var _0x7aeb=function(_0x5093a3,_0x54dd5b){_0x5093a3=_0x5093a3-0x0;var _0x42b05c=_0xaeb7[_0x5093a3];return _0x42b05c;};'use strict';var Sequelize=require(_0x7aeb('0x0'));module[_0x7aeb('0x1')]={'name':{'type':Sequelize[_0x7aeb('0x2')]},'type':{'type':Sequelize[_0x7aeb('0x3')](_0x7aeb('0x4'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x7aeb('0x5')]},'path':{'type':Sequelize[_0x7aeb('0x2')],'comment':_0x7aeb('0x6')},'active':{'type':Sequelize[_0x7aeb('0x7')],'defaultValue':0x0,'comment':_0x7aeb('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0x7aeb('0x9'),_0x7aeb('0xa'),_0x7aeb('0xb'),_0x7aeb('0xc')),'defaultValue':_0x7aeb('0xb'),'comment':_0x7aeb('0xd')},'icon':{'type':Sequelize[_0x7aeb('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x7aeb('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 954383b..d35e1f8 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 _0x1eeb=['Invalid\x20manifest:\x20views\x20missing','views','admin','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','body','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','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','lodash','squel','crypto','desk.js','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','json','save','update','then','destroy','Plugins','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','Plugin','findAll','rows','catch','params','length','find','join','root','server/files/plugins','format','%s.zip','createWriteStream','zip','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','basename','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','download','unlinkSync','info','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing'];(function(_0x26cd0d,_0x5ef493){var _0x38ec81=function(_0x1d6c25){while(--_0x1d6c25){_0x26cd0d['push'](_0x26cd0d['shift']());}};_0x38ec81(++_0x5ef493);}(_0x1eeb,0xd1));var _0xb1ee=function(_0x4fab79,_0x4f76dc){_0x4fab79=_0x4fab79-0x0;var _0x31ec8e=_0x1eeb[_0x4fab79];return _0x31ec8e;};'use strict';var emlformat=require(_0xb1ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb1ee('0x1'));var jsonpatch=require(_0xb1ee('0x2'));var rp=require('request-promise');var moment=require(_0xb1ee('0x3'));var BPromise=require(_0xb1ee('0x4'));var Mustache=require(_0xb1ee('0x5'));var util=require(_0xb1ee('0x6'));var path=require(_0xb1ee('0x7'));var sox=require(_0xb1ee('0x8'));var csv=require(_0xb1ee('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb1ee('0xa'));var squel=require(_0xb1ee('0xb'));var crypto=require(_0xb1ee('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb1ee('0xd'));var toCsv=require(_0xb1ee('0x9'));var querystring=require(_0xb1ee('0xe'));var Papa=require(_0xb1ee('0xf'));var extract=require(_0xb1ee('0x10'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0xb1ee('0x11'));var authService=require(_0xb1ee('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb1ee('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb1ee('0x14'));var config=require(_0xb1ee('0x15'));var licenseUtil=require(_0xb1ee('0x16'));var db=require(_0xb1ee('0x17'))['db'];config[_0xb1ee('0x18')]=_[_0xb1ee('0x19')](config[_0xb1ee('0x18')],{'host':_0xb1ee('0x1a'),'port':0x18eb});var socket=require(_0xb1ee('0x1b'))(new Redis(config['redis']));require(_0xb1ee('0x1c'))[_0xb1ee('0x1d')](socket);function respondWithStatusCode(_0x3d8a69,_0x42a32d){_0x42a32d=_0x42a32d||0xcc;return function(_0xab3181){if(_0xab3181){return _0x3d8a69[_0xb1ee('0x1e')](_0x42a32d);}return _0x3d8a69[_0xb1ee('0x1f')](_0x42a32d)[_0xb1ee('0x20')]();};}function respondWithResult(_0x266a52,_0x213806){_0x213806=_0x213806||0xc8;return function(_0x1f6dbf){if(_0x1f6dbf){return _0x266a52[_0xb1ee('0x1f')](_0x213806)['json'](_0x1f6dbf);}};}function respondWithFilteredResult(_0x4ff437,_0x512ecc){return function(_0x561eff){if(_0x561eff){var _0x5c0be0=typeof _0x512ecc[_0xb1ee('0x21')]==='undefined'&&typeof _0x512ecc[_0xb1ee('0x22')]===_0xb1ee('0x23');var _0x481794=_0x561eff[_0xb1ee('0x24')];var _0x2331e7=_0x5c0be0?0x0:_0x512ecc['offset'];var _0x84cd9a=_0x5c0be0?_0x561eff[_0xb1ee('0x24')]:_0x512ecc[_0xb1ee('0x21')]+_0x512ecc[_0xb1ee('0x22')];var _0x10b7dd;if(_0x84cd9a>=_0x481794){_0x84cd9a=_0x481794;_0x10b7dd=0xc8;}else{_0x10b7dd=0xce;}_0x4ff437[_0xb1ee('0x1f')](_0x10b7dd);return _0x4ff437[_0xb1ee('0x25')]('Content-Range',_0x2331e7+'-'+_0x84cd9a+'/'+_0x481794)[_0xb1ee('0x26')](_0x561eff);}return null;};}function patchUpdates(_0x4c5df8){return function(_0x43cd07){try{jsonpatch['apply'](_0x43cd07,_0x4c5df8,!![]);}catch(_0x288c44){return BPromise['reject'](_0x288c44);}return _0x43cd07[_0xb1ee('0x27')]();};}function saveUpdates(_0x8683dd,_0x6f1758){return function(_0x2a3280){if(_0x2a3280){return _0x2a3280[_0xb1ee('0x28')](_0x8683dd)[_0xb1ee('0x29')](function(_0x1c452b){return _0x1c452b;});}return null;};}function removeEntity(_0x5b5aa0,_0x508e88){return function(_0x52e971){if(_0x52e971){return _0x52e971[_0xb1ee('0x2a')]()[_0xb1ee('0x29')](function(){var _0xf5f922=_0x52e971['get']({'plain':!![]});var _0xe13fce=_0xb1ee('0x2b');return db[_0xb1ee('0x2c')]['destroy']({'where':{'type':_0xe13fce,'resourceId':_0xf5f922['id']}})[_0xb1ee('0x29')](function(){return _0x52e971;});})[_0xb1ee('0x29')](function(){_0x5b5aa0[_0xb1ee('0x1f')](0xcc)[_0xb1ee('0x20')]();});}};}function handleEntityNotFound(_0x1d5949,_0x498854){return function(_0x406472){if(!_0x406472){_0x1d5949['sendStatus'](0x194);}return _0x406472;};}function handleError(_0x25c4b3,_0x188f36){_0x188f36=_0x188f36||0x1f4;return function(_0x19a04a){logger[_0xb1ee('0x2d')](_0x19a04a[_0xb1ee('0x2e')]);if(_0x19a04a[_0xb1ee('0x2f')]){delete _0x19a04a[_0xb1ee('0x2f')];}_0x25c4b3[_0xb1ee('0x1f')](_0x188f36)['send'](_0x19a04a);};}exports['index']=function(_0x1df419,_0xbe4102){var _0xf9252e={},_0x4478d2={},_0x1130c6={'count':0x0,'rows':[]};var _0x16c53c=_[_0xb1ee('0x30')](db['Plugin'][_0xb1ee('0x31')],function(_0x29cfe7){return{'name':_0x29cfe7[_0xb1ee('0x32')],'type':_0x29cfe7[_0xb1ee('0x33')]['key']};});_0x4478d2[_0xb1ee('0x34')]=_[_0xb1ee('0x30')](_0x16c53c,_0xb1ee('0x2f'));_0x4478d2[_0xb1ee('0x35')]=_[_0xb1ee('0x36')](_0x1df419[_0xb1ee('0x35')]);_0x4478d2[_0xb1ee('0x37')]=_[_0xb1ee('0x38')](_0x4478d2['model'],_0x4478d2['query']);_0xf9252e[_0xb1ee('0x39')]=_[_0xb1ee('0x38')](_0x4478d2['model'],qs[_0xb1ee('0x3a')](_0x1df419[_0xb1ee('0x35')]['fields']));_0xf9252e[_0xb1ee('0x39')]=_0xf9252e[_0xb1ee('0x39')]['length']?_0xf9252e['attributes']:_0x4478d2['model'];if(!_0x1df419[_0xb1ee('0x35')][_0xb1ee('0x3b')]('nolimit')){_0xf9252e[_0xb1ee('0x22')]=qs[_0xb1ee('0x22')](_0x1df419[_0xb1ee('0x35')][_0xb1ee('0x22')]);_0xf9252e['offset']=qs['offset'](_0x1df419[_0xb1ee('0x35')]['offset']);}_0xf9252e['order']=qs['sort'](_0x1df419[_0xb1ee('0x35')][_0xb1ee('0x3c')]);_0xf9252e[_0xb1ee('0x3d')]=qs[_0xb1ee('0x37')](_['pick'](_0x1df419[_0xb1ee('0x35')],_0x4478d2[_0xb1ee('0x37')]),_0x16c53c);if(_0x1df419[_0xb1ee('0x35')][_0xb1ee('0x3e')]){_0xf9252e[_0xb1ee('0x3d')]=_[_0xb1ee('0x3f')](_0xf9252e[_0xb1ee('0x3d')],{'$or':_['map'](_0x16c53c,function(_0x31c22a){if(_0x31c22a[_0xb1ee('0x33')]!==_0xb1ee('0x40')){var _0x50d32e={};_0x50d32e[_0x31c22a[_0xb1ee('0x2f')]]={'$like':'%'+_0x1df419[_0xb1ee('0x35')][_0xb1ee('0x3e')]+'%'};return _0x50d32e;}})});}_0xf9252e=_[_0xb1ee('0x3f')]({},_0xf9252e,_0x1df419[_0xb1ee('0x41')]);var _0x567a63={'where':_0xf9252e[_0xb1ee('0x3d')]};return db['Plugin'][_0xb1ee('0x24')](_0x567a63)[_0xb1ee('0x29')](function(_0x19fafd){_0x1130c6[_0xb1ee('0x24')]=_0x19fafd;if(_0x1df419[_0xb1ee('0x35')][_0xb1ee('0x42')]){_0xf9252e[_0xb1ee('0x43')]=[{'all':!![]}];}return db[_0xb1ee('0x44')][_0xb1ee('0x45')](_0xf9252e);})['then'](function(_0x4988e0){_0x1130c6[_0xb1ee('0x46')]=_0x4988e0;return _0x1130c6;})[_0xb1ee('0x29')](respondWithFilteredResult(_0xbe4102,_0xf9252e))[_0xb1ee('0x47')](handleError(_0xbe4102,null));};exports['show']=function(_0x38fdb7,_0x71ff48){var _0x3081db={'raw':!![],'where':{'id':_0x38fdb7[_0xb1ee('0x48')]['id']}},_0x316dc6={};_0x316dc6['model']=_[_0xb1ee('0x36')](db[_0xb1ee('0x44')][_0xb1ee('0x31')]);_0x316dc6[_0xb1ee('0x35')]=_[_0xb1ee('0x36')](_0x38fdb7[_0xb1ee('0x35')]);_0x316dc6[_0xb1ee('0x37')]=_['intersection'](_0x316dc6[_0xb1ee('0x34')],_0x316dc6[_0xb1ee('0x35')]);_0x3081db['attributes']=_[_0xb1ee('0x38')](_0x316dc6[_0xb1ee('0x34')],qs[_0xb1ee('0x3a')](_0x38fdb7['query'][_0xb1ee('0x3a')]));_0x3081db['attributes']=_0x3081db['attributes'][_0xb1ee('0x49')]?_0x3081db['attributes']:_0x316dc6[_0xb1ee('0x34')];if(_0x38fdb7['query']['includeAll']){_0x3081db['include']=[{'all':!![]}];}_0x3081db=_[_0xb1ee('0x3f')]({},_0x3081db,_0x38fdb7['options']);return db[_0xb1ee('0x44')][_0xb1ee('0x4a')](_0x3081db)[_0xb1ee('0x29')](handleEntityNotFound(_0x71ff48,null))['then'](respondWithResult(_0x71ff48,null))[_0xb1ee('0x47')](handleError(_0x71ff48,null));};exports['download']=function(_0x558628,_0x29fd8c,_0x2d5f1e){return db['Plugin'][_0xb1ee('0x4a')]({'where':{'id':_0x558628[_0xb1ee('0x48')]['id']},'attributes':[_0xb1ee('0x2f'),_0xb1ee('0x7')],'raw':!![]})[_0xb1ee('0x29')](handleEntityNotFound(_0x29fd8c,null))[_0xb1ee('0x29')](function(_0x3330e2){if(_0x3330e2){var _0x459955=path[_0xb1ee('0x4b')](config[_0xb1ee('0x4c')],_0xb1ee('0x4d'),util[_0xb1ee('0x4e')](_0xb1ee('0x4f'),path['basename'](_0x3330e2[_0xb1ee('0x7')])));var _0x3e7175=fs[_0xb1ee('0x50')](_0x459955);var _0x39bac2=archiver(_0xb1ee('0x51'),{'zlib':{'level':0x9}});_0x39bac2['on']('warning',function(_0x15dd2d){if(_0x15dd2d[_0xb1ee('0x52')]==='ENOENT'){logger[_0xb1ee('0x2d')](_0x15dd2d);}else{throw new db[(_0xb1ee('0x53'))][(_0xb1ee('0x54'))](_0xb1ee('0x55'));}});_0x39bac2['on']('error',function(_0x37f8fb){throw new db[(_0xb1ee('0x53'))][(_0xb1ee('0x54'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x39bac2['pipe'](_0x3e7175);_0x39bac2[_0xb1ee('0x56')](_0xb1ee('0x57'),{'cwd':path['join'](config[_0xb1ee('0x4c')],_0xb1ee('0x4d'),path['dirname'](_0x3330e2[_0xb1ee('0x7')])),'ignore':[path[_0xb1ee('0x4b')](path[_0xb1ee('0x58')](_0x3330e2[_0xb1ee('0x7')]),_0xb1ee('0x59')),path[_0xb1ee('0x4b')](path[_0xb1ee('0x58')](_0x3330e2[_0xb1ee('0x7')]),_0xb1ee('0x5a'))],'nodir':!![]})['finalize']();_0x3e7175['on'](_0xb1ee('0x5b'),function(){if(!fs[_0xb1ee('0x5c')](_0x459955)){throw new db[(_0xb1ee('0x53'))][(_0xb1ee('0x54'))](_0xb1ee('0x5d'));}return _0x29fd8c[_0xb1ee('0x5e')](_0x459955,util[_0xb1ee('0x4e')](_0xb1ee('0x4f'),path[_0xb1ee('0x58')](_0x3330e2[_0xb1ee('0x7')])),function(_0x4c9557){if(_0x4c9557){throw new db[(_0xb1ee('0x53'))][(_0xb1ee('0x54'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xb1ee('0x5f')](_0x459955);logger[_0xb1ee('0x60')]('Download\x20completed');logger['info']('Temporary\x20file\x20removed');});});}return null;})[_0xb1ee('0x47')](handleError(_0x29fd8c,null));};exports[_0xb1ee('0x61')]=function(_0x128875,_0x30b3a7,_0x40cd93){var _0x17a781=path[_0xb1ee('0x58')](_0x128875[_0xb1ee('0x62')][_0xb1ee('0x63')],path[_0xb1ee('0x64')](_0x128875['file'][_0xb1ee('0x63')]));var _0x38e5b4=path[_0xb1ee('0x4b')](config[_0xb1ee('0x4c')],_0xb1ee('0x4d'),_0x128875[_0xb1ee('0x62')][_0xb1ee('0x63')]);var _0x2cce2f=path[_0xb1ee('0x4b')](config['root'],_0xb1ee('0x4d'),_0x17a781);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x38e5b4);logger['info'](_0xb1ee('0x65'),_0x2cce2f);try{fs[_0xb1ee('0x66')](_0x38e5b4,parseInt('0777',0x8));extract(_0x38e5b4,{'dir':_0x2cce2f},function(_0x38a0c3){if(_0x38a0c3){logger[_0xb1ee('0x2d')](_0x38a0c3);handleError(_0x38a0c3,!![]);};var _0x45fd95=fs[_0xb1ee('0x67')](_0x2cce2f);if(_0x45fd95[_0xb1ee('0x49')]>0x1){removeReferences(_0x38e5b4,_0x2cce2f);logger[_0xb1ee('0x2d')](_0xb1ee('0x68'));return _0x40cd93(new Error(_0xb1ee('0x68')));}var _0x550ffb=fs[_0xb1ee('0x69')](path[_0xb1ee('0x4b')](_0x2cce2f,_0x45fd95[0x0]));if(_0x550ffb[_0xb1ee('0x6a')]()){removeReferences(_0x38e5b4,_0x2cce2f);logger[_0xb1ee('0x2d')](_0xb1ee('0x68'));return _0x40cd93(new Error(_0xb1ee('0x68')));}if(_0x550ffb[_0xb1ee('0x6b')]()){var _0x1bdee7=fs[_0xb1ee('0x67')](path[_0xb1ee('0x4b')](_0x2cce2f,_0x45fd95[0x0]));if(_0x1bdee7['length']===0x0){removeReferences(_0x38e5b4,_0x2cce2f);logger[_0xb1ee('0x2d')](_0xb1ee('0x68'));return _0x40cd93(new Error('Invalid\x20plugin\x20structure'));}var _0x2ae2b7=_0x1bdee7[_0xb1ee('0x6c')](function(_0x91e227){return _0x91e227===_0xb1ee('0x6d');});if(!_0x2ae2b7){return _0x40cd93(new Error('Plugin\x20manifest\x20missing'));}var _0x214dc8=fs[_0xb1ee('0x6e')](path[_0xb1ee('0x4b')](_0x2cce2f,_0x45fd95[0x0],_0xb1ee('0x6d')));var _0x2e45e6=JSON['parse'](_0x214dc8);if(_0xb1ee('0x23')==typeof _0x2e45e6[_0xb1ee('0x2f')]){return _0x40cd93(new Error(_0xb1ee('0x6f')));}if(_0xb1ee('0x23')==typeof _0x2e45e6['type']){return _0x40cd93(new Error(_0xb1ee('0x70')));}if('undefined'==typeof _0x2e45e6[_0xb1ee('0x71')]){return _0x40cd93(new Error(_0xb1ee('0x72')));}if(_0xb1ee('0x23')==typeof _0x2e45e6[_0xb1ee('0x73')]){return _0x40cd93(new Error(_0xb1ee('0x74')));}if(_0x2e45e6[_0xb1ee('0x33')]==='html'){if(_0xb1ee('0x23')==typeof _0x2e45e6[_0xb1ee('0x73')]['views']){return _0x40cd93(new Error(_0xb1ee('0x75')));}if(_0xb1ee('0x23')==typeof _0x2e45e6['parameters'][_0xb1ee('0x76')][_0xb1ee('0x77')]&&_0xb1ee('0x23')==typeof _0x2e45e6['parameters'][_0xb1ee('0x76')]['agent']){return _0x40cd93(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x2e45e6[_0xb1ee('0x33')]===_0xb1ee('0x78')){if(_0xb1ee('0x23')==typeof _0x2e45e6[_0xb1ee('0x73')][_0xb1ee('0x79')]){return _0x40cd93(new Error(_0xb1ee('0x7a')));}if(_0xb1ee('0x23')==typeof _0x2e45e6[_0xb1ee('0x73')]['scriptPath']){return _0x40cd93(new Error(_0xb1ee('0x7b')));}}else{return _0x40cd93(new Error(_0xb1ee('0x7c')));}var _0x2e891f=_0x2e45e6[_0xb1ee('0x2f')];var _0x14fc87=_0x2e45e6[_0xb1ee('0x7d')];var _0xf621f7=_0x2e45e6['type'];var _0x2cf6c7=_0x2e45e6[_0xb1ee('0x7e')]?_0x2e45e6[_0xb1ee('0x7e')]:_0xb1ee('0x7f');var _0x519029=_0x2e45e6['icon']?_0x2e45e6[_0xb1ee('0x80')]:_0xb1ee('0x81');var _0x1d95d8='';var _0x5b4625='';var _0xfea895='';var _0x375ceb='';var _0x52d5e7=_0x2e45e6[_0xb1ee('0x71')];if(_0xf621f7===_0xb1ee('0x82')){if(_0xb1ee('0x23')!=typeof _0x2e45e6['parameters'][_0xb1ee('0x76')][_0xb1ee('0x77')]){var _0x28bb4e=_0x2e45e6[_0xb1ee('0x73')][_0xb1ee('0x76')][_0xb1ee('0x77')];if(!/^(f|ht)tps?:\/\//i[_0xb1ee('0x83')](_0x28bb4e)){_0x1d95d8=path[_0xb1ee('0x4b')]('plugins',_0x17a781,_0x45fd95[0x0],_0x28bb4e);}else{_0x1d95d8=_0x28bb4e;}}else{logger['info'](_0xb1ee('0x84'));}if('undefined'!=typeof _0x2e45e6[_0xb1ee('0x73')]['views']['agent']){var _0x484643=_0x2e45e6[_0xb1ee('0x73')]['views'][_0xb1ee('0x85')];if(!/^(f|ht)tps?:\/\//i['test'](_0x484643)){_0x5b4625=path[_0xb1ee('0x4b')](_0xb1ee('0x86'),_0x17a781,_0x45fd95[0x0],_0x484643);}else{_0x5b4625=_0x484643;}}else{logger['info'](_0xb1ee('0x87'));}}else if(_0xf621f7===_0xb1ee('0x78')){_0xfea895=_0x2e45e6['parameters'][_0xb1ee('0x79')];_0x375ceb=_0x2e45e6[_0xb1ee('0x73')]['scriptPath'];if('undefined'!=typeof _0x2e45e6[_0xb1ee('0x73')][_0xb1ee('0x76')]){if(_0xb1ee('0x23')!=typeof _0x2e45e6[_0xb1ee('0x73')][_0xb1ee('0x76')][_0xb1ee('0x77')]){var _0x28bb4e=_0x2e45e6[_0xb1ee('0x73')][_0xb1ee('0x76')][_0xb1ee('0x77')];if(!/^(f|ht)tps?:\/\//i[_0xb1ee('0x83')](_0x28bb4e)){_0x1d95d8=path[_0xb1ee('0x4b')]('plugins',_0x17a781,_0x45fd95[0x0],_0x28bb4e);}else{_0x1d95d8=_0x28bb4e;}}if(_0xb1ee('0x23')!=typeof _0x2e45e6[_0xb1ee('0x73')][_0xb1ee('0x76')]['agent']){var _0x484643=_0x2e45e6['parameters'][_0xb1ee('0x76')][_0xb1ee('0x85')];if(!/^(f|ht)tps?:\/\//i[_0xb1ee('0x83')](_0x484643)){_0x5b4625=path[_0xb1ee('0x4b')](_0xb1ee('0x86'),_0x17a781,_0x45fd95[0x0],_0x484643);}else{_0x5b4625=_0x484643;}}}}var _0x101a59={'name':_0x2e891f,'description':_0x14fc87,'path':path[_0xb1ee('0x4b')](_0x17a781,_0x45fd95[0x0]),'type':_0xf621f7,'sidebar':_0x2cf6c7,'icon':_0x519029,'adminUrl':_0x1d95d8,'agentUrl':_0x5b4625,'scriptName':_0xfea895,'scriptPath':_0x375ceb,'version':_0x52d5e7};removeReferences(_0x38e5b4,null);return db[_0xb1ee('0x44')][_0xb1ee('0x88')](_0x101a59)['then'](function(_0x1700bb){var _0x1d9afb={'role':_0x128875['body']['role'],'userProfileId':_0x128875['body'][_0xb1ee('0x89')]};if(!_0x1d9afb)throw new Error(_0xb1ee('0x8a'));if(_0x1d9afb['role']==='user'){var _0x30bd77=_0x1700bb['get']({'plain':!![]});return db['UserProfileSection'][_0xb1ee('0x4a')]({'where':{'name':_0xb1ee('0x2b'),'userProfileId':_0x1d9afb[_0xb1ee('0x89')]},'raw':!![]})[_0xb1ee('0x29')](function(_0x15caca){if(_0x15caca&&_0x15caca[_0xb1ee('0x8b')]===0x0){return db[_0xb1ee('0x2c')][_0xb1ee('0x88')]({'name':_0x30bd77['name'],'resourceId':_0x30bd77['id'],'type':_0x15caca['name'],'sectionId':_0x15caca['id']},{})[_0xb1ee('0x29')](function(){return _0x1700bb;});}else{return _0x1700bb;}})[_0xb1ee('0x47')](function(_0x25d13f){logger['error'](_0xb1ee('0x8c'),_0x25d13f);throw _0x25d13f;});}return _0x1700bb;})[_0xb1ee('0x29')](respondWithResult(_0x30b3a7,null))[_0xb1ee('0x47')](handleError(_0x30b3a7,null));}});}catch(_0x381ec1){_0x30b3a7[_0xb1ee('0x1f')](0x1f4)[_0xb1ee('0x8d')](_0x381ec1);}};function removeReferences(_0x5c3ada,_0x395c19){try{if(_0x5c3ada){fs[_0xb1ee('0x5f')](_0x5c3ada);logger['info'](_0xb1ee('0x8e'));}if(_0x395c19){rimraf(_0x395c19,function(){});logger[_0xb1ee('0x60')](_0xb1ee('0x8f'));}}catch(_0x3b7a1c){logger['error'](_0x3b7a1c);}}exports[_0xb1ee('0x28')]=function(_0xa4dd8,_0x22d6d9,_0x1971a9){return db[_0xb1ee('0x44')][_0xb1ee('0x4a')]({'where':{'id':_0xa4dd8[_0xb1ee('0x48')]['id']}})['then'](handleEntityNotFound(_0x22d6d9,null))['then'](saveUpdates(_0xa4dd8[_0xb1ee('0x90')],null))[_0xb1ee('0x29')](respondWithResult(_0x22d6d9,null))[_0xb1ee('0x47')](handleError(_0x22d6d9,null));};exports[_0xb1ee('0x91')]=function(_0x14534d,_0x5b01d2,_0x219c90){return db[_0xb1ee('0x44')][_0xb1ee('0x4a')]({'where':{'id':_0x14534d['params']['id']}})['then'](function(_0x32b115){if(_0x32b115){return _0x32b115[_0xb1ee('0x2a')]();}})['then'](function(_0x7f340b){rimraf(path[_0xb1ee('0x4b')](config[_0xb1ee('0x4c')],_0xb1ee('0x4d'),path[_0xb1ee('0x92')](_0x7f340b[_0xb1ee('0x7')])),function(){});return _0x7f340b;})[_0xb1ee('0x29')](handleEntityNotFound(_0x5b01d2,null))[_0xb1ee('0x29')](respondWithStatusCode(_0x5b01d2,null))['catch'](handleError(_0x5b01d2,null));};exports[_0xb1ee('0x93')]=function(_0x160a58,_0x48ace3,_0x780cac){return BPromise[_0xb1ee('0x94')]()[_0xb1ee('0x29')](function(){if(!_0x160a58[_0xb1ee('0x35')]['path']){throw new Error(_0xb1ee('0x95'));}if(!_0x160a58['query']['port']){throw new Error(_0xb1ee('0x96'));}var _0x13274e=_0x160a58[_0xb1ee('0x35')][_0xb1ee('0x97')]?_0x160a58['query'][_0xb1ee('0x97')]+':'+_0x160a58[_0xb1ee('0x35')][_0xb1ee('0x98')]:_0xb1ee('0x99')+_0x160a58[_0xb1ee('0x35')][_0xb1ee('0x98')];var _0x4d66e0=_0x160a58[_0xb1ee('0x35')]['json']?_0x160a58[_0xb1ee('0x35')]['json']:!![];var _0x3a62e2=_0x160a58[_0xb1ee('0x35')]['encoding']?_0x160a58['query'][_0xb1ee('0x9a')]:null;var _0x2e33b0={'method':_0x160a58[_0xb1ee('0x9b')],'uri':util[_0xb1ee('0x4e')](_0xb1ee('0x9c'),_0x13274e,_0x160a58['query'][_0xb1ee('0x7')]),'json':_0x4d66e0,'resolveWithFullResponse':!![],'encoding':_0x3a62e2,'qs':_0x160a58[_0xb1ee('0x35')]};if(_0x160a58['headers']){_0x2e33b0['headers']=_0x160a58[_0xb1ee('0x9d')];if(_0x2e33b0[_0xb1ee('0x9d')][_0xb1ee('0x9e')]){delete _0x2e33b0[_0xb1ee('0x9d')][_0xb1ee('0x9e')];}}if(_0x2e33b0[_0xb1ee('0x9d')][_0xb1ee('0x9f')]){delete _0x2e33b0[_0xb1ee('0x9d')][_0xb1ee('0x9f')];}return rp(_0x2e33b0);})[_0xb1ee('0x29')](function(_0x1bbbd9){if(_0x1bbbd9){_0x48ace3['set'](_0x1bbbd9[_0xb1ee('0x9d')]);logger[_0xb1ee('0x60')](_0x1bbbd9[_0xb1ee('0x90')]);if(_[_0xb1ee('0xa0')](_0x160a58[_0xb1ee('0x35')][_0xb1ee('0x7')],'download')&&_0x1bbbd9[_0xb1ee('0xa1')]==0x1f4){return _0x48ace3['sendStatus'](_0x1bbbd9[_0xb1ee('0xa1')]);}else{return _0x48ace3[_0xb1ee('0x1f')](_0x1bbbd9[_0xb1ee('0xa1')])[_0xb1ee('0x8d')](_0x1bbbd9['body']);}}else{return _0x48ace3[_0xb1ee('0x1e')](0xc8);}})[_0xb1ee('0x47')](handleError(_0x48ace3,null));};exports[_0xb1ee('0xa2')]=function(_0x457d79,_0x2f1990,_0x299ba9){return BPromise[_0xb1ee('0x94')]()[_0xb1ee('0x29')](function(){if(!_0x457d79[_0xb1ee('0x35')][_0xb1ee('0x7')]){throw new Error(_0xb1ee('0x95'));}if(!_0x457d79[_0xb1ee('0x35')][_0xb1ee('0x98')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x27140f=_0x457d79[_0xb1ee('0x35')][_0xb1ee('0x97')]?_0x457d79[_0xb1ee('0x35')][_0xb1ee('0x97')]+':'+_0x457d79['query'][_0xb1ee('0x98')]:_0xb1ee('0x99')+_0x457d79[_0xb1ee('0x35')][_0xb1ee('0x98')];var _0x57f410=_0x457d79[_0xb1ee('0x35')][_0xb1ee('0x26')]?_0x457d79[_0xb1ee('0x35')][_0xb1ee('0x26')]:!![];var _0x3a4d63=_0x457d79[_0xb1ee('0x35')]['encoding']?_0x457d79[_0xb1ee('0x35')]['encoding']:null;var _0x48ae20={'method':_0x457d79[_0xb1ee('0x9b')],'uri':util[_0xb1ee('0x4e')]('%s%s',_0x27140f,_0x457d79[_0xb1ee('0x35')]['path']),'json':_0x57f410,'resolveWithFullResponse':!![],'encoding':_0x3a4d63,'body':_0x457d79[_0xb1ee('0x90')]};if(_0x457d79['headers']){_0x48ae20['headers']=_0x457d79[_0xb1ee('0x9d')];if(_0x48ae20[_0xb1ee('0x9d')][_0xb1ee('0x9e')]){delete _0x48ae20['headers'][_0xb1ee('0x9e')];}}if(_0x48ae20[_0xb1ee('0x9d')][_0xb1ee('0x9f')]){delete _0x48ae20[_0xb1ee('0x9d')]['content-type'];}return rp(_0x48ae20);})['then'](function(_0x752d38){if(_0x752d38){_0x2f1990[_0xb1ee('0x25')](_0x752d38[_0xb1ee('0x9d')]);logger[_0xb1ee('0x60')](_0x752d38[_0xb1ee('0x90')]);return _0x2f1990['status'](_0x752d38[_0xb1ee('0xa1')])[_0xb1ee('0x8d')](_0x752d38[_0xb1ee('0x90')]);}else{return _0x2f1990['sendStatus'](0xc8);}})[_0xb1ee('0x47')](handleError(_0x2f1990,null));}; \ No newline at end of file +var _0x455e=['undefined','limit','count','set','Content-Range','json','apply','save','then','get','Plugins','UserProfileResource','destroy','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','download','join','root','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','error','Sequelize','pipe','glob','**/*','node_modules/**/*','basename','finalize','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','scriptPath','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','status','webhookPost','http://localhost:','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','localhost','socket.io-emitter','redis','./plugin.socket','register','sendStatus','end','offset'];(function(_0x2f2377,_0x11cc21){var _0x441e6b=function(_0x1d0e90){while(--_0x1d0e90){_0x2f2377['push'](_0x2f2377['shift']());}};_0x441e6b(++_0x11cc21);}(_0x455e,0x8f));var _0xe455=function(_0x5cc0c8,_0x403e0e){_0x5cc0c8=_0x5cc0c8-0x0;var _0x3b3f67=_0x455e[_0x5cc0c8];return _0x3b3f67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe455('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe455('0x1'));var rp=require(_0xe455('0x2'));var moment=require(_0xe455('0x3'));var BPromise=require(_0xe455('0x4'));var Mustache=require(_0xe455('0x5'));var util=require('util');var path=require(_0xe455('0x6'));var sox=require('sox');var csv=require(_0xe455('0x7'));var ejs=require(_0xe455('0x8'));var fs=require('fs');var fs_extra=require(_0xe455('0x9'));var _=require(_0xe455('0xa'));var squel=require('squel');var crypto=require(_0xe455('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe455('0x7'));var querystring=require(_0xe455('0xc'));var Papa=require('papaparse');var extract=require(_0xe455('0xd'));var rimraf=require(_0xe455('0x0'));var archiver=require(_0xe455('0xe'));var Redis=require(_0xe455('0xf'));var authService=require(_0xe455('0x10'));var qs=require(_0xe455('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe455('0x12'));var logger=require(_0xe455('0x13'))(_0xe455('0x14'));var utils=require(_0xe455('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe455('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xe455('0x17'),'port':0x18eb});var socket=require(_0xe455('0x18'))(new Redis(config[_0xe455('0x19')]));require(_0xe455('0x1a'))[_0xe455('0x1b')](socket);function respondWithStatusCode(_0x5b97a4,_0x42911b){_0x42911b=_0x42911b||0xcc;return function(_0x5159ff){if(_0x5159ff){return _0x5b97a4[_0xe455('0x1c')](_0x42911b);}return _0x5b97a4['status'](_0x42911b)[_0xe455('0x1d')]();};}function respondWithResult(_0xbc85e7,_0xb0175c){_0xb0175c=_0xb0175c||0xc8;return function(_0x15ebf4){if(_0x15ebf4){return _0xbc85e7['status'](_0xb0175c)['json'](_0x15ebf4);}};}function respondWithFilteredResult(_0x5bac47,_0x2c260a){return function(_0xad5b39){if(_0xad5b39){var _0x21a5b8=typeof _0x2c260a[_0xe455('0x1e')]===_0xe455('0x1f')&&typeof _0x2c260a[_0xe455('0x20')]===_0xe455('0x1f');var _0x59c651=_0xad5b39['count'];var _0x39b208=_0x21a5b8?0x0:_0x2c260a['offset'];var _0x2a1d0c=_0x21a5b8?_0xad5b39[_0xe455('0x21')]:_0x2c260a[_0xe455('0x1e')]+_0x2c260a[_0xe455('0x20')];var _0x2bad84;if(_0x2a1d0c>=_0x59c651){_0x2a1d0c=_0x59c651;_0x2bad84=0xc8;}else{_0x2bad84=0xce;}_0x5bac47['status'](_0x2bad84);return _0x5bac47[_0xe455('0x22')](_0xe455('0x23'),_0x39b208+'-'+_0x2a1d0c+'/'+_0x59c651)[_0xe455('0x24')](_0xad5b39);}return null;};}function patchUpdates(_0x23d847){return function(_0x3fb8f9){try{jsonpatch[_0xe455('0x25')](_0x3fb8f9,_0x23d847,!![]);}catch(_0x49fb06){return BPromise['reject'](_0x49fb06);}return _0x3fb8f9[_0xe455('0x26')]();};}function saveUpdates(_0x5ef2ae,_0x4fa482){return function(_0x2dd6ff){if(_0x2dd6ff){return _0x2dd6ff['update'](_0x5ef2ae)['then'](function(_0x1f5bf6){return _0x1f5bf6;});}return null;};}function removeEntity(_0x1331ce,_0x382b6e){return function(_0x3f069c){if(_0x3f069c){return _0x3f069c['destroy']()[_0xe455('0x27')](function(){var _0x3ac950=_0x3f069c[_0xe455('0x28')]({'plain':!![]});var _0x430f82=_0xe455('0x29');return db[_0xe455('0x2a')][_0xe455('0x2b')]({'where':{'type':_0x430f82,'resourceId':_0x3ac950['id']}})[_0xe455('0x27')](function(){return _0x3f069c;});})['then'](function(){_0x1331ce['status'](0xcc)[_0xe455('0x1d')]();});}};}function handleEntityNotFound(_0x5d8fdf,_0x3d2682){return function(_0x40a905){if(!_0x40a905){_0x5d8fdf['sendStatus'](0x194);}return _0x40a905;};}function handleError(_0x54b866,_0x30186b){_0x30186b=_0x30186b||0x1f4;return function(_0x5dbae2){logger['error'](_0x5dbae2[_0xe455('0x2c')]);if(_0x5dbae2[_0xe455('0x2d')]){delete _0x5dbae2[_0xe455('0x2d')];}_0x54b866['status'](_0x30186b)[_0xe455('0x2e')](_0x5dbae2);};}exports[_0xe455('0x2f')]=function(_0x159bb3,_0x562e33){var _0x1d17f7={},_0x3da42d={},_0x47cf86={'count':0x0,'rows':[]};var _0x542606=_[_0xe455('0x30')](db[_0xe455('0x31')][_0xe455('0x32')],function(_0x2b6952){return{'name':_0x2b6952[_0xe455('0x33')],'type':_0x2b6952[_0xe455('0x34')]['key']};});_0x3da42d[_0xe455('0x35')]=_['map'](_0x542606,_0xe455('0x2d'));_0x3da42d[_0xe455('0x36')]=_[_0xe455('0x37')](_0x159bb3[_0xe455('0x36')]);_0x3da42d[_0xe455('0x38')]=_[_0xe455('0x39')](_0x3da42d[_0xe455('0x35')],_0x3da42d[_0xe455('0x36')]);_0x1d17f7[_0xe455('0x3a')]=_[_0xe455('0x39')](_0x3da42d['model'],qs[_0xe455('0x3b')](_0x159bb3[_0xe455('0x36')]['fields']));_0x1d17f7['attributes']=_0x1d17f7[_0xe455('0x3a')][_0xe455('0x3c')]?_0x1d17f7[_0xe455('0x3a')]:_0x3da42d[_0xe455('0x35')];if(!_0x159bb3[_0xe455('0x36')]['hasOwnProperty'](_0xe455('0x3d'))){_0x1d17f7['limit']=qs['limit'](_0x159bb3[_0xe455('0x36')][_0xe455('0x20')]);_0x1d17f7[_0xe455('0x1e')]=qs[_0xe455('0x1e')](_0x159bb3['query']['offset']);}_0x1d17f7[_0xe455('0x3e')]=qs[_0xe455('0x3f')](_0x159bb3['query'][_0xe455('0x3f')]);_0x1d17f7['where']=qs[_0xe455('0x38')](_[_0xe455('0x40')](_0x159bb3['query'],_0x3da42d[_0xe455('0x38')]),_0x542606);if(_0x159bb3['query'][_0xe455('0x41')]){_0x1d17f7[_0xe455('0x42')]=_['merge'](_0x1d17f7[_0xe455('0x42')],{'$or':_[_0xe455('0x30')](_0x542606,function(_0x4b1d0b){if(_0x4b1d0b[_0xe455('0x34')]!==_0xe455('0x43')){var _0x1abb2e={};_0x1abb2e[_0x4b1d0b[_0xe455('0x2d')]]={'$like':'%'+_0x159bb3[_0xe455('0x36')][_0xe455('0x41')]+'%'};return _0x1abb2e;}})});}_0x1d17f7=_[_0xe455('0x44')]({},_0x1d17f7,_0x159bb3[_0xe455('0x45')]);var _0x1e87b1={'where':_0x1d17f7[_0xe455('0x42')]};return db[_0xe455('0x31')][_0xe455('0x21')](_0x1e87b1)[_0xe455('0x27')](function(_0x254eaa){_0x47cf86[_0xe455('0x21')]=_0x254eaa;if(_0x159bb3['query'][_0xe455('0x46')]){_0x1d17f7[_0xe455('0x47')]=[{'all':!![]}];}return db[_0xe455('0x31')][_0xe455('0x48')](_0x1d17f7);})['then'](function(_0xc59dfb){_0x47cf86[_0xe455('0x49')]=_0xc59dfb;return _0x47cf86;})['then'](respondWithFilteredResult(_0x562e33,_0x1d17f7))[_0xe455('0x4a')](handleError(_0x562e33,null));};exports[_0xe455('0x4b')]=function(_0x284205,_0x375259){var _0x8eb0b1={'raw':!![],'where':{'id':_0x284205[_0xe455('0x4c')]['id']}},_0xcafc3a={};_0xcafc3a[_0xe455('0x35')]=_[_0xe455('0x37')](db['Plugin'][_0xe455('0x32')]);_0xcafc3a[_0xe455('0x36')]=_['keys'](_0x284205[_0xe455('0x36')]);_0xcafc3a[_0xe455('0x38')]=_[_0xe455('0x39')](_0xcafc3a[_0xe455('0x35')],_0xcafc3a[_0xe455('0x36')]);_0x8eb0b1['attributes']=_[_0xe455('0x39')](_0xcafc3a[_0xe455('0x35')],qs['fields'](_0x284205['query']['fields']));_0x8eb0b1['attributes']=_0x8eb0b1[_0xe455('0x3a')][_0xe455('0x3c')]?_0x8eb0b1[_0xe455('0x3a')]:_0xcafc3a[_0xe455('0x35')];if(_0x284205[_0xe455('0x36')][_0xe455('0x46')]){_0x8eb0b1['include']=[{'all':!![]}];}_0x8eb0b1=_[_0xe455('0x44')]({},_0x8eb0b1,_0x284205[_0xe455('0x45')]);return db[_0xe455('0x31')][_0xe455('0x4d')](_0x8eb0b1)['then'](handleEntityNotFound(_0x375259,null))[_0xe455('0x27')](respondWithResult(_0x375259,null))[_0xe455('0x4a')](handleError(_0x375259,null));};exports[_0xe455('0x4e')]=function(_0x5e517f,_0x102eee,_0x526ca5){return db[_0xe455('0x31')][_0xe455('0x4d')]({'where':{'id':_0x5e517f[_0xe455('0x4c')]['id']},'attributes':[_0xe455('0x2d'),_0xe455('0x6')],'raw':!![]})[_0xe455('0x27')](handleEntityNotFound(_0x102eee,null))['then'](function(_0x2d2ba3){if(_0x2d2ba3){var _0x4a3d1d=path[_0xe455('0x4f')](config[_0xe455('0x50')],_0xe455('0x51'),util[_0xe455('0x52')](_0xe455('0x53'),path['basename'](_0x2d2ba3[_0xe455('0x6')])));var _0x1a735f=fs[_0xe455('0x54')](_0x4a3d1d);var _0x21ea97=archiver(_0xe455('0x55'),{'zlib':{'level':0x9}});_0x21ea97['on'](_0xe455('0x56'),function(_0x17b5a6){if(_0x17b5a6['code']===_0xe455('0x57')){logger['error'](_0x17b5a6);}else{throw new db['Sequelize'][(_0xe455('0x58'))](_0xe455('0x59'));}});_0x21ea97['on'](_0xe455('0x5a'),function(_0x18bcf4){throw new db[(_0xe455('0x5b'))][(_0xe455('0x58'))](_0xe455('0x59'));});_0x21ea97[_0xe455('0x5c')](_0x1a735f);_0x21ea97[_0xe455('0x5d')](_0xe455('0x5e'),{'cwd':path['join'](config[_0xe455('0x50')],_0xe455('0x51'),path['dirname'](_0x2d2ba3[_0xe455('0x6')])),'ignore':[path[_0xe455('0x4f')](path['basename'](_0x2d2ba3[_0xe455('0x6')]),_0xe455('0x5f')),path['join'](path[_0xe455('0x60')](_0x2d2ba3[_0xe455('0x6')]),'attachments/**/*')],'nodir':!![]})[_0xe455('0x61')]();_0x1a735f['on'](_0xe455('0x62'),function(){if(!fs['existsSync'](_0x4a3d1d)){throw new db[(_0xe455('0x5b'))][(_0xe455('0x58'))](_0xe455('0x63'));}return _0x102eee[_0xe455('0x4e')](_0x4a3d1d,util[_0xe455('0x52')](_0xe455('0x53'),path['basename'](_0x2d2ba3[_0xe455('0x6')])),function(_0x272771){if(_0x272771){throw new db[(_0xe455('0x5b'))][(_0xe455('0x58'))](_0xe455('0x64'));}fs[_0xe455('0x65')](_0x4a3d1d);logger[_0xe455('0x66')](_0xe455('0x67'));logger[_0xe455('0x66')](_0xe455('0x68'));});});}return null;})['catch'](handleError(_0x102eee,null));};exports[_0xe455('0x69')]=function(_0x390743,_0x2b4f7d,_0x326c29){var _0x5e329b=path[_0xe455('0x60')](_0x390743[_0xe455('0x6a')]['filename'],path[_0xe455('0x6b')](_0x390743[_0xe455('0x6a')][_0xe455('0x6c')]));var _0x861be2=path['join'](config['root'],'server/files/plugins',_0x390743['file'][_0xe455('0x6c')]);var _0x304e3e=path[_0xe455('0x4f')](config[_0xe455('0x50')],_0xe455('0x51'),_0x5e329b);logger[_0xe455('0x66')](_0xe455('0x6d'),_0x861be2);logger[_0xe455('0x66')](_0xe455('0x6e'),_0x304e3e);try{fs[_0xe455('0x6f')](_0x861be2,parseInt(_0xe455('0x70'),0x8));extract(_0x861be2,{'dir':_0x304e3e},function(_0x4eb4d8){if(_0x4eb4d8){logger['error'](_0x4eb4d8);handleError(_0x4eb4d8,!![]);};var _0x523a52=fs[_0xe455('0x71')](_0x304e3e);if(_0x523a52[_0xe455('0x3c')]>0x1){removeReferences(_0x861be2,_0x304e3e);logger[_0xe455('0x5a')](_0xe455('0x72'));return _0x326c29(new Error(_0xe455('0x72')));}var _0x1edb54=fs[_0xe455('0x73')](path['join'](_0x304e3e,_0x523a52[0x0]));if(_0x1edb54['isFile']()){removeReferences(_0x861be2,_0x304e3e);logger[_0xe455('0x5a')](_0xe455('0x72'));return _0x326c29(new Error(_0xe455('0x72')));}if(_0x1edb54[_0xe455('0x74')]()){var _0x9c0225=fs[_0xe455('0x71')](path['join'](_0x304e3e,_0x523a52[0x0]));if(_0x9c0225['length']===0x0){removeReferences(_0x861be2,_0x304e3e);logger['error']('Invalid\x20plugin\x20structure');return _0x326c29(new Error(_0xe455('0x72')));}var _0x43670e=_0x9c0225[_0xe455('0x75')](function(_0x28d4fc){return _0x28d4fc===_0xe455('0x76');});if(!_0x43670e){return _0x326c29(new Error(_0xe455('0x77')));}var _0x20733b=fs[_0xe455('0x78')](path['join'](_0x304e3e,_0x523a52[0x0],_0xe455('0x76')));var _0x4a4289=JSON[_0xe455('0x79')](_0x20733b);if(_0xe455('0x1f')==typeof _0x4a4289[_0xe455('0x2d')]){return _0x326c29(new Error(_0xe455('0x7a')));}if(_0xe455('0x1f')==typeof _0x4a4289[_0xe455('0x34')]){return _0x326c29(new Error(_0xe455('0x7b')));}if(_0xe455('0x1f')==typeof _0x4a4289[_0xe455('0x7c')]){return _0x326c29(new Error(_0xe455('0x7d')));}if('undefined'==typeof _0x4a4289[_0xe455('0x7e')]){return _0x326c29(new Error(_0xe455('0x7f')));}if(_0x4a4289[_0xe455('0x34')]===_0xe455('0x80')){if('undefined'==typeof _0x4a4289[_0xe455('0x7e')][_0xe455('0x81')]){return _0x326c29(new Error(_0xe455('0x82')));}if(_0xe455('0x1f')==typeof _0x4a4289[_0xe455('0x7e')][_0xe455('0x81')][_0xe455('0x83')]&&_0xe455('0x1f')==typeof _0x4a4289[_0xe455('0x7e')][_0xe455('0x81')][_0xe455('0x84')]){return _0x326c29(new Error(_0xe455('0x85')));}}else if(_0x4a4289[_0xe455('0x34')]===_0xe455('0x86')){if(_0xe455('0x1f')==typeof _0x4a4289[_0xe455('0x7e')][_0xe455('0x87')]){return _0x326c29(new Error(_0xe455('0x88')));}if(_0xe455('0x1f')==typeof _0x4a4289[_0xe455('0x7e')]['scriptPath']){return _0x326c29(new Error(_0xe455('0x89')));}}else{return _0x326c29(new Error(_0xe455('0x8a')));}var _0x53ff57=_0x4a4289[_0xe455('0x2d')];var _0x5de5b9=_0x4a4289[_0xe455('0x8b')];var _0x10389c=_0x4a4289['type'];var _0x4b27a0=_0x4a4289[_0xe455('0x8c')]?_0x4a4289[_0xe455('0x8c')]:'always';var _0x24f19a=_0x4a4289[_0xe455('0x8d')]?_0x4a4289[_0xe455('0x8d')]:_0xe455('0x8e');var _0x418b3b='';var _0x572c05='';var _0x4a733d='';var _0x2a4c2f='';var _0x3c5f46=_0x4a4289[_0xe455('0x7c')];if(_0x10389c===_0xe455('0x80')){if(_0xe455('0x1f')!=typeof _0x4a4289[_0xe455('0x7e')][_0xe455('0x81')][_0xe455('0x83')]){var _0x10889f=_0x4a4289['parameters'][_0xe455('0x81')][_0xe455('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xe455('0x8f')](_0x10889f)){_0x418b3b=path[_0xe455('0x4f')](_0xe455('0x90'),_0x5e329b,_0x523a52[0x0],_0x10889f);}else{_0x418b3b=_0x10889f;}}else{logger[_0xe455('0x66')](_0xe455('0x91'));}if(_0xe455('0x1f')!=typeof _0x4a4289[_0xe455('0x7e')]['views'][_0xe455('0x84')]){var _0x7593b1=_0x4a4289['parameters'][_0xe455('0x81')][_0xe455('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xe455('0x8f')](_0x7593b1)){_0x572c05=path[_0xe455('0x4f')](_0xe455('0x90'),_0x5e329b,_0x523a52[0x0],_0x7593b1);}else{_0x572c05=_0x7593b1;}}else{logger[_0xe455('0x66')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x10389c===_0xe455('0x86')){_0x4a733d=_0x4a4289[_0xe455('0x7e')][_0xe455('0x87')];_0x2a4c2f=_0x4a4289[_0xe455('0x7e')][_0xe455('0x92')];if('undefined'!=typeof _0x4a4289[_0xe455('0x7e')][_0xe455('0x81')]){if(_0xe455('0x1f')!=typeof _0x4a4289[_0xe455('0x7e')][_0xe455('0x81')]['admin']){var _0x10889f=_0x4a4289[_0xe455('0x7e')][_0xe455('0x81')][_0xe455('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xe455('0x8f')](_0x10889f)){_0x418b3b=path[_0xe455('0x4f')](_0xe455('0x90'),_0x5e329b,_0x523a52[0x0],_0x10889f);}else{_0x418b3b=_0x10889f;}}if(_0xe455('0x1f')!=typeof _0x4a4289[_0xe455('0x7e')][_0xe455('0x81')][_0xe455('0x84')]){var _0x7593b1=_0x4a4289[_0xe455('0x7e')][_0xe455('0x81')][_0xe455('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xe455('0x8f')](_0x7593b1)){_0x572c05=path[_0xe455('0x4f')](_0xe455('0x90'),_0x5e329b,_0x523a52[0x0],_0x7593b1);}else{_0x572c05=_0x7593b1;}}}}var _0x1f50a0={'name':_0x53ff57,'description':_0x5de5b9,'path':path[_0xe455('0x4f')](_0x5e329b,_0x523a52[0x0]),'type':_0x10389c,'sidebar':_0x4b27a0,'icon':_0x24f19a,'adminUrl':_0x418b3b,'agentUrl':_0x572c05,'scriptName':_0x4a733d,'scriptPath':_0x2a4c2f,'version':_0x3c5f46};removeReferences(_0x861be2,null);return db[_0xe455('0x31')][_0xe455('0x93')](_0x1f50a0)[_0xe455('0x27')](function(_0x5cb056){var _0x106118={'role':_0x390743[_0xe455('0x94')]['role'],'userProfileId':_0x390743[_0xe455('0x94')][_0xe455('0x95')]};if(!_0x106118)throw new Error(_0xe455('0x96'));if(_0x106118[_0xe455('0x97')]==='user'){var _0xee1d87=_0x5cb056[_0xe455('0x28')]({'plain':!![]});return db['UserProfileSection'][_0xe455('0x4d')]({'where':{'name':_0xe455('0x29'),'userProfileId':_0x106118[_0xe455('0x95')]},'raw':!![]})[_0xe455('0x27')](function(_0x4ff71a){if(_0x4ff71a&&_0x4ff71a['autoAssociation']===0x0){return db[_0xe455('0x2a')][_0xe455('0x93')]({'name':_0xee1d87[_0xe455('0x2d')],'resourceId':_0xee1d87['id'],'type':_0x4ff71a[_0xe455('0x2d')],'sectionId':_0x4ff71a['id']},{})[_0xe455('0x27')](function(){return _0x5cb056;});}else{return _0x5cb056;}})[_0xe455('0x4a')](function(_0x3b165d){logger[_0xe455('0x5a')](_0xe455('0x98'),_0x3b165d);throw _0x3b165d;});}return _0x5cb056;})['then'](respondWithResult(_0x2b4f7d,null))[_0xe455('0x4a')](handleError(_0x2b4f7d,null));}});}catch(_0x42216a){_0x2b4f7d['status'](0x1f4)[_0xe455('0x2e')](_0x42216a);}};function removeReferences(_0xf18b19,_0x3ba5df){try{if(_0xf18b19){fs[_0xe455('0x65')](_0xf18b19);logger[_0xe455('0x66')](_0xe455('0x99'));}if(_0x3ba5df){rimraf(_0x3ba5df,function(){});logger['info'](_0xe455('0x9a'));}}catch(_0x18df6f){logger[_0xe455('0x5a')](_0x18df6f);}}exports[_0xe455('0x9b')]=function(_0x133bdc,_0x47801f,_0x16ed08){return db[_0xe455('0x31')]['find']({'where':{'id':_0x133bdc['params']['id']}})[_0xe455('0x27')](handleEntityNotFound(_0x47801f,null))[_0xe455('0x27')](saveUpdates(_0x133bdc[_0xe455('0x94')],null))[_0xe455('0x27')](respondWithResult(_0x47801f,null))[_0xe455('0x4a')](handleError(_0x47801f,null));};exports['delete']=function(_0x48ad78,_0x1627a1,_0x517e7d){return db['Plugin'][_0xe455('0x4d')]({'where':{'id':_0x48ad78[_0xe455('0x4c')]['id']}})[_0xe455('0x27')](function(_0x169e3f){if(_0x169e3f){return _0x169e3f[_0xe455('0x2b')]();}})[_0xe455('0x27')](function(_0x476d0e){rimraf(path['join'](config[_0xe455('0x50')],_0xe455('0x51'),path[_0xe455('0x9c')](_0x476d0e[_0xe455('0x6')])),function(){});return _0x476d0e;})[_0xe455('0x27')](handleEntityNotFound(_0x1627a1,null))['then'](respondWithStatusCode(_0x1627a1,null))['catch'](handleError(_0x1627a1,null));};exports[_0xe455('0x9d')]=function(_0x393b9f,_0x2c08e7,_0x1c02be){return BPromise[_0xe455('0x9e')]()[_0xe455('0x27')](function(){if(!_0x393b9f[_0xe455('0x36')][_0xe455('0x6')]){throw new Error(_0xe455('0x9f'));}if(!_0x393b9f['query'][_0xe455('0xa0')]){throw new Error(_0xe455('0xa1'));}var _0x465dee=_0x393b9f['query']['hostname']?_0x393b9f[_0xe455('0x36')][_0xe455('0xa2')]+':'+_0x393b9f[_0xe455('0x36')][_0xe455('0xa0')]:'http://localhost:'+_0x393b9f[_0xe455('0x36')][_0xe455('0xa0')];var _0x22fa7e=_0x393b9f[_0xe455('0x36')]['json']?_0x393b9f[_0xe455('0x36')][_0xe455('0x24')]:!![];var _0x276a86=_0x393b9f['query'][_0xe455('0xa3')]?_0x393b9f[_0xe455('0x36')][_0xe455('0xa3')]:null;var _0x55a7ad={'method':_0x393b9f[_0xe455('0xa4')],'uri':util[_0xe455('0x52')](_0xe455('0xa5'),_0x465dee,_0x393b9f[_0xe455('0x36')][_0xe455('0x6')]),'json':_0x22fa7e,'resolveWithFullResponse':!![],'encoding':_0x276a86,'qs':_0x393b9f[_0xe455('0x36')]};if(_0x393b9f[_0xe455('0xa6')]){_0x55a7ad[_0xe455('0xa6')]=_0x393b9f[_0xe455('0xa6')];if(_0x55a7ad['headers'][_0xe455('0xa7')]){delete _0x55a7ad['headers'][_0xe455('0xa7')];}}if(_0x55a7ad[_0xe455('0xa6')][_0xe455('0xa8')]){delete _0x55a7ad['headers'][_0xe455('0xa8')];}return rp(_0x55a7ad);})[_0xe455('0x27')](function(_0x19c096){if(_0x19c096){_0x2c08e7['set'](_0x19c096[_0xe455('0xa6')]);logger[_0xe455('0x66')](_0x19c096['body']);if(_[_0xe455('0xa9')](_0x393b9f['query'][_0xe455('0x6')],_0xe455('0x4e'))&&_0x19c096['statusCode']==0x1f4){return _0x2c08e7[_0xe455('0x1c')](_0x19c096[_0xe455('0xaa')]);}else{return _0x2c08e7[_0xe455('0xab')](_0x19c096[_0xe455('0xaa')])['send'](_0x19c096['body']);}}else{return _0x2c08e7[_0xe455('0x1c')](0xc8);}})['catch'](handleError(_0x2c08e7,null));};exports[_0xe455('0xac')]=function(_0x15824f,_0x2382d5,_0x8ab7ee){return BPromise['resolve']()[_0xe455('0x27')](function(){if(!_0x15824f[_0xe455('0x36')][_0xe455('0x6')]){throw new Error(_0xe455('0x9f'));}if(!_0x15824f[_0xe455('0x36')][_0xe455('0xa0')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x319f12=_0x15824f[_0xe455('0x36')]['hostname']?_0x15824f['query'][_0xe455('0xa2')]+':'+_0x15824f['query']['port']:_0xe455('0xad')+_0x15824f[_0xe455('0x36')]['port'];var _0xa7de00=_0x15824f[_0xe455('0x36')][_0xe455('0x24')]?_0x15824f[_0xe455('0x36')][_0xe455('0x24')]:!![];var _0x50c508=_0x15824f[_0xe455('0x36')][_0xe455('0xa3')]?_0x15824f[_0xe455('0x36')][_0xe455('0xa3')]:null;var _0x2832ee={'method':_0x15824f[_0xe455('0xa4')],'uri':util['format']('%s%s',_0x319f12,_0x15824f[_0xe455('0x36')][_0xe455('0x6')]),'json':_0xa7de00,'resolveWithFullResponse':!![],'encoding':_0x50c508,'body':_0x15824f['body']};if(_0x15824f['headers']){_0x2832ee[_0xe455('0xa6')]=_0x15824f[_0xe455('0xa6')];if(_0x2832ee[_0xe455('0xa6')][_0xe455('0xa7')]){delete _0x2832ee[_0xe455('0xa6')][_0xe455('0xa7')];}}if(_0x2832ee['headers'][_0xe455('0xa8')]){delete _0x2832ee[_0xe455('0xa6')][_0xe455('0xa8')];}return rp(_0x2832ee);})['then'](function(_0x44dc54){if(_0x44dc54){_0x2382d5[_0xe455('0x22')](_0x44dc54['headers']);logger['info'](_0x44dc54[_0xe455('0x94')]);return _0x2382d5[_0xe455('0xab')](_0x44dc54[_0xe455('0xaa')])[_0xe455('0x2e')](_0x44dc54[_0xe455('0x94')]);}else{return _0x2382d5[_0xe455('0x1c')](0xc8);}})[_0xe455('0x4a')](handleError(_0x2382d5,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 0b1cb79..3628460 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 _0xa3eb=['hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','save','update','remove','emit'];(function(_0x454b11,_0x4075cf){var _0x3241f2=function(_0x4d250f){while(--_0x4d250f){_0x454b11['push'](_0x454b11['shift']());}};_0x3241f2(++_0x4075cf);}(_0xa3eb,0x1ed));var _0xba3e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa3eb[_0x134c2e];return _0x2825db;};'use strict';var EventEmitter=require(_0xba3e('0x0'));var Plugin=require(_0xba3e('0x1'))['db'][_0xba3e('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xba3e('0x3'),'afterUpdate':_0xba3e('0x4'),'afterDestroy':_0xba3e('0x5')};function emitEvent(_0x3905e4){return function(_0x1c512e,_0x24a0f8,_0x113a07){PluginEvents[_0xba3e('0x6')](_0x3905e4+':'+_0x1c512e['id'],_0x1c512e);PluginEvents[_0xba3e('0x6')](_0x3905e4,_0x1c512e);_0x113a07(null);};}for(var e in events){if(events[_0xba3e('0x7')](e)){var event=events[e];Plugin[_0xba3e('0x8')](e,emitEvent(event));}}module[_0xba3e('0x9')]=PluginEvents; \ No newline at end of file +var _0xdc97=['events','../../mysqldb','Plugin','save','remove','emit','hook'];(function(_0xa88264,_0x4f727a){var _0x258d08=function(_0x4a46f5){while(--_0x4a46f5){_0xa88264['push'](_0xa88264['shift']());}};_0x258d08(++_0x4f727a);}(_0xdc97,0x13b));var _0x7dc9=function(_0x1bdccd,_0x3830f9){_0x1bdccd=_0x1bdccd-0x0;var _0x2b6700=_0xdc97[_0x1bdccd];return _0x2b6700;};'use strict';var EventEmitter=require(_0x7dc9('0x0'));var Plugin=require(_0x7dc9('0x1'))['db'][_0x7dc9('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7dc9('0x3'),'afterUpdate':'update','afterDestroy':_0x7dc9('0x4')};function emitEvent(_0x2b86da){return function(_0x478a95,_0x2a77c1,_0x1e513b){PluginEvents[_0x7dc9('0x5')](_0x2b86da+':'+_0x478a95['id'],_0x478a95);PluginEvents[_0x7dc9('0x5')](_0x2b86da,_0x478a95);_0x1e513b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x7dc9('0x6')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index bd0bb98..557b36c 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 _0xc4f5=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Plugin'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xc4f5,0xa5));var _0x5c4f=function(_0x39c760,_0x4daa3d){_0x39c760=_0x39c760-0x0;var _0x472eb3=_0xc4f5[_0x39c760];return _0x472eb3;};'use strict';var _=require('lodash');var util=require(_0x5c4f('0x0'));var logger=require(_0x5c4f('0x1'))(_0x5c4f('0x2'));var moment=require('moment');var BPromise=require(_0x5c4f('0x3'));var rp=require(_0x5c4f('0x4'));var fs=require('fs');var path=require(_0x5c4f('0x5'));var rimraf=require(_0x5c4f('0x6'));var config=require(_0x5c4f('0x7'));var attributes=require('./plugin.attributes');module[_0x5c4f('0x8')]=function(_0x299b8b,_0x3fd7bb){return _0x299b8b[_0x5c4f('0x9')](_0x5c4f('0xa'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8994=['../../config/environment','exports','define','Plugin','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x39efd5,_0x374e8c){var _0x514f37=function(_0x53cc51){while(--_0x53cc51){_0x39efd5['push'](_0x39efd5['shift']());}};_0x514f37(++_0x374e8c);}(_0x8994,0x16f));var _0x4899=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x8994[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0x4899('0x0'));var util=require(_0x4899('0x1'));var logger=require(_0x4899('0x2'))(_0x4899('0x3'));var moment=require('moment');var BPromise=require(_0x4899('0x4'));var rp=require(_0x4899('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4899('0x6'));var config=require(_0x4899('0x7'));var attributes=require('./plugin.attributes');module[_0x4899('0x8')]=function(_0x1ae947,_0xd8f787){return _0x1ae947[_0x4899('0x9')](_0x4899('0xa'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index e53f311..d8f6427 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 _0x792f=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreatePlugin','create','body','options','raw','then','debug','util','moment'];(function(_0x19e7f4,_0x58850f){var _0x1e4ffd=function(_0x28648d){while(--_0x28648d){_0x19e7f4['push'](_0x19e7f4['shift']());}};_0x1e4ffd(++_0x58850f);}(_0x792f,0x10e));var _0xf792=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x792f[_0x33032e];return _0x13316b;};'use strict';var _=require('lodash');var util=require(_0xf792('0x0'));var moment=require(_0xf792('0x1'));var BPromise=require(_0xf792('0x2'));var rs=require(_0xf792('0x3'));var fs=require('fs');var Redis=require(_0xf792('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf792('0x5'));var logger=require(_0xf792('0x6'))(_0xf792('0x7'));var config=require('../../config/environment');var jayson=require(_0xf792('0x8'));var client=jayson[_0xf792('0x9')][_0xf792('0xa')]({'port':0x232a});config[_0xf792('0xb')]=_[_0xf792('0xc')](config['redis'],{'host':_0xf792('0xd'),'port':0x18eb});var socket=require(_0xf792('0xe'))(new Redis(config[_0xf792('0xb')]));require(_0xf792('0xf'))[_0xf792('0x10')](socket);function respondWithRpcPromise(_0x41a140,_0x3feefa,_0x43dadf){return new BPromise(function(_0x213aac,_0x2a9c73){return client[_0xf792('0x11')](_0x41a140,_0x43dadf)['then'](function(_0x47ff16){logger[_0xf792('0x12')](_0xf792('0x13'),_0x3feefa,_0xf792('0x14'));logger['debug'](_0xf792('0x15'),_0x3feefa,_0xf792('0x14'),JSON[_0xf792('0x16')](_0x47ff16));if(_0x47ff16[_0xf792('0x17')]){if(_0x47ff16['error']['code']===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x3feefa,_0x47ff16[_0xf792('0x17')][_0xf792('0x18')]);return _0x2a9c73(_0x47ff16[_0xf792('0x17')]['message']);}logger[_0xf792('0x17')](_0xf792('0x13'),_0x3feefa,_0x47ff16[_0xf792('0x17')][_0xf792('0x18')]);return _0x213aac(_0x47ff16[_0xf792('0x17')][_0xf792('0x18')]);}else{logger[_0xf792('0x12')](_0xf792('0x13'),_0x3feefa,_0xf792('0x14'));_0x213aac(_0x47ff16[_0xf792('0x19')]['message']);}})[_0xf792('0x1a')](function(_0x29289c){logger['error']('Plugin,\x20%s,\x20%s',_0x3feefa,_0x29289c);_0x2a9c73(_0x29289c);});});}exports[_0xf792('0x1b')]=function(_0x53e52e){var _0x2710fc=this;return new Promise(function(_0x40b145,_0x5718f1){return db['Plugin'][_0xf792('0x1c')](_0x53e52e[_0xf792('0x1d')],{'raw':_0x53e52e[_0xf792('0x1e')]?_0x53e52e[_0xf792('0x1e')][_0xf792('0x1f')]===undefined?!![]:![]:!![]})[_0xf792('0x20')](function(_0x4792ec){logger[_0xf792('0x12')]('CreatePlugin',_0x53e52e);logger[_0xf792('0x21')](_0xf792('0x1b'),_0x53e52e,JSON[_0xf792('0x16')](_0x4792ec));_0x40b145(_0x4792ec);})['catch'](function(_0x26108a){logger[_0xf792('0x17')]('CreatePlugin',_0x26108a[_0xf792('0x18')],_0x53e52e);_0x5718f1(_0x2710fc[_0xf792('0x17')](0x1f4,_0x26108a[_0xf792('0x18')]));});});}; \ No newline at end of file +var _0x8ac0=['moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreatePlugin','create','options','raw','catch','lodash','util'];(function(_0x1c8abb,_0x4fe2f9){var _0x58eb71=function(_0x5ee26a){while(--_0x5ee26a){_0x1c8abb['push'](_0x1c8abb['shift']());}};_0x58eb71(++_0x4fe2f9);}(_0x8ac0,0x9e));var _0x08ac=function(_0x483bff,_0x16d0d7){_0x483bff=_0x483bff-0x0;var _0x4e971f=_0x8ac0[_0x483bff];return _0x4e971f;};'use strict';var _=require(_0x08ac('0x0'));var util=require(_0x08ac('0x1'));var moment=require(_0x08ac('0x2'));var BPromise=require(_0x08ac('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x08ac('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x08ac('0x5'))(_0x08ac('0x6'));var config=require(_0x08ac('0x7'));var jayson=require(_0x08ac('0x8'));var client=jayson[_0x08ac('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x08ac('0xa')],{'host':_0x08ac('0xb'),'port':0x18eb});var socket=require(_0x08ac('0xc'))(new Redis(config['redis']));require(_0x08ac('0xd'))[_0x08ac('0xe')](socket);function respondWithRpcPromise(_0x1b2d4f,_0x2a2c35,_0x18ff8d){return new BPromise(function(_0xb0717e,_0x437e18){return client[_0x08ac('0xf')](_0x1b2d4f,_0x18ff8d)[_0x08ac('0x10')](function(_0x1595e5){logger[_0x08ac('0x11')](_0x08ac('0x12'),_0x2a2c35,_0x08ac('0x13'));logger[_0x08ac('0x14')](_0x08ac('0x15'),_0x2a2c35,_0x08ac('0x13'),JSON[_0x08ac('0x16')](_0x1595e5));if(_0x1595e5[_0x08ac('0x17')]){if(_0x1595e5['error'][_0x08ac('0x18')]===0x1f4){logger[_0x08ac('0x17')]('Plugin,\x20%s,\x20%s',_0x2a2c35,_0x1595e5[_0x08ac('0x17')]['message']);return _0x437e18(_0x1595e5[_0x08ac('0x17')][_0x08ac('0x19')]);}logger[_0x08ac('0x17')]('Plugin,\x20%s,\x20%s',_0x2a2c35,_0x1595e5[_0x08ac('0x17')][_0x08ac('0x19')]);return _0xb0717e(_0x1595e5[_0x08ac('0x17')][_0x08ac('0x19')]);}else{logger['info'](_0x08ac('0x12'),_0x2a2c35,'request\x20sent');_0xb0717e(_0x1595e5[_0x08ac('0x1a')]['message']);}})['catch'](function(_0xaf52c3){logger[_0x08ac('0x17')](_0x08ac('0x12'),_0x2a2c35,_0xaf52c3);_0x437e18(_0xaf52c3);});});}exports[_0x08ac('0x1b')]=function(_0xe01e5f){var _0xa13a64=this;return new Promise(function(_0x51b2e9,_0x32761b){return db['Plugin'][_0x08ac('0x1c')](_0xe01e5f['body'],{'raw':_0xe01e5f['options']?_0xe01e5f[_0x08ac('0x1d')][_0x08ac('0x1e')]===undefined?!![]:![]:!![]})[_0x08ac('0x10')](function(_0x47d56a){logger[_0x08ac('0x11')](_0x08ac('0x1b'),_0xe01e5f);logger['debug']('CreatePlugin',_0xe01e5f,JSON['stringify'](_0x47d56a));_0x51b2e9(_0x47d56a);})[_0x08ac('0x1f')](function(_0x55c9d8){logger[_0x08ac('0x17')](_0x08ac('0x1b'),_0x55c9d8[_0x08ac('0x19')],_0xe01e5f);_0x32761b(_0xa13a64[_0x08ac('0x17')](0x1f4,_0x55c9d8[_0x08ac('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index a00bf5a..ee262af 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 _0x08d8=['removeListener','register','length','./plugin.events','save','emit'];(function(_0x425716,_0x3e9d1c){var _0x2d39af=function(_0x1febc1){while(--_0x1febc1){_0x425716['push'](_0x425716['shift']());}};_0x2d39af(++_0x3e9d1c);}(_0x08d8,0x171));var _0x808d=function(_0x231068,_0x5bbe87){_0x231068=_0x231068-0x0;var _0x13aa8b=_0x08d8[_0x231068];return _0x13aa8b;};'use strict';var PluginEvents=require(_0x808d('0x0'));var events=[_0x808d('0x1'),'remove','update'];function createListener(_0x331a1a,_0x90a0dd){return function(_0x5d5aae){_0x90a0dd[_0x808d('0x2')](_0x331a1a,_0x5d5aae);};}function removeListener(_0x524dbe,_0xdf65e){return function(){PluginEvents[_0x808d('0x3')](_0x524dbe,_0xdf65e);};}exports[_0x808d('0x4')]=function(_0x3df1ae){for(var _0x500d12=0x0,_0x5d15cd=events[_0x808d('0x5')];_0x500d12<_0x5d15cd;_0x500d12++){var _0x5af889=events[_0x500d12];var _0x19fe53=createListener('plugin:'+_0x5af889,_0x3df1ae);PluginEvents['on'](_0x5af889,_0x19fe53);}}; \ No newline at end of file +var _0xb349=['removeListener','length','plugin:','./plugin.events','remove','update','emit'];(function(_0x1b6a83,_0x56c08d){var _0x1bf266=function(_0x4eed19){while(--_0x4eed19){_0x1b6a83['push'](_0x1b6a83['shift']());}};_0x1bf266(++_0x56c08d);}(_0xb349,0x1a7));var _0x9b34=function(_0x323708,_0x57c2e9){_0x323708=_0x323708-0x0;var _0x551f52=_0xb349[_0x323708];return _0x551f52;};'use strict';var PluginEvents=require(_0x9b34('0x0'));var events=['save',_0x9b34('0x1'),_0x9b34('0x2')];function createListener(_0x427b00,_0xb518ee){return function(_0x5787bd){_0xb518ee[_0x9b34('0x3')](_0x427b00,_0x5787bd);};}function removeListener(_0x2e7b6a,_0x341ccb){return function(){PluginEvents[_0x9b34('0x4')](_0x2e7b6a,_0x341ccb);};}exports['register']=function(_0x38558f){for(var _0x2ca756=0x0,_0x12f98c=events[_0x9b34('0x5')];_0x2ca756<_0x12f98c;_0x2ca756++){var _0x439c05=events[_0x2ca756];var _0x210f9a=createListener(_0x9b34('0x6')+_0x439c05,_0x38558f);PluginEvents['on'](_0x439c05,_0x210f9a);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 3ac390b..b8fa53f 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(_0x54ab3a,_0xfa0242){var _0x31a645=function(_0x31debb){while(--_0x31debb){_0x54ab3a['push'](_0x54ab3a['shift']());}};_0x31a645(++_0xfa0242);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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(_0x1c9459,_0x538ed1){var _0x3b6d03=function(_0x2a05cf){while(--_0x2a05cf){_0x1c9459['push'](_0x1c9459['shift']());}};_0x3b6d03(++_0x538ed1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 df68650..e938d69 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 _0x1be1=['stop','hasOwnProperty','status','destroy','delete','Unknown\x20id','../../config/logger','api','child_process','exec','bluebird','sendStatus','json','error','name','send','npm\x20install','info','index','express','motion2','length','then','catch','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','update','restart'];(function(_0x4afc80,_0x1743d5){var _0x1d7031=function(_0x44be25){while(--_0x44be25){_0x4afc80['push'](_0x4afc80['shift']());}};_0x1d7031(++_0x1743d5);}(_0x1be1,0x192));var _0x11be=function(_0x10aba7,_0x243de2){_0x10aba7=_0x10aba7-0x0;var _0x203686=_0x1be1[_0x10aba7];return _0x203686;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x11be('0x0'))(_0x11be('0x1'));var path=require('path');var exec=require(_0x11be('0x2'))[_0x11be('0x3')];var BPromise=require(_0x11be('0x4'));function handleEntityNotFound(_0x318d41,_0x504d3a){return function(_0x3ce56d){if(!_0x3ce56d){_0x318d41[_0x11be('0x5')](0x194);;}return _0x3ce56d;};}function respondWithResult(_0x11f793,_0x479719){_0x479719=_0x479719||0xc8;return function(_0xfe8c62){if(_0xfe8c62){return _0x11f793['status'](_0x479719)[_0x11be('0x6')](_0xfe8c62);}return null;};}function handleError(_0x11fc15,_0x246772){_0x246772=_0x246772||0x1f4;return function(_0x461e17){logger[_0x11be('0x7')](_0x461e17['stack']);if(_0x461e17[_0x11be('0x8')]){delete _0x461e17[_0x11be('0x8')];}_0x11fc15['status'](_0x246772)[_0x11be('0x9')](_0x461e17);};}function execChildProcess(){return new BPromise(function(_0x2cd786,_0x40f0d1){exec(_0x11be('0xa'),function(_0x4e013c,_0x447e88,_0xcb8120){logger[_0x11be('0xb')](_0x447e88);logger['info'](_0xcb8120);if(_0x4e013c){logger[_0x11be('0x7')](_0x4e013c);return _0x40f0d1(_0x4e013c);}return _0x2cd786(_0x447e88);});});}exports[_0x11be('0xc')]=function(_0x4ce3ae,_0x44eff2){return pm2['list']()['then'](function(_0x569842){if(_0x569842){var _0x4b6e7e=_['reject'](_0x569842,function(_0x5aa444){return _0x5aa444['name']===_0x11be('0xd')||_0x5aa444['name']===_0x11be('0xe');});return{'rows':_0x4b6e7e,'count':_0x4b6e7e[_0x11be('0xf')]};}return null;})[_0x11be('0x10')](respondWithResult(_0x44eff2,null))[_0x11be('0x11')](handleError(_0x44eff2,null));};exports['show']=function(_0x2ed725,_0x403d7a){return pm2['describe'](_0x2ed725[_0x11be('0x12')]['id'])[_0x11be('0x10')](respondWithResult(_0x403d7a,null))[_0x11be('0x10')](handleEntityNotFound(_0x403d7a,null))['catch'](handleError(_0x403d7a,null));};exports['create']=function(_0x141391,_0x976e51){if(_0x141391[_0x11be('0x13')][_0x11be('0x8')]&&_0x141391['body'][_0x11be('0x14')]){var _0x45136f=path[_0x11be('0x15')](__dirname,_0x11be('0x16'),_0x141391[_0x11be('0x13')][_0x11be('0x14')]);var _0xa944ac=process[_0x11be('0x17')]();process[_0x11be('0x18')](path[_0x11be('0x19')](_0x45136f));return execChildProcess()['then'](function(_0xfe3737){process[_0x11be('0x18')](_0xa944ac);return pm2[_0x11be('0x1a')]({'name':_0x141391['body']['name'],'script':_0x45136f});})[_0x11be('0x10')](function(_0x10ce04){pm2[_0x11be('0x1b')]();return _0x10ce04[0x0];})['then'](respondWithResult(_0x976e51,0xc9))[_0x11be('0x11')](handleError(_0x976e51,null));}else{return _0x976e51['status'](0x1f4)[_0x11be('0x9')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x11be('0x1c')]=function(_0xb11f3d,_0x5002d7){if(_0xb11f3d[_0x11be('0x13')]['id']){delete _0xb11f3d[_0x11be('0x13')]['id'];}var _0x1d3b5c={'online':_0x11be('0x1d'),'stopped':_0x11be('0x1e')};if(_0x1d3b5c[_0x11be('0x1f')](_0xb11f3d[_0x11be('0x13')][_0x11be('0x20')])){return pm2[_0x1d3b5c[_0xb11f3d[_0x11be('0x13')]['status']]](_0xb11f3d[_0x11be('0x12')]['id'])['then'](respondWithResult(_0x5002d7,0xc8))[_0x11be('0x11')](handleError(_0x5002d7,null));}else{return _0x5002d7[_0x11be('0x20')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports[_0x11be('0x21')]=function(_0x265fc9,_0x5e8f9a){if(_0x265fc9[_0x11be('0x13')]['id']){delete _0x265fc9[_0x11be('0x13')]['id'];}if(_0x265fc9[_0x11be('0x12')]['id']){return pm2[_0x11be('0x22')](_0x265fc9[_0x11be('0x12')]['id'])[_0x11be('0x10')](function(_0x4b527e){pm2[_0x11be('0x1b')]();return _0x4b527e[0x0];})[_0x11be('0x10')](respondWithResult(_0x5e8f9a,null))[_0x11be('0x11')](handleError(_0x5e8f9a,null));}else{return _0x5e8f9a[_0x11be('0x20')](0x1f4)[_0x11be('0x9')]({'message':_0x11be('0x23')});}}; \ No newline at end of file +var _0x702d=['../../config/pm2','../../config/logger','api','path','exec','bluebird','sendStatus','status','error','stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','params','create','body','join','../../files/plugins','script','cwd','chdir','start','dump','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','destroy','delete','Unknown\x20id','lodash'];(function(_0x2fbd0e,_0x3460a9){var _0x481c9f=function(_0x4bc402){while(--_0x4bc402){_0x2fbd0e['push'](_0x2fbd0e['shift']());}};_0x481c9f(++_0x3460a9);}(_0x702d,0x147));var _0xd702=function(_0x1535b3,_0x2660a6){_0x1535b3=_0x1535b3-0x0;var _0x150da3=_0x702d[_0x1535b3];return _0x150da3;};'use strict';var _=require(_0xd702('0x0'));var pm2=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var path=require(_0xd702('0x4'));var exec=require('child_process')[_0xd702('0x5')];var BPromise=require(_0xd702('0x6'));function handleEntityNotFound(_0x27b260,_0x1c5a32){return function(_0x481ee0){if(!_0x481ee0){_0x27b260[_0xd702('0x7')](0x194);;}return _0x481ee0;};}function respondWithResult(_0x544e94,_0x1aecfc){_0x1aecfc=_0x1aecfc||0xc8;return function(_0x3a2c03){if(_0x3a2c03){return _0x544e94[_0xd702('0x8')](_0x1aecfc)['json'](_0x3a2c03);}return null;};}function handleError(_0x12bb75,_0x53bd02){_0x53bd02=_0x53bd02||0x1f4;return function(_0x39c49e){logger[_0xd702('0x9')](_0x39c49e[_0xd702('0xa')]);if(_0x39c49e[_0xd702('0xb')]){delete _0x39c49e[_0xd702('0xb')];}_0x12bb75[_0xd702('0x8')](_0x53bd02)[_0xd702('0xc')](_0x39c49e);};}function execChildProcess(){return new BPromise(function(_0x1988eb,_0x5907cf){exec(_0xd702('0xd'),function(_0x58805a,_0x4a3439,_0x3e9439){logger[_0xd702('0xe')](_0x4a3439);logger[_0xd702('0xe')](_0x3e9439);if(_0x58805a){logger['error'](_0x58805a);return _0x5907cf(_0x58805a);}return _0x1988eb(_0x4a3439);});});}exports[_0xd702('0xf')]=function(_0x128add,_0x1ed8a3){return pm2[_0xd702('0x10')]()[_0xd702('0x11')](function(_0x181ff2){if(_0x181ff2){var _0x59dd33=_[_0xd702('0x12')](_0x181ff2,function(_0x3ea0ab){return _0x3ea0ab['name']===_0xd702('0x13')||_0x3ea0ab['name']===_0xd702('0x14');});return{'rows':_0x59dd33,'count':_0x59dd33[_0xd702('0x15')]};}return null;})['then'](respondWithResult(_0x1ed8a3,null))[_0xd702('0x16')](handleError(_0x1ed8a3,null));};exports[_0xd702('0x17')]=function(_0x2a87f2,_0x4fdbbd){return pm2['describe'](_0x2a87f2[_0xd702('0x18')]['id'])['then'](respondWithResult(_0x4fdbbd,null))[_0xd702('0x11')](handleEntityNotFound(_0x4fdbbd,null))[_0xd702('0x16')](handleError(_0x4fdbbd,null));};exports[_0xd702('0x19')]=function(_0x265b1b,_0x4cf326){if(_0x265b1b[_0xd702('0x1a')][_0xd702('0xb')]&&_0x265b1b['body']['script']){var _0x536ca8=path[_0xd702('0x1b')](__dirname,_0xd702('0x1c'),_0x265b1b['body'][_0xd702('0x1d')]);var _0x5d91fd=process[_0xd702('0x1e')]();process['chdir'](path['dirname'](_0x536ca8));return execChildProcess()['then'](function(_0x21c00e){process[_0xd702('0x1f')](_0x5d91fd);return pm2[_0xd702('0x20')]({'name':_0x265b1b['body'][_0xd702('0xb')],'script':_0x536ca8});})[_0xd702('0x11')](function(_0x10599a){pm2[_0xd702('0x21')]();return _0x10599a[0x0];})[_0xd702('0x11')](respondWithResult(_0x4cf326,0xc9))[_0xd702('0x16')](handleError(_0x4cf326,null));}else{return _0x4cf326[_0xd702('0x8')](0x1f4)[_0xd702('0xc')]({'message':_0xd702('0x22')});}};exports['update']=function(_0x116b2f,_0x322cb8){if(_0x116b2f[_0xd702('0x1a')]['id']){delete _0x116b2f[_0xd702('0x1a')]['id'];}var _0xbe4518={'online':_0xd702('0x23'),'stopped':_0xd702('0x24')};if(_0xbe4518[_0xd702('0x25')](_0x116b2f['body']['status'])){return pm2[_0xbe4518[_0x116b2f[_0xd702('0x1a')][_0xd702('0x8')]]](_0x116b2f['params']['id'])[_0xd702('0x11')](respondWithResult(_0x322cb8,0xc8))[_0xd702('0x16')](handleError(_0x322cb8,null));}else{return _0x322cb8[_0xd702('0x8')](0x1f4)[_0xd702('0xc')]({'message':'Unknown\x20status'});}};exports[_0xd702('0x26')]=function(_0x313281,_0x1630ed){if(_0x313281[_0xd702('0x1a')]['id']){delete _0x313281[_0xd702('0x1a')]['id'];}if(_0x313281['params']['id']){return pm2[_0xd702('0x27')](_0x313281[_0xd702('0x18')]['id'])[_0xd702('0x11')](function(_0x5abfea){pm2[_0xd702('0x21')]();return _0x5abfea[0x0];})['then'](respondWithResult(_0x1630ed,null))['catch'](handleError(_0x1630ed,null));}else{return _0x1630ed[_0xd702('0x8')](0x1f4)[_0xd702('0xc')]({'message':_0xd702('0x28')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 970d5a7..789cbde 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 _0x7d32=['./realtime.controller','get','isAuthenticated','getAgents','getQueues','exports','express'];(function(_0x100c80,_0x2bff5f){var _0x1f8909=function(_0x46ce1f){while(--_0x46ce1f){_0x100c80['push'](_0x100c80['shift']());}};_0x1f8909(++_0x2bff5f);}(_0x7d32,0x84));var _0x27d3=function(_0xf04272,_0x3adde4){_0xf04272=_0xf04272-0x0;var _0x18b674=_0x7d32[_0xf04272];return _0x18b674;};'use strict';var express=require(_0x27d3('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x27d3('0x1'));router[_0x27d3('0x2')]('/agents',auth[_0x27d3('0x3')](),controller[_0x27d3('0x4')]);router['get']('/queues',auth[_0x27d3('0x3')](),controller[_0x27d3('0x5')]);module[_0x27d3('0x6')]=router; \ No newline at end of file +var _0x9bbb=['isAuthenticated','getAgents','/queues','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get','/agents'];(function(_0x5b4431,_0x66eaec){var _0x479e92=function(_0x392d1a){while(--_0x392d1a){_0x5b4431['push'](_0x5b4431['shift']());}};_0x479e92(++_0x66eaec);}(_0x9bbb,0x170));var _0xb9bb=function(_0xc40664,_0xe11845){_0xc40664=_0xc40664-0x0;var _0x5b86dd=_0x9bbb[_0xc40664];return _0x5b86dd;};'use strict';var express=require(_0xb9bb('0x0'));var router=express[_0xb9bb('0x1')]();var auth=require(_0xb9bb('0x2'));var controller=require(_0xb9bb('0x3'));router[_0xb9bb('0x4')](_0xb9bb('0x5'),auth[_0xb9bb('0x6')](),controller[_0xb9bb('0x7')]);router['get'](_0xb9bb('0x8'),auth['isAuthenticated'](),controller[_0xb9bb('0x9')]);module[_0xb9bb('0xa')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index be5ad60..7a2283e 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 _0x6cb6=['filter','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','handleError','undefined','limit','count','offset','set','Content-Range','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter','pause','*pause','then','isValidChannel','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','order','getRealtimeAgents','rows','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','push','literal','FIELD(id,','Pause','where','merge','user','Agents','online','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','find','filterAgentAttributes','getAgentStatus','forEach','voice','voiceStatus','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','resolve','startCase','Queue','name','outbound','dialActive','dialMethod','join','userProfileId','Queues'];(function(_0x4011d3,_0x27df5c){var _0x1a1030=function(_0x4ca78a){while(--_0x4ca78a){_0x4011d3['push'](_0x4011d3['shift']());}};_0x1a1030(++_0x27df5c);}(_0x6cb6,0x104));var _0x66cb=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x6cb6[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x66cb('0x0'));var util=require(_0x66cb('0x1'));var rta=require(_0x66cb('0x2'));var rtq=require(_0x66cb('0x3'));var qs=require(_0x66cb('0x4'));var utils=require(_0x66cb('0x5'));var db=require(_0x66cb('0x6'))['db'];var APIBadRequestError=require(_0x66cb('0x7'))['APIBadRequestError'];var APIHandleError=require(_0x66cb('0x7'))[_0x66cb('0x8')];function respondWithFilteredResult(_0x2458ea,_0xb2129e){return function(_0x51574e){if(_0x51574e){var _0x3de1ad=typeof _0xb2129e['offset']===_0x66cb('0x9')&&typeof _0xb2129e[_0x66cb('0xa')]===_0x66cb('0x9');var _0x20d7d4=_0x51574e[_0x66cb('0xb')];var _0x6b7758=_0x3de1ad?0x0:_0xb2129e['offset'];var _0x4fb2d7=_0x3de1ad?_0x51574e[_0x66cb('0xb')]:_0xb2129e[_0x66cb('0xc')]+_0xb2129e[_0x66cb('0xa')];var _0x5bac42;if(_0x4fb2d7>=_0x20d7d4){_0x4fb2d7=_0x20d7d4;_0x5bac42=0xc8;}else{_0x5bac42=0xce;}_0x2458ea['status'](_0x5bac42);return _0x2458ea[_0x66cb('0xd')](_0x66cb('0xe'),_0x6b7758+'-'+_0x4fb2d7+'/'+_0x20d7d4)[_0x66cb('0xf')](_0x51574e);}return null;};}exports[_0x66cb('0x10')]=function(_0x578ed4,_0x221e1c){var _0x2d86f6={'count':0x0,'rows':[]};var _0x20dbd4={};var _0x1e7fde;var _0xbe3aaa=utils[_0x66cb('0x11')]();var _0x5968f8;var _0x36fe49;var _0x53fc6e=_0x578ed4[_0x66cb('0x12')]['globalQueueFilter'];var _0x5daebe=_0x578ed4[_0x66cb('0x12')][_0x66cb('0x13')];var _0x3e3bf3=_0x578ed4['query'][_0x66cb('0x14')];var _0x34bc2b=_0x5daebe===_0x66cb('0x15')||_0x5daebe===_0x66cb('0x16')?!![]:![];var _0xc74ee7=[];var _0x205fbf;var _0x4b1818;Promise['resolve']()[_0x66cb('0x17')](function(){if(_0x578ed4[_0x66cb('0x12')]['channel']){if(!utils[_0x66cb('0x18')](_0x578ed4[_0x66cb('0x12')][_0x66cb('0x19')])){throw new APIBadRequestError(util[_0x66cb('0x1a')](_0x66cb('0x1b'),_0x578ed4[_0x66cb('0x12')][_0x66cb('0x19')]));}_0x1e7fde=_0x578ed4[_0x66cb('0x12')][_0x66cb('0x19')][_0x66cb('0x1c')]();}if(!_0x578ed4[_0x66cb('0x12')]['sort']||!_0x578ed4[_0x66cb('0x12')][_0x66cb('0x1d')][_0x66cb('0x1e')](_0x66cb('0x1f'))){_0x578ed4[_0x66cb('0x12')][_0x66cb('0x1d')]=rta[_0x66cb('0x20')](_0x578ed4['query'][_0x66cb('0x1d')]);return;}var _0x6d58b9=rta[_0x66cb('0x21')](_0x578ed4[_0x66cb('0x12')][_0x66cb('0x1d')]);_0x578ed4['query']['sort']=_0x6d58b9[_0x66cb('0x22')]['join'](',');_0x205fbf=_0x6d58b9[_0x66cb('0x23')];})[_0x66cb('0x17')](function(){if(!_0x53fc6e){return[];}return rta['getAgentIdsByQueues'](_0x53fc6e,_0x1e7fde);})[_0x66cb('0x17')](function(_0xf15757){_0xc74ee7=_0xf15757;return rta[_0x66cb('0x24')]();})[_0x66cb('0x17')](function(_0x5b153a){_0x36fe49=_0x5b153a[_0x66cb('0x25')];if((!_0x5daebe||_0x34bc2b)&&!_0x205fbf){return _0xc74ee7;}if(_0x205fbf&&!_0x5daebe){return rta['getSortedAgentsIdsByStatus'](_0x36fe49,_0xc74ee7,_0x205fbf);}else{return rta[_0x66cb('0x26')](_0x36fe49,_0xc74ee7,_0x5daebe);}})[_0x66cb('0x17')](function(_0x513893){_0xc74ee7=_0x513893;var _0x1f7d25=![];if(_0xc74ee7[_0x66cb('0x27')]===0x0){if(_0x53fc6e||_0x5daebe){_0x1f7d25=!![];}if(_0x34bc2b){_0x1f7d25=![];}}if(_0x1f7d25){return _0x2d86f6;}var _0x350329=_[_0x66cb('0x28')](db[_0x66cb('0x29')][_0x66cb('0x2a')],function(_0x2288e7){return{'name':_0x2288e7[_0x66cb('0x2b')],'type':_0x2288e7[_0x66cb('0x2c')][_0x66cb('0x2d')]};});_0x578ed4[_0x66cb('0x12')][_0x66cb('0x2e')]=_0x66cb('0x2f');_0x20dbd4=qs[_0x66cb('0x30')](_0x350329,_0x578ed4);_0x20dbd4[_0x66cb('0x31')]=!![];var _0x9bdbb5=[];if(_0xc74ee7[_0x66cb('0x27')]>0x0){_0x9bdbb5[_0x66cb('0x32')]({'id':{'$in':_0xc74ee7}});if(_0x205fbf&&!_0x5daebe){_0x4b1818=[db['sequelize'][_0x66cb('0x33')](_0x66cb('0x34')+_0xc74ee7+')')];_0x20dbd4[_0x66cb('0x23')]=_0x4b1818;}}if(_0x34bc2b){_0xbe3aaa['forEach'](function(_0x15102b){var _0x55b4ea=!![];if(_0x5daebe===_0x66cb('0x16')&&_0x1e7fde!==_0x15102b){_0x55b4ea=![];}_0x9bdbb5[_0x66cb('0x32')]({[_0x15102b+_0x66cb('0x35')]:_0x55b4ea});});if(_0x3e3bf3){_0x9bdbb5['push']({'pauseType':_0x3e3bf3});}}else if(_0x5daebe){_0xbe3aaa['forEach'](function(_0x299069){_0x9bdbb5[_0x66cb('0x32')]({[_0x299069+_0x66cb('0x35')]:![]});});}_0x20dbd4[_0x66cb('0x36')]=_[_0x66cb('0x37')](_0x20dbd4['where'],{'$and':_0x9bdbb5});if(_0x578ed4['user']['role']===_0x66cb('0x38')){var _0x18bbb5={'params':{'id':_0x578ed4[_0x66cb('0x38')]['userProfileId']},'query':{'section':_0x66cb('0x39'),'role':_0x66cb('0x2f'),'raw':!![],'ids':_0xc74ee7,'customSorting':_0x4b1818}};if(_0x578ed4[_0x66cb('0x12')]['online']){_0x18bbb5['query'][_0x66cb('0x3a')]=!![];}if(_0x34bc2b){_0x18bbb5[_0x66cb('0x12')][_0x66cb('0x3b')]=_0x9bdbb5;}_0x18bbb5['query']=Object[_0x66cb('0x3c')](_0x18bbb5[_0x66cb('0x12')],_0x578ed4[_0x66cb('0x12')]);return db[_0x66cb('0x3d')][_0x66cb('0x3e')](_0x18bbb5);}return db[_0x66cb('0x29')][_0x66cb('0x3f')](_0x20dbd4);})[_0x66cb('0x17')](function(_0x2540ef){_0x2d86f6['count']=_0x2540ef['count'];_0x5968f8=_0x2540ef['rows'];return _0x5968f8[_0x66cb('0x28')](function(_0xce81cf){var _0x390139=_[_0x66cb('0x40')](_0x36fe49,['id',_0xce81cf['id']]);if(_0x390139){var _0x316833=rta[_0x66cb('0x41')](_0x390139);_[_0x66cb('0x37')](_0xce81cf,_0x316833);}_0xce81cf['globalStatus']=rta[_0x66cb('0x42')](_0xce81cf);if(_0xce81cf[_0x66cb('0x1f')][_0x66cb('0x1e')](_0x66cb('0x15'))){_0xbe3aaa[_0x66cb('0x43')](function(_0x4acb4c){if(_0xce81cf[_0x4acb4c+_0x66cb('0x35')]){if(_0x4acb4c===_0x66cb('0x44')){if(_0xce81cf[_0x66cb('0x45')]!=='talking'){_0xce81cf[_0x66cb('0x45')]=_0x66cb('0x15');}}else{_0xce81cf[_0x4acb4c+'Status']=_0x66cb('0x15');}}});}return _0xce81cf;});})['then'](function(_0x239de0){if(!_0x205fbf||_0x4b1818){return _0x239de0;}return rta[_0x66cb('0x46')](_0x239de0,_0x205fbf);})[_0x66cb('0x17')](function(_0x5ab5fd){var _0x16ff1f=rta[_0x66cb('0x47')]();_0x2d86f6[_0x66cb('0x25')]=_0x5ab5fd['map'](function(_0x4ef338){return _[_0x66cb('0x48')](_0x4ef338,_0x16ff1f);});return _0x2d86f6;})[_0x66cb('0x17')](respondWithFilteredResult(_0x221e1c,_0x20dbd4))[_0x66cb('0x49')](APIHandleError(_0x221e1c));};exports['getQueues']=function(_0x12141d,_0x255393){var _0x46ff4d={'count':0x0,'rows':[]};var _0x2f61a6={};var _0x128c22;var _0x2e96db;var _0x4cfb14;Promise[_0x66cb('0x4a')]()[_0x66cb('0x17')](function(){if(_0x12141d[_0x66cb('0x12')][_0x66cb('0x19')]){if(!utils['isValidChannel'](_0x12141d[_0x66cb('0x12')][_0x66cb('0x19')])){throw new APIBadRequestError(util[_0x66cb('0x1a')](_0x66cb('0x1b'),_0x12141d[_0x66cb('0x12')][_0x66cb('0x19')]));}_0x128c22=_0x12141d['query']['channel'][_0x66cb('0x1c')]();}var _0x489330=_[_0x66cb('0x4b')](_0x128c22)+_0x66cb('0x4c');var _0x16df76=_[_0x66cb('0x28')](db[_0x489330][_0x66cb('0x2a')],function(_0x291ce6){return{'name':_0x291ce6['fieldName'],'type':_0x291ce6[_0x66cb('0x2c')]['key']};});if(!_0x12141d[_0x66cb('0x12')][_0x66cb('0x22')]){var _0x2b2dc8=['id',_0x66cb('0x4d')];if(_0x128c22===_0x66cb('0x44')){_0x2b2dc8[_0x66cb('0x32')](_0x66cb('0x2c'));if(_0x12141d['query'][_0x66cb('0x2c')]===_0x66cb('0x4e')){_0x2b2dc8['push']([_0x66cb('0x4f'),_0x66cb('0x50')]);}}_0x12141d[_0x66cb('0x12')][_0x66cb('0x22')]=_0x2b2dc8[_0x66cb('0x51')](',');}_0x2f61a6=qs['getOptions'](_0x16df76,_0x12141d);if(_0x12141d[_0x66cb('0x38')]['role']===_0x66cb('0x38')){var _0x12b634={'params':{'id':_0x12141d[_0x66cb('0x38')][_0x66cb('0x52')]},'query':{'section':_0x128c22===_0x66cb('0x44')&&_0x12141d['query']['type']===_0x66cb('0x4e')?'QueueCampaigns':_[_0x66cb('0x4b')](_0x128c22)+_0x66cb('0x53'),'type':_0x12141d[_0x66cb('0x12')][_0x66cb('0x2c')],'nolimit':!![],'sort':_0x66cb('0x4d'),'filter':_0x12141d[_0x66cb('0x12')][_0x66cb('0x54')]}};_0x12b634[_0x66cb('0x12')]=Object[_0x66cb('0x3c')](_0x12b634[_0x66cb('0x12')],_0x12141d[_0x66cb('0x12')]);delete _0x12b634['query']['id'];return db[_0x66cb('0x3d')]['getResources'](_0x12b634);}return db[_0x489330]['findAndCountAll'](_0x2f61a6);})[_0x66cb('0x17')](function(_0x40d811){_0x46ff4d[_0x66cb('0xb')]=_0x40d811['count'];_0x2e96db=_0x40d811['rows'];return rtq['getRealtimeQueues'](_0x12141d,_0x128c22);})[_0x66cb('0x17')](function(_0x426a1c){_0x4cfb14=_0x426a1c['rows'];return rtq[_0x66cb('0x55')](_0x2e96db,_0x4cfb14,_0x128c22,_0x12141d['query'][_0x66cb('0x2c')]);})['then'](function(_0x3a8504){_0x46ff4d[_0x66cb('0x25')]=_0x3a8504;return _0x46ff4d;})[_0x66cb('0x17')](respondWithFilteredResult(_0x255393,_0x2f61a6))['catch'](APIHandleError(_0x255393));}; \ No newline at end of file +var _0xe1e1=['getRealtimeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../mysqldb','../../errors/api','APIBadRequestError','offset','limit','undefined','count','set','Content-Range','json','getChannels','query','pauseTypeFilter','*pause','resolve','then','isValidChannel','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','includes','globalStatus','fields','join','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','length','map','User','key','role','getOptions','raw','push','literal','FIELD(id,','order','forEach','Pause','where','merge','user','Agents','agent','online','assign','UserProfile','getResources','findAndCountAll','filterAgentAttributes','pause','voice','voiceStatus','talking','Status','getRealtimeAgentsQueryFields','pick','catch','getQueues','toLowerCase','startCase','fieldName','type','name','dialActive','userProfileId','Queues'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe1e1,0xe2));var _0x1e1e=function(_0x24cea3,_0x463f04){_0x24cea3=_0x24cea3-0x0;var _0x3dc9f7=_0xe1e1[_0x24cea3];return _0x3dc9f7;};'use strict';var _=require(_0x1e1e('0x0'));var util=require(_0x1e1e('0x1'));var rta=require(_0x1e1e('0x2'));var rtq=require(_0x1e1e('0x3'));var qs=require(_0x1e1e('0x4'));var utils=require('../../config/utils');var db=require(_0x1e1e('0x5'))['db'];var APIBadRequestError=require(_0x1e1e('0x6'))[_0x1e1e('0x7')];var APIHandleError=require(_0x1e1e('0x6'))['handleError'];function respondWithFilteredResult(_0x435f02,_0x5b63a5){return function(_0x387641){if(_0x387641){var _0xf8ec18=typeof _0x5b63a5[_0x1e1e('0x8')]==='undefined'&&typeof _0x5b63a5[_0x1e1e('0x9')]===_0x1e1e('0xa');var _0xa1949a=_0x387641['count'];var _0x20a474=_0xf8ec18?0x0:_0x5b63a5[_0x1e1e('0x8')];var _0x38878c=_0xf8ec18?_0x387641[_0x1e1e('0xb')]:_0x5b63a5[_0x1e1e('0x8')]+_0x5b63a5['limit'];var _0x5446a4;if(_0x38878c>=_0xa1949a){_0x38878c=_0xa1949a;_0x5446a4=0xc8;}else{_0x5446a4=0xce;}_0x435f02['status'](_0x5446a4);return _0x435f02[_0x1e1e('0xc')](_0x1e1e('0xd'),_0x20a474+'-'+_0x38878c+'/'+_0xa1949a)[_0x1e1e('0xe')](_0x387641);}return null;};}exports['getAgents']=function(_0x18b143,_0x3e9149){var _0x11d471={'count':0x0,'rows':[]};var _0x2e5473={};var _0x498709;var _0x259ba9=utils[_0x1e1e('0xf')]();var _0x3db912;var _0x1c0db9;var _0x882724=_0x18b143[_0x1e1e('0x10')]['globalQueueFilter'];var _0x17ca4b=_0x18b143[_0x1e1e('0x10')]['globalStatusFilter'];var _0x101f0c=_0x18b143[_0x1e1e('0x10')][_0x1e1e('0x11')];var _0x35b2d6=_0x17ca4b==='pause'||_0x17ca4b===_0x1e1e('0x12')?!![]:![];var _0x2fb21e=[];var _0x1065d0;var _0x425b49;Promise[_0x1e1e('0x13')]()[_0x1e1e('0x14')](function(){if(_0x18b143['query']['channel']){if(!utils[_0x1e1e('0x15')](_0x18b143[_0x1e1e('0x10')][_0x1e1e('0x16')])){throw new APIBadRequestError(util[_0x1e1e('0x17')](_0x1e1e('0x18'),_0x18b143[_0x1e1e('0x10')][_0x1e1e('0x16')]));}_0x498709=_0x18b143['query']['channel']['toLowerCase']();}if(!_0x18b143[_0x1e1e('0x10')]['sort']||!_0x18b143[_0x1e1e('0x10')][_0x1e1e('0x19')][_0x1e1e('0x1a')](_0x1e1e('0x1b'))){_0x18b143[_0x1e1e('0x10')][_0x1e1e('0x19')]=rta['validateSortParameter'](_0x18b143['query']['sort']);return;}var _0x3bd777=rta['getUpdatedSortOptions'](_0x18b143['query'][_0x1e1e('0x19')]);_0x18b143[_0x1e1e('0x10')][_0x1e1e('0x19')]=_0x3bd777[_0x1e1e('0x1c')][_0x1e1e('0x1d')](',');_0x1065d0=_0x3bd777['order'];})[_0x1e1e('0x14')](function(){if(!_0x882724){return[];}return rta[_0x1e1e('0x1e')](_0x882724,_0x498709);})[_0x1e1e('0x14')](function(_0x540318){_0x2fb21e=_0x540318;return rta['getRealtimeAgents']();})[_0x1e1e('0x14')](function(_0x26d41b){_0x1c0db9=_0x26d41b[_0x1e1e('0x1f')];if((!_0x17ca4b||_0x35b2d6)&&!_0x1065d0){return _0x2fb21e;}if(_0x1065d0&&!_0x17ca4b){return rta[_0x1e1e('0x20')](_0x1c0db9,_0x2fb21e,_0x1065d0);}else{return rta['getAgentIdsByStatus'](_0x1c0db9,_0x2fb21e,_0x17ca4b);}})[_0x1e1e('0x14')](function(_0xdc93d1){_0x2fb21e=_0xdc93d1;var _0x19b171=![];if(_0x2fb21e[_0x1e1e('0x21')]===0x0){if(_0x882724||_0x17ca4b){_0x19b171=!![];}if(_0x35b2d6){_0x19b171=![];}}if(_0x19b171){return _0x11d471;}var _0x1d83be=_[_0x1e1e('0x22')](db[_0x1e1e('0x23')]['rawAttributes'],function(_0xe0d385){return{'name':_0xe0d385['fieldName'],'type':_0xe0d385['type'][_0x1e1e('0x24')]};});_0x18b143[_0x1e1e('0x10')][_0x1e1e('0x25')]='agent';_0x2e5473=qs[_0x1e1e('0x26')](_0x1d83be,_0x18b143);_0x2e5473[_0x1e1e('0x27')]=!![];var _0x128779=[];if(_0x2fb21e['length']>0x0){_0x128779[_0x1e1e('0x28')]({'id':{'$in':_0x2fb21e}});if(_0x1065d0&&!_0x17ca4b){_0x425b49=[db['sequelize'][_0x1e1e('0x29')](_0x1e1e('0x2a')+_0x2fb21e+')')];_0x2e5473[_0x1e1e('0x2b')]=_0x425b49;}}if(_0x35b2d6){_0x259ba9[_0x1e1e('0x2c')](function(_0x4deeed){var _0x338ee2=!![];if(_0x17ca4b===_0x1e1e('0x12')&&_0x498709!==_0x4deeed){_0x338ee2=![];}_0x128779['push']({[_0x4deeed+_0x1e1e('0x2d')]:_0x338ee2});});if(_0x101f0c){_0x128779[_0x1e1e('0x28')]({'pauseType':_0x101f0c});}}else if(_0x17ca4b){_0x259ba9['forEach'](function(_0x37f550){_0x128779['push']({[_0x37f550+_0x1e1e('0x2d')]:![]});});}_0x2e5473[_0x1e1e('0x2e')]=_[_0x1e1e('0x2f')](_0x2e5473[_0x1e1e('0x2e')],{'$and':_0x128779});if(_0x18b143[_0x1e1e('0x30')][_0x1e1e('0x25')]===_0x1e1e('0x30')){var _0xf8585c={'params':{'id':_0x18b143[_0x1e1e('0x30')]['userProfileId']},'query':{'section':_0x1e1e('0x31'),'role':_0x1e1e('0x32'),'raw':!![],'ids':_0x2fb21e,'customSorting':_0x425b49}};if(_0x18b143[_0x1e1e('0x10')][_0x1e1e('0x33')]){_0xf8585c[_0x1e1e('0x10')][_0x1e1e('0x33')]=!![];}if(_0x35b2d6){_0xf8585c[_0x1e1e('0x10')]['extraQueryConditions']=_0x128779;}_0xf8585c['query']=Object[_0x1e1e('0x34')](_0xf8585c['query'],_0x18b143[_0x1e1e('0x10')]);return db[_0x1e1e('0x35')][_0x1e1e('0x36')](_0xf8585c);}return db[_0x1e1e('0x23')][_0x1e1e('0x37')](_0x2e5473);})['then'](function(_0xa9f590){_0x11d471[_0x1e1e('0xb')]=_0xa9f590[_0x1e1e('0xb')];_0x3db912=_0xa9f590[_0x1e1e('0x1f')];return _0x3db912[_0x1e1e('0x22')](function(_0x2c6d46){var _0x3e9c04=_['find'](_0x1c0db9,['id',_0x2c6d46['id']]);if(_0x3e9c04){var _0x239383=rta[_0x1e1e('0x38')](_0x3e9c04);_[_0x1e1e('0x2f')](_0x2c6d46,_0x239383);}_0x2c6d46[_0x1e1e('0x1b')]=rta['getAgentStatus'](_0x2c6d46);if(_0x2c6d46['globalStatus']['includes'](_0x1e1e('0x39'))){_0x259ba9['forEach'](function(_0x264090){if(_0x2c6d46[_0x264090+'Pause']){if(_0x264090===_0x1e1e('0x3a')){if(_0x2c6d46[_0x1e1e('0x3b')]!==_0x1e1e('0x3c')){_0x2c6d46['voiceStatus']='pause';}}else{_0x2c6d46[_0x264090+_0x1e1e('0x3d')]=_0x1e1e('0x39');}}});}return _0x2c6d46;});})['then'](function(_0x4a0435){if(!_0x1065d0||_0x425b49){return _0x4a0435;}return rta['sortAgentsByStatus'](_0x4a0435,_0x1065d0);})[_0x1e1e('0x14')](function(_0x587f32){var _0x3baffe=rta[_0x1e1e('0x3e')]();_0x11d471['rows']=_0x587f32['map'](function(_0x905c77){return _[_0x1e1e('0x3f')](_0x905c77,_0x3baffe);});return _0x11d471;})[_0x1e1e('0x14')](respondWithFilteredResult(_0x3e9149,_0x2e5473))[_0x1e1e('0x40')](APIHandleError(_0x3e9149));};exports[_0x1e1e('0x41')]=function(_0x2433ed,_0x34d135){var _0x431cb6={'count':0x0,'rows':[]};var _0x57828a={};var _0x1d91fb;var _0x484779;var _0x5d4c4a;Promise[_0x1e1e('0x13')]()[_0x1e1e('0x14')](function(){if(_0x2433ed[_0x1e1e('0x10')][_0x1e1e('0x16')]){if(!utils[_0x1e1e('0x15')](_0x2433ed[_0x1e1e('0x10')][_0x1e1e('0x16')])){throw new APIBadRequestError(util[_0x1e1e('0x17')](_0x1e1e('0x18'),_0x2433ed[_0x1e1e('0x10')][_0x1e1e('0x16')]));}_0x1d91fb=_0x2433ed[_0x1e1e('0x10')]['channel'][_0x1e1e('0x42')]();}var _0x1ca7e5=_[_0x1e1e('0x43')](_0x1d91fb)+'Queue';var _0x34c14f=_[_0x1e1e('0x22')](db[_0x1ca7e5]['rawAttributes'],function(_0xda2c4f){return{'name':_0xda2c4f[_0x1e1e('0x44')],'type':_0xda2c4f[_0x1e1e('0x45')]['key']};});if(!_0x2433ed[_0x1e1e('0x10')]['fields']){var _0x52d0bf=['id',_0x1e1e('0x46')];if(_0x1d91fb===_0x1e1e('0x3a')){_0x52d0bf['push'](_0x1e1e('0x45'));if(_0x2433ed['query'][_0x1e1e('0x45')]==='outbound'){_0x52d0bf[_0x1e1e('0x28')]([_0x1e1e('0x47'),'dialMethod']);}}_0x2433ed[_0x1e1e('0x10')][_0x1e1e('0x1c')]=_0x52d0bf['join'](',');}_0x57828a=qs[_0x1e1e('0x26')](_0x34c14f,_0x2433ed);if(_0x2433ed[_0x1e1e('0x30')]['role']===_0x1e1e('0x30')){var _0x32ddd9={'params':{'id':_0x2433ed[_0x1e1e('0x30')][_0x1e1e('0x48')]},'query':{'section':_0x1d91fb===_0x1e1e('0x3a')&&_0x2433ed[_0x1e1e('0x10')][_0x1e1e('0x45')]==='outbound'?'QueueCampaigns':_[_0x1e1e('0x43')](_0x1d91fb)+_0x1e1e('0x49'),'type':_0x2433ed['query'][_0x1e1e('0x45')],'nolimit':!![],'sort':_0x1e1e('0x46'),'filter':_0x2433ed['query']['filter']}};_0x32ddd9['query']=Object['assign'](_0x32ddd9[_0x1e1e('0x10')],_0x2433ed[_0x1e1e('0x10')]);delete _0x32ddd9[_0x1e1e('0x10')]['id'];return db['UserProfile']['getResources'](_0x32ddd9);}return db[_0x1ca7e5][_0x1e1e('0x37')](_0x57828a);})[_0x1e1e('0x14')](function(_0x550336){_0x431cb6[_0x1e1e('0xb')]=_0x550336[_0x1e1e('0xb')];_0x484779=_0x550336[_0x1e1e('0x1f')];return rtq[_0x1e1e('0x4a')](_0x2433ed,_0x1d91fb);})[_0x1e1e('0x14')](function(_0x9bfcbc){_0x5d4c4a=_0x9bfcbc[_0x1e1e('0x1f')];return rtq['initializeQueues'](_0x484779,_0x5d4c4a,_0x1d91fb,_0x2433ed[_0x1e1e('0x10')][_0x1e1e('0x45')]);})[_0x1e1e('0x14')](function(_0x2724cb){_0x431cb6[_0x1e1e('0x1f')]=_0x2724cb;return _0x431cb6;})['then'](respondWithFilteredResult(_0x34d135,_0x57828a))[_0x1e1e('0x40')](APIHandleError(_0x34d135));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index cba928f..40d670a 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x389fee,_0x18baf5){var _0x1511f6=function(_0x4c27f1){while(--_0x4c27f1){_0x389fee['push'](_0x389fee['shift']());}};_0x1511f6(++_0x18baf5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x39aa6c,_0x1cb0b2){var _0x5e86c5=function(_0x522f1f){while(--_0x522f1f){_0x39aa6c['push'](_0x39aa6c['shift']());}};_0x5e86c5(++_0x1cb0b2);}(_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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index a56f54a..b08e3c6 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 _0xfc65=['INTEGER','sequelize','STRING','DATE'];(function(_0xcb66c,_0x51d718){var _0x50af38=function(_0x25f466){while(--_0x25f466){_0xcb66c['push'](_0xcb66c['shift']());}};_0x50af38(++_0x51d718);}(_0xfc65,0x1e1));var _0x5fc6=function(_0xa394d7,_0x43f1a3){_0xa394d7=_0xa394d7-0x0;var _0xd75d2f=_0xfc65[_0xa394d7];return _0xd75d2f;};'use strict';var Sequelize=require(_0x5fc6('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x5fc6('0x1')]},'scheduledat':{'type':Sequelize[_0x5fc6('0x2')]},'uniqueid':{'type':Sequelize[_0x5fc6('0x1')]},'starttime':{'type':Sequelize[_0x5fc6('0x2')]},'responsetime':{'type':Sequelize[_0x5fc6('0x2')]},'ringtime':{'type':Sequelize[_0x5fc6('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x5fc6('0x1')]},'campaigntype':{'type':Sequelize[_0x5fc6('0x1')]},'membername':{'type':Sequelize[_0x5fc6('0x1')]}}; \ No newline at end of file +var _0x1db9=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x4ccd05,_0x33ab5f){var _0xa108e6=function(_0x1f37aa){while(--_0x1f37aa){_0x4ccd05['push'](_0x4ccd05['shift']());}};_0xa108e6(++_0x33ab5f);}(_0x1db9,0x176));var _0x91db=function(_0x151a98,_0x26abd6){_0x151a98=_0x151a98-0x0;var _0x4f8374=_0x1db9[_0x151a98];return _0x4f8374;};'use strict';var Sequelize=require(_0x91db('0x0'));module[_0x91db('0x1')]={'state':{'type':Sequelize[_0x91db('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x91db('0x3')]},'scheduledat':{'type':Sequelize[_0x91db('0x4')]},'uniqueid':{'type':Sequelize[_0x91db('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x91db('0x4')]},'ringtime':{'type':Sequelize[_0x91db('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x91db('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index da006a2..a47115e 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 _0x153b=['../../config/environment','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x656b37,_0xf42532){var _0x131459=function(_0x37eebc){while(--_0x37eebc){_0x656b37['push'](_0x656b37['shift']());}};_0x131459(++_0xf42532);}(_0x153b,0x1b2));var _0xb153=function(_0x242aec,_0x22a0da){_0x242aec=_0x242aec-0x0;var _0x560978=_0x153b[_0x242aec];return _0x560978;};'use strict';var _=require(_0xb153('0x0'));var util=require(_0xb153('0x1'));var logger=require(_0xb153('0x2'))(_0xb153('0x3'));var moment=require(_0xb153('0x4'));var BPromise=require(_0xb153('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb153('0x6'));var rimraf=require(_0xb153('0x7'));var config=require(_0xb153('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0xb153('0x9')]=function(_0x5e1841,_0x9f78f0){return _0x5e1841[_0xb153('0xa')](_0xb153('0xb'),attributes,{'tableName':_0xb153('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcadc=['ReportAgentPreview','report_agent_preview','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0xcadc,0x1a6));var _0xccad=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcadc[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xccad('0x0'));var logger=require(_0xccad('0x1'))(_0xccad('0x2'));var moment=require(_0xccad('0x3'));var BPromise=require('bluebird');var rp=require(_0xccad('0x4'));var fs=require('fs');var path=require(_0xccad('0x5'));var rimraf=require(_0xccad('0x6'));var config=require(_0xccad('0x7'));var attributes=require(_0xccad('0x8'));module[_0xccad('0x9')]=function(_0x2c853c,_0x794432){return _0x2c853c['define'](_0xccad('0xa'),attributes,{'tableName':_0xccad('0xb'),'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 24a0138..174c404 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 _0xaef0=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','util','moment'];(function(_0x1fdde1,_0x35f4db){var _0x5e8d00=function(_0x52ba38){while(--_0x52ba38){_0x1fdde1['push'](_0x1fdde1['shift']());}};_0x5e8d00(++_0x35f4db);}(_0xaef0,0x142));var _0x0aef=function(_0xe5b349,_0x5f06e4){_0xe5b349=_0xe5b349-0x0;var _0x26b0ad=_0xaef0[_0xe5b349];return _0x26b0ad;};'use strict';var _=require('lodash');var util=require(_0x0aef('0x0'));var moment=require(_0x0aef('0x1'));var BPromise=require('bluebird');var rs=require(_0x0aef('0x2'));var fs=require('fs');var Redis=require(_0x0aef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0aef('0x4'));var logger=require(_0x0aef('0x5'))('rpc');var config=require(_0x0aef('0x6'));var jayson=require(_0x0aef('0x7'));var client=jayson[_0x0aef('0x8')][_0x0aef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc8da5d,_0x5d9708,_0x1bbb2d){return new BPromise(function(_0x1cb9f6,_0xa6c731){return client[_0x0aef('0xa')](_0xc8da5d,_0x1bbb2d)[_0x0aef('0xb')](function(_0x16066c){logger[_0x0aef('0xc')](_0x0aef('0xd'),_0x5d9708,'request\x20sent');logger[_0x0aef('0xe')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x5d9708,_0x0aef('0xf'),JSON[_0x0aef('0x10')](_0x16066c));if(_0x16066c[_0x0aef('0x11')]){if(_0x16066c[_0x0aef('0x11')][_0x0aef('0x12')]===0x1f4){logger[_0x0aef('0x11')](_0x0aef('0xd'),_0x5d9708,_0x16066c['error']['message']);return _0xa6c731(_0x16066c[_0x0aef('0x11')]['message']);}logger['error'](_0x0aef('0xd'),_0x5d9708,_0x16066c['error'][_0x0aef('0x13')]);return _0x1cb9f6(_0x16066c['error'][_0x0aef('0x13')]);}else{logger[_0x0aef('0xc')](_0x0aef('0xd'),_0x5d9708,_0x0aef('0xf'));_0x1cb9f6(_0x16066c[_0x0aef('0x14')][_0x0aef('0x13')]);}})[_0x0aef('0x15')](function(_0x5a247b){logger[_0x0aef('0x11')](_0x0aef('0xd'),_0x5d9708,_0x5a247b);_0xa6c731(_0x5a247b);});});}exports[_0x0aef('0x16')]=function(_0x486493){var _0x27b269=this;return new Promise(function(_0x84bbe6,_0x3c4abe){return db[_0x0aef('0x17')]['create'](_0x486493[_0x0aef('0x18')],{'raw':_0x486493[_0x0aef('0x19')]?_0x486493[_0x0aef('0x19')][_0x0aef('0x1a')]===undefined?!![]:![]:!![]})[_0x0aef('0xb')](function(_0x394627){logger[_0x0aef('0xc')]('CreateReportAgentPreview',_0x486493);logger['debug'](_0x0aef('0x16'),_0x486493,JSON[_0x0aef('0x10')](_0x394627));_0x84bbe6(_0x394627);})[_0x0aef('0x15')](function(_0xc6d07e){logger[_0x0aef('0x11')](_0x0aef('0x16'),_0xc6d07e[_0x0aef('0x13')],_0x486493);_0x3c4abe(_0x27b269[_0x0aef('0x11')](0x1f4,_0xc6d07e[_0x0aef('0x13')]));});});}; \ No newline at end of file +var _0xda74=['moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview','create','body','raw','lodash'];(function(_0x2fd160,_0x53c0d6){var _0x5c2031=function(_0x8ecfa5){while(--_0x8ecfa5){_0x2fd160['push'](_0x2fd160['shift']());}};_0x5c2031(++_0x53c0d6);}(_0xda74,0x7c));var _0x4da7=function(_0x2c0870,_0x15ec7a){_0x2c0870=_0x2c0870-0x0;var _0x231d2d=_0xda74[_0x2c0870];return _0x231d2d;};'use strict';var _=require(_0x4da7('0x0'));var util=require('util');var moment=require(_0x4da7('0x1'));var BPromise=require('bluebird');var rs=require(_0x4da7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4da7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4da7('0x4'))(_0x4da7('0x5'));var config=require(_0x4da7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4da7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18f64b,_0x2f6a93,_0x247592){return new BPromise(function(_0x5a8bf2,_0x59ade4){return client[_0x4da7('0x8')](_0x18f64b,_0x247592)[_0x4da7('0x9')](function(_0x24be31){logger[_0x4da7('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x2f6a93,_0x4da7('0xb'));logger[_0x4da7('0xc')](_0x4da7('0xd'),_0x2f6a93,_0x4da7('0xb'),JSON[_0x4da7('0xe')](_0x24be31));if(_0x24be31[_0x4da7('0xf')]){if(_0x24be31['error'][_0x4da7('0x10')]===0x1f4){logger[_0x4da7('0xf')](_0x4da7('0x11'),_0x2f6a93,_0x24be31[_0x4da7('0xf')][_0x4da7('0x12')]);return _0x59ade4(_0x24be31[_0x4da7('0xf')]['message']);}logger[_0x4da7('0xf')](_0x4da7('0x11'),_0x2f6a93,_0x24be31[_0x4da7('0xf')][_0x4da7('0x12')]);return _0x5a8bf2(_0x24be31[_0x4da7('0xf')][_0x4da7('0x12')]);}else{logger['info'](_0x4da7('0x11'),_0x2f6a93,'request\x20sent');_0x5a8bf2(_0x24be31[_0x4da7('0x13')][_0x4da7('0x12')]);}})[_0x4da7('0x14')](function(_0x5941e0){logger[_0x4da7('0xf')](_0x4da7('0x11'),_0x2f6a93,_0x5941e0);_0x59ade4(_0x5941e0);});});}exports[_0x4da7('0x15')]=function(_0x1f5107){var _0xa241ac=this;return new Promise(function(_0x496414,_0x55208b){return db['ReportAgentPreview'][_0x4da7('0x16')](_0x1f5107[_0x4da7('0x17')],{'raw':_0x1f5107['options']?_0x1f5107['options'][_0x4da7('0x18')]===undefined?!![]:![]:!![]})[_0x4da7('0x9')](function(_0x2b5228){logger['info'](_0x4da7('0x15'),_0x1f5107);logger[_0x4da7('0xc')](_0x4da7('0x15'),_0x1f5107,JSON[_0x4da7('0xe')](_0x2b5228));_0x496414(_0x2b5228);})['catch'](function(_0x1a336a){logger[_0x4da7('0xf')]('CreateReportAgentPreview',_0x1a336a[_0x4da7('0x12')],_0x1f5107);_0x55208b(_0xa241ac[_0x4da7('0xf')](0x1f4,_0x1a336a[_0x4da7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 93e4558..b269270 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 _0x1aa6=['/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','agents','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1aa6,0xcb));var _0x61aa=function(_0x38b2d9,_0x19fd42){_0x38b2d9=_0x38b2d9-0x0;var _0x23a3e1=_0x1aa6[_0x38b2d9];return _0x23a3e1;};'use strict';var multer=require(_0x61aa('0x0'));var util=require(_0x61aa('0x1'));var path=require(_0x61aa('0x2'));var express=require(_0x61aa('0x3'));var router=express[_0x61aa('0x4')]();var auth=require(_0x61aa('0x5'));var controller=require(_0x61aa('0x6'));router[_0x61aa('0x7')](_0x61aa('0x8'),auth[_0x61aa('0x9')](),controller[_0x61aa('0xa')]);router[_0x61aa('0x7')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x61aa('0xb')]);router['get'](_0x61aa('0xc'),auth[_0x61aa('0x9')](),controller[_0x61aa('0xd')]);router[_0x61aa('0x7')](_0x61aa('0xe'),auth['isAuthenticated'](),controller[_0x61aa('0xf')]);router[_0x61aa('0x7')](_0x61aa('0x10'),auth[_0x61aa('0x9')](),controller['chatQueues']);router[_0x61aa('0x7')](_0x61aa('0x11'),auth[_0x61aa('0x9')](),controller['mailQueues']);router[_0x61aa('0x7')]('/mail/accounts',auth[_0x61aa('0x9')](),controller[_0x61aa('0x12')]);router['get']('/openchannel/queues',auth[_0x61aa('0x9')](),controller[_0x61aa('0x13')]);router[_0x61aa('0x7')](_0x61aa('0x14'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x15')]);router[_0x61aa('0x7')]('/whatsapp/queues',auth['isAuthenticated'](),controller[_0x61aa('0x16')]);router['get'](_0x61aa('0x17'),auth['isAuthenticated'](),controller[_0x61aa('0x18')]);router[_0x61aa('0x7')]('/voice/queues/preview/:id',auth[_0x61aa('0x9')](),controller['voiceQueuesPreview']);router['get']('/voice/queues/channels',auth['isAuthenticated'](),controller['voiceQueuesChannels']);router[_0x61aa('0x7')](_0x61aa('0x19'),auth[_0x61aa('0x9')](),controller['voiceQueuesChannel']);router[_0x61aa('0x7')](_0x61aa('0x1a'),auth[_0x61aa('0x9')](),controller['voiceQueuesChannelHangup']);router[_0x61aa('0x7')](_0x61aa('0x1b'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x1c')]);router[_0x61aa('0x7')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x61aa('0x1d')]);router[_0x61aa('0x1e')]('/voice/queues/:id',auth[_0x61aa('0x9')](),controller[_0x61aa('0x1f')]);router[_0x61aa('0x7')](_0x61aa('0x20'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x21')]);router['get'](_0x61aa('0x22'),auth[_0x61aa('0x9')](),controller['outboundChannels']);router[_0x61aa('0x7')](_0x61aa('0x23'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x24')]);router[_0x61aa('0x1e')]('/agents/:id/capacity',auth[_0x61aa('0x9')](),controller[_0x61aa('0x25')]);router[_0x61aa('0x7')](_0x61aa('0x26'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x27')]);router[_0x61aa('0x7')]('/trunks',auth[_0x61aa('0x9')](),controller[_0x61aa('0x28')]);router[_0x61aa('0x7')](_0x61aa('0x29'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x2a')]);router['get'](_0x61aa('0x2b'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x2c')]);router['get'](_0x61aa('0x2d'),auth['isAuthenticated'](),controller[_0x61aa('0x2e')]);router[_0x61aa('0x7')](_0x61aa('0x2f'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x30')]);router['get'](_0x61aa('0x31'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x32')]);router[_0x61aa('0x7')](_0x61aa('0x33'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x34')]);router[_0x61aa('0x7')]('/sms/queues/waitinginteractions',auth[_0x61aa('0x9')](),controller[_0x61aa('0x35')]);router[_0x61aa('0x7')](_0x61aa('0x36'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x37')]);router[_0x61aa('0x7')](_0x61aa('0x38'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x39')]);router[_0x61aa('0x3a')](_0x61aa('0x3b'),auth['isAuthenticated'](),controller['queueNotify'](_0x61aa('0x3c')));router[_0x61aa('0x7')]('/mail/queues/:id',auth[_0x61aa('0x9')](),controller[_0x61aa('0x3d')]);router[_0x61aa('0x3a')](_0x61aa('0x3e'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x3f')](_0x61aa('0x40')));router[_0x61aa('0x7')](_0x61aa('0x41'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x42')]);router[_0x61aa('0x3a')]('/fax/queues/:id/notify',auth[_0x61aa('0x9')](),controller[_0x61aa('0x3f')](_0x61aa('0x43')));router['get']('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x61aa('0x44')]);router[_0x61aa('0x3a')](_0x61aa('0x45'),auth[_0x61aa('0x9')](),controller['queueNotify'](_0x61aa('0x46')));router[_0x61aa('0x7')]('/openchannel/queues/:id',auth[_0x61aa('0x9')](),controller[_0x61aa('0x47')]);router[_0x61aa('0x3a')](_0x61aa('0x48'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x3f')](_0x61aa('0x49')));router[_0x61aa('0x3a')](_0x61aa('0x4a'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x3f')]('whatsapp'));router[_0x61aa('0x7')](_0x61aa('0x4b'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x4c')]);router['get'](_0x61aa('0x4d'),auth[_0x61aa('0x9')](),controller[_0x61aa('0x4e')]);router['post'](_0x61aa('0x4f'),auth['isAuthenticated'](),controller[_0x61aa('0x50')]);module[_0x61aa('0x51')]=router; \ No newline at end of file +var _0xfda2=['multer','util','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','agentNotify'];(function(_0x405838,_0xf863a9){var _0x539075=function(_0x5a6265){while(--_0x5a6265){_0x405838['push'](_0x405838['shift']());}};_0x539075(++_0xf863a9);}(_0xfda2,0x1ce));var _0x2fda=function(_0x492fe5,_0x4c6490){_0x492fe5=_0x492fe5-0x0;var _0x21020b=_0xfda2[_0x492fe5];return _0x21020b;};'use strict';var multer=require(_0x2fda('0x0'));var util=require(_0x2fda('0x1'));var path=require('path');var express=require(_0x2fda('0x2'));var router=express[_0x2fda('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0x2fda('0x4'));router[_0x2fda('0x5')](_0x2fda('0x6'),auth[_0x2fda('0x7')](),controller['voiceChannels']);router[_0x2fda('0x5')](_0x2fda('0x8'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0x2fda('0x5')](_0x2fda('0x9'),auth[_0x2fda('0x7')](),controller[_0x2fda('0xa')]);router[_0x2fda('0x5')](_0x2fda('0xb'),auth[_0x2fda('0x7')](),controller['voiceQueues']);router[_0x2fda('0x5')]('/chat/queues',auth['isAuthenticated'](),controller[_0x2fda('0xc')]);router[_0x2fda('0x5')]('/mail/queues',auth[_0x2fda('0x7')](),controller[_0x2fda('0xd')]);router['get'](_0x2fda('0xe'),auth[_0x2fda('0x7')](),controller[_0x2fda('0xf')]);router[_0x2fda('0x5')](_0x2fda('0x10'),auth['isAuthenticated'](),controller['openchannelQueues']);router[_0x2fda('0x5')](_0x2fda('0x11'),auth['isAuthenticated'](),controller[_0x2fda('0x12')]);router['get'](_0x2fda('0x13'),auth[_0x2fda('0x7')](),controller[_0x2fda('0x14')]);router[_0x2fda('0x5')](_0x2fda('0x15'),auth[_0x2fda('0x7')](),controller[_0x2fda('0x16')]);router[_0x2fda('0x5')]('/voice/queues/preview/:id',auth[_0x2fda('0x7')](),controller[_0x2fda('0x17')]);router[_0x2fda('0x5')](_0x2fda('0x18'),auth['isAuthenticated'](),controller[_0x2fda('0x19')]);router[_0x2fda('0x5')]('/voice/queues/channels/:uniqueid',auth[_0x2fda('0x7')](),controller[_0x2fda('0x1a')]);router[_0x2fda('0x5')](_0x2fda('0x1b'),auth[_0x2fda('0x7')](),controller['voiceQueuesChannelHangup']);router[_0x2fda('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x2fda('0x7')](),controller[_0x2fda('0x1c')]);router[_0x2fda('0x5')](_0x2fda('0x1d'),auth[_0x2fda('0x7')](),controller[_0x2fda('0x1e')]);router['put'](_0x2fda('0x1d'),auth[_0x2fda('0x7')](),controller[_0x2fda('0x1f')]);router['get']('/outbound',auth[_0x2fda('0x7')](),controller[_0x2fda('0x20')]);router[_0x2fda('0x5')](_0x2fda('0x21'),auth['isAuthenticated'](),controller[_0x2fda('0x22')]);router['get']('/agents',auth[_0x2fda('0x7')](),controller['agents']);router['put'](_0x2fda('0x23'),auth[_0x2fda('0x7')](),controller[_0x2fda('0x24')]);router[_0x2fda('0x5')](_0x2fda('0x25'),auth[_0x2fda('0x7')](),controller[_0x2fda('0x26')]);router[_0x2fda('0x5')](_0x2fda('0x27'),auth[_0x2fda('0x7')](),controller['trunks']);router[_0x2fda('0x5')]('/campaigns',auth[_0x2fda('0x7')](),controller[_0x2fda('0x28')]);router[_0x2fda('0x5')](_0x2fda('0x29'),auth[_0x2fda('0x7')](),controller[_0x2fda('0x2a')]);router[_0x2fda('0x5')](_0x2fda('0x2b'),auth[_0x2fda('0x7')](),controller[_0x2fda('0x2c')]);router[_0x2fda('0x5')](_0x2fda('0x2d'),auth[_0x2fda('0x7')](),controller[_0x2fda('0x2e')]);router['get'](_0x2fda('0x2f'),auth['isAuthenticated'](),controller[_0x2fda('0x30')]);router[_0x2fda('0x5')](_0x2fda('0x31'),auth[_0x2fda('0x7')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x2fda('0x5')](_0x2fda('0x32'),auth['isAuthenticated'](),controller[_0x2fda('0x33')]);router['get']('/whatsapp/queues/waitinginteractions',auth[_0x2fda('0x7')](),controller[_0x2fda('0x34')]);router[_0x2fda('0x5')](_0x2fda('0x35'),auth[_0x2fda('0x7')](),controller['faxQueuesWaitingInteractions']);router[_0x2fda('0x36')](_0x2fda('0x37'),auth['isAuthenticated'](),controller[_0x2fda('0x38')](_0x2fda('0x39')));router[_0x2fda('0x5')]('/mail/queues/:id',auth[_0x2fda('0x7')](),controller[_0x2fda('0x3a')]);router[_0x2fda('0x36')](_0x2fda('0x3b'),auth[_0x2fda('0x7')](),controller[_0x2fda('0x38')](_0x2fda('0x3c')));router[_0x2fda('0x5')](_0x2fda('0x3d'),auth[_0x2fda('0x7')](),controller[_0x2fda('0x3e')]);router[_0x2fda('0x36')](_0x2fda('0x3f'),auth[_0x2fda('0x7')](),controller[_0x2fda('0x38')](_0x2fda('0x40')));router[_0x2fda('0x5')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x2fda('0x41')]);router[_0x2fda('0x36')](_0x2fda('0x42'),auth[_0x2fda('0x7')](),controller['queueNotify'](_0x2fda('0x43')));router[_0x2fda('0x5')](_0x2fda('0x44'),auth[_0x2fda('0x7')](),controller[_0x2fda('0x45')]);router[_0x2fda('0x36')](_0x2fda('0x46'),auth['isAuthenticated'](),controller[_0x2fda('0x38')](_0x2fda('0x47')));router['post'](_0x2fda('0x48'),auth[_0x2fda('0x7')](),controller['queueNotify']('whatsapp'));router['get'](_0x2fda('0x49'),auth[_0x2fda('0x7')](),controller[_0x2fda('0x4a')]);router[_0x2fda('0x5')](_0x2fda('0x4b'),auth[_0x2fda('0x7')](),controller['showWhatsappQueues']);router[_0x2fda('0x36')]('/agents/:id/notify',auth[_0x2fda('0x7')](),controller[_0x2fda('0x4c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 706ffb3..c7fff76 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 _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x569a90,_0x57bd2a){var _0xc6ae24=function(_0x386a30){while(--_0x386a30){_0x569a90['push'](_0x569a90['shift']());}};_0xc6ae24(++_0x57bd2a);}(_0xe706,0xa3));var _0x6e70=function(_0x127af0,_0x49fbc5){_0x127af0=_0x127af0-0x0;var _0x1fc410=_0xe706[_0x127af0];return _0x1fc410;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file +var _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x33a497,_0x544a62){var _0x708cfa=function(_0x3b4e11){while(--_0x3b4e11){_0x33a497['push'](_0x33a497['shift']());}};_0x708cfa(++_0x544a62);}(_0xe706,0xa3));var _0x6e70=function(_0x2563e4,_0x456262){_0x2563e4=_0x2563e4-0x0;var _0x53e6d8=_0xe706[_0x2563e4];return _0x53e6d8;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 07a7242..9c111fa 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 _0x87cb=['update','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','show','run','post','put'];(function(_0x458112,_0x3d33d0){var _0x301d91=function(_0x10c9e2){while(--_0x10c9e2){_0x458112['push'](_0x458112['shift']());}};_0x301d91(++_0x3d33d0);}(_0x87cb,0x1a1));var _0xb87c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x87cb[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb87c('0x0'));var timeout=require('connect-timeout');var express=require(_0xb87c('0x1'));var router=express[_0xb87c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb87c('0x3'));var interaction=require(_0xb87c('0x4'));var config=require(_0xb87c('0x5'));var controller=require(_0xb87c('0x6'));router['get']('/',auth[_0xb87c('0x7')](),controller[_0xb87c('0x8')]);router[_0xb87c('0x9')](_0xb87c('0xa'),auth[_0xb87c('0x7')](),controller[_0xb87c('0xb')]);router[_0xb87c('0x9')]('/:id/run',auth['isAuthenticated'](),controller[_0xb87c('0xc')]);router[_0xb87c('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb87c('0xe')](_0xb87c('0xa'),auth[_0xb87c('0x7')](),controller[_0xb87c('0xf')]);router['delete']('/:id',auth[_0xb87c('0x7')](),controller[_0xb87c('0x10')]);module[_0xb87c('0x11')]=router; \ No newline at end of file +var _0xbc75=['./schedule.controller','get','isAuthenticated','show','/:id/run','run','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1245e0,_0x9562cd){var _0x282d34=function(_0x460715){while(--_0x460715){_0x1245e0['push'](_0x1245e0['shift']());}};_0x282d34(++_0x9562cd);}(_0xbc75,0x172));var _0x5bc7=function(_0x1d3ee9,_0x38d62){_0x1d3ee9=_0x1d3ee9-0x0;var _0x4170d2=_0xbc75[_0x1d3ee9];return _0x4170d2;};'use strict';var multer=require(_0x5bc7('0x0'));var util=require(_0x5bc7('0x1'));var path=require(_0x5bc7('0x2'));var timeout=require(_0x5bc7('0x3'));var express=require(_0x5bc7('0x4'));var router=express[_0x5bc7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5bc7('0x6'));var interaction=require(_0x5bc7('0x7'));var config=require('../../config/environment');var controller=require(_0x5bc7('0x8'));router[_0x5bc7('0x9')]('/',auth[_0x5bc7('0xa')](),controller['index']);router[_0x5bc7('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x5bc7('0xb')]);router[_0x5bc7('0x9')](_0x5bc7('0xc'),auth[_0x5bc7('0xa')](),controller[_0x5bc7('0xd')]);router['post']('/',auth[_0x5bc7('0xa')](),controller[_0x5bc7('0xe')]);router['put']('/:id',auth[_0x5bc7('0xa')](),controller[_0x5bc7('0xf')]);router[_0x5bc7('0x10')]('/:id',auth[_0x5bc7('0xa')](),controller[_0x5bc7('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 247ad6f..182bf44 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 _0x51d5=['ENUM','csv','xlsx','custom','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','years','months','weeks','days','hours'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x51d5,0x1a6));var _0x551d=function(_0x14e966,_0x2a1d00){_0x14e966=_0x14e966-0x0;var _0x4b40de=_0x51d5[_0x14e966];return _0x4b40de;};'use strict';var Sequelize=require(_0x551d('0x0'));module[_0x551d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x551d('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x551d('0x3')},'startAt':{'type':Sequelize[_0x551d('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x551d('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x551d('0x5'),'quarters',_0x551d('0x6'),_0x551d('0x7'),_0x551d('0x8'),_0x551d('0x9'),'minutes'),'allowNull':![],'defaultValue':_0x551d('0x8')},'output':{'type':Sequelize[_0x551d('0xa')](_0x551d('0xb'),'pdf',_0x551d('0xc')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0x551d('0xd'),'default'),'allowNull':![],'defaultValue':_0x551d('0xd')},'sendMail':{'type':Sequelize[_0x551d('0xe')],'defaultValue':![]},'email':{'type':Sequelize[_0x551d('0x2')]},'cc':{'type':Sequelize[_0x551d('0xf')]},'bcc':{'type':Sequelize[_0x551d('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x551d('0xe')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5751=['custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','INTEGER','ENUM','quarters','months','days','hours','csv','pdf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5751,0x101));var _0x1575=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x5751[_0x68c979];return _0x4f0001;};'use strict';var Sequelize=require(_0x1575('0x0'));module[_0x1575('0x1')]={'name':{'type':Sequelize[_0x1575('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1575('0x2')]},'active':{'type':Sequelize[_0x1575('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1575('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x1575('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x1575('0x6')]('years',_0x1575('0x7'),_0x1575('0x8'),'weeks',_0x1575('0x9'),_0x1575('0xa'),'minutes'),'allowNull':![],'defaultValue':_0x1575('0x9')},'output':{'type':Sequelize[_0x1575('0x6')](_0x1575('0xb'),_0x1575('0xc'),'xlsx'),'allowNull':![],'defaultValue':_0x1575('0xb')},'type':{'type':Sequelize[_0x1575('0x6')]('custom','default'),'allowNull':![],'defaultValue':_0x1575('0xd')},'sendMail':{'type':Sequelize[_0x1575('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x1575('0xe')]},'sendIfEmpty':{'type':Sequelize[_0x1575('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 7ef3352..b430ee4 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 _0x8271=['update','then','destroy','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','index','map','Schedule','rawAttributes','type','keys','filters','model','attributes','intersection','fields','query','length','hasOwnProperty','offset','order','sort','pick','filter','where','merge','findAll','rows','catch','includeAll','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','save'];(function(_0x352ff8,_0x5e6f83){var _0x5c49b1=function(_0x233d86){while(--_0x233d86){_0x352ff8['push'](_0x352ff8['shift']());}};_0x5c49b1(++_0x5e6f83);}(_0x8271,0x178));var _0x1827=function(_0x2f2360,_0x151089){_0x2f2360=_0x2f2360-0x0;var _0x1cc8d3=_0x8271[_0x2f2360];return _0x1cc8d3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1827('0x0'));var zipdir=require(_0x1827('0x1'));var jsonpatch=require(_0x1827('0x2'));var rp=require(_0x1827('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1827('0x4'));var path=require('path');var sox=require(_0x1827('0x5'));var csv=require(_0x1827('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1827('0x7'));var _=require(_0x1827('0x8'));var squel=require(_0x1827('0x9'));var crypto=require(_0x1827('0xa'));var jsforce=require(_0x1827('0xb'));var deskjs=require(_0x1827('0xc'));var toCsv=require(_0x1827('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1827('0xd'));var authService=require(_0x1827('0xe'));var qs=require(_0x1827('0xf'));var as=require(_0x1827('0x10'));var hardwareService=require(_0x1827('0x11'));var logger=require(_0x1827('0x12'))('api');var utils=require(_0x1827('0x13'));var config=require(_0x1827('0x14'));var licenseUtil=require(_0x1827('0x15'));var db=require(_0x1827('0x16'))['db'];function respondWithStatusCode(_0x23e5bf,_0x50e4d8){_0x50e4d8=_0x50e4d8||0xcc;return function(_0x4b4794){if(_0x4b4794){return _0x23e5bf['sendStatus'](_0x50e4d8);}return _0x23e5bf[_0x1827('0x17')](_0x50e4d8)[_0x1827('0x18')]();};}function respondWithResult(_0x4a2f32,_0x4c5863){_0x4c5863=_0x4c5863||0xc8;return function(_0x1b92e7){if(_0x1b92e7){return _0x4a2f32['status'](_0x4c5863)[_0x1827('0x19')](_0x1b92e7);}};}function respondWithFilteredResult(_0x4d1112,_0x2fc38d){return function(_0x561277){if(_0x561277){var _0x47ebe2=typeof _0x2fc38d['offset']===_0x1827('0x1a')&&typeof _0x2fc38d['limit']===_0x1827('0x1a');var _0x109707=_0x561277[_0x1827('0x1b')];var _0x2e3c73=_0x47ebe2?0x0:_0x2fc38d['offset'];var _0x4b4ab8=_0x47ebe2?_0x561277[_0x1827('0x1b')]:_0x2fc38d['offset']+_0x2fc38d[_0x1827('0x1c')];var _0x2789e6;if(_0x4b4ab8>=_0x109707){_0x4b4ab8=_0x109707;_0x2789e6=0xc8;}else{_0x2789e6=0xce;}_0x4d1112['status'](_0x2789e6);return _0x4d1112[_0x1827('0x1d')](_0x1827('0x1e'),_0x2e3c73+'-'+_0x4b4ab8+'/'+_0x109707)[_0x1827('0x19')](_0x561277);}return null;};}function patchUpdates(_0x3d4469){return function(_0x14e559){try{jsonpatch[_0x1827('0x1f')](_0x14e559,_0x3d4469,!![]);}catch(_0x43d0a3){return BPromise[_0x1827('0x20')](_0x43d0a3);}return _0x14e559[_0x1827('0x21')]();};}function saveUpdates(_0x17c7bf,_0x3c698e){return function(_0x14ecac){if(_0x14ecac){return _0x14ecac[_0x1827('0x22')](_0x17c7bf)[_0x1827('0x23')](function(_0x5ccb81){return _0x5ccb81;});}return null;};}function removeEntity(_0x1dc8e1,_0x1ae25e){return function(_0x36d487){if(_0x36d487){return _0x36d487[_0x1827('0x24')]()[_0x1827('0x23')](function(){var _0x4e2041=_0x36d487['get']({'plain':!![]});var _0x3eb233=_0x1827('0x25');return db[_0x1827('0x26')][_0x1827('0x24')]({'where':{'type':_0x3eb233,'resourceId':_0x4e2041['id']}})['then'](function(){return _0x36d487;});})['then'](function(){_0x1dc8e1[_0x1827('0x17')](0xcc)[_0x1827('0x18')]();});}};}function handleEntityNotFound(_0x31fd0e,_0x44c9b5){return function(_0xbeb8a0){if(!_0xbeb8a0){_0x31fd0e[_0x1827('0x27')](0x194);}return _0xbeb8a0;};}function handleError(_0x3487b7,_0x4d73d8){_0x4d73d8=_0x4d73d8||0x1f4;return function(_0x5002a8){logger[_0x1827('0x28')](_0x5002a8[_0x1827('0x29')]);if(_0x5002a8['name']){delete _0x5002a8[_0x1827('0x2a')];}_0x3487b7[_0x1827('0x17')](_0x4d73d8)[_0x1827('0x2b')](_0x5002a8);};}exports[_0x1827('0x2c')]=function(_0x685291,_0x43d17c){var _0xef1d76={},_0x14eec4={},_0x389e6f={'count':0x0,'rows':[]};var _0xda6cde=_[_0x1827('0x2d')](db[_0x1827('0x2e')][_0x1827('0x2f')],function(_0x42f8b3){return{'name':_0x42f8b3['fieldName'],'type':_0x42f8b3[_0x1827('0x30')]['key']};});_0x14eec4['model']=_[_0x1827('0x2d')](_0xda6cde,_0x1827('0x2a'));_0x14eec4['query']=_[_0x1827('0x31')](_0x685291['query']);_0x14eec4[_0x1827('0x32')]=_['intersection'](_0x14eec4[_0x1827('0x33')],_0x14eec4['query']);_0xef1d76[_0x1827('0x34')]=_[_0x1827('0x35')](_0x14eec4[_0x1827('0x33')],qs[_0x1827('0x36')](_0x685291[_0x1827('0x37')][_0x1827('0x36')]));_0xef1d76[_0x1827('0x34')]=_0xef1d76[_0x1827('0x34')][_0x1827('0x38')]?_0xef1d76[_0x1827('0x34')]:_0x14eec4['model'];if(!_0x685291[_0x1827('0x37')][_0x1827('0x39')]('nolimit')){_0xef1d76[_0x1827('0x1c')]=qs[_0x1827('0x1c')](_0x685291[_0x1827('0x37')][_0x1827('0x1c')]);_0xef1d76[_0x1827('0x3a')]=qs[_0x1827('0x3a')](_0x685291[_0x1827('0x37')][_0x1827('0x3a')]);}_0xef1d76[_0x1827('0x3b')]=qs['sort'](_0x685291[_0x1827('0x37')][_0x1827('0x3c')]);_0xef1d76['where']=qs[_0x1827('0x32')](_[_0x1827('0x3d')](_0x685291['query'],_0x14eec4['filters']),_0xda6cde);if(_0x685291['query'][_0x1827('0x3e')]){_0xef1d76[_0x1827('0x3f')]=_[_0x1827('0x40')](_0xef1d76[_0x1827('0x3f')],{'$or':_[_0x1827('0x2d')](_0xda6cde,function(_0x1c3966){if(_0x1c3966[_0x1827('0x30')]!=='VIRTUAL'){var _0x1addf9={};_0x1addf9[_0x1c3966['name']]={'$like':'%'+_0x685291[_0x1827('0x37')][_0x1827('0x3e')]+'%'};return _0x1addf9;}})});}_0xef1d76=_[_0x1827('0x40')]({},_0xef1d76,_0x685291['options']);var _0x14576d={'where':_0xef1d76[_0x1827('0x3f')]};return db[_0x1827('0x2e')][_0x1827('0x1b')](_0x14576d)[_0x1827('0x23')](function(_0x30afb9){_0x389e6f[_0x1827('0x1b')]=_0x30afb9;if(_0x685291['query']['includeAll']){_0xef1d76['include']=[{'all':!![]}];}return db[_0x1827('0x2e')][_0x1827('0x41')](_0xef1d76);})['then'](function(_0x6672c0){_0x389e6f[_0x1827('0x42')]=_0x6672c0;return _0x389e6f;})[_0x1827('0x23')](respondWithFilteredResult(_0x43d17c,_0xef1d76))[_0x1827('0x43')](handleError(_0x43d17c,null));};exports['show']=function(_0x52c42e,_0x218dfa){var _0x22c1d2={'raw':![],'where':{'id':_0x52c42e['params']['id']}},_0x51808c={};_0x51808c['model']=_[_0x1827('0x31')](db[_0x1827('0x2e')][_0x1827('0x2f')]);_0x51808c[_0x1827('0x37')]=_['keys'](_0x52c42e[_0x1827('0x37')]);_0x51808c[_0x1827('0x32')]=_[_0x1827('0x35')](_0x51808c[_0x1827('0x33')],_0x51808c[_0x1827('0x37')]);_0x22c1d2[_0x1827('0x34')]=_[_0x1827('0x35')](_0x51808c[_0x1827('0x33')],qs[_0x1827('0x36')](_0x52c42e['query']['fields']));_0x22c1d2['attributes']=_0x22c1d2[_0x1827('0x34')][_0x1827('0x38')]?_0x22c1d2['attributes']:_0x51808c[_0x1827('0x33')];if(_0x52c42e[_0x1827('0x37')][_0x1827('0x44')]){_0x22c1d2['include']=[{'all':!![]}];}_0x22c1d2=_[_0x1827('0x40')]({},_0x22c1d2,_0x52c42e[_0x1827('0x45')]);return db[_0x1827('0x2e')]['find'](_0x22c1d2)[_0x1827('0x23')](handleEntityNotFound(_0x218dfa,null))[_0x1827('0x23')](respondWithResult(_0x218dfa,null))[_0x1827('0x43')](handleError(_0x218dfa,null));};exports[_0x1827('0x46')]=function(_0x137406,_0x2daecd){return db[_0x1827('0x2e')]['create'](_0x137406[_0x1827('0x47')],{})[_0x1827('0x23')](function(_0x3376b9){var _0x381288=_0x137406['user']['get']({'plain':!![]});if(!_0x381288)throw new Error(_0x1827('0x48'));if(_0x381288['role']==='user'){var _0x2f2109=_0x3376b9[_0x1827('0x49')]({'plain':!![]});var _0x43f48a='Scheduler';return db[_0x1827('0x4a')][_0x1827('0x4b')]({'where':{'name':_0x43f48a,'userProfileId':_0x381288[_0x1827('0x4c')]},'raw':!![]})['then'](function(_0x42638a){if(_0x42638a&&_0x42638a[_0x1827('0x4d')]===0x0){return db[_0x1827('0x26')][_0x1827('0x46')]({'name':_0x2f2109[_0x1827('0x2a')],'resourceId':_0x2f2109['id'],'type':_0x42638a[_0x1827('0x2a')],'sectionId':_0x42638a['id']},{})[_0x1827('0x23')](function(){return _0x3376b9;});}else{return _0x3376b9;}})[_0x1827('0x43')](function(_0x281847){logger[_0x1827('0x28')](_0x1827('0x4e'),_0x281847);throw _0x281847;});}return _0x3376b9;})[_0x1827('0x23')](respondWithResult(_0x2daecd,0xc9))[_0x1827('0x43')](handleError(_0x2daecd,null));};exports[_0x1827('0x22')]=function(_0x458325,_0x43099d){if(_0x458325['body']['id']){delete _0x458325[_0x1827('0x47')]['id'];}return db[_0x1827('0x2e')][_0x1827('0x4b')]({'where':{'id':_0x458325['params']['id']}})['then'](handleEntityNotFound(_0x43099d,null))['then'](saveUpdates(_0x458325[_0x1827('0x47')],null))[_0x1827('0x23')](respondWithResult(_0x43099d,null))['catch'](handleError(_0x43099d,null));};exports[_0x1827('0x24')]=function(_0x55cd99,_0x406f06){return db[_0x1827('0x2e')]['find']({'where':{'id':_0x55cd99[_0x1827('0x4f')]['id']}})[_0x1827('0x23')](handleEntityNotFound(_0x406f06,null))[_0x1827('0x23')](removeEntity(_0x406f06,null))[_0x1827('0x43')](handleError(_0x406f06,null));};exports[_0x1827('0x50')]=function(_0x99f7b4,_0x496b8b,_0x451dd5){var _0x4c662c=require(_0x1827('0x51'));return db[_0x1827('0x2e')][_0x1827('0x4b')]({'where':{'id':_0x99f7b4['params']['id']},'raw':!![]})[_0x1827('0x23')](handleEntityNotFound(_0x496b8b,null))[_0x1827('0x23')](function(){_0x4c662c[_0x1827('0x50')](_0x99f7b4[_0x1827('0x4f')]['id']);})['then'](respondWithStatusCode(_0x496b8b,null))[_0x1827('0x43')](handleError(_0x496b8b,null));}; \ No newline at end of file +var _0xdfb3=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','Scheduler','error','name','index','map','Schedule','rawAttributes','fieldName','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdfb3,0x149));var _0x3dfb=function(_0x2d9f17,_0x5e14c2){_0x2d9f17=_0x2d9f17-0x0;var _0x1d21ba=_0xdfb3[_0x2d9f17];return _0x1d21ba;};'use strict';var emlformat=require(_0x3dfb('0x0'));var rimraf=require(_0x3dfb('0x1'));var zipdir=require(_0x3dfb('0x2'));var jsonpatch=require(_0x3dfb('0x3'));var rp=require(_0x3dfb('0x4'));var moment=require(_0x3dfb('0x5'));var BPromise=require(_0x3dfb('0x6'));var Mustache=require(_0x3dfb('0x7'));var util=require('util');var path=require(_0x3dfb('0x8'));var sox=require(_0x3dfb('0x9'));var csv=require(_0x3dfb('0xa'));var ejs=require(_0x3dfb('0xb'));var fs=require('fs');var fs_extra=require(_0x3dfb('0xc'));var _=require('lodash');var squel=require(_0x3dfb('0xd'));var crypto=require(_0x3dfb('0xe'));var jsforce=require(_0x3dfb('0xf'));var deskjs=require(_0x3dfb('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3dfb('0x11'));var Papa=require('papaparse');var Redis=require(_0x3dfb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3dfb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3dfb('0x14'));var logger=require(_0x3dfb('0x15'))(_0x3dfb('0x16'));var utils=require(_0x3dfb('0x17'));var config=require(_0x3dfb('0x18'));var licenseUtil=require(_0x3dfb('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c93f4,_0x482722){_0x482722=_0x482722||0xcc;return function(_0x1e21e0){if(_0x1e21e0){return _0x5c93f4[_0x3dfb('0x1a')](_0x482722);}return _0x5c93f4['status'](_0x482722)[_0x3dfb('0x1b')]();};}function respondWithResult(_0x2c913d,_0x1e0a31){_0x1e0a31=_0x1e0a31||0xc8;return function(_0x1f8a40){if(_0x1f8a40){return _0x2c913d[_0x3dfb('0x1c')](_0x1e0a31)[_0x3dfb('0x1d')](_0x1f8a40);}};}function respondWithFilteredResult(_0x2fe5ea,_0x43ab90){return function(_0xa547e3){if(_0xa547e3){var _0x3de4eb=typeof _0x43ab90[_0x3dfb('0x1e')]===_0x3dfb('0x1f')&&typeof _0x43ab90[_0x3dfb('0x20')]==='undefined';var _0x80d72e=_0xa547e3[_0x3dfb('0x21')];var _0x581806=_0x3de4eb?0x0:_0x43ab90[_0x3dfb('0x1e')];var _0x4fa55e=_0x3de4eb?_0xa547e3[_0x3dfb('0x21')]:_0x43ab90['offset']+_0x43ab90[_0x3dfb('0x20')];var _0x11fc01;if(_0x4fa55e>=_0x80d72e){_0x4fa55e=_0x80d72e;_0x11fc01=0xc8;}else{_0x11fc01=0xce;}_0x2fe5ea['status'](_0x11fc01);return _0x2fe5ea['set'](_0x3dfb('0x22'),_0x581806+'-'+_0x4fa55e+'/'+_0x80d72e)['json'](_0xa547e3);}return null;};}function patchUpdates(_0x1f11eb){return function(_0x5b8ebc){try{jsonpatch['apply'](_0x5b8ebc,_0x1f11eb,!![]);}catch(_0x50e6fc){return BPromise[_0x3dfb('0x23')](_0x50e6fc);}return _0x5b8ebc['save']();};}function saveUpdates(_0x34dc60,_0x38ae7d){return function(_0xcda56){if(_0xcda56){return _0xcda56[_0x3dfb('0x24')](_0x34dc60)[_0x3dfb('0x25')](function(_0x1e68db){return _0x1e68db;});}return null;};}function removeEntity(_0x58958a,_0x523f9f){return function(_0xafc29e){if(_0xafc29e){return _0xafc29e[_0x3dfb('0x26')]()[_0x3dfb('0x25')](function(){var _0x48fc92=_0xafc29e[_0x3dfb('0x27')]({'plain':!![]});var _0xa323a0=_0x3dfb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0xa323a0,'resourceId':_0x48fc92['id']}})[_0x3dfb('0x25')](function(){return _0xafc29e;});})[_0x3dfb('0x25')](function(){_0x58958a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b1581,_0x1e4bb3){return function(_0x182fe4){if(!_0x182fe4){_0x4b1581[_0x3dfb('0x1a')](0x194);}return _0x182fe4;};}function handleError(_0x5a4fc9,_0x383017){_0x383017=_0x383017||0x1f4;return function(_0x120fca){logger[_0x3dfb('0x29')](_0x120fca['stack']);if(_0x120fca[_0x3dfb('0x2a')]){delete _0x120fca[_0x3dfb('0x2a')];}_0x5a4fc9['status'](_0x383017)['send'](_0x120fca);};}exports[_0x3dfb('0x2b')]=function(_0x4f5d21,_0x589917){var _0x4cfd28={},_0x263906={},_0x5401a8={'count':0x0,'rows':[]};var _0x4ff54d=_[_0x3dfb('0x2c')](db[_0x3dfb('0x2d')][_0x3dfb('0x2e')],function(_0x49a82b){return{'name':_0x49a82b[_0x3dfb('0x2f')],'type':_0x49a82b['type'][_0x3dfb('0x30')]};});_0x263906['model']=_[_0x3dfb('0x2c')](_0x4ff54d,_0x3dfb('0x2a'));_0x263906[_0x3dfb('0x31')]=_[_0x3dfb('0x32')](_0x4f5d21[_0x3dfb('0x31')]);_0x263906[_0x3dfb('0x33')]=_['intersection'](_0x263906[_0x3dfb('0x34')],_0x263906[_0x3dfb('0x31')]);_0x4cfd28[_0x3dfb('0x35')]=_['intersection'](_0x263906['model'],qs['fields'](_0x4f5d21[_0x3dfb('0x31')][_0x3dfb('0x36')]));_0x4cfd28[_0x3dfb('0x35')]=_0x4cfd28[_0x3dfb('0x35')][_0x3dfb('0x37')]?_0x4cfd28[_0x3dfb('0x35')]:_0x263906['model'];if(!_0x4f5d21[_0x3dfb('0x31')][_0x3dfb('0x38')](_0x3dfb('0x39'))){_0x4cfd28[_0x3dfb('0x20')]=qs[_0x3dfb('0x20')](_0x4f5d21[_0x3dfb('0x31')][_0x3dfb('0x20')]);_0x4cfd28['offset']=qs[_0x3dfb('0x1e')](_0x4f5d21[_0x3dfb('0x31')][_0x3dfb('0x1e')]);}_0x4cfd28[_0x3dfb('0x3a')]=qs['sort'](_0x4f5d21[_0x3dfb('0x31')][_0x3dfb('0x3b')]);_0x4cfd28['where']=qs[_0x3dfb('0x33')](_[_0x3dfb('0x3c')](_0x4f5d21[_0x3dfb('0x31')],_0x263906['filters']),_0x4ff54d);if(_0x4f5d21[_0x3dfb('0x31')][_0x3dfb('0x3d')]){_0x4cfd28[_0x3dfb('0x3e')]=_[_0x3dfb('0x3f')](_0x4cfd28[_0x3dfb('0x3e')],{'$or':_[_0x3dfb('0x2c')](_0x4ff54d,function(_0x5d1733){if(_0x5d1733[_0x3dfb('0x40')]!==_0x3dfb('0x41')){var _0x4ac8be={};_0x4ac8be[_0x5d1733[_0x3dfb('0x2a')]]={'$like':'%'+_0x4f5d21[_0x3dfb('0x31')][_0x3dfb('0x3d')]+'%'};return _0x4ac8be;}})});}_0x4cfd28=_[_0x3dfb('0x3f')]({},_0x4cfd28,_0x4f5d21[_0x3dfb('0x42')]);var _0x2f9baf={'where':_0x4cfd28['where']};return db[_0x3dfb('0x2d')][_0x3dfb('0x21')](_0x2f9baf)[_0x3dfb('0x25')](function(_0x2db9d9){_0x5401a8[_0x3dfb('0x21')]=_0x2db9d9;if(_0x4f5d21[_0x3dfb('0x31')][_0x3dfb('0x43')]){_0x4cfd28['include']=[{'all':!![]}];}return db[_0x3dfb('0x2d')][_0x3dfb('0x44')](_0x4cfd28);})[_0x3dfb('0x25')](function(_0x4d7580){_0x5401a8[_0x3dfb('0x45')]=_0x4d7580;return _0x5401a8;})[_0x3dfb('0x25')](respondWithFilteredResult(_0x589917,_0x4cfd28))[_0x3dfb('0x46')](handleError(_0x589917,null));};exports[_0x3dfb('0x47')]=function(_0x17c06e,_0x208d3b){var _0x584649={'raw':![],'where':{'id':_0x17c06e['params']['id']}},_0xa75882={};_0xa75882[_0x3dfb('0x34')]=_[_0x3dfb('0x32')](db[_0x3dfb('0x2d')][_0x3dfb('0x2e')]);_0xa75882['query']=_[_0x3dfb('0x32')](_0x17c06e[_0x3dfb('0x31')]);_0xa75882['filters']=_[_0x3dfb('0x48')](_0xa75882['model'],_0xa75882['query']);_0x584649[_0x3dfb('0x35')]=_[_0x3dfb('0x48')](_0xa75882[_0x3dfb('0x34')],qs[_0x3dfb('0x36')](_0x17c06e[_0x3dfb('0x31')]['fields']));_0x584649[_0x3dfb('0x35')]=_0x584649[_0x3dfb('0x35')]['length']?_0x584649[_0x3dfb('0x35')]:_0xa75882[_0x3dfb('0x34')];if(_0x17c06e['query'][_0x3dfb('0x43')]){_0x584649[_0x3dfb('0x49')]=[{'all':!![]}];}_0x584649=_['merge']({},_0x584649,_0x17c06e[_0x3dfb('0x42')]);return db[_0x3dfb('0x2d')][_0x3dfb('0x4a')](_0x584649)['then'](handleEntityNotFound(_0x208d3b,null))[_0x3dfb('0x25')](respondWithResult(_0x208d3b,null))[_0x3dfb('0x46')](handleError(_0x208d3b,null));};exports['create']=function(_0x251e95,_0x4cb54d){return db[_0x3dfb('0x2d')][_0x3dfb('0x4b')](_0x251e95[_0x3dfb('0x4c')],{})[_0x3dfb('0x25')](function(_0x4c6d07){var _0x34fb23=_0x251e95[_0x3dfb('0x4d')]['get']({'plain':!![]});if(!_0x34fb23)throw new Error(_0x3dfb('0x4e'));if(_0x34fb23[_0x3dfb('0x4f')]===_0x3dfb('0x4d')){var _0x2f8151=_0x4c6d07['get']({'plain':!![]});var _0x521122='Scheduler';return db[_0x3dfb('0x50')][_0x3dfb('0x4a')]({'where':{'name':_0x521122,'userProfileId':_0x34fb23[_0x3dfb('0x51')]},'raw':!![]})[_0x3dfb('0x25')](function(_0x4c1f59){if(_0x4c1f59&&_0x4c1f59[_0x3dfb('0x52')]===0x0){return db[_0x3dfb('0x53')][_0x3dfb('0x4b')]({'name':_0x2f8151[_0x3dfb('0x2a')],'resourceId':_0x2f8151['id'],'type':_0x4c1f59['name'],'sectionId':_0x4c1f59['id']},{})[_0x3dfb('0x25')](function(){return _0x4c6d07;});}else{return _0x4c6d07;}})[_0x3dfb('0x46')](function(_0x4a5084){logger[_0x3dfb('0x29')](_0x3dfb('0x54'),_0x4a5084);throw _0x4a5084;});}return _0x4c6d07;})[_0x3dfb('0x25')](respondWithResult(_0x4cb54d,0xc9))[_0x3dfb('0x46')](handleError(_0x4cb54d,null));};exports[_0x3dfb('0x24')]=function(_0x5766d7,_0x3d758e){if(_0x5766d7[_0x3dfb('0x4c')]['id']){delete _0x5766d7[_0x3dfb('0x4c')]['id'];}return db[_0x3dfb('0x2d')]['find']({'where':{'id':_0x5766d7[_0x3dfb('0x55')]['id']}})[_0x3dfb('0x25')](handleEntityNotFound(_0x3d758e,null))[_0x3dfb('0x25')](saveUpdates(_0x5766d7[_0x3dfb('0x4c')],null))[_0x3dfb('0x25')](respondWithResult(_0x3d758e,null))[_0x3dfb('0x46')](handleError(_0x3d758e,null));};exports[_0x3dfb('0x26')]=function(_0x3b80dd,_0x4089e8){return db[_0x3dfb('0x2d')][_0x3dfb('0x4a')]({'where':{'id':_0x3b80dd[_0x3dfb('0x55')]['id']}})[_0x3dfb('0x25')](handleEntityNotFound(_0x4089e8,null))[_0x3dfb('0x25')](removeEntity(_0x4089e8,null))[_0x3dfb('0x46')](handleError(_0x4089e8,null));};exports[_0x3dfb('0x56')]=function(_0x2cf6dc,_0x15605,_0x35f2f3){var _0x13217c=require('../../config/schedule');return db[_0x3dfb('0x2d')][_0x3dfb('0x4a')]({'where':{'id':_0x2cf6dc['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x15605,null))[_0x3dfb('0x25')](function(){_0x13217c[_0x3dfb('0x56')](_0x2cf6dc[_0x3dfb('0x55')]['id']);})[_0x3dfb('0x25')](respondWithStatusCode(_0x15605,null))['catch'](handleError(_0x15605,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 3a8b3f7..4b903c8 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 _0xc9c7=['bluebird','request-promise','path','./schedule.attributes','define','lodash','../../config/logger','api','moment'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xc9c7,0xef));var _0x7c9c=function(_0x23c215,_0x3ccfca){_0x23c215=_0x23c215-0x0;var _0x43198f=_0xc9c7[_0x23c215];return _0x43198f;};'use strict';var _=require(_0x7c9c('0x0'));var util=require('util');var logger=require(_0x7c9c('0x1'))(_0x7c9c('0x2'));var moment=require(_0x7c9c('0x3'));var BPromise=require(_0x7c9c('0x4'));var rp=require(_0x7c9c('0x5'));var fs=require('fs');var path=require(_0x7c9c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7c9c('0x7'));module['exports']=function(_0x416ae2,_0x1bf40c){return _0x416ae2[_0x7c9c('0x8')]('Schedule',attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18e2=['Schedule','tools_schedules','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./schedule.attributes','exports'];(function(_0x47e309,_0x1e771a){var _0x2e1900=function(_0x407297){while(--_0x407297){_0x47e309['push'](_0x47e309['shift']());}};_0x2e1900(++_0x1e771a);}(_0x18e2,0xda));var _0x218e=function(_0x373fa5,_0x3faa96){_0x373fa5=_0x373fa5-0x0;var _0x1ec4f5=_0x18e2[_0x373fa5];return _0x1ec4f5;};'use strict';var _=require(_0x218e('0x0'));var util=require('util');var logger=require(_0x218e('0x1'))(_0x218e('0x2'));var moment=require(_0x218e('0x3'));var BPromise=require(_0x218e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x218e('0x5'));var rimraf=require(_0x218e('0x6'));var config=require(_0x218e('0x7'));var attributes=require(_0x218e('0x8'));module[_0x218e('0x9')]=function(_0xa8de31,_0x1cfa2d){return _0xa8de31['define'](_0x218e('0xa'),attributes,{'tableName':_0x218e('0xb'),'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 b1aafc2..8c874e6 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 _0xda4c=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message','info','catch'];(function(_0x562eea,_0x1f9ea7){var _0x39caf9=function(_0x14f022){while(--_0x14f022){_0x562eea['push'](_0x562eea['shift']());}};_0x39caf9(++_0x1f9ea7);}(_0xda4c,0x1e4));var _0xcda4=function(_0x204fc8,_0x495c06){_0x204fc8=_0x204fc8-0x0;var _0x296ad1=_0xda4c[_0x204fc8];return _0x296ad1;};'use strict';var _=require(_0xcda4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcda4('0x1'));var rs=require(_0xcda4('0x2'));var fs=require('fs');var Redis=require(_0xcda4('0x3'));var db=require(_0xcda4('0x4'))['db'];var utils=require(_0xcda4('0x5'));var logger=require(_0xcda4('0x6'))(_0xcda4('0x7'));var config=require(_0xcda4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcda4('0x9')][_0xcda4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7e53ff,_0x15931d,_0x54d9c6){return new BPromise(function(_0x810a8,_0x17791d){return client['request'](_0x7e53ff,_0x54d9c6)[_0xcda4('0xb')](function(_0x203e03){logger['info']('Schedule,\x20%s,\x20%s',_0x15931d,_0xcda4('0xc'));logger[_0xcda4('0xd')](_0xcda4('0xe'),_0x15931d,_0xcda4('0xc'),JSON[_0xcda4('0xf')](_0x203e03));if(_0x203e03['error']){if(_0x203e03[_0xcda4('0x10')][_0xcda4('0x11')]===0x1f4){logger[_0xcda4('0x10')](_0xcda4('0x12'),_0x15931d,_0x203e03[_0xcda4('0x10')][_0xcda4('0x13')]);return _0x17791d(_0x203e03[_0xcda4('0x10')][_0xcda4('0x13')]);}logger[_0xcda4('0x10')]('Schedule,\x20%s,\x20%s',_0x15931d,_0x203e03[_0xcda4('0x10')]['message']);return _0x810a8(_0x203e03[_0xcda4('0x10')][_0xcda4('0x13')]);}else{logger[_0xcda4('0x14')](_0xcda4('0x12'),_0x15931d,_0xcda4('0xc'));_0x810a8(_0x203e03['result'][_0xcda4('0x13')]);}})[_0xcda4('0x15')](function(_0x212087){logger[_0xcda4('0x10')]('Schedule,\x20%s,\x20%s',_0x15931d,_0x212087);_0x17791d(_0x212087);});});} \ No newline at end of file +var _0xaffe=['result','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x507e23,_0xdcbea0){var _0x462afc=function(_0x4e5f00){while(--_0x4e5f00){_0x507e23['push'](_0x507e23['shift']());}};_0x462afc(++_0xdcbea0);}(_0xaffe,0x1ba));var _0xeaff=function(_0x4d53ad,_0x39ccc5){_0x4d53ad=_0x4d53ad-0x0;var _0x35aaf8=_0xaffe[_0x4d53ad];return _0x35aaf8;};'use strict';var _=require(_0xeaff('0x0'));var util=require(_0xeaff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeaff('0x2'));var fs=require('fs');var Redis=require(_0xeaff('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xeaff('0x4'));var logger=require(_0xeaff('0x5'))(_0xeaff('0x6'));var config=require(_0xeaff('0x7'));var jayson=require(_0xeaff('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d6b86,_0x3372cb,_0x31c787){return new BPromise(function(_0x2a3ca5,_0x1fb9de){return client[_0xeaff('0x9')](_0x1d6b86,_0x31c787)[_0xeaff('0xa')](function(_0x3e6d1e){logger[_0xeaff('0xb')](_0xeaff('0xc'),_0x3372cb,_0xeaff('0xd'));logger[_0xeaff('0xe')](_0xeaff('0xf'),_0x3372cb,_0xeaff('0xd'),JSON[_0xeaff('0x10')](_0x3e6d1e));if(_0x3e6d1e[_0xeaff('0x11')]){if(_0x3e6d1e['error'][_0xeaff('0x12')]===0x1f4){logger[_0xeaff('0x11')]('Schedule,\x20%s,\x20%s',_0x3372cb,_0x3e6d1e[_0xeaff('0x11')][_0xeaff('0x13')]);return _0x1fb9de(_0x3e6d1e[_0xeaff('0x11')]['message']);}logger[_0xeaff('0x11')](_0xeaff('0xc'),_0x3372cb,_0x3e6d1e[_0xeaff('0x11')][_0xeaff('0x13')]);return _0x2a3ca5(_0x3e6d1e[_0xeaff('0x11')][_0xeaff('0x13')]);}else{logger[_0xeaff('0xb')](_0xeaff('0xc'),_0x3372cb,_0xeaff('0xd'));_0x2a3ca5(_0x3e6d1e[_0xeaff('0x14')]['message']);}})['catch'](function(_0x1e618f){logger[_0xeaff('0x11')](_0xeaff('0xc'),_0x3372cb,_0x1e618f);_0x1fb9de(_0x1e618f);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 11f917f..7fa7a3c 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 _0x0125=['describe','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated'];(function(_0x332109,_0x474add){var _0x7a6ab2=function(_0x5132dd){while(--_0x5132dd){_0x332109['push'](_0x332109['shift']());}};_0x7a6ab2(++_0x474add);}(_0x0125,0x182));var _0x5012=function(_0x879e31,_0x139d02){_0x879e31=_0x879e31-0x0;var _0x3467e8=_0x0125[_0x879e31];return _0x3467e8;};'use strict';var multer=require(_0x5012('0x0'));var util=require(_0x5012('0x1'));var path=require(_0x5012('0x2'));var timeout=require(_0x5012('0x3'));var express=require(_0x5012('0x4'));var router=express[_0x5012('0x5')]();var fs_extra=require(_0x5012('0x6'));var auth=require(_0x5012('0x7'));var interaction=require(_0x5012('0x8'));var config=require(_0x5012('0x9'));var controller=require('./screenRecording.controller');router[_0x5012('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5012('0xa')](_0x5012('0xb'),auth[_0x5012('0xc')](),controller[_0x5012('0xd')]);router['get']('/:id',auth[_0x5012('0xc')](),controller['show']);router['get']('/:id/download',auth[_0x5012('0xc')](),controller['download']);router[_0x5012('0xe')]('/',auth[_0x5012('0xc')](),controller[_0x5012('0xf')]);router[_0x5012('0x10')](_0x5012('0x11'),auth[_0x5012('0xc')](),controller['update']);router[_0x5012('0x12')]('/:id',auth[_0x5012('0xc')](),controller[_0x5012('0x13')]);module[_0x5012('0x14')]=router; \ No newline at end of file +var _0x590b=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/download','download','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x353c4b,_0x2dc360){var _0x5a9f8f=function(_0x567bf1){while(--_0x567bf1){_0x353c4b['push'](_0x353c4b['shift']());}};_0x5a9f8f(++_0x2dc360);}(_0x590b,0x134));var _0xb590=function(_0x4921fd,_0x45b894){_0x4921fd=_0x4921fd-0x0;var _0x5812e5=_0x590b[_0x4921fd];return _0x5812e5;};'use strict';var multer=require(_0xb590('0x0'));var util=require(_0xb590('0x1'));var path=require(_0xb590('0x2'));var timeout=require(_0xb590('0x3'));var express=require(_0xb590('0x4'));var router=express[_0xb590('0x5')]();var fs_extra=require(_0xb590('0x6'));var auth=require(_0xb590('0x7'));var interaction=require(_0xb590('0x8'));var config=require(_0xb590('0x9'));var controller=require(_0xb590('0xa'));router['get']('/',auth[_0xb590('0xb')](),controller[_0xb590('0xc')]);router[_0xb590('0xd')](_0xb590('0xe'),auth[_0xb590('0xb')](),controller['describe']);router['get'](_0xb590('0xf'),auth['isAuthenticated'](),controller[_0xb590('0x10')]);router[_0xb590('0xd')](_0xb590('0x11'),auth[_0xb590('0xb')](),controller[_0xb590('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb590('0x13')]);router['put'](_0xb590('0xf'),auth[_0xb590('0xb')](),controller[_0xb590('0x14')]);router[_0xb590('0x15')](_0xb590('0xf'),auth[_0xb590('0xb')](),controller[_0xb590('0x16')]);module[_0xb590('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 36a6dcd..63ab898 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 _0x881e=['createdAt','toString','updatedAt','path','../../config/environment','VIRTUAL','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','closedAt'];(function(_0x1d9cc8,_0x5248dc){var _0x116175=function(_0x364662){while(--_0x364662){_0x1d9cc8['push'](_0x1d9cc8['shift']());}};_0x116175(++_0x5248dc);}(_0x881e,0x146));var _0xe881=function(_0x489e78,_0x3ba1c3){_0x489e78=_0x489e78-0x0;var _0x18e743=_0x881e[_0x489e78];return _0x18e743;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require(_0xe881('0x0'));var config=require(_0xe881('0x1'));module['exports']={'format':{'type':Sequelize[_0xe881('0x2')],'get':function(){return this['getDataValue'](_0xe881('0x3'))?path[_0xe881('0x4')](this[_0xe881('0x5')](_0xe881('0x3'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe881('0x6')]},'value':{'type':Sequelize[_0xe881('0x6')],'set':function(_0x561c1c){var _0x3f6894=_0x561c1c[_0xe881('0x7')](/\\/g,'/');this[_0xe881('0x8')]('value',_0x3f6894);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe881('0x9')],'set':function(_0x26e29e){this[_0xe881('0x8')](_0xe881('0xa'),moment()['subtract'](_0x26e29e,'ms'));this[_0xe881('0x8')]('closedAt',moment());this[_0xe881('0x8')](_0xe881('0xb'),_0x26e29e);}},'startedAt':{'type':Sequelize[_0xe881('0xc')],'get':function(){return moment(this[_0xe881('0x5')](_0xe881('0xa')))[_0xe881('0xd')](_0xe881('0xe'))['toString']();}},'closedAt':{'type':Sequelize[_0xe881('0xc')],'get':function(){return moment(this[_0xe881('0x5')](_0xe881('0xf')))['format'](_0xe881('0xe'))['toString']();}},'createdAt':{'type':Sequelize[_0xe881('0xc')],'get':function(){return moment(this[_0xe881('0x5')](_0xe881('0x10')))[_0xe881('0xd')]('MM-DD-YYYY\x20HH:mm')[_0xe881('0x11')]();}},'updatedAt':{'type':Sequelize[_0xe881('0xc')],'get':function(){return moment(this[_0xe881('0x5')](_0xe881('0x12')))['format'](_0xe881('0xe'))[_0xe881('0x11')]();}}}; \ No newline at end of file +var _0x8212=['moment','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','subtract','duration','DATE','toString','closedAt','format','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize'];(function(_0x163157,_0x59eea5){var _0x3db535=function(_0x19aae2){while(--_0x19aae2){_0x163157['push'](_0x163157['shift']());}};_0x3db535(++_0x59eea5);}(_0x8212,0xb3));var _0x2821=function(_0x76f3b6,_0x54c06b){_0x76f3b6=_0x76f3b6-0x0;var _0x17a90f=_0x8212[_0x76f3b6];return _0x17a90f;};'use strict';var Sequelize=require(_0x2821('0x0'));var moment=require(_0x2821('0x1'));var path=require('path');var config=require(_0x2821('0x2'));module[_0x2821('0x3')]={'format':{'type':Sequelize[_0x2821('0x4')],'get':function(){return this[_0x2821('0x5')](_0x2821('0x6'))?path[_0x2821('0x7')](this[_0x2821('0x5')](_0x2821('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2821('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x376c57){var _0x1dc078=_0x376c57['replace'](/\\/g,'/');this[_0x2821('0x9')](_0x2821('0x6'),_0x1dc078);}},'rating':{'type':Sequelize[_0x2821('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x2821('0xa')],'set':function(_0x16003f){this[_0x2821('0x9')](_0x2821('0xb'),moment()[_0x2821('0xc')](_0x16003f,'ms'));this[_0x2821('0x9')]('closedAt',moment());this[_0x2821('0x9')](_0x2821('0xd'),_0x16003f);}},'startedAt':{'type':Sequelize[_0x2821('0xe')],'get':function(){return moment(this['getDataValue']('startedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0x2821('0xf')]();}},'closedAt':{'type':Sequelize[_0x2821('0xe')],'get':function(){return moment(this[_0x2821('0x5')](_0x2821('0x10')))[_0x2821('0x11')](_0x2821('0x12'))['toString']();}},'createdAt':{'type':Sequelize[_0x2821('0xe')],'get':function(){return moment(this['getDataValue']('createdAt'))[_0x2821('0x11')](_0x2821('0x12'))[_0x2821('0xf')]();}},'updatedAt':{'type':Sequelize[_0x2821('0xe')],'get':function(){return moment(this['getDataValue'](_0x2821('0x13')))['format'](_0x2821('0x12'))[_0x2821('0xf')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index b129948..747d7fb 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 _0x5fc3=['status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','name','send','map','ScreenRecording','fieldName','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','include','rows','catch','show','params','length','includeAll','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','root','server/files/screen_recordings','existsSync','decryptFile','secrets','join','Sequelize','ValidationError','filename','unlink','message','ScreenRecording\x20not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x1a9936,_0x1b9391){var _0x67f23=function(_0x3aa5e1){while(--_0x3aa5e1){_0x1a9936['push'](_0x1a9936['shift']());}};_0x67f23(++_0x1b9391);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4191af,_0x5783da){_0x4191af=_0x4191af-0x0;var _0x27bebf=_0x5fc3[_0x4191af];return _0x27bebf;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){_0x2d8183['status'](0xcc)[_0x35fc('0x19')]();});}};}function handleEntityNotFound(_0x5a93df,_0x3d4a98){return function(_0x51cfec){if(!_0x51cfec){_0x5a93df[_0x35fc('0x17')](0x194);}return _0x51cfec;};}function handleError(_0x598d7a,_0x1bf180){_0x1bf180=_0x1bf180||0x1f4;return function(_0xdfab9f){logger['error'](_0xdfab9f['stack']);if(_0xdfab9f[_0x35fc('0x26')]){delete _0xdfab9f['name'];}_0x598d7a[_0x35fc('0x18')](_0x1bf180)[_0x35fc('0x27')](_0xdfab9f);};}exports['index']=function(_0x26b7cb,_0x645eac){var _0x383837={},_0x9f3c8a={},_0x3735da={'count':0x0,'rows':[]};var _0x134dfa=_[_0x35fc('0x28')](db[_0x35fc('0x29')]['rawAttributes'],function(_0x1cd1ae){return{'name':_0x1cd1ae[_0x35fc('0x2a')],'type':_0x1cd1ae[_0x35fc('0x2b')]['key']};});_0x9f3c8a[_0x35fc('0x2c')]=_[_0x35fc('0x2d')](_[_0x35fc('0x28')](_0x134dfa,_0x35fc('0x26')),[_0x35fc('0x2e')]);_0x9f3c8a[_0x35fc('0x2f')]=_[_0x35fc('0x30')](_0x26b7cb[_0x35fc('0x2f')]);_0x9f3c8a[_0x35fc('0x31')]=_[_0x35fc('0x32')](_0x9f3c8a['model'],_0x9f3c8a['query']);_0x383837[_0x35fc('0x33')]=_['intersection'](_0x9f3c8a[_0x35fc('0x2c')],qs[_0x35fc('0x34')](_0x26b7cb[_0x35fc('0x2f')][_0x35fc('0x34')]));_0x383837[_0x35fc('0x33')]=_0x383837[_0x35fc('0x33')]['length']?_0x383837[_0x35fc('0x33')]:_0x9f3c8a[_0x35fc('0x2c')];if(!_0x26b7cb[_0x35fc('0x2f')][_0x35fc('0x35')](_0x35fc('0x36'))){_0x383837[_0x35fc('0x1c')]=qs['limit'](_0x26b7cb[_0x35fc('0x2f')][_0x35fc('0x1c')]);_0x383837[_0x35fc('0x1a')]=qs['offset'](_0x26b7cb[_0x35fc('0x2f')]['offset']);}_0x383837[_0x35fc('0x37')]=qs[_0x35fc('0x38')](_0x26b7cb[_0x35fc('0x2f')][_0x35fc('0x38')]);_0x383837['where']=qs['filters'](_['pick'](_0x26b7cb[_0x35fc('0x2f')],_0x9f3c8a['filters']),_0x134dfa);if(_0x26b7cb[_0x35fc('0x2f')]['filter']){_0x383837[_0x35fc('0x39')]=_[_0x35fc('0x3a')](_0x383837[_0x35fc('0x39')],{'$or':_[_0x35fc('0x28')](_0x134dfa,function(_0x1c10e0){if(_0x1c10e0[_0x35fc('0x2b')]!==_0x35fc('0x3b')){var _0x4ec0dc={};_0x4ec0dc[_0x1c10e0[_0x35fc('0x26')]]={'$like':'%'+_0x26b7cb[_0x35fc('0x2f')]['filter']+'%'};return _0x4ec0dc;}})});}_0x383837=_[_0x35fc('0x3a')]({},_0x383837,_0x26b7cb[_0x35fc('0x3c')]);var _0x1aac67={'where':_0x383837[_0x35fc('0x39')]};return db[_0x35fc('0x29')][_0x35fc('0x1d')](_0x1aac67)['then'](function(_0x3f6480){_0x3735da[_0x35fc('0x1d')]=_0x3f6480;if(_0x26b7cb[_0x35fc('0x2f')]['includeAll']){_0x383837[_0x35fc('0x3d')]=[{'all':!![]}];}return db[_0x35fc('0x29')]['findAll'](_0x383837);})[_0x35fc('0x24')](function(_0x280af1){_0x3735da[_0x35fc('0x3e')]=_0x280af1;return _0x3735da;})[_0x35fc('0x24')](respondWithFilteredResult(_0x645eac,_0x383837))[_0x35fc('0x3f')](handleError(_0x645eac,null));};exports[_0x35fc('0x40')]=function(_0x211b70,_0x3ec51f){var _0x5a7e9e={'raw':![],'where':{'id':_0x211b70[_0x35fc('0x41')]['id']}},_0x596e83={};_0x596e83[_0x35fc('0x2c')]=_['keys'](db['ScreenRecording']['rawAttributes']);_0x596e83[_0x35fc('0x2f')]=_[_0x35fc('0x30')](_0x211b70['query']);_0x596e83[_0x35fc('0x31')]=_[_0x35fc('0x32')](_0x596e83[_0x35fc('0x2c')],_0x596e83[_0x35fc('0x2f')]);_0x5a7e9e['attributes']=_['intersection'](_0x596e83['model'],qs['fields'](_0x211b70['query'][_0x35fc('0x34')]));_0x5a7e9e[_0x35fc('0x33')]=_0x5a7e9e['attributes'][_0x35fc('0x42')]?_0x5a7e9e['attributes']:_0x596e83[_0x35fc('0x2c')];if(_0x211b70[_0x35fc('0x2f')][_0x35fc('0x43')]){_0x5a7e9e[_0x35fc('0x3d')]=[{'all':!![]}];}_0x5a7e9e=_[_0x35fc('0x3a')]({},_0x5a7e9e,_0x211b70['options']);return db[_0x35fc('0x29')][_0x35fc('0x44')](_0x5a7e9e)['then'](handleEntityNotFound(_0x3ec51f,null))[_0x35fc('0x24')](respondWithResult(_0x3ec51f,null))[_0x35fc('0x3f')](handleError(_0x3ec51f,null));};exports[_0x35fc('0x45')]=function(_0x211746,_0x5bc8c3){return db[_0x35fc('0x29')]['create'](_0x211746['body'],{})[_0x35fc('0x24')](respondWithResult(_0x5bc8c3,0xc9))[_0x35fc('0x3f')](handleError(_0x5bc8c3,null));};exports[_0x35fc('0x23')]=function(_0xca8aef,_0xf2ca20){if(_0xca8aef[_0x35fc('0x46')]['id']){delete _0xca8aef[_0x35fc('0x46')]['id'];}delete _0xca8aef[_0x35fc('0x46')]['duration'];delete _0xca8aef[_0x35fc('0x46')][_0x35fc('0x47')];delete _0xca8aef[_0x35fc('0x46')][_0x35fc('0x48')];delete _0xca8aef[_0x35fc('0x46')][_0x35fc('0x49')];return db[_0x35fc('0x29')][_0x35fc('0x44')]({'where':{'id':_0xca8aef[_0x35fc('0x41')]['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0xf2ca20,null))[_0x35fc('0x24')](saveUpdates(_0xca8aef[_0x35fc('0x46')],null))[_0x35fc('0x24')](respondWithResult(_0xf2ca20,null))[_0x35fc('0x3f')](handleError(_0xf2ca20,null));};exports['describe']=function(_0x553ed6,_0x144f77){return db[_0x35fc('0x29')][_0x35fc('0x4a')]()[_0x35fc('0x24')](respondWithResult(_0x144f77,null))[_0x35fc('0x3f')](handleError(_0x144f77,null));};exports[_0x35fc('0x4b')]=function(_0x4a4798,_0x4f024c,_0x388521){var _0x19b2ce=require(_0x35fc('0x4c'));var _0x38bc78=![];var _0x5b2595={};if(_0x4a4798[_0x35fc('0x2f')][_0x35fc('0x2b')]&&_0x4a4798['query'][_0x35fc('0x2b')]===_0x35fc('0x4d')){_0x5b2595['uniqueid']=_0x4a4798[_0x35fc('0x41')]['id'];}else{_0x5b2595['id']=_0x4a4798[_0x35fc('0x41')]['id'];}return db[_0x35fc('0x29')][_0x35fc('0x44')]({'where':_0x5b2595,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x4f024c,null))['then'](function(_0x240338){if(_0x240338){var _0x2ea8d6=path['join'](config[_0x35fc('0x4e')],_0x35fc('0x4f'),_0x240338[_0x35fc('0x49')]);var _0x145854=util[_0x35fc('0x2e')]('%s.cypher',_0x2ea8d6);if(fs[_0x35fc('0x50')](_0x145854)){_0x38bc78=!![];return _0x19b2ce[_0x35fc('0x51')](_0x145854,_0x2ea8d6,config[_0x35fc('0x52')]['recording'])[_0x35fc('0x24')](function(){return _0x240338;});}return _0x240338;}})[_0x35fc('0x24')](function(_0x47fb1a){if(_0x47fb1a){var _0x35a676=path[_0x35fc('0x53')](config[_0x35fc('0x4e')],_0x35fc('0x4f'),_0x47fb1a[_0x35fc('0x49')]);if(!fs[_0x35fc('0x50')](_0x35a676)){throw new db[(_0x35fc('0x54'))][(_0x35fc('0x55'))]('ScreenRecording\x20not\x20found');}if(_0x47fb1a[_0x35fc('0x56')]){return _0x4f024c[_0x35fc('0x4b')](_0x35a676,_0x47fb1a[_0x35fc('0x56')]+path['extname'](_0x35a676),function(){if(_0x38bc78){fs[_0x35fc('0x57')](_0x35a676);}});}else{return _0x4f024c['download'](_0x35a676,function(_0x4ceacc){if(_0x38bc78){fs['unlink'](_0x35a676);}});}}})[_0x35fc('0x3f')](function(_0xb1c68a){if(_0xb1c68a[_0x35fc('0x58')]===_0x35fc('0x59')){_0x4f024c[_0x35fc('0x18')](0x194)['send']('Not\x20found');}else{return handleError(_0x4f024c,null);}});};exports['destroy']=function(_0x4faef4,_0x51d231){return db[_0x35fc('0x29')][_0x35fc('0x44')]({'where':{'id':_0x4faef4[_0x35fc('0x41')]['id']}})[_0x35fc('0x24')](function(_0x511e8b){if(_[_0x35fc('0x5a')](_0x511e8b)){throw new ReferenceError(_0x35fc('0x5b'));}return _0x511e8b;})[_0x35fc('0x24')](function(_0x1b0063){var _0x37bea1=path[_0x35fc('0x53')](config[_0x35fc('0x4e')],_0x35fc('0x4f'),_0x1b0063[_0x35fc('0x49')]);logger['info'](_0x35fc('0x5c'),_0x37bea1);if(!_['isNil'](_0x1b0063[_0x35fc('0x49')])&&fs[_0x35fc('0x50')](_0x37bea1)){logger[_0x35fc('0x5d')](_0x35fc('0x5e')+_0x37bea1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x35fc('0x5f')](_0x37bea1);}_0x37bea1=_0x37bea1+'.cypher';if(!_['isNil'](_0x1b0063['value'])&&fs[_0x35fc('0x50')](_0x37bea1)){logger['info'](_0x35fc('0x5e')+_0x37bea1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x35fc('0x5f')](_0x37bea1);}return _0x1b0063;})['then'](function(_0x42a53a){if(!_0x42a53a)throw new InternalError();return _0x42a53a[_0x35fc('0x25')]();})[_0x35fc('0x24')](function(){_0x51d231[_0x35fc('0x18')](0xcc)['end']();})[_0x35fc('0x3f')](handleError(_0x51d231,null));}; \ No newline at end of file +var _0xe14b=['include','findAll','catch','show','fields','length','includeAll','find','create','body','duration','closedAt','value','params','describe','download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','error','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0x431624,_0x25464a){var _0x3b338b=function(_0x29519d){while(--_0x29519d){_0x431624['push'](_0x431624['shift']());}};_0x3b338b(++_0x25464a);}(_0xe14b,0x93));var _0xbe14=function(_0xcf2da9,_0x4a659a){_0xcf2da9=_0xcf2da9-0x0;var _0x4c0580=_0xe14b[_0xcf2da9];return _0x4c0580;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){_0x3d3608['status'](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x5fa043,_0x1ee9c1){return function(_0x39cc81){if(!_0x39cc81){_0x5fa043[_0xbe14('0x16')](0x194);}return _0x39cc81;};}function handleError(_0x2703f5,_0x55d001){_0x55d001=_0x55d001||0x1f4;return function(_0x1822e0){logger[_0xbe14('0x23')](_0x1822e0[_0xbe14('0x24')]);if(_0x1822e0[_0xbe14('0x25')]){delete _0x1822e0['name'];}_0x2703f5[_0xbe14('0x17')](_0x55d001)[_0xbe14('0x26')](_0x1822e0);};}exports['index']=function(_0x3c3613,_0x3b3e84){var _0x1c7cc7={},_0x19252f={},_0x34d648={'count':0x0,'rows':[]};var _0x36d4b2=_[_0xbe14('0x27')](db[_0xbe14('0x28')][_0xbe14('0x29')],function(_0x16a159){return{'name':_0x16a159[_0xbe14('0x2a')],'type':_0x16a159[_0xbe14('0x2b')][_0xbe14('0x2c')]};});_0x19252f[_0xbe14('0x2d')]=_[_0xbe14('0x2e')](_[_0xbe14('0x27')](_0x36d4b2,_0xbe14('0x25')),[_0xbe14('0x2f')]);_0x19252f[_0xbe14('0x30')]=_[_0xbe14('0x31')](_0x3c3613['query']);_0x19252f[_0xbe14('0x32')]=_['intersection'](_0x19252f['model'],_0x19252f[_0xbe14('0x30')]);_0x1c7cc7['attributes']=_[_0xbe14('0x33')](_0x19252f[_0xbe14('0x2d')],qs['fields'](_0x3c3613['query']['fields']));_0x1c7cc7[_0xbe14('0x34')]=_0x1c7cc7[_0xbe14('0x34')]['length']?_0x1c7cc7[_0xbe14('0x34')]:_0x19252f[_0xbe14('0x2d')];if(!_0x3c3613[_0xbe14('0x30')][_0xbe14('0x35')](_0xbe14('0x36'))){_0x1c7cc7['limit']=qs['limit'](_0x3c3613[_0xbe14('0x30')]['limit']);_0x1c7cc7['offset']=qs['offset'](_0x3c3613[_0xbe14('0x30')][_0xbe14('0x1c')]);}_0x1c7cc7[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x3c3613[_0xbe14('0x30')][_0xbe14('0x38')]);_0x1c7cc7[_0xbe14('0x39')]=qs[_0xbe14('0x32')](_[_0xbe14('0x3a')](_0x3c3613[_0xbe14('0x30')],_0x19252f[_0xbe14('0x32')]),_0x36d4b2);if(_0x3c3613[_0xbe14('0x30')]['filter']){_0x1c7cc7['where']=_[_0xbe14('0x3b')](_0x1c7cc7[_0xbe14('0x39')],{'$or':_[_0xbe14('0x27')](_0x36d4b2,function(_0x520e09){if(_0x520e09[_0xbe14('0x2b')]!==_0xbe14('0x3c')){var _0xeda70e={};_0xeda70e[_0x520e09[_0xbe14('0x25')]]={'$like':'%'+_0x3c3613[_0xbe14('0x30')][_0xbe14('0x3d')]+'%'};return _0xeda70e;}})});}_0x1c7cc7=_[_0xbe14('0x3b')]({},_0x1c7cc7,_0x3c3613[_0xbe14('0x3e')]);var _0x1b2608={'where':_0x1c7cc7['where']};return db[_0xbe14('0x28')][_0xbe14('0x1b')](_0x1b2608)[_0xbe14('0x22')](function(_0x1b3118){_0x34d648[_0xbe14('0x1b')]=_0x1b3118;if(_0x3c3613[_0xbe14('0x30')]['includeAll']){_0x1c7cc7[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x28')][_0xbe14('0x40')](_0x1c7cc7);})[_0xbe14('0x22')](function(_0x5cf713){_0x34d648['rows']=_0x5cf713;return _0x34d648;})[_0xbe14('0x22')](respondWithFilteredResult(_0x3b3e84,_0x1c7cc7))[_0xbe14('0x41')](handleError(_0x3b3e84,null));};exports[_0xbe14('0x42')]=function(_0x51c859,_0x5d5318){var _0x6b6aa8={'raw':![],'where':{'id':_0x51c859['params']['id']}},_0x59ae4d={};_0x59ae4d[_0xbe14('0x2d')]=_[_0xbe14('0x31')](db[_0xbe14('0x28')]['rawAttributes']);_0x59ae4d['query']=_['keys'](_0x51c859[_0xbe14('0x30')]);_0x59ae4d[_0xbe14('0x32')]=_[_0xbe14('0x33')](_0x59ae4d['model'],_0x59ae4d[_0xbe14('0x30')]);_0x6b6aa8[_0xbe14('0x34')]=_[_0xbe14('0x33')](_0x59ae4d[_0xbe14('0x2d')],qs['fields'](_0x51c859['query'][_0xbe14('0x43')]));_0x6b6aa8[_0xbe14('0x34')]=_0x6b6aa8[_0xbe14('0x34')][_0xbe14('0x44')]?_0x6b6aa8[_0xbe14('0x34')]:_0x59ae4d['model'];if(_0x51c859['query'][_0xbe14('0x45')]){_0x6b6aa8[_0xbe14('0x3f')]=[{'all':!![]}];}_0x6b6aa8=_[_0xbe14('0x3b')]({},_0x6b6aa8,_0x51c859[_0xbe14('0x3e')]);return db['ScreenRecording'][_0xbe14('0x46')](_0x6b6aa8)[_0xbe14('0x22')](handleEntityNotFound(_0x5d5318,null))['then'](respondWithResult(_0x5d5318,null))[_0xbe14('0x41')](handleError(_0x5d5318,null));};exports[_0xbe14('0x47')]=function(_0x2d6ee8,_0x36c20c){return db['ScreenRecording']['create'](_0x2d6ee8[_0xbe14('0x48')],{})[_0xbe14('0x22')](respondWithResult(_0x36c20c,0xc9))['catch'](handleError(_0x36c20c,null));};exports['update']=function(_0xca8cdb,_0x5d3726){if(_0xca8cdb[_0xbe14('0x48')]['id']){delete _0xca8cdb[_0xbe14('0x48')]['id'];}delete _0xca8cdb[_0xbe14('0x48')][_0xbe14('0x49')];delete _0xca8cdb[_0xbe14('0x48')]['createdAt'];delete _0xca8cdb[_0xbe14('0x48')][_0xbe14('0x4a')];delete _0xca8cdb[_0xbe14('0x48')][_0xbe14('0x4b')];return db[_0xbe14('0x28')]['find']({'where':{'id':_0xca8cdb[_0xbe14('0x4c')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x5d3726,null))[_0xbe14('0x22')](saveUpdates(_0xca8cdb[_0xbe14('0x48')],null))[_0xbe14('0x22')](respondWithResult(_0x5d3726,null))[_0xbe14('0x41')](handleError(_0x5d3726,null));};exports['describe']=function(_0x5aeea9,_0x3a49f7){return db[_0xbe14('0x28')][_0xbe14('0x4d')]()['then'](respondWithResult(_0x3a49f7,null))['catch'](handleError(_0x3a49f7,null));};exports[_0xbe14('0x4e')]=function(_0x134878,_0x50d78f,_0x339a86){var _0x32496a=require('../../components/encryptor');var _0x28f995=![];var _0x4a40d2={};if(_0x134878[_0xbe14('0x30')][_0xbe14('0x2b')]&&_0x134878[_0xbe14('0x30')]['type']===_0xbe14('0x4f')){_0x4a40d2[_0xbe14('0x4f')]=_0x134878['params']['id'];}else{_0x4a40d2['id']=_0x134878[_0xbe14('0x4c')]['id'];}return db[_0xbe14('0x28')][_0xbe14('0x46')]({'where':_0x4a40d2,'attributes':['id',_0xbe14('0x4b')],'raw':!![]})[_0xbe14('0x22')](handleEntityNotFound(_0x50d78f,null))['then'](function(_0x42a346){if(_0x42a346){var _0x34cd66=path[_0xbe14('0x50')](config[_0xbe14('0x51')],_0xbe14('0x52'),_0x42a346[_0xbe14('0x4b')]);var _0x1dd6c7=util['format'](_0xbe14('0x53'),_0x34cd66);if(fs[_0xbe14('0x54')](_0x1dd6c7)){_0x28f995=!![];return _0x32496a[_0xbe14('0x55')](_0x1dd6c7,_0x34cd66,config[_0xbe14('0x56')][_0xbe14('0x57')])[_0xbe14('0x22')](function(){return _0x42a346;});}return _0x42a346;}})[_0xbe14('0x22')](function(_0x32df3c){if(_0x32df3c){var _0x285b6e=path[_0xbe14('0x50')](config[_0xbe14('0x51')],'server/files/screen_recordings',_0x32df3c['value']);if(!fs['existsSync'](_0x285b6e)){throw new db[(_0xbe14('0x58'))][(_0xbe14('0x59'))](_0xbe14('0x5a'));}if(_0x32df3c[_0xbe14('0x5b')]){return _0x50d78f[_0xbe14('0x4e')](_0x285b6e,_0x32df3c[_0xbe14('0x5b')]+path[_0xbe14('0x5c')](_0x285b6e),function(){if(_0x28f995){fs[_0xbe14('0x5d')](_0x285b6e);}});}else{return _0x50d78f[_0xbe14('0x4e')](_0x285b6e,function(_0x451b0b){if(_0x28f995){fs[_0xbe14('0x5d')](_0x285b6e);}});}}})[_0xbe14('0x41')](function(_0x2088e4){if(_0x2088e4[_0xbe14('0x5e')]===_0xbe14('0x5a')){_0x50d78f[_0xbe14('0x17')](0x194)[_0xbe14('0x26')](_0xbe14('0x5f'));}else{return handleError(_0x50d78f,null);}});};exports[_0xbe14('0x60')]=function(_0x1a945b,_0x5f394c){return db[_0xbe14('0x28')][_0xbe14('0x46')]({'where':{'id':_0x1a945b[_0xbe14('0x4c')]['id']}})[_0xbe14('0x22')](function(_0x3ee6b7){if(_[_0xbe14('0x61')](_0x3ee6b7)){throw new ReferenceError(_0xbe14('0x62'));}return _0x3ee6b7;})[_0xbe14('0x22')](function(_0x23cb36){var _0x100d43=path['join'](config[_0xbe14('0x51')],_0xbe14('0x52'),_0x23cb36[_0xbe14('0x4b')]);logger[_0xbe14('0x63')](_0xbe14('0x64'),_0x100d43);if(!_['isNil'](_0x23cb36[_0xbe14('0x4b')])&&fs[_0xbe14('0x54')](_0x100d43)){logger[_0xbe14('0x63')](_0xbe14('0x65')+_0x100d43+_0xbe14('0x66'));fs['unlinkSync'](_0x100d43);}_0x100d43=_0x100d43+_0xbe14('0x67');if(!_[_0xbe14('0x61')](_0x23cb36[_0xbe14('0x4b')])&&fs[_0xbe14('0x54')](_0x100d43)){logger[_0xbe14('0x63')](_0xbe14('0x65')+_0x100d43+_0xbe14('0x66'));fs[_0xbe14('0x68')](_0x100d43);}return _0x23cb36;})['then'](function(_0x1bb588){if(!_0x1bb588)throw new InternalError();return _0x1bb588[_0xbe14('0x60')]();})[_0xbe14('0x22')](function(){_0x5f394c[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();})[_0xbe14('0x41')](handleError(_0x5f394c,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index aebe0ea..77502df 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 _0x50ed=['path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','interactionid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x53eab3,_0x1944e8){var _0x33dd60=function(_0xe741a){while(--_0xe741a){_0x53eab3['push'](_0x53eab3['shift']());}};_0x33dd60(++_0x1944e8);}(_0x50ed,0x182));var _0xd50e=function(_0x30fc08,_0x4fd6bc){_0x30fc08=_0x30fc08-0x0;var _0x239678=_0x50ed[_0x30fc08];return _0x239678;};'use strict';var _=require(_0xd50e('0x0'));var util=require(_0xd50e('0x1'));var logger=require(_0xd50e('0x2'))(_0xd50e('0x3'));var moment=require(_0xd50e('0x4'));var BPromise=require('bluebird');var rp=require(_0xd50e('0x5'));var fs=require('fs');var path=require(_0xd50e('0x6'));var rimraf=require(_0xd50e('0x7'));var config=require(_0xd50e('0x8'));var attributes=require(_0xd50e('0x9'));module[_0xd50e('0xa')]=function(_0x4509be,_0x53a56b){return _0x4509be[_0xd50e('0xb')](_0xd50e('0xc'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xd50e('0xd'),'fields':[_0xd50e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xafa5=['screen_recordings','interactionid','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./screenRecording.attributes','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xafa5,0x141));var _0x5afa=function(_0x24fa80,_0x5d9fb1){_0x24fa80=_0x24fa80-0x0;var _0x27fcd3=_0xafa5[_0x24fa80];return _0x27fcd3;};'use strict';var _=require('lodash');var util=require(_0x5afa('0x0'));var logger=require(_0x5afa('0x1'))(_0x5afa('0x2'));var moment=require(_0x5afa('0x3'));var BPromise=require('bluebird');var rp=require(_0x5afa('0x4'));var fs=require('fs');var path=require(_0x5afa('0x5'));var rimraf=require('rimraf');var config=require(_0x5afa('0x6'));var attributes=require(_0x5afa('0x7'));module['exports']=function(_0x102703,_0x39a567){return _0x102703[_0x5afa('0x8')]('ScreenRecording',attributes,{'tableName':_0x5afa('0x9'),'paranoid':![],'indexes':[{'name':_0x5afa('0xa'),'fields':[_0x5afa('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 0e66b29..bdea628 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 _0x2db4=['stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s'];(function(_0x5cc67c,_0x3efdca){var _0x6637d=function(_0x64f9fa){while(--_0x64f9fa){_0x5cc67c['push'](_0x5cc67c['shift']());}};_0x6637d(++_0x3efdca);}(_0x2db4,0x10e));var _0x42db=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x2db4[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0x42db('0x0'));var util=require('util');var moment=require(_0x42db('0x1'));var BPromise=require(_0x42db('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x42db('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x42db('0x4'))(_0x42db('0x5'));var config=require(_0x42db('0x6'));var jayson=require(_0x42db('0x7'));var client=jayson[_0x42db('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24a864,_0x517e2b,_0x52900d){return new BPromise(function(_0x33a11d,_0xb16dc5){return client[_0x42db('0x9')](_0x24a864,_0x52900d)[_0x42db('0xa')](function(_0x5e0f2b){logger[_0x42db('0xb')](_0x42db('0xc'),_0x517e2b,_0x42db('0xd'));logger[_0x42db('0xe')](_0x42db('0xf'),_0x517e2b,_0x42db('0xd'),JSON[_0x42db('0x10')](_0x5e0f2b));if(_0x5e0f2b[_0x42db('0x11')]){if(_0x5e0f2b[_0x42db('0x11')][_0x42db('0x12')]===0x1f4){logger[_0x42db('0x11')](_0x42db('0xc'),_0x517e2b,_0x5e0f2b['error'][_0x42db('0x13')]);return _0xb16dc5(_0x5e0f2b['error'][_0x42db('0x13')]);}logger['error'](_0x42db('0xc'),_0x517e2b,_0x5e0f2b['error'][_0x42db('0x13')]);return _0x33a11d(_0x5e0f2b[_0x42db('0x11')][_0x42db('0x13')]);}else{logger['info'](_0x42db('0xc'),_0x517e2b,_0x42db('0xd'));_0x33a11d(_0x5e0f2b[_0x42db('0x14')]['message']);}})[_0x42db('0x15')](function(_0x8f66a8){logger[_0x42db('0x11')](_0x42db('0xc'),_0x517e2b,_0x8f66a8);_0xb16dc5(_0x8f66a8);});});} \ No newline at end of file +var _0x1690=['message','catch','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','result'];(function(_0x4ff7d1,_0x3331d1){var _0x16e063=function(_0x18c921){while(--_0x18c921){_0x4ff7d1['push'](_0x4ff7d1['shift']());}};_0x16e063(++_0x3331d1);}(_0x1690,0x1a6));var _0x0169=function(_0x3ffccc,_0x39620f){_0x3ffccc=_0x3ffccc-0x0;var _0x1583d2=_0x1690[_0x3ffccc];return _0x1583d2;};'use strict';var _=require(_0x0169('0x0'));var util=require(_0x0169('0x1'));var moment=require(_0x0169('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0169('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0169('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x0169('0x5'));var jayson=require(_0x0169('0x6'));var client=jayson[_0x0169('0x7')][_0x0169('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3234c4,_0x1df330,_0x56c444){return new BPromise(function(_0x2c4b2e,_0x12f95e){return client['request'](_0x3234c4,_0x56c444)[_0x0169('0x9')](function(_0xb25263){logger[_0x0169('0xa')]('ScreenRecording,\x20%s,\x20%s',_0x1df330,_0x0169('0xb'));logger[_0x0169('0xc')](_0x0169('0xd'),_0x1df330,_0x0169('0xb'),JSON[_0x0169('0xe')](_0xb25263));if(_0xb25263[_0x0169('0xf')]){if(_0xb25263[_0x0169('0xf')][_0x0169('0x10')]===0x1f4){logger[_0x0169('0xf')](_0x0169('0x11'),_0x1df330,_0xb25263['error']['message']);return _0x12f95e(_0xb25263[_0x0169('0xf')]['message']);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x1df330,_0xb25263[_0x0169('0xf')]['message']);return _0x2c4b2e(_0xb25263[_0x0169('0xf')]['message']);}else{logger['info'](_0x0169('0x11'),_0x1df330,_0x0169('0xb'));_0x2c4b2e(_0xb25263[_0x0169('0x12')][_0x0169('0x13')]);}})[_0x0169('0x14')](function(_0x215259){logger[_0x0169('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x1df330,_0x215259);_0x12f95e(_0x215259);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index a333541..68d36be 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 _0x2d7c=['put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','join','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','file','addLogo','diskStorage','root','logologin','single','addLogoLogin','preferred','favicon','addFavicon'];(function(_0x5f170f,_0x553d8e){var _0x2419de=function(_0x2f54f9){while(--_0x2f54f9){_0x5f170f['push'](_0x5f170f['shift']());}};_0x2419de(++_0x553d8e);}(_0x2d7c,0x183));var _0xc2d7=function(_0x3ce571,_0x52e126){_0x3ce571=_0x3ce571-0x0;var _0xcef624=_0x2d7c[_0x3ce571];return _0xcef624;};'use strict';var multer=require(_0xc2d7('0x0'));var util=require(_0xc2d7('0x1'));var path=require(_0xc2d7('0x2'));var timeout=require(_0xc2d7('0x3'));var express=require(_0xc2d7('0x4'));var router=express[_0xc2d7('0x5')]();var fs_extra=require(_0xc2d7('0x6'));var auth=require(_0xc2d7('0x7'));var interaction=require(_0xc2d7('0x8'));var config=require(_0xc2d7('0x9'));var controller=require(_0xc2d7('0xa'));router['get']('/',auth[_0xc2d7('0xb')](),controller[_0xc2d7('0xc')]);router[_0xc2d7('0xd')](_0xc2d7('0xe'),controller[_0xc2d7('0xf')]);router['get'](_0xc2d7('0x10'),controller[_0xc2d7('0x11')]);router[_0xc2d7('0xd')](_0xc2d7('0x12'),controller[_0xc2d7('0x13')]);router[_0xc2d7('0xd')](_0xc2d7('0x14'),controller[_0xc2d7('0x15')]);router['get'](_0xc2d7('0x16'),controller[_0xc2d7('0x17')]);router[_0xc2d7('0xd')](_0xc2d7('0x18'),controller['getPreferred']);router[_0xc2d7('0xd')](_0xc2d7('0x19'),controller[_0xc2d7('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x47b168,_0x1a8fd6,_0x236825){_0x236825(null,path[_0xc2d7('0x1b')](config['root'],_0xc2d7('0x1c')));},'filename':function(_0x43522c,_0x77dffd,_0x3766aa){_0x3766aa(null,util[_0xc2d7('0x1d')](_0xc2d7('0x1e'),_0xc2d7('0x1f'),path[_0xc2d7('0x20')](_0x77dffd[_0xc2d7('0x21')])));}})});router[_0xc2d7('0x22')](_0xc2d7('0x12'),upload['single'](_0xc2d7('0x23')),controller[_0xc2d7('0x24')]);var upload=multer({'storage':multer[_0xc2d7('0x25')]({'destination':function(_0x3f8fec,_0x1ba19a,_0x27a8c5){_0x27a8c5(null,path['join'](config[_0xc2d7('0x26')],'server/files/images/logos/'));},'filename':function(_0x55d488,_0x41be69,_0xd7785){_0xd7785(null,util[_0xc2d7('0x1d')](_0xc2d7('0x1e'),_0xc2d7('0x27'),path[_0xc2d7('0x20')](_0x41be69['originalname'])));}})});router['post']('/:id/logo_login',upload[_0xc2d7('0x28')]('file'),controller[_0xc2d7('0x29')]);var upload=multer({'storage':multer[_0xc2d7('0x25')]({'destination':function(_0x46d4f4,_0x1d8206,_0x57a655){_0x57a655(null,path[_0xc2d7('0x1b')](config[_0xc2d7('0x26')],_0xc2d7('0x1c')));},'filename':function(_0x274f82,_0x530cb0,_0x28abdc){_0x28abdc(null,util[_0xc2d7('0x1d')](_0xc2d7('0x1e'),_0xc2d7('0x2a'),path[_0xc2d7('0x20')](_0x530cb0[_0xc2d7('0x21')])));}})});router['post'](_0xc2d7('0x18'),upload[_0xc2d7('0x28')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0xc2d7('0x25')]({'destination':function(_0x2c5e3c,_0x179e40,_0x361cff){_0x361cff(null,path[_0xc2d7('0x1b')](config[_0xc2d7('0x26')],_0xc2d7('0x1c')));},'filename':function(_0x504cf0,_0x5cada7,_0x2be9b6){_0x2be9b6(null,util[_0xc2d7('0x1d')](_0xc2d7('0x1e'),_0xc2d7('0x2b'),path[_0xc2d7('0x20')](_0x5cada7[_0xc2d7('0x21')])));}})});router['post']('/:id/favicon',upload[_0xc2d7('0x28')]('file'),controller[_0xc2d7('0x2c')]);router[_0xc2d7('0x2d')](_0xc2d7('0x10'),auth[_0xc2d7('0xb')](),controller[_0xc2d7('0x2e')]);module[_0xc2d7('0x2f')]=router; \ No newline at end of file +var _0x5304=['originalname','post','/:id/logo','single','addLogo','join','logologin','file','addLogoLogin','preferred','addPreferred','favicon','addFavicon','update','exports','util','connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','index','get','/now','show','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname'];(function(_0x5daf0a,_0x4f5617){var _0x5bb34c=function(_0x402b01){while(--_0x402b01){_0x5daf0a['push'](_0x5daf0a['shift']());}};_0x5bb34c(++_0x4f5617);}(_0x5304,0x1ef));var _0x4530=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x5304[_0x16d10f];return _0x50c823;};'use strict';var multer=require('multer');var util=require(_0x4530('0x0'));var path=require('path');var timeout=require(_0x4530('0x1'));var express=require(_0x4530('0x2'));var router=express[_0x4530('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4530('0x4'));var config=require('../../config/environment');var controller=require('./setting.controller');router['get']('/',auth[_0x4530('0x5')](),controller[_0x4530('0x6')]);router[_0x4530('0x7')](_0x4530('0x8'),controller['getDate']);router[_0x4530('0x7')]('/:id',controller[_0x4530('0x9')]);router[_0x4530('0x7')]('/:id/logo',controller[_0x4530('0xa')]);router[_0x4530('0x7')](_0x4530('0xb'),controller[_0x4530('0xc')]);router[_0x4530('0x7')]('/:id/gdpr',controller[_0x4530('0xd')]);router[_0x4530('0x7')](_0x4530('0xe'),controller[_0x4530('0xf')]);router[_0x4530('0x7')](_0x4530('0x10'),controller[_0x4530('0x11')]);var upload=multer({'storage':multer[_0x4530('0x12')]({'destination':function(_0x4fc3bc,_0x43e54d,_0x396dd0){_0x396dd0(null,path['join'](config[_0x4530('0x13')],_0x4530('0x14')));},'filename':function(_0x4feb18,_0x4b8fed,_0x5f5fb4){_0x5f5fb4(null,util[_0x4530('0x15')](_0x4530('0x16'),_0x4530('0x17'),path[_0x4530('0x18')](_0x4b8fed[_0x4530('0x19')])));}})});router[_0x4530('0x1a')](_0x4530('0x1b'),upload[_0x4530('0x1c')]('file'),controller[_0x4530('0x1d')]);var upload=multer({'storage':multer[_0x4530('0x12')]({'destination':function(_0x30c01f,_0x4e7b8,_0x33e4f6){_0x33e4f6(null,path[_0x4530('0x1e')](config[_0x4530('0x13')],'server/files/images/logos/'));},'filename':function(_0x5376eb,_0x460191,_0x45f5a3){_0x45f5a3(null,util[_0x4530('0x15')](_0x4530('0x16'),_0x4530('0x1f'),path['extname'](_0x460191[_0x4530('0x19')])));}})});router[_0x4530('0x1a')](_0x4530('0xb'),upload[_0x4530('0x1c')](_0x4530('0x20')),controller[_0x4530('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3b7b76,_0x2f7467,_0x16f3bc){_0x16f3bc(null,path['join'](config[_0x4530('0x13')],_0x4530('0x14')));},'filename':function(_0x353118,_0x3f149b,_0x58d298){_0x58d298(null,util['format']('%s%s',_0x4530('0x22'),path[_0x4530('0x18')](_0x3f149b[_0x4530('0x19')])));}})});router[_0x4530('0x1a')]('/:id/preferred',upload[_0x4530('0x1c')](_0x4530('0x20')),controller[_0x4530('0x23')]);var upload=multer({'storage':multer[_0x4530('0x12')]({'destination':function(_0x22405f,_0xbf35f3,_0xf547fe){_0xf547fe(null,path[_0x4530('0x1e')](config[_0x4530('0x13')],_0x4530('0x14')));},'filename':function(_0x5eb753,_0x20d016,_0x4a95c4){_0x4a95c4(null,util[_0x4530('0x15')](_0x4530('0x16'),_0x4530('0x24'),path[_0x4530('0x18')](_0x20d016[_0x4530('0x19')])));}})});router[_0x4530('0x1a')](_0x4530('0x10'),upload[_0x4530('0x1c')](_0x4530('0x20')),controller[_0x4530('0x25')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4530('0x26')]);module[_0x4530('0x27')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 685ebe5..5f52a49 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0xd2de9b,_0x56a96d){var _0xbb5c77=function(_0x16fd16){while(--_0x16fd16){_0xd2de9b['push'](_0xd2de9b['shift']());}};_0xbb5c77(++_0x56a96d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x706db8,_0x4ae7a2){var _0x1ac625=function(_0x3ba1ab){while(--_0x3ba1ab){_0x706db8['push'](_0x706db8['shift']());}};_0x1ac625(++_0x4ae7a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 9c98713..7398672 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 _0x33cf=['result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','Setting','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','order','sort','pick','filter','where','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','merge','options','find','update','body','params','addLogo','file','filename','loginLogo','getLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','logo','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','download','getLogoLogin','getLicense','default_loginLogo.svg','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','defaultPreferred','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x302d0d,_0x5a9457){var _0xc6574c=function(_0x68950d){while(--_0x68950d){_0x302d0d['push'](_0x302d0d['shift']());}};_0xc6574c(++_0x5a9457);}(_0x33cf,0x14a));var _0xf33c=function(_0x177ccb,_0x40ed77){_0x177ccb=_0x177ccb-0x0;var _0x48d7db=_0x33cf[_0x177ccb];return _0x48d7db;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf33c('0x0'));var jsonpatch=require(_0xf33c('0x1'));var rp=require(_0xf33c('0x2'));var moment=require(_0xf33c('0x3'));var BPromise=require(_0xf33c('0x4'));var Mustache=require(_0xf33c('0x5'));var util=require(_0xf33c('0x6'));var path=require(_0xf33c('0x7'));var sox=require(_0xf33c('0x8'));var csv=require('to-csv');var ejs=require(_0xf33c('0x9'));var fs=require('fs');var fs_extra=require(_0xf33c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf33c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf33c('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf33c('0xd'));var Redis=require(_0xf33c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf33c('0xf'));var as=require(_0xf33c('0x10'));var hardwareService=require(_0xf33c('0x11'));var logger=require(_0xf33c('0x12'))(_0xf33c('0x13'));var utils=require(_0xf33c('0x14'));var config=require(_0xf33c('0x15'));var licenseUtil=require(_0xf33c('0x16'));var db=require(_0xf33c('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xf33c('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e318d,_0x1e5d28,_0x5a6f79,_0x4b37e0){return new BPromise(function(_0x4afe0a,_0x47001e){var _0x1dc954=_0x4b37e0||client;return _0x1dc954[_0xf33c('0x19')](_0x5e318d,_0x5a6f79)[_0xf33c('0x1a')](function(_0x17d9c0){logger['info'](_0xf33c('0x1b'),_0x1e5d28,_0xf33c('0x1c'));logger[_0xf33c('0x1d')](_0xf33c('0x1e'),_0x1e5d28,_0xf33c('0x1c'),JSON[_0xf33c('0x1f')](_0x17d9c0));if(_0x17d9c0[_0xf33c('0x20')]){if(_0x17d9c0[_0xf33c('0x20')][_0xf33c('0x21')]===0x1f4){logger['error'](_0xf33c('0x1b'),_0x1e5d28,_0x17d9c0[_0xf33c('0x20')][_0xf33c('0x22')]);return _0x47001e(_0x17d9c0[_0xf33c('0x20')][_0xf33c('0x22')]);}logger[_0xf33c('0x20')](_0xf33c('0x1b'),_0x1e5d28,_0x17d9c0[_0xf33c('0x20')][_0xf33c('0x22')]);return _0x4afe0a(_0x17d9c0[_0xf33c('0x20')][_0xf33c('0x22')]);}else{logger[_0xf33c('0x23')](_0xf33c('0x1b'),_0x1e5d28,'request\x20sent');_0x4afe0a(_0x17d9c0[_0xf33c('0x24')][_0xf33c('0x22')]);}})['catch'](function(_0x4bfa5b){logger[_0xf33c('0x20')](_0xf33c('0x1b'),_0x1e5d28,_0x4bfa5b);_0x47001e(_0x4bfa5b);});});}function respondWithStatusCode(_0x214078,_0x1816b2){_0x1816b2=_0x1816b2||0xcc;return function(_0x4ec8d5){if(_0x4ec8d5){return _0x214078[_0xf33c('0x25')](_0x1816b2);}return _0x214078[_0xf33c('0x26')](_0x1816b2)[_0xf33c('0x27')]();};}function respondWithResult(_0x28e631,_0x4fd9f8){_0x4fd9f8=_0x4fd9f8||0xc8;return function(_0x4f84c5){if(_0x4f84c5){return _0x28e631[_0xf33c('0x26')](_0x4fd9f8)['json'](_0x4f84c5);}};}function respondWithFilteredResult(_0x47c83a,_0x182fdd){return function(_0x1bf4bc){if(_0x1bf4bc){var _0x146ff8=typeof _0x182fdd[_0xf33c('0x28')]===_0xf33c('0x29')&&typeof _0x182fdd[_0xf33c('0x2a')]==='undefined';var _0x46acf5=_0x1bf4bc[_0xf33c('0x2b')];var _0x1f627d=_0x146ff8?0x0:_0x182fdd[_0xf33c('0x28')];var _0x11c17f=_0x146ff8?_0x1bf4bc['count']:_0x182fdd[_0xf33c('0x28')]+_0x182fdd[_0xf33c('0x2a')];var _0x2ab7e0;if(_0x11c17f>=_0x46acf5){_0x11c17f=_0x46acf5;_0x2ab7e0=0xc8;}else{_0x2ab7e0=0xce;}_0x47c83a[_0xf33c('0x26')](_0x2ab7e0);return _0x47c83a[_0xf33c('0x2c')](_0xf33c('0x2d'),_0x1f627d+'-'+_0x11c17f+'/'+_0x46acf5)['json'](_0x1bf4bc);}return null;};}function patchUpdates(_0x38722a){return function(_0x19a01c){try{jsonpatch[_0xf33c('0x2e')](_0x19a01c,_0x38722a,!![]);}catch(_0x42c822){return BPromise[_0xf33c('0x2f')](_0x42c822);}return _0x19a01c[_0xf33c('0x30')]();};}function saveUpdates(_0x26e9e7,_0x3ef4b8){return function(_0x55305b){if(_0x55305b){return _0x55305b['update'](_0x26e9e7)[_0xf33c('0x1a')](function(_0x5628e4){return _0x5628e4;});}return null;};}function removeEntity(_0x1e10a7,_0x4f4970){return function(_0x44176b){if(_0x44176b){return _0x44176b[_0xf33c('0x31')]()['then'](function(){_0x1e10a7[_0xf33c('0x26')](0xcc)[_0xf33c('0x27')]();});}};}function handleEntityNotFound(_0x2c4155,_0x4ee92f){return function(_0xa3f9ee){if(!_0xa3f9ee){_0x2c4155[_0xf33c('0x25')](0x194);}return _0xa3f9ee;};}function handleError(_0xc2df75,_0x144ea2){_0x144ea2=_0x144ea2||0x1f4;return function(_0x29f623){logger[_0xf33c('0x20')](_0x29f623[_0xf33c('0x32')]);if(_0x29f623[_0xf33c('0x33')]){delete _0x29f623['name'];}_0xc2df75['status'](_0x144ea2)[_0xf33c('0x34')](_0x29f623);};}exports[_0xf33c('0x35')]=function(_0xd34e3a,_0x574008){var _0x5ab0b8={},_0x39adab={},_0x4020f7={'count':0x0,'rows':[]};var _0x3ee474=_[_0xf33c('0x36')](db[_0xf33c('0x37')][_0xf33c('0x38')],function(_0xb375b4){return{'name':_0xb375b4['fieldName'],'type':_0xb375b4['type']['key']};});_0x39adab['model']=_['map'](_0x3ee474,'name');_0x39adab[_0xf33c('0x39')]=_[_0xf33c('0x3a')](_0xd34e3a['query']);_0x39adab[_0xf33c('0x3b')]=_[_0xf33c('0x3c')](_0x39adab[_0xf33c('0x3d')],_0x39adab[_0xf33c('0x39')]);_0x5ab0b8['attributes']=_[_0xf33c('0x3c')](_0x39adab['model'],qs[_0xf33c('0x3e')](_0xd34e3a['query'][_0xf33c('0x3e')]));_0x5ab0b8[_0xf33c('0x3f')]=_0x5ab0b8[_0xf33c('0x3f')][_0xf33c('0x40')]?_0x5ab0b8[_0xf33c('0x3f')]:_0x39adab[_0xf33c('0x3d')];if(!_0xd34e3a[_0xf33c('0x39')]['hasOwnProperty']('nolimit')){_0x5ab0b8[_0xf33c('0x2a')]=qs[_0xf33c('0x2a')](_0xd34e3a[_0xf33c('0x39')][_0xf33c('0x2a')]);_0x5ab0b8[_0xf33c('0x28')]=qs[_0xf33c('0x28')](_0xd34e3a['query'][_0xf33c('0x28')]);}_0x5ab0b8[_0xf33c('0x41')]=qs[_0xf33c('0x42')](_0xd34e3a['query'][_0xf33c('0x42')]);_0x5ab0b8['where']=qs[_0xf33c('0x3b')](_[_0xf33c('0x43')](_0xd34e3a['query'],_0x39adab[_0xf33c('0x3b')]),_0x3ee474);if(_0xd34e3a[_0xf33c('0x39')][_0xf33c('0x44')]){_0x5ab0b8[_0xf33c('0x45')]=_['merge'](_0x5ab0b8['where'],{'$or':_[_0xf33c('0x36')](_0x3ee474,function(_0x55c3b9){if(_0x55c3b9[_0xf33c('0x46')]!==_0xf33c('0x47')){var _0x11a078={};_0x11a078[_0x55c3b9['name']]={'$like':'%'+_0xd34e3a[_0xf33c('0x39')][_0xf33c('0x44')]+'%'};return _0x11a078;}})});}_0x5ab0b8=_['merge']({},_0x5ab0b8,_0xd34e3a['options']);var _0x16fd8f={'where':_0x5ab0b8[_0xf33c('0x45')]};return db['Setting']['count'](_0x16fd8f)['then'](function(_0x11c89f){_0x4020f7['count']=_0x11c89f;if(_0xd34e3a[_0xf33c('0x39')][_0xf33c('0x48')]){_0x5ab0b8[_0xf33c('0x49')]=[{'all':!![]}];}return db[_0xf33c('0x37')][_0xf33c('0x4a')](_0x5ab0b8);})['then'](function(_0x5ceeff){_0x4020f7[_0xf33c('0x4b')]=_0x5ceeff;return _0x4020f7;})[_0xf33c('0x1a')](respondWithFilteredResult(_0x574008,_0x5ab0b8))[_0xf33c('0x4c')](handleError(_0x574008,null));};exports[_0xf33c('0x4d')]=function(_0x7a02ec,_0x4183e5){var _0x17d4f3={'raw':![],'where':{'id':_0x7a02ec['params']['id']}},_0x7cd06b={};_0x7cd06b[_0xf33c('0x3d')]=_[_0xf33c('0x3a')](db[_0xf33c('0x37')][_0xf33c('0x38')]);_0x7cd06b[_0xf33c('0x39')]=_[_0xf33c('0x3a')](_0x7a02ec['query']);_0x7cd06b[_0xf33c('0x3b')]=_[_0xf33c('0x3c')](_0x7cd06b[_0xf33c('0x3d')],_0x7cd06b['query']);_0x17d4f3['attributes']=_[_0xf33c('0x3c')](_0x7cd06b[_0xf33c('0x3d')],qs[_0xf33c('0x3e')](_0x7a02ec['query'][_0xf33c('0x3e')]));_0x17d4f3['attributes']=_0x17d4f3[_0xf33c('0x3f')]['length']?_0x17d4f3[_0xf33c('0x3f')]:_0x7cd06b['model'];if(_0x7a02ec[_0xf33c('0x39')][_0xf33c('0x48')]){_0x17d4f3['include']=[{'all':!![]}];}_0x17d4f3=_[_0xf33c('0x4e')]({},_0x17d4f3,_0x7a02ec[_0xf33c('0x4f')]);return db[_0xf33c('0x37')][_0xf33c('0x50')](_0x17d4f3)[_0xf33c('0x1a')](handleEntityNotFound(_0x4183e5,null))[_0xf33c('0x1a')](respondWithResult(_0x4183e5,null))[_0xf33c('0x4c')](handleError(_0x4183e5,null));};exports[_0xf33c('0x51')]=function(_0x1e148e,_0x1878c3){if(_0x1e148e[_0xf33c('0x52')]['id']){delete _0x1e148e['body']['id'];}return db[_0xf33c('0x37')][_0xf33c('0x50')]({'where':{'id':_0x1e148e[_0xf33c('0x53')]['id']}})['then'](handleEntityNotFound(_0x1878c3,null))[_0xf33c('0x1a')](saveUpdates(_0x1e148e[_0xf33c('0x52')],null))[_0xf33c('0x1a')](respondWithResult(_0x1878c3,null))['catch'](handleError(_0x1878c3,null));};exports[_0xf33c('0x54')]=function(_0x48547b,_0x545f46,_0xe48421){if(_0x48547b['file']&&_0x48547b[_0xf33c('0x55')][_0xf33c('0x56')]){_0x48547b[_0xf33c('0x52')]['logo']=_0x48547b[_0xf33c('0x55')]['filename'];}return db['Setting'][_0xf33c('0x50')]({'where':{'id':_0x48547b['params']['id']}})[_0xf33c('0x1a')](handleEntityNotFound(_0x545f46,null))[_0xf33c('0x1a')](saveUpdates(_0x48547b[_0xf33c('0x52')],null))[_0xf33c('0x1a')](respondWithResult(_0x545f46,null))[_0xf33c('0x4c')](handleError(_0x545f46,null));};exports['addLogoLogin']=function(_0x243b85,_0x59b1ae,_0x4cbe4b){if(_0x243b85[_0xf33c('0x55')]&&_0x243b85[_0xf33c('0x55')]['filename']){_0x243b85['body'][_0xf33c('0x57')]=_0x243b85[_0xf33c('0x55')][_0xf33c('0x56')];}return db[_0xf33c('0x37')]['find']({'where':{'id':_0x243b85[_0xf33c('0x53')]['id']}})['then'](handleEntityNotFound(_0x59b1ae,null))[_0xf33c('0x1a')](saveUpdates(_0x243b85[_0xf33c('0x52')],null))[_0xf33c('0x1a')](respondWithResult(_0x59b1ae,null))[_0xf33c('0x4c')](handleError(_0x59b1ae,null));};var utilLicense=require(_0xf33c('0x16'));exports[_0xf33c('0x58')]=function(_0x130408,_0x4c70fa,_0x36d8a0){var _0x79a1ca=_0xf33c('0x59');var _0x1b52a7={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x375caa){if(_0x375caa){_0x1b52a7=_0x375caa;}return db['Setting'][_0xf33c('0x50')]({'where':{'id':_0x130408[_0xf33c('0x53')]['id']},'attributes':['logo',_0xf33c('0x57'),_0xf33c('0x5a'),_0xf33c('0x5b'),_0xf33c('0x5c'),_0xf33c('0x5d'),'defaultPreferred',_0xf33c('0x5e')],'raw':!![]});})[_0xf33c('0x1a')](handleEntityNotFound(_0x4c70fa,null))[_0xf33c('0x1a')](function(_0x5ea759){if(_0x5ea759){var _0x587c33=_0x5ea759['logo']&&fs[_0xf33c('0x5f')](path[_0xf33c('0x60')](config[_0xf33c('0x61')],_0x79a1ca,_[_0xf33c('0x62')](_0x5ea759[_0xf33c('0x63')])))?path[_0xf33c('0x60')](config[_0xf33c('0x61')],_0x79a1ca,_['toLower'](_0x5ea759[_0xf33c('0x63')])):path[_0xf33c('0x60')](config['root'],_0x79a1ca,_[_0xf33c('0x62')](_0xf33c('0x64')));var _0x394fa9=_0xf33c('0x65')+_[_0xf33c('0x66')](_0xf33c('0x63'));if(_0x5ea759[_0x394fa9]||!_0x1b52a7[_0xf33c('0x67')]){_0x587c33=path[_0xf33c('0x60')](config[_0xf33c('0x61')],_0x79a1ca,_['toLower'](_0xf33c('0x64')));}if(!fs[_0xf33c('0x5f')](_0x587c33)){throw new db[(_0xf33c('0x68'))][(_0xf33c('0x69'))](_['upperFirst']('logo')+'\x20not\x20found');}return _0x4c70fa[_0xf33c('0x6a')](_0x587c33);}})[_0xf33c('0x4c')](handleError(_0x4c70fa,null));};var utilLicense=require(_0xf33c('0x16'));exports[_0xf33c('0x6b')]=function(_0xbe822d,_0x19b22f,_0x3b84d0){var _0x54f595=_0xf33c('0x59');var _0x22c44e={'custom':![]};return utilLicense[_0xf33c('0x6c')]()[_0xf33c('0x1a')](function(_0x61ffce){if(_0x61ffce){_0x22c44e=_0x61ffce;}return db[_0xf33c('0x37')][_0xf33c('0x50')]({'where':{'id':_0xbe822d[_0xf33c('0x53')]['id']},'attributes':[_0xf33c('0x63'),_0xf33c('0x57'),'preferred',_0xf33c('0x5b'),_0xf33c('0x5c'),_0xf33c('0x5d'),'defaultPreferred',_0xf33c('0x5e')],'raw':!![]});})[_0xf33c('0x1a')](handleEntityNotFound(_0x19b22f,null))[_0xf33c('0x1a')](function(_0x1701ec){if(_0x1701ec){var _0x1274f9=_0x1701ec[_0xf33c('0x57')]&&fs[_0xf33c('0x5f')](path[_0xf33c('0x60')](config[_0xf33c('0x61')],_0x54f595,_[_0xf33c('0x62')](_0x1701ec[_0xf33c('0x57')])))?path[_0xf33c('0x60')](config[_0xf33c('0x61')],_0x54f595,_['toLower'](_0x1701ec[_0xf33c('0x57')])):path[_0xf33c('0x60')](config[_0xf33c('0x61')],_0x54f595,_['toLower']('default_loginLogo.svg'));var _0x23e777=_0xf33c('0x65')+_[_0xf33c('0x66')](_0xf33c('0x57'));if(_0x1701ec[_0x23e777]||!_0x22c44e['custom']){_0x1274f9=path[_0xf33c('0x60')](config['root'],_0x54f595,_[_0xf33c('0x62')](_0xf33c('0x6d')));}if(!fs[_0xf33c('0x5f')](_0x1274f9)){throw new db[(_0xf33c('0x68'))][(_0xf33c('0x69'))](_[_0xf33c('0x66')](_0xf33c('0x57'))+_0xf33c('0x6e'));}return _0x19b22f['download'](_0x1274f9);}})[_0xf33c('0x4c')](handleError(_0x19b22f,null));};exports[_0xf33c('0x6f')]=function(_0x1b3994,_0x1a6cc7){return db['Setting'][_0xf33c('0x50')]({'where':{'id':_0x1b3994[_0xf33c('0x53')]['id']},'attributes':[_0xf33c('0x70')]})[_0xf33c('0x1a')](respondWithResult(_0x1a6cc7,null))[_0xf33c('0x4c')](handleError(_0x1a6cc7,null));};exports[_0xf33c('0x71')]=function(_0x2ecee7,_0x5a7bb2,_0x444126){if(_0x2ecee7[_0xf33c('0x55')]&&_0x2ecee7[_0xf33c('0x55')][_0xf33c('0x56')]){_0x2ecee7[_0xf33c('0x52')]['preferred']=_0x2ecee7[_0xf33c('0x55')][_0xf33c('0x56')];}return db[_0xf33c('0x37')][_0xf33c('0x50')]({'where':{'id':_0x2ecee7[_0xf33c('0x53')]['id']}})[_0xf33c('0x1a')](handleEntityNotFound(_0x5a7bb2,null))[_0xf33c('0x1a')](saveUpdates(_0x2ecee7[_0xf33c('0x52')],null))['then'](respondWithResult(_0x5a7bb2,null))[_0xf33c('0x4c')](handleError(_0x5a7bb2,null));};var utilLicense=require('../../config/license/util');exports[_0xf33c('0x72')]=function(_0x5e8bac,_0x5ca8b8,_0x496723){var _0x4d3433=_0xf33c('0x59');var _0x291b6f={'custom':![]};return utilLicense[_0xf33c('0x6c')]()[_0xf33c('0x1a')](function(_0x33bbfb){if(_0x33bbfb){_0x291b6f=_0x33bbfb;}return db[_0xf33c('0x37')]['find']({'where':{'id':_0x5e8bac[_0xf33c('0x53')]['id']},'attributes':[_0xf33c('0x63'),'loginLogo',_0xf33c('0x5a'),'favicon',_0xf33c('0x5c'),_0xf33c('0x5d'),_0xf33c('0x73'),_0xf33c('0x5e')],'raw':!![]});})[_0xf33c('0x1a')](handleEntityNotFound(_0x5ca8b8,null))[_0xf33c('0x1a')](function(_0x3cbbcb){if(_0x3cbbcb){var _0x46ac88=_0x3cbbcb[_0xf33c('0x5a')]&&fs[_0xf33c('0x5f')](path['join'](config[_0xf33c('0x61')],_0x4d3433,_['toLower'](_0x3cbbcb[_0xf33c('0x5a')])))?path[_0xf33c('0x60')](config[_0xf33c('0x61')],_0x4d3433,_[_0xf33c('0x62')](_0x3cbbcb[_0xf33c('0x5a')])):path[_0xf33c('0x60')](config[_0xf33c('0x61')],_0x4d3433,_[_0xf33c('0x62')]('default_preferred.png'));var _0x8a16e8=_0xf33c('0x65')+_['upperFirst'](_0xf33c('0x5a'));if(_0x3cbbcb[_0x8a16e8]||!_0x291b6f['custom']||!_0x291b6f[_0xf33c('0x5a')]){_0x46ac88=path[_0xf33c('0x60')](config[_0xf33c('0x61')],_0x4d3433,_[_0xf33c('0x62')]('default_preferred.png'));}if(!fs['existsSync'](_0x46ac88)){throw new db[(_0xf33c('0x68'))][(_0xf33c('0x69'))](_[_0xf33c('0x66')](_0xf33c('0x5a'))+_0xf33c('0x6e'));}return _0x5ca8b8['download'](_0x46ac88);}})[_0xf33c('0x4c')](handleError(_0x5ca8b8,null));};exports[_0xf33c('0x74')]=function(_0xcab1d0,_0xe847ed,_0x54993e){if(_0xcab1d0[_0xf33c('0x55')]&&_0xcab1d0[_0xf33c('0x55')][_0xf33c('0x56')]){_0xcab1d0[_0xf33c('0x52')][_0xf33c('0x5b')]=_0xcab1d0[_0xf33c('0x55')][_0xf33c('0x56')];}return db['Setting']['find']({'where':{'id':_0xcab1d0[_0xf33c('0x53')]['id']}})['then'](handleEntityNotFound(_0xe847ed,null))[_0xf33c('0x1a')](saveUpdates(_0xcab1d0[_0xf33c('0x52')],null))[_0xf33c('0x1a')](respondWithResult(_0xe847ed,null))[_0xf33c('0x4c')](handleError(_0xe847ed,null));};var utilLicense=require(_0xf33c('0x16'));exports[_0xf33c('0x75')]=function(_0x264638,_0x5daca2,_0x5cd3ed){var _0x3486bf=_0xf33c('0x59');var _0x2c3b21={'custom':![]};return utilLicense[_0xf33c('0x6c')]()[_0xf33c('0x1a')](function(_0x2bec9a){if(_0x2bec9a){_0x2c3b21=_0x2bec9a;}return db[_0xf33c('0x37')][_0xf33c('0x50')]({'where':{'id':_0x264638[_0xf33c('0x53')]['id']},'attributes':['logo',_0xf33c('0x57'),'preferred',_0xf33c('0x5b'),_0xf33c('0x5c'),'defaultLoginLogo',_0xf33c('0x73'),_0xf33c('0x5e')],'raw':!![]});})[_0xf33c('0x1a')](handleEntityNotFound(_0x5daca2,null))['then'](function(_0x3ed960){if(_0x3ed960){var _0x3665df=_0x3ed960[_0xf33c('0x5b')]&&fs['existsSync'](path[_0xf33c('0x60')](config[_0xf33c('0x61')],_0x3486bf,_[_0xf33c('0x62')](_0x3ed960[_0xf33c('0x5b')])))?path['join'](config[_0xf33c('0x61')],_0x3486bf,_['toLower'](_0x3ed960['favicon'])):path[_0xf33c('0x60')](config[_0xf33c('0x61')],_0x3486bf,_['toLower'](_0xf33c('0x76')));var _0xd5520d=_0xf33c('0x65')+_[_0xf33c('0x66')](_0xf33c('0x5b'));if(_0x3ed960[_0xd5520d]||!_0x2c3b21[_0xf33c('0x67')]){_0x3665df=path[_0xf33c('0x60')](config[_0xf33c('0x61')],_0x3486bf,_[_0xf33c('0x62')](_0xf33c('0x76')));}if(!fs[_0xf33c('0x5f')](_0x3665df)){throw new db['Sequelize'][(_0xf33c('0x69'))](_[_0xf33c('0x66')]('favicon')+'\x20not\x20found');}return _0x5daca2[_0xf33c('0x6a')](_0x3665df);}})[_0xf33c('0x4c')](handleError(_0x5daca2,null));};exports[_0xf33c('0x77')]=function(_0x1862ae,_0xf91326){var _0x32a80d={'offset':moment()[_0xf33c('0x78')]()};_0x32a80d['now']=moment()[_0xf33c('0x78')](_0x32a80d['offset'])[_0xf33c('0x79')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0xf91326[_0xf33c('0x26')](0xc8)[_0xf33c('0x34')](_0x32a80d);}; \ No newline at end of file +var _0xe563=['body','addLogo','file','filename','logo','find','loginLogo','params','getLogo','server/files/images/logos','getLicense','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','root','toLower','join','default_logo.svg','upperFirst','custom','existsSync','\x20not\x20found','download','preferred','favicon','default_loginLogo.svg','default','Sequelize','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','ValidationError','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','message','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','Setting','include','rows','show','includeAll','catch','update'];(function(_0x4fef91,_0x33303d){var _0x4edadb=function(_0x4f6107){while(--_0x4f6107){_0x4fef91['push'](_0x4fef91['shift']());}};_0x4edadb(++_0x33303d);}(_0xe563,0x125));var _0x3e56=function(_0x625cd8,_0x424bf8){_0x625cd8=_0x625cd8-0x0;var _0x28f426=_0xe563[_0x625cd8];return _0x28f426;};'use strict';var emlformat=require(_0x3e56('0x0'));var rimraf=require(_0x3e56('0x1'));var zipdir=require(_0x3e56('0x2'));var jsonpatch=require(_0x3e56('0x3'));var rp=require(_0x3e56('0x4'));var moment=require(_0x3e56('0x5'));var BPromise=require(_0x3e56('0x6'));var Mustache=require(_0x3e56('0x7'));var util=require(_0x3e56('0x8'));var path=require(_0x3e56('0x9'));var sox=require('sox');var csv=require(_0x3e56('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e56('0xb'));var _=require(_0x3e56('0xc'));var squel=require(_0x3e56('0xd'));var crypto=require(_0x3e56('0xe'));var jsforce=require(_0x3e56('0xf'));var deskjs=require(_0x3e56('0x10'));var toCsv=require(_0x3e56('0xa'));var querystring=require(_0x3e56('0x11'));var Papa=require(_0x3e56('0x12'));var Redis=require(_0x3e56('0x13'));var authService=require(_0x3e56('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3e56('0x15'));var hardwareService=require(_0x3e56('0x16'));var logger=require(_0x3e56('0x17'))(_0x3e56('0x18'));var utils=require(_0x3e56('0x19'));var config=require(_0x3e56('0x1a'));var licenseUtil=require(_0x3e56('0x1b'));var db=require(_0x3e56('0x1c'))['db'];var jayson=require(_0x3e56('0x1d'));var client=jayson[_0x3e56('0x1e')][_0x3e56('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x21313a,_0x4cf468,_0x6a8f8c,_0x11d186){return new BPromise(function(_0x4ad88f,_0x2dcfd2){var _0x32d8e9=_0x11d186||client;return _0x32d8e9[_0x3e56('0x20')](_0x21313a,_0x6a8f8c)[_0x3e56('0x21')](function(_0x302527){logger[_0x3e56('0x22')](_0x3e56('0x23'),_0x4cf468,_0x3e56('0x24'));logger['debug'](_0x3e56('0x25'),_0x4cf468,_0x3e56('0x24'),JSON['stringify'](_0x302527));if(_0x302527[_0x3e56('0x26')]){if(_0x302527[_0x3e56('0x26')]['code']===0x1f4){logger[_0x3e56('0x26')](_0x3e56('0x23'),_0x4cf468,_0x302527['error'][_0x3e56('0x27')]);return _0x2dcfd2(_0x302527[_0x3e56('0x26')][_0x3e56('0x27')]);}logger[_0x3e56('0x26')](_0x3e56('0x23'),_0x4cf468,_0x302527[_0x3e56('0x26')][_0x3e56('0x27')]);return _0x4ad88f(_0x302527['error']['message']);}else{logger[_0x3e56('0x22')](_0x3e56('0x23'),_0x4cf468,_0x3e56('0x24'));_0x4ad88f(_0x302527['result'][_0x3e56('0x27')]);}})['catch'](function(_0x6022ff){logger[_0x3e56('0x26')](_0x3e56('0x23'),_0x4cf468,_0x6022ff);_0x2dcfd2(_0x6022ff);});});}function respondWithStatusCode(_0xc79453,_0x1f7b69){_0x1f7b69=_0x1f7b69||0xcc;return function(_0x48eefe){if(_0x48eefe){return _0xc79453[_0x3e56('0x28')](_0x1f7b69);}return _0xc79453[_0x3e56('0x29')](_0x1f7b69)[_0x3e56('0x2a')]();};}function respondWithResult(_0x305404,_0x25b3e8){_0x25b3e8=_0x25b3e8||0xc8;return function(_0x30a46f){if(_0x30a46f){return _0x305404[_0x3e56('0x29')](_0x25b3e8)[_0x3e56('0x2b')](_0x30a46f);}};}function respondWithFilteredResult(_0xafe6bf,_0x19cfc2){return function(_0x51ff4d){if(_0x51ff4d){var _0x540d1c=typeof _0x19cfc2[_0x3e56('0x2c')]===_0x3e56('0x2d')&&typeof _0x19cfc2['limit']===_0x3e56('0x2d');var _0x5230ac=_0x51ff4d[_0x3e56('0x2e')];var _0x2aafab=_0x540d1c?0x0:_0x19cfc2[_0x3e56('0x2c')];var _0x466404=_0x540d1c?_0x51ff4d[_0x3e56('0x2e')]:_0x19cfc2[_0x3e56('0x2c')]+_0x19cfc2['limit'];var _0x2c7d08;if(_0x466404>=_0x5230ac){_0x466404=_0x5230ac;_0x2c7d08=0xc8;}else{_0x2c7d08=0xce;}_0xafe6bf[_0x3e56('0x29')](_0x2c7d08);return _0xafe6bf[_0x3e56('0x2f')]('Content-Range',_0x2aafab+'-'+_0x466404+'/'+_0x5230ac)[_0x3e56('0x2b')](_0x51ff4d);}return null;};}function patchUpdates(_0x54587b){return function(_0x19ea60){try{jsonpatch[_0x3e56('0x30')](_0x19ea60,_0x54587b,!![]);}catch(_0x45b934){return BPromise[_0x3e56('0x31')](_0x45b934);}return _0x19ea60[_0x3e56('0x32')]();};}function saveUpdates(_0xc349f1,_0x49a77c){return function(_0x479b2b){if(_0x479b2b){return _0x479b2b['update'](_0xc349f1)[_0x3e56('0x21')](function(_0x3d8ada){return _0x3d8ada;});}return null;};}function removeEntity(_0x22b1ef,_0xa32da2){return function(_0x56cf22){if(_0x56cf22){return _0x56cf22[_0x3e56('0x33')]()[_0x3e56('0x21')](function(){_0x22b1ef[_0x3e56('0x29')](0xcc)[_0x3e56('0x2a')]();});}};}function handleEntityNotFound(_0x555aaf,_0x1b25c7){return function(_0x37fcaf){if(!_0x37fcaf){_0x555aaf[_0x3e56('0x28')](0x194);}return _0x37fcaf;};}function handleError(_0x33799c,_0x59837d){_0x59837d=_0x59837d||0x1f4;return function(_0x12c5b3){logger[_0x3e56('0x26')](_0x12c5b3[_0x3e56('0x34')]);if(_0x12c5b3[_0x3e56('0x35')]){delete _0x12c5b3[_0x3e56('0x35')];}_0x33799c[_0x3e56('0x29')](_0x59837d)['send'](_0x12c5b3);};}exports[_0x3e56('0x36')]=function(_0x5c77e5,_0xeacc06){var _0x470e24={},_0x35180c={},_0x993ffd={'count':0x0,'rows':[]};var _0x949455=_[_0x3e56('0x37')](db['Setting'][_0x3e56('0x38')],function(_0x5bce8a){return{'name':_0x5bce8a[_0x3e56('0x39')],'type':_0x5bce8a[_0x3e56('0x3a')][_0x3e56('0x3b')]};});_0x35180c[_0x3e56('0x3c')]=_[_0x3e56('0x37')](_0x949455,_0x3e56('0x35'));_0x35180c[_0x3e56('0x3d')]=_[_0x3e56('0x3e')](_0x5c77e5['query']);_0x35180c[_0x3e56('0x3f')]=_[_0x3e56('0x40')](_0x35180c[_0x3e56('0x3c')],_0x35180c['query']);_0x470e24['attributes']=_[_0x3e56('0x40')](_0x35180c['model'],qs[_0x3e56('0x41')](_0x5c77e5[_0x3e56('0x3d')][_0x3e56('0x41')]));_0x470e24['attributes']=_0x470e24[_0x3e56('0x42')][_0x3e56('0x43')]?_0x470e24['attributes']:_0x35180c['model'];if(!_0x5c77e5[_0x3e56('0x3d')][_0x3e56('0x44')]('nolimit')){_0x470e24[_0x3e56('0x45')]=qs['limit'](_0x5c77e5['query'][_0x3e56('0x45')]);_0x470e24[_0x3e56('0x2c')]=qs[_0x3e56('0x2c')](_0x5c77e5[_0x3e56('0x3d')]['offset']);}_0x470e24[_0x3e56('0x46')]=qs[_0x3e56('0x47')](_0x5c77e5['query'][_0x3e56('0x47')]);_0x470e24['where']=qs[_0x3e56('0x3f')](_[_0x3e56('0x48')](_0x5c77e5['query'],_0x35180c[_0x3e56('0x3f')]),_0x949455);if(_0x5c77e5['query'][_0x3e56('0x49')]){_0x470e24[_0x3e56('0x4a')]=_['merge'](_0x470e24[_0x3e56('0x4a')],{'$or':_[_0x3e56('0x37')](_0x949455,function(_0x311ade){if(_0x311ade[_0x3e56('0x3a')]!==_0x3e56('0x4b')){var _0x320711={};_0x320711[_0x311ade[_0x3e56('0x35')]]={'$like':'%'+_0x5c77e5[_0x3e56('0x3d')]['filter']+'%'};return _0x320711;}})});}_0x470e24=_[_0x3e56('0x4c')]({},_0x470e24,_0x5c77e5[_0x3e56('0x4d')]);var _0x88e8e6={'where':_0x470e24[_0x3e56('0x4a')]};return db[_0x3e56('0x4e')][_0x3e56('0x2e')](_0x88e8e6)['then'](function(_0xed1bcf){_0x993ffd['count']=_0xed1bcf;if(_0x5c77e5[_0x3e56('0x3d')]['includeAll']){_0x470e24[_0x3e56('0x4f')]=[{'all':!![]}];}return db[_0x3e56('0x4e')]['findAll'](_0x470e24);})[_0x3e56('0x21')](function(_0x53e5f2){_0x993ffd[_0x3e56('0x50')]=_0x53e5f2;return _0x993ffd;})[_0x3e56('0x21')](respondWithFilteredResult(_0xeacc06,_0x470e24))['catch'](handleError(_0xeacc06,null));};exports[_0x3e56('0x51')]=function(_0x5d6451,_0x1d04df){var _0x5dafc1={'raw':![],'where':{'id':_0x5d6451['params']['id']}},_0x32e659={};_0x32e659['model']=_['keys'](db['Setting'][_0x3e56('0x38')]);_0x32e659['query']=_[_0x3e56('0x3e')](_0x5d6451['query']);_0x32e659[_0x3e56('0x3f')]=_[_0x3e56('0x40')](_0x32e659['model'],_0x32e659[_0x3e56('0x3d')]);_0x5dafc1[_0x3e56('0x42')]=_[_0x3e56('0x40')](_0x32e659['model'],qs[_0x3e56('0x41')](_0x5d6451[_0x3e56('0x3d')]['fields']));_0x5dafc1['attributes']=_0x5dafc1[_0x3e56('0x42')][_0x3e56('0x43')]?_0x5dafc1[_0x3e56('0x42')]:_0x32e659[_0x3e56('0x3c')];if(_0x5d6451['query'][_0x3e56('0x52')]){_0x5dafc1[_0x3e56('0x4f')]=[{'all':!![]}];}_0x5dafc1=_[_0x3e56('0x4c')]({},_0x5dafc1,_0x5d6451[_0x3e56('0x4d')]);return db[_0x3e56('0x4e')]['find'](_0x5dafc1)[_0x3e56('0x21')](handleEntityNotFound(_0x1d04df,null))[_0x3e56('0x21')](respondWithResult(_0x1d04df,null))[_0x3e56('0x53')](handleError(_0x1d04df,null));};exports[_0x3e56('0x54')]=function(_0x55756d,_0x498836){if(_0x55756d[_0x3e56('0x55')]['id']){delete _0x55756d['body']['id'];}return db['Setting']['find']({'where':{'id':_0x55756d['params']['id']}})[_0x3e56('0x21')](handleEntityNotFound(_0x498836,null))[_0x3e56('0x21')](saveUpdates(_0x55756d[_0x3e56('0x55')],null))[_0x3e56('0x21')](respondWithResult(_0x498836,null))[_0x3e56('0x53')](handleError(_0x498836,null));};exports[_0x3e56('0x56')]=function(_0x4526be,_0x16b30f,_0x81a22c){if(_0x4526be[_0x3e56('0x57')]&&_0x4526be[_0x3e56('0x57')][_0x3e56('0x58')]){_0x4526be['body'][_0x3e56('0x59')]=_0x4526be[_0x3e56('0x57')][_0x3e56('0x58')];}return db[_0x3e56('0x4e')][_0x3e56('0x5a')]({'where':{'id':_0x4526be['params']['id']}})[_0x3e56('0x21')](handleEntityNotFound(_0x16b30f,null))['then'](saveUpdates(_0x4526be['body'],null))[_0x3e56('0x21')](respondWithResult(_0x16b30f,null))[_0x3e56('0x53')](handleError(_0x16b30f,null));};exports['addLogoLogin']=function(_0x2cddc1,_0x2bc3a9,_0x1c7c69){if(_0x2cddc1[_0x3e56('0x57')]&&_0x2cddc1['file'][_0x3e56('0x58')]){_0x2cddc1[_0x3e56('0x55')][_0x3e56('0x5b')]=_0x2cddc1[_0x3e56('0x57')][_0x3e56('0x58')];}return db['Setting'][_0x3e56('0x5a')]({'where':{'id':_0x2cddc1[_0x3e56('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2bc3a9,null))[_0x3e56('0x21')](saveUpdates(_0x2cddc1['body'],null))[_0x3e56('0x21')](respondWithResult(_0x2bc3a9,null))[_0x3e56('0x53')](handleError(_0x2bc3a9,null));};var utilLicense=require(_0x3e56('0x1b'));exports[_0x3e56('0x5d')]=function(_0x339786,_0x5192b4,_0x436a23){var _0x495ab9=_0x3e56('0x5e');var _0x372cf4={'custom':![]};return utilLicense[_0x3e56('0x5f')]()[_0x3e56('0x21')](function(_0x27fa05){if(_0x27fa05){_0x372cf4=_0x27fa05;}return db[_0x3e56('0x4e')][_0x3e56('0x5a')]({'where':{'id':_0x339786[_0x3e56('0x5c')]['id']},'attributes':[_0x3e56('0x59'),_0x3e56('0x5b'),'preferred','favicon',_0x3e56('0x60'),_0x3e56('0x61'),_0x3e56('0x62'),_0x3e56('0x63')],'raw':!![]});})['then'](handleEntityNotFound(_0x5192b4,null))[_0x3e56('0x21')](function(_0x430418){if(_0x430418){var _0x2779ec=_0x430418[_0x3e56('0x59')]&&fs['existsSync'](path['join'](config[_0x3e56('0x64')],_0x495ab9,_[_0x3e56('0x65')](_0x430418[_0x3e56('0x59')])))?path[_0x3e56('0x66')](config[_0x3e56('0x64')],_0x495ab9,_[_0x3e56('0x65')](_0x430418['logo'])):path[_0x3e56('0x66')](config[_0x3e56('0x64')],_0x495ab9,_[_0x3e56('0x65')](_0x3e56('0x67')));var _0x3f0d16='default'+_[_0x3e56('0x68')](_0x3e56('0x59'));if(_0x430418[_0x3f0d16]||!_0x372cf4[_0x3e56('0x69')]){_0x2779ec=path[_0x3e56('0x66')](config[_0x3e56('0x64')],_0x495ab9,_[_0x3e56('0x65')](_0x3e56('0x67')));}if(!fs[_0x3e56('0x6a')](_0x2779ec)){throw new db['Sequelize']['ValidationError'](_[_0x3e56('0x68')](_0x3e56('0x59'))+_0x3e56('0x6b'));}return _0x5192b4[_0x3e56('0x6c')](_0x2779ec);}})[_0x3e56('0x53')](handleError(_0x5192b4,null));};var utilLicense=require(_0x3e56('0x1b'));exports['getLogoLogin']=function(_0x548256,_0x366c8d,_0x596f33){var _0x36c61c=_0x3e56('0x5e');var _0x43b11a={'custom':![]};return utilLicense[_0x3e56('0x5f')]()['then'](function(_0x1ab8c7){if(_0x1ab8c7){_0x43b11a=_0x1ab8c7;}return db[_0x3e56('0x4e')][_0x3e56('0x5a')]({'where':{'id':_0x548256[_0x3e56('0x5c')]['id']},'attributes':[_0x3e56('0x59'),_0x3e56('0x5b'),_0x3e56('0x6d'),_0x3e56('0x6e'),'defaultLogo',_0x3e56('0x61'),_0x3e56('0x62'),_0x3e56('0x63')],'raw':!![]});})['then'](handleEntityNotFound(_0x366c8d,null))[_0x3e56('0x21')](function(_0x2a1df5){if(_0x2a1df5){var _0xf9c14a=_0x2a1df5['loginLogo']&&fs[_0x3e56('0x6a')](path[_0x3e56('0x66')](config[_0x3e56('0x64')],_0x36c61c,_[_0x3e56('0x65')](_0x2a1df5[_0x3e56('0x5b')])))?path[_0x3e56('0x66')](config[_0x3e56('0x64')],_0x36c61c,_[_0x3e56('0x65')](_0x2a1df5[_0x3e56('0x5b')])):path[_0x3e56('0x66')](config[_0x3e56('0x64')],_0x36c61c,_['toLower'](_0x3e56('0x6f')));var _0x7657d5=_0x3e56('0x70')+_[_0x3e56('0x68')]('loginLogo');if(_0x2a1df5[_0x7657d5]||!_0x43b11a[_0x3e56('0x69')]){_0xf9c14a=path[_0x3e56('0x66')](config[_0x3e56('0x64')],_0x36c61c,_[_0x3e56('0x65')]('default_loginLogo.svg'));}if(!fs[_0x3e56('0x6a')](_0xf9c14a)){throw new db[(_0x3e56('0x71'))]['ValidationError'](_['upperFirst'](_0x3e56('0x5b'))+_0x3e56('0x6b'));}return _0x366c8d[_0x3e56('0x6c')](_0xf9c14a);}})[_0x3e56('0x53')](handleError(_0x366c8d,null));};exports['gdpr']=function(_0x464db9,_0x4b3f67){return db[_0x3e56('0x4e')][_0x3e56('0x5a')]({'where':{'id':_0x464db9['params']['id']},'attributes':[_0x3e56('0x72')]})['then'](respondWithResult(_0x4b3f67,null))[_0x3e56('0x53')](handleError(_0x4b3f67,null));};exports[_0x3e56('0x73')]=function(_0x2693e3,_0x5425a3,_0x2a08c){if(_0x2693e3[_0x3e56('0x57')]&&_0x2693e3[_0x3e56('0x57')][_0x3e56('0x58')]){_0x2693e3['body'][_0x3e56('0x6d')]=_0x2693e3['file'][_0x3e56('0x58')];}return db[_0x3e56('0x4e')]['find']({'where':{'id':_0x2693e3['params']['id']}})[_0x3e56('0x21')](handleEntityNotFound(_0x5425a3,null))[_0x3e56('0x21')](saveUpdates(_0x2693e3[_0x3e56('0x55')],null))[_0x3e56('0x21')](respondWithResult(_0x5425a3,null))[_0x3e56('0x53')](handleError(_0x5425a3,null));};var utilLicense=require('../../config/license/util');exports[_0x3e56('0x74')]=function(_0x4b17a6,_0x706c72,_0x32267e){var _0x36c563=_0x3e56('0x5e');var _0x5e3abe={'custom':![]};return utilLicense[_0x3e56('0x5f')]()[_0x3e56('0x21')](function(_0x39170e){if(_0x39170e){_0x5e3abe=_0x39170e;}return db[_0x3e56('0x4e')][_0x3e56('0x5a')]({'where':{'id':_0x4b17a6[_0x3e56('0x5c')]['id']},'attributes':[_0x3e56('0x59'),_0x3e56('0x5b'),'preferred',_0x3e56('0x6e'),_0x3e56('0x60'),_0x3e56('0x61'),_0x3e56('0x62'),_0x3e56('0x63')],'raw':!![]});})[_0x3e56('0x21')](handleEntityNotFound(_0x706c72,null))['then'](function(_0x55a100){if(_0x55a100){var _0x3beab4=_0x55a100['preferred']&&fs[_0x3e56('0x6a')](path[_0x3e56('0x66')](config[_0x3e56('0x64')],_0x36c563,_[_0x3e56('0x65')](_0x55a100[_0x3e56('0x6d')])))?path[_0x3e56('0x66')](config['root'],_0x36c563,_[_0x3e56('0x65')](_0x55a100['preferred'])):path[_0x3e56('0x66')](config[_0x3e56('0x64')],_0x36c563,_[_0x3e56('0x65')](_0x3e56('0x75')));var _0x421c64=_0x3e56('0x70')+_[_0x3e56('0x68')](_0x3e56('0x6d'));if(_0x55a100[_0x421c64]||!_0x5e3abe['custom']||!_0x5e3abe[_0x3e56('0x6d')]){_0x3beab4=path[_0x3e56('0x66')](config['root'],_0x36c563,_['toLower'](_0x3e56('0x75')));}if(!fs[_0x3e56('0x6a')](_0x3beab4)){throw new db[(_0x3e56('0x71'))]['ValidationError'](_[_0x3e56('0x68')](_0x3e56('0x6d'))+_0x3e56('0x6b'));}return _0x706c72['download'](_0x3beab4);}})[_0x3e56('0x53')](handleError(_0x706c72,null));};exports[_0x3e56('0x76')]=function(_0x3822b6,_0x485e2d,_0x34d154){if(_0x3822b6[_0x3e56('0x57')]&&_0x3822b6[_0x3e56('0x57')]['filename']){_0x3822b6[_0x3e56('0x55')][_0x3e56('0x6e')]=_0x3822b6[_0x3e56('0x57')][_0x3e56('0x58')];}return db['Setting']['find']({'where':{'id':_0x3822b6[_0x3e56('0x5c')]['id']}})[_0x3e56('0x21')](handleEntityNotFound(_0x485e2d,null))[_0x3e56('0x21')](saveUpdates(_0x3822b6[_0x3e56('0x55')],null))[_0x3e56('0x21')](respondWithResult(_0x485e2d,null))['catch'](handleError(_0x485e2d,null));};var utilLicense=require(_0x3e56('0x1b'));exports[_0x3e56('0x77')]=function(_0x545140,_0x3bd26e,_0x356946){var _0xb4798e=_0x3e56('0x5e');var _0x4de4af={'custom':![]};return utilLicense[_0x3e56('0x5f')]()['then'](function(_0x3cdd81){if(_0x3cdd81){_0x4de4af=_0x3cdd81;}return db[_0x3e56('0x4e')]['find']({'where':{'id':_0x545140['params']['id']},'attributes':[_0x3e56('0x59'),'loginLogo',_0x3e56('0x6d'),_0x3e56('0x6e'),_0x3e56('0x60'),'defaultLoginLogo',_0x3e56('0x62'),_0x3e56('0x63')],'raw':!![]});})[_0x3e56('0x21')](handleEntityNotFound(_0x3bd26e,null))[_0x3e56('0x21')](function(_0x2843d6){if(_0x2843d6){var _0x47bad5=_0x2843d6[_0x3e56('0x6e')]&&fs[_0x3e56('0x6a')](path[_0x3e56('0x66')](config[_0x3e56('0x64')],_0xb4798e,_[_0x3e56('0x65')](_0x2843d6['favicon'])))?path[_0x3e56('0x66')](config[_0x3e56('0x64')],_0xb4798e,_[_0x3e56('0x65')](_0x2843d6[_0x3e56('0x6e')])):path[_0x3e56('0x66')](config[_0x3e56('0x64')],_0xb4798e,_['toLower'](_0x3e56('0x78')));var _0x1aa4e9=_0x3e56('0x70')+_['upperFirst']('favicon');if(_0x2843d6[_0x1aa4e9]||!_0x4de4af[_0x3e56('0x69')]){_0x47bad5=path[_0x3e56('0x66')](config[_0x3e56('0x64')],_0xb4798e,_[_0x3e56('0x65')](_0x3e56('0x78')));}if(!fs['existsSync'](_0x47bad5)){throw new db[(_0x3e56('0x71'))][(_0x3e56('0x79'))](_[_0x3e56('0x68')](_0x3e56('0x6e'))+_0x3e56('0x6b'));}return _0x3bd26e[_0x3e56('0x6c')](_0x47bad5);}})[_0x3e56('0x53')](handleError(_0x3bd26e,null));};exports['getDate']=function(_0x8db654,_0x1aac1a){var _0x318db3={'offset':moment()['utcOffset']()};_0x318db3['now']=moment()[_0x3e56('0x7a')](_0x318db3[_0x3e56('0x2c')])[_0x3e56('0x7b')](_0x3e56('0x7c'));return _0x1aac1a[_0x3e56('0x29')](0xc8)[_0x3e56('0x7d')](_0x318db3);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index a63d829..838ba4a 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 _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_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 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':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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':'settings','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 9d41e03..35cfb9c 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 _0x5b1e=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowSetting','Setting','find','raw','options','where','attributes','map','include','model','debug'];(function(_0x2da840,_0xb0568d){var _0x4b0c96=function(_0x2cb3f8){while(--_0x2cb3f8){_0x2da840['push'](_0x2da840['shift']());}};_0x4b0c96(++_0xb0568d);}(_0x5b1e,0xc1));var _0xe5b1=function(_0x230abb,_0x421322){_0x230abb=_0x230abb-0x0;var _0x1ede31=_0x5b1e[_0x230abb];return _0x1ede31;};'use strict';var _=require(_0xe5b1('0x0'));var util=require(_0xe5b1('0x1'));var moment=require(_0xe5b1('0x2'));var BPromise=require(_0xe5b1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5b1('0x4'));var db=require(_0xe5b1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe5b1('0x6'))('rpc');var config=require(_0xe5b1('0x7'));var jayson=require(_0xe5b1('0x8'));var client=jayson[_0xe5b1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e4a57,_0x1b461a,_0x3c5590){return new BPromise(function(_0x3c3374,_0x5a3b6f){return client[_0xe5b1('0xa')](_0x5e4a57,_0x3c5590)[_0xe5b1('0xb')](function(_0x2a6fb5){logger[_0xe5b1('0xc')](_0xe5b1('0xd'),_0x1b461a,_0xe5b1('0xe'));logger['debug'](_0xe5b1('0xf'),_0x1b461a,'request\x20sent',JSON[_0xe5b1('0x10')](_0x2a6fb5));if(_0x2a6fb5[_0xe5b1('0x11')]){if(_0x2a6fb5[_0xe5b1('0x11')][_0xe5b1('0x12')]===0x1f4){logger[_0xe5b1('0x11')]('Setting,\x20%s,\x20%s',_0x1b461a,_0x2a6fb5[_0xe5b1('0x11')][_0xe5b1('0x13')]);return _0x5a3b6f(_0x2a6fb5[_0xe5b1('0x11')][_0xe5b1('0x13')]);}logger[_0xe5b1('0x11')](_0xe5b1('0xd'),_0x1b461a,_0x2a6fb5['error'][_0xe5b1('0x13')]);return _0x3c3374(_0x2a6fb5[_0xe5b1('0x11')]['message']);}else{logger[_0xe5b1('0xc')](_0xe5b1('0xd'),_0x1b461a,'request\x20sent');_0x3c3374(_0x2a6fb5['result']['message']);}})['catch'](function(_0x9fcfe6){logger['error'](_0xe5b1('0xd'),_0x1b461a,_0x9fcfe6);_0x5a3b6f(_0x9fcfe6);});});}exports[_0xe5b1('0x14')]=function(_0x4404a0){var _0x4d7134=this;return new Promise(function(_0x1a5d13,_0x579ee1){return db[_0xe5b1('0x15')][_0xe5b1('0x16')]({'raw':_0x4404a0['options']?_0x4404a0['options'][_0xe5b1('0x17')]===undefined?!![]:![]:!![],'where':_0x4404a0[_0xe5b1('0x18')]?_0x4404a0[_0xe5b1('0x18')][_0xe5b1('0x19')]||null:null,'attributes':_0x4404a0[_0xe5b1('0x18')]?_0x4404a0[_0xe5b1('0x18')][_0xe5b1('0x1a')]||null:null,'include':_0x4404a0[_0xe5b1('0x18')]?_0x4404a0[_0xe5b1('0x18')]['include']?_[_0xe5b1('0x1b')](_0x4404a0[_0xe5b1('0x18')][_0xe5b1('0x1c')],function(_0x4cf192){return{'model':db[_0x4cf192['model']],'as':_0x4cf192['as'],'attributes':_0x4cf192[_0xe5b1('0x1a')],'include':_0x4cf192[_0xe5b1('0x1c')]?_[_0xe5b1('0x1b')](_0x4cf192['include'],function(_0x159585){return{'model':db[_0x159585[_0xe5b1('0x1d')]],'as':_0x159585['as'],'attributes':_0x159585[_0xe5b1('0x1a')],'include':_0x159585[_0xe5b1('0x1c')]?_[_0xe5b1('0x1b')](_0x159585[_0xe5b1('0x1c')],function(_0x2bf737){return{'model':db[_0x2bf737[_0xe5b1('0x1d')]],'as':_0x2bf737['as'],'attributes':_0x2bf737[_0xe5b1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe5b1('0xb')](function(_0x1f5d8e){logger[_0xe5b1('0xc')](_0xe5b1('0x14'),_0x4404a0);logger[_0xe5b1('0x1e')](_0xe5b1('0x14'),_0x4404a0,JSON[_0xe5b1('0x10')](_0x1f5d8e));_0x1a5d13(_0x1f5d8e);})[_0xe5b1('0x1f')](function(_0x85e908){logger[_0xe5b1('0x11')](_0xe5b1('0x14'),_0x85e908[_0xe5b1('0x13')],_0x4404a0);_0x579ee1(_0x4d7134[_0xe5b1('0x11')](0x1f4,_0x85e908['message']));});});}; \ No newline at end of file +var _0x0121=['error','code','message','request\x20sent','result','ShowSetting','find','options','raw','attributes','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Setting,\x20%s,\x20%s','debug','stringify'];(function(_0x1bab5b,_0x4a2039){var _0x207c1b=function(_0x332000){while(--_0x332000){_0x1bab5b['push'](_0x1bab5b['shift']());}};_0x207c1b(++_0x4a2039);}(_0x0121,0x158));var _0x1012=function(_0x18dfc7,_0x3b0a8c){_0x18dfc7=_0x18dfc7-0x0;var _0x4ff768=_0x0121[_0x18dfc7];return _0x4ff768;};'use strict';var _=require(_0x1012('0x0'));var util=require('util');var moment=require(_0x1012('0x1'));var BPromise=require(_0x1012('0x2'));var rs=require(_0x1012('0x3'));var fs=require('fs');var Redis=require(_0x1012('0x4'));var db=require(_0x1012('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1012('0x6'))(_0x1012('0x7'));var config=require(_0x1012('0x8'));var jayson=require(_0x1012('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ab5,_0x479c4e,_0x45aab3){return new BPromise(function(_0x2f857c,_0x4d223c){return client[_0x1012('0xa')](_0x3c2ab5,_0x45aab3)[_0x1012('0xb')](function(_0x1f8000){logger[_0x1012('0xc')](_0x1012('0xd'),_0x479c4e,'request\x20sent');logger[_0x1012('0xe')]('Setting,\x20%s,\x20%s,\x20%s',_0x479c4e,'request\x20sent',JSON[_0x1012('0xf')](_0x1f8000));if(_0x1f8000['error']){if(_0x1f8000[_0x1012('0x10')][_0x1012('0x11')]===0x1f4){logger[_0x1012('0x10')](_0x1012('0xd'),_0x479c4e,_0x1f8000['error'][_0x1012('0x12')]);return _0x4d223c(_0x1f8000[_0x1012('0x10')][_0x1012('0x12')]);}logger[_0x1012('0x10')](_0x1012('0xd'),_0x479c4e,_0x1f8000[_0x1012('0x10')][_0x1012('0x12')]);return _0x2f857c(_0x1f8000['error']['message']);}else{logger[_0x1012('0xc')](_0x1012('0xd'),_0x479c4e,_0x1012('0x13'));_0x2f857c(_0x1f8000[_0x1012('0x14')][_0x1012('0x12')]);}})['catch'](function(_0x266cb8){logger['error'](_0x1012('0xd'),_0x479c4e,_0x266cb8);_0x4d223c(_0x266cb8);});});}exports[_0x1012('0x15')]=function(_0x400dab){var _0x5f3365=this;return new Promise(function(_0x19211b,_0x31c32f){return db['Setting'][_0x1012('0x16')]({'raw':_0x400dab['options']?_0x400dab[_0x1012('0x17')][_0x1012('0x18')]===undefined?!![]:![]:!![],'where':_0x400dab['options']?_0x400dab['options']['where']||null:null,'attributes':_0x400dab[_0x1012('0x17')]?_0x400dab['options'][_0x1012('0x19')]||null:null,'include':_0x400dab[_0x1012('0x17')]?_0x400dab[_0x1012('0x17')][_0x1012('0x1a')]?_[_0x1012('0x1b')](_0x400dab[_0x1012('0x17')]['include'],function(_0x1da0d6){return{'model':db[_0x1da0d6[_0x1012('0x1c')]],'as':_0x1da0d6['as'],'attributes':_0x1da0d6[_0x1012('0x19')],'include':_0x1da0d6[_0x1012('0x1a')]?_['map'](_0x1da0d6['include'],function(_0x435352){return{'model':db[_0x435352[_0x1012('0x1c')]],'as':_0x435352['as'],'attributes':_0x435352[_0x1012('0x19')],'include':_0x435352[_0x1012('0x1a')]?_['map'](_0x435352[_0x1012('0x1a')],function(_0xbd9595){return{'model':db[_0xbd9595[_0x1012('0x1c')]],'as':_0xbd9595['as'],'attributes':_0xbd9595[_0x1012('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1012('0xb')](function(_0xd1ee70){logger[_0x1012('0xc')](_0x1012('0x15'),_0x400dab);logger[_0x1012('0xe')](_0x1012('0x15'),_0x400dab,JSON['stringify'](_0xd1ee70));_0x19211b(_0xd1ee70);})[_0x1012('0x1d')](function(_0x5181a1){logger[_0x1012('0x10')]('ShowSetting',_0x5181a1[_0x1012('0x12')],_0x400dab);_0x31c32f(_0x5f3365[_0x1012('0x10')](0x1f4,_0x5181a1[_0x1012('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 19786b0..daf19e8 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 _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x285c85,_0x132c21){var _0x2f81cd=function(_0x9b9962){while(--_0x9b9962){_0x285c85['push'](_0x285c85['shift']());}};_0x2f81cd(++_0x132c21);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file +var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x180e73,_0x39e847){var _0xa8b095=function(_0x126b4f){while(--_0x126b4f){_0x180e73['push'](_0x180e73['shift']());}};_0xa8b095(++_0x39e847);}(_0x7a54,0x106));var _0x47a5=function(_0x6f9a56,_0x4c4a28){_0x6f9a56=_0x6f9a56-0x0;var _0x44a979=_0x7a54[_0x6f9a56];return _0x44a979;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 83c1fbb..1d48988 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 _0x78bf=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','ENUM','twilio','plivo','clickatell','bandwidth','csc','infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x272ea6,_0x3f0673){var _0x43ef03=function(_0x2307e2){while(--_0x2307e2){_0x272ea6['push'](_0x272ea6['shift']());}};_0x43ef03(++_0x3f0673);}(_0x78bf,0xee));var _0xf78b=function(_0xc93556,_0x840f41){_0xc93556=_0xc93556-0x0;var _0x4453a1=_0x78bf[_0xc93556];return _0x4453a1;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xf78b('0x0'));module[_0xf78b('0x1')]={'name':{'type':Sequelize[_0xf78b('0x2')],'unique':_0xf78b('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xf78b('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xf78b('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xf78b('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xf78b('0x2')]},'type':{'type':Sequelize[_0xf78b('0x4')](_0xf78b('0x5'),'skebby','connectel','clicksend',_0xf78b('0x6'),_0xf78b('0x7'),_0xf78b('0x8'),_0xf78b('0x9'),_0xf78b('0xa'),_0xf78b('0xb'))},'accountSid':{'type':Sequelize[_0xf78b('0x2')]},'authId':{'type':Sequelize[_0xf78b('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xf78b('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xf78b('0x2')]},'password':{'type':Sequelize[_0xf78b('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xf78b('0x2')]},'accountId':{'type':Sequelize[_0xf78b('0x2')]},'senderString':{'type':Sequelize[_0xf78b('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf78b('0xc')],'defaultValue':function(){return _0xf78b('0xd');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf78b('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf78b('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf78b('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf78b('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf78b('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xf78b('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf78b('0xf')],'comment':_0xf78b('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf78b('0x11'),'set':function(_0x3c2bae){if(!_0x3c2bae)this[_0xf78b('0x12')](_0xf78b('0x13'),null);this[_0xf78b('0x12')](_0xf78b('0x14'),_0x3c2bae);}}}; \ No newline at end of file +var _0x30de=['ENUM','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','sequelize','randomstring','exports','STRING','name','twilio','connectel','clicksend','plivo','clickatell','csc','intelepeer'];(function(_0xd89c89,_0x44b883){var _0x1733c3=function(_0x898075){while(--_0x898075){_0xd89c89['push'](_0xd89c89['shift']());}};_0x1733c3(++_0x44b883);}(_0x30de,0x1ad));var _0xe30d=function(_0x355f62,_0x4dbf53){_0x355f62=_0x355f62-0x0;var _0x47b9be=_0x30de[_0x355f62];return _0x47b9be;};'use strict';var Sequelize=require(_0xe30d('0x0'));var rs=require(_0xe30d('0x1'));module[_0xe30d('0x2')]={'name':{'type':Sequelize[_0xe30d('0x3')],'unique':_0xe30d('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xe30d('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xe30d('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xe30d('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xe30d('0x3')]},'type':{'type':Sequelize['ENUM'](_0xe30d('0x5'),'skebby',_0xe30d('0x6'),_0xe30d('0x7'),_0xe30d('0x8'),_0xe30d('0x9'),'bandwidth',_0xe30d('0xa'),'infobip',_0xe30d('0xb'))},'accountSid':{'type':Sequelize[_0xe30d('0x3')]},'authId':{'type':Sequelize[_0xe30d('0x3')]},'authToken':{'type':Sequelize[_0xe30d('0x3')]},'smsMethod':{'type':Sequelize[_0xe30d('0xc')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xe30d('0x3')]},'apiKey':{'type':Sequelize[_0xe30d('0x3')]},'applicationId':{'type':Sequelize[_0xe30d('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xe30d('0x3')]},'deliveryReport':{'type':Sequelize[_0xe30d('0xd')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xe30d('0xe')],'defaultValue':function(){return _0xe30d('0xf');}},'notificationSound':{'type':Sequelize[_0xe30d('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe30d('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe30d('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xe30d('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe30d('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe30d('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe30d('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xe30d('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe30d('0x10')],'comment':_0xe30d('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xe30d('0xd')],'defaultValue':![],'comment':_0xe30d('0x12'),'set':function(_0x201008){if(!_0x201008)this[_0xe30d('0x13')](_0xe30d('0x14'),null);this[_0xe30d('0x13')]('mandatoryDisposition',_0x201008);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 86a7e8e..dc7f5d0 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 _0xae88=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','get','SmsAccounts','stack','name','send','index','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','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','Pause','describe','SmsAccountId','Disposition','findOne','removeDispositions','addAnswer','CannedAnswer','include','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','Body','messageId','MessageSid','skebby','sender','text','clicksend','message_id','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','Sequelize','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','autoclose','close','unmanaged','User','UserId','agent','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','fullname','internal','Tag','Tags','color','tag','List','SmsMessage','Messages','dataValues','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','groupName','redif','connectel','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','state','message-id','addAgents','ids','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x58c074,_0x57a0cb){var _0x31eab2=function(_0x21834e){while(--_0x21834e){_0x58c074['push'](_0x58c074['shift']());}};_0x31eab2(++_0x57a0cb);}(_0xae88,0x1bd));var _0x8ae8=function(_0x10eb6f,_0x48928a){_0x10eb6f=_0x10eb6f-0x0;var _0x2c1b95=_0xae88[_0x10eb6f];return _0x2c1b95;};'use strict';var emlformat=require(_0x8ae8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8ae8('0x1'));var jsonpatch=require(_0x8ae8('0x2'));var rp=require(_0x8ae8('0x3'));var moment=require('moment');var BPromise=require(_0x8ae8('0x4'));var Mustache=require(_0x8ae8('0x5'));var util=require(_0x8ae8('0x6'));var path=require(_0x8ae8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8ae8('0x8'));var fs=require('fs');var fs_extra=require(_0x8ae8('0x9'));var _=require('lodash');var squel=require(_0x8ae8('0xa'));var crypto=require(_0x8ae8('0xb'));var jsforce=require(_0x8ae8('0xc'));var deskjs=require(_0x8ae8('0xd'));var toCsv=require(_0x8ae8('0xe'));var querystring=require(_0x8ae8('0xf'));var Papa=require(_0x8ae8('0x10'));var Redis=require(_0x8ae8('0x11'));var authService=require(_0x8ae8('0x12'));var qs=require(_0x8ae8('0x13'));var as=require(_0x8ae8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ae8('0x15'))('api');var utils=require(_0x8ae8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8ae8('0x17'));var db=require(_0x8ae8('0x18'))['db'];config[_0x8ae8('0x19')]=_[_0x8ae8('0x1a')](config['redis'],{'host':_0x8ae8('0x1b'),'port':0x18eb});var socket=require(_0x8ae8('0x1c'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x8ae8('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x8ae8('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x18192d,_0x5a7ee9,_0x5dcad1,_0x56d6cf){return new BPromise(function(_0x27962c,_0x389e2a){var _0x5857d9=_0x56d6cf||client;return _0x5857d9[_0x8ae8('0x1f')](_0x18192d,_0x5dcad1)[_0x8ae8('0x20')](function(_0x537d9a){logger[_0x8ae8('0x21')](_0x8ae8('0x22'),_0x5a7ee9,_0x8ae8('0x23'));logger[_0x8ae8('0x24')](_0x8ae8('0x25'),_0x5a7ee9,_0x8ae8('0x23'),JSON[_0x8ae8('0x26')](_0x537d9a));if(_0x537d9a['error']){if(_0x537d9a[_0x8ae8('0x27')][_0x8ae8('0x28')]===0x1f4){logger[_0x8ae8('0x27')](_0x8ae8('0x22'),_0x5a7ee9,_0x537d9a[_0x8ae8('0x27')]['message']);return _0x389e2a(_0x537d9a[_0x8ae8('0x27')][_0x8ae8('0x29')]);}logger[_0x8ae8('0x27')]('SmsAccount,\x20%s,\x20%s',_0x5a7ee9,_0x537d9a[_0x8ae8('0x27')][_0x8ae8('0x29')]);return _0x27962c(_0x537d9a[_0x8ae8('0x27')][_0x8ae8('0x29')]);}else{logger[_0x8ae8('0x21')](_0x8ae8('0x22'),_0x5a7ee9,_0x8ae8('0x23'));_0x27962c(_0x537d9a[_0x8ae8('0x2a')][_0x8ae8('0x29')]);}})[_0x8ae8('0x2b')](function(_0xbbf9c7){logger[_0x8ae8('0x27')](_0x8ae8('0x22'),_0x5a7ee9,_0xbbf9c7);_0x389e2a(_0xbbf9c7);});});}function respondWithStatusCode(_0x506537,_0x31c087){_0x31c087=_0x31c087||0xcc;return function(_0x1f7220){if(_0x1f7220){return _0x506537[_0x8ae8('0x2c')](_0x31c087);}return _0x506537[_0x8ae8('0x2d')](_0x31c087)['end']();};}function respondWithResult(_0xffbd29,_0x1a8ad1){_0x1a8ad1=_0x1a8ad1||0xc8;return function(_0x1f27dd){if(_0x1f27dd){return _0xffbd29['status'](_0x1a8ad1)[_0x8ae8('0x2e')](_0x1f27dd);}};}function respondWithFilteredResult(_0x45af88,_0x42e04f){return function(_0x31ca76){if(_0x31ca76){var _0x5ecc3e=typeof _0x42e04f[_0x8ae8('0x2f')]===_0x8ae8('0x30')&&typeof _0x42e04f[_0x8ae8('0x31')]===_0x8ae8('0x30');var _0x447b66=_0x31ca76['count'];var _0xd02f4c=_0x5ecc3e?0x0:_0x42e04f[_0x8ae8('0x2f')];var _0x3eca71=_0x5ecc3e?_0x31ca76[_0x8ae8('0x32')]:_0x42e04f[_0x8ae8('0x2f')]+_0x42e04f[_0x8ae8('0x31')];var _0x3a1aa3;if(_0x3eca71>=_0x447b66){_0x3eca71=_0x447b66;_0x3a1aa3=0xc8;}else{_0x3a1aa3=0xce;}_0x45af88[_0x8ae8('0x2d')](_0x3a1aa3);return _0x45af88[_0x8ae8('0x33')](_0x8ae8('0x34'),_0xd02f4c+'-'+_0x3eca71+'/'+_0x447b66)['json'](_0x31ca76);}return null;};}function patchUpdates(_0x52d4f0){return function(_0x26e6af){try{jsonpatch[_0x8ae8('0x35')](_0x26e6af,_0x52d4f0,!![]);}catch(_0x1d9d04){return BPromise['reject'](_0x1d9d04);}return _0x26e6af[_0x8ae8('0x36')]();};}function saveUpdates(_0x531dbb,_0x224e52){return function(_0x5e18fe){if(_0x5e18fe){return _0x5e18fe['update'](_0x531dbb)[_0x8ae8('0x20')](function(_0x40821a){return _0x40821a;});}return null;};}function removeEntity(_0x5394f6,_0x936fe6){return function(_0x480589){if(_0x480589){return _0x480589[_0x8ae8('0x37')]()[_0x8ae8('0x20')](function(){var _0x4e7f11=_0x480589[_0x8ae8('0x38')]({'plain':!![]});var _0x13cd82=_0x8ae8('0x39');return db['UserProfileResource'][_0x8ae8('0x37')]({'where':{'type':_0x13cd82,'resourceId':_0x4e7f11['id']}})[_0x8ae8('0x20')](function(){return _0x480589;});})[_0x8ae8('0x20')](function(){_0x5394f6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45534a,_0x3c7d90){return function(_0x57e54a){if(!_0x57e54a){_0x45534a[_0x8ae8('0x2c')](0x194);}return _0x57e54a;};}function handleError(_0x5456cf,_0x164277){_0x164277=_0x164277||0x1f4;return function(_0x3cce01){logger[_0x8ae8('0x27')](_0x3cce01[_0x8ae8('0x3a')]);if(_0x3cce01['name']){delete _0x3cce01[_0x8ae8('0x3b')];}_0x5456cf[_0x8ae8('0x2d')](_0x164277)[_0x8ae8('0x3c')](_0x3cce01);};}exports[_0x8ae8('0x3d')]=function(_0x119092,_0x856b10){var _0x6a82f6={'include':[{'model':db['Pause'],'as':_0x8ae8('0x3e')}]},_0x25e727={},_0xe1aa73={'count':0x0,'rows':[]};var _0x15860b=_['map'](db[_0x8ae8('0x3f')][_0x8ae8('0x40')],function(_0x3a4d83){return{'name':_0x3a4d83[_0x8ae8('0x41')],'type':_0x3a4d83[_0x8ae8('0x42')][_0x8ae8('0x43')]};});_0x25e727['model']=_[_0x8ae8('0x44')](_0x15860b,_0x8ae8('0x3b'));_0x25e727[_0x8ae8('0x45')]=_[_0x8ae8('0x46')](_0x119092[_0x8ae8('0x45')]);_0x25e727[_0x8ae8('0x47')]=_['intersection'](_0x25e727[_0x8ae8('0x48')],_0x25e727['query']);_0x6a82f6[_0x8ae8('0x49')]=_[_0x8ae8('0x4a')](_0x25e727[_0x8ae8('0x48')],qs[_0x8ae8('0x4b')](_0x119092[_0x8ae8('0x45')][_0x8ae8('0x4b')]));_0x6a82f6[_0x8ae8('0x49')]=_0x6a82f6['attributes'][_0x8ae8('0x4c')]?_0x6a82f6[_0x8ae8('0x49')]:_0x25e727['model'];if(!_0x119092[_0x8ae8('0x45')][_0x8ae8('0x4d')](_0x8ae8('0x4e'))){_0x6a82f6[_0x8ae8('0x31')]=qs[_0x8ae8('0x31')](_0x119092['query'][_0x8ae8('0x31')]);_0x6a82f6[_0x8ae8('0x2f')]=qs[_0x8ae8('0x2f')](_0x119092[_0x8ae8('0x45')][_0x8ae8('0x2f')]);}_0x6a82f6[_0x8ae8('0x4f')]=qs[_0x8ae8('0x50')](_0x119092['query'][_0x8ae8('0x50')]);_0x6a82f6[_0x8ae8('0x51')]=qs[_0x8ae8('0x47')](_[_0x8ae8('0x52')](_0x119092[_0x8ae8('0x45')],_0x25e727[_0x8ae8('0x47')]),_0x15860b);if(_0x119092[_0x8ae8('0x45')][_0x8ae8('0x53')]){_0x6a82f6[_0x8ae8('0x51')]=_[_0x8ae8('0x54')](_0x6a82f6['where'],{'$or':_[_0x8ae8('0x44')](_0x15860b,function(_0x12e2cc){if(_0x12e2cc[_0x8ae8('0x42')]!=='VIRTUAL'){var _0x135e32={};_0x135e32[_0x12e2cc[_0x8ae8('0x3b')]]={'$like':'%'+_0x119092[_0x8ae8('0x45')][_0x8ae8('0x53')]+'%'};return _0x135e32;}})});}_0x6a82f6=_[_0x8ae8('0x54')]({},_0x6a82f6,_0x119092[_0x8ae8('0x55')]);var _0x4baf98={'where':_0x6a82f6[_0x8ae8('0x51')]};return db[_0x8ae8('0x3f')]['count'](_0x4baf98)['then'](function(_0x2bdd1a){_0xe1aa73['count']=_0x2bdd1a;if(_0x119092[_0x8ae8('0x45')][_0x8ae8('0x56')]){_0x6a82f6['include']=[{'all':!![]}];}return db[_0x8ae8('0x3f')][_0x8ae8('0x57')](_0x6a82f6);})[_0x8ae8('0x20')](function(_0x4ccbc3){_0xe1aa73[_0x8ae8('0x58')]=_0x4ccbc3;return _0xe1aa73;})['then'](respondWithFilteredResult(_0x856b10,_0x6a82f6))[_0x8ae8('0x2b')](handleError(_0x856b10,null));};exports[_0x8ae8('0x59')]=function(_0x4a6c7a,_0x2ff83a){var _0x94bbce={'raw':![],'where':{'id':_0x4a6c7a[_0x8ae8('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x8ae8('0x3e')}]},_0x4937b3={};_0x4937b3[_0x8ae8('0x48')]=_[_0x8ae8('0x46')](db['SmsAccount']['rawAttributes']);_0x4937b3['query']=_[_0x8ae8('0x46')](_0x4a6c7a[_0x8ae8('0x45')]);_0x4937b3['filters']=_[_0x8ae8('0x4a')](_0x4937b3[_0x8ae8('0x48')],_0x4937b3[_0x8ae8('0x45')]);_0x94bbce['attributes']=_[_0x8ae8('0x4a')](_0x4937b3[_0x8ae8('0x48')],qs[_0x8ae8('0x4b')](_0x4a6c7a[_0x8ae8('0x45')]['fields']));_0x94bbce[_0x8ae8('0x49')]=_0x94bbce['attributes']['length']?_0x94bbce[_0x8ae8('0x49')]:_0x4937b3[_0x8ae8('0x48')];if(_0x4a6c7a['query'][_0x8ae8('0x56')]){_0x94bbce['include']=[{'all':!![]}];}_0x94bbce=_[_0x8ae8('0x54')]({},_0x94bbce,_0x4a6c7a[_0x8ae8('0x55')]);return db[_0x8ae8('0x3f')][_0x8ae8('0x5b')](_0x94bbce)[_0x8ae8('0x20')](handleEntityNotFound(_0x2ff83a,null))[_0x8ae8('0x20')](respondWithResult(_0x2ff83a,null))['catch'](handleError(_0x2ff83a,null));};exports[_0x8ae8('0x5c')]=function(_0x58f08e,_0x1dad26){return db[_0x8ae8('0x3f')][_0x8ae8('0x5c')](_0x58f08e[_0x8ae8('0x5d')],{})[_0x8ae8('0x20')](function(_0x5b6731){var _0x4b8c47=_0x58f08e[_0x8ae8('0x5e')][_0x8ae8('0x38')]({'plain':!![]});if(!_0x4b8c47)throw new Error(_0x8ae8('0x5f'));if(_0x4b8c47[_0x8ae8('0x60')]===_0x8ae8('0x5e')){var _0x209899=_0x5b6731['get']({'plain':!![]});var _0x25238e=_0x8ae8('0x39');return db[_0x8ae8('0x61')][_0x8ae8('0x5b')]({'where':{'name':_0x25238e,'userProfileId':_0x4b8c47[_0x8ae8('0x62')]},'raw':!![]})[_0x8ae8('0x20')](function(_0x3f576c){if(_0x3f576c&&_0x3f576c[_0x8ae8('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x209899[_0x8ae8('0x3b')],'resourceId':_0x209899['id'],'type':_0x3f576c[_0x8ae8('0x3b')],'sectionId':_0x3f576c['id']},{})[_0x8ae8('0x20')](function(){return _0x5b6731;});}else{return _0x5b6731;}})[_0x8ae8('0x2b')](function(_0x2ebe49){logger['error'](_0x8ae8('0x64'),_0x2ebe49);throw _0x2ebe49;});}return _0x5b6731;})['then'](respondWithResult(_0x1dad26,0xc9))[_0x8ae8('0x2b')](handleError(_0x1dad26,null));};exports[_0x8ae8('0x65')]=function(_0x4973b7,_0xac4388){if(_0x4973b7[_0x8ae8('0x5d')]['id']){delete _0x4973b7[_0x8ae8('0x5d')]['id'];}return db[_0x8ae8('0x3f')]['find']({'where':{'id':_0x4973b7[_0x8ae8('0x5a')]['id']},'include':[{'model':db[_0x8ae8('0x66')],'as':_0x8ae8('0x3e')}]})['then'](handleEntityNotFound(_0xac4388,null))[_0x8ae8('0x20')](saveUpdates(_0x4973b7['body'],null))[_0x8ae8('0x20')](respondWithResult(_0xac4388,null))[_0x8ae8('0x2b')](handleError(_0xac4388,null));};exports[_0x8ae8('0x37')]=function(_0x372ccd,_0x102a40){return db['SmsAccount'][_0x8ae8('0x5b')]({'where':{'id':_0x372ccd['params']['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x102a40,null))['then'](removeEntity(_0x102a40,null))[_0x8ae8('0x2b')](handleError(_0x102a40,null));};exports[_0x8ae8('0x67')]=function(_0x43bca3,_0x3a91f2){return db['SmsAccount']['describe']()[_0x8ae8('0x20')](respondWithResult(_0x3a91f2,null))[_0x8ae8('0x2b')](handleError(_0x3a91f2,null));};exports['addDisposition']=function(_0x681078,_0x38a309,_0x4a15bd){if(_0x681078['body']['id']){delete _0x681078['body']['id'];}return db[_0x8ae8('0x3f')][_0x8ae8('0x5b')]({'where':{'id':_0x681078['params']['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x38a309,null))[_0x8ae8('0x20')](function(_0x3e3ea6){if(_0x3e3ea6){_0x681078[_0x8ae8('0x5d')][_0x8ae8('0x68')]=_0x3e3ea6['id'];return db[_0x8ae8('0x69')][_0x8ae8('0x5c')](_0x681078[_0x8ae8('0x5d')]);}})['then'](respondWithResult(_0x38a309,null))['catch'](handleError(_0x38a309,null));};exports['getDispositions']=function(_0x20546c,_0x5d5de5,_0x559124){var _0x42518c={'raw':![],'where':{}};var _0x3bb1fe={};var _0x357feb={'count':0x0,'rows':[]};return db[_0x8ae8('0x3f')][_0x8ae8('0x6a')]({'where':{'id':_0x20546c[_0x8ae8('0x5a')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x5d5de5,null))[_0x8ae8('0x20')](function(_0x275355){if(_0x275355){_0x3bb1fe['model']=_[_0x8ae8('0x46')](db[_0x8ae8('0x69')][_0x8ae8('0x40')]);_0x3bb1fe['query']=_['keys'](_0x20546c[_0x8ae8('0x45')]);_0x3bb1fe[_0x8ae8('0x47')]=_['intersection'](_0x3bb1fe[_0x8ae8('0x48')],_0x3bb1fe[_0x8ae8('0x45')]);_0x42518c[_0x8ae8('0x49')]=_['intersection'](_0x3bb1fe[_0x8ae8('0x48')],qs[_0x8ae8('0x4b')](_0x20546c[_0x8ae8('0x45')]['fields']));_0x42518c[_0x8ae8('0x49')]=_0x42518c[_0x8ae8('0x49')][_0x8ae8('0x4c')]?_0x42518c[_0x8ae8('0x49')]:_0x3bb1fe[_0x8ae8('0x48')];if(!_0x20546c[_0x8ae8('0x45')][_0x8ae8('0x4d')](_0x8ae8('0x4e'))){_0x42518c[_0x8ae8('0x31')]=qs[_0x8ae8('0x31')](_0x20546c[_0x8ae8('0x45')]['limit']);_0x42518c[_0x8ae8('0x2f')]=qs[_0x8ae8('0x2f')](_0x20546c[_0x8ae8('0x45')][_0x8ae8('0x2f')]);}_0x42518c['order']=qs[_0x8ae8('0x50')](_0x20546c[_0x8ae8('0x45')][_0x8ae8('0x50')]);_0x42518c[_0x8ae8('0x51')]=qs[_0x8ae8('0x47')](_[_0x8ae8('0x52')](_0x20546c[_0x8ae8('0x45')],_0x3bb1fe['filters']));_0x42518c[_0x8ae8('0x51')][_0x8ae8('0x68')]=_0x275355['id'];if(_0x20546c[_0x8ae8('0x45')][_0x8ae8('0x53')]){_0x42518c['where']=_['merge'](_0x42518c[_0x8ae8('0x51')],{'$or':_[_0x8ae8('0x44')](_0x42518c['attributes'],function(_0x24db95){var _0x3167af={};_0x3167af[_0x24db95]={'$like':'%'+_0x20546c['query']['filter']+'%'};return _0x3167af;})});}_0x42518c=_['merge']({},_0x42518c,_0x20546c[_0x8ae8('0x55')]);return db['Disposition']['count']({'where':_0x42518c[_0x8ae8('0x51')]})['then'](function(_0x506018){_0x357feb['count']=_0x506018;if(_0x20546c['query']['includeAll']){_0x42518c['include']=[{'all':!![]}];}return db[_0x8ae8('0x69')]['findAll'](_0x42518c);})[_0x8ae8('0x20')](function(_0xfb3711){_0x357feb[_0x8ae8('0x58')]=_0xfb3711;return _0x357feb;});}})[_0x8ae8('0x20')](respondWithFilteredResult(_0x5d5de5,_0x42518c))[_0x8ae8('0x2b')](handleError(_0x5d5de5,null));};exports[_0x8ae8('0x6b')]=function(_0x1851fe,_0x11c604,_0x59ac20){return db[_0x8ae8('0x3f')]['find']({'where':{'id':_0x1851fe[_0x8ae8('0x5a')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x11c604,null))[_0x8ae8('0x20')](function(_0x532fa1){if(_0x532fa1){return _0x532fa1[_0x8ae8('0x6b')](_0x1851fe[_0x8ae8('0x45')]['ids']);}})[_0x8ae8('0x20')](respondWithStatusCode(_0x11c604,null))[_0x8ae8('0x2b')](handleError(_0x11c604,null));};exports[_0x8ae8('0x6c')]=function(_0x3f3d9f,_0x1f8374,_0x20f29c){if(_0x3f3d9f[_0x8ae8('0x5d')]['id']){delete _0x3f3d9f[_0x8ae8('0x5d')]['id'];}return db['SmsAccount'][_0x8ae8('0x5b')]({'where':{'id':_0x3f3d9f[_0x8ae8('0x5a')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x1f8374,null))[_0x8ae8('0x20')](function(_0x6254df){if(_0x6254df){_0x3f3d9f[_0x8ae8('0x5d')][_0x8ae8('0x68')]=_0x6254df['id'];return db['CannedAnswer']['create'](_0x3f3d9f[_0x8ae8('0x5d')]);}})[_0x8ae8('0x20')](respondWithResult(_0x1f8374,null))['catch'](handleError(_0x1f8374,null));};exports['getAnswers']=function(_0x539a76,_0x581327,_0x50037c){var _0x5c069f={'raw':![],'where':{}};var _0xe096c5={};var _0x4133fb={'count':0x0,'rows':[]};return db[_0x8ae8('0x3f')][_0x8ae8('0x6a')]({'where':{'id':_0x539a76[_0x8ae8('0x5a')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x581327,null))[_0x8ae8('0x20')](function(_0x22764a){if(_0x22764a){_0xe096c5[_0x8ae8('0x48')]=_[_0x8ae8('0x46')](db[_0x8ae8('0x6d')]['rawAttributes']);_0xe096c5[_0x8ae8('0x45')]=_[_0x8ae8('0x46')](_0x539a76[_0x8ae8('0x45')]);_0xe096c5[_0x8ae8('0x47')]=_[_0x8ae8('0x4a')](_0xe096c5[_0x8ae8('0x48')],_0xe096c5[_0x8ae8('0x45')]);_0x5c069f[_0x8ae8('0x49')]=_[_0x8ae8('0x4a')](_0xe096c5[_0x8ae8('0x48')],qs[_0x8ae8('0x4b')](_0x539a76['query'][_0x8ae8('0x4b')]));_0x5c069f[_0x8ae8('0x49')]=_0x5c069f[_0x8ae8('0x49')][_0x8ae8('0x4c')]?_0x5c069f[_0x8ae8('0x49')]:_0xe096c5['model'];if(!_0x539a76['query']['hasOwnProperty'](_0x8ae8('0x4e'))){_0x5c069f[_0x8ae8('0x31')]=qs['limit'](_0x539a76[_0x8ae8('0x45')][_0x8ae8('0x31')]);_0x5c069f[_0x8ae8('0x2f')]=qs[_0x8ae8('0x2f')](_0x539a76[_0x8ae8('0x45')][_0x8ae8('0x2f')]);}_0x5c069f[_0x8ae8('0x4f')]=qs[_0x8ae8('0x50')](_0x539a76[_0x8ae8('0x45')][_0x8ae8('0x50')]);_0x5c069f['where']=qs[_0x8ae8('0x47')](_['pick'](_0x539a76[_0x8ae8('0x45')],_0xe096c5[_0x8ae8('0x47')]));_0x5c069f[_0x8ae8('0x51')][_0x8ae8('0x68')]=_0x22764a['id'];if(_0x539a76[_0x8ae8('0x45')][_0x8ae8('0x53')]){_0x5c069f['where']=_[_0x8ae8('0x54')](_0x5c069f[_0x8ae8('0x51')],{'$or':_[_0x8ae8('0x44')](_0x5c069f[_0x8ae8('0x49')],function(_0x120d64){var _0x3fc05a={};_0x3fc05a[_0x120d64]={'$like':'%'+_0x539a76[_0x8ae8('0x45')][_0x8ae8('0x53')]+'%'};return _0x3fc05a;})});}_0x5c069f=_[_0x8ae8('0x54')]({},_0x5c069f,_0x539a76[_0x8ae8('0x55')]);return db['CannedAnswer'][_0x8ae8('0x32')]({'where':_0x5c069f['where']})['then'](function(_0x5afca7){_0x4133fb[_0x8ae8('0x32')]=_0x5afca7;if(_0x539a76[_0x8ae8('0x45')][_0x8ae8('0x56')]){_0x5c069f[_0x8ae8('0x6e')]=[{'all':!![]}];}return db[_0x8ae8('0x6d')][_0x8ae8('0x57')](_0x5c069f);})['then'](function(_0x1a0949){_0x4133fb[_0x8ae8('0x58')]=_0x1a0949;return _0x4133fb;});}})[_0x8ae8('0x20')](respondWithFilteredResult(_0x581327,_0x5c069f))[_0x8ae8('0x2b')](handleError(_0x581327,null));};exports[_0x8ae8('0x6f')]=function(_0x39598b,_0x2c80e9,_0x499ebe){return db[_0x8ae8('0x3f')][_0x8ae8('0x5b')]({'where':{'id':_0x39598b[_0x8ae8('0x5a')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x2c80e9,null))[_0x8ae8('0x20')](function(_0x557774){if(_0x557774){return _0x557774[_0x8ae8('0x6f')](_0x39598b['query']['ids']);}})[_0x8ae8('0x20')](respondWithStatusCode(_0x2c80e9,null))[_0x8ae8('0x2b')](handleError(_0x2c80e9,null));};exports[_0x8ae8('0x70')]=function(_0x5048d3,_0xd02bca,_0x12e633){var _0x276fff={'channel':_0x8ae8('0x71')};var _0xd8e77d=[];var _0x2b71a9=[];var _0x4e09c4={};return db['SmsAccount'][_0x8ae8('0x5b')]({'where':{'id':_0x5048d3[_0x8ae8('0x5a')]['id']},'include':[{'model':db[_0x8ae8('0x72')],'as':_0x8ae8('0x73')}]})[_0x8ae8('0x20')](handleEntityNotFound(_0xd02bca,null))[_0x8ae8('0x20')](function(_0x16c935){_0x276fff[_0x8ae8('0x74')]=_0x16c935;_0x276fff[_0x8ae8('0x75')]=_[_0x8ae8('0x76')](_0x16c935[_0x8ae8('0x73')],[_0x8ae8('0x77')],[_0x8ae8('0x78')]);if(_0x276fff[_0x8ae8('0x74')]['Applications']){delete _0x276fff['account'][_0x8ae8('0x73')];}return db[_0x8ae8('0x79')][_0x8ae8('0x67')]();})[_0x8ae8('0x20')](function(_0x188a0a){if(!_0x188a0a){throw new db['Sequelize']['ValidationError'](_0x8ae8('0x7a'));}_0xd8e77d=_[_0x8ae8('0x7b')](_[_0x8ae8('0x46')](_0x188a0a),[_0x8ae8('0x7c'),_0x8ae8('0x7d')]);_0x2b71a9=_[_0x8ae8('0x7b')](_[_0x8ae8('0x46')](_0x188a0a),['createdAt',_0x8ae8('0x7d'),_0x8ae8('0x7e'),_0x8ae8('0x7f')]);_0x276fff[_0x8ae8('0x5d')]={'mapKey':_0x8ae8('0x80')};if(_0x276fff[_0x8ae8('0x74')][_0x8ae8('0x42')]){switch(_0x276fff[_0x8ae8('0x74')][_0x8ae8('0x42')]){case'twilio':_0x276fff['body'][_0x8ae8('0x81')]=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x82')];_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x5d')]=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x83')];_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x84')]=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x85')];break;case _0x8ae8('0x86'):_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x81')]='+'+_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x87')];_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x5d')]=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x88')];break;case'connectel':_0x276fff['body']['from']=_0x5048d3['body'][_0x8ae8('0x81')];_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x5d')]=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x29')];break;case _0x8ae8('0x89'):_0x276fff['body'][_0x8ae8('0x81')]=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x81')];_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x5d')]=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x5d')];_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x84')]=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x8a')];break;case'plivo':_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x81')]=_0x5048d3['body'][_0x8ae8('0x82')];_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x5d')]=_0x5048d3['body']['Text'];_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x84')]=_0x5048d3['body']['MessageUUID'];break;case _0x8ae8('0x8b'):_0x276fff['body'][_0x8ae8('0x81')]='+'+_0x5048d3[_0x8ae8('0x5d')]['results'][0x0][_0x8ae8('0x81')];_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x5d')]=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x8c')][0x0][_0x8ae8('0x88')];_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x84')]=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x8c')][0x0][_0x8ae8('0x84')];break;case _0x8ae8('0x8d'):_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x81')]=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x8e')];_0x276fff['body'][_0x8ae8('0x5d')]=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x8f')]['message'];break;case _0x8ae8('0x90'):_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x81')]=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x91')];_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x5d')]=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x88')];_0x276fff[_0x8ae8('0x5d')]['messageId']=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x92')];break;case _0x8ae8('0x93'):_0x276fff['body'][_0x8ae8('0x84')]=_0x5048d3[_0x8ae8('0x5d')][0x0][_0x8ae8('0x29')]['id'];_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x81')]=_0x5048d3[_0x8ae8('0x5d')][0x0]['message'][_0x8ae8('0x81')];_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x5d')]=_0x5048d3[_0x8ae8('0x5d')][0x0][_0x8ae8('0x29')][_0x8ae8('0x88')];break;case _0x8ae8('0x94'):_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x81')]=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x81')];_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x5d')]=_0x5048d3['body'][_0x8ae8('0x29')];_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x84')]=_0x5048d3[_0x8ae8('0x5d')][_0x8ae8('0x95')];break;}}if(_0x276fff[_0x8ae8('0x5d')]['id']){delete _0x276fff[_0x8ae8('0x5d')]['id'];}if(_['isNil'](_0x276fff['body']['from'])){throw new db[(_0x8ae8('0x96'))][(_0x8ae8('0x97'))](_0x8ae8('0x98'));}if(_[_0x8ae8('0x99')](_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x5d')])||_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x5d')]===''){throw new db[(_0x8ae8('0x96'))][(_0x8ae8('0x97'))](_0x8ae8('0x9a'));}if(_['isNil'](_0x276fff['body'][_0x8ae8('0x9b')])){throw new db['Sequelize'][(_0x8ae8('0x97'))](_0x8ae8('0x9c')+_0x2b71a9);}if(!_['includes'](_0x2b71a9,_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x9b')])){throw new db[(_0x8ae8('0x96'))][(_0x8ae8('0x97'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2b71a9);}_0x4e09c4[_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x9b')]]=_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x81')];return db[_0x8ae8('0x9d')][_0x8ae8('0x5b')]({'where':{'id':_0x276fff[_0x8ae8('0x74')][_0x8ae8('0x7f')]},'include':[{'model':db[_0x8ae8('0x79')],'as':'Contacts','where':_0x4e09c4,'limit':0x1,'order':[['updatedAt',_0x8ae8('0x9e')]]}]});})[_0x8ae8('0x20')](handleEntityNotFound(_0xd02bca,null))[_0x8ae8('0x20')](function(_0x2fd1db){if(_0x2fd1db){_0x276fff[_0x8ae8('0x9f')]=_[_0x8ae8('0xa0')](_0x2fd1db,[_0x8ae8('0xa1')]);if(_0x2fd1db[_0x8ae8('0xa1')]['length']){return _0x2fd1db[_0x8ae8('0xa1')][0x0];}var _0x491b30=_[_0x8ae8('0x1a')](_0x276fff[_0x8ae8('0x5d')],{'firstName':_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x81')],'ListId':_0x2fd1db['id']});_0x491b30[_0x276fff['body'][_0x8ae8('0x9b')]]=_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x81')];return db[_0x8ae8('0x79')]['create'](_0x491b30,{'fields':_0xd8e77d,'raw':!![]});}})[_0x8ae8('0x20')](handleEntityNotFound(_0xd02bca,null))[_0x8ae8('0x20')](function(_0x1d992b){if(_0x1d992b){_0x276fff[_0x8ae8('0xa2')]=_0x1d992b;var _0x2c59d0={'ContactId':_0x1d992b['id'],'phone':_0x276fff[_0x8ae8('0x5d')]['from'],'SmsAccountId':_0x5048d3[_0x8ae8('0x5a')]['id']};var _0x1f5c2c={'ContactId':_0x1d992b['id'],'SmsAccountId':_0x5048d3[_0x8ae8('0x5a')]['id'],'closed':![]};return db[_0x8ae8('0xa3')][_0x8ae8('0x5b')]({'where':_0x1f5c2c})['then'](function(_0x3cc0f4){if(_0x3cc0f4){return[_0x3cc0f4,![]];}return db[_0x8ae8('0xa3')][_0x8ae8('0x5c')](_0x2c59d0)[_0x8ae8('0x20')](function(_0x560e05){return[_0x560e05,!![]];});});}})[_0x8ae8('0xa4')](function(_0x37b1a2,_0x2f14c0){_0x276fff[_0x8ae8('0xa5')]=_0x37b1a2['get']({'plain':!![]});_0x276fff[_0x8ae8('0xa5')]['created']=![];if(_0x2f14c0){if(_0x276fff[_0x8ae8('0x74')][_0x8ae8('0xa6')]){_0x276fff[_0x8ae8('0x75')]['push']({'id':0x0,'priority':_0x276fff['applications'][_0x8ae8('0x4c')]+0x1,'app':_0x8ae8('0xa7'),'appdata':_0x8ae8('0xa8'),'interval':'*,*,*,*'});}_0x276fff[_0x8ae8('0xa5')]['created']=!![];}return db['SmsMessage'][_0x8ae8('0x5c')]({'phone':_0x276fff['body']['from'],'messageId':_0x276fff[_0x8ae8('0x5d')][_0x8ae8('0x84')],'body':_0x276fff['body'][_0x8ae8('0x5d')],'SmsAccountId':_0x5048d3[_0x8ae8('0x5a')]['id'],'SmsInteractionId':_0x37b1a2['id'],'direction':'in','ContactId':_0x37b1a2['ContactId'],'AttachmentId':_0x276fff['body']['AttachmentId']});})['then'](function(_0x53edeb){_0x276fff['message']=_0x53edeb;if(!_0x276fff[_0x8ae8('0xa5')]['UserId'])return;return db[_0x8ae8('0xa9')]['find']({'attributes':['id',_0x8ae8('0x3b')],'where':{'id':_0x276fff[_0x8ae8('0xa5')][_0x8ae8('0xaa')]}});})['then'](function(_0x58690e){if(_0x58690e){_0x276fff[_0x8ae8('0x75')]['unshift']({'id':0x0,'priority':0x0,'app':_0x8ae8('0xab'),'appdata':_0x58690e[_0x8ae8('0x3b')]+','+(_0x276fff[_0x8ae8('0x74')][_0x8ae8('0xac')]||0xa),'interval':'*,*,*,*'});}if(!_0x276fff[_0x8ae8('0xa5')][_0x8ae8('0xad')])return;return db[_0x8ae8('0xae')][_0x8ae8('0x5b')]({'attributes':['id',_0x8ae8('0x3b')],'where':{'id':_0x276fff[_0x8ae8('0xa5')][_0x8ae8('0xad')]}});})[_0x8ae8('0x20')](function(_0x4c07f3){if(_0x4c07f3){_0x276fff['applications']['unshift']({'id':0x0,'priority':0x1,'app':_0x8ae8('0xaf'),'appdata':_0x4c07f3[_0x8ae8('0x3b')]+','+(_0x276fff['account'][_0x8ae8('0xb0')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x8ae8('0xb1'),_0x276fff);})[_0x8ae8('0x20')](function(_0x33d4b1){if(_0x33d4b1){var _0x5c9da8=0xc8;var _0x57f206='receiveMessage';logger[_0x8ae8('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x57f206,_0x5c9da8,_0x8ae8('0xb2'));logger['debug'](_0x8ae8('0xb3'),_0x57f206,_0x5c9da8,_0x8ae8('0xb2'),JSON[_0x8ae8('0x26')](_0x33d4b1));if(_0x276fff[_0x8ae8('0x74')][_0x8ae8('0x42')]===_0x8ae8('0xb4')){return _0xd02bca[_0x8ae8('0x2d')](_0x5c9da8)[_0x8ae8('0x33')](_0x8ae8('0xb5'),_0x8ae8('0xb6'))[_0x8ae8('0x3c')](_0x8ae8('0xb7'));}else{return _0xd02bca[_0x8ae8('0x2d')](_0x5c9da8)['json'](_0x33d4b1);}}})[_0x8ae8('0x2b')](handleError(_0xd02bca,null));};exports[_0x8ae8('0xb8')]=function(_0x4f32bd,_0x517752){var _0x7a625f=_0x4f32bd[_0x8ae8('0x5a')]['id'];var _0x46f109=_0x4f32bd[_0x8ae8('0x5d')];var _0x127d88=0xc8;var _0x55197f=null;return db[_0x8ae8('0xb9')]['transaction']({'isolationLevel':db[_0x8ae8('0xb9')][_0x8ae8('0xba')][_0x8ae8('0xbb')]['READ_COMMITTED']},function(_0x10063f){return db[_0x8ae8('0x3f')]['findOne']({'where':{'id':_0x7a625f},'transaction':_0x10063f})[_0x8ae8('0x20')](function(_0x53846e){if(_0x53846e){return db['SmsApplication'][_0x8ae8('0x37')]({'where':{'SmsAccountId':_0x7a625f},'transaction':_0x10063f})[_0x8ae8('0x20')](function(){var _0x83d5d6=_[_0x8ae8('0x44')](_0x46f109,function(_0x513f88){_0x513f88[_0x8ae8('0x68')]=_0x7a625f;return _0x513f88;});return db[_0x8ae8('0x72')][_0x8ae8('0xbc')](_0x83d5d6,{'transaction':_0x10063f});});}else{_0x127d88=0x194;_0x55197f=[];}});})['then'](function(){if(_0x127d88!==0x194){return db['SmsApplication'][_0x8ae8('0xbd')]({'where':{'SmsAccountId':_0x7a625f},'order':'priority'})[_0x8ae8('0x20')](function(_0xc916de){_0x55197f=_0xc916de;});}})[_0x8ae8('0x2b')](function(_0xeb9f2f){_0x127d88=0x1f4;logger[_0x8ae8('0x27')](_0xeb9f2f[_0x8ae8('0x3a')]);if(_0xeb9f2f['name']){delete _0xeb9f2f[_0x8ae8('0x3b')];}_0x55197f=_0xeb9f2f;})[_0x8ae8('0xbe')](function(){if(_0x55197f===null){_0x517752['sendStatus'](_0x127d88);}else{if(_0x127d88===0x1f4){_0x517752['status'](_0x127d88)[_0x8ae8('0x3c')](_0x55197f);}else{_0x517752['status'](_0x127d88)[_0x8ae8('0x2e')](_0x55197f);}}});};exports[_0x8ae8('0xbf')]=function(_0x39f98e,_0x3e2648,_0x5b806c){var _0x2353ed={};var _0x3edde5={};var _0x438263;var _0x2a4509;return db[_0x8ae8('0x3f')]['findOne']({'where':{'id':_0x39f98e[_0x8ae8('0x5a')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x3e2648,null))[_0x8ae8('0x20')](function(_0x55cd1b){if(_0x55cd1b){_0x438263=_0x55cd1b;_0x3edde5[_0x8ae8('0x48')]=_[_0x8ae8('0x46')](db['SmsApplication'][_0x8ae8('0x40')]);_0x3edde5['query']=_['keys'](_0x39f98e[_0x8ae8('0x45')]);_0x3edde5[_0x8ae8('0x47')]=_[_0x8ae8('0x4a')](_0x3edde5[_0x8ae8('0x48')],_0x3edde5[_0x8ae8('0x45')]);_0x2353ed[_0x8ae8('0x49')]=_[_0x8ae8('0x4a')](_0x3edde5[_0x8ae8('0x48')],qs[_0x8ae8('0x4b')](_0x39f98e[_0x8ae8('0x45')][_0x8ae8('0x4b')]));_0x2353ed[_0x8ae8('0x49')]=_0x2353ed['attributes'][_0x8ae8('0x4c')]?_0x2353ed[_0x8ae8('0x49')]:_0x3edde5[_0x8ae8('0x48')];_0x2353ed['order']=qs[_0x8ae8('0x50')](_0x39f98e['query'][_0x8ae8('0x50')]);_0x2353ed[_0x8ae8('0x51')]=qs[_0x8ae8('0x47')](_[_0x8ae8('0x52')](_0x39f98e[_0x8ae8('0x45')],_0x3edde5[_0x8ae8('0x47')]));if(_0x39f98e[_0x8ae8('0x45')]['filter']){_0x2353ed[_0x8ae8('0x51')]=_['merge'](_0x2353ed[_0x8ae8('0x51')],{'$or':_[_0x8ae8('0x44')](_0x2353ed[_0x8ae8('0x49')],function(_0xb4cfa){var _0x30f7df={};_0x30f7df[_0xb4cfa]={'$like':'%'+_0x39f98e['query'][_0x8ae8('0x53')]+'%'};return _0x30f7df;})});}_0x2353ed=_[_0x8ae8('0x54')]({},_0x2353ed,_0x39f98e[_0x8ae8('0x55')]);return _0x438263[_0x8ae8('0xbf')](_0x2353ed);}})['then'](function(_0x250b46){if(_0x250b46){_0x2a4509=_0x250b46['length'];if(!_0x39f98e['query'][_0x8ae8('0x4d')](_0x8ae8('0x4e'))){_0x2353ed[_0x8ae8('0x31')]=qs[_0x8ae8('0x31')](_0x39f98e[_0x8ae8('0x45')]['limit']);_0x2353ed['offset']=qs[_0x8ae8('0x2f')](_0x39f98e['query'][_0x8ae8('0x2f')]);}return _0x438263['getApplications'](_0x2353ed);}})[_0x8ae8('0x20')](function(_0xd77c08){if(_0xd77c08){return _0xd77c08?{'count':_0x2a4509,'rows':_0xd77c08}:null;}})[_0x8ae8('0x20')](respondWithResult(_0x3e2648,null))['catch'](handleError(_0x3e2648,null));};exports[_0x8ae8('0xc0')]=function(_0x32e095,_0x834375,_0xa087a9){var _0x15544d={'raw':![],'where':{}};var _0xd54a31={};var _0x1f2079={'count':0x0,'rows':[]};return db[_0x8ae8('0x3f')][_0x8ae8('0x6a')]({'where':{'id':_0x32e095[_0x8ae8('0x5a')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x834375,null))[_0x8ae8('0x20')](function(_0x3e7074){if(_0x3e7074){_0xd54a31[_0x8ae8('0x48')]=_[_0x8ae8('0x46')](db[_0x8ae8('0xa3')][_0x8ae8('0x40')]);_0xd54a31[_0x8ae8('0x45')]=_[_0x8ae8('0x46')](_0x32e095[_0x8ae8('0x45')]);_0xd54a31['filters']=_[_0x8ae8('0x4a')](_0xd54a31[_0x8ae8('0x48')],_0xd54a31['query']);_0x15544d['attributes']=_[_0x8ae8('0x4a')](_0xd54a31[_0x8ae8('0x48')],qs[_0x8ae8('0x4b')](_0x32e095[_0x8ae8('0x45')]['fields']));_0x15544d[_0x8ae8('0x49')]=_0x15544d[_0x8ae8('0x49')][_0x8ae8('0x4c')]?_0x15544d[_0x8ae8('0x49')]:_0xd54a31[_0x8ae8('0x48')];if(!_0x32e095[_0x8ae8('0x45')][_0x8ae8('0x4d')]('nolimit')){_0x15544d['limit']=qs[_0x8ae8('0x31')](_0x32e095[_0x8ae8('0x45')][_0x8ae8('0x31')]);_0x15544d[_0x8ae8('0x2f')]=qs[_0x8ae8('0x2f')](_0x32e095[_0x8ae8('0x45')][_0x8ae8('0x2f')]);}_0x15544d[_0x8ae8('0x4f')]=qs['sort'](_0x32e095[_0x8ae8('0x45')][_0x8ae8('0x50')]);_0x15544d[_0x8ae8('0x51')]=qs[_0x8ae8('0x47')](_[_0x8ae8('0x52')](_0x32e095['query'],_0xd54a31[_0x8ae8('0x47')]));_0x15544d[_0x8ae8('0x51')][_0x8ae8('0x68')]=_0x3e7074['id'];if(_0x32e095[_0x8ae8('0x45')][_0x8ae8('0x53')]){_0x15544d[_0x8ae8('0x51')]=_['merge'](_0x15544d[_0x8ae8('0x51')],{'$or':_['map'](_0x15544d[_0x8ae8('0x49')],function(_0x2014a4){var _0x49b3fe={};_0x49b3fe[_0x2014a4]={'$like':'%'+_0x32e095[_0x8ae8('0x45')][_0x8ae8('0x53')]+'%'};return _0x49b3fe;})});}_0x15544d=_[_0x8ae8('0x54')]({},_0x15544d,_0x32e095[_0x8ae8('0x55')]);return db[_0x8ae8('0xa3')]['count']({'where':_0x15544d[_0x8ae8('0x51')]})[_0x8ae8('0x20')](function(_0x25e9fa){_0x1f2079[_0x8ae8('0x32')]=_0x25e9fa;if(_0x32e095[_0x8ae8('0x45')]['includeAll']){_0x15544d[_0x8ae8('0x6e')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x8ae8('0xa9')],'as':'Owner','attributes':[_0x8ae8('0x3b'),_0x8ae8('0xc1'),_0x8ae8('0xc2')],'required':![]},{'model':db[_0x8ae8('0xc3')],'as':_0x8ae8('0xc4'),'attributes':['id',_0x8ae8('0x3b'),_0x8ae8('0xc5')],'where':_0x32e095[_0x8ae8('0x45')][_0x8ae8('0xc6')]?{'id':_0x32e095[_0x8ae8('0x45')][_0x8ae8('0xc6')]}:undefined,'required':_0x32e095[_0x8ae8('0x45')][_0x8ae8('0xc6')]?!![]:![]}];}return db[_0x8ae8('0xa3')]['findAll'](_0x15544d);})[_0x8ae8('0x20')](function(_0x40e95f){_0x1f2079[_0x8ae8('0x58')]=_0x40e95f;return _0x1f2079;});}})[_0x8ae8('0x20')](respondWithFilteredResult(_0x834375,_0x15544d))['catch'](handleError(_0x834375,null));};exports[_0x8ae8('0x3c')]=function(_0x1aae2c,_0x5298e3,_0x41d698){var _0x33d3d0,_0x1b4423,_0x1d44e0;if(_[_0x8ae8('0x99')](_0x1aae2c[_0x8ae8('0x5d')][_0x8ae8('0x5d')])||_0x1aae2c[_0x8ae8('0x5d')][_0x8ae8('0x5d')]===''){throw new db[(_0x8ae8('0x96'))][(_0x8ae8('0x97'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1aae2c[_0x8ae8('0x5d')]['to'])){throw new db[(_0x8ae8('0x96'))][(_0x8ae8('0x97'))]('to\x20is\x20mandatory');}_0x33d3d0=_0x1aae2c['body']['to'];return db['SmsAccount'][_0x8ae8('0x5b')]({'where':{'id':_0x1aae2c[_0x8ae8('0x5a')]['id']},'include':[{'model':db[_0x8ae8('0x9d')],'as':_0x8ae8('0xc7'),'include':[{'model':db[_0x8ae8('0x79')],'as':'Contacts','where':{'mobile':_0x33d3d0},'limit':0x1,'order':[['updatedAt',_0x8ae8('0x9e')]]}]}]})[_0x8ae8('0x20')](handleEntityNotFound(_0x5298e3,null))[_0x8ae8('0x20')](function(_0x388ea2){if(_0x388ea2&&_0x388ea2[_0x8ae8('0xc7')]){_0x1b4423=_0x388ea2[_0x8ae8('0x38')]({'plain':!![]});if(_0x1b4423[_0x8ae8('0xc7')]&&_0x1b4423[_0x8ae8('0xc7')][_0x8ae8('0xa1')][_0x8ae8('0x4c')]){return _0x1b4423[_0x8ae8('0xc7')]['Contacts'][0x0];}return db[_0x8ae8('0x79')][_0x8ae8('0x5c')](_[_0x8ae8('0x1a')](_0x1aae2c['body'],{'firstName':_0x33d3d0,'mobile':_0x33d3d0,'phone':_0x33d3d0,'ListId':_0x1b4423[_0x8ae8('0x7f')]}));}})[_0x8ae8('0x20')](handleEntityNotFound(_0x5298e3,null))[_0x8ae8('0x20')](function(_0x1c96d7){if(_0x1c96d7){_0x1d44e0=_0x1c96d7;return db[_0x8ae8('0xa3')][_0x8ae8('0x5b')]({'where':{'ContactId':_0x1d44e0['id'],'closed':![],'SmsAccountId':_0x1b4423['id']}})[_0x8ae8('0x20')](function(_0x5ba3ca){if(_0x5ba3ca){return[_0x5ba3ca,![]];}return db[_0x8ae8('0xa3')][_0x8ae8('0x5c')]({'UserId':_0x1aae2c['user']['id'],'ContactId':_0x1d44e0['id'],'SmsAccountId':_0x1b4423['id'],'phone':_0x33d3d0,'firstMsgDirection':'out','Messages':[_['merge'](_0x1aae2c['body'],{'read':![],'body':_0x1aae2c[_0x8ae8('0x5d')]['body'],'phone':_0x33d3d0,'SmsAccountId':_0x1b4423['id'],'UserId':_0x1aae2c['user']['id'],'ContactId':_0x1d44e0['id']})]},{'include':[{'model':db[_0x8ae8('0xc8')],'as':_0x8ae8('0xc9')}]})[_0x8ae8('0x20')](function(_0x13480f){return[_0x13480f,!![]];});});}})['spread'](function(_0x2d641c,_0x515f7d){if(_0x515f7d){return _0x2d641c;}return db['SmsMessage'][_0x8ae8('0x5c')](_[_0x8ae8('0x54')](_0x1aae2c[_0x8ae8('0x5d')],{'read':![],'body':_0x1aae2c[_0x8ae8('0x5d')][_0x8ae8('0x5d')],'phone':_0x33d3d0,'SmsAccountId':_0x1b4423['id'],'SmsInteractionId':_0x2d641c['id'],'UserId':_0x1aae2c['user']['id'],'ContactId':_0x1d44e0['id']}))[_0x8ae8('0x20')](function(_0x2105d3){_0x2d641c['dataValues'][_0x8ae8('0xc9')]=[];_0x2d641c['dataValues']['Messages']['push'](_0x2105d3[_0x8ae8('0xca')]);return _0x2d641c;});})[_0x8ae8('0x20')](respondWithResult(_0x5298e3,null))[_0x8ae8('0x2b')](handleError(_0x5298e3,null));};exports[_0x8ae8('0x2d')]=function(_0x293fad,_0x1fdc12,_0x403624){if(_0x293fad[_0x8ae8('0x5d')]['id']){delete _0x293fad[_0x8ae8('0x5d')]['id'];}var _0x14818a,_0x165e71,_0x494c36;return db[_0x8ae8('0x3f')][_0x8ae8('0x5b')]({'where':{'id':_0x293fad[_0x8ae8('0x5a')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x1fdc12,null))[_0x8ae8('0x20')](function(_0x1652d6){if(_0x1652d6){_0x494c36=_0x1652d6;logger[_0x8ae8('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8ae8('0x2d'),'received\x20delivery\x20report\x20from',_0x1652d6[_0x8ae8('0x42')],util['inspect'](_0x293fad['body'],{'showHidden':![],'depth':null}));switch(_0x1652d6[_0x8ae8('0x42')]){case _0x8ae8('0x86'):if(_0x293fad['body'][_0x8ae8('0xcb')]&&_0x293fad[_0x8ae8('0x5d')][_0x8ae8('0x2d')]){_0x165e71=_0x293fad[_0x8ae8('0x5d')][_0x8ae8('0x2d')];return db[_0x8ae8('0xc8')][_0x8ae8('0x5b')]({'where':{'messageId':_0x293fad[_0x8ae8('0x5d')][_0x8ae8('0xcb')]}});}break;case'connectel':if(_0x293fad[_0x8ae8('0x5d')][_0x8ae8('0xcc')]&&_0x293fad['body'][_0x8ae8('0xcd')]){_0x165e71=_0x293fad['body'][_0x8ae8('0xcd')];return db[_0x8ae8('0xc8')][_0x8ae8('0x5b')]({'where':{'messageId':_0x293fad[_0x8ae8('0x5d')][_0x8ae8('0xcc')]}});}break;case _0x8ae8('0x89'):if(_0x293fad[_0x8ae8('0x5d')][_0x8ae8('0x8a')]&&_0x293fad[_0x8ae8('0x5d')][_0x8ae8('0xce')]){_0x165e71=_0x293fad[_0x8ae8('0x5d')][_0x8ae8('0xce')];return db['SmsMessage']['find']({'where':{'messageId':_0x293fad[_0x8ae8('0x5d')]['message_id']}});}break;case _0x8ae8('0x8b'):var _0x10dcba=_0x293fad['body'][_0x8ae8('0x8c')][0x0];if(_0x10dcba[_0x8ae8('0x84')]&&_0x10dcba['status']['groupName']===_0x8ae8('0xcf')){_0x165e71=_0x10dcba['status'][_0x8ae8('0xd0')];return db['SmsMessage'][_0x8ae8('0x5b')]({'where':{'messageId':_0x10dcba[_0x8ae8('0x84')]}});}break;case _0x8ae8('0x90'):if(_0x293fad[_0x8ae8('0x5d')]['messageId']&&_0x293fad[_0x8ae8('0x5d')][_0x8ae8('0x2d')]){_0x165e71=_0x293fad[_0x8ae8('0x5d')][_0x8ae8('0x2d')];return db['SmsMessage'][_0x8ae8('0x5b')]({'where':{'messageId':_0x293fad[_0x8ae8('0x5d')][_0x8ae8('0x84')]}});}break;case'bandwidth':if(_0x293fad[_0x8ae8('0x5d')][0x0]['message']['id']){_0x165e71=_0x293fad['body'][0x0]['type'];return db[_0x8ae8('0xc8')][_0x8ae8('0x5b')]({'where':{'messageId':_0x293fad[_0x8ae8('0x5d')][0x0][_0x8ae8('0x29')]['id']}});}break;case _0x8ae8('0x94'):if(_0x293fad[_0x8ae8('0x5d')][_0x8ae8('0xd1')]&&_0x293fad[_0x8ae8('0x5d')][_0x8ae8('0x2d')]){_0x165e71=_0x293fad[_0x8ae8('0x5d')][_0x8ae8('0x2d')];return db[_0x8ae8('0xc8')][_0x8ae8('0x5b')]({'where':{'messageId':_0x293fad[_0x8ae8('0x5d')]['redif']}});}break;}}})[_0x8ae8('0x20')](handleEntityNotFound(_0x1fdc12,null))[_0x8ae8('0x20')](function(_0x19c509){if(_0x19c509){_0x14818a=_0x19c509;switch(_0x494c36[_0x8ae8('0x42')]){case _0x8ae8('0x86'):if(_0x165e71===_0x8ae8('0xcf')){return _0x14818a['update']({'read':!![]});}else{logger[_0x8ae8('0x27')](_0x8ae8('0x25'),_0x8ae8('0x2d'),'skebby',util['inspect'](_0x293fad['body'],{'showHidden':![],'depth':null}));}break;case _0x8ae8('0xd2'):if(_0x165e71==='1'){return _0x14818a['update']({'read':!![]});}else{logger[_0x8ae8('0x27')](_0x8ae8('0x25'),_0x8ae8('0x2d'),'skebby',util[_0x8ae8('0xd3')](_0x293fad[_0x8ae8('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x8ae8('0x89'):if(!_0x293fad['body'][_0x8ae8('0xd4')]&&_0x165e71>=0xc8&&_0x165e71<=0xce){return _0x14818a[_0x8ae8('0x65')]({'read':!![]});}else{logger[_0x8ae8('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8ae8('0x2d'),_0x8ae8('0x89'),util[_0x8ae8('0xd3')](_0x293fad[_0x8ae8('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x8ae8('0x8b'):var _0x410f95=_0x293fad[_0x8ae8('0x5d')]['results'][0x0];if(_0x410f95[_0x8ae8('0x2d')]['groupName']===_0x8ae8('0xcf')){return _0x14818a[_0x8ae8('0x65')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8ae8('0x2d'),_0x8ae8('0x8b'),util[_0x8ae8('0xd3')](_0x293fad[_0x8ae8('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x8ae8('0x90'):if(_0x165e71==_0x8ae8('0xd5')||_0x165e71==_0x8ae8('0xd6')){return _0x14818a[_0x8ae8('0x65')]({'read':!![]});}else{logger[_0x8ae8('0x27')](_0x8ae8('0x25'),_0x8ae8('0x2d'),_0x8ae8('0x90'),util['inspect'](_0x293fad[_0x8ae8('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x8ae8('0x93'):if(_0x165e71=='message-delivered'){return _0x14818a[_0x8ae8('0x65')]({'read':!![]});}else{logger[_0x8ae8('0x27')](_0x8ae8('0x25'),'status','bandwidth',util[_0x8ae8('0xd3')](_0x293fad['body'],{'showHidden':![],'depth':null}));}break;case _0x8ae8('0x94'):if(_0x165e71===_0x8ae8('0xd7')||_0x165e71===_0x8ae8('0xd8')){return _0x14818a[_0x8ae8('0x65')]({'read':!![]});}else{logger[_0x8ae8('0x27')](_0x8ae8('0x25'),'status',_0x8ae8('0x94'),util[_0x8ae8('0xd3')](_0x293fad['body'],{'showHidden':![],'depth':null}));}break;}return _0x14818a;}})[_0x8ae8('0x20')](respondWithResult(_0x1fdc12,null))[_0x8ae8('0x2b')](handleError(_0x1fdc12,null));};exports[_0x8ae8('0xd9')]=function(_0x264e82,_0x50ccf1,_0x1a2bfb){var _0x4c78d7,_0x4f040d,_0x3a9e33;return db[_0x8ae8('0x3f')][_0x8ae8('0x5b')]({'where':{'id':_0x264e82[_0x8ae8('0x5a')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x50ccf1,null))['then'](function(_0x463aa8){if(_0x463aa8){_0x3a9e33=_0x463aa8;logger[_0x8ae8('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x8ae8('0xda'),_0x463aa8['type'],util[_0x8ae8('0xd3')](_0x264e82['query'],{'showHidden':![],'depth':null}));switch(_0x463aa8['type']){case _0x8ae8('0x8d'):if(_0x264e82[_0x8ae8('0x45')]['message-id']&&_0x264e82['query']['state']){_0x4f040d=_0x264e82[_0x8ae8('0x45')][_0x8ae8('0xdb')];return db[_0x8ae8('0xc8')][_0x8ae8('0x5b')]({'where':{'messageId':_0x264e82['query'][_0x8ae8('0xdc')]}});}break;}}})['then'](handleEntityNotFound(_0x50ccf1,null))[_0x8ae8('0x20')](function(_0x2c854e){if(_0x2c854e){_0x4c78d7=_0x2c854e;switch(_0x3a9e33[_0x8ae8('0x42')]){case'csc':if(_0x4f040d==='2'||_0x4f040d==='6'){return _0x4c78d7[_0x8ae8('0x65')]({'read':!![]});}else{logger['error'](_0x8ae8('0x25'),_0x8ae8('0x2d'),_0x8ae8('0x8d'),util[_0x8ae8('0xd3')](_0x264e82[_0x8ae8('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x4c78d7;}})[_0x8ae8('0x20')](respondWithResult(_0x50ccf1,null))[_0x8ae8('0x2b')](handleError(_0x50ccf1,null));};exports[_0x8ae8('0xdd')]=function(_0x487e20,_0x15bf39,_0x40be42){return db[_0x8ae8('0x3f')][_0x8ae8('0x5b')]({'where':{'id':_0x487e20[_0x8ae8('0x5a')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x15bf39,null))[_0x8ae8('0x20')](function(_0x1201dd){if(_0x1201dd){return _0x1201dd[_0x8ae8('0xdd')](_0x487e20[_0x8ae8('0x5d')]['ids'],_[_0x8ae8('0xa0')](_0x487e20['body'],[_0x8ae8('0xde'),'id'])||{})[_0x8ae8('0xa4')](function(_0x2c0b50){for(var _0xc46c9a=0x0;_0xc46c9a<_0x487e20[_0x8ae8('0x5d')][_0x8ae8('0xde')][_0x8ae8('0x4c')];_0xc46c9a+=0x1){socket[_0x8ae8('0xdf')](_0x8ae8('0xe0'),{'UserId':Number(_0x487e20[_0x8ae8('0x5d')][_0x8ae8('0xde')][_0xc46c9a]),'SmsAccountId':Number(_0x487e20[_0x8ae8('0x5a')]['id'])});}return _0x2c0b50;});}})[_0x8ae8('0x20')](respondWithResult(_0x15bf39,null))[_0x8ae8('0x2b')](handleError(_0x15bf39,null));};exports[_0x8ae8('0xe1')]=function(_0x2bcb17,_0x33ffbc,_0x156c90){return db[_0x8ae8('0x3f')]['find']({'where':{'id':_0x2bcb17[_0x8ae8('0x5a')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x33ffbc,null))['then'](function(_0x538f25){if(_0x538f25){return _0x538f25[_0x8ae8('0xe1')](_0x2bcb17[_0x8ae8('0x45')][_0x8ae8('0xde')])[_0x8ae8('0x20')](function(){if(_[_0x8ae8('0xe2')](_0x2bcb17[_0x8ae8('0x45')][_0x8ae8('0xde')])){for(var _0x4fd3f9=0x0;_0x4fd3f9<_0x2bcb17[_0x8ae8('0x45')]['ids'][_0x8ae8('0x4c')];_0x4fd3f9+=0x1){socket[_0x8ae8('0xdf')](_0x8ae8('0xe3'),{'UserId':Number(_0x2bcb17[_0x8ae8('0x45')][_0x8ae8('0xde')][_0x4fd3f9]),'SmsAccountId':Number(_0x2bcb17['params']['id'])});}}else{socket[_0x8ae8('0xdf')](_0x8ae8('0xe3'),{'UserId':Number(_0x2bcb17[_0x8ae8('0x45')][_0x8ae8('0xde')]),'SmsAccountId':Number(_0x2bcb17['params']['id'])});}});}})[_0x8ae8('0x20')](respondWithStatusCode(_0x33ffbc,null))[_0x8ae8('0x2b')](handleError(_0x33ffbc,null));};exports['getAgents']=function(_0x7eb530,_0x11a9e0,_0x1888b3){var _0x3578c3={};var _0x47110a={};var _0x4ac4cf;var _0x24e611;return db['SmsAccount'][_0x8ae8('0x6a')]({'where':{'id':_0x7eb530[_0x8ae8('0x5a')]['id']}})[_0x8ae8('0x20')](handleEntityNotFound(_0x11a9e0,null))[_0x8ae8('0x20')](function(_0x26bd74){if(_0x26bd74){_0x4ac4cf=_0x26bd74;_0x47110a[_0x8ae8('0x48')]=_[_0x8ae8('0x46')](db[_0x8ae8('0xa9')][_0x8ae8('0x40')]);_0x47110a[_0x8ae8('0x45')]=_[_0x8ae8('0x46')](_0x7eb530[_0x8ae8('0x45')]);_0x47110a[_0x8ae8('0x47')]=_[_0x8ae8('0x4a')](_0x47110a[_0x8ae8('0x48')],_0x47110a[_0x8ae8('0x45')]);_0x3578c3['attributes']=_[_0x8ae8('0x4a')](_0x47110a[_0x8ae8('0x48')],qs[_0x8ae8('0x4b')](_0x7eb530['query'][_0x8ae8('0x4b')]));_0x3578c3[_0x8ae8('0x49')]=_0x3578c3[_0x8ae8('0x49')][_0x8ae8('0x4c')]?_0x3578c3['attributes']:_0x47110a['model'];_0x3578c3[_0x8ae8('0x4f')]=qs['sort'](_0x7eb530[_0x8ae8('0x45')]['sort']);_0x3578c3['where']=qs[_0x8ae8('0x47')](_[_0x8ae8('0x52')](_0x7eb530[_0x8ae8('0x45')],_0x47110a[_0x8ae8('0x47')]));if(_0x7eb530[_0x8ae8('0x45')][_0x8ae8('0x53')]){_0x3578c3[_0x8ae8('0x51')]=_[_0x8ae8('0x54')](_0x3578c3['where'],{'$or':_['map'](_0x3578c3[_0x8ae8('0x49')],function(_0x480384){var _0x5d23cc={};_0x5d23cc[_0x480384]={'$like':'%'+_0x7eb530[_0x8ae8('0x45')]['filter']+'%'};return _0x5d23cc;})});}_0x3578c3=_[_0x8ae8('0x54')]({},_0x3578c3,_0x7eb530['options']);return _0x4ac4cf[_0x8ae8('0xe4')](_0x3578c3);}})['then'](function(_0x1826f2){if(_0x1826f2){_0x24e611=_0x1826f2[_0x8ae8('0x4c')];if(!_0x7eb530['query'][_0x8ae8('0x4d')]('nolimit')){_0x3578c3['limit']=qs[_0x8ae8('0x31')](_0x7eb530[_0x8ae8('0x45')]['limit']);_0x3578c3[_0x8ae8('0x2f')]=qs[_0x8ae8('0x2f')](_0x7eb530[_0x8ae8('0x45')][_0x8ae8('0x2f')]);}return _0x4ac4cf[_0x8ae8('0xe4')](_0x3578c3);}})[_0x8ae8('0x20')](function(_0x430cd2){if(_0x430cd2){return _0x430cd2?{'count':_0x24e611,'rows':_0x430cd2}:null;}})[_0x8ae8('0x20')](respondWithResult(_0x11a9e0,null))[_0x8ae8('0x2b')](handleError(_0x11a9e0,null));}; \ No newline at end of file +var _0x0ed5=['MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','bandwidth','intelepeer','isNil','ValidationError','from\x20is\x20mandatory','mapKey','DESC','list','Contacts','contact','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','queueId','SmsQueue','queue','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','finally','getApplications','fullname','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','out','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','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','../../config/logger','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','update','destroy','UserProfileResource','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','SmsAccounts','find','userProfileId','autoAssociation','params','describe','addDisposition','Disposition','getDispositions','findOne','order','SmsAccountId','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','Body','messageId','MessageSid','skebby','sender','text','connectel','from','clicksend','message_id','plivo','From','Text'];(function(_0x338061,_0x199894){var _0x2171fd=function(_0x54e337){while(--_0x54e337){_0x338061['push'](_0x338061['shift']());}};_0x2171fd(++_0x199894);}(_0x0ed5,0x138));var _0x50ed=function(_0x2ce4bd,_0x490b3d){_0x2ce4bd=_0x2ce4bd-0x0;var _0x141ebc=_0x0ed5[_0x2ce4bd];return _0x141ebc;};'use strict';var emlformat=require(_0x50ed('0x0'));var rimraf=require(_0x50ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50ed('0x2'));var rp=require(_0x50ed('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x50ed('0x4'));var util=require(_0x50ed('0x5'));var path=require(_0x50ed('0x6'));var sox=require(_0x50ed('0x7'));var csv=require(_0x50ed('0x8'));var ejs=require(_0x50ed('0x9'));var fs=require('fs');var fs_extra=require(_0x50ed('0xa'));var _=require(_0x50ed('0xb'));var squel=require(_0x50ed('0xc'));var crypto=require(_0x50ed('0xd'));var jsforce=require(_0x50ed('0xe'));var deskjs=require(_0x50ed('0xf'));var toCsv=require(_0x50ed('0x8'));var querystring=require(_0x50ed('0x10'));var Papa=require(_0x50ed('0x11'));var Redis=require('ioredis');var authService=require(_0x50ed('0x12'));var qs=require(_0x50ed('0x13'));var as=require(_0x50ed('0x14'));var hardwareService=require(_0x50ed('0x15'));var logger=require(_0x50ed('0x16'))(_0x50ed('0x17'));var utils=require(_0x50ed('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x50ed('0x19')](config[_0x50ed('0x1a')],{'host':_0x50ed('0x1b'),'port':0x18eb});var socket=require(_0x50ed('0x1c'))(new Redis(config[_0x50ed('0x1a')]));require(_0x50ed('0x1d'))['register'](socket);var jayson=require(_0x50ed('0x1e'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x3ff049,_0x1bb7b7,_0x5b2a97,_0x3f4477){return new BPromise(function(_0x547db0,_0x380ec6){var _0x429232=_0x3f4477||client;return _0x429232[_0x50ed('0x1f')](_0x3ff049,_0x5b2a97)[_0x50ed('0x20')](function(_0x1caa32){logger[_0x50ed('0x21')](_0x50ed('0x22'),_0x1bb7b7,_0x50ed('0x23'));logger[_0x50ed('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1bb7b7,_0x50ed('0x23'),JSON[_0x50ed('0x25')](_0x1caa32));if(_0x1caa32[_0x50ed('0x26')]){if(_0x1caa32['error'][_0x50ed('0x27')]===0x1f4){logger[_0x50ed('0x26')](_0x50ed('0x22'),_0x1bb7b7,_0x1caa32['error'][_0x50ed('0x28')]);return _0x380ec6(_0x1caa32[_0x50ed('0x26')][_0x50ed('0x28')]);}logger[_0x50ed('0x26')]('SmsAccount,\x20%s,\x20%s',_0x1bb7b7,_0x1caa32[_0x50ed('0x26')]['message']);return _0x547db0(_0x1caa32[_0x50ed('0x26')][_0x50ed('0x28')]);}else{logger[_0x50ed('0x21')](_0x50ed('0x22'),_0x1bb7b7,_0x50ed('0x23'));_0x547db0(_0x1caa32[_0x50ed('0x29')][_0x50ed('0x28')]);}})['catch'](function(_0x4564de){logger[_0x50ed('0x26')](_0x50ed('0x22'),_0x1bb7b7,_0x4564de);_0x380ec6(_0x4564de);});});}function respondWithStatusCode(_0x2a91f0,_0x25c1e9){_0x25c1e9=_0x25c1e9||0xcc;return function(_0x52a582){if(_0x52a582){return _0x2a91f0['sendStatus'](_0x25c1e9);}return _0x2a91f0[_0x50ed('0x2a')](_0x25c1e9)[_0x50ed('0x2b')]();};}function respondWithResult(_0x25febb,_0x174b90){_0x174b90=_0x174b90||0xc8;return function(_0x1a65fa){if(_0x1a65fa){return _0x25febb[_0x50ed('0x2a')](_0x174b90)[_0x50ed('0x2c')](_0x1a65fa);}};}function respondWithFilteredResult(_0x471cbe,_0x2eadbf){return function(_0x2008d0){if(_0x2008d0){var _0x92b109=typeof _0x2eadbf['offset']==='undefined'&&typeof _0x2eadbf[_0x50ed('0x2d')]===_0x50ed('0x2e');var _0x23e2d5=_0x2008d0[_0x50ed('0x2f')];var _0xe52515=_0x92b109?0x0:_0x2eadbf[_0x50ed('0x30')];var _0x56ab8=_0x92b109?_0x2008d0['count']:_0x2eadbf[_0x50ed('0x30')]+_0x2eadbf[_0x50ed('0x2d')];var _0x5e4a1b;if(_0x56ab8>=_0x23e2d5){_0x56ab8=_0x23e2d5;_0x5e4a1b=0xc8;}else{_0x5e4a1b=0xce;}_0x471cbe[_0x50ed('0x2a')](_0x5e4a1b);return _0x471cbe[_0x50ed('0x31')](_0x50ed('0x32'),_0xe52515+'-'+_0x56ab8+'/'+_0x23e2d5)[_0x50ed('0x2c')](_0x2008d0);}return null;};}function patchUpdates(_0x29fa5e){return function(_0x4bcbf2){try{jsonpatch[_0x50ed('0x33')](_0x4bcbf2,_0x29fa5e,!![]);}catch(_0x864d56){return BPromise['reject'](_0x864d56);}return _0x4bcbf2['save']();};}function saveUpdates(_0x6c09b1,_0x1d1b4c){return function(_0x3320f8){if(_0x3320f8){return _0x3320f8[_0x50ed('0x34')](_0x6c09b1)[_0x50ed('0x20')](function(_0x579c98){return _0x579c98;});}return null;};}function removeEntity(_0x15a508,_0x538170){return function(_0x2dfcf8){if(_0x2dfcf8){return _0x2dfcf8[_0x50ed('0x35')]()[_0x50ed('0x20')](function(){var _0xbc486b=_0x2dfcf8['get']({'plain':!![]});var _0x5c5a9b='SmsAccounts';return db[_0x50ed('0x36')][_0x50ed('0x35')]({'where':{'type':_0x5c5a9b,'resourceId':_0xbc486b['id']}})[_0x50ed('0x20')](function(){return _0x2dfcf8;});})[_0x50ed('0x20')](function(){_0x15a508[_0x50ed('0x2a')](0xcc)[_0x50ed('0x2b')]();});}};}function handleEntityNotFound(_0x297523,_0x57b8f6){return function(_0x5be871){if(!_0x5be871){_0x297523[_0x50ed('0x37')](0x194);}return _0x5be871;};}function handleError(_0x257d4e,_0x2b7261){_0x2b7261=_0x2b7261||0x1f4;return function(_0x4228b9){logger['error'](_0x4228b9[_0x50ed('0x38')]);if(_0x4228b9[_0x50ed('0x39')]){delete _0x4228b9[_0x50ed('0x39')];}_0x257d4e[_0x50ed('0x2a')](_0x2b7261)[_0x50ed('0x3a')](_0x4228b9);};}exports['index']=function(_0x57fe5f,_0xff7ce3){var _0x48a226={'include':[{'model':db[_0x50ed('0x3b')],'as':_0x50ed('0x3c')}]},_0x460832={},_0xd2a9a4={'count':0x0,'rows':[]};var _0x4013bd=_[_0x50ed('0x3d')](db[_0x50ed('0x3e')][_0x50ed('0x3f')],function(_0x2c31fb){return{'name':_0x2c31fb[_0x50ed('0x40')],'type':_0x2c31fb[_0x50ed('0x41')][_0x50ed('0x42')]};});_0x460832[_0x50ed('0x43')]=_[_0x50ed('0x3d')](_0x4013bd,_0x50ed('0x39'));_0x460832[_0x50ed('0x44')]=_[_0x50ed('0x45')](_0x57fe5f[_0x50ed('0x44')]);_0x460832['filters']=_[_0x50ed('0x46')](_0x460832['model'],_0x460832[_0x50ed('0x44')]);_0x48a226[_0x50ed('0x47')]=_[_0x50ed('0x46')](_0x460832[_0x50ed('0x43')],qs[_0x50ed('0x48')](_0x57fe5f[_0x50ed('0x44')]['fields']));_0x48a226[_0x50ed('0x47')]=_0x48a226[_0x50ed('0x47')][_0x50ed('0x49')]?_0x48a226[_0x50ed('0x47')]:_0x460832['model'];if(!_0x57fe5f[_0x50ed('0x44')][_0x50ed('0x4a')](_0x50ed('0x4b'))){_0x48a226[_0x50ed('0x2d')]=qs[_0x50ed('0x2d')](_0x57fe5f[_0x50ed('0x44')][_0x50ed('0x2d')]);_0x48a226[_0x50ed('0x30')]=qs[_0x50ed('0x30')](_0x57fe5f['query'][_0x50ed('0x30')]);}_0x48a226['order']=qs['sort'](_0x57fe5f['query'][_0x50ed('0x4c')]);_0x48a226['where']=qs[_0x50ed('0x4d')](_[_0x50ed('0x4e')](_0x57fe5f[_0x50ed('0x44')],_0x460832[_0x50ed('0x4d')]),_0x4013bd);if(_0x57fe5f[_0x50ed('0x44')][_0x50ed('0x4f')]){_0x48a226[_0x50ed('0x50')]=_[_0x50ed('0x51')](_0x48a226[_0x50ed('0x50')],{'$or':_['map'](_0x4013bd,function(_0x47c227){if(_0x47c227[_0x50ed('0x41')]!==_0x50ed('0x52')){var _0x3a76ed={};_0x3a76ed[_0x47c227['name']]={'$like':'%'+_0x57fe5f['query'][_0x50ed('0x4f')]+'%'};return _0x3a76ed;}})});}_0x48a226=_[_0x50ed('0x51')]({},_0x48a226,_0x57fe5f[_0x50ed('0x53')]);var _0x2b73c7={'where':_0x48a226[_0x50ed('0x50')]};return db[_0x50ed('0x3e')][_0x50ed('0x2f')](_0x2b73c7)['then'](function(_0x2d378e){_0xd2a9a4[_0x50ed('0x2f')]=_0x2d378e;if(_0x57fe5f['query'][_0x50ed('0x54')]){_0x48a226['include']=[{'all':!![]}];}return db[_0x50ed('0x3e')][_0x50ed('0x55')](_0x48a226);})[_0x50ed('0x20')](function(_0x1d0888){_0xd2a9a4[_0x50ed('0x56')]=_0x1d0888;return _0xd2a9a4;})['then'](respondWithFilteredResult(_0xff7ce3,_0x48a226))[_0x50ed('0x57')](handleError(_0xff7ce3,null));};exports[_0x50ed('0x58')]=function(_0x837a68,_0x432c3){var _0x3227ac={'raw':![],'where':{'id':_0x837a68['params']['id']},'include':[{'model':db[_0x50ed('0x3b')],'as':_0x50ed('0x3c')}]},_0x2be091={};_0x2be091['model']=_[_0x50ed('0x45')](db[_0x50ed('0x3e')][_0x50ed('0x3f')]);_0x2be091['query']=_[_0x50ed('0x45')](_0x837a68[_0x50ed('0x44')]);_0x2be091[_0x50ed('0x4d')]=_[_0x50ed('0x46')](_0x2be091[_0x50ed('0x43')],_0x2be091['query']);_0x3227ac[_0x50ed('0x47')]=_[_0x50ed('0x46')](_0x2be091[_0x50ed('0x43')],qs['fields'](_0x837a68['query'][_0x50ed('0x48')]));_0x3227ac[_0x50ed('0x47')]=_0x3227ac[_0x50ed('0x47')][_0x50ed('0x49')]?_0x3227ac[_0x50ed('0x47')]:_0x2be091[_0x50ed('0x43')];if(_0x837a68['query'][_0x50ed('0x54')]){_0x3227ac[_0x50ed('0x59')]=[{'all':!![]}];}_0x3227ac=_[_0x50ed('0x51')]({},_0x3227ac,_0x837a68[_0x50ed('0x53')]);return db[_0x50ed('0x3e')]['find'](_0x3227ac)[_0x50ed('0x20')](handleEntityNotFound(_0x432c3,null))[_0x50ed('0x20')](respondWithResult(_0x432c3,null))[_0x50ed('0x57')](handleError(_0x432c3,null));};exports[_0x50ed('0x5a')]=function(_0x3be758,_0x4e1e98){return db[_0x50ed('0x3e')][_0x50ed('0x5a')](_0x3be758[_0x50ed('0x5b')],{})['then'](function(_0x4629c4){var _0x204e1b=_0x3be758[_0x50ed('0x5c')]['get']({'plain':!![]});if(!_0x204e1b)throw new Error(_0x50ed('0x5d'));if(_0x204e1b[_0x50ed('0x5e')]===_0x50ed('0x5c')){var _0x35a993=_0x4629c4[_0x50ed('0x5f')]({'plain':!![]});var _0x274b14=_0x50ed('0x60');return db['UserProfileSection'][_0x50ed('0x61')]({'where':{'name':_0x274b14,'userProfileId':_0x204e1b[_0x50ed('0x62')]},'raw':!![]})['then'](function(_0x500d4c){if(_0x500d4c&&_0x500d4c[_0x50ed('0x63')]===0x0){return db[_0x50ed('0x36')]['create']({'name':_0x35a993[_0x50ed('0x39')],'resourceId':_0x35a993['id'],'type':_0x500d4c['name'],'sectionId':_0x500d4c['id']},{})[_0x50ed('0x20')](function(){return _0x4629c4;});}else{return _0x4629c4;}})['catch'](function(_0x4b1e48){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b1e48);throw _0x4b1e48;});}return _0x4629c4;})['then'](respondWithResult(_0x4e1e98,0xc9))['catch'](handleError(_0x4e1e98,null));};exports[_0x50ed('0x34')]=function(_0x3a4b13,_0x5b1b3a){if(_0x3a4b13[_0x50ed('0x5b')]['id']){delete _0x3a4b13[_0x50ed('0x5b')]['id'];}return db[_0x50ed('0x3e')][_0x50ed('0x61')]({'where':{'id':_0x3a4b13[_0x50ed('0x64')]['id']},'include':[{'model':db['Pause'],'as':_0x50ed('0x3c')}]})[_0x50ed('0x20')](handleEntityNotFound(_0x5b1b3a,null))[_0x50ed('0x20')](saveUpdates(_0x3a4b13[_0x50ed('0x5b')],null))[_0x50ed('0x20')](respondWithResult(_0x5b1b3a,null))[_0x50ed('0x57')](handleError(_0x5b1b3a,null));};exports[_0x50ed('0x35')]=function(_0xac8130,_0x4be609){return db['SmsAccount']['find']({'where':{'id':_0xac8130[_0x50ed('0x64')]['id']}})[_0x50ed('0x20')](handleEntityNotFound(_0x4be609,null))['then'](removeEntity(_0x4be609,null))[_0x50ed('0x57')](handleError(_0x4be609,null));};exports[_0x50ed('0x65')]=function(_0x20917a,_0x44ea5c){return db['SmsAccount'][_0x50ed('0x65')]()[_0x50ed('0x20')](respondWithResult(_0x44ea5c,null))[_0x50ed('0x57')](handleError(_0x44ea5c,null));};exports[_0x50ed('0x66')]=function(_0xcf72b9,_0x57f1ee,_0x7504c8){if(_0xcf72b9[_0x50ed('0x5b')]['id']){delete _0xcf72b9[_0x50ed('0x5b')]['id'];}return db[_0x50ed('0x3e')]['find']({'where':{'id':_0xcf72b9[_0x50ed('0x64')]['id']}})['then'](handleEntityNotFound(_0x57f1ee,null))['then'](function(_0x16875b){if(_0x16875b){_0xcf72b9[_0x50ed('0x5b')]['SmsAccountId']=_0x16875b['id'];return db[_0x50ed('0x67')]['create'](_0xcf72b9[_0x50ed('0x5b')]);}})['then'](respondWithResult(_0x57f1ee,null))['catch'](handleError(_0x57f1ee,null));};exports[_0x50ed('0x68')]=function(_0x15203f,_0x51392d,_0x1ea342){var _0x4b37b9={'raw':![],'where':{}};var _0x3386f8={};var _0x387293={'count':0x0,'rows':[]};return db[_0x50ed('0x3e')][_0x50ed('0x69')]({'where':{'id':_0x15203f['params']['id']}})[_0x50ed('0x20')](handleEntityNotFound(_0x51392d,null))[_0x50ed('0x20')](function(_0x4faaf0){if(_0x4faaf0){_0x3386f8[_0x50ed('0x43')]=_[_0x50ed('0x45')](db[_0x50ed('0x67')][_0x50ed('0x3f')]);_0x3386f8[_0x50ed('0x44')]=_['keys'](_0x15203f['query']);_0x3386f8['filters']=_['intersection'](_0x3386f8[_0x50ed('0x43')],_0x3386f8[_0x50ed('0x44')]);_0x4b37b9[_0x50ed('0x47')]=_[_0x50ed('0x46')](_0x3386f8[_0x50ed('0x43')],qs['fields'](_0x15203f[_0x50ed('0x44')]['fields']));_0x4b37b9[_0x50ed('0x47')]=_0x4b37b9[_0x50ed('0x47')][_0x50ed('0x49')]?_0x4b37b9['attributes']:_0x3386f8[_0x50ed('0x43')];if(!_0x15203f[_0x50ed('0x44')][_0x50ed('0x4a')](_0x50ed('0x4b'))){_0x4b37b9['limit']=qs['limit'](_0x15203f['query'][_0x50ed('0x2d')]);_0x4b37b9[_0x50ed('0x30')]=qs[_0x50ed('0x30')](_0x15203f[_0x50ed('0x44')][_0x50ed('0x30')]);}_0x4b37b9[_0x50ed('0x6a')]=qs[_0x50ed('0x4c')](_0x15203f[_0x50ed('0x44')][_0x50ed('0x4c')]);_0x4b37b9['where']=qs[_0x50ed('0x4d')](_[_0x50ed('0x4e')](_0x15203f[_0x50ed('0x44')],_0x3386f8[_0x50ed('0x4d')]));_0x4b37b9[_0x50ed('0x50')][_0x50ed('0x6b')]=_0x4faaf0['id'];if(_0x15203f['query'][_0x50ed('0x4f')]){_0x4b37b9[_0x50ed('0x50')]=_[_0x50ed('0x51')](_0x4b37b9[_0x50ed('0x50')],{'$or':_[_0x50ed('0x3d')](_0x4b37b9[_0x50ed('0x47')],function(_0x4cab7d){var _0x25d3cd={};_0x25d3cd[_0x4cab7d]={'$like':'%'+_0x15203f['query']['filter']+'%'};return _0x25d3cd;})});}_0x4b37b9=_[_0x50ed('0x51')]({},_0x4b37b9,_0x15203f[_0x50ed('0x53')]);return db[_0x50ed('0x67')]['count']({'where':_0x4b37b9[_0x50ed('0x50')]})['then'](function(_0x59730c){_0x387293[_0x50ed('0x2f')]=_0x59730c;if(_0x15203f['query'][_0x50ed('0x54')]){_0x4b37b9['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4b37b9);})[_0x50ed('0x20')](function(_0x2b86fc){_0x387293['rows']=_0x2b86fc;return _0x387293;});}})[_0x50ed('0x20')](respondWithFilteredResult(_0x51392d,_0x4b37b9))[_0x50ed('0x57')](handleError(_0x51392d,null));};exports['removeDispositions']=function(_0x117f4a,_0x17a3c1,_0x3cc2e5){return db['SmsAccount'][_0x50ed('0x61')]({'where':{'id':_0x117f4a[_0x50ed('0x64')]['id']}})['then'](handleEntityNotFound(_0x17a3c1,null))[_0x50ed('0x20')](function(_0x2f582f){if(_0x2f582f){return _0x2f582f[_0x50ed('0x6c')](_0x117f4a['query'][_0x50ed('0x6d')]);}})[_0x50ed('0x20')](respondWithStatusCode(_0x17a3c1,null))[_0x50ed('0x57')](handleError(_0x17a3c1,null));};exports[_0x50ed('0x6e')]=function(_0x4ff257,_0x56b0d7,_0x1fba1f){if(_0x4ff257['body']['id']){delete _0x4ff257[_0x50ed('0x5b')]['id'];}return db[_0x50ed('0x3e')][_0x50ed('0x61')]({'where':{'id':_0x4ff257[_0x50ed('0x64')]['id']}})[_0x50ed('0x20')](handleEntityNotFound(_0x56b0d7,null))[_0x50ed('0x20')](function(_0x33d0a1){if(_0x33d0a1){_0x4ff257[_0x50ed('0x5b')][_0x50ed('0x6b')]=_0x33d0a1['id'];return db[_0x50ed('0x6f')][_0x50ed('0x5a')](_0x4ff257[_0x50ed('0x5b')]);}})['then'](respondWithResult(_0x56b0d7,null))[_0x50ed('0x57')](handleError(_0x56b0d7,null));};exports['getAnswers']=function(_0x199a1d,_0x272730,_0x21a44d){var _0x7f909e={'raw':![],'where':{}};var _0x5830b1={};var _0x14caf1={'count':0x0,'rows':[]};return db[_0x50ed('0x3e')][_0x50ed('0x69')]({'where':{'id':_0x199a1d[_0x50ed('0x64')]['id']}})[_0x50ed('0x20')](handleEntityNotFound(_0x272730,null))[_0x50ed('0x20')](function(_0x32c6db){if(_0x32c6db){_0x5830b1[_0x50ed('0x43')]=_[_0x50ed('0x45')](db[_0x50ed('0x6f')]['rawAttributes']);_0x5830b1['query']=_[_0x50ed('0x45')](_0x199a1d[_0x50ed('0x44')]);_0x5830b1[_0x50ed('0x4d')]=_['intersection'](_0x5830b1['model'],_0x5830b1[_0x50ed('0x44')]);_0x7f909e[_0x50ed('0x47')]=_['intersection'](_0x5830b1[_0x50ed('0x43')],qs[_0x50ed('0x48')](_0x199a1d['query'][_0x50ed('0x48')]));_0x7f909e[_0x50ed('0x47')]=_0x7f909e[_0x50ed('0x47')]['length']?_0x7f909e['attributes']:_0x5830b1[_0x50ed('0x43')];if(!_0x199a1d['query'][_0x50ed('0x4a')](_0x50ed('0x4b'))){_0x7f909e['limit']=qs[_0x50ed('0x2d')](_0x199a1d[_0x50ed('0x44')][_0x50ed('0x2d')]);_0x7f909e[_0x50ed('0x30')]=qs['offset'](_0x199a1d['query'][_0x50ed('0x30')]);}_0x7f909e[_0x50ed('0x6a')]=qs[_0x50ed('0x4c')](_0x199a1d[_0x50ed('0x44')]['sort']);_0x7f909e[_0x50ed('0x50')]=qs[_0x50ed('0x4d')](_[_0x50ed('0x4e')](_0x199a1d[_0x50ed('0x44')],_0x5830b1[_0x50ed('0x4d')]));_0x7f909e[_0x50ed('0x50')][_0x50ed('0x6b')]=_0x32c6db['id'];if(_0x199a1d[_0x50ed('0x44')][_0x50ed('0x4f')]){_0x7f909e['where']=_[_0x50ed('0x51')](_0x7f909e[_0x50ed('0x50')],{'$or':_[_0x50ed('0x3d')](_0x7f909e[_0x50ed('0x47')],function(_0x32a97a){var _0x343e9a={};_0x343e9a[_0x32a97a]={'$like':'%'+_0x199a1d['query'][_0x50ed('0x4f')]+'%'};return _0x343e9a;})});}_0x7f909e=_[_0x50ed('0x51')]({},_0x7f909e,_0x199a1d['options']);return db[_0x50ed('0x6f')][_0x50ed('0x2f')]({'where':_0x7f909e[_0x50ed('0x50')]})[_0x50ed('0x20')](function(_0x45f8bf){_0x14caf1['count']=_0x45f8bf;if(_0x199a1d[_0x50ed('0x44')]['includeAll']){_0x7f909e[_0x50ed('0x59')]=[{'all':!![]}];}return db[_0x50ed('0x6f')][_0x50ed('0x55')](_0x7f909e);})[_0x50ed('0x20')](function(_0x1752ba){_0x14caf1[_0x50ed('0x56')]=_0x1752ba;return _0x14caf1;});}})[_0x50ed('0x20')](respondWithFilteredResult(_0x272730,_0x7f909e))[_0x50ed('0x57')](handleError(_0x272730,null));};exports[_0x50ed('0x70')]=function(_0x218932,_0x3295d1,_0x41d73a){return db[_0x50ed('0x3e')][_0x50ed('0x61')]({'where':{'id':_0x218932['params']['id']}})[_0x50ed('0x20')](handleEntityNotFound(_0x3295d1,null))[_0x50ed('0x20')](function(_0x3ca99d){if(_0x3ca99d){return _0x3ca99d[_0x50ed('0x70')](_0x218932[_0x50ed('0x44')][_0x50ed('0x6d')]);}})[_0x50ed('0x20')](respondWithStatusCode(_0x3295d1,null))['catch'](handleError(_0x3295d1,null));};exports[_0x50ed('0x71')]=function(_0x4c2852,_0x36eeb0,_0x546237){var _0x36916c={'channel':_0x50ed('0x72')};var _0x5a99f0=[];var _0x52fac5=[];var _0x7228ec={};return db[_0x50ed('0x3e')][_0x50ed('0x61')]({'where':{'id':_0x4c2852[_0x50ed('0x64')]['id']},'include':[{'model':db[_0x50ed('0x73')],'as':_0x50ed('0x74')}]})['then'](handleEntityNotFound(_0x36eeb0,null))[_0x50ed('0x20')](function(_0x48e666){_0x36916c[_0x50ed('0x75')]=_0x48e666;_0x36916c[_0x50ed('0x76')]=_[_0x50ed('0x77')](_0x48e666[_0x50ed('0x74')],[_0x50ed('0x78')],[_0x50ed('0x79')]);if(_0x36916c['account'][_0x50ed('0x74')]){delete _0x36916c[_0x50ed('0x75')]['Applications'];}return db[_0x50ed('0x7a')][_0x50ed('0x65')]();})[_0x50ed('0x20')](function(_0x54389e){if(!_0x54389e){throw new db[(_0x50ed('0x7b'))]['ValidationError'](_0x50ed('0x7c'));}_0x5a99f0=_[_0x50ed('0x7d')](_[_0x50ed('0x45')](_0x54389e),[_0x50ed('0x7e'),_0x50ed('0x7f')]);_0x52fac5=_[_0x50ed('0x7d')](_[_0x50ed('0x45')](_0x54389e),[_0x50ed('0x7e'),'updatedAt',_0x50ed('0x80'),_0x50ed('0x81')]);_0x36916c['body']={'mapKey':'mobile'};if(_0x36916c[_0x50ed('0x75')][_0x50ed('0x41')]){switch(_0x36916c['account'][_0x50ed('0x41')]){case _0x50ed('0x82'):_0x36916c[_0x50ed('0x5b')]['from']=_0x4c2852[_0x50ed('0x5b')]['From'];_0x36916c[_0x50ed('0x5b')][_0x50ed('0x5b')]=_0x4c2852['body'][_0x50ed('0x83')];_0x36916c[_0x50ed('0x5b')][_0x50ed('0x84')]=_0x4c2852[_0x50ed('0x5b')][_0x50ed('0x85')];break;case _0x50ed('0x86'):_0x36916c['body']['from']='+'+_0x4c2852[_0x50ed('0x5b')][_0x50ed('0x87')];_0x36916c['body'][_0x50ed('0x5b')]=_0x4c2852[_0x50ed('0x5b')][_0x50ed('0x88')];break;case _0x50ed('0x89'):_0x36916c['body'][_0x50ed('0x8a')]=_0x4c2852[_0x50ed('0x5b')][_0x50ed('0x8a')];_0x36916c[_0x50ed('0x5b')][_0x50ed('0x5b')]=_0x4c2852[_0x50ed('0x5b')][_0x50ed('0x28')];break;case _0x50ed('0x8b'):_0x36916c['body'][_0x50ed('0x8a')]=_0x4c2852[_0x50ed('0x5b')]['from'];_0x36916c[_0x50ed('0x5b')][_0x50ed('0x5b')]=_0x4c2852[_0x50ed('0x5b')][_0x50ed('0x5b')];_0x36916c[_0x50ed('0x5b')][_0x50ed('0x84')]=_0x4c2852['body'][_0x50ed('0x8c')];break;case _0x50ed('0x8d'):_0x36916c[_0x50ed('0x5b')][_0x50ed('0x8a')]=_0x4c2852[_0x50ed('0x5b')][_0x50ed('0x8e')];_0x36916c[_0x50ed('0x5b')][_0x50ed('0x5b')]=_0x4c2852['body'][_0x50ed('0x8f')];_0x36916c[_0x50ed('0x5b')][_0x50ed('0x84')]=_0x4c2852['body'][_0x50ed('0x90')];break;case _0x50ed('0x91'):_0x36916c[_0x50ed('0x5b')][_0x50ed('0x8a')]='+'+_0x4c2852[_0x50ed('0x5b')][_0x50ed('0x92')][0x0][_0x50ed('0x8a')];_0x36916c[_0x50ed('0x5b')]['body']=_0x4c2852[_0x50ed('0x5b')][_0x50ed('0x92')][0x0]['text'];_0x36916c[_0x50ed('0x5b')][_0x50ed('0x84')]=_0x4c2852[_0x50ed('0x5b')]['results'][0x0]['messageId'];break;case _0x50ed('0x93'):_0x36916c[_0x50ed('0x5b')][_0x50ed('0x8a')]=_0x4c2852['body'][_0x50ed('0x94')];_0x36916c[_0x50ed('0x5b')][_0x50ed('0x5b')]=_0x4c2852[_0x50ed('0x5b')][_0x50ed('0x95')]['message'];break;case _0x50ed('0x96'):_0x36916c[_0x50ed('0x5b')]['from']=_0x4c2852[_0x50ed('0x5b')]['fromNumber'];_0x36916c[_0x50ed('0x5b')]['body']=_0x4c2852[_0x50ed('0x5b')][_0x50ed('0x88')];_0x36916c[_0x50ed('0x5b')][_0x50ed('0x84')]=_0x4c2852[_0x50ed('0x5b')]['replyMessageId'];break;case _0x50ed('0x97'):_0x36916c[_0x50ed('0x5b')]['messageId']=_0x4c2852[_0x50ed('0x5b')][0x0]['message']['id'];_0x36916c[_0x50ed('0x5b')]['from']=_0x4c2852[_0x50ed('0x5b')][0x0][_0x50ed('0x28')][_0x50ed('0x8a')];_0x36916c[_0x50ed('0x5b')][_0x50ed('0x5b')]=_0x4c2852['body'][0x0][_0x50ed('0x28')][_0x50ed('0x88')];break;case _0x50ed('0x98'):_0x36916c[_0x50ed('0x5b')][_0x50ed('0x8a')]=_0x4c2852[_0x50ed('0x5b')][_0x50ed('0x8a')];_0x36916c[_0x50ed('0x5b')]['body']=_0x4c2852[_0x50ed('0x5b')][_0x50ed('0x28')];_0x36916c[_0x50ed('0x5b')]['messageId']=_0x4c2852[_0x50ed('0x5b')]['refid'];break;}}if(_0x36916c[_0x50ed('0x5b')]['id']){delete _0x36916c[_0x50ed('0x5b')]['id'];}if(_[_0x50ed('0x99')](_0x36916c[_0x50ed('0x5b')][_0x50ed('0x8a')])){throw new db['Sequelize'][(_0x50ed('0x9a'))](_0x50ed('0x9b'));}if(_[_0x50ed('0x99')](_0x36916c['body'][_0x50ed('0x5b')])||_0x36916c[_0x50ed('0x5b')][_0x50ed('0x5b')]===''){throw new db[(_0x50ed('0x7b'))][(_0x50ed('0x9a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x36916c[_0x50ed('0x5b')][_0x50ed('0x9c')])){throw new db['Sequelize'][(_0x50ed('0x9a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x52fac5);}if(!_['includes'](_0x52fac5,_0x36916c[_0x50ed('0x5b')][_0x50ed('0x9c')])){throw new db['Sequelize'][(_0x50ed('0x9a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x52fac5);}_0x7228ec[_0x36916c['body'][_0x50ed('0x9c')]]=_0x36916c[_0x50ed('0x5b')][_0x50ed('0x8a')];return db['CmList'][_0x50ed('0x61')]({'where':{'id':_0x36916c[_0x50ed('0x75')]['ListId']},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x7228ec,'limit':0x1,'order':[[_0x50ed('0x7f'),_0x50ed('0x9d')]]}]});})['then'](handleEntityNotFound(_0x36eeb0,null))[_0x50ed('0x20')](function(_0x5e60d4){if(_0x5e60d4){_0x36916c[_0x50ed('0x9e')]=_['omit'](_0x5e60d4,[_0x50ed('0x9f')]);if(_0x5e60d4[_0x50ed('0x9f')][_0x50ed('0x49')]){return _0x5e60d4[_0x50ed('0x9f')][0x0];}var _0x1088d0=_[_0x50ed('0x19')](_0x36916c[_0x50ed('0x5b')],{'firstName':_0x36916c['body']['from'],'ListId':_0x5e60d4['id']});_0x1088d0[_0x36916c[_0x50ed('0x5b')]['mapKey']]=_0x36916c[_0x50ed('0x5b')]['from'];return db[_0x50ed('0x7a')][_0x50ed('0x5a')](_0x1088d0,{'fields':_0x5a99f0,'raw':!![]});}})[_0x50ed('0x20')](handleEntityNotFound(_0x36eeb0,null))[_0x50ed('0x20')](function(_0x30562d){if(_0x30562d){_0x36916c[_0x50ed('0xa0')]=_0x30562d;var _0x113dfa={'ContactId':_0x30562d['id'],'phone':_0x36916c['body'][_0x50ed('0x8a')],'SmsAccountId':_0x4c2852[_0x50ed('0x64')]['id']};var _0x2b28f4={'ContactId':_0x30562d['id'],'SmsAccountId':_0x4c2852[_0x50ed('0x64')]['id'],'closed':![]};return db[_0x50ed('0xa1')]['find']({'where':_0x2b28f4})['then'](function(_0x1adbd2){if(_0x1adbd2){return[_0x1adbd2,![]];}return db[_0x50ed('0xa1')][_0x50ed('0x5a')](_0x113dfa)[_0x50ed('0x20')](function(_0x3a7908){return[_0x3a7908,!![]];});});}})[_0x50ed('0xa2')](function(_0x350ba2,_0x4dfbc1){_0x36916c[_0x50ed('0xa3')]=_0x350ba2[_0x50ed('0x5f')]({'plain':!![]});_0x36916c[_0x50ed('0xa3')]['created']=![];if(_0x4dfbc1){if(_0x36916c['account'][_0x50ed('0xa4')]){_0x36916c[_0x50ed('0x76')][_0x50ed('0xa5')]({'id':0x0,'priority':_0x36916c[_0x50ed('0x76')][_0x50ed('0x49')]+0x1,'app':_0x50ed('0xa6'),'appdata':_0x50ed('0xa7'),'interval':_0x50ed('0xa8')});}_0x36916c[_0x50ed('0xa3')][_0x50ed('0xa9')]=!![];}return db[_0x50ed('0xaa')][_0x50ed('0x5a')]({'phone':_0x36916c[_0x50ed('0x5b')][_0x50ed('0x8a')],'messageId':_0x36916c['body'][_0x50ed('0x84')],'body':_0x36916c[_0x50ed('0x5b')][_0x50ed('0x5b')],'SmsAccountId':_0x4c2852[_0x50ed('0x64')]['id'],'SmsInteractionId':_0x350ba2['id'],'direction':'in','ContactId':_0x350ba2[_0x50ed('0xab')],'AttachmentId':_0x36916c[_0x50ed('0x5b')][_0x50ed('0xac')]});})[_0x50ed('0x20')](function(_0xad409d){_0x36916c[_0x50ed('0x28')]=_0xad409d;if(!_0x36916c[_0x50ed('0xa3')][_0x50ed('0xad')])return;return db[_0x50ed('0xae')][_0x50ed('0x61')]({'attributes':['id',_0x50ed('0x39')],'where':{'id':_0x36916c[_0x50ed('0xa3')][_0x50ed('0xad')]}});})['then'](function(_0x575f9a){if(_0x575f9a){_0x36916c[_0x50ed('0x76')][_0x50ed('0xaf')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x575f9a[_0x50ed('0x39')]+','+(_0x36916c['account'][_0x50ed('0xb0')]||0xa),'interval':_0x50ed('0xa8')});}if(!_0x36916c[_0x50ed('0xa3')][_0x50ed('0xb1')])return;return db[_0x50ed('0xb2')]['find']({'attributes':['id',_0x50ed('0x39')],'where':{'id':_0x36916c[_0x50ed('0xa3')][_0x50ed('0xb1')]}});})[_0x50ed('0x20')](function(_0x10f06e){if(_0x10f06e){_0x36916c[_0x50ed('0x76')]['unshift']({'id':0x0,'priority':0x1,'app':_0x50ed('0xb3'),'appdata':_0x10f06e[_0x50ed('0x39')]+','+(_0x36916c[_0x50ed('0x75')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x36916c);})[_0x50ed('0x20')](function(_0xe36fe4){if(_0xe36fe4){var _0x4897c2=0xc8;var _0x3d9406=_0x50ed('0xb4');logger[_0x50ed('0x21')](_0x50ed('0xb5'),_0x3d9406,_0x4897c2,_0x50ed('0xb6'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3d9406,_0x4897c2,_0x50ed('0xb6'),JSON['stringify'](_0xe36fe4));if(_0x36916c['account'][_0x50ed('0x41')]===_0x50ed('0x82')){return _0x36eeb0[_0x50ed('0x2a')](_0x4897c2)[_0x50ed('0x31')]('Content-Type',_0x50ed('0xb7'))[_0x50ed('0x3a')](_0x50ed('0xb8'));}else{return _0x36eeb0['status'](_0x4897c2)[_0x50ed('0x2c')](_0xe36fe4);}}})[_0x50ed('0x57')](handleError(_0x36eeb0,null));};exports[_0x50ed('0xb9')]=function(_0x558274,_0x2a9965){var _0x216eaf=_0x558274['params']['id'];var _0x337399=_0x558274[_0x50ed('0x5b')];var _0x494f3d=0xc8;var _0x193c56=null;return db[_0x50ed('0xba')][_0x50ed('0xbb')]({'isolationLevel':db[_0x50ed('0xba')][_0x50ed('0xbc')]['ISOLATION_LEVELS'][_0x50ed('0xbd')]},function(_0x20f0cd){return db['SmsAccount'][_0x50ed('0x69')]({'where':{'id':_0x216eaf},'transaction':_0x20f0cd})[_0x50ed('0x20')](function(_0x1ded2a){if(_0x1ded2a){return db[_0x50ed('0x73')][_0x50ed('0x35')]({'where':{'SmsAccountId':_0x216eaf},'transaction':_0x20f0cd})[_0x50ed('0x20')](function(){var _0x4330ef=_['map'](_0x337399,function(_0x3a4e6b){_0x3a4e6b[_0x50ed('0x6b')]=_0x216eaf;return _0x3a4e6b;});return db[_0x50ed('0x73')][_0x50ed('0xbe')](_0x4330ef,{'transaction':_0x20f0cd});});}else{_0x494f3d=0x194;_0x193c56=[];}});})[_0x50ed('0x20')](function(){if(_0x494f3d!==0x194){return db[_0x50ed('0x73')]['findAndCountAll']({'where':{'SmsAccountId':_0x216eaf},'order':'priority'})[_0x50ed('0x20')](function(_0x4471c4){_0x193c56=_0x4471c4;});}})[_0x50ed('0x57')](function(_0x44a215){_0x494f3d=0x1f4;logger['error'](_0x44a215[_0x50ed('0x38')]);if(_0x44a215[_0x50ed('0x39')]){delete _0x44a215[_0x50ed('0x39')];}_0x193c56=_0x44a215;})[_0x50ed('0xbf')](function(){if(_0x193c56===null){_0x2a9965[_0x50ed('0x37')](_0x494f3d);}else{if(_0x494f3d===0x1f4){_0x2a9965['status'](_0x494f3d)['send'](_0x193c56);}else{_0x2a9965[_0x50ed('0x2a')](_0x494f3d)[_0x50ed('0x2c')](_0x193c56);}}});};exports[_0x50ed('0xc0')]=function(_0x381b21,_0x7c7ba6,_0x589f01){var _0x5b361c={};var _0xf7ce3c={};var _0x77a6aa;var _0x33645f;return db['SmsAccount']['findOne']({'where':{'id':_0x381b21[_0x50ed('0x64')]['id']}})[_0x50ed('0x20')](handleEntityNotFound(_0x7c7ba6,null))[_0x50ed('0x20')](function(_0x1e6cbb){if(_0x1e6cbb){_0x77a6aa=_0x1e6cbb;_0xf7ce3c[_0x50ed('0x43')]=_[_0x50ed('0x45')](db[_0x50ed('0x73')][_0x50ed('0x3f')]);_0xf7ce3c[_0x50ed('0x44')]=_[_0x50ed('0x45')](_0x381b21[_0x50ed('0x44')]);_0xf7ce3c[_0x50ed('0x4d')]=_[_0x50ed('0x46')](_0xf7ce3c[_0x50ed('0x43')],_0xf7ce3c[_0x50ed('0x44')]);_0x5b361c[_0x50ed('0x47')]=_[_0x50ed('0x46')](_0xf7ce3c[_0x50ed('0x43')],qs[_0x50ed('0x48')](_0x381b21['query'][_0x50ed('0x48')]));_0x5b361c[_0x50ed('0x47')]=_0x5b361c['attributes']['length']?_0x5b361c[_0x50ed('0x47')]:_0xf7ce3c[_0x50ed('0x43')];_0x5b361c[_0x50ed('0x6a')]=qs[_0x50ed('0x4c')](_0x381b21[_0x50ed('0x44')]['sort']);_0x5b361c[_0x50ed('0x50')]=qs['filters'](_[_0x50ed('0x4e')](_0x381b21[_0x50ed('0x44')],_0xf7ce3c[_0x50ed('0x4d')]));if(_0x381b21[_0x50ed('0x44')][_0x50ed('0x4f')]){_0x5b361c['where']=_[_0x50ed('0x51')](_0x5b361c[_0x50ed('0x50')],{'$or':_['map'](_0x5b361c[_0x50ed('0x47')],function(_0x1737ad){var _0x412271={};_0x412271[_0x1737ad]={'$like':'%'+_0x381b21[_0x50ed('0x44')][_0x50ed('0x4f')]+'%'};return _0x412271;})});}_0x5b361c=_[_0x50ed('0x51')]({},_0x5b361c,_0x381b21[_0x50ed('0x53')]);return _0x77a6aa['getApplications'](_0x5b361c);}})['then'](function(_0x4fb224){if(_0x4fb224){_0x33645f=_0x4fb224[_0x50ed('0x49')];if(!_0x381b21[_0x50ed('0x44')][_0x50ed('0x4a')](_0x50ed('0x4b'))){_0x5b361c[_0x50ed('0x2d')]=qs[_0x50ed('0x2d')](_0x381b21[_0x50ed('0x44')][_0x50ed('0x2d')]);_0x5b361c[_0x50ed('0x30')]=qs[_0x50ed('0x30')](_0x381b21[_0x50ed('0x44')][_0x50ed('0x30')]);}return _0x77a6aa[_0x50ed('0xc0')](_0x5b361c);}})[_0x50ed('0x20')](function(_0x3d8c29){if(_0x3d8c29){return _0x3d8c29?{'count':_0x33645f,'rows':_0x3d8c29}:null;}})[_0x50ed('0x20')](respondWithResult(_0x7c7ba6,null))[_0x50ed('0x57')](handleError(_0x7c7ba6,null));};exports['getInteractions']=function(_0x3c7389,_0x5ed09f,_0x4cf74b){var _0xd451a3={'raw':![],'where':{}};var _0x4b0d92={};var _0x20e467={'count':0x0,'rows':[]};return db['SmsAccount'][_0x50ed('0x69')]({'where':{'id':_0x3c7389[_0x50ed('0x64')]['id']}})['then'](handleEntityNotFound(_0x5ed09f,null))[_0x50ed('0x20')](function(_0x4c6dc9){if(_0x4c6dc9){_0x4b0d92['model']=_['keys'](db[_0x50ed('0xa1')][_0x50ed('0x3f')]);_0x4b0d92[_0x50ed('0x44')]=_['keys'](_0x3c7389[_0x50ed('0x44')]);_0x4b0d92['filters']=_['intersection'](_0x4b0d92[_0x50ed('0x43')],_0x4b0d92[_0x50ed('0x44')]);_0xd451a3[_0x50ed('0x47')]=_[_0x50ed('0x46')](_0x4b0d92['model'],qs[_0x50ed('0x48')](_0x3c7389[_0x50ed('0x44')][_0x50ed('0x48')]));_0xd451a3[_0x50ed('0x47')]=_0xd451a3[_0x50ed('0x47')]['length']?_0xd451a3[_0x50ed('0x47')]:_0x4b0d92['model'];if(!_0x3c7389[_0x50ed('0x44')][_0x50ed('0x4a')](_0x50ed('0x4b'))){_0xd451a3['limit']=qs[_0x50ed('0x2d')](_0x3c7389[_0x50ed('0x44')][_0x50ed('0x2d')]);_0xd451a3[_0x50ed('0x30')]=qs['offset'](_0x3c7389[_0x50ed('0x44')][_0x50ed('0x30')]);}_0xd451a3['order']=qs[_0x50ed('0x4c')](_0x3c7389[_0x50ed('0x44')]['sort']);_0xd451a3[_0x50ed('0x50')]=qs[_0x50ed('0x4d')](_[_0x50ed('0x4e')](_0x3c7389['query'],_0x4b0d92[_0x50ed('0x4d')]));_0xd451a3[_0x50ed('0x50')][_0x50ed('0x6b')]=_0x4c6dc9['id'];if(_0x3c7389[_0x50ed('0x44')]['filter']){_0xd451a3[_0x50ed('0x50')]=_[_0x50ed('0x51')](_0xd451a3['where'],{'$or':_[_0x50ed('0x3d')](_0xd451a3[_0x50ed('0x47')],function(_0x385bac){var _0x22e034={};_0x22e034[_0x385bac]={'$like':'%'+_0x3c7389[_0x50ed('0x44')]['filter']+'%'};return _0x22e034;})});}_0xd451a3=_[_0x50ed('0x51')]({},_0xd451a3,_0x3c7389[_0x50ed('0x53')]);return db[_0x50ed('0xa1')][_0x50ed('0x2f')]({'where':_0xd451a3[_0x50ed('0x50')]})[_0x50ed('0x20')](function(_0x568ee3){_0x20e467[_0x50ed('0x2f')]=_0x568ee3;if(_0x3c7389[_0x50ed('0x44')][_0x50ed('0x54')]){_0xd451a3[_0x50ed('0x59')]=[{'model':db[_0x50ed('0x7a')],'as':'Contact','required':![]},{'model':db[_0x50ed('0xae')],'as':'Owner','attributes':['name',_0x50ed('0xc1'),_0x50ed('0xc2')],'required':![]},{'model':db[_0x50ed('0xc3')],'as':_0x50ed('0xc4'),'attributes':['id','name',_0x50ed('0xc5')],'where':_0x3c7389[_0x50ed('0x44')][_0x50ed('0xc6')]?{'id':_0x3c7389[_0x50ed('0x44')]['tag']}:undefined,'required':_0x3c7389[_0x50ed('0x44')]['tag']?!![]:![]}];}return db[_0x50ed('0xa1')]['findAll'](_0xd451a3);})['then'](function(_0x2aa723){_0x20e467['rows']=_0x2aa723;return _0x20e467;});}})[_0x50ed('0x20')](respondWithFilteredResult(_0x5ed09f,_0xd451a3))[_0x50ed('0x57')](handleError(_0x5ed09f,null));};exports[_0x50ed('0x3a')]=function(_0x477eaa,_0x133c5f,_0x1ec1ad){var _0x10b0a1,_0x1192cd,_0x164074;if(_[_0x50ed('0x99')](_0x477eaa['body'][_0x50ed('0x5b')])||_0x477eaa[_0x50ed('0x5b')][_0x50ed('0x5b')]===''){throw new db[(_0x50ed('0x7b'))][(_0x50ed('0x9a'))](_0x50ed('0xc7'));}if(_['isNil'](_0x477eaa[_0x50ed('0x5b')]['to'])){throw new db['Sequelize'][(_0x50ed('0x9a'))](_0x50ed('0xc8'));}_0x10b0a1=_0x477eaa[_0x50ed('0x5b')]['to'];return db[_0x50ed('0x3e')][_0x50ed('0x61')]({'where':{'id':_0x477eaa[_0x50ed('0x64')]['id']},'include':[{'model':db[_0x50ed('0xc9')],'as':_0x50ed('0xca'),'include':[{'model':db[_0x50ed('0x7a')],'as':_0x50ed('0x9f'),'where':{'mobile':_0x10b0a1},'limit':0x1,'order':[[_0x50ed('0x7f'),_0x50ed('0x9d')]]}]}]})[_0x50ed('0x20')](handleEntityNotFound(_0x133c5f,null))['then'](function(_0xd5e9bc){if(_0xd5e9bc&&_0xd5e9bc[_0x50ed('0xca')]){_0x1192cd=_0xd5e9bc['get']({'plain':!![]});if(_0x1192cd[_0x50ed('0xca')]&&_0x1192cd[_0x50ed('0xca')][_0x50ed('0x9f')][_0x50ed('0x49')]){return _0x1192cd[_0x50ed('0xca')][_0x50ed('0x9f')][0x0];}return db[_0x50ed('0x7a')][_0x50ed('0x5a')](_['defaults'](_0x477eaa[_0x50ed('0x5b')],{'firstName':_0x10b0a1,'mobile':_0x10b0a1,'phone':_0x10b0a1,'ListId':_0x1192cd[_0x50ed('0x81')]}));}})['then'](handleEntityNotFound(_0x133c5f,null))[_0x50ed('0x20')](function(_0x4ef74d){if(_0x4ef74d){_0x164074=_0x4ef74d;return db['SmsInteraction'][_0x50ed('0x61')]({'where':{'ContactId':_0x164074['id'],'closed':![],'SmsAccountId':_0x1192cd['id']}})[_0x50ed('0x20')](function(_0x39ca94){if(_0x39ca94){return[_0x39ca94,![]];}return db[_0x50ed('0xa1')][_0x50ed('0x5a')]({'UserId':_0x477eaa['user']['id'],'ContactId':_0x164074['id'],'SmsAccountId':_0x1192cd['id'],'phone':_0x10b0a1,'firstMsgDirection':_0x50ed('0xcb'),'Messages':[_[_0x50ed('0x51')](_0x477eaa[_0x50ed('0x5b')],{'read':![],'body':_0x477eaa[_0x50ed('0x5b')][_0x50ed('0x5b')],'phone':_0x10b0a1,'SmsAccountId':_0x1192cd['id'],'UserId':_0x477eaa[_0x50ed('0x5c')]['id'],'ContactId':_0x164074['id']})]},{'include':[{'model':db[_0x50ed('0xaa')],'as':'Messages'}]})[_0x50ed('0x20')](function(_0x277b30){return[_0x277b30,!![]];});});}})[_0x50ed('0xa2')](function(_0x2cf3ea,_0x33b62d){if(_0x33b62d){return _0x2cf3ea;}return db[_0x50ed('0xaa')]['create'](_[_0x50ed('0x51')](_0x477eaa[_0x50ed('0x5b')],{'read':![],'body':_0x477eaa[_0x50ed('0x5b')][_0x50ed('0x5b')],'phone':_0x10b0a1,'SmsAccountId':_0x1192cd['id'],'SmsInteractionId':_0x2cf3ea['id'],'UserId':_0x477eaa[_0x50ed('0x5c')]['id'],'ContactId':_0x164074['id']}))['then'](function(_0x9a25c5){_0x2cf3ea[_0x50ed('0xcc')]['Messages']=[];_0x2cf3ea[_0x50ed('0xcc')]['Messages'][_0x50ed('0xa5')](_0x9a25c5[_0x50ed('0xcc')]);return _0x2cf3ea;});})[_0x50ed('0x20')](respondWithResult(_0x133c5f,null))[_0x50ed('0x57')](handleError(_0x133c5f,null));};exports[_0x50ed('0x2a')]=function(_0x117505,_0x183f95,_0xc2e5d4){if(_0x117505[_0x50ed('0x5b')]['id']){delete _0x117505[_0x50ed('0x5b')]['id'];}var _0x13357c,_0x4f66e5,_0x52a54d;return db['SmsAccount'][_0x50ed('0x61')]({'where':{'id':_0x117505[_0x50ed('0x64')]['id']}})[_0x50ed('0x20')](handleEntityNotFound(_0x183f95,null))[_0x50ed('0x20')](function(_0x30c380){if(_0x30c380){_0x52a54d=_0x30c380;logger[_0x50ed('0x24')](_0x50ed('0xb5'),_0x50ed('0x2a'),_0x50ed('0xcd'),_0x30c380[_0x50ed('0x41')],util[_0x50ed('0xce')](_0x117505[_0x50ed('0x5b')],{'showHidden':![],'depth':null}));switch(_0x30c380[_0x50ed('0x41')]){case _0x50ed('0x86'):if(_0x117505['body'][_0x50ed('0xcf')]&&_0x117505[_0x50ed('0x5b')][_0x50ed('0x2a')]){_0x4f66e5=_0x117505[_0x50ed('0x5b')]['status'];return db[_0x50ed('0xaa')][_0x50ed('0x61')]({'where':{'messageId':_0x117505[_0x50ed('0x5b')][_0x50ed('0xcf')]}});}break;case _0x50ed('0x89'):if(_0x117505['body'][_0x50ed('0xd0')]&&_0x117505[_0x50ed('0x5b')][_0x50ed('0xd1')]){_0x4f66e5=_0x117505[_0x50ed('0x5b')]['statusInt'];return db[_0x50ed('0xaa')][_0x50ed('0x61')]({'where':{'messageId':_0x117505[_0x50ed('0x5b')][_0x50ed('0xd0')]}});}break;case _0x50ed('0x8b'):if(_0x117505[_0x50ed('0x5b')][_0x50ed('0x8c')]&&_0x117505[_0x50ed('0x5b')][_0x50ed('0xd2')]){_0x4f66e5=_0x117505[_0x50ed('0x5b')][_0x50ed('0xd2')];return db[_0x50ed('0xaa')]['find']({'where':{'messageId':_0x117505['body']['message_id']}});}break;case _0x50ed('0x91'):var _0x5210d2=_0x117505[_0x50ed('0x5b')][_0x50ed('0x92')][0x0];if(_0x5210d2[_0x50ed('0x84')]&&_0x5210d2[_0x50ed('0x2a')][_0x50ed('0xd3')]===_0x50ed('0xd4')){_0x4f66e5=_0x5210d2[_0x50ed('0x2a')][_0x50ed('0xd3')];return db[_0x50ed('0xaa')]['find']({'where':{'messageId':_0x5210d2[_0x50ed('0x84')]}});}break;case _0x50ed('0x96'):if(_0x117505[_0x50ed('0x5b')][_0x50ed('0x84')]&&_0x117505[_0x50ed('0x5b')][_0x50ed('0x2a')]){_0x4f66e5=_0x117505[_0x50ed('0x5b')][_0x50ed('0x2a')];return db[_0x50ed('0xaa')]['find']({'where':{'messageId':_0x117505[_0x50ed('0x5b')][_0x50ed('0x84')]}});}break;case'bandwidth':if(_0x117505[_0x50ed('0x5b')][0x0]['message']['id']){_0x4f66e5=_0x117505[_0x50ed('0x5b')][0x0][_0x50ed('0x41')];return db[_0x50ed('0xaa')][_0x50ed('0x61')]({'where':{'messageId':_0x117505['body'][0x0][_0x50ed('0x28')]['id']}});}break;case _0x50ed('0x98'):if(_0x117505[_0x50ed('0x5b')]['redif']&&_0x117505[_0x50ed('0x5b')][_0x50ed('0x2a')]){_0x4f66e5=_0x117505[_0x50ed('0x5b')]['status'];return db['SmsMessage'][_0x50ed('0x61')]({'where':{'messageId':_0x117505[_0x50ed('0x5b')]['redif']}});}break;}}})[_0x50ed('0x20')](handleEntityNotFound(_0x183f95,null))[_0x50ed('0x20')](function(_0x9fdfb6){if(_0x9fdfb6){_0x13357c=_0x9fdfb6;switch(_0x52a54d[_0x50ed('0x41')]){case'skebby':if(_0x4f66e5===_0x50ed('0xd4')){return _0x13357c['update']({'read':!![]});}else{logger[_0x50ed('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x50ed('0x86'),util[_0x50ed('0xce')](_0x117505[_0x50ed('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x50ed('0x89'):if(_0x4f66e5==='1'){return _0x13357c['update']({'read':!![]});}else{logger[_0x50ed('0x26')](_0x50ed('0xb5'),_0x50ed('0x2a'),'skebby',util[_0x50ed('0xce')](_0x117505[_0x50ed('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x50ed('0x8b'):if(!_0x117505[_0x50ed('0x5b')][_0x50ed('0xd5')]&&_0x4f66e5>=0xc8&&_0x4f66e5<=0xce){return _0x13357c[_0x50ed('0x34')]({'read':!![]});}else{logger[_0x50ed('0x26')](_0x50ed('0xb5'),'status',_0x50ed('0x8b'),util[_0x50ed('0xce')](_0x117505['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x5705d8=_0x117505[_0x50ed('0x5b')][_0x50ed('0x92')][0x0];if(_0x5705d8[_0x50ed('0x2a')][_0x50ed('0xd3')]===_0x50ed('0xd4')){return _0x13357c[_0x50ed('0x34')]({'read':!![]});}else{logger['error'](_0x50ed('0xb5'),_0x50ed('0x2a'),_0x50ed('0x91'),util[_0x50ed('0xce')](_0x117505['body'],{'showHidden':![],'depth':null}));}break;case _0x50ed('0x96'):if(_0x4f66e5==_0x50ed('0xd6')||_0x4f66e5==_0x50ed('0xd7')){return _0x13357c[_0x50ed('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x50ed('0x2a'),'clickatell',util[_0x50ed('0xce')](_0x117505[_0x50ed('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x50ed('0x97'):if(_0x4f66e5==_0x50ed('0xd8')){return _0x13357c[_0x50ed('0x34')]({'read':!![]});}else{logger[_0x50ed('0x26')](_0x50ed('0xb5'),_0x50ed('0x2a'),_0x50ed('0x97'),util['inspect'](_0x117505[_0x50ed('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x50ed('0x98'):if(_0x4f66e5==='DELIVRD'||_0x4f66e5===_0x50ed('0xd9')){return _0x13357c['update']({'read':!![]});}else{logger[_0x50ed('0x26')](_0x50ed('0xb5'),_0x50ed('0x2a'),_0x50ed('0x98'),util['inspect'](_0x117505['body'],{'showHidden':![],'depth':null}));}break;}return _0x13357c;}})[_0x50ed('0x20')](respondWithResult(_0x183f95,null))['catch'](handleError(_0x183f95,null));};exports[_0x50ed('0xda')]=function(_0x21c554,_0x198e29,_0x3339d6){var _0x4d4c46,_0x2cde6e,_0x3003b4;return db[_0x50ed('0x3e')][_0x50ed('0x61')]({'where':{'id':_0x21c554[_0x50ed('0x64')]['id']}})[_0x50ed('0x20')](handleEntityNotFound(_0x198e29,null))[_0x50ed('0x20')](function(_0xcf342){if(_0xcf342){_0x3003b4=_0xcf342;logger[_0x50ed('0x24')](_0x50ed('0xb5'),'status','received\x20delivery\x20report\x20from',_0xcf342['type'],util[_0x50ed('0xce')](_0x21c554[_0x50ed('0x44')],{'showHidden':![],'depth':null}));switch(_0xcf342['type']){case _0x50ed('0x93'):if(_0x21c554['query'][_0x50ed('0xdb')]&&_0x21c554[_0x50ed('0x44')][_0x50ed('0xdc')]){_0x2cde6e=_0x21c554[_0x50ed('0x44')][_0x50ed('0xdc')];return db[_0x50ed('0xaa')][_0x50ed('0x61')]({'where':{'messageId':_0x21c554[_0x50ed('0x44')][_0x50ed('0xdb')]}});}break;}}})[_0x50ed('0x20')](handleEntityNotFound(_0x198e29,null))['then'](function(_0xc3a277){if(_0xc3a277){_0x4d4c46=_0xc3a277;switch(_0x3003b4[_0x50ed('0x41')]){case _0x50ed('0x93'):if(_0x2cde6e==='2'||_0x2cde6e==='6'){return _0x4d4c46[_0x50ed('0x34')]({'read':!![]});}else{logger[_0x50ed('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x50ed('0x2a'),'csc',util[_0x50ed('0xce')](_0x21c554[_0x50ed('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x4d4c46;}})['then'](respondWithResult(_0x198e29,null))[_0x50ed('0x57')](handleError(_0x198e29,null));};exports[_0x50ed('0xdd')]=function(_0x18092d,_0x5dbfa3,_0x386ee0){return db[_0x50ed('0x3e')][_0x50ed('0x61')]({'where':{'id':_0x18092d['params']['id']}})[_0x50ed('0x20')](handleEntityNotFound(_0x5dbfa3,null))[_0x50ed('0x20')](function(_0x2ee302){if(_0x2ee302){return _0x2ee302[_0x50ed('0xdd')](_0x18092d[_0x50ed('0x5b')][_0x50ed('0x6d')],_[_0x50ed('0xde')](_0x18092d['body'],[_0x50ed('0x6d'),'id'])||{})[_0x50ed('0xa2')](function(_0x4c0383){for(var _0x21cf27=0x0;_0x21cf27<_0x18092d[_0x50ed('0x5b')][_0x50ed('0x6d')][_0x50ed('0x49')];_0x21cf27+=0x1){socket[_0x50ed('0xdf')](_0x50ed('0xe0'),{'UserId':Number(_0x18092d[_0x50ed('0x5b')]['ids'][_0x21cf27]),'SmsAccountId':Number(_0x18092d[_0x50ed('0x64')]['id'])});}return _0x4c0383;});}})[_0x50ed('0x20')](respondWithResult(_0x5dbfa3,null))[_0x50ed('0x57')](handleError(_0x5dbfa3,null));};exports[_0x50ed('0xe1')]=function(_0x561f22,_0xc1b4b,_0x14fbfc){return db['SmsAccount'][_0x50ed('0x61')]({'where':{'id':_0x561f22['params']['id']}})[_0x50ed('0x20')](handleEntityNotFound(_0xc1b4b,null))['then'](function(_0x424357){if(_0x424357){return _0x424357[_0x50ed('0xe1')](_0x561f22[_0x50ed('0x44')][_0x50ed('0x6d')])[_0x50ed('0x20')](function(){if(_['isArray'](_0x561f22[_0x50ed('0x44')][_0x50ed('0x6d')])){for(var _0x59c489=0x0;_0x59c489<_0x561f22[_0x50ed('0x44')][_0x50ed('0x6d')][_0x50ed('0x49')];_0x59c489+=0x1){socket[_0x50ed('0xdf')]('userSmsAccount:remove',{'UserId':Number(_0x561f22[_0x50ed('0x44')][_0x50ed('0x6d')][_0x59c489]),'SmsAccountId':Number(_0x561f22[_0x50ed('0x64')]['id'])});}}else{socket[_0x50ed('0xdf')](_0x50ed('0xe2'),{'UserId':Number(_0x561f22[_0x50ed('0x44')][_0x50ed('0x6d')]),'SmsAccountId':Number(_0x561f22['params']['id'])});}});}})['then'](respondWithStatusCode(_0xc1b4b,null))['catch'](handleError(_0xc1b4b,null));};exports[_0x50ed('0xe3')]=function(_0x4b2f4,_0x257aaf,_0x229292){var _0x3c319c={};var _0xa9e785={};var _0x15fa68;var _0x15b1fd;return db['SmsAccount']['findOne']({'where':{'id':_0x4b2f4['params']['id']}})[_0x50ed('0x20')](handleEntityNotFound(_0x257aaf,null))[_0x50ed('0x20')](function(_0x89c3e1){if(_0x89c3e1){_0x15fa68=_0x89c3e1;_0xa9e785[_0x50ed('0x43')]=_[_0x50ed('0x45')](db[_0x50ed('0xae')][_0x50ed('0x3f')]);_0xa9e785[_0x50ed('0x44')]=_[_0x50ed('0x45')](_0x4b2f4['query']);_0xa9e785['filters']=_[_0x50ed('0x46')](_0xa9e785[_0x50ed('0x43')],_0xa9e785[_0x50ed('0x44')]);_0x3c319c[_0x50ed('0x47')]=_['intersection'](_0xa9e785[_0x50ed('0x43')],qs[_0x50ed('0x48')](_0x4b2f4[_0x50ed('0x44')][_0x50ed('0x48')]));_0x3c319c[_0x50ed('0x47')]=_0x3c319c[_0x50ed('0x47')][_0x50ed('0x49')]?_0x3c319c[_0x50ed('0x47')]:_0xa9e785[_0x50ed('0x43')];_0x3c319c[_0x50ed('0x6a')]=qs[_0x50ed('0x4c')](_0x4b2f4['query']['sort']);_0x3c319c[_0x50ed('0x50')]=qs[_0x50ed('0x4d')](_[_0x50ed('0x4e')](_0x4b2f4[_0x50ed('0x44')],_0xa9e785[_0x50ed('0x4d')]));if(_0x4b2f4[_0x50ed('0x44')][_0x50ed('0x4f')]){_0x3c319c[_0x50ed('0x50')]=_[_0x50ed('0x51')](_0x3c319c[_0x50ed('0x50')],{'$or':_[_0x50ed('0x3d')](_0x3c319c[_0x50ed('0x47')],function(_0x1119d4){var _0x340d1f={};_0x340d1f[_0x1119d4]={'$like':'%'+_0x4b2f4[_0x50ed('0x44')][_0x50ed('0x4f')]+'%'};return _0x340d1f;})});}_0x3c319c=_[_0x50ed('0x51')]({},_0x3c319c,_0x4b2f4[_0x50ed('0x53')]);return _0x15fa68['getAgents'](_0x3c319c);}})[_0x50ed('0x20')](function(_0x5591b4){if(_0x5591b4){_0x15b1fd=_0x5591b4[_0x50ed('0x49')];if(!_0x4b2f4[_0x50ed('0x44')][_0x50ed('0x4a')]('nolimit')){_0x3c319c[_0x50ed('0x2d')]=qs[_0x50ed('0x2d')](_0x4b2f4['query'][_0x50ed('0x2d')]);_0x3c319c['offset']=qs[_0x50ed('0x30')](_0x4b2f4['query'][_0x50ed('0x30')]);}return _0x15fa68['getAgents'](_0x3c319c);}})[_0x50ed('0x20')](function(_0x4dbcdd){if(_0x4dbcdd){return _0x4dbcdd?{'count':_0x15b1fd,'rows':_0x4dbcdd}:null;}})[_0x50ed('0x20')](respondWithResult(_0x257aaf,null))['catch'](handleError(_0x257aaf,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 28d5fbb..a9a015c 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 _0x50aa=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','SmsAccount'];(function(_0x334d52,_0x40d32b){var _0x32aacf=function(_0x2a904e){while(--_0x2a904e){_0x334d52['push'](_0x334d52['shift']());}};_0x32aacf(++_0x40d32b);}(_0x50aa,0xe7));var _0xa50a=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0x50aa[_0x1ab180];return _0xfb2c2d;};'use strict';var EventEmitter=require(_0xa50a('0x0'));var SmsAccount=require(_0xa50a('0x1'))['db'][_0xa50a('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa50a('0x3'),'afterUpdate':_0xa50a('0x4'),'afterDestroy':_0xa50a('0x5')};function emitEvent(_0x4b6149){return function(_0x37ffe5,_0x2c5b0c,_0x58465c){SmsAccountEvents[_0xa50a('0x6')](_0x4b6149+':'+_0x37ffe5['id'],_0x37ffe5);SmsAccountEvents['emit'](_0x4b6149,_0x37ffe5);_0x58465c(null);};}for(var e in events){if(events[_0xa50a('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xa50a('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x3302=['SmsAccount','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x56a7cb,_0xddcb23){var _0x20c921=function(_0x61aeab){while(--_0x61aeab){_0x56a7cb['push'](_0x56a7cb['shift']());}};_0x20c921(++_0xddcb23);}(_0x3302,0x116));var _0x2330=function(_0x3e2b49,_0x820a55){_0x3e2b49=_0x3e2b49-0x0;var _0x32ef8d=_0x3302[_0x3e2b49];return _0x32ef8d;};'use strict';var EventEmitter=require(_0x2330('0x0'));var SmsAccount=require(_0x2330('0x1'))['db'][_0x2330('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2330('0x3'),'afterUpdate':_0x2330('0x4'),'afterDestroy':_0x2330('0x5')};function emitEvent(_0xaf06c8){return function(_0x3ec180,_0x424d7c,_0x178929){SmsAccountEvents['emit'](_0xaf06c8+':'+_0x3ec180['id'],_0x3ec180);SmsAccountEvents[_0x2330('0x6')](_0xaf06c8,_0x3ec180);_0x178929(null);};}for(var e in events){if(events[_0x2330('0x7')](e)){var event=events[e];SmsAccount[_0x2330('0x8')](e,emitEvent(event));}}module[_0x2330('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 4e68a67..a952711 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 _0x7543=['../../config/environment','./smsAccount.attributes','exports','SmsAccount','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1f0531,_0x515d33){var _0x1b58fb=function(_0x3b6101){while(--_0x3b6101){_0x1f0531['push'](_0x1f0531['shift']());}};_0x1b58fb(++_0x515d33);}(_0x7543,0x1bc));var _0x3754=function(_0x28f4e2,_0x3f9280){_0x28f4e2=_0x28f4e2-0x0;var _0x3061fb=_0x7543[_0x28f4e2];return _0x3061fb;};'use strict';var _=require(_0x3754('0x0'));var util=require('util');var logger=require(_0x3754('0x1'))(_0x3754('0x2'));var moment=require(_0x3754('0x3'));var BPromise=require(_0x3754('0x4'));var rp=require(_0x3754('0x5'));var fs=require('fs');var path=require(_0x3754('0x6'));var rimraf=require('rimraf');var config=require(_0x3754('0x7'));var attributes=require(_0x3754('0x8'));module[_0x3754('0x9')]=function(_0xe6189c,_0x5cd731){return _0xe6189c['define'](_0x3754('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14a1=['../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','lodash','util','moment','request-promise','rimraf'];(function(_0x3c1cf1,_0x2b199f){var _0x651e2d=function(_0x417be6){while(--_0x417be6){_0x3c1cf1['push'](_0x3c1cf1['shift']());}};_0x651e2d(++_0x2b199f);}(_0x14a1,0x159));var _0x114a=function(_0x286f52,_0x865177){_0x286f52=_0x286f52-0x0;var _0x31aeff=_0x14a1[_0x286f52];return _0x31aeff;};'use strict';var _=require(_0x114a('0x0'));var util=require(_0x114a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x114a('0x2'));var BPromise=require('bluebird');var rp=require(_0x114a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x114a('0x4'));var config=require(_0x114a('0x5'));var attributes=require(_0x114a('0x6'));module['exports']=function(_0x1be14f,_0x4c57b8){return _0x1be14f[_0x114a('0x7')](_0x114a('0x8'),attributes,{'tableName':_0x114a('0x9'),'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 b9a05e3..1ac6f3e 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 _0xcea3=['request','then','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','SmsAccount,\x20%s,\x20%s','request\x20sent','result','SmsAccount','find','options','raw','include','attributes','map','model','ShowSmsAccount','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./smsAccount.socket','register'];(function(_0x17a558,_0xf2ca4b){var _0x27f950=function(_0x1012a8){while(--_0x1012a8){_0x17a558['push'](_0x17a558['shift']());}};_0x27f950(++_0xf2ca4b);}(_0xcea3,0x1d0));var _0x3cea=function(_0x5e035f,_0x3ad520){_0x5e035f=_0x5e035f-0x0;var _0x34c881=_0xcea3[_0x5e035f];return _0x34c881;};'use strict';var _=require(_0x3cea('0x0'));var util=require('util');var moment=require(_0x3cea('0x1'));var BPromise=require(_0x3cea('0x2'));var rs=require(_0x3cea('0x3'));var fs=require('fs');var Redis=require(_0x3cea('0x4'));var db=require(_0x3cea('0x5'))['db'];var utils=require(_0x3cea('0x6'));var logger=require(_0x3cea('0x7'))(_0x3cea('0x8'));var config=require(_0x3cea('0x9'));var jayson=require(_0x3cea('0xa'));var client=jayson[_0x3cea('0xb')][_0x3cea('0xc')]({'port':0x232a});config[_0x3cea('0xd')]=_['defaults'](config[_0x3cea('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x3cea('0xe'))(new Redis(config[_0x3cea('0xd')]));require(_0x3cea('0xf'))[_0x3cea('0x10')](socket);function respondWithRpcPromise(_0x5c88a4,_0x404c70,_0x2d73f9){return new BPromise(function(_0x17dc36,_0x174ac1){return client[_0x3cea('0x11')](_0x5c88a4,_0x2d73f9)[_0x3cea('0x12')](function(_0x13e6d9){logger['info']('SmsAccount,\x20%s,\x20%s',_0x404c70,'request\x20sent');logger[_0x3cea('0x13')](_0x3cea('0x14'),_0x404c70,'request\x20sent',JSON['stringify'](_0x13e6d9));if(_0x13e6d9[_0x3cea('0x15')]){if(_0x13e6d9['error'][_0x3cea('0x16')]===0x1f4){logger[_0x3cea('0x15')]('SmsAccount,\x20%s,\x20%s',_0x404c70,_0x13e6d9[_0x3cea('0x15')]['message']);return _0x174ac1(_0x13e6d9[_0x3cea('0x15')][_0x3cea('0x17')]);}logger['error'](_0x3cea('0x18'),_0x404c70,_0x13e6d9['error']['message']);return _0x17dc36(_0x13e6d9[_0x3cea('0x15')][_0x3cea('0x17')]);}else{logger['info'](_0x3cea('0x18'),_0x404c70,_0x3cea('0x19'));_0x17dc36(_0x13e6d9[_0x3cea('0x1a')][_0x3cea('0x17')]);}})['catch'](function(_0x948da4){logger[_0x3cea('0x15')](_0x3cea('0x18'),_0x404c70,_0x948da4);_0x174ac1(_0x948da4);});});}exports['ShowSmsAccount']=function(_0x2a5614){var _0x2b3234=this;return new Promise(function(_0x1754e7,_0x324904){return db[_0x3cea('0x1b')][_0x3cea('0x1c')]({'raw':_0x2a5614[_0x3cea('0x1d')]?_0x2a5614[_0x3cea('0x1d')][_0x3cea('0x1e')]===undefined?!![]:![]:!![],'where':_0x2a5614[_0x3cea('0x1d')]?_0x2a5614[_0x3cea('0x1d')]['where']||null:null,'attributes':_0x2a5614['options']?_0x2a5614[_0x3cea('0x1d')]['attributes']||null:null,'include':_0x2a5614[_0x3cea('0x1d')]?_0x2a5614[_0x3cea('0x1d')][_0x3cea('0x1f')]?_['map'](_0x2a5614[_0x3cea('0x1d')][_0x3cea('0x1f')],function(_0x1a08ff){return{'model':db[_0x1a08ff['model']],'as':_0x1a08ff['as'],'attributes':_0x1a08ff[_0x3cea('0x20')],'include':_0x1a08ff[_0x3cea('0x1f')]?_[_0x3cea('0x21')](_0x1a08ff['include'],function(_0x35037c){return{'model':db[_0x35037c[_0x3cea('0x22')]],'as':_0x35037c['as'],'attributes':_0x35037c[_0x3cea('0x20')],'include':_0x35037c[_0x3cea('0x1f')]?_[_0x3cea('0x21')](_0x35037c[_0x3cea('0x1f')],function(_0x577bc5){return{'model':db[_0x577bc5['model']],'as':_0x577bc5['as'],'attributes':_0x577bc5[_0x3cea('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f31e7){logger['info'](_0x3cea('0x23'),_0x2a5614);logger['debug'](_0x3cea('0x23'),_0x2a5614,JSON['stringify'](_0x5f31e7));_0x1754e7(_0x5f31e7);})[_0x3cea('0x24')](function(_0x3413ac){logger[_0x3cea('0x15')](_0x3cea('0x23'),_0x3413ac['message'],_0x2a5614);_0x324904(_0x2b3234[_0x3cea('0x15')](0x1f4,_0x3413ac['message']));});});}; \ No newline at end of file +var _0x4c5d=['jayson/promise','client','http','redis','defaults','./smsAccount.socket','register','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','SmsAccount','find','options','where','include','map','model','attributes','then','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x57db73,_0x59171e){var _0x5b0c39=function(_0x3db350){while(--_0x3db350){_0x57db73['push'](_0x57db73['shift']());}};_0x5b0c39(++_0x59171e);}(_0x4c5d,0x1c0));var _0xd4c5=function(_0x12d424,_0x2bf675){_0x12d424=_0x12d424-0x0;var _0xc68108=_0x4c5d[_0x12d424];return _0xc68108;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd4c5('0x0'));var BPromise=require(_0xd4c5('0x1'));var rs=require(_0xd4c5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4c5('0x3'))['db'];var utils=require(_0xd4c5('0x4'));var logger=require(_0xd4c5('0x5'))(_0xd4c5('0x6'));var config=require('../../config/environment');var jayson=require(_0xd4c5('0x7'));var client=jayson[_0xd4c5('0x8')][_0xd4c5('0x9')]({'port':0x232a});config[_0xd4c5('0xa')]=_[_0xd4c5('0xb')](config[_0xd4c5('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd4c5('0xa')]));require(_0xd4c5('0xc'))[_0xd4c5('0xd')](socket);function respondWithRpcPromise(_0x11b2ae,_0x465fd1,_0x219a2a){return new BPromise(function(_0x175a00,_0x55c12f){return client['request'](_0x11b2ae,_0x219a2a)['then'](function(_0xf7d044){logger[_0xd4c5('0xe')]('SmsAccount,\x20%s,\x20%s',_0x465fd1,_0xd4c5('0xf'));logger[_0xd4c5('0x10')](_0xd4c5('0x11'),_0x465fd1,_0xd4c5('0xf'),JSON[_0xd4c5('0x12')](_0xf7d044));if(_0xf7d044['error']){if(_0xf7d044[_0xd4c5('0x13')][_0xd4c5('0x14')]===0x1f4){logger[_0xd4c5('0x13')](_0xd4c5('0x15'),_0x465fd1,_0xf7d044[_0xd4c5('0x13')]['message']);return _0x55c12f(_0xf7d044['error']['message']);}logger['error'](_0xd4c5('0x15'),_0x465fd1,_0xf7d044[_0xd4c5('0x13')][_0xd4c5('0x16')]);return _0x175a00(_0xf7d044[_0xd4c5('0x13')][_0xd4c5('0x16')]);}else{logger[_0xd4c5('0xe')](_0xd4c5('0x15'),_0x465fd1,_0xd4c5('0xf'));_0x175a00(_0xf7d044[_0xd4c5('0x17')][_0xd4c5('0x16')]);}})[_0xd4c5('0x18')](function(_0x3164ed){logger[_0xd4c5('0x13')](_0xd4c5('0x15'),_0x465fd1,_0x3164ed);_0x55c12f(_0x3164ed);});});}exports[_0xd4c5('0x19')]=function(_0xa387c4){var _0x3e2238=this;return new Promise(function(_0x3ca9bc,_0x1642da){return db[_0xd4c5('0x1a')][_0xd4c5('0x1b')]({'raw':_0xa387c4[_0xd4c5('0x1c')]?_0xa387c4[_0xd4c5('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xa387c4[_0xd4c5('0x1c')]?_0xa387c4['options'][_0xd4c5('0x1d')]||null:null,'attributes':_0xa387c4[_0xd4c5('0x1c')]?_0xa387c4['options']['attributes']||null:null,'include':_0xa387c4[_0xd4c5('0x1c')]?_0xa387c4[_0xd4c5('0x1c')][_0xd4c5('0x1e')]?_[_0xd4c5('0x1f')](_0xa387c4[_0xd4c5('0x1c')]['include'],function(_0x42faa9){return{'model':db[_0x42faa9[_0xd4c5('0x20')]],'as':_0x42faa9['as'],'attributes':_0x42faa9['attributes'],'include':_0x42faa9[_0xd4c5('0x1e')]?_[_0xd4c5('0x1f')](_0x42faa9[_0xd4c5('0x1e')],function(_0x5dc87f){return{'model':db[_0x5dc87f['model']],'as':_0x5dc87f['as'],'attributes':_0x5dc87f[_0xd4c5('0x21')],'include':_0x5dc87f[_0xd4c5('0x1e')]?_[_0xd4c5('0x1f')](_0x5dc87f[_0xd4c5('0x1e')],function(_0x1bb306){return{'model':db[_0x1bb306[_0xd4c5('0x20')]],'as':_0x1bb306['as'],'attributes':_0x1bb306[_0xd4c5('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd4c5('0x22')](function(_0x3255bd){logger['info'](_0xd4c5('0x19'),_0xa387c4);logger[_0xd4c5('0x10')](_0xd4c5('0x19'),_0xa387c4,JSON[_0xd4c5('0x12')](_0x3255bd));_0x3ca9bc(_0x3255bd);})[_0xd4c5('0x18')](function(_0x38ec52){logger[_0xd4c5('0x13')](_0xd4c5('0x19'),_0x38ec52['message'],_0xa387c4);_0x1642da(_0x3e2238[_0xd4c5('0x13')](0x1f4,_0x38ec52[_0xd4c5('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 30c8d1d..ca62b00 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 f4fb41e..c8d0607 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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x3452a8,_0x4bfaa4){var _0x233814=function(_0x40b537){while(--_0x40b537){_0x3452a8['push'](_0x3452a8['shift']());}};_0x233814(++_0x4bfaa4);}(_0x3e74,0x175));var _0x43e7=function(_0x263746,_0x5ed172){_0x263746=_0x263746-0x0;var _0x4814eb=_0x3e74[_0x263746];return _0x4814eb;};'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 diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 1af2e15..0a27e81 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 _0x7575=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x4700fa,_0x3b46ca){var _0x4926e4=function(_0x2c58be){while(--_0x2c58be){_0x4700fa['push'](_0x4700fa['shift']());}};_0x4926e4(++_0x3b46ca);}(_0x7575,0xb1));var _0x5757=function(_0x586d90,_0x3081aa){_0x586d90=_0x586d90-0x0;var _0x1a1703=_0x7575[_0x586d90];return _0x1a1703;};'use strict';var Sequelize=require(_0x5757('0x0'));module['exports']={'priority':{'type':Sequelize[_0x5757('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5757('0x2')],'allowNull':![],'defaultValue':_0x5757('0x3')},'appdata':{'type':Sequelize[_0x5757('0x4')]()},'description':{'type':Sequelize[_0x5757('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x5757('0x5')}}; \ No newline at end of file +var _0x2875=['*,*,*,*','sequelize','STRING','noop'];(function(_0x42cd79,_0xb9e647){var _0x3cb89e=function(_0x11476c){while(--_0x11476c){_0x42cd79['push'](_0x42cd79['shift']());}};_0x3cb89e(++_0xb9e647);}(_0x2875,0x85));var _0x5287=function(_0x77fcad,_0xeebb41){_0x77fcad=_0x77fcad-0x0;var _0x3d032e=_0x2875[_0x77fcad];return _0x3d032e;};'use strict';var Sequelize=require(_0x5287('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5287('0x1')],'allowNull':![],'defaultValue':_0x5287('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5287('0x1')]},'interval':{'type':Sequelize[_0x5287('0x1')],'defaultValue':_0x5287('0x3')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 3a5fde8..f3afd4f 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 _0x77b6=['../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','then','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2a23ae,_0x39b344){var _0x565d60=function(_0x196812){while(--_0x196812){_0x2a23ae['push'](_0x2a23ae['shift']());}};_0x565d60(++_0x39b344);}(_0x77b6,0x121));var _0x677b=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x77b6[_0x138f59];return _0x3d114d;};'use strict';var emlformat=require(_0x677b('0x0'));var rimraf=require(_0x677b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x677b('0x2'));var rp=require(_0x677b('0x3'));var moment=require(_0x677b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x677b('0x5'));var util=require(_0x677b('0x6'));var path=require(_0x677b('0x7'));var sox=require('sox');var csv=require(_0x677b('0x8'));var ejs=require(_0x677b('0x9'));var fs=require('fs');var fs_extra=require(_0x677b('0xa'));var _=require(_0x677b('0xb'));var squel=require(_0x677b('0xc'));var crypto=require(_0x677b('0xd'));var jsforce=require(_0x677b('0xe'));var deskjs=require(_0x677b('0xf'));var toCsv=require(_0x677b('0x8'));var querystring=require(_0x677b('0x10'));var Papa=require('papaparse');var Redis=require(_0x677b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x677b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x677b('0x13'))(_0x677b('0x14'));var utils=require(_0x677b('0x15'));var config=require(_0x677b('0x16'));var licenseUtil=require(_0x677b('0x17'));var db=require(_0x677b('0x18'))['db'];function respondWithStatusCode(_0x42646a,_0x30366e){_0x30366e=_0x30366e||0xcc;return function(_0x504191){if(_0x504191){return _0x42646a[_0x677b('0x19')](_0x30366e);}return _0x42646a[_0x677b('0x1a')](_0x30366e)[_0x677b('0x1b')]();};}function respondWithResult(_0x37e414,_0x1f2e5c){_0x1f2e5c=_0x1f2e5c||0xc8;return function(_0xcb58fd){if(_0xcb58fd){return _0x37e414[_0x677b('0x1a')](_0x1f2e5c)['json'](_0xcb58fd);}};}function respondWithFilteredResult(_0x4d9ffb,_0x363ff0){return function(_0x4bc305){if(_0x4bc305){var _0x19e394=typeof _0x363ff0[_0x677b('0x1c')]===_0x677b('0x1d')&&typeof _0x363ff0[_0x677b('0x1e')]==='undefined';var _0x1b285d=_0x4bc305[_0x677b('0x1f')];var _0x305148=_0x19e394?0x0:_0x363ff0[_0x677b('0x1c')];var _0x4e8770=_0x19e394?_0x4bc305[_0x677b('0x1f')]:_0x363ff0[_0x677b('0x1c')]+_0x363ff0[_0x677b('0x1e')];var _0x12bade;if(_0x4e8770>=_0x1b285d){_0x4e8770=_0x1b285d;_0x12bade=0xc8;}else{_0x12bade=0xce;}_0x4d9ffb['status'](_0x12bade);return _0x4d9ffb[_0x677b('0x20')](_0x677b('0x21'),_0x305148+'-'+_0x4e8770+'/'+_0x1b285d)[_0x677b('0x22')](_0x4bc305);}return null;};}function patchUpdates(_0x36c5b8){return function(_0x345d28){try{jsonpatch[_0x677b('0x23')](_0x345d28,_0x36c5b8,!![]);}catch(_0x170870){return BPromise['reject'](_0x170870);}return _0x345d28[_0x677b('0x24')]();};}function saveUpdates(_0x39c4a7,_0x207b0a){return function(_0x32645f){if(_0x32645f){return _0x32645f[_0x677b('0x25')](_0x39c4a7)['then'](function(_0x1cf6ec){return _0x1cf6ec;});}return null;};}function removeEntity(_0x70c3b,_0x53c668){return function(_0x97afc7){if(_0x97afc7){return _0x97afc7[_0x677b('0x26')]()[_0x677b('0x27')](function(){_0x70c3b[_0x677b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34fcae,_0x24678a){return function(_0x5f562d){if(!_0x5f562d){_0x34fcae[_0x677b('0x19')](0x194);}return _0x5f562d;};}function handleError(_0x513de9,_0x8359b0){_0x8359b0=_0x8359b0||0x1f4;return function(_0x4e74cc){logger[_0x677b('0x28')](_0x4e74cc[_0x677b('0x29')]);if(_0x4e74cc[_0x677b('0x2a')]){delete _0x4e74cc[_0x677b('0x2a')];}_0x513de9[_0x677b('0x1a')](_0x8359b0)[_0x677b('0x2b')](_0x4e74cc);};}exports[_0x677b('0x2c')]=function(_0x54a4b1,_0x465c74){var _0x221554={},_0x59bd73={},_0x46414d={'count':0x0,'rows':[]};var _0x3dc448=_[_0x677b('0x2d')](db[_0x677b('0x2e')][_0x677b('0x2f')],function(_0x4aa391){return{'name':_0x4aa391[_0x677b('0x30')],'type':_0x4aa391[_0x677b('0x31')][_0x677b('0x32')]};});_0x59bd73[_0x677b('0x33')]=_[_0x677b('0x2d')](_0x3dc448,_0x677b('0x2a'));_0x59bd73['query']=_[_0x677b('0x34')](_0x54a4b1[_0x677b('0x35')]);_0x59bd73[_0x677b('0x36')]=_[_0x677b('0x37')](_0x59bd73[_0x677b('0x33')],_0x59bd73[_0x677b('0x35')]);_0x221554[_0x677b('0x38')]=_[_0x677b('0x37')](_0x59bd73[_0x677b('0x33')],qs[_0x677b('0x39')](_0x54a4b1['query'][_0x677b('0x39')]));_0x221554['attributes']=_0x221554[_0x677b('0x38')][_0x677b('0x3a')]?_0x221554['attributes']:_0x59bd73[_0x677b('0x33')];if(!_0x54a4b1[_0x677b('0x35')][_0x677b('0x3b')](_0x677b('0x3c'))){_0x221554[_0x677b('0x1e')]=qs[_0x677b('0x1e')](_0x54a4b1[_0x677b('0x35')]['limit']);_0x221554['offset']=qs[_0x677b('0x1c')](_0x54a4b1[_0x677b('0x35')]['offset']);}_0x221554[_0x677b('0x3d')]=qs[_0x677b('0x3e')](_0x54a4b1[_0x677b('0x35')][_0x677b('0x3e')]);_0x221554[_0x677b('0x3f')]=qs[_0x677b('0x36')](_[_0x677b('0x40')](_0x54a4b1[_0x677b('0x35')],_0x59bd73[_0x677b('0x36')]),_0x3dc448);if(_0x54a4b1[_0x677b('0x35')][_0x677b('0x41')]){_0x221554[_0x677b('0x3f')]=_[_0x677b('0x42')](_0x221554[_0x677b('0x3f')],{'$or':_[_0x677b('0x2d')](_0x3dc448,function(_0xc971ed){if(_0xc971ed[_0x677b('0x31')]!==_0x677b('0x43')){var _0x171e60={};_0x171e60[_0xc971ed[_0x677b('0x2a')]]={'$like':'%'+_0x54a4b1[_0x677b('0x35')][_0x677b('0x41')]+'%'};return _0x171e60;}})});}_0x221554=_[_0x677b('0x42')]({},_0x221554,_0x54a4b1[_0x677b('0x44')]);var _0xb4faad={'where':_0x221554[_0x677b('0x3f')]};return db[_0x677b('0x2e')][_0x677b('0x1f')](_0xb4faad)['then'](function(_0x2c1298){_0x46414d['count']=_0x2c1298;if(_0x54a4b1['query'][_0x677b('0x45')]){_0x221554[_0x677b('0x46')]=[{'all':!![]}];}return db['SmsApplication'][_0x677b('0x47')](_0x221554);})['then'](function(_0xd9ae94){_0x46414d[_0x677b('0x48')]=_0xd9ae94;return _0x46414d;})[_0x677b('0x27')](respondWithFilteredResult(_0x465c74,_0x221554))['catch'](handleError(_0x465c74,null));};exports['show']=function(_0x31d0be,_0x2143a4){var _0x26f0a1={'raw':!![],'where':{'id':_0x31d0be[_0x677b('0x49')]['id']}},_0x4db7ec={};_0x4db7ec['model']=_[_0x677b('0x34')](db[_0x677b('0x2e')][_0x677b('0x2f')]);_0x4db7ec['query']=_['keys'](_0x31d0be[_0x677b('0x35')]);_0x4db7ec[_0x677b('0x36')]=_['intersection'](_0x4db7ec['model'],_0x4db7ec[_0x677b('0x35')]);_0x26f0a1['attributes']=_['intersection'](_0x4db7ec[_0x677b('0x33')],qs[_0x677b('0x39')](_0x31d0be[_0x677b('0x35')][_0x677b('0x39')]));_0x26f0a1['attributes']=_0x26f0a1[_0x677b('0x38')][_0x677b('0x3a')]?_0x26f0a1[_0x677b('0x38')]:_0x4db7ec['model'];if(_0x31d0be[_0x677b('0x35')][_0x677b('0x45')]){_0x26f0a1[_0x677b('0x46')]=[{'all':!![]}];}_0x26f0a1=_['merge']({},_0x26f0a1,_0x31d0be[_0x677b('0x44')]);return db[_0x677b('0x2e')][_0x677b('0x4a')](_0x26f0a1)['then'](handleEntityNotFound(_0x2143a4,null))[_0x677b('0x27')](respondWithResult(_0x2143a4,null))[_0x677b('0x4b')](handleError(_0x2143a4,null));};exports[_0x677b('0x4c')]=function(_0x29a9e2,_0x5b4904){return db[_0x677b('0x2e')][_0x677b('0x4c')](_0x29a9e2[_0x677b('0x4d')],{})[_0x677b('0x27')](respondWithResult(_0x5b4904,0xc9))['catch'](handleError(_0x5b4904,null));};exports['update']=function(_0x6fd366,_0x23aaf0){if(_0x6fd366['body']['id']){delete _0x6fd366[_0x677b('0x4d')]['id'];}return db[_0x677b('0x2e')][_0x677b('0x4a')]({'where':{'id':_0x6fd366['params']['id']}})[_0x677b('0x27')](handleEntityNotFound(_0x23aaf0,null))[_0x677b('0x27')](saveUpdates(_0x6fd366[_0x677b('0x4d')],null))[_0x677b('0x27')](respondWithResult(_0x23aaf0,null))['catch'](handleError(_0x23aaf0,null));};exports[_0x677b('0x26')]=function(_0x3d7984,_0x9d549d){return db[_0x677b('0x2e')][_0x677b('0x4a')]({'where':{'id':_0x3d7984['params']['id']}})[_0x677b('0x27')](handleEntityNotFound(_0x9d549d,null))['then'](removeEntity(_0x9d549d,null))[_0x677b('0x4b')](handleError(_0x9d549d,null));}; \ No newline at end of file +var _0xdc43=['moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','apply','reject','then','error','stack','send','index','map','SmsApplication','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge','where','type','VIRTUAL','count','catch','show','params','includeAll','options','create','body','update','find','destroy','eml-format','zip-dir','fast-json-patch'];(function(_0x31752d,_0x2efff8){var _0x29da67=function(_0x296d74){while(--_0x296d74){_0x31752d['push'](_0x31752d['shift']());}};_0x29da67(++_0x2efff8);}(_0xdc43,0x19b));var _0x3dc4=function(_0x55ea43,_0x31605c){_0x55ea43=_0x55ea43-0x0;var _0x394afb=_0xdc43[_0x55ea43];return _0x394afb;};'use strict';var emlformat=require(_0x3dc4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3dc4('0x1'));var jsonpatch=require(_0x3dc4('0x2'));var rp=require('request-promise');var moment=require(_0x3dc4('0x3'));var BPromise=require(_0x3dc4('0x4'));var Mustache=require(_0x3dc4('0x5'));var util=require(_0x3dc4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3dc4('0x7'));var ejs=require(_0x3dc4('0x8'));var fs=require('fs');var fs_extra=require(_0x3dc4('0x9'));var _=require('lodash');var squel=require(_0x3dc4('0xa'));var crypto=require(_0x3dc4('0xb'));var jsforce=require(_0x3dc4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3dc4('0x7'));var querystring=require(_0x3dc4('0xd'));var Papa=require(_0x3dc4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3dc4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3dc4('0x10'));var logger=require(_0x3dc4('0x11'))(_0x3dc4('0x12'));var utils=require('../../config/utils');var config=require(_0x3dc4('0x13'));var licenseUtil=require(_0x3dc4('0x14'));var db=require(_0x3dc4('0x15'))['db'];function respondWithStatusCode(_0x52cd39,_0x4118bc){_0x4118bc=_0x4118bc||0xcc;return function(_0x42d325){if(_0x42d325){return _0x52cd39[_0x3dc4('0x16')](_0x4118bc);}return _0x52cd39['status'](_0x4118bc)[_0x3dc4('0x17')]();};}function respondWithResult(_0x3d637a,_0x469392){_0x469392=_0x469392||0xc8;return function(_0x286fa7){if(_0x286fa7){return _0x3d637a[_0x3dc4('0x18')](_0x469392)[_0x3dc4('0x19')](_0x286fa7);}};}function respondWithFilteredResult(_0x109757,_0x982765){return function(_0x72ffc4){if(_0x72ffc4){var _0x559bfc=typeof _0x982765[_0x3dc4('0x1a')]===_0x3dc4('0x1b')&&typeof _0x982765[_0x3dc4('0x1c')]===_0x3dc4('0x1b');var _0x31df76=_0x72ffc4['count'];var _0x116f7c=_0x559bfc?0x0:_0x982765['offset'];var _0x5a1afb=_0x559bfc?_0x72ffc4['count']:_0x982765[_0x3dc4('0x1a')]+_0x982765['limit'];var _0x421870;if(_0x5a1afb>=_0x31df76){_0x5a1afb=_0x31df76;_0x421870=0xc8;}else{_0x421870=0xce;}_0x109757['status'](_0x421870);return _0x109757['set'](_0x3dc4('0x1d'),_0x116f7c+'-'+_0x5a1afb+'/'+_0x31df76)[_0x3dc4('0x19')](_0x72ffc4);}return null;};}function patchUpdates(_0x5efe7f){return function(_0x1ed126){try{jsonpatch[_0x3dc4('0x1e')](_0x1ed126,_0x5efe7f,!![]);}catch(_0x219e4b){return BPromise[_0x3dc4('0x1f')](_0x219e4b);}return _0x1ed126['save']();};}function saveUpdates(_0x8950b0,_0x40863d){return function(_0x4edabf){if(_0x4edabf){return _0x4edabf['update'](_0x8950b0)[_0x3dc4('0x20')](function(_0x3ade21){return _0x3ade21;});}return null;};}function removeEntity(_0x4ab3ef,_0x3b5f8e){return function(_0x294bd4){if(_0x294bd4){return _0x294bd4['destroy']()[_0x3dc4('0x20')](function(){_0x4ab3ef[_0x3dc4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cd56a,_0x53b74d){return function(_0x62ba93){if(!_0x62ba93){_0x5cd56a[_0x3dc4('0x16')](0x194);}return _0x62ba93;};}function handleError(_0x3b39b3,_0x56b7b3){_0x56b7b3=_0x56b7b3||0x1f4;return function(_0xbfbcd4){logger[_0x3dc4('0x21')](_0xbfbcd4[_0x3dc4('0x22')]);if(_0xbfbcd4['name']){delete _0xbfbcd4['name'];}_0x3b39b3[_0x3dc4('0x18')](_0x56b7b3)[_0x3dc4('0x23')](_0xbfbcd4);};}exports[_0x3dc4('0x24')]=function(_0x507738,_0x4e05ac){var _0x1fb5e0={},_0x35a4f3={},_0x5ac952={'count':0x0,'rows':[]};var _0x375520=_[_0x3dc4('0x25')](db[_0x3dc4('0x26')][_0x3dc4('0x27')],function(_0x52490f){return{'name':_0x52490f[_0x3dc4('0x28')],'type':_0x52490f['type'][_0x3dc4('0x29')]};});_0x35a4f3[_0x3dc4('0x2a')]=_[_0x3dc4('0x25')](_0x375520,_0x3dc4('0x2b'));_0x35a4f3[_0x3dc4('0x2c')]=_[_0x3dc4('0x2d')](_0x507738[_0x3dc4('0x2c')]);_0x35a4f3[_0x3dc4('0x2e')]=_[_0x3dc4('0x2f')](_0x35a4f3[_0x3dc4('0x2a')],_0x35a4f3[_0x3dc4('0x2c')]);_0x1fb5e0[_0x3dc4('0x30')]=_[_0x3dc4('0x2f')](_0x35a4f3['model'],qs[_0x3dc4('0x31')](_0x507738[_0x3dc4('0x2c')][_0x3dc4('0x31')]));_0x1fb5e0[_0x3dc4('0x30')]=_0x1fb5e0['attributes'][_0x3dc4('0x32')]?_0x1fb5e0['attributes']:_0x35a4f3[_0x3dc4('0x2a')];if(!_0x507738[_0x3dc4('0x2c')]['hasOwnProperty'](_0x3dc4('0x33'))){_0x1fb5e0[_0x3dc4('0x1c')]=qs[_0x3dc4('0x1c')](_0x507738[_0x3dc4('0x2c')][_0x3dc4('0x1c')]);_0x1fb5e0[_0x3dc4('0x1a')]=qs[_0x3dc4('0x1a')](_0x507738[_0x3dc4('0x2c')]['offset']);}_0x1fb5e0[_0x3dc4('0x34')]=qs['sort'](_0x507738[_0x3dc4('0x2c')]['sort']);_0x1fb5e0['where']=qs['filters'](_['pick'](_0x507738[_0x3dc4('0x2c')],_0x35a4f3[_0x3dc4('0x2e')]),_0x375520);if(_0x507738[_0x3dc4('0x2c')][_0x3dc4('0x35')]){_0x1fb5e0['where']=_[_0x3dc4('0x36')](_0x1fb5e0[_0x3dc4('0x37')],{'$or':_['map'](_0x375520,function(_0x551cb8){if(_0x551cb8[_0x3dc4('0x38')]!==_0x3dc4('0x39')){var _0xd9da2c={};_0xd9da2c[_0x551cb8[_0x3dc4('0x2b')]]={'$like':'%'+_0x507738[_0x3dc4('0x2c')][_0x3dc4('0x35')]+'%'};return _0xd9da2c;}})});}_0x1fb5e0=_[_0x3dc4('0x36')]({},_0x1fb5e0,_0x507738['options']);var _0x4ead28={'where':_0x1fb5e0[_0x3dc4('0x37')]};return db[_0x3dc4('0x26')]['count'](_0x4ead28)[_0x3dc4('0x20')](function(_0x110c4a){_0x5ac952[_0x3dc4('0x3a')]=_0x110c4a;if(_0x507738[_0x3dc4('0x2c')]['includeAll']){_0x1fb5e0['include']=[{'all':!![]}];}return db[_0x3dc4('0x26')]['findAll'](_0x1fb5e0);})['then'](function(_0x8c942b){_0x5ac952['rows']=_0x8c942b;return _0x5ac952;})[_0x3dc4('0x20')](respondWithFilteredResult(_0x4e05ac,_0x1fb5e0))[_0x3dc4('0x3b')](handleError(_0x4e05ac,null));};exports[_0x3dc4('0x3c')]=function(_0x376455,_0x4943ec){var _0x3f1853={'raw':!![],'where':{'id':_0x376455[_0x3dc4('0x3d')]['id']}},_0x5c4ee8={};_0x5c4ee8[_0x3dc4('0x2a')]=_[_0x3dc4('0x2d')](db[_0x3dc4('0x26')]['rawAttributes']);_0x5c4ee8[_0x3dc4('0x2c')]=_[_0x3dc4('0x2d')](_0x376455[_0x3dc4('0x2c')]);_0x5c4ee8['filters']=_[_0x3dc4('0x2f')](_0x5c4ee8['model'],_0x5c4ee8[_0x3dc4('0x2c')]);_0x3f1853[_0x3dc4('0x30')]=_[_0x3dc4('0x2f')](_0x5c4ee8[_0x3dc4('0x2a')],qs[_0x3dc4('0x31')](_0x376455[_0x3dc4('0x2c')][_0x3dc4('0x31')]));_0x3f1853['attributes']=_0x3f1853[_0x3dc4('0x30')][_0x3dc4('0x32')]?_0x3f1853[_0x3dc4('0x30')]:_0x5c4ee8[_0x3dc4('0x2a')];if(_0x376455[_0x3dc4('0x2c')][_0x3dc4('0x3e')]){_0x3f1853['include']=[{'all':!![]}];}_0x3f1853=_[_0x3dc4('0x36')]({},_0x3f1853,_0x376455[_0x3dc4('0x3f')]);return db['SmsApplication']['find'](_0x3f1853)[_0x3dc4('0x20')](handleEntityNotFound(_0x4943ec,null))[_0x3dc4('0x20')](respondWithResult(_0x4943ec,null))[_0x3dc4('0x3b')](handleError(_0x4943ec,null));};exports['create']=function(_0x34d721,_0x4de88c){return db[_0x3dc4('0x26')][_0x3dc4('0x40')](_0x34d721[_0x3dc4('0x41')],{})['then'](respondWithResult(_0x4de88c,0xc9))['catch'](handleError(_0x4de88c,null));};exports[_0x3dc4('0x42')]=function(_0x49c9a8,_0x16feb3){if(_0x49c9a8[_0x3dc4('0x41')]['id']){delete _0x49c9a8[_0x3dc4('0x41')]['id'];}return db['SmsApplication'][_0x3dc4('0x43')]({'where':{'id':_0x49c9a8['params']['id']}})[_0x3dc4('0x20')](handleEntityNotFound(_0x16feb3,null))[_0x3dc4('0x20')](saveUpdates(_0x49c9a8['body'],null))[_0x3dc4('0x20')](respondWithResult(_0x16feb3,null))[_0x3dc4('0x3b')](handleError(_0x16feb3,null));};exports[_0x3dc4('0x44')]=function(_0xecacfc,_0x2760d7){return db[_0x3dc4('0x26')]['find']({'where':{'id':_0xecacfc[_0x3dc4('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2760d7,null))['then'](removeEntity(_0x2760d7,null))[_0x3dc4('0x3b')](handleError(_0x2760d7,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index a8c5c4e..ca7d2a9 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 _0xc7a3=['moment','bluebird','rimraf','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x5c7770,_0x4e1863){var _0x4c7195=function(_0x1907f4){while(--_0x1907f4){_0x5c7770['push'](_0x5c7770['shift']());}};_0x4c7195(++_0x4e1863);}(_0xc7a3,0x182));var _0x3c7a=function(_0x2178ec,_0x1f4c66){_0x2178ec=_0x2178ec-0x0;var _0x117c34=_0xc7a3[_0x2178ec];return _0x117c34;};'use strict';var _=require(_0x3c7a('0x0'));var util=require(_0x3c7a('0x1'));var logger=require(_0x3c7a('0x2'))(_0x3c7a('0x3'));var moment=require(_0x3c7a('0x4'));var BPromise=require(_0x3c7a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3c7a('0x6'));var config=require(_0x3c7a('0x7'));var attributes=require('./smsApplication.attributes');module[_0x3c7a('0x8')]=function(_0x4d7b60,_0x1f2567){return _0x4d7b60[_0x3c7a('0x9')](_0x3c7a('0xa'),attributes,{'tableName':_0x3c7a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3c7a('0xc')});}; \ No newline at end of file +var _0x00bb=['SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./smsApplication.attributes','define'];(function(_0x45d80c,_0x35c0ff){var _0x449a98=function(_0x1b5ab7){while(--_0x1b5ab7){_0x45d80c['push'](_0x45d80c['shift']());}};_0x449a98(++_0x35c0ff);}(_0x00bb,0x1d8));var _0xb00b=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x00bb[_0x33032e];return _0x13316b;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb00b('0xb'),'collate':_0xb00b('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index ab1b671..620c14e 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 _0x9b09=['SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x1b4f25,_0x387b6c){var _0x3491f2=function(_0xbc1629){while(--_0xbc1629){_0x1b4f25['push'](_0x1b4f25['shift']());}};_0x3491f2(++_0x387b6c);}(_0x9b09,0x1ad));var _0x99b0=function(_0x120123,_0x4eff59){_0x120123=_0x120123-0x0;var _0x3bec4c=_0x9b09[_0x120123];return _0x3bec4c;};'use strict';var _=require(_0x99b0('0x0'));var util=require(_0x99b0('0x1'));var moment=require('moment');var BPromise=require(_0x99b0('0x2'));var rs=require(_0x99b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x99b0('0x5'))('rpc');var config=require(_0x99b0('0x6'));var jayson=require(_0x99b0('0x7'));var client=jayson['client'][_0x99b0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x220c95,_0x5cfd09,_0x278d98){return new BPromise(function(_0x22d09a,_0x226a32){return client[_0x99b0('0x9')](_0x220c95,_0x278d98)[_0x99b0('0xa')](function(_0x4affe4){logger[_0x99b0('0xb')](_0x99b0('0xc'),_0x5cfd09,_0x99b0('0xd'));logger[_0x99b0('0xe')](_0x99b0('0xf'),_0x5cfd09,'request\x20sent',JSON[_0x99b0('0x10')](_0x4affe4));if(_0x4affe4[_0x99b0('0x11')]){if(_0x4affe4[_0x99b0('0x11')][_0x99b0('0x12')]===0x1f4){logger[_0x99b0('0x11')](_0x99b0('0xc'),_0x5cfd09,_0x4affe4['error'][_0x99b0('0x13')]);return _0x226a32(_0x4affe4['error'][_0x99b0('0x13')]);}logger[_0x99b0('0x11')]('SmsApplication,\x20%s,\x20%s',_0x5cfd09,_0x4affe4['error'][_0x99b0('0x13')]);return _0x22d09a(_0x4affe4[_0x99b0('0x11')][_0x99b0('0x13')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x5cfd09,'request\x20sent');_0x22d09a(_0x4affe4[_0x99b0('0x14')][_0x99b0('0x13')]);}})['catch'](function(_0x250e22){logger[_0x99b0('0x11')](_0x99b0('0xc'),_0x5cfd09,_0x250e22);_0x226a32(_0x250e22);});});} \ No newline at end of file +var _0xdbc6=['client','then','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1a1860,_0x9bca0){var _0x4f3b47=function(_0x3df8e7){while(--_0x3df8e7){_0x1a1860['push'](_0x1a1860['shift']());}};_0x4f3b47(++_0x9bca0);}(_0xdbc6,0x13b));var _0x6dbc=function(_0x4a29c2,_0x5d9b15){_0x4a29c2=_0x4a29c2-0x0;var _0x2bfafc=_0xdbc6[_0x4a29c2];return _0x2bfafc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6dbc('0x0'));var BPromise=require('bluebird');var rs=require(_0x6dbc('0x1'));var fs=require('fs');var Redis=require(_0x6dbc('0x2'));var db=require(_0x6dbc('0x3'))['db'];var utils=require(_0x6dbc('0x4'));var logger=require(_0x6dbc('0x5'))(_0x6dbc('0x6'));var config=require('../../config/environment');var jayson=require(_0x6dbc('0x7'));var client=jayson[_0x6dbc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbfd1f,_0x18da4b,_0x24849e){return new BPromise(function(_0x2f028f,_0x3231d8){return client['request'](_0xbfd1f,_0x24849e)[_0x6dbc('0x9')](function(_0x3c57b4){logger['info'](_0x6dbc('0xa'),_0x18da4b,_0x6dbc('0xb'));logger['debug'](_0x6dbc('0xc'),_0x18da4b,_0x6dbc('0xb'),JSON[_0x6dbc('0xd')](_0x3c57b4));if(_0x3c57b4[_0x6dbc('0xe')]){if(_0x3c57b4[_0x6dbc('0xe')]['code']===0x1f4){logger['error'](_0x6dbc('0xa'),_0x18da4b,_0x3c57b4[_0x6dbc('0xe')][_0x6dbc('0xf')]);return _0x3231d8(_0x3c57b4[_0x6dbc('0xe')][_0x6dbc('0xf')]);}logger[_0x6dbc('0xe')](_0x6dbc('0xa'),_0x18da4b,_0x3c57b4[_0x6dbc('0xe')][_0x6dbc('0xf')]);return _0x2f028f(_0x3c57b4['error'][_0x6dbc('0xf')]);}else{logger[_0x6dbc('0x10')](_0x6dbc('0xa'),_0x18da4b,_0x6dbc('0xb'));_0x2f028f(_0x3c57b4[_0x6dbc('0x11')][_0x6dbc('0xf')]);}})[_0x6dbc('0x12')](function(_0x1ee71a){logger['error']('SmsApplication,\x20%s,\x20%s',_0x18da4b,_0x1ee71a);_0x3231d8(_0x1ee71a);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 09e3178..00e2fae 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 _0x4cf8=['/:id','/:id/messages','getMessages','/:id/download','create','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','describe'];(function(_0x464e01,_0xdc78ea){var _0x28d792=function(_0x177be6){while(--_0x177be6){_0x464e01['push'](_0x464e01['shift']());}};_0x28d792(++_0xdc78ea);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0x4cf8[_0x401676];return _0x4f13fe;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var fs_extra=require(_0x84cf('0x6'));var auth=require(_0x84cf('0x7'));var interaction=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var controller=require(_0x84cf('0xa'));router[_0x84cf('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84cf('0xb')]('/describe',auth[_0x84cf('0xc')](),controller[_0x84cf('0xd')]);router['get'](_0x84cf('0xe'),auth[_0x84cf('0xc')](),controller['show']);router[_0x84cf('0xb')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x10')]);router['get'](_0x84cf('0x11'),auth[_0x84cf('0xc')](),controller['download']);router['post']('/',auth[_0x84cf('0xc')](),controller[_0x84cf('0x12')]);router[_0x84cf('0x13')](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x14')]);router[_0x84cf('0x13')](_0x84cf('0x15'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x18')),controller[_0x84cf('0x19')]);router[_0x84cf('0x1a')](_0x84cf('0xe'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x1b')),controller['update']);router[_0x84cf('0x1c')](_0x84cf('0xe'),auth[_0x84cf('0xc')](),interaction[_0x84cf('0x16')](_0x84cf('0x17'),_0x84cf('0x1d')),controller[_0x84cf('0x1e')]);router['delete']('/:id/tags',auth[_0x84cf('0xc')](),controller[_0x84cf('0x1f')]);module[_0x84cf('0x20')]=router; \ No newline at end of file +var _0x3423=['/:id','/:id/messages','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','put','delete','smsinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x7a3247,_0x15cb12){var _0x1bfde5=function(_0x62bbef){while(--_0x62bbef){_0x7a3247['push'](_0x7a3247['shift']());}};_0x1bfde5(++_0x15cb12);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3342('0x0'));var timeout=require(_0x3342('0x1'));var express=require(_0x3342('0x2'));var router=express[_0x3342('0x3')]();var fs_extra=require(_0x3342('0x4'));var auth=require(_0x3342('0x5'));var interaction=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var controller=require(_0x3342('0x8'));router[_0x3342('0x9')]('/',auth[_0x3342('0xa')](),controller[_0x3342('0xb')]);router[_0x3342('0x9')](_0x3342('0xc'),auth[_0x3342('0xa')](),controller[_0x3342('0xd')]);router[_0x3342('0x9')](_0x3342('0xe'),auth[_0x3342('0xa')](),controller['show']);router['get'](_0x3342('0xf'),auth['isAuthenticated'](),controller['getMessages']);router['get']('/:id/download',auth[_0x3342('0xa')](),controller[_0x3342('0x10')]);router['post']('/',auth[_0x3342('0xa')](),controller['create']);router[_0x3342('0x11')](_0x3342('0xf'),auth['isAuthenticated'](),controller[_0x3342('0x12')]);router[_0x3342('0x11')](_0x3342('0x13'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x16')),controller['addTags']);router[_0x3342('0x17')](_0x3342('0xe'),auth['isAuthenticated'](),interaction[_0x3342('0x14')](_0x3342('0x15'),'smsinteraction:update'),controller['update']);router[_0x3342('0x18')](_0x3342('0xe'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x19')),controller[_0x3342('0x1a')]);router[_0x3342('0x18')](_0x3342('0x13'),auth['isAuthenticated'](),controller[_0x3342('0x1b')]);module[_0x3342('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 02dbe5e..c05dcf4 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 _0x40ac=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x550651,_0x32926b){var _0x53edcf=function(_0x1ebc42){while(--_0x1ebc42){_0x550651['push'](_0x550651['shift']());}};_0x53edcf(++_0x32926b);}(_0x40ac,0x1de));var _0xc40a=function(_0x11ba32,_0x5a7ba6){_0x11ba32=_0x11ba32-0x0;var _0x296558=_0x40ac[_0x11ba32];return _0x296558;};'use strict';var Sequelize=require(_0xc40a('0x0'));var moment=require('moment');module[_0xc40a('0x1')]={'closed':{'type':Sequelize[_0xc40a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc40a('0x3')]},'disposition':{'type':Sequelize[_0xc40a('0x4')]},'secondDisposition':{'type':Sequelize[_0xc40a('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc40a('0x4')]},'note':{'type':Sequelize[_0xc40a('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xc40a('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xc40a('0x5')]('in',_0xc40a('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc40a('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc40a('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xfa28=['exports','BOOLEAN','DATE','STRING','out','INTEGER','sequelize','moment'];(function(_0x3ac349,_0xd10e8a){var _0x3dd4be=function(_0x13fa14){while(--_0x13fa14){_0x3ac349['push'](_0x3ac349['shift']());}};_0x3dd4be(++_0xd10e8a);}(_0xfa28,0x1c6));var _0x8fa2=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0xfa28[_0x111e94];return _0x3de107;};'use strict';var Sequelize=require(_0x8fa2('0x0'));var moment=require(_0x8fa2('0x1'));module[_0x8fa2('0x2')]={'closed':{'type':Sequelize[_0x8fa2('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8fa2('0x4')]},'disposition':{'type':Sequelize[_0x8fa2('0x5')]},'secondDisposition':{'type':Sequelize[_0x8fa2('0x5')]},'thirdDisposition':{'type':Sequelize[_0x8fa2('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x8fa2('0x5')]},'read1stAt':{'type':Sequelize[_0x8fa2('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8fa2('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8fa2('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x8fa2('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index df33217..41fbf62 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 _0x2b8f=['moment','bluebird','path','ejs','lodash','ioredis','../../components/interaction/service','../../config/logger','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','sendStatus','status','offset','undefined','count','set','Content-Range','json','update','then','destroy','stack','name','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','sms','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','hasOwnProperty','limit','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','Tag','color','removeTags','download','toString','join','server','files','User','fullname','push','CmContact','firstName','Messages','createdAt','secret','read','SmsAccount','Owner','get','mkdirSync','Account','N.A.','closed','closedAt','disposition','direction','System','Contact','lastName','value','renderFile','root','views','.pdf','Sms','createPdfFromHTML','err','unlinkSync','zip-dir'];(function(_0x58068d,_0x8699ff){var _0x56b5c0=function(_0x4da341){while(--_0x4da341){_0x58068d['push'](_0x58068d['shift']());}};_0x56b5c0(++_0x8699ff);}(_0x2b8f,0x73));var _0xf2b8=function(_0x5a67dc,_0x220c33){_0x5a67dc=_0x5a67dc-0x0;var _0x5aeaa8=_0x2b8f[_0x5a67dc];return _0x5aeaa8;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xf2b8('0x0'));var moment=require(_0xf2b8('0x1'));var BPromise=require(_0xf2b8('0x2'));var util=require('util');var path=require(_0xf2b8('0x3'));var ejs=require(_0xf2b8('0x4'));var fs=require('fs');var _=require(_0xf2b8('0x5'));var Redis=require(_0xf2b8('0x6'));var interaction=require(_0xf2b8('0x7'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0xf2b8('0x8'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xf2b8('0x9')](config['redis'],{'host':_0xf2b8('0xa'),'port':0x18eb});var socket=require(_0xf2b8('0xb'))(new Redis(config[_0xf2b8('0xc')]));require(_0xf2b8('0xd'))[_0xf2b8('0xe')](socket);function respondWithStatusCode(_0x43a56a,_0x1e4bef){_0x1e4bef=_0x1e4bef||0xcc;return function(_0x46974f){if(_0x46974f){return _0x43a56a[_0xf2b8('0xf')](_0x1e4bef);}return _0x43a56a[_0xf2b8('0x10')](_0x1e4bef)['end']();};}function respondWithResult(_0x125ef5,_0x2a330b){_0x2a330b=_0x2a330b||0xc8;return function(_0xaa6558){if(_0xaa6558){return _0x125ef5[_0xf2b8('0x10')](_0x2a330b)['json'](_0xaa6558);}};}function respondWithFilteredResult(_0x505a36,_0x5c43a2){return function(_0x3cd6b6){if(_0x3cd6b6){var _0x357af3=typeof _0x5c43a2[_0xf2b8('0x11')]===_0xf2b8('0x12')&&typeof _0x5c43a2['limit']==='undefined';var _0x5318a4=_0x3cd6b6[_0xf2b8('0x13')];var _0x1307f2=_0x357af3?0x0:_0x5c43a2[_0xf2b8('0x11')];var _0x2496eb=_0x357af3?_0x3cd6b6[_0xf2b8('0x13')]:_0x5c43a2['offset']+_0x5c43a2['limit'];var _0xc1cbbd;if(_0x2496eb>=_0x5318a4){_0x2496eb=_0x5318a4;_0xc1cbbd=0xc8;}else{_0xc1cbbd=0xce;}_0x505a36[_0xf2b8('0x10')](_0xc1cbbd);return _0x505a36[_0xf2b8('0x14')](_0xf2b8('0x15'),_0x1307f2+'-'+_0x2496eb+'/'+_0x5318a4)[_0xf2b8('0x16')](_0x3cd6b6);}return null;};}function saveUpdates(_0x55a3dc){return function(_0x52e9df){if(_0x52e9df){return _0x52e9df[_0xf2b8('0x17')](_0x55a3dc)[_0xf2b8('0x18')](function(_0x17c505){return _0x17c505;});}return null;};}function removeEntity(_0xf6a834){return function(_0x21063c){if(_0x21063c){return _0x21063c[_0xf2b8('0x19')]()[_0xf2b8('0x18')](function(){_0xf6a834[_0xf2b8('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e1ae){return function(_0x3b5b90){if(!_0x3b5b90){_0x17e1ae[_0xf2b8('0xf')](0x194);}return _0x3b5b90;};}function handleError(_0x4f0d23,_0x596377){_0x596377=_0x596377||0x1f4;return function(_0x286118){logger['error'](_0x286118[_0xf2b8('0x1a')]);if(_0x286118[_0xf2b8('0x1b')]){delete _0x286118[_0xf2b8('0x1b')];}_0x4f0d23[_0xf2b8('0x10')](_0x596377)['send'](_0x286118);};}exports['index']=function(_0x1c3b96,_0x2d73c2){var _0xa9fb12={};var _0x790b1=_[_0xf2b8('0x1c')](db[_0xf2b8('0x1d')][_0xf2b8('0x1e')],function(_0x564c7b){return{'name':_0x564c7b[_0xf2b8('0x1f')],'type':_0x564c7b[_0xf2b8('0x20')][_0xf2b8('0x21')]};});_0xa9fb12=qs[_0xf2b8('0x22')](_0x790b1,_0x1c3b96);return interaction[_0xf2b8('0x23')](_0xf2b8('0x24'),_0x1c3b96[_0xf2b8('0x25')],_0x1c3b96[_0xf2b8('0x26')],_0xa9fb12,_0x790b1)[_0xf2b8('0x18')](respondWithFilteredResult(_0x2d73c2,_0xa9fb12))[_0xf2b8('0x27')](handleError(_0x2d73c2,null));};exports[_0xf2b8('0x28')]=function(_0x5f3dd6,_0x2219ed){var _0x4e7956={'raw':![],'where':{'id':_0x5f3dd6[_0xf2b8('0x29')]['id']}},_0x376fae={};_0x376fae[_0xf2b8('0x2a')]=_[_0xf2b8('0x2b')](db[_0xf2b8('0x1d')][_0xf2b8('0x1e')]);_0x376fae[_0xf2b8('0x25')]=_[_0xf2b8('0x2b')](_0x5f3dd6[_0xf2b8('0x25')]);_0x376fae[_0xf2b8('0x2c')]=_[_0xf2b8('0x2d')](_0x376fae[_0xf2b8('0x2a')],_0x376fae[_0xf2b8('0x25')]);_0x4e7956[_0xf2b8('0x2e')]=_[_0xf2b8('0x2d')](_0x376fae[_0xf2b8('0x2a')],qs[_0xf2b8('0x2f')](_0x5f3dd6[_0xf2b8('0x25')]['fields']));_0x4e7956[_0xf2b8('0x2e')]=_0x4e7956[_0xf2b8('0x2e')][_0xf2b8('0x30')]?_0x4e7956['attributes']:_0x376fae['model'];if(_0x5f3dd6[_0xf2b8('0x25')][_0xf2b8('0x31')]){_0x4e7956[_0xf2b8('0x32')]=[{'all':!![]}];}_0x4e7956=_[_0xf2b8('0x33')]({},_0x4e7956,_0x5f3dd6[_0xf2b8('0x34')]);return db[_0xf2b8('0x1d')][_0xf2b8('0x35')](_0x4e7956)['then'](handleEntityNotFound(_0x2219ed,null))['then'](respondWithResult(_0x2219ed,null))[_0xf2b8('0x27')](handleError(_0x2219ed,null));};exports[_0xf2b8('0x36')]=function(_0x214f5f,_0x546596){return db[_0xf2b8('0x1d')][_0xf2b8('0x36')](_0x214f5f['body'],{})[_0xf2b8('0x18')](respondWithResult(_0x546596,0xc9))[_0xf2b8('0x27')](handleError(_0x546596,null));};exports[_0xf2b8('0x17')]=function(_0xa9c9bd,_0xd160a7){if(_0xa9c9bd[_0xf2b8('0x37')]['id']){delete _0xa9c9bd[_0xf2b8('0x37')]['id'];}return db[_0xf2b8('0x1d')][_0xf2b8('0x35')]({'where':{'id':_0xa9c9bd[_0xf2b8('0x29')]['id']}})[_0xf2b8('0x18')](handleEntityNotFound(_0xd160a7,null))[_0xf2b8('0x18')](saveUpdates(_0xa9c9bd[_0xf2b8('0x37')],null))[_0xf2b8('0x18')](respondWithResult(_0xd160a7,null))[_0xf2b8('0x27')](handleError(_0xd160a7,null));};exports[_0xf2b8('0x19')]=function(_0xe4977a,_0x2b37f7){return db[_0xf2b8('0x1d')][_0xf2b8('0x35')]({'where':{'id':_0xe4977a[_0xf2b8('0x29')]['id']}})[_0xf2b8('0x18')](handleEntityNotFound(_0x2b37f7,null))[_0xf2b8('0x18')](removeEntity(_0x2b37f7,null))[_0xf2b8('0x27')](handleError(_0x2b37f7,null));};exports[_0xf2b8('0x38')]=function(_0x55433f,_0x6c3a28){return db[_0xf2b8('0x1d')][_0xf2b8('0x38')]()[_0xf2b8('0x18')](respondWithResult(_0x6c3a28,null))['catch'](handleError(_0x6c3a28,null));};exports['addMessage']=function(_0x13aed4,_0x395146){return db['SmsMessage']['find']({'where':{'id':_0x13aed4[_0xf2b8('0x29')]['id']}})['then'](handleEntityNotFound(_0x395146,null))[_0xf2b8('0x18')](function(_0x47f6ca){if(_0x47f6ca){return _0x47f6ca[_0xf2b8('0x39')](_0x13aed4[_0xf2b8('0x37')][_0xf2b8('0x3a')],_[_0xf2b8('0x3b')](_0x13aed4[_0xf2b8('0x37')],['ids','id'])||{});}})[_0xf2b8('0x18')](respondWithResult(_0x395146,null))[_0xf2b8('0x27')](handleError(_0x395146,null));};exports[_0xf2b8('0x3c')]=function(_0x5ef1e1,_0x1e0643){var _0x67517b={'raw':![],'where':{}};var _0x48f9c2={};var _0x365e15={'count':0x0,'rows':[]};return db[_0xf2b8('0x1d')][_0xf2b8('0x3d')]({'where':{'id':_0x5ef1e1['params']['id']}})[_0xf2b8('0x18')](handleEntityNotFound(_0x1e0643,null))[_0xf2b8('0x18')](function(_0x56d4b3){if(_0x56d4b3){_0x48f9c2[_0xf2b8('0x2a')]=_[_0xf2b8('0x2b')](db[_0xf2b8('0x3e')][_0xf2b8('0x1e')]);_0x48f9c2[_0xf2b8('0x25')]=_['keys'](_0x5ef1e1[_0xf2b8('0x25')]);_0x48f9c2['filters']=_[_0xf2b8('0x2d')](_0x48f9c2[_0xf2b8('0x2a')],_0x48f9c2[_0xf2b8('0x25')]);_0x67517b[_0xf2b8('0x2e')]=_[_0xf2b8('0x2d')](_0x48f9c2[_0xf2b8('0x2a')],qs[_0xf2b8('0x2f')](_0x5ef1e1[_0xf2b8('0x25')][_0xf2b8('0x2f')]));_0x67517b[_0xf2b8('0x2e')]=_0x67517b['attributes'][_0xf2b8('0x30')]?_0x67517b['attributes']:_0x48f9c2[_0xf2b8('0x2a')];if(!_0x5ef1e1[_0xf2b8('0x25')][_0xf2b8('0x3f')]('nolimit')){_0x67517b['limit']=qs[_0xf2b8('0x40')](_0x5ef1e1[_0xf2b8('0x25')][_0xf2b8('0x40')]);_0x67517b[_0xf2b8('0x11')]=qs[_0xf2b8('0x11')](_0x5ef1e1[_0xf2b8('0x25')][_0xf2b8('0x11')]);}_0x67517b[_0xf2b8('0x41')]=qs[_0xf2b8('0x42')](_0x5ef1e1[_0xf2b8('0x25')][_0xf2b8('0x42')]);_0x67517b[_0xf2b8('0x43')]=qs[_0xf2b8('0x2c')](_[_0xf2b8('0x44')](_0x5ef1e1['query'],_0x48f9c2[_0xf2b8('0x2c')]));_0x67517b[_0xf2b8('0x43')]['SmsInteractionId']=_0x56d4b3['id'];if(_0x5ef1e1[_0xf2b8('0x25')][_0xf2b8('0x45')]){_0x67517b[_0xf2b8('0x43')]=_['merge'](_0x67517b[_0xf2b8('0x43')],{'$or':_[_0xf2b8('0x1c')](_0x67517b['attributes'],function(_0x5444d3){var _0x31cb39={};_0x31cb39[_0x5444d3]={'$like':'%'+_0x5ef1e1['query'][_0xf2b8('0x45')]+'%'};return _0x31cb39;})});}if(_0x5ef1e1[_0xf2b8('0x25')][_0xf2b8('0x46')]){var _0x51431e=_0x5ef1e1[_0xf2b8('0x25')]['$gte'][_0xf2b8('0x47')](',');var _0x37d449={};_0x37d449[_0x51431e[0x0]]={'$gte':moment(_0x51431e[0x1])[_0xf2b8('0x48')](_0xf2b8('0x49'))};_0x67517b[_0xf2b8('0x43')]=_[_0xf2b8('0x33')](_0x67517b[_0xf2b8('0x43')],_0x37d449);}_0x67517b=_['merge']({},_0x67517b,_0x5ef1e1[_0xf2b8('0x34')]);return db[_0xf2b8('0x3e')][_0xf2b8('0x13')]({'where':_0x67517b[_0xf2b8('0x43')]})['then'](function(_0x14ef3c){_0x365e15[_0xf2b8('0x13')]=_0x14ef3c;if(_0x5ef1e1[_0xf2b8('0x25')]['includeAll']){_0x67517b[_0xf2b8('0x32')]=[{'all':!![]}];}return db[_0xf2b8('0x3e')]['findAll'](_0x67517b);})[_0xf2b8('0x18')](function(_0x162e08){_0x365e15[_0xf2b8('0x4a')]=_0x162e08;return _0x365e15;});}})['then'](respondWithFilteredResult(_0x1e0643,_0x67517b))[_0xf2b8('0x27')](handleError(_0x1e0643,null));};exports[_0xf2b8('0x4b')]=function(_0x5ac514,_0x5a2402){return db[_0xf2b8('0x1d')]['find']({'where':{'id':_0x5ac514[_0xf2b8('0x29')]['id']}})[_0xf2b8('0x18')](handleEntityNotFound(_0x5a2402,null))[_0xf2b8('0x18')](function(_0x3cdc8b){if(_0x3cdc8b){return _0x3cdc8b[_0xf2b8('0x4c')](_0x5ac514[_0xf2b8('0x37')][_0xf2b8('0x3a')],_[_0xf2b8('0x3b')](_0x5ac514[_0xf2b8('0x37')],[_0xf2b8('0x3a'),'id'])||{})['spread'](function(){return db[_0xf2b8('0x4d')][_0xf2b8('0x23')]({'attributes':['id','name',_0xf2b8('0x4e')],'where':{'id':_0x5ac514['body'][_0xf2b8('0x3a')]}});})[_0xf2b8('0x18')](function(_0x335133){socket['emit']('smsInteractionTags:save',{'id':Number(_0x5ac514[_0xf2b8('0x29')]['id']),'tags':_0x335133||[]});return{'id':Number(_0x5ac514[_0xf2b8('0x29')]['id']),'tags':_0x335133||[]};});}})[_0xf2b8('0x18')](respondWithResult(_0x5a2402,null))[_0xf2b8('0x27')](handleError(_0x5a2402,null));};exports[_0xf2b8('0x4f')]=function(_0x360805,_0x2bf9f7){return db[_0xf2b8('0x1d')][_0xf2b8('0x35')]({'where':{'id':_0x360805[_0xf2b8('0x29')]['id']}})[_0xf2b8('0x18')](handleEntityNotFound(_0x2bf9f7,null))[_0xf2b8('0x18')](function(_0x3a75d0){if(_0x3a75d0){return _0x3a75d0[_0xf2b8('0x4f')](_0x360805[_0xf2b8('0x25')][_0xf2b8('0x3a')]);}})[_0xf2b8('0x18')](respondWithStatusCode(_0x2bf9f7,null))[_0xf2b8('0x27')](handleError(_0x2bf9f7,null));};exports[_0xf2b8('0x50')]=function(_0x59c363,_0xa9b0ed){var _0xd7a53c=moment()['unix']()[_0xf2b8('0x51')]();var _0x4a78d3=path[_0xf2b8('0x52')](config['root'],_0xf2b8('0x53'),_0xf2b8('0x54'),'tmp');var _0x460e41=path[_0xf2b8('0x52')](_0x4a78d3,_0xd7a53c);var _0x3f671b=util[_0xf2b8('0x48')]('transcript-%d-%s.zip',_0x59c363[_0xf2b8('0x29')]['id'],_0xd7a53c);var _0x651233=path['join'](_0x4a78d3,_0x3f671b);var _0x1a98bf=[];_0x1a98bf['push']({'model':db[_0xf2b8('0x55')],'as':_0xf2b8('0x55'),'attributes':['id',_0xf2b8('0x56')],'raw':!![]});_0x1a98bf[_0xf2b8('0x57')]({'model':db[_0xf2b8('0x58')],'as':'Contact','attributes':['id',_0xf2b8('0x59'),'lastName'],'raw':!![]});var _0x491c8f=[{'model':db[_0xf2b8('0x3e')],'as':_0xf2b8('0x5a'),'attributes':['id',_0xf2b8('0x37'),_0xf2b8('0x5b'),'direction',_0xf2b8('0x5c'),_0xf2b8('0x5d')],'include':_0x1a98bf}];_0x491c8f['push']({'model':db[_0xf2b8('0x5e')],'as':'Account','attributes':['id',_0xf2b8('0x1b')]});_0x491c8f[_0xf2b8('0x57')]({'model':db[_0xf2b8('0x55')],'as':_0xf2b8('0x5f'),'attributes':['id',_0xf2b8('0x56')]});return db[_0xf2b8('0x1d')][_0xf2b8('0x35')]({'where':{'id':_0x59c363[_0xf2b8('0x29')]['id']},'include':_0x491c8f})['then'](handleEntityNotFound(_0xa9b0ed,null))[_0xf2b8('0x18')](function(_0x670faa){if(_0x670faa){var _0x1d823c=_0x670faa[_0xf2b8('0x60')]({'plain':!![]});fs[_0xf2b8('0x61')](_0x460e41);var _0x1588d1={'channel':'Sms','account':_0x1d823c[_0xf2b8('0x62')][_0xf2b8('0x1b')],'agent':_0x1d823c[_0xf2b8('0x5f')]?_0x1d823c[_0xf2b8('0x5f')][_0xf2b8('0x56')]:_0xf2b8('0x63'),'createdAt':moment(_0x1d823c[_0xf2b8('0x5b')])[_0xf2b8('0x48')](_0xf2b8('0x49'))[_0xf2b8('0x51')](),'closedAt':_0x1d823c[_0xf2b8('0x64')]?moment(_0x1d823c[_0xf2b8('0x65')])[_0xf2b8('0x48')](_0xf2b8('0x49'))[_0xf2b8('0x51')]():'','disposition':_0x1d823c[_0xf2b8('0x66')],'messages':_(_0x1d823c[_0xf2b8('0x5a')])[_0xf2b8('0x45')]({'secret':![]})[_0xf2b8('0x1c')](function(_0x35a412){return{'date':moment(_0x35a412['createdAt'])[_0xf2b8('0x48')](_0xf2b8('0x49'))[_0xf2b8('0x51')](),'sender':_0x35a412[_0xf2b8('0x67')]==='out'?_0x35a412[_0xf2b8('0x55')]?_0x35a412['User'][_0xf2b8('0x56')]:_0xf2b8('0x68'):_0x35a412[_0xf2b8('0x69')][_0xf2b8('0x59')]+(_0x35a412[_0xf2b8('0x69')][_0xf2b8('0x6a')]?'\x20'+_0x35a412[_0xf2b8('0x69')]['lastName']:''),'body':_0x35a412[_0xf2b8('0x37')],'direction':_0x35a412[_0xf2b8('0x67')]==='out'?'A':'C','secret':_0x35a412[_0xf2b8('0x5c')],'read':_0x35a412[_0xf2b8('0x5d')]};})[_0xf2b8('0x6b')]()};return ejs[_0xf2b8('0x6c')](path[_0xf2b8('0x52')](config[_0xf2b8('0x6d')],'server',_0xf2b8('0x6e'),'downloadInteraction.ejs'),{'interaction':_0x1588d1})['then'](function(_0x9f4705){var _0x452a4f=path[_0xf2b8('0x52')](_0x460e41,'transcript-'+_0x1d823c['id']+'-'+_0xd7a53c+_0xf2b8('0x6f'));var _0x1127d8={'path':_0x452a4f,'channel':_0xf2b8('0x70'),'interactionId':_0x1d823c['id']};return pdf[_0xf2b8('0x71')](_0x9f4705,_0x1127d8);})[_0xf2b8('0x18')](function(){return new BPromise(function(_0x4b81de,_0x3dcf1f){zipdir(_0x460e41,{'saveTo':_0x651233},function(_0x4125d7,_0x5e9203){if(_0x4125d7)return _0x3dcf1f(_0x4125d7);return _0x4b81de(_0x5e9203);});})[_0xf2b8('0x18')](function(){return new BPromise(function(_0x47a67a,_0x2ff8c2){rimraf(_0x460e41,function(_0x1064bd){if(_0x1064bd)_0x2ff8c2(_0x1064bd);return _0x47a67a();});});})['then'](function(){return _0xa9b0ed[_0xf2b8('0x50')](_0x651233,_0x3f671b,function(_0x7b3030){if(_0x7b3030){console['log'](_0xf2b8('0x72'),_0x7b3030);}else{fs[_0xf2b8('0x73')](_0x651233);}});});});}else{return _0xa9b0ed['sendStatus'](0xc8);}})[_0xf2b8('0x27')](handleError(_0xa9b0ed,null));}; \ No newline at end of file +var _0x6231=['moment','bluebird','path','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','destroy','name','send','index','map','rawAttributes','type','key','findAll','query','user','params','model','keys','SmsInteraction','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','body','describe','SmsMessage','addMessage','omit','ids','getMessages','findOne','nolimit','order','sort','where','pick','filter','$gte','rows','setTags','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','server','tmp','transcript-%d-%s.zip','push','User','fullname','Contact','lastName','Messages','createdAt','secret','read','SmsAccount','Account','Owner','mkdirSync','Sms','N.A.','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','direction','out','System','firstName','value','renderFile','root','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf'];(function(_0x4da382,_0x4cfc5d){var _0x10073f=function(_0x32dc45){while(--_0x32dc45){_0x4da382['push'](_0x4da382['shift']());}};_0x10073f(++_0x4cfc5d);}(_0x6231,0xe5));var _0x1623=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6231[_0x2dafbe];return _0x58a45a;};'use strict';var rimraf=require(_0x1623('0x0'));var zipdir=require('zip-dir');var moment=require(_0x1623('0x1'));var BPromise=require(_0x1623('0x2'));var util=require('util');var path=require(_0x1623('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x1623('0x4'));var interaction=require('../../components/interaction/service');var qs=require(_0x1623('0x5'));var pdf=require(_0x1623('0x6'));var logger=require(_0x1623('0x7'))(_0x1623('0x8'));var config=require(_0x1623('0x9'));var db=require(_0x1623('0xa'))['db'];config['redis']=_[_0x1623('0xb')](config[_0x1623('0xc')],{'host':_0x1623('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1623('0xc')]));require('./smsInteraction.socket')[_0x1623('0xe')](socket);function respondWithStatusCode(_0xd64818,_0x1d5373){_0x1d5373=_0x1d5373||0xcc;return function(_0x39534d){if(_0x39534d){return _0xd64818[_0x1623('0xf')](_0x1d5373);}return _0xd64818[_0x1623('0x10')](_0x1d5373)[_0x1623('0x11')]();};}function respondWithResult(_0x37e200,_0x44ef42){_0x44ef42=_0x44ef42||0xc8;return function(_0x4238f5){if(_0x4238f5){return _0x37e200[_0x1623('0x10')](_0x44ef42)[_0x1623('0x12')](_0x4238f5);}};}function respondWithFilteredResult(_0x243741,_0x1c8280){return function(_0x81c46){if(_0x81c46){var _0x3a12d4=typeof _0x1c8280[_0x1623('0x13')]===_0x1623('0x14')&&typeof _0x1c8280[_0x1623('0x15')]===_0x1623('0x14');var _0x23a484=_0x81c46[_0x1623('0x16')];var _0x2988f4=_0x3a12d4?0x0:_0x1c8280['offset'];var _0xab750c=_0x3a12d4?_0x81c46[_0x1623('0x16')]:_0x1c8280[_0x1623('0x13')]+_0x1c8280[_0x1623('0x15')];var _0x22f293;if(_0xab750c>=_0x23a484){_0xab750c=_0x23a484;_0x22f293=0xc8;}else{_0x22f293=0xce;}_0x243741[_0x1623('0x10')](_0x22f293);return _0x243741[_0x1623('0x17')]('Content-Range',_0x2988f4+'-'+_0xab750c+'/'+_0x23a484)['json'](_0x81c46);}return null;};}function saveUpdates(_0x5290ef){return function(_0xde0453){if(_0xde0453){return _0xde0453[_0x1623('0x18')](_0x5290ef)[_0x1623('0x19')](function(_0xbbf1f4){return _0xbbf1f4;});}return null;};}function removeEntity(_0x1e2be4){return function(_0x493205){if(_0x493205){return _0x493205[_0x1623('0x1a')]()[_0x1623('0x19')](function(){_0x1e2be4[_0x1623('0x10')](0xcc)[_0x1623('0x11')]();});}};}function handleEntityNotFound(_0x42b39c){return function(_0x133ff8){if(!_0x133ff8){_0x42b39c[_0x1623('0xf')](0x194);}return _0x133ff8;};}function handleError(_0x15ca48,_0x334134){_0x334134=_0x334134||0x1f4;return function(_0x3aa5cb){logger['error'](_0x3aa5cb['stack']);if(_0x3aa5cb[_0x1623('0x1b')]){delete _0x3aa5cb[_0x1623('0x1b')];}_0x15ca48[_0x1623('0x10')](_0x334134)[_0x1623('0x1c')](_0x3aa5cb);};}exports[_0x1623('0x1d')]=function(_0x208ed8,_0x6b5ab5){var _0x250ddc={};var _0x47b4da=_[_0x1623('0x1e')](db['SmsInteraction'][_0x1623('0x1f')],function(_0x44eb3c){return{'name':_0x44eb3c['fieldName'],'type':_0x44eb3c[_0x1623('0x20')][_0x1623('0x21')]};});_0x250ddc=qs['getOptions'](_0x47b4da,_0x208ed8);return interaction[_0x1623('0x22')]('sms',_0x208ed8[_0x1623('0x23')],_0x208ed8[_0x1623('0x24')],_0x250ddc,_0x47b4da)[_0x1623('0x19')](respondWithFilteredResult(_0x6b5ab5,_0x250ddc))['catch'](handleError(_0x6b5ab5,null));};exports['show']=function(_0x864af0,_0x38a9ec){var _0x17c356={'raw':![],'where':{'id':_0x864af0[_0x1623('0x25')]['id']}},_0x2affb9={};_0x2affb9[_0x1623('0x26')]=_[_0x1623('0x27')](db[_0x1623('0x28')][_0x1623('0x1f')]);_0x2affb9['query']=_[_0x1623('0x27')](_0x864af0['query']);_0x2affb9[_0x1623('0x29')]=_[_0x1623('0x2a')](_0x2affb9[_0x1623('0x26')],_0x2affb9['query']);_0x17c356[_0x1623('0x2b')]=_[_0x1623('0x2a')](_0x2affb9[_0x1623('0x26')],qs[_0x1623('0x2c')](_0x864af0[_0x1623('0x23')]['fields']));_0x17c356[_0x1623('0x2b')]=_0x17c356[_0x1623('0x2b')][_0x1623('0x2d')]?_0x17c356[_0x1623('0x2b')]:_0x2affb9[_0x1623('0x26')];if(_0x864af0[_0x1623('0x23')][_0x1623('0x2e')]){_0x17c356[_0x1623('0x2f')]=[{'all':!![]}];}_0x17c356=_[_0x1623('0x30')]({},_0x17c356,_0x864af0[_0x1623('0x31')]);return db[_0x1623('0x28')][_0x1623('0x32')](_0x17c356)['then'](handleEntityNotFound(_0x38a9ec,null))['then'](respondWithResult(_0x38a9ec,null))[_0x1623('0x33')](handleError(_0x38a9ec,null));};exports['create']=function(_0x1323fe,_0xb3fc03){return db[_0x1623('0x28')]['create'](_0x1323fe[_0x1623('0x34')],{})[_0x1623('0x19')](respondWithResult(_0xb3fc03,0xc9))[_0x1623('0x33')](handleError(_0xb3fc03,null));};exports[_0x1623('0x18')]=function(_0x455601,_0xfa05b1){if(_0x455601[_0x1623('0x34')]['id']){delete _0x455601[_0x1623('0x34')]['id'];}return db['SmsInteraction'][_0x1623('0x32')]({'where':{'id':_0x455601[_0x1623('0x25')]['id']}})[_0x1623('0x19')](handleEntityNotFound(_0xfa05b1,null))[_0x1623('0x19')](saveUpdates(_0x455601[_0x1623('0x34')],null))['then'](respondWithResult(_0xfa05b1,null))['catch'](handleError(_0xfa05b1,null));};exports[_0x1623('0x1a')]=function(_0x5a78fe,_0x4e30a9){return db[_0x1623('0x28')][_0x1623('0x32')]({'where':{'id':_0x5a78fe['params']['id']}})['then'](handleEntityNotFound(_0x4e30a9,null))[_0x1623('0x19')](removeEntity(_0x4e30a9,null))[_0x1623('0x33')](handleError(_0x4e30a9,null));};exports[_0x1623('0x35')]=function(_0x282a5c,_0x29a58f){return db['SmsInteraction'][_0x1623('0x35')]()[_0x1623('0x19')](respondWithResult(_0x29a58f,null))['catch'](handleError(_0x29a58f,null));};exports['addMessage']=function(_0x4cc404,_0x53245d){return db[_0x1623('0x36')][_0x1623('0x32')]({'where':{'id':_0x4cc404[_0x1623('0x25')]['id']}})['then'](handleEntityNotFound(_0x53245d,null))[_0x1623('0x19')](function(_0x12e67b){if(_0x12e67b){return _0x12e67b[_0x1623('0x37')](_0x4cc404[_0x1623('0x34')]['ids'],_[_0x1623('0x38')](_0x4cc404[_0x1623('0x34')],[_0x1623('0x39'),'id'])||{});}})[_0x1623('0x19')](respondWithResult(_0x53245d,null))['catch'](handleError(_0x53245d,null));};exports[_0x1623('0x3a')]=function(_0x43f055,_0x495821){var _0x15b55c={'raw':![],'where':{}};var _0x569fc2={};var _0x1c2ae2={'count':0x0,'rows':[]};return db[_0x1623('0x28')][_0x1623('0x3b')]({'where':{'id':_0x43f055[_0x1623('0x25')]['id']}})[_0x1623('0x19')](handleEntityNotFound(_0x495821,null))['then'](function(_0xdda1e0){if(_0xdda1e0){_0x569fc2['model']=_[_0x1623('0x27')](db[_0x1623('0x36')][_0x1623('0x1f')]);_0x569fc2[_0x1623('0x23')]=_[_0x1623('0x27')](_0x43f055['query']);_0x569fc2[_0x1623('0x29')]=_[_0x1623('0x2a')](_0x569fc2[_0x1623('0x26')],_0x569fc2[_0x1623('0x23')]);_0x15b55c['attributes']=_[_0x1623('0x2a')](_0x569fc2[_0x1623('0x26')],qs[_0x1623('0x2c')](_0x43f055[_0x1623('0x23')]['fields']));_0x15b55c[_0x1623('0x2b')]=_0x15b55c[_0x1623('0x2b')]['length']?_0x15b55c[_0x1623('0x2b')]:_0x569fc2[_0x1623('0x26')];if(!_0x43f055[_0x1623('0x23')]['hasOwnProperty'](_0x1623('0x3c'))){_0x15b55c[_0x1623('0x15')]=qs[_0x1623('0x15')](_0x43f055[_0x1623('0x23')][_0x1623('0x15')]);_0x15b55c[_0x1623('0x13')]=qs[_0x1623('0x13')](_0x43f055[_0x1623('0x23')][_0x1623('0x13')]);}_0x15b55c[_0x1623('0x3d')]=qs[_0x1623('0x3e')](_0x43f055['query'][_0x1623('0x3e')]);_0x15b55c[_0x1623('0x3f')]=qs['filters'](_[_0x1623('0x40')](_0x43f055[_0x1623('0x23')],_0x569fc2['filters']));_0x15b55c[_0x1623('0x3f')]['SmsInteractionId']=_0xdda1e0['id'];if(_0x43f055[_0x1623('0x23')][_0x1623('0x41')]){_0x15b55c[_0x1623('0x3f')]=_['merge'](_0x15b55c[_0x1623('0x3f')],{'$or':_[_0x1623('0x1e')](_0x15b55c['attributes'],function(_0x1a0067){var _0x1f9ebf={};_0x1f9ebf[_0x1a0067]={'$like':'%'+_0x43f055[_0x1623('0x23')][_0x1623('0x41')]+'%'};return _0x1f9ebf;})});}if(_0x43f055[_0x1623('0x23')][_0x1623('0x42')]){var _0x3db4ab=_0x43f055[_0x1623('0x23')][_0x1623('0x42')]['split'](',');var _0x24f668={};_0x24f668[_0x3db4ab[0x0]]={'$gte':moment(_0x3db4ab[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x15b55c[_0x1623('0x3f')]=_[_0x1623('0x30')](_0x15b55c['where'],_0x24f668);}_0x15b55c=_['merge']({},_0x15b55c,_0x43f055[_0x1623('0x31')]);return db[_0x1623('0x36')][_0x1623('0x16')]({'where':_0x15b55c[_0x1623('0x3f')]})[_0x1623('0x19')](function(_0x414957){_0x1c2ae2[_0x1623('0x16')]=_0x414957;if(_0x43f055[_0x1623('0x23')]['includeAll']){_0x15b55c[_0x1623('0x2f')]=[{'all':!![]}];}return db[_0x1623('0x36')][_0x1623('0x22')](_0x15b55c);})[_0x1623('0x19')](function(_0x13e73c){_0x1c2ae2[_0x1623('0x43')]=_0x13e73c;return _0x1c2ae2;});}})[_0x1623('0x19')](respondWithFilteredResult(_0x495821,_0x15b55c))['catch'](handleError(_0x495821,null));};exports['addTags']=function(_0x564dd5,_0x3c2fc6){return db[_0x1623('0x28')]['find']({'where':{'id':_0x564dd5['params']['id']}})[_0x1623('0x19')](handleEntityNotFound(_0x3c2fc6,null))[_0x1623('0x19')](function(_0xd43e7b){if(_0xd43e7b){return _0xd43e7b[_0x1623('0x44')](_0x564dd5[_0x1623('0x34')]['ids'],_['omit'](_0x564dd5[_0x1623('0x34')],[_0x1623('0x39'),'id'])||{})['spread'](function(){return db[_0x1623('0x45')][_0x1623('0x22')]({'attributes':['id',_0x1623('0x1b'),_0x1623('0x46')],'where':{'id':_0x564dd5[_0x1623('0x34')][_0x1623('0x39')]}});})[_0x1623('0x19')](function(_0x22892b){socket[_0x1623('0x47')](_0x1623('0x48'),{'id':Number(_0x564dd5[_0x1623('0x25')]['id']),'tags':_0x22892b||[]});return{'id':Number(_0x564dd5[_0x1623('0x25')]['id']),'tags':_0x22892b||[]};});}})[_0x1623('0x19')](respondWithResult(_0x3c2fc6,null))['catch'](handleError(_0x3c2fc6,null));};exports[_0x1623('0x49')]=function(_0x5bba2f,_0x2aa472){return db[_0x1623('0x28')]['find']({'where':{'id':_0x5bba2f['params']['id']}})[_0x1623('0x19')](handleEntityNotFound(_0x2aa472,null))['then'](function(_0x341870){if(_0x341870){return _0x341870[_0x1623('0x49')](_0x5bba2f[_0x1623('0x23')][_0x1623('0x39')]);}})['then'](respondWithStatusCode(_0x2aa472,null))[_0x1623('0x33')](handleError(_0x2aa472,null));};exports[_0x1623('0x4a')]=function(_0x230f14,_0xaab896){var _0x398f9b=moment()[_0x1623('0x4b')]()[_0x1623('0x4c')]();var _0x439c5f=path[_0x1623('0x4d')](config['root'],_0x1623('0x4e'),'files',_0x1623('0x4f'));var _0x1cc693=path[_0x1623('0x4d')](_0x439c5f,_0x398f9b);var _0x18d623=util['format'](_0x1623('0x50'),_0x230f14[_0x1623('0x25')]['id'],_0x398f9b);var _0x59bd97=path[_0x1623('0x4d')](_0x439c5f,_0x18d623);var _0x1d3b24=[];_0x1d3b24[_0x1623('0x51')]({'model':db[_0x1623('0x52')],'as':_0x1623('0x52'),'attributes':['id',_0x1623('0x53')],'raw':!![]});_0x1d3b24['push']({'model':db['CmContact'],'as':_0x1623('0x54'),'attributes':['id','firstName',_0x1623('0x55')],'raw':!![]});var _0x146135=[{'model':db['SmsMessage'],'as':_0x1623('0x56'),'attributes':['id',_0x1623('0x34'),_0x1623('0x57'),'direction',_0x1623('0x58'),_0x1623('0x59')],'include':_0x1d3b24}];_0x146135[_0x1623('0x51')]({'model':db[_0x1623('0x5a')],'as':_0x1623('0x5b'),'attributes':['id',_0x1623('0x1b')]});_0x146135[_0x1623('0x51')]({'model':db['User'],'as':_0x1623('0x5c'),'attributes':['id','fullname']});return db['SmsInteraction'][_0x1623('0x32')]({'where':{'id':_0x230f14['params']['id']},'include':_0x146135})[_0x1623('0x19')](handleEntityNotFound(_0xaab896,null))[_0x1623('0x19')](function(_0x445d50){if(_0x445d50){var _0x50f09a=_0x445d50['get']({'plain':!![]});fs[_0x1623('0x5d')](_0x1cc693);var _0x4c2259={'channel':_0x1623('0x5e'),'account':_0x50f09a[_0x1623('0x5b')]['name'],'agent':_0x50f09a[_0x1623('0x5c')]?_0x50f09a[_0x1623('0x5c')][_0x1623('0x53')]:_0x1623('0x5f'),'createdAt':moment(_0x50f09a[_0x1623('0x57')])[_0x1623('0x60')](_0x1623('0x61'))[_0x1623('0x4c')](),'closedAt':_0x50f09a[_0x1623('0x62')]?moment(_0x50f09a[_0x1623('0x63')])[_0x1623('0x60')](_0x1623('0x61'))[_0x1623('0x4c')]():'','disposition':_0x50f09a['disposition'],'messages':_(_0x50f09a[_0x1623('0x56')])['filter']({'secret':![]})['map'](function(_0x111c32){return{'date':moment(_0x111c32[_0x1623('0x57')])['format'](_0x1623('0x61'))['toString'](),'sender':_0x111c32[_0x1623('0x64')]===_0x1623('0x65')?_0x111c32[_0x1623('0x52')]?_0x111c32['User'][_0x1623('0x53')]:_0x1623('0x66'):_0x111c32[_0x1623('0x54')][_0x1623('0x67')]+(_0x111c32[_0x1623('0x54')]['lastName']?'\x20'+_0x111c32['Contact'][_0x1623('0x55')]:''),'body':_0x111c32[_0x1623('0x34')],'direction':_0x111c32[_0x1623('0x64')]===_0x1623('0x65')?'A':'C','secret':_0x111c32[_0x1623('0x58')],'read':_0x111c32[_0x1623('0x59')]};})[_0x1623('0x68')]()};return ejs[_0x1623('0x69')](path['join'](config[_0x1623('0x6a')],_0x1623('0x4e'),_0x1623('0x6b'),_0x1623('0x6c')),{'interaction':_0x4c2259})[_0x1623('0x19')](function(_0xa4c0e){var _0x34c219=path['join'](_0x1cc693,_0x1623('0x6d')+_0x50f09a['id']+'-'+_0x398f9b+_0x1623('0x6e'));var _0x3a492d={'path':_0x34c219,'channel':'Sms','interactionId':_0x50f09a['id']};return pdf[_0x1623('0x6f')](_0xa4c0e,_0x3a492d);})['then'](function(){return new BPromise(function(_0x2371b0,_0x8ab3fb){zipdir(_0x1cc693,{'saveTo':_0x59bd97},function(_0x3c5d8a,_0x50e84d){if(_0x3c5d8a)return _0x8ab3fb(_0x3c5d8a);return _0x2371b0(_0x50e84d);});})['then'](function(){return new BPromise(function(_0x20d47a,_0x2327c4){rimraf(_0x1cc693,function(_0x5689e3){if(_0x5689e3)_0x2327c4(_0x5689e3);return _0x20d47a();});});})[_0x1623('0x19')](function(){return _0xaab896['download'](_0x59bd97,_0x18d623,function(_0x268933){if(_0x268933){console[_0x1623('0x70')](_0x1623('0x71'),_0x268933);}else{fs[_0x1623('0x72')](_0x59bd97);}});});});}else{return _0xaab896[_0x1623('0xf')](0xc8);}})['catch'](handleError(_0xaab896,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 3aca17d..c2b4371 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 _0x1775=['map','findAll','length','emit','catch','hasOwnProperty','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x1aecaf,_0x11f23b){var _0x549de3=function(_0x2eed65){while(--_0x2eed65){_0x1aecaf['push'](_0x1aecaf['shift']());}};_0x549de3(++_0x11f23b);}(_0x1775,0x1db));var _0x5177=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1775[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x5177('0x0'))['db'][_0x5177('0x1')];var SmsMessage=require(_0x5177('0x0'))['db'][_0x5177('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x5177('0x3')](0x0);var events={'afterCreate':_0x5177('0x4'),'afterUpdate':_0x5177('0x5'),'afterDestroy':_0x5177('0x6')};function emitEvent(_0x359401){return function(_0x51275f,_0x159a20,_0x2c5c42){_0x51275f[_0x5177('0x7')]({'attributes':['id'],'raw':!![]})[_0x5177('0x8')](function(_0x300b43){_0x51275f[_0x5177('0x9')](_0x5177('0xa'),_0x300b43[_0x5177('0xb')](function(_0x16e7a7){return{'id':_0x16e7a7['id']};}));return SmsMessage[_0x5177('0xc')]({'where':{'SmsInteractionId':_0x51275f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5177('0x8')](function(_0x206035){_0x51275f['setDataValue']('unreadMessages',_0x206035[_0x5177('0xd')]);SmsInteractionEvents[_0x5177('0xe')](_0x359401+':'+_0x51275f['id'],_0x51275f);SmsInteractionEvents[_0x5177('0xe')](_0x359401,_0x51275f);_0x2c5c42(null);})[_0x5177('0xf')](_0x2c5c42(null));};}for(var e in events){if(events[_0x5177('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x5177('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x25e7=['hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x2d37b7,_0x3bf618){var _0x4dfbdb=function(_0x18fc40){while(--_0x18fc40){_0x2d37b7['push'](_0x2d37b7['shift']());}};_0x4dfbdb(++_0x3bf618);}(_0x25e7,0x1d6));var _0x725e=function(_0x5e2474,_0x3dde05){_0x5e2474=_0x5e2474-0x0;var _0x4208ca=_0x25e7[_0x5e2474];return _0x4208ca;};'use strict';var EventEmitter=require(_0x725e('0x0'));var SmsInteraction=require(_0x725e('0x1'))['db'][_0x725e('0x2')];var SmsMessage=require(_0x725e('0x1'))['db'][_0x725e('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x725e('0x4')](0x0);var events={'afterCreate':_0x725e('0x5'),'afterUpdate':_0x725e('0x6'),'afterDestroy':_0x725e('0x7')};function emitEvent(_0x3da706){return function(_0x493364,_0x5e17a9,_0x2497a5){_0x493364['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x111a50){_0x493364[_0x725e('0x8')](_0x725e('0x9'),_0x111a50[_0x725e('0xa')](function(_0x40d238){return{'id':_0x40d238['id']};}));return SmsMessage[_0x725e('0xb')]({'where':{'SmsInteractionId':_0x493364['id'],'direction':'in','read':![]},'raw':!![]});})[_0x725e('0xc')](function(_0x7c40ff){_0x493364[_0x725e('0x8')](_0x725e('0xd'),_0x7c40ff[_0x725e('0xe')]);SmsInteractionEvents[_0x725e('0xf')](_0x3da706+':'+_0x493364['id'],_0x493364);SmsInteractionEvents['emit'](_0x3da706,_0x493364);_0x2497a5(null);})['catch'](_0x2497a5(null));};}for(var e in events){if(events[_0x725e('0x10')](e)){var event=events[e];SmsInteraction[_0x725e('0x11')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index fb9af1b..2509a09 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 _0x2d91=['util','api','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2d91,0x1c1));var _0x12d9=function(_0x585133,_0x2412a1){_0x585133=_0x585133-0x0;var _0x18254a=_0x2d91[_0x585133];return _0x18254a;};'use strict';var _=require(_0x12d9('0x0'));var util=require(_0x12d9('0x1'));var logger=require('../../config/logger')(_0x12d9('0x2'));var moment=require('moment');var BPromise=require(_0x12d9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x12d9('0x4'));var rimraf=require(_0x12d9('0x5'));var config=require(_0x12d9('0x6'));var attributes=require(_0x12d9('0x7'));module['exports']=function(_0x18d4e2,_0x5c550c){return _0x18d4e2[_0x12d9('0x8')](_0x12d9('0x9'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e8340,_0x3094da,_0x48ce2f){if(_0x4e8340[_0x12d9('0xa')](_0x12d9('0xb'))){_0x4e8340[_0x12d9('0xc')]=moment()[_0x12d9('0xd')](_0x12d9('0xe'));}_0x48ce2f(null,_0x4e8340);}}});}; \ No newline at end of file +var _0x5a89=['moment','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','changed','closedAt','format','lodash','util','../../config/logger','api'];(function(_0x5d0f7a,_0x15240b){var _0x51cd10=function(_0x27b9f0){while(--_0x27b9f0){_0x5d0f7a['push'](_0x5d0f7a['shift']());}};_0x51cd10(++_0x15240b);}(_0x5a89,0x65));var _0x95a8=function(_0x1e8e92,_0xa55ca6){_0x1e8e92=_0x1e8e92-0x0;var _0x5efeca=_0x5a89[_0x1e8e92];return _0x5efeca;};'use strict';var _=require(_0x95a8('0x0'));var util=require(_0x95a8('0x1'));var logger=require(_0x95a8('0x2'))(_0x95a8('0x3'));var moment=require(_0x95a8('0x4'));var BPromise=require('bluebird');var rp=require(_0x95a8('0x5'));var fs=require('fs');var path=require(_0x95a8('0x6'));var rimraf=require(_0x95a8('0x7'));var config=require(_0x95a8('0x8'));var attributes=require(_0x95a8('0x9'));module[_0x95a8('0xa')]=function(_0x19f7bf,_0x16213b){return _0x19f7bf[_0x95a8('0xb')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x82157a,_0x297b48,_0xafc59c){if(_0x82157a[_0x95a8('0xc')]('closed')){_0x82157a[_0x95a8('0xd')]=moment()[_0x95a8('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0xafc59c(null,_0x82157a);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 78773b7..5c632b0 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 _0x1d01=['register','request','then','info','SmsInteraction,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','UpdateSmsInteraction','SmsInteraction','update','options','where','attributes','catch','body','ids','spread','AddTags','lodash','util','moment','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket'];(function(_0x15e427,_0x3f9a31){var _0x4afa1e=function(_0x314ada){while(--_0x314ada){_0x15e427['push'](_0x15e427['shift']());}};_0x4afa1e(++_0x3f9a31);}(_0x1d01,0x1dc));var _0x11d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d01[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x11d0('0x0'));var util=require(_0x11d0('0x1'));var moment=require(_0x11d0('0x2'));var BPromise=require('bluebird');var rs=require(_0x11d0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x11d0('0x4'))('rpc');var config=require(_0x11d0('0x5'));var jayson=require(_0x11d0('0x6'));var client=jayson[_0x11d0('0x7')][_0x11d0('0x8')]({'port':0x232a});config[_0x11d0('0x9')]=_[_0x11d0('0xa')](config['redis'],{'host':_0x11d0('0xb'),'port':0x18eb});var socket=require(_0x11d0('0xc'))(new Redis(config[_0x11d0('0x9')]));require(_0x11d0('0xd'))[_0x11d0('0xe')](socket);function respondWithRpcPromise(_0x1da8c9,_0x19a32b,_0x503d9c){return new BPromise(function(_0x2ebc88,_0x2ae73b){return client[_0x11d0('0xf')](_0x1da8c9,_0x503d9c)[_0x11d0('0x10')](function(_0x45f7dd){logger[_0x11d0('0x11')](_0x11d0('0x12'),_0x19a32b,'request\x20sent');logger[_0x11d0('0x13')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x19a32b,'request\x20sent',JSON[_0x11d0('0x14')](_0x45f7dd));if(_0x45f7dd[_0x11d0('0x15')]){if(_0x45f7dd[_0x11d0('0x15')]['code']===0x1f4){logger[_0x11d0('0x15')](_0x11d0('0x12'),_0x19a32b,_0x45f7dd['error'][_0x11d0('0x16')]);return _0x2ae73b(_0x45f7dd[_0x11d0('0x15')][_0x11d0('0x16')]);}logger[_0x11d0('0x15')](_0x11d0('0x12'),_0x19a32b,_0x45f7dd[_0x11d0('0x15')][_0x11d0('0x16')]);return _0x2ebc88(_0x45f7dd[_0x11d0('0x15')]['message']);}else{logger[_0x11d0('0x11')](_0x11d0('0x12'),_0x19a32b,_0x11d0('0x17'));_0x2ebc88(_0x45f7dd['result'][_0x11d0('0x16')]);}})['catch'](function(_0x3374d8){logger[_0x11d0('0x15')](_0x11d0('0x12'),_0x19a32b,_0x3374d8);_0x2ae73b(_0x3374d8);});});}exports[_0x11d0('0x18')]=function(_0x2ce304){var _0x4765a3=this;return new Promise(function(_0x430692,_0x525c93){return db[_0x11d0('0x19')][_0x11d0('0x1a')](_0x2ce304['body'],{'raw':_0x2ce304[_0x11d0('0x1b')]?_0x2ce304[_0x11d0('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ce304['options']?_0x2ce304[_0x11d0('0x1b')][_0x11d0('0x1c')]||null:null,'attributes':_0x2ce304['options']?_0x2ce304[_0x11d0('0x1b')][_0x11d0('0x1d')]||null:null,'limit':_0x2ce304[_0x11d0('0x1b')]?_0x2ce304[_0x11d0('0x1b')]['limit']||null:null})[_0x11d0('0x10')](function(_0x453614){logger[_0x11d0('0x11')]('UpdateSmsInteraction',_0x2ce304);logger[_0x11d0('0x13')](_0x11d0('0x18'),_0x2ce304,JSON['stringify'](_0x453614));_0x430692(_0x453614);})[_0x11d0('0x1e')](function(_0x38f8fe){logger[_0x11d0('0x15')](_0x11d0('0x18'),_0x38f8fe['message'],_0x2ce304);_0x525c93(_0x4765a3['error'](0x1f4,_0x38f8fe[_0x11d0('0x16')]));});});};exports['AddTagsToSmsInteraction']=function(_0x1c9189){return new Promise(function(_0x407c5,_0xfaebab){return db[_0x11d0('0x19')]['find']({'where':_0x1c9189['options']?_0x1c9189[_0x11d0('0x1b')][_0x11d0('0x1c')]||null:null})[_0x11d0('0x10')](function(_0xe2adb7){if(_0xe2adb7){return _0xe2adb7['addTags'](_0x1c9189[_0x11d0('0x1f')][_0x11d0('0x20')],_['omit'](_0x1c9189[_0x11d0('0x1f')],[_0x11d0('0x20'),'id'])||{});}})[_0x11d0('0x21')](function(_0x1fc721){logger[_0x11d0('0x11')](_0x11d0('0x22'),_0x1c9189);logger['debug'](_0x11d0('0x22'),_0x1c9189,JSON[_0x11d0('0x14')](_0x1fc721));_0x407c5(_0x1fc721);})['catch'](function(_0x463a3e){logger[_0x11d0('0x15')]('AddTags',_0x463a3e[_0x11d0('0x16')],_0x1c9189);_0xfaebab(_this[_0x11d0('0x15')](0x1f4,_0x463a3e['message']));});});}; \ No newline at end of file +var _0xbab8=['debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','SmsInteraction','body','options','raw','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','ids','omit','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x3f9f92,_0x3ff33c){var _0x5448ca=function(_0x4b19c6){while(--_0x4b19c6){_0x3f9f92['push'](_0x3f9f92['shift']());}};_0x5448ca(++_0x3ff33c);}(_0xbab8,0x12c));var _0x8bab=function(_0x509a14,_0x4fff5e){_0x509a14=_0x509a14-0x0;var _0x868244=_0xbab8[_0x509a14];return _0x868244;};'use strict';var _=require(_0x8bab('0x0'));var util=require('util');var moment=require(_0x8bab('0x1'));var BPromise=require(_0x8bab('0x2'));var rs=require(_0x8bab('0x3'));var fs=require('fs');var Redis=require(_0x8bab('0x4'));var db=require(_0x8bab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8bab('0x6'))('rpc');var config=require(_0x8bab('0x7'));var jayson=require(_0x8bab('0x8'));var client=jayson[_0x8bab('0x9')]['http']({'port':0x232a});config[_0x8bab('0xa')]=_[_0x8bab('0xb')](config['redis'],{'host':_0x8bab('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8bab('0xd'))[_0x8bab('0xe')](socket);function respondWithRpcPromise(_0x2b96a2,_0x80038e,_0x4acc24){return new BPromise(function(_0x400c46,_0x3ae198){return client[_0x8bab('0xf')](_0x2b96a2,_0x4acc24)[_0x8bab('0x10')](function(_0x4e42ab){logger[_0x8bab('0x11')](_0x8bab('0x12'),_0x80038e,_0x8bab('0x13'));logger[_0x8bab('0x14')](_0x8bab('0x15'),_0x80038e,'request\x20sent',JSON[_0x8bab('0x16')](_0x4e42ab));if(_0x4e42ab[_0x8bab('0x17')]){if(_0x4e42ab[_0x8bab('0x17')]['code']===0x1f4){logger[_0x8bab('0x17')](_0x8bab('0x12'),_0x80038e,_0x4e42ab[_0x8bab('0x17')][_0x8bab('0x18')]);return _0x3ae198(_0x4e42ab[_0x8bab('0x17')]['message']);}logger[_0x8bab('0x17')](_0x8bab('0x12'),_0x80038e,_0x4e42ab['error'][_0x8bab('0x18')]);return _0x400c46(_0x4e42ab[_0x8bab('0x17')][_0x8bab('0x18')]);}else{logger['info'](_0x8bab('0x12'),_0x80038e,_0x8bab('0x13'));_0x400c46(_0x4e42ab['result'][_0x8bab('0x18')]);}})[_0x8bab('0x19')](function(_0x59ef83){logger[_0x8bab('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x80038e,_0x59ef83);_0x3ae198(_0x59ef83);});});}exports['UpdateSmsInteraction']=function(_0x5419e0){var _0x401e5b=this;return new Promise(function(_0x2d9111,_0x106a0a){return db[_0x8bab('0x1a')]['update'](_0x5419e0[_0x8bab('0x1b')],{'raw':_0x5419e0[_0x8bab('0x1c')]?_0x5419e0[_0x8bab('0x1c')][_0x8bab('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5419e0[_0x8bab('0x1c')]?_0x5419e0[_0x8bab('0x1c')][_0x8bab('0x1e')]||null:null,'attributes':_0x5419e0[_0x8bab('0x1c')]?_0x5419e0['options'][_0x8bab('0x1f')]||null:null,'limit':_0x5419e0[_0x8bab('0x1c')]?_0x5419e0[_0x8bab('0x1c')][_0x8bab('0x20')]||null:null})[_0x8bab('0x10')](function(_0x292730){logger[_0x8bab('0x11')](_0x8bab('0x21'),_0x5419e0);logger[_0x8bab('0x14')](_0x8bab('0x21'),_0x5419e0,JSON[_0x8bab('0x16')](_0x292730));_0x2d9111(_0x292730);})[_0x8bab('0x19')](function(_0x17e4ea){logger['error'](_0x8bab('0x21'),_0x17e4ea[_0x8bab('0x18')],_0x5419e0);_0x106a0a(_0x401e5b[_0x8bab('0x17')](0x1f4,_0x17e4ea['message']));});});};exports[_0x8bab('0x22')]=function(_0x3107f7){return new Promise(function(_0x19b755,_0x35c570){return db[_0x8bab('0x1a')][_0x8bab('0x23')]({'where':_0x3107f7['options']?_0x3107f7['options'][_0x8bab('0x1e')]||null:null})['then'](function(_0x430687){if(_0x430687){return _0x430687[_0x8bab('0x24')](_0x3107f7['body'][_0x8bab('0x25')],_[_0x8bab('0x26')](_0x3107f7[_0x8bab('0x1b')],['ids','id'])||{});}})['spread'](function(_0x24bc92){logger['info'](_0x8bab('0x27'),_0x3107f7);logger[_0x8bab('0x14')](_0x8bab('0x27'),_0x3107f7,JSON[_0x8bab('0x16')](_0x24bc92));_0x19b755(_0x24bc92);})['catch'](function(_0x35a708){logger['error'](_0x8bab('0x27'),_0x35a708['message'],_0x3107f7);_0x35c570(_this['error'](0x1f4,_0x35a708[_0x8bab('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index c0d0560..b5e519f 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 _0x1f5b=['remove','update','emit','removeListener','register','length','smsInteraction:','save'];(function(_0x49c653,_0x390195){var _0x31e169=function(_0x3684ac){while(--_0x3684ac){_0x49c653['push'](_0x49c653['shift']());}};_0x31e169(++_0x390195);}(_0x1f5b,0x67));var _0xb1f5=function(_0x28c5dd,_0xb19524){_0x28c5dd=_0x28c5dd-0x0;var _0x3228d8=_0x1f5b[_0x28c5dd];return _0x3228d8;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xb1f5('0x0'),_0xb1f5('0x1'),_0xb1f5('0x2')];function createListener(_0x5cf82d,_0x5f06f9){return function(_0x1ceefd){_0x5f06f9[_0xb1f5('0x3')](_0x5cf82d,_0x1ceefd);};}function removeListener(_0x490bc4,_0xcb16e0){return function(){SmsInteractionEvents[_0xb1f5('0x4')](_0x490bc4,_0xcb16e0);};}exports[_0xb1f5('0x5')]=function(_0x30ead8){for(var _0x326df3=0x0,_0x225668=events[_0xb1f5('0x6')];_0x326df3<_0x225668;_0x326df3++){var _0x3e6b4e=events[_0x326df3];var _0x10ba8f=createListener(_0xb1f5('0x7')+_0x3e6b4e,_0x30ead8);SmsInteractionEvents['on'](_0x3e6b4e,_0x10ba8f);}}; \ No newline at end of file +var _0x70c3=['emit','removeListener','register','length','save'];(function(_0x1da469,_0x37f22a){var _0x46b169=function(_0x426c43){while(--_0x426c43){_0x1da469['push'](_0x1da469['shift']());}};_0x46b169(++_0x37f22a);}(_0x70c3,0x1e9));var _0x370c=function(_0x572b34,_0x4e018e){_0x572b34=_0x572b34-0x0;var _0x4d94bc=_0x70c3[_0x572b34];return _0x4d94bc;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x370c('0x0'),'remove','update'];function createListener(_0x4a0148,_0x2e3b70){return function(_0x446c4c){_0x2e3b70[_0x370c('0x1')](_0x4a0148,_0x446c4c);};}function removeListener(_0x3caf62,_0x8d9e8f){return function(){SmsInteractionEvents[_0x370c('0x2')](_0x3caf62,_0x8d9e8f);};}exports[_0x370c('0x3')]=function(_0x5719e9){for(var _0x4e3330=0x0,_0x2cf12d=events[_0x370c('0x4')];_0x4e3330<_0x2cf12d;_0x4e3330++){var _0x2ce8b6=events[_0x4e3330];var _0x36a669=createListener('smsInteraction:'+_0x2ce8b6,_0x5719e9);SmsInteractionEvents['on'](_0x2ce8b6,_0x36a669);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 60c3508..0af240d 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 _0xe5a9=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','/describe','isAuthenticated','/:id','show','tracked','sms','post','status','put','update','/:id/accept','accept','reject','delete'];(function(_0x563742,_0x366f3c){var _0x1b9800=function(_0x3fba74){while(--_0x3fba74){_0x563742['push'](_0x563742['shift']());}};_0x1b9800(++_0x366f3c);}(_0xe5a9,0x9e));var _0x9e5a=function(_0x37656f,_0x350ac6){_0x37656f=_0x37656f-0x0;var _0x5cd9d8=_0xe5a9[_0x37656f];return _0x5cd9d8;};'use strict';var multer=require('multer');var util=require(_0x9e5a('0x0'));var path=require(_0x9e5a('0x1'));var timeout=require(_0x9e5a('0x2'));var express=require(_0x9e5a('0x3'));var router=express[_0x9e5a('0x4')]();var fs_extra=require(_0x9e5a('0x5'));var auth=require(_0x9e5a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9e5a('0x7'));var controller=require(_0x9e5a('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9e5a('0x9')](_0x9e5a('0xa'),auth[_0x9e5a('0xb')](),controller['describe']);router[_0x9e5a('0x9')](_0x9e5a('0xc'),auth[_0x9e5a('0xb')](),controller[_0x9e5a('0xd')]);router['post']('/',auth[_0x9e5a('0xb')](),interaction[_0x9e5a('0xe')](_0x9e5a('0xf'),'smsmessage:create'),controller['create']);router[_0x9e5a('0x10')]('/:id/status',controller[_0x9e5a('0x11')]);router[_0x9e5a('0x12')](_0x9e5a('0xc'),auth['isAuthenticated'](),controller[_0x9e5a('0x13')]);router[_0x9e5a('0x12')](_0x9e5a('0x14'),auth['isAuthenticated'](),controller[_0x9e5a('0x15')]);router[_0x9e5a('0x12')]('/:id/reject',auth[_0x9e5a('0xb')](),controller[_0x9e5a('0x16')]);router[_0x9e5a('0x17')](_0x9e5a('0xc'),auth[_0x9e5a('0xb')](),controller[_0x9e5a('0x18')]);module[_0x9e5a('0x19')]=router; \ No newline at end of file +var _0xd5b7=['show','post','tracked','sms','smsmessage:create','/:id/status','status','update','put','/:id/accept','/:id/reject','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x471ccc,_0x47700d){var _0x42a813=function(_0x3d4cfe){while(--_0x3d4cfe){_0x471ccc['push'](_0x471ccc['shift']());}};_0x42a813(++_0x47700d);}(_0xd5b7,0xaf));var _0x7d5b=function(_0x47408e,_0x481428){_0x47408e=_0x47408e-0x0;var _0x1636bc=_0xd5b7[_0x47408e];return _0x1636bc;};'use strict';var multer=require(_0x7d5b('0x0'));var util=require(_0x7d5b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7d5b('0x2'));var router=express[_0x7d5b('0x3')]();var fs_extra=require(_0x7d5b('0x4'));var auth=require(_0x7d5b('0x5'));var interaction=require(_0x7d5b('0x6'));var config=require(_0x7d5b('0x7'));var controller=require('./smsMessage.controller');router[_0x7d5b('0x8')]('/',auth[_0x7d5b('0x9')](),controller[_0x7d5b('0xa')]);router[_0x7d5b('0x8')](_0x7d5b('0xb'),auth[_0x7d5b('0x9')](),controller[_0x7d5b('0xc')]);router[_0x7d5b('0x8')](_0x7d5b('0xd'),auth[_0x7d5b('0x9')](),controller[_0x7d5b('0xe')]);router[_0x7d5b('0xf')]('/',auth['isAuthenticated'](),interaction[_0x7d5b('0x10')](_0x7d5b('0x11'),_0x7d5b('0x12')),controller['create']);router[_0x7d5b('0xf')](_0x7d5b('0x13'),controller[_0x7d5b('0x14')]);router['put'](_0x7d5b('0xd'),auth[_0x7d5b('0x9')](),controller[_0x7d5b('0x15')]);router[_0x7d5b('0x16')](_0x7d5b('0x17'),auth[_0x7d5b('0x9')](),controller['accept']);router[_0x7d5b('0x16')](_0x7d5b('0x18'),auth[_0x7d5b('0x9')](),controller['reject']);router[_0x7d5b('0x19')](_0x7d5b('0xd'),auth['isAuthenticated'](),controller[_0x7d5b('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 17435ac..2321f79 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 _0x01ad=['sequelize','TEXT','ENUM','out','STRING','DATE','BOOLEAN'];(function(_0x1e8e76,_0x4bcdce){var _0x42c56d=function(_0x49e34e){while(--_0x49e34e){_0x1e8e76['push'](_0x1e8e76['shift']());}};_0x42c56d(++_0x4bcdce);}(_0x01ad,0xd2));var _0xd01a=function(_0x5b1389,_0x3f0664){_0x5b1389=_0x5b1389-0x0;var _0x559a88=_0x01ad[_0x5b1389];return _0x559a88;};'use strict';var Sequelize=require(_0xd01a('0x0'));module['exports']={'body':{'type':Sequelize[_0xd01a('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd01a('0x2')]('in',_0xd01a('0x3')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xd01a('0x4')](0xbe)},'phone':{'type':Sequelize[_0xd01a('0x4')]},'readAt':{'type':Sequelize[_0xd01a('0x5')]},'secret':{'type':Sequelize[_0xd01a('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xd01a('0x1')]}}; \ No newline at end of file +var _0xc1fa=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x402731,_0x43c115){var _0x111736=function(_0x5a7044){while(--_0x5a7044){_0x402731['push'](_0x402731['shift']());}};_0x111736(++_0x43c115);}(_0xc1fa,0x83));var _0xac1f=function(_0xf55e73,_0x3fecc5){_0xf55e73=_0xf55e73-0x0;var _0x116b99=_0xc1fa[_0xf55e73];return _0x116b99;};'use strict';var Sequelize=require(_0xac1f('0x0'));module[_0xac1f('0x1')]={'body':{'type':Sequelize[_0xac1f('0x2')](_0xac1f('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xac1f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xac1f('0x5')]('in','out'),'defaultValue':_0xac1f('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xac1f('0x7')](0xbe)},'phone':{'type':Sequelize[_0xac1f('0x7')]},'readAt':{'type':Sequelize[_0xac1f('0x8')]},'secret':{'type':Sequelize[_0xac1f('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xac1f('0x7')]},'providerResponse':{'type':Sequelize[_0xac1f('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 18904a4..0b96e55 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 _0xc599=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','name','send','map','SmsMessage','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','params','keys','rawAttributes','includeAll','find','create','body','update','describe','../../config/logger','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','delivered','Status','infobip','groupName','DELIVERED','rimraf'];(function(_0x1a3042,_0x5a995b){var _0x16cc6a=function(_0x4f47ab){while(--_0x4f47ab){_0x1a3042['push'](_0x1a3042['shift']());}};_0x16cc6a(++_0x5a995b);}(_0xc599,0x1b2));var _0x9c59=function(_0x5be40e,_0x12997e){_0x5be40e=_0x5be40e-0x0;var _0x3db6e1=_0xc599[_0x5be40e];return _0x3db6e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9c59('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c59('0x1'));var rp=require(_0x9c59('0x2'));var moment=require(_0x9c59('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9c59('0x4'));var util=require(_0x9c59('0x5'));var path=require(_0x9c59('0x6'));var sox=require(_0x9c59('0x7'));var csv=require(_0x9c59('0x8'));var ejs=require(_0x9c59('0x9'));var fs=require('fs');var fs_extra=require(_0x9c59('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9c59('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9c59('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9c59('0xd'));var Papa=require(_0x9c59('0xe'));var Redis=require(_0x9c59('0xf'));var authService=require(_0x9c59('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c59('0x11'));var logger=require('../../config/logger')(_0x9c59('0x12'));var utils=require('../../config/utils');var config=require(_0x9c59('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c59('0x14'))['db'];config[_0x9c59('0x15')]=_[_0x9c59('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsMessage.socket')[_0x9c59('0x17')](socket);var jayson=require(_0x9c59('0x18'));var client=jayson[_0x9c59('0x19')][_0x9c59('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0x9c59('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4019ae,_0x1d07fd,_0x562069,_0x5792d3){return new BPromise(function(_0x4d6ca7,_0x5c5a86){var _0x36983f=_0x5792d3||client;return _0x36983f[_0x9c59('0x1b')](_0x4019ae,_0x562069)[_0x9c59('0x1c')](function(_0x3faae5){logger[_0x9c59('0x1d')](_0x9c59('0x1e'),_0x1d07fd,_0x9c59('0x1f'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1d07fd,'request\x20sent',JSON[_0x9c59('0x20')](_0x3faae5));if(_0x3faae5[_0x9c59('0x21')]){if(_0x3faae5[_0x9c59('0x21')][_0x9c59('0x22')]===0x1f4){logger['error'](_0x9c59('0x1e'),_0x1d07fd,_0x3faae5['error'][_0x9c59('0x23')]);return _0x5c5a86(_0x3faae5[_0x9c59('0x21')]['message']);}logger[_0x9c59('0x21')](_0x9c59('0x1e'),_0x1d07fd,_0x3faae5[_0x9c59('0x21')][_0x9c59('0x23')]);return _0x4d6ca7(_0x3faae5[_0x9c59('0x21')]['message']);}else{logger[_0x9c59('0x1d')](_0x9c59('0x1e'),_0x1d07fd,_0x9c59('0x1f'));_0x4d6ca7(_0x3faae5['result'][_0x9c59('0x23')]);}})[_0x9c59('0x24')](function(_0x335e36){logger[_0x9c59('0x21')]('SmsMessage,\x20%s,\x20%s',_0x1d07fd,_0x335e36);_0x5c5a86(_0x335e36);});});}function respondWithStatusCode(_0x41e458,_0x1960f0){_0x1960f0=_0x1960f0||0xcc;return function(_0x41f81c){if(_0x41f81c){return _0x41e458['sendStatus'](_0x1960f0);}return _0x41e458[_0x9c59('0x25')](_0x1960f0)[_0x9c59('0x26')]();};}function respondWithResult(_0x214dcb,_0x3da24a){_0x3da24a=_0x3da24a||0xc8;return function(_0x190793){if(_0x190793){return _0x214dcb['status'](_0x3da24a)[_0x9c59('0x27')](_0x190793);}};}function respondWithFilteredResult(_0x9e8833,_0x4f497d){return function(_0x5d3856){if(_0x5d3856){var _0x28fecc=typeof _0x4f497d[_0x9c59('0x28')]===_0x9c59('0x29')&&typeof _0x4f497d[_0x9c59('0x2a')]==='undefined';var _0x10b971=_0x5d3856[_0x9c59('0x2b')];var _0x5664a6=_0x28fecc?0x0:_0x4f497d[_0x9c59('0x28')];var _0x5479aa=_0x28fecc?_0x5d3856[_0x9c59('0x2b')]:_0x4f497d[_0x9c59('0x28')]+_0x4f497d[_0x9c59('0x2a')];var _0x13387f;if(_0x5479aa>=_0x10b971){_0x5479aa=_0x10b971;_0x13387f=0xc8;}else{_0x13387f=0xce;}_0x9e8833[_0x9c59('0x25')](_0x13387f);return _0x9e8833[_0x9c59('0x2c')](_0x9c59('0x2d'),_0x5664a6+'-'+_0x5479aa+'/'+_0x10b971)[_0x9c59('0x27')](_0x5d3856);}return null;};}function patchUpdates(_0x2ac265){return function(_0x41726e){try{jsonpatch[_0x9c59('0x2e')](_0x41726e,_0x2ac265,!![]);}catch(_0xedf388){return BPromise[_0x9c59('0x2f')](_0xedf388);}return _0x41726e['save']();};}function saveUpdates(_0x46558b,_0x2ea01a){return function(_0x565184){if(_0x565184){return _0x565184['update'](_0x46558b)[_0x9c59('0x1c')](function(_0x288f12){return _0x288f12;});}return null;};}function removeEntity(_0x2c4d54,_0x3b9aa5){return function(_0x56434e){if(_0x56434e){return _0x56434e[_0x9c59('0x30')]()[_0x9c59('0x1c')](function(){_0x2c4d54['status'](0xcc)[_0x9c59('0x26')]();});}};}function handleEntityNotFound(_0x435d67,_0x47c725){return function(_0x145d4c){if(!_0x145d4c){_0x435d67['sendStatus'](0x194);}return _0x145d4c;};}function handleError(_0x2fc643,_0x122e8b){_0x122e8b=_0x122e8b||0x1f4;return function(_0x4b8eca){logger[_0x9c59('0x21')](_0x4b8eca['stack']);if(_0x4b8eca['name']){delete _0x4b8eca[_0x9c59('0x31')];}_0x2fc643['status'](_0x122e8b)[_0x9c59('0x32')](_0x4b8eca);};}exports['index']=function(_0x547718,_0x490f6e){var _0x3c0280={},_0x25d14a={},_0x30ca33={'count':0x0,'rows':[]};var _0x261c1e=_[_0x9c59('0x33')](db[_0x9c59('0x34')]['rawAttributes'],function(_0xeb9134){return{'name':_0xeb9134['fieldName'],'type':_0xeb9134[_0x9c59('0x35')][_0x9c59('0x36')]};});_0x25d14a[_0x9c59('0x37')]=_[_0x9c59('0x33')](_0x261c1e,_0x9c59('0x31'));_0x25d14a[_0x9c59('0x38')]=_['keys'](_0x547718[_0x9c59('0x38')]);_0x25d14a[_0x9c59('0x39')]=_[_0x9c59('0x3a')](_0x25d14a[_0x9c59('0x37')],_0x25d14a[_0x9c59('0x38')]);_0x3c0280[_0x9c59('0x3b')]=_['intersection'](_0x25d14a[_0x9c59('0x37')],qs[_0x9c59('0x3c')](_0x547718[_0x9c59('0x38')]['fields']));_0x3c0280[_0x9c59('0x3b')]=_0x3c0280[_0x9c59('0x3b')][_0x9c59('0x3d')]?_0x3c0280[_0x9c59('0x3b')]:_0x25d14a['model'];if(!_0x547718[_0x9c59('0x38')][_0x9c59('0x3e')](_0x9c59('0x3f'))){_0x3c0280[_0x9c59('0x2a')]=qs[_0x9c59('0x2a')](_0x547718[_0x9c59('0x38')]['limit']);_0x3c0280['offset']=qs['offset'](_0x547718['query'][_0x9c59('0x28')]);}_0x3c0280[_0x9c59('0x40')]=qs[_0x9c59('0x41')](_0x547718[_0x9c59('0x38')][_0x9c59('0x41')]);_0x3c0280['where']=qs['filters'](_[_0x9c59('0x42')](_0x547718[_0x9c59('0x38')],_0x25d14a[_0x9c59('0x39')]),_0x261c1e);if(_0x547718[_0x9c59('0x38')][_0x9c59('0x43')]){_0x3c0280[_0x9c59('0x44')]=_[_0x9c59('0x45')](_0x3c0280[_0x9c59('0x44')],{'$or':_[_0x9c59('0x33')](_0x261c1e,function(_0x169ded){if(_0x169ded[_0x9c59('0x35')]!==_0x9c59('0x46')){var _0x49f31d={};_0x49f31d[_0x169ded[_0x9c59('0x31')]]={'$like':'%'+_0x547718[_0x9c59('0x38')]['filter']+'%'};return _0x49f31d;}})});}_0x3c0280=_[_0x9c59('0x45')]({},_0x3c0280,_0x547718[_0x9c59('0x47')]);var _0x390dca={'where':_0x3c0280[_0x9c59('0x44')]};return db[_0x9c59('0x34')][_0x9c59('0x2b')](_0x390dca)[_0x9c59('0x1c')](function(_0x2188f7){_0x30ca33['count']=_0x2188f7;if(_0x547718[_0x9c59('0x38')]['includeAll']){_0x3c0280[_0x9c59('0x48')]=[{'all':!![]}];}return db[_0x9c59('0x34')][_0x9c59('0x49')](_0x3c0280);})[_0x9c59('0x1c')](function(_0x841640){_0x30ca33[_0x9c59('0x4a')]=_0x841640;return _0x30ca33;})[_0x9c59('0x1c')](respondWithFilteredResult(_0x490f6e,_0x3c0280))[_0x9c59('0x24')](handleError(_0x490f6e,null));};exports['show']=function(_0x2b9f99,_0x151d42){var _0x1bea98={'raw':!![],'where':{'id':_0x2b9f99[_0x9c59('0x4b')]['id']}},_0x405d65={};_0x405d65[_0x9c59('0x37')]=_[_0x9c59('0x4c')](db[_0x9c59('0x34')][_0x9c59('0x4d')]);_0x405d65['query']=_[_0x9c59('0x4c')](_0x2b9f99[_0x9c59('0x38')]);_0x405d65[_0x9c59('0x39')]=_[_0x9c59('0x3a')](_0x405d65['model'],_0x405d65[_0x9c59('0x38')]);_0x1bea98[_0x9c59('0x3b')]=_['intersection'](_0x405d65[_0x9c59('0x37')],qs['fields'](_0x2b9f99['query'][_0x9c59('0x3c')]));_0x1bea98[_0x9c59('0x3b')]=_0x1bea98[_0x9c59('0x3b')][_0x9c59('0x3d')]?_0x1bea98[_0x9c59('0x3b')]:_0x405d65['model'];if(_0x2b9f99[_0x9c59('0x38')][_0x9c59('0x4e')]){_0x1bea98[_0x9c59('0x48')]=[{'all':!![]}];}_0x1bea98=_[_0x9c59('0x45')]({},_0x1bea98,_0x2b9f99[_0x9c59('0x47')]);return db[_0x9c59('0x34')][_0x9c59('0x4f')](_0x1bea98)['then'](handleEntityNotFound(_0x151d42,null))[_0x9c59('0x1c')](respondWithResult(_0x151d42,null))[_0x9c59('0x24')](handleError(_0x151d42,null));};exports['create']=function(_0x280300,_0x373712){return db[_0x9c59('0x34')][_0x9c59('0x50')](_0x280300[_0x9c59('0x51')],{})['then'](respondWithResult(_0x373712,0xc9))[_0x9c59('0x24')](handleError(_0x373712,null));};exports[_0x9c59('0x52')]=function(_0xf31c4,_0xbf6918){if(_0xf31c4[_0x9c59('0x51')]['id']){delete _0xf31c4[_0x9c59('0x51')]['id'];}return db[_0x9c59('0x34')]['find']({'where':{'id':_0xf31c4['params']['id']}})[_0x9c59('0x1c')](handleEntityNotFound(_0xbf6918,null))[_0x9c59('0x1c')](saveUpdates(_0xf31c4[_0x9c59('0x51')],null))[_0x9c59('0x1c')](respondWithResult(_0xbf6918,null))[_0x9c59('0x24')](handleError(_0xbf6918,null));};exports['destroy']=function(_0x1acd80,_0x4cd16f){return db[_0x9c59('0x34')]['find']({'where':{'id':_0x1acd80[_0x9c59('0x4b')]['id']}})[_0x9c59('0x1c')](handleEntityNotFound(_0x4cd16f,null))[_0x9c59('0x1c')](removeEntity(_0x4cd16f,null))[_0x9c59('0x24')](handleError(_0x4cd16f,null));};exports[_0x9c59('0x53')]=function(_0x3f145e,_0x573837){return db['SmsMessage'][_0x9c59('0x53')]()[_0x9c59('0x1c')](respondWithResult(_0x573837,null))[_0x9c59('0x24')](handleError(_0x573837,null));};var interaction_log=require(_0x9c59('0x54'))('sms-interactions');exports[_0x9c59('0x55')]=function(_0x3ee0b2,_0x4c737b,_0x13aa5a){var _0x1af3d0={'agent':{},'channel':_0x9c59('0x56')};if(_0x3ee0b2[_0x9c59('0x51')]['id']){delete _0x3ee0b2[_0x9c59('0x51')]['id'];}_0x3ee0b2[_0x9c59('0x51')][_0x9c59('0x57')]=!![];_0x3ee0b2[_0x9c59('0x51')][_0x9c59('0x58')]=moment()[_0x9c59('0x59')](_0x9c59('0x5a'));_0x3ee0b2[_0x9c59('0x51')]['UserId']=_0x3ee0b2['body'][_0x9c59('0x5b')]||_0x3ee0b2['user']['id'];_0x1af3d0[_0x9c59('0x5c')]['id']=_0x3ee0b2[_0x9c59('0x51')][_0x9c59('0x5b')];return db['SmsMessage'][_0x9c59('0x4f')]({'where':{'id':_0x3ee0b2[_0x9c59('0x4b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4c737b,null))[_0x9c59('0x1c')](saveUpdates(_0x3ee0b2[_0x9c59('0x51')],null))[_0x9c59('0x1c')](function(_0x6313fe){if(_0x6313fe){_0x1af3d0[_0x9c59('0x23')]=_0x6313fe[_0x9c59('0x5d')]({'plain':!![]});return db[_0x9c59('0x5e')]['find']({'where':{'id':_0x6313fe[_0x9c59('0x5f')]}});}return null;})[_0x9c59('0x1c')](handleEntityNotFound(_0x4c737b,null))[_0x9c59('0x1c')](function(_0x3f6077){if(_0x3f6077){return _0x3f6077[_0x9c59('0x52')]({'UserId':_0x3ee0b2[_0x9c59('0x51')][_0x9c59('0x5b')],'read1stAt':_[_0x9c59('0x60')](_0x3f6077[_0x9c59('0x61')])?moment()['format'](_0x9c59('0x5a')):undefined});}return null;})[_0x9c59('0x1c')](function(_0x143a81){if(_0x143a81){_0x1af3d0['interaction']=_0x143a81[_0x9c59('0x5d')]({'plain':!![]});interaction_log['info'](_0x9c59('0x62'),_0x3ee0b2[_0x9c59('0x63')]['id'],_0x3ee0b2[_0x9c59('0x63')][_0x9c59('0x31')],_0x3ee0b2[_0x9c59('0x63')][_0x9c59('0x64')],_0x1af3d0[_0x9c59('0x65')]['id'],_0x3ee0b2['body']?JSON[_0x9c59('0x20')](_0x3ee0b2['body']):_0x9c59('0x66'));return respondWithRpcPromise(_0x9c59('0x67'),_0x9c59('0x68'),_0x1af3d0);}return null;})[_0x9c59('0x1c')](function(_0xd61c21){var _0x5f3210=_0x9c59('0x69')+_0xd61c21[_0x9c59('0x23')][_0x9c59('0x6a')];return db[_0x9c59('0x6b')]['query'](_0x5f3210,{'type':db[_0x9c59('0x6c')][_0x9c59('0x6d')][_0x9c59('0x6e')],'raw':!![]})[_0x9c59('0x1c')](function(_0x1b7ed){return _0x1b7ed;});})[_0x9c59('0x1c')](function(_0x240b13){if(_0x240b13){_0x1af3d0[_0x9c59('0x23')]['contact']=_0x240b13[0x0];if(!_0x3ee0b2['body'][_0x9c59('0x5b')])return;return db[_0x9c59('0x6f')][_0x9c59('0x4f')]({'where':{'id':_0x3ee0b2[_0x9c59('0x51')][_0x9c59('0x5b')],'role':'agent'},'attributes':['id',_0x9c59('0x31'),_0x9c59('0x70'),_0x9c59('0x71'),_0x9c59('0x72')],'raw':!![]});}return null;})[_0x9c59('0x1c')](function(_0x3a920b){if(!_0x3a920b)return null;_0x1af3d0[_0x9c59('0x23')][_0x9c59('0x5c')]=_0x3a920b;return _0x1af3d0;})[_0x9c59('0x1c')](function(_0x165281){if(_0x165281){if(_0x3ee0b2['body'][_0x9c59('0x73')]){_0x1af3d0[_0x9c59('0x23')][_0x9c59('0x74')]=util['format'](_0x9c59('0x75'),_0x3ee0b2[_0x9c59('0x63')][_0x9c59('0x31')]);_0x1af3d0[_0x9c59('0x23')]['channel']=_0x1af3d0[_0x9c59('0x76')];_0x1af3d0['message'][_0x9c59('0x77')]=_0x1af3d0[_0x9c59('0x76')];_0x1af3d0[_0x9c59('0x23')][_0x9c59('0x78')]=_0x9c59('0x55');return respondWithRpcPromise(_0x9c59('0x79'),_0x9c59('0x79'),{'event':_0x9c59('0x7a'),'message':_0x1af3d0['message']},client9002)['then'](function(){return _0x1af3d0;});}return _0x1af3d0;}return null;})['then'](respondWithResult(_0x4c737b,null))[_0x9c59('0x24')](handleError(_0x4c737b,null));};var interaction_log=require(_0x9c59('0x54'))(_0x9c59('0x7b'));exports[_0x9c59('0x2f')]=function(_0x1f04fb,_0x4e4197,_0xeb6cd3){var _0x2ca6be={'agent':{},'channel':'sms'};if(_0x1f04fb[_0x9c59('0x51')]['id']){delete _0x1f04fb[_0x9c59('0x51')]['id'];}_0x1f04fb[_0x9c59('0x51')][_0x9c59('0x5b')]=_0x1f04fb[_0x9c59('0x51')][_0x9c59('0x5b')]||_0x1f04fb[_0x9c59('0x63')]['id'];_0x2ca6be[_0x9c59('0x5c')]['id']=_0x1f04fb[_0x9c59('0x51')][_0x9c59('0x5b')];return db[_0x9c59('0x34')][_0x9c59('0x4f')]({'where':{'id':_0x1f04fb[_0x9c59('0x4b')]['id'],'UserId':null}})[_0x9c59('0x1c')](handleEntityNotFound(_0x4e4197,null))['then'](function(_0x454940){if(_0x454940){_0x2ca6be[_0x9c59('0x23')]=_0x454940[_0x9c59('0x5d')]({'plain':!![]});return db[_0x9c59('0x5e')][_0x9c59('0x4f')]({'where':{'id':_0x454940[_0x9c59('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x4e4197,null))['then'](function(_0x22b2ea){if(_0x22b2ea){_0x2ca6be[_0x9c59('0x65')]=_0x22b2ea[_0x9c59('0x5d')]({'plain':!![]});interaction_log[_0x9c59('0x1d')](_0x9c59('0x7c'),_0x1f04fb[_0x9c59('0x63')]['id'],_0x1f04fb[_0x9c59('0x63')][_0x9c59('0x31')],_0x1f04fb[_0x9c59('0x63')][_0x9c59('0x64')],_0x2ca6be[_0x9c59('0x65')]['id'],_0x1f04fb['body']?JSON['stringify'](_0x1f04fb[_0x9c59('0x51')]):'null');return respondWithRpcPromise(_0x9c59('0x7d'),_0x9c59('0x7e'),_0x2ca6be);}return null;})[_0x9c59('0x1c')](function(_0x4fd5f){var _0x601505=_0x9c59('0x69')+_0x4fd5f[_0x9c59('0x23')]['ContactId'];return db['sequelize']['query'](_0x601505,{'type':db[_0x9c59('0x6c')][_0x9c59('0x6d')][_0x9c59('0x6e')],'raw':!![]})['then'](function(_0x231d5b){return _0x231d5b;});})[_0x9c59('0x1c')](function(_0x438a62){if(_0x438a62){_0x2ca6be[_0x9c59('0x23')][_0x9c59('0x7f')]=_0x438a62[0x0];if(!_0x1f04fb[_0x9c59('0x51')][_0x9c59('0x5b')])return;return db['User'][_0x9c59('0x4f')]({'where':{'id':_0x1f04fb[_0x9c59('0x51')]['UserId'],'role':_0x9c59('0x5c')},'attributes':['id',_0x9c59('0x31'),'fullname',_0x9c59('0x71'),_0x9c59('0x72')],'raw':!![]});}return null;})[_0x9c59('0x1c')](function(_0x5d5143){if(!_0x5d5143)return null;_0x2ca6be[_0x9c59('0x23')]['agent']=_0x5d5143;return _0x2ca6be;})[_0x9c59('0x1c')](function(_0x53e06e){if(_0x53e06e){_0x53e06e[_0x9c59('0x23')]['interface']=util[_0x9c59('0x59')](_0x9c59('0x75'),_0x1f04fb['user'][_0x9c59('0x31')]);_0x53e06e[_0x9c59('0x23')][_0x9c59('0x76')]=_0x2ca6be['channel'];_0x53e06e[_0x9c59('0x23')]['motionChannel']=_0x2ca6be[_0x9c59('0x76')];_0x53e06e[_0x9c59('0x23')][_0x9c59('0x78')]=_0x9c59('0x2f');respondWithRpcPromise(_0x9c59('0x79'),_0x9c59('0x79'),{'event':_0x9c59('0x80'),'message':_0x53e06e[_0x9c59('0x23')]},client9002);return _0x2ca6be;}return null;})['then'](respondWithResult(_0x4e4197,null))[_0x9c59('0x24')](handleError(_0x4e4197,null));};exports['status']=function(_0x4ec30f,_0x71e275,_0x3d8710){if(_0x4ec30f[_0x9c59('0x51')]['id']){delete _0x4ec30f[_0x9c59('0x51')]['id'];}var _0x231ce0;return db['SmsMessage']['find']({'where':{'id':_0x4ec30f[_0x9c59('0x4b')]['id']}})[_0x9c59('0x1c')](handleEntityNotFound(_0x71e275,null))[_0x9c59('0x1c')](function(_0x36780a){if(_0x36780a){_0x231ce0=_0x36780a;return db[_0x9c59('0x81')][_0x9c59('0x4f')]({'where':{'id':_0x36780a[_0x9c59('0x82')]}});}})[_0x9c59('0x1c')](handleEntityNotFound(_0x71e275,null))[_0x9c59('0x1c')](function(_0x884204){if(_0x884204){logger['debug'](_0x9c59('0x83'),_0x9c59('0x25'),'received\x20delivery\x20report\x20from',_0x884204[_0x9c59('0x35')],util[_0x9c59('0x84')](_0x4ec30f[_0x9c59('0x51')],{'showHidden':![],'depth':null}));switch(_0x884204[_0x9c59('0x35')]){case _0x9c59('0x85'):if(_0x4ec30f[_0x9c59('0x51')]['MessageSid']&&_0x4ec30f['body'][_0x9c59('0x86')]===_0x231ce0[_0x9c59('0x87')]){return _0x231ce0[_0x9c59('0x52')]({'read':!![]});}else{logger['error'](_0x9c59('0x88'),_0x9c59('0x25'),_0x9c59('0x85'),util[_0x9c59('0x84')](_0x4ec30f['body'],{'showHidden':![],'depth':null}));}break;case _0x9c59('0x89'):if(_0x4ec30f['body']['MessageUUID']&&_0x4ec30f['body'][_0x9c59('0x8a')]===_0x231ce0[_0x9c59('0x87')]&&_[_0x9c59('0x8b')](['sent',_0x9c59('0x8c')],_0x4ec30f[_0x9c59('0x51')][_0x9c59('0x8d')])>=0x0){return _0x231ce0[_0x9c59('0x52')]({'read':!![]});}else{logger[_0x9c59('0x21')](_0x9c59('0x88'),'status','plivio',util['inspect'](_0x4ec30f[_0x9c59('0x51')],{'showHidden':![],'depth':null}));}break;case _0x9c59('0x8e'):var _0x287936=_0x4ec30f['body']['results'][0x0];if(_0x287936['status'][_0x9c59('0x8f')]===_0x9c59('0x90')){return _0x231ce0[_0x9c59('0x52')]({'read':!![]});}else{logger[_0x9c59('0x21')](_0x9c59('0x88'),_0x9c59('0x25'),_0x9c59('0x8e'),util[_0x9c59('0x84')](_0x4ec30f['body'],{'showHidden':![],'depth':null}));}break;}return _0x231ce0;}})[_0x9c59('0x1c')](respondWithResult(_0x71e275,null))[_0x9c59('0x24')](handleError(_0x71e275,null));}; \ No newline at end of file +var _0xeb0f=['pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','body','find','describe','../../config/logger','sms-interactions','sms','read','readAt','format','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE: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','contact','User','fullname','email','internal','interface','channel','motionChannel','accept','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','rejectmessage','SmsAccountId','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','Status','plivio','infobip','groupName','DELIVERED','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../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','message','result','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2b1634,_0x3a4201){var _0x357d97=function(_0x4495c6){while(--_0x4495c6){_0x2b1634['push'](_0x2b1634['shift']());}};_0x357d97(++_0x3a4201);}(_0xeb0f,0x176));var _0xfeb0=function(_0x399e47,_0x4fd7b2){_0x399e47=_0x399e47-0x0;var _0x37eab3=_0xeb0f[_0x399e47];return _0x37eab3;};'use strict';var emlformat=require(_0xfeb0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfeb0('0x1'));var jsonpatch=require(_0xfeb0('0x2'));var rp=require(_0xfeb0('0x3'));var moment=require(_0xfeb0('0x4'));var BPromise=require(_0xfeb0('0x5'));var Mustache=require(_0xfeb0('0x6'));var util=require('util');var path=require(_0xfeb0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfeb0('0x8'));var fs=require('fs');var fs_extra=require(_0xfeb0('0x9'));var _=require(_0xfeb0('0xa'));var squel=require(_0xfeb0('0xb'));var crypto=require(_0xfeb0('0xc'));var jsforce=require(_0xfeb0('0xd'));var deskjs=require(_0xfeb0('0xe'));var toCsv=require(_0xfeb0('0xf'));var querystring=require(_0xfeb0('0x10'));var Papa=require(_0xfeb0('0x11'));var Redis=require(_0xfeb0('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfeb0('0x13'));var hardwareService=require(_0xfeb0('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xfeb0('0x15'));var config=require(_0xfeb0('0x16'));var licenseUtil=require(_0xfeb0('0x17'));var db=require(_0xfeb0('0x18'))['db'];config[_0xfeb0('0x19')]=_['defaults'](config[_0xfeb0('0x19')],{'host':_0xfeb0('0x1a'),'port':0x18eb});var socket=require(_0xfeb0('0x1b'))(new Redis(config[_0xfeb0('0x19')]));require(_0xfeb0('0x1c'))[_0xfeb0('0x1d')](socket);var jayson=require(_0xfeb0('0x1e'));var client=jayson[_0xfeb0('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0xfeb0('0x1f')][_0xfeb0('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1d7f72,_0x58662b,_0x4f0c65,_0x4ede0e){return new BPromise(function(_0x1aa982,_0x4714cb){var _0x3428ee=_0x4ede0e||client;return _0x3428ee[_0xfeb0('0x21')](_0x1d7f72,_0x4f0c65)[_0xfeb0('0x22')](function(_0x82a86e){logger[_0xfeb0('0x23')](_0xfeb0('0x24'),_0x58662b,'request\x20sent');logger[_0xfeb0('0x25')](_0xfeb0('0x26'),_0x58662b,'request\x20sent',JSON[_0xfeb0('0x27')](_0x82a86e));if(_0x82a86e[_0xfeb0('0x28')]){if(_0x82a86e[_0xfeb0('0x28')]['code']===0x1f4){logger[_0xfeb0('0x28')]('SmsMessage,\x20%s,\x20%s',_0x58662b,_0x82a86e[_0xfeb0('0x28')][_0xfeb0('0x29')]);return _0x4714cb(_0x82a86e[_0xfeb0('0x28')][_0xfeb0('0x29')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x58662b,_0x82a86e[_0xfeb0('0x28')]['message']);return _0x1aa982(_0x82a86e[_0xfeb0('0x28')][_0xfeb0('0x29')]);}else{logger[_0xfeb0('0x23')](_0xfeb0('0x24'),_0x58662b,'request\x20sent');_0x1aa982(_0x82a86e[_0xfeb0('0x2a')][_0xfeb0('0x29')]);}})['catch'](function(_0x73119e){logger[_0xfeb0('0x28')](_0xfeb0('0x24'),_0x58662b,_0x73119e);_0x4714cb(_0x73119e);});});}function respondWithStatusCode(_0x388c62,_0x2114dc){_0x2114dc=_0x2114dc||0xcc;return function(_0x34ba8f){if(_0x34ba8f){return _0x388c62[_0xfeb0('0x2b')](_0x2114dc);}return _0x388c62[_0xfeb0('0x2c')](_0x2114dc)[_0xfeb0('0x2d')]();};}function respondWithResult(_0x547d4c,_0x44811a){_0x44811a=_0x44811a||0xc8;return function(_0x2f4d02){if(_0x2f4d02){return _0x547d4c['status'](_0x44811a)[_0xfeb0('0x2e')](_0x2f4d02);}};}function respondWithFilteredResult(_0x2f875c,_0x2a2b52){return function(_0x14eed2){if(_0x14eed2){var _0x58cf1=typeof _0x2a2b52['offset']===_0xfeb0('0x2f')&&typeof _0x2a2b52['limit']==='undefined';var _0x4cd828=_0x14eed2[_0xfeb0('0x30')];var _0x40cd34=_0x58cf1?0x0:_0x2a2b52[_0xfeb0('0x31')];var _0x4c4fe6=_0x58cf1?_0x14eed2[_0xfeb0('0x30')]:_0x2a2b52[_0xfeb0('0x31')]+_0x2a2b52[_0xfeb0('0x32')];var _0x266edb;if(_0x4c4fe6>=_0x4cd828){_0x4c4fe6=_0x4cd828;_0x266edb=0xc8;}else{_0x266edb=0xce;}_0x2f875c[_0xfeb0('0x2c')](_0x266edb);return _0x2f875c[_0xfeb0('0x33')]('Content-Range',_0x40cd34+'-'+_0x4c4fe6+'/'+_0x4cd828)['json'](_0x14eed2);}return null;};}function patchUpdates(_0x14bc1b){return function(_0x5d188e){try{jsonpatch[_0xfeb0('0x34')](_0x5d188e,_0x14bc1b,!![]);}catch(_0x1dde16){return BPromise[_0xfeb0('0x35')](_0x1dde16);}return _0x5d188e[_0xfeb0('0x36')]();};}function saveUpdates(_0x45d664,_0x45ba50){return function(_0x11cfe6){if(_0x11cfe6){return _0x11cfe6[_0xfeb0('0x37')](_0x45d664)[_0xfeb0('0x22')](function(_0x37a1d9){return _0x37a1d9;});}return null;};}function removeEntity(_0x41295c,_0x2cb4fb){return function(_0x28d4a6){if(_0x28d4a6){return _0x28d4a6[_0xfeb0('0x38')]()[_0xfeb0('0x22')](function(){_0x41295c[_0xfeb0('0x2c')](0xcc)[_0xfeb0('0x2d')]();});}};}function handleEntityNotFound(_0x4e047d,_0x20b206){return function(_0x33fe82){if(!_0x33fe82){_0x4e047d['sendStatus'](0x194);}return _0x33fe82;};}function handleError(_0xc694d9,_0x11215f){_0x11215f=_0x11215f||0x1f4;return function(_0x369a15){logger[_0xfeb0('0x28')](_0x369a15[_0xfeb0('0x39')]);if(_0x369a15['name']){delete _0x369a15[_0xfeb0('0x3a')];}_0xc694d9['status'](_0x11215f)[_0xfeb0('0x3b')](_0x369a15);};}exports[_0xfeb0('0x3c')]=function(_0x5acd6f,_0x3851fb){var _0x58a729={},_0x2888f2={},_0x2dc8fe={'count':0x0,'rows':[]};var _0x3a545b=_[_0xfeb0('0x3d')](db[_0xfeb0('0x3e')][_0xfeb0('0x3f')],function(_0x27a6ae){return{'name':_0x27a6ae[_0xfeb0('0x40')],'type':_0x27a6ae[_0xfeb0('0x41')]['key']};});_0x2888f2[_0xfeb0('0x42')]=_[_0xfeb0('0x3d')](_0x3a545b,_0xfeb0('0x3a'));_0x2888f2[_0xfeb0('0x43')]=_[_0xfeb0('0x44')](_0x5acd6f['query']);_0x2888f2[_0xfeb0('0x45')]=_[_0xfeb0('0x46')](_0x2888f2[_0xfeb0('0x42')],_0x2888f2[_0xfeb0('0x43')]);_0x58a729['attributes']=_[_0xfeb0('0x46')](_0x2888f2[_0xfeb0('0x42')],qs[_0xfeb0('0x47')](_0x5acd6f[_0xfeb0('0x43')][_0xfeb0('0x47')]));_0x58a729[_0xfeb0('0x48')]=_0x58a729['attributes'][_0xfeb0('0x49')]?_0x58a729['attributes']:_0x2888f2[_0xfeb0('0x42')];if(!_0x5acd6f['query'][_0xfeb0('0x4a')](_0xfeb0('0x4b'))){_0x58a729[_0xfeb0('0x32')]=qs[_0xfeb0('0x32')](_0x5acd6f[_0xfeb0('0x43')][_0xfeb0('0x32')]);_0x58a729[_0xfeb0('0x31')]=qs[_0xfeb0('0x31')](_0x5acd6f[_0xfeb0('0x43')]['offset']);}_0x58a729[_0xfeb0('0x4c')]=qs['sort'](_0x5acd6f[_0xfeb0('0x43')][_0xfeb0('0x4d')]);_0x58a729[_0xfeb0('0x4e')]=qs[_0xfeb0('0x45')](_[_0xfeb0('0x4f')](_0x5acd6f['query'],_0x2888f2['filters']),_0x3a545b);if(_0x5acd6f[_0xfeb0('0x43')][_0xfeb0('0x50')]){_0x58a729[_0xfeb0('0x4e')]=_[_0xfeb0('0x51')](_0x58a729[_0xfeb0('0x4e')],{'$or':_[_0xfeb0('0x3d')](_0x3a545b,function(_0x12d24f){if(_0x12d24f[_0xfeb0('0x41')]!==_0xfeb0('0x52')){var _0x130916={};_0x130916[_0x12d24f['name']]={'$like':'%'+_0x5acd6f[_0xfeb0('0x43')][_0xfeb0('0x50')]+'%'};return _0x130916;}})});}_0x58a729=_['merge']({},_0x58a729,_0x5acd6f[_0xfeb0('0x53')]);var _0x3ee041={'where':_0x58a729[_0xfeb0('0x4e')]};return db['SmsMessage'][_0xfeb0('0x30')](_0x3ee041)[_0xfeb0('0x22')](function(_0x5dfbdb){_0x2dc8fe[_0xfeb0('0x30')]=_0x5dfbdb;if(_0x5acd6f[_0xfeb0('0x43')][_0xfeb0('0x54')]){_0x58a729['include']=[{'all':!![]}];}return db['SmsMessage'][_0xfeb0('0x55')](_0x58a729);})['then'](function(_0x2ab71c){_0x2dc8fe[_0xfeb0('0x56')]=_0x2ab71c;return _0x2dc8fe;})[_0xfeb0('0x22')](respondWithFilteredResult(_0x3851fb,_0x58a729))[_0xfeb0('0x57')](handleError(_0x3851fb,null));};exports[_0xfeb0('0x58')]=function(_0x2bd414,_0x41de77){var _0x5ef8f9={'raw':!![],'where':{'id':_0x2bd414[_0xfeb0('0x59')]['id']}},_0x52ebfd={};_0x52ebfd['model']=_[_0xfeb0('0x44')](db['SmsMessage']['rawAttributes']);_0x52ebfd[_0xfeb0('0x43')]=_[_0xfeb0('0x44')](_0x2bd414[_0xfeb0('0x43')]);_0x52ebfd[_0xfeb0('0x45')]=_[_0xfeb0('0x46')](_0x52ebfd[_0xfeb0('0x42')],_0x52ebfd[_0xfeb0('0x43')]);_0x5ef8f9[_0xfeb0('0x48')]=_[_0xfeb0('0x46')](_0x52ebfd[_0xfeb0('0x42')],qs[_0xfeb0('0x47')](_0x2bd414[_0xfeb0('0x43')][_0xfeb0('0x47')]));_0x5ef8f9[_0xfeb0('0x48')]=_0x5ef8f9[_0xfeb0('0x48')]['length']?_0x5ef8f9['attributes']:_0x52ebfd[_0xfeb0('0x42')];if(_0x2bd414['query'][_0xfeb0('0x54')]){_0x5ef8f9[_0xfeb0('0x5a')]=[{'all':!![]}];}_0x5ef8f9=_[_0xfeb0('0x51')]({},_0x5ef8f9,_0x2bd414[_0xfeb0('0x53')]);return db['SmsMessage']['find'](_0x5ef8f9)['then'](handleEntityNotFound(_0x41de77,null))[_0xfeb0('0x22')](respondWithResult(_0x41de77,null))[_0xfeb0('0x57')](handleError(_0x41de77,null));};exports['create']=function(_0x11e95f,_0x1dc290){return db[_0xfeb0('0x3e')]['create'](_0x11e95f['body'],{})[_0xfeb0('0x22')](respondWithResult(_0x1dc290,0xc9))[_0xfeb0('0x57')](handleError(_0x1dc290,null));};exports[_0xfeb0('0x37')]=function(_0x2fa55b,_0x33c64f){if(_0x2fa55b[_0xfeb0('0x5b')]['id']){delete _0x2fa55b[_0xfeb0('0x5b')]['id'];}return db[_0xfeb0('0x3e')]['find']({'where':{'id':_0x2fa55b[_0xfeb0('0x59')]['id']}})[_0xfeb0('0x22')](handleEntityNotFound(_0x33c64f,null))[_0xfeb0('0x22')](saveUpdates(_0x2fa55b['body'],null))[_0xfeb0('0x22')](respondWithResult(_0x33c64f,null))[_0xfeb0('0x57')](handleError(_0x33c64f,null));};exports['destroy']=function(_0xafb423,_0xf2025b){return db[_0xfeb0('0x3e')][_0xfeb0('0x5c')]({'where':{'id':_0xafb423[_0xfeb0('0x59')]['id']}})['then'](handleEntityNotFound(_0xf2025b,null))[_0xfeb0('0x22')](removeEntity(_0xf2025b,null))[_0xfeb0('0x57')](handleError(_0xf2025b,null));};exports[_0xfeb0('0x5d')]=function(_0x4d02e4,_0x4dd525){return db[_0xfeb0('0x3e')][_0xfeb0('0x5d')]()['then'](respondWithResult(_0x4dd525,null))[_0xfeb0('0x57')](handleError(_0x4dd525,null));};var interaction_log=require(_0xfeb0('0x5e'))(_0xfeb0('0x5f'));exports['accept']=function(_0x351d55,_0xca4e9c,_0x2b6c7b){var _0x3321e7={'agent':{},'channel':_0xfeb0('0x60')};if(_0x351d55[_0xfeb0('0x5b')]['id']){delete _0x351d55[_0xfeb0('0x5b')]['id'];}_0x351d55['body'][_0xfeb0('0x61')]=!![];_0x351d55[_0xfeb0('0x5b')][_0xfeb0('0x62')]=moment()[_0xfeb0('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x351d55['body'][_0xfeb0('0x64')]=_0x351d55[_0xfeb0('0x5b')][_0xfeb0('0x64')]||_0x351d55[_0xfeb0('0x65')]['id'];_0x3321e7[_0xfeb0('0x66')]['id']=_0x351d55[_0xfeb0('0x5b')][_0xfeb0('0x64')];return db[_0xfeb0('0x3e')][_0xfeb0('0x5c')]({'where':{'id':_0x351d55[_0xfeb0('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0xca4e9c,null))[_0xfeb0('0x22')](saveUpdates(_0x351d55['body'],null))['then'](function(_0x21a359){if(_0x21a359){_0x3321e7['message']=_0x21a359[_0xfeb0('0x67')]({'plain':!![]});return db[_0xfeb0('0x68')][_0xfeb0('0x5c')]({'where':{'id':_0x21a359[_0xfeb0('0x69')]}});}return null;})[_0xfeb0('0x22')](handleEntityNotFound(_0xca4e9c,null))['then'](function(_0x2ef790){if(_0x2ef790){return _0x2ef790['update']({'UserId':_0x351d55[_0xfeb0('0x5b')]['UserId'],'read1stAt':_['isNil'](_0x2ef790[_0xfeb0('0x6a')])?moment()[_0xfeb0('0x63')](_0xfeb0('0x6b')):undefined});}return null;})[_0xfeb0('0x22')](function(_0x5f51a1){if(_0x5f51a1){_0x3321e7[_0xfeb0('0x6c')]=_0x5f51a1[_0xfeb0('0x67')]({'plain':!![]});interaction_log['info'](_0xfeb0('0x6d'),_0x351d55[_0xfeb0('0x65')]['id'],_0x351d55[_0xfeb0('0x65')][_0xfeb0('0x3a')],_0x351d55[_0xfeb0('0x65')][_0xfeb0('0x6e')],_0x3321e7[_0xfeb0('0x6c')]['id'],_0x351d55['body']?JSON[_0xfeb0('0x27')](_0x351d55[_0xfeb0('0x5b')]):_0xfeb0('0x6f'));return respondWithRpcPromise(_0xfeb0('0x70'),_0xfeb0('0x71'),_0x3321e7);}return null;})['then'](function(_0x43cf8e){var _0x2dd7d3=_0xfeb0('0x72')+_0x43cf8e[_0xfeb0('0x29')][_0xfeb0('0x73')];return db[_0xfeb0('0x74')][_0xfeb0('0x43')](_0x2dd7d3,{'type':db[_0xfeb0('0x75')][_0xfeb0('0x76')][_0xfeb0('0x77')],'raw':!![]})[_0xfeb0('0x22')](function(_0x167532){return _0x167532;});})[_0xfeb0('0x22')](function(_0x438a3a){if(_0x438a3a){_0x3321e7[_0xfeb0('0x29')][_0xfeb0('0x78')]=_0x438a3a[0x0];if(!_0x351d55['body'][_0xfeb0('0x64')])return;return db[_0xfeb0('0x79')][_0xfeb0('0x5c')]({'where':{'id':_0x351d55[_0xfeb0('0x5b')][_0xfeb0('0x64')],'role':_0xfeb0('0x66')},'attributes':['id',_0xfeb0('0x3a'),_0xfeb0('0x7a'),_0xfeb0('0x7b'),_0xfeb0('0x7c')],'raw':!![]});}return null;})[_0xfeb0('0x22')](function(_0x503f8e){if(!_0x503f8e)return null;_0x3321e7[_0xfeb0('0x29')]['agent']=_0x503f8e;return _0x3321e7;})['then'](function(_0x502db6){if(_0x502db6){if(_0x351d55[_0xfeb0('0x5b')]['manual']){_0x3321e7['message'][_0xfeb0('0x7d')]=util[_0xfeb0('0x63')]('SIP/%s',_0x351d55[_0xfeb0('0x65')]['name']);_0x3321e7[_0xfeb0('0x29')][_0xfeb0('0x7e')]=_0x3321e7[_0xfeb0('0x7e')];_0x3321e7['message'][_0xfeb0('0x7f')]=_0x3321e7[_0xfeb0('0x7e')];_0x3321e7[_0xfeb0('0x29')]['event']=_0xfeb0('0x80');return respondWithRpcPromise(_0xfeb0('0x81'),_0xfeb0('0x81'),{'event':_0xfeb0('0x82'),'message':_0x3321e7[_0xfeb0('0x29')]},client9002)['then'](function(){return _0x3321e7;});}return _0x3321e7;}return null;})['then'](respondWithResult(_0xca4e9c,null))['catch'](handleError(_0xca4e9c,null));};var interaction_log=require(_0xfeb0('0x5e'))('sms-interactions');exports[_0xfeb0('0x35')]=function(_0x2a58aa,_0x435dc8,_0x51d242){var _0x4b6a93={'agent':{},'channel':_0xfeb0('0x60')};if(_0x2a58aa[_0xfeb0('0x5b')]['id']){delete _0x2a58aa[_0xfeb0('0x5b')]['id'];}_0x2a58aa[_0xfeb0('0x5b')]['UserId']=_0x2a58aa[_0xfeb0('0x5b')]['UserId']||_0x2a58aa[_0xfeb0('0x65')]['id'];_0x4b6a93[_0xfeb0('0x66')]['id']=_0x2a58aa[_0xfeb0('0x5b')]['UserId'];return db[_0xfeb0('0x3e')]['find']({'where':{'id':_0x2a58aa[_0xfeb0('0x59')]['id'],'UserId':null}})[_0xfeb0('0x22')](handleEntityNotFound(_0x435dc8,null))[_0xfeb0('0x22')](function(_0x41d150){if(_0x41d150){_0x4b6a93[_0xfeb0('0x29')]=_0x41d150[_0xfeb0('0x67')]({'plain':!![]});return db[_0xfeb0('0x68')][_0xfeb0('0x5c')]({'where':{'id':_0x41d150[_0xfeb0('0x69')]}});}return null;})[_0xfeb0('0x22')](handleEntityNotFound(_0x435dc8,null))[_0xfeb0('0x22')](function(_0x40e2f8){if(_0x40e2f8){_0x4b6a93[_0xfeb0('0x6c')]=_0x40e2f8[_0xfeb0('0x67')]({'plain':!![]});interaction_log[_0xfeb0('0x23')](_0xfeb0('0x83'),_0x2a58aa['user']['id'],_0x2a58aa[_0xfeb0('0x65')][_0xfeb0('0x3a')],_0x2a58aa['user'][_0xfeb0('0x6e')],_0x4b6a93[_0xfeb0('0x6c')]['id'],_0x2a58aa['body']?JSON[_0xfeb0('0x27')](_0x2a58aa[_0xfeb0('0x5b')]):_0xfeb0('0x6f'));return respondWithRpcPromise(_0xfeb0('0x84'),_0xfeb0('0x85'),_0x4b6a93);}return null;})[_0xfeb0('0x22')](function(_0x56a2e6){var _0x2ed16c=_0xfeb0('0x72')+_0x56a2e6[_0xfeb0('0x29')][_0xfeb0('0x73')];return db[_0xfeb0('0x74')]['query'](_0x2ed16c,{'type':db[_0xfeb0('0x75')][_0xfeb0('0x76')][_0xfeb0('0x77')],'raw':!![]})[_0xfeb0('0x22')](function(_0x3e275a){return _0x3e275a;});})[_0xfeb0('0x22')](function(_0x727c2d){if(_0x727c2d){_0x4b6a93[_0xfeb0('0x29')][_0xfeb0('0x78')]=_0x727c2d[0x0];if(!_0x2a58aa[_0xfeb0('0x5b')][_0xfeb0('0x64')])return;return db['User'][_0xfeb0('0x5c')]({'where':{'id':_0x2a58aa['body'][_0xfeb0('0x64')],'role':'agent'},'attributes':['id',_0xfeb0('0x3a'),_0xfeb0('0x7a'),_0xfeb0('0x7b'),_0xfeb0('0x7c')],'raw':!![]});}return null;})['then'](function(_0x34fb6d){if(!_0x34fb6d)return null;_0x4b6a93['message'][_0xfeb0('0x66')]=_0x34fb6d;return _0x4b6a93;})[_0xfeb0('0x22')](function(_0x191146){if(_0x191146){_0x191146[_0xfeb0('0x29')][_0xfeb0('0x7d')]=util[_0xfeb0('0x63')]('SIP/%s',_0x2a58aa[_0xfeb0('0x65')][_0xfeb0('0x3a')]);_0x191146['message'][_0xfeb0('0x7e')]=_0x4b6a93[_0xfeb0('0x7e')];_0x191146[_0xfeb0('0x29')]['motionChannel']=_0x4b6a93[_0xfeb0('0x7e')];_0x191146[_0xfeb0('0x29')][_0xfeb0('0x86')]='reject';respondWithRpcPromise('EventManager',_0xfeb0('0x81'),{'event':_0xfeb0('0x87'),'message':_0x191146[_0xfeb0('0x29')]},client9002);return _0x4b6a93;}return null;})['then'](respondWithResult(_0x435dc8,null))[_0xfeb0('0x57')](handleError(_0x435dc8,null));};exports[_0xfeb0('0x2c')]=function(_0x58cdde,_0xd59620,_0x57acc7){if(_0x58cdde['body']['id']){delete _0x58cdde[_0xfeb0('0x5b')]['id'];}var _0x56a191;return db['SmsMessage']['find']({'where':{'id':_0x58cdde[_0xfeb0('0x59')]['id']}})[_0xfeb0('0x22')](handleEntityNotFound(_0xd59620,null))['then'](function(_0x5d4a02){if(_0x5d4a02){_0x56a191=_0x5d4a02;return db['SmsAccount']['find']({'where':{'id':_0x5d4a02[_0xfeb0('0x88')]}});}})[_0xfeb0('0x22')](handleEntityNotFound(_0xd59620,null))[_0xfeb0('0x22')](function(_0x3902d7){if(_0x3902d7){logger[_0xfeb0('0x25')](_0xfeb0('0x26'),_0xfeb0('0x2c'),'received\x20delivery\x20report\x20from',_0x3902d7[_0xfeb0('0x41')],util['inspect'](_0x58cdde[_0xfeb0('0x5b')],{'showHidden':![],'depth':null}));switch(_0x3902d7[_0xfeb0('0x41')]){case _0xfeb0('0x89'):if(_0x58cdde['body'][_0xfeb0('0x8a')]&&_0x58cdde['body'][_0xfeb0('0x8a')]===_0x56a191[_0xfeb0('0x8b')]){return _0x56a191[_0xfeb0('0x37')]({'read':!![]});}else{logger[_0xfeb0('0x28')](_0xfeb0('0x8c'),_0xfeb0('0x2c'),'twilio',util[_0xfeb0('0x8d')](_0x58cdde[_0xfeb0('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xfeb0('0x8e'):if(_0x58cdde[_0xfeb0('0x5b')]['MessageUUID']&&_0x58cdde['body'][_0xfeb0('0x8f')]===_0x56a191['messageId']&&_[_0xfeb0('0x90')]([_0xfeb0('0x91'),'delivered'],_0x58cdde['body'][_0xfeb0('0x92')])>=0x0){return _0x56a191[_0xfeb0('0x37')]({'read':!![]});}else{logger[_0xfeb0('0x28')](_0xfeb0('0x8c'),_0xfeb0('0x2c'),_0xfeb0('0x93'),util['inspect'](_0x58cdde['body'],{'showHidden':![],'depth':null}));}break;case _0xfeb0('0x94'):var _0x36e26e=_0x58cdde[_0xfeb0('0x5b')]['results'][0x0];if(_0x36e26e['status'][_0xfeb0('0x95')]===_0xfeb0('0x96')){return _0x56a191[_0xfeb0('0x37')]({'read':!![]});}else{logger[_0xfeb0('0x28')](_0xfeb0('0x8c'),_0xfeb0('0x2c'),_0xfeb0('0x94'),util[_0xfeb0('0x8d')](_0x58cdde[_0xfeb0('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x56a191;}})['then'](respondWithResult(_0xd59620,null))['catch'](handleError(_0xd59620,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 1a99d22..1dc3270 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 _0xa3ec=['save','update','remove','emit','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3ec,0xae));var _0xca3e=function(_0x5a7857,_0x595b4d){_0x5a7857=_0x5a7857-0x0;var _0x2e40b7=_0xa3ec[_0x5a7857];return _0x2e40b7;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xca3e('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xca3e('0x1')](0x0);var events={'afterCreate':_0xca3e('0x2'),'afterUpdate':_0xca3e('0x3'),'afterDestroy':_0xca3e('0x4')};function emitEvent(_0x16da01){return function(_0x5253f5,_0x47fb57,_0x539d37){SmsMessageEvents[_0xca3e('0x5')](_0x16da01+':'+_0x5253f5['id'],_0x5253f5);SmsMessageEvents[_0xca3e('0x5')](_0x16da01,_0x5253f5);_0x539d37(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xca3e('0x6')](e,emitEvent(event));}}module[_0xca3e('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x75fe=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x75fe,0x162));var _0xe75f=function(_0x2930b8,_0x2e1d8b){_0x2930b8=_0x2930b8-0x0;var _0x3711bc=_0x75fe[_0x2930b8];return _0x3711bc;};'use strict';var EventEmitter=require(_0xe75f('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xe75f('0x1')](0x0);var events={'afterCreate':_0xe75f('0x2'),'afterUpdate':_0xe75f('0x3'),'afterDestroy':_0xe75f('0x4')};function emitEvent(_0xe043c){return function(_0x3b7848,_0x584cb7,_0x23937a){SmsMessageEvents['emit'](_0xe043c+':'+_0x3b7848['id'],_0x3b7848);SmsMessageEvents[_0xe75f('0x5')](_0xe043c,_0x3b7848);_0x23937a(null);};}for(var e in events){if(events[_0xe75f('0x6')](e)){var event=events[e];SmsMessage[_0xe75f('0x7')](e,emitEvent(event));}}module[_0xe75f('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 c1bd5a7..386ce90 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 _0x23d6=['secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','error','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create','remote','/status?token=','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','read','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','message_id','clickSend','plivo','authId','/api/sms/messages/','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','token','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','Missing\x20parameters:\x20username,\x20password','csc','login','text','timestamp','keys','sort','length','apiKey','createHash','digest','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','Token\x20not\x20received','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','out'];(function(_0x1c3370,_0xf617e8){var _0xa9b358=function(_0x39cb44){while(--_0x39cb44){_0x1c3370['push'](_0x1c3370['shift']());}};_0xa9b358(++_0xf617e8);}(_0x23d6,0x67));var _0x623d=function(_0x39a10e,_0x23c6a8){_0x39a10e=_0x39a10e-0x0;var _0x355d59=_0x23d6[_0x39a10e];return _0x355d59;};'use strict';var _=require('lodash');var util=require(_0x623d('0x0'));var logger=require(_0x623d('0x1'))(_0x623d('0x2'));var moment=require(_0x623d('0x3'));var BPromise=require('bluebird');var rp=require(_0x623d('0x4'));var fs=require('fs');var path=require(_0x623d('0x5'));var rimraf=require('rimraf');var config=require(_0x623d('0x6'));var attributes=require(_0x623d('0x7'));module[_0x623d('0x8')]=function(_0x5a3a37,_0x529640){return _0x5a3a37[_0x623d('0x9')](_0x623d('0xa'),attributes,{'tableName':_0x623d('0xb'),'paranoid':![],'indexes':[{'name':_0x623d('0xc'),'fields':[_0x623d('0xc')]},{'name':_0x623d('0xd'),'fields':[_0x623d('0xe')],'type':_0x623d('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x28876a,_0x8fc2cf,_0x133315){var _0x44c53b=_0x5a3a37[_0x623d('0x10')];var _0x55c443=_0x28876a[_0x623d('0x11')]({'plain':!![]});if(_0x55c443['direction'][_0x623d('0x12')]()==='in'||_0x55c443[_0x623d('0x13')][_0x623d('0x12')]()===_0x623d('0x14')&&!_0x55c443[_0x623d('0x15')]&&!_[_0x623d('0x16')](_0x55c443[_0x623d('0x17')])&&!_[_0x623d('0x16')](_0x55c443[_0x623d('0x18')])){_0x44c53b[_0x623d('0x19')][_0x623d('0x1a')]({'where':{'id':_0x55c443['SmsInteractionId']}})[_0x623d('0x1b')](function(_0x3b61d8){if(_0x3b61d8){_0x3b61d8[_0x623d('0x1c')]({'lastMsgAt':_0x55c443[_0x623d('0x1d')],'lastMsgDirection':_0x55c443['direction'][_0x623d('0x12')]()});}})[_0x623d('0x1e')](function(_0x345b35){console[_0x623d('0x1f')](_0x345b35);});}if(_0x55c443[_0x623d('0x13')]===_0x623d('0x14')&&!_0x55c443[_0x623d('0x15')]){var _0x38e468;_0x44c53b['SmsAccount']['find']({'where':{'id':_0x55c443[_0x623d('0x20')]},'raw':!![]})[_0x623d('0x1b')](function(_0x5b013e){_0x38e468=_0x5b013e;if(_0x38e468&&_0x38e468[_0x623d('0x21')]){switch(_0x38e468[_0x623d('0x21')]){case _0x623d('0x22'):var _0x434b3a=require(_0x623d('0x22'));if(_0x38e468['accountSid']&&_0x38e468[_0x623d('0x23')]&&_0x38e468[_0x623d('0x24')]){var _0x1070ed=new _0x434b3a(_0x38e468[_0x623d('0x25')],_0x38e468[_0x623d('0x23')]);_0x1070ed[_0x623d('0x26')][_0x623d('0x27')]({'body':_0x55c443[_0x623d('0xe')],'to':_0x55c443[_0x623d('0x24')],'from':_0x38e468[_0x623d('0x24')],'statusCallback':_0x38e468[_0x623d('0x28')]+'/api/sms/messages/'+_0x55c443['id']+_0x623d('0x29')+_0x38e468['token']})['then'](function(_0x2491d4){if(_0x2491d4['sid']){return _0x28876a[_0x623d('0x1c')]({'messageId':_0x2491d4['sid']});}})[_0x623d('0x1e')](function(_0x5df978){logger[_0x623d('0x1f')](_0x623d('0x2a'),_0x623d('0x2b'),_0x623d('0x22'),util[_0x623d('0x2c')](_0x5df978,{'showHidden':![],'depth':null}));});}else{logger[_0x623d('0x1f')](_0x623d('0x2a'),_0x623d('0x2b'),_0x623d('0x22'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x623d('0x2d'):var _0x1a55f9=_0x623d('0x2e');if(_0x38e468[_0x623d('0x2f')]&&_0x38e468[_0x623d('0x30')]){var _0x567ac6={'recipient':[_0x55c443[_0x623d('0x24')]],'message':_0x55c443[_0x623d('0xe')],'message_type':_0x38e468[_0x623d('0x31')]};if(_0x38e468[_0x623d('0x31')]&&_0x38e468[_0x623d('0x31')]!=='SI'){_0x567ac6[_0x623d('0x32')]=_0x38e468[_0x623d('0x24')];}var _0x59c147={'url':_0x1a55f9+_0x623d('0x33')+_0x38e468[_0x623d('0x2f')]+_0x623d('0x34')+_0x38e468[_0x623d('0x30')],'method':_0x623d('0x35')};rp(_0x59c147)[_0x623d('0x1b')](function(_0x1592c0){var _0x1b0b79=_0x1592c0[_0x623d('0x36')](';');var _0x117d94={'user_key':_0x1b0b79[0x0],'session_key':_0x1b0b79[0x1]};_0x59c147={'url':_0x1a55f9+_0x623d('0x37'),'method':_0x623d('0x38'),'headers':{'user_key':_0x117d94[_0x623d('0x39')],'Session_key':_0x117d94['session_key']},'json':!![],'body':_0x567ac6};return rp(_0x59c147);})[_0x623d('0x1b')](function(_0x5dbced){if(_0x5dbced[_0x623d('0x3a')]>=0x1){var _0x50fa8e={'messageId':_0x5dbced[_0x623d('0x3b')]};if(_0x38e468[_0x623d('0x31')]!=='GP'||!_0x38e468[_0x623d('0x3c')]){_0x50fa8e[_0x623d('0x3d')]=!![];}return _0x28876a['update'](_0x50fa8e);}else{return logger['error'](_0x623d('0x2a'),_0x623d('0x2b'),_0x623d('0x2d'),util[_0x623d('0x2c')](_0x5dbced,{'showHidden':![],'depth':null}));}})[_0x623d('0x1e')](function(_0x25d007){return logger['error'](_0x623d('0x2a'),_0x623d('0x2b'),_0x623d('0x2d'),util[_0x623d('0x2c')](_0x25d007,{'showHidden':![],'depth':null}));});}else{logger[_0x623d('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x623d('0x2d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x623d('0x3e'):if(_0x38e468[_0x623d('0x23')]){var _0x48c8c4={'recipient':_0x55c443['phone'],'message':_0x55c443['body'],'sender':_0x38e468[_0x623d('0x3f')]||_0x38e468[_0x623d('0x24')],'authorization':_0x38e468['authToken']};var _0x8fc2cf={'method':_0x623d('0x38'),'uri':_0x623d('0x40'),'body':_0x48c8c4,'json':!![]};rp(_0x8fc2cf)[_0x623d('0x1b')](function(_0x7000d2){var _0x1d4f46={'messageId':_0x7000d2[_0x623d('0x41')]};if(!_0x38e468[_0x623d('0x3c')]){_0x1d4f46['read']=!![];}return _0x28876a[_0x623d('0x1c')](_0x1d4f46);})[_0x623d('0x1e')](function(_0x4d07a2){logger[_0x623d('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x623d('0x2b'),'connectel',util['inspect'](_0x4d07a2,{'showHidden':![],'depth':null}));});}else{logger[_0x623d('0x1f')](_0x623d('0x2a'),_0x623d('0x2b'),_0x623d('0x3e'),_0x623d('0x42'));}break;case _0x623d('0x43'):if(_0x38e468[_0x623d('0x2f')]&&_0x38e468[_0x623d('0x30')]){var _0x48c8c4={'messages':[{'source':_0x623d('0x44'),'to':_0x55c443['phone'],'body':_0x55c443[_0x623d('0xe')],'from':_0x38e468['senderString']||_0x38e468[_0x623d('0x24')]}]};var _0x26e9e4=util[_0x623d('0x45')](_0x623d('0x46'),_0x38e468['username'],_0x38e468[_0x623d('0x30')]);var _0x8fc2cf={'method':_0x623d('0x38'),'uri':_0x623d('0x47'),'body':_0x48c8c4,'headers':{'Authorization':util[_0x623d('0x45')](_0x623d('0x48'),new Buffer(_0x26e9e4)[_0x623d('0x49')](_0x623d('0x4a')))},'json':!![]};rp(_0x8fc2cf)['then'](function(_0x2f364c){if(_0x2f364c['http_code']>=0xc8&&_0x2f364c[_0x623d('0x4b')]<=0xce){if(_0x2f364c['data']&&_0x2f364c['data']['queued_count']>0x0){var _0x5e6a32=_['head'](_0x2f364c[_0x623d('0x4c')]['messages']);var _0x1b21b4={'messageId':_0x5e6a32[_0x623d('0x4d')]};if(!_0x38e468[_0x623d('0x3c')]){_0x1b21b4[_0x623d('0x3d')]=!![];}return _0x28876a[_0x623d('0x1c')](_0x1b21b4);}else{logger[_0x623d('0x1f')](_0x623d('0x2a'),'afterCreate',_0x623d('0x4e'),util[_0x623d('0x2c')](_0x2f364c,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x623d('0x2a'),_0x623d('0x2b'),_0x623d('0x4e'),util[_0x623d('0x2c')](_0x2f364c,{'showHidden':![],'depth':null}));}})['catch'](function(_0x29605d){logger[_0x623d('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x623d('0x2b'),_0x623d('0x4e'),util[_0x623d('0x2c')](_0x29605d,{'showHidden':![],'depth':null}));});}else{logger[_0x623d('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x623d('0x2b'),_0x623d('0x4e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x623d('0x4f'):if(_0x38e468[_0x623d('0x50')]&&_0x38e468[_0x623d('0x23')]){var _0x48c8c4={'dst':_0x55c443[_0x623d('0x24')],'text':_0x55c443[_0x623d('0xe')],'src':_0x38e468['senderString']||_0x38e468[_0x623d('0x24')],'url':_0x38e468[_0x623d('0x28')]+_0x623d('0x51')+_0x55c443['id']+'/status?token='+_0x38e468['token']};var _0x26e9e4=util[_0x623d('0x45')]('%s:%s',_0x38e468[_0x623d('0x50')],_0x38e468['authToken']);var _0x8fc2cf={'method':_0x623d('0x38'),'uri':util['format']('https://api.plivo.com/v1/Account/%s/Message/',_0x38e468[_0x623d('0x50')]),'body':_0x48c8c4,'headers':{'Authorization':util[_0x623d('0x45')](_0x623d('0x48'),new Buffer(_0x26e9e4)['toString']('base64'))},'json':!![]};rp(_0x8fc2cf)['then'](function(_0x1b8d93){var _0x2d3256={'messageId':_0x1b8d93[_0x623d('0x52')][0x0]};return _0x28876a[_0x623d('0x1c')](_0x2d3256);})[_0x623d('0x1e')](function(_0x5f2ff6){logger[_0x623d('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x623d('0x2b'),_0x623d('0x4f'),util['inspect'](_0x5f2ff6,{'showHidden':![],'depth':null}));});}else{logger[_0x623d('0x1f')](_0x623d('0x2a'),_0x623d('0x2b'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x623d('0x53'):if(_0x38e468[_0x623d('0x2f')]&&_0x38e468[_0x623d('0x30')]){if(_0x38e468['baseUrl']){var _0x31b44f={'method':_0x623d('0x38'),'uri':_0x38e468[_0x623d('0x54')]+_0x623d('0x55'),'body':{'username':_0x38e468[_0x623d('0x2f')],'password':_0x38e468[_0x623d('0x30')]},'json':!![]};return rp(_0x31b44f)['then'](function(_0x45856f){var _0x1c764e={'method':_0x623d('0x38'),'uri':_0x38e468[_0x623d('0x54')]+_0x623d('0x56'),'body':{'messages':[{'from':_0x38e468['phone'],'destinations':[{'to':_0x55c443[_0x623d('0x24')]}],'text':_0x55c443['body'],'notifyUrl':_0x38e468[_0x623d('0x28')]+_0x623d('0x51')+_0x55c443['id']+_0x623d('0x29')+_0x38e468[_0x623d('0x57')],'notifyContentType':_0x623d('0x58'),'callbackData':_0x38e468['phone']+';'+_0x55c443[_0x623d('0xe')]}]},'headers':{'Authorization':_0x623d('0x59')+_0x45856f[_0x623d('0x57')]},'json':!![]};return rp(_0x1c764e)[_0x623d('0x1b')](function(_0x200fde){if(_0x200fde[_0x623d('0x26')]){var _0x22491e={'messageId':_0x200fde['messages'][0x0][_0x623d('0xc')]};if(!_0x38e468['deliveryReport']){_0x22491e[_0x623d('0x3d')]=!![];}return _0x28876a[_0x623d('0x1c')](_0x22491e);}else{return logger[_0x623d('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x623d('0x53'),util[_0x623d('0x2c')](_0x200fde,{'showHidden':![],'depth':null}));}});})[_0x623d('0x1e')](function(_0x3aae9b){return logger[_0x623d('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x623d('0x2b'),'infobip',util[_0x623d('0x2c')](_0x3aae9b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x623d('0x2a'),_0x623d('0x2b'),'infobip',_0x623d('0x5a'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x623d('0x2b'),_0x623d('0x53'),_0x623d('0x5b'));}break;case _0x623d('0x5c'):var _0xb81111=require('crypto');if(_0x38e468['apiKey']){var _0x4d3300={};_0x4d3300[_0x623d('0x5d')]=_0x38e468[_0x623d('0x2f')];_0x4d3300['phone']=_0x55c443[_0x623d('0x24')];_0x4d3300[_0x623d('0x32')]=_0x38e468[_0x623d('0x24')];_0x4d3300[_0x623d('0x5e')]=_0x55c443[_0x623d('0xe')];_0x4d3300[_0x623d('0x5f')]=+new Date();var _0x397520='';var _0x226135='';var _0x487ab1=Object[_0x623d('0x60')](_0x4d3300);_0x487ab1[_0x623d('0x61')]();for(var _0x5cf29c=0x0;_0x5cf29c<_0x487ab1[_0x623d('0x62')];_0x5cf29c++){if(_0x397520!=''){_0x397520+='&';}_0x397520+=_0x487ab1[_0x5cf29c]+'='+encodeURIComponent(_0x4d3300[_0x487ab1[_0x5cf29c]]);_0x226135+=_0x4d3300[_0x487ab1[_0x5cf29c]];}_0x226135+=_0x38e468[_0x623d('0x63')];_0x226135=_0xb81111[_0x623d('0x64')]('md5')[_0x623d('0x1c')](_0x226135)[_0x623d('0x65')]('hex');if(_0x397520!==''){_0x397520+='&';}_0x397520+=_0x623d('0x66')+_0x226135;var _0x59c147={'method':_0x623d('0x35'),'uri':_0x38e468[_0x623d('0x54')]+_0x623d('0x67')+_0x397520,'json':!![]};return rp(_0x59c147)[_0x623d('0x1b')](function(_0x44f1b4){var _0x3780ac=Object[_0x623d('0x60')](_0x44f1b4);if(_0x44f1b4[_0x3780ac[0x0]]['error']&&parseInt(_0x44f1b4[_0x3780ac[0x0]]['error'])===0x0){var _0x142601={'messageId':_0x44f1b4[_0x3780ac[0x0]][_0x623d('0x68')]};if(!_0x38e468[_0x623d('0x3c')]){_0x142601['read']=!![];}return _0x28876a[_0x623d('0x1c')](_0x142601);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x623d('0x2b'),_0x623d('0x5c'),util[_0x623d('0x2c')](_0x44f1b4[_0x623d('0x1f')],{'showHidden':![],'depth':null}));}})['catch'](function(_0xb26bb0){return logger[_0x623d('0x1f')](_0x623d('0x2a'),_0x623d('0x2b'),_0x623d('0x5c'),util[_0x623d('0x2c')](_0xb26bb0,{'showHidden':![],'depth':null}));});}else{logger[_0x623d('0x1f')](_0x623d('0x2a'),_0x623d('0x2b'),_0x623d('0x5c'),_0x623d('0x69'));}break;case _0x623d('0x6a'):if(_0x38e468[_0x623d('0x63')]){var _0x513fb0={'method':_0x623d('0x38'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x38e468['apiKey']},'body':{'content':_0x55c443['body'],'to':[_0x55c443[_0x623d('0x24')]],'from':_0x38e468[_0x623d('0x24')],'binary':![],'clientMessageId':'uuid','charset':_0x623d('0x6b')},'json':!![]};rp(_0x513fb0)['then'](function(_0xa4c57f){if(!_0xa4c57f[_0x623d('0x1f')]){var _0x23e219={'messageId':_0xa4c57f[_0x623d('0x26')][0x0][_0x623d('0x6c')]};if(!_0x38e468[_0x623d('0x3c')]){_0x23e219[_0x623d('0x3d')]=!![];}return _0x28876a[_0x623d('0x1c')](_0x23e219);}else{return logger['error'](_0x623d('0x2a'),_0x623d('0x2b'),_0x623d('0x6a'),util[_0x623d('0x2c')](_0xa4c57f[_0x623d('0x1f')],{'showHidden':![],'depth':null}));}})[_0x623d('0x1e')](function(_0x451357){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x623d('0x2b'),_0x623d('0x6a'),util[_0x623d('0x2c')](_0x451357,{'showHidden':![],'depth':null}));});}else{logger[_0x623d('0x1f')](_0x623d('0x2a'),_0x623d('0x2b'),'clickatell',_0x623d('0x69'));}break;case'bandwidth':if(_0x38e468['username']&&_0x38e468[_0x623d('0x30')]){var _0x26e9e4=util['format'](_0x623d('0x46'),_0x38e468[_0x623d('0x2f')],_0x38e468[_0x623d('0x30')]);var _0x8fc2cf={'method':_0x623d('0x38'),'uri':_0x623d('0x6d')+_0x38e468[_0x623d('0x6e')]+_0x623d('0x6f'),'body':{'to':[_0x55c443[_0x623d('0x24')]],'text':_0x55c443['body'],'from':_0x38e468[_0x623d('0x24')],'applicationId':_0x38e468[_0x623d('0x70')]},'headers':{'Authorization':util[_0x623d('0x45')](_0x623d('0x48'),new Buffer(_0x26e9e4)[_0x623d('0x49')](_0x623d('0x4a')))},'json':!![]};rp(_0x8fc2cf)[_0x623d('0x1b')](function(_0x408c62){if(_0x408c62['id']){var _0x462931={'messageId':_0x408c62['id']};return _0x28876a[_0x623d('0x1c')](_0x462931);}else{logger[_0x623d('0x1f')](_0x623d('0x2a'),_0x623d('0x2b'),'bandwidth',util[_0x623d('0x2c')](_0x408c62,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1d7504){logger[_0x623d('0x1f')](_0x623d('0x2a'),'afterCreate',_0x623d('0x71'),util[_0x623d('0x2c')](_0x1d7504,{'showHidden':![],'depth':null}));});}else{logger[_0x623d('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x623d('0x2b'),_0x623d('0x71'),_0x623d('0x5b'));}break;case _0x623d('0x72'):if(_0x38e468[_0x623d('0x63')]){var _0x4239f8={};var _0x59c147={'method':_0x623d('0x38'),'uri':_0x623d('0x73'),'headers':{'Authorization':_0x623d('0x74')+_0x38e468[_0x623d('0x63')],'Content-Type':_0x623d('0x58')},'body':{'from':_0x38e468[_0x623d('0x24')],'to':_0x55c443[_0x623d('0x24')],'text':_0x55c443[_0x623d('0xe')]},'json':!![]};return rp(_0x59c147)['then'](function(_0x512f29){if(_0x512f29[_0x623d('0x75')]==0xca){_0x4239f8[_0x623d('0x76')]=_0x512f29;var _0x49d5aa={'method':'POST','uri':_0x623d('0x77'),'headers':{'Authorization':_0x623d('0x74')+_0x38e468[_0x623d('0x63')],'Content-Type':_0x623d('0x58')},'body':{'refid':_0x4239f8['message']['refid']},'json':!![]};return rp(_0x49d5aa)[_0x623d('0x1b')](function(_0x5527e9){_0x4239f8[_0x623d('0x78')]=_0x5527e9;var _0x48ec76={'messageId':_0x4239f8[_0x623d('0x76')][_0x623d('0x79')],'read':!![]};return _0x28876a[_0x623d('0x1c')](_0x48ec76);});}else{return logger[_0x623d('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','intelepeer',util['inspect'](_0x512f29,{'showHidden':![],'depth':null}));}})[_0x623d('0x1e')](function(_0x181d19){return logger[_0x623d('0x1f')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x623d('0x2b'),_0x623d('0x72'),util[_0x623d('0x2c')](_0x181d19,{'showHidden':![],'depth':null}));});}else{return logger[_0x623d('0x1f')](_0x623d('0x2a'),_0x623d('0x2b'),_0x623d('0x72'),_0x623d('0x7a'));}break;}}})['finally'](function(){_0x133315();});}else{_0x133315();}}},'charset':'utf8mb4','collate':_0x623d('0x7b')});}; \ No newline at end of file +var _0x5ef0=['exports','define','messageId','fti_sms_messages','get','direction','toLowerCase','out','secret','isNil','SmsInteraction','findOne','SmsInteractionId','then','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','create','remote','/api/sms/messages/','/status?token=','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','sms','POST','session_key','total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','clicksend','xCALLY\x20Motion','body','%s:%s','https://rest.clicksend.com/v3/sms/send','format','base64','http_code','queued_count','head','data','messages','deliveryReport','clickSend','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','Missing\x20parameters:\x20base_url','csc','login','text','length','apiKey','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','Basic\x20%s','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','finally','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes'];(function(_0x3fc1ad,_0x4ab661){var _0x2019d8=function(_0x17b5bd){while(--_0x17b5bd){_0x3fc1ad['push'](_0x3fc1ad['shift']());}};_0x2019d8(++_0x4ab661);}(_0x5ef0,0x1df));var _0x05ef=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5ef0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x05ef('0x0'));var util=require('util');var logger=require(_0x05ef('0x1'))(_0x05ef('0x2'));var moment=require(_0x05ef('0x3'));var BPromise=require(_0x05ef('0x4'));var rp=require(_0x05ef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x05ef('0x6'));var config=require(_0x05ef('0x7'));var attributes=require(_0x05ef('0x8'));module[_0x05ef('0x9')]=function(_0x2654cc,_0xfcc879){return _0x2654cc[_0x05ef('0xa')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x05ef('0xb'),'fields':['messageId']},{'name':_0x05ef('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6f0a61,_0x329367,_0x2503fa){var _0x12f1e7=_0x2654cc['models'];var _0x7a19=_0x6f0a61[_0x05ef('0xd')]({'plain':!![]});if(_0x7a19[_0x05ef('0xe')][_0x05ef('0xf')]()==='in'||_0x7a19[_0x05ef('0xe')][_0x05ef('0xf')]()===_0x05ef('0x10')&&!_0x7a19[_0x05ef('0x11')]&&!_['isNil'](_0x7a19['UserId'])&&!_[_0x05ef('0x12')](_0x7a19['SmsInteractionId'])){_0x12f1e7[_0x05ef('0x13')][_0x05ef('0x14')]({'where':{'id':_0x7a19[_0x05ef('0x15')]}})[_0x05ef('0x16')](function(_0x416d98){if(_0x416d98){_0x416d98['update']({'lastMsgAt':_0x7a19[_0x05ef('0x17')],'lastMsgDirection':_0x7a19['direction'][_0x05ef('0xf')]()});}})[_0x05ef('0x18')](function(_0x3abec1){console[_0x05ef('0x19')](_0x3abec1);});}if(_0x7a19['direction']==='out'&&!_0x7a19[_0x05ef('0x11')]){var _0x5f0a24;_0x12f1e7[_0x05ef('0x1a')][_0x05ef('0x1b')]({'where':{'id':_0x7a19[_0x05ef('0x1c')]},'raw':!![]})[_0x05ef('0x16')](function(_0x446bf1){_0x5f0a24=_0x446bf1;if(_0x5f0a24&&_0x5f0a24[_0x05ef('0x1d')]){switch(_0x5f0a24[_0x05ef('0x1d')]){case _0x05ef('0x1e'):var _0x808ab7=require('twilio');if(_0x5f0a24[_0x05ef('0x1f')]&&_0x5f0a24[_0x05ef('0x20')]&&_0x5f0a24[_0x05ef('0x21')]){var _0xa4e86c=new _0x808ab7(_0x5f0a24[_0x05ef('0x1f')],_0x5f0a24[_0x05ef('0x20')]);_0xa4e86c['messages'][_0x05ef('0x22')]({'body':_0x7a19['body'],'to':_0x7a19[_0x05ef('0x21')],'from':_0x5f0a24[_0x05ef('0x21')],'statusCallback':_0x5f0a24[_0x05ef('0x23')]+_0x05ef('0x24')+_0x7a19['id']+_0x05ef('0x25')+_0x5f0a24[_0x05ef('0x26')]})['then'](function(_0xc9e80c){if(_0xc9e80c[_0x05ef('0x27')]){return _0x6f0a61[_0x05ef('0x28')]({'messageId':_0xc9e80c[_0x05ef('0x27')]});}})[_0x05ef('0x18')](function(_0x11d1d3){logger[_0x05ef('0x19')](_0x05ef('0x29'),_0x05ef('0x2a'),_0x05ef('0x1e'),util[_0x05ef('0x2b')](_0x11d1d3,{'showHidden':![],'depth':null}));});}else{logger[_0x05ef('0x19')](_0x05ef('0x29'),_0x05ef('0x2a'),'twilio',_0x05ef('0x2c'));}break;case _0x05ef('0x2d'):var _0x210879=_0x05ef('0x2e');if(_0x5f0a24[_0x05ef('0x2f')]&&_0x5f0a24[_0x05ef('0x30')]){var _0x189b15={'recipient':[_0x7a19[_0x05ef('0x21')]],'message':_0x7a19['body'],'message_type':_0x5f0a24['smsMethod']};if(_0x5f0a24[_0x05ef('0x31')]&&_0x5f0a24[_0x05ef('0x31')]!=='SI'){_0x189b15[_0x05ef('0x32')]=_0x5f0a24[_0x05ef('0x21')];}var _0x12568b={'url':_0x210879+_0x05ef('0x33')+_0x5f0a24[_0x05ef('0x2f')]+_0x05ef('0x34')+_0x5f0a24[_0x05ef('0x30')],'method':_0x05ef('0x35')};rp(_0x12568b)[_0x05ef('0x16')](function(_0x508e55){var _0x4b3a54=_0x508e55['split'](';');var _0x2b074e={'user_key':_0x4b3a54[0x0],'session_key':_0x4b3a54[0x1]};_0x12568b={'url':_0x210879+_0x05ef('0x36'),'method':_0x05ef('0x37'),'headers':{'user_key':_0x2b074e['user_key'],'Session_key':_0x2b074e[_0x05ef('0x38')]},'json':!![],'body':_0x189b15};return rp(_0x12568b);})[_0x05ef('0x16')](function(_0x4d81d7){if(_0x4d81d7[_0x05ef('0x39')]>=0x1){var _0x55f206={'messageId':_0x4d81d7[_0x05ef('0x3a')]};if(_0x5f0a24[_0x05ef('0x31')]!=='GP'||!_0x5f0a24['deliveryReport']){_0x55f206[_0x05ef('0x3b')]=!![];}return _0x6f0a61[_0x05ef('0x28')](_0x55f206);}else{return logger[_0x05ef('0x19')](_0x05ef('0x29'),_0x05ef('0x2a'),'skebby',util[_0x05ef('0x2b')](_0x4d81d7,{'showHidden':![],'depth':null}));}})[_0x05ef('0x18')](function(_0x5f2402){return logger[_0x05ef('0x19')](_0x05ef('0x29'),_0x05ef('0x2a'),'skebby',util[_0x05ef('0x2b')](_0x5f2402,{'showHidden':![],'depth':null}));});}else{logger[_0x05ef('0x19')](_0x05ef('0x29'),_0x05ef('0x2a'),_0x05ef('0x2d'),_0x05ef('0x3c'));}break;case _0x05ef('0x3d'):if(_0x5f0a24['authToken']){var _0x106910={'recipient':_0x7a19[_0x05ef('0x21')],'message':_0x7a19['body'],'sender':_0x5f0a24[_0x05ef('0x3e')]||_0x5f0a24[_0x05ef('0x21')],'authorization':_0x5f0a24[_0x05ef('0x20')]};var _0x329367={'method':_0x05ef('0x37'),'uri':_0x05ef('0x3f'),'body':_0x106910,'json':!![]};rp(_0x329367)[_0x05ef('0x16')](function(_0x46b262){var _0x48aa59={'messageId':_0x46b262[_0x05ef('0x40')]};if(!_0x5f0a24['deliveryReport']){_0x48aa59[_0x05ef('0x3b')]=!![];}return _0x6f0a61[_0x05ef('0x28')](_0x48aa59);})[_0x05ef('0x18')](function(_0x43775a){logger[_0x05ef('0x19')](_0x05ef('0x29'),_0x05ef('0x2a'),'connectel',util[_0x05ef('0x2b')](_0x43775a,{'showHidden':![],'depth':null}));});}else{logger[_0x05ef('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x05ef('0x2a'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0x05ef('0x41'):if(_0x5f0a24['username']&&_0x5f0a24[_0x05ef('0x30')]){var _0x106910={'messages':[{'source':_0x05ef('0x42'),'to':_0x7a19[_0x05ef('0x21')],'body':_0x7a19[_0x05ef('0x43')],'from':_0x5f0a24[_0x05ef('0x3e')]||_0x5f0a24[_0x05ef('0x21')]}]};var _0x5c8970=util['format'](_0x05ef('0x44'),_0x5f0a24[_0x05ef('0x2f')],_0x5f0a24[_0x05ef('0x30')]);var _0x329367={'method':_0x05ef('0x37'),'uri':_0x05ef('0x45'),'body':_0x106910,'headers':{'Authorization':util[_0x05ef('0x46')]('Basic\x20%s',new Buffer(_0x5c8970)['toString'](_0x05ef('0x47')))},'json':!![]};rp(_0x329367)[_0x05ef('0x16')](function(_0x57766c){if(_0x57766c[_0x05ef('0x48')]>=0xc8&&_0x57766c[_0x05ef('0x48')]<=0xce){if(_0x57766c['data']&&_0x57766c['data'][_0x05ef('0x49')]>0x0){var _0x571d19=_[_0x05ef('0x4a')](_0x57766c[_0x05ef('0x4b')][_0x05ef('0x4c')]);var _0x4797e6={'messageId':_0x571d19['message_id']};if(!_0x5f0a24[_0x05ef('0x4d')]){_0x4797e6[_0x05ef('0x3b')]=!![];}return _0x6f0a61[_0x05ef('0x28')](_0x4797e6);}else{logger[_0x05ef('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x05ef('0x4e'),util[_0x05ef('0x2b')](_0x57766c,{'showHidden':![],'depth':null}));}}else{logger[_0x05ef('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x05ef('0x2a'),'clickSend',util['inspect'](_0x57766c,{'showHidden':![],'depth':null}));}})[_0x05ef('0x18')](function(_0x149815){logger[_0x05ef('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x05ef('0x2a'),_0x05ef('0x4e'),util[_0x05ef('0x2b')](_0x149815,{'showHidden':![],'depth':null}));});}else{logger[_0x05ef('0x19')](_0x05ef('0x29'),'afterCreate',_0x05ef('0x4e'),_0x05ef('0x3c'));}break;case'plivo':if(_0x5f0a24[_0x05ef('0x4f')]&&_0x5f0a24[_0x05ef('0x20')]){var _0x106910={'dst':_0x7a19['phone'],'text':_0x7a19[_0x05ef('0x43')],'src':_0x5f0a24[_0x05ef('0x3e')]||_0x5f0a24[_0x05ef('0x21')],'url':_0x5f0a24[_0x05ef('0x23')]+_0x05ef('0x24')+_0x7a19['id']+_0x05ef('0x25')+_0x5f0a24[_0x05ef('0x26')]};var _0x5c8970=util['format'](_0x05ef('0x44'),_0x5f0a24[_0x05ef('0x4f')],_0x5f0a24[_0x05ef('0x20')]);var _0x329367={'method':'POST','uri':util[_0x05ef('0x46')](_0x05ef('0x50'),_0x5f0a24[_0x05ef('0x4f')]),'body':_0x106910,'headers':{'Authorization':util[_0x05ef('0x46')]('Basic\x20%s',new Buffer(_0x5c8970)[_0x05ef('0x51')]('base64'))},'json':!![]};rp(_0x329367)['then'](function(_0x3b27da){var _0x3e3633={'messageId':_0x3b27da[_0x05ef('0x52')][0x0]};return _0x6f0a61[_0x05ef('0x28')](_0x3e3633);})['catch'](function(_0x54f5d4){logger[_0x05ef('0x19')](_0x05ef('0x29'),'afterCreate',_0x05ef('0x53'),util[_0x05ef('0x2b')](_0x54f5d4,{'showHidden':![],'depth':null}));});}else{logger[_0x05ef('0x19')](_0x05ef('0x29'),'afterCreate',_0x05ef('0x53'),_0x05ef('0x54'));}break;case _0x05ef('0x55'):if(_0x5f0a24[_0x05ef('0x2f')]&&_0x5f0a24['password']){if(_0x5f0a24[_0x05ef('0x56')]){var _0x5c481b={'method':_0x05ef('0x37'),'uri':_0x5f0a24[_0x05ef('0x56')]+_0x05ef('0x57'),'body':{'username':_0x5f0a24['username'],'password':_0x5f0a24[_0x05ef('0x30')]},'json':!![]};return rp(_0x5c481b)['then'](function(_0xbb9ab7){var _0x756431={'method':_0x05ef('0x37'),'uri':_0x5f0a24[_0x05ef('0x56')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x5f0a24['phone'],'destinations':[{'to':_0x7a19[_0x05ef('0x21')]}],'text':_0x7a19[_0x05ef('0x43')],'notifyUrl':_0x5f0a24[_0x05ef('0x23')]+_0x05ef('0x24')+_0x7a19['id']+_0x05ef('0x25')+_0x5f0a24[_0x05ef('0x26')],'notifyContentType':_0x05ef('0x58'),'callbackData':_0x5f0a24[_0x05ef('0x21')]+';'+_0x7a19[_0x05ef('0x43')]}]},'headers':{'Authorization':'IBSSO\x20'+_0xbb9ab7[_0x05ef('0x26')]},'json':!![]};return rp(_0x756431)[_0x05ef('0x16')](function(_0x23be4b){if(_0x23be4b[_0x05ef('0x4c')]){var _0x393b49={'messageId':_0x23be4b[_0x05ef('0x4c')][0x0][_0x05ef('0xb')]};if(!_0x5f0a24['deliveryReport']){_0x393b49[_0x05ef('0x3b')]=!![];}return _0x6f0a61['update'](_0x393b49);}else{return logger[_0x05ef('0x19')](_0x05ef('0x29'),_0x05ef('0x2a'),_0x05ef('0x55'),util[_0x05ef('0x2b')](_0x23be4b,{'showHidden':![],'depth':null}));}});})[_0x05ef('0x18')](function(_0x2f331f){return logger[_0x05ef('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x05ef('0x2a'),_0x05ef('0x55'),util['inspect'](_0x2f331f,{'showHidden':![],'depth':null}));});}else{logger[_0x05ef('0x19')](_0x05ef('0x29'),_0x05ef('0x2a'),_0x05ef('0x55'),_0x05ef('0x59'));}}else{logger['error'](_0x05ef('0x29'),_0x05ef('0x2a'),'infobip',_0x05ef('0x3c'));}break;case _0x05ef('0x5a'):var _0x45324f=require('crypto');if(_0x5f0a24['apiKey']){var _0x30be30={};_0x30be30[_0x05ef('0x5b')]=_0x5f0a24[_0x05ef('0x2f')];_0x30be30[_0x05ef('0x21')]=_0x7a19[_0x05ef('0x21')];_0x30be30['sender']=_0x5f0a24[_0x05ef('0x21')];_0x30be30[_0x05ef('0x5c')]=_0x7a19[_0x05ef('0x43')];_0x30be30['timestamp']=+new Date();var _0x541220='';var _0x5bc04d='';var _0x5156f8=Object['keys'](_0x30be30);_0x5156f8['sort']();for(var _0x2472aa=0x0;_0x2472aa<_0x5156f8[_0x05ef('0x5d')];_0x2472aa++){if(_0x541220!=''){_0x541220+='&';}_0x541220+=_0x5156f8[_0x2472aa]+'='+encodeURIComponent(_0x30be30[_0x5156f8[_0x2472aa]]);_0x5bc04d+=_0x30be30[_0x5156f8[_0x2472aa]];}_0x5bc04d+=_0x5f0a24[_0x05ef('0x5e')];_0x5bc04d=_0x45324f[_0x05ef('0x5f')](_0x05ef('0x60'))[_0x05ef('0x28')](_0x5bc04d)[_0x05ef('0x61')](_0x05ef('0x62'));if(_0x541220!==''){_0x541220+='&';}_0x541220+=_0x05ef('0x63')+_0x5bc04d;var _0x12568b={'method':'GET','uri':_0x5f0a24[_0x05ef('0x56')]+_0x05ef('0x64')+_0x541220,'json':!![]};return rp(_0x12568b)[_0x05ef('0x16')](function(_0x55eb46){var _0x3d3075=Object['keys'](_0x55eb46);if(_0x55eb46[_0x3d3075[0x0]]['error']&&parseInt(_0x55eb46[_0x3d3075[0x0]][_0x05ef('0x19')])===0x0){var _0xf1f58b={'messageId':_0x55eb46[_0x3d3075[0x0]][_0x05ef('0x65')]};if(!_0x5f0a24[_0x05ef('0x4d')]){_0xf1f58b[_0x05ef('0x3b')]=!![];}return _0x6f0a61[_0x05ef('0x28')](_0xf1f58b);}else{return logger[_0x05ef('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x05ef('0x2a'),_0x05ef('0x5a'),util['inspect'](_0x55eb46[_0x05ef('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1bf127){return logger[_0x05ef('0x19')](_0x05ef('0x29'),_0x05ef('0x2a'),'csc',util['inspect'](_0x1bf127,{'showHidden':![],'depth':null}));});}else{logger[_0x05ef('0x19')](_0x05ef('0x29'),'afterCreate',_0x05ef('0x5a'),'Missing\x20parameters:\x20apiKey');}break;case _0x05ef('0x66'):if(_0x5f0a24[_0x05ef('0x5e')]){var _0x5340ed={'method':_0x05ef('0x37'),'uri':_0x05ef('0x67'),'headers':{'Authorization':_0x5f0a24[_0x05ef('0x5e')]},'body':{'content':_0x7a19[_0x05ef('0x43')],'to':[_0x7a19[_0x05ef('0x21')]],'from':_0x5f0a24['phone'],'binary':![],'clientMessageId':'uuid','charset':_0x05ef('0x68')},'json':!![]};rp(_0x5340ed)[_0x05ef('0x16')](function(_0x38a8cb){if(!_0x38a8cb[_0x05ef('0x19')]){var _0x350f74={'messageId':_0x38a8cb[_0x05ef('0x4c')][0x0][_0x05ef('0x69')]};if(!_0x5f0a24[_0x05ef('0x4d')]){_0x350f74['read']=!![];}return _0x6f0a61[_0x05ef('0x28')](_0x350f74);}else{return logger[_0x05ef('0x19')](_0x05ef('0x29'),_0x05ef('0x2a'),_0x05ef('0x66'),util[_0x05ef('0x2b')](_0x38a8cb[_0x05ef('0x19')],{'showHidden':![],'depth':null}));}})[_0x05ef('0x18')](function(_0x29c781){return logger[_0x05ef('0x19')](_0x05ef('0x29'),_0x05ef('0x2a'),_0x05ef('0x66'),util[_0x05ef('0x2b')](_0x29c781,{'showHidden':![],'depth':null}));});}else{logger[_0x05ef('0x19')](_0x05ef('0x29'),_0x05ef('0x2a'),_0x05ef('0x66'),_0x05ef('0x6a'));}break;case'bandwidth':if(_0x5f0a24[_0x05ef('0x2f')]&&_0x5f0a24[_0x05ef('0x30')]){var _0x5c8970=util[_0x05ef('0x46')]('%s:%s',_0x5f0a24['username'],_0x5f0a24[_0x05ef('0x30')]);var _0x329367={'method':_0x05ef('0x37'),'uri':_0x05ef('0x6b')+_0x5f0a24[_0x05ef('0x6c')]+_0x05ef('0x6d'),'body':{'to':[_0x7a19['phone']],'text':_0x7a19[_0x05ef('0x43')],'from':_0x5f0a24['phone'],'applicationId':_0x5f0a24[_0x05ef('0x6e')]},'headers':{'Authorization':util[_0x05ef('0x46')](_0x05ef('0x6f'),new Buffer(_0x5c8970)[_0x05ef('0x51')](_0x05ef('0x47')))},'json':!![]};rp(_0x329367)[_0x05ef('0x16')](function(_0x4806c3){if(_0x4806c3['id']){var _0x1b4183={'messageId':_0x4806c3['id']};return _0x6f0a61[_0x05ef('0x28')](_0x1b4183);}else{logger['error'](_0x05ef('0x29'),_0x05ef('0x2a'),_0x05ef('0x70'),util[_0x05ef('0x2b')](_0x4806c3,{'showHidden':![],'depth':null}));}})[_0x05ef('0x18')](function(_0x5812f8){logger['error'](_0x05ef('0x29'),_0x05ef('0x2a'),_0x05ef('0x70'),util[_0x05ef('0x2b')](_0x5812f8,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x05ef('0x2a'),_0x05ef('0x70'),_0x05ef('0x3c'));}break;case'intelepeer':if(_0x5f0a24[_0x05ef('0x5e')]){var _0x48dab7={};var _0x12568b={'method':'POST','uri':_0x05ef('0x71'),'headers':{'Authorization':_0x05ef('0x72')+_0x5f0a24[_0x05ef('0x5e')],'Content-Type':_0x05ef('0x58')},'body':{'from':_0x5f0a24['phone'],'to':_0x7a19['phone'],'text':_0x7a19[_0x05ef('0x43')]},'json':!![]};return rp(_0x12568b)[_0x05ef('0x16')](function(_0x3bf551){if(_0x3bf551['code']==0xca){_0x48dab7[_0x05ef('0x73')]=_0x3bf551;var _0x3438c7={'method':_0x05ef('0x37'),'uri':_0x05ef('0x74'),'headers':{'Authorization':'Bearer\x20'+_0x5f0a24[_0x05ef('0x5e')],'Content-Type':'application/json'},'body':{'refid':_0x48dab7[_0x05ef('0x73')][_0x05ef('0x75')]},'json':!![]};return rp(_0x3438c7)[_0x05ef('0x16')](function(_0x3a1109){_0x48dab7[_0x05ef('0x76')]=_0x3a1109;var _0x24c685={'messageId':_0x48dab7[_0x05ef('0x73')][_0x05ef('0x75')],'read':!![]};return _0x6f0a61[_0x05ef('0x28')](_0x24c685);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x05ef('0x2a'),_0x05ef('0x77'),util[_0x05ef('0x2b')](_0x3bf551,{'showHidden':![],'depth':null}));}})[_0x05ef('0x18')](function(_0x4c9223){return logger[_0x05ef('0x19')](_0x05ef('0x29'),_0x05ef('0x2a'),'intelepeer',util[_0x05ef('0x2b')](_0x4c9223,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x05ef('0x29'),'afterCreate',_0x05ef('0x77'),_0x05ef('0x78'));}break;}}})[_0x05ef('0x79')](function(){_0x2503fa();});}else{_0x2503fa();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index cc792d8..3b70232 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 _0x0342=['stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','body','options','raw','then','debug','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0x0342,0x14d));var _0x2034=function(_0x58b301,_0x45e991){_0x58b301=_0x58b301-0x0;var _0x2171b3=_0x0342[_0x58b301];return _0x2171b3;};'use strict';var _=require(_0x2034('0x0'));var util=require('util');var moment=require(_0x2034('0x1'));var BPromise=require('bluebird');var rs=require(_0x2034('0x2'));var fs=require('fs');var Redis=require(_0x2034('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2034('0x4'))(_0x2034('0x5'));var config=require(_0x2034('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2034('0x7')][_0x2034('0x8')]({'port':0x232a});config[_0x2034('0x9')]=_[_0x2034('0xa')](config[_0x2034('0x9')],{'host':_0x2034('0xb'),'port':0x18eb});var socket=require(_0x2034('0xc'))(new Redis(config[_0x2034('0x9')]));require(_0x2034('0xd'))[_0x2034('0xe')](socket);function respondWithRpcPromise(_0x386e7f,_0x5c7ffd,_0x562b03){return new BPromise(function(_0x4cd6e3,_0x51d4d5){return client[_0x2034('0xf')](_0x386e7f,_0x562b03)['then'](function(_0x4997cf){logger[_0x2034('0x10')]('SmsMessage,\x20%s,\x20%s',_0x5c7ffd,_0x2034('0x11'));logger['debug'](_0x2034('0x12'),_0x5c7ffd,'request\x20sent',JSON[_0x2034('0x13')](_0x4997cf));if(_0x4997cf[_0x2034('0x14')]){if(_0x4997cf[_0x2034('0x14')][_0x2034('0x15')]===0x1f4){logger['error'](_0x2034('0x16'),_0x5c7ffd,_0x4997cf[_0x2034('0x14')][_0x2034('0x17')]);return _0x51d4d5(_0x4997cf[_0x2034('0x14')][_0x2034('0x17')]);}logger[_0x2034('0x14')]('SmsMessage,\x20%s,\x20%s',_0x5c7ffd,_0x4997cf['error'][_0x2034('0x17')]);return _0x4cd6e3(_0x4997cf[_0x2034('0x14')]['message']);}else{logger[_0x2034('0x10')](_0x2034('0x16'),_0x5c7ffd,'request\x20sent');_0x4cd6e3(_0x4997cf[_0x2034('0x18')]['message']);}})[_0x2034('0x19')](function(_0x51e387){logger[_0x2034('0x14')]('SmsMessage,\x20%s,\x20%s',_0x5c7ffd,_0x51e387);_0x51d4d5(_0x51e387);});});}exports[_0x2034('0x1a')]=function(_0xc3646f){var _0x31b7cc=this;return new Promise(function(_0x3c4bb8,_0x30f69c){return db['SmsMessage']['create'](_0xc3646f[_0x2034('0x1b')],{'raw':_0xc3646f[_0x2034('0x1c')]?_0xc3646f[_0x2034('0x1c')][_0x2034('0x1d')]===undefined?!![]:![]:!![]})[_0x2034('0x1e')](function(_0x9eb64f){logger[_0x2034('0x10')](_0x2034('0x1a'),_0xc3646f);logger[_0x2034('0x1f')](_0x2034('0x1a'),_0xc3646f,JSON[_0x2034('0x13')](_0x9eb64f));_0x3c4bb8(_0x9eb64f);})['catch'](function(_0x33bc73){logger[_0x2034('0x14')](_0x2034('0x1a'),_0x33bc73[_0x2034('0x17')],_0xc3646f);_0x30f69c(_0x31b7cc['error'](0x1f4,_0x33bc73[_0x2034('0x17')]));});});}; \ No newline at end of file +var _0x3376=['request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','create','body','options','raw','CreateSmsMessage','stringify','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','defaults','localhost','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3376,0xe7));var _0x6337=function(_0x3ca3fd,_0x1cb2be){_0x3ca3fd=_0x3ca3fd-0x0;var _0x1a0673=_0x3376[_0x3ca3fd];return _0x1a0673;};'use strict';var _=require(_0x6337('0x0'));var util=require(_0x6337('0x1'));var moment=require('moment');var BPromise=require(_0x6337('0x2'));var rs=require(_0x6337('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6337('0x4'))['db'];var utils=require(_0x6337('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6337('0x6'));var client=jayson[_0x6337('0x7')][_0x6337('0x8')]({'port':0x232a});config['redis']=_[_0x6337('0x9')](config['redis'],{'host':_0x6337('0xa'),'port':0x18eb});var socket=require(_0x6337('0xb'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x6337('0xc')](socket);function respondWithRpcPromise(_0x59195a,_0x338bf8,_0x31546c){return new BPromise(function(_0x11e464,_0x28c775){return client[_0x6337('0xd')](_0x59195a,_0x31546c)[_0x6337('0xe')](function(_0x38db7f){logger[_0x6337('0xf')](_0x6337('0x10'),_0x338bf8,_0x6337('0x11'));logger[_0x6337('0x12')](_0x6337('0x13'),_0x338bf8,'request\x20sent',JSON['stringify'](_0x38db7f));if(_0x38db7f[_0x6337('0x14')]){if(_0x38db7f[_0x6337('0x14')][_0x6337('0x15')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x338bf8,_0x38db7f[_0x6337('0x14')][_0x6337('0x16')]);return _0x28c775(_0x38db7f['error']['message']);}logger['error'](_0x6337('0x10'),_0x338bf8,_0x38db7f[_0x6337('0x14')][_0x6337('0x16')]);return _0x11e464(_0x38db7f[_0x6337('0x14')]['message']);}else{logger['info'](_0x6337('0x10'),_0x338bf8,_0x6337('0x11'));_0x11e464(_0x38db7f[_0x6337('0x17')][_0x6337('0x16')]);}})[_0x6337('0x18')](function(_0x2ea798){logger['error'](_0x6337('0x10'),_0x338bf8,_0x2ea798);_0x28c775(_0x2ea798);});});}exports['CreateSmsMessage']=function(_0x20f72c){var _0x397db8=this;return new Promise(function(_0x93743b,_0x201f3a){return db['SmsMessage'][_0x6337('0x19')](_0x20f72c[_0x6337('0x1a')],{'raw':_0x20f72c['options']?_0x20f72c[_0x6337('0x1b')][_0x6337('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x58fcd7){logger[_0x6337('0xf')](_0x6337('0x1d'),_0x20f72c);logger[_0x6337('0x12')](_0x6337('0x1d'),_0x20f72c,JSON[_0x6337('0x1e')](_0x58fcd7));_0x93743b(_0x58fcd7);})[_0x6337('0x18')](function(_0x356c96){logger['error'](_0x6337('0x1d'),_0x356c96['message'],_0x20f72c);_0x201f3a(_0x397db8['error'](0x1f4,_0x356c96[_0x6337('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 1178461..e0b860e 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 _0x4fed=['remove','emit','length','smsMessage:','./smsMessage.events'];(function(_0x2ffc46,_0x35ce3c){var _0x1eda8f=function(_0x285344){while(--_0x285344){_0x2ffc46['push'](_0x2ffc46['shift']());}};_0x1eda8f(++_0x35ce3c);}(_0x4fed,0x167));var _0xd4fe=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x4fed[_0x3f0b30];return _0x2748a5;};'use strict';var SmsMessageEvents=require(_0xd4fe('0x0'));var events=['save',_0xd4fe('0x1'),'update'];function createListener(_0x7e528a,_0x1c4581){return function(_0x18411b){_0x1c4581[_0xd4fe('0x2')](_0x7e528a,_0x18411b);};}function removeListener(_0x162710,_0x367bae){return function(){SmsMessageEvents['removeListener'](_0x162710,_0x367bae);};}exports['register']=function(_0xec5d02){for(var _0x259114=0x0,_0x57b402=events[_0xd4fe('0x3')];_0x259114<_0x57b402;_0x259114++){var _0x134a75=events[_0x259114];var _0x19dcff=createListener(_0xd4fe('0x4')+_0x134a75,_0xec5d02);SmsMessageEvents['on'](_0x134a75,_0x19dcff);}}; \ No newline at end of file +var _0x9da8=['emit','register','length','save','remove','update'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9da8,0x105));var _0x89da=function(_0x1cc01a,_0x10e545){_0x1cc01a=_0x1cc01a-0x0;var _0xf401d7=_0x9da8[_0x1cc01a];return _0xf401d7;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x89da('0x0'),_0x89da('0x1'),_0x89da('0x2')];function createListener(_0x58b2a0,_0x5408cf){return function(_0x22f68e){_0x5408cf[_0x89da('0x3')](_0x58b2a0,_0x22f68e);};}function removeListener(_0x49a2b9,_0x18de26){return function(){SmsMessageEvents['removeListener'](_0x49a2b9,_0x18de26);};}exports[_0x89da('0x4')]=function(_0x1cf627){for(var _0x19a17a=0x0,_0x506dd3=events[_0x89da('0x5')];_0x19a17a<_0x506dd3;_0x19a17a++){var _0x4414b9=events[_0x19a17a];var _0x318b10=createListener('smsMessage:'+_0x4414b9,_0x1cf627);SmsMessageEvents['on'](_0x4414b9,_0x318b10);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index dfd7adc..b0768b7 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 _0xaad7=['removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','put','update','delete','destroy'];(function(_0x6f2ce5,_0x4231eb){var _0x28a54a=function(_0x1bc980){while(--_0x1bc980){_0x6f2ce5['push'](_0x6f2ce5['shift']());}};_0x28a54a(++_0x4231eb);}(_0xaad7,0x1ab));var _0x7aad=function(_0x499d07,_0x4bebd2){_0x499d07=_0x499d07-0x0;var _0x2728b8=_0xaad7[_0x499d07];return _0x2728b8;};'use strict';var multer=require('multer');var util=require(_0x7aad('0x0'));var path=require('path');var timeout=require(_0x7aad('0x1'));var express=require(_0x7aad('0x2'));var router=express[_0x7aad('0x3')]();var fs_extra=require(_0x7aad('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7aad('0x5'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0x7aad('0x6')]('/',auth[_0x7aad('0x7')](),controller[_0x7aad('0x8')]);router[_0x7aad('0x6')]('/describe',auth[_0x7aad('0x7')](),controller['describe']);router[_0x7aad('0x6')](_0x7aad('0x9'),auth['isAuthenticated'](),controller[_0x7aad('0xa')]);router[_0x7aad('0x6')]('/:id/members',auth[_0x7aad('0x7')](),controller[_0x7aad('0xb')]);router['get'](_0x7aad('0xc'),auth['isAuthenticated'](),controller[_0x7aad('0xd')]);router[_0x7aad('0x6')](_0x7aad('0xe'),auth['isAuthenticated'](),controller[_0x7aad('0xf')]);router['post']('/',auth[_0x7aad('0x7')](),controller[_0x7aad('0x10')]);router[_0x7aad('0x11')](_0x7aad('0xc'),auth[_0x7aad('0x7')](),controller[_0x7aad('0x12')]);router['post'](_0x7aad('0xe'),auth['isAuthenticated'](),controller['addAgents']);router[_0x7aad('0x13')](_0x7aad('0x9'),auth['isAuthenticated'](),controller[_0x7aad('0x14')]);router[_0x7aad('0x15')](_0x7aad('0x9'),auth[_0x7aad('0x7')](),controller[_0x7aad('0x16')]);router[_0x7aad('0x15')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x7aad('0xe'),auth[_0x7aad('0x7')](),controller[_0x7aad('0x17')]);module[_0x7aad('0x18')]=router; \ No newline at end of file +var _0xdd4a=['describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','put','/:id','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe'];(function(_0x30520f,_0x33e349){var _0x3aed14=function(_0x1f4ef8){while(--_0x1f4ef8){_0x30520f['push'](_0x30520f['shift']());}};_0x3aed14(++_0x33e349);}(_0xdd4a,0x152));var _0xadd4=function(_0x5db96a,_0x60039){_0x5db96a=_0x5db96a-0x0;var _0x13fdb0=_0xdd4a[_0x5db96a];return _0x13fdb0;};'use strict';var multer=require(_0xadd4('0x0'));var util=require(_0xadd4('0x1'));var path=require(_0xadd4('0x2'));var timeout=require(_0xadd4('0x3'));var express=require(_0xadd4('0x4'));var router=express[_0xadd4('0x5')]();var fs_extra=require(_0xadd4('0x6'));var auth=require(_0xadd4('0x7'));var interaction=require(_0xadd4('0x8'));var config=require(_0xadd4('0x9'));var controller=require('./smsQueue.controller');router['get']('/',auth[_0xadd4('0xa')](),controller[_0xadd4('0xb')]);router[_0xadd4('0xc')](_0xadd4('0xd'),auth[_0xadd4('0xa')](),controller[_0xadd4('0xe')]);router[_0xadd4('0xc')]('/:id',auth[_0xadd4('0xa')](),controller[_0xadd4('0xf')]);router[_0xadd4('0xc')](_0xadd4('0x10'),auth['isAuthenticated'](),controller[_0xadd4('0x11')]);router[_0xadd4('0xc')](_0xadd4('0x12'),auth[_0xadd4('0xa')](),controller[_0xadd4('0x13')]);router[_0xadd4('0xc')](_0xadd4('0x14'),auth[_0xadd4('0xa')](),controller['getAgents']);router['post']('/',auth[_0xadd4('0xa')](),controller[_0xadd4('0x15')]);router[_0xadd4('0x16')]('/:id/teams',auth[_0xadd4('0xa')](),controller[_0xadd4('0x17')]);router[_0xadd4('0x16')](_0xadd4('0x14'),auth[_0xadd4('0xa')](),controller[_0xadd4('0x18')]);router[_0xadd4('0x19')](_0xadd4('0x1a'),auth['isAuthenticated'](),controller['update']);router[_0xadd4('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xadd4('0x1c')]);router[_0xadd4('0x1b')](_0xadd4('0x12'),auth[_0xadd4('0xa')](),controller[_0xadd4('0x1d')]);router[_0xadd4('0x1b')](_0xadd4('0x14'),auth[_0xadd4('0xa')](),controller[_0xadd4('0x1e')]);module[_0xadd4('0x1f')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 8466df4..bb5a827 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 _0x262d=['name','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x244ad2,_0x51d1bc){var _0x10fa3d=function(_0x4f6cb7){while(--_0x4f6cb7){_0x244ad2['push'](_0x244ad2['shift']());}};_0x10fa3d(++_0x51d1bc);}(_0x262d,0x6d));var _0xd262=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x262d[_0x138f59];return _0x3d114d;};'use strict';var Sequelize=require(_0xd262('0x0'));module[_0xd262('0x1')]={'name':{'type':Sequelize[_0xd262('0x2')],'unique':_0xd262('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd262('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd262('0x4'),_0xd262('0x5'),_0xd262('0x6'))}}; \ No newline at end of file +var _0x19b1=['exports','name','STRING','INTEGER','ENUM','roundrobin','sequelize'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x19b1,0xe6));var _0x119b=function(_0x58eec7,_0x2353db){_0x58eec7=_0x58eec7-0x0;var _0x25c5d3=_0x19b1[_0x58eec7];return _0x25c5d3;};'use strict';var Sequelize=require(_0x119b('0x0'));module[_0x119b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x119b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x119b('0x3')]},'timeout':{'type':Sequelize[_0x119b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x119b('0x5')]('rrmemory','beepall',_0x119b('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 7078b67..3ff8cd1 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 _0x7a54=['transaction','addTeams','each','findOrCreate','userSmsQueue:save','removeTeams','Team','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','QueryTypes','SELECT','every','includes','all','compact','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','emit','removeAgents','isArray','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','then','get','SmsQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','SmsQueue','include','rows','catch','show','params','model','query','intersection','fields','attributes','includeAll','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','limit','order','sort','filters','pick','filter','User','UserId','createdAt','format','%s/%s','smsPause','getTeams','keys','nolimit','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize'];(function(_0x1746c6,_0x9ac0ff){var _0x25c091=function(_0x263ba7){while(--_0x263ba7){_0x1746c6['push'](_0x1746c6['shift']());}};_0x25c091(++_0x9ac0ff);}(_0x7a54,0x106));var _0x47a5=function(_0x895776,_0x3b3dfb){_0x895776=_0x895776-0x0;var _0x601ef2=_0x7a54[_0x895776];return _0x601ef2;};'use strict';var BPromise=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var squel=require('squel');var Redis=require(_0x47a5('0x3'));var qs=require(_0x47a5('0x4'));var logger=require('../../config/logger')(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var db=require(_0x47a5('0x7'))['db'];config[_0x47a5('0x8')]=_[_0x47a5('0x9')](config['redis'],{'host':_0x47a5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x8')]));require(_0x47a5('0xb'))['register'](socket);function respondWithStatusCode(_0x194fb0,_0x5077f3){_0x5077f3=_0x5077f3||0xcc;return function(_0x5d90b3){if(_0x5d90b3){return _0x194fb0['sendStatus'](_0x5077f3);}return _0x194fb0[_0x47a5('0xc')](_0x5077f3)[_0x47a5('0xd')]();};}function respondWithResult(_0x5e31dd,_0x2eb0dd){_0x2eb0dd=_0x2eb0dd||0xc8;return function(_0x49e844){if(_0x49e844){return _0x5e31dd['status'](_0x2eb0dd)[_0x47a5('0xe')](_0x49e844);}};}function respondWithFilteredResult(_0x69e4d4,_0x2f399b){return function(_0x250fad){if(_0x250fad){var _0xd612dd=typeof _0x2f399b[_0x47a5('0xf')]===_0x47a5('0x10')&&typeof _0x2f399b['limit']===_0x47a5('0x10');var _0x221b54=_0x250fad[_0x47a5('0x11')];var _0x711793=_0xd612dd?0x0:_0x2f399b[_0x47a5('0xf')];var _0x620ee9=_0xd612dd?_0x250fad[_0x47a5('0x11')]:_0x2f399b[_0x47a5('0xf')]+_0x2f399b['limit'];var _0x362359;if(_0x620ee9>=_0x221b54){_0x620ee9=_0x221b54;_0x362359=0xc8;}else{_0x362359=0xce;}_0x69e4d4[_0x47a5('0xc')](_0x362359);return _0x69e4d4[_0x47a5('0x12')](_0x47a5('0x13'),_0x711793+'-'+_0x620ee9+'/'+_0x221b54)[_0x47a5('0xe')](_0x250fad);}return null;};}function saveUpdates(_0x574af6){return function(_0x549de3){if(_0x549de3){return _0x549de3[_0x47a5('0x14')](_0x574af6)['then'](function(_0x5247fd){return _0x5247fd;});}return null;};}function removeEntity(_0x423a81){return function(_0xaf70a6){if(_0xaf70a6){return _0xaf70a6[_0x47a5('0x15')]()[_0x47a5('0x16')](function(){var _0x477b1d=_0xaf70a6[_0x47a5('0x17')]({'plain':!![]});var _0x2763d6=_0x47a5('0x18');return db[_0x47a5('0x19')]['destroy']({'where':{'type':_0x2763d6,'resourceId':_0x477b1d['id']}})[_0x47a5('0x16')](function(){return _0xaf70a6;});})[_0x47a5('0x16')](function(){_0x423a81['status'](0xcc)[_0x47a5('0xd')]();});}};}function handleEntityNotFound(_0x1f03f7){return function(_0x36874d){if(!_0x36874d){_0x1f03f7['sendStatus'](0x194);}return _0x36874d;};}function handleError(_0xb8ae6c,_0x2f142b){_0x2f142b=_0x2f142b||0x1f4;return function(_0x23db32){logger[_0x47a5('0x1a')](_0x23db32['stack']);if(_0x23db32[_0x47a5('0x1b')]){delete _0x23db32[_0x47a5('0x1b')];}_0xb8ae6c['status'](_0x2f142b)[_0x47a5('0x1c')](_0x23db32);};}exports[_0x47a5('0x1d')]=function(_0x4437f1,_0x129ce5){var _0x3abd6a={};var _0x50bf17={'count':0x0,'rows':[]};var _0x53078a=_[_0x47a5('0x1e')](db['SmsQueue'][_0x47a5('0x1f')],function(_0x5b6c4e){return{'name':_0x5b6c4e[_0x47a5('0x20')],'type':_0x5b6c4e[_0x47a5('0x21')][_0x47a5('0x22')]};});_0x3abd6a=qs[_0x47a5('0x23')](_0x53078a,_0x4437f1);var _0x21f296={'where':_0x3abd6a[_0x47a5('0x24')]};return db[_0x47a5('0x25')][_0x47a5('0x11')](_0x21f296)[_0x47a5('0x16')](function(_0x361bfa){_0x50bf17[_0x47a5('0x11')]=_0x361bfa;_0x3abd6a[_0x47a5('0x26')]=qs[_0x47a5('0x26')](_0x4437f1['query']);return db[_0x47a5('0x25')]['findAll'](_0x3abd6a);})[_0x47a5('0x16')](function(_0x9ac908){_0x50bf17[_0x47a5('0x27')]=_0x9ac908;return _0x50bf17;})['then'](respondWithFilteredResult(_0x129ce5,_0x3abd6a))[_0x47a5('0x28')](handleError(_0x129ce5,null));};exports[_0x47a5('0x29')]=function(_0x39b50b,_0x1f1c68){var _0x51cc81={'raw':!![],'where':{'id':_0x39b50b[_0x47a5('0x2a')]['id']}},_0x50d875={};_0x50d875[_0x47a5('0x2b')]=_['keys'](db['SmsQueue'][_0x47a5('0x1f')]);_0x50d875[_0x47a5('0x2c')]=_['keys'](_0x39b50b[_0x47a5('0x2c')]);_0x50d875['filters']=_[_0x47a5('0x2d')](_0x50d875[_0x47a5('0x2b')],_0x50d875['query']);_0x51cc81['attributes']=_[_0x47a5('0x2d')](_0x50d875['model'],qs[_0x47a5('0x2e')](_0x39b50b[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x51cc81['attributes']=_0x51cc81[_0x47a5('0x2f')]['length']?_0x51cc81['attributes']:_0x50d875[_0x47a5('0x2b')];if(_0x39b50b['query'][_0x47a5('0x30')]){_0x51cc81['include']=[{'all':!![]}];}_0x51cc81=_[_0x47a5('0x31')]({},_0x51cc81,_0x39b50b[_0x47a5('0x32')]);return db[_0x47a5('0x25')][_0x47a5('0x33')](_0x51cc81)[_0x47a5('0x16')](handleEntityNotFound(_0x1f1c68,null))[_0x47a5('0x16')](respondWithResult(_0x1f1c68,null))[_0x47a5('0x28')](handleError(_0x1f1c68,null));};exports[_0x47a5('0x34')]=function(_0x1a0d23,_0x4caed5){return db[_0x47a5('0x25')][_0x47a5('0x34')](_0x1a0d23['body'],{})[_0x47a5('0x16')](function(_0x2bf53d){var _0x1d4348=_0x1a0d23['user'][_0x47a5('0x17')]({'plain':!![]});if(!_0x1d4348)throw new Error(_0x47a5('0x35'));if(_0x1d4348['role']===_0x47a5('0x36')){var _0x19218a=_0x2bf53d['get']({'plain':!![]});var _0x55c5eb='SmsQueues';return db[_0x47a5('0x37')]['find']({'where':{'name':_0x55c5eb,'userProfileId':_0x1d4348[_0x47a5('0x38')]},'raw':!![]})[_0x47a5('0x16')](function(_0x301a85){if(_0x301a85&&_0x301a85[_0x47a5('0x39')]===0x0){return db[_0x47a5('0x19')][_0x47a5('0x34')]({'name':_0x19218a[_0x47a5('0x1b')],'resourceId':_0x19218a['id'],'type':_0x301a85[_0x47a5('0x1b')],'sectionId':_0x301a85['id']},{})[_0x47a5('0x16')](function(){return _0x2bf53d;});}else{return _0x2bf53d;}})[_0x47a5('0x28')](function(_0x280500){logger[_0x47a5('0x1a')](_0x47a5('0x3a'),_0x280500);throw _0x280500;});}return _0x2bf53d;})['then'](respondWithResult(_0x4caed5,0xc9))[_0x47a5('0x28')](handleError(_0x4caed5,null));};exports[_0x47a5('0x14')]=function(_0x331474,_0x23bd8d){if(_0x331474['body']['id']){delete _0x331474[_0x47a5('0x3b')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x331474['params']['id']}})['then'](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x16')](saveUpdates(_0x331474['body'],null))[_0x47a5('0x16')](respondWithResult(_0x23bd8d,null))[_0x47a5('0x28')](handleError(_0x23bd8d,null));};exports[_0x47a5('0x15')]=function(_0x494526,_0x3805fd){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x494526['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3805fd,null))['then'](removeEntity(_0x3805fd,null))[_0x47a5('0x28')](handleError(_0x3805fd,null));};exports[_0x47a5('0x3c')]=function(_0x188614,_0xd75ca3){return db[_0x47a5('0x25')][_0x47a5('0x3c')]()[_0x47a5('0x16')](respondWithResult(_0xd75ca3,null))[_0x47a5('0x28')](handleError(_0xd75ca3,null));};exports[_0x47a5('0x3d')]=function(_0x162fa0,_0x24ecb1){var _0x3c3ebf={'raw':!![],'where':{}},_0xe28d76={},_0x3574d4;return db[_0x47a5('0x25')][_0x47a5('0x3e')]({'where':{'id':_0x162fa0['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x24ecb1,null))[_0x47a5('0x16')](function(_0x49eab1){if(_0x49eab1){_0x3574d4=_0x49eab1['get']({'plain':!![]});_0xe28d76[_0x47a5('0x2b')]=_['keys'](db[_0x47a5('0x3f')][_0x47a5('0x1f')]);_0xe28d76['query']=_['keys'](_0x162fa0[_0x47a5('0x2c')]);_0xe28d76['filters']=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],_0xe28d76[_0x47a5('0x2c')]);_0x3c3ebf[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x162fa0['query']['fields']));_0x3c3ebf[_0x47a5('0x2f')]=_0x3c3ebf[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x3c3ebf[_0x47a5('0x2f')]:_0xe28d76[_0x47a5('0x2b')];if(!_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x41')]('nolimit')){_0x3c3ebf[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x162fa0[_0x47a5('0x2c')]['limit']);_0x3c3ebf[_0x47a5('0xf')]=qs['offset'](_0x162fa0[_0x47a5('0x2c')][_0x47a5('0xf')]);}_0x3c3ebf[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x162fa0['query'][_0x47a5('0x44')]);_0x3c3ebf[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_[_0x47a5('0x46')](_0x162fa0[_0x47a5('0x2c')],_0xe28d76[_0x47a5('0x45')]));_0x3c3ebf[_0x47a5('0x24')]['SmsQueueId']=_0x49eab1['id'];if(_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x3c3ebf[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x3c3ebf[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x3c3ebf['attributes'],function(_0x1ad6a9){var _0x245a15={};_0x245a15[_0x1ad6a9]={'$like':'%'+_0x162fa0[_0x47a5('0x2c')]['filter']+'%'};return _0x245a15;})});}_0x3c3ebf=_[_0x47a5('0x31')]({},_0x3c3ebf,_0x162fa0[_0x47a5('0x32')]);return db[_0x47a5('0x3f')]['findAll'](_0x3c3ebf);}})['then'](function(_0x274e38){if(_0x274e38){return db[_0x47a5('0x48')]['findAndCountAll']({'where':{'id':_['map'](_0x274e38,_0x47a5('0x49')),'role':'agent'},'attributes':['id',_0x47a5('0x1b'),'smsPause','updatedAt',_0x47a5('0x4a')]});}})[_0x47a5('0x16')](function(_0x53eedf){if(_0x53eedf){return{'count':_0x53eedf[_0x47a5('0x11')],'rows':_[_0x47a5('0x1e')](_0x53eedf['rows'],function(_0x5b6127){return{'membername':_0x5b6127[_0x47a5('0x1b')],'UserId':_0x5b6127['id'],'queue_name':_0x3574d4[_0x47a5('0x1b')],'SmsQueueId':_0x3574d4['id'],'interface':util[_0x47a5('0x4b')](_0x47a5('0x4c'),'SIP',_0x5b6127[_0x47a5('0x1b')]),'penalty':0x0,'paused':_0x5b6127[_0x47a5('0x4d')],'createdAt':_0x5b6127[_0x47a5('0x4a')],'updatedAt':_0x5b6127['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x47a5('0x16')](respondWithFilteredResult(_0x24ecb1,_0x3c3ebf))['catch'](handleError(_0x24ecb1,null));};exports[_0x47a5('0x4e')]=function(_0x470da6,_0x943a15){var _0x1c485b={};var _0x3603b7={};var _0x4966af;var _0x144af9;return db['SmsQueue']['findOne']({'where':{'id':_0x470da6['params']['id']}})['then'](handleEntityNotFound(_0x943a15,null))[_0x47a5('0x16')](function(_0x6cd4ea){if(_0x6cd4ea){_0x4966af=_0x6cd4ea;_0x3603b7[_0x47a5('0x2b')]=_['keys'](db['Team'][_0x47a5('0x1f')]);_0x3603b7[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x470da6[_0x47a5('0x2c')]);_0x3603b7[_0x47a5('0x45')]=_['intersection'](_0x3603b7[_0x47a5('0x2b')],_0x3603b7['query']);_0x1c485b[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0x3603b7['model'],qs[_0x47a5('0x2e')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x1c485b[_0x47a5('0x2f')]=_0x1c485b[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x1c485b[_0x47a5('0x2f')]:_0x3603b7[_0x47a5('0x2b')];_0x1c485b['order']=qs[_0x47a5('0x44')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x44')]);_0x1c485b[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x470da6[_0x47a5('0x2c')],_0x3603b7[_0x47a5('0x45')]));if(_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x1c485b[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x1c485b[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x1c485b[_0x47a5('0x2f')],function(_0x44cb90){var _0x1d56f3={};_0x1d56f3[_0x44cb90]={'$like':'%'+_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x1d56f3;})});}_0x1c485b=_[_0x47a5('0x31')]({},_0x1c485b,_0x470da6[_0x47a5('0x32')]);return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x284fb8){if(_0x284fb8){_0x144af9=_0x284fb8[_0x47a5('0x40')];if(!_0x470da6['query'][_0x47a5('0x41')](_0x47a5('0x50'))){_0x1c485b[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x470da6['query'][_0x47a5('0x42')]);_0x1c485b['offset']=qs[_0x47a5('0xf')](_0x470da6['query'][_0x47a5('0xf')]);}return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x2f27c3){if(_0x2f27c3){return _0x2f27c3?{'count':_0x144af9,'rows':_0x2f27c3}:null;}})[_0x47a5('0x16')](respondWithResult(_0x943a15,null))['catch'](handleError(_0x943a15,null));};exports['addTeams']=function(_0x4b8084,_0x4164a3){var _0x2b1303=_0x4b8084[_0x47a5('0x3b')][_0x47a5('0x51')];return db['Team'][_0x47a5('0x52')]({'where':{'id':_0x2b1303},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id',_0x47a5('0x1b'),_0x47a5('0x54'),_0x47a5('0x55'),_0x47a5('0x56')],'raw':!![]}]})[_0x47a5('0x16')](function(_0x4618a0){if(_0x4618a0){var _0xc69a68=_[_0x47a5('0x57')](_0x4618a0,function(_0x463e5e){var _0x49d3dc=_0x463e5e[_0x47a5('0x17')]({'plain':!![]});return _0x49d3dc['Agents'];});return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x4b8084[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x40e584){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x448981){return _0x40e584[_0x47a5('0x5a')](_0x2b1303,{'transaction':_0x448981})[_0x47a5('0x16')](function(){return BPromise[_0x47a5('0x5b')](_0xc69a68,function(_0x1f07ac){return db[_0x47a5('0x3f')][_0x47a5('0x5c')]({'where':{'UserId':_0x1f07ac['id'],'SmsQueueId':_0x4b8084[_0x47a5('0x2a')]['id']},'transaction':_0x448981});});})['then'](function(){_0xc69a68['forEach'](function(_0x5ccc89){socket['emit'](_0x47a5('0x5d'),{'UserId':_0x5ccc89['id'],'SmsQueueId':_0x40e584['id']});});});});});}})[_0x47a5('0x16')](respondWithStatusCode(_0x4164a3,null))['catch'](handleError(_0x4164a3,null));};exports[_0x47a5('0x5e')]=function(_0x44dda2,_0x1baa5a){return db[_0x47a5('0x5f')][_0x47a5('0x52')]({'where':{'id':_0x44dda2[_0x47a5('0x2c')][_0x47a5('0x51')]},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id'],'raw':!![]}]})[_0x47a5('0x16')](handleEntityNotFound(_0x1baa5a,null))[_0x47a5('0x16')](function(_0x5e5f16){var _0x18fa31=_[_0x47a5('0x1e')](_0x5e5f16,'id');var _0x420671=[];var _0x4f35ff=[];var _0x340846=squel[_0x47a5('0x60')]();_0x340846[_0x47a5('0x61')]('tq.TeamId')[_0x47a5('0x62')]('team_has_sms_queues','tq')['join'](_0x47a5('0x63'),'ut',_0x47a5('0x64'))[_0x47a5('0x24')](_0x47a5('0x65'),_0x44dda2[_0x47a5('0x2a')]['id']);for(var _0xea50f3=0x0;_0xea50f3<_0x5e5f16['length'];_0xea50f3+=0x1){let _0x592322=_0x5e5f16[_0xea50f3];for(var _0x3e0dbd=0x0;_0x3e0dbd<_0x592322['Agents'][_0x47a5('0x40')];_0x3e0dbd+=0x1){let _0x3fffd1=_0x592322[_0x47a5('0x53')][_0x3e0dbd];var _0xb16bdd=_0x340846['clone']();_0xb16bdd[_0x47a5('0x24')]('ut.UserId\x20=\x20?',_0x3fffd1['id']);_0x4f35ff['push'](db[_0x47a5('0x58')][_0x47a5('0x2c')](_0xb16bdd['toString'](),{'type':db[_0x47a5('0x58')][_0x47a5('0x66')][_0x47a5('0x67')]})['then'](function(_0x280372){if(_0x280372['length']===0x1){return _0x3fffd1['id'];}else{var _0x2307da=_[_0x47a5('0x68')](_[_0x47a5('0x1e')](_0x280372,'TeamId'),function(_0x2e0af1){return _[_0x47a5('0x69')](_0x18fa31,_0x2e0af1);});if(_0x2307da){return _0x3fffd1['id'];}}}));}}return BPromise[_0x47a5('0x6a')](_0x4f35ff)['then'](function(_0x3525e7){_0x420671=_(_0x420671)['union'](_0x3525e7)[_0x47a5('0x6b')]()['value']();return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x44dda2[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x51738b){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x23c393){return _0x51738b[_0x47a5('0x5e')](_0x44dda2[_0x47a5('0x2c')]['ids'],{'transaction':_0x23c393})['then'](function(){if(!_[_0x47a5('0x6c')](_0x420671)){return _0x51738b['removeAgents'](_0x420671,{'transaction':_0x23c393});}})[_0x47a5('0x16')](function(){_0x420671[_0x47a5('0x6d')](function(_0x216402){socket['emit'](_0x47a5('0x6e'),{'UserId':_0x216402,'SmsQueueId':_0x51738b['id']});});});});});});})[_0x47a5('0x16')](respondWithStatusCode(_0x1baa5a,null))['catch'](handleError(_0x1baa5a,null));};exports[_0x47a5('0x6f')]=function(_0x8a9dea,_0x19acfa){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x8a9dea['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x19acfa,null))[_0x47a5('0x16')](function(_0x48e7f3){if(_0x48e7f3){return _0x48e7f3[_0x47a5('0x6f')](_0x8a9dea[_0x47a5('0x3b')]['ids'],_[_0x47a5('0x70')](_0x8a9dea[_0x47a5('0x3b')],[_0x47a5('0x51'),'id'])||{})['spread'](function(_0x3f2ad9){for(var _0x59b4a5=0x0;_0x59b4a5<_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x47a5('0x40')];_0x59b4a5+=0x1){socket[_0x47a5('0x71')]('userSmsQueue:save',{'UserId':Number(_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x59b4a5]),'SmsQueueId':Number(_0x8a9dea[_0x47a5('0x2a')]['id'])});}return _0x3f2ad9;});}})[_0x47a5('0x16')](respondWithResult(_0x19acfa,null))[_0x47a5('0x28')](handleError(_0x19acfa,null));};exports[_0x47a5('0x72')]=function(_0x49b76a,_0x3eb5c1){return db['SmsQueue']['find']({'where':{'id':_0x49b76a[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3eb5c1,null))[_0x47a5('0x16')](function(_0x96fb22){if(_0x96fb22){return _0x96fb22[_0x47a5('0x72')](_0x49b76a['query'][_0x47a5('0x51')])[_0x47a5('0x16')](function(){if(_[_0x47a5('0x73')](_0x49b76a[_0x47a5('0x2c')]['ids'])){for(var _0x240db9=0x0;_0x240db9<_0x49b76a['query'][_0x47a5('0x51')][_0x47a5('0x40')];_0x240db9+=0x1){socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a[_0x47a5('0x2c')][_0x47a5('0x51')][_0x240db9]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}}else{socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a['query'][_0x47a5('0x51')]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3eb5c1,null))[_0x47a5('0x28')](handleError(_0x3eb5c1,null));};exports[_0x47a5('0x74')]=function(_0x6d6a5,_0x5b85cd){var _0x4bf1f5={};var _0x126bb1={};var _0x3d7371;var _0x47fbb6;return db['SmsQueue'][_0x47a5('0x3e')]({'where':{'id':_0x6d6a5[_0x47a5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x16')](function(_0x269ff6){if(_0x269ff6){_0x3d7371=_0x269ff6;_0x126bb1['model']=_[_0x47a5('0x4f')](db[_0x47a5('0x48')][_0x47a5('0x1f')]);_0x126bb1[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x6d6a5[_0x47a5('0x2c')]);_0x126bb1['filters']=_['intersection'](_0x126bb1['model'],_0x126bb1[_0x47a5('0x2c')]);_0x4bf1f5[_0x47a5('0x2f')]=_['intersection'](_0x126bb1[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x4bf1f5[_0x47a5('0x2f')]=_0x4bf1f5['attributes'][_0x47a5('0x40')]?_0x4bf1f5['attributes']:_0x126bb1['model'];_0x4bf1f5['order']=qs[_0x47a5('0x44')](_0x6d6a5['query'][_0x47a5('0x44')]);_0x4bf1f5[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x6d6a5[_0x47a5('0x2c')],_0x126bb1[_0x47a5('0x45')]));if(_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x4bf1f5[_0x47a5('0x24')]=_['merge'](_0x4bf1f5[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x4bf1f5['attributes'],function(_0x42ba59){var _0x419870={};_0x419870[_0x42ba59]={'$like':'%'+_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x419870;})});}_0x4bf1f5=_[_0x47a5('0x31')]({},_0x4bf1f5,_0x6d6a5[_0x47a5('0x32')]);return _0x3d7371['getAgents'](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x2e418d){if(_0x2e418d){_0x47fbb6=_0x2e418d['length'];if(!_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x41')](_0x47a5('0x50'))){_0x4bf1f5[_0x47a5('0x42')]=qs['limit'](_0x6d6a5['query']['limit']);_0x4bf1f5['offset']=qs[_0x47a5('0xf')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0xf')]);}return _0x3d7371[_0x47a5('0x74')](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x6bc37b){if(_0x6bc37b){return _0x6bc37b?{'count':_0x47fbb6,'rows':_0x6bc37b}:null;}})[_0x47a5('0x16')](respondWithResult(_0x5b85cd,null))[_0x47a5('0x28')](handleError(_0x5b85cd,null));}; \ No newline at end of file +var _0x5f2f=['redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','map','SmsQueue','rawAttributes','type','key','getOptions','where','include','findAll','rows','show','params','model','keys','query','filters','intersection','attributes','fields','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','field','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','sequelize','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api'];(function(_0xfd80d5,_0x303f80){var _0xeb957d=function(_0x1c5d12){while(--_0x1c5d12){_0xfd80d5['push'](_0xfd80d5['shift']());}};_0xeb957d(++_0x303f80);}(_0x5f2f,0x73));var _0xf5f2=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0x5f2f[_0x56e4e7];return _0x383618;};'use strict';var BPromise=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var squel=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var qs=require(_0xf5f2('0x5'));var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf5f2('0x8')]=_[_0xf5f2('0x9')](config[_0xf5f2('0x8')],{'host':_0xf5f2('0xa'),'port':0x18eb});var socket=require(_0xf5f2('0xb'))(new Redis(config[_0xf5f2('0x8')]));require('./smsQueue.socket')[_0xf5f2('0xc')](socket);function respondWithStatusCode(_0x46cd9c,_0x2ec345){_0x2ec345=_0x2ec345||0xcc;return function(_0x56a69f){if(_0x56a69f){return _0x46cd9c[_0xf5f2('0xd')](_0x2ec345);}return _0x46cd9c[_0xf5f2('0xe')](_0x2ec345)[_0xf5f2('0xf')]();};}function respondWithResult(_0x4e0e6b,_0x977a59){_0x977a59=_0x977a59||0xc8;return function(_0x4ebbbe){if(_0x4ebbbe){return _0x4e0e6b['status'](_0x977a59)[_0xf5f2('0x10')](_0x4ebbbe);}};}function respondWithFilteredResult(_0x151aba,_0x4b78cd){return function(_0x336f6b){if(_0x336f6b){var _0x14b51f=typeof _0x4b78cd[_0xf5f2('0x11')]===_0xf5f2('0x12')&&typeof _0x4b78cd[_0xf5f2('0x13')]===_0xf5f2('0x12');var _0x5c01b8=_0x336f6b[_0xf5f2('0x14')];var _0xea612c=_0x14b51f?0x0:_0x4b78cd[_0xf5f2('0x11')];var _0x1c1a5c=_0x14b51f?_0x336f6b[_0xf5f2('0x14')]:_0x4b78cd['offset']+_0x4b78cd[_0xf5f2('0x13')];var _0x286197;if(_0x1c1a5c>=_0x5c01b8){_0x1c1a5c=_0x5c01b8;_0x286197=0xc8;}else{_0x286197=0xce;}_0x151aba[_0xf5f2('0xe')](_0x286197);return _0x151aba[_0xf5f2('0x15')](_0xf5f2('0x16'),_0xea612c+'-'+_0x1c1a5c+'/'+_0x5c01b8)[_0xf5f2('0x10')](_0x336f6b);}return null;};}function saveUpdates(_0xdb61b3){return function(_0x395a5a){if(_0x395a5a){return _0x395a5a[_0xf5f2('0x17')](_0xdb61b3)[_0xf5f2('0x18')](function(_0x20fccd){return _0x20fccd;});}return null;};}function removeEntity(_0x28e097){return function(_0x4ff59b){if(_0x4ff59b){return _0x4ff59b[_0xf5f2('0x19')]()[_0xf5f2('0x18')](function(){var _0x626999=_0x4ff59b[_0xf5f2('0x1a')]({'plain':!![]});var _0x56acc5=_0xf5f2('0x1b');return db[_0xf5f2('0x1c')]['destroy']({'where':{'type':_0x56acc5,'resourceId':_0x626999['id']}})['then'](function(){return _0x4ff59b;});})[_0xf5f2('0x18')](function(){_0x28e097[_0xf5f2('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45b74f){return function(_0x170042){if(!_0x170042){_0x45b74f[_0xf5f2('0xd')](0x194);}return _0x170042;};}function handleError(_0x39c024,_0x36f1cb){_0x36f1cb=_0x36f1cb||0x1f4;return function(_0x4c691a){logger[_0xf5f2('0x1d')](_0x4c691a[_0xf5f2('0x1e')]);if(_0x4c691a[_0xf5f2('0x1f')]){delete _0x4c691a[_0xf5f2('0x1f')];}_0x39c024[_0xf5f2('0xe')](_0x36f1cb)['send'](_0x4c691a);};}exports['index']=function(_0x5f1124,_0x3f79d5){var _0x13da6f={};var _0x1a5bb3={'count':0x0,'rows':[]};var _0xf6c58d=_[_0xf5f2('0x20')](db[_0xf5f2('0x21')][_0xf5f2('0x22')],function(_0x294414){return{'name':_0x294414['fieldName'],'type':_0x294414[_0xf5f2('0x23')][_0xf5f2('0x24')]};});_0x13da6f=qs[_0xf5f2('0x25')](_0xf6c58d,_0x5f1124);var _0x31bfcb={'where':_0x13da6f[_0xf5f2('0x26')]};return db[_0xf5f2('0x21')]['count'](_0x31bfcb)['then'](function(_0x22c826){_0x1a5bb3[_0xf5f2('0x14')]=_0x22c826;_0x13da6f[_0xf5f2('0x27')]=qs['include'](_0x5f1124['query']);return db[_0xf5f2('0x21')][_0xf5f2('0x28')](_0x13da6f);})[_0xf5f2('0x18')](function(_0x153924){_0x1a5bb3[_0xf5f2('0x29')]=_0x153924;return _0x1a5bb3;})['then'](respondWithFilteredResult(_0x3f79d5,_0x13da6f))['catch'](handleError(_0x3f79d5,null));};exports[_0xf5f2('0x2a')]=function(_0x4e19cb,_0xb744b9){var _0x58a4df={'raw':!![],'where':{'id':_0x4e19cb[_0xf5f2('0x2b')]['id']}},_0x45b643={};_0x45b643[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x21')][_0xf5f2('0x22')]);_0x45b643[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x4e19cb['query']);_0x45b643[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x45b643[_0xf5f2('0x2c')],_0x45b643[_0xf5f2('0x2e')]);_0x58a4df[_0xf5f2('0x31')]=_[_0xf5f2('0x30')](_0x45b643[_0xf5f2('0x2c')],qs['fields'](_0x4e19cb[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x58a4df['attributes']=_0x58a4df[_0xf5f2('0x31')]['length']?_0x58a4df[_0xf5f2('0x31')]:_0x45b643[_0xf5f2('0x2c')];if(_0x4e19cb[_0xf5f2('0x2e')][_0xf5f2('0x33')]){_0x58a4df['include']=[{'all':!![]}];}_0x58a4df=_['merge']({},_0x58a4df,_0x4e19cb[_0xf5f2('0x34')]);return db[_0xf5f2('0x21')][_0xf5f2('0x35')](_0x58a4df)['then'](handleEntityNotFound(_0xb744b9,null))[_0xf5f2('0x18')](respondWithResult(_0xb744b9,null))['catch'](handleError(_0xb744b9,null));};exports[_0xf5f2('0x36')]=function(_0x566c47,_0x46f464){return db[_0xf5f2('0x21')]['create'](_0x566c47[_0xf5f2('0x37')],{})[_0xf5f2('0x18')](function(_0x5a4441){var _0x35f738=_0x566c47['user']['get']({'plain':!![]});if(!_0x35f738)throw new Error(_0xf5f2('0x38'));if(_0x35f738[_0xf5f2('0x39')]===_0xf5f2('0x3a')){var _0x2d4400=_0x5a4441[_0xf5f2('0x1a')]({'plain':!![]});var _0xe62b57=_0xf5f2('0x1b');return db['UserProfileSection'][_0xf5f2('0x35')]({'where':{'name':_0xe62b57,'userProfileId':_0x35f738[_0xf5f2('0x3b')]},'raw':!![]})['then'](function(_0xc6a1ae){if(_0xc6a1ae&&_0xc6a1ae[_0xf5f2('0x3c')]===0x0){return db[_0xf5f2('0x1c')][_0xf5f2('0x36')]({'name':_0x2d4400[_0xf5f2('0x1f')],'resourceId':_0x2d4400['id'],'type':_0xc6a1ae[_0xf5f2('0x1f')],'sectionId':_0xc6a1ae['id']},{})[_0xf5f2('0x18')](function(){return _0x5a4441;});}else{return _0x5a4441;}})[_0xf5f2('0x3d')](function(_0x574f24){logger[_0xf5f2('0x1d')](_0xf5f2('0x3e'),_0x574f24);throw _0x574f24;});}return _0x5a4441;})[_0xf5f2('0x18')](respondWithResult(_0x46f464,0xc9))['catch'](handleError(_0x46f464,null));};exports['update']=function(_0x59eb00,_0x76d21b){if(_0x59eb00[_0xf5f2('0x37')]['id']){delete _0x59eb00['body']['id'];}return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x59eb00[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x76d21b,null))[_0xf5f2('0x18')](saveUpdates(_0x59eb00[_0xf5f2('0x37')],null))[_0xf5f2('0x18')](respondWithResult(_0x76d21b,null))[_0xf5f2('0x3d')](handleError(_0x76d21b,null));};exports[_0xf5f2('0x19')]=function(_0x106062,_0x444317){return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x106062[_0xf5f2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x444317,null))[_0xf5f2('0x18')](removeEntity(_0x444317,null))['catch'](handleError(_0x444317,null));};exports[_0xf5f2('0x3f')]=function(_0xc04f44,_0x218def){return db[_0xf5f2('0x21')][_0xf5f2('0x3f')]()[_0xf5f2('0x18')](respondWithResult(_0x218def,null))['catch'](handleError(_0x218def,null));};exports[_0xf5f2('0x40')]=function(_0x2e7193,_0x1c1497){var _0x29b108={'raw':!![],'where':{}},_0x12124d={},_0x10753a;return db[_0xf5f2('0x21')][_0xf5f2('0x41')]({'where':{'id':_0x2e7193['params']['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x1c1497,null))[_0xf5f2('0x18')](function(_0x45db9a){if(_0x45db9a){_0x10753a=_0x45db9a['get']({'plain':!![]});_0x12124d[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x42')]['rawAttributes']);_0x12124d['query']=_[_0xf5f2('0x2d')](_0x2e7193[_0xf5f2('0x2e')]);_0x12124d['filters']=_[_0xf5f2('0x30')](_0x12124d['model'],_0x12124d[_0xf5f2('0x2e')]);_0x29b108['attributes']=_[_0xf5f2('0x30')](_0x12124d['model'],qs[_0xf5f2('0x32')](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x29b108[_0xf5f2('0x31')]=_0x29b108['attributes'][_0xf5f2('0x43')]?_0x29b108[_0xf5f2('0x31')]:_0x12124d['model'];if(!_0x2e7193['query'][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x29b108['limit']=qs[_0xf5f2('0x13')](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x13')]);_0x29b108[_0xf5f2('0x11')]=qs['offset'](_0x2e7193['query'][_0xf5f2('0x11')]);}_0x29b108[_0xf5f2('0x46')]=qs['sort'](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x29b108[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x48')](_0x2e7193[_0xf5f2('0x2e')],_0x12124d[_0xf5f2('0x2f')]));_0x29b108['where']['SmsQueueId']=_0x45db9a['id'];if(_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x29b108[_0xf5f2('0x26')]=_[_0xf5f2('0x4a')](_0x29b108[_0xf5f2('0x26')],{'$or':_['map'](_0x29b108[_0xf5f2('0x31')],function(_0x20ba91){var _0x18b124={};_0x18b124[_0x20ba91]={'$like':'%'+_0x2e7193['query'][_0xf5f2('0x49')]+'%'};return _0x18b124;})});}_0x29b108=_['merge']({},_0x29b108,_0x2e7193[_0xf5f2('0x34')]);return db[_0xf5f2('0x42')][_0xf5f2('0x28')](_0x29b108);}})[_0xf5f2('0x18')](function(_0x4afa4d){if(_0x4afa4d){return db['User'][_0xf5f2('0x4b')]({'where':{'id':_['map'](_0x4afa4d,_0xf5f2('0x4c')),'role':_0xf5f2('0x4d')},'attributes':['id','name',_0xf5f2('0x4e'),_0xf5f2('0x4f'),_0xf5f2('0x50')]});}})['then'](function(_0x397b99){if(_0x397b99){return{'count':_0x397b99[_0xf5f2('0x14')],'rows':_[_0xf5f2('0x20')](_0x397b99[_0xf5f2('0x29')],function(_0x51fa7e){return{'membername':_0x51fa7e[_0xf5f2('0x1f')],'UserId':_0x51fa7e['id'],'queue_name':_0x10753a['name'],'SmsQueueId':_0x10753a['id'],'interface':util[_0xf5f2('0x51')](_0xf5f2('0x52'),_0xf5f2('0x53'),_0x51fa7e[_0xf5f2('0x1f')]),'penalty':0x0,'paused':_0x51fa7e[_0xf5f2('0x4e')],'createdAt':_0x51fa7e['createdAt'],'updatedAt':_0x51fa7e[_0xf5f2('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf5f2('0x18')](respondWithFilteredResult(_0x1c1497,_0x29b108))[_0xf5f2('0x3d')](handleError(_0x1c1497,null));};exports[_0xf5f2('0x54')]=function(_0x2c5733,_0x5359b5){var _0x31e16b={};var _0x5ee6bc={};var _0x4c96ee;var _0xd4f6ef;return db['SmsQueue'][_0xf5f2('0x41')]({'where':{'id':_0x2c5733[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5359b5,null))[_0xf5f2('0x18')](function(_0x5767fc){if(_0x5767fc){_0x4c96ee=_0x5767fc;_0x5ee6bc[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x55')][_0xf5f2('0x22')]);_0x5ee6bc[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x2c5733[_0xf5f2('0x2e')]);_0x5ee6bc['filters']=_[_0xf5f2('0x30')](_0x5ee6bc[_0xf5f2('0x2c')],_0x5ee6bc[_0xf5f2('0x2e')]);_0x31e16b[_0xf5f2('0x31')]=_['intersection'](_0x5ee6bc[_0xf5f2('0x2c')],qs['fields'](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x31e16b['attributes']=_0x31e16b[_0xf5f2('0x31')][_0xf5f2('0x43')]?_0x31e16b[_0xf5f2('0x31')]:_0x5ee6bc[_0xf5f2('0x2c')];_0x31e16b[_0xf5f2('0x46')]=qs['sort'](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x31e16b[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x48')](_0x2c5733[_0xf5f2('0x2e')],_0x5ee6bc['filters']));if(_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x31e16b['where']=_[_0xf5f2('0x4a')](_0x31e16b[_0xf5f2('0x26')],{'$or':_[_0xf5f2('0x20')](_0x31e16b['attributes'],function(_0x551cc9){var _0x4f3df6={};_0x4f3df6[_0x551cc9]={'$like':'%'+_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x49')]+'%'};return _0x4f3df6;})});}_0x31e16b=_[_0xf5f2('0x4a')]({},_0x31e16b,_0x2c5733[_0xf5f2('0x34')]);return _0x4c96ee[_0xf5f2('0x54')](_0x31e16b);}})['then'](function(_0x278b76){if(_0x278b76){_0xd4f6ef=_0x278b76[_0xf5f2('0x43')];if(!_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x31e16b[_0xf5f2('0x13')]=qs[_0xf5f2('0x13')](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x13')]);_0x31e16b[_0xf5f2('0x11')]=qs[_0xf5f2('0x11')](_0x2c5733['query']['offset']);}return _0x4c96ee['getTeams'](_0x31e16b);}})[_0xf5f2('0x18')](function(_0xafba8e){if(_0xafba8e){return _0xafba8e?{'count':_0xd4f6ef,'rows':_0xafba8e}:null;}})[_0xf5f2('0x18')](respondWithResult(_0x5359b5,null))[_0xf5f2('0x3d')](handleError(_0x5359b5,null));};exports[_0xf5f2('0x56')]=function(_0x5c6959,_0x9d943f){var _0x43c732=_0x5c6959[_0xf5f2('0x37')][_0xf5f2('0x57')];return db[_0xf5f2('0x55')]['findAll']({'where':{'id':_0x43c732},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x58')],'as':_0xf5f2('0x59'),'attributes':['id','name',_0xf5f2('0x5a'),_0xf5f2('0x5b'),_0xf5f2('0x5c')],'raw':!![]}]})[_0xf5f2('0x18')](function(_0x588434){if(_0x588434){var _0x40b36e=_[_0xf5f2('0x5d')](_0x588434,function(_0x19602d){var _0x2adeb4=_0x19602d[_0xf5f2('0x1a')]({'plain':!![]});return _0x2adeb4['Agents'];});return db['SmsQueue'][_0xf5f2('0x35')]({'where':{'id':_0x5c6959[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](function(_0xe3ea1e){return db['sequelize']['transaction'](function(_0x16048e){return _0xe3ea1e['addTeams'](_0x43c732,{'transaction':_0x16048e})['then'](function(){return BPromise['each'](_0x40b36e,function(_0x57cb18){return db[_0xf5f2('0x42')][_0xf5f2('0x5e')]({'where':{'UserId':_0x57cb18['id'],'SmsQueueId':_0x5c6959[_0xf5f2('0x2b')]['id']},'transaction':_0x16048e});});})[_0xf5f2('0x18')](function(){_0x40b36e[_0xf5f2('0x5f')](function(_0x9f941e){socket[_0xf5f2('0x60')](_0xf5f2('0x61'),{'UserId':_0x9f941e['id'],'SmsQueueId':_0xe3ea1e['id']});});});});});}})[_0xf5f2('0x18')](respondWithStatusCode(_0x9d943f,null))[_0xf5f2('0x3d')](handleError(_0x9d943f,null));};exports[_0xf5f2('0x62')]=function(_0x2afeac,_0x1ba503){return db[_0xf5f2('0x55')][_0xf5f2('0x28')]({'where':{'id':_0x2afeac[_0xf5f2('0x2e')][_0xf5f2('0x57')]},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf5f2('0x18')](handleEntityNotFound(_0x1ba503,null))[_0xf5f2('0x18')](function(_0x21043b){var _0x2811ad=_[_0xf5f2('0x20')](_0x21043b,'id');var _0x308220=[];var _0x16491c=[];var _0xcf48eb=squel['select']();_0xcf48eb[_0xf5f2('0x63')]('tq.TeamId')['from']('team_has_sms_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf5f2('0x26')](_0xf5f2('0x64'),_0x2afeac[_0xf5f2('0x2b')]['id']);for(var _0x375bc9=0x0;_0x375bc9<_0x21043b[_0xf5f2('0x43')];_0x375bc9+=0x1){let _0x3cf857=_0x21043b[_0x375bc9];for(var _0x5dc63f=0x0;_0x5dc63f<_0x3cf857['Agents'][_0xf5f2('0x43')];_0x5dc63f+=0x1){let _0x578a22=_0x3cf857[_0xf5f2('0x59')][_0x5dc63f];var _0x186fdd=_0xcf48eb['clone']();_0x186fdd['where'](_0xf5f2('0x65'),_0x578a22['id']);_0x16491c[_0xf5f2('0x66')](db['sequelize'][_0xf5f2('0x2e')](_0x186fdd[_0xf5f2('0x67')](),{'type':db['sequelize'][_0xf5f2('0x68')][_0xf5f2('0x69')]})[_0xf5f2('0x18')](function(_0x4c1678){if(_0x4c1678[_0xf5f2('0x43')]===0x1){return _0x578a22['id'];}else{var _0xc28adc=_[_0xf5f2('0x6a')](_[_0xf5f2('0x20')](_0x4c1678,_0xf5f2('0x6b')),function(_0x3e0288){return _[_0xf5f2('0x6c')](_0x2811ad,_0x3e0288);});if(_0xc28adc){return _0x578a22['id'];}}}));}}return BPromise[_0xf5f2('0x6d')](_0x16491c)[_0xf5f2('0x18')](function(_0x3a6f60){_0x308220=_(_0x308220)[_0xf5f2('0x6e')](_0x3a6f60)[_0xf5f2('0x6f')]()[_0xf5f2('0x70')]();return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x2afeac[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](function(_0x29a9d4){return db[_0xf5f2('0x71')][_0xf5f2('0x72')](function(_0x800f42){return _0x29a9d4['removeTeams'](_0x2afeac[_0xf5f2('0x2e')][_0xf5f2('0x57')],{'transaction':_0x800f42})['then'](function(){if(!_[_0xf5f2('0x73')](_0x308220)){return _0x29a9d4[_0xf5f2('0x74')](_0x308220,{'transaction':_0x800f42});}})['then'](function(){_0x308220[_0xf5f2('0x5f')](function(_0x2f54eb){socket[_0xf5f2('0x60')]('userSmsQueue:remove',{'UserId':_0x2f54eb,'SmsQueueId':_0x29a9d4['id']});});});});});});})['then'](respondWithStatusCode(_0x1ba503,null))[_0xf5f2('0x3d')](handleError(_0x1ba503,null));};exports[_0xf5f2('0x75')]=function(_0x213ade,_0x5ba275){return db['SmsQueue'][_0xf5f2('0x35')]({'where':{'id':_0x213ade[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5ba275,null))['then'](function(_0x4cde64){if(_0x4cde64){return _0x4cde64['addAgents'](_0x213ade['body']['ids'],_[_0xf5f2('0x76')](_0x213ade['body'],[_0xf5f2('0x57'),'id'])||{})[_0xf5f2('0x77')](function(_0xec3c35){for(var _0x43a167=0x0;_0x43a167<_0x213ade[_0xf5f2('0x37')][_0xf5f2('0x57')][_0xf5f2('0x43')];_0x43a167+=0x1){socket[_0xf5f2('0x60')](_0xf5f2('0x61'),{'UserId':Number(_0x213ade[_0xf5f2('0x37')][_0xf5f2('0x57')][_0x43a167]),'SmsQueueId':Number(_0x213ade[_0xf5f2('0x2b')]['id'])});}return _0xec3c35;});}})[_0xf5f2('0x18')](respondWithResult(_0x5ba275,null))['catch'](handleError(_0x5ba275,null));};exports[_0xf5f2('0x74')]=function(_0x2a4fed,_0x5783e2){return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x2a4fed['params']['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5783e2,null))[_0xf5f2('0x18')](function(_0x281f61){if(_0x281f61){return _0x281f61['removeAgents'](_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')])['then'](function(){if(_[_0xf5f2('0x78')](_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')])){for(var _0x517aa8=0x0;_0x517aa8<_0x2a4fed[_0xf5f2('0x2e')]['ids'][_0xf5f2('0x43')];_0x517aa8+=0x1){socket['emit'](_0xf5f2('0x79'),{'UserId':Number(_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')][_0x517aa8]),'SmsQueueId':Number(_0x2a4fed[_0xf5f2('0x2b')]['id'])});}}else{socket['emit'](_0xf5f2('0x79'),{'UserId':Number(_0x2a4fed['query']['ids']),'SmsQueueId':Number(_0x2a4fed['params']['id'])});}});}})[_0xf5f2('0x18')](respondWithStatusCode(_0x5783e2,null))[_0xf5f2('0x3d')](handleError(_0x5783e2,null));};exports['getAgents']=function(_0x3c8a1b,_0x15025d){var _0x35790b={};var _0x3962b2={};var _0x28873e;var _0x1fc5ae;return db['SmsQueue'][_0xf5f2('0x41')]({'where':{'id':_0x3c8a1b[_0xf5f2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x15025d,null))[_0xf5f2('0x18')](function(_0x19cbff){if(_0x19cbff){_0x28873e=_0x19cbff;_0x3962b2['model']=_[_0xf5f2('0x2d')](db[_0xf5f2('0x58')][_0xf5f2('0x22')]);_0x3962b2[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x3c8a1b[_0xf5f2('0x2e')]);_0x3962b2['filters']=_[_0xf5f2('0x30')](_0x3962b2[_0xf5f2('0x2c')],_0x3962b2[_0xf5f2('0x2e')]);_0x35790b[_0xf5f2('0x31')]=_[_0xf5f2('0x30')](_0x3962b2[_0xf5f2('0x2c')],qs[_0xf5f2('0x32')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x35790b['attributes']=_0x35790b[_0xf5f2('0x31')][_0xf5f2('0x43')]?_0x35790b[_0xf5f2('0x31')]:_0x3962b2[_0xf5f2('0x2c')];_0x35790b[_0xf5f2('0x46')]=qs[_0xf5f2('0x47')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x35790b[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_['pick'](_0x3c8a1b['query'],_0x3962b2[_0xf5f2('0x2f')]));if(_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x35790b[_0xf5f2('0x26')]=_['merge'](_0x35790b[_0xf5f2('0x26')],{'$or':_[_0xf5f2('0x20')](_0x35790b[_0xf5f2('0x31')],function(_0x3d7f53){var _0x456a1e={};_0x456a1e[_0x3d7f53]={'$like':'%'+_0x3c8a1b['query'][_0xf5f2('0x49')]+'%'};return _0x456a1e;})});}_0x35790b=_[_0xf5f2('0x4a')]({},_0x35790b,_0x3c8a1b['options']);return _0x28873e[_0xf5f2('0x7a')](_0x35790b);}})[_0xf5f2('0x18')](function(_0x2563fa){if(_0x2563fa){_0x1fc5ae=_0x2563fa[_0xf5f2('0x43')];if(!_0x3c8a1b['query'][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x35790b[_0xf5f2('0x13')]=qs['limit'](_0x3c8a1b['query'][_0xf5f2('0x13')]);_0x35790b[_0xf5f2('0x11')]=qs[_0xf5f2('0x11')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x11')]);}return _0x28873e[_0xf5f2('0x7a')](_0x35790b);}})['then'](function(_0x39dee8){if(_0x39dee8){return _0x39dee8?{'count':_0x1fc5ae,'rows':_0x39dee8}:null;}})['then'](respondWithResult(_0x15025d,null))[_0xf5f2('0x3d')](handleError(_0x15025d,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 9fdeb89..f57b49f 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 _0x4dc4=['emit','hasOwnProperty','hook','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove'];(function(_0x3dc089,_0x5ccb0d){var _0x34d9d3=function(_0x4556bf){while(--_0x4556bf){_0x3dc089['push'](_0x3dc089['shift']());}};_0x34d9d3(++_0x5ccb0d);}(_0x4dc4,0x175));var _0x44dc=function(_0x2abf03,_0xda4a7){_0x2abf03=_0x2abf03-0x0;var _0x275177=_0x4dc4[_0x2abf03];return _0x275177;};'use strict';var EventEmitter=require(_0x44dc('0x0'));var SmsQueue=require(_0x44dc('0x1'))['db'][_0x44dc('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x44dc('0x3')](0x0);var events={'afterCreate':_0x44dc('0x4'),'afterUpdate':_0x44dc('0x5'),'afterDestroy':_0x44dc('0x6')};function emitEvent(_0xdc8961){return function(_0x577c0e,_0x7774c0,_0x3123e1){SmsQueueEvents[_0x44dc('0x7')](_0xdc8961+':'+_0x577c0e['id'],_0x577c0e);SmsQueueEvents['emit'](_0xdc8961,_0x577c0e);_0x3123e1(null);};}for(var e in events){if(events[_0x44dc('0x8')](e)){var event=events[e];SmsQueue[_0x44dc('0x9')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0x78ff=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners','save','update'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x78ff,0x145));var _0xf78f=function(_0x15dba5,_0x5d2fbe){_0x15dba5=_0x15dba5-0x0;var _0x12e9f9=_0x78ff[_0x15dba5];return _0x12e9f9;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xf78f('0x0'))['db'][_0xf78f('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf78f('0x2')](0x0);var events={'afterCreate':_0xf78f('0x3'),'afterUpdate':_0xf78f('0x4'),'afterDestroy':_0xf78f('0x5')};function emitEvent(_0x3f7a2c){return function(_0x1cf462,_0x240d13,_0x2d5bd1){SmsQueueEvents[_0xf78f('0x6')](_0x3f7a2c+':'+_0x1cf462['id'],_0x1cf462);SmsQueueEvents[_0xf78f('0x6')](_0x3f7a2c,_0x1cf462);_0x2d5bd1(null);};}for(var e in events){if(events[_0xf78f('0x7')](e)){var event=events[e];SmsQueue[_0xf78f('0x8')](e,emitEvent(event));}}module[_0xf78f('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index fe18f4b..ffdfd67 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 _0xc1b4=['./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2298f0,_0x3bbf4f){var _0x39b136=function(_0xc2cd6e){while(--_0xc2cd6e){_0x2298f0['push'](_0x2298f0['shift']());}};_0x39b136(++_0x3bbf4f);}(_0xc1b4,0x1d9));var _0x4c1b=function(_0x1b161d,_0x28ea23){_0x1b161d=_0x1b161d-0x0;var _0x1b9195=_0xc1b4[_0x1b161d];return _0x1b9195;};'use strict';var _=require(_0x4c1b('0x0'));var util=require(_0x4c1b('0x1'));var logger=require(_0x4c1b('0x2'))('api');var moment=require(_0x4c1b('0x3'));var BPromise=require('bluebird');var rp=require(_0x4c1b('0x4'));var fs=require('fs');var path=require(_0x4c1b('0x5'));var rimraf=require(_0x4c1b('0x6'));var config=require(_0x4c1b('0x7'));var attributes=require(_0x4c1b('0x8'));module[_0x4c1b('0x9')]=function(_0x59c755,_0x36cd04){return _0x59c755[_0x4c1b('0xa')](_0x4c1b('0xb'),attributes,{'tableName':_0x4c1b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07fa=['../../config/environment','./smsQueue.attributes','SmsQueue','sms_queues','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x32aa7b,_0x49defc){var _0x1d4df4=function(_0x3ad652){while(--_0x3ad652){_0x32aa7b['push'](_0x32aa7b['shift']());}};_0x1d4df4(++_0x49defc);}(_0x07fa,0x1a8));var _0xa07f=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x07fa[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa07f('0x0'))(_0xa07f('0x1'));var moment=require(_0xa07f('0x2'));var BPromise=require(_0xa07f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa07f('0x4'));var rimraf=require(_0xa07f('0x5'));var config=require(_0xa07f('0x6'));var attributes=require(_0xa07f('0x7'));module['exports']=function(_0x58a4a8,_0x2eb1fd){return _0x58a4a8['define'](_0xa07f('0x8'),attributes,{'tableName':_0xa07f('0x9'),'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 c72f64c..ed01d18 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 _0xa5d1=['../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','findAll','options','raw','where','attributes','limit','map','include','model','debug','ShowSmsQueue','SmsQueue','find','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xa5d1,0xa5));var _0x1a5d=function(_0x54f73e,_0x4946c1){_0x54f73e=_0x54f73e-0x0;var _0x5ed7cd=_0xa5d1[_0x54f73e];return _0x5ed7cd;};'use strict';var _=require('lodash');var util=require(_0x1a5d('0x0'));var moment=require('moment');var BPromise=require(_0x1a5d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a5d('0x2'));var db=require(_0x1a5d('0x3'))['db'];var utils=require(_0x1a5d('0x4'));var logger=require(_0x1a5d('0x5'))(_0x1a5d('0x6'));var config=require(_0x1a5d('0x7'));var jayson=require(_0x1a5d('0x8'));var client=jayson[_0x1a5d('0x9')][_0x1a5d('0xa')]({'port':0x232a});config['redis']=_[_0x1a5d('0xb')](config[_0x1a5d('0xc')],{'host':_0x1a5d('0xd'),'port':0x18eb});var socket=require(_0x1a5d('0xe'))(new Redis(config[_0x1a5d('0xc')]));require(_0x1a5d('0xf'))[_0x1a5d('0x10')](socket);function respondWithRpcPromise(_0x303983,_0x256ed8,_0x22a4c8){return new BPromise(function(_0x405ad6,_0x1a27ec){return client[_0x1a5d('0x11')](_0x303983,_0x22a4c8)[_0x1a5d('0x12')](function(_0x245abc){logger[_0x1a5d('0x13')](_0x1a5d('0x14'),_0x256ed8,_0x1a5d('0x15'));logger['debug'](_0x1a5d('0x16'),_0x256ed8,_0x1a5d('0x15'),JSON[_0x1a5d('0x17')](_0x245abc));if(_0x245abc[_0x1a5d('0x18')]){if(_0x245abc[_0x1a5d('0x18')][_0x1a5d('0x19')]===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x256ed8,_0x245abc[_0x1a5d('0x18')][_0x1a5d('0x1a')]);return _0x1a27ec(_0x245abc[_0x1a5d('0x18')]['message']);}logger['error'](_0x1a5d('0x14'),_0x256ed8,_0x245abc[_0x1a5d('0x18')][_0x1a5d('0x1a')]);return _0x405ad6(_0x245abc['error'][_0x1a5d('0x1a')]);}else{logger[_0x1a5d('0x13')]('SmsQueue,\x20%s,\x20%s',_0x256ed8,'request\x20sent');_0x405ad6(_0x245abc[_0x1a5d('0x1b')][_0x1a5d('0x1a')]);}})[_0x1a5d('0x1c')](function(_0x470d67){logger[_0x1a5d('0x18')](_0x1a5d('0x14'),_0x256ed8,_0x470d67);_0x1a27ec(_0x470d67);});});}exports[_0x1a5d('0x1d')]=function(_0x36d186){var _0x5d8abf=this;return new Promise(function(_0x5b54b3,_0x918041){return db['SmsQueue'][_0x1a5d('0x1e')]({'raw':_0x36d186[_0x1a5d('0x1f')]?_0x36d186[_0x1a5d('0x1f')][_0x1a5d('0x20')]===undefined?!![]:![]:!![],'where':_0x36d186[_0x1a5d('0x1f')]?_0x36d186[_0x1a5d('0x1f')][_0x1a5d('0x21')]||null:null,'attributes':_0x36d186[_0x1a5d('0x1f')]?_0x36d186[_0x1a5d('0x1f')][_0x1a5d('0x22')]||null:null,'limit':_0x36d186[_0x1a5d('0x1f')]?_0x36d186[_0x1a5d('0x1f')][_0x1a5d('0x23')]||null:null,'include':_0x36d186[_0x1a5d('0x1f')]?_0x36d186[_0x1a5d('0x1f')]['include']?_[_0x1a5d('0x24')](_0x36d186[_0x1a5d('0x1f')][_0x1a5d('0x25')],function(_0x1d304f){return{'model':db[_0x1d304f[_0x1a5d('0x26')]],'as':_0x1d304f['as'],'attributes':_0x1d304f['attributes'],'include':_0x1d304f[_0x1a5d('0x25')]?_[_0x1a5d('0x24')](_0x1d304f[_0x1a5d('0x25')],function(_0x567ad8){return{'model':db[_0x567ad8[_0x1a5d('0x26')]],'as':_0x567ad8['as'],'attributes':_0x567ad8[_0x1a5d('0x22')],'include':_0x567ad8['include']?_['map'](_0x567ad8[_0x1a5d('0x25')],function(_0x21293d){return{'model':db[_0x21293d[_0x1a5d('0x26')]],'as':_0x21293d['as'],'attributes':_0x21293d[_0x1a5d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1a5d('0x12')](function(_0x539277){logger['info']('GetSmsQueue',_0x36d186);logger[_0x1a5d('0x27')]('GetSmsQueue',_0x36d186,JSON[_0x1a5d('0x17')](_0x539277));_0x5b54b3(_0x539277);})[_0x1a5d('0x1c')](function(_0x393c55){logger[_0x1a5d('0x18')]('GetSmsQueue',_0x393c55['message'],_0x36d186);_0x918041(_0x5d8abf['error'](0x1f4,_0x393c55[_0x1a5d('0x1a')]));});});};exports[_0x1a5d('0x28')]=function(_0x5639ba){var _0x2e8e2f=this;return new Promise(function(_0x69e6d4,_0xb90a06){return db[_0x1a5d('0x29')][_0x1a5d('0x2a')]({'raw':_0x5639ba[_0x1a5d('0x1f')]?_0x5639ba[_0x1a5d('0x1f')][_0x1a5d('0x20')]===undefined?!![]:![]:!![],'where':_0x5639ba[_0x1a5d('0x1f')]?_0x5639ba[_0x1a5d('0x1f')][_0x1a5d('0x21')]||null:null,'attributes':_0x5639ba[_0x1a5d('0x1f')]?_0x5639ba[_0x1a5d('0x1f')][_0x1a5d('0x22')]||null:null,'include':_0x5639ba[_0x1a5d('0x1f')]?_0x5639ba[_0x1a5d('0x1f')][_0x1a5d('0x25')]?_[_0x1a5d('0x24')](_0x5639ba[_0x1a5d('0x1f')][_0x1a5d('0x25')],function(_0x2d4a76){return{'model':db[_0x2d4a76[_0x1a5d('0x26')]],'as':_0x2d4a76['as'],'attributes':_0x2d4a76['attributes'],'include':_0x2d4a76[_0x1a5d('0x25')]?_[_0x1a5d('0x24')](_0x2d4a76[_0x1a5d('0x25')],function(_0x206e87){return{'model':db[_0x206e87[_0x1a5d('0x26')]],'as':_0x206e87['as'],'attributes':_0x206e87['attributes'],'include':_0x206e87[_0x1a5d('0x25')]?_['map'](_0x206e87[_0x1a5d('0x25')],function(_0x25b13c){return{'model':db[_0x25b13c[_0x1a5d('0x26')]],'as':_0x25b13c['as'],'attributes':_0x25b13c['attributes']};}):[]};}):[]};}):[]:[]})[_0x1a5d('0x12')](function(_0x47147c){logger[_0x1a5d('0x13')]('ShowSmsQueue',_0x5639ba);logger[_0x1a5d('0x27')]('ShowSmsQueue',_0x5639ba,JSON['stringify'](_0x47147c));_0x69e6d4(_0x47147c);})[_0x1a5d('0x1c')](function(_0x4a9881){logger[_0x1a5d('0x18')](_0x1a5d('0x28'),_0x4a9881['message'],_0x5639ba);_0xb90a06(_0x2e8e2f[_0x1a5d('0x18')](0x1f4,_0x4a9881[_0x1a5d('0x1a')]));});});}; \ No newline at end of file +var _0x6f96=['model','debug','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x38aeea,_0x57522a){var _0x5e8d2c=function(_0xff08ce){while(--_0xff08ce){_0x38aeea['push'](_0x38aeea['shift']());}};_0x5e8d2c(++_0x57522a);}(_0x6f96,0x187));var _0x66f9=function(_0x5417f2,_0x5b2237){_0x5417f2=_0x5417f2-0x0;var _0x48aa43=_0x6f96[_0x5417f2];return _0x48aa43;};'use strict';var _=require(_0x66f9('0x0'));var util=require(_0x66f9('0x1'));var moment=require(_0x66f9('0x2'));var BPromise=require(_0x66f9('0x3'));var rs=require(_0x66f9('0x4'));var fs=require('fs');var Redis=require(_0x66f9('0x5'));var db=require(_0x66f9('0x6'))['db'];var utils=require(_0x66f9('0x7'));var logger=require(_0x66f9('0x8'))(_0x66f9('0x9'));var config=require(_0x66f9('0xa'));var jayson=require(_0x66f9('0xb'));var client=jayson[_0x66f9('0xc')]['http']({'port':0x232a});config[_0x66f9('0xd')]=_[_0x66f9('0xe')](config[_0x66f9('0xd')],{'host':_0x66f9('0xf'),'port':0x18eb});var socket=require(_0x66f9('0x10'))(new Redis(config[_0x66f9('0xd')]));require('./smsQueue.socket')[_0x66f9('0x11')](socket);function respondWithRpcPromise(_0x9549eb,_0xd76264,_0xbf4265){return new BPromise(function(_0x506af7,_0x3f5ba1){return client[_0x66f9('0x12')](_0x9549eb,_0xbf4265)[_0x66f9('0x13')](function(_0x6794b3){logger[_0x66f9('0x14')](_0x66f9('0x15'),_0xd76264,_0x66f9('0x16'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0xd76264,_0x66f9('0x16'),JSON[_0x66f9('0x17')](_0x6794b3));if(_0x6794b3['error']){if(_0x6794b3[_0x66f9('0x18')][_0x66f9('0x19')]===0x1f4){logger[_0x66f9('0x18')](_0x66f9('0x15'),_0xd76264,_0x6794b3[_0x66f9('0x18')][_0x66f9('0x1a')]);return _0x3f5ba1(_0x6794b3[_0x66f9('0x18')][_0x66f9('0x1a')]);}logger[_0x66f9('0x18')]('SmsQueue,\x20%s,\x20%s',_0xd76264,_0x6794b3[_0x66f9('0x18')][_0x66f9('0x1a')]);return _0x506af7(_0x6794b3['error'][_0x66f9('0x1a')]);}else{logger[_0x66f9('0x14')](_0x66f9('0x15'),_0xd76264,_0x66f9('0x16'));_0x506af7(_0x6794b3[_0x66f9('0x1b')]['message']);}})[_0x66f9('0x1c')](function(_0x66a29c){logger[_0x66f9('0x18')](_0x66f9('0x15'),_0xd76264,_0x66a29c);_0x3f5ba1(_0x66a29c);});});}exports[_0x66f9('0x1d')]=function(_0x2f0ded){var _0x4ec217=this;return new Promise(function(_0x12eae7,_0x161483){return db[_0x66f9('0x1e')][_0x66f9('0x1f')]({'raw':_0x2f0ded[_0x66f9('0x20')]?_0x2f0ded[_0x66f9('0x20')][_0x66f9('0x21')]===undefined?!![]:![]:!![],'where':_0x2f0ded[_0x66f9('0x20')]?_0x2f0ded['options'][_0x66f9('0x22')]||null:null,'attributes':_0x2f0ded[_0x66f9('0x20')]?_0x2f0ded[_0x66f9('0x20')][_0x66f9('0x23')]||null:null,'limit':_0x2f0ded[_0x66f9('0x20')]?_0x2f0ded[_0x66f9('0x20')][_0x66f9('0x24')]||null:null,'include':_0x2f0ded[_0x66f9('0x20')]?_0x2f0ded[_0x66f9('0x20')][_0x66f9('0x25')]?_[_0x66f9('0x26')](_0x2f0ded['options'][_0x66f9('0x25')],function(_0x29d2d7){return{'model':db[_0x29d2d7[_0x66f9('0x27')]],'as':_0x29d2d7['as'],'attributes':_0x29d2d7[_0x66f9('0x23')],'include':_0x29d2d7[_0x66f9('0x25')]?_[_0x66f9('0x26')](_0x29d2d7[_0x66f9('0x25')],function(_0xadac1a){return{'model':db[_0xadac1a[_0x66f9('0x27')]],'as':_0xadac1a['as'],'attributes':_0xadac1a[_0x66f9('0x23')],'include':_0xadac1a[_0x66f9('0x25')]?_[_0x66f9('0x26')](_0xadac1a[_0x66f9('0x25')],function(_0x3f01b5){return{'model':db[_0x3f01b5['model']],'as':_0x3f01b5['as'],'attributes':_0x3f01b5[_0x66f9('0x23')]};}):[]};}):[]};}):[]:[]})[_0x66f9('0x13')](function(_0x163b03){logger[_0x66f9('0x14')](_0x66f9('0x1d'),_0x2f0ded);logger[_0x66f9('0x28')](_0x66f9('0x1d'),_0x2f0ded,JSON[_0x66f9('0x17')](_0x163b03));_0x12eae7(_0x163b03);})[_0x66f9('0x1c')](function(_0x238d82){logger[_0x66f9('0x18')](_0x66f9('0x1d'),_0x238d82[_0x66f9('0x1a')],_0x2f0ded);_0x161483(_0x4ec217[_0x66f9('0x18')](0x1f4,_0x238d82[_0x66f9('0x1a')]));});});};exports[_0x66f9('0x29')]=function(_0x2fbacf){var _0x4668a4=this;return new Promise(function(_0x85adfb,_0x1dd63c){return db[_0x66f9('0x1e')][_0x66f9('0x2a')]({'raw':_0x2fbacf['options']?_0x2fbacf[_0x66f9('0x20')][_0x66f9('0x21')]===undefined?!![]:![]:!![],'where':_0x2fbacf[_0x66f9('0x20')]?_0x2fbacf[_0x66f9('0x20')][_0x66f9('0x22')]||null:null,'attributes':_0x2fbacf[_0x66f9('0x20')]?_0x2fbacf[_0x66f9('0x20')][_0x66f9('0x23')]||null:null,'include':_0x2fbacf[_0x66f9('0x20')]?_0x2fbacf['options'][_0x66f9('0x25')]?_[_0x66f9('0x26')](_0x2fbacf['options'][_0x66f9('0x25')],function(_0x2fc9b3){return{'model':db[_0x2fc9b3[_0x66f9('0x27')]],'as':_0x2fc9b3['as'],'attributes':_0x2fc9b3['attributes'],'include':_0x2fc9b3[_0x66f9('0x25')]?_['map'](_0x2fc9b3[_0x66f9('0x25')],function(_0x530625){return{'model':db[_0x530625[_0x66f9('0x27')]],'as':_0x530625['as'],'attributes':_0x530625[_0x66f9('0x23')],'include':_0x530625[_0x66f9('0x25')]?_['map'](_0x530625[_0x66f9('0x25')],function(_0x1e240b){return{'model':db[_0x1e240b[_0x66f9('0x27')]],'as':_0x1e240b['as'],'attributes':_0x1e240b[_0x66f9('0x23')]};}):[]};}):[]};}):[]:[]})[_0x66f9('0x13')](function(_0x44cb33){logger[_0x66f9('0x14')]('ShowSmsQueue',_0x2fbacf);logger['debug'](_0x66f9('0x29'),_0x2fbacf,JSON['stringify'](_0x44cb33));_0x85adfb(_0x44cb33);})[_0x66f9('0x1c')](function(_0x3475d1){logger[_0x66f9('0x18')](_0x66f9('0x29'),_0x3475d1['message'],_0x2fbacf);_0x1dd63c(_0x4668a4[_0x66f9('0x18')](0x1f4,_0x3475d1['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 4358d35..4ac1e96 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 _0xe926=['./smsQueue.events','save','update','register','smsQueue:'];(function(_0x33d9c5,_0x2c159d){var _0x28f547=function(_0x61fc92){while(--_0x61fc92){_0x33d9c5['push'](_0x33d9c5['shift']());}};_0x28f547(++_0x2c159d);}(_0xe926,0xf0));var _0x6e92=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xe926[_0x49ca18];return _0x145d54;};'use strict';var SmsQueueEvents=require(_0x6e92('0x0'));var events=[_0x6e92('0x1'),'remove',_0x6e92('0x2')];function createListener(_0x5e40df,_0x4209eb){return function(_0x4b6610){_0x4209eb['emit'](_0x5e40df,_0x4b6610);};}function removeListener(_0x57f482,_0x164906){return function(){SmsQueueEvents['removeListener'](_0x57f482,_0x164906);};}exports[_0x6e92('0x3')]=function(_0x14cfae){for(var _0x5c9416=0x0,_0x2305db=events['length'];_0x5c9416<_0x2305db;_0x5c9416++){var _0x52458c=events[_0x5c9416];var _0x38e372=createListener(_0x6e92('0x4')+_0x52458c,_0x14cfae);SmsQueueEvents['on'](_0x52458c,_0x38e372);}}; \ No newline at end of file +var _0xd717=['smsQueue:','./smsQueue.events','remove','update','removeListener','length'];(function(_0x18a814,_0x523e26){var _0x345660=function(_0x20ce8c){while(--_0x20ce8c){_0x18a814['push'](_0x18a814['shift']());}};_0x345660(++_0x523e26);}(_0xd717,0x10f));var _0x7d71=function(_0x2b746b,_0x421fa0){_0x2b746b=_0x2b746b-0x0;var _0x1bd43d=_0xd717[_0x2b746b];return _0x1bd43d;};'use strict';var SmsQueueEvents=require(_0x7d71('0x0'));var events=['save',_0x7d71('0x1'),_0x7d71('0x2')];function createListener(_0x5c5cac,_0x5bd231){return function(_0x4a755c){_0x5bd231['emit'](_0x5c5cac,_0x4a755c);};}function removeListener(_0x47d07a,_0x2008a5){return function(){SmsQueueEvents[_0x7d71('0x3')](_0x47d07a,_0x2008a5);};}exports['register']=function(_0x46666f){for(var _0x5a9ce7=0x0,_0x3aaf8e=events[_0x7d71('0x4')];_0x5a9ce7<_0x3aaf8e;_0x5a9ce7++){var _0x8f5905=events[_0x5a9ce7];var _0x37e91b=createListener(_0x7d71('0x5')+_0x8f5905,_0x46666f);SmsQueueEvents['on'](_0x8f5905,_0x37e91b);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 5bb8a6c..40cf8a6 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 _0x4e0a=['../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x8dedb7,_0x1cfb46){var _0x27b550=function(_0x44aea6){while(--_0x44aea6){_0x8dedb7['push'](_0x8dedb7['shift']());}};_0x27b550(++_0x1cfb46);}(_0x4e0a,0x1d5));var _0xa4e0=function(_0x722103,_0x5732f3){_0x722103=_0x722103-0x0;var _0x3e2435=_0x4e0a[_0x722103];return _0x3e2435;};'use strict';var multer=require(_0xa4e0('0x0'));var util=require('util');var path=require(_0xa4e0('0x1'));var timeout=require(_0xa4e0('0x2'));var express=require('express');var router=express[_0xa4e0('0x3')]();var fs_extra=require(_0xa4e0('0x4'));var auth=require(_0xa4e0('0x5'));var interaction=require(_0xa4e0('0x6'));var config=require(_0xa4e0('0x7'));var controller=require(_0xa4e0('0x8'));router[_0xa4e0('0x9')]('/',auth[_0xa4e0('0xa')](),controller[_0xa4e0('0xb')]);router[_0xa4e0('0x9')]('/describe',auth[_0xa4e0('0xa')](),controller[_0xa4e0('0xc')]);router[_0xa4e0('0x9')](_0xa4e0('0xd'),auth[_0xa4e0('0xa')](),controller[_0xa4e0('0xe')]);router[_0xa4e0('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa4e0('0xd'),auth[_0xa4e0('0xa')](),controller[_0xa4e0('0x10')]);router['delete'](_0xa4e0('0xd'),auth[_0xa4e0('0xa')](),controller[_0xa4e0('0x11')]);module[_0xa4e0('0x12')]=router; \ No newline at end of file +var _0xbe10=['../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4a5f99,_0x2aaa0e){var _0x6394da=function(_0x509c8a){while(--_0x509c8a){_0x4a5f99['push'](_0x4a5f99['shift']());}};_0x6394da(++_0x2aaa0e);}(_0xbe10,0x174));var _0x0be1=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xbe10[_0x4ff09b];return _0x3f5c2e;};'use strict';var multer=require(_0x0be1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0be1('0x1'));var express=require(_0x0be1('0x2'));var router=express[_0x0be1('0x3')]();var fs_extra=require(_0x0be1('0x4'));var auth=require(_0x0be1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0be1('0x6'));var controller=require(_0x0be1('0x7'));router[_0x0be1('0x8')]('/',auth[_0x0be1('0x9')](),controller[_0x0be1('0xa')]);router[_0x0be1('0x8')](_0x0be1('0xb'),auth[_0x0be1('0x9')](),controller[_0x0be1('0xc')]);router['get'](_0x0be1('0xd'),auth[_0x0be1('0x9')](),controller['show']);router[_0x0be1('0xe')]('/',auth[_0x0be1('0x9')](),controller[_0x0be1('0xf')]);router[_0x0be1('0x10')](_0x0be1('0xd'),auth[_0x0be1('0x9')](),controller[_0x0be1('0x11')]);router[_0x0be1('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x0be1('0x13')]);module[_0x0be1('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 67a2bf1..4dc5cce 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 _0x3716=['moment','sequelize','exports','STRING','DATE'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x3716,0xbe));var _0x6371=function(_0x289891,_0x49a0fa){_0x289891=_0x289891-0x0;var _0x31cf2e=_0x3716[_0x289891];return _0x31cf2e;};'use strict';var moment=require(_0x6371('0x0'));var Sequelize=require(_0x6371('0x1'));module[_0x6371('0x2')]={'uniqueid':{'type':Sequelize[_0x6371('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x6371('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x6371('0x4')]},'acceptAt':{'type':Sequelize[_0x6371('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x6371('0x3')]}}; \ No newline at end of file +var _0x0f10=['exports','STRING','DATE','moment','sequelize'];(function(_0x431711,_0x3c6ce8){var _0x331955=function(_0x5d7092){while(--_0x5d7092){_0x431711['push'](_0x431711['shift']());}};_0x331955(++_0x3c6ce8);}(_0x0f10,0x7b));var _0x00f1=function(_0x2cce0c,_0x334752){_0x2cce0c=_0x2cce0c-0x0;var _0x34b4e2=_0x0f10[_0x2cce0c];return _0x34b4e2;};'use strict';var moment=require(_0x00f1('0x0'));var Sequelize=require(_0x00f1('0x1'));module[_0x00f1('0x2')]={'uniqueid':{'type':Sequelize[_0x00f1('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x00f1('0x3')]},'joinAt':{'type':Sequelize[_0x00f1('0x4')]},'leaveAt':{'type':Sequelize[_0x00f1('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x00f1('0x4')]},'reason':{'type':Sequelize[_0x00f1('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 8ef2f12..95808c8 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 _0xb768=['filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','keys','includeAll','catch','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','map','SmsQueueReport','rawAttributes','key','model','query'];(function(_0x486008,_0x2b2d05){var _0x2fefc7=function(_0x4177fe){while(--_0x4177fe){_0x486008['push'](_0x486008['shift']());}};_0x2fefc7(++_0x2b2d05);}(_0xb768,0xaf));var _0x8b76=function(_0x48d0f6,_0x1def0e){_0x48d0f6=_0x48d0f6-0x0;var _0x3ba238=_0xb768[_0x48d0f6];return _0x3ba238;};'use strict';var emlformat=require(_0x8b76('0x0'));var rimraf=require(_0x8b76('0x1'));var zipdir=require(_0x8b76('0x2'));var jsonpatch=require(_0x8b76('0x3'));var rp=require(_0x8b76('0x4'));var moment=require('moment');var BPromise=require(_0x8b76('0x5'));var Mustache=require(_0x8b76('0x6'));var util=require(_0x8b76('0x7'));var path=require(_0x8b76('0x8'));var sox=require(_0x8b76('0x9'));var csv=require(_0x8b76('0xa'));var ejs=require(_0x8b76('0xb'));var fs=require('fs');var fs_extra=require(_0x8b76('0xc'));var _=require(_0x8b76('0xd'));var squel=require(_0x8b76('0xe'));var crypto=require(_0x8b76('0xf'));var jsforce=require(_0x8b76('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8b76('0x11'));var Redis=require(_0x8b76('0x12'));var authService=require(_0x8b76('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8b76('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b76('0x15'))('api');var utils=require(_0x8b76('0x16'));var config=require(_0x8b76('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8b76('0x18'))['db'];function respondWithStatusCode(_0x572516,_0x30f777){_0x30f777=_0x30f777||0xcc;return function(_0xabf5fa){if(_0xabf5fa){return _0x572516[_0x8b76('0x19')](_0x30f777);}return _0x572516[_0x8b76('0x1a')](_0x30f777)['end']();};}function respondWithResult(_0xa1520d,_0xd0b1f9){_0xd0b1f9=_0xd0b1f9||0xc8;return function(_0x3e8db4){if(_0x3e8db4){return _0xa1520d[_0x8b76('0x1a')](_0xd0b1f9)[_0x8b76('0x1b')](_0x3e8db4);}};}function respondWithFilteredResult(_0x3265d3,_0x479996){return function(_0x17688e){if(_0x17688e){var _0x4aae3c=typeof _0x479996[_0x8b76('0x1c')]===_0x8b76('0x1d')&&typeof _0x479996[_0x8b76('0x1e')]===_0x8b76('0x1d');var _0x3a800d=_0x17688e[_0x8b76('0x1f')];var _0x58ecfa=_0x4aae3c?0x0:_0x479996[_0x8b76('0x1c')];var _0x52926c=_0x4aae3c?_0x17688e[_0x8b76('0x1f')]:_0x479996['offset']+_0x479996[_0x8b76('0x1e')];var _0x2dd181;if(_0x52926c>=_0x3a800d){_0x52926c=_0x3a800d;_0x2dd181=0xc8;}else{_0x2dd181=0xce;}_0x3265d3[_0x8b76('0x1a')](_0x2dd181);return _0x3265d3[_0x8b76('0x20')](_0x8b76('0x21'),_0x58ecfa+'-'+_0x52926c+'/'+_0x3a800d)[_0x8b76('0x1b')](_0x17688e);}return null;};}function patchUpdates(_0x360530){return function(_0x50c26f){try{jsonpatch[_0x8b76('0x22')](_0x50c26f,_0x360530,!![]);}catch(_0x392846){return BPromise[_0x8b76('0x23')](_0x392846);}return _0x50c26f[_0x8b76('0x24')]();};}function saveUpdates(_0x526ad0,_0x28b50c){return function(_0x54aaf6){if(_0x54aaf6){return _0x54aaf6[_0x8b76('0x25')](_0x526ad0)[_0x8b76('0x26')](function(_0x301d52){return _0x301d52;});}return null;};}function removeEntity(_0x941b69,_0x3b7c05){return function(_0x5a1bad){if(_0x5a1bad){return _0x5a1bad[_0x8b76('0x27')]()[_0x8b76('0x26')](function(){_0x941b69[_0x8b76('0x1a')](0xcc)[_0x8b76('0x28')]();});}};}function handleEntityNotFound(_0x310d8f,_0x5dd83b){return function(_0x156aac){if(!_0x156aac){_0x310d8f[_0x8b76('0x19')](0x194);}return _0x156aac;};}function handleError(_0x2b1842,_0x507a63){_0x507a63=_0x507a63||0x1f4;return function(_0x5eeb14){logger['error'](_0x5eeb14['stack']);if(_0x5eeb14['name']){delete _0x5eeb14[_0x8b76('0x29')];}_0x2b1842[_0x8b76('0x1a')](_0x507a63)[_0x8b76('0x2a')](_0x5eeb14);};}exports[_0x8b76('0x2b')]=function(_0x4d4eff,_0x20860b){var _0x2b98e8={},_0x3ff506={},_0x1b23ed={'count':0x0,'rows':[]};var _0x4a7a22=_[_0x8b76('0x2c')](db[_0x8b76('0x2d')][_0x8b76('0x2e')],function(_0x52961d){return{'name':_0x52961d['fieldName'],'type':_0x52961d['type'][_0x8b76('0x2f')]};});_0x3ff506[_0x8b76('0x30')]=_[_0x8b76('0x2c')](_0x4a7a22,_0x8b76('0x29'));_0x3ff506['query']=_['keys'](_0x4d4eff[_0x8b76('0x31')]);_0x3ff506[_0x8b76('0x32')]=_[_0x8b76('0x33')](_0x3ff506[_0x8b76('0x30')],_0x3ff506[_0x8b76('0x31')]);_0x2b98e8[_0x8b76('0x34')]=_[_0x8b76('0x33')](_0x3ff506[_0x8b76('0x30')],qs['fields'](_0x4d4eff[_0x8b76('0x31')][_0x8b76('0x35')]));_0x2b98e8[_0x8b76('0x34')]=_0x2b98e8[_0x8b76('0x34')][_0x8b76('0x36')]?_0x2b98e8[_0x8b76('0x34')]:_0x3ff506[_0x8b76('0x30')];if(!_0x4d4eff['query']['hasOwnProperty'](_0x8b76('0x37'))){_0x2b98e8[_0x8b76('0x1e')]=qs[_0x8b76('0x1e')](_0x4d4eff['query']['limit']);_0x2b98e8['offset']=qs[_0x8b76('0x1c')](_0x4d4eff['query'][_0x8b76('0x1c')]);}_0x2b98e8[_0x8b76('0x38')]=qs[_0x8b76('0x39')](_0x4d4eff[_0x8b76('0x31')][_0x8b76('0x39')]);_0x2b98e8[_0x8b76('0x3a')]=qs[_0x8b76('0x32')](_['pick'](_0x4d4eff[_0x8b76('0x31')],_0x3ff506[_0x8b76('0x32')]),_0x4a7a22);if(_0x4d4eff[_0x8b76('0x31')][_0x8b76('0x3b')]){_0x2b98e8[_0x8b76('0x3a')]=_[_0x8b76('0x3c')](_0x2b98e8['where'],{'$or':_[_0x8b76('0x2c')](_0x4a7a22,function(_0x41f1aa){if(_0x41f1aa[_0x8b76('0x3d')]!==_0x8b76('0x3e')){var _0x3be16d={};_0x3be16d[_0x41f1aa[_0x8b76('0x29')]]={'$like':'%'+_0x4d4eff[_0x8b76('0x31')]['filter']+'%'};return _0x3be16d;}})});}_0x2b98e8=_[_0x8b76('0x3c')]({},_0x2b98e8,_0x4d4eff[_0x8b76('0x3f')]);var _0x3ad6da={'where':_0x2b98e8['where']};return db[_0x8b76('0x2d')]['count'](_0x3ad6da)[_0x8b76('0x26')](function(_0x3eadc6){_0x1b23ed[_0x8b76('0x1f')]=_0x3eadc6;if(_0x4d4eff[_0x8b76('0x31')]['includeAll']){_0x2b98e8[_0x8b76('0x40')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x8b76('0x41')](_0x2b98e8);})[_0x8b76('0x26')](function(_0x505df5){_0x1b23ed[_0x8b76('0x42')]=_0x505df5;return _0x1b23ed;})[_0x8b76('0x26')](respondWithFilteredResult(_0x20860b,_0x2b98e8))['catch'](handleError(_0x20860b,null));};exports[_0x8b76('0x43')]=function(_0x4dd218,_0x128d81){var _0x437de0={'raw':!![],'where':{'id':_0x4dd218[_0x8b76('0x44')]['id']}},_0xae4320={};_0xae4320[_0x8b76('0x30')]=_[_0x8b76('0x45')](db[_0x8b76('0x2d')][_0x8b76('0x2e')]);_0xae4320[_0x8b76('0x31')]=_[_0x8b76('0x45')](_0x4dd218[_0x8b76('0x31')]);_0xae4320[_0x8b76('0x32')]=_[_0x8b76('0x33')](_0xae4320[_0x8b76('0x30')],_0xae4320['query']);_0x437de0[_0x8b76('0x34')]=_['intersection'](_0xae4320[_0x8b76('0x30')],qs['fields'](_0x4dd218[_0x8b76('0x31')][_0x8b76('0x35')]));_0x437de0[_0x8b76('0x34')]=_0x437de0[_0x8b76('0x34')]['length']?_0x437de0[_0x8b76('0x34')]:_0xae4320[_0x8b76('0x30')];if(_0x4dd218['query'][_0x8b76('0x46')]){_0x437de0[_0x8b76('0x40')]=[{'all':!![]}];}_0x437de0=_[_0x8b76('0x3c')]({},_0x437de0,_0x4dd218[_0x8b76('0x3f')]);return db[_0x8b76('0x2d')]['find'](_0x437de0)[_0x8b76('0x26')](handleEntityNotFound(_0x128d81,null))[_0x8b76('0x26')](respondWithResult(_0x128d81,null))[_0x8b76('0x47')](handleError(_0x128d81,null));};exports['create']=function(_0x37831a,_0x7e5312){return db['SmsQueueReport']['create'](_0x37831a[_0x8b76('0x48')],{})[_0x8b76('0x26')](respondWithResult(_0x7e5312,0xc9))[_0x8b76('0x47')](handleError(_0x7e5312,null));};exports[_0x8b76('0x25')]=function(_0x46ab94,_0x28b3c7){if(_0x46ab94['body']['id']){delete _0x46ab94[_0x8b76('0x48')]['id'];}return db[_0x8b76('0x2d')][_0x8b76('0x49')]({'where':{'id':_0x46ab94['params']['id']}})['then'](handleEntityNotFound(_0x28b3c7,null))[_0x8b76('0x26')](saveUpdates(_0x46ab94[_0x8b76('0x48')],null))[_0x8b76('0x26')](respondWithResult(_0x28b3c7,null))[_0x8b76('0x47')](handleError(_0x28b3c7,null));};exports[_0x8b76('0x27')]=function(_0x19d34e,_0x4b4ea7){return db['SmsQueueReport'][_0x8b76('0x49')]({'where':{'id':_0x19d34e[_0x8b76('0x44')]['id']}})[_0x8b76('0x26')](handleEntityNotFound(_0x4b4ea7,null))[_0x8b76('0x26')](removeEntity(_0x4b4ea7,null))[_0x8b76('0x47')](handleError(_0x4b4ea7,null));};exports[_0x8b76('0x4a')]=function(_0x4803c1,_0x553f75){return db[_0x8b76('0x2d')][_0x8b76('0x4a')]()[_0x8b76('0x26')](respondWithResult(_0x553f75,null))[_0x8b76('0x47')](handleError(_0x553f75,null));}; \ No newline at end of file +var _0xe8de=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filters','filter','merge','options','SmsQueueReport','include','findAll','rows','catch','params','length','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x10c4f9,_0x100fb4){var _0x522b09=function(_0x3325e4){while(--_0x3325e4){_0x10c4f9['push'](_0x10c4f9['shift']());}};_0x522b09(++_0x100fb4);}(_0xe8de,0x1f2));var _0xee8d=function(_0xa8e125,_0x447e2a){_0xa8e125=_0xa8e125-0x0;var _0x279b67=_0xe8de[_0xa8e125];return _0x279b67;};'use strict';var emlformat=require(_0xee8d('0x0'));var rimraf=require(_0xee8d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee8d('0x2'));var rp=require('request-promise');var moment=require(_0xee8d('0x3'));var BPromise=require(_0xee8d('0x4'));var Mustache=require(_0xee8d('0x5'));var util=require(_0xee8d('0x6'));var path=require(_0xee8d('0x7'));var sox=require(_0xee8d('0x8'));var csv=require('to-csv');var ejs=require(_0xee8d('0x9'));var fs=require('fs');var fs_extra=require(_0xee8d('0xa'));var _=require(_0xee8d('0xb'));var squel=require(_0xee8d('0xc'));var crypto=require(_0xee8d('0xd'));var jsforce=require(_0xee8d('0xe'));var deskjs=require(_0xee8d('0xf'));var toCsv=require(_0xee8d('0x10'));var querystring=require('querystring');var Papa=require(_0xee8d('0x11'));var Redis=require('ioredis');var authService=require(_0xee8d('0x12'));var qs=require(_0xee8d('0x13'));var as=require(_0xee8d('0x14'));var hardwareService=require(_0xee8d('0x15'));var logger=require('../../config/logger')(_0xee8d('0x16'));var utils=require(_0xee8d('0x17'));var config=require(_0xee8d('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31ce6a,_0x3c67da){_0x3c67da=_0x3c67da||0xcc;return function(_0x3fb19c){if(_0x3fb19c){return _0x31ce6a[_0xee8d('0x19')](_0x3c67da);}return _0x31ce6a[_0xee8d('0x1a')](_0x3c67da)['end']();};}function respondWithResult(_0x5c4e78,_0x235cea){_0x235cea=_0x235cea||0xc8;return function(_0xc0ec85){if(_0xc0ec85){return _0x5c4e78[_0xee8d('0x1a')](_0x235cea)[_0xee8d('0x1b')](_0xc0ec85);}};}function respondWithFilteredResult(_0x39cb8a,_0x296dd8){return function(_0x164058){if(_0x164058){var _0xf3b6d8=typeof _0x296dd8[_0xee8d('0x1c')]===_0xee8d('0x1d')&&typeof _0x296dd8['limit']==='undefined';var _0x202e90=_0x164058[_0xee8d('0x1e')];var _0x36a234=_0xf3b6d8?0x0:_0x296dd8[_0xee8d('0x1c')];var _0x437ef4=_0xf3b6d8?_0x164058['count']:_0x296dd8[_0xee8d('0x1c')]+_0x296dd8[_0xee8d('0x1f')];var _0x2ffc04;if(_0x437ef4>=_0x202e90){_0x437ef4=_0x202e90;_0x2ffc04=0xc8;}else{_0x2ffc04=0xce;}_0x39cb8a[_0xee8d('0x1a')](_0x2ffc04);return _0x39cb8a['set'](_0xee8d('0x20'),_0x36a234+'-'+_0x437ef4+'/'+_0x202e90)[_0xee8d('0x1b')](_0x164058);}return null;};}function patchUpdates(_0x352fa3){return function(_0x3907b4){try{jsonpatch[_0xee8d('0x21')](_0x3907b4,_0x352fa3,!![]);}catch(_0x46af94){return BPromise[_0xee8d('0x22')](_0x46af94);}return _0x3907b4[_0xee8d('0x23')]();};}function saveUpdates(_0x17c367,_0x28793b){return function(_0x5aed76){if(_0x5aed76){return _0x5aed76[_0xee8d('0x24')](_0x17c367)[_0xee8d('0x25')](function(_0x2da948){return _0x2da948;});}return null;};}function removeEntity(_0x17c15b,_0x59bfa6){return function(_0x310c93){if(_0x310c93){return _0x310c93[_0xee8d('0x26')]()[_0xee8d('0x25')](function(){_0x17c15b[_0xee8d('0x1a')](0xcc)[_0xee8d('0x27')]();});}};}function handleEntityNotFound(_0x20d04c,_0x73cafc){return function(_0x18d951){if(!_0x18d951){_0x20d04c[_0xee8d('0x19')](0x194);}return _0x18d951;};}function handleError(_0x512afd,_0x35fa67){_0x35fa67=_0x35fa67||0x1f4;return function(_0x1fb826){logger[_0xee8d('0x28')](_0x1fb826['stack']);if(_0x1fb826[_0xee8d('0x29')]){delete _0x1fb826['name'];}_0x512afd[_0xee8d('0x1a')](_0x35fa67)[_0xee8d('0x2a')](_0x1fb826);};}exports[_0xee8d('0x2b')]=function(_0x448bea,_0x3977e2){var _0x39de55={},_0x1183c3={},_0x28cc99={'count':0x0,'rows':[]};var _0x1ff79a=_[_0xee8d('0x2c')](db['SmsQueueReport'][_0xee8d('0x2d')],function(_0xf9dfef){return{'name':_0xf9dfef[_0xee8d('0x2e')],'type':_0xf9dfef[_0xee8d('0x2f')]['key']};});_0x1183c3[_0xee8d('0x30')]=_[_0xee8d('0x2c')](_0x1ff79a,'name');_0x1183c3['query']=_[_0xee8d('0x31')](_0x448bea[_0xee8d('0x32')]);_0x1183c3['filters']=_['intersection'](_0x1183c3[_0xee8d('0x30')],_0x1183c3[_0xee8d('0x32')]);_0x39de55[_0xee8d('0x33')]=_[_0xee8d('0x34')](_0x1183c3[_0xee8d('0x30')],qs[_0xee8d('0x35')](_0x448bea['query'][_0xee8d('0x35')]));_0x39de55[_0xee8d('0x33')]=_0x39de55[_0xee8d('0x33')]['length']?_0x39de55[_0xee8d('0x33')]:_0x1183c3[_0xee8d('0x30')];if(!_0x448bea[_0xee8d('0x32')][_0xee8d('0x36')]('nolimit')){_0x39de55[_0xee8d('0x1f')]=qs['limit'](_0x448bea[_0xee8d('0x32')][_0xee8d('0x1f')]);_0x39de55[_0xee8d('0x1c')]=qs['offset'](_0x448bea['query'][_0xee8d('0x1c')]);}_0x39de55['order']=qs[_0xee8d('0x37')](_0x448bea[_0xee8d('0x32')][_0xee8d('0x37')]);_0x39de55[_0xee8d('0x38')]=qs['filters'](_[_0xee8d('0x39')](_0x448bea[_0xee8d('0x32')],_0x1183c3[_0xee8d('0x3a')]),_0x1ff79a);if(_0x448bea['query'][_0xee8d('0x3b')]){_0x39de55[_0xee8d('0x38')]=_[_0xee8d('0x3c')](_0x39de55['where'],{'$or':_[_0xee8d('0x2c')](_0x1ff79a,function(_0x11eb31){if(_0x11eb31[_0xee8d('0x2f')]!=='VIRTUAL'){var _0x2ed678={};_0x2ed678[_0x11eb31[_0xee8d('0x29')]]={'$like':'%'+_0x448bea[_0xee8d('0x32')][_0xee8d('0x3b')]+'%'};return _0x2ed678;}})});}_0x39de55=_[_0xee8d('0x3c')]({},_0x39de55,_0x448bea[_0xee8d('0x3d')]);var _0x6e78ea={'where':_0x39de55[_0xee8d('0x38')]};return db[_0xee8d('0x3e')]['count'](_0x6e78ea)['then'](function(_0x58d320){_0x28cc99['count']=_0x58d320;if(_0x448bea[_0xee8d('0x32')]['includeAll']){_0x39de55[_0xee8d('0x3f')]=[{'all':!![]}];}return db[_0xee8d('0x3e')][_0xee8d('0x40')](_0x39de55);})[_0xee8d('0x25')](function(_0x4f431d){_0x28cc99[_0xee8d('0x41')]=_0x4f431d;return _0x28cc99;})[_0xee8d('0x25')](respondWithFilteredResult(_0x3977e2,_0x39de55))[_0xee8d('0x42')](handleError(_0x3977e2,null));};exports['show']=function(_0x5c0731,_0x14f50c){var _0xc9081={'raw':!![],'where':{'id':_0x5c0731[_0xee8d('0x43')]['id']}},_0x4a4e1a={};_0x4a4e1a['model']=_[_0xee8d('0x31')](db['SmsQueueReport'][_0xee8d('0x2d')]);_0x4a4e1a['query']=_[_0xee8d('0x31')](_0x5c0731[_0xee8d('0x32')]);_0x4a4e1a['filters']=_[_0xee8d('0x34')](_0x4a4e1a[_0xee8d('0x30')],_0x4a4e1a['query']);_0xc9081[_0xee8d('0x33')]=_[_0xee8d('0x34')](_0x4a4e1a[_0xee8d('0x30')],qs[_0xee8d('0x35')](_0x5c0731[_0xee8d('0x32')]['fields']));_0xc9081[_0xee8d('0x33')]=_0xc9081['attributes'][_0xee8d('0x44')]?_0xc9081[_0xee8d('0x33')]:_0x4a4e1a['model'];if(_0x5c0731[_0xee8d('0x32')][_0xee8d('0x45')]){_0xc9081[_0xee8d('0x3f')]=[{'all':!![]}];}_0xc9081=_[_0xee8d('0x3c')]({},_0xc9081,_0x5c0731['options']);return db[_0xee8d('0x3e')][_0xee8d('0x46')](_0xc9081)[_0xee8d('0x25')](handleEntityNotFound(_0x14f50c,null))[_0xee8d('0x25')](respondWithResult(_0x14f50c,null))[_0xee8d('0x42')](handleError(_0x14f50c,null));};exports[_0xee8d('0x47')]=function(_0x6b4927,_0x4e3039){return db[_0xee8d('0x3e')][_0xee8d('0x47')](_0x6b4927[_0xee8d('0x48')],{})['then'](respondWithResult(_0x4e3039,0xc9))[_0xee8d('0x42')](handleError(_0x4e3039,null));};exports[_0xee8d('0x24')]=function(_0x54a730,_0x940b76){if(_0x54a730[_0xee8d('0x48')]['id']){delete _0x54a730[_0xee8d('0x48')]['id'];}return db[_0xee8d('0x3e')]['find']({'where':{'id':_0x54a730['params']['id']}})[_0xee8d('0x25')](handleEntityNotFound(_0x940b76,null))['then'](saveUpdates(_0x54a730[_0xee8d('0x48')],null))['then'](respondWithResult(_0x940b76,null))[_0xee8d('0x42')](handleError(_0x940b76,null));};exports[_0xee8d('0x26')]=function(_0x5ceb86,_0x1f014d){return db[_0xee8d('0x3e')][_0xee8d('0x46')]({'where':{'id':_0x5ceb86[_0xee8d('0x43')]['id']}})[_0xee8d('0x25')](handleEntityNotFound(_0x1f014d,null))['then'](removeEntity(_0x1f014d,null))[_0xee8d('0x42')](handleError(_0x1f014d,null));};exports[_0xee8d('0x49')]=function(_0x1af27d,_0x5d8d73){return db[_0xee8d('0x3e')][_0xee8d('0x49')]()[_0xee8d('0x25')](respondWithResult(_0x5d8d73,null))[_0xee8d('0x42')](handleError(_0x5d8d73,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 7cd831e..bb1657c 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 _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 7fe9f51..3ce8eef 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 _0x8a2d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','raw','catch','UpdateSmsQueueReport','update','options','where','attributes','limit','lodash','moment','bluebird','randomstring'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x8a2d,0x1d8));var _0xd8a2=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x8a2d[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0xd8a2('0x0'));var util=require('util');var moment=require(_0xd8a2('0x1'));var BPromise=require(_0xd8a2('0x2'));var rs=require(_0xd8a2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd8a2('0x4'))(_0xd8a2('0x5'));var config=require(_0xd8a2('0x6'));var jayson=require(_0xd8a2('0x7'));var client=jayson[_0xd8a2('0x8')][_0xd8a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e82d6,_0x9cf768,_0x26123a){return new BPromise(function(_0x5a4234,_0x5edebd){return client[_0xd8a2('0xa')](_0x4e82d6,_0x26123a)[_0xd8a2('0xb')](function(_0x2b961e){logger[_0xd8a2('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x9cf768,_0xd8a2('0xd'));logger[_0xd8a2('0xe')](_0xd8a2('0xf'),_0x9cf768,_0xd8a2('0xd'),JSON[_0xd8a2('0x10')](_0x2b961e));if(_0x2b961e['error']){if(_0x2b961e[_0xd8a2('0x11')][_0xd8a2('0x12')]===0x1f4){logger['error'](_0xd8a2('0x13'),_0x9cf768,_0x2b961e[_0xd8a2('0x11')][_0xd8a2('0x14')]);return _0x5edebd(_0x2b961e[_0xd8a2('0x11')]['message']);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x9cf768,_0x2b961e['error'][_0xd8a2('0x14')]);return _0x5a4234(_0x2b961e[_0xd8a2('0x11')][_0xd8a2('0x14')]);}else{logger['info'](_0xd8a2('0x13'),_0x9cf768,_0xd8a2('0xd'));_0x5a4234(_0x2b961e[_0xd8a2('0x15')][_0xd8a2('0x14')]);}})['catch'](function(_0x792a7d){logger[_0xd8a2('0x11')](_0xd8a2('0x13'),_0x9cf768,_0x792a7d);_0x5edebd(_0x792a7d);});});}exports[_0xd8a2('0x16')]=function(_0x4d3276){var _0x27d756=this;return new Promise(function(_0x5a85b7,_0x2e2353){return db[_0xd8a2('0x17')][_0xd8a2('0x18')](_0x4d3276[_0xd8a2('0x19')],{'raw':_0x4d3276['options']?_0x4d3276['options'][_0xd8a2('0x1a')]===undefined?!![]:![]:!![]})[_0xd8a2('0xb')](function(_0x28f896){logger[_0xd8a2('0xc')]('CreateSmsQueueReport',_0x4d3276);logger['debug']('CreateSmsQueueReport',_0x4d3276,JSON['stringify'](_0x28f896));_0x5a85b7(_0x28f896);})[_0xd8a2('0x1b')](function(_0x682257){logger[_0xd8a2('0x11')](_0xd8a2('0x16'),_0x682257['message'],_0x4d3276);_0x2e2353(_0x27d756[_0xd8a2('0x11')](0x1f4,_0x682257[_0xd8a2('0x14')]));});});};exports[_0xd8a2('0x1c')]=function(_0x2a97a3){var _0x5b437f=this;return new Promise(function(_0x3574d4,_0x2a6896){return db['SmsQueueReport'][_0xd8a2('0x1d')](_0x2a97a3[_0xd8a2('0x19')],{'raw':_0x2a97a3[_0xd8a2('0x1e')]?_0x2a97a3[_0xd8a2('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a97a3[_0xd8a2('0x1e')]?_0x2a97a3[_0xd8a2('0x1e')][_0xd8a2('0x1f')]||null:null,'attributes':_0x2a97a3[_0xd8a2('0x1e')]?_0x2a97a3[_0xd8a2('0x1e')][_0xd8a2('0x20')]||null:null,'limit':_0x2a97a3['options']?_0x2a97a3[_0xd8a2('0x1e')][_0xd8a2('0x21')]||null:null})[_0xd8a2('0xb')](function(_0xe04669){logger['info'](_0xd8a2('0x1c'),_0x2a97a3);logger[_0xd8a2('0xe')](_0xd8a2('0x1c'),_0x2a97a3,JSON[_0xd8a2('0x10')](_0xe04669));_0x3574d4(_0xe04669);})[_0xd8a2('0x1b')](function(_0x51ff59){logger[_0xd8a2('0x11')](_0xd8a2('0x1c'),_0x51ff59[_0xd8a2('0x14')],_0x2a97a3);_0x2a6896(_0x5b437f['error'](0x1f4,_0x51ff59[_0xd8a2('0x14')]));});});}; \ No newline at end of file +var _0x836a=['raw','UpdateSmsQueueReport','SmsQueueReport','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','body','options'];(function(_0x4f86ce,_0x41ff07){var _0x3159a8=function(_0x358426){while(--_0x358426){_0x4f86ce['push'](_0x4f86ce['shift']());}};_0x3159a8(++_0x41ff07);}(_0x836a,0xcc));var _0xa836=function(_0x3c3a03,_0x3c0da1){_0x3c3a03=_0x3c3a03-0x0;var _0x57ff53=_0x836a[_0x3c3a03];return _0x57ff53;};'use strict';var _=require('lodash');var util=require(_0xa836('0x0'));var moment=require(_0xa836('0x1'));var BPromise=require(_0xa836('0x2'));var rs=require(_0xa836('0x3'));var fs=require('fs');var Redis=require(_0xa836('0x4'));var db=require(_0xa836('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa836('0x6'))(_0xa836('0x7'));var config=require('../../config/environment');var jayson=require(_0xa836('0x8'));var client=jayson[_0xa836('0x9')][_0xa836('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f618f,_0x7e031d,_0x55a66b){return new BPromise(function(_0x3945e6,_0x7de976){return client[_0xa836('0xb')](_0x2f618f,_0x55a66b)[_0xa836('0xc')](function(_0x2c228b){logger[_0xa836('0xd')](_0xa836('0xe'),_0x7e031d,_0xa836('0xf'));logger[_0xa836('0x10')](_0xa836('0x11'),_0x7e031d,'request\x20sent',JSON[_0xa836('0x12')](_0x2c228b));if(_0x2c228b[_0xa836('0x13')]){if(_0x2c228b['error'][_0xa836('0x14')]===0x1f4){logger[_0xa836('0x13')](_0xa836('0xe'),_0x7e031d,_0x2c228b[_0xa836('0x13')][_0xa836('0x15')]);return _0x7de976(_0x2c228b['error'][_0xa836('0x15')]);}logger['error'](_0xa836('0xe'),_0x7e031d,_0x2c228b['error'][_0xa836('0x15')]);return _0x3945e6(_0x2c228b[_0xa836('0x13')]['message']);}else{logger[_0xa836('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x7e031d,'request\x20sent');_0x3945e6(_0x2c228b[_0xa836('0x16')][_0xa836('0x15')]);}})[_0xa836('0x17')](function(_0x903c64){logger[_0xa836('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x7e031d,_0x903c64);_0x7de976(_0x903c64);});});}exports[_0xa836('0x18')]=function(_0x542305){var _0x4fd0c3=this;return new Promise(function(_0x1b6c10,_0x4099a1){return db['SmsQueueReport']['create'](_0x542305[_0xa836('0x19')],{'raw':_0x542305[_0xa836('0x1a')]?_0x542305[_0xa836('0x1a')][_0xa836('0x1b')]===undefined?!![]:![]:!![]})[_0xa836('0xc')](function(_0x374e81){logger[_0xa836('0xd')]('CreateSmsQueueReport',_0x542305);logger[_0xa836('0x10')](_0xa836('0x18'),_0x542305,JSON[_0xa836('0x12')](_0x374e81));_0x1b6c10(_0x374e81);})[_0xa836('0x17')](function(_0x7b4607){logger[_0xa836('0x13')]('CreateSmsQueueReport',_0x7b4607[_0xa836('0x15')],_0x542305);_0x4099a1(_0x4fd0c3['error'](0x1f4,_0x7b4607[_0xa836('0x15')]));});});};exports[_0xa836('0x1c')]=function(_0x24e641){var _0x59fec1=this;return new Promise(function(_0x5dc752,_0x3b6f7e){return db[_0xa836('0x1d')]['update'](_0x24e641['body'],{'raw':_0x24e641[_0xa836('0x1a')]?_0x24e641[_0xa836('0x1a')][_0xa836('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24e641[_0xa836('0x1a')]?_0x24e641['options'][_0xa836('0x1e')]||null:null,'attributes':_0x24e641[_0xa836('0x1a')]?_0x24e641[_0xa836('0x1a')][_0xa836('0x1f')]||null:null,'limit':_0x24e641['options']?_0x24e641[_0xa836('0x1a')][_0xa836('0x20')]||null:null})['then'](function(_0x594a5f){logger[_0xa836('0xd')](_0xa836('0x1c'),_0x24e641);logger[_0xa836('0x10')]('UpdateSmsQueueReport',_0x24e641,JSON[_0xa836('0x12')](_0x594a5f));_0x5dc752(_0x594a5f);})[_0xa836('0x17')](function(_0xacbbdf){logger[_0xa836('0x13')]('UpdateSmsQueueReport',_0xacbbdf[_0xa836('0x15')],_0x24e641);_0x3b6f7e(_0x59fec1[_0xa836('0x13')](0x1f4,_0xacbbdf['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index db3a98a..643026b 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 _0x1670=['create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x412f44,_0x2b7567){var _0x566e9a=function(_0x1a8321){while(--_0x1a8321){_0x412f44['push'](_0x412f44['shift']());}};_0x566e9a(++_0x2b7567);}(_0x1670,0x9a));var _0x0167=function(_0x380bd6,_0x15dff9){_0x380bd6=_0x380bd6-0x0;var _0x4b8d66=_0x1670[_0x380bd6];return _0x4b8d66;};'use strict';var multer=require(_0x0167('0x0'));var util=require(_0x0167('0x1'));var path=require('path');var timeout=require(_0x0167('0x2'));var express=require('express');var router=express[_0x0167('0x3')]();var fs_extra=require(_0x0167('0x4'));var auth=require(_0x0167('0x5'));var interaction=require(_0x0167('0x6'));var config=require('../../config/environment');var controller=require('./smsTransferReport.controller');router[_0x0167('0x7')]('/',auth[_0x0167('0x8')](),controller[_0x0167('0x9')]);router[_0x0167('0x7')](_0x0167('0xa'),auth[_0x0167('0x8')](),controller[_0x0167('0xb')]);router[_0x0167('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x0167('0xc')]);router[_0x0167('0xd')]('/',auth[_0x0167('0x8')](),controller[_0x0167('0xe')]);router[_0x0167('0xf')](_0x0167('0x10'),auth[_0x0167('0x8')](),controller[_0x0167('0x11')]);router[_0x0167('0x12')](_0x0167('0x10'),auth[_0x0167('0x8')](),controller[_0x0167('0x13')]);module[_0x0167('0x14')]=router; \ No newline at end of file +var _0x08d9=['fs-extra','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','multer','path','express','Router'];(function(_0x1e4d16,_0x41537e){var _0x221bee=function(_0x1ac2b2){while(--_0x1ac2b2){_0x1e4d16['push'](_0x1e4d16['shift']());}};_0x221bee(++_0x41537e);}(_0x08d9,0xc2));var _0x908d=function(_0x5db010,_0x5f7adc){_0x5db010=_0x5db010-0x0;var _0x505c87=_0x08d9[_0x5db010];return _0x505c87;};'use strict';var multer=require(_0x908d('0x0'));var util=require('util');var path=require(_0x908d('0x1'));var timeout=require('connect-timeout');var express=require(_0x908d('0x2'));var router=express[_0x908d('0x3')]();var fs_extra=require(_0x908d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x908d('0x5'));var controller=require(_0x908d('0x6'));router[_0x908d('0x7')]('/',auth[_0x908d('0x8')](),controller[_0x908d('0x9')]);router['get'](_0x908d('0xa'),auth[_0x908d('0x8')](),controller[_0x908d('0xb')]);router[_0x908d('0x7')](_0x908d('0xc'),auth[_0x908d('0x8')](),controller[_0x908d('0xd')]);router[_0x908d('0xe')]('/',auth[_0x908d('0x8')](),controller[_0x908d('0xf')]);router['put'](_0x908d('0xc'),auth[_0x908d('0x8')](),controller[_0x908d('0x10')]);router[_0x908d('0x11')](_0x908d('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 9b4da6e..1b412e6 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x383521,_0x5e87de){var _0x3310de=function(_0x1eec35){while(--_0x1eec35){_0x383521['push'](_0x383521['shift']());}};_0x3310de(++_0x5e87de);}(_0x4b84,0x1cc));var _0x44b8=function(_0x39fd11,_0x5d7883){_0x39fd11=_0x39fd11-0x0;var _0x302799=_0x4b84[_0x39fd11];return _0x302799;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0xb5179e,_0x67e31d){var _0x423511=function(_0x408d13){while(--_0x408d13){_0xb5179e['push'](_0xb5179e['shift']());}};_0x423511(++_0x67e31d);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 4790fe8..74ee68d 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 _0xcd36=['SmsTransferReport','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','show','params','keys','rawAttributes','options','find','create','body','catch','describe','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xcd36,0xba));var _0x6cd3=function(_0x4bdc01,_0x470950){_0x4bdc01=_0x4bdc01-0x0;var _0x4f7ea1=_0xcd36[_0x4bdc01];return _0x4f7ea1;};'use strict';var emlformat=require(_0x6cd3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6cd3('0x1'));var rp=require(_0x6cd3('0x2'));var moment=require('moment');var BPromise=require(_0x6cd3('0x3'));var Mustache=require(_0x6cd3('0x4'));var util=require('util');var path=require(_0x6cd3('0x5'));var sox=require(_0x6cd3('0x6'));var csv=require(_0x6cd3('0x7'));var ejs=require(_0x6cd3('0x8'));var fs=require('fs');var fs_extra=require(_0x6cd3('0x9'));var _=require(_0x6cd3('0xa'));var squel=require('squel');var crypto=require(_0x6cd3('0xb'));var jsforce=require(_0x6cd3('0xc'));var deskjs=require(_0x6cd3('0xd'));var toCsv=require(_0x6cd3('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6cd3('0xe'));var authService=require(_0x6cd3('0xf'));var qs=require(_0x6cd3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cd3('0x11'));var logger=require(_0x6cd3('0x12'))(_0x6cd3('0x13'));var utils=require(_0x6cd3('0x14'));var config=require(_0x6cd3('0x15'));var licenseUtil=require(_0x6cd3('0x16'));var db=require(_0x6cd3('0x17'))['db'];function respondWithStatusCode(_0x5c1769,_0x10950e){_0x10950e=_0x10950e||0xcc;return function(_0x401331){if(_0x401331){return _0x5c1769[_0x6cd3('0x18')](_0x10950e);}return _0x5c1769[_0x6cd3('0x19')](_0x10950e)['end']();};}function respondWithResult(_0x37973b,_0x4ee386){_0x4ee386=_0x4ee386||0xc8;return function(_0xd7e636){if(_0xd7e636){return _0x37973b['status'](_0x4ee386)[_0x6cd3('0x1a')](_0xd7e636);}};}function respondWithFilteredResult(_0x57ea95,_0x7fde69){return function(_0x26e642){if(_0x26e642){var _0x322d3b=typeof _0x7fde69[_0x6cd3('0x1b')]==='undefined'&&typeof _0x7fde69['limit']===_0x6cd3('0x1c');var _0x50f9cc=_0x26e642[_0x6cd3('0x1d')];var _0x105716=_0x322d3b?0x0:_0x7fde69[_0x6cd3('0x1b')];var _0x5e46fe=_0x322d3b?_0x26e642[_0x6cd3('0x1d')]:_0x7fde69[_0x6cd3('0x1b')]+_0x7fde69['limit'];var _0x3bc7c4;if(_0x5e46fe>=_0x50f9cc){_0x5e46fe=_0x50f9cc;_0x3bc7c4=0xc8;}else{_0x3bc7c4=0xce;}_0x57ea95[_0x6cd3('0x19')](_0x3bc7c4);return _0x57ea95[_0x6cd3('0x1e')](_0x6cd3('0x1f'),_0x105716+'-'+_0x5e46fe+'/'+_0x50f9cc)[_0x6cd3('0x1a')](_0x26e642);}return null;};}function patchUpdates(_0x5ba22a){return function(_0x639cc9){try{jsonpatch[_0x6cd3('0x20')](_0x639cc9,_0x5ba22a,!![]);}catch(_0x2eef51){return BPromise['reject'](_0x2eef51);}return _0x639cc9[_0x6cd3('0x21')]();};}function saveUpdates(_0x1a27eb,_0x583ebf){return function(_0x5303f8){if(_0x5303f8){return _0x5303f8[_0x6cd3('0x22')](_0x1a27eb)[_0x6cd3('0x23')](function(_0xcb79d){return _0xcb79d;});}return null;};}function removeEntity(_0x2c8a0f,_0x238a6b){return function(_0x4580e0){if(_0x4580e0){return _0x4580e0[_0x6cd3('0x24')]()['then'](function(){_0x2c8a0f[_0x6cd3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22f615,_0x19e158){return function(_0x5c48aa){if(!_0x5c48aa){_0x22f615['sendStatus'](0x194);}return _0x5c48aa;};}function handleError(_0x510df5,_0x2c2621){_0x2c2621=_0x2c2621||0x1f4;return function(_0x31af02){logger[_0x6cd3('0x25')](_0x31af02[_0x6cd3('0x26')]);if(_0x31af02[_0x6cd3('0x27')]){delete _0x31af02[_0x6cd3('0x27')];}_0x510df5[_0x6cd3('0x19')](_0x2c2621)[_0x6cd3('0x28')](_0x31af02);};}exports[_0x6cd3('0x29')]=function(_0x116ffb,_0x161550){var _0x3e2837={},_0x234ad5={},_0x7792f9={'count':0x0,'rows':[]};var _0x534562=_['map'](db[_0x6cd3('0x2a')]['rawAttributes'],function(_0x270f02){return{'name':_0x270f02['fieldName'],'type':_0x270f02[_0x6cd3('0x2b')][_0x6cd3('0x2c')]};});_0x234ad5[_0x6cd3('0x2d')]=_[_0x6cd3('0x2e')](_0x534562,'name');_0x234ad5[_0x6cd3('0x2f')]=_['keys'](_0x116ffb[_0x6cd3('0x2f')]);_0x234ad5[_0x6cd3('0x30')]=_['intersection'](_0x234ad5[_0x6cd3('0x2d')],_0x234ad5['query']);_0x3e2837['attributes']=_[_0x6cd3('0x31')](_0x234ad5['model'],qs[_0x6cd3('0x32')](_0x116ffb[_0x6cd3('0x2f')][_0x6cd3('0x32')]));_0x3e2837[_0x6cd3('0x33')]=_0x3e2837['attributes'][_0x6cd3('0x34')]?_0x3e2837[_0x6cd3('0x33')]:_0x234ad5[_0x6cd3('0x2d')];if(!_0x116ffb[_0x6cd3('0x2f')][_0x6cd3('0x35')](_0x6cd3('0x36'))){_0x3e2837['limit']=qs['limit'](_0x116ffb['query'][_0x6cd3('0x37')]);_0x3e2837[_0x6cd3('0x1b')]=qs[_0x6cd3('0x1b')](_0x116ffb[_0x6cd3('0x2f')]['offset']);}_0x3e2837[_0x6cd3('0x38')]=qs[_0x6cd3('0x39')](_0x116ffb['query'][_0x6cd3('0x39')]);_0x3e2837[_0x6cd3('0x3a')]=qs[_0x6cd3('0x30')](_[_0x6cd3('0x3b')](_0x116ffb[_0x6cd3('0x2f')],_0x234ad5[_0x6cd3('0x30')]),_0x534562);if(_0x116ffb[_0x6cd3('0x2f')][_0x6cd3('0x3c')]){_0x3e2837['where']=_['merge'](_0x3e2837['where'],{'$or':_[_0x6cd3('0x2e')](_0x534562,function(_0x2d059a){if(_0x2d059a['type']!==_0x6cd3('0x3d')){var _0x51f0f0={};_0x51f0f0[_0x2d059a[_0x6cd3('0x27')]]={'$like':'%'+_0x116ffb['query'][_0x6cd3('0x3c')]+'%'};return _0x51f0f0;}})});}_0x3e2837=_[_0x6cd3('0x3e')]({},_0x3e2837,_0x116ffb['options']);var _0x379aa4={'where':_0x3e2837['where']};return db[_0x6cd3('0x2a')][_0x6cd3('0x1d')](_0x379aa4)['then'](function(_0x3952e3){_0x7792f9[_0x6cd3('0x1d')]=_0x3952e3;if(_0x116ffb['query'][_0x6cd3('0x3f')]){_0x3e2837[_0x6cd3('0x40')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x6cd3('0x41')](_0x3e2837);})[_0x6cd3('0x23')](function(_0x28bba1){_0x7792f9['rows']=_0x28bba1;return _0x7792f9;})['then'](respondWithFilteredResult(_0x161550,_0x3e2837))['catch'](handleError(_0x161550,null));};exports[_0x6cd3('0x42')]=function(_0x269aec,_0x26c346){var _0xad650={'raw':!![],'where':{'id':_0x269aec[_0x6cd3('0x43')]['id']}},_0x4d25f9={};_0x4d25f9[_0x6cd3('0x2d')]=_[_0x6cd3('0x44')](db[_0x6cd3('0x2a')][_0x6cd3('0x45')]);_0x4d25f9[_0x6cd3('0x2f')]=_['keys'](_0x269aec['query']);_0x4d25f9[_0x6cd3('0x30')]=_[_0x6cd3('0x31')](_0x4d25f9['model'],_0x4d25f9[_0x6cd3('0x2f')]);_0xad650['attributes']=_[_0x6cd3('0x31')](_0x4d25f9[_0x6cd3('0x2d')],qs[_0x6cd3('0x32')](_0x269aec[_0x6cd3('0x2f')][_0x6cd3('0x32')]));_0xad650[_0x6cd3('0x33')]=_0xad650['attributes'][_0x6cd3('0x34')]?_0xad650[_0x6cd3('0x33')]:_0x4d25f9[_0x6cd3('0x2d')];if(_0x269aec['query'][_0x6cd3('0x3f')]){_0xad650[_0x6cd3('0x40')]=[{'all':!![]}];}_0xad650=_['merge']({},_0xad650,_0x269aec[_0x6cd3('0x46')]);return db[_0x6cd3('0x2a')][_0x6cd3('0x47')](_0xad650)[_0x6cd3('0x23')](handleEntityNotFound(_0x26c346,null))[_0x6cd3('0x23')](respondWithResult(_0x26c346,null))['catch'](handleError(_0x26c346,null));};exports['create']=function(_0x433195,_0x308bc4){return db['SmsTransferReport'][_0x6cd3('0x48')](_0x433195[_0x6cd3('0x49')],{})[_0x6cd3('0x23')](respondWithResult(_0x308bc4,0xc9))[_0x6cd3('0x4a')](handleError(_0x308bc4,null));};exports[_0x6cd3('0x22')]=function(_0x3e71a0,_0x97e576){if(_0x3e71a0[_0x6cd3('0x49')]['id']){delete _0x3e71a0[_0x6cd3('0x49')]['id'];}return db[_0x6cd3('0x2a')][_0x6cd3('0x47')]({'where':{'id':_0x3e71a0[_0x6cd3('0x43')]['id']}})[_0x6cd3('0x23')](handleEntityNotFound(_0x97e576,null))[_0x6cd3('0x23')](saveUpdates(_0x3e71a0['body'],null))['then'](respondWithResult(_0x97e576,null))[_0x6cd3('0x4a')](handleError(_0x97e576,null));};exports[_0x6cd3('0x24')]=function(_0x3d6e07,_0x53e807){return db[_0x6cd3('0x2a')][_0x6cd3('0x47')]({'where':{'id':_0x3d6e07[_0x6cd3('0x43')]['id']}})['then'](handleEntityNotFound(_0x53e807,null))[_0x6cd3('0x23')](removeEntity(_0x53e807,null))['catch'](handleError(_0x53e807,null));};exports[_0x6cd3('0x4b')]=function(_0x1fc4d3,_0x35e511){return db['SmsTransferReport'][_0x6cd3('0x4b')]()[_0x6cd3('0x23')](respondWithResult(_0x35e511,null))[_0x6cd3('0x4a')](handleError(_0x35e511,null));}; \ No newline at end of file +var _0x1abc=['rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','length','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','SmsTransferReport'];(function(_0x2c062f,_0xc90b9){var _0x202e72=function(_0x397f6f){while(--_0x397f6f){_0x2c062f['push'](_0x2c062f['shift']());}};_0x202e72(++_0xc90b9);}(_0x1abc,0xbd));var _0xc1ab=function(_0x330c71,_0x290139){_0x330c71=_0x330c71-0x0;var _0x1f5916=_0x1abc[_0x330c71];return _0x1f5916;};'use strict';var emlformat=require(_0xc1ab('0x0'));var rimraf=require(_0xc1ab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc1ab('0x2'));var rp=require(_0xc1ab('0x3'));var moment=require('moment');var BPromise=require(_0xc1ab('0x4'));var Mustache=require('mustache');var util=require(_0xc1ab('0x5'));var path=require(_0xc1ab('0x6'));var sox=require(_0xc1ab('0x7'));var csv=require(_0xc1ab('0x8'));var ejs=require(_0xc1ab('0x9'));var fs=require('fs');var fs_extra=require(_0xc1ab('0xa'));var _=require(_0xc1ab('0xb'));var squel=require(_0xc1ab('0xc'));var crypto=require(_0xc1ab('0xd'));var jsforce=require(_0xc1ab('0xe'));var deskjs=require(_0xc1ab('0xf'));var toCsv=require(_0xc1ab('0x8'));var querystring=require(_0xc1ab('0x10'));var Papa=require(_0xc1ab('0x11'));var Redis=require('ioredis');var authService=require(_0xc1ab('0x12'));var qs=require(_0xc1ab('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1ab('0x14'));var logger=require(_0xc1ab('0x15'))(_0xc1ab('0x16'));var utils=require(_0xc1ab('0x17'));var config=require(_0xc1ab('0x18'));var licenseUtil=require(_0xc1ab('0x19'));var db=require(_0xc1ab('0x1a'))['db'];function respondWithStatusCode(_0x25ad4f,_0x47f334){_0x47f334=_0x47f334||0xcc;return function(_0x1b323a){if(_0x1b323a){return _0x25ad4f['sendStatus'](_0x47f334);}return _0x25ad4f[_0xc1ab('0x1b')](_0x47f334)[_0xc1ab('0x1c')]();};}function respondWithResult(_0xe9688a,_0x58e5f5){_0x58e5f5=_0x58e5f5||0xc8;return function(_0x10c4b7){if(_0x10c4b7){return _0xe9688a['status'](_0x58e5f5)[_0xc1ab('0x1d')](_0x10c4b7);}};}function respondWithFilteredResult(_0xaf73d1,_0x1e1de9){return function(_0x1ea58f){if(_0x1ea58f){var _0x1cd3c1=typeof _0x1e1de9[_0xc1ab('0x1e')]===_0xc1ab('0x1f')&&typeof _0x1e1de9['limit']===_0xc1ab('0x1f');var _0x4f06b9=_0x1ea58f[_0xc1ab('0x20')];var _0x32e392=_0x1cd3c1?0x0:_0x1e1de9[_0xc1ab('0x1e')];var _0xafd703=_0x1cd3c1?_0x1ea58f[_0xc1ab('0x20')]:_0x1e1de9[_0xc1ab('0x1e')]+_0x1e1de9[_0xc1ab('0x21')];var _0x1be86f;if(_0xafd703>=_0x4f06b9){_0xafd703=_0x4f06b9;_0x1be86f=0xc8;}else{_0x1be86f=0xce;}_0xaf73d1[_0xc1ab('0x1b')](_0x1be86f);return _0xaf73d1[_0xc1ab('0x22')](_0xc1ab('0x23'),_0x32e392+'-'+_0xafd703+'/'+_0x4f06b9)[_0xc1ab('0x1d')](_0x1ea58f);}return null;};}function patchUpdates(_0x4d34f3){return function(_0x39f85b){try{jsonpatch[_0xc1ab('0x24')](_0x39f85b,_0x4d34f3,!![]);}catch(_0x38acee){return BPromise['reject'](_0x38acee);}return _0x39f85b[_0xc1ab('0x25')]();};}function saveUpdates(_0x26a68c,_0x55bc27){return function(_0x343f17){if(_0x343f17){return _0x343f17[_0xc1ab('0x26')](_0x26a68c)[_0xc1ab('0x27')](function(_0x30e216){return _0x30e216;});}return null;};}function removeEntity(_0x3509fe,_0x479e52){return function(_0x1065b3){if(_0x1065b3){return _0x1065b3[_0xc1ab('0x28')]()['then'](function(){_0x3509fe['status'](0xcc)[_0xc1ab('0x1c')]();});}};}function handleEntityNotFound(_0xa82345,_0x480b57){return function(_0x305e36){if(!_0x305e36){_0xa82345[_0xc1ab('0x29')](0x194);}return _0x305e36;};}function handleError(_0xecd7f4,_0x62c4a3){_0x62c4a3=_0x62c4a3||0x1f4;return function(_0x2495c6){logger[_0xc1ab('0x2a')](_0x2495c6[_0xc1ab('0x2b')]);if(_0x2495c6[_0xc1ab('0x2c')]){delete _0x2495c6[_0xc1ab('0x2c')];}_0xecd7f4[_0xc1ab('0x1b')](_0x62c4a3)[_0xc1ab('0x2d')](_0x2495c6);};}exports['index']=function(_0x4125b1,_0x2eec48){var _0x4fa4d4={},_0x1b8c43={},_0x5ad145={'count':0x0,'rows':[]};var _0x14b6c0=_[_0xc1ab('0x2e')](db[_0xc1ab('0x2f')][_0xc1ab('0x30')],function(_0x520a09){return{'name':_0x520a09[_0xc1ab('0x31')],'type':_0x520a09[_0xc1ab('0x32')][_0xc1ab('0x33')]};});_0x1b8c43[_0xc1ab('0x34')]=_[_0xc1ab('0x2e')](_0x14b6c0,_0xc1ab('0x2c'));_0x1b8c43['query']=_['keys'](_0x4125b1[_0xc1ab('0x35')]);_0x1b8c43['filters']=_['intersection'](_0x1b8c43[_0xc1ab('0x34')],_0x1b8c43[_0xc1ab('0x35')]);_0x4fa4d4['attributes']=_[_0xc1ab('0x36')](_0x1b8c43[_0xc1ab('0x34')],qs[_0xc1ab('0x37')](_0x4125b1[_0xc1ab('0x35')][_0xc1ab('0x37')]));_0x4fa4d4[_0xc1ab('0x38')]=_0x4fa4d4[_0xc1ab('0x38')]['length']?_0x4fa4d4[_0xc1ab('0x38')]:_0x1b8c43[_0xc1ab('0x34')];if(!_0x4125b1[_0xc1ab('0x35')][_0xc1ab('0x39')](_0xc1ab('0x3a'))){_0x4fa4d4['limit']=qs[_0xc1ab('0x21')](_0x4125b1[_0xc1ab('0x35')][_0xc1ab('0x21')]);_0x4fa4d4[_0xc1ab('0x1e')]=qs[_0xc1ab('0x1e')](_0x4125b1[_0xc1ab('0x35')]['offset']);}_0x4fa4d4[_0xc1ab('0x3b')]=qs['sort'](_0x4125b1[_0xc1ab('0x35')][_0xc1ab('0x3c')]);_0x4fa4d4['where']=qs[_0xc1ab('0x3d')](_[_0xc1ab('0x3e')](_0x4125b1[_0xc1ab('0x35')],_0x1b8c43[_0xc1ab('0x3d')]),_0x14b6c0);if(_0x4125b1[_0xc1ab('0x35')][_0xc1ab('0x3f')]){_0x4fa4d4[_0xc1ab('0x40')]=_[_0xc1ab('0x41')](_0x4fa4d4[_0xc1ab('0x40')],{'$or':_[_0xc1ab('0x2e')](_0x14b6c0,function(_0x1371d5){if(_0x1371d5[_0xc1ab('0x32')]!==_0xc1ab('0x42')){var _0x3c3302={};_0x3c3302[_0x1371d5[_0xc1ab('0x2c')]]={'$like':'%'+_0x4125b1[_0xc1ab('0x35')][_0xc1ab('0x3f')]+'%'};return _0x3c3302;}})});}_0x4fa4d4=_[_0xc1ab('0x41')]({},_0x4fa4d4,_0x4125b1[_0xc1ab('0x43')]);var _0x348f7c={'where':_0x4fa4d4[_0xc1ab('0x40')]};return db[_0xc1ab('0x2f')]['count'](_0x348f7c)['then'](function(_0x4791e7){_0x5ad145[_0xc1ab('0x20')]=_0x4791e7;if(_0x4125b1[_0xc1ab('0x35')][_0xc1ab('0x44')]){_0x4fa4d4[_0xc1ab('0x45')]=[{'all':!![]}];}return db[_0xc1ab('0x2f')]['findAll'](_0x4fa4d4);})[_0xc1ab('0x27')](function(_0x319f53){_0x5ad145[_0xc1ab('0x46')]=_0x319f53;return _0x5ad145;})[_0xc1ab('0x27')](respondWithFilteredResult(_0x2eec48,_0x4fa4d4))[_0xc1ab('0x47')](handleError(_0x2eec48,null));};exports['show']=function(_0x4e1cd9,_0x50fedf){var _0xdd3338={'raw':!![],'where':{'id':_0x4e1cd9[_0xc1ab('0x48')]['id']}},_0x3c20ef={};_0x3c20ef[_0xc1ab('0x34')]=_[_0xc1ab('0x49')](db[_0xc1ab('0x2f')][_0xc1ab('0x30')]);_0x3c20ef[_0xc1ab('0x35')]=_['keys'](_0x4e1cd9['query']);_0x3c20ef[_0xc1ab('0x3d')]=_[_0xc1ab('0x36')](_0x3c20ef['model'],_0x3c20ef[_0xc1ab('0x35')]);_0xdd3338['attributes']=_[_0xc1ab('0x36')](_0x3c20ef['model'],qs[_0xc1ab('0x37')](_0x4e1cd9[_0xc1ab('0x35')][_0xc1ab('0x37')]));_0xdd3338[_0xc1ab('0x38')]=_0xdd3338['attributes'][_0xc1ab('0x4a')]?_0xdd3338[_0xc1ab('0x38')]:_0x3c20ef[_0xc1ab('0x34')];if(_0x4e1cd9[_0xc1ab('0x35')][_0xc1ab('0x44')]){_0xdd3338[_0xc1ab('0x45')]=[{'all':!![]}];}_0xdd3338=_['merge']({},_0xdd3338,_0x4e1cd9['options']);return db[_0xc1ab('0x2f')][_0xc1ab('0x4b')](_0xdd3338)[_0xc1ab('0x27')](handleEntityNotFound(_0x50fedf,null))[_0xc1ab('0x27')](respondWithResult(_0x50fedf,null))[_0xc1ab('0x47')](handleError(_0x50fedf,null));};exports[_0xc1ab('0x4c')]=function(_0x1b49ed,_0x66e6f9){return db[_0xc1ab('0x2f')]['create'](_0x1b49ed[_0xc1ab('0x4d')],{})[_0xc1ab('0x27')](respondWithResult(_0x66e6f9,0xc9))[_0xc1ab('0x47')](handleError(_0x66e6f9,null));};exports[_0xc1ab('0x26')]=function(_0x294922,_0x218278){if(_0x294922[_0xc1ab('0x4d')]['id']){delete _0x294922['body']['id'];}return db[_0xc1ab('0x2f')][_0xc1ab('0x4b')]({'where':{'id':_0x294922[_0xc1ab('0x48')]['id']}})['then'](handleEntityNotFound(_0x218278,null))[_0xc1ab('0x27')](saveUpdates(_0x294922[_0xc1ab('0x4d')],null))[_0xc1ab('0x27')](respondWithResult(_0x218278,null))['catch'](handleError(_0x218278,null));};exports[_0xc1ab('0x28')]=function(_0x30ca30,_0x11c489){return db[_0xc1ab('0x2f')]['find']({'where':{'id':_0x30ca30[_0xc1ab('0x48')]['id']}})[_0xc1ab('0x27')](handleEntityNotFound(_0x11c489,null))[_0xc1ab('0x27')](removeEntity(_0x11c489,null))['catch'](handleError(_0x11c489,null));};exports[_0xc1ab('0x4e')]=function(_0x9ef64c,_0x21f2ed){return db[_0xc1ab('0x2f')][_0xc1ab('0x4e')]()[_0xc1ab('0x27')](respondWithResult(_0x21f2ed,null))[_0xc1ab('0x47')](handleError(_0x21f2ed,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 8325013..e3b2a16 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 _0xeedf=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','report_sms_transfer','uniqueid'];(function(_0x1b8d87,_0x4168fb){var _0x182b74=function(_0x12b570){while(--_0x12b570){_0x1b8d87['push'](_0x1b8d87['shift']());}};_0x182b74(++_0x4168fb);}(_0xeedf,0x12c));var _0xfeed=function(_0x1f25c4,_0x5d2543){_0x1f25c4=_0x1f25c4-0x0;var _0xc68740=_0xeedf[_0x1f25c4];return _0xc68740;};'use strict';var _=require(_0xfeed('0x0'));var util=require(_0xfeed('0x1'));var logger=require(_0xfeed('0x2'))('api');var moment=require(_0xfeed('0x3'));var BPromise=require('bluebird');var rp=require(_0xfeed('0x4'));var fs=require('fs');var path=require(_0xfeed('0x5'));var rimraf=require(_0xfeed('0x6'));var config=require(_0xfeed('0x7'));var attributes=require('./smsTransferReport.attributes');module[_0xfeed('0x8')]=function(_0x2c211d,_0x5df4fe){return _0x2c211d[_0xfeed('0x9')]('SmsTransferReport',attributes,{'tableName':_0xfeed('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xfeed('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcca7=['api','request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','exports','report_sms_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x6eb833,_0x2bb5e5){var _0xdfc38c=function(_0x13c4a4){while(--_0x13c4a4){_0x6eb833['push'](_0x6eb833['shift']());}};_0xdfc38c(++_0x2bb5e5);}(_0xcca7,0x1aa));var _0x7cca=function(_0x5bf36d,_0x194769){_0x5bf36d=_0x5bf36d-0x0;var _0xc78588=_0xcca7[_0x5bf36d];return _0xc78588;};'use strict';var _=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var logger=require(_0x7cca('0x2'))(_0x7cca('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7cca('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var attributes=require(_0x7cca('0x7'));module[_0x7cca('0x8')]=function(_0x1c6c95,_0xe70805){return _0x1c6c95['define']('SmsTransferReport',attributes,{'tableName':_0x7cca('0x9'),'paranoid':![],'indexes':[{'name':_0x7cca('0xa'),'fields':[_0x7cca('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 83eab59..8d9673d 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 _0xf350=['request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','SmsTransferReport,\x20%s,\x20%s'];(function(_0x5879a9,_0x30ba2d){var _0x4b8e59=function(_0x5a8025){while(--_0x5a8025){_0x5879a9['push'](_0x5879a9['shift']());}};_0x4b8e59(++_0x30ba2d);}(_0xf350,0x105));var _0x0f35=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf350[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0f35('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0f35('0x1'));var rs=require(_0x0f35('0x2'));var fs=require('fs');var Redis=require(_0x0f35('0x3'));var db=require(_0x0f35('0x4'))['db'];var utils=require(_0x0f35('0x5'));var logger=require(_0x0f35('0x6'))(_0x0f35('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0f35('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c61c4,_0x481712,_0x544342){return new BPromise(function(_0x2c716b,_0x49c0fe){return client[_0x0f35('0x9')](_0x2c61c4,_0x544342)['then'](function(_0x3d928d){logger[_0x0f35('0xa')](_0x0f35('0xb'),_0x481712,_0x0f35('0xc'));logger[_0x0f35('0xd')](_0x0f35('0xe'),_0x481712,_0x0f35('0xc'),JSON[_0x0f35('0xf')](_0x3d928d));if(_0x3d928d[_0x0f35('0x10')]){if(_0x3d928d['error'][_0x0f35('0x11')]===0x1f4){logger[_0x0f35('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x481712,_0x3d928d[_0x0f35('0x10')]['message']);return _0x49c0fe(_0x3d928d[_0x0f35('0x10')]['message']);}logger['error'](_0x0f35('0xb'),_0x481712,_0x3d928d[_0x0f35('0x10')][_0x0f35('0x12')]);return _0x2c716b(_0x3d928d['error'][_0x0f35('0x12')]);}else{logger[_0x0f35('0xa')](_0x0f35('0xb'),_0x481712,_0x0f35('0xc'));_0x2c716b(_0x3d928d[_0x0f35('0x13')][_0x0f35('0x12')]);}})[_0x0f35('0x14')](function(_0x1a2ffc){logger[_0x0f35('0x10')](_0x0f35('0xb'),_0x481712,_0x1a2ffc);_0x49c0fe(_0x1a2ffc);});});} \ No newline at end of file +var _0x28e3=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0x28e3,0x106));var _0x328e=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x28e3[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x328e('0x0'));var util=require(_0x328e('0x1'));var moment=require(_0x328e('0x2'));var BPromise=require(_0x328e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x328e('0x4'));var db=require(_0x328e('0x5'))['db'];var utils=require(_0x328e('0x6'));var logger=require(_0x328e('0x7'))(_0x328e('0x8'));var config=require(_0x328e('0x9'));var jayson=require(_0x328e('0xa'));var client=jayson[_0x328e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b5c91,_0x58885f,_0x2bddaa){return new BPromise(function(_0x3696b6,_0x3467ee){return client[_0x328e('0xc')](_0x4b5c91,_0x2bddaa)[_0x328e('0xd')](function(_0x4a4f53){logger[_0x328e('0xe')](_0x328e('0xf'),_0x58885f,_0x328e('0x10'));logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x58885f,'request\x20sent',JSON[_0x328e('0x11')](_0x4a4f53));if(_0x4a4f53[_0x328e('0x12')]){if(_0x4a4f53[_0x328e('0x12')][_0x328e('0x13')]===0x1f4){logger[_0x328e('0x12')](_0x328e('0xf'),_0x58885f,_0x4a4f53[_0x328e('0x12')][_0x328e('0x14')]);return _0x3467ee(_0x4a4f53[_0x328e('0x12')][_0x328e('0x14')]);}logger[_0x328e('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x58885f,_0x4a4f53[_0x328e('0x12')][_0x328e('0x14')]);return _0x3696b6(_0x4a4f53[_0x328e('0x12')][_0x328e('0x14')]);}else{logger[_0x328e('0xe')](_0x328e('0xf'),_0x58885f,_0x328e('0x10'));_0x3696b6(_0x4a4f53[_0x328e('0x15')][_0x328e('0x14')]);}})['catch'](function(_0x1fdb79){logger[_0x328e('0x12')](_0x328e('0xf'),_0x58885f,_0x1fdb79);_0x3467ee(_0x1fdb79);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 4d620e4..84cf790 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 _0x2754=['put','update','delete','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','download','diskStorage','join','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','create'];(function(_0x4dd7e3,_0xc65d8d){var _0x5c2f5e=function(_0x14a98f){while(--_0x14a98f){_0x4dd7e3['push'](_0x4dd7e3['shift']());}};_0x5c2f5e(++_0xc65d8d);}(_0x2754,0x1e4));var _0x4275=function(_0x25e812,_0x1342a2){_0x25e812=_0x25e812-0x0;var _0x727c56=_0x2754[_0x25e812];return _0x727c56;};'use strict';var multer=require(_0x4275('0x0'));var util=require('util');var path=require(_0x4275('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4275('0x2')]();var fs_extra=require(_0x4275('0x3'));var auth=require(_0x4275('0x4'));var interaction=require(_0x4275('0x5'));var config=require(_0x4275('0x6'));var controller=require(_0x4275('0x7'));router[_0x4275('0x8')]('/',auth[_0x4275('0x9')](),controller[_0x4275('0xa')]);router[_0x4275('0x8')](_0x4275('0xb'),auth[_0x4275('0x9')](),controller[_0x4275('0xc')]);router[_0x4275('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x4275('0xd')]);var upload=multer({'storage':multer[_0x4275('0xe')]({'destination':function(_0x38eea2,_0x182b9a,_0x3b8202){_0x3b8202(null,path[_0x4275('0xf')](config['root'],_0x4275('0x10')));},'filename':function(_0xde1deb,_0x44ab54,_0x6467cf){_0x44ab54[_0x4275('0x11')]=_0x44ab54['originalname'][_0x4275('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x6467cf(null,util[_0x4275('0x13')](_0x4275('0x14'),path[_0x4275('0x15')](_0x44ab54[_0x4275('0x11')],path[_0x4275('0x16')](_0x44ab54[_0x4275('0x11')])),Date[_0x4275('0x17')](),path[_0x4275('0x16')](_0x44ab54[_0x4275('0x11')])));}})});router[_0x4275('0x18')]('/',upload[_0x4275('0x19')](_0x4275('0x1a')),controller[_0x4275('0x1b')]);router[_0x4275('0x1c')](_0x4275('0xb'),auth['isAuthenticated'](),controller[_0x4275('0x1d')]);router[_0x4275('0x1e')](_0x4275('0xb'),auth['isAuthenticated'](),controller[_0x4275('0x1e')]);module[_0x4275('0x1f')]=router; \ No newline at end of file +var _0x24db=['exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','root','originalname','format','%s-%s%s','now','extname','post','single','file','create','put','update','delete'];(function(_0x3f943f,_0x1bc3d7){var _0xdf628a=function(_0xe97b54){while(--_0xe97b54){_0x3f943f['push'](_0x3f943f['shift']());}};_0xdf628a(++_0x1bc3d7);}(_0x24db,0xe9));var _0xb24d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24db[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb24d('0x0'));var express=require(_0xb24d('0x1'));var router=express[_0xb24d('0x2')]();var fs_extra=require(_0xb24d('0x3'));var auth=require(_0xb24d('0x4'));var interaction=require(_0xb24d('0x5'));var config=require(_0xb24d('0x6'));var controller=require('./sound.controller');router[_0xb24d('0x7')]('/',auth[_0xb24d('0x8')](),controller[_0xb24d('0x9')]);router[_0xb24d('0x7')](_0xb24d('0xa'),auth[_0xb24d('0x8')](),controller[_0xb24d('0xb')]);router[_0xb24d('0x7')](_0xb24d('0xc'),auth['isAuthenticated'](),controller[_0xb24d('0xd')]);var upload=multer({'storage':multer[_0xb24d('0xe')]({'destination':function(_0x476986,_0x134f5e,_0x72f03){_0x72f03(null,path['join'](config[_0xb24d('0xf')],'server/files/sounds/original/'));},'filename':function(_0x3a55c4,_0x2714d2,_0x4ba510){_0x2714d2[_0xb24d('0x10')]=_0x2714d2['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4ba510(null,util[_0xb24d('0x11')](_0xb24d('0x12'),path['basename'](_0x2714d2['originalname'],path['extname'](_0x2714d2['originalname'])),Date[_0xb24d('0x13')](),path[_0xb24d('0x14')](_0x2714d2[_0xb24d('0x10')])));}})});router[_0xb24d('0x15')]('/',upload[_0xb24d('0x16')](_0xb24d('0x17')),controller[_0xb24d('0x18')]);router[_0xb24d('0x19')](_0xb24d('0xa'),auth['isAuthenticated'](),controller[_0xb24d('0x1a')]);router[_0xb24d('0x1b')](_0xb24d('0xa'),auth[_0xb24d('0x8')](),controller[_0xb24d('0x1b')]);module[_0xb24d('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index a415df6..b8bd9cb 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 _0x3443=['name','STRING','INTEGER','BIGINT','sequelize','exports'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x3443,0x1c6));var _0x3344=function(_0x40f4cc,_0x432f55){_0x40f4cc=_0x40f4cc-0x0;var _0x458315=_0x3443[_0x40f4cc];return _0x458315;};'use strict';var Sequelize=require(_0x3344('0x0'));module[_0x3344('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3344('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x3344('0x3')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x3344('0x3')]},'original_format':{'type':Sequelize[_0x3344('0x3')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x3344('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x3344('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x3344('0x5')]},'converted_channelCount':{'type':Sequelize[_0x3344('0x4')]},'converted_bitRate':{'type':Sequelize[_0x3344('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x3344('0x4')]}}; \ No newline at end of file +var _0xb88b=['exports','STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xb88b,0x1c8));var _0xbb88=function(_0x1de918,_0x2dc421){_0x1de918=_0x1de918-0x0;var _0x5fc1a0=_0xb88b[_0x1de918];return _0x5fc1a0;};'use strict';var Sequelize=require('sequelize');module[_0xbb88('0x0')]={'name':{'type':Sequelize[_0xbb88('0x1')],'unique':_0xbb88('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xbb88('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xbb88('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xbb88('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xbb88('0x4')]},'original_sampleRate':{'type':Sequelize[_0xbb88('0x5')]},'converted_format':{'type':Sequelize[_0xbb88('0x1')]},'converted_duration':{'type':Sequelize[_0xbb88('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xbb88('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xbb88('0x4')]},'converted_sampleRate':{'type':Sequelize[_0xbb88('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 8db20a0..0eb6ea2 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 _0x16bc=['mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','Sounds','UserProfileResource','end','sendStatus','error','stack','name','send','index','Sound','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','length','download','save_name','converted_format','existsSync','join','Sequelize','ValidationError','Sound\x20not\x20found','root','format','%s.%s','create','basename','file','extname','filename','originalname','substring','wav','server/files/sounds/original','server/files/sounds/converted','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_channelCount','0777','body','role','userProfileId','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','description','delete','original_format','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x21fd8e,_0x553dc7){var _0x157b97=function(_0x48f3e1){while(--_0x48f3e1){_0x21fd8e['push'](_0x21fd8e['shift']());}};_0x157b97(++_0x553dc7);}(_0x16bc,0x75));var _0xc16b=function(_0xafdaf4,_0x5bd4d1){_0xafdaf4=_0xafdaf4-0x0;var _0x1e70a8=_0x16bc[_0xafdaf4];return _0x1e70a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc16b('0x0'));var zipdir=require(_0xc16b('0x1'));var jsonpatch=require(_0xc16b('0x2'));var rp=require(_0xc16b('0x3'));var moment=require(_0xc16b('0x4'));var BPromise=require(_0xc16b('0x5'));var Mustache=require(_0xc16b('0x6'));var util=require('util');var path=require(_0xc16b('0x7'));var sox=require(_0xc16b('0x8'));var csv=require(_0xc16b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc16b('0xa'));var squel=require(_0xc16b('0xb'));var crypto=require(_0xc16b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc16b('0xd'));var toCsv=require(_0xc16b('0x9'));var querystring=require(_0xc16b('0xe'));var Papa=require('papaparse');var Redis=require(_0xc16b('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc16b('0x10'));var hardwareService=require(_0xc16b('0x11'));var logger=require(_0xc16b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xc16b('0x13'));var licenseUtil=require(_0xc16b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d0c58,_0x5f16b6){_0x5f16b6=_0x5f16b6||0xcc;return function(_0x39e602){if(_0x39e602){return _0x3d0c58['sendStatus'](_0x5f16b6);}return _0x3d0c58[_0xc16b('0x15')](_0x5f16b6)['end']();};}function respondWithResult(_0x57f2d3,_0x338424){_0x338424=_0x338424||0xc8;return function(_0x296248){if(_0x296248){return _0x57f2d3[_0xc16b('0x15')](_0x338424)[_0xc16b('0x16')](_0x296248);}};}function respondWithFilteredResult(_0x2830ec,_0x25ba21){return function(_0x22b599){if(_0x22b599){var _0x474381=typeof _0x25ba21[_0xc16b('0x17')]===_0xc16b('0x18')&&typeof _0x25ba21[_0xc16b('0x19')]==='undefined';var _0x18015b=_0x22b599[_0xc16b('0x1a')];var _0x5204fd=_0x474381?0x0:_0x25ba21['offset'];var _0x1d699e=_0x474381?_0x22b599[_0xc16b('0x1a')]:_0x25ba21[_0xc16b('0x17')]+_0x25ba21[_0xc16b('0x19')];var _0x44bb34;if(_0x1d699e>=_0x18015b){_0x1d699e=_0x18015b;_0x44bb34=0xc8;}else{_0x44bb34=0xce;}_0x2830ec['status'](_0x44bb34);return _0x2830ec[_0xc16b('0x1b')]('Content-Range',_0x5204fd+'-'+_0x1d699e+'/'+_0x18015b)['json'](_0x22b599);}return null;};}function patchUpdates(_0x2b86b8){return function(_0x34bb62){try{jsonpatch[_0xc16b('0x1c')](_0x34bb62,_0x2b86b8,!![]);}catch(_0x2fb4ff){return BPromise[_0xc16b('0x1d')](_0x2fb4ff);}return _0x34bb62[_0xc16b('0x1e')]();};}function saveUpdates(_0x478bbf,_0x3523ac){return function(_0x1e7df1){if(_0x1e7df1){return _0x1e7df1[_0xc16b('0x1f')](_0x478bbf)['then'](function(_0x15ab9d){return _0x15ab9d;});}return null;};}function removeEntity(_0x5670d7,_0x510b61){return function(_0x1fecb2){if(_0x1fecb2){return _0x1fecb2[_0xc16b('0x20')]()[_0xc16b('0x21')](function(){var _0x43436f=_0x1fecb2[_0xc16b('0x22')]({'plain':!![]});var _0x2d6369=_0xc16b('0x23');return db[_0xc16b('0x24')]['destroy']({'where':{'type':_0x2d6369,'resourceId':_0x43436f['id']}})[_0xc16b('0x21')](function(){return _0x1fecb2;});})[_0xc16b('0x21')](function(){_0x5670d7[_0xc16b('0x15')](0xcc)[_0xc16b('0x25')]();});}};}function handleEntityNotFound(_0x19e8fa,_0x506062){return function(_0x1ea878){if(!_0x1ea878){_0x19e8fa[_0xc16b('0x26')](0x194);}return _0x1ea878;};}function handleError(_0x340ac6,_0x344fbf){_0x344fbf=_0x344fbf||0x1f4;return function(_0x3a44db){logger[_0xc16b('0x27')](_0x3a44db[_0xc16b('0x28')]);if(_0x3a44db[_0xc16b('0x29')]){delete _0x3a44db[_0xc16b('0x29')];}_0x340ac6[_0xc16b('0x15')](_0x344fbf)[_0xc16b('0x2a')](_0x3a44db);};}exports[_0xc16b('0x2b')]=function(_0x9c9d0c,_0x217312){var _0x32e6ea={},_0x4fd450={},_0x2bcc77={'count':0x0,'rows':[]};var _0x34c31c=_['map'](db[_0xc16b('0x2c')][_0xc16b('0x2d')],function(_0xbaade7){return{'name':_0xbaade7['fieldName'],'type':_0xbaade7[_0xc16b('0x2e')][_0xc16b('0x2f')]};});_0x4fd450['model']=_[_0xc16b('0x30')](_0x34c31c,_0xc16b('0x29'));_0x4fd450[_0xc16b('0x31')]=_[_0xc16b('0x32')](_0x9c9d0c[_0xc16b('0x31')]);_0x4fd450[_0xc16b('0x33')]=_[_0xc16b('0x34')](_0x4fd450[_0xc16b('0x35')],_0x4fd450[_0xc16b('0x31')]);_0x32e6ea[_0xc16b('0x36')]=_[_0xc16b('0x34')](_0x4fd450[_0xc16b('0x35')],qs[_0xc16b('0x37')](_0x9c9d0c[_0xc16b('0x31')][_0xc16b('0x37')]));_0x32e6ea[_0xc16b('0x36')]=_0x32e6ea[_0xc16b('0x36')]['length']?_0x32e6ea[_0xc16b('0x36')]:_0x4fd450[_0xc16b('0x35')];if(!_0x9c9d0c[_0xc16b('0x31')]['hasOwnProperty'](_0xc16b('0x38'))){_0x32e6ea[_0xc16b('0x19')]=qs[_0xc16b('0x19')](_0x9c9d0c['query'][_0xc16b('0x19')]);_0x32e6ea[_0xc16b('0x17')]=qs[_0xc16b('0x17')](_0x9c9d0c[_0xc16b('0x31')]['offset']);}_0x32e6ea[_0xc16b('0x39')]=qs['sort'](_0x9c9d0c['query'][_0xc16b('0x3a')]);_0x32e6ea['where']=qs['filters'](_['pick'](_0x9c9d0c[_0xc16b('0x31')],_0x4fd450['filters']),_0x34c31c);if(_0x9c9d0c['query']['filter']){_0x32e6ea[_0xc16b('0x3b')]=_[_0xc16b('0x3c')](_0x32e6ea['where'],{'$or':_[_0xc16b('0x30')](_0x34c31c,function(_0x430907){if(_0x430907[_0xc16b('0x2e')]!==_0xc16b('0x3d')){var _0x390550={};_0x390550[_0x430907['name']]={'$like':'%'+_0x9c9d0c['query'][_0xc16b('0x3e')]+'%'};return _0x390550;}})});}_0x32e6ea=_[_0xc16b('0x3c')]({},_0x32e6ea,_0x9c9d0c[_0xc16b('0x3f')]);var _0x2934b5={'where':_0x32e6ea[_0xc16b('0x3b')]};return db[_0xc16b('0x2c')][_0xc16b('0x1a')](_0x2934b5)[_0xc16b('0x21')](function(_0x1df452){_0x2bcc77[_0xc16b('0x1a')]=_0x1df452;if(_0x9c9d0c[_0xc16b('0x31')][_0xc16b('0x40')]){_0x32e6ea[_0xc16b('0x41')]=[{'all':!![]}];}return db[_0xc16b('0x2c')]['findAll'](_0x32e6ea);})[_0xc16b('0x21')](function(_0x2c78ac){_0x2bcc77['rows']=_0x2c78ac;return _0x2bcc77;})[_0xc16b('0x21')](respondWithFilteredResult(_0x217312,_0x32e6ea))[_0xc16b('0x42')](handleError(_0x217312,null));};exports[_0xc16b('0x43')]=function(_0x53da1d,_0x2eaafa){var _0x4dd151={'raw':!![],'where':{'id':_0x53da1d[_0xc16b('0x44')]['id']}},_0x9cc7d9={};_0x9cc7d9[_0xc16b('0x35')]=_[_0xc16b('0x32')](db[_0xc16b('0x2c')]['rawAttributes']);_0x9cc7d9[_0xc16b('0x31')]=_[_0xc16b('0x32')](_0x53da1d[_0xc16b('0x31')]);_0x9cc7d9[_0xc16b('0x33')]=_[_0xc16b('0x34')](_0x9cc7d9['model'],_0x9cc7d9[_0xc16b('0x31')]);_0x4dd151[_0xc16b('0x36')]=_[_0xc16b('0x34')](_0x9cc7d9[_0xc16b('0x35')],qs[_0xc16b('0x37')](_0x53da1d['query']['fields']));_0x4dd151[_0xc16b('0x36')]=_0x4dd151['attributes'][_0xc16b('0x45')]?_0x4dd151[_0xc16b('0x36')]:_0x9cc7d9[_0xc16b('0x35')];if(_0x53da1d['query'][_0xc16b('0x40')]){_0x4dd151[_0xc16b('0x41')]=[{'all':!![]}];}_0x4dd151=_[_0xc16b('0x3c')]({},_0x4dd151,_0x53da1d['options']);return db[_0xc16b('0x2c')]['find'](_0x4dd151)['then'](handleEntityNotFound(_0x2eaafa,null))[_0xc16b('0x21')](respondWithResult(_0x2eaafa,null))[_0xc16b('0x42')](handleError(_0x2eaafa,null));};exports[_0xc16b('0x46')]=function(_0x21ceae,_0xb5456,_0x59ecc2){return db[_0xc16b('0x2c')]['find']({'where':{'id':_0x21ceae[_0xc16b('0x44')]['id']},'attributes':['name',_0xc16b('0x47'),_0xc16b('0x48')],'raw':!![]})[_0xc16b('0x21')](handleEntityNotFound(_0xb5456,null))[_0xc16b('0x21')](function(_0x242c00){if(_0x242c00){if(!fs[_0xc16b('0x49')](path[_0xc16b('0x4a')](config['root'],'server/files/sounds/converted',_0x242c00['save_name']+'.'+_0x242c00[_0xc16b('0x48')]))){throw new db[(_0xc16b('0x4b'))][(_0xc16b('0x4c'))](_0xc16b('0x4d'));}return _0xb5456[_0xc16b('0x46')](path[_0xc16b('0x4a')](config[_0xc16b('0x4e')],'server/files/sounds/converted',util[_0xc16b('0x4f')](_0xc16b('0x50'),_0x242c00[_0xc16b('0x47')],_0x242c00[_0xc16b('0x48')])),util[_0xc16b('0x4f')](_0xc16b('0x50'),_0x242c00[_0xc16b('0x29')],_0x242c00[_0xc16b('0x48')]));}return null;})[_0xc16b('0x42')](handleError(_0xb5456,null));};exports[_0xc16b('0x51')]=function(_0x581f32,_0x567951,_0xd9e186){var _0x21a902={'name':path[_0xc16b('0x52')](_0x581f32[_0xc16b('0x53')]['originalname'],path[_0xc16b('0x54')](_0x581f32[_0xc16b('0x53')]['originalname'])),'save_name':path[_0xc16b('0x52')](_0x581f32['file'][_0xc16b('0x55')],path['extname'](_0x581f32['file'][_0xc16b('0x55')])),'original_format':path[_0xc16b('0x54')](_0x581f32[_0xc16b('0x53')][_0xc16b('0x56')])[_0xc16b('0x57')](0x1),'converted_format':_0xc16b('0x58')};var _0x51c943=path[_0xc16b('0x4a')](config[_0xc16b('0x4e')],_0xc16b('0x59'),_0x581f32['file'][_0xc16b('0x55')]);var _0x1554aa=path['join'](config['root'],_0xc16b('0x5a'),util[_0xc16b('0x4f')]('%s.%s',path[_0xc16b('0x52')](_0x581f32['file'][_0xc16b('0x55')],path['extname'](_0x581f32[_0xc16b('0x53')][_0xc16b('0x55')])),_0x21a902[_0xc16b('0x48')]));logger[_0xc16b('0x5b')](_0xc16b('0x5c'),_0x51c943);logger[_0xc16b('0x5b')](_0xc16b('0x5d'),_0x1554aa);try{fs[_0xc16b('0x5e')](_0x51c943,parseInt('0777',0x8));var _0x1e07ca=sox[_0xc16b('0x5f')](_0x51c943,_0x1554aa,{'sampleRate':0x1f40,'format':_0xc16b('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1e07ca['on'](_0xc16b('0x27'),function(_0x76842e){fs['unlinkSync'](_0x51c943);_0x567951[_0xc16b('0x15')](0x1f4)[_0xc16b('0x2a')](_0x76842e);});_0x1e07ca['on'](_0xc16b('0x60'),function(_0xfa9c0e){_0x21a902[_0xc16b('0x61')]=isNaN(_0xfa9c0e[_0xc16b('0x62')])?null:_0xfa9c0e[_0xc16b('0x62')]*0x3e8;_0x21a902[_0xc16b('0x63')]=isNaN(_0xfa9c0e[_0xc16b('0x64')])?null:_0xfa9c0e[_0xc16b('0x64')];_0x21a902[_0xc16b('0x65')]=isNaN(_0xfa9c0e[_0xc16b('0x66')])?null:_0xfa9c0e['channelCount'];_0x21a902[_0xc16b('0x67')]=isNaN(_0xfa9c0e['bitRate'])?null:_0xfa9c0e[_0xc16b('0x68')];_0x21a902[_0xc16b('0x69')]=isNaN(_0xfa9c0e[_0xc16b('0x6a')])?null:_0xfa9c0e[_0xc16b('0x6a')];});_0x1e07ca['on']('dest',function(_0x3f6e75){_0x21a902[_0xc16b('0x6b')]=isNaN(_0x3f6e75[_0xc16b('0x62')])?null:_0x3f6e75['duration']*0x3e8;_0x21a902['converted_sampleCount']=isNaN(_0x3f6e75[_0xc16b('0x64')])?null:_0x3f6e75[_0xc16b('0x64')];_0x21a902[_0xc16b('0x6c')]=isNaN(_0x3f6e75[_0xc16b('0x66')])?null:_0x3f6e75['channelCount'];_0x21a902['converted_bitRate']=isNaN(_0x3f6e75['bitRate'])?null:_0x3f6e75['bitRate'];_0x21a902['converted_sampleRate']=isNaN(_0x3f6e75['sampleRate'])?null:_0x3f6e75[_0xc16b('0x6a')];});_0x1e07ca['on'](_0xc16b('0x25'),function(){fs['chmodSync'](_0x1554aa,parseInt(_0xc16b('0x6d'),0x8));return db['Sound'][_0xc16b('0x51')](_0x21a902)[_0xc16b('0x21')](function(_0x293a7a){var _0x1b03be={'role':_0x581f32[_0xc16b('0x6e')][_0xc16b('0x6f')],'userProfileId':_0x581f32['body'][_0xc16b('0x70')]};if(!_0x1b03be)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b03be[_0xc16b('0x6f')]===_0xc16b('0x71')){var _0x2a9369=_0x293a7a[_0xc16b('0x22')]({'plain':!![]});return db[_0xc16b('0x72')][_0xc16b('0x73')]({'where':{'name':_0xc16b('0x23'),'userProfileId':_0x1b03be[_0xc16b('0x70')]},'raw':!![]})[_0xc16b('0x21')](function(_0x36d6f6){if(_0x36d6f6&&_0x36d6f6[_0xc16b('0x74')]===0x0){return db[_0xc16b('0x24')][_0xc16b('0x51')]({'name':_0x2a9369[_0xc16b('0x29')],'resourceId':_0x2a9369['id'],'type':_0x36d6f6['name'],'sectionId':_0x36d6f6['id']},{})['then'](function(){return _0x293a7a;});}else{return _0x293a7a;}})['catch'](function(_0x4c9b66){logger['error'](_0xc16b('0x75'),_0x4c9b66);throw _0x4c9b66;});}return _0x293a7a;})['then'](respondWithResult(_0x567951,null))[_0xc16b('0x42')](handleError(_0x567951,null));});_0x1e07ca['start']();}catch(_0xd0dd3f){_0x567951[_0xc16b('0x15')](0x1f4)[_0xc16b('0x2a')](_0xd0dd3f);}};exports[_0xc16b('0x1f')]=function(_0x584897,_0x2f3586,_0x49145a){return db[_0xc16b('0x2c')][_0xc16b('0x73')]({'where':{'id':_0x584897[_0xc16b('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f3586,null))[_0xc16b('0x21')](saveUpdates(_[_0xc16b('0x76')](_0x584897[_0xc16b('0x6e')],[_0xc16b('0x29'),_0xc16b('0x77')]),null))['then'](respondWithResult(_0x2f3586,null))[_0xc16b('0x42')](handleError(_0x2f3586,null));};exports[_0xc16b('0x78')]=function(_0x13261b,_0x819b91,_0x34c98){return db[_0xc16b('0x2c')][_0xc16b('0x73')]({'where':{'id':_0x13261b[_0xc16b('0x44')]['id']}})[_0xc16b('0x21')](function(_0x24e232){if(_0x24e232){return _0x24e232[_0xc16b('0x20')]();}})[_0xc16b('0x21')](function(_0x418763){var _0xf8b134=path[_0xc16b('0x4a')](config[_0xc16b('0x4e')],'server/files/sounds/original',util[_0xc16b('0x4f')](_0xc16b('0x50'),_0x418763['save_name'],_0x418763[_0xc16b('0x79')]));var _0x2c2de7=path[_0xc16b('0x4a')](config[_0xc16b('0x4e')],'server/files/sounds/converted',util['format'](_0xc16b('0x50'),_0x418763['save_name'],_0x418763['converted_format']));fs[_0xc16b('0x7a')](_0xf8b134);fs[_0xc16b('0x7a')](_0x2c2de7);return _0x418763;})[_0xc16b('0x21')](function(_0x374d38){if(_0x374d38){return _0x819b91[_0xc16b('0x15')](0xcc)['end']();}})[_0xc16b('0x21')](handleEntityNotFound(_0x819b91,null))[_0xc16b('0x42')](handleError(_0x819b91,null));}; \ No newline at end of file +var _0x354b=['to-csv','querystring','papaparse','ioredis','../../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','set','Content-Range','reject','save','update','then','destroy','Sounds','UserProfileResource','error','stack','name','send','index','map','fieldName','type','key','query','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','options','Sound','includeAll','include','rows','catch','show','params','keys','rawAttributes','model','find','download','save_name','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','format','create','basename','file','originalname','extname','filename','substring','wav','join','%s.%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_bitRate','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','autoAssociation','pick','description','delete','server/files/sounds/original','original_format','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x5cc51f,_0x22c480){var _0x315a2f=function(_0x4f93bd){while(--_0x4f93bd){_0x5cc51f['push'](_0x5cc51f['shift']());}};_0x315a2f(++_0x22c480);}(_0x354b,0x171));var _0xb354=function(_0x1fa5aa,_0x32648f){_0x1fa5aa=_0x1fa5aa-0x0;var _0x1c532f=_0x354b[_0x1fa5aa];return _0x1c532f;};'use strict';var emlformat=require(_0xb354('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb354('0x1'));var jsonpatch=require(_0xb354('0x2'));var rp=require(_0xb354('0x3'));var moment=require(_0xb354('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb354('0x5'));var util=require(_0xb354('0x6'));var path=require('path');var sox=require(_0xb354('0x7'));var csv=require('to-csv');var ejs=require(_0xb354('0x8'));var fs=require('fs');var fs_extra=require(_0xb354('0x9'));var _=require(_0xb354('0xa'));var squel=require(_0xb354('0xb'));var crypto=require(_0xb354('0xc'));var jsforce=require(_0xb354('0xd'));var deskjs=require(_0xb354('0xe'));var toCsv=require(_0xb354('0xf'));var querystring=require(_0xb354('0x10'));var Papa=require(_0xb354('0x11'));var Redis=require(_0xb354('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb354('0x13'));var as=require(_0xb354('0x14'));var hardwareService=require(_0xb354('0x15'));var logger=require(_0xb354('0x16'))(_0xb354('0x17'));var utils=require(_0xb354('0x18'));var config=require(_0xb354('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb354('0x1a'))['db'];function respondWithStatusCode(_0x45dbd7,_0x5f32b1){_0x5f32b1=_0x5f32b1||0xcc;return function(_0x5c8208){if(_0x5c8208){return _0x45dbd7[_0xb354('0x1b')](_0x5f32b1);}return _0x45dbd7[_0xb354('0x1c')](_0x5f32b1)[_0xb354('0x1d')]();};}function respondWithResult(_0x584a09,_0x31b34b){_0x31b34b=_0x31b34b||0xc8;return function(_0x521adf){if(_0x521adf){return _0x584a09['status'](_0x31b34b)[_0xb354('0x1e')](_0x521adf);}};}function respondWithFilteredResult(_0x5b14e7,_0x3e0bcb){return function(_0x13d11b){if(_0x13d11b){var _0x1541c3=typeof _0x3e0bcb[_0xb354('0x1f')]===_0xb354('0x20')&&typeof _0x3e0bcb[_0xb354('0x21')]===_0xb354('0x20');var _0x150fd9=_0x13d11b['count'];var _0x773c43=_0x1541c3?0x0:_0x3e0bcb['offset'];var _0x442fdc=_0x1541c3?_0x13d11b[_0xb354('0x22')]:_0x3e0bcb[_0xb354('0x1f')]+_0x3e0bcb['limit'];var _0x46df96;if(_0x442fdc>=_0x150fd9){_0x442fdc=_0x150fd9;_0x46df96=0xc8;}else{_0x46df96=0xce;}_0x5b14e7[_0xb354('0x1c')](_0x46df96);return _0x5b14e7[_0xb354('0x23')](_0xb354('0x24'),_0x773c43+'-'+_0x442fdc+'/'+_0x150fd9)[_0xb354('0x1e')](_0x13d11b);}return null;};}function patchUpdates(_0x32b9db){return function(_0x2781af){try{jsonpatch['apply'](_0x2781af,_0x32b9db,!![]);}catch(_0x74076f){return BPromise[_0xb354('0x25')](_0x74076f);}return _0x2781af[_0xb354('0x26')]();};}function saveUpdates(_0x481496,_0x1cb7a0){return function(_0x3358eb){if(_0x3358eb){return _0x3358eb[_0xb354('0x27')](_0x481496)[_0xb354('0x28')](function(_0x91fc23){return _0x91fc23;});}return null;};}function removeEntity(_0x16afc7,_0x57484a){return function(_0x4024cd){if(_0x4024cd){return _0x4024cd[_0xb354('0x29')]()['then'](function(){var _0x2be582=_0x4024cd['get']({'plain':!![]});var _0x39dec9=_0xb354('0x2a');return db[_0xb354('0x2b')]['destroy']({'where':{'type':_0x39dec9,'resourceId':_0x2be582['id']}})[_0xb354('0x28')](function(){return _0x4024cd;});})['then'](function(){_0x16afc7[_0xb354('0x1c')](0xcc)[_0xb354('0x1d')]();});}};}function handleEntityNotFound(_0x1f193f,_0x36ddb0){return function(_0x63a02b){if(!_0x63a02b){_0x1f193f['sendStatus'](0x194);}return _0x63a02b;};}function handleError(_0x514ca0,_0x1067ba){_0x1067ba=_0x1067ba||0x1f4;return function(_0x4e0063){logger[_0xb354('0x2c')](_0x4e0063[_0xb354('0x2d')]);if(_0x4e0063[_0xb354('0x2e')]){delete _0x4e0063[_0xb354('0x2e')];}_0x514ca0['status'](_0x1067ba)[_0xb354('0x2f')](_0x4e0063);};}exports[_0xb354('0x30')]=function(_0x4c80b0,_0x14dc6f){var _0x4ed14d={},_0x47560c={},_0xa2832e={'count':0x0,'rows':[]};var _0x54efb5=_[_0xb354('0x31')](db['Sound']['rawAttributes'],function(_0x3c3980){return{'name':_0x3c3980[_0xb354('0x32')],'type':_0x3c3980[_0xb354('0x33')][_0xb354('0x34')]};});_0x47560c['model']=_[_0xb354('0x31')](_0x54efb5,_0xb354('0x2e'));_0x47560c[_0xb354('0x35')]=_['keys'](_0x4c80b0['query']);_0x47560c[_0xb354('0x36')]=_[_0xb354('0x37')](_0x47560c['model'],_0x47560c[_0xb354('0x35')]);_0x4ed14d['attributes']=_[_0xb354('0x37')](_0x47560c['model'],qs[_0xb354('0x38')](_0x4c80b0['query'][_0xb354('0x38')]));_0x4ed14d['attributes']=_0x4ed14d[_0xb354('0x39')][_0xb354('0x3a')]?_0x4ed14d[_0xb354('0x39')]:_0x47560c['model'];if(!_0x4c80b0[_0xb354('0x35')]['hasOwnProperty'](_0xb354('0x3b'))){_0x4ed14d[_0xb354('0x21')]=qs['limit'](_0x4c80b0[_0xb354('0x35')][_0xb354('0x21')]);_0x4ed14d[_0xb354('0x1f')]=qs[_0xb354('0x1f')](_0x4c80b0[_0xb354('0x35')][_0xb354('0x1f')]);}_0x4ed14d[_0xb354('0x3c')]=qs[_0xb354('0x3d')](_0x4c80b0['query'][_0xb354('0x3d')]);_0x4ed14d['where']=qs[_0xb354('0x36')](_['pick'](_0x4c80b0['query'],_0x47560c['filters']),_0x54efb5);if(_0x4c80b0[_0xb354('0x35')][_0xb354('0x3e')]){_0x4ed14d[_0xb354('0x3f')]=_[_0xb354('0x40')](_0x4ed14d[_0xb354('0x3f')],{'$or':_[_0xb354('0x31')](_0x54efb5,function(_0x431084){if(_0x431084['type']!=='VIRTUAL'){var _0x14e2ce={};_0x14e2ce[_0x431084[_0xb354('0x2e')]]={'$like':'%'+_0x4c80b0[_0xb354('0x35')]['filter']+'%'};return _0x14e2ce;}})});}_0x4ed14d=_[_0xb354('0x40')]({},_0x4ed14d,_0x4c80b0[_0xb354('0x41')]);var _0x4112c6={'where':_0x4ed14d['where']};return db[_0xb354('0x42')]['count'](_0x4112c6)[_0xb354('0x28')](function(_0x2dc64c){_0xa2832e[_0xb354('0x22')]=_0x2dc64c;if(_0x4c80b0['query'][_0xb354('0x43')]){_0x4ed14d[_0xb354('0x44')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x4ed14d);})['then'](function(_0xff11db){_0xa2832e[_0xb354('0x45')]=_0xff11db;return _0xa2832e;})[_0xb354('0x28')](respondWithFilteredResult(_0x14dc6f,_0x4ed14d))[_0xb354('0x46')](handleError(_0x14dc6f,null));};exports[_0xb354('0x47')]=function(_0x62b1c9,_0x4d06d6){var _0x180022={'raw':!![],'where':{'id':_0x62b1c9[_0xb354('0x48')]['id']}},_0x37948a={};_0x37948a['model']=_[_0xb354('0x49')](db[_0xb354('0x42')][_0xb354('0x4a')]);_0x37948a['query']=_[_0xb354('0x49')](_0x62b1c9['query']);_0x37948a[_0xb354('0x36')]=_[_0xb354('0x37')](_0x37948a[_0xb354('0x4b')],_0x37948a[_0xb354('0x35')]);_0x180022['attributes']=_[_0xb354('0x37')](_0x37948a['model'],qs[_0xb354('0x38')](_0x62b1c9[_0xb354('0x35')][_0xb354('0x38')]));_0x180022[_0xb354('0x39')]=_0x180022['attributes'][_0xb354('0x3a')]?_0x180022[_0xb354('0x39')]:_0x37948a['model'];if(_0x62b1c9[_0xb354('0x35')][_0xb354('0x43')]){_0x180022[_0xb354('0x44')]=[{'all':!![]}];}_0x180022=_['merge']({},_0x180022,_0x62b1c9[_0xb354('0x41')]);return db[_0xb354('0x42')][_0xb354('0x4c')](_0x180022)[_0xb354('0x28')](handleEntityNotFound(_0x4d06d6,null))[_0xb354('0x28')](respondWithResult(_0x4d06d6,null))[_0xb354('0x46')](handleError(_0x4d06d6,null));};exports[_0xb354('0x4d')]=function(_0x467362,_0x3af433,_0x7db7be){return db[_0xb354('0x42')][_0xb354('0x4c')]({'where':{'id':_0x467362['params']['id']},'attributes':[_0xb354('0x2e'),_0xb354('0x4e'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x3af433,null))[_0xb354('0x28')](function(_0x54bcec){if(_0x54bcec){if(!fs['existsSync'](path['join'](config[_0xb354('0x4f')],_0xb354('0x50'),_0x54bcec[_0xb354('0x4e')]+'.'+_0x54bcec[_0xb354('0x51')]))){throw new db[(_0xb354('0x52'))][(_0xb354('0x53'))](_0xb354('0x54'));}return _0x3af433[_0xb354('0x4d')](path['join'](config[_0xb354('0x4f')],_0xb354('0x50'),util[_0xb354('0x55')]('%s.%s',_0x54bcec[_0xb354('0x4e')],_0x54bcec[_0xb354('0x51')])),util[_0xb354('0x55')]('%s.%s',_0x54bcec[_0xb354('0x2e')],_0x54bcec[_0xb354('0x51')]));}return null;})['catch'](handleError(_0x3af433,null));};exports[_0xb354('0x56')]=function(_0x332ec4,_0xbe3e8f,_0x390331){var _0x21a801={'name':path[_0xb354('0x57')](_0x332ec4[_0xb354('0x58')][_0xb354('0x59')],path[_0xb354('0x5a')](_0x332ec4[_0xb354('0x58')][_0xb354('0x59')])),'save_name':path[_0xb354('0x57')](_0x332ec4[_0xb354('0x58')]['filename'],path['extname'](_0x332ec4[_0xb354('0x58')][_0xb354('0x5b')])),'original_format':path['extname'](_0x332ec4['file']['originalname'])[_0xb354('0x5c')](0x1),'converted_format':_0xb354('0x5d')};var _0x3d573e=path['join'](config['root'],'server/files/sounds/original',_0x332ec4['file'][_0xb354('0x5b')]);var _0xf5f582=path[_0xb354('0x5e')](config['root'],_0xb354('0x50'),util[_0xb354('0x55')](_0xb354('0x5f'),path['basename'](_0x332ec4[_0xb354('0x58')][_0xb354('0x5b')],path[_0xb354('0x5a')](_0x332ec4[_0xb354('0x58')]['filename'])),_0x21a801[_0xb354('0x51')]));logger[_0xb354('0x60')]('Sound\x20upload\x20filepath:\x20%s',_0x3d573e);logger[_0xb354('0x60')](_0xb354('0x61'),_0xf5f582);try{fs[_0xb354('0x62')](_0x3d573e,parseInt(_0xb354('0x63'),0x8));var _0x36f1fd=sox[_0xb354('0x64')](_0x3d573e,_0xf5f582,{'sampleRate':0x1f40,'format':_0xb354('0x5d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x36f1fd['on'](_0xb354('0x2c'),function(_0x58a14e){fs['unlinkSync'](_0x3d573e);_0xbe3e8f[_0xb354('0x1c')](0x1f4)[_0xb354('0x2f')](_0x58a14e);});_0x36f1fd['on'](_0xb354('0x65'),function(_0x3b5080){_0x21a801[_0xb354('0x66')]=isNaN(_0x3b5080[_0xb354('0x67')])?null:_0x3b5080[_0xb354('0x67')]*0x3e8;_0x21a801[_0xb354('0x68')]=isNaN(_0x3b5080['sampleCount'])?null:_0x3b5080[_0xb354('0x69')];_0x21a801[_0xb354('0x6a')]=isNaN(_0x3b5080[_0xb354('0x6b')])?null:_0x3b5080[_0xb354('0x6b')];_0x21a801['original_bitRate']=isNaN(_0x3b5080[_0xb354('0x6c')])?null:_0x3b5080[_0xb354('0x6c')];_0x21a801[_0xb354('0x6d')]=isNaN(_0x3b5080[_0xb354('0x6e')])?null:_0x3b5080[_0xb354('0x6e')];});_0x36f1fd['on'](_0xb354('0x6f'),function(_0x3f2827){_0x21a801['converted_duration']=isNaN(_0x3f2827[_0xb354('0x67')])?null:_0x3f2827[_0xb354('0x67')]*0x3e8;_0x21a801['converted_sampleCount']=isNaN(_0x3f2827[_0xb354('0x69')])?null:_0x3f2827['sampleCount'];_0x21a801['converted_channelCount']=isNaN(_0x3f2827[_0xb354('0x6b')])?null:_0x3f2827[_0xb354('0x6b')];_0x21a801[_0xb354('0x70')]=isNaN(_0x3f2827['bitRate'])?null:_0x3f2827[_0xb354('0x6c')];_0x21a801[_0xb354('0x71')]=isNaN(_0x3f2827['sampleRate'])?null:_0x3f2827['sampleRate'];});_0x36f1fd['on'](_0xb354('0x1d'),function(){fs[_0xb354('0x62')](_0xf5f582,parseInt(_0xb354('0x63'),0x8));return db[_0xb354('0x42')]['create'](_0x21a801)['then'](function(_0x2089b6){var _0x3c4d20={'role':_0x332ec4['body']['role'],'userProfileId':_0x332ec4[_0xb354('0x72')][_0xb354('0x73')]};if(!_0x3c4d20)throw new Error(_0xb354('0x74'));if(_0x3c4d20[_0xb354('0x75')]===_0xb354('0x76')){var _0x1dbf07=_0x2089b6[_0xb354('0x77')]({'plain':!![]});return db[_0xb354('0x78')][_0xb354('0x4c')]({'where':{'name':_0xb354('0x2a'),'userProfileId':_0x3c4d20['userProfileId']},'raw':!![]})['then'](function(_0x3721bd){if(_0x3721bd&&_0x3721bd[_0xb354('0x79')]===0x0){return db[_0xb354('0x2b')][_0xb354('0x56')]({'name':_0x1dbf07[_0xb354('0x2e')],'resourceId':_0x1dbf07['id'],'type':_0x3721bd[_0xb354('0x2e')],'sectionId':_0x3721bd['id']},{})['then'](function(){return _0x2089b6;});}else{return _0x2089b6;}})[_0xb354('0x46')](function(_0x6817d0){logger[_0xb354('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x6817d0);throw _0x6817d0;});}return _0x2089b6;})[_0xb354('0x28')](respondWithResult(_0xbe3e8f,null))[_0xb354('0x46')](handleError(_0xbe3e8f,null));});_0x36f1fd['start']();}catch(_0x31c17d){_0xbe3e8f[_0xb354('0x1c')](0x1f4)['send'](_0x31c17d);}};exports[_0xb354('0x27')]=function(_0x9cdf02,_0x43dc6c,_0x328c5c){return db[_0xb354('0x42')][_0xb354('0x4c')]({'where':{'id':_0x9cdf02[_0xb354('0x48')]['id']}})[_0xb354('0x28')](handleEntityNotFound(_0x43dc6c,null))[_0xb354('0x28')](saveUpdates(_[_0xb354('0x7a')](_0x9cdf02[_0xb354('0x72')],['name',_0xb354('0x7b')]),null))['then'](respondWithResult(_0x43dc6c,null))[_0xb354('0x46')](handleError(_0x43dc6c,null));};exports[_0xb354('0x7c')]=function(_0x1ae5ac,_0x39c750,_0x488228){return db[_0xb354('0x42')][_0xb354('0x4c')]({'where':{'id':_0x1ae5ac['params']['id']}})['then'](function(_0xb511f6){if(_0xb511f6){return _0xb511f6['destroy']();}})[_0xb354('0x28')](function(_0x5a124b){var _0x1d8e2b=path[_0xb354('0x5e')](config[_0xb354('0x4f')],_0xb354('0x7d'),util[_0xb354('0x55')]('%s.%s',_0x5a124b['save_name'],_0x5a124b[_0xb354('0x7e')]));var _0x8911b3=path[_0xb354('0x5e')](config[_0xb354('0x4f')],'server/files/sounds/converted',util['format'](_0xb354('0x5f'),_0x5a124b['save_name'],_0x5a124b[_0xb354('0x51')]));fs[_0xb354('0x7f')](_0x1d8e2b);fs[_0xb354('0x7f')](_0x8911b3);return _0x5a124b;})[_0xb354('0x28')](function(_0x564d8f){if(_0x564d8f){return _0x39c750[_0xb354('0x1c')](0xcc)['end']();}})[_0xb354('0x28')](handleEntityNotFound(_0x39c750,null))[_0xb354('0x46')](handleError(_0x39c750,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 2e7337d..31d809b 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 _0x74a5=['request-promise','./sound.attributes','define','Sound','tools_sounds','lodash','util','../../config/logger','moment','bluebird'];(function(_0xaf4e3b,_0x3527ac){var _0x37a1e1=function(_0x49dc7f){while(--_0x49dc7f){_0xaf4e3b['push'](_0xaf4e3b['shift']());}};_0x37a1e1(++_0x3527ac);}(_0x74a5,0xf5));var _0x574a=function(_0x1ff257,_0x4eb105){_0x1ff257=_0x1ff257-0x0;var _0x1abaa9=_0x74a5[_0x1ff257];return _0x1abaa9;};'use strict';var _=require(_0x574a('0x0'));var util=require(_0x574a('0x1'));var logger=require(_0x574a('0x2'))('api');var moment=require(_0x574a('0x3'));var BPromise=require(_0x574a('0x4'));var rp=require(_0x574a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x574a('0x6'));module['exports']=function(_0x5eeee6,_0x1a7a99){return _0x5eeee6[_0x574a('0x7')](_0x574a('0x8'),attributes,{'tableName':_0x574a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b4d=['moment','bluebird','../../config/environment','./sound.attributes','exports','Sound','lodash','util'];(function(_0x22386f,_0x38d739){var _0x20bade=function(_0x5dee70){while(--_0x5dee70){_0x22386f['push'](_0x22386f['shift']());}};_0x20bade(++_0x38d739);}(_0x0b4d,0x1be));var _0xd0b4=function(_0x1183da,_0x1534a4){_0x1183da=_0x1183da-0x0;var _0x18b71e=_0x0b4d[_0x1183da];return _0x18b71e;};'use strict';var _=require(_0xd0b4('0x0'));var util=require(_0xd0b4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd0b4('0x2'));var BPromise=require(_0xd0b4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd0b4('0x4'));var attributes=require(_0xd0b4('0x5'));module[_0xd0b4('0x6')]=function(_0x5325fd,_0x51d569){return _0x5325fd['define'](_0xd0b4('0x7'),attributes,{'tableName':'tools_sounds','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 b71ddc1..ccc00c7 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 _0xeea4=['include','map','model','stringify','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','ShowSound','Sound','find','options','raw','where','attributes'];(function(_0x4439ee,_0x58676d){var _0x481430=function(_0x21ae0c){while(--_0x21ae0c){_0x4439ee['push'](_0x4439ee['shift']());}};_0x481430(++_0x58676d);}(_0xeea4,0x1a8));var _0x4eea=function(_0x4b251d,_0x370bf4){_0x4b251d=_0x4b251d-0x0;var _0x32259e=_0xeea4[_0x4b251d];return _0x32259e;};'use strict';var _=require(_0x4eea('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4eea('0x1'));var fs=require('fs');var Redis=require(_0x4eea('0x2'));var db=require(_0x4eea('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4eea('0x4'))('rpc');var config=require(_0x4eea('0x5'));var jayson=require(_0x4eea('0x6'));var client=jayson['client'][_0x4eea('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x18c2fc,_0x440b5e,_0x249767){return new BPromise(function(_0x2a6294,_0x364707){return client[_0x4eea('0x8')](_0x18c2fc,_0x249767)[_0x4eea('0x9')](function(_0x2288e4){logger['info'](_0x4eea('0xa'),_0x440b5e,_0x4eea('0xb'));logger[_0x4eea('0xc')](_0x4eea('0xd'),_0x440b5e,_0x4eea('0xb'),JSON['stringify'](_0x2288e4));if(_0x2288e4[_0x4eea('0xe')]){if(_0x2288e4['error']['code']===0x1f4){logger[_0x4eea('0xe')](_0x4eea('0xa'),_0x440b5e,_0x2288e4[_0x4eea('0xe')][_0x4eea('0xf')]);return _0x364707(_0x2288e4[_0x4eea('0xe')][_0x4eea('0xf')]);}logger[_0x4eea('0xe')]('Sound,\x20%s,\x20%s',_0x440b5e,_0x2288e4['error']['message']);return _0x2a6294(_0x2288e4[_0x4eea('0xe')][_0x4eea('0xf')]);}else{logger[_0x4eea('0x10')]('Sound,\x20%s,\x20%s',_0x440b5e,_0x4eea('0xb'));_0x2a6294(_0x2288e4[_0x4eea('0x11')][_0x4eea('0xf')]);}})[_0x4eea('0x12')](function(_0x14167){logger[_0x4eea('0xe')](_0x4eea('0xa'),_0x440b5e,_0x14167);_0x364707(_0x14167);});});}exports[_0x4eea('0x13')]=function(_0x4714fd){var _0x5240fd=this;return new Promise(function(_0x48c315,_0x475149){return db[_0x4eea('0x14')][_0x4eea('0x15')]({'raw':_0x4714fd[_0x4eea('0x16')]?_0x4714fd[_0x4eea('0x16')][_0x4eea('0x17')]===undefined?!![]:![]:!![],'where':_0x4714fd[_0x4eea('0x16')]?_0x4714fd[_0x4eea('0x16')][_0x4eea('0x18')]||null:null,'attributes':_0x4714fd[_0x4eea('0x16')]?_0x4714fd['options'][_0x4eea('0x19')]||null:null,'include':_0x4714fd['options']?_0x4714fd['options'][_0x4eea('0x1a')]?_[_0x4eea('0x1b')](_0x4714fd['options']['include'],function(_0x377418){return{'model':db[_0x377418[_0x4eea('0x1c')]],'as':_0x377418['as'],'attributes':_0x377418[_0x4eea('0x19')],'include':_0x377418['include']?_['map'](_0x377418['include'],function(_0x1506a1){return{'model':db[_0x1506a1[_0x4eea('0x1c')]],'as':_0x1506a1['as'],'attributes':_0x1506a1[_0x4eea('0x19')],'include':_0x1506a1[_0x4eea('0x1a')]?_[_0x4eea('0x1b')](_0x1506a1[_0x4eea('0x1a')],function(_0x5ab318){return{'model':db[_0x5ab318[_0x4eea('0x1c')]],'as':_0x5ab318['as'],'attributes':_0x5ab318['attributes']};}):[]};}):[]};}):[]:[]})[_0x4eea('0x9')](function(_0x1a63e6){logger[_0x4eea('0x10')](_0x4eea('0x13'),_0x4714fd);logger[_0x4eea('0xc')](_0x4eea('0x13'),_0x4714fd,JSON[_0x4eea('0x1d')](_0x1a63e6));_0x48c315(_0x1a63e6);})[_0x4eea('0x12')](function(_0x182b0b){logger['error'](_0x4eea('0x13'),_0x182b0b[_0x4eea('0xf')],_0x4714fd);_0x475149(_0x5240fd['error'](0x1f4,_0x182b0b['message']));});});}; \ No newline at end of file +var _0x3135=['Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','attributes','include','map','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x138279,_0x630c35){var _0x36e90d=function(_0x586524){while(--_0x586524){_0x138279['push'](_0x138279['shift']());}};_0x36e90d(++_0x630c35);}(_0x3135,0x187));var _0x5313=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3135[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5313('0x0'));var util=require(_0x5313('0x1'));var moment=require('moment');var BPromise=require(_0x5313('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5313('0x3'));var db=require(_0x5313('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5313('0x5'));var jayson=require(_0x5313('0x6'));var client=jayson[_0x5313('0x7')][_0x5313('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x762e2e,_0x39c9a0,_0x38c170){return new BPromise(function(_0xf8c790,_0x317248){return client[_0x5313('0x9')](_0x762e2e,_0x38c170)[_0x5313('0xa')](function(_0x5ae421){logger[_0x5313('0xb')](_0x5313('0xc'),_0x39c9a0,'request\x20sent');logger[_0x5313('0xd')](_0x5313('0xe'),_0x39c9a0,_0x5313('0xf'),JSON[_0x5313('0x10')](_0x5ae421));if(_0x5ae421[_0x5313('0x11')]){if(_0x5ae421[_0x5313('0x11')][_0x5313('0x12')]===0x1f4){logger[_0x5313('0x11')](_0x5313('0xc'),_0x39c9a0,_0x5ae421['error'][_0x5313('0x13')]);return _0x317248(_0x5ae421[_0x5313('0x11')]['message']);}logger['error'](_0x5313('0xc'),_0x39c9a0,_0x5ae421[_0x5313('0x11')]['message']);return _0xf8c790(_0x5ae421[_0x5313('0x11')]['message']);}else{logger[_0x5313('0xb')](_0x5313('0xc'),_0x39c9a0,'request\x20sent');_0xf8c790(_0x5ae421[_0x5313('0x14')][_0x5313('0x13')]);}})[_0x5313('0x15')](function(_0x5e53d6){logger['error'](_0x5313('0xc'),_0x39c9a0,_0x5e53d6);_0x317248(_0x5e53d6);});});}exports[_0x5313('0x16')]=function(_0x184744){var _0x22dfc8=this;return new Promise(function(_0x2067b1,_0x5c563c){return db[_0x5313('0x17')]['find']({'raw':_0x184744[_0x5313('0x18')]?_0x184744['options'][_0x5313('0x19')]===undefined?!![]:![]:!![],'where':_0x184744[_0x5313('0x18')]?_0x184744['options'][_0x5313('0x1a')]||null:null,'attributes':_0x184744[_0x5313('0x18')]?_0x184744[_0x5313('0x18')][_0x5313('0x1b')]||null:null,'include':_0x184744[_0x5313('0x18')]?_0x184744[_0x5313('0x18')][_0x5313('0x1c')]?_[_0x5313('0x1d')](_0x184744[_0x5313('0x18')]['include'],function(_0x19751d){return{'model':db[_0x19751d[_0x5313('0x1e')]],'as':_0x19751d['as'],'attributes':_0x19751d[_0x5313('0x1b')],'include':_0x19751d['include']?_[_0x5313('0x1d')](_0x19751d['include'],function(_0x263471){return{'model':db[_0x263471[_0x5313('0x1e')]],'as':_0x263471['as'],'attributes':_0x263471[_0x5313('0x1b')],'include':_0x263471[_0x5313('0x1c')]?_[_0x5313('0x1d')](_0x263471[_0x5313('0x1c')],function(_0xdeb68e){return{'model':db[_0xdeb68e['model']],'as':_0xdeb68e['as'],'attributes':_0xdeb68e['attributes']};}):[]};}):[]};}):[]:[]})[_0x5313('0xa')](function(_0x3e0f79){logger['info']('ShowSound',_0x184744);logger[_0x5313('0xd')]('ShowSound',_0x184744,JSON[_0x5313('0x10')](_0x3e0f79));_0x2067b1(_0x3e0f79);})[_0x5313('0x15')](function(_0x213ba3){logger[_0x5313('0x11')](_0x5313('0x16'),_0x213ba3['message'],_0x184744);_0x5c563c(_0x22dfc8['error'](0x1f4,_0x213ba3[_0x5313('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 9ef51a7..d95cb0c 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 _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(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0x4fc2,0x111));var _0x24fc=function(_0x265b89,_0x3b9dde){_0x265b89=_0x265b89-0x0;var _0x3d972c=_0x4fc2[_0x265b89];return _0x3d972c;};'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 +var _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x786e9,_0x1a029){var _0x1f891b=function(_0x31ad7c){while(--_0x31ad7c){_0x786e9['push'](_0x786e9['shift']());}};_0x1f891b(++_0x1a029);}(_0x8603,0x190));var _0x3860=function(_0x3cab7e,_0x4718bc){_0x3cab7e=_0x3cab7e-0x0;var _0x5b14ea=_0x8603[_0x3cab7e];return _0x5b14ea;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 4c50ba1..dc19c59 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 _0x5d75=['exports','STRING','TEXT','ENUM','out','sequelize'];(function(_0x26efac,_0x21ab8a){var _0x8482e4=function(_0x14db32){while(--_0x14db32){_0x26efac['push'](_0x26efac['shift']());}};_0x8482e4(++_0x21ab8a);}(_0x5d75,0x107));var _0x55d7=function(_0x16bb10,_0x570445){_0x16bb10=_0x16bb10-0x0;var _0x2b63eb=_0x5d75[_0x16bb10];return _0x2b63eb;};'use strict';var Sequelize=require(_0x55d7('0x0'));module[_0x55d7('0x1')]={'uniqueid':{'type':Sequelize[_0x55d7('0x2')]},'body':{'type':Sequelize[_0x55d7('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x55d7('0x4')]('in',_0x55d7('0x5')),'defaultValue':_0x55d7('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x55d7('0x3')]}}; \ No newline at end of file +var _0xcea3=['medium','ENUM','out','TEXT','sequelize','exports','STRING'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xcea3,0x1e7));var _0x3cea=function(_0x38b541,_0x3494bb){_0x38b541=_0x38b541-0x0;var _0x15accd=_0xcea3[_0x38b541];return _0x15accd;};'use strict';var Sequelize=require(_0x3cea('0x0'));module[_0x3cea('0x1')]={'uniqueid':{'type':Sequelize[_0x3cea('0x2')]},'body':{'type':Sequelize['TEXT'](_0x3cea('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x3cea('0x4')]('in','out'),'defaultValue':_0x3cea('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x3cea('0x2')]},'providerResponse':{'type':Sequelize[_0x3cea('0x6')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index ee54679..fca8a64 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 _0x5d5c=['rows','show','params','find','catch','create','body','eml-format','rimraf','request-promise','moment','bluebird','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','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d5c,0xee));var _0xc5d5=function(_0x3aa12a,_0x334658){_0x3aa12a=_0x3aa12a-0x0;var _0xca7ba8=_0x5d5c[_0x3aa12a];return _0xca7ba8;};'use strict';var emlformat=require(_0xc5d5('0x0'));var rimraf=require(_0xc5d5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc5d5('0x2'));var moment=require(_0xc5d5('0x3'));var BPromise=require(_0xc5d5('0x4'));var Mustache=require(_0xc5d5('0x5'));var util=require(_0xc5d5('0x6'));var path=require(_0xc5d5('0x7'));var sox=require(_0xc5d5('0x8'));var csv=require(_0xc5d5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc5d5('0xa'));var _=require(_0xc5d5('0xb'));var squel=require(_0xc5d5('0xc'));var crypto=require(_0xc5d5('0xd'));var jsforce=require(_0xc5d5('0xe'));var deskjs=require(_0xc5d5('0xf'));var toCsv=require(_0xc5d5('0x9'));var querystring=require(_0xc5d5('0x10'));var Papa=require(_0xc5d5('0x11'));var Redis=require(_0xc5d5('0x12'));var authService=require(_0xc5d5('0x13'));var qs=require(_0xc5d5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5d5('0x15'));var logger=require(_0xc5d5('0x16'))(_0xc5d5('0x17'));var utils=require(_0xc5d5('0x18'));var config=require(_0xc5d5('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc5d5('0x1a'))['db'];function respondWithStatusCode(_0x15c597,_0x589ced){_0x589ced=_0x589ced||0xcc;return function(_0x26e0dd){if(_0x26e0dd){return _0x15c597['sendStatus'](_0x589ced);}return _0x15c597[_0xc5d5('0x1b')](_0x589ced)[_0xc5d5('0x1c')]();};}function respondWithResult(_0x30f217,_0x1e6f14){_0x1e6f14=_0x1e6f14||0xc8;return function(_0x549683){if(_0x549683){return _0x30f217[_0xc5d5('0x1b')](_0x1e6f14)[_0xc5d5('0x1d')](_0x549683);}};}function respondWithFilteredResult(_0x422738,_0xd03235){return function(_0x1fb313){if(_0x1fb313){var _0x11dbef=typeof _0xd03235[_0xc5d5('0x1e')]===_0xc5d5('0x1f')&&typeof _0xd03235['limit']==='undefined';var _0x1c6462=_0x1fb313[_0xc5d5('0x20')];var _0x58b38c=_0x11dbef?0x0:_0xd03235[_0xc5d5('0x1e')];var _0x209ec7=_0x11dbef?_0x1fb313['count']:_0xd03235[_0xc5d5('0x1e')]+_0xd03235[_0xc5d5('0x21')];var _0x416569;if(_0x209ec7>=_0x1c6462){_0x209ec7=_0x1c6462;_0x416569=0xc8;}else{_0x416569=0xce;}_0x422738[_0xc5d5('0x1b')](_0x416569);return _0x422738[_0xc5d5('0x22')](_0xc5d5('0x23'),_0x58b38c+'-'+_0x209ec7+'/'+_0x1c6462)[_0xc5d5('0x1d')](_0x1fb313);}return null;};}function patchUpdates(_0x2f6ac3){return function(_0x441692){try{jsonpatch['apply'](_0x441692,_0x2f6ac3,!![]);}catch(_0x290368){return BPromise[_0xc5d5('0x24')](_0x290368);}return _0x441692[_0xc5d5('0x25')]();};}function saveUpdates(_0x91f786,_0x2e455e){return function(_0x23549d){if(_0x23549d){return _0x23549d[_0xc5d5('0x26')](_0x91f786)[_0xc5d5('0x27')](function(_0x4337c8){return _0x4337c8;});}return null;};}function removeEntity(_0x4b6664,_0x9c252e){return function(_0x2ea350){if(_0x2ea350){return _0x2ea350[_0xc5d5('0x28')]()['then'](function(){_0x4b6664[_0xc5d5('0x1b')](0xcc)[_0xc5d5('0x1c')]();});}};}function handleEntityNotFound(_0x2e4a5f,_0x338c1e){return function(_0x35b8f9){if(!_0x35b8f9){_0x2e4a5f['sendStatus'](0x194);}return _0x35b8f9;};}function handleError(_0x5f77c6,_0x778335){_0x778335=_0x778335||0x1f4;return function(_0x428f41){logger[_0xc5d5('0x29')](_0x428f41[_0xc5d5('0x2a')]);if(_0x428f41[_0xc5d5('0x2b')]){delete _0x428f41[_0xc5d5('0x2b')];}_0x5f77c6[_0xc5d5('0x1b')](_0x778335)[_0xc5d5('0x2c')](_0x428f41);};}exports[_0xc5d5('0x2d')]=function(_0x46d9a4,_0x1e26ba){var _0x29b201={},_0x3236c5={},_0x5b225f={'count':0x0,'rows':[]};var _0x1b56b0=_[_0xc5d5('0x2e')](db[_0xc5d5('0x2f')][_0xc5d5('0x30')],function(_0x1c05db){return{'name':_0x1c05db[_0xc5d5('0x31')],'type':_0x1c05db['type'][_0xc5d5('0x32')]};});_0x3236c5[_0xc5d5('0x33')]=_[_0xc5d5('0x2e')](_0x1b56b0,_0xc5d5('0x2b'));_0x3236c5['query']=_[_0xc5d5('0x34')](_0x46d9a4[_0xc5d5('0x35')]);_0x3236c5[_0xc5d5('0x36')]=_[_0xc5d5('0x37')](_0x3236c5[_0xc5d5('0x33')],_0x3236c5[_0xc5d5('0x35')]);_0x29b201[_0xc5d5('0x38')]=_['intersection'](_0x3236c5[_0xc5d5('0x33')],qs[_0xc5d5('0x39')](_0x46d9a4[_0xc5d5('0x35')][_0xc5d5('0x39')]));_0x29b201[_0xc5d5('0x38')]=_0x29b201[_0xc5d5('0x38')]['length']?_0x29b201[_0xc5d5('0x38')]:_0x3236c5[_0xc5d5('0x33')];if(!_0x46d9a4[_0xc5d5('0x35')][_0xc5d5('0x3a')](_0xc5d5('0x3b'))){_0x29b201[_0xc5d5('0x21')]=qs[_0xc5d5('0x21')](_0x46d9a4[_0xc5d5('0x35')]['limit']);_0x29b201[_0xc5d5('0x1e')]=qs[_0xc5d5('0x1e')](_0x46d9a4['query'][_0xc5d5('0x1e')]);}_0x29b201[_0xc5d5('0x3c')]=qs[_0xc5d5('0x3d')](_0x46d9a4[_0xc5d5('0x35')]['sort']);_0x29b201[_0xc5d5('0x3e')]=qs['filters'](_[_0xc5d5('0x3f')](_0x46d9a4[_0xc5d5('0x35')],_0x3236c5[_0xc5d5('0x36')]),_0x1b56b0);if(_0x46d9a4[_0xc5d5('0x35')][_0xc5d5('0x40')]){_0x29b201['where']=_['merge'](_0x29b201[_0xc5d5('0x3e')],{'$or':_[_0xc5d5('0x2e')](_0x1b56b0,function(_0x3f9457){if(_0x3f9457['type']!=='VIRTUAL'){var _0x4e2c37={};_0x4e2c37[_0x3f9457[_0xc5d5('0x2b')]]={'$like':'%'+_0x46d9a4[_0xc5d5('0x35')][_0xc5d5('0x40')]+'%'};return _0x4e2c37;}})});}_0x29b201=_[_0xc5d5('0x41')]({},_0x29b201,_0x46d9a4[_0xc5d5('0x42')]);var _0x526f37={'where':_0x29b201[_0xc5d5('0x3e')]};return db[_0xc5d5('0x2f')][_0xc5d5('0x20')](_0x526f37)['then'](function(_0x4fc420){_0x5b225f[_0xc5d5('0x20')]=_0x4fc420;if(_0x46d9a4['query'][_0xc5d5('0x43')]){_0x29b201[_0xc5d5('0x44')]=[{'all':!![]}];}return db[_0xc5d5('0x2f')][_0xc5d5('0x45')](_0x29b201);})[_0xc5d5('0x27')](function(_0x55c971){_0x5b225f[_0xc5d5('0x46')]=_0x55c971;return _0x5b225f;})['then'](respondWithFilteredResult(_0x1e26ba,_0x29b201))['catch'](handleError(_0x1e26ba,null));};exports[_0xc5d5('0x47')]=function(_0x287efe,_0x199a2f){var _0x182057={'raw':!![],'where':{'id':_0x287efe[_0xc5d5('0x48')]['id']}},_0x3319d2={};_0x3319d2[_0xc5d5('0x33')]=_[_0xc5d5('0x34')](db['SquareMessage'][_0xc5d5('0x30')]);_0x3319d2[_0xc5d5('0x35')]=_['keys'](_0x287efe[_0xc5d5('0x35')]);_0x3319d2[_0xc5d5('0x36')]=_['intersection'](_0x3319d2[_0xc5d5('0x33')],_0x3319d2[_0xc5d5('0x35')]);_0x182057[_0xc5d5('0x38')]=_[_0xc5d5('0x37')](_0x3319d2[_0xc5d5('0x33')],qs[_0xc5d5('0x39')](_0x287efe['query']['fields']));_0x182057[_0xc5d5('0x38')]=_0x182057[_0xc5d5('0x38')]['length']?_0x182057[_0xc5d5('0x38')]:_0x3319d2[_0xc5d5('0x33')];if(_0x287efe[_0xc5d5('0x35')][_0xc5d5('0x43')]){_0x182057['include']=[{'all':!![]}];}_0x182057=_[_0xc5d5('0x41')]({},_0x182057,_0x287efe[_0xc5d5('0x42')]);return db[_0xc5d5('0x2f')][_0xc5d5('0x49')](_0x182057)[_0xc5d5('0x27')](handleEntityNotFound(_0x199a2f,null))[_0xc5d5('0x27')](respondWithResult(_0x199a2f,null))[_0xc5d5('0x4a')](handleError(_0x199a2f,null));};exports['create']=function(_0x214e6f,_0x52d532){return db[_0xc5d5('0x2f')][_0xc5d5('0x4b')](_0x214e6f[_0xc5d5('0x4c')],{})['then'](respondWithResult(_0x52d532,0xc9))[_0xc5d5('0x4a')](handleError(_0x52d532,null));};exports[_0xc5d5('0x26')]=function(_0xb77f13,_0x57e747){if(_0xb77f13[_0xc5d5('0x4c')]['id']){delete _0xb77f13[_0xc5d5('0x4c')]['id'];}return db[_0xc5d5('0x2f')]['find']({'where':{'id':_0xb77f13[_0xc5d5('0x48')]['id']}})[_0xc5d5('0x27')](handleEntityNotFound(_0x57e747,null))[_0xc5d5('0x27')](saveUpdates(_0xb77f13[_0xc5d5('0x4c')],null))['then'](respondWithResult(_0x57e747,null))[_0xc5d5('0x4a')](handleError(_0x57e747,null));};exports[_0xc5d5('0x28')]=function(_0x4e40db,_0x384c3a){return db[_0xc5d5('0x2f')][_0xc5d5('0x49')]({'where':{'id':_0x4e40db[_0xc5d5('0x48')]['id']}})[_0xc5d5('0x27')](handleEntityNotFound(_0x384c3a,null))[_0xc5d5('0x27')](removeEntity(_0x384c3a,null))[_0xc5d5('0x4a')](handleError(_0x384c3a,null));}; \ No newline at end of file +var _0x2515=['util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../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','save','update','then','error','stack','name','index','SquareMessage','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','filter','options','include','rows','catch','show','find','create','body','destroy','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2515,0x1c2));var _0x5251=function(_0x223fd2,_0x40b449){_0x223fd2=_0x223fd2-0x0;var _0x5d1701=_0x2515[_0x223fd2];return _0x5d1701;};'use strict';var emlformat=require(_0x5251('0x0'));var rimraf=require(_0x5251('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5251('0x2'));var rp=require(_0x5251('0x3'));var moment=require(_0x5251('0x4'));var BPromise=require(_0x5251('0x5'));var Mustache=require('mustache');var util=require(_0x5251('0x6'));var path=require(_0x5251('0x7'));var sox=require('sox');var csv=require(_0x5251('0x8'));var ejs=require(_0x5251('0x9'));var fs=require('fs');var fs_extra=require(_0x5251('0xa'));var _=require(_0x5251('0xb'));var squel=require(_0x5251('0xc'));var crypto=require(_0x5251('0xd'));var jsforce=require(_0x5251('0xe'));var deskjs=require(_0x5251('0xf'));var toCsv=require(_0x5251('0x8'));var querystring=require(_0x5251('0x10'));var Papa=require(_0x5251('0x11'));var Redis=require(_0x5251('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5251('0x13'));var as=require(_0x5251('0x14'));var hardwareService=require(_0x5251('0x15'));var logger=require('../../config/logger')(_0x5251('0x16'));var utils=require(_0x5251('0x17'));var config=require(_0x5251('0x18'));var licenseUtil=require(_0x5251('0x19'));var db=require(_0x5251('0x1a'))['db'];function respondWithStatusCode(_0x35bcad,_0x32a518){_0x32a518=_0x32a518||0xcc;return function(_0x2d2488){if(_0x2d2488){return _0x35bcad[_0x5251('0x1b')](_0x32a518);}return _0x35bcad[_0x5251('0x1c')](_0x32a518)[_0x5251('0x1d')]();};}function respondWithResult(_0xa0c768,_0xe926ce){_0xe926ce=_0xe926ce||0xc8;return function(_0x37c8cd){if(_0x37c8cd){return _0xa0c768[_0x5251('0x1c')](_0xe926ce)[_0x5251('0x1e')](_0x37c8cd);}};}function respondWithFilteredResult(_0x2fef30,_0x283ca1){return function(_0x1010f7){if(_0x1010f7){var _0x5660a7=typeof _0x283ca1[_0x5251('0x1f')]===_0x5251('0x20')&&typeof _0x283ca1[_0x5251('0x21')]===_0x5251('0x20');var _0x781054=_0x1010f7[_0x5251('0x22')];var _0x3c12d5=_0x5660a7?0x0:_0x283ca1[_0x5251('0x1f')];var _0x382470=_0x5660a7?_0x1010f7[_0x5251('0x22')]:_0x283ca1[_0x5251('0x1f')]+_0x283ca1['limit'];var _0x7c58b0;if(_0x382470>=_0x781054){_0x382470=_0x781054;_0x7c58b0=0xc8;}else{_0x7c58b0=0xce;}_0x2fef30[_0x5251('0x1c')](_0x7c58b0);return _0x2fef30[_0x5251('0x23')](_0x5251('0x24'),_0x3c12d5+'-'+_0x382470+'/'+_0x781054)['json'](_0x1010f7);}return null;};}function patchUpdates(_0x3e7d9d){return function(_0x230c2b){try{jsonpatch[_0x5251('0x25')](_0x230c2b,_0x3e7d9d,!![]);}catch(_0x24b19c){return BPromise[_0x5251('0x26')](_0x24b19c);}return _0x230c2b[_0x5251('0x27')]();};}function saveUpdates(_0x495f8d,_0xf95bc5){return function(_0x4e6fe7){if(_0x4e6fe7){return _0x4e6fe7[_0x5251('0x28')](_0x495f8d)[_0x5251('0x29')](function(_0x323b34){return _0x323b34;});}return null;};}function removeEntity(_0x5596ac,_0x2c5f46){return function(_0x11cff9){if(_0x11cff9){return _0x11cff9['destroy']()[_0x5251('0x29')](function(){_0x5596ac[_0x5251('0x1c')](0xcc)[_0x5251('0x1d')]();});}};}function handleEntityNotFound(_0x2adfc8,_0x2b8e0f){return function(_0x47c659){if(!_0x47c659){_0x2adfc8['sendStatus'](0x194);}return _0x47c659;};}function handleError(_0x1ba533,_0x11aee7){_0x11aee7=_0x11aee7||0x1f4;return function(_0x5bd203){logger[_0x5251('0x2a')](_0x5bd203[_0x5251('0x2b')]);if(_0x5bd203[_0x5251('0x2c')]){delete _0x5bd203[_0x5251('0x2c')];}_0x1ba533[_0x5251('0x1c')](_0x11aee7)['send'](_0x5bd203);};}exports[_0x5251('0x2d')]=function(_0x1713e8,_0x438d02){var _0x4cef03={},_0x19b3ad={},_0xfbe7cd={'count':0x0,'rows':[]};var _0x326d0d=_['map'](db[_0x5251('0x2e')][_0x5251('0x2f')],function(_0x17c450){return{'name':_0x17c450['fieldName'],'type':_0x17c450[_0x5251('0x30')][_0x5251('0x31')]};});_0x19b3ad[_0x5251('0x32')]=_[_0x5251('0x33')](_0x326d0d,'name');_0x19b3ad[_0x5251('0x34')]=_[_0x5251('0x35')](_0x1713e8[_0x5251('0x34')]);_0x19b3ad['filters']=_[_0x5251('0x36')](_0x19b3ad[_0x5251('0x32')],_0x19b3ad[_0x5251('0x34')]);_0x4cef03[_0x5251('0x37')]=_['intersection'](_0x19b3ad[_0x5251('0x32')],qs[_0x5251('0x38')](_0x1713e8[_0x5251('0x34')][_0x5251('0x38')]));_0x4cef03[_0x5251('0x37')]=_0x4cef03[_0x5251('0x37')][_0x5251('0x39')]?_0x4cef03[_0x5251('0x37')]:_0x19b3ad['model'];if(!_0x1713e8[_0x5251('0x34')][_0x5251('0x3a')](_0x5251('0x3b'))){_0x4cef03['limit']=qs[_0x5251('0x21')](_0x1713e8['query']['limit']);_0x4cef03[_0x5251('0x1f')]=qs[_0x5251('0x1f')](_0x1713e8[_0x5251('0x34')][_0x5251('0x1f')]);}_0x4cef03[_0x5251('0x3c')]=qs[_0x5251('0x3d')](_0x1713e8['query'][_0x5251('0x3d')]);_0x4cef03['where']=qs[_0x5251('0x3e')](_['pick'](_0x1713e8[_0x5251('0x34')],_0x19b3ad['filters']),_0x326d0d);if(_0x1713e8[_0x5251('0x34')]['filter']){_0x4cef03[_0x5251('0x3f')]=_[_0x5251('0x40')](_0x4cef03[_0x5251('0x3f')],{'$or':_[_0x5251('0x33')](_0x326d0d,function(_0x1e61cf){if(_0x1e61cf['type']!=='VIRTUAL'){var _0x6cda40={};_0x6cda40[_0x1e61cf[_0x5251('0x2c')]]={'$like':'%'+_0x1713e8[_0x5251('0x34')][_0x5251('0x41')]+'%'};return _0x6cda40;}})});}_0x4cef03=_[_0x5251('0x40')]({},_0x4cef03,_0x1713e8[_0x5251('0x42')]);var _0x2d3d44={'where':_0x4cef03['where']};return db[_0x5251('0x2e')][_0x5251('0x22')](_0x2d3d44)[_0x5251('0x29')](function(_0x5bb327){_0xfbe7cd['count']=_0x5bb327;if(_0x1713e8[_0x5251('0x34')]['includeAll']){_0x4cef03[_0x5251('0x43')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x4cef03);})['then'](function(_0x1ac1aa){_0xfbe7cd[_0x5251('0x44')]=_0x1ac1aa;return _0xfbe7cd;})['then'](respondWithFilteredResult(_0x438d02,_0x4cef03))[_0x5251('0x45')](handleError(_0x438d02,null));};exports[_0x5251('0x46')]=function(_0x3d0526,_0x1fd128){var _0x532d5e={'raw':!![],'where':{'id':_0x3d0526['params']['id']}},_0x30cf1a={};_0x30cf1a[_0x5251('0x32')]=_['keys'](db[_0x5251('0x2e')][_0x5251('0x2f')]);_0x30cf1a[_0x5251('0x34')]=_['keys'](_0x3d0526[_0x5251('0x34')]);_0x30cf1a[_0x5251('0x3e')]=_[_0x5251('0x36')](_0x30cf1a[_0x5251('0x32')],_0x30cf1a[_0x5251('0x34')]);_0x532d5e[_0x5251('0x37')]=_['intersection'](_0x30cf1a['model'],qs[_0x5251('0x38')](_0x3d0526['query'][_0x5251('0x38')]));_0x532d5e[_0x5251('0x37')]=_0x532d5e[_0x5251('0x37')][_0x5251('0x39')]?_0x532d5e[_0x5251('0x37')]:_0x30cf1a[_0x5251('0x32')];if(_0x3d0526[_0x5251('0x34')]['includeAll']){_0x532d5e[_0x5251('0x43')]=[{'all':!![]}];}_0x532d5e=_[_0x5251('0x40')]({},_0x532d5e,_0x3d0526[_0x5251('0x42')]);return db[_0x5251('0x2e')][_0x5251('0x47')](_0x532d5e)[_0x5251('0x29')](handleEntityNotFound(_0x1fd128,null))['then'](respondWithResult(_0x1fd128,null))['catch'](handleError(_0x1fd128,null));};exports[_0x5251('0x48')]=function(_0x366e7f,_0xc983db){return db[_0x5251('0x2e')][_0x5251('0x48')](_0x366e7f['body'],{})['then'](respondWithResult(_0xc983db,0xc9))['catch'](handleError(_0xc983db,null));};exports[_0x5251('0x28')]=function(_0x277163,_0x28fff1){if(_0x277163[_0x5251('0x49')]['id']){delete _0x277163['body']['id'];}return db['SquareMessage'][_0x5251('0x47')]({'where':{'id':_0x277163['params']['id']}})[_0x5251('0x29')](handleEntityNotFound(_0x28fff1,null))['then'](saveUpdates(_0x277163[_0x5251('0x49')],null))['then'](respondWithResult(_0x28fff1,null))[_0x5251('0x45')](handleError(_0x28fff1,null));};exports[_0x5251('0x4a')]=function(_0x422be4,_0x2277f5){return db[_0x5251('0x2e')]['find']({'where':{'id':_0x422be4[_0x5251('0x4b')]['id']}})[_0x5251('0x29')](handleEntityNotFound(_0x2277f5,null))['then'](removeEntity(_0x2277f5,null))['catch'](handleError(_0x2277f5,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 9749d81..d6c8f72 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 _0xc943=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api'];(function(_0x8307e3,_0x48eb78){var _0x492db9=function(_0x1284f7){while(--_0x1284f7){_0x8307e3['push'](_0x8307e3['shift']());}};_0x492db9(++_0x48eb78);}(_0xc943,0x173));var _0x3c94=function(_0x34c063,_0x11d3d7){_0x34c063=_0x34c063-0x0;var _0x2c63a3=_0xc943[_0x34c063];return _0x2c63a3;};'use strict';var _=require(_0x3c94('0x0'));var util=require(_0x3c94('0x1'));var logger=require(_0x3c94('0x2'))(_0x3c94('0x3'));var moment=require(_0x3c94('0x4'));var BPromise=require(_0x3c94('0x5'));var rp=require(_0x3c94('0x6'));var fs=require('fs');var path=require(_0x3c94('0x7'));var rimraf=require(_0x3c94('0x8'));var config=require(_0x3c94('0x9'));var attributes=require(_0x3c94('0xa'));module[_0x3c94('0xb')]=function(_0x1146bb,_0x4fe61f){return _0x1146bb[_0x3c94('0xc')](_0x3c94('0xd'),attributes,{'tableName':_0x3c94('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd09=['path','rimraf','../../config/environment','exports','define','SquareMessage','square_messages','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0xbd09,0x8b));var _0x9bd0=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xbd09[_0x5c351c];return _0x26f3b3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9bd0('0x0'))(_0x9bd0('0x1'));var moment=require(_0x9bd0('0x2'));var BPromise=require(_0x9bd0('0x3'));var rp=require(_0x9bd0('0x4'));var fs=require('fs');var path=require(_0x9bd0('0x5'));var rimraf=require(_0x9bd0('0x6'));var config=require(_0x9bd0('0x7'));var attributes=require('./squareMessage.attributes');module[_0x9bd0('0x8')]=function(_0x4e5583,_0x55d1c2){return _0x4e5583[_0x9bd0('0x9')](_0x9bd0('0xa'),attributes,{'tableName':_0x9bd0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 53b874e..3db1d54 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 _0xccc4=['code','message','catch','CreateSquareMessage','SquareMessage','create','body','options','lodash','util','moment','ioredis','../../config/logger','rpc','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x25fa5c,_0x421141){var _0x1bade2=function(_0x3faf20){while(--_0x3faf20){_0x25fa5c['push'](_0x25fa5c['shift']());}};_0x1bade2(++_0x421141);}(_0xccc4,0xe9));var _0x4ccc=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xccc4[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x4ccc('0x0'));var util=require(_0x4ccc('0x1'));var moment=require(_0x4ccc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ccc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ccc('0x4'))(_0x4ccc('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4ccc('0x6')][_0x4ccc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3bc688,_0x5362be,_0x13ab4f){return new BPromise(function(_0x5dce92,_0x136194){return client[_0x4ccc('0x8')](_0x3bc688,_0x13ab4f)[_0x4ccc('0x9')](function(_0x155c3b){logger[_0x4ccc('0xa')](_0x4ccc('0xb'),_0x5362be,_0x4ccc('0xc'));logger[_0x4ccc('0xd')](_0x4ccc('0xe'),_0x5362be,_0x4ccc('0xc'),JSON[_0x4ccc('0xf')](_0x155c3b));if(_0x155c3b[_0x4ccc('0x10')]){if(_0x155c3b[_0x4ccc('0x10')][_0x4ccc('0x11')]===0x1f4){logger[_0x4ccc('0x10')]('SquareMessage,\x20%s,\x20%s',_0x5362be,_0x155c3b[_0x4ccc('0x10')][_0x4ccc('0x12')]);return _0x136194(_0x155c3b['error']['message']);}logger[_0x4ccc('0x10')](_0x4ccc('0xb'),_0x5362be,_0x155c3b['error'][_0x4ccc('0x12')]);return _0x5dce92(_0x155c3b[_0x4ccc('0x10')][_0x4ccc('0x12')]);}else{logger['info'](_0x4ccc('0xb'),_0x5362be,_0x4ccc('0xc'));_0x5dce92(_0x155c3b['result'][_0x4ccc('0x12')]);}})[_0x4ccc('0x13')](function(_0x43baca){logger[_0x4ccc('0x10')](_0x4ccc('0xb'),_0x5362be,_0x43baca);_0x136194(_0x43baca);});});}exports[_0x4ccc('0x14')]=function(_0x1f51cc){var _0x423718=this;return new Promise(function(_0x121863,_0x5784b5){return db[_0x4ccc('0x15')][_0x4ccc('0x16')](_0x1f51cc[_0x4ccc('0x17')],{'raw':_0x1f51cc[_0x4ccc('0x18')]?_0x1f51cc[_0x4ccc('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1a8636){logger['info'](_0x4ccc('0x14'),_0x1f51cc);logger[_0x4ccc('0xd')]('CreateSquareMessage',_0x1f51cc,JSON[_0x4ccc('0xf')](_0x1a8636));_0x121863(_0x1a8636);})['catch'](function(_0x58890c){logger[_0x4ccc('0x10')](_0x4ccc('0x14'),_0x58890c[_0x4ccc('0x12')],_0x1f51cc);_0x5784b5(_0x423718['error'](0x1f4,_0x58890c[_0x4ccc('0x12')]));});});}; \ No newline at end of file +var _0xdb4e=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','CreateSquareMessage','create','body','options','stringify'];(function(_0x34fabb,_0x54ec70){var _0x3a1b8f=function(_0x2e1491){while(--_0x2e1491){_0x34fabb['push'](_0x34fabb['shift']());}};_0x3a1b8f(++_0x54ec70);}(_0xdb4e,0x82));var _0xedb4=function(_0x47b6e4,_0x541578){_0x47b6e4=_0x47b6e4-0x0;var _0x398027=_0xdb4e[_0x47b6e4];return _0x398027;};'use strict';var _=require('lodash');var util=require(_0xedb4('0x0'));var moment=require(_0xedb4('0x1'));var BPromise=require(_0xedb4('0x2'));var rs=require(_0xedb4('0x3'));var fs=require('fs');var Redis=require(_0xedb4('0x4'));var db=require(_0xedb4('0x5'))['db'];var utils=require(_0xedb4('0x6'));var logger=require(_0xedb4('0x7'))('rpc');var config=require(_0xedb4('0x8'));var jayson=require(_0xedb4('0x9'));var client=jayson['client'][_0xedb4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b5c5f,_0x5b3546,_0x102a93){return new BPromise(function(_0x3acf6b,_0x31ac13){return client[_0xedb4('0xb')](_0x2b5c5f,_0x102a93)[_0xedb4('0xc')](function(_0x22572c){logger[_0xedb4('0xd')](_0xedb4('0xe'),_0x5b3546,'request\x20sent');logger[_0xedb4('0xf')](_0xedb4('0x10'),_0x5b3546,_0xedb4('0x11'),JSON['stringify'](_0x22572c));if(_0x22572c[_0xedb4('0x12')]){if(_0x22572c[_0xedb4('0x12')][_0xedb4('0x13')]===0x1f4){logger[_0xedb4('0x12')](_0xedb4('0xe'),_0x5b3546,_0x22572c[_0xedb4('0x12')][_0xedb4('0x14')]);return _0x31ac13(_0x22572c['error'][_0xedb4('0x14')]);}logger[_0xedb4('0x12')](_0xedb4('0xe'),_0x5b3546,_0x22572c[_0xedb4('0x12')][_0xedb4('0x14')]);return _0x3acf6b(_0x22572c['error'][_0xedb4('0x14')]);}else{logger[_0xedb4('0xd')](_0xedb4('0xe'),_0x5b3546,_0xedb4('0x11'));_0x3acf6b(_0x22572c['result'][_0xedb4('0x14')]);}})['catch'](function(_0x129aa7){logger[_0xedb4('0x12')]('SquareMessage,\x20%s,\x20%s',_0x5b3546,_0x129aa7);_0x31ac13(_0x129aa7);});});}exports[_0xedb4('0x15')]=function(_0x689e33){var _0x41d50a=this;return new Promise(function(_0x53dd8d,_0x14f80e){return db['SquareMessage'][_0xedb4('0x16')](_0x689e33[_0xedb4('0x17')],{'raw':_0x689e33[_0xedb4('0x18')]?_0x689e33[_0xedb4('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xedb4('0xc')](function(_0x1153d8){logger[_0xedb4('0xd')]('CreateSquareMessage',_0x689e33);logger[_0xedb4('0xf')](_0xedb4('0x15'),_0x689e33,JSON[_0xedb4('0x19')](_0x1153d8));_0x53dd8d(_0x1153d8);})['catch'](function(_0x414c31){logger['error'](_0xedb4('0x15'),_0x414c31[_0xedb4('0x14')],_0x689e33);_0x14f80e(_0x41d50a[_0xedb4('0x12')](0x1f4,_0x414c31[_0xedb4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 30a2afc..e4b2b63 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 _0xae9e=['isAuthenticated','/:id','show','/:id/test','15s','test','post','create','put','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x2e071a,_0x49802b){var _0x53789d=function(_0x4af3a4){while(--_0x4af3a4){_0x2e071a['push'](_0x2e071a['shift']());}};_0x53789d(++_0x49802b);}(_0xae9e,0xa3));var _0xeae9=function(_0x5bd95e,_0x2c6710){_0x5bd95e=_0x5bd95e-0x0;var _0x5b436=_0xae9e[_0x5bd95e];return _0x5b436;};'use strict';var multer=require(_0xeae9('0x0'));var util=require(_0xeae9('0x1'));var path=require(_0xeae9('0x2'));var timeout=require(_0xeae9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xeae9('0x4'));var auth=require(_0xeae9('0x5'));var interaction=require(_0xeae9('0x6'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0xeae9('0x7')]('/',auth[_0xeae9('0x8')](),controller['index']);router[_0xeae9('0x7')](_0xeae9('0x9'),auth[_0xeae9('0x8')](),controller[_0xeae9('0xa')]);router['get'](_0xeae9('0xb'),auth[_0xeae9('0x8')](),timeout(_0xeae9('0xc')),controller[_0xeae9('0xd')]);router[_0xeae9('0xe')]('/',auth[_0xeae9('0x8')](),controller[_0xeae9('0xf')]);router[_0xeae9('0x10')](_0xeae9('0x9'),auth[_0xeae9('0x8')](),controller['update']);router[_0xeae9('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xeae9('0x12')]=router; \ No newline at end of file +var _0xb4fc=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/test','15s','create'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xb4fc,0x1c5));var _0xcb4f=function(_0x58ffd3,_0xdf6a5f){_0x58ffd3=_0x58ffd3-0x0;var _0xf86480=_0xb4fc[_0x58ffd3];return _0xf86480;};'use strict';var multer=require(_0xcb4f('0x0'));var util=require('util');var path=require(_0xcb4f('0x1'));var timeout=require(_0xcb4f('0x2'));var express=require(_0xcb4f('0x3'));var router=express[_0xcb4f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcb4f('0x5'));var interaction=require(_0xcb4f('0x6'));var config=require(_0xcb4f('0x7'));var controller=require('./squareOdbc.controller');router[_0xcb4f('0x8')]('/',auth[_0xcb4f('0x9')](),controller['index']);router[_0xcb4f('0x8')](_0xcb4f('0xa'),auth[_0xcb4f('0x9')](),controller[_0xcb4f('0xb')]);router[_0xcb4f('0x8')](_0xcb4f('0xc'),auth[_0xcb4f('0x9')](),timeout(_0xcb4f('0xd')),controller['test']);router['post']('/',auth[_0xcb4f('0x9')](),controller[_0xcb4f('0xe')]);router['put'](_0xcb4f('0xa'),auth[_0xcb4f('0x9')](),controller['update']);router[_0xcb4f('0xf')](_0xcb4f('0xa'),auth[_0xcb4f('0x9')](),controller[_0xcb4f('0x10')]);module[_0xcb4f('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 4c5c67e..295027f 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 _0xd935=['sequelize','exports','STRING','name'];(function(_0x5454c4,_0x945165){var _0x48e5d7=function(_0x3b1e28){while(--_0x3b1e28){_0x5454c4['push'](_0x5454c4['shift']());}};_0x48e5d7(++_0x945165);}(_0xd935,0x108));var _0x5d93=function(_0x30ead7,_0x5d8dd5){_0x30ead7=_0x30ead7-0x0;var _0x38f88d=_0xd935[_0x30ead7];return _0x38f88d;};'use strict';var Sequelize=require(_0x5d93('0x0'));module[_0x5d93('0x1')]={'name':{'type':Sequelize[_0x5d93('0x2')],'unique':_0x5d93('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x5d93('0x2')]},'description':{'type':Sequelize[_0x5d93('0x2')]}}; \ No newline at end of file +var _0xa170=['exports','STRING'];(function(_0x1dd532,_0x36e81c){var _0x3732aa=function(_0x19d50a){while(--_0x19d50a){_0x1dd532['push'](_0x1dd532['shift']());}};_0x3732aa(++_0x36e81c);}(_0xa170,0x114));var _0x0a17=function(_0x3a864a,_0x40a599){_0x3a864a=_0x3a864a-0x0;var _0x41e6cb=_0xa170[_0x3a864a];return _0x41e6cb;};'use strict';var Sequelize=require('sequelize');module[_0x0a17('0x0')]={'name':{'type':Sequelize[_0x0a17('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x0a17('0x1')]},'description':{'type':Sequelize[_0x0a17('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 7f64fa9..d36e1e4 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 _0xb522=['params','length','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','openSync','dsn','closeSync','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../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','save','update','destroy','then','get','UserProfileResource','error','stack','name','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show'];(function(_0x17a3d7,_0x271dc7){var _0x5c5309=function(_0x55ac47){while(--_0x55ac47){_0x17a3d7['push'](_0x17a3d7['shift']());}};_0x5c5309(++_0x271dc7);}(_0xb522,0xb6));var _0x2b52=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb522[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x2b52('0x0'));var rimraf=require(_0x2b52('0x1'));var zipdir=require(_0x2b52('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2b52('0x3'));var moment=require(_0x2b52('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2b52('0x5'));var util=require(_0x2b52('0x6'));var path=require('path');var sox=require(_0x2b52('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b52('0x8'));var _=require('lodash');var squel=require(_0x2b52('0x9'));var crypto=require(_0x2b52('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2b52('0xb'));var toCsv=require(_0x2b52('0xc'));var querystring=require(_0x2b52('0xd'));var Papa=require('papaparse');var Redis=require(_0x2b52('0xe'));var authService=require(_0x2b52('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2b52('0x10'));var hardwareService=require(_0x2b52('0x11'));var logger=require(_0x2b52('0x12'))(_0x2b52('0x13'));var utils=require(_0x2b52('0x14'));var config=require(_0x2b52('0x15'));var licenseUtil=require(_0x2b52('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1be5c2,_0x498086){_0x498086=_0x498086||0xcc;return function(_0x1fbb0d){if(_0x1fbb0d){return _0x1be5c2[_0x2b52('0x17')](_0x498086);}return _0x1be5c2['status'](_0x498086)[_0x2b52('0x18')]();};}function respondWithResult(_0x402a11,_0x4e4aa4){_0x4e4aa4=_0x4e4aa4||0xc8;return function(_0x558430){if(_0x558430){return _0x402a11['status'](_0x4e4aa4)[_0x2b52('0x19')](_0x558430);}};}function respondWithFilteredResult(_0x5956e2,_0x14a052){return function(_0x98f13d){if(_0x98f13d){var _0x49b812=typeof _0x14a052[_0x2b52('0x1a')]===_0x2b52('0x1b')&&typeof _0x14a052[_0x2b52('0x1c')]===_0x2b52('0x1b');var _0x3bfd0f=_0x98f13d[_0x2b52('0x1d')];var _0x3ff627=_0x49b812?0x0:_0x14a052[_0x2b52('0x1a')];var _0x29535d=_0x49b812?_0x98f13d['count']:_0x14a052[_0x2b52('0x1a')]+_0x14a052[_0x2b52('0x1c')];var _0x26f493;if(_0x29535d>=_0x3bfd0f){_0x29535d=_0x3bfd0f;_0x26f493=0xc8;}else{_0x26f493=0xce;}_0x5956e2[_0x2b52('0x1e')](_0x26f493);return _0x5956e2[_0x2b52('0x1f')]('Content-Range',_0x3ff627+'-'+_0x29535d+'/'+_0x3bfd0f)['json'](_0x98f13d);}return null;};}function patchUpdates(_0xc7ca17){return function(_0x19b071){try{jsonpatch['apply'](_0x19b071,_0xc7ca17,!![]);}catch(_0x580167){return BPromise['reject'](_0x580167);}return _0x19b071[_0x2b52('0x20')]();};}function saveUpdates(_0x4e3c64,_0x259684){return function(_0x49ce64){if(_0x49ce64){return _0x49ce64[_0x2b52('0x21')](_0x4e3c64)['then'](function(_0x13ef57){return _0x13ef57;});}return null;};}function removeEntity(_0x13e650,_0x1268c5){return function(_0x348017){if(_0x348017){return _0x348017[_0x2b52('0x22')]()[_0x2b52('0x23')](function(){var _0x4920ed=_0x348017[_0x2b52('0x24')]({'plain':!![]});var _0x270d1f='ODBC';return db[_0x2b52('0x25')][_0x2b52('0x22')]({'where':{'type':_0x270d1f,'resourceId':_0x4920ed['id']}})[_0x2b52('0x23')](function(){return _0x348017;});})[_0x2b52('0x23')](function(){_0x13e650[_0x2b52('0x1e')](0xcc)[_0x2b52('0x18')]();});}};}function handleEntityNotFound(_0xc24e41,_0xf2910c){return function(_0x24f78e){if(!_0x24f78e){_0xc24e41[_0x2b52('0x17')](0x194);}return _0x24f78e;};}function handleError(_0x40e445,_0x457e4a){_0x457e4a=_0x457e4a||0x1f4;return function(_0x51cbf2){logger[_0x2b52('0x26')](_0x51cbf2[_0x2b52('0x27')]);if(_0x51cbf2['name']){delete _0x51cbf2[_0x2b52('0x28')];}_0x40e445[_0x2b52('0x1e')](_0x457e4a)['send'](_0x51cbf2);};}exports[_0x2b52('0x29')]=function(_0x3091c6,_0x275175){var _0x236aa3={},_0x1b1569={},_0x4eb6de={'count':0x0,'rows':[]};var _0x3c689b=_[_0x2b52('0x2a')](db[_0x2b52('0x2b')][_0x2b52('0x2c')],function(_0x2e377f){return{'name':_0x2e377f[_0x2b52('0x2d')],'type':_0x2e377f[_0x2b52('0x2e')][_0x2b52('0x2f')]};});_0x1b1569[_0x2b52('0x30')]=_[_0x2b52('0x2a')](_0x3c689b,'name');_0x1b1569[_0x2b52('0x31')]=_[_0x2b52('0x32')](_0x3091c6[_0x2b52('0x31')]);_0x1b1569['filters']=_[_0x2b52('0x33')](_0x1b1569[_0x2b52('0x30')],_0x1b1569[_0x2b52('0x31')]);_0x236aa3['attributes']=_[_0x2b52('0x33')](_0x1b1569[_0x2b52('0x30')],qs[_0x2b52('0x34')](_0x3091c6[_0x2b52('0x31')][_0x2b52('0x34')]));_0x236aa3['attributes']=_0x236aa3[_0x2b52('0x35')]['length']?_0x236aa3[_0x2b52('0x35')]:_0x1b1569['model'];if(!_0x3091c6[_0x2b52('0x31')][_0x2b52('0x36')](_0x2b52('0x37'))){_0x236aa3['limit']=qs[_0x2b52('0x1c')](_0x3091c6[_0x2b52('0x31')][_0x2b52('0x1c')]);_0x236aa3[_0x2b52('0x1a')]=qs[_0x2b52('0x1a')](_0x3091c6[_0x2b52('0x31')][_0x2b52('0x1a')]);}_0x236aa3[_0x2b52('0x38')]=qs[_0x2b52('0x39')](_0x3091c6[_0x2b52('0x31')][_0x2b52('0x39')]);_0x236aa3[_0x2b52('0x3a')]=qs[_0x2b52('0x3b')](_[_0x2b52('0x3c')](_0x3091c6['query'],_0x1b1569[_0x2b52('0x3b')]),_0x3c689b);if(_0x3091c6['query'][_0x2b52('0x3d')]){_0x236aa3[_0x2b52('0x3a')]=_[_0x2b52('0x3e')](_0x236aa3['where'],{'$or':_['map'](_0x3c689b,function(_0x12bfbf){if(_0x12bfbf['type']!==_0x2b52('0x3f')){var _0x36430f={};_0x36430f[_0x12bfbf[_0x2b52('0x28')]]={'$like':'%'+_0x3091c6[_0x2b52('0x31')][_0x2b52('0x3d')]+'%'};return _0x36430f;}})});}_0x236aa3=_[_0x2b52('0x3e')]({},_0x236aa3,_0x3091c6[_0x2b52('0x40')]);var _0x5e70d8={'where':_0x236aa3[_0x2b52('0x3a')]};return db[_0x2b52('0x2b')][_0x2b52('0x1d')](_0x5e70d8)[_0x2b52('0x23')](function(_0x3f2b41){_0x4eb6de[_0x2b52('0x1d')]=_0x3f2b41;if(_0x3091c6[_0x2b52('0x31')][_0x2b52('0x41')]){_0x236aa3[_0x2b52('0x42')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x236aa3);})[_0x2b52('0x23')](function(_0x32b867){_0x4eb6de[_0x2b52('0x43')]=_0x32b867;return _0x4eb6de;})[_0x2b52('0x23')](respondWithFilteredResult(_0x275175,_0x236aa3))[_0x2b52('0x44')](handleError(_0x275175,null));};exports[_0x2b52('0x45')]=function(_0x29ca75,_0x49558c){var _0xc9ba3d={'raw':!![],'where':{'id':_0x29ca75[_0x2b52('0x46')]['id']}},_0x2d752c={};_0x2d752c[_0x2b52('0x30')]=_['keys'](db[_0x2b52('0x2b')][_0x2b52('0x2c')]);_0x2d752c['query']=_[_0x2b52('0x32')](_0x29ca75[_0x2b52('0x31')]);_0x2d752c['filters']=_[_0x2b52('0x33')](_0x2d752c[_0x2b52('0x30')],_0x2d752c[_0x2b52('0x31')]);_0xc9ba3d[_0x2b52('0x35')]=_[_0x2b52('0x33')](_0x2d752c['model'],qs[_0x2b52('0x34')](_0x29ca75[_0x2b52('0x31')]['fields']));_0xc9ba3d[_0x2b52('0x35')]=_0xc9ba3d[_0x2b52('0x35')][_0x2b52('0x47')]?_0xc9ba3d[_0x2b52('0x35')]:_0x2d752c[_0x2b52('0x30')];if(_0x29ca75[_0x2b52('0x31')]['includeAll']){_0xc9ba3d[_0x2b52('0x42')]=[{'all':!![]}];}_0xc9ba3d=_[_0x2b52('0x3e')]({},_0xc9ba3d,_0x29ca75[_0x2b52('0x40')]);return db[_0x2b52('0x2b')][_0x2b52('0x48')](_0xc9ba3d)[_0x2b52('0x23')](handleEntityNotFound(_0x49558c,null))[_0x2b52('0x23')](respondWithResult(_0x49558c,null))[_0x2b52('0x44')](handleError(_0x49558c,null));};exports['create']=function(_0x59e2e4,_0x727845){return db[_0x2b52('0x2b')][_0x2b52('0x49')](_0x59e2e4[_0x2b52('0x4a')],{})['then'](function(_0x43cd8a){var _0x320d28=_0x59e2e4[_0x2b52('0x4b')][_0x2b52('0x24')]({'plain':!![]});if(!_0x320d28)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x320d28[_0x2b52('0x4c')]===_0x2b52('0x4b')){var _0x2d9c01=_0x43cd8a[_0x2b52('0x24')]({'plain':!![]});var _0x3b1b24='ODBC';return db[_0x2b52('0x4d')][_0x2b52('0x48')]({'where':{'name':_0x3b1b24,'userProfileId':_0x320d28[_0x2b52('0x4e')]},'raw':!![]})[_0x2b52('0x23')](function(_0x39b23b){if(_0x39b23b&&_0x39b23b['autoAssociation']===0x0){return db[_0x2b52('0x25')][_0x2b52('0x49')]({'name':_0x2d9c01[_0x2b52('0x28')],'resourceId':_0x2d9c01['id'],'type':_0x39b23b[_0x2b52('0x28')],'sectionId':_0x39b23b['id']},{})[_0x2b52('0x23')](function(){return _0x43cd8a;});}else{return _0x43cd8a;}})['catch'](function(_0x1e9210){logger[_0x2b52('0x26')](_0x2b52('0x4f'),_0x1e9210);throw _0x1e9210;});}return _0x43cd8a;})['then'](respondWithResult(_0x727845,0xc9))['catch'](handleError(_0x727845,null));};exports['update']=function(_0x47972b,_0x138094){if(_0x47972b[_0x2b52('0x4a')]['id']){delete _0x47972b['body']['id'];}return db[_0x2b52('0x2b')][_0x2b52('0x48')]({'where':{'id':_0x47972b[_0x2b52('0x46')]['id']}})[_0x2b52('0x23')](handleEntityNotFound(_0x138094,null))['then'](saveUpdates(_0x47972b[_0x2b52('0x4a')],null))[_0x2b52('0x23')](respondWithResult(_0x138094,null))[_0x2b52('0x44')](handleError(_0x138094,null));};exports[_0x2b52('0x22')]=function(_0x256bcb,_0x39b8a6){return db[_0x2b52('0x2b')]['find']({'where':{'id':_0x256bcb['params']['id']}})[_0x2b52('0x23')](handleEntityNotFound(_0x39b8a6,null))[_0x2b52('0x23')](removeEntity(_0x39b8a6,null))[_0x2b52('0x44')](handleError(_0x39b8a6,null));};exports[_0x2b52('0x50')]=function(_0x4ec69a,_0x5d325e,_0x37a7f8){var _0x9b62d5;return db['SquareOdbc'][_0x2b52('0x48')]({'where':{'id':_0x4ec69a[_0x2b52('0x46')]['id']},'attributes':['id','dsn']})[_0x2b52('0x23')](handleEntityNotFound(_0x5d325e,null))[_0x2b52('0x23')](function(_0x427f8b){if(_0x427f8b){var _0x3f0796=require('odbc')();_0x3f0796[_0x2b52('0x51')](_0x427f8b[_0x2b52('0x52')]);_0x3f0796[_0x2b52('0x53')]();return _0x427f8b;}})[_0x2b52('0x23')](respondWithResult(_0x5d325e,null))[_0x2b52('0x44')](handleError(_0x5d325e,null));}; \ No newline at end of file +var _0xdf2e=['crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','then','destroy','get','ODBC','UserProfileResource','stack','name','index','map','SquareOdbc','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','options','include','rows','catch','show','params','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','create','error','update','body','test','dsn','odbc','openSync','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','fs-extra','lodash','squel'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xdf2e,0x122));var _0xedf2=function(_0x456a4b,_0x51df8){_0x456a4b=_0x456a4b-0x0;var _0x42957c=_0xdf2e[_0x456a4b];return _0x42957c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xedf2('0x0'));var zipdir=require(_0xedf2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xedf2('0x2'));var moment=require(_0xedf2('0x3'));var BPromise=require(_0xedf2('0x4'));var Mustache=require('mustache');var util=require(_0xedf2('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xedf2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedf2('0x7'));var _=require(_0xedf2('0x8'));var squel=require(_0xedf2('0x9'));var crypto=require(_0xedf2('0xa'));var jsforce=require(_0xedf2('0xb'));var deskjs=require(_0xedf2('0xc'));var toCsv=require(_0xedf2('0x6'));var querystring=require(_0xedf2('0xd'));var Papa=require(_0xedf2('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xedf2('0xf'));var hardwareService=require(_0xedf2('0x10'));var logger=require(_0xedf2('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xedf2('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xedf2('0x13'))['db'];function respondWithStatusCode(_0x47a677,_0x4f8ef9){_0x4f8ef9=_0x4f8ef9||0xcc;return function(_0x3ae0ab){if(_0x3ae0ab){return _0x47a677[_0xedf2('0x14')](_0x4f8ef9);}return _0x47a677[_0xedf2('0x15')](_0x4f8ef9)[_0xedf2('0x16')]();};}function respondWithResult(_0x452b62,_0x1161cd){_0x1161cd=_0x1161cd||0xc8;return function(_0xd8a63e){if(_0xd8a63e){return _0x452b62[_0xedf2('0x15')](_0x1161cd)['json'](_0xd8a63e);}};}function respondWithFilteredResult(_0x501afb,_0x134356){return function(_0x221abe){if(_0x221abe){var _0x32dba8=typeof _0x134356[_0xedf2('0x17')]===_0xedf2('0x18')&&typeof _0x134356[_0xedf2('0x19')]===_0xedf2('0x18');var _0x2676e1=_0x221abe[_0xedf2('0x1a')];var _0x517231=_0x32dba8?0x0:_0x134356[_0xedf2('0x17')];var _0x172f7c=_0x32dba8?_0x221abe[_0xedf2('0x1a')]:_0x134356[_0xedf2('0x17')]+_0x134356[_0xedf2('0x19')];var _0x555bdc;if(_0x172f7c>=_0x2676e1){_0x172f7c=_0x2676e1;_0x555bdc=0xc8;}else{_0x555bdc=0xce;}_0x501afb[_0xedf2('0x15')](_0x555bdc);return _0x501afb['set'](_0xedf2('0x1b'),_0x517231+'-'+_0x172f7c+'/'+_0x2676e1)['json'](_0x221abe);}return null;};}function patchUpdates(_0x1a7e6a){return function(_0x9fe97d){try{jsonpatch[_0xedf2('0x1c')](_0x9fe97d,_0x1a7e6a,!![]);}catch(_0x2cae61){return BPromise['reject'](_0x2cae61);}return _0x9fe97d['save']();};}function saveUpdates(_0x2824d5,_0x51de66){return function(_0x334f0f){if(_0x334f0f){return _0x334f0f['update'](_0x2824d5)[_0xedf2('0x1d')](function(_0x5acb07){return _0x5acb07;});}return null;};}function removeEntity(_0x129d37,_0x33f6fd){return function(_0x3444d4){if(_0x3444d4){return _0x3444d4[_0xedf2('0x1e')]()[_0xedf2('0x1d')](function(){var _0x381eb0=_0x3444d4[_0xedf2('0x1f')]({'plain':!![]});var _0x287862=_0xedf2('0x20');return db[_0xedf2('0x21')][_0xedf2('0x1e')]({'where':{'type':_0x287862,'resourceId':_0x381eb0['id']}})[_0xedf2('0x1d')](function(){return _0x3444d4;});})[_0xedf2('0x1d')](function(){_0x129d37[_0xedf2('0x15')](0xcc)[_0xedf2('0x16')]();});}};}function handleEntityNotFound(_0xe9d293,_0x1b91c2){return function(_0x6352b){if(!_0x6352b){_0xe9d293[_0xedf2('0x14')](0x194);}return _0x6352b;};}function handleError(_0x246a19,_0x90d998){_0x90d998=_0x90d998||0x1f4;return function(_0x3c4b3e){logger['error'](_0x3c4b3e[_0xedf2('0x22')]);if(_0x3c4b3e[_0xedf2('0x23')]){delete _0x3c4b3e['name'];}_0x246a19[_0xedf2('0x15')](_0x90d998)['send'](_0x3c4b3e);};}exports[_0xedf2('0x24')]=function(_0xad6324,_0x227ed5){var _0x3d9463={},_0x276276={},_0x2d7a7c={'count':0x0,'rows':[]};var _0x3ba15c=_[_0xedf2('0x25')](db[_0xedf2('0x26')][_0xedf2('0x27')],function(_0x4671d5){return{'name':_0x4671d5[_0xedf2('0x28')],'type':_0x4671d5[_0xedf2('0x29')]['key']};});_0x276276[_0xedf2('0x2a')]=_[_0xedf2('0x25')](_0x3ba15c,'name');_0x276276['query']=_[_0xedf2('0x2b')](_0xad6324['query']);_0x276276[_0xedf2('0x2c')]=_[_0xedf2('0x2d')](_0x276276['model'],_0x276276[_0xedf2('0x2e')]);_0x3d9463['attributes']=_['intersection'](_0x276276[_0xedf2('0x2a')],qs[_0xedf2('0x2f')](_0xad6324[_0xedf2('0x2e')][_0xedf2('0x2f')]));_0x3d9463[_0xedf2('0x30')]=_0x3d9463[_0xedf2('0x30')][_0xedf2('0x31')]?_0x3d9463[_0xedf2('0x30')]:_0x276276[_0xedf2('0x2a')];if(!_0xad6324[_0xedf2('0x2e')][_0xedf2('0x32')]('nolimit')){_0x3d9463[_0xedf2('0x19')]=qs['limit'](_0xad6324[_0xedf2('0x2e')][_0xedf2('0x19')]);_0x3d9463[_0xedf2('0x17')]=qs[_0xedf2('0x17')](_0xad6324['query'][_0xedf2('0x17')]);}_0x3d9463[_0xedf2('0x33')]=qs[_0xedf2('0x34')](_0xad6324['query'][_0xedf2('0x34')]);_0x3d9463[_0xedf2('0x35')]=qs[_0xedf2('0x2c')](_[_0xedf2('0x36')](_0xad6324[_0xedf2('0x2e')],_0x276276[_0xedf2('0x2c')]),_0x3ba15c);if(_0xad6324[_0xedf2('0x2e')]['filter']){_0x3d9463[_0xedf2('0x35')]=_[_0xedf2('0x37')](_0x3d9463['where'],{'$or':_[_0xedf2('0x25')](_0x3ba15c,function(_0x5f10d6){if(_0x5f10d6[_0xedf2('0x29')]!=='VIRTUAL'){var _0x3754ad={};_0x3754ad[_0x5f10d6[_0xedf2('0x23')]]={'$like':'%'+_0xad6324[_0xedf2('0x2e')]['filter']+'%'};return _0x3754ad;}})});}_0x3d9463=_[_0xedf2('0x37')]({},_0x3d9463,_0xad6324[_0xedf2('0x38')]);var _0x314446={'where':_0x3d9463['where']};return db[_0xedf2('0x26')][_0xedf2('0x1a')](_0x314446)[_0xedf2('0x1d')](function(_0x49451f){_0x2d7a7c[_0xedf2('0x1a')]=_0x49451f;if(_0xad6324[_0xedf2('0x2e')]['includeAll']){_0x3d9463[_0xedf2('0x39')]=[{'all':!![]}];}return db[_0xedf2('0x26')]['findAll'](_0x3d9463);})[_0xedf2('0x1d')](function(_0x1fa0ee){_0x2d7a7c[_0xedf2('0x3a')]=_0x1fa0ee;return _0x2d7a7c;})['then'](respondWithFilteredResult(_0x227ed5,_0x3d9463))[_0xedf2('0x3b')](handleError(_0x227ed5,null));};exports[_0xedf2('0x3c')]=function(_0x10f2e1,_0x438fe8){var _0x5bef32={'raw':!![],'where':{'id':_0x10f2e1[_0xedf2('0x3d')]['id']}},_0x380653={};_0x380653[_0xedf2('0x2a')]=_[_0xedf2('0x2b')](db['SquareOdbc'][_0xedf2('0x27')]);_0x380653[_0xedf2('0x2e')]=_[_0xedf2('0x2b')](_0x10f2e1[_0xedf2('0x2e')]);_0x380653[_0xedf2('0x2c')]=_[_0xedf2('0x2d')](_0x380653['model'],_0x380653[_0xedf2('0x2e')]);_0x5bef32['attributes']=_[_0xedf2('0x2d')](_0x380653['model'],qs['fields'](_0x10f2e1['query']['fields']));_0x5bef32[_0xedf2('0x30')]=_0x5bef32[_0xedf2('0x30')][_0xedf2('0x31')]?_0x5bef32[_0xedf2('0x30')]:_0x380653[_0xedf2('0x2a')];if(_0x10f2e1[_0xedf2('0x2e')]['includeAll']){_0x5bef32[_0xedf2('0x39')]=[{'all':!![]}];}_0x5bef32=_['merge']({},_0x5bef32,_0x10f2e1[_0xedf2('0x38')]);return db[_0xedf2('0x26')][_0xedf2('0x3e')](_0x5bef32)[_0xedf2('0x1d')](handleEntityNotFound(_0x438fe8,null))[_0xedf2('0x1d')](respondWithResult(_0x438fe8,null))[_0xedf2('0x3b')](handleError(_0x438fe8,null));};exports['create']=function(_0x3b37a4,_0x3b5da9){return db['SquareOdbc']['create'](_0x3b37a4['body'],{})['then'](function(_0xc62096){var _0x1992a9=_0x3b37a4['user'][_0xedf2('0x1f')]({'plain':!![]});if(!_0x1992a9)throw new Error(_0xedf2('0x3f'));if(_0x1992a9[_0xedf2('0x40')]===_0xedf2('0x41')){var _0xf56ba7=_0xc62096[_0xedf2('0x1f')]({'plain':!![]});var _0x25c274='ODBC';return db['UserProfileSection']['find']({'where':{'name':_0x25c274,'userProfileId':_0x1992a9[_0xedf2('0x42')]},'raw':!![]})[_0xedf2('0x1d')](function(_0xe8a015){if(_0xe8a015&&_0xe8a015['autoAssociation']===0x0){return db[_0xedf2('0x21')][_0xedf2('0x43')]({'name':_0xf56ba7[_0xedf2('0x23')],'resourceId':_0xf56ba7['id'],'type':_0xe8a015['name'],'sectionId':_0xe8a015['id']},{})[_0xedf2('0x1d')](function(){return _0xc62096;});}else{return _0xc62096;}})[_0xedf2('0x3b')](function(_0x3f54a7){logger[_0xedf2('0x44')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f54a7);throw _0x3f54a7;});}return _0xc62096;})[_0xedf2('0x1d')](respondWithResult(_0x3b5da9,0xc9))[_0xedf2('0x3b')](handleError(_0x3b5da9,null));};exports[_0xedf2('0x45')]=function(_0x342b36,_0x157286){if(_0x342b36['body']['id']){delete _0x342b36[_0xedf2('0x46')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x342b36[_0xedf2('0x3d')]['id']}})[_0xedf2('0x1d')](handleEntityNotFound(_0x157286,null))[_0xedf2('0x1d')](saveUpdates(_0x342b36[_0xedf2('0x46')],null))[_0xedf2('0x1d')](respondWithResult(_0x157286,null))[_0xedf2('0x3b')](handleError(_0x157286,null));};exports[_0xedf2('0x1e')]=function(_0x1ede0e,_0x53e349){return db[_0xedf2('0x26')][_0xedf2('0x3e')]({'where':{'id':_0x1ede0e[_0xedf2('0x3d')]['id']}})[_0xedf2('0x1d')](handleEntityNotFound(_0x53e349,null))['then'](removeEntity(_0x53e349,null))[_0xedf2('0x3b')](handleError(_0x53e349,null));};exports[_0xedf2('0x47')]=function(_0x1a569b,_0x475ce3,_0x33536d){var _0x5e265e;return db[_0xedf2('0x26')][_0xedf2('0x3e')]({'where':{'id':_0x1a569b[_0xedf2('0x3d')]['id']},'attributes':['id',_0xedf2('0x48')]})[_0xedf2('0x1d')](handleEntityNotFound(_0x475ce3,null))[_0xedf2('0x1d')](function(_0x54c08f){if(_0x54c08f){var _0x2c7cbe=require(_0xedf2('0x49'))();_0x2c7cbe[_0xedf2('0x4a')](_0x54c08f['dsn']);_0x2c7cbe['closeSync']();return _0x54c08f;}})['then'](respondWithResult(_0x475ce3,null))['catch'](handleError(_0x475ce3,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index ec738c4..32fb1e2 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 _0x5a94=['square_odbc','lodash','util','../../config/logger','api','moment','path','../../config/environment','define','SquareOdbc'];(function(_0x43e2f3,_0x1ecf27){var _0x2bfd6f=function(_0x26c21c){while(--_0x26c21c){_0x43e2f3['push'](_0x43e2f3['shift']());}};_0x2bfd6f(++_0x1ecf27);}(_0x5a94,0x1cd));var _0x45a9=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x5a94[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0x45a9('0x0'));var util=require(_0x45a9('0x1'));var logger=require(_0x45a9('0x2'))(_0x45a9('0x3'));var moment=require(_0x45a9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x45a9('0x5'));var rimraf=require('rimraf');var config=require(_0x45a9('0x6'));var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x3e8d57,_0x2b0270){return _0x3e8d57[_0x45a9('0x7')](_0x45a9('0x8'),attributes,{'tableName':_0x45a9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d63=['rimraf','../../config/environment','exports','define','SquareOdbc','square_odbc','lodash','../../config/logger','path'];(function(_0x1fdd5d,_0x2874e3){var _0x525d89=function(_0x27777a){while(--_0x27777a){_0x1fdd5d['push'](_0x1fdd5d['shift']());}};_0x525d89(++_0x2874e3);}(_0x0d63,0x7b));var _0x30d6=function(_0x55af86,_0x5c8ff6){_0x55af86=_0x55af86-0x0;var _0x58df3b=_0x0d63[_0x55af86];return _0x58df3b;};'use strict';var _=require(_0x30d6('0x0'));var util=require('util');var logger=require(_0x30d6('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x30d6('0x2'));var rimraf=require(_0x30d6('0x3'));var config=require(_0x30d6('0x4'));var attributes=require('./squareOdbc.attributes');module[_0x30d6('0x5')]=function(_0x3f8f31,_0x3010e8){return _0x3f8f31[_0x30d6('0x6')](_0x30d6('0x7'),attributes,{'tableName':_0x30d6('0x8'),'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 6f2d3c3..76dee08 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 _0x64ac=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSquareOdbc','find','options','raw','where','attributes','map','model','include','lodash','util','bluebird','randomstring'];(function(_0x5826d2,_0x43ad97){var _0x316742=function(_0x1b097d){while(--_0x1b097d){_0x5826d2['push'](_0x5826d2['shift']());}};_0x316742(++_0x43ad97);}(_0x64ac,0xbc));var _0xc64a=function(_0x13da9b,_0x8410f6){_0x13da9b=_0x13da9b-0x0;var _0xe359b5=_0x64ac[_0x13da9b];return _0xe359b5;};'use strict';var _=require(_0xc64a('0x0'));var util=require(_0xc64a('0x1'));var moment=require('moment');var BPromise=require(_0xc64a('0x2'));var rs=require(_0xc64a('0x3'));var fs=require('fs');var Redis=require(_0xc64a('0x4'));var db=require(_0xc64a('0x5'))['db'];var utils=require(_0xc64a('0x6'));var logger=require(_0xc64a('0x7'))(_0xc64a('0x8'));var config=require('../../config/environment');var jayson=require(_0xc64a('0x9'));var client=jayson['client'][_0xc64a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x542c57,_0x1fa87c,_0x1bf43a){return new BPromise(function(_0x50db6d,_0x9b6140){return client[_0xc64a('0xb')](_0x542c57,_0x1bf43a)[_0xc64a('0xc')](function(_0x2b94a2){logger[_0xc64a('0xd')](_0xc64a('0xe'),_0x1fa87c,_0xc64a('0xf'));logger[_0xc64a('0x10')](_0xc64a('0x11'),_0x1fa87c,_0xc64a('0xf'),JSON[_0xc64a('0x12')](_0x2b94a2));if(_0x2b94a2['error']){if(_0x2b94a2[_0xc64a('0x13')][_0xc64a('0x14')]===0x1f4){logger[_0xc64a('0x13')](_0xc64a('0xe'),_0x1fa87c,_0x2b94a2[_0xc64a('0x13')][_0xc64a('0x15')]);return _0x9b6140(_0x2b94a2['error'][_0xc64a('0x15')]);}logger[_0xc64a('0x13')](_0xc64a('0xe'),_0x1fa87c,_0x2b94a2['error'][_0xc64a('0x15')]);return _0x50db6d(_0x2b94a2[_0xc64a('0x13')][_0xc64a('0x15')]);}else{logger['info'](_0xc64a('0xe'),_0x1fa87c,_0xc64a('0xf'));_0x50db6d(_0x2b94a2['result']['message']);}})[_0xc64a('0x16')](function(_0x4ec94b){logger[_0xc64a('0x13')](_0xc64a('0xe'),_0x1fa87c,_0x4ec94b);_0x9b6140(_0x4ec94b);});});}exports[_0xc64a('0x17')]=function(_0x56fad5){var _0x33f996=this;return new Promise(function(_0x307be2,_0xc52e01){return db['SquareOdbc'][_0xc64a('0x18')]({'raw':_0x56fad5['options']?_0x56fad5[_0xc64a('0x19')][_0xc64a('0x1a')]===undefined?!![]:![]:!![],'where':_0x56fad5[_0xc64a('0x19')]?_0x56fad5[_0xc64a('0x19')][_0xc64a('0x1b')]||null:null,'attributes':_0x56fad5['options']?_0x56fad5[_0xc64a('0x19')][_0xc64a('0x1c')]||null:null,'include':_0x56fad5[_0xc64a('0x19')]?_0x56fad5[_0xc64a('0x19')]['include']?_[_0xc64a('0x1d')](_0x56fad5[_0xc64a('0x19')]['include'],function(_0x11a228){return{'model':db[_0x11a228[_0xc64a('0x1e')]],'as':_0x11a228['as'],'attributes':_0x11a228[_0xc64a('0x1c')],'include':_0x11a228[_0xc64a('0x1f')]?_[_0xc64a('0x1d')](_0x11a228[_0xc64a('0x1f')],function(_0x4ed83c){return{'model':db[_0x4ed83c[_0xc64a('0x1e')]],'as':_0x4ed83c['as'],'attributes':_0x4ed83c[_0xc64a('0x1c')],'include':_0x4ed83c[_0xc64a('0x1f')]?_[_0xc64a('0x1d')](_0x4ed83c[_0xc64a('0x1f')],function(_0x42a79c){return{'model':db[_0x42a79c[_0xc64a('0x1e')]],'as':_0x42a79c['as'],'attributes':_0x42a79c['attributes']};}):[]};}):[]};}):[]:[]})[_0xc64a('0xc')](function(_0x51971e){logger['info']('ShowSquareOdbc',_0x56fad5);logger[_0xc64a('0x10')]('ShowSquareOdbc',_0x56fad5,JSON[_0xc64a('0x12')](_0x51971e));_0x307be2(_0x51971e);})[_0xc64a('0x16')](function(_0x564078){logger['error']('ShowSquareOdbc',_0x564078[_0xc64a('0x15')],_0x56fad5);_0xc52e01(_0x33f996[_0xc64a('0x13')](0x1f4,_0x564078[_0xc64a('0x15')]));});});}; \ No newline at end of file +var _0xea4b=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch','SquareOdbc','find','options','raw','where','attributes','map','include','model','ShowSquareOdbc','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x842858,_0x3a3ca0){var _0x46c2a2=function(_0x47f795){while(--_0x47f795){_0x842858['push'](_0x842858['shift']());}};_0x46c2a2(++_0x3a3ca0);}(_0xea4b,0x10b));var _0xbea4=function(_0x5e8763,_0x558211){_0x5e8763=_0x5e8763-0x0;var _0x286b08=_0xea4b[_0x5e8763];return _0x286b08;};'use strict';var _=require(_0xbea4('0x0'));var util=require('util');var moment=require(_0xbea4('0x1'));var BPromise=require('bluebird');var rs=require(_0xbea4('0x2'));var fs=require('fs');var Redis=require(_0xbea4('0x3'));var db=require(_0xbea4('0x4'))['db'];var utils=require(_0xbea4('0x5'));var logger=require(_0xbea4('0x6'))('rpc');var config=require(_0xbea4('0x7'));var jayson=require(_0xbea4('0x8'));var client=jayson[_0xbea4('0x9')][_0xbea4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x595902,_0x39fbeb,_0x2d694b){return new BPromise(function(_0xabdf84,_0x292c8f){return client[_0xbea4('0xb')](_0x595902,_0x2d694b)[_0xbea4('0xc')](function(_0x475efa){logger[_0xbea4('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x39fbeb,_0xbea4('0xe'));logger[_0xbea4('0xf')](_0xbea4('0x10'),_0x39fbeb,_0xbea4('0xe'),JSON[_0xbea4('0x11')](_0x475efa));if(_0x475efa['error']){if(_0x475efa[_0xbea4('0x12')][_0xbea4('0x13')]===0x1f4){logger[_0xbea4('0x12')](_0xbea4('0x14'),_0x39fbeb,_0x475efa[_0xbea4('0x12')][_0xbea4('0x15')]);return _0x292c8f(_0x475efa[_0xbea4('0x12')][_0xbea4('0x15')]);}logger[_0xbea4('0x12')](_0xbea4('0x14'),_0x39fbeb,_0x475efa['error'][_0xbea4('0x15')]);return _0xabdf84(_0x475efa[_0xbea4('0x12')][_0xbea4('0x15')]);}else{logger['info'](_0xbea4('0x14'),_0x39fbeb,'request\x20sent');_0xabdf84(_0x475efa[_0xbea4('0x16')][_0xbea4('0x15')]);}})[_0xbea4('0x17')](function(_0x3de07d){logger[_0xbea4('0x12')](_0xbea4('0x14'),_0x39fbeb,_0x3de07d);_0x292c8f(_0x3de07d);});});}exports['ShowSquareOdbc']=function(_0x431c41){var _0x337e95=this;return new Promise(function(_0xb5fa4e,_0x529121){return db[_0xbea4('0x18')][_0xbea4('0x19')]({'raw':_0x431c41[_0xbea4('0x1a')]?_0x431c41[_0xbea4('0x1a')][_0xbea4('0x1b')]===undefined?!![]:![]:!![],'where':_0x431c41[_0xbea4('0x1a')]?_0x431c41[_0xbea4('0x1a')][_0xbea4('0x1c')]||null:null,'attributes':_0x431c41[_0xbea4('0x1a')]?_0x431c41[_0xbea4('0x1a')][_0xbea4('0x1d')]||null:null,'include':_0x431c41[_0xbea4('0x1a')]?_0x431c41[_0xbea4('0x1a')]['include']?_[_0xbea4('0x1e')](_0x431c41[_0xbea4('0x1a')][_0xbea4('0x1f')],function(_0xf2da2){return{'model':db[_0xf2da2[_0xbea4('0x20')]],'as':_0xf2da2['as'],'attributes':_0xf2da2[_0xbea4('0x1d')],'include':_0xf2da2[_0xbea4('0x1f')]?_[_0xbea4('0x1e')](_0xf2da2[_0xbea4('0x1f')],function(_0xe09e08){return{'model':db[_0xe09e08[_0xbea4('0x20')]],'as':_0xe09e08['as'],'attributes':_0xe09e08['attributes'],'include':_0xe09e08[_0xbea4('0x1f')]?_['map'](_0xe09e08[_0xbea4('0x1f')],function(_0x5ae0d4){return{'model':db[_0x5ae0d4[_0xbea4('0x20')]],'as':_0x5ae0d4['as'],'attributes':_0x5ae0d4[_0xbea4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbea4('0xc')](function(_0x3b94ab){logger['info'](_0xbea4('0x21'),_0x431c41);logger[_0xbea4('0xf')](_0xbea4('0x21'),_0x431c41,JSON[_0xbea4('0x11')](_0x3b94ab));_0xb5fa4e(_0x3b94ab);})[_0xbea4('0x17')](function(_0x243f22){logger[_0xbea4('0x12')](_0xbea4('0x21'),_0x243f22['message'],_0x431c41);_0x529121(_0x337e95['error'](0x1f4,_0x243f22[_0xbea4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 7108a98..9f481c5 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 _0xc31f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id','show','create','put','delete','exports','multer','util'];(function(_0x115ac0,_0x3dc028){var _0x1bc04e=function(_0x1eefef){while(--_0x1eefef){_0x115ac0['push'](_0x115ac0['shift']());}};_0x1bc04e(++_0x3dc028);}(_0xc31f,0x14e));var _0xfc31=function(_0x225944,_0xbaf68a){_0x225944=_0x225944-0x0;var _0x5393e1=_0xc31f[_0x225944];return _0x5393e1;};'use strict';var multer=require(_0xfc31('0x0'));var util=require(_0xfc31('0x1'));var path=require(_0xfc31('0x2'));var timeout=require(_0xfc31('0x3'));var express=require(_0xfc31('0x4'));var router=express[_0xfc31('0x5')]();var fs_extra=require(_0xfc31('0x6'));var auth=require(_0xfc31('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0xfc31('0x8')]('/',auth[_0xfc31('0x9')](),controller['index']);router['get'](_0xfc31('0xa'),auth['isAuthenticated'](),controller[_0xfc31('0xb')]);router['post']('/',auth[_0xfc31('0x9')](),controller[_0xfc31('0xc')]);router[_0xfc31('0xd')](_0xfc31('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xfc31('0xe')](_0xfc31('0xa'),auth[_0xfc31('0x9')](),controller['destroy']);module[_0xfc31('0xf')]=router; \ No newline at end of file +var _0xc5ed=['index','show','post','create','put','/:id','update','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated'];(function(_0x4fbdc8,_0x265bdb){var _0x5dd79d=function(_0xe9d7c){while(--_0xe9d7c){_0x4fbdc8['push'](_0x4fbdc8['shift']());}};_0x5dd79d(++_0x265bdb);}(_0xc5ed,0x194));var _0xdc5e=function(_0x5e3e7d,_0x248b95){_0x5e3e7d=_0x5e3e7d-0x0;var _0x3fc549=_0xc5ed[_0x5e3e7d];return _0x3fc549;};'use strict';var multer=require('multer');var util=require(_0xdc5e('0x0'));var path=require(_0xdc5e('0x1'));var timeout=require('connect-timeout');var express=require(_0xdc5e('0x2'));var router=express[_0xdc5e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdc5e('0x4'));var interaction=require(_0xdc5e('0x5'));var config=require(_0xdc5e('0x6'));var controller=require(_0xdc5e('0x7'));router[_0xdc5e('0x8')]('/',auth[_0xdc5e('0x9')](),controller[_0xdc5e('0xa')]);router[_0xdc5e('0x8')]('/:id',auth[_0xdc5e('0x9')](),controller[_0xdc5e('0xb')]);router[_0xdc5e('0xc')]('/',auth[_0xdc5e('0x9')](),controller[_0xdc5e('0xd')]);router[_0xdc5e('0xe')](_0xdc5e('0xf'),auth[_0xdc5e('0x9')](),controller[_0xdc5e('0x10')]);router['delete'](_0xdc5e('0xf'),auth[_0xdc5e('0x9')](),controller['destroy']);module[_0xdc5e('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 1682a4a..05bd968 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 _0x6888=['DATE','sequelize','exports','STRING','name','TEXT','BLOB','long','preproduction','toString','utf8','getDataValue','production'];(function(_0x1fa760,_0x1bf063){var _0xd8eda1=function(_0x4a21d6){while(--_0x4a21d6){_0x1fa760['push'](_0x1fa760['shift']());}};_0xd8eda1(++_0x1bf063);}(_0x6888,0x146));var _0x8688=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x6888[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require(_0x8688('0x0'));module[_0x8688('0x1')]={'name':{'type':Sequelize[_0x8688('0x2')],'unique':_0x8688('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x8688('0x2')]},'notes':{'type':Sequelize[_0x8688('0x4')]},'preproduction':{'type':Sequelize[_0x8688('0x5')](_0x8688('0x6')),'get':function(){if(this['getDataValue'](_0x8688('0x7'))){return this['getDataValue']('preproduction')[_0x8688('0x8')](_0x8688('0x9'));}}},'production':{'type':Sequelize[_0x8688('0x5')](_0x8688('0x6')),'get':function(){if(this[_0x8688('0xa')](_0x8688('0xb'))){return this['getDataValue'](_0x8688('0xb'))[_0x8688('0x8')](_0x8688('0x9'));}}},'savedAt':{'type':Sequelize[_0x8688('0xc')]},'publishedAt':{'type':Sequelize[_0x8688('0xc')]}}; \ No newline at end of file +var _0xa7ee=['utf8','long','production','DATE','sequelize','STRING','name','TEXT','getDataValue','preproduction','toString'];(function(_0x328b40,_0x370642){var _0x556a56=function(_0x467553){while(--_0x467553){_0x328b40['push'](_0x328b40['shift']());}};_0x556a56(++_0x370642);}(_0xa7ee,0x159));var _0xea7e=function(_0x68359d,_0x51477f){_0x68359d=_0x68359d-0x0;var _0x15d875=_0xa7ee[_0x68359d];return _0x15d875;};'use strict';var Sequelize=require(_0xea7e('0x0'));module['exports']={'name':{'type':Sequelize[_0xea7e('0x1')],'unique':_0xea7e('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xea7e('0x1')]},'notes':{'type':Sequelize[_0xea7e('0x3')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0xea7e('0x4')]('preproduction')){return this[_0xea7e('0x4')](_0xea7e('0x5'))[_0xea7e('0x6')](_0xea7e('0x7'));}}},'production':{'type':Sequelize['BLOB'](_0xea7e('0x8')),'get':function(){if(this[_0xea7e('0x4')](_0xea7e('0x9'))){return this[_0xea7e('0x4')](_0xea7e('0x9'))['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0xea7e('0xa')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index a8e6052..220b267 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 _0xe7be=['production','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','status','json','offset','undefined','count','Content-Range','update','destroy','then','get','publish','agi','stringify','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','merge','filter','includeAll','findAll','rows','catch','show','keys','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','pick'];(function(_0x353c9b,_0x963d4b){var _0x37b8f4=function(_0x56d4ee){while(--_0x56d4ee){_0x353c9b['push'](_0x353c9b['shift']());}};_0x37b8f4(++_0x963d4b);}(_0xe7be,0x1cf));var _0xee7b=function(_0x5f0d94,_0x5618be){_0x5f0d94=_0x5f0d94-0x0;var _0x4fe50d=_0xe7be[_0x5f0d94];return _0x4fe50d;};'use strict';var _=require('lodash');var Redis=require(_0xee7b('0x0'));var qs=require(_0xee7b('0x1'));var logger=require(_0xee7b('0x2'))('api');var config=require('../../config/environment');var db=require(_0xee7b('0x3'))['db'];config[_0xee7b('0x4')]=_[_0xee7b('0x5')](config[_0xee7b('0x4')],{'host':_0xee7b('0x6'),'port':0x18eb});var socket=require(_0xee7b('0x7'))(new Redis(config['redis']));require(_0xee7b('0x8'))['register'](socket);function respondWithResult(_0x140240,_0x14e274){_0x14e274=_0x14e274||0xc8;return function(_0x338032){if(_0x338032){return _0x140240[_0xee7b('0x9')](_0x14e274)[_0xee7b('0xa')](_0x338032);}};}function respondWithFilteredResult(_0xbb8bdf,_0xb2f785){return function(_0x1355c1){if(_0x1355c1){var _0x489dd7=typeof _0xb2f785[_0xee7b('0xb')]===_0xee7b('0xc')&&typeof _0xb2f785['limit']===_0xee7b('0xc');var _0x515f5e=_0x1355c1[_0xee7b('0xd')];var _0x4fbb0f=_0x489dd7?0x0:_0xb2f785['offset'];var _0x36b60d=_0x489dd7?_0x1355c1[_0xee7b('0xd')]:_0xb2f785['offset']+_0xb2f785['limit'];var _0x3852d8;if(_0x36b60d>=_0x515f5e){_0x36b60d=_0x515f5e;_0x3852d8=0xc8;}else{_0x3852d8=0xce;}_0xbb8bdf[_0xee7b('0x9')](_0x3852d8);return _0xbb8bdf['set'](_0xee7b('0xe'),_0x4fbb0f+'-'+_0x36b60d+'/'+_0x515f5e)['json'](_0x1355c1);}return null;};}function saveUpdates(_0x1ba541){return function(_0x3e2b90){if(_0x3e2b90){return _0x3e2b90[_0xee7b('0xf')](_0x1ba541)['then'](function(_0x960e0){return _0x960e0;});}return null;};}function removeEntity(_0x1f8582){return function(_0x12243f){if(_0x12243f){return _0x12243f[_0xee7b('0x10')]()[_0xee7b('0x11')](function(){var _0x4da326=_0x12243f[_0xee7b('0x12')]({'plain':!![]});var _0x5b982c='SquareProjects';return db['UserProfileResource'][_0xee7b('0x10')]({'where':{'type':_0x5b982c,'resourceId':_0x4da326['id']}})['then'](function(){return _0x12243f;});})[_0xee7b('0x11')](function(){var _0x4dbf0f=new Redis(config[_0xee7b('0x4')]);_0x4dbf0f[_0xee7b('0x13')](_0xee7b('0x14'),JSON[_0xee7b('0x15')]({'id':_0x12243f['id'],'deleted':!![]}));})[_0xee7b('0x11')](function(){_0x1f8582[_0xee7b('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aa15f){return function(_0x16d543){if(!_0x16d543){_0x4aa15f[_0xee7b('0x16')](0x194);}return _0x16d543;};}function handleError(_0x538b67,_0x5a20f3){_0x5a20f3=_0x5a20f3||0x1f4;return function(_0x14a62b){logger[_0xee7b('0x17')](_0x14a62b[_0xee7b('0x18')]);if(_0x14a62b['name']){delete _0x14a62b[_0xee7b('0x19')];}_0x538b67[_0xee7b('0x9')](_0x5a20f3)[_0xee7b('0x1a')](_0x14a62b);};}exports[_0xee7b('0x1b')]=function(_0x571e68,_0x23c84d){var _0x1a46c8={},_0x23babf={},_0x28a27e={'count':0x0,'rows':[]};var _0x8b6b69=_[_0xee7b('0x1c')](db[_0xee7b('0x1d')][_0xee7b('0x1e')],function(_0x19af4e){return{'name':_0x19af4e[_0xee7b('0x1f')],'type':_0x19af4e[_0xee7b('0x20')]['key']};});_0x23babf[_0xee7b('0x21')]=_[_0xee7b('0x1c')](_0x8b6b69,_0xee7b('0x19'));_0x23babf[_0xee7b('0x22')]=_['keys'](_0x571e68[_0xee7b('0x22')]);_0x23babf[_0xee7b('0x23')]=_[_0xee7b('0x24')](_0x23babf[_0xee7b('0x21')],_0x23babf[_0xee7b('0x22')]);_0x1a46c8[_0xee7b('0x25')]=_['intersection'](_0x23babf[_0xee7b('0x21')],qs[_0xee7b('0x26')](_0x571e68['query']['fields']));_0x1a46c8['attributes']=_0x1a46c8[_0xee7b('0x25')]['length']?_0x1a46c8['attributes']:_0x23babf['model'];if(!_0x571e68[_0xee7b('0x22')][_0xee7b('0x27')](_0xee7b('0x28'))){_0x1a46c8[_0xee7b('0x29')]=qs[_0xee7b('0x29')](_0x571e68[_0xee7b('0x22')][_0xee7b('0x29')]);_0x1a46c8[_0xee7b('0xb')]=qs['offset'](_0x571e68[_0xee7b('0x22')][_0xee7b('0xb')]);}_0x1a46c8['order']=qs[_0xee7b('0x2a')](_0x571e68[_0xee7b('0x22')]['sort']);_0x1a46c8[_0xee7b('0x2b')]=qs[_0xee7b('0x23')](_['pick'](_0x571e68['query'],_0x23babf[_0xee7b('0x23')]),_0x8b6b69);if(_0x571e68[_0xee7b('0x22')]['filter']){_0x1a46c8[_0xee7b('0x2b')]=_[_0xee7b('0x2c')](_0x1a46c8['where'],{'$or':_[_0xee7b('0x1c')](_0x8b6b69,function(_0x1b6dbc){if(_0x1b6dbc[_0xee7b('0x20')]!=='VIRTUAL'){var _0x4262af={};_0x4262af[_0x1b6dbc[_0xee7b('0x19')]]={'$like':'%'+_0x571e68['query'][_0xee7b('0x2d')]+'%'};return _0x4262af;}})});}_0x1a46c8=_[_0xee7b('0x2c')]({},_0x1a46c8,_0x571e68['options']);var _0x29dd4b={'where':_0x1a46c8[_0xee7b('0x2b')]};return db['SquareProject'][_0xee7b('0xd')](_0x29dd4b)[_0xee7b('0x11')](function(_0x56fc07){_0x28a27e[_0xee7b('0xd')]=_0x56fc07;if(_0x571e68['query'][_0xee7b('0x2e')]){_0x1a46c8['include']=[{'all':!![]}];}return db['SquareProject'][_0xee7b('0x2f')](_0x1a46c8);})[_0xee7b('0x11')](function(_0x49b9b2){_0x28a27e[_0xee7b('0x30')]=_0x49b9b2;return _0x28a27e;})[_0xee7b('0x11')](respondWithFilteredResult(_0x23c84d,_0x1a46c8))[_0xee7b('0x31')](handleError(_0x23c84d,null));};exports[_0xee7b('0x32')]=function(_0x28a37b,_0x5ea799){var _0x3432a1={'raw':![],'where':{'id':_0x28a37b['params']['id']}},_0x3c8178={};_0x3c8178[_0xee7b('0x21')]=_[_0xee7b('0x33')](db['SquareProject'][_0xee7b('0x1e')]);_0x3c8178['query']=_[_0xee7b('0x33')](_0x28a37b[_0xee7b('0x22')]);_0x3c8178[_0xee7b('0x23')]=_[_0xee7b('0x24')](_0x3c8178['model'],_0x3c8178[_0xee7b('0x22')]);_0x3432a1['attributes']=_['intersection'](_0x3c8178[_0xee7b('0x21')],qs[_0xee7b('0x26')](_0x28a37b[_0xee7b('0x22')]['fields']));_0x3432a1[_0xee7b('0x25')]=_0x3432a1['attributes'][_0xee7b('0x34')]?_0x3432a1[_0xee7b('0x25')]:_0x3c8178['model'];if(_0x28a37b['query'][_0xee7b('0x2e')]){_0x3432a1['include']=[{'all':!![]}];}_0x3432a1=_[_0xee7b('0x2c')]({},_0x3432a1,_0x28a37b[_0xee7b('0x35')]);return db[_0xee7b('0x1d')]['find'](_0x3432a1)[_0xee7b('0x11')](handleEntityNotFound(_0x5ea799,null))[_0xee7b('0x11')](respondWithResult(_0x5ea799,null))[_0xee7b('0x31')](handleError(_0x5ea799,null));};exports['create']=function(_0x317313,_0x3eeb85){return db[_0xee7b('0x1d')][_0xee7b('0x36')](_0x317313[_0xee7b('0x37')],{})[_0xee7b('0x11')](function(_0xefc6f9){var _0x362bbf=_0x317313[_0xee7b('0x38')]['get']({'plain':!![]});if(!_0x362bbf)throw new Error(_0xee7b('0x39'));if(_0x362bbf['role']==='user'){var _0x6f7239=_0xefc6f9[_0xee7b('0x12')]({'plain':!![]});var _0x370136='SquareProjects';return db['UserProfileSection'][_0xee7b('0x3a')]({'where':{'name':_0x370136,'userProfileId':_0x362bbf[_0xee7b('0x3b')]},'raw':!![]})[_0xee7b('0x11')](function(_0x5446f1){if(_0x5446f1&&_0x5446f1[_0xee7b('0x3c')]===0x0){return db[_0xee7b('0x3d')][_0xee7b('0x36')]({'name':_0x6f7239['name'],'resourceId':_0x6f7239['id'],'type':_0x5446f1[_0xee7b('0x19')],'sectionId':_0x5446f1['id']},{})['then'](function(){return _0xefc6f9;});}else{return _0xefc6f9;}})[_0xee7b('0x31')](function(_0x25870e){logger[_0xee7b('0x17')](_0xee7b('0x3e'),_0x25870e);throw _0x25870e;});}return _0xefc6f9;})[_0xee7b('0x11')](respondWithResult(_0x3eeb85,0xc9))[_0xee7b('0x31')](handleError(_0x3eeb85,null));};exports[_0xee7b('0xf')]=function(_0x3c61b3,_0x391980){if(_0x3c61b3[_0xee7b('0x37')]['id']){delete _0x3c61b3[_0xee7b('0x37')]['id'];}return db['SquareProject'][_0xee7b('0x3a')]({'where':{'id':_0x3c61b3[_0xee7b('0x3f')]['id']}})['then'](handleEntityNotFound(_0x391980,null))[_0xee7b('0x11')](saveUpdates(_0x3c61b3['body'],null))[_0xee7b('0x11')](function(_0x28a957){if(!_0x28a957)return;var _0x314047=_0x28a957[_0xee7b('0x12')]({'plain':!![]});return _0x314047;})[_0xee7b('0x11')](function(_0x416ffe){var _0x378b11=new Redis(config[_0xee7b('0x4')]);_0x378b11[_0xee7b('0x13')](_0xee7b('0x14'),JSON['stringify'](_[_0xee7b('0x40')](_0x416ffe,['id',_0xee7b('0x19'),_0xee7b('0x41')])));return _0x416ffe;})[_0xee7b('0x11')](respondWithResult(_0x391980,null))[_0xee7b('0x31')](handleError(_0x391980,null));};exports[_0xee7b('0x10')]=function(_0x2ad726,_0x7d5d02){return db['SquareProject'][_0xee7b('0x3a')]({'where':{'id':_0x2ad726[_0xee7b('0x3f')]['id']}})[_0xee7b('0x11')](handleEntityNotFound(_0x7d5d02,null))[_0xee7b('0x11')](removeEntity(_0x7d5d02,null))[_0xee7b('0x31')](handleError(_0x7d5d02,null));}; \ No newline at end of file +var _0xd949=['stringify','end','sendStatus','error','name','index','map','SquareProject','type','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','rows','catch','params','rawAttributes','length','includeAll','options','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','body','find','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi'];(function(_0x371fab,_0x8629a0){var _0x388ca4=function(_0x20967b){while(--_0x20967b){_0x371fab['push'](_0x371fab['shift']());}};_0x388ca4(++_0x8629a0);}(_0xd949,0x1b2));var _0x9d94=function(_0x84b885,_0x5594fa){_0x84b885=_0x84b885-0x0;var _0x14c0ac=_0xd949[_0x84b885];return _0x14c0ac;};'use strict';var _=require(_0x9d94('0x0'));var Redis=require(_0x9d94('0x1'));var qs=require(_0x9d94('0x2'));var logger=require(_0x9d94('0x3'))('api');var config=require(_0x9d94('0x4'));var db=require(_0x9d94('0x5'))['db'];config[_0x9d94('0x6')]=_[_0x9d94('0x7')](config[_0x9d94('0x6')],{'host':_0x9d94('0x8'),'port':0x18eb});var socket=require(_0x9d94('0x9'))(new Redis(config[_0x9d94('0x6')]));require(_0x9d94('0xa'))[_0x9d94('0xb')](socket);function respondWithResult(_0x378b68,_0x6b18df){_0x6b18df=_0x6b18df||0xc8;return function(_0x3f7414){if(_0x3f7414){return _0x378b68[_0x9d94('0xc')](_0x6b18df)['json'](_0x3f7414);}};}function respondWithFilteredResult(_0x3fd731,_0x154648){return function(_0x25b7f1){if(_0x25b7f1){var _0x34438a=typeof _0x154648[_0x9d94('0xd')]===_0x9d94('0xe')&&typeof _0x154648[_0x9d94('0xf')]===_0x9d94('0xe');var _0x5445a3=_0x25b7f1[_0x9d94('0x10')];var _0x404bed=_0x34438a?0x0:_0x154648['offset'];var _0x3a3418=_0x34438a?_0x25b7f1[_0x9d94('0x10')]:_0x154648['offset']+_0x154648[_0x9d94('0xf')];var _0x56ccc7;if(_0x3a3418>=_0x5445a3){_0x3a3418=_0x5445a3;_0x56ccc7=0xc8;}else{_0x56ccc7=0xce;}_0x3fd731[_0x9d94('0xc')](_0x56ccc7);return _0x3fd731[_0x9d94('0x11')](_0x9d94('0x12'),_0x404bed+'-'+_0x3a3418+'/'+_0x5445a3)[_0x9d94('0x13')](_0x25b7f1);}return null;};}function saveUpdates(_0x349114){return function(_0xeb2dd6){if(_0xeb2dd6){return _0xeb2dd6[_0x9d94('0x14')](_0x349114)[_0x9d94('0x15')](function(_0x3a9a99){return _0x3a9a99;});}return null;};}function removeEntity(_0xaa4911){return function(_0x2862fa){if(_0x2862fa){return _0x2862fa[_0x9d94('0x16')]()[_0x9d94('0x15')](function(){var _0x1072da=_0x2862fa[_0x9d94('0x17')]({'plain':!![]});var _0x3200ca=_0x9d94('0x18');return db[_0x9d94('0x19')][_0x9d94('0x16')]({'where':{'type':_0x3200ca,'resourceId':_0x1072da['id']}})['then'](function(){return _0x2862fa;});})['then'](function(){var _0x21004f=new Redis(config[_0x9d94('0x6')]);_0x21004f[_0x9d94('0x1a')](_0x9d94('0x1b'),JSON[_0x9d94('0x1c')]({'id':_0x2862fa['id'],'deleted':!![]}));})[_0x9d94('0x15')](function(){_0xaa4911[_0x9d94('0xc')](0xcc)[_0x9d94('0x1d')]();});}};}function handleEntityNotFound(_0x131ad0){return function(_0x4a117f){if(!_0x4a117f){_0x131ad0[_0x9d94('0x1e')](0x194);}return _0x4a117f;};}function handleError(_0x1506a1,_0x4ab060){_0x4ab060=_0x4ab060||0x1f4;return function(_0x3ecc43){logger[_0x9d94('0x1f')](_0x3ecc43['stack']);if(_0x3ecc43[_0x9d94('0x20')]){delete _0x3ecc43['name'];}_0x1506a1[_0x9d94('0xc')](_0x4ab060)['send'](_0x3ecc43);};}exports[_0x9d94('0x21')]=function(_0x1678ec,_0x1c284d){var _0x440011={},_0x411c7f={},_0x203e08={'count':0x0,'rows':[]};var _0x2ca550=_[_0x9d94('0x22')](db[_0x9d94('0x23')]['rawAttributes'],function(_0x1f6694){return{'name':_0x1f6694['fieldName'],'type':_0x1f6694[_0x9d94('0x24')]['key']};});_0x411c7f[_0x9d94('0x25')]=_[_0x9d94('0x22')](_0x2ca550,'name');_0x411c7f[_0x9d94('0x26')]=_[_0x9d94('0x27')](_0x1678ec[_0x9d94('0x26')]);_0x411c7f[_0x9d94('0x28')]=_['intersection'](_0x411c7f['model'],_0x411c7f['query']);_0x440011[_0x9d94('0x29')]=_[_0x9d94('0x2a')](_0x411c7f[_0x9d94('0x25')],qs[_0x9d94('0x2b')](_0x1678ec['query'][_0x9d94('0x2b')]));_0x440011[_0x9d94('0x29')]=_0x440011[_0x9d94('0x29')]['length']?_0x440011[_0x9d94('0x29')]:_0x411c7f[_0x9d94('0x25')];if(!_0x1678ec[_0x9d94('0x26')]['hasOwnProperty'](_0x9d94('0x2c'))){_0x440011[_0x9d94('0xf')]=qs['limit'](_0x1678ec['query'][_0x9d94('0xf')]);_0x440011[_0x9d94('0xd')]=qs[_0x9d94('0xd')](_0x1678ec['query'][_0x9d94('0xd')]);}_0x440011[_0x9d94('0x2d')]=qs[_0x9d94('0x2e')](_0x1678ec['query'][_0x9d94('0x2e')]);_0x440011[_0x9d94('0x2f')]=qs[_0x9d94('0x28')](_[_0x9d94('0x30')](_0x1678ec[_0x9d94('0x26')],_0x411c7f[_0x9d94('0x28')]),_0x2ca550);if(_0x1678ec[_0x9d94('0x26')][_0x9d94('0x31')]){_0x440011[_0x9d94('0x2f')]=_['merge'](_0x440011['where'],{'$or':_[_0x9d94('0x22')](_0x2ca550,function(_0x32fa9e){if(_0x32fa9e[_0x9d94('0x24')]!==_0x9d94('0x32')){var _0x3353f7={};_0x3353f7[_0x32fa9e[_0x9d94('0x20')]]={'$like':'%'+_0x1678ec[_0x9d94('0x26')][_0x9d94('0x31')]+'%'};return _0x3353f7;}})});}_0x440011=_[_0x9d94('0x33')]({},_0x440011,_0x1678ec['options']);var _0x40349b={'where':_0x440011[_0x9d94('0x2f')]};return db['SquareProject']['count'](_0x40349b)['then'](function(_0x1bc11f){_0x203e08['count']=_0x1bc11f;if(_0x1678ec[_0x9d94('0x26')]['includeAll']){_0x440011[_0x9d94('0x34')]=[{'all':!![]}];}return db[_0x9d94('0x23')]['findAll'](_0x440011);})[_0x9d94('0x15')](function(_0x4088df){_0x203e08[_0x9d94('0x35')]=_0x4088df;return _0x203e08;})[_0x9d94('0x15')](respondWithFilteredResult(_0x1c284d,_0x440011))[_0x9d94('0x36')](handleError(_0x1c284d,null));};exports['show']=function(_0x4532f3,_0x62d29d){var _0x101e55={'raw':![],'where':{'id':_0x4532f3[_0x9d94('0x37')]['id']}},_0x5bc2c8={};_0x5bc2c8['model']=_[_0x9d94('0x27')](db[_0x9d94('0x23')][_0x9d94('0x38')]);_0x5bc2c8[_0x9d94('0x26')]=_[_0x9d94('0x27')](_0x4532f3[_0x9d94('0x26')]);_0x5bc2c8[_0x9d94('0x28')]=_[_0x9d94('0x2a')](_0x5bc2c8[_0x9d94('0x25')],_0x5bc2c8[_0x9d94('0x26')]);_0x101e55[_0x9d94('0x29')]=_[_0x9d94('0x2a')](_0x5bc2c8['model'],qs[_0x9d94('0x2b')](_0x4532f3['query']['fields']));_0x101e55[_0x9d94('0x29')]=_0x101e55[_0x9d94('0x29')][_0x9d94('0x39')]?_0x101e55[_0x9d94('0x29')]:_0x5bc2c8[_0x9d94('0x25')];if(_0x4532f3[_0x9d94('0x26')][_0x9d94('0x3a')]){_0x101e55['include']=[{'all':!![]}];}_0x101e55=_[_0x9d94('0x33')]({},_0x101e55,_0x4532f3[_0x9d94('0x3b')]);return db[_0x9d94('0x23')]['find'](_0x101e55)[_0x9d94('0x15')](handleEntityNotFound(_0x62d29d,null))['then'](respondWithResult(_0x62d29d,null))[_0x9d94('0x36')](handleError(_0x62d29d,null));};exports['create']=function(_0x14a8e3,_0x457dfd){return db[_0x9d94('0x23')]['create'](_0x14a8e3['body'],{})[_0x9d94('0x15')](function(_0x367b59){var _0x4c656c=_0x14a8e3['user'][_0x9d94('0x17')]({'plain':!![]});if(!_0x4c656c)throw new Error(_0x9d94('0x3c'));if(_0x4c656c['role']==='user'){var _0x3137f3=_0x367b59[_0x9d94('0x17')]({'plain':!![]});var _0x15e3fc=_0x9d94('0x18');return db[_0x9d94('0x3d')]['find']({'where':{'name':_0x15e3fc,'userProfileId':_0x4c656c[_0x9d94('0x3e')]},'raw':!![]})[_0x9d94('0x15')](function(_0x259ace){if(_0x259ace&&_0x259ace['autoAssociation']===0x0){return db[_0x9d94('0x19')]['create']({'name':_0x3137f3['name'],'resourceId':_0x3137f3['id'],'type':_0x259ace[_0x9d94('0x20')],'sectionId':_0x259ace['id']},{})['then'](function(){return _0x367b59;});}else{return _0x367b59;}})[_0x9d94('0x36')](function(_0x310ab3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x310ab3);throw _0x310ab3;});}return _0x367b59;})[_0x9d94('0x15')](respondWithResult(_0x457dfd,0xc9))[_0x9d94('0x36')](handleError(_0x457dfd,null));};exports[_0x9d94('0x14')]=function(_0x52c22a,_0x1aa9b9){if(_0x52c22a['body']['id']){delete _0x52c22a[_0x9d94('0x3f')]['id'];}return db[_0x9d94('0x23')][_0x9d94('0x40')]({'where':{'id':_0x52c22a[_0x9d94('0x37')]['id']}})[_0x9d94('0x15')](handleEntityNotFound(_0x1aa9b9,null))[_0x9d94('0x15')](saveUpdates(_0x52c22a[_0x9d94('0x3f')],null))[_0x9d94('0x15')](function(_0x2f1a02){if(!_0x2f1a02)return;var _0x255b78=_0x2f1a02['get']({'plain':!![]});return _0x255b78;})[_0x9d94('0x15')](function(_0x36ef42){var _0x189809=new Redis(config[_0x9d94('0x6')]);_0x189809[_0x9d94('0x1a')]('agi',JSON[_0x9d94('0x1c')](_['pick'](_0x36ef42,['id',_0x9d94('0x20'),_0x9d94('0x41')])));return _0x36ef42;})[_0x9d94('0x15')](respondWithResult(_0x1aa9b9,null))['catch'](handleError(_0x1aa9b9,null));};exports['destroy']=function(_0x86fdcb,_0xaf2064){return db[_0x9d94('0x23')][_0x9d94('0x40')]({'where':{'id':_0x86fdcb[_0x9d94('0x37')]['id']}})[_0x9d94('0x15')](handleEntityNotFound(_0xaf2064,null))[_0x9d94('0x15')](removeEntity(_0xaf2064,null))[_0x9d94('0x36')](handleError(_0xaf2064,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 4bd4190..664017d 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 _0x2b12=['events','../../mysqldb','SquareProject','update','remove','emit','hasOwnProperty','exports'];(function(_0x201c3a,_0x191c6c){var _0x315db2=function(_0x3a774e){while(--_0x3a774e){_0x201c3a['push'](_0x201c3a['shift']());}};_0x315db2(++_0x191c6c);}(_0x2b12,0xa8));var _0x22b1=function(_0x29ef6f,_0x15cf37){_0x29ef6f=_0x29ef6f-0x0;var _0x18eb5f=_0x2b12[_0x29ef6f];return _0x18eb5f;};'use strict';var EventEmitter=require(_0x22b1('0x0'));var SquareProject=require(_0x22b1('0x1'))['db'][_0x22b1('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x22b1('0x3'),'afterDestroy':_0x22b1('0x4')};function emitEvent(_0x47f3a9){return function(_0x51ccfd,_0x43a0bd,_0x5409a4){SquareProjectEvents['emit'](_0x47f3a9+':'+_0x51ccfd['id'],_0x51ccfd);SquareProjectEvents[_0x22b1('0x5')](_0x47f3a9,_0x51ccfd);_0x5409a4(null);};}for(var e in events){if(events[_0x22b1('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x22b1('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x14a6=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','SquareProject'];(function(_0xd36370,_0x5ea327){var _0x272d21=function(_0x245cd4){while(--_0x245cd4){_0xd36370['push'](_0xd36370['shift']());}};_0x272d21(++_0x5ea327);}(_0x14a6,0x176));var _0x614a=function(_0x4874c2,_0x3ce845){_0x4874c2=_0x4874c2-0x0;var _0x3cdd3e=_0x14a6[_0x4874c2];return _0x3cdd3e;};'use strict';var EventEmitter=require(_0x614a('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x614a('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x614a('0x2')](0x0);var events={'afterCreate':_0x614a('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5f0dc4){return function(_0x119bfe,_0x55df11,_0x540839){SquareProjectEvents['emit'](_0x5f0dc4+':'+_0x119bfe['id'],_0x119bfe);SquareProjectEvents[_0x614a('0x4')](_0x5f0dc4,_0x119bfe);_0x540839(null);};}for(var e in events){if(events[_0x614a('0x5')](e)){var event=events[e];SquareProject[_0x614a('0x6')](e,emitEvent(event));}}module[_0x614a('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 73ed37c..f60fa3d 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 _0xe6e2=['rimraf','../../config/environment','./squareProject.attributes','SquareProject','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','util','moment','bluebird','request-promise','path'];(function(_0x3f66a9,_0x30d183){var _0x4a9876=function(_0x16879c){while(--_0x16879c){_0x3f66a9['push'](_0x3f66a9['shift']());}};_0x4a9876(++_0x30d183);}(_0xe6e2,0x8b));var _0x2e6e=function(_0x3fe76b,_0x3c6c63){_0x3fe76b=_0x3fe76b-0x0;var _0x15df75=_0xe6e2[_0x3fe76b];return _0x15df75;};'use strict';var _=require('lodash');var util=require(_0x2e6e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2e6e('0x1'));var BPromise=require(_0x2e6e('0x2'));var rp=require(_0x2e6e('0x3'));var fs=require('fs');var path=require(_0x2e6e('0x4'));var rimraf=require(_0x2e6e('0x5'));var config=require(_0x2e6e('0x6'));var attributes=require(_0x2e6e('0x7'));module['exports']=function(_0x4c4f27,_0x769cae){return _0x4c4f27['define'](_0x2e6e('0x8'),attributes,{'tableName':_0x2e6e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a59ba,_0x45b391,_0x4dabc0){if(_0x1a59ba['changed'](_0x2e6e('0xa'))){_0x1a59ba[_0x2e6e('0xb')]=moment()[_0x2e6e('0xc')](_0x2e6e('0xd'));}if(_0x1a59ba[_0x2e6e('0xe')](_0x2e6e('0xf'))){_0x1a59ba['publishedAt']=moment()[_0x2e6e('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4dabc0(null,_0x1a59ba);}}});}; \ No newline at end of file +var _0x979e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareProject.attributes','define','SquareProject','changed','preproduction','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','util'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x979e,0x153));var _0xe979=function(_0x4882ae,_0x4c7b7b){_0x4882ae=_0x4882ae-0x0;var _0x456b80=_0x979e[_0x4882ae];return _0x456b80;};'use strict';var _=require('lodash');var util=require(_0xe979('0x0'));var logger=require(_0xe979('0x1'))(_0xe979('0x2'));var moment=require(_0xe979('0x3'));var BPromise=require(_0xe979('0x4'));var rp=require(_0xe979('0x5'));var fs=require('fs');var path=require(_0xe979('0x6'));var rimraf=require(_0xe979('0x7'));var config=require('../../config/environment');var attributes=require(_0xe979('0x8'));module['exports']=function(_0x5d7cf7,_0x55212f){return _0x5d7cf7[_0xe979('0x9')](_0xe979('0xa'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a50e0,_0x3a1668,_0x5f4eee){if(_0x3a50e0[_0xe979('0xb')](_0xe979('0xc'))){_0x3a50e0['savedAt']=moment()[_0xe979('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3a50e0[_0xe979('0xb')](_0xe979('0xe'))){_0x3a50e0[_0xe979('0xf')]=moment()['format'](_0xe979('0x10'));}_0x5f4eee(null,_0x3a50e0);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index b58e54c..3e70d7c 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 _0x6af4=['message','ShowSquareProject','find','stringify','ioredis','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','options','raw','where','include','map','model','attributes','then','info','debug','catch','error'];(function(_0x4096a5,_0xc11b3a){var _0x4a0117=function(_0x3ea803){while(--_0x3ea803){_0x4096a5['push'](_0x4096a5['shift']());}};_0x4a0117(++_0xc11b3a);}(_0x6af4,0x17e));var _0x46af=function(_0x5091c1,_0x26ad59){_0x5091c1=_0x5091c1-0x0;var _0x5b7dd1=_0x6af4[_0x5091c1];return _0x5b7dd1;};'use strict';var _=require('lodash');var Redis=require(_0x46af('0x0'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x46af('0x1'));var config=require(_0x46af('0x2'));config[_0x46af('0x3')]=_[_0x46af('0x4')](config['redis'],{'host':_0x46af('0x5'),'port':0x18eb});var socket=require(_0x46af('0x6'))(new Redis(config[_0x46af('0x3')]));require(_0x46af('0x7'))[_0x46af('0x8')](socket);exports[_0x46af('0x9')]=function(_0x459f77){var _0x564469=this;return new Promise(function(_0x589e6b,_0x1f58d9){return db[_0x46af('0xa')]['findAll']({'raw':_0x459f77['options']?_0x459f77[_0x46af('0xb')][_0x46af('0xc')]===undefined?!![]:![]:!![],'where':_0x459f77[_0x46af('0xb')]?_0x459f77[_0x46af('0xb')][_0x46af('0xd')]||null:null,'attributes':_0x459f77[_0x46af('0xb')]?_0x459f77[_0x46af('0xb')]['attributes']||null:null,'limit':_0x459f77[_0x46af('0xb')]?_0x459f77[_0x46af('0xb')]['limit']||null:null,'include':_0x459f77[_0x46af('0xb')]?_0x459f77[_0x46af('0xb')][_0x46af('0xe')]?_[_0x46af('0xf')](_0x459f77['options'][_0x46af('0xe')],function(_0x2cb8e1){return{'model':db[_0x2cb8e1[_0x46af('0x10')]],'as':_0x2cb8e1['as'],'attributes':_0x2cb8e1['attributes'],'include':_0x2cb8e1[_0x46af('0xe')]?_[_0x46af('0xf')](_0x2cb8e1[_0x46af('0xe')],function(_0x2c8e89){return{'model':db[_0x2c8e89[_0x46af('0x10')]],'as':_0x2c8e89['as'],'attributes':_0x2c8e89[_0x46af('0x11')],'include':_0x2c8e89[_0x46af('0xe')]?_[_0x46af('0xf')](_0x2c8e89[_0x46af('0xe')],function(_0xaaa1cf){return{'model':db[_0xaaa1cf[_0x46af('0x10')]],'as':_0xaaa1cf['as'],'attributes':_0xaaa1cf[_0x46af('0x11')]};}):[]};}):[]};}):[]:[]})[_0x46af('0x12')](function(_0x36003d){logger[_0x46af('0x13')](_0x46af('0x9'),_0x459f77);logger[_0x46af('0x14')](_0x46af('0x9'),_0x459f77,JSON['stringify'](_0x36003d));_0x589e6b(_0x36003d);})[_0x46af('0x15')](function(_0x431818){logger[_0x46af('0x16')](_0x46af('0x9'),_0x431818[_0x46af('0x17')],_0x459f77);_0x1f58d9(_0x564469['error'](0x1f4,_0x431818[_0x46af('0x17')]));});});};exports[_0x46af('0x18')]=function(_0x2e7e2d){var _0x35c7aa=this;return new Promise(function(_0x2a67c3,_0x52b97e){return db[_0x46af('0xa')][_0x46af('0x19')]({'raw':_0x2e7e2d[_0x46af('0xb')]?_0x2e7e2d[_0x46af('0xb')]['raw']===undefined?!![]:![]:!![],'where':_0x2e7e2d[_0x46af('0xb')]?_0x2e7e2d[_0x46af('0xb')][_0x46af('0xd')]||null:null,'attributes':_0x2e7e2d[_0x46af('0xb')]?_0x2e7e2d[_0x46af('0xb')]['attributes']||null:null,'include':_0x2e7e2d['options']?_0x2e7e2d[_0x46af('0xb')][_0x46af('0xe')]?_[_0x46af('0xf')](_0x2e7e2d['options'][_0x46af('0xe')],function(_0x2ed831){return{'model':db[_0x2ed831[_0x46af('0x10')]],'as':_0x2ed831['as'],'attributes':_0x2ed831[_0x46af('0x11')],'include':_0x2ed831[_0x46af('0xe')]?_[_0x46af('0xf')](_0x2ed831[_0x46af('0xe')],function(_0xe8ac5f){return{'model':db[_0xe8ac5f[_0x46af('0x10')]],'as':_0xe8ac5f['as'],'attributes':_0xe8ac5f[_0x46af('0x11')],'include':_0xe8ac5f[_0x46af('0xe')]?_['map'](_0xe8ac5f[_0x46af('0xe')],function(_0x10bce4){return{'model':db[_0x10bce4[_0x46af('0x10')]],'as':_0x10bce4['as'],'attributes':_0x10bce4[_0x46af('0x11')]};}):[]};}):[]};}):[]:[]})[_0x46af('0x12')](function(_0x31b172){logger[_0x46af('0x13')](_0x46af('0x18'),_0x2e7e2d);logger[_0x46af('0x14')]('ShowSquareProject',_0x2e7e2d,JSON[_0x46af('0x1a')](_0x31b172));_0x2a67c3(_0x31b172);})[_0x46af('0x15')](function(_0x56a7eb){logger['error'](_0x46af('0x18'),_0x56a7eb[_0x46af('0x17')],_0x2e7e2d);_0x52b97e(_0x35c7aa[_0x46af('0x16')](0x1f4,_0x56a7eb[_0x46af('0x17')]));});});}; \ No newline at end of file +var _0xc5a9=['../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','./squareProject.socket','SquareProject','findAll','options','raw','where','limit','include','map','attributes','model','then','info','debug','catch','error','GetSquareProjects','message','ShowSquareProject','find','stringify','ioredis','../../mysqldb'];(function(_0x48dcc3,_0x2f1cb7){var _0x3c1fcc=function(_0x4e7973){while(--_0x4e7973){_0x48dcc3['push'](_0x48dcc3['shift']());}};_0x3c1fcc(++_0x2f1cb7);}(_0xc5a9,0x1b1));var _0x9c5a=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0xc5a9[_0x365e54];return _0x13317a;};'use strict';var _=require('lodash');var Redis=require(_0x9c5a('0x0'));var db=require(_0x9c5a('0x1'))['db'];var logger=require(_0x9c5a('0x2'))(_0x9c5a('0x3'));var config=require(_0x9c5a('0x4'));config[_0x9c5a('0x5')]=_['defaults'](config[_0x9c5a('0x5')],{'host':_0x9c5a('0x6'),'port':0x18eb});var socket=require(_0x9c5a('0x7'))(new Redis(config[_0x9c5a('0x5')]));require(_0x9c5a('0x8'))['register'](socket);exports['GetSquareProjects']=function(_0x738f1a){var _0x4667f1=this;return new Promise(function(_0x4d18be,_0x76694c){return db[_0x9c5a('0x9')][_0x9c5a('0xa')]({'raw':_0x738f1a[_0x9c5a('0xb')]?_0x738f1a[_0x9c5a('0xb')][_0x9c5a('0xc')]===undefined?!![]:![]:!![],'where':_0x738f1a[_0x9c5a('0xb')]?_0x738f1a[_0x9c5a('0xb')][_0x9c5a('0xd')]||null:null,'attributes':_0x738f1a[_0x9c5a('0xb')]?_0x738f1a[_0x9c5a('0xb')]['attributes']||null:null,'limit':_0x738f1a[_0x9c5a('0xb')]?_0x738f1a['options'][_0x9c5a('0xe')]||null:null,'include':_0x738f1a[_0x9c5a('0xb')]?_0x738f1a[_0x9c5a('0xb')][_0x9c5a('0xf')]?_[_0x9c5a('0x10')](_0x738f1a[_0x9c5a('0xb')][_0x9c5a('0xf')],function(_0x7fd1f1){return{'model':db[_0x7fd1f1['model']],'as':_0x7fd1f1['as'],'attributes':_0x7fd1f1[_0x9c5a('0x11')],'include':_0x7fd1f1[_0x9c5a('0xf')]?_[_0x9c5a('0x10')](_0x7fd1f1['include'],function(_0x4cbdcc){return{'model':db[_0x4cbdcc['model']],'as':_0x4cbdcc['as'],'attributes':_0x4cbdcc[_0x9c5a('0x11')],'include':_0x4cbdcc['include']?_[_0x9c5a('0x10')](_0x4cbdcc[_0x9c5a('0xf')],function(_0x13cbe7){return{'model':db[_0x13cbe7[_0x9c5a('0x12')]],'as':_0x13cbe7['as'],'attributes':_0x13cbe7[_0x9c5a('0x11')]};}):[]};}):[]};}):[]:[]})[_0x9c5a('0x13')](function(_0x59ba12){logger[_0x9c5a('0x14')]('GetSquareProjects',_0x738f1a);logger[_0x9c5a('0x15')]('GetSquareProjects',_0x738f1a,JSON['stringify'](_0x59ba12));_0x4d18be(_0x59ba12);})[_0x9c5a('0x16')](function(_0x48c433){logger[_0x9c5a('0x17')](_0x9c5a('0x18'),_0x48c433[_0x9c5a('0x19')],_0x738f1a);_0x76694c(_0x4667f1['error'](0x1f4,_0x48c433['message']));});});};exports[_0x9c5a('0x1a')]=function(_0x3bfa81){var _0x53acde=this;return new Promise(function(_0x7ed9c0,_0x47765e){return db[_0x9c5a('0x9')][_0x9c5a('0x1b')]({'raw':_0x3bfa81[_0x9c5a('0xb')]?_0x3bfa81[_0x9c5a('0xb')][_0x9c5a('0xc')]===undefined?!![]:![]:!![],'where':_0x3bfa81[_0x9c5a('0xb')]?_0x3bfa81['options']['where']||null:null,'attributes':_0x3bfa81['options']?_0x3bfa81['options'][_0x9c5a('0x11')]||null:null,'include':_0x3bfa81[_0x9c5a('0xb')]?_0x3bfa81['options']['include']?_['map'](_0x3bfa81['options']['include'],function(_0x201a71){return{'model':db[_0x201a71[_0x9c5a('0x12')]],'as':_0x201a71['as'],'attributes':_0x201a71[_0x9c5a('0x11')],'include':_0x201a71[_0x9c5a('0xf')]?_[_0x9c5a('0x10')](_0x201a71['include'],function(_0x4b849d){return{'model':db[_0x4b849d['model']],'as':_0x4b849d['as'],'attributes':_0x4b849d[_0x9c5a('0x11')],'include':_0x4b849d['include']?_[_0x9c5a('0x10')](_0x4b849d['include'],function(_0x3fc6c2){return{'model':db[_0x3fc6c2[_0x9c5a('0x12')]],'as':_0x3fc6c2['as'],'attributes':_0x3fc6c2[_0x9c5a('0x11')]};}):[]};}):[]};}):[]:[]})[_0x9c5a('0x13')](function(_0x3b2a6c){logger[_0x9c5a('0x14')](_0x9c5a('0x1a'),_0x3bfa81);logger[_0x9c5a('0x15')](_0x9c5a('0x1a'),_0x3bfa81,JSON[_0x9c5a('0x1c')](_0x3b2a6c));_0x7ed9c0(_0x3b2a6c);})[_0x9c5a('0x16')](function(_0x546f89){logger[_0x9c5a('0x17')](_0x9c5a('0x1a'),_0x546f89[_0x9c5a('0x19')],_0x3bfa81);_0x47765e(_0x53acde[_0x9c5a('0x17')](0x1f4,_0x546f89[_0x9c5a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 7d3ea93..d6152d9 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 _0x33d9=['./squareProject.events','save','remove','update','emit','removeListener','register','length','squareProject:'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x33d9,0xd8));var _0x933d=function(_0xab985e,_0x39efd1){_0xab985e=_0xab985e-0x0;var _0x52e718=_0x33d9[_0xab985e];return _0x52e718;};'use strict';var SquareProjectEvents=require(_0x933d('0x0'));var events=[_0x933d('0x1'),_0x933d('0x2'),_0x933d('0x3')];function createListener(_0x23ad38,_0x4ff360){return function(_0xee4a69){_0x4ff360[_0x933d('0x4')](_0x23ad38,_0xee4a69);};}function removeListener(_0x181630,_0x439aa5){return function(){SquareProjectEvents[_0x933d('0x5')](_0x181630,_0x439aa5);};}exports[_0x933d('0x6')]=function(_0x1f2c41){for(var _0x2b618b=0x0,_0x4e3b56=events[_0x933d('0x7')];_0x2b618b<_0x4e3b56;_0x2b618b++){var _0x321e2b=events[_0x2b618b];var _0x565239=createListener(_0x933d('0x8')+_0x321e2b,_0x1f2c41);SquareProjectEvents['on'](_0x321e2b,_0x565239);}}; \ No newline at end of file +var _0x4ccd=['removeListener','register','length','squareProject:','./squareProject.events','save','remove','update','emit'];(function(_0x163d71,_0x3fc130){var _0x338b47=function(_0x57b1dc){while(--_0x57b1dc){_0x163d71['push'](_0x163d71['shift']());}};_0x338b47(++_0x3fc130);}(_0x4ccd,0x187));var _0xd4cc=function(_0x1d39f6,_0x146f4a){_0x1d39f6=_0x1d39f6-0x0;var _0x3dbd7a=_0x4ccd[_0x1d39f6];return _0x3dbd7a;};'use strict';var SquareProjectEvents=require(_0xd4cc('0x0'));var events=[_0xd4cc('0x1'),_0xd4cc('0x2'),_0xd4cc('0x3')];function createListener(_0x207db8,_0x5c9f37){return function(_0x5b3f94){_0x5c9f37[_0xd4cc('0x4')](_0x207db8,_0x5b3f94);};}function removeListener(_0x558244,_0x45fa79){return function(){SquareProjectEvents[_0xd4cc('0x5')](_0x558244,_0x45fa79);};}exports[_0xd4cc('0x6')]=function(_0x4d1995){for(var _0x51b959=0x0,_0x4f8895=events[_0xd4cc('0x7')];_0x51b959<_0x4f8895;_0x51b959++){var _0x44d091=events[_0x51b959];var _0x35af53=createListener(_0xd4cc('0x8')+_0x44d091,_0x4d1995);SquareProjectEvents['on'](_0x44d091,_0x35af53);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index b90185f..24142e3 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 _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x396646,_0x35baa5){var _0x29451b=function(_0x26c7dc){while(--_0x26c7dc){_0x396646['push'](_0x396646['shift']());}};_0x29451b(++_0x35baa5);}(_0x7a54,0x106));var _0x47a5=function(_0x25f8bc,_0x53fc97){_0x25f8bc=_0x25f8bc-0x0;var _0xf3bf74=_0x7a54[_0x25f8bc];return _0xf3bf74;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router; \ No newline at end of file +var _0xe14b=['Router','../../components/auth/service','./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','delete','destroy','exports','multer','util','express'];(function(_0xa495bc,_0x157a1d){var _0x17b6dd=function(_0x4174af){while(--_0x4174af){_0xa495bc['push'](_0xa495bc['shift']());}};_0x17b6dd(++_0x157a1d);}(_0xe14b,0x93));var _0xbe14=function(_0x2943cd,_0x5b30f3){_0x2943cd=_0x2943cd-0x0;var _0x271023=_0xe14b[_0x2943cd];return _0x271023;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['get']('/:id/download',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x7')](),controller['create']);router['put'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0xc')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xd')]);module[_0xbe14('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index d0b70ee..933a41b 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 _0xac31=['STRING','VIRTUAL','savePath','lastIndexOf','sequelize','exports'];(function(_0x55c7e4,_0x1746d7){var _0x48b877=function(_0x299ec0){while(--_0x299ec0){_0x55c7e4['push'](_0x55c7e4['shift']());}};_0x48b877(++_0x1746d7);}(_0xac31,0xca));var _0x1ac3=function(_0x29250c,_0x480051){_0x29250c=_0x29250c-0x0;var _0x482c7b=_0xac31[_0x29250c];return _0x482c7b;};'use strict';var Sequelize=require(_0x1ac3('0x0'));module[_0x1ac3('0x1')]={'uniqueid':{'type':Sequelize[_0x1ac3('0x2')]},'callerid':{'type':Sequelize[_0x1ac3('0x2')]},'calleridname':{'type':Sequelize[_0x1ac3('0x2')]},'context':{'type':Sequelize[_0x1ac3('0x2')]},'extension':{'type':Sequelize[_0x1ac3('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1ac3('0x2')]},'dnid':{'type':Sequelize[_0x1ac3('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x1ac3('0x2')]},'savePath':{'type':Sequelize[_0x1ac3('0x2')]},'format':{'type':Sequelize[_0x1ac3('0x3')],'get':function(){var _0x1be223='';var _0x157604=this['getDataValue'](_0x1ac3('0x4'));if(_0x157604){_0x1be223=_0x157604['substring'](_0x157604[_0x1ac3('0x5')]('.'));}return _0x1be223;}}}; \ No newline at end of file +var _0x7217=['lastIndexOf','sequelize','STRING','VIRTUAL','getDataValue','savePath','substring'];(function(_0x30ea5a,_0x194d21){var _0x1bc76d=function(_0x4555ef){while(--_0x4555ef){_0x30ea5a['push'](_0x30ea5a['shift']());}};_0x1bc76d(++_0x194d21);}(_0x7217,0x19e));var _0x7721=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x7217[_0x1cfa0d];return _0xe33279;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7721('0x1')]},'callerid':{'type':Sequelize[_0x7721('0x1')]},'calleridname':{'type':Sequelize[_0x7721('0x1')]},'context':{'type':Sequelize[_0x7721('0x1')]},'extension':{'type':Sequelize[_0x7721('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x7721('0x1')]},'projectName':{'type':Sequelize[_0x7721('0x1')]},'saveName':{'type':Sequelize[_0x7721('0x1')]},'filename':{'type':Sequelize[_0x7721('0x1')]},'savePath':{'type':Sequelize[_0x7721('0x1')]},'format':{'type':Sequelize[_0x7721('0x2')],'get':function(){var _0x18ab6b='';var _0x21f680=this[_0x7721('0x3')](_0x7721('0x4'));if(_0x21f680){_0x18ab6b=_0x21f680[_0x7721('0x5')](_0x21f680[_0x7721('0x6')]('.'));}return _0x18ab6b;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 35e1a21..3c79f12 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 _0xfca0=['%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','to-csv','ejs','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','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','save','then','destroy','error','name','send','rawAttributes','fieldName','type','map','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','SquareRecording','include','catch','show','params','keys','length','includeAll','merge','create','body','find','download','../../components/encryptor','uniqueid','filename','savePath'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfca0,0x121));var _0x0fca=function(_0x45a2e2,_0x92d820){_0x45a2e2=_0x45a2e2-0x0;var _0x9cdd87=_0xfca0[_0x45a2e2];return _0x9cdd87;};'use strict';var emlformat=require(_0x0fca('0x0'));var rimraf=require(_0x0fca('0x1'));var zipdir=require(_0x0fca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0fca('0x3'));var Mustache=require(_0x0fca('0x4'));var util=require('util');var path=require(_0x0fca('0x5'));var sox=require(_0x0fca('0x6'));var csv=require(_0x0fca('0x7'));var ejs=require(_0x0fca('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0fca('0x9'));var squel=require('squel');var crypto=require(_0x0fca('0xa'));var jsforce=require(_0x0fca('0xb'));var deskjs=require(_0x0fca('0xc'));var toCsv=require(_0x0fca('0x7'));var querystring=require('querystring');var Papa=require(_0x0fca('0xd'));var Redis=require(_0x0fca('0xe'));var authService=require(_0x0fca('0xf'));var qs=require(_0x0fca('0x10'));var as=require(_0x0fca('0x11'));var hardwareService=require(_0x0fca('0x12'));var logger=require(_0x0fca('0x13'))(_0x0fca('0x14'));var utils=require(_0x0fca('0x15'));var config=require(_0x0fca('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0fca('0x17'))['db'];function respondWithStatusCode(_0x507e9b,_0x2dba32){_0x2dba32=_0x2dba32||0xcc;return function(_0x110545){if(_0x110545){return _0x507e9b[_0x0fca('0x18')](_0x2dba32);}return _0x507e9b['status'](_0x2dba32)[_0x0fca('0x19')]();};}function respondWithResult(_0x2d6434,_0x49cac2){_0x49cac2=_0x49cac2||0xc8;return function(_0x35f2f8){if(_0x35f2f8){return _0x2d6434[_0x0fca('0x1a')](_0x49cac2)[_0x0fca('0x1b')](_0x35f2f8);}};}function respondWithFilteredResult(_0x1ff45b,_0x521a48){return function(_0x22a633){if(_0x22a633){var _0x46f10f=typeof _0x521a48[_0x0fca('0x1c')]==='undefined'&&typeof _0x521a48[_0x0fca('0x1d')]===_0x0fca('0x1e');var _0x3a6fcb=_0x22a633[_0x0fca('0x1f')];var _0x12170b=_0x46f10f?0x0:_0x521a48['offset'];var _0x19fb42=_0x46f10f?_0x22a633['count']:_0x521a48[_0x0fca('0x1c')]+_0x521a48[_0x0fca('0x1d')];var _0x21c1e6;if(_0x19fb42>=_0x3a6fcb){_0x19fb42=_0x3a6fcb;_0x21c1e6=0xc8;}else{_0x21c1e6=0xce;}_0x1ff45b[_0x0fca('0x1a')](_0x21c1e6);return _0x1ff45b['set'](_0x0fca('0x20'),_0x12170b+'-'+_0x19fb42+'/'+_0x3a6fcb)[_0x0fca('0x1b')](_0x22a633);}return null;};}function patchUpdates(_0xe8009){return function(_0x505546){try{jsonpatch[_0x0fca('0x21')](_0x505546,_0xe8009,!![]);}catch(_0x213102){return BPromise['reject'](_0x213102);}return _0x505546[_0x0fca('0x22')]();};}function saveUpdates(_0x32d1f6,_0x3bea4c){return function(_0x365ab9){if(_0x365ab9){return _0x365ab9['update'](_0x32d1f6)[_0x0fca('0x23')](function(_0x3ac562){return _0x3ac562;});}return null;};}function removeEntity(_0x5002fc,_0x21e96e){return function(_0x49d515){if(_0x49d515){return _0x49d515[_0x0fca('0x24')]()['then'](function(){_0x5002fc[_0x0fca('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f0a14,_0x5533e6){return function(_0x41aba8){if(!_0x41aba8){_0x2f0a14[_0x0fca('0x18')](0x194);}return _0x41aba8;};}function handleError(_0x4f9b70,_0x4f101e){_0x4f101e=_0x4f101e||0x1f4;return function(_0x46bcb6){logger[_0x0fca('0x25')](_0x46bcb6['stack']);if(_0x46bcb6[_0x0fca('0x26')]){delete _0x46bcb6[_0x0fca('0x26')];}_0x4f9b70['status'](_0x4f101e)[_0x0fca('0x27')](_0x46bcb6);};}exports['index']=function(_0x8e80a,_0x41d8e8){var _0x163690={},_0x4e2a66={},_0x56954d={'count':0x0,'rows':[]};var _0x3c547c=_['map'](db['SquareRecording'][_0x0fca('0x28')],function(_0x1344c8){return{'name':_0x1344c8[_0x0fca('0x29')],'type':_0x1344c8[_0x0fca('0x2a')]['key']};});_0x4e2a66['model']=_[_0x0fca('0x2b')](_0x3c547c,_0x0fca('0x26'));_0x4e2a66['query']=_['keys'](_0x8e80a[_0x0fca('0x2c')]);_0x4e2a66[_0x0fca('0x2d')]=_[_0x0fca('0x2e')](_0x4e2a66[_0x0fca('0x2f')],_0x4e2a66[_0x0fca('0x2c')]);_0x163690['attributes']=_['intersection'](_0x4e2a66[_0x0fca('0x2f')],qs[_0x0fca('0x30')](_0x8e80a[_0x0fca('0x2c')][_0x0fca('0x30')]));_0x163690[_0x0fca('0x31')]=_0x163690[_0x0fca('0x31')]['length']?_0x163690[_0x0fca('0x31')]:_0x4e2a66['model'];if(!_0x8e80a[_0x0fca('0x2c')][_0x0fca('0x32')](_0x0fca('0x33'))){_0x163690[_0x0fca('0x1d')]=qs[_0x0fca('0x1d')](_0x8e80a['query'][_0x0fca('0x1d')]);_0x163690[_0x0fca('0x1c')]=qs[_0x0fca('0x1c')](_0x8e80a[_0x0fca('0x2c')]['offset']);}_0x163690[_0x0fca('0x34')]=qs[_0x0fca('0x35')](_0x8e80a[_0x0fca('0x2c')]['sort']);_0x163690[_0x0fca('0x36')]=qs[_0x0fca('0x2d')](_[_0x0fca('0x37')](_0x8e80a['query'],_0x4e2a66[_0x0fca('0x2d')]),_0x3c547c);if(_0x8e80a[_0x0fca('0x2c')]['filter']){_0x163690[_0x0fca('0x36')]=_['merge'](_0x163690[_0x0fca('0x36')],{'$or':_['map'](_0x3c547c,function(_0xc17a02){if(_0xc17a02[_0x0fca('0x2a')]!=='VIRTUAL'){var _0x58076f={};_0x58076f[_0xc17a02[_0x0fca('0x26')]]={'$like':'%'+_0x8e80a[_0x0fca('0x2c')][_0x0fca('0x38')]+'%'};return _0x58076f;}})});}_0x163690=_['merge']({},_0x163690,_0x8e80a[_0x0fca('0x39')]);var _0x332a80={'where':_0x163690['where']};return db[_0x0fca('0x3a')]['count'](_0x332a80)[_0x0fca('0x23')](function(_0x19a65b){_0x56954d[_0x0fca('0x1f')]=_0x19a65b;if(_0x8e80a['query']['includeAll']){_0x163690[_0x0fca('0x3b')]=[{'all':!![]}];}return db[_0x0fca('0x3a')]['findAll'](_0x163690);})[_0x0fca('0x23')](function(_0x3b17b3){_0x56954d['rows']=_0x3b17b3;return _0x56954d;})[_0x0fca('0x23')](respondWithFilteredResult(_0x41d8e8,_0x163690))[_0x0fca('0x3c')](handleError(_0x41d8e8,null));};exports[_0x0fca('0x3d')]=function(_0x2d85ff,_0x1b0239){var _0x3a6c78={'raw':!![],'where':{'id':_0x2d85ff[_0x0fca('0x3e')]['id']}},_0x3aa77f={};_0x3aa77f[_0x0fca('0x2f')]=_['keys'](db[_0x0fca('0x3a')]['rawAttributes']);_0x3aa77f[_0x0fca('0x2c')]=_[_0x0fca('0x3f')](_0x2d85ff[_0x0fca('0x2c')]);_0x3aa77f[_0x0fca('0x2d')]=_['intersection'](_0x3aa77f[_0x0fca('0x2f')],_0x3aa77f[_0x0fca('0x2c')]);_0x3a6c78['attributes']=_[_0x0fca('0x2e')](_0x3aa77f['model'],qs[_0x0fca('0x30')](_0x2d85ff[_0x0fca('0x2c')]['fields']));_0x3a6c78[_0x0fca('0x31')]=_0x3a6c78[_0x0fca('0x31')][_0x0fca('0x40')]?_0x3a6c78['attributes']:_0x3aa77f[_0x0fca('0x2f')];if(_0x2d85ff['query'][_0x0fca('0x41')]){_0x3a6c78[_0x0fca('0x3b')]=[{'all':!![]}];}_0x3a6c78=_[_0x0fca('0x42')]({},_0x3a6c78,_0x2d85ff[_0x0fca('0x39')]);return db[_0x0fca('0x3a')]['find'](_0x3a6c78)['then'](handleEntityNotFound(_0x1b0239,null))[_0x0fca('0x23')](respondWithResult(_0x1b0239,null))['catch'](handleError(_0x1b0239,null));};exports[_0x0fca('0x43')]=function(_0x27858a,_0x1ec119){return db[_0x0fca('0x3a')]['create'](_0x27858a[_0x0fca('0x44')],{})['then'](respondWithResult(_0x1ec119,0xc9))[_0x0fca('0x3c')](handleError(_0x1ec119,null));};exports['update']=function(_0x26a946,_0x31f643){if(_0x26a946[_0x0fca('0x44')]['id']){delete _0x26a946['body']['id'];}return db[_0x0fca('0x3a')][_0x0fca('0x45')]({'where':{'id':_0x26a946[_0x0fca('0x3e')]['id']}})[_0x0fca('0x23')](handleEntityNotFound(_0x31f643,null))[_0x0fca('0x23')](saveUpdates(_0x26a946['body'],null))['then'](respondWithResult(_0x31f643,null))[_0x0fca('0x3c')](handleError(_0x31f643,null));};exports[_0x0fca('0x46')]=function(_0x5a945d,_0x22f800,_0x566d3b){var _0xcafa25=require(_0x0fca('0x47'));var _0x1a66c8=![];var _0x4906df={};if(_0x5a945d[_0x0fca('0x2c')][_0x0fca('0x2a')]&&_0x5a945d[_0x0fca('0x2c')]['type']===_0x0fca('0x48')){_0x4906df[_0x0fca('0x48')]=_0x5a945d[_0x0fca('0x3e')]['id'];}else{_0x4906df['id']=_0x5a945d[_0x0fca('0x3e')]['id'];}return db[_0x0fca('0x3a')]['find']({'where':_0x4906df,'attributes':['id','savePath',_0x0fca('0x49')],'raw':!![]})[_0x0fca('0x23')](handleEntityNotFound(_0x22f800,null))['then'](function(_0x241f2e){if(_0x241f2e){var _0x2bdf4e=_0x241f2e[_0x0fca('0x4a')];var _0x1501a2=util['format'](_0x0fca('0x4b'),_0x2bdf4e);if(fs[_0x0fca('0x4c')](_0x1501a2)){_0x1a66c8=!![];return _0xcafa25[_0x0fca('0x4d')](_0x1501a2,_0x2bdf4e,config['secrets'][_0x0fca('0x4e')])[_0x0fca('0x23')](function(){return _0x241f2e;});}return _0x241f2e;}})['then'](function(_0x379864){if(_0x379864){var _0x23e2ab=_0x379864[_0x0fca('0x4a')];if(!fs[_0x0fca('0x4c')](_0x23e2ab)){throw new db[(_0x0fca('0x4f'))][(_0x0fca('0x50'))](_0x0fca('0x51'));}if(_0x379864[_0x0fca('0x49')]){return _0x22f800[_0x0fca('0x46')](_0x23e2ab,_0x379864[_0x0fca('0x49')]+path['extname'](_0x23e2ab),function(){if(_0x1a66c8){fs[_0x0fca('0x52')](_0x23e2ab);}});}else{return _0x22f800['download'](_0x23e2ab,function(_0x5d659f){if(_0x1a66c8){fs[_0x0fca('0x52')](_0x23e2ab);}});}}})[_0x0fca('0x3c')](function(_0x2140ce){if(_0x2140ce[_0x0fca('0x53')]===_0x0fca('0x51')){_0x22f800[_0x0fca('0x1a')](0x194)[_0x0fca('0x27')]('Not\x20found');}else{return handleError(_0x22f800,null);}});};exports[_0x0fca('0x24')]=function(_0x2aecbc,_0x13e202){return db[_0x0fca('0x3a')][_0x0fca('0x45')]({'where':{'id':_0x2aecbc[_0x0fca('0x3e')]['id']}})[_0x0fca('0x23')](function(_0x2730ca){if(_[_0x0fca('0x54')](_0x2730ca)){throw new ReferenceError(_0x0fca('0x55'));}return _0x2730ca;})[_0x0fca('0x23')](function(_0xdd1bb1){var _0x22a4eb=_0xdd1bb1[_0x0fca('0x4a')];logger['info'](_0x0fca('0x56'),_0x22a4eb);if(!_[_0x0fca('0x54')](_0xdd1bb1[_0x0fca('0x4a')])&&fs[_0x0fca('0x4c')](_0x22a4eb)){logger[_0x0fca('0x57')](_0x0fca('0x58')+_0x22a4eb+_0x0fca('0x59'));fs[_0x0fca('0x5a')](_0x22a4eb);}_0x22a4eb=_0x22a4eb+'.cypher';if(!_['isNil'](_0xdd1bb1[_0x0fca('0x4a')])&&fs[_0x0fca('0x4c')](_0x22a4eb)){logger[_0x0fca('0x57')](_0x0fca('0x58')+_0x22a4eb+_0x0fca('0x59'));fs['unlinkSync'](_0x22a4eb);}return _0xdd1bb1;})[_0x0fca('0x23')](function(_0xee2d07){if(!_0xee2d07)throw new InternalError();return _0xee2d07[_0x0fca('0x24')]();})[_0x0fca('0x23')](function(){_0x13e202[_0x0fca('0x1a')](0xcc)[_0x0fca('0x19')]();})['catch'](handleError(_0x13e202,null));}; \ No newline at end of file +var _0x88d1=['format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','extname','download','unlink','message','SquareRecording\x20not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','error','stack','name','SquareRecording','type','map','query','intersection','model','attributes','fields','length','nolimit','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','filters','find','create','body','update','../../components/encryptor','uniqueid','filename','savePath'];(function(_0x423cec,_0x54e1b6){var _0x318e8c=function(_0x200705){while(--_0x200705){_0x423cec['push'](_0x423cec['shift']());}};_0x318e8c(++_0x54e1b6);}(_0x88d1,0x189));var _0x188d=function(_0xb106c7,_0x1e0c90){_0xb106c7=_0xb106c7-0x0;var _0x24a91e=_0x88d1[_0xb106c7];return _0x24a91e;};'use strict';var emlformat=require(_0x188d('0x0'));var rimraf=require(_0x188d('0x1'));var zipdir=require(_0x188d('0x2'));var jsonpatch=require(_0x188d('0x3'));var rp=require(_0x188d('0x4'));var moment=require(_0x188d('0x5'));var BPromise=require(_0x188d('0x6'));var Mustache=require(_0x188d('0x7'));var util=require(_0x188d('0x8'));var path=require('path');var sox=require(_0x188d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x188d('0xa'));var squel=require('squel');var crypto=require(_0x188d('0xb'));var jsforce=require(_0x188d('0xc'));var deskjs=require(_0x188d('0xd'));var toCsv=require(_0x188d('0xe'));var querystring=require(_0x188d('0xf'));var Papa=require(_0x188d('0x10'));var Redis=require(_0x188d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x188d('0x12'));var hardwareService=require(_0x188d('0x13'));var logger=require(_0x188d('0x14'))(_0x188d('0x15'));var utils=require('../../config/utils');var config=require(_0x188d('0x16'));var licenseUtil=require(_0x188d('0x17'));var db=require(_0x188d('0x18'))['db'];function respondWithStatusCode(_0x3c297d,_0x39622a){_0x39622a=_0x39622a||0xcc;return function(_0x4eaab1){if(_0x4eaab1){return _0x3c297d[_0x188d('0x19')](_0x39622a);}return _0x3c297d[_0x188d('0x1a')](_0x39622a)[_0x188d('0x1b')]();};}function respondWithResult(_0x3970fd,_0x1c1af6){_0x1c1af6=_0x1c1af6||0xc8;return function(_0x24c93f){if(_0x24c93f){return _0x3970fd['status'](_0x1c1af6)[_0x188d('0x1c')](_0x24c93f);}};}function respondWithFilteredResult(_0x19be4f,_0x4aa2d8){return function(_0x7498d){if(_0x7498d){var _0x45d969=typeof _0x4aa2d8[_0x188d('0x1d')]===_0x188d('0x1e')&&typeof _0x4aa2d8[_0x188d('0x1f')]===_0x188d('0x1e');var _0x1639e2=_0x7498d[_0x188d('0x20')];var _0x592b0d=_0x45d969?0x0:_0x4aa2d8['offset'];var _0x2d192d=_0x45d969?_0x7498d['count']:_0x4aa2d8[_0x188d('0x1d')]+_0x4aa2d8[_0x188d('0x1f')];var _0x24fcfc;if(_0x2d192d>=_0x1639e2){_0x2d192d=_0x1639e2;_0x24fcfc=0xc8;}else{_0x24fcfc=0xce;}_0x19be4f[_0x188d('0x1a')](_0x24fcfc);return _0x19be4f[_0x188d('0x21')](_0x188d('0x22'),_0x592b0d+'-'+_0x2d192d+'/'+_0x1639e2)[_0x188d('0x1c')](_0x7498d);}return null;};}function patchUpdates(_0x15952d){return function(_0x392074){try{jsonpatch['apply'](_0x392074,_0x15952d,!![]);}catch(_0x5395fb){return BPromise['reject'](_0x5395fb);}return _0x392074[_0x188d('0x23')]();};}function saveUpdates(_0x112dd5,_0x154387){return function(_0x4efeb3){if(_0x4efeb3){return _0x4efeb3['update'](_0x112dd5)[_0x188d('0x24')](function(_0x102a8b){return _0x102a8b;});}return null;};}function removeEntity(_0x16dc09,_0x4555e5){return function(_0x4b2bb7){if(_0x4b2bb7){return _0x4b2bb7['destroy']()[_0x188d('0x24')](function(){_0x16dc09[_0x188d('0x1a')](0xcc)[_0x188d('0x1b')]();});}};}function handleEntityNotFound(_0x22cbf2,_0x1863ce){return function(_0x5cf598){if(!_0x5cf598){_0x22cbf2[_0x188d('0x19')](0x194);}return _0x5cf598;};}function handleError(_0x33a05b,_0x27b04a){_0x27b04a=_0x27b04a||0x1f4;return function(_0x373185){logger[_0x188d('0x25')](_0x373185[_0x188d('0x26')]);if(_0x373185['name']){delete _0x373185[_0x188d('0x27')];}_0x33a05b[_0x188d('0x1a')](_0x27b04a)['send'](_0x373185);};}exports['index']=function(_0x4a5ca3,_0x1c1b3c){var _0x2d90f3={},_0x3a79af={},_0x4a4e28={'count':0x0,'rows':[]};var _0x30bacb=_['map'](db[_0x188d('0x28')]['rawAttributes'],function(_0x4e147b){return{'name':_0x4e147b['fieldName'],'type':_0x4e147b[_0x188d('0x29')]['key']};});_0x3a79af['model']=_[_0x188d('0x2a')](_0x30bacb,_0x188d('0x27'));_0x3a79af[_0x188d('0x2b')]=_['keys'](_0x4a5ca3[_0x188d('0x2b')]);_0x3a79af['filters']=_[_0x188d('0x2c')](_0x3a79af[_0x188d('0x2d')],_0x3a79af['query']);_0x2d90f3[_0x188d('0x2e')]=_[_0x188d('0x2c')](_0x3a79af['model'],qs[_0x188d('0x2f')](_0x4a5ca3[_0x188d('0x2b')]['fields']));_0x2d90f3[_0x188d('0x2e')]=_0x2d90f3['attributes'][_0x188d('0x30')]?_0x2d90f3[_0x188d('0x2e')]:_0x3a79af['model'];if(!_0x4a5ca3['query']['hasOwnProperty'](_0x188d('0x31'))){_0x2d90f3[_0x188d('0x1f')]=qs['limit'](_0x4a5ca3['query'][_0x188d('0x1f')]);_0x2d90f3[_0x188d('0x1d')]=qs[_0x188d('0x1d')](_0x4a5ca3[_0x188d('0x2b')]['offset']);}_0x2d90f3['order']=qs['sort'](_0x4a5ca3[_0x188d('0x2b')]['sort']);_0x2d90f3[_0x188d('0x32')]=qs['filters'](_[_0x188d('0x33')](_0x4a5ca3['query'],_0x3a79af['filters']),_0x30bacb);if(_0x4a5ca3['query']['filter']){_0x2d90f3[_0x188d('0x32')]=_[_0x188d('0x34')](_0x2d90f3[_0x188d('0x32')],{'$or':_[_0x188d('0x2a')](_0x30bacb,function(_0x24657b){if(_0x24657b['type']!==_0x188d('0x35')){var _0x37d9df={};_0x37d9df[_0x24657b[_0x188d('0x27')]]={'$like':'%'+_0x4a5ca3[_0x188d('0x2b')]['filter']+'%'};return _0x37d9df;}})});}_0x2d90f3=_['merge']({},_0x2d90f3,_0x4a5ca3[_0x188d('0x36')]);var _0x1282aa={'where':_0x2d90f3[_0x188d('0x32')]};return db[_0x188d('0x28')][_0x188d('0x20')](_0x1282aa)[_0x188d('0x24')](function(_0x284ee8){_0x4a4e28['count']=_0x284ee8;if(_0x4a5ca3[_0x188d('0x2b')]['includeAll']){_0x2d90f3[_0x188d('0x37')]=[{'all':!![]}];}return db[_0x188d('0x28')][_0x188d('0x38')](_0x2d90f3);})['then'](function(_0x3ec494){_0x4a4e28[_0x188d('0x39')]=_0x3ec494;return _0x4a4e28;})['then'](respondWithFilteredResult(_0x1c1b3c,_0x2d90f3))[_0x188d('0x3a')](handleError(_0x1c1b3c,null));};exports[_0x188d('0x3b')]=function(_0x584354,_0x358750){var _0x30ef94={'raw':!![],'where':{'id':_0x584354[_0x188d('0x3c')]['id']}},_0x559fbd={};_0x559fbd[_0x188d('0x2d')]=_[_0x188d('0x3d')](db[_0x188d('0x28')][_0x188d('0x3e')]);_0x559fbd[_0x188d('0x2b')]=_['keys'](_0x584354['query']);_0x559fbd[_0x188d('0x3f')]=_['intersection'](_0x559fbd[_0x188d('0x2d')],_0x559fbd[_0x188d('0x2b')]);_0x30ef94['attributes']=_['intersection'](_0x559fbd[_0x188d('0x2d')],qs['fields'](_0x584354[_0x188d('0x2b')][_0x188d('0x2f')]));_0x30ef94['attributes']=_0x30ef94[_0x188d('0x2e')][_0x188d('0x30')]?_0x30ef94[_0x188d('0x2e')]:_0x559fbd[_0x188d('0x2d')];if(_0x584354['query']['includeAll']){_0x30ef94[_0x188d('0x37')]=[{'all':!![]}];}_0x30ef94=_[_0x188d('0x34')]({},_0x30ef94,_0x584354[_0x188d('0x36')]);return db['SquareRecording'][_0x188d('0x40')](_0x30ef94)['then'](handleEntityNotFound(_0x358750,null))[_0x188d('0x24')](respondWithResult(_0x358750,null))[_0x188d('0x3a')](handleError(_0x358750,null));};exports[_0x188d('0x41')]=function(_0x27969e,_0x1ae784){return db[_0x188d('0x28')][_0x188d('0x41')](_0x27969e[_0x188d('0x42')],{})[_0x188d('0x24')](respondWithResult(_0x1ae784,0xc9))[_0x188d('0x3a')](handleError(_0x1ae784,null));};exports[_0x188d('0x43')]=function(_0x3509ff,_0x4650a1){if(_0x3509ff[_0x188d('0x42')]['id']){delete _0x3509ff['body']['id'];}return db[_0x188d('0x28')][_0x188d('0x40')]({'where':{'id':_0x3509ff[_0x188d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4650a1,null))[_0x188d('0x24')](saveUpdates(_0x3509ff['body'],null))[_0x188d('0x24')](respondWithResult(_0x4650a1,null))[_0x188d('0x3a')](handleError(_0x4650a1,null));};exports['download']=function(_0x306af5,_0x583908,_0x5b4687){var _0xad46cf=require(_0x188d('0x44'));var _0x38431b=![];var _0x4d3289={};if(_0x306af5[_0x188d('0x2b')][_0x188d('0x29')]&&_0x306af5[_0x188d('0x2b')][_0x188d('0x29')]===_0x188d('0x45')){_0x4d3289[_0x188d('0x45')]=_0x306af5[_0x188d('0x3c')]['id'];}else{_0x4d3289['id']=_0x306af5[_0x188d('0x3c')]['id'];}return db['SquareRecording'][_0x188d('0x40')]({'where':_0x4d3289,'attributes':['id','savePath',_0x188d('0x46')],'raw':!![]})['then'](handleEntityNotFound(_0x583908,null))[_0x188d('0x24')](function(_0x1452c1){if(_0x1452c1){var _0x51c995=_0x1452c1[_0x188d('0x47')];var _0x201d7a=util[_0x188d('0x48')](_0x188d('0x49'),_0x51c995);if(fs[_0x188d('0x4a')](_0x201d7a)){_0x38431b=!![];return _0xad46cf[_0x188d('0x4b')](_0x201d7a,_0x51c995,config[_0x188d('0x4c')]['recording'])[_0x188d('0x24')](function(){return _0x1452c1;});}return _0x1452c1;}})['then'](function(_0x4e4a58){if(_0x4e4a58){var _0x140db7=_0x4e4a58[_0x188d('0x47')];if(!fs[_0x188d('0x4a')](_0x140db7)){throw new db[(_0x188d('0x4d'))][(_0x188d('0x4e'))]('SquareRecording\x20not\x20found');}if(_0x4e4a58['filename']){return _0x583908['download'](_0x140db7,_0x4e4a58[_0x188d('0x46')]+path[_0x188d('0x4f')](_0x140db7),function(){if(_0x38431b){fs['unlink'](_0x140db7);}});}else{return _0x583908[_0x188d('0x50')](_0x140db7,function(_0x42690d){if(_0x38431b){fs[_0x188d('0x51')](_0x140db7);}});}}})[_0x188d('0x3a')](function(_0x20d806){if(_0x20d806[_0x188d('0x52')]===_0x188d('0x53')){_0x583908[_0x188d('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x583908,null);}});};exports[_0x188d('0x54')]=function(_0x339874,_0x513cec){return db[_0x188d('0x28')][_0x188d('0x40')]({'where':{'id':_0x339874['params']['id']}})[_0x188d('0x24')](function(_0x360069){if(_[_0x188d('0x55')](_0x360069)){throw new ReferenceError(_0x188d('0x56'));}return _0x360069;})[_0x188d('0x24')](function(_0x1be493){var _0x2de966=_0x1be493[_0x188d('0x47')];logger[_0x188d('0x57')](_0x188d('0x58'),_0x2de966);if(!_[_0x188d('0x55')](_0x1be493[_0x188d('0x47')])&&fs[_0x188d('0x4a')](_0x2de966)){logger[_0x188d('0x57')](_0x188d('0x59')+_0x2de966+_0x188d('0x5a'));fs[_0x188d('0x5b')](_0x2de966);}_0x2de966=_0x2de966+_0x188d('0x5c');if(!_['isNil'](_0x1be493[_0x188d('0x47')])&&fs[_0x188d('0x4a')](_0x2de966)){logger['info'](_0x188d('0x59')+_0x2de966+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x188d('0x5b')](_0x2de966);}return _0x1be493;})[_0x188d('0x24')](function(_0x2ee4b6){if(!_0x2ee4b6)throw new InternalError();return _0x2ee4b6['destroy']();})['then'](function(){_0x513cec[_0x188d('0x1a')](0xcc)[_0x188d('0x1b')]();})['catch'](handleError(_0x513cec,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index cf0cefe..cbd3051 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 _0x4c4a=['path','../../config/environment','exports','SquareRecording','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4c4a,0x1d0));var _0xa4c4=function(_0x253a0e,_0x498d5c){_0x253a0e=_0x253a0e-0x0;var _0x163cf5=_0x4c4a[_0x253a0e];return _0x163cf5;};'use strict';var _=require(_0xa4c4('0x0'));var util=require(_0xa4c4('0x1'));var logger=require(_0xa4c4('0x2'))('api');var moment=require(_0xa4c4('0x3'));var BPromise=require(_0xa4c4('0x4'));var rp=require(_0xa4c4('0x5'));var fs=require('fs');var path=require(_0xa4c4('0x6'));var rimraf=require('rimraf');var config=require(_0xa4c4('0x7'));var attributes=require('./squareRecording.attributes');module[_0xa4c4('0x8')]=function(_0x11aded,_0x5ca539){return _0x11aded['define'](_0xa4c4('0x9'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x762e=['exports','define','SquareRecording','square_recordings','lodash','api','request-promise','path','rimraf','./squareRecording.attributes'];(function(_0x2b59db,_0x2fd753){var _0x1b8a3b=function(_0x41c9ab){while(--_0x41c9ab){_0x2b59db['push'](_0x2b59db['shift']());}};_0x1b8a3b(++_0x2fd753);}(_0x762e,0xea));var _0xe762=function(_0x15b20f,_0x40e904){_0x15b20f=_0x15b20f-0x0;var _0x5a86af=_0x762e[_0x15b20f];return _0x5a86af;};'use strict';var _=require(_0xe762('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe762('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe762('0x2'));var fs=require('fs');var path=require(_0xe762('0x3'));var rimraf=require(_0xe762('0x4'));var config=require('../../config/environment');var attributes=require(_0xe762('0x5'));module[_0xe762('0x6')]=function(_0x48995a,_0x4abeb6){return _0x48995a[_0xe762('0x7')](_0xe762('0x8'),attributes,{'tableName':_0xe762('0x9'),'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 ab6645a..17d146e 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 _0x1600=['SquareRecording','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateSquareRecording'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x1600,0x1df));var _0x0160=function(_0x56d138,_0x924339){_0x56d138=_0x56d138-0x0;var _0x42f723=_0x1600[_0x56d138];return _0x42f723;};'use strict';var _=require(_0x0160('0x0'));var util=require(_0x0160('0x1'));var moment=require(_0x0160('0x2'));var BPromise=require(_0x0160('0x3'));var rs=require(_0x0160('0x4'));var fs=require('fs');var Redis=require(_0x0160('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0160('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0160('0x7')][_0x0160('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50eaa7,_0x3ff795,_0x2b189e){return new BPromise(function(_0x12ba3f,_0x12259c){return client[_0x0160('0x9')](_0x50eaa7,_0x2b189e)[_0x0160('0xa')](function(_0x2be0bd){logger[_0x0160('0xb')](_0x0160('0xc'),_0x3ff795,'request\x20sent');logger[_0x0160('0xd')](_0x0160('0xe'),_0x3ff795,_0x0160('0xf'),JSON[_0x0160('0x10')](_0x2be0bd));if(_0x2be0bd[_0x0160('0x11')]){if(_0x2be0bd[_0x0160('0x11')][_0x0160('0x12')]===0x1f4){logger[_0x0160('0x11')]('SquareRecording,\x20%s,\x20%s',_0x3ff795,_0x2be0bd['error'][_0x0160('0x13')]);return _0x12259c(_0x2be0bd[_0x0160('0x11')][_0x0160('0x13')]);}logger[_0x0160('0x11')]('SquareRecording,\x20%s,\x20%s',_0x3ff795,_0x2be0bd[_0x0160('0x11')]['message']);return _0x12ba3f(_0x2be0bd[_0x0160('0x11')][_0x0160('0x13')]);}else{logger['info'](_0x0160('0xc'),_0x3ff795,'request\x20sent');_0x12ba3f(_0x2be0bd['result']['message']);}})['catch'](function(_0x20246c){logger[_0x0160('0x11')](_0x0160('0xc'),_0x3ff795,_0x20246c);_0x12259c(_0x20246c);});});}exports[_0x0160('0x14')]=function(_0x101807){var _0x52a513=this;return new Promise(function(_0x14015b,_0x2f4ff0){return db[_0x0160('0x15')]['create'](_0x101807[_0x0160('0x16')],{'raw':_0x101807['options']?_0x101807[_0x0160('0x17')][_0x0160('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x2d56c3){logger['info'](_0x0160('0x14'),_0x101807);logger[_0x0160('0xd')](_0x0160('0x14'),_0x101807,JSON[_0x0160('0x10')](_0x2d56c3));_0x14015b(_0x2d56c3);})['catch'](function(_0x194572){logger[_0x0160('0x11')](_0x0160('0x14'),_0x194572['message'],_0x101807);_0x2f4ff0(_0x52a513[_0x0160('0x11')](0x1f4,_0x194572[_0x0160('0x13')]));});});}; \ No newline at end of file +var _0x1a55=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','moment','bluebird'];(function(_0x5cff47,_0x561069){var _0x2a2efe=function(_0x46acac){while(--_0x46acac){_0x5cff47['push'](_0x5cff47['shift']());}};_0x2a2efe(++_0x561069);}(_0x1a55,0x102));var _0x51a5=function(_0x289596,_0x2c6663){_0x289596=_0x289596-0x0;var _0x1c9de8=_0x1a55[_0x289596];return _0x1c9de8;};'use strict';var _=require(_0x51a5('0x0'));var util=require('util');var moment=require(_0x51a5('0x1'));var BPromise=require(_0x51a5('0x2'));var rs=require(_0x51a5('0x3'));var fs=require('fs');var Redis=require(_0x51a5('0x4'));var db=require(_0x51a5('0x5'))['db'];var utils=require(_0x51a5('0x6'));var logger=require(_0x51a5('0x7'))(_0x51a5('0x8'));var config=require(_0x51a5('0x9'));var jayson=require(_0x51a5('0xa'));var client=jayson[_0x51a5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33c819,_0x91324d,_0x85a124){return new BPromise(function(_0x11a6b2,_0xf8659c){return client[_0x51a5('0xc')](_0x33c819,_0x85a124)['then'](function(_0x2c0bc7){logger[_0x51a5('0xd')](_0x51a5('0xe'),_0x91324d,'request\x20sent');logger[_0x51a5('0xf')](_0x51a5('0x10'),_0x91324d,'request\x20sent',JSON[_0x51a5('0x11')](_0x2c0bc7));if(_0x2c0bc7[_0x51a5('0x12')]){if(_0x2c0bc7[_0x51a5('0x12')]['code']===0x1f4){logger[_0x51a5('0x12')](_0x51a5('0xe'),_0x91324d,_0x2c0bc7[_0x51a5('0x12')]['message']);return _0xf8659c(_0x2c0bc7[_0x51a5('0x12')][_0x51a5('0x13')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x91324d,_0x2c0bc7[_0x51a5('0x12')]['message']);return _0x11a6b2(_0x2c0bc7[_0x51a5('0x12')]['message']);}else{logger['info'](_0x51a5('0xe'),_0x91324d,_0x51a5('0x14'));_0x11a6b2(_0x2c0bc7[_0x51a5('0x15')]['message']);}})[_0x51a5('0x16')](function(_0x5a54fc){logger['error'](_0x51a5('0xe'),_0x91324d,_0x5a54fc);_0xf8659c(_0x5a54fc);});});}exports[_0x51a5('0x17')]=function(_0x583f94){var _0x5ba2d9=this;return new Promise(function(_0x30d3b7,_0x1f8cc9){return db[_0x51a5('0x18')][_0x51a5('0x19')](_0x583f94[_0x51a5('0x1a')],{'raw':_0x583f94[_0x51a5('0x1b')]?_0x583f94[_0x51a5('0x1b')][_0x51a5('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x45d602){logger[_0x51a5('0xd')](_0x51a5('0x17'),_0x583f94);logger[_0x51a5('0xf')]('CreateSquareRecording',_0x583f94,JSON[_0x51a5('0x11')](_0x45d602));_0x30d3b7(_0x45d602);})['catch'](function(_0x38df97){logger['error'](_0x51a5('0x17'),_0x38df97[_0x51a5('0x13')],_0x583f94);_0x1f8cc9(_0x5ba2d9[_0x51a5('0x12')](0x1f4,_0x38df97[_0x51a5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 27529f5..4bc20dc 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x292d97,_0x4de4bd){var _0xb4c274=function(_0x382c9e){while(--_0x382c9e){_0x292d97['push'](_0x292d97['shift']());}};_0xb4c274(++_0x4de4bd);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x222f8f,_0x2f31a4){var _0x5650e6=function(_0x106c4){while(--_0x106c4){_0x222f8f['push'](_0x222f8f['shift']());}};_0x5650e6(++_0x2f31a4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 30a48e2..f686a6d 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 _0x7d87=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3205c6,_0x581f15){var _0x120200=function(_0x397593){while(--_0x397593){_0x3205c6['push'](_0x3205c6['shift']());}};_0x120200(++_0x581f15);}(_0x7d87,0x1d2));var _0x77d8=function(_0x412937,_0xdbe7e9){_0x412937=_0x412937-0x0;var _0x20772e=_0x7d87[_0x412937];return _0x20772e;};'use strict';var Sequelize=require(_0x77d8('0x0'));module[_0x77d8('0x1')]={'network':{'type':Sequelize[_0x77d8('0x2')]},'network_script':{'type':Sequelize[_0x77d8('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x77d8('0x2')]},'language':{'type':Sequelize[_0x77d8('0x2')]},'type':{'type':Sequelize[_0x77d8('0x2')]},'uniqueid':{'type':Sequelize[_0x77d8('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x77d8('0x2')]},'calleridname':{'type':Sequelize[_0x77d8('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x77d8('0x2')]},'callington':{'type':Sequelize[_0x77d8('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x77d8('0x2')]},'rdnis':{'type':Sequelize[_0x77d8('0x2')]},'context':{'type':Sequelize[_0x77d8('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x77d8('0x2')]},'enhanced':{'type':Sequelize[_0x77d8('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x77d8('0x2')]},'project_name':{'type':Sequelize[_0x77d8('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x77d8('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x8edd=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x59d212,_0x126f7b){var _0x16eb64=function(_0x1ade17){while(--_0x1ade17){_0x59d212['push'](_0x59d212['shift']());}};_0x16eb64(++_0x126f7b);}(_0x8edd,0x8d));var _0xd8ed=function(_0x48db05,_0x3261b7){_0x48db05=_0x48db05-0x0;var _0x2ad791=_0x8edd[_0x48db05];return _0x2ad791;};'use strict';var Sequelize=require(_0xd8ed('0x0'));module[_0xd8ed('0x1')]={'network':{'type':Sequelize[_0xd8ed('0x2')]},'network_script':{'type':Sequelize[_0xd8ed('0x2')]},'request':{'type':Sequelize[_0xd8ed('0x2')]},'channel':{'type':Sequelize[_0xd8ed('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd8ed('0x2')]},'uniqueid':{'type':Sequelize[_0xd8ed('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd8ed('0x2')]},'callingpres':{'type':Sequelize[_0xd8ed('0x2')]},'callingani2':{'type':Sequelize[_0xd8ed('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xd8ed('0x2')]},'rdnis':{'type':Sequelize[_0xd8ed('0x2')]},'context':{'type':Sequelize[_0xd8ed('0x2')]},'extension':{'type':Sequelize[_0xd8ed('0x2')]},'priority':{'type':Sequelize[_0xd8ed('0x2')]},'enhanced':{'type':Sequelize[_0xd8ed('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xd8ed('0x2')]},'joinAt':{'type':Sequelize[_0xd8ed('0x3')]},'leaveAt':{'type':Sequelize[_0xd8ed('0x3')]},'bot':{'type':Sequelize[_0xd8ed('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 39c52c6..46ee94b 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 _0x81c7=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','save','update','then','end','error','stack','name','send','index','map','SquareReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x81c7,0x12b));var _0x781c=function(_0x6bbc3c,_0x22325e){_0x6bbc3c=_0x6bbc3c-0x0;var _0x19c8aa=_0x81c7[_0x6bbc3c];return _0x19c8aa;};'use strict';var emlformat=require(_0x781c('0x0'));var rimraf=require(_0x781c('0x1'));var zipdir=require(_0x781c('0x2'));var jsonpatch=require(_0x781c('0x3'));var rp=require(_0x781c('0x4'));var moment=require(_0x781c('0x5'));var BPromise=require(_0x781c('0x6'));var Mustache=require(_0x781c('0x7'));var util=require(_0x781c('0x8'));var path=require(_0x781c('0x9'));var sox=require(_0x781c('0xa'));var csv=require(_0x781c('0xb'));var ejs=require(_0x781c('0xc'));var fs=require('fs');var fs_extra=require(_0x781c('0xd'));var _=require(_0x781c('0xe'));var squel=require(_0x781c('0xf'));var crypto=require(_0x781c('0x10'));var jsforce=require(_0x781c('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x781c('0x12'));var Papa=require(_0x781c('0x13'));var Redis=require(_0x781c('0x14'));var authService=require(_0x781c('0x15'));var qs=require(_0x781c('0x16'));var as=require(_0x781c('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x781c('0x18'))('api');var utils=require(_0x781c('0x19'));var config=require(_0x781c('0x1a'));var licenseUtil=require(_0x781c('0x1b'));var db=require(_0x781c('0x1c'))['db'];function respondWithStatusCode(_0x3a5458,_0x2b87f0){_0x2b87f0=_0x2b87f0||0xcc;return function(_0x33d898){if(_0x33d898){return _0x3a5458['sendStatus'](_0x2b87f0);}return _0x3a5458[_0x781c('0x1d')](_0x2b87f0)['end']();};}function respondWithResult(_0x55ccd9,_0x4b09a5){_0x4b09a5=_0x4b09a5||0xc8;return function(_0x256aca){if(_0x256aca){return _0x55ccd9[_0x781c('0x1d')](_0x4b09a5)[_0x781c('0x1e')](_0x256aca);}};}function respondWithFilteredResult(_0x6ab8b1,_0x54cff4){return function(_0x37e36c){if(_0x37e36c){var _0xd053bd=typeof _0x54cff4[_0x781c('0x1f')]===_0x781c('0x20')&&typeof _0x54cff4[_0x781c('0x21')]===_0x781c('0x20');var _0x294727=_0x37e36c['count'];var _0x2f219d=_0xd053bd?0x0:_0x54cff4[_0x781c('0x1f')];var _0x408691=_0xd053bd?_0x37e36c[_0x781c('0x22')]:_0x54cff4['offset']+_0x54cff4[_0x781c('0x21')];var _0xd18b32;if(_0x408691>=_0x294727){_0x408691=_0x294727;_0xd18b32=0xc8;}else{_0xd18b32=0xce;}_0x6ab8b1['status'](_0xd18b32);return _0x6ab8b1[_0x781c('0x23')]('Content-Range',_0x2f219d+'-'+_0x408691+'/'+_0x294727)['json'](_0x37e36c);}return null;};}function patchUpdates(_0xba92d9){return function(_0x415fd8){try{jsonpatch[_0x781c('0x24')](_0x415fd8,_0xba92d9,!![]);}catch(_0x40834c){return BPromise['reject'](_0x40834c);}return _0x415fd8[_0x781c('0x25')]();};}function saveUpdates(_0x543628,_0x4aef09){return function(_0x10fa0a){if(_0x10fa0a){return _0x10fa0a[_0x781c('0x26')](_0x543628)[_0x781c('0x27')](function(_0x2e9e9e){return _0x2e9e9e;});}return null;};}function removeEntity(_0x2d4b54,_0x332e59){return function(_0x12b16){if(_0x12b16){return _0x12b16['destroy']()[_0x781c('0x27')](function(){_0x2d4b54[_0x781c('0x1d')](0xcc)[_0x781c('0x28')]();});}};}function handleEntityNotFound(_0x2e9a66,_0xfda8c9){return function(_0xa82fd6){if(!_0xa82fd6){_0x2e9a66['sendStatus'](0x194);}return _0xa82fd6;};}function handleError(_0x34d2fc,_0x3af50f){_0x3af50f=_0x3af50f||0x1f4;return function(_0xe46496){logger[_0x781c('0x29')](_0xe46496[_0x781c('0x2a')]);if(_0xe46496['name']){delete _0xe46496[_0x781c('0x2b')];}_0x34d2fc[_0x781c('0x1d')](_0x3af50f)[_0x781c('0x2c')](_0xe46496);};}exports[_0x781c('0x2d')]=function(_0x4fb676,_0x4e2761){var _0x2d0317={},_0x20e824={},_0x369158={'count':0x0,'rows':[]};var _0x2b9507=_[_0x781c('0x2e')](db[_0x781c('0x2f')]['rawAttributes'],function(_0x4c83da){return{'name':_0x4c83da[_0x781c('0x30')],'type':_0x4c83da[_0x781c('0x31')][_0x781c('0x32')]};});_0x20e824[_0x781c('0x33')]=_['map'](_0x2b9507,_0x781c('0x2b'));_0x20e824[_0x781c('0x34')]=_[_0x781c('0x35')](_0x4fb676['query']);_0x20e824[_0x781c('0x36')]=_['intersection'](_0x20e824['model'],_0x20e824['query']);_0x2d0317[_0x781c('0x37')]=_[_0x781c('0x38')](_0x20e824[_0x781c('0x33')],qs[_0x781c('0x39')](_0x4fb676['query'][_0x781c('0x39')]));_0x2d0317['attributes']=_0x2d0317[_0x781c('0x37')][_0x781c('0x3a')]?_0x2d0317[_0x781c('0x37')]:_0x20e824[_0x781c('0x33')];if(!_0x4fb676['query'][_0x781c('0x3b')]('nolimit')){_0x2d0317['limit']=qs[_0x781c('0x21')](_0x4fb676[_0x781c('0x34')][_0x781c('0x21')]);_0x2d0317[_0x781c('0x1f')]=qs[_0x781c('0x1f')](_0x4fb676[_0x781c('0x34')][_0x781c('0x1f')]);}_0x2d0317[_0x781c('0x3c')]=qs[_0x781c('0x3d')](_0x4fb676[_0x781c('0x34')]['sort']);_0x2d0317[_0x781c('0x3e')]=qs['filters'](_[_0x781c('0x3f')](_0x4fb676[_0x781c('0x34')],_0x20e824[_0x781c('0x36')]),_0x2b9507);if(_0x4fb676[_0x781c('0x34')][_0x781c('0x40')]){_0x2d0317[_0x781c('0x3e')]=_[_0x781c('0x41')](_0x2d0317[_0x781c('0x3e')],{'$or':_['map'](_0x2b9507,function(_0x2f7ff1){if(_0x2f7ff1[_0x781c('0x31')]!=='VIRTUAL'){var _0x1c6601={};_0x1c6601[_0x2f7ff1[_0x781c('0x2b')]]={'$like':'%'+_0x4fb676['query']['filter']+'%'};return _0x1c6601;}})});}_0x2d0317=_[_0x781c('0x41')]({},_0x2d0317,_0x4fb676[_0x781c('0x42')]);var _0x561ba8={'where':_0x2d0317['where']};return db[_0x781c('0x2f')][_0x781c('0x22')](_0x561ba8)[_0x781c('0x27')](function(_0x5c7fdd){_0x369158['count']=_0x5c7fdd;if(_0x4fb676['query'][_0x781c('0x43')]){_0x2d0317[_0x781c('0x44')]=[{'all':!![]}];}return db['SquareReport'][_0x781c('0x45')](_0x2d0317);})[_0x781c('0x27')](function(_0x108698){_0x369158[_0x781c('0x46')]=_0x108698;return _0x369158;})[_0x781c('0x27')](respondWithFilteredResult(_0x4e2761,_0x2d0317))[_0x781c('0x47')](handleError(_0x4e2761,null));};exports[_0x781c('0x48')]=function(_0x418be6,_0x446c31){var _0x4865f0={'raw':!![],'where':{'id':_0x418be6['params']['id']}},_0x1a7c3a={};_0x1a7c3a[_0x781c('0x33')]=_['keys'](db[_0x781c('0x2f')][_0x781c('0x49')]);_0x1a7c3a[_0x781c('0x34')]=_[_0x781c('0x35')](_0x418be6['query']);_0x1a7c3a['filters']=_['intersection'](_0x1a7c3a[_0x781c('0x33')],_0x1a7c3a[_0x781c('0x34')]);_0x4865f0[_0x781c('0x37')]=_['intersection'](_0x1a7c3a['model'],qs[_0x781c('0x39')](_0x418be6[_0x781c('0x34')][_0x781c('0x39')]));_0x4865f0[_0x781c('0x37')]=_0x4865f0[_0x781c('0x37')][_0x781c('0x3a')]?_0x4865f0[_0x781c('0x37')]:_0x1a7c3a['model'];if(_0x418be6['query']['includeAll']){_0x4865f0[_0x781c('0x44')]=[{'all':!![]}];}_0x4865f0=_['merge']({},_0x4865f0,_0x418be6[_0x781c('0x42')]);return db['SquareReport'][_0x781c('0x4a')](_0x4865f0)[_0x781c('0x27')](handleEntityNotFound(_0x446c31,null))['then'](respondWithResult(_0x446c31,null))[_0x781c('0x47')](handleError(_0x446c31,null));};exports[_0x781c('0x4b')]=function(_0x53d04e,_0x337841){return db['SquareReport'][_0x781c('0x4b')](_0x53d04e['body'],{})['then'](respondWithResult(_0x337841,0xc9))[_0x781c('0x47')](handleError(_0x337841,null));};exports[_0x781c('0x26')]=function(_0x2d5998,_0x19cc72){if(_0x2d5998[_0x781c('0x4c')]['id']){delete _0x2d5998[_0x781c('0x4c')]['id'];}return db[_0x781c('0x2f')][_0x781c('0x4a')]({'where':{'id':_0x2d5998[_0x781c('0x4d')]['id']}})[_0x781c('0x27')](handleEntityNotFound(_0x19cc72,null))[_0x781c('0x27')](saveUpdates(_0x2d5998[_0x781c('0x4c')],null))['then'](respondWithResult(_0x19cc72,null))[_0x781c('0x47')](handleError(_0x19cc72,null));};exports[_0x781c('0x4e')]=function(_0x4a0bf4,_0x11fc3d){return db[_0x781c('0x2f')][_0x781c('0x4a')]({'where':{'id':_0x4a0bf4[_0x781c('0x4d')]['id']}})[_0x781c('0x27')](handleEntityNotFound(_0x11fc3d,null))[_0x781c('0x27')](removeEntity(_0x11fc3d,null))[_0x781c('0x47')](handleError(_0x11fc3d,null));};exports[_0x781c('0x4f')]=function(_0x16bba8,_0x1ac73d){return db[_0x781c('0x2f')][_0x781c('0x4f')]()[_0x781c('0x27')](respondWithResult(_0x1ac73d,null))[_0x781c('0x47')](handleError(_0x1ac73d,null));}; \ No newline at end of file +var _0x4070=['key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','length','find','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','SquareReport','rawAttributes','fieldName','type'];(function(_0x5e178e,_0x54568c){var _0x4500b6=function(_0x47b81a){while(--_0x47b81a){_0x5e178e['push'](_0x5e178e['shift']());}};_0x4500b6(++_0x54568c);}(_0x4070,0x103));var _0x0407=function(_0x148bc0,_0xf5cfdc){_0x148bc0=_0x148bc0-0x0;var _0x34d7d0=_0x4070[_0x148bc0];return _0x34d7d0;};'use strict';var emlformat=require(_0x0407('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0407('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0407('0x2'));var moment=require(_0x0407('0x3'));var BPromise=require(_0x0407('0x4'));var Mustache=require(_0x0407('0x5'));var util=require(_0x0407('0x6'));var path=require(_0x0407('0x7'));var sox=require(_0x0407('0x8'));var csv=require(_0x0407('0x9'));var ejs=require(_0x0407('0xa'));var fs=require('fs');var fs_extra=require(_0x0407('0xb'));var _=require(_0x0407('0xc'));var squel=require(_0x0407('0xd'));var crypto=require(_0x0407('0xe'));var jsforce=require(_0x0407('0xf'));var deskjs=require(_0x0407('0x10'));var toCsv=require(_0x0407('0x9'));var querystring=require('querystring');var Papa=require(_0x0407('0x11'));var Redis=require(_0x0407('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0407('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0407('0x14'))(_0x0407('0x15'));var utils=require(_0x0407('0x16'));var config=require(_0x0407('0x17'));var licenseUtil=require(_0x0407('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e0cf3,_0x497402){_0x497402=_0x497402||0xcc;return function(_0x3525f7){if(_0x3525f7){return _0x4e0cf3[_0x0407('0x19')](_0x497402);}return _0x4e0cf3[_0x0407('0x1a')](_0x497402)[_0x0407('0x1b')]();};}function respondWithResult(_0x5ec8d4,_0x157f94){_0x157f94=_0x157f94||0xc8;return function(_0x6f1e9f){if(_0x6f1e9f){return _0x5ec8d4[_0x0407('0x1a')](_0x157f94)[_0x0407('0x1c')](_0x6f1e9f);}};}function respondWithFilteredResult(_0x1b80e7,_0x11e6c9){return function(_0x4e6b55){if(_0x4e6b55){var _0x55cc26=typeof _0x11e6c9[_0x0407('0x1d')]===_0x0407('0x1e')&&typeof _0x11e6c9['limit']==='undefined';var _0x13be12=_0x4e6b55[_0x0407('0x1f')];var _0x1df7c5=_0x55cc26?0x0:_0x11e6c9['offset'];var _0x4e48f6=_0x55cc26?_0x4e6b55[_0x0407('0x1f')]:_0x11e6c9[_0x0407('0x1d')]+_0x11e6c9[_0x0407('0x20')];var _0x5a5d12;if(_0x4e48f6>=_0x13be12){_0x4e48f6=_0x13be12;_0x5a5d12=0xc8;}else{_0x5a5d12=0xce;}_0x1b80e7['status'](_0x5a5d12);return _0x1b80e7[_0x0407('0x21')](_0x0407('0x22'),_0x1df7c5+'-'+_0x4e48f6+'/'+_0x13be12)[_0x0407('0x1c')](_0x4e6b55);}return null;};}function patchUpdates(_0xb1709d){return function(_0xa27ae0){try{jsonpatch[_0x0407('0x23')](_0xa27ae0,_0xb1709d,!![]);}catch(_0x2dd3c9){return BPromise[_0x0407('0x24')](_0x2dd3c9);}return _0xa27ae0[_0x0407('0x25')]();};}function saveUpdates(_0x351094,_0x35cb56){return function(_0x1ec938){if(_0x1ec938){return _0x1ec938[_0x0407('0x26')](_0x351094)[_0x0407('0x27')](function(_0x376de6){return _0x376de6;});}return null;};}function removeEntity(_0x59bbac,_0x2b2ca9){return function(_0x548be0){if(_0x548be0){return _0x548be0[_0x0407('0x28')]()[_0x0407('0x27')](function(){_0x59bbac[_0x0407('0x1a')](0xcc)[_0x0407('0x1b')]();});}};}function handleEntityNotFound(_0x15d5cc,_0x3b99c9){return function(_0x3c1d79){if(!_0x3c1d79){_0x15d5cc['sendStatus'](0x194);}return _0x3c1d79;};}function handleError(_0x1a5870,_0x82eed6){_0x82eed6=_0x82eed6||0x1f4;return function(_0x37b9d8){logger['error'](_0x37b9d8[_0x0407('0x29')]);if(_0x37b9d8[_0x0407('0x2a')]){delete _0x37b9d8[_0x0407('0x2a')];}_0x1a5870['status'](_0x82eed6)[_0x0407('0x2b')](_0x37b9d8);};}exports[_0x0407('0x2c')]=function(_0x53b499,_0x5197ea){var _0x540004={},_0xe145fc={},_0x5c3c95={'count':0x0,'rows':[]};var _0x5f35b8=_['map'](db[_0x0407('0x2d')][_0x0407('0x2e')],function(_0x278e4d){return{'name':_0x278e4d[_0x0407('0x2f')],'type':_0x278e4d[_0x0407('0x30')][_0x0407('0x31')]};});_0xe145fc[_0x0407('0x32')]=_[_0x0407('0x33')](_0x5f35b8,_0x0407('0x2a'));_0xe145fc[_0x0407('0x34')]=_[_0x0407('0x35')](_0x53b499[_0x0407('0x34')]);_0xe145fc[_0x0407('0x36')]=_[_0x0407('0x37')](_0xe145fc['model'],_0xe145fc[_0x0407('0x34')]);_0x540004[_0x0407('0x38')]=_[_0x0407('0x37')](_0xe145fc['model'],qs[_0x0407('0x39')](_0x53b499[_0x0407('0x34')]['fields']));_0x540004[_0x0407('0x38')]=_0x540004[_0x0407('0x38')]['length']?_0x540004[_0x0407('0x38')]:_0xe145fc[_0x0407('0x32')];if(!_0x53b499['query'][_0x0407('0x3a')](_0x0407('0x3b'))){_0x540004[_0x0407('0x20')]=qs[_0x0407('0x20')](_0x53b499[_0x0407('0x34')]['limit']);_0x540004['offset']=qs[_0x0407('0x1d')](_0x53b499['query']['offset']);}_0x540004[_0x0407('0x3c')]=qs[_0x0407('0x3d')](_0x53b499[_0x0407('0x34')][_0x0407('0x3d')]);_0x540004[_0x0407('0x3e')]=qs[_0x0407('0x36')](_[_0x0407('0x3f')](_0x53b499['query'],_0xe145fc[_0x0407('0x36')]),_0x5f35b8);if(_0x53b499[_0x0407('0x34')][_0x0407('0x40')]){_0x540004['where']=_['merge'](_0x540004[_0x0407('0x3e')],{'$or':_[_0x0407('0x33')](_0x5f35b8,function(_0x2aef25){if(_0x2aef25['type']!==_0x0407('0x41')){var _0x53ca17={};_0x53ca17[_0x2aef25[_0x0407('0x2a')]]={'$like':'%'+_0x53b499[_0x0407('0x34')][_0x0407('0x40')]+'%'};return _0x53ca17;}})});}_0x540004=_[_0x0407('0x42')]({},_0x540004,_0x53b499[_0x0407('0x43')]);var _0x26d3e0={'where':_0x540004['where']};return db[_0x0407('0x2d')][_0x0407('0x1f')](_0x26d3e0)[_0x0407('0x27')](function(_0x2f10be){_0x5c3c95['count']=_0x2f10be;if(_0x53b499[_0x0407('0x34')][_0x0407('0x44')]){_0x540004[_0x0407('0x45')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x540004);})[_0x0407('0x27')](function(_0x2c4f45){_0x5c3c95['rows']=_0x2c4f45;return _0x5c3c95;})[_0x0407('0x27')](respondWithFilteredResult(_0x5197ea,_0x540004))[_0x0407('0x46')](handleError(_0x5197ea,null));};exports[_0x0407('0x47')]=function(_0x32a70a,_0x11676a){var _0x28c953={'raw':!![],'where':{'id':_0x32a70a[_0x0407('0x48')]['id']}},_0x5aad0d={};_0x5aad0d[_0x0407('0x32')]=_['keys'](db[_0x0407('0x2d')][_0x0407('0x2e')]);_0x5aad0d[_0x0407('0x34')]=_[_0x0407('0x35')](_0x32a70a['query']);_0x5aad0d[_0x0407('0x36')]=_[_0x0407('0x37')](_0x5aad0d[_0x0407('0x32')],_0x5aad0d[_0x0407('0x34')]);_0x28c953[_0x0407('0x38')]=_[_0x0407('0x37')](_0x5aad0d[_0x0407('0x32')],qs['fields'](_0x32a70a[_0x0407('0x34')][_0x0407('0x39')]));_0x28c953[_0x0407('0x38')]=_0x28c953['attributes'][_0x0407('0x49')]?_0x28c953[_0x0407('0x38')]:_0x5aad0d['model'];if(_0x32a70a['query'][_0x0407('0x44')]){_0x28c953[_0x0407('0x45')]=[{'all':!![]}];}_0x28c953=_[_0x0407('0x42')]({},_0x28c953,_0x32a70a[_0x0407('0x43')]);return db['SquareReport'][_0x0407('0x4a')](_0x28c953)[_0x0407('0x27')](handleEntityNotFound(_0x11676a,null))[_0x0407('0x27')](respondWithResult(_0x11676a,null))[_0x0407('0x46')](handleError(_0x11676a,null));};exports['create']=function(_0x892ce,_0x3e5202){return db[_0x0407('0x2d')]['create'](_0x892ce[_0x0407('0x4b')],{})[_0x0407('0x27')](respondWithResult(_0x3e5202,0xc9))['catch'](handleError(_0x3e5202,null));};exports[_0x0407('0x26')]=function(_0x4dd347,_0xbd0d66){if(_0x4dd347[_0x0407('0x4b')]['id']){delete _0x4dd347[_0x0407('0x4b')]['id'];}return db[_0x0407('0x2d')][_0x0407('0x4a')]({'where':{'id':_0x4dd347[_0x0407('0x48')]['id']}})[_0x0407('0x27')](handleEntityNotFound(_0xbd0d66,null))[_0x0407('0x27')](saveUpdates(_0x4dd347[_0x0407('0x4b')],null))[_0x0407('0x27')](respondWithResult(_0xbd0d66,null))['catch'](handleError(_0xbd0d66,null));};exports[_0x0407('0x28')]=function(_0x32acca,_0xc28496){return db['SquareReport'][_0x0407('0x4a')]({'where':{'id':_0x32acca['params']['id']}})[_0x0407('0x27')](handleEntityNotFound(_0xc28496,null))[_0x0407('0x27')](removeEntity(_0xc28496,null))[_0x0407('0x46')](handleError(_0xc28496,null));};exports[_0x0407('0x4c')]=function(_0x3d508f,_0x4c1df3){return db[_0x0407('0x2d')][_0x0407('0x4c')]()[_0x0407('0x27')](respondWithResult(_0x4c1df3,null))[_0x0407('0x46')](handleError(_0x4c1df3,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index b025755..ffd97e7 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 _0x2a51=['../../config/environment','./squareReport.attributes','exports','define','report_square','uid_pname','project_name','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4c315a,_0x187fc3){var _0x2310d8=function(_0x35006d){while(--_0x35006d){_0x4c315a['push'](_0x4c315a['shift']());}};_0x2310d8(++_0x187fc3);}(_0x2a51,0x1ab));var _0x12a5=function(_0x4ff2a4,_0x27fbd0){_0x4ff2a4=_0x4ff2a4-0x0;var _0x578342=_0x2a51[_0x4ff2a4];return _0x578342;};'use strict';var _=require('lodash');var util=require(_0x12a5('0x0'));var logger=require(_0x12a5('0x1'))(_0x12a5('0x2'));var moment=require(_0x12a5('0x3'));var BPromise=require(_0x12a5('0x4'));var rp=require(_0x12a5('0x5'));var fs=require('fs');var path=require(_0x12a5('0x6'));var rimraf=require('rimraf');var config=require(_0x12a5('0x7'));var attributes=require(_0x12a5('0x8'));module[_0x12a5('0x9')]=function(_0x2dcb3a,_0x45da06){return _0x2dcb3a[_0x12a5('0xa')]('SquareReport',attributes,{'tableName':_0x12a5('0xb'),'paranoid':![],'indexes':[{'name':_0x12a5('0xc'),'fields':['uniqueid',_0x12a5('0xd')]},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa3ec=['exports','define','SquareReport','report_square','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareReport.attributes'];(function(_0x2cbb2a,_0x3cedf5){var _0x51579f=function(_0x329c0b){while(--_0x329c0b){_0x2cbb2a['push'](_0x2cbb2a['shift']());}};_0x51579f(++_0x3cedf5);}(_0xa3ec,0x106));var _0xca3e=function(_0x1f2313,_0xee725c){_0x1f2313=_0x1f2313-0x0;var _0x3b649c=_0xa3ec[_0x1f2313];return _0x3b649c;};'use strict';var _=require(_0xca3e('0x0'));var util=require(_0xca3e('0x1'));var logger=require(_0xca3e('0x2'))(_0xca3e('0x3'));var moment=require(_0xca3e('0x4'));var BPromise=require(_0xca3e('0x5'));var rp=require(_0xca3e('0x6'));var fs=require('fs');var path=require(_0xca3e('0x7'));var rimraf=require(_0xca3e('0x8'));var config=require('../../config/environment');var attributes=require(_0xca3e('0x9'));module[_0xca3e('0xa')]=function(_0x39295b,_0x5278f7){return _0x39295b[_0xca3e('0xb')](_0xca3e('0xc'),attributes,{'tableName':_0xca3e('0xd'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xca3e('0xe'),_0xca3e('0xf')]},{'name':_0xca3e('0x10'),'fields':[_0xca3e('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 0f3570a..d01d8ae 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 _0xbe2f=['raw','then','debug','where','attributes','limit','UpdateSquareReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options'];(function(_0x50f211,_0x308322){var _0x3ba891=function(_0x510968){while(--_0x510968){_0x50f211['push'](_0x50f211['shift']());}};_0x3ba891(++_0x308322);}(_0xbe2f,0x1ab));var _0xfbe2=function(_0x2b1f0f,_0x29d810){_0x2b1f0f=_0x2b1f0f-0x0;var _0x28be53=_0xbe2f[_0x2b1f0f];return _0x28be53;};'use strict';var _=require(_0xfbe2('0x0'));var util=require(_0xfbe2('0x1'));var moment=require(_0xfbe2('0x2'));var BPromise=require(_0xfbe2('0x3'));var rs=require(_0xfbe2('0x4'));var fs=require('fs');var Redis=require(_0xfbe2('0x5'));var db=require(_0xfbe2('0x6'))['db'];var utils=require(_0xfbe2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xfbe2('0x8'));var jayson=require(_0xfbe2('0x9'));var client=jayson[_0xfbe2('0xa')][_0xfbe2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21a5a1,_0x2b6ed7,_0x464e10){return new BPromise(function(_0x2385a0,_0x31d2c3){return client[_0xfbe2('0xc')](_0x21a5a1,_0x464e10)['then'](function(_0x146b20){logger[_0xfbe2('0xd')](_0xfbe2('0xe'),_0x2b6ed7,_0xfbe2('0xf'));logger['debug'](_0xfbe2('0x10'),_0x2b6ed7,_0xfbe2('0xf'),JSON[_0xfbe2('0x11')](_0x146b20));if(_0x146b20[_0xfbe2('0x12')]){if(_0x146b20[_0xfbe2('0x12')][_0xfbe2('0x13')]===0x1f4){logger[_0xfbe2('0x12')](_0xfbe2('0xe'),_0x2b6ed7,_0x146b20[_0xfbe2('0x12')][_0xfbe2('0x14')]);return _0x31d2c3(_0x146b20[_0xfbe2('0x12')][_0xfbe2('0x14')]);}logger[_0xfbe2('0x12')](_0xfbe2('0xe'),_0x2b6ed7,_0x146b20[_0xfbe2('0x12')]['message']);return _0x2385a0(_0x146b20[_0xfbe2('0x12')][_0xfbe2('0x14')]);}else{logger[_0xfbe2('0xd')]('SquareReport,\x20%s,\x20%s',_0x2b6ed7,_0xfbe2('0xf'));_0x2385a0(_0x146b20[_0xfbe2('0x15')][_0xfbe2('0x14')]);}})[_0xfbe2('0x16')](function(_0x3f4084){logger['error'](_0xfbe2('0xe'),_0x2b6ed7,_0x3f4084);_0x31d2c3(_0x3f4084);});});}exports[_0xfbe2('0x17')]=function(_0x27f7f0){var _0x796414=this;return new Promise(function(_0xb7e53f,_0x3cbb6c){return db[_0xfbe2('0x18')][_0xfbe2('0x19')](_0x27f7f0[_0xfbe2('0x1a')],{'raw':_0x27f7f0[_0xfbe2('0x1b')]?_0x27f7f0[_0xfbe2('0x1b')][_0xfbe2('0x1c')]===undefined?!![]:![]:!![]})[_0xfbe2('0x1d')](function(_0x4b2bc9){logger[_0xfbe2('0xd')](_0xfbe2('0x17'),_0x27f7f0);logger[_0xfbe2('0x1e')](_0xfbe2('0x17'),_0x27f7f0,JSON[_0xfbe2('0x11')](_0x4b2bc9));_0xb7e53f(_0x4b2bc9);})['catch'](function(_0x455026){logger[_0xfbe2('0x12')](_0xfbe2('0x17'),_0x455026[_0xfbe2('0x14')],_0x27f7f0);_0x3cbb6c(_0x796414[_0xfbe2('0x12')](0x1f4,_0x455026['message']));});});};exports['UpdateSquareReport']=function(_0x29a308){var _0x40ccc0=this;return new Promise(function(_0x476609,_0x27ab46){return db[_0xfbe2('0x18')]['update'](_0x29a308[_0xfbe2('0x1a')],{'raw':_0x29a308[_0xfbe2('0x1b')]?_0x29a308['options'][_0xfbe2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29a308[_0xfbe2('0x1b')]?_0x29a308['options'][_0xfbe2('0x1f')]||null:null,'attributes':_0x29a308['options']?_0x29a308[_0xfbe2('0x1b')][_0xfbe2('0x20')]||null:null,'limit':_0x29a308['options']?_0x29a308[_0xfbe2('0x1b')][_0xfbe2('0x21')]||null:null})[_0xfbe2('0x1d')](function(_0x1ae3ea){logger['info'](_0xfbe2('0x22'),_0x29a308);logger[_0xfbe2('0x1e')](_0xfbe2('0x22'),_0x29a308,JSON[_0xfbe2('0x11')](_0x1ae3ea));_0x476609(_0x1ae3ea);})[_0xfbe2('0x16')](function(_0x527350){logger[_0xfbe2('0x12')]('UpdateSquareReport',_0x527350[_0xfbe2('0x14')],_0x29a308);_0x27ab46(_0x40ccc0[_0xfbe2('0x12')](0x1f4,_0x527350[_0xfbe2('0x14')]));});});}; \ No newline at end of file +var _0x7e4f=['info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareReport','create','body','options','raw','UpdateSquareReport','SquareReport','update','where','limit','then','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x3735bf,_0x4bce37){var _0x2d9565=function(_0x443fa4){while(--_0x443fa4){_0x3735bf['push'](_0x3735bf['shift']());}};_0x2d9565(++_0x4bce37);}(_0x7e4f,0xee));var _0xf7e4=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7e4f[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf7e4('0x0'));var BPromise=require(_0xf7e4('0x1'));var rs=require(_0xf7e4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7e4('0x3'))['db'];var utils=require(_0xf7e4('0x4'));var logger=require(_0xf7e4('0x5'))(_0xf7e4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf7e4('0x7')][_0xf7e4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x168cc4,_0x46b472,_0x1d7b8e){return new BPromise(function(_0x57d427,_0xc306fc){return client[_0xf7e4('0x9')](_0x168cc4,_0x1d7b8e)['then'](function(_0x284055){logger[_0xf7e4('0xa')](_0xf7e4('0xb'),_0x46b472,_0xf7e4('0xc'));logger[_0xf7e4('0xd')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x46b472,'request\x20sent',JSON[_0xf7e4('0xe')](_0x284055));if(_0x284055[_0xf7e4('0xf')]){if(_0x284055[_0xf7e4('0xf')][_0xf7e4('0x10')]===0x1f4){logger[_0xf7e4('0xf')]('SquareReport,\x20%s,\x20%s',_0x46b472,_0x284055[_0xf7e4('0xf')][_0xf7e4('0x11')]);return _0xc306fc(_0x284055[_0xf7e4('0xf')]['message']);}logger[_0xf7e4('0xf')](_0xf7e4('0xb'),_0x46b472,_0x284055['error']['message']);return _0x57d427(_0x284055['error']['message']);}else{logger['info'](_0xf7e4('0xb'),_0x46b472,_0xf7e4('0xc'));_0x57d427(_0x284055[_0xf7e4('0x12')]['message']);}})[_0xf7e4('0x13')](function(_0x2f6b1d){logger[_0xf7e4('0xf')](_0xf7e4('0xb'),_0x46b472,_0x2f6b1d);_0xc306fc(_0x2f6b1d);});});}exports[_0xf7e4('0x14')]=function(_0x58eec2){var _0x202ed9=this;return new Promise(function(_0x44c676,_0x4598b5){return db['SquareReport'][_0xf7e4('0x15')](_0x58eec2[_0xf7e4('0x16')],{'raw':_0x58eec2[_0xf7e4('0x17')]?_0x58eec2[_0xf7e4('0x17')][_0xf7e4('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x36e34a){logger['info']('CreateSquareReport',_0x58eec2);logger['debug'](_0xf7e4('0x14'),_0x58eec2,JSON[_0xf7e4('0xe')](_0x36e34a));_0x44c676(_0x36e34a);})[_0xf7e4('0x13')](function(_0x4b2a91){logger['error'](_0xf7e4('0x14'),_0x4b2a91['message'],_0x58eec2);_0x4598b5(_0x202ed9['error'](0x1f4,_0x4b2a91[_0xf7e4('0x11')]));});});};exports[_0xf7e4('0x19')]=function(_0x226e09){var _0x4c43fb=this;return new Promise(function(_0x25dea1,_0x2da1f1){return db[_0xf7e4('0x1a')][_0xf7e4('0x1b')](_0x226e09[_0xf7e4('0x16')],{'raw':_0x226e09[_0xf7e4('0x17')]?_0x226e09[_0xf7e4('0x17')][_0xf7e4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x226e09['options']?_0x226e09[_0xf7e4('0x17')][_0xf7e4('0x1c')]||null:null,'attributes':_0x226e09[_0xf7e4('0x17')]?_0x226e09[_0xf7e4('0x17')]['attributes']||null:null,'limit':_0x226e09[_0xf7e4('0x17')]?_0x226e09[_0xf7e4('0x17')][_0xf7e4('0x1d')]||null:null})[_0xf7e4('0x1e')](function(_0x1226ff){logger[_0xf7e4('0xa')](_0xf7e4('0x19'),_0x226e09);logger[_0xf7e4('0xd')](_0xf7e4('0x19'),_0x226e09,JSON[_0xf7e4('0xe')](_0x1226ff));_0x25dea1(_0x1226ff);})[_0xf7e4('0x13')](function(_0x3f479c){logger[_0xf7e4('0xf')](_0xf7e4('0x19'),_0x3f479c['message'],_0x226e09);_0x2da1f1(_0x4c43fb['error'](0x1f4,_0x3f479c[_0xf7e4('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 841fd6c..aa9b1f8 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 _0x7ec7=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','/describe','isAuthenticated','describe','get','/:id','post','create','update','exports','util'];(function(_0x10de9c,_0x5a81b0){var _0x198a7e=function(_0x1c0c93){while(--_0x1c0c93){_0x10de9c['push'](_0x10de9c['shift']());}};_0x198a7e(++_0x5a81b0);}(_0x7ec7,0x131));var _0x77ec=function(_0x1a4cac,_0x116f47){_0x1a4cac=_0x1a4cac-0x0;var _0x142f2f=_0x7ec7[_0x1a4cac];return _0x142f2f;};'use strict';var multer=require('multer');var util=require(_0x77ec('0x0'));var path=require(_0x77ec('0x1'));var timeout=require(_0x77ec('0x2'));var express=require('express');var router=express[_0x77ec('0x3')]();var fs_extra=require(_0x77ec('0x4'));var auth=require(_0x77ec('0x5'));var interaction=require(_0x77ec('0x6'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x77ec('0x7')]);router['get'](_0x77ec('0x8'),auth[_0x77ec('0x9')](),controller[_0x77ec('0xa')]);router[_0x77ec('0xb')](_0x77ec('0xc'),auth[_0x77ec('0x9')](),controller['show']);router[_0x77ec('0xd')]('/',auth[_0x77ec('0x9')](),controller[_0x77ec('0xe')]);router['put'](_0x77ec('0xc'),auth['isAuthenticated'](),controller[_0x77ec('0xf')]);router['delete'](_0x77ec('0xc'),auth[_0x77ec('0x9')](),controller['destroy']);module[_0x77ec('0x10')]=router; \ No newline at end of file +var _0x171c=['index','/describe','describe','/:id','show','put','delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x4f1071,_0x344c47){var _0x1fb4dd=function(_0xe2ab1c){while(--_0xe2ab1c){_0x4f1071['push'](_0x4f1071['shift']());}};_0x1fb4dd(++_0x344c47);}(_0x171c,0x17d));var _0xc171=function(_0x3b7c4d,_0x43c187){_0x3b7c4d=_0x3b7c4d-0x0;var _0x3995b2=_0x171c[_0x3b7c4d];return _0x3995b2;};'use strict';var multer=require(_0xc171('0x0'));var util=require('util');var path=require(_0xc171('0x1'));var timeout=require('connect-timeout');var express=require(_0xc171('0x2'));var router=express[_0xc171('0x3')]();var fs_extra=require(_0xc171('0x4'));var auth=require(_0xc171('0x5'));var interaction=require(_0xc171('0x6'));var config=require('../../config/environment');var controller=require(_0xc171('0x7'));router[_0xc171('0x8')]('/',auth[_0xc171('0x9')](),controller[_0xc171('0xa')]);router['get'](_0xc171('0xb'),auth[_0xc171('0x9')](),controller[_0xc171('0xc')]);router[_0xc171('0x8')](_0xc171('0xd'),auth[_0xc171('0x9')](),controller[_0xc171('0xe')]);router['post']('/',auth[_0xc171('0x9')](),controller['create']);router[_0xc171('0xf')](_0xc171('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xc171('0x10')](_0xc171('0xd'),auth[_0xc171('0x9')](),controller['destroy']);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 f3358b5..576c397 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 _0x03ae=['TEXT','sequelize','exports','STRING'];(function(_0x5193d2,_0x27d826){var _0x49d7b2=function(_0x578e1b){while(--_0x578e1b){_0x5193d2['push'](_0x5193d2['shift']());}};_0x49d7b2(++_0x27d826);}(_0x03ae,0x135));var _0xe03a=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x03ae[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require(_0xe03a('0x0'));module[_0xe03a('0x1')]={'uniqueid':{'type':Sequelize[_0xe03a('0x2')]},'node':{'type':Sequelize[_0xe03a('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xe03a('0x3')]},'project_name':{'type':Sequelize[_0xe03a('0x2')]},'callerid':{'type':Sequelize[_0xe03a('0x2')]}}; \ No newline at end of file +var _0xf04c=['STRING','sequelize','exports'];(function(_0x4245da,_0xa976da){var _0x18925b=function(_0x3ed249){while(--_0x3ed249){_0x4245da['push'](_0x4245da['shift']());}};_0x18925b(++_0xa976da);}(_0xf04c,0xfd));var _0xcf04=function(_0x85a4e0,_0x47df41){_0x85a4e0=_0x85a4e0-0x0;var _0x340968=_0xf04c[_0x85a4e0];return _0x340968;};'use strict';var Sequelize=require(_0xcf04('0x0'));module[_0xcf04('0x1')]={'uniqueid':{'type':Sequelize[_0xcf04('0x2')]},'node':{'type':Sequelize[_0xcf04('0x2')]},'application':{'type':Sequelize[_0xcf04('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xcf04('0x2')]},'callerid':{'type':Sequelize[_0xcf04('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index e508428..e8a5dec 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 _0x93d3=['intersection','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','name','options','include','findAll','rows','catch','params','rawAttributes','fields','length','includeAll','create','body','find','describe','eml-format','zip-dir','mustache','util','path','jsforce','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','stack','index','map','SquareDetailsReport','fieldName','key','model','keys','query','filters'];(function(_0x1db831,_0x42b7b5){var _0x39ba56=function(_0x2c2dd3){while(--_0x2c2dd3){_0x1db831['push'](_0x1db831['shift']());}};_0x39ba56(++_0x42b7b5);}(_0x93d3,0x1e9));var _0x393d=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x93d3[_0x24061a];return _0x82054e;};'use strict';var emlformat=require(_0x393d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x393d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x393d('0x2'));var util=require(_0x393d('0x3'));var path=require(_0x393d('0x4'));var sox=require('sox');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('crypto');var jsforce=require(_0x393d('0x5'));var deskjs=require('desk.js');var toCsv=require(_0x393d('0x6'));var querystring=require(_0x393d('0x7'));var Papa=require('papaparse');var Redis=require(_0x393d('0x8'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x393d('0x9'));var hardwareService=require(_0x393d('0xa'));var logger=require(_0x393d('0xb'))('api');var utils=require(_0x393d('0xc'));var config=require(_0x393d('0xd'));var licenseUtil=require(_0x393d('0xe'));var db=require(_0x393d('0xf'))['db'];function respondWithStatusCode(_0x578a43,_0x39b8b3){_0x39b8b3=_0x39b8b3||0xcc;return function(_0x3cf62a){if(_0x3cf62a){return _0x578a43[_0x393d('0x10')](_0x39b8b3);}return _0x578a43[_0x393d('0x11')](_0x39b8b3)['end']();};}function respondWithResult(_0x17bc58,_0x483596){_0x483596=_0x483596||0xc8;return function(_0x3417b6){if(_0x3417b6){return _0x17bc58[_0x393d('0x11')](_0x483596)[_0x393d('0x12')](_0x3417b6);}};}function respondWithFilteredResult(_0x56ba70,_0x216159){return function(_0x2afa31){if(_0x2afa31){var _0x5c4802=typeof _0x216159[_0x393d('0x13')]===_0x393d('0x14')&&typeof _0x216159['limit']===_0x393d('0x14');var _0x5f239e=_0x2afa31[_0x393d('0x15')];var _0x596f2f=_0x5c4802?0x0:_0x216159[_0x393d('0x13')];var _0xa68587=_0x5c4802?_0x2afa31[_0x393d('0x15')]:_0x216159[_0x393d('0x13')]+_0x216159['limit'];var _0x42fc17;if(_0xa68587>=_0x5f239e){_0xa68587=_0x5f239e;_0x42fc17=0xc8;}else{_0x42fc17=0xce;}_0x56ba70['status'](_0x42fc17);return _0x56ba70['set'](_0x393d('0x16'),_0x596f2f+'-'+_0xa68587+'/'+_0x5f239e)[_0x393d('0x12')](_0x2afa31);}return null;};}function patchUpdates(_0x420ee1){return function(_0x38d550){try{jsonpatch[_0x393d('0x17')](_0x38d550,_0x420ee1,!![]);}catch(_0x5d69fd){return BPromise[_0x393d('0x18')](_0x5d69fd);}return _0x38d550[_0x393d('0x19')]();};}function saveUpdates(_0x4b7ec9,_0xd4f173){return function(_0x4e29a2){if(_0x4e29a2){return _0x4e29a2[_0x393d('0x1a')](_0x4b7ec9)[_0x393d('0x1b')](function(_0x726e8f){return _0x726e8f;});}return null;};}function removeEntity(_0x58e451,_0x4da66c){return function(_0x3bee2f){if(_0x3bee2f){return _0x3bee2f[_0x393d('0x1c')]()[_0x393d('0x1b')](function(){_0x58e451['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b6b36,_0x35f7ae){return function(_0x416c79){if(!_0x416c79){_0x5b6b36[_0x393d('0x10')](0x194);}return _0x416c79;};}function handleError(_0x375da0,_0x5da764){_0x5da764=_0x5da764||0x1f4;return function(_0x21b0c2){logger['error'](_0x21b0c2[_0x393d('0x1d')]);if(_0x21b0c2['name']){delete _0x21b0c2['name'];}_0x375da0[_0x393d('0x11')](_0x5da764)['send'](_0x21b0c2);};}exports[_0x393d('0x1e')]=function(_0x108884,_0x57bfa2){var _0x4e0e24={},_0x158e26={},_0x35a05d={'count':0x0,'rows':[]};var _0x4e1eb9=_[_0x393d('0x1f')](db[_0x393d('0x20')]['rawAttributes'],function(_0x461d4e){return{'name':_0x461d4e[_0x393d('0x21')],'type':_0x461d4e['type'][_0x393d('0x22')]};});_0x158e26[_0x393d('0x23')]=_['map'](_0x4e1eb9,'name');_0x158e26['query']=_[_0x393d('0x24')](_0x108884[_0x393d('0x25')]);_0x158e26[_0x393d('0x26')]=_[_0x393d('0x27')](_0x158e26['model'],_0x158e26[_0x393d('0x25')]);_0x4e0e24['attributes']=_[_0x393d('0x27')](_0x158e26[_0x393d('0x23')],qs['fields'](_0x108884[_0x393d('0x25')]['fields']));_0x4e0e24[_0x393d('0x28')]=_0x4e0e24[_0x393d('0x28')]['length']?_0x4e0e24[_0x393d('0x28')]:_0x158e26['model'];if(!_0x108884['query'][_0x393d('0x29')]('nolimit')){_0x4e0e24['limit']=qs[_0x393d('0x2a')](_0x108884[_0x393d('0x25')][_0x393d('0x2a')]);_0x4e0e24[_0x393d('0x13')]=qs['offset'](_0x108884[_0x393d('0x25')][_0x393d('0x13')]);}_0x4e0e24[_0x393d('0x2b')]=qs[_0x393d('0x2c')](_0x108884[_0x393d('0x25')][_0x393d('0x2c')]);_0x4e0e24[_0x393d('0x2d')]=qs[_0x393d('0x26')](_[_0x393d('0x2e')](_0x108884['query'],_0x158e26[_0x393d('0x26')]),_0x4e1eb9);if(_0x108884[_0x393d('0x25')][_0x393d('0x2f')]){_0x4e0e24[_0x393d('0x2d')]=_[_0x393d('0x30')](_0x4e0e24[_0x393d('0x2d')],{'$or':_[_0x393d('0x1f')](_0x4e1eb9,function(_0x1f6205){if(_0x1f6205[_0x393d('0x31')]!==_0x393d('0x32')){var _0x4cbec8={};_0x4cbec8[_0x1f6205[_0x393d('0x33')]]={'$like':'%'+_0x108884[_0x393d('0x25')][_0x393d('0x2f')]+'%'};return _0x4cbec8;}})});}_0x4e0e24=_['merge']({},_0x4e0e24,_0x108884[_0x393d('0x34')]);var _0x165728={'where':_0x4e0e24[_0x393d('0x2d')]};return db['SquareDetailsReport'][_0x393d('0x15')](_0x165728)[_0x393d('0x1b')](function(_0x4bedf2){_0x35a05d[_0x393d('0x15')]=_0x4bedf2;if(_0x108884[_0x393d('0x25')]['includeAll']){_0x4e0e24[_0x393d('0x35')]=[{'all':!![]}];}return db[_0x393d('0x20')][_0x393d('0x36')](_0x4e0e24);})[_0x393d('0x1b')](function(_0x2f40c0){_0x35a05d[_0x393d('0x37')]=_0x2f40c0;return _0x35a05d;})['then'](respondWithFilteredResult(_0x57bfa2,_0x4e0e24))[_0x393d('0x38')](handleError(_0x57bfa2,null));};exports['show']=function(_0x13c3b4,_0x372dc5){var _0x36589b={'raw':!![],'where':{'id':_0x13c3b4[_0x393d('0x39')]['id']}},_0x257f8a={};_0x257f8a['model']=_['keys'](db[_0x393d('0x20')][_0x393d('0x3a')]);_0x257f8a[_0x393d('0x25')]=_[_0x393d('0x24')](_0x13c3b4[_0x393d('0x25')]);_0x257f8a[_0x393d('0x26')]=_[_0x393d('0x27')](_0x257f8a[_0x393d('0x23')],_0x257f8a[_0x393d('0x25')]);_0x36589b[_0x393d('0x28')]=_[_0x393d('0x27')](_0x257f8a[_0x393d('0x23')],qs[_0x393d('0x3b')](_0x13c3b4[_0x393d('0x25')][_0x393d('0x3b')]));_0x36589b[_0x393d('0x28')]=_0x36589b[_0x393d('0x28')][_0x393d('0x3c')]?_0x36589b[_0x393d('0x28')]:_0x257f8a['model'];if(_0x13c3b4[_0x393d('0x25')][_0x393d('0x3d')]){_0x36589b[_0x393d('0x35')]=[{'all':!![]}];}_0x36589b=_[_0x393d('0x30')]({},_0x36589b,_0x13c3b4[_0x393d('0x34')]);return db['SquareDetailsReport']['find'](_0x36589b)[_0x393d('0x1b')](handleEntityNotFound(_0x372dc5,null))['then'](respondWithResult(_0x372dc5,null))[_0x393d('0x38')](handleError(_0x372dc5,null));};exports[_0x393d('0x3e')]=function(_0xf31469,_0x46f1bb){return db['SquareDetailsReport']['create'](_0xf31469[_0x393d('0x3f')],{})['then'](respondWithResult(_0x46f1bb,0xc9))[_0x393d('0x38')](handleError(_0x46f1bb,null));};exports[_0x393d('0x1a')]=function(_0x5e8605,_0x19cadd){if(_0x5e8605[_0x393d('0x3f')]['id']){delete _0x5e8605[_0x393d('0x3f')]['id'];}return db[_0x393d('0x20')][_0x393d('0x40')]({'where':{'id':_0x5e8605['params']['id']}})[_0x393d('0x1b')](handleEntityNotFound(_0x19cadd,null))[_0x393d('0x1b')](saveUpdates(_0x5e8605[_0x393d('0x3f')],null))[_0x393d('0x1b')](respondWithResult(_0x19cadd,null))['catch'](handleError(_0x19cadd,null));};exports[_0x393d('0x1c')]=function(_0x1be187,_0x157c4a){return db[_0x393d('0x20')][_0x393d('0x40')]({'where':{'id':_0x1be187[_0x393d('0x39')]['id']}})[_0x393d('0x1b')](handleEntityNotFound(_0x157c4a,null))['then'](removeEntity(_0x157c4a,null))['catch'](handleError(_0x157c4a,null));};exports[_0x393d('0x41')]=function(_0x4867db,_0x566445){return db['SquareDetailsReport'][_0x393d('0x41')]()['then'](respondWithResult(_0x566445,null))[_0x393d('0x38')](handleError(_0x566445,null));}; \ No newline at end of file +var _0x47f5=['stack','name','send','index','map','SquareDetailsReport','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','order','sort','filter','where','type','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','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','offset','limit','count','Content-Range','json','reject','save','update','destroy','then'];(function(_0x1e4c55,_0x1415eb){var _0x511ab5=function(_0x2958cb){while(--_0x2958cb){_0x1e4c55['push'](_0x1e4c55['shift']());}};_0x511ab5(++_0x1415eb);}(_0x47f5,0x1be));var _0x547f=function(_0x595bd1,_0xb1e7a){_0x595bd1=_0x595bd1-0x0;var _0xd0344f=_0x47f5[_0x595bd1];return _0xd0344f;};'use strict';var emlformat=require(_0x547f('0x0'));var rimraf=require(_0x547f('0x1'));var zipdir=require(_0x547f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x547f('0x3'));var moment=require(_0x547f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x547f('0x5'));var util=require(_0x547f('0x6'));var path=require(_0x547f('0x7'));var sox=require(_0x547f('0x8'));var csv=require(_0x547f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x547f('0xa'));var squel=require('squel');var crypto=require(_0x547f('0xb'));var jsforce=require(_0x547f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x547f('0x9'));var querystring=require(_0x547f('0xd'));var Papa=require(_0x547f('0xe'));var Redis=require(_0x547f('0xf'));var authService=require(_0x547f('0x10'));var qs=require(_0x547f('0x11'));var as=require(_0x547f('0x12'));var hardwareService=require(_0x547f('0x13'));var logger=require(_0x547f('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x547f('0x15'));var licenseUtil=require(_0x547f('0x16'));var db=require(_0x547f('0x17'))['db'];function respondWithStatusCode(_0x2770a8,_0x4e2c20){_0x4e2c20=_0x4e2c20||0xcc;return function(_0x467b71){if(_0x467b71){return _0x2770a8[_0x547f('0x18')](_0x4e2c20);}return _0x2770a8[_0x547f('0x19')](_0x4e2c20)[_0x547f('0x1a')]();};}function respondWithResult(_0x2f4bc6,_0x312059){_0x312059=_0x312059||0xc8;return function(_0x58358a){if(_0x58358a){return _0x2f4bc6[_0x547f('0x19')](_0x312059)['json'](_0x58358a);}};}function respondWithFilteredResult(_0xc40384,_0x371152){return function(_0x480552){if(_0x480552){var _0x52a2ab=typeof _0x371152[_0x547f('0x1b')]==='undefined'&&typeof _0x371152[_0x547f('0x1c')]==='undefined';var _0xe31ad6=_0x480552[_0x547f('0x1d')];var _0x36435c=_0x52a2ab?0x0:_0x371152[_0x547f('0x1b')];var _0x1a1155=_0x52a2ab?_0x480552[_0x547f('0x1d')]:_0x371152[_0x547f('0x1b')]+_0x371152[_0x547f('0x1c')];var _0x4be6a3;if(_0x1a1155>=_0xe31ad6){_0x1a1155=_0xe31ad6;_0x4be6a3=0xc8;}else{_0x4be6a3=0xce;}_0xc40384[_0x547f('0x19')](_0x4be6a3);return _0xc40384['set'](_0x547f('0x1e'),_0x36435c+'-'+_0x1a1155+'/'+_0xe31ad6)[_0x547f('0x1f')](_0x480552);}return null;};}function patchUpdates(_0x201ae6){return function(_0x1bcedd){try{jsonpatch['apply'](_0x1bcedd,_0x201ae6,!![]);}catch(_0x3f8c73){return BPromise[_0x547f('0x20')](_0x3f8c73);}return _0x1bcedd[_0x547f('0x21')]();};}function saveUpdates(_0x511e81,_0x6a6487){return function(_0x1c4485){if(_0x1c4485){return _0x1c4485[_0x547f('0x22')](_0x511e81)['then'](function(_0x2b1d49){return _0x2b1d49;});}return null;};}function removeEntity(_0x8d29be,_0x60acf6){return function(_0x36e705){if(_0x36e705){return _0x36e705[_0x547f('0x23')]()[_0x547f('0x24')](function(){_0x8d29be['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48b2df,_0xdfd1e3){return function(_0x57b3ac){if(!_0x57b3ac){_0x48b2df[_0x547f('0x18')](0x194);}return _0x57b3ac;};}function handleError(_0x2c554b,_0x45c181){_0x45c181=_0x45c181||0x1f4;return function(_0x4672af){logger['error'](_0x4672af[_0x547f('0x25')]);if(_0x4672af[_0x547f('0x26')]){delete _0x4672af[_0x547f('0x26')];}_0x2c554b[_0x547f('0x19')](_0x45c181)[_0x547f('0x27')](_0x4672af);};}exports[_0x547f('0x28')]=function(_0x59ac8b,_0x50bcfd){var _0x442eec={},_0x12421f={},_0x1cbe41={'count':0x0,'rows':[]};var _0xa3c113=_[_0x547f('0x29')](db[_0x547f('0x2a')][_0x547f('0x2b')],function(_0x3a4d53){return{'name':_0x3a4d53['fieldName'],'type':_0x3a4d53['type'][_0x547f('0x2c')]};});_0x12421f['model']=_[_0x547f('0x29')](_0xa3c113,_0x547f('0x26'));_0x12421f[_0x547f('0x2d')]=_['keys'](_0x59ac8b['query']);_0x12421f[_0x547f('0x2e')]=_[_0x547f('0x2f')](_0x12421f[_0x547f('0x30')],_0x12421f[_0x547f('0x2d')]);_0x442eec[_0x547f('0x31')]=_[_0x547f('0x2f')](_0x12421f[_0x547f('0x30')],qs[_0x547f('0x32')](_0x59ac8b['query'][_0x547f('0x32')]));_0x442eec['attributes']=_0x442eec[_0x547f('0x31')][_0x547f('0x33')]?_0x442eec['attributes']:_0x12421f[_0x547f('0x30')];if(!_0x59ac8b[_0x547f('0x2d')]['hasOwnProperty']('nolimit')){_0x442eec[_0x547f('0x1c')]=qs[_0x547f('0x1c')](_0x59ac8b['query'][_0x547f('0x1c')]);_0x442eec['offset']=qs[_0x547f('0x1b')](_0x59ac8b['query'][_0x547f('0x1b')]);}_0x442eec[_0x547f('0x34')]=qs['sort'](_0x59ac8b['query'][_0x547f('0x35')]);_0x442eec['where']=qs['filters'](_['pick'](_0x59ac8b[_0x547f('0x2d')],_0x12421f[_0x547f('0x2e')]),_0xa3c113);if(_0x59ac8b[_0x547f('0x2d')][_0x547f('0x36')]){_0x442eec[_0x547f('0x37')]=_['merge'](_0x442eec[_0x547f('0x37')],{'$or':_[_0x547f('0x29')](_0xa3c113,function(_0x28bbd0){if(_0x28bbd0[_0x547f('0x38')]!=='VIRTUAL'){var _0x306e2a={};_0x306e2a[_0x28bbd0[_0x547f('0x26')]]={'$like':'%'+_0x59ac8b['query'][_0x547f('0x36')]+'%'};return _0x306e2a;}})});}_0x442eec=_['merge']({},_0x442eec,_0x59ac8b['options']);var _0x46e66d={'where':_0x442eec[_0x547f('0x37')]};return db[_0x547f('0x2a')]['count'](_0x46e66d)[_0x547f('0x24')](function(_0x11d8f4){_0x1cbe41[_0x547f('0x1d')]=_0x11d8f4;if(_0x59ac8b[_0x547f('0x2d')][_0x547f('0x39')]){_0x442eec[_0x547f('0x3a')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x547f('0x3b')](_0x442eec);})[_0x547f('0x24')](function(_0x86f51d){_0x1cbe41[_0x547f('0x3c')]=_0x86f51d;return _0x1cbe41;})['then'](respondWithFilteredResult(_0x50bcfd,_0x442eec))[_0x547f('0x3d')](handleError(_0x50bcfd,null));};exports[_0x547f('0x3e')]=function(_0x8d6b4,_0x56fb1c){var _0x5cc933={'raw':!![],'where':{'id':_0x8d6b4[_0x547f('0x3f')]['id']}},_0xe8d24c={};_0xe8d24c[_0x547f('0x30')]=_[_0x547f('0x40')](db['SquareDetailsReport'][_0x547f('0x2b')]);_0xe8d24c['query']=_[_0x547f('0x40')](_0x8d6b4[_0x547f('0x2d')]);_0xe8d24c[_0x547f('0x2e')]=_[_0x547f('0x2f')](_0xe8d24c[_0x547f('0x30')],_0xe8d24c[_0x547f('0x2d')]);_0x5cc933[_0x547f('0x31')]=_[_0x547f('0x2f')](_0xe8d24c[_0x547f('0x30')],qs[_0x547f('0x32')](_0x8d6b4[_0x547f('0x2d')][_0x547f('0x32')]));_0x5cc933[_0x547f('0x31')]=_0x5cc933[_0x547f('0x31')][_0x547f('0x33')]?_0x5cc933[_0x547f('0x31')]:_0xe8d24c[_0x547f('0x30')];if(_0x8d6b4[_0x547f('0x2d')][_0x547f('0x39')]){_0x5cc933['include']=[{'all':!![]}];}_0x5cc933=_[_0x547f('0x41')]({},_0x5cc933,_0x8d6b4['options']);return db[_0x547f('0x2a')][_0x547f('0x42')](_0x5cc933)[_0x547f('0x24')](handleEntityNotFound(_0x56fb1c,null))['then'](respondWithResult(_0x56fb1c,null))['catch'](handleError(_0x56fb1c,null));};exports['create']=function(_0x5eee2f,_0x55a596){return db[_0x547f('0x2a')]['create'](_0x5eee2f['body'],{})[_0x547f('0x24')](respondWithResult(_0x55a596,0xc9))[_0x547f('0x3d')](handleError(_0x55a596,null));};exports[_0x547f('0x22')]=function(_0x1fcf42,_0x3102d6){if(_0x1fcf42[_0x547f('0x43')]['id']){delete _0x1fcf42[_0x547f('0x43')]['id'];}return db['SquareDetailsReport'][_0x547f('0x42')]({'where':{'id':_0x1fcf42['params']['id']}})[_0x547f('0x24')](handleEntityNotFound(_0x3102d6,null))['then'](saveUpdates(_0x1fcf42[_0x547f('0x43')],null))[_0x547f('0x24')](respondWithResult(_0x3102d6,null))['catch'](handleError(_0x3102d6,null));};exports[_0x547f('0x23')]=function(_0x13a1d9,_0x126763){return db[_0x547f('0x2a')][_0x547f('0x42')]({'where':{'id':_0x13a1d9[_0x547f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x126763,null))[_0x547f('0x24')](removeEntity(_0x126763,null))['catch'](handleError(_0x126763,null));};exports[_0x547f('0x44')]=function(_0x5d22de,_0x150027){return db[_0x547f('0x2a')][_0x547f('0x44')]()[_0x547f('0x24')](respondWithResult(_0x150027,null))[_0x547f('0x3d')](handleError(_0x150027,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index def6089..eb04046 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 _0xbbf1=['path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x275e85,_0x2fc5c1){var _0xe1e5f2=function(_0x4565d6){while(--_0x4565d6){_0x275e85['push'](_0x275e85['shift']());}};_0xe1e5f2(++_0x2fc5c1);}(_0xbbf1,0x166));var _0x1bbf=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0xbbf1[_0x46f1a6];return _0x38429a;};'use strict';var _=require(_0x1bbf('0x0'));var util=require(_0x1bbf('0x1'));var logger=require(_0x1bbf('0x2'))(_0x1bbf('0x3'));var moment=require(_0x1bbf('0x4'));var BPromise=require('bluebird');var rp=require(_0x1bbf('0x5'));var fs=require('fs');var path=require(_0x1bbf('0x6'));var rimraf=require(_0x1bbf('0x7'));var config=require(_0x1bbf('0x8'));var attributes=require(_0x1bbf('0x9'));module[_0x1bbf('0xa')]=function(_0x2e2aed,_0x20e3da){return _0x2e2aed[_0x1bbf('0xb')](_0x1bbf('0xc'),attributes,{'tableName':_0x1bbf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x906c=['bluebird','request-promise','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','report_square_details','lodash','api','moment'];(function(_0x433694,_0x4a1257){var _0x38569f=function(_0x42d8f6){while(--_0x42d8f6){_0x433694['push'](_0x433694['shift']());}};_0x38569f(++_0x4a1257);}(_0x906c,0xfa));var _0xc906=function(_0x1a706a,_0x49ce65){_0x1a706a=_0x1a706a-0x0;var _0x139364=_0x906c[_0x1a706a];return _0x139364;};'use strict';var _=require(_0xc906('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc906('0x1'));var moment=require(_0xc906('0x2'));var BPromise=require(_0xc906('0x3'));var rp=require(_0xc906('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc906('0x5'));var config=require(_0xc906('0x6'));var attributes=require(_0xc906('0x7'));module[_0xc906('0x8')]=function(_0x2ded2f,_0x133ab3){return _0x2ded2f[_0xc906('0x9')]('SquareDetailsReport',attributes,{'tableName':_0xc906('0xa'),'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 53a875d..3077e8b 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 _0x351d=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','then'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x351d,0x90));var _0xd351=function(_0x4743cc,_0x13609b){_0x4743cc=_0x4743cc-0x0;var _0x40d6c4=_0x351d[_0x4743cc];return _0x40d6c4;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var moment=require(_0xd351('0x1'));var BPromise=require(_0xd351('0x2'));var rs=require(_0xd351('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd351('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd351('0x5'))(_0xd351('0x6'));var config=require('../../config/environment');var jayson=require(_0xd351('0x7'));var client=jayson[_0xd351('0x8')][_0xd351('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5318b2,_0x16b3f7,_0x235aa0){return new BPromise(function(_0x4e1b06,_0x2e9a2a){return client[_0xd351('0xa')](_0x5318b2,_0x235aa0)['then'](function(_0x586c60){logger[_0xd351('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x16b3f7,_0xd351('0xc'));logger[_0xd351('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x16b3f7,_0xd351('0xc'),JSON[_0xd351('0xe')](_0x586c60));if(_0x586c60['error']){if(_0x586c60[_0xd351('0xf')]['code']===0x1f4){logger['error'](_0xd351('0x10'),_0x16b3f7,_0x586c60[_0xd351('0xf')][_0xd351('0x11')]);return _0x2e9a2a(_0x586c60[_0xd351('0xf')]['message']);}logger[_0xd351('0xf')](_0xd351('0x10'),_0x16b3f7,_0x586c60['error'][_0xd351('0x11')]);return _0x4e1b06(_0x586c60[_0xd351('0xf')][_0xd351('0x11')]);}else{logger[_0xd351('0xb')](_0xd351('0x10'),_0x16b3f7,'request\x20sent');_0x4e1b06(_0x586c60[_0xd351('0x12')]['message']);}})['catch'](function(_0x2c6708){logger['error'](_0xd351('0x10'),_0x16b3f7,_0x2c6708);_0x2e9a2a(_0x2c6708);});});}exports[_0xd351('0x13')]=function(_0x4e0164){var _0x4c6693=this;return new Promise(function(_0x1e1a3c,_0x2bfc53){return db[_0xd351('0x14')][_0xd351('0x15')](_0x4e0164['body'],{'raw':_0x4e0164[_0xd351('0x16')]?_0x4e0164['options']['raw']===undefined?!![]:![]:!![]})[_0xd351('0x17')](function(_0x4a427b){logger[_0xd351('0xb')](_0xd351('0x13'),_0x4e0164);logger[_0xd351('0xd')](_0xd351('0x13'),_0x4e0164,JSON[_0xd351('0xe')](_0x4a427b));_0x1e1a3c(_0x4a427b);})['catch'](function(_0x18625b){logger[_0xd351('0xf')](_0xd351('0x13'),_0x18625b['message'],_0x4e0164);_0x2bfc53(_0x4c6693[_0xd351('0xf')](0x1f4,_0x18625b[_0xd351('0x11')]));});});}; \ No newline at end of file +var _0xbbbc=['options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','request\x20sent','error','message','result','catch','CreateSquareDetailsReport','create','body'];(function(_0x1fa890,_0x4fbfa9){var _0x119874=function(_0x1903e4){while(--_0x1903e4){_0x1fa890['push'](_0x1fa890['shift']());}};_0x119874(++_0x4fbfa9);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x36a560,_0x57378b){_0x36a560=_0x36a560-0x0;var _0x10923a=_0xbbbc[_0x36a560];return _0x10923a;};'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')]('SquareDetailsReport,\x20%s,\x20%s',_0x1796b4,'request\x20sent');logger[_0xcbbb('0xf')]('SquareDetailsReport,\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')]('SquareDetailsReport,\x20%s,\x20%s',_0x1796b4,_0x4ec90a[_0xcbbb('0x11')]['message']);return _0x356249(_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);}logger[_0xcbbb('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x1796b4,_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);return _0x6f4fd8(_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x1796b4,_0xcbbb('0x10'));_0x6f4fd8(_0x4ec90a[_0xcbbb('0x13')][_0xcbbb('0x12')]);}})[_0xcbbb('0x14')](function(_0x5e25ca){logger[_0xcbbb('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x1796b4,_0x5e25ca);_0x356249(_0x5e25ca);});});}exports[_0xcbbb('0x15')]=function(_0x3436af){var _0x3572bb=this;return new Promise(function(_0x5052df,_0x57c5e9){return db['SquareDetailsReport'][_0xcbbb('0x16')](_0x3436af[_0xcbbb('0x17')],{'raw':_0x3436af[_0xcbbb('0x18')]?_0x3436af[_0xcbbb('0x18')][_0xcbbb('0x19')]===undefined?!![]:![]:!![]})[_0xcbbb('0xd')](function(_0x45de5f){logger[_0xcbbb('0xe')](_0xcbbb('0x15'),_0x3436af);logger[_0xcbbb('0xf')]('CreateSquareDetailsReport',_0x3436af,JSON[_0xcbbb('0x1a')](_0x45de5f));_0x5052df(_0x45de5f);})[_0xcbbb('0x14')](function(_0x159c62){logger[_0xcbbb('0x11')](_0xcbbb('0x15'),_0x159c62[_0xcbbb('0x12')],_0x3436af);_0x57c5e9(_0x3572bb[_0xcbbb('0x11')](0x1f4,_0x159c62[_0xcbbb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 295a0ac..1098f43 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 _0x64ab=['./system.controller','get','index','/process/:pid/kill','isAuthenticated','killProcess','exports','express','Router','../../components/auth/service'];(function(_0xdc5a08,_0x4eab21){var _0x3f6e2e=function(_0x3cb5ca){while(--_0x3cb5ca){_0xdc5a08['push'](_0xdc5a08['shift']());}};_0x3f6e2e(++_0x4eab21);}(_0x64ab,0x165));var _0xb64a=function(_0x51f023,_0xf4526d){_0x51f023=_0x51f023-0x0;var _0x3340db=_0x64ab[_0x51f023];return _0x3340db;};'use strict';var express=require(_0xb64a('0x0'));var router=express[_0xb64a('0x1')]();var auth=require(_0xb64a('0x2'));var controller=require(_0xb64a('0x3'));router[_0xb64a('0x4')]('/',auth['isAuthenticated'](),controller[_0xb64a('0x5')]);router[_0xb64a('0x4')](_0xb64a('0x6'),auth[_0xb64a('0x7')](),controller[_0xb64a('0x8')]);module[_0xb64a('0x9')]=router; \ No newline at end of file +var _0x6be4=['get','isAuthenticated','index','killProcess','exports','express','Router','../../components/auth/service','./system.controller'];(function(_0xda7f4f,_0x13c5c7){var _0x1b9e6e=function(_0x1f6506){while(--_0x1f6506){_0xda7f4f['push'](_0xda7f4f['shift']());}};_0x1b9e6e(++_0x13c5c7);}(_0x6be4,0x137));var _0x46be=function(_0x5aa593,_0x275634){_0x5aa593=_0x5aa593-0x0;var _0x3c2770=_0x6be4[_0x5aa593];return _0x3c2770;};'use strict';var express=require(_0x46be('0x0'));var router=express[_0x46be('0x1')]();var auth=require(_0x46be('0x2'));var controller=require(_0x46be('0x3'));router[_0x46be('0x4')]('/',auth[_0x46be('0x5')](),controller[_0x46be('0x6')]);router[_0x46be('0x4')]('/process/:pid/kill',auth[_0x46be('0x5')](),controller[_0x46be('0x7')]);module[_0x46be('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index f0206a1..8705944 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 _0xf2f5=['exec','../../config/logger','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','then','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process'];(function(_0x22e134,_0xb69611){var _0x3b7a20=function(_0x531b75){while(--_0x531b75){_0x22e134['push'](_0x22e134['shift']());}};_0x3b7a20(++_0xb69611);}(_0xf2f5,0x1d9));var _0x5f2f=function(_0x552d46,_0x2a8900){_0x552d46=_0x552d46-0x0;var _0x1d3599=_0xf2f5[_0x552d46];return _0x1d3599;};'use strict';var info=require(_0x5f2f('0x0'));var exec=require(_0x5f2f('0x1'))[_0x5f2f('0x2')];var logger=require(_0x5f2f('0x3'))('api');var util=require('util');var BPromise=require(_0x5f2f('0x4'));var _=require(_0x5f2f('0x5'));function handleError(_0x5c1234,_0x1704be,_0x5868c8){_0x1704be=_0x1704be||0x1f4;return function(_0x182a37){logger['error'](_0x5f2f('0x6'),_0x5868c8,_0x1704be,util[_0x5f2f('0x7')](_0x182a37,{'showHidden':![],'depth':null}));delete _0x182a37[_0x5f2f('0x8')];_0x5c1234[_0x5f2f('0x9')](_0x1704be)['send'](_0x182a37);};}exports[_0x5f2f('0xa')]=function(_0x1d02c7,_0x2c5944){return info['getAllData']()[_0x5f2f('0xb')](function(_0x3d9f2d){return _0x2c5944['status'](0xc8)[_0x5f2f('0xc')](_0x3d9f2d);})['catch'](function(_0x5129bb){return _0x2c5944['status'](0x1f4)[_0x5f2f('0xc')](_0x5129bb);});};exports[_0x5f2f('0xd')]=function(_0x12c06a,_0x2e0361){var _0x298d78=[_0x5f2f('0xe')];return new BPromise(function(_0x3d59ea,_0x28c16f){return exec(util[_0x5f2f('0xf')](_0x5f2f('0x10'),_0x12c06a[_0x5f2f('0x11')]['pid']),function(_0x4d0602,_0x44d9ea,_0x53f28a){if(_0x4d0602){return _0x28c16f(_0x4d0602);}return _0x3d59ea(_0x44d9ea);});})[_0x5f2f('0xb')](function(_0x34a529){var _0x50e530=![];var _0x304f11=_0x34a529[_0x5f2f('0x12')](/\n/);for(var _0x1afa2a=0x0,_0x294ca1=_0x298d78['length'];_0x1afa2a<_0x294ca1,_0x50e530===![];_0x1afa2a+=0x1){if(_0x34a529[_0x5f2f('0x13')](_0x298d78[_0x1afa2a])>=0x0){_0x50e530=!![];}}if(!_0x50e530){throw new Error(util[_0x5f2f('0xf')](_0x5f2f('0x14'),_0x12c06a[_0x5f2f('0x11')][_0x5f2f('0x15')]));}process[_0x5f2f('0x16')](_0x12c06a[_0x5f2f('0x11')]['pid'],_0x5f2f('0x17'));return _0x2e0361['status'](0xc8)[_0x5f2f('0xc')]({'message':util[_0x5f2f('0xf')](_0x5f2f('0x18'),_0x12c06a['params'][_0x5f2f('0x15')])});})['catch'](handleError(_0x2e0361,null,_0x5f2f('0xd')));}; \ No newline at end of file +var _0xe32f=['catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','json'];(function(_0xe4797c,_0x1a9bcf){var _0x41e9a7=function(_0x316ce1){while(--_0x316ce1){_0xe4797c['push'](_0xe4797c['shift']());}};_0x41e9a7(++_0x1a9bcf);}(_0xe32f,0x1cd));var _0xfe32=function(_0xce546,_0x141dbb){_0xce546=_0xce546-0x0;var _0x241852=_0xe32f[_0xce546];return _0x241852;};'use strict';var info=require(_0xfe32('0x0'));var exec=require(_0xfe32('0x1'))[_0xfe32('0x2')];var logger=require('../../config/logger')('api');var util=require('util');var BPromise=require(_0xfe32('0x3'));var _=require(_0xfe32('0x4'));function handleError(_0x42f2cb,_0x2f77d2,_0x432e9c){_0x2f77d2=_0x2f77d2||0x1f4;return function(_0xb8138e){logger[_0xfe32('0x5')](_0xfe32('0x6'),_0x432e9c,_0x2f77d2,util[_0xfe32('0x7')](_0xb8138e,{'showHidden':![],'depth':null}));delete _0xb8138e[_0xfe32('0x8')];_0x42f2cb[_0xfe32('0x9')](_0x2f77d2)[_0xfe32('0xa')](_0xb8138e);};}exports[_0xfe32('0xb')]=function(_0x8f71f0,_0x25ae8c){return info[_0xfe32('0xc')]()['then'](function(_0x30f695){return _0x25ae8c[_0xfe32('0x9')](0xc8)[_0xfe32('0xd')](_0x30f695);})[_0xfe32('0xe')](function(_0x3907cd){return _0x25ae8c[_0xfe32('0x9')](0x1f4)[_0xfe32('0xd')](_0x3907cd);});};exports[_0xfe32('0xf')]=function(_0x20c85e,_0x38da72){var _0x332033=[_0xfe32('0x10')];return new BPromise(function(_0x11f068,_0xcb01de){return exec(util[_0xfe32('0x11')](_0xfe32('0x12'),_0x20c85e[_0xfe32('0x13')][_0xfe32('0x14')]),function(_0x1514e8,_0x5d6a87,_0x53837b){if(_0x1514e8){return _0xcb01de(_0x1514e8);}return _0x11f068(_0x5d6a87);});})['then'](function(_0x8f9e9f){var _0x2eb0bc=![];var _0x4a559a=_0x8f9e9f['split'](/\n/);for(var _0x5df004=0x0,_0x2cca1b=_0x332033['length'];_0x5df004<_0x2cca1b,_0x2eb0bc===![];_0x5df004+=0x1){if(_0x8f9e9f[_0xfe32('0x15')](_0x332033[_0x5df004])>=0x0){_0x2eb0bc=!![];}}if(!_0x2eb0bc){throw new Error(util[_0xfe32('0x11')](_0xfe32('0x16'),_0x20c85e[_0xfe32('0x13')][_0xfe32('0x14')]));}process['kill'](_0x20c85e[_0xfe32('0x13')]['pid'],_0xfe32('0x17'));return _0x38da72[_0xfe32('0x9')](0xc8)[_0xfe32('0xd')]({'message':util['format'](_0xfe32('0x18'),_0x20c85e[_0xfe32('0x13')]['pid'])});})[_0xfe32('0xe')](handleError(_0x38da72,null,_0xfe32('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 7b79afa..ebe1618 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 _0xefc3=['../../components/interaction/service','get','isAuthenticated','/:id','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3e182f,_0x380ec7){var _0x23edc9=function(_0x3ca65e){while(--_0x3ca65e){_0x3e182f['push'](_0x3e182f['shift']());}};_0x23edc9(++_0x380ec7);}(_0xefc3,0xa9));var _0x3efc=function(_0x2d1bc8,_0x26f326){_0x2d1bc8=_0x2d1bc8-0x0;var _0x5c0c8b=_0xefc3[_0x2d1bc8];return _0x5c0c8b;};'use strict';var multer=require(_0x3efc('0x0'));var util=require(_0x3efc('0x1'));var path=require(_0x3efc('0x2'));var timeout=require(_0x3efc('0x3'));var express=require(_0x3efc('0x4'));var router=express[_0x3efc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3efc('0x6'));var interaction=require(_0x3efc('0x7'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0x3efc('0x8')]('/',auth[_0x3efc('0x9')](),controller['index']);router[_0x3efc('0x8')](_0x3efc('0xa'),auth[_0x3efc('0x9')](),controller[_0x3efc('0xb')]);router[_0x3efc('0xc')]('/',auth['isAuthenticated'](),controller[_0x3efc('0xd')]);router['put']('/:id',auth[_0x3efc('0x9')](),controller['update']);router[_0x3efc('0xe')](_0x3efc('0xa'),auth[_0x3efc('0x9')](),controller[_0x3efc('0xf')]);module['exports']=router; \ No newline at end of file +var _0xe1d1=['destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete'];(function(_0x16ee11,_0x41af42){var _0x128d83=function(_0x40e757){while(--_0x40e757){_0x16ee11['push'](_0x16ee11['shift']());}};_0x128d83(++_0x41af42);}(_0xe1d1,0x131));var _0x1e1d=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xe1d1[_0x20589d];return _0x422de9;};'use strict';var multer=require(_0x1e1d('0x0'));var util=require(_0x1e1d('0x1'));var path=require('path');var timeout=require(_0x1e1d('0x2'));var express=require(_0x1e1d('0x3'));var router=express[_0x1e1d('0x4')]();var fs_extra=require(_0x1e1d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1e1d('0x6'));var config=require(_0x1e1d('0x7'));var controller=require(_0x1e1d('0x8'));router[_0x1e1d('0x9')]('/',auth[_0x1e1d('0xa')](),controller[_0x1e1d('0xb')]);router['get'](_0x1e1d('0xc'),auth[_0x1e1d('0xa')](),controller[_0x1e1d('0xd')]);router[_0x1e1d('0xe')]('/',auth[_0x1e1d('0xa')](),controller[_0x1e1d('0xf')]);router['put'](_0x1e1d('0xc'),auth[_0x1e1d('0xa')](),controller[_0x1e1d('0x10')]);router[_0x1e1d('0x11')](_0x1e1d('0xc'),auth[_0x1e1d('0xa')](),controller[_0x1e1d('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 6a4a3dd..90ce024 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 _0x4fc2=['STRING','name','#0091EA','sequelize','exports'];(function(_0x5efb4a,_0x39b1ec){var _0x5f31a2=function(_0x2375a7){while(--_0x2375a7){_0x5efb4a['push'](_0x5efb4a['shift']());}};_0x5f31a2(++_0x39b1ec);}(_0x4fc2,0x111));var _0x24fc=function(_0x3f7e37,_0x32f790){_0x3f7e37=_0x3f7e37-0x0;var _0x2a3ec7=_0x4fc2[_0x3f7e37];return _0x2a3ec7;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'name':{'type':Sequelize[_0x24fc('0x2')],'unique':_0x24fc('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x24fc('0x4')},'description':{'type':Sequelize[_0x24fc('0x2')]}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x2d5c23,_0x4c5b6b){var _0x38f2a3=function(_0x56d5fa){while(--_0x56d5fa){_0x2d5c23['push'](_0x2d5c23['shift']());}};_0x38f2a3(++_0x4c5b6b);}(_0x757a,0xde));var _0xa757=function(_0x1fe121,_0x508fd6){_0x1fe121=_0x1fe121-0x0;var _0x2a2343=_0x757a[_0x1fe121];return _0x2a2343;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xa757('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 77a3efb..791ca85 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_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 _0x8ce3=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','autoAssociation','UserProfileResource','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','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','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','stack','name','send','map','Tag','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0x8ce3,0xc3));var _0x38ce=function(_0x161ac3,_0x142e49){_0x161ac3=_0x161ac3-0x0;var _0x3bb837=_0x8ce3[_0x161ac3];return _0x3bb837;};'use strict';var emlformat=require(_0x38ce('0x0'));var rimraf=require(_0x38ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38ce('0x2'));var rp=require(_0x38ce('0x3'));var moment=require(_0x38ce('0x4'));var BPromise=require(_0x38ce('0x5'));var Mustache=require(_0x38ce('0x6'));var util=require(_0x38ce('0x7'));var path=require(_0x38ce('0x8'));var sox=require(_0x38ce('0x9'));var csv=require('to-csv');var ejs=require(_0x38ce('0xa'));var fs=require('fs');var fs_extra=require(_0x38ce('0xb'));var _=require('lodash');var squel=require(_0x38ce('0xc'));var crypto=require(_0x38ce('0xd'));var jsforce=require(_0x38ce('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x38ce('0xf'));var querystring=require('querystring');var Papa=require(_0x38ce('0x10'));var Redis=require('ioredis');var authService=require(_0x38ce('0x11'));var qs=require(_0x38ce('0x12'));var as=require(_0x38ce('0x13'));var hardwareService=require(_0x38ce('0x14'));var logger=require(_0x38ce('0x15'))(_0x38ce('0x16'));var utils=require(_0x38ce('0x17'));var config=require(_0x38ce('0x18'));var licenseUtil=require(_0x38ce('0x19'));var db=require(_0x38ce('0x1a'))['db'];function respondWithStatusCode(_0x42e234,_0x3ef662){_0x3ef662=_0x3ef662||0xcc;return function(_0x28b554){if(_0x28b554){return _0x42e234[_0x38ce('0x1b')](_0x3ef662);}return _0x42e234[_0x38ce('0x1c')](_0x3ef662)[_0x38ce('0x1d')]();};}function respondWithResult(_0x56a09f,_0x48ba7c){_0x48ba7c=_0x48ba7c||0xc8;return function(_0x3c4d7f){if(_0x3c4d7f){return _0x56a09f[_0x38ce('0x1c')](_0x48ba7c)[_0x38ce('0x1e')](_0x3c4d7f);}};}function respondWithFilteredResult(_0x55be6a,_0x2f3b99){return function(_0x54fcd3){if(_0x54fcd3){var _0x2771ec=typeof _0x2f3b99[_0x38ce('0x1f')]==='undefined'&&typeof _0x2f3b99[_0x38ce('0x20')]===_0x38ce('0x21');var _0x1dfaba=_0x54fcd3['count'];var _0xe4099a=_0x2771ec?0x0:_0x2f3b99[_0x38ce('0x1f')];var _0x3df527=_0x2771ec?_0x54fcd3[_0x38ce('0x22')]:_0x2f3b99[_0x38ce('0x1f')]+_0x2f3b99[_0x38ce('0x20')];var _0x2d4218;if(_0x3df527>=_0x1dfaba){_0x3df527=_0x1dfaba;_0x2d4218=0xc8;}else{_0x2d4218=0xce;}_0x55be6a['status'](_0x2d4218);return _0x55be6a[_0x38ce('0x23')](_0x38ce('0x24'),_0xe4099a+'-'+_0x3df527+'/'+_0x1dfaba)[_0x38ce('0x1e')](_0x54fcd3);}return null;};}function patchUpdates(_0x303391){return function(_0x30b060){try{jsonpatch[_0x38ce('0x25')](_0x30b060,_0x303391,!![]);}catch(_0x323490){return BPromise[_0x38ce('0x26')](_0x323490);}return _0x30b060[_0x38ce('0x27')]();};}function saveUpdates(_0x3cf50b,_0x1aace7){return function(_0x580cf3){if(_0x580cf3){return _0x580cf3[_0x38ce('0x28')](_0x3cf50b)[_0x38ce('0x29')](function(_0xe40e9c){return _0xe40e9c;});}return null;};}function removeEntity(_0xcf5d9e,_0x4a56b0){return function(_0x2c85e6){if(_0x2c85e6){return _0x2c85e6[_0x38ce('0x2a')]()['then'](function(){var _0xe0af00=_0x2c85e6[_0x38ce('0x2b')]({'plain':!![]});var _0x43b479='Tags';return db['UserProfileResource'][_0x38ce('0x2a')]({'where':{'type':_0x43b479,'resourceId':_0xe0af00['id']}})[_0x38ce('0x29')](function(){return _0x2c85e6;});})[_0x38ce('0x29')](function(){_0xcf5d9e[_0x38ce('0x1c')](0xcc)[_0x38ce('0x1d')]();});}};}function handleEntityNotFound(_0x2a59fe,_0x13e2fc){return function(_0xce1f64){if(!_0xce1f64){_0x2a59fe[_0x38ce('0x1b')](0x194);}return _0xce1f64;};}function handleError(_0x4649be,_0xfc590a){_0xfc590a=_0xfc590a||0x1f4;return function(_0x381703){logger['error'](_0x381703[_0x38ce('0x2c')]);if(_0x381703[_0x38ce('0x2d')]){delete _0x381703['name'];}_0x4649be[_0x38ce('0x1c')](_0xfc590a)[_0x38ce('0x2e')](_0x381703);};}exports['index']=function(_0xd96d33,_0x282ee4){var _0x568d94={},_0x28d775={},_0x53f2c9={'count':0x0,'rows':[]};var _0x1aa8fb=_[_0x38ce('0x2f')](db[_0x38ce('0x30')][_0x38ce('0x31')],function(_0x444b93){return{'name':_0x444b93[_0x38ce('0x32')],'type':_0x444b93[_0x38ce('0x33')][_0x38ce('0x34')]};});_0x28d775['model']=_['map'](_0x1aa8fb,_0x38ce('0x2d'));_0x28d775[_0x38ce('0x35')]=_[_0x38ce('0x36')](_0xd96d33[_0x38ce('0x35')]);_0x28d775[_0x38ce('0x37')]=_['intersection'](_0x28d775[_0x38ce('0x38')],_0x28d775[_0x38ce('0x35')]);_0x568d94[_0x38ce('0x39')]=_[_0x38ce('0x3a')](_0x28d775[_0x38ce('0x38')],qs[_0x38ce('0x3b')](_0xd96d33[_0x38ce('0x35')]['fields']));_0x568d94[_0x38ce('0x39')]=_0x568d94[_0x38ce('0x39')]['length']?_0x568d94[_0x38ce('0x39')]:_0x28d775[_0x38ce('0x38')];if(!_0xd96d33[_0x38ce('0x35')][_0x38ce('0x3c')](_0x38ce('0x3d'))){_0x568d94[_0x38ce('0x20')]=qs[_0x38ce('0x20')](_0xd96d33[_0x38ce('0x35')]['limit']);_0x568d94[_0x38ce('0x1f')]=qs[_0x38ce('0x1f')](_0xd96d33[_0x38ce('0x35')][_0x38ce('0x1f')]);}_0x568d94['order']=qs[_0x38ce('0x3e')](_0xd96d33['query'][_0x38ce('0x3e')]);_0x568d94[_0x38ce('0x3f')]=qs[_0x38ce('0x37')](_[_0x38ce('0x40')](_0xd96d33[_0x38ce('0x35')],_0x28d775[_0x38ce('0x37')]),_0x1aa8fb);if(_0xd96d33['query'][_0x38ce('0x41')]){_0x568d94['where']=_[_0x38ce('0x42')](_0x568d94[_0x38ce('0x3f')],{'$or':_[_0x38ce('0x2f')](_0x1aa8fb,function(_0x37b738){if(_0x37b738[_0x38ce('0x33')]!==_0x38ce('0x43')){var _0x5209ee={};_0x5209ee[_0x37b738[_0x38ce('0x2d')]]={'$like':'%'+_0xd96d33[_0x38ce('0x35')][_0x38ce('0x41')]+'%'};return _0x5209ee;}})});}_0x568d94=_[_0x38ce('0x42')]({},_0x568d94,_0xd96d33[_0x38ce('0x44')]);var _0x467d3e={'where':_0x568d94['where']};return db['Tag'][_0x38ce('0x22')](_0x467d3e)[_0x38ce('0x29')](function(_0x174c86){_0x53f2c9[_0x38ce('0x22')]=_0x174c86;if(_0xd96d33[_0x38ce('0x35')][_0x38ce('0x45')]){_0x568d94[_0x38ce('0x46')]=[{'all':!![]}];}return db['Tag'][_0x38ce('0x47')](_0x568d94);})[_0x38ce('0x29')](function(_0x5a689b){_0x53f2c9[_0x38ce('0x48')]=_0x5a689b;return _0x53f2c9;})[_0x38ce('0x29')](respondWithFilteredResult(_0x282ee4,_0x568d94))[_0x38ce('0x49')](handleError(_0x282ee4,null));};exports['show']=function(_0xaf99ce,_0xd95bc8){var _0x33f6a6={'raw':!![],'where':{'id':_0xaf99ce[_0x38ce('0x4a')]['id']}},_0x981068={};_0x981068[_0x38ce('0x38')]=_['keys'](db[_0x38ce('0x30')][_0x38ce('0x31')]);_0x981068[_0x38ce('0x35')]=_[_0x38ce('0x36')](_0xaf99ce[_0x38ce('0x35')]);_0x981068[_0x38ce('0x37')]=_['intersection'](_0x981068[_0x38ce('0x38')],_0x981068[_0x38ce('0x35')]);_0x33f6a6['attributes']=_['intersection'](_0x981068['model'],qs[_0x38ce('0x3b')](_0xaf99ce[_0x38ce('0x35')]['fields']));_0x33f6a6['attributes']=_0x33f6a6[_0x38ce('0x39')]['length']?_0x33f6a6[_0x38ce('0x39')]:_0x981068['model'];if(_0xaf99ce[_0x38ce('0x35')][_0x38ce('0x45')]){_0x33f6a6['include']=[{'all':!![]}];}_0x33f6a6=_[_0x38ce('0x42')]({},_0x33f6a6,_0xaf99ce[_0x38ce('0x44')]);return db['Tag'][_0x38ce('0x4b')](_0x33f6a6)[_0x38ce('0x29')](handleEntityNotFound(_0xd95bc8,null))[_0x38ce('0x29')](respondWithResult(_0xd95bc8,null))[_0x38ce('0x49')](handleError(_0xd95bc8,null));};exports[_0x38ce('0x4c')]=function(_0x25a299,_0x58cc6f){return db[_0x38ce('0x30')][_0x38ce('0x4c')](_0x25a299['body'],{})[_0x38ce('0x29')](function(_0x316eec){var _0x429517=_0x25a299[_0x38ce('0x4d')][_0x38ce('0x2b')]({'plain':!![]});if(!_0x429517)throw new Error(_0x38ce('0x4e'));if(_0x429517[_0x38ce('0x4f')]==='user'){var _0x3e1522=_0x316eec[_0x38ce('0x2b')]({'plain':!![]});var _0x3f88df=_0x38ce('0x50');return db[_0x38ce('0x51')][_0x38ce('0x4b')]({'where':{'name':_0x3f88df,'userProfileId':_0x429517['userProfileId']},'raw':!![]})['then'](function(_0xc2c9d3){if(_0xc2c9d3&&_0xc2c9d3[_0x38ce('0x52')]===0x0){return db[_0x38ce('0x53')][_0x38ce('0x4c')]({'name':_0x3e1522[_0x38ce('0x2d')],'resourceId':_0x3e1522['id'],'type':_0xc2c9d3[_0x38ce('0x2d')],'sectionId':_0xc2c9d3['id']},{})['then'](function(){return _0x316eec;});}else{return _0x316eec;}})['catch'](function(_0x199c5b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x199c5b);throw _0x199c5b;});}return _0x316eec;})[_0x38ce('0x29')](respondWithResult(_0x58cc6f,0xc9))[_0x38ce('0x49')](handleError(_0x58cc6f,null));};exports[_0x38ce('0x28')]=function(_0xbe5626,_0xd031c0){if(_0xbe5626['body']['id']){delete _0xbe5626[_0x38ce('0x54')]['id'];}return db[_0x38ce('0x30')][_0x38ce('0x4b')]({'where':{'id':_0xbe5626[_0x38ce('0x4a')]['id']}})[_0x38ce('0x29')](handleEntityNotFound(_0xd031c0,null))[_0x38ce('0x29')](saveUpdates(_0xbe5626[_0x38ce('0x54')],null))[_0x38ce('0x29')](respondWithResult(_0xd031c0,null))[_0x38ce('0x49')](handleError(_0xd031c0,null));};exports[_0x38ce('0x2a')]=function(_0x2db125,_0x56d63e){return db['Tag'][_0x38ce('0x4b')]({'where':{'id':_0x2db125[_0x38ce('0x4a')]['id']}})[_0x38ce('0x29')](handleEntityNotFound(_0x56d63e,null))[_0x38ce('0x29')](removeEntity(_0x56d63e,null))['catch'](handleError(_0x56d63e,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index ae901cd..260634f 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 _0xc943=['bluebird','request-promise','rimraf','exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment'];(function(_0x350744,_0x7d9b13){var _0x14ad39=function(_0x1306dd){while(--_0x1306dd){_0x350744['push'](_0x350744['shift']());}};_0x14ad39(++_0x7d9b13);}(_0xc943,0x157));var _0x3c94=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0xc943[_0x13606d];return _0x1b85b0;};'use strict';var _=require(_0x3c94('0x0'));var util=require(_0x3c94('0x1'));var logger=require(_0x3c94('0x2'))(_0x3c94('0x3'));var moment=require(_0x3c94('0x4'));var BPromise=require(_0x3c94('0x5'));var rp=require(_0x3c94('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c94('0x7'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module[_0x3c94('0x8')]=function(_0x1809c8,_0x283333){return _0x1809c8[_0x3c94('0x9')](_0x3c94('0xa'),attributes,{'tableName':_0x3c94('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ccc=['Tag','util','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define'];(function(_0x5a99bb,_0xbc6bff){var _0x1b9940=function(_0xb4086e){while(--_0xb4086e){_0x5a99bb['push'](_0x5a99bb['shift']());}};_0x1b9940(++_0xbc6bff);}(_0x4ccc,0x145));var _0xc4cc=function(_0x97ebfb,_0x416f0f){_0x97ebfb=_0x97ebfb-0x0;var _0x5d61f6=_0x4ccc[_0x97ebfb];return _0x5d61f6;};'use strict';var _=require('lodash');var util=require(_0xc4cc('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc4cc('0x1'));var fs=require('fs');var path=require(_0xc4cc('0x2'));var rimraf=require(_0xc4cc('0x3'));var config=require(_0xc4cc('0x4'));var attributes=require(_0xc4cc('0x5'));module[_0xc4cc('0x6')]=function(_0x2eb85e,_0x1971b8){return _0x2eb85e[_0xc4cc('0x7')](_0xc4cc('0x8'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 5fe6d27..4b15925 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 _0x303a=['Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x303a,0x1a0));var _0xa303=function(_0x332c1b,_0x28d711){_0x332c1b=_0x332c1b-0x0;var _0x21b49b=_0x303a[_0x332c1b];return _0x21b49b;};'use strict';var _=require(_0xa303('0x0'));var util=require('util');var moment=require(_0xa303('0x1'));var BPromise=require(_0xa303('0x2'));var rs=require(_0xa303('0x3'));var fs=require('fs');var Redis=require(_0xa303('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa303('0x5'));var logger=require(_0xa303('0x6'))(_0xa303('0x7'));var config=require(_0xa303('0x8'));var jayson=require(_0xa303('0x9'));var client=jayson[_0xa303('0xa')][_0xa303('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f61f1,_0x69b173,_0x5d95fd){return new BPromise(function(_0x51e1ee,_0x488c85){return client[_0xa303('0xc')](_0x3f61f1,_0x5d95fd)[_0xa303('0xd')](function(_0x5e2e48){logger[_0xa303('0xe')]('Tag,\x20%s,\x20%s',_0x69b173,_0xa303('0xf'));logger['debug'](_0xa303('0x10'),_0x69b173,_0xa303('0xf'),JSON[_0xa303('0x11')](_0x5e2e48));if(_0x5e2e48[_0xa303('0x12')]){if(_0x5e2e48['error'][_0xa303('0x13')]===0x1f4){logger['error'](_0xa303('0x14'),_0x69b173,_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);return _0x488c85(_0x5e2e48['error'][_0xa303('0x15')]);}logger[_0xa303('0x12')](_0xa303('0x14'),_0x69b173,_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);return _0x51e1ee(_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);}else{logger[_0xa303('0xe')]('Tag,\x20%s,\x20%s',_0x69b173,_0xa303('0xf'));_0x51e1ee(_0x5e2e48[_0xa303('0x16')][_0xa303('0x15')]);}})[_0xa303('0x17')](function(_0x3e2813){logger[_0xa303('0x12')]('Tag,\x20%s,\x20%s',_0x69b173,_0x3e2813);_0x488c85(_0x3e2813);});});} \ No newline at end of file +var _0x99e9=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0x99e9,0xb4));var _0x999e=function(_0x4456a2,_0x376ff2){_0x4456a2=_0x4456a2-0x0;var _0xf36b56=_0x99e9[_0x4456a2];return _0xf36b56;};'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']('Tag,\x20%s,\x20%s',_0x18f337,_0x999e('0xe'));_0x46aeae(_0x2c38cf[_0x999e('0x15')][_0x999e('0x14')]);}})[_0x999e('0x16')](function(_0x1e9bff){logger[_0x999e('0x12')]('Tag,\x20%s,\x20%s',_0x18f337,_0x1e9bff);_0x38a692(_0x1e9bff);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 98f1732..a9f2039 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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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 fa4cb59..1d41694 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 _0x0713=['STRING','name'];(function(_0x3852d4,_0x46b516){var _0x3df901=function(_0x36ddcc){while(--_0x36ddcc){_0x3852d4['push'](_0x3852d4['shift']());}};_0x3df901(++_0x46b516);}(_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 _0xd8b0=['exports','sequelize'];(function(_0x110ed8,_0x4e37e6){var _0x1b4f61=function(_0x7a07f2){while(--_0x7a07f2){_0x110ed8['push'](_0x110ed8['shift']());}};_0x1b4f61(++_0x4e37e6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 3dc0050..c580ce1 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 _0x993a=['../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','localhost','./team.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','index','map','rawAttributes','fieldName','key','name','query','model','attributes','intersection','fields','length','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','Team','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','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','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','send','findOne','channel','ValidationError','Unknown\x20channel','keys','capitalize','toLowerCase','Queue','filters','Queues','addQueues','isValidChannel','add','removeQueues','remove','addAgents','isArray','ids','Voice','Mail','Sms','Fax','Openchannel','Whatsapp','QueueId','penalty','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','TeamVoiceQueue','all','VoicePrefixId','spread','Chat','Queue:remove','removeAgents','hasOwnProperty','nolimit','getAgents','zip-dir','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x258ed7,_0x184498){var _0x20ffde=function(_0x1f3ffb){while(--_0x1f3ffb){_0x258ed7['push'](_0x258ed7['shift']());}};_0x20ffde(++_0x184498);}(_0x993a,0x1ba));var _0xa993=function(_0x28c778,_0x23588d){_0x28c778=_0x28c778-0x0;var _0x3bdbae=_0x993a[_0x28c778];return _0x3bdbae;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa993('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa993('0x1'));var Mustache=require('mustache');var util=require(_0xa993('0x2'));var path=require(_0xa993('0x3'));var sox=require('sox');var csv=require(_0xa993('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa993('0x5'));var _=require(_0xa993('0x6'));var squel=require(_0xa993('0x7'));var crypto=require(_0xa993('0x8'));var jsforce=require(_0xa993('0x9'));var deskjs=require(_0xa993('0xa'));var toCsv=require(_0xa993('0x4'));var querystring=require(_0xa993('0xb'));var Papa=require(_0xa993('0xc'));var Redis=require(_0xa993('0xd'));var authService=require(_0xa993('0xe'));var qs=require(_0xa993('0xf'));var as=require(_0xa993('0x10'));var hardwareService=require(_0xa993('0x11'));var logger=require(_0xa993('0x12'))(_0xa993('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa993('0x14'))['db'];config[_0xa993('0x15')]=_['defaults'](config[_0xa993('0x15')],{'host':_0xa993('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa993('0x15')]));require(_0xa993('0x17'))[_0xa993('0x18')](socket);function respondWithStatusCode(_0x19c753,_0x36db46){_0x36db46=_0x36db46||0xcc;return function(_0x5a5f4b){if(_0x5a5f4b){return _0x19c753['sendStatus'](_0x36db46);}return _0x19c753[_0xa993('0x19')](_0x36db46)[_0xa993('0x1a')]();};}function respondWithResult(_0x594992,_0x3b30d4){_0x3b30d4=_0x3b30d4||0xc8;return function(_0x380993){if(_0x380993){return _0x594992['status'](_0x3b30d4)[_0xa993('0x1b')](_0x380993);}};}function respondWithFilteredResult(_0x1e5c3e,_0x4083fa){return function(_0xeec6c6){if(_0xeec6c6){var _0x428165=typeof _0x4083fa[_0xa993('0x1c')]===_0xa993('0x1d')&&typeof _0x4083fa[_0xa993('0x1e')]===_0xa993('0x1d');var _0x54b094=_0xeec6c6[_0xa993('0x1f')];var _0x143242=_0x428165?0x0:_0x4083fa['offset'];var _0xc146d2=_0x428165?_0xeec6c6[_0xa993('0x1f')]:_0x4083fa[_0xa993('0x1c')]+_0x4083fa[_0xa993('0x1e')];var _0x4566cf;if(_0xc146d2>=_0x54b094){_0xc146d2=_0x54b094;_0x4566cf=0xc8;}else{_0x4566cf=0xce;}_0x1e5c3e[_0xa993('0x19')](_0x4566cf);return _0x1e5c3e[_0xa993('0x20')](_0xa993('0x21'),_0x143242+'-'+_0xc146d2+'/'+_0x54b094)[_0xa993('0x1b')](_0xeec6c6);}return null;};}function patchUpdates(_0x4706aa){return function(_0x27ba44){try{jsonpatch[_0xa993('0x22')](_0x27ba44,_0x4706aa,!![]);}catch(_0x464c58){return BPromise[_0xa993('0x23')](_0x464c58);}return _0x27ba44[_0xa993('0x24')]();};}function saveUpdates(_0x2ac8e2,_0x2a3ed){return function(_0x3adcee){if(_0x3adcee){return _0x3adcee[_0xa993('0x25')](_0x2ac8e2)[_0xa993('0x26')](function(_0x30d83c){return _0x30d83c;});}return null;};}function handleEntityNotFound(_0x35da13,_0xad2c46){return function(_0x6aa5d3){if(!_0x6aa5d3){_0x35da13[_0xa993('0x27')](0x194);}return _0x6aa5d3;};}function handleError(_0x55c348,_0x18f7ba){_0x18f7ba=_0x18f7ba||0x1f4;return function(_0x207b13){logger[_0xa993('0x28')](_0x207b13[_0xa993('0x29')]);if(_0x207b13['name']){delete _0x207b13['name'];}_0x55c348[_0xa993('0x19')](_0x18f7ba)['send'](_0x207b13);};}exports[_0xa993('0x2a')]=function(_0x76de30,_0x40edec){var _0xfd4c47={},_0x55c699={},_0x2f8073={'count':0x0,'rows':[]};var _0x3d856c=_[_0xa993('0x2b')](db['Team'][_0xa993('0x2c')],function(_0x2403c0){return{'name':_0x2403c0[_0xa993('0x2d')],'type':_0x2403c0['type'][_0xa993('0x2e')]};});_0x55c699['model']=_[_0xa993('0x2b')](_0x3d856c,_0xa993('0x2f'));_0x55c699[_0xa993('0x30')]=_['keys'](_0x76de30[_0xa993('0x30')]);_0x55c699['filters']=_['intersection'](_0x55c699[_0xa993('0x31')],_0x55c699[_0xa993('0x30')]);_0xfd4c47[_0xa993('0x32')]=_[_0xa993('0x33')](_0x55c699[_0xa993('0x31')],qs['fields'](_0x76de30['query'][_0xa993('0x34')]));_0xfd4c47[_0xa993('0x32')]=_0xfd4c47[_0xa993('0x32')][_0xa993('0x35')]?_0xfd4c47['attributes']:_0x55c699[_0xa993('0x31')];if(!_0x76de30[_0xa993('0x30')]['hasOwnProperty']('nolimit')){_0xfd4c47['limit']=qs[_0xa993('0x1e')](_0x76de30[_0xa993('0x30')][_0xa993('0x1e')]);_0xfd4c47[_0xa993('0x1c')]=qs[_0xa993('0x1c')](_0x76de30[_0xa993('0x30')]['offset']);}_0xfd4c47[_0xa993('0x36')]=qs[_0xa993('0x37')](_0x76de30['query'][_0xa993('0x37')]);_0xfd4c47[_0xa993('0x38')]=qs['filters'](_[_0xa993('0x39')](_0x76de30[_0xa993('0x30')],_0x55c699['filters']),_0x3d856c);if(_0x76de30[_0xa993('0x30')][_0xa993('0x3a')]){_0xfd4c47['where']=_['merge'](_0xfd4c47[_0xa993('0x38')],{'$or':_['map'](_0x3d856c,function(_0x55abbe){if(_0x55abbe[_0xa993('0x3b')]!==_0xa993('0x3c')){var _0x4ed7c5={};_0x4ed7c5[_0x55abbe[_0xa993('0x2f')]]={'$like':'%'+_0x76de30[_0xa993('0x30')][_0xa993('0x3a')]+'%'};return _0x4ed7c5;}})});}_0xfd4c47=_[_0xa993('0x3d')]({},_0xfd4c47,_0x76de30[_0xa993('0x3e')]);var _0x461b1d={'where':_0xfd4c47[_0xa993('0x38')]};return db['Team'][_0xa993('0x1f')](_0x461b1d)[_0xa993('0x26')](function(_0x46976b){_0x2f8073[_0xa993('0x1f')]=_0x46976b;if(_0x76de30[_0xa993('0x30')][_0xa993('0x3f')]){_0xfd4c47[_0xa993('0x40')]=[{'all':!![]}];}return db['Team'][_0xa993('0x41')](_0xfd4c47);})[_0xa993('0x26')](function(_0x1f4c0c){_0x2f8073[_0xa993('0x42')]=_0x1f4c0c;return _0x2f8073;})[_0xa993('0x26')](respondWithFilteredResult(_0x40edec,_0xfd4c47))[_0xa993('0x43')](handleError(_0x40edec,null));};exports[_0xa993('0x44')]=function(_0x19728c,_0x1c2d6c){var _0x1bcfc6={'raw':![],'where':{'id':_0x19728c[_0xa993('0x45')]['id']}},_0x312856={};_0x312856[_0xa993('0x31')]=_['keys'](db[_0xa993('0x46')][_0xa993('0x2c')]);_0x312856[_0xa993('0x30')]=_['keys'](_0x19728c['query']);_0x312856['filters']=_['intersection'](_0x312856['model'],_0x312856['query']);_0x1bcfc6['attributes']=_[_0xa993('0x33')](_0x312856['model'],qs['fields'](_0x19728c[_0xa993('0x30')]['fields']));_0x1bcfc6[_0xa993('0x32')]=_0x1bcfc6[_0xa993('0x32')][_0xa993('0x35')]?_0x1bcfc6[_0xa993('0x32')]:_0x312856[_0xa993('0x31')];if(_0x19728c['query'][_0xa993('0x3f')]){_0x1bcfc6[_0xa993('0x40')]=[{'all':!![]}];}_0x1bcfc6=_[_0xa993('0x3d')]({},_0x1bcfc6,_0x19728c[_0xa993('0x3e')]);return db[_0xa993('0x46')][_0xa993('0x47')](_0x1bcfc6)[_0xa993('0x26')](handleEntityNotFound(_0x1c2d6c,null))['then'](respondWithResult(_0x1c2d6c,null))[_0xa993('0x43')](handleError(_0x1c2d6c,null));};exports[_0xa993('0x48')]=function(_0x21e3d0,_0x44cb0e){return db[_0xa993('0x46')][_0xa993('0x48')](_0x21e3d0[_0xa993('0x49')],{})['then'](function(_0x287ff2){var _0x20a92=_0x21e3d0[_0xa993('0x4a')][_0xa993('0x4b')]({'plain':!![]});if(!_0x20a92)throw new Error(_0xa993('0x4c'));if(_0x20a92['role']==='user'){var _0x4843bc=_0x287ff2['get']({'plain':!![]});var _0x31cd47=_0xa993('0x4d');return db['UserProfileSection'][_0xa993('0x47')]({'where':{'name':_0x31cd47,'userProfileId':_0x20a92[_0xa993('0x4e')]},'raw':!![]})[_0xa993('0x26')](function(_0x3d9e39){if(_0x3d9e39&&_0x3d9e39['autoAssociation']===0x0){return db[_0xa993('0x4f')][_0xa993('0x48')]({'name':_0x4843bc[_0xa993('0x2f')],'resourceId':_0x4843bc['id'],'type':_0x3d9e39[_0xa993('0x2f')],'sectionId':_0x3d9e39['id']},{})[_0xa993('0x26')](function(){return _0x287ff2;});}else{return _0x287ff2;}})[_0xa993('0x43')](function(_0x1ce741){logger[_0xa993('0x28')](_0xa993('0x50'),_0x1ce741);throw _0x1ce741;});}return _0x287ff2;})['then'](respondWithResult(_0x44cb0e,0xc9))[_0xa993('0x43')](handleError(_0x44cb0e,null));};exports[_0xa993('0x25')]=function(_0x392409,_0x1fe25d){if(_0x392409[_0xa993('0x49')]['id']){delete _0x392409[_0xa993('0x49')]['id'];}return db[_0xa993('0x46')][_0xa993('0x47')]({'where':{'id':_0x392409['params']['id']}})[_0xa993('0x26')](handleEntityNotFound(_0x1fe25d,null))[_0xa993('0x26')](saveUpdates(_0x392409[_0xa993('0x49')],null))['then'](respondWithResult(_0x1fe25d,null))[_0xa993('0x43')](handleError(_0x1fe25d,null));};exports[_0xa993('0x51')]=function(_0x2b5869,_0x2353f7){var _0x4ebb22=_0x2b5869[_0xa993('0x45')]['id'];var _0x340b69=[];return db[_0xa993('0x52')][_0xa993('0x53')](function(_0xef602a){var _0x1c5723=_0xa993('0x54')+_0x4ebb22;return db[_0xa993('0x52')]['query'](_0x1c5723,{'type':db[_0xa993('0x55')][_0xa993('0x56')][_0xa993('0x57')],'raw':!![],'transaction':_0xef602a})[_0xa993('0x26')](function(_0x775137){_0x340b69=_[_0xa993('0x2b')](_0x775137,function(_0x2de7e2){return Number(_0x2de7e2['UserId']);});})[_0xa993('0x26')](function(){var _0x1b3816=_0xa993('0x58')+_0x4ebb22;return db['sequelize']['query'](_0x1b3816,{'type':db[_0xa993('0x55')][_0xa993('0x56')][_0xa993('0x57')],'raw':!![],'transaction':_0xef602a});})[_0xa993('0x26')](function(_0x16a0cd){var _0x166837=_[_0xa993('0x2b')](_0x16a0cd,function(_0x296d4b){return Number(_0x296d4b[_0xa993('0x59')]);});return db[_0xa993('0x5a')][_0xa993('0x51')]({'where':{'UserId':{'$in':_0x340b69},'VoiceQueueId':{'$in':_0x166837}},'transaction':_0xef602a});})['then'](function(){var _0x5ce6a8=_0xa993('0x5b')+_0x4ebb22;return db[_0xa993('0x52')]['query'](_0x5ce6a8,{'type':db['Sequelize'][_0xa993('0x56')][_0xa993('0x57')],'raw':!![],'transaction':_0xef602a});})[_0xa993('0x26')](function(_0x49d3b5){var _0x165da9=_['map'](_0x49d3b5,function(_0x572fb8){return Number(_0x572fb8['MailQueueId']);});return db[_0xa993('0x5c')][_0xa993('0x51')]({'where':{'UserId':{'$in':_0x340b69},'MailQueueId':{'$in':_0x165da9}},'transaction':_0xef602a});})[_0xa993('0x26')](function(){var _0x3abbb5=_0xa993('0x5d')+_0x4ebb22;return db[_0xa993('0x52')]['query'](_0x3abbb5,{'type':db['Sequelize'][_0xa993('0x56')][_0xa993('0x57')],'raw':!![],'transaction':_0xef602a});})[_0xa993('0x26')](function(_0x728ce9){var _0x2b70b1=_['map'](_0x728ce9,function(_0x3a9780){return Number(_0x3a9780[_0xa993('0x5e')]);});return db['UserSmsQueue'][_0xa993('0x51')]({'where':{'UserId':{'$in':_0x340b69},'SmsQueueId':{'$in':_0x2b70b1}},'transaction':_0xef602a});})[_0xa993('0x26')](function(){var _0x32e8bb=_0xa993('0x5f')+_0x4ebb22;return db['sequelize'][_0xa993('0x30')](_0x32e8bb,{'type':db[_0xa993('0x55')][_0xa993('0x56')][_0xa993('0x57')],'raw':!![],'transaction':_0xef602a});})[_0xa993('0x26')](function(_0x57f468){var _0x2c24e2=_[_0xa993('0x2b')](_0x57f468,function(_0x54090e){return Number(_0x54090e[_0xa993('0x60')]);});return db['UserChatQueue'][_0xa993('0x51')]({'where':{'UserId':{'$in':_0x340b69},'ChatQueueId':{'$in':_0x2c24e2}},'transaction':_0xef602a});})[_0xa993('0x26')](function(){var _0xe2462e='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4ebb22;return db['sequelize'][_0xa993('0x30')](_0xe2462e,{'type':db['Sequelize'][_0xa993('0x56')][_0xa993('0x57')],'raw':!![],'transaction':_0xef602a});})[_0xa993('0x26')](function(_0x337fc6){var _0x44e166=_['map'](_0x337fc6,function(_0x20881e){return Number(_0x20881e['FaxQueueId']);});return db[_0xa993('0x61')]['destroy']({'where':{'UserId':{'$in':_0x340b69},'FaxQueueId':{'$in':_0x44e166}},'transaction':_0xef602a});})[_0xa993('0x26')](function(){var _0x4d419b=_0xa993('0x62')+_0x4ebb22;return db[_0xa993('0x52')]['query'](_0x4d419b,{'type':db[_0xa993('0x55')]['QueryTypes'][_0xa993('0x57')],'raw':!![],'transaction':_0xef602a});})[_0xa993('0x26')](function(_0x1f6b63){var _0x580eff=_['map'](_0x1f6b63,function(_0x10e4ed){return Number(_0x10e4ed[_0xa993('0x63')]);});return db['UserOpenchannelQueue'][_0xa993('0x51')]({'where':{'UserId':{'$in':_0x340b69},'OpenchannelQueueId':{'$in':_0x580eff}},'transaction':_0xef602a});})['then'](function(){var _0x257a7b=_0xa993('0x64')+_0x4ebb22;return db[_0xa993('0x52')][_0xa993('0x30')](_0x257a7b,{'type':db['Sequelize'][_0xa993('0x56')][_0xa993('0x57')],'raw':!![],'transaction':_0xef602a});})[_0xa993('0x26')](function(_0x48d682){var _0x5846b1=_['map'](_0x48d682,function(_0x30c39b){return Number(_0x30c39b[_0xa993('0x65')]);});return db[_0xa993('0x66')][_0xa993('0x51')]({'where':{'UserId':{'$in':_0x340b69},'WhatsappQueueId':{'$in':_0x5846b1}},'transaction':_0xef602a});})[_0xa993('0x26')](function(){return db[_0xa993('0x67')][_0xa993('0x47')]({'where':{'TeamId':_0x4ebb22}});})['then'](function(_0x18ea6a){if(_0x18ea6a===null){return;}return db[_0xa993('0x68')][_0xa993('0x51')]({'where':{'UserId':{'$in':_0x340b69},'VoicePrefixId':_0x18ea6a['VoicePrefixId']},'transaction':_0xef602a});})[_0xa993('0x26')](function(){return db[_0xa993('0x46')][_0xa993('0x51')]({'where':{'id':_0x4ebb22},'cascade':!![],'transaction':_0xef602a});})[_0xa993('0x26')](function(_0x4cf3ea){if(_0x4cf3ea===0x0){_0x2353f7[_0xa993('0x27')](0x194);}else{return db[_0xa993('0x4f')][_0xa993('0x51')]({'where':{'type':_0xa993('0x4d'),'resourceId':_0x4ebb22},'cascade':!![],'transaction':_0xef602a})[_0xa993('0x26')](function(){_0x2353f7[_0xa993('0x19')](0xcc)[_0xa993('0x1a')]();});}})[_0xa993('0x43')](function(_0x399a5e){_0x2353f7[_0xa993('0x19')](0x1f4)[_0xa993('0x69')](_0x399a5e);});});};exports['getQueues']=function(_0x425447,_0x5892eb,_0x1dd969){return db[_0xa993('0x46')][_0xa993('0x6a')]({'where':{'id':_0x425447[_0xa993('0x45')]['id']}})[_0xa993('0x26')](handleEntityNotFound(_0x5892eb,null))['then'](function(_0x393caa){if(!_0x425447['query']['channel']||!utils['isValidChannel'](_0x425447[_0xa993('0x30')][_0xa993('0x6b')])){throw new db[(_0xa993('0x55'))][(_0xa993('0x6c'))](_0xa993('0x6d'));}var _0x3af97a={};var _0x46d676={};_0x46d676['model']=_[_0xa993('0x6e')](db[_[_0xa993('0x6f')](_0x425447['query'][_0xa993('0x6b')][_0xa993('0x70')]())+_0xa993('0x71')]['rawAttributes']);_0x46d676[_0xa993('0x30')]=_[_0xa993('0x6e')](_0x425447[_0xa993('0x30')]);_0x46d676[_0xa993('0x72')]=_[_0xa993('0x33')](_0x46d676[_0xa993('0x31')],_0x46d676[_0xa993('0x30')]);_0x3af97a[_0xa993('0x32')]=_[_0xa993('0x33')](_0x46d676['model'],qs['fields'](_0x425447['query'][_0xa993('0x34')]));_0x3af97a[_0xa993('0x32')]=_0x3af97a[_0xa993('0x32')][_0xa993('0x35')]?_0x3af97a['attributes']:_0x46d676[_0xa993('0x31')];_0x3af97a[_0xa993('0x1e')]=qs[_0xa993('0x1e')](_0x425447[_0xa993('0x30')][_0xa993('0x1e')]);_0x3af97a[_0xa993('0x1c')]=qs['offset'](_0x425447[_0xa993('0x30')][_0xa993('0x1c')]);_0x3af97a[_0xa993('0x36')]=qs['sort'](_0x425447[_0xa993('0x30')][_0xa993('0x37')]);_0x3af97a[_0xa993('0x38')]=qs[_0xa993('0x72')](_[_0xa993('0x39')](_0x425447[_0xa993('0x30')],_0x46d676['filters']));_0x3af97a=_[_0xa993('0x3d')]({},_0x3af97a,_0x425447[_0xa993('0x3e')]);return _0x393caa[_0xa993('0x4b')+_[_0xa993('0x6f')](_0x425447[_0xa993('0x30')][_0xa993('0x6b')][_0xa993('0x70')]())+_0xa993('0x73')](_0x3af97a);})[_0xa993('0x26')](respondWithResult(_0x5892eb,null))[_0xa993('0x43')](handleError(_0x5892eb,null));};exports[_0xa993('0x74')]=function(_0x18caac,_0x48da8a,_0x8ba60b){return db[_0xa993('0x46')][_0xa993('0x6a')]({'where':{'id':_0x18caac[_0xa993('0x45')]['id']}})[_0xa993('0x26')](function(_0xef306){if(_0xef306){if(!_0x18caac[_0xa993('0x49')]['channel']||!utils[_0xa993('0x75')](_0x18caac['body'][_0xa993('0x6b')])){throw new db['Sequelize'][(_0xa993('0x6c'))](_0xa993('0x6d'));}return _0xef306[_0xa993('0x76')+_[_0xa993('0x6f')](_0x18caac['body']['channel'][_0xa993('0x70')]())+_0xa993('0x73')](_0x18caac['body']['ids']);}return null;})['then'](handleEntityNotFound(_0x48da8a,null))[_0xa993('0x26')](respondWithStatusCode(_0x48da8a,null))['catch'](handleError(_0x48da8a,null));};exports[_0xa993('0x77')]=function(_0x5433b8,_0x522a97,_0x3a1d0e){return db[_0xa993('0x46')]['findOne']({'where':{'id':_0x5433b8[_0xa993('0x45')]['id']}})['then'](function(_0x1d522f){if(_0x1d522f){if(!_0x5433b8['query']['channel']||!utils[_0xa993('0x75')](_0x5433b8['query']['channel'])){throw new db[(_0xa993('0x55'))][(_0xa993('0x6c'))](_0xa993('0x6d'));}return _0x1d522f[_0xa993('0x78')+_[_0xa993('0x6f')](_0x5433b8['query'][_0xa993('0x6b')][_0xa993('0x70')]())+'Queues'](_0x5433b8[_0xa993('0x30')]['ids']);}return null;})[_0xa993('0x26')](handleEntityNotFound(_0x522a97,null))['then'](respondWithStatusCode(_0x522a97,null))['catch'](handleError(_0x522a97,null));};exports[_0xa993('0x79')]=function(_0x4376e1,_0x180239){var _0xa552ca=_[_0xa993('0x7a')](_0x4376e1['body'][_0xa993('0x7b')])?_0x4376e1[_0xa993('0x49')]['ids']:[_0x4376e1['body'][_0xa993('0x7b')]];var _0x330535=_0x4376e1[_0xa993('0x45')]['id'];return db[_0xa993('0x46')][_0xa993('0x47')]({'where':{'id':_0x330535}})[_0xa993('0x26')](handleEntityNotFound(_0x180239,null))[_0xa993('0x26')](function(_0x343e1e){if(_0x343e1e){var _0x5e18d2=[_0xa993('0x7c'),'Chat',_0xa993('0x7d'),_0xa993('0x7e'),_0xa993('0x7f'),_0xa993('0x80'),_0xa993('0x81')];return db['sequelize'][_0xa993('0x53')](function(_0x3ca865){var _0x24c6db=_['map'](_0x5e18d2,function(_0x485b18){var _0x4aee5b={'attributes':['id','name']};if(_0x485b18===_0xa993('0x7c')){_0x4aee5b['through']={'attributes':['penalty']};}return _0x343e1e[_0xa993('0x4b')+_0x485b18+'Queues'](_0x4aee5b)[_0xa993('0x26')](function(_0x14fbec){var _0x573ac7=_[_0xa993('0x2b')](_0x14fbec,function(_0x5e2452){var _0x11d080=_[_0xa993('0x2b')](_0xa552ca,function(_0x2b4eeb){var _0x16a95e={'where':{'UserId':_0x2b4eeb,[_0x485b18+_0xa993('0x82')]:_0x5e2452['id']},'transaction':_0x3ca865};if(_0x485b18===_0xa993('0x7c')){_0x16a95e['defaults']={'penalty':_0x5e2452['TeamVoiceQueue'][_0xa993('0x83')]};}return db[_0xa993('0x84')+_0x485b18+_0xa993('0x71')][_0xa993('0x85')](_0x16a95e)['then'](function(){socket[_0xa993('0x86')]('user'+_0x485b18+_0xa993('0x87'),{'UserId':_0x2b4eeb,[_0x485b18+_0xa993('0x82')]:_0x5e2452['id']});if(_0x485b18!==_0xa993('0x7c')){return;}return db[_0xa993('0x84')][_0xa993('0x41')]({'where':{'id':_0xa552ca,'online':0x1},'attributes':['id','name',_0xa993('0x88'),_0xa993('0x89'),_0xa993('0x8a')],'raw':!![]})[_0xa993('0x26')](function(_0x202566){var _0x244279=_[_0xa993('0x2b')](_0x202566,function(_0x31c01c){return db[_0xa993('0x8b')][_0xa993('0x8c')]({'membername':_0x31c01c['name'],'UserId':_0x31c01c['id'],'queue_name':_0x5e2452['name'],'VoiceQueueId':_0x5e2452['id'],'interface':_[_0xa993('0x8d')](_0x31c01c['interface'])?util['format'](_0xa993('0x8e'),_0x31c01c[_0xa993('0x2f')]):_0x31c01c[_0xa993('0x8a')],'paused':_0x31c01c[_0xa993('0x89')]||![],'penalty':_0x5e2452[_0xa993('0x8f')]['penalty']},{'transaction':_0x3ca865});});return Promise['all'](_0x244279);});});});return Promise[_0xa993('0x90')](_0x11d080);});return Promise[_0xa993('0x90')](_0x573ac7);})[_0xa993('0x26')](function(){return db['TeamVoicePrefix'][_0xa993('0x6a')]({'where':{'teamId':_0x330535}})[_0xa993('0x26')](function(_0x4e736a){if(_0x4e736a){var _0x496580=_[_0xa993('0x2b')](_0xa552ca,function(_0xc684ee){db[_0xa993('0x68')]['upsert']({'UserId':_0xc684ee,'VoicePrefixId':_0x4e736a[_0xa993('0x91')]});});return Promise['all'](_0x496580);}});});});return Promise['all'](_0x24c6db)[_0xa993('0x26')](function(){return _0x343e1e[_0xa993('0x79')](_0xa552ca,{'transaction':_0x3ca865})[_0xa993('0x92')](function(_0x218477){return _0x218477;});});});}})['then'](respondWithResult(_0x180239,null))['catch'](handleError(_0x180239,null));};exports['removeAgents']=function(_0x3b05d9,_0x1fd079){var _0x499a29=_[_0xa993('0x7a')](_0x3b05d9[_0xa993('0x30')][_0xa993('0x7b')])?_0x3b05d9[_0xa993('0x30')]['ids']:[_0x3b05d9[_0xa993('0x30')]['ids']];var _0x5917fa=_0x3b05d9[_0xa993('0x45')]['id'];return db['Team'][_0xa993('0x47')]({'where':{'id':_0x5917fa}})[_0xa993('0x26')](handleEntityNotFound(_0x1fd079,null))[_0xa993('0x26')](function(_0x472c0f){if(_0x472c0f){var _0x5ffaaf=['Voice',_0xa993('0x93'),_0xa993('0x7d'),_0xa993('0x7e'),_0xa993('0x7f'),'Openchannel',_0xa993('0x81')];return db[_0xa993('0x52')][_0xa993('0x53')](function(_0x5274a6){var _0x39ef30=_[_0xa993('0x2b')](_0x5ffaaf,function(_0x56a3e5){var _0x4a9f0c={'attributes':['id',_0xa993('0x2f')]};return _0x472c0f[_0xa993('0x4b')+_0x56a3e5+_0xa993('0x73')](_0x4a9f0c)['then'](function(_0x24f540){var _0x5b0936=_[_0xa993('0x2b')](_0x24f540,function(_0x1d736b){return _0x1d736b['removeAgents'](_0x499a29,{'transaction':_0x5274a6})[_0xa993('0x26')](function(){var _0x4aa3a5=_[_0xa993('0x2b')](_0x499a29,function(_0x584e9a){socket[_0xa993('0x86')](_0xa993('0x4a')+_0x56a3e5+_0xa993('0x94'),{'UserId':Number(_0x584e9a),[_0x56a3e5+'QueueId']:_0x1d736b['id']});if(_0x56a3e5!==_0xa993('0x7c')){return;}return db[_0xa993('0x8b')][_0xa993('0x51')]({'where':{'VoiceQueueId':_0x1d736b['id'],'UserId':_0x584e9a},'transaction':_0x5274a6});});return Promise[_0xa993('0x90')](_0x4aa3a5);});});return Promise['all'](_0x5b0936);});});return Promise[_0xa993('0x90')](_0x39ef30)[_0xa993('0x26')](function(){return _0x472c0f[_0xa993('0x95')](_0x499a29,{'transaction':_0x5274a6});})[_0xa993('0x26')](function(){return db[_0xa993('0x67')][_0xa993('0x6a')]({'where':{'teamId':_0x5917fa}})['then'](function(_0x8e8975){if(_0x8e8975){var _0x13a8de=_[_0xa993('0x2b')](_0x499a29,function(_0x5761ac){db[_0xa993('0x68')][_0xa993('0x51')]({'where':{'UserId':_0x5761ac,'VoicePrefixId':_0x8e8975['VoicePrefixId']}});});return Promise['all'](_0x13a8de);}});});});}})[_0xa993('0x26')](respondWithStatusCode(_0x1fd079,null))[_0xa993('0x43')](handleError(_0x1fd079,null));};exports['getAgents']=function(_0x28adb9,_0x5dccf9,_0x228340){var _0x3a6d87={};var _0x59ca92={};var _0x3bf658;var _0x4945a8;return db['Team'][_0xa993('0x6a')]({'where':{'id':_0x28adb9[_0xa993('0x45')]['id']}})[_0xa993('0x26')](handleEntityNotFound(_0x5dccf9,null))[_0xa993('0x26')](function(_0x168234){if(_0x168234){_0x3bf658=_0x168234;_0x59ca92[_0xa993('0x31')]=_[_0xa993('0x6e')](db['User'][_0xa993('0x2c')]);_0x59ca92[_0xa993('0x30')]=_[_0xa993('0x6e')](_0x28adb9['query']);_0x59ca92[_0xa993('0x72')]=_[_0xa993('0x33')](_0x59ca92['model'],_0x59ca92['query']);_0x3a6d87[_0xa993('0x32')]=_[_0xa993('0x33')](_0x59ca92[_0xa993('0x31')],qs[_0xa993('0x34')](_0x28adb9['query'][_0xa993('0x34')]));_0x3a6d87[_0xa993('0x32')]=_0x3a6d87['attributes'][_0xa993('0x35')]?_0x3a6d87[_0xa993('0x32')]:_0x59ca92['model'];_0x3a6d87[_0xa993('0x36')]=qs[_0xa993('0x37')](_0x28adb9[_0xa993('0x30')]['sort']);_0x3a6d87['where']=qs[_0xa993('0x72')](_[_0xa993('0x39')](_0x28adb9[_0xa993('0x30')],_0x59ca92[_0xa993('0x72')]));if(_0x28adb9[_0xa993('0x30')][_0xa993('0x3a')]){_0x3a6d87[_0xa993('0x38')]=_[_0xa993('0x3d')](_0x3a6d87[_0xa993('0x38')],{'$or':_[_0xa993('0x2b')](_0x3a6d87[_0xa993('0x32')],function(_0x2985f2){var _0x2a575f={};_0x2a575f[_0x2985f2]={'$like':'%'+_0x28adb9[_0xa993('0x30')][_0xa993('0x3a')]+'%'};return _0x2a575f;})});}_0x3a6d87=_[_0xa993('0x3d')]({},_0x3a6d87,_0x28adb9['options']);return _0x3bf658['getAgents'](_0x3a6d87);}})[_0xa993('0x26')](function(_0x2b8a01){if(_0x2b8a01){_0x4945a8=_0x2b8a01[_0xa993('0x35')];if(!_0x28adb9['query'][_0xa993('0x96')](_0xa993('0x97'))){_0x3a6d87[_0xa993('0x1e')]=qs[_0xa993('0x1e')](_0x28adb9[_0xa993('0x30')][_0xa993('0x1e')]);_0x3a6d87[_0xa993('0x1c')]=qs['offset'](_0x28adb9[_0xa993('0x30')][_0xa993('0x1c')]);}return _0x3bf658[_0xa993('0x98')](_0x3a6d87);}})['then'](function(_0x4859f1){if(_0x4859f1){return _0x4859f1?{'count':_0x4945a8,'rows':_0x4859f1}:null;}})[_0xa993('0x26')](respondWithResult(_0x5dccf9,null))[_0xa993('0x43')](handleError(_0x5dccf9,null));}; \ No newline at end of file +var _0x7703=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','stack','send','index','map','Team','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','catch','create','body','user','get','Teams','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','update','params','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','UserMailQueue','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize','toLowerCase','order','Queues','addQueues','Unknown\x20channel','add','ids','removeQueues','remove','addAgents','isArray','Mail','Sms','Fax','Openchannel','Whatsapp','transaction','Voice','penalty','TeamVoiceQueue','findOrCreate','Queue:save','User','online','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','all','spread','removeAgents','Chat','emit','Queue:remove','QueueId','getAgents','hasOwnProperty','rimraf','moment','bluebird','mustache','util','sox','jsforce','desk.js','to-csv','papaparse','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end'];(function(_0x2cb3eb,_0x4d83aa){var _0x2759ee=function(_0x4108a0){while(--_0x4108a0){_0x2cb3eb['push'](_0x2cb3eb['shift']());}};_0x2759ee(++_0x4d83aa);}(_0x7703,0x1a2));var _0x3770=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x7703[_0x5416db];return _0x243e35;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3770('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3770('0x1'));var BPromise=require(_0x3770('0x2'));var Mustache=require(_0x3770('0x3'));var util=require(_0x3770('0x4'));var path=require('path');var sox=require(_0x3770('0x5'));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('crypto');var jsforce=require(_0x3770('0x6'));var deskjs=require(_0x3770('0x7'));var toCsv=require(_0x3770('0x8'));var querystring=require('querystring');var Papa=require(_0x3770('0x9'));var Redis=require(_0x3770('0xa'));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(_0x3770('0xb'))(_0x3770('0xc'));var utils=require('../../config/utils');var config=require(_0x3770('0xd'));var licenseUtil=require('../../config/license/util');var db=require(_0x3770('0xe'))['db'];config[_0x3770('0xf')]=_[_0x3770('0x10')](config[_0x3770('0xf')],{'host':_0x3770('0x11'),'port':0x18eb});var socket=require(_0x3770('0x12'))(new Redis(config[_0x3770('0xf')]));require('./team.socket')[_0x3770('0x13')](socket);function respondWithStatusCode(_0x4be6e5,_0x184e2d){_0x184e2d=_0x184e2d||0xcc;return function(_0x537a50){if(_0x537a50){return _0x4be6e5[_0x3770('0x14')](_0x184e2d);}return _0x4be6e5[_0x3770('0x15')](_0x184e2d)[_0x3770('0x16')]();};}function respondWithResult(_0x22cf27,_0x55a4dc){_0x55a4dc=_0x55a4dc||0xc8;return function(_0x2381bb){if(_0x2381bb){return _0x22cf27[_0x3770('0x15')](_0x55a4dc)[_0x3770('0x17')](_0x2381bb);}};}function respondWithFilteredResult(_0x3880e7,_0x718212){return function(_0xe95d8d){if(_0xe95d8d){var _0x9e4864=typeof _0x718212[_0x3770('0x18')]===_0x3770('0x19')&&typeof _0x718212[_0x3770('0x1a')]==='undefined';var _0x4a6593=_0xe95d8d[_0x3770('0x1b')];var _0x2ae6c7=_0x9e4864?0x0:_0x718212[_0x3770('0x18')];var _0x5ce7c2=_0x9e4864?_0xe95d8d['count']:_0x718212[_0x3770('0x18')]+_0x718212[_0x3770('0x1a')];var _0x3b1f03;if(_0x5ce7c2>=_0x4a6593){_0x5ce7c2=_0x4a6593;_0x3b1f03=0xc8;}else{_0x3b1f03=0xce;}_0x3880e7[_0x3770('0x15')](_0x3b1f03);return _0x3880e7[_0x3770('0x1c')](_0x3770('0x1d'),_0x2ae6c7+'-'+_0x5ce7c2+'/'+_0x4a6593)['json'](_0xe95d8d);}return null;};}function patchUpdates(_0x3140dd){return function(_0x29761d){try{jsonpatch[_0x3770('0x1e')](_0x29761d,_0x3140dd,!![]);}catch(_0x217dc5){return BPromise[_0x3770('0x1f')](_0x217dc5);}return _0x29761d[_0x3770('0x20')]();};}function saveUpdates(_0x5cba07,_0x128ab4){return function(_0x3ae840){if(_0x3ae840){return _0x3ae840['update'](_0x5cba07)['then'](function(_0x101327){return _0x101327;});}return null;};}function handleEntityNotFound(_0x399e57,_0x31fa8e){return function(_0x1a0b5a){if(!_0x1a0b5a){_0x399e57['sendStatus'](0x194);}return _0x1a0b5a;};}function handleError(_0xfeb369,_0x547837){_0x547837=_0x547837||0x1f4;return function(_0x4ab1bc){logger['error'](_0x4ab1bc[_0x3770('0x21')]);if(_0x4ab1bc['name']){delete _0x4ab1bc['name'];}_0xfeb369[_0x3770('0x15')](_0x547837)[_0x3770('0x22')](_0x4ab1bc);};}exports[_0x3770('0x23')]=function(_0x508352,_0xb4a993){var _0x15977d={},_0x2734e3={},_0x83ae4c={'count':0x0,'rows':[]};var _0x5c174e=_[_0x3770('0x24')](db[_0x3770('0x25')][_0x3770('0x26')],function(_0xb35f88){return{'name':_0xb35f88[_0x3770('0x27')],'type':_0xb35f88[_0x3770('0x28')][_0x3770('0x29')]};});_0x2734e3['model']=_[_0x3770('0x24')](_0x5c174e,_0x3770('0x2a'));_0x2734e3[_0x3770('0x2b')]=_[_0x3770('0x2c')](_0x508352['query']);_0x2734e3[_0x3770('0x2d')]=_[_0x3770('0x2e')](_0x2734e3[_0x3770('0x2f')],_0x2734e3['query']);_0x15977d[_0x3770('0x30')]=_['intersection'](_0x2734e3[_0x3770('0x2f')],qs[_0x3770('0x31')](_0x508352[_0x3770('0x2b')][_0x3770('0x31')]));_0x15977d['attributes']=_0x15977d[_0x3770('0x30')][_0x3770('0x32')]?_0x15977d['attributes']:_0x2734e3[_0x3770('0x2f')];if(!_0x508352[_0x3770('0x2b')]['hasOwnProperty'](_0x3770('0x33'))){_0x15977d['limit']=qs[_0x3770('0x1a')](_0x508352[_0x3770('0x2b')]['limit']);_0x15977d['offset']=qs[_0x3770('0x18')](_0x508352[_0x3770('0x2b')]['offset']);}_0x15977d['order']=qs['sort'](_0x508352[_0x3770('0x2b')][_0x3770('0x34')]);_0x15977d[_0x3770('0x35')]=qs['filters'](_[_0x3770('0x36')](_0x508352[_0x3770('0x2b')],_0x2734e3['filters']),_0x5c174e);if(_0x508352[_0x3770('0x2b')][_0x3770('0x37')]){_0x15977d['where']=_['merge'](_0x15977d[_0x3770('0x35')],{'$or':_[_0x3770('0x24')](_0x5c174e,function(_0x5e148b){if(_0x5e148b[_0x3770('0x28')]!==_0x3770('0x38')){var _0x27b4c3={};_0x27b4c3[_0x5e148b[_0x3770('0x2a')]]={'$like':'%'+_0x508352[_0x3770('0x2b')][_0x3770('0x37')]+'%'};return _0x27b4c3;}})});}_0x15977d=_[_0x3770('0x39')]({},_0x15977d,_0x508352[_0x3770('0x3a')]);var _0x2f373b={'where':_0x15977d['where']};return db[_0x3770('0x25')][_0x3770('0x1b')](_0x2f373b)[_0x3770('0x3b')](function(_0x55ae84){_0x83ae4c[_0x3770('0x1b')]=_0x55ae84;if(_0x508352['query'][_0x3770('0x3c')]){_0x15977d[_0x3770('0x3d')]=[{'all':!![]}];}return db[_0x3770('0x25')][_0x3770('0x3e')](_0x15977d);})[_0x3770('0x3b')](function(_0x371db2){_0x83ae4c['rows']=_0x371db2;return _0x83ae4c;})[_0x3770('0x3b')](respondWithFilteredResult(_0xb4a993,_0x15977d))['catch'](handleError(_0xb4a993,null));};exports['show']=function(_0x17f720,_0x3d5a57){var _0xecd773={'raw':![],'where':{'id':_0x17f720['params']['id']}},_0x2e5cff={};_0x2e5cff[_0x3770('0x2f')]=_[_0x3770('0x2c')](db[_0x3770('0x25')][_0x3770('0x26')]);_0x2e5cff['query']=_[_0x3770('0x2c')](_0x17f720['query']);_0x2e5cff[_0x3770('0x2d')]=_[_0x3770('0x2e')](_0x2e5cff['model'],_0x2e5cff[_0x3770('0x2b')]);_0xecd773[_0x3770('0x30')]=_[_0x3770('0x2e')](_0x2e5cff[_0x3770('0x2f')],qs['fields'](_0x17f720[_0x3770('0x2b')][_0x3770('0x31')]));_0xecd773[_0x3770('0x30')]=_0xecd773[_0x3770('0x30')][_0x3770('0x32')]?_0xecd773[_0x3770('0x30')]:_0x2e5cff['model'];if(_0x17f720[_0x3770('0x2b')][_0x3770('0x3c')]){_0xecd773['include']=[{'all':!![]}];}_0xecd773=_[_0x3770('0x39')]({},_0xecd773,_0x17f720[_0x3770('0x3a')]);return db[_0x3770('0x25')]['find'](_0xecd773)[_0x3770('0x3b')](handleEntityNotFound(_0x3d5a57,null))[_0x3770('0x3b')](respondWithResult(_0x3d5a57,null))[_0x3770('0x3f')](handleError(_0x3d5a57,null));};exports[_0x3770('0x40')]=function(_0x489681,_0x3669ef){return db[_0x3770('0x25')][_0x3770('0x40')](_0x489681[_0x3770('0x41')],{})[_0x3770('0x3b')](function(_0x3d5985){var _0x478d45=_0x489681[_0x3770('0x42')][_0x3770('0x43')]({'plain':!![]});if(!_0x478d45)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x478d45['role']===_0x3770('0x42')){var _0x1cd00f=_0x3d5985[_0x3770('0x43')]({'plain':!![]});var _0x4cc861=_0x3770('0x44');return db[_0x3770('0x45')][_0x3770('0x46')]({'where':{'name':_0x4cc861,'userProfileId':_0x478d45[_0x3770('0x47')]},'raw':!![]})[_0x3770('0x3b')](function(_0x162c29){if(_0x162c29&&_0x162c29[_0x3770('0x48')]===0x0){return db[_0x3770('0x49')][_0x3770('0x40')]({'name':_0x1cd00f[_0x3770('0x2a')],'resourceId':_0x1cd00f['id'],'type':_0x162c29['name'],'sectionId':_0x162c29['id']},{})[_0x3770('0x3b')](function(){return _0x3d5985;});}else{return _0x3d5985;}})['catch'](function(_0x459774){logger[_0x3770('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x459774);throw _0x459774;});}return _0x3d5985;})[_0x3770('0x3b')](respondWithResult(_0x3669ef,0xc9))['catch'](handleError(_0x3669ef,null));};exports[_0x3770('0x4b')]=function(_0x4ebb1d,_0x497043){if(_0x4ebb1d[_0x3770('0x41')]['id']){delete _0x4ebb1d['body']['id'];}return db[_0x3770('0x25')][_0x3770('0x46')]({'where':{'id':_0x4ebb1d[_0x3770('0x4c')]['id']}})[_0x3770('0x3b')](handleEntityNotFound(_0x497043,null))[_0x3770('0x3b')](saveUpdates(_0x4ebb1d['body'],null))['then'](respondWithResult(_0x497043,null))['catch'](handleError(_0x497043,null));};exports[_0x3770('0x4d')]=function(_0x33b1ef,_0x2e1351){var _0x47fd19=_0x33b1ef[_0x3770('0x4c')]['id'];var _0x5a5128=[];return db[_0x3770('0x4e')]['transaction'](function(_0x46a45d){var _0x1785dd=_0x3770('0x4f')+_0x47fd19;return db[_0x3770('0x4e')][_0x3770('0x2b')](_0x1785dd,{'type':db[_0x3770('0x50')]['QueryTypes'][_0x3770('0x51')],'raw':!![],'transaction':_0x46a45d})['then'](function(_0x5c71f1){_0x5a5128=_['map'](_0x5c71f1,function(_0x53c345){return Number(_0x53c345[_0x3770('0x52')]);});})[_0x3770('0x3b')](function(){var _0x214882=_0x3770('0x53')+_0x47fd19;return db[_0x3770('0x4e')][_0x3770('0x2b')](_0x214882,{'type':db['Sequelize'][_0x3770('0x54')][_0x3770('0x51')],'raw':!![],'transaction':_0x46a45d});})[_0x3770('0x3b')](function(_0x587153){var _0x44fc66=_[_0x3770('0x24')](_0x587153,function(_0x21fde6){return Number(_0x21fde6[_0x3770('0x55')]);});return db['UserVoiceQueue'][_0x3770('0x4d')]({'where':{'UserId':{'$in':_0x5a5128},'VoiceQueueId':{'$in':_0x44fc66}},'transaction':_0x46a45d});})[_0x3770('0x3b')](function(){var _0x20654c='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x47fd19;return db['sequelize']['query'](_0x20654c,{'type':db[_0x3770('0x50')][_0x3770('0x54')][_0x3770('0x51')],'raw':!![],'transaction':_0x46a45d});})[_0x3770('0x3b')](function(_0x4d185d){var _0x2b4452=_[_0x3770('0x24')](_0x4d185d,function(_0x2d7ef5){return Number(_0x2d7ef5['MailQueueId']);});return db[_0x3770('0x56')][_0x3770('0x4d')]({'where':{'UserId':{'$in':_0x5a5128},'MailQueueId':{'$in':_0x2b4452}},'transaction':_0x46a45d});})[_0x3770('0x3b')](function(){var _0x58e166='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x47fd19;return db['sequelize'][_0x3770('0x2b')](_0x58e166,{'type':db['Sequelize'][_0x3770('0x54')][_0x3770('0x51')],'raw':!![],'transaction':_0x46a45d});})['then'](function(_0x1edf3a){var _0x19aa21=_[_0x3770('0x24')](_0x1edf3a,function(_0x1243f8){return Number(_0x1243f8[_0x3770('0x57')]);});return db[_0x3770('0x58')][_0x3770('0x4d')]({'where':{'UserId':{'$in':_0x5a5128},'SmsQueueId':{'$in':_0x19aa21}},'transaction':_0x46a45d});})[_0x3770('0x3b')](function(){var _0x312f75='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x47fd19;return db[_0x3770('0x4e')]['query'](_0x312f75,{'type':db[_0x3770('0x50')][_0x3770('0x54')]['SELECT'],'raw':!![],'transaction':_0x46a45d});})[_0x3770('0x3b')](function(_0x1c2aaa){var _0x5bc271=_[_0x3770('0x24')](_0x1c2aaa,function(_0x49b541){return Number(_0x49b541[_0x3770('0x59')]);});return db[_0x3770('0x5a')][_0x3770('0x4d')]({'where':{'UserId':{'$in':_0x5a5128},'ChatQueueId':{'$in':_0x5bc271}},'transaction':_0x46a45d});})['then'](function(){var _0x10d02b=_0x3770('0x5b')+_0x47fd19;return db[_0x3770('0x4e')]['query'](_0x10d02b,{'type':db[_0x3770('0x50')][_0x3770('0x54')][_0x3770('0x51')],'raw':!![],'transaction':_0x46a45d});})['then'](function(_0x21bbba){var _0x33a202=_[_0x3770('0x24')](_0x21bbba,function(_0x53c2d0){return Number(_0x53c2d0[_0x3770('0x5c')]);});return db[_0x3770('0x5d')]['destroy']({'where':{'UserId':{'$in':_0x5a5128},'FaxQueueId':{'$in':_0x33a202}},'transaction':_0x46a45d});})[_0x3770('0x3b')](function(){var _0x4bdd8f=_0x3770('0x5e')+_0x47fd19;return db[_0x3770('0x4e')][_0x3770('0x2b')](_0x4bdd8f,{'type':db['Sequelize'][_0x3770('0x54')][_0x3770('0x51')],'raw':!![],'transaction':_0x46a45d});})[_0x3770('0x3b')](function(_0xc6e750){var _0x2a817a=_[_0x3770('0x24')](_0xc6e750,function(_0x7e5b26){return Number(_0x7e5b26['OpenchannelQueueId']);});return db[_0x3770('0x5f')][_0x3770('0x4d')]({'where':{'UserId':{'$in':_0x5a5128},'OpenchannelQueueId':{'$in':_0x2a817a}},'transaction':_0x46a45d});})[_0x3770('0x3b')](function(){var _0x439a16=_0x3770('0x60')+_0x47fd19;return db['sequelize'][_0x3770('0x2b')](_0x439a16,{'type':db[_0x3770('0x50')][_0x3770('0x54')][_0x3770('0x51')],'raw':!![],'transaction':_0x46a45d});})[_0x3770('0x3b')](function(_0x11d8cc){var _0x3e5e42=_[_0x3770('0x24')](_0x11d8cc,function(_0x5bcbd9){return Number(_0x5bcbd9['WhatsappQueueId']);});return db[_0x3770('0x61')][_0x3770('0x4d')]({'where':{'UserId':{'$in':_0x5a5128},'WhatsappQueueId':{'$in':_0x3e5e42}},'transaction':_0x46a45d});})['then'](function(){return db[_0x3770('0x62')][_0x3770('0x46')]({'where':{'TeamId':_0x47fd19}});})[_0x3770('0x3b')](function(_0x3b007a){if(_0x3b007a===null){return;}return db[_0x3770('0x63')][_0x3770('0x4d')]({'where':{'UserId':{'$in':_0x5a5128},'VoicePrefixId':_0x3b007a[_0x3770('0x64')]},'transaction':_0x46a45d});})[_0x3770('0x3b')](function(){return db['Team'][_0x3770('0x4d')]({'where':{'id':_0x47fd19},'cascade':!![],'transaction':_0x46a45d});})['then'](function(_0x507718){if(_0x507718===0x0){_0x2e1351[_0x3770('0x14')](0x194);}else{return db[_0x3770('0x49')][_0x3770('0x4d')]({'where':{'type':'Teams','resourceId':_0x47fd19},'cascade':!![],'transaction':_0x46a45d})[_0x3770('0x3b')](function(){_0x2e1351[_0x3770('0x15')](0xcc)[_0x3770('0x16')]();});}})[_0x3770('0x3f')](function(_0x5a3b22){_0x2e1351[_0x3770('0x15')](0x1f4)[_0x3770('0x22')](_0x5a3b22);});});};exports[_0x3770('0x65')]=function(_0x375259,_0x566233,_0x28f474){return db[_0x3770('0x25')][_0x3770('0x66')]({'where':{'id':_0x375259['params']['id']}})[_0x3770('0x3b')](handleEntityNotFound(_0x566233,null))[_0x3770('0x3b')](function(_0x2615ac){if(!_0x375259['query'][_0x3770('0x67')]||!utils[_0x3770('0x68')](_0x375259[_0x3770('0x2b')][_0x3770('0x67')])){throw new db['Sequelize'][(_0x3770('0x69'))]('Unknown\x20channel');}var _0x3761d1={};var _0x1f8627={};_0x1f8627[_0x3770('0x2f')]=_[_0x3770('0x2c')](db[_[_0x3770('0x6a')](_0x375259[_0x3770('0x2b')]['channel'][_0x3770('0x6b')]())+'Queue'][_0x3770('0x26')]);_0x1f8627[_0x3770('0x2b')]=_[_0x3770('0x2c')](_0x375259['query']);_0x1f8627['filters']=_[_0x3770('0x2e')](_0x1f8627['model'],_0x1f8627[_0x3770('0x2b')]);_0x3761d1['attributes']=_[_0x3770('0x2e')](_0x1f8627['model'],qs[_0x3770('0x31')](_0x375259['query'][_0x3770('0x31')]));_0x3761d1['attributes']=_0x3761d1[_0x3770('0x30')][_0x3770('0x32')]?_0x3761d1[_0x3770('0x30')]:_0x1f8627[_0x3770('0x2f')];_0x3761d1[_0x3770('0x1a')]=qs[_0x3770('0x1a')](_0x375259[_0x3770('0x2b')][_0x3770('0x1a')]);_0x3761d1[_0x3770('0x18')]=qs['offset'](_0x375259[_0x3770('0x2b')][_0x3770('0x18')]);_0x3761d1[_0x3770('0x6c')]=qs[_0x3770('0x34')](_0x375259['query']['sort']);_0x3761d1['where']=qs[_0x3770('0x2d')](_['pick'](_0x375259[_0x3770('0x2b')],_0x1f8627[_0x3770('0x2d')]));_0x3761d1=_[_0x3770('0x39')]({},_0x3761d1,_0x375259[_0x3770('0x3a')]);return _0x2615ac['get'+_[_0x3770('0x6a')](_0x375259[_0x3770('0x2b')][_0x3770('0x67')]['toLowerCase']())+_0x3770('0x6d')](_0x3761d1);})[_0x3770('0x3b')](respondWithResult(_0x566233,null))[_0x3770('0x3f')](handleError(_0x566233,null));};exports[_0x3770('0x6e')]=function(_0x2f1e1d,_0x173885,_0x50e45d){return db[_0x3770('0x25')]['findOne']({'where':{'id':_0x2f1e1d[_0x3770('0x4c')]['id']}})['then'](function(_0x58a391){if(_0x58a391){if(!_0x2f1e1d[_0x3770('0x41')][_0x3770('0x67')]||!utils['isValidChannel'](_0x2f1e1d[_0x3770('0x41')][_0x3770('0x67')])){throw new db[(_0x3770('0x50'))][(_0x3770('0x69'))](_0x3770('0x6f'));}return _0x58a391[_0x3770('0x70')+_[_0x3770('0x6a')](_0x2f1e1d['body'][_0x3770('0x67')][_0x3770('0x6b')]())+'Queues'](_0x2f1e1d[_0x3770('0x41')][_0x3770('0x71')]);}return null;})[_0x3770('0x3b')](handleEntityNotFound(_0x173885,null))[_0x3770('0x3b')](respondWithStatusCode(_0x173885,null))[_0x3770('0x3f')](handleError(_0x173885,null));};exports[_0x3770('0x72')]=function(_0x431a71,_0x2fbf30,_0x25f3b9){return db['Team'][_0x3770('0x66')]({'where':{'id':_0x431a71[_0x3770('0x4c')]['id']}})['then'](function(_0x3c1ba0){if(_0x3c1ba0){if(!_0x431a71[_0x3770('0x2b')][_0x3770('0x67')]||!utils['isValidChannel'](_0x431a71[_0x3770('0x2b')][_0x3770('0x67')])){throw new db['Sequelize'][(_0x3770('0x69'))](_0x3770('0x6f'));}return _0x3c1ba0[_0x3770('0x73')+_[_0x3770('0x6a')](_0x431a71[_0x3770('0x2b')][_0x3770('0x67')][_0x3770('0x6b')]())+_0x3770('0x6d')](_0x431a71['query']['ids']);}return null;})[_0x3770('0x3b')](handleEntityNotFound(_0x2fbf30,null))['then'](respondWithStatusCode(_0x2fbf30,null))[_0x3770('0x3f')](handleError(_0x2fbf30,null));};exports[_0x3770('0x74')]=function(_0x46bb77,_0x26d00a){var _0xfcb596=_[_0x3770('0x75')](_0x46bb77[_0x3770('0x41')]['ids'])?_0x46bb77[_0x3770('0x41')][_0x3770('0x71')]:[_0x46bb77[_0x3770('0x41')][_0x3770('0x71')]];var _0x3e8ffe=_0x46bb77[_0x3770('0x4c')]['id'];return db[_0x3770('0x25')][_0x3770('0x46')]({'where':{'id':_0x3e8ffe}})[_0x3770('0x3b')](handleEntityNotFound(_0x26d00a,null))[_0x3770('0x3b')](function(_0x49fca6){if(_0x49fca6){var _0x4f88db=['Voice','Chat',_0x3770('0x76'),_0x3770('0x77'),_0x3770('0x78'),_0x3770('0x79'),_0x3770('0x7a')];return db[_0x3770('0x4e')][_0x3770('0x7b')](function(_0x5e92c7){var _0x2cc940=_[_0x3770('0x24')](_0x4f88db,function(_0x12d81f){var _0x3ccb5d={'attributes':['id',_0x3770('0x2a')]};if(_0x12d81f===_0x3770('0x7c')){_0x3ccb5d['through']={'attributes':[_0x3770('0x7d')]};}return _0x49fca6[_0x3770('0x43')+_0x12d81f+_0x3770('0x6d')](_0x3ccb5d)['then'](function(_0x4f91c2){var _0x4de965=_[_0x3770('0x24')](_0x4f91c2,function(_0x49e7ba){var _0x585b27=_[_0x3770('0x24')](_0xfcb596,function(_0x847711){var _0x22ae3e={'where':{'UserId':_0x847711,[_0x12d81f+'QueueId']:_0x49e7ba['id']},'transaction':_0x5e92c7};if(_0x12d81f===_0x3770('0x7c')){_0x22ae3e['defaults']={'penalty':_0x49e7ba[_0x3770('0x7e')]['penalty']};}return db['User'+_0x12d81f+'Queue'][_0x3770('0x7f')](_0x22ae3e)[_0x3770('0x3b')](function(){socket['emit'](_0x3770('0x42')+_0x12d81f+_0x3770('0x80'),{'UserId':_0x847711,[_0x12d81f+'QueueId']:_0x49e7ba['id']});if(_0x12d81f!==_0x3770('0x7c')){return;}return db[_0x3770('0x81')]['findAll']({'where':{'id':_0xfcb596,'online':0x1},'attributes':['id',_0x3770('0x2a'),_0x3770('0x82'),'voicePause',_0x3770('0x83')],'raw':!![]})[_0x3770('0x3b')](function(_0xc5aaf0){var _0x5e7ea9=_[_0x3770('0x24')](_0xc5aaf0,function(_0x25b76e){return db[_0x3770('0x84')][_0x3770('0x85')]({'membername':_0x25b76e[_0x3770('0x2a')],'UserId':_0x25b76e['id'],'queue_name':_0x49e7ba[_0x3770('0x2a')],'VoiceQueueId':_0x49e7ba['id'],'interface':_[_0x3770('0x86')](_0x25b76e[_0x3770('0x83')])?util[_0x3770('0x87')](_0x3770('0x88'),_0x25b76e[_0x3770('0x2a')]):_0x25b76e[_0x3770('0x83')],'paused':_0x25b76e[_0x3770('0x89')]||![],'penalty':_0x49e7ba[_0x3770('0x7e')][_0x3770('0x7d')]},{'transaction':_0x5e92c7});});return Promise[_0x3770('0x8a')](_0x5e7ea9);});});});return Promise['all'](_0x585b27);});return Promise['all'](_0x4de965);})['then'](function(){return db[_0x3770('0x62')][_0x3770('0x66')]({'where':{'teamId':_0x3e8ffe}})[_0x3770('0x3b')](function(_0x406fe3){if(_0x406fe3){var _0x1da381=_[_0x3770('0x24')](_0xfcb596,function(_0x39bbe4){db[_0x3770('0x63')][_0x3770('0x85')]({'UserId':_0x39bbe4,'VoicePrefixId':_0x406fe3[_0x3770('0x64')]});});return Promise[_0x3770('0x8a')](_0x1da381);}});});});return Promise[_0x3770('0x8a')](_0x2cc940)[_0x3770('0x3b')](function(){return _0x49fca6[_0x3770('0x74')](_0xfcb596,{'transaction':_0x5e92c7})[_0x3770('0x8b')](function(_0x36fd76){return _0x36fd76;});});});}})[_0x3770('0x3b')](respondWithResult(_0x26d00a,null))[_0x3770('0x3f')](handleError(_0x26d00a,null));};exports[_0x3770('0x8c')]=function(_0xbdb20a,_0x511dd4){var _0x2b16ed=_['isArray'](_0xbdb20a[_0x3770('0x2b')]['ids'])?_0xbdb20a[_0x3770('0x2b')]['ids']:[_0xbdb20a['query'][_0x3770('0x71')]];var _0x331058=_0xbdb20a[_0x3770('0x4c')]['id'];return db['Team'][_0x3770('0x46')]({'where':{'id':_0x331058}})['then'](handleEntityNotFound(_0x511dd4,null))[_0x3770('0x3b')](function(_0x11cb69){if(_0x11cb69){var _0xb7eec7=[_0x3770('0x7c'),_0x3770('0x8d'),'Mail',_0x3770('0x77'),_0x3770('0x78'),'Openchannel','Whatsapp'];return db[_0x3770('0x4e')][_0x3770('0x7b')](function(_0x13587d){var _0x455d98=_[_0x3770('0x24')](_0xb7eec7,function(_0x300945){var _0x3b39e8={'attributes':['id','name']};return _0x11cb69[_0x3770('0x43')+_0x300945+'Queues'](_0x3b39e8)[_0x3770('0x3b')](function(_0x1d8834){var _0x549110=_[_0x3770('0x24')](_0x1d8834,function(_0x44256d){return _0x44256d[_0x3770('0x8c')](_0x2b16ed,{'transaction':_0x13587d})[_0x3770('0x3b')](function(){var _0x3e35d1=_[_0x3770('0x24')](_0x2b16ed,function(_0x2fd6cf){socket[_0x3770('0x8e')]('user'+_0x300945+_0x3770('0x8f'),{'UserId':Number(_0x2fd6cf),[_0x300945+_0x3770('0x90')]:_0x44256d['id']});if(_0x300945!==_0x3770('0x7c')){return;}return db['UserVoiceQueueRt'][_0x3770('0x4d')]({'where':{'VoiceQueueId':_0x44256d['id'],'UserId':_0x2fd6cf},'transaction':_0x13587d});});return Promise['all'](_0x3e35d1);});});return Promise['all'](_0x549110);});});return Promise['all'](_0x455d98)[_0x3770('0x3b')](function(){return _0x11cb69[_0x3770('0x8c')](_0x2b16ed,{'transaction':_0x13587d});})['then'](function(){return db[_0x3770('0x62')]['findOne']({'where':{'teamId':_0x331058}})[_0x3770('0x3b')](function(_0x15b58d){if(_0x15b58d){var _0x3c6650=_['map'](_0x2b16ed,function(_0x25e5b7){db[_0x3770('0x63')][_0x3770('0x4d')]({'where':{'UserId':_0x25e5b7,'VoicePrefixId':_0x15b58d[_0x3770('0x64')]}});});return Promise[_0x3770('0x8a')](_0x3c6650);}});});});}})[_0x3770('0x3b')](respondWithStatusCode(_0x511dd4,null))[_0x3770('0x3f')](handleError(_0x511dd4,null));};exports[_0x3770('0x91')]=function(_0x348cf8,_0x1c2c68,_0x21e671){var _0x326922={};var _0x9639cb={};var _0xa1cc4;var _0x53a68e;return db['Team'][_0x3770('0x66')]({'where':{'id':_0x348cf8[_0x3770('0x4c')]['id']}})[_0x3770('0x3b')](handleEntityNotFound(_0x1c2c68,null))[_0x3770('0x3b')](function(_0x814d5d){if(_0x814d5d){_0xa1cc4=_0x814d5d;_0x9639cb[_0x3770('0x2f')]=_[_0x3770('0x2c')](db[_0x3770('0x81')][_0x3770('0x26')]);_0x9639cb['query']=_[_0x3770('0x2c')](_0x348cf8['query']);_0x9639cb[_0x3770('0x2d')]=_[_0x3770('0x2e')](_0x9639cb[_0x3770('0x2f')],_0x9639cb[_0x3770('0x2b')]);_0x326922[_0x3770('0x30')]=_['intersection'](_0x9639cb[_0x3770('0x2f')],qs[_0x3770('0x31')](_0x348cf8[_0x3770('0x2b')][_0x3770('0x31')]));_0x326922['attributes']=_0x326922[_0x3770('0x30')][_0x3770('0x32')]?_0x326922[_0x3770('0x30')]:_0x9639cb[_0x3770('0x2f')];_0x326922['order']=qs[_0x3770('0x34')](_0x348cf8['query'][_0x3770('0x34')]);_0x326922[_0x3770('0x35')]=qs[_0x3770('0x2d')](_[_0x3770('0x36')](_0x348cf8[_0x3770('0x2b')],_0x9639cb[_0x3770('0x2d')]));if(_0x348cf8[_0x3770('0x2b')][_0x3770('0x37')]){_0x326922[_0x3770('0x35')]=_[_0x3770('0x39')](_0x326922['where'],{'$or':_['map'](_0x326922[_0x3770('0x30')],function(_0x3f4ec8){var _0x37464a={};_0x37464a[_0x3f4ec8]={'$like':'%'+_0x348cf8[_0x3770('0x2b')][_0x3770('0x37')]+'%'};return _0x37464a;})});}_0x326922=_['merge']({},_0x326922,_0x348cf8['options']);return _0xa1cc4[_0x3770('0x91')](_0x326922);}})[_0x3770('0x3b')](function(_0x12c6f8){if(_0x12c6f8){_0x53a68e=_0x12c6f8[_0x3770('0x32')];if(!_0x348cf8[_0x3770('0x2b')][_0x3770('0x92')]('nolimit')){_0x326922[_0x3770('0x1a')]=qs[_0x3770('0x1a')](_0x348cf8['query'][_0x3770('0x1a')]);_0x326922['offset']=qs[_0x3770('0x18')](_0x348cf8['query'][_0x3770('0x18')]);}return _0xa1cc4[_0x3770('0x91')](_0x326922);}})['then'](function(_0x53d02a){if(_0x53d02a){return _0x53d02a?{'count':_0x53a68e,'rows':_0x53d02a}:null;}})[_0x3770('0x3b')](respondWithResult(_0x1c2c68,null))[_0x3770('0x3f')](handleError(_0x1c2c68,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index ae2d63b..3adda5e 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 _0xd926=['update','emit','hook','exports','../../mysqldb','Team','setMaxListeners'];(function(_0x2731f0,_0x126b1b){var _0x36a180=function(_0x44d1a9){while(--_0x44d1a9){_0x2731f0['push'](_0x2731f0['shift']());}};_0x36a180(++_0x126b1b);}(_0xd926,0xe4));var _0x6d92=function(_0x44cc11,_0x255e4c){_0x44cc11=_0x44cc11-0x0;var _0x37b592=_0xd926[_0x44cc11];return _0x37b592;};'use strict';var EventEmitter=require('events');var Team=require(_0x6d92('0x0'))['db'][_0x6d92('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x6d92('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6d92('0x3'),'afterDestroy':'remove'};function emitEvent(_0x23fdef){return function(_0x42691e,_0x834e5e,_0x4527a8){TeamEvents[_0x6d92('0x4')](_0x23fdef+':'+_0x42691e['id'],_0x42691e);TeamEvents['emit'](_0x23fdef,_0x42691e);_0x4527a8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x6d92('0x5')](e,emitEvent(event));}}module[_0x6d92('0x6')]=TeamEvents; \ No newline at end of file +var _0x6bfe=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove'];(function(_0x2c5268,_0xd7eca7){var _0x68f319=function(_0x2815fd){while(--_0x2815fd){_0x2c5268['push'](_0x2c5268['shift']());}};_0x68f319(++_0xd7eca7);}(_0x6bfe,0x185));var _0xe6bf=function(_0x4dcfe3,_0x4f0618){_0x4dcfe3=_0x4dcfe3-0x0;var _0xd4c55=_0x6bfe[_0x4dcfe3];return _0xd4c55;};'use strict';var EventEmitter=require(_0xe6bf('0x0'));var Team=require(_0xe6bf('0x1'))['db'][_0xe6bf('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xe6bf('0x3')](0x0);var events={'afterCreate':_0xe6bf('0x4'),'afterUpdate':_0xe6bf('0x5'),'afterDestroy':_0xe6bf('0x6')};function emitEvent(_0x439bb0){return function(_0x171966,_0x46b040,_0x3484b0){TeamEvents[_0xe6bf('0x7')](_0x439bb0+':'+_0x171966['id'],_0x171966);TeamEvents['emit'](_0x439bb0,_0x171966);_0x3484b0(null);};}for(var e in events){if(events[_0xe6bf('0x8')](e)){var event=events[e];Team[_0xe6bf('0x9')](e,emitEvent(event));}}module[_0xe6bf('0xa')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index ded332e..c7cd19f 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 _0x6a41=['Team','teams','Chat','Fax','Mail','Openchannel','Voice','Whatsapp','resolve','all','lodash','./team.attributes','get','Queues','then','map','setDataValue','channel','catch','exports','define'];(function(_0x431f4d,_0x2abbf4){var _0x237c46=function(_0x38f57c){while(--_0x38f57c){_0x431f4d['push'](_0x431f4d['shift']());}};_0x237c46(++_0x2abbf4);}(_0x6a41,0xc7));var _0x16a4=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x6a41[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x16a4('0x0'));var attributes=require(_0x16a4('0x1'));function getQueuesByChannel(_0x68affa,_0x4a0d82){var _0x1b0ab9=_0x16a4('0x2')+_0x4a0d82+_0x16a4('0x3');return _0x68affa[_0x1b0ab9]()[_0x16a4('0x4')](function(_0x576e89){return _[_0x16a4('0x5')](_0x576e89,function(_0x2e7d8d){_0x2e7d8d[_0x16a4('0x6')](_0x16a4('0x7'),_0x4a0d82);return _0x2e7d8d;});})[_0x16a4('0x8')](function(_0x2ccce3){throw _0x2ccce3;});}module[_0x16a4('0x9')]=function(_0x52966f){return _0x52966f[_0x16a4('0xa')](_0x16a4('0xb'),attributes,{'tableName':_0x16a4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1b6900=this;var _0x3da615=[_0x16a4('0xd'),_0x16a4('0xe'),_0x16a4('0xf'),_0x16a4('0x10'),'Sms',_0x16a4('0x11'),_0x16a4('0x12')];return Promise[_0x16a4('0x13')]()[_0x16a4('0x4')](function(){var _0x545aab=_[_0x16a4('0x5')](_0x3da615,function(_0x19d0f4){return getQueuesByChannel(_0x1b6900,_0x19d0f4);});return Promise[_0x16a4('0x14')](_0x545aab);})[_0x16a4('0x8')](function(_0x561616){throw _0x561616;});}}});}; \ No newline at end of file +var _0xf273=['map','setDataValue','channel','catch','exports','define','Team','teams','Fax','Mail','Sms','Voice','Whatsapp','resolve','all','./team.attributes','Queues','then'];(function(_0x567f76,_0x14e6fd){var _0x55061c=function(_0x6c145b){while(--_0x6c145b){_0x567f76['push'](_0x567f76['shift']());}};_0x55061c(++_0x14e6fd);}(_0xf273,0x19b));var _0x3f27=function(_0x552fb5,_0x51fa13){_0x552fb5=_0x552fb5-0x0;var _0x10a203=_0xf273[_0x552fb5];return _0x10a203;};'use strict';var _=require('lodash');var attributes=require(_0x3f27('0x0'));function getQueuesByChannel(_0x104a33,_0x319392){var _0x2e9dc2='get'+_0x319392+_0x3f27('0x1');return _0x104a33[_0x2e9dc2]()[_0x3f27('0x2')](function(_0x3ced26){return _[_0x3f27('0x3')](_0x3ced26,function(_0x36c0c7){_0x36c0c7[_0x3f27('0x4')](_0x3f27('0x5'),_0x319392);return _0x36c0c7;});})[_0x3f27('0x6')](function(_0x36f977){throw _0x36f977;});}module[_0x3f27('0x7')]=function(_0x236b73){return _0x236b73[_0x3f27('0x8')](_0x3f27('0x9'),attributes,{'tableName':_0x3f27('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x2d028f=this;var _0x496094=['Chat',_0x3f27('0xb'),_0x3f27('0xc'),'Openchannel',_0x3f27('0xd'),_0x3f27('0xe'),_0x3f27('0xf')];return Promise[_0x3f27('0x10')]()[_0x3f27('0x2')](function(){var _0x249712=_['map'](_0x496094,function(_0x56f80f){return getQueuesByChannel(_0x2d028f,_0x56f80f);});return Promise[_0x3f27('0x11')](_0x249712);})[_0x3f27('0x6')](function(_0x27f968){throw _0x27f968;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index cb381ef..e46c267 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 _0x02d1=['rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','then','info','Team,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x53ef61,_0x44cda6){var _0x4e4207=function(_0x50af1b){while(--_0x50af1b){_0x53ef61['push'](_0x53ef61['shift']());}};_0x4e4207(++_0x44cda6);}(_0x02d1,0xa8));var _0x102d=function(_0x42c01d,_0x17e327){_0x42c01d=_0x42c01d-0x0;var _0x2d8cef=_0x02d1[_0x42c01d];return _0x2d8cef;};'use strict';var _=require(_0x102d('0x0'));var util=require('util');var moment=require(_0x102d('0x1'));var BPromise=require(_0x102d('0x2'));var rs=require(_0x102d('0x3'));var fs=require('fs');var Redis=require(_0x102d('0x4'));var db=require(_0x102d('0x5'))['db'];var utils=require(_0x102d('0x6'));var logger=require('../../config/logger')(_0x102d('0x7'));var config=require(_0x102d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x102d('0x9')]({'port':0x232a});config[_0x102d('0xa')]=_[_0x102d('0xb')](config[_0x102d('0xa')],{'host':_0x102d('0xc'),'port':0x18eb});var socket=require(_0x102d('0xd'))(new Redis(config['redis']));require('./team.socket')[_0x102d('0xe')](socket);function respondWithRpcPromise(_0x46cdff,_0x3c8257,_0x27fd1d){return new BPromise(function(_0x6bb968,_0x53c15f){return client['request'](_0x46cdff,_0x27fd1d)[_0x102d('0xf')](function(_0x189894){logger[_0x102d('0x10')](_0x102d('0x11'),_0x3c8257,'request\x20sent');logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x3c8257,_0x102d('0x12'),JSON[_0x102d('0x13')](_0x189894));if(_0x189894[_0x102d('0x14')]){if(_0x189894[_0x102d('0x14')][_0x102d('0x15')]===0x1f4){logger[_0x102d('0x14')](_0x102d('0x11'),_0x3c8257,_0x189894[_0x102d('0x14')][_0x102d('0x16')]);return _0x53c15f(_0x189894[_0x102d('0x14')][_0x102d('0x16')]);}logger[_0x102d('0x14')]('Team,\x20%s,\x20%s',_0x3c8257,_0x189894['error'][_0x102d('0x16')]);return _0x6bb968(_0x189894[_0x102d('0x14')][_0x102d('0x16')]);}else{logger[_0x102d('0x10')](_0x102d('0x11'),_0x3c8257,_0x102d('0x12'));_0x6bb968(_0x189894[_0x102d('0x17')]['message']);}})[_0x102d('0x18')](function(_0x1b1858){logger[_0x102d('0x14')](_0x102d('0x11'),_0x3c8257,_0x1b1858);_0x53c15f(_0x1b1858);});});} \ No newline at end of file +var _0x328d=['../../mysqldb','../../config/logger','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird','randomstring','ioredis'];(function(_0x492ce0,_0x474c65){var _0x17a696=function(_0x246049){while(--_0x246049){_0x492ce0['push'](_0x492ce0['shift']());}};_0x17a696(++_0x474c65);}(_0x328d,0xf8));var _0xd328=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x328d[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0xd328('0x0'));var util=require(_0xd328('0x1'));var moment=require('moment');var BPromise=require(_0xd328('0x2'));var rs=require(_0xd328('0x3'));var fs=require('fs');var Redis=require(_0xd328('0x4'));var db=require(_0xd328('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd328('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd328('0x7'));var client=jayson[_0xd328('0x8')]['http']({'port':0x232a});config[_0xd328('0x9')]=_['defaults'](config[_0xd328('0x9')],{'host':_0xd328('0xa'),'port':0x18eb});var socket=require(_0xd328('0xb'))(new Redis(config[_0xd328('0x9')]));require('./team.socket')[_0xd328('0xc')](socket);function respondWithRpcPromise(_0x475c41,_0x5d36fe,_0x5cc22e){return new BPromise(function(_0x195277,_0x50ffd2){return client[_0xd328('0xd')](_0x475c41,_0x5cc22e)['then'](function(_0x127cea){logger[_0xd328('0xe')](_0xd328('0xf'),_0x5d36fe,_0xd328('0x10'));logger[_0xd328('0x11')](_0xd328('0x12'),_0x5d36fe,_0xd328('0x10'),JSON['stringify'](_0x127cea));if(_0x127cea[_0xd328('0x13')]){if(_0x127cea[_0xd328('0x13')][_0xd328('0x14')]===0x1f4){logger[_0xd328('0x13')]('Team,\x20%s,\x20%s',_0x5d36fe,_0x127cea[_0xd328('0x13')][_0xd328('0x15')]);return _0x50ffd2(_0x127cea['error'][_0xd328('0x15')]);}logger[_0xd328('0x13')](_0xd328('0xf'),_0x5d36fe,_0x127cea['error'][_0xd328('0x15')]);return _0x195277(_0x127cea[_0xd328('0x13')][_0xd328('0x15')]);}else{logger[_0xd328('0xe')]('Team,\x20%s,\x20%s',_0x5d36fe,'request\x20sent');_0x195277(_0x127cea[_0xd328('0x16')][_0xd328('0x15')]);}})['catch'](function(_0x53f66b){logger[_0xd328('0x13')](_0xd328('0xf'),_0x5d36fe,_0x53f66b);_0x50ffd2(_0x53f66b);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 9c5240b..283ab2f 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 _0x4178=['removeListener','length','team:','update'];(function(_0x586a2a,_0x3067a8){var _0x2d30f5=function(_0x4d93c7){while(--_0x4d93c7){_0x586a2a['push'](_0x586a2a['shift']());}};_0x2d30f5(++_0x3067a8);}(_0x4178,0x1df));var _0x8417=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x4178[_0x160c73];return _0xd9302;};'use strict';var TeamEvents=require('./team.events');var events=['save','remove',_0x8417('0x0')];function createListener(_0x51f614,_0xe9453f){return function(_0x1c4f62){_0xe9453f['emit'](_0x51f614,_0x1c4f62);};}function removeListener(_0x2c8b83,_0x352a69){return function(){TeamEvents[_0x8417('0x1')](_0x2c8b83,_0x352a69);};}exports['register']=function(_0x1700b3){for(var _0x32d707=0x0,_0x440552=events[_0x8417('0x2')];_0x32d707<_0x440552;_0x32d707++){var _0x373b35=events[_0x32d707];var _0x5ace9c=createListener(_0x8417('0x3')+_0x373b35,_0x1700b3);TeamEvents['on'](_0x373b35,_0x5ace9c);}}; \ No newline at end of file +var _0x63cf=['remove','update','removeListener','register','team:','./team.events','save'];(function(_0x4b0f64,_0x4a6dca){var _0x4fcad4=function(_0x5ac61f){while(--_0x5ac61f){_0x4b0f64['push'](_0x4b0f64['shift']());}};_0x4fcad4(++_0x4a6dca);}(_0x63cf,0xc9));var _0xf63c=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0x63cf[_0xf26c2e];return _0x46ecb4;};'use strict';var TeamEvents=require(_0xf63c('0x0'));var events=[_0xf63c('0x1'),_0xf63c('0x2'),_0xf63c('0x3')];function createListener(_0x112d53,_0x34b27e){return function(_0x1e5162){_0x34b27e['emit'](_0x112d53,_0x1e5162);};}function removeListener(_0x1aa7fd,_0x5844c1){return function(){TeamEvents[_0xf63c('0x4')](_0x1aa7fd,_0x5844c1);};}exports[_0xf63c('0x5')]=function(_0x30da33){for(var _0x2fe800=0x0,_0x6be9b2=events['length'];_0x2fe800<_0x6be9b2;_0x2fe800++){var _0x339935=events[_0x2fe800];var _0x3ba6cc=createListener(_0xf63c('0x6')+_0x339935,_0x30da33);TeamEvents['on'](_0x339935,_0x3ba6cc);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index bb13551..253c363 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 _0x9efb=['INTEGER','exports'];(function(_0x5bf2c8,_0x2b5120){var _0x279d74=function(_0x39a44f){while(--_0x39a44f){_0x5bf2c8['push'](_0x5bf2c8['shift']());}};_0x279d74(++_0x2b5120);}(_0x9efb,0x143));var _0xb9ef=function(_0x2725e7,_0x25b928){_0x2725e7=_0x2725e7-0x0;var _0x1214ee=_0x9efb[_0x2725e7];return _0x1214ee;};'use strict';var Sequelize=require('sequelize');module[_0xb9ef('0x0')]={'TeamId':{'type':Sequelize[_0xb9ef('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x950a=['sequelize','exports','INTEGER'];(function(_0x445f2b,_0x4662ef){var _0x59278e=function(_0x4233ad){while(--_0x4233ad){_0x445f2b['push'](_0x445f2b['shift']());}};_0x59278e(++_0x4662ef);}(_0x950a,0x174));var _0xa950=function(_0x4665b2,_0x5f8f90){_0x4665b2=_0x4665b2-0x0;var _0x239ea7=_0x950a[_0x4665b2];return _0x239ea7;};'use strict';var Sequelize=require(_0xa950('0x0'));module[_0xa950('0x1')]={'TeamId':{'type':Sequelize[_0xa950('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 049eee7..fb4eba1 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 _0x4b17=['team_has_voice_prefixes','lodash','../../config/logger','moment','bluebird','path','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix'];(function(_0x5d90b8,_0x71f07d){var _0x14408f=function(_0x11f22f){while(--_0x11f22f){_0x5d90b8['push'](_0x5d90b8['shift']());}};_0x14408f(++_0x71f07d);}(_0x4b17,0x10f));var _0x74b1=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0x4b17[_0x29db36];return _0x234e87;};'use strict';var _=require(_0x74b1('0x0'));var util=require('util');var logger=require(_0x74b1('0x1'))('api');var moment=require(_0x74b1('0x2'));var BPromise=require(_0x74b1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x74b1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x74b1('0x5'));module[_0x74b1('0x6')]=function(_0x379dcc,_0x3873a6){return _0x379dcc[_0x74b1('0x7')](_0x74b1('0x8'),attributes,{'tableName':_0x74b1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f59=['../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x30659a,_0x7f34a5){var _0x49cd65=function(_0x5a716a){while(--_0x5a716a){_0x30659a['push'](_0x30659a['shift']());}};_0x49cd65(++_0x7f34a5);}(_0x6f59,0x1be));var _0x96f5=function(_0x2d2750,_0x4d1da6){_0x2d2750=_0x2d2750-0x0;var _0x24c699=_0x6f59[_0x2d2750];return _0x24c699;};'use strict';var _=require(_0x96f5('0x0'));var util=require(_0x96f5('0x1'));var logger=require(_0x96f5('0x2'))(_0x96f5('0x3'));var moment=require(_0x96f5('0x4'));var BPromise=require(_0x96f5('0x5'));var rp=require(_0x96f5('0x6'));var fs=require('fs');var path=require(_0x96f5('0x7'));var rimraf=require(_0x96f5('0x8'));var config=require(_0x96f5('0x9'));var attributes=require(_0x96f5('0xa'));module[_0x96f5('0xb')]=function(_0x598154,_0xf6cd7d){return _0x598154['define'](_0x96f5('0xc'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index b3862ca..0129616 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x52bbdc,_0x191120){var _0x576eed=function(_0x3ad5c0){while(--_0x3ad5c0){_0x52bbdc['push'](_0x52bbdc['shift']());}};_0x576eed(++_0x191120);}(_0x70e0,0x17b));var _0x070e=function(_0x4290c3,_0x3579de){_0x4290c3=_0x4290c3-0x0;var _0x43eb2b=_0x70e0[_0x4290c3];return _0x43eb2b;};'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(_0x31a505,_0x6b435b){var _0x287b14=function(_0xce36ad){while(--_0xce36ad){_0x31a505['push'](_0x31a505['shift']());}};_0x287b14(++_0x6b435b);}(_0xedd9,0xfc));var _0x9edd=function(_0x5a8c89,_0x210289){_0x5a8c89=_0x5a8c89-0x0;var _0x1b8a9f=_0xedd9[_0x5a8c89];return _0x1b8a9f;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index d18d676..d403634 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 _0x0849=['exports','INTEGER'];(function(_0x261de2,_0x68ba7f){var _0x10ac2f=function(_0xb2a468){while(--_0xb2a468){_0x261de2['push'](_0x261de2['shift']());}};_0x10ac2f(++_0x68ba7f);}(_0x0849,0x90));var _0x9084=function(_0x21605f,_0x22308a){_0x21605f=_0x21605f-0x0;var _0x466f25=_0x0849[_0x21605f];return _0x466f25;};'use strict';var Sequelize=require('sequelize');module[_0x9084('0x0')]={'penalty':{'type':Sequelize[_0x9084('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x143e=['exports','sequelize'];(function(_0x970068,_0x3e4142){var _0x51063d=function(_0x32b30e){while(--_0x32b30e){_0x970068['push'](_0x970068['shift']());}};_0x51063d(++_0x3e4142);}(_0x143e,0xdf));var _0xe143=function(_0x3b6939,_0xb65e69){_0x3b6939=_0x3b6939-0x0;var _0xc9f654=_0x143e[_0x3b6939];return _0xc9f654;};'use strict';var Sequelize=require(_0xe143('0x0'));module[_0xe143('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 f6c3393..557e1f4 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 _0xc770=['path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','lodash','util','moment','bluebird','request-promise'];(function(_0x5bdc31,_0x40dad6){var _0x570f7c=function(_0x2b4869){while(--_0x2b4869){_0x5bdc31['push'](_0x5bdc31['shift']());}};_0x570f7c(++_0x40dad6);}(_0xc770,0xd3));var _0x0c77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc770[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0c77('0x0'));var util=require(_0x0c77('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0c77('0x2'));var BPromise=require(_0x0c77('0x3'));var rp=require(_0x0c77('0x4'));var fs=require('fs');var path=require(_0x0c77('0x5'));var rimraf=require(_0x0c77('0x6'));var config=require(_0x0c77('0x7'));var attributes=require(_0x0c77('0x8'));module[_0x0c77('0x9')]=function(_0x575bb3,_0x26a0ff){return _0x575bb3[_0x0c77('0xa')]('TeamVoiceQueue',attributes,{'tableName':_0x0c77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x851d=['bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','lodash','../../config/logger','api'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x851d,0x69));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd851('0x0'));var util=require('util');var logger=require(_0xd851('0x1'))(_0xd851('0x2'));var moment=require('moment');var BPromise=require(_0xd851('0x3'));var rp=require(_0xd851('0x4'));var fs=require('fs');var path=require(_0xd851('0x5'));var rimraf=require(_0xd851('0x6'));var config=require(_0xd851('0x7'));var attributes=require(_0xd851('0x8'));module['exports']=function(_0x578809,_0x1fff93){return _0x578809[_0xd851('0x9')](_0xd851('0xa'),attributes,{'tableName':_0xd851('0xb'),'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 ea532b0..ee0bf27 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 _0xa37e=['TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0x15756e,_0x548eb6){var _0x4c37ed=function(_0x48aefa){while(--_0x48aefa){_0x15756e['push'](_0x15756e['shift']());}};_0x4c37ed(++_0x548eb6);}(_0xa37e,0x97));var _0xea37=function(_0x35d109,_0x39fbd3){_0x35d109=_0x35d109-0x0;var _0x4851b0=_0xa37e[_0x35d109];return _0x4851b0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea37('0x0'));var BPromise=require(_0xea37('0x1'));var rs=require(_0xea37('0x2'));var fs=require('fs');var Redis=require(_0xea37('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xea37('0x4'));var logger=require('../../config/logger')(_0xea37('0x5'));var config=require(_0xea37('0x6'));var jayson=require(_0xea37('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36c489,_0x4a9e08,_0x4ae081){return new BPromise(function(_0x2c2890,_0x1401e1){return client[_0xea37('0x8')](_0x36c489,_0x4ae081)[_0xea37('0x9')](function(_0x5e4ebe){logger[_0xea37('0xa')](_0xea37('0xb'),_0x4a9e08,_0xea37('0xc'));logger['debug']('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x4a9e08,_0xea37('0xc'),JSON[_0xea37('0xd')](_0x5e4ebe));if(_0x5e4ebe[_0xea37('0xe')]){if(_0x5e4ebe['error'][_0xea37('0xf')]===0x1f4){logger[_0xea37('0xe')](_0xea37('0xb'),_0x4a9e08,_0x5e4ebe['error'][_0xea37('0x10')]);return _0x1401e1(_0x5e4ebe[_0xea37('0xe')]['message']);}logger[_0xea37('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4a9e08,_0x5e4ebe[_0xea37('0xe')]['message']);return _0x2c2890(_0x5e4ebe[_0xea37('0xe')][_0xea37('0x10')]);}else{logger[_0xea37('0xa')](_0xea37('0xb'),_0x4a9e08,'request\x20sent');_0x2c2890(_0x5e4ebe[_0xea37('0x11')]['message']);}})['catch'](function(_0x3ae3cc){logger['error'](_0xea37('0xb'),_0x4a9e08,_0x3ae3cc);_0x1401e1(_0x3ae3cc);});});} \ No newline at end of file +var _0x25e4=['../../config/environment','http','then','info','request\x20sent','debug','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x7ee493,_0x2cc2cb){var _0x1f2c25=function(_0x243745){while(--_0x243745){_0x7ee493['push'](_0x7ee493['shift']());}};_0x1f2c25(++_0x2cc2cb);}(_0x25e4,0x10a));var _0x425e=function(_0x3af4ad,_0x90cec1){_0x3af4ad=_0x3af4ad-0x0;var _0x2f447e=_0x25e4[_0x3af4ad];return _0x2f447e;};'use strict';var _=require(_0x425e('0x0'));var util=require(_0x425e('0x1'));var moment=require(_0x425e('0x2'));var BPromise=require(_0x425e('0x3'));var rs=require(_0x425e('0x4'));var fs=require('fs');var Redis=require(_0x425e('0x5'));var db=require(_0x425e('0x6'))['db'];var utils=require(_0x425e('0x7'));var logger=require(_0x425e('0x8'))(_0x425e('0x9'));var config=require(_0x425e('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x425e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3568ca,_0x2bf2e1,_0x4bd169){return new BPromise(function(_0x547850,_0xa62524){return client['request'](_0x3568ca,_0x4bd169)[_0x425e('0xc')](function(_0x901ec3){logger[_0x425e('0xd')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2bf2e1,_0x425e('0xe'));logger[_0x425e('0xf')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2bf2e1,_0x425e('0xe'),JSON[_0x425e('0x10')](_0x901ec3));if(_0x901ec3[_0x425e('0x11')]){if(_0x901ec3[_0x425e('0x11')][_0x425e('0x12')]===0x1f4){logger[_0x425e('0x11')](_0x425e('0x13'),_0x2bf2e1,_0x901ec3['error']['message']);return _0xa62524(_0x901ec3[_0x425e('0x11')][_0x425e('0x14')]);}logger[_0x425e('0x11')](_0x425e('0x13'),_0x2bf2e1,_0x901ec3['error'][_0x425e('0x14')]);return _0x547850(_0x901ec3[_0x425e('0x11')][_0x425e('0x14')]);}else{logger[_0x425e('0xd')](_0x425e('0x13'),_0x2bf2e1,_0x425e('0xe'));_0x547850(_0x901ec3[_0x425e('0x15')]['message']);}})[_0x425e('0x16')](function(_0x2935f2){logger[_0x425e('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2bf2e1,_0x2935f2);_0xa62524(_0x2935f2);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 22c6078..baaaf10 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 _0xceef=['create','put','update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./template.controller','get','/:id','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xceef,0xf6));var _0xfcee=function(_0x4c5a24,_0x5ef60c){_0x4c5a24=_0x4c5a24-0x0;var _0x4b067e=_0xceef[_0x4c5a24];return _0x4b067e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfcee('0x0'));var timeout=require(_0xfcee('0x1'));var express=require('express');var router=express[_0xfcee('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfcee('0x3'));var interaction=require(_0xfcee('0x4'));var config=require('../../config/environment');var controller=require(_0xfcee('0x5'));router[_0xfcee('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfcee('0x6')](_0xfcee('0x7'),auth[_0xfcee('0x8')](),controller['show']);router['post']('/',auth[_0xfcee('0x8')](),controller[_0xfcee('0x9')]);router[_0xfcee('0xa')](_0xfcee('0x7'),auth[_0xfcee('0x8')](),controller[_0xfcee('0xb')]);router[_0xfcee('0xc')]('/:id',auth[_0xfcee('0x8')](),controller[_0xfcee('0xd')]);module[_0xfcee('0xe')]=router; \ No newline at end of file +var _0xf811=['show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id'];(function(_0x1e2f5b,_0x60bf47){var _0x2bb7bc=function(_0x1ddf91){while(--_0x1ddf91){_0x1e2f5b['push'](_0x1e2f5b['shift']());}};_0x2bb7bc(++_0x60bf47);}(_0xf811,0x6f));var _0x1f81=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xf811[_0x381589];return _0x2a075d;};'use strict';var multer=require(_0x1f81('0x0'));var util=require(_0x1f81('0x1'));var path=require(_0x1f81('0x2'));var timeout=require(_0x1f81('0x3'));var express=require(_0x1f81('0x4'));var router=express[_0x1f81('0x5')]();var fs_extra=require(_0x1f81('0x6'));var auth=require(_0x1f81('0x7'));var interaction=require(_0x1f81('0x8'));var config=require(_0x1f81('0x9'));var controller=require(_0x1f81('0xa'));router[_0x1f81('0xb')]('/',auth[_0x1f81('0xc')](),controller[_0x1f81('0xd')]);router['get'](_0x1f81('0xe'),auth[_0x1f81('0xc')](),controller[_0x1f81('0xf')]);router['post']('/',auth[_0x1f81('0xc')](),controller[_0x1f81('0x10')]);router['put'](_0x1f81('0xe'),auth['isAuthenticated'](),controller[_0x1f81('0x11')]);router[_0x1f81('0x12')](_0x1f81('0xe'),auth[_0x1f81('0xc')](),controller[_0x1f81('0x13')]);module[_0x1f81('0x14')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index f9844f3..ed1f579 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 _0xdec7=['sequelize','STRING','TEXT'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0xdec7,0x132));var _0x7dec=function(_0x59fe72,_0x21cd0b){_0x59fe72=_0x59fe72-0x0;var _0x583b28=_0xdec7[_0x59fe72];return _0x583b28;};'use strict';var Sequelize=require(_0x7dec('0x0'));module['exports']={'name':{'type':Sequelize[_0x7dec('0x1')]},'description':{'type':Sequelize[_0x7dec('0x1')]},'html':{'type':Sequelize[_0x7dec('0x2')]}}; \ No newline at end of file +var _0xc891=['TEXT','sequelize','STRING'];(function(_0x548568,_0x38b789){var _0x3a8c75=function(_0x3d7cfd){while(--_0x3d7cfd){_0x548568['push'](_0x548568['shift']());}};_0x3a8c75(++_0x38b789);}(_0xc891,0x1ea));var _0x1c89=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xc891[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x1c89('0x0'));module['exports']={'name':{'type':Sequelize[_0x1c89('0x1')]},'description':{'type':Sequelize[_0x1c89('0x1')]},'html':{'type':Sequelize[_0x1c89('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 226dcff..a4a7c6e 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 _0xb2f5=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','get','user','Templates','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0xf04c6d,_0xe98786){var _0x4a804e=function(_0x431a0a){while(--_0x431a0a){_0xf04c6d['push'](_0xf04c6d['shift']());}};_0x4a804e(++_0xe98786);}(_0xb2f5,0x114));var _0x5b2f=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xb2f5[_0x3c8e9a];return _0x2d4c57;};'use strict';var emlformat=require(_0x5b2f('0x0'));var rimraf=require(_0x5b2f('0x1'));var zipdir=require(_0x5b2f('0x2'));var jsonpatch=require(_0x5b2f('0x3'));var rp=require(_0x5b2f('0x4'));var moment=require('moment');var BPromise=require(_0x5b2f('0x5'));var Mustache=require(_0x5b2f('0x6'));var util=require('util');var path=require(_0x5b2f('0x7'));var sox=require(_0x5b2f('0x8'));var csv=require(_0x5b2f('0x9'));var ejs=require(_0x5b2f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5b2f('0xb'));var squel=require(_0x5b2f('0xc'));var crypto=require(_0x5b2f('0xd'));var jsforce=require(_0x5b2f('0xe'));var deskjs=require(_0x5b2f('0xf'));var toCsv=require(_0x5b2f('0x9'));var querystring=require(_0x5b2f('0x10'));var Papa=require(_0x5b2f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5b2f('0x12'));var as=require(_0x5b2f('0x13'));var hardwareService=require(_0x5b2f('0x14'));var logger=require(_0x5b2f('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x5b2f('0x16'));var licenseUtil=require(_0x5b2f('0x17'));var db=require(_0x5b2f('0x18'))['db'];function respondWithStatusCode(_0x50e761,_0x5f2c05){_0x5f2c05=_0x5f2c05||0xcc;return function(_0xafa737){if(_0xafa737){return _0x50e761['sendStatus'](_0x5f2c05);}return _0x50e761[_0x5b2f('0x19')](_0x5f2c05)[_0x5b2f('0x1a')]();};}function respondWithResult(_0x450094,_0x4911ec){_0x4911ec=_0x4911ec||0xc8;return function(_0x5d5747){if(_0x5d5747){return _0x450094[_0x5b2f('0x19')](_0x4911ec)[_0x5b2f('0x1b')](_0x5d5747);}};}function respondWithFilteredResult(_0x20f104,_0x231a1e){return function(_0x1122f1){if(_0x1122f1){var _0x2b2ed0=typeof _0x231a1e[_0x5b2f('0x1c')]===_0x5b2f('0x1d')&&typeof _0x231a1e['limit']===_0x5b2f('0x1d');var _0x33a34a=_0x1122f1[_0x5b2f('0x1e')];var _0x270d74=_0x2b2ed0?0x0:_0x231a1e[_0x5b2f('0x1c')];var _0xf1f095=_0x2b2ed0?_0x1122f1[_0x5b2f('0x1e')]:_0x231a1e[_0x5b2f('0x1c')]+_0x231a1e[_0x5b2f('0x1f')];var _0x206ddd;if(_0xf1f095>=_0x33a34a){_0xf1f095=_0x33a34a;_0x206ddd=0xc8;}else{_0x206ddd=0xce;}_0x20f104['status'](_0x206ddd);return _0x20f104['set'](_0x5b2f('0x20'),_0x270d74+'-'+_0xf1f095+'/'+_0x33a34a)[_0x5b2f('0x1b')](_0x1122f1);}return null;};}function patchUpdates(_0x59c6d4){return function(_0x1c1447){try{jsonpatch[_0x5b2f('0x21')](_0x1c1447,_0x59c6d4,!![]);}catch(_0x534720){return BPromise[_0x5b2f('0x22')](_0x534720);}return _0x1c1447[_0x5b2f('0x23')]();};}function saveUpdates(_0x174f54,_0x5ed8f8){return function(_0x11d6d8){if(_0x11d6d8){return _0x11d6d8[_0x5b2f('0x24')](_0x174f54)[_0x5b2f('0x25')](function(_0x2ab092){return _0x2ab092;});}return null;};}function removeEntity(_0x23288c,_0x24868f){return function(_0x648ac7){if(_0x648ac7){return _0x648ac7[_0x5b2f('0x26')]()[_0x5b2f('0x25')](function(){var _0x5da57e=_0x648ac7['get']({'plain':!![]});var _0x5f0f2b='Templates';return db[_0x5b2f('0x27')][_0x5b2f('0x26')]({'where':{'type':_0x5f0f2b,'resourceId':_0x5da57e['id']}})['then'](function(){return _0x648ac7;});})['then'](function(){_0x23288c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x202110,_0x4e3db1){return function(_0x101fbe){if(!_0x101fbe){_0x202110['sendStatus'](0x194);}return _0x101fbe;};}function handleError(_0x2a3359,_0x3727fa){_0x3727fa=_0x3727fa||0x1f4;return function(_0x11b38d){logger[_0x5b2f('0x28')](_0x11b38d['stack']);if(_0x11b38d['name']){delete _0x11b38d[_0x5b2f('0x29')];}_0x2a3359[_0x5b2f('0x19')](_0x3727fa)[_0x5b2f('0x2a')](_0x11b38d);};}exports[_0x5b2f('0x2b')]=function(_0x5450db,_0x3742af){var _0xd7ad0c={},_0x1785e4={},_0x3e7b2a={'count':0x0,'rows':[]};var _0x530f6f=_[_0x5b2f('0x2c')](db[_0x5b2f('0x2d')][_0x5b2f('0x2e')],function(_0x3f34eb){return{'name':_0x3f34eb[_0x5b2f('0x2f')],'type':_0x3f34eb[_0x5b2f('0x30')][_0x5b2f('0x31')]};});_0x1785e4[_0x5b2f('0x32')]=_[_0x5b2f('0x2c')](_0x530f6f,_0x5b2f('0x29'));_0x1785e4[_0x5b2f('0x33')]=_[_0x5b2f('0x34')](_0x5450db[_0x5b2f('0x33')]);_0x1785e4[_0x5b2f('0x35')]=_[_0x5b2f('0x36')](_0x1785e4[_0x5b2f('0x32')],_0x1785e4['query']);_0xd7ad0c[_0x5b2f('0x37')]=_[_0x5b2f('0x36')](_0x1785e4[_0x5b2f('0x32')],qs[_0x5b2f('0x38')](_0x5450db['query']['fields']));_0xd7ad0c[_0x5b2f('0x37')]=_0xd7ad0c[_0x5b2f('0x37')][_0x5b2f('0x39')]?_0xd7ad0c[_0x5b2f('0x37')]:_0x1785e4[_0x5b2f('0x32')];if(!_0x5450db[_0x5b2f('0x33')][_0x5b2f('0x3a')](_0x5b2f('0x3b'))){_0xd7ad0c['limit']=qs['limit'](_0x5450db[_0x5b2f('0x33')][_0x5b2f('0x1f')]);_0xd7ad0c[_0x5b2f('0x1c')]=qs['offset'](_0x5450db[_0x5b2f('0x33')][_0x5b2f('0x1c')]);}_0xd7ad0c[_0x5b2f('0x3c')]=qs[_0x5b2f('0x3d')](_0x5450db[_0x5b2f('0x33')][_0x5b2f('0x3d')]);_0xd7ad0c[_0x5b2f('0x3e')]=qs[_0x5b2f('0x35')](_[_0x5b2f('0x3f')](_0x5450db['query'],_0x1785e4['filters']),_0x530f6f);if(_0x5450db[_0x5b2f('0x33')][_0x5b2f('0x40')]){_0xd7ad0c['where']=_[_0x5b2f('0x41')](_0xd7ad0c['where'],{'$or':_[_0x5b2f('0x2c')](_0x530f6f,function(_0x7f2b02){if(_0x7f2b02[_0x5b2f('0x30')]!==_0x5b2f('0x42')){var _0x4f85a4={};_0x4f85a4[_0x7f2b02[_0x5b2f('0x29')]]={'$like':'%'+_0x5450db['query']['filter']+'%'};return _0x4f85a4;}})});}_0xd7ad0c=_['merge']({},_0xd7ad0c,_0x5450db[_0x5b2f('0x43')]);var _0x16b424={'where':_0xd7ad0c[_0x5b2f('0x3e')]};return db['Template'][_0x5b2f('0x1e')](_0x16b424)[_0x5b2f('0x25')](function(_0x5d5eb4){_0x3e7b2a[_0x5b2f('0x1e')]=_0x5d5eb4;if(_0x5450db[_0x5b2f('0x33')][_0x5b2f('0x44')]){_0xd7ad0c[_0x5b2f('0x45')]=[{'all':!![]}];}return db[_0x5b2f('0x2d')][_0x5b2f('0x46')](_0xd7ad0c);})[_0x5b2f('0x25')](function(_0x7fdb53){_0x3e7b2a[_0x5b2f('0x47')]=_0x7fdb53;return _0x3e7b2a;})[_0x5b2f('0x25')](respondWithFilteredResult(_0x3742af,_0xd7ad0c))[_0x5b2f('0x48')](handleError(_0x3742af,null));};exports[_0x5b2f('0x49')]=function(_0x1bf33c,_0x4971f0){var _0x8bd90c={'raw':!![],'where':{'id':_0x1bf33c[_0x5b2f('0x4a')]['id']}},_0x45683a={};_0x45683a[_0x5b2f('0x32')]=_[_0x5b2f('0x34')](db[_0x5b2f('0x2d')][_0x5b2f('0x2e')]);_0x45683a[_0x5b2f('0x33')]=_[_0x5b2f('0x34')](_0x1bf33c[_0x5b2f('0x33')]);_0x45683a[_0x5b2f('0x35')]=_[_0x5b2f('0x36')](_0x45683a[_0x5b2f('0x32')],_0x45683a['query']);_0x8bd90c[_0x5b2f('0x37')]=_[_0x5b2f('0x36')](_0x45683a[_0x5b2f('0x32')],qs[_0x5b2f('0x38')](_0x1bf33c[_0x5b2f('0x33')]['fields']));_0x8bd90c[_0x5b2f('0x37')]=_0x8bd90c[_0x5b2f('0x37')]['length']?_0x8bd90c['attributes']:_0x45683a[_0x5b2f('0x32')];if(_0x1bf33c['query'][_0x5b2f('0x44')]){_0x8bd90c[_0x5b2f('0x45')]=[{'all':!![]}];}_0x8bd90c=_['merge']({},_0x8bd90c,_0x1bf33c['options']);return db['Template']['find'](_0x8bd90c)[_0x5b2f('0x25')](handleEntityNotFound(_0x4971f0,null))[_0x5b2f('0x25')](respondWithResult(_0x4971f0,null))[_0x5b2f('0x48')](handleError(_0x4971f0,null));};exports[_0x5b2f('0x4b')]=function(_0xf599af,_0x36e62b){return db[_0x5b2f('0x2d')]['create'](_0xf599af['body'],{})[_0x5b2f('0x25')](function(_0x2c6fc7){var _0x5df156=_0xf599af['user'][_0x5b2f('0x4c')]({'plain':!![]});if(!_0x5df156)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5df156['role']===_0x5b2f('0x4d')){var _0x2dde46=_0x2c6fc7[_0x5b2f('0x4c')]({'plain':!![]});var _0x4dc066=_0x5b2f('0x4e');return db['UserProfileSection'][_0x5b2f('0x4f')]({'where':{'name':_0x4dc066,'userProfileId':_0x5df156[_0x5b2f('0x50')]},'raw':!![]})[_0x5b2f('0x25')](function(_0x3df8ce){if(_0x3df8ce&&_0x3df8ce[_0x5b2f('0x51')]===0x0){return db[_0x5b2f('0x27')][_0x5b2f('0x4b')]({'name':_0x2dde46[_0x5b2f('0x29')],'resourceId':_0x2dde46['id'],'type':_0x3df8ce['name'],'sectionId':_0x3df8ce['id']},{})[_0x5b2f('0x25')](function(){return _0x2c6fc7;});}else{return _0x2c6fc7;}})['catch'](function(_0x4ef4e7){logger[_0x5b2f('0x28')](_0x5b2f('0x52'),_0x4ef4e7);throw _0x4ef4e7;});}return _0x2c6fc7;})[_0x5b2f('0x25')](respondWithResult(_0x36e62b,0xc9))[_0x5b2f('0x48')](handleError(_0x36e62b,null));};exports[_0x5b2f('0x24')]=function(_0x4755be,_0x1bc4dd){if(_0x4755be[_0x5b2f('0x53')]['id']){delete _0x4755be[_0x5b2f('0x53')]['id'];}return db[_0x5b2f('0x2d')][_0x5b2f('0x4f')]({'where':{'id':_0x4755be['params']['id']}})[_0x5b2f('0x25')](handleEntityNotFound(_0x1bc4dd,null))['then'](saveUpdates(_0x4755be['body'],null))[_0x5b2f('0x25')](respondWithResult(_0x1bc4dd,null))['catch'](handleError(_0x1bc4dd,null));};exports[_0x5b2f('0x26')]=function(_0x599586,_0x29db68){return db[_0x5b2f('0x2d')]['find']({'where':{'id':_0x599586[_0x5b2f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x29db68,null))['then'](removeEntity(_0x29db68,null))[_0x5b2f('0x48')](handleError(_0x29db68,null));}; \ No newline at end of file +var _0x8d73=['reject','save','update','destroy','then','get','Templates','name','send','index','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','where','merge','VIRTUAL','filter','Template','includeAll','include','findAll','catch','show','keys','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x485e81,_0x124192){var _0x14cf22=function(_0x4fe35e){while(--_0x4fe35e){_0x485e81['push'](_0x485e81['shift']());}};_0x14cf22(++_0x124192);}(_0x8d73,0x11c));var _0x38d7=function(_0xb3fdb5,_0x2e1c8f){_0xb3fdb5=_0xb3fdb5-0x0;var _0x3fb4f9=_0x8d73[_0xb3fdb5];return _0x3fb4f9;};'use strict';var emlformat=require(_0x38d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x38d7('0x1'));var jsonpatch=require(_0x38d7('0x2'));var rp=require(_0x38d7('0x3'));var moment=require(_0x38d7('0x4'));var BPromise=require(_0x38d7('0x5'));var Mustache=require(_0x38d7('0x6'));var util=require('util');var path=require(_0x38d7('0x7'));var sox=require(_0x38d7('0x8'));var csv=require(_0x38d7('0x9'));var ejs=require(_0x38d7('0xa'));var fs=require('fs');var fs_extra=require(_0x38d7('0xb'));var _=require(_0x38d7('0xc'));var squel=require(_0x38d7('0xd'));var crypto=require('crypto');var jsforce=require(_0x38d7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x38d7('0xf'));var Papa=require(_0x38d7('0x10'));var Redis=require(_0x38d7('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38d7('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x38d7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x38d7('0x14'))['db'];function respondWithStatusCode(_0x22c04f,_0x58c82d){_0x58c82d=_0x58c82d||0xcc;return function(_0x5ca24e){if(_0x5ca24e){return _0x22c04f[_0x38d7('0x15')](_0x58c82d);}return _0x22c04f[_0x38d7('0x16')](_0x58c82d)[_0x38d7('0x17')]();};}function respondWithResult(_0x24bb0d,_0x45b55d){_0x45b55d=_0x45b55d||0xc8;return function(_0x55e296){if(_0x55e296){return _0x24bb0d['status'](_0x45b55d)[_0x38d7('0x18')](_0x55e296);}};}function respondWithFilteredResult(_0x3ff2a4,_0x40d847){return function(_0x4fc152){if(_0x4fc152){var _0x483cfd=typeof _0x40d847[_0x38d7('0x19')]===_0x38d7('0x1a')&&typeof _0x40d847[_0x38d7('0x1b')]===_0x38d7('0x1a');var _0x35269b=_0x4fc152[_0x38d7('0x1c')];var _0x2329d9=_0x483cfd?0x0:_0x40d847[_0x38d7('0x19')];var _0x57910b=_0x483cfd?_0x4fc152[_0x38d7('0x1c')]:_0x40d847[_0x38d7('0x19')]+_0x40d847[_0x38d7('0x1b')];var _0xd280d0;if(_0x57910b>=_0x35269b){_0x57910b=_0x35269b;_0xd280d0=0xc8;}else{_0xd280d0=0xce;}_0x3ff2a4['status'](_0xd280d0);return _0x3ff2a4[_0x38d7('0x1d')](_0x38d7('0x1e'),_0x2329d9+'-'+_0x57910b+'/'+_0x35269b)[_0x38d7('0x18')](_0x4fc152);}return null;};}function patchUpdates(_0x38da16){return function(_0x90f50f){try{jsonpatch[_0x38d7('0x1f')](_0x90f50f,_0x38da16,!![]);}catch(_0x45e177){return BPromise[_0x38d7('0x20')](_0x45e177);}return _0x90f50f[_0x38d7('0x21')]();};}function saveUpdates(_0x193a6f,_0xd181f){return function(_0x4dcf38){if(_0x4dcf38){return _0x4dcf38[_0x38d7('0x22')](_0x193a6f)['then'](function(_0x364fe3){return _0x364fe3;});}return null;};}function removeEntity(_0x5a00c6,_0x55454f){return function(_0x551bab){if(_0x551bab){return _0x551bab[_0x38d7('0x23')]()[_0x38d7('0x24')](function(){var _0x261ef5=_0x551bab[_0x38d7('0x25')]({'plain':!![]});var _0x3f5529=_0x38d7('0x26');return db['UserProfileResource'][_0x38d7('0x23')]({'where':{'type':_0x3f5529,'resourceId':_0x261ef5['id']}})[_0x38d7('0x24')](function(){return _0x551bab;});})['then'](function(){_0x5a00c6[_0x38d7('0x16')](0xcc)[_0x38d7('0x17')]();});}};}function handleEntityNotFound(_0x40c322,_0x270998){return function(_0x1715f8){if(!_0x1715f8){_0x40c322[_0x38d7('0x15')](0x194);}return _0x1715f8;};}function handleError(_0x2845a0,_0x5e034b){_0x5e034b=_0x5e034b||0x1f4;return function(_0xf27160){logger['error'](_0xf27160['stack']);if(_0xf27160[_0x38d7('0x27')]){delete _0xf27160[_0x38d7('0x27')];}_0x2845a0['status'](_0x5e034b)[_0x38d7('0x28')](_0xf27160);};}exports[_0x38d7('0x29')]=function(_0x386454,_0x28ad0c){var _0x450fe4={},_0x2417f7={},_0x31b0b3={'count':0x0,'rows':[]};var _0x4b22db=_['map'](db['Template'][_0x38d7('0x2a')],function(_0x3cd8b1){return{'name':_0x3cd8b1[_0x38d7('0x2b')],'type':_0x3cd8b1[_0x38d7('0x2c')][_0x38d7('0x2d')]};});_0x2417f7[_0x38d7('0x2e')]=_[_0x38d7('0x2f')](_0x4b22db,'name');_0x2417f7[_0x38d7('0x30')]=_['keys'](_0x386454[_0x38d7('0x30')]);_0x2417f7['filters']=_[_0x38d7('0x31')](_0x2417f7[_0x38d7('0x2e')],_0x2417f7[_0x38d7('0x30')]);_0x450fe4[_0x38d7('0x32')]=_[_0x38d7('0x31')](_0x2417f7[_0x38d7('0x2e')],qs['fields'](_0x386454[_0x38d7('0x30')][_0x38d7('0x33')]));_0x450fe4[_0x38d7('0x32')]=_0x450fe4[_0x38d7('0x32')][_0x38d7('0x34')]?_0x450fe4[_0x38d7('0x32')]:_0x2417f7[_0x38d7('0x2e')];if(!_0x386454[_0x38d7('0x30')][_0x38d7('0x35')]('nolimit')){_0x450fe4['limit']=qs[_0x38d7('0x1b')](_0x386454['query']['limit']);_0x450fe4['offset']=qs[_0x38d7('0x19')](_0x386454[_0x38d7('0x30')][_0x38d7('0x19')]);}_0x450fe4['order']=qs[_0x38d7('0x36')](_0x386454[_0x38d7('0x30')][_0x38d7('0x36')]);_0x450fe4['where']=qs[_0x38d7('0x37')](_[_0x38d7('0x38')](_0x386454[_0x38d7('0x30')],_0x2417f7[_0x38d7('0x37')]),_0x4b22db);if(_0x386454['query']['filter']){_0x450fe4[_0x38d7('0x39')]=_[_0x38d7('0x3a')](_0x450fe4[_0x38d7('0x39')],{'$or':_[_0x38d7('0x2f')](_0x4b22db,function(_0x5afac6){if(_0x5afac6[_0x38d7('0x2c')]!==_0x38d7('0x3b')){var _0x1475f2={};_0x1475f2[_0x5afac6[_0x38d7('0x27')]]={'$like':'%'+_0x386454[_0x38d7('0x30')][_0x38d7('0x3c')]+'%'};return _0x1475f2;}})});}_0x450fe4=_['merge']({},_0x450fe4,_0x386454['options']);var _0x14a004={'where':_0x450fe4['where']};return db[_0x38d7('0x3d')][_0x38d7('0x1c')](_0x14a004)['then'](function(_0x466e2a){_0x31b0b3['count']=_0x466e2a;if(_0x386454[_0x38d7('0x30')][_0x38d7('0x3e')]){_0x450fe4[_0x38d7('0x3f')]=[{'all':!![]}];}return db[_0x38d7('0x3d')][_0x38d7('0x40')](_0x450fe4);})['then'](function(_0x33ce73){_0x31b0b3['rows']=_0x33ce73;return _0x31b0b3;})[_0x38d7('0x24')](respondWithFilteredResult(_0x28ad0c,_0x450fe4))[_0x38d7('0x41')](handleError(_0x28ad0c,null));};exports[_0x38d7('0x42')]=function(_0x44359d,_0x588b56){var _0x2c079c={'raw':!![],'where':{'id':_0x44359d['params']['id']}},_0x4a54c5={};_0x4a54c5[_0x38d7('0x2e')]=_[_0x38d7('0x43')](db[_0x38d7('0x3d')]['rawAttributes']);_0x4a54c5[_0x38d7('0x30')]=_[_0x38d7('0x43')](_0x44359d['query']);_0x4a54c5[_0x38d7('0x37')]=_['intersection'](_0x4a54c5['model'],_0x4a54c5[_0x38d7('0x30')]);_0x2c079c[_0x38d7('0x32')]=_[_0x38d7('0x31')](_0x4a54c5['model'],qs['fields'](_0x44359d['query'][_0x38d7('0x33')]));_0x2c079c['attributes']=_0x2c079c[_0x38d7('0x32')]['length']?_0x2c079c['attributes']:_0x4a54c5[_0x38d7('0x2e')];if(_0x44359d[_0x38d7('0x30')][_0x38d7('0x3e')]){_0x2c079c['include']=[{'all':!![]}];}_0x2c079c=_[_0x38d7('0x3a')]({},_0x2c079c,_0x44359d['options']);return db[_0x38d7('0x3d')][_0x38d7('0x44')](_0x2c079c)[_0x38d7('0x24')](handleEntityNotFound(_0x588b56,null))[_0x38d7('0x24')](respondWithResult(_0x588b56,null))[_0x38d7('0x41')](handleError(_0x588b56,null));};exports[_0x38d7('0x45')]=function(_0x2ca22c,_0x29d36f){return db[_0x38d7('0x3d')][_0x38d7('0x45')](_0x2ca22c[_0x38d7('0x46')],{})['then'](function(_0x45e92c){var _0x4171eb=_0x2ca22c[_0x38d7('0x47')][_0x38d7('0x25')]({'plain':!![]});if(!_0x4171eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4171eb[_0x38d7('0x48')]==='user'){var _0x4eea5d=_0x45e92c[_0x38d7('0x25')]({'plain':!![]});var _0x2e8cf4=_0x38d7('0x26');return db[_0x38d7('0x49')][_0x38d7('0x44')]({'where':{'name':_0x2e8cf4,'userProfileId':_0x4171eb[_0x38d7('0x4a')]},'raw':!![]})[_0x38d7('0x24')](function(_0x2f7cd4){if(_0x2f7cd4&&_0x2f7cd4[_0x38d7('0x4b')]===0x0){return db[_0x38d7('0x4c')][_0x38d7('0x45')]({'name':_0x4eea5d[_0x38d7('0x27')],'resourceId':_0x4eea5d['id'],'type':_0x2f7cd4[_0x38d7('0x27')],'sectionId':_0x2f7cd4['id']},{})[_0x38d7('0x24')](function(){return _0x45e92c;});}else{return _0x45e92c;}})[_0x38d7('0x41')](function(_0x510ec4){logger['error'](_0x38d7('0x4d'),_0x510ec4);throw _0x510ec4;});}return _0x45e92c;})[_0x38d7('0x24')](respondWithResult(_0x29d36f,0xc9))[_0x38d7('0x41')](handleError(_0x29d36f,null));};exports[_0x38d7('0x22')]=function(_0x4e357c,_0x40828e){if(_0x4e357c[_0x38d7('0x46')]['id']){delete _0x4e357c[_0x38d7('0x46')]['id'];}return db[_0x38d7('0x3d')][_0x38d7('0x44')]({'where':{'id':_0x4e357c['params']['id']}})[_0x38d7('0x24')](handleEntityNotFound(_0x40828e,null))[_0x38d7('0x24')](saveUpdates(_0x4e357c[_0x38d7('0x46')],null))['then'](respondWithResult(_0x40828e,null))[_0x38d7('0x41')](handleError(_0x40828e,null));};exports[_0x38d7('0x23')]=function(_0x4edf24,_0x44c1a1){return db[_0x38d7('0x3d')][_0x38d7('0x44')]({'where':{'id':_0x4edf24[_0x38d7('0x4e')]['id']}})[_0x38d7('0x24')](handleEntityNotFound(_0x44c1a1,null))[_0x38d7('0x24')](removeEntity(_0x44c1a1,null))['catch'](handleError(_0x44c1a1,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 28d4e52..f635121 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 _0xb0d9=['Template','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./template.attributes','exports'];(function(_0x2761a0,_0x59b0e6){var _0xe8c366=function(_0x5e36ad){while(--_0x5e36ad){_0x2761a0['push'](_0x2761a0['shift']());}};_0xe8c366(++_0x59b0e6);}(_0xb0d9,0x1a8));var _0x9b0d=function(_0x36c596,_0x2c8107){_0x36c596=_0x36c596-0x0;var _0x179aa3=_0xb0d9[_0x36c596];return _0x179aa3;};'use strict';var _=require(_0x9b0d('0x0'));var util=require('util');var logger=require(_0x9b0d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9b0d('0x2'));var rp=require(_0x9b0d('0x3'));var fs=require('fs');var path=require(_0x9b0d('0x4'));var rimraf=require('rimraf');var config=require(_0x9b0d('0x5'));var attributes=require(_0x9b0d('0x6'));module[_0x9b0d('0x7')]=function(_0x5afbd4,_0x3575ea){return _0x5afbd4['define'](_0x9b0d('0x8'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe381=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','lodash','util'];(function(_0xbac63a,_0xfc7132){var _0x551652=function(_0x31557c){while(--_0x31557c){_0xbac63a['push'](_0xbac63a['shift']());}};_0x551652(++_0xfc7132);}(_0xe381,0xdb));var _0x1e38=function(_0x4d3924,_0x327b56){_0x4d3924=_0x4d3924-0x0;var _0x844555=_0xe381[_0x4d3924];return _0x844555;};'use strict';var _=require(_0x1e38('0x0'));var util=require(_0x1e38('0x1'));var logger=require(_0x1e38('0x2'))(_0x1e38('0x3'));var moment=require(_0x1e38('0x4'));var BPromise=require(_0x1e38('0x5'));var rp=require(_0x1e38('0x6'));var fs=require('fs');var path=require(_0x1e38('0x7'));var rimraf=require(_0x1e38('0x8'));var config=require(_0x1e38('0x9'));var attributes=require(_0x1e38('0xa'));module[_0x1e38('0xb')]=function(_0x416391,_0x48eca4){return _0x416391[_0x1e38('0xc')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 11508e2..213f45f 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 _0xdc09=['options','raw','where','attributes','limit','include','map','model','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTemplate','Template','findAll'];(function(_0x310669,_0xea2d6a){var _0xd86097=function(_0x19a5e5){while(--_0x19a5e5){_0x310669['push'](_0x310669['shift']());}};_0xd86097(++_0xea2d6a);}(_0xdc09,0xc2));var _0x9dc0=function(_0x867b0a,_0x587ccf){_0x867b0a=_0x867b0a-0x0;var _0x137438=_0xdc09[_0x867b0a];return _0x137438;};'use strict';var _=require('lodash');var util=require(_0x9dc0('0x0'));var moment=require(_0x9dc0('0x1'));var BPromise=require(_0x9dc0('0x2'));var rs=require(_0x9dc0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9dc0('0x4'));var logger=require(_0x9dc0('0x5'))('rpc');var config=require(_0x9dc0('0x6'));var jayson=require(_0x9dc0('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16b586,_0x12a353,_0x2a7fb8){return new BPromise(function(_0x1abd4e,_0x353fb1){return client[_0x9dc0('0x8')](_0x16b586,_0x2a7fb8)[_0x9dc0('0x9')](function(_0xbb57ec){logger[_0x9dc0('0xa')](_0x9dc0('0xb'),_0x12a353,_0x9dc0('0xc'));logger[_0x9dc0('0xd')](_0x9dc0('0xe'),_0x12a353,'request\x20sent',JSON[_0x9dc0('0xf')](_0xbb57ec));if(_0xbb57ec[_0x9dc0('0x10')]){if(_0xbb57ec[_0x9dc0('0x10')]['code']===0x1f4){logger[_0x9dc0('0x10')](_0x9dc0('0xb'),_0x12a353,_0xbb57ec[_0x9dc0('0x10')][_0x9dc0('0x11')]);return _0x353fb1(_0xbb57ec[_0x9dc0('0x10')][_0x9dc0('0x11')]);}logger[_0x9dc0('0x10')](_0x9dc0('0xb'),_0x12a353,_0xbb57ec[_0x9dc0('0x10')]['message']);return _0x1abd4e(_0xbb57ec[_0x9dc0('0x10')]['message']);}else{logger[_0x9dc0('0xa')](_0x9dc0('0xb'),_0x12a353,_0x9dc0('0xc'));_0x1abd4e(_0xbb57ec[_0x9dc0('0x12')][_0x9dc0('0x11')]);}})[_0x9dc0('0x13')](function(_0xce7ffc){logger['error'](_0x9dc0('0xb'),_0x12a353,_0xce7ffc);_0x353fb1(_0xce7ffc);});});}exports[_0x9dc0('0x14')]=function(_0x4dda7c){var _0x41b62b=this;return new Promise(function(_0x375b33,_0x20627a){return db[_0x9dc0('0x15')][_0x9dc0('0x16')]({'raw':_0x4dda7c['options']?_0x4dda7c[_0x9dc0('0x17')][_0x9dc0('0x18')]===undefined?!![]:![]:!![],'where':_0x4dda7c[_0x9dc0('0x17')]?_0x4dda7c[_0x9dc0('0x17')][_0x9dc0('0x19')]||null:null,'attributes':_0x4dda7c['options']?_0x4dda7c[_0x9dc0('0x17')][_0x9dc0('0x1a')]||null:null,'limit':_0x4dda7c['options']?_0x4dda7c[_0x9dc0('0x17')][_0x9dc0('0x1b')]||null:null,'include':_0x4dda7c['options']?_0x4dda7c[_0x9dc0('0x17')][_0x9dc0('0x1c')]?_[_0x9dc0('0x1d')](_0x4dda7c[_0x9dc0('0x17')][_0x9dc0('0x1c')],function(_0x350075){return{'model':db[_0x350075['model']],'as':_0x350075['as'],'attributes':_0x350075[_0x9dc0('0x1a')],'include':_0x350075['include']?_['map'](_0x350075[_0x9dc0('0x1c')],function(_0x1ba196){return{'model':db[_0x1ba196[_0x9dc0('0x1e')]],'as':_0x1ba196['as'],'attributes':_0x1ba196[_0x9dc0('0x1a')],'include':_0x1ba196['include']?_['map'](_0x1ba196[_0x9dc0('0x1c')],function(_0x50c92c){return{'model':db[_0x50c92c[_0x9dc0('0x1e')]],'as':_0x50c92c['as'],'attributes':_0x50c92c['attributes']};}):[]};}):[]};}):[]:[]})[_0x9dc0('0x9')](function(_0x1eb6e5){logger[_0x9dc0('0xa')](_0x9dc0('0x14'),_0x4dda7c);logger[_0x9dc0('0xd')](_0x9dc0('0x14'),_0x4dda7c,JSON['stringify'](_0x1eb6e5));_0x375b33(_0x1eb6e5);})[_0x9dc0('0x13')](function(_0x4804c8){logger[_0x9dc0('0x10')](_0x9dc0('0x14'),_0x4804c8[_0x9dc0('0x11')],_0x4dda7c);_0x20627a(_0x41b62b[_0x9dc0('0x10')](0x1f4,_0x4804c8[_0x9dc0('0x11')]));});});}; \ No newline at end of file +var _0x3dac=['../../config/utils','rpc','../../config/environment','client','http','request','info','Template,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','where','include','map','attributes','model','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1b96ae,_0x11cd19){var _0x394985=function(_0x581c14){while(--_0x581c14){_0x1b96ae['push'](_0x1b96ae['shift']());}};_0x394985(++_0x11cd19);}(_0x3dac,0xe1));var _0xc3da=function(_0x20becb,_0x2a2e41){_0x20becb=_0x20becb-0x0;var _0x42752b=_0x3dac[_0x20becb];return _0x42752b;};'use strict';var _=require(_0xc3da('0x0'));var util=require(_0xc3da('0x1'));var moment=require('moment');var BPromise=require(_0xc3da('0x2'));var rs=require(_0xc3da('0x3'));var fs=require('fs');var Redis=require(_0xc3da('0x4'));var db=require(_0xc3da('0x5'))['db'];var utils=require(_0xc3da('0x6'));var logger=require('../../config/logger')(_0xc3da('0x7'));var config=require(_0xc3da('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc3da('0x9')][_0xc3da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b5ed7,_0x3f8edd,_0x402fcd){return new BPromise(function(_0xb66cff,_0x3482f1){return client[_0xc3da('0xb')](_0x4b5ed7,_0x402fcd)['then'](function(_0xe67572){logger[_0xc3da('0xc')](_0xc3da('0xd'),_0x3f8edd,'request\x20sent');logger[_0xc3da('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x3f8edd,_0xc3da('0xf'),JSON[_0xc3da('0x10')](_0xe67572));if(_0xe67572[_0xc3da('0x11')]){if(_0xe67572[_0xc3da('0x11')][_0xc3da('0x12')]===0x1f4){logger[_0xc3da('0x11')](_0xc3da('0xd'),_0x3f8edd,_0xe67572[_0xc3da('0x11')]['message']);return _0x3482f1(_0xe67572[_0xc3da('0x11')]['message']);}logger['error'](_0xc3da('0xd'),_0x3f8edd,_0xe67572['error'][_0xc3da('0x13')]);return _0xb66cff(_0xe67572[_0xc3da('0x11')][_0xc3da('0x13')]);}else{logger[_0xc3da('0xc')]('Template,\x20%s,\x20%s',_0x3f8edd,'request\x20sent');_0xb66cff(_0xe67572[_0xc3da('0x14')][_0xc3da('0x13')]);}})[_0xc3da('0x15')](function(_0x524979){logger[_0xc3da('0x11')]('Template,\x20%s,\x20%s',_0x3f8edd,_0x524979);_0x3482f1(_0x524979);});});}exports[_0xc3da('0x16')]=function(_0x4857bd){var _0x326ef9=this;return new Promise(function(_0x38b3c1,_0x145b45){return db[_0xc3da('0x17')][_0xc3da('0x18')]({'raw':_0x4857bd['options']?_0x4857bd[_0xc3da('0x19')][_0xc3da('0x1a')]===undefined?!![]:![]:!![],'where':_0x4857bd[_0xc3da('0x19')]?_0x4857bd['options'][_0xc3da('0x1b')]||null:null,'attributes':_0x4857bd[_0xc3da('0x19')]?_0x4857bd['options']['attributes']||null:null,'limit':_0x4857bd[_0xc3da('0x19')]?_0x4857bd[_0xc3da('0x19')]['limit']||null:null,'include':_0x4857bd[_0xc3da('0x19')]?_0x4857bd[_0xc3da('0x19')][_0xc3da('0x1c')]?_[_0xc3da('0x1d')](_0x4857bd[_0xc3da('0x19')][_0xc3da('0x1c')],function(_0x2adea4){return{'model':db[_0x2adea4['model']],'as':_0x2adea4['as'],'attributes':_0x2adea4[_0xc3da('0x1e')],'include':_0x2adea4[_0xc3da('0x1c')]?_[_0xc3da('0x1d')](_0x2adea4[_0xc3da('0x1c')],function(_0x1879f6){return{'model':db[_0x1879f6[_0xc3da('0x1f')]],'as':_0x1879f6['as'],'attributes':_0x1879f6[_0xc3da('0x1e')],'include':_0x1879f6[_0xc3da('0x1c')]?_[_0xc3da('0x1d')](_0x1879f6['include'],function(_0x4e0e09){return{'model':db[_0x4e0e09[_0xc3da('0x1f')]],'as':_0x4e0e09['as'],'attributes':_0x4e0e09[_0xc3da('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc3da('0x20')](function(_0x1218b5){logger['info'](_0xc3da('0x16'),_0x4857bd);logger['debug'](_0xc3da('0x16'),_0x4857bd,JSON['stringify'](_0x1218b5));_0x38b3c1(_0x1218b5);})[_0xc3da('0x15')](function(_0x1eb625){logger[_0xc3da('0x11')](_0xc3da('0x16'),_0x1eb625[_0xc3da('0x13')],_0x4857bd);_0x145b45(_0x326ef9['error'](0x1f4,_0x1eb625[_0xc3da('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index d8432e4..e1ca18f 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 _0xa2b7=['./trigger.controller','get','index','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAnyCondition','addAction','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa2b7,0xd9));var _0x7a2b=function(_0x5cabfd,_0x5dea47){_0x5cabfd=_0x5cabfd-0x0;var _0x4bc06c=_0xa2b7[_0x5cabfd];return _0x4bc06c;};'use strict';var multer=require(_0x7a2b('0x0'));var util=require(_0x7a2b('0x1'));var path=require('path');var timeout=require(_0x7a2b('0x2'));var express=require('express');var router=express[_0x7a2b('0x3')]();var fs_extra=require(_0x7a2b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7a2b('0x5'));var config=require(_0x7a2b('0x6'));var controller=require(_0x7a2b('0x7'));router[_0x7a2b('0x8')]('/',auth['isAuthenticated'](),controller[_0x7a2b('0x9')]);router[_0x7a2b('0x8')]('/:id',auth[_0x7a2b('0xa')](),controller[_0x7a2b('0xb')]);router[_0x7a2b('0x8')](_0x7a2b('0xc'),auth['isAuthenticated'](),controller[_0x7a2b('0xd')]);router['get'](_0x7a2b('0xe'),auth[_0x7a2b('0xa')](),controller[_0x7a2b('0xf')]);router[_0x7a2b('0x8')](_0x7a2b('0x10'),auth[_0x7a2b('0xa')](),controller[_0x7a2b('0x11')]);router['post']('/',auth[_0x7a2b('0xa')](),controller[_0x7a2b('0x12')]);router[_0x7a2b('0x13')]('/:id/all_conditions',auth[_0x7a2b('0xa')](),controller['addAllCondition']);router[_0x7a2b('0x13')](_0x7a2b('0xe'),auth['isAuthenticated'](),controller[_0x7a2b('0x14')]);router[_0x7a2b('0x13')](_0x7a2b('0x10'),auth['isAuthenticated'](),controller[_0x7a2b('0x15')]);router[_0x7a2b('0x16')](_0x7a2b('0x17'),auth[_0x7a2b('0xa')](),controller[_0x7a2b('0x18')]);router[_0x7a2b('0x19')](_0x7a2b('0x17'),auth['isAuthenticated'](),controller[_0x7a2b('0x1a')]);module[_0x7a2b('0x1b')]=router; \ No newline at end of file +var _0xd1a2=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','addAllCondition','addAnyCondition','addAction','update','destroy','exports'];(function(_0x175e65,_0x36e14f){var _0x2161c6=function(_0x49b687){while(--_0x49b687){_0x175e65['push'](_0x175e65['shift']());}};_0x2161c6(++_0x36e14f);}(_0xd1a2,0x190));var _0x2d1a=function(_0x3a0cab,_0x3c0820){_0x3a0cab=_0x3a0cab-0x0;var _0x39bd0d=_0xd1a2[_0x3a0cab];return _0x39bd0d;};'use strict';var multer=require(_0x2d1a('0x0'));var util=require(_0x2d1a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2d1a('0x2'));var router=express[_0x2d1a('0x3')]();var fs_extra=require(_0x2d1a('0x4'));var auth=require(_0x2d1a('0x5'));var interaction=require(_0x2d1a('0x6'));var config=require(_0x2d1a('0x7'));var controller=require('./trigger.controller');router['get']('/',auth[_0x2d1a('0x8')](),controller[_0x2d1a('0x9')]);router[_0x2d1a('0xa')](_0x2d1a('0xb'),auth[_0x2d1a('0x8')](),controller[_0x2d1a('0xc')]);router[_0x2d1a('0xa')](_0x2d1a('0xd'),auth[_0x2d1a('0x8')](),controller[_0x2d1a('0xe')]);router[_0x2d1a('0xa')](_0x2d1a('0xf'),auth[_0x2d1a('0x8')](),controller[_0x2d1a('0x10')]);router[_0x2d1a('0xa')](_0x2d1a('0x11'),auth['isAuthenticated'](),controller['getActions']);router[_0x2d1a('0x12')]('/',auth[_0x2d1a('0x8')](),controller['create']);router['post'](_0x2d1a('0xd'),auth['isAuthenticated'](),controller[_0x2d1a('0x13')]);router[_0x2d1a('0x12')](_0x2d1a('0xf'),auth[_0x2d1a('0x8')](),controller[_0x2d1a('0x14')]);router['post']('/:id/actions',auth[_0x2d1a('0x8')](),controller[_0x2d1a('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2d1a('0x16')]);router['delete'](_0x2d1a('0xb'),auth[_0x2d1a('0x8')](),controller[_0x2d1a('0x17')]);module[_0x2d1a('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 480c03c..d419b58 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 _0x3450=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3b9cf1,_0x5cc906){var _0x5d4992=function(_0x32bf1a){while(--_0x32bf1a){_0x3b9cf1['push'](_0x3b9cf1['shift']());}};_0x5d4992(++_0x5cc906);}(_0x3450,0x14b));var _0x0345=function(_0x3a196b,_0x1a03c4){_0x3a196b=_0x3a196b-0x0;var _0x192dd8=_0x3450[_0x3a196b];return _0x192dd8;};'use strict';var Sequelize=require(_0x0345('0x0'));module[_0x0345('0x1')]={'name':{'type':Sequelize[_0x0345('0x2')]},'channel':{'type':Sequelize[_0x0345('0x2')]},'description':{'type':Sequelize[_0x0345('0x2')]},'status':{'type':Sequelize[_0x0345('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x84c7=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x84c7,0x6f));var _0x784c=function(_0x449aa4,_0x3ab067){_0x449aa4=_0x449aa4-0x0;var _0xc4e420=_0x84c7[_0x449aa4];return _0xc4e420;};'use strict';var Sequelize=require(_0x784c('0x0'));module[_0x784c('0x1')]={'name':{'type':Sequelize[_0x784c('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x784c('0x2')]},'status':{'type':Sequelize[_0x784c('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 6900a1d..5332666 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 _0x408c=['then','destroy','get','Triggers','UserProfileResource','stack','name','index','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','Trigger','include','findAll','rows','catch','show','params','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','pick','hasOwnProperty','getAnyConditions','addAction','getActions','Action','rimraf','request-promise','bluebird','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update'];(function(_0x470170,_0x454483){var _0x2cc1cc=function(_0x212a4c){while(--_0x212a4c){_0x470170['push'](_0x470170['shift']());}};_0x2cc1cc(++_0x454483);}(_0x408c,0xf8));var _0xc408=function(_0x229a6b,_0x5e4a9a){_0x229a6b=_0x229a6b-0x0;var _0x5edf49=_0x408c[_0x229a6b];return _0x5edf49;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc408('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc408('0x1'));var moment=require('moment');var BPromise=require(_0xc408('0x2'));var Mustache=require('mustache');var util=require(_0xc408('0x3'));var path=require('path');var sox=require(_0xc408('0x4'));var csv=require('to-csv');var ejs=require(_0xc408('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc408('0x6'));var crypto=require(_0xc408('0x7'));var jsforce=require(_0xc408('0x8'));var deskjs=require(_0xc408('0x9'));var toCsv=require(_0xc408('0xa'));var querystring=require(_0xc408('0xb'));var Papa=require(_0xc408('0xc'));var Redis=require(_0xc408('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc408('0xe'));var as=require(_0xc408('0xf'));var hardwareService=require(_0xc408('0x10'));var logger=require(_0xc408('0x11'))(_0xc408('0x12'));var utils=require(_0xc408('0x13'));var config=require(_0xc408('0x14'));var licenseUtil=require(_0xc408('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a0aa,_0x544441){_0x544441=_0x544441||0xcc;return function(_0x21b83a){if(_0x21b83a){return _0x18a0aa[_0xc408('0x16')](_0x544441);}return _0x18a0aa[_0xc408('0x17')](_0x544441)[_0xc408('0x18')]();};}function respondWithResult(_0x465284,_0x118374){_0x118374=_0x118374||0xc8;return function(_0x111203){if(_0x111203){return _0x465284[_0xc408('0x17')](_0x118374)[_0xc408('0x19')](_0x111203);}};}function respondWithFilteredResult(_0x4ee2e9,_0x5acbdd){return function(_0x178e9e){if(_0x178e9e){var _0xb941b6=typeof _0x5acbdd[_0xc408('0x1a')]===_0xc408('0x1b')&&typeof _0x5acbdd[_0xc408('0x1c')]==='undefined';var _0x57324f=_0x178e9e[_0xc408('0x1d')];var _0x91fab8=_0xb941b6?0x0:_0x5acbdd['offset'];var _0x2ea9c3=_0xb941b6?_0x178e9e[_0xc408('0x1d')]:_0x5acbdd[_0xc408('0x1a')]+_0x5acbdd[_0xc408('0x1c')];var _0x9e783b;if(_0x2ea9c3>=_0x57324f){_0x2ea9c3=_0x57324f;_0x9e783b=0xc8;}else{_0x9e783b=0xce;}_0x4ee2e9[_0xc408('0x17')](_0x9e783b);return _0x4ee2e9['set'](_0xc408('0x1e'),_0x91fab8+'-'+_0x2ea9c3+'/'+_0x57324f)['json'](_0x178e9e);}return null;};}function patchUpdates(_0xa9c0cd){return function(_0x54bd27){try{jsonpatch[_0xc408('0x1f')](_0x54bd27,_0xa9c0cd,!![]);}catch(_0x569eb9){return BPromise[_0xc408('0x20')](_0x569eb9);}return _0x54bd27['save']();};}function saveUpdates(_0x35f167,_0x522189){return function(_0x5bd662){if(_0x5bd662){return _0x5bd662[_0xc408('0x21')](_0x35f167)[_0xc408('0x22')](function(_0x4e7832){return _0x4e7832;});}return null;};}function removeEntity(_0x36e4b9,_0x2b41f8){return function(_0x3804b8){if(_0x3804b8){return _0x3804b8[_0xc408('0x23')]()[_0xc408('0x22')](function(){var _0x365fd7=_0x3804b8[_0xc408('0x24')]({'plain':!![]});var _0x384487=_0xc408('0x25');return db[_0xc408('0x26')]['destroy']({'where':{'type':_0x384487,'resourceId':_0x365fd7['id']}})[_0xc408('0x22')](function(){return _0x3804b8;});})['then'](function(){_0x36e4b9[_0xc408('0x17')](0xcc)[_0xc408('0x18')]();});}};}function handleEntityNotFound(_0x533fa9,_0x5de54c){return function(_0x433eaf){if(!_0x433eaf){_0x533fa9[_0xc408('0x16')](0x194);}return _0x433eaf;};}function handleError(_0x597eda,_0x4e9c9d){_0x4e9c9d=_0x4e9c9d||0x1f4;return function(_0x1219f6){logger['error'](_0x1219f6[_0xc408('0x27')]);if(_0x1219f6['name']){delete _0x1219f6[_0xc408('0x28')];}_0x597eda[_0xc408('0x17')](_0x4e9c9d)['send'](_0x1219f6);};}exports[_0xc408('0x29')]=function(_0x4c0fde,_0xf46ab){var _0x3e89ac={},_0x3e3393={},_0x4c72fe={'count':0x0,'rows':[]};var _0x48b0fb=_['map'](db['Trigger'][_0xc408('0x2a')],function(_0x27ce76){return{'name':_0x27ce76[_0xc408('0x2b')],'type':_0x27ce76[_0xc408('0x2c')]['key']};});_0x3e3393[_0xc408('0x2d')]=_['map'](_0x48b0fb,'name');_0x3e3393[_0xc408('0x2e')]=_[_0xc408('0x2f')](_0x4c0fde[_0xc408('0x2e')]);_0x3e3393[_0xc408('0x30')]=_['intersection'](_0x3e3393[_0xc408('0x2d')],_0x3e3393['query']);_0x3e89ac[_0xc408('0x31')]=_['intersection'](_0x3e3393[_0xc408('0x2d')],qs['fields'](_0x4c0fde[_0xc408('0x2e')][_0xc408('0x32')]));_0x3e89ac[_0xc408('0x31')]=_0x3e89ac[_0xc408('0x31')][_0xc408('0x33')]?_0x3e89ac[_0xc408('0x31')]:_0x3e3393[_0xc408('0x2d')];if(!_0x4c0fde[_0xc408('0x2e')]['hasOwnProperty'](_0xc408('0x34'))){_0x3e89ac['limit']=qs[_0xc408('0x1c')](_0x4c0fde[_0xc408('0x2e')][_0xc408('0x1c')]);_0x3e89ac['offset']=qs[_0xc408('0x1a')](_0x4c0fde[_0xc408('0x2e')]['offset']);}_0x3e89ac[_0xc408('0x35')]=qs[_0xc408('0x36')](_0x4c0fde[_0xc408('0x2e')]['sort']);_0x3e89ac[_0xc408('0x37')]=qs['filters'](_['pick'](_0x4c0fde[_0xc408('0x2e')],_0x3e3393[_0xc408('0x30')]),_0x48b0fb);if(_0x4c0fde[_0xc408('0x2e')][_0xc408('0x38')]){_0x3e89ac[_0xc408('0x37')]=_[_0xc408('0x39')](_0x3e89ac[_0xc408('0x37')],{'$or':_[_0xc408('0x3a')](_0x48b0fb,function(_0x1b8dc2){if(_0x1b8dc2[_0xc408('0x2c')]!==_0xc408('0x3b')){var _0x5f726f={};_0x5f726f[_0x1b8dc2[_0xc408('0x28')]]={'$like':'%'+_0x4c0fde[_0xc408('0x2e')]['filter']+'%'};return _0x5f726f;}})});}_0x3e89ac=_[_0xc408('0x39')]({},_0x3e89ac,_0x4c0fde[_0xc408('0x3c')]);var _0x1fcc08={'where':_0x3e89ac[_0xc408('0x37')]};return db[_0xc408('0x3d')][_0xc408('0x1d')](_0x1fcc08)[_0xc408('0x22')](function(_0x19af47){_0x4c72fe[_0xc408('0x1d')]=_0x19af47;if(_0x4c0fde[_0xc408('0x2e')]['includeAll']){_0x3e89ac[_0xc408('0x3e')]=[{'all':!![]}];}return db[_0xc408('0x3d')][_0xc408('0x3f')](_0x3e89ac);})['then'](function(_0x4d8efc){_0x4c72fe[_0xc408('0x40')]=_0x4d8efc;return _0x4c72fe;})[_0xc408('0x22')](respondWithFilteredResult(_0xf46ab,_0x3e89ac))[_0xc408('0x41')](handleError(_0xf46ab,null));};exports[_0xc408('0x42')]=function(_0x40849b,_0x319361){var _0x470c9b={'raw':![],'where':{'id':_0x40849b[_0xc408('0x43')]['id']}},_0x2c6e34={};_0x2c6e34[_0xc408('0x2d')]=_[_0xc408('0x2f')](db[_0xc408('0x3d')][_0xc408('0x2a')]);_0x2c6e34['query']=_[_0xc408('0x2f')](_0x40849b[_0xc408('0x2e')]);_0x2c6e34[_0xc408('0x30')]=_[_0xc408('0x44')](_0x2c6e34['model'],_0x2c6e34[_0xc408('0x2e')]);_0x470c9b[_0xc408('0x31')]=_[_0xc408('0x44')](_0x2c6e34[_0xc408('0x2d')],qs[_0xc408('0x32')](_0x40849b['query'][_0xc408('0x32')]));_0x470c9b[_0xc408('0x31')]=_0x470c9b[_0xc408('0x31')][_0xc408('0x33')]?_0x470c9b['attributes']:_0x2c6e34[_0xc408('0x2d')];if(_0x40849b[_0xc408('0x2e')][_0xc408('0x45')]){_0x470c9b[_0xc408('0x3e')]=[{'all':!![]}];}_0x470c9b=_[_0xc408('0x39')]({},_0x470c9b,_0x40849b[_0xc408('0x3c')]);return db[_0xc408('0x3d')][_0xc408('0x46')](_0x470c9b)[_0xc408('0x22')](handleEntityNotFound(_0x319361,null))[_0xc408('0x22')](respondWithResult(_0x319361,null))[_0xc408('0x41')](handleError(_0x319361,null));};exports[_0xc408('0x47')]=function(_0x37e1ec,_0x2f7f52){return db[_0xc408('0x3d')][_0xc408('0x47')](_0x37e1ec[_0xc408('0x48')],{})[_0xc408('0x22')](function(_0x185305){var _0x45552c=_0x37e1ec[_0xc408('0x49')]['get']({'plain':!![]});if(!_0x45552c)throw new Error(_0xc408('0x4a'));if(_0x45552c[_0xc408('0x4b')]===_0xc408('0x49')){var _0x4252cf=_0x185305[_0xc408('0x24')]({'plain':!![]});var _0x4d3d5b=_0xc408('0x25');return db[_0xc408('0x4c')][_0xc408('0x46')]({'where':{'name':_0x4d3d5b,'userProfileId':_0x45552c[_0xc408('0x4d')]},'raw':!![]})[_0xc408('0x22')](function(_0x1e0e3f){if(_0x1e0e3f&&_0x1e0e3f[_0xc408('0x4e')]===0x0){return db[_0xc408('0x26')][_0xc408('0x47')]({'name':_0x4252cf['name'],'resourceId':_0x4252cf['id'],'type':_0x1e0e3f[_0xc408('0x28')],'sectionId':_0x1e0e3f['id']},{})[_0xc408('0x22')](function(){return _0x185305;});}else{return _0x185305;}})[_0xc408('0x41')](function(_0x24e8e6){logger[_0xc408('0x4f')](_0xc408('0x50'),_0x24e8e6);throw _0x24e8e6;});}return _0x185305;})[_0xc408('0x22')](respondWithResult(_0x2f7f52,0xc9))[_0xc408('0x41')](handleError(_0x2f7f52,null));};exports['update']=function(_0x268520,_0x57b89c){if(_0x268520[_0xc408('0x48')]['id']){delete _0x268520[_0xc408('0x48')]['id'];}return db[_0xc408('0x3d')]['find']({'where':{'id':_0x268520[_0xc408('0x43')]['id']}})[_0xc408('0x22')](handleEntityNotFound(_0x57b89c,null))['then'](saveUpdates(_0x268520[_0xc408('0x48')],null))[_0xc408('0x22')](respondWithResult(_0x57b89c,null))[_0xc408('0x41')](handleError(_0x57b89c,null));};exports[_0xc408('0x23')]=function(_0x2424dc,_0x2ffce2){return db['Trigger'][_0xc408('0x46')]({'where':{'id':_0x2424dc[_0xc408('0x43')]['id']}})['then'](handleEntityNotFound(_0x2ffce2,null))[_0xc408('0x22')](removeEntity(_0x2ffce2,null))['catch'](handleError(_0x2ffce2,null));};exports[_0xc408('0x51')]=function(_0x373d39,_0x697abd,_0x373142){if(_0x373d39[_0xc408('0x48')]['id']){delete _0x373d39[_0xc408('0x48')]['id'];}return db[_0xc408('0x3d')][_0xc408('0x46')]({'where':{'id':_0x373d39[_0xc408('0x43')]['id']}})[_0xc408('0x22')](handleEntityNotFound(_0x697abd,null))[_0xc408('0x22')](function(_0x233992){if(_0x233992){_0x373d39[_0xc408('0x48')][_0xc408('0x52')]=_0x233992['id'];return db[_0xc408('0x53')][_0xc408('0x47')](_0x373d39['body']);}})[_0xc408('0x22')](respondWithResult(_0x697abd,null))[_0xc408('0x41')](handleError(_0x697abd,null));};exports[_0xc408('0x54')]=function(_0x235e8b,_0x54459d,_0x522279){if(_0x235e8b[_0xc408('0x48')]['id']){delete _0x235e8b[_0xc408('0x48')]['id'];}return db[_0xc408('0x3d')][_0xc408('0x46')]({'where':{'id':_0x235e8b[_0xc408('0x43')]['id']}})[_0xc408('0x22')](handleEntityNotFound(_0x54459d,null))[_0xc408('0x22')](function(_0xac95b1){if(_0xac95b1){_0x235e8b[_0xc408('0x48')][_0xc408('0x55')]=_0xac95b1['id'];return db[_0xc408('0x53')][_0xc408('0x47')](_0x235e8b[_0xc408('0x48')]);}})[_0xc408('0x22')](respondWithResult(_0x54459d,null))[_0xc408('0x41')](handleError(_0x54459d,null));};exports[_0xc408('0x56')]=function(_0x2f6d8c,_0xdfdf0d,_0x5e0b3f){var _0x504bde={};var _0x5380c0={};var _0x5fbbc5;var _0x2bc6a2;return db['Trigger'][_0xc408('0x57')]({'where':{'id':_0x2f6d8c[_0xc408('0x43')]['id']}})[_0xc408('0x22')](handleEntityNotFound(_0xdfdf0d,null))[_0xc408('0x22')](function(_0x36d2c2){if(_0x36d2c2){_0x5fbbc5=_0x36d2c2;_0x5380c0['model']=_[_0xc408('0x2f')](db[_0xc408('0x53')]['rawAttributes']);_0x5380c0[_0xc408('0x2e')]=_[_0xc408('0x2f')](_0x2f6d8c[_0xc408('0x2e')]);_0x5380c0[_0xc408('0x30')]=_[_0xc408('0x44')](_0x5380c0[_0xc408('0x2d')],_0x5380c0[_0xc408('0x2e')]);_0x504bde[_0xc408('0x31')]=_[_0xc408('0x44')](_0x5380c0['model'],qs['fields'](_0x2f6d8c['query'][_0xc408('0x32')]));_0x504bde[_0xc408('0x31')]=_0x504bde['attributes'][_0xc408('0x33')]?_0x504bde[_0xc408('0x31')]:_0x5380c0['model'];_0x504bde[_0xc408('0x35')]=qs[_0xc408('0x36')](_0x2f6d8c[_0xc408('0x2e')]['sort']);_0x504bde[_0xc408('0x37')]=qs['filters'](_[_0xc408('0x58')](_0x2f6d8c[_0xc408('0x2e')],_0x5380c0[_0xc408('0x30')]));if(_0x2f6d8c[_0xc408('0x2e')][_0xc408('0x38')]){_0x504bde[_0xc408('0x37')]=_['merge'](_0x504bde[_0xc408('0x37')],{'$or':_[_0xc408('0x3a')](_0x504bde[_0xc408('0x31')],function(_0x4f7081){var _0x147427={};_0x147427[_0x4f7081]={'$like':'%'+_0x2f6d8c['query']['filter']+'%'};return _0x147427;})});}_0x504bde=_['merge']({},_0x504bde,_0x2f6d8c[_0xc408('0x3c')]);return _0x5fbbc5[_0xc408('0x56')](_0x504bde);}})[_0xc408('0x22')](function(_0x2ba156){if(_0x2ba156){_0x2bc6a2=_0x2ba156[_0xc408('0x33')];if(!_0x2f6d8c[_0xc408('0x2e')][_0xc408('0x59')]('nolimit')){_0x504bde[_0xc408('0x1c')]=qs[_0xc408('0x1c')](_0x2f6d8c['query'][_0xc408('0x1c')]);_0x504bde[_0xc408('0x1a')]=qs['offset'](_0x2f6d8c[_0xc408('0x2e')][_0xc408('0x1a')]);}return _0x5fbbc5[_0xc408('0x56')](_0x504bde);}})[_0xc408('0x22')](function(_0x535913){if(_0x535913){return _0x535913?{'count':_0x2bc6a2,'rows':_0x535913}:null;}})[_0xc408('0x22')](respondWithResult(_0xdfdf0d,null))[_0xc408('0x41')](handleError(_0xdfdf0d,null));};exports['getAnyConditions']=function(_0x336b6f,_0x1cb33e,_0x45e7f7){var _0x5a7b31={};var _0x552862={};var _0x2ce352;var _0x4a27d1;return db[_0xc408('0x3d')][_0xc408('0x57')]({'where':{'id':_0x336b6f[_0xc408('0x43')]['id']}})['then'](handleEntityNotFound(_0x1cb33e,null))[_0xc408('0x22')](function(_0x3ec6e0){if(_0x3ec6e0){_0x2ce352=_0x3ec6e0;_0x552862[_0xc408('0x2d')]=_[_0xc408('0x2f')](db[_0xc408('0x53')]['rawAttributes']);_0x552862[_0xc408('0x2e')]=_[_0xc408('0x2f')](_0x336b6f['query']);_0x552862['filters']=_[_0xc408('0x44')](_0x552862[_0xc408('0x2d')],_0x552862[_0xc408('0x2e')]);_0x5a7b31[_0xc408('0x31')]=_[_0xc408('0x44')](_0x552862[_0xc408('0x2d')],qs['fields'](_0x336b6f[_0xc408('0x2e')][_0xc408('0x32')]));_0x5a7b31['attributes']=_0x5a7b31[_0xc408('0x31')]['length']?_0x5a7b31[_0xc408('0x31')]:_0x552862[_0xc408('0x2d')];_0x5a7b31['order']=qs[_0xc408('0x36')](_0x336b6f[_0xc408('0x2e')][_0xc408('0x36')]);_0x5a7b31[_0xc408('0x37')]=qs[_0xc408('0x30')](_[_0xc408('0x58')](_0x336b6f[_0xc408('0x2e')],_0x552862[_0xc408('0x30')]));if(_0x336b6f[_0xc408('0x2e')][_0xc408('0x38')]){_0x5a7b31['where']=_[_0xc408('0x39')](_0x5a7b31[_0xc408('0x37')],{'$or':_[_0xc408('0x3a')](_0x5a7b31[_0xc408('0x31')],function(_0x4e9b0d){var _0x37fdb7={};_0x37fdb7[_0x4e9b0d]={'$like':'%'+_0x336b6f[_0xc408('0x2e')]['filter']+'%'};return _0x37fdb7;})});}_0x5a7b31=_[_0xc408('0x39')]({},_0x5a7b31,_0x336b6f[_0xc408('0x3c')]);return _0x2ce352[_0xc408('0x5a')](_0x5a7b31);}})[_0xc408('0x22')](function(_0x488183){if(_0x488183){_0x4a27d1=_0x488183[_0xc408('0x33')];if(!_0x336b6f['query']['hasOwnProperty'](_0xc408('0x34'))){_0x5a7b31[_0xc408('0x1c')]=qs['limit'](_0x336b6f[_0xc408('0x2e')]['limit']);_0x5a7b31['offset']=qs[_0xc408('0x1a')](_0x336b6f[_0xc408('0x2e')][_0xc408('0x1a')]);}return _0x2ce352['getAnyConditions'](_0x5a7b31);}})[_0xc408('0x22')](function(_0x4bd287){if(_0x4bd287){return _0x4bd287?{'count':_0x4a27d1,'rows':_0x4bd287}:null;}})[_0xc408('0x22')](respondWithResult(_0x1cb33e,null))['catch'](handleError(_0x1cb33e,null));};exports[_0xc408('0x5b')]=function(_0x34cc3e,_0x5e0ecb,_0x4e3a34){if(_0x34cc3e['body']['id']){delete _0x34cc3e['body']['id'];}return db[_0xc408('0x3d')][_0xc408('0x46')]({'where':{'id':_0x34cc3e[_0xc408('0x43')]['id']}})[_0xc408('0x22')](handleEntityNotFound(_0x5e0ecb,null))[_0xc408('0x22')](function(_0x80bc91){if(_0x80bc91){_0x34cc3e['body']['TriggerId']=_0x80bc91['id'];return db['Action'][_0xc408('0x47')](_0x34cc3e[_0xc408('0x48')]);}})['then'](respondWithResult(_0x5e0ecb,null))[_0xc408('0x41')](handleError(_0x5e0ecb,null));};exports[_0xc408('0x5c')]=function(_0x39ab41,_0x56ac80,_0x4a0f9e){var _0x42ec82={};var _0x359f18={};var _0x5c0593;var _0x2953e6;return db[_0xc408('0x3d')]['findOne']({'where':{'id':_0x39ab41[_0xc408('0x43')]['id']}})[_0xc408('0x22')](handleEntityNotFound(_0x56ac80,null))[_0xc408('0x22')](function(_0x513808){if(_0x513808){_0x5c0593=_0x513808;_0x359f18['model']=_[_0xc408('0x2f')](db[_0xc408('0x5d')]['rawAttributes']);_0x359f18[_0xc408('0x2e')]=_['keys'](_0x39ab41['query']);_0x359f18[_0xc408('0x30')]=_[_0xc408('0x44')](_0x359f18[_0xc408('0x2d')],_0x359f18[_0xc408('0x2e')]);_0x42ec82[_0xc408('0x31')]=_[_0xc408('0x44')](_0x359f18[_0xc408('0x2d')],qs['fields'](_0x39ab41[_0xc408('0x2e')][_0xc408('0x32')]));_0x42ec82[_0xc408('0x31')]=_0x42ec82[_0xc408('0x31')][_0xc408('0x33')]?_0x42ec82[_0xc408('0x31')]:_0x359f18[_0xc408('0x2d')];_0x42ec82['order']=qs['sort'](_0x39ab41[_0xc408('0x2e')][_0xc408('0x36')]);_0x42ec82['where']=qs[_0xc408('0x30')](_['pick'](_0x39ab41[_0xc408('0x2e')],_0x359f18['filters']));if(_0x39ab41[_0xc408('0x2e')][_0xc408('0x38')]){_0x42ec82[_0xc408('0x37')]=_[_0xc408('0x39')](_0x42ec82[_0xc408('0x37')],{'$or':_[_0xc408('0x3a')](_0x42ec82[_0xc408('0x31')],function(_0x7bfe6){var _0xf55020={};_0xf55020[_0x7bfe6]={'$like':'%'+_0x39ab41['query'][_0xc408('0x38')]+'%'};return _0xf55020;})});}_0x42ec82=_[_0xc408('0x39')]({},_0x42ec82,_0x39ab41['options']);return _0x5c0593['getActions'](_0x42ec82);}})[_0xc408('0x22')](function(_0x2be4e7){if(_0x2be4e7){_0x2953e6=_0x2be4e7[_0xc408('0x33')];if(!_0x39ab41['query'][_0xc408('0x59')]('nolimit')){_0x42ec82['limit']=qs[_0xc408('0x1c')](_0x39ab41[_0xc408('0x2e')][_0xc408('0x1c')]);_0x42ec82[_0xc408('0x1a')]=qs[_0xc408('0x1a')](_0x39ab41['query'][_0xc408('0x1a')]);}return _0x5c0593[_0xc408('0x5c')](_0x42ec82);}})[_0xc408('0x22')](function(_0x261bea){if(_0x261bea){return _0x261bea?{'count':_0x2953e6,'rows':_0x261bea}:null;}})['then'](respondWithResult(_0x56ac80,null))[_0xc408('0x41')](handleError(_0x56ac80,null));}; \ No newline at end of file +var _0x3d71=['save','update','then','destroy','get','Triggers','UserProfileResource','name','send','index','map','Trigger','fieldName','type','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','length','options','find','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','hasOwnProperty','getAnyConditions','getActions','Action','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject'];(function(_0x5ab18b,_0x38ed8f){var _0x5dafb6=function(_0x412969){while(--_0x412969){_0x5ab18b['push'](_0x5ab18b['shift']());}};_0x5dafb6(++_0x38ed8f);}(_0x3d71,0x131));var _0x13d7=function(_0x53bb74,_0x590c3e){_0x53bb74=_0x53bb74-0x0;var _0x286b70=_0x3d71[_0x53bb74];return _0x286b70;};'use strict';var emlformat=require(_0x13d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x13d7('0x1'));var jsonpatch=require(_0x13d7('0x2'));var rp=require(_0x13d7('0x3'));var moment=require(_0x13d7('0x4'));var BPromise=require(_0x13d7('0x5'));var Mustache=require(_0x13d7('0x6'));var util=require(_0x13d7('0x7'));var path=require('path');var sox=require(_0x13d7('0x8'));var csv=require(_0x13d7('0x9'));var ejs=require(_0x13d7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x13d7('0xb'));var crypto=require(_0x13d7('0xc'));var jsforce=require(_0x13d7('0xd'));var deskjs=require(_0x13d7('0xe'));var toCsv=require(_0x13d7('0x9'));var querystring=require(_0x13d7('0xf'));var Papa=require('papaparse');var Redis=require(_0x13d7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x13d7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x13d7('0x12'));var utils=require(_0x13d7('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5367c0,_0x429af1){_0x429af1=_0x429af1||0xcc;return function(_0x28dd8e){if(_0x28dd8e){return _0x5367c0['sendStatus'](_0x429af1);}return _0x5367c0[_0x13d7('0x14')](_0x429af1)[_0x13d7('0x15')]();};}function respondWithResult(_0x3306ab,_0x47b010){_0x47b010=_0x47b010||0xc8;return function(_0x5d7e84){if(_0x5d7e84){return _0x3306ab['status'](_0x47b010)[_0x13d7('0x16')](_0x5d7e84);}};}function respondWithFilteredResult(_0x5e7751,_0x40f1fb){return function(_0x2172bf){if(_0x2172bf){var _0x1f23d9=typeof _0x40f1fb[_0x13d7('0x17')]===_0x13d7('0x18')&&typeof _0x40f1fb['limit']==='undefined';var _0x3ad482=_0x2172bf['count'];var _0x5a4c52=_0x1f23d9?0x0:_0x40f1fb[_0x13d7('0x17')];var _0x2c7d65=_0x1f23d9?_0x2172bf[_0x13d7('0x19')]:_0x40f1fb[_0x13d7('0x17')]+_0x40f1fb[_0x13d7('0x1a')];var _0x3d0688;if(_0x2c7d65>=_0x3ad482){_0x2c7d65=_0x3ad482;_0x3d0688=0xc8;}else{_0x3d0688=0xce;}_0x5e7751[_0x13d7('0x14')](_0x3d0688);return _0x5e7751[_0x13d7('0x1b')](_0x13d7('0x1c'),_0x5a4c52+'-'+_0x2c7d65+'/'+_0x3ad482)[_0x13d7('0x16')](_0x2172bf);}return null;};}function patchUpdates(_0x585746){return function(_0x2ae742){try{jsonpatch[_0x13d7('0x1d')](_0x2ae742,_0x585746,!![]);}catch(_0x3a0d0a){return BPromise[_0x13d7('0x1e')](_0x3a0d0a);}return _0x2ae742[_0x13d7('0x1f')]();};}function saveUpdates(_0xfadfa8,_0xd6b722){return function(_0x5251d1){if(_0x5251d1){return _0x5251d1[_0x13d7('0x20')](_0xfadfa8)[_0x13d7('0x21')](function(_0x40edf2){return _0x40edf2;});}return null;};}function removeEntity(_0x99deca,_0x1be0f3){return function(_0x158a58){if(_0x158a58){return _0x158a58[_0x13d7('0x22')]()['then'](function(){var _0x3b0664=_0x158a58[_0x13d7('0x23')]({'plain':!![]});var _0x155a25=_0x13d7('0x24');return db[_0x13d7('0x25')][_0x13d7('0x22')]({'where':{'type':_0x155a25,'resourceId':_0x3b0664['id']}})['then'](function(){return _0x158a58;});})[_0x13d7('0x21')](function(){_0x99deca[_0x13d7('0x14')](0xcc)[_0x13d7('0x15')]();});}};}function handleEntityNotFound(_0x2fe548,_0xc34d5f){return function(_0x353dd6){if(!_0x353dd6){_0x2fe548['sendStatus'](0x194);}return _0x353dd6;};}function handleError(_0x597895,_0x573de2){_0x573de2=_0x573de2||0x1f4;return function(_0x466f92){logger['error'](_0x466f92['stack']);if(_0x466f92[_0x13d7('0x26')]){delete _0x466f92[_0x13d7('0x26')];}_0x597895[_0x13d7('0x14')](_0x573de2)[_0x13d7('0x27')](_0x466f92);};}exports[_0x13d7('0x28')]=function(_0x39f403,_0x331f63){var _0x1ac6f7={},_0x42a280={},_0x3f70cb={'count':0x0,'rows':[]};var _0x2f65fe=_[_0x13d7('0x29')](db[_0x13d7('0x2a')]['rawAttributes'],function(_0x4194d1){return{'name':_0x4194d1[_0x13d7('0x2b')],'type':_0x4194d1[_0x13d7('0x2c')]['key']};});_0x42a280[_0x13d7('0x2d')]=_[_0x13d7('0x29')](_0x2f65fe,_0x13d7('0x26'));_0x42a280[_0x13d7('0x2e')]=_[_0x13d7('0x2f')](_0x39f403[_0x13d7('0x2e')]);_0x42a280['filters']=_[_0x13d7('0x30')](_0x42a280[_0x13d7('0x2d')],_0x42a280['query']);_0x1ac6f7['attributes']=_['intersection'](_0x42a280['model'],qs[_0x13d7('0x31')](_0x39f403['query']['fields']));_0x1ac6f7[_0x13d7('0x32')]=_0x1ac6f7[_0x13d7('0x32')]['length']?_0x1ac6f7['attributes']:_0x42a280[_0x13d7('0x2d')];if(!_0x39f403['query']['hasOwnProperty'](_0x13d7('0x33'))){_0x1ac6f7[_0x13d7('0x1a')]=qs['limit'](_0x39f403['query'][_0x13d7('0x1a')]);_0x1ac6f7[_0x13d7('0x17')]=qs['offset'](_0x39f403[_0x13d7('0x2e')][_0x13d7('0x17')]);}_0x1ac6f7[_0x13d7('0x34')]=qs['sort'](_0x39f403[_0x13d7('0x2e')][_0x13d7('0x35')]);_0x1ac6f7[_0x13d7('0x36')]=qs[_0x13d7('0x37')](_[_0x13d7('0x38')](_0x39f403[_0x13d7('0x2e')],_0x42a280[_0x13d7('0x37')]),_0x2f65fe);if(_0x39f403[_0x13d7('0x2e')][_0x13d7('0x39')]){_0x1ac6f7[_0x13d7('0x36')]=_[_0x13d7('0x3a')](_0x1ac6f7[_0x13d7('0x36')],{'$or':_[_0x13d7('0x29')](_0x2f65fe,function(_0x57b697){if(_0x57b697['type']!=='VIRTUAL'){var _0x479692={};_0x479692[_0x57b697[_0x13d7('0x26')]]={'$like':'%'+_0x39f403['query'][_0x13d7('0x39')]+'%'};return _0x479692;}})});}_0x1ac6f7=_[_0x13d7('0x3a')]({},_0x1ac6f7,_0x39f403['options']);var _0x26873b={'where':_0x1ac6f7[_0x13d7('0x36')]};return db[_0x13d7('0x2a')][_0x13d7('0x19')](_0x26873b)[_0x13d7('0x21')](function(_0x476eb6){_0x3f70cb[_0x13d7('0x19')]=_0x476eb6;if(_0x39f403['query'][_0x13d7('0x3b')]){_0x1ac6f7[_0x13d7('0x3c')]=[{'all':!![]}];}return db[_0x13d7('0x2a')][_0x13d7('0x3d')](_0x1ac6f7);})[_0x13d7('0x21')](function(_0x50a7c3){_0x3f70cb[_0x13d7('0x3e')]=_0x50a7c3;return _0x3f70cb;})[_0x13d7('0x21')](respondWithFilteredResult(_0x331f63,_0x1ac6f7))[_0x13d7('0x3f')](handleError(_0x331f63,null));};exports['show']=function(_0x372b4b,_0x54299b){var _0x4d6a38={'raw':![],'where':{'id':_0x372b4b[_0x13d7('0x40')]['id']}},_0x514c14={};_0x514c14[_0x13d7('0x2d')]=_[_0x13d7('0x2f')](db[_0x13d7('0x2a')][_0x13d7('0x41')]);_0x514c14[_0x13d7('0x2e')]=_['keys'](_0x372b4b[_0x13d7('0x2e')]);_0x514c14['filters']=_[_0x13d7('0x30')](_0x514c14['model'],_0x514c14[_0x13d7('0x2e')]);_0x4d6a38[_0x13d7('0x32')]=_['intersection'](_0x514c14[_0x13d7('0x2d')],qs[_0x13d7('0x31')](_0x372b4b['query']['fields']));_0x4d6a38[_0x13d7('0x32')]=_0x4d6a38['attributes'][_0x13d7('0x42')]?_0x4d6a38[_0x13d7('0x32')]:_0x514c14[_0x13d7('0x2d')];if(_0x372b4b['query'][_0x13d7('0x3b')]){_0x4d6a38['include']=[{'all':!![]}];}_0x4d6a38=_[_0x13d7('0x3a')]({},_0x4d6a38,_0x372b4b[_0x13d7('0x43')]);return db['Trigger'][_0x13d7('0x44')](_0x4d6a38)[_0x13d7('0x21')](handleEntityNotFound(_0x54299b,null))[_0x13d7('0x21')](respondWithResult(_0x54299b,null))[_0x13d7('0x3f')](handleError(_0x54299b,null));};exports[_0x13d7('0x45')]=function(_0xa7a20c,_0x103ddc){return db[_0x13d7('0x2a')][_0x13d7('0x45')](_0xa7a20c[_0x13d7('0x46')],{})[_0x13d7('0x21')](function(_0x9c3f5){var _0xb8f0ae=_0xa7a20c[_0x13d7('0x47')][_0x13d7('0x23')]({'plain':!![]});if(!_0xb8f0ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb8f0ae['role']===_0x13d7('0x47')){var _0x5f4aed=_0x9c3f5[_0x13d7('0x23')]({'plain':!![]});var _0x552d25='Triggers';return db[_0x13d7('0x48')][_0x13d7('0x44')]({'where':{'name':_0x552d25,'userProfileId':_0xb8f0ae['userProfileId']},'raw':!![]})[_0x13d7('0x21')](function(_0x5c4f72){if(_0x5c4f72&&_0x5c4f72[_0x13d7('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x5f4aed[_0x13d7('0x26')],'resourceId':_0x5f4aed['id'],'type':_0x5c4f72[_0x13d7('0x26')],'sectionId':_0x5c4f72['id']},{})[_0x13d7('0x21')](function(){return _0x9c3f5;});}else{return _0x9c3f5;}})['catch'](function(_0x43a1aa){logger['error'](_0x13d7('0x4a'),_0x43a1aa);throw _0x43a1aa;});}return _0x9c3f5;})[_0x13d7('0x21')](respondWithResult(_0x103ddc,0xc9))[_0x13d7('0x3f')](handleError(_0x103ddc,null));};exports[_0x13d7('0x20')]=function(_0x14283e,_0x1bc14f){if(_0x14283e[_0x13d7('0x46')]['id']){delete _0x14283e[_0x13d7('0x46')]['id'];}return db['Trigger']['find']({'where':{'id':_0x14283e['params']['id']}})[_0x13d7('0x21')](handleEntityNotFound(_0x1bc14f,null))[_0x13d7('0x21')](saveUpdates(_0x14283e[_0x13d7('0x46')],null))[_0x13d7('0x21')](respondWithResult(_0x1bc14f,null))[_0x13d7('0x3f')](handleError(_0x1bc14f,null));};exports['destroy']=function(_0x4ca60d,_0x5e4ba4){return db[_0x13d7('0x2a')][_0x13d7('0x44')]({'where':{'id':_0x4ca60d['params']['id']}})[_0x13d7('0x21')](handleEntityNotFound(_0x5e4ba4,null))[_0x13d7('0x21')](removeEntity(_0x5e4ba4,null))[_0x13d7('0x3f')](handleError(_0x5e4ba4,null));};exports['addAllCondition']=function(_0x582bc0,_0x3bc884,_0x170879){if(_0x582bc0[_0x13d7('0x46')]['id']){delete _0x582bc0['body']['id'];}return db[_0x13d7('0x2a')][_0x13d7('0x44')]({'where':{'id':_0x582bc0[_0x13d7('0x40')]['id']}})[_0x13d7('0x21')](handleEntityNotFound(_0x3bc884,null))[_0x13d7('0x21')](function(_0x3f65e7){if(_0x3f65e7){_0x582bc0[_0x13d7('0x46')]['TriggerAllId']=_0x3f65e7['id'];return db[_0x13d7('0x4b')]['create'](_0x582bc0['body']);}})['then'](respondWithResult(_0x3bc884,null))[_0x13d7('0x3f')](handleError(_0x3bc884,null));};exports[_0x13d7('0x4c')]=function(_0x4663b2,_0x5de410,_0x22f3cd){if(_0x4663b2[_0x13d7('0x46')]['id']){delete _0x4663b2[_0x13d7('0x46')]['id'];}return db['Trigger'][_0x13d7('0x44')]({'where':{'id':_0x4663b2[_0x13d7('0x40')]['id']}})[_0x13d7('0x21')](handleEntityNotFound(_0x5de410,null))[_0x13d7('0x21')](function(_0x2ea4bd){if(_0x2ea4bd){_0x4663b2['body'][_0x13d7('0x4d')]=_0x2ea4bd['id'];return db['Condition'][_0x13d7('0x45')](_0x4663b2['body']);}})[_0x13d7('0x21')](respondWithResult(_0x5de410,null))['catch'](handleError(_0x5de410,null));};exports[_0x13d7('0x4e')]=function(_0x1efd4b,_0xdb487c,_0x24148c){var _0x24937b={};var _0x50ece1={};var _0x628e31;var _0x49111d;return db[_0x13d7('0x2a')][_0x13d7('0x4f')]({'where':{'id':_0x1efd4b[_0x13d7('0x40')]['id']}})['then'](handleEntityNotFound(_0xdb487c,null))[_0x13d7('0x21')](function(_0x10f372){if(_0x10f372){_0x628e31=_0x10f372;_0x50ece1[_0x13d7('0x2d')]=_['keys'](db[_0x13d7('0x4b')][_0x13d7('0x41')]);_0x50ece1[_0x13d7('0x2e')]=_[_0x13d7('0x2f')](_0x1efd4b[_0x13d7('0x2e')]);_0x50ece1[_0x13d7('0x37')]=_[_0x13d7('0x30')](_0x50ece1[_0x13d7('0x2d')],_0x50ece1[_0x13d7('0x2e')]);_0x24937b[_0x13d7('0x32')]=_[_0x13d7('0x30')](_0x50ece1[_0x13d7('0x2d')],qs['fields'](_0x1efd4b[_0x13d7('0x2e')]['fields']));_0x24937b['attributes']=_0x24937b[_0x13d7('0x32')][_0x13d7('0x42')]?_0x24937b[_0x13d7('0x32')]:_0x50ece1['model'];_0x24937b[_0x13d7('0x34')]=qs[_0x13d7('0x35')](_0x1efd4b[_0x13d7('0x2e')][_0x13d7('0x35')]);_0x24937b[_0x13d7('0x36')]=qs[_0x13d7('0x37')](_[_0x13d7('0x38')](_0x1efd4b[_0x13d7('0x2e')],_0x50ece1[_0x13d7('0x37')]));if(_0x1efd4b[_0x13d7('0x2e')][_0x13d7('0x39')]){_0x24937b['where']=_[_0x13d7('0x3a')](_0x24937b[_0x13d7('0x36')],{'$or':_[_0x13d7('0x29')](_0x24937b[_0x13d7('0x32')],function(_0x254e47){var _0x3ac770={};_0x3ac770[_0x254e47]={'$like':'%'+_0x1efd4b['query']['filter']+'%'};return _0x3ac770;})});}_0x24937b=_[_0x13d7('0x3a')]({},_0x24937b,_0x1efd4b[_0x13d7('0x43')]);return _0x628e31[_0x13d7('0x4e')](_0x24937b);}})[_0x13d7('0x21')](function(_0x3eafdd){if(_0x3eafdd){_0x49111d=_0x3eafdd[_0x13d7('0x42')];if(!_0x1efd4b['query'][_0x13d7('0x50')]('nolimit')){_0x24937b['limit']=qs[_0x13d7('0x1a')](_0x1efd4b[_0x13d7('0x2e')]['limit']);_0x24937b['offset']=qs['offset'](_0x1efd4b[_0x13d7('0x2e')][_0x13d7('0x17')]);}return _0x628e31[_0x13d7('0x4e')](_0x24937b);}})[_0x13d7('0x21')](function(_0x2dc5ec){if(_0x2dc5ec){return _0x2dc5ec?{'count':_0x49111d,'rows':_0x2dc5ec}:null;}})[_0x13d7('0x21')](respondWithResult(_0xdb487c,null))[_0x13d7('0x3f')](handleError(_0xdb487c,null));};exports[_0x13d7('0x51')]=function(_0xb42091,_0x26299c,_0x2227ff){var _0x1bb5f9={};var _0x2a9bb1={};var _0x4a3659;var _0x565e59;return db[_0x13d7('0x2a')][_0x13d7('0x4f')]({'where':{'id':_0xb42091[_0x13d7('0x40')]['id']}})[_0x13d7('0x21')](handleEntityNotFound(_0x26299c,null))[_0x13d7('0x21')](function(_0x5ef9bc){if(_0x5ef9bc){_0x4a3659=_0x5ef9bc;_0x2a9bb1[_0x13d7('0x2d')]=_[_0x13d7('0x2f')](db[_0x13d7('0x4b')][_0x13d7('0x41')]);_0x2a9bb1[_0x13d7('0x2e')]=_[_0x13d7('0x2f')](_0xb42091[_0x13d7('0x2e')]);_0x2a9bb1[_0x13d7('0x37')]=_[_0x13d7('0x30')](_0x2a9bb1[_0x13d7('0x2d')],_0x2a9bb1[_0x13d7('0x2e')]);_0x1bb5f9[_0x13d7('0x32')]=_[_0x13d7('0x30')](_0x2a9bb1[_0x13d7('0x2d')],qs[_0x13d7('0x31')](_0xb42091[_0x13d7('0x2e')][_0x13d7('0x31')]));_0x1bb5f9[_0x13d7('0x32')]=_0x1bb5f9[_0x13d7('0x32')]['length']?_0x1bb5f9[_0x13d7('0x32')]:_0x2a9bb1[_0x13d7('0x2d')];_0x1bb5f9[_0x13d7('0x34')]=qs[_0x13d7('0x35')](_0xb42091[_0x13d7('0x2e')][_0x13d7('0x35')]);_0x1bb5f9['where']=qs[_0x13d7('0x37')](_[_0x13d7('0x38')](_0xb42091[_0x13d7('0x2e')],_0x2a9bb1['filters']));if(_0xb42091[_0x13d7('0x2e')]['filter']){_0x1bb5f9[_0x13d7('0x36')]=_[_0x13d7('0x3a')](_0x1bb5f9[_0x13d7('0x36')],{'$or':_[_0x13d7('0x29')](_0x1bb5f9['attributes'],function(_0x3a13c8){var _0x261efe={};_0x261efe[_0x3a13c8]={'$like':'%'+_0xb42091[_0x13d7('0x2e')][_0x13d7('0x39')]+'%'};return _0x261efe;})});}_0x1bb5f9=_[_0x13d7('0x3a')]({},_0x1bb5f9,_0xb42091[_0x13d7('0x43')]);return _0x4a3659[_0x13d7('0x51')](_0x1bb5f9);}})[_0x13d7('0x21')](function(_0x3fecc4){if(_0x3fecc4){_0x565e59=_0x3fecc4[_0x13d7('0x42')];if(!_0xb42091[_0x13d7('0x2e')][_0x13d7('0x50')](_0x13d7('0x33'))){_0x1bb5f9[_0x13d7('0x1a')]=qs['limit'](_0xb42091[_0x13d7('0x2e')][_0x13d7('0x1a')]);_0x1bb5f9[_0x13d7('0x17')]=qs[_0x13d7('0x17')](_0xb42091['query'][_0x13d7('0x17')]);}return _0x4a3659[_0x13d7('0x51')](_0x1bb5f9);}})['then'](function(_0x4ece0d){if(_0x4ece0d){return _0x4ece0d?{'count':_0x565e59,'rows':_0x4ece0d}:null;}})[_0x13d7('0x21')](respondWithResult(_0x26299c,null))[_0x13d7('0x3f')](handleError(_0x26299c,null));};exports['addAction']=function(_0xbbba88,_0x209d04,_0x188ae0){if(_0xbbba88[_0x13d7('0x46')]['id']){delete _0xbbba88[_0x13d7('0x46')]['id'];}return db[_0x13d7('0x2a')][_0x13d7('0x44')]({'where':{'id':_0xbbba88[_0x13d7('0x40')]['id']}})[_0x13d7('0x21')](handleEntityNotFound(_0x209d04,null))[_0x13d7('0x21')](function(_0x5adbb6){if(_0x5adbb6){_0xbbba88[_0x13d7('0x46')]['TriggerId']=_0x5adbb6['id'];return db['Action'][_0x13d7('0x45')](_0xbbba88[_0x13d7('0x46')]);}})[_0x13d7('0x21')](respondWithResult(_0x209d04,null))[_0x13d7('0x3f')](handleError(_0x209d04,null));};exports[_0x13d7('0x52')]=function(_0x192ed0,_0x394169,_0x127906){var _0x4e0529={};var _0xa360b8={};var _0xdbc910;var _0x419e50;return db[_0x13d7('0x2a')][_0x13d7('0x4f')]({'where':{'id':_0x192ed0['params']['id']}})[_0x13d7('0x21')](handleEntityNotFound(_0x394169,null))[_0x13d7('0x21')](function(_0x3045ec){if(_0x3045ec){_0xdbc910=_0x3045ec;_0xa360b8[_0x13d7('0x2d')]=_[_0x13d7('0x2f')](db[_0x13d7('0x53')][_0x13d7('0x41')]);_0xa360b8['query']=_['keys'](_0x192ed0[_0x13d7('0x2e')]);_0xa360b8['filters']=_[_0x13d7('0x30')](_0xa360b8[_0x13d7('0x2d')],_0xa360b8['query']);_0x4e0529[_0x13d7('0x32')]=_[_0x13d7('0x30')](_0xa360b8[_0x13d7('0x2d')],qs[_0x13d7('0x31')](_0x192ed0[_0x13d7('0x2e')][_0x13d7('0x31')]));_0x4e0529[_0x13d7('0x32')]=_0x4e0529['attributes'][_0x13d7('0x42')]?_0x4e0529[_0x13d7('0x32')]:_0xa360b8['model'];_0x4e0529[_0x13d7('0x34')]=qs[_0x13d7('0x35')](_0x192ed0[_0x13d7('0x2e')]['sort']);_0x4e0529[_0x13d7('0x36')]=qs[_0x13d7('0x37')](_['pick'](_0x192ed0[_0x13d7('0x2e')],_0xa360b8['filters']));if(_0x192ed0[_0x13d7('0x2e')][_0x13d7('0x39')]){_0x4e0529[_0x13d7('0x36')]=_[_0x13d7('0x3a')](_0x4e0529[_0x13d7('0x36')],{'$or':_[_0x13d7('0x29')](_0x4e0529[_0x13d7('0x32')],function(_0x4ed3af){var _0x1fe5f4={};_0x1fe5f4[_0x4ed3af]={'$like':'%'+_0x192ed0[_0x13d7('0x2e')][_0x13d7('0x39')]+'%'};return _0x1fe5f4;})});}_0x4e0529=_[_0x13d7('0x3a')]({},_0x4e0529,_0x192ed0[_0x13d7('0x43')]);return _0xdbc910[_0x13d7('0x52')](_0x4e0529);}})['then'](function(_0x330089){if(_0x330089){_0x419e50=_0x330089[_0x13d7('0x42')];if(!_0x192ed0[_0x13d7('0x2e')][_0x13d7('0x50')](_0x13d7('0x33'))){_0x4e0529['limit']=qs[_0x13d7('0x1a')](_0x192ed0['query'][_0x13d7('0x1a')]);_0x4e0529['offset']=qs[_0x13d7('0x17')](_0x192ed0[_0x13d7('0x2e')][_0x13d7('0x17')]);}return _0xdbc910[_0x13d7('0x52')](_0x4e0529);}})[_0x13d7('0x21')](function(_0x4b3120){if(_0x4b3120){return _0x4b3120?{'count':_0x419e50,'rows':_0x4b3120}:null;}})[_0x13d7('0x21')](respondWithResult(_0x394169,null))[_0x13d7('0x3f')](handleError(_0x394169,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 5f5804d..62e3115 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 _0xd1d4=['util','api','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash'];(function(_0x5e25b8,_0x19bd6f){var _0x123ce4=function(_0x501183){while(--_0x501183){_0x5e25b8['push'](_0x5e25b8['shift']());}};_0x123ce4(++_0x19bd6f);}(_0xd1d4,0xfb));var _0x4d1d=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xd1d4[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0x4d1d('0x0'));var util=require(_0x4d1d('0x1'));var logger=require('../../config/logger')(_0x4d1d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4d1d('0x3'));var fs=require('fs');var path=require(_0x4d1d('0x4'));var rimraf=require(_0x4d1d('0x5'));var config=require(_0x4d1d('0x6'));var attributes=require(_0x4d1d('0x7'));module[_0x4d1d('0x8')]=function(_0x30466a,_0xb8a403){return _0x30466a[_0x4d1d('0x9')](_0x4d1d('0xa'),attributes,{'tableName':_0x4d1d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fde=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4fde,0x19f));var _0xe4fd=function(_0x3c59fc,_0x10dbd2){_0x3c59fc=_0x3c59fc-0x0;var _0x2b78d4=_0x4fde[_0x3c59fc];return _0x2b78d4;};'use strict';var _=require(_0xe4fd('0x0'));var util=require(_0xe4fd('0x1'));var logger=require(_0xe4fd('0x2'))(_0xe4fd('0x3'));var moment=require('moment');var BPromise=require(_0xe4fd('0x4'));var rp=require(_0xe4fd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4fd('0x6'));var config=require(_0xe4fd('0x7'));var attributes=require(_0xe4fd('0x8'));module[_0xe4fd('0x9')]=function(_0x464a19,_0x73219e){return _0x464a19[_0xe4fd('0xa')](_0xe4fd('0xb'),attributes,{'tableName':_0xe4fd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 1dd3bd6..c672c90 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 _0x8da5=['findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowTrigger','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','GetTrigger','Trigger'];(function(_0x1f6b4b,_0x39b510){var _0x33156f=function(_0x411eae){while(--_0x411eae){_0x1f6b4b['push'](_0x1f6b4b['shift']());}};_0x33156f(++_0x39b510);}(_0x8da5,0xb5));var _0x58da=function(_0x57a777,_0x46d31a){_0x57a777=_0x57a777-0x0;var _0x2f7882=_0x8da5[_0x57a777];return _0x2f7882;};'use strict';var _=require(_0x58da('0x0'));var util=require(_0x58da('0x1'));var moment=require(_0x58da('0x2'));var BPromise=require('bluebird');var rs=require(_0x58da('0x3'));var fs=require('fs');var Redis=require(_0x58da('0x4'));var db=require(_0x58da('0x5'))['db'];var utils=require(_0x58da('0x6'));var logger=require(_0x58da('0x7'))(_0x58da('0x8'));var config=require(_0x58da('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x58da('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e2d1e,_0xb95875,_0x5bf9d4){return new BPromise(function(_0x528cb5,_0x353e93){return client[_0x58da('0xb')](_0x1e2d1e,_0x5bf9d4)[_0x58da('0xc')](function(_0x1fba8f){logger[_0x58da('0xd')](_0x58da('0xe'),_0xb95875,_0x58da('0xf'));logger[_0x58da('0x10')](_0x58da('0x11'),_0xb95875,'request\x20sent',JSON[_0x58da('0x12')](_0x1fba8f));if(_0x1fba8f[_0x58da('0x13')]){if(_0x1fba8f[_0x58da('0x13')]['code']===0x1f4){logger['error'](_0x58da('0xe'),_0xb95875,_0x1fba8f['error'][_0x58da('0x14')]);return _0x353e93(_0x1fba8f[_0x58da('0x13')][_0x58da('0x14')]);}logger['error'](_0x58da('0xe'),_0xb95875,_0x1fba8f[_0x58da('0x13')]['message']);return _0x528cb5(_0x1fba8f[_0x58da('0x13')][_0x58da('0x14')]);}else{logger[_0x58da('0xd')](_0x58da('0xe'),_0xb95875,'request\x20sent');_0x528cb5(_0x1fba8f['result'][_0x58da('0x14')]);}})['catch'](function(_0x353583){logger[_0x58da('0x13')](_0x58da('0xe'),_0xb95875,_0x353583);_0x353e93(_0x353583);});});}exports[_0x58da('0x15')]=function(_0x251741){var _0x5b6f12=this;return new Promise(function(_0x543f2a,_0x5def16){return db[_0x58da('0x16')][_0x58da('0x17')]({'raw':_0x251741[_0x58da('0x18')]?_0x251741[_0x58da('0x18')][_0x58da('0x19')]===undefined?!![]:![]:!![],'where':_0x251741[_0x58da('0x18')]?_0x251741[_0x58da('0x18')][_0x58da('0x1a')]||null:null,'attributes':_0x251741[_0x58da('0x18')]?_0x251741[_0x58da('0x18')][_0x58da('0x1b')]||null:null,'limit':_0x251741['options']?_0x251741[_0x58da('0x18')][_0x58da('0x1c')]||null:null,'include':_0x251741['options']?_0x251741[_0x58da('0x18')][_0x58da('0x1d')]?_[_0x58da('0x1e')](_0x251741[_0x58da('0x18')][_0x58da('0x1d')],function(_0x38360e){return{'model':db[_0x38360e[_0x58da('0x1f')]],'as':_0x38360e['as'],'attributes':_0x38360e[_0x58da('0x1b')],'include':_0x38360e['include']?_[_0x58da('0x1e')](_0x38360e['include'],function(_0x4a272e){return{'model':db[_0x4a272e[_0x58da('0x1f')]],'as':_0x4a272e['as'],'attributes':_0x4a272e['attributes'],'include':_0x4a272e[_0x58da('0x1d')]?_[_0x58da('0x1e')](_0x4a272e[_0x58da('0x1d')],function(_0x5cc923){return{'model':db[_0x5cc923[_0x58da('0x1f')]],'as':_0x5cc923['as'],'attributes':_0x5cc923[_0x58da('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x58da('0xc')](function(_0x4712d7){logger[_0x58da('0xd')](_0x58da('0x15'),_0x251741);logger[_0x58da('0x10')]('GetTrigger',_0x251741,JSON[_0x58da('0x12')](_0x4712d7));_0x543f2a(_0x4712d7);})[_0x58da('0x20')](function(_0x175d0f){logger[_0x58da('0x13')](_0x58da('0x15'),_0x175d0f[_0x58da('0x14')],_0x251741);_0x5def16(_0x5b6f12[_0x58da('0x13')](0x1f4,_0x175d0f[_0x58da('0x14')]));});});};exports[_0x58da('0x21')]=function(_0x470bb6){var _0x25838=this;return new Promise(function(_0x43e7b6,_0x353a4e){return db[_0x58da('0x16')]['find']({'raw':_0x470bb6[_0x58da('0x18')]?_0x470bb6[_0x58da('0x18')][_0x58da('0x19')]===undefined?!![]:![]:!![],'where':_0x470bb6[_0x58da('0x18')]?_0x470bb6[_0x58da('0x18')][_0x58da('0x1a')]||null:null,'attributes':_0x470bb6['options']?_0x470bb6['options'][_0x58da('0x1b')]||null:null,'include':_0x470bb6[_0x58da('0x18')]?_0x470bb6['options'][_0x58da('0x1d')]?_[_0x58da('0x1e')](_0x470bb6[_0x58da('0x18')][_0x58da('0x1d')],function(_0xca0d7e){return{'model':db[_0xca0d7e['model']],'as':_0xca0d7e['as'],'attributes':_0xca0d7e['attributes'],'include':_0xca0d7e['include']?_[_0x58da('0x1e')](_0xca0d7e[_0x58da('0x1d')],function(_0x1e4a1e){return{'model':db[_0x1e4a1e['model']],'as':_0x1e4a1e['as'],'attributes':_0x1e4a1e['attributes'],'include':_0x1e4a1e[_0x58da('0x1d')]?_['map'](_0x1e4a1e['include'],function(_0x156bff){return{'model':db[_0x156bff[_0x58da('0x1f')]],'as':_0x156bff['as'],'attributes':_0x156bff['attributes']};}):[]};}):[]};}):[]:[]})[_0x58da('0xc')](function(_0xd1ea67){logger[_0x58da('0xd')](_0x58da('0x21'),_0x470bb6);logger[_0x58da('0x10')](_0x58da('0x21'),_0x470bb6,JSON[_0x58da('0x12')](_0xd1ea67));_0x43e7b6(_0xd1ea67);})['catch'](function(_0x8f1a28){logger[_0x58da('0x13')](_0x58da('0x21'),_0x8f1a28[_0x58da('0x14')],_0x470bb6);_0x353a4e(_0x25838[_0x58da('0x13')](0x1f4,_0x8f1a28[_0x58da('0x14')]));});});}; \ No newline at end of file +var _0xecaf=['then','info','request\x20sent','debug','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','limit','include','map','model','attributes','find','ShowTrigger','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x410263,_0xca0aac){var _0x584882=function(_0x338d99){while(--_0x338d99){_0x410263['push'](_0x410263['shift']());}};_0x584882(++_0xca0aac);}(_0xecaf,0xd1));var _0xfeca=function(_0x4d953b,_0x3c85ba){_0x4d953b=_0x4d953b-0x0;var _0x285ec0=_0xecaf[_0x4d953b];return _0x285ec0;};'use strict';var _=require(_0xfeca('0x0'));var util=require(_0xfeca('0x1'));var moment=require(_0xfeca('0x2'));var BPromise=require('bluebird');var rs=require(_0xfeca('0x3'));var fs=require('fs');var Redis=require(_0xfeca('0x4'));var db=require(_0xfeca('0x5'))['db'];var utils=require(_0xfeca('0x6'));var logger=require(_0xfeca('0x7'))(_0xfeca('0x8'));var config=require(_0xfeca('0x9'));var jayson=require(_0xfeca('0xa'));var client=jayson['client'][_0xfeca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x245591,_0x171ae7,_0x3c06e4){return new BPromise(function(_0x4af177,_0x371cd7){return client[_0xfeca('0xc')](_0x245591,_0x3c06e4)[_0xfeca('0xd')](function(_0x3d5fcd){logger[_0xfeca('0xe')]('Trigger,\x20%s,\x20%s',_0x171ae7,_0xfeca('0xf'));logger[_0xfeca('0x10')]('Trigger,\x20%s,\x20%s,\x20%s',_0x171ae7,_0xfeca('0xf'),JSON[_0xfeca('0x11')](_0x3d5fcd));if(_0x3d5fcd[_0xfeca('0x12')]){if(_0x3d5fcd[_0xfeca('0x12')][_0xfeca('0x13')]===0x1f4){logger['error'](_0xfeca('0x14'),_0x171ae7,_0x3d5fcd[_0xfeca('0x12')][_0xfeca('0x15')]);return _0x371cd7(_0x3d5fcd['error']['message']);}logger[_0xfeca('0x12')](_0xfeca('0x14'),_0x171ae7,_0x3d5fcd[_0xfeca('0x12')][_0xfeca('0x15')]);return _0x4af177(_0x3d5fcd[_0xfeca('0x12')][_0xfeca('0x15')]);}else{logger[_0xfeca('0xe')]('Trigger,\x20%s,\x20%s',_0x171ae7,_0xfeca('0xf'));_0x4af177(_0x3d5fcd[_0xfeca('0x16')][_0xfeca('0x15')]);}})[_0xfeca('0x17')](function(_0x30092c){logger['error'](_0xfeca('0x14'),_0x171ae7,_0x30092c);_0x371cd7(_0x30092c);});});}exports[_0xfeca('0x18')]=function(_0x252800){var _0xda66c=this;return new Promise(function(_0x189c2e,_0x5a909a){return db[_0xfeca('0x19')][_0xfeca('0x1a')]({'raw':_0x252800['options']?_0x252800[_0xfeca('0x1b')][_0xfeca('0x1c')]===undefined?!![]:![]:!![],'where':_0x252800['options']?_0x252800[_0xfeca('0x1b')][_0xfeca('0x1d')]||null:null,'attributes':_0x252800['options']?_0x252800[_0xfeca('0x1b')]['attributes']||null:null,'limit':_0x252800[_0xfeca('0x1b')]?_0x252800[_0xfeca('0x1b')][_0xfeca('0x1e')]||null:null,'include':_0x252800['options']?_0x252800[_0xfeca('0x1b')][_0xfeca('0x1f')]?_[_0xfeca('0x20')](_0x252800[_0xfeca('0x1b')][_0xfeca('0x1f')],function(_0x1fa67f){return{'model':db[_0x1fa67f[_0xfeca('0x21')]],'as':_0x1fa67f['as'],'attributes':_0x1fa67f[_0xfeca('0x22')],'include':_0x1fa67f[_0xfeca('0x1f')]?_[_0xfeca('0x20')](_0x1fa67f['include'],function(_0x399509){return{'model':db[_0x399509[_0xfeca('0x21')]],'as':_0x399509['as'],'attributes':_0x399509[_0xfeca('0x22')],'include':_0x399509[_0xfeca('0x1f')]?_[_0xfeca('0x20')](_0x399509['include'],function(_0x26f438){return{'model':db[_0x26f438[_0xfeca('0x21')]],'as':_0x26f438['as'],'attributes':_0x26f438[_0xfeca('0x22')]};}):[]};}):[]};}):[]:[]})[_0xfeca('0xd')](function(_0x2aa004){logger[_0xfeca('0xe')](_0xfeca('0x18'),_0x252800);logger[_0xfeca('0x10')](_0xfeca('0x18'),_0x252800,JSON[_0xfeca('0x11')](_0x2aa004));_0x189c2e(_0x2aa004);})[_0xfeca('0x17')](function(_0x305bd3){logger[_0xfeca('0x12')](_0xfeca('0x18'),_0x305bd3[_0xfeca('0x15')],_0x252800);_0x5a909a(_0xda66c[_0xfeca('0x12')](0x1f4,_0x305bd3['message']));});});};exports['ShowTrigger']=function(_0x241e6a){var _0x21da80=this;return new Promise(function(_0xe23b08,_0x38e2da){return db[_0xfeca('0x19')][_0xfeca('0x23')]({'raw':_0x241e6a[_0xfeca('0x1b')]?_0x241e6a[_0xfeca('0x1b')][_0xfeca('0x1c')]===undefined?!![]:![]:!![],'where':_0x241e6a[_0xfeca('0x1b')]?_0x241e6a['options'][_0xfeca('0x1d')]||null:null,'attributes':_0x241e6a[_0xfeca('0x1b')]?_0x241e6a[_0xfeca('0x1b')][_0xfeca('0x22')]||null:null,'include':_0x241e6a['options']?_0x241e6a['options'][_0xfeca('0x1f')]?_['map'](_0x241e6a['options'][_0xfeca('0x1f')],function(_0x4e1f28){return{'model':db[_0x4e1f28['model']],'as':_0x4e1f28['as'],'attributes':_0x4e1f28['attributes'],'include':_0x4e1f28[_0xfeca('0x1f')]?_['map'](_0x4e1f28[_0xfeca('0x1f')],function(_0x5459d5){return{'model':db[_0x5459d5[_0xfeca('0x21')]],'as':_0x5459d5['as'],'attributes':_0x5459d5['attributes'],'include':_0x5459d5[_0xfeca('0x1f')]?_[_0xfeca('0x20')](_0x5459d5[_0xfeca('0x1f')],function(_0x3f907e){return{'model':db[_0x3f907e[_0xfeca('0x21')]],'as':_0x3f907e['as'],'attributes':_0x3f907e[_0xfeca('0x22')]};}):[]};}):[]};}):[]:[]})[_0xfeca('0xd')](function(_0x701b53){logger[_0xfeca('0xe')](_0xfeca('0x24'),_0x241e6a);logger[_0xfeca('0x10')](_0xfeca('0x24'),_0x241e6a,JSON['stringify'](_0x701b53));_0xe23b08(_0x701b53);})[_0xfeca('0x17')](function(_0x2ac840){logger[_0xfeca('0x12')](_0xfeca('0x24'),_0x2ac840[_0xfeca('0x15')],_0x241e6a);_0x38e2da(_0x21da80[_0xfeca('0x12')](0x1f4,_0x2ac840[_0xfeca('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 2b64d42..0fdd320 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 _0x0f95=['/:id/clone','clone','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','get','index','/:id','isAuthenticated','post'];(function(_0x51c3ed,_0x550d79){var _0x54806b=function(_0x21ef80){while(--_0x21ef80){_0x51c3ed['push'](_0x51c3ed['shift']());}};_0x54806b(++_0x550d79);}(_0x0f95,0x92));var _0x50f9=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0x0f95[_0x3fe042];return _0x7d4a1f;};'use strict';var multer=require(_0x50f9('0x0'));var util=require(_0x50f9('0x1'));var path=require(_0x50f9('0x2'));var timeout=require(_0x50f9('0x3'));var express=require(_0x50f9('0x4'));var router=express[_0x50f9('0x5')]();var fs_extra=require(_0x50f9('0x6'));var auth=require(_0x50f9('0x7'));var interaction=require(_0x50f9('0x8'));var config=require('../../config/environment');var controller=require(_0x50f9('0x9'));router[_0x50f9('0xa')]('/',auth['isAuthenticated'](),controller[_0x50f9('0xb')]);router[_0x50f9('0xa')](_0x50f9('0xc'),auth[_0x50f9('0xd')](),controller['show']);router[_0x50f9('0xe')](_0x50f9('0xf'),auth[_0x50f9('0xd')](),controller[_0x50f9('0x10')]);router['post']('/',auth[_0x50f9('0xd')](),controller[_0x50f9('0x11')]);router[_0x50f9('0x12')]('/:id',auth[_0x50f9('0xd')](),controller[_0x50f9('0x13')]);router[_0x50f9('0x14')](_0x50f9('0xc'),auth['isAuthenticated'](),controller[_0x50f9('0x15')]);module[_0x50f9('0x16')]=router; \ No newline at end of file +var _0xa79c=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','/:id/clone','create','destroy'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xa79c,0x145));var _0xca79=function(_0x3aa2c0,_0x5f1793){_0x3aa2c0=_0x3aa2c0-0x0;var _0x59c92f=_0xa79c[_0x3aa2c0];return _0x59c92f;};'use strict';var multer=require(_0xca79('0x0'));var util=require(_0xca79('0x1'));var path=require('path');var timeout=require(_0xca79('0x2'));var express=require(_0xca79('0x3'));var router=express['Router']();var fs_extra=require(_0xca79('0x4'));var auth=require(_0xca79('0x5'));var interaction=require(_0xca79('0x6'));var config=require(_0xca79('0x7'));var controller=require('./trunk.controller');router[_0xca79('0x8')]('/',auth[_0xca79('0x9')](),controller[_0xca79('0xa')]);router['get'](_0xca79('0xb'),auth['isAuthenticated'](),controller[_0xca79('0xc')]);router[_0xca79('0xd')](_0xca79('0xe'),auth[_0xca79('0x9')](),controller['clone']);router[_0xca79('0xd')]('/',auth[_0xca79('0x9')](),controller[_0xca79('0xf')]);router['put'](_0xca79('0xb'),auth[_0xca79('0x9')](),controller['update']);router['delete'](_0xca79('0xb'),auth[_0xca79('0x9')](),controller[_0xca79('0x10')]);module[_0xca79('0x11')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index bc0618e..26c1c4e 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 _0xba9d=['ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','refuse','originate','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','nonat','outgoing','force_rport,comedia','nat','all'];(function(_0x26b8ee,_0x9a7070){var _0x5a0488=function(_0x51c0d9){while(--_0x51c0d9){_0x26b8ee['push'](_0x26b8ee['shift']());}};_0x5a0488(++_0x9a7070);}(_0xba9d,0x14d));var _0xdba9=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xba9d[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0xdba9('0x0'));module['exports']={'name':{'type':Sequelize[_0xdba9('0x1')],'allowNull':![],'unique':_0xdba9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x4'),_0xdba9('0x5'),_0xdba9('0x6')),'allowNull':![],'defaultValue':_0xdba9('0x4')},'context':{'type':Sequelize[_0xdba9('0x1')],'allowNull':![],'defaultValue':_0xdba9('0x7')},'callingpres':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x8'),_0xdba9('0x9'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0xdba9('0xa'),_0xdba9('0xb'),_0xdba9('0xc'),_0xdba9('0xd'))},'deny':{'type':Sequelize[_0xdba9('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xdba9('0x1')]},'md5secret':{'type':Sequelize[_0xdba9('0x1')]},'remotesecret':{'type':Sequelize[_0xdba9('0x1')]},'transport':{'type':Sequelize[_0xdba9('0x1')],'defaultValue':_0xdba9('0xe'),'set':function(_0x5f0376){this[_0xdba9('0xf')](_0xdba9('0x10'),_0x5f0376?_0x5f0376[_0xdba9('0x11')](','):null);},'get':function(){return this[_0xdba9('0x12')]('transport')?this[_0xdba9('0x12')](_0xdba9('0x10'))[_0xdba9('0x13')](','):null;},'comment':_0xdba9('0x14')},'dtmfmode':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x15'),'info',_0xdba9('0x16'),_0xdba9('0x17'),_0xdba9('0x18')),'defaultValue':_0xdba9('0x15')},'directmedia':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x19'),'no',_0xdba9('0x1a'),'update',_0xdba9('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xdba9('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0xdba9('0x1')]},'nat':{'type':Sequelize[_0xdba9('0x1')],'defaultValue':_0xdba9('0x1c'),'set':function(_0x557864){this[_0xdba9('0xf')](_0xdba9('0x1d'),_0x557864?_0x557864['join'](','):null);},'get':function(){return this[_0xdba9('0x12')](_0xdba9('0x1d'))?this[_0xdba9('0x12')](_0xdba9('0x1d'))[_0xdba9('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xdba9('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xdba9('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xdba9('0x1')],'defaultValue':_0xdba9('0x1e')},'allow':{'type':Sequelize[_0xdba9('0x1')],'allowNull':![],'defaultValue':_0xdba9('0x1f'),'set':function(_0x4dc550){this[_0xdba9('0xf')](_0xdba9('0x20'),_0x4dc550?_0x4dc550[_0xdba9('0x11')](';'):_0xdba9('0x1f'));},'get':function(){return this['getDataValue'](_0xdba9('0x20'))?this[_0xdba9('0x12')](_0xdba9('0x20'))[_0xdba9('0x13')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x19'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xdba9('0x21'),'set':function(_0x14dfc6){this[_0xdba9('0xf')](_0xdba9('0x22'),_0x14dfc6?_0x14dfc6[_0xdba9('0x11')](','):null);},'get':function(){return this[_0xdba9('0x12')]('insecure')?this['getDataValue'](_0xdba9('0x22'))[_0xdba9('0x13')](','):null;},'comment':_0xdba9('0x23')},'trustrpid':{'type':Sequelize[_0xdba9('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x19'),'no','never')},'promiscredir':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x19'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xdba9('0x19'),'no')},'accountcode':{'type':Sequelize[_0xdba9('0x24')](0xb)},'setvar':{'type':Sequelize[_0xdba9('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x19'),'no'),'defaultValue':_0xdba9('0x19')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x19'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xdba9('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0xdba9('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xdba9('0x1')]},'template':{'type':Sequelize[_0xdba9('0x1')]},'videosupport':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x19'),'no',_0xdba9('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xdba9('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x19'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x26'),_0xdba9('0x27'),_0xdba9('0x28'))},'session_expires':{'type':Sequelize[_0xdba9('0x24')](0xb)},'session_minse':{'type':Sequelize[_0xdba9('0x24')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0xdba9('0x29')),'defaultValue':_0xdba9('0x29')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xdba9('0x1')]},'fromdomain':{'type':Sequelize[_0xdba9('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xdba9('0x24')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xdba9('0x19'),'no'),'defaultValue':_0xdba9('0x19')},'keepalive':{'type':Sequelize[_0xdba9('0x24')](0xb)},'defaultip':{'type':Sequelize[_0xdba9('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xdba9('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xdba9('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0xdba9('0x3')]('yes','no',_0xdba9('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xdba9('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xdba9('0x24')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xdba9('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0xdba9('0x1')]},'contactdeny':{'type':Sequelize[_0xdba9('0x1')]},'contactacl':{'type':Sequelize[_0xdba9('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xdba9('0x1')]},'use_q850_reason':{'type':Sequelize[_0xdba9('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xdba9('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x19'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xdba9('0x19'),'no')},'icesupport':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x19'),'no',_0xdba9('0x2b'),_0xdba9('0x2c'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xdba9('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xdba9('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xdba9('0x1')]},'dtlssetup':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x2d'),_0xdba9('0x2e'),_0xdba9('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xdba9('0x1')]},'recordofffeature':{'type':Sequelize[_0xdba9('0x1')]},'call_limit':{'type':Sequelize[_0xdba9('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x19'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xdba9('0x19'),'no')},'vmexten':{'type':Sequelize[_0xdba9('0x1')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xdba9('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xdba9('0x1')],'defaultValue':_0xdba9('0x30')},'canreinvite':{'type':Sequelize[_0xdba9('0x3')](_0xdba9('0x19'),'no',_0xdba9('0x1a'),_0xdba9('0x31'),_0xdba9('0x32')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xdba9('0x1')]},'active':{'type':Sequelize[_0xdba9('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0xe3bf=['join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','rfc2833','update','outgoing','yes','nat','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','always','accept','uac','uas','pai','fingerprint','active','passive','actpass','dynamic','nonat','BOOLEAN','sequelize','exports','name','ENUM','friend','peer','STRING','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','setDataValue','transport'];(function(_0x4c0f9a,_0x1efd44){var _0x9dec53=function(_0x1512d7){while(--_0x1512d7){_0x4c0f9a['push'](_0x4c0f9a['shift']());}};_0x9dec53(++_0x1efd44);}(_0xe3bf,0x7d));var _0xfe3b=function(_0x395f78,_0x582ad4){_0x395f78=_0x395f78-0x0;var _0x1319ca=_0xe3bf[_0x395f78];return _0x1319ca;};'use strict';var Sequelize=require(_0xfe3b('0x0'));module[_0xfe3b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfe3b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x4'),'user',_0xfe3b('0x5')),'allowNull':![],'defaultValue':_0xfe3b('0x4')},'context':{'type':Sequelize[_0xfe3b('0x6')],'allowNull':![],'defaultValue':_0xfe3b('0x7')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0xfe3b('0x8'),_0xfe3b('0x9'),_0xfe3b('0xa'),_0xfe3b('0xb'),_0xfe3b('0xc'),'PROHIB_FAILED_SCREEN',_0xfe3b('0xd'))},'deny':{'type':Sequelize[_0xfe3b('0x6')]},'permit':{'type':Sequelize[_0xfe3b('0x6')]},'secret':{'type':Sequelize[_0xfe3b('0x6')]},'md5secret':{'type':Sequelize[_0xfe3b('0x6')]},'remotesecret':{'type':Sequelize[_0xfe3b('0x6')]},'transport':{'type':Sequelize[_0xfe3b('0x6')],'defaultValue':'udp','set':function(_0x4af5e8){this[_0xfe3b('0xe')](_0xfe3b('0xf'),_0x4af5e8?_0x4af5e8[_0xfe3b('0x10')](','):null);},'get':function(){return this[_0xfe3b('0x11')](_0xfe3b('0xf'))?this[_0xfe3b('0x11')](_0xfe3b('0xf'))[_0xfe3b('0x12')](','):null;},'comment':_0xfe3b('0x13')},'dtmfmode':{'type':Sequelize[_0xfe3b('0x3')]('rfc2833',_0xfe3b('0x14'),_0xfe3b('0x15'),_0xfe3b('0x16'),'auto'),'defaultValue':_0xfe3b('0x17')},'directmedia':{'type':Sequelize['ENUM']('yes','no','nonat',_0xfe3b('0x18'),_0xfe3b('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xfe3b('0x6')]},'directmediadeny':{'type':Sequelize[_0xfe3b('0x6')]},'nat':{'type':Sequelize[_0xfe3b('0x6')],'defaultValue':'force_rport,comedia','set':function(_0x2e4462){this[_0xfe3b('0xe')](_0xfe3b('0x1b'),_0x2e4462?_0x2e4462[_0xfe3b('0x10')](','):null);},'get':function(){return this[_0xfe3b('0x11')](_0xfe3b('0x1b'))?this[_0xfe3b('0x11')](_0xfe3b('0x1b'))[_0xfe3b('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xfe3b('0x6')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xfe3b('0x6')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xfe3b('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xfe3b('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xfe3b('0x6')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xfe3b('0x6')],'allowNull':![],'defaultValue':_0xfe3b('0x1c'),'set':function(_0x57db1c){this['setDataValue'](_0xfe3b('0x1d'),_0x57db1c?_0x57db1c[_0xfe3b('0x10')](';'):_0xfe3b('0x1c'));},'get':function(){return this[_0xfe3b('0x11')](_0xfe3b('0x1d'))?this['getDataValue']('allow')[_0xfe3b('0x12')](';'):null;},'comment':_0xfe3b('0x1e')},'autoframing':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no')},'insecure':{'type':Sequelize[_0xfe3b('0x6')],'defaultValue':_0xfe3b('0x1f'),'set':function(_0x553e82){this['setDataValue'](_0xfe3b('0x20'),_0x553e82?_0x553e82['join'](','):null);},'get':function(){return this['getDataValue'](_0xfe3b('0x20'))?this['getDataValue'](_0xfe3b('0x20'))[_0xfe3b('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xfe3b('0x3')]('yes','no',_0xfe3b('0x21'))},'promiscredir':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no')},'useclientcode':{'type':Sequelize[_0xfe3b('0x3')]('yes','no')},'accountcode':{'type':Sequelize[_0xfe3b('0x22')](0xb)},'setvar':{'type':Sequelize[_0xfe3b('0x6')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xfe3b('0x6')]},'callcounter':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xfe3b('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xfe3b('0x6')]},'template':{'type':Sequelize[_0xfe3b('0x6')]},'videosupport':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no',_0xfe3b('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no')},'mailbox':{'type':Sequelize[_0xfe3b('0x6')]},'session_timers':{'type':Sequelize['ENUM'](_0xfe3b('0x24'),'refuse','originate')},'session_expires':{'type':Sequelize[_0xfe3b('0x22')](0xb)},'session_minse':{'type':Sequelize[_0xfe3b('0x22')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xfe3b('0x25'),_0xfe3b('0x26')),'defaultValue':_0xfe3b('0x26')},'t38pt_usertpsource':{'type':Sequelize[_0xfe3b('0x6')]},'regexten':{'type':Sequelize[_0xfe3b('0x6')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xfe3b('0x6')]},'port':{'type':Sequelize[_0xfe3b('0x22')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xfe3b('0x22')](0xb)},'defaultip':{'type':Sequelize[_0xfe3b('0x6')]},'defaultuser':{'type':Sequelize[_0xfe3b('0x6')]},'rtptimeout':{'type':Sequelize[_0xfe3b('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xfe3b('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xfe3b('0x22')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xfe3b('0x1a'),'no',_0xfe3b('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xfe3b('0x6')]},'callbackextension':{'type':Sequelize[_0xfe3b('0x6')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xfe3b('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0xfe3b('0x6')]},'contactdeny':{'type':Sequelize[_0xfe3b('0x6')]},'contactacl':{'type':Sequelize[_0xfe3b('0x6')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xfe3b('0x6')]},'maxforwards':{'type':Sequelize[_0xfe3b('0x22')](0xb)},'encryption':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no')},'force_avp':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no')},'icesupport':{'type':Sequelize[_0xfe3b('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0xfe3b('0x3')]('yes','no',_0xfe3b('0x28'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xfe3b('0x6')]},'dtlsprivatekey':{'type':Sequelize[_0xfe3b('0x6')]},'dtlscipher':{'type':Sequelize[_0xfe3b('0x6')]},'dtlscafile':{'type':Sequelize[_0xfe3b('0x6')]},'dtlscapath':{'type':Sequelize[_0xfe3b('0x6')]},'dtlssetup':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x29'),_0xfe3b('0x2a'),_0xfe3b('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xfe3b('0x6')]},'recordofffeature':{'type':Sequelize[_0xfe3b('0x6')]},'call_limit':{'type':Sequelize[_0xfe3b('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xfe3b('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xfe3b('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0xfe3b('0x6')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xfe3b('0x6')]},'description':{'type':Sequelize[_0xfe3b('0x6')]},'host':{'type':Sequelize[_0xfe3b('0x6')],'defaultValue':_0xfe3b('0x2c')},'canreinvite':{'type':Sequelize[_0xfe3b('0x3')](_0xfe3b('0x1a'),'no',_0xfe3b('0x2d'),_0xfe3b('0x18'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xfe3b('0x6')]},'otherFields':{'type':Sequelize[_0xfe3b('0x6')]},'active':{'type':Sequelize[_0xfe3b('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xfe3b('0x6')],'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 cd0a813..4d4cbe1 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 _0xb821=['model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Trunk','includeAll','findAll','intersection','length','include','find','params','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','server/files/templates/trunk.ejs','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','root','rimraf','zip-dir','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','code','Trunk,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','name','send','index','rawAttributes','fieldName','key'];(function(_0x4fe18f,_0x571907){var _0x1ae78f=function(_0x117d93){while(--_0x117d93){_0x4fe18f['push'](_0x4fe18f['shift']());}};_0x1ae78f(++_0x571907);}(_0xb821,0xa7));var _0x1b82=function(_0x5ab8bb,_0x139e42){_0x5ab8bb=_0x5ab8bb-0x0;var _0x51adcf=_0xb821[_0x5ab8bb];return _0x51adcf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b82('0x0'));var zipdir=require(_0x1b82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b82('0x3'));var path=require(_0x1b82('0x4'));var sox=require(_0x1b82('0x5'));var csv=require(_0x1b82('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b82('0x7'));var _=require(_0x1b82('0x8'));var squel=require(_0x1b82('0x9'));var crypto=require(_0x1b82('0xa'));var jsforce=require(_0x1b82('0xb'));var deskjs=require(_0x1b82('0xc'));var toCsv=require(_0x1b82('0x6'));var querystring=require(_0x1b82('0xd'));var Papa=require(_0x1b82('0xe'));var Redis=require('ioredis');var authService=require(_0x1b82('0xf'));var qs=require(_0x1b82('0x10'));var as=require(_0x1b82('0x11'));var hardwareService=require(_0x1b82('0x12'));var logger=require(_0x1b82('0x13'))(_0x1b82('0x14'));var utils=require(_0x1b82('0x15'));var config=require(_0x1b82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b82('0x17'))['db'];var jayson=require(_0x1b82('0x18'));var client=jayson[_0x1b82('0x19')][_0x1b82('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x50aed7,_0x1a6285,_0x5767aa,_0x54915f){return new BPromise(function(_0x1e553a,_0x4bf75b){var _0x1cffd1=_0x54915f||client;return _0x1cffd1[_0x1b82('0x1b')](_0x50aed7,_0x5767aa)['then'](function(_0x46c2cf){logger['info']('Trunk,\x20%s,\x20%s',_0x1a6285,_0x1b82('0x1c'));logger['debug'](_0x1b82('0x1d'),_0x1a6285,_0x1b82('0x1c'),JSON[_0x1b82('0x1e')](_0x46c2cf));if(_0x46c2cf['error']){if(_0x46c2cf['error'][_0x1b82('0x1f')]===0x1f4){logger['error'](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x4bf75b(_0x46c2cf['error'][_0x1b82('0x22')]);}logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x46c2cf[_0x1b82('0x21')][_0x1b82('0x22')]);return _0x1e553a(_0x46c2cf['error'][_0x1b82('0x22')]);}else{logger[_0x1b82('0x23')](_0x1b82('0x20'),_0x1a6285,_0x1b82('0x1c'));_0x1e553a(_0x46c2cf[_0x1b82('0x24')][_0x1b82('0x22')]);}})[_0x1b82('0x25')](function(_0x486e92){logger[_0x1b82('0x21')](_0x1b82('0x20'),_0x1a6285,_0x486e92);_0x4bf75b(_0x486e92);});});}function respondWithStatusCode(_0x5b8d09,_0x561d78){_0x561d78=_0x561d78||0xcc;return function(_0x225b81){if(_0x225b81){return _0x5b8d09[_0x1b82('0x26')](_0x561d78);}return _0x5b8d09['status'](_0x561d78)[_0x1b82('0x27')]();};}function respondWithResult(_0x4db690,_0x5cd458){_0x5cd458=_0x5cd458||0xc8;return function(_0x5f556b){if(_0x5f556b){return _0x4db690[_0x1b82('0x28')](_0x5cd458)[_0x1b82('0x29')](_0x5f556b);}};}function respondWithFilteredResult(_0xfd00d1,_0x257b79){return function(_0x548a3b){if(_0x548a3b){var _0x222483=typeof _0x257b79[_0x1b82('0x2a')]===_0x1b82('0x2b')&&typeof _0x257b79[_0x1b82('0x2c')]===_0x1b82('0x2b');var _0x1b8b6f=_0x548a3b[_0x1b82('0x2d')];var _0x21ea34=_0x222483?0x0:_0x257b79[_0x1b82('0x2a')];var _0x1f9c6b=_0x222483?_0x548a3b[_0x1b82('0x2d')]:_0x257b79[_0x1b82('0x2a')]+_0x257b79[_0x1b82('0x2c')];var _0x5ea890;if(_0x1f9c6b>=_0x1b8b6f){_0x1f9c6b=_0x1b8b6f;_0x5ea890=0xc8;}else{_0x5ea890=0xce;}_0xfd00d1[_0x1b82('0x28')](_0x5ea890);return _0xfd00d1[_0x1b82('0x2e')](_0x1b82('0x2f'),_0x21ea34+'-'+_0x1f9c6b+'/'+_0x1b8b6f)[_0x1b82('0x29')](_0x548a3b);}return null;};}function patchUpdates(_0x18e4ff){return function(_0x115ce7){try{jsonpatch[_0x1b82('0x30')](_0x115ce7,_0x18e4ff,!![]);}catch(_0x46575f){return BPromise[_0x1b82('0x31')](_0x46575f);}return _0x115ce7[_0x1b82('0x32')]();};}function saveUpdates(_0x501ab0,_0x225c06){return function(_0x29a31e){if(_0x29a31e){return _0x29a31e[_0x1b82('0x33')](_0x501ab0)[_0x1b82('0x34')](function(_0x5b7b18){return _0x5b7b18;});}return null;};}function removeEntity(_0x474218,_0xbf65a){return function(_0x544bd5){if(_0x544bd5){return _0x544bd5[_0x1b82('0x35')]()[_0x1b82('0x34')](function(){var _0x365c3c=_0x544bd5['get']({'plain':!![]});var _0x5efb8e=_0x1b82('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x5efb8e,'resourceId':_0x365c3c['id']}})[_0x1b82('0x34')](function(){return _0x544bd5;});})[_0x1b82('0x34')](function(){_0x474218[_0x1b82('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a64e,_0x366db3){return function(_0xea774a){if(!_0xea774a){_0x42a64e[_0x1b82('0x26')](0x194);}return _0xea774a;};}function handleError(_0x4dd64a,_0x42c1c4){_0x42c1c4=_0x42c1c4||0x1f4;return function(_0x1cd7de){logger[_0x1b82('0x21')](_0x1cd7de['stack']);if(_0x1cd7de['name']){delete _0x1cd7de[_0x1b82('0x37')];}_0x4dd64a['status'](_0x42c1c4)[_0x1b82('0x38')](_0x1cd7de);};}exports[_0x1b82('0x39')]=function(_0x286b4b,_0x348880){var _0x1255db={},_0x3ab35c={},_0x39fe4a={'count':0x0,'rows':[]};var _0x1368df=_['map'](db['Trunk'][_0x1b82('0x3a')],function(_0x5f4baf){return{'name':_0x5f4baf[_0x1b82('0x3b')],'type':_0x5f4baf['type'][_0x1b82('0x3c')]};});_0x3ab35c[_0x1b82('0x3d')]=_[_0x1b82('0x3e')](_0x1368df,_0x1b82('0x37'));_0x3ab35c[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x286b4b['query']);_0x3ab35c[_0x1b82('0x41')]=_['intersection'](_0x3ab35c[_0x1b82('0x3d')],_0x3ab35c['query']);_0x1255db[_0x1b82('0x42')]=_['intersection'](_0x3ab35c['model'],qs[_0x1b82('0x43')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x1255db[_0x1b82('0x42')]=_0x1255db[_0x1b82('0x42')]['length']?_0x1255db[_0x1b82('0x42')]:_0x3ab35c['model'];if(!_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x44')](_0x1b82('0x45'))){_0x1255db[_0x1b82('0x2c')]=qs[_0x1b82('0x2c')](_0x286b4b['query'][_0x1b82('0x2c')]);_0x1255db['offset']=qs[_0x1b82('0x2a')](_0x286b4b[_0x1b82('0x3f')]['offset']);}_0x1255db[_0x1b82('0x46')]=qs[_0x1b82('0x47')](_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x47')]);_0x1255db[_0x1b82('0x48')]=qs[_0x1b82('0x41')](_[_0x1b82('0x49')](_0x286b4b['query'],_0x3ab35c[_0x1b82('0x41')]),_0x1368df);if(_0x286b4b['query'][_0x1b82('0x4a')]){_0x1255db[_0x1b82('0x48')]=_[_0x1b82('0x4b')](_0x1255db[_0x1b82('0x48')],{'$or':_[_0x1b82('0x3e')](_0x1368df,function(_0x1d24d6){if(_0x1d24d6[_0x1b82('0x4c')]!==_0x1b82('0x4d')){var _0x192ce3={};_0x192ce3[_0x1d24d6[_0x1b82('0x37')]]={'$like':'%'+_0x286b4b[_0x1b82('0x3f')][_0x1b82('0x4a')]+'%'};return _0x192ce3;}})});}_0x1255db=_[_0x1b82('0x4b')]({},_0x1255db,_0x286b4b[_0x1b82('0x4e')]);var _0x4fb92f={'where':_0x1255db['where']};return db[_0x1b82('0x4f')]['count'](_0x4fb92f)[_0x1b82('0x34')](function(_0x3df0af){_0x39fe4a[_0x1b82('0x2d')]=_0x3df0af;if(_0x286b4b['query'][_0x1b82('0x50')]){_0x1255db['include']=[{'all':!![]}];}return db['Trunk'][_0x1b82('0x51')](_0x1255db);})[_0x1b82('0x34')](function(_0x242324){_0x39fe4a['rows']=_0x242324;return _0x39fe4a;})[_0x1b82('0x34')](respondWithFilteredResult(_0x348880,_0x1255db))[_0x1b82('0x25')](handleError(_0x348880,null));};exports['show']=function(_0x5ca898,_0x106282){var _0x2e676a={'raw':![],'where':{'id':_0x5ca898['params']['id']}},_0x2dc53e={};_0x2dc53e[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db[_0x1b82('0x4f')][_0x1b82('0x3a')]);_0x2dc53e[_0x1b82('0x3f')]=_[_0x1b82('0x40')](_0x5ca898['query']);_0x2dc53e[_0x1b82('0x41')]=_['intersection'](_0x2dc53e[_0x1b82('0x3d')],_0x2dc53e[_0x1b82('0x3f')]);_0x2e676a['attributes']=_[_0x1b82('0x52')](_0x2dc53e['model'],qs[_0x1b82('0x43')](_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x2e676a[_0x1b82('0x42')]=_0x2e676a[_0x1b82('0x42')][_0x1b82('0x53')]?_0x2e676a['attributes']:_0x2dc53e['model'];if(_0x5ca898[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x2e676a[_0x1b82('0x54')]=[{'all':!![]}];}_0x2e676a=_[_0x1b82('0x4b')]({},_0x2e676a,_0x5ca898[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x2e676a)[_0x1b82('0x34')](handleEntityNotFound(_0x106282,null))['then'](respondWithResult(_0x106282,null))['catch'](handleError(_0x106282,null));};exports['clone']=function(_0x2658b5,_0x2a95d2){var _0x207f1c={'where':{'id':_0x2658b5[_0x1b82('0x56')]['id']}},_0x27ad80={};_0x27ad80[_0x1b82('0x3d')]=_[_0x1b82('0x40')](db['Trunk'][_0x1b82('0x3a')]);_0x207f1c[_0x1b82('0x42')]=_[_0x1b82('0x52')](_0x27ad80[_0x1b82('0x3d')],qs[_0x1b82('0x43')](_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x43')]));_0x207f1c[_0x1b82('0x42')]=_0x207f1c['attributes'][_0x1b82('0x53')]?_0x207f1c[_0x1b82('0x42')]:_0x27ad80[_0x1b82('0x3d')];if(_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]){_0x207f1c['include']=[{'all':!![]}];}_0x207f1c=_['merge']({},_0x207f1c,_0x2658b5[_0x1b82('0x4e')]);return db[_0x1b82('0x4f')][_0x1b82('0x55')](_0x207f1c)[_0x1b82('0x34')](handleEntityNotFound(_0x2a95d2,null))['then'](function(_0x170905){if(_0x170905){var _0x352603=_0x170905[_0x1b82('0x57')]({'plain':!![]});_0x352603=qs[_0x1b82('0x58')](_0x352603,['id',_0x1b82('0x59'),_0x1b82('0x5a')]);_0x2658b5[_0x1b82('0x5b')]=_[_0x1b82('0x58')](_0x2658b5[_0x1b82('0x5b')],['id',_0x1b82('0x59'),'updatedAt']);return db[_0x1b82('0x4f')][_0x1b82('0x5c')](_['merge'](_0x352603,_0x2658b5[_0x1b82('0x5b')]),{'include':_0x2658b5[_0x1b82('0x3f')][_0x1b82('0x50')]?[{'all':!![]}]:undefined})[_0x1b82('0x34')](function(_0x4b26c4){var _0x30f13a=_0x2658b5[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x30f13a)throw new Error(_0x1b82('0x5e'));if(_0x30f13a[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x4e8fa2=_0x4b26c4[_0x1b82('0x57')]({'plain':!![]});var _0x5267c3=_0x1b82('0x36');return db['UserProfileSection'][_0x1b82('0x55')]({'where':{'name':_0x5267c3,'userProfileId':_0x30f13a[_0x1b82('0x60')]},'raw':!![]})[_0x1b82('0x34')](function(_0x2db0fe){if(_0x2db0fe&&_0x2db0fe[_0x1b82('0x61')]===0x0){return db[_0x1b82('0x62')][_0x1b82('0x5c')]({'name':_0x4e8fa2['name'],'resourceId':_0x4e8fa2['id'],'type':_0x2db0fe[_0x1b82('0x37')],'sectionId':_0x2db0fe['id']},{})[_0x1b82('0x34')](function(){return _0x4b26c4;});}else{return _0x4b26c4;}})[_0x1b82('0x25')](function(_0x2de10c){logger[_0x1b82('0x21')](_0x1b82('0x63'),_0x2de10c);throw _0x2de10c;});}return _0x4b26c4;});}})[_0x1b82('0x34')](respondWithResult(_0x2a95d2,0xc9))[_0x1b82('0x25')](handleError(_0x2a95d2,null));};exports[_0x1b82('0x5c')]=function(_0x3f7690,_0x1873de,_0xe31cbc){var _0x1ef92c;return db['Trunk'][_0x1b82('0x5c')](_0x3f7690[_0x1b82('0x5b')],{'raw':!![]})[_0x1b82('0x34')](function(_0x4a229e){_0x1ef92c=_0x4a229e;return db[_0x1b82('0x4f')][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x3bf106){var _0x5cc386=fs[_0x1b82('0x64')](path['join'](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x3b4088=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x68')),'utf8');var _0x143689=ejs[_0x1b82('0x69')](_0x5cc386,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x143689);if(_0x1ef92c[_0x1b82('0x6c')]){var _0x29c42e=ejs[_0x1b82('0x69')](_0x3b4088,{'trunks':_0x3bf106||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x29c42e);}})[_0x1b82('0x34')](function(){return respondWithRpcPromise(_0x1b82('0x6e'),'create',{'module':_0x1b82('0x6f')});})['then'](function(){var _0x4c2e52=_0x3f7690[_0x1b82('0x5d')][_0x1b82('0x57')]({'plain':!![]});if(!_0x4c2e52)throw new Error(_0x1b82('0x5e'));if(_0x4c2e52[_0x1b82('0x5f')]===_0x1b82('0x5d')){var _0x1dd3a1=_0x1ef92c[_0x1b82('0x57')]({'plain':!![]});return db[_0x1b82('0x70')][_0x1b82('0x55')]({'where':{'name':_0x1b82('0x36'),'userProfileId':_0x4c2e52['userProfileId']},'raw':!![]})[_0x1b82('0x34')](function(_0x4d496b){if(_0x4d496b&&_0x4d496b[_0x1b82('0x61')]===0x0){return db['UserProfileResource'][_0x1b82('0x5c')]({'name':_0x1dd3a1[_0x1b82('0x37')],'resourceId':_0x1dd3a1['id'],'type':_0x4d496b[_0x1b82('0x37')],'sectionId':_0x4d496b['id']},{})[_0x1b82('0x34')](function(){return _0x1ef92c;});}else{return _0x1ef92c;}})[_0x1b82('0x25')](function(_0x49a202){logger[_0x1b82('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a202);throw _0x49a202;});}return _0x1ef92c;})['then'](respondWithResult(_0x1873de,0xc9))[_0x1b82('0x25')](handleError(_0x1873de,null));};exports[_0x1b82('0x33')]=function(_0x1a4826,_0x4d986c,_0x2e9191){var _0x52f16e;return db[_0x1b82('0x4f')]['find']({'where':{'id':_0x1a4826[_0x1b82('0x56')]['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x4d986c,null))[_0x1b82('0x34')](saveUpdates(_0x1a4826[_0x1b82('0x5b')],null))['then'](function(_0x46cae4){if(_0x46cae4){_0x52f16e=_0x46cae4;return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});}})[_0x1b82('0x34')](function(_0x1095fb){if(_0x1095fb){var _0x185fce=fs[_0x1b82('0x64')](path['join'](config[_0x1b82('0x71')],'server/files/templates/trunk.ejs'),_0x1b82('0x66'));var _0x5ce247=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],'server/files/templates/registry.ejs'),_0x1b82('0x66'));var _0x31a56e=ejs[_0x1b82('0x69')](_0x185fce,{'trunks':_0x1095fb||[]});fs['writeFileSync'](_0x1b82('0x6b'),_0x31a56e);var _0x396272=ejs[_0x1b82('0x69')](_0x5ce247,{'trunks':_0x1095fb||[]});fs[_0x1b82('0x6a')](_0x1b82('0x6d'),_0x396272);return respondWithRpcPromise('Reload',_0x1b82('0x33'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x2759ac){if(_0x2759ac){return _0x52f16e;}})['then'](respondWithResult(_0x4d986c,null))[_0x1b82('0x25')](handleError(_0x4d986c,null));};exports[_0x1b82('0x35')]=function(_0x5f349f,_0x3e17b0,_0x391207){var _0x553ac5;return db['Trunk']['find']({'where':{'id':_0x5f349f['params']['id']}})[_0x1b82('0x34')](handleEntityNotFound(_0x3e17b0,null))[_0x1b82('0x34')](removeEntity(_0x3e17b0,null))[_0x1b82('0x34')](function(){return db['Trunk'][_0x1b82('0x51')]({'raw':!![]});})['then'](function(_0x7d95b6){var _0x372c3b=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config['root'],_0x1b82('0x65')),_0x1b82('0x66'));var _0x14510c=fs[_0x1b82('0x64')](path[_0x1b82('0x67')](config[_0x1b82('0x71')],_0x1b82('0x68')),'utf8');var _0x58e180=ejs[_0x1b82('0x69')](_0x372c3b,{'trunks':_0x7d95b6});var _0x531d3f=ejs['render'](_0x14510c,{'trunks':_0x7d95b6});fs[_0x1b82('0x6a')](_0x1b82('0x6b'),_0x58e180);fs[_0x1b82('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x531d3f);return respondWithRpcPromise(_0x1b82('0x6e'),'destroy',{'module':_0x1b82('0x6f')});})[_0x1b82('0x25')](handleError(_0x3e17b0,null));}; \ No newline at end of file +var _0x81bd=['/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','update','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','UserProfileResource','name','index','Trunk','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','clone','find','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/registry.ejs','utf8','writeFileSync'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x81bd,0x7c));var _0xd81b=function(_0x19b5c0,_0x18ca6d){_0x19b5c0=_0x19b5c0-0x0;var _0x2fb804=_0x81bd[_0x19b5c0];return _0x2fb804;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd81b('0x1b'));var client=jayson['client'][_0xd81b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xe75568,_0x5f0b6b,_0x35a053,_0x47dd04){return new BPromise(function(_0x13dd00,_0x41bf7a){var _0x6c6041=_0x47dd04||client;return _0x6c6041[_0xd81b('0x1d')](_0xe75568,_0x35a053)[_0xd81b('0x1e')](function(_0x552215){logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');logger[_0xd81b('0x21')](_0xd81b('0x22'),_0x5f0b6b,_0xd81b('0x23'),JSON[_0xd81b('0x24')](_0x552215));if(_0x552215[_0xd81b('0x25')]){if(_0x552215[_0xd81b('0x25')][_0xd81b('0x26')]===0x1f4){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);return _0x41bf7a(_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);}logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')]['message']);return _0x13dd00(_0x552215['error'][_0xd81b('0x27')]);}else{logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');_0x13dd00(_0x552215[_0xd81b('0x28')][_0xd81b('0x27')]);}})['catch'](function(_0xcd6474){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0xcd6474);_0x41bf7a(_0xcd6474);});});}function respondWithStatusCode(_0x1ad65c,_0x279176){_0x279176=_0x279176||0xcc;return function(_0xcb4f91){if(_0xcb4f91){return _0x1ad65c[_0xd81b('0x29')](_0x279176);}return _0x1ad65c[_0xd81b('0x2a')](_0x279176)[_0xd81b('0x2b')]();};}function respondWithResult(_0x212c4e,_0x2ccedf){_0x2ccedf=_0x2ccedf||0xc8;return function(_0x1bf351){if(_0x1bf351){return _0x212c4e['status'](_0x2ccedf)[_0xd81b('0x2c')](_0x1bf351);}};}function respondWithFilteredResult(_0x99dbc9,_0xe3637a){return function(_0x31b9fd){if(_0x31b9fd){var _0x3266c2=typeof _0xe3637a[_0xd81b('0x2d')]===_0xd81b('0x2e')&&typeof _0xe3637a[_0xd81b('0x2f')]===_0xd81b('0x2e');var _0x483a3d=_0x31b9fd[_0xd81b('0x30')];var _0x4e2eff=_0x3266c2?0x0:_0xe3637a['offset'];var _0xb9ff9f=_0x3266c2?_0x31b9fd[_0xd81b('0x30')]:_0xe3637a['offset']+_0xe3637a['limit'];var _0x4093c8;if(_0xb9ff9f>=_0x483a3d){_0xb9ff9f=_0x483a3d;_0x4093c8=0xc8;}else{_0x4093c8=0xce;}_0x99dbc9[_0xd81b('0x2a')](_0x4093c8);return _0x99dbc9[_0xd81b('0x31')](_0xd81b('0x32'),_0x4e2eff+'-'+_0xb9ff9f+'/'+_0x483a3d)[_0xd81b('0x2c')](_0x31b9fd);}return null;};}function patchUpdates(_0x4654ba){return function(_0x5527ed){try{jsonpatch[_0xd81b('0x33')](_0x5527ed,_0x4654ba,!![]);}catch(_0x26f629){return BPromise['reject'](_0x26f629);}return _0x5527ed['save']();};}function saveUpdates(_0x165892,_0x1966b1){return function(_0x50472a){if(_0x50472a){return _0x50472a['update'](_0x165892)['then'](function(_0x322991){return _0x322991;});}return null;};}function removeEntity(_0x3ead68,_0x1d2f46){return function(_0x1c4cf7){if(_0x1c4cf7){return _0x1c4cf7[_0xd81b('0x34')]()[_0xd81b('0x1e')](function(){var _0x29aabf=_0x1c4cf7['get']({'plain':!![]});var _0x28782f='Trunks';return db[_0xd81b('0x35')][_0xd81b('0x34')]({'where':{'type':_0x28782f,'resourceId':_0x29aabf['id']}})[_0xd81b('0x1e')](function(){return _0x1c4cf7;});})[_0xd81b('0x1e')](function(){_0x3ead68[_0xd81b('0x2a')](0xcc)[_0xd81b('0x2b')]();});}};}function handleEntityNotFound(_0x1c20d3,_0x2d23b9){return function(_0xf9d1a5){if(!_0xf9d1a5){_0x1c20d3[_0xd81b('0x29')](0x194);}return _0xf9d1a5;};}function handleError(_0x1be4e2,_0x3c8371){_0x3c8371=_0x3c8371||0x1f4;return function(_0x346038){logger['error'](_0x346038['stack']);if(_0x346038[_0xd81b('0x36')]){delete _0x346038[_0xd81b('0x36')];}_0x1be4e2[_0xd81b('0x2a')](_0x3c8371)['send'](_0x346038);};}exports[_0xd81b('0x37')]=function(_0x37ba34,_0x5a236a){var _0x46f058={},_0xaa9e97={},_0x512e39={'count':0x0,'rows':[]};var _0xed5272=_['map'](db[_0xd81b('0x38')][_0xd81b('0x39')],function(_0x203365){return{'name':_0x203365[_0xd81b('0x3a')],'type':_0x203365['type'][_0xd81b('0x3b')]};});_0xaa9e97[_0xd81b('0x3c')]=_[_0xd81b('0x3d')](_0xed5272,_0xd81b('0x36'));_0xaa9e97[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x37ba34[_0xd81b('0x3e')]);_0xaa9e97['filters']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],_0xaa9e97[_0xd81b('0x3e')]);_0x46f058['attributes']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],qs[_0xd81b('0x41')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x46f058['attributes']=_0x46f058[_0xd81b('0x42')][_0xd81b('0x43')]?_0x46f058[_0xd81b('0x42')]:_0xaa9e97[_0xd81b('0x3c')];if(!_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x44')](_0xd81b('0x45'))){_0x46f058[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2f')]);_0x46f058['offset']=qs[_0xd81b('0x2d')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2d')]);}_0x46f058[_0xd81b('0x46')]=qs[_0xd81b('0x47')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x47')]);_0x46f058[_0xd81b('0x48')]=qs['filters'](_['pick'](_0x37ba34[_0xd81b('0x3e')],_0xaa9e97[_0xd81b('0x49')]),_0xed5272);if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]){_0x46f058[_0xd81b('0x48')]=_[_0xd81b('0x4b')](_0x46f058[_0xd81b('0x48')],{'$or':_[_0xd81b('0x3d')](_0xed5272,function(_0x2fa588){if(_0x2fa588[_0xd81b('0x4c')]!==_0xd81b('0x4d')){var _0x38e436={};_0x38e436[_0x2fa588['name']]={'$like':'%'+_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]+'%'};return _0x38e436;}})});}_0x46f058=_[_0xd81b('0x4b')]({},_0x46f058,_0x37ba34[_0xd81b('0x4e')]);var _0x105a48={'where':_0x46f058[_0xd81b('0x48')]};return db[_0xd81b('0x38')][_0xd81b('0x30')](_0x105a48)[_0xd81b('0x1e')](function(_0x53ea36){_0x512e39[_0xd81b('0x30')]=_0x53ea36;if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x46f058[_0xd81b('0x50')]=[{'all':!![]}];}return db['Trunk'][_0xd81b('0x51')](_0x46f058);})[_0xd81b('0x1e')](function(_0x15030b){_0x512e39[_0xd81b('0x52')]=_0x15030b;return _0x512e39;})[_0xd81b('0x1e')](respondWithFilteredResult(_0x5a236a,_0x46f058))[_0xd81b('0x53')](handleError(_0x5a236a,null));};exports[_0xd81b('0x54')]=function(_0x43d7ce,_0x133a76){var _0x49cba6={'raw':![],'where':{'id':_0x43d7ce[_0xd81b('0x55')]['id']}},_0x534d10={};_0x534d10[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db[_0xd81b('0x38')][_0xd81b('0x39')]);_0x534d10[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x43d7ce[_0xd81b('0x3e')]);_0x534d10['filters']=_[_0xd81b('0x40')](_0x534d10[_0xd81b('0x3c')],_0x534d10[_0xd81b('0x3e')]);_0x49cba6[_0xd81b('0x42')]=_[_0xd81b('0x40')](_0x534d10['model'],qs[_0xd81b('0x41')](_0x43d7ce[_0xd81b('0x3e')]['fields']));_0x49cba6[_0xd81b('0x42')]=_0x49cba6[_0xd81b('0x42')][_0xd81b('0x43')]?_0x49cba6[_0xd81b('0x42')]:_0x534d10[_0xd81b('0x3c')];if(_0x43d7ce[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x49cba6[_0xd81b('0x50')]=[{'all':!![]}];}_0x49cba6=_[_0xd81b('0x4b')]({},_0x49cba6,_0x43d7ce[_0xd81b('0x4e')]);return db[_0xd81b('0x38')]['find'](_0x49cba6)[_0xd81b('0x1e')](handleEntityNotFound(_0x133a76,null))['then'](respondWithResult(_0x133a76,null))[_0xd81b('0x53')](handleError(_0x133a76,null));};exports[_0xd81b('0x56')]=function(_0x390db6,_0x3c2a9f){var _0x34d2a2={'where':{'id':_0x390db6['params']['id']}},_0x1e9f73={};_0x1e9f73[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db['Trunk']['rawAttributes']);_0x34d2a2[_0xd81b('0x42')]=_['intersection'](_0x1e9f73[_0xd81b('0x3c')],qs['fields'](_0x390db6[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x34d2a2[_0xd81b('0x42')]=_0x34d2a2['attributes'][_0xd81b('0x43')]?_0x34d2a2[_0xd81b('0x42')]:_0x1e9f73['model'];if(_0x390db6[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x34d2a2['include']=[{'all':!![]}];}_0x34d2a2=_[_0xd81b('0x4b')]({},_0x34d2a2,_0x390db6['options']);return db[_0xd81b('0x38')][_0xd81b('0x57')](_0x34d2a2)[_0xd81b('0x1e')](handleEntityNotFound(_0x3c2a9f,null))[_0xd81b('0x1e')](function(_0x4add79){if(_0x4add79){var _0x32eab4=_0x4add79[_0xd81b('0x58')]({'plain':!![]});_0x32eab4=qs[_0xd81b('0x59')](_0x32eab4,['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);_0x390db6['body']=_[_0xd81b('0x59')](_0x390db6[_0xd81b('0x5c')],['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);return db[_0xd81b('0x38')][_0xd81b('0x5d')](_[_0xd81b('0x4b')](_0x32eab4,_0x390db6['body']),{'include':_0x390db6['query']['includeAll']?[{'all':!![]}]:undefined})[_0xd81b('0x1e')](function(_0x12b0bf){var _0x37507e=_0x390db6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x37507e)throw new Error(_0xd81b('0x5f'));if(_0x37507e[_0xd81b('0x60')]==='user'){var _0x3fcd8c=_0x12b0bf[_0xd81b('0x58')]({'plain':!![]});var _0x35c9cf=_0xd81b('0x61');return db[_0xd81b('0x62')][_0xd81b('0x57')]({'where':{'name':_0x35c9cf,'userProfileId':_0x37507e[_0xd81b('0x63')]},'raw':!![]})['then'](function(_0x14b187){if(_0x14b187&&_0x14b187[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x3fcd8c[_0xd81b('0x36')],'resourceId':_0x3fcd8c['id'],'type':_0x14b187[_0xd81b('0x36')],'sectionId':_0x14b187['id']},{})[_0xd81b('0x1e')](function(){return _0x12b0bf;});}else{return _0x12b0bf;}})[_0xd81b('0x53')](function(_0x8fa8cd){logger[_0xd81b('0x25')](_0xd81b('0x65'),_0x8fa8cd);throw _0x8fa8cd;});}return _0x12b0bf;});}})[_0xd81b('0x1e')](respondWithResult(_0x3c2a9f,0xc9))['catch'](handleError(_0x3c2a9f,null));};exports[_0xd81b('0x5d')]=function(_0x5358a6,_0x2e7141,_0x6fa974){var _0x414f40;return db[_0xd81b('0x38')][_0xd81b('0x5d')](_0x5358a6[_0xd81b('0x5c')],{'raw':!![]})[_0xd81b('0x1e')](function(_0x18f2ac){_0x414f40=_0x18f2ac;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0xfa2a13){var _0x344c32=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),'utf8');var _0x3274d2=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),_0xd81b('0x6a'));var _0xaee7e3=ejs['render'](_0x344c32,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0xaee7e3);if(_0x414f40[_0xd81b('0x6d')]){var _0x1c6ec8=ejs[_0xd81b('0x6e')](_0x3274d2,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x1c6ec8);}})[_0xd81b('0x1e')](function(){return respondWithRpcPromise(_0xd81b('0x70'),'create',{'module':_0xd81b('0x71')});})[_0xd81b('0x1e')](function(){var _0x3858eb=_0x5358a6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x3858eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3858eb[_0xd81b('0x60')]===_0xd81b('0x5e')){var _0x4cc440=_0x414f40[_0xd81b('0x58')]({'plain':!![]});return db[_0xd81b('0x62')]['find']({'where':{'name':_0xd81b('0x61'),'userProfileId':_0x3858eb[_0xd81b('0x63')]},'raw':!![]})[_0xd81b('0x1e')](function(_0x483026){if(_0x483026&&_0x483026[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x4cc440['name'],'resourceId':_0x4cc440['id'],'type':_0x483026['name'],'sectionId':_0x483026['id']},{})[_0xd81b('0x1e')](function(){return _0x414f40;});}else{return _0x414f40;}})[_0xd81b('0x53')](function(_0x36c694){logger['error'](_0xd81b('0x65'),_0x36c694);throw _0x36c694;});}return _0x414f40;})[_0xd81b('0x1e')](respondWithResult(_0x2e7141,0xc9))[_0xd81b('0x53')](handleError(_0x2e7141,null));};exports[_0xd81b('0x72')]=function(_0x524196,_0x4f69a7,_0x42ae01){var _0x256696;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x524196['params']['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x4f69a7,null))[_0xd81b('0x1e')](saveUpdates(_0x524196['body'],null))[_0xd81b('0x1e')](function(_0x4e5bf4){if(_0x4e5bf4){_0x256696=_0x4e5bf4;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});}})['then'](function(_0x1be0e6){if(_0x1be0e6){var _0x9a9634=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),_0xd81b('0x6a'));var _0xc0e137=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),'utf8');var _0x5c8ea0=ejs[_0xd81b('0x6e')](_0x9a9634,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0x5c8ea0);var _0x15aed5=ejs['render'](_0xc0e137,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x15aed5);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x72'),{'module':_0xd81b('0x71')});}return null;})['then'](function(_0x3744bf){if(_0x3744bf){return _0x256696;}})[_0xd81b('0x1e')](respondWithResult(_0x4f69a7,null))[_0xd81b('0x53')](handleError(_0x4f69a7,null));};exports[_0xd81b('0x34')]=function(_0x1d596c,_0x288124,_0x402eb9){var _0x57179a;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x1d596c[_0xd81b('0x55')]['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x288124,null))[_0xd81b('0x1e')](removeEntity(_0x288124,null))[_0xd81b('0x1e')](function(){return db['Trunk'][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0x11e590){var _0x9e6e05=fs[_0xd81b('0x66')](path['join'](config[_0xd81b('0x68')],_0xd81b('0x73')),_0xd81b('0x6a'));var _0x5060dc=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config['root'],_0xd81b('0x69')),'utf8');var _0x5f5514=ejs[_0xd81b('0x6e')](_0x9e6e05,{'trunks':_0x11e590});var _0x428317=ejs[_0xd81b('0x6e')](_0x5060dc,{'trunks':_0x11e590});fs['writeFileSync'](_0xd81b('0x6c'),_0x5f5514);fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x428317);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x34'),{'module':_0xd81b('0x71')});})['catch'](handleError(_0x288124,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 031235d..ee40a28 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 _0x0bbf=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','lodash','util','../../config/logger'];(function(_0x28de32,_0x242d8b){var _0x5ec7a8=function(_0x4c1a27){while(--_0x4c1a27){_0x28de32['push'](_0x28de32['shift']());}};_0x5ec7a8(++_0x242d8b);}(_0x0bbf,0xcf));var _0xf0bb=function(_0x32056c,_0x1b6db7){_0x32056c=_0x32056c-0x0;var _0x317313=_0x0bbf[_0x32056c];return _0x317313;};'use strict';var _=require(_0xf0bb('0x0'));var util=require(_0xf0bb('0x1'));var logger=require(_0xf0bb('0x2'))(_0xf0bb('0x3'));var moment=require(_0xf0bb('0x4'));var BPromise=require(_0xf0bb('0x5'));var rp=require(_0xf0bb('0x6'));var fs=require('fs');var path=require(_0xf0bb('0x7'));var rimraf=require(_0xf0bb('0x8'));var config=require(_0xf0bb('0x9'));var attributes=require(_0xf0bb('0xa'));module[_0xf0bb('0xb')]=function(_0x2acf2d,_0x2be7e6){return _0x2acf2d[_0xf0bb('0xc')](_0xf0bb('0xd'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59a6=['rimraf','../../config/environment','define','Trunk','tools_trunks','lodash','../../config/logger','bluebird','request-promise','path'];(function(_0x174a72,_0x46034c){var _0x32cecd=function(_0x188a47){while(--_0x188a47){_0x174a72['push'](_0x174a72['shift']());}};_0x32cecd(++_0x46034c);}(_0x59a6,0xff));var _0x659a=function(_0x4d80a6,_0x494029){_0x4d80a6=_0x4d80a6-0x0;var _0x2735b0=_0x59a6[_0x4d80a6];return _0x2735b0;};'use strict';var _=require(_0x659a('0x0'));var util=require('util');var logger=require(_0x659a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x659a('0x2'));var rp=require(_0x659a('0x3'));var fs=require('fs');var path=require(_0x659a('0x4'));var rimraf=require(_0x659a('0x5'));var config=require(_0x659a('0x6'));var attributes=require('./trunk.attributes');module['exports']=function(_0x40a48b,_0x4c3c25){return _0x40a48b[_0x659a('0x7')](_0x659a('0x8'),attributes,{'tableName':_0x659a('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 d211abc..859aa43 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 _0x263e=['where','attributes','limit','include','map','model','ShowTrunk','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetTrunk','findAll','options','raw'];(function(_0x37cdd9,_0x4ac392){var _0x2ce804=function(_0x472e0b){while(--_0x472e0b){_0x37cdd9['push'](_0x37cdd9['shift']());}};_0x2ce804(++_0x4ac392);}(_0x263e,0x1d8));var _0xe263=function(_0x1103c4,_0x562d1d){_0x1103c4=_0x1103c4-0x0;var _0x1c19ab=_0x263e[_0x1103c4];return _0x1c19ab;};'use strict';var _=require(_0xe263('0x0'));var util=require(_0xe263('0x1'));var moment=require(_0xe263('0x2'));var BPromise=require('bluebird');var rs=require(_0xe263('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe263('0x4'));var logger=require(_0xe263('0x5'))(_0xe263('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe263('0x7')][_0xe263('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3eba99,_0x1407fe,_0x4201aa){return new BPromise(function(_0x2547b0,_0x5844f9){return client[_0xe263('0x9')](_0x3eba99,_0x4201aa)[_0xe263('0xa')](function(_0xb579ae){logger[_0xe263('0xb')](_0xe263('0xc'),_0x1407fe,_0xe263('0xd'));logger[_0xe263('0xe')](_0xe263('0xf'),_0x1407fe,_0xe263('0xd'),JSON[_0xe263('0x10')](_0xb579ae));if(_0xb579ae[_0xe263('0x11')]){if(_0xb579ae[_0xe263('0x11')]['code']===0x1f4){logger[_0xe263('0x11')](_0xe263('0xc'),_0x1407fe,_0xb579ae[_0xe263('0x11')][_0xe263('0x12')]);return _0x5844f9(_0xb579ae[_0xe263('0x11')][_0xe263('0x12')]);}logger[_0xe263('0x11')](_0xe263('0xc'),_0x1407fe,_0xb579ae[_0xe263('0x11')][_0xe263('0x12')]);return _0x2547b0(_0xb579ae[_0xe263('0x11')][_0xe263('0x12')]);}else{logger[_0xe263('0xb')](_0xe263('0xc'),_0x1407fe,_0xe263('0xd'));_0x2547b0(_0xb579ae['result'][_0xe263('0x12')]);}})[_0xe263('0x13')](function(_0x5c8e0b){logger[_0xe263('0x11')](_0xe263('0xc'),_0x1407fe,_0x5c8e0b);_0x5844f9(_0x5c8e0b);});});}exports[_0xe263('0x14')]=function(_0x2e3449){var _0x48bc0e=this;return new Promise(function(_0x5388b2,_0x136511){return db['Trunk'][_0xe263('0x15')]({'raw':_0x2e3449['options']?_0x2e3449[_0xe263('0x16')][_0xe263('0x17')]===undefined?!![]:![]:!![],'where':_0x2e3449['options']?_0x2e3449['options'][_0xe263('0x18')]||null:null,'attributes':_0x2e3449[_0xe263('0x16')]?_0x2e3449[_0xe263('0x16')][_0xe263('0x19')]||null:null,'limit':_0x2e3449['options']?_0x2e3449[_0xe263('0x16')][_0xe263('0x1a')]||null:null,'include':_0x2e3449[_0xe263('0x16')]?_0x2e3449[_0xe263('0x16')][_0xe263('0x1b')]?_[_0xe263('0x1c')](_0x2e3449['options']['include'],function(_0x11ed57){return{'model':db[_0x11ed57['model']],'as':_0x11ed57['as'],'attributes':_0x11ed57[_0xe263('0x19')],'include':_0x11ed57[_0xe263('0x1b')]?_[_0xe263('0x1c')](_0x11ed57[_0xe263('0x1b')],function(_0x35cf8b){return{'model':db[_0x35cf8b['model']],'as':_0x35cf8b['as'],'attributes':_0x35cf8b[_0xe263('0x19')],'include':_0x35cf8b[_0xe263('0x1b')]?_['map'](_0x35cf8b[_0xe263('0x1b')],function(_0xda60cb){return{'model':db[_0xda60cb[_0xe263('0x1d')]],'as':_0xda60cb['as'],'attributes':_0xda60cb[_0xe263('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe263('0xa')](function(_0x1cb7c9){logger['info'](_0xe263('0x14'),_0x2e3449);logger[_0xe263('0xe')]('GetTrunk',_0x2e3449,JSON[_0xe263('0x10')](_0x1cb7c9));_0x5388b2(_0x1cb7c9);})[_0xe263('0x13')](function(_0x482577){logger['error'](_0xe263('0x14'),_0x482577[_0xe263('0x12')],_0x2e3449);_0x136511(_0x48bc0e[_0xe263('0x11')](0x1f4,_0x482577[_0xe263('0x12')]));});});};exports[_0xe263('0x1e')]=function(_0x1d1d4e){var _0x4edde2=this;return new Promise(function(_0x18ba56,_0x27388c){return db['Trunk']['find']({'raw':_0x1d1d4e['options']?_0x1d1d4e[_0xe263('0x16')][_0xe263('0x17')]===undefined?!![]:![]:!![],'where':_0x1d1d4e['options']?_0x1d1d4e[_0xe263('0x16')]['where']||null:null,'attributes':_0x1d1d4e[_0xe263('0x16')]?_0x1d1d4e[_0xe263('0x16')]['attributes']||null:null,'include':_0x1d1d4e[_0xe263('0x16')]?_0x1d1d4e[_0xe263('0x16')][_0xe263('0x1b')]?_[_0xe263('0x1c')](_0x1d1d4e[_0xe263('0x16')][_0xe263('0x1b')],function(_0x4e7244){return{'model':db[_0x4e7244['model']],'as':_0x4e7244['as'],'attributes':_0x4e7244[_0xe263('0x19')],'include':_0x4e7244['include']?_[_0xe263('0x1c')](_0x4e7244[_0xe263('0x1b')],function(_0xf01876){return{'model':db[_0xf01876[_0xe263('0x1d')]],'as':_0xf01876['as'],'attributes':_0xf01876[_0xe263('0x19')],'include':_0xf01876[_0xe263('0x1b')]?_['map'](_0xf01876[_0xe263('0x1b')],function(_0x4cf3f1){return{'model':db[_0x4cf3f1[_0xe263('0x1d')]],'as':_0x4cf3f1['as'],'attributes':_0x4cf3f1[_0xe263('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3429e1){logger[_0xe263('0xb')](_0xe263('0x1e'),_0x1d1d4e);logger['debug'](_0xe263('0x1e'),_0x1d1d4e,JSON['stringify'](_0x3429e1));_0x18ba56(_0x3429e1);})[_0xe263('0x13')](function(_0x8365a5){logger[_0xe263('0x11')](_0xe263('0x1e'),_0x8365a5[_0xe263('0x12')],_0x1d1d4e);_0x27388c(_0x4edde2[_0xe263('0x11')](0x1f4,_0x8365a5[_0xe263('0x12')]));});});}; \ No newline at end of file +var _0x3daa=['Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','GetTrunk','findAll','options','where','attributes','limit','map','include','model','stringify','ShowTrunk','Trunk','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1fdd3e,_0x22735b){var _0x2da065=function(_0x45f972){while(--_0x45f972){_0x1fdd3e['push'](_0x1fdd3e['shift']());}};_0x2da065(++_0x22735b);}(_0x3daa,0x1c4));var _0xa3da=function(_0x19c45e,_0x3d1db7){_0x19c45e=_0x19c45e-0x0;var _0x48f142=_0x3daa[_0x19c45e];return _0x48f142;};'use strict';var _=require(_0xa3da('0x0'));var util=require(_0xa3da('0x1'));var moment=require(_0xa3da('0x2'));var BPromise=require(_0xa3da('0x3'));var rs=require(_0xa3da('0x4'));var fs=require('fs');var Redis=require(_0xa3da('0x5'));var db=require(_0xa3da('0x6'))['db'];var utils=require(_0xa3da('0x7'));var logger=require(_0xa3da('0x8'))(_0xa3da('0x9'));var config=require(_0xa3da('0xa'));var jayson=require(_0xa3da('0xb'));var client=jayson[_0xa3da('0xc')][_0xa3da('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5e6840,_0x8b195c,_0x14c8a1){return new BPromise(function(_0x280f30,_0x406493){return client[_0xa3da('0xe')](_0x5e6840,_0x14c8a1)[_0xa3da('0xf')](function(_0xd92bec){logger['info'](_0xa3da('0x10'),_0x8b195c,_0xa3da('0x11'));logger[_0xa3da('0x12')]('Trunk,\x20%s,\x20%s,\x20%s',_0x8b195c,_0xa3da('0x11'),JSON['stringify'](_0xd92bec));if(_0xd92bec[_0xa3da('0x13')]){if(_0xd92bec[_0xa3da('0x13')][_0xa3da('0x14')]===0x1f4){logger[_0xa3da('0x13')](_0xa3da('0x10'),_0x8b195c,_0xd92bec[_0xa3da('0x13')][_0xa3da('0x15')]);return _0x406493(_0xd92bec[_0xa3da('0x13')]['message']);}logger[_0xa3da('0x13')](_0xa3da('0x10'),_0x8b195c,_0xd92bec[_0xa3da('0x13')][_0xa3da('0x15')]);return _0x280f30(_0xd92bec['error'][_0xa3da('0x15')]);}else{logger[_0xa3da('0x16')](_0xa3da('0x10'),_0x8b195c,_0xa3da('0x11'));_0x280f30(_0xd92bec[_0xa3da('0x17')][_0xa3da('0x15')]);}})[_0xa3da('0x18')](function(_0x528f58){logger[_0xa3da('0x13')]('Trunk,\x20%s,\x20%s',_0x8b195c,_0x528f58);_0x406493(_0x528f58);});});}exports[_0xa3da('0x19')]=function(_0x363a7a){var _0x52a17e=this;return new Promise(function(_0x6540f8,_0x417869){return db['Trunk'][_0xa3da('0x1a')]({'raw':_0x363a7a[_0xa3da('0x1b')]?_0x363a7a[_0xa3da('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x363a7a[_0xa3da('0x1b')]?_0x363a7a[_0xa3da('0x1b')][_0xa3da('0x1c')]||null:null,'attributes':_0x363a7a[_0xa3da('0x1b')]?_0x363a7a[_0xa3da('0x1b')][_0xa3da('0x1d')]||null:null,'limit':_0x363a7a[_0xa3da('0x1b')]?_0x363a7a[_0xa3da('0x1b')][_0xa3da('0x1e')]||null:null,'include':_0x363a7a[_0xa3da('0x1b')]?_0x363a7a[_0xa3da('0x1b')]['include']?_[_0xa3da('0x1f')](_0x363a7a[_0xa3da('0x1b')]['include'],function(_0x530b20){return{'model':db[_0x530b20['model']],'as':_0x530b20['as'],'attributes':_0x530b20['attributes'],'include':_0x530b20[_0xa3da('0x20')]?_['map'](_0x530b20[_0xa3da('0x20')],function(_0x523d8d){return{'model':db[_0x523d8d[_0xa3da('0x21')]],'as':_0x523d8d['as'],'attributes':_0x523d8d['attributes'],'include':_0x523d8d[_0xa3da('0x20')]?_[_0xa3da('0x1f')](_0x523d8d[_0xa3da('0x20')],function(_0x2a4a7a){return{'model':db[_0x2a4a7a[_0xa3da('0x21')]],'as':_0x2a4a7a['as'],'attributes':_0x2a4a7a[_0xa3da('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa3da('0xf')](function(_0x247569){logger['info'](_0xa3da('0x19'),_0x363a7a);logger[_0xa3da('0x12')](_0xa3da('0x19'),_0x363a7a,JSON[_0xa3da('0x22')](_0x247569));_0x6540f8(_0x247569);})[_0xa3da('0x18')](function(_0x5291d0){logger[_0xa3da('0x13')](_0xa3da('0x19'),_0x5291d0[_0xa3da('0x15')],_0x363a7a);_0x417869(_0x52a17e['error'](0x1f4,_0x5291d0[_0xa3da('0x15')]));});});};exports[_0xa3da('0x23')]=function(_0x16ef0a){var _0x5eecdb=this;return new Promise(function(_0x3317b0,_0x1061cb){return db[_0xa3da('0x24')][_0xa3da('0x25')]({'raw':_0x16ef0a[_0xa3da('0x1b')]?_0x16ef0a[_0xa3da('0x1b')][_0xa3da('0x26')]===undefined?!![]:![]:!![],'where':_0x16ef0a[_0xa3da('0x1b')]?_0x16ef0a[_0xa3da('0x1b')][_0xa3da('0x1c')]||null:null,'attributes':_0x16ef0a[_0xa3da('0x1b')]?_0x16ef0a[_0xa3da('0x1b')][_0xa3da('0x1d')]||null:null,'include':_0x16ef0a['options']?_0x16ef0a[_0xa3da('0x1b')][_0xa3da('0x20')]?_[_0xa3da('0x1f')](_0x16ef0a[_0xa3da('0x1b')][_0xa3da('0x20')],function(_0x40ffb3){return{'model':db[_0x40ffb3[_0xa3da('0x21')]],'as':_0x40ffb3['as'],'attributes':_0x40ffb3[_0xa3da('0x1d')],'include':_0x40ffb3['include']?_[_0xa3da('0x1f')](_0x40ffb3[_0xa3da('0x20')],function(_0x4e93d3){return{'model':db[_0x4e93d3[_0xa3da('0x21')]],'as':_0x4e93d3['as'],'attributes':_0x4e93d3[_0xa3da('0x1d')],'include':_0x4e93d3[_0xa3da('0x20')]?_[_0xa3da('0x1f')](_0x4e93d3['include'],function(_0xb4f745){return{'model':db[_0xb4f745[_0xa3da('0x21')]],'as':_0xb4f745['as'],'attributes':_0xb4f745[_0xa3da('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa3da('0xf')](function(_0x254f84){logger[_0xa3da('0x16')](_0xa3da('0x23'),_0x16ef0a);logger[_0xa3da('0x12')](_0xa3da('0x23'),_0x16ef0a,JSON[_0xa3da('0x22')](_0x254f84));_0x3317b0(_0x254f84);})[_0xa3da('0x18')](function(_0x173d7c){logger['error'](_0xa3da('0x23'),_0x173d7c[_0xa3da('0x15')],_0x16ef0a);_0x1061cb(_0x5eecdb[_0xa3da('0x13')](0x1f4,_0x173d7c[_0xa3da('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 15d992c..fb5b796 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b1d=['update','exports','Router','../../components/auth/service','./user-setting.controller','/:id'];(function(_0x4b6b8b,_0x73c39){var _0x2b2295=function(_0x52a6e7){while(--_0x52a6e7){_0x4b6b8b['push'](_0x4b6b8b['shift']());}};_0x2b2295(++_0x73c39);}(_0x1b1d,0x140));var _0xd1b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b1d[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0xd1b1('0x0')]();var auth=require(_0xd1b1('0x1'));var controller=require(_0xd1b1('0x2'));router['put'](_0xd1b1('0x3'),auth['isAuthenticated'](),controller[_0xd1b1('0x4')]);module[_0xd1b1('0x5')]=router; \ No newline at end of file +var _0xbaae=['Router','../../components/auth/service','./user-setting.controller','put','/:id','update','exports'];(function(_0x1f5908,_0xf1fefa){var _0x4b7734=function(_0x21e81a){while(--_0x21e81a){_0x1f5908['push'](_0x1f5908['shift']());}};_0x4b7734(++_0xf1fefa);}(_0xbaae,0x8c));var _0xebaa=function(_0x1fe120,_0x3a3305){_0x1fe120=_0x1fe120-0x0;var _0x50e5dd=_0xbaae[_0x1fe120];return _0x50e5dd;};'use strict';var express=require('express');var router=express[_0xebaa('0x0')]();var auth=require(_0xebaa('0x1'));var controller=require(_0xebaa('0x2'));router[_0xebaa('0x3')](_0xebaa('0x4'),auth['isAuthenticated'](),controller[_0xebaa('0x5')]);module[_0xebaa('0x6')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index dac6ad8..661efeb 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x95ad=['error','info','debug','exports','ENUM','BOOLEAN','TEXT','DATE','UserId','sequelize'];(function(_0x35e244,_0x5b2e8c){var _0x501c55=function(_0x15e236){while(--_0x15e236){_0x35e244['push'](_0x35e244['shift']());}};_0x501c55(++_0x5b2e8c);}(_0x95ad,0x6d));var _0xd95a=function(_0x361c42,_0x5b810a){_0x361c42=_0x361c42-0x0;var _0x53190a=_0x95ad[_0x361c42];return _0x53190a;};'use strict';var Sequelize=require(_0xd95a('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xd95a('0x1'),'warning',_0xd95a('0x2'),_0xd95a('0x3')];module[_0xd95a('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xd95a('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xd95a('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xd95a('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xd95a('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0xd95a('0x9')}}; \ No newline at end of file +var _0x853d=['debug','exports','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','error'];(function(_0x111361,_0x544d53){var _0x43bff1=function(_0x33535a){while(--_0x33535a){_0x111361['push'](_0x111361['shift']());}};_0x43bff1(++_0x544d53);}(_0x853d,0x12a));var _0xd853=function(_0x55e839,_0x3b5345){_0x55e839=_0x55e839-0x0;var _0x39c61a=_0x853d[_0x55e839];return _0x39c61a;};'use strict';var Sequelize=require(_0xd853('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xd853('0x1'),'warning','info',_0xd853('0x2')];module[_0xd853('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0xd853('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xd853('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xd853('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xd853('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xd853('0x8')],'unique':_0xd853('0x9')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 8b982e8..7cdd561 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c4a=['error','stack','name','send','user','Unauthorized','find','params','body','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','./user-setting.socket','register','defaults','localhost','status','json','update','then'];(function(_0x2ff03b,_0x1206be){var _0x1df7d3=function(_0x27f0a5){while(--_0x27f0a5){_0x2ff03b['push'](_0x2ff03b['shift']());}};_0x1df7d3(++_0x1206be);}(_0x5c4a,0xfb));var _0xa5c4=function(_0x2bcb71,_0x1bd33c){_0x2bcb71=_0x2bcb71-0x0;var _0x58ce62=_0x5c4a[_0x2bcb71];return _0x58ce62;};'use strict';var _=require('lodash');var Redis=require(_0xa5c4('0x0'));var logger=require(_0xa5c4('0x1'))('api');var config=require(_0xa5c4('0x2'));var db=require(_0xa5c4('0x3'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xa5c4('0x4')]));require(_0xa5c4('0x5'))[_0xa5c4('0x6')](socket);config[_0xa5c4('0x4')]=_[_0xa5c4('0x7')](config['redis'],{'host':_0xa5c4('0x8'),'port':0x18eb});function respondWithResult(_0x4210e8,_0x163c03){_0x163c03=_0x163c03||0xc8;return function(_0x435ccb){if(_0x435ccb){return _0x4210e8[_0xa5c4('0x9')](_0x163c03)[_0xa5c4('0xa')](_0x435ccb);}};}function saveUpdates(_0x4cd657){return function(_0x11e089){if(_0x11e089){return _0x11e089[_0xa5c4('0xb')](_0x4cd657)[_0xa5c4('0xc')](function(_0x51c7b1){return _0x51c7b1;});}return null;};}function handleEntityNotFound(_0x5e986b){return function(_0x179fcd){if(!_0x179fcd){_0x5e986b['sendStatus'](0x194);}return _0x179fcd;};}function handleError(_0x34db1f,_0x32acea){_0x32acea=_0x32acea||0x1f4;return function(_0x4eb7cd){logger[_0xa5c4('0xd')](_0x4eb7cd[_0xa5c4('0xe')]);if(_0x4eb7cd[_0xa5c4('0xf')]){delete _0x4eb7cd[_0xa5c4('0xf')];}_0x34db1f[_0xa5c4('0x9')](_0x32acea)[_0xa5c4('0x10')](_0x4eb7cd);};}exports[_0xa5c4('0xb')]=function(_0x2f9a4a,_0x4c82d6){if(_0x2f9a4a[_0xa5c4('0x11')]['role']!=='admin')throw new Error(_0xa5c4('0x12'));if(isNaN(Number(_0x2f9a4a['params']['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db['UserSetting'][_0xa5c4('0x13')]({'where':{'id':_0x2f9a4a[_0xa5c4('0x14')]['id']}})[_0xa5c4('0xc')](handleEntityNotFound(_0x4c82d6,null))[_0xa5c4('0xc')](saveUpdates(_0x2f9a4a[_0xa5c4('0x15')],null))[_0xa5c4('0xc')](respondWithResult(_0x4c82d6,null))['catch'](handleError(_0x4c82d6,null));}; \ No newline at end of file +var _0x6108=['../../config/logger','api','../../config/environment','redis','./user-setting.socket','defaults','localhost','json','then','sendStatus','error','stack','name','send','update','user','Unauthorized','params','Invalid\x20user\x20setting\x20id','body','lodash'];(function(_0x1c4006,_0x2524d4){var _0x19586e=function(_0x75a04b){while(--_0x75a04b){_0x1c4006['push'](_0x1c4006['shift']());}};_0x19586e(++_0x2524d4);}(_0x6108,0xbc));var _0x8610=function(_0x10e43c,_0x325992){_0x10e43c=_0x10e43c-0x0;var _0x2a46bc=_0x6108[_0x10e43c];return _0x2a46bc;};'use strict';var _=require(_0x8610('0x0'));var Redis=require('ioredis');var logger=require(_0x8610('0x1'))(_0x8610('0x2'));var config=require(_0x8610('0x3'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x8610('0x4')]));require(_0x8610('0x5'))['register'](socket);config['redis']=_[_0x8610('0x6')](config[_0x8610('0x4')],{'host':_0x8610('0x7'),'port':0x18eb});function respondWithResult(_0x26dab3,_0x4e0fe4){_0x4e0fe4=_0x4e0fe4||0xc8;return function(_0x174f41){if(_0x174f41){return _0x26dab3['status'](_0x4e0fe4)[_0x8610('0x8')](_0x174f41);}};}function saveUpdates(_0x2255a0){return function(_0x21774e){if(_0x21774e){return _0x21774e['update'](_0x2255a0)[_0x8610('0x9')](function(_0x3682b9){return _0x3682b9;});}return null;};}function handleEntityNotFound(_0x46854f){return function(_0x1eb419){if(!_0x1eb419){_0x46854f[_0x8610('0xa')](0x194);}return _0x1eb419;};}function handleError(_0x1da432,_0x4b3af2){_0x4b3af2=_0x4b3af2||0x1f4;return function(_0x1b6c16){logger[_0x8610('0xb')](_0x1b6c16[_0x8610('0xc')]);if(_0x1b6c16['name']){delete _0x1b6c16[_0x8610('0xd')];}_0x1da432['status'](_0x4b3af2)[_0x8610('0xe')](_0x1b6c16);};}exports[_0x8610('0xf')]=function(_0x413324,_0x277942){if(_0x413324[_0x8610('0x10')]['role']!=='admin')throw new Error(_0x8610('0x11'));if(isNaN(Number(_0x413324[_0x8610('0x12')]['id'])))throw new Error(_0x8610('0x13'));return db['UserSetting']['find']({'where':{'id':_0x413324['params']['id']}})[_0x8610('0x9')](handleEntityNotFound(_0x277942,null))[_0x8610('0x9')](saveUpdates(_0x413324[_0x8610('0x14')],null))[_0x8610('0x9')](respondWithResult(_0x277942,null))['catch'](handleError(_0x277942,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 559643f..4a68ac5 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35d1=['events','../../mysqldb','UserSetting','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x108d68,_0x9b39de){var _0x11476a=function(_0x21cc20){while(--_0x21cc20){_0x108d68['push'](_0x108d68['shift']());}};_0x11476a(++_0x9b39de);}(_0x35d1,0x144));var _0x135d=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0x35d1[_0x136619];return _0x38c4a5;};'use strict';var EventEmitter=require(_0x135d('0x0'));var UserSetting=require(_0x135d('0x1'))['db'][_0x135d('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x135d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x135d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5e6504){return function(_0x23b8f2,_0x528596,_0x381c78){UserSettingEvents['emit'](_0x5e6504+':'+_0x23b8f2['id'],_0x23b8f2);UserSettingEvents[_0x135d('0x5')](_0x5e6504,_0x23b8f2);_0x381c78(null);};}for(var e in events){if(events[_0x135d('0x6')](e)){var event=events[e];UserSetting[_0x135d('0x7')](e,emitEvent(event));}}module[_0x135d('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x9f1d=['UserSetting','setMaxListeners','update','emit','hook','exports','events','../../mysqldb'];(function(_0x1d7d68,_0x4a407d){var _0x456c44=function(_0x348a5a){while(--_0x348a5a){_0x1d7d68['push'](_0x1d7d68['shift']());}};_0x456c44(++_0x4a407d);}(_0x9f1d,0x1be));var _0xd9f1=function(_0x25a97a,_0x4e6512){_0x25a97a=_0x25a97a-0x0;var _0x2c7965=_0x9f1d[_0x25a97a];return _0x2c7965;};'use strict';var EventEmitter=require(_0xd9f1('0x0'));var UserSetting=require(_0xd9f1('0x1'))['db'][_0xd9f1('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xd9f1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd9f1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x56574a){return function(_0x3c906a,_0x21b255,_0x102c46){UserSettingEvents[_0xd9f1('0x5')](_0x56574a+':'+_0x3c906a['id'],_0x3c906a);UserSettingEvents[_0xd9f1('0x5')](_0x56574a,_0x3c906a);_0x102c46(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xd9f1('0x6')](e,emitEvent(event));}}module[_0xd9f1('0x7')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 7280c1f..490aee2 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ea9=['exports','define','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x55bdf7,_0x3f7fca){var _0x55465f=function(_0x2c2a9a){while(--_0x2c2a9a){_0x55bdf7['push'](_0x55bdf7['shift']());}};_0x55465f(++_0x3f7fca);}(_0x6ea9,0x89));var _0x96ea=function(_0x9a7de4,_0x1b6585){_0x9a7de4=_0x9a7de4-0x0;var _0x7af308=_0x6ea9[_0x9a7de4];return _0x7af308;};'use strict';var attributes=require(_0x96ea('0x0'));module[_0x96ea('0x1')]=function(_0x27c316){return _0x27c316[_0x96ea('0x2')](_0x96ea('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1fb6c1){if(!_0x1fb6c1[_0x96ea('0x4')])_0x1fb6c1[_0x96ea('0x5')]=null;else if(_0x1fb6c1['clientSideLoggingEnabledSince']===null)_0x1fb6c1[_0x96ea('0x5')]=new Date();}}});}; \ No newline at end of file +var _0x63a5=['UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x37f64a,_0x53a4a9){var _0x137153=function(_0x34ad32){while(--_0x34ad32){_0x37f64a['push'](_0x37f64a['shift']());}};_0x137153(++_0x53a4a9);}(_0x63a5,0x18e));var _0x563a=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x63a5[_0x5a95fa];return _0x1a61b8;};'use strict';var attributes=require(_0x563a('0x0'));module[_0x563a('0x1')]=function(_0x91178){return _0x91178['define'](_0x563a('0x2'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x922339){if(!_0x922339[_0x563a('0x3')])_0x922339[_0x563a('0x4')]=null;else if(_0x922339[_0x563a('0x4')]===null)_0x922339['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 1a96747..4e5126e 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3029=['./user-setting.events','save','remove','update','user-setting:update','emit','user-setting:update:user-','length'];(function(_0x19f5fc,_0x4c658a){var _0x315fa3=function(_0x2198b5){while(--_0x2198b5){_0x19f5fc['push'](_0x19f5fc['shift']());}};_0x315fa3(++_0x4c658a);}(_0x3029,0x90));var _0x9302=function(_0x462bff,_0x151a16){_0x462bff=_0x462bff-0x0;var _0x27229a=_0x3029[_0x462bff];return _0x27229a;};'use strict';var UserSettingEvents=require(_0x9302('0x0'));var events=[_0x9302('0x1'),_0x9302('0x2'),_0x9302('0x3')];function createListener(_0x4ad307,_0x4c82be){return function(_0x1d6a2d){_0x4c82be['emit'](_0x4ad307,_0x1d6a2d);if(_0x4ad307===_0x9302('0x4')){_0x4c82be[_0x9302('0x5')](_0x9302('0x6')+_0x1d6a2d['UserId'],_0x1d6a2d);}};}exports['register']=function(_0x286901){for(var _0x293e47=0x0,_0x13d224=events[_0x9302('0x7')];_0x293e47<_0x13d224;_0x293e47++){var _0x58a501=events[_0x293e47];var _0x49ac51=createListener('user-setting:'+_0x58a501,_0x286901);UserSettingEvents['on'](_0x58a501,_0x49ac51);}}; \ No newline at end of file +var _0x6d54=['length','user-setting:','./user-setting.events','remove','update','emit','user-setting:update','UserId','register'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6d54,0x1f1));var _0x46d5=function(_0x5db291,_0x436956){_0x5db291=_0x5db291-0x0;var _0x54a80e=_0x6d54[_0x5db291];return _0x54a80e;};'use strict';var UserSettingEvents=require(_0x46d5('0x0'));var events=['save',_0x46d5('0x1'),_0x46d5('0x2')];function createListener(_0xd7b17c,_0x514516){return function(_0x26573){_0x514516[_0x46d5('0x3')](_0xd7b17c,_0x26573);if(_0xd7b17c===_0x46d5('0x4')){_0x514516[_0x46d5('0x3')]('user-setting:update:user-'+_0x26573[_0x46d5('0x5')],_0x26573);}};}exports[_0x46d5('0x6')]=function(_0x26fbac){for(var _0x4597e6=0x0,_0x4564de=events[_0x46d5('0x7')];_0x4597e6<_0x4564de;_0x4597e6++){var _0x38b437=events[_0x4597e6];var _0x7962c4=createListener(_0x46d5('0x8')+_0x38b437,_0x26fbac);UserSettingEvents['on'](_0x38b437,_0x7962c4);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index e5d522d..45f5ee1 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 _0xcdf0=['/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','single','file','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','changePassword','delete','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','whoami','/presence','getPresence','/:id','show','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','addContacts','create'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xcdf0,0xa8));var _0x0cdf=function(_0x4ce818,_0xc23665){_0x4ce818=_0x4ce818-0x0;var _0x4c8d65=_0xcdf0[_0x4ce818];return _0x4c8d65;};'use strict';var multer=require(_0x0cdf('0x0'));var util=require(_0x0cdf('0x1'));var path=require(_0x0cdf('0x2'));var timeout=require(_0x0cdf('0x3'));var express=require(_0x0cdf('0x4'));var router=express['Router']();var fs_extra=require(_0x0cdf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0cdf('0x6'));var config=require('../../config/environment');var controller=require('./user.controller');router[_0x0cdf('0x7')]('/',auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x9')]);router[_0x0cdf('0x7')](_0x0cdf('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0cdf('0x7')]('/whoami',auth[_0x0cdf('0x8')](),controller[_0x0cdf('0xb')]);router['get'](_0x0cdf('0xc'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0xd')]);router['get'](_0x0cdf('0xe'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0xf')]);router[_0x0cdf('0x7')]('/:id/avatar',controller[_0x0cdf('0x10')]);router[_0x0cdf('0x7')]('/:id/open_tabs',auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x11')]);router[_0x0cdf('0x7')](_0x0cdf('0x12'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x13')]);router['get'](_0x0cdf('0x14'),auth[_0x0cdf('0x8')](),controller['getQueues']);router[_0x0cdf('0x7')](_0x0cdf('0x15'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x16')]);router['get']('/:id/groups',auth[_0x0cdf('0x8')](),controller['getGroups']);router[_0x0cdf('0x7')](_0x0cdf('0x17'),auth['isAuthenticated'](),controller['getRecordings']);router['get']('/:id/screen_recordings',auth[_0x0cdf('0x8')](),controller['getScreenRecordings']);router[_0x0cdf('0x7')](_0x0cdf('0x18'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x19')]);router[_0x0cdf('0x7')](_0x0cdf('0x1a'),auth['isAuthenticated'](),controller[_0x0cdf('0x1b')]);router[_0x0cdf('0x7')](_0x0cdf('0x1c'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x1d')]);router[_0x0cdf('0x7')]('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0x0cdf('0x1e')]);router[_0x0cdf('0x7')](_0x0cdf('0x1f'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x20')]);router['get'](_0x0cdf('0x21'),auth['isAuthenticated'](),controller[_0x0cdf('0x22')]);router[_0x0cdf('0x7')](_0x0cdf('0x23'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x24')]);router[_0x0cdf('0x7')](_0x0cdf('0x25'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x26')]);router[_0x0cdf('0x7')]('/:id/agents',auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x27')]);router[_0x0cdf('0x7')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x0cdf('0x28')]);router['get'](_0x0cdf('0x29'),auth['isAuthenticated'](),controller[_0x0cdf('0x2a')]);router[_0x0cdf('0x7')](_0x0cdf('0x2b'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x2c')]);router['get'](_0x0cdf('0x2d'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0x0cdf('0x7')](_0x0cdf('0x2e'),auth['isAuthenticated'](),controller[_0x0cdf('0x2f')]);router[_0x0cdf('0x7')]('/:id/chat_websites',auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x0cdf('0x7')](_0x0cdf('0x30'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x31')]);router['get'](_0x0cdf('0x32'),auth['isAuthenticated'](),controller[_0x0cdf('0x33')]);router[_0x0cdf('0x7')](_0x0cdf('0x34'),auth[_0x0cdf('0x8')](),controller['getApiKey']);router[_0x0cdf('0x35')](_0x0cdf('0x12'),auth['isAuthenticated'](),controller[_0x0cdf('0x36')]);router['post']('/',auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x37')]);router[_0x0cdf('0x35')](_0x0cdf('0x38'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x39')]);router[_0x0cdf('0x35')](_0x0cdf('0x14'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x3a')]);var upload=multer({'storage':multer[_0x0cdf('0x3b')]({'destination':function(_0xcdf2f7,_0x35eb2c,_0x55de2e){_0x55de2e(null,path[_0x0cdf('0x3c')](config[_0x0cdf('0x3d')],_0x0cdf('0x3e')));},'filename':function(_0x15f1cb,_0x547e96,_0x3847a8){_0x3847a8(null,util[_0x0cdf('0x3f')](_0x0cdf('0x40'),Date[_0x0cdf('0x41')](),_0x547e96['originalname']));}})});router['post']('/:id/avatar',upload[_0x0cdf('0x42')](_0x0cdf('0x43')),controller['addAvatar']);router[_0x0cdf('0x35')](_0x0cdf('0x44'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x45')]);router[_0x0cdf('0x35')](_0x0cdf('0x46'),auth['isAuthenticated'](),controller[_0x0cdf('0x47')]);router[_0x0cdf('0x35')](_0x0cdf('0x48'),auth['isAuthenticated'](),controller[_0x0cdf('0x49')]);router[_0x0cdf('0x35')](_0x0cdf('0x4a'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x4b')]);router[_0x0cdf('0x35')](_0x0cdf('0x23'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x4c')]);router['post'](_0x0cdf('0x4d'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x4e')]);router['post']('/:id/mail_interactions',auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x4f')]);router[_0x0cdf('0x35')](_0x0cdf('0x50'),auth['isAuthenticated'](),controller[_0x0cdf('0x51')]);router['post'](_0x0cdf('0x52'),auth['isAuthenticated'](),controller[_0x0cdf('0x53')]);router[_0x0cdf('0x35')](_0x0cdf('0x54'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x55')]);router[_0x0cdf('0x35')](_0x0cdf('0x56'),auth[_0x0cdf('0x8')](),controller['addWhatsappInteractions']);router['post'](_0x0cdf('0x29'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x57')]);router[_0x0cdf('0x35')](_0x0cdf('0x2b'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x58')]);router[_0x0cdf('0x35')](_0x0cdf('0x2d'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x59')]);router['post']('/:id/sms_accounts',auth[_0x0cdf('0x8')](),controller['addSmsAccounts']);router[_0x0cdf('0x35')](_0x0cdf('0x5a'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x5b')]);router[_0x0cdf('0x35')](_0x0cdf('0x30'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x5c')]);router['post'](_0x0cdf('0x34'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x5d')]);router[_0x0cdf('0x5e')](_0x0cdf('0xe'),auth['isAuthenticated'](),controller[_0x0cdf('0x5f')]);router['put'](_0x0cdf('0x60'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x61')]);router[_0x0cdf('0x62')](_0x0cdf('0x14'),auth[_0x0cdf('0x8')](),controller['removeQueues']);router['delete'](_0x0cdf('0x23'),auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id',auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x63')]);router[_0x0cdf('0x62')](_0x0cdf('0x4d'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x64')]);router[_0x0cdf('0x62')](_0x0cdf('0x65'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x66')]);router[_0x0cdf('0x62')](_0x0cdf('0x50'),auth[_0x0cdf('0x8')](),controller['removeFaxInteractions']);router[_0x0cdf('0x62')](_0x0cdf('0x52'),auth['isAuthenticated'](),controller[_0x0cdf('0x67')]);router['delete'](_0x0cdf('0x54'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x68')]);router[_0x0cdf('0x62')](_0x0cdf('0x56'),auth['isAuthenticated'](),controller[_0x0cdf('0x69')]);router[_0x0cdf('0x62')](_0x0cdf('0x29'),auth['isAuthenticated'](),controller[_0x0cdf('0x6a')]);router[_0x0cdf('0x62')](_0x0cdf('0x2b'),auth[_0x0cdf('0x8')](),controller['removeMailAccounts']);router[_0x0cdf('0x62')](_0x0cdf('0x2d'),auth[_0x0cdf('0x8')](),controller['removeOpenchannelAccounts']);router[_0x0cdf('0x62')](_0x0cdf('0x2e'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router[_0x0cdf('0x62')](_0x0cdf('0x5a'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x6b')]);router[_0x0cdf('0x62')](_0x0cdf('0x30'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x6c')]);router['delete'](_0x0cdf('0x34'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x6d')]);router[_0x0cdf('0x35')](_0x0cdf('0x6e'),auth[_0x0cdf('0x8')](),controller[_0x0cdf('0x6f')]);module['exports']=router; \ No newline at end of file +var _0x26fb=['addChatWebsites','addWhatsappAccounts','createApiKey','put','changePassword','removeQueues','delete','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','/:id/api_key','getApiKey','post','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','now','single','file','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addSmsAccounts'];(function(_0x5e56d2,_0x69a9d9){var _0x382751=function(_0x44c5ef){while(--_0x44c5ef){_0x5e56d2['push'](_0x5e56d2['shift']());}};_0x382751(++_0x69a9d9);}(_0x26fb,0x1f4));var _0xb26f=function(_0x1c9fc4,_0x240343){_0x1c9fc4=_0x1c9fc4-0x0;var _0x2efcba=_0x26fb[_0x1c9fc4];return _0x2efcba;};'use strict';var multer=require(_0xb26f('0x0'));var util=require(_0xb26f('0x1'));var path=require(_0xb26f('0x2'));var timeout=require(_0xb26f('0x3'));var express=require(_0xb26f('0x4'));var router=express[_0xb26f('0x5')]();var fs_extra=require(_0xb26f('0x6'));var auth=require(_0xb26f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb26f('0x8'));var controller=require(_0xb26f('0x9'));router[_0xb26f('0xa')]('/',auth[_0xb26f('0xb')](),controller[_0xb26f('0xc')]);router['get'](_0xb26f('0xd'),auth[_0xb26f('0xb')](),controller[_0xb26f('0xe')]);router[_0xb26f('0xa')](_0xb26f('0xf'),auth['isAuthenticated'](),controller[_0xb26f('0x10')]);router[_0xb26f('0xa')](_0xb26f('0x11'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x12')]);router[_0xb26f('0xa')](_0xb26f('0x13'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x14')]);router[_0xb26f('0xa')](_0xb26f('0x15'),controller[_0xb26f('0x16')]);router[_0xb26f('0xa')](_0xb26f('0x17'),auth['isAuthenticated'](),controller[_0xb26f('0x18')]);router[_0xb26f('0xa')](_0xb26f('0x19'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x1a')]);router[_0xb26f('0xa')](_0xb26f('0x1b'),auth['isAuthenticated'](),controller['getQueues']);router[_0xb26f('0xa')](_0xb26f('0x1c'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x1d')]);router['get'](_0xb26f('0x1e'),auth[_0xb26f('0xb')](),controller['getGroups']);router['get'](_0xb26f('0x1f'),auth[_0xb26f('0xb')](),controller['getRecordings']);router[_0xb26f('0xa')](_0xb26f('0x20'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x21')]);router['get'](_0xb26f('0x22'),auth['isAuthenticated'](),controller[_0xb26f('0x23')]);router[_0xb26f('0xa')](_0xb26f('0x24'),auth['isAuthenticated'](),controller[_0xb26f('0x25')]);router['get'](_0xb26f('0x26'),auth['isAuthenticated'](),controller[_0xb26f('0x27')]);router[_0xb26f('0xa')](_0xb26f('0x28'),auth['isAuthenticated'](),controller[_0xb26f('0x29')]);router[_0xb26f('0xa')](_0xb26f('0x2a'),auth[_0xb26f('0xb')](),controller['getFaxInteractions']);router[_0xb26f('0xa')](_0xb26f('0x2b'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x2c')]);router[_0xb26f('0xa')]('/:id/teams',auth[_0xb26f('0xb')](),controller[_0xb26f('0x2d')]);router[_0xb26f('0xa')](_0xb26f('0x2e'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x2f')]);router[_0xb26f('0xa')](_0xb26f('0x30'),auth['isAuthenticated'](),controller[_0xb26f('0x31')]);router[_0xb26f('0xa')](_0xb26f('0x32'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0xb26f('0xa')](_0xb26f('0x33'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x34')]);router[_0xb26f('0xa')]('/:id/mail_accounts',auth[_0xb26f('0xb')](),controller[_0xb26f('0x35')]);router['get'](_0xb26f('0x36'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x37')]);router['get'](_0xb26f('0x38'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x39')]);router[_0xb26f('0xa')](_0xb26f('0x3a'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x3b')]);router[_0xb26f('0xa')](_0xb26f('0x3c'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x3d')]);router[_0xb26f('0xa')](_0xb26f('0x3e'),auth[_0xb26f('0xb')](),controller['getScheduledCalls']);router[_0xb26f('0xa')](_0xb26f('0x3f'),auth['isAuthenticated'](),controller[_0xb26f('0x40')]);router[_0xb26f('0x41')](_0xb26f('0x19'),auth['isAuthenticated'](),controller['addContacts']);router[_0xb26f('0x41')]('/',auth['isAuthenticated'](),controller[_0xb26f('0x42')]);router[_0xb26f('0x41')](_0xb26f('0x43'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x44')]);router[_0xb26f('0x41')]('/:id/queues',auth['isAuthenticated'](),controller[_0xb26f('0x45')]);var upload=multer({'storage':multer[_0xb26f('0x46')]({'destination':function(_0x44d009,_0x102ee2,_0x4b01fc){_0x4b01fc(null,path[_0xb26f('0x47')](config[_0xb26f('0x48')],_0xb26f('0x49')));},'filename':function(_0x1e0476,_0x18e0b6,_0x223c6e){_0x223c6e(null,util[_0xb26f('0x4a')]('%s-%s',Date[_0xb26f('0x4b')](),_0x18e0b6['originalname']));}})});router[_0xb26f('0x41')](_0xb26f('0x15'),upload[_0xb26f('0x4c')](_0xb26f('0x4d')),controller['addAvatar']);router[_0xb26f('0x41')](_0xb26f('0x4e'),auth['isAuthenticated'](),controller['login']);router[_0xb26f('0x41')](_0xb26f('0x4f'),auth['isAuthenticated'](),controller[_0xb26f('0x50')]);router[_0xb26f('0x41')](_0xb26f('0x51'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x52')]);router['post'](_0xb26f('0x53'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x54')]);router[_0xb26f('0x41')](_0xb26f('0x55'),auth[_0xb26f('0xb')](),controller['addTeams']);router['post'](_0xb26f('0x56'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x57')]);router['post'](_0xb26f('0x58'),auth['isAuthenticated'](),controller[_0xb26f('0x59')]);router[_0xb26f('0x41')](_0xb26f('0x5a'),auth['isAuthenticated'](),controller[_0xb26f('0x5b')]);router[_0xb26f('0x41')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0xb26f('0x5c')]);router[_0xb26f('0x41')](_0xb26f('0x5d'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x5e')]);router[_0xb26f('0x41')](_0xb26f('0x5f'),auth[_0xb26f('0xb')](),controller['addWhatsappInteractions']);router[_0xb26f('0x41')](_0xb26f('0x33'),auth['isAuthenticated'](),controller[_0xb26f('0x60')]);router[_0xb26f('0x41')](_0xb26f('0x61'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x62')]);router[_0xb26f('0x41')]('/:id/openchannel_accounts',auth[_0xb26f('0xb')](),controller['addOpenchannelAccounts']);router['post']('/:id/sms_accounts',auth[_0xb26f('0xb')](),controller[_0xb26f('0x63')]);router[_0xb26f('0x41')](_0xb26f('0x3a'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x64')]);router[_0xb26f('0x41')](_0xb26f('0x3c'),auth['isAuthenticated'](),controller[_0xb26f('0x65')]);router[_0xb26f('0x41')](_0xb26f('0x3f'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x66')]);router[_0xb26f('0x67')](_0xb26f('0x13'),auth['isAuthenticated'](),controller['update']);router[_0xb26f('0x67')]('/:id/password',auth[_0xb26f('0xb')](),controller[_0xb26f('0x68')]);router['delete']('/:id/queues',auth['isAuthenticated'](),controller[_0xb26f('0x69')]);router[_0xb26f('0x6a')](_0xb26f('0x55'),auth[_0xb26f('0xb')](),controller['removeTeams']);router[_0xb26f('0x6a')](_0xb26f('0x13'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x6b')]);router[_0xb26f('0x6a')](_0xb26f('0x56'),auth['isAuthenticated'](),controller[_0xb26f('0x6c')]);router[_0xb26f('0x6a')](_0xb26f('0x58'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x6d')]);router[_0xb26f('0x6a')](_0xb26f('0x5a'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x6e')]);router[_0xb26f('0x6a')]('/:id/sms_interactions',auth[_0xb26f('0xb')](),controller['removeSmsInteractions']);router[_0xb26f('0x6a')](_0xb26f('0x5d'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x6f')]);router[_0xb26f('0x6a')]('/:id/whatsapp_interactions',auth[_0xb26f('0xb')](),controller[_0xb26f('0x70')]);router[_0xb26f('0x6a')](_0xb26f('0x33'),auth['isAuthenticated'](),controller[_0xb26f('0x71')]);router[_0xb26f('0x6a')](_0xb26f('0x61'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x72')]);router['delete'](_0xb26f('0x36'),auth[_0xb26f('0xb')](),controller['removeOpenchannelAccounts']);router[_0xb26f('0x6a')]('/:id/sms_accounts',auth[_0xb26f('0xb')](),controller[_0xb26f('0x73')]);router[_0xb26f('0x6a')](_0xb26f('0x3a'),auth[_0xb26f('0xb')](),controller['removeChatWebsites']);router[_0xb26f('0x6a')](_0xb26f('0x3c'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x74')]);router[_0xb26f('0x6a')]('/:id/api_key',auth[_0xb26f('0xb')](),controller[_0xb26f('0x75')]);router[_0xb26f('0x41')](_0xb26f('0x76'),auth[_0xb26f('0xb')](),controller['messengerSoundNotification']);module[_0xb26f('0x77')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 4c3002b..42fe3d8 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 _0x4192=['INTEGER','internal','format','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','rfc2833','info','shortinfo','inband','nonat','yes','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','\x22\x22\x20<>','always','refuse','originate','uas','certificate','passive','actpass','update','update,nonat','TEXT','showWebBar','get','wss','encryption','force_avp','icesupport','dtlsverify','dtlssetup','rtcp_mux','avpf','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','fullname','callerid','\x22%s\x22\x20<%s>','getDataValue','email','ENUM','user','local'];(function(_0x1a1b6e,_0x3a07a9){var _0x571e2c=function(_0x6cea62){while(--_0x6cea62){_0x1a1b6e['push'](_0x1a1b6e['shift']());}};_0x571e2c(++_0x3a07a9);}(_0x4192,0xe3));var _0x2419=function(_0x5b2a15,_0xd200ec){_0x5b2a15=_0x5b2a15-0x0;var _0x33038d=_0x4192[_0x5b2a15];return _0x33038d;};'use strict';var Sequelize=require(_0x2419('0x0'));var moment=require(_0x2419('0x1'));var util=require(_0x2419('0x2'));var _=require('lodash');module[_0x2419('0x3')]={'name':{'type':Sequelize[_0x2419('0x4')],'allowNull':![],'unique':_0x2419('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xa2ac78){this[_0x2419('0x6')](_0x2419('0x5'),_0xa2ac78);this[_0x2419('0x6')](_0x2419('0x7'),_0xa2ac78);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x2419('0x4')],'allowNull':![],'set':function(_0xfe7f4e){this[_0x2419('0x6')](_0x2419('0x8'),_0xfe7f4e);this[_0x2419('0x6')](_0x2419('0x9'),util['format'](_0x2419('0xa'),_0xfe7f4e,this[_0x2419('0xb')]('internal')));}},'alias':{'type':Sequelize[_0x2419('0x4')]},'email':{'type':Sequelize[_0x2419('0x4')],'allowNull':![],'unique':_0x2419('0xc'),'validate':{'isEmail':!![]},'set':function(_0x21a75a){if(_0x21a75a){this['setDataValue'](_0x2419('0xc'),_0x21a75a['toLowerCase']());}}},'role':{'type':Sequelize[_0x2419('0xd')]('admin',_0x2419('0xe'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x2419('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x2419('0xf')},'internal':{'type':Sequelize[_0x2419('0x10')](0xb),'allowNull':![],'unique':_0x2419('0x11'),'set':function(_0x2b25cf){this[_0x2419('0x6')](_0x2419('0x11'),_0x2b25cf);this[_0x2419('0x6')]('accountcode',_0x2b25cf);this[_0x2419('0x6')](_0x2419('0x9'),util[_0x2419('0x12')](_0x2419('0xa'),this[_0x2419('0xb')](_0x2419('0x8')),_0x2b25cf));}},'salt':{'type':Sequelize[_0x2419('0x4')]},'phone':{'type':Sequelize[_0x2419('0x4')]},'mobile':{'type':Sequelize[_0x2419('0x4')]},'address':{'type':Sequelize[_0x2419('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x2419('0x4')]},'city':{'type':Sequelize[_0x2419('0x4')]},'country':{'type':Sequelize[_0x2419('0x4')]},'online':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x2419('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x2419('0x4')],'defaultValue':_0x2419('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x2419('0x10')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x2419('0x10')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x2419('0x10')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x2419('0x10')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x2419('0x10')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x2419('0x10')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x2419('0x10')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x2419('0x10')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x2419('0xd')](_0x2419('0x16'),_0x2419('0xe'),_0x2419('0x17')),'allowNull':!![],'defaultValue':_0x2419('0x16')},'context':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![],'defaultValue':_0x2419('0x18')},'callingpres':{'type':Sequelize[_0x2419('0xd')](_0x2419('0x19'),_0x2419('0x1a'),'ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED',_0x2419('0x1b'),_0x2419('0x1c'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![],'defaultValue':_0x2419('0x1d'),'set':function(_0x51858a){this[_0x2419('0x6')]('transport',_0x51858a?_0x51858a[_0x2419('0x1e')](','):null);},'get':function(){return this[_0x2419('0xb')](_0x2419('0x1f'))?this[_0x2419('0xb')]('transport')[_0x2419('0x20')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x2419('0xd')](_0x2419('0x21'),_0x2419('0x22'),_0x2419('0x23'),_0x2419('0x24'),'auto'),'allowNull':!![],'defaultValue':_0x2419('0x21')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x2419('0x25'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2419('0xd')](_0x2419('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x5a16c8){this[_0x2419('0x6')](_0x2419('0x27'),_0x5a16c8?_0x5a16c8['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x2419('0xb')](_0x2419('0x27'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x2419('0x4')]},'namedcallgroup':{'type':Sequelize[_0x2419('0x4')]},'pickupgroup':{'type':Sequelize[_0x2419('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x2419('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2419('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2419('0x28')},'allow':{'type':Sequelize[_0x2419('0x4')],'allowNull':![],'defaultValue':_0x2419('0x29'),'set':function(_0x5e9f85){this[_0x2419('0x6')](_0x2419('0x2a'),_0x5e9f85?_0x5e9f85[_0x2419('0x1e')](';'):_0x2419('0x29'));},'get':function(){return this[_0x2419('0xb')](_0x2419('0x2a'))?this['getDataValue'](_0x2419('0x2a'))[_0x2419('0x20')](';'):null;},'comment':_0x2419('0x2b')},'autoframing':{'type':Sequelize[_0x2419('0xd')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![],'set':function(_0x5ad9cf){this[_0x2419('0x6')](_0x2419('0x2c'),_0x5ad9cf?_0x5ad9cf[_0x2419('0x1e')](','):null);},'get':function(){return this['getDataValue'](_0x2419('0x2c'))?this['getDataValue'](_0x2419('0x2c'))[_0x2419('0x20')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x2419('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x2419('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x2419('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x2419('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x2419('0x10')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![],'defaultValue':_0x2419('0x2d')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x2419('0xd')](_0x2419('0x26'),'no'),'allowNull':!![],'defaultValue':_0x2419('0x26')},'busylevel':{'type':Sequelize[_0x2419('0x10')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x2419('0xd')](_0x2419('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x2419('0xd')](_0x2419('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x2419('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x2419('0xd')](_0x2419('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x2419('0xd')](_0x2419('0x26'),'no',_0x2419('0x2e')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x2419('0xd')](_0x2419('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x2419('0x2f'),_0x2419('0x30')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x2419('0x10')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x2419('0xd')]('uac',_0x2419('0x31')),'allowNull':!![],'defaultValue':_0x2419('0x31')},'t38pt_usertpsource':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x2419('0xd')](_0x2419('0x26'),'no'),'allowNull':!![],'defaultValue':_0x2419('0x26')},'keepalive':{'type':Sequelize[_0x2419('0x10')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x2419('0x10')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x2419('0x10')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x2419('0xd')](_0x2419('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x2419('0x10')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x2419('0x10')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x2419('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2419('0xd')](_0x2419('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x2419('0xd')](_0x2419('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x2419('0xd')](_0x2419('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x2419('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x2419('0x26'),'no','fingerprint',_0x2419('0x32')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x2419('0xd')]('active',_0x2419('0x33'),_0x2419('0x34')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x2419('0xd')](_0x2419('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x2419('0x10')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x2419('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x2419('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x2419('0x26'),'no',_0x2419('0x25'),_0x2419('0x35'),_0x2419('0x36')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x2419('0x14')]},'passwordResetAt':{'type':Sequelize[_0x2419('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x2419('0x37')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x13d912){this['setDataValue'](_0x2419('0x38'),_0x13d912);var _0x2d6d2f=this[_0x2419('0x39')]({'plain':!![]});switch(_0x13d912){case 0x0:case 0x1:var _0x4c2797=_0x2d6d2f[_0x2419('0x1f')]?_['isArray'](_0x2d6d2f['transport'])?_0x2d6d2f[_0x2419('0x1f')]['join']():_0x2d6d2f['transport']:_0x2419('0x1d');if(_0x4c2797===_0x2419('0x3a')){_0x4c2797=_0x2419('0x1d');}this[_0x2419('0x6')]('transport',_0x4c2797);this[_0x2419('0x6')](_0x2419('0x3b'),'no');this[_0x2419('0x6')]('avpf',null);this['setDataValue'](_0x2419('0x3c'),null);this['setDataValue'](_0x2419('0x3d'),null);this['setDataValue']('dtlsenable',null);this[_0x2419('0x6')](_0x2419('0x3e'),null);this[_0x2419('0x6')](_0x2419('0x3f'),null);this['setDataValue']('dtlscertfile',null);this[_0x2419('0x6')]('dtlsprivatekey',null);this[_0x2419('0x6')](_0x2419('0x40'),'no');break;case 0x2:this['setDataValue'](_0x2419('0x1f'),'wss');this['setDataValue'](_0x2419('0x3b'),_0x2419('0x26'));this[_0x2419('0x6')](_0x2419('0x41'),_0x2419('0x26'));this[_0x2419('0x6')](_0x2419('0x3c'),_0x2419('0x26'));this[_0x2419('0x6')](_0x2419('0x3d'),_0x2419('0x26'));this[_0x2419('0x6')]('dtlsenable',_0x2419('0x26'));this[_0x2419('0x6')](_0x2419('0x3e'),'no');this[_0x2419('0x6')](_0x2419('0x3f'),_0x2419('0x34'));this[_0x2419('0x6')](_0x2419('0x42'),_0x2d6d2f['dtlscertfile']||_0x2419('0x43'));this[_0x2419('0x6')](_0x2419('0x44'),_0x2d6d2f[_0x2419('0x44')]||_0x2419('0x45'));this[_0x2419('0x6')](_0x2419('0x40'),_0x2419('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0x2419('0x37')],'set':function(_0x49399d){this['setDataValue']('permissions',_0x49399d?_0x49399d[_0x2419('0x1e')](','):[]);},'get':function(){return this[_0x2419('0xb')](_0x2419('0x46'))?_[_0x2419('0x47')](this[_0x2419('0xb')]('permissions')[_0x2419('0x20')](','),function(_0x3bde8b){return parseInt(_0x3bde8b,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x2419('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x2419('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x2419('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x2419('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x2419('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x2419('0x10')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x2419('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x2419('0x10')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x2419('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x2419('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x2419('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x2419('0x48')],'get':function(){return this[_0x2419('0xb')](_0x2419('0x49'))?this[_0x2419('0xb')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'interface':{'type':Sequelize[_0x2419('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x2419('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![],'set':function(_0x1a75c7){if(typeof _0x1a75c7==='string'){var _0x463ca6=_0x1a75c7==='1'?!![]:_0x1a75c7==='0'?![]:_0x1a75c7===_0x2419('0x4a')?!![]:_0x1a75c7===_0x2419('0x4b')?![]:![];this[_0x2419('0x6')](_0x2419('0x4c'),_0x463ca6);}else{this['setDataValue'](_0x2419('0x4c'),_0x1a75c7);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x43334a){this[_0x2419('0x6')](_0x2419('0x4d'),_0x43334a);if(_0x43334a===!![]){this[_0x2419('0x6')](_0x2419('0x4e'),moment());this['setDataValue'](_0x2419('0x4f'),0x0);}else{this['setDataValue'](_0x2419('0x4e'),null);}}},'blockedAt':{'type':Sequelize[_0x2419('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x2419('0x10')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x2419('0x13')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x2419('0x10')](0x5)[_0x2419('0x50')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x2419('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x2419('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x2419('0x10')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x2419('0x10')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x2419('0x10')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x2419('0x10')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x2419('0x10')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x2419('0x10')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x2419('0x13')],'defaultValue':![]}}; \ No newline at end of file +var _0x7e72=['internal','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','format','getDataValue','fullname','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','transport','split','rfc2833','info','shortinfo','inband','auto','update','outgoing','yes','force_rport,comedia','join','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<>','always','accept','refuse','uac','uas','fingerprint','passive','actpass','nonat','update,nonat','DATE','TEXT','showWebBar','get','isArray','udp','wss','encryption','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','force_avp','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','STRING','setDataValue','name','The\x20name\x20of\x20the\x20user','callerid','\x22%s\x22\x20<%s>'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7e72,0x1c2));var _0x27e7=function(_0xfbfa3b,_0x3e3288){_0xfbfa3b=_0xfbfa3b-0x0;var _0x3c83fd=_0x7e72[_0xfbfa3b];return _0x3c83fd;};'use strict';var Sequelize=require(_0x27e7('0x0'));var moment=require(_0x27e7('0x1'));var util=require(_0x27e7('0x2'));var _=require(_0x27e7('0x3'));module['exports']={'name':{'type':Sequelize[_0x27e7('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x31e0b4){this[_0x27e7('0x5')](_0x27e7('0x6'),_0x31e0b4);this[_0x27e7('0x5')]('defaultuser',_0x31e0b4);},'comment':_0x27e7('0x7')},'fullname':{'type':Sequelize[_0x27e7('0x4')],'allowNull':![],'set':function(_0x4e2d40){this[_0x27e7('0x5')]('fullname',_0x4e2d40);this[_0x27e7('0x5')](_0x27e7('0x8'),util['format'](_0x27e7('0x9'),_0x4e2d40,this['getDataValue'](_0x27e7('0xa'))));}},'alias':{'type':Sequelize[_0x27e7('0x4')]},'email':{'type':Sequelize[_0x27e7('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0xa501c9){if(_0xa501c9){this[_0x27e7('0x5')]('email',_0xa501c9[_0x27e7('0xb')]());}}},'role':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0xd'),_0x27e7('0xe'),_0x27e7('0xf'),_0x27e7('0x10')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x27e7('0x4')],'defaultValue':_0x27e7('0x11')},'internal':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':![],'unique':'internal','set':function(_0x285a38){this['setDataValue'](_0x27e7('0xa'),_0x285a38);this[_0x27e7('0x5')]('accountcode',_0x285a38);this[_0x27e7('0x5')]('callerid',util[_0x27e7('0x13')]('\x22%s\x22\x20<%s>',this[_0x27e7('0x14')](_0x27e7('0x15')),_0x285a38));}},'salt':{'type':Sequelize[_0x27e7('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x27e7('0x4')]},'address':{'type':Sequelize[_0x27e7('0x4')]},'zipcode':{'type':Sequelize[_0x27e7('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x27e7('0x4')]},'country':{'type':Sequelize[_0x27e7('0x4')]},'online':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x27e7('0x4')],'defaultValue':_0x27e7('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x27e7('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x27e7('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x27e7('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x27e7('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x27e7('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x27e7('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![],'defaultValue':_0x27e7('0x18')},'ipaddr':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x27e7('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x19'),'user',_0x27e7('0x1a')),'allowNull':!![],'defaultValue':_0x27e7('0x19')},'context':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![],'defaultValue':_0x27e7('0x1b')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x27e7('0x1c'),'ALLOWED_FAILED_SCREEN',_0x27e7('0x1d'),_0x27e7('0x1e'),'PROHIB_PASSED_SCREEN',_0x27e7('0x1f'),_0x27e7('0x20')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![],'defaultValue':'udp','set':function(_0x22af00){this[_0x27e7('0x5')](_0x27e7('0x21'),_0x22af00?_0x22af00['join'](','):null);},'get':function(){return this[_0x27e7('0x14')]('transport')?this['getDataValue'](_0x27e7('0x21'))[_0x27e7('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x23'),_0x27e7('0x24'),_0x27e7('0x25'),_0x27e7('0x26'),_0x27e7('0x27')),'allowNull':!![],'defaultValue':_0x27e7('0x23')},'directmedia':{'type':Sequelize[_0x27e7('0xc')]('yes','no','nonat',_0x27e7('0x28'),_0x27e7('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![],'defaultValue':_0x27e7('0x2b'),'set':function(_0x5dd597){this[_0x27e7('0x5')]('nat',_0x5dd597?_0x5dd597[_0x27e7('0x2c')](','):null);},'get':function(){return this['getDataValue'](_0x27e7('0x2d'))?this[_0x27e7('0x14')](_0x27e7('0x2d'))[_0x27e7('0x22')](','):null;},'comment':_0x27e7('0x2e')},'callgroup':{'type':Sequelize[_0x27e7('0x4')]},'namedcallgroup':{'type':Sequelize[_0x27e7('0x4')]},'pickupgroup':{'type':Sequelize[_0x27e7('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x27e7('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x27e7('0x4')],'allowNull':![],'defaultValue':_0x27e7('0x2f')},'allow':{'type':Sequelize[_0x27e7('0x4')],'allowNull':![],'defaultValue':_0x27e7('0x30'),'set':function(_0x5d8039){this['setDataValue'](_0x27e7('0x31'),_0x5d8039?_0x5d8039[_0x27e7('0x2c')](';'):_0x27e7('0x30'));},'get':function(){return this[_0x27e7('0x14')](_0x27e7('0x31'))?this[_0x27e7('0x14')](_0x27e7('0x31'))[_0x27e7('0x22')](';'):null;},'comment':_0x27e7('0x32')},'autoframing':{'type':Sequelize[_0x27e7('0xc')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![],'set':function(_0x1a22d9){this[_0x27e7('0x5')](_0x27e7('0x33'),_0x1a22d9?_0x1a22d9[_0x27e7('0x2c')](','):null);},'get':function(){return this['getDataValue'](_0x27e7('0x33'))?this['getDataValue'](_0x27e7('0x33'))['split'](','):null;},'comment':_0x27e7('0x34')},'trustrpid':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x2a'),'no',_0x27e7('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![],'defaultValue':_0x27e7('0x36')},'amaflags':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x27e7('0xc')]('yes','no'),'allowNull':!![],'defaultValue':_0x27e7('0x2a')},'busylevel':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x27e7('0xc')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x27e7('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x27e7('0x2a'),'no',_0x27e7('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x27e7('0x38'),_0x27e7('0x39'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x3a'),_0x27e7('0x3b')),'allowNull':!![],'defaultValue':_0x27e7('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x27e7('0x2a')},'keepalive':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x27e7('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x27e7('0xc')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x27e7('0xc')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x27e7('0x2a'),'no',_0x27e7('0x3c'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x27e7('0xc')]('active',_0x27e7('0x3d'),_0x27e7('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x27e7('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x27e7('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x2a'),'no',_0x27e7('0x3f'),_0x27e7('0x28'),_0x27e7('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x27e7('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x27e7('0x41')]},'passwordResetAt':{'type':Sequelize[_0x27e7('0x41')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x27e7('0x42')]},'showWebBar':{'type':Sequelize[_0x27e7('0x12')],'defaultValue':0x0,'set':function(_0x13a338){this['setDataValue'](_0x27e7('0x43'),_0x13a338);var _0x447bc1=this[_0x27e7('0x44')]({'plain':!![]});switch(_0x13a338){case 0x0:case 0x1:var _0x2aa909=_0x447bc1[_0x27e7('0x21')]?_[_0x27e7('0x45')](_0x447bc1[_0x27e7('0x21')])?_0x447bc1[_0x27e7('0x21')][_0x27e7('0x2c')]():_0x447bc1[_0x27e7('0x21')]:_0x27e7('0x46');if(_0x2aa909===_0x27e7('0x47')){_0x2aa909=_0x27e7('0x46');}this[_0x27e7('0x5')]('transport',_0x2aa909);this[_0x27e7('0x5')](_0x27e7('0x48'),'no');this[_0x27e7('0x5')](_0x27e7('0x49'),null);this['setDataValue']('force_avp',null);this[_0x27e7('0x5')](_0x27e7('0x4a'),null);this[_0x27e7('0x5')](_0x27e7('0x4b'),null);this[_0x27e7('0x5')](_0x27e7('0x4c'),null);this[_0x27e7('0x5')](_0x27e7('0x4d'),null);this[_0x27e7('0x5')](_0x27e7('0x4e'),null);this[_0x27e7('0x5')](_0x27e7('0x4f'),null);this[_0x27e7('0x5')](_0x27e7('0x50'),'no');break;case 0x2:this['setDataValue'](_0x27e7('0x21'),'wss');this[_0x27e7('0x5')](_0x27e7('0x48'),_0x27e7('0x2a'));this[_0x27e7('0x5')](_0x27e7('0x49'),_0x27e7('0x2a'));this['setDataValue'](_0x27e7('0x51'),_0x27e7('0x2a'));this[_0x27e7('0x5')](_0x27e7('0x4a'),'yes');this['setDataValue']('dtlsenable',_0x27e7('0x2a'));this[_0x27e7('0x5')](_0x27e7('0x4c'),'no');this[_0x27e7('0x5')](_0x27e7('0x4d'),_0x27e7('0x3e'));this['setDataValue'](_0x27e7('0x4e'),_0x447bc1[_0x27e7('0x4e')]||'/etc/pki/tls/certs/motion.crt');this[_0x27e7('0x5')](_0x27e7('0x4f'),_0x447bc1[_0x27e7('0x4f')]||'/etc/pki/tls/private/motion.key');this[_0x27e7('0x5')](_0x27e7('0x50'),_0x27e7('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x27e7('0x42')],'set':function(_0x193bcc){this[_0x27e7('0x5')]('permissions',_0x193bcc?_0x193bcc[_0x27e7('0x2c')](','):[]);},'get':function(){return this[_0x27e7('0x14')](_0x27e7('0x52'))?_['map'](this['getDataValue'](_0x27e7('0x52'))[_0x27e7('0x22')](','),function(_0x4af306){return parseInt(_0x4af306,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x27e7('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x27e7('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x27e7('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x27e7('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x27e7('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x27e7('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x27e7('0xc')](_0x27e7('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x27e7('0x53')],'get':function(){return this[_0x27e7('0x14')]('phoneBarEnableScreenRecordingByAgent')?this[_0x27e7('0x14')](_0x27e7('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x27e7('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x16598e){if(typeof _0x16598e===_0x27e7('0x55')){var _0x28915e=_0x16598e==='1'?!![]:_0x16598e==='0'?![]:_0x16598e===_0x27e7('0x56')?!![]:_0x16598e==='false'?![]:![];this['setDataValue'](_0x27e7('0x57'),_0x28915e);}else{this[_0x27e7('0x5')]('screenrecording',_0x16598e);}}},'blocked':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![],'set':function(_0x1a0dab){this[_0x27e7('0x5')](_0x27e7('0x58'),_0x1a0dab);if(_0x1a0dab===!![]){this[_0x27e7('0x5')](_0x27e7('0x59'),moment());this['setDataValue'](_0x27e7('0x5a'),0x0);}else{this[_0x27e7('0x5')](_0x27e7('0x59'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x27e7('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x27e7('0x12')](0x5)[_0x27e7('0x5b')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x27e7('0x12')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x27e7('0x12')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x27e7('0x12')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x27e7('0x16')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index a6c5c05..1fe9c24 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 _0x9742=['some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','compact','changePassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','Wrong\x20credentials','Sequelize','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','Queues','penalty','spread','toLowerCase','QueueId','Queue:save','voice','VoiceQueue','get','format','SIP/%s','removeQueues','remove','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','file','filename','root','server/files/images/logos/default_profile.png','download','existsSync','join','server/files/images/','getOpenTabs','mail','ChatOpenTabs','CHAT','createdAt','OpenchannelOpenTabs','OPENCHANNEL','SMS','WHATSAPP','concat','getContacts','User\x20with\x20id\x20%s\x20not\x20found','getOptions','hasOwnProperty','CmList','List','Tag','Tags','color','tag','findAll','model','keys','Queue','rawAttributes','filters','intersection','fields','order','sort','merge','Unknown\x20role','nolimit','getVoiceQueuesRt','pick','getGroups','ChatGroup','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','WhatsappInteraction','getWhatsappInteractions','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','headers','x-forwarded-for','connection','remoteAddress','socket','getVoiceQueues','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','openchannelPause','smsPause','whatsappPause','getTeams','Team','addTeams','resolve','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','flattenDeep','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','isArray','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','omit','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$or','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','firstName','lastName','CmContact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','unknown','ringing','inbound','flatten','asc','desc','substring','getRealtimeAgents','voiceStatus','unavailable','busy','slice','charAt','toUpperCase','SELECT','field','ui.','InteractionId','user_has_','ui.UserId\x20=\x20?','messengerSoundNotification','enabled','moment','path','lodash','squel','ioredis','../../components/auth/service','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','localhost','sendStatus','end','json','offset','undefined','limit','count','set','update','then','role','agent','emit','userNotification:recalc:','destroy','Agents','Telephones','telephone','filter','ignore','value','includes','name','UserProfileResource','status','stack','send','map','fieldName','type','key','password','salt','previousPasswords','resetPasswordToken','resetPasswordExpires','index','where','query','includeAll','include','userSetting','true','UserSetting','attributes','push','User','rows','openTabs','length','chat','dataValues','fax','all','catch','show','options','find','sms','openchannel','whatsapp','body','describe','params','addContacts','ids','Setting','securePassword','validatePasswordPattern','max','internal','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','110','104','105','109','100','111','115','create','user','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','error','bulkCreate','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user'];(function(_0x36eb05,_0x42c7bb){var _0x57a186=function(_0x1d5ab8){while(--_0x1d5ab8){_0x36eb05['push'](_0x36eb05['shift']());}};_0x57a186(++_0x42c7bb);}(_0x9742,0x104));var _0x2974=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9742[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0x2974('0x0'));var util=require('util');var path=require(_0x2974('0x1'));var fs=require('fs');var _=require(_0x2974('0x2'));var squel=require(_0x2974('0x3'));var Redis=require(_0x2974('0x4'));var authService=require(_0x2974('0x5'));var contacts=require(_0x2974('0x6'));var qs=require(_0x2974('0x7'));var rta=require('../../components/realtime/agents');var logger=require(_0x2974('0x8'))(_0x2974('0x9'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var APIBadRequestError=require(_0x2974('0xa'))[_0x2974('0xb')];var APINotFoundError=require('../../errors/api')[_0x2974('0xc')];var APIHandleError=require('../../errors/api')[_0x2974('0xd')];var db=require(_0x2974('0xe'))['db'];var socket=require(_0x2974('0xf'))(new Redis(config[_0x2974('0x10')]));require(_0x2974('0x11'))[_0x2974('0x12')](socket);config['redis']=_['defaults'](config[_0x2974('0x10')],{'host':_0x2974('0x13'),'port':0x18eb});var values;function respondWithStatusCode(_0x1ecc67,_0x22a568){_0x22a568=_0x22a568||0xcc;return function(_0x342d1d){if(_0x342d1d){return _0x1ecc67[_0x2974('0x14')](_0x22a568);}return _0x1ecc67['status'](_0x22a568)[_0x2974('0x15')]();};}function respondWithResult(_0x15dad5,_0x3eeaf3){_0x3eeaf3=_0x3eeaf3||0xc8;return function(_0x26afef){if(_0x26afef){return _0x15dad5['status'](_0x3eeaf3)[_0x2974('0x16')](_0x26afef);}};}function respondWithFilteredResult(_0x1c2913,_0x4ab7dd){return function(_0xeada34){if(_0xeada34){var _0x36cf43=typeof _0x4ab7dd[_0x2974('0x17')]===_0x2974('0x18')&&typeof _0x4ab7dd[_0x2974('0x19')]===_0x2974('0x18');var _0x4c6987=_0xeada34[_0x2974('0x1a')];var _0x322876=_0x36cf43?0x0:_0x4ab7dd['offset'];var _0x25fefe=_0x36cf43?_0xeada34[_0x2974('0x1a')]:_0x4ab7dd[_0x2974('0x17')]+_0x4ab7dd[_0x2974('0x19')];var _0x45463c;if(_0x25fefe>=_0x4c6987){_0x25fefe=_0x4c6987;_0x45463c=0xc8;}else{_0x45463c=0xce;}_0x1c2913['status'](_0x45463c);return _0x1c2913[_0x2974('0x1b')]('Content-Range',_0x322876+'-'+_0x25fefe+'/'+_0x4c6987)[_0x2974('0x16')](_0xeada34);}return null;};}function saveUpdates(_0xce775b){return function(_0x267615){if(_0x267615){return _0x267615[_0x2974('0x1c')](_0xce775b)[_0x2974('0x1d')](function(_0x56cba1){if(_0x56cba1[_0x2974('0x1e')]===_0x2974('0x1f')){socket[_0x2974('0x20')](_0x2974('0x21')+_0x56cba1['id'],_0x56cba1);}return _0x56cba1;});}return null;};}function removeEntity(_0x23b200){return function(_0x1a889f){if(_0x1a889f){return _0x1a889f[_0x2974('0x22')]()['then'](function(){var _0x35a361=_0x1a889f['get']({'plain':!![]});if(_0x35a361[_0x2974('0x1e')]==='admin')return;var _0xd5d768=[{'name':'Users','value':'user','ignore':!![]},{'name':_0x2974('0x23'),'value':_0x2974('0x1f'),'ignore':![]},{'name':_0x2974('0x24'),'value':_0x2974('0x25'),'ignore':![]}];var _0x37f09e=_(_0xd5d768)[_0x2974('0x26')](_0x2974('0x27'))['map'](_0x2974('0x28'))[_0x2974('0x28')]();if(_[_0x2974('0x29')](_0x37f09e,_0x35a361[_0x2974('0x1e')])){return;}var _0x1a5b81=_['find'](_0xd5d768,[_0x2974('0x28'),_0x35a361[_0x2974('0x1e')]])[_0x2974('0x2a')];return db[_0x2974('0x2b')][_0x2974('0x22')]({'where':{'type':_0x1a5b81,'resourceId':_0x35a361['id']}})[_0x2974('0x1d')](function(){return _0x1a889f;});})['then'](function(){_0x23b200[_0x2974('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd1d38f){return function(_0x22917c){if(!_0x22917c){_0xd1d38f[_0x2974('0x14')](0x194);}return _0x22917c;};}function handleError(_0x212c8e,_0x4616bc){_0x4616bc=_0x4616bc||0x1f4;return function(_0x437775){logger['error'](_0x437775[_0x2974('0x2d')]);if(_0x437775[_0x2974('0x2a')]){delete _0x437775[_0x2974('0x2a')];}_0x212c8e[_0x2974('0x2c')](_0x4616bc)[_0x2974('0x2e')](_0x437775);};}function getUserAttributes(){return _(db['User']['rawAttributes'])[_0x2974('0x2f')](function(_0x1d83c8){return{'name':_0x1d83c8[_0x2974('0x30')],'type':_0x1d83c8[_0x2974('0x31')][_0x2974('0x32')]};})[_0x2974('0x26')](function(_0x28e617){return![_0x2974('0x33'),_0x2974('0x34'),_0x2974('0x35'),_0x2974('0x36'),_0x2974('0x37'),'md5secret'][_0x2974('0x29')](_0x28e617[_0x2974('0x2a')]);})['value']();}exports[_0x2974('0x38')]=function(_0x8494af,_0x29db5f){var _0x43a54f={},_0x202d30={'count':0x0,'rows':[]};var _0x4f9210=getUserAttributes();_0x43a54f=qs['getOptions'](_0x4f9210,_0x8494af);var _0x420e78={'where':_0x43a54f[_0x2974('0x39')]};return db['User']['count'](_0x420e78)[_0x2974('0x1d')](function(_0x298cc6){_0x202d30[_0x2974('0x1a')]=_0x298cc6;if(_0x8494af[_0x2974('0x3a')][_0x2974('0x3b')]){_0x43a54f[_0x2974('0x3c')]=[{'all':!![]}];}if(_0x8494af[_0x2974('0x3a')][_0x2974('0x3d')]===_0x2974('0x3e')){_0x43a54f['include']=[{'model':db[_0x2974('0x3f')],'as':'userSetting'}];}if(!_[_0x2974('0x29')](_0x43a54f[_0x2974('0x40')],'id')){_0x43a54f[_0x2974('0x40')][_0x2974('0x41')]('id');}return db[_0x2974('0x42')]['findAll'](_0x43a54f);})[_0x2974('0x1d')](function(_0x29509b){_0x202d30[_0x2974('0x43')]=_0x29509b;if(_0x8494af[_0x2974('0x3a')][_0x2974('0x44')]===_0x2974('0x3e')){var _0x210538=[];for(var _0x4c38f7=0x0;_0x4c38f7<_0x202d30[_0x2974('0x43')][_0x2974('0x45')];_0x4c38f7++){_0x210538['push'](get_open_tabs(_0x2974('0x46'),_0x202d30[_0x2974('0x43')][_0x4c38f7][_0x2974('0x47')]));_0x210538['push'](get_open_tabs('sms',_0x202d30[_0x2974('0x43')][_0x4c38f7]['dataValues']));_0x210538[_0x2974('0x41')](get_open_tabs(_0x2974('0x48'),_0x202d30[_0x2974('0x43')][_0x4c38f7][_0x2974('0x47')]));_0x210538[_0x2974('0x41')](get_open_tabs('mail',_0x202d30[_0x2974('0x43')][_0x4c38f7]['dataValues']));_0x210538[_0x2974('0x41')](get_open_tabs('openchannel',_0x202d30[_0x2974('0x43')][_0x4c38f7]['dataValues']));_0x210538[_0x2974('0x41')](get_open_tabs('whatsapp',_0x202d30[_0x2974('0x43')][_0x4c38f7]['dataValues']));}return Promise[_0x2974('0x49')](_0x210538)[_0x2974('0x1d')](function(){return _0x202d30;});}else{return _0x202d30;}})[_0x2974('0x1d')](respondWithFilteredResult(_0x29db5f,_0x43a54f))[_0x2974('0x4a')](handleError(_0x29db5f,null));};exports[_0x2974('0x4b')]=function(_0x4ebe0e,_0x188c47){var _0x262f54=getUserAttributes();_0x4ebe0e['query']['id']=_0x4ebe0e['params']['id'];var _0x23737c=qs['getOptions'](_0x262f54,_0x4ebe0e);if(_0x4ebe0e['query'][_0x2974('0x3b')]){_0x23737c['include']=[{'all':!![]}];}if(_0x4ebe0e[_0x2974('0x3a')]['userSetting']==='true'){_0x23737c[_0x2974('0x3c')]=[{'model':db[_0x2974('0x3f')],'as':_0x2974('0x3d')}];}_0x23737c=_['merge']({},_0x23737c,_0x4ebe0e[_0x2974('0x4c')]);if(!_[_0x2974('0x29')](_0x23737c[_0x2974('0x40')],'id')){_0x23737c[_0x2974('0x40')][_0x2974('0x41')]('id');}return db['User'][_0x2974('0x4d')](_0x23737c)[_0x2974('0x1d')](handleEntityNotFound(_0x188c47,null))[_0x2974('0x1d')](function(_0x36aa6f){var _0x35e5a6=[];values=_0x36aa6f;if(_0x4ebe0e[_0x2974('0x3a')][_0x2974('0x44')]===_0x2974('0x3e')){_0x35e5a6[_0x2974('0x41')](get_open_tabs(_0x2974('0x46'),_0x36aa6f[_0x2974('0x47')]));_0x35e5a6['push'](get_open_tabs(_0x2974('0x4e'),_0x36aa6f[_0x2974('0x47')]));_0x35e5a6[_0x2974('0x41')](get_open_tabs(_0x2974('0x4f'),_0x36aa6f[_0x2974('0x47')]));_0x35e5a6[_0x2974('0x41')](get_open_tabs(_0x2974('0x50'),_0x36aa6f['dataValues']));_0x35e5a6['push'](get_open_tabs('fax',_0x36aa6f['dataValues']));_0x35e5a6[_0x2974('0x41')](get_open_tabs('mail',_0x36aa6f[_0x2974('0x47')]));return Promise['all'](_0x35e5a6);}else{return values;}})[_0x2974('0x1d')](function(){return values;})[_0x2974('0x1d')](respondWithResult(_0x188c47,null))[_0x2974('0x4a')](handleError(_0x188c47,null));};exports[_0x2974('0x1c')]=function(_0x1bdb4e,_0x2c61c4){if(_0x1bdb4e[_0x2974('0x51')]['id']){delete _0x1bdb4e[_0x2974('0x51')]['id'];}delete _0x1bdb4e[_0x2974('0x51')][_0x2974('0x1e')];return db[_0x2974('0x42')][_0x2974('0x4d')]({'where':{'id':_0x1bdb4e['params']['id']}})[_0x2974('0x1d')](handleEntityNotFound(_0x2c61c4,null))['then'](saveUpdates(_0x1bdb4e[_0x2974('0x51')],null))[_0x2974('0x1d')](respondWithResult(_0x2c61c4,null))['catch'](handleError(_0x2c61c4,null));};exports[_0x2974('0x52')]=function(_0x660b60,_0x1d041f){return db[_0x2974('0x42')][_0x2974('0x52')]()[_0x2974('0x1d')](respondWithResult(_0x1d041f,null))[_0x2974('0x4a')](handleError(_0x1d041f,null));};exports['addContacts']=function(_0x1ca11d,_0x510a60){return db[_0x2974('0x42')][_0x2974('0x4d')]({'where':{'id':_0x1ca11d[_0x2974('0x53')]['id']}})[_0x2974('0x1d')](handleEntityNotFound(_0x510a60,null))[_0x2974('0x1d')](function(_0x1d36b6){if(_0x1d36b6){return _0x1d36b6[_0x2974('0x54')](_0x1ca11d[_0x2974('0x51')][_0x2974('0x55')],_['omit'](_0x1ca11d[_0x2974('0x51')],[_0x2974('0x55'),'id'])||{});}})[_0x2974('0x1d')](respondWithResult(_0x510a60,null))[_0x2974('0x4a')](handleError(_0x510a60,null));};function validateUser(_0xbf376e){return new Promise(function(_0x55d4b8,_0x301bb2){if(_0xbf376e['internal'])return _0x55d4b8(_0xbf376e);return db[_0x2974('0x56')]['findById'](0x1)[_0x2974('0x1d')](function(_0x111805){if(_0x111805[_0x2974('0x57')])authService[_0x2974('0x58')](_0xbf376e['password']);db[_0x2974('0x42')][_0x2974('0x59')](_0x2974('0x5a'))[_0x2974('0x1d')](function(_0x14da99){if(_[_0x2974('0x5b')](_0x14da99)){_0xbf376e[_0x2974('0x5a')]=_0x111805['min_internal']||0x1;return;}if(_[_0x2974('0x5b')](_0x111805[_0x2974('0x5c')])||_0x111805[_0x2974('0x5c')]===_0x14da99){_0xbf376e['internal']=_0x14da99+0x1;return;}if(_0x111805['min_internal']>_0x14da99){_0xbf376e[_0x2974('0x5a')]=_0x111805['min_internal'];return;}return db[_0x2974('0x5d')][_0x2974('0x3a')](_0x2974('0x5e'),{'type':db[_0x2974('0x5d')][_0x2974('0x5f')]['SELECT']})[_0x2974('0x1d')](function(_0x4cf01c){if(_0x4cf01c&&_0x4cf01c['length']){for(var _0x59ff7c=0x0,_0x3e7dc5=_0x4cf01c[_0x2974('0x45')];_0x59ff7c<_0x3e7dc5&&_[_0x2974('0x5b')](_0xbf376e[_0x2974('0x5a')]);_0x59ff7c++){if(_0x111805['min_internal']<=_0x4cf01c[_0x59ff7c][_0x2974('0x60')]){_0xbf376e['internal']=_0x4cf01c[_0x59ff7c][_0x2974('0x60')];}else if(_0x111805[_0x2974('0x5c')]>_0x4cf01c[_0x59ff7c][_0x2974('0x60')]&&_0x111805[_0x2974('0x5c')]<=_0x4cf01c[_0x59ff7c]['to']){_0xbf376e[_0x2974('0x5a')]=_0x111805[_0x2974('0x5c')];}}}if(_['isNil'](_0xbf376e['internal'])){_0xbf376e['internal']=_0x14da99+0x1;}return _0x55d4b8(_0xbf376e);});});})[_0x2974('0x4a')](function(_0x5dc687){_0x301bb2(_0x5dc687);});});}function updateUser(_0x89c038){return new Promise(function(_0x21b4db,_0x2d85f3){try{if(_0x89c038[_0x2974('0x61')]){_0x89c038[_0x2974('0x62')]=_0x89c038[_0x2974('0x5a')];_0x89c038[_0x2974('0x63')]={'mailbox':_0x89c038['internal'],'password':_0x89c038[_0x2974('0x33')],'fullname':_0x89c038[_0x2974('0x64')],'email':_0x89c038[_0x2974('0x65')]};}if(_0x89c038[_0x2974('0x1e')]==='agent'){if(!_0x89c038[_0x2974('0x66')])_0x89c038[_0x2974('0x66')]=[_0x2974('0x67'),_0x2974('0x68'),_0x2974('0x69'),_0x2974('0x6a'),_0x2974('0x6b'),_0x2974('0x6c'),_0x2974('0x6d'),'106','107','108',_0x2974('0x6e'),_0x2974('0x6f'),_0x2974('0x70'),'114',_0x2974('0x71')];}_0x21b4db(_0x89c038);}catch(_0x59b67c){_0x2d85f3(_0x59b67c);}});}exports[_0x2974('0x72')]=function(_0x58bd41,_0x5cdd92){if(_0x58bd41[_0x2974('0x73')]['role']==='agent')throw new Error(_0x2974('0x74'));if(_0x58bd41[_0x2974('0x51')][_0x2974('0x1e')]===_0x2974('0x73')&&_0x58bd41[_0x2974('0x73')][_0x2974('0x1e')]!==_0x2974('0x75')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x58bd41[_0x2974('0x51')][_0x2974('0x1e')]===_0x2974('0x75')&&_0x58bd41[_0x2974('0x73')]['role']!==_0x2974('0x75')){throw new Error(_0x2974('0x76'));}return licenseUtil[_0x2974('0x77')]([_0x58bd41['body']])['then'](function(){return validateUser(_0x58bd41[_0x2974('0x51')]);})['then'](function(_0x49eb80){return updateUser(_0x49eb80)[_0x2974('0x1d')](function(_0x6c7e34){if(_0x6c7e34[_0x2974('0x1e')]===_0x2974('0x75')){_0x6c7e34[_0x2974('0x78')]=_0x58bd41[_0x2974('0x73')][_0x2974('0x78')];delete _0x6c7e34[_0x2974('0x79')];}return _0x6c7e34;});})[_0x2974('0x1d')](function(_0x2047a7){return db[_0x2974('0x42')][_0x2974('0x72')](_0x2047a7,{'include':[{'model':db['VoiceMail'],'as':_0x2974('0x63')}]});})[_0x2974('0x1d')](function(_0x5e02e4){if(_0x58bd41[_0x2974('0x51')][_0x2974('0x1e')]===_0x2974('0x73'))return _0x5e02e4;if(_0x58bd41['user'][_0x2974('0x1e')]!==_0x2974('0x73'))return _0x5e02e4;return db[_0x2974('0x7a')][_0x2974('0x4d')]({'where':{'name':_0x5e02e4[_0x2974('0x1e')]===_0x2974('0x1f')?'Agents':'Telephones','userProfileId':_0x58bd41[_0x2974('0x73')]['userProfileId']},'raw':!![]})[_0x2974('0x1d')](function(_0x53ffaf){if(!_0x53ffaf||_0x53ffaf[_0x2974('0x7b')]!=0x0)return _0x5e02e4;return db['UserProfileResource'][_0x2974('0x72')]({'name':_0x5e02e4[_0x2974('0x2a')],'resourceId':_0x5e02e4['id'],'type':_0x53ffaf[_0x2974('0x2a')],'sectionId':_0x53ffaf['id']},{})[_0x2974('0x1d')](function(){return _0x5e02e4;});})[_0x2974('0x4a')](function(_0x4a6f78){logger[_0x2974('0x7c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a6f78);throw _0x4a6f78;});})[_0x2974('0x1d')](respondWithResult(_0x5cdd92,0xc9))['catch'](handleError(_0x5cdd92,null));};exports[_0x2974('0x7d')]=function(_0x16ef5a,_0x2f33fc){var _0x2962ef=_0x16ef5a[_0x2974('0x51')];var _0x192f6b=[];if(_0x16ef5a['user'][_0x2974('0x1e')]===_0x2974('0x1f'))throw new Error(_0x2974('0x74'));if(_['some'](_0x2962ef,['role',_0x2974('0x73')])&&_0x16ef5a[_0x2974('0x73')]['role']!==_0x2974('0x75')){throw new Error(_0x2974('0x7e'));}if(_[_0x2974('0x7f')](_0x2962ef,['role',_0x2974('0x75')])&&_0x16ef5a['user'][_0x2974('0x1e')]!==_0x2974('0x75')){throw new Error(_0x2974('0x80'));}return licenseUtil[_0x2974('0x77')](_0x2962ef)['then'](function(){return validateUser(_0x2962ef[0x0]);})[_0x2974('0x1d')](function(){for(var _0x14ca45=0x1;_0x14ca45<_0x2962ef[_0x2974('0x45')];_0x14ca45++){var _0x130615=_0x2962ef[_0x14ca45-0x1][_0x2974('0x5a')];if(!_0x2962ef[_0x14ca45][_0x2974('0x5a')])_0x2962ef[_0x14ca45]['internal']=_0x130615+0x1;_0x192f6b[_0x2974('0x41')](validateUser(_0x2962ef[_0x14ca45]));}return Promise[_0x2974('0x49')](_0x192f6b);})[_0x2974('0x1d')](function(){_0x192f6b=[];for(var _0x9a825f=0x0;_0x9a825f<_0x2962ef['length'];_0x9a825f++){_0x192f6b[_0x2974('0x41')](updateUser(_0x2962ef[_0x9a825f]));}return Promise[_0x2974('0x49')](_0x192f6b);})[_0x2974('0x1d')](function(){_0x192f6b=_0x2962ef[_0x2974('0x2f')](function(_0xdb9cb4){return db['User'][_0x2974('0x72')](_0xdb9cb4,{'include':[{'model':db[_0x2974('0x63')],'as':_0x2974('0x63')}]})[_0x2974('0x1d')](function(_0x2d1c31){_0xdb9cb4['id']=_0x2d1c31['id'];return _0xdb9cb4;});});return Promise[_0x2974('0x49')](_0x192f6b);})['then'](function(_0x459f9e){if(_0x16ef5a['body']['role']===_0x2974('0x73'))return _0x459f9e;if(_0x16ef5a['user']['role']!=='user')return _0x459f9e;var _0x1b01c2=_[_0x2974('0x7f')](_0x459f9e,function(_0x3e6eee){return _0x3e6eee[_0x2974('0x1e')]==='agent'||_0x3e6eee[_0x2974('0x1e')]===_0x2974('0x25');});if(!_0x1b01c2)return _0x459f9e;return db[_0x2974('0x7a')]['findAll']({'where':{'name':{'$or':[_0x2974('0x23'),'Telephones']},'userProfileId':_0x16ef5a['user'][_0x2974('0x79')]},'raw':!![]})['then'](function(_0x5a0c3a){if(_['isEmpty'](_0x5a0c3a)||!_['some'](_0x5a0c3a,[_0x2974('0x7b'),0x0]))return _0x459f9e;_0x192f6b=[];var _0x11fad3=_(_0x5a0c3a)['map'](function(_0x597ae9){if(_0x597ae9[_0x2974('0x7b')]===0x1)return;return _0x597ae9[_0x2974('0x2a')]===_0x2974('0x23')?'agent':'telephone';})[_0x2974('0x81')]()['value']();for(var _0x2ef8f2=0x0;_0x2ef8f2<_0x459f9e[_0x2974('0x45')];_0x2ef8f2++){if(!_[_0x2974('0x29')](_0x11fad3,_0x459f9e[_0x2ef8f2][_0x2974('0x1e')]))return;var _0xd96e0d=_0x459f9e[_0x2ef8f2][_0x2974('0x1e')]===_0x2974('0x1f')?_0x2974('0x23'):_0x2974('0x24');_0x192f6b[_0x2974('0x41')](db[_0x2974('0x2b')][_0x2974('0x72')]({'name':_0x459f9e[_0x2ef8f2]['name'],'resourceId':_0x459f9e[_0x2ef8f2]['id'],'type':_0xd96e0d,'sectionId':_['find'](_0x5a0c3a,[_0x2974('0x2a'),_0xd96e0d])['id']},{}));}return Promise[_0x2974('0x49')](_0x192f6b);});})[_0x2974('0x1d')](respondWithResult(_0x2f33fc,0xc9))[_0x2974('0x4a')](handleError(_0x2f33fc,null));};exports[_0x2974('0x82')]=function(_0x47e45e,_0x3d123d){if(_0x47e45e['body']['id']){delete _0x47e45e[_0x2974('0x51')]['id'];}return db[_0x2974('0x42')]['find']({'where':{'id':_0x47e45e[_0x2974('0x53')]['id']}})[_0x2974('0x1d')](function(_0x53c339){if(!_0x53c339)return null;if(_0x53c339['id']===_0x47e45e[_0x2974('0x73')]['id']){if(!_0x47e45e[_0x2974('0x51')]['oldPassword']||!_0x47e45e['body'][_0x2974('0x83')]){throw new db['Sequelize'][(_0x2974('0x84'))](_0x2974('0x85'));}if(!_0x53c339[_0x2974('0x86')](_0x47e45e[_0x2974('0x51')][_0x2974('0x87')])){throw new db['Sequelize']['ValidationError'](_0x2974('0x88'));}if(_0x47e45e['body'][_0x2974('0x87')]===_0x47e45e[_0x2974('0x51')][_0x2974('0x83')]){throw new db[(_0x2974('0x89'))][(_0x2974('0x84'))](_0x2974('0x8a'));}}else if(_0x47e45e[_0x2974('0x73')][_0x2974('0x1e')]===_0x2974('0x75')){if(!_0x47e45e[_0x2974('0x51')][_0x2974('0x83')]){throw new db[(_0x2974('0x89'))]['ValidationError'](_0x2974('0x8b'));}}else if(_0x47e45e[_0x2974('0x73')][_0x2974('0x1e')]==='user'){if(!_0x47e45e['body']['newPassword']){throw new db[(_0x2974('0x89'))][(_0x2974('0x84'))](_0x2974('0x8b'));}if(_0x53c339[_0x2974('0x1e')]!=='agent'){throw new db[(_0x2974('0x89'))][(_0x2974('0x84'))](_0x2974('0x74'));}}else{throw new db['Sequelize'][(_0x2974('0x84'))](_0x2974('0x74'));}return _0x53c339;})[_0x2974('0x1d')](handleEntityNotFound(_0x3d123d,null))[_0x2974('0x1d')](function(_0x86f47b){return db[_0x2974('0x56')][_0x2974('0x8c')]({'attributes':['id',_0x2974('0x57'),_0x2974('0x8d'),_0x2974('0x8e')]})[_0x2974('0x1d')](function(_0x3022c0){if(_0x3022c0['securePassword'])authService[_0x2974('0x58')](_0x47e45e[_0x2974('0x51')][_0x2974('0x83')]);if(!_0x3022c0[_0x2974('0x8d')]||!_0x86f47b['previousPasswords'])return _0x86f47b;authService[_0x2974('0x8f')](_0x47e45e[_0x2974('0x51')]['newPassword'],_0x86f47b[_0x2974('0x35')],_0x3022c0[_0x2974('0x8e')]);return _0x86f47b;})[_0x2974('0x1d')](saveUpdates({'password':_0x47e45e['body'][_0x2974('0x83')],'passwordResetAt':_0x47e45e[_0x2974('0x73')]['id']==_0x47e45e[_0x2974('0x53')]['id']?moment():null,'previousPasswords':authService[_0x2974('0x90')](_0x47e45e[_0x2974('0x51')][_0x2974('0x83')],_0x86f47b[_0x2974('0x35')])},null));})[_0x2974('0x1d')](respondWithResult(_0x3d123d,null))['catch'](handleError(_0x3d123d,null));};exports[_0x2974('0x91')]=function(_0x46a600,_0x26f4cf){var _0x57659e=_0x46a600[_0x2974('0x51')][_0x2974('0x92')];return db[_0x2974('0x42')][_0x2974('0x4d')]({'where':{'id':_0x46a600['params']['id']},'attributes':['id','name',_0x2974('0x1e'),_0x2974('0x93'),_0x2974('0x94'),_0x2974('0x95'),_0x2974('0x96')]})[_0x2974('0x1d')](handleEntityNotFound(_0x26f4cf,null))[_0x2974('0x1d')](function(_0xe465a5){if(_0xe465a5){if(!utils[_0x2974('0x97')](_0x57659e)){throw new db[(_0x2974('0x89'))][(_0x2974('0x84'))](_0x2974('0x98'));}return _0xe465a5[_0x2974('0x99')+_[_0x2974('0x9a')](_0x57659e['toLowerCase']())+_0x2974('0x9b')](_0x46a600[_0x2974('0x51')]['ids'],{'penalty':_0x46a600[_0x2974('0x51')][_0x2974('0x9c')]||0x0})[_0x2974('0x9d')](function(_0x2fdfe3){for(var _0x446fbb=0x0;_0x446fbb<_0x46a600[_0x2974('0x51')]['ids'][_0x2974('0x45')];_0x446fbb+=0x1){var _0x4f7d0f={'UserId':Number(_0x46a600[_0x2974('0x53')]['id'])};_0x4f7d0f[_['capitalize'](_0x57659e[_0x2974('0x9e')]())+_0x2974('0x9f')]=Number(_0x46a600[_0x2974('0x51')][_0x2974('0x55')][_0x446fbb]);socket[_0x2974('0x20')](_0x2974('0x73')+_['capitalize'](_0x57659e[_0x2974('0x9e')]())+_0x2974('0xa0'),_0x4f7d0f);}return _0x2fdfe3;})['then'](function(){if(_0x57659e===_0x2974('0xa1')){return db[_0x2974('0xa2')]['findAll']({'where':{'id':_0x46a600[_0x2974('0x51')][_0x2974('0x55')]||[]},'raw':!![],'attributes':['id',_0x2974('0x2a')]});}})[_0x2974('0x1d')](function(_0x48d28a){var _0x20f4f0=_0xe465a5[_0x2974('0xa3')]({'plain':!![]});var _0x287f7b=[];if(_0x57659e===_0x2974('0xa1')&&_0x20f4f0[_0x2974('0x1e')]===_0x2974('0x1f')&&_0x20f4f0[_0x2974('0x93')]){for(let _0x45dc40=0x0;_0x45dc40<_0x48d28a[_0x2974('0x45')];_0x45dc40+=0x1){_0x287f7b[_0x2974('0x41')]({'membername':_0x20f4f0[_0x2974('0x2a')],'UserId':_0x20f4f0['id'],'queue_name':_0x48d28a[_0x45dc40][_0x2974('0x2a')],'VoiceQueueId':_0x48d28a[_0x45dc40]['id'],'interface':_['isNil'](_0x20f4f0[_0x2974('0x96')])?util[_0x2974('0xa4')](_0x2974('0xa5'),_0x20f4f0[_0x2974('0x2a')]):_0x20f4f0['interface'],'paused':_0x20f4f0[_0x2974('0x95')]||![],'penalty':_0x46a600[_0x2974('0x51')][_0x2974('0x9c')]||0x0});}return Promise[_0x2974('0x49')](_0x287f7b[_0x2974('0x2f')](function(_0x526a21){return db['UserVoiceQueueRt']['upsert'](_0x526a21);}));}return _0xe465a5;});}})[_0x2974('0x1d')](respondWithStatusCode(_0x26f4cf,null))['catch'](handleError(_0x26f4cf,null));};exports[_0x2974('0xa6')]=function(_0x5929f7,_0x5416c5){var _0x4130ef,_0x14c47d;return db[_0x2974('0x42')]['find']({'where':{'id':_0x5929f7[_0x2974('0x53')]['id']},'attributes':['id','name','role']})[_0x2974('0x1d')](handleEntityNotFound(_0x5416c5,null))[_0x2974('0x1d')](function(_0x9d482e){if(_0x9d482e){_0x4130ef=_0x9d482e;if(!_0x5929f7[_0x2974('0x3a')][_0x2974('0x92')]||!utils[_0x2974('0x97')](_0x5929f7[_0x2974('0x3a')]['channel'])){throw new db[(_0x2974('0x89'))][(_0x2974('0x84'))](_0x2974('0x98'));}return _0x9d482e[_0x2974('0xa7')+_[_0x2974('0x9a')](_0x5929f7[_0x2974('0x3a')]['channel']['toLowerCase']())+'Queues'](_0x5929f7[_0x2974('0x3a')][_0x2974('0x55')]);}})['then'](function(_0x31df25){if(_['isArray'](_0x5929f7[_0x2974('0x3a')]['ids'])){for(var _0x33fec5=0x0;_0x33fec5<_0x5929f7[_0x2974('0x3a')][_0x2974('0x55')][_0x2974('0x45')];_0x33fec5+=0x1){_0x14c47d={'UserId':Number(_0x5929f7[_0x2974('0x53')]['id'])};_0x14c47d[_[_0x2974('0x9a')](_0x5929f7[_0x2974('0x3a')][_0x2974('0x92')][_0x2974('0x9e')]())+_0x2974('0x9f')]=Number(_0x5929f7[_0x2974('0x3a')]['ids'][_0x33fec5]);socket[_0x2974('0x20')](_0x2974('0x73')+_[_0x2974('0x9a')](_0x5929f7[_0x2974('0x3a')][_0x2974('0x92')][_0x2974('0x9e')]())+'Queue:remove',_0x14c47d);}}else{_0x14c47d={'UserId':Number(_0x5929f7[_0x2974('0x53')]['id'])};_0x14c47d[_[_0x2974('0x9a')](_0x5929f7[_0x2974('0x3a')][_0x2974('0x92')][_0x2974('0x9e')]())+'QueueId']=Number(_0x5929f7[_0x2974('0x3a')][_0x2974('0x55')]);socket[_0x2974('0x20')](_0x2974('0x73')+_[_0x2974('0x9a')](_0x5929f7[_0x2974('0x3a')][_0x2974('0x92')]['toLowerCase']())+_0x2974('0xa8'),_0x14c47d);}return _0x31df25;})['then'](function(){if(_0x5929f7[_0x2974('0x3a')][_0x2974('0x92')]===_0x2974('0xa1')){return db[_0x2974('0xa9')][_0x2974('0x22')]({'where':{'UserId':_0x5929f7[_0x2974('0x53')]['id'],'VoiceQueueId':_0x5929f7[_0x2974('0x3a')][_0x2974('0x55')]},'individualHooks':!![]})['then'](function(){return _0x4130ef;});}return _0x4130ef;})[_0x2974('0x1d')](respondWithStatusCode(_0x5416c5,null))[_0x2974('0x4a')](handleError(_0x5416c5,null));};exports[_0x2974('0xaa')]=function(_0x1a8298,_0x537d67){_0x1a8298[_0x2974('0x51')][_0x2974('0xab')]=_0x1a8298[_0x2974('0xac')][_0x2974('0xad')];return db[_0x2974('0x42')]['find']({'where':{'id':_0x1a8298['params']['id']}})[_0x2974('0x1d')](handleEntityNotFound(_0x537d67,null))[_0x2974('0x1d')](saveUpdates(_0x1a8298['body'],null))[_0x2974('0x1d')](respondWithResult(_0x537d67,null))[_0x2974('0x4a')](handleError(_0x537d67,null));};exports['getAvatar']=function(_0x113897,_0x18fe1e){var _0x57d016=path['join'](config[_0x2974('0xae')],_0x2974('0xaf'));return db['User'][_0x2974('0x4d')]({'where':{'id':_0x113897[_0x2974('0x53')]['id']},'attributes':['id',_0x2974('0xab')],'raw':!![]})[_0x2974('0x1d')](handleEntityNotFound(_0x18fe1e,null))['then'](function(_0x1127c4){if(_0x1127c4){if(_[_0x2974('0x5b')](_0x1127c4['userpic'])){return _0x18fe1e[_0x2974('0xb0')](_0x57d016);}else{if(!fs[_0x2974('0xb1')](path[_0x2974('0xb2')](config[_0x2974('0xae')],_0x2974('0xb3'),_0x1127c4['userpic']))){return _0x18fe1e[_0x2974('0xb0')](_0x57d016);}return _0x18fe1e[_0x2974('0xb0')](path[_0x2974('0xb2')](config[_0x2974('0xae')],_0x2974('0xb3'),_0x1127c4[_0x2974('0xab')]));}}})['catch'](handleError(_0x18fe1e,null));};exports[_0x2974('0xb4')]=function(_0x40e625,_0x59cf41){return db[_0x2974('0x42')][_0x2974('0x4d')]({'where':{'id':_0x40e625['params']['id']},'attributes':['id']})[_0x2974('0x1d')](handleEntityNotFound(_0x59cf41,null))[_0x2974('0x1d')](function(_0x40b99c){var _0x461d9b=[];values=_0x40b99c[_0x2974('0x47')];_0x461d9b['push'](get_open_tabs(_0x2974('0x46'),_0x40b99c[_0x2974('0x47')]));_0x461d9b[_0x2974('0x41')](get_open_tabs(_0x2974('0x4e'),_0x40b99c[_0x2974('0x47')]));_0x461d9b[_0x2974('0x41')](get_open_tabs('openchannel',_0x40b99c[_0x2974('0x47')]));_0x461d9b[_0x2974('0x41')](get_open_tabs(_0x2974('0x50'),_0x40b99c['dataValues']));_0x461d9b[_0x2974('0x41')](get_open_tabs(_0x2974('0x48'),_0x40b99c['dataValues']));_0x461d9b[_0x2974('0x41')](get_open_tabs(_0x2974('0xb5'),_0x40b99c[_0x2974('0x47')]));return Promise['all'](_0x461d9b);})[_0x2974('0x1d')](function(_0x31f770){if(_0x31f770){var _0x589698=_['map'](values[_0x2974('0xb6')],function(_0x5d94eb){return{'channel':_0x2974('0xb7'),'id':_0x5d94eb['id'],'createdAt':_0x5d94eb[_0x2974('0xb8')]};});var _0x4f27e3=_[_0x2974('0x2f')](values['FaxOpenTabs'],function(_0x425672){return{'channel':'FAX','id':_0x425672['id'],'createdAt':_0x425672[_0x2974('0xb8')]};});var _0x5e0acb=_[_0x2974('0x2f')](values[_0x2974('0xb9')],function(_0x820ed7){return{'channel':_0x2974('0xba'),'id':_0x820ed7['id'],'createdAt':_0x820ed7[_0x2974('0xb8')]};});var _0x2a8629=_[_0x2974('0x2f')](values['MailOpenTabs'],function(_0x24f89f){return{'channel':'MAIL','id':_0x24f89f['id'],'createdAt':_0x24f89f['createdAt']};});var _0xdfbd93=_[_0x2974('0x2f')](values['SmsOpenTabs'],function(_0x26753a){return{'channel':_0x2974('0xbb'),'id':_0x26753a['id'],'createdAt':_0x26753a['createdAt']};});var _0x17d6da=_[_0x2974('0x2f')](values['WhatsappOpenTabs'],function(_0x15b038){return{'channel':_0x2974('0xbc'),'id':_0x15b038['id'],'createdAt':_0x15b038[_0x2974('0xb8')]};});var _0x4341ed=_[_0x2974('0xbd')](_0x589698,_0x4f27e3,_0x5e0acb,_0x2a8629,_0xdfbd93,_0x17d6da);var _0x4c9540={'count':_0x4341ed[_0x2974('0x45')],'rows':_0x4341ed};return _0x4c9540;}else return null;})[_0x2974('0x1d')](respondWithResult(_0x59cf41,null))[_0x2974('0x4a')](handleError(_0x59cf41,null));};exports[_0x2974('0xbe')]=function(_0x40859a,_0x26037c){var _0x534544={};return db['User'][_0x2974('0x8c')]({'where':{'id':_0x40859a[_0x2974('0x53')]['id']}})[_0x2974('0x1d')](function(_0x57d7fb){if(!_0x57d7fb){throw new APINotFoundError(util[_0x2974('0xa4')](_0x2974('0xbf'),_0x40859a[_0x2974('0x53')]['id']));}return contacts[_0x2974('0x52')]();})['then'](function(_0x4d6de1){_0x40859a[_0x2974('0x3a')][_0x2974('0x42')]=_0x40859a[_0x2974('0x53')]['id'];_0x534544=qs[_0x2974('0xc0')](_0x4d6de1,_0x40859a);if(_0x40859a[_0x2974('0x3a')][_0x2974('0xc1')](_0x2974('0x3b'))){_0x534544['include']=[{'model':db[_0x2974('0xc2')],'as':_0x2974('0xc3'),'required':![]},{'model':db[_0x2974('0xc4')],'as':_0x2974('0xc5'),'attributes':['id','name',_0x2974('0xc6')],'where':_0x40859a[_0x2974('0x3a')][_0x2974('0xc7')]?{'id':_0x40859a[_0x2974('0x3a')][_0x2974('0xc7')]}:undefined,'required':_0x40859a[_0x2974('0x3a')][_0x2974('0xc7')]?!![]:![]}];}return contacts[_0x2974('0xc8')](_0x40859a[_0x2974('0x3a')],_0x40859a[_0x2974('0x73')],_0x534544,_0x4d6de1);})[_0x2974('0x1d')](respondWithFilteredResult(_0x26037c,_0x534544))['catch'](APIHandleError(_0x26037c));};exports['getQueues']=function(_0x2cd20e,_0x2b7a73){var _0x432c22;var _0x5a719b={};var _0x153240;return db['User']['findOne']({'where':{'id':_0x2cd20e[_0x2974('0x53')]['id']},'attributes':['id','name',_0x2974('0x1e')]})[_0x2974('0x1d')](handleEntityNotFound(_0x2b7a73,null))['then'](function(_0x2e136a){if(!utils[_0x2974('0x97')](_0x2cd20e[_0x2974('0x3a')]['channel'])){throw new db[(_0x2974('0x89'))]['ValidationError']('Unknown\x20channel');}_0x432c22=_0x2e136a;var _0x127617={};_0x127617[_0x2974('0xc9')]=_[_0x2974('0xca')](db[_[_0x2974('0x9a')](_0x2cd20e[_0x2974('0x3a')]['channel'])+_0x2974('0xcb')][_0x2974('0xcc')]);_0x127617[_0x2974('0x3a')]=_[_0x2974('0xca')](_0x2cd20e[_0x2974('0x3a')]);_0x127617[_0x2974('0xcd')]=_[_0x2974('0xce')](_0x127617[_0x2974('0xc9')],_0x127617[_0x2974('0x3a')]);_0x5a719b[_0x2974('0x40')]=_[_0x2974('0xce')](_0x127617[_0x2974('0xc9')],qs[_0x2974('0xcf')](_0x2cd20e['query']['fields']));_0x5a719b['attributes']=_0x5a719b[_0x2974('0x40')][_0x2974('0x45')]?_0x5a719b[_0x2974('0x40')]:_0x127617['model'];_0x5a719b[_0x2974('0xd0')]=qs[_0x2974('0xd1')](_0x2cd20e[_0x2974('0x3a')][_0x2974('0xd1')]);_0x5a719b[_0x2974('0x39')]=qs[_0x2974('0xcd')](_['pick'](_0x2cd20e['query'],_0x127617[_0x2974('0xcd')]));if(_0x2cd20e[_0x2974('0x3a')][_0x2974('0x26')]){_0x5a719b[_0x2974('0x39')]=_[_0x2974('0xd2')](_0x5a719b[_0x2974('0x39')],{'$or':_[_0x2974('0x2f')](_0x5a719b['attributes'],function(_0x1c9d7d){var _0x38777b={};_0x38777b[_0x1c9d7d]={'$like':'%'+_0x2cd20e[_0x2974('0x3a')]['filter']+'%'};return _0x38777b;})});}_0x5a719b=_[_0x2974('0xd2')]({},_0x5a719b,_0x2cd20e['options']);switch(_0x432c22[_0x2974('0x1e')]){case'admin':return db[_[_0x2974('0x9a')](_0x2cd20e[_0x2974('0x3a')][_0x2974('0x92')])+_0x2974('0xcb')][_0x2974('0xc8')](_0x5a719b);case _0x2974('0x73'):case _0x2974('0x1f'):return _0x432c22[_0x2974('0xa3')+_['capitalize'](_0x2cd20e['query'][_0x2974('0x92')])+_0x2974('0x9b')](_0x5a719b);default:throw new db[(_0x2974('0x89'))][(_0x2974('0x84'))](_0x2974('0xd3'));}})[_0x2974('0x1d')](function(_0x4aca53){_0x153240=_0x4aca53[_0x2974('0x45')];if(!_0x2cd20e['query']['hasOwnProperty'](_0x2974('0xd4'))){_0x5a719b[_0x2974('0x19')]=qs[_0x2974('0x19')](_0x2cd20e['query'][_0x2974('0x19')]);_0x5a719b['offset']=qs['offset'](_0x2cd20e['query']['offset']);}switch(_0x432c22[_0x2974('0x1e')]){case _0x2974('0x75'):return db[_[_0x2974('0x9a')](_0x2cd20e[_0x2974('0x3a')]['channel'])+'Queue']['findAll'](_0x5a719b);case'user':case'agent':return _0x432c22['get'+_[_0x2974('0x9a')](_0x2cd20e[_0x2974('0x3a')]['channel'])+_0x2974('0x9b')](_0x5a719b);}})[_0x2974('0x1d')](function(_0x5e7007){return{'count':_0x153240,'rows':_0x5e7007};})[_0x2974('0x1d')](respondWithResult(_0x2b7a73,null))[_0x2974('0x4a')](handleError(_0x2b7a73,null));};exports[_0x2974('0xd5')]=function(_0x12b2a7,_0x5df768){var _0x51f351={};var _0x3cc3db={};var _0x5f283e;var _0x425d13;return db[_0x2974('0x42')]['findOne']({'where':{'id':_0x12b2a7[_0x2974('0x53')]['id']}})[_0x2974('0x1d')](handleEntityNotFound(_0x5df768,null))[_0x2974('0x1d')](function(_0x26db1b){if(_0x26db1b){_0x5f283e=_0x26db1b;_0x3cc3db['model']=_[_0x2974('0xca')](db[_0x2974('0xa9')][_0x2974('0xcc')]);_0x3cc3db[_0x2974('0x3a')]=_[_0x2974('0xca')](_0x12b2a7['query']);_0x3cc3db[_0x2974('0xcd')]=_[_0x2974('0xce')](_0x3cc3db[_0x2974('0xc9')],_0x3cc3db[_0x2974('0x3a')]);_0x51f351[_0x2974('0x40')]=_[_0x2974('0xce')](_0x3cc3db['model'],qs[_0x2974('0xcf')](_0x12b2a7[_0x2974('0x3a')][_0x2974('0xcf')]));_0x51f351['attributes']=_0x51f351['attributes'][_0x2974('0x45')]?_0x51f351[_0x2974('0x40')]:_0x3cc3db[_0x2974('0xc9')];_0x51f351[_0x2974('0xd0')]=qs['sort'](_0x12b2a7[_0x2974('0x3a')][_0x2974('0xd1')]);_0x51f351[_0x2974('0x39')]=qs[_0x2974('0xcd')](_[_0x2974('0xd6')](_0x12b2a7[_0x2974('0x3a')],_0x3cc3db[_0x2974('0xcd')]));if(_0x12b2a7['query'][_0x2974('0x26')]){_0x51f351[_0x2974('0x39')]=_['merge'](_0x51f351[_0x2974('0x39')],{'$or':_[_0x2974('0x2f')](_0x51f351['attributes'],function(_0x1ec028){var _0x538e56={};_0x538e56[_0x1ec028]={'$like':'%'+_0x12b2a7[_0x2974('0x3a')][_0x2974('0x26')]+'%'};return _0x538e56;})});}_0x51f351=_[_0x2974('0xd2')]({},_0x51f351,_0x12b2a7[_0x2974('0x4c')]);return _0x5f283e['getVoiceQueuesRt'](_0x51f351);}})[_0x2974('0x1d')](function(_0xa8fa0d){if(_0xa8fa0d){_0x425d13=_0xa8fa0d[_0x2974('0x45')];if(!_0x12b2a7[_0x2974('0x3a')][_0x2974('0xc1')]('nolimit')){_0x51f351[_0x2974('0x19')]=qs['limit'](_0x12b2a7[_0x2974('0x3a')][_0x2974('0x19')]);_0x51f351[_0x2974('0x17')]=qs[_0x2974('0x17')](_0x12b2a7[_0x2974('0x3a')][_0x2974('0x17')]);}return _0x5f283e[_0x2974('0xd5')](_0x51f351);}})[_0x2974('0x1d')](function(_0x2c1d60){if(_0x2c1d60){return _0x2c1d60?{'count':_0x425d13,'rows':_0x2c1d60}:null;}})[_0x2974('0x1d')](respondWithResult(_0x5df768,null))[_0x2974('0x4a')](handleError(_0x5df768,null));};exports[_0x2974('0xd7')]=function(_0x1b48d3,_0x48a7eb){var _0x146153={};var _0x29d2f8={};var _0x36e7b1;var _0x193bf6;return db[_0x2974('0x42')]['findOne']({'where':{'id':_0x1b48d3[_0x2974('0x53')]['id']}})[_0x2974('0x1d')](handleEntityNotFound(_0x48a7eb,null))[_0x2974('0x1d')](function(_0x1e8518){if(_0x1e8518){_0x36e7b1=_0x1e8518;_0x29d2f8[_0x2974('0xc9')]=_['keys'](db[_0x2974('0xd8')][_0x2974('0xcc')]);_0x29d2f8[_0x2974('0x3a')]=_[_0x2974('0xca')](_0x1b48d3[_0x2974('0x3a')]);_0x29d2f8['filters']=_['intersection'](_0x29d2f8['model'],_0x29d2f8[_0x2974('0x3a')]);_0x146153[_0x2974('0x40')]=_[_0x2974('0xce')](_0x29d2f8['model'],qs[_0x2974('0xcf')](_0x1b48d3['query'][_0x2974('0xcf')]));_0x146153[_0x2974('0x40')]=_0x146153['attributes']['length']?_0x146153[_0x2974('0x40')]:_0x29d2f8[_0x2974('0xc9')];_0x146153['order']=qs[_0x2974('0xd1')](_0x1b48d3[_0x2974('0x3a')][_0x2974('0xd1')]);_0x146153[_0x2974('0x39')]=qs[_0x2974('0xcd')](_['pick'](_0x1b48d3[_0x2974('0x3a')],_0x29d2f8[_0x2974('0xcd')]));if(_0x1b48d3[_0x2974('0x3a')][_0x2974('0x26')]){_0x146153[_0x2974('0x39')]=_['merge'](_0x146153['where'],{'$or':_[_0x2974('0x2f')](_0x146153[_0x2974('0x40')],function(_0x1dd0cc){var _0x315e1e={};_0x315e1e[_0x1dd0cc]={'$like':'%'+_0x1b48d3[_0x2974('0x3a')][_0x2974('0x26')]+'%'};return _0x315e1e;})});}_0x146153=_[_0x2974('0xd2')]({},_0x146153,_0x1b48d3[_0x2974('0x4c')]);return _0x36e7b1[_0x2974('0xd7')](_0x146153);}})[_0x2974('0x1d')](function(_0x2e0c2e){if(_0x2e0c2e){_0x193bf6=_0x2e0c2e[_0x2974('0x45')];if(!_0x1b48d3[_0x2974('0x3a')][_0x2974('0xc1')](_0x2974('0xd4'))){_0x146153[_0x2974('0x19')]=qs[_0x2974('0x19')](_0x1b48d3[_0x2974('0x3a')][_0x2974('0x19')]);_0x146153[_0x2974('0x17')]=qs[_0x2974('0x17')](_0x1b48d3[_0x2974('0x3a')]['offset']);}return _0x36e7b1[_0x2974('0xd7')](_0x146153);}})['then'](function(_0x2824b6){if(_0x2824b6){return _0x2824b6?{'count':_0x193bf6,'rows':_0x2824b6}:null;}})['then'](respondWithResult(_0x48a7eb,null))[_0x2974('0x4a')](handleError(_0x48a7eb,null));};exports[_0x2974('0xd9')]=function(_0x3b0de9,_0xa107da){var _0x150c87={'raw':!![],'where':{}};var _0x1de012={};var _0x100362={'count':0x0,'rows':[]};return db[_0x2974('0x42')][_0x2974('0x8c')]({'where':{'id':_0x3b0de9[_0x2974('0x53')]['id']}})['then'](handleEntityNotFound(_0xa107da,null))['then'](function(_0x2750c9){if(_0x2750c9){_0x1de012[_0x2974('0xc9')]=_[_0x2974('0xca')](db[_0x2974('0xda')][_0x2974('0xcc')]);_0x1de012[_0x2974('0x3a')]=_['keys'](_0x3b0de9[_0x2974('0x3a')]);_0x1de012[_0x2974('0xcd')]=_[_0x2974('0xce')](_0x1de012[_0x2974('0xc9')],_0x1de012[_0x2974('0x3a')]);_0x150c87[_0x2974('0x40')]=_['intersection'](_0x1de012[_0x2974('0xc9')],qs[_0x2974('0xcf')](_0x3b0de9[_0x2974('0x3a')][_0x2974('0xcf')]));_0x150c87[_0x2974('0x40')]=_0x150c87['attributes'][_0x2974('0x45')]?_0x150c87['attributes']:_0x1de012[_0x2974('0xc9')];if(!_0x3b0de9[_0x2974('0x3a')]['hasOwnProperty'](_0x2974('0xd4'))){_0x150c87['limit']=qs[_0x2974('0x19')](_0x3b0de9[_0x2974('0x3a')][_0x2974('0x19')]);_0x150c87[_0x2974('0x17')]=qs[_0x2974('0x17')](_0x3b0de9['query'][_0x2974('0x17')]);}_0x150c87[_0x2974('0xd0')]=qs[_0x2974('0xd1')](_0x3b0de9[_0x2974('0x3a')][_0x2974('0xd1')]);_0x150c87[_0x2974('0x39')]=qs['filters'](_['pick'](_0x3b0de9['query'],_0x1de012[_0x2974('0xcd')]));_0x150c87['where']['UserId']=_0x2750c9['id'];if(_0x3b0de9[_0x2974('0x3a')]['filter']){_0x150c87[_0x2974('0x39')]=_[_0x2974('0xd2')](_0x150c87['where'],{'$or':_[_0x2974('0x2f')](_0x150c87['attributes'],function(_0x4ef0de){var _0x121b59={};_0x121b59[_0x4ef0de]={'$like':'%'+_0x3b0de9['query'][_0x2974('0x26')]+'%'};return _0x121b59;})});}_0x150c87=_[_0x2974('0xd2')]({},_0x150c87,_0x3b0de9[_0x2974('0x4c')]);return db['VoiceRecording']['count']({'where':_0x150c87[_0x2974('0x39')]})[_0x2974('0x1d')](function(_0xac7f3a){_0x100362[_0x2974('0x1a')]=_0xac7f3a;if(_0x3b0de9['query'][_0x2974('0x3b')]){_0x150c87[_0x2974('0x3c')]=[{'all':!![]}];}return db['VoiceRecording'][_0x2974('0xc8')](_0x150c87);})[_0x2974('0x1d')](function(_0x408392){_0x100362['rows']=_0x408392;return _0x100362;});}})[_0x2974('0x1d')](respondWithFilteredResult(_0xa107da,_0x150c87))['catch'](handleError(_0xa107da,null));};exports[_0x2974('0xdb')]=function(_0x4d2d7b,_0x53dfe7){var _0x10e92d={'raw':!![],'where':{}};var _0x378841={};var _0x31492b={'count':0x0,'rows':[]};return db[_0x2974('0x42')][_0x2974('0x8c')]({'where':{'id':_0x4d2d7b[_0x2974('0x53')]['id']}})[_0x2974('0x1d')](handleEntityNotFound(_0x53dfe7,null))[_0x2974('0x1d')](function(_0x5f10f8){if(_0x5f10f8){_0x378841[_0x2974('0xc9')]=_[_0x2974('0xca')](db[_0x2974('0xdc')][_0x2974('0xcc')]);_0x378841[_0x2974('0x3a')]=_['keys'](_0x4d2d7b['query']);_0x378841[_0x2974('0xcd')]=_[_0x2974('0xce')](_0x378841[_0x2974('0xc9')],_0x378841[_0x2974('0x3a')]);_0x10e92d[_0x2974('0x40')]=_['intersection'](_0x378841['model'],qs['fields'](_0x4d2d7b['query']['fields']));_0x10e92d[_0x2974('0x40')]=_0x10e92d[_0x2974('0x40')][_0x2974('0x45')]?_0x10e92d[_0x2974('0x40')]:_0x378841[_0x2974('0xc9')];if(!_0x4d2d7b[_0x2974('0x3a')][_0x2974('0xc1')](_0x2974('0xd4'))){_0x10e92d['limit']=qs[_0x2974('0x19')](_0x4d2d7b[_0x2974('0x3a')]['limit']);_0x10e92d[_0x2974('0x17')]=qs[_0x2974('0x17')](_0x4d2d7b[_0x2974('0x3a')][_0x2974('0x17')]);}_0x10e92d[_0x2974('0xd0')]=qs['sort'](_0x4d2d7b[_0x2974('0x3a')][_0x2974('0xd1')]);_0x10e92d[_0x2974('0x39')]=qs['filters'](_[_0x2974('0xd6')](_0x4d2d7b[_0x2974('0x3a')],_0x378841['filters']));_0x10e92d[_0x2974('0x39')][_0x2974('0xdd')]=_0x5f10f8['id'];if(_0x4d2d7b[_0x2974('0x3a')]['filter']){_0x10e92d['where']=_[_0x2974('0xd2')](_0x10e92d[_0x2974('0x39')],{'$or':_[_0x2974('0x2f')](_0x10e92d['attributes'],function(_0xaa1db4){var _0x37cc2c={};_0x37cc2c[_0xaa1db4]={'$like':'%'+_0x4d2d7b['query'][_0x2974('0x26')]+'%'};return _0x37cc2c;})});}_0x10e92d=_[_0x2974('0xd2')]({},_0x10e92d,_0x4d2d7b[_0x2974('0x4c')]);return db['ScreenRecording'][_0x2974('0x1a')]({'where':_0x10e92d[_0x2974('0x39')]})['then'](function(_0x1da0f7){_0x31492b['count']=_0x1da0f7;if(_0x4d2d7b[_0x2974('0x3a')]['includeAll']){_0x10e92d[_0x2974('0x3c')]=[{'all':!![]}];}return db[_0x2974('0xdc')][_0x2974('0xc8')](_0x10e92d);})['then'](function(_0x38a5f6){_0x31492b[_0x2974('0x43')]=_0x38a5f6;return _0x31492b;});}})[_0x2974('0x1d')](respondWithFilteredResult(_0x53dfe7,_0x10e92d))[_0x2974('0x4a')](handleError(_0x53dfe7,null));};exports[_0x2974('0xde')]=function(_0x5a25d6,_0x11aaa6){var _0x706279={};var _0x5af210={};var _0x45bb2a;var _0x2fcd1f;return db['User'][_0x2974('0x8c')]({'where':{'id':_0x5a25d6[_0x2974('0x53')]['id']}})[_0x2974('0x1d')](handleEntityNotFound(_0x11aaa6,null))[_0x2974('0x1d')](function(_0x67b6fa){if(_0x67b6fa){_0x45bb2a=_0x67b6fa;_0x5af210[_0x2974('0xc9')]=_['keys'](db[_0x2974('0xdf')][_0x2974('0xcc')]);_0x5af210['query']=_[_0x2974('0xca')](_0x5a25d6[_0x2974('0x3a')]);_0x5af210['filters']=_['intersection'](_0x5af210[_0x2974('0xc9')],_0x5af210[_0x2974('0x3a')]);_0x706279[_0x2974('0x40')]=_[_0x2974('0xce')](_0x5af210[_0x2974('0xc9')],qs[_0x2974('0xcf')](_0x5a25d6['query']['fields']));_0x706279[_0x2974('0x40')]=_0x706279['attributes'][_0x2974('0x45')]?_0x706279[_0x2974('0x40')]:_0x5af210[_0x2974('0xc9')];_0x706279['order']=qs[_0x2974('0xd1')](_0x5a25d6['query'][_0x2974('0xd1')]);_0x706279[_0x2974('0x39')]=qs['filters'](_['pick'](_0x5a25d6['query'],_0x5af210[_0x2974('0xcd')]));if(_0x5a25d6['query'][_0x2974('0x26')]){_0x706279[_0x2974('0x39')]=_[_0x2974('0xd2')](_0x706279[_0x2974('0x39')],{'$or':_[_0x2974('0x2f')](_0x706279[_0x2974('0x40')],function(_0x5b0bab){var _0x4830ed={};_0x4830ed[_0x5b0bab]={'$like':'%'+_0x5a25d6[_0x2974('0x3a')]['filter']+'%'};return _0x4830ed;})});}_0x706279=_[_0x2974('0xd2')]({},_0x706279,_0x5a25d6[_0x2974('0x4c')]);return _0x45bb2a[_0x2974('0xde')](_0x706279);}})['then'](function(_0x23cd0e){if(_0x23cd0e){_0x2fcd1f=_0x23cd0e[_0x2974('0x45')];if(!_0x5a25d6[_0x2974('0x3a')][_0x2974('0xc1')](_0x2974('0xd4'))){_0x706279[_0x2974('0x19')]=qs[_0x2974('0x19')](_0x5a25d6[_0x2974('0x3a')]['limit']);_0x706279[_0x2974('0x17')]=qs[_0x2974('0x17')](_0x5a25d6[_0x2974('0x3a')][_0x2974('0x17')]);}return _0x45bb2a['getChatInteractions'](_0x706279);}})[_0x2974('0x1d')](function(_0x1374aa){if(_0x1374aa){return _0x1374aa?{'count':_0x2fcd1f,'rows':_0x1374aa}:null;}})[_0x2974('0x1d')](respondWithResult(_0x11aaa6,null))[_0x2974('0x4a')](handleError(_0x11aaa6,null));};exports[_0x2974('0xe0')]=function(_0x2afa4e,_0x4ed877){var _0x526ca6={};var _0xbc7c37={};var _0x4e2cd8;var _0x4dca79;return db[_0x2974('0x42')][_0x2974('0x8c')]({'where':{'id':_0x2afa4e[_0x2974('0x53')]['id']}})[_0x2974('0x1d')](handleEntityNotFound(_0x4ed877,null))[_0x2974('0x1d')](function(_0x46f0a8){if(_0x46f0a8){_0x4e2cd8=_0x46f0a8;_0xbc7c37[_0x2974('0xc9')]=_['keys'](db['OpenchannelInteraction'][_0x2974('0xcc')]);_0xbc7c37[_0x2974('0x3a')]=_[_0x2974('0xca')](_0x2afa4e[_0x2974('0x3a')]);_0xbc7c37[_0x2974('0xcd')]=_[_0x2974('0xce')](_0xbc7c37['model'],_0xbc7c37[_0x2974('0x3a')]);_0x526ca6[_0x2974('0x40')]=_['intersection'](_0xbc7c37[_0x2974('0xc9')],qs[_0x2974('0xcf')](_0x2afa4e[_0x2974('0x3a')][_0x2974('0xcf')]));_0x526ca6[_0x2974('0x40')]=_0x526ca6['attributes']['length']?_0x526ca6[_0x2974('0x40')]:_0xbc7c37[_0x2974('0xc9')];_0x526ca6[_0x2974('0xd0')]=qs[_0x2974('0xd1')](_0x2afa4e[_0x2974('0x3a')][_0x2974('0xd1')]);_0x526ca6['where']=qs[_0x2974('0xcd')](_[_0x2974('0xd6')](_0x2afa4e['query'],_0xbc7c37[_0x2974('0xcd')]));if(_0x2afa4e[_0x2974('0x3a')][_0x2974('0x26')]){_0x526ca6[_0x2974('0x39')]=_[_0x2974('0xd2')](_0x526ca6[_0x2974('0x39')],{'$or':_[_0x2974('0x2f')](_0x526ca6[_0x2974('0x40')],function(_0x56e127){var _0xd56a52={};_0xd56a52[_0x56e127]={'$like':'%'+_0x2afa4e['query'][_0x2974('0x26')]+'%'};return _0xd56a52;})});}_0x526ca6=_[_0x2974('0xd2')]({},_0x526ca6,_0x2afa4e[_0x2974('0x4c')]);return _0x4e2cd8[_0x2974('0xe0')](_0x526ca6);}})[_0x2974('0x1d')](function(_0x250477){if(_0x250477){_0x4dca79=_0x250477[_0x2974('0x45')];if(!_0x2afa4e['query']['hasOwnProperty'](_0x2974('0xd4'))){_0x526ca6[_0x2974('0x19')]=qs[_0x2974('0x19')](_0x2afa4e[_0x2974('0x3a')][_0x2974('0x19')]);_0x526ca6[_0x2974('0x17')]=qs[_0x2974('0x17')](_0x2afa4e[_0x2974('0x3a')][_0x2974('0x17')]);}return _0x4e2cd8['getOpenchannelInteractions'](_0x526ca6);}})[_0x2974('0x1d')](function(_0x5db423){if(_0x5db423){return _0x5db423?{'count':_0x4dca79,'rows':_0x5db423}:null;}})[_0x2974('0x1d')](respondWithResult(_0x4ed877,null))[_0x2974('0x4a')](handleError(_0x4ed877,null));};exports[_0x2974('0xe1')]=function(_0x57bd0f,_0x57fa37){var _0x14c3c5={'raw':!![],'where':{}};var _0x339dff={};var _0x51d408={'count':0x0,'rows':[]};return db[_0x2974('0x42')][_0x2974('0x8c')]({'where':{'id':_0x57bd0f['params']['id']}})[_0x2974('0x1d')](handleEntityNotFound(_0x57fa37,null))['then'](function(_0x34382c){if(_0x34382c){_0x339dff[_0x2974('0xc9')]=_[_0x2974('0xca')](db[_0x2974('0xe2')][_0x2974('0xcc')]);_0x339dff[_0x2974('0x3a')]=_['keys'](_0x57bd0f[_0x2974('0x3a')]);_0x339dff[_0x2974('0xcd')]=_[_0x2974('0xce')](_0x339dff['model'],_0x339dff[_0x2974('0x3a')]);_0x14c3c5[_0x2974('0x40')]=_[_0x2974('0xce')](_0x339dff[_0x2974('0xc9')],qs[_0x2974('0xcf')](_0x57bd0f[_0x2974('0x3a')][_0x2974('0xcf')]));_0x14c3c5[_0x2974('0x40')]=_0x14c3c5[_0x2974('0x40')]['length']?_0x14c3c5[_0x2974('0x40')]:_0x339dff[_0x2974('0xc9')];if(!_0x57bd0f[_0x2974('0x3a')]['hasOwnProperty'](_0x2974('0xd4'))){_0x14c3c5[_0x2974('0x19')]=qs[_0x2974('0x19')](_0x57bd0f['query']['limit']);_0x14c3c5[_0x2974('0x17')]=qs[_0x2974('0x17')](_0x57bd0f[_0x2974('0x3a')][_0x2974('0x17')]);}_0x14c3c5[_0x2974('0xd0')]=qs['sort'](_0x57bd0f[_0x2974('0x3a')][_0x2974('0xd1')]);_0x14c3c5[_0x2974('0x39')]=qs[_0x2974('0xcd')](_[_0x2974('0xd6')](_0x57bd0f[_0x2974('0x3a')],_0x339dff[_0x2974('0xcd')]));_0x14c3c5[_0x2974('0x39')]['UserId']=_0x34382c['id'];if(_0x57bd0f[_0x2974('0x3a')][_0x2974('0x26')]){_0x14c3c5['where']=_['merge'](_0x14c3c5['where'],{'$or':_[_0x2974('0x2f')](_0x14c3c5['attributes'],function(_0x225947){var _0x257f6c={};_0x257f6c[_0x225947]={'$like':'%'+_0x57bd0f[_0x2974('0x3a')][_0x2974('0x26')]+'%'};return _0x257f6c;})});}_0x14c3c5=_[_0x2974('0xd2')]({},_0x14c3c5,_0x57bd0f[_0x2974('0x4c')]);return db[_0x2974('0xe2')]['count']({'where':_0x14c3c5[_0x2974('0x39')]})['then'](function(_0x20093b){_0x51d408[_0x2974('0x1a')]=_0x20093b;if(_0x57bd0f['query'][_0x2974('0x3b')]){_0x14c3c5[_0x2974('0x3c')]=[{'all':!![]}];}return db[_0x2974('0xe2')][_0x2974('0xc8')](_0x14c3c5);})['then'](function(_0x35e1c2){_0x51d408['rows']=_0x35e1c2;return _0x51d408;});}})[_0x2974('0x1d')](respondWithFilteredResult(_0x57fa37,_0x14c3c5))[_0x2974('0x4a')](handleError(_0x57fa37,null));};exports[_0x2974('0xe3')]=function(_0x38de9d,_0x3e6ed4){var _0xb9fed4={};var _0x301007={};var _0xe051e1;var _0x428cfe;return db[_0x2974('0x42')]['findOne']({'where':{'id':_0x38de9d[_0x2974('0x53')]['id']}})['then'](handleEntityNotFound(_0x3e6ed4,null))[_0x2974('0x1d')](function(_0x480015){if(_0x480015){_0xe051e1=_0x480015;_0x301007[_0x2974('0xc9')]=_[_0x2974('0xca')](db[_0x2974('0xe4')][_0x2974('0xcc')]);_0x301007[_0x2974('0x3a')]=_[_0x2974('0xca')](_0x38de9d[_0x2974('0x3a')]);_0x301007[_0x2974('0xcd')]=_[_0x2974('0xce')](_0x301007[_0x2974('0xc9')],_0x301007['query']);_0xb9fed4[_0x2974('0x40')]=_[_0x2974('0xce')](_0x301007[_0x2974('0xc9')],qs[_0x2974('0xcf')](_0x38de9d['query'][_0x2974('0xcf')]));_0xb9fed4[_0x2974('0x40')]=_0xb9fed4['attributes'][_0x2974('0x45')]?_0xb9fed4[_0x2974('0x40')]:_0x301007[_0x2974('0xc9')];_0xb9fed4[_0x2974('0xd0')]=qs['sort'](_0x38de9d[_0x2974('0x3a')][_0x2974('0xd1')]);_0xb9fed4[_0x2974('0x39')]=qs[_0x2974('0xcd')](_[_0x2974('0xd6')](_0x38de9d['query'],_0x301007['filters']));if(_0x38de9d[_0x2974('0x3a')]['filter']){_0xb9fed4[_0x2974('0x39')]=_[_0x2974('0xd2')](_0xb9fed4[_0x2974('0x39')],{'$or':_['map'](_0xb9fed4[_0x2974('0x40')],function(_0x3ee231){var _0x303480={};_0x303480[_0x3ee231]={'$like':'%'+_0x38de9d[_0x2974('0x3a')][_0x2974('0x26')]+'%'};return _0x303480;})});}_0xb9fed4=_[_0x2974('0xd2')]({},_0xb9fed4,_0x38de9d[_0x2974('0x4c')]);return _0xe051e1[_0x2974('0xe3')](_0xb9fed4);}})['then'](function(_0x1ebf38){if(_0x1ebf38){_0x428cfe=_0x1ebf38[_0x2974('0x45')];if(!_0x38de9d[_0x2974('0x3a')]['hasOwnProperty'](_0x2974('0xd4'))){_0xb9fed4[_0x2974('0x19')]=qs[_0x2974('0x19')](_0x38de9d['query']['limit']);_0xb9fed4[_0x2974('0x17')]=qs['offset'](_0x38de9d[_0x2974('0x3a')][_0x2974('0x17')]);}return _0xe051e1['getSmsInteractions'](_0xb9fed4);}})[_0x2974('0x1d')](function(_0x3f7ccf){if(_0x3f7ccf){return _0x3f7ccf?{'count':_0x428cfe,'rows':_0x3f7ccf}:null;}})['then'](respondWithResult(_0x3e6ed4,null))[_0x2974('0x4a')](handleError(_0x3e6ed4,null));};exports[_0x2974('0xe5')]=function(_0x7e7568,_0x247169){var _0x2bf01f={};var _0x45185d={};var _0x12d3cb;var _0x4294f6;return db['User']['findOne']({'where':{'id':_0x7e7568[_0x2974('0x53')]['id']}})['then'](handleEntityNotFound(_0x247169,null))[_0x2974('0x1d')](function(_0x168d06){if(_0x168d06){_0x12d3cb=_0x168d06;_0x45185d[_0x2974('0xc9')]=_[_0x2974('0xca')](db['FaxInteraction'][_0x2974('0xcc')]);_0x45185d[_0x2974('0x3a')]=_[_0x2974('0xca')](_0x7e7568['query']);_0x45185d[_0x2974('0xcd')]=_[_0x2974('0xce')](_0x45185d['model'],_0x45185d['query']);_0x2bf01f[_0x2974('0x40')]=_[_0x2974('0xce')](_0x45185d['model'],qs[_0x2974('0xcf')](_0x7e7568[_0x2974('0x3a')]['fields']));_0x2bf01f[_0x2974('0x40')]=_0x2bf01f[_0x2974('0x40')][_0x2974('0x45')]?_0x2bf01f[_0x2974('0x40')]:_0x45185d[_0x2974('0xc9')];_0x2bf01f['order']=qs[_0x2974('0xd1')](_0x7e7568[_0x2974('0x3a')]['sort']);_0x2bf01f[_0x2974('0x39')]=qs[_0x2974('0xcd')](_[_0x2974('0xd6')](_0x7e7568[_0x2974('0x3a')],_0x45185d[_0x2974('0xcd')]));if(_0x7e7568[_0x2974('0x3a')][_0x2974('0x26')]){_0x2bf01f['where']=_[_0x2974('0xd2')](_0x2bf01f['where'],{'$or':_[_0x2974('0x2f')](_0x2bf01f['attributes'],function(_0x2589ef){var _0x34ec97={};_0x34ec97[_0x2589ef]={'$like':'%'+_0x7e7568['query'][_0x2974('0x26')]+'%'};return _0x34ec97;})});}_0x2bf01f=_[_0x2974('0xd2')]({},_0x2bf01f,_0x7e7568['options']);return _0x12d3cb['getFaxInteractions'](_0x2bf01f);}})['then'](function(_0x52de0b){if(_0x52de0b){_0x4294f6=_0x52de0b[_0x2974('0x45')];if(!_0x7e7568[_0x2974('0x3a')][_0x2974('0xc1')](_0x2974('0xd4'))){_0x2bf01f[_0x2974('0x19')]=qs['limit'](_0x7e7568['query'][_0x2974('0x19')]);_0x2bf01f[_0x2974('0x17')]=qs[_0x2974('0x17')](_0x7e7568[_0x2974('0x3a')][_0x2974('0x17')]);}return _0x12d3cb[_0x2974('0xe5')](_0x2bf01f);}})['then'](function(_0x4158e0){if(_0x4158e0){return _0x4158e0?{'count':_0x4294f6,'rows':_0x4158e0}:null;}})['then'](respondWithResult(_0x247169,null))[_0x2974('0x4a')](handleError(_0x247169,null));};exports['getWhatsappInteractions']=function(_0x33346a,_0x571d10){var _0x4dc105={};var _0x5ae4b0={};var _0x1d2b3b;var _0x4ba2a6;return db[_0x2974('0x42')]['findOne']({'where':{'id':_0x33346a[_0x2974('0x53')]['id']}})[_0x2974('0x1d')](handleEntityNotFound(_0x571d10,null))[_0x2974('0x1d')](function(_0x164324){if(_0x164324){_0x1d2b3b=_0x164324;_0x5ae4b0['model']=_[_0x2974('0xca')](db[_0x2974('0xe6')][_0x2974('0xcc')]);_0x5ae4b0[_0x2974('0x3a')]=_[_0x2974('0xca')](_0x33346a[_0x2974('0x3a')]);_0x5ae4b0[_0x2974('0xcd')]=_['intersection'](_0x5ae4b0[_0x2974('0xc9')],_0x5ae4b0[_0x2974('0x3a')]);_0x4dc105['attributes']=_[_0x2974('0xce')](_0x5ae4b0[_0x2974('0xc9')],qs[_0x2974('0xcf')](_0x33346a[_0x2974('0x3a')][_0x2974('0xcf')]));_0x4dc105[_0x2974('0x40')]=_0x4dc105[_0x2974('0x40')][_0x2974('0x45')]?_0x4dc105[_0x2974('0x40')]:_0x5ae4b0['model'];_0x4dc105[_0x2974('0xd0')]=qs[_0x2974('0xd1')](_0x33346a[_0x2974('0x3a')]['sort']);_0x4dc105[_0x2974('0x39')]=qs[_0x2974('0xcd')](_['pick'](_0x33346a[_0x2974('0x3a')],_0x5ae4b0['filters']));if(_0x33346a[_0x2974('0x3a')][_0x2974('0x26')]){_0x4dc105[_0x2974('0x39')]=_[_0x2974('0xd2')](_0x4dc105[_0x2974('0x39')],{'$or':_[_0x2974('0x2f')](_0x4dc105[_0x2974('0x40')],function(_0xfcd43f){var _0x402b66={};_0x402b66[_0xfcd43f]={'$like':'%'+_0x33346a[_0x2974('0x3a')][_0x2974('0x26')]+'%'};return _0x402b66;})});}_0x4dc105=_[_0x2974('0xd2')]({},_0x4dc105,_0x33346a['options']);return _0x1d2b3b[_0x2974('0xe7')](_0x4dc105);}})[_0x2974('0x1d')](function(_0x273bc2){if(_0x273bc2){_0x4ba2a6=_0x273bc2['length'];if(!_0x33346a[_0x2974('0x3a')][_0x2974('0xc1')](_0x2974('0xd4'))){_0x4dc105[_0x2974('0x19')]=qs[_0x2974('0x19')](_0x33346a[_0x2974('0x3a')][_0x2974('0x19')]);_0x4dc105[_0x2974('0x17')]=qs[_0x2974('0x17')](_0x33346a['query']['offset']);}return _0x1d2b3b[_0x2974('0xe7')](_0x4dc105);}})[_0x2974('0x1d')](function(_0x238257){if(_0x238257){return _0x238257?{'count':_0x4ba2a6,'rows':_0x238257}:null;}})['then'](respondWithResult(_0x571d10,null))[_0x2974('0x4a')](handleError(_0x571d10,null));};exports['login']=function(_0x35c242,_0x15e2c7,_0x2de64c){var _0x19b0a0;var _0x4f1fc6;var _0x23d8d1;var _0x1052e8=!_['isNil'](_0x35c242[_0x2974('0x53')]['id'])?_0x35c242[_0x2974('0x53')]['id']:!_['isNil'](_0x35c242[_0x2974('0x73')]['id'])?_0x35c242[_0x2974('0x73')]['id']:null;return db['User'][_0x2974('0x4d')]({'where':{'id':_0x1052e8,'role':{'$or':[_0x2974('0x75'),_0x2974('0x73'),_0x2974('0x1f')]}},'attributes':['id',_0x2974('0x2a'),_0x2974('0xe8'),_0x2974('0xe9'),_0x2974('0x1e'),_0x2974('0x5a'),_0x2974('0x94')]})[_0x2974('0x1d')](function(_0xd2ce8f){if(_0xd2ce8f){if(_0xd2ce8f[_0x2974('0x1e')]===_0x2974('0x1f')){_0x19b0a0=_0xd2ce8f;if(_0x35c242[_0x2974('0x51')][_0x2974('0x96')]){_0x23d8d1=util[_0x2974('0xa4')](_0x2974('0xea'),_0x19b0a0[_0x35c242[_0x2974('0x51')][_0x2974('0x96')]]);}else if(_0x35c242[_0x2974('0x51')][_0x2974('0xeb')]){_0x23d8d1=util['format']('SIP/%s',_0x35c242[_0x2974('0x51')][_0x2974('0xeb')]);}else{_0x23d8d1=util[_0x2974('0xa4')](_0x2974('0xa5'),_0x19b0a0['name']);}socket['to'](util['format'](_0x2974('0xec'),_0x19b0a0[_0x2974('0x2a')]))[_0x2974('0x20')]('user:forcelogout',{'user':{'id':_0x19b0a0['id'],'name':_0x19b0a0['name']},'ip':_0x35c242[_0x2974('0xed')][_0x2974('0xee')]||_0x35c242[_0x2974('0xef')][_0x2974('0xf0')]||_0x35c242[_0x2974('0xf1')][_0x2974('0xf0')]||_0x35c242[_0x2974('0xef')][_0x2974('0xf1')]['remoteAddress']});return db[_0x2974('0xa9')][_0x2974('0x22')]({'where':{'membername':_0x19b0a0[_0x2974('0x2a')]},'individualHooks':!![]});}}else{throw new db[(_0x2974('0x89'))][(_0x2974('0x84'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x2974('0x1d')](function(){if(_0x19b0a0){return _0x19b0a0[_0x2974('0xf2')]({'raw':!![]});}})['then'](function(_0x30803a){if(_0x19b0a0){if(_0x30803a){_0x4f1fc6=_0x30803a;if(_0x4f1fc6[_0x2974('0x45')]){var _0x188e37=_0x4f1fc6['map'](function(_0x472f43){var _0x46b1ea={'membername':_0x19b0a0[_0x2974('0x2a')],'UserId':_0x19b0a0['id'],'queue_name':_0x472f43[_0x2974('0x2a')],'VoiceQueueId':_0x472f43['id'],'interface':_0x23d8d1,'paused':_0x19b0a0[_0x2974('0x94')]||![],'penalty':_0x472f43['UserVoiceQueue.penalty']||0x0};return db[_0x2974('0xa9')][_0x2974('0xf3')](_0x46b1ea);});return Promise[_0x2974('0x49')](_0x188e37);}}}})[_0x2974('0x1d')](function(){if(_0x19b0a0){return db[_0x2974('0xf4')]['findAll']({'where':{'membername':_0x19b0a0[_0x2974('0x2a')],'exitAt':null}});}})[_0x2974('0x1d')](function(_0x54b857){if(_0x19b0a0){var _0x2994e7=[];_0x54b857[_0x2974('0xf5')](function(_0x2f5b51){_0x2994e7[_0x2974('0x41')](_0x2f5b51[_0x2974('0x1c')]({'exitAt':moment()[_0x2974('0xa4')](_0x2974('0xf6'))}));});return Promise[_0x2974('0x49')](_0x2994e7);}})[_0x2974('0x1d')](function(){if(_0x19b0a0){var _0x349de9=[];var _0x2958aa=[];var _0x3856e6=utils[_0x2974('0xf7')]();var _0x31b83b={'membername':_0x19b0a0['name'],'interface':_0x23d8d1,'enterAt':moment()[_0x2974('0xa4')](_0x2974('0xf6')),'role':_0x19b0a0['role'],'internal':_0x19b0a0[_0x2974('0x5a')]};_0x3856e6[_0x2974('0xf5')](function(_0x5aacf2){_0x349de9[_0x2974('0x41')](_[_0x2974('0xd2')]({'channel':_0x5aacf2,'type':_0x2974('0xf8'),'data1':_0x35c242['body'][_0x2974('0xf9')],'data2':_0x23d8d1},_0x31b83b));if(_0x19b0a0[_0x2974('0x94')]){_0x2958aa['push'](_['merge']({'channel':_0x5aacf2,'type':_0x2974('0xfa'),'data1':_0x2974('0xfb')},_0x31b83b));}});return db[_0x2974('0xf4')][_0x2974('0x7d')](_0x349de9[_0x2974('0xbd')](_0x2958aa),{'individualHooks':!![]});}})[_0x2974('0x1d')](function(){if(_0x19b0a0){return _0x19b0a0[_0x2974('0x1c')]({'online':!![],'lastLoginAt':moment()[_0x2974('0xa4')](_0x2974('0xf6')),'voicePause':_0x19b0a0[_0x2974('0x94')]||![],'mailPause':_0x19b0a0[_0x2974('0x94')]||![],'chatPause':_0x19b0a0[_0x2974('0x94')]||![],'faxPause':_0x19b0a0[_0x2974('0x94')]||![],'smsPause':_0x19b0a0[_0x2974('0x94')]||![],'openchannelPause':_0x19b0a0['loginInPause']||![],'whatsappPause':_0x19b0a0['loginInPause']||![],'pauseType':_0x19b0a0['loginInPause']?'LOGININPAUSE':null,'interface':_0x23d8d1,'lastPauseAt':moment()[_0x2974('0xa4')](_0x2974('0xf6'))});}})['then'](function(_0x4447ba){if(_0x35c242[_0x2974('0xfc')]){return _0x2de64c();}else{return Promise['resolve'](_0x4447ba)['then'](respondWithResult(_0x15e2c7,null));}})['catch'](handleError(_0x15e2c7,null));};exports['logout']=function(_0x545c64,_0x585852){var _0x421d7f;return db[_0x2974('0x42')][_0x2974('0x4d')]({'where':{'id':_0x545c64[_0x2974('0x53')]['id'],'role':_0x2974('0x1f')},'attributes':['id',_0x2974('0x2a'),_0x2974('0x1e')]})['then'](handleEntityNotFound(_0x585852,null))[_0x2974('0x1d')](function(_0xc0db4d){if(_0xc0db4d){_0x421d7f=_0xc0db4d;return db[_0x2974('0xa9')][_0x2974('0x22')]({'where':{'membername':_0x421d7f['name']},'individualHooks':!![]});}})[_0x2974('0x1d')](function(){return db[_0x2974('0xf4')]['findAll']({'where':{'membername':_0x421d7f[_0x2974('0x2a')],'exitAt':null}});})[_0x2974('0x1d')](function(_0x57a8f1){var _0x1400ea=[];_0x57a8f1[_0x2974('0xf5')](function(_0x3564ac){_0x1400ea[_0x2974('0x41')](_0x3564ac['update']({'exitAt':moment()[_0x2974('0xa4')](_0x2974('0xf6'))}));});return Promise[_0x2974('0x49')](_0x1400ea);})[_0x2974('0x1d')](function(){return _0x421d7f[_0x2974('0x1c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x2974('0x1d')](respondWithResult(_0x585852,null))[_0x2974('0x4a')](handleError(_0x585852,null));};exports[_0x2974('0xfd')]=function(_0x36d0c2,_0x4cddc6){var _0x1bf89e;return db[_0x2974('0xa9')][_0x2974('0x1c')]({'paused':0x1},{'where':{'UserId':_0x36d0c2[_0x2974('0x53')]['id']},'individualHooks':!![]})[_0x2974('0x1d')](function(){return db[_0x2974('0x42')][_0x2974('0x4d')]({'where':{'id':_0x36d0c2[_0x2974('0x53')]['id'],'role':_0x2974('0x1f')},'attributes':['id','name',_0x2974('0x1e'),_0x2974('0x5a'),'interface',_0x2974('0x93')]});})[_0x2974('0x1d')](handleEntityNotFound(_0x4cddc6,null))[_0x2974('0x1d')](function(_0x43004e){if(_0x43004e){_0x1bf89e=_0x43004e;return db[_0x2974('0xf4')]['findAll']({'where':{'membername':_0x1bf89e[_0x2974('0x2a')],'type':_0x2974('0xfa'),'exitAt':null}});}})[_0x2974('0x1d')](function(_0x27fda4){if(_0x27fda4[_0x2974('0x45')]){var _0x1f5d92=moment()['format'](_0x2974('0xf6'));for(var _0x183f79=0x0,_0x386380=_0x27fda4[_0x2974('0x45')];_0x183f79<_0x386380;_0x183f79++){_0x27fda4[_0x183f79][_0x2974('0xfe')]({'exitAt':_0x1f5d92});}}})['then'](function(){var _0x4048d5=[];var _0x3fab57=utils['getChannels']();_0x3fab57['forEach'](function(_0x57f423){_0x4048d5[_0x2974('0x41')]({'channel':_0x57f423,'membername':_0x1bf89e[_0x2974('0x2a')],'interface':_[_0x2974('0x5b')](_0x1bf89e['interface'])?util[_0x2974('0xa4')](_0x2974('0xa5'),_0x1bf89e[_0x2974('0x2a')]):_0x1bf89e[_0x2974('0x96')],'type':'PAUSE','enterAt':moment()['format'](_0x2974('0xf6')),'data1':_0x36d0c2[_0x2974('0x51')][_0x2974('0x31')]||_0x2974('0xff'),'role':_0x1bf89e['role'],'internal':_0x1bf89e['internal']});});return db[_0x2974('0xf4')][_0x2974('0x7d')](_0x4048d5,{'individualHooks':!![]});})[_0x2974('0x1d')](function(){return _0x1bf89e[_0x2974('0x1c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x36d0c2[_0x2974('0x51')][_0x2974('0x31')]||_0x2974('0xff'),'lastPauseAt':moment()[_0x2974('0xa4')](_0x2974('0xf6'))});})['then'](respondWithResult(_0x4cddc6,null))[_0x2974('0x4a')](handleError(_0x4cddc6,null));};exports[_0x2974('0x100')]=function(_0x4708ef,_0x185088){if(_0x4708ef[_0x2974('0x51')][_0x2974('0x92')]&&!utils['isValidChannel'](_0x4708ef[_0x2974('0x51')]['channel'])){throw new APIBadRequestError(util[_0x2974('0xa4')](_0x2974('0x101'),_0x4708ef[_0x2974('0x51')]['channel']));}return db[_0x2974('0x42')][_0x2974('0x4d')]({'where':{'id':_0x4708ef[_0x2974('0x53')]['id']},'attributes':['id',_0x2974('0x2a'),_0x2974('0x1e'),_0x2974('0x5a'),_0x2974('0x96'),_0x2974('0x93'),_0x2974('0x95'),_0x2974('0x102'),_0x2974('0x103'),'faxPause',_0x2974('0x104'),_0x2974('0x105'),_0x2974('0x106'),'pauseType','lastPauseAt']})[_0x2974('0x1d')](function(_0x1f5bb0){if(!_0x1f5bb0){throw new APINotFoundError(util[_0x2974('0xa4')](_0x2974('0xbf'),_0x4708ef[_0x2974('0x53')]['id']));}return _0x1f5bb0['unpause'](_0x4708ef[_0x2974('0x51')][_0x2974('0x92')]);})[_0x2974('0x1d')](respondWithResult(_0x185088,null))[_0x2974('0x4a')](APIHandleError(_0x185088));};exports[_0x2974('0x107')]=function(_0x2d2456,_0x1797c0){var _0x15a607={};var _0x337474={};var _0x16e7d8;var _0x5a2596;return db[_0x2974('0x42')][_0x2974('0x8c')]({'where':{'id':_0x2d2456[_0x2974('0x53')]['id']}})[_0x2974('0x1d')](handleEntityNotFound(_0x1797c0,null))[_0x2974('0x1d')](function(_0x81469b){if(_0x81469b){_0x16e7d8=_0x81469b;_0x337474[_0x2974('0xc9')]=_['keys'](db[_0x2974('0x108')]['rawAttributes']);_0x337474[_0x2974('0x3a')]=_[_0x2974('0xca')](_0x2d2456['query']);_0x337474['filters']=_['intersection'](_0x337474['model'],_0x337474[_0x2974('0x3a')]);_0x15a607[_0x2974('0x40')]=_[_0x2974('0xce')](_0x337474[_0x2974('0xc9')],qs[_0x2974('0xcf')](_0x2d2456[_0x2974('0x3a')]['fields']));_0x15a607[_0x2974('0x40')]=_0x15a607[_0x2974('0x40')][_0x2974('0x45')]?_0x15a607[_0x2974('0x40')]:_0x337474[_0x2974('0xc9')];_0x15a607[_0x2974('0xd0')]=qs['sort'](_0x2d2456['query']['sort']);_0x15a607['where']=qs[_0x2974('0xcd')](_[_0x2974('0xd6')](_0x2d2456['query'],_0x337474['filters']));if(_0x2d2456[_0x2974('0x3a')][_0x2974('0x26')]){_0x15a607['where']=_[_0x2974('0xd2')](_0x15a607[_0x2974('0x39')],{'$or':_[_0x2974('0x2f')](_0x15a607['attributes'],function(_0x3e5dc2){var _0x46a70e={};_0x46a70e[_0x3e5dc2]={'$like':'%'+_0x2d2456['query'][_0x2974('0x26')]+'%'};return _0x46a70e;})});}_0x15a607=_['merge']({},_0x15a607,_0x2d2456[_0x2974('0x4c')]);return _0x16e7d8[_0x2974('0x107')](_0x15a607);}})[_0x2974('0x1d')](function(_0x4d3dfd){if(_0x4d3dfd){_0x5a2596=_0x4d3dfd[_0x2974('0x45')];if(!_0x2d2456[_0x2974('0x3a')][_0x2974('0xc1')](_0x2974('0xd4'))){_0x15a607[_0x2974('0x19')]=qs[_0x2974('0x19')](_0x2d2456[_0x2974('0x3a')][_0x2974('0x19')]);_0x15a607[_0x2974('0x17')]=qs[_0x2974('0x17')](_0x2d2456[_0x2974('0x3a')][_0x2974('0x17')]);}return _0x16e7d8[_0x2974('0x107')](_0x15a607);}})[_0x2974('0x1d')](function(_0x4a5727){if(_0x4a5727){return _0x4a5727?{'count':_0x5a2596,'rows':_0x4a5727}:null;}})[_0x2974('0x1d')](respondWithResult(_0x1797c0,null))['catch'](handleError(_0x1797c0,null));};exports[_0x2974('0x109')]=function(_0x571c30,_0x2ac9f5){var _0x4f31da=_0x571c30[_0x2974('0x53')]['id'];var _0x10fc34=_0x571c30[_0x2974('0x51')]?_0x571c30[_0x2974('0x51')][_0x2974('0x55')]:null;var _0x42236c=[];return Promise[_0x2974('0x10a')]()[_0x2974('0x1d')](function(){if(!_0x10fc34)throw new APIBadRequestError(_0x2974('0x10b'));})[_0x2974('0x1d')](function(){return db[_0x2974('0x42')][_0x2974('0x8c')]({'where':{'id':_0x4f31da}});})['then'](function(_0x43df99){if(!_0x43df99)throw new APINotFoundError(util['format'](_0x2974('0xbf'),_0x571c30[_0x2974('0x53')]['id']));return db[_0x2974('0x5d')][_0x2974('0x10c')](function(_0x1ac4f6){return _0x43df99[_0x2974('0x109')](_0x10fc34,{'transaction':_0x1ac4f6})[_0x2974('0x1d')](function(){return db[_0x2974('0x108')]['findAll']({'where':{'id':{'$in':_0x10fc34}}});})[_0x2974('0x1d')](function(_0x1c4a63){var _0x541316=_['map'](_0x1c4a63,function(_0x1c6533){return _0x1c6533['getAssociatedQueues']();});return Promise[_0x2974('0x49')](_0x541316);})['then'](function(_0x141868){_0x42236c=_[_0x2974('0x10d')](_0x141868);var _0x2b80df=_[_0x2974('0x2f')](_0x42236c,function(_0x40c499){return _0x40c499['addAgent'](_0x43df99['id'],{'transaction':_0x1ac4f6});});return Promise[_0x2974('0x49')](_0x2b80df);})[_0x2974('0x1d')](function(){if(!_0x43df99[_0x2974('0x93')])return;var _0x3019e0=_[_0x2974('0x26')](_0x42236c,function(_0x4bc2ac){return _0x4bc2ac[_0x2974('0x10e')](_0x2974('0x92'))===_0x2974('0x10f');});var _0x3e38eb=_[_0x2974('0x2f')](_0x3019e0,function(_0xdbd9a7){return db[_0x2974('0xa9')][_0x2974('0xf3')]({'membername':_0x43df99[_0x2974('0x2a')],'UserId':_0x43df99['id'],'queue_name':_0xdbd9a7[_0x2974('0x2a')],'VoiceQueueId':_0xdbd9a7['id'],'interface':_[_0x2974('0x5b')](_0x43df99[_0x2974('0x96')])?util['format'](_0x2974('0xa5'),_0x43df99['name']):_0x43df99['interface'],'paused':_0x43df99['voicePause']||![],'penalty':_0x43df99[_0x2974('0x9c')]},{'transaction':_0x1ac4f6});});return Promise[_0x2974('0x49')](_0x3e38eb);})['then'](function(){return db[_0x2974('0x110')][_0x2974('0xc8')]({'where':{'teamId':{'$in':_0x10fc34}}});})['then'](function(_0x30b3e0){var _0x575d33=_[_0x2974('0x2f')](_0x30b3e0,function(_0x532b81){return db[_0x2974('0x111')][_0x2974('0x72')]({'UserId':_0x43df99['id'],'VoicePrefixId':_0x532b81[_0x2974('0x112')]},{'transaction':_0x1ac4f6});});return Promise['all'](_0x575d33);});});})[_0x2974('0x1d')](function(){for(var _0x2eeec8=0x0;_0x2eeec8<_0x42236c[_0x2974('0x45')];_0x2eeec8++){var _0x326817=_0x42236c[_0x2eeec8]['getDataValue']('channel');var _0x25c6e3=_0x326817+'QueueId';socket[_0x2974('0x20')](_0x2974('0x73')+_0x326817+_0x2974('0xa0'),{'UserId':_0x4f31da,['queueField']:_0x42236c[_0x2eeec8]['id']});}})[_0x2974('0x1d')](respondWithStatusCode(_0x2ac9f5,null))[_0x2974('0x4a')](APIHandleError(_0x2ac9f5));};exports[_0x2974('0x113')]=function(_0x445a5c,_0x219db4){var _0x51fb66=_0x445a5c[_0x2974('0x53')]['id'];var _0x24b237=null;if(_0x445a5c[_0x2974('0x3a')][_0x2974('0x55')]){_0x24b237=_[_0x2974('0x114')](_0x445a5c[_0x2974('0x3a')][_0x2974('0x55')])?_0x445a5c['query'][_0x2974('0x55')]:[_0x445a5c[_0x2974('0x3a')][_0x2974('0x55')]];}var _0x111c8a=[];return Promise[_0x2974('0x10a')]()[_0x2974('0x1d')](function(){if(!_0x24b237)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x2974('0x1d')](function(){return db[_0x2974('0x42')][_0x2974('0x8c')]({'where':{'id':_0x51fb66}});})[_0x2974('0x1d')](function(_0x4b10b0){if(!_0x4b10b0)throw new APINotFoundError(util[_0x2974('0xa4')](_0x2974('0xbf'),_0x445a5c[_0x2974('0x53')]['id']));return db['sequelize'][_0x2974('0x10c')](function(_0x14237d){return _0x4b10b0[_0x2974('0x113')](_0x24b237,{'transaction':_0x14237d})[_0x2974('0x1d')](function(){return db[_0x2974('0x108')][_0x2974('0xc8')]({'where':{'id':{'$in':_0x24b237}}});})[_0x2974('0x1d')](function(_0x282628){var _0x50e910=_[_0x2974('0x2f')](_0x282628,function(_0x326b7e){return _0x326b7e['getAssociatedQueues']();});return Promise[_0x2974('0x49')](_0x50e910);})[_0x2974('0x1d')](function(_0x1a3fb7){_0x111c8a=_[_0x2974('0x10d')](_0x1a3fb7);var _0x5d630b=_[_0x2974('0x2f')](_0x111c8a,function(_0x1caa73){return _0x1caa73[_0x2974('0x115')](_0x4b10b0['id'],{'transaction':_0x14237d});});return Promise['all'](_0x5d630b);})[_0x2974('0x1d')](function(){if(!_0x4b10b0['online'])return;var _0x31f1f1=_[_0x2974('0x26')](_0x111c8a,function(_0x481cab){return _0x481cab[_0x2974('0x10e')](_0x2974('0x92'))===_0x2974('0x10f');});var _0x1a5a3a=_[_0x2974('0x2f')](_0x31f1f1,function(_0x34dab6){return db[_0x2974('0xa9')][_0x2974('0x22')]({'where':{'VoiceQueueId':_0x34dab6['id'],'UserId':_0x4b10b0['id']},'transaction':_0x14237d});});return Promise['all'](_0x1a5a3a);})[_0x2974('0x1d')](function(){return db[_0x2974('0x110')]['findAll']({'where':{'teamId':{'$in':_0x24b237}}});})['then'](function(_0x34a734){var _0x11b807=_['map'](_0x34a734,function(_0x2ecf88){return db[_0x2974('0x111')][_0x2974('0x22')]({'where':{'UserId':_0x4b10b0['id'],'VoicePrefixId':_0x2ecf88['VoicePrefixId']}},{'transaction':_0x14237d});});return Promise['all'](_0x11b807);});});})[_0x2974('0x1d')](function(){for(var _0x58a07d=0x0;_0x58a07d<_0x111c8a['length'];_0x58a07d++){var _0x327bbd=_0x111c8a[_0x58a07d][_0x2974('0x10e')]('channel');var _0x238c79=_0x327bbd+_0x2974('0x9f');socket[_0x2974('0x20')](_0x2974('0x73')+_0x327bbd+_0x2974('0xa8'),{'UserId':_0x51fb66,['queueField']:_0x111c8a[_0x58a07d]['id']});}})['then'](respondWithStatusCode(_0x219db4,null))[_0x2974('0x4a')](APIHandleError(_0x219db4));};exports[_0x2974('0x116')]=function(_0x247e09,_0x2dacfb){var _0x5350e6={};var _0x47f425={};var _0x4a646c;var _0x967363;return db[_0x2974('0x42')][_0x2974('0x8c')]({'where':{'id':_0x247e09[_0x2974('0x53')]['id']}})[_0x2974('0x1d')](handleEntityNotFound(_0x2dacfb,null))[_0x2974('0x1d')](function(_0x418495){if(_0x418495){_0x4a646c=_0x418495;_0x47f425[_0x2974('0xc9')]=_[_0x2974('0xca')](db['CmList']['rawAttributes']);_0x47f425[_0x2974('0x3a')]=_[_0x2974('0xca')](_0x247e09['query']);_0x47f425['filters']=_[_0x2974('0xce')](_0x47f425['model'],_0x47f425['query']);_0x5350e6[_0x2974('0x40')]=_[_0x2974('0xce')](_0x47f425[_0x2974('0xc9')],qs[_0x2974('0xcf')](_0x247e09[_0x2974('0x3a')]['fields']));_0x5350e6['attributes']=_0x5350e6['attributes']['length']?_0x5350e6[_0x2974('0x40')]:_0x47f425[_0x2974('0xc9')];_0x5350e6[_0x2974('0xd0')]=qs['sort'](_0x247e09['query']['sort']);_0x5350e6['where']=qs[_0x2974('0xcd')](_[_0x2974('0xd6')](_0x247e09[_0x2974('0x3a')],_0x47f425[_0x2974('0xcd')]));if(_0x247e09[_0x2974('0x3a')][_0x2974('0x26')]){_0x5350e6[_0x2974('0x39')]=_[_0x2974('0xd2')](_0x5350e6[_0x2974('0x39')],{'$or':_[_0x2974('0x2f')](_0x5350e6[_0x2974('0x40')],function(_0x23d712){var _0x3de148={};_0x3de148[_0x23d712]={'$like':'%'+_0x247e09['query'][_0x2974('0x26')]+'%'};return _0x3de148;})});}_0x5350e6=_['merge']({},_0x5350e6,_0x247e09[_0x2974('0x4c')]);return _0x4a646c[_0x2974('0x116')](_0x5350e6);}})[_0x2974('0x1d')](function(_0x34adfe){if(_0x34adfe){_0x967363=_0x34adfe[_0x2974('0x45')];if(!_0x247e09[_0x2974('0x3a')]['hasOwnProperty'](_0x2974('0xd4'))){_0x5350e6['limit']=qs[_0x2974('0x19')](_0x247e09[_0x2974('0x3a')][_0x2974('0x19')]);_0x5350e6[_0x2974('0x17')]=qs[_0x2974('0x17')](_0x247e09[_0x2974('0x3a')][_0x2974('0x17')]);}return _0x4a646c[_0x2974('0x116')](_0x5350e6);}})[_0x2974('0x1d')](function(_0x2f9787){if(_0x2f9787){return _0x2f9787?{'count':_0x967363,'rows':_0x2f9787}:null;}})[_0x2974('0x1d')](respondWithResult(_0x2dacfb,null))[_0x2974('0x4a')](handleError(_0x2dacfb,null));};exports[_0x2974('0x117')]=function(_0x400253,_0x1cc859){var _0x21cc73={};var _0x49dc5b={};var _0x239230;return db['User'][_0x2974('0x8c')]({'where':{'id':_0x400253[_0x2974('0x53')]['id']}})[_0x2974('0x1d')](handleEntityNotFound(_0x1cc859,null))[_0x2974('0x1d')](function(_0x3e7900){if(_0x3e7900){_0x239230=_0x3e7900;_0x49dc5b[_0x2974('0xc9')]=_[_0x2974('0xca')](db[_0x2974('0x42')][_0x2974('0xcc')]);_0x49dc5b[_0x2974('0x3a')]=_[_0x2974('0xca')](_0x400253[_0x2974('0x3a')]);_0x49dc5b[_0x2974('0xcd')]=_[_0x2974('0xce')](_0x49dc5b[_0x2974('0xc9')],_0x49dc5b['query']);_0x21cc73[_0x2974('0x40')]=_['intersection'](_0x49dc5b[_0x2974('0xc9')],qs[_0x2974('0xcf')](_0x400253['query']['fields']));_0x21cc73[_0x2974('0x40')]=_0x21cc73[_0x2974('0x40')][_0x2974('0x45')]?_0x21cc73['attributes']:_0x49dc5b[_0x2974('0xc9')];_0x21cc73[_0x2974('0xd0')]=qs[_0x2974('0xd1')](_0x400253['query']['sort']);_0x21cc73[_0x2974('0x39')]=qs['filters'](_['pick'](_0x400253[_0x2974('0x3a')],_0x49dc5b[_0x2974('0xcd')]));if(_0x400253[_0x2974('0x3a')]['filter']){_0x21cc73[_0x2974('0x39')]=_[_0x2974('0xd2')](_0x21cc73[_0x2974('0x39')],{'$or':_[_0x2974('0x2f')](_0x21cc73['attributes'],function(_0x31f6bc){var _0x56b548={};_0x56b548[_0x31f6bc]={'$like':'%'+_0x400253[_0x2974('0x3a')]['filter']+'%'};return _0x56b548;})});}_0x21cc73[_0x2974('0xc9')]=db[_0x2974('0x42')];_0x21cc73['as']='Agents';_0x21cc73=_[_0x2974('0xd2')]({},_0x21cc73,_0x400253[_0x2974('0x4c')]);return _0x239230[_0x2974('0xf2')]({'include':[_0x21cc73]});}})['then'](function(_0x2520f8){if(_0x2520f8){var _0x2f61df={},_0x2b77a4=[];for(var _0x5ea7ce=0x0;_0x5ea7ce<_0x2520f8[_0x2974('0x45')];_0x5ea7ce+=0x1){for(var _0x5653cd=0x0,_0x44b8a3;_0x5653cd<_0x2520f8[_0x5ea7ce][_0x2974('0x23')]['length'];_0x5653cd+=0x1){_0x44b8a3=_0x2520f8[_0x5ea7ce]['Agents'][_0x5653cd][_0x2974('0xa3')]({'plain':!![]});_0x2f61df[_0x44b8a3['id']]=_0x44b8a3;}}_0x2f61df=_[_0x2974('0x118')](_0x2f61df);for(var _0x486193=qs[_0x2974('0x17')](_0x400253[_0x2974('0x3a')][_0x2974('0x17')]);_0x486193<_0x2f61df[_0x2974('0x45')]&&_0x2b77a4[_0x2974('0x45')]=_0x2cb575){_0x31e238=_0x2cb575;_0x4fe04e=0xc8;}else{_0x4fe04e=0xce;}_0x5eb479['status'](_0x4fe04e);return _0x5eb479[_0xa2ff('0x1a')]('Content-Range',_0x48c7e5+'-'+_0x31e238+'/'+_0x2cb575)['json'](_0x143f98);}return null;};}function saveUpdates(_0x66f6e7){return function(_0x5e382f){if(_0x5e382f){return _0x5e382f[_0xa2ff('0x1b')](_0x66f6e7)[_0xa2ff('0x1c')](function(_0x5a9d95){if(_0x5a9d95[_0xa2ff('0x1d')]===_0xa2ff('0x1e')){socket['emit'](_0xa2ff('0x1f')+_0x5a9d95['id'],_0x5a9d95);}return _0x5a9d95;});}return null;};}function removeEntity(_0x547046){return function(_0x522ed7){if(_0x522ed7){return _0x522ed7[_0xa2ff('0x20')]()[_0xa2ff('0x1c')](function(){var _0x8352a4=_0x522ed7[_0xa2ff('0x21')]({'plain':!![]});if(_0x8352a4[_0xa2ff('0x1d')]==='admin')return;var _0x2eb195=[{'name':_0xa2ff('0x22'),'value':'user','ignore':!![]},{'name':_0xa2ff('0x23'),'value':'agent','ignore':![]},{'name':_0xa2ff('0x24'),'value':_0xa2ff('0x25'),'ignore':![]}];var _0x1797c4=_(_0x2eb195)[_0xa2ff('0x26')](_0xa2ff('0x27'))[_0xa2ff('0x28')]('value')['value']();if(_[_0xa2ff('0x29')](_0x1797c4,_0x8352a4[_0xa2ff('0x1d')])){return;}var _0x4b8899=_[_0xa2ff('0x2a')](_0x2eb195,[_0xa2ff('0x2b'),_0x8352a4[_0xa2ff('0x1d')]])['name'];return db[_0xa2ff('0x2c')][_0xa2ff('0x20')]({'where':{'type':_0x4b8899,'resourceId':_0x8352a4['id']}})[_0xa2ff('0x1c')](function(){return _0x522ed7;});})[_0xa2ff('0x1c')](function(){_0x547046[_0xa2ff('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59d76c){return function(_0x3959f){if(!_0x3959f){_0x59d76c[_0xa2ff('0x12')](0x194);}return _0x3959f;};}function handleError(_0x18ea56,_0x42113a){_0x42113a=_0x42113a||0x1f4;return function(_0xf30c29){logger[_0xa2ff('0x2d')](_0xf30c29[_0xa2ff('0x2e')]);if(_0xf30c29[_0xa2ff('0x2f')]){delete _0xf30c29[_0xa2ff('0x2f')];}_0x18ea56[_0xa2ff('0x13')](_0x42113a)[_0xa2ff('0x30')](_0xf30c29);};}function getUserAttributes(){return _(db[_0xa2ff('0x31')][_0xa2ff('0x32')])[_0xa2ff('0x28')](function(_0x554222){return{'name':_0x554222[_0xa2ff('0x33')],'type':_0x554222['type']['key']};})[_0xa2ff('0x26')](function(_0x4aaff9){return![_0xa2ff('0x34'),_0xa2ff('0x35'),_0xa2ff('0x36'),_0xa2ff('0x37'),_0xa2ff('0x38'),_0xa2ff('0x39')]['includes'](_0x4aaff9[_0xa2ff('0x2f')]);})['value']();}exports[_0xa2ff('0x3a')]=function(_0x5d3408,_0x39688d){var _0x585a0b={},_0x476a3d={'count':0x0,'rows':[]};var _0x464a98=getUserAttributes();_0x585a0b=qs['getOptions'](_0x464a98,_0x5d3408);var _0x385e1c={'where':_0x585a0b['where']};return db['User'][_0xa2ff('0x18')](_0x385e1c)[_0xa2ff('0x1c')](function(_0x3e1ef7){_0x476a3d[_0xa2ff('0x18')]=_0x3e1ef7;if(_0x5d3408[_0xa2ff('0x3b')]['includeAll']){_0x585a0b['include']=[{'all':!![]}];}if(_0x5d3408[_0xa2ff('0x3b')][_0xa2ff('0x3c')]===_0xa2ff('0x3d')){_0x585a0b[_0xa2ff('0x3e')]=[{'model':db['UserSetting'],'as':'userSetting'}];}if(!_[_0xa2ff('0x29')](_0x585a0b[_0xa2ff('0x3f')],'id')){_0x585a0b[_0xa2ff('0x3f')]['push']('id');}return db[_0xa2ff('0x31')]['findAll'](_0x585a0b);})[_0xa2ff('0x1c')](function(_0x1be9e0){_0x476a3d[_0xa2ff('0x40')]=_0x1be9e0;if(_0x5d3408[_0xa2ff('0x3b')]['openTabs']===_0xa2ff('0x3d')){var _0x10e97c=[];for(var _0xd1bb08=0x0;_0xd1bb08<_0x476a3d['rows'][_0xa2ff('0x41')];_0xd1bb08++){_0x10e97c[_0xa2ff('0x42')](get_open_tabs(_0xa2ff('0x43'),_0x476a3d[_0xa2ff('0x40')][_0xd1bb08][_0xa2ff('0x44')]));_0x10e97c[_0xa2ff('0x42')](get_open_tabs('sms',_0x476a3d[_0xa2ff('0x40')][_0xd1bb08][_0xa2ff('0x44')]));_0x10e97c[_0xa2ff('0x42')](get_open_tabs(_0xa2ff('0x45'),_0x476a3d[_0xa2ff('0x40')][_0xd1bb08][_0xa2ff('0x44')]));_0x10e97c['push'](get_open_tabs('mail',_0x476a3d[_0xa2ff('0x40')][_0xd1bb08]['dataValues']));_0x10e97c[_0xa2ff('0x42')](get_open_tabs('openchannel',_0x476a3d['rows'][_0xd1bb08][_0xa2ff('0x44')]));_0x10e97c[_0xa2ff('0x42')](get_open_tabs(_0xa2ff('0x46'),_0x476a3d[_0xa2ff('0x40')][_0xd1bb08][_0xa2ff('0x44')]));}return Promise[_0xa2ff('0x47')](_0x10e97c)[_0xa2ff('0x1c')](function(){return _0x476a3d;});}else{return _0x476a3d;}})[_0xa2ff('0x1c')](respondWithFilteredResult(_0x39688d,_0x585a0b))['catch'](handleError(_0x39688d,null));};exports[_0xa2ff('0x48')]=function(_0x11b69b,_0x389cf6){var _0x19cd3b=getUserAttributes();_0x11b69b[_0xa2ff('0x3b')]['id']=_0x11b69b[_0xa2ff('0x49')]['id'];var _0x6623a7=qs[_0xa2ff('0x4a')](_0x19cd3b,_0x11b69b);if(_0x11b69b[_0xa2ff('0x3b')][_0xa2ff('0x4b')]){_0x6623a7['include']=[{'all':!![]}];}if(_0x11b69b['query']['userSetting']==='true'){_0x6623a7[_0xa2ff('0x3e')]=[{'model':db[_0xa2ff('0x4c')],'as':_0xa2ff('0x3c')}];}_0x6623a7=_['merge']({},_0x6623a7,_0x11b69b[_0xa2ff('0x4d')]);if(!_[_0xa2ff('0x29')](_0x6623a7[_0xa2ff('0x3f')],'id')){_0x6623a7[_0xa2ff('0x3f')][_0xa2ff('0x42')]('id');}return db[_0xa2ff('0x31')][_0xa2ff('0x2a')](_0x6623a7)[_0xa2ff('0x1c')](handleEntityNotFound(_0x389cf6,null))[_0xa2ff('0x1c')](function(_0x4912c3){var _0x103a80=[];values=_0x4912c3;if(_0x11b69b[_0xa2ff('0x3b')]['openTabs']===_0xa2ff('0x3d')){_0x103a80[_0xa2ff('0x42')](get_open_tabs('chat',_0x4912c3[_0xa2ff('0x44')]));_0x103a80[_0xa2ff('0x42')](get_open_tabs('sms',_0x4912c3[_0xa2ff('0x44')]));_0x103a80[_0xa2ff('0x42')](get_open_tabs(_0xa2ff('0x4e'),_0x4912c3['dataValues']));_0x103a80[_0xa2ff('0x42')](get_open_tabs(_0xa2ff('0x46'),_0x4912c3['dataValues']));_0x103a80[_0xa2ff('0x42')](get_open_tabs(_0xa2ff('0x45'),_0x4912c3['dataValues']));_0x103a80[_0xa2ff('0x42')](get_open_tabs(_0xa2ff('0x4f'),_0x4912c3['dataValues']));return Promise[_0xa2ff('0x47')](_0x103a80);}else{return values;}})['then'](function(){return values;})[_0xa2ff('0x1c')](respondWithResult(_0x389cf6,null))['catch'](handleError(_0x389cf6,null));};exports['update']=function(_0x452a37,_0x1f85f2){if(_0x452a37[_0xa2ff('0x50')]['id']){delete _0x452a37[_0xa2ff('0x50')]['id'];}delete _0x452a37['body'][_0xa2ff('0x1d')];return db[_0xa2ff('0x31')]['find']({'where':{'id':_0x452a37[_0xa2ff('0x49')]['id']}})[_0xa2ff('0x1c')](handleEntityNotFound(_0x1f85f2,null))[_0xa2ff('0x1c')](saveUpdates(_0x452a37[_0xa2ff('0x50')],null))['then'](respondWithResult(_0x1f85f2,null))[_0xa2ff('0x51')](handleError(_0x1f85f2,null));};exports[_0xa2ff('0x52')]=function(_0x1cc6d0,_0xff32db){return db['User']['describe']()[_0xa2ff('0x1c')](respondWithResult(_0xff32db,null))['catch'](handleError(_0xff32db,null));};exports[_0xa2ff('0x53')]=function(_0x616701,_0x4dd018){return db['User'][_0xa2ff('0x2a')]({'where':{'id':_0x616701['params']['id']}})[_0xa2ff('0x1c')](handleEntityNotFound(_0x4dd018,null))[_0xa2ff('0x1c')](function(_0x2eeb11){if(_0x2eeb11){return _0x2eeb11[_0xa2ff('0x53')](_0x616701[_0xa2ff('0x50')]['ids'],_[_0xa2ff('0x54')](_0x616701['body'],[_0xa2ff('0x55'),'id'])||{});}})['then'](respondWithResult(_0x4dd018,null))[_0xa2ff('0x51')](handleError(_0x4dd018,null));};function validateUser(_0x25ca8d){return new Promise(function(_0x148caa,_0x930f2c){if(_0x25ca8d['internal'])return _0x148caa(_0x25ca8d);return db[_0xa2ff('0x56')][_0xa2ff('0x57')](0x1)['then'](function(_0x172e9a){if(_0x172e9a['securePassword'])authService[_0xa2ff('0x58')](_0x25ca8d['password']);db[_0xa2ff('0x31')]['max'](_0xa2ff('0x59'))[_0xa2ff('0x1c')](function(_0x41e3e4){if(_[_0xa2ff('0x5a')](_0x41e3e4)){_0x25ca8d[_0xa2ff('0x59')]=_0x172e9a[_0xa2ff('0x5b')]||0x1;return;}if(_[_0xa2ff('0x5a')](_0x172e9a[_0xa2ff('0x5b')])||_0x172e9a['min_internal']===_0x41e3e4){_0x25ca8d[_0xa2ff('0x59')]=_0x41e3e4+0x1;return;}if(_0x172e9a[_0xa2ff('0x5b')]>_0x41e3e4){_0x25ca8d[_0xa2ff('0x59')]=_0x172e9a[_0xa2ff('0x5b')];return;}return db[_0xa2ff('0x5c')][_0xa2ff('0x3b')](_0xa2ff('0x5d'),{'type':db['sequelize'][_0xa2ff('0x5e')]['SELECT']})[_0xa2ff('0x1c')](function(_0x378223){if(_0x378223&&_0x378223['length']){for(var _0x190c84=0x0,_0x5aa015=_0x378223['length'];_0x190c84<_0x5aa015&&_[_0xa2ff('0x5a')](_0x25ca8d[_0xa2ff('0x59')]);_0x190c84++){if(_0x172e9a[_0xa2ff('0x5b')]<=_0x378223[_0x190c84][_0xa2ff('0x5f')]){_0x25ca8d[_0xa2ff('0x59')]=_0x378223[_0x190c84]['from'];}else if(_0x172e9a['min_internal']>_0x378223[_0x190c84][_0xa2ff('0x5f')]&&_0x172e9a[_0xa2ff('0x5b')]<=_0x378223[_0x190c84]['to']){_0x25ca8d[_0xa2ff('0x59')]=_0x172e9a[_0xa2ff('0x5b')];}}}if(_[_0xa2ff('0x5a')](_0x25ca8d[_0xa2ff('0x59')])){_0x25ca8d[_0xa2ff('0x59')]=_0x41e3e4+0x1;}return _0x148caa(_0x25ca8d);});});})[_0xa2ff('0x51')](function(_0x4dbbb4){_0x930f2c(_0x4dbbb4);});});}function updateUser(_0x2fe0ae){return new Promise(function(_0x233ef2,_0x20076d){try{if(_0x2fe0ae[_0xa2ff('0x60')]){_0x2fe0ae['mailbox']=_0x2fe0ae[_0xa2ff('0x59')];_0x2fe0ae['VoiceMail']={'mailbox':_0x2fe0ae['internal'],'password':_0x2fe0ae[_0xa2ff('0x34')],'fullname':_0x2fe0ae[_0xa2ff('0x61')],'email':_0x2fe0ae['email']};}if(_0x2fe0ae[_0xa2ff('0x1d')]==='agent'){if(!_0x2fe0ae[_0xa2ff('0x62')])_0x2fe0ae[_0xa2ff('0x62')]=[_0xa2ff('0x63'),'102',_0xa2ff('0x64'),_0xa2ff('0x65'),_0xa2ff('0x66'),_0xa2ff('0x67'),_0xa2ff('0x68'),_0xa2ff('0x69'),_0xa2ff('0x6a'),_0xa2ff('0x6b'),_0xa2ff('0x6c'),'100',_0xa2ff('0x6d'),_0xa2ff('0x6e'),_0xa2ff('0x6f')];}_0x233ef2(_0x2fe0ae);}catch(_0x54a87b){_0x20076d(_0x54a87b);}});}exports['create']=function(_0x8086fe,_0x3e2bc9){if(_0x8086fe[_0xa2ff('0x70')]['role']==='agent')throw new Error('Unauthorized');if(_0x8086fe[_0xa2ff('0x50')]['role']===_0xa2ff('0x70')&&_0x8086fe[_0xa2ff('0x70')]['role']!==_0xa2ff('0x71')){throw new Error(_0xa2ff('0x72'));}if(_0x8086fe[_0xa2ff('0x50')][_0xa2ff('0x1d')]==='admin'&&_0x8086fe['user'][_0xa2ff('0x1d')]!==_0xa2ff('0x71')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x8086fe[_0xa2ff('0x50')]])['then'](function(){return validateUser(_0x8086fe['body']);})[_0xa2ff('0x1c')](function(_0x46e80d){return updateUser(_0x46e80d)['then'](function(_0x375647){if(_0x375647[_0xa2ff('0x1d')]===_0xa2ff('0x71')){_0x375647[_0xa2ff('0x73')]=_0x8086fe[_0xa2ff('0x70')][_0xa2ff('0x73')];delete _0x375647[_0xa2ff('0x74')];}return _0x375647;});})[_0xa2ff('0x1c')](function(_0x3d7b90){return db['User']['create'](_0x3d7b90,{'include':[{'model':db[_0xa2ff('0x75')],'as':_0xa2ff('0x75')}]});})['then'](function(_0x564ec8){if(_0x8086fe[_0xa2ff('0x50')][_0xa2ff('0x1d')]===_0xa2ff('0x70'))return _0x564ec8;if(_0x8086fe[_0xa2ff('0x70')]['role']!==_0xa2ff('0x70'))return _0x564ec8;return db['UserProfileSection'][_0xa2ff('0x2a')]({'where':{'name':_0x564ec8[_0xa2ff('0x1d')]===_0xa2ff('0x1e')?_0xa2ff('0x23'):_0xa2ff('0x24'),'userProfileId':_0x8086fe['user'][_0xa2ff('0x74')]},'raw':!![]})[_0xa2ff('0x1c')](function(_0x173a97){if(!_0x173a97||_0x173a97[_0xa2ff('0x76')]!=0x0)return _0x564ec8;return db[_0xa2ff('0x2c')]['create']({'name':_0x564ec8[_0xa2ff('0x2f')],'resourceId':_0x564ec8['id'],'type':_0x173a97[_0xa2ff('0x2f')],'sectionId':_0x173a97['id']},{})[_0xa2ff('0x1c')](function(){return _0x564ec8;});})[_0xa2ff('0x51')](function(_0x1ae687){logger['error'](_0xa2ff('0x77'),_0x1ae687);throw _0x1ae687;});})[_0xa2ff('0x1c')](respondWithResult(_0x3e2bc9,0xc9))[_0xa2ff('0x51')](handleError(_0x3e2bc9,null));};exports[_0xa2ff('0x78')]=function(_0x948bce,_0x5cb47e){var _0x44f9f5=_0x948bce['body'];var _0x26aed0=[];if(_0x948bce[_0xa2ff('0x70')][_0xa2ff('0x1d')]===_0xa2ff('0x1e'))throw new Error(_0xa2ff('0x79'));if(_['some'](_0x44f9f5,[_0xa2ff('0x1d'),_0xa2ff('0x70')])&&_0x948bce[_0xa2ff('0x70')][_0xa2ff('0x1d')]!==_0xa2ff('0x71')){throw new Error(_0xa2ff('0x72'));}if(_[_0xa2ff('0x7a')](_0x44f9f5,[_0xa2ff('0x1d'),'admin'])&&_0x948bce['user'][_0xa2ff('0x1d')]!==_0xa2ff('0x71')){throw new Error(_0xa2ff('0x7b'));}return licenseUtil['checkUserLimits'](_0x44f9f5)[_0xa2ff('0x1c')](function(){return validateUser(_0x44f9f5[0x0]);})[_0xa2ff('0x1c')](function(){for(var _0xb9f771=0x1;_0xb9f771<_0x44f9f5[_0xa2ff('0x41')];_0xb9f771++){var _0x23ffec=_0x44f9f5[_0xb9f771-0x1]['internal'];if(!_0x44f9f5[_0xb9f771][_0xa2ff('0x59')])_0x44f9f5[_0xb9f771][_0xa2ff('0x59')]=_0x23ffec+0x1;_0x26aed0[_0xa2ff('0x42')](validateUser(_0x44f9f5[_0xb9f771]));}return Promise[_0xa2ff('0x47')](_0x26aed0);})[_0xa2ff('0x1c')](function(){_0x26aed0=[];for(var _0x4ab55d=0x0;_0x4ab55d<_0x44f9f5[_0xa2ff('0x41')];_0x4ab55d++){_0x26aed0[_0xa2ff('0x42')](updateUser(_0x44f9f5[_0x4ab55d]));}return Promise[_0xa2ff('0x47')](_0x26aed0);})[_0xa2ff('0x1c')](function(){_0x26aed0=_0x44f9f5[_0xa2ff('0x28')](function(_0x33186f){return db[_0xa2ff('0x31')][_0xa2ff('0x7c')](_0x33186f,{'include':[{'model':db[_0xa2ff('0x75')],'as':_0xa2ff('0x75')}]})[_0xa2ff('0x1c')](function(_0x940a97){_0x33186f['id']=_0x940a97['id'];return _0x33186f;});});return Promise[_0xa2ff('0x47')](_0x26aed0);})[_0xa2ff('0x1c')](function(_0x1cd83b){if(_0x948bce[_0xa2ff('0x50')]['role']==='user')return _0x1cd83b;if(_0x948bce[_0xa2ff('0x70')]['role']!==_0xa2ff('0x70'))return _0x1cd83b;var _0x12ee47=_[_0xa2ff('0x7a')](_0x1cd83b,function(_0x134269){return _0x134269[_0xa2ff('0x1d')]===_0xa2ff('0x1e')||_0x134269['role']===_0xa2ff('0x25');});if(!_0x12ee47)return _0x1cd83b;return db[_0xa2ff('0x7d')][_0xa2ff('0x7e')]({'where':{'name':{'$or':[_0xa2ff('0x23'),_0xa2ff('0x24')]},'userProfileId':_0x948bce[_0xa2ff('0x70')][_0xa2ff('0x74')]},'raw':!![]})[_0xa2ff('0x1c')](function(_0x380925){if(_[_0xa2ff('0x7f')](_0x380925)||!_[_0xa2ff('0x7a')](_0x380925,[_0xa2ff('0x76'),0x0]))return _0x1cd83b;_0x26aed0=[];var _0x5495f3=_(_0x380925)[_0xa2ff('0x28')](function(_0x2f5e0e){if(_0x2f5e0e[_0xa2ff('0x76')]===0x1)return;return _0x2f5e0e[_0xa2ff('0x2f')]==='Agents'?'agent':_0xa2ff('0x25');})[_0xa2ff('0x80')]()['value']();for(var _0xce003=0x0;_0xce003<_0x1cd83b[_0xa2ff('0x41')];_0xce003++){if(!_[_0xa2ff('0x29')](_0x5495f3,_0x1cd83b[_0xce003][_0xa2ff('0x1d')]))return;var _0x2a3e7b=_0x1cd83b[_0xce003]['role']===_0xa2ff('0x1e')?_0xa2ff('0x23'):'Telephones';_0x26aed0['push'](db[_0xa2ff('0x2c')]['create']({'name':_0x1cd83b[_0xce003][_0xa2ff('0x2f')],'resourceId':_0x1cd83b[_0xce003]['id'],'type':_0x2a3e7b,'sectionId':_['find'](_0x380925,[_0xa2ff('0x2f'),_0x2a3e7b])['id']},{}));}return Promise[_0xa2ff('0x47')](_0x26aed0);});})[_0xa2ff('0x1c')](respondWithResult(_0x5cb47e,0xc9))[_0xa2ff('0x51')](handleError(_0x5cb47e,null));};exports[_0xa2ff('0x81')]=function(_0x3434cf,_0x25034b){if(_0x3434cf[_0xa2ff('0x50')]['id']){delete _0x3434cf[_0xa2ff('0x50')]['id'];}return db[_0xa2ff('0x31')]['find']({'where':{'id':_0x3434cf[_0xa2ff('0x49')]['id']}})[_0xa2ff('0x1c')](function(_0x1de773){if(!_0x1de773)return null;if(_0x1de773['id']===_0x3434cf['user']['id']){if(!_0x3434cf[_0xa2ff('0x50')]['oldPassword']||!_0x3434cf[_0xa2ff('0x50')][_0xa2ff('0x82')]){throw new db[(_0xa2ff('0x83'))][(_0xa2ff('0x84'))](_0xa2ff('0x85'));}if(!_0x1de773['authenticate'](_0x3434cf[_0xa2ff('0x50')]['oldPassword'])){throw new db[(_0xa2ff('0x83'))][(_0xa2ff('0x84'))](_0xa2ff('0x86'));}if(_0x3434cf['body'][_0xa2ff('0x87')]===_0x3434cf['body'][_0xa2ff('0x82')]){throw new db['Sequelize'][(_0xa2ff('0x84'))](_0xa2ff('0x88'));}}else if(_0x3434cf[_0xa2ff('0x70')][_0xa2ff('0x1d')]===_0xa2ff('0x71')){if(!_0x3434cf[_0xa2ff('0x50')]['newPassword']){throw new db[(_0xa2ff('0x83'))][(_0xa2ff('0x84'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x3434cf[_0xa2ff('0x70')][_0xa2ff('0x1d')]===_0xa2ff('0x70')){if(!_0x3434cf['body'][_0xa2ff('0x82')]){throw new db[(_0xa2ff('0x83'))][(_0xa2ff('0x84'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x1de773[_0xa2ff('0x1d')]!==_0xa2ff('0x1e')){throw new db[(_0xa2ff('0x83'))]['ValidationError'](_0xa2ff('0x79'));}}else{throw new db['Sequelize'][(_0xa2ff('0x84'))](_0xa2ff('0x79'));}return _0x1de773;})[_0xa2ff('0x1c')](handleEntityNotFound(_0x25034b,null))['then'](function(_0x126946){return db[_0xa2ff('0x56')][_0xa2ff('0x89')]({'attributes':['id',_0xa2ff('0x8a'),_0xa2ff('0x8b'),_0xa2ff('0x8c')]})[_0xa2ff('0x1c')](function(_0x2f2fc2){if(_0x2f2fc2[_0xa2ff('0x8a')])authService[_0xa2ff('0x58')](_0x3434cf[_0xa2ff('0x50')][_0xa2ff('0x82')]);if(!_0x2f2fc2[_0xa2ff('0x8b')]||!_0x126946[_0xa2ff('0x36')])return _0x126946;authService['validatePasswordHistory'](_0x3434cf[_0xa2ff('0x50')][_0xa2ff('0x82')],_0x126946[_0xa2ff('0x36')],_0x2f2fc2[_0xa2ff('0x8c')]);return _0x126946;})['then'](saveUpdates({'password':_0x3434cf[_0xa2ff('0x50')]['newPassword'],'passwordResetAt':_0x3434cf[_0xa2ff('0x70')]['id']==_0x3434cf[_0xa2ff('0x49')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x3434cf[_0xa2ff('0x50')]['newPassword'],_0x126946['previousPasswords'])},null));})['then'](respondWithResult(_0x25034b,null))[_0xa2ff('0x51')](handleError(_0x25034b,null));};exports[_0xa2ff('0x8d')]=function(_0x150451,_0x20c99d){var _0xef7114=_0x150451[_0xa2ff('0x50')][_0xa2ff('0x8e')];return db[_0xa2ff('0x31')][_0xa2ff('0x2a')]({'where':{'id':_0x150451[_0xa2ff('0x49')]['id']},'attributes':['id',_0xa2ff('0x2f'),'role',_0xa2ff('0x8f'),_0xa2ff('0x90'),_0xa2ff('0x91'),'interface']})[_0xa2ff('0x1c')](handleEntityNotFound(_0x20c99d,null))[_0xa2ff('0x1c')](function(_0x37b7ef){if(_0x37b7ef){if(!utils['isValidChannel'](_0xef7114)){throw new db[(_0xa2ff('0x83'))][(_0xa2ff('0x84'))](_0xa2ff('0x92'));}return _0x37b7ef[_0xa2ff('0x93')+_[_0xa2ff('0x94')](_0xef7114[_0xa2ff('0x95')]())+_0xa2ff('0x96')](_0x150451[_0xa2ff('0x50')]['ids'],{'penalty':_0x150451[_0xa2ff('0x50')][_0xa2ff('0x97')]||0x0})[_0xa2ff('0x98')](function(_0x4c4e65){for(var _0xa613bc=0x0;_0xa613bc<_0x150451[_0xa2ff('0x50')]['ids'][_0xa2ff('0x41')];_0xa613bc+=0x1){var _0x4277ad={'UserId':Number(_0x150451[_0xa2ff('0x49')]['id'])};_0x4277ad[_[_0xa2ff('0x94')](_0xef7114[_0xa2ff('0x95')]())+_0xa2ff('0x99')]=Number(_0x150451[_0xa2ff('0x50')][_0xa2ff('0x55')][_0xa613bc]);socket[_0xa2ff('0x9a')]('user'+_[_0xa2ff('0x94')](_0xef7114[_0xa2ff('0x95')]())+_0xa2ff('0x9b'),_0x4277ad);}return _0x4c4e65;})[_0xa2ff('0x1c')](function(){if(_0xef7114==='voice'){return db[_0xa2ff('0x9c')][_0xa2ff('0x7e')]({'where':{'id':_0x150451[_0xa2ff('0x50')][_0xa2ff('0x55')]||[]},'raw':!![],'attributes':['id',_0xa2ff('0x2f')]});}})[_0xa2ff('0x1c')](function(_0x2e341b){var _0x14f3b8=_0x37b7ef[_0xa2ff('0x21')]({'plain':!![]});var _0x3495d8=[];if(_0xef7114===_0xa2ff('0x9d')&&_0x14f3b8['role']==='agent'&&_0x14f3b8['online']){for(let _0x475a0a=0x0;_0x475a0a<_0x2e341b['length'];_0x475a0a+=0x1){_0x3495d8[_0xa2ff('0x42')]({'membername':_0x14f3b8['name'],'UserId':_0x14f3b8['id'],'queue_name':_0x2e341b[_0x475a0a][_0xa2ff('0x2f')],'VoiceQueueId':_0x2e341b[_0x475a0a]['id'],'interface':_[_0xa2ff('0x5a')](_0x14f3b8[_0xa2ff('0x9e')])?util[_0xa2ff('0x9f')]('SIP/%s',_0x14f3b8['name']):_0x14f3b8['interface'],'paused':_0x14f3b8[_0xa2ff('0x91')]||![],'penalty':_0x150451['body'][_0xa2ff('0x97')]||0x0});}return Promise[_0xa2ff('0x47')](_0x3495d8['map'](function(_0x24a4ed){return db['UserVoiceQueueRt'][_0xa2ff('0xa0')](_0x24a4ed);}));}return _0x37b7ef;});}})['then'](respondWithStatusCode(_0x20c99d,null))['catch'](handleError(_0x20c99d,null));};exports['removeQueues']=function(_0x31d75e,_0x55818c){var _0x20bf43,_0x48cd86;return db['User'][_0xa2ff('0x2a')]({'where':{'id':_0x31d75e[_0xa2ff('0x49')]['id']},'attributes':['id',_0xa2ff('0x2f'),'role']})[_0xa2ff('0x1c')](handleEntityNotFound(_0x55818c,null))[_0xa2ff('0x1c')](function(_0x1d2fa3){if(_0x1d2fa3){_0x20bf43=_0x1d2fa3;if(!_0x31d75e[_0xa2ff('0x3b')][_0xa2ff('0x8e')]||!utils[_0xa2ff('0xa1')](_0x31d75e[_0xa2ff('0x3b')]['channel'])){throw new db['Sequelize'][(_0xa2ff('0x84'))](_0xa2ff('0x92'));}return _0x1d2fa3[_0xa2ff('0xa2')+_[_0xa2ff('0x94')](_0x31d75e[_0xa2ff('0x3b')][_0xa2ff('0x8e')]['toLowerCase']())+_0xa2ff('0x96')](_0x31d75e['query'][_0xa2ff('0x55')]);}})[_0xa2ff('0x1c')](function(_0x30485d){if(_['isArray'](_0x31d75e['query'][_0xa2ff('0x55')])){for(var _0x5bd140=0x0;_0x5bd140<_0x31d75e[_0xa2ff('0x3b')][_0xa2ff('0x55')][_0xa2ff('0x41')];_0x5bd140+=0x1){_0x48cd86={'UserId':Number(_0x31d75e[_0xa2ff('0x49')]['id'])};_0x48cd86[_[_0xa2ff('0x94')](_0x31d75e[_0xa2ff('0x3b')][_0xa2ff('0x8e')][_0xa2ff('0x95')]())+_0xa2ff('0x99')]=Number(_0x31d75e[_0xa2ff('0x3b')][_0xa2ff('0x55')][_0x5bd140]);socket['emit'](_0xa2ff('0x70')+_[_0xa2ff('0x94')](_0x31d75e[_0xa2ff('0x3b')][_0xa2ff('0x8e')]['toLowerCase']())+'Queue:remove',_0x48cd86);}}else{_0x48cd86={'UserId':Number(_0x31d75e[_0xa2ff('0x49')]['id'])};_0x48cd86[_['capitalize'](_0x31d75e[_0xa2ff('0x3b')][_0xa2ff('0x8e')]['toLowerCase']())+_0xa2ff('0x99')]=Number(_0x31d75e['query'][_0xa2ff('0x55')]);socket[_0xa2ff('0x9a')](_0xa2ff('0x70')+_[_0xa2ff('0x94')](_0x31d75e[_0xa2ff('0x3b')][_0xa2ff('0x8e')][_0xa2ff('0x95')]())+_0xa2ff('0xa3'),_0x48cd86);}return _0x30485d;})[_0xa2ff('0x1c')](function(){if(_0x31d75e[_0xa2ff('0x3b')][_0xa2ff('0x8e')]==='voice'){return db[_0xa2ff('0xa4')][_0xa2ff('0x20')]({'where':{'UserId':_0x31d75e['params']['id'],'VoiceQueueId':_0x31d75e[_0xa2ff('0x3b')][_0xa2ff('0x55')]},'individualHooks':!![]})[_0xa2ff('0x1c')](function(){return _0x20bf43;});}return _0x20bf43;})[_0xa2ff('0x1c')](respondWithStatusCode(_0x55818c,null))[_0xa2ff('0x51')](handleError(_0x55818c,null));};exports['addAvatar']=function(_0x52bf5a,_0x1cfa9d){_0x52bf5a['body'][_0xa2ff('0xa5')]=_0x52bf5a[_0xa2ff('0xa6')][_0xa2ff('0xa7')];return db[_0xa2ff('0x31')][_0xa2ff('0x2a')]({'where':{'id':_0x52bf5a['params']['id']}})[_0xa2ff('0x1c')](handleEntityNotFound(_0x1cfa9d,null))[_0xa2ff('0x1c')](saveUpdates(_0x52bf5a[_0xa2ff('0x50')],null))[_0xa2ff('0x1c')](respondWithResult(_0x1cfa9d,null))[_0xa2ff('0x51')](handleError(_0x1cfa9d,null));};exports[_0xa2ff('0xa8')]=function(_0x9c4eaf,_0xcfdaa5){var _0x3eb5dc=path['join'](config[_0xa2ff('0xa9')],_0xa2ff('0xaa'));return db[_0xa2ff('0x31')][_0xa2ff('0x2a')]({'where':{'id':_0x9c4eaf['params']['id']},'attributes':['id',_0xa2ff('0xa5')],'raw':!![]})[_0xa2ff('0x1c')](handleEntityNotFound(_0xcfdaa5,null))['then'](function(_0x483e78){if(_0x483e78){if(_[_0xa2ff('0x5a')](_0x483e78[_0xa2ff('0xa5')])){return _0xcfdaa5[_0xa2ff('0xab')](_0x3eb5dc);}else{if(!fs['existsSync'](path[_0xa2ff('0xac')](config[_0xa2ff('0xa9')],_0xa2ff('0xad'),_0x483e78[_0xa2ff('0xa5')]))){return _0xcfdaa5[_0xa2ff('0xab')](_0x3eb5dc);}return _0xcfdaa5[_0xa2ff('0xab')](path[_0xa2ff('0xac')](config[_0xa2ff('0xa9')],'server/files/images/',_0x483e78[_0xa2ff('0xa5')]));}}})[_0xa2ff('0x51')](handleError(_0xcfdaa5,null));};exports[_0xa2ff('0xae')]=function(_0x147448,_0x4d8df8){return db[_0xa2ff('0x31')]['find']({'where':{'id':_0x147448[_0xa2ff('0x49')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x4d8df8,null))[_0xa2ff('0x1c')](function(_0x2dc06e){var _0x414e2c=[];values=_0x2dc06e[_0xa2ff('0x44')];_0x414e2c[_0xa2ff('0x42')](get_open_tabs(_0xa2ff('0x43'),_0x2dc06e[_0xa2ff('0x44')]));_0x414e2c['push'](get_open_tabs('sms',_0x2dc06e[_0xa2ff('0x44')]));_0x414e2c['push'](get_open_tabs(_0xa2ff('0x4e'),_0x2dc06e[_0xa2ff('0x44')]));_0x414e2c[_0xa2ff('0x42')](get_open_tabs(_0xa2ff('0x46'),_0x2dc06e[_0xa2ff('0x44')]));_0x414e2c[_0xa2ff('0x42')](get_open_tabs(_0xa2ff('0x45'),_0x2dc06e['dataValues']));_0x414e2c[_0xa2ff('0x42')](get_open_tabs(_0xa2ff('0x4f'),_0x2dc06e[_0xa2ff('0x44')]));return Promise[_0xa2ff('0x47')](_0x414e2c);})[_0xa2ff('0x1c')](function(_0x5b3b32){if(_0x5b3b32){var _0x562187=_['map'](values['ChatOpenTabs'],function(_0x125636){return{'channel':_0xa2ff('0xaf'),'id':_0x125636['id'],'createdAt':_0x125636[_0xa2ff('0xb0')]};});var _0x1ac4e5=_['map'](values[_0xa2ff('0xb1')],function(_0xf1fa20){return{'channel':'FAX','id':_0xf1fa20['id'],'createdAt':_0xf1fa20[_0xa2ff('0xb0')]};});var _0x2e6b58=_[_0xa2ff('0x28')](values[_0xa2ff('0xb2')],function(_0x4c6728){return{'channel':_0xa2ff('0xb3'),'id':_0x4c6728['id'],'createdAt':_0x4c6728[_0xa2ff('0xb0')]};});var _0x6275d2=_[_0xa2ff('0x28')](values[_0xa2ff('0xb4')],function(_0x3711e3){return{'channel':_0xa2ff('0xb5'),'id':_0x3711e3['id'],'createdAt':_0x3711e3[_0xa2ff('0xb0')]};});var _0x35c6f7=_['map'](values[_0xa2ff('0xb6')],function(_0x3a7289){return{'channel':_0xa2ff('0xb7'),'id':_0x3a7289['id'],'createdAt':_0x3a7289[_0xa2ff('0xb0')]};});var _0x509e30=_['map'](values[_0xa2ff('0xb8')],function(_0x5db634){return{'channel':_0xa2ff('0xb9'),'id':_0x5db634['id'],'createdAt':_0x5db634[_0xa2ff('0xb0')]};});var _0x1e7199=_[_0xa2ff('0xba')](_0x562187,_0x1ac4e5,_0x2e6b58,_0x6275d2,_0x35c6f7,_0x509e30);var _0x13714d={'count':_0x1e7199[_0xa2ff('0x41')],'rows':_0x1e7199};return _0x13714d;}else return null;})[_0xa2ff('0x1c')](respondWithResult(_0x4d8df8,null))[_0xa2ff('0x51')](handleError(_0x4d8df8,null));};exports[_0xa2ff('0xbb')]=function(_0x2fe4bc,_0x4f7bca){var _0x430b5d={};return db[_0xa2ff('0x31')][_0xa2ff('0x89')]({'where':{'id':_0x2fe4bc[_0xa2ff('0x49')]['id']}})[_0xa2ff('0x1c')](function(_0x27bcd6){if(!_0x27bcd6){throw new APINotFoundError(util[_0xa2ff('0x9f')](_0xa2ff('0xbc'),_0x2fe4bc[_0xa2ff('0x49')]['id']));}return contacts[_0xa2ff('0x52')]();})[_0xa2ff('0x1c')](function(_0x243862){_0x2fe4bc[_0xa2ff('0x3b')][_0xa2ff('0x31')]=_0x2fe4bc[_0xa2ff('0x49')]['id'];_0x430b5d=qs[_0xa2ff('0x4a')](_0x243862,_0x2fe4bc);if(_0x2fe4bc[_0xa2ff('0x3b')][_0xa2ff('0xbd')](_0xa2ff('0x4b'))){_0x430b5d[_0xa2ff('0x3e')]=[{'model':db[_0xa2ff('0xbe')],'as':'List','required':![]},{'model':db[_0xa2ff('0xbf')],'as':_0xa2ff('0xc0'),'attributes':['id',_0xa2ff('0x2f'),_0xa2ff('0xc1')],'where':_0x2fe4bc[_0xa2ff('0x3b')][_0xa2ff('0xc2')]?{'id':_0x2fe4bc[_0xa2ff('0x3b')]['tag']}:undefined,'required':_0x2fe4bc[_0xa2ff('0x3b')][_0xa2ff('0xc2')]?!![]:![]}];}return contacts[_0xa2ff('0x7e')](_0x2fe4bc[_0xa2ff('0x3b')],_0x2fe4bc[_0xa2ff('0x70')],_0x430b5d,_0x243862);})[_0xa2ff('0x1c')](respondWithFilteredResult(_0x4f7bca,_0x430b5d))[_0xa2ff('0x51')](APIHandleError(_0x4f7bca));};exports[_0xa2ff('0xc3')]=function(_0x353fd4,_0x561c3b){var _0x486ed3;var _0x34882d={};var _0x353906;return db[_0xa2ff('0x31')][_0xa2ff('0x89')]({'where':{'id':_0x353fd4[_0xa2ff('0x49')]['id']},'attributes':['id',_0xa2ff('0x2f'),_0xa2ff('0x1d')]})[_0xa2ff('0x1c')](handleEntityNotFound(_0x561c3b,null))[_0xa2ff('0x1c')](function(_0x21b1da){if(!utils[_0xa2ff('0xa1')](_0x353fd4[_0xa2ff('0x3b')]['channel'])){throw new db[(_0xa2ff('0x83'))]['ValidationError']('Unknown\x20channel');}_0x486ed3=_0x21b1da;var _0x4192eb={};_0x4192eb['model']=_[_0xa2ff('0xc4')](db[_[_0xa2ff('0x94')](_0x353fd4[_0xa2ff('0x3b')]['channel'])+'Queue'][_0xa2ff('0x32')]);_0x4192eb[_0xa2ff('0x3b')]=_[_0xa2ff('0xc4')](_0x353fd4[_0xa2ff('0x3b')]);_0x4192eb[_0xa2ff('0xc5')]=_[_0xa2ff('0xc6')](_0x4192eb[_0xa2ff('0xc7')],_0x4192eb[_0xa2ff('0x3b')]);_0x34882d[_0xa2ff('0x3f')]=_['intersection'](_0x4192eb[_0xa2ff('0xc7')],qs['fields'](_0x353fd4[_0xa2ff('0x3b')]['fields']));_0x34882d[_0xa2ff('0x3f')]=_0x34882d[_0xa2ff('0x3f')][_0xa2ff('0x41')]?_0x34882d['attributes']:_0x4192eb['model'];_0x34882d[_0xa2ff('0xc8')]=qs[_0xa2ff('0xc9')](_0x353fd4[_0xa2ff('0x3b')][_0xa2ff('0xc9')]);_0x34882d[_0xa2ff('0xca')]=qs['filters'](_[_0xa2ff('0xcb')](_0x353fd4['query'],_0x4192eb[_0xa2ff('0xc5')]));if(_0x353fd4[_0xa2ff('0x3b')][_0xa2ff('0x26')]){_0x34882d['where']=_['merge'](_0x34882d[_0xa2ff('0xca')],{'$or':_[_0xa2ff('0x28')](_0x34882d[_0xa2ff('0x3f')],function(_0x1fb5d0){var _0x377162={};_0x377162[_0x1fb5d0]={'$like':'%'+_0x353fd4['query'][_0xa2ff('0x26')]+'%'};return _0x377162;})});}_0x34882d=_[_0xa2ff('0xcc')]({},_0x34882d,_0x353fd4[_0xa2ff('0x4d')]);switch(_0x486ed3['role']){case _0xa2ff('0x71'):return db[_['capitalize'](_0x353fd4[_0xa2ff('0x3b')][_0xa2ff('0x8e')])+_0xa2ff('0xcd')][_0xa2ff('0x7e')](_0x34882d);case _0xa2ff('0x70'):case'agent':return _0x486ed3[_0xa2ff('0x21')+_[_0xa2ff('0x94')](_0x353fd4[_0xa2ff('0x3b')]['channel'])+_0xa2ff('0x96')](_0x34882d);default:throw new db['Sequelize'][(_0xa2ff('0x84'))]('Unknown\x20role');}})['then'](function(_0x3b158a){_0x353906=_0x3b158a[_0xa2ff('0x41')];if(!_0x353fd4[_0xa2ff('0x3b')][_0xa2ff('0xbd')](_0xa2ff('0xce'))){_0x34882d['limit']=qs[_0xa2ff('0x17')](_0x353fd4[_0xa2ff('0x3b')][_0xa2ff('0x17')]);_0x34882d[_0xa2ff('0x19')]=qs[_0xa2ff('0x19')](_0x353fd4[_0xa2ff('0x3b')][_0xa2ff('0x19')]);}switch(_0x486ed3[_0xa2ff('0x1d')]){case _0xa2ff('0x71'):return db[_['capitalize'](_0x353fd4[_0xa2ff('0x3b')][_0xa2ff('0x8e')])+_0xa2ff('0xcd')][_0xa2ff('0x7e')](_0x34882d);case'user':case'agent':return _0x486ed3['get'+_[_0xa2ff('0x94')](_0x353fd4['query'][_0xa2ff('0x8e')])+_0xa2ff('0x96')](_0x34882d);}})[_0xa2ff('0x1c')](function(_0x2a3129){return{'count':_0x353906,'rows':_0x2a3129};})[_0xa2ff('0x1c')](respondWithResult(_0x561c3b,null))[_0xa2ff('0x51')](handleError(_0x561c3b,null));};exports[_0xa2ff('0xcf')]=function(_0x1d3460,_0x4a0ee8){var _0x58687={};var _0xe90ec0={};var _0x39e661;var _0x154a8a;return db[_0xa2ff('0x31')][_0xa2ff('0x89')]({'where':{'id':_0x1d3460[_0xa2ff('0x49')]['id']}})[_0xa2ff('0x1c')](handleEntityNotFound(_0x4a0ee8,null))['then'](function(_0x4badb2){if(_0x4badb2){_0x39e661=_0x4badb2;_0xe90ec0[_0xa2ff('0xc7')]=_[_0xa2ff('0xc4')](db[_0xa2ff('0xa4')][_0xa2ff('0x32')]);_0xe90ec0[_0xa2ff('0x3b')]=_[_0xa2ff('0xc4')](_0x1d3460[_0xa2ff('0x3b')]);_0xe90ec0[_0xa2ff('0xc5')]=_[_0xa2ff('0xc6')](_0xe90ec0[_0xa2ff('0xc7')],_0xe90ec0[_0xa2ff('0x3b')]);_0x58687[_0xa2ff('0x3f')]=_[_0xa2ff('0xc6')](_0xe90ec0[_0xa2ff('0xc7')],qs[_0xa2ff('0xd0')](_0x1d3460[_0xa2ff('0x3b')]['fields']));_0x58687['attributes']=_0x58687[_0xa2ff('0x3f')]['length']?_0x58687[_0xa2ff('0x3f')]:_0xe90ec0[_0xa2ff('0xc7')];_0x58687[_0xa2ff('0xc8')]=qs[_0xa2ff('0xc9')](_0x1d3460[_0xa2ff('0x3b')]['sort']);_0x58687[_0xa2ff('0xca')]=qs[_0xa2ff('0xc5')](_[_0xa2ff('0xcb')](_0x1d3460['query'],_0xe90ec0[_0xa2ff('0xc5')]));if(_0x1d3460[_0xa2ff('0x3b')][_0xa2ff('0x26')]){_0x58687[_0xa2ff('0xca')]=_[_0xa2ff('0xcc')](_0x58687[_0xa2ff('0xca')],{'$or':_[_0xa2ff('0x28')](_0x58687[_0xa2ff('0x3f')],function(_0x5a6791){var _0x433fb0={};_0x433fb0[_0x5a6791]={'$like':'%'+_0x1d3460['query'][_0xa2ff('0x26')]+'%'};return _0x433fb0;})});}_0x58687=_[_0xa2ff('0xcc')]({},_0x58687,_0x1d3460[_0xa2ff('0x4d')]);return _0x39e661[_0xa2ff('0xcf')](_0x58687);}})[_0xa2ff('0x1c')](function(_0x1df30d){if(_0x1df30d){_0x154a8a=_0x1df30d[_0xa2ff('0x41')];if(!_0x1d3460[_0xa2ff('0x3b')][_0xa2ff('0xbd')](_0xa2ff('0xce'))){_0x58687[_0xa2ff('0x17')]=qs['limit'](_0x1d3460[_0xa2ff('0x3b')][_0xa2ff('0x17')]);_0x58687[_0xa2ff('0x19')]=qs['offset'](_0x1d3460[_0xa2ff('0x3b')]['offset']);}return _0x39e661[_0xa2ff('0xcf')](_0x58687);}})[_0xa2ff('0x1c')](function(_0x500859){if(_0x500859){return _0x500859?{'count':_0x154a8a,'rows':_0x500859}:null;}})[_0xa2ff('0x1c')](respondWithResult(_0x4a0ee8,null))[_0xa2ff('0x51')](handleError(_0x4a0ee8,null));};exports[_0xa2ff('0xd1')]=function(_0x2e47ee,_0x3ae50d){var _0x494d7d={};var _0x5a2a78={};var _0x484ae3;var _0x6fa4ec;return db[_0xa2ff('0x31')][_0xa2ff('0x89')]({'where':{'id':_0x2e47ee[_0xa2ff('0x49')]['id']}})[_0xa2ff('0x1c')](handleEntityNotFound(_0x3ae50d,null))[_0xa2ff('0x1c')](function(_0x2bb42e){if(_0x2bb42e){_0x484ae3=_0x2bb42e;_0x5a2a78['model']=_[_0xa2ff('0xc4')](db['ChatGroup'][_0xa2ff('0x32')]);_0x5a2a78['query']=_[_0xa2ff('0xc4')](_0x2e47ee[_0xa2ff('0x3b')]);_0x5a2a78[_0xa2ff('0xc5')]=_['intersection'](_0x5a2a78[_0xa2ff('0xc7')],_0x5a2a78[_0xa2ff('0x3b')]);_0x494d7d[_0xa2ff('0x3f')]=_['intersection'](_0x5a2a78[_0xa2ff('0xc7')],qs[_0xa2ff('0xd0')](_0x2e47ee['query']['fields']));_0x494d7d['attributes']=_0x494d7d[_0xa2ff('0x3f')][_0xa2ff('0x41')]?_0x494d7d[_0xa2ff('0x3f')]:_0x5a2a78[_0xa2ff('0xc7')];_0x494d7d[_0xa2ff('0xc8')]=qs[_0xa2ff('0xc9')](_0x2e47ee[_0xa2ff('0x3b')][_0xa2ff('0xc9')]);_0x494d7d[_0xa2ff('0xca')]=qs[_0xa2ff('0xc5')](_[_0xa2ff('0xcb')](_0x2e47ee[_0xa2ff('0x3b')],_0x5a2a78[_0xa2ff('0xc5')]));if(_0x2e47ee[_0xa2ff('0x3b')][_0xa2ff('0x26')]){_0x494d7d[_0xa2ff('0xca')]=_[_0xa2ff('0xcc')](_0x494d7d[_0xa2ff('0xca')],{'$or':_[_0xa2ff('0x28')](_0x494d7d[_0xa2ff('0x3f')],function(_0x2706c9){var _0x5be64d={};_0x5be64d[_0x2706c9]={'$like':'%'+_0x2e47ee[_0xa2ff('0x3b')][_0xa2ff('0x26')]+'%'};return _0x5be64d;})});}_0x494d7d=_['merge']({},_0x494d7d,_0x2e47ee[_0xa2ff('0x4d')]);return _0x484ae3[_0xa2ff('0xd1')](_0x494d7d);}})[_0xa2ff('0x1c')](function(_0x1a1ff8){if(_0x1a1ff8){_0x6fa4ec=_0x1a1ff8['length'];if(!_0x2e47ee[_0xa2ff('0x3b')][_0xa2ff('0xbd')](_0xa2ff('0xce'))){_0x494d7d['limit']=qs[_0xa2ff('0x17')](_0x2e47ee['query'][_0xa2ff('0x17')]);_0x494d7d[_0xa2ff('0x19')]=qs[_0xa2ff('0x19')](_0x2e47ee[_0xa2ff('0x3b')][_0xa2ff('0x19')]);}return _0x484ae3[_0xa2ff('0xd1')](_0x494d7d);}})[_0xa2ff('0x1c')](function(_0x19d6e8){if(_0x19d6e8){return _0x19d6e8?{'count':_0x6fa4ec,'rows':_0x19d6e8}:null;}})[_0xa2ff('0x1c')](respondWithResult(_0x3ae50d,null))[_0xa2ff('0x51')](handleError(_0x3ae50d,null));};exports[_0xa2ff('0xd2')]=function(_0x316207,_0x23b8cb){var _0x2ac7e2={'raw':!![],'where':{}};var _0x87f647={};var _0x55a036={'count':0x0,'rows':[]};return db['User'][_0xa2ff('0x89')]({'where':{'id':_0x316207[_0xa2ff('0x49')]['id']}})['then'](handleEntityNotFound(_0x23b8cb,null))['then'](function(_0x4b01e7){if(_0x4b01e7){_0x87f647[_0xa2ff('0xc7')]=_[_0xa2ff('0xc4')](db[_0xa2ff('0xd3')][_0xa2ff('0x32')]);_0x87f647[_0xa2ff('0x3b')]=_[_0xa2ff('0xc4')](_0x316207[_0xa2ff('0x3b')]);_0x87f647[_0xa2ff('0xc5')]=_['intersection'](_0x87f647[_0xa2ff('0xc7')],_0x87f647[_0xa2ff('0x3b')]);_0x2ac7e2['attributes']=_[_0xa2ff('0xc6')](_0x87f647[_0xa2ff('0xc7')],qs['fields'](_0x316207[_0xa2ff('0x3b')]['fields']));_0x2ac7e2[_0xa2ff('0x3f')]=_0x2ac7e2['attributes']['length']?_0x2ac7e2[_0xa2ff('0x3f')]:_0x87f647['model'];if(!_0x316207[_0xa2ff('0x3b')][_0xa2ff('0xbd')](_0xa2ff('0xce'))){_0x2ac7e2[_0xa2ff('0x17')]=qs[_0xa2ff('0x17')](_0x316207[_0xa2ff('0x3b')][_0xa2ff('0x17')]);_0x2ac7e2['offset']=qs['offset'](_0x316207[_0xa2ff('0x3b')][_0xa2ff('0x19')]);}_0x2ac7e2[_0xa2ff('0xc8')]=qs[_0xa2ff('0xc9')](_0x316207[_0xa2ff('0x3b')][_0xa2ff('0xc9')]);_0x2ac7e2[_0xa2ff('0xca')]=qs[_0xa2ff('0xc5')](_[_0xa2ff('0xcb')](_0x316207['query'],_0x87f647['filters']));_0x2ac7e2['where'][_0xa2ff('0xd4')]=_0x4b01e7['id'];if(_0x316207[_0xa2ff('0x3b')][_0xa2ff('0x26')]){_0x2ac7e2['where']=_['merge'](_0x2ac7e2[_0xa2ff('0xca')],{'$or':_[_0xa2ff('0x28')](_0x2ac7e2['attributes'],function(_0x1dd67c){var _0x5f0af8={};_0x5f0af8[_0x1dd67c]={'$like':'%'+_0x316207['query']['filter']+'%'};return _0x5f0af8;})});}_0x2ac7e2=_[_0xa2ff('0xcc')]({},_0x2ac7e2,_0x316207['options']);return db[_0xa2ff('0xd3')][_0xa2ff('0x18')]({'where':_0x2ac7e2[_0xa2ff('0xca')]})[_0xa2ff('0x1c')](function(_0x5b4bd5){_0x55a036['count']=_0x5b4bd5;if(_0x316207[_0xa2ff('0x3b')][_0xa2ff('0x4b')]){_0x2ac7e2[_0xa2ff('0x3e')]=[{'all':!![]}];}return db[_0xa2ff('0xd3')]['findAll'](_0x2ac7e2);})['then'](function(_0x5e3c32){_0x55a036[_0xa2ff('0x40')]=_0x5e3c32;return _0x55a036;});}})[_0xa2ff('0x1c')](respondWithFilteredResult(_0x23b8cb,_0x2ac7e2))[_0xa2ff('0x51')](handleError(_0x23b8cb,null));};exports['getScreenRecordings']=function(_0x30cbd9,_0x172d6e){var _0xa7e00d={'raw':!![],'where':{}};var _0x50c600={};var _0x109faf={'count':0x0,'rows':[]};return db['User'][_0xa2ff('0x89')]({'where':{'id':_0x30cbd9[_0xa2ff('0x49')]['id']}})[_0xa2ff('0x1c')](handleEntityNotFound(_0x172d6e,null))[_0xa2ff('0x1c')](function(_0x560b15){if(_0x560b15){_0x50c600['model']=_[_0xa2ff('0xc4')](db[_0xa2ff('0xd5')][_0xa2ff('0x32')]);_0x50c600[_0xa2ff('0x3b')]=_[_0xa2ff('0xc4')](_0x30cbd9[_0xa2ff('0x3b')]);_0x50c600[_0xa2ff('0xc5')]=_[_0xa2ff('0xc6')](_0x50c600['model'],_0x50c600[_0xa2ff('0x3b')]);_0xa7e00d['attributes']=_['intersection'](_0x50c600['model'],qs[_0xa2ff('0xd0')](_0x30cbd9[_0xa2ff('0x3b')][_0xa2ff('0xd0')]));_0xa7e00d[_0xa2ff('0x3f')]=_0xa7e00d['attributes'][_0xa2ff('0x41')]?_0xa7e00d[_0xa2ff('0x3f')]:_0x50c600[_0xa2ff('0xc7')];if(!_0x30cbd9[_0xa2ff('0x3b')][_0xa2ff('0xbd')](_0xa2ff('0xce'))){_0xa7e00d[_0xa2ff('0x17')]=qs[_0xa2ff('0x17')](_0x30cbd9[_0xa2ff('0x3b')]['limit']);_0xa7e00d[_0xa2ff('0x19')]=qs['offset'](_0x30cbd9['query']['offset']);}_0xa7e00d[_0xa2ff('0xc8')]=qs[_0xa2ff('0xc9')](_0x30cbd9[_0xa2ff('0x3b')]['sort']);_0xa7e00d[_0xa2ff('0xca')]=qs[_0xa2ff('0xc5')](_[_0xa2ff('0xcb')](_0x30cbd9[_0xa2ff('0x3b')],_0x50c600[_0xa2ff('0xc5')]));_0xa7e00d[_0xa2ff('0xca')][_0xa2ff('0xd4')]=_0x560b15['id'];if(_0x30cbd9[_0xa2ff('0x3b')][_0xa2ff('0x26')]){_0xa7e00d[_0xa2ff('0xca')]=_[_0xa2ff('0xcc')](_0xa7e00d['where'],{'$or':_[_0xa2ff('0x28')](_0xa7e00d[_0xa2ff('0x3f')],function(_0x245e5e){var _0x1ba5eb={};_0x1ba5eb[_0x245e5e]={'$like':'%'+_0x30cbd9[_0xa2ff('0x3b')][_0xa2ff('0x26')]+'%'};return _0x1ba5eb;})});}_0xa7e00d=_[_0xa2ff('0xcc')]({},_0xa7e00d,_0x30cbd9[_0xa2ff('0x4d')]);return db['ScreenRecording']['count']({'where':_0xa7e00d[_0xa2ff('0xca')]})['then'](function(_0x3298eb){_0x109faf[_0xa2ff('0x18')]=_0x3298eb;if(_0x30cbd9[_0xa2ff('0x3b')][_0xa2ff('0x4b')]){_0xa7e00d[_0xa2ff('0x3e')]=[{'all':!![]}];}return db[_0xa2ff('0xd5')][_0xa2ff('0x7e')](_0xa7e00d);})[_0xa2ff('0x1c')](function(_0x3a955e){_0x109faf[_0xa2ff('0x40')]=_0x3a955e;return _0x109faf;});}})[_0xa2ff('0x1c')](respondWithFilteredResult(_0x172d6e,_0xa7e00d))[_0xa2ff('0x51')](handleError(_0x172d6e,null));};exports[_0xa2ff('0xd6')]=function(_0x1407fd,_0x279c78){var _0x4995df={};var _0x717ec1={};var _0x5a91a6;var _0x11b61a;return db[_0xa2ff('0x31')][_0xa2ff('0x89')]({'where':{'id':_0x1407fd['params']['id']}})['then'](handleEntityNotFound(_0x279c78,null))[_0xa2ff('0x1c')](function(_0x361573){if(_0x361573){_0x5a91a6=_0x361573;_0x717ec1['model']=_[_0xa2ff('0xc4')](db[_0xa2ff('0xd7')]['rawAttributes']);_0x717ec1[_0xa2ff('0x3b')]=_[_0xa2ff('0xc4')](_0x1407fd[_0xa2ff('0x3b')]);_0x717ec1['filters']=_['intersection'](_0x717ec1['model'],_0x717ec1[_0xa2ff('0x3b')]);_0x4995df[_0xa2ff('0x3f')]=_['intersection'](_0x717ec1['model'],qs[_0xa2ff('0xd0')](_0x1407fd[_0xa2ff('0x3b')]['fields']));_0x4995df[_0xa2ff('0x3f')]=_0x4995df[_0xa2ff('0x3f')][_0xa2ff('0x41')]?_0x4995df[_0xa2ff('0x3f')]:_0x717ec1[_0xa2ff('0xc7')];_0x4995df[_0xa2ff('0xc8')]=qs[_0xa2ff('0xc9')](_0x1407fd['query'][_0xa2ff('0xc9')]);_0x4995df['where']=qs[_0xa2ff('0xc5')](_['pick'](_0x1407fd[_0xa2ff('0x3b')],_0x717ec1['filters']));if(_0x1407fd[_0xa2ff('0x3b')][_0xa2ff('0x26')]){_0x4995df[_0xa2ff('0xca')]=_['merge'](_0x4995df[_0xa2ff('0xca')],{'$or':_[_0xa2ff('0x28')](_0x4995df[_0xa2ff('0x3f')],function(_0x48dfc8){var _0x4b36c6={};_0x4b36c6[_0x48dfc8]={'$like':'%'+_0x1407fd[_0xa2ff('0x3b')][_0xa2ff('0x26')]+'%'};return _0x4b36c6;})});}_0x4995df=_[_0xa2ff('0xcc')]({},_0x4995df,_0x1407fd[_0xa2ff('0x4d')]);return _0x5a91a6[_0xa2ff('0xd6')](_0x4995df);}})[_0xa2ff('0x1c')](function(_0x1a4962){if(_0x1a4962){_0x11b61a=_0x1a4962[_0xa2ff('0x41')];if(!_0x1407fd['query'][_0xa2ff('0xbd')](_0xa2ff('0xce'))){_0x4995df[_0xa2ff('0x17')]=qs['limit'](_0x1407fd['query']['limit']);_0x4995df[_0xa2ff('0x19')]=qs['offset'](_0x1407fd[_0xa2ff('0x3b')][_0xa2ff('0x19')]);}return _0x5a91a6[_0xa2ff('0xd6')](_0x4995df);}})[_0xa2ff('0x1c')](function(_0x95fda4){if(_0x95fda4){return _0x95fda4?{'count':_0x11b61a,'rows':_0x95fda4}:null;}})[_0xa2ff('0x1c')](respondWithResult(_0x279c78,null))[_0xa2ff('0x51')](handleError(_0x279c78,null));};exports[_0xa2ff('0xd8')]=function(_0x5117d9,_0x4cbe31){var _0x5236da={};var _0x53d46f={};var _0x2a4d3b;var _0x3d970c;return db[_0xa2ff('0x31')][_0xa2ff('0x89')]({'where':{'id':_0x5117d9[_0xa2ff('0x49')]['id']}})[_0xa2ff('0x1c')](handleEntityNotFound(_0x4cbe31,null))[_0xa2ff('0x1c')](function(_0x314756){if(_0x314756){_0x2a4d3b=_0x314756;_0x53d46f[_0xa2ff('0xc7')]=_[_0xa2ff('0xc4')](db[_0xa2ff('0xd9')][_0xa2ff('0x32')]);_0x53d46f[_0xa2ff('0x3b')]=_[_0xa2ff('0xc4')](_0x5117d9[_0xa2ff('0x3b')]);_0x53d46f[_0xa2ff('0xc5')]=_['intersection'](_0x53d46f[_0xa2ff('0xc7')],_0x53d46f[_0xa2ff('0x3b')]);_0x5236da[_0xa2ff('0x3f')]=_['intersection'](_0x53d46f[_0xa2ff('0xc7')],qs[_0xa2ff('0xd0')](_0x5117d9[_0xa2ff('0x3b')][_0xa2ff('0xd0')]));_0x5236da[_0xa2ff('0x3f')]=_0x5236da[_0xa2ff('0x3f')]['length']?_0x5236da[_0xa2ff('0x3f')]:_0x53d46f[_0xa2ff('0xc7')];_0x5236da['order']=qs[_0xa2ff('0xc9')](_0x5117d9[_0xa2ff('0x3b')][_0xa2ff('0xc9')]);_0x5236da['where']=qs['filters'](_[_0xa2ff('0xcb')](_0x5117d9[_0xa2ff('0x3b')],_0x53d46f[_0xa2ff('0xc5')]));if(_0x5117d9[_0xa2ff('0x3b')]['filter']){_0x5236da[_0xa2ff('0xca')]=_[_0xa2ff('0xcc')](_0x5236da[_0xa2ff('0xca')],{'$or':_[_0xa2ff('0x28')](_0x5236da['attributes'],function(_0x3912af){var _0x596c10={};_0x596c10[_0x3912af]={'$like':'%'+_0x5117d9[_0xa2ff('0x3b')]['filter']+'%'};return _0x596c10;})});}_0x5236da=_[_0xa2ff('0xcc')]({},_0x5236da,_0x5117d9[_0xa2ff('0x4d')]);return _0x2a4d3b[_0xa2ff('0xd8')](_0x5236da);}})[_0xa2ff('0x1c')](function(_0x53e9fb){if(_0x53e9fb){_0x3d970c=_0x53e9fb[_0xa2ff('0x41')];if(!_0x5117d9['query'][_0xa2ff('0xbd')](_0xa2ff('0xce'))){_0x5236da[_0xa2ff('0x17')]=qs[_0xa2ff('0x17')](_0x5117d9[_0xa2ff('0x3b')][_0xa2ff('0x17')]);_0x5236da[_0xa2ff('0x19')]=qs['offset'](_0x5117d9[_0xa2ff('0x3b')][_0xa2ff('0x19')]);}return _0x2a4d3b['getOpenchannelInteractions'](_0x5236da);}})[_0xa2ff('0x1c')](function(_0x317305){if(_0x317305){return _0x317305?{'count':_0x3d970c,'rows':_0x317305}:null;}})['then'](respondWithResult(_0x4cbe31,null))['catch'](handleError(_0x4cbe31,null));};exports[_0xa2ff('0xda')]=function(_0x2ceefb,_0x5e021b){var _0x1942cd={'raw':!![],'where':{}};var _0x5be2b8={};var _0x39cc5c={'count':0x0,'rows':[]};return db[_0xa2ff('0x31')][_0xa2ff('0x89')]({'where':{'id':_0x2ceefb[_0xa2ff('0x49')]['id']}})['then'](handleEntityNotFound(_0x5e021b,null))[_0xa2ff('0x1c')](function(_0x481bd0){if(_0x481bd0){_0x5be2b8[_0xa2ff('0xc7')]=_[_0xa2ff('0xc4')](db[_0xa2ff('0xdb')][_0xa2ff('0x32')]);_0x5be2b8['query']=_[_0xa2ff('0xc4')](_0x2ceefb[_0xa2ff('0x3b')]);_0x5be2b8[_0xa2ff('0xc5')]=_['intersection'](_0x5be2b8[_0xa2ff('0xc7')],_0x5be2b8[_0xa2ff('0x3b')]);_0x1942cd['attributes']=_['intersection'](_0x5be2b8['model'],qs[_0xa2ff('0xd0')](_0x2ceefb[_0xa2ff('0x3b')][_0xa2ff('0xd0')]));_0x1942cd[_0xa2ff('0x3f')]=_0x1942cd['attributes'][_0xa2ff('0x41')]?_0x1942cd[_0xa2ff('0x3f')]:_0x5be2b8[_0xa2ff('0xc7')];if(!_0x2ceefb[_0xa2ff('0x3b')][_0xa2ff('0xbd')](_0xa2ff('0xce'))){_0x1942cd['limit']=qs[_0xa2ff('0x17')](_0x2ceefb[_0xa2ff('0x3b')]['limit']);_0x1942cd['offset']=qs[_0xa2ff('0x19')](_0x2ceefb[_0xa2ff('0x3b')][_0xa2ff('0x19')]);}_0x1942cd['order']=qs[_0xa2ff('0xc9')](_0x2ceefb[_0xa2ff('0x3b')][_0xa2ff('0xc9')]);_0x1942cd['where']=qs[_0xa2ff('0xc5')](_[_0xa2ff('0xcb')](_0x2ceefb['query'],_0x5be2b8['filters']));_0x1942cd[_0xa2ff('0xca')]['UserId']=_0x481bd0['id'];if(_0x2ceefb[_0xa2ff('0x3b')][_0xa2ff('0x26')]){_0x1942cd[_0xa2ff('0xca')]=_['merge'](_0x1942cd[_0xa2ff('0xca')],{'$or':_[_0xa2ff('0x28')](_0x1942cd[_0xa2ff('0x3f')],function(_0x159d23){var _0x2c831c={};_0x2c831c[_0x159d23]={'$like':'%'+_0x2ceefb['query'][_0xa2ff('0x26')]+'%'};return _0x2c831c;})});}_0x1942cd=_[_0xa2ff('0xcc')]({},_0x1942cd,_0x2ceefb[_0xa2ff('0x4d')]);return db['MailInteraction'][_0xa2ff('0x18')]({'where':_0x1942cd[_0xa2ff('0xca')]})[_0xa2ff('0x1c')](function(_0x5e40da){_0x39cc5c[_0xa2ff('0x18')]=_0x5e40da;if(_0x2ceefb['query'][_0xa2ff('0x4b')]){_0x1942cd[_0xa2ff('0x3e')]=[{'all':!![]}];}return db['MailInteraction'][_0xa2ff('0x7e')](_0x1942cd);})[_0xa2ff('0x1c')](function(_0x5f557b){_0x39cc5c[_0xa2ff('0x40')]=_0x5f557b;return _0x39cc5c;});}})['then'](respondWithFilteredResult(_0x5e021b,_0x1942cd))[_0xa2ff('0x51')](handleError(_0x5e021b,null));};exports[_0xa2ff('0xdc')]=function(_0x2e6608,_0x302373){var _0x3c3e50={};var _0x445b63={};var _0x52a41b;var _0x4fac3c;return db[_0xa2ff('0x31')][_0xa2ff('0x89')]({'where':{'id':_0x2e6608[_0xa2ff('0x49')]['id']}})[_0xa2ff('0x1c')](handleEntityNotFound(_0x302373,null))[_0xa2ff('0x1c')](function(_0x56ae08){if(_0x56ae08){_0x52a41b=_0x56ae08;_0x445b63['model']=_[_0xa2ff('0xc4')](db[_0xa2ff('0xdd')][_0xa2ff('0x32')]);_0x445b63[_0xa2ff('0x3b')]=_['keys'](_0x2e6608[_0xa2ff('0x3b')]);_0x445b63[_0xa2ff('0xc5')]=_[_0xa2ff('0xc6')](_0x445b63[_0xa2ff('0xc7')],_0x445b63[_0xa2ff('0x3b')]);_0x3c3e50[_0xa2ff('0x3f')]=_['intersection'](_0x445b63[_0xa2ff('0xc7')],qs[_0xa2ff('0xd0')](_0x2e6608['query'][_0xa2ff('0xd0')]));_0x3c3e50[_0xa2ff('0x3f')]=_0x3c3e50['attributes'][_0xa2ff('0x41')]?_0x3c3e50[_0xa2ff('0x3f')]:_0x445b63['model'];_0x3c3e50[_0xa2ff('0xc8')]=qs[_0xa2ff('0xc9')](_0x2e6608[_0xa2ff('0x3b')][_0xa2ff('0xc9')]);_0x3c3e50[_0xa2ff('0xca')]=qs['filters'](_[_0xa2ff('0xcb')](_0x2e6608[_0xa2ff('0x3b')],_0x445b63[_0xa2ff('0xc5')]));if(_0x2e6608[_0xa2ff('0x3b')][_0xa2ff('0x26')]){_0x3c3e50[_0xa2ff('0xca')]=_[_0xa2ff('0xcc')](_0x3c3e50['where'],{'$or':_[_0xa2ff('0x28')](_0x3c3e50[_0xa2ff('0x3f')],function(_0x564770){var _0x2395e5={};_0x2395e5[_0x564770]={'$like':'%'+_0x2e6608[_0xa2ff('0x3b')][_0xa2ff('0x26')]+'%'};return _0x2395e5;})});}_0x3c3e50=_[_0xa2ff('0xcc')]({},_0x3c3e50,_0x2e6608[_0xa2ff('0x4d')]);return _0x52a41b[_0xa2ff('0xdc')](_0x3c3e50);}})[_0xa2ff('0x1c')](function(_0x4fdfb1){if(_0x4fdfb1){_0x4fac3c=_0x4fdfb1[_0xa2ff('0x41')];if(!_0x2e6608[_0xa2ff('0x3b')][_0xa2ff('0xbd')](_0xa2ff('0xce'))){_0x3c3e50[_0xa2ff('0x17')]=qs[_0xa2ff('0x17')](_0x2e6608['query'][_0xa2ff('0x17')]);_0x3c3e50[_0xa2ff('0x19')]=qs[_0xa2ff('0x19')](_0x2e6608[_0xa2ff('0x3b')]['offset']);}return _0x52a41b[_0xa2ff('0xdc')](_0x3c3e50);}})['then'](function(_0x3f8e20){if(_0x3f8e20){return _0x3f8e20?{'count':_0x4fac3c,'rows':_0x3f8e20}:null;}})[_0xa2ff('0x1c')](respondWithResult(_0x302373,null))[_0xa2ff('0x51')](handleError(_0x302373,null));};exports[_0xa2ff('0xde')]=function(_0xe7dbd4,_0x15b377){var _0xba5c88={};var _0x2d56d1={};var _0x47d456;var _0x1f5b55;return db['User'][_0xa2ff('0x89')]({'where':{'id':_0xe7dbd4[_0xa2ff('0x49')]['id']}})[_0xa2ff('0x1c')](handleEntityNotFound(_0x15b377,null))[_0xa2ff('0x1c')](function(_0x175924){if(_0x175924){_0x47d456=_0x175924;_0x2d56d1[_0xa2ff('0xc7')]=_['keys'](db[_0xa2ff('0xdf')][_0xa2ff('0x32')]);_0x2d56d1['query']=_[_0xa2ff('0xc4')](_0xe7dbd4['query']);_0x2d56d1[_0xa2ff('0xc5')]=_[_0xa2ff('0xc6')](_0x2d56d1[_0xa2ff('0xc7')],_0x2d56d1[_0xa2ff('0x3b')]);_0xba5c88[_0xa2ff('0x3f')]=_[_0xa2ff('0xc6')](_0x2d56d1[_0xa2ff('0xc7')],qs[_0xa2ff('0xd0')](_0xe7dbd4[_0xa2ff('0x3b')]['fields']));_0xba5c88[_0xa2ff('0x3f')]=_0xba5c88[_0xa2ff('0x3f')][_0xa2ff('0x41')]?_0xba5c88[_0xa2ff('0x3f')]:_0x2d56d1['model'];_0xba5c88[_0xa2ff('0xc8')]=qs[_0xa2ff('0xc9')](_0xe7dbd4['query'][_0xa2ff('0xc9')]);_0xba5c88[_0xa2ff('0xca')]=qs[_0xa2ff('0xc5')](_[_0xa2ff('0xcb')](_0xe7dbd4[_0xa2ff('0x3b')],_0x2d56d1[_0xa2ff('0xc5')]));if(_0xe7dbd4[_0xa2ff('0x3b')]['filter']){_0xba5c88[_0xa2ff('0xca')]=_[_0xa2ff('0xcc')](_0xba5c88[_0xa2ff('0xca')],{'$or':_['map'](_0xba5c88['attributes'],function(_0x91b296){var _0x46f066={};_0x46f066[_0x91b296]={'$like':'%'+_0xe7dbd4[_0xa2ff('0x3b')][_0xa2ff('0x26')]+'%'};return _0x46f066;})});}_0xba5c88=_[_0xa2ff('0xcc')]({},_0xba5c88,_0xe7dbd4['options']);return _0x47d456[_0xa2ff('0xde')](_0xba5c88);}})['then'](function(_0x4c698c){if(_0x4c698c){_0x1f5b55=_0x4c698c[_0xa2ff('0x41')];if(!_0xe7dbd4[_0xa2ff('0x3b')][_0xa2ff('0xbd')](_0xa2ff('0xce'))){_0xba5c88[_0xa2ff('0x17')]=qs['limit'](_0xe7dbd4[_0xa2ff('0x3b')][_0xa2ff('0x17')]);_0xba5c88[_0xa2ff('0x19')]=qs[_0xa2ff('0x19')](_0xe7dbd4[_0xa2ff('0x3b')]['offset']);}return _0x47d456[_0xa2ff('0xde')](_0xba5c88);}})['then'](function(_0x1e25bc){if(_0x1e25bc){return _0x1e25bc?{'count':_0x1f5b55,'rows':_0x1e25bc}:null;}})[_0xa2ff('0x1c')](respondWithResult(_0x15b377,null))[_0xa2ff('0x51')](handleError(_0x15b377,null));};exports[_0xa2ff('0xe0')]=function(_0xb07b00,_0x54ce62){var _0x2a041e={};var _0x3a7979={};var _0x121c1f;var _0x49afe7;return db[_0xa2ff('0x31')][_0xa2ff('0x89')]({'where':{'id':_0xb07b00[_0xa2ff('0x49')]['id']}})['then'](handleEntityNotFound(_0x54ce62,null))[_0xa2ff('0x1c')](function(_0x1e24cf){if(_0x1e24cf){_0x121c1f=_0x1e24cf;_0x3a7979['model']=_[_0xa2ff('0xc4')](db[_0xa2ff('0xe1')]['rawAttributes']);_0x3a7979[_0xa2ff('0x3b')]=_[_0xa2ff('0xc4')](_0xb07b00['query']);_0x3a7979[_0xa2ff('0xc5')]=_[_0xa2ff('0xc6')](_0x3a7979[_0xa2ff('0xc7')],_0x3a7979[_0xa2ff('0x3b')]);_0x2a041e[_0xa2ff('0x3f')]=_[_0xa2ff('0xc6')](_0x3a7979[_0xa2ff('0xc7')],qs['fields'](_0xb07b00[_0xa2ff('0x3b')][_0xa2ff('0xd0')]));_0x2a041e[_0xa2ff('0x3f')]=_0x2a041e['attributes'][_0xa2ff('0x41')]?_0x2a041e['attributes']:_0x3a7979[_0xa2ff('0xc7')];_0x2a041e[_0xa2ff('0xc8')]=qs[_0xa2ff('0xc9')](_0xb07b00[_0xa2ff('0x3b')]['sort']);_0x2a041e[_0xa2ff('0xca')]=qs['filters'](_['pick'](_0xb07b00[_0xa2ff('0x3b')],_0x3a7979[_0xa2ff('0xc5')]));if(_0xb07b00[_0xa2ff('0x3b')]['filter']){_0x2a041e['where']=_[_0xa2ff('0xcc')](_0x2a041e[_0xa2ff('0xca')],{'$or':_[_0xa2ff('0x28')](_0x2a041e[_0xa2ff('0x3f')],function(_0x509995){var _0x1eb296={};_0x1eb296[_0x509995]={'$like':'%'+_0xb07b00['query'][_0xa2ff('0x26')]+'%'};return _0x1eb296;})});}_0x2a041e=_[_0xa2ff('0xcc')]({},_0x2a041e,_0xb07b00[_0xa2ff('0x4d')]);return _0x121c1f[_0xa2ff('0xe0')](_0x2a041e);}})['then'](function(_0x2e8c53){if(_0x2e8c53){_0x49afe7=_0x2e8c53[_0xa2ff('0x41')];if(!_0xb07b00[_0xa2ff('0x3b')][_0xa2ff('0xbd')](_0xa2ff('0xce'))){_0x2a041e[_0xa2ff('0x17')]=qs[_0xa2ff('0x17')](_0xb07b00[_0xa2ff('0x3b')][_0xa2ff('0x17')]);_0x2a041e[_0xa2ff('0x19')]=qs[_0xa2ff('0x19')](_0xb07b00[_0xa2ff('0x3b')][_0xa2ff('0x19')]);}return _0x121c1f[_0xa2ff('0xe0')](_0x2a041e);}})['then'](function(_0x2e53a5){if(_0x2e53a5){return _0x2e53a5?{'count':_0x49afe7,'rows':_0x2e53a5}:null;}})[_0xa2ff('0x1c')](respondWithResult(_0x54ce62,null))[_0xa2ff('0x51')](handleError(_0x54ce62,null));};exports[_0xa2ff('0xe2')]=function(_0x58a9ba,_0x471c55,_0x4a602e){var _0x16c70b;var _0x544817;var _0x36b4ad;var _0x48743c=!_[_0xa2ff('0x5a')](_0x58a9ba[_0xa2ff('0x49')]['id'])?_0x58a9ba['params']['id']:!_['isNil'](_0x58a9ba[_0xa2ff('0x70')]['id'])?_0x58a9ba[_0xa2ff('0x70')]['id']:null;return db[_0xa2ff('0x31')][_0xa2ff('0x2a')]({'where':{'id':_0x48743c,'role':{'$or':[_0xa2ff('0x71'),_0xa2ff('0x70'),_0xa2ff('0x1e')]}},'attributes':['id','name','phone',_0xa2ff('0xe3'),_0xa2ff('0x1d'),_0xa2ff('0x59'),_0xa2ff('0x90')]})[_0xa2ff('0x1c')](function(_0x2d589c){if(_0x2d589c){if(_0x2d589c[_0xa2ff('0x1d')]===_0xa2ff('0x1e')){_0x16c70b=_0x2d589c;if(_0x58a9ba['body'][_0xa2ff('0x9e')]){_0x36b4ad=util['format'](_0xa2ff('0xe4'),_0x16c70b[_0x58a9ba['body']['interface']]);}else if(_0x58a9ba[_0xa2ff('0x50')][_0xa2ff('0xe5')]){_0x36b4ad=util[_0xa2ff('0x9f')](_0xa2ff('0xe6'),_0x58a9ba[_0xa2ff('0x50')][_0xa2ff('0xe5')]);}else{_0x36b4ad=util[_0xa2ff('0x9f')](_0xa2ff('0xe6'),_0x16c70b[_0xa2ff('0x2f')]);}socket['to'](util[_0xa2ff('0x9f')](_0xa2ff('0xe7'),_0x16c70b[_0xa2ff('0x2f')]))[_0xa2ff('0x9a')](_0xa2ff('0xe8'),{'user':{'id':_0x16c70b['id'],'name':_0x16c70b[_0xa2ff('0x2f')]},'ip':_0x58a9ba[_0xa2ff('0xe9')]['x-forwarded-for']||_0x58a9ba[_0xa2ff('0xea')]['remoteAddress']||_0x58a9ba[_0xa2ff('0xeb')][_0xa2ff('0xec')]||_0x58a9ba['connection']['socket'][_0xa2ff('0xec')]});return db['UserVoiceQueueRt'][_0xa2ff('0x20')]({'where':{'membername':_0x16c70b[_0xa2ff('0x2f')]},'individualHooks':!![]});}}else{throw new db[(_0xa2ff('0x83'))][(_0xa2ff('0x84'))](_0xa2ff('0xed'));}})[_0xa2ff('0x1c')](function(){if(_0x16c70b){return _0x16c70b[_0xa2ff('0xee')]({'raw':!![]});}})[_0xa2ff('0x1c')](function(_0x4e1e19){if(_0x16c70b){if(_0x4e1e19){_0x544817=_0x4e1e19;if(_0x544817['length']){var _0x4d9097=_0x544817[_0xa2ff('0x28')](function(_0x22a273){var _0x56ab1e={'membername':_0x16c70b[_0xa2ff('0x2f')],'UserId':_0x16c70b['id'],'queue_name':_0x22a273[_0xa2ff('0x2f')],'VoiceQueueId':_0x22a273['id'],'interface':_0x36b4ad,'paused':_0x16c70b[_0xa2ff('0x90')]||![],'penalty':_0x22a273[_0xa2ff('0xef')]||0x0};return db[_0xa2ff('0xa4')][_0xa2ff('0xa0')](_0x56ab1e);});return Promise['all'](_0x4d9097);}}}})[_0xa2ff('0x1c')](function(){if(_0x16c70b){return db[_0xa2ff('0xf0')][_0xa2ff('0x7e')]({'where':{'membername':_0x16c70b[_0xa2ff('0x2f')],'exitAt':null}});}})['then'](function(_0x4564ed){if(_0x16c70b){var _0x1b6e50=[];_0x4564ed[_0xa2ff('0xf1')](function(_0x40164e){_0x1b6e50['push'](_0x40164e[_0xa2ff('0x1b')]({'exitAt':moment()[_0xa2ff('0x9f')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xa2ff('0x47')](_0x1b6e50);}})['then'](function(){if(_0x16c70b){var _0x5daee4=[];var _0x3d4196=[];var _0x3d521b=utils[_0xa2ff('0xf2')]();var _0x1d780e={'membername':_0x16c70b[_0xa2ff('0x2f')],'interface':_0x36b4ad,'enterAt':moment()[_0xa2ff('0x9f')](_0xa2ff('0xf3')),'role':_0x16c70b[_0xa2ff('0x1d')],'internal':_0x16c70b[_0xa2ff('0x59')]};_0x3d521b['forEach'](function(_0x52bbf3){_0x5daee4[_0xa2ff('0x42')](_[_0xa2ff('0xcc')]({'channel':_0x52bbf3,'type':_0xa2ff('0xf4'),'data1':_0x58a9ba['body']['device'],'data2':_0x36b4ad},_0x1d780e));if(_0x16c70b[_0xa2ff('0x90')]){_0x3d4196[_0xa2ff('0x42')](_[_0xa2ff('0xcc')]({'channel':_0x52bbf3,'type':_0xa2ff('0xf5'),'data1':'LOGININPAUSE'},_0x1d780e));}});return db[_0xa2ff('0xf0')][_0xa2ff('0x78')](_0x5daee4[_0xa2ff('0xba')](_0x3d4196),{'individualHooks':!![]});}})[_0xa2ff('0x1c')](function(){if(_0x16c70b){return _0x16c70b[_0xa2ff('0x1b')]({'online':!![],'lastLoginAt':moment()[_0xa2ff('0x9f')](_0xa2ff('0xf3')),'voicePause':_0x16c70b[_0xa2ff('0x90')]||![],'mailPause':_0x16c70b['loginInPause']||![],'chatPause':_0x16c70b[_0xa2ff('0x90')]||![],'faxPause':_0x16c70b['loginInPause']||![],'smsPause':_0x16c70b[_0xa2ff('0x90')]||![],'openchannelPause':_0x16c70b['loginInPause']||![],'whatsappPause':_0x16c70b['loginInPause']||![],'pauseType':_0x16c70b['loginInPause']?_0xa2ff('0xf6'):null,'interface':_0x36b4ad,'lastPauseAt':moment()['format'](_0xa2ff('0xf3'))});}})['then'](function(_0x1130aa){if(_0x58a9ba['isMiddleware']){return _0x4a602e();}else{return Promise[_0xa2ff('0xf7')](_0x1130aa)[_0xa2ff('0x1c')](respondWithResult(_0x471c55,null));}})['catch'](handleError(_0x471c55,null));};exports[_0xa2ff('0xf8')]=function(_0x585ee1,_0x403dde){var _0x1143aa;return db[_0xa2ff('0x31')][_0xa2ff('0x2a')]({'where':{'id':_0x585ee1[_0xa2ff('0x49')]['id'],'role':_0xa2ff('0x1e')},'attributes':['id','name',_0xa2ff('0x1d')]})[_0xa2ff('0x1c')](handleEntityNotFound(_0x403dde,null))['then'](function(_0x31f910){if(_0x31f910){_0x1143aa=_0x31f910;return db[_0xa2ff('0xa4')][_0xa2ff('0x20')]({'where':{'membername':_0x1143aa[_0xa2ff('0x2f')]},'individualHooks':!![]});}})['then'](function(){return db[_0xa2ff('0xf0')]['findAll']({'where':{'membername':_0x1143aa[_0xa2ff('0x2f')],'exitAt':null}});})[_0xa2ff('0x1c')](function(_0x17799a){var _0x3d6e97=[];_0x17799a[_0xa2ff('0xf1')](function(_0x22856e){_0x3d6e97[_0xa2ff('0x42')](_0x22856e['update']({'exitAt':moment()[_0xa2ff('0x9f')](_0xa2ff('0xf3'))}));});return Promise['all'](_0x3d6e97);})[_0xa2ff('0x1c')](function(){return _0x1143aa[_0xa2ff('0x1b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xa2ff('0x1c')](respondWithResult(_0x403dde,null))[_0xa2ff('0x51')](handleError(_0x403dde,null));};exports['pause']=function(_0x43c352,_0x48a350){var _0x7bc669;return db[_0xa2ff('0xa4')]['update']({'paused':0x1},{'where':{'UserId':_0x43c352[_0xa2ff('0x49')]['id']},'individualHooks':!![]})['then'](function(){return db[_0xa2ff('0x31')][_0xa2ff('0x2a')]({'where':{'id':_0x43c352[_0xa2ff('0x49')]['id'],'role':_0xa2ff('0x1e')},'attributes':['id','name',_0xa2ff('0x1d'),_0xa2ff('0x59'),_0xa2ff('0x9e'),'online']});})[_0xa2ff('0x1c')](handleEntityNotFound(_0x48a350,null))['then'](function(_0x33d4f2){if(_0x33d4f2){_0x7bc669=_0x33d4f2;return db[_0xa2ff('0xf0')][_0xa2ff('0x7e')]({'where':{'membername':_0x7bc669['name'],'type':_0xa2ff('0xf5'),'exitAt':null}});}})[_0xa2ff('0x1c')](function(_0x30f5ac){if(_0x30f5ac[_0xa2ff('0x41')]){var _0x554072=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x31619a=0x0,_0x5acdae=_0x30f5ac[_0xa2ff('0x41')];_0x31619a<_0x5acdae;_0x31619a++){_0x30f5ac[_0x31619a]['updateAttributes']({'exitAt':_0x554072});}}})[_0xa2ff('0x1c')](function(){var _0x33d879=[];var _0xba359a=utils['getChannels']();_0xba359a[_0xa2ff('0xf1')](function(_0x31e009){_0x33d879['push']({'channel':_0x31e009,'membername':_0x7bc669[_0xa2ff('0x2f')],'interface':_['isNil'](_0x7bc669[_0xa2ff('0x9e')])?util[_0xa2ff('0x9f')](_0xa2ff('0xe6'),_0x7bc669[_0xa2ff('0x2f')]):_0x7bc669[_0xa2ff('0x9e')],'type':_0xa2ff('0xf5'),'enterAt':moment()[_0xa2ff('0x9f')](_0xa2ff('0xf3')),'data1':_0x43c352[_0xa2ff('0x50')][_0xa2ff('0xf9')]||'DEFAULT\x20PAUSE','role':_0x7bc669['role'],'internal':_0x7bc669['internal']});});return db[_0xa2ff('0xf0')][_0xa2ff('0x78')](_0x33d879,{'individualHooks':!![]});})[_0xa2ff('0x1c')](function(){return _0x7bc669[_0xa2ff('0x1b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x43c352[_0xa2ff('0x50')][_0xa2ff('0xf9')]||_0xa2ff('0xfa'),'lastPauseAt':moment()['format'](_0xa2ff('0xf3'))});})[_0xa2ff('0x1c')](respondWithResult(_0x48a350,null))['catch'](handleError(_0x48a350,null));};exports[_0xa2ff('0xfb')]=function(_0xccc3df,_0x46d9a7){if(_0xccc3df[_0xa2ff('0x50')]['channel']&&!utils['isValidChannel'](_0xccc3df['body'][_0xa2ff('0x8e')])){throw new APIBadRequestError(util[_0xa2ff('0x9f')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0xccc3df[_0xa2ff('0x50')][_0xa2ff('0x8e')]));}return db['User'][_0xa2ff('0x2a')]({'where':{'id':_0xccc3df[_0xa2ff('0x49')]['id']},'attributes':['id',_0xa2ff('0x2f'),'role',_0xa2ff('0x59'),_0xa2ff('0x9e'),'online',_0xa2ff('0x91'),_0xa2ff('0xfc'),_0xa2ff('0xfd'),_0xa2ff('0xfe'),_0xa2ff('0xff'),_0xa2ff('0x100'),_0xa2ff('0x101'),'pauseType',_0xa2ff('0x102')]})[_0xa2ff('0x1c')](function(_0x14b1af){if(!_0x14b1af){throw new APINotFoundError(util[_0xa2ff('0x9f')](_0xa2ff('0xbc'),_0xccc3df[_0xa2ff('0x49')]['id']));}return _0x14b1af[_0xa2ff('0xfb')](_0xccc3df[_0xa2ff('0x50')][_0xa2ff('0x8e')]);})['then'](respondWithResult(_0x46d9a7,null))[_0xa2ff('0x51')](APIHandleError(_0x46d9a7));};exports['getTeams']=function(_0x5693d7,_0x5ccd5b){var _0x24ac62={};var _0x246054={};var _0x89508;var _0x521261;return db[_0xa2ff('0x31')][_0xa2ff('0x89')]({'where':{'id':_0x5693d7[_0xa2ff('0x49')]['id']}})[_0xa2ff('0x1c')](handleEntityNotFound(_0x5ccd5b,null))[_0xa2ff('0x1c')](function(_0x32c730){if(_0x32c730){_0x89508=_0x32c730;_0x246054[_0xa2ff('0xc7')]=_['keys'](db[_0xa2ff('0x103')]['rawAttributes']);_0x246054[_0xa2ff('0x3b')]=_[_0xa2ff('0xc4')](_0x5693d7[_0xa2ff('0x3b')]);_0x246054[_0xa2ff('0xc5')]=_['intersection'](_0x246054[_0xa2ff('0xc7')],_0x246054['query']);_0x24ac62[_0xa2ff('0x3f')]=_['intersection'](_0x246054['model'],qs[_0xa2ff('0xd0')](_0x5693d7[_0xa2ff('0x3b')][_0xa2ff('0xd0')]));_0x24ac62[_0xa2ff('0x3f')]=_0x24ac62[_0xa2ff('0x3f')]['length']?_0x24ac62[_0xa2ff('0x3f')]:_0x246054[_0xa2ff('0xc7')];_0x24ac62[_0xa2ff('0xc8')]=qs[_0xa2ff('0xc9')](_0x5693d7[_0xa2ff('0x3b')]['sort']);_0x24ac62[_0xa2ff('0xca')]=qs['filters'](_[_0xa2ff('0xcb')](_0x5693d7['query'],_0x246054['filters']));if(_0x5693d7[_0xa2ff('0x3b')]['filter']){_0x24ac62[_0xa2ff('0xca')]=_['merge'](_0x24ac62['where'],{'$or':_['map'](_0x24ac62[_0xa2ff('0x3f')],function(_0x3a3401){var _0x32a383={};_0x32a383[_0x3a3401]={'$like':'%'+_0x5693d7['query'][_0xa2ff('0x26')]+'%'};return _0x32a383;})});}_0x24ac62=_[_0xa2ff('0xcc')]({},_0x24ac62,_0x5693d7[_0xa2ff('0x4d')]);return _0x89508[_0xa2ff('0x104')](_0x24ac62);}})[_0xa2ff('0x1c')](function(_0xa2593){if(_0xa2593){_0x521261=_0xa2593[_0xa2ff('0x41')];if(!_0x5693d7[_0xa2ff('0x3b')][_0xa2ff('0xbd')]('nolimit')){_0x24ac62[_0xa2ff('0x17')]=qs['limit'](_0x5693d7[_0xa2ff('0x3b')]['limit']);_0x24ac62[_0xa2ff('0x19')]=qs[_0xa2ff('0x19')](_0x5693d7[_0xa2ff('0x3b')][_0xa2ff('0x19')]);}return _0x89508[_0xa2ff('0x104')](_0x24ac62);}})[_0xa2ff('0x1c')](function(_0x28d6b8){if(_0x28d6b8){return _0x28d6b8?{'count':_0x521261,'rows':_0x28d6b8}:null;}})['then'](respondWithResult(_0x5ccd5b,null))['catch'](handleError(_0x5ccd5b,null));};exports[_0xa2ff('0x105')]=function(_0xb0cec7,_0x50b9a5){var _0x16985f=_0xb0cec7[_0xa2ff('0x49')]['id'];var _0x47739d=_0xb0cec7[_0xa2ff('0x50')]?_0xb0cec7[_0xa2ff('0x50')][_0xa2ff('0x55')]:null;var _0x4a6e62=[];return Promise[_0xa2ff('0xf7')]()[_0xa2ff('0x1c')](function(){if(!_0x47739d)throw new APIBadRequestError(_0xa2ff('0x106'));})[_0xa2ff('0x1c')](function(){return db[_0xa2ff('0x31')][_0xa2ff('0x89')]({'where':{'id':_0x16985f}});})[_0xa2ff('0x1c')](function(_0x2fd850){if(!_0x2fd850)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0xb0cec7[_0xa2ff('0x49')]['id']));return db['sequelize']['transaction'](function(_0x383a07){return _0x2fd850[_0xa2ff('0x105')](_0x47739d,{'transaction':_0x383a07})[_0xa2ff('0x1c')](function(){return db[_0xa2ff('0x103')][_0xa2ff('0x7e')]({'where':{'id':{'$in':_0x47739d}}});})[_0xa2ff('0x1c')](function(_0x376036){var _0x450712=_[_0xa2ff('0x28')](_0x376036,function(_0x8e949){return _0x8e949[_0xa2ff('0x107')]();});return Promise[_0xa2ff('0x47')](_0x450712);})[_0xa2ff('0x1c')](function(_0x2983e4){_0x4a6e62=_[_0xa2ff('0x108')](_0x2983e4);var _0x329b49=_['map'](_0x4a6e62,function(_0x56334b){return _0x56334b[_0xa2ff('0x109')](_0x2fd850['id'],{'transaction':_0x383a07});});return Promise['all'](_0x329b49);})[_0xa2ff('0x1c')](function(){if(!_0x2fd850['online'])return;var _0x1e997c=_[_0xa2ff('0x26')](_0x4a6e62,function(_0x4440d2){return _0x4440d2[_0xa2ff('0x10a')](_0xa2ff('0x8e'))==='Voice';});var _0x3d35a9=_[_0xa2ff('0x28')](_0x1e997c,function(_0x336955){return db['UserVoiceQueueRt'][_0xa2ff('0xa0')]({'membername':_0x2fd850['name'],'UserId':_0x2fd850['id'],'queue_name':_0x336955[_0xa2ff('0x2f')],'VoiceQueueId':_0x336955['id'],'interface':_[_0xa2ff('0x5a')](_0x2fd850['interface'])?util[_0xa2ff('0x9f')]('SIP/%s',_0x2fd850[_0xa2ff('0x2f')]):_0x2fd850[_0xa2ff('0x9e')],'paused':_0x2fd850[_0xa2ff('0x91')]||![],'penalty':_0x2fd850[_0xa2ff('0x97')]},{'transaction':_0x383a07});});return Promise['all'](_0x3d35a9);})[_0xa2ff('0x1c')](function(){return db[_0xa2ff('0x10b')][_0xa2ff('0x7e')]({'where':{'teamId':{'$in':_0x47739d}}});})[_0xa2ff('0x1c')](function(_0x4733f7){var _0x2c5595=_['map'](_0x4733f7,function(_0x561fea){return db[_0xa2ff('0x10c')][_0xa2ff('0x7c')]({'UserId':_0x2fd850['id'],'VoicePrefixId':_0x561fea[_0xa2ff('0x10d')]},{'transaction':_0x383a07});});return Promise[_0xa2ff('0x47')](_0x2c5595);});});})['then'](function(){for(var _0x5a4de8=0x0;_0x5a4de8<_0x4a6e62[_0xa2ff('0x41')];_0x5a4de8++){var _0x4d0043=_0x4a6e62[_0x5a4de8][_0xa2ff('0x10a')](_0xa2ff('0x8e'));var _0xe0ec51=_0x4d0043+'QueueId';socket['emit'](_0xa2ff('0x70')+_0x4d0043+_0xa2ff('0x9b'),{'UserId':_0x16985f,['queueField']:_0x4a6e62[_0x5a4de8]['id']});}})[_0xa2ff('0x1c')](respondWithStatusCode(_0x50b9a5,null))[_0xa2ff('0x51')](APIHandleError(_0x50b9a5));};exports['removeTeams']=function(_0x89a954,_0x197c38){var _0x12ef7c=_0x89a954['params']['id'];var _0x406634=null;if(_0x89a954['query']['ids']){_0x406634=_['isArray'](_0x89a954['query']['ids'])?_0x89a954[_0xa2ff('0x3b')]['ids']:[_0x89a954['query'][_0xa2ff('0x55')]];}var _0x415425=[];return Promise[_0xa2ff('0xf7')]()['then'](function(){if(!_0x406634)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})['then'](function(){return db[_0xa2ff('0x31')][_0xa2ff('0x89')]({'where':{'id':_0x12ef7c}});})['then'](function(_0xd0d3c2){if(!_0xd0d3c2)throw new APINotFoundError(util[_0xa2ff('0x9f')](_0xa2ff('0xbc'),_0x89a954['params']['id']));return db[_0xa2ff('0x5c')]['transaction'](function(_0x36e871){return _0xd0d3c2[_0xa2ff('0x10e')](_0x406634,{'transaction':_0x36e871})[_0xa2ff('0x1c')](function(){return db[_0xa2ff('0x103')][_0xa2ff('0x7e')]({'where':{'id':{'$in':_0x406634}}});})[_0xa2ff('0x1c')](function(_0x11f104){var _0x2834cb=_[_0xa2ff('0x28')](_0x11f104,function(_0x33cc5d){return _0x33cc5d[_0xa2ff('0x107')]();});return Promise[_0xa2ff('0x47')](_0x2834cb);})[_0xa2ff('0x1c')](function(_0x4093d7){_0x415425=_[_0xa2ff('0x108')](_0x4093d7);var _0x1cc324=_[_0xa2ff('0x28')](_0x415425,function(_0x2c889d){return _0x2c889d['removeAgent'](_0xd0d3c2['id'],{'transaction':_0x36e871});});return Promise[_0xa2ff('0x47')](_0x1cc324);})['then'](function(){if(!_0xd0d3c2[_0xa2ff('0x8f')])return;var _0x522195=_[_0xa2ff('0x26')](_0x415425,function(_0x54f84e){return _0x54f84e[_0xa2ff('0x10a')](_0xa2ff('0x8e'))===_0xa2ff('0x10f');});var _0x1ec5b6=_[_0xa2ff('0x28')](_0x522195,function(_0x4a22a1){return db[_0xa2ff('0xa4')][_0xa2ff('0x20')]({'where':{'VoiceQueueId':_0x4a22a1['id'],'UserId':_0xd0d3c2['id']},'transaction':_0x36e871});});return Promise[_0xa2ff('0x47')](_0x1ec5b6);})['then'](function(){return db['TeamVoicePrefix'][_0xa2ff('0x7e')]({'where':{'teamId':{'$in':_0x406634}}});})[_0xa2ff('0x1c')](function(_0x52279c){var _0x31d96e=_[_0xa2ff('0x28')](_0x52279c,function(_0x494def){return db[_0xa2ff('0x10c')][_0xa2ff('0x20')]({'where':{'UserId':_0xd0d3c2['id'],'VoicePrefixId':_0x494def[_0xa2ff('0x10d')]}},{'transaction':_0x36e871});});return Promise[_0xa2ff('0x47')](_0x31d96e);});});})[_0xa2ff('0x1c')](function(){for(var _0x52541a=0x0;_0x52541a<_0x415425[_0xa2ff('0x41')];_0x52541a++){var _0x34d699=_0x415425[_0x52541a]['getDataValue']('channel');var _0x4d53f3=_0x34d699+_0xa2ff('0x99');socket[_0xa2ff('0x9a')](_0xa2ff('0x70')+_0x34d699+'Queue:remove',{'UserId':_0x12ef7c,['queueField']:_0x415425[_0x52541a]['id']});}})['then'](respondWithStatusCode(_0x197c38,null))[_0xa2ff('0x51')](APIHandleError(_0x197c38));};exports[_0xa2ff('0x110')]=function(_0x3019df,_0x8e44ae){var _0x3b4711={};var _0xd6d270={};var _0x2cb18b;var _0x3ba420;return db['User']['findOne']({'where':{'id':_0x3019df[_0xa2ff('0x49')]['id']}})[_0xa2ff('0x1c')](handleEntityNotFound(_0x8e44ae,null))[_0xa2ff('0x1c')](function(_0x3e6d18){if(_0x3e6d18){_0x2cb18b=_0x3e6d18;_0xd6d270[_0xa2ff('0xc7')]=_[_0xa2ff('0xc4')](db[_0xa2ff('0xbe')][_0xa2ff('0x32')]);_0xd6d270[_0xa2ff('0x3b')]=_[_0xa2ff('0xc4')](_0x3019df['query']);_0xd6d270[_0xa2ff('0xc5')]=_[_0xa2ff('0xc6')](_0xd6d270[_0xa2ff('0xc7')],_0xd6d270[_0xa2ff('0x3b')]);_0x3b4711['attributes']=_['intersection'](_0xd6d270[_0xa2ff('0xc7')],qs['fields'](_0x3019df['query']['fields']));_0x3b4711[_0xa2ff('0x3f')]=_0x3b4711[_0xa2ff('0x3f')][_0xa2ff('0x41')]?_0x3b4711[_0xa2ff('0x3f')]:_0xd6d270[_0xa2ff('0xc7')];_0x3b4711['order']=qs[_0xa2ff('0xc9')](_0x3019df['query'][_0xa2ff('0xc9')]);_0x3b4711[_0xa2ff('0xca')]=qs['filters'](_[_0xa2ff('0xcb')](_0x3019df['query'],_0xd6d270[_0xa2ff('0xc5')]));if(_0x3019df[_0xa2ff('0x3b')][_0xa2ff('0x26')]){_0x3b4711[_0xa2ff('0xca')]=_['merge'](_0x3b4711[_0xa2ff('0xca')],{'$or':_[_0xa2ff('0x28')](_0x3b4711[_0xa2ff('0x3f')],function(_0x45f80b){var _0x1e078={};_0x1e078[_0x45f80b]={'$like':'%'+_0x3019df[_0xa2ff('0x3b')]['filter']+'%'};return _0x1e078;})});}_0x3b4711=_[_0xa2ff('0xcc')]({},_0x3b4711,_0x3019df[_0xa2ff('0x4d')]);return _0x2cb18b[_0xa2ff('0x110')](_0x3b4711);}})[_0xa2ff('0x1c')](function(_0x42397e){if(_0x42397e){_0x3ba420=_0x42397e[_0xa2ff('0x41')];if(!_0x3019df[_0xa2ff('0x3b')][_0xa2ff('0xbd')]('nolimit')){_0x3b4711[_0xa2ff('0x17')]=qs['limit'](_0x3019df[_0xa2ff('0x3b')][_0xa2ff('0x17')]);_0x3b4711[_0xa2ff('0x19')]=qs[_0xa2ff('0x19')](_0x3019df[_0xa2ff('0x3b')][_0xa2ff('0x19')]);}return _0x2cb18b[_0xa2ff('0x110')](_0x3b4711);}})[_0xa2ff('0x1c')](function(_0x2ad485){if(_0x2ad485){return _0x2ad485?{'count':_0x3ba420,'rows':_0x2ad485}:null;}})[_0xa2ff('0x1c')](respondWithResult(_0x8e44ae,null))['catch'](handleError(_0x8e44ae,null));};exports[_0xa2ff('0x111')]=function(_0x411845,_0x1d1043){var _0x16a0d7={};var _0x3292d3={};var _0x44c46a;return db[_0xa2ff('0x31')][_0xa2ff('0x89')]({'where':{'id':_0x411845[_0xa2ff('0x49')]['id']}})[_0xa2ff('0x1c')](handleEntityNotFound(_0x1d1043,null))[_0xa2ff('0x1c')](function(_0x338fcc){if(_0x338fcc){_0x44c46a=_0x338fcc;_0x3292d3[_0xa2ff('0xc7')]=_[_0xa2ff('0xc4')](db[_0xa2ff('0x31')][_0xa2ff('0x32')]);_0x3292d3[_0xa2ff('0x3b')]=_[_0xa2ff('0xc4')](_0x411845['query']);_0x3292d3['filters']=_[_0xa2ff('0xc6')](_0x3292d3[_0xa2ff('0xc7')],_0x3292d3[_0xa2ff('0x3b')]);_0x16a0d7[_0xa2ff('0x3f')]=_['intersection'](_0x3292d3[_0xa2ff('0xc7')],qs[_0xa2ff('0xd0')](_0x411845['query'][_0xa2ff('0xd0')]));_0x16a0d7[_0xa2ff('0x3f')]=_0x16a0d7[_0xa2ff('0x3f')][_0xa2ff('0x41')]?_0x16a0d7['attributes']:_0x3292d3[_0xa2ff('0xc7')];_0x16a0d7[_0xa2ff('0xc8')]=qs['sort'](_0x411845[_0xa2ff('0x3b')][_0xa2ff('0xc9')]);_0x16a0d7[_0xa2ff('0xca')]=qs[_0xa2ff('0xc5')](_[_0xa2ff('0xcb')](_0x411845['query'],_0x3292d3[_0xa2ff('0xc5')]));if(_0x411845[_0xa2ff('0x3b')][_0xa2ff('0x26')]){_0x16a0d7[_0xa2ff('0xca')]=_[_0xa2ff('0xcc')](_0x16a0d7['where'],{'$or':_[_0xa2ff('0x28')](_0x16a0d7[_0xa2ff('0x3f')],function(_0x2aeecf){var _0x18f33a={};_0x18f33a[_0x2aeecf]={'$like':'%'+_0x411845[_0xa2ff('0x3b')]['filter']+'%'};return _0x18f33a;})});}_0x16a0d7['model']=db[_0xa2ff('0x31')];_0x16a0d7['as']=_0xa2ff('0x23');_0x16a0d7=_[_0xa2ff('0xcc')]({},_0x16a0d7,_0x411845[_0xa2ff('0x4d')]);return _0x44c46a[_0xa2ff('0xee')]({'include':[_0x16a0d7]});}})['then'](function(_0x5889e2){if(_0x5889e2){var _0x196d7b={},_0x14834b=[];for(var _0x5a30c2=0x0;_0x5a30c2<_0x5889e2[_0xa2ff('0x41')];_0x5a30c2+=0x1){for(var _0x2c35f5=0x0,_0x9945d5;_0x2c35f5<_0x5889e2[_0x5a30c2][_0xa2ff('0x23')][_0xa2ff('0x41')];_0x2c35f5+=0x1){_0x9945d5=_0x5889e2[_0x5a30c2][_0xa2ff('0x23')][_0x2c35f5]['get']({'plain':!![]});_0x196d7b[_0x9945d5['id']]=_0x9945d5;}}_0x196d7b=_[_0xa2ff('0x112')](_0x196d7b);for(var _0x20f550=qs['offset'](_0x411845[_0xa2ff('0x3b')][_0xa2ff('0x19')]);_0x20f550<_0x196d7b[_0xa2ff('0x41')]&&_0x14834b[_0xa2ff('0x41')]=_0x55eec6['agents']){throw new Error(_0x58e1('0x51'));}})[_0x58e1('0x17')](function(){if(_0x42227f){return db[_0x58e1('0x25')]['destroy']({'where':{'membername':_0x42227f[_0x58e1('0x20')]},'individualHooks':!![]});}})[_0x58e1('0x17')](function(){if(_0x42227f){return _0x42227f[_0x58e1('0x52')]({'raw':!![]});}})[_0x58e1('0x17')](function(_0x1e9b21){if(_0x42227f){if(_0x1e9b21){var _0xc6048a=[];_0x5cfe9f=_0x1e9b21;if(_0x5cfe9f[_0x58e1('0x28')]){for(var _0x36ca76=0x0;_0x36ca76<_0x5cfe9f['length'];_0x36ca76++){_0xc6048a[_0x58e1('0x2d')](db[_0x58e1('0x25')][_0x58e1('0x53')]({'membername':_0x42227f[_0x58e1('0x20')],'UserId':_0x42227f['id'],'queue_name':_0x5cfe9f[_0x36ca76]['name'],'VoiceQueueId':_0x5cfe9f[_0x36ca76]['id'],'interface':_0x58f93c,'paused':_0x42227f[_0x58e1('0x4b')]||![],'penalty':_0x5cfe9f[_0x36ca76][_0x58e1('0x54')]||0x0}));}return BPromise[_0x58e1('0x47')](_0xc6048a);}}}})[_0x58e1('0x17')](function(){if(_0x42227f){return db[_0x58e1('0x36')]['findAll']({'where':{'membername':_0x42227f[_0x58e1('0x20')],'exitAt':null}});}})[_0x58e1('0x17')](function(_0x91ec77){if(_0x42227f){if(_0x91ec77&&_0x91ec77[_0x58e1('0x28')]){var _0x577457=[];_0x91ec77['forEach'](function(_0x4d6f40){_0x577457['push'](_0x4d6f40[_0x58e1('0x26')]({'exitAt':moment()[_0x58e1('0x22')](_0x58e1('0x29'))}));});return BPromise[_0x58e1('0x47')](_0x577457);}}})[_0x58e1('0x17')](function(){if(_0x42227f){var _0xe813d0=[];var _0x1d23d8=[];var _0x4fa700=utils[_0x58e1('0x2b')]();var _0x1c82af={'membername':_0x42227f[_0x58e1('0x20')],'interface':_0x58f93c,'enterAt':moment()[_0x58e1('0x22')](_0x58e1('0x29')),'role':_0x42227f[_0x58e1('0x33')],'internal':_0x42227f[_0x58e1('0x34')]};_0x4fa700['forEach'](function(_0x548e0d){_0xe813d0[_0x58e1('0x2d')](_[_0x58e1('0x55')]({'channel':_0x548e0d,'type':_0x58e1('0x56'),'data1':'callysquare','data2':_0x58f93c},_0x1c82af));if(_0x42227f[_0x58e1('0x4b')]){_0x1d23d8[_0x58e1('0x2d')](_[_0x58e1('0x55')]({'channel':_0x548e0d,'type':_0x58e1('0x27'),'data1':'LOGININPAUSE'},_0x1c82af));}});return db[_0x58e1('0x36')][_0x58e1('0x57')](_0xe813d0[_0x58e1('0x58')](_0x1d23d8),{'individualHooks':!![]});}})[_0x58e1('0x17')](function(){if(_0x42227f){return _0x42227f['update']({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x42227f[_0x58e1('0x4b')]||![],'mailPause':_0x42227f[_0x58e1('0x4b')]||![],'chatPause':_0x42227f['loginInPause']||![],'faxPause':_0x42227f[_0x58e1('0x4b')]||![],'smsPause':_0x42227f['loginInPause']||![],'openchannelPause':_0x42227f['loginInPause']||![],'pauseType':_0x42227f[_0x58e1('0x4b')]?_0x58e1('0x59'):null,'lastPauseAt':moment()[_0x58e1('0x22')](_0x58e1('0x29')),'interface':_0x58f93c});}})['then'](function(_0x30aa7f){_0x20faf7(_0x30aa7f);})[_0x58e1('0x1e')](function(_0x417877){_0x2c8442(_0x4e08d4[_0x58e1('0x1c')](0x1f4,_0x417877['message']));});});}; \ No newline at end of file +var _0x343c=['error','message','ShowUser','User','find','stringify','catch','PauseUser','name','role','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','forEach','push','isNil','type','DEFAULT\x20PAUSE','body','uniqueid','bulkCreate','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','online','voicePause','chatPause','pauseType','lastPauseAt','unpause','system','LogoutUser','findOne','all','LoginUser','mobile','phone','SIP/%s','count','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','loginInPause','UserVoiceQueue.penalty','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','concat','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','register','findAll','options','raw','where','attributes','limit','include','map','model','then','info','GetUser','debug'];(function(_0x5dfbe8,_0x3ba7aa){var _0x5dc1aa=function(_0x2f6b30){while(--_0x2f6b30){_0x5dfbe8['push'](_0x5dfbe8['shift']());}};_0x5dc1aa(++_0x3ba7aa);}(_0x343c,0x19c));var _0xc343=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x343c[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xc343('0x0'));var moment=require(_0xc343('0x1'));var BPromise=require(_0xc343('0x2'));var Redis=require(_0xc343('0x3'));var db=require(_0xc343('0x4'))['db'];var utils=require(_0xc343('0x5'));var logger=require(_0xc343('0x6'))(_0xc343('0x7'));var config=require(_0xc343('0x8'));config[_0xc343('0x9')]=_[_0xc343('0xa')](config[_0xc343('0x9')],{'host':_0xc343('0xb'),'port':0x18eb});var socket=require(_0xc343('0xc'))(new Redis(config[_0xc343('0x9')]));require(_0xc343('0xd'))[_0xc343('0xe')](socket);exports['GetUser']=function(_0x178ba4){var _0x50acc1=this;return new Promise(function(_0x2a06bd,_0x3f255a){return db['User'][_0xc343('0xf')]({'raw':_0x178ba4[_0xc343('0x10')]?_0x178ba4[_0xc343('0x10')][_0xc343('0x11')]===undefined?!![]:![]:!![],'where':_0x178ba4['options']?_0x178ba4[_0xc343('0x10')][_0xc343('0x12')]||null:null,'attributes':_0x178ba4['options']?_0x178ba4[_0xc343('0x10')][_0xc343('0x13')]||null:null,'limit':_0x178ba4[_0xc343('0x10')]?_0x178ba4[_0xc343('0x10')][_0xc343('0x14')]||null:null,'include':_0x178ba4[_0xc343('0x10')]?_0x178ba4[_0xc343('0x10')][_0xc343('0x15')]?_[_0xc343('0x16')](_0x178ba4[_0xc343('0x10')]['include'],function(_0x3a36ff){return{'model':db[_0x3a36ff['model']],'as':_0x3a36ff['as'],'attributes':_0x3a36ff[_0xc343('0x13')],'include':_0x3a36ff['include']?_[_0xc343('0x16')](_0x3a36ff[_0xc343('0x15')],function(_0x478f3c){return{'model':db[_0x478f3c[_0xc343('0x17')]],'as':_0x478f3c['as'],'attributes':_0x478f3c[_0xc343('0x13')],'include':_0x478f3c[_0xc343('0x15')]?_[_0xc343('0x16')](_0x478f3c[_0xc343('0x15')],function(_0x445f4d){return{'model':db[_0x445f4d[_0xc343('0x17')]],'as':_0x445f4d['as'],'attributes':_0x445f4d[_0xc343('0x13')]};}):[]};}):[]};}):[]:[]})[_0xc343('0x18')](function(_0x3a9651){logger[_0xc343('0x19')](_0xc343('0x1a'),_0x178ba4);logger[_0xc343('0x1b')](_0xc343('0x1a'),_0x178ba4,JSON['stringify'](_0x3a9651));_0x2a06bd(_0x3a9651);})['catch'](function(_0x121d11){logger[_0xc343('0x1c')](_0xc343('0x1a'),_0x121d11['message'],_0x178ba4);_0x3f255a(_0x50acc1[_0xc343('0x1c')](0x1f4,_0x121d11[_0xc343('0x1d')]));});});};exports[_0xc343('0x1e')]=function(_0x5cf382){var _0x3be514=this;return new Promise(function(_0xe86d0a,_0xc7b000){return db[_0xc343('0x1f')][_0xc343('0x20')]({'raw':_0x5cf382[_0xc343('0x10')]?_0x5cf382[_0xc343('0x10')][_0xc343('0x11')]===undefined?!![]:![]:!![],'where':_0x5cf382[_0xc343('0x10')]?_0x5cf382[_0xc343('0x10')][_0xc343('0x12')]||null:null,'attributes':_0x5cf382[_0xc343('0x10')]?_0x5cf382['options'][_0xc343('0x13')]||null:null,'include':_0x5cf382[_0xc343('0x10')]?_0x5cf382['options']['include']?_[_0xc343('0x16')](_0x5cf382[_0xc343('0x10')]['include'],function(_0x50c90f){return{'model':db[_0x50c90f['model']],'as':_0x50c90f['as'],'attributes':_0x50c90f[_0xc343('0x13')],'include':_0x50c90f[_0xc343('0x15')]?_['map'](_0x50c90f[_0xc343('0x15')],function(_0x45c389){return{'model':db[_0x45c389[_0xc343('0x17')]],'as':_0x45c389['as'],'attributes':_0x45c389['attributes'],'include':_0x45c389['include']?_[_0xc343('0x16')](_0x45c389[_0xc343('0x15')],function(_0x214664){return{'model':db[_0x214664[_0xc343('0x17')]],'as':_0x214664['as'],'attributes':_0x214664['attributes']};}):[]};}):[]};}):[]:[]})[_0xc343('0x18')](function(_0x737892){logger[_0xc343('0x19')](_0xc343('0x1e'),_0x5cf382);logger[_0xc343('0x1b')]('ShowUser',_0x5cf382,JSON[_0xc343('0x21')](_0x737892));_0xe86d0a(_0x737892);})[_0xc343('0x22')](function(_0x3e65dd){logger[_0xc343('0x1c')](_0xc343('0x1e'),_0x3e65dd[_0xc343('0x1d')],_0x5cf382);_0xc7b000(_0x3be514['error'](0x1f4,_0x3e65dd[_0xc343('0x1d')]));});});};exports[_0xc343('0x23')]=function(_0x59cea4){var _0x2df6b7;return db['User']['find']({'where':_0x59cea4['options'][_0xc343('0x12')]||{},'attributes':['id',_0xc343('0x24'),_0xc343('0x25'),_0xc343('0x26'),_0xc343('0x27')]})[_0xc343('0x18')](function(_0x504fc6){if(!_0x504fc6){throw new Error(util[_0xc343('0x28')](_0xc343('0x29'),_0x59cea4[_0xc343('0x2a')]['id']));}_0x2df6b7=_0x504fc6;return db[_0xc343('0x2b')][_0xc343('0x2c')]({'paused':0x1},{'where':{'UserId':_0x2df6b7['id']},'individualHooks':!![]});})[_0xc343('0x18')](function(){return db[_0xc343('0x2d')][_0xc343('0xf')]({'where':{'membername':_0x2df6b7['name'],'type':_0xc343('0x2e'),'exitAt':null}});})[_0xc343('0x18')](function(_0x32cdad){if(_0x32cdad&&_0x32cdad[_0xc343('0x2f')]){var _0x23f080=moment()[_0xc343('0x28')](_0xc343('0x30'));for(var _0x33c34c=0x0,_0x24050c=_0x32cdad[_0xc343('0x2f')];_0x33c34c<_0x24050c;_0x33c34c++){_0x32cdad[_0x33c34c]['updateAttributes']({'exitAt':_0x23f080});}}})[_0xc343('0x18')](function(){var _0x476f3d=[];var _0x266c8a=utils['getChannels']();_0x266c8a[_0xc343('0x31')](function(_0x52d25c){_0x476f3d[_0xc343('0x32')]({'channel':_0x52d25c,'membername':_0x2df6b7[_0xc343('0x24')],'interface':_[_0xc343('0x33')](_0x2df6b7[_0xc343('0x27')])?util[_0xc343('0x28')]('SIP/%s',_0x2df6b7[_0xc343('0x24')]):_0x2df6b7[_0xc343('0x27')],'type':_0xc343('0x2e'),'enterAt':moment()['format'](_0xc343('0x30')),'data1':_0x59cea4['body'][_0xc343('0x34')]||_0xc343('0x35'),'role':_0x2df6b7[_0xc343('0x25')],'internal':_0x2df6b7[_0xc343('0x26')],'uniqueid':_0x59cea4[_0xc343('0x36')][_0xc343('0x37')]||null});});return db[_0xc343('0x2d')][_0xc343('0x38')](_0x476f3d,{'individualHooks':!![]});})['then'](function(){return _0x2df6b7[_0xc343('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x59cea4[_0xc343('0x36')][_0xc343('0x34')]||_0xc343('0x35'),'lastPauseAt':moment()[_0xc343('0x28')](_0xc343('0x30'))});})[_0xc343('0x22')](function(_0x45e7f2){throw _0x45e7f2;});};exports['UnpauseUser']=function(_0xa532a7){return Promise[_0xc343('0x39')]()['then'](function(){if(_0xa532a7['body'][_0xc343('0x3a')]&&!utils[_0xc343('0x3b')](_0xa532a7[_0xc343('0x36')][_0xc343('0x3a')])){throw new Error(util[_0xc343('0x28')](_0xc343('0x3c'),_0xa532a7[_0xc343('0x36')][_0xc343('0x3a')]));}return db[_0xc343('0x1f')]['findOne']({'where':_0xa532a7['options'][_0xc343('0x12')]||{},'attributes':['id',_0xc343('0x24'),_0xc343('0x25'),_0xc343('0x26'),_0xc343('0x27'),_0xc343('0x3d'),_0xc343('0x3e'),'mailPause',_0xc343('0x3f'),'faxPause','openchannelPause','smsPause','whatsappPause',_0xc343('0x40'),_0xc343('0x41')]});})['then'](function(_0x3708d0){if(!_0x3708d0){throw new Error(util['format'](_0xc343('0x29'),_0xa532a7['params']['id']));}return _0x3708d0[_0xc343('0x42')](_0xa532a7[_0xc343('0x36')][_0xc343('0x3a')],_0xc343('0x43'));})[_0xc343('0x22')](function(_0x5a4e00){throw _0x5a4e00;});};exports[_0xc343('0x44')]=function(_0x1efd21){var _0x544b1f=this;return new Promise(function(_0x11fd5d,_0x52319a){var _0x2a89d8;return db[_0xc343('0x1f')][_0xc343('0x45')]({'where':_0x1efd21[_0xc343('0x10')][_0xc343('0x12')]||{},'attributes':['id',_0xc343('0x24')]})[_0xc343('0x18')](function(_0x505db3){if(_0x505db3){_0x2a89d8=_0x505db3;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x2a89d8[_0xc343('0x24')]},'individualHooks':!![]});}})[_0xc343('0x18')](function(){if(_0x2a89d8){return db[_0xc343('0x2d')][_0xc343('0xf')]({'where':{'membername':_0x2a89d8[_0xc343('0x24')],'exitAt':null}});}})[_0xc343('0x18')](function(_0x455ee2){if(_0x2a89d8){if(_0x455ee2&&_0x455ee2[_0xc343('0x2f')]){var _0xa6f04f=[];_0x455ee2[_0xc343('0x31')](function(_0x51c89c){_0xa6f04f[_0xc343('0x32')](_0x51c89c[_0xc343('0x2c')]({'exitAt':moment()[_0xc343('0x28')](_0xc343('0x30'))}));});return BPromise[_0xc343('0x46')](_0xa6f04f);}}})['then'](function(){if(_0x2a89d8){return _0x2a89d8[_0xc343('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xc343('0x18')](function(_0x365028){_0x11fd5d(_0x365028);})[_0xc343('0x22')](function(_0x5b3476){_0x52319a(_0x544b1f[_0xc343('0x1c')](0x1f4,_0x5b3476[_0xc343('0x1d')]));});});};exports[_0xc343('0x47')]=function(_0x431c91){var _0x16e9e4=this;return new Promise(function(_0x33257f,_0x10b920){var _0x476502;var _0x2f6171;var _0xed28f1;var _0x369a4c;return db['User'][_0xc343('0x45')]({'where':_0x431c91[_0xc343('0x10')][_0xc343('0x12')]||{},'attributes':['id','name','role',_0xc343('0x48'),_0xc343('0x49'),'internal','loginInPause',_0xc343('0x27')]})[_0xc343('0x18')](function(_0x1f71fa){if(_0x1f71fa){_0x476502=_0x1f71fa;_0x369a4c=_0x431c91[_0xc343('0x36')]['interface']?_0x431c91[_0xc343('0x36')][_0xc343('0x27')]:util[_0xc343('0x28')](_0xc343('0x4a'),_0x476502[_0xc343('0x24')]);return db['User'][_0xc343('0x4b')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x476502['id']}}});}})[_0xc343('0x18')](function(_0x15f8ca){if(_0x15f8ca){_0xed28f1=_0x15f8ca;return require('../../config/license/util')[_0xc343('0x4c')]();}})[_0xc343('0x18')](function(_0x51890e){if(_0x51890e&&_0x51890e[_0xc343('0x4d')]&&_0xed28f1>=_0x51890e[_0xc343('0x4d')]){throw new Error(_0xc343('0x4e'));}})[_0xc343('0x18')](function(){if(_0x476502){return db[_0xc343('0x2b')]['destroy']({'where':{'membername':_0x476502['name']},'individualHooks':!![]});}})[_0xc343('0x18')](function(){if(_0x476502){return _0x476502[_0xc343('0x4f')]({'raw':!![]});}})['then'](function(_0x59961f){if(_0x476502){if(_0x59961f){var _0x15886a=[];_0x2f6171=_0x59961f;if(_0x2f6171[_0xc343('0x2f')]){for(var _0x5d53d6=0x0;_0x5d53d6<_0x2f6171['length'];_0x5d53d6++){_0x15886a[_0xc343('0x32')](db[_0xc343('0x2b')]['upsert']({'membername':_0x476502[_0xc343('0x24')],'UserId':_0x476502['id'],'queue_name':_0x2f6171[_0x5d53d6][_0xc343('0x24')],'VoiceQueueId':_0x2f6171[_0x5d53d6]['id'],'interface':_0x369a4c,'paused':_0x476502[_0xc343('0x50')]||![],'penalty':_0x2f6171[_0x5d53d6][_0xc343('0x51')]||0x0}));}return BPromise[_0xc343('0x46')](_0x15886a);}}}})[_0xc343('0x18')](function(){if(_0x476502){return db[_0xc343('0x2d')][_0xc343('0xf')]({'where':{'membername':_0x476502[_0xc343('0x24')],'exitAt':null}});}})[_0xc343('0x18')](function(_0x1623b3){if(_0x476502){if(_0x1623b3&&_0x1623b3['length']){var _0x28eeb2=[];_0x1623b3[_0xc343('0x31')](function(_0x57cb74){_0x28eeb2[_0xc343('0x32')](_0x57cb74[_0xc343('0x2c')]({'exitAt':moment()[_0xc343('0x28')](_0xc343('0x30'))}));});return BPromise['all'](_0x28eeb2);}}})[_0xc343('0x18')](function(){if(_0x476502){var _0x42f5a4=[];var _0x2f1355=[];var _0x352363=utils[_0xc343('0x52')]();var _0x271999={'membername':_0x476502[_0xc343('0x24')],'interface':_0x369a4c,'enterAt':moment()[_0xc343('0x28')](_0xc343('0x30')),'role':_0x476502[_0xc343('0x25')],'internal':_0x476502['internal']};_0x352363[_0xc343('0x31')](function(_0x5c2df8){_0x42f5a4[_0xc343('0x32')](_[_0xc343('0x53')]({'channel':_0x5c2df8,'type':_0xc343('0x54'),'data1':_0xc343('0x55'),'data2':_0x369a4c},_0x271999));if(_0x476502[_0xc343('0x50')]){_0x2f1355[_0xc343('0x32')](_[_0xc343('0x53')]({'channel':_0x5c2df8,'type':_0xc343('0x2e'),'data1':_0xc343('0x56')},_0x271999));}});return db['MemberReport'][_0xc343('0x38')](_0x42f5a4[_0xc343('0x57')](_0x2f1355),{'individualHooks':!![]});}})['then'](function(){if(_0x476502){return _0x476502[_0xc343('0x2c')]({'online':!![],'lastLoginAt':moment()['format'](_0xc343('0x30')),'voicePause':_0x476502['loginInPause']||![],'mailPause':_0x476502[_0xc343('0x50')]||![],'chatPause':_0x476502[_0xc343('0x50')]||![],'faxPause':_0x476502[_0xc343('0x50')]||![],'smsPause':_0x476502[_0xc343('0x50')]||![],'openchannelPause':_0x476502[_0xc343('0x50')]||![],'pauseType':_0x476502['loginInPause']?_0xc343('0x56'):null,'lastPauseAt':moment()[_0xc343('0x28')](_0xc343('0x30')),'interface':_0x369a4c});}})['then'](function(_0x11ec7c){_0x33257f(_0x11ec7c);})[_0xc343('0x22')](function(_0x1e52b7){_0x10b920(_0x16e9e4['error'](0x1f4,_0x1e52b7[_0xc343('0x1d')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index f7d3ac8..971635d 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 _0x3163=['remove','update','emit','user:','./user.events'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0x3163,0x149));var _0x3316=function(_0x1fb5db,_0x5eec00){_0x1fb5db=_0x1fb5db-0x0;var _0x59df5c=_0x3163[_0x1fb5db];return _0x59df5c;};'use strict';var UserEvents=require(_0x3316('0x0'));var events=['save',_0x3316('0x1'),_0x3316('0x2')];function createListener(_0x251f41,_0x43be32){return function(_0x5981ab){_0x43be32[_0x3316('0x3')](_0x251f41,_0x5981ab);};}function removeListener(_0x349c1b,_0x5bb75a){return function(){UserEvents['removeListener'](_0x349c1b,_0x5bb75a);};}exports['register']=function(_0x3f0d29){for(var _0x8b569d=0x0,_0x35f6aa=events['length'];_0x8b569d<_0x35f6aa;_0x8b569d++){var _0x174f45=events[_0x8b569d];var _0x4661d1=createListener(_0x3316('0x4')+_0x174f45,_0x3f0d29);UserEvents['on'](_0x174f45,_0x4661d1);}}; \ No newline at end of file +var _0xf260=['./user.events','save','update','emit','removeListener','register','length','user:'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf260,0x80));var _0x0f26=function(_0x228a4a,_0x23d65e){_0x228a4a=_0x228a4a-0x0;var _0x3d3937=_0xf260[_0x228a4a];return _0x3d3937;};'use strict';var UserEvents=require(_0x0f26('0x0'));var events=[_0x0f26('0x1'),'remove',_0x0f26('0x2')];function createListener(_0x2d7914,_0x43c868){return function(_0x30561e){_0x43c868[_0x0f26('0x3')](_0x2d7914,_0x30561e);};}function removeListener(_0x50065c,_0x577fca){return function(){UserEvents[_0x0f26('0x4')](_0x50065c,_0x577fca);};}exports[_0x0f26('0x5')]=function(_0x116145){for(var _0x168c6b=0x0,_0x3a8b11=events[_0x0f26('0x6')];_0x168c6b<_0x3a8b11;_0x168c6b++){var _0x267917=events[_0x168c6b];var _0x131e6f=createListener(_0x0f26('0x7')+_0x267917,_0x116145);UserEvents['on'](_0x267917,_0x131e6f);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index d0ba5b7..fea2586 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4da886,_0x4b6e85){var _0xd86f03=function(_0x2a8d81){while(--_0x2a8d81){_0x4da886['push'](_0x4da886['shift']());}};_0xd86f03(++_0x4b6e85);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x534b0c,_0x17e0d3){var _0x570be4=function(_0x3d63e3){while(--_0x3d63e3){_0x534b0c['push'](_0x534b0c['shift']());}};_0x570be4(++_0x17e0d3);}(_0xe706,0xa3));var _0x6e70=function(_0x41d02a,_0x355e19){_0x41d02a=_0x41d02a-0x0;var _0x4c3983=_0xe706[_0x41d02a];return _0x4c3983;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index f9dedb0..e81b782 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 _0x760d=['exports','INTEGER','sequelize'];(function(_0x1bd6fa,_0x22d856){var _0x1ec425=function(_0x1005a3){while(--_0x1005a3){_0x1bd6fa['push'](_0x1bd6fa['shift']());}};_0x1ec425(++_0x22d856);}(_0x760d,0x113));var _0xd760=function(_0x161400,_0x3feb33){_0x161400=_0x161400-0x0;var _0x43b0f9=_0x760d[_0x161400];return _0x43b0f9;};'use strict';var Sequelize=require(_0xd760('0x0'));module[_0xd760('0x1')]={'penalty':{'type':Sequelize[_0xd760('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xaa3c=['exports','INTEGER','sequelize'];(function(_0x2bfa86,_0x34bb3c){var _0xf15627=function(_0x3a930d){while(--_0x3a930d){_0x2bfa86['push'](_0x2bfa86['shift']());}};_0xf15627(++_0x34bb3c);}(_0xaa3c,0xb3));var _0xcaa3=function(_0xf8118f,_0x4a1087){_0xf8118f=_0xf8118f-0x0;var _0x8018c5=_0xaa3c[_0xf8118f];return _0x8018c5;};'use strict';var Sequelize=require(_0xcaa3('0x0'));module[_0xcaa3('0x1')]={'penalty':{'type':Sequelize[_0xcaa3('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 c32aab8..0c25c0d 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 _0xec2b=['define','UserChatQueue','user_has_chat_queues','api','moment','bluebird','rimraf','../../config/environment','./userChatQueue.attributes','exports'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0xec2b,0x14d));var _0xbec2=function(_0x5bb304,_0x40b9d2){_0x5bb304=_0x5bb304-0x0;var _0x2e2026=_0xec2b[_0x5bb304];return _0x2e2026;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbec2('0x0'));var moment=require(_0xbec2('0x1'));var BPromise=require(_0xbec2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbec2('0x3'));var config=require(_0xbec2('0x4'));var attributes=require(_0xbec2('0x5'));module[_0xbec2('0x6')]=function(_0x1c8ede,_0x2e8a71){return _0x1c8ede[_0xbec2('0x7')](_0xbec2('0x8'),attributes,{'tableName':_0xbec2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd9d=['bluebird','request-promise','path','rimraf','./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0x44f0a1,_0x457d11){var _0x4af42e=function(_0x15fcbf){while(--_0x15fcbf){_0x44f0a1['push'](_0x44f0a1['shift']());}};_0x4af42e(++_0x457d11);}(_0xbd9d,0x1b5));var _0xdbd9=function(_0x35f4f8,_0x578df6){_0x35f4f8=_0x35f4f8-0x0;var _0x5f4a22=_0xbd9d[_0x35f4f8];return _0x5f4a22;};'use strict';var _=require(_0xdbd9('0x0'));var util=require(_0xdbd9('0x1'));var logger=require(_0xdbd9('0x2'))(_0xdbd9('0x3'));var moment=require(_0xdbd9('0x4'));var BPromise=require(_0xdbd9('0x5'));var rp=require(_0xdbd9('0x6'));var fs=require('fs');var path=require(_0xdbd9('0x7'));var rimraf=require(_0xdbd9('0x8'));var config=require('../../config/environment');var attributes=require(_0xdbd9('0x9'));module[_0xdbd9('0xa')]=function(_0x3b1999,_0xba102f){return _0x3b1999['define'](_0xdbd9('0xb'),attributes,{'tableName':_0xdbd9('0xc'),'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 6178cc5..5bafb9a 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 _0xc1ae=['UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4d4a58,_0x2bcaf6){var _0x531989=function(_0x26e691){while(--_0x26e691){_0x4d4a58['push'](_0x4d4a58['shift']());}};_0x531989(++_0x2bcaf6);}(_0xc1ae,0x84));var _0xec1a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc1ae[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xec1a('0x0'));var util=require('util');var moment=require(_0xec1a('0x1'));var BPromise=require(_0xec1a('0x2'));var rs=require(_0xec1a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec1a('0x4'))['db'];var utils=require(_0xec1a('0x5'));var logger=require('../../config/logger')(_0xec1a('0x6'));var config=require(_0xec1a('0x7'));var jayson=require(_0xec1a('0x8'));var client=jayson[_0xec1a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7787a1,_0x536bc4,_0x4f1509){return new BPromise(function(_0x458d80,_0x3c0937){return client['request'](_0x7787a1,_0x4f1509)[_0xec1a('0xa')](function(_0x2b08ae){logger[_0xec1a('0xb')](_0xec1a('0xc'),_0x536bc4,_0xec1a('0xd'));logger[_0xec1a('0xe')](_0xec1a('0xf'),_0x536bc4,'request\x20sent',JSON['stringify'](_0x2b08ae));if(_0x2b08ae[_0xec1a('0x10')]){if(_0x2b08ae[_0xec1a('0x10')][_0xec1a('0x11')]===0x1f4){logger['error'](_0xec1a('0xc'),_0x536bc4,_0x2b08ae[_0xec1a('0x10')][_0xec1a('0x12')]);return _0x3c0937(_0x2b08ae['error'][_0xec1a('0x12')]);}logger[_0xec1a('0x10')](_0xec1a('0xc'),_0x536bc4,_0x2b08ae['error'][_0xec1a('0x12')]);return _0x458d80(_0x2b08ae[_0xec1a('0x10')]['message']);}else{logger['info'](_0xec1a('0xc'),_0x536bc4,_0xec1a('0xd'));_0x458d80(_0x2b08ae[_0xec1a('0x13')][_0xec1a('0x12')]);}})[_0xec1a('0x14')](function(_0x39c471){logger[_0xec1a('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x536bc4,_0x39c471);_0x3c0937(_0x39c471);});});} \ No newline at end of file +var _0x7eab=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7eab,0x1b2));var _0xb7ea=function(_0x66a21e,_0x102645){_0x66a21e=_0x66a21e-0x0;var _0x4fa0a4=_0x7eab[_0x66a21e];return _0x4fa0a4;};'use strict';var _=require(_0xb7ea('0x0'));var util=require(_0xb7ea('0x1'));var moment=require('moment');var BPromise=require(_0xb7ea('0x2'));var rs=require(_0xb7ea('0x3'));var fs=require('fs');var Redis=require(_0xb7ea('0x4'));var db=require(_0xb7ea('0x5'))['db'];var utils=require(_0xb7ea('0x6'));var logger=require(_0xb7ea('0x7'))(_0xb7ea('0x8'));var config=require(_0xb7ea('0x9'));var jayson=require(_0xb7ea('0xa'));var client=jayson[_0xb7ea('0xb')][_0xb7ea('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x196d1a,_0x3e76ed,_0x2ace9f){return new BPromise(function(_0x9bfff1,_0x17ada9){return client[_0xb7ea('0xd')](_0x196d1a,_0x2ace9f)[_0xb7ea('0xe')](function(_0xe218b9){logger[_0xb7ea('0xf')](_0xb7ea('0x10'),_0x3e76ed,_0xb7ea('0x11'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x3e76ed,_0xb7ea('0x11'),JSON[_0xb7ea('0x12')](_0xe218b9));if(_0xe218b9[_0xb7ea('0x13')]){if(_0xe218b9[_0xb7ea('0x13')][_0xb7ea('0x14')]===0x1f4){logger[_0xb7ea('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x3e76ed,_0xe218b9['error'][_0xb7ea('0x15')]);return _0x17ada9(_0xe218b9['error'][_0xb7ea('0x15')]);}logger[_0xb7ea('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x3e76ed,_0xe218b9[_0xb7ea('0x13')][_0xb7ea('0x15')]);return _0x9bfff1(_0xe218b9[_0xb7ea('0x13')][_0xb7ea('0x15')]);}else{logger[_0xb7ea('0xf')](_0xb7ea('0x10'),_0x3e76ed,_0xb7ea('0x11'));_0x9bfff1(_0xe218b9[_0xb7ea('0x16')]['message']);}})[_0xb7ea('0x17')](function(_0x3ebc47){logger[_0xb7ea('0x13')](_0xb7ea('0x10'),_0x3e76ed,_0x3ebc47);_0x17ada9(_0x3ebc47);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index e048794..3a4579f 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2a9d8b,_0x144d15){var _0x355243=function(_0x5948a2){while(--_0x5948a2){_0x2a9d8b['push'](_0x2a9d8b['shift']());}};_0x355243(++_0x144d15);}(_0x70e0,0x17b));var _0x070e=function(_0x10113e,_0x2c6861){_0x10113e=_0x10113e-0x0;var _0x2051d4=_0x70e0[_0x10113e];return _0x2051d4;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xac218e,_0x4a3a42){var _0x513b6d=function(_0x9155fa){while(--_0x9155fa){_0xac218e['push'](_0xac218e['shift']());}};_0x513b6d(++_0x4a3a42);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 14e9c93..d4645de 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 _0xbf49=['exports','INTEGER','STRING','sequelize'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xbf49,0x1eb));var _0x9bf4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf49[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9bf4('0x0'));module[_0x9bf4('0x1')]={'penalty':{'type':Sequelize[_0x9bf4('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9bf4('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x9bf4('0x3')]}}; \ No newline at end of file +var _0x7d3f=['STRING','sequelize','INTEGER'];(function(_0x4a9d70,_0x47fbb5){var _0x11b3a6=function(_0x33b721){while(--_0x33b721){_0x4a9d70['push'](_0x4a9d70['shift']());}};_0x11b3a6(++_0x47fbb5);}(_0x7d3f,0x175));var _0xf7d3=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x7d3f[_0x2b5eae];return _0x5f3ac9;};'use strict';var Sequelize=require(_0xf7d3('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xf7d3('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf7d3('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xf7d3('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 2d4eea1..8871d42 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 _0x9891=['rimraf','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x5b1939,_0x5b2646){var _0x4b7f01=function(_0x3d971d){while(--_0x3d971d){_0x5b1939['push'](_0x5b1939['shift']());}};_0x4b7f01(++_0x5b2646);}(_0x9891,0x1c0));var _0x1989=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0x9891[_0x26b8b5];return _0x2150a9;};'use strict';var _=require(_0x1989('0x0'));var util=require(_0x1989('0x1'));var logger=require('../../config/logger')(_0x1989('0x2'));var moment=require(_0x1989('0x3'));var BPromise=require(_0x1989('0x4'));var rp=require(_0x1989('0x5'));var fs=require('fs');var path=require(_0x1989('0x6'));var rimraf=require(_0x1989('0x7'));var config=require(_0x1989('0x8'));var attributes=require('./userFaxQueue.attributes');module[_0x1989('0x9')]=function(_0x3cd0ca,_0x145ac4){return _0x3cd0ca[_0x1989('0xa')](_0x1989('0xb'),attributes,{'tableName':_0x1989('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b8c=['request-promise','path','rimraf','exports','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','moment','bluebird'];(function(_0xafb8e6,_0x4b3a6b){var _0x36eec3=function(_0x30af02){while(--_0x30af02){_0xafb8e6['push'](_0xafb8e6['shift']());}};_0x36eec3(++_0x4b3a6b);}(_0x4b8c,0x10f));var _0xc4b8=function(_0xac7ae2,_0x449f86){_0xac7ae2=_0xac7ae2-0x0;var _0x1b0092=_0x4b8c[_0xac7ae2];return _0x1b0092;};'use strict';var _=require(_0xc4b8('0x0'));var util=require('util');var logger=require(_0xc4b8('0x1'))('api');var moment=require(_0xc4b8('0x2'));var BPromise=require(_0xc4b8('0x3'));var rp=require(_0xc4b8('0x4'));var fs=require('fs');var path=require(_0xc4b8('0x5'));var rimraf=require(_0xc4b8('0x6'));var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module[_0xc4b8('0x7')]=function(_0x337ac7,_0x3944e4){return _0x337ac7[_0xc4b8('0x8')](_0xc4b8('0x9'),attributes,{'tableName':_0xc4b8('0xa'),'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 1876ddd..4d3db95 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 _0xc7d6=['http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x273717,_0x2c1c10){var _0x313ed2=function(_0x360dbc){while(--_0x360dbc){_0x273717['push'](_0x273717['shift']());}};_0x313ed2(++_0x2c1c10);}(_0xc7d6,0x1ac));var _0x6c7d=function(_0x22ca55,_0x4d2a17){_0x22ca55=_0x22ca55-0x0;var _0x191044=_0xc7d6[_0x22ca55];return _0x191044;};'use strict';var _=require(_0x6c7d('0x0'));var util=require(_0x6c7d('0x1'));var moment=require(_0x6c7d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c7d('0x3'));var db=require(_0x6c7d('0x4'))['db'];var utils=require(_0x6c7d('0x5'));var logger=require(_0x6c7d('0x6'))(_0x6c7d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6c7d('0x8')][_0x6c7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bb779,_0x5c289e,_0x569e67){return new BPromise(function(_0x384408,_0x50033e){return client[_0x6c7d('0xa')](_0x2bb779,_0x569e67)['then'](function(_0x5bb110){logger[_0x6c7d('0xb')](_0x6c7d('0xc'),_0x5c289e,_0x6c7d('0xd'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x5c289e,_0x6c7d('0xd'),JSON[_0x6c7d('0xe')](_0x5bb110));if(_0x5bb110['error']){if(_0x5bb110[_0x6c7d('0xf')][_0x6c7d('0x10')]===0x1f4){logger[_0x6c7d('0xf')](_0x6c7d('0xc'),_0x5c289e,_0x5bb110[_0x6c7d('0xf')][_0x6c7d('0x11')]);return _0x50033e(_0x5bb110[_0x6c7d('0xf')][_0x6c7d('0x11')]);}logger[_0x6c7d('0xf')](_0x6c7d('0xc'),_0x5c289e,_0x5bb110[_0x6c7d('0xf')][_0x6c7d('0x11')]);return _0x384408(_0x5bb110[_0x6c7d('0xf')][_0x6c7d('0x11')]);}else{logger['info'](_0x6c7d('0xc'),_0x5c289e,_0x6c7d('0xd'));_0x384408(_0x5bb110[_0x6c7d('0x12')][_0x6c7d('0x11')]);}})['catch'](function(_0x21d077){logger[_0x6c7d('0xf')](_0x6c7d('0xc'),_0x5c289e,_0x21d077);_0x50033e(_0x21d077);});});} \ No newline at end of file +var _0x408b=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','error','code','UserFaxQueue,\x20%s,\x20%s','message','result'];(function(_0x5207b3,_0x2034d3){var _0x487c33=function(_0x3d0ddc){while(--_0x3d0ddc){_0x5207b3['push'](_0x5207b3['shift']());}};_0x487c33(++_0x2034d3);}(_0x408b,0x1e6));var _0xb408=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x408b[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb408('0x0'));var BPromise=require('bluebird');var rs=require(_0xb408('0x1'));var fs=require('fs');var Redis=require(_0xb408('0x2'));var db=require(_0xb408('0x3'))['db'];var utils=require(_0xb408('0x4'));var logger=require(_0xb408('0x5'))('rpc');var config=require(_0xb408('0x6'));var jayson=require(_0xb408('0x7'));var client=jayson['client'][_0xb408('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x365d20,_0x28038b,_0x1c28ae){return new BPromise(function(_0x23dac4,_0xafe394){return client[_0xb408('0x9')](_0x365d20,_0x1c28ae)[_0xb408('0xa')](function(_0x589e19){logger[_0xb408('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x28038b,_0xb408('0xc'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x28038b,_0xb408('0xc'),JSON['stringify'](_0x589e19));if(_0x589e19[_0xb408('0xd')]){if(_0x589e19[_0xb408('0xd')][_0xb408('0xe')]===0x1f4){logger['error'](_0xb408('0xf'),_0x28038b,_0x589e19[_0xb408('0xd')][_0xb408('0x10')]);return _0xafe394(_0x589e19[_0xb408('0xd')][_0xb408('0x10')]);}logger[_0xb408('0xd')](_0xb408('0xf'),_0x28038b,_0x589e19[_0xb408('0xd')]['message']);return _0x23dac4(_0x589e19[_0xb408('0xd')][_0xb408('0x10')]);}else{logger[_0xb408('0xb')](_0xb408('0xf'),_0x28038b,'request\x20sent');_0x23dac4(_0x589e19[_0xb408('0x11')][_0xb408('0x10')]);}})['catch'](function(_0x50d17d){logger[_0xb408('0xd')](_0xb408('0xf'),_0x28038b,_0x50d17d);_0xafe394(_0x50d17d);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 1c94a8d..f1139f7 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x21d4c1,_0x1042d8){var _0x440412=function(_0x4d96c7){while(--_0x4d96c7){_0x21d4c1['push'](_0x21d4c1['shift']());}};_0x440412(++_0x1042d8);}(_0xe706,0xa3));var _0x6e70=function(_0x27097a,_0x1b7f8b){_0x27097a=_0x27097a-0x0;var _0x26378b=_0xe706[_0x27097a];return _0x26378b;};'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(_0x39dc6a,_0x42f379){var _0x1aed2f=function(_0x5cefb5){while(--_0x5cefb5){_0x39dc6a['push'](_0x39dc6a['shift']());}};_0x1aed2f(++_0x42f379);}(_0xe706,0xa3));var _0x6e70=function(_0x456904,_0x4cb25c){_0x456904=_0x456904-0x0;var _0x4b0063=_0xe706[_0x456904];return _0x4b0063;};'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 412e0bf..8ea99f2 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 _0x243b=['INTEGER','exports'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x243b,0xb1));var _0xb243=function(_0x2ad50a,_0x170f2f){_0x2ad50a=_0x2ad50a-0x0;var _0x3d6a63=_0x243b[_0x2ad50a];return _0x3d6a63;};'use strict';var Sequelize=require('sequelize');module[_0xb243('0x0')]={'penalty':{'type':Sequelize[_0xb243('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5845=['exports','INTEGER','sequelize'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0x5845,0x80));var _0x5584=function(_0x49ade0,_0x29ebe4){_0x49ade0=_0x49ade0-0x0;var _0x34b9d2=_0x5845[_0x49ade0];return _0x34b9d2;};'use strict';var Sequelize=require(_0x5584('0x0'));module[_0x5584('0x1')]={'penalty':{'type':Sequelize[_0x5584('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 b927bdc..8dd67f1 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 _0xfc61=['moment','bluebird','request-promise','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','api'];(function(_0x478e89,_0x9d1545){var _0x4eb4e5=function(_0x51790b){while(--_0x51790b){_0x478e89['push'](_0x478e89['shift']());}};_0x4eb4e5(++_0x9d1545);}(_0xfc61,0xcd));var _0x1fc6=function(_0x40bbf5,_0x20da60){_0x40bbf5=_0x40bbf5-0x0;var _0x572ca7=_0xfc61[_0x40bbf5];return _0x572ca7;};'use strict';var _=require(_0x1fc6('0x0'));var util=require(_0x1fc6('0x1'));var logger=require(_0x1fc6('0x2'))(_0x1fc6('0x3'));var moment=require(_0x1fc6('0x4'));var BPromise=require(_0x1fc6('0x5'));var rp=require(_0x1fc6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1fc6('0x7'));module[_0x1fc6('0x8')]=function(_0x45a91c,_0x259f0e){return _0x45a91c[_0x1fc6('0x9')](_0x1fc6('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf77=['moment','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','api'];(function(_0x33aaed,_0x11dd47){var _0x11f6e7=function(_0x582b84){while(--_0x582b84){_0x33aaed['push'](_0x33aaed['shift']());}};_0x11f6e7(++_0x11dd47);}(_0xcf77,0x134));var _0x7cf7=function(_0x1a104e,_0x2ddb65){_0x1a104e=_0x1a104e-0x0;var _0x131002=_0xcf77[_0x1a104e];return _0x131002;};'use strict';var _=require(_0x7cf7('0x0'));var util=require(_0x7cf7('0x1'));var logger=require(_0x7cf7('0x2'))(_0x7cf7('0x3'));var moment=require(_0x7cf7('0x4'));var BPromise=require(_0x7cf7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7cf7('0x6'));var rimraf=require(_0x7cf7('0x7'));var config=require(_0x7cf7('0x8'));var attributes=require(_0x7cf7('0x9'));module[_0x7cf7('0xa')]=function(_0x4f6cc2,_0x485303){return _0x4f6cc2[_0x7cf7('0xb')](_0x7cf7('0xc'),attributes,{'tableName':'user_has_mail_queues','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 97bdd28..f1e2555 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x96d52d,_0x509f16){var _0x2575d4=function(_0x415bd0){while(--_0x415bd0){_0x96d52d['push'](_0x96d52d['shift']());}};_0x2575d4(++_0x509f16);}(_0xe14b,0x93));var _0xbe14=function(_0x2b3686,_0x81df85){_0x2b3686=_0x2b3686-0x0;var _0x235fd8=_0xe14b[_0x2b3686];return _0x235fd8;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x7217,0x19e));var _0x7721=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x7217[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 6e1ee8b..e58187b 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 _0x8977=['post','sendUserNotification','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./userNotification.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8977,0x18f));var _0x7897=function(_0x12c15d,_0x1298d7){_0x12c15d=_0x12c15d-0x0;var _0x173fd0=_0x8977[_0x12c15d];return _0x173fd0;};'use strict';var multer=require(_0x7897('0x0'));var util=require(_0x7897('0x1'));var path=require('path');var timeout=require(_0x7897('0x2'));var express=require('express');var router=express[_0x7897('0x3')]();var fs_extra=require(_0x7897('0x4'));var auth=require(_0x7897('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7897('0x6'));var controller=require(_0x7897('0x7'));router[_0x7897('0x8')]('/',auth['isAuthenticated'](),controller[_0x7897('0x9')]);module[_0x7897('0xa')]=router; \ No newline at end of file +var _0xb052=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xf7fe97,_0x432968){var _0x55b1a5=function(_0x8897a1){while(--_0x8897a1){_0xf7fe97['push'](_0xf7fe97['shift']());}};_0x55b1a5(++_0x432968);}(_0xb052,0xb0));var _0x2b05=function(_0x28fbbf,_0x11f896){_0x28fbbf=_0x28fbbf-0x0;var _0x543af6=_0xb052[_0x28fbbf];return _0x543af6;};'use strict';var multer=require(_0x2b05('0x0'));var util=require(_0x2b05('0x1'));var path=require(_0x2b05('0x2'));var timeout=require(_0x2b05('0x3'));var express=require(_0x2b05('0x4'));var router=express[_0x2b05('0x5')]();var fs_extra=require(_0x2b05('0x6'));var auth=require(_0x2b05('0x7'));var interaction=require(_0x2b05('0x8'));var config=require(_0x2b05('0x9'));var controller=require('./userNotification.controller');router[_0x2b05('0xa')]('/',auth[_0x2b05('0xb')](),controller[_0x2b05('0xc')]);module[_0x2b05('0xd')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index b3a4f74..da5e05f 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 _0xcd15=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x1a49cb,_0x5ac9cd){var _0x302261=function(_0x2d9270){while(--_0x2d9270){_0x1a49cb['push'](_0x1a49cb['shift']());}};_0x302261(++_0x5ac9cd);}(_0xcd15,0xc8));var _0x5cd1=function(_0x231a47,_0x46a963){_0x231a47=_0x231a47-0x0;var _0x48d7c9=_0xcd15[_0x231a47];return _0x48d7c9;};'use strict';var Sequelize=require(_0x5cd1('0x0'));module[_0x5cd1('0x1')]={'body':{'type':Sequelize[_0x5cd1('0x2')]},'senderName':{'type':Sequelize[_0x5cd1('0x3')]},'recipientsId':{'type':Sequelize[_0x5cd1('0x2')]},'recipientsDescription':{'type':Sequelize[_0x5cd1('0x3')]},'beep':{'type':Sequelize[_0x5cd1('0x4')]}}; \ No newline at end of file +var _0x8cd9=['BOOLEAN','exports','TEXT','STRING'];(function(_0xd3dba8,_0x4ddede){var _0x4795e8=function(_0xc1bca){while(--_0xc1bca){_0xd3dba8['push'](_0xd3dba8['shift']());}};_0x4795e8(++_0x4ddede);}(_0x8cd9,0x175));var _0x98cd=function(_0x10edea,_0x2b5516){_0x10edea=_0x10edea-0x0;var _0x3780ee=_0x8cd9[_0x10edea];return _0x3780ee;};'use strict';var Sequelize=require('sequelize');module[_0x98cd('0x0')]={'body':{'type':Sequelize[_0x98cd('0x1')]},'senderName':{'type':Sequelize[_0x98cd('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x98cd('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index db0cdae..e69e84f 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 _0x7a8d=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./userNotification.socket','register','sendStatus','status','end','offset','count','limit','set','Content-Range','json','save','update','then','destroy','error','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','join','sequelize','transaction','UserNotification','forEach','recipient','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','User','union','ids','queue','replace','push','all','flatten','findOne','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5d7ad1,_0x348f92){var _0x2dff2f=function(_0x4cb2e9){while(--_0x4cb2e9){_0x5d7ad1['push'](_0x5d7ad1['shift']());}};_0x2dff2f(++_0x348f92);}(_0x7a8d,0xc0));var _0xd7a8=function(_0x526d54,_0x43323b){_0x526d54=_0x526d54-0x0;var _0x341042=_0x7a8d[_0x526d54];return _0x341042;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd7a8('0x0'));var zipdir=require(_0xd7a8('0x1'));var jsonpatch=require(_0xd7a8('0x2'));var rp=require(_0xd7a8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd7a8('0x4'));var util=require(_0xd7a8('0x5'));var path=require(_0xd7a8('0x6'));var sox=require(_0xd7a8('0x7'));var csv=require(_0xd7a8('0x8'));var ejs=require(_0xd7a8('0x9'));var fs=require('fs');var fs_extra=require(_0xd7a8('0xa'));var _=require(_0xd7a8('0xb'));var squel=require(_0xd7a8('0xc'));var crypto=require('crypto');var jsforce=require(_0xd7a8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd7a8('0x8'));var querystring=require('querystring');var Papa=require(_0xd7a8('0xe'));var Redis=require(_0xd7a8('0xf'));var authService=require(_0xd7a8('0x10'));var qs=require(_0xd7a8('0x11'));var as=require(_0xd7a8('0x12'));var hardwareService=require(_0xd7a8('0x13'));var logger=require('../../config/logger')(_0xd7a8('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd7a8('0x15'));var db=require(_0xd7a8('0x16'))['db'];config['redis']=_[_0xd7a8('0x17')](config['redis'],{'host':_0xd7a8('0x18'),'port':0x18eb});var socket=require(_0xd7a8('0x19'))(new Redis(config[_0xd7a8('0x1a')]));require(_0xd7a8('0x1b'))[_0xd7a8('0x1c')](socket);function respondWithStatusCode(_0x524b5b,_0x190168){_0x190168=_0x190168||0xcc;return function(_0x607a3d){if(_0x607a3d){return _0x524b5b[_0xd7a8('0x1d')](_0x190168);}return _0x524b5b[_0xd7a8('0x1e')](_0x190168)[_0xd7a8('0x1f')]();};}function respondWithResult(_0x4347ca,_0x151816){_0x151816=_0x151816||0xc8;return function(_0x1850bf){if(_0x1850bf){return _0x4347ca[_0xd7a8('0x1e')](_0x151816)['json'](_0x1850bf);}};}function respondWithFilteredResult(_0x51371a,_0x5737a8){return function(_0x5418a7){if(_0x5418a7){var _0x11e61e=typeof _0x5737a8[_0xd7a8('0x20')]==='undefined'&&typeof _0x5737a8['limit']==='undefined';var _0xecd9e9=_0x5418a7[_0xd7a8('0x21')];var _0xdffcc5=_0x11e61e?0x0:_0x5737a8['offset'];var _0x2443be=_0x11e61e?_0x5418a7[_0xd7a8('0x21')]:_0x5737a8['offset']+_0x5737a8[_0xd7a8('0x22')];var _0x2a07ba;if(_0x2443be>=_0xecd9e9){_0x2443be=_0xecd9e9;_0x2a07ba=0xc8;}else{_0x2a07ba=0xce;}_0x51371a[_0xd7a8('0x1e')](_0x2a07ba);return _0x51371a[_0xd7a8('0x23')](_0xd7a8('0x24'),_0xdffcc5+'-'+_0x2443be+'/'+_0xecd9e9)[_0xd7a8('0x25')](_0x5418a7);}return null;};}function patchUpdates(_0x597363){return function(_0x72cd0e){try{jsonpatch['apply'](_0x72cd0e,_0x597363,!![]);}catch(_0x1fef50){return BPromise['reject'](_0x1fef50);}return _0x72cd0e[_0xd7a8('0x26')]();};}function saveUpdates(_0x400cc2,_0x11ca66){return function(_0x3a0370){if(_0x3a0370){return _0x3a0370[_0xd7a8('0x27')](_0x400cc2)[_0xd7a8('0x28')](function(_0x2623ab){return _0x2623ab;});}return null;};}function removeEntity(_0x3fe7c5,_0x400bd4){return function(_0x22206f){if(_0x22206f){return _0x22206f[_0xd7a8('0x29')]()[_0xd7a8('0x28')](function(){_0x3fe7c5['status'](0xcc)[_0xd7a8('0x1f')]();});}};}function handleEntityNotFound(_0x1c55d5,_0x3f7a36){return function(_0x2bec02){if(!_0x2bec02){_0x1c55d5[_0xd7a8('0x1d')](0x194);}return _0x2bec02;};}function handleError(_0x4c3214,_0x17480f){_0x17480f=_0x17480f||0x1f4;return function(_0x5da3c8){logger[_0xd7a8('0x2a')](_0x5da3c8['stack']);if(_0x5da3c8[_0xd7a8('0x2b')]){delete _0x5da3c8[_0xd7a8('0x2b')];}_0x4c3214[_0xd7a8('0x1e')](_0x17480f)[_0xd7a8('0x2c')](_0x5da3c8);};}exports[_0xd7a8('0x2d')]=function(_0x4a4add,_0x49d6ba,_0x3824e6){if(!_0x4a4add[_0xd7a8('0x2e')][_0xd7a8('0x2f')](_0xd7a8('0x30'))&&!_0x4a4add[_0xd7a8('0x2e')][_0xd7a8('0x2f')](_0xd7a8('0x31'))){throw new db[(_0xd7a8('0x32'))]['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x4a4add[_0xd7a8('0x2e')][_0xd7a8('0x2f')](_0xd7a8('0x31'))&&!_0x4a4add[_0xd7a8('0x2e')]['hasOwnProperty'](_0xd7a8('0x33'))){throw new db['Sequelize'][(_0xd7a8('0x34'))](_0xd7a8('0x35'));}if(!_0x4a4add[_0xd7a8('0x2e')][_0xd7a8('0x2f')](_0xd7a8('0x36'))){throw new db['Sequelize'][(_0xd7a8('0x34'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x1d6e51=JSON['parse'](_0x4a4add[_0xd7a8('0x2e')][_0xd7a8('0x36')]);}catch(_0x150023){logger[_0xd7a8('0x2a')](_0x150023);throw new db[(_0xd7a8('0x32'))][(_0xd7a8('0x34'))](_0xd7a8('0x37'));}var _0xe16aaa=[_0xd7a8('0x38'),_0xd7a8('0x39'),_0xd7a8('0x3a'),_0xd7a8('0x3b'),_0xd7a8('0x3c'),_0xd7a8('0x3d'),_0xd7a8('0x3e'),_0xd7a8('0x3f'),'user'];if(_[_0xd7a8('0x40')](_0x1d6e51,function(_0x11e509){return!_[_0xd7a8('0x41')](_0xe16aaa,_0x11e509[_0xd7a8('0x42')][_0xd7a8('0x43')]());})){throw new db[(_0xd7a8('0x32'))][(_0xd7a8('0x34'))](_0xd7a8('0x44'));}}}var _0x541016={};_0x541016['senderName']=_0x4a4add[_0xd7a8('0x2e')]['hasOwnProperty'](_0xd7a8('0x45'))?_0x4a4add['body']['senderName']:_0x4a4add[_0xd7a8('0x46')][_0xd7a8('0x47')];_0x541016[_0xd7a8('0x48')]=_[_0xd7a8('0x49')](_0x4a4add[_0xd7a8('0x2e')][_0xd7a8('0x48')])?null:_0x4a4add[_0xd7a8('0x2e')]['recipientsDescription'];_0x541016['beep']=_0x4a4add[_0xd7a8('0x2e')][_0xd7a8('0x4a')]||![];_0x541016[_0xd7a8('0x4b')]=_0x4a4add[_0xd7a8('0x46')]['id'];return getContent(_0x4a4add[_0xd7a8('0x2e')])[_0xd7a8('0x28')](function(_0x55f763){_0x541016[_0xd7a8('0x2e')]=_0x55f763;return getRecipients(_0x1d6e51);})[_0xd7a8('0x28')](function(_0x2be4cf){_0x541016['recipientsId']=_['sortBy'](_0x2be4cf)[_0xd7a8('0x4c')](',');return db[_0xd7a8('0x4d')][_0xd7a8('0x4e')](function(_0x694c23){return db[_0xd7a8('0x4f')]['create'](_0x541016,{'raw':!![],'transaction':_0x694c23})[_0xd7a8('0x28')](function(_0x1680fd){var _0x377119={'sender':_0x541016[_0xd7a8('0x45')],'description':_0x541016['recipientsDescription'],'content':_0x541016[_0xd7a8('0x2e')],'beep':_0x541016[_0xd7a8('0x4a')]};_0x2be4cf[_0xd7a8('0x50')](function(_0x184fb9){_0x377119[_0xd7a8('0x51')]=_0x184fb9;socket['emit']('userNotification:send',_0x377119);});return _0x1680fd;});});})[_0xd7a8('0x28')](respondWithResult(_0x49d6ba,0xc9))[_0xd7a8('0x52')](handleError(_0x49d6ba,null));};function getContent(_0x4e7817){return new BPromise(function(_0x3b9218,_0x1b1276){if(_0x4e7817['text']){_0x3b9218(_0x4e7817['text']);return;}return db[_0xd7a8('0x53')]['findOne']({'attributes':[_0xd7a8('0x54')],'where':{'id':_0x4e7817[_0xd7a8('0x31')]},'raw':!![]})[_0xd7a8('0x28')](function(_0x2489d6){if(!_0x2489d6)throw new db['Sequelize']['ValidationError'](_0xd7a8('0x55'));var _0x29455d=Mustache['render'](_0x2489d6['html'],_0x4e7817[_0xd7a8('0x33')]);_0x3b9218(_0x29455d);})[_0xd7a8('0x52')](function(_0x45ec72){_0x1b1276(_0x45ec72);});});}function getRecipients(_0x44225){return new BPromise(function(_0xf0460e,_0x22e6ef){var _0x25ea34=[];var _0x2d699e=[];_0x44225[_0xd7a8('0x50')](function(_0x880a39){var _0x2613b7=_[_0xd7a8('0x56')](_0x880a39[_0xd7a8('0x42')][_0xd7a8('0x43')]());if(_0x2613b7===_0xd7a8('0x57')){_0x25ea34=_[_0xd7a8('0x58')](_0x25ea34,_0x880a39[_0xd7a8('0x59')]);}else{if(_['includes'](_0x2613b7,_0xd7a8('0x5a')))_0x2613b7=_0x2613b7[_0xd7a8('0x5b')](_0xd7a8('0x5a'),'Queue');_0x880a39[_0xd7a8('0x59')][_0xd7a8('0x50')](function(_0x18a735){_0x2d699e[_0xd7a8('0x5c')](getAgents(_0x2613b7,_0x18a735));});}});return BPromise[_0xd7a8('0x5d')](_0x2d699e)[_0xd7a8('0x28')](function(_0xe893a0){_0x25ea34=_[_0xd7a8('0x58')](_0x25ea34,_[_0xd7a8('0x5e')](_0xe893a0));_0xf0460e(_0x25ea34);})[_0xd7a8('0x52')](function(_0x410949){_0x22e6ef(_0x410949);});});}function getAgents(_0x13cf5e,_0x36223f){return new BPromise(function(_0x33231d,_0x198f58){return db[_0x13cf5e][_0xd7a8('0x5f')]({'where':{'id':_0x36223f}})['then'](function(_0x5498fc){return _0x5498fc[_0xd7a8('0x60')]({'attributes':['id'],'raw':!![]})[_0xd7a8('0x28')](function(_0x4d0817){var _0x96cdf0=_[_0xd7a8('0x61')](_0x4d0817,'id');_0x33231d(_0x96cdf0);});})[_0xd7a8('0x52')](function(_0x3be5b7){_0x198f58(_0x3be5b7);});});} \ No newline at end of file +var _0x6c12=['../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','join','sequelize','UserNotification','create','recipient','emit','userNotification:send','catch','text','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','User','union','queue','replace','ids','push','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x6c12,0x112));var _0x26c1=function(_0x1ebe90,_0x5d29fc){_0x1ebe90=_0x1ebe90-0x0;var _0x447c82=_0x6c12[_0x1ebe90];return _0x447c82;};'use strict';var emlformat=require(_0x26c1('0x0'));var rimraf=require(_0x26c1('0x1'));var zipdir=require(_0x26c1('0x2'));var jsonpatch=require(_0x26c1('0x3'));var rp=require(_0x26c1('0x4'));var moment=require(_0x26c1('0x5'));var BPromise=require(_0x26c1('0x6'));var Mustache=require(_0x26c1('0x7'));var util=require(_0x26c1('0x8'));var path=require(_0x26c1('0x9'));var sox=require(_0x26c1('0xa'));var csv=require(_0x26c1('0xb'));var ejs=require(_0x26c1('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x26c1('0xd'));var squel=require(_0x26c1('0xe'));var crypto=require(_0x26c1('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x26c1('0xb'));var querystring=require(_0x26c1('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x26c1('0x11'));var qs=require(_0x26c1('0x12'));var as=require(_0x26c1('0x13'));var hardwareService=require(_0x26c1('0x14'));var logger=require(_0x26c1('0x15'))(_0x26c1('0x16'));var utils=require(_0x26c1('0x17'));var config=require(_0x26c1('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x26c1('0x19'))['db'];config['redis']=_[_0x26c1('0x1a')](config[_0x26c1('0x1b')],{'host':_0x26c1('0x1c'),'port':0x18eb});var socket=require(_0x26c1('0x1d'))(new Redis(config[_0x26c1('0x1b')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x29d067,_0x82822d){_0x82822d=_0x82822d||0xcc;return function(_0x2faf34){if(_0x2faf34){return _0x29d067['sendStatus'](_0x82822d);}return _0x29d067[_0x26c1('0x1e')](_0x82822d)[_0x26c1('0x1f')]();};}function respondWithResult(_0x2a2598,_0x54c6c1){_0x54c6c1=_0x54c6c1||0xc8;return function(_0x4a9a85){if(_0x4a9a85){return _0x2a2598[_0x26c1('0x1e')](_0x54c6c1)['json'](_0x4a9a85);}};}function respondWithFilteredResult(_0x5a87be,_0xd5ee6d){return function(_0x119aa6){if(_0x119aa6){var _0x4d0387=typeof _0xd5ee6d[_0x26c1('0x20')]==='undefined'&&typeof _0xd5ee6d[_0x26c1('0x21')]===_0x26c1('0x22');var _0x3f8a2f=_0x119aa6[_0x26c1('0x23')];var _0x56e4fe=_0x4d0387?0x0:_0xd5ee6d['offset'];var _0x354dc1=_0x4d0387?_0x119aa6['count']:_0xd5ee6d[_0x26c1('0x20')]+_0xd5ee6d[_0x26c1('0x21')];var _0x4abec9;if(_0x354dc1>=_0x3f8a2f){_0x354dc1=_0x3f8a2f;_0x4abec9=0xc8;}else{_0x4abec9=0xce;}_0x5a87be[_0x26c1('0x1e')](_0x4abec9);return _0x5a87be[_0x26c1('0x24')]('Content-Range',_0x56e4fe+'-'+_0x354dc1+'/'+_0x3f8a2f)[_0x26c1('0x25')](_0x119aa6);}return null;};}function patchUpdates(_0x46049c){return function(_0x30e27f){try{jsonpatch[_0x26c1('0x26')](_0x30e27f,_0x46049c,!![]);}catch(_0x43ee86){return BPromise[_0x26c1('0x27')](_0x43ee86);}return _0x30e27f[_0x26c1('0x28')]();};}function saveUpdates(_0x424e7c,_0x29deeb){return function(_0x32854b){if(_0x32854b){return _0x32854b[_0x26c1('0x29')](_0x424e7c)[_0x26c1('0x2a')](function(_0x2561bf){return _0x2561bf;});}return null;};}function removeEntity(_0xf6095e,_0x16932f){return function(_0x18eddf){if(_0x18eddf){return _0x18eddf[_0x26c1('0x2b')]()[_0x26c1('0x2a')](function(){_0xf6095e[_0x26c1('0x1e')](0xcc)[_0x26c1('0x1f')]();});}};}function handleEntityNotFound(_0x2f48a1,_0x25f271){return function(_0x1c8b71){if(!_0x1c8b71){_0x2f48a1['sendStatus'](0x194);}return _0x1c8b71;};}function handleError(_0x32112b,_0x8acb0b){_0x8acb0b=_0x8acb0b||0x1f4;return function(_0x58b630){logger[_0x26c1('0x2c')](_0x58b630[_0x26c1('0x2d')]);if(_0x58b630[_0x26c1('0x2e')]){delete _0x58b630[_0x26c1('0x2e')];}_0x32112b['status'](_0x8acb0b)[_0x26c1('0x2f')](_0x58b630);};}exports[_0x26c1('0x30')]=function(_0x15afd9,_0xe0ffc1,_0x5f2603){if(!_0x15afd9[_0x26c1('0x31')][_0x26c1('0x32')]('text')&&!_0x15afd9['body'][_0x26c1('0x32')](_0x26c1('0x33'))){throw new db[(_0x26c1('0x34'))]['ValidationError'](_0x26c1('0x35'));}else{if(_0x15afd9[_0x26c1('0x31')][_0x26c1('0x32')](_0x26c1('0x33'))&&!_0x15afd9[_0x26c1('0x31')][_0x26c1('0x32')](_0x26c1('0x36'))){throw new db[(_0x26c1('0x34'))][(_0x26c1('0x37'))](_0x26c1('0x38'));}if(!_0x15afd9['body'][_0x26c1('0x32')]('recipients')){throw new db['Sequelize'][(_0x26c1('0x37'))](_0x26c1('0x39'));}else{try{var _0x138121=JSON[_0x26c1('0x3a')](_0x15afd9[_0x26c1('0x31')]['recipients']);}catch(_0xdf9806){logger['error'](_0xdf9806);throw new db[(_0x26c1('0x34'))][(_0x26c1('0x37'))](_0x26c1('0x3b'));}var _0x357517=[_0x26c1('0x3c'),_0x26c1('0x3d'),'mailqueue',_0x26c1('0x3e'),_0x26c1('0x3f'),_0x26c1('0x40'),'whatsappqueue','team',_0x26c1('0x41')];if(_[_0x26c1('0x42')](_0x138121,function(_0x3bcfe4){return!_[_0x26c1('0x43')](_0x357517,_0x3bcfe4[_0x26c1('0x44')]['toLowerCase']());})){throw new db['Sequelize']['ValidationError'](_0x26c1('0x45'));}}}var _0x2a3faa={};_0x2a3faa[_0x26c1('0x46')]=_0x15afd9[_0x26c1('0x31')][_0x26c1('0x32')]('senderName')?_0x15afd9[_0x26c1('0x31')][_0x26c1('0x46')]:_0x15afd9['user'][_0x26c1('0x47')];_0x2a3faa['recipientsDescription']=_[_0x26c1('0x48')](_0x15afd9[_0x26c1('0x31')][_0x26c1('0x49')])?null:_0x15afd9[_0x26c1('0x31')]['recipientsDescription'];_0x2a3faa[_0x26c1('0x4a')]=_0x15afd9['body'][_0x26c1('0x4a')]||![];_0x2a3faa['SenderId']=_0x15afd9[_0x26c1('0x41')]['id'];return getContent(_0x15afd9['body'])['then'](function(_0x5cf37b){_0x2a3faa['body']=_0x5cf37b;return getRecipients(_0x138121);})[_0x26c1('0x2a')](function(_0x13b751){_0x2a3faa['recipientsId']=_['sortBy'](_0x13b751)[_0x26c1('0x4b')](',');return db[_0x26c1('0x4c')]['transaction'](function(_0x30ec11){return db[_0x26c1('0x4d')][_0x26c1('0x4e')](_0x2a3faa,{'raw':!![],'transaction':_0x30ec11})[_0x26c1('0x2a')](function(_0x2c5c91){var _0x26c708={'sender':_0x2a3faa['senderName'],'description':_0x2a3faa[_0x26c1('0x49')],'content':_0x2a3faa[_0x26c1('0x31')],'beep':_0x2a3faa[_0x26c1('0x4a')]};_0x13b751['forEach'](function(_0x2cb241){_0x26c708[_0x26c1('0x4f')]=_0x2cb241;socket[_0x26c1('0x50')](_0x26c1('0x51'),_0x26c708);});return _0x2c5c91;});});})[_0x26c1('0x2a')](respondWithResult(_0xe0ffc1,0xc9))[_0x26c1('0x52')](handleError(_0xe0ffc1,null));};function getContent(_0x1798ff){return new BPromise(function(_0x3a0792,_0x105a67){if(_0x1798ff[_0x26c1('0x53')]){_0x3a0792(_0x1798ff['text']);return;}return db['Template'][_0x26c1('0x54')]({'attributes':[_0x26c1('0x55')],'where':{'id':_0x1798ff[_0x26c1('0x33')]},'raw':!![]})[_0x26c1('0x2a')](function(_0x53bf21){if(!_0x53bf21)throw new db[(_0x26c1('0x34'))][(_0x26c1('0x37'))](_0x26c1('0x56'));var _0x2e4ea8=Mustache[_0x26c1('0x57')](_0x53bf21[_0x26c1('0x55')],_0x1798ff[_0x26c1('0x36')]);_0x3a0792(_0x2e4ea8);})[_0x26c1('0x52')](function(_0x459db7){_0x105a67(_0x459db7);});});}function getRecipients(_0x1e391c){return new BPromise(function(_0x5ef5ba,_0x2947d3){var _0x2a16f1=[];var _0x3743c1=[];_0x1e391c[_0x26c1('0x58')](function(_0x45d419){var _0x397d6=_['startCase'](_0x45d419[_0x26c1('0x44')]['toLowerCase']());if(_0x397d6===_0x26c1('0x59')){_0x2a16f1=_[_0x26c1('0x5a')](_0x2a16f1,_0x45d419['ids']);}else{if(_[_0x26c1('0x43')](_0x397d6,_0x26c1('0x5b')))_0x397d6=_0x397d6[_0x26c1('0x5c')]('queue','Queue');_0x45d419[_0x26c1('0x5d')]['forEach'](function(_0x28d044){_0x3743c1[_0x26c1('0x5e')](getAgents(_0x397d6,_0x28d044));});}});return BPromise[_0x26c1('0x5f')](_0x3743c1)[_0x26c1('0x2a')](function(_0x2d1cbd){_0x2a16f1=_['union'](_0x2a16f1,_[_0x26c1('0x60')](_0x2d1cbd));_0x5ef5ba(_0x2a16f1);})[_0x26c1('0x52')](function(_0x310370){_0x2947d3(_0x310370);});});}function getAgents(_0x2633f0,_0x109547){return new BPromise(function(_0x2d05ed,_0x3fa62b){return db[_0x2633f0][_0x26c1('0x54')]({'where':{'id':_0x109547}})[_0x26c1('0x2a')](function(_0x1df454){return _0x1df454[_0x26c1('0x61')]({'attributes':['id'],'raw':!![]})[_0x26c1('0x2a')](function(_0x3623c2){var _0x17fe79=_[_0x26c1('0x62')](_0x3623c2,'id');_0x2d05ed(_0x17fe79);});})[_0x26c1('0x52')](function(_0x443b5d){_0x3fa62b(_0x443b5d);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 2e40e20..a8058c0 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 _0xb1b6=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','save','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb1b6,0x181));var _0x6b1b=function(_0x551c1a,_0x3a5c39){_0x551c1a=_0x551c1a-0x0;var _0x409cff=_0xb1b6[_0x551c1a];return _0x409cff;};'use strict';var EventEmitter=require(_0x6b1b('0x0'));var UserNotification=require(_0x6b1b('0x1'))['db'][_0x6b1b('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6b1b('0x3'),'afterUpdate':_0x6b1b('0x4'),'afterDestroy':_0x6b1b('0x5')};function emitEvent(_0x332ebe){return function(_0x5c4185,_0x3c2c1e,_0x400079){UserNotificationEvents[_0x6b1b('0x6')](_0x332ebe+':'+_0x5c4185['id'],_0x5c4185);UserNotificationEvents[_0x6b1b('0x6')](_0x332ebe,_0x5c4185);_0x400079(null);};}for(var e in events){if(events[_0x6b1b('0x7')](e)){var event=events[e];UserNotification[_0x6b1b('0x8')](e,emitEvent(event));}}module[_0x6b1b('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0x4a67=['UserNotification','setMaxListeners','save','emit','hook','events','../../mysqldb'];(function(_0x182663,_0x3578f5){var _0x10019e=function(_0x198277){while(--_0x198277){_0x182663['push'](_0x182663['shift']());}};_0x10019e(++_0x3578f5);}(_0x4a67,0x19b));var _0x74a6=function(_0x414dd8,_0x2c8c0c){_0x414dd8=_0x414dd8-0x0;var _0x4fd925=_0x4a67[_0x414dd8];return _0x4fd925;};'use strict';var EventEmitter=require(_0x74a6('0x0'));var UserNotification=require(_0x74a6('0x1'))['db'][_0x74a6('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x74a6('0x3')](0x0);var events={'afterCreate':_0x74a6('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x386f4b){return function(_0x21702d,_0xbb0541,_0x16621a){UserNotificationEvents['emit'](_0x386f4b+':'+_0x21702d['id'],_0x21702d);UserNotificationEvents[_0x74a6('0x5')](_0x386f4b,_0x21702d);_0x16621a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x74a6('0x6')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 5b7221e..a5dff63 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 _0x552d=['path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x552d,0xbe));var _0xd552=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x552d[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xd552('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd552('0x1'));var moment=require(_0xd552('0x2'));var BPromise=require(_0xd552('0x3'));var rp=require(_0xd552('0x4'));var fs=require('fs');var path=require(_0xd552('0x5'));var rimraf=require(_0xd552('0x6'));var config=require(_0xd552('0x7'));var attributes=require(_0xd552('0x8'));module[_0xd552('0x9')]=function(_0x4ceaca,_0x68f9b2){return _0x4ceaca[_0xd552('0xa')](_0xd552('0xb'),attributes,{'tableName':_0xd552('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd552('0xd'),'collate':_0xd552('0xe')});}; \ No newline at end of file +var _0xb9e7=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','UserNotification','userNotifications','utf8mb4','util','../../config/logger'];(function(_0x1d63b2,_0x52f531){var _0x3bb161=function(_0x1202ce){while(--_0x1202ce){_0x1d63b2['push'](_0x1d63b2['shift']());}};_0x3bb161(++_0x52f531);}(_0xb9e7,0x1df));var _0x7b9e=function(_0x3818c0,_0x542521){_0x3818c0=_0x3818c0-0x0;var _0x55ec33=_0xb9e7[_0x3818c0];return _0x55ec33;};'use strict';var _=require('lodash');var util=require(_0x7b9e('0x0'));var logger=require(_0x7b9e('0x1'))(_0x7b9e('0x2'));var moment=require(_0x7b9e('0x3'));var BPromise=require(_0x7b9e('0x4'));var rp=require(_0x7b9e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b9e('0x6'));var config=require(_0x7b9e('0x7'));var attributes=require('./userNotification.attributes');module[_0x7b9e('0x8')]=function(_0x51a0ca,_0x3a9c5e){return _0x51a0ca[_0x7b9e('0x9')](_0x7b9e('0xa'),attributes,{'tableName':_0x7b9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b9e('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 1158f2d..9420730 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 _0x8849=['request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','client','http','redis','localhost','socket.io-emitter','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s'];(function(_0x31520f,_0x7b9adb){var _0x5785ce=function(_0x5c28df){while(--_0x5c28df){_0x31520f['push'](_0x31520f['shift']());}};_0x5785ce(++_0x7b9adb);}(_0x8849,0x7b));var _0x9884=function(_0x5b4fdb,_0x2d36c0){_0x5b4fdb=_0x5b4fdb-0x0;var _0x3d51ef=_0x8849[_0x5b4fdb];return _0x3d51ef;};'use strict';var _=require(_0x9884('0x0'));var util=require('util');var moment=require(_0x9884('0x1'));var BPromise=require(_0x9884('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9884('0x3'));var db=require(_0x9884('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9884('0x5')][_0x9884('0x6')]({'port':0x232a});config[_0x9884('0x7')]=_['defaults'](config[_0x9884('0x7')],{'host':_0x9884('0x8'),'port':0x18eb});var socket=require(_0x9884('0x9'))(new Redis(config[_0x9884('0x7')]));require(_0x9884('0xa'))['register'](socket);function respondWithRpcPromise(_0x22aa21,_0x298478,_0x46126d){return new BPromise(function(_0xde276,_0x437e0a){return client[_0x9884('0xb')](_0x22aa21,_0x46126d)[_0x9884('0xc')](function(_0x4b85a7){logger[_0x9884('0xd')](_0x9884('0xe'),_0x298478,_0x9884('0xf'));logger[_0x9884('0x10')](_0x9884('0x11'),_0x298478,_0x9884('0xf'),JSON['stringify'](_0x4b85a7));if(_0x4b85a7[_0x9884('0x12')]){if(_0x4b85a7[_0x9884('0x12')][_0x9884('0x13')]===0x1f4){logger['error'](_0x9884('0xe'),_0x298478,_0x4b85a7['error'][_0x9884('0x14')]);return _0x437e0a(_0x4b85a7['error'][_0x9884('0x14')]);}logger[_0x9884('0x12')]('UserNotification,\x20%s,\x20%s',_0x298478,_0x4b85a7['error'][_0x9884('0x14')]);return _0xde276(_0x4b85a7[_0x9884('0x12')][_0x9884('0x14')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x298478,'request\x20sent');_0xde276(_0x4b85a7[_0x9884('0x15')]['message']);}})[_0x9884('0x16')](function(_0x23f40e){logger['error'](_0x9884('0xe'),_0x298478,_0x23f40e);_0x437e0a(_0x23f40e);});});} \ No newline at end of file +var _0xa129=['UserNotification,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./userNotification.socket','register','request','info','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x214528,_0x3d20a1){var _0x52fc0e=function(_0xee43eb){while(--_0xee43eb){_0x214528['push'](_0x214528['shift']());}};_0x52fc0e(++_0x3d20a1);}(_0xa129,0x11b));var _0x9a12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa129[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9a12('0x0'));var util=require(_0x9a12('0x1'));var moment=require(_0x9a12('0x2'));var BPromise=require(_0x9a12('0x3'));var rs=require(_0x9a12('0x4'));var fs=require('fs');var Redis=require(_0x9a12('0x5'));var db=require(_0x9a12('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a12('0x7'))(_0x9a12('0x8'));var config=require(_0x9a12('0x9'));var jayson=require(_0x9a12('0xa'));var client=jayson[_0x9a12('0xb')][_0x9a12('0xc')]({'port':0x232a});config['redis']=_[_0x9a12('0xd')](config['redis'],{'host':_0x9a12('0xe'),'port':0x18eb});var socket=require(_0x9a12('0xf'))(new Redis(config[_0x9a12('0x10')]));require(_0x9a12('0x11'))[_0x9a12('0x12')](socket);function respondWithRpcPromise(_0x81559c,_0x1a714a,_0x56aa44){return new BPromise(function(_0xab826f,_0x1c641f){return client[_0x9a12('0x13')](_0x81559c,_0x56aa44)['then'](function(_0x42b99e){logger[_0x9a12('0x14')]('UserNotification,\x20%s,\x20%s',_0x1a714a,_0x9a12('0x15'));logger[_0x9a12('0x16')](_0x9a12('0x17'),_0x1a714a,_0x9a12('0x15'),JSON[_0x9a12('0x18')](_0x42b99e));if(_0x42b99e[_0x9a12('0x19')]){if(_0x42b99e[_0x9a12('0x19')][_0x9a12('0x1a')]===0x1f4){logger[_0x9a12('0x19')](_0x9a12('0x1b'),_0x1a714a,_0x42b99e[_0x9a12('0x19')]['message']);return _0x1c641f(_0x42b99e[_0x9a12('0x19')][_0x9a12('0x1c')]);}logger[_0x9a12('0x19')](_0x9a12('0x1b'),_0x1a714a,_0x42b99e[_0x9a12('0x19')][_0x9a12('0x1c')]);return _0xab826f(_0x42b99e[_0x9a12('0x19')][_0x9a12('0x1c')]);}else{logger[_0x9a12('0x14')](_0x9a12('0x1b'),_0x1a714a,'request\x20sent');_0xab826f(_0x42b99e[_0x9a12('0x1d')][_0x9a12('0x1c')]);}})[_0x9a12('0x1e')](function(_0x37df16){logger['error'](_0x9a12('0x1b'),_0x1a714a,_0x37df16);_0x1c641f(_0x37df16);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index e220bc8..5a714c5 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 _0x27a9=['length','userNotification:','./userNotification.events','update','removeListener','register'];(function(_0x39c61f,_0x22d16e){var _0x344842=function(_0x127100){while(--_0x127100){_0x39c61f['push'](_0x39c61f['shift']());}};_0x344842(++_0x22d16e);}(_0x27a9,0xb0));var _0x927a=function(_0x421528,_0x16b8a0){_0x421528=_0x421528-0x0;var _0x1ea128=_0x27a9[_0x421528];return _0x1ea128;};'use strict';var UserNotificationEvents=require(_0x927a('0x0'));var events=['save','remove',_0x927a('0x1')];function createListener(_0x1ebeae,_0x19891c){return function(_0x379b20){_0x19891c['emit'](_0x1ebeae,_0x379b20);};}function removeListener(_0x4476de,_0x2dd2df){return function(){UserNotificationEvents[_0x927a('0x2')](_0x4476de,_0x2dd2df);};}exports[_0x927a('0x3')]=function(_0x4f4069){for(var _0x2edbde=0x0,_0x1cb27b=events[_0x927a('0x4')];_0x2edbde<_0x1cb27b;_0x2edbde++){var _0x4a6b1a=events[_0x2edbde];var _0x39d27c=createListener(_0x927a('0x5')+_0x4a6b1a,_0x4f4069);UserNotificationEvents['on'](_0x4a6b1a,_0x39d27c);}}; \ No newline at end of file +var _0x837e=['update','removeListener','length','userNotification:','./userNotification.events','remove'];(function(_0x5c4133,_0xff7f35){var _0x232190=function(_0x805687){while(--_0x805687){_0x5c4133['push'](_0x5c4133['shift']());}};_0x232190(++_0xff7f35);}(_0x837e,0x1e4));var _0xe837=function(_0x13d374,_0xb5aa9c){_0x13d374=_0x13d374-0x0;var _0x8e09b2=_0x837e[_0x13d374];return _0x8e09b2;};'use strict';var UserNotificationEvents=require(_0xe837('0x0'));var events=['save',_0xe837('0x1'),_0xe837('0x2')];function createListener(_0xbfd36b,_0x2ecb65){return function(_0x2183a9){_0x2ecb65['emit'](_0xbfd36b,_0x2183a9);};}function removeListener(_0x1453a3,_0x2eb0c0){return function(){UserNotificationEvents[_0xe837('0x3')](_0x1453a3,_0x2eb0c0);};}exports['register']=function(_0x32124b){for(var _0x2b9950=0x0,_0x6b560a=events[_0xe837('0x4')];_0x2b9950<_0x6b560a;_0x2b9950++){var _0x3f9745=events[_0x2b9950];var _0x189fcc=createListener(_0xe837('0x5')+_0x3f9745,_0x32124b);UserNotificationEvents['on'](_0x3f9745,_0x189fcc);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 89b4f9f..86c3a8a 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4dcb47,_0x50ef92){var _0x352b40=function(_0x5bce21){while(--_0x5bce21){_0x4dcb47['push'](_0x4dcb47['shift']());}};_0x352b40(++_0x50ef92);}(_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(_0x337a98,_0x518550){var _0x848c41=function(_0x3e863d){while(--_0x3e863d){_0x337a98['push'](_0x337a98['shift']());}};_0x848c41(++_0x518550);}(_0xe706,0xa3));var _0x6e70=function(_0x175bfd,_0x4d47b5){_0x175bfd=_0x175bfd-0x0;var _0x2753f2=_0xe706[_0x175bfd];return _0x2753f2;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 9b05daf..ee1bb66 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 _0x93a6=['INTEGER','sequelize','exports'];(function(_0x2181b1,_0x569637){var _0x530548=function(_0x4b31f1){while(--_0x4b31f1){_0x2181b1['push'](_0x2181b1['shift']());}};_0x530548(++_0x569637);}(_0x93a6,0x1ab));var _0x693a=function(_0x2715b5,_0xdc645f){_0x2715b5=_0x2715b5-0x0;var _0x114369=_0x93a6[_0x2715b5];return _0x114369;};'use strict';var Sequelize=require(_0x693a('0x0'));module[_0x693a('0x1')]={'penalty':{'type':Sequelize[_0x693a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xaf11=['sequelize','exports'];(function(_0x2cf213,_0x5487ca){var _0x376287=function(_0x2f3d7d){while(--_0x2f3d7d){_0x2cf213['push'](_0x2cf213['shift']());}};_0x376287(++_0x5487ca);}(_0xaf11,0x190));var _0x1af1=function(_0xa63d7e,_0x39a5cd){_0xa63d7e=_0xa63d7e-0x0;var _0x3f826b=_0xaf11[_0xa63d7e];return _0x3f826b;};'use strict';var Sequelize=require(_0x1af1('0x0'));module[_0x1af1('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 a75c24e..8bc469f 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 _0x3f4d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','lodash'];(function(_0x2f8409,_0x369a87){var _0x40ad89=function(_0x299403){while(--_0x299403){_0x2f8409['push'](_0x2f8409['shift']());}};_0x40ad89(++_0x369a87);}(_0x3f4d,0x12a));var _0xd3f4=function(_0x125dea,_0xb160c1){_0x125dea=_0x125dea-0x0;var _0x3f612a=_0x3f4d[_0x125dea];return _0x3f612a;};'use strict';var _=require(_0xd3f4('0x0'));var util=require(_0xd3f4('0x1'));var logger=require(_0xd3f4('0x2'))(_0xd3f4('0x3'));var moment=require(_0xd3f4('0x4'));var BPromise=require(_0xd3f4('0x5'));var rp=require(_0xd3f4('0x6'));var fs=require('fs');var path=require(_0xd3f4('0x7'));var rimraf=require(_0xd3f4('0x8'));var config=require('../../config/environment');var attributes=require(_0xd3f4('0x9'));module[_0xd3f4('0xa')]=function(_0x25115b,_0x375751){return _0x25115b[_0xd3f4('0xb')](_0xd3f4('0xc'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45d7=['util','../../config/logger','api','moment','bluebird','path','rimraf','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash'];(function(_0x504bb0,_0x40db89){var _0x1d4bb3=function(_0x1a17cc){while(--_0x1a17cc){_0x504bb0['push'](_0x504bb0['shift']());}};_0x1d4bb3(++_0x40db89);}(_0x45d7,0x137));var _0x745d=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x45d7[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x745d('0x0'));var util=require(_0x745d('0x1'));var logger=require(_0x745d('0x2'))(_0x745d('0x3'));var moment=require(_0x745d('0x4'));var BPromise=require(_0x745d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x745d('0x6'));var rimraf=require(_0x745d('0x7'));var config=require('../../config/environment');var attributes=require(_0x745d('0x8'));module[_0x745d('0x9')]=function(_0x1f1f88,_0x1d4444){return _0x1f1f88[_0x745d('0xa')]('UserOpenchannelQueue',attributes,{'tableName':_0x745d('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 22827f7..afc4bc5 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 _0xf5cd=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result'];(function(_0x16c5ad,_0x36c89c){var _0x588205=function(_0x27de97){while(--_0x27de97){_0x16c5ad['push'](_0x16c5ad['shift']());}};_0x588205(++_0x36c89c);}(_0xf5cd,0xd1));var _0xdf5c=function(_0x3f2f56,_0x386433){_0x3f2f56=_0x3f2f56-0x0;var _0x3ec0fd=_0xf5cd[_0x3f2f56];return _0x3ec0fd;};'use strict';var _=require(_0xdf5c('0x0'));var util=require(_0xdf5c('0x1'));var moment=require(_0xdf5c('0x2'));var BPromise=require(_0xdf5c('0x3'));var rs=require(_0xdf5c('0x4'));var fs=require('fs');var Redis=require(_0xdf5c('0x5'));var db=require(_0xdf5c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xdf5c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdf5c('0x8')][_0xdf5c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x584f69,_0x38a45d,_0x1a2281){return new BPromise(function(_0xef2699,_0x15971a){return client['request'](_0x584f69,_0x1a2281)[_0xdf5c('0xa')](function(_0x94a044){logger[_0xdf5c('0xb')](_0xdf5c('0xc'),_0x38a45d,'request\x20sent');logger[_0xdf5c('0xd')](_0xdf5c('0xe'),_0x38a45d,'request\x20sent',JSON['stringify'](_0x94a044));if(_0x94a044[_0xdf5c('0xf')]){if(_0x94a044[_0xdf5c('0xf')]['code']===0x1f4){logger['error'](_0xdf5c('0xc'),_0x38a45d,_0x94a044[_0xdf5c('0xf')]['message']);return _0x15971a(_0x94a044['error'][_0xdf5c('0x10')]);}logger[_0xdf5c('0xf')](_0xdf5c('0xc'),_0x38a45d,_0x94a044[_0xdf5c('0xf')][_0xdf5c('0x10')]);return _0xef2699(_0x94a044[_0xdf5c('0xf')]['message']);}else{logger[_0xdf5c('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x38a45d,_0xdf5c('0x11'));_0xef2699(_0x94a044[_0xdf5c('0x12')][_0xdf5c('0x10')]);}})['catch'](function(_0x11eba2){logger[_0xdf5c('0xf')](_0xdf5c('0xc'),_0x38a45d,_0x11eba2);_0x15971a(_0x11eba2);});});} \ No newline at end of file +var _0xf813=['message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x11d3ea,_0x2005e6){var _0x20e237=function(_0x1e2120){while(--_0x1e2120){_0x11d3ea['push'](_0x11d3ea['shift']());}};_0x20e237(++_0x2005e6);}(_0xf813,0x14c));var _0x3f81=function(_0x334c50,_0x1f11d0){_0x334c50=_0x334c50-0x0;var _0x524766=_0xf813[_0x334c50];return _0x524766;};'use strict';var _=require(_0x3f81('0x0'));var util=require(_0x3f81('0x1'));var moment=require(_0x3f81('0x2'));var BPromise=require(_0x3f81('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f81('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f81('0x5'));var logger=require(_0x3f81('0x6'))(_0x3f81('0x7'));var config=require(_0x3f81('0x8'));var jayson=require(_0x3f81('0x9'));var client=jayson['client'][_0x3f81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ddd33,_0x5f27ec,_0x256f40){return new BPromise(function(_0x2e433b,_0x5226c9){return client[_0x3f81('0xb')](_0x3ddd33,_0x256f40)['then'](function(_0x116cf8){logger[_0x3f81('0xc')](_0x3f81('0xd'),_0x5f27ec,'request\x20sent');logger[_0x3f81('0xe')](_0x3f81('0xf'),_0x5f27ec,_0x3f81('0x10'),JSON[_0x3f81('0x11')](_0x116cf8));if(_0x116cf8[_0x3f81('0x12')]){if(_0x116cf8['error'][_0x3f81('0x13')]===0x1f4){logger['error'](_0x3f81('0xd'),_0x5f27ec,_0x116cf8['error'][_0x3f81('0x14')]);return _0x5226c9(_0x116cf8[_0x3f81('0x12')][_0x3f81('0x14')]);}logger['error'](_0x3f81('0xd'),_0x5f27ec,_0x116cf8[_0x3f81('0x12')][_0x3f81('0x14')]);return _0x2e433b(_0x116cf8[_0x3f81('0x12')][_0x3f81('0x14')]);}else{logger[_0x3f81('0xc')](_0x3f81('0xd'),_0x5f27ec,_0x3f81('0x10'));_0x2e433b(_0x116cf8[_0x3f81('0x15')]['message']);}})['catch'](function(_0x540fb1){logger[_0x3f81('0x12')](_0x3f81('0xd'),_0x5f27ec,_0x540fb1);_0x5226c9(_0x540fb1);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index bdf4287..d20efb7 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 _0xc653=['/describe','/:id','show','/:id/sections','getSections','getResources','post','create','/:id/clone','addSections','/:id/resources','addResources','put','update','destroy','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc653,0x6e));var _0x3c65=function(_0x524280,_0x46045c){_0x524280=_0x524280-0x0;var _0x2b2ceb=_0xc653[_0x524280];return _0x2b2ceb;};'use strict';var multer=require(_0x3c65('0x0'));var util=require(_0x3c65('0x1'));var path=require(_0x3c65('0x2'));var timeout=require(_0x3c65('0x3'));var express=require(_0x3c65('0x4'));var router=express[_0x3c65('0x5')]();var fs_extra=require(_0x3c65('0x6'));var auth=require(_0x3c65('0x7'));var interaction=require(_0x3c65('0x8'));var config=require(_0x3c65('0x9'));var controller=require(_0x3c65('0xa'));router[_0x3c65('0xb')]('/',auth[_0x3c65('0xc')](),controller[_0x3c65('0xd')]);router[_0x3c65('0xb')](_0x3c65('0xe'),auth[_0x3c65('0xc')](),controller['describe']);router[_0x3c65('0xb')](_0x3c65('0xf'),auth['isAuthenticated'](),controller[_0x3c65('0x10')]);router['get'](_0x3c65('0x11'),auth[_0x3c65('0xc')](),controller[_0x3c65('0x12')]);router['get']('/:id/resources',auth[_0x3c65('0xc')](),controller[_0x3c65('0x13')]);router[_0x3c65('0x14')]('/',auth[_0x3c65('0xc')](),controller[_0x3c65('0x15')]);router['post'](_0x3c65('0x16'),auth['isAuthenticated'](),controller['clone']);router[_0x3c65('0x14')](_0x3c65('0x11'),auth['isAuthenticated'](),controller[_0x3c65('0x17')]);router[_0x3c65('0x14')](_0x3c65('0x18'),auth[_0x3c65('0xc')](),controller[_0x3c65('0x19')]);router[_0x3c65('0x1a')](_0x3c65('0xf'),auth[_0x3c65('0xc')](),controller[_0x3c65('0x1b')]);router['delete'](_0x3c65('0xf'),auth[_0x3c65('0xc')](),controller[_0x3c65('0x1c')]);router['delete'](_0x3c65('0x11'),auth['isAuthenticated'](),controller['removeSections']);router[_0x3c65('0x1d')](_0x3c65('0x18'),auth[_0x3c65('0xc')](),controller['removeResources']);module[_0x3c65('0x1e')]=router; \ No newline at end of file +var _0x3b68=['get','isAuthenticated','index','/describe','/:id','getSections','/:id/resources','getResources','post','create','/:id/clone','addSections','addResources','delete','removeSections','removeResources','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller'];(function(_0x47014e,_0x197853){var _0x529d52=function(_0x144e4c){while(--_0x144e4c){_0x47014e['push'](_0x47014e['shift']());}};_0x529d52(++_0x197853);}(_0x3b68,0x170));var _0x83b6=function(_0x2c1337,_0x24afd2){_0x2c1337=_0x2c1337-0x0;var _0x44a8ad=_0x3b68[_0x2c1337];return _0x44a8ad;};'use strict';var multer=require(_0x83b6('0x0'));var util=require(_0x83b6('0x1'));var path=require(_0x83b6('0x2'));var timeout=require(_0x83b6('0x3'));var express=require('express');var router=express[_0x83b6('0x4')]();var fs_extra=require(_0x83b6('0x5'));var auth=require(_0x83b6('0x6'));var interaction=require(_0x83b6('0x7'));var config=require(_0x83b6('0x8'));var controller=require(_0x83b6('0x9'));router[_0x83b6('0xa')]('/',auth[_0x83b6('0xb')](),controller[_0x83b6('0xc')]);router[_0x83b6('0xa')](_0x83b6('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x83b6('0xa')](_0x83b6('0xe'),auth[_0x83b6('0xb')](),controller['show']);router[_0x83b6('0xa')]('/:id/sections',auth[_0x83b6('0xb')](),controller[_0x83b6('0xf')]);router[_0x83b6('0xa')](_0x83b6('0x10'),auth[_0x83b6('0xb')](),controller[_0x83b6('0x11')]);router[_0x83b6('0x12')]('/',auth[_0x83b6('0xb')](),controller[_0x83b6('0x13')]);router['post'](_0x83b6('0x14'),auth[_0x83b6('0xb')](),controller['clone']);router['post']('/:id/sections',auth['isAuthenticated'](),controller[_0x83b6('0x15')]);router[_0x83b6('0x12')]('/:id/resources',auth[_0x83b6('0xb')](),controller[_0x83b6('0x16')]);router['put'](_0x83b6('0xe'),auth[_0x83b6('0xb')](),controller['update']);router[_0x83b6('0x17')](_0x83b6('0xe'),auth[_0x83b6('0xb')](),controller['destroy']);router[_0x83b6('0x17')]('/:id/sections',auth[_0x83b6('0xb')](),controller[_0x83b6('0x18')]);router['delete'](_0x83b6('0x10'),auth['isAuthenticated'](),controller[_0x83b6('0x19')]);module[_0x83b6('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index b454163..12d0a27 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 _0xb4fc=['getDataValue','BOOLEAN','exports','STRING','name','setDataValue','crudPermissions','join'];(function(_0x1b869b,_0x14f997){var _0x1aa3f8=function(_0x2d04a8){while(--_0x2d04a8){_0x1b869b['push'](_0x1b869b['shift']());}};_0x1aa3f8(++_0x14f997);}(_0xb4fc,0xea));var _0xcb4f=function(_0x1a2bd0,_0x29fbab){_0x1a2bd0=_0x1a2bd0-0x0;var _0x57d3ca=_0xb4fc[_0x1a2bd0];return _0x57d3ca;};'use strict';var Sequelize=require('sequelize');module[_0xcb4f('0x0')]={'name':{'type':Sequelize[_0xcb4f('0x1')],'allowNull':![],'unique':_0xcb4f('0x2')},'crudPermissions':{'type':Sequelize[_0xcb4f('0x1')],'set':function(_0x210f15){this[_0xcb4f('0x3')](_0xcb4f('0x4'),_0x210f15?_0x210f15[_0xcb4f('0x5')](''):[]);},'get':function(){return this[_0xcb4f('0x6')]('crudPermissions')?this[_0xcb4f('0x6')](_0xcb4f('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xcb4f('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xcb4f('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xcb4f('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xcb4f('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xcb4f('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xcb4f('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xcb4f('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xcb4f('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xcb4f('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x842a=['sequelize','exports','STRING','name','crudPermissions','getDataValue','BOOLEAN'];(function(_0x4b967a,_0x22f5b3){var _0xb548f=function(_0x212030){while(--_0x212030){_0x4b967a['push'](_0x4b967a['shift']());}};_0xb548f(++_0x22f5b3);}(_0x842a,0x70));var _0xa842=function(_0x20fb02,_0x96c029){_0x20fb02=_0x20fb02-0x0;var _0x24a33e=_0x842a[_0x20fb02];return _0x24a33e;};'use strict';var Sequelize=require(_0xa842('0x0'));module[_0xa842('0x1')]={'name':{'type':Sequelize[_0xa842('0x2')],'allowNull':![],'unique':_0xa842('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x4e9ed1){this['setDataValue'](_0xa842('0x4'),_0x4e9ed1?_0x4e9ed1['join'](''):[]);},'get':function(){return this['getDataValue'](_0xa842('0x4'))?this[_0xa842('0x5')](_0xa842('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xa842('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xa842('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xa842('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xa842('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xa842('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xa842('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa842('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 034dfcc..e5f7cf8 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 _0xe51c=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','./userProfile.socket','register','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','send','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','where','merge','map','options','UserProfile','includeAll','include','then','catch','params','length','find','create','body','clone','get','updatedAt','crudPermissions','omit','createdAt','sequelize','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','userProfileId','Resources','describe','addSections','transaction','sectionId','ids','getSections','enabled','includes','isEmpty','subsections','Dashboard','push','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto'];(function(_0x3dde3a,_0x5345be){var _0x3f934a=function(_0x482f15){while(--_0x482f15){_0x3dde3a['push'](_0x3dde3a['shift']());}};_0x3f934a(++_0x5345be);}(_0xe51c,0x143));var _0xce51=function(_0x5613de,_0x479c93){_0x5613de=_0x5613de-0x0;var _0x5b40cb=_0xe51c[_0x5613de];return _0x5b40cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce51('0x0'));var zipdir=require(_0xce51('0x1'));var jsonpatch=require(_0xce51('0x2'));var rp=require(_0xce51('0x3'));var moment=require(_0xce51('0x4'));var BPromise=require(_0xce51('0x5'));var Mustache=require(_0xce51('0x6'));var util=require(_0xce51('0x7'));var path=require(_0xce51('0x8'));var sox=require('sox');var csv=require(_0xce51('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce51('0xa'));var _=require(_0xce51('0xb'));var squel=require('squel');var crypto=require(_0xce51('0xc'));var jsforce=require(_0xce51('0xd'));var deskjs=require(_0xce51('0xe'));var toCsv=require('to-csv');var querystring=require(_0xce51('0xf'));var Papa=require(_0xce51('0x10'));var Redis=require('ioredis');var authService=require(_0xce51('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xce51('0x12'));var hardwareService=require(_0xce51('0x13'));var logger=require(_0xce51('0x14'))(_0xce51('0x15'));var utils=require('../../config/utils');var config=require(_0xce51('0x16'));var licenseUtil=require(_0xce51('0x17'));var db=require(_0xce51('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xce51('0x19'),'port':0x18eb});var socket=require(_0xce51('0x1a'))(new Redis(config['redis']));require(_0xce51('0x1b'))[_0xce51('0x1c')](socket);function respondWithStatusCode(_0x55cafe,_0x56a312){_0x56a312=_0x56a312||0xcc;return function(_0x110a58){if(_0x110a58){return _0x55cafe['sendStatus'](_0x56a312);}return _0x55cafe[_0xce51('0x1d')](_0x56a312)[_0xce51('0x1e')]();};}function respondWithResult(_0x3339b1,_0x378620){_0x378620=_0x378620||0xc8;return function(_0x4a7c15){if(_0x4a7c15){return _0x3339b1['status'](_0x378620)[_0xce51('0x1f')](_0x4a7c15);}};}function respondWithFilteredResult(_0x4c5010,_0x12f332){return function(_0x18360d){if(_0x18360d){var _0x863fd6=typeof _0x12f332['offset']==='undefined'&&typeof _0x12f332[_0xce51('0x20')]===_0xce51('0x21');var _0x2918af=_0x18360d[_0xce51('0x22')];var _0x2c71bf=_0x863fd6?0x0:_0x12f332[_0xce51('0x23')];var _0x2d9508=_0x863fd6?_0x18360d['count']:_0x12f332[_0xce51('0x23')]+_0x12f332[_0xce51('0x20')];var _0xa884f2;if(_0x2d9508>=_0x2918af){_0x2d9508=_0x2918af;_0xa884f2=0xc8;}else{_0xa884f2=0xce;}_0x4c5010[_0xce51('0x1d')](_0xa884f2);return _0x4c5010[_0xce51('0x24')](_0xce51('0x25'),_0x2c71bf+'-'+_0x2d9508+'/'+_0x2918af)[_0xce51('0x1f')](_0x18360d);}return null;};}function patchUpdates(_0x311823){return function(_0x2aebe6){try{jsonpatch[_0xce51('0x26')](_0x2aebe6,_0x311823,!![]);}catch(_0x3e4677){return BPromise[_0xce51('0x27')](_0x3e4677);}return _0x2aebe6[_0xce51('0x28')]();};}function saveUpdates(_0x3404ad,_0x4dc723){return function(_0x3463f9){if(_0x3463f9){return _0x3463f9[_0xce51('0x29')](_0x3404ad)['then'](function(_0x24fba8){return _0x24fba8;});}return null;};}function removeEntity(_0x45e1ca,_0x1c82c5){return function(_0x1e8abb){if(_0x1e8abb){return _0x1e8abb[_0xce51('0x2a')]()['then'](function(){_0x45e1ca[_0xce51('0x1d')](0xcc)[_0xce51('0x1e')]();});}};}function handleEntityNotFound(_0x10a352,_0x456c0c){return function(_0x19a3be){if(!_0x19a3be){_0x10a352[_0xce51('0x2b')](0x194);}return _0x19a3be;};}function handleError(_0x1dddab,_0x101114){_0x101114=_0x101114||0x1f4;return function(_0x543297){logger[_0xce51('0x2c')](_0x543297[_0xce51('0x2d')]);if(_0x543297[_0xce51('0x2e')]){delete _0x543297[_0xce51('0x2e')];}_0x1dddab['status'](_0x101114)[_0xce51('0x2f')](_0x543297);};}exports['index']=function(_0xb19cf,_0x492848){var _0x18f09a={},_0x4a6983={},_0x3eaf44={'count':0x0,'rows':[]};var _0x102168=_['map'](db['UserProfile'][_0xce51('0x30')],function(_0x33a638){return{'name':_0x33a638[_0xce51('0x31')],'type':_0x33a638['type'][_0xce51('0x32')]};});_0x4a6983[_0xce51('0x33')]=_['map'](_0x102168,'name');_0x4a6983[_0xce51('0x34')]=_[_0xce51('0x35')](_0xb19cf[_0xce51('0x34')]);_0x4a6983[_0xce51('0x36')]=_[_0xce51('0x37')](_0x4a6983['model'],_0x4a6983[_0xce51('0x34')]);_0x18f09a[_0xce51('0x38')]=_[_0xce51('0x37')](_0x4a6983[_0xce51('0x33')],qs[_0xce51('0x39')](_0xb19cf[_0xce51('0x34')][_0xce51('0x39')]));_0x18f09a['attributes']=_0x18f09a[_0xce51('0x38')]['length']?_0x18f09a[_0xce51('0x38')]:_0x4a6983[_0xce51('0x33')];if(!_0xb19cf[_0xce51('0x34')][_0xce51('0x3a')]('nolimit')){_0x18f09a[_0xce51('0x20')]=qs['limit'](_0xb19cf[_0xce51('0x34')][_0xce51('0x20')]);_0x18f09a[_0xce51('0x23')]=qs['offset'](_0xb19cf[_0xce51('0x34')][_0xce51('0x23')]);}_0x18f09a[_0xce51('0x3b')]=qs[_0xce51('0x3c')](_0xb19cf[_0xce51('0x34')][_0xce51('0x3c')]);_0x18f09a['where']=qs[_0xce51('0x36')](_['pick'](_0xb19cf[_0xce51('0x34')],_0x4a6983[_0xce51('0x36')]),_0x102168);if(_0xb19cf[_0xce51('0x34')][_0xce51('0x3d')]){_0x18f09a[_0xce51('0x3e')]=_[_0xce51('0x3f')](_0x18f09a[_0xce51('0x3e')],{'$or':_[_0xce51('0x40')](_0x102168,function(_0x2a7b84){if(_0x2a7b84['type']!=='VIRTUAL'){var _0x41a73b={};_0x41a73b[_0x2a7b84[_0xce51('0x2e')]]={'$like':'%'+_0xb19cf[_0xce51('0x34')][_0xce51('0x3d')]+'%'};return _0x41a73b;}})});}_0x18f09a=_[_0xce51('0x3f')]({},_0x18f09a,_0xb19cf[_0xce51('0x41')]);var _0x255b9d={'where':_0x18f09a[_0xce51('0x3e')]};return db[_0xce51('0x42')][_0xce51('0x22')](_0x255b9d)['then'](function(_0x5e51dc){_0x3eaf44[_0xce51('0x22')]=_0x5e51dc;if(_0xb19cf[_0xce51('0x34')][_0xce51('0x43')]){_0x18f09a[_0xce51('0x44')]=[{'all':!![]}];}return db[_0xce51('0x42')]['findAll'](_0x18f09a);})[_0xce51('0x45')](function(_0x2c354c){_0x3eaf44['rows']=_0x2c354c;return _0x3eaf44;})[_0xce51('0x45')](respondWithFilteredResult(_0x492848,_0x18f09a))[_0xce51('0x46')](handleError(_0x492848,null));};exports['show']=function(_0x5407f0,_0x1a6308){var _0x51d65c={'raw':![],'where':{'id':_0x5407f0[_0xce51('0x47')]['id']}},_0x2b71a9={};_0x2b71a9['model']=_[_0xce51('0x35')](db[_0xce51('0x42')][_0xce51('0x30')]);_0x2b71a9[_0xce51('0x34')]=_[_0xce51('0x35')](_0x5407f0[_0xce51('0x34')]);_0x2b71a9[_0xce51('0x36')]=_['intersection'](_0x2b71a9[_0xce51('0x33')],_0x2b71a9[_0xce51('0x34')]);_0x51d65c[_0xce51('0x38')]=_[_0xce51('0x37')](_0x2b71a9['model'],qs[_0xce51('0x39')](_0x5407f0['query'][_0xce51('0x39')]));_0x51d65c[_0xce51('0x38')]=_0x51d65c['attributes'][_0xce51('0x48')]?_0x51d65c[_0xce51('0x38')]:_0x2b71a9['model'];if(_0x5407f0[_0xce51('0x34')][_0xce51('0x43')]){_0x51d65c[_0xce51('0x44')]=[{'all':!![]}];}_0x51d65c=_['merge']({},_0x51d65c,_0x5407f0[_0xce51('0x41')]);return db[_0xce51('0x42')][_0xce51('0x49')](_0x51d65c)['then'](handleEntityNotFound(_0x1a6308,null))[_0xce51('0x45')](respondWithResult(_0x1a6308,null))[_0xce51('0x46')](handleError(_0x1a6308,null));};exports[_0xce51('0x4a')]=function(_0x3b72b6,_0x530f98){return db[_0xce51('0x42')][_0xce51('0x4a')](_0x3b72b6[_0xce51('0x4b')],{})[_0xce51('0x45')](respondWithResult(_0x530f98,0xc9))[_0xce51('0x46')](handleError(_0x530f98,null));};exports[_0xce51('0x4c')]=function(_0x206c15,_0x48fd0e){var _0x2179d7={'where':{'id':_0x206c15['params']['id']}},_0x2c5c61={};_0x2c5c61[_0xce51('0x33')]=_[_0xce51('0x35')](db[_0xce51('0x42')][_0xce51('0x30')]);_0x2179d7[_0xce51('0x38')]=_[_0xce51('0x37')](_0x2c5c61['model'],qs[_0xce51('0x39')](_0x206c15[_0xce51('0x34')][_0xce51('0x39')]));_0x2179d7['attributes']=_0x2179d7['attributes'][_0xce51('0x48')]?_0x2179d7[_0xce51('0x38')]:_0x2c5c61['model'];if(_0x206c15['query'][_0xce51('0x43')]){_0x2179d7[_0xce51('0x44')]=[{'all':!![]}];}_0x2179d7=_[_0xce51('0x3f')]({},_0x2179d7,_0x206c15[_0xce51('0x41')]);return db[_0xce51('0x42')][_0xce51('0x49')](_0x2179d7)[_0xce51('0x45')](handleEntityNotFound(_0x48fd0e,null))[_0xce51('0x45')](function(_0x5c4935){if(_0x5c4935){var _0x4d488b=_0x5c4935[_0xce51('0x4d')]({'plain':!![]});_0x4d488b=qs['omit'](_0x4d488b,['id','createdAt',_0xce51('0x4e'),_0xce51('0x4f')]);_0x206c15['body']=_[_0xce51('0x50')](_0x206c15[_0xce51('0x4b')],['id',_0xce51('0x51'),'updatedAt']);return db[_0xce51('0x52')]['transaction'](function(_0x43ae66){return db['UserProfile']['create'](_[_0xce51('0x3f')](_0x4d488b,_0x206c15[_0xce51('0x4b')]),{'include':_0x206c15[_0xce51('0x34')][_0xce51('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x43ae66})['then'](function(_0x4bcb79){var _0x5d96c6=_0x4bcb79['get']({'plain':!![]});return db[_0xce51('0x53')][_0xce51('0x54')]({'where':{'userProfileId':_0x206c15[_0xce51('0x47')]['id']},'raw':!![]})[_0xce51('0x45')](function(_0x230772){if(_0x230772){return BPromise[_0xce51('0x55')](_0x230772,function(_0x3f8d49){return new BPromise(function(_0x5153e2,_0x2e080f){if(_0x3f8d49[_0xce51('0x56')]===null||_0x3f8d49[_0xce51('0x56')]===0x1)_0x5153e2(null);return db[_0xce51('0x57')][_0xce51('0x54')]({'where':{'sectionId':_0x3f8d49['id']},'raw':!![]})[_0xce51('0x45')](function(_0x15ea73){var _0x2ff5d0=_[_0xce51('0x40')](_0x15ea73,function(_0x4fe86c){return qs[_0xce51('0x50')](_0x4fe86c,['id',_0xce51('0x51'),_0xce51('0x4e'),'sectionId']);});_0x5153e2(_0x2ff5d0);})[_0xce51('0x46')](function(_0x324eb6){_0x2e080f(_0x324eb6);});})[_0xce51('0x45')](function(_0x2c058f){var _0x33809b=qs[_0xce51('0x50')](_0x3f8d49,['id',_0xce51('0x51'),_0xce51('0x4e')]);_0x33809b[_0xce51('0x58')]=_0x5d96c6['id'];if(_0x2c058f)_0x33809b['Resources']=_0x2c058f;return _0x33809b;})[_0xce51('0x45')](function(_0x4cb1c3){return db[_0xce51('0x53')][_0xce51('0x4a')](_0x4cb1c3,{'include':[{'model':db[_0xce51('0x57')],'as':_0xce51('0x59')}],'raw':!![],'transaction':_0x43ae66});});})[_0xce51('0x45')](function(){return _0x5d96c6;});}});});});}})[_0xce51('0x45')](respondWithResult(_0x48fd0e,0xc9))[_0xce51('0x46')](handleError(_0x48fd0e,null));};exports[_0xce51('0x29')]=function(_0x5c5701,_0x20f58e){if(_0x5c5701[_0xce51('0x4b')]['id']){delete _0x5c5701[_0xce51('0x4b')]['id'];}return db['UserProfile'][_0xce51('0x49')]({'where':{'id':_0x5c5701[_0xce51('0x47')]['id']}})[_0xce51('0x45')](handleEntityNotFound(_0x20f58e,null))['then'](saveUpdates(_0x5c5701[_0xce51('0x4b')],null))[_0xce51('0x45')](respondWithResult(_0x20f58e,null))[_0xce51('0x46')](handleError(_0x20f58e,null));};exports[_0xce51('0x2a')]=function(_0x5edc0f,_0x4b2ced){return db[_0xce51('0x42')][_0xce51('0x49')]({'where':{'id':_0x5edc0f[_0xce51('0x47')]['id']}})[_0xce51('0x45')](handleEntityNotFound(_0x4b2ced,null))[_0xce51('0x45')](removeEntity(_0x4b2ced,null))[_0xce51('0x46')](handleError(_0x4b2ced,null));};exports[_0xce51('0x5a')]=function(_0x5d045d,_0x4f6f9f){return db['UserProfile'][_0xce51('0x5a')]()[_0xce51('0x45')](respondWithResult(_0x4f6f9f,null))[_0xce51('0x46')](handleError(_0x4f6f9f,null));};exports[_0xce51('0x5b')]=function(_0x267eba,_0x5d530f){var _0x500edd=_0x267eba[_0xce51('0x4b')];return db[_0xce51('0x42')]['find']({'where':{'id':_0x267eba[_0xce51('0x47')]['id']}})[_0xce51('0x45')](handleEntityNotFound(_0x5d530f,null))['then'](function(_0x27c0a0){if(_0x27c0a0){return db['sequelize'][_0xce51('0x5c')](function(_0x38f808){return db[_0xce51('0x53')][_0xce51('0x2a')]({'where':{'userProfileId':_0x267eba[_0xce51('0x47')]['id'],'sectionId':_['map'](_0x500edd,function(_0x377007){return _0x377007[_0xce51('0x5d')];})},'transaction':_0x38f808})[_0xce51('0x45')](function(){var _0x312799=_[_0xce51('0x40')](_0x500edd,function(_0x3d1deb){_0x3d1deb['userProfileId']=_0x267eba[_0xce51('0x47')]['id'];return _0x3d1deb;});var _0x111a24=[];return BPromise[_0xce51('0x55')](_0x312799,function(_0x1e5cfd){return db[_0xce51('0x53')]['create'](_0x1e5cfd,{'include':[{'model':db[_0xce51('0x57')],'as':_0xce51('0x59')}],'raw':!![],'transaction':_0x38f808})[_0xce51('0x45')](function(_0xaeb8c4){_0x111a24['push'](_0xaeb8c4[_0xce51('0x4d')]({'plain':!![]}));});})[_0xce51('0x45')](function(){return _0x111a24;});});});}})[_0xce51('0x45')](function(_0x41e97a){return _0x41e97a;})['then'](respondWithResult(_0x5d530f,null))[_0xce51('0x46')](handleError(_0x5d530f,null));};exports['removeSections']=function(_0x27041e,_0x575d53){var _0x2e3aec;return db[_0xce51('0x42')][_0xce51('0x49')]({'where':{'id':_0x27041e[_0xce51('0x47')]['id']},'attributes':['id',_0xce51('0x2e')]})[_0xce51('0x45')](handleEntityNotFound(_0x575d53,null))[_0xce51('0x45')](function(_0x58270f){if(_0x58270f){_0x2e3aec=_0x58270f;return db[_0xce51('0x53')][_0xce51('0x2a')]({'where':{'userProfileId':_0x27041e[_0xce51('0x47')]['id'],'sectionId':_0x27041e[_0xce51('0x34')][_0xce51('0x5e')]}});}})[_0xce51('0x45')](function(){return _0x2e3aec;})['then'](respondWithStatusCode(_0x575d53,null))['catch'](handleError(_0x575d53,null));};exports[_0xce51('0x5f')]=function(_0x12fdca,_0x5e0dbb){var _0xad84=[];var _0x3b53b4=[];return db[_0xce51('0x53')][_0xce51('0x54')]({'where':{'userProfileId':_0x12fdca[_0xce51('0x47')]['id']},'raw':!![]})[_0xce51('0x45')](function(_0x5952bf){_0xad84=_['filter'](_0x5952bf,function(_0x21f51b){return _0x21f51b[_0xce51('0x60')]===0x1||_[_0xce51('0x61')]([0x3eb,0x709],_0x21f51b[_0xce51('0x5d')]);});if(!_[_0xce51('0x62')](_0xad84)){return _['map'](_0xad84,function(_0x3808af){return _0x3808af[_0xce51('0x5d')];});}else{return;}})[_0xce51('0x45')](function(_0x5f37e1){if(_0x5f37e1)_0x3b53b4=_0x5f37e1;if(_[_0xce51('0x61')](_0x3b53b4,0x64)){var _0x3e3304=_['find'](_0xad84,{'sectionId':0x64});return hasDefaultDashboard(_0x3e3304)[_0xce51('0x45')](function(_0x59c70b){return _['map'](_0xad84,function(_0x1e7426){if(_0x1e7426[_0xce51('0x5d')]===0x64){_0x1e7426[_0xce51('0x63')]=_0x59c70b;}return _0x1e7426;});});}else{return;}})[_0xce51('0x45')](function(_0x3ad257){if(_0x3ad257)_0xad84=_0x3ad257;if(_['includes'](_0x3b53b4,0x3eb)){var _0xdcb8a9=_[_0xce51('0x49')](_0xad84,{'sectionId':0x3eb});return getCustomDashboards(_0xdcb8a9)[_0xce51('0x45')](function(_0x371a6b){return _[_0xce51('0x40')](_0xad84,function(_0x3115fc){if(_0xdcb8a9[_0xce51('0x60')]){if(_0x3115fc[_0xce51('0x5d')]===0x3eb){_0x3115fc[_0xce51('0x63')]=_0x371a6b;}}else{if(_0x3115fc[_0xce51('0x5d')]===0x64){if(!_0x3115fc[_0xce51('0x63')]){_0x3115fc[_0xce51('0x63')]=[];}_0x3115fc[_0xce51('0x63')]=_0x3115fc['subsections']['concat'](_0x371a6b);}}return _0x3115fc;});});}else{return;}})[_0xce51('0x45')](function(_0x5d65f9){if(_0x5d65f9)_0xad84=_0x5d65f9;if(_['includes'](_0x3b53b4,0x709)){var _0x53a45b=_[_0xce51('0x49')](_0xad84,{'sectionId':0x709});return getPlugins(_0x53a45b)[_0xce51('0x45')](function(_0x3d3e5b){if(_0x53a45b['enabled']){return _[_0xce51('0x40')](_0xad84,function(_0x3098c6){if(_0x3098c6['sectionId']===0x709){_0x3098c6[_0xce51('0x63')]=_0x3d3e5b;}return _0x3098c6;});}else{var _0x345192={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3d3e5b};var _0x55755e=_[_0xce51('0x40')](_0xad84);_0x55755e['push'](_0x345192);return _0x55755e;}});}else{return;}})[_0xce51('0x45')](function(_0x92976d){if(_0x92976d)_0xad84=_0x92976d;return _['filter'](_0xad84,[_0xce51('0x60'),0x1]);})[_0xce51('0x45')](respondWithResult(_0x5e0dbb,null))['catch'](handleError(_0x5e0dbb,null));};function hasDefaultDashboard(_0x4b2058){var _0x3239e0=[0x65];return new BPromise(function(_0x483b91,_0x3cb0ed){try{if(_0x4b2058[_0xce51('0x56')]){_0x483b91(_0x3239e0);}else{return db[_0xce51('0x57')]['findOne']({'where':{'sectionId':_0x4b2058['id']},'raw':!![]})[_0xce51('0x45')](function(_0x37e207){_0x37e207?_0x483b91(_0x3239e0):_0x483b91();});}}catch(_0x412e75){_0x3cb0ed(_0x412e75);}});}function getCustomDashboards(_0x909337){var _0x2930b4=[];return new BPromise(function(_0x36b00c,_0x1c6108){try{if(_0x909337['autoAssociation']){return db[_0xce51('0x64')][_0xce51('0x54')]({'raw':!![]})[_0xce51('0x45')](function(_0x4e0e4f){_0x4e0e4f['forEach'](function(_0x267e2c){_0x2930b4[_0xce51('0x65')](_0x267e2c['id']+0x1869f);});_0x36b00c(_0x2930b4);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x909337['id']},'raw':!![]})[_0xce51('0x45')](function(_0x340d9f){_0x340d9f[_0xce51('0x66')](function(_0x5d4680){_0x2930b4[_0xce51('0x65')](_0x5d4680['resourceId']+0x1869f);});_0x36b00c(_0x2930b4);});}}catch(_0x4318d0){_0x1c6108(_0x4318d0);}});}function getPlugins(_0x579eb6){var _0x373d60=[];return new BPromise(function(_0x8aecd7,_0x589d96){try{if(_0x579eb6['autoAssociation']){return db[_0xce51('0x67')][_0xce51('0x54')]({'raw':!![]})[_0xce51('0x45')](function(_0x2dcaad){_0x2dcaad[_0xce51('0x66')](function(_0x412be7){_0x373d60['push'](_0x412be7['id']+0x15b38);});_0x8aecd7(_0x373d60);});}else{return db['UserProfileResource'][_0xce51('0x54')]({'where':{'sectionId':_0x579eb6['id']},'raw':!![]})['then'](function(_0x5cb24c){_0x5cb24c[_0xce51('0x66')](function(_0x170b94){_0x373d60['push'](_0x170b94[_0xce51('0x68')]+0x15b38);});_0x8aecd7(_0x373d60);});}}catch(_0x10631e){_0x589d96(_0x10631e);}});}exports[_0xce51('0x69')]=function(_0x5de6da,_0x32efea){return db['UserProfile'][_0xce51('0x49')]({'where':{'id':_0x5de6da[_0xce51('0x47')]['id']}})[_0xce51('0x45')](handleEntityNotFound(_0x32efea,null))[_0xce51('0x45')](function(_0x424b79){if(_0x424b79){return db[_0xce51('0x52')]['transaction'](function(_0x35674d){return db[_0xce51('0x53')][_0xce51('0x54')]({'where':{'userProfileId':_0x5de6da[_0xce51('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0xce51('0x45')](function(_0x2beeb7){if(_0x2beeb7){return db[_0xce51('0x53')]['destroy']({'where':{'userProfileId':_0x5de6da[_0xce51('0x47')]['id'],'id':_['map'](_0x2beeb7,function(_0x30a047){return _0x30a047['id'];})},'transaction':_0x35674d});}})['then'](function(_0x59237c){var _0x4bc01f=_[_0xce51('0x40')](_0x5de6da['body'],function(_0xce3408){_0xce3408[_0xce51('0x58')]=_0x5de6da['params']['id'];return _0xce3408;});return db['UserProfileSection']['bulkCreate'](_0x4bc01f,{'raw':!![],'transaction':_0x35674d});})[_0xce51('0x45')](function(_0x434fdb){var _0xa1f72a=_[_0xce51('0x3d')](_['map'](_0x434fdb,function(_0x45c18a){return _0x45c18a[_0xce51('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0xa1f72a){return db[_0xce51('0x53')]['findAll']({'where':{'userProfileId':_0x5de6da[_0xce51('0x47')]['id'],'sectionId':_[_0xce51('0x40')](_0xa1f72a,function(_0xce67b9){return _0xce67b9['sectionId'];})},'attributes':['id',_0xce51('0x5d')],'raw':!![]})['then'](function(_0x3b5c39){var _0x3f66f9=_[_0xce51('0x40')](_0x5de6da[_0xce51('0x4b')],function(_0x29cc12){_0x29cc12[_0xce51('0x58')]=_0x5de6da[_0xce51('0x47')]['id'];return _0x29cc12;});return db[_0xce51('0x57')][_0xce51('0x6a')](_0x3f66f9,{'raw':!![],'transaction':_0x35674d});});}})['catch'](handleError(_0x32efea,null));});}})[_0xce51('0x45')](function(_0x2b019d){var _0x53d8a6=_[_0xce51('0x40')](_0x2b019d,function(_0x1d100c){return _0x1d100c[_0xce51('0x4d')]({'plain':!![]});});})[_0xce51('0x45')](respondWithResult(_0x32efea,null))[_0xce51('0x46')](handleError(_0x32efea,null));};exports['removeResources']=function(_0x5977d1,_0x4eb856,_0x2418d1){return db['UserProfile']['find']({'where':{'id':_0x5977d1['params']['id']}})['then'](handleEntityNotFound(_0x4eb856,null))[_0xce51('0x45')](function(_0x56689e){if(_0x56689e){return _0x56689e[_0xce51('0x6b')](_0x5977d1[_0xce51('0x34')][_0xce51('0x5e')]);}})['then'](respondWithStatusCode(_0x4eb856,null))[_0xce51('0x46')](handleError(_0x4eb856,null));};exports[_0xce51('0x6c')]=function(_0x140630,_0x36dfab){var _0x4d6cea={};if(!_0x140630[_0xce51('0x34')][_0xce51('0x6d')])throw new Error(_0xce51('0x6e'));if(!_0x140630[_0xce51('0x34')][_0xce51('0x3a')]('nolimit')){_0x4d6cea[_0xce51('0x20')]=qs[_0xce51('0x20')](_0x140630['query'][_0xce51('0x20')]);_0x4d6cea[_0xce51('0x23')]=qs[_0xce51('0x23')](_0x140630[_0xce51('0x34')][_0xce51('0x23')]);}return db['UserProfile']['find']({'where':{'id':_0x140630['params']['id']}})[_0xce51('0x45')](function(_0x2bb55f){if(!_0x2bb55f)throw new Error(_0xce51('0x6f')+_0x140630[_0xce51('0x47')]['id']);return db['UserProfile'][_0xce51('0x6c')](_0x140630);})[_0xce51('0x45')](respondWithFilteredResult(_0x36dfab,_0x4d6cea))[_0xce51('0x46')](handleError(_0x36dfab,null));}; \ No newline at end of file +var _0x1018=['get','omit','createdAt','updatedAt','crudPermissions','transaction','each','autoAssociation','UserProfileResource','sectionId','userProfileId','UserProfileSection','Resources','find','describe','addSections','sequelize','push','ids','getSections','enabled','includes','subsections','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','UserProfile','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','include','findAll','rows','catch','params','options','create','body','clone','includeAll'];(function(_0x30d14d,_0x3af90f){var _0x2efd56=function(_0x4ef9cf){while(--_0x4ef9cf){_0x30d14d['push'](_0x30d14d['shift']());}};_0x2efd56(++_0x3af90f);}(_0x1018,0x90));var _0x8101=function(_0x58fa4c,_0x2720fb){_0x58fa4c=_0x58fa4c-0x0;var _0x20831e=_0x1018[_0x58fa4c];return _0x20831e;};'use strict';var emlformat=require(_0x8101('0x0'));var rimraf=require(_0x8101('0x1'));var zipdir=require(_0x8101('0x2'));var jsonpatch=require(_0x8101('0x3'));var rp=require(_0x8101('0x4'));var moment=require(_0x8101('0x5'));var BPromise=require(_0x8101('0x6'));var Mustache=require(_0x8101('0x7'));var util=require(_0x8101('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x8101('0x9'));var ejs=require(_0x8101('0xa'));var fs=require('fs');var fs_extra=require(_0x8101('0xb'));var _=require(_0x8101('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8101('0xd'));var toCsv=require(_0x8101('0x9'));var querystring=require(_0x8101('0xe'));var Papa=require(_0x8101('0xf'));var Redis=require(_0x8101('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8101('0x11'));var hardwareService=require(_0x8101('0x12'));var logger=require(_0x8101('0x13'))(_0x8101('0x14'));var utils=require('../../config/utils');var config=require(_0x8101('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8101('0x16'))['db'];config[_0x8101('0x17')]=_[_0x8101('0x18')](config['redis'],{'host':_0x8101('0x19'),'port':0x18eb});var socket=require(_0x8101('0x1a'))(new Redis(config['redis']));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x23b9d4,_0x54c59a){_0x54c59a=_0x54c59a||0xcc;return function(_0x35ded2){if(_0x35ded2){return _0x23b9d4[_0x8101('0x1b')](_0x54c59a);}return _0x23b9d4[_0x8101('0x1c')](_0x54c59a)[_0x8101('0x1d')]();};}function respondWithResult(_0x18f9d7,_0x39025b){_0x39025b=_0x39025b||0xc8;return function(_0x3073d4){if(_0x3073d4){return _0x18f9d7['status'](_0x39025b)[_0x8101('0x1e')](_0x3073d4);}};}function respondWithFilteredResult(_0x549887,_0x6b6ecd){return function(_0x20c9a3){if(_0x20c9a3){var _0x1c4d63=typeof _0x6b6ecd[_0x8101('0x1f')]===_0x8101('0x20')&&typeof _0x6b6ecd[_0x8101('0x21')]===_0x8101('0x20');var _0x268994=_0x20c9a3[_0x8101('0x22')];var _0x289b3c=_0x1c4d63?0x0:_0x6b6ecd[_0x8101('0x1f')];var _0x1e0b74=_0x1c4d63?_0x20c9a3[_0x8101('0x22')]:_0x6b6ecd['offset']+_0x6b6ecd['limit'];var _0x58a240;if(_0x1e0b74>=_0x268994){_0x1e0b74=_0x268994;_0x58a240=0xc8;}else{_0x58a240=0xce;}_0x549887[_0x8101('0x1c')](_0x58a240);return _0x549887[_0x8101('0x23')](_0x8101('0x24'),_0x289b3c+'-'+_0x1e0b74+'/'+_0x268994)[_0x8101('0x1e')](_0x20c9a3);}return null;};}function patchUpdates(_0x1da403){return function(_0x289334){try{jsonpatch[_0x8101('0x25')](_0x289334,_0x1da403,!![]);}catch(_0x445886){return BPromise[_0x8101('0x26')](_0x445886);}return _0x289334[_0x8101('0x27')]();};}function saveUpdates(_0x59d4ca,_0x44cdab){return function(_0x4c7827){if(_0x4c7827){return _0x4c7827[_0x8101('0x28')](_0x59d4ca)[_0x8101('0x29')](function(_0x5933b2){return _0x5933b2;});}return null;};}function removeEntity(_0x1e895d,_0x1d13fb){return function(_0x252ae9){if(_0x252ae9){return _0x252ae9[_0x8101('0x2a')]()[_0x8101('0x29')](function(){_0x1e895d[_0x8101('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e9192,_0x51733c){return function(_0x56b071){if(!_0x56b071){_0x5e9192[_0x8101('0x1b')](0x194);}return _0x56b071;};}function handleError(_0x443406,_0xc2ccc6){_0xc2ccc6=_0xc2ccc6||0x1f4;return function(_0x50fb7e){logger['error'](_0x50fb7e[_0x8101('0x2b')]);if(_0x50fb7e['name']){delete _0x50fb7e[_0x8101('0x2c')];}_0x443406['status'](_0xc2ccc6)[_0x8101('0x2d')](_0x50fb7e);};}exports[_0x8101('0x2e')]=function(_0x7294ad,_0x35432f){var _0x51cff4={},_0x447d0b={},_0x578f64={'count':0x0,'rows':[]};var _0x2af5ac=_['map'](db[_0x8101('0x2f')][_0x8101('0x30')],function(_0x38c56f){return{'name':_0x38c56f[_0x8101('0x31')],'type':_0x38c56f[_0x8101('0x32')][_0x8101('0x33')]};});_0x447d0b[_0x8101('0x34')]=_[_0x8101('0x35')](_0x2af5ac,_0x8101('0x2c'));_0x447d0b[_0x8101('0x36')]=_[_0x8101('0x37')](_0x7294ad[_0x8101('0x36')]);_0x447d0b[_0x8101('0x38')]=_['intersection'](_0x447d0b[_0x8101('0x34')],_0x447d0b[_0x8101('0x36')]);_0x51cff4[_0x8101('0x39')]=_[_0x8101('0x3a')](_0x447d0b[_0x8101('0x34')],qs['fields'](_0x7294ad['query'][_0x8101('0x3b')]));_0x51cff4['attributes']=_0x51cff4[_0x8101('0x39')][_0x8101('0x3c')]?_0x51cff4[_0x8101('0x39')]:_0x447d0b[_0x8101('0x34')];if(!_0x7294ad[_0x8101('0x36')][_0x8101('0x3d')](_0x8101('0x3e'))){_0x51cff4[_0x8101('0x21')]=qs[_0x8101('0x21')](_0x7294ad[_0x8101('0x36')][_0x8101('0x21')]);_0x51cff4[_0x8101('0x1f')]=qs['offset'](_0x7294ad[_0x8101('0x36')][_0x8101('0x1f')]);}_0x51cff4[_0x8101('0x3f')]=qs[_0x8101('0x40')](_0x7294ad[_0x8101('0x36')][_0x8101('0x40')]);_0x51cff4['where']=qs[_0x8101('0x38')](_[_0x8101('0x41')](_0x7294ad['query'],_0x447d0b[_0x8101('0x38')]),_0x2af5ac);if(_0x7294ad[_0x8101('0x36')][_0x8101('0x42')]){_0x51cff4['where']=_[_0x8101('0x43')](_0x51cff4['where'],{'$or':_[_0x8101('0x35')](_0x2af5ac,function(_0x28be81){if(_0x28be81[_0x8101('0x32')]!=='VIRTUAL'){var _0x2224de={};_0x2224de[_0x28be81['name']]={'$like':'%'+_0x7294ad[_0x8101('0x36')][_0x8101('0x42')]+'%'};return _0x2224de;}})});}_0x51cff4=_['merge']({},_0x51cff4,_0x7294ad['options']);var _0x3e7afe={'where':_0x51cff4['where']};return db[_0x8101('0x2f')][_0x8101('0x22')](_0x3e7afe)[_0x8101('0x29')](function(_0x161688){_0x578f64[_0x8101('0x22')]=_0x161688;if(_0x7294ad[_0x8101('0x36')]['includeAll']){_0x51cff4[_0x8101('0x44')]=[{'all':!![]}];}return db['UserProfile'][_0x8101('0x45')](_0x51cff4);})[_0x8101('0x29')](function(_0x210877){_0x578f64[_0x8101('0x46')]=_0x210877;return _0x578f64;})[_0x8101('0x29')](respondWithFilteredResult(_0x35432f,_0x51cff4))[_0x8101('0x47')](handleError(_0x35432f,null));};exports['show']=function(_0x2878e7,_0x382bdd){var _0x4b9c44={'raw':![],'where':{'id':_0x2878e7[_0x8101('0x48')]['id']}},_0x4eea78={};_0x4eea78['model']=_[_0x8101('0x37')](db[_0x8101('0x2f')][_0x8101('0x30')]);_0x4eea78[_0x8101('0x36')]=_[_0x8101('0x37')](_0x2878e7['query']);_0x4eea78[_0x8101('0x38')]=_['intersection'](_0x4eea78[_0x8101('0x34')],_0x4eea78[_0x8101('0x36')]);_0x4b9c44[_0x8101('0x39')]=_['intersection'](_0x4eea78[_0x8101('0x34')],qs[_0x8101('0x3b')](_0x2878e7['query'][_0x8101('0x3b')]));_0x4b9c44[_0x8101('0x39')]=_0x4b9c44[_0x8101('0x39')][_0x8101('0x3c')]?_0x4b9c44[_0x8101('0x39')]:_0x4eea78['model'];if(_0x2878e7[_0x8101('0x36')]['includeAll']){_0x4b9c44[_0x8101('0x44')]=[{'all':!![]}];}_0x4b9c44=_['merge']({},_0x4b9c44,_0x2878e7[_0x8101('0x49')]);return db[_0x8101('0x2f')]['find'](_0x4b9c44)['then'](handleEntityNotFound(_0x382bdd,null))[_0x8101('0x29')](respondWithResult(_0x382bdd,null))['catch'](handleError(_0x382bdd,null));};exports[_0x8101('0x4a')]=function(_0x36a157,_0x148e25){return db[_0x8101('0x2f')][_0x8101('0x4a')](_0x36a157[_0x8101('0x4b')],{})[_0x8101('0x29')](respondWithResult(_0x148e25,0xc9))[_0x8101('0x47')](handleError(_0x148e25,null));};exports[_0x8101('0x4c')]=function(_0x5df39c,_0x4ea03f){var _0x362d45={'where':{'id':_0x5df39c['params']['id']}},_0x42ce1c={};_0x42ce1c['model']=_[_0x8101('0x37')](db[_0x8101('0x2f')]['rawAttributes']);_0x362d45[_0x8101('0x39')]=_[_0x8101('0x3a')](_0x42ce1c[_0x8101('0x34')],qs[_0x8101('0x3b')](_0x5df39c[_0x8101('0x36')]['fields']));_0x362d45[_0x8101('0x39')]=_0x362d45['attributes'][_0x8101('0x3c')]?_0x362d45[_0x8101('0x39')]:_0x42ce1c[_0x8101('0x34')];if(_0x5df39c['query'][_0x8101('0x4d')]){_0x362d45[_0x8101('0x44')]=[{'all':!![]}];}_0x362d45=_[_0x8101('0x43')]({},_0x362d45,_0x5df39c[_0x8101('0x49')]);return db[_0x8101('0x2f')]['find'](_0x362d45)[_0x8101('0x29')](handleEntityNotFound(_0x4ea03f,null))[_0x8101('0x29')](function(_0x220dc){if(_0x220dc){var _0x5c9e9d=_0x220dc[_0x8101('0x4e')]({'plain':!![]});_0x5c9e9d=qs[_0x8101('0x4f')](_0x5c9e9d,['id',_0x8101('0x50'),_0x8101('0x51'),_0x8101('0x52')]);_0x5df39c['body']=_['omit'](_0x5df39c['body'],['id',_0x8101('0x50'),_0x8101('0x51')]);return db['sequelize'][_0x8101('0x53')](function(_0x2cd66f){return db[_0x8101('0x2f')][_0x8101('0x4a')](_[_0x8101('0x43')](_0x5c9e9d,_0x5df39c[_0x8101('0x4b')]),{'include':_0x5df39c[_0x8101('0x36')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x2cd66f})['then'](function(_0x155957){var _0x481261=_0x155957[_0x8101('0x4e')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x5df39c[_0x8101('0x48')]['id']},'raw':!![]})[_0x8101('0x29')](function(_0x13d9e6){if(_0x13d9e6){return BPromise[_0x8101('0x54')](_0x13d9e6,function(_0x48509d){return new BPromise(function(_0xbce807,_0x3a3657){if(_0x48509d[_0x8101('0x55')]===null||_0x48509d[_0x8101('0x55')]===0x1)_0xbce807(null);return db[_0x8101('0x56')][_0x8101('0x45')]({'where':{'sectionId':_0x48509d['id']},'raw':!![]})[_0x8101('0x29')](function(_0x34cb98){var _0x748719=_['map'](_0x34cb98,function(_0x4b9f08){return qs[_0x8101('0x4f')](_0x4b9f08,['id',_0x8101('0x50'),'updatedAt',_0x8101('0x57')]);});_0xbce807(_0x748719);})['catch'](function(_0x5139cd){_0x3a3657(_0x5139cd);});})[_0x8101('0x29')](function(_0x4f7156){var _0x564fbd=qs[_0x8101('0x4f')](_0x48509d,['id',_0x8101('0x50'),_0x8101('0x51')]);_0x564fbd[_0x8101('0x58')]=_0x481261['id'];if(_0x4f7156)_0x564fbd['Resources']=_0x4f7156;return _0x564fbd;})['then'](function(_0x42d2e0){return db[_0x8101('0x59')]['create'](_0x42d2e0,{'include':[{'model':db['UserProfileResource'],'as':_0x8101('0x5a')}],'raw':!![],'transaction':_0x2cd66f});});})[_0x8101('0x29')](function(){return _0x481261;});}});});});}})[_0x8101('0x29')](respondWithResult(_0x4ea03f,0xc9))[_0x8101('0x47')](handleError(_0x4ea03f,null));};exports[_0x8101('0x28')]=function(_0x1e914d,_0x52457e){if(_0x1e914d[_0x8101('0x4b')]['id']){delete _0x1e914d[_0x8101('0x4b')]['id'];}return db[_0x8101('0x2f')][_0x8101('0x5b')]({'where':{'id':_0x1e914d[_0x8101('0x48')]['id']}})[_0x8101('0x29')](handleEntityNotFound(_0x52457e,null))[_0x8101('0x29')](saveUpdates(_0x1e914d['body'],null))['then'](respondWithResult(_0x52457e,null))['catch'](handleError(_0x52457e,null));};exports[_0x8101('0x2a')]=function(_0x56b10f,_0x30a435){return db[_0x8101('0x2f')]['find']({'where':{'id':_0x56b10f[_0x8101('0x48')]['id']}})[_0x8101('0x29')](handleEntityNotFound(_0x30a435,null))[_0x8101('0x29')](removeEntity(_0x30a435,null))[_0x8101('0x47')](handleError(_0x30a435,null));};exports[_0x8101('0x5c')]=function(_0x38160f,_0x530ebe){return db[_0x8101('0x2f')]['describe']()[_0x8101('0x29')](respondWithResult(_0x530ebe,null))[_0x8101('0x47')](handleError(_0x530ebe,null));};exports[_0x8101('0x5d')]=function(_0x24053e,_0xc906b1){var _0x30840c=_0x24053e[_0x8101('0x4b')];return db['UserProfile']['find']({'where':{'id':_0x24053e['params']['id']}})[_0x8101('0x29')](handleEntityNotFound(_0xc906b1,null))[_0x8101('0x29')](function(_0x5a717c){if(_0x5a717c){return db[_0x8101('0x5e')]['transaction'](function(_0x5a51d6){return db[_0x8101('0x59')]['destroy']({'where':{'userProfileId':_0x24053e[_0x8101('0x48')]['id'],'sectionId':_[_0x8101('0x35')](_0x30840c,function(_0x1b75cd){return _0x1b75cd[_0x8101('0x57')];})},'transaction':_0x5a51d6})[_0x8101('0x29')](function(){var _0x1adf20=_['map'](_0x30840c,function(_0x5ba897){_0x5ba897['userProfileId']=_0x24053e[_0x8101('0x48')]['id'];return _0x5ba897;});var _0x5c42c4=[];return BPromise[_0x8101('0x54')](_0x1adf20,function(_0x1fe057){return db[_0x8101('0x59')][_0x8101('0x4a')](_0x1fe057,{'include':[{'model':db[_0x8101('0x56')],'as':_0x8101('0x5a')}],'raw':!![],'transaction':_0x5a51d6})['then'](function(_0x45ea4c){_0x5c42c4[_0x8101('0x5f')](_0x45ea4c[_0x8101('0x4e')]({'plain':!![]}));});})[_0x8101('0x29')](function(){return _0x5c42c4;});});});}})[_0x8101('0x29')](function(_0x2b025c){return _0x2b025c;})[_0x8101('0x29')](respondWithResult(_0xc906b1,null))[_0x8101('0x47')](handleError(_0xc906b1,null));};exports['removeSections']=function(_0x4eda89,_0x4ebeb6){var _0xf7206d;return db[_0x8101('0x2f')][_0x8101('0x5b')]({'where':{'id':_0x4eda89[_0x8101('0x48')]['id']},'attributes':['id','name']})[_0x8101('0x29')](handleEntityNotFound(_0x4ebeb6,null))['then'](function(_0x594602){if(_0x594602){_0xf7206d=_0x594602;return db['UserProfileSection'][_0x8101('0x2a')]({'where':{'userProfileId':_0x4eda89['params']['id'],'sectionId':_0x4eda89[_0x8101('0x36')][_0x8101('0x60')]}});}})[_0x8101('0x29')](function(){return _0xf7206d;})[_0x8101('0x29')](respondWithStatusCode(_0x4ebeb6,null))[_0x8101('0x47')](handleError(_0x4ebeb6,null));};exports[_0x8101('0x61')]=function(_0x3144f2,_0x142a02){var _0x322621=[];var _0x1f3cdd=[];return db[_0x8101('0x59')]['findAll']({'where':{'userProfileId':_0x3144f2['params']['id']},'raw':!![]})[_0x8101('0x29')](function(_0x931e39){_0x322621=_[_0x8101('0x42')](_0x931e39,function(_0x12be81){return _0x12be81[_0x8101('0x62')]===0x1||_['includes']([0x3eb,0x709],_0x12be81[_0x8101('0x57')]);});if(!_['isEmpty'](_0x322621)){return _[_0x8101('0x35')](_0x322621,function(_0x3b87a8){return _0x3b87a8[_0x8101('0x57')];});}else{return;}})[_0x8101('0x29')](function(_0x39712a){if(_0x39712a)_0x1f3cdd=_0x39712a;if(_[_0x8101('0x63')](_0x1f3cdd,0x64)){var _0x37ec58=_[_0x8101('0x5b')](_0x322621,{'sectionId':0x64});return hasDefaultDashboard(_0x37ec58)[_0x8101('0x29')](function(_0x5620f5){return _[_0x8101('0x35')](_0x322621,function(_0x442775){if(_0x442775['sectionId']===0x64){_0x442775['subsections']=_0x5620f5;}return _0x442775;});});}else{return;}})[_0x8101('0x29')](function(_0xcf0e79){if(_0xcf0e79)_0x322621=_0xcf0e79;if(_[_0x8101('0x63')](_0x1f3cdd,0x3eb)){var _0x5c84a6=_[_0x8101('0x5b')](_0x322621,{'sectionId':0x3eb});return getCustomDashboards(_0x5c84a6)[_0x8101('0x29')](function(_0x1a368c){return _['map'](_0x322621,function(_0x161701){if(_0x5c84a6[_0x8101('0x62')]){if(_0x161701['sectionId']===0x3eb){_0x161701[_0x8101('0x64')]=_0x1a368c;}}else{if(_0x161701[_0x8101('0x57')]===0x64){if(!_0x161701[_0x8101('0x64')]){_0x161701[_0x8101('0x64')]=[];}_0x161701['subsections']=_0x161701[_0x8101('0x64')]['concat'](_0x1a368c);}}return _0x161701;});});}else{return;}})[_0x8101('0x29')](function(_0x2ceb8f){if(_0x2ceb8f)_0x322621=_0x2ceb8f;if(_[_0x8101('0x63')](_0x1f3cdd,0x709)){var _0x2b30eb=_[_0x8101('0x5b')](_0x322621,{'sectionId':0x709});return getPlugins(_0x2b30eb)[_0x8101('0x29')](function(_0x504ba2){if(_0x2b30eb[_0x8101('0x62')]){return _[_0x8101('0x35')](_0x322621,function(_0x2bd9de){if(_0x2bd9de[_0x8101('0x57')]===0x709){_0x2bd9de[_0x8101('0x64')]=_0x504ba2;}return _0x2bd9de;});}else{var _0x1801b0={'sectionId':0x76c,'enabled':0x1,'subsections':_0x504ba2};var _0x4479b2=_[_0x8101('0x35')](_0x322621);_0x4479b2[_0x8101('0x5f')](_0x1801b0);return _0x4479b2;}});}else{return;}})[_0x8101('0x29')](function(_0x3024af){if(_0x3024af)_0x322621=_0x3024af;return _[_0x8101('0x42')](_0x322621,[_0x8101('0x62'),0x1]);})[_0x8101('0x29')](respondWithResult(_0x142a02,null))[_0x8101('0x47')](handleError(_0x142a02,null));};function hasDefaultDashboard(_0x5a8dfe){var _0x458768=[0x65];return new BPromise(function(_0x37e23a,_0x3513d4){try{if(_0x5a8dfe[_0x8101('0x55')]){_0x37e23a(_0x458768);}else{return db[_0x8101('0x56')]['findOne']({'where':{'sectionId':_0x5a8dfe['id']},'raw':!![]})[_0x8101('0x29')](function(_0x23b89f){_0x23b89f?_0x37e23a(_0x458768):_0x37e23a();});}}catch(_0x23d8ff){_0x3513d4(_0x23d8ff);}});}function getCustomDashboards(_0x2c4a7a){var _0x5077fc=[];return new BPromise(function(_0x1271ea,_0x416fea){try{if(_0x2c4a7a[_0x8101('0x55')]){return db[_0x8101('0x65')]['findAll']({'raw':!![]})[_0x8101('0x29')](function(_0x288f8e){_0x288f8e[_0x8101('0x66')](function(_0x35617b){_0x5077fc[_0x8101('0x5f')](_0x35617b['id']+0x1869f);});_0x1271ea(_0x5077fc);});}else{return db[_0x8101('0x56')]['findAll']({'where':{'sectionId':_0x2c4a7a['id']},'raw':!![]})[_0x8101('0x29')](function(_0x4ab24e){_0x4ab24e[_0x8101('0x66')](function(_0x978109){_0x5077fc[_0x8101('0x5f')](_0x978109[_0x8101('0x67')]+0x1869f);});_0x1271ea(_0x5077fc);});}}catch(_0x2c705c){_0x416fea(_0x2c705c);}});}function getPlugins(_0x5d4e1c){var _0x4ec148=[];return new BPromise(function(_0x578a6e,_0x1bccdf){try{if(_0x5d4e1c[_0x8101('0x55')]){return db[_0x8101('0x68')]['findAll']({'raw':!![]})[_0x8101('0x29')](function(_0x5287d4){_0x5287d4[_0x8101('0x66')](function(_0x49cd05){_0x4ec148[_0x8101('0x5f')](_0x49cd05['id']+0x15b38);});_0x578a6e(_0x4ec148);});}else{return db[_0x8101('0x56')]['findAll']({'where':{'sectionId':_0x5d4e1c['id']},'raw':!![]})[_0x8101('0x29')](function(_0x493e51){_0x493e51['forEach'](function(_0xc0b59a){_0x4ec148[_0x8101('0x5f')](_0xc0b59a['resourceId']+0x15b38);});_0x578a6e(_0x4ec148);});}}catch(_0x34a821){_0x1bccdf(_0x34a821);}});}exports[_0x8101('0x69')]=function(_0x4c796e,_0x18f222){return db[_0x8101('0x2f')][_0x8101('0x5b')]({'where':{'id':_0x4c796e[_0x8101('0x48')]['id']}})[_0x8101('0x29')](handleEntityNotFound(_0x18f222,null))[_0x8101('0x29')](function(_0x4dd104){if(_0x4dd104){return db[_0x8101('0x5e')][_0x8101('0x53')](function(_0x2d3130){return db['UserProfileSection'][_0x8101('0x45')]({'where':{'userProfileId':_0x4c796e[_0x8101('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0x8101('0x29')](function(_0x10d934){if(_0x10d934){return db[_0x8101('0x59')][_0x8101('0x2a')]({'where':{'userProfileId':_0x4c796e[_0x8101('0x48')]['id'],'id':_[_0x8101('0x35')](_0x10d934,function(_0x41a497){return _0x41a497['id'];})},'transaction':_0x2d3130});}})['then'](function(_0x963daa){var _0x34b65a=_[_0x8101('0x35')](_0x4c796e[_0x8101('0x4b')],function(_0x53399e){_0x53399e[_0x8101('0x58')]=_0x4c796e['params']['id'];return _0x53399e;});return db[_0x8101('0x59')][_0x8101('0x6a')](_0x34b65a,{'raw':!![],'transaction':_0x2d3130});})[_0x8101('0x29')](function(_0x1164e5){var _0x3b18f5=_[_0x8101('0x42')](_[_0x8101('0x35')](_0x1164e5,function(_0x16ee29){return _0x16ee29[_0x8101('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x3b18f5){return db[_0x8101('0x59')][_0x8101('0x45')]({'where':{'userProfileId':_0x4c796e[_0x8101('0x48')]['id'],'sectionId':_[_0x8101('0x35')](_0x3b18f5,function(_0x5aaecc){return _0x5aaecc[_0x8101('0x57')];})},'attributes':['id',_0x8101('0x57')],'raw':!![]})[_0x8101('0x29')](function(_0x17ced9){var _0x36af24=_['map'](_0x4c796e[_0x8101('0x4b')],function(_0x3c7336){_0x3c7336[_0x8101('0x58')]=_0x4c796e[_0x8101('0x48')]['id'];return _0x3c7336;});return db[_0x8101('0x56')]['bulkCreate'](_0x36af24,{'raw':!![],'transaction':_0x2d3130});});}})[_0x8101('0x47')](handleError(_0x18f222,null));});}})[_0x8101('0x29')](function(_0x1c294d){var _0x491925=_[_0x8101('0x35')](_0x1c294d,function(_0x5b8245){return _0x5b8245[_0x8101('0x4e')]({'plain':!![]});});})[_0x8101('0x29')](respondWithResult(_0x18f222,null))['catch'](handleError(_0x18f222,null));};exports['removeResources']=function(_0x430ec7,_0x411ad4,_0x5747c5){return db[_0x8101('0x2f')][_0x8101('0x5b')]({'where':{'id':_0x430ec7['params']['id']}})[_0x8101('0x29')](handleEntityNotFound(_0x411ad4,null))['then'](function(_0x53f530){if(_0x53f530){return _0x53f530[_0x8101('0x6b')](_0x430ec7[_0x8101('0x36')]['ids']);}})[_0x8101('0x29')](respondWithStatusCode(_0x411ad4,null))[_0x8101('0x47')](handleError(_0x411ad4,null));};exports['getResources']=function(_0x2bd6b1,_0x190080){var _0x1a792f={};if(!_0x2bd6b1[_0x8101('0x36')][_0x8101('0x6c')])throw new Error('Missing\x20section\x20parameter');if(!_0x2bd6b1[_0x8101('0x36')]['hasOwnProperty'](_0x8101('0x3e'))){_0x1a792f[_0x8101('0x21')]=qs['limit'](_0x2bd6b1[_0x8101('0x36')][_0x8101('0x21')]);_0x1a792f[_0x8101('0x1f')]=qs[_0x8101('0x1f')](_0x2bd6b1[_0x8101('0x36')][_0x8101('0x1f')]);}return db[_0x8101('0x2f')][_0x8101('0x5b')]({'where':{'id':_0x2bd6b1[_0x8101('0x48')]['id']}})[_0x8101('0x29')](function(_0x578be3){if(!_0x578be3)throw new Error(_0x8101('0x6d')+_0x2bd6b1['params']['id']);return db[_0x8101('0x2f')][_0x8101('0x6e')](_0x2bd6b1);})[_0x8101('0x29')](respondWithFilteredResult(_0x190080,_0x1a792f))[_0x8101('0x47')](handleError(_0x190080,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 6cd216e..11cd5f4 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 _0xf40b=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserProfile','setMaxListeners','save'];(function(_0x11498f,_0x24a9ce){var _0x47c861=function(_0x582a6c){while(--_0x582a6c){_0x11498f['push'](_0x11498f['shift']());}};_0x47c861(++_0x24a9ce);}(_0xf40b,0xb0));var _0xbf40=function(_0x2475fb,_0x238ba5){_0x2475fb=_0x2475fb-0x0;var _0x5a879a=_0xf40b[_0x2475fb];return _0x5a879a;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xbf40('0x0'))['db'][_0xbf40('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xbf40('0x2')](0x0);var events={'afterCreate':_0xbf40('0x3'),'afterUpdate':'update','afterDestroy':_0xbf40('0x4')};function emitEvent(_0x2a92dc){return function(_0x118fce,_0x887cae,_0x1a1c6f){UserProfileEvents['emit'](_0x2a92dc+':'+_0x118fce['id'],_0x118fce);UserProfileEvents[_0xbf40('0x5')](_0x2a92dc,_0x118fce);_0x1a1c6f(null);};}for(var e in events){if(events[_0xbf40('0x6')](e)){var event=events[e];UserProfile[_0xbf40('0x7')](e,emitEvent(event));}}module[_0xbf40('0x8')]=UserProfileEvents; \ No newline at end of file +var _0xe260=['remove','emit','hook','exports','events','UserProfile','setMaxListeners','save','update'];(function(_0x2392bf,_0x975591){var _0xfa60e0=function(_0x2e82a9){while(--_0x2e82a9){_0x2392bf['push'](_0x2392bf['shift']());}};_0xfa60e0(++_0x975591);}(_0xe260,0x94));var _0x0e26=function(_0x16127c,_0x401f88){_0x16127c=_0x16127c-0x0;var _0x179b1a=_0xe260[_0x16127c];return _0x179b1a;};'use strict';var EventEmitter=require(_0x0e26('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x0e26('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x0e26('0x2')](0x0);var events={'afterCreate':_0x0e26('0x3'),'afterUpdate':_0x0e26('0x4'),'afterDestroy':_0x0e26('0x5')};function emitEvent(_0x16613c){return function(_0x4a2388,_0x937f2a,_0x141a58){UserProfileEvents[_0x0e26('0x6')](_0x16613c+':'+_0x4a2388['id'],_0x4a2388);UserProfileEvents['emit'](_0x16613c,_0x4a2388);_0x141a58(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x0e26('0x7')](e,emitEvent(event));}}module[_0x0e26('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 171c5d3..7dc53dc 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 _0x0b9c=['Dashboard','intervals','Interval','Pause','Schedule','Tag','templates','triggers','Trigger','trunks','Trunk','variables','plugins','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','raw','mergeResources','length','push','UserProfileSection','all','ignore','isEmpty','union','find','autoAssociation','rawAttributes','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','reportType','default','DefaultReports','custom','CustomReports','rows','ids','customSorting','extraQueryConditions','count','include','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','filter','value','findAll','then','associatedResources','map','catch','field','model','name','resolve','UserProfileResource','resourceId','toLowerCase','childModel','SquareProject','odbc','SquareOdbc','SquareRecording','parentSections','projectName','JscriptyProject','contacts','CmContact','ListId','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceContext','voicemails','VoiceMail','Agents','membername','User','role','agent','Telephones','VoiceQueues','VoiceQueue','type','inbound','QueueCampaigns','queue','outbound','musiconholds','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','agents','telephones','Users','admin','user','ZendeskAccount','SalesforceAccount','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','CannedAnswer','Disposition','customdashboards'];(function(_0x18be13,_0x12f269){var _0x17317b=function(_0x449d31){while(--_0x449d31){_0x18be13['push'](_0x18be13['shift']());}};_0x17317b(++_0x12f269);}(_0x0b9c,0x11c));var _0xc0b9=function(_0x1a5c41,_0xcd5c02){_0x1a5c41=_0x1a5c41-0x0;var _0x17629c=_0x0b9c[_0x1a5c41];return _0x17629c;};'use strict';var _=require(_0xc0b9('0x0'));var attributes=require(_0xc0b9('0x1'));var squel=require(_0xc0b9('0x2'));module[_0xc0b9('0x3')]=function(_0x26d93f){var _0x2967f5=_0x26d93f['models'];function _0x191b8f(_0x1a2e6a,_0x17a2de){return new Promise(function(_0x569b73,_0x4d0c34){if(!_0x17a2de)return _0x569b73(null);var _0x5b587a=_0x17a2de[_0xc0b9('0x4')]?{[_0x17a2de[_0xc0b9('0x4')]['field']]:_0x17a2de['filter'][_0xc0b9('0x5')]}:undefined;return _0x2967f5[_0x1a2e6a][_0xc0b9('0x6')]({'where':_0x5b587a,'raw':!![]})[_0xc0b9('0x7')](function(_0x1e607b){_0x17a2de[_0xc0b9('0x8')]=_[_0xc0b9('0x9')](_0x1e607b,'id');_0x569b73(_0x17a2de);})[_0xc0b9('0xa')](function(_0x16b74e){_0x4d0c34(_0x16b74e);});});}function _0x583fd6(_0x3e368d,_0x2bf1be){return new Promise(function(_0xe7763d,_0x4c256a){var _0x55f0ea=_0x3e368d[_0xc0b9('0x4')]?{[_0x3e368d[_0xc0b9('0x4')][_0xc0b9('0xb')]]:_0x3e368d[_0xc0b9('0x4')][_0xc0b9('0x5')]}:undefined;return _0x2967f5[_0x3e368d[_0xc0b9('0xc')]]['findAll']({'where':_0x55f0ea,'raw':!![]})[_0xc0b9('0x7')](function(_0xa826ef){_0x2bf1be[_0xc0b9('0x8')]=_[_0xc0b9('0x9')](_0xa826ef,function(_0x444342){return _0x444342[_0xc0b9('0xd')];});_0xe7763d(_0x2bf1be);})['catch'](function(_0xd44b21){_0x4c256a(_0xd44b21);});});}function _0x482fa0(_0x1f2d2a,_0x81ad78,_0x2eb050){if(!_0x81ad78)return Promise[_0xc0b9('0xe')](null);return new Promise(function(_0x5a12ef,_0x355396){return _0x2967f5[_0xc0b9('0xf')][_0xc0b9('0x6')]({'where':{'sectionId':_0x81ad78['id']},'raw':!![]})['then'](function(_0x257e73){if(_0x1f2d2a[_0xc0b9('0xb')]&&_0x1f2d2a[_0xc0b9('0xb')]!=='id'){_0x81ad78[_0xc0b9('0x8')]=_['map'](_0x257e73,function(_0x20f07b){return _0x20f07b[_0x1f2d2a['field']];});}else{if(_0x2eb050==='AnalyticExtractedReport'){_0x81ad78['associatedResources']=_['map'](_0x257e73,function(_0x32c517){return{'id':_0x32c517[_0xc0b9('0x10')],'type':_0x32c517['type']};});}else{_0x81ad78[_0xc0b9('0x8')]=_[_0xc0b9('0x9')](_0x257e73,function(_0x5f26af){return _0x5f26af[_0xc0b9('0x10')];});}}_0x5a12ef(_0x81ad78);})[_0xc0b9('0xa')](function(_0x486cee){_0x355396(_0x486cee);});});}function _0x8d2b58(_0x46bb6d,_0x7397d1){var _0x41c87f={'parentSections':[]};switch(_0x46bb6d[_0xc0b9('0x11')]()){case'squareprojects':_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x13');break;case _0xc0b9('0x14'):_0x41c87f['childModel']=_0xc0b9('0x15');break;case'squarerecordings':_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x16');_0x41c87f[_0xc0b9('0x17')]=[{'name':'SquareProjects','field':_0xc0b9('0xd'),'foreignKey':_0xc0b9('0x18')}];break;case'projects':_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x19');break;case _0xc0b9('0x1a'):_0x41c87f['childModel']=_0xc0b9('0x1b');_0x41c87f[_0xc0b9('0x17')]=[{'name':'Lists','field':'id','foreignKey':_0xc0b9('0x1c')}];break;case'lists':_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x1d');break;case _0xc0b9('0x1e'):_0x41c87f['childModel']='CmCompany';break;case _0xc0b9('0x1f'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x20');break;case _0xc0b9('0x21'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x22');break;case'chatwebsites':_0x41c87f['childModel']=_0xc0b9('0x23');break;case _0xc0b9('0x24'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x25');break;case _0xc0b9('0x26'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x27');break;case'inboundroutes':case _0xc0b9('0x28'):case _0xc0b9('0x29'):_0x41c87f[_0xc0b9('0x12')]='VoiceExtension';break;case'contexts':_0x41c87f['childModel']=_0xc0b9('0x2a');break;case _0xc0b9('0x2b'):_0x41c87f['childModel']=_0xc0b9('0x2c');break;case'voicerecordings':_0x41c87f[_0xc0b9('0x12')]='VoiceRecording';_0x41c87f[_0xc0b9('0x17')]=[{'name':_0xc0b9('0x2d'),'field':_0xc0b9('0xd'),'foreignKey':_0xc0b9('0x2e'),'model':_0xc0b9('0x2f'),'filter':{'field':_0xc0b9('0x30'),'value':[_0xc0b9('0x31')]}},{'name':_0xc0b9('0x32'),'field':_0xc0b9('0xd'),'foreignKey':_0xc0b9('0x2e'),'model':_0xc0b9('0x2f'),'filter':{'field':'role','value':['telephone']}},{'name':_0xc0b9('0x33'),'field':'name','foreignKey':'queue','model':_0xc0b9('0x34'),'filter':{'field':_0xc0b9('0x35'),'value':[_0xc0b9('0x36')]}},{'name':_0xc0b9('0x37'),'field':_0xc0b9('0xd'),'foreignKey':_0xc0b9('0x38'),'model':'VoiceQueue','filter':{'field':_0xc0b9('0x35'),'value':[_0xc0b9('0x39')]}}];break;case _0xc0b9('0x3a'):_0x41c87f['childModel']='VoiceMusicOnHold';break;case _0xc0b9('0x3b'):_0x41c87f[_0xc0b9('0x12')]='VoiceChanSpy';break;case _0xc0b9('0x3c'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x3d');break;case _0xc0b9('0x3e'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x3f');break;case _0xc0b9('0x40'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x41');break;case _0xc0b9('0x42'):_0x41c87f[_0xc0b9('0x12')]='MailAccount';break;case _0xc0b9('0x43'):_0x41c87f['childModel']=_0xc0b9('0x44');break;case _0xc0b9('0x45'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x46');break;case _0xc0b9('0x47'):_0x41c87f['childModel']=_0xc0b9('0x48');break;case _0xc0b9('0x49'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x4a');break;case _0xc0b9('0x4b'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x4c');break;case'whatsappqueues':_0x41c87f[_0xc0b9('0x12')]='WhatsappQueue';break;case _0xc0b9('0x4d'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x4e');break;case _0xc0b9('0x4f'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x50');break;case _0xc0b9('0x51'):case'queuecampaigns':_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x34');if(_0x7397d1){_0x41c87f['parentSections']=[{'name':_0xc0b9('0x33')},{'name':_0xc0b9('0x37')}];}break;case'users':case _0xc0b9('0x52'):case _0xc0b9('0x53'):_0x41c87f[_0xc0b9('0x12')]='User';if(_0x7397d1){_0x41c87f['parentSections']=[{'name':_0xc0b9('0x54'),'filter':{'field':'role','value':[_0xc0b9('0x55'),_0xc0b9('0x56')]},'ignore':!![]},{'name':'Agents'},{'name':_0xc0b9('0x32')}];}break;case'zendeskaccounts':_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x57');break;case'salesforceaccounts':_0x41c87f['childModel']=_0xc0b9('0x58');break;case'freshdeskaccounts':_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x59');break;case'sugarcrmaccounts':_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x5a');break;case _0xc0b9('0x5b'):_0x41c87f['childModel']=_0xc0b9('0x5c');break;case _0xc0b9('0x5d'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x5e');break;case'vtigeraccounts':_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x2f');break;case'cannedanswers':_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x5f');break;case'dispositions':_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x60');break;case _0xc0b9('0x61'):_0x41c87f['childModel']=_0xc0b9('0x62');break;case _0xc0b9('0x63'):_0x41c87f['childModel']=_0xc0b9('0x64');break;case'pauses':_0x41c87f['childModel']=_0xc0b9('0x65');break;case'scheduler':_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x66');break;case'sounds':_0x41c87f[_0xc0b9('0x12')]='Sound';break;case'tags':_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x67');break;case _0xc0b9('0x68'):_0x41c87f[_0xc0b9('0x12')]='Template';break;case _0xc0b9('0x69'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x6a');break;case _0xc0b9('0x6b'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x6c');break;case _0xc0b9('0x6d'):_0x41c87f[_0xc0b9('0x12')]='Variable';break;case _0xc0b9('0x6e'):_0x41c87f[_0xc0b9('0x12')]='Plugin';break;case _0xc0b9('0x6f'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x70');_0x41c87f['parentSections']=[{'name':_0xc0b9('0x71'),'field':'id','foreignKey':_0xc0b9('0x72')}];break;case _0xc0b9('0x73'):_0x41c87f[_0xc0b9('0x12')]=_0xc0b9('0x74');break;}return _0x41c87f;}function _0x28dc02(_0x19b7c2,_0x422320){var _0x516985=_0x19b7c2[_0xc0b9('0x75')](0x0)[_0xc0b9('0x76')]()+_0x19b7c2[_0xc0b9('0x77')](0x1);var _0x42be3c={'type':_0x2967f5[_0xc0b9('0x78')][_0xc0b9('0x79')][_0xc0b9('0x7a')],'raw':!![]};return new Promise(function(_0x11f177,_0x531c39){var _0x5df328=squel[_0xc0b9('0x7b')]()[_0xc0b9('0xb')](_0xc0b9('0x7c')+_0x516985+_0xc0b9('0x7d'),'id')[_0xc0b9('0xb')](_0xc0b9('0x7e'))[_0xc0b9('0x7f')](_0xc0b9('0x80')+_0x19b7c2+'_interactions','ui')[_0xc0b9('0x81')](_0xc0b9('0x82'),_0x422320['id']);return _0x2967f5[_0xc0b9('0x83')][_0xc0b9('0x84')](_0x5df328[_0xc0b9('0x85')](),_0x42be3c)[_0xc0b9('0x7')](function(_0x540d9d){_0x422320[_0x516985+_0xc0b9('0x86')]=_0x540d9d;_0x11f177(_0x540d9d);})[_0xc0b9('0xa')](function(_0x1d6ccd){_0x531c39(_0x1d6ccd);});});}return _0x26d93f[_0xc0b9('0x87')](_0xc0b9('0x88'),attributes,{'tableName':_0xc0b9('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3eb894){var _0x57130d=require(_0xc0b9('0x8a'));var _0x1e9343={'raw':_0x3eb894[_0xc0b9('0x84')][_0xc0b9('0x8b')],'where':{}};var _0x3df3b0={};var _0x2a344e={'count':0x0,'rows':[]};var _0x3079bd=_0x3eb894[_0xc0b9('0x84')]['section'];var _0x307032=_0x3eb894['query'][_0xc0b9('0x8c')]||![];var _0x58b985=_0x8d2b58(_0x3079bd,_0x307032);if(!_0x58b985[_0xc0b9('0x12')])throw new Error('Invalid\x20section\x20\x27'+_0x3079bd+'\x27');var _0x4ed4a8=[{'name':_0x3079bd}];if(!_['isEmpty'](_0x58b985[_0xc0b9('0x17')]))_0x4ed4a8=_0x58b985[_0xc0b9('0x17')];var _0x1b013e=[];for(var _0x391997=0x0;_0x391997<_0x4ed4a8[_0xc0b9('0x8d')];_0x391997++){_0x1b013e[_0xc0b9('0x8e')](_0x2967f5[_0xc0b9('0x8f')]['find']({'where':{'userProfileId':_0x3eb894['params']['id'],'name':_0x4ed4a8[_0x391997][_0xc0b9('0xd')]},'raw':!![]}));}return Promise[_0xc0b9('0x90')](_0x1b013e)[_0xc0b9('0x7')](function(_0x578ec7){var _0x3a3723=_['filter'](_0x578ec7,function(_0x54e489){return _0x54e489?_0x54e489:undefined;});var _0x7da7cb=_[_0xc0b9('0x4')](_0x4ed4a8,[_0xc0b9('0x91'),!![]]);var _0x8becfb=_[_0xc0b9('0x92')](_0x3a3723)&&_[_0xc0b9('0x92')](_0x7da7cb)?null:_[_0xc0b9('0x93')](_0x7da7cb,_0x3a3723);if(!_0x8becfb)return null;var _0x811b54=[];for(var _0x35b9cd=0x0;_0x35b9cd<_0x8becfb[_0xc0b9('0x8d')];_0x35b9cd++){var _0x2891dc=_[_0xc0b9('0x94')](_0x4ed4a8,function(_0x1c9665){return _0x8becfb[_0x35b9cd]?_0x1c9665[_0xc0b9('0xd')]===_0x8becfb[_0x35b9cd][_0xc0b9('0xd')]:null;});if(_0x2891dc){if(_0x8becfb[_0x35b9cd][_0xc0b9('0x91')]){_0x811b54['push'](_0x191b8f(_0x58b985['childModel'],_0x8becfb[_0x35b9cd]));}else{if(!_0x8becfb[_0x35b9cd][_0xc0b9('0x95')]){_0x811b54['push'](_0x482fa0(_0x2891dc,_0x8becfb[_0x35b9cd],_0x58b985['childModel']));}else{if(_0x2891dc[_0xc0b9('0xc')]){_0x811b54['push'](_0x583fd6(_0x2891dc,_0x8becfb[_0x35b9cd]));}}}}}return Promise[_0xc0b9('0x90')](_0x811b54);})[_0xc0b9('0x7')](function(_0x3af0ed){var _0xc30d21=_0x3af0ed;var _0x525f45=null;if(_0xc30d21){_0x525f45=_0xc30d21[_0xc0b9('0x8d')]===0x1?_0xc30d21[0x0]:null;}if(!_0x525f45&&!_0xc30d21)return _0x2a344e;var _0x2621fb=_0x2967f5[_0x58b985[_0xc0b9('0x12')]][_0xc0b9('0x96')];_0x3df3b0[_0xc0b9('0xc')]=_[_0xc0b9('0x97')](_0x2621fb);_0x3df3b0[_0xc0b9('0x84')]=_['keys'](_0x3eb894[_0xc0b9('0x84')]);_0x3df3b0[_0xc0b9('0x98')]=_['intersection'](_0x3df3b0[_0xc0b9('0xc')],_0x3df3b0[_0xc0b9('0x84')]);_0x1e9343['attributes']=_[_0xc0b9('0x99')](_0x3df3b0[_0xc0b9('0xc')],_0x57130d['fields'](_0x3eb894['query']['fields']));_0x1e9343[_0xc0b9('0x9a')]=_0x1e9343[_0xc0b9('0x9a')][_0xc0b9('0x8d')]?_0x1e9343['attributes']:_0x3df3b0[_0xc0b9('0xc')];if(!_0x3eb894['query'][_0xc0b9('0x9b')](_0xc0b9('0x9c'))){_0x1e9343[_0xc0b9('0x9d')]=_0x57130d[_0xc0b9('0x9d')](_0x3eb894['query']['limit']);_0x1e9343[_0xc0b9('0x9e')]=_0x57130d[_0xc0b9('0x9e')](_0x3eb894[_0xc0b9('0x84')][_0xc0b9('0x9e')]);}_0x1e9343[_0xc0b9('0x9f')]=_0x57130d[_0xc0b9('0xa0')](_0x3eb894[_0xc0b9('0x84')][_0xc0b9('0xa0')]);_0x1e9343['where']=_0x57130d[_0xc0b9('0x98')](_[_0xc0b9('0xa1')](_0x3eb894['query'],_0x3df3b0[_0xc0b9('0x98')]));if(_0x3eb894[_0xc0b9('0x84')][_0xc0b9('0x4')]){_0x1e9343[_0xc0b9('0x81')]=_[_0xc0b9('0xa2')](_0x1e9343['where'],{'$or':_[_0xc0b9('0x9')](_0x2621fb,function(_0x467d71){if(_0x467d71['type'][_0xc0b9('0xa3')]!==_0xc0b9('0xa4')){var _0x3825ef={};_0x3825ef[_0x467d71[_0xc0b9('0xb')]]={'$like':'%'+_0x3eb894[_0xc0b9('0x84')]['filter']+'%'};return _0x3825ef;}})});}var _0x4dc2ed=[];var _0xcdeb8f=null;var _0x348960={};if(_0x525f45){_0xcdeb8f=_[_0xc0b9('0x94')](_0x4ed4a8,[_0xc0b9('0xd'),_0x525f45['name']]);if(_0xcdeb8f['field']){_0x348960={};if(_0x58b985[_0xc0b9('0x12')]===_0xc0b9('0x70')){_0x348960[_0xcdeb8f[_0xc0b9('0xa5')]]=_[_0xc0b9('0x9')](_0x525f45[_0xc0b9('0x8')],'id');}else{_0x348960[_0xcdeb8f[_0xc0b9('0xa5')]]=_0x525f45[_0xc0b9('0x8')];}_0x4dc2ed[_0xc0b9('0x8e')](_0x348960);}else{_0x1e9343[_0xc0b9('0x81')]['id']=_0x525f45[_0xc0b9('0x8')];}}else{for(var _0x55f14c=0x0;_0x55f14c<_0xc30d21[_0xc0b9('0x8d')];_0x55f14c++){_0xcdeb8f=_[_0xc0b9('0x94')](_0x4ed4a8,[_0xc0b9('0xd'),_0xc30d21[_0x55f14c][_0xc0b9('0xd')]]);if(_0xcdeb8f[_0xc0b9('0xb')]){_0x348960={};_0x348960[_0xcdeb8f[_0xc0b9('0xa5')]]=_0xc30d21[_0x55f14c][_0xc0b9('0x8')];_0x4dc2ed[_0xc0b9('0x8e')](_0x348960);}else{if(!_0x1e9343[_0xc0b9('0x81')]['id'])_0x1e9343[_0xc0b9('0x81')]['id']=[];_0xc30d21[_0x55f14c][_0xc0b9('0x8')][_0xc0b9('0xa6')](function(_0x501794){_0x1e9343[_0xc0b9('0x81')]['id']['push'](_0x501794);});}}}if(!_[_0xc0b9('0x92')](_0x4dc2ed)){_0x1e9343[_0xc0b9('0x81')]=_[_0xc0b9('0xa2')](_0x1e9343[_0xc0b9('0x81')],{'$and':{'$or':_0x4dc2ed}});}_0x1e9343=_[_0xc0b9('0xa2')]({},_0x1e9343,_0x3eb894[_0xc0b9('0xa7')]);if(_0x525f45&&!_0x525f45[_0xc0b9('0x95')]&&_0x58b985['childModel']===_0xc0b9('0x70')){if(_0x3eb894[_0xc0b9('0x84')]['includeAll']){_0x1e9343['include']=[{'all':!![]}];}return _0x2967f5[_0x58b985[_0xc0b9('0x12')]][_0xc0b9('0x6')](_0x1e9343)[_0xc0b9('0x7')](function(_0x127f41){var _0x1c7437=[];_0x127f41[_0xc0b9('0xa6')](function(_0x467fb3){var _0x5079a2;switch(_0x467fb3[_0xc0b9('0xa8')]){case _0xc0b9('0xa9'):_0x5079a2=_[_0xc0b9('0x94')](_0x525f45['associatedResources'],function(_0x5f0187){return _0x5f0187['id']===_0x467fb3[_0xc0b9('0x72')]&&_0x5f0187[_0xc0b9('0x35')]===_0xc0b9('0xaa');});break;case _0xc0b9('0xab'):_0x5079a2=_[_0xc0b9('0x94')](_0x525f45[_0xc0b9('0x8')],function(_0x43cf85){return _0x43cf85['id']===_0x467fb3[_0xc0b9('0x72')]&&_0x43cf85['type']===_0xc0b9('0xac');});break;}if(_0x5079a2)_0x1c7437[_0xc0b9('0x8e')](_0x467fb3);});_0x2a344e['count']=_0x1c7437[_0xc0b9('0x8d')];_0x2a344e[_0xc0b9('0xad')]=_0x1c7437;return _0x2a344e;});}else{if(!_[_0xc0b9('0x92')](_0x3eb894[_0xc0b9('0x84')][_0xc0b9('0xae')])){_0x1e9343[_0xc0b9('0x81')]['id']=_0x1e9343[_0xc0b9('0x81')]['id']?_[_0xc0b9('0x99')](_0x1e9343['where']['id'],_0x3eb894[_0xc0b9('0x84')]['ids']):_0x3eb894[_0xc0b9('0x84')]['ids'];if(_0x3eb894[_0xc0b9('0x84')][_0xc0b9('0xaf')]){_0x1e9343['order']=_0x3eb894[_0xc0b9('0x84')][_0xc0b9('0xaf')];}}if(_0x3eb894[_0xc0b9('0x84')][_0xc0b9('0xb0')]){_0x1e9343[_0xc0b9('0x81')]=_[_0xc0b9('0xa2')](_0x1e9343[_0xc0b9('0x81')],{'$and':_0x3eb894[_0xc0b9('0x84')][_0xc0b9('0xb0')]});}return _0x2967f5[_0x58b985[_0xc0b9('0x12')]]['count']({'where':_0x1e9343['where']})[_0xc0b9('0x7')](function(_0x17ae71){_0x2a344e[_0xc0b9('0xb1')]=_0x17ae71;if(_0x3eb894[_0xc0b9('0x84')]['includeAll']){if(_0x58b985[_0xc0b9('0x12')]==='CmContact'){_0x1e9343[_0xc0b9('0xb2')]=[{'model':_0x2967f5[_0xc0b9('0x67')],'as':_0xc0b9('0xb3'),'attributes':['id',_0xc0b9('0xd'),_0xc0b9('0xb4')],'required':_0x3eb894['query'][_0xc0b9('0xb5')]?!![]:![]},{'model':_0x2967f5[_0xc0b9('0x67')],'as':_0xc0b9('0xb6'),'attributes':['id','name',_0xc0b9('0xb4')],'through':_0x3eb894[_0xc0b9('0x84')][_0xc0b9('0xb5')]?{'attributes':[],'where':{'TagId':_0x3eb894['query']['tag']||undefined}}:{},'required':_0x3eb894[_0xc0b9('0x84')][_0xc0b9('0xb5')]?!![]:![]}];}else{_0x1e9343[_0xc0b9('0xb2')]=[{'all':!![]}];}}return _0x2967f5[_0x58b985['childModel']][_0xc0b9('0x6')](_0x1e9343);})[_0xc0b9('0x7')](function(_0x4cf973){_0x2a344e['rows']=_0x4cf973;if(_0x3079bd===_0xc0b9('0x2d')&&_0x3eb894[_0xc0b9('0x84')][_0xc0b9('0xb7')]===_0xc0b9('0xb8')){var _0x1679ab=[];for(var _0x14e3cc=0x0;_0x14e3cc<_0x2a344e[_0xc0b9('0xad')][_0xc0b9('0x8d')];_0x14e3cc++){_0x1679ab[_0xc0b9('0x8e')](_0x28dc02(_0xc0b9('0xb9'),_0x2a344e['rows'][_0x14e3cc]['dataValues']));_0x1679ab[_0xc0b9('0x8e')](_0x28dc02('sms',_0x2a344e[_0xc0b9('0xad')][_0x14e3cc][_0xc0b9('0xba')]));_0x1679ab['push'](_0x28dc02(_0xc0b9('0xbb'),_0x2a344e[_0xc0b9('0xad')][_0x14e3cc][_0xc0b9('0xba')]));_0x1679ab[_0xc0b9('0x8e')](_0x28dc02(_0xc0b9('0xbc'),_0x2a344e[_0xc0b9('0xad')][_0x14e3cc][_0xc0b9('0xba')]));_0x1679ab[_0xc0b9('0x8e')](_0x28dc02(_0xc0b9('0xbd'),_0x2a344e['rows'][_0x14e3cc][_0xc0b9('0xba')]));_0x1679ab[_0xc0b9('0x8e')](_0x28dc02(_0xc0b9('0xbe'),_0x2a344e[_0xc0b9('0xad')][_0x14e3cc][_0xc0b9('0xba')]));}return Promise[_0xc0b9('0x90')](_0x1679ab)['then'](function(){return _0x2a344e;});}return _0x2a344e;});}});}}});}; \ No newline at end of file +var _0xfd36=['SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','metrics','charAt','toUpperCase','slice','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','define','user_profiles','../../components/parsers/qs','section','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','forEach','includeAll','include','default','reportId','DefaultReports','CustomReports','count','rows','ids','customSorting','extraQueryConditions','Tags','color','tag','ThroughTags','openTabs','true','dataValues','fax','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','associatedResources','catch','value','model','findAll','then','name','resolve','UserProfileResource','map','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','odbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','Agents','agent','Telephones','membername','User','role','telephone','VoiceQueues','queue','VoiceQueue','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','Users','user','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount'];(function(_0x2fef7c,_0x1e72c9){var _0x3a6212=function(_0x5f27a7){while(--_0x5f27a7){_0x2fef7c['push'](_0x2fef7c['shift']());}};_0x3a6212(++_0x1e72c9);}(_0xfd36,0x11e));var _0x6fd3=function(_0x147322,_0x5cc0a6){_0x147322=_0x147322-0x0;var _0x5b55e8=_0xfd36[_0x147322];return _0x5b55e8;};'use strict';var _=require(_0x6fd3('0x0'));var attributes=require(_0x6fd3('0x1'));var squel=require(_0x6fd3('0x2'));module[_0x6fd3('0x3')]=function(_0x2ec0dd){var _0x1d2172=_0x2ec0dd[_0x6fd3('0x4')];function _0x542a14(_0x1a8b12,_0x5a9b24){return new Promise(function(_0x263790,_0x5d6a36){if(!_0x5a9b24)return _0x263790(null);var _0x42bd36=_0x5a9b24[_0x6fd3('0x5')]?{[_0x5a9b24[_0x6fd3('0x5')][_0x6fd3('0x6')]]:_0x5a9b24[_0x6fd3('0x5')]['value']}:undefined;return _0x1d2172[_0x1a8b12]['findAll']({'where':_0x42bd36,'raw':!![]})['then'](function(_0x2c27e1){_0x5a9b24[_0x6fd3('0x7')]=_['map'](_0x2c27e1,'id');_0x263790(_0x5a9b24);})[_0x6fd3('0x8')](function(_0x5ceb08){_0x5d6a36(_0x5ceb08);});});}function _0x5f0032(_0x482f1a,_0x182ffe){return new Promise(function(_0x21bae5,_0x58ed40){var _0x5ab780=_0x482f1a[_0x6fd3('0x5')]?{[_0x482f1a['filter'][_0x6fd3('0x6')]]:_0x482f1a['filter'][_0x6fd3('0x9')]}:undefined;return _0x1d2172[_0x482f1a[_0x6fd3('0xa')]][_0x6fd3('0xb')]({'where':_0x5ab780,'raw':!![]})[_0x6fd3('0xc')](function(_0x317d66){_0x182ffe[_0x6fd3('0x7')]=_['map'](_0x317d66,function(_0x3acc8f){return _0x3acc8f[_0x6fd3('0xd')];});_0x21bae5(_0x182ffe);})[_0x6fd3('0x8')](function(_0x499a03){_0x58ed40(_0x499a03);});});}function _0x38895e(_0x2db63c,_0x2e0dea,_0x4c0af9){if(!_0x2e0dea)return Promise[_0x6fd3('0xe')](null);return new Promise(function(_0x53c23a,_0x2c209d){return _0x1d2172[_0x6fd3('0xf')][_0x6fd3('0xb')]({'where':{'sectionId':_0x2e0dea['id']},'raw':!![]})[_0x6fd3('0xc')](function(_0xc82e4a){if(_0x2db63c['field']&&_0x2db63c[_0x6fd3('0x6')]!=='id'){_0x2e0dea[_0x6fd3('0x7')]=_[_0x6fd3('0x10')](_0xc82e4a,function(_0x54cee1){return _0x54cee1[_0x2db63c[_0x6fd3('0x6')]];});}else{if(_0x4c0af9===_0x6fd3('0x11')){_0x2e0dea['associatedResources']=_[_0x6fd3('0x10')](_0xc82e4a,function(_0x13cf89){return{'id':_0x13cf89[_0x6fd3('0x12')],'type':_0x13cf89[_0x6fd3('0x13')]};});}else{_0x2e0dea[_0x6fd3('0x7')]=_[_0x6fd3('0x10')](_0xc82e4a,function(_0x14fc32){return _0x14fc32[_0x6fd3('0x12')];});}}_0x53c23a(_0x2e0dea);})[_0x6fd3('0x8')](function(_0x36e5f5){_0x2c209d(_0x36e5f5);});});}function _0x5573c6(_0x379ced,_0x299ede){var _0x3592ac={'parentSections':[]};switch(_0x379ced[_0x6fd3('0x14')]()){case'squareprojects':_0x3592ac[_0x6fd3('0x15')]='SquareProject';break;case _0x6fd3('0x16'):_0x3592ac[_0x6fd3('0x15')]='SquareOdbc';break;case _0x6fd3('0x17'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x18');_0x3592ac[_0x6fd3('0x19')]=[{'name':_0x6fd3('0x1a'),'field':'name','foreignKey':_0x6fd3('0x1b')}];break;case _0x6fd3('0x1c'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x1d');break;case _0x6fd3('0x1e'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x1f');_0x3592ac[_0x6fd3('0x19')]=[{'name':_0x6fd3('0x20'),'field':'id','foreignKey':'ListId'}];break;case _0x6fd3('0x21'):_0x3592ac['childModel']=_0x6fd3('0x22');break;case _0x6fd3('0x23'):_0x3592ac['childModel']=_0x6fd3('0x24');break;case'globalcustomfields':_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x25');break;case _0x6fd3('0x26'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x27');break;case _0x6fd3('0x28'):_0x3592ac['childModel']=_0x6fd3('0x29');break;case _0x6fd3('0x2a'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x2b');break;case _0x6fd3('0x2c'):_0x3592ac['childModel']=_0x6fd3('0x2d');break;case _0x6fd3('0x2e'):case _0x6fd3('0x2f'):case _0x6fd3('0x30'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x31');break;case _0x6fd3('0x32'):_0x3592ac['childModel']=_0x6fd3('0x33');break;case _0x6fd3('0x34'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x35');break;case'voicerecordings':_0x3592ac[_0x6fd3('0x15')]='VoiceRecording';_0x3592ac['parentSections']=[{'name':_0x6fd3('0x36'),'field':'name','foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0x6fd3('0x37')]}},{'name':_0x6fd3('0x38'),'field':_0x6fd3('0xd'),'foreignKey':_0x6fd3('0x39'),'model':_0x6fd3('0x3a'),'filter':{'field':_0x6fd3('0x3b'),'value':[_0x6fd3('0x3c')]}},{'name':_0x6fd3('0x3d'),'field':_0x6fd3('0xd'),'foreignKey':_0x6fd3('0x3e'),'model':_0x6fd3('0x3f'),'filter':{'field':_0x6fd3('0x13'),'value':['inbound']}},{'name':'QueueCampaigns','field':_0x6fd3('0xd'),'foreignKey':_0x6fd3('0x3e'),'model':_0x6fd3('0x3f'),'filter':{'field':_0x6fd3('0x13'),'value':[_0x6fd3('0x40')]}}];break;case'musiconholds':_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x41');break;case _0x6fd3('0x42'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x43');break;case _0x6fd3('0x44'):_0x3592ac['childModel']=_0x6fd3('0x45');break;case'ivrcampaigns':_0x3592ac[_0x6fd3('0x15')]='Campaign';break;case _0x6fd3('0x46'):_0x3592ac['childModel']=_0x6fd3('0x47');break;case'mailaccounts':_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x48');break;case _0x6fd3('0x49'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x4a');break;case _0x6fd3('0x4b'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x4c');break;case'openchannelaccounts':_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x4d');break;case _0x6fd3('0x4e'):_0x3592ac['childModel']=_0x6fd3('0x4f');break;case _0x6fd3('0x50'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x51');break;case _0x6fd3('0x52'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x53');break;case _0x6fd3('0x54'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x55');break;case _0x6fd3('0x56'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x57');break;case _0x6fd3('0x58'):case _0x6fd3('0x59'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x3f');if(_0x299ede){_0x3592ac[_0x6fd3('0x19')]=[{'name':_0x6fd3('0x3d')},{'name':'QueueCampaigns'}];}break;case'users':case'agents':case'telephones':_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x3a');if(_0x299ede){_0x3592ac[_0x6fd3('0x19')]=[{'name':_0x6fd3('0x5a'),'filter':{'field':_0x6fd3('0x3b'),'value':['admin',_0x6fd3('0x5b')]},'ignore':!![]},{'name':_0x6fd3('0x36')},{'name':_0x6fd3('0x38')}];}break;case'zendeskaccounts':_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x5c');break;case'salesforceaccounts':_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x5d');break;case _0x6fd3('0x5e'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x5f');break;case'sugarcrmaccounts':_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x60');break;case _0x6fd3('0x61'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x62');break;case _0x6fd3('0x63'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x64');break;case _0x6fd3('0x65'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x3a');break;case _0x6fd3('0x66'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x67');break;case _0x6fd3('0x68'):_0x3592ac[_0x6fd3('0x15')]='Disposition';break;case'customdashboards':_0x3592ac[_0x6fd3('0x15')]='Dashboard';break;case _0x6fd3('0x69'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x6a');break;case _0x6fd3('0x6b'):_0x3592ac['childModel']=_0x6fd3('0x6c');break;case _0x6fd3('0x6d'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x6e');break;case _0x6fd3('0x6f'):_0x3592ac['childModel']=_0x6fd3('0x70');break;case'tags':_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x71');break;case'templates':_0x3592ac['childModel']='Template';break;case'triggers':_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x72');break;case _0x6fd3('0x73'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x74');break;case _0x6fd3('0x75'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x76');break;case _0x6fd3('0x77'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x78');break;case _0x6fd3('0x79'):_0x3592ac[_0x6fd3('0x15')]=_0x6fd3('0x11');_0x3592ac[_0x6fd3('0x19')]=[{'name':_0x6fd3('0x7a'),'field':'id','foreignKey':'reportId'}];break;case _0x6fd3('0x7b'):_0x3592ac[_0x6fd3('0x15')]='AnalyticMetric';break;}return _0x3592ac;}function _0x35ca73(_0x3ae002,_0x4ba764){var _0x376d07=_0x3ae002[_0x6fd3('0x7c')](0x0)[_0x6fd3('0x7d')]()+_0x3ae002[_0x6fd3('0x7e')](0x1);var _0x316532={'type':_0x1d2172['Sequelize']['QueryTypes'][_0x6fd3('0x7f')],'raw':!![]};return new Promise(function(_0xe59c6f,_0x2a3efc){var _0x55b063=squel[_0x6fd3('0x80')]()[_0x6fd3('0x6')](_0x6fd3('0x81')+_0x376d07+_0x6fd3('0x82'),'id')[_0x6fd3('0x6')](_0x6fd3('0x83'))['from'](_0x6fd3('0x84')+_0x3ae002+_0x6fd3('0x85'),'ui')[_0x6fd3('0x86')](_0x6fd3('0x87'),_0x4ba764['id']);return _0x1d2172[_0x6fd3('0x88')][_0x6fd3('0x89')](_0x55b063['toString'](),_0x316532)[_0x6fd3('0xc')](function(_0x4a4810){_0x4ba764[_0x376d07+_0x6fd3('0x8a')]=_0x4a4810;_0xe59c6f(_0x4a4810);})[_0x6fd3('0x8')](function(_0x1d8f90){_0x2a3efc(_0x1d8f90);});});}return _0x2ec0dd[_0x6fd3('0x8b')]('UserProfile',attributes,{'tableName':_0x6fd3('0x8c'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x6b4bcb){var _0x571c4d=require(_0x6fd3('0x8d'));var _0x2896cc={'raw':_0x6b4bcb[_0x6fd3('0x89')]['raw'],'where':{}};var _0x1ea8c0={};var _0x3d6027={'count':0x0,'rows':[]};var _0x4c2cd3=_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0x8e')];var _0x3800da=_0x6b4bcb[_0x6fd3('0x89')]['mergeResources']||![];var _0x28816a=_0x5573c6(_0x4c2cd3,_0x3800da);if(!_0x28816a['childModel'])throw new Error(_0x6fd3('0x8f')+_0x4c2cd3+'\x27');var _0x3fc561=[{'name':_0x4c2cd3}];if(!_[_0x6fd3('0x90')](_0x28816a[_0x6fd3('0x19')]))_0x3fc561=_0x28816a[_0x6fd3('0x19')];var _0x52828d=[];for(var _0x1116d2=0x0;_0x1116d2<_0x3fc561[_0x6fd3('0x91')];_0x1116d2++){_0x52828d[_0x6fd3('0x92')](_0x1d2172[_0x6fd3('0x93')][_0x6fd3('0x94')]({'where':{'userProfileId':_0x6b4bcb[_0x6fd3('0x95')]['id'],'name':_0x3fc561[_0x1116d2][_0x6fd3('0xd')]},'raw':!![]}));}return Promise[_0x6fd3('0x96')](_0x52828d)[_0x6fd3('0xc')](function(_0x4c3552){var _0x4d6e08=_['filter'](_0x4c3552,function(_0x4be29c){return _0x4be29c?_0x4be29c:undefined;});var _0x11d6ec=_[_0x6fd3('0x5')](_0x3fc561,[_0x6fd3('0x97'),!![]]);var _0x136243=_[_0x6fd3('0x90')](_0x4d6e08)&&_[_0x6fd3('0x90')](_0x11d6ec)?null:_['union'](_0x11d6ec,_0x4d6e08);if(!_0x136243)return null;var _0x3bf675=[];for(var _0x466ebf=0x0;_0x466ebf<_0x136243[_0x6fd3('0x91')];_0x466ebf++){var _0x2162a6=_['find'](_0x3fc561,function(_0x561c33){return _0x136243[_0x466ebf]?_0x561c33[_0x6fd3('0xd')]===_0x136243[_0x466ebf][_0x6fd3('0xd')]:null;});if(_0x2162a6){if(_0x136243[_0x466ebf]['ignore']){_0x3bf675['push'](_0x542a14(_0x28816a[_0x6fd3('0x15')],_0x136243[_0x466ebf]));}else{if(!_0x136243[_0x466ebf][_0x6fd3('0x98')]){_0x3bf675['push'](_0x38895e(_0x2162a6,_0x136243[_0x466ebf],_0x28816a[_0x6fd3('0x15')]));}else{if(_0x2162a6[_0x6fd3('0xa')]){_0x3bf675[_0x6fd3('0x92')](_0x5f0032(_0x2162a6,_0x136243[_0x466ebf]));}}}}}return Promise[_0x6fd3('0x96')](_0x3bf675);})[_0x6fd3('0xc')](function(_0x2c9737){var _0x467974=_0x2c9737;var _0x149b5c=null;if(_0x467974){_0x149b5c=_0x467974['length']===0x1?_0x467974[0x0]:null;}if(!_0x149b5c&&!_0x467974)return _0x3d6027;var _0x38e1b1=_0x1d2172[_0x28816a[_0x6fd3('0x15')]][_0x6fd3('0x99')];_0x1ea8c0[_0x6fd3('0xa')]=_[_0x6fd3('0x9a')](_0x38e1b1);_0x1ea8c0[_0x6fd3('0x89')]=_[_0x6fd3('0x9a')](_0x6b4bcb[_0x6fd3('0x89')]);_0x1ea8c0[_0x6fd3('0x9b')]=_[_0x6fd3('0x9c')](_0x1ea8c0['model'],_0x1ea8c0[_0x6fd3('0x89')]);_0x2896cc[_0x6fd3('0x9d')]=_['intersection'](_0x1ea8c0['model'],_0x571c4d[_0x6fd3('0x9e')](_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0x9e')]));_0x2896cc[_0x6fd3('0x9d')]=_0x2896cc[_0x6fd3('0x9d')]['length']?_0x2896cc[_0x6fd3('0x9d')]:_0x1ea8c0['model'];if(!_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0x9f')](_0x6fd3('0xa0'))){_0x2896cc[_0x6fd3('0xa1')]=_0x571c4d[_0x6fd3('0xa1')](_0x6b4bcb[_0x6fd3('0x89')]['limit']);_0x2896cc[_0x6fd3('0xa2')]=_0x571c4d[_0x6fd3('0xa2')](_0x6b4bcb[_0x6fd3('0x89')]['offset']);}_0x2896cc[_0x6fd3('0xa3')]=_0x571c4d['sort'](_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0xa4')]);_0x2896cc['where']=_0x571c4d['filters'](_['pick'](_0x6b4bcb[_0x6fd3('0x89')],_0x1ea8c0[_0x6fd3('0x9b')]));if(_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0x5')]){_0x2896cc['where']=_[_0x6fd3('0xa5')](_0x2896cc[_0x6fd3('0x86')],{'$or':_[_0x6fd3('0x10')](_0x38e1b1,function(_0x3494bc){if(_0x3494bc[_0x6fd3('0x13')][_0x6fd3('0xa6')]!==_0x6fd3('0xa7')){var _0x425644={};_0x425644[_0x3494bc[_0x6fd3('0x6')]]={'$like':'%'+_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0x5')]+'%'};return _0x425644;}})});}var _0x497489=[];var _0x23fbde=null;var _0x2faa38={};if(_0x149b5c){_0x23fbde=_[_0x6fd3('0x94')](_0x3fc561,[_0x6fd3('0xd'),_0x149b5c[_0x6fd3('0xd')]]);if(_0x23fbde[_0x6fd3('0x6')]){_0x2faa38={};if(_0x28816a[_0x6fd3('0x15')]===_0x6fd3('0x11')){_0x2faa38[_0x23fbde[_0x6fd3('0xa8')]]=_[_0x6fd3('0x10')](_0x149b5c[_0x6fd3('0x7')],'id');}else{_0x2faa38[_0x23fbde[_0x6fd3('0xa8')]]=_0x149b5c['associatedResources'];}_0x497489[_0x6fd3('0x92')](_0x2faa38);}else{_0x2896cc[_0x6fd3('0x86')]['id']=_0x149b5c[_0x6fd3('0x7')];}}else{for(var _0xcddaa5=0x0;_0xcddaa5<_0x467974['length'];_0xcddaa5++){_0x23fbde=_[_0x6fd3('0x94')](_0x3fc561,[_0x6fd3('0xd'),_0x467974[_0xcddaa5][_0x6fd3('0xd')]]);if(_0x23fbde[_0x6fd3('0x6')]){_0x2faa38={};_0x2faa38[_0x23fbde[_0x6fd3('0xa8')]]=_0x467974[_0xcddaa5]['associatedResources'];_0x497489[_0x6fd3('0x92')](_0x2faa38);}else{if(!_0x2896cc[_0x6fd3('0x86')]['id'])_0x2896cc[_0x6fd3('0x86')]['id']=[];_0x467974[_0xcddaa5][_0x6fd3('0x7')][_0x6fd3('0xa9')](function(_0xcfedd6){_0x2896cc['where']['id'][_0x6fd3('0x92')](_0xcfedd6);});}}}if(!_['isEmpty'](_0x497489)){_0x2896cc[_0x6fd3('0x86')]=_[_0x6fd3('0xa5')](_0x2896cc[_0x6fd3('0x86')],{'$and':{'$or':_0x497489}});}_0x2896cc=_[_0x6fd3('0xa5')]({},_0x2896cc,_0x6b4bcb['options']);if(_0x149b5c&&!_0x149b5c['autoAssociation']&&_0x28816a['childModel']===_0x6fd3('0x11')){if(_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0xaa')]){_0x2896cc[_0x6fd3('0xab')]=[{'all':!![]}];}return _0x1d2172[_0x28816a[_0x6fd3('0x15')]]['findAll'](_0x2896cc)['then'](function(_0x158b9d){var _0x13b14e=[];_0x158b9d[_0x6fd3('0xa9')](function(_0x57a81b){var _0x10e7ca;switch(_0x57a81b['reportType']){case _0x6fd3('0xac'):_0x10e7ca=_['find'](_0x149b5c[_0x6fd3('0x7')],function(_0x41614b){return _0x41614b['id']===_0x57a81b[_0x6fd3('0xad')]&&_0x41614b[_0x6fd3('0x13')]===_0x6fd3('0xae');});break;case'custom':_0x10e7ca=_[_0x6fd3('0x94')](_0x149b5c[_0x6fd3('0x7')],function(_0x518cdb){return _0x518cdb['id']===_0x57a81b[_0x6fd3('0xad')]&&_0x518cdb[_0x6fd3('0x13')]===_0x6fd3('0xaf');});break;}if(_0x10e7ca)_0x13b14e['push'](_0x57a81b);});_0x3d6027[_0x6fd3('0xb0')]=_0x13b14e[_0x6fd3('0x91')];_0x3d6027[_0x6fd3('0xb1')]=_0x13b14e;return _0x3d6027;});}else{if(!_[_0x6fd3('0x90')](_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0xb2')])){_0x2896cc[_0x6fd3('0x86')]['id']=_0x2896cc['where']['id']?_[_0x6fd3('0x9c')](_0x2896cc[_0x6fd3('0x86')]['id'],_0x6b4bcb['query'][_0x6fd3('0xb2')]):_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0xb2')];if(_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0xb3')]){_0x2896cc[_0x6fd3('0xa3')]=_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0xb3')];}}if(_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0xb4')]){_0x2896cc[_0x6fd3('0x86')]=_['merge'](_0x2896cc[_0x6fd3('0x86')],{'$and':_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0xb4')]});}return _0x1d2172[_0x28816a[_0x6fd3('0x15')]][_0x6fd3('0xb0')]({'where':_0x2896cc[_0x6fd3('0x86')]})[_0x6fd3('0xc')](function(_0x5e847b){_0x3d6027[_0x6fd3('0xb0')]=_0x5e847b;if(_0x6b4bcb['query'][_0x6fd3('0xaa')]){if(_0x28816a['childModel']===_0x6fd3('0x1f')){_0x2896cc[_0x6fd3('0xab')]=[{'model':_0x1d2172[_0x6fd3('0x71')],'as':_0x6fd3('0xb5'),'attributes':['id',_0x6fd3('0xd'),_0x6fd3('0xb6')],'required':_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0xb7')]?!![]:![]},{'model':_0x1d2172[_0x6fd3('0x71')],'as':_0x6fd3('0xb8'),'attributes':['id','name',_0x6fd3('0xb6')],'through':_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0xb7')]?{'attributes':[],'where':{'TagId':_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0xb7')]||undefined}}:{},'required':_0x6b4bcb[_0x6fd3('0x89')][_0x6fd3('0xb7')]?!![]:![]}];}else{_0x2896cc[_0x6fd3('0xab')]=[{'all':!![]}];}}return _0x1d2172[_0x28816a[_0x6fd3('0x15')]]['findAll'](_0x2896cc);})[_0x6fd3('0xc')](function(_0x5a9ab0){_0x3d6027[_0x6fd3('0xb1')]=_0x5a9ab0;if(_0x4c2cd3==='Agents'&&_0x6b4bcb['query'][_0x6fd3('0xb9')]===_0x6fd3('0xba')){var _0x403a66=[];for(var _0x2e1652=0x0;_0x2e1652<_0x3d6027[_0x6fd3('0xb1')]['length'];_0x2e1652++){_0x403a66[_0x6fd3('0x92')](_0x35ca73('chat',_0x3d6027[_0x6fd3('0xb1')][_0x2e1652][_0x6fd3('0xbb')]));_0x403a66[_0x6fd3('0x92')](_0x35ca73('sms',_0x3d6027[_0x6fd3('0xb1')][_0x2e1652][_0x6fd3('0xbb')]));_0x403a66['push'](_0x35ca73(_0x6fd3('0xbc'),_0x3d6027[_0x6fd3('0xb1')][_0x2e1652][_0x6fd3('0xbb')]));_0x403a66[_0x6fd3('0x92')](_0x35ca73('mail',_0x3d6027[_0x6fd3('0xb1')][_0x2e1652][_0x6fd3('0xbb')]));_0x403a66[_0x6fd3('0x92')](_0x35ca73(_0x6fd3('0xbd'),_0x3d6027[_0x6fd3('0xb1')][_0x2e1652]['dataValues']));_0x403a66[_0x6fd3('0x92')](_0x35ca73(_0x6fd3('0xbe'),_0x3d6027[_0x6fd3('0xb1')][_0x2e1652]['dataValues']));}return Promise[_0x6fd3('0x96')](_0x403a66)[_0x6fd3('0xc')](function(){return _0x3d6027;});}return _0x3d6027;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 8cef2b0..761e6d7 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 _0x7409=['socket.io-emitter','register','then','info','error','UserProfile,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7409,0x6e));var _0x9740=function(_0x4afc2c,_0x336a88){_0x4afc2c=_0x4afc2c-0x0;var _0x164084=_0x7409[_0x4afc2c];return _0x164084;};'use strict';var _=require(_0x9740('0x0'));var util=require(_0x9740('0x1'));var moment=require('moment');var BPromise=require(_0x9740('0x2'));var rs=require(_0x9740('0x3'));var fs=require('fs');var Redis=require(_0x9740('0x4'));var db=require(_0x9740('0x5'))['db'];var utils=require(_0x9740('0x6'));var logger=require(_0x9740('0x7'))(_0x9740('0x8'));var config=require(_0x9740('0x9'));var jayson=require(_0x9740('0xa'));var client=jayson['client'][_0x9740('0xb')]({'port':0x232a});config[_0x9740('0xc')]=_[_0x9740('0xd')](config['redis'],{'host':_0x9740('0xe'),'port':0x18eb});var socket=require(_0x9740('0xf'))(new Redis(config[_0x9740('0xc')]));require('./userProfile.socket')[_0x9740('0x10')](socket);function respondWithRpcPromise(_0x548bf8,_0x1a6ff9,_0xc27c18){return new BPromise(function(_0x4e39f9,_0x59dd44){return client['request'](_0x548bf8,_0xc27c18)[_0x9740('0x11')](function(_0x3bc357){logger[_0x9740('0x12')]('UserProfile,\x20%s,\x20%s',_0x1a6ff9,'request\x20sent');logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x1a6ff9,'request\x20sent',JSON['stringify'](_0x3bc357));if(_0x3bc357['error']){if(_0x3bc357[_0x9740('0x13')]['code']===0x1f4){logger['error'](_0x9740('0x14'),_0x1a6ff9,_0x3bc357['error'][_0x9740('0x15')]);return _0x59dd44(_0x3bc357[_0x9740('0x13')][_0x9740('0x15')]);}logger[_0x9740('0x13')]('UserProfile,\x20%s,\x20%s',_0x1a6ff9,_0x3bc357[_0x9740('0x13')]['message']);return _0x4e39f9(_0x3bc357[_0x9740('0x13')][_0x9740('0x15')]);}else{logger[_0x9740('0x12')](_0x9740('0x14'),_0x1a6ff9,_0x9740('0x16'));_0x4e39f9(_0x3bc357[_0x9740('0x17')][_0x9740('0x15')]);}})[_0x9740('0x18')](function(_0x206c4d){logger['error'](_0x9740('0x14'),_0x1a6ff9,_0x206c4d);_0x59dd44(_0x206c4d);});});} \ No newline at end of file +var _0xf78f=['./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x16bb0e,_0x343132){var _0x102b8b=function(_0x17a62b){while(--_0x17a62b){_0x16bb0e['push'](_0x16bb0e['shift']());}};_0x102b8b(++_0x343132);}(_0xf78f,0x72));var _0xff78=function(_0x249d5d,_0x3778d9){_0x249d5d=_0x249d5d-0x0;var _0x1d4f69=_0xf78f[_0x249d5d];return _0x1d4f69;};'use strict';var _=require('lodash');var util=require(_0xff78('0x0'));var moment=require(_0xff78('0x1'));var BPromise=require(_0xff78('0x2'));var rs=require(_0xff78('0x3'));var fs=require('fs');var Redis=require(_0xff78('0x4'));var db=require(_0xff78('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xff78('0x6')]['http']({'port':0x232a});config[_0xff78('0x7')]=_[_0xff78('0x8')](config[_0xff78('0x7')],{'host':_0xff78('0x9'),'port':0x18eb});var socket=require(_0xff78('0xa'))(new Redis(config[_0xff78('0x7')]));require(_0xff78('0xb'))[_0xff78('0xc')](socket);function respondWithRpcPromise(_0x4f9abd,_0x4eaba5,_0x36dfa4){return new BPromise(function(_0xa55092,_0x1ea7d4){return client[_0xff78('0xd')](_0x4f9abd,_0x36dfa4)[_0xff78('0xe')](function(_0x2e22e3){logger[_0xff78('0xf')](_0xff78('0x10'),_0x4eaba5,'request\x20sent');logger[_0xff78('0x11')](_0xff78('0x12'),_0x4eaba5,'request\x20sent',JSON[_0xff78('0x13')](_0x2e22e3));if(_0x2e22e3['error']){if(_0x2e22e3[_0xff78('0x14')]['code']===0x1f4){logger[_0xff78('0x14')](_0xff78('0x10'),_0x4eaba5,_0x2e22e3[_0xff78('0x14')][_0xff78('0x15')]);return _0x1ea7d4(_0x2e22e3['error'][_0xff78('0x15')]);}logger[_0xff78('0x14')](_0xff78('0x10'),_0x4eaba5,_0x2e22e3[_0xff78('0x14')][_0xff78('0x15')]);return _0xa55092(_0x2e22e3[_0xff78('0x14')][_0xff78('0x15')]);}else{logger['info'](_0xff78('0x10'),_0x4eaba5,_0xff78('0x16'));_0xa55092(_0x2e22e3[_0xff78('0x17')][_0xff78('0x15')]);}})[_0xff78('0x18')](function(_0x41a06e){logger[_0xff78('0x14')](_0xff78('0x10'),_0x4eaba5,_0x41a06e);_0x1ea7d4(_0x41a06e);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index c04d25c..ecf060c 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 _0x7f29=['removeListener','register','userProfile:','remove'];(function(_0x5c41f1,_0x598888){var _0x5f0924=function(_0x4226c2){while(--_0x4226c2){_0x5c41f1['push'](_0x5c41f1['shift']());}};_0x5f0924(++_0x598888);}(_0x7f29,0xf3));var _0x97f2=function(_0x3b6975,_0x290607){_0x3b6975=_0x3b6975-0x0;var _0x58f6ae=_0x7f29[_0x3b6975];return _0x58f6ae;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=['save',_0x97f2('0x0'),'update'];function createListener(_0x5d17b8,_0x405594){return function(_0x58a473){_0x405594['emit'](_0x5d17b8,_0x58a473);};}function removeListener(_0x14445a,_0x3248f6){return function(){UserProfileEvents[_0x97f2('0x1')](_0x14445a,_0x3248f6);};}exports[_0x97f2('0x2')]=function(_0x3aea2b){for(var _0x49bc00=0x0,_0x1524a3=events['length'];_0x49bc00<_0x1524a3;_0x49bc00++){var _0x1e76ca=events[_0x49bc00];var _0x5901d2=createListener(_0x97f2('0x3')+_0x1e76ca,_0x3aea2b);UserProfileEvents['on'](_0x1e76ca,_0x5901d2);}}; \ No newline at end of file +var _0x7592=['save','remove','emit','removeListener','register','length','userProfile:'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7592,0x150));var _0x2759=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x7592[_0x173441];return _0x2423a8;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x2759('0x0'),_0x2759('0x1'),'update'];function createListener(_0x24e1fb,_0x7859e5){return function(_0x8cdc81){_0x7859e5[_0x2759('0x2')](_0x24e1fb,_0x8cdc81);};}function removeListener(_0x33df98,_0x1ee11d){return function(){UserProfileEvents[_0x2759('0x3')](_0x33df98,_0x1ee11d);};}exports[_0x2759('0x4')]=function(_0x52eb17){for(var _0x5ebf24=0x0,_0x58887c=events[_0x2759('0x5')];_0x5ebf24<_0x58887c;_0x5ebf24++){var _0x3d0c12=events[_0x5ebf24];var _0x305644=createListener(_0x2759('0x6')+_0x3d0c12,_0x52eb17);UserProfileEvents['on'](_0x3d0c12,_0x305644);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index ef14ae0..b1c028e 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 _0xd3b9=['/:id','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','describe'];(function(_0x23da4d,_0x63498c){var _0x4ae55=function(_0x323d75){while(--_0x323d75){_0x23da4d['push'](_0x23da4d['shift']());}};_0x4ae55(++_0x63498c);}(_0xd3b9,0xd7));var _0x9d3b=function(_0x2202bd,_0x203d44){_0x2202bd=_0x2202bd-0x0;var _0x262693=_0xd3b9[_0x2202bd];return _0x262693;};'use strict';var multer=require(_0x9d3b('0x0'));var util=require(_0x9d3b('0x1'));var path=require(_0x9d3b('0x2'));var timeout=require(_0x9d3b('0x3'));var express=require(_0x9d3b('0x4'));var router=express[_0x9d3b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9d3b('0x6'));var interaction=require(_0x9d3b('0x7'));var config=require('../../config/environment');var controller=require(_0x9d3b('0x8'));router[_0x9d3b('0x9')]('/',auth[_0x9d3b('0xa')](),controller[_0x9d3b('0xb')]);router[_0x9d3b('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x9d3b('0xc')]);router[_0x9d3b('0x9')](_0x9d3b('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9d3b('0xe')]('/',auth[_0x9d3b('0xa')](),controller[_0x9d3b('0xf')]);router[_0x9d3b('0x10')](_0x9d3b('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x9d3b('0x11')](_0x9d3b('0xd'),auth[_0x9d3b('0xa')](),controller['destroy']);module[_0x9d3b('0x12')]=router; \ No newline at end of file +var _0x0f42=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0f42,0x1b6));var _0x20f4=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0f42[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x20f4('0x0'));var timeout=require(_0x20f4('0x1'));var express=require(_0x20f4('0x2'));var router=express[_0x20f4('0x3')]();var fs_extra=require(_0x20f4('0x4'));var auth=require(_0x20f4('0x5'));var interaction=require(_0x20f4('0x6'));var config=require('../../config/environment');var controller=require(_0x20f4('0x7'));router[_0x20f4('0x8')]('/',auth['isAuthenticated'](),controller[_0x20f4('0x9')]);router[_0x20f4('0x8')](_0x20f4('0xa'),auth[_0x20f4('0xb')](),controller[_0x20f4('0xc')]);router[_0x20f4('0x8')](_0x20f4('0xd'),auth['isAuthenticated'](),controller[_0x20f4('0xe')]);router[_0x20f4('0xf')]('/',auth['isAuthenticated'](),controller[_0x20f4('0x10')]);router[_0x20f4('0x11')](_0x20f4('0xd'),auth[_0x20f4('0xb')](),controller[_0x20f4('0x12')]);router[_0x20f4('0x13')](_0x20f4('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 246de2f..14d0047 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 _0x64d0=['sequelize','exports','STRING','INTEGER'];(function(_0xe3839f,_0x555463){var _0x43c987=function(_0x4a592f){while(--_0x4a592f){_0xe3839f['push'](_0xe3839f['shift']());}};_0x43c987(++_0x555463);}(_0x64d0,0xa0));var _0x064d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64d0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x064d('0x0'));module[_0x064d('0x1')]={'name':{'type':Sequelize[_0x064d('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x064d('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x16a2=['exports','STRING','INTEGER'];(function(_0x46ce49,_0x40df08){var _0x207f70=function(_0x449ead){while(--_0x449ead){_0x46ce49['push'](_0x46ce49['shift']());}};_0x207f70(++_0x40df08);}(_0x16a2,0x1d4));var _0x216a=function(_0x2a8860,_0x2da926){_0x2a8860=_0x2a8860-0x0;var _0x2f47a4=_0x16a2[_0x2a8860];return _0x2f47a4;};'use strict';var Sequelize=require('sequelize');module[_0x216a('0x0')]={'name':{'type':Sequelize[_0x216a('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x216a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x216a('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 63af77f..0eae68c 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 _0x781d=['sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','UserProfileResource','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x781d,0x14a));var _0xd781=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x781d[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){_0x101480[_0xd781('0x1a')](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x19')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=_[_0xd781('0x2b')](db[_0xd781('0x2c')]['rawAttributes'],function(_0x54521e){return{'name':_0x54521e[_0xd781('0x2d')],'type':_0x54521e[_0xd781('0x2e')][_0xd781('0x2f')]};});_0x5b0464['model']=_['map'](_0x4a3bd3,_0xd781('0x28'));_0x5b0464[_0xd781('0x30')]=_[_0xd781('0x31')](_0x5c3848['query']);_0x5b0464['filters']=_[_0xd781('0x32')](_0x5b0464[_0xd781('0x33')],_0x5b0464['query']);_0x43cc74[_0xd781('0x34')]=_[_0xd781('0x32')](_0x5b0464['model'],qs[_0xd781('0x35')](_0x5c3848[_0xd781('0x30')][_0xd781('0x35')]));_0x43cc74[_0xd781('0x34')]=_0x43cc74['attributes'][_0xd781('0x36')]?_0x43cc74[_0xd781('0x34')]:_0x5b0464[_0xd781('0x33')];if(!_0x5c3848[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x37'))){_0x43cc74[_0xd781('0x1e')]=qs['limit'](_0x5c3848[_0xd781('0x30')]['limit']);_0x43cc74[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x5c3848['query'][_0xd781('0x1c')]);}_0x43cc74[_0xd781('0x38')]=qs['sort'](_0x5c3848[_0xd781('0x30')]['sort']);_0x43cc74[_0xd781('0x39')]=qs[_0xd781('0x3a')](_['pick'](_0x5c3848[_0xd781('0x30')],_0x5b0464[_0xd781('0x3a')]),_0x4a3bd3);if(_0x5c3848['query'][_0xd781('0x3b')]){_0x43cc74[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x43cc74['where'],{'$or':_[_0xd781('0x2b')](_0x4a3bd3,function(_0x22b94e){if(_0x22b94e[_0xd781('0x2e')]!==_0xd781('0x3d')){var _0x2e8218={};_0x2e8218[_0x22b94e[_0xd781('0x28')]]={'$like':'%'+_0x5c3848[_0xd781('0x30')][_0xd781('0x3b')]+'%'};return _0x2e8218;}})});}_0x43cc74=_[_0xd781('0x3c')]({},_0x43cc74,_0x5c3848['options']);var _0x2a60d6={'where':_0x43cc74['where']};return db[_0xd781('0x2c')][_0xd781('0x1f')](_0x2a60d6)['then'](function(_0x1a5833){_0x296a0b[_0xd781('0x1f')]=_0x1a5833;if(_0x5c3848[_0xd781('0x30')][_0xd781('0x3e')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2c')]['findAll'](_0x43cc74);})[_0xd781('0x26')](function(_0xcdaacf){_0x296a0b['rows']=_0xcdaacf;return _0x296a0b;})['then'](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))[_0xd781('0x3f')](handleError(_0x5b6b9d,null));};exports[_0xd781('0x40')]=function(_0x15b49d,_0x23bbab){var _0x53aba6={'raw':![],'where':{'id':_0x15b49d[_0xd781('0x41')]['id']}},_0x46e7f6={};_0x46e7f6['model']=_['keys'](db[_0xd781('0x2c')][_0xd781('0x42')]);_0x46e7f6[_0xd781('0x30')]=_['keys'](_0x15b49d['query']);_0x46e7f6[_0xd781('0x3a')]=_[_0xd781('0x32')](_0x46e7f6[_0xd781('0x33')],_0x46e7f6[_0xd781('0x30')]);_0x53aba6[_0xd781('0x34')]=_[_0xd781('0x32')](_0x46e7f6['model'],qs['fields'](_0x15b49d[_0xd781('0x30')][_0xd781('0x35')]));_0x53aba6[_0xd781('0x34')]=_0x53aba6[_0xd781('0x34')][_0xd781('0x36')]?_0x53aba6['attributes']:_0x46e7f6[_0xd781('0x33')];if(_0x15b49d[_0xd781('0x30')][_0xd781('0x3e')]){_0x53aba6['include']=[{'all':!![]}];}_0x53aba6=_[_0xd781('0x3c')]({},_0x53aba6,_0x15b49d[_0xd781('0x43')]);return db[_0xd781('0x2c')]['find'](_0x53aba6)[_0xd781('0x26')](handleEntityNotFound(_0x23bbab,null))[_0xd781('0x26')](respondWithResult(_0x23bbab,null))['catch'](handleError(_0x23bbab,null));};exports['create']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['create'](_0x13a907[_0xd781('0x44')],{})[_0xd781('0x26')](respondWithResult(_0x16d16e,0xc9))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x336d30,_0x3828ad){if(_0x336d30[_0xd781('0x44')]['id']){delete _0x336d30['body']['id'];}return db[_0xd781('0x2c')][_0xd781('0x45')]({'where':{'id':_0x336d30[_0xd781('0x41')]['id']}})['then'](handleEntityNotFound(_0x3828ad,null))[_0xd781('0x26')](saveUpdates(_0x336d30[_0xd781('0x44')],null))['then'](respondWithResult(_0x3828ad,null))[_0xd781('0x3f')](handleError(_0x3828ad,null));};exports[_0xd781('0x25')]=function(_0x41caac,_0x207546){return db[_0xd781('0x2c')]['find']({'where':{'id':_0x41caac[_0xd781('0x41')]['id']}})['then'](handleEntityNotFound(_0x207546,null))[_0xd781('0x26')](removeEntity(_0x207546,null))['catch'](handleError(_0x207546,null));};exports[_0xd781('0x46')]=function(_0x17a46e,_0x4f9e37){return db[_0xd781('0x2c')]['describe']()['then'](respondWithResult(_0x4f9e37,null))['catch'](handleError(_0x4f9e37,null));}; \ No newline at end of file +var _0x4975=['to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','UserProfileResource','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x4f8b0e,_0x586fc4){var _0x42c3e6=function(_0x32ead0){while(--_0x32ead0){_0x4f8b0e['push'](_0x4f8b0e['shift']());}};_0x42c3e6(++_0x586fc4);}(_0x4975,0x86));var _0x5497=function(_0x40ff86,_0x39b67e){_0x40ff86=_0x40ff86-0x0;var _0x53f67a=_0x4975[_0x40ff86];return _0x53f67a;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['UserProfileResource']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['UserProfileResource'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));};exports['describe']=function(_0x1f73eb,_0x5b2c22){return db['UserProfileResource'][_0x5497('0x47')]()[_0x5497('0x24')](respondWithResult(_0x5b2c22,null))['catch'](handleError(_0x5b2c22,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index d228a59..a0013a8 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 _0x2816=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util'];(function(_0xb82b9a,_0x1910da){var _0x3aeb99=function(_0x1dc745){while(--_0x1dc745){_0xb82b9a['push'](_0xb82b9a['shift']());}};_0x3aeb99(++_0x1910da);}(_0x2816,0x1de));var _0x6281=function(_0x2995e1,_0x42c521){_0x2995e1=_0x2995e1-0x0;var _0x4ad4c5=_0x2816[_0x2995e1];return _0x4ad4c5;};'use strict';var _=require(_0x6281('0x0'));var util=require(_0x6281('0x1'));var logger=require(_0x6281('0x2'))('api');var moment=require(_0x6281('0x3'));var BPromise=require(_0x6281('0x4'));var rp=require(_0x6281('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6281('0x6'));var config=require(_0x6281('0x7'));var attributes=require(_0x6281('0x8'));module[_0x6281('0x9')]=function(_0x223e64,_0x59df71){return _0x223e64[_0x6281('0xa')]('UserProfileResource',attributes,{'tableName':_0x6281('0xb'),'paranoid':![],'indexes':[{'name':_0x6281('0xc'),'fields':[_0x6281('0xd'),_0x6281('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x04d6=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','sectionId','lodash','util'];(function(_0x39cea6,_0x1bc94a){var _0x4744b1=function(_0x1a69a5){while(--_0x1a69a5){_0x39cea6['push'](_0x39cea6['shift']());}};_0x4744b1(++_0x1bc94a);}(_0x04d6,0x1be));var _0x604d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x04d6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x604d('0x0'));var util=require(_0x604d('0x1'));var logger=require(_0x604d('0x2'))(_0x604d('0x3'));var moment=require(_0x604d('0x4'));var BPromise=require(_0x604d('0x5'));var rp=require(_0x604d('0x6'));var fs=require('fs');var path=require(_0x604d('0x7'));var rimraf=require(_0x604d('0x8'));var config=require(_0x604d('0x9'));var attributes=require(_0x604d('0xa'));module[_0x604d('0xb')]=function(_0x1a41fd,_0xc96a9a){return _0x1a41fd[_0x604d('0xc')]('UserProfileResource',attributes,{'tableName':_0x604d('0xd'),'paranoid':![],'indexes':[{'name':_0x604d('0xe'),'fields':['resourceId',_0x604d('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index fb8daac..f6455f9 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 _0xb48a=['info','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x5bacb9,_0x58dbab){var _0x58ab22=function(_0x2469d1){while(--_0x2469d1){_0x5bacb9['push'](_0x5bacb9['shift']());}};_0x58ab22(++_0x58dbab);}(_0xb48a,0x1d5));var _0xab48=function(_0x1fc715,_0x310ef){_0x1fc715=_0x1fc715-0x0;var _0x4c92a6=_0xb48a[_0x1fc715];return _0x4c92a6;};'use strict';var _=require('lodash');var util=require(_0xab48('0x0'));var moment=require(_0xab48('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab48('0x2'));var db=require(_0xab48('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xab48('0x4'))(_0xab48('0x5'));var config=require(_0xab48('0x6'));var jayson=require(_0xab48('0x7'));var client=jayson[_0xab48('0x8')][_0xab48('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e83cd,_0x4d79b4,_0xae02d7){return new BPromise(function(_0x2a866b,_0x256956){return client['request'](_0x3e83cd,_0xae02d7)[_0xab48('0xa')](function(_0x26fda8){logger['info'](_0xab48('0xb'),_0x4d79b4,'request\x20sent');logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x4d79b4,_0xab48('0xc'),JSON[_0xab48('0xd')](_0x26fda8));if(_0x26fda8[_0xab48('0xe')]){if(_0x26fda8[_0xab48('0xe')][_0xab48('0xf')]===0x1f4){logger['error'](_0xab48('0xb'),_0x4d79b4,_0x26fda8[_0xab48('0xe')]['message']);return _0x256956(_0x26fda8[_0xab48('0xe')][_0xab48('0x10')]);}logger[_0xab48('0xe')](_0xab48('0xb'),_0x4d79b4,_0x26fda8[_0xab48('0xe')][_0xab48('0x10')]);return _0x2a866b(_0x26fda8[_0xab48('0xe')][_0xab48('0x10')]);}else{logger[_0xab48('0x11')](_0xab48('0xb'),_0x4d79b4,_0xab48('0xc'));_0x2a866b(_0x26fda8['result'][_0xab48('0x10')]);}})['catch'](function(_0x325b3b){logger[_0xab48('0xe')](_0xab48('0xb'),_0x4d79b4,_0x325b3b);_0x256956(_0x325b3b);});});} \ No newline at end of file +var _0xaa7d=['client','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x482bcf,_0x3819b8){var _0x351553=function(_0x546a0a){while(--_0x546a0a){_0x482bcf['push'](_0x482bcf['shift']());}};_0x351553(++_0x3819b8);}(_0xaa7d,0x193));var _0xdaa7=function(_0x58fbb0,_0xe497b5){_0x58fbb0=_0x58fbb0-0x0;var _0x1783d2=_0xaa7d[_0x58fbb0];return _0x1783d2;};'use strict';var _=require(_0xdaa7('0x0'));var util=require(_0xdaa7('0x1'));var moment=require(_0xdaa7('0x2'));var BPromise=require(_0xdaa7('0x3'));var rs=require(_0xdaa7('0x4'));var fs=require('fs');var Redis=require(_0xdaa7('0x5'));var db=require(_0xdaa7('0x6'))['db'];var utils=require(_0xdaa7('0x7'));var logger=require(_0xdaa7('0x8'))(_0xdaa7('0x9'));var config=require(_0xdaa7('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xdaa7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a0969,_0x579b82,_0x39de57){return new BPromise(function(_0x390fa3,_0x3e35d2){return client[_0xdaa7('0xc')](_0x5a0969,_0x39de57)[_0xdaa7('0xd')](function(_0x14b8f9){logger['info'](_0xdaa7('0xe'),_0x579b82,_0xdaa7('0xf'));logger[_0xdaa7('0x10')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x579b82,'request\x20sent',JSON['stringify'](_0x14b8f9));if(_0x14b8f9['error']){if(_0x14b8f9[_0xdaa7('0x11')][_0xdaa7('0x12')]===0x1f4){logger[_0xdaa7('0x11')](_0xdaa7('0xe'),_0x579b82,_0x14b8f9[_0xdaa7('0x11')][_0xdaa7('0x13')]);return _0x3e35d2(_0x14b8f9[_0xdaa7('0x11')][_0xdaa7('0x13')]);}logger[_0xdaa7('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x579b82,_0x14b8f9[_0xdaa7('0x11')]['message']);return _0x390fa3(_0x14b8f9[_0xdaa7('0x11')][_0xdaa7('0x13')]);}else{logger[_0xdaa7('0x14')](_0xdaa7('0xe'),_0x579b82,_0xdaa7('0xf'));_0x390fa3(_0x14b8f9[_0xdaa7('0x15')][_0xdaa7('0x13')]);}})[_0xdaa7('0x16')](function(_0xa36c3f){logger[_0xdaa7('0x11')](_0xdaa7('0xe'),_0x579b82,_0xa36c3f);_0x3e35d2(_0xa36c3f);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index c50453e..ea75431 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 _0x2f35=['index','get','/describe','describe','/:id','show','post','create','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','isAuthenticated'];(function(_0x290a36,_0x561046){var _0xc59237=function(_0x5c0c52){while(--_0x5c0c52){_0x290a36['push'](_0x290a36['shift']());}};_0xc59237(++_0x561046);}(_0x2f35,0x15b));var _0x52f3=function(_0x50e202,_0x268014){_0x50e202=_0x50e202-0x0;var _0x4a4993=_0x2f35[_0x50e202];return _0x4a4993;};'use strict';var multer=require(_0x52f3('0x0'));var util=require(_0x52f3('0x1'));var path=require(_0x52f3('0x2'));var timeout=require('connect-timeout');var express=require(_0x52f3('0x3'));var router=express[_0x52f3('0x4')]();var fs_extra=require(_0x52f3('0x5'));var auth=require(_0x52f3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x52f3('0x7'));var controller=require(_0x52f3('0x8'));router['get']('/',auth[_0x52f3('0x9')](),controller[_0x52f3('0xa')]);router[_0x52f3('0xb')](_0x52f3('0xc'),auth[_0x52f3('0x9')](),controller[_0x52f3('0xd')]);router[_0x52f3('0xb')](_0x52f3('0xe'),auth[_0x52f3('0x9')](),controller[_0x52f3('0xf')]);router[_0x52f3('0x10')]('/',auth['isAuthenticated'](),controller[_0x52f3('0x11')]);router['put'](_0x52f3('0xe'),auth[_0x52f3('0x9')](),controller[_0x52f3('0x12')]);router[_0x52f3('0x13')]('/:id',auth[_0x52f3('0x9')](),controller['destroy']);module[_0x52f3('0x14')]=router; \ No newline at end of file +var _0xb4f5=['put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','describe','get','show','create'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0xb4f5,0x83));var _0x5b4f=function(_0x4e7306,_0x51515f){_0x4e7306=_0x4e7306-0x0;var _0x403bbe=_0xb4f5[_0x4e7306];return _0x403bbe;};'use strict';var multer=require(_0x5b4f('0x0'));var util=require(_0x5b4f('0x1'));var path=require(_0x5b4f('0x2'));var timeout=require(_0x5b4f('0x3'));var express=require(_0x5b4f('0x4'));var router=express['Router']();var fs_extra=require(_0x5b4f('0x5'));var auth=require(_0x5b4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5b4f('0x7'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0x5b4f('0x8')](),controller['index']);router['get']('/describe',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x9')]);router[_0x5b4f('0xa')]('/:id',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0xb')]);router['post']('/',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0xc')]);router[_0x5b4f('0xd')](_0x5b4f('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x5b4f('0xf')]('/:id',auth[_0x5b4f('0x8')](),controller[_0x5b4f('0x10')]);module[_0x5b4f('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 69a7d30..5b4f291 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 _0xe511=['exports','STRING','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','sequelize'];(function(_0x2324cd,_0x56b1b6){var _0x1ce0fe=function(_0x4245cc){while(--_0x4245cc){_0x2324cd['push'](_0x2324cd['shift']());}};_0x1ce0fe(++_0x56b1b6);}(_0xe511,0x16f));var _0x1e51=function(_0x19d707,_0x17ca70){_0x19d707=_0x19d707-0x0;var _0x4475b1=_0xe511[_0x19d707];return _0x4475b1;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x1e51('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x1e51('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x1e51('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x42e242){this[_0x1e51('0x4')](_0x1e51('0x5'),_0x42e242?_0x42e242[_0x1e51('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x1e51('0x5'))?this[_0x1e51('0x7')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file +var _0xb62e=['STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb62e,0x1de));var _0xeb62=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb62e[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0xeb62('0x0'));module[_0xeb62('0x1')]={'name':{'type':Sequelize[_0xeb62('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xeb62('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xeb62('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xeb62('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xeb62('0x2')],'set':function(_0x929329){this[_0xeb62('0x4')](_0xeb62('0x5'),_0x929329?_0x929329['join'](''):[]);},'get':function(){return this[_0xeb62('0x6')](_0xeb62('0x5'))?this[_0xeb62('0x6')]('crudPermissions')[_0xeb62('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index d2e1f76..175bba2 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 _0xda6a=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','then','error','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xda6a,0xc7));var _0xada6=function(_0x1cddba,_0x3e497b){_0x1cddba=_0x1cddba-0x0;var _0x4bf2d1=_0xda6a[_0x1cddba];return _0x4bf2d1;};'use strict';var emlformat=require(_0xada6('0x0'));var rimraf=require(_0xada6('0x1'));var zipdir=require(_0xada6('0x2'));var jsonpatch=require(_0xada6('0x3'));var rp=require(_0xada6('0x4'));var moment=require('moment');var BPromise=require(_0xada6('0x5'));var Mustache=require('mustache');var util=require(_0xada6('0x6'));var path=require(_0xada6('0x7'));var sox=require(_0xada6('0x8'));var csv=require(_0xada6('0x9'));var ejs=require(_0xada6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xada6('0xb'));var squel=require(_0xada6('0xc'));var crypto=require(_0xada6('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xada6('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xada6('0xe'));var qs=require(_0xada6('0xf'));var as=require(_0xada6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xada6('0x11'))(_0xada6('0x12'));var utils=require('../../config/utils');var config=require(_0xada6('0x13'));var licenseUtil=require(_0xada6('0x14'));var db=require(_0xada6('0x15'))['db'];function respondWithStatusCode(_0x433df5,_0x572d65){_0x572d65=_0x572d65||0xcc;return function(_0x5c9894){if(_0x5c9894){return _0x433df5[_0xada6('0x16')](_0x572d65);}return _0x433df5[_0xada6('0x17')](_0x572d65)[_0xada6('0x18')]();};}function respondWithResult(_0x4accb6,_0x346706){_0x346706=_0x346706||0xc8;return function(_0x39ed13){if(_0x39ed13){return _0x4accb6['status'](_0x346706)['json'](_0x39ed13);}};}function respondWithFilteredResult(_0x192a10,_0x357c76){return function(_0x1f08d4){if(_0x1f08d4){var _0x25b18f=typeof _0x357c76[_0xada6('0x19')]==='undefined'&&typeof _0x357c76[_0xada6('0x1a')]===_0xada6('0x1b');var _0x707c26=_0x1f08d4['count'];var _0x474ed7=_0x25b18f?0x0:_0x357c76[_0xada6('0x19')];var _0x2b4793=_0x25b18f?_0x1f08d4[_0xada6('0x1c')]:_0x357c76[_0xada6('0x19')]+_0x357c76['limit'];var _0x521bdc;if(_0x2b4793>=_0x707c26){_0x2b4793=_0x707c26;_0x521bdc=0xc8;}else{_0x521bdc=0xce;}_0x192a10['status'](_0x521bdc);return _0x192a10[_0xada6('0x1d')](_0xada6('0x1e'),_0x474ed7+'-'+_0x2b4793+'/'+_0x707c26)[_0xada6('0x1f')](_0x1f08d4);}return null;};}function patchUpdates(_0x12b6d7){return function(_0x2baf9f){try{jsonpatch[_0xada6('0x20')](_0x2baf9f,_0x12b6d7,!![]);}catch(_0x438d48){return BPromise['reject'](_0x438d48);}return _0x2baf9f[_0xada6('0x21')]();};}function saveUpdates(_0x435e4d,_0x52b5d5){return function(_0x2355d7){if(_0x2355d7){return _0x2355d7['update'](_0x435e4d)[_0xada6('0x22')](function(_0x5d5980){return _0x5d5980;});}return null;};}function removeEntity(_0x5ca418,_0x47081a){return function(_0x381ff5){if(_0x381ff5){return _0x381ff5['destroy']()[_0xada6('0x22')](function(){_0x5ca418[_0xada6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x557916,_0x83a641){return function(_0x181cc2){if(!_0x181cc2){_0x557916[_0xada6('0x16')](0x194);}return _0x181cc2;};}function handleError(_0x536942,_0x2b14cf){_0x2b14cf=_0x2b14cf||0x1f4;return function(_0x486e21){logger[_0xada6('0x23')](_0x486e21['stack']);if(_0x486e21['name']){delete _0x486e21[_0xada6('0x24')];}_0x536942[_0xada6('0x17')](_0x2b14cf)[_0xada6('0x25')](_0x486e21);};}exports[_0xada6('0x26')]=function(_0x124a5e,_0x5ed6a9){var _0x440861={},_0xf34e13={},_0x26059c={'count':0x0,'rows':[]};var _0x5beb1a=_[_0xada6('0x27')](db[_0xada6('0x28')][_0xada6('0x29')],function(_0xa3ed0a){return{'name':_0xa3ed0a[_0xada6('0x2a')],'type':_0xa3ed0a[_0xada6('0x2b')]['key']};});_0xf34e13['model']=_[_0xada6('0x27')](_0x5beb1a,_0xada6('0x24'));_0xf34e13[_0xada6('0x2c')]=_[_0xada6('0x2d')](_0x124a5e[_0xada6('0x2c')]);_0xf34e13[_0xada6('0x2e')]=_[_0xada6('0x2f')](_0xf34e13[_0xada6('0x30')],_0xf34e13['query']);_0x440861[_0xada6('0x31')]=_[_0xada6('0x2f')](_0xf34e13['model'],qs[_0xada6('0x32')](_0x124a5e[_0xada6('0x2c')][_0xada6('0x32')]));_0x440861[_0xada6('0x31')]=_0x440861['attributes'][_0xada6('0x33')]?_0x440861[_0xada6('0x31')]:_0xf34e13[_0xada6('0x30')];if(!_0x124a5e[_0xada6('0x2c')]['hasOwnProperty'](_0xada6('0x34'))){_0x440861['limit']=qs[_0xada6('0x1a')](_0x124a5e['query'][_0xada6('0x1a')]);_0x440861[_0xada6('0x19')]=qs['offset'](_0x124a5e['query'][_0xada6('0x19')]);}_0x440861[_0xada6('0x35')]=qs[_0xada6('0x36')](_0x124a5e['query'][_0xada6('0x36')]);_0x440861[_0xada6('0x37')]=qs['filters'](_[_0xada6('0x38')](_0x124a5e['query'],_0xf34e13['filters']),_0x5beb1a);if(_0x124a5e[_0xada6('0x2c')][_0xada6('0x39')]){_0x440861[_0xada6('0x37')]=_[_0xada6('0x3a')](_0x440861[_0xada6('0x37')],{'$or':_[_0xada6('0x27')](_0x5beb1a,function(_0x4df40a){if(_0x4df40a[_0xada6('0x2b')]!==_0xada6('0x3b')){var _0x2cbc0d={};_0x2cbc0d[_0x4df40a[_0xada6('0x24')]]={'$like':'%'+_0x124a5e[_0xada6('0x2c')][_0xada6('0x39')]+'%'};return _0x2cbc0d;}})});}_0x440861=_['merge']({},_0x440861,_0x124a5e['options']);var _0x3a5ad9={'where':_0x440861[_0xada6('0x37')]};return db[_0xada6('0x28')][_0xada6('0x1c')](_0x3a5ad9)[_0xada6('0x22')](function(_0x4f8ddd){_0x26059c['count']=_0x4f8ddd;if(_0x124a5e[_0xada6('0x2c')][_0xada6('0x3c')]){_0x440861[_0xada6('0x3d')]=[{'all':!![]}];}return db['UserProfileSection'][_0xada6('0x3e')](_0x440861);})['then'](function(_0x14ddba){_0x26059c[_0xada6('0x3f')]=_0x14ddba;return _0x26059c;})['then'](respondWithFilteredResult(_0x5ed6a9,_0x440861))[_0xada6('0x40')](handleError(_0x5ed6a9,null));};exports[_0xada6('0x41')]=function(_0x5f15d5,_0x4739d6){var _0x352039={'raw':![],'where':{'id':_0x5f15d5[_0xada6('0x42')]['id']}},_0xed6206={};_0xed6206['model']=_['keys'](db['UserProfileSection'][_0xada6('0x29')]);_0xed6206[_0xada6('0x2c')]=_[_0xada6('0x2d')](_0x5f15d5[_0xada6('0x2c')]);_0xed6206[_0xada6('0x2e')]=_[_0xada6('0x2f')](_0xed6206[_0xada6('0x30')],_0xed6206[_0xada6('0x2c')]);_0x352039[_0xada6('0x31')]=_['intersection'](_0xed6206[_0xada6('0x30')],qs['fields'](_0x5f15d5[_0xada6('0x2c')]['fields']));_0x352039[_0xada6('0x31')]=_0x352039[_0xada6('0x31')][_0xada6('0x33')]?_0x352039[_0xada6('0x31')]:_0xed6206[_0xada6('0x30')];if(_0x5f15d5[_0xada6('0x2c')][_0xada6('0x3c')]){_0x352039[_0xada6('0x3d')]=[{'all':!![]}];}_0x352039=_['merge']({},_0x352039,_0x5f15d5['options']);return db[_0xada6('0x28')]['find'](_0x352039)['then'](handleEntityNotFound(_0x4739d6,null))[_0xada6('0x22')](respondWithResult(_0x4739d6,null))[_0xada6('0x40')](handleError(_0x4739d6,null));};exports['create']=function(_0x4f34d1,_0x5c8a32){return db['UserProfileSection']['create'](_0x4f34d1[_0xada6('0x43')],{})[_0xada6('0x22')](respondWithResult(_0x5c8a32,0xc9))[_0xada6('0x40')](handleError(_0x5c8a32,null));};exports['update']=function(_0x394ca1,_0x1e0605){if(_0x394ca1[_0xada6('0x43')]['id']){delete _0x394ca1[_0xada6('0x43')]['id'];}return db[_0xada6('0x28')][_0xada6('0x44')]({'where':{'id':_0x394ca1[_0xada6('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e0605,null))[_0xada6('0x22')](saveUpdates(_0x394ca1['body'],null))[_0xada6('0x22')](respondWithResult(_0x1e0605,null))[_0xada6('0x40')](handleError(_0x1e0605,null));};exports[_0xada6('0x45')]=function(_0x3a3cf7,_0x3f0443){return db[_0xada6('0x28')]['find']({'where':{'id':_0x3a3cf7[_0xada6('0x42')]['id']}})['then'](handleEntityNotFound(_0x3f0443,null))[_0xada6('0x22')](removeEntity(_0x3f0443,null))[_0xada6('0x40')](handleError(_0x3f0443,null));};exports[_0xada6('0x46')]=function(_0x73d8da,_0x151aeb){return db[_0xada6('0x28')][_0xada6('0x46')]()[_0xada6('0x22')](respondWithResult(_0x151aeb,null))[_0xada6('0x40')](handleError(_0x151aeb,null));}; \ No newline at end of file +var _0x0001=['index','map','UserProfileSection','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','status','stack','name','send'];(function(_0x366992,_0x6862f0){var _0x10bc0c=function(_0xd8a56e){while(--_0xd8a56e){_0x366992['push'](_0x366992['shift']());}};_0x10bc0c(++_0x6862f0);}(_0x0001,0x1e3));var _0x1000=function(_0x4e9e21,_0x3c77d6){_0x4e9e21=_0x4e9e21-0x0;var _0x4021b7=_0x0001[_0x4e9e21];return _0x4021b7;};'use strict';var emlformat=require(_0x1000('0x0'));var rimraf=require(_0x1000('0x1'));var zipdir=require(_0x1000('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1000('0x3'));var moment=require(_0x1000('0x4'));var BPromise=require(_0x1000('0x5'));var Mustache=require(_0x1000('0x6'));var util=require(_0x1000('0x7'));var path=require('path');var sox=require(_0x1000('0x8'));var csv=require(_0x1000('0x9'));var ejs=require(_0x1000('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1000('0xb'));var squel=require(_0x1000('0xc'));var crypto=require(_0x1000('0xd'));var jsforce=require(_0x1000('0xe'));var deskjs=require(_0x1000('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1000('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1000('0x11'));var as=require(_0x1000('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1000('0x13'))(_0x1000('0x14'));var utils=require(_0x1000('0x15'));var config=require(_0x1000('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1000('0x17'))['db'];function respondWithStatusCode(_0x2d248a,_0x277f55){_0x277f55=_0x277f55||0xcc;return function(_0x5e59d2){if(_0x5e59d2){return _0x2d248a[_0x1000('0x18')](_0x277f55);}return _0x2d248a['status'](_0x277f55)[_0x1000('0x19')]();};}function respondWithResult(_0x5594f9,_0xbcfd71){_0xbcfd71=_0xbcfd71||0xc8;return function(_0x1ef246){if(_0x1ef246){return _0x5594f9['status'](_0xbcfd71)[_0x1000('0x1a')](_0x1ef246);}};}function respondWithFilteredResult(_0x454720,_0x2e31c0){return function(_0x40e718){if(_0x40e718){var _0x33d7b3=typeof _0x2e31c0[_0x1000('0x1b')]==='undefined'&&typeof _0x2e31c0[_0x1000('0x1c')]===_0x1000('0x1d');var _0x2be398=_0x40e718[_0x1000('0x1e')];var _0x275be4=_0x33d7b3?0x0:_0x2e31c0[_0x1000('0x1b')];var _0x5517ce=_0x33d7b3?_0x40e718[_0x1000('0x1e')]:_0x2e31c0[_0x1000('0x1b')]+_0x2e31c0[_0x1000('0x1c')];var _0x32fa9b;if(_0x5517ce>=_0x2be398){_0x5517ce=_0x2be398;_0x32fa9b=0xc8;}else{_0x32fa9b=0xce;}_0x454720['status'](_0x32fa9b);return _0x454720[_0x1000('0x1f')](_0x1000('0x20'),_0x275be4+'-'+_0x5517ce+'/'+_0x2be398)[_0x1000('0x1a')](_0x40e718);}return null;};}function patchUpdates(_0x5613be){return function(_0x46d836){try{jsonpatch[_0x1000('0x21')](_0x46d836,_0x5613be,!![]);}catch(_0x572419){return BPromise[_0x1000('0x22')](_0x572419);}return _0x46d836[_0x1000('0x23')]();};}function saveUpdates(_0x47d70f,_0x7576de){return function(_0x2c09c7){if(_0x2c09c7){return _0x2c09c7[_0x1000('0x24')](_0x47d70f)[_0x1000('0x25')](function(_0x12f0da){return _0x12f0da;});}return null;};}function removeEntity(_0x133d57,_0x367764){return function(_0x7b7140){if(_0x7b7140){return _0x7b7140['destroy']()[_0x1000('0x25')](function(){_0x133d57[_0x1000('0x26')](0xcc)[_0x1000('0x19')]();});}};}function handleEntityNotFound(_0x12c58f,_0x23c920){return function(_0x2dfaaf){if(!_0x2dfaaf){_0x12c58f[_0x1000('0x18')](0x194);}return _0x2dfaaf;};}function handleError(_0x4508cc,_0xbb3269){_0xbb3269=_0xbb3269||0x1f4;return function(_0x32619c){logger['error'](_0x32619c[_0x1000('0x27')]);if(_0x32619c[_0x1000('0x28')]){delete _0x32619c[_0x1000('0x28')];}_0x4508cc['status'](_0xbb3269)[_0x1000('0x29')](_0x32619c);};}exports[_0x1000('0x2a')]=function(_0x41015e,_0x14f6ae){var _0x365bd5={},_0xfa88ca={},_0x112bef={'count':0x0,'rows':[]};var _0x5d11fe=_[_0x1000('0x2b')](db[_0x1000('0x2c')][_0x1000('0x2d')],function(_0x18d38d){return{'name':_0x18d38d[_0x1000('0x2e')],'type':_0x18d38d[_0x1000('0x2f')]['key']};});_0xfa88ca[_0x1000('0x30')]=_[_0x1000('0x2b')](_0x5d11fe,_0x1000('0x28'));_0xfa88ca['query']=_[_0x1000('0x31')](_0x41015e[_0x1000('0x32')]);_0xfa88ca[_0x1000('0x33')]=_[_0x1000('0x34')](_0xfa88ca['model'],_0xfa88ca[_0x1000('0x32')]);_0x365bd5[_0x1000('0x35')]=_[_0x1000('0x34')](_0xfa88ca[_0x1000('0x30')],qs[_0x1000('0x36')](_0x41015e[_0x1000('0x32')][_0x1000('0x36')]));_0x365bd5[_0x1000('0x35')]=_0x365bd5[_0x1000('0x35')][_0x1000('0x37')]?_0x365bd5[_0x1000('0x35')]:_0xfa88ca[_0x1000('0x30')];if(!_0x41015e['query']['hasOwnProperty'](_0x1000('0x38'))){_0x365bd5[_0x1000('0x1c')]=qs['limit'](_0x41015e[_0x1000('0x32')][_0x1000('0x1c')]);_0x365bd5[_0x1000('0x1b')]=qs['offset'](_0x41015e[_0x1000('0x32')]['offset']);}_0x365bd5[_0x1000('0x39')]=qs[_0x1000('0x3a')](_0x41015e['query']['sort']);_0x365bd5[_0x1000('0x3b')]=qs['filters'](_[_0x1000('0x3c')](_0x41015e[_0x1000('0x32')],_0xfa88ca[_0x1000('0x33')]),_0x5d11fe);if(_0x41015e['query'][_0x1000('0x3d')]){_0x365bd5[_0x1000('0x3b')]=_[_0x1000('0x3e')](_0x365bd5[_0x1000('0x3b')],{'$or':_[_0x1000('0x2b')](_0x5d11fe,function(_0x1fba1b){if(_0x1fba1b['type']!==_0x1000('0x3f')){var _0x65073e={};_0x65073e[_0x1fba1b[_0x1000('0x28')]]={'$like':'%'+_0x41015e[_0x1000('0x32')][_0x1000('0x3d')]+'%'};return _0x65073e;}})});}_0x365bd5=_[_0x1000('0x3e')]({},_0x365bd5,_0x41015e[_0x1000('0x40')]);var _0x53577b={'where':_0x365bd5[_0x1000('0x3b')]};return db[_0x1000('0x2c')][_0x1000('0x1e')](_0x53577b)[_0x1000('0x25')](function(_0x44bd54){_0x112bef[_0x1000('0x1e')]=_0x44bd54;if(_0x41015e['query']['includeAll']){_0x365bd5[_0x1000('0x41')]=[{'all':!![]}];}return db[_0x1000('0x2c')]['findAll'](_0x365bd5);})['then'](function(_0x446127){_0x112bef[_0x1000('0x42')]=_0x446127;return _0x112bef;})[_0x1000('0x25')](respondWithFilteredResult(_0x14f6ae,_0x365bd5))[_0x1000('0x43')](handleError(_0x14f6ae,null));};exports[_0x1000('0x44')]=function(_0x4945c8,_0x2a8135){var _0x5dce88={'raw':![],'where':{'id':_0x4945c8[_0x1000('0x45')]['id']}},_0x1c9beb={};_0x1c9beb['model']=_['keys'](db[_0x1000('0x2c')][_0x1000('0x2d')]);_0x1c9beb['query']=_['keys'](_0x4945c8[_0x1000('0x32')]);_0x1c9beb[_0x1000('0x33')]=_[_0x1000('0x34')](_0x1c9beb['model'],_0x1c9beb[_0x1000('0x32')]);_0x5dce88[_0x1000('0x35')]=_[_0x1000('0x34')](_0x1c9beb['model'],qs[_0x1000('0x36')](_0x4945c8[_0x1000('0x32')]['fields']));_0x5dce88['attributes']=_0x5dce88[_0x1000('0x35')][_0x1000('0x37')]?_0x5dce88[_0x1000('0x35')]:_0x1c9beb[_0x1000('0x30')];if(_0x4945c8[_0x1000('0x32')][_0x1000('0x46')]){_0x5dce88[_0x1000('0x41')]=[{'all':!![]}];}_0x5dce88=_[_0x1000('0x3e')]({},_0x5dce88,_0x4945c8[_0x1000('0x40')]);return db[_0x1000('0x2c')]['find'](_0x5dce88)['then'](handleEntityNotFound(_0x2a8135,null))['then'](respondWithResult(_0x2a8135,null))['catch'](handleError(_0x2a8135,null));};exports[_0x1000('0x47')]=function(_0x1f6532,_0x56eeab){return db[_0x1000('0x2c')][_0x1000('0x47')](_0x1f6532[_0x1000('0x48')],{})[_0x1000('0x25')](respondWithResult(_0x56eeab,0xc9))[_0x1000('0x43')](handleError(_0x56eeab,null));};exports['update']=function(_0x4addfd,_0x5a9d2e){if(_0x4addfd[_0x1000('0x48')]['id']){delete _0x4addfd[_0x1000('0x48')]['id'];}return db[_0x1000('0x2c')]['find']({'where':{'id':_0x4addfd[_0x1000('0x45')]['id']}})[_0x1000('0x25')](handleEntityNotFound(_0x5a9d2e,null))[_0x1000('0x25')](saveUpdates(_0x4addfd[_0x1000('0x48')],null))['then'](respondWithResult(_0x5a9d2e,null))[_0x1000('0x43')](handleError(_0x5a9d2e,null));};exports[_0x1000('0x49')]=function(_0x2cfe53,_0xd6f55c){return db['UserProfileSection']['find']({'where':{'id':_0x2cfe53[_0x1000('0x45')]['id']}})[_0x1000('0x25')](handleEntityNotFound(_0xd6f55c,null))[_0x1000('0x25')](removeEntity(_0xd6f55c,null))[_0x1000('0x43')](handleError(_0xd6f55c,null));};exports[_0x1000('0x4a')]=function(_0x47967c,_0x1e3e5a){return db[_0x1000('0x2c')][_0x1000('0x4a')]()[_0x1000('0x25')](respondWithResult(_0x1e3e5a,null))['catch'](handleError(_0x1e3e5a,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index cd50147..d30f707 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 _0xece1=['path','rimraf','../../config/environment','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xece1,0x89));var _0x1ece=function(_0x2702c5,_0x121a91){_0x2702c5=_0x2702c5-0x0;var _0x400d27=_0xece1[_0x2702c5];return _0x400d27;};'use strict';var _=require(_0x1ece('0x0'));var util=require(_0x1ece('0x1'));var logger=require(_0x1ece('0x2'))(_0x1ece('0x3'));var moment=require(_0x1ece('0x4'));var BPromise=require(_0x1ece('0x5'));var rp=require(_0x1ece('0x6'));var fs=require('fs');var path=require(_0x1ece('0x7'));var rimraf=require(_0x1ece('0x8'));var config=require(_0x1ece('0x9'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x219f3a,_0xb621f9){return _0x219f3a['define']('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x1ece('0xa'),_0x1ece('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4a1b=['api','bluebird','request-promise','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','lodash','util','../../config/logger'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4a1b,0x7f));var _0xb4a1=function(_0x743701,_0x3e67bb){_0x743701=_0x743701-0x0;var _0x5a141d=_0x4a1b[_0x743701];return _0x5a141d;};'use strict';var _=require(_0xb4a1('0x0'));var util=require(_0xb4a1('0x1'));var logger=require(_0xb4a1('0x2'))(_0xb4a1('0x3'));var moment=require('moment');var BPromise=require(_0xb4a1('0x4'));var rp=require(_0xb4a1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb4a1('0x6'));var attributes=require(_0xb4a1('0x7'));module[_0xb4a1('0x8')]=function(_0x1bc000,_0x4168a1){return _0x1bc000['define'](_0xb4a1('0x9'),attributes,{'tableName':_0xb4a1('0xa'),'paranoid':![],'indexes':[{'name':_0xb4a1('0xb'),'fields':[_0xb4a1('0xc'),'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 80cb3ef..ae9d579 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 _0xa77c=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x21f22e,_0x3868a7){var _0x3bc364=function(_0x255b24){while(--_0x255b24){_0x21f22e['push'](_0x21f22e['shift']());}};_0x3bc364(++_0x3868a7);}(_0xa77c,0x131));var _0xca77=function(_0x47042c,_0x339d8b){_0x47042c=_0x47042c-0x0;var _0x542e56=_0xa77c[_0x47042c];return _0x542e56;};'use strict';var _=require(_0xca77('0x0'));var util=require(_0xca77('0x1'));var moment=require(_0xca77('0x2'));var BPromise=require('bluebird');var rs=require(_0xca77('0x3'));var fs=require('fs');var Redis=require(_0xca77('0x4'));var db=require(_0xca77('0x5'))['db'];var utils=require(_0xca77('0x6'));var logger=require(_0xca77('0x7'))(_0xca77('0x8'));var config=require(_0xca77('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xca77('0xa')][_0xca77('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41afa4,_0x59e19b,_0x2b557e){return new BPromise(function(_0x24475b,_0x400806){return client[_0xca77('0xc')](_0x41afa4,_0x2b557e)[_0xca77('0xd')](function(_0x55dc11){logger[_0xca77('0xe')](_0xca77('0xf'),_0x59e19b,_0xca77('0x10'));logger[_0xca77('0x11')](_0xca77('0x12'),_0x59e19b,_0xca77('0x10'),JSON[_0xca77('0x13')](_0x55dc11));if(_0x55dc11['error']){if(_0x55dc11[_0xca77('0x14')][_0xca77('0x15')]===0x1f4){logger[_0xca77('0x14')](_0xca77('0xf'),_0x59e19b,_0x55dc11[_0xca77('0x14')][_0xca77('0x16')]);return _0x400806(_0x55dc11['error'][_0xca77('0x16')]);}logger[_0xca77('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x59e19b,_0x55dc11[_0xca77('0x14')][_0xca77('0x16')]);return _0x24475b(_0x55dc11[_0xca77('0x14')][_0xca77('0x16')]);}else{logger[_0xca77('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x59e19b,_0xca77('0x10'));_0x24475b(_0x55dc11[_0xca77('0x17')][_0xca77('0x16')]);}})['catch'](function(_0x3f53d7){logger[_0xca77('0x14')](_0xca77('0xf'),_0x59e19b,_0x3f53d7);_0x400806(_0x3f53d7);});});} \ No newline at end of file +var _0xe7ab=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5f2da6,_0x5ad591){var _0x1c7e21=function(_0x4ee65e){while(--_0x4ee65e){_0x5f2da6['push'](_0x5f2da6['shift']());}};_0x1c7e21(++_0x5ad591);}(_0xe7ab,0xe7));var _0xbe7a=function(_0x1176dc,_0x4b4ad7){_0x1176dc=_0x1176dc-0x0;var _0x32fa65=_0xe7ab[_0x1176dc];return _0x32fa65;};'use strict';var _=require(_0xbe7a('0x0'));var util=require(_0xbe7a('0x1'));var moment=require(_0xbe7a('0x2'));var BPromise=require(_0xbe7a('0x3'));var rs=require(_0xbe7a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe7a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe7a('0x6'))(_0xbe7a('0x7'));var config=require(_0xbe7a('0x8'));var jayson=require(_0xbe7a('0x9'));var client=jayson[_0xbe7a('0xa')][_0xbe7a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7aefba,_0xdba467,_0x23a7d3){return new BPromise(function(_0x409fb3,_0x51a955){return client[_0xbe7a('0xc')](_0x7aefba,_0x23a7d3)[_0xbe7a('0xd')](function(_0x1f1c70){logger['info'](_0xbe7a('0xe'),_0xdba467,_0xbe7a('0xf'));logger[_0xbe7a('0x10')](_0xbe7a('0x11'),_0xdba467,_0xbe7a('0xf'),JSON[_0xbe7a('0x12')](_0x1f1c70));if(_0x1f1c70[_0xbe7a('0x13')]){if(_0x1f1c70[_0xbe7a('0x13')][_0xbe7a('0x14')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0xdba467,_0x1f1c70[_0xbe7a('0x13')]['message']);return _0x51a955(_0x1f1c70[_0xbe7a('0x13')][_0xbe7a('0x15')]);}logger[_0xbe7a('0x13')]('UserProfileSection,\x20%s,\x20%s',_0xdba467,_0x1f1c70['error'][_0xbe7a('0x15')]);return _0x409fb3(_0x1f1c70['error'][_0xbe7a('0x15')]);}else{logger['info'](_0xbe7a('0xe'),_0xdba467,_0xbe7a('0xf'));_0x409fb3(_0x1f1c70['result'][_0xbe7a('0x15')]);}})[_0xbe7a('0x16')](function(_0x18330c){logger['error'](_0xbe7a('0xe'),_0xdba467,_0x18330c);_0x51a955(_0x18330c);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 941345a..d220bb5 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4c8d9c,_0x5a7bac){var _0x41e860=function(_0xd6d6c5){while(--_0xd6d6c5){_0x4c8d9c['push'](_0x4c8d9c['shift']());}};_0x41e860(++_0x5a7bac);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1e91eb,_0x5829a3){_0x1e91eb=_0x1e91eb-0x0;var _0x2af75a=_0xcb91[_0x1e91eb];return _0x2af75a;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4ef221,_0x596540){var _0x202ba5=function(_0x78cb05){while(--_0x78cb05){_0x4ef221['push'](_0x4ef221['shift']());}};_0x202ba5(++_0x596540);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 1668c1e..9cab259 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 _0x5a29=['INTEGER','sequelize','exports'];(function(_0x28d9ab,_0x4b68b1){var _0x5a46d9=function(_0x3b7b38){while(--_0x3b7b38){_0x28d9ab['push'](_0x28d9ab['shift']());}};_0x5a46d9(++_0x4b68b1);}(_0x5a29,0x1db));var _0x95a2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5a29[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x95a2('0x0'));module[_0x95a2('0x1')]={'penalty':{'type':Sequelize[_0x95a2('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0637=['sequelize','INTEGER'];(function(_0x5b0680,_0x2c43fb){var _0x1fe35d=function(_0x1a91ea){while(--_0x1a91ea){_0x5b0680['push'](_0x5b0680['shift']());}};_0x1fe35d(++_0x2c43fb);}(_0x0637,0x7e));var _0x7063=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0637[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x7063('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x7063('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 c43c2fa..351bd18 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 _0x0e4b=['./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','moment','../../config/environment'];(function(_0x4858ed,_0x47de67){var _0x5b74f3=function(_0xf753fa){while(--_0xf753fa){_0x4858ed['push'](_0x4858ed['shift']());}};_0x5b74f3(++_0x47de67);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x20f37d,_0x20a575){_0x20f37d=_0x20f37d-0x0;var _0x35e958=_0x0e4b[_0x20f37d];return _0x35e958;};'use strict';var _=require(_0xb0e4('0x0'));var util=require(_0xb0e4('0x1'));var logger=require(_0xb0e4('0x2'))('api');var moment=require(_0xb0e4('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(_0xb0e4('0x4'));var attributes=require(_0xb0e4('0x5'));module['exports']=function(_0x45bdf2,_0x3b56c3){return _0x45bdf2[_0xb0e4('0x6')](_0xb0e4('0x7'),attributes,{'tableName':_0xb0e4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7524=['../../config/logger','moment','bluebird','rimraf','./userSmsQueue.attributes','exports','define','user_has_sms_queues','util'];(function(_0x1d1bd0,_0x237c21){var _0x54bcac=function(_0x313159){while(--_0x313159){_0x1d1bd0['push'](_0x1d1bd0['shift']());}};_0x54bcac(++_0x237c21);}(_0x7524,0xce));var _0x4752=function(_0x187435,_0x5675cb){_0x187435=_0x187435-0x0;var _0x32b1d1=_0x7524[_0x187435];return _0x32b1d1;};'use strict';var _=require('lodash');var util=require(_0x4752('0x0'));var logger=require(_0x4752('0x1'))('api');var moment=require(_0x4752('0x2'));var BPromise=require(_0x4752('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4752('0x4'));var config=require('../../config/environment');var attributes=require(_0x4752('0x5'));module[_0x4752('0x6')]=function(_0x66a421,_0x55b411){return _0x66a421[_0x4752('0x7')]('UserSmsQueue',attributes,{'tableName':_0x4752('0x8'),'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 948f9f9..4ef565d 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 _0xb267=['client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise'];(function(_0x4300b1,_0x50389e){var _0x3c073d=function(_0x30c6fd){while(--_0x30c6fd){_0x4300b1['push'](_0x4300b1['shift']());}};_0x3c073d(++_0x50389e);}(_0xb267,0x15e));var _0x7b26=function(_0x35d575,_0x5f5733){_0x35d575=_0x35d575-0x0;var _0x527650=_0xb267[_0x35d575];return _0x527650;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7b26('0x0'));var BPromise=require(_0x7b26('0x1'));var rs=require(_0x7b26('0x2'));var fs=require('fs');var Redis=require(_0x7b26('0x3'));var db=require(_0x7b26('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7b26('0x5'));var jayson=require(_0x7b26('0x6'));var client=jayson[_0x7b26('0x7')][_0x7b26('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x308c23,_0x8b5dff,_0x360b76){return new BPromise(function(_0x592b0c,_0x30cedf){return client[_0x7b26('0x9')](_0x308c23,_0x360b76)[_0x7b26('0xa')](function(_0xb4eebb){logger[_0x7b26('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x8b5dff,'request\x20sent');logger['debug'](_0x7b26('0xc'),_0x8b5dff,_0x7b26('0xd'),JSON[_0x7b26('0xe')](_0xb4eebb));if(_0xb4eebb[_0x7b26('0xf')]){if(_0xb4eebb['error'][_0x7b26('0x10')]===0x1f4){logger[_0x7b26('0xf')](_0x7b26('0x11'),_0x8b5dff,_0xb4eebb[_0x7b26('0xf')][_0x7b26('0x12')]);return _0x30cedf(_0xb4eebb['error'][_0x7b26('0x12')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x8b5dff,_0xb4eebb['error'][_0x7b26('0x12')]);return _0x592b0c(_0xb4eebb['error'][_0x7b26('0x12')]);}else{logger[_0x7b26('0xb')](_0x7b26('0x11'),_0x8b5dff,_0x7b26('0xd'));_0x592b0c(_0xb4eebb[_0x7b26('0x13')][_0x7b26('0x12')]);}})[_0x7b26('0x14')](function(_0x2b170e){logger[_0x7b26('0xf')](_0x7b26('0x11'),_0x8b5dff,_0x2b170e);_0x30cedf(_0x2b170e);});});} \ No newline at end of file +var _0x14cb=['http','UserSmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3f07c7,_0x675256){var _0x1c2cd7=function(_0x108d78){while(--_0x108d78){_0x3f07c7['push'](_0x3f07c7['shift']());}};_0x1c2cd7(++_0x675256);}(_0x14cb,0x7c));var _0xb14c=function(_0xce80ee,_0x345599){_0xce80ee=_0xce80ee-0x0;var _0x4fd68d=_0x14cb[_0xce80ee];return _0x4fd68d;};'use strict';var _=require(_0xb14c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb14c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb14c('0x2'));var db=require(_0xb14c('0x3'))['db'];var utils=require(_0xb14c('0x4'));var logger=require(_0xb14c('0x5'))(_0xb14c('0x6'));var config=require('../../config/environment');var jayson=require(_0xb14c('0x7'));var client=jayson[_0xb14c('0x8')][_0xb14c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35069c,_0x271ff2,_0xf69136){return new BPromise(function(_0x5e0011,_0xc8b9cd){return client['request'](_0x35069c,_0xf69136)['then'](function(_0x365ccd){logger['info'](_0xb14c('0xa'),_0x271ff2,'request\x20sent');logger[_0xb14c('0xb')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x271ff2,_0xb14c('0xc'),JSON[_0xb14c('0xd')](_0x365ccd));if(_0x365ccd[_0xb14c('0xe')]){if(_0x365ccd[_0xb14c('0xe')][_0xb14c('0xf')]===0x1f4){logger['error'](_0xb14c('0xa'),_0x271ff2,_0x365ccd['error']['message']);return _0xc8b9cd(_0x365ccd['error'][_0xb14c('0x10')]);}logger[_0xb14c('0xe')](_0xb14c('0xa'),_0x271ff2,_0x365ccd[_0xb14c('0xe')][_0xb14c('0x10')]);return _0x5e0011(_0x365ccd[_0xb14c('0xe')][_0xb14c('0x10')]);}else{logger[_0xb14c('0x11')](_0xb14c('0xa'),_0x271ff2,_0xb14c('0xc'));_0x5e0011(_0x365ccd['result'][_0xb14c('0x10')]);}})[_0xb14c('0x12')](function(_0x552762){logger['error'](_0xb14c('0xa'),_0x271ff2,_0x552762);_0xc8b9cd(_0x552762);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index fb5643c..cfa4fbd 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 _0x3aa5=['sequelize','exports','INTEGER'];(function(_0x67936a,_0x2047bc){var _0x3aa79a=function(_0x467d7d){while(--_0x467d7d){_0x67936a['push'](_0x67936a['shift']());}};_0x3aa79a(++_0x2047bc);}(_0x3aa5,0x87));var _0x53aa=function(_0x39bd2f,_0x2971ba){_0x39bd2f=_0x39bd2f-0x0;var _0x5d9775=_0x3aa5[_0x39bd2f];return _0x5d9775;};'use strict';var Sequelize=require(_0x53aa('0x0'));module[_0x53aa('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x53aa('0x2')]}}; \ No newline at end of file +var _0x4ebb=['INTEGER','sequelize','exports'];(function(_0x185267,_0x4163e6){var _0x3423f5=function(_0x2871c2){while(--_0x2871c2){_0x185267['push'](_0x185267['shift']());}};_0x3423f5(++_0x4163e6);}(_0x4ebb,0xb2));var _0xb4eb=function(_0x126b55,_0x56bc93){_0x126b55=_0x126b55-0x0;var _0x5f1415=_0x4ebb[_0x126b55];return _0x5f1415;};'use strict';var Sequelize=require(_0xb4eb('0x0'));module[_0xb4eb('0x1')]={'UserId':{'type':Sequelize[_0xb4eb('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xb4eb('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 52def34..b8ee52a 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(_0x13f5a7,_0x24da6b){var _0x4bc1ca=function(_0x1f93c4){while(--_0x1f93c4){_0x13f5a7['push'](_0x13f5a7['shift']());}};_0x4bc1ca(++_0x24da6b);}(_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 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(_0x2d7dde,_0x115332){var _0x3e72f6=function(_0x501661){while(--_0x501661){_0x2d7dde['push'](_0x2d7dde['shift']());}};_0x3e72f6(++_0x115332);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 cb41250..0332547 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2d1dd2,_0x5ff0e0){var _0x5db677=function(_0x22f373){while(--_0x22f373){_0x2d1dd2['push'](_0x2d1dd2['shift']());}};_0x5db677(++_0x5ff0e0);}(_0x70e0,0x17b));var _0x070e=function(_0x5d5445,_0x49be14){_0x5d5445=_0x5d5445-0x0;var _0x37c0b7=_0x70e0[_0x5d5445];return _0x37c0b7;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x37d8e1,_0x349648){var _0x18584c=function(_0x2b2e4d){while(--_0x2b2e4d){_0x37d8e1['push'](_0x37d8e1['shift']());}};_0x18584c(++_0x349648);}(_0x70e0,0x17b));var _0x070e=function(_0x5d3219,_0x32f848){_0x5d3219=_0x5d3219-0x0;var _0x354ed3=_0x70e0[_0x5d3219];return _0x354ed3;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index f0030fe..eb43197 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 _0x4d1b=['sequelize','exports'];(function(_0x408d4c,_0x1fe565){var _0x123cd0=function(_0x40f93f){while(--_0x40f93f){_0x408d4c['push'](_0x408d4c['shift']());}};_0x123cd0(++_0x1fe565);}(_0x4d1b,0x128));var _0xb4d1=function(_0x40aaa4,_0x3b22f4){_0x40aaa4=_0x40aaa4-0x0;var _0x4e21e5=_0x4d1b[_0x40aaa4];return _0x4e21e5;};'use strict';var Sequelize=require(_0xb4d1('0x0'));module[_0xb4d1('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa7eb=['exports','sequelize'];(function(_0x5bc999,_0x25cf39){var _0x135b6d=function(_0x18c8ce){while(--_0x18c8ce){_0x5bc999['push'](_0x5bc999['shift']());}};_0x135b6d(++_0x25cf39);}(_0xa7eb,0x71));var _0xba7e=function(_0x259917,_0x2ca224){_0x259917=_0x259917-0x0;var _0x4536d0=_0xa7eb[_0x259917];return _0x4536d0;};'use strict';var Sequelize=require(_0xba7e('0x0'));module[_0xba7e('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 9a6d8fb..c5f022f 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 _0x811e=['moment','bluebird','request-promise','../../config/environment','exports','lodash','util','api'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x811e,0x1d5));var _0xe811=function(_0x18a342,_0xe3c72f){_0x18a342=_0x18a342-0x0;var _0x10be3a=_0x811e[_0x18a342];return _0x10be3a;};'use strict';var _=require(_0xe811('0x0'));var util=require(_0xe811('0x1'));var logger=require('../../config/logger')(_0xe811('0x2'));var moment=require(_0xe811('0x3'));var BPromise=require(_0xe811('0x4'));var rp=require(_0xe811('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe811('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0xe811('0x7')]=function(_0x1115ef,_0x5a1408){return _0x1115ef['define']('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66cf=['path','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x66cf,0x95));var _0xf66c=function(_0x60a21f,_0x5af97b){_0x60a21f=_0x60a21f-0x0;var _0x21776b=_0x66cf[_0x60a21f];return _0x21776b;};'use strict';var _=require(_0xf66c('0x0'));var util=require(_0xf66c('0x1'));var logger=require(_0xf66c('0x2'))(_0xf66c('0x3'));var moment=require(_0xf66c('0x4'));var BPromise=require(_0xf66c('0x5'));var rp=require(_0xf66c('0x6'));var fs=require('fs');var path=require(_0xf66c('0x7'));var rimraf=require('rimraf');var config=require(_0xf66c('0x8'));var attributes=require(_0xf66c('0x9'));module['exports']=function(_0x60dd26,_0x335bfc){return _0x60dd26[_0xf66c('0xa')](_0xf66c('0xb'),attributes,{'tableName':_0xf66c('0xc'),'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 25ebc85..8e01951 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 _0x2f83=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x4ef77b,_0x6a3df){var _0x58d1a6=function(_0x3b7e29){while(--_0x3b7e29){_0x4ef77b['push'](_0x4ef77b['shift']());}};_0x58d1a6(++_0x6a3df);}(_0x2f83,0x180));var _0x32f8=function(_0xcd49bd,_0x2a12a3){_0xcd49bd=_0xcd49bd-0x0;var _0xb6ee44=_0x2f83[_0xcd49bd];return _0xb6ee44;};'use strict';var _=require(_0x32f8('0x0'));var util=require(_0x32f8('0x1'));var moment=require(_0x32f8('0x2'));var BPromise=require(_0x32f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x32f8('0x4'));var db=require(_0x32f8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x32f8('0x6'))(_0x32f8('0x7'));var config=require(_0x32f8('0x8'));var jayson=require(_0x32f8('0x9'));var client=jayson[_0x32f8('0xa')][_0x32f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54ce02,_0xee71a1,_0x2e639e){return new BPromise(function(_0x375368,_0x1ba754){return client[_0x32f8('0xc')](_0x54ce02,_0x2e639e)['then'](function(_0x12187b){logger[_0x32f8('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0xee71a1,_0x32f8('0xe'));logger[_0x32f8('0xf')](_0x32f8('0x10'),_0xee71a1,_0x32f8('0xe'),JSON[_0x32f8('0x11')](_0x12187b));if(_0x12187b['error']){if(_0x12187b[_0x32f8('0x12')][_0x32f8('0x13')]===0x1f4){logger['error'](_0x32f8('0x14'),_0xee71a1,_0x12187b[_0x32f8('0x12')][_0x32f8('0x15')]);return _0x1ba754(_0x12187b[_0x32f8('0x12')]['message']);}logger['error'](_0x32f8('0x14'),_0xee71a1,_0x12187b[_0x32f8('0x12')][_0x32f8('0x15')]);return _0x375368(_0x12187b[_0x32f8('0x12')]['message']);}else{logger[_0x32f8('0xd')](_0x32f8('0x14'),_0xee71a1,_0x32f8('0xe'));_0x375368(_0x12187b['result'][_0x32f8('0x15')]);}})[_0x32f8('0x16')](function(_0x368f43){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0xee71a1,_0x368f43);_0x1ba754(_0x368f43);});});} \ No newline at end of file +var _0x2390=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','util','moment'];(function(_0x33154d,_0x854047){var _0x3b2f03=function(_0x35f7a6){while(--_0x35f7a6){_0x33154d['push'](_0x33154d['shift']());}};_0x3b2f03(++_0x854047);}(_0x2390,0x152));var _0x0239=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x2390[_0x187ee1];return _0x388160;};'use strict';var _=require('lodash');var util=require(_0x0239('0x0'));var moment=require(_0x0239('0x1'));var BPromise=require(_0x0239('0x2'));var rs=require(_0x0239('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0239('0x4'))['db'];var utils=require(_0x0239('0x5'));var logger=require('../../config/logger')(_0x0239('0x6'));var config=require('../../config/environment');var jayson=require(_0x0239('0x7'));var client=jayson[_0x0239('0x8')][_0x0239('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7d6c98,_0x354aed,_0x14b709){return new BPromise(function(_0x37acf9,_0x361c95){return client[_0x0239('0xa')](_0x7d6c98,_0x14b709)[_0x0239('0xb')](function(_0x1cf007){logger[_0x0239('0xc')](_0x0239('0xd'),_0x354aed,_0x0239('0xe'));logger[_0x0239('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x354aed,_0x0239('0xe'),JSON['stringify'](_0x1cf007));if(_0x1cf007[_0x0239('0x10')]){if(_0x1cf007['error'][_0x0239('0x11')]===0x1f4){logger[_0x0239('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x354aed,_0x1cf007[_0x0239('0x10')][_0x0239('0x12')]);return _0x361c95(_0x1cf007[_0x0239('0x10')][_0x0239('0x12')]);}logger[_0x0239('0x10')](_0x0239('0xd'),_0x354aed,_0x1cf007[_0x0239('0x10')][_0x0239('0x12')]);return _0x37acf9(_0x1cf007[_0x0239('0x10')][_0x0239('0x12')]);}else{logger[_0x0239('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x354aed,_0x0239('0xe'));_0x37acf9(_0x1cf007['result'][_0x0239('0x12')]);}})[_0x0239('0x13')](function(_0x5734e7){logger[_0x0239('0x10')](_0x0239('0xd'),_0x354aed,_0x5734e7);_0x361c95(_0x5734e7);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 38afdec..4916e3a 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(_0x43f585,_0x3f8ba8){var _0x399005=function(_0x1e0027){while(--_0x1e0027){_0x43f585['push'](_0x43f585['shift']());}};_0x399005(++_0x3f8ba8);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x163b24,_0x57dbc2){var _0x95087b=function(_0x39d161){while(--_0x39d161){_0x163b24['push'](_0x163b24['shift']());}};_0x95087b(++_0x57dbc2);}(_0x70e0,0x17b));var _0x070e=function(_0x5ed338,_0x26a047){_0x5ed338=_0x5ed338-0x0;var _0x3b09d1=_0x70e0[_0x5ed338];return _0x3b09d1;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index bb0dd5b..723fe9f 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 _0xb3e4=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x3fefc9,_0xb564ef){var _0x2826dd=function(_0x4ce2bc){while(--_0x4ce2bc){_0x3fefc9['push'](_0x3fefc9['shift']());}};_0x2826dd(++_0xb564ef);}(_0xb3e4,0x18a));var _0x4b3e=function(_0x29d1dc,_0x59a24e){_0x29d1dc=_0x29d1dc-0x0;var _0x11c157=_0xb3e4[_0x29d1dc];return _0x11c157;};'use strict';var Sequelize=require(_0x4b3e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x4b3e('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x4b3e('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x4b3e('0x2')},'UserId':{'type':Sequelize[_0x4b3e('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x4b3e('0x3')],'allowNull':![],'unique':_0x4b3e('0x4'),'comment':_0x4b3e('0x2')},'VoiceQueueId':{'type':Sequelize[_0x4b3e('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x4b3e('0x3')],'allowNull':![],'unique':_0x4b3e('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x4b3e('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xbf3d=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x2131f9,_0x3ab36f){var _0x31bbb1=function(_0x15fcdf){while(--_0x15fcdf){_0x2131f9['push'](_0x2131f9['shift']());}};_0x31bbb1(++_0x3ab36f);}(_0xbf3d,0xc5));var _0xdbf3=function(_0x254803,_0x443ed9){_0x254803=_0x254803-0x0;var _0x53351e=_0xbf3d[_0x254803];return _0x53351e;};'use strict';var Sequelize=require(_0xdbf3('0x0'));module[_0xdbf3('0x1')]={'uniqueid':{'type':Sequelize[_0xdbf3('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xdbf3('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xdbf3('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xdbf3('0x4')],'allowNull':![],'unique':_0xdbf3('0x5'),'comment':_0xdbf3('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xdbf3('0x4')],'allowNull':![],'unique':_0xdbf3('0x5'),'comment':_0xdbf3('0x3')},'penalty':{'type':Sequelize[_0xdbf3('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xdbf3('0x2')](0xb),'defaultValue':0x0,'comment':_0xdbf3('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index e864c4b..35c3ddf 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 _0xb6c6=['save','update','emit','hasOwnProperty','exports','events','setMaxListeners'];(function(_0xcb37df,_0x167e90){var _0x5d3122=function(_0x14e707){while(--_0x14e707){_0xcb37df['push'](_0xcb37df['shift']());}};_0x5d3122(++_0x167e90);}(_0xb6c6,0x1be));var _0x6b6c=function(_0xcfe1e3,_0x1d2820){_0xcfe1e3=_0xcfe1e3-0x0;var _0x2f305e=_0xb6c6[_0xcfe1e3];return _0x2f305e;};'use strict';var EventEmitter=require(_0x6b6c('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x6b6c('0x1')](0x0);var events={'afterCreate':_0x6b6c('0x2'),'afterUpdate':_0x6b6c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x10d8bf){return function(_0x2635f0,_0x386c68,_0xcd6b09){UserVoiceQueueRtEvents['emit'](_0x10d8bf+':'+_0x2635f0['id'],_0x2635f0);UserVoiceQueueRtEvents[_0x6b6c('0x4')](_0x10d8bf,_0x2635f0);_0xcd6b09(null);};}for(var e in events){if(events[_0x6b6c('0x5')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x6b6c('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x22e5=['emit','hook','exports','setMaxListeners','update','remove'];(function(_0x8c93f6,_0x2bff97){var _0x4c6aba=function(_0x19ee88){while(--_0x19ee88){_0x8c93f6['push'](_0x8c93f6['shift']());}};_0x4c6aba(++_0x2bff97);}(_0x22e5,0x189));var _0x522e=function(_0x38f939,_0x32a8bf){_0x38f939=_0x38f939-0x0;var _0x113693=_0x22e5[_0x38f939];return _0x113693;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x522e('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x522e('0x1'),'afterDestroy':_0x522e('0x2')};function emitEvent(_0x42a2dd){return function(_0x502229,_0x589434,_0x592a7b){UserVoiceQueueRtEvents['emit'](_0x42a2dd+':'+_0x502229['id'],_0x502229);UserVoiceQueueRtEvents[_0x522e('0x3')](_0x42a2dd,_0x502229);_0x592a7b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x522e('0x4')](e,emitEvent(event));}}module[_0x522e('0x5')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index ddb6e6b..fb449f9 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 _0x7901=['request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','lodash','util','api','moment','bluebird'];(function(_0x22ef1d,_0x57d3aa){var _0x11d109=function(_0x5bcee0){while(--_0x5bcee0){_0x22ef1d['push'](_0x22ef1d['shift']());}};_0x11d109(++_0x57d3aa);}(_0x7901,0x97));var _0x1790=function(_0x5c04a8,_0x1cf1e2){_0x5c04a8=_0x5c04a8-0x0;var _0x415022=_0x7901[_0x5c04a8];return _0x415022;};'use strict';var _=require(_0x1790('0x0'));var util=require(_0x1790('0x1'));var logger=require('../../config/logger')(_0x1790('0x2'));var moment=require(_0x1790('0x3'));var BPromise=require(_0x1790('0x4'));var rp=require(_0x1790('0x5'));var fs=require('fs');var path=require(_0x1790('0x6'));var rimraf=require(_0x1790('0x7'));var config=require(_0x1790('0x8'));var attributes=require(_0x1790('0x9'));module[_0x1790('0xa')]=function(_0x1e9772,_0x3e6917){return _0x1e9772[_0x1790('0xb')](_0x1790('0xc'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9068=['define','user_has_voice_queues_rt','util','api','moment','bluebird','rimraf'];(function(_0x197a7a,_0x4b9054){var _0x386cb6=function(_0xa32b1b){while(--_0xa32b1b){_0x197a7a['push'](_0x197a7a['shift']());}};_0x386cb6(++_0x4b9054);}(_0x9068,0x113));var _0x8906=function(_0x302da4,_0x5d3076){_0x302da4=_0x302da4-0x0;var _0x5c152d=_0x9068[_0x302da4];return _0x5c152d;};'use strict';var _=require('lodash');var util=require(_0x8906('0x0'));var logger=require('../../config/logger')(_0x8906('0x1'));var moment=require(_0x8906('0x2'));var BPromise=require(_0x8906('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8906('0x4'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x5964d1,_0x239f62){return _0x5964d1[_0x8906('0x5')]('UserVoiceQueueRt',attributes,{'tableName':_0x8906('0x6'),'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 2989071..a6ada9f 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 _0x6d31=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','util','moment','bluebird','randomstring','ioredis'];(function(_0x14bdfb,_0x7ebb3c){var _0x433477=function(_0x499bf6){while(--_0x499bf6){_0x14bdfb['push'](_0x14bdfb['shift']());}};_0x433477(++_0x7ebb3c);}(_0x6d31,0x6d));var _0x16d3=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x6d31[_0x3054be];return _0x3df150;};'use strict';var _=require('lodash');var util=require(_0x16d3('0x0'));var moment=require(_0x16d3('0x1'));var BPromise=require(_0x16d3('0x2'));var rs=require(_0x16d3('0x3'));var fs=require('fs');var Redis=require(_0x16d3('0x4'));var db=require(_0x16d3('0x5'))['db'];var utils=require(_0x16d3('0x6'));var logger=require(_0x16d3('0x7'))(_0x16d3('0x8'));var config=require('../../config/environment');var jayson=require(_0x16d3('0x9'));var client=jayson[_0x16d3('0xa')][_0x16d3('0xb')]({'port':0x232a});config[_0x16d3('0xc')]=_[_0x16d3('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x16d3('0xe'))(new Redis(config['redis']));require(_0x16d3('0xf'))[_0x16d3('0x10')](socket);function respondWithRpcPromise(_0x384705,_0x424085,_0x4d2cc0){return new BPromise(function(_0x5c29d2,_0x51d560){return client[_0x16d3('0x11')](_0x384705,_0x4d2cc0)[_0x16d3('0x12')](function(_0xd6af){logger[_0x16d3('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x424085,_0x16d3('0x14'));logger[_0x16d3('0x15')](_0x16d3('0x16'),_0x424085,_0x16d3('0x14'),JSON[_0x16d3('0x17')](_0xd6af));if(_0xd6af[_0x16d3('0x18')]){if(_0xd6af['error'][_0x16d3('0x19')]===0x1f4){logger[_0x16d3('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x424085,_0xd6af[_0x16d3('0x18')][_0x16d3('0x1a')]);return _0x51d560(_0xd6af['error']['message']);}logger[_0x16d3('0x18')](_0x16d3('0x1b'),_0x424085,_0xd6af[_0x16d3('0x18')]['message']);return _0x5c29d2(_0xd6af[_0x16d3('0x18')][_0x16d3('0x1a')]);}else{logger['info'](_0x16d3('0x1b'),_0x424085,_0x16d3('0x14'));_0x5c29d2(_0xd6af[_0x16d3('0x1c')][_0x16d3('0x1a')]);}})[_0x16d3('0x1d')](function(_0x3888e7){logger[_0x16d3('0x18')](_0x16d3('0x1b'),_0x424085,_0x3888e7);_0x51d560(_0x3888e7);});});}exports[_0x16d3('0x1e')]=function(_0xd210f7){var _0x40980d=this;return new Promise(function(_0x114c5f,_0xb804dd){return db[_0x16d3('0x1f')][_0x16d3('0x20')]({'raw':_0xd210f7['options']?_0xd210f7[_0x16d3('0x21')][_0x16d3('0x22')]===undefined?!![]:![]:!![],'where':_0xd210f7[_0x16d3('0x21')]?_0xd210f7[_0x16d3('0x21')]['where']||null:null,'attributes':[[db[_0x16d3('0x23')]['fn']('COUNT',db[_0x16d3('0x23')]['fn']('IF',db['sequelize'][_0x16d3('0x24')](_0x16d3('0x25')))),'outboundQueuePauses']]})[_0x16d3('0x12')](function(_0x5b3219){logger['info']('GetVoiceQueueRtPauses',_0xd210f7);logger['debug'](_0x16d3('0x1e'),_0xd210f7,JSON[_0x16d3('0x17')](_0x5b3219));_0x114c5f(_0x5b3219);})[_0x16d3('0x1d')](function(_0x511505){logger[_0x16d3('0x18')](_0x16d3('0x1e'),_0x511505[_0x16d3('0x1a')],_0xd210f7);_0xb804dd(_0x40980d['error'](0x1f4,_0x511505['message']));});});}; \ No newline at end of file +var _0x9eeb=['UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x9eeb,0x7c));var _0xb9ee=function(_0x5aa00e,_0x3d2e7f){_0x5aa00e=_0x5aa00e-0x0;var _0x966fa6=_0x9eeb[_0x5aa00e];return _0x966fa6;};'use strict';var _=require(_0xb9ee('0x0'));var util=require(_0xb9ee('0x1'));var moment=require(_0xb9ee('0x2'));var BPromise=require(_0xb9ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb9ee('0x4'));var db=require(_0xb9ee('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb9ee('0x6'));var config=require('../../config/environment');var jayson=require(_0xb9ee('0x7'));var client=jayson[_0xb9ee('0x8')][_0xb9ee('0x9')]({'port':0x232a});config[_0xb9ee('0xa')]=_[_0xb9ee('0xb')](config[_0xb9ee('0xa')],{'host':_0xb9ee('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0xb9ee('0xd')](socket);function respondWithRpcPromise(_0xa256a,_0x235941,_0x11108b){return new BPromise(function(_0x30d6e6,_0x4f3a69){return client[_0xb9ee('0xe')](_0xa256a,_0x11108b)[_0xb9ee('0xf')](function(_0x168b5c){logger['info'](_0xb9ee('0x10'),_0x235941,_0xb9ee('0x11'));logger[_0xb9ee('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x235941,'request\x20sent',JSON['stringify'](_0x168b5c));if(_0x168b5c[_0xb9ee('0x13')]){if(_0x168b5c[_0xb9ee('0x13')][_0xb9ee('0x14')]===0x1f4){logger[_0xb9ee('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x235941,_0x168b5c[_0xb9ee('0x13')][_0xb9ee('0x15')]);return _0x4f3a69(_0x168b5c[_0xb9ee('0x13')][_0xb9ee('0x15')]);}logger[_0xb9ee('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x235941,_0x168b5c[_0xb9ee('0x13')][_0xb9ee('0x15')]);return _0x30d6e6(_0x168b5c['error'][_0xb9ee('0x15')]);}else{logger[_0xb9ee('0x16')](_0xb9ee('0x10'),_0x235941,_0xb9ee('0x11'));_0x30d6e6(_0x168b5c[_0xb9ee('0x17')][_0xb9ee('0x15')]);}})['catch'](function(_0x3715de){logger['error'](_0xb9ee('0x10'),_0x235941,_0x3715de);_0x4f3a69(_0x3715de);});});}exports[_0xb9ee('0x18')]=function(_0x26e119){var _0x5968df=this;return new Promise(function(_0x5c3eb3,_0x2e9653){return db[_0xb9ee('0x19')]['findAll']({'raw':_0x26e119[_0xb9ee('0x1a')]?_0x26e119['options'][_0xb9ee('0x1b')]===undefined?!![]:![]:!![],'where':_0x26e119[_0xb9ee('0x1a')]?_0x26e119[_0xb9ee('0x1a')][_0xb9ee('0x1c')]||null:null,'attributes':[[db[_0xb9ee('0x1d')]['fn'](_0xb9ee('0x1e'),db[_0xb9ee('0x1d')]['fn']('IF',db[_0xb9ee('0x1d')][_0xb9ee('0x1f')](_0xb9ee('0x20')))),'outboundQueuePauses']]})[_0xb9ee('0xf')](function(_0x278340){logger[_0xb9ee('0x16')](_0xb9ee('0x18'),_0x26e119);logger[_0xb9ee('0x12')](_0xb9ee('0x18'),_0x26e119,JSON[_0xb9ee('0x21')](_0x278340));_0x5c3eb3(_0x278340);})[_0xb9ee('0x22')](function(_0x47068a){logger[_0xb9ee('0x13')]('GetVoiceQueueRtPauses',_0x47068a[_0xb9ee('0x15')],_0x26e119);_0x2e9653(_0x5968df['error'](0x1f4,_0x47068a[_0xb9ee('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 432cde7..5b3f8e4 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 _0xc051=['length','./userVoiceQueueRt.events','save','emit','removeListener','register'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0xc051,0xb5));var _0x1c05=function(_0x17d646,_0x1e94df){_0x17d646=_0x17d646-0x0;var _0x369353=_0xc051[_0x17d646];return _0x369353;};'use strict';var UserVoiceQueueRtEvents=require(_0x1c05('0x0'));var events=[_0x1c05('0x1'),'remove','update'];function createListener(_0x502bb6,_0x3d0368){return function(_0x151bdf){_0x3d0368[_0x1c05('0x2')](_0x502bb6,_0x151bdf);};}function removeListener(_0x5d181d,_0x352877){return function(){UserVoiceQueueRtEvents[_0x1c05('0x3')](_0x5d181d,_0x352877);};}exports[_0x1c05('0x4')]=function(_0x294fcb){for(var _0x14284f=0x0,_0x28a978=events[_0x1c05('0x5')];_0x14284f<_0x28a978;_0x14284f++){var _0x44d233=events[_0x14284f];var _0x87b897=createListener('userVoiceQueueRt:'+_0x44d233,_0x294fcb);UserVoiceQueueRtEvents['on'](_0x44d233,_0x87b897);}}; \ No newline at end of file +var _0x31af=['remove','emit','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x541de5,_0x19a192){var _0x578514=function(_0x249022){while(--_0x249022){_0x541de5['push'](_0x541de5['shift']());}};_0x578514(++_0x19a192);}(_0x31af,0xde));var _0xf31a=function(_0x3fe7a7,_0x11e498){_0x3fe7a7=_0x3fe7a7-0x0;var _0x2cec17=_0x31af[_0x3fe7a7];return _0x2cec17;};'use strict';var UserVoiceQueueRtEvents=require(_0xf31a('0x0'));var events=[_0xf31a('0x1'),_0xf31a('0x2'),'update'];function createListener(_0x5f5639,_0x4596f6){return function(_0x4a8ef1){_0x4596f6[_0xf31a('0x3')](_0x5f5639,_0x4a8ef1);};}function removeListener(_0x1853d7,_0x820362){return function(){UserVoiceQueueRtEvents[_0xf31a('0x4')](_0x1853d7,_0x820362);};}exports['register']=function(_0x8d7853){for(var _0x209fcc=0x0,_0x405926=events[_0xf31a('0x5')];_0x209fcc<_0x405926;_0x209fcc++){var _0x47b7a1=events[_0x209fcc];var _0x31f8e7=createListener(_0xf31a('0x6')+_0x47b7a1,_0x8d7853);UserVoiceQueueRtEvents['on'](_0x47b7a1,_0x31f8e7);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 6919323..04344c4 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xe4b358,_0x36c25c){var _0x394873=function(_0x37c696){while(--_0x37c696){_0xe4b358['push'](_0xe4b358['shift']());}};_0x394873(++_0x36c25c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0xcb91[_0x337748];return _0x3bb03f;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3d7a63,_0x41e59b){var _0x1b4435=function(_0xb6959b){while(--_0xb6959b){_0x3d7a63['push'](_0x3d7a63['shift']());}};_0x1b4435(++_0x41e59b);}(_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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index f5a2a0c..a846404 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 _0xa95a=['exports','sequelize'];(function(_0x4a5ba4,_0x1c18a7){var _0x2247e7=function(_0x4ddeeb){while(--_0x4ddeeb){_0x4a5ba4['push'](_0x4a5ba4['shift']());}};_0x2247e7(++_0x1c18a7);}(_0xa95a,0x191));var _0xaa95=function(_0x3722f9,_0x32d494){_0x3722f9=_0x3722f9-0x0;var _0x1d22a1=_0xa95a[_0x3722f9];return _0x1d22a1;};'use strict';var Sequelize=require(_0xaa95('0x0'));module[_0xaa95('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xed3e=['INTEGER','sequelize','exports'];(function(_0x46390e,_0x39d20f){var _0x4db91c=function(_0x2bd91e){while(--_0x2bd91e){_0x46390e['push'](_0x46390e['shift']());}};_0x4db91c(++_0x39d20f);}(_0xed3e,0xe8));var _0xeed3=function(_0x44d456,_0x10b1c9){_0x44d456=_0x44d456-0x0;var _0x5eca30=_0xed3e[_0x44d456];return _0x5eca30;};'use strict';var Sequelize=require(_0xeed3('0x0'));module[_0xeed3('0x1')]={'penalty':{'type':Sequelize[_0xeed3('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 064ab1e..5eab73a 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 _0x8a99=['rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x39092b,_0x39c819){var _0x5bd171=function(_0x5e165c){while(--_0x5e165c){_0x39092b['push'](_0x39092b['shift']());}};_0x5bd171(++_0x39c819);}(_0x8a99,0x7c));var _0x98a9=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x8a99[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0x98a9('0x0'));var util=require(_0x98a9('0x1'));var logger=require(_0x98a9('0x2'))(_0x98a9('0x3'));var moment=require(_0x98a9('0x4'));var BPromise=require('bluebird');var rp=require(_0x98a9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x98a9('0x6'));var config=require(_0x98a9('0x7'));var attributes=require(_0x98a9('0x8'));module[_0x98a9('0x9')]=function(_0x2f0465,_0xd708bd){return _0x2f0465[_0x98a9('0xa')](_0x98a9('0xb'),attributes,{'tableName':_0x98a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d20=['UserWhatsappQueue','util','../../config/logger','api','moment','path','../../config/environment','./userWhatsappQueue.attributes','exports','define'];(function(_0x30ff34,_0x391498){var _0x168e9b=function(_0x4dd145){while(--_0x4dd145){_0x30ff34['push'](_0x30ff34['shift']());}};_0x168e9b(++_0x391498);}(_0x4d20,0x155));var _0x04d2=function(_0x532b2c,_0x14e660){_0x532b2c=_0x532b2c-0x0;var _0x26f14=_0x4d20[_0x532b2c];return _0x26f14;};'use strict';var _=require('lodash');var util=require(_0x04d2('0x0'));var logger=require(_0x04d2('0x1'))(_0x04d2('0x2'));var moment=require(_0x04d2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x04d2('0x4'));var rimraf=require('rimraf');var config=require(_0x04d2('0x5'));var attributes=require(_0x04d2('0x6'));module[_0x04d2('0x7')]=function(_0x28e2c4,_0x17d011){return _0x28e2c4[_0x04d2('0x8')](_0x04d2('0x9'),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 a06fa36..22cd2d8 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 _0x4645=['UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x30a31e,_0x31f766){var _0x170879=function(_0x313ee7){while(--_0x313ee7){_0x30a31e['push'](_0x30a31e['shift']());}};_0x170879(++_0x31f766);}(_0x4645,0x1ea));var _0x5464=function(_0x11e368,_0x1320e8){_0x11e368=_0x11e368-0x0;var _0x294f52=_0x4645[_0x11e368];return _0x294f52;};'use strict';var _=require(_0x5464('0x0'));var util=require(_0x5464('0x1'));var moment=require(_0x5464('0x2'));var BPromise=require(_0x5464('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5464('0x4'))['db'];var utils=require(_0x5464('0x5'));var logger=require(_0x5464('0x6'))(_0x5464('0x7'));var config=require(_0x5464('0x8'));var jayson=require(_0x5464('0x9'));var client=jayson['client'][_0x5464('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b7645,_0x14870a,_0x5b0df5){return new BPromise(function(_0x463b3f,_0x4359cd){return client[_0x5464('0xb')](_0x5b7645,_0x5b0df5)[_0x5464('0xc')](function(_0x5c379a){logger[_0x5464('0xd')](_0x5464('0xe'),_0x14870a,_0x5464('0xf'));logger[_0x5464('0x10')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x14870a,_0x5464('0xf'),JSON[_0x5464('0x11')](_0x5c379a));if(_0x5c379a['error']){if(_0x5c379a[_0x5464('0x12')][_0x5464('0x13')]===0x1f4){logger[_0x5464('0x12')](_0x5464('0xe'),_0x14870a,_0x5c379a[_0x5464('0x12')][_0x5464('0x14')]);return _0x4359cd(_0x5c379a[_0x5464('0x12')][_0x5464('0x14')]);}logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x14870a,_0x5c379a['error'][_0x5464('0x14')]);return _0x463b3f(_0x5c379a[_0x5464('0x12')][_0x5464('0x14')]);}else{logger['info'](_0x5464('0xe'),_0x14870a,_0x5464('0xf'));_0x463b3f(_0x5c379a['result'][_0x5464('0x14')]);}})['catch'](function(_0x47da40){logger[_0x5464('0x12')](_0x5464('0xe'),_0x14870a,_0x47da40);_0x4359cd(_0x47da40);});});} \ No newline at end of file +var _0xe02f=['../../config/logger','rpc','jayson/promise','client','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x199930,_0x53443e){var _0x22005a=function(_0x4f6ecc){while(--_0x4f6ecc){_0x199930['push'](_0x199930['shift']());}};_0x22005a(++_0x53443e);}(_0xe02f,0x124));var _0xfe02=function(_0x2551dd,_0x5ba066){_0x2551dd=_0x2551dd-0x0;var _0x905704=_0xe02f[_0x2551dd];return _0x905704;};'use strict';var _=require(_0xfe02('0x0'));var util=require(_0xfe02('0x1'));var moment=require(_0xfe02('0x2'));var BPromise=require(_0xfe02('0x3'));var rs=require(_0xfe02('0x4'));var fs=require('fs');var Redis=require(_0xfe02('0x5'));var db=require(_0xfe02('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe02('0x7'))(_0xfe02('0x8'));var config=require('../../config/environment');var jayson=require(_0xfe02('0x9'));var client=jayson[_0xfe02('0xa')][_0xfe02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x222b95,_0xb4d74c,_0x5a8d48){return new BPromise(function(_0x32d624,_0x2f4d92){return client[_0xfe02('0xc')](_0x222b95,_0x5a8d48)[_0xfe02('0xd')](function(_0x15f427){logger['info'](_0xfe02('0xe'),_0xb4d74c,_0xfe02('0xf'));logger['debug'](_0xfe02('0x10'),_0xb4d74c,_0xfe02('0xf'),JSON[_0xfe02('0x11')](_0x15f427));if(_0x15f427[_0xfe02('0x12')]){if(_0x15f427[_0xfe02('0x12')][_0xfe02('0x13')]===0x1f4){logger[_0xfe02('0x12')](_0xfe02('0xe'),_0xb4d74c,_0x15f427[_0xfe02('0x12')][_0xfe02('0x14')]);return _0x2f4d92(_0x15f427[_0xfe02('0x12')][_0xfe02('0x14')]);}logger[_0xfe02('0x12')](_0xfe02('0xe'),_0xb4d74c,_0x15f427[_0xfe02('0x12')][_0xfe02('0x14')]);return _0x32d624(_0x15f427[_0xfe02('0x12')][_0xfe02('0x14')]);}else{logger[_0xfe02('0x15')](_0xfe02('0xe'),_0xb4d74c,'request\x20sent');_0x32d624(_0x15f427['result'][_0xfe02('0x14')]);}})[_0xfe02('0x16')](function(_0xf5d1e3){logger[_0xfe02('0x12')](_0xfe02('0xe'),_0xb4d74c,_0xf5d1e3);_0x2f4d92(_0xf5d1e3);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index d8ecc74..500208c 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 _0x956a=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','util','path','connect-timeout','express','Router'];(function(_0x48a108,_0x355314){var _0x44458d=function(_0x2e8cad){while(--_0x2e8cad){_0x48a108['push'](_0x48a108['shift']());}};_0x44458d(++_0x355314);}(_0x956a,0xb6));var _0xa956=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x956a[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0xa956('0x0'));var path=require(_0xa956('0x1'));var timeout=require(_0xa956('0x2'));var express=require(_0xa956('0x3'));var router=express[_0xa956('0x4')]();var fs_extra=require(_0xa956('0x5'));var auth=require(_0xa956('0x6'));var interaction=require(_0xa956('0x7'));var config=require('../../config/environment');var controller=require('./variable.controller');router[_0xa956('0x8')]('/',auth[_0xa956('0x9')](),controller[_0xa956('0xa')]);router['get'](_0xa956('0xb'),auth[_0xa956('0x9')](),controller[_0xa956('0xc')]);router[_0xa956('0xd')]('/',auth[_0xa956('0x9')](),controller[_0xa956('0xe')]);router[_0xa956('0xf')]('/:id',auth[_0xa956('0x9')](),controller[_0xa956('0x10')]);router['delete'](_0xa956('0xb'),auth[_0xa956('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3cd1=['/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated'];(function(_0x3340fa,_0x54eae8){var _0x309e22=function(_0x1095ff){while(--_0x1095ff){_0x3340fa['push'](_0x3340fa['shift']());}};_0x309e22(++_0x54eae8);}(_0x3cd1,0x112));var _0x13cd=function(_0x52f316,_0x53cbc2){_0x52f316=_0x52f316-0x0;var _0x344ac9=_0x3cd1[_0x52f316];return _0x344ac9;};'use strict';var multer=require('multer');var util=require(_0x13cd('0x0'));var path=require(_0x13cd('0x1'));var timeout=require(_0x13cd('0x2'));var express=require(_0x13cd('0x3'));var router=express[_0x13cd('0x4')]();var fs_extra=require(_0x13cd('0x5'));var auth=require(_0x13cd('0x6'));var interaction=require(_0x13cd('0x7'));var config=require('../../config/environment');var controller=require(_0x13cd('0x8'));router[_0x13cd('0x9')]('/',auth[_0x13cd('0xa')](),controller['index']);router['get'](_0x13cd('0xb'),auth[_0x13cd('0xa')](),controller[_0x13cd('0xc')]);router[_0x13cd('0xd')]('/',auth['isAuthenticated'](),controller[_0x13cd('0xe')]);router[_0x13cd('0xf')](_0x13cd('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x13cd('0x10')](_0x13cd('0xb'),auth[_0x13cd('0xa')](),controller[_0x13cd('0x11')]);module[_0x13cd('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 82f321b..0d9d3ad 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 _0x4c85=['sequelize','STRING','name'];(function(_0x23d5fe,_0x59c243){var _0x4524b2=function(_0x501392){while(--_0x501392){_0x23d5fe['push'](_0x23d5fe['shift']());}};_0x4524b2(++_0x59c243);}(_0x4c85,0xa5));var _0x54c8=function(_0x46cec7,_0x4ec5e0){_0x46cec7=_0x46cec7-0x0;var _0x332904=_0x4c85[_0x46cec7];return _0x332904;};'use strict';var Sequelize=require(_0x54c8('0x0'));module['exports']={'name':{'type':Sequelize[_0x54c8('0x1')],'unique':_0x54c8('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x54c8('0x1')]}}; \ No newline at end of file +var _0xa4d8=['sequelize','exports','STRING','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa4d8,0x1dc));var _0x8a4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa4d8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8a4d('0x0'));module[_0x8a4d('0x1')]={'name':{'type':Sequelize[_0x8a4d('0x2')],'unique':_0x8a4d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8a4d('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 942006b..324b871 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 _0x5489=['show','length','includeAll','find','create','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','Variables','UserProfileResource','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch'];(function(_0x4cf447,_0x536a74){var _0x4bd4fd=function(_0x54a5c5){while(--_0x54a5c5){_0x4cf447['push'](_0x4cf447['shift']());}};_0x4bd4fd(++_0x536a74);}(_0x5489,0x1ed));var _0x9548=function(_0x4323fd,_0xd5f17c){_0x4323fd=_0x4323fd-0x0;var _0x2f20d8=_0x5489[_0x4323fd];return _0x2f20d8;};'use strict';var emlformat=require(_0x9548('0x0'));var rimraf=require(_0x9548('0x1'));var zipdir=require(_0x9548('0x2'));var jsonpatch=require(_0x9548('0x3'));var rp=require(_0x9548('0x4'));var moment=require(_0x9548('0x5'));var BPromise=require(_0x9548('0x6'));var Mustache=require(_0x9548('0x7'));var util=require(_0x9548('0x8'));var path=require(_0x9548('0x9'));var sox=require(_0x9548('0xa'));var csv=require(_0x9548('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9548('0xc'));var _=require(_0x9548('0xd'));var squel=require(_0x9548('0xe'));var crypto=require('crypto');var jsforce=require(_0x9548('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9548('0xb'));var querystring=require(_0x9548('0x10'));var Papa=require(_0x9548('0x11'));var Redis=require(_0x9548('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9548('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9548('0x14'));var logger=require(_0x9548('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9548('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x582ccb,_0xf4338d){_0xf4338d=_0xf4338d||0xcc;return function(_0x155742){if(_0x155742){return _0x582ccb[_0x9548('0x17')](_0xf4338d);}return _0x582ccb[_0x9548('0x18')](_0xf4338d)[_0x9548('0x19')]();};}function respondWithResult(_0x1ec2db,_0x5d3903){_0x5d3903=_0x5d3903||0xc8;return function(_0x4ee012){if(_0x4ee012){return _0x1ec2db['status'](_0x5d3903)[_0x9548('0x1a')](_0x4ee012);}};}function respondWithFilteredResult(_0xc5b51f,_0x205e05){return function(_0x1e9ac3){if(_0x1e9ac3){var _0x11e7aa=typeof _0x205e05['offset']===_0x9548('0x1b')&&typeof _0x205e05[_0x9548('0x1c')]===_0x9548('0x1b');var _0x596482=_0x1e9ac3[_0x9548('0x1d')];var _0x4f653e=_0x11e7aa?0x0:_0x205e05[_0x9548('0x1e')];var _0x3f6402=_0x11e7aa?_0x1e9ac3[_0x9548('0x1d')]:_0x205e05['offset']+_0x205e05[_0x9548('0x1c')];var _0x2c735c;if(_0x3f6402>=_0x596482){_0x3f6402=_0x596482;_0x2c735c=0xc8;}else{_0x2c735c=0xce;}_0xc5b51f['status'](_0x2c735c);return _0xc5b51f['set']('Content-Range',_0x4f653e+'-'+_0x3f6402+'/'+_0x596482)[_0x9548('0x1a')](_0x1e9ac3);}return null;};}function patchUpdates(_0x5b0c87){return function(_0x131088){try{jsonpatch[_0x9548('0x1f')](_0x131088,_0x5b0c87,!![]);}catch(_0x1e7829){return BPromise[_0x9548('0x20')](_0x1e7829);}return _0x131088[_0x9548('0x21')]();};}function saveUpdates(_0x20a909,_0x63d800){return function(_0x55e6cc){if(_0x55e6cc){return _0x55e6cc[_0x9548('0x22')](_0x20a909)[_0x9548('0x23')](function(_0x633162){return _0x633162;});}return null;};}function removeEntity(_0x19c11b,_0x287afc){return function(_0x31307c){if(_0x31307c){return _0x31307c[_0x9548('0x24')]()[_0x9548('0x23')](function(){var _0x17c772=_0x31307c['get']({'plain':!![]});var _0x1c8c4a=_0x9548('0x25');return db[_0x9548('0x26')][_0x9548('0x24')]({'where':{'type':_0x1c8c4a,'resourceId':_0x17c772['id']}})[_0x9548('0x23')](function(){return _0x31307c;});})['then'](function(){_0x19c11b[_0x9548('0x18')](0xcc)[_0x9548('0x19')]();});}};}function handleEntityNotFound(_0x359e20,_0x4983a3){return function(_0x4ac818){if(!_0x4ac818){_0x359e20[_0x9548('0x17')](0x194);}return _0x4ac818;};}function handleError(_0x57cd28,_0x11b81c){_0x11b81c=_0x11b81c||0x1f4;return function(_0x2028a6){logger[_0x9548('0x27')](_0x2028a6[_0x9548('0x28')]);if(_0x2028a6[_0x9548('0x29')]){delete _0x2028a6[_0x9548('0x29')];}_0x57cd28[_0x9548('0x18')](_0x11b81c)[_0x9548('0x2a')](_0x2028a6);};}exports[_0x9548('0x2b')]=function(_0x3536c3,_0x1a741c){var _0x2090c8={},_0x15e5c7={},_0x14a2fa={'count':0x0,'rows':[]};var _0x2a6457=_[_0x9548('0x2c')](db[_0x9548('0x2d')][_0x9548('0x2e')],function(_0x3d2168){return{'name':_0x3d2168[_0x9548('0x2f')],'type':_0x3d2168[_0x9548('0x30')]['key']};});_0x15e5c7[_0x9548('0x31')]=_[_0x9548('0x2c')](_0x2a6457,_0x9548('0x29'));_0x15e5c7[_0x9548('0x32')]=_[_0x9548('0x33')](_0x3536c3[_0x9548('0x32')]);_0x15e5c7[_0x9548('0x34')]=_[_0x9548('0x35')](_0x15e5c7['model'],_0x15e5c7[_0x9548('0x32')]);_0x2090c8[_0x9548('0x36')]=_['intersection'](_0x15e5c7[_0x9548('0x31')],qs[_0x9548('0x37')](_0x3536c3[_0x9548('0x32')][_0x9548('0x37')]));_0x2090c8[_0x9548('0x36')]=_0x2090c8['attributes']['length']?_0x2090c8[_0x9548('0x36')]:_0x15e5c7[_0x9548('0x31')];if(!_0x3536c3['query'][_0x9548('0x38')]('nolimit')){_0x2090c8[_0x9548('0x1c')]=qs[_0x9548('0x1c')](_0x3536c3[_0x9548('0x32')][_0x9548('0x1c')]);_0x2090c8[_0x9548('0x1e')]=qs[_0x9548('0x1e')](_0x3536c3[_0x9548('0x32')][_0x9548('0x1e')]);}_0x2090c8['order']=qs['sort'](_0x3536c3[_0x9548('0x32')]['sort']);_0x2090c8[_0x9548('0x39')]=qs[_0x9548('0x34')](_[_0x9548('0x3a')](_0x3536c3['query'],_0x15e5c7[_0x9548('0x34')]),_0x2a6457);if(_0x3536c3['query'][_0x9548('0x3b')]){_0x2090c8[_0x9548('0x39')]=_[_0x9548('0x3c')](_0x2090c8[_0x9548('0x39')],{'$or':_[_0x9548('0x2c')](_0x2a6457,function(_0x160cbb){if(_0x160cbb[_0x9548('0x30')]!==_0x9548('0x3d')){var _0xf4e04d={};_0xf4e04d[_0x160cbb[_0x9548('0x29')]]={'$like':'%'+_0x3536c3[_0x9548('0x32')][_0x9548('0x3b')]+'%'};return _0xf4e04d;}})});}_0x2090c8=_[_0x9548('0x3c')]({},_0x2090c8,_0x3536c3[_0x9548('0x3e')]);var _0xab061c={'where':_0x2090c8[_0x9548('0x39')]};return db[_0x9548('0x2d')][_0x9548('0x1d')](_0xab061c)[_0x9548('0x23')](function(_0x4d4751){_0x14a2fa[_0x9548('0x1d')]=_0x4d4751;if(_0x3536c3[_0x9548('0x32')]['includeAll']){_0x2090c8[_0x9548('0x3f')]=[{'all':!![]}];}return db[_0x9548('0x2d')][_0x9548('0x40')](_0x2090c8);})[_0x9548('0x23')](function(_0x11cec9){_0x14a2fa[_0x9548('0x41')]=_0x11cec9;return _0x14a2fa;})['then'](respondWithFilteredResult(_0x1a741c,_0x2090c8))[_0x9548('0x42')](handleError(_0x1a741c,null));};exports[_0x9548('0x43')]=function(_0x4aeb0c,_0x3ad880){var _0x1b538d={'raw':!![],'where':{'id':_0x4aeb0c['params']['id']}},_0x143d47={};_0x143d47[_0x9548('0x31')]=_[_0x9548('0x33')](db[_0x9548('0x2d')][_0x9548('0x2e')]);_0x143d47[_0x9548('0x32')]=_['keys'](_0x4aeb0c[_0x9548('0x32')]);_0x143d47[_0x9548('0x34')]=_['intersection'](_0x143d47[_0x9548('0x31')],_0x143d47[_0x9548('0x32')]);_0x1b538d[_0x9548('0x36')]=_[_0x9548('0x35')](_0x143d47[_0x9548('0x31')],qs[_0x9548('0x37')](_0x4aeb0c[_0x9548('0x32')][_0x9548('0x37')]));_0x1b538d['attributes']=_0x1b538d[_0x9548('0x36')][_0x9548('0x44')]?_0x1b538d[_0x9548('0x36')]:_0x143d47[_0x9548('0x31')];if(_0x4aeb0c[_0x9548('0x32')][_0x9548('0x45')]){_0x1b538d[_0x9548('0x3f')]=[{'all':!![]}];}_0x1b538d=_[_0x9548('0x3c')]({},_0x1b538d,_0x4aeb0c['options']);return db['Variable'][_0x9548('0x46')](_0x1b538d)[_0x9548('0x23')](handleEntityNotFound(_0x3ad880,null))[_0x9548('0x23')](respondWithResult(_0x3ad880,null))[_0x9548('0x42')](handleError(_0x3ad880,null));};exports[_0x9548('0x47')]=function(_0xbe0a91,_0x573cbc){return db[_0x9548('0x2d')][_0x9548('0x47')](_0xbe0a91['body'],{})[_0x9548('0x23')](function(_0x248c3a){var _0x2ab869=_0xbe0a91[_0x9548('0x48')][_0x9548('0x49')]({'plain':!![]});if(!_0x2ab869)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ab869[_0x9548('0x4a')]===_0x9548('0x48')){var _0x54109a=_0x248c3a['get']({'plain':!![]});var _0x4469c1=_0x9548('0x25');return db[_0x9548('0x4b')][_0x9548('0x46')]({'where':{'name':_0x4469c1,'userProfileId':_0x2ab869[_0x9548('0x4c')]},'raw':!![]})['then'](function(_0x958e98){if(_0x958e98&&_0x958e98['autoAssociation']===0x0){return db[_0x9548('0x26')][_0x9548('0x47')]({'name':_0x54109a[_0x9548('0x29')],'resourceId':_0x54109a['id'],'type':_0x958e98[_0x9548('0x29')],'sectionId':_0x958e98['id']},{})[_0x9548('0x23')](function(){return _0x248c3a;});}else{return _0x248c3a;}})[_0x9548('0x42')](function(_0x3fd4cd){logger[_0x9548('0x27')](_0x9548('0x4d'),_0x3fd4cd);throw _0x3fd4cd;});}return _0x248c3a;})[_0x9548('0x23')](respondWithResult(_0x573cbc,0xc9))[_0x9548('0x42')](handleError(_0x573cbc,null));};exports[_0x9548('0x22')]=function(_0x3412fb,_0x3fb1d8){if(_0x3412fb[_0x9548('0x4e')]['id']){delete _0x3412fb['body']['id'];}return db['Variable']['find']({'where':{'id':_0x3412fb[_0x9548('0x4f')]['id']}})[_0x9548('0x23')](handleEntityNotFound(_0x3fb1d8,null))[_0x9548('0x23')](saveUpdates(_0x3412fb[_0x9548('0x4e')],null))[_0x9548('0x23')](respondWithResult(_0x3fb1d8,null))[_0x9548('0x42')](handleError(_0x3fb1d8,null));};exports['destroy']=function(_0x1791e8,_0x1376f4){return db[_0x9548('0x2d')][_0x9548('0x46')]({'where':{'id':_0x1791e8[_0x9548('0x4f')]['id']}})[_0x9548('0x23')](handleEntityNotFound(_0x1376f4,null))[_0x9548('0x23')](removeEntity(_0x1376f4,null))[_0x9548('0x42')](handleError(_0x1376f4,null));}; \ No newline at end of file +var _0xf747=['hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','get','Variables','UserProfileResource','sendStatus','error','name','send','map','Variable','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x1895b7,_0x21fbc7){var _0x1aecdc=function(_0x44682a){while(--_0x44682a){_0x1895b7['push'](_0x1895b7['shift']());}};_0x1aecdc(++_0x21fbc7);}(_0xf747,0x110));var _0x7f74=function(_0x81e87b,_0x30c25a){_0x81e87b=_0x81e87b-0x0;var _0xc7ae21=_0xf747[_0x81e87b];return _0xc7ae21;};'use strict';var emlformat=require(_0x7f74('0x0'));var rimraf=require(_0x7f74('0x1'));var zipdir=require(_0x7f74('0x2'));var jsonpatch=require(_0x7f74('0x3'));var rp=require(_0x7f74('0x4'));var moment=require(_0x7f74('0x5'));var BPromise=require(_0x7f74('0x6'));var Mustache=require('mustache');var util=require(_0x7f74('0x7'));var path=require(_0x7f74('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7f74('0x9'));var fs=require('fs');var fs_extra=require(_0x7f74('0xa'));var _=require('lodash');var squel=require(_0x7f74('0xb'));var crypto=require(_0x7f74('0xc'));var jsforce=require(_0x7f74('0xd'));var deskjs=require(_0x7f74('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7f74('0xf'));var Papa=require(_0x7f74('0x10'));var Redis=require(_0x7f74('0x11'));var authService=require(_0x7f74('0x12'));var qs=require(_0x7f74('0x13'));var as=require(_0x7f74('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f74('0x15'))(_0x7f74('0x16'));var utils=require(_0x7f74('0x17'));var config=require(_0x7f74('0x18'));var licenseUtil=require(_0x7f74('0x19'));var db=require(_0x7f74('0x1a'))['db'];function respondWithStatusCode(_0x3fe842,_0xe1f229){_0xe1f229=_0xe1f229||0xcc;return function(_0x8323af){if(_0x8323af){return _0x3fe842['sendStatus'](_0xe1f229);}return _0x3fe842[_0x7f74('0x1b')](_0xe1f229)[_0x7f74('0x1c')]();};}function respondWithResult(_0x410df8,_0x287a93){_0x287a93=_0x287a93||0xc8;return function(_0x49b56d){if(_0x49b56d){return _0x410df8[_0x7f74('0x1b')](_0x287a93)[_0x7f74('0x1d')](_0x49b56d);}};}function respondWithFilteredResult(_0x31a3da,_0x212d96){return function(_0x41c292){if(_0x41c292){var _0x47e3f9=typeof _0x212d96[_0x7f74('0x1e')]===_0x7f74('0x1f')&&typeof _0x212d96[_0x7f74('0x20')]==='undefined';var _0x3c317b=_0x41c292['count'];var _0x264097=_0x47e3f9?0x0:_0x212d96['offset'];var _0x460ba3=_0x47e3f9?_0x41c292[_0x7f74('0x21')]:_0x212d96[_0x7f74('0x1e')]+_0x212d96[_0x7f74('0x20')];var _0x203c90;if(_0x460ba3>=_0x3c317b){_0x460ba3=_0x3c317b;_0x203c90=0xc8;}else{_0x203c90=0xce;}_0x31a3da['status'](_0x203c90);return _0x31a3da[_0x7f74('0x22')]('Content-Range',_0x264097+'-'+_0x460ba3+'/'+_0x3c317b)['json'](_0x41c292);}return null;};}function patchUpdates(_0x2bb02c){return function(_0x4cde7a){try{jsonpatch[_0x7f74('0x23')](_0x4cde7a,_0x2bb02c,!![]);}catch(_0x5edeed){return BPromise[_0x7f74('0x24')](_0x5edeed);}return _0x4cde7a['save']();};}function saveUpdates(_0x300cc8,_0x487908){return function(_0x34827a){if(_0x34827a){return _0x34827a[_0x7f74('0x25')](_0x300cc8)['then'](function(_0x164ac2){return _0x164ac2;});}return null;};}function removeEntity(_0x2a12c6,_0x7d4552){return function(_0x3a705e){if(_0x3a705e){return _0x3a705e[_0x7f74('0x26')]()[_0x7f74('0x27')](function(){var _0x46bef8=_0x3a705e[_0x7f74('0x28')]({'plain':!![]});var _0x27ae32=_0x7f74('0x29');return db[_0x7f74('0x2a')][_0x7f74('0x26')]({'where':{'type':_0x27ae32,'resourceId':_0x46bef8['id']}})[_0x7f74('0x27')](function(){return _0x3a705e;});})[_0x7f74('0x27')](function(){_0x2a12c6[_0x7f74('0x1b')](0xcc)[_0x7f74('0x1c')]();});}};}function handleEntityNotFound(_0x18dc24,_0x1c6d34){return function(_0x77f3c9){if(!_0x77f3c9){_0x18dc24[_0x7f74('0x2b')](0x194);}return _0x77f3c9;};}function handleError(_0x5c6589,_0x8d4592){_0x8d4592=_0x8d4592||0x1f4;return function(_0x302207){logger[_0x7f74('0x2c')](_0x302207['stack']);if(_0x302207[_0x7f74('0x2d')]){delete _0x302207[_0x7f74('0x2d')];}_0x5c6589[_0x7f74('0x1b')](_0x8d4592)[_0x7f74('0x2e')](_0x302207);};}exports['index']=function(_0x3af095,_0x1d5fec){var _0x2514d5={},_0x6d6434={},_0x52ffac={'count':0x0,'rows':[]};var _0x2529bd=_[_0x7f74('0x2f')](db[_0x7f74('0x30')][_0x7f74('0x31')],function(_0x433feb){return{'name':_0x433feb[_0x7f74('0x32')],'type':_0x433feb[_0x7f74('0x33')]['key']};});_0x6d6434[_0x7f74('0x34')]=_[_0x7f74('0x2f')](_0x2529bd,_0x7f74('0x2d'));_0x6d6434[_0x7f74('0x35')]=_[_0x7f74('0x36')](_0x3af095[_0x7f74('0x35')]);_0x6d6434[_0x7f74('0x37')]=_[_0x7f74('0x38')](_0x6d6434[_0x7f74('0x34')],_0x6d6434[_0x7f74('0x35')]);_0x2514d5[_0x7f74('0x39')]=_['intersection'](_0x6d6434['model'],qs[_0x7f74('0x3a')](_0x3af095['query'][_0x7f74('0x3a')]));_0x2514d5[_0x7f74('0x39')]=_0x2514d5[_0x7f74('0x39')][_0x7f74('0x3b')]?_0x2514d5['attributes']:_0x6d6434[_0x7f74('0x34')];if(!_0x3af095[_0x7f74('0x35')][_0x7f74('0x3c')](_0x7f74('0x3d'))){_0x2514d5['limit']=qs['limit'](_0x3af095[_0x7f74('0x35')][_0x7f74('0x20')]);_0x2514d5[_0x7f74('0x1e')]=qs[_0x7f74('0x1e')](_0x3af095[_0x7f74('0x35')]['offset']);}_0x2514d5['order']=qs[_0x7f74('0x3e')](_0x3af095[_0x7f74('0x35')][_0x7f74('0x3e')]);_0x2514d5[_0x7f74('0x3f')]=qs['filters'](_[_0x7f74('0x40')](_0x3af095[_0x7f74('0x35')],_0x6d6434['filters']),_0x2529bd);if(_0x3af095[_0x7f74('0x35')][_0x7f74('0x41')]){_0x2514d5['where']=_['merge'](_0x2514d5[_0x7f74('0x3f')],{'$or':_[_0x7f74('0x2f')](_0x2529bd,function(_0xfc5c02){if(_0xfc5c02[_0x7f74('0x33')]!==_0x7f74('0x42')){var _0x5db092={};_0x5db092[_0xfc5c02[_0x7f74('0x2d')]]={'$like':'%'+_0x3af095[_0x7f74('0x35')][_0x7f74('0x41')]+'%'};return _0x5db092;}})});}_0x2514d5=_[_0x7f74('0x43')]({},_0x2514d5,_0x3af095[_0x7f74('0x44')]);var _0x5b5841={'where':_0x2514d5[_0x7f74('0x3f')]};return db[_0x7f74('0x30')][_0x7f74('0x21')](_0x5b5841)['then'](function(_0x5d16df){_0x52ffac[_0x7f74('0x21')]=_0x5d16df;if(_0x3af095['query'][_0x7f74('0x45')]){_0x2514d5['include']=[{'all':!![]}];}return db[_0x7f74('0x30')][_0x7f74('0x46')](_0x2514d5);})['then'](function(_0x5d93be){_0x52ffac['rows']=_0x5d93be;return _0x52ffac;})['then'](respondWithFilteredResult(_0x1d5fec,_0x2514d5))[_0x7f74('0x47')](handleError(_0x1d5fec,null));};exports[_0x7f74('0x48')]=function(_0x173aec,_0x168535){var _0x55f97b={'raw':!![],'where':{'id':_0x173aec[_0x7f74('0x49')]['id']}},_0x564d9e={};_0x564d9e['model']=_[_0x7f74('0x36')](db[_0x7f74('0x30')][_0x7f74('0x31')]);_0x564d9e[_0x7f74('0x35')]=_[_0x7f74('0x36')](_0x173aec[_0x7f74('0x35')]);_0x564d9e[_0x7f74('0x37')]=_[_0x7f74('0x38')](_0x564d9e[_0x7f74('0x34')],_0x564d9e[_0x7f74('0x35')]);_0x55f97b[_0x7f74('0x39')]=_[_0x7f74('0x38')](_0x564d9e[_0x7f74('0x34')],qs['fields'](_0x173aec[_0x7f74('0x35')]['fields']));_0x55f97b['attributes']=_0x55f97b[_0x7f74('0x39')][_0x7f74('0x3b')]?_0x55f97b[_0x7f74('0x39')]:_0x564d9e[_0x7f74('0x34')];if(_0x173aec[_0x7f74('0x35')]['includeAll']){_0x55f97b['include']=[{'all':!![]}];}_0x55f97b=_['merge']({},_0x55f97b,_0x173aec[_0x7f74('0x44')]);return db[_0x7f74('0x30')][_0x7f74('0x4a')](_0x55f97b)[_0x7f74('0x27')](handleEntityNotFound(_0x168535,null))['then'](respondWithResult(_0x168535,null))[_0x7f74('0x47')](handleError(_0x168535,null));};exports['create']=function(_0x5d8cf,_0x568544){return db[_0x7f74('0x30')][_0x7f74('0x4b')](_0x5d8cf[_0x7f74('0x4c')],{})['then'](function(_0x4c4303){var _0x2a1eb8=_0x5d8cf[_0x7f74('0x4d')][_0x7f74('0x28')]({'plain':!![]});if(!_0x2a1eb8)throw new Error(_0x7f74('0x4e'));if(_0x2a1eb8[_0x7f74('0x4f')]===_0x7f74('0x4d')){var _0x4a8bdd=_0x4c4303[_0x7f74('0x28')]({'plain':!![]});var _0x390b06=_0x7f74('0x29');return db['UserProfileSection'][_0x7f74('0x4a')]({'where':{'name':_0x390b06,'userProfileId':_0x2a1eb8[_0x7f74('0x50')]},'raw':!![]})['then'](function(_0x3595c5){if(_0x3595c5&&_0x3595c5[_0x7f74('0x51')]===0x0){return db['UserProfileResource'][_0x7f74('0x4b')]({'name':_0x4a8bdd[_0x7f74('0x2d')],'resourceId':_0x4a8bdd['id'],'type':_0x3595c5[_0x7f74('0x2d')],'sectionId':_0x3595c5['id']},{})[_0x7f74('0x27')](function(){return _0x4c4303;});}else{return _0x4c4303;}})[_0x7f74('0x47')](function(_0x387071){logger['error'](_0x7f74('0x52'),_0x387071);throw _0x387071;});}return _0x4c4303;})[_0x7f74('0x27')](respondWithResult(_0x568544,0xc9))['catch'](handleError(_0x568544,null));};exports[_0x7f74('0x25')]=function(_0x4de313,_0xc7ca8c){if(_0x4de313[_0x7f74('0x4c')]['id']){delete _0x4de313['body']['id'];}return db['Variable'][_0x7f74('0x4a')]({'where':{'id':_0x4de313[_0x7f74('0x49')]['id']}})[_0x7f74('0x27')](handleEntityNotFound(_0xc7ca8c,null))[_0x7f74('0x27')](saveUpdates(_0x4de313[_0x7f74('0x4c')],null))['then'](respondWithResult(_0xc7ca8c,null))[_0x7f74('0x47')](handleError(_0xc7ca8c,null));};exports['destroy']=function(_0x4fc7f2,_0x3f67db){return db[_0x7f74('0x30')][_0x7f74('0x4a')]({'where':{'id':_0x4fc7f2[_0x7f74('0x49')]['id']}})[_0x7f74('0x27')](handleEntityNotFound(_0x3f67db,null))[_0x7f74('0x27')](removeEntity(_0x3f67db,null))[_0x7f74('0x47')](handleError(_0x3f67db,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index bb5b02a..2b28d98 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 _0x9abd=['../../config/logger','api','moment','request-promise','path','./variable.attributes','exports','define','Variable','tools_variables','lodash','util'];(function(_0x4d53f9,_0x570532){var _0x5dd4eb=function(_0x579454){while(--_0x579454){_0x4d53f9['push'](_0x4d53f9['shift']());}};_0x5dd4eb(++_0x570532);}(_0x9abd,0x196));var _0xd9ab=function(_0x834fec,_0x4f452){_0x834fec=_0x834fec-0x0;var _0x3822bc=_0x9abd[_0x834fec];return _0x3822bc;};'use strict';var _=require(_0xd9ab('0x0'));var util=require(_0xd9ab('0x1'));var logger=require(_0xd9ab('0x2'))(_0xd9ab('0x3'));var moment=require(_0xd9ab('0x4'));var BPromise=require('bluebird');var rp=require(_0xd9ab('0x5'));var fs=require('fs');var path=require(_0xd9ab('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd9ab('0x7'));module[_0xd9ab('0x8')]=function(_0x437ed8,_0x13cbff){return _0x437ed8[_0xd9ab('0x9')](_0xd9ab('0xa'),attributes,{'tableName':_0xd9ab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2696=['bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','tools_variables','lodash','util','../../config/logger','api','moment'];(function(_0x28baa4,_0x475c23){var _0x284511=function(_0xfc5f53){while(--_0xfc5f53){_0x28baa4['push'](_0x28baa4['shift']());}};_0x284511(++_0x475c23);}(_0x2696,0x18e));var _0x6269=function(_0x4b9dac,_0x13dfb2){_0x4b9dac=_0x4b9dac-0x0;var _0x1243f6=_0x2696[_0x4b9dac];return _0x1243f6;};'use strict';var _=require(_0x6269('0x0'));var util=require(_0x6269('0x1'));var logger=require(_0x6269('0x2'))(_0x6269('0x3'));var moment=require(_0x6269('0x4'));var BPromise=require(_0x6269('0x5'));var rp=require(_0x6269('0x6'));var fs=require('fs');var path=require(_0x6269('0x7'));var rimraf=require(_0x6269('0x8'));var config=require(_0x6269('0x9'));var attributes=require(_0x6269('0xa'));module[_0x6269('0xb')]=function(_0x357484,_0xb0e388){return _0x357484['define']('Variable',attributes,{'tableName':_0x6269('0xc'),'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 e19e588..1bc909f 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 _0x7fbe=['stringify','error','code','message','result','catch','Variable','find','options','where','attributes','include','map','model','info','ShowVariable','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../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'];(function(_0x288f50,_0x402312){var _0x1944a4=function(_0x50ed11){while(--_0x50ed11){_0x288f50['push'](_0x288f50['shift']());}};_0x1944a4(++_0x402312);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x32ad69,_0x518f0c){_0x32ad69=_0x32ad69-0x0;var _0x1062ef=_0x7fbe[_0x32ad69];return _0x1062ef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}exports['ShowVariable']=function(_0x293a47){var _0x546463=this;return new Promise(function(_0x1e77fd,_0x4708f7){return db[_0xe7fb('0x18')][_0xe7fb('0x19')]({'raw':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x293a47[_0xe7fb('0x1a')]?_0x293a47['options'][_0xe7fb('0x1b')]||null:null,'attributes':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1c')]||null:null,'include':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1d')]?_[_0xe7fb('0x1e')](_0x293a47['options'][_0xe7fb('0x1d')],function(_0x469ead){return{'model':db[_0x469ead['model']],'as':_0x469ead['as'],'attributes':_0x469ead['attributes'],'include':_0x469ead['include']?_[_0xe7fb('0x1e')](_0x469ead['include'],function(_0x49b219){return{'model':db[_0x49b219[_0xe7fb('0x1f')]],'as':_0x49b219['as'],'attributes':_0x49b219[_0xe7fb('0x1c')],'include':_0x49b219[_0xe7fb('0x1d')]?_['map'](_0x49b219[_0xe7fb('0x1d')],function(_0x2b69c4){return{'model':db[_0x2b69c4[_0xe7fb('0x1f')]],'as':_0x2b69c4['as'],'attributes':_0x2b69c4[_0xe7fb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe7fb('0xd')](function(_0x16237a){logger[_0xe7fb('0x20')]('ShowVariable',_0x293a47);logger['debug'](_0xe7fb('0x21'),_0x293a47,JSON[_0xe7fb('0x12')](_0x16237a));_0x1e77fd(_0x16237a);})[_0xe7fb('0x17')](function(_0x4fd290){logger[_0xe7fb('0x13')](_0xe7fb('0x21'),_0x4fd290[_0xe7fb('0x15')],_0x293a47);_0x4708f7(_0x546463[_0xe7fb('0x13')](0x1f4,_0x4fd290[_0xe7fb('0x15')]));});});}; \ No newline at end of file +var _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x19cbac,_0x4a7597){var _0x180da3=function(_0x219c1a){while(--_0x219c1a){_0x19cbac['push'](_0x19cbac['shift']());}};_0x180da3(++_0x4a7597);}(_0x8ef6,0xf2));var _0x68ef=function(_0x159c26,_0x185fee){_0x159c26=_0x159c26-0x0;var _0x39744f=_0x8ef6[_0x159c26];return _0x39744f;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 5d2f6a1..a8949c4 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 _0x7ece=['migrations','exports','Router','./version.controller','get','index','isAuthenticated','/reset','canUpdate','reset','/pull','pull','/restart','restart','/migrations'];(function(_0xd8aad0,_0x4da2cd){var _0x570860=function(_0x1acc03){while(--_0x1acc03){_0xd8aad0['push'](_0xd8aad0['shift']());}};_0x570860(++_0x4da2cd);}(_0x7ece,0xb6));var _0xe7ec=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x7ece[_0x5f1391];return _0x50ebe3;};'use strict';var express=require('express');var router=express[_0xe7ec('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xe7ec('0x1'));router[_0xe7ec('0x2')]('/',controller[_0xe7ec('0x3')]);router[_0xe7ec('0x2')]('/fetch',auth[_0xe7ec('0x4')](),auth['canUpdate'](),controller['fetch']);router[_0xe7ec('0x2')](_0xe7ec('0x5'),auth['isAuthenticated'](),auth[_0xe7ec('0x6')](),controller[_0xe7ec('0x7')]);router[_0xe7ec('0x2')](_0xe7ec('0x8'),auth[_0xe7ec('0x4')](),auth['canUpdate'](),controller[_0xe7ec('0x9')]);router['get'](_0xe7ec('0xa'),auth[_0xe7ec('0x4')](),controller[_0xe7ec('0xb')]);router['get'](_0xe7ec('0xc'),controller[_0xe7ec('0xd')]);module[_0xe7ec('0xe')]=router; \ No newline at end of file +var _0x2c01=['express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/reset','reset','pull','restart','/migrations','migrations'];(function(_0x103ac4,_0x137d0c){var _0x39d4c0=function(_0x40d749){while(--_0x40d749){_0x103ac4['push'](_0x103ac4['shift']());}};_0x39d4c0(++_0x137d0c);}(_0x2c01,0x168));var _0x12c0=function(_0x1e3fdf,_0x87b0ce){_0x1e3fdf=_0x1e3fdf-0x0;var _0x340b71=_0x2c01[_0x1e3fdf];return _0x340b71;};'use strict';var express=require(_0x12c0('0x0'));var router=express[_0x12c0('0x1')]();var auth=require(_0x12c0('0x2'));var controller=require(_0x12c0('0x3'));router[_0x12c0('0x4')]('/',controller[_0x12c0('0x5')]);router[_0x12c0('0x4')](_0x12c0('0x6'),auth[_0x12c0('0x7')](),auth[_0x12c0('0x8')](),controller['fetch']);router['get'](_0x12c0('0x9'),auth[_0x12c0('0x7')](),auth[_0x12c0('0x8')](),controller[_0x12c0('0xa')]);router[_0x12c0('0x4')]('/pull',auth[_0x12c0('0x7')](),auth[_0x12c0('0x8')](),controller[_0x12c0('0xb')]);router[_0x12c0('0x4')]('/restart',auth[_0x12c0('0x7')](),controller[_0x12c0('0xc')]);router[_0x12c0('0x4')](_0x12c0('0xd'),controller[_0x12c0('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 3fc29d9..85319ae 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 _0xf13e=['pkginfo','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','version','query','latest','fetch','tags','exports','2.0.0','json','status','master','info','reset','--hard','FETCH_HEAD','error','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','catch','migrations','join','length','.js','push','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf13e,0xb9));var _0xef13=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0xf13e[_0x234ae1];return _0x227ba0;};'use strict';var Umzug=require(_0xef13('0x0'));var path=require(_0xef13('0x1'));var fs=require('fs');var _=require(_0xef13('0x2'));var pkginfo=require(_0xef13('0x3'))(module,'version');var compareVersions=require(_0xef13('0x4'));var exec=require(_0xef13('0x5'))['exec'];var db=require(_0xef13('0x6'))['db'];var config=require(_0xef13('0x7'));var pm2=require(_0xef13('0x8'));var logger=require('../../config/logger')(_0xef13('0x9'));var git=require(_0xef13('0xa'))(config[_0xef13('0xb')]);exports['index']=function(_0x17baca,_0x1001cd){var _0x54aa4e={'current':module['exports'][_0xef13('0xc')],'phonebar':0x2};if(_0x17baca[_0xef13('0xd')]&&_0x17baca['query'][_0xef13('0xe')]){return git[_0xef13('0xf')]()[_0xef13('0x10')](function(_0x40e031,_0x17912b){_0x54aa4e[_0xef13('0xe')]=(_0x40e031?module[_0xef13('0x11')][_0xef13('0xc')]:_0x17912b['latest'])||_0xef13('0x12');return _0x1001cd['status'](0xc8)[_0xef13('0x13')](_0x54aa4e);});}else{return _0x1001cd[_0xef13('0x14')](0xc8)['json'](_0x54aa4e);}};exports['fetch']=function(_0x1c4245,_0x433bbe){return git[_0xef13('0xf')](['origin',_0xef13('0x15')],function(_0x4da378){if(_0x4da378){logger['error'](_0x4da378);return _0x433bbe[_0xef13('0x14')](0x1f4)[_0xef13('0x13')](_0x4da378);}logger[_0xef13('0x16')]('git\x20fetch');return _0x433bbe[_0xef13('0x14')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xef13('0x17')]=function(_0x16bc50,_0x4fdca7){return git[_0xef13('0x17')]([_0xef13('0x18'),_0xef13('0x19')],function(_0x387695){if(_0x387695){logger[_0xef13('0x1a')](_0x387695);return _0x4fdca7[_0xef13('0x14')](0x1f4)['json'](_0x387695);}logger[_0xef13('0x16')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x4fdca7[_0xef13('0x14')](0xc8)[_0xef13('0x13')]({'output':'git\x20reset\x20--hard'});});};exports[_0xef13('0x1b')]=function(_0x51e0fd,_0x2f55fd){exec(_0xef13('0x1c'),function(_0x221484,_0x267956,_0x55dd01){logger['info'](_0x267956);logger[_0xef13('0x16')](_0x55dd01);if(_0x221484){logger['error'](_0x221484);return _0x2f55fd[_0xef13('0x14')](0x1f4)[_0xef13('0x13')](_0x221484);}return _0x2f55fd[_0xef13('0x14')](0xc8)[_0xef13('0x13')]({'output':_0x267956});});};exports[_0xef13('0x1d')]=function(_0x323d60,_0xa84e02){return pm2[_0xef13('0x1d')]('motion2')[_0xef13('0x1e')](function(_0x350316){logger['info'](_0xef13('0x1f'),_0x350316);return _0xa84e02[_0xef13('0x14')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xef13('0x20')](function(_0x3b3ae3){logger[_0xef13('0x1a')](_0x3b3ae3);return _0xa84e02['status'](0x1f4)[_0xef13('0x13')](_0x3b3ae3);});};exports[_0xef13('0x21')]=function(_0x4e31c6,_0x290eff){var _0x1dbd30=fs['readdirSync'](path[_0xef13('0x22')](config[_0xef13('0xb')],'server',_0xef13('0x21')));var _0x5691b3=[];for(var _0x29e51b=0x0;_0x29e51b<_0x1dbd30[_0xef13('0x23')];_0x29e51b++){var _0x91845e=_0x1dbd30[_0x29e51b]['replace'](_0xef13('0x24'),'');if(compareVersions(module[_0xef13('0x11')]['version'],_0x91845e)===-0x1){_0x5691b3[_0xef13('0x25')](_0x91845e);}}if(_0x5691b3[_0xef13('0x23')]){var _0x36c284=_0x5691b3[_0xef13('0x26')](compareVersions);var _0x337c21=new Umzug({'storage':_0xef13('0x27'),'storageOptions':{'model':db['Migration'],'modelName':_0xef13('0x28'),'columnName':_0xef13('0xc')},'migrations':{'params':[db[_0xef13('0x27')][_0xef13('0x29')](),db[_0xef13('0x27')]['constructor'],function(){throw new Error(_0xef13('0x2a'));}],'path':path[_0xef13('0x22')](config[_0xef13('0xb')],'server',_0xef13('0x21')),'pattern':/\.js$/}});_0x337c21['up']({'migrations':_[_0xef13('0x2b')](_0x36c284,function(_0x5b05f4){return _0x5b05f4+_0xef13('0x24');})})['then'](function(){return _0x290eff['status'](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xef13('0x11')][_0xef13('0xc')]+_0xef13('0x2c')+_[_0xef13('0x2d')](_0x36c284),'migrations':_[_0xef13('0x22')](_0x36c284)});})[_0xef13('0x20')](function(_0x33cd79){if(_0x33cd79 instanceof db[_0xef13('0x27')]['UniqueConstraintError']){return _0x290eff['status'](0xc8)[_0xef13('0x13')]({'output':_0xef13('0x2e')});}else{return _0x290eff[_0xef13('0x14')](0x1f4)['json'](_0x33cd79);}});}else{return _0x290eff['status'](0xc8)['json']({'output':_0xef13('0x2e')});}}; \ No newline at end of file +var _0x666e=['replace','push','Migration','sequelize','getQueryInterface','constructor','join','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','version','query','latest','tags','2.0.0','status','json','fetch','master','error','info','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','server'];(function(_0x45ce08,_0x59dcc7){var _0x23dff2=function(_0x1ad0e5){while(--_0x1ad0e5){_0x45ce08['push'](_0x45ce08['shift']());}};_0x23dff2(++_0x59dcc7);}(_0x666e,0x1f4));var _0xe666=function(_0x53816b,_0x2f9ba3){_0x53816b=_0x53816b-0x0;var _0x7f2259=_0x666e[_0x53816b];return _0x7f2259;};'use strict';var Umzug=require(_0xe666('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xe666('0x1'));var pkginfo=require(_0xe666('0x2'))(module,'version');var compareVersions=require(_0xe666('0x3'));var exec=require(_0xe666('0x4'))[_0xe666('0x5')];var db=require(_0xe666('0x6'))['db'];var config=require(_0xe666('0x7'));var pm2=require(_0xe666('0x8'));var logger=require('../../config/logger')(_0xe666('0x9'));var git=require(_0xe666('0xa'))(config[_0xe666('0xb')]);exports[_0xe666('0xc')]=function(_0x4e85fb,_0x1dec13){var _0x5b5336={'current':module[_0xe666('0xd')][_0xe666('0xe')],'phonebar':0x2};if(_0x4e85fb[_0xe666('0xf')]&&_0x4e85fb['query'][_0xe666('0x10')]){return git['fetch']()[_0xe666('0x11')](function(_0x4ae5a1,_0x3c274e){_0x5b5336[_0xe666('0x10')]=(_0x4ae5a1?module[_0xe666('0xd')]['version']:_0x3c274e[_0xe666('0x10')])||_0xe666('0x12');return _0x1dec13[_0xe666('0x13')](0xc8)[_0xe666('0x14')](_0x5b5336);});}else{return _0x1dec13[_0xe666('0x13')](0xc8)[_0xe666('0x14')](_0x5b5336);}};exports['fetch']=function(_0x38faa3,_0x4d6334){return git[_0xe666('0x15')](['origin',_0xe666('0x16')],function(_0x367e9e){if(_0x367e9e){logger[_0xe666('0x17')](_0x367e9e);return _0x4d6334[_0xe666('0x13')](0x1f4)[_0xe666('0x14')](_0x367e9e);}logger[_0xe666('0x18')]('git\x20fetch');return _0x4d6334['status'](0xc8)[_0xe666('0x14')]({'output':_0xe666('0x19')});});};exports[_0xe666('0x1a')]=function(_0x15f751,_0x5b0102){return git[_0xe666('0x1a')](['--hard',_0xe666('0x1b')],function(_0x1b6c28){if(_0x1b6c28){logger['error'](_0x1b6c28);return _0x5b0102['status'](0x1f4)['json'](_0x1b6c28);}logger['info'](_0xe666('0x1c'));return _0x5b0102[_0xe666('0x13')](0xc8)[_0xe666('0x14')]({'output':_0xe666('0x1d')});});};exports[_0xe666('0x1e')]=function(_0x402cbf,_0x5890e7){exec(_0xe666('0x1f'),function(_0x3c8124,_0x4a03e5,_0x1635a1){logger[_0xe666('0x18')](_0x4a03e5);logger[_0xe666('0x18')](_0x1635a1);if(_0x3c8124){logger['error'](_0x3c8124);return _0x5890e7[_0xe666('0x13')](0x1f4)[_0xe666('0x14')](_0x3c8124);}return _0x5890e7[_0xe666('0x13')](0xc8)[_0xe666('0x14')]({'output':_0x4a03e5});});};exports[_0xe666('0x20')]=function(_0xad9a01,_0x4866e9){return pm2[_0xe666('0x20')](_0xe666('0x21'))[_0xe666('0x22')](function(_0xda9344){logger[_0xe666('0x18')](_0xe666('0x23'),_0xda9344);return _0x4866e9[_0xe666('0x13')](0xc8)[_0xe666('0x14')]({'output':_0xe666('0x24')});})[_0xe666('0x25')](function(_0x5ac5f0){logger[_0xe666('0x17')](_0x5ac5f0);return _0x4866e9[_0xe666('0x13')](0x1f4)[_0xe666('0x14')](_0x5ac5f0);});};exports[_0xe666('0x26')]=function(_0x10cb71,_0x4ac3e7){var _0x1667b0=fs['readdirSync'](path['join'](config[_0xe666('0xb')],_0xe666('0x27'),_0xe666('0x26')));var _0x468c03=[];for(var _0x10f7cf=0x0;_0x10f7cf<_0x1667b0['length'];_0x10f7cf++){var _0x382a13=_0x1667b0[_0x10f7cf][_0xe666('0x28')]('.js','');if(compareVersions(module['exports']['version'],_0x382a13)===-0x1){_0x468c03[_0xe666('0x29')](_0x382a13);}}if(_0x468c03['length']){var _0x22ef54=_0x468c03['sort'](compareVersions);var _0x58c237=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xe666('0x2a')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0xe666('0x2b')][_0xe666('0x2c')](),db[_0xe666('0x2b')][_0xe666('0x2d')],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[_0xe666('0x2e')](config[_0xe666('0xb')],'server',_0xe666('0x26')),'pattern':/\.js$/}});_0x58c237['up']({'migrations':_[_0xe666('0x2f')](_0x22ef54,function(_0x111453){return _0x111453+_0xe666('0x30');})})['then'](function(){return _0x4ac3e7[_0xe666('0x13')](0xc8)[_0xe666('0x14')]({'output':_0xe666('0x31')+module[_0xe666('0xd')][_0xe666('0xe')]+_0xe666('0x32')+_[_0xe666('0x33')](_0x22ef54),'migrations':_[_0xe666('0x2e')](_0x22ef54)});})['catch'](function(_0x2849c6){if(_0x2849c6 instanceof db['sequelize'][_0xe666('0x34')]){return _0x4ac3e7['status'](0xc8)[_0xe666('0x14')]({'output':_0xe666('0x35')});}else{return _0x4ac3e7['status'](0x1f4)[_0xe666('0x14')](_0x2849c6);}});}else{return _0x4ac3e7[_0xe666('0x13')](0xc8)[_0xe666('0x14')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 9949f8b..1d280ba 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 _0x3f65=['describe','/:id','show','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','/describe'];(function(_0x562614,_0x53b1e4){var _0x19266a=function(_0x5d0d0a){while(--_0x5d0d0a){_0x562614['push'](_0x562614['shift']());}};_0x19266a(++_0x53b1e4);}(_0x3f65,0xd9));var _0x53f6=function(_0x50f288,_0xfecd76){_0x50f288=_0x50f288-0x0;var _0x2a0755=_0x3f65[_0x50f288];return _0x2a0755;};'use strict';var multer=require(_0x53f6('0x0'));var util=require(_0x53f6('0x1'));var path=require('path');var timeout=require(_0x53f6('0x2'));var express=require(_0x53f6('0x3'));var router=express[_0x53f6('0x4')]();var fs_extra=require(_0x53f6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x53f6('0x6'));var config=require(_0x53f6('0x7'));var controller=require(_0x53f6('0x8'));router[_0x53f6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x53f6('0x9')](_0x53f6('0xa'),auth['isAuthenticated'](),controller[_0x53f6('0xb')]);router[_0x53f6('0x9')](_0x53f6('0xc'),auth['isAuthenticated'](),controller[_0x53f6('0xd')]);router['post']('/',auth[_0x53f6('0xe')](),controller['create']);router['put'](_0x53f6('0xc'),auth[_0x53f6('0xe')](),controller[_0x53f6('0xf')]);router[_0x53f6('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x53f6('0x11')]);module[_0x53f6('0x12')]=router; \ No newline at end of file +var _0x2955=['isAuthenticated','get','/describe','describe','/:id','show','create','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller'];(function(_0x15942a,_0x13b58c){var _0x36a9fb=function(_0x549c27){while(--_0x549c27){_0x15942a['push'](_0x15942a['shift']());}};_0x36a9fb(++_0x13b58c);}(_0x2955,0x106));var _0x5295=function(_0x377409,_0x222f7e){_0x377409=_0x377409-0x0;var _0x502a7e=_0x2955[_0x377409];return _0x502a7e;};'use strict';var multer=require(_0x5295('0x0'));var util=require('util');var path=require(_0x5295('0x1'));var timeout=require('connect-timeout');var express=require(_0x5295('0x2'));var router=express[_0x5295('0x3')]();var fs_extra=require(_0x5295('0x4'));var auth=require(_0x5295('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5295('0x6'));var controller=require(_0x5295('0x7'));router['get']('/',auth[_0x5295('0x8')](),controller['index']);router[_0x5295('0x9')](_0x5295('0xa'),auth[_0x5295('0x8')](),controller[_0x5295('0xb')]);router[_0x5295('0x9')](_0x5295('0xc'),auth[_0x5295('0x8')](),controller[_0x5295('0xd')]);router['post']('/',auth[_0x5295('0x8')](),controller[_0x5295('0xe')]);router['put'](_0x5295('0xc'),auth[_0x5295('0x8')](),controller['update']);router[_0x5295('0xf')](_0x5295('0xc'),auth['isAuthenticated'](),controller[_0x5295('0x10')]);module[_0x5295('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 08f500e..dfff798 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 _0xccef=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x4b768d,_0x4b72c5){var _0x1368a8=function(_0x36abea){while(--_0x36abea){_0x4b768d['push'](_0x4b768d['shift']());}};_0x1368a8(++_0x4b72c5);}(_0xccef,0x1d4));var _0xfcce=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xccef[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0xfcce('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfcce('0x1')]},'calleridnum':{'type':Sequelize[_0xfcce('0x1')]},'calleridname':{'type':Sequelize[_0xfcce('0x1')]},'queue':{'type':Sequelize[_0xfcce('0x1')]},'interface':{'type':Sequelize[_0xfcce('0x1')]},'membername':{'type':Sequelize[_0xfcce('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xfcce('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xfcce('0x2')]},'holdtime':{'type':Sequelize[_0xfcce('0x3')]},'agentcomplete':{'type':Sequelize[_0xfcce('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xfcce('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xfcce('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xfcce('0x3')]},'agentacw':{'type':Sequelize[_0xfcce('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xfcce('0x1')]},'lastevent':{'type':Sequelize[_0xfcce('0x1')]},'channel':{'type':Sequelize[_0xfcce('0x1')]},'channelstate':{'type':Sequelize[_0xfcce('0x3')]},'channelstatedesc':{'type':Sequelize[_0xfcce('0x1')]},'connectedlinenum':{'type':Sequelize[_0xfcce('0x1')]},'connectedlinename':{'type':Sequelize[_0xfcce('0x1')]},'language':{'type':Sequelize[_0xfcce('0x1')]},'accountcode':{'type':Sequelize[_0xfcce('0x1')]},'context':{'type':Sequelize[_0xfcce('0x1')]},'exten':{'type':Sequelize[_0xfcce('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xfcce('0x1')]},'destchannelstate':{'type':Sequelize[_0xfcce('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xfcce('0x1')]},'destcalleridnum':{'type':Sequelize[_0xfcce('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xfcce('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xfcce('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xfcce('0x1')]},'destexten':{'type':Sequelize[_0xfcce('0x1')]},'destpriority':{'type':Sequelize[_0xfcce('0x1')]},'destuniqueid':{'type':Sequelize[_0xfcce('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xfcce('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xfcce('0x1')]},'transfer':{'type':Sequelize[_0xfcce('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xfcce('0x1')],'comment':_0xfcce('0x5')},'transferexten':{'type':Sequelize[_0xfcce('0x1')]},'transferuniqueid':{'type':Sequelize[_0xfcce('0x1')]},'agententerreason':{'type':Sequelize[_0xfcce('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0598=['exports','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x362df6,_0xb1b625){var _0x4d26a5=function(_0x28db0c){while(--_0x28db0c){_0x362df6['push'](_0x362df6['shift']());}};_0x4d26a5(++_0xb1b625);}(_0x0598,0x92));var _0x8059=function(_0x4366c7,_0x11c659){_0x4366c7=_0x4366c7-0x0;var _0x10c687=_0x0598[_0x4366c7];return _0x10c687;};'use strict';var Sequelize=require(_0x8059('0x0'));module[_0x8059('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8059('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x8059('0x2')]},'interface':{'type':Sequelize[_0x8059('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x8059('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x8059('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x8059('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8059('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8059('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8059('0x5')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x8059('0x2')]},'lastevent':{'type':Sequelize[_0x8059('0x2')]},'channel':{'type':Sequelize[_0x8059('0x2')]},'channelstate':{'type':Sequelize[_0x8059('0x5')]},'channelstatedesc':{'type':Sequelize[_0x8059('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x8059('0x2')]},'accountcode':{'type':Sequelize[_0x8059('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x8059('0x2')]},'destchannelstate':{'type':Sequelize[_0x8059('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x8059('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8059('0x2')]},'destcalleridname':{'type':Sequelize[_0x8059('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x8059('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x8059('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x8059('0x2')]},'destpriority':{'type':Sequelize[_0x8059('0x2')]},'destuniqueid':{'type':Sequelize[_0x8059('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8059('0x2')],'comment':_0x8059('0x6')},'transferexten':{'type':Sequelize[_0x8059('0x2')]},'transferuniqueid':{'type':Sequelize[_0x8059('0x2')]},'agententerreason':{'type':Sequelize[_0x8059('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 709d37e..eb8144d 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(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 4416ca1..6a956da 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 _0x7118=['rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','../../config/logger','api','bluebird','request-promise','path'];(function(_0x358e3b,_0x72233f){var _0x4906c0=function(_0x5d25fb){while(--_0x5d25fb){_0x358e3b['push'](_0x358e3b['shift']());}};_0x4906c0(++_0x72233f);}(_0x7118,0x159));var _0x8711=function(_0x25d459,_0x57be10){_0x25d459=_0x25d459-0x0;var _0x6b46b3=_0x7118[_0x25d459];return _0x6b46b3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8711('0x0'))(_0x8711('0x1'));var moment=require('moment');var BPromise=require(_0x8711('0x2'));var rp=require(_0x8711('0x3'));var fs=require('fs');var path=require(_0x8711('0x4'));var rimraf=require(_0x8711('0x5'));var config=require(_0x8711('0x6'));var attributes=require(_0x8711('0x7'));module[_0x8711('0x8')]=function(_0x54885e,_0x385033){return _0x54885e[_0x8711('0x9')](_0x8711('0xa'),attributes,{'tableName':_0x8711('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8711('0xc'),_0x8711('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xef8b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','uniqueid','destuniqueid','util','../../config/logger','api'];(function(_0x55c01a,_0x1c39a6){var _0x8eca10=function(_0x3ba52c){while(--_0x3ba52c){_0x55c01a['push'](_0x55c01a['shift']());}};_0x8eca10(++_0x1c39a6);}(_0xef8b,0x192));var _0xbef8=function(_0x31cb77,_0x348021){_0x31cb77=_0x31cb77-0x0;var _0x710374=_0xef8b[_0x31cb77];return _0x710374;};'use strict';var _=require('lodash');var util=require(_0xbef8('0x0'));var logger=require(_0xbef8('0x1'))(_0xbef8('0x2'));var moment=require(_0xbef8('0x3'));var BPromise=require(_0xbef8('0x4'));var rp=require(_0xbef8('0x5'));var fs=require('fs');var path=require(_0xbef8('0x6'));var rimraf=require(_0xbef8('0x7'));var config=require(_0xbef8('0x8'));var attributes=require(_0xbef8('0x9'));module[_0xbef8('0xa')]=function(_0x550cb1,_0x1dd4a3){return _0x550cb1[_0xbef8('0xb')](_0xbef8('0xc'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xbef8('0xd'),_0xbef8('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 e190770..e2e7dae 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 _0xfbd9=['request\x20sent','stringify','error','code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','debug','UpdateVoiceAgentReport','update','body','where','attributes','limit','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','VoiceAgentReport,\x20%s,\x20%s'];(function(_0x22c154,_0x30b413){var _0x38dea0=function(_0x18c06a){while(--_0x18c06a){_0x22c154['push'](_0x22c154['shift']());}};_0x38dea0(++_0x30b413);}(_0xfbd9,0x1a1));var _0x9fbd=function(_0x12ea79,_0x1f0c6e){_0x12ea79=_0x12ea79-0x0;var _0x83481a=_0xfbd9[_0x12ea79];return _0x83481a;};'use strict';var _=require(_0x9fbd('0x0'));var util=require(_0x9fbd('0x1'));var moment=require(_0x9fbd('0x2'));var BPromise=require(_0x9fbd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9fbd('0x4'));var db=require(_0x9fbd('0x5'))['db'];var utils=require(_0x9fbd('0x6'));var logger=require(_0x9fbd('0x7'))(_0x9fbd('0x8'));var config=require(_0x9fbd('0x9'));var jayson=require(_0x9fbd('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3241a1,_0xb37b31,_0x88fd51){return new BPromise(function(_0x615715,_0x11e3c3){return client['request'](_0x3241a1,_0x88fd51)['then'](function(_0x24c136){logger['info'](_0x9fbd('0xb'),_0xb37b31,_0x9fbd('0xc'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0xb37b31,'request\x20sent',JSON[_0x9fbd('0xd')](_0x24c136));if(_0x24c136[_0x9fbd('0xe')]){if(_0x24c136[_0x9fbd('0xe')][_0x9fbd('0xf')]===0x1f4){logger['error'](_0x9fbd('0xb'),_0xb37b31,_0x24c136[_0x9fbd('0xe')][_0x9fbd('0x10')]);return _0x11e3c3(_0x24c136[_0x9fbd('0xe')][_0x9fbd('0x10')]);}logger[_0x9fbd('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0xb37b31,_0x24c136[_0x9fbd('0xe')][_0x9fbd('0x10')]);return _0x615715(_0x24c136[_0x9fbd('0xe')]['message']);}else{logger[_0x9fbd('0x11')](_0x9fbd('0xb'),_0xb37b31,_0x9fbd('0xc'));_0x615715(_0x24c136[_0x9fbd('0x12')][_0x9fbd('0x10')]);}})[_0x9fbd('0x13')](function(_0x3a3e5f){logger[_0x9fbd('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0xb37b31,_0x3a3e5f);_0x11e3c3(_0x3a3e5f);});});}exports[_0x9fbd('0x14')]=function(_0x2bddbf){var _0x3662eb=this;return new Promise(function(_0xb7196f,_0x17045f){return db[_0x9fbd('0x15')][_0x9fbd('0x16')](_0x2bddbf['body'],{'raw':_0x2bddbf[_0x9fbd('0x17')]?_0x2bddbf[_0x9fbd('0x17')][_0x9fbd('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x541e01){logger[_0x9fbd('0x11')](_0x9fbd('0x14'),_0x2bddbf);logger[_0x9fbd('0x19')](_0x9fbd('0x14'),_0x2bddbf,JSON[_0x9fbd('0xd')](_0x541e01));_0xb7196f(_0x541e01);})[_0x9fbd('0x13')](function(_0x2ed43b){logger[_0x9fbd('0xe')](_0x9fbd('0x14'),_0x2ed43b[_0x9fbd('0x10')],_0x2bddbf);_0x17045f(_0x3662eb[_0x9fbd('0xe')](0x1f4,_0x2ed43b[_0x9fbd('0x10')]));});});};exports[_0x9fbd('0x1a')]=function(_0x5a7e66){var _0x598b26=this;return new Promise(function(_0x357092,_0x4cea2d){return db[_0x9fbd('0x15')][_0x9fbd('0x1b')](_0x5a7e66[_0x9fbd('0x1c')],{'raw':_0x5a7e66['options']?_0x5a7e66[_0x9fbd('0x17')][_0x9fbd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a7e66[_0x9fbd('0x17')]?_0x5a7e66[_0x9fbd('0x17')][_0x9fbd('0x1d')]||null:null,'attributes':_0x5a7e66[_0x9fbd('0x17')]?_0x5a7e66['options'][_0x9fbd('0x1e')]||null:null,'limit':_0x5a7e66[_0x9fbd('0x17')]?_0x5a7e66['options'][_0x9fbd('0x1f')]||null:null})[_0x9fbd('0x20')](function(_0x2edf21){logger['info']('UpdateVoiceAgentReport',_0x5a7e66);logger['debug'](_0x9fbd('0x1a'),_0x5a7e66,JSON[_0x9fbd('0xd')](_0x2edf21));_0x357092(_0x2edf21);})[_0x9fbd('0x13')](function(_0x59641b){logger[_0x9fbd('0xe')](_0x9fbd('0x1a'),_0x59641b[_0x9fbd('0x10')],_0x5a7e66);_0x4cea2d(_0x598b26['error'](0x1f4,_0x59641b['message']));});});}; \ No newline at end of file +var _0x853d=['UpdateVoiceAgentReport','update','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw'];(function(_0x57e958,_0x153503){var _0x565a44=function(_0x50454b){while(--_0x50454b){_0x57e958['push'](_0x57e958['shift']());}};_0x565a44(++_0x153503);}(_0x853d,0x1a8));var _0xd853=function(_0x2331d3,_0x2995bd){_0x2331d3=_0x2331d3-0x0;var _0x24a661=_0x853d[_0x2331d3];return _0x24a661;};'use strict';var _=require(_0xd853('0x0'));var util=require('util');var moment=require(_0xd853('0x1'));var BPromise=require(_0xd853('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd853('0x3'));var db=require(_0xd853('0x4'))['db'];var utils=require(_0xd853('0x5'));var logger=require(_0xd853('0x6'))(_0xd853('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd853('0x8')][_0xd853('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x412528,_0x221a1a,_0x2cd410){return new BPromise(function(_0x3efe57,_0x59c140){return client[_0xd853('0xa')](_0x412528,_0x2cd410)[_0xd853('0xb')](function(_0x137507){logger[_0xd853('0xc')](_0xd853('0xd'),_0x221a1a,'request\x20sent');logger[_0xd853('0xe')](_0xd853('0xf'),_0x221a1a,_0xd853('0x10'),JSON[_0xd853('0x11')](_0x137507));if(_0x137507[_0xd853('0x12')]){if(_0x137507['error']['code']===0x1f4){logger[_0xd853('0x12')](_0xd853('0xd'),_0x221a1a,_0x137507[_0xd853('0x12')]['message']);return _0x59c140(_0x137507[_0xd853('0x12')][_0xd853('0x13')]);}logger[_0xd853('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x221a1a,_0x137507[_0xd853('0x12')][_0xd853('0x13')]);return _0x3efe57(_0x137507[_0xd853('0x12')][_0xd853('0x13')]);}else{logger[_0xd853('0xc')](_0xd853('0xd'),_0x221a1a,_0xd853('0x10'));_0x3efe57(_0x137507['result'][_0xd853('0x13')]);}})[_0xd853('0x14')](function(_0x46a310){logger['error'](_0xd853('0xd'),_0x221a1a,_0x46a310);_0x59c140(_0x46a310);});});}exports[_0xd853('0x15')]=function(_0x4ffcd0){var _0x58db4d=this;return new Promise(function(_0x263755,_0x4168c8){return db[_0xd853('0x16')]['create'](_0x4ffcd0[_0xd853('0x17')],{'raw':_0x4ffcd0[_0xd853('0x18')]?_0x4ffcd0[_0xd853('0x18')][_0xd853('0x19')]===undefined?!![]:![]:!![]})[_0xd853('0xb')](function(_0x310d27){logger[_0xd853('0xc')](_0xd853('0x15'),_0x4ffcd0);logger[_0xd853('0xe')](_0xd853('0x15'),_0x4ffcd0,JSON['stringify'](_0x310d27));_0x263755(_0x310d27);})[_0xd853('0x14')](function(_0x55f65c){logger[_0xd853('0x12')](_0xd853('0x15'),_0x55f65c[_0xd853('0x13')],_0x4ffcd0);_0x4168c8(_0x58db4d['error'](0x1f4,_0x55f65c[_0xd853('0x13')]));});});};exports[_0xd853('0x1a')]=function(_0x9b9abb){var _0x41dd68=this;return new Promise(function(_0x5325a8,_0x2f951d){return db['VoiceAgentReport'][_0xd853('0x1b')](_0x9b9abb[_0xd853('0x17')],{'raw':_0x9b9abb[_0xd853('0x18')]?_0x9b9abb[_0xd853('0x18')][_0xd853('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9b9abb[_0xd853('0x18')]?_0x9b9abb[_0xd853('0x18')]['where']||null:null,'attributes':_0x9b9abb[_0xd853('0x18')]?_0x9b9abb['options'][_0xd853('0x1c')]||null:null,'limit':_0x9b9abb[_0xd853('0x18')]?_0x9b9abb[_0xd853('0x18')][_0xd853('0x1d')]||null:null})['then'](function(_0x2baef3){logger['info'](_0xd853('0x1a'),_0x9b9abb);logger[_0xd853('0xe')](_0xd853('0x1a'),_0x9b9abb,JSON[_0xd853('0x11')](_0x2baef3));_0x5325a8(_0x2baef3);})[_0xd853('0x14')](function(_0x328bfd){logger[_0xd853('0x12')]('UpdateVoiceAgentReport',_0x328bfd[_0xd853('0x13')],_0x9b9abb);_0x2f951d(_0x41dd68[_0xd853('0x12')](0x1f4,_0x328bfd[_0xd853('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 02ffb5e..8f2050e 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 _0x6c7b=['./voiceCallReport.controller','get','isAuthenticated','index','describe','/:id','show','post','update','delete','destroy','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x29557d,_0x517862){_0x29557d=_0x29557d-0x0;var _0x239694=_0x6c7b[_0x29557d];return _0x239694;};'use strict';var multer=require(_0xb6c7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb6c7('0x1'));var router=express['Router']();var fs_extra=require(_0xb6c7('0x2'));var auth=require(_0xb6c7('0x3'));var interaction=require(_0xb6c7('0x4'));var config=require('../../config/environment');var controller=require(_0xb6c7('0x5'));router[_0xb6c7('0x6')]('/',auth[_0xb6c7('0x7')](),controller[_0xb6c7('0x8')]);router[_0xb6c7('0x6')]('/describe',auth[_0xb6c7('0x7')](),controller[_0xb6c7('0x9')]);router[_0xb6c7('0x6')](_0xb6c7('0xa'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0xb')]);router[_0xb6c7('0xc')]('/',auth[_0xb6c7('0x7')](),controller['create']);router['put'](_0xb6c7('0xa'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0xd')]);router[_0xb6c7('0xe')](_0xb6c7('0xa'),auth[_0xb6c7('0x7')](),controller[_0xb6c7('0xf')]);module['exports']=router; \ No newline at end of file +var _0xd67b=['exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy'];(function(_0x198ba6,_0x558252){var _0x5c69eb=function(_0x3d13f9){while(--_0x3d13f9){_0x198ba6['push'](_0x198ba6['shift']());}};_0x5c69eb(++_0x558252);}(_0xd67b,0x133));var _0xbd67=function(_0x42fe64,_0x528d38){_0x42fe64=_0x42fe64-0x0;var _0x509f74=_0xd67b[_0x42fe64];return _0x509f74;};'use strict';var multer=require('multer');var util=require(_0xbd67('0x0'));var path=require('path');var timeout=require(_0xbd67('0x1'));var express=require(_0xbd67('0x2'));var router=express[_0xbd67('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbd67('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbd67('0x5'));var controller=require('./voiceCallReport.controller');router[_0xbd67('0x6')]('/',auth[_0xbd67('0x7')](),controller[_0xbd67('0x8')]);router[_0xbd67('0x6')](_0xbd67('0x9'),auth[_0xbd67('0x7')](),controller[_0xbd67('0xa')]);router[_0xbd67('0x6')](_0xbd67('0xb'),auth[_0xbd67('0x7')](),controller[_0xbd67('0xc')]);router[_0xbd67('0xd')]('/',auth[_0xbd67('0x7')](),controller['create']);router['put'](_0xbd67('0xb'),auth['isAuthenticated'](),controller[_0xbd67('0xe')]);router[_0xbd67('0xf')](_0xbd67('0xb'),auth[_0xbd67('0x7')](),controller[_0xbd67('0x10')]);module[_0xbd67('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index cfb4130..6c9e672 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 _0x48fa=['STRING','ENUM','inbound','outbound-fax','dialer','DATE','INTEGER','sequelize','exports'];(function(_0x2e655a,_0x6d5799){var _0x26f13b=function(_0x2dd535){while(--_0x2dd535){_0x2e655a['push'](_0x2e655a['shift']());}};_0x26f13b(++_0x6d5799);}(_0x48fa,0x127));var _0xa48f=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x48fa[_0xac151d];return _0x111dba;};'use strict';var Sequelize=require(_0xa48f('0x0'));module[_0xa48f('0x1')]={'uniqueid':{'type':Sequelize[_0xa48f('0x2')]},'type':{'type':Sequelize[_0xa48f('0x3')](_0xa48f('0x4'),'internal','outbound','inbound-fax',_0xa48f('0x5'),_0xa48f('0x6'))},'tag':{'type':Sequelize[_0xa48f('0x2')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xa48f('0x2')]},'destination':{'type':Sequelize[_0xa48f('0x2')]},'destinationcontext':{'type':Sequelize[_0xa48f('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xa48f('0x2')]},'lastapplication':{'type':Sequelize[_0xa48f('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xa48f('0x7')]},'systemanswertime':{'type':Sequelize[_0xa48f('0x7')]},'answertime':{'type':Sequelize[_0xa48f('0x7')]},'endtime':{'type':Sequelize[_0xa48f('0x7')]},'duration':{'type':Sequelize[_0xa48f('0x8')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xa48f('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa48f('0x2')]},'amaflags':{'type':Sequelize[_0xa48f('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xa48f('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xa48f('0x2')]},'note':{'type':Sequelize[_0xa48f('0x2')]},'prefix':{'type':Sequelize[_0xa48f('0x2')]},'routeid':{'type':Sequelize[_0xa48f('0x8')]},'sipcallid':{'type':Sequelize[_0xa48f('0x2')]}}; \ No newline at end of file +var _0x50d1=['INTEGER','exports','STRING','ENUM','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE'];(function(_0x33a708,_0x3911e9){var _0x3d7cb1=function(_0x2eaef1){while(--_0x2eaef1){_0x33a708['push'](_0x33a708['shift']());}};_0x3d7cb1(++_0x3911e9);}(_0x50d1,0xf3));var _0x150d=function(_0x1aa938,_0x4ad0fe){_0x1aa938=_0x1aa938-0x0;var _0x31d00d=_0x50d1[_0x1aa938];return _0x31d00d;};'use strict';var Sequelize=require('sequelize');module[_0x150d('0x0')]={'uniqueid':{'type':Sequelize[_0x150d('0x1')]},'type':{'type':Sequelize[_0x150d('0x2')]('inbound',_0x150d('0x3'),_0x150d('0x4'),_0x150d('0x5'),_0x150d('0x6'),_0x150d('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x150d('0x1')]},'destination':{'type':Sequelize[_0x150d('0x1')]},'destinationcontext':{'type':Sequelize[_0x150d('0x1')]},'callerid':{'type':Sequelize[_0x150d('0x1')]},'channel':{'type':Sequelize[_0x150d('0x1')]},'destinationchannel':{'type':Sequelize[_0x150d('0x1')]},'lastapplication':{'type':Sequelize[_0x150d('0x1')]},'lastdata':{'type':Sequelize[_0x150d('0x8')]},'starttime':{'type':Sequelize[_0x150d('0x9')]},'systemanswertime':{'type':Sequelize[_0x150d('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x150d('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x150d('0xa')]},'mohtime':{'type':Sequelize[_0x150d('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x150d('0x1')]},'amaflags':{'type':Sequelize[_0x150d('0x1')]},'userfield':{'type':Sequelize[_0x150d('0x1')]},'userDisposition':{'type':Sequelize[_0x150d('0x1')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x150d('0x1')]},'note':{'type':Sequelize[_0x150d('0x1')]},'prefix':{'type':Sequelize[_0x150d('0x1')]},'routeid':{'type':Sequelize[_0x150d('0xa')]},'sipcallid':{'type':Sequelize[_0x150d('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 245e758..dd5d54e 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 _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x555faa,_0x2fc199){var _0x19a33c=function(_0x3897fc){while(--_0x3897fc){_0x555faa['push'](_0x555faa['shift']());}};_0x19a33c(++_0x2fc199);}(_0xdb28,0x106));var _0x8db2=function(_0x580ca9,_0x26920f){_0x580ca9=_0x580ca9-0x0;var _0x1c5eb9=_0xdb28[_0x580ca9];return _0x1c5eb9;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file +var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x3ae2b2,_0x2d936f){var _0x1dbf00=function(_0x4072e9){while(--_0x4072e9){_0x3ae2b2['push'](_0x3ae2b2['shift']());}};_0x1dbf00(++_0x2d936f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x42fddb,_0x43d777){_0x42fddb=_0x42fddb-0x0;var _0x357157=_0x5f2f[_0x42fddb];return _0x357157;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index d8b2751..cade32f 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 _0x5d99=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','report_call','uniqueid'];(function(_0x23ce8a,_0x288aa7){var _0x108679=function(_0x355cfb){while(--_0x355cfb){_0x23ce8a['push'](_0x23ce8a['shift']());}};_0x108679(++_0x288aa7);}(_0x5d99,0x150));var _0x95d9=function(_0x810e4d,_0x909ef4){_0x810e4d=_0x810e4d-0x0;var _0x13f01c=_0x5d99[_0x810e4d];return _0x13f01c;};'use strict';var _=require('lodash');var util=require(_0x95d9('0x0'));var logger=require(_0x95d9('0x1'))(_0x95d9('0x2'));var moment=require(_0x95d9('0x3'));var BPromise=require(_0x95d9('0x4'));var rp=require(_0x95d9('0x5'));var fs=require('fs');var path=require(_0x95d9('0x6'));var rimraf=require(_0x95d9('0x7'));var config=require(_0x95d9('0x8'));var attributes=require(_0x95d9('0x9'));module[_0x95d9('0xa')]=function(_0x70af06,_0x2a3a71){return _0x70af06[_0x95d9('0xb')]('VoiceCallReport',attributes,{'tableName':_0x95d9('0xc'),'paranoid':![],'indexes':[{'fields':[_0x95d9('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7763=['./voiceCallReport.attributes','exports','report_call','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x45e440,_0x3516fd){var _0x1a6c22=function(_0x49ae26){while(--_0x49ae26){_0x45e440['push'](_0x45e440['shift']());}};_0x1a6c22(++_0x3516fd);}(_0x7763,0xa0));var _0x3776=function(_0xaede4a,_0x44f7d7){_0xaede4a=_0xaede4a-0x0;var _0x10e86d=_0x7763[_0xaede4a];return _0x10e86d;};'use strict';var _=require(_0x3776('0x0'));var util=require(_0x3776('0x1'));var logger=require(_0x3776('0x2'))(_0x3776('0x3'));var moment=require('moment');var BPromise=require(_0x3776('0x4'));var rp=require(_0x3776('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3776('0x6'));var config=require(_0x3776('0x7'));var attributes=require(_0x3776('0x8'));module[_0x3776('0x9')]=function(_0x4c9d16,_0x2e49de){return _0x4c9d16['define']('VoiceCallReport',attributes,{'tableName':_0x3776('0xa'),'paranoid':![],'indexes':[{'fields':[_0x3776('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 69e6f82..44ff754 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 _0x8591=['options','raw','attributes','limit','include','map','model','CreateVoiceCallReport','VoiceCallReport','create','body','UpdateVoiceCallReport','update','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetVoiceCallReport','findAll'];(function(_0x23f947,_0x2ec81b){var _0x2969a4=function(_0x57bb2f){while(--_0x57bb2f){_0x23f947['push'](_0x23f947['shift']());}};_0x2969a4(++_0x2ec81b);}(_0x8591,0x1ee));var _0x1859=function(_0x4f48e4,_0x21af0b){_0x4f48e4=_0x4f48e4-0x0;var _0x581c5d=_0x8591[_0x4f48e4];return _0x581c5d;};'use strict';var _=require('lodash');var util=require(_0x1859('0x0'));var moment=require(_0x1859('0x1'));var BPromise=require(_0x1859('0x2'));var rs=require(_0x1859('0x3'));var fs=require('fs');var Redis=require(_0x1859('0x4'));var db=require(_0x1859('0x5'))['db'];var utils=require(_0x1859('0x6'));var logger=require(_0x1859('0x7'))(_0x1859('0x8'));var config=require(_0x1859('0x9'));var jayson=require(_0x1859('0xa'));var client=jayson['client'][_0x1859('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48f9df,_0x21f367,_0x4bc578){return new BPromise(function(_0x1ab500,_0x5e602a){return client[_0x1859('0xc')](_0x48f9df,_0x4bc578)[_0x1859('0xd')](function(_0x59b1b0){logger[_0x1859('0xe')](_0x1859('0xf'),_0x21f367,'request\x20sent');logger[_0x1859('0x10')](_0x1859('0x11'),_0x21f367,'request\x20sent',JSON[_0x1859('0x12')](_0x59b1b0));if(_0x59b1b0[_0x1859('0x13')]){if(_0x59b1b0[_0x1859('0x13')]['code']===0x1f4){logger['error'](_0x1859('0xf'),_0x21f367,_0x59b1b0[_0x1859('0x13')][_0x1859('0x14')]);return _0x5e602a(_0x59b1b0['error'][_0x1859('0x14')]);}logger[_0x1859('0x13')](_0x1859('0xf'),_0x21f367,_0x59b1b0[_0x1859('0x13')][_0x1859('0x14')]);return _0x1ab500(_0x59b1b0[_0x1859('0x13')][_0x1859('0x14')]);}else{logger[_0x1859('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x21f367,_0x1859('0x15'));_0x1ab500(_0x59b1b0[_0x1859('0x16')][_0x1859('0x14')]);}})[_0x1859('0x17')](function(_0x810dbe){logger[_0x1859('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x21f367,_0x810dbe);_0x5e602a(_0x810dbe);});});}exports[_0x1859('0x18')]=function(_0x59c1e9){var _0x186289=this;return new Promise(function(_0x44f5d7,_0x101292){return db['VoiceCallReport'][_0x1859('0x19')]({'raw':_0x59c1e9[_0x1859('0x1a')]?_0x59c1e9[_0x1859('0x1a')][_0x1859('0x1b')]===undefined?!![]:![]:!![],'where':_0x59c1e9[_0x1859('0x1a')]?_0x59c1e9[_0x1859('0x1a')]['where']||null:null,'attributes':_0x59c1e9['options']?_0x59c1e9['options'][_0x1859('0x1c')]||null:null,'limit':_0x59c1e9[_0x1859('0x1a')]?_0x59c1e9[_0x1859('0x1a')][_0x1859('0x1d')]||null:null,'include':_0x59c1e9[_0x1859('0x1a')]?_0x59c1e9[_0x1859('0x1a')][_0x1859('0x1e')]?_[_0x1859('0x1f')](_0x59c1e9['options'][_0x1859('0x1e')],function(_0x4c510c){return{'model':db[_0x4c510c['model']],'as':_0x4c510c['as'],'attributes':_0x4c510c[_0x1859('0x1c')],'include':_0x4c510c[_0x1859('0x1e')]?_['map'](_0x4c510c[_0x1859('0x1e')],function(_0xabb122){return{'model':db[_0xabb122[_0x1859('0x20')]],'as':_0xabb122['as'],'attributes':_0xabb122['attributes'],'include':_0xabb122['include']?_[_0x1859('0x1f')](_0xabb122['include'],function(_0x2841bd){return{'model':db[_0x2841bd[_0x1859('0x20')]],'as':_0x2841bd['as'],'attributes':_0x2841bd[_0x1859('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1859('0xd')](function(_0xd6e98){logger[_0x1859('0xe')](_0x1859('0x18'),_0x59c1e9);logger[_0x1859('0x10')](_0x1859('0x18'),_0x59c1e9,JSON[_0x1859('0x12')](_0xd6e98));_0x44f5d7(_0xd6e98);})[_0x1859('0x17')](function(_0x2b3980){logger[_0x1859('0x13')](_0x1859('0x18'),_0x2b3980['message'],_0x59c1e9);_0x101292(_0x186289['error'](0x1f4,_0x2b3980[_0x1859('0x14')]));});});};exports[_0x1859('0x21')]=function(_0x4e1b24){var _0x46004d=this;return new Promise(function(_0x2573fa,_0x3ed0fd){return db[_0x1859('0x22')][_0x1859('0x23')](_0x4e1b24[_0x1859('0x24')],{'raw':_0x4e1b24[_0x1859('0x1a')]?_0x4e1b24[_0x1859('0x1a')][_0x1859('0x1b')]===undefined?!![]:![]:!![]})[_0x1859('0xd')](function(_0x2ad474){logger['info'](_0x1859('0x21'),_0x4e1b24);logger[_0x1859('0x10')](_0x1859('0x21'),_0x4e1b24,JSON[_0x1859('0x12')](_0x2ad474));_0x2573fa(_0x2ad474);})[_0x1859('0x17')](function(_0x132ec3){logger[_0x1859('0x13')]('CreateVoiceCallReport',_0x132ec3[_0x1859('0x14')],_0x4e1b24);_0x3ed0fd(_0x46004d['error'](0x1f4,_0x132ec3[_0x1859('0x14')]));});});};exports[_0x1859('0x25')]=function(_0x16dc8f){var _0x28e43e=this;return new Promise(function(_0x41964e,_0x3e9652){return db['VoiceCallReport'][_0x1859('0x26')](_0x16dc8f[_0x1859('0x24')],{'raw':_0x16dc8f[_0x1859('0x1a')]?_0x16dc8f[_0x1859('0x1a')][_0x1859('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16dc8f[_0x1859('0x1a')]?_0x16dc8f[_0x1859('0x1a')][_0x1859('0x27')]||null:null,'attributes':_0x16dc8f[_0x1859('0x1a')]?_0x16dc8f[_0x1859('0x1a')][_0x1859('0x1c')]||null:null,'limit':_0x16dc8f['options']?_0x16dc8f[_0x1859('0x1a')][_0x1859('0x1d')]||null:null})[_0x1859('0xd')](function(_0x23cd0a){logger[_0x1859('0xe')](_0x1859('0x25'),_0x16dc8f);logger[_0x1859('0x10')](_0x1859('0x25'),_0x16dc8f,JSON[_0x1859('0x12')](_0x23cd0a));_0x41964e(_0x23cd0a);})[_0x1859('0x17')](function(_0x316101){logger[_0x1859('0x13')](_0x1859('0x25'),_0x316101['message'],_0x16dc8f);_0x3e9652(_0x28e43e[_0x1859('0x13')](0x1f4,_0x316101[_0x1859('0x14')]));});});}; \ No newline at end of file +var _0x4ac3=['stringify','UpdateVoiceCallReport','update','where','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','attributes','limit','include','map','model','debug','CreateVoiceCallReport','create','raw'];(function(_0x12b068,_0x408475){var _0x3fa828=function(_0x1bc57b){while(--_0x1bc57b){_0x12b068['push'](_0x12b068['shift']());}};_0x3fa828(++_0x408475);}(_0x4ac3,0xa1));var _0x34ac=function(_0x3a1675,_0x5aac46){_0x3a1675=_0x3a1675-0x0;var _0x3962b2=_0x4ac3[_0x3a1675];return _0x3962b2;};'use strict';var _=require(_0x34ac('0x0'));var util=require(_0x34ac('0x1'));var moment=require(_0x34ac('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ac('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ac('0x4'));var logger=require(_0x34ac('0x5'))(_0x34ac('0x6'));var config=require(_0x34ac('0x7'));var jayson=require(_0x34ac('0x8'));var client=jayson[_0x34ac('0x9')][_0x34ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x310cea,_0x5c6e2d,_0xce992){return new BPromise(function(_0x2ed78f,_0x31707e){return client[_0x34ac('0xb')](_0x310cea,_0xce992)['then'](function(_0x9c0f5e){logger[_0x34ac('0xc')](_0x34ac('0xd'),_0x5c6e2d,_0x34ac('0xe'));logger['debug'](_0x34ac('0xf'),_0x5c6e2d,_0x34ac('0xe'),JSON['stringify'](_0x9c0f5e));if(_0x9c0f5e['error']){if(_0x9c0f5e['error'][_0x34ac('0x10')]===0x1f4){logger[_0x34ac('0x11')](_0x34ac('0xd'),_0x5c6e2d,_0x9c0f5e[_0x34ac('0x11')][_0x34ac('0x12')]);return _0x31707e(_0x9c0f5e[_0x34ac('0x11')]['message']);}logger['error'](_0x34ac('0xd'),_0x5c6e2d,_0x9c0f5e[_0x34ac('0x11')][_0x34ac('0x12')]);return _0x2ed78f(_0x9c0f5e[_0x34ac('0x11')][_0x34ac('0x12')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x5c6e2d,_0x34ac('0xe'));_0x2ed78f(_0x9c0f5e[_0x34ac('0x13')][_0x34ac('0x12')]);}})[_0x34ac('0x14')](function(_0x37b320){logger[_0x34ac('0x11')](_0x34ac('0xd'),_0x5c6e2d,_0x37b320);_0x31707e(_0x37b320);});});}exports[_0x34ac('0x15')]=function(_0x3800e4){var _0x2f4264=this;return new Promise(function(_0x2590bb,_0x431e36){return db[_0x34ac('0x16')][_0x34ac('0x17')]({'raw':_0x3800e4[_0x34ac('0x18')]?_0x3800e4[_0x34ac('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3800e4['options']?_0x3800e4[_0x34ac('0x18')]['where']||null:null,'attributes':_0x3800e4[_0x34ac('0x18')]?_0x3800e4[_0x34ac('0x18')][_0x34ac('0x19')]||null:null,'limit':_0x3800e4[_0x34ac('0x18')]?_0x3800e4[_0x34ac('0x18')][_0x34ac('0x1a')]||null:null,'include':_0x3800e4['options']?_0x3800e4[_0x34ac('0x18')][_0x34ac('0x1b')]?_[_0x34ac('0x1c')](_0x3800e4[_0x34ac('0x18')]['include'],function(_0x33dff3){return{'model':db[_0x33dff3[_0x34ac('0x1d')]],'as':_0x33dff3['as'],'attributes':_0x33dff3[_0x34ac('0x19')],'include':_0x33dff3[_0x34ac('0x1b')]?_[_0x34ac('0x1c')](_0x33dff3['include'],function(_0x30843c){return{'model':db[_0x30843c[_0x34ac('0x1d')]],'as':_0x30843c['as'],'attributes':_0x30843c['attributes'],'include':_0x30843c[_0x34ac('0x1b')]?_['map'](_0x30843c[_0x34ac('0x1b')],function(_0x3c5ea1){return{'model':db[_0x3c5ea1[_0x34ac('0x1d')]],'as':_0x3c5ea1['as'],'attributes':_0x3c5ea1[_0x34ac('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46741e){logger[_0x34ac('0xc')](_0x34ac('0x15'),_0x3800e4);logger[_0x34ac('0x1e')](_0x34ac('0x15'),_0x3800e4,JSON['stringify'](_0x46741e));_0x2590bb(_0x46741e);})['catch'](function(_0x3be2ef){logger[_0x34ac('0x11')](_0x34ac('0x15'),_0x3be2ef[_0x34ac('0x12')],_0x3800e4);_0x431e36(_0x2f4264[_0x34ac('0x11')](0x1f4,_0x3be2ef['message']));});});};exports[_0x34ac('0x1f')]=function(_0xc33ad7){var _0x280438=this;return new Promise(function(_0x2e46e6,_0x9f8770){return db['VoiceCallReport'][_0x34ac('0x20')](_0xc33ad7['body'],{'raw':_0xc33ad7[_0x34ac('0x18')]?_0xc33ad7['options'][_0x34ac('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x2314fc){logger[_0x34ac('0xc')]('CreateVoiceCallReport',_0xc33ad7);logger[_0x34ac('0x1e')]('CreateVoiceCallReport',_0xc33ad7,JSON[_0x34ac('0x22')](_0x2314fc));_0x2e46e6(_0x2314fc);})[_0x34ac('0x14')](function(_0xa87e7a){logger[_0x34ac('0x11')](_0x34ac('0x1f'),_0xa87e7a['message'],_0xc33ad7);_0x9f8770(_0x280438['error'](0x1f4,_0xa87e7a['message']));});});};exports[_0x34ac('0x23')]=function(_0x54cecb){var _0x4a5846=this;return new Promise(function(_0x3360dc,_0x3b3e9b){return db[_0x34ac('0x16')][_0x34ac('0x24')](_0x54cecb['body'],{'raw':_0x54cecb[_0x34ac('0x18')]?_0x54cecb[_0x34ac('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54cecb[_0x34ac('0x18')]?_0x54cecb['options'][_0x34ac('0x25')]||null:null,'attributes':_0x54cecb[_0x34ac('0x18')]?_0x54cecb[_0x34ac('0x18')]['attributes']||null:null,'limit':_0x54cecb[_0x34ac('0x18')]?_0x54cecb[_0x34ac('0x18')][_0x34ac('0x1a')]||null:null})[_0x34ac('0x26')](function(_0x4d3510){logger[_0x34ac('0xc')](_0x34ac('0x23'),_0x54cecb);logger[_0x34ac('0x1e')](_0x34ac('0x23'),_0x54cecb,JSON[_0x34ac('0x22')](_0x4d3510));_0x3360dc(_0x4d3510);})[_0x34ac('0x14')](function(_0x2b494c){logger[_0x34ac('0x11')]('UpdateVoiceCallReport',_0x2b494c[_0x34ac('0x12')],_0x54cecb);_0x3b3e9b(_0x4a5846[_0x34ac('0x11')](0x1f4,_0x2b494c[_0x34ac('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index ea6f8d6..5ef55a4 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 _0xbdfc=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','show','post','put','/:id','update','delete','exports','multer','util','connect-timeout','express'];(function(_0xae1475,_0x24fc8b){var _0x1f5d5e=function(_0x2385b6){while(--_0x2385b6){_0xae1475['push'](_0xae1475['shift']());}};_0x1f5d5e(++_0x24fc8b);}(_0xbdfc,0x68));var _0xcbdf=function(_0x4f2b6a,_0x40583f){_0x4f2b6a=_0x4f2b6a-0x0;var _0x140925=_0xbdfc[_0x4f2b6a];return _0x140925;};'use strict';var multer=require(_0xcbdf('0x0'));var util=require(_0xcbdf('0x1'));var path=require('path');var timeout=require(_0xcbdf('0x2'));var express=require(_0xcbdf('0x3'));var router=express[_0xcbdf('0x4')]();var fs_extra=require(_0xcbdf('0x5'));var auth=require(_0xcbdf('0x6'));var interaction=require(_0xcbdf('0x7'));var config=require('../../config/environment');var controller=require(_0xcbdf('0x8'));router[_0xcbdf('0x9')]('/',auth[_0xcbdf('0xa')](),controller['index']);router[_0xcbdf('0x9')]('/:id',auth[_0xcbdf('0xa')](),controller[_0xcbdf('0xb')]);router[_0xcbdf('0xc')]('/',auth[_0xcbdf('0xa')](),controller['create']);router[_0xcbdf('0xd')](_0xcbdf('0xe'),auth['isAuthenticated'](),controller[_0xcbdf('0xf')]);router[_0xcbdf('0x10')](_0xcbdf('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xcbdf('0x11')]=router; \ No newline at end of file +var _0x7079=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x8c2c37,_0x45f7bb){var _0x4d32ce=function(_0x55c589){while(--_0x55c589){_0x8c2c37['push'](_0x8c2c37['shift']());}};_0x4d32ce(++_0x45f7bb);}(_0x7079,0x1eb));var _0x9707=function(_0x5b31b9,_0x50edd7){_0x5b31b9=_0x5b31b9-0x0;var _0x4f9e60=_0x7079[_0x5b31b9];return _0x4f9e60;};'use strict';var multer=require('multer');var util=require(_0x9707('0x0'));var path=require(_0x9707('0x1'));var timeout=require(_0x9707('0x2'));var express=require(_0x9707('0x3'));var router=express[_0x9707('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9707('0x5'));var interaction=require(_0x9707('0x6'));var config=require(_0x9707('0x7'));var controller=require('./voiceChanSpy.controller');router[_0x9707('0x8')]('/',auth[_0x9707('0x9')](),controller[_0x9707('0xa')]);router['get'](_0x9707('0xb'),auth['isAuthenticated'](),controller[_0x9707('0xc')]);router[_0x9707('0xd')]('/',auth['isAuthenticated'](),controller[_0x9707('0xe')]);router[_0x9707('0xf')](_0x9707('0xb'),auth[_0x9707('0x9')](),controller['update']);router[_0x9707('0x10')]('/:id',auth[_0x9707('0x9')](),controller[_0x9707('0x11')]);module[_0x9707('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 21d8fcb..c137dd5 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 _0x2a76=['join','getDataValue','split','BOOLEAN','exports','STRING','name','options'];(function(_0x49e02c,_0x88247){var _0xa40e64=function(_0x5c202a){while(--_0x5c202a){_0x49e02c['push'](_0x49e02c['shift']());}};_0xa40e64(++_0x88247);}(_0x2a76,0xcc));var _0x62a7=function(_0x498fea,_0x3e2bab){_0x498fea=_0x498fea-0x0;var _0x10f3ee=_0x2a76[_0x498fea];return _0x10f3ee;};'use strict';var Sequelize=require('sequelize');module[_0x62a7('0x0')]={'name':{'type':Sequelize[_0x62a7('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x62a7('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x62a7('0x1')],'set':function(_0x5e6993){this['setDataValue'](_0x62a7('0x3'),_0x5e6993?_0x5e6993[_0x62a7('0x4')](''):[]);},'get':function(){return this[_0x62a7('0x5')](_0x62a7('0x3'))?this['getDataValue'](_0x62a7('0x3'))[_0x62a7('0x6')](''):[];}},'auth':{'type':Sequelize[_0x62a7('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x62a7('0x1')]},'record':{'type':Sequelize[_0x62a7('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x62a7('0x1')]},'description':{'type':Sequelize[_0x62a7('0x1')]}}; \ No newline at end of file +var _0xa1ff=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options'];(function(_0x22a716,_0x14793b){var _0x45c97f=function(_0x20b1f7){while(--_0x20b1f7){_0x22a716['push'](_0x22a716['shift']());}};_0x45c97f(++_0x14793b);}(_0xa1ff,0x1c5));var _0xfa1f=function(_0x31d1d7,_0x54bc7c){_0x31d1d7=_0x31d1d7-0x0;var _0x328ad2=_0xa1ff[_0x31d1d7];return _0x328ad2;};'use strict';var Sequelize=require(_0xfa1f('0x0'));module[_0xfa1f('0x1')]={'name':{'type':Sequelize[_0xfa1f('0x2')]},'prefix':{'type':Sequelize[_0xfa1f('0x2')],'unique':_0xfa1f('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xfa1f('0x2')],'set':function(_0x2f7be9){this[_0xfa1f('0x4')]('options',_0x2f7be9?_0x2f7be9['join'](''):[]);},'get':function(){return this['getDataValue'](_0xfa1f('0x5'))?this[_0xfa1f('0x6')](_0xfa1f('0x5'))[_0xfa1f('0x7')](''):[];}},'auth':{'type':Sequelize[_0xfa1f('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xfa1f('0x2')]},'record':{'type':Sequelize[_0xfa1f('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xfa1f('0x2')]},'description':{'type':Sequelize[_0xfa1f('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 9ef8cb9..9524450 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 _0x49e9=['key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','get','ChanSpies','UserProfileResource','error','name','index','map','VoiceChanSpy','rawAttributes','type'];(function(_0x58c86a,_0x602654){var _0x2bb374=function(_0x1302a9){while(--_0x1302a9){_0x58c86a['push'](_0x58c86a['shift']());}};_0x2bb374(++_0x602654);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x949e('0x0'));var rimraf=require(_0x949e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x949e('0x2'));var rp=require(_0x949e('0x3'));var moment=require(_0x949e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x949e('0x5'));var path=require('path');var sox=require(_0x949e('0x6'));var csv=require(_0x949e('0x7'));var ejs=require(_0x949e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x949e('0x9'));var squel=require(_0x949e('0xa'));var crypto=require(_0x949e('0xb'));var jsforce=require(_0x949e('0xc'));var deskjs=require(_0x949e('0xd'));var toCsv=require(_0x949e('0x7'));var querystring=require(_0x949e('0xe'));var Papa=require('papaparse');var Redis=require(_0x949e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x949e('0x10'));var as=require(_0x949e('0x11'));var hardwareService=require(_0x949e('0x12'));var logger=require('../../config/logger')(_0x949e('0x13'));var utils=require(_0x949e('0x14'));var config=require(_0x949e('0x15'));var licenseUtil=require(_0x949e('0x16'));var db=require(_0x949e('0x17'))['db'];function respondWithStatusCode(_0x253d5e,_0x1871a5){_0x1871a5=_0x1871a5||0xcc;return function(_0x17d1f3){if(_0x17d1f3){return _0x253d5e[_0x949e('0x18')](_0x1871a5);}return _0x253d5e[_0x949e('0x19')](_0x1871a5)[_0x949e('0x1a')]();};}function respondWithResult(_0x7a8954,_0x3e0e54){_0x3e0e54=_0x3e0e54||0xc8;return function(_0x7f8be2){if(_0x7f8be2){return _0x7a8954[_0x949e('0x19')](_0x3e0e54)['json'](_0x7f8be2);}};}function respondWithFilteredResult(_0x257981,_0x3d81cd){return function(_0x587bff){if(_0x587bff){var _0xf1f41a=typeof _0x3d81cd['offset']===_0x949e('0x1b')&&typeof _0x3d81cd[_0x949e('0x1c')]==='undefined';var _0x37fd96=_0x587bff[_0x949e('0x1d')];var _0x43498d=_0xf1f41a?0x0:_0x3d81cd[_0x949e('0x1e')];var _0x20333c=_0xf1f41a?_0x587bff['count']:_0x3d81cd[_0x949e('0x1e')]+_0x3d81cd[_0x949e('0x1c')];var _0x476fa8;if(_0x20333c>=_0x37fd96){_0x20333c=_0x37fd96;_0x476fa8=0xc8;}else{_0x476fa8=0xce;}_0x257981[_0x949e('0x19')](_0x476fa8);return _0x257981[_0x949e('0x1f')](_0x949e('0x20'),_0x43498d+'-'+_0x20333c+'/'+_0x37fd96)[_0x949e('0x21')](_0x587bff);}return null;};}function patchUpdates(_0x2f21bd){return function(_0x104740){try{jsonpatch[_0x949e('0x22')](_0x104740,_0x2f21bd,!![]);}catch(_0x23fc20){return BPromise[_0x949e('0x23')](_0x23fc20);}return _0x104740[_0x949e('0x24')]();};}function saveUpdates(_0x1927ab,_0x199d53){return function(_0x2e81f2){if(_0x2e81f2){return _0x2e81f2['update'](_0x1927ab)[_0x949e('0x25')](function(_0x44ffb4){return _0x44ffb4;});}return null;};}function removeEntity(_0x5572ae,_0x48a1d1){return function(_0x23b38e){if(_0x23b38e){return _0x23b38e[_0x949e('0x26')]()[_0x949e('0x25')](function(){var _0x36c890=_0x23b38e[_0x949e('0x27')]({'plain':!![]});var _0x1185b3=_0x949e('0x28');return db[_0x949e('0x29')][_0x949e('0x26')]({'where':{'type':_0x1185b3,'resourceId':_0x36c890['id']}})[_0x949e('0x25')](function(){return _0x23b38e;});})['then'](function(){_0x5572ae[_0x949e('0x19')](0xcc)[_0x949e('0x1a')]();});}};}function handleEntityNotFound(_0x59b3a1,_0x39308f){return function(_0x20061d){if(!_0x20061d){_0x59b3a1['sendStatus'](0x194);}return _0x20061d;};}function handleError(_0x446401,_0x36dc1d){_0x36dc1d=_0x36dc1d||0x1f4;return function(_0x5b9f28){logger[_0x949e('0x2a')](_0x5b9f28['stack']);if(_0x5b9f28['name']){delete _0x5b9f28[_0x949e('0x2b')];}_0x446401['status'](_0x36dc1d)['send'](_0x5b9f28);};}exports[_0x949e('0x2c')]=function(_0x3502c1,_0x3051ec){var _0x4c890f={},_0x4ca7ae={},_0x56dc85={'count':0x0,'rows':[]};var _0x4eddbd=_[_0x949e('0x2d')](db[_0x949e('0x2e')][_0x949e('0x2f')],function(_0x1fe31b){return{'name':_0x1fe31b['fieldName'],'type':_0x1fe31b[_0x949e('0x30')][_0x949e('0x31')]};});_0x4ca7ae[_0x949e('0x32')]=_['map'](_0x4eddbd,_0x949e('0x2b'));_0x4ca7ae[_0x949e('0x33')]=_[_0x949e('0x34')](_0x3502c1['query']);_0x4ca7ae['filters']=_[_0x949e('0x35')](_0x4ca7ae[_0x949e('0x32')],_0x4ca7ae[_0x949e('0x33')]);_0x4c890f[_0x949e('0x36')]=_['intersection'](_0x4ca7ae[_0x949e('0x32')],qs[_0x949e('0x37')](_0x3502c1[_0x949e('0x33')][_0x949e('0x37')]));_0x4c890f[_0x949e('0x36')]=_0x4c890f[_0x949e('0x36')][_0x949e('0x38')]?_0x4c890f[_0x949e('0x36')]:_0x4ca7ae['model'];if(!_0x3502c1['query'][_0x949e('0x39')]('nolimit')){_0x4c890f['limit']=qs[_0x949e('0x1c')](_0x3502c1[_0x949e('0x33')][_0x949e('0x1c')]);_0x4c890f[_0x949e('0x1e')]=qs[_0x949e('0x1e')](_0x3502c1[_0x949e('0x33')][_0x949e('0x1e')]);}_0x4c890f[_0x949e('0x3a')]=qs[_0x949e('0x3b')](_0x3502c1[_0x949e('0x33')][_0x949e('0x3b')]);_0x4c890f[_0x949e('0x3c')]=qs[_0x949e('0x3d')](_[_0x949e('0x3e')](_0x3502c1[_0x949e('0x33')],_0x4ca7ae[_0x949e('0x3d')]),_0x4eddbd);if(_0x3502c1[_0x949e('0x33')]['filter']){_0x4c890f[_0x949e('0x3c')]=_['merge'](_0x4c890f[_0x949e('0x3c')],{'$or':_[_0x949e('0x2d')](_0x4eddbd,function(_0x53629d){if(_0x53629d['type']!=='VIRTUAL'){var _0x1e848c={};_0x1e848c[_0x53629d[_0x949e('0x2b')]]={'$like':'%'+_0x3502c1['query']['filter']+'%'};return _0x1e848c;}})});}_0x4c890f=_['merge']({},_0x4c890f,_0x3502c1[_0x949e('0x3f')]);var _0x2bd51b={'where':_0x4c890f['where']};return db[_0x949e('0x2e')][_0x949e('0x1d')](_0x2bd51b)['then'](function(_0x3a1bc7){_0x56dc85[_0x949e('0x1d')]=_0x3a1bc7;if(_0x3502c1[_0x949e('0x33')][_0x949e('0x40')]){_0x4c890f['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0x949e('0x41')](_0x4c890f);})[_0x949e('0x25')](function(_0x7201da){_0x56dc85[_0x949e('0x42')]=_0x7201da;return _0x56dc85;})[_0x949e('0x25')](respondWithFilteredResult(_0x3051ec,_0x4c890f))[_0x949e('0x43')](handleError(_0x3051ec,null));};exports[_0x949e('0x44')]=function(_0x572f20,_0x4c7d73){var _0x985ff8={'raw':![],'where':{'id':_0x572f20[_0x949e('0x45')]['id']}},_0x5e970b={};_0x5e970b[_0x949e('0x32')]=_[_0x949e('0x34')](db[_0x949e('0x2e')][_0x949e('0x2f')]);_0x5e970b[_0x949e('0x33')]=_['keys'](_0x572f20['query']);_0x5e970b[_0x949e('0x3d')]=_[_0x949e('0x35')](_0x5e970b[_0x949e('0x32')],_0x5e970b[_0x949e('0x33')]);_0x985ff8[_0x949e('0x36')]=_['intersection'](_0x5e970b[_0x949e('0x32')],qs[_0x949e('0x37')](_0x572f20['query'][_0x949e('0x37')]));_0x985ff8[_0x949e('0x36')]=_0x985ff8[_0x949e('0x36')][_0x949e('0x38')]?_0x985ff8[_0x949e('0x36')]:_0x5e970b[_0x949e('0x32')];if(_0x572f20[_0x949e('0x33')][_0x949e('0x40')]){_0x985ff8[_0x949e('0x46')]=[{'all':!![]}];}_0x985ff8=_['merge']({},_0x985ff8,_0x572f20[_0x949e('0x3f')]);return db['VoiceChanSpy'][_0x949e('0x47')](_0x985ff8)[_0x949e('0x25')](handleEntityNotFound(_0x4c7d73,null))['then'](respondWithResult(_0x4c7d73,null))[_0x949e('0x43')](handleError(_0x4c7d73,null));};exports[_0x949e('0x48')]=function(_0x121355,_0x2e2b6a){return db[_0x949e('0x2e')][_0x949e('0x48')](_0x121355[_0x949e('0x49')],{})[_0x949e('0x25')](function(_0x5d4348){var _0x8f2a58=_0x121355[_0x949e('0x4a')][_0x949e('0x27')]({'plain':!![]});if(!_0x8f2a58)throw new Error(_0x949e('0x4b'));if(_0x8f2a58[_0x949e('0x4c')]==='user'){var _0x5f23b2=_0x5d4348[_0x949e('0x27')]({'plain':!![]});var _0x16f5ad='ChanSpies';return db[_0x949e('0x4d')][_0x949e('0x47')]({'where':{'name':_0x16f5ad,'userProfileId':_0x8f2a58[_0x949e('0x4e')]},'raw':!![]})[_0x949e('0x25')](function(_0x48c677){if(_0x48c677&&_0x48c677['autoAssociation']===0x0){return db[_0x949e('0x29')][_0x949e('0x48')]({'name':_0x5f23b2[_0x949e('0x2b')],'resourceId':_0x5f23b2['id'],'type':_0x48c677[_0x949e('0x2b')],'sectionId':_0x48c677['id']},{})[_0x949e('0x25')](function(){return _0x5d4348;});}else{return _0x5d4348;}})[_0x949e('0x43')](function(_0x29ebb6){logger[_0x949e('0x2a')](_0x949e('0x4f'),_0x29ebb6);throw _0x29ebb6;});}return _0x5d4348;})['then'](respondWithResult(_0x2e2b6a,0xc9))[_0x949e('0x43')](handleError(_0x2e2b6a,null));};exports['update']=function(_0x2f63aa,_0x4fb3d5){if(_0x2f63aa[_0x949e('0x49')]['id']){delete _0x2f63aa['body']['id'];}return db[_0x949e('0x2e')][_0x949e('0x47')]({'where':{'id':_0x2f63aa['params']['id']}})[_0x949e('0x25')](handleEntityNotFound(_0x4fb3d5,null))[_0x949e('0x25')](saveUpdates(_0x2f63aa[_0x949e('0x49')],null))[_0x949e('0x25')](respondWithResult(_0x4fb3d5,null))[_0x949e('0x43')](handleError(_0x4fb3d5,null));};exports['destroy']=function(_0x48a016,_0x287a45){return db[_0x949e('0x2e')]['find']({'where':{'id':_0x48a016[_0x949e('0x45')]['id']}})[_0x949e('0x25')](handleEntityNotFound(_0x287a45,null))['then'](removeEntity(_0x287a45,null))[_0x949e('0x43')](handleError(_0x287a45,null));}; \ No newline at end of file +var _0x2547=['../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','error','stack','name','send','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','map','options','includeAll','findAll','rows','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3f6aba,_0x998f68){var _0x44ea93=function(_0x323036){while(--_0x323036){_0x3f6aba['push'](_0x3f6aba['shift']());}};_0x44ea93(++_0x998f68);}(_0x2547,0x1cd));var _0x7254=function(_0x262e80,_0x49dc41){_0x262e80=_0x262e80-0x0;var _0x1d542c=_0x2547[_0x262e80];return _0x1d542c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7254('0x0'));var zipdir=require(_0x7254('0x1'));var jsonpatch=require(_0x7254('0x2'));var rp=require(_0x7254('0x3'));var moment=require(_0x7254('0x4'));var BPromise=require(_0x7254('0x5'));var Mustache=require(_0x7254('0x6'));var util=require(_0x7254('0x7'));var path=require('path');var sox=require(_0x7254('0x8'));var csv=require(_0x7254('0x9'));var ejs=require(_0x7254('0xa'));var fs=require('fs');var fs_extra=require(_0x7254('0xb'));var _=require('lodash');var squel=require(_0x7254('0xc'));var crypto=require(_0x7254('0xd'));var jsforce=require(_0x7254('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7254('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7254('0xf'));var qs=require(_0x7254('0x10'));var as=require(_0x7254('0x11'));var hardwareService=require(_0x7254('0x12'));var logger=require(_0x7254('0x13'))(_0x7254('0x14'));var utils=require('../../config/utils');var config=require(_0x7254('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7254('0x16'))['db'];function respondWithStatusCode(_0x53fc4f,_0x16c08e){_0x16c08e=_0x16c08e||0xcc;return function(_0x2bfff8){if(_0x2bfff8){return _0x53fc4f[_0x7254('0x17')](_0x16c08e);}return _0x53fc4f[_0x7254('0x18')](_0x16c08e)[_0x7254('0x19')]();};}function respondWithResult(_0x395a8a,_0x124192){_0x124192=_0x124192||0xc8;return function(_0x21cecc){if(_0x21cecc){return _0x395a8a[_0x7254('0x18')](_0x124192)[_0x7254('0x1a')](_0x21cecc);}};}function respondWithFilteredResult(_0x38a99c,_0x1ee5cb){return function(_0x163c8c){if(_0x163c8c){var _0x535065=typeof _0x1ee5cb[_0x7254('0x1b')]===_0x7254('0x1c')&&typeof _0x1ee5cb[_0x7254('0x1d')]===_0x7254('0x1c');var _0x3b5f06=_0x163c8c[_0x7254('0x1e')];var _0x2737e0=_0x535065?0x0:_0x1ee5cb['offset'];var _0x1f48f6=_0x535065?_0x163c8c[_0x7254('0x1e')]:_0x1ee5cb[_0x7254('0x1b')]+_0x1ee5cb[_0x7254('0x1d')];var _0x2a1ddc;if(_0x1f48f6>=_0x3b5f06){_0x1f48f6=_0x3b5f06;_0x2a1ddc=0xc8;}else{_0x2a1ddc=0xce;}_0x38a99c[_0x7254('0x18')](_0x2a1ddc);return _0x38a99c[_0x7254('0x1f')](_0x7254('0x20'),_0x2737e0+'-'+_0x1f48f6+'/'+_0x3b5f06)[_0x7254('0x1a')](_0x163c8c);}return null;};}function patchUpdates(_0x3b6cb6){return function(_0x2594b8){try{jsonpatch[_0x7254('0x21')](_0x2594b8,_0x3b6cb6,!![]);}catch(_0xc617b6){return BPromise[_0x7254('0x22')](_0xc617b6);}return _0x2594b8[_0x7254('0x23')]();};}function saveUpdates(_0x95ceaa,_0x2bb2fe){return function(_0x46c0a2){if(_0x46c0a2){return _0x46c0a2[_0x7254('0x24')](_0x95ceaa)[_0x7254('0x25')](function(_0x1be69b){return _0x1be69b;});}return null;};}function removeEntity(_0x50c34b,_0x493bfd){return function(_0x136ea3){if(_0x136ea3){return _0x136ea3[_0x7254('0x26')]()[_0x7254('0x25')](function(){var _0x54dace=_0x136ea3[_0x7254('0x27')]({'plain':!![]});var _0x36b5d5=_0x7254('0x28');return db['UserProfileResource'][_0x7254('0x26')]({'where':{'type':_0x36b5d5,'resourceId':_0x54dace['id']}})[_0x7254('0x25')](function(){return _0x136ea3;});})[_0x7254('0x25')](function(){_0x50c34b['status'](0xcc)[_0x7254('0x19')]();});}};}function handleEntityNotFound(_0x594a63,_0x1bb6a7){return function(_0x134a9e){if(!_0x134a9e){_0x594a63['sendStatus'](0x194);}return _0x134a9e;};}function handleError(_0x17bb46,_0x158356){_0x158356=_0x158356||0x1f4;return function(_0x4f684c){logger[_0x7254('0x29')](_0x4f684c[_0x7254('0x2a')]);if(_0x4f684c[_0x7254('0x2b')]){delete _0x4f684c[_0x7254('0x2b')];}_0x17bb46[_0x7254('0x18')](_0x158356)[_0x7254('0x2c')](_0x4f684c);};}exports['index']=function(_0x146028,_0x2dba3f){var _0x5569be={},_0x2f75ea={},_0x1279cd={'count':0x0,'rows':[]};var _0x2be5fc=_['map'](db[_0x7254('0x2d')][_0x7254('0x2e')],function(_0x354305){return{'name':_0x354305[_0x7254('0x2f')],'type':_0x354305[_0x7254('0x30')][_0x7254('0x31')]};});_0x2f75ea[_0x7254('0x32')]=_['map'](_0x2be5fc,_0x7254('0x2b'));_0x2f75ea['query']=_['keys'](_0x146028[_0x7254('0x33')]);_0x2f75ea[_0x7254('0x34')]=_[_0x7254('0x35')](_0x2f75ea[_0x7254('0x32')],_0x2f75ea[_0x7254('0x33')]);_0x5569be[_0x7254('0x36')]=_[_0x7254('0x35')](_0x2f75ea[_0x7254('0x32')],qs[_0x7254('0x37')](_0x146028[_0x7254('0x33')][_0x7254('0x37')]));_0x5569be[_0x7254('0x36')]=_0x5569be[_0x7254('0x36')][_0x7254('0x38')]?_0x5569be['attributes']:_0x2f75ea[_0x7254('0x32')];if(!_0x146028[_0x7254('0x33')][_0x7254('0x39')](_0x7254('0x3a'))){_0x5569be[_0x7254('0x1d')]=qs['limit'](_0x146028[_0x7254('0x33')]['limit']);_0x5569be[_0x7254('0x1b')]=qs[_0x7254('0x1b')](_0x146028[_0x7254('0x33')][_0x7254('0x1b')]);}_0x5569be[_0x7254('0x3b')]=qs['sort'](_0x146028[_0x7254('0x33')]['sort']);_0x5569be[_0x7254('0x3c')]=qs[_0x7254('0x34')](_['pick'](_0x146028[_0x7254('0x33')],_0x2f75ea[_0x7254('0x34')]),_0x2be5fc);if(_0x146028[_0x7254('0x33')][_0x7254('0x3d')]){_0x5569be[_0x7254('0x3c')]=_[_0x7254('0x3e')](_0x5569be['where'],{'$or':_[_0x7254('0x3f')](_0x2be5fc,function(_0x102d87){if(_0x102d87[_0x7254('0x30')]!=='VIRTUAL'){var _0x3fbad7={};_0x3fbad7[_0x102d87[_0x7254('0x2b')]]={'$like':'%'+_0x146028[_0x7254('0x33')]['filter']+'%'};return _0x3fbad7;}})});}_0x5569be=_[_0x7254('0x3e')]({},_0x5569be,_0x146028[_0x7254('0x40')]);var _0x18a918={'where':_0x5569be[_0x7254('0x3c')]};return db[_0x7254('0x2d')]['count'](_0x18a918)['then'](function(_0x25004f){_0x1279cd[_0x7254('0x1e')]=_0x25004f;if(_0x146028[_0x7254('0x33')][_0x7254('0x41')]){_0x5569be['include']=[{'all':!![]}];}return db['VoiceChanSpy'][_0x7254('0x42')](_0x5569be);})['then'](function(_0x2ae22e){_0x1279cd[_0x7254('0x43')]=_0x2ae22e;return _0x1279cd;})[_0x7254('0x25')](respondWithFilteredResult(_0x2dba3f,_0x5569be))[_0x7254('0x44')](handleError(_0x2dba3f,null));};exports['show']=function(_0x4adf34,_0x467f31){var _0x3f6ead={'raw':![],'where':{'id':_0x4adf34[_0x7254('0x45')]['id']}},_0x29b90c={};_0x29b90c[_0x7254('0x32')]=_['keys'](db['VoiceChanSpy'][_0x7254('0x2e')]);_0x29b90c[_0x7254('0x33')]=_[_0x7254('0x46')](_0x4adf34['query']);_0x29b90c[_0x7254('0x34')]=_[_0x7254('0x35')](_0x29b90c['model'],_0x29b90c[_0x7254('0x33')]);_0x3f6ead[_0x7254('0x36')]=_[_0x7254('0x35')](_0x29b90c[_0x7254('0x32')],qs['fields'](_0x4adf34[_0x7254('0x33')][_0x7254('0x37')]));_0x3f6ead['attributes']=_0x3f6ead[_0x7254('0x36')][_0x7254('0x38')]?_0x3f6ead[_0x7254('0x36')]:_0x29b90c['model'];if(_0x4adf34[_0x7254('0x33')][_0x7254('0x41')]){_0x3f6ead['include']=[{'all':!![]}];}_0x3f6ead=_['merge']({},_0x3f6ead,_0x4adf34[_0x7254('0x40')]);return db['VoiceChanSpy'][_0x7254('0x47')](_0x3f6ead)[_0x7254('0x25')](handleEntityNotFound(_0x467f31,null))['then'](respondWithResult(_0x467f31,null))['catch'](handleError(_0x467f31,null));};exports[_0x7254('0x48')]=function(_0xc40bc5,_0x38bcd5){return db[_0x7254('0x2d')][_0x7254('0x48')](_0xc40bc5[_0x7254('0x49')],{})['then'](function(_0x245213){var _0x5ef7f9=_0xc40bc5[_0x7254('0x4a')][_0x7254('0x27')]({'plain':!![]});if(!_0x5ef7f9)throw new Error(_0x7254('0x4b'));if(_0x5ef7f9['role']===_0x7254('0x4a')){var _0x1c1a0e=_0x245213[_0x7254('0x27')]({'plain':!![]});var _0x5b3b6e=_0x7254('0x28');return db[_0x7254('0x4c')][_0x7254('0x47')]({'where':{'name':_0x5b3b6e,'userProfileId':_0x5ef7f9[_0x7254('0x4d')]},'raw':!![]})[_0x7254('0x25')](function(_0x4e1e38){if(_0x4e1e38&&_0x4e1e38['autoAssociation']===0x0){return db[_0x7254('0x4e')][_0x7254('0x48')]({'name':_0x1c1a0e[_0x7254('0x2b')],'resourceId':_0x1c1a0e['id'],'type':_0x4e1e38[_0x7254('0x2b')],'sectionId':_0x4e1e38['id']},{})[_0x7254('0x25')](function(){return _0x245213;});}else{return _0x245213;}})['catch'](function(_0x5a44fb){logger[_0x7254('0x29')](_0x7254('0x4f'),_0x5a44fb);throw _0x5a44fb;});}return _0x245213;})[_0x7254('0x25')](respondWithResult(_0x38bcd5,0xc9))[_0x7254('0x44')](handleError(_0x38bcd5,null));};exports['update']=function(_0xaf6d3d,_0x3e3d09){if(_0xaf6d3d['body']['id']){delete _0xaf6d3d[_0x7254('0x49')]['id'];}return db['VoiceChanSpy'][_0x7254('0x47')]({'where':{'id':_0xaf6d3d['params']['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x3e3d09,null))['then'](saveUpdates(_0xaf6d3d['body'],null))[_0x7254('0x25')](respondWithResult(_0x3e3d09,null))[_0x7254('0x44')](handleError(_0x3e3d09,null));};exports[_0x7254('0x26')]=function(_0x1122e8,_0x4f6c9f){return db[_0x7254('0x2d')]['find']({'where':{'id':_0x1122e8[_0x7254('0x45')]['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x4f6c9f,null))[_0x7254('0x25')](removeEntity(_0x4f6c9f,null))[_0x7254('0x44')](handleError(_0x4f6c9f,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 8a66e23..b47611f 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 _0xdf99=['StopMixMonitor','length','internal','concat','User','exports','models','define','VoiceChanSpy','then','VoiceExtension','destroy','catch','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','push','merge','MixMonitor','${UNIQUEID}.%s,a','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','record'];(function(_0x38ccf2,_0x1bdfec){var _0x3425eb=function(_0xd86255){while(--_0xd86255){_0x38ccf2['push'](_0x38ccf2['shift']());}};_0x3425eb(++_0x1bdfec);}(_0xdf99,0x161));var _0x9df9=function(_0x19f9e6,_0x4f59a6){_0x19f9e6=_0x19f9e6-0x0;var _0x45c862=_0xdf99[_0x19f9e6];return _0x45c862;};'use strict';var _=require(_0x9df9('0x0'));var util=require(_0x9df9('0x1'));var BPromise=require(_0x9df9('0x2'));var attributes=require(_0x9df9('0x3'));var getUserApplications=function(_0x292fcd,_0x790a2a,_0x5bbfc5){var _0x28482b=0x1;var _0x2932cd=[];var _0x4176ba={'context':_0x790a2a[_0x9df9('0x4')]||_0x9df9('0x5'),'exten':util[_0x9df9('0x6')](_0x9df9('0x7'),_0x292fcd[_0x9df9('0x8')],_0x5bbfc5),'type':'system','isApp':![],'ChanSpyId':_0x292fcd['id'],'UserId':_0x790a2a['id']};_0x2932cd['push'](_['merge']({'app':'Set','appdata':util['format']('CDR(type)=%s','chanspy'),'priority':_0x28482b++},_0x4176ba));if(_0x292fcd['record']){_0x2932cd[_0x9df9('0x9')](_[_0x9df9('0xa')]({'app':_0x9df9('0xb'),'appdata':util[_0x9df9('0x6')](_0x9df9('0xc'),_0x292fcd['recordingFormat']),'priority':_0x28482b++},_0x4176ba));}if(_0x292fcd['auth']){_0x2932cd[_0x9df9('0x9')](_[_0x9df9('0xa')]({'app':_0x9df9('0xd'),'appdata':_0x292fcd[_0x9df9('0xe')],'priority':_0x28482b++},_0x4176ba));}_0x2932cd[_0x9df9('0x9')](_[_0x9df9('0xa')]({'app':_0x9df9('0xf'),'appdata':util[_0x9df9('0x6')](_0x9df9('0x10'),_0x790a2a[_0x9df9('0x11')],_0x292fcd['options']?_0x292fcd[_0x9df9('0x12')][_0x9df9('0x13')](''):''),'priority':_0x28482b++},_0x4176ba));if(_0x292fcd[_0x9df9('0x14')]){_0x2932cd[_0x9df9('0x9')](_['merge']({'app':_0x9df9('0x15'),'priority':_0x28482b++},_0x4176ba));}return _0x2932cd;};var getChanSpyApplications=function(_0x52ae31,_0x3bad70){var _0x53482c=[];for(var _0x3dd703=0x0,_0x33a1c3=0x1;_0x3dd703<_0x3bad70[_0x9df9('0x16')];_0x3dd703++,_0x33a1c3=0x1){_0x53482c=_0x53482c['concat'](getUserApplications(_0x52ae31,_0x3bad70[_0x3dd703],_0x3bad70[_0x3dd703][_0x9df9('0x17')]));if(_0x3bad70[_0x3dd703][_0x9df9('0x17')]!=_0x3bad70[_0x3dd703][_0x9df9('0x11')]){_0x53482c=_0x53482c[_0x9df9('0x18')](getUserApplications(_0x52ae31,_0x3bad70[_0x3dd703],_0x3bad70[_0x3dd703][_0x9df9('0x11')]));}}return _0x53482c;};var getChanSpyPromise=function(_0x362072,_0x3c41d7){return new BPromise(function(_0x3a1280,_0x384f6b){return _0x362072[_0x9df9('0x19')]['findAll']({'attributes':['id',_0x9df9('0x11'),_0x9df9('0x17')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x5eddb8){if(_0x5eddb8){return _0x3a1280(getChanSpyApplications(_0x3c41d7,_0x5eddb8));}return _0x3a1280([]);})['catch'](function(_0x497aa2){_0x384f6b(_0x497aa2);});});};module[_0x9df9('0x1a')]=function(_0x28a4c9,_0x164f7f){var _0x1fd245=_0x28a4c9[_0x9df9('0x1b')];return _0x28a4c9[_0x9df9('0x1c')](_0x9df9('0x1d'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x30e542,_0x176219,_0xda8643){return getChanSpyPromise(_0x1fd245,_0x30e542)[_0x9df9('0x1e')](function(_0x2f9ec8){if(_0x2f9ec8&&_0x2f9ec8[_0x9df9('0x16')]){return _0x1fd245[_0x9df9('0x1f')]['bulkCreate'](_0x2f9ec8);}})['then'](function(){_0xda8643();})['catch'](function(_0x51fa25){_0xda8643(_0x51fa25);});},'afterUpdate':function(_0x2fdd61,_0x2ec999,_0x2f1fd8){return _0x1fd245['VoiceExtension'][_0x9df9('0x20')]({'where':{'ChanSpyId':_0x2fdd61['id']}})[_0x9df9('0x1e')](function(){return getChanSpyPromise(_0x1fd245,_0x2fdd61);})[_0x9df9('0x1e')](function(_0x1a2b9b){if(_0x1a2b9b&&_0x1a2b9b[_0x9df9('0x16')]){return _0x1fd245[_0x9df9('0x1f')]['bulkCreate'](_0x1a2b9b);}})[_0x9df9('0x1e')](function(){_0x2f1fd8();})[_0x9df9('0x21')](function(_0x304359){_0x2f1fd8(_0x304359);});},'afterDestroy':function(_0x54e741,_0x53218b,_0x1e41e4){return _0x1fd245['VoiceExtension'][_0x9df9('0x20')]({'where':{'ChanSpyId':_0x54e741['id']}})['then'](function(){_0x1e41e4();})[_0x9df9('0x21')](function(_0x46e244){_0x1e41e4(_0x46e244);});}}});}; \ No newline at end of file +var _0x8bdc=['format','%s%s','prefix','system','merge','Set','CDR(type)=%s','record','push','MixMonitor','recordingFormat','auth','Authenticate','SIP/%s,%s','options','StopMixMonitor','length','internal','name','User','findAll','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','util','./voiceChanSpy.attributes','context','from-sip'];(function(_0x202b92,_0x5f48f5){var _0x2899f7=function(_0x489c7f){while(--_0x489c7f){_0x202b92['push'](_0x202b92['shift']());}};_0x2899f7(++_0x5f48f5);}(_0x8bdc,0xce));var _0xc8bd=function(_0x15f67d,_0x3eb8dc){_0x15f67d=_0x15f67d-0x0;var _0x21a2e4=_0x8bdc[_0x15f67d];return _0x21a2e4;};'use strict';var _=require('lodash');var util=require(_0xc8bd('0x0'));var BPromise=require('bluebird');var attributes=require(_0xc8bd('0x1'));var getUserApplications=function(_0x3bcee1,_0x5b906a,_0x18507a){var _0x336507=0x1;var _0x4f131a=[];var _0x2f7804={'context':_0x5b906a[_0xc8bd('0x2')]||_0xc8bd('0x3'),'exten':util[_0xc8bd('0x4')](_0xc8bd('0x5'),_0x3bcee1[_0xc8bd('0x6')],_0x18507a),'type':_0xc8bd('0x7'),'isApp':![],'ChanSpyId':_0x3bcee1['id'],'UserId':_0x5b906a['id']};_0x4f131a['push'](_[_0xc8bd('0x8')]({'app':_0xc8bd('0x9'),'appdata':util[_0xc8bd('0x4')](_0xc8bd('0xa'),'chanspy'),'priority':_0x336507++},_0x2f7804));if(_0x3bcee1[_0xc8bd('0xb')]){_0x4f131a[_0xc8bd('0xc')](_['merge']({'app':_0xc8bd('0xd'),'appdata':util[_0xc8bd('0x4')]('${UNIQUEID}.%s,a',_0x3bcee1[_0xc8bd('0xe')]),'priority':_0x336507++},_0x2f7804));}if(_0x3bcee1[_0xc8bd('0xf')]){_0x4f131a['push'](_[_0xc8bd('0x8')]({'app':_0xc8bd('0x10'),'appdata':_0x3bcee1['password'],'priority':_0x336507++},_0x2f7804));}_0x4f131a[_0xc8bd('0xc')](_['merge']({'app':'ChanSpy','appdata':util['format'](_0xc8bd('0x11'),_0x5b906a['name'],_0x3bcee1[_0xc8bd('0x12')]?_0x3bcee1[_0xc8bd('0x12')]['join'](''):''),'priority':_0x336507++},_0x2f7804));if(_0x3bcee1[_0xc8bd('0xb')]){_0x4f131a[_0xc8bd('0xc')](_[_0xc8bd('0x8')]({'app':_0xc8bd('0x13'),'priority':_0x336507++},_0x2f7804));}return _0x4f131a;};var getChanSpyApplications=function(_0xc4aef5,_0x54a601){var _0x1dc4ae=[];for(var _0xe61d12=0x0,_0xd4bf6c=0x1;_0xe61d12<_0x54a601[_0xc8bd('0x14')];_0xe61d12++,_0xd4bf6c=0x1){_0x1dc4ae=_0x1dc4ae['concat'](getUserApplications(_0xc4aef5,_0x54a601[_0xe61d12],_0x54a601[_0xe61d12][_0xc8bd('0x15')]));if(_0x54a601[_0xe61d12][_0xc8bd('0x15')]!=_0x54a601[_0xe61d12][_0xc8bd('0x16')]){_0x1dc4ae=_0x1dc4ae['concat'](getUserApplications(_0xc4aef5,_0x54a601[_0xe61d12],_0x54a601[_0xe61d12][_0xc8bd('0x16')]));}}return _0x1dc4ae;};var getChanSpyPromise=function(_0x1ad3c3,_0x28a5e4){return new BPromise(function(_0xf2dfaa,_0x49d555){return _0x1ad3c3[_0xc8bd('0x17')][_0xc8bd('0x18')]({'attributes':['id','name',_0xc8bd('0x15')],'where':{'role':_0xc8bd('0x19'),'chanspy':!![]},'raw':!![]})[_0xc8bd('0x1a')](function(_0x2f7937){if(_0x2f7937){return _0xf2dfaa(getChanSpyApplications(_0x28a5e4,_0x2f7937));}return _0xf2dfaa([]);})[_0xc8bd('0x1b')](function(_0x2713a9){_0x49d555(_0x2713a9);});});};module[_0xc8bd('0x1c')]=function(_0x2200b9,_0x2b9292){var _0x577a3f=_0x2200b9[_0xc8bd('0x1d')];return _0x2200b9['define'](_0xc8bd('0x1e'),attributes,{'tableName':_0xc8bd('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x10d797,_0x5e7335,_0x11e0c5){return getChanSpyPromise(_0x577a3f,_0x10d797)[_0xc8bd('0x1a')](function(_0x439280){if(_0x439280&&_0x439280['length']){return _0x577a3f[_0xc8bd('0x20')][_0xc8bd('0x21')](_0x439280);}})['then'](function(){_0x11e0c5();})['catch'](function(_0x1251db){_0x11e0c5(_0x1251db);});},'afterUpdate':function(_0x41e183,_0x35c01c,_0x550326){return _0x577a3f[_0xc8bd('0x20')][_0xc8bd('0x22')]({'where':{'ChanSpyId':_0x41e183['id']}})[_0xc8bd('0x1a')](function(){return getChanSpyPromise(_0x577a3f,_0x41e183);})[_0xc8bd('0x1a')](function(_0x1e8747){if(_0x1e8747&&_0x1e8747[_0xc8bd('0x14')]){return _0x577a3f[_0xc8bd('0x20')][_0xc8bd('0x21')](_0x1e8747);}})[_0xc8bd('0x1a')](function(){_0x550326();})[_0xc8bd('0x1b')](function(_0x37af77){_0x550326(_0x37af77);});},'afterDestroy':function(_0x4a48b2,_0xbcd1f3,_0x288203){return _0x577a3f[_0xc8bd('0x20')]['destroy']({'where':{'ChanSpyId':_0x4a48b2['id']}})[_0xc8bd('0x1a')](function(){_0x288203();})['catch'](function(_0x4a085f){_0x288203(_0x4a085f);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index c057587..31b162f 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 _0x574d=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x29f562,_0x50a039){var _0x281052=function(_0x58f622){while(--_0x58f622){_0x29f562['push'](_0x29f562['shift']());}};_0x281052(++_0x50a039);}(_0x574d,0xc0));var _0xd574=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x574d[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0xd574('0x0'));var util=require(_0xd574('0x1'));var moment=require(_0xd574('0x2'));var BPromise=require(_0xd574('0x3'));var rs=require(_0xd574('0x4'));var fs=require('fs');var Redis=require(_0xd574('0x5'));var db=require(_0xd574('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd574('0x7'))(_0xd574('0x8'));var config=require(_0xd574('0x9'));var jayson=require(_0xd574('0xa'));var client=jayson['client'][_0xd574('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13a566,_0x3ce54f,_0x1558b3){return new BPromise(function(_0x3a1e54,_0x20751c){return client['request'](_0x13a566,_0x1558b3)['then'](function(_0x4306f7){logger[_0xd574('0xc')](_0xd574('0xd'),_0x3ce54f,_0xd574('0xe'));logger[_0xd574('0xf')](_0xd574('0x10'),_0x3ce54f,_0xd574('0xe'),JSON['stringify'](_0x4306f7));if(_0x4306f7[_0xd574('0x11')]){if(_0x4306f7[_0xd574('0x11')][_0xd574('0x12')]===0x1f4){logger[_0xd574('0x11')](_0xd574('0xd'),_0x3ce54f,_0x4306f7[_0xd574('0x11')][_0xd574('0x13')]);return _0x20751c(_0x4306f7[_0xd574('0x11')][_0xd574('0x13')]);}logger[_0xd574('0x11')](_0xd574('0xd'),_0x3ce54f,_0x4306f7[_0xd574('0x11')]['message']);return _0x3a1e54(_0x4306f7[_0xd574('0x11')][_0xd574('0x13')]);}else{logger[_0xd574('0xc')](_0xd574('0xd'),_0x3ce54f,_0xd574('0xe'));_0x3a1e54(_0x4306f7[_0xd574('0x14')][_0xd574('0x13')]);}})[_0xd574('0x15')](function(_0x5c1db1){logger['error'](_0xd574('0xd'),_0x3ce54f,_0x5c1db1);_0x20751c(_0x5c1db1);});});} \ No newline at end of file +var _0x765e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x765e,0x131));var _0xe765=function(_0x581bf1,_0x40f867){_0x581bf1=_0x581bf1-0x0;var _0x17bb7f=_0x765e[_0x581bf1];return _0x17bb7f;};'use strict';var _=require(_0xe765('0x0'));var util=require(_0xe765('0x1'));var moment=require(_0xe765('0x2'));var BPromise=require(_0xe765('0x3'));var rs=require(_0xe765('0x4'));var fs=require('fs');var Redis=require(_0xe765('0x5'));var db=require(_0xe765('0x6'))['db'];var utils=require(_0xe765('0x7'));var logger=require(_0xe765('0x8'))(_0xe765('0x9'));var config=require(_0xe765('0xa'));var jayson=require(_0xe765('0xb'));var client=jayson[_0xe765('0xc')][_0xe765('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xdd89e7,_0x504542,_0x35d891){return new BPromise(function(_0x28e955,_0x27b0f4){return client[_0xe765('0xe')](_0xdd89e7,_0x35d891)[_0xe765('0xf')](function(_0x41801f){logger[_0xe765('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x504542,_0xe765('0x11'));logger[_0xe765('0x12')](_0xe765('0x13'),_0x504542,'request\x20sent',JSON[_0xe765('0x14')](_0x41801f));if(_0x41801f['error']){if(_0x41801f['error']['code']===0x1f4){logger[_0xe765('0x15')](_0xe765('0x16'),_0x504542,_0x41801f[_0xe765('0x15')][_0xe765('0x17')]);return _0x27b0f4(_0x41801f[_0xe765('0x15')]['message']);}logger[_0xe765('0x15')](_0xe765('0x16'),_0x504542,_0x41801f[_0xe765('0x15')][_0xe765('0x17')]);return _0x28e955(_0x41801f[_0xe765('0x15')]['message']);}else{logger['info'](_0xe765('0x16'),_0x504542,_0xe765('0x11'));_0x28e955(_0x41801f[_0xe765('0x18')]['message']);}})[_0xe765('0x19')](function(_0x36aca3){logger[_0xe765('0x15')](_0xe765('0x16'),_0x504542,_0x36aca3);_0x27b0f4(_0x36aca3);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 7e3bfc0..75c8ec3 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 _0x7438=['create','put','update','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post'];(function(_0x39471e,_0x4a195d){var _0x51693a=function(_0x2dc0b9){while(--_0x2dc0b9){_0x39471e['push'](_0x39471e['shift']());}};_0x51693a(++_0x4a195d);}(_0x7438,0x1b4));var _0x8743=function(_0x467cba,_0x140db7){_0x467cba=_0x467cba-0x0;var _0x3b630e=_0x7438[_0x467cba];return _0x3b630e;};'use strict';var multer=require(_0x8743('0x0'));var util=require(_0x8743('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8743('0x2'));var router=express[_0x8743('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8743('0x4'));var interaction=require(_0x8743('0x5'));var config=require(_0x8743('0x6'));var controller=require('./voiceContext.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8743('0x7')](_0x8743('0x8'),auth[_0x8743('0x9')](),controller[_0x8743('0xa')]);router[_0x8743('0xb')]('/',auth[_0x8743('0x9')](),controller[_0x8743('0xc')]);router[_0x8743('0xd')](_0x8743('0x8'),auth['isAuthenticated'](),controller[_0x8743('0xe')]);router['delete'](_0x8743('0x8'),auth[_0x8743('0x9')](),controller['destroy']);module[_0x8743('0xf')]=router; \ No newline at end of file +var _0x71f7=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','create','put','/:id','update','delete','path','connect-timeout','Router'];(function(_0x5b0e51,_0x50113d){var _0x7aceac=function(_0x4e3e6f){while(--_0x4e3e6f){_0x5b0e51['push'](_0x5b0e51['shift']());}};_0x7aceac(++_0x50113d);}(_0x71f7,0x1dd));var _0x771f=function(_0x4d11fd,_0x1b51f2){_0x4d11fd=_0x4d11fd-0x0;var _0x4f4d3f=_0x71f7[_0x4d11fd];return _0x4f4d3f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x771f('0x0'));var timeout=require(_0x771f('0x1'));var express=require('express');var router=express[_0x771f('0x2')]();var fs_extra=require(_0x771f('0x3'));var auth=require(_0x771f('0x4'));var interaction=require(_0x771f('0x5'));var config=require(_0x771f('0x6'));var controller=require('./voiceContext.controller');router['get']('/',auth[_0x771f('0x7')](),controller[_0x771f('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x771f('0x9')]);router['post']('/',auth[_0x771f('0x7')](),controller[_0x771f('0xa')]);router[_0x771f('0xb')](_0x771f('0xc'),auth[_0x771f('0x7')](),controller[_0x771f('0xd')]);router[_0x771f('0xe')](_0x771f('0xc'),auth[_0x771f('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 366e70e..f6f1b01 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 _0x0fc0=['STRING','name','BOOLEAN','sequelize'];(function(_0x42b17c,_0x30451e){var _0x9ecc60=function(_0x3d82e8){while(--_0x3d82e8){_0x42b17c['push'](_0x42b17c['shift']());}};_0x9ecc60(++_0x30451e);}(_0x0fc0,0x13b));var _0x00fc=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x0fc0[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require(_0x00fc('0x0'));module['exports']={'name':{'type':Sequelize[_0x00fc('0x1')],'unique':_0x00fc('0x2')},'description':{'type':Sequelize[_0x00fc('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x00fc('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd483=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x107eb6,_0x1d42b8){var _0x409d7f=function(_0x1f9084){while(--_0x1f9084){_0x107eb6['push'](_0x107eb6['shift']());}};_0x409d7f(++_0x1d42b8);}(_0xd483,0x87));var _0x3d48=function(_0x19f90a,_0x1ca757){_0x19f90a=_0x19f90a-0x0;var _0x4583c6=_0xd483[_0x19f90a];return _0x4583c6;};'use strict';var Sequelize=require(_0x3d48('0x0'));module[_0x3d48('0x1')]={'name':{'type':Sequelize[_0x3d48('0x2')],'unique':_0x3d48('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x3d48('0x4')],'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 bd6eeea..16f4c6e 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 _0x53a9=['root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','get','user','UserProfileSection','userProfileId','autoAssociation','body','destroy','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','then','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','options','find','create','readFileSync'];(function(_0x1a0a7b,_0x39dc10){var _0x32e078=function(_0x819f2b){while(--_0x819f2b){_0x1a0a7b['push'](_0x1a0a7b['shift']());}};_0x32e078(++_0x39dc10);}(_0x53a9,0x141));var _0x953a=function(_0x717919,_0x3b1695){_0x717919=_0x717919-0x0;var _0x4df2e5=_0x53a9[_0x717919];return _0x4df2e5;};'use strict';var emlformat=require(_0x953a('0x0'));var rimraf=require(_0x953a('0x1'));var zipdir=require(_0x953a('0x2'));var jsonpatch=require(_0x953a('0x3'));var rp=require('request-promise');var moment=require(_0x953a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x953a('0x5'));var util=require('util');var path=require(_0x953a('0x6'));var sox=require('sox');var csv=require(_0x953a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x953a('0x8'));var squel=require('squel');var crypto=require(_0x953a('0x9'));var jsforce=require(_0x953a('0xa'));var deskjs=require(_0x953a('0xb'));var toCsv=require(_0x953a('0x7'));var querystring=require(_0x953a('0xc'));var Papa=require(_0x953a('0xd'));var Redis=require('ioredis');var authService=require(_0x953a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x953a('0xf'));var hardwareService=require(_0x953a('0x10'));var logger=require(_0x953a('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x953a('0x12'));var licenseUtil=require(_0x953a('0x13'));var db=require(_0x953a('0x14'))['db'];var jayson=require(_0x953a('0x15'));var client=jayson[_0x953a('0x16')][_0x953a('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x36681b,_0x54185c,_0x2d045f,_0x2b2248){return new BPromise(function(_0x354a5e,_0x32dece){var _0x313d09=_0x2b2248||client;return _0x313d09[_0x953a('0x18')](_0x36681b,_0x2d045f)['then'](function(_0x422153){logger[_0x953a('0x19')](_0x953a('0x1a'),_0x54185c,_0x953a('0x1b'));logger[_0x953a('0x1c')](_0x953a('0x1d'),_0x54185c,_0x953a('0x1b'),JSON[_0x953a('0x1e')](_0x422153));if(_0x422153['error']){if(_0x422153[_0x953a('0x1f')][_0x953a('0x20')]===0x1f4){logger[_0x953a('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x54185c,_0x422153[_0x953a('0x1f')][_0x953a('0x21')]);return _0x32dece(_0x422153[_0x953a('0x1f')][_0x953a('0x21')]);}logger[_0x953a('0x1f')](_0x953a('0x1a'),_0x54185c,_0x422153[_0x953a('0x1f')]['message']);return _0x354a5e(_0x422153[_0x953a('0x1f')][_0x953a('0x21')]);}else{logger[_0x953a('0x19')]('VoiceContext,\x20%s,\x20%s',_0x54185c,_0x953a('0x1b'));_0x354a5e(_0x422153[_0x953a('0x22')][_0x953a('0x21')]);}})[_0x953a('0x23')](function(_0x4995e7){logger[_0x953a('0x1f')](_0x953a('0x1a'),_0x54185c,_0x4995e7);_0x32dece(_0x4995e7);});});}function respondWithStatusCode(_0x4082b8,_0x1d8e6d){_0x1d8e6d=_0x1d8e6d||0xcc;return function(_0x51dfa4){if(_0x51dfa4){return _0x4082b8[_0x953a('0x24')](_0x1d8e6d);}return _0x4082b8[_0x953a('0x25')](_0x1d8e6d)[_0x953a('0x26')]();};}function respondWithResult(_0x4f96c8,_0x4be556){_0x4be556=_0x4be556||0xc8;return function(_0xef6574){if(_0xef6574){return _0x4f96c8[_0x953a('0x25')](_0x4be556)[_0x953a('0x27')](_0xef6574);}};}function respondWithFilteredResult(_0x146bb6,_0x4ec9f2){return function(_0x368019){if(_0x368019){var _0x1332ae=typeof _0x4ec9f2[_0x953a('0x28')]===_0x953a('0x29')&&typeof _0x4ec9f2['limit']===_0x953a('0x29');var _0x556b12=_0x368019[_0x953a('0x2a')];var _0x37bee6=_0x1332ae?0x0:_0x4ec9f2[_0x953a('0x28')];var _0x3669a1=_0x1332ae?_0x368019[_0x953a('0x2a')]:_0x4ec9f2[_0x953a('0x28')]+_0x4ec9f2['limit'];var _0x62b7b9;if(_0x3669a1>=_0x556b12){_0x3669a1=_0x556b12;_0x62b7b9=0xc8;}else{_0x62b7b9=0xce;}_0x146bb6['status'](_0x62b7b9);return _0x146bb6[_0x953a('0x2b')]('Content-Range',_0x37bee6+'-'+_0x3669a1+'/'+_0x556b12)[_0x953a('0x27')](_0x368019);}return null;};}function patchUpdates(_0x36da7e){return function(_0x36ef83){try{jsonpatch['apply'](_0x36ef83,_0x36da7e,!![]);}catch(_0x4ae1dc){return BPromise[_0x953a('0x2c')](_0x4ae1dc);}return _0x36ef83[_0x953a('0x2d')]();};}function saveUpdates(_0x2ee0c4,_0x47e4bd){return function(_0x53557e){if(_0x53557e){return _0x53557e[_0x953a('0x2e')](_0x2ee0c4)[_0x953a('0x2f')](function(_0x107ef4){return _0x107ef4;});}return null;};}function removeEntity(_0x295ad0,_0x5a0336){return function(_0x370d4c){if(_0x370d4c){return _0x370d4c['destroy']()[_0x953a('0x2f')](function(){var _0x322d17=_0x370d4c['get']({'plain':!![]});var _0x1b876e=_0x953a('0x30');return db[_0x953a('0x31')]['destroy']({'where':{'type':_0x1b876e,'resourceId':_0x322d17['id']}})['then'](function(){return _0x370d4c;});})[_0x953a('0x2f')](function(){_0x295ad0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x816d29,_0x90aa95){return function(_0x42a438){if(!_0x42a438){_0x816d29[_0x953a('0x24')](0x194);}return _0x42a438;};}function handleError(_0x1054df,_0x3650ec){_0x3650ec=_0x3650ec||0x1f4;return function(_0x5acf34){logger[_0x953a('0x1f')](_0x5acf34[_0x953a('0x32')]);if(_0x5acf34[_0x953a('0x33')]){delete _0x5acf34['name'];}_0x1054df['status'](_0x3650ec)[_0x953a('0x34')](_0x5acf34);};}exports[_0x953a('0x35')]=function(_0x4043ff,_0x1eba0d){var _0x19d3fb={},_0x4bac22={},_0x5e06b7={'count':0x0,'rows':[]};var _0xd07a65=_[_0x953a('0x36')](db[_0x953a('0x37')][_0x953a('0x38')],function(_0x4d9f32){return{'name':_0x4d9f32[_0x953a('0x39')],'type':_0x4d9f32[_0x953a('0x3a')][_0x953a('0x3b')]};});_0x4bac22[_0x953a('0x3c')]=_[_0x953a('0x36')](_0xd07a65,_0x953a('0x33'));_0x4bac22[_0x953a('0x3d')]=_[_0x953a('0x3e')](_0x4043ff[_0x953a('0x3d')]);_0x4bac22[_0x953a('0x3f')]=_['intersection'](_0x4bac22[_0x953a('0x3c')],_0x4bac22[_0x953a('0x3d')]);_0x19d3fb[_0x953a('0x40')]=_[_0x953a('0x41')](_0x4bac22[_0x953a('0x3c')],qs[_0x953a('0x42')](_0x4043ff[_0x953a('0x3d')]['fields']));_0x19d3fb[_0x953a('0x40')]=_0x19d3fb[_0x953a('0x40')][_0x953a('0x43')]?_0x19d3fb[_0x953a('0x40')]:_0x4bac22['model'];if(!_0x4043ff[_0x953a('0x3d')][_0x953a('0x44')](_0x953a('0x45'))){_0x19d3fb['limit']=qs[_0x953a('0x46')](_0x4043ff[_0x953a('0x3d')][_0x953a('0x46')]);_0x19d3fb[_0x953a('0x28')]=qs[_0x953a('0x28')](_0x4043ff[_0x953a('0x3d')][_0x953a('0x28')]);}_0x19d3fb[_0x953a('0x47')]=qs['sort'](_0x4043ff['query'][_0x953a('0x48')]);_0x19d3fb[_0x953a('0x49')]=qs['filters'](_[_0x953a('0x4a')](_0x4043ff[_0x953a('0x3d')],_0x4bac22[_0x953a('0x3f')]),_0xd07a65);if(_0x4043ff[_0x953a('0x3d')][_0x953a('0x4b')]){_0x19d3fb[_0x953a('0x49')]=_[_0x953a('0x4c')](_0x19d3fb['where'],{'$or':_[_0x953a('0x36')](_0xd07a65,function(_0x5eecd2){if(_0x5eecd2[_0x953a('0x3a')]!==_0x953a('0x4d')){var _0x46e33e={};_0x46e33e[_0x5eecd2[_0x953a('0x33')]]={'$like':'%'+_0x4043ff[_0x953a('0x3d')][_0x953a('0x4b')]+'%'};return _0x46e33e;}})});}_0x19d3fb=_[_0x953a('0x4c')]({},_0x19d3fb,_0x4043ff['options']);var _0x5d0786={'where':_0x19d3fb[_0x953a('0x49')]};return db[_0x953a('0x37')][_0x953a('0x2a')](_0x5d0786)['then'](function(_0x67bcda){_0x5e06b7['count']=_0x67bcda;if(_0x4043ff['query'][_0x953a('0x4e')]){_0x19d3fb[_0x953a('0x4f')]=[{'all':!![]}];}return db[_0x953a('0x37')][_0x953a('0x50')](_0x19d3fb);})['then'](function(_0x36b93a){_0x5e06b7[_0x953a('0x51')]=_0x36b93a;return _0x5e06b7;})[_0x953a('0x2f')](respondWithFilteredResult(_0x1eba0d,_0x19d3fb))[_0x953a('0x23')](handleError(_0x1eba0d,null));};exports['show']=function(_0x2118a9,_0x525f4e){var _0x1f8183={'raw':![],'where':{'id':_0x2118a9[_0x953a('0x52')]['id']}},_0x4a956e={};_0x4a956e[_0x953a('0x3c')]=_[_0x953a('0x3e')](db['VoiceContext'][_0x953a('0x38')]);_0x4a956e['query']=_[_0x953a('0x3e')](_0x2118a9[_0x953a('0x3d')]);_0x4a956e[_0x953a('0x3f')]=_[_0x953a('0x41')](_0x4a956e[_0x953a('0x3c')],_0x4a956e[_0x953a('0x3d')]);_0x1f8183[_0x953a('0x40')]=_[_0x953a('0x41')](_0x4a956e[_0x953a('0x3c')],qs[_0x953a('0x42')](_0x2118a9[_0x953a('0x3d')][_0x953a('0x42')]));_0x1f8183[_0x953a('0x40')]=_0x1f8183[_0x953a('0x40')][_0x953a('0x43')]?_0x1f8183[_0x953a('0x40')]:_0x4a956e[_0x953a('0x3c')];if(_0x2118a9[_0x953a('0x3d')][_0x953a('0x4e')]){_0x1f8183[_0x953a('0x4f')]=[{'all':!![]}];}_0x1f8183=_[_0x953a('0x4c')]({},_0x1f8183,_0x2118a9[_0x953a('0x53')]);return db[_0x953a('0x37')][_0x953a('0x54')](_0x1f8183)['then'](handleEntityNotFound(_0x525f4e,null))[_0x953a('0x2f')](respondWithResult(_0x525f4e,null))[_0x953a('0x23')](handleError(_0x525f4e,null));};exports[_0x953a('0x55')]=function(_0x227433,_0xc40809,_0x3c0148){var _0x26ef46;return db[_0x953a('0x37')][_0x953a('0x55')](_0x227433['body'],{'raw':!![]})[_0x953a('0x2f')](function(_0x4d0c7b){_0x26ef46=_0x4d0c7b;return db[_0x953a('0x37')][_0x953a('0x50')]({'raw':!![]});})[_0x953a('0x2f')](function(_0x1906e5){var _0x25627a=fs[_0x953a('0x56')](path['join'](config[_0x953a('0x57')],_0x953a('0x58')),_0x953a('0x59'));var _0x1b5275=ejs[_0x953a('0x5a')](_0x25627a,{'contexts':_0x1906e5||[]});fs[_0x953a('0x5b')](_0x953a('0x5c'),_0x1b5275);})['then'](function(){return respondWithRpcPromise(_0x953a('0x5d'),_0x953a('0x55'),{'module':'chan_sip.so'});})[_0x953a('0x2f')](function(){var _0x150e22=_0x227433['user'][_0x953a('0x5e')]({'plain':!![]});if(!_0x150e22)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x150e22['role']===_0x953a('0x5f')){var _0x434b4d=_0x26ef46['get']({'plain':!![]});return db[_0x953a('0x60')][_0x953a('0x54')]({'where':{'name':_0x953a('0x30'),'userProfileId':_0x150e22[_0x953a('0x61')]},'raw':!![]})[_0x953a('0x2f')](function(_0x1bf9dd){if(_0x1bf9dd&&_0x1bf9dd[_0x953a('0x62')]===0x0){return db[_0x953a('0x31')][_0x953a('0x55')]({'name':_0x434b4d['name'],'resourceId':_0x434b4d['id'],'type':_0x1bf9dd[_0x953a('0x33')],'sectionId':_0x1bf9dd['id']},{})[_0x953a('0x2f')](function(){return _0x26ef46;});}else{return _0x26ef46;}})[_0x953a('0x23')](function(_0x7c09a3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7c09a3);throw _0x7c09a3;});}return _0x26ef46;})['then'](respondWithResult(_0xc40809,0xc9))[_0x953a('0x23')](handleError(_0xc40809,null));};exports[_0x953a('0x2e')]=function(_0x4567b9,_0x1b383c,_0x3d5d53){var _0x16ae44;return db[_0x953a('0x37')][_0x953a('0x54')]({'where':{'id':_0x4567b9['params']['id']}})['then'](handleEntityNotFound(_0x1b383c,null))[_0x953a('0x2f')](saveUpdates(_0x4567b9[_0x953a('0x63')],null))[_0x953a('0x2f')](function(_0x1d6180){if(_0x1d6180){_0x16ae44=_0x1d6180;return db[_0x953a('0x37')]['findAll']({'raw':!![]});}})[_0x953a('0x2f')](function(_0x25cef7){var _0x51e19b=fs[_0x953a('0x56')](path['join'](config[_0x953a('0x57')],_0x953a('0x58')),_0x953a('0x59'));var _0x4965ff=ejs['render'](_0x51e19b,{'contexts':_0x25cef7||[]});fs[_0x953a('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4965ff);})[_0x953a('0x2f')](function(){return respondWithRpcPromise(_0x953a('0x5d'),_0x953a('0x2e'),{'module':'chan_sip.so'});})[_0x953a('0x2f')](function(){return _0x16ae44;})[_0x953a('0x2f')](respondWithResult(_0x1b383c,null))[_0x953a('0x23')](handleError(_0x1b383c,null));};exports[_0x953a('0x64')]=function(_0x15e1fd,_0x545390,_0x26082c){var _0x401a46;return db[_0x953a('0x37')][_0x953a('0x54')]({'where':{'id':_0x15e1fd[_0x953a('0x52')]['id']}})['then'](handleEntityNotFound(_0x545390,null))[_0x953a('0x2f')](removeEntity(_0x545390,null))[_0x953a('0x2f')](function(){return db[_0x953a('0x37')][_0x953a('0x50')]({'raw':!![]});})['then'](function(_0x2e13db){var _0x3bc76f=fs[_0x953a('0x56')](path['join'](config[_0x953a('0x57')],_0x953a('0x58')),'utf8');var _0x177bb9=ejs[_0x953a('0x5a')](_0x3bc76f,{'contexts':_0x2e13db});fs['writeFileSync'](_0x953a('0x5c'),_0x177bb9);return respondWithRpcPromise(_0x953a('0x5d'),_0x953a('0x64'),{'module':_0x953a('0x65')});})[_0x953a('0x23')](handleError(_0x545390,null));}; \ No newline at end of file +var _0x6ae5=['then','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','request\x20sent','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','UserProfileResource','name','send','map','VoiceContext','fieldName','key','model','query','keys','attributes','fields','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','intersection','length','find','create','body','readFileSync','root','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','/etc/asterisk/extensions_xcally_contexts.conf','server/files/templates/context.ejs','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','http','request'];(function(_0x3478d1,_0x31ab6b){var _0x26fa28=function(_0x176df2){while(--_0x176df2){_0x3478d1['push'](_0x3478d1['shift']());}};_0x26fa28(++_0x31ab6b);}(_0x6ae5,0x1ed));var _0x56ae=function(_0x52595f,_0x59531e){_0x52595f=_0x52595f-0x0;var _0x13a13d=_0x6ae5[_0x52595f];return _0x13a13d;};'use strict';var emlformat=require(_0x56ae('0x0'));var rimraf=require(_0x56ae('0x1'));var zipdir=require(_0x56ae('0x2'));var jsonpatch=require(_0x56ae('0x3'));var rp=require('request-promise');var moment=require(_0x56ae('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x56ae('0x5'));var util=require(_0x56ae('0x6'));var path=require(_0x56ae('0x7'));var sox=require(_0x56ae('0x8'));var csv=require(_0x56ae('0x9'));var ejs=require(_0x56ae('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x56ae('0xb'));var jsforce=require(_0x56ae('0xc'));var deskjs=require(_0x56ae('0xd'));var toCsv=require(_0x56ae('0x9'));var querystring=require(_0x56ae('0xe'));var Papa=require(_0x56ae('0xf'));var Redis=require(_0x56ae('0x10'));var authService=require(_0x56ae('0x11'));var qs=require(_0x56ae('0x12'));var as=require(_0x56ae('0x13'));var hardwareService=require(_0x56ae('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x56ae('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x56ae('0x16'));var db=require(_0x56ae('0x17'))['db'];var jayson=require(_0x56ae('0x18'));var client=jayson['client'][_0x56ae('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x332012,_0x131d10,_0x738049,_0x53b7b6){return new BPromise(function(_0x496768,_0x20bc22){var _0x1c6634=_0x53b7b6||client;return _0x1c6634[_0x56ae('0x1a')](_0x332012,_0x738049)[_0x56ae('0x1b')](function(_0x29f7b3){logger[_0x56ae('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x131d10,'request\x20sent');logger[_0x56ae('0x1d')](_0x56ae('0x1e'),_0x131d10,'request\x20sent',JSON[_0x56ae('0x1f')](_0x29f7b3));if(_0x29f7b3[_0x56ae('0x20')]){if(_0x29f7b3[_0x56ae('0x20')][_0x56ae('0x21')]===0x1f4){logger[_0x56ae('0x20')](_0x56ae('0x22'),_0x131d10,_0x29f7b3[_0x56ae('0x20')]['message']);return _0x20bc22(_0x29f7b3[_0x56ae('0x20')][_0x56ae('0x23')]);}logger[_0x56ae('0x20')](_0x56ae('0x22'),_0x131d10,_0x29f7b3[_0x56ae('0x20')][_0x56ae('0x23')]);return _0x496768(_0x29f7b3[_0x56ae('0x20')][_0x56ae('0x23')]);}else{logger[_0x56ae('0x1c')](_0x56ae('0x22'),_0x131d10,_0x56ae('0x24'));_0x496768(_0x29f7b3['result']['message']);}})['catch'](function(_0x1f0741){logger[_0x56ae('0x20')](_0x56ae('0x22'),_0x131d10,_0x1f0741);_0x20bc22(_0x1f0741);});});}function respondWithStatusCode(_0x1bb207,_0x163ef3){_0x163ef3=_0x163ef3||0xcc;return function(_0x5a1c44){if(_0x5a1c44){return _0x1bb207[_0x56ae('0x25')](_0x163ef3);}return _0x1bb207[_0x56ae('0x26')](_0x163ef3)[_0x56ae('0x27')]();};}function respondWithResult(_0x25545d,_0x1fc1b3){_0x1fc1b3=_0x1fc1b3||0xc8;return function(_0x4934cd){if(_0x4934cd){return _0x25545d['status'](_0x1fc1b3)['json'](_0x4934cd);}};}function respondWithFilteredResult(_0x5a38d0,_0x1466bd){return function(_0x5994b5){if(_0x5994b5){var _0x7349e9=typeof _0x1466bd[_0x56ae('0x28')]==='undefined'&&typeof _0x1466bd[_0x56ae('0x29')]===_0x56ae('0x2a');var _0x43a1a3=_0x5994b5[_0x56ae('0x2b')];var _0x3e8774=_0x7349e9?0x0:_0x1466bd['offset'];var _0x43eb05=_0x7349e9?_0x5994b5[_0x56ae('0x2b')]:_0x1466bd['offset']+_0x1466bd[_0x56ae('0x29')];var _0x3b3d2d;if(_0x43eb05>=_0x43a1a3){_0x43eb05=_0x43a1a3;_0x3b3d2d=0xc8;}else{_0x3b3d2d=0xce;}_0x5a38d0[_0x56ae('0x26')](_0x3b3d2d);return _0x5a38d0[_0x56ae('0x2c')](_0x56ae('0x2d'),_0x3e8774+'-'+_0x43eb05+'/'+_0x43a1a3)[_0x56ae('0x2e')](_0x5994b5);}return null;};}function patchUpdates(_0x6d42d){return function(_0x2a841d){try{jsonpatch[_0x56ae('0x2f')](_0x2a841d,_0x6d42d,!![]);}catch(_0x29afd3){return BPromise[_0x56ae('0x30')](_0x29afd3);}return _0x2a841d[_0x56ae('0x31')]();};}function saveUpdates(_0x4de8d1,_0x2eac1b){return function(_0x123aa9){if(_0x123aa9){return _0x123aa9[_0x56ae('0x32')](_0x4de8d1)['then'](function(_0x117c8a){return _0x117c8a;});}return null;};}function removeEntity(_0x2627ad,_0x3e069c){return function(_0x4f28be){if(_0x4f28be){return _0x4f28be[_0x56ae('0x33')]()[_0x56ae('0x1b')](function(){var _0xfa282f=_0x4f28be[_0x56ae('0x34')]({'plain':!![]});var _0x3c7fd4='Contexts';return db[_0x56ae('0x35')][_0x56ae('0x33')]({'where':{'type':_0x3c7fd4,'resourceId':_0xfa282f['id']}})[_0x56ae('0x1b')](function(){return _0x4f28be;});})[_0x56ae('0x1b')](function(){_0x2627ad[_0x56ae('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57b6a1,_0x49ebf9){return function(_0xfd0c9f){if(!_0xfd0c9f){_0x57b6a1[_0x56ae('0x25')](0x194);}return _0xfd0c9f;};}function handleError(_0x3e279a,_0xfdfffe){_0xfdfffe=_0xfdfffe||0x1f4;return function(_0x22de9d){logger[_0x56ae('0x20')](_0x22de9d['stack']);if(_0x22de9d[_0x56ae('0x36')]){delete _0x22de9d[_0x56ae('0x36')];}_0x3e279a['status'](_0xfdfffe)[_0x56ae('0x37')](_0x22de9d);};}exports['index']=function(_0x5c5b0a,_0x2cfa20){var _0x1311be={},_0x1aeceb={},_0x502413={'count':0x0,'rows':[]};var _0x162354=_[_0x56ae('0x38')](db[_0x56ae('0x39')]['rawAttributes'],function(_0x8c89a4){return{'name':_0x8c89a4[_0x56ae('0x3a')],'type':_0x8c89a4['type'][_0x56ae('0x3b')]};});_0x1aeceb[_0x56ae('0x3c')]=_[_0x56ae('0x38')](_0x162354,'name');_0x1aeceb[_0x56ae('0x3d')]=_[_0x56ae('0x3e')](_0x5c5b0a[_0x56ae('0x3d')]);_0x1aeceb['filters']=_['intersection'](_0x1aeceb['model'],_0x1aeceb[_0x56ae('0x3d')]);_0x1311be[_0x56ae('0x3f')]=_['intersection'](_0x1aeceb[_0x56ae('0x3c')],qs[_0x56ae('0x40')](_0x5c5b0a[_0x56ae('0x3d')][_0x56ae('0x40')]));_0x1311be[_0x56ae('0x3f')]=_0x1311be[_0x56ae('0x3f')]['length']?_0x1311be[_0x56ae('0x3f')]:_0x1aeceb[_0x56ae('0x3c')];if(!_0x5c5b0a['query']['hasOwnProperty'](_0x56ae('0x41'))){_0x1311be[_0x56ae('0x29')]=qs[_0x56ae('0x29')](_0x5c5b0a[_0x56ae('0x3d')][_0x56ae('0x29')]);_0x1311be[_0x56ae('0x28')]=qs[_0x56ae('0x28')](_0x5c5b0a[_0x56ae('0x3d')][_0x56ae('0x28')]);}_0x1311be[_0x56ae('0x42')]=qs[_0x56ae('0x43')](_0x5c5b0a['query'][_0x56ae('0x43')]);_0x1311be[_0x56ae('0x44')]=qs[_0x56ae('0x45')](_[_0x56ae('0x46')](_0x5c5b0a[_0x56ae('0x3d')],_0x1aeceb[_0x56ae('0x45')]),_0x162354);if(_0x5c5b0a[_0x56ae('0x3d')][_0x56ae('0x47')]){_0x1311be[_0x56ae('0x44')]=_['merge'](_0x1311be[_0x56ae('0x44')],{'$or':_['map'](_0x162354,function(_0xda1106){if(_0xda1106[_0x56ae('0x48')]!==_0x56ae('0x49')){var _0x4b761b={};_0x4b761b[_0xda1106[_0x56ae('0x36')]]={'$like':'%'+_0x5c5b0a[_0x56ae('0x3d')][_0x56ae('0x47')]+'%'};return _0x4b761b;}})});}_0x1311be=_[_0x56ae('0x4a')]({},_0x1311be,_0x5c5b0a[_0x56ae('0x4b')]);var _0x5c2bd8={'where':_0x1311be['where']};return db[_0x56ae('0x39')][_0x56ae('0x2b')](_0x5c2bd8)['then'](function(_0x1155c7){_0x502413[_0x56ae('0x2b')]=_0x1155c7;if(_0x5c5b0a[_0x56ae('0x3d')][_0x56ae('0x4c')]){_0x1311be[_0x56ae('0x4d')]=[{'all':!![]}];}return db[_0x56ae('0x39')][_0x56ae('0x4e')](_0x1311be);})[_0x56ae('0x1b')](function(_0x15bbaa){_0x502413[_0x56ae('0x4f')]=_0x15bbaa;return _0x502413;})[_0x56ae('0x1b')](respondWithFilteredResult(_0x2cfa20,_0x1311be))[_0x56ae('0x50')](handleError(_0x2cfa20,null));};exports['show']=function(_0x574ac0,_0x2c768b){var _0x309a42={'raw':![],'where':{'id':_0x574ac0[_0x56ae('0x51')]['id']}},_0x38e5b3={};_0x38e5b3[_0x56ae('0x3c')]=_[_0x56ae('0x3e')](db[_0x56ae('0x39')]['rawAttributes']);_0x38e5b3['query']=_[_0x56ae('0x3e')](_0x574ac0[_0x56ae('0x3d')]);_0x38e5b3['filters']=_['intersection'](_0x38e5b3[_0x56ae('0x3c')],_0x38e5b3[_0x56ae('0x3d')]);_0x309a42[_0x56ae('0x3f')]=_[_0x56ae('0x52')](_0x38e5b3[_0x56ae('0x3c')],qs[_0x56ae('0x40')](_0x574ac0['query']['fields']));_0x309a42['attributes']=_0x309a42['attributes'][_0x56ae('0x53')]?_0x309a42[_0x56ae('0x3f')]:_0x38e5b3[_0x56ae('0x3c')];if(_0x574ac0[_0x56ae('0x3d')][_0x56ae('0x4c')]){_0x309a42[_0x56ae('0x4d')]=[{'all':!![]}];}_0x309a42=_['merge']({},_0x309a42,_0x574ac0[_0x56ae('0x4b')]);return db[_0x56ae('0x39')][_0x56ae('0x54')](_0x309a42)[_0x56ae('0x1b')](handleEntityNotFound(_0x2c768b,null))['then'](respondWithResult(_0x2c768b,null))[_0x56ae('0x50')](handleError(_0x2c768b,null));};exports[_0x56ae('0x55')]=function(_0x51ea7f,_0x193ed5,_0x236c1c){var _0x21ab95;return db[_0x56ae('0x39')][_0x56ae('0x55')](_0x51ea7f[_0x56ae('0x56')],{'raw':!![]})[_0x56ae('0x1b')](function(_0x43db47){_0x21ab95=_0x43db47;return db[_0x56ae('0x39')]['findAll']({'raw':!![]});})[_0x56ae('0x1b')](function(_0x16cdbc){var _0x33e14a=fs[_0x56ae('0x57')](path['join'](config[_0x56ae('0x58')],'server/files/templates/context.ejs'),'utf8');var _0x353c8e=ejs[_0x56ae('0x59')](_0x33e14a,{'contexts':_0x16cdbc||[]});fs[_0x56ae('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x353c8e);})[_0x56ae('0x1b')](function(){return respondWithRpcPromise(_0x56ae('0x5b'),_0x56ae('0x55'),{'module':_0x56ae('0x5c')});})[_0x56ae('0x1b')](function(){var _0xe58623=_0x51ea7f[_0x56ae('0x5d')][_0x56ae('0x34')]({'plain':!![]});if(!_0xe58623)throw new Error(_0x56ae('0x5e'));if(_0xe58623[_0x56ae('0x5f')]===_0x56ae('0x5d')){var _0x4e09e6=_0x21ab95[_0x56ae('0x34')]({'plain':!![]});return db[_0x56ae('0x60')]['find']({'where':{'name':_0x56ae('0x61'),'userProfileId':_0xe58623[_0x56ae('0x62')]},'raw':!![]})[_0x56ae('0x1b')](function(_0x8817e8){if(_0x8817e8&&_0x8817e8[_0x56ae('0x63')]===0x0){return db['UserProfileResource'][_0x56ae('0x55')]({'name':_0x4e09e6[_0x56ae('0x36')],'resourceId':_0x4e09e6['id'],'type':_0x8817e8['name'],'sectionId':_0x8817e8['id']},{})['then'](function(){return _0x21ab95;});}else{return _0x21ab95;}})['catch'](function(_0x3fb82b){logger[_0x56ae('0x20')](_0x56ae('0x64'),_0x3fb82b);throw _0x3fb82b;});}return _0x21ab95;})[_0x56ae('0x1b')](respondWithResult(_0x193ed5,0xc9))['catch'](handleError(_0x193ed5,null));};exports[_0x56ae('0x32')]=function(_0x460ca2,_0x8d737b,_0x3b3e72){var _0x180155;return db[_0x56ae('0x39')]['find']({'where':{'id':_0x460ca2['params']['id']}})[_0x56ae('0x1b')](handleEntityNotFound(_0x8d737b,null))[_0x56ae('0x1b')](saveUpdates(_0x460ca2[_0x56ae('0x56')],null))[_0x56ae('0x1b')](function(_0x4b2204){if(_0x4b2204){_0x180155=_0x4b2204;return db[_0x56ae('0x39')][_0x56ae('0x4e')]({'raw':!![]});}})['then'](function(_0x5bb4f5){var _0x204f34=fs[_0x56ae('0x57')](path[_0x56ae('0x65')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x4bd4bb=ejs[_0x56ae('0x59')](_0x204f34,{'contexts':_0x5bb4f5||[]});fs[_0x56ae('0x5a')](_0x56ae('0x66'),_0x4bd4bb);})[_0x56ae('0x1b')](function(){return respondWithRpcPromise('Reload',_0x56ae('0x32'),{'module':_0x56ae('0x5c')});})[_0x56ae('0x1b')](function(){return _0x180155;})[_0x56ae('0x1b')](respondWithResult(_0x8d737b,null))[_0x56ae('0x50')](handleError(_0x8d737b,null));};exports[_0x56ae('0x33')]=function(_0xb12b83,_0x189417,_0x1d8a25){var _0x5a58ff;return db[_0x56ae('0x39')][_0x56ae('0x54')]({'where':{'id':_0xb12b83['params']['id']}})['then'](handleEntityNotFound(_0x189417,null))[_0x56ae('0x1b')](removeEntity(_0x189417,null))[_0x56ae('0x1b')](function(){return db[_0x56ae('0x39')][_0x56ae('0x4e')]({'raw':!![]});})['then'](function(_0x3ee5e0){var _0x146ed2=fs[_0x56ae('0x57')](path[_0x56ae('0x65')](config['root'],_0x56ae('0x67')),'utf8');var _0x3c6f64=ejs[_0x56ae('0x59')](_0x146ed2,{'contexts':_0x3ee5e0});fs[_0x56ae('0x5a')](_0x56ae('0x66'),_0x3c6f64);return respondWithRpcPromise(_0x56ae('0x5b'),'destroy',{'module':_0x56ae('0x5c')});})[_0x56ae('0x50')](handleError(_0x189417,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 52d48ef..eef07ca 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 _0x8b65=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','VoiceContext','lodash'];(function(_0x11deab,_0x595015){var _0x2a9bcf=function(_0x52d1cc){while(--_0x52d1cc){_0x11deab['push'](_0x11deab['shift']());}};_0x2a9bcf(++_0x595015);}(_0x8b65,0x13e));var _0x58b6=function(_0x25470a,_0x2b3f98){_0x25470a=_0x25470a-0x0;var _0x1bcae2=_0x8b65[_0x25470a];return _0x1bcae2;};'use strict';var _=require(_0x58b6('0x0'));var util=require(_0x58b6('0x1'));var logger=require(_0x58b6('0x2'))(_0x58b6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x58b6('0x4'));var fs=require('fs');var path=require(_0x58b6('0x5'));var rimraf=require(_0x58b6('0x6'));var config=require(_0x58b6('0x7'));var attributes=require(_0x58b6('0x8'));module[_0x58b6('0x9')]=function(_0x528888,_0x2cec99){return _0x528888['define'](_0x58b6('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8842=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define'];(function(_0x2edbdf,_0x1892c1){var _0x487a01=function(_0x4b24ff){while(--_0x4b24ff){_0x2edbdf['push'](_0x2edbdf['shift']());}};_0x487a01(++_0x1892c1);}(_0x8842,0x1ea));var _0x2884=function(_0x3e10b0,_0x4544e3){_0x3e10b0=_0x3e10b0-0x0;var _0x14b94d=_0x8842[_0x3e10b0];return _0x14b94d;};'use strict';var _=require(_0x2884('0x0'));var util=require(_0x2884('0x1'));var logger=require(_0x2884('0x2'))(_0x2884('0x3'));var moment=require(_0x2884('0x4'));var BPromise=require(_0x2884('0x5'));var rp=require(_0x2884('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2884('0x7'));var config=require(_0x2884('0x8'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0xe27f2,_0x26293b){return _0xe27f2[_0x2884('0x9')]('VoiceContext',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 d6752f7..5baa1c1 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 _0xa596=['VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','request\x20sent','debug'];(function(_0x5bf6b8,_0x464f48){var _0x44b425=function(_0x4e1b70){while(--_0x4e1b70){_0x5bf6b8['push'](_0x5bf6b8['shift']());}};_0x44b425(++_0x464f48);}(_0xa596,0x7b));var _0x6a59=function(_0x1f875b,_0x1ef023){_0x1f875b=_0x1f875b-0x0;var _0x31fdcb=_0xa596[_0x1f875b];return _0x31fdcb;};'use strict';var _=require(_0x6a59('0x0'));var util=require(_0x6a59('0x1'));var moment=require('moment');var BPromise=require(_0x6a59('0x2'));var rs=require(_0x6a59('0x3'));var fs=require('fs');var Redis=require(_0x6a59('0x4'));var db=require(_0x6a59('0x5'))['db'];var utils=require(_0x6a59('0x6'));var logger=require(_0x6a59('0x7'))(_0x6a59('0x8'));var config=require(_0x6a59('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6a59('0xa')][_0x6a59('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21e97f,_0x375a77,_0xb50532){return new BPromise(function(_0x3c392f,_0x5aa5fe){return client[_0x6a59('0xc')](_0x21e97f,_0xb50532)['then'](function(_0x21008c){logger['info']('VoiceContext,\x20%s,\x20%s',_0x375a77,_0x6a59('0xd'));logger[_0x6a59('0xe')](_0x6a59('0xf'),_0x375a77,'request\x20sent',JSON[_0x6a59('0x10')](_0x21008c));if(_0x21008c[_0x6a59('0x11')]){if(_0x21008c['error'][_0x6a59('0x12')]===0x1f4){logger['error'](_0x6a59('0x13'),_0x375a77,_0x21008c[_0x6a59('0x11')][_0x6a59('0x14')]);return _0x5aa5fe(_0x21008c[_0x6a59('0x11')][_0x6a59('0x14')]);}logger[_0x6a59('0x11')](_0x6a59('0x13'),_0x375a77,_0x21008c[_0x6a59('0x11')][_0x6a59('0x14')]);return _0x3c392f(_0x21008c[_0x6a59('0x11')][_0x6a59('0x14')]);}else{logger['info'](_0x6a59('0x13'),_0x375a77,_0x6a59('0xd'));_0x3c392f(_0x21008c[_0x6a59('0x15')][_0x6a59('0x14')]);}})[_0x6a59('0x16')](function(_0x39ad1e){logger['error'](_0x6a59('0x13'),_0x375a77,_0x39ad1e);_0x5aa5fe(_0x39ad1e);});});} \ No newline at end of file +var _0xe195=['jayson/promise','client','request','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x267f04,_0x18005d){var _0x324621=function(_0x3ef6a9){while(--_0x3ef6a9){_0x267f04['push'](_0x267f04['shift']());}};_0x324621(++_0x18005d);}(_0xe195,0x1c6));var _0x5e19=function(_0x5b1b36,_0x20bc0a){_0x5b1b36=_0x5b1b36-0x0;var _0x133f3d=_0xe195[_0x5b1b36];return _0x133f3d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5e19('0x0'));var BPromise=require(_0x5e19('0x1'));var rs=require(_0x5e19('0x2'));var fs=require('fs');var Redis=require(_0x5e19('0x3'));var db=require(_0x5e19('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e19('0x5'))(_0x5e19('0x6'));var config=require(_0x5e19('0x7'));var jayson=require(_0x5e19('0x8'));var client=jayson[_0x5e19('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ca278,_0x50b913,_0x1e40c4){return new BPromise(function(_0x21e440,_0x377428){return client[_0x5e19('0xa')](_0x2ca278,_0x1e40c4)['then'](function(_0x3a1974){logger['info'](_0x5e19('0xb'),_0x50b913,_0x5e19('0xc'));logger[_0x5e19('0xd')](_0x5e19('0xe'),_0x50b913,_0x5e19('0xc'),JSON[_0x5e19('0xf')](_0x3a1974));if(_0x3a1974[_0x5e19('0x10')]){if(_0x3a1974['error'][_0x5e19('0x11')]===0x1f4){logger[_0x5e19('0x10')](_0x5e19('0xb'),_0x50b913,_0x3a1974[_0x5e19('0x10')][_0x5e19('0x12')]);return _0x377428(_0x3a1974['error'][_0x5e19('0x12')]);}logger[_0x5e19('0x10')]('VoiceContext,\x20%s,\x20%s',_0x50b913,_0x3a1974[_0x5e19('0x10')][_0x5e19('0x12')]);return _0x21e440(_0x3a1974[_0x5e19('0x10')]['message']);}else{logger['info'](_0x5e19('0xb'),_0x50b913,'request\x20sent');_0x21e440(_0x3a1974[_0x5e19('0x13')][_0x5e19('0x12')]);}})[_0x5e19('0x14')](function(_0x5e72a3){logger['error']('VoiceContext,\x20%s,\x20%s',_0x50b913,_0x5e72a3);_0x377428(_0x5e72a3);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index ed2a74a..d8b5cf0 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 _0x654e=['./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3631bd,_0x37d121){var _0xbf0068=function(_0x457120){while(--_0x457120){_0x3631bd['push'](_0x3631bd['shift']());}};_0xbf0068(++_0x37d121);}(_0x654e,0x1e8));var _0xe654=function(_0x810e4d,_0x909ef4){_0x810e4d=_0x810e4d-0x0;var _0x13f01c=_0x654e[_0x810e4d];return _0x13f01c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe654('0x0'));var timeout=require('connect-timeout');var express=require(_0xe654('0x1'));var router=express[_0xe654('0x2')]();var fs_extra=require(_0xe654('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe654('0x4'));var config=require('../../config/environment');var controller=require(_0xe654('0x5'));router[_0xe654('0x6')]('/',auth[_0xe654('0x7')](),controller[_0xe654('0x8')]);router[_0xe654('0x6')](_0xe654('0x9'),auth[_0xe654('0x7')](),controller[_0xe654('0xa')]);router[_0xe654('0x6')](_0xe654('0xb'),auth[_0xe654('0x7')](),controller[_0xe654('0xc')]);router['post']('/',auth[_0xe654('0x7')](),controller[_0xe654('0xd')]);router['put'](_0xe654('0xb'),auth[_0xe654('0x7')](),controller[_0xe654('0xe')]);router[_0xe654('0xf')]('/:id',auth[_0xe654('0x7')](),controller[_0xe654('0x10')]);module['exports']=router; \ No newline at end of file +var _0x5ef5=['index','get','describe','show','post','/:id','delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./voiceDialReport.controller','isAuthenticated'];(function(_0x1f5fbc,_0x5507af){var _0x67da7d=function(_0x5b2a55){while(--_0x5b2a55){_0x1f5fbc['push'](_0x1f5fbc['shift']());}};_0x67da7d(++_0x5507af);}(_0x5ef5,0xa7));var _0x55ef=function(_0x30444b,_0x3260bd){_0x30444b=_0x30444b-0x0;var _0x27f975=_0x5ef5[_0x30444b];return _0x27f975;};'use strict';var multer=require(_0x55ef('0x0'));var util=require(_0x55ef('0x1'));var path=require(_0x55ef('0x2'));var timeout=require(_0x55ef('0x3'));var express=require(_0x55ef('0x4'));var router=express[_0x55ef('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x55ef('0x6'));var config=require('../../config/environment');var controller=require(_0x55ef('0x7'));router['get']('/',auth[_0x55ef('0x8')](),controller[_0x55ef('0x9')]);router[_0x55ef('0xa')]('/describe',auth[_0x55ef('0x8')](),controller[_0x55ef('0xb')]);router['get']('/:id',auth[_0x55ef('0x8')](),controller[_0x55ef('0xc')]);router[_0x55ef('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x55ef('0xe'),auth[_0x55ef('0x8')](),controller['update']);router[_0x55ef('0xf')](_0x55ef('0xe'),auth[_0x55ef('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 19ca650..4948a94 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 _0x24ca=['STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x26c80e,_0x12f763){var _0x9443b4=function(_0x1cbec8){while(--_0x1cbec8){_0x26c80e['push'](_0x26c80e['shift']());}};_0x9443b4(++_0x12f763);}(_0x24ca,0x1bc));var _0xa24c=function(_0x687ddc,_0x2092fa){_0x687ddc=_0x687ddc-0x0;var _0x441991=_0x24ca[_0x687ddc];return _0x441991;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xa24c('0x1')]},'channel':{'type':Sequelize[_0xa24c('0x1')]},'channelstate':{'type':Sequelize[_0xa24c('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa24c('0x1')]},'calleridname':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'language':{'type':Sequelize[_0xa24c('0x1')]},'accountcode':{'type':Sequelize[_0xa24c('0x1')]},'context':{'type':Sequelize[_0xa24c('0x1')]},'exten':{'type':Sequelize[_0xa24c('0x1')]},'priority':{'type':Sequelize[_0xa24c('0x2')]},'uniqueid':{'type':Sequelize[_0xa24c('0x1')]},'linkedid':{'type':Sequelize[_0xa24c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa24c('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridnum':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'destlanguage':{'type':Sequelize[_0xa24c('0x1')]},'destaccountcode':{'type':Sequelize[_0xa24c('0x1')]},'destcontext':{'type':Sequelize[_0xa24c('0x1')]},'destexten':{'type':Sequelize[_0xa24c('0x1')]},'destpriority':{'type':Sequelize[_0xa24c('0x2')]},'destuniqueid':{'type':Sequelize[_0xa24c('0x1')]},'destlinkedid':{'type':Sequelize[_0xa24c('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xa24c('0x1')]},'starttime':{'type':Sequelize[_0xa24c('0x3')]},'answertime':{'type':Sequelize[_0xa24c('0x3')]},'endtime':{'type':Sequelize[_0xa24c('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xa24c('0x4')},'routeId':{'type':Sequelize[_0xa24c('0x2')]},'duration':{'type':Sequelize[_0xa24c('0x2')]},'holdtime':{'type':Sequelize[_0xa24c('0x2')]},'billableseconds':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file +var _0xa41a=['exports','STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x42282c,_0x230809){var _0x1631f5=function(_0x20e27c){while(--_0x20e27c){_0x42282c['push'](_0x42282c['shift']());}};_0x1631f5(++_0x230809);}(_0xa41a,0x6b));var _0xaa41=function(_0x406aca,_0x951c9b){_0x406aca=_0x406aca-0x0;var _0x49370b=_0xa41a[_0x406aca];return _0x49370b;};'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 diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 81a33aa..20bf536 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 _0xbdca=['includeAll','findAll','rows','catch','show','params','keys','include','find','create','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','querystring','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','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','map','VoiceDialReport','rawAttributes','type','key','query','filters','intersection','fields','attributes','length','model','order','sort','where','filter','VIRTUAL','merge','options'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0xbdca,0x137));var _0xabdc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbdca[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xabdc('0x0'));var rimraf=require(_0xabdc('0x1'));var zipdir=require(_0xabdc('0x2'));var jsonpatch=require(_0xabdc('0x3'));var rp=require(_0xabdc('0x4'));var moment=require(_0xabdc('0x5'));var BPromise=require(_0xabdc('0x6'));var Mustache=require(_0xabdc('0x7'));var util=require(_0xabdc('0x8'));var path=require(_0xabdc('0x9'));var sox=require(_0xabdc('0xa'));var csv=require(_0xabdc('0xb'));var ejs=require(_0xabdc('0xc'));var fs=require('fs');var fs_extra=require(_0xabdc('0xd'));var _=require(_0xabdc('0xe'));var squel=require(_0xabdc('0xf'));var crypto=require('crypto');var jsforce=require(_0xabdc('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xabdc('0x11'));var Papa=require('papaparse');var Redis=require(_0xabdc('0x12'));var authService=require(_0xabdc('0x13'));var qs=require(_0xabdc('0x14'));var as=require(_0xabdc('0x15'));var hardwareService=require(_0xabdc('0x16'));var logger=require(_0xabdc('0x17'))('api');var utils=require(_0xabdc('0x18'));var config=require(_0xabdc('0x19'));var licenseUtil=require(_0xabdc('0x1a'));var db=require(_0xabdc('0x1b'))['db'];function respondWithStatusCode(_0x125f42,_0x3bea6f){_0x3bea6f=_0x3bea6f||0xcc;return function(_0x3e516f){if(_0x3e516f){return _0x125f42[_0xabdc('0x1c')](_0x3bea6f);}return _0x125f42[_0xabdc('0x1d')](_0x3bea6f)['end']();};}function respondWithResult(_0x4fe5a4,_0x19ab96){_0x19ab96=_0x19ab96||0xc8;return function(_0x5d97a9){if(_0x5d97a9){return _0x4fe5a4['status'](_0x19ab96)[_0xabdc('0x1e')](_0x5d97a9);}};}function respondWithFilteredResult(_0x7d6644,_0x1a683e){return function(_0x520747){if(_0x520747){var _0x1505e9=typeof _0x1a683e[_0xabdc('0x1f')]===_0xabdc('0x20')&&typeof _0x1a683e[_0xabdc('0x21')]==='undefined';var _0x5b3b6a=_0x520747['count'];var _0x95d0b8=_0x1505e9?0x0:_0x1a683e[_0xabdc('0x1f')];var _0x35fb0c=_0x1505e9?_0x520747[_0xabdc('0x22')]:_0x1a683e['offset']+_0x1a683e[_0xabdc('0x21')];var _0x8806a9;if(_0x35fb0c>=_0x5b3b6a){_0x35fb0c=_0x5b3b6a;_0x8806a9=0xc8;}else{_0x8806a9=0xce;}_0x7d6644[_0xabdc('0x1d')](_0x8806a9);return _0x7d6644[_0xabdc('0x23')](_0xabdc('0x24'),_0x95d0b8+'-'+_0x35fb0c+'/'+_0x5b3b6a)[_0xabdc('0x1e')](_0x520747);}return null;};}function patchUpdates(_0x44285c){return function(_0x141367){try{jsonpatch[_0xabdc('0x25')](_0x141367,_0x44285c,!![]);}catch(_0x5bcab8){return BPromise[_0xabdc('0x26')](_0x5bcab8);}return _0x141367['save']();};}function saveUpdates(_0x1c2e8a,_0x59a236){return function(_0x34967b){if(_0x34967b){return _0x34967b[_0xabdc('0x27')](_0x1c2e8a)[_0xabdc('0x28')](function(_0x108d62){return _0x108d62;});}return null;};}function removeEntity(_0x2a5a42,_0x11ec5a){return function(_0x24e982){if(_0x24e982){return _0x24e982[_0xabdc('0x29')]()['then'](function(){_0x2a5a42[_0xabdc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd150f1,_0x32eabd){return function(_0x4eaaa9){if(!_0x4eaaa9){_0xd150f1['sendStatus'](0x194);}return _0x4eaaa9;};}function handleError(_0x125400,_0x5af4a1){_0x5af4a1=_0x5af4a1||0x1f4;return function(_0x1cee88){logger['error'](_0x1cee88[_0xabdc('0x2a')]);if(_0x1cee88[_0xabdc('0x2b')]){delete _0x1cee88[_0xabdc('0x2b')];}_0x125400[_0xabdc('0x1d')](_0x5af4a1)['send'](_0x1cee88);};}exports[_0xabdc('0x2c')]=function(_0x346ab6,_0xec0b0e){var _0xdf81d0={},_0x27d6b1={},_0x529286={'count':0x0,'rows':[]};var _0x1f6fd1=_[_0xabdc('0x2d')](db[_0xabdc('0x2e')][_0xabdc('0x2f')],function(_0x51031d){return{'name':_0x51031d['fieldName'],'type':_0x51031d[_0xabdc('0x30')][_0xabdc('0x31')]};});_0x27d6b1['model']=_[_0xabdc('0x2d')](_0x1f6fd1,_0xabdc('0x2b'));_0x27d6b1[_0xabdc('0x32')]=_['keys'](_0x346ab6[_0xabdc('0x32')]);_0x27d6b1[_0xabdc('0x33')]=_[_0xabdc('0x34')](_0x27d6b1['model'],_0x27d6b1[_0xabdc('0x32')]);_0xdf81d0['attributes']=_[_0xabdc('0x34')](_0x27d6b1['model'],qs[_0xabdc('0x35')](_0x346ab6[_0xabdc('0x32')][_0xabdc('0x35')]));_0xdf81d0[_0xabdc('0x36')]=_0xdf81d0[_0xabdc('0x36')][_0xabdc('0x37')]?_0xdf81d0[_0xabdc('0x36')]:_0x27d6b1[_0xabdc('0x38')];if(!_0x346ab6[_0xabdc('0x32')]['hasOwnProperty']('nolimit')){_0xdf81d0[_0xabdc('0x21')]=qs[_0xabdc('0x21')](_0x346ab6[_0xabdc('0x32')][_0xabdc('0x21')]);_0xdf81d0[_0xabdc('0x1f')]=qs[_0xabdc('0x1f')](_0x346ab6[_0xabdc('0x32')][_0xabdc('0x1f')]);}_0xdf81d0[_0xabdc('0x39')]=qs['sort'](_0x346ab6[_0xabdc('0x32')][_0xabdc('0x3a')]);_0xdf81d0[_0xabdc('0x3b')]=qs[_0xabdc('0x33')](_['pick'](_0x346ab6[_0xabdc('0x32')],_0x27d6b1['filters']),_0x1f6fd1);if(_0x346ab6[_0xabdc('0x32')][_0xabdc('0x3c')]){_0xdf81d0[_0xabdc('0x3b')]=_['merge'](_0xdf81d0[_0xabdc('0x3b')],{'$or':_[_0xabdc('0x2d')](_0x1f6fd1,function(_0x8eb423){if(_0x8eb423[_0xabdc('0x30')]!==_0xabdc('0x3d')){var _0x4595c6={};_0x4595c6[_0x8eb423[_0xabdc('0x2b')]]={'$like':'%'+_0x346ab6[_0xabdc('0x32')][_0xabdc('0x3c')]+'%'};return _0x4595c6;}})});}_0xdf81d0=_[_0xabdc('0x3e')]({},_0xdf81d0,_0x346ab6[_0xabdc('0x3f')]);var _0x568fdc={'where':_0xdf81d0['where']};return db[_0xabdc('0x2e')]['count'](_0x568fdc)[_0xabdc('0x28')](function(_0x4ff557){_0x529286[_0xabdc('0x22')]=_0x4ff557;if(_0x346ab6[_0xabdc('0x32')][_0xabdc('0x40')]){_0xdf81d0['include']=[{'all':!![]}];}return db[_0xabdc('0x2e')][_0xabdc('0x41')](_0xdf81d0);})['then'](function(_0x5cc418){_0x529286[_0xabdc('0x42')]=_0x5cc418;return _0x529286;})[_0xabdc('0x28')](respondWithFilteredResult(_0xec0b0e,_0xdf81d0))[_0xabdc('0x43')](handleError(_0xec0b0e,null));};exports[_0xabdc('0x44')]=function(_0x2410e5,_0xfe9a1f){var _0x42581b={'raw':!![],'where':{'id':_0x2410e5[_0xabdc('0x45')]['id']}},_0xbb33dc={};_0xbb33dc['model']=_['keys'](db['VoiceDialReport'][_0xabdc('0x2f')]);_0xbb33dc[_0xabdc('0x32')]=_[_0xabdc('0x46')](_0x2410e5['query']);_0xbb33dc[_0xabdc('0x33')]=_[_0xabdc('0x34')](_0xbb33dc[_0xabdc('0x38')],_0xbb33dc[_0xabdc('0x32')]);_0x42581b[_0xabdc('0x36')]=_[_0xabdc('0x34')](_0xbb33dc[_0xabdc('0x38')],qs[_0xabdc('0x35')](_0x2410e5['query']['fields']));_0x42581b[_0xabdc('0x36')]=_0x42581b[_0xabdc('0x36')][_0xabdc('0x37')]?_0x42581b[_0xabdc('0x36')]:_0xbb33dc['model'];if(_0x2410e5[_0xabdc('0x32')][_0xabdc('0x40')]){_0x42581b[_0xabdc('0x47')]=[{'all':!![]}];}_0x42581b=_[_0xabdc('0x3e')]({},_0x42581b,_0x2410e5[_0xabdc('0x3f')]);return db['VoiceDialReport'][_0xabdc('0x48')](_0x42581b)[_0xabdc('0x28')](handleEntityNotFound(_0xfe9a1f,null))['then'](respondWithResult(_0xfe9a1f,null))['catch'](handleError(_0xfe9a1f,null));};exports[_0xabdc('0x49')]=function(_0x29b784,_0x833d1a){return db[_0xabdc('0x2e')]['create'](_0x29b784['body'],{})[_0xabdc('0x28')](respondWithResult(_0x833d1a,0xc9))['catch'](handleError(_0x833d1a,null));};exports[_0xabdc('0x27')]=function(_0x1f8b8b,_0x5db32b){if(_0x1f8b8b['body']['id']){delete _0x1f8b8b['body']['id'];}return db[_0xabdc('0x2e')]['find']({'where':{'id':_0x1f8b8b[_0xabdc('0x45')]['id']}})['then'](handleEntityNotFound(_0x5db32b,null))[_0xabdc('0x28')](saveUpdates(_0x1f8b8b['body'],null))[_0xabdc('0x28')](respondWithResult(_0x5db32b,null))['catch'](handleError(_0x5db32b,null));};exports['destroy']=function(_0x516dea,_0x169a73){return db[_0xabdc('0x2e')]['find']({'where':{'id':_0x516dea[_0xabdc('0x45')]['id']}})['then'](handleEntityNotFound(_0x169a73,null))[_0xabdc('0x28')](removeEntity(_0x169a73,null))[_0xabdc('0x43')](handleError(_0x169a73,null));};exports[_0xabdc('0x4a')]=function(_0x5ddee5,_0x19024e){return db[_0xabdc('0x2e')][_0xabdc('0x4a')]()[_0xabdc('0x28')](respondWithResult(_0x19024e,null))[_0xabdc('0x43')](handleError(_0x19024e,null));}; \ No newline at end of file +var _0x7f25=['filter','merge','options','VoiceDialReport','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x4c753a,_0x21664f){var _0x1f0ff1=function(_0x1f3e18){while(--_0x1f3e18){_0x4c753a['push'](_0x4c753a['shift']());}};_0x1f0ff1(++_0x21664f);}(_0x7f25,0xf7));var _0x57f2=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0x7f25[_0x1d558c];return _0x15767d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57f2('0x0'));var zipdir=require(_0x57f2('0x1'));var jsonpatch=require(_0x57f2('0x2'));var rp=require(_0x57f2('0x3'));var moment=require(_0x57f2('0x4'));var BPromise=require(_0x57f2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x57f2('0x6'));var ejs=require(_0x57f2('0x7'));var fs=require('fs');var fs_extra=require(_0x57f2('0x8'));var _=require(_0x57f2('0x9'));var squel=require(_0x57f2('0xa'));var crypto=require('crypto');var jsforce=require(_0x57f2('0xb'));var deskjs=require(_0x57f2('0xc'));var toCsv=require('to-csv');var querystring=require(_0x57f2('0xd'));var Papa=require(_0x57f2('0xe'));var Redis=require(_0x57f2('0xf'));var authService=require(_0x57f2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x57f2('0x11'));var hardwareService=require(_0x57f2('0x12'));var logger=require(_0x57f2('0x13'))(_0x57f2('0x14'));var utils=require('../../config/utils');var config=require(_0x57f2('0x15'));var licenseUtil=require(_0x57f2('0x16'));var db=require(_0x57f2('0x17'))['db'];function respondWithStatusCode(_0x36cc22,_0x2bd51a){_0x2bd51a=_0x2bd51a||0xcc;return function(_0x2bf6d9){if(_0x2bf6d9){return _0x36cc22[_0x57f2('0x18')](_0x2bd51a);}return _0x36cc22['status'](_0x2bd51a)[_0x57f2('0x19')]();};}function respondWithResult(_0x5842af,_0x56c58f){_0x56c58f=_0x56c58f||0xc8;return function(_0x20383b){if(_0x20383b){return _0x5842af[_0x57f2('0x1a')](_0x56c58f)[_0x57f2('0x1b')](_0x20383b);}};}function respondWithFilteredResult(_0x4bd576,_0x56ed43){return function(_0xb191f8){if(_0xb191f8){var _0x3c2ea2=typeof _0x56ed43[_0x57f2('0x1c')]===_0x57f2('0x1d')&&typeof _0x56ed43[_0x57f2('0x1e')]===_0x57f2('0x1d');var _0x49d323=_0xb191f8['count'];var _0x39250a=_0x3c2ea2?0x0:_0x56ed43[_0x57f2('0x1c')];var _0x53297d=_0x3c2ea2?_0xb191f8[_0x57f2('0x1f')]:_0x56ed43[_0x57f2('0x1c')]+_0x56ed43['limit'];var _0x1207c9;if(_0x53297d>=_0x49d323){_0x53297d=_0x49d323;_0x1207c9=0xc8;}else{_0x1207c9=0xce;}_0x4bd576[_0x57f2('0x1a')](_0x1207c9);return _0x4bd576[_0x57f2('0x20')](_0x57f2('0x21'),_0x39250a+'-'+_0x53297d+'/'+_0x49d323)[_0x57f2('0x1b')](_0xb191f8);}return null;};}function patchUpdates(_0x591953){return function(_0xa7586d){try{jsonpatch[_0x57f2('0x22')](_0xa7586d,_0x591953,!![]);}catch(_0x11a9e3){return BPromise[_0x57f2('0x23')](_0x11a9e3);}return _0xa7586d[_0x57f2('0x24')]();};}function saveUpdates(_0x44d006,_0xb7d91a){return function(_0x4942e0){if(_0x4942e0){return _0x4942e0[_0x57f2('0x25')](_0x44d006)[_0x57f2('0x26')](function(_0x3f098f){return _0x3f098f;});}return null;};}function removeEntity(_0x5a2f3b,_0x5f367f){return function(_0x15d36f){if(_0x15d36f){return _0x15d36f[_0x57f2('0x27')]()[_0x57f2('0x26')](function(){_0x5a2f3b['status'](0xcc)[_0x57f2('0x19')]();});}};}function handleEntityNotFound(_0x59e180,_0x1ec7c3){return function(_0x31dd1d){if(!_0x31dd1d){_0x59e180[_0x57f2('0x18')](0x194);}return _0x31dd1d;};}function handleError(_0x4c151f,_0x13e74e){_0x13e74e=_0x13e74e||0x1f4;return function(_0x852f37){logger['error'](_0x852f37[_0x57f2('0x28')]);if(_0x852f37[_0x57f2('0x29')]){delete _0x852f37[_0x57f2('0x29')];}_0x4c151f[_0x57f2('0x1a')](_0x13e74e)[_0x57f2('0x2a')](_0x852f37);};}exports[_0x57f2('0x2b')]=function(_0x1fb0a0,_0x5ea01f){var _0x301ff9={},_0x18aa71={},_0x4316cf={'count':0x0,'rows':[]};var _0x42d659=_[_0x57f2('0x2c')](db['VoiceDialReport'][_0x57f2('0x2d')],function(_0x5aca0b){return{'name':_0x5aca0b[_0x57f2('0x2e')],'type':_0x5aca0b[_0x57f2('0x2f')][_0x57f2('0x30')]};});_0x18aa71[_0x57f2('0x31')]=_['map'](_0x42d659,_0x57f2('0x29'));_0x18aa71['query']=_[_0x57f2('0x32')](_0x1fb0a0[_0x57f2('0x33')]);_0x18aa71[_0x57f2('0x34')]=_[_0x57f2('0x35')](_0x18aa71['model'],_0x18aa71['query']);_0x301ff9[_0x57f2('0x36')]=_['intersection'](_0x18aa71[_0x57f2('0x31')],qs[_0x57f2('0x37')](_0x1fb0a0['query']['fields']));_0x301ff9[_0x57f2('0x36')]=_0x301ff9[_0x57f2('0x36')]['length']?_0x301ff9[_0x57f2('0x36')]:_0x18aa71[_0x57f2('0x31')];if(!_0x1fb0a0[_0x57f2('0x33')][_0x57f2('0x38')](_0x57f2('0x39'))){_0x301ff9[_0x57f2('0x1e')]=qs[_0x57f2('0x1e')](_0x1fb0a0[_0x57f2('0x33')]['limit']);_0x301ff9[_0x57f2('0x1c')]=qs[_0x57f2('0x1c')](_0x1fb0a0['query'][_0x57f2('0x1c')]);}_0x301ff9['order']=qs[_0x57f2('0x3a')](_0x1fb0a0['query'][_0x57f2('0x3a')]);_0x301ff9[_0x57f2('0x3b')]=qs[_0x57f2('0x34')](_[_0x57f2('0x3c')](_0x1fb0a0['query'],_0x18aa71[_0x57f2('0x34')]),_0x42d659);if(_0x1fb0a0['query'][_0x57f2('0x3d')]){_0x301ff9[_0x57f2('0x3b')]=_[_0x57f2('0x3e')](_0x301ff9[_0x57f2('0x3b')],{'$or':_[_0x57f2('0x2c')](_0x42d659,function(_0x2239ba){if(_0x2239ba['type']!=='VIRTUAL'){var _0x4be0b5={};_0x4be0b5[_0x2239ba[_0x57f2('0x29')]]={'$like':'%'+_0x1fb0a0[_0x57f2('0x33')][_0x57f2('0x3d')]+'%'};return _0x4be0b5;}})});}_0x301ff9=_['merge']({},_0x301ff9,_0x1fb0a0[_0x57f2('0x3f')]);var _0x5db671={'where':_0x301ff9['where']};return db[_0x57f2('0x40')][_0x57f2('0x1f')](_0x5db671)[_0x57f2('0x26')](function(_0x5cff97){_0x4316cf['count']=_0x5cff97;if(_0x1fb0a0[_0x57f2('0x33')][_0x57f2('0x41')]){_0x301ff9[_0x57f2('0x42')]=[{'all':!![]}];}return db[_0x57f2('0x40')][_0x57f2('0x43')](_0x301ff9);})[_0x57f2('0x26')](function(_0x49665c){_0x4316cf[_0x57f2('0x44')]=_0x49665c;return _0x4316cf;})['then'](respondWithFilteredResult(_0x5ea01f,_0x301ff9))[_0x57f2('0x45')](handleError(_0x5ea01f,null));};exports[_0x57f2('0x46')]=function(_0x3296b1,_0x45289e){var _0x46a75f={'raw':!![],'where':{'id':_0x3296b1[_0x57f2('0x47')]['id']}},_0x57cbed={};_0x57cbed[_0x57f2('0x31')]=_['keys'](db[_0x57f2('0x40')][_0x57f2('0x2d')]);_0x57cbed[_0x57f2('0x33')]=_['keys'](_0x3296b1['query']);_0x57cbed[_0x57f2('0x34')]=_[_0x57f2('0x35')](_0x57cbed[_0x57f2('0x31')],_0x57cbed[_0x57f2('0x33')]);_0x46a75f[_0x57f2('0x36')]=_[_0x57f2('0x35')](_0x57cbed[_0x57f2('0x31')],qs[_0x57f2('0x37')](_0x3296b1[_0x57f2('0x33')][_0x57f2('0x37')]));_0x46a75f[_0x57f2('0x36')]=_0x46a75f[_0x57f2('0x36')][_0x57f2('0x48')]?_0x46a75f[_0x57f2('0x36')]:_0x57cbed[_0x57f2('0x31')];if(_0x3296b1[_0x57f2('0x33')][_0x57f2('0x41')]){_0x46a75f[_0x57f2('0x42')]=[{'all':!![]}];}_0x46a75f=_[_0x57f2('0x3e')]({},_0x46a75f,_0x3296b1['options']);return db[_0x57f2('0x40')][_0x57f2('0x49')](_0x46a75f)[_0x57f2('0x26')](handleEntityNotFound(_0x45289e,null))[_0x57f2('0x26')](respondWithResult(_0x45289e,null))[_0x57f2('0x45')](handleError(_0x45289e,null));};exports[_0x57f2('0x4a')]=function(_0x585b5d,_0x36cbe0){return db[_0x57f2('0x40')][_0x57f2('0x4a')](_0x585b5d[_0x57f2('0x4b')],{})['then'](respondWithResult(_0x36cbe0,0xc9))[_0x57f2('0x45')](handleError(_0x36cbe0,null));};exports[_0x57f2('0x25')]=function(_0x3ba271,_0x4400e5){if(_0x3ba271['body']['id']){delete _0x3ba271[_0x57f2('0x4b')]['id'];}return db[_0x57f2('0x40')][_0x57f2('0x49')]({'where':{'id':_0x3ba271[_0x57f2('0x47')]['id']}})['then'](handleEntityNotFound(_0x4400e5,null))[_0x57f2('0x26')](saveUpdates(_0x3ba271['body'],null))[_0x57f2('0x26')](respondWithResult(_0x4400e5,null))[_0x57f2('0x45')](handleError(_0x4400e5,null));};exports[_0x57f2('0x27')]=function(_0x11de1a,_0x3fd524){return db[_0x57f2('0x40')][_0x57f2('0x49')]({'where':{'id':_0x11de1a[_0x57f2('0x47')]['id']}})[_0x57f2('0x26')](handleEntityNotFound(_0x3fd524,null))[_0x57f2('0x26')](removeEntity(_0x3fd524,null))[_0x57f2('0x45')](handleError(_0x3fd524,null));};exports[_0x57f2('0x4c')]=function(_0x1c8b8e,_0x268670){return db['VoiceDialReport'][_0x57f2('0x4c')]()[_0x57f2('0x26')](respondWithResult(_0x268670,null))[_0x57f2('0x45')](handleError(_0x268670,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index b17476a..0663ddc 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 _0x4927=['report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport'];(function(_0x4ab395,_0x3a81c6){var _0x4e56ed=function(_0x68f7f3){while(--_0x68f7f3){_0x4ab395['push'](_0x4ab395['shift']());}};_0x4e56ed(++_0x3a81c6);}(_0x4927,0x122));var _0x7492=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4927[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x7492('0x0'));var util=require(_0x7492('0x1'));var logger=require(_0x7492('0x2'))(_0x7492('0x3'));var moment=require(_0x7492('0x4'));var BPromise=require(_0x7492('0x5'));var rp=require(_0x7492('0x6'));var fs=require('fs');var path=require(_0x7492('0x7'));var rimraf=require(_0x7492('0x8'));var config=require(_0x7492('0x9'));var attributes=require(_0x7492('0xa'));module[_0x7492('0xb')]=function(_0x110eca,_0x276317){return _0x110eca[_0x7492('0xc')](_0x7492('0xd'),attributes,{'tableName':_0x7492('0xe'),'paranoid':![],'indexes':[{'fields':[_0x7492('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7f4c=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','report_dial','uniqueid','lodash'];(function(_0x4252fb,_0x2875b6){var _0x40b2ae=function(_0xf9ca79){while(--_0xf9ca79){_0x4252fb['push'](_0x4252fb['shift']());}};_0x40b2ae(++_0x2875b6);}(_0x7f4c,0xd0));var _0xc7f4=function(_0x185f27,_0x3498d9){_0x185f27=_0x185f27-0x0;var _0x2b400d=_0x7f4c[_0x185f27];return _0x2b400d;};'use strict';var _=require(_0xc7f4('0x0'));var util=require('util');var logger=require(_0xc7f4('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc7f4('0x2'));var rp=require(_0xc7f4('0x3'));var fs=require('fs');var path=require(_0xc7f4('0x4'));var rimraf=require(_0xc7f4('0x5'));var config=require(_0xc7f4('0x6'));var attributes=require(_0xc7f4('0x7'));module[_0xc7f4('0x8')]=function(_0x5f5a05,_0xf467a0){return _0x5f5a05['define']('VoiceDialReport',attributes,{'tableName':_0xc7f4('0x9'),'paranoid':![],'indexes':[{'fields':[_0xc7f4('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 36c5efd..ea5930e 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 _0x883f=['message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','where','attributes','UpdateVoiceDialReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x55ddb3,_0x438146){var _0x355a70=function(_0x5b18ce){while(--_0x5b18ce){_0x55ddb3['push'](_0x55ddb3['shift']());}};_0x355a70(++_0x438146);}(_0x883f,0x14c));var _0xf883=function(_0x1be790,_0x112549){_0x1be790=_0x1be790-0x0;var _0x7668c8=_0x883f[_0x1be790];return _0x7668c8;};'use strict';var _=require(_0xf883('0x0'));var util=require('util');var moment=require(_0xf883('0x1'));var BPromise=require(_0xf883('0x2'));var rs=require(_0xf883('0x3'));var fs=require('fs');var Redis=require(_0xf883('0x4'));var db=require(_0xf883('0x5'))['db'];var utils=require(_0xf883('0x6'));var logger=require('../../config/logger')(_0xf883('0x7'));var config=require(_0xf883('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf883('0x9')][_0xf883('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x580e41,_0x55fa98,_0x38338a){return new BPromise(function(_0x3e845e,_0x7ecf5f){return client[_0xf883('0xb')](_0x580e41,_0x38338a)[_0xf883('0xc')](function(_0x313e65){logger[_0xf883('0xd')](_0xf883('0xe'),_0x55fa98,_0xf883('0xf'));logger[_0xf883('0x10')](_0xf883('0x11'),_0x55fa98,'request\x20sent',JSON[_0xf883('0x12')](_0x313e65));if(_0x313e65['error']){if(_0x313e65[_0xf883('0x13')]['code']===0x1f4){logger[_0xf883('0x13')](_0xf883('0xe'),_0x55fa98,_0x313e65[_0xf883('0x13')][_0xf883('0x14')]);return _0x7ecf5f(_0x313e65[_0xf883('0x13')][_0xf883('0x14')]);}logger[_0xf883('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x55fa98,_0x313e65['error']['message']);return _0x3e845e(_0x313e65[_0xf883('0x13')][_0xf883('0x14')]);}else{logger[_0xf883('0xd')](_0xf883('0xe'),_0x55fa98,_0xf883('0xf'));_0x3e845e(_0x313e65[_0xf883('0x15')]['message']);}})[_0xf883('0x16')](function(_0x1b2dd5){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x55fa98,_0x1b2dd5);_0x7ecf5f(_0x1b2dd5);});});}exports[_0xf883('0x17')]=function(_0x5242de){var _0x2837d1=this;return new Promise(function(_0x2d41c3,_0x29338a){return db[_0xf883('0x18')][_0xf883('0x19')](_0x5242de[_0xf883('0x1a')],{'raw':_0x5242de[_0xf883('0x1b')]?_0x5242de[_0xf883('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xf883('0xc')](function(_0x40d90d){logger[_0xf883('0xd')]('CreateVoiceDialReport',_0x5242de);logger[_0xf883('0x10')]('CreateVoiceDialReport',_0x5242de,JSON[_0xf883('0x12')](_0x40d90d));_0x2d41c3(_0x40d90d);})[_0xf883('0x16')](function(_0x25714c){logger[_0xf883('0x13')](_0xf883('0x17'),_0x25714c['message'],_0x5242de);_0x29338a(_0x2837d1[_0xf883('0x13')](0x1f4,_0x25714c[_0xf883('0x14')]));});});};exports['UpdateVoiceDialReport']=function(_0x53849f){var _0x2a4a0a=this;return new Promise(function(_0x45c22a,_0x5c85e0){return db[_0xf883('0x18')]['update'](_0x53849f['body'],{'raw':_0x53849f[_0xf883('0x1b')]?_0x53849f[_0xf883('0x1b')][_0xf883('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53849f[_0xf883('0x1b')]?_0x53849f[_0xf883('0x1b')][_0xf883('0x1d')]||null:null,'attributes':_0x53849f[_0xf883('0x1b')]?_0x53849f[_0xf883('0x1b')][_0xf883('0x1e')]||null:null,'limit':_0x53849f[_0xf883('0x1b')]?_0x53849f[_0xf883('0x1b')]['limit']||null:null})['then'](function(_0x222488){logger['info'](_0xf883('0x1f'),_0x53849f);logger[_0xf883('0x10')](_0xf883('0x1f'),_0x53849f,JSON[_0xf883('0x12')](_0x222488));_0x45c22a(_0x222488);})[_0xf883('0x16')](function(_0x519a00){logger[_0xf883('0x13')]('UpdateVoiceDialReport',_0x519a00[_0xf883('0x14')],_0x53849f);_0x5c85e0(_0x2a4a0a[_0xf883('0x13')](0x1f4,_0x519a00[_0xf883('0x14')]));});});}; \ No newline at end of file +var _0x931a=['then','info','VoiceDialReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','VoiceDialReport','create','body','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2fa1c6,_0x4a5b8d){var _0x5f3257=function(_0x195b53){while(--_0x195b53){_0x2fa1c6['push'](_0x2fa1c6['shift']());}};_0x5f3257(++_0x4a5b8d);}(_0x931a,0x78));var _0xa931=function(_0x3226b5,_0x297318){_0x3226b5=_0x3226b5-0x0;var _0x32bb4a=_0x931a[_0x3226b5];return _0x32bb4a;};'use strict';var _=require(_0xa931('0x0'));var util=require('util');var moment=require(_0xa931('0x1'));var BPromise=require(_0xa931('0x2'));var rs=require(_0xa931('0x3'));var fs=require('fs');var Redis=require(_0xa931('0x4'));var db=require(_0xa931('0x5'))['db'];var utils=require(_0xa931('0x6'));var logger=require(_0xa931('0x7'))(_0xa931('0x8'));var config=require(_0xa931('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa931('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b98d9,_0x36853f,_0xb918f3){return new BPromise(function(_0x4a6fef,_0x47aaba){return client[_0xa931('0xb')](_0x5b98d9,_0xb918f3)[_0xa931('0xc')](function(_0xfcf564){logger[_0xa931('0xd')](_0xa931('0xe'),_0x36853f,'request\x20sent');logger[_0xa931('0xf')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x36853f,'request\x20sent',JSON[_0xa931('0x10')](_0xfcf564));if(_0xfcf564[_0xa931('0x11')]){if(_0xfcf564[_0xa931('0x11')][_0xa931('0x12')]===0x1f4){logger['error'](_0xa931('0xe'),_0x36853f,_0xfcf564[_0xa931('0x11')]['message']);return _0x47aaba(_0xfcf564['error'][_0xa931('0x13')]);}logger['error'](_0xa931('0xe'),_0x36853f,_0xfcf564[_0xa931('0x11')][_0xa931('0x13')]);return _0x4a6fef(_0xfcf564[_0xa931('0x11')][_0xa931('0x13')]);}else{logger[_0xa931('0xd')](_0xa931('0xe'),_0x36853f,_0xa931('0x14'));_0x4a6fef(_0xfcf564['result']['message']);}})[_0xa931('0x15')](function(_0x1b2491){logger['error'](_0xa931('0xe'),_0x36853f,_0x1b2491);_0x47aaba(_0x1b2491);});});}exports['CreateVoiceDialReport']=function(_0x37df42){var _0x553934=this;return new Promise(function(_0x4904f6,_0x101f95){return db[_0xa931('0x16')][_0xa931('0x17')](_0x37df42[_0xa931('0x18')],{'raw':_0x37df42['options']?_0x37df42[_0xa931('0x19')][_0xa931('0x1a')]===undefined?!![]:![]:!![]})[_0xa931('0xc')](function(_0x16f7c4){logger[_0xa931('0xd')](_0xa931('0x1b'),_0x37df42);logger[_0xa931('0xf')]('CreateVoiceDialReport',_0x37df42,JSON['stringify'](_0x16f7c4));_0x4904f6(_0x16f7c4);})[_0xa931('0x15')](function(_0x4aa01c){logger[_0xa931('0x11')]('CreateVoiceDialReport',_0x4aa01c[_0xa931('0x13')],_0x37df42);_0x101f95(_0x553934[_0xa931('0x11')](0x1f4,_0x4aa01c[_0xa931('0x13')]));});});};exports[_0xa931('0x1c')]=function(_0x414014){var _0xb5cd63=this;return new Promise(function(_0x3c21c1,_0x1d4d37){return db[_0xa931('0x16')][_0xa931('0x1d')](_0x414014[_0xa931('0x18')],{'raw':_0x414014['options']?_0x414014[_0xa931('0x19')][_0xa931('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x414014['options']?_0x414014['options'][_0xa931('0x1e')]||null:null,'attributes':_0x414014[_0xa931('0x19')]?_0x414014[_0xa931('0x19')][_0xa931('0x1f')]||null:null,'limit':_0x414014[_0xa931('0x19')]?_0x414014[_0xa931('0x19')][_0xa931('0x20')]||null:null})[_0xa931('0xc')](function(_0x36c414){logger[_0xa931('0xd')](_0xa931('0x1c'),_0x414014);logger['debug'](_0xa931('0x1c'),_0x414014,JSON[_0xa931('0x10')](_0x36c414));_0x3c21c1(_0x36c414);})[_0xa931('0x15')](function(_0xa34f39){logger[_0xa931('0x11')](_0xa931('0x1c'),_0xa34f39[_0xa931('0x13')],_0x414014);_0x1d4d37(_0xb5cd63[_0xa931('0x11')](0x1f4,_0xa34f39[_0xa931('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index cb047c8..16a38f1 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 _0x3a32=['multer','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','post','put','/:id','update','delete','destroy','exports'];(function(_0x13fd82,_0x1ee0dd){var _0x55cc3a=function(_0x1190a8){while(--_0x1190a8){_0x13fd82['push'](_0x13fd82['shift']());}};_0x55cc3a(++_0x1ee0dd);}(_0x3a32,0x66));var _0x23a3=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x3a32[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x23a3('0x0'));var util=require('util');var path=require(_0x23a3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x23a3('0x2')]();var fs_extra=require(_0x23a3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x23a3('0x4'));var config=require(_0x23a3('0x5'));var controller=require(_0x23a3('0x6'));router[_0x23a3('0x7')]('/',auth[_0x23a3('0x8')](),controller[_0x23a3('0x9')]);router[_0x23a3('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x23a3('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x23a3('0xa')]('/:id/applications',auth[_0x23a3('0x8')](),controller['addApplications']);router[_0x23a3('0xb')](_0x23a3('0xc'),auth[_0x23a3('0x8')](),controller[_0x23a3('0xd')]);router[_0x23a3('0xe')](_0x23a3('0xc'),auth[_0x23a3('0x8')](),controller[_0x23a3('0xf')]);module[_0x23a3('0x10')]=router; \ No newline at end of file +var _0xd21d=['../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','create','/:id/applications','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4e5f34,_0x166307){var _0x1e9b8f=function(_0x49e25b){while(--_0x49e25b){_0x4e5f34['push'](_0x4e5f34['shift']());}};_0x1e9b8f(++_0x166307);}(_0xd21d,0x174));var _0xdd21=function(_0x314bb5,_0x476e6a){_0x314bb5=_0x314bb5-0x0;var _0x32c85e=_0xd21d[_0x314bb5];return _0x32c85e;};'use strict';var multer=require(_0xdd21('0x0'));var util=require(_0xdd21('0x1'));var path=require(_0xdd21('0x2'));var timeout=require(_0xdd21('0x3'));var express=require(_0xdd21('0x4'));var router=express[_0xdd21('0x5')]();var fs_extra=require(_0xdd21('0x6'));var auth=require(_0xdd21('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdd21('0x8'));var controller=require(_0xdd21('0x9'));router[_0xdd21('0xa')]('/',auth[_0xdd21('0xb')](),controller['index']);router[_0xdd21('0xa')](_0xdd21('0xc'),auth[_0xdd21('0xb')](),controller[_0xdd21('0xd')]);router[_0xdd21('0xe')]('/',auth[_0xdd21('0xb')](),controller[_0xdd21('0xf')]);router['post'](_0xdd21('0x10'),auth['isAuthenticated'](),controller['addApplications']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xdd21('0x11')]);router[_0xdd21('0x12')](_0xdd21('0xc'),auth[_0xdd21('0xb')](),controller['destroy']);module[_0xdd21('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 808f936..f360f22 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 _0xeaf3=['sequelize','exports','STRING','compositeIndex','NoOp','ENUM','outbound','internal','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','getDataValue','exten'];(function(_0x403ff8,_0x459e58){var _0xfdee81=function(_0x2f65f8){while(--_0x2f65f8){_0x403ff8['push'](_0x403ff8['shift']());}};_0xfdee81(++_0x459e58);}(_0xeaf3,0x17a));var _0x3eaf=function(_0xf51f07,_0x56eb8d){_0xf51f07=_0xf51f07-0x0;var _0x41748a=_0xeaf3[_0xf51f07];return _0x41748a;};'use strict';var Sequelize=require(_0x3eaf('0x0'));module[_0x3eaf('0x1')]={'context':{'type':Sequelize[_0x3eaf('0x2')],'allowNull':![],'unique':_0x3eaf('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x3eaf('0x2')],'allowNull':![],'unique':_0x3eaf('0x3')},'priority':{'type':Sequelize[_0x3eaf('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x3eaf('0x2')],'allowNull':![],'defaultValue':_0x3eaf('0x4')},'appdata':{'type':Sequelize[_0x3eaf('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x3eaf('0x5')]('inbound',_0x3eaf('0x6'),_0x3eaf('0x7'),'inbound-fax',_0x3eaf('0x8'),_0x3eaf('0x9'),_0x3eaf('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x3eaf('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3eaf('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x3eaf('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x3eaf('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x3eaf('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x3eaf('0xd')]},'recordingFormat':{'type':Sequelize[_0x3eaf('0x2')],'defaultValue':_0x3eaf('0xe')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x3eaf('0xf')],'get':function(_0x1fe0c0){return this[_0x3eaf('0x10')](_0x3eaf('0x11'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xa5ca=['system','any','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xa5ca,0x1e3));var _0xaa5c=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0xa5ca[_0x429948];return _0x35d5d1;};'use strict';var Sequelize=require(_0xaa5c('0x0'));module[_0xaa5c('0x1')]={'context':{'type':Sequelize[_0xaa5c('0x2')],'allowNull':![],'unique':_0xaa5c('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xaa5c('0x2')],'allowNull':![],'unique':_0xaa5c('0x3')},'priority':{'type':Sequelize[_0xaa5c('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xaa5c('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xaa5c('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xaa5c('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xaa5c('0x4')](_0xaa5c('0x5'),_0xaa5c('0x6'),_0xaa5c('0x7'),_0xaa5c('0x8'),_0xaa5c('0x9'),_0xaa5c('0xa'),_0xaa5c('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xaa5c('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xaa5c('0xc')]},'isApp':{'type':Sequelize[_0xaa5c('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xaa5c('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xaa5c('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xaa5c('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xaa5c('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0xaa5c('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0xaa5c('0xe')],'get':function(_0x1bc377){return this[_0xaa5c('0xf')](_0xaa5c('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 8f2e759..7641468 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 _0x4b58=['OutboundRoutes','outbound','InternalRoutes','filter','ignore','map','includes','type','find','value','name','UserProfileResource','stack','send','index','VoiceExtension','fieldName','key','query','filters','attributes','model','fields','length','hasOwnProperty','nolimit','where','pick','merge','includeAll','include','findAll','rows','catch','show','params','keys','intersection','options','create','body','startsWith','exten','concat','role','user','inbound','internal','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','cutdigits','mandatoryDisposition','alias','context','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','isApp','createRouting','bulkCreate','findAndCountAll','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','register','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','destroy','then','get','InboundRoutes'];(function(_0x14571a,_0x2622b9){var _0x275d7=function(_0x4de168){while(--_0x4de168){_0x14571a['push'](_0x14571a['shift']());}};_0x275d7(++_0x2622b9);}(_0x4b58,0xfb));var _0x84b5=function(_0x539491,_0x4db64d){_0x539491=_0x539491-0x0;var _0x38551f=_0x4b58[_0x539491];return _0x38551f;};'use strict';var _=require(_0x84b5('0x0'));var Redis=require(_0x84b5('0x1'));var qs=require(_0x84b5('0x2'));var logger=require(_0x84b5('0x3'))('api');var config=require(_0x84b5('0x4'));var db=require(_0x84b5('0x5'))['db'];config[_0x84b5('0x6')]=_[_0x84b5('0x7')](config[_0x84b5('0x6')],{'host':_0x84b5('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x84b5('0x6')]));require(_0x84b5('0x9'))[_0x84b5('0xa')](socket);function respondWithStatusCode(_0x25e77c,_0x32d3b5){_0x32d3b5=_0x32d3b5||0xcc;return function(_0x53a5a4){if(_0x53a5a4){return _0x25e77c[_0x84b5('0xb')](_0x32d3b5);}return _0x25e77c[_0x84b5('0xc')](_0x32d3b5)[_0x84b5('0xd')]();};}function respondWithResult(_0x4540e8,_0x1fe1bf){_0x1fe1bf=_0x1fe1bf||0xc8;return function(_0x59cf72){if(_0x59cf72){return _0x4540e8[_0x84b5('0xc')](_0x1fe1bf)['json'](_0x59cf72);}};}function respondWithFilteredResult(_0x2754db,_0x13f66b){return function(_0x2eec25){if(_0x2eec25){var _0x224c76=typeof _0x13f66b['offset']===_0x84b5('0xe')&&typeof _0x13f66b[_0x84b5('0xf')]===_0x84b5('0xe');var _0x58d861=_0x2eec25['count'];var _0x5f32e3=_0x224c76?0x0:_0x13f66b[_0x84b5('0x10')];var _0x597d4d=_0x224c76?_0x2eec25[_0x84b5('0x11')]:_0x13f66b['offset']+_0x13f66b[_0x84b5('0xf')];var _0x5dba03;if(_0x597d4d>=_0x58d861){_0x597d4d=_0x58d861;_0x5dba03=0xc8;}else{_0x5dba03=0xce;}_0x2754db['status'](_0x5dba03);return _0x2754db[_0x84b5('0x12')](_0x84b5('0x13'),_0x5f32e3+'-'+_0x597d4d+'/'+_0x58d861)[_0x84b5('0x14')](_0x2eec25);}return null;};}function removeEntity(_0x3203a6){return function(_0x46a4ac){if(_0x46a4ac){return _0x46a4ac[_0x84b5('0x15')]()[_0x84b5('0x16')](function(){var _0x385ae3=_0x46a4ac[_0x84b5('0x17')]({'plain':!![]});var _0x4d1752=[{'name':_0x84b5('0x18'),'value':'inbound','ignore':![]},{'name':_0x84b5('0x19'),'value':_0x84b5('0x1a'),'ignore':![]},{'name':_0x84b5('0x1b'),'value':'internal','ignore':![]}];var _0x105187=_(_0x4d1752)[_0x84b5('0x1c')](_0x84b5('0x1d'))[_0x84b5('0x1e')]('value')['value']();if(_[_0x84b5('0x1f')](_0x105187,_0x385ae3[_0x84b5('0x20')])){return;}var _0x2af5e1=_[_0x84b5('0x21')](_0x4d1752,[_0x84b5('0x22'),_0x385ae3[_0x84b5('0x20')]])[_0x84b5('0x23')];return db[_0x84b5('0x24')][_0x84b5('0x15')]({'where':{'type':_0x2af5e1,'resourceId':_0x385ae3['id']}})[_0x84b5('0x16')](function(){return _0x46a4ac;});})['then'](function(){_0x3203a6[_0x84b5('0xc')](0xcc)[_0x84b5('0xd')]();});}};}function handleEntityNotFound(_0x2f7321){return function(_0x599bd9){if(!_0x599bd9){_0x2f7321[_0x84b5('0xb')](0x194);}return _0x599bd9;};}function handleError(_0x54d1b4,_0x352203){_0x352203=_0x352203||0x1f4;return function(_0x1ec59f){logger['error'](_0x1ec59f[_0x84b5('0x25')]);if(_0x1ec59f['name']){delete _0x1ec59f[_0x84b5('0x23')];}_0x54d1b4[_0x84b5('0xc')](_0x352203)[_0x84b5('0x26')](_0x1ec59f);};}exports[_0x84b5('0x27')]=function(_0x344246,_0xb63088){var _0x118d6b={},_0x5bb090={},_0x2118dc={'count':0x0,'rows':[]};var _0x59bff9=_[_0x84b5('0x1e')](db[_0x84b5('0x28')]['rawAttributes'],function(_0x220867){return{'name':_0x220867[_0x84b5('0x29')],'type':_0x220867['type'][_0x84b5('0x2a')]};});_0x5bb090['model']=_[_0x84b5('0x1e')](_0x59bff9,_0x84b5('0x23'));_0x5bb090[_0x84b5('0x2b')]=_['keys'](_0x344246[_0x84b5('0x2b')]);_0x5bb090[_0x84b5('0x2c')]=_['intersection'](_0x5bb090['model'],_0x5bb090[_0x84b5('0x2b')]);_0x118d6b[_0x84b5('0x2d')]=_['intersection'](_0x5bb090[_0x84b5('0x2e')],qs[_0x84b5('0x2f')](_0x344246[_0x84b5('0x2b')][_0x84b5('0x2f')]));_0x118d6b['attributes']=_0x118d6b['attributes'][_0x84b5('0x30')]?_0x118d6b[_0x84b5('0x2d')]:_0x5bb090[_0x84b5('0x2e')];if(!_0x344246[_0x84b5('0x2b')][_0x84b5('0x31')](_0x84b5('0x32'))){_0x118d6b[_0x84b5('0xf')]=qs[_0x84b5('0xf')](_0x344246[_0x84b5('0x2b')][_0x84b5('0xf')]);_0x118d6b[_0x84b5('0x10')]=qs[_0x84b5('0x10')](_0x344246[_0x84b5('0x2b')][_0x84b5('0x10')]);}_0x118d6b['order']=qs['sort'](_0x344246['query']['sort']);_0x118d6b[_0x84b5('0x33')]=qs[_0x84b5('0x2c')](_[_0x84b5('0x34')](_0x344246[_0x84b5('0x2b')],_0x5bb090[_0x84b5('0x2c')]),_0x59bff9);if(_0x344246['query'][_0x84b5('0x1c')]){_0x118d6b['where']=_['merge'](_0x118d6b[_0x84b5('0x33')],{'$or':_['map'](_0x59bff9,function(_0x10c710){if(_0x10c710[_0x84b5('0x20')]!=='VIRTUAL'){var _0x506773={};_0x506773[_0x10c710[_0x84b5('0x23')]]={'$like':'%'+_0x344246[_0x84b5('0x2b')][_0x84b5('0x1c')]+'%'};return _0x506773;}})});}_0x118d6b=_[_0x84b5('0x35')]({},_0x118d6b,_0x344246['options']);var _0x3be3cd={'where':_0x118d6b[_0x84b5('0x33')]};return db[_0x84b5('0x28')]['count'](_0x3be3cd)[_0x84b5('0x16')](function(_0x3457de){_0x2118dc[_0x84b5('0x11')]=_0x3457de;if(_0x344246['query'][_0x84b5('0x36')]){_0x118d6b[_0x84b5('0x37')]=[{'all':!![]}];}return db[_0x84b5('0x28')][_0x84b5('0x38')](_0x118d6b);})['then'](function(_0xa67258){_0x2118dc[_0x84b5('0x39')]=_0xa67258;return _0x2118dc;})[_0x84b5('0x16')](respondWithFilteredResult(_0xb63088,_0x118d6b))[_0x84b5('0x3a')](handleError(_0xb63088,null));};exports[_0x84b5('0x3b')]=function(_0x6c00d4,_0x24ea60){var _0x5637db={'raw':![],'where':{'id':_0x6c00d4[_0x84b5('0x3c')]['id']}},_0x48c265={};_0x48c265['model']=_[_0x84b5('0x3d')](db[_0x84b5('0x28')]['rawAttributes']);_0x48c265['query']=_['keys'](_0x6c00d4[_0x84b5('0x2b')]);_0x48c265[_0x84b5('0x2c')]=_[_0x84b5('0x3e')](_0x48c265[_0x84b5('0x2e')],_0x48c265[_0x84b5('0x2b')]);_0x5637db[_0x84b5('0x2d')]=_[_0x84b5('0x3e')](_0x48c265[_0x84b5('0x2e')],qs[_0x84b5('0x2f')](_0x6c00d4[_0x84b5('0x2b')][_0x84b5('0x2f')]));_0x5637db[_0x84b5('0x2d')]=_0x5637db['attributes']['length']?_0x5637db[_0x84b5('0x2d')]:_0x48c265[_0x84b5('0x2e')];if(_0x6c00d4[_0x84b5('0x2b')]['includeAll']){_0x5637db[_0x84b5('0x37')]=[{'all':!![]}];}_0x5637db=_['merge']({},_0x5637db,_0x6c00d4[_0x84b5('0x3f')]);return db[_0x84b5('0x28')][_0x84b5('0x21')](_0x5637db)[_0x84b5('0x16')](handleEntityNotFound(_0x24ea60,null))[_0x84b5('0x16')](respondWithResult(_0x24ea60,null))[_0x84b5('0x3a')](handleError(_0x24ea60,null));};exports[_0x84b5('0x15')]=function(_0xa83d5b,_0x3a207e){return db['VoiceExtension']['find']({'where':{'id':_0xa83d5b[_0x84b5('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3a207e,null))['then'](removeEntity(_0x3a207e,null))['catch'](handleError(_0x3a207e,null));};exports[_0x84b5('0x40')]=function(_0x1ed8e6,_0x41cfb1){if(_0x1ed8e6[_0x84b5('0x41')][_0x84b5('0x20')]===_0x84b5('0x1a')&&!_[_0x84b5('0x42')](_0x1ed8e6[_0x84b5('0x41')][_0x84b5('0x43')],'_')){_0x1ed8e6['body'][_0x84b5('0x43')]='_'[_0x84b5('0x44')](_0x1ed8e6[_0x84b5('0x41')][_0x84b5('0x43')]);}return db[_0x84b5('0x28')][_0x84b5('0x40')](_0x1ed8e6[_0x84b5('0x41')],{'raw':![]})[_0x84b5('0x16')](function(_0xc09c7a){var _0x11ebda=_0x1ed8e6['user']['get']({'plain':!![]});if(!_0x11ebda)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11ebda[_0x84b5('0x45')]===_0x84b5('0x46')){var _0x2f8726=_0xc09c7a['get']({'plain':!![]});var _0x24e1fd=[{'name':_0x84b5('0x18'),'value':_0x84b5('0x47')},{'name':'OutboundRoutes','value':_0x84b5('0x1a')},{'name':_0x84b5('0x1b'),'value':_0x84b5('0x48')}];var _0x82f532=_[_0x84b5('0x21')](_0x24e1fd,['value',_0x2f8726['type']])[_0x84b5('0x23')];return db['UserProfileSection'][_0x84b5('0x21')]({'where':{'name':_0x82f532,'userProfileId':_0x11ebda[_0x84b5('0x49')]},'raw':!![]})[_0x84b5('0x16')](function(_0x1082be){if(_0x1082be&&_0x1082be[_0x84b5('0x4a')]===0x0){return db['UserProfileResource'][_0x84b5('0x40')]({'name':_0x2f8726[_0x84b5('0x23')],'resourceId':_0x2f8726['id'],'type':_0x1082be[_0x84b5('0x23')],'sectionId':_0x1082be['id']},{})['then'](function(){return _0xc09c7a;});}else{return _0xc09c7a;}})['catch'](function(_0x1f3f1a){logger[_0x84b5('0x4b')](_0x84b5('0x4c'),_0x1f3f1a);throw _0x1f3f1a;});}return _0xc09c7a;})[_0x84b5('0x16')](respondWithResult(_0x41cfb1,0xc9))[_0x84b5('0x3a')](handleError(_0x41cfb1,null));};exports['update']=function(_0x5de2dd,_0x5df908){if(_0x5de2dd[_0x84b5('0x41')]['id']){delete _0x5de2dd[_0x84b5('0x41')]['id'];}return db[_0x84b5('0x28')][_0x84b5('0x21')]({'where':{'id':_0x5de2dd[_0x84b5('0x3c')]['id']}})[_0x84b5('0x16')](handleEntityNotFound(_0x5df908,null))[_0x84b5('0x16')](function(_0x26b233){if(_0x26b233){return db['VoiceExtension'][_0x84b5('0x4d')](_[_0x84b5('0x34')](_0x5de2dd[_0x84b5('0x41')],['exten','context','description','recordingFormat',_0x84b5('0x4e'),_0x84b5('0x4f'),_0x84b5('0x50')]),{'where':{'context':_0x26b233[_0x84b5('0x51')],'exten':_0x26b233[_0x84b5('0x43')]},'individualHooks':!![]})[_0x84b5('0x16')](function(_0x14d0db){return _0x14d0db;});}return null;})[_0x84b5('0x16')](respondWithStatusCode(_0x5df908,null))[_0x84b5('0x3a')](handleError(_0x5df908,null));};exports['addApplications']=function(_0x17cafd,_0x5921d3){var _0x1aa873=_0x17cafd[_0x84b5('0x3c')]['id'];var _0xdeb6be=_0x17cafd[_0x84b5('0x41')];var _0xeb42ee=0xc8;var _0x3572f4=null;return db[_0x84b5('0x52')][_0x84b5('0x53')]({'isolationLevel':db['sequelize'][_0x84b5('0x54')][_0x84b5('0x55')][_0x84b5('0x56')]},function(_0x4faa7b){return db['VoiceExtension'][_0x84b5('0x57')]({'where':{'id':_0x1aa873},'transaction':_0x4faa7b})[_0x84b5('0x16')](function(_0x197dfd){if(_0x197dfd){return db[_0x84b5('0x28')][_0x84b5('0x15')]({'where':{'VoiceExtensionId':_0x1aa873},'transaction':_0x4faa7b})[_0x84b5('0x16')](function(){var _0x175cd6=_[_0x84b5('0x1e')](_0xdeb6be,function(_0x2f3ceb){_0x2f3ceb['VoiceExtensionId']=_0x1aa873;_0x2f3ceb[_0x84b5('0x58')]=!![];return _0x2f3ceb;});return _0x197dfd[_0x84b5('0x59')](_0x175cd6);})['then'](function(_0x15be35){return db['VoiceExtension'][_0x84b5('0x5a')](_0x15be35,{'transaction':_0x4faa7b});});}else{_0xeb42ee=0x194;_0x3572f4=[];}});})[_0x84b5('0x16')](function(){if(_0xeb42ee!==0x194){return db['VoiceExtension'][_0x84b5('0x5b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1aa873},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x3e340b){_0x3572f4=_0x3e340b;});}})[_0x84b5('0x3a')](function(_0x427e10){_0xeb42ee=0x1f4;logger[_0x84b5('0x4b')](_0x427e10['stack']);if(_0x427e10['name']){delete _0x427e10[_0x84b5('0x23')];}_0x3572f4=_0x427e10;})['finally'](function(){if(_0x3572f4===null){_0x5921d3[_0x84b5('0xb')](_0xeb42ee);}else{if(_0xeb42ee===0x1f4){_0x5921d3[_0x84b5('0xc')](_0xeb42ee)[_0x84b5('0x26')](_0x3572f4);}else{_0x5921d3[_0x84b5('0xc')](_0xeb42ee)['json'](_0x3572f4);}}});}; \ No newline at end of file +var _0xe4e4=['order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','length','params','body','startsWith','exten','create','role','user','get','inbound','internal','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','recordingFormat','alias','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','destroy','then','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','filter','ignore','map','value','includes','type','find','name','error','send','index','VoiceExtension','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x49778b,_0x18e5e4){var _0x120c36=function(_0x4a2718){while(--_0x4a2718){_0x49778b['push'](_0x49778b['shift']());}};_0x120c36(++_0x18e5e4);}(_0xe4e4,0x83));var _0x4e4e=function(_0x5926b1,_0x49ccff){_0x5926b1=_0x5926b1-0x0;var _0x51d745=_0xe4e4[_0x5926b1];return _0x51d745;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x4e4e('0x0'));var config=require(_0x4e4e('0x1'));var db=require('../../mysqldb')['db'];config[_0x4e4e('0x2')]=_[_0x4e4e('0x3')](config[_0x4e4e('0x2')],{'host':_0x4e4e('0x4'),'port':0x18eb});var socket=require(_0x4e4e('0x5'))(new Redis(config[_0x4e4e('0x2')]));require('./voiceExtension.socket')[_0x4e4e('0x6')](socket);function respondWithStatusCode(_0x16607a,_0xebe2d5){_0xebe2d5=_0xebe2d5||0xcc;return function(_0x20d7b3){if(_0x20d7b3){return _0x16607a[_0x4e4e('0x7')](_0xebe2d5);}return _0x16607a[_0x4e4e('0x8')](_0xebe2d5)[_0x4e4e('0x9')]();};}function respondWithResult(_0x170f77,_0xbace87){_0xbace87=_0xbace87||0xc8;return function(_0x525a51){if(_0x525a51){return _0x170f77[_0x4e4e('0x8')](_0xbace87)['json'](_0x525a51);}};}function respondWithFilteredResult(_0x40d466,_0x29c850){return function(_0x350df9){if(_0x350df9){var _0x57dafe=typeof _0x29c850[_0x4e4e('0xa')]==='undefined'&&typeof _0x29c850[_0x4e4e('0xb')]===_0x4e4e('0xc');var _0x195ffa=_0x350df9[_0x4e4e('0xd')];var _0x1bf741=_0x57dafe?0x0:_0x29c850[_0x4e4e('0xa')];var _0x55a561=_0x57dafe?_0x350df9[_0x4e4e('0xd')]:_0x29c850[_0x4e4e('0xa')]+_0x29c850[_0x4e4e('0xb')];var _0x38c114;if(_0x55a561>=_0x195ffa){_0x55a561=_0x195ffa;_0x38c114=0xc8;}else{_0x38c114=0xce;}_0x40d466['status'](_0x38c114);return _0x40d466[_0x4e4e('0xe')](_0x4e4e('0xf'),_0x1bf741+'-'+_0x55a561+'/'+_0x195ffa)[_0x4e4e('0x10')](_0x350df9);}return null;};}function removeEntity(_0x42e946){return function(_0x158623){if(_0x158623){return _0x158623[_0x4e4e('0x11')]()[_0x4e4e('0x12')](function(){var _0x53e4e2=_0x158623['get']({'plain':!![]});var _0x21dae6=[{'name':_0x4e4e('0x13'),'value':'inbound','ignore':![]},{'name':_0x4e4e('0x14'),'value':_0x4e4e('0x15'),'ignore':![]},{'name':_0x4e4e('0x16'),'value':'internal','ignore':![]}];var _0x117d27=_(_0x21dae6)[_0x4e4e('0x17')](_0x4e4e('0x18'))[_0x4e4e('0x19')](_0x4e4e('0x1a'))[_0x4e4e('0x1a')]();if(_[_0x4e4e('0x1b')](_0x117d27,_0x53e4e2[_0x4e4e('0x1c')])){return;}var _0x52d276=_[_0x4e4e('0x1d')](_0x21dae6,['value',_0x53e4e2[_0x4e4e('0x1c')]])[_0x4e4e('0x1e')];return db['UserProfileResource'][_0x4e4e('0x11')]({'where':{'type':_0x52d276,'resourceId':_0x53e4e2['id']}})[_0x4e4e('0x12')](function(){return _0x158623;});})['then'](function(){_0x42e946[_0x4e4e('0x8')](0xcc)[_0x4e4e('0x9')]();});}};}function handleEntityNotFound(_0x5a393e){return function(_0x33627f){if(!_0x33627f){_0x5a393e['sendStatus'](0x194);}return _0x33627f;};}function handleError(_0x2ce68e,_0xb008ae){_0xb008ae=_0xb008ae||0x1f4;return function(_0x4e0009){logger[_0x4e4e('0x1f')](_0x4e0009['stack']);if(_0x4e0009[_0x4e4e('0x1e')]){delete _0x4e0009[_0x4e4e('0x1e')];}_0x2ce68e[_0x4e4e('0x8')](_0xb008ae)[_0x4e4e('0x20')](_0x4e0009);};}exports[_0x4e4e('0x21')]=function(_0x55a161,_0x437012){var _0x8526fa={},_0x16fc40={},_0x32d634={'count':0x0,'rows':[]};var _0x35c77c=_[_0x4e4e('0x19')](db[_0x4e4e('0x22')][_0x4e4e('0x23')],function(_0x12bcd0){return{'name':_0x12bcd0['fieldName'],'type':_0x12bcd0['type'][_0x4e4e('0x24')]};});_0x16fc40[_0x4e4e('0x25')]=_[_0x4e4e('0x19')](_0x35c77c,'name');_0x16fc40[_0x4e4e('0x26')]=_[_0x4e4e('0x27')](_0x55a161[_0x4e4e('0x26')]);_0x16fc40[_0x4e4e('0x28')]=_[_0x4e4e('0x29')](_0x16fc40['model'],_0x16fc40[_0x4e4e('0x26')]);_0x8526fa[_0x4e4e('0x2a')]=_[_0x4e4e('0x29')](_0x16fc40[_0x4e4e('0x25')],qs[_0x4e4e('0x2b')](_0x55a161[_0x4e4e('0x26')][_0x4e4e('0x2b')]));_0x8526fa['attributes']=_0x8526fa[_0x4e4e('0x2a')]['length']?_0x8526fa[_0x4e4e('0x2a')]:_0x16fc40[_0x4e4e('0x25')];if(!_0x55a161[_0x4e4e('0x26')][_0x4e4e('0x2c')]('nolimit')){_0x8526fa[_0x4e4e('0xb')]=qs[_0x4e4e('0xb')](_0x55a161[_0x4e4e('0x26')][_0x4e4e('0xb')]);_0x8526fa[_0x4e4e('0xa')]=qs['offset'](_0x55a161[_0x4e4e('0x26')]['offset']);}_0x8526fa[_0x4e4e('0x2d')]=qs[_0x4e4e('0x2e')](_0x55a161[_0x4e4e('0x26')]['sort']);_0x8526fa[_0x4e4e('0x2f')]=qs[_0x4e4e('0x28')](_[_0x4e4e('0x30')](_0x55a161['query'],_0x16fc40[_0x4e4e('0x28')]),_0x35c77c);if(_0x55a161['query'][_0x4e4e('0x17')]){_0x8526fa[_0x4e4e('0x2f')]=_[_0x4e4e('0x31')](_0x8526fa[_0x4e4e('0x2f')],{'$or':_[_0x4e4e('0x19')](_0x35c77c,function(_0x164a3e){if(_0x164a3e['type']!==_0x4e4e('0x32')){var _0x3d756b={};_0x3d756b[_0x164a3e['name']]={'$like':'%'+_0x55a161[_0x4e4e('0x26')][_0x4e4e('0x17')]+'%'};return _0x3d756b;}})});}_0x8526fa=_[_0x4e4e('0x31')]({},_0x8526fa,_0x55a161[_0x4e4e('0x33')]);var _0x214609={'where':_0x8526fa['where']};return db[_0x4e4e('0x22')][_0x4e4e('0xd')](_0x214609)[_0x4e4e('0x12')](function(_0x498f3d){_0x32d634[_0x4e4e('0xd')]=_0x498f3d;if(_0x55a161[_0x4e4e('0x26')][_0x4e4e('0x34')]){_0x8526fa[_0x4e4e('0x35')]=[{'all':!![]}];}return db['VoiceExtension'][_0x4e4e('0x36')](_0x8526fa);})['then'](function(_0xe7dd0c){_0x32d634[_0x4e4e('0x37')]=_0xe7dd0c;return _0x32d634;})[_0x4e4e('0x12')](respondWithFilteredResult(_0x437012,_0x8526fa))[_0x4e4e('0x38')](handleError(_0x437012,null));};exports['show']=function(_0x5375e9,_0x159642){var _0x311819={'raw':![],'where':{'id':_0x5375e9['params']['id']}},_0x211cff={};_0x211cff[_0x4e4e('0x25')]=_['keys'](db[_0x4e4e('0x22')][_0x4e4e('0x23')]);_0x211cff['query']=_[_0x4e4e('0x27')](_0x5375e9[_0x4e4e('0x26')]);_0x211cff[_0x4e4e('0x28')]=_['intersection'](_0x211cff['model'],_0x211cff[_0x4e4e('0x26')]);_0x311819['attributes']=_[_0x4e4e('0x29')](_0x211cff[_0x4e4e('0x25')],qs[_0x4e4e('0x2b')](_0x5375e9['query'][_0x4e4e('0x2b')]));_0x311819[_0x4e4e('0x2a')]=_0x311819[_0x4e4e('0x2a')][_0x4e4e('0x39')]?_0x311819[_0x4e4e('0x2a')]:_0x211cff[_0x4e4e('0x25')];if(_0x5375e9[_0x4e4e('0x26')][_0x4e4e('0x34')]){_0x311819[_0x4e4e('0x35')]=[{'all':!![]}];}_0x311819=_[_0x4e4e('0x31')]({},_0x311819,_0x5375e9[_0x4e4e('0x33')]);return db[_0x4e4e('0x22')][_0x4e4e('0x1d')](_0x311819)[_0x4e4e('0x12')](handleEntityNotFound(_0x159642,null))[_0x4e4e('0x12')](respondWithResult(_0x159642,null))[_0x4e4e('0x38')](handleError(_0x159642,null));};exports[_0x4e4e('0x11')]=function(_0x1625dc,_0x5240a4){return db[_0x4e4e('0x22')][_0x4e4e('0x1d')]({'where':{'id':_0x1625dc[_0x4e4e('0x3a')]['id']}})[_0x4e4e('0x12')](handleEntityNotFound(_0x5240a4,null))['then'](removeEntity(_0x5240a4,null))[_0x4e4e('0x38')](handleError(_0x5240a4,null));};exports['create']=function(_0x158e78,_0x5f4b7f){if(_0x158e78[_0x4e4e('0x3b')][_0x4e4e('0x1c')]===_0x4e4e('0x15')&&!_[_0x4e4e('0x3c')](_0x158e78[_0x4e4e('0x3b')][_0x4e4e('0x3d')],'_')){_0x158e78['body']['exten']='_'['concat'](_0x158e78[_0x4e4e('0x3b')][_0x4e4e('0x3d')]);}return db[_0x4e4e('0x22')][_0x4e4e('0x3e')](_0x158e78['body'],{'raw':![]})['then'](function(_0x32e734){var _0x2b03ff=_0x158e78['user']['get']({'plain':!![]});if(!_0x2b03ff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b03ff[_0x4e4e('0x3f')]===_0x4e4e('0x40')){var _0x3e6147=_0x32e734[_0x4e4e('0x41')]({'plain':!![]});var _0x3073d5=[{'name':_0x4e4e('0x13'),'value':_0x4e4e('0x42')},{'name':_0x4e4e('0x14'),'value':_0x4e4e('0x15')},{'name':_0x4e4e('0x16'),'value':_0x4e4e('0x43')}];var _0x225d3e=_['find'](_0x3073d5,['value',_0x3e6147[_0x4e4e('0x1c')]])[_0x4e4e('0x1e')];return db[_0x4e4e('0x44')]['find']({'where':{'name':_0x225d3e,'userProfileId':_0x2b03ff[_0x4e4e('0x45')]},'raw':!![]})[_0x4e4e('0x12')](function(_0x3615cb){if(_0x3615cb&&_0x3615cb[_0x4e4e('0x46')]===0x0){return db[_0x4e4e('0x47')][_0x4e4e('0x3e')]({'name':_0x3e6147[_0x4e4e('0x1e')],'resourceId':_0x3e6147['id'],'type':_0x3615cb[_0x4e4e('0x1e')],'sectionId':_0x3615cb['id']},{})[_0x4e4e('0x12')](function(){return _0x32e734;});}else{return _0x32e734;}})[_0x4e4e('0x38')](function(_0x298cb0){logger[_0x4e4e('0x1f')](_0x4e4e('0x48'),_0x298cb0);throw _0x298cb0;});}return _0x32e734;})[_0x4e4e('0x12')](respondWithResult(_0x5f4b7f,0xc9))[_0x4e4e('0x38')](handleError(_0x5f4b7f,null));};exports['update']=function(_0x4ceb7e,_0x51fa6d){if(_0x4ceb7e[_0x4e4e('0x3b')]['id']){delete _0x4ceb7e['body']['id'];}return db[_0x4e4e('0x22')][_0x4e4e('0x1d')]({'where':{'id':_0x4ceb7e[_0x4e4e('0x3a')]['id']}})[_0x4e4e('0x12')](handleEntityNotFound(_0x51fa6d,null))[_0x4e4e('0x12')](function(_0x3296a7){if(_0x3296a7){return db[_0x4e4e('0x22')]['update'](_['pick'](_0x4ceb7e['body'],['exten',_0x4e4e('0x49'),'description',_0x4e4e('0x4a'),'cutdigits','mandatoryDisposition',_0x4e4e('0x4b')]),{'where':{'context':_0x3296a7[_0x4e4e('0x49')],'exten':_0x3296a7[_0x4e4e('0x3d')]},'individualHooks':!![]})[_0x4e4e('0x12')](function(_0x5c570b){return _0x5c570b;});}return null;})['then'](respondWithStatusCode(_0x51fa6d,null))['catch'](handleError(_0x51fa6d,null));};exports[_0x4e4e('0x4c')]=function(_0x2fdc53,_0x4426f2){var _0x4532c=_0x2fdc53[_0x4e4e('0x3a')]['id'];var _0x3566b1=_0x2fdc53[_0x4e4e('0x3b')];var _0x19c0da=0xc8;var _0x292f60=null;return db['sequelize'][_0x4e4e('0x4d')]({'isolationLevel':db[_0x4e4e('0x4e')]['Transaction'][_0x4e4e('0x4f')][_0x4e4e('0x50')]},function(_0xa7bf14){return db[_0x4e4e('0x22')][_0x4e4e('0x51')]({'where':{'id':_0x4532c},'transaction':_0xa7bf14})[_0x4e4e('0x12')](function(_0x16f337){if(_0x16f337){return db[_0x4e4e('0x22')]['destroy']({'where':{'VoiceExtensionId':_0x4532c},'transaction':_0xa7bf14})[_0x4e4e('0x12')](function(){var _0x3f183a=_[_0x4e4e('0x19')](_0x3566b1,function(_0x20e054){_0x20e054[_0x4e4e('0x52')]=_0x4532c;_0x20e054[_0x4e4e('0x53')]=!![];return _0x20e054;});return _0x16f337['createRouting'](_0x3f183a);})[_0x4e4e('0x12')](function(_0x5c8822){return db[_0x4e4e('0x22')][_0x4e4e('0x54')](_0x5c8822,{'transaction':_0xa7bf14});});}else{_0x19c0da=0x194;_0x292f60=[];}});})['then'](function(){if(_0x19c0da!==0x194){return db[_0x4e4e('0x22')][_0x4e4e('0x55')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4532c},'order':_0x4e4e('0x56')})[_0x4e4e('0x12')](function(_0x3a453d){_0x292f60=_0x3a453d;});}})[_0x4e4e('0x38')](function(_0x17fbfe){_0x19c0da=0x1f4;logger['error'](_0x17fbfe['stack']);if(_0x17fbfe[_0x4e4e('0x1e')]){delete _0x17fbfe[_0x4e4e('0x1e')];}_0x292f60=_0x17fbfe;})[_0x4e4e('0x57')](function(){if(_0x292f60===null){_0x4426f2[_0x4e4e('0x7')](_0x19c0da);}else{if(_0x19c0da===0x1f4){_0x4426f2[_0x4e4e('0x8')](_0x19c0da)[_0x4e4e('0x20')](_0x292f60);}else{_0x4426f2['status'](_0x19c0da)[_0x4e4e('0x10')](_0x292f60);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 7a88c44..2ee9547 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 _0x4b01=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x2195dc,_0x41bf5e){var _0x4a3db2=function(_0x1dbb05){while(--_0x1dbb05){_0x2195dc['push'](_0x2195dc['shift']());}};_0x4a3db2(++_0x41bf5e);}(_0x4b01,0x18a));var _0x14b0=function(_0x2132e6,_0x31fdd2){_0x2132e6=_0x2132e6-0x0;var _0x24ad7c=_0x4b01[_0x2132e6];return _0x24ad7c;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x14b0('0x0'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x14b0('0x1')](0x0);var events={'afterCreate':_0x14b0('0x2'),'afterUpdate':_0x14b0('0x3'),'afterDestroy':_0x14b0('0x4')};function emitEvent(_0x22e5af){return function(_0x466a21,_0x48ccd4,_0x3fede8){VoiceExtensionEvents[_0x14b0('0x5')](_0x22e5af+':'+_0x466a21['id'],_0x466a21);VoiceExtensionEvents['emit'](_0x22e5af,_0x466a21);_0x3fede8(null);};}for(var e in events){if(events[_0x14b0('0x6')](e)){var event=events[e];VoiceExtension[_0x14b0('0x7')](e,emitEvent(event));}}module[_0x14b0('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xee50=['hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit'];(function(_0x55cc58,_0x5ce0af){var _0x26062e=function(_0x59e29d){while(--_0x59e29d){_0x55cc58['push'](_0x55cc58['shift']());}};_0x26062e(++_0x5ce0af);}(_0xee50,0xf6));var _0x0ee5=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xee50[_0x11005e];return _0x29338f;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x0ee5('0x0'))['db'][_0x0ee5('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x0ee5('0x2')](0x0);var events={'afterCreate':_0x0ee5('0x3'),'afterUpdate':'update','afterDestroy':_0x0ee5('0x4')};function emitEvent(_0x1ed78f){return function(_0x3be2b3,_0x3c65be,_0x1d82b6){VoiceExtensionEvents[_0x0ee5('0x5')](_0x1ed78f+':'+_0x3be2b3['id'],_0x3be2b3);VoiceExtensionEvents[_0x0ee5('0x5')](_0x1ed78f,_0x3be2b3);_0x1d82b6(null);};}for(var e in events){if(events[_0x0ee5('0x6')](e)){var event=events[e];VoiceExtension[_0x0ee5('0x7')](e,emitEvent(event));}}module[_0x0ee5('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 8d1fc1c..10586ad 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 _0xf398=['$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','last','priority','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','CDR(type)=','context','exten','alias','Set','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','url','length','name','param','split','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','interval','IntervalId','then','intervals','map','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','answer','playback','includes','app','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xf398,0x10a));var _0x8f39=function(_0xdc4445,_0x4b9e17){_0xdc4445=_0xdc4445-0x0;var _0x356c67=_0xf398[_0xdc4445];return _0x356c67;};'use strict';var _=require(_0x8f39('0x0'));var attributes=require(_0x8f39('0x1'));module[_0x8f39('0x2')]=function(_0x40c8bf){var _0x159ae1=_0x40c8bf[_0x8f39('0x3')];function _0xb1a246(_0x1b4285){var _0x2952d2=0x2;var _0x1e8b4d=[{'type':_0x1b4285[_0x8f39('0x4')],'app':'Set','appdata':_0x8f39('0x5')+_0x1b4285[_0x8f39('0x4')],'context':_0x1b4285[_0x8f39('0x6')],'exten':_0x1b4285[_0x8f39('0x7')],'priority':_0x2952d2++,'VoiceExtensionId':_0x1b4285['id']},{'type':_0x1b4285[_0x8f39('0x4')],'app':_0x1b4285[_0x8f39('0x8')]?_0x8f39('0x9'):_0x8f39('0xa'),'appdata':_0x1b4285[_0x8f39('0x8')]?_0x8f39('0xb')+_0x1b4285[_0x8f39('0x8')]:_0x8f39('0xc'),'context':_0x1b4285[_0x8f39('0x6')],'exten':_0x1b4285[_0x8f39('0x7')],'priority':_0x2952d2++,'VoiceExtensionId':_0x1b4285['id']}];if(_0x1b4285['type']===_0x8f39('0xd')){_0x1e8b4d[_0x8f39('0xe')]({'type':_0x8f39('0xd'),'app':_0x8f39('0x9'),'appdata':_0x8f39('0xf')+_0x1b4285['id'],'context':_0x1b4285['context'],'exten':_0x1b4285['exten'],'priority':_0x2952d2++,'VoiceExtensionId':_0x1b4285['id']});}_0x1e8b4d[_0x8f39('0xe')]({'type':_0x1b4285[_0x8f39('0x4')],'app':_0x8f39('0x9'),'appdata':_0x8f39('0x10'),'context':_0x1b4285['context'],'exten':_0x1b4285[_0x8f39('0x7')],'priority':_0x2952d2++,'VoiceExtensionId':_0x1b4285['id']},{'type':_0x1b4285['type'],'app':_0x8f39('0x9'),'appdata':_0x8f39('0x11'),'context':_0x1b4285[_0x8f39('0x6')],'exten':_0x1b4285[_0x8f39('0x7')],'priority':_0x2952d2++,'VoiceExtensionId':_0x1b4285['id']},{'type':_0x1b4285[_0x8f39('0x4')],'app':'Set','appdata':_0x8f39('0x12'),'context':_0x1b4285[_0x8f39('0x6')],'exten':_0x1b4285[_0x8f39('0x7')],'priority':_0x2952d2++,'VoiceExtensionId':_0x1b4285['id']});return _0x1e8b4d;}function _0x4d7911(_0x28fd0f){var _0x4e9c50=0x2;var _0x2db45f=[{'type':_0x8f39('0x13'),'app':_0x8f39('0x9'),'appdata':'CDR(type)=outbound','context':_0x28fd0f[_0x8f39('0x6')],'exten':_0x28fd0f[_0x8f39('0x7')],'priority':_0x4e9c50++,'VoiceExtensionId':_0x28fd0f['id']},{'type':_0x8f39('0x13'),'app':_0x28fd0f[_0x8f39('0x8')]?_0x8f39('0x9'):_0x8f39('0xa'),'appdata':_0x28fd0f[_0x8f39('0x8')]?_0x8f39('0xb')+_0x28fd0f[_0x8f39('0x8')]:_0x8f39('0xc'),'context':_0x28fd0f[_0x8f39('0x6')],'exten':_0x28fd0f[_0x8f39('0x7')],'priority':_0x4e9c50++,'VoiceExtensionId':_0x28fd0f['id']},{'type':'outbound','app':_0x8f39('0x9'),'appdata':_0x8f39('0x14')+(_0x28fd0f['cutdigits']?_0x8f39('0x15')+_0x28fd0f[_0x8f39('0x16')]+'}':_0x8f39('0x17')),'context':_0x28fd0f[_0x8f39('0x6')],'exten':_0x28fd0f[_0x8f39('0x7')],'priority':_0x4e9c50++,'VoiceExtensionId':_0x28fd0f['id']},{'type':_0x8f39('0x13'),'app':_0x8f39('0x9'),'appdata':_0x8f39('0xf')+_0x28fd0f['id'],'context':_0x28fd0f[_0x8f39('0x6')],'exten':_0x28fd0f['exten'],'priority':_0x4e9c50++,'VoiceExtensionId':_0x28fd0f['id']},{'type':'outbound','app':'ExecIf','appdata':_0x8f39('0x18')+(_0x4e9c50+0x2)+_0x8f39('0x19')+(_0x4e9c50+0x1)+')','context':_0x28fd0f['context'],'exten':_0x28fd0f[_0x8f39('0x7')],'priority':_0x4e9c50++,'VoiceExtensionId':_0x28fd0f['id']},{'type':_0x8f39('0x13'),'app':_0x8f39('0x9'),'appdata':_0x28fd0f[_0x8f39('0x16')]?'CDR(prefix)=${EXTEN:0:'+_0x28fd0f[_0x8f39('0x16')]+'}':'CDR(prefix)=noprefix','context':_0x28fd0f['context'],'exten':_0x28fd0f[_0x8f39('0x7')],'priority':_0x4e9c50++,'VoiceExtensionId':_0x28fd0f['id']},{'type':_0x8f39('0x13'),'app':'Set','appdata':_0x8f39('0x10'),'context':_0x28fd0f['context'],'exten':_0x28fd0f[_0x8f39('0x7')],'priority':_0x4e9c50++,'VoiceExtensionId':_0x28fd0f['id']},{'type':'outbound','app':_0x8f39('0x9'),'appdata':_0x8f39('0x11'),'context':_0x28fd0f[_0x8f39('0x6')],'exten':_0x28fd0f['exten'],'priority':_0x4e9c50++,'VoiceExtensionId':_0x28fd0f['id']},{'type':_0x8f39('0x13'),'app':_0x8f39('0x9'),'appdata':'MONITOR_OPTIONS=ab','context':_0x28fd0f['context'],'exten':_0x28fd0f['exten'],'priority':_0x4e9c50++,'VoiceExtensionId':_0x28fd0f['id']},{'type':'outbound','app':'Set','appdata':_0x8f39('0x1a')+_0x28fd0f['id'],'context':_0x28fd0f['context'],'exten':_0x28fd0f[_0x8f39('0x7')],'priority':_0x4e9c50++,'VoiceExtensionId':_0x28fd0f['id']}];if(_0x28fd0f[_0x8f39('0x1b')](_0x8f39('0x1c'))&&_0x28fd0f['recordingFormat']!==_0x8f39('0x1d')){_0x2db45f[_0x8f39('0xe')]({'type':_0x8f39('0x13'),'app':'Set','appdata':_0x8f39('0x1e'),'context':_0x28fd0f['context'],'exten':_0x28fd0f[_0x8f39('0x7')],'priority':_0x4e9c50++,'VoiceExtensionId':_0x28fd0f['id']},{'type':_0x8f39('0x13'),'app':_0x8f39('0x9'),'appdata':_0x8f39('0x1f')+_0x28fd0f[_0x8f39('0x1c')]||'wav','context':_0x28fd0f[_0x8f39('0x6')],'exten':_0x28fd0f['exten'],'priority':_0x4e9c50++,'VoiceExtensionId':_0x28fd0f['id']});}return _0x2db45f;}function _0x18c16f(_0x65624c,_0x32436a){var _0xc1f7b7=[{'name':_0x8f39('0x20'),'param':0x0},{'name':_0x8f39('0x21'),'param':0x1},{'name':_0x8f39('0x22'),'param':0x2},{'name':_0x8f39('0x23'),'param':0x3}];var _0x64de85={};var _0xbee572=_0x32436a['split'](',');var _0x77ed43=[];for(var _0xb2f934=0x0;_0xb2f934<_0xc1f7b7[_0x8f39('0x24')];_0xb2f934++){switch(_0xc1f7b7[_0xb2f934][_0x8f39('0x25')]){case'trunk':_0x64de85[_0x8f39('0x20')]=_0xbee572[_0xc1f7b7[_0xb2f934][_0x8f39('0x26')]][_0x8f39('0x27')]('/')[0x1];_0x64de85[_0x8f39('0x28')]=_0xbee572[_0xc1f7b7[_0xb2f934]['param']]['split']('/')[0x2];_0x64de85['prefix']=_0x64de85[_0x8f39('0x28')]?_0x64de85[_0x8f39('0x28')][_0x8f39('0x27')]('$')[0x0]:undefined;_0x64de85[_0x8f39('0x28')]=_0x65624c[_0x8f39('0x16')]?(_0x64de85[_0x8f39('0x29')]||'')+_0x8f39('0x15')+_0x65624c['cutdigits']+'}':(_0x64de85['prefix']||'')+'${EXTEN}';_0x77ed43[_0xc1f7b7[_0xb2f934][_0x8f39('0x26')]]=[_0x8f39('0x2a'),_0x64de85['trunk'],_0x64de85[_0x8f39('0x28')]][_0x8f39('0x2b')]('/');break;case _0x8f39('0x22'):_0x64de85[_0x8f39('0x22')]=_0xbee572[_0xc1f7b7[_0xb2f934][_0x8f39('0x26')]];if(_0x65624c[_0x8f39('0x1c')]!==_0x8f39('0x1d')){if(_0x64de85[_0x8f39('0x22')][_0x8f39('0x2c')]('U(xcally-mixmonitor-context)')<0x0){_0x64de85['options']+=_0x8f39('0x2d');}}else{_0x64de85['options']=_0x64de85[_0x8f39('0x22')]['replace'](_0x8f39('0x2d'),'');}_0x77ed43[_0xc1f7b7[_0xb2f934][_0x8f39('0x26')]]=_0x64de85[_0x8f39('0x22')];break;default:_0x77ed43[_0xc1f7b7[_0xb2f934]['param']]=_0xbee572[_0xc1f7b7[_0xb2f934][_0x8f39('0x26')]];}}return _0x77ed43[_0x8f39('0x2b')](',');}function _0x34e068(_0x34794a,_0x122b9a,_0x361fc1){return new Promise(function(_0x272a97,_0x5c188d){var _0x18f276=[];if(_[_0x8f39('0x2e')](_0x122b9a))return _0x272a97(_0x18f276);_0x159ae1[_0x8f39('0x2f')]['findAll']({'attributes':['id',_0x8f39('0x30'),_0x8f39('0x31')],'raw':!![]})[_0x8f39('0x32')](function(_0x65a23b){for(var _0x5adb28=0x0,_0x42c2f8=0x0;_0x5adb28<_0x122b9a[_0x8f39('0x24')];_0x5adb28++,_0x42c2f8=0x0){var _0x19b728=_0x122b9a[_0x5adb28];var _0x247804=[];var _0x2abbbd=[];delete _0x19b728['id'];if(_0x19b728['interval']!=='*,*,*,*'){_0x19b728[_0x8f39('0x33')]=[_0x19b728[_0x8f39('0x30')]];}else{_0x19b728[_0x8f39('0x33')]=_0x19b728[_0x8f39('0x31')]?_[_0x8f39('0x34')](_['filter'](_0x65a23b,{'IntervalId':_0x19b728[_0x8f39('0x31')]}),_0x8f39('0x30')):[];}_0x19b728[_0x8f39('0x6')]=_0x34794a[_0x8f39('0x6')];_0x19b728[_0x8f39('0x7')]=_0x34794a['exten'];if(_0x19b728[_0x8f39('0x4')])_0x19b728['type']=_0x19b728['type'][_0x8f39('0x35')]();if(_0x34794a['type']===_0x8f39('0x13')){if(_0x19b728[_0x8f39('0x1b')](_0x8f39('0x36'))&&_0x19b728[_0x8f39('0x36')]&&_0x19b728['tag']!=='--'){_0x247804[_0x8f39('0xe')]({'type':_0x19b728[_0x8f39('0x4')][_0x8f39('0x35')](),'app':'Set','appdata':_0x8f39('0x37')+_0x19b728[_0x8f39('0x36')],'context':_0x34794a['context'],'exten':_0x34794a['exten'],'priority':_0x19b728[_0x8f39('0x33')][_0x8f39('0x24')]+_0x361fc1+_0x42c2f8++,'VoiceExtensionId':_0x34794a['id']});}_0x247804[_0x8f39('0xe')]({'type':_0x19b728[_0x8f39('0x4')][_0x8f39('0x35')](),'app':_0x8f39('0x38'),'appdata':_0x8f39('0x39')+(_0x19b728[_0x8f39('0x3a')]?_0x8f39('0x3b')+_0x19b728[_0x8f39('0x3a')]+')':'NoOp(No\x20number\x20available)'),'context':_0x34794a[_0x8f39('0x6')],'exten':_0x34794a[_0x8f39('0x7')],'priority':_0x19b728[_0x8f39('0x33')][_0x8f39('0x24')]+_0x361fc1+_0x42c2f8++,'VoiceExtensionId':_0x34794a['id']});}else{if(_0x19b728['hasOwnProperty'](_0x8f39('0x3c'))){if(['queue',_0x8f39('0x3d')][_0x8f39('0x3e')](_0x19b728[_0x8f39('0x3f')][_0x8f39('0x35')]())&&_0x19b728['appType']!=='custom'){if(_0x19b728[_0x8f39('0x3c')]){_0x247804[_0x8f39('0xe')]({'type':_0x19b728[_0x8f39('0x4')]['toLowerCase'](),'app':_0x8f39('0x38'),'appdata':_0x8f39('0x40'),'context':_0x34794a[_0x8f39('0x6')],'exten':_0x34794a[_0x8f39('0x7')],'priority':_0x19b728[_0x8f39('0x33')][_0x8f39('0x24')]+_0x361fc1+_0x42c2f8++,'VoiceExtensionId':_0x34794a['id']});_0x247804[_0x8f39('0xe')]({'type':_0x19b728[_0x8f39('0x4')][_0x8f39('0x35')](),'app':_0x8f39('0x9'),'appdata':_0x8f39('0x41'),'context':_0x34794a[_0x8f39('0x6')],'exten':_0x34794a[_0x8f39('0x7')],'priority':_0x19b728[_0x8f39('0x33')]['length']+_0x361fc1+_0x42c2f8++,'VoiceExtensionId':_0x34794a['id']});}else{_0x247804['push']({'type':_0x19b728[_0x8f39('0x4')][_0x8f39('0x35')](),'app':'ExecIf','appdata':_0x8f39('0x42'),'context':_0x34794a[_0x8f39('0x6')],'exten':_0x34794a[_0x8f39('0x7')],'priority':_0x19b728[_0x8f39('0x33')][_0x8f39('0x24')]+_0x361fc1+_0x42c2f8++,'VoiceExtensionId':_0x34794a['id']});_0x247804[_0x8f39('0xe')]({'type':_0x19b728[_0x8f39('0x4')][_0x8f39('0x35')](),'app':_0x8f39('0x9'),'appdata':_0x8f39('0x43'),'context':_0x34794a[_0x8f39('0x6')],'exten':_0x34794a[_0x8f39('0x7')],'priority':_0x19b728[_0x8f39('0x33')]['length']+_0x361fc1+_0x42c2f8++,'VoiceExtensionId':_0x34794a['id']});}}}}for(var _0x1532ba=0x0;_0x1532ba<_0x19b728[_0x8f39('0x33')]['length'];_0x1532ba++){var _0x3fd58d=_0x361fc1+_0x19b728[_0x8f39('0x33')]['length'];var _0x49a102=_0x1532ba===_0x19b728[_0x8f39('0x33')][_0x8f39('0x24')]-0x1?_0x361fc1+_0x247804[_0x8f39('0x24')]+_0x2abbbd['length']+0x2:_0x361fc1+_0x1532ba+0x1;_0x247804[_0x8f39('0x44')](_0x1532ba,0x0,{'type':_0x34794a[_0x8f39('0x4')],'app':_0x8f39('0x45'),'appdata':_0x19b728[_0x8f39('0x33')][_0x1532ba]+'?'+_0x34794a[_0x8f39('0x6')]+',${EXTEN},'+_0x3fd58d+':'+_0x34794a['context']+_0x8f39('0x46')+_0x49a102,'exten':_0x34794a['exten'],'context':_0x34794a[_0x8f39('0x6')],'priority':_0x361fc1+_0x1532ba,'VoiceExtensionId':_0x34794a['id']});}if(_0x19b728[_0x8f39('0x47')]===_0x8f39('0x48')){_0x19b728[_0x8f39('0x49')]=_0x18c16f(_0x34794a,_0x19b728[_0x8f39('0x49')]);}if(_0x19b728[_0x8f39('0x47')]==='agi'){_0x247804['push']({'type':_0x19b728[_0x8f39('0x4')][_0x8f39('0x35')](),'app':_0x8f39('0x9'),'appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x34794a[_0x8f39('0x6')],'exten':_0x34794a['exten'],'priority':_0x19b728[_0x8f39('0x33')]['length']+_0x361fc1+_0x42c2f8++,'VoiceExtensionId':_0x34794a['id']});}_0x19b728['priority']=_0x247804['length']?_[_0x8f39('0x4a')](_0x247804)[_0x8f39('0x4b')]+0x1:_0x361fc1;_0x18f276=_[_0x8f39('0x4c')](_0x18f276,_0x247804,[_0x19b728],_0x2abbbd);_0x361fc1=_[_0x8f39('0x4a')](_0x18f276)[_0x8f39('0x4b')]+0x1;}return _0x272a97(_0x18f276);})[_0x8f39('0x4d')](function(_0x25c6f5){_0x5c188d(_0x25c6f5);});});}return _0x40c8bf[_0x8f39('0x4e')](_0x8f39('0x4f'),attributes,{'tableName':_0x8f39('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3388a9){var _0x163413=this[_0x8f39('0x51')]({'plain':!![]});var _0x4c2ea6=_0x163413[_0x8f39('0x4')]==='outbound'?_0x4d7911(_0x163413):_0xb1a246(_0x163413);return _0x34e068(_0x163413,_0x3388a9,_[_0x8f39('0x4a')](_0x4c2ea6)[_0x8f39('0x4b')]+0x1)['then'](function(_0x7de869){var _0x108914=_[_0x8f39('0x4c')](_0x4c2ea6,_0x7de869);_0x108914['push']({'type':_0x163413[_0x8f39('0x4')],'app':_0x8f39('0x52'),'exten':_0x163413[_0x8f39('0x7')],'context':_0x163413[_0x8f39('0x6')],'priority':_[_0x8f39('0x4a')](_0x108914)['priority']+0x1,'VoiceExtensionId':_0x163413['id']});return _0x108914;});}}});}; \ No newline at end of file +var _0x1e1b=['exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','CDR(destination)=','${EXTEN:','cutdigits','${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=','wav','url','name','trunk','split','phone','param','prefix','SIP','options','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','interval','then','length','*,*,*,*','intervals','IntervalId','map','toLowerCase','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','concat','catch','define','VoiceExtension','get','last','lodash','./voiceExtension.attributes','models','type','Set','context'];(function(_0x5b2ad1,_0x4c8974){var _0x5a3c7d=function(_0x4d7e70){while(--_0x4d7e70){_0x5b2ad1['push'](_0x5b2ad1['shift']());}};_0x5a3c7d(++_0x4c8974);}(_0x1e1b,0xfc));var _0xb1e1=function(_0x93942f,_0xb48547){_0x93942f=_0x93942f-0x0;var _0x23fcd8=_0x1e1b[_0x93942f];return _0x23fcd8;};'use strict';var _=require(_0xb1e1('0x0'));var attributes=require(_0xb1e1('0x1'));module['exports']=function(_0x380337){var _0x1f06dc=_0x380337[_0xb1e1('0x2')];function _0x3b0a58(_0x22a9d6){var _0x2ea24a=0x2;var _0x4e7a0b=[{'type':_0x22a9d6[_0xb1e1('0x3')],'app':_0xb1e1('0x4'),'appdata':'CDR(type)='+_0x22a9d6[_0xb1e1('0x3')],'context':_0x22a9d6[_0xb1e1('0x5')],'exten':_0x22a9d6[_0xb1e1('0x6')],'priority':_0x2ea24a++,'VoiceExtensionId':_0x22a9d6['id']},{'type':_0x22a9d6[_0xb1e1('0x3')],'app':_0x22a9d6[_0xb1e1('0x7')]?_0xb1e1('0x4'):_0xb1e1('0x8'),'appdata':_0x22a9d6[_0xb1e1('0x7')]?_0xb1e1('0x9')+_0x22a9d6[_0xb1e1('0x7')]:_0xb1e1('0xa'),'context':_0x22a9d6['context'],'exten':_0x22a9d6[_0xb1e1('0x6')],'priority':_0x2ea24a++,'VoiceExtensionId':_0x22a9d6['id']}];if(_0x22a9d6['type']===_0xb1e1('0xb')){_0x4e7a0b[_0xb1e1('0xc')]({'type':_0xb1e1('0xb'),'app':_0xb1e1('0x4'),'appdata':_0xb1e1('0xd')+_0x22a9d6['id'],'context':_0x22a9d6['context'],'exten':_0x22a9d6[_0xb1e1('0x6')],'priority':_0x2ea24a++,'VoiceExtensionId':_0x22a9d6['id']});}_0x4e7a0b[_0xb1e1('0xc')]({'type':_0x22a9d6[_0xb1e1('0x3')],'app':_0xb1e1('0x4'),'appdata':_0xb1e1('0xe'),'context':_0x22a9d6[_0xb1e1('0x5')],'exten':_0x22a9d6[_0xb1e1('0x6')],'priority':_0x2ea24a++,'VoiceExtensionId':_0x22a9d6['id']},{'type':_0x22a9d6[_0xb1e1('0x3')],'app':_0xb1e1('0x4'),'appdata':_0xb1e1('0xf'),'context':_0x22a9d6[_0xb1e1('0x5')],'exten':_0x22a9d6['exten'],'priority':_0x2ea24a++,'VoiceExtensionId':_0x22a9d6['id']},{'type':_0x22a9d6['type'],'app':'Set','appdata':_0xb1e1('0x10'),'context':_0x22a9d6[_0xb1e1('0x5')],'exten':_0x22a9d6['exten'],'priority':_0x2ea24a++,'VoiceExtensionId':_0x22a9d6['id']});return _0x4e7a0b;}function _0xe83b68(_0x46d0a0){var _0xb18f8=0x2;var _0xb5934e=[{'type':'outbound','app':_0xb1e1('0x4'),'appdata':_0xb1e1('0x11'),'context':_0x46d0a0['context'],'exten':_0x46d0a0[_0xb1e1('0x6')],'priority':_0xb18f8++,'VoiceExtensionId':_0x46d0a0['id']},{'type':_0xb1e1('0x12'),'app':_0x46d0a0[_0xb1e1('0x7')]?'Set':_0xb1e1('0x8'),'appdata':_0x46d0a0[_0xb1e1('0x7')]?_0xb1e1('0x9')+_0x46d0a0[_0xb1e1('0x7')]:'No\x20alias\x20set','context':_0x46d0a0[_0xb1e1('0x5')],'exten':_0x46d0a0['exten'],'priority':_0xb18f8++,'VoiceExtensionId':_0x46d0a0['id']},{'type':_0xb1e1('0x12'),'app':_0xb1e1('0x4'),'appdata':_0xb1e1('0x13')+(_0x46d0a0['cutdigits']?_0xb1e1('0x14')+_0x46d0a0[_0xb1e1('0x15')]+'}':_0xb1e1('0x16')),'context':_0x46d0a0[_0xb1e1('0x5')],'exten':_0x46d0a0[_0xb1e1('0x6')],'priority':_0xb18f8++,'VoiceExtensionId':_0x46d0a0['id']},{'type':'outbound','app':_0xb1e1('0x4'),'appdata':'CDR(routeid)='+_0x46d0a0['id'],'context':_0x46d0a0[_0xb1e1('0x5')],'exten':_0x46d0a0[_0xb1e1('0x6')],'priority':_0xb18f8++,'VoiceExtensionId':_0x46d0a0['id']},{'type':_0xb1e1('0x12'),'app':_0xb1e1('0x17'),'appdata':_0xb1e1('0x18')+(_0xb18f8+0x2)+_0xb1e1('0x19')+(_0xb18f8+0x1)+')','context':_0x46d0a0[_0xb1e1('0x5')],'exten':_0x46d0a0['exten'],'priority':_0xb18f8++,'VoiceExtensionId':_0x46d0a0['id']},{'type':'outbound','app':_0xb1e1('0x4'),'appdata':_0x46d0a0[_0xb1e1('0x15')]?_0xb1e1('0x1a')+_0x46d0a0['cutdigits']+'}':_0xb1e1('0x1b'),'context':_0x46d0a0[_0xb1e1('0x5')],'exten':_0x46d0a0[_0xb1e1('0x6')],'priority':_0xb18f8++,'VoiceExtensionId':_0x46d0a0['id']},{'type':_0xb1e1('0x12'),'app':_0xb1e1('0x4'),'appdata':_0xb1e1('0xe'),'context':_0x46d0a0[_0xb1e1('0x5')],'exten':_0x46d0a0['exten'],'priority':_0xb18f8++,'VoiceExtensionId':_0x46d0a0['id']},{'type':_0xb1e1('0x12'),'app':_0xb1e1('0x4'),'appdata':_0xb1e1('0xf'),'context':_0x46d0a0['context'],'exten':_0x46d0a0['exten'],'priority':_0xb18f8++,'VoiceExtensionId':_0x46d0a0['id']},{'type':_0xb1e1('0x12'),'app':_0xb1e1('0x4'),'appdata':_0xb1e1('0x10'),'context':_0x46d0a0[_0xb1e1('0x5')],'exten':_0x46d0a0[_0xb1e1('0x6')],'priority':_0xb18f8++,'VoiceExtensionId':_0x46d0a0['id']},{'type':_0xb1e1('0x12'),'app':_0xb1e1('0x4'),'appdata':_0xb1e1('0x1c')+_0x46d0a0['id'],'context':_0x46d0a0[_0xb1e1('0x5')],'exten':_0x46d0a0['exten'],'priority':_0xb18f8++,'VoiceExtensionId':_0x46d0a0['id']}];if(_0x46d0a0[_0xb1e1('0x1d')](_0xb1e1('0x1e'))&&_0x46d0a0[_0xb1e1('0x1e')]!==_0xb1e1('0x1f')){_0xb5934e[_0xb1e1('0xc')]({'type':_0xb1e1('0x12'),'app':_0xb1e1('0x4'),'appdata':_0xb1e1('0x20'),'context':_0x46d0a0[_0xb1e1('0x5')],'exten':_0x46d0a0[_0xb1e1('0x6')],'priority':_0xb18f8++,'VoiceExtensionId':_0x46d0a0['id']},{'type':_0xb1e1('0x12'),'app':_0xb1e1('0x4'),'appdata':_0xb1e1('0x21')+_0x46d0a0[_0xb1e1('0x1e')]||_0xb1e1('0x22'),'context':_0x46d0a0[_0xb1e1('0x5')],'exten':_0x46d0a0[_0xb1e1('0x6')],'priority':_0xb18f8++,'VoiceExtensionId':_0x46d0a0['id']});}return _0xb5934e;}function _0x287c4f(_0x446f1d,_0x4b0994){var _0x4e6c10=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':_0xb1e1('0x23'),'param':0x3}];var _0xd476a4={};var _0x260235=_0x4b0994['split'](',');var _0x1d6374=[];for(var _0xcc5ef7=0x0;_0xcc5ef7<_0x4e6c10['length'];_0xcc5ef7++){switch(_0x4e6c10[_0xcc5ef7][_0xb1e1('0x24')]){case _0xb1e1('0x25'):_0xd476a4[_0xb1e1('0x25')]=_0x260235[_0x4e6c10[_0xcc5ef7]['param']][_0xb1e1('0x26')]('/')[0x1];_0xd476a4[_0xb1e1('0x27')]=_0x260235[_0x4e6c10[_0xcc5ef7][_0xb1e1('0x28')]][_0xb1e1('0x26')]('/')[0x2];_0xd476a4[_0xb1e1('0x29')]=_0xd476a4[_0xb1e1('0x27')]?_0xd476a4[_0xb1e1('0x27')]['split']('$')[0x0]:undefined;_0xd476a4[_0xb1e1('0x27')]=_0x446f1d[_0xb1e1('0x15')]?(_0xd476a4['prefix']||'')+_0xb1e1('0x14')+_0x446f1d[_0xb1e1('0x15')]+'}':(_0xd476a4[_0xb1e1('0x29')]||'')+_0xb1e1('0x16');_0x1d6374[_0x4e6c10[_0xcc5ef7]['param']]=[_0xb1e1('0x2a'),_0xd476a4[_0xb1e1('0x25')],_0xd476a4[_0xb1e1('0x27')]]['join']('/');break;case _0xb1e1('0x2b'):_0xd476a4[_0xb1e1('0x2b')]=_0x260235[_0x4e6c10[_0xcc5ef7]['param']];if(_0x446f1d[_0xb1e1('0x1e')]!=='none'){if(_0xd476a4[_0xb1e1('0x2b')][_0xb1e1('0x2c')](_0xb1e1('0x2d'))<0x0){_0xd476a4['options']+=_0xb1e1('0x2d');}}else{_0xd476a4['options']=_0xd476a4[_0xb1e1('0x2b')][_0xb1e1('0x2e')](_0xb1e1('0x2d'),'');}_0x1d6374[_0x4e6c10[_0xcc5ef7]['param']]=_0xd476a4[_0xb1e1('0x2b')];break;default:_0x1d6374[_0x4e6c10[_0xcc5ef7][_0xb1e1('0x28')]]=_0x260235[_0x4e6c10[_0xcc5ef7]['param']];}}return _0x1d6374[_0xb1e1('0x2f')](',');}function _0x512ec5(_0x1e6a21,_0x44d04e,_0x230fc8){return new Promise(function(_0x209dc2,_0x4ef31e){var _0x5bffb9=[];if(_[_0xb1e1('0x30')](_0x44d04e))return _0x209dc2(_0x5bffb9);_0x1f06dc[_0xb1e1('0x31')]['findAll']({'attributes':['id',_0xb1e1('0x32'),'IntervalId'],'raw':!![]})[_0xb1e1('0x33')](function(_0x542a79){for(var _0x3de839=0x0,_0xc8554d=0x0;_0x3de839<_0x44d04e[_0xb1e1('0x34')];_0x3de839++,_0xc8554d=0x0){var _0x128824=_0x44d04e[_0x3de839];var _0xfe8139=[];var _0x116b5a=[];delete _0x128824['id'];if(_0x128824[_0xb1e1('0x32')]!==_0xb1e1('0x35')){_0x128824[_0xb1e1('0x36')]=[_0x128824['interval']];}else{_0x128824[_0xb1e1('0x36')]=_0x128824[_0xb1e1('0x37')]?_[_0xb1e1('0x38')](_['filter'](_0x542a79,{'IntervalId':_0x128824['IntervalId']}),_0xb1e1('0x32')):[];}_0x128824[_0xb1e1('0x5')]=_0x1e6a21[_0xb1e1('0x5')];_0x128824['exten']=_0x1e6a21['exten'];if(_0x128824[_0xb1e1('0x3')])_0x128824['type']=_0x128824['type'][_0xb1e1('0x39')]();if(_0x1e6a21[_0xb1e1('0x3')]===_0xb1e1('0x12')){if(_0x128824[_0xb1e1('0x1d')](_0xb1e1('0x3a'))&&_0x128824[_0xb1e1('0x3a')]&&_0x128824[_0xb1e1('0x3a')]!=='--'){_0xfe8139[_0xb1e1('0xc')]({'type':_0x128824[_0xb1e1('0x3')][_0xb1e1('0x39')](),'app':'Set','appdata':_0xb1e1('0x3b')+_0x128824[_0xb1e1('0x3a')],'context':_0x1e6a21[_0xb1e1('0x5')],'exten':_0x1e6a21[_0xb1e1('0x6')],'priority':_0x128824[_0xb1e1('0x36')][_0xb1e1('0x34')]+_0x230fc8+_0xc8554d++,'VoiceExtensionId':_0x1e6a21['id']});}_0xfe8139[_0xb1e1('0xc')]({'type':_0x128824[_0xb1e1('0x3')][_0xb1e1('0x39')](),'app':_0xb1e1('0x17'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x128824[_0xb1e1('0x3c')]?_0xb1e1('0x3d')+_0x128824[_0xb1e1('0x3c')]+')':_0xb1e1('0x3e')),'context':_0x1e6a21[_0xb1e1('0x5')],'exten':_0x1e6a21[_0xb1e1('0x6')],'priority':_0x128824[_0xb1e1('0x36')][_0xb1e1('0x34')]+_0x230fc8+_0xc8554d++,'VoiceExtensionId':_0x1e6a21['id']});}else{if(_0x128824[_0xb1e1('0x1d')](_0xb1e1('0x3f'))){if([_0xb1e1('0x40'),'playback'][_0xb1e1('0x41')](_0x128824[_0xb1e1('0x42')][_0xb1e1('0x39')]())&&_0x128824['appType']!==_0xb1e1('0x43')){if(_0x128824[_0xb1e1('0x3f')]){_0xfe8139['push']({'type':_0x128824[_0xb1e1('0x3')][_0xb1e1('0x39')](),'app':_0xb1e1('0x17'),'appdata':_0xb1e1('0x44'),'context':_0x1e6a21[_0xb1e1('0x5')],'exten':_0x1e6a21[_0xb1e1('0x6')],'priority':_0x128824[_0xb1e1('0x36')]['length']+_0x230fc8+_0xc8554d++,'VoiceExtensionId':_0x1e6a21['id']});_0xfe8139[_0xb1e1('0xc')]({'type':_0x128824['type'][_0xb1e1('0x39')](),'app':_0xb1e1('0x4'),'appdata':_0xb1e1('0x45'),'context':_0x1e6a21['context'],'exten':_0x1e6a21[_0xb1e1('0x6')],'priority':_0x128824[_0xb1e1('0x36')]['length']+_0x230fc8+_0xc8554d++,'VoiceExtensionId':_0x1e6a21['id']});}else{_0xfe8139[_0xb1e1('0xc')]({'type':_0x128824[_0xb1e1('0x3')][_0xb1e1('0x39')](),'app':_0xb1e1('0x17'),'appdata':_0xb1e1('0x46'),'context':_0x1e6a21[_0xb1e1('0x5')],'exten':_0x1e6a21[_0xb1e1('0x6')],'priority':_0x128824['intervals']['length']+_0x230fc8+_0xc8554d++,'VoiceExtensionId':_0x1e6a21['id']});_0xfe8139[_0xb1e1('0xc')]({'type':_0x128824[_0xb1e1('0x3')]['toLowerCase'](),'app':_0xb1e1('0x4'),'appdata':_0xb1e1('0x47'),'context':_0x1e6a21['context'],'exten':_0x1e6a21['exten'],'priority':_0x128824[_0xb1e1('0x36')][_0xb1e1('0x34')]+_0x230fc8+_0xc8554d++,'VoiceExtensionId':_0x1e6a21['id']});}}}}for(var _0x169e0a=0x0;_0x169e0a<_0x128824[_0xb1e1('0x36')][_0xb1e1('0x34')];_0x169e0a++){var _0x42abda=_0x230fc8+_0x128824[_0xb1e1('0x36')][_0xb1e1('0x34')];var _0x33784f=_0x169e0a===_0x128824[_0xb1e1('0x36')][_0xb1e1('0x34')]-0x1?_0x230fc8+_0xfe8139[_0xb1e1('0x34')]+_0x116b5a['length']+0x2:_0x230fc8+_0x169e0a+0x1;_0xfe8139['splice'](_0x169e0a,0x0,{'type':_0x1e6a21[_0xb1e1('0x3')],'app':_0xb1e1('0x48'),'appdata':_0x128824[_0xb1e1('0x36')][_0x169e0a]+'?'+_0x1e6a21[_0xb1e1('0x5')]+_0xb1e1('0x49')+_0x42abda+':'+_0x1e6a21[_0xb1e1('0x5')]+_0xb1e1('0x49')+_0x33784f,'exten':_0x1e6a21['exten'],'context':_0x1e6a21[_0xb1e1('0x5')],'priority':_0x230fc8+_0x169e0a,'VoiceExtensionId':_0x1e6a21['id']});}if(_0x128824[_0xb1e1('0x4a')]===_0xb1e1('0x4b')){_0x128824[_0xb1e1('0x4c')]=_0x287c4f(_0x1e6a21,_0x128824[_0xb1e1('0x4c')]);}if(_0x128824[_0xb1e1('0x4a')]===_0xb1e1('0x4d')){_0xfe8139[_0xb1e1('0xc')]({'type':_0x128824[_0xb1e1('0x3')]['toLowerCase'](),'app':_0xb1e1('0x4'),'appdata':_0xb1e1('0x4e'),'context':_0x1e6a21[_0xb1e1('0x5')],'exten':_0x1e6a21['exten'],'priority':_0x128824[_0xb1e1('0x36')]['length']+_0x230fc8+_0xc8554d++,'VoiceExtensionId':_0x1e6a21['id']});}_0x128824['priority']=_0xfe8139['length']?_['last'](_0xfe8139)[_0xb1e1('0x4f')]+0x1:_0x230fc8;_0x5bffb9=_[_0xb1e1('0x50')](_0x5bffb9,_0xfe8139,[_0x128824],_0x116b5a);_0x230fc8=_['last'](_0x5bffb9)[_0xb1e1('0x4f')]+0x1;}return _0x209dc2(_0x5bffb9);})[_0xb1e1('0x51')](function(_0x4f0123){_0x4ef31e(_0x4f0123);});});}return _0x380337[_0xb1e1('0x52')](_0xb1e1('0x53'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x2f1ae4){var _0x4b7cac=this[_0xb1e1('0x54')]({'plain':!![]});var _0x2d5d25=_0x4b7cac[_0xb1e1('0x3')]===_0xb1e1('0x12')?_0xe83b68(_0x4b7cac):_0x3b0a58(_0x4b7cac);return _0x512ec5(_0x4b7cac,_0x2f1ae4,_[_0xb1e1('0x55')](_0x2d5d25)['priority']+0x1)[_0xb1e1('0x33')](function(_0x542f89){var _0x4b8ecb=_[_0xb1e1('0x50')](_0x2d5d25,_0x542f89);_0x4b8ecb['push']({'type':_0x4b7cac[_0xb1e1('0x3')],'app':'Hangup','exten':_0x4b7cac[_0xb1e1('0x6')],'context':_0x4b7cac['context'],'priority':_[_0xb1e1('0x55')](_0x4b8ecb)[_0xb1e1('0x4f')]+0x1,'VoiceExtensionId':_0x4b7cac['id']});return _0x4b8ecb;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 2142335..cc3ea55 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 _0x943c=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map','model','attributes','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x40c18a,_0x12bfb3){var _0x512703=function(_0x199e1f){while(--_0x199e1f){_0x40c18a['push'](_0x40c18a['shift']());}};_0x512703(++_0x12bfb3);}(_0x943c,0xd8));var _0xc943=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x943c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc943('0x0'));var util=require(_0xc943('0x1'));var moment=require(_0xc943('0x2'));var BPromise=require(_0xc943('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc943('0x4'))['db'];var utils=require(_0xc943('0x5'));var logger=require(_0xc943('0x6'))('rpc');var config=require(_0xc943('0x7'));var jayson=require(_0xc943('0x8'));var client=jayson[_0xc943('0x9')][_0xc943('0xa')]({'port':0x232a});config[_0xc943('0xb')]=_[_0xc943('0xc')](config[_0xc943('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xc943('0xd'))(new Redis(config[_0xc943('0xb')]));require(_0xc943('0xe'))[_0xc943('0xf')](socket);function respondWithRpcPromise(_0x5ea94b,_0x4b054c,_0x4a4313){return new BPromise(function(_0x142a27,_0x578a7b){return client['request'](_0x5ea94b,_0x4a4313)[_0xc943('0x10')](function(_0x401b9a){logger[_0xc943('0x11')](_0xc943('0x12'),_0x4b054c,_0xc943('0x13'));logger[_0xc943('0x14')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x4b054c,_0xc943('0x13'),JSON[_0xc943('0x15')](_0x401b9a));if(_0x401b9a['error']){if(_0x401b9a['error']['code']===0x1f4){logger[_0xc943('0x16')](_0xc943('0x12'),_0x4b054c,_0x401b9a['error'][_0xc943('0x17')]);return _0x578a7b(_0x401b9a['error']['message']);}logger[_0xc943('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x4b054c,_0x401b9a[_0xc943('0x16')][_0xc943('0x17')]);return _0x142a27(_0x401b9a[_0xc943('0x16')][_0xc943('0x17')]);}else{logger['info'](_0xc943('0x12'),_0x4b054c,_0xc943('0x13'));_0x142a27(_0x401b9a[_0xc943('0x18')]['message']);}})[_0xc943('0x19')](function(_0x320b62){logger[_0xc943('0x16')](_0xc943('0x12'),_0x4b054c,_0x320b62);_0x578a7b(_0x320b62);});});}exports[_0xc943('0x1a')]=function(_0x23da3a){var _0x18a50c=this;return new Promise(function(_0x397598,_0x2dbb35){return db[_0xc943('0x1b')][_0xc943('0x1c')]({'raw':_0x23da3a[_0xc943('0x1d')]?_0x23da3a[_0xc943('0x1d')][_0xc943('0x1e')]===undefined?!![]:![]:!![],'where':_0x23da3a[_0xc943('0x1d')]?_0x23da3a[_0xc943('0x1d')][_0xc943('0x1f')]||null:null,'attributes':_0x23da3a[_0xc943('0x1d')]?_0x23da3a[_0xc943('0x1d')]['attributes']||null:null,'limit':_0x23da3a[_0xc943('0x1d')]?_0x23da3a[_0xc943('0x1d')][_0xc943('0x20')]||null:null,'include':_0x23da3a[_0xc943('0x1d')]?_0x23da3a[_0xc943('0x1d')][_0xc943('0x21')]?_[_0xc943('0x22')](_0x23da3a[_0xc943('0x1d')][_0xc943('0x21')],function(_0x41b83e){return{'model':db[_0x41b83e[_0xc943('0x23')]],'as':_0x41b83e['as'],'attributes':_0x41b83e[_0xc943('0x24')],'include':_0x41b83e[_0xc943('0x21')]?_[_0xc943('0x22')](_0x41b83e['include'],function(_0x34a9ea){return{'model':db[_0x34a9ea[_0xc943('0x23')]],'as':_0x34a9ea['as'],'attributes':_0x34a9ea[_0xc943('0x24')],'include':_0x34a9ea[_0xc943('0x21')]?_[_0xc943('0x22')](_0x34a9ea[_0xc943('0x21')],function(_0x4e77b3){return{'model':db[_0x4e77b3[_0xc943('0x23')]],'as':_0x4e77b3['as'],'attributes':_0x4e77b3[_0xc943('0x24')]};}):[]};}):[]};}):[]:[]})[_0xc943('0x10')](function(_0x288700){logger[_0xc943('0x11')](_0xc943('0x1a'),_0x23da3a);logger[_0xc943('0x14')](_0xc943('0x1a'),_0x23da3a,JSON['stringify'](_0x288700));_0x397598(_0x288700);})['catch'](function(_0x23bd30){logger[_0xc943('0x16')](_0xc943('0x1a'),_0x23bd30[_0xc943('0x17')],_0x23da3a);_0x2dbb35(_0x18a50c['error'](0x1f4,_0x23bd30['message']));});});}; \ No newline at end of file +var _0x6050=['error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','localhost','socket.io-emitter','redis','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1522e6,_0x334dec){var _0x582d2d=function(_0x1b3b23){while(--_0x1b3b23){_0x1522e6['push'](_0x1522e6['shift']());}};_0x582d2d(++_0x334dec);}(_0x6050,0x196));var _0x0605=function(_0x58d45b,_0x5eecf4){_0x58d45b=_0x58d45b-0x0;var _0x283170=_0x6050[_0x58d45b];return _0x283170;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var moment=require(_0x0605('0x2'));var BPromise=require(_0x0605('0x3'));var rs=require(_0x0605('0x4'));var fs=require('fs');var Redis=require(_0x0605('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0605('0x6'));var logger=require(_0x0605('0x7'))(_0x0605('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0605('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x0605('0xa'),'port':0x18eb});var socket=require(_0x0605('0xb'))(new Redis(config[_0x0605('0xc')]));require(_0x0605('0xd'))[_0x0605('0xe')](socket);function respondWithRpcPromise(_0x52bb63,_0x1882e6,_0x23dc2b){return new BPromise(function(_0xe54b22,_0x2c5e23){return client[_0x0605('0xf')](_0x52bb63,_0x23dc2b)[_0x0605('0x10')](function(_0x4385d3){logger[_0x0605('0x11')](_0x0605('0x12'),_0x1882e6,_0x0605('0x13'));logger[_0x0605('0x14')](_0x0605('0x15'),_0x1882e6,_0x0605('0x13'),JSON[_0x0605('0x16')](_0x4385d3));if(_0x4385d3[_0x0605('0x17')]){if(_0x4385d3[_0x0605('0x17')][_0x0605('0x18')]===0x1f4){logger[_0x0605('0x17')](_0x0605('0x12'),_0x1882e6,_0x4385d3['error'][_0x0605('0x19')]);return _0x2c5e23(_0x4385d3[_0x0605('0x17')][_0x0605('0x19')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x1882e6,_0x4385d3[_0x0605('0x17')][_0x0605('0x19')]);return _0xe54b22(_0x4385d3[_0x0605('0x17')][_0x0605('0x19')]);}else{logger[_0x0605('0x11')](_0x0605('0x12'),_0x1882e6,_0x0605('0x13'));_0xe54b22(_0x4385d3[_0x0605('0x1a')][_0x0605('0x19')]);}})[_0x0605('0x1b')](function(_0x3a22e9){logger[_0x0605('0x17')](_0x0605('0x12'),_0x1882e6,_0x3a22e9);_0x2c5e23(_0x3a22e9);});});}exports[_0x0605('0x1c')]=function(_0x59bc87){var _0x254020=this;return new Promise(function(_0x14a920,_0x430f28){return db[_0x0605('0x1d')][_0x0605('0x1e')]({'raw':_0x59bc87[_0x0605('0x1f')]?_0x59bc87[_0x0605('0x1f')][_0x0605('0x20')]===undefined?!![]:![]:!![],'where':_0x59bc87[_0x0605('0x1f')]?_0x59bc87['options'][_0x0605('0x21')]||null:null,'attributes':_0x59bc87['options']?_0x59bc87[_0x0605('0x1f')][_0x0605('0x22')]||null:null,'limit':_0x59bc87[_0x0605('0x1f')]?_0x59bc87[_0x0605('0x1f')][_0x0605('0x23')]||null:null,'include':_0x59bc87[_0x0605('0x1f')]?_0x59bc87[_0x0605('0x1f')][_0x0605('0x24')]?_[_0x0605('0x25')](_0x59bc87[_0x0605('0x1f')][_0x0605('0x24')],function(_0x1c3722){return{'model':db[_0x1c3722['model']],'as':_0x1c3722['as'],'attributes':_0x1c3722[_0x0605('0x22')],'include':_0x1c3722[_0x0605('0x24')]?_['map'](_0x1c3722['include'],function(_0x55ebd8){return{'model':db[_0x55ebd8[_0x0605('0x26')]],'as':_0x55ebd8['as'],'attributes':_0x55ebd8[_0x0605('0x22')],'include':_0x55ebd8[_0x0605('0x24')]?_[_0x0605('0x25')](_0x55ebd8[_0x0605('0x24')],function(_0x4554df){return{'model':db[_0x4554df['model']],'as':_0x4554df['as'],'attributes':_0x4554df[_0x0605('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa836f2){logger[_0x0605('0x11')](_0x0605('0x1c'),_0x59bc87);logger[_0x0605('0x14')](_0x0605('0x1c'),_0x59bc87,JSON[_0x0605('0x16')](_0xa836f2));_0x14a920(_0xa836f2);})['catch'](function(_0x165a0c){logger[_0x0605('0x17')](_0x0605('0x1c'),_0x165a0c[_0x0605('0x19')],_0x59bc87);_0x430f28(_0x254020[_0x0605('0x17')](0x1f4,_0x165a0c[_0x0605('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 573bff1..dc21c1c 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 _0x5fab=['emit','removeListener','register','length','./voiceExtension.events','save','update'];(function(_0x314209,_0x580b43){var _0x3b8c3a=function(_0x522659){while(--_0x522659){_0x314209['push'](_0x314209['shift']());}};_0x3b8c3a(++_0x580b43);}(_0x5fab,0x177));var _0xb5fa=function(_0x11d08e,_0x1cd670){_0x11d08e=_0x11d08e-0x0;var _0x19c8cb=_0x5fab[_0x11d08e];return _0x19c8cb;};'use strict';var VoiceExtensionEvents=require(_0xb5fa('0x0'));var events=[_0xb5fa('0x1'),'remove',_0xb5fa('0x2')];function createListener(_0x2e2a50,_0x3fc227){return function(_0x316ad0){_0x3fc227[_0xb5fa('0x3')](_0x2e2a50,_0x316ad0);};}function removeListener(_0x595d8b,_0x29390a){return function(){VoiceExtensionEvents[_0xb5fa('0x4')](_0x595d8b,_0x29390a);};}exports[_0xb5fa('0x5')]=function(_0x44df89){for(var _0x4a0249=0x0,_0x5d70f6=events[_0xb5fa('0x6')];_0x4a0249<_0x5d70f6;_0x4a0249++){var _0x1aec3e=events[_0x4a0249];var _0x9c7bce=createListener('voiceExtension:'+_0x1aec3e,_0x44df89);VoiceExtensionEvents['on'](_0x1aec3e,_0x9c7bce);}}; \ No newline at end of file +var _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x4d2f2b,_0x3c596e){var _0x5ac391=function(_0x17a9c0){while(--_0x17a9c0){_0x4d2f2b['push'](_0x4d2f2b['shift']());}};_0x5ac391(++_0x3c596e);}(_0xabce,0x103));var _0xeabc=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xabce[_0x173d7e];return _0x2220d6;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 457b138..11eb076 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 _0x9fd4=['post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/messages'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9fd4,0x16c));var _0x49fd=function(_0x273e4c,_0x24c349){_0x273e4c=_0x273e4c-0x0;var _0x11adb4=_0x9fd4[_0x273e4c];return _0x11adb4;};'use strict';var multer=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var path=require(_0x49fd('0x2'));var timeout=require(_0x49fd('0x3'));var express=require(_0x49fd('0x4'));var router=express[_0x49fd('0x5')]();var fs_extra=require(_0x49fd('0x6'));var auth=require(_0x49fd('0x7'));var interaction=require(_0x49fd('0x8'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x49fd('0x9')]('/',auth[_0x49fd('0xa')](),controller[_0x49fd('0xb')]);router[_0x49fd('0x9')]('/:id',auth[_0x49fd('0xa')](),controller[_0x49fd('0xc')]);router[_0x49fd('0x9')](_0x49fd('0xd'),auth[_0x49fd('0xa')](),controller['getMessages']);router[_0x49fd('0xe')]('/',auth[_0x49fd('0xa')](),controller[_0x49fd('0xf')]);router[_0x49fd('0x10')](_0x49fd('0x11'),auth[_0x49fd('0xa')](),controller[_0x49fd('0x12')]);router['delete'](_0x49fd('0x11'),auth[_0x49fd('0xa')](),controller[_0x49fd('0x13')]);module[_0x49fd('0x14')]=router; \ No newline at end of file +var _0x7880=['Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x1b913f,_0x2b5dc6){var _0x56f28f=function(_0xf8d8cb){while(--_0xf8d8cb){_0x1b913f['push'](_0x1b913f['shift']());}};_0x56f28f(++_0x2b5dc6);}(_0x7880,0x1f4));var _0x0788=function(_0x348bac,_0x1804b2){_0x348bac=_0x348bac-0x0;var _0x4e2cbf=_0x7880[_0x348bac];return _0x4e2cbf;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller['update']);router[_0x0788('0x12')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);module[_0x0788('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index efe1e3d..c481a73 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 _0x11f2=['INTEGER','VIRTUAL','fullname','getDataValue','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP'];(function(_0x4a9e4a,_0x585df1){var _0xaa903e=function(_0x4190dd){while(--_0x4190dd){_0x4a9e4a['push'](_0x4a9e4a['shift']());}};_0xaa903e(++_0x585df1);}(_0x11f2,0x82));var _0x211f=function(_0xf763ec,_0x251c78){_0xf763ec=_0xf763ec-0x0;var _0x3b8884=_0x11f2[_0xf763ec];return _0x3b8884;};'use strict';var Sequelize=require(_0x211f('0x0'));module[_0x211f('0x1')]={'customer_id':{'type':Sequelize[_0x211f('0x2')]},'context':{'type':Sequelize[_0x211f('0x2')],'defaultValue':_0x211f('0x3'),'unique':_0x211f('0x4')},'mailbox':{'type':Sequelize[_0x211f('0x2')],'defaultValue':'','allowNull':![],'unique':_0x211f('0x4')},'password':{'type':Sequelize[_0x211f('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x211f('0x2')],'validate':{'isEmail':!![]},'set':function(_0x10ad49){this[_0x211f('0x5')](_0x211f('0x6'),typeof _0x10ad49===_0x211f('0x7')&&_0x10ad49[_0x211f('0x8')]()?_0x10ad49[_0x211f('0x8')]():null);}},'pager':{'type':Sequelize[_0x211f('0x2')]},'tz':{'type':Sequelize[_0x211f('0x2')],'defaultValue':_0x211f('0x9')},'attach':{'type':Sequelize[_0x211f('0xa')](_0x211f('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x211f('0xa')](_0x211f('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x211f('0x2')]},'callback':{'type':Sequelize[_0x211f('0x2')]},'review':{'type':Sequelize['ENUM'](_0x211f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x211f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x211f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x211f('0xa')](_0x211f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x211f('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x211f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x211f('0xa')](_0x211f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x211f('0xa')](_0x211f('0xb'),'no'),'defaultValue':_0x211f('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0x211f('0xa')](_0x211f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x211f('0xa')](_0x211f('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x211f('0xd')},'emailsubject':{'type':Sequelize[_0x211f('0x2')]},'emailbody':{'type':Sequelize[_0x211f('0x2')]},'maxsecs':{'type':Sequelize[_0x211f('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x211f('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x211f('0xf')],'get':function(){return this['getDataValue'](_0x211f('0x10'))+'\x20-\x20'+this[_0x211f('0x11')]('mailbox');}}}; \ No newline at end of file +var _0xc0bf=['mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','\x20-\x20'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc0bf,0xb5));var _0xfc0b=function(_0x3f0a2c,_0x422b65){_0x3f0a2c=_0x3f0a2c-0x0;var _0x38b447=_0xc0bf[_0x3f0a2c];return _0x38b447;};'use strict';var Sequelize=require(_0xfc0b('0x0'));module[_0xfc0b('0x1')]={'customer_id':{'type':Sequelize[_0xfc0b('0x2')]},'context':{'type':Sequelize[_0xfc0b('0x2')],'defaultValue':'from-voicemail','unique':_0xfc0b('0x3')},'mailbox':{'type':Sequelize[_0xfc0b('0x2')],'defaultValue':'','allowNull':![],'unique':_0xfc0b('0x3')},'password':{'type':Sequelize[_0xfc0b('0x2')]},'fullname':{'type':Sequelize[_0xfc0b('0x2')]},'email':{'type':Sequelize[_0xfc0b('0x2')],'validate':{'isEmail':!![]},'set':function(_0x9026ab){this[_0xfc0b('0x4')](_0xfc0b('0x5'),typeof _0x9026ab===_0xfc0b('0x6')&&_0x9026ab[_0xfc0b('0x7')]()?_0x9026ab['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xfc0b('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xfc0b('0x8')](_0xfc0b('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xfc0b('0x8')](_0xfc0b('0x9'),'no'),'defaultValue':_0xfc0b('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xfc0b('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xfc0b('0x8')](_0xfc0b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xfc0b('0x8')](_0xfc0b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xfc0b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xfc0b('0x8')](_0xfc0b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xfc0b('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xfc0b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xfc0b('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xfc0b('0x8')](_0xfc0b('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xfc0b('0x8')](_0xfc0b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xfc0b('0x8')](_0xfc0b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xfc0b('0x8')](_0xfc0b('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xfc0b('0xb')},'emailsubject':{'type':Sequelize[_0xfc0b('0x2')]},'emailbody':{'type':Sequelize[_0xfc0b('0x2')]},'maxsecs':{'type':Sequelize[_0xfc0b('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xfc0b('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('fullname')+_0xfc0b('0xd')+this['getDataValue'](_0xfc0b('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 68774bc..3d60d33 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 _0xed3c=['body','getMessages','findOne','order','sort','mailbox','findAndCountAll','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','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','options','includeAll','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Voicemails','UserProfileSection','userProfileId','autoAssociation'];(function(_0x3e9081,_0x99b751){var _0x523517=function(_0x2af3ee){while(--_0x2af3ee){_0x3e9081['push'](_0x3e9081['shift']());}};_0x523517(++_0x99b751);}(_0xed3c,0x1a6));var _0xced3=function(_0x56740a,_0x568894){_0x56740a=_0x56740a-0x0;var _0x257144=_0xed3c[_0x56740a];return _0x257144;};'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'];function respondWithStatusCode(_0x42d879,_0x3b2ac4){_0x3b2ac4=_0x3b2ac4||0xcc;return function(_0x457caf){if(_0x457caf){return _0x42d879[_0xced3('0x16')](_0x3b2ac4);}return _0x42d879[_0xced3('0x17')](_0x3b2ac4)['end']();};}function respondWithResult(_0x65bb58,_0x5e186e){_0x5e186e=_0x5e186e||0xc8;return function(_0xf2db6f){if(_0xf2db6f){return _0x65bb58[_0xced3('0x17')](_0x5e186e)[_0xced3('0x18')](_0xf2db6f);}};}function respondWithFilteredResult(_0x39e4aa,_0x4dd4c3){return function(_0x146a21){if(_0x146a21){var _0x322c2d=typeof _0x4dd4c3['offset']===_0xced3('0x19')&&typeof _0x4dd4c3[_0xced3('0x1a')]===_0xced3('0x19');var _0x17f611=_0x146a21['count'];var _0x4569af=_0x322c2d?0x0:_0x4dd4c3['offset'];var _0x353580=_0x322c2d?_0x146a21[_0xced3('0x1b')]:_0x4dd4c3[_0xced3('0x1c')]+_0x4dd4c3[_0xced3('0x1a')];var _0x44143f;if(_0x353580>=_0x17f611){_0x353580=_0x17f611;_0x44143f=0xc8;}else{_0x44143f=0xce;}_0x39e4aa[_0xced3('0x17')](_0x44143f);return _0x39e4aa[_0xced3('0x1d')](_0xced3('0x1e'),_0x4569af+'-'+_0x353580+'/'+_0x17f611)[_0xced3('0x18')](_0x146a21);}return null;};}function patchUpdates(_0x17c011){return function(_0x2008f2){try{jsonpatch['apply'](_0x2008f2,_0x17c011,!![]);}catch(_0x5b8b1f){return BPromise['reject'](_0x5b8b1f);}return _0x2008f2[_0xced3('0x1f')]();};}function saveUpdates(_0x342b9e,_0x21e074){return function(_0x4bf915){if(_0x4bf915){return _0x4bf915[_0xced3('0x20')](_0x342b9e)[_0xced3('0x21')](function(_0x526854){return _0x526854;});}return null;};}function removeEntity(_0x559fa2,_0x3adf14){return function(_0x101708){if(_0x101708){return _0x101708[_0xced3('0x22')]()[_0xced3('0x21')](function(){var _0x50f7c1=_0x101708[_0xced3('0x23')]({'plain':!![]});var _0x23f92b='Voicemails';return db[_0xced3('0x24')]['destroy']({'where':{'type':_0x23f92b,'resourceId':_0x50f7c1['id']}})[_0xced3('0x21')](function(){return _0x101708;});})[_0xced3('0x21')](function(){_0x559fa2[_0xced3('0x17')](0xcc)[_0xced3('0x25')]();});}};}function handleEntityNotFound(_0x2ec2c4,_0x502cf1){return function(_0x5454c0){if(!_0x5454c0){_0x2ec2c4[_0xced3('0x16')](0x194);}return _0x5454c0;};}function handleError(_0x5bb425,_0x2ab8a8){_0x2ab8a8=_0x2ab8a8||0x1f4;return function(_0x1e6923){logger['error'](_0x1e6923[_0xced3('0x26')]);if(_0x1e6923[_0xced3('0x27')]){delete _0x1e6923[_0xced3('0x27')];}_0x5bb425[_0xced3('0x17')](_0x2ab8a8)[_0xced3('0x28')](_0x1e6923);};}exports[_0xced3('0x29')]=function(_0x895a32,_0x41d003){var _0x116cc7={},_0x559b8e={},_0xa78899={'count':0x0,'rows':[]};var _0x1b8baa=_[_0xced3('0x2a')](db[_0xced3('0x2b')][_0xced3('0x2c')],function(_0x21e4a2){return{'name':_0x21e4a2[_0xced3('0x2d')],'type':_0x21e4a2[_0xced3('0x2e')][_0xced3('0x2f')]};});_0x559b8e[_0xced3('0x30')]=_[_0xced3('0x2a')](_0x1b8baa,_0xced3('0x27'));_0x559b8e[_0xced3('0x31')]=_[_0xced3('0x32')](_0x895a32[_0xced3('0x31')]);_0x559b8e[_0xced3('0x33')]=_[_0xced3('0x34')](_0x559b8e[_0xced3('0x30')],_0x559b8e[_0xced3('0x31')]);_0x116cc7[_0xced3('0x35')]=_[_0xced3('0x34')](_0x559b8e['model'],qs[_0xced3('0x36')](_0x895a32['query'][_0xced3('0x36')]));_0x116cc7[_0xced3('0x35')]=_0x116cc7[_0xced3('0x35')][_0xced3('0x37')]?_0x116cc7[_0xced3('0x35')]:_0x559b8e[_0xced3('0x30')];if(!_0x895a32[_0xced3('0x31')][_0xced3('0x38')](_0xced3('0x39'))){_0x116cc7[_0xced3('0x1a')]=qs['limit'](_0x895a32[_0xced3('0x31')][_0xced3('0x1a')]);_0x116cc7['offset']=qs[_0xced3('0x1c')](_0x895a32[_0xced3('0x31')][_0xced3('0x1c')]);}_0x116cc7['order']=qs['sort'](_0x895a32[_0xced3('0x31')]['sort']);_0x116cc7[_0xced3('0x3a')]=qs[_0xced3('0x33')](_['pick'](_0x895a32[_0xced3('0x31')],_0x559b8e[_0xced3('0x33')]),_0x1b8baa);if(_0x895a32[_0xced3('0x31')]['filter']){_0x116cc7[_0xced3('0x3a')]=_['merge'](_0x116cc7['where'],{'$or':_[_0xced3('0x2a')](_0x1b8baa,function(_0x31e281){if(_0x31e281[_0xced3('0x2e')]!=='VIRTUAL'){var _0xb2cf20={};_0xb2cf20[_0x31e281[_0xced3('0x27')]]={'$like':'%'+_0x895a32[_0xced3('0x31')][_0xced3('0x3b')]+'%'};return _0xb2cf20;}})});}_0x116cc7=_[_0xced3('0x3c')]({},_0x116cc7,_0x895a32[_0xced3('0x3d')]);var _0x30e890={'where':_0x116cc7[_0xced3('0x3a')]};return db[_0xced3('0x2b')][_0xced3('0x1b')](_0x30e890)[_0xced3('0x21')](function(_0x38855f){_0xa78899[_0xced3('0x1b')]=_0x38855f;if(_0x895a32[_0xced3('0x31')][_0xced3('0x3e')]){_0x116cc7['include']=[{'all':!![]}];}return db[_0xced3('0x2b')][_0xced3('0x3f')](_0x116cc7);})[_0xced3('0x21')](function(_0x1a6c1f){_0xa78899[_0xced3('0x40')]=_0x1a6c1f;return _0xa78899;})[_0xced3('0x21')](respondWithFilteredResult(_0x41d003,_0x116cc7))[_0xced3('0x41')](handleError(_0x41d003,null));};exports[_0xced3('0x42')]=function(_0x1ab7e0,_0x4cea5c){var _0x6c0238={'raw':!![],'where':{'id':_0x1ab7e0[_0xced3('0x43')]['id']}},_0x47ab23={};_0x47ab23[_0xced3('0x30')]=_[_0xced3('0x32')](db['VoiceMail'][_0xced3('0x2c')]);_0x47ab23[_0xced3('0x31')]=_[_0xced3('0x32')](_0x1ab7e0[_0xced3('0x31')]);_0x47ab23['filters']=_[_0xced3('0x34')](_0x47ab23[_0xced3('0x30')],_0x47ab23[_0xced3('0x31')]);_0x6c0238[_0xced3('0x35')]=_[_0xced3('0x34')](_0x47ab23['model'],qs[_0xced3('0x36')](_0x1ab7e0[_0xced3('0x31')][_0xced3('0x36')]));_0x6c0238[_0xced3('0x35')]=_0x6c0238[_0xced3('0x35')][_0xced3('0x37')]?_0x6c0238[_0xced3('0x35')]:_0x47ab23['model'];if(_0x1ab7e0[_0xced3('0x31')][_0xced3('0x3e')]){_0x6c0238['include']=[{'all':!![]}];}_0x6c0238=_['merge']({},_0x6c0238,_0x1ab7e0[_0xced3('0x3d')]);return db['VoiceMail'][_0xced3('0x44')](_0x6c0238)[_0xced3('0x21')](handleEntityNotFound(_0x4cea5c,null))[_0xced3('0x21')](respondWithResult(_0x4cea5c,null))[_0xced3('0x41')](handleError(_0x4cea5c,null));};exports[_0xced3('0x45')]=function(_0x1b3396,_0x3700ed){return db[_0xced3('0x2b')][_0xced3('0x45')](_0x1b3396['body'],{})[_0xced3('0x21')](function(_0x8df206){var _0x2aa876=_0x1b3396[_0xced3('0x46')][_0xced3('0x23')]({'plain':!![]});if(!_0x2aa876)throw new Error(_0xced3('0x47'));if(_0x2aa876['role']===_0xced3('0x46')){var _0x629ecf=_0x8df206[_0xced3('0x23')]({'plain':!![]});var _0x409da0=_0xced3('0x48');return db[_0xced3('0x49')][_0xced3('0x44')]({'where':{'name':_0x409da0,'userProfileId':_0x2aa876[_0xced3('0x4a')]},'raw':!![]})[_0xced3('0x21')](function(_0x44d779){if(_0x44d779&&_0x44d779[_0xced3('0x4b')]===0x0){return db[_0xced3('0x24')]['create']({'name':_0x629ecf[_0xced3('0x27')],'resourceId':_0x629ecf['id'],'type':_0x44d779['name'],'sectionId':_0x44d779['id']},{})[_0xced3('0x21')](function(){return _0x8df206;});}else{return _0x8df206;}})[_0xced3('0x41')](function(_0xc93e05){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc93e05);throw _0xc93e05;});}return _0x8df206;})[_0xced3('0x21')](respondWithResult(_0x3700ed,0xc9))[_0xced3('0x41')](handleError(_0x3700ed,null));};exports['update']=function(_0x3f41cc,_0x4ae67d){if(_0x3f41cc[_0xced3('0x4c')]['id']){delete _0x3f41cc[_0xced3('0x4c')]['id'];}return db['VoiceMail'][_0xced3('0x44')]({'where':{'id':_0x3f41cc[_0xced3('0x43')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x4ae67d,null))['then'](saveUpdates(_0x3f41cc[_0xced3('0x4c')],null))['then'](respondWithResult(_0x4ae67d,null))[_0xced3('0x41')](handleError(_0x4ae67d,null));};exports[_0xced3('0x22')]=function(_0x4694b8,_0x168c36){return db[_0xced3('0x2b')][_0xced3('0x44')]({'where':{'id':_0x4694b8[_0xced3('0x43')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x168c36,null))[_0xced3('0x21')](removeEntity(_0x168c36,null))[_0xced3('0x41')](handleError(_0x168c36,null));};exports[_0xced3('0x4d')]=function(_0x4b14dd,_0x3859e8,_0x3de35d){return db[_0xced3('0x2b')][_0xced3('0x4e')]({'where':{'id':_0x4b14dd[_0xced3('0x43')]['id']}})[_0xced3('0x21')](handleEntityNotFound(_0x3859e8,null))['then'](function(_0x9db425){var _0x171081;var _0x21ea6a={},_0x440a0f={};_0x440a0f[_0xced3('0x30')]=_[_0xced3('0x32')](db['VoiceMailMessage'][_0xced3('0x2c')]);_0x440a0f['query']=_[_0xced3('0x32')](_0x4b14dd['query']);_0x440a0f[_0xced3('0x33')]=_[_0xced3('0x34')](_0x440a0f['model'],_0x440a0f[_0xced3('0x31')]);_0x21ea6a[_0xced3('0x35')]=_[_0xced3('0x34')](_0x440a0f[_0xced3('0x30')],qs[_0xced3('0x36')](_0x4b14dd[_0xced3('0x31')][_0xced3('0x36')]));_0x21ea6a[_0xced3('0x35')]=_0x21ea6a[_0xced3('0x35')][_0xced3('0x37')]?_0x21ea6a[_0xced3('0x35')]:_0x440a0f[_0xced3('0x30')];if(!_0x4b14dd[_0xced3('0x31')]['hasOwnProperty'](_0xced3('0x39'))){_0x21ea6a[_0xced3('0x1a')]=qs[_0xced3('0x1a')](_0x4b14dd[_0xced3('0x31')]['limit']);_0x21ea6a[_0xced3('0x1c')]=qs[_0xced3('0x1c')](_0x4b14dd[_0xced3('0x31')][_0xced3('0x1c')]);}_0x21ea6a[_0xced3('0x4f')]=qs[_0xced3('0x50')](_0x4b14dd[_0xced3('0x31')]['sort']);_0x21ea6a[_0xced3('0x3a')]=qs[_0xced3('0x33')](_['pick'](_0x4b14dd[_0xced3('0x31')],_0x440a0f[_0xced3('0x33')]));if(_0x4b14dd[_0xced3('0x31')][_0xced3('0x3b')]){_0x21ea6a['where']=_[_0xced3('0x3c')](_0x21ea6a[_0xced3('0x3a')],{'$or':_[_0xced3('0x2a')](_0x21ea6a[_0xced3('0x35')],function(_0x3992d2){var _0x385d45={};_0x385d45[_0x3992d2]={'$like':'%'+_0x4b14dd[_0xced3('0x31')][_0xced3('0x3b')]+'%'};return _0x385d45;})});}_0x21ea6a[_0xced3('0x3a')]=_[_0xced3('0x3c')](_0x21ea6a['where'],{'mailboxuser':_0x9db425[_0xced3('0x51')]});_0x21ea6a=_[_0xced3('0x3c')]({},_0x21ea6a,_0x4b14dd['options']);return db['VoiceMailMessage'][_0xced3('0x52')](_0x21ea6a)['then'](respondWithFilteredResult(_0x3859e8,_0x21ea6a));})[_0xced3('0x41')](handleError(_0x3859e8,null));}; \ No newline at end of file +var _0x9c00=['name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','merge','where','VIRTUAL','options','VoiceMail','includeAll','include','rows','catch','show','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','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','update','destroy','get','Voicemails','UserProfileResource','then','stack'];(function(_0x1c4b40,_0x1a5e89){var _0x7c66a4=function(_0x270365){while(--_0x270365){_0x1c4b40['push'](_0x1c4b40['shift']());}};_0x7c66a4(++_0x1a5e89);}(_0x9c00,0x1a0));var _0x09c0=function(_0x441a8b,_0x4c6cc9){_0x441a8b=_0x441a8b-0x0;var _0x367ac5=_0x9c00[_0x441a8b];return _0x367ac5;};'use strict';var emlformat=require(_0x09c0('0x0'));var rimraf=require(_0x09c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09c0('0x2'));var moment=require(_0x09c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x09c0('0x4'));var util=require(_0x09c0('0x5'));var path=require(_0x09c0('0x6'));var sox=require(_0x09c0('0x7'));var csv=require(_0x09c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var as=require(_0x09c0('0x13'));var hardwareService=require(_0x09c0('0x14'));var logger=require(_0x09c0('0x15'))(_0x09c0('0x16'));var utils=require(_0x09c0('0x17'));var config=require(_0x09c0('0x18'));var licenseUtil=require(_0x09c0('0x19'));var db=require(_0x09c0('0x1a'))['db'];function respondWithStatusCode(_0x144271,_0x3b95cc){_0x3b95cc=_0x3b95cc||0xcc;return function(_0x331905){if(_0x331905){return _0x144271[_0x09c0('0x1b')](_0x3b95cc);}return _0x144271[_0x09c0('0x1c')](_0x3b95cc)[_0x09c0('0x1d')]();};}function respondWithResult(_0x3649d2,_0x16e490){_0x16e490=_0x16e490||0xc8;return function(_0x254598){if(_0x254598){return _0x3649d2[_0x09c0('0x1c')](_0x16e490)[_0x09c0('0x1e')](_0x254598);}};}function respondWithFilteredResult(_0x33c3d6,_0x2fdf11){return function(_0x4ff6b7){if(_0x4ff6b7){var _0x590129=typeof _0x2fdf11['offset']===_0x09c0('0x1f')&&typeof _0x2fdf11[_0x09c0('0x20')]===_0x09c0('0x1f');var _0x628272=_0x4ff6b7['count'];var _0x2c4440=_0x590129?0x0:_0x2fdf11['offset'];var _0x4c29a7=_0x590129?_0x4ff6b7[_0x09c0('0x21')]:_0x2fdf11['offset']+_0x2fdf11[_0x09c0('0x20')];var _0x319c36;if(_0x4c29a7>=_0x628272){_0x4c29a7=_0x628272;_0x319c36=0xc8;}else{_0x319c36=0xce;}_0x33c3d6[_0x09c0('0x1c')](_0x319c36);return _0x33c3d6['set'](_0x09c0('0x22'),_0x2c4440+'-'+_0x4c29a7+'/'+_0x628272)[_0x09c0('0x1e')](_0x4ff6b7);}return null;};}function patchUpdates(_0x8ad645){return function(_0x3447c5){try{jsonpatch[_0x09c0('0x23')](_0x3447c5,_0x8ad645,!![]);}catch(_0xa5d16f){return BPromise[_0x09c0('0x24')](_0xa5d16f);}return _0x3447c5['save']();};}function saveUpdates(_0x1695e8,_0x46f171){return function(_0x473fbd){if(_0x473fbd){return _0x473fbd[_0x09c0('0x25')](_0x1695e8)['then'](function(_0x4f6824){return _0x4f6824;});}return null;};}function removeEntity(_0x321bcc,_0x25fdb5){return function(_0x1e8a1c){if(_0x1e8a1c){return _0x1e8a1c[_0x09c0('0x26')]()['then'](function(){var _0x42ebfc=_0x1e8a1c[_0x09c0('0x27')]({'plain':!![]});var _0x56d883=_0x09c0('0x28');return db[_0x09c0('0x29')][_0x09c0('0x26')]({'where':{'type':_0x56d883,'resourceId':_0x42ebfc['id']}})[_0x09c0('0x2a')](function(){return _0x1e8a1c;});})[_0x09c0('0x2a')](function(){_0x321bcc[_0x09c0('0x1c')](0xcc)[_0x09c0('0x1d')]();});}};}function handleEntityNotFound(_0x35b61c,_0x1ea951){return function(_0x1aa80e){if(!_0x1aa80e){_0x35b61c[_0x09c0('0x1b')](0x194);}return _0x1aa80e;};}function handleError(_0x5e53ac,_0x15a667){_0x15a667=_0x15a667||0x1f4;return function(_0x1bdde9){logger['error'](_0x1bdde9[_0x09c0('0x2b')]);if(_0x1bdde9['name']){delete _0x1bdde9[_0x09c0('0x2c')];}_0x5e53ac['status'](_0x15a667)[_0x09c0('0x2d')](_0x1bdde9);};}exports[_0x09c0('0x2e')]=function(_0x108409,_0x4159bc){var _0x4e999a={},_0x5478b7={},_0x17c374={'count':0x0,'rows':[]};var _0x38a315=_[_0x09c0('0x2f')](db['VoiceMail'][_0x09c0('0x30')],function(_0x4bdae9){return{'name':_0x4bdae9[_0x09c0('0x31')],'type':_0x4bdae9[_0x09c0('0x32')][_0x09c0('0x33')]};});_0x5478b7['model']=_[_0x09c0('0x2f')](_0x38a315,_0x09c0('0x2c'));_0x5478b7[_0x09c0('0x34')]=_[_0x09c0('0x35')](_0x108409[_0x09c0('0x34')]);_0x5478b7[_0x09c0('0x36')]=_[_0x09c0('0x37')](_0x5478b7['model'],_0x5478b7[_0x09c0('0x34')]);_0x4e999a[_0x09c0('0x38')]=_[_0x09c0('0x37')](_0x5478b7[_0x09c0('0x39')],qs[_0x09c0('0x3a')](_0x108409['query'][_0x09c0('0x3a')]));_0x4e999a[_0x09c0('0x38')]=_0x4e999a[_0x09c0('0x38')][_0x09c0('0x3b')]?_0x4e999a[_0x09c0('0x38')]:_0x5478b7['model'];if(!_0x108409[_0x09c0('0x34')][_0x09c0('0x3c')](_0x09c0('0x3d'))){_0x4e999a[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x108409[_0x09c0('0x34')][_0x09c0('0x20')]);_0x4e999a['offset']=qs[_0x09c0('0x3e')](_0x108409[_0x09c0('0x34')][_0x09c0('0x3e')]);}_0x4e999a[_0x09c0('0x3f')]=qs[_0x09c0('0x40')](_0x108409['query']['sort']);_0x4e999a['where']=qs['filters'](_[_0x09c0('0x41')](_0x108409[_0x09c0('0x34')],_0x5478b7[_0x09c0('0x36')]),_0x38a315);if(_0x108409[_0x09c0('0x34')][_0x09c0('0x42')]){_0x4e999a['where']=_[_0x09c0('0x43')](_0x4e999a[_0x09c0('0x44')],{'$or':_['map'](_0x38a315,function(_0x1067cf){if(_0x1067cf['type']!==_0x09c0('0x45')){var _0x5c80a2={};_0x5c80a2[_0x1067cf[_0x09c0('0x2c')]]={'$like':'%'+_0x108409[_0x09c0('0x34')]['filter']+'%'};return _0x5c80a2;}})});}_0x4e999a=_[_0x09c0('0x43')]({},_0x4e999a,_0x108409[_0x09c0('0x46')]);var _0x5d69fd={'where':_0x4e999a[_0x09c0('0x44')]};return db[_0x09c0('0x47')][_0x09c0('0x21')](_0x5d69fd)[_0x09c0('0x2a')](function(_0xeb8191){_0x17c374[_0x09c0('0x21')]=_0xeb8191;if(_0x108409['query'][_0x09c0('0x48')]){_0x4e999a[_0x09c0('0x49')]=[{'all':!![]}];}return db[_0x09c0('0x47')]['findAll'](_0x4e999a);})[_0x09c0('0x2a')](function(_0x30c0c5){_0x17c374[_0x09c0('0x4a')]=_0x30c0c5;return _0x17c374;})['then'](respondWithFilteredResult(_0x4159bc,_0x4e999a))[_0x09c0('0x4b')](handleError(_0x4159bc,null));};exports[_0x09c0('0x4c')]=function(_0x52cd5c,_0x5bbf4e){var _0x397e73={'raw':!![],'where':{'id':_0x52cd5c['params']['id']}},_0x471078={};_0x471078[_0x09c0('0x39')]=_[_0x09c0('0x35')](db['VoiceMail'][_0x09c0('0x30')]);_0x471078[_0x09c0('0x34')]=_[_0x09c0('0x35')](_0x52cd5c[_0x09c0('0x34')]);_0x471078[_0x09c0('0x36')]=_['intersection'](_0x471078[_0x09c0('0x39')],_0x471078['query']);_0x397e73['attributes']=_[_0x09c0('0x37')](_0x471078[_0x09c0('0x39')],qs[_0x09c0('0x3a')](_0x52cd5c[_0x09c0('0x34')][_0x09c0('0x3a')]));_0x397e73[_0x09c0('0x38')]=_0x397e73['attributes']['length']?_0x397e73['attributes']:_0x471078[_0x09c0('0x39')];if(_0x52cd5c[_0x09c0('0x34')][_0x09c0('0x48')]){_0x397e73['include']=[{'all':!![]}];}_0x397e73=_[_0x09c0('0x43')]({},_0x397e73,_0x52cd5c[_0x09c0('0x46')]);return db[_0x09c0('0x47')][_0x09c0('0x4d')](_0x397e73)[_0x09c0('0x2a')](handleEntityNotFound(_0x5bbf4e,null))[_0x09c0('0x2a')](respondWithResult(_0x5bbf4e,null))[_0x09c0('0x4b')](handleError(_0x5bbf4e,null));};exports[_0x09c0('0x4e')]=function(_0x3f6d14,_0x38085c){return db[_0x09c0('0x47')][_0x09c0('0x4e')](_0x3f6d14[_0x09c0('0x4f')],{})[_0x09c0('0x2a')](function(_0x332b69){var _0x32abbe=_0x3f6d14[_0x09c0('0x50')][_0x09c0('0x27')]({'plain':!![]});if(!_0x32abbe)throw new Error(_0x09c0('0x51'));if(_0x32abbe[_0x09c0('0x52')]==='user'){var _0x4acf54=_0x332b69[_0x09c0('0x27')]({'plain':!![]});var _0x15b0a2=_0x09c0('0x28');return db[_0x09c0('0x53')]['find']({'where':{'name':_0x15b0a2,'userProfileId':_0x32abbe[_0x09c0('0x54')]},'raw':!![]})[_0x09c0('0x2a')](function(_0x1823c2){if(_0x1823c2&&_0x1823c2['autoAssociation']===0x0){return db[_0x09c0('0x29')][_0x09c0('0x4e')]({'name':_0x4acf54[_0x09c0('0x2c')],'resourceId':_0x4acf54['id'],'type':_0x1823c2[_0x09c0('0x2c')],'sectionId':_0x1823c2['id']},{})[_0x09c0('0x2a')](function(){return _0x332b69;});}else{return _0x332b69;}})[_0x09c0('0x4b')](function(_0x45ecd0){logger['error'](_0x09c0('0x55'),_0x45ecd0);throw _0x45ecd0;});}return _0x332b69;})[_0x09c0('0x2a')](respondWithResult(_0x38085c,0xc9))[_0x09c0('0x4b')](handleError(_0x38085c,null));};exports[_0x09c0('0x25')]=function(_0x21fe00,_0x316fbd){if(_0x21fe00[_0x09c0('0x4f')]['id']){delete _0x21fe00['body']['id'];}return db['VoiceMail'][_0x09c0('0x4d')]({'where':{'id':_0x21fe00[_0x09c0('0x56')]['id']}})[_0x09c0('0x2a')](handleEntityNotFound(_0x316fbd,null))['then'](saveUpdates(_0x21fe00[_0x09c0('0x4f')],null))['then'](respondWithResult(_0x316fbd,null))[_0x09c0('0x4b')](handleError(_0x316fbd,null));};exports[_0x09c0('0x26')]=function(_0x42d4dd,_0x290618){return db[_0x09c0('0x47')][_0x09c0('0x4d')]({'where':{'id':_0x42d4dd[_0x09c0('0x56')]['id']}})['then'](handleEntityNotFound(_0x290618,null))[_0x09c0('0x2a')](removeEntity(_0x290618,null))[_0x09c0('0x4b')](handleError(_0x290618,null));};exports[_0x09c0('0x57')]=function(_0x270ff2,_0x3a6845,_0x219195){return db[_0x09c0('0x47')][_0x09c0('0x58')]({'where':{'id':_0x270ff2[_0x09c0('0x56')]['id']}})[_0x09c0('0x2a')](handleEntityNotFound(_0x3a6845,null))[_0x09c0('0x2a')](function(_0x4c4339){var _0x34cc0a;var _0x3564e6={},_0x26dc22={};_0x26dc22[_0x09c0('0x39')]=_['keys'](db[_0x09c0('0x59')]['rawAttributes']);_0x26dc22[_0x09c0('0x34')]=_[_0x09c0('0x35')](_0x270ff2[_0x09c0('0x34')]);_0x26dc22['filters']=_['intersection'](_0x26dc22[_0x09c0('0x39')],_0x26dc22[_0x09c0('0x34')]);_0x3564e6[_0x09c0('0x38')]=_[_0x09c0('0x37')](_0x26dc22['model'],qs[_0x09c0('0x3a')](_0x270ff2[_0x09c0('0x34')]['fields']));_0x3564e6[_0x09c0('0x38')]=_0x3564e6[_0x09c0('0x38')][_0x09c0('0x3b')]?_0x3564e6[_0x09c0('0x38')]:_0x26dc22['model'];if(!_0x270ff2[_0x09c0('0x34')][_0x09c0('0x3c')](_0x09c0('0x3d'))){_0x3564e6[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x270ff2[_0x09c0('0x34')][_0x09c0('0x20')]);_0x3564e6[_0x09c0('0x3e')]=qs[_0x09c0('0x3e')](_0x270ff2[_0x09c0('0x34')][_0x09c0('0x3e')]);}_0x3564e6[_0x09c0('0x3f')]=qs[_0x09c0('0x40')](_0x270ff2['query'][_0x09c0('0x40')]);_0x3564e6[_0x09c0('0x44')]=qs[_0x09c0('0x36')](_[_0x09c0('0x41')](_0x270ff2[_0x09c0('0x34')],_0x26dc22['filters']));if(_0x270ff2[_0x09c0('0x34')][_0x09c0('0x42')]){_0x3564e6[_0x09c0('0x44')]=_[_0x09c0('0x43')](_0x3564e6['where'],{'$or':_[_0x09c0('0x2f')](_0x3564e6[_0x09c0('0x38')],function(_0x569462){var _0x325013={};_0x325013[_0x569462]={'$like':'%'+_0x270ff2[_0x09c0('0x34')][_0x09c0('0x42')]+'%'};return _0x325013;})});}_0x3564e6[_0x09c0('0x44')]=_[_0x09c0('0x43')](_0x3564e6['where'],{'mailboxuser':_0x4c4339[_0x09c0('0x5a')]});_0x3564e6=_[_0x09c0('0x43')]({},_0x3564e6,_0x270ff2[_0x09c0('0x46')]);return db[_0x09c0('0x59')][_0x09c0('0x5b')](_0x3564e6)['then'](respondWithFilteredResult(_0x3a6845,_0x3564e6));})[_0x09c0('0x4b')](handleError(_0x3a6845,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 9776298..38328a3 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 _0x0bdd=['context','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes','define','voice_voicemail'];(function(_0x53ad58,_0x3fb489){var _0x554b03=function(_0x5769ba){while(--_0x5769ba){_0x53ad58['push'](_0x53ad58['shift']());}};_0x554b03(++_0x3fb489);}(_0x0bdd,0x1f0));var _0xd0bd=function(_0x197191,_0x412830){_0x197191=_0x197191-0x0;var _0x15d150=_0x0bdd[_0x197191];return _0x15d150;};'use strict';var _=require(_0xd0bd('0x0'));var util=require('util');var logger=require(_0xd0bd('0x1'))(_0xd0bd('0x2'));var moment=require('moment');var BPromise=require(_0xd0bd('0x3'));var rp=require(_0xd0bd('0x4'));var fs=require('fs');var path=require(_0xd0bd('0x5'));var rimraf=require('rimraf');var config=require(_0xd0bd('0x6'));var attributes=require(_0xd0bd('0x7'));module['exports']=function(_0x54f3a9,_0x4626d5){return _0x54f3a9[_0xd0bd('0x8')]('VoiceMail',attributes,{'tableName':_0xd0bd('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0xd0bd('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9da4=['../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','context','util','../../config/logger','api','moment','bluebird','path'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0x9da4,0x182));var _0x49da=function(_0x33638b,_0x4509dd){_0x33638b=_0x33638b-0x0;var _0x4365f8=_0x9da4[_0x33638b];return _0x4365f8;};'use strict';var _=require('lodash');var util=require(_0x49da('0x0'));var logger=require(_0x49da('0x1'))(_0x49da('0x2'));var moment=require(_0x49da('0x3'));var BPromise=require(_0x49da('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x49da('0x5'));var rimraf=require('rimraf');var config=require(_0x49da('0x6'));var attributes=require(_0x49da('0x7'));module[_0x49da('0x8')]=function(_0x182b7f,_0x4e93df){return _0x182b7f[_0x49da('0x9')](_0x49da('0xa'),attributes,{'tableName':_0x49da('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x49da('0xc'),_0x49da('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 6795701..842de0e 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 _0x5df8=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5df8,0x15f));var _0x85df=function(_0x4038b3,_0x3696d7){_0x4038b3=_0x4038b3-0x0;var _0x4df483=_0x5df8[_0x4038b3];return _0x4df483;};'use strict';var _=require(_0x85df('0x0'));var util=require(_0x85df('0x1'));var moment=require(_0x85df('0x2'));var BPromise=require(_0x85df('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85df('0x4'));var db=require(_0x85df('0x5'))['db'];var utils=require(_0x85df('0x6'));var logger=require(_0x85df('0x7'))(_0x85df('0x8'));var config=require(_0x85df('0x9'));var jayson=require(_0x85df('0xa'));var client=jayson[_0x85df('0xb')][_0x85df('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x311661,_0xf31c82,_0x1d1849){return new BPromise(function(_0x58cb87,_0x28886c){return client[_0x85df('0xd')](_0x311661,_0x1d1849)['then'](function(_0x3b896d){logger[_0x85df('0xe')](_0x85df('0xf'),_0xf31c82,_0x85df('0x10'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0xf31c82,_0x85df('0x10'),JSON[_0x85df('0x11')](_0x3b896d));if(_0x3b896d[_0x85df('0x12')]){if(_0x3b896d['error'][_0x85df('0x13')]===0x1f4){logger[_0x85df('0x12')]('VoiceMail,\x20%s,\x20%s',_0xf31c82,_0x3b896d[_0x85df('0x12')][_0x85df('0x14')]);return _0x28886c(_0x3b896d['error']['message']);}logger['error']('VoiceMail,\x20%s,\x20%s',_0xf31c82,_0x3b896d[_0x85df('0x12')]['message']);return _0x58cb87(_0x3b896d['error'][_0x85df('0x14')]);}else{logger[_0x85df('0xe')](_0x85df('0xf'),_0xf31c82,'request\x20sent');_0x58cb87(_0x3b896d['result'][_0x85df('0x14')]);}})[_0x85df('0x15')](function(_0x5d724a){logger[_0x85df('0x12')](_0x85df('0xf'),_0xf31c82,_0x5d724a);_0x28886c(_0x5d724a);});});} \ No newline at end of file +var _0x6e0f=['request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','VoiceMail,\x20%s,\x20%s'];(function(_0x2341ab,_0x326a6c){var _0x54533e=function(_0x413273){while(--_0x413273){_0x2341ab['push'](_0x2341ab['shift']());}};_0x54533e(++_0x326a6c);}(_0x6e0f,0x93));var _0xf6e0=function(_0x7feb90,_0x28e700){_0x7feb90=_0x7feb90-0x0;var _0x3c5b33=_0x6e0f[_0x7feb90];return _0x3c5b33;};'use strict';var _=require(_0xf6e0('0x0'));var util=require(_0xf6e0('0x1'));var moment=require(_0xf6e0('0x2'));var BPromise=require('bluebird');var rs=require(_0xf6e0('0x3'));var fs=require('fs');var Redis=require(_0xf6e0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf6e0('0x5'));var logger=require(_0xf6e0('0x6'))(_0xf6e0('0x7'));var config=require(_0xf6e0('0x8'));var jayson=require(_0xf6e0('0x9'));var client=jayson[_0xf6e0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f71a9,_0x2a1ced,_0xff358b){return new BPromise(function(_0x44a3aa,_0x141a42){return client[_0xf6e0('0xb')](_0x3f71a9,_0xff358b)[_0xf6e0('0xc')](function(_0x58f463){logger['info'](_0xf6e0('0xd'),_0x2a1ced,_0xf6e0('0xe'));logger[_0xf6e0('0xf')](_0xf6e0('0x10'),_0x2a1ced,_0xf6e0('0xe'),JSON[_0xf6e0('0x11')](_0x58f463));if(_0x58f463[_0xf6e0('0x12')]){if(_0x58f463[_0xf6e0('0x12')]['code']===0x1f4){logger[_0xf6e0('0x12')](_0xf6e0('0xd'),_0x2a1ced,_0x58f463[_0xf6e0('0x12')][_0xf6e0('0x13')]);return _0x141a42(_0x58f463['error'][_0xf6e0('0x13')]);}logger[_0xf6e0('0x12')]('VoiceMail,\x20%s,\x20%s',_0x2a1ced,_0x58f463[_0xf6e0('0x12')]['message']);return _0x44a3aa(_0x58f463[_0xf6e0('0x12')]['message']);}else{logger[_0xf6e0('0x14')](_0xf6e0('0xd'),_0x2a1ced,_0xf6e0('0xe'));_0x44a3aa(_0x58f463[_0xf6e0('0x15')][_0xf6e0('0x13')]);}})[_0xf6e0('0x16')](function(_0xb2fd92){logger[_0xf6e0('0x12')]('VoiceMail,\x20%s,\x20%s',_0x2a1ced,_0xb2fd92);_0x141a42(_0xb2fd92);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index cbc6b3e..0e786dc 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 _0x1f3b=['/:id/download','download','create','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','/:id','show','get'];(function(_0x526f9b,_0x458c4e){var _0x468133=function(_0x504ce4){while(--_0x504ce4){_0x526f9b['push'](_0x526f9b['shift']());}};_0x468133(++_0x458c4e);}(_0x1f3b,0x146));var _0xb1f3=function(_0x52e2a8,_0x22d875){_0x52e2a8=_0x52e2a8-0x0;var _0x3d3fb0=_0x1f3b[_0x52e2a8];return _0x3d3fb0;};'use strict';var multer=require(_0xb1f3('0x0'));var util=require('util');var path=require(_0xb1f3('0x1'));var timeout=require(_0xb1f3('0x2'));var express=require(_0xb1f3('0x3'));var router=express[_0xb1f3('0x4')]();var fs_extra=require(_0xb1f3('0x5'));var auth=require(_0xb1f3('0x6'));var interaction=require(_0xb1f3('0x7'));var config=require(_0xb1f3('0x8'));var controller=require(_0xb1f3('0x9'));router['get']('/',auth[_0xb1f3('0xa')](),controller['index']);router['get'](_0xb1f3('0xb'),auth[_0xb1f3('0xa')](),controller[_0xb1f3('0xc')]);router[_0xb1f3('0xd')](_0xb1f3('0xe'),auth[_0xb1f3('0xa')](),controller[_0xb1f3('0xf')]);router['post']('/',auth[_0xb1f3('0xa')](),controller[_0xb1f3('0x10')]);router['put'](_0xb1f3('0xb'),auth[_0xb1f3('0xa')](),controller[_0xb1f3('0x11')]);router['delete'](_0xb1f3('0xb'),auth[_0xb1f3('0xa')](),controller[_0xb1f3('0x12')]);module[_0xb1f3('0x13')]=router; \ No newline at end of file +var _0x0fd0=['download','post','put','exports','express','Router','fs-extra','../../components/interaction/service','./voiceMailMessage.controller','isAuthenticated','index','get','/:id'];(function(_0xc971a4,_0x5b381c){var _0x4ebd6b=function(_0x371149){while(--_0x371149){_0xc971a4['push'](_0xc971a4['shift']());}};_0x4ebd6b(++_0x5b381c);}(_0x0fd0,0xe1));var _0x00fd=function(_0x4b6391,_0x125cdd){_0x4b6391=_0x4b6391-0x0;var _0x375d90=_0x0fd0[_0x4b6391];return _0x375d90;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x00fd('0x0'));var router=express[_0x00fd('0x1')]();var fs_extra=require(_0x00fd('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x00fd('0x3'));var config=require('../../config/environment');var controller=require(_0x00fd('0x4'));router['get']('/',auth[_0x00fd('0x5')](),controller[_0x00fd('0x6')]);router[_0x00fd('0x7')](_0x00fd('0x8'),auth[_0x00fd('0x5')](),controller['show']);router['get']('/:id/download',auth[_0x00fd('0x5')](),controller[_0x00fd('0x9')]);router[_0x00fd('0xa')]('/',auth[_0x00fd('0x5')](),controller['create']);router[_0x00fd('0xb')](_0x00fd('0x8'),auth[_0x00fd('0x5')](),controller['update']);router['delete'](_0x00fd('0x8'),auth[_0x00fd('0x5')](),controller['destroy']);module[_0x00fd('0xc')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 11aa85c..47b2335 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 _0x3fce=['sequelize','exports','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3fce,0x1cc));var _0xe3fc=function(_0x2b9d5c,_0x173518){_0x2b9d5c=_0x2b9d5c-0x0;var _0x37bb93=_0x3fce[_0x2b9d5c];return _0x37bb93;};'use strict';var Sequelize=require(_0xe3fc('0x0'));module[_0xe3fc('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5d61e0){return this[_0xe3fc('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xe3fc('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xe3fc('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xe3fc('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xe3fc('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xe3fc('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xe3fc('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xe3fc('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xe3fc('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xe3fc('0x5')](_0xe3fc('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xe3fc('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xe3fc('0x4')],'defaultValue':''},'stamp':{'type':_0xe3fc('0x7'),'defaultValue':Sequelize[_0xe3fc('0x8')](_0xe3fc('0x9'))}}; \ No newline at end of file +var _0xbb0d=['STRING','BLOB','TIMESTAMP','literal','sequelize','VIRTUAL','getDataValue','INTEGER'];(function(_0x104504,_0x443c9b){var _0x2f3e8f=function(_0x31c8ca){while(--_0x31c8ca){_0x104504['push'](_0x104504['shift']());}};_0x2f3e8f(++_0x443c9b);}(_0xbb0d,0x16c));var _0xdbb0=function(_0x5ca423,_0x22451e){_0x5ca423=_0x5ca423-0x0;var _0x25220d=_0xbb0d[_0x5ca423];return _0x25220d;};'use strict';var Sequelize=require(_0xdbb0('0x0'));module['exports']={'name':{'type':Sequelize[_0xdbb0('0x1')],'get':function(_0x2a9004){return this[_0xdbb0('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xdbb0('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xdbb0('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xdbb0('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xdbb0('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xdbb0('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xdbb0('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xdbb0('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xdbb0('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xdbb0('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xdbb0('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xdbb0('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xdbb0('0x4')],'defaultValue':''},'stamp':{'type':_0xdbb0('0x6'),'defaultValue':Sequelize[_0xdbb0('0x7')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 9e9626c..2c4fe47 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 _0x6089=['name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','rows','catch','show','params','keys','includeAll','find','create','body','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then'];(function(_0x26b4fd,_0x132c60){var _0x3cbd38=function(_0x2952c4){while(--_0x2952c4){_0x26b4fd['push'](_0x26b4fd['shift']());}};_0x3cbd38(++_0x132c60);}(_0x6089,0xd2));var _0x9608=function(_0x1d4269,_0x1f560b){_0x1d4269=_0x1d4269-0x0;var _0x412a58=_0x6089[_0x1d4269];return _0x412a58;};'use strict';var emlformat=require(_0x9608('0x0'));var rimraf=require(_0x9608('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9608('0x2'));var rp=require(_0x9608('0x3'));var moment=require(_0x9608('0x4'));var BPromise=require(_0x9608('0x5'));var Mustache=require('mustache');var util=require(_0x9608('0x6'));var path=require(_0x9608('0x7'));var sox=require(_0x9608('0x8'));var csv=require(_0x9608('0x9'));var ejs=require(_0x9608('0xa'));var fs=require('fs');var fs_extra=require(_0x9608('0xb'));var _=require('lodash');var squel=require(_0x9608('0xc'));var crypto=require(_0x9608('0xd'));var jsforce=require(_0x9608('0xe'));var deskjs=require(_0x9608('0xf'));var toCsv=require(_0x9608('0x9'));var querystring=require('querystring');var Papa=require(_0x9608('0x10'));var Redis=require(_0x9608('0x11'));var authService=require(_0x9608('0x12'));var qs=require(_0x9608('0x13'));var as=require(_0x9608('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9608('0x15'));var utils=require(_0x9608('0x16'));var config=require(_0x9608('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9608('0x18'))['db'];function respondWithStatusCode(_0x39fee0,_0x2400f0){_0x2400f0=_0x2400f0||0xcc;return function(_0x3abd69){if(_0x3abd69){return _0x39fee0[_0x9608('0x19')](_0x2400f0);}return _0x39fee0['status'](_0x2400f0)[_0x9608('0x1a')]();};}function respondWithResult(_0x4db591,_0x4adbe0){_0x4adbe0=_0x4adbe0||0xc8;return function(_0x3f197d){if(_0x3f197d){return _0x4db591[_0x9608('0x1b')](_0x4adbe0)[_0x9608('0x1c')](_0x3f197d);}};}function respondWithFilteredResult(_0x5573ec,_0xd9999){return function(_0xae5a9e){if(_0xae5a9e){var _0x476d3a=typeof _0xd9999[_0x9608('0x1d')]===_0x9608('0x1e')&&typeof _0xd9999['limit']==='undefined';var _0x5283a1=_0xae5a9e[_0x9608('0x1f')];var _0xb6c49f=_0x476d3a?0x0:_0xd9999[_0x9608('0x1d')];var _0x5e1458=_0x476d3a?_0xae5a9e[_0x9608('0x1f')]:_0xd9999['offset']+_0xd9999[_0x9608('0x20')];var _0x25c278;if(_0x5e1458>=_0x5283a1){_0x5e1458=_0x5283a1;_0x25c278=0xc8;}else{_0x25c278=0xce;}_0x5573ec['status'](_0x25c278);return _0x5573ec[_0x9608('0x21')](_0x9608('0x22'),_0xb6c49f+'-'+_0x5e1458+'/'+_0x5283a1)['json'](_0xae5a9e);}return null;};}function patchUpdates(_0xec187a){return function(_0x459a72){try{jsonpatch[_0x9608('0x23')](_0x459a72,_0xec187a,!![]);}catch(_0x2d4d84){return BPromise['reject'](_0x2d4d84);}return _0x459a72[_0x9608('0x24')]();};}function saveUpdates(_0x5dade6,_0x35dd2a){return function(_0xeeb1f3){if(_0xeeb1f3){return _0xeeb1f3[_0x9608('0x25')](_0x5dade6)['then'](function(_0x506b91){return _0x506b91;});}return null;};}function removeEntity(_0x1ca5dc,_0x6fa549){return function(_0x1b434b){if(_0x1b434b){return _0x1b434b['destroy']()[_0x9608('0x26')](function(){_0x1ca5dc[_0x9608('0x1b')](0xcc)[_0x9608('0x1a')]();});}};}function handleEntityNotFound(_0x377317,_0x5663e2){return function(_0x308041){if(!_0x308041){_0x377317[_0x9608('0x19')](0x194);}return _0x308041;};}function handleError(_0x4eba60,_0x2d68ec){_0x2d68ec=_0x2d68ec||0x1f4;return function(_0x260dbe){logger['error'](_0x260dbe['stack']);if(_0x260dbe[_0x9608('0x27')]){delete _0x260dbe[_0x9608('0x27')];}_0x4eba60['status'](_0x2d68ec)[_0x9608('0x28')](_0x260dbe);};}exports[_0x9608('0x29')]=function(_0x2ac8d6,_0x584926){var _0x1fe705={},_0x4cf03c={},_0x7cd1e9={'count':0x0,'rows':[]};var _0x2976ec=_[_0x9608('0x2a')](db[_0x9608('0x2b')][_0x9608('0x2c')],function(_0x2e82cc){return{'name':_0x2e82cc[_0x9608('0x2d')],'type':_0x2e82cc[_0x9608('0x2e')][_0x9608('0x2f')]};});_0x4cf03c[_0x9608('0x30')]=_[_0x9608('0x31')](_[_0x9608('0x2a')](_0x2976ec,_0x9608('0x27')),['name']);_0x4cf03c['query']=_['keys'](_0x2ac8d6['query']);_0x4cf03c[_0x9608('0x32')]=_[_0x9608('0x33')](_0x4cf03c['model'],_0x4cf03c[_0x9608('0x34')]);_0x1fe705['attributes']=_['intersection'](_0x4cf03c[_0x9608('0x30')],qs[_0x9608('0x35')](_0x2ac8d6[_0x9608('0x34')][_0x9608('0x35')]));_0x1fe705[_0x9608('0x36')]=_0x1fe705[_0x9608('0x36')]['length']?_0x1fe705[_0x9608('0x36')]:_0x4cf03c[_0x9608('0x30')];if(!_0x2ac8d6[_0x9608('0x34')][_0x9608('0x37')](_0x9608('0x38'))){_0x1fe705[_0x9608('0x20')]=qs[_0x9608('0x20')](_0x2ac8d6['query'][_0x9608('0x20')]);_0x1fe705[_0x9608('0x1d')]=qs['offset'](_0x2ac8d6[_0x9608('0x34')]['offset']);}_0x1fe705[_0x9608('0x39')]=qs[_0x9608('0x3a')](_0x2ac8d6[_0x9608('0x34')]['sort']);_0x1fe705['where']=qs[_0x9608('0x32')](_[_0x9608('0x3b')](_0x2ac8d6[_0x9608('0x34')],_0x4cf03c['filters']),_0x2976ec);if(_0x2ac8d6[_0x9608('0x34')][_0x9608('0x3c')]){_0x1fe705[_0x9608('0x3d')]=_[_0x9608('0x3e')](_0x1fe705[_0x9608('0x3d')],{'$or':_['map'](_0x2976ec,function(_0x3d3fc5){if(_0x3d3fc5['type']!=='VIRTUAL'){var _0x27b502={};_0x27b502[_0x3d3fc5[_0x9608('0x27')]]={'$like':'%'+_0x2ac8d6[_0x9608('0x34')][_0x9608('0x3c')]+'%'};return _0x27b502;}})});}_0x1fe705=_[_0x9608('0x3e')]({},_0x1fe705,_0x2ac8d6[_0x9608('0x3f')]);var _0x710a9={'where':_0x1fe705['where']};return db[_0x9608('0x2b')]['count'](_0x710a9)[_0x9608('0x26')](function(_0x4cca30){_0x7cd1e9['count']=_0x4cca30;if(_0x2ac8d6['query']['includeAll']){_0x1fe705[_0x9608('0x40')]=[{'all':!![]}];}return db[_0x9608('0x2b')]['findAll'](_0x1fe705);})[_0x9608('0x26')](function(_0x159cae){_0x7cd1e9[_0x9608('0x41')]=_0x159cae;return _0x7cd1e9;})['then'](respondWithFilteredResult(_0x584926,_0x1fe705))[_0x9608('0x42')](handleError(_0x584926,null));};exports[_0x9608('0x43')]=function(_0x337ea6,_0x3173be){var _0x4b03f5={'raw':!![],'where':{'id':_0x337ea6[_0x9608('0x44')]['id']}},_0x5716ba={};_0x5716ba[_0x9608('0x30')]=_[_0x9608('0x45')](db[_0x9608('0x2b')]['rawAttributes']);_0x5716ba[_0x9608('0x34')]=_['keys'](_0x337ea6['query']);_0x5716ba[_0x9608('0x32')]=_['intersection'](_0x5716ba[_0x9608('0x30')],_0x5716ba['query']);_0x4b03f5[_0x9608('0x36')]=_[_0x9608('0x33')](_0x5716ba[_0x9608('0x30')],qs[_0x9608('0x35')](_0x337ea6[_0x9608('0x34')][_0x9608('0x35')]));_0x4b03f5[_0x9608('0x36')]=_0x4b03f5[_0x9608('0x36')]['length']?_0x4b03f5['attributes']:_0x5716ba[_0x9608('0x30')];if(_0x337ea6[_0x9608('0x34')][_0x9608('0x46')]){_0x4b03f5[_0x9608('0x40')]=[{'all':!![]}];}_0x4b03f5=_['merge']({},_0x4b03f5,_0x337ea6[_0x9608('0x3f')]);return db[_0x9608('0x2b')][_0x9608('0x47')](_0x4b03f5)[_0x9608('0x26')](handleEntityNotFound(_0x3173be,null))['then'](respondWithResult(_0x3173be,null))[_0x9608('0x42')](handleError(_0x3173be,null));};exports['create']=function(_0x51d414,_0x20d26d){return db['VoiceMailMessage'][_0x9608('0x48')](_0x51d414[_0x9608('0x49')],{})[_0x9608('0x26')](respondWithResult(_0x20d26d,0xc9))['catch'](handleError(_0x20d26d,null));};exports['update']=function(_0x1df3d5,_0x3e43b8){if(_0x1df3d5[_0x9608('0x49')]['id']){delete _0x1df3d5[_0x9608('0x49')]['id'];}return db[_0x9608('0x2b')][_0x9608('0x47')]({'where':{'id':_0x1df3d5['params']['id']}})[_0x9608('0x26')](handleEntityNotFound(_0x3e43b8,null))['then'](saveUpdates(_0x1df3d5['body'],null))['then'](respondWithResult(_0x3e43b8,null))[_0x9608('0x42')](handleError(_0x3e43b8,null));};exports['destroy']=function(_0x34d65e,_0x2b0d26){return db[_0x9608('0x2b')][_0x9608('0x47')]({'where':{'id':_0x34d65e['params']['id']}})[_0x9608('0x26')](handleEntityNotFound(_0x2b0d26,null))[_0x9608('0x26')](removeEntity(_0x2b0d26,null))[_0x9608('0x42')](handleError(_0x2b0d26,null));};exports['download']=function(_0x49526a,_0x3d8e2d,_0x226e13){return db[_0x9608('0x2b')]['find']({'where':{'id':_0x49526a[_0x9608('0x44')]['id']},'attributes':['id',_0x9608('0x4a'),'msg_id']})[_0x9608('0x26')](handleEntityNotFound(_0x3d8e2d,null))[_0x9608('0x26')](function(_0x38db80){if(_0x38db80){if(!_0x38db80[_0x9608('0x4a')]){throw new db[(_0x9608('0x4b'))][(_0x9608('0x4c'))](_0x9608('0x4d'));}var _0x3fd926={'Content-Type':_0x9608('0x4e'),'Content-Disposition':'attachment'};if(_0x38db80[_0x9608('0x4f')]){_0x3fd926[_0x9608('0x50')]=_0x9608('0x51')+_0x38db80['msg_id']+_0x9608('0x52');}_0x3d8e2d[_0x9608('0x21')](_0x3fd926);return _0x3d8e2d[_0x9608('0x28')](new Buffer(_0x38db80[_0x9608('0x4a')]));}})[_0x9608('0x42')](handleError(_0x3d8e2d,null));}; \ No newline at end of file +var _0x7f76=['fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','download','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','recording','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceMailMessage'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x7f76,0x84));var _0x67f7=function(_0x3b4626,_0x14d17b){_0x3b4626=_0x3b4626-0x0;var _0x404a2e=_0x7f76[_0x3b4626];return _0x404a2e;};'use strict';var emlformat=require(_0x67f7('0x0'));var rimraf=require(_0x67f7('0x1'));var zipdir=require(_0x67f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x67f7('0x3'));var moment=require(_0x67f7('0x4'));var BPromise=require(_0x67f7('0x5'));var Mustache=require(_0x67f7('0x6'));var util=require('util');var path=require(_0x67f7('0x7'));var sox=require(_0x67f7('0x8'));var csv=require('to-csv');var ejs=require(_0x67f7('0x9'));var fs=require('fs');var fs_extra=require(_0x67f7('0xa'));var _=require(_0x67f7('0xb'));var squel=require(_0x67f7('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x67f7('0xd'));var toCsv=require(_0x67f7('0xe'));var querystring=require(_0x67f7('0xf'));var Papa=require(_0x67f7('0x10'));var Redis=require(_0x67f7('0x11'));var authService=require(_0x67f7('0x12'));var qs=require(_0x67f7('0x13'));var as=require(_0x67f7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x67f7('0x15'))('api');var utils=require(_0x67f7('0x16'));var config=require(_0x67f7('0x17'));var licenseUtil=require(_0x67f7('0x18'));var db=require(_0x67f7('0x19'))['db'];function respondWithStatusCode(_0x344439,_0x52c40c){_0x52c40c=_0x52c40c||0xcc;return function(_0x149edb){if(_0x149edb){return _0x344439[_0x67f7('0x1a')](_0x52c40c);}return _0x344439[_0x67f7('0x1b')](_0x52c40c)[_0x67f7('0x1c')]();};}function respondWithResult(_0x3db444,_0xf4e182){_0xf4e182=_0xf4e182||0xc8;return function(_0x3e3df4){if(_0x3e3df4){return _0x3db444['status'](_0xf4e182)[_0x67f7('0x1d')](_0x3e3df4);}};}function respondWithFilteredResult(_0x3bc09f,_0x12ff0a){return function(_0x2909cc){if(_0x2909cc){var _0x5d9e24=typeof _0x12ff0a[_0x67f7('0x1e')]==='undefined'&&typeof _0x12ff0a['limit']===_0x67f7('0x1f');var _0x3b25b3=_0x2909cc['count'];var _0x2ff723=_0x5d9e24?0x0:_0x12ff0a[_0x67f7('0x1e')];var _0x3a7145=_0x5d9e24?_0x2909cc[_0x67f7('0x20')]:_0x12ff0a[_0x67f7('0x1e')]+_0x12ff0a[_0x67f7('0x21')];var _0x24d89c;if(_0x3a7145>=_0x3b25b3){_0x3a7145=_0x3b25b3;_0x24d89c=0xc8;}else{_0x24d89c=0xce;}_0x3bc09f[_0x67f7('0x1b')](_0x24d89c);return _0x3bc09f['set'](_0x67f7('0x22'),_0x2ff723+'-'+_0x3a7145+'/'+_0x3b25b3)[_0x67f7('0x1d')](_0x2909cc);}return null;};}function patchUpdates(_0x485661){return function(_0x153d84){try{jsonpatch[_0x67f7('0x23')](_0x153d84,_0x485661,!![]);}catch(_0x570607){return BPromise[_0x67f7('0x24')](_0x570607);}return _0x153d84[_0x67f7('0x25')]();};}function saveUpdates(_0x29a7bb,_0x2cacb9){return function(_0x395d05){if(_0x395d05){return _0x395d05[_0x67f7('0x26')](_0x29a7bb)[_0x67f7('0x27')](function(_0x15724d){return _0x15724d;});}return null;};}function removeEntity(_0x1f7203,_0x174e9b){return function(_0x5892aa){if(_0x5892aa){return _0x5892aa[_0x67f7('0x28')]()[_0x67f7('0x27')](function(){_0x1f7203[_0x67f7('0x1b')](0xcc)[_0x67f7('0x1c')]();});}};}function handleEntityNotFound(_0x18617d,_0x624575){return function(_0x24c7fb){if(!_0x24c7fb){_0x18617d[_0x67f7('0x1a')](0x194);}return _0x24c7fb;};}function handleError(_0x4e466e,_0x11b0df){_0x11b0df=_0x11b0df||0x1f4;return function(_0x14d2c9){logger[_0x67f7('0x29')](_0x14d2c9[_0x67f7('0x2a')]);if(_0x14d2c9[_0x67f7('0x2b')]){delete _0x14d2c9[_0x67f7('0x2b')];}_0x4e466e[_0x67f7('0x1b')](_0x11b0df)[_0x67f7('0x2c')](_0x14d2c9);};}exports[_0x67f7('0x2d')]=function(_0x57de40,_0x449893){var _0x365bd4={},_0x2a2d18={},_0x1c80b5={'count':0x0,'rows':[]};var _0x43ef6d=_[_0x67f7('0x2e')](db[_0x67f7('0x2f')]['rawAttributes'],function(_0x5b4e40){return{'name':_0x5b4e40[_0x67f7('0x30')],'type':_0x5b4e40[_0x67f7('0x31')][_0x67f7('0x32')]};});_0x2a2d18[_0x67f7('0x33')]=_[_0x67f7('0x34')](_[_0x67f7('0x2e')](_0x43ef6d,_0x67f7('0x2b')),[_0x67f7('0x2b')]);_0x2a2d18[_0x67f7('0x35')]=_[_0x67f7('0x36')](_0x57de40['query']);_0x2a2d18[_0x67f7('0x37')]=_[_0x67f7('0x38')](_0x2a2d18['model'],_0x2a2d18[_0x67f7('0x35')]);_0x365bd4[_0x67f7('0x39')]=_[_0x67f7('0x38')](_0x2a2d18[_0x67f7('0x33')],qs['fields'](_0x57de40[_0x67f7('0x35')][_0x67f7('0x3a')]));_0x365bd4[_0x67f7('0x39')]=_0x365bd4[_0x67f7('0x39')][_0x67f7('0x3b')]?_0x365bd4['attributes']:_0x2a2d18[_0x67f7('0x33')];if(!_0x57de40['query'][_0x67f7('0x3c')]('nolimit')){_0x365bd4[_0x67f7('0x21')]=qs['limit'](_0x57de40[_0x67f7('0x35')][_0x67f7('0x21')]);_0x365bd4['offset']=qs['offset'](_0x57de40[_0x67f7('0x35')][_0x67f7('0x1e')]);}_0x365bd4[_0x67f7('0x3d')]=qs[_0x67f7('0x3e')](_0x57de40[_0x67f7('0x35')]['sort']);_0x365bd4[_0x67f7('0x3f')]=qs[_0x67f7('0x37')](_['pick'](_0x57de40[_0x67f7('0x35')],_0x2a2d18[_0x67f7('0x37')]),_0x43ef6d);if(_0x57de40[_0x67f7('0x35')][_0x67f7('0x40')]){_0x365bd4['where']=_[_0x67f7('0x41')](_0x365bd4['where'],{'$or':_[_0x67f7('0x2e')](_0x43ef6d,function(_0xf4555c){if(_0xf4555c[_0x67f7('0x31')]!==_0x67f7('0x42')){var _0x5909e8={};_0x5909e8[_0xf4555c['name']]={'$like':'%'+_0x57de40[_0x67f7('0x35')][_0x67f7('0x40')]+'%'};return _0x5909e8;}})});}_0x365bd4=_[_0x67f7('0x41')]({},_0x365bd4,_0x57de40[_0x67f7('0x43')]);var _0x3a1625={'where':_0x365bd4[_0x67f7('0x3f')]};return db[_0x67f7('0x2f')]['count'](_0x3a1625)[_0x67f7('0x27')](function(_0x587af0){_0x1c80b5[_0x67f7('0x20')]=_0x587af0;if(_0x57de40[_0x67f7('0x35')][_0x67f7('0x44')]){_0x365bd4[_0x67f7('0x45')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x67f7('0x46')](_0x365bd4);})['then'](function(_0x41c94c){_0x1c80b5[_0x67f7('0x47')]=_0x41c94c;return _0x1c80b5;})[_0x67f7('0x27')](respondWithFilteredResult(_0x449893,_0x365bd4))[_0x67f7('0x48')](handleError(_0x449893,null));};exports[_0x67f7('0x49')]=function(_0x49726e,_0x1515a1){var _0x138116={'raw':!![],'where':{'id':_0x49726e[_0x67f7('0x4a')]['id']}},_0x231b19={};_0x231b19['model']=_[_0x67f7('0x36')](db[_0x67f7('0x2f')]['rawAttributes']);_0x231b19[_0x67f7('0x35')]=_['keys'](_0x49726e[_0x67f7('0x35')]);_0x231b19['filters']=_[_0x67f7('0x38')](_0x231b19['model'],_0x231b19[_0x67f7('0x35')]);_0x138116[_0x67f7('0x39')]=_[_0x67f7('0x38')](_0x231b19[_0x67f7('0x33')],qs[_0x67f7('0x3a')](_0x49726e[_0x67f7('0x35')][_0x67f7('0x3a')]));_0x138116[_0x67f7('0x39')]=_0x138116[_0x67f7('0x39')][_0x67f7('0x3b')]?_0x138116[_0x67f7('0x39')]:_0x231b19[_0x67f7('0x33')];if(_0x49726e[_0x67f7('0x35')][_0x67f7('0x44')]){_0x138116[_0x67f7('0x45')]=[{'all':!![]}];}_0x138116=_[_0x67f7('0x41')]({},_0x138116,_0x49726e['options']);return db[_0x67f7('0x2f')][_0x67f7('0x4b')](_0x138116)['then'](handleEntityNotFound(_0x1515a1,null))[_0x67f7('0x27')](respondWithResult(_0x1515a1,null))[_0x67f7('0x48')](handleError(_0x1515a1,null));};exports['create']=function(_0x126939,_0x57aeeb){return db[_0x67f7('0x2f')][_0x67f7('0x4c')](_0x126939[_0x67f7('0x4d')],{})[_0x67f7('0x27')](respondWithResult(_0x57aeeb,0xc9))[_0x67f7('0x48')](handleError(_0x57aeeb,null));};exports[_0x67f7('0x26')]=function(_0x17e49a,_0x121d5c){if(_0x17e49a['body']['id']){delete _0x17e49a[_0x67f7('0x4d')]['id'];}return db[_0x67f7('0x2f')][_0x67f7('0x4b')]({'where':{'id':_0x17e49a[_0x67f7('0x4a')]['id']}})[_0x67f7('0x27')](handleEntityNotFound(_0x121d5c,null))['then'](saveUpdates(_0x17e49a[_0x67f7('0x4d')],null))['then'](respondWithResult(_0x121d5c,null))[_0x67f7('0x48')](handleError(_0x121d5c,null));};exports[_0x67f7('0x28')]=function(_0x21d5e4,_0x4ff43b){return db[_0x67f7('0x2f')]['find']({'where':{'id':_0x21d5e4[_0x67f7('0x4a')]['id']}})[_0x67f7('0x27')](handleEntityNotFound(_0x4ff43b,null))[_0x67f7('0x27')](removeEntity(_0x4ff43b,null))[_0x67f7('0x48')](handleError(_0x4ff43b,null));};exports[_0x67f7('0x4e')]=function(_0x365e88,_0x4fad7e,_0x484732){return db[_0x67f7('0x2f')]['find']({'where':{'id':_0x365e88['params']['id']},'attributes':['id','recording','msg_id']})['then'](handleEntityNotFound(_0x4fad7e,null))['then'](function(_0x307ec0){if(_0x307ec0){if(!_0x307ec0['recording']){throw new db[(_0x67f7('0x4f'))][(_0x67f7('0x50'))](_0x67f7('0x51'));}var _0x534325={'Content-Type':_0x67f7('0x52'),'Content-Disposition':_0x67f7('0x53')};if(_0x307ec0[_0x67f7('0x54')]){_0x534325[_0x67f7('0x55')]=_0x67f7('0x56')+_0x307ec0[_0x67f7('0x54')]+_0x67f7('0x57');}_0x4fad7e[_0x67f7('0x58')](_0x534325);return _0x4fad7e[_0x67f7('0x2c')](new Buffer(_0x307ec0[_0x67f7('0x59')]));}})[_0x67f7('0x48')](handleError(_0x4fad7e,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index f4e0d92..4a23a86 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 _0x92c6=['voice_voicemail_messages','dir','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage'];(function(_0x2140ae,_0x276645){var _0x33ccc7=function(_0xedb37c){while(--_0xedb37c){_0x2140ae['push'](_0x2140ae['shift']());}};_0x33ccc7(++_0x276645);}(_0x92c6,0xe2));var _0x692c=function(_0x75e717,_0x458bd0){_0x75e717=_0x75e717-0x0;var _0x162c70=_0x92c6[_0x75e717];return _0x162c70;};'use strict';var _=require(_0x692c('0x0'));var util=require(_0x692c('0x1'));var logger=require(_0x692c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x692c('0x3'));var rp=require(_0x692c('0x4'));var fs=require('fs');var path=require(_0x692c('0x5'));var rimraf=require(_0x692c('0x6'));var config=require(_0x692c('0x7'));var attributes=require(_0x692c('0x8'));module[_0x692c('0x9')]=function(_0x3cf61a,_0x149bce){return _0x3cf61a[_0x692c('0xa')](_0x692c('0xb'),attributes,{'tableName':_0x692c('0xc'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x692c('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd820=['dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage'];(function(_0x1e9f16,_0x5c6259){var _0x2335a6=function(_0x2de7f){while(--_0x2de7f){_0x1e9f16['push'](_0x1e9f16['shift']());}};_0x2335a6(++_0x5c6259);}(_0xd820,0x71));var _0x0d82=function(_0xc43657,_0x17b2d8){_0xc43657=_0xc43657-0x0;var _0x6eca29=_0xd820[_0xc43657];return _0x6eca29;};'use strict';var _=require(_0x0d82('0x0'));var util=require(_0x0d82('0x1'));var logger=require(_0x0d82('0x2'))(_0x0d82('0x3'));var moment=require(_0x0d82('0x4'));var BPromise=require(_0x0d82('0x5'));var rp=require(_0x0d82('0x6'));var fs=require('fs');var path=require(_0x0d82('0x7'));var rimraf=require(_0x0d82('0x8'));var config=require(_0x0d82('0x9'));var attributes=require(_0x0d82('0xa'));module[_0x0d82('0xb')]=function(_0x48fd35,_0x355e1f){return _0x48fd35['define'](_0x0d82('0xc'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x0d82('0xd'),'fields':[_0x0d82('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 0122b6e..d5aa035 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 _0x4c94=['catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result'];(function(_0x118535,_0x1b9a59){var _0x5c1bfd=function(_0x458d89){while(--_0x458d89){_0x118535['push'](_0x118535['shift']());}};_0x5c1bfd(++_0x1b9a59);}(_0x4c94,0x1e4));var _0x44c9=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x4c94[_0x5a79e2];return _0x266c45;};'use strict';var _=require(_0x44c9('0x0'));var util=require(_0x44c9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44c9('0x2'));var fs=require('fs');var Redis=require(_0x44c9('0x3'));var db=require(_0x44c9('0x4'))['db'];var utils=require(_0x44c9('0x5'));var logger=require('../../config/logger')(_0x44c9('0x6'));var config=require(_0x44c9('0x7'));var jayson=require(_0x44c9('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e2de3,_0x5ac31d,_0x15da21){return new BPromise(function(_0x551ad2,_0x2b6679){return client[_0x44c9('0x9')](_0x5e2de3,_0x15da21)[_0x44c9('0xa')](function(_0x21260d){logger[_0x44c9('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0x5ac31d,_0x44c9('0xc'));logger[_0x44c9('0xd')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x5ac31d,_0x44c9('0xc'),JSON[_0x44c9('0xe')](_0x21260d));if(_0x21260d[_0x44c9('0xf')]){if(_0x21260d['error'][_0x44c9('0x10')]===0x1f4){logger[_0x44c9('0xf')](_0x44c9('0x11'),_0x5ac31d,_0x21260d[_0x44c9('0xf')][_0x44c9('0x12')]);return _0x2b6679(_0x21260d[_0x44c9('0xf')][_0x44c9('0x12')]);}logger[_0x44c9('0xf')](_0x44c9('0x11'),_0x5ac31d,_0x21260d[_0x44c9('0xf')][_0x44c9('0x12')]);return _0x551ad2(_0x21260d[_0x44c9('0xf')]['message']);}else{logger[_0x44c9('0xb')](_0x44c9('0x11'),_0x5ac31d,'request\x20sent');_0x551ad2(_0x21260d[_0x44c9('0x13')][_0x44c9('0x12')]);}})[_0x44c9('0x14')](function(_0x448224){logger[_0x44c9('0xf')](_0x44c9('0x11'),_0x5ac31d,_0x448224);_0x2b6679(_0x448224);});});} \ No newline at end of file +var _0xe8c1=['info','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0xe8c1,0x187));var _0x1e8c=function(_0x30182f,_0x30ce41){_0x30182f=_0x30182f-0x0;var _0x5207db=_0xe8c1[_0x30182f];return _0x5207db;};'use strict';var _=require(_0x1e8c('0x0'));var util=require(_0x1e8c('0x1'));var moment=require('moment');var BPromise=require(_0x1e8c('0x2'));var rs=require(_0x1e8c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e8c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1e8c('0x5'));var config=require(_0x1e8c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1e8c('0x7')][_0x1e8c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c8dfe,_0x2eb099,_0x36984c){return new BPromise(function(_0x10959,_0x56c033){return client['request'](_0x2c8dfe,_0x36984c)['then'](function(_0x25fc83){logger[_0x1e8c('0x9')]('VoiceMailMessage,\x20%s,\x20%s',_0x2eb099,'request\x20sent');logger[_0x1e8c('0xa')](_0x1e8c('0xb'),_0x2eb099,_0x1e8c('0xc'),JSON[_0x1e8c('0xd')](_0x25fc83));if(_0x25fc83[_0x1e8c('0xe')]){if(_0x25fc83[_0x1e8c('0xe')][_0x1e8c('0xf')]===0x1f4){logger['error'](_0x1e8c('0x10'),_0x2eb099,_0x25fc83[_0x1e8c('0xe')][_0x1e8c('0x11')]);return _0x56c033(_0x25fc83[_0x1e8c('0xe')]['message']);}logger[_0x1e8c('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x2eb099,_0x25fc83[_0x1e8c('0xe')]['message']);return _0x10959(_0x25fc83[_0x1e8c('0xe')][_0x1e8c('0x11')]);}else{logger[_0x1e8c('0x9')]('VoiceMailMessage,\x20%s,\x20%s',_0x2eb099,'request\x20sent');_0x10959(_0x25fc83[_0x1e8c('0x12')][_0x1e8c('0x11')]);}})[_0x1e8c('0x13')](function(_0x1c5374){logger[_0x1e8c('0xe')](_0x1e8c('0x10'),_0x2eb099,_0x1c5374);_0x56c033(_0x1c5374);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 7669bd1..e4a5062 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 _0xeccb=['/:id/sounds','post','create','put','/:id','update','destroy','/:id/sounds/:id2','removeSound','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','show'];(function(_0x226190,_0x95f7b1){var _0x253fe7=function(_0x5c3a90){while(--_0x5c3a90){_0x226190['push'](_0x226190['shift']());}};_0x253fe7(++_0x95f7b1);}(_0xeccb,0xab));var _0xbecc=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xeccb[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbecc('0x0'));var timeout=require(_0xbecc('0x1'));var express=require(_0xbecc('0x2'));var router=express[_0xbecc('0x3')]();var fs_extra=require(_0xbecc('0x4'));var auth=require(_0xbecc('0x5'));var interaction=require(_0xbecc('0x6'));var config=require(_0xbecc('0x7'));var controller=require(_0xbecc('0x8'));router['get']('/',auth[_0xbecc('0x9')](),controller[_0xbecc('0xa')]);router[_0xbecc('0xb')]('/:id',auth[_0xbecc('0x9')](),controller[_0xbecc('0xc')]);router[_0xbecc('0xb')](_0xbecc('0xd'),auth[_0xbecc('0x9')](),controller['getSounds']);router[_0xbecc('0xe')]('/',auth['isAuthenticated'](),controller[_0xbecc('0xf')]);router['post']('/:id/sounds',auth['isAuthenticated'](),controller['addSound']);router[_0xbecc('0x10')](_0xbecc('0x11'),auth[_0xbecc('0x9')](),controller[_0xbecc('0x12')]);router['delete'](_0xbecc('0x11'),auth[_0xbecc('0x9')](),controller[_0xbecc('0x13')]);router['delete'](_0xbecc('0x14'),auth['isAuthenticated'](),controller[_0xbecc('0x15')]);module[_0xbecc('0x16')]=router; \ No newline at end of file +var _0x6925=['get','isAuthenticated','/:id/sounds','getSounds','create','post','addSound','put','/:id','update','/:id/sounds/:id2','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller'];(function(_0x1added,_0x3782c7){var _0x2ba01d=function(_0x112bb9){while(--_0x112bb9){_0x1added['push'](_0x1added['shift']());}};_0x2ba01d(++_0x3782c7);}(_0x6925,0x19b));var _0x5692=function(_0x2ad3e6,_0x123f2f){_0x2ad3e6=_0x2ad3e6-0x0;var _0xf2f5e5=_0x6925[_0x2ad3e6];return _0xf2f5e5;};'use strict';var multer=require(_0x5692('0x0'));var util=require(_0x5692('0x1'));var path=require(_0x5692('0x2'));var timeout=require('connect-timeout');var express=require(_0x5692('0x3'));var router=express[_0x5692('0x4')]();var fs_extra=require(_0x5692('0x5'));var auth=require(_0x5692('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5692('0x7'));var controller=require(_0x5692('0x8'));router[_0x5692('0x9')]('/',auth[_0x5692('0xa')](),controller['index']);router[_0x5692('0x9')]('/:id',auth[_0x5692('0xa')](),controller['show']);router[_0x5692('0x9')](_0x5692('0xb'),auth['isAuthenticated'](),controller[_0x5692('0xc')]);router['post']('/',auth[_0x5692('0xa')](),controller[_0x5692('0xd')]);router[_0x5692('0xe')](_0x5692('0xb'),auth[_0x5692('0xa')](),controller[_0x5692('0xf')]);router[_0x5692('0x10')](_0x5692('0x11'),auth['isAuthenticated'](),controller[_0x5692('0x12')]);router['delete']('/:id',auth[_0x5692('0xa')](),controller['destroy']);router['delete'](_0x5692('0x13'),auth[_0x5692('0xa')](),controller['removeSound']);module[_0x5692('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 1f8e789..d10beaa 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 _0x3b94=['sequelize','exports','STRING','name','ENUM','custom','mp3nb','files','TIMESTAMP','BOOLEAN'];(function(_0x208ec9,_0x2ecf52){var _0x489740=function(_0x1909fd){while(--_0x1909fd){_0x208ec9['push'](_0x208ec9['shift']());}};_0x489740(++_0x2ecf52);}(_0x3b94,0x154));var _0x43b9=function(_0x561a55,_0x1fb793){_0x561a55=_0x561a55-0x0;var _0x17b9b9=_0x3b94[_0x561a55];return _0x17b9b9;};'use strict';var Sequelize=require(_0x43b9('0x0'));module[_0x43b9('0x1')]={'name':{'type':Sequelize[_0x43b9('0x2')],'allowNull':![],'unique':_0x43b9('0x3')},'mode':{'type':Sequelize[_0x43b9('0x4')](_0x43b9('0x5'),'files',_0x43b9('0x6'),'quietmp3nb','quietmp3','mp3'),'allowNull':!![],'defaultValue':_0x43b9('0x7')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x43b9('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x43b9('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x43b9('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x43b9('0x8')},'defaultEntry':{'type':Sequelize[_0x43b9('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5461=['name','mp3nb','quietmp3nb','quietmp3','mp3','alpha','BOOLEAN','sequelize','exports','STRING'];(function(_0x200aa5,_0x197802){var _0x458200=function(_0x594959){while(--_0x594959){_0x200aa5['push'](_0x200aa5['shift']());}};_0x458200(++_0x197802);}(_0x5461,0x1bf));var _0x1546=function(_0x25a42a,_0x3d489b){_0x25a42a=_0x25a42a-0x0;var _0x1129b1=_0x5461[_0x25a42a];return _0x1129b1;};'use strict';var Sequelize=require(_0x1546('0x0'));module[_0x1546('0x1')]={'name':{'type':Sequelize[_0x1546('0x2')],'allowNull':![],'unique':_0x1546('0x3')},'mode':{'type':Sequelize['ENUM']('custom','files',_0x1546('0x4'),_0x1546('0x5'),_0x1546('0x6'),_0x1546('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x1546('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x1546('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x1546('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x1546('0x2')],'allowNull':!![],'defaultValue':_0x1546('0x8')},'format':{'type':Sequelize[_0x1546('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x1546('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 8be0680..f2dff29 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 _0x8e27=['basename','id2','createdAt','format','getSounds','pick','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','name','send','map','VoiceMusicOnHold','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','params','find','body','create','sequelize','transaction','mode','files','directory','join','server/files/moh','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','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','root','server/files/sounds/converted','%s.%s'];(function(_0x2142c8,_0x3001eb){var _0x4286e9=function(_0x43d768){while(--_0x43d768){_0x2142c8['push'](_0x2142c8['shift']());}};_0x4286e9(++_0x3001eb);}(_0x8e27,0x14a));var _0x78e2=function(_0x39017c,_0x15f210){_0x39017c=_0x39017c-0x0;var _0x584624=_0x8e27[_0x39017c];return _0x584624;};'use strict';var emlformat=require(_0x78e2('0x0'));var rimraf=require(_0x78e2('0x1'));var zipdir=require(_0x78e2('0x2'));var jsonpatch=require(_0x78e2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x78e2('0x4'));var Mustache=require(_0x78e2('0x5'));var util=require(_0x78e2('0x6'));var path=require(_0x78e2('0x7'));var sox=require(_0x78e2('0x8'));var csv=require(_0x78e2('0x9'));var ejs=require(_0x78e2('0xa'));var fs=require('fs');var fs_extra=require(_0x78e2('0xb'));var _=require(_0x78e2('0xc'));var squel=require(_0x78e2('0xd'));var crypto=require('crypto');var jsforce=require(_0x78e2('0xe'));var deskjs=require(_0x78e2('0xf'));var toCsv=require(_0x78e2('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x78e2('0x10'));var qs=require(_0x78e2('0x11'));var as=require(_0x78e2('0x12'));var hardwareService=require(_0x78e2('0x13'));var logger=require('../../config/logger')(_0x78e2('0x14'));var utils=require(_0x78e2('0x15'));var config=require(_0x78e2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x78e2('0x17'))['db'];function respondWithStatusCode(_0x5d0922,_0x381525){_0x381525=_0x381525||0xcc;return function(_0x3f9f7d){if(_0x3f9f7d){return _0x5d0922[_0x78e2('0x18')](_0x381525);}return _0x5d0922[_0x78e2('0x19')](_0x381525)[_0x78e2('0x1a')]();};}function respondWithResult(_0x4efdcd,_0x186802){_0x186802=_0x186802||0xc8;return function(_0x46184f){if(_0x46184f){return _0x4efdcd[_0x78e2('0x19')](_0x186802)[_0x78e2('0x1b')](_0x46184f);}};}function respondWithFilteredResult(_0x5d5514,_0x260b5c){return function(_0x36fe32){if(_0x36fe32){var _0x3afef9=typeof _0x260b5c[_0x78e2('0x1c')]===_0x78e2('0x1d')&&typeof _0x260b5c[_0x78e2('0x1e')]===_0x78e2('0x1d');var _0x50f3f1=_0x36fe32[_0x78e2('0x1f')];var _0x579730=_0x3afef9?0x0:_0x260b5c['offset'];var _0x57f9c6=_0x3afef9?_0x36fe32[_0x78e2('0x1f')]:_0x260b5c['offset']+_0x260b5c['limit'];var _0x30e2d8;if(_0x57f9c6>=_0x50f3f1){_0x57f9c6=_0x50f3f1;_0x30e2d8=0xc8;}else{_0x30e2d8=0xce;}_0x5d5514[_0x78e2('0x19')](_0x30e2d8);return _0x5d5514[_0x78e2('0x20')]('Content-Range',_0x579730+'-'+_0x57f9c6+'/'+_0x50f3f1)['json'](_0x36fe32);}return null;};}function patchUpdates(_0x5c6f0a){return function(_0x243b41){try{jsonpatch[_0x78e2('0x21')](_0x243b41,_0x5c6f0a,!![]);}catch(_0x3a30d8){return BPromise[_0x78e2('0x22')](_0x3a30d8);}return _0x243b41[_0x78e2('0x23')]();};}function saveUpdates(_0x21011b,_0x43e127){return function(_0x44bef7){if(_0x44bef7){return _0x44bef7[_0x78e2('0x24')](_0x21011b)[_0x78e2('0x25')](function(_0x1f0577){return _0x1f0577;});}return null;};}function removeEntity(_0x593c55,_0x3546a0){return function(_0x4ad83b){if(_0x4ad83b){return _0x4ad83b[_0x78e2('0x26')]()[_0x78e2('0x25')](function(){var _0x4b0518=_0x4ad83b[_0x78e2('0x27')]({'plain':!![]});var _0x5708f7=_0x78e2('0x28');return db[_0x78e2('0x29')][_0x78e2('0x26')]({'where':{'type':_0x5708f7,'resourceId':_0x4b0518['id']}})[_0x78e2('0x25')](function(){return _0x4ad83b;});})[_0x78e2('0x25')](function(){_0x593c55[_0x78e2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1000f7,_0x3a8581){return function(_0x2bd676){if(!_0x2bd676){_0x1000f7[_0x78e2('0x18')](0x194);}return _0x2bd676;};}function handleError(_0x4a0d08,_0x3c09ec){_0x3c09ec=_0x3c09ec||0x1f4;return function(_0x440ca9){logger[_0x78e2('0x2a')](_0x440ca9['stack']);if(_0x440ca9[_0x78e2('0x2b')]){delete _0x440ca9[_0x78e2('0x2b')];}_0x4a0d08[_0x78e2('0x19')](_0x3c09ec)[_0x78e2('0x2c')](_0x440ca9);};}exports['index']=function(_0x1d3fe2,_0x2e1efe){var _0x5a9001={},_0x48845a={},_0x4aecf0={'count':0x0,'rows':[]};var _0x280c88=_[_0x78e2('0x2d')](db[_0x78e2('0x2e')][_0x78e2('0x2f')],function(_0x11ee47){return{'name':_0x11ee47['fieldName'],'type':_0x11ee47[_0x78e2('0x30')]['key']};});_0x48845a[_0x78e2('0x31')]=_[_0x78e2('0x2d')](_0x280c88,_0x78e2('0x2b'));_0x48845a[_0x78e2('0x32')]=_[_0x78e2('0x33')](_0x1d3fe2[_0x78e2('0x32')]);_0x48845a[_0x78e2('0x34')]=_[_0x78e2('0x35')](_0x48845a[_0x78e2('0x31')],_0x48845a[_0x78e2('0x32')]);_0x5a9001[_0x78e2('0x36')]=_['intersection'](_0x48845a[_0x78e2('0x31')],qs[_0x78e2('0x37')](_0x1d3fe2[_0x78e2('0x32')][_0x78e2('0x37')]));_0x5a9001['attributes']=_0x5a9001[_0x78e2('0x36')][_0x78e2('0x38')]?_0x5a9001[_0x78e2('0x36')]:_0x48845a[_0x78e2('0x31')];if(!_0x1d3fe2[_0x78e2('0x32')]['hasOwnProperty'](_0x78e2('0x39'))){_0x5a9001[_0x78e2('0x1e')]=qs[_0x78e2('0x1e')](_0x1d3fe2[_0x78e2('0x32')][_0x78e2('0x1e')]);_0x5a9001['offset']=qs['offset'](_0x1d3fe2[_0x78e2('0x32')][_0x78e2('0x1c')]);}_0x5a9001[_0x78e2('0x3a')]=qs[_0x78e2('0x3b')](_0x1d3fe2['query'][_0x78e2('0x3b')]);delete _0x1d3fe2[_0x78e2('0x32')][_0x78e2('0x3b')];_0x5a9001[_0x78e2('0x3c')]=qs[_0x78e2('0x34')](_['pick'](_0x1d3fe2[_0x78e2('0x32')],_0x48845a[_0x78e2('0x34')]),_0x280c88);if(_0x1d3fe2[_0x78e2('0x32')][_0x78e2('0x3d')]){_0x5a9001['where']=_[_0x78e2('0x3e')](_0x5a9001[_0x78e2('0x3c')],{'$or':_['map'](_0x280c88,function(_0x1feb2a){if(_0x1feb2a[_0x78e2('0x30')]!=='VIRTUAL'){var _0x416bc8={};_0x416bc8[_0x1feb2a[_0x78e2('0x2b')]]={'$like':'%'+_0x1d3fe2['query'][_0x78e2('0x3d')]+'%'};return _0x416bc8;}})});}_0x5a9001=_[_0x78e2('0x3e')]({},_0x5a9001,_0x1d3fe2[_0x78e2('0x3f')]);var _0x48db6d={'where':_0x5a9001[_0x78e2('0x3c')]};return db[_0x78e2('0x2e')][_0x78e2('0x1f')](_0x48db6d)[_0x78e2('0x25')](function(_0x14ed0d){_0x4aecf0[_0x78e2('0x1f')]=_0x14ed0d;if(_0x1d3fe2[_0x78e2('0x32')][_0x78e2('0x40')]){_0x5a9001[_0x78e2('0x41')]=[{'all':!![]}];}return db[_0x78e2('0x2e')][_0x78e2('0x42')](_0x5a9001);})[_0x78e2('0x25')](function(_0x4664b3){_0x4aecf0['rows']=_0x4664b3;return _0x4aecf0;})[_0x78e2('0x25')](respondWithFilteredResult(_0x2e1efe,_0x5a9001))[_0x78e2('0x43')](handleError(_0x2e1efe,null));};exports[_0x78e2('0x44')]=function(_0x16469d,_0xc431a0){var _0x38781c={'raw':![],'where':{'id':_0x16469d[_0x78e2('0x45')]['id']}},_0x5db281={};_0x5db281[_0x78e2('0x31')]=_['keys'](db[_0x78e2('0x2e')][_0x78e2('0x2f')]);_0x5db281[_0x78e2('0x32')]=_['keys'](_0x16469d['query']);_0x5db281['filters']=_[_0x78e2('0x35')](_0x5db281[_0x78e2('0x31')],_0x5db281['query']);_0x38781c[_0x78e2('0x36')]=_['intersection'](_0x5db281[_0x78e2('0x31')],qs[_0x78e2('0x37')](_0x16469d[_0x78e2('0x32')]['fields']));_0x38781c[_0x78e2('0x36')]=_0x38781c[_0x78e2('0x36')][_0x78e2('0x38')]?_0x38781c[_0x78e2('0x36')]:_0x5db281[_0x78e2('0x31')];if(_0x16469d[_0x78e2('0x32')]['includeAll']){_0x38781c[_0x78e2('0x41')]=[{'all':!![]}];}_0x38781c=_[_0x78e2('0x3e')]({},_0x38781c,_0x16469d[_0x78e2('0x3f')]);return db[_0x78e2('0x2e')][_0x78e2('0x46')](_0x38781c)[_0x78e2('0x25')](handleEntityNotFound(_0xc431a0,null))[_0x78e2('0x25')](respondWithResult(_0xc431a0,null))[_0x78e2('0x43')](handleError(_0xc431a0,null));};exports['update']=function(_0x499837,_0xb7e437){if(_0x499837[_0x78e2('0x47')]['id']){delete _0x499837['body']['id'];}return db[_0x78e2('0x2e')][_0x78e2('0x46')]({'where':{'id':_0x499837['params']['id']}})[_0x78e2('0x25')](handleEntityNotFound(_0xb7e437,null))[_0x78e2('0x25')](saveUpdates(_0x499837[_0x78e2('0x47')],null))['then'](respondWithResult(_0xb7e437,null))[_0x78e2('0x43')](handleError(_0xb7e437,null));};exports[_0x78e2('0x48')]=function(_0x41ca98,_0xb3bfb9,_0x1ad5ad){return db[_0x78e2('0x49')][_0x78e2('0x4a')](function(_0x54a6f1){if(_0x41ca98[_0x78e2('0x47')][_0x78e2('0x4b')]===_0x78e2('0x4c')){_0x41ca98[_0x78e2('0x47')][_0x78e2('0x4d')]=path[_0x78e2('0x4e')](config['root'],_0x78e2('0x4f'),_0x41ca98[_0x78e2('0x47')][_0x78e2('0x2b')]);}return db['VoiceMusicOnHold']['create'](_0x41ca98[_0x78e2('0x47')],{'transaction':_0x54a6f1})[_0x78e2('0x25')](function(_0x31e407){if(_0x41ca98[_0x78e2('0x47')][_0x78e2('0x4b')]==='files'){fs['mkdirSync'](_0x31e407['directory'],parseInt('0777',0x8));}var _0x354288=_0x41ca98[_0x78e2('0x50')][_0x78e2('0x27')]({'plain':!![]});if(!_0x354288)throw new Error(_0x78e2('0x51'));if(_0x354288[_0x78e2('0x52')]==='user'){var _0x3800cf=_0x31e407[_0x78e2('0x27')]({'plain':!![]});return db[_0x78e2('0x53')][_0x78e2('0x46')]({'where':{'name':'MusicOnHolds','userProfileId':_0x354288[_0x78e2('0x54')]},'raw':!![]})['then'](function(_0x108725){if(_0x108725&&_0x108725[_0x78e2('0x55')]===0x0){return db[_0x78e2('0x29')]['create']({'name':_0x3800cf[_0x78e2('0x2b')],'resourceId':_0x3800cf['id'],'type':_0x108725[_0x78e2('0x2b')],'sectionId':_0x108725['id']},{})['then'](function(){return _0x31e407;});}else{return _0x31e407;}})['catch'](function(_0x166578){logger['error'](_0x78e2('0x56'),_0x166578);});}return _0x31e407;});})[_0x78e2('0x25')](respondWithResult(_0xb3bfb9,0xc9))[_0x78e2('0x43')](handleError(_0xb3bfb9,null));};exports[_0x78e2('0x26')]=function(_0x3b1556,_0x2cc385,_0x3d0bdf){var _0x2a686f;return db[_0x78e2('0x2e')][_0x78e2('0x46')]({'where':{'id':_0x3b1556[_0x78e2('0x45')]['id']}})[_0x78e2('0x25')](function(_0x368781){if(_0x368781){return db[_0x78e2('0x49')]['transaction'](function(_0x279687){return _0x368781['destroy']({'transaction':_0x279687,'raw':!![]})[_0x78e2('0x25')](function(_0x22e046){if(_0x22e046[_0x78e2('0x4d')]){fs[_0x78e2('0x57')](_0x22e046[_0x78e2('0x4d')])[_0x78e2('0x58')](function(_0x50b4b2){fs[_0x78e2('0x59')](path['join'](_0x22e046[_0x78e2('0x4d')],_0x50b4b2));});fs[_0x78e2('0x5a')](_0x22e046[_0x78e2('0x4d')]);}return _0x22e046;});})[_0x78e2('0x43')](function(_0x4ef92a){throw new db[(_0x78e2('0x5b'))][(_0x78e2('0x5c'))](_0x4ef92a[_0x78e2('0x5d')]);});}})[_0x78e2('0x25')](handleEntityNotFound(_0x2cc385,null))['then'](removeEntity(_0x2cc385,null))[_0x78e2('0x43')](handleError(_0x2cc385,null));};exports[_0x78e2('0x5e')]=function(_0x4d6a4f,_0x1d0913,_0x3d9177){return db[_0x78e2('0x49')][_0x78e2('0x4a')](function(_0x4beae0){var _0x513a08;return db[_0x78e2('0x2e')][_0x78e2('0x46')]({'where':{'id':_0x4d6a4f[_0x78e2('0x45')]['id']}})[_0x78e2('0x25')](function(_0x1c9a70){if(_0x1c9a70){_0x513a08=_0x1c9a70;return _0x1c9a70[_0x78e2('0x5e')](_0x4d6a4f[_0x78e2('0x47')]['id'],{'transaction':_0x4beae0});}})[_0x78e2('0x25')](function(_0x1ceeb5){if(_0x1ceeb5){return db[_0x78e2('0x5f')][_0x78e2('0x60')]({'where':{'id':_0x4d6a4f['body']['id']},'attributes':['id',_0x78e2('0x2b'),_0x78e2('0x61'),_0x78e2('0x62'),'createdAt'],'raw':!![]});}})[_0x78e2('0x25')](function(_0x304424){if(_0x304424){var _0x47f2f6=path[_0x78e2('0x4e')](config[_0x78e2('0x63')],_0x78e2('0x64'),util['format'](_0x78e2('0x65'),path[_0x78e2('0x66')](_0x304424[_0x78e2('0x61')],path['extname'](_0x304424[_0x78e2('0x61')])),_0x304424[_0x78e2('0x62')]));var _0x24b7e4=path[_0x78e2('0x4e')](config['root'],_0x78e2('0x4f'),_0x513a08[_0x78e2('0x2b')],util['format'](_0x78e2('0x65'),_0x304424[_0x78e2('0x2b')],_0x304424[_0x78e2('0x62')]));fs['symlinkSync'](_0x47f2f6,_0x24b7e4);return _0x304424;}})[_0x78e2('0x43')](function(_0x50ceb0){throw new db[(_0x78e2('0x5b'))][(_0x78e2('0x5c'))](_0x50ceb0[_0x78e2('0x5d')]);});})[_0x78e2('0x25')](handleEntityNotFound(_0x1d0913,null))[_0x78e2('0x25')](respondWithResult(_0x1d0913,0xc9))[_0x78e2('0x43')](handleError(_0x1d0913,null));};exports['removeSound']=function(_0xdfc637,_0x2046d5,_0x258da9){return db[_0x78e2('0x49')][_0x78e2('0x4a')](function(_0x1c74ce){var _0xfd855c;return db[_0x78e2('0x2e')]['findOne']({'where':{'id':_0xdfc637[_0x78e2('0x45')]['id']}})['then'](handleEntityNotFound(_0x2046d5,null))[_0x78e2('0x25')](function(_0x4ecb06){if(_0x4ecb06){_0xfd855c=_0x4ecb06;return _0x4ecb06['removeSound'](_0xdfc637[_0x78e2('0x45')][_0x78e2('0x67')]);}})['then'](function(_0x53669e){if(_0x53669e){return db[_0x78e2('0x5f')][_0x78e2('0x60')]({'where':{'id':_0xdfc637[_0x78e2('0x45')][_0x78e2('0x67')]},'attributes':['id','name',_0x78e2('0x61'),_0x78e2('0x62'),_0x78e2('0x68')],'raw':!![]});}})['then'](function(_0x54d350){if(_0x54d350){fs[_0x78e2('0x59')](path[_0x78e2('0x4e')](_0xfd855c[_0x78e2('0x4d')],util[_0x78e2('0x69')](_0x78e2('0x65'),_0x54d350[_0x78e2('0x2b')],_0x54d350[_0x78e2('0x62')])));return _0x54d350;}})['catch'](function(_0x3dc7a8){throw new db[(_0x78e2('0x5b'))][(_0x78e2('0x5c'))](_0x3dc7a8[_0x78e2('0x5d')]);});})['then'](handleEntityNotFound(_0x2046d5,null))[_0x78e2('0x25')](respondWithStatusCode(_0x2046d5,0xcc))[_0x78e2('0x43')](handleError(_0x2046d5,null));};exports[_0x78e2('0x6a')]=function(_0x262e3e,_0xaf7ac6,_0x434bca){var _0x3a485b={};var _0x364dc0={};var _0x147eb3;var _0x4fab34;return db[_0x78e2('0x2e')][_0x78e2('0x60')]({'where':{'id':_0x262e3e[_0x78e2('0x45')]['id']}})[_0x78e2('0x25')](handleEntityNotFound(_0xaf7ac6,null))['then'](function(_0x31219d){if(_0x31219d){_0x147eb3=_0x31219d;_0x364dc0[_0x78e2('0x31')]=_[_0x78e2('0x33')](db[_0x78e2('0x5f')][_0x78e2('0x2f')]);_0x364dc0[_0x78e2('0x32')]=_['keys'](_0x262e3e[_0x78e2('0x32')]);_0x364dc0[_0x78e2('0x34')]=_[_0x78e2('0x35')](_0x364dc0['model'],_0x364dc0[_0x78e2('0x32')]);_0x3a485b[_0x78e2('0x36')]=_[_0x78e2('0x35')](_0x364dc0[_0x78e2('0x31')],qs['fields'](_0x262e3e[_0x78e2('0x32')][_0x78e2('0x37')]));_0x3a485b[_0x78e2('0x36')]=_0x3a485b[_0x78e2('0x36')]['length']?_0x3a485b[_0x78e2('0x36')]:_0x364dc0[_0x78e2('0x31')];_0x3a485b[_0x78e2('0x3a')]=qs[_0x78e2('0x3b')](_0x262e3e[_0x78e2('0x32')][_0x78e2('0x3b')]);_0x3a485b[_0x78e2('0x3c')]=qs[_0x78e2('0x34')](_[_0x78e2('0x6b')](_0x262e3e[_0x78e2('0x32')],_0x364dc0[_0x78e2('0x34')]));if(_0x262e3e[_0x78e2('0x32')][_0x78e2('0x3d')]){_0x3a485b[_0x78e2('0x3c')]=_['merge'](_0x3a485b[_0x78e2('0x3c')],{'$or':_['map'](_0x3a485b['attributes'],function(_0x29d580){var _0x574e6f={};_0x574e6f[_0x29d580]={'$like':'%'+_0x262e3e[_0x78e2('0x32')]['filter']+'%'};return _0x574e6f;})});}_0x3a485b=_[_0x78e2('0x3e')]({},_0x3a485b,_0x262e3e[_0x78e2('0x3f')]);return _0x147eb3[_0x78e2('0x6a')](_0x3a485b);}})[_0x78e2('0x25')](function(_0x1c4a4a){if(_0x1c4a4a){_0x4fab34=_0x1c4a4a[_0x78e2('0x38')];if(!_0x262e3e['query']['hasOwnProperty']('nolimit')){_0x3a485b[_0x78e2('0x1e')]=qs[_0x78e2('0x1e')](_0x262e3e[_0x78e2('0x32')][_0x78e2('0x1e')]);_0x3a485b[_0x78e2('0x1c')]=qs['offset'](_0x262e3e[_0x78e2('0x32')][_0x78e2('0x1c')]);}return _0x147eb3[_0x78e2('0x6a')](_0x3a485b);}})[_0x78e2('0x25')](function(_0x6e8646){if(_0x6e8646){return _0x6e8646?{'count':_0x4fab34,'rows':_0x6e8646}:null;}})[_0x78e2('0x25')](respondWithResult(_0xaf7ac6,null))['catch'](handleError(_0xaf7ac6,null));}; \ No newline at end of file +var _0x5973=['MusicOnHolds','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','createdAt','server/files/sounds/converted','format','save_name','extname','%s.%s','converted_format','symlinkSync','removeSound','id2','getSounds','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','VoiceMusicOnHold','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','find','params','create','transaction','body','mode','directory','join','root','server/files/moh','files','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x5973,0x1cb));var _0x3597=function(_0xe1f502,_0x4fcee8){_0xe1f502=_0xe1f502-0x0;var _0x5baa21=_0x5973[_0xe1f502];return _0x5baa21;};'use strict';var emlformat=require(_0x3597('0x0'));var rimraf=require(_0x3597('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3597('0x2'));var rp=require('request-promise');var moment=require(_0x3597('0x3'));var BPromise=require(_0x3597('0x4'));var Mustache=require('mustache');var util=require(_0x3597('0x5'));var path=require(_0x3597('0x6'));var sox=require('sox');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(_0x3597('0x7'));var crypto=require(_0x3597('0x8'));var jsforce=require(_0x3597('0x9'));var deskjs=require(_0x3597('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3597('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3597('0xc'));var hardwareService=require(_0x3597('0xd'));var logger=require('../../config/logger')(_0x3597('0xe'));var utils=require(_0x3597('0xf'));var config=require(_0x3597('0x10'));var licenseUtil=require(_0x3597('0x11'));var db=require(_0x3597('0x12'))['db'];function respondWithStatusCode(_0x119b70,_0xb24d66){_0xb24d66=_0xb24d66||0xcc;return function(_0x44c23e){if(_0x44c23e){return _0x119b70[_0x3597('0x13')](_0xb24d66);}return _0x119b70[_0x3597('0x14')](_0xb24d66)['end']();};}function respondWithResult(_0x35a712,_0x312f0c){_0x312f0c=_0x312f0c||0xc8;return function(_0x204c26){if(_0x204c26){return _0x35a712['status'](_0x312f0c)[_0x3597('0x15')](_0x204c26);}};}function respondWithFilteredResult(_0x554bb0,_0x16a5fe){return function(_0x5f2b49){if(_0x5f2b49){var _0x3aa2e7=typeof _0x16a5fe['offset']===_0x3597('0x16')&&typeof _0x16a5fe['limit']===_0x3597('0x16');var _0x4a7736=_0x5f2b49[_0x3597('0x17')];var _0x42428a=_0x3aa2e7?0x0:_0x16a5fe[_0x3597('0x18')];var _0x431605=_0x3aa2e7?_0x5f2b49[_0x3597('0x17')]:_0x16a5fe[_0x3597('0x18')]+_0x16a5fe[_0x3597('0x19')];var _0x1de274;if(_0x431605>=_0x4a7736){_0x431605=_0x4a7736;_0x1de274=0xc8;}else{_0x1de274=0xce;}_0x554bb0['status'](_0x1de274);return _0x554bb0[_0x3597('0x1a')](_0x3597('0x1b'),_0x42428a+'-'+_0x431605+'/'+_0x4a7736)[_0x3597('0x15')](_0x5f2b49);}return null;};}function patchUpdates(_0x4e8fa3){return function(_0x54d53f){try{jsonpatch[_0x3597('0x1c')](_0x54d53f,_0x4e8fa3,!![]);}catch(_0x21753a){return BPromise[_0x3597('0x1d')](_0x21753a);}return _0x54d53f[_0x3597('0x1e')]();};}function saveUpdates(_0x46435c,_0x4a0c20){return function(_0x31a25a){if(_0x31a25a){return _0x31a25a[_0x3597('0x1f')](_0x46435c)[_0x3597('0x20')](function(_0x1b9697){return _0x1b9697;});}return null;};}function removeEntity(_0x5a62bd,_0x50e40c){return function(_0x181bc3){if(_0x181bc3){return _0x181bc3[_0x3597('0x21')]()[_0x3597('0x20')](function(){var _0x6ba001=_0x181bc3[_0x3597('0x22')]({'plain':!![]});var _0x9e73b5='MusicOnHolds';return db[_0x3597('0x23')][_0x3597('0x21')]({'where':{'type':_0x9e73b5,'resourceId':_0x6ba001['id']}})[_0x3597('0x20')](function(){return _0x181bc3;});})[_0x3597('0x20')](function(){_0x5a62bd['status'](0xcc)[_0x3597('0x24')]();});}};}function handleEntityNotFound(_0xcd04cb,_0x4a3d8d){return function(_0x13b367){if(!_0x13b367){_0xcd04cb['sendStatus'](0x194);}return _0x13b367;};}function handleError(_0x3474c0,_0x1a0782){_0x1a0782=_0x1a0782||0x1f4;return function(_0x51e836){logger[_0x3597('0x25')](_0x51e836[_0x3597('0x26')]);if(_0x51e836[_0x3597('0x27')]){delete _0x51e836[_0x3597('0x27')];}_0x3474c0[_0x3597('0x14')](_0x1a0782)[_0x3597('0x28')](_0x51e836);};}exports[_0x3597('0x29')]=function(_0x488048,_0x3ee925){var _0x323d6c={},_0x23d70c={},_0x2ce8={'count':0x0,'rows':[]};var _0x9fef64=_[_0x3597('0x2a')](db[_0x3597('0x2b')]['rawAttributes'],function(_0x68255e){return{'name':_0x68255e[_0x3597('0x2c')],'type':_0x68255e[_0x3597('0x2d')][_0x3597('0x2e')]};});_0x23d70c['model']=_[_0x3597('0x2a')](_0x9fef64,_0x3597('0x27'));_0x23d70c['query']=_[_0x3597('0x2f')](_0x488048[_0x3597('0x30')]);_0x23d70c[_0x3597('0x31')]=_[_0x3597('0x32')](_0x23d70c[_0x3597('0x33')],_0x23d70c[_0x3597('0x30')]);_0x323d6c[_0x3597('0x34')]=_[_0x3597('0x32')](_0x23d70c['model'],qs[_0x3597('0x35')](_0x488048[_0x3597('0x30')][_0x3597('0x35')]));_0x323d6c[_0x3597('0x34')]=_0x323d6c['attributes'][_0x3597('0x36')]?_0x323d6c[_0x3597('0x34')]:_0x23d70c[_0x3597('0x33')];if(!_0x488048[_0x3597('0x30')]['hasOwnProperty'](_0x3597('0x37'))){_0x323d6c[_0x3597('0x19')]=qs[_0x3597('0x19')](_0x488048['query'][_0x3597('0x19')]);_0x323d6c[_0x3597('0x18')]=qs['offset'](_0x488048[_0x3597('0x30')][_0x3597('0x18')]);}_0x323d6c[_0x3597('0x38')]=qs[_0x3597('0x39')](_0x488048['query'][_0x3597('0x39')]);delete _0x488048[_0x3597('0x30')][_0x3597('0x39')];_0x323d6c[_0x3597('0x3a')]=qs[_0x3597('0x31')](_[_0x3597('0x3b')](_0x488048[_0x3597('0x30')],_0x23d70c['filters']),_0x9fef64);if(_0x488048[_0x3597('0x30')][_0x3597('0x3c')]){_0x323d6c[_0x3597('0x3a')]=_[_0x3597('0x3d')](_0x323d6c['where'],{'$or':_['map'](_0x9fef64,function(_0x5794a2){if(_0x5794a2[_0x3597('0x2d')]!==_0x3597('0x3e')){var _0x3bb7c0={};_0x3bb7c0[_0x5794a2[_0x3597('0x27')]]={'$like':'%'+_0x488048['query'][_0x3597('0x3c')]+'%'};return _0x3bb7c0;}})});}_0x323d6c=_['merge']({},_0x323d6c,_0x488048[_0x3597('0x3f')]);var _0x5d5bb0={'where':_0x323d6c[_0x3597('0x3a')]};return db['VoiceMusicOnHold'][_0x3597('0x17')](_0x5d5bb0)[_0x3597('0x20')](function(_0x28606b){_0x2ce8[_0x3597('0x17')]=_0x28606b;if(_0x488048[_0x3597('0x30')][_0x3597('0x40')]){_0x323d6c[_0x3597('0x41')]=[{'all':!![]}];}return db[_0x3597('0x2b')][_0x3597('0x42')](_0x323d6c);})[_0x3597('0x20')](function(_0x427cc3){_0x2ce8[_0x3597('0x43')]=_0x427cc3;return _0x2ce8;})[_0x3597('0x20')](respondWithFilteredResult(_0x3ee925,_0x323d6c))[_0x3597('0x44')](handleError(_0x3ee925,null));};exports['show']=function(_0x101e3d,_0x53839b){var _0x49ad8a={'raw':![],'where':{'id':_0x101e3d['params']['id']}},_0x154214={};_0x154214[_0x3597('0x33')]=_['keys'](db[_0x3597('0x2b')][_0x3597('0x45')]);_0x154214[_0x3597('0x30')]=_['keys'](_0x101e3d[_0x3597('0x30')]);_0x154214[_0x3597('0x31')]=_['intersection'](_0x154214['model'],_0x154214[_0x3597('0x30')]);_0x49ad8a[_0x3597('0x34')]=_['intersection'](_0x154214[_0x3597('0x33')],qs['fields'](_0x101e3d[_0x3597('0x30')][_0x3597('0x35')]));_0x49ad8a[_0x3597('0x34')]=_0x49ad8a[_0x3597('0x34')][_0x3597('0x36')]?_0x49ad8a[_0x3597('0x34')]:_0x154214[_0x3597('0x33')];if(_0x101e3d['query'][_0x3597('0x40')]){_0x49ad8a['include']=[{'all':!![]}];}_0x49ad8a=_[_0x3597('0x3d')]({},_0x49ad8a,_0x101e3d[_0x3597('0x3f')]);return db[_0x3597('0x2b')][_0x3597('0x46')](_0x49ad8a)[_0x3597('0x20')](handleEntityNotFound(_0x53839b,null))[_0x3597('0x20')](respondWithResult(_0x53839b,null))['catch'](handleError(_0x53839b,null));};exports[_0x3597('0x1f')]=function(_0xfa6f34,_0x4b8a9d){if(_0xfa6f34['body']['id']){delete _0xfa6f34['body']['id'];}return db[_0x3597('0x2b')][_0x3597('0x46')]({'where':{'id':_0xfa6f34[_0x3597('0x47')]['id']}})[_0x3597('0x20')](handleEntityNotFound(_0x4b8a9d,null))[_0x3597('0x20')](saveUpdates(_0xfa6f34['body'],null))[_0x3597('0x20')](respondWithResult(_0x4b8a9d,null))[_0x3597('0x44')](handleError(_0x4b8a9d,null));};exports[_0x3597('0x48')]=function(_0x3d4ea3,_0x17be25,_0x57986c){return db['sequelize'][_0x3597('0x49')](function(_0x45d3bd){if(_0x3d4ea3[_0x3597('0x4a')][_0x3597('0x4b')]==='files'){_0x3d4ea3[_0x3597('0x4a')][_0x3597('0x4c')]=path[_0x3597('0x4d')](config[_0x3597('0x4e')],_0x3597('0x4f'),_0x3d4ea3[_0x3597('0x4a')]['name']);}return db[_0x3597('0x2b')][_0x3597('0x48')](_0x3d4ea3[_0x3597('0x4a')],{'transaction':_0x45d3bd})[_0x3597('0x20')](function(_0x1d76c1){if(_0x3d4ea3[_0x3597('0x4a')][_0x3597('0x4b')]===_0x3597('0x50')){fs[_0x3597('0x51')](_0x1d76c1['directory'],parseInt('0777',0x8));}var _0x3e3e42=_0x3d4ea3[_0x3597('0x52')][_0x3597('0x22')]({'plain':!![]});if(!_0x3e3e42)throw new Error(_0x3597('0x53'));if(_0x3e3e42[_0x3597('0x54')]===_0x3597('0x52')){var _0x26e00f=_0x1d76c1['get']({'plain':!![]});return db[_0x3597('0x55')][_0x3597('0x46')]({'where':{'name':_0x3597('0x56'),'userProfileId':_0x3e3e42['userProfileId']},'raw':!![]})[_0x3597('0x20')](function(_0x4ade9e){if(_0x4ade9e&&_0x4ade9e['autoAssociation']===0x0){return db[_0x3597('0x23')]['create']({'name':_0x26e00f[_0x3597('0x27')],'resourceId':_0x26e00f['id'],'type':_0x4ade9e[_0x3597('0x27')],'sectionId':_0x4ade9e['id']},{})[_0x3597('0x20')](function(){return _0x1d76c1;});}else{return _0x1d76c1;}})[_0x3597('0x44')](function(_0x340731){logger['error'](_0x3597('0x57'),_0x340731);});}return _0x1d76c1;});})[_0x3597('0x20')](respondWithResult(_0x17be25,0xc9))[_0x3597('0x44')](handleError(_0x17be25,null));};exports['destroy']=function(_0x1cfc6e,_0x292ee2,_0x299648){var _0x10bcbb;return db[_0x3597('0x2b')]['find']({'where':{'id':_0x1cfc6e['params']['id']}})[_0x3597('0x20')](function(_0x1c518f){if(_0x1c518f){return db[_0x3597('0x58')][_0x3597('0x49')](function(_0x390c4e){return _0x1c518f[_0x3597('0x21')]({'transaction':_0x390c4e,'raw':!![]})['then'](function(_0x16f7e2){if(_0x16f7e2[_0x3597('0x4c')]){fs[_0x3597('0x59')](_0x16f7e2[_0x3597('0x4c')])[_0x3597('0x5a')](function(_0x8607d9){fs['unlinkSync'](path[_0x3597('0x4d')](_0x16f7e2[_0x3597('0x4c')],_0x8607d9));});fs[_0x3597('0x5b')](_0x16f7e2['directory']);}return _0x16f7e2;});})['catch'](function(_0x4a10b4){throw new db[(_0x3597('0x5c'))][(_0x3597('0x5d'))](_0x4a10b4[_0x3597('0x5e')]);});}})[_0x3597('0x20')](handleEntityNotFound(_0x292ee2,null))[_0x3597('0x20')](removeEntity(_0x292ee2,null))['catch'](handleError(_0x292ee2,null));};exports['addSound']=function(_0x596815,_0x3cb8e0,_0x406c20){return db[_0x3597('0x58')][_0x3597('0x49')](function(_0x58d6a9){var _0x7a73f8;return db[_0x3597('0x2b')]['find']({'where':{'id':_0x596815[_0x3597('0x47')]['id']}})[_0x3597('0x20')](function(_0x21b651){if(_0x21b651){_0x7a73f8=_0x21b651;return _0x21b651[_0x3597('0x5f')](_0x596815['body']['id'],{'transaction':_0x58d6a9});}})['then'](function(_0x445b40){if(_0x445b40){return db[_0x3597('0x60')][_0x3597('0x61')]({'where':{'id':_0x596815[_0x3597('0x4a')]['id']},'attributes':['id',_0x3597('0x27'),'save_name','converted_format',_0x3597('0x62')],'raw':!![]});}})[_0x3597('0x20')](function(_0x36ba9f){if(_0x36ba9f){var _0x2374ef=path[_0x3597('0x4d')](config[_0x3597('0x4e')],_0x3597('0x63'),util[_0x3597('0x64')]('%s.%s',path['basename'](_0x36ba9f[_0x3597('0x65')],path[_0x3597('0x66')](_0x36ba9f['save_name'])),_0x36ba9f['converted_format']));var _0x2c7c62=path[_0x3597('0x4d')](config['root'],_0x3597('0x4f'),_0x7a73f8[_0x3597('0x27')],util['format'](_0x3597('0x67'),_0x36ba9f['name'],_0x36ba9f[_0x3597('0x68')]));fs[_0x3597('0x69')](_0x2374ef,_0x2c7c62);return _0x36ba9f;}})[_0x3597('0x44')](function(_0x587dc9){throw new db['Sequelize'][(_0x3597('0x5d'))](_0x587dc9['message']);});})['then'](handleEntityNotFound(_0x3cb8e0,null))['then'](respondWithResult(_0x3cb8e0,0xc9))[_0x3597('0x44')](handleError(_0x3cb8e0,null));};exports[_0x3597('0x6a')]=function(_0x390826,_0x220ae6,_0x2bfb5f){return db[_0x3597('0x58')][_0x3597('0x49')](function(_0x42a445){var _0x47ce1f;return db[_0x3597('0x2b')][_0x3597('0x61')]({'where':{'id':_0x390826[_0x3597('0x47')]['id']}})[_0x3597('0x20')](handleEntityNotFound(_0x220ae6,null))[_0x3597('0x20')](function(_0x482285){if(_0x482285){_0x47ce1f=_0x482285;return _0x482285[_0x3597('0x6a')](_0x390826['params']['id2']);}})['then'](function(_0xc541ca){if(_0xc541ca){return db[_0x3597('0x60')][_0x3597('0x61')]({'where':{'id':_0x390826[_0x3597('0x47')][_0x3597('0x6b')]},'attributes':['id',_0x3597('0x27'),_0x3597('0x65'),_0x3597('0x68'),'createdAt'],'raw':!![]});}})[_0x3597('0x20')](function(_0x45e46a){if(_0x45e46a){fs['unlinkSync'](path['join'](_0x47ce1f[_0x3597('0x4c')],util[_0x3597('0x64')](_0x3597('0x67'),_0x45e46a['name'],_0x45e46a['converted_format'])));return _0x45e46a;}})['catch'](function(_0x224c06){throw new db[(_0x3597('0x5c'))][(_0x3597('0x5d'))](_0x224c06[_0x3597('0x5e')]);});})[_0x3597('0x20')](handleEntityNotFound(_0x220ae6,null))[_0x3597('0x20')](respondWithStatusCode(_0x220ae6,0xcc))['catch'](handleError(_0x220ae6,null));};exports['getSounds']=function(_0x23ec8d,_0x5c0b90,_0x3d81a0){var _0x2b1ad0={};var _0x3f95eb={};var _0x3ef9e4;var _0x176e88;return db[_0x3597('0x2b')][_0x3597('0x61')]({'where':{'id':_0x23ec8d[_0x3597('0x47')]['id']}})[_0x3597('0x20')](handleEntityNotFound(_0x5c0b90,null))['then'](function(_0x154120){if(_0x154120){_0x3ef9e4=_0x154120;_0x3f95eb[_0x3597('0x33')]=_[_0x3597('0x2f')](db[_0x3597('0x60')][_0x3597('0x45')]);_0x3f95eb[_0x3597('0x30')]=_['keys'](_0x23ec8d[_0x3597('0x30')]);_0x3f95eb['filters']=_[_0x3597('0x32')](_0x3f95eb[_0x3597('0x33')],_0x3f95eb['query']);_0x2b1ad0['attributes']=_['intersection'](_0x3f95eb[_0x3597('0x33')],qs[_0x3597('0x35')](_0x23ec8d[_0x3597('0x30')][_0x3597('0x35')]));_0x2b1ad0[_0x3597('0x34')]=_0x2b1ad0[_0x3597('0x34')][_0x3597('0x36')]?_0x2b1ad0[_0x3597('0x34')]:_0x3f95eb[_0x3597('0x33')];_0x2b1ad0[_0x3597('0x38')]=qs['sort'](_0x23ec8d[_0x3597('0x30')][_0x3597('0x39')]);_0x2b1ad0[_0x3597('0x3a')]=qs[_0x3597('0x31')](_[_0x3597('0x3b')](_0x23ec8d[_0x3597('0x30')],_0x3f95eb['filters']));if(_0x23ec8d[_0x3597('0x30')][_0x3597('0x3c')]){_0x2b1ad0['where']=_[_0x3597('0x3d')](_0x2b1ad0[_0x3597('0x3a')],{'$or':_[_0x3597('0x2a')](_0x2b1ad0['attributes'],function(_0x8594db){var _0x45c65e={};_0x45c65e[_0x8594db]={'$like':'%'+_0x23ec8d['query']['filter']+'%'};return _0x45c65e;})});}_0x2b1ad0=_[_0x3597('0x3d')]({},_0x2b1ad0,_0x23ec8d['options']);return _0x3ef9e4['getSounds'](_0x2b1ad0);}})[_0x3597('0x20')](function(_0x1449e0){if(_0x1449e0){_0x176e88=_0x1449e0[_0x3597('0x36')];if(!_0x23ec8d[_0x3597('0x30')]['hasOwnProperty'](_0x3597('0x37'))){_0x2b1ad0[_0x3597('0x19')]=qs[_0x3597('0x19')](_0x23ec8d[_0x3597('0x30')]['limit']);_0x2b1ad0[_0x3597('0x18')]=qs['offset'](_0x23ec8d[_0x3597('0x30')][_0x3597('0x18')]);}return _0x3ef9e4[_0x3597('0x6c')](_0x2b1ad0);}})[_0x3597('0x20')](function(_0x5bd819){if(_0x5bd819){return _0x5bd819?{'count':_0x176e88,'rows':_0x5bd819}:null;}})[_0x3597('0x20')](respondWithResult(_0x5c0b90,null))[_0x3597('0x44')](handleError(_0x5c0b90,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 6ae8567..effacc0 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 _0x39b3=['bluebird','rimraf','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','lodash','api','moment'];(function(_0x4a56bd,_0x9e704c){var _0x1961cd=function(_0x255c99){while(--_0x255c99){_0x4a56bd['push'](_0x4a56bd['shift']());}};_0x1961cd(++_0x9e704c);}(_0x39b3,0x1ad));var _0x339b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x39b3[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x339b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x339b('0x1'));var moment=require(_0x339b('0x2'));var BPromise=require(_0x339b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x339b('0x4'));var config=require('../../config/environment');var attributes=require(_0x339b('0x5'));module[_0x339b('0x6')]=function(_0x5d26a8,_0x219544){return _0x5d26a8['define'](_0x339b('0x7'),attributes,{'tableName':_0x339b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf07=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf07,0x1af));var _0x7df0=function(_0x205201,_0x280331){_0x205201=_0x205201-0x0;var _0x268a4b=_0xdf07[_0x205201];return _0x268a4b;};'use strict';var _=require('lodash');var util=require(_0x7df0('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7df0('0x1'));var BPromise=require(_0x7df0('0x2'));var rp=require(_0x7df0('0x3'));var fs=require('fs');var path=require(_0x7df0('0x4'));var rimraf=require(_0x7df0('0x5'));var config=require(_0x7df0('0x6'));var attributes=require(_0x7df0('0x7'));module[_0x7df0('0x8')]=function(_0x3977a2,_0x1c7978){return _0x3977a2[_0x7df0('0x9')](_0x7df0('0xa'),attributes,{'tableName':_0x7df0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 5cb4e0b..20c0443 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 _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x12957c,_0x234c86){var _0x27b62e=function(_0x388ce6){while(--_0x388ce6){_0x12957c['push'](_0x12957c['shift']());}};_0x27b62e(++_0x234c86);}(_0xe706,0xa3));var _0x6e70=function(_0x85e9c6,_0xedec06){_0x85e9c6=_0x85e9c6-0x0;var _0x880842=_0xe706[_0x85e9c6];return _0x880842;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x3d813c,_0x7ed88a){var _0x370ae1=function(_0x3e0a3e){while(--_0x3e0a3e){_0x3d813c['push'](_0x3d813c['shift']());}};_0x370ae1(++_0x7ed88a);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index a2f5ee7..016746b 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 _0xeb9e=['/:id','show','/:id/users','getAgents','/:id/teams','getTeams','create','post','addAgents','addTeams','put','update','delete','destroy','removeTeams','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','/describe','describe'];(function(_0x42e0c8,_0x153375){var _0x1311cf=function(_0x1cc6fb){while(--_0x1cc6fb){_0x42e0c8['push'](_0x42e0c8['shift']());}};_0x1311cf(++_0x153375);}(_0xeb9e,0x143));var _0xeeb9=function(_0x135ffe,_0xc2481e){_0x135ffe=_0x135ffe-0x0;var _0x58b7c2=_0xeb9e[_0x135ffe];return _0x58b7c2;};'use strict';var multer=require('multer');var util=require(_0xeeb9('0x0'));var path=require('path');var timeout=require(_0xeeb9('0x1'));var express=require(_0xeeb9('0x2'));var router=express[_0xeeb9('0x3')]();var fs_extra=require(_0xeeb9('0x4'));var auth=require(_0xeeb9('0x5'));var interaction=require(_0xeeb9('0x6'));var config=require(_0xeeb9('0x7'));var controller=require(_0xeeb9('0x8'));router[_0xeeb9('0x9')]('/',auth[_0xeeb9('0xa')](),controller['index']);router['get'](_0xeeb9('0xb'),auth[_0xeeb9('0xa')](),controller[_0xeeb9('0xc')]);router[_0xeeb9('0x9')](_0xeeb9('0xd'),auth['isAuthenticated'](),controller[_0xeeb9('0xe')]);router[_0xeeb9('0x9')](_0xeeb9('0xf'),auth[_0xeeb9('0xa')](),controller[_0xeeb9('0x10')]);router[_0xeeb9('0x9')](_0xeeb9('0x11'),auth[_0xeeb9('0xa')](),controller[_0xeeb9('0x12')]);router['post']('/',auth[_0xeeb9('0xa')](),controller[_0xeeb9('0x13')]);router[_0xeeb9('0x14')](_0xeeb9('0xf'),auth[_0xeeb9('0xa')](),controller[_0xeeb9('0x15')]);router['post']('/:id/teams',auth[_0xeeb9('0xa')](),controller[_0xeeb9('0x16')]);router[_0xeeb9('0x17')]('/:id',auth[_0xeeb9('0xa')](),controller[_0xeeb9('0x18')]);router[_0xeeb9('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xeeb9('0x1a')]);router['delete'](_0xeeb9('0xf'),auth[_0xeeb9('0xa')](),controller['removeAgents']);router[_0xeeb9('0x19')](_0xeeb9('0x11'),auth['isAuthenticated'](),controller[_0xeeb9('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x4f16=['removeTeams','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','destroy','delete'];(function(_0x40be92,_0x488e3){var _0x33e39c=function(_0x3e90b4){while(--_0x3e90b4){_0x40be92['push'](_0x40be92['shift']());}};_0x33e39c(++_0x488e3);}(_0x4f16,0x11f));var _0x64f1=function(_0x1475a6,_0x56628c){_0x1475a6=_0x1475a6-0x0;var _0x3c0d07=_0x4f16[_0x1475a6];return _0x3c0d07;};'use strict';var multer=require(_0x64f1('0x0'));var util=require(_0x64f1('0x1'));var path=require(_0x64f1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x64f1('0x3'));var auth=require(_0x64f1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x64f1('0x5'));var controller=require('./voicePrefix.controller');router[_0x64f1('0x6')]('/',auth[_0x64f1('0x7')](),controller[_0x64f1('0x8')]);router[_0x64f1('0x6')](_0x64f1('0x9'),auth[_0x64f1('0x7')](),controller[_0x64f1('0xa')]);router['get'](_0x64f1('0xb'),auth[_0x64f1('0x7')](),controller['show']);router[_0x64f1('0x6')](_0x64f1('0xc'),auth[_0x64f1('0x7')](),controller[_0x64f1('0xd')]);router[_0x64f1('0x6')](_0x64f1('0xe'),auth['isAuthenticated'](),controller[_0x64f1('0xf')]);router[_0x64f1('0x10')]('/',auth[_0x64f1('0x7')](),controller[_0x64f1('0x11')]);router['post']('/:id/users',auth[_0x64f1('0x7')](),controller[_0x64f1('0x12')]);router['post']('/:id/teams',auth[_0x64f1('0x7')](),controller['addTeams']);router['put'](_0x64f1('0xb'),auth[_0x64f1('0x7')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x64f1('0x13')]);router[_0x64f1('0x14')](_0x64f1('0xc'),auth[_0x64f1('0x7')](),controller['removeAgents']);router[_0x64f1('0x14')](_0x64f1('0xe'),auth[_0x64f1('0x7')](),controller[_0x64f1('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index a32a66b..62eb2e8 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 _0x0191=['INTEGER','sequelize','exports','STRING','name','system-','getDataValue'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x0191,0xb7));var _0x1019=function(_0x2673bb,_0x292576){_0x2673bb=_0x2673bb-0x0;var _0x3edc1c=_0x0191[_0x2673bb];return _0x3edc1c;};'use strict';var Sequelize=require(_0x1019('0x0'));module[_0x1019('0x1')]={'name':{'type':Sequelize[_0x1019('0x2')],'allowNull':![],'unique':_0x1019('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x5bce67){return _0x1019('0x4')+this[_0x1019('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0x1019('0x2')]},'callerIdAll':{'type':Sequelize[_0x1019('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x1019('0x6')]}}; \ No newline at end of file +var _0x7dc8=['sequelize','STRING','VIRTUAL','system-','getDataValue','name','INTEGER'];(function(_0x12d812,_0x496bb7){var _0x3711ab=function(_0x3259da){while(--_0x3259da){_0x12d812['push'](_0x12d812['shift']());}};_0x3711ab(++_0x496bb7);}(_0x7dc8,0x118));var _0x87dc=function(_0x49c4ab,_0x32bba6){_0x49c4ab=_0x49c4ab-0x0;var _0x591b1f=_0x7dc8[_0x49c4ab];return _0x591b1f;};'use strict';var Sequelize=require(_0x87dc('0x0'));module['exports']={'name':{'type':Sequelize[_0x87dc('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x87dc('0x2')],'get':function(_0x2e07b6){return _0x87dc('0x3')+this[_0x87dc('0x4')](_0x87dc('0x5'))+'-';}},'description':{'type':Sequelize[_0x87dc('0x1')]},'callerIdAll':{'type':Sequelize[_0x87dc('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x87dc('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 5257e68..af2e801 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 _0x1c7c=['isArray','userVoicePrefix:remove','getAgents','findOne','keys','User','order','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','TeamVoicePrefix','upsert','each','findOrCreate','forEach','removeTeams','select','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','every','TeamId','includes','all','union','value','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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','send','map','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoicePrefix','includeAll','findAll','rows','catch','show','include','find','describe','sequelize','transaction','create','body','VoiceExtension','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','VoicePrefixId','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','system-','addAgents','params','omit','ids','emit','userVoicePrefix:save','removeAgents'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1c7c,0x164));var _0xc1c7=function(_0x248ff4,_0x516512){_0x248ff4=_0x248ff4-0x0;var _0x42e816=_0x1c7c[_0x248ff4];return _0x42e816;};'use strict';var emlformat=require(_0xc1c7('0x0'));var rimraf=require(_0xc1c7('0x1'));var zipdir=require(_0xc1c7('0x2'));var jsonpatch=require(_0xc1c7('0x3'));var rp=require('request-promise');var moment=require(_0xc1c7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc1c7('0x5'));var util=require(_0xc1c7('0x6'));var path=require(_0xc1c7('0x7'));var sox=require(_0xc1c7('0x8'));var csv=require(_0xc1c7('0x9'));var ejs=require(_0xc1c7('0xa'));var fs=require('fs');var fs_extra=require(_0xc1c7('0xb'));var _=require(_0xc1c7('0xc'));var squel=require(_0xc1c7('0xd'));var crypto=require(_0xc1c7('0xe'));var jsforce=require(_0xc1c7('0xf'));var deskjs=require(_0xc1c7('0x10'));var toCsv=require(_0xc1c7('0x9'));var querystring=require(_0xc1c7('0x11'));var Papa=require(_0xc1c7('0x12'));var Redis=require(_0xc1c7('0x13'));var authService=require(_0xc1c7('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc1c7('0x15'));var hardwareService=require(_0xc1c7('0x16'));var logger=require('../../config/logger')(_0xc1c7('0x17'));var utils=require(_0xc1c7('0x18'));var config=require(_0xc1c7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1c7('0x1a'))['db'];config[_0xc1c7('0x1b')]=_[_0xc1c7('0x1c')](config[_0xc1c7('0x1b')],{'host':_0xc1c7('0x1d'),'port':0x18eb});var socket=require(_0xc1c7('0x1e'))(new Redis(config[_0xc1c7('0x1b')]));require(_0xc1c7('0x1f'))[_0xc1c7('0x20')](socket);function respondWithStatusCode(_0x1b6905,_0x99b874){_0x99b874=_0x99b874||0xcc;return function(_0x34d392){if(_0x34d392){return _0x1b6905['sendStatus'](_0x99b874);}return _0x1b6905[_0xc1c7('0x21')](_0x99b874)[_0xc1c7('0x22')]();};}function respondWithResult(_0x21911c,_0x555b59){_0x555b59=_0x555b59||0xc8;return function(_0x94678a){if(_0x94678a){return _0x21911c[_0xc1c7('0x21')](_0x555b59)[_0xc1c7('0x23')](_0x94678a);}};}function respondWithFilteredResult(_0x39ac54,_0x20439e){return function(_0xb42702){if(_0xb42702){var _0x21758a=typeof _0x20439e[_0xc1c7('0x24')]==='undefined'&&typeof _0x20439e[_0xc1c7('0x25')]===_0xc1c7('0x26');var _0x3ec66a=_0xb42702[_0xc1c7('0x27')];var _0x4b706e=_0x21758a?0x0:_0x20439e[_0xc1c7('0x24')];var _0x4d6171=_0x21758a?_0xb42702[_0xc1c7('0x27')]:_0x20439e[_0xc1c7('0x24')]+_0x20439e['limit'];var _0x5846f0;if(_0x4d6171>=_0x3ec66a){_0x4d6171=_0x3ec66a;_0x5846f0=0xc8;}else{_0x5846f0=0xce;}_0x39ac54[_0xc1c7('0x21')](_0x5846f0);return _0x39ac54[_0xc1c7('0x28')](_0xc1c7('0x29'),_0x4b706e+'-'+_0x4d6171+'/'+_0x3ec66a)['json'](_0xb42702);}return null;};}function patchUpdates(_0x813853){return function(_0x341b41){try{jsonpatch[_0xc1c7('0x2a')](_0x341b41,_0x813853,!![]);}catch(_0x31a0e0){return BPromise[_0xc1c7('0x2b')](_0x31a0e0);}return _0x341b41[_0xc1c7('0x2c')]();};}function saveUpdates(_0x3180fd,_0x120168){return function(_0x22b654){if(_0x22b654){return _0x22b654[_0xc1c7('0x2d')](_0x3180fd)[_0xc1c7('0x2e')](function(_0x363fbc){return _0x363fbc;});}return null;};}function removeEntity(_0x33aac7,_0x260a3f){return function(_0xf1c405){if(_0xf1c405){return _0xf1c405[_0xc1c7('0x2f')]()['then'](function(){var _0xf0ab9c=_0xf1c405[_0xc1c7('0x30')]({'plain':!![]});var _0x4e1721='VoicePrefixes';return db[_0xc1c7('0x31')]['destroy']({'where':{'type':_0x4e1721,'resourceId':_0xf0ab9c['id']}})['then'](function(){return _0xf1c405;});})[_0xc1c7('0x2e')](function(){_0x33aac7[_0xc1c7('0x21')](0xcc)[_0xc1c7('0x22')]();});}};}function handleEntityNotFound(_0x243450,_0x461360){return function(_0x4adb81){if(!_0x4adb81){_0x243450['sendStatus'](0x194);}return _0x4adb81;};}function handleError(_0x1b6f97,_0x4275f9){_0x4275f9=_0x4275f9||0x1f4;return function(_0x9a0ab3){logger[_0xc1c7('0x32')](_0x9a0ab3[_0xc1c7('0x33')]);if(_0x9a0ab3['name']){delete _0x9a0ab3['name'];}_0x1b6f97[_0xc1c7('0x21')](_0x4275f9)[_0xc1c7('0x34')](_0x9a0ab3);};}exports['index']=function(_0x41b154,_0x3cf425){var _0x39b68c={},_0x1f9708={},_0x74b523={'count':0x0,'rows':[]};var _0x2d69d3=_[_0xc1c7('0x35')](db['VoicePrefix'][_0xc1c7('0x36')],function(_0xeac123){return{'name':_0xeac123[_0xc1c7('0x37')],'type':_0xeac123[_0xc1c7('0x38')][_0xc1c7('0x39')]};});_0x1f9708[_0xc1c7('0x3a')]=_[_0xc1c7('0x35')](_0x2d69d3,_0xc1c7('0x3b'));_0x1f9708[_0xc1c7('0x3c')]=_['keys'](_0x41b154['query']);_0x1f9708[_0xc1c7('0x3d')]=_[_0xc1c7('0x3e')](_0x1f9708[_0xc1c7('0x3a')],_0x1f9708[_0xc1c7('0x3c')]);_0x39b68c[_0xc1c7('0x3f')]=_[_0xc1c7('0x3e')](_0x1f9708[_0xc1c7('0x3a')],qs[_0xc1c7('0x40')](_0x41b154[_0xc1c7('0x3c')][_0xc1c7('0x40')]));_0x39b68c[_0xc1c7('0x3f')]=_0x39b68c[_0xc1c7('0x3f')][_0xc1c7('0x41')]?_0x39b68c[_0xc1c7('0x3f')]:_0x1f9708[_0xc1c7('0x3a')];if(!_0x41b154[_0xc1c7('0x3c')][_0xc1c7('0x42')](_0xc1c7('0x43'))){_0x39b68c[_0xc1c7('0x25')]=qs[_0xc1c7('0x25')](_0x41b154[_0xc1c7('0x3c')]['limit']);_0x39b68c['offset']=qs['offset'](_0x41b154[_0xc1c7('0x3c')]['offset']);}_0x39b68c['order']=qs[_0xc1c7('0x44')](_0x41b154[_0xc1c7('0x3c')][_0xc1c7('0x44')]);_0x39b68c[_0xc1c7('0x45')]=qs['filters'](_[_0xc1c7('0x46')](_0x41b154[_0xc1c7('0x3c')],_0x1f9708[_0xc1c7('0x3d')]),_0x2d69d3);if(_0x41b154[_0xc1c7('0x3c')][_0xc1c7('0x47')]){_0x39b68c[_0xc1c7('0x45')]=_[_0xc1c7('0x48')](_0x39b68c[_0xc1c7('0x45')],{'$or':_[_0xc1c7('0x35')](_0x2d69d3,function(_0x1810c7){if(_0x1810c7[_0xc1c7('0x38')]!==_0xc1c7('0x49')){var _0x23d0b2={};_0x23d0b2[_0x1810c7['name']]={'$like':'%'+_0x41b154[_0xc1c7('0x3c')][_0xc1c7('0x47')]+'%'};return _0x23d0b2;}})});}_0x39b68c=_['merge']({},_0x39b68c,_0x41b154[_0xc1c7('0x4a')]);var _0x23b10b={'where':_0x39b68c[_0xc1c7('0x45')]};return db[_0xc1c7('0x4b')][_0xc1c7('0x27')](_0x23b10b)[_0xc1c7('0x2e')](function(_0xd5e06a){_0x74b523[_0xc1c7('0x27')]=_0xd5e06a;if(_0x41b154[_0xc1c7('0x3c')][_0xc1c7('0x4c')]){_0x39b68c['include']=[{'all':!![]}];}return db[_0xc1c7('0x4b')][_0xc1c7('0x4d')](_0x39b68c);})['then'](function(_0x4c6834){_0x74b523[_0xc1c7('0x4e')]=_0x4c6834;return _0x74b523;})[_0xc1c7('0x2e')](respondWithFilteredResult(_0x3cf425,_0x39b68c))[_0xc1c7('0x4f')](handleError(_0x3cf425,null));};exports[_0xc1c7('0x50')]=function(_0x429221,_0x51a33f){var _0x1eca39={'raw':![],'where':{'id':_0x429221['params']['id']}},_0x805dac={};_0x805dac['model']=_['keys'](db[_0xc1c7('0x4b')][_0xc1c7('0x36')]);_0x805dac[_0xc1c7('0x3c')]=_['keys'](_0x429221[_0xc1c7('0x3c')]);_0x805dac[_0xc1c7('0x3d')]=_['intersection'](_0x805dac[_0xc1c7('0x3a')],_0x805dac[_0xc1c7('0x3c')]);_0x1eca39[_0xc1c7('0x3f')]=_[_0xc1c7('0x3e')](_0x805dac[_0xc1c7('0x3a')],qs[_0xc1c7('0x40')](_0x429221[_0xc1c7('0x3c')][_0xc1c7('0x40')]));_0x1eca39[_0xc1c7('0x3f')]=_0x1eca39[_0xc1c7('0x3f')][_0xc1c7('0x41')]?_0x1eca39[_0xc1c7('0x3f')]:_0x805dac[_0xc1c7('0x3a')];if(_0x429221[_0xc1c7('0x3c')][_0xc1c7('0x4c')]){_0x1eca39[_0xc1c7('0x51')]=[{'all':!![]}];}_0x1eca39=_[_0xc1c7('0x48')]({},_0x1eca39,_0x429221[_0xc1c7('0x4a')]);return db['VoicePrefix'][_0xc1c7('0x52')](_0x1eca39)['then'](handleEntityNotFound(_0x51a33f,null))[_0xc1c7('0x2e')](respondWithResult(_0x51a33f,null))[_0xc1c7('0x4f')](handleError(_0x51a33f,null));};exports[_0xc1c7('0x2f')]=function(_0x524088,_0x473e8d){return db[_0xc1c7('0x4b')]['find']({'where':{'id':_0x524088['params']['id']}})['then'](handleEntityNotFound(_0x473e8d,null))[_0xc1c7('0x2e')](removeEntity(_0x473e8d,null))[_0xc1c7('0x4f')](handleError(_0x473e8d,null));};exports['describe']=function(_0x49542,_0x12a1d2){return db[_0xc1c7('0x4b')][_0xc1c7('0x53')]()[_0xc1c7('0x2e')](respondWithResult(_0x12a1d2,null))[_0xc1c7('0x4f')](handleError(_0x12a1d2,null));};exports['create']=function(_0x259e55,_0x568377){var _0x307b5e;return db[_0xc1c7('0x54')][_0xc1c7('0x55')](function(_0x557cb6){return db[_0xc1c7('0x4b')][_0xc1c7('0x56')](_0x259e55[_0xc1c7('0x57')],{'transaction':_0x557cb6})[_0xc1c7('0x2e')](function(_0x1679c5){_0x307b5e=_0x1679c5[_0xc1c7('0x30')]({'plain':!![]});return db[_0xc1c7('0x58')][_0xc1c7('0x52')]({'where':{'id':_0x307b5e['VoiceExtensionId']},'raw':!![]})[_0xc1c7('0x2e')](function(_0x2a8664){return createVoicePrefixExtensions(_0x307b5e,_0x2a8664,_0x557cb6);});});})[_0xc1c7('0x2e')](function(){var _0x575fc5=_0x259e55['user'][_0xc1c7('0x30')]({'plain':!![]});if(!_0x575fc5)throw new Error(_0xc1c7('0x59'));if(_0x575fc5[_0xc1c7('0x5a')]==='user'){var _0x1c636c=_0x307b5e;return db['UserProfileSection'][_0xc1c7('0x52')]({'where':{'name':_0xc1c7('0x5b'),'userProfileId':_0x575fc5[_0xc1c7('0x5c')]},'raw':!![]})[_0xc1c7('0x2e')](function(_0x345a46){if(_0x345a46&&_0x345a46[_0xc1c7('0x5d')]===0x0){return db[_0xc1c7('0x31')]['create']({'name':_0x1c636c[_0xc1c7('0x3b')],'resourceId':_0x1c636c['id'],'type':_0x345a46[_0xc1c7('0x3b')],'sectionId':_0x345a46['id']},{})[_0xc1c7('0x2e')](function(){return _0x307b5e;});}else{return _0x307b5e;}})['catch'](function(_0x24fa71){logger['error'](_0xc1c7('0x5e'),_0x24fa71);throw _0x24fa71;});}return _0x307b5e;})['then'](respondWithResult(_0x568377,null))[_0xc1c7('0x4f')](handleError(_0x568377,null));};function Extension(_0x212d53,_0x314232,_0x3a94fb,_0x156d51){this['context']='from-sip';this['exten']=_0x212d53;this[_0xc1c7('0x5f')]=_0x3a94fb;this[_0xc1c7('0x38')]=_0xc1c7('0x60');this[_0xc1c7('0x61')]=_0xc1c7('0x62');this[_0xc1c7('0x63')]=_0x314232;this['appdata']=_0x156d51;}function createVoicePrefixExtensions(_0x19b8d7,_0xe5882,_0x1c010a){return new BPromise(function(_0x6e300e,_0x5f4f7a){var _0x2e4673=new Extension(formatPrefixName(_0x19b8d7[_0xc1c7('0x64')]),0x1,_0xc1c7('0x65'),'Voice\x20Prefix');_0x2e4673[_0xc1c7('0x66')]=_0x19b8d7['id'];return db[_0xc1c7('0x58')][_0xc1c7('0x56')](_0x2e4673,{'transaction':_0x1c010a})[_0xc1c7('0x2e')](function(_0x58b08b){var _0x552691=_0x58b08b[_0xc1c7('0x30')]({'plain':!![]});var _0x203790=_['map'](addVoicePrefixExtensions(_0x19b8d7,_0xe5882),function(_0x46dc1e){_0x46dc1e[_0xc1c7('0x67')]=_0x552691['id'];_0x46dc1e['VoicePrefixId']=_0x19b8d7['id'];return _0x46dc1e;});return db[_0xc1c7('0x58')][_0xc1c7('0x68')](_0x203790,{'transaction':_0x1c010a})['then'](function(_0x6b9337){if(!_0x6b9337){return _0x5f4f7a(_0xc1c7('0x69'));}else{return _0x6e300e(_0x6b9337);}})[_0xc1c7('0x4f')](function(_0x2b4db2){return _0x5f4f7a(_0x2b4db2);});});;});};function addVoicePrefixExtensions(_0x1087b2,_0x11c9d8){var _0x1ed9fc=[];var _0x33104e=formatPrefixName(_0x1087b2[_0xc1c7('0x64')]);_0x1ed9fc[_0xc1c7('0x6a')](new Extension(_0x33104e,0x2,_0xc1c7('0x6b'),_0xc1c7('0x6c')+_0x1087b2[_0xc1c7('0x3b')]));if(_0x1087b2[_0xc1c7('0x6d')]){_0x1ed9fc[_0xc1c7('0x6a')](new Extension(_0x33104e,0x3,_0xc1c7('0x6b'),_0xc1c7('0x6e')+_0x1087b2[_0xc1c7('0x6d')]));}else{_0x1ed9fc[_0xc1c7('0x6a')](new Extension(_0x33104e,0x3,_0xc1c7('0x65'),_0xc1c7('0x6f')));}_0x1ed9fc[_0xc1c7('0x6a')](new Extension(_0x33104e,0x4,_0xc1c7('0x70'),_0x11c9d8[_0xc1c7('0x71')]+','+_0xc1c7('0x72')+(0x8+_0x1087b2[_0xc1c7('0x3b')][_0xc1c7('0x41')])+'}'+','+0x1));return _0x1ed9fc;}function formatPrefixName(_0x1448d8){var _0x47d58e='_';for(var _0x8c88c0=0x0;_0x8c88c0<_0x1448d8[_0xc1c7('0x41')];_0x8c88c0++){if(_0x1448d8[_0xc1c7('0x73')](_0x8c88c0)=='-'){_0x47d58e+=_0x1448d8[_0xc1c7('0x73')](_0x8c88c0);}else{_0x47d58e+='['+_0x1448d8[_0xc1c7('0x73')](_0x8c88c0)+']';}}_0x47d58e+='.';return _0x47d58e;}exports[_0xc1c7('0x2d')]=function(_0x1ccd7d,_0x29181f,_0x5f4f50){var _0xbbd4e3=_0x1ccd7d[_0xc1c7('0x57')];_0xbbd4e3[_0xc1c7('0x64')]=_0xc1c7('0x74')+_0xbbd4e3[_0xc1c7('0x3b')]+'-';return db[_0xc1c7('0x54')][_0xc1c7('0x55')](function(_0xa00af6){return db['VoicePrefix'][_0xc1c7('0x2d')](_0xbbd4e3,{'where':{'id':_0xbbd4e3['id']},'transaction':_0xa00af6})[_0xc1c7('0x2e')](function(){return db[_0xc1c7('0x58')][_0xc1c7('0x2f')]({'where':{'VoicePrefixId':_0xbbd4e3['id']},'transaction':_0xa00af6})[_0xc1c7('0x2e')](function(){return db[_0xc1c7('0x58')][_0xc1c7('0x52')]({'where':{'id':_0xbbd4e3[_0xc1c7('0x67')]},'raw':!![]})[_0xc1c7('0x2e')](function(_0x125270){return createVoicePrefixExtensions(_0xbbd4e3,_0x125270,_0xa00af6);});});});})[_0xc1c7('0x2e')](function(){return db[_0xc1c7('0x4b')]['findById'](_0xbbd4e3['id']);})['then'](respondWithResult(_0x29181f,null))[_0xc1c7('0x4f')](handleError(_0x29181f,null));};exports[_0xc1c7('0x75')]=function(_0xc16f09,_0x11fd01,_0x44a24b){return db[_0xc1c7('0x4b')][_0xc1c7('0x52')]({'where':{'id':_0xc16f09[_0xc1c7('0x76')]['id']}})[_0xc1c7('0x2e')](handleEntityNotFound(_0x11fd01,null))[_0xc1c7('0x2e')](function(_0x180607){if(_0x180607){return _0x180607[_0xc1c7('0x75')](_0xc16f09[_0xc1c7('0x57')]['ids'],_[_0xc1c7('0x77')](_0xc16f09[_0xc1c7('0x57')],[_0xc1c7('0x78'),'id'])||{})['spread'](function(_0x4de022){for(var _0x550c4a=0x0;_0x550c4a<_0xc16f09[_0xc1c7('0x57')][_0xc1c7('0x78')]['length'];_0x550c4a+=0x1){socket[_0xc1c7('0x79')](_0xc1c7('0x7a'),{'UserId':Number(_0xc16f09['body']['ids'][_0x550c4a]),'VoicePrefixId':Number(_0xc16f09['params']['id'])});}return _0x4de022;});}})[_0xc1c7('0x2e')](respondWithResult(_0x11fd01,null))['catch'](handleError(_0x11fd01,null));};exports[_0xc1c7('0x7b')]=function(_0x3bc3aa,_0xf899a,_0x4b7a34){return db[_0xc1c7('0x4b')]['find']({'where':{'id':_0x3bc3aa[_0xc1c7('0x76')]['id']}})[_0xc1c7('0x2e')](handleEntityNotFound(_0xf899a,null))['then'](function(_0xf7b22e){if(_0xf7b22e){return _0xf7b22e[_0xc1c7('0x7b')](_0x3bc3aa[_0xc1c7('0x3c')][_0xc1c7('0x78')])[_0xc1c7('0x2e')](function(){if(_[_0xc1c7('0x7c')](_0x3bc3aa[_0xc1c7('0x3c')][_0xc1c7('0x78')])){for(var _0x425f3d=0x0;_0x425f3d<_0x3bc3aa[_0xc1c7('0x3c')]['ids'][_0xc1c7('0x41')];_0x425f3d+=0x1){socket[_0xc1c7('0x79')](_0xc1c7('0x7d'),{'UserId':Number(_0x3bc3aa[_0xc1c7('0x3c')]['ids'][_0x425f3d]),'VoicePrefixId':Number(_0x3bc3aa[_0xc1c7('0x76')]['id'])});}}else{socket[_0xc1c7('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x3bc3aa['query'][_0xc1c7('0x78')]),'VoicePrefixId':Number(_0x3bc3aa[_0xc1c7('0x76')]['id'])});}});}})[_0xc1c7('0x2e')](respondWithStatusCode(_0xf899a,null))[_0xc1c7('0x4f')](handleError(_0xf899a,null));};exports[_0xc1c7('0x7e')]=function(_0x176603,_0x48309e,_0x1f0c3f){var _0x2ad4f5={};var _0x5698e9={};var _0x65161e;var _0x32c26e;return db[_0xc1c7('0x4b')][_0xc1c7('0x7f')]({'where':{'id':_0x176603[_0xc1c7('0x76')]['id']}})[_0xc1c7('0x2e')](handleEntityNotFound(_0x48309e,null))[_0xc1c7('0x2e')](function(_0x175bba){if(_0x175bba){_0x65161e=_0x175bba;_0x5698e9[_0xc1c7('0x3a')]=_[_0xc1c7('0x80')](db[_0xc1c7('0x81')][_0xc1c7('0x36')]);_0x5698e9[_0xc1c7('0x3c')]=_[_0xc1c7('0x80')](_0x176603['query']);_0x5698e9[_0xc1c7('0x3d')]=_[_0xc1c7('0x3e')](_0x5698e9[_0xc1c7('0x3a')],_0x5698e9[_0xc1c7('0x3c')]);_0x2ad4f5[_0xc1c7('0x3f')]=_[_0xc1c7('0x3e')](_0x5698e9['model'],qs[_0xc1c7('0x40')](_0x176603[_0xc1c7('0x3c')]['fields']));_0x2ad4f5['attributes']=_0x2ad4f5[_0xc1c7('0x3f')][_0xc1c7('0x41')]?_0x2ad4f5[_0xc1c7('0x3f')]:_0x5698e9[_0xc1c7('0x3a')];_0x2ad4f5[_0xc1c7('0x82')]=qs[_0xc1c7('0x44')](_0x176603['query'][_0xc1c7('0x44')]);_0x2ad4f5[_0xc1c7('0x45')]=qs[_0xc1c7('0x3d')](_[_0xc1c7('0x46')](_0x176603['query'],_0x5698e9[_0xc1c7('0x3d')]));if(_0x176603['query'][_0xc1c7('0x47')]){_0x2ad4f5['where']=_[_0xc1c7('0x48')](_0x2ad4f5[_0xc1c7('0x45')],{'$or':_['map'](_0x2ad4f5[_0xc1c7('0x3f')],function(_0x30e6ca){var _0x44aee1={};_0x44aee1[_0x30e6ca]={'$like':'%'+_0x176603[_0xc1c7('0x3c')][_0xc1c7('0x47')]+'%'};return _0x44aee1;})});}_0x2ad4f5=_[_0xc1c7('0x48')]({},_0x2ad4f5,_0x176603[_0xc1c7('0x4a')]);return _0x65161e[_0xc1c7('0x7e')](_0x2ad4f5);}})[_0xc1c7('0x2e')](function(_0xe1e5dd){if(_0xe1e5dd){_0x32c26e=_0xe1e5dd[_0xc1c7('0x41')];if(!_0x176603[_0xc1c7('0x3c')][_0xc1c7('0x42')](_0xc1c7('0x43'))){_0x2ad4f5[_0xc1c7('0x25')]=qs[_0xc1c7('0x25')](_0x176603[_0xc1c7('0x3c')][_0xc1c7('0x25')]);_0x2ad4f5[_0xc1c7('0x24')]=qs['offset'](_0x176603['query']['offset']);}return _0x65161e[_0xc1c7('0x7e')](_0x2ad4f5);}})['then'](function(_0x49c29b){if(_0x49c29b){return _0x49c29b?{'count':_0x32c26e,'rows':_0x49c29b}:null;}})['then'](respondWithResult(_0x48309e,null))[_0xc1c7('0x4f')](handleError(_0x48309e,null));};exports[_0xc1c7('0x83')]=function(_0x56cd17,_0x5d60e8,_0x57b04b){var _0x238077={};var _0x454b0d={};var _0x20a948;var _0x18b20f;return db[_0xc1c7('0x4b')][_0xc1c7('0x7f')]({'where':{'id':_0x56cd17['params']['id']}})[_0xc1c7('0x2e')](handleEntityNotFound(_0x5d60e8,null))[_0xc1c7('0x2e')](function(_0x2b9cff){if(_0x2b9cff){_0x20a948=_0x2b9cff;_0x454b0d['model']=_[_0xc1c7('0x80')](db[_0xc1c7('0x84')][_0xc1c7('0x36')]);_0x454b0d['query']=_[_0xc1c7('0x80')](_0x56cd17[_0xc1c7('0x3c')]);_0x454b0d[_0xc1c7('0x3d')]=_[_0xc1c7('0x3e')](_0x454b0d[_0xc1c7('0x3a')],_0x454b0d[_0xc1c7('0x3c')]);_0x238077[_0xc1c7('0x3f')]=_[_0xc1c7('0x3e')](_0x454b0d['model'],qs['fields'](_0x56cd17[_0xc1c7('0x3c')][_0xc1c7('0x40')]));_0x238077[_0xc1c7('0x3f')]=_0x238077['attributes'][_0xc1c7('0x41')]?_0x238077[_0xc1c7('0x3f')]:_0x454b0d[_0xc1c7('0x3a')];_0x238077[_0xc1c7('0x82')]=qs[_0xc1c7('0x44')](_0x56cd17['query'][_0xc1c7('0x44')]);_0x238077[_0xc1c7('0x45')]=qs[_0xc1c7('0x3d')](_[_0xc1c7('0x46')](_0x56cd17[_0xc1c7('0x3c')],_0x454b0d[_0xc1c7('0x3d')]));if(_0x56cd17[_0xc1c7('0x3c')][_0xc1c7('0x47')]){_0x238077[_0xc1c7('0x45')]=_[_0xc1c7('0x48')](_0x238077[_0xc1c7('0x45')],{'$or':_[_0xc1c7('0x35')](_0x238077[_0xc1c7('0x3f')],function(_0x38e932){var _0x265a7a={};_0x265a7a[_0x38e932]={'$like':'%'+_0x56cd17['query'][_0xc1c7('0x47')]+'%'};return _0x265a7a;})});}_0x238077=_[_0xc1c7('0x48')]({},_0x238077,_0x56cd17[_0xc1c7('0x4a')]);return _0x20a948[_0xc1c7('0x83')](_0x238077);}})[_0xc1c7('0x2e')](function(_0x4855ba){if(_0x4855ba){_0x18b20f=_0x4855ba[_0xc1c7('0x41')];if(!_0x56cd17['query'][_0xc1c7('0x42')](_0xc1c7('0x43'))){_0x238077[_0xc1c7('0x25')]=qs[_0xc1c7('0x25')](_0x56cd17['query'][_0xc1c7('0x25')]);_0x238077['offset']=qs[_0xc1c7('0x24')](_0x56cd17[_0xc1c7('0x3c')]['offset']);}return _0x20a948[_0xc1c7('0x83')](_0x238077);}})[_0xc1c7('0x2e')](function(_0x324a87){if(_0x324a87){return _0x324a87?{'count':_0x18b20f,'rows':_0x324a87}:null;}})['then'](respondWithResult(_0x5d60e8,null))[_0xc1c7('0x4f')](handleError(_0x5d60e8,null));};exports[_0xc1c7('0x85')]=function(_0x2b4a14,_0x18e4c4,_0x27edc3){var _0x4bae45=_0x2b4a14[_0xc1c7('0x57')]['ids'];var _0x183c59;return db['Team'][_0xc1c7('0x4d')]({'where':{'id':_0x4bae45},'attributes':['id'],'include':[{'model':db[_0xc1c7('0x81')],'as':_0xc1c7('0x86'),'attributes':['id','name',_0xc1c7('0x87'),_0xc1c7('0x88'),_0xc1c7('0x89')],'raw':!![]}]})[_0xc1c7('0x2e')](function(_0x4ccff5){if(_0x4ccff5){_0x183c59=_0x4ccff5;var _0x287d57=_[_0xc1c7('0x8a')](_0x4ccff5,function(_0x1732a5){var _0x20dccd=_0x1732a5[_0xc1c7('0x30')]({'plain':!![]});return _0x20dccd[_0xc1c7('0x86')];});return db[_0xc1c7('0x4b')][_0xc1c7('0x52')]({'where':{'id':_0x2b4a14[_0xc1c7('0x76')]['id']}})[_0xc1c7('0x2e')](function(_0x45e974){return db[_0xc1c7('0x54')][_0xc1c7('0x55')](function(_0x4d78b8){return _0x45e974[_0xc1c7('0x85')](_0x4bae45,{'transaction':_0x4d78b8})[_0xc1c7('0x2e')](function(){return BPromise['each'](_0x183c59,function(_0x125085){return db[_0xc1c7('0x8b')][_0xc1c7('0x8c')]({'TeamId':_0x125085['id'],'VoicePrefixId':_0x2b4a14[_0xc1c7('0x76')]['id']},{'transaction':_0x4d78b8});});})[_0xc1c7('0x2e')](function(){return BPromise[_0xc1c7('0x8d')](_0x287d57,function(_0x846c80){return db['UserVoicePrefix'][_0xc1c7('0x8e')]({'where':{'UserId':_0x846c80['id'],'VoicePrefixId':_0x2b4a14[_0xc1c7('0x76')]['id']},'transaction':_0x4d78b8});});})[_0xc1c7('0x2e')](function(){_0x287d57[_0xc1c7('0x8f')](function(_0x2a5267){socket['emit'](_0xc1c7('0x7a'),{'UserId':_0x2a5267['id'],'VoicePrefixId':_0x45e974['id']});});});});});}})[_0xc1c7('0x2e')](respondWithStatusCode(_0x18e4c4,null))[_0xc1c7('0x4f')](handleError(_0x18e4c4,null));};exports[_0xc1c7('0x90')]=function(_0x1bed9e,_0x39997a,_0x1273ae){return db['Team'][_0xc1c7('0x4d')]({'where':{'id':_0x1bed9e[_0xc1c7('0x3c')][_0xc1c7('0x78')]},'attributes':['id'],'include':[{'model':db[_0xc1c7('0x81')],'as':_0xc1c7('0x86'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x39997a,null))[_0xc1c7('0x2e')](function(_0x1e7149){var _0x23d84c=_[_0xc1c7('0x35')](_0x1e7149,'id');var _0x22052c=[];var _0x2ca2c1=[];var _0x1f926a=squel[_0xc1c7('0x91')]();_0x1f926a['field'](_0xc1c7('0x92'))[_0xc1c7('0x93')](_0xc1c7('0x94'),'tq')['join'](_0xc1c7('0x95'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc1c7('0x45')](_0xc1c7('0x96'),_0x1bed9e[_0xc1c7('0x76')]['id']);for(var _0x146e74=0x0;_0x146e74<_0x1e7149[_0xc1c7('0x41')];_0x146e74+=0x1){let _0x3f10ac=_0x1e7149[_0x146e74];for(var _0x3a5abd=0x0;_0x3a5abd<_0x3f10ac[_0xc1c7('0x86')][_0xc1c7('0x41')];_0x3a5abd+=0x1){let _0x494ba4=_0x3f10ac[_0xc1c7('0x86')][_0x3a5abd];var _0x4fead5=_0x1f926a[_0xc1c7('0x97')]();_0x4fead5[_0xc1c7('0x45')](_0xc1c7('0x98'),_0x494ba4['id']);_0x2ca2c1[_0xc1c7('0x6a')](db[_0xc1c7('0x54')][_0xc1c7('0x3c')](_0x4fead5[_0xc1c7('0x99')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0xc1c7('0x2e')](function(_0x198e78){if(_0x198e78[_0xc1c7('0x41')]===0x1){return _0x494ba4['id'];}else{var _0xde9a91=_[_0xc1c7('0x9a')](_['map'](_0x198e78,_0xc1c7('0x9b')),function(_0x3d6078){return _[_0xc1c7('0x9c')](_0x23d84c,_0x3d6078);});if(_0xde9a91){return _0x494ba4['id'];}}}));}}return BPromise[_0xc1c7('0x9d')](_0x2ca2c1)[_0xc1c7('0x2e')](function(_0x3f0e2c){_0x22052c=_(_0x22052c)[_0xc1c7('0x9e')](_0x3f0e2c)['compact']()[_0xc1c7('0x9f')]();return db[_0xc1c7('0x4b')]['find']({'where':{'id':_0x1bed9e['params']['id']}})[_0xc1c7('0x2e')](function(_0x2801fb){return db[_0xc1c7('0x54')][_0xc1c7('0x55')](function(_0x43c3c3){return _0x2801fb[_0xc1c7('0x90')](_0x1bed9e[_0xc1c7('0x3c')][_0xc1c7('0x78')],{'transaction':_0x43c3c3})[_0xc1c7('0x2e')](function(){if(!_['isEmpty'](_0x22052c)){return _0x2801fb['removeAgents'](_0x22052c,{'transaction':_0x43c3c3});}})[_0xc1c7('0x2e')](function(){_0x22052c['forEach'](function(_0x479d8a){socket[_0xc1c7('0x79')](_0xc1c7('0x7d'),{'UserId':_0x479d8a,'VoicePrefixId':_0x2801fb['id']});});});});});});})[_0xc1c7('0x2e')](respondWithStatusCode(_0x39997a,null))[_0xc1c7('0x4f')](handleError(_0x39997a,null));}; \ No newline at end of file +var _0xa30a=['priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','push','PREFIX-CALLERIDALL=','charAt','body','VoiceExtensionId','findById','addAgents','ids','omit','spread','emit','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','order','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','TeamVoicePrefix','upsert','findOrCreate','userVoicePrefix:save','removeTeams','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','forEach','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','type','map','keys','filters','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','find','params','describe','create','transaction','VoiceExtension','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','description','Voice\x20Prefix\x20Extension'];(function(_0x5197d7,_0xdeff79){var _0x4ccf01=function(_0x3c7e3e){while(--_0x3c7e3e){_0x5197d7['push'](_0x5197d7['shift']());}};_0x4ccf01(++_0xdeff79);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xaa30('0x0'));var rimraf=require(_0xaa30('0x1'));var zipdir=require(_0xaa30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa30('0x3'));var moment=require(_0xaa30('0x4'));var BPromise=require(_0xaa30('0x5'));var Mustache=require(_0xaa30('0x6'));var util=require(_0xaa30('0x7'));var path=require(_0xaa30('0x8'));var sox=require(_0xaa30('0x9'));var csv=require('to-csv');var ejs=require(_0xaa30('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xf'));var querystring=require(_0xaa30('0x10'));var Papa=require(_0xaa30('0x11'));var Redis=require(_0xaa30('0x12'));var authService=require(_0xaa30('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa30('0x14'));var logger=require('../../config/logger')(_0xaa30('0x15'));var utils=require(_0xaa30('0x16'));var config=require(_0xaa30('0x17'));var licenseUtil=require(_0xaa30('0x18'));var db=require('../../mysqldb')['db'];config[_0xaa30('0x19')]=_[_0xaa30('0x1a')](config[_0xaa30('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa30('0x1b'))(new Redis(config[_0xaa30('0x19')]));require(_0xaa30('0x1c'))[_0xaa30('0x1d')](socket);function respondWithStatusCode(_0x41f1d9,_0x31aa0b){_0x31aa0b=_0x31aa0b||0xcc;return function(_0x3240e9){if(_0x3240e9){return _0x41f1d9[_0xaa30('0x1e')](_0x31aa0b);}return _0x41f1d9[_0xaa30('0x1f')](_0x31aa0b)[_0xaa30('0x20')]();};}function respondWithResult(_0x519518,_0x91839d){_0x91839d=_0x91839d||0xc8;return function(_0x591478){if(_0x591478){return _0x519518['status'](_0x91839d)[_0xaa30('0x21')](_0x591478);}};}function respondWithFilteredResult(_0x153939,_0x130606){return function(_0x540e36){if(_0x540e36){var _0x54fa49=typeof _0x130606['offset']===_0xaa30('0x22')&&typeof _0x130606['limit']===_0xaa30('0x22');var _0x332a0a=_0x540e36['count'];var _0x4e29f9=_0x54fa49?0x0:_0x130606['offset'];var _0x3cbf92=_0x54fa49?_0x540e36[_0xaa30('0x23')]:_0x130606[_0xaa30('0x24')]+_0x130606[_0xaa30('0x25')];var _0x43a526;if(_0x3cbf92>=_0x332a0a){_0x3cbf92=_0x332a0a;_0x43a526=0xc8;}else{_0x43a526=0xce;}_0x153939['status'](_0x43a526);return _0x153939[_0xaa30('0x26')](_0xaa30('0x27'),_0x4e29f9+'-'+_0x3cbf92+'/'+_0x332a0a)[_0xaa30('0x21')](_0x540e36);}return null;};}function patchUpdates(_0x2d9e35){return function(_0x1ff442){try{jsonpatch['apply'](_0x1ff442,_0x2d9e35,!![]);}catch(_0x325b42){return BPromise[_0xaa30('0x28')](_0x325b42);}return _0x1ff442[_0xaa30('0x29')]();};}function saveUpdates(_0x326f84,_0x57d1ca){return function(_0x14d7fa){if(_0x14d7fa){return _0x14d7fa[_0xaa30('0x2a')](_0x326f84)[_0xaa30('0x2b')](function(_0x12da2f){return _0x12da2f;});}return null;};}function removeEntity(_0x97b038,_0x2a59ce){return function(_0x55cccb){if(_0x55cccb){return _0x55cccb[_0xaa30('0x2c')]()[_0xaa30('0x2b')](function(){var _0x5d4da8=_0x55cccb[_0xaa30('0x2d')]({'plain':!![]});var _0x5b3efb=_0xaa30('0x2e');return db[_0xaa30('0x2f')][_0xaa30('0x2c')]({'where':{'type':_0x5b3efb,'resourceId':_0x5d4da8['id']}})[_0xaa30('0x2b')](function(){return _0x55cccb;});})[_0xaa30('0x2b')](function(){_0x97b038[_0xaa30('0x1f')](0xcc)[_0xaa30('0x20')]();});}};}function handleEntityNotFound(_0x39f708,_0x1f288c){return function(_0x43fb30){if(!_0x43fb30){_0x39f708[_0xaa30('0x1e')](0x194);}return _0x43fb30;};}function handleError(_0x43003f,_0x2038a6){_0x2038a6=_0x2038a6||0x1f4;return function(_0x46abb9){logger[_0xaa30('0x30')](_0x46abb9[_0xaa30('0x31')]);if(_0x46abb9[_0xaa30('0x32')]){delete _0x46abb9[_0xaa30('0x32')];}_0x43003f['status'](_0x2038a6)[_0xaa30('0x33')](_0x46abb9);};}exports[_0xaa30('0x34')]=function(_0x3bc22f,_0x20916f){var _0x2276e0={},_0x1dce4a={},_0x4dae71={'count':0x0,'rows':[]};var _0x5addbf=_['map'](db[_0xaa30('0x35')][_0xaa30('0x36')],function(_0xb48ef3){return{'name':_0xb48ef3[_0xaa30('0x37')],'type':_0xb48ef3[_0xaa30('0x38')]['key']};});_0x1dce4a['model']=_[_0xaa30('0x39')](_0x5addbf,_0xaa30('0x32'));_0x1dce4a['query']=_[_0xaa30('0x3a')](_0x3bc22f['query']);_0x1dce4a[_0xaa30('0x3b')]=_['intersection'](_0x1dce4a[_0xaa30('0x3c')],_0x1dce4a[_0xaa30('0x3d')]);_0x2276e0['attributes']=_[_0xaa30('0x3e')](_0x1dce4a[_0xaa30('0x3c')],qs[_0xaa30('0x3f')](_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x3f')]));_0x2276e0[_0xaa30('0x40')]=_0x2276e0['attributes'][_0xaa30('0x41')]?_0x2276e0[_0xaa30('0x40')]:_0x1dce4a['model'];if(!_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x42')](_0xaa30('0x43'))){_0x2276e0['limit']=qs['limit'](_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x25')]);_0x2276e0[_0xaa30('0x24')]=qs[_0xaa30('0x24')](_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x24')]);}_0x2276e0['order']=qs['sort'](_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x44')]);_0x2276e0[_0xaa30('0x45')]=qs['filters'](_[_0xaa30('0x46')](_0x3bc22f[_0xaa30('0x3d')],_0x1dce4a[_0xaa30('0x3b')]),_0x5addbf);if(_0x3bc22f[_0xaa30('0x3d')]['filter']){_0x2276e0[_0xaa30('0x45')]=_[_0xaa30('0x47')](_0x2276e0[_0xaa30('0x45')],{'$or':_[_0xaa30('0x39')](_0x5addbf,function(_0x1f6f53){if(_0x1f6f53['type']!==_0xaa30('0x48')){var _0x29cf85={};_0x29cf85[_0x1f6f53[_0xaa30('0x32')]]={'$like':'%'+_0x3bc22f[_0xaa30('0x3d')][_0xaa30('0x49')]+'%'};return _0x29cf85;}})});}_0x2276e0=_[_0xaa30('0x47')]({},_0x2276e0,_0x3bc22f[_0xaa30('0x4a')]);var _0x17510b={'where':_0x2276e0['where']};return db['VoicePrefix'][_0xaa30('0x23')](_0x17510b)['then'](function(_0x5208f8){_0x4dae71['count']=_0x5208f8;if(_0x3bc22f[_0xaa30('0x3d')]['includeAll']){_0x2276e0[_0xaa30('0x4b')]=[{'all':!![]}];}return db['VoicePrefix'][_0xaa30('0x4c')](_0x2276e0);})[_0xaa30('0x2b')](function(_0x3f530e){_0x4dae71[_0xaa30('0x4d')]=_0x3f530e;return _0x4dae71;})[_0xaa30('0x2b')](respondWithFilteredResult(_0x20916f,_0x2276e0))[_0xaa30('0x4e')](handleError(_0x20916f,null));};exports[_0xaa30('0x4f')]=function(_0xc1ae21,_0x3302ff){var _0x521462={'raw':![],'where':{'id':_0xc1ae21['params']['id']}},_0x334639={};_0x334639[_0xaa30('0x3c')]=_[_0xaa30('0x3a')](db[_0xaa30('0x35')][_0xaa30('0x36')]);_0x334639[_0xaa30('0x3d')]=_['keys'](_0xc1ae21['query']);_0x334639[_0xaa30('0x3b')]=_['intersection'](_0x334639[_0xaa30('0x3c')],_0x334639[_0xaa30('0x3d')]);_0x521462[_0xaa30('0x40')]=_[_0xaa30('0x3e')](_0x334639[_0xaa30('0x3c')],qs[_0xaa30('0x3f')](_0xc1ae21[_0xaa30('0x3d')]['fields']));_0x521462[_0xaa30('0x40')]=_0x521462[_0xaa30('0x40')][_0xaa30('0x41')]?_0x521462['attributes']:_0x334639[_0xaa30('0x3c')];if(_0xc1ae21[_0xaa30('0x3d')]['includeAll']){_0x521462[_0xaa30('0x4b')]=[{'all':!![]}];}_0x521462=_['merge']({},_0x521462,_0xc1ae21[_0xaa30('0x4a')]);return db['VoicePrefix']['find'](_0x521462)[_0xaa30('0x2b')](handleEntityNotFound(_0x3302ff,null))['then'](respondWithResult(_0x3302ff,null))['catch'](handleError(_0x3302ff,null));};exports[_0xaa30('0x2c')]=function(_0x1083e2,_0x2574f5){return db[_0xaa30('0x35')][_0xaa30('0x50')]({'where':{'id':_0x1083e2[_0xaa30('0x51')]['id']}})['then'](handleEntityNotFound(_0x2574f5,null))[_0xaa30('0x2b')](removeEntity(_0x2574f5,null))[_0xaa30('0x4e')](handleError(_0x2574f5,null));};exports[_0xaa30('0x52')]=function(_0x57a5fa,_0x53bcaa){return db['VoicePrefix']['describe']()[_0xaa30('0x2b')](respondWithResult(_0x53bcaa,null))[_0xaa30('0x4e')](handleError(_0x53bcaa,null));};exports[_0xaa30('0x53')]=function(_0x1d5c15,_0x1cb3f9){var _0x1ed257;return db['sequelize'][_0xaa30('0x54')](function(_0x2db9d5){return db[_0xaa30('0x35')][_0xaa30('0x53')](_0x1d5c15['body'],{'transaction':_0x2db9d5})[_0xaa30('0x2b')](function(_0x2d23f8){_0x1ed257=_0x2d23f8[_0xaa30('0x2d')]({'plain':!![]});return db[_0xaa30('0x55')][_0xaa30('0x50')]({'where':{'id':_0x1ed257['VoiceExtensionId']},'raw':!![]})['then'](function(_0x34ca1c){return createVoicePrefixExtensions(_0x1ed257,_0x34ca1c,_0x2db9d5);});});})[_0xaa30('0x2b')](function(){var _0x3c4f07=_0x1d5c15['user'][_0xaa30('0x2d')]({'plain':!![]});if(!_0x3c4f07)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c4f07[_0xaa30('0x56')]===_0xaa30('0x57')){var _0x483a01=_0x1ed257;return db[_0xaa30('0x58')][_0xaa30('0x50')]({'where':{'name':'VoicePrefixes','userProfileId':_0x3c4f07[_0xaa30('0x59')]},'raw':!![]})['then'](function(_0x5b227d){if(_0x5b227d&&_0x5b227d[_0xaa30('0x5a')]===0x0){return db[_0xaa30('0x2f')][_0xaa30('0x53')]({'name':_0x483a01['name'],'resourceId':_0x483a01['id'],'type':_0x5b227d[_0xaa30('0x32')],'sectionId':_0x5b227d['id']},{})[_0xaa30('0x2b')](function(){return _0x1ed257;});}else{return _0x1ed257;}})[_0xaa30('0x4e')](function(_0x949d84){logger[_0xaa30('0x30')](_0xaa30('0x5b'),_0x949d84);throw _0x949d84;});}return _0x1ed257;})[_0xaa30('0x2b')](respondWithResult(_0x1cb3f9,null))[_0xaa30('0x4e')](handleError(_0x1cb3f9,null));};function Extension(_0x242b5a,_0x426b90,_0xb1afa8,_0x2f84fa){this[_0xaa30('0x5c')]='from-sip';this[_0xaa30('0x5d')]=_0x242b5a;this[_0xaa30('0x5e')]=_0xb1afa8;this[_0xaa30('0x38')]='system';this[_0xaa30('0x5f')]=_0xaa30('0x60');this[_0xaa30('0x61')]=_0x426b90;this[_0xaa30('0x62')]=_0x2f84fa;}function createVoicePrefixExtensions(_0x9ee658,_0x2c5959,_0x4f1d54){return new BPromise(function(_0x366205,_0x4f5222){var _0x36242e=new Extension(formatPrefixName(_0x9ee658[_0xaa30('0x63')]),0x1,_0xaa30('0x64'),_0xaa30('0x65'));_0x36242e['VoicePrefixId']=_0x9ee658['id'];return db[_0xaa30('0x55')][_0xaa30('0x53')](_0x36242e,{'transaction':_0x4f1d54})['then'](function(_0x26f6f9){var _0x62b307=_0x26f6f9[_0xaa30('0x2d')]({'plain':!![]});var _0x16097e=_[_0xaa30('0x39')](addVoicePrefixExtensions(_0x9ee658,_0x2c5959),function(_0x13ee8f){_0x13ee8f['VoiceExtensionId']=_0x62b307['id'];_0x13ee8f[_0xaa30('0x66')]=_0x9ee658['id'];return _0x13ee8f;});return db[_0xaa30('0x55')][_0xaa30('0x67')](_0x16097e,{'transaction':_0x4f1d54})[_0xaa30('0x2b')](function(_0x334ef1){if(!_0x334ef1){return _0x4f5222(_0xaa30('0x68'));}else{return _0x366205(_0x334ef1);}})[_0xaa30('0x4e')](function(_0x42da00){return _0x4f5222(_0x42da00);});});;});};function addVoicePrefixExtensions(_0x4318a2,_0x6c968e){var _0x46bdc4=[];var _0x2f4d77=formatPrefixName(_0x4318a2[_0xaa30('0x63')]);_0x46bdc4['push'](new Extension(_0x2f4d77,0x2,_0xaa30('0x69'),'CDR(prefix)='+_0x4318a2[_0xaa30('0x32')]));if(_0x4318a2['callerIdAll']){_0x46bdc4[_0xaa30('0x6a')](new Extension(_0x2f4d77,0x3,_0xaa30('0x69'),_0xaa30('0x6b')+_0x4318a2['callerIdAll']));}else{_0x46bdc4[_0xaa30('0x6a')](new Extension(_0x2f4d77,0x3,_0xaa30('0x64'),'No\x20callerid\x20available'));}_0x46bdc4[_0xaa30('0x6a')](new Extension(_0x2f4d77,0x4,'goto',_0x6c968e[_0xaa30('0x5c')]+','+'${EXTEN:'+(0x8+_0x4318a2['name'][_0xaa30('0x41')])+'}'+','+0x1));return _0x46bdc4;}function formatPrefixName(_0x99d382){var _0xd3e52e='_';for(var _0x313bfa=0x0;_0x313bfa<_0x99d382[_0xaa30('0x41')];_0x313bfa++){if(_0x99d382[_0xaa30('0x6c')](_0x313bfa)=='-'){_0xd3e52e+=_0x99d382[_0xaa30('0x6c')](_0x313bfa);}else{_0xd3e52e+='['+_0x99d382['charAt'](_0x313bfa)+']';}}_0xd3e52e+='.';return _0xd3e52e;}exports[_0xaa30('0x2a')]=function(_0x3f2683,_0x1386a9,_0x4aeb5d){var _0x1f8a61=_0x3f2683[_0xaa30('0x6d')];_0x1f8a61[_0xaa30('0x63')]='system-'+_0x1f8a61[_0xaa30('0x32')]+'-';return db['sequelize'][_0xaa30('0x54')](function(_0x4d2787){return db['VoicePrefix'][_0xaa30('0x2a')](_0x1f8a61,{'where':{'id':_0x1f8a61['id']},'transaction':_0x4d2787})[_0xaa30('0x2b')](function(){return db['VoiceExtension'][_0xaa30('0x2c')]({'where':{'VoicePrefixId':_0x1f8a61['id']},'transaction':_0x4d2787})[_0xaa30('0x2b')](function(){return db[_0xaa30('0x55')]['find']({'where':{'id':_0x1f8a61[_0xaa30('0x6e')]},'raw':!![]})[_0xaa30('0x2b')](function(_0x23daeb){return createVoicePrefixExtensions(_0x1f8a61,_0x23daeb,_0x4d2787);});});});})[_0xaa30('0x2b')](function(){return db[_0xaa30('0x35')][_0xaa30('0x6f')](_0x1f8a61['id']);})[_0xaa30('0x2b')](respondWithResult(_0x1386a9,null))['catch'](handleError(_0x1386a9,null));};exports[_0xaa30('0x70')]=function(_0x37c3ee,_0x112dc3,_0x25977d){return db['VoicePrefix'][_0xaa30('0x50')]({'where':{'id':_0x37c3ee[_0xaa30('0x51')]['id']}})['then'](handleEntityNotFound(_0x112dc3,null))[_0xaa30('0x2b')](function(_0x2d9dd8){if(_0x2d9dd8){return _0x2d9dd8[_0xaa30('0x70')](_0x37c3ee[_0xaa30('0x6d')][_0xaa30('0x71')],_[_0xaa30('0x72')](_0x37c3ee['body'],[_0xaa30('0x71'),'id'])||{})[_0xaa30('0x73')](function(_0x5948b4){for(var _0x2aa0ce=0x0;_0x2aa0ce<_0x37c3ee[_0xaa30('0x6d')][_0xaa30('0x71')][_0xaa30('0x41')];_0x2aa0ce+=0x1){socket[_0xaa30('0x74')]('userVoicePrefix:save',{'UserId':Number(_0x37c3ee[_0xaa30('0x6d')][_0xaa30('0x71')][_0x2aa0ce]),'VoicePrefixId':Number(_0x37c3ee[_0xaa30('0x51')]['id'])});}return _0x5948b4;});}})[_0xaa30('0x2b')](respondWithResult(_0x112dc3,null))[_0xaa30('0x4e')](handleError(_0x112dc3,null));};exports[_0xaa30('0x75')]=function(_0x5d3d83,_0x1e3a19,_0x467134){return db['VoicePrefix']['find']({'where':{'id':_0x5d3d83[_0xaa30('0x51')]['id']}})[_0xaa30('0x2b')](handleEntityNotFound(_0x1e3a19,null))[_0xaa30('0x2b')](function(_0x100f18){if(_0x100f18){return _0x100f18[_0xaa30('0x75')](_0x5d3d83[_0xaa30('0x3d')][_0xaa30('0x71')])['then'](function(){if(_['isArray'](_0x5d3d83['query'][_0xaa30('0x71')])){for(var _0x25ebba=0x0;_0x25ebba<_0x5d3d83[_0xaa30('0x3d')][_0xaa30('0x71')][_0xaa30('0x41')];_0x25ebba+=0x1){socket['emit'](_0xaa30('0x76'),{'UserId':Number(_0x5d3d83[_0xaa30('0x3d')][_0xaa30('0x71')][_0x25ebba]),'VoicePrefixId':Number(_0x5d3d83[_0xaa30('0x51')]['id'])});}}else{socket[_0xaa30('0x74')](_0xaa30('0x76'),{'UserId':Number(_0x5d3d83[_0xaa30('0x3d')][_0xaa30('0x71')]),'VoicePrefixId':Number(_0x5d3d83['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1e3a19,null))['catch'](handleError(_0x1e3a19,null));};exports[_0xaa30('0x77')]=function(_0x408362,_0x541d3b,_0x775047){var _0xe9e4={};var _0x15e3ae={};var _0x33551c;var _0x404f82;return db['VoicePrefix'][_0xaa30('0x78')]({'where':{'id':_0x408362[_0xaa30('0x51')]['id']}})[_0xaa30('0x2b')](handleEntityNotFound(_0x541d3b,null))['then'](function(_0x21b87b){if(_0x21b87b){_0x33551c=_0x21b87b;_0x15e3ae[_0xaa30('0x3c')]=_[_0xaa30('0x3a')](db[_0xaa30('0x79')][_0xaa30('0x36')]);_0x15e3ae[_0xaa30('0x3d')]=_[_0xaa30('0x3a')](_0x408362['query']);_0x15e3ae[_0xaa30('0x3b')]=_[_0xaa30('0x3e')](_0x15e3ae[_0xaa30('0x3c')],_0x15e3ae[_0xaa30('0x3d')]);_0xe9e4[_0xaa30('0x40')]=_[_0xaa30('0x3e')](_0x15e3ae[_0xaa30('0x3c')],qs[_0xaa30('0x3f')](_0x408362[_0xaa30('0x3d')][_0xaa30('0x3f')]));_0xe9e4[_0xaa30('0x40')]=_0xe9e4[_0xaa30('0x40')][_0xaa30('0x41')]?_0xe9e4['attributes']:_0x15e3ae[_0xaa30('0x3c')];_0xe9e4['order']=qs[_0xaa30('0x44')](_0x408362[_0xaa30('0x3d')][_0xaa30('0x44')]);_0xe9e4[_0xaa30('0x45')]=qs[_0xaa30('0x3b')](_[_0xaa30('0x46')](_0x408362[_0xaa30('0x3d')],_0x15e3ae[_0xaa30('0x3b')]));if(_0x408362[_0xaa30('0x3d')][_0xaa30('0x49')]){_0xe9e4[_0xaa30('0x45')]=_[_0xaa30('0x47')](_0xe9e4[_0xaa30('0x45')],{'$or':_[_0xaa30('0x39')](_0xe9e4[_0xaa30('0x40')],function(_0x3744b3){var _0x35a47f={};_0x35a47f[_0x3744b3]={'$like':'%'+_0x408362[_0xaa30('0x3d')][_0xaa30('0x49')]+'%'};return _0x35a47f;})});}_0xe9e4=_['merge']({},_0xe9e4,_0x408362[_0xaa30('0x4a')]);return _0x33551c[_0xaa30('0x77')](_0xe9e4);}})[_0xaa30('0x2b')](function(_0x3a67b3){if(_0x3a67b3){_0x404f82=_0x3a67b3[_0xaa30('0x41')];if(!_0x408362[_0xaa30('0x3d')][_0xaa30('0x42')]('nolimit')){_0xe9e4[_0xaa30('0x25')]=qs[_0xaa30('0x25')](_0x408362['query'][_0xaa30('0x25')]);_0xe9e4[_0xaa30('0x24')]=qs['offset'](_0x408362[_0xaa30('0x3d')][_0xaa30('0x24')]);}return _0x33551c[_0xaa30('0x77')](_0xe9e4);}})[_0xaa30('0x2b')](function(_0x5eb209){if(_0x5eb209){return _0x5eb209?{'count':_0x404f82,'rows':_0x5eb209}:null;}})[_0xaa30('0x2b')](respondWithResult(_0x541d3b,null))['catch'](handleError(_0x541d3b,null));};exports[_0xaa30('0x7a')]=function(_0x41480f,_0x24f60f,_0x3fb561){var _0x24a3af={};var _0x4412d4={};var _0x45ffba;var _0x2e73e1;return db[_0xaa30('0x35')]['findOne']({'where':{'id':_0x41480f[_0xaa30('0x51')]['id']}})[_0xaa30('0x2b')](handleEntityNotFound(_0x24f60f,null))['then'](function(_0x1f48c1){if(_0x1f48c1){_0x45ffba=_0x1f48c1;_0x4412d4[_0xaa30('0x3c')]=_['keys'](db[_0xaa30('0x7b')][_0xaa30('0x36')]);_0x4412d4['query']=_[_0xaa30('0x3a')](_0x41480f['query']);_0x4412d4['filters']=_[_0xaa30('0x3e')](_0x4412d4[_0xaa30('0x3c')],_0x4412d4['query']);_0x24a3af['attributes']=_[_0xaa30('0x3e')](_0x4412d4[_0xaa30('0x3c')],qs['fields'](_0x41480f[_0xaa30('0x3d')]['fields']));_0x24a3af['attributes']=_0x24a3af[_0xaa30('0x40')]['length']?_0x24a3af[_0xaa30('0x40')]:_0x4412d4['model'];_0x24a3af[_0xaa30('0x7c')]=qs[_0xaa30('0x44')](_0x41480f[_0xaa30('0x3d')][_0xaa30('0x44')]);_0x24a3af[_0xaa30('0x45')]=qs[_0xaa30('0x3b')](_[_0xaa30('0x46')](_0x41480f[_0xaa30('0x3d')],_0x4412d4[_0xaa30('0x3b')]));if(_0x41480f['query']['filter']){_0x24a3af[_0xaa30('0x45')]=_[_0xaa30('0x47')](_0x24a3af[_0xaa30('0x45')],{'$or':_['map'](_0x24a3af['attributes'],function(_0x46df1d){var _0x554b6b={};_0x554b6b[_0x46df1d]={'$like':'%'+_0x41480f[_0xaa30('0x3d')][_0xaa30('0x49')]+'%'};return _0x554b6b;})});}_0x24a3af=_[_0xaa30('0x47')]({},_0x24a3af,_0x41480f[_0xaa30('0x4a')]);return _0x45ffba['getTeams'](_0x24a3af);}})[_0xaa30('0x2b')](function(_0x5d061b){if(_0x5d061b){_0x2e73e1=_0x5d061b[_0xaa30('0x41')];if(!_0x41480f[_0xaa30('0x3d')][_0xaa30('0x42')](_0xaa30('0x43'))){_0x24a3af['limit']=qs[_0xaa30('0x25')](_0x41480f[_0xaa30('0x3d')]['limit']);_0x24a3af[_0xaa30('0x24')]=qs['offset'](_0x41480f[_0xaa30('0x3d')]['offset']);}return _0x45ffba[_0xaa30('0x7a')](_0x24a3af);}})[_0xaa30('0x2b')](function(_0x11dd5e){if(_0x11dd5e){return _0x11dd5e?{'count':_0x2e73e1,'rows':_0x11dd5e}:null;}})[_0xaa30('0x2b')](respondWithResult(_0x24f60f,null))[_0xaa30('0x4e')](handleError(_0x24f60f,null));};exports[_0xaa30('0x7d')]=function(_0x2f90db,_0x3f382a,_0x36f739){var _0x5687ef=_0x2f90db[_0xaa30('0x6d')][_0xaa30('0x71')];var _0x21e8c7;return db['Team'][_0xaa30('0x4c')]({'where':{'id':_0x5687ef},'attributes':['id'],'include':[{'model':db[_0xaa30('0x79')],'as':_0xaa30('0x7e'),'attributes':['id',_0xaa30('0x32'),_0xaa30('0x7f'),_0xaa30('0x80'),_0xaa30('0x81')],'raw':!![]}]})[_0xaa30('0x2b')](function(_0x16e95c){if(_0x16e95c){_0x21e8c7=_0x16e95c;var _0x4dc93c=_[_0xaa30('0x82')](_0x16e95c,function(_0x25dca3){var _0x13521a=_0x25dca3['get']({'plain':!![]});return _0x13521a[_0xaa30('0x7e')];});return db[_0xaa30('0x35')]['find']({'where':{'id':_0x2f90db[_0xaa30('0x51')]['id']}})['then'](function(_0x51a37a){return db[_0xaa30('0x83')][_0xaa30('0x54')](function(_0xcf7c59){return _0x51a37a[_0xaa30('0x7d')](_0x5687ef,{'transaction':_0xcf7c59})['then'](function(){return BPromise['each'](_0x21e8c7,function(_0x4240d0){return db[_0xaa30('0x84')][_0xaa30('0x85')]({'TeamId':_0x4240d0['id'],'VoicePrefixId':_0x2f90db[_0xaa30('0x51')]['id']},{'transaction':_0xcf7c59});});})[_0xaa30('0x2b')](function(){return BPromise['each'](_0x4dc93c,function(_0x7db5d7){return db['UserVoicePrefix'][_0xaa30('0x86')]({'where':{'UserId':_0x7db5d7['id'],'VoicePrefixId':_0x2f90db[_0xaa30('0x51')]['id']},'transaction':_0xcf7c59});});})[_0xaa30('0x2b')](function(){_0x4dc93c['forEach'](function(_0x1c25b1){socket[_0xaa30('0x74')](_0xaa30('0x87'),{'UserId':_0x1c25b1['id'],'VoicePrefixId':_0x51a37a['id']});});});});});}})[_0xaa30('0x2b')](respondWithStatusCode(_0x3f382a,null))[_0xaa30('0x4e')](handleError(_0x3f382a,null));};exports[_0xaa30('0x88')]=function(_0x51fb85,_0x133a0f,_0x1bd3c2){return db['Team']['findAll']({'where':{'id':_0x51fb85[_0xaa30('0x3d')][_0xaa30('0x71')]},'attributes':['id'],'include':[{'model':db[_0xaa30('0x79')],'as':_0xaa30('0x7e'),'attributes':['id'],'raw':!![]}]})[_0xaa30('0x2b')](handleEntityNotFound(_0x133a0f,null))[_0xaa30('0x2b')](function(_0x3dd250){var _0x2ec205=_[_0xaa30('0x39')](_0x3dd250,'id');var _0x211916=[];var _0x4bba25=[];var _0x73c665=squel['select']();_0x73c665['field'](_0xaa30('0x89'))[_0xaa30('0x8a')](_0xaa30('0x8b'),'tq')['join'](_0xaa30('0x8c'),'ut',_0xaa30('0x8d'))['where'](_0xaa30('0x8e'),_0x51fb85[_0xaa30('0x51')]['id']);for(var _0x2ebaa0=0x0;_0x2ebaa0<_0x3dd250[_0xaa30('0x41')];_0x2ebaa0+=0x1){let _0x420276=_0x3dd250[_0x2ebaa0];for(var _0x2c48a2=0x0;_0x2c48a2<_0x420276['Agents'][_0xaa30('0x41')];_0x2c48a2+=0x1){let _0x206fc4=_0x420276[_0xaa30('0x7e')][_0x2c48a2];var _0x24fccc=_0x73c665[_0xaa30('0x8f')]();_0x24fccc[_0xaa30('0x45')](_0xaa30('0x90'),_0x206fc4['id']);_0x4bba25['push'](db['sequelize'][_0xaa30('0x3d')](_0x24fccc[_0xaa30('0x91')](),{'type':db[_0xaa30('0x83')][_0xaa30('0x92')][_0xaa30('0x93')]})[_0xaa30('0x2b')](function(_0x162810){if(_0x162810[_0xaa30('0x41')]===0x1){return _0x206fc4['id'];}else{var _0x2ed461=_[_0xaa30('0x94')](_[_0xaa30('0x39')](_0x162810,'TeamId'),function(_0x5c21e){return _[_0xaa30('0x95')](_0x2ec205,_0x5c21e);});if(_0x2ed461){return _0x206fc4['id'];}}}));}}return BPromise[_0xaa30('0x96')](_0x4bba25)[_0xaa30('0x2b')](function(_0x46c9a5){_0x211916=_(_0x211916)[_0xaa30('0x97')](_0x46c9a5)[_0xaa30('0x98')]()[_0xaa30('0x99')]();return db[_0xaa30('0x35')][_0xaa30('0x50')]({'where':{'id':_0x51fb85[_0xaa30('0x51')]['id']}})[_0xaa30('0x2b')](function(_0x4cc3f0){return db[_0xaa30('0x83')][_0xaa30('0x54')](function(_0x31bdf6){return _0x4cc3f0['removeTeams'](_0x51fb85['query'][_0xaa30('0x71')],{'transaction':_0x31bdf6})['then'](function(){if(!_[_0xaa30('0x9a')](_0x211916)){return _0x4cc3f0['removeAgents'](_0x211916,{'transaction':_0x31bdf6});}})[_0xaa30('0x2b')](function(){_0x211916[_0xaa30('0x9b')](function(_0xb148d9){socket[_0xaa30('0x74')]('userVoicePrefix:remove',{'UserId':_0xb148d9,'VoicePrefixId':_0x4cc3f0['id']});});});});});});})[_0xaa30('0x2b')](respondWithStatusCode(_0x133a0f,null))[_0xaa30('0x4e')](handleError(_0x133a0f,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 3a1c542..da125a8 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 _0x864c=['hasOwnProperty','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove','emit'];(function(_0x18d272,_0x22a8cc){var _0x329899=function(_0x36834a){while(--_0x36834a){_0x18d272['push'](_0x18d272['shift']());}};_0x329899(++_0x22a8cc);}(_0x864c,0x1e8));var _0xc864=function(_0x2c3211,_0x545a69){_0x2c3211=_0x2c3211-0x0;var _0x502975=_0x864c[_0x2c3211];return _0x502975;};'use strict';var EventEmitter=require(_0xc864('0x0'));var VoicePrefix=require(_0xc864('0x1'))['db'][_0xc864('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc864('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc864('0x4'),'afterDestroy':_0xc864('0x5')};function emitEvent(_0x5bde7e){return function(_0x307484,_0x3c6524,_0x433634){VoicePrefixEvents['emit'](_0x5bde7e+':'+_0x307484['id'],_0x307484);VoicePrefixEvents[_0xc864('0x6')](_0x5bde7e,_0x307484);_0x433634(null);};}for(var e in events){if(events[_0xc864('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xc864('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x505d=['remove','emit','hasOwnProperty','hook','events','setMaxListeners','save'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0x505d,0x162));var _0xd505=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0x505d[_0x32b993];return _0x482780;};'use strict';var EventEmitter=require(_0xd505('0x0'));var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xd505('0x1')](0x0);var events={'afterCreate':_0xd505('0x2'),'afterUpdate':'update','afterDestroy':_0xd505('0x3')};function emitEvent(_0x4e63d9){return function(_0x35df29,_0x46efe2,_0x25e27f){VoicePrefixEvents[_0xd505('0x4')](_0x4e63d9+':'+_0x35df29['id'],_0x35df29);VoicePrefixEvents[_0xd505('0x4')](_0x4e63d9,_0x35df29);_0x25e27f(null);};}for(var e in events){if(events[_0xd505('0x5')](e)){var event=events[e];VoicePrefix[_0xd505('0x6')](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 8e4a4d1..a1bf6ac 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 _0x16ae=['define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','moment','request-promise','../../config/environment','./voicePrefix.attributes'];(function(_0x48fbb8,_0xbe3e3c){var _0x245d2e=function(_0x7ced96){while(--_0x7ced96){_0x48fbb8['push'](_0x48fbb8['shift']());}};_0x245d2e(++_0xbe3e3c);}(_0x16ae,0xdf));var _0xe16a=function(_0x5e7654,_0x55fc47){_0x5e7654=_0x5e7654-0x0;var _0x214357=_0x16ae[_0x5e7654];return _0x214357;};'use strict';var _=require(_0xe16a('0x0'));var util=require(_0xe16a('0x1'));var logger=require(_0xe16a('0x2'))('api');var moment=require(_0xe16a('0x3'));var BPromise=require('bluebird');var rp=require(_0xe16a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe16a('0x5'));var attributes=require(_0xe16a('0x6'));module['exports']=function(_0x2f8c82,_0x33ea61){return _0x2f8c82[_0xe16a('0x7')](_0xe16a('0x8'),attributes,{'tableName':_0xe16a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0198=['../../config/environment','exports','define','VoicePrefix','voice_prefixes','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3c365e,_0x3b40a9){var _0x198acc=function(_0x46d80e){while(--_0x46d80e){_0x3c365e['push'](_0x3c365e['shift']());}};_0x198acc(++_0x3b40a9);}(_0x0198,0x191));var _0x8019=function(_0x280ae7,_0x456fb1){_0x280ae7=_0x280ae7-0x0;var _0x418b9e=_0x0198[_0x280ae7];return _0x418b9e;};'use strict';var _=require('lodash');var util=require(_0x8019('0x0'));var logger=require(_0x8019('0x1'))(_0x8019('0x2'));var moment=require(_0x8019('0x3'));var BPromise=require('bluebird');var rp=require(_0x8019('0x4'));var fs=require('fs');var path=require(_0x8019('0x5'));var rimraf=require(_0x8019('0x6'));var config=require(_0x8019('0x7'));var attributes=require('./voicePrefix.attributes');module[_0x8019('0x8')]=function(_0x22a3ee,_0xf218c4){return _0x22a3ee[_0x8019('0x9')](_0x8019('0xa'),attributes,{'tableName':_0x8019('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 3875a57..8f98f05 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 _0x7e02=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x4e2750,_0xcbaafb){var _0x35a95d=function(_0x17066e){while(--_0x17066e){_0x4e2750['push'](_0x4e2750['shift']());}};_0x35a95d(++_0xcbaafb);}(_0x7e02,0x71));var _0x27e0=function(_0x334f61,_0x20cd4c){_0x334f61=_0x334f61-0x0;var _0x307da4=_0x7e02[_0x334f61];return _0x307da4;};'use strict';var _=require(_0x27e0('0x0'));var util=require(_0x27e0('0x1'));var moment=require(_0x27e0('0x2'));var BPromise=require(_0x27e0('0x3'));var rs=require(_0x27e0('0x4'));var fs=require('fs');var Redis=require(_0x27e0('0x5'));var db=require(_0x27e0('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x27e0('0x7'));var config=require('../../config/environment');var jayson=require(_0x27e0('0x8'));var client=jayson[_0x27e0('0x9')][_0x27e0('0xa')]({'port':0x232a});config[_0x27e0('0xb')]=_[_0x27e0('0xc')](config[_0x27e0('0xb')],{'host':_0x27e0('0xd'),'port':0x18eb});var socket=require(_0x27e0('0xe'))(new Redis(config['redis']));require(_0x27e0('0xf'))['register'](socket);function respondWithRpcPromise(_0xa5a2fd,_0x1d7413,_0x480486){return new BPromise(function(_0x17f18d,_0xbf3ce5){return client[_0x27e0('0x10')](_0xa5a2fd,_0x480486)[_0x27e0('0x11')](function(_0x12db7d){logger[_0x27e0('0x12')](_0x27e0('0x13'),_0x1d7413,_0x27e0('0x14'));logger[_0x27e0('0x15')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x1d7413,_0x27e0('0x14'),JSON[_0x27e0('0x16')](_0x12db7d));if(_0x12db7d[_0x27e0('0x17')]){if(_0x12db7d['error'][_0x27e0('0x18')]===0x1f4){logger[_0x27e0('0x17')](_0x27e0('0x13'),_0x1d7413,_0x12db7d['error'][_0x27e0('0x19')]);return _0xbf3ce5(_0x12db7d[_0x27e0('0x17')][_0x27e0('0x19')]);}logger[_0x27e0('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x1d7413,_0x12db7d['error'][_0x27e0('0x19')]);return _0x17f18d(_0x12db7d[_0x27e0('0x17')][_0x27e0('0x19')]);}else{logger[_0x27e0('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x1d7413,_0x27e0('0x14'));_0x17f18d(_0x12db7d[_0x27e0('0x1a')][_0x27e0('0x19')]);}})[_0x27e0('0x1b')](function(_0x608e4f){logger[_0x27e0('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x1d7413,_0x608e4f);_0xbf3ce5(_0x608e4f);});});} \ No newline at end of file +var _0x6691=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x6691,0x12d));var _0x1669=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6691[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x1669('0x0'));var util=require(_0x1669('0x1'));var moment=require(_0x1669('0x2'));var BPromise=require(_0x1669('0x3'));var rs=require(_0x1669('0x4'));var fs=require('fs');var Redis=require(_0x1669('0x5'));var db=require(_0x1669('0x6'))['db'];var utils=require(_0x1669('0x7'));var logger=require(_0x1669('0x8'))(_0x1669('0x9'));var config=require('../../config/environment');var jayson=require(_0x1669('0xa'));var client=jayson[_0x1669('0xb')][_0x1669('0xc')]({'port':0x232a});config[_0x1669('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1669('0xe'))(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x56e0ee,_0x52b44f,_0x408538){return new BPromise(function(_0x93d633,_0xdf793d){return client[_0x1669('0xf')](_0x56e0ee,_0x408538)[_0x1669('0x10')](function(_0x3d6f5e){logger[_0x1669('0x11')](_0x1669('0x12'),_0x52b44f,_0x1669('0x13'));logger[_0x1669('0x14')](_0x1669('0x15'),_0x52b44f,_0x1669('0x13'),JSON[_0x1669('0x16')](_0x3d6f5e));if(_0x3d6f5e[_0x1669('0x17')]){if(_0x3d6f5e[_0x1669('0x17')][_0x1669('0x18')]===0x1f4){logger[_0x1669('0x17')](_0x1669('0x12'),_0x52b44f,_0x3d6f5e[_0x1669('0x17')][_0x1669('0x19')]);return _0xdf793d(_0x3d6f5e[_0x1669('0x17')][_0x1669('0x19')]);}logger[_0x1669('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x52b44f,_0x3d6f5e[_0x1669('0x17')][_0x1669('0x19')]);return _0x93d633(_0x3d6f5e[_0x1669('0x17')][_0x1669('0x19')]);}else{logger[_0x1669('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x52b44f,'request\x20sent');_0x93d633(_0x3d6f5e[_0x1669('0x1a')][_0x1669('0x19')]);}})[_0x1669('0x1b')](function(_0x4fcf1c){logger[_0x1669('0x17')](_0x1669('0x12'),_0x52b44f,_0x4fcf1c);_0xdf793d(_0x4fcf1c);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 4eb38f9..38c945f 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 _0x6c4b=['emit','length','voicePrefix:','./voicePrefix.events','save','remove'];(function(_0x59f136,_0x52c0d){var _0x1949ce=function(_0x1f292a){while(--_0x1f292a){_0x59f136['push'](_0x59f136['shift']());}};_0x1949ce(++_0x52c0d);}(_0x6c4b,0x93));var _0xb6c4=function(_0x3eead8,_0x58145a){_0x3eead8=_0x3eead8-0x0;var _0x1df4a2=_0x6c4b[_0x3eead8];return _0x1df4a2;};'use strict';var VoicePrefixEvents=require(_0xb6c4('0x0'));var events=[_0xb6c4('0x1'),_0xb6c4('0x2'),'update'];function createListener(_0x1f07f4,_0x2a1872){return function(_0x235930){_0x2a1872[_0xb6c4('0x3')](_0x1f07f4,_0x235930);};}function removeListener(_0x459ef7,_0x27f46b){return function(){VoicePrefixEvents['removeListener'](_0x459ef7,_0x27f46b);};}exports['register']=function(_0x1f7abc){for(var _0x5a290a=0x0,_0x109973=events[_0xb6c4('0x4')];_0x5a290a<_0x109973;_0x5a290a++){var _0x554935=events[_0x5a290a];var _0x312141=createListener(_0xb6c4('0x5')+_0x554935,_0x1f7abc);VoicePrefixEvents['on'](_0x554935,_0x312141);}}; \ No newline at end of file +var _0x1bb2=['register','length','save','remove','update','emit','removeListener'];(function(_0x5be53c,_0x62a39c){var _0x4fcd9d=function(_0x541c04){while(--_0x541c04){_0x5be53c['push'](_0x5be53c['shift']());}};_0x4fcd9d(++_0x62a39c);}(_0x1bb2,0x152));var _0x21bb=function(_0x2acf76,_0x2e78b4){_0x2acf76=_0x2acf76-0x0;var _0x35e75c=_0x1bb2[_0x2acf76];return _0x35e75c;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x21bb('0x0'),_0x21bb('0x1'),_0x21bb('0x2')];function createListener(_0x480fcb,_0x4e514f){return function(_0x170632){_0x4e514f[_0x21bb('0x3')](_0x480fcb,_0x170632);};}function removeListener(_0x1c21c6,_0x469984){return function(){VoicePrefixEvents[_0x21bb('0x4')](_0x1c21c6,_0x469984);};}exports[_0x21bb('0x5')]=function(_0x198344){for(var _0x267bb0=0x0,_0x36217b=events[_0x21bb('0x6')];_0x267bb0<_0x36217b;_0x267bb0++){var _0x642998=events[_0x267bb0];var _0x316b77=createListener('voicePrefix:'+_0x642998,_0x198344);VoicePrefixEvents['on'](_0x642998,_0x316b77);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index a1dad95..6560a7c 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 _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x1c22ac,_0x4c86bd){var _0x4c867a=function(_0x370c7d){while(--_0x370c7d){_0x1c22ac['push'](_0x1c22ac['shift']());}};_0x4c867a(++_0x4c86bd);}(_0xb10b,0x12a));var _0xbb10=function(_0x1005d4,_0x5199ab){_0x1005d4=_0x1005d4-0x0;var _0x421977=_0xb10b[_0x1005d4];return _0x421977;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ccbc7,_0x3093c8){_0x3ccbc7=_0x3ccbc7-0x0;var _0x50c97a=_0xb10b[_0x3ccbc7];return _0x50c97a;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index cbeb464..6a61b56 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 _0x2e27=['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)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','inbound','outbound','ENUM','leastrecent','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','preview','booked','includes','INTEGER','yes','all','once','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','power','predictive','progressive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','dropRate'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2e27,0x162));var _0x72e2=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0x2e27[_0x383356];return _0x32ee5a;};'use strict';var Sequelize=require(_0x72e2('0x0'));module[_0x72e2('0x1')]={'name':{'type':Sequelize[_0x72e2('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x72e2('0x3'),_0x72e2('0x4')),'allowNull':![],'defaultValue':_0x72e2('0x3')},'musiconhold':{'type':Sequelize[_0x72e2('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x72e2('0x5')]('rr','ringall',_0x72e2('0x6'),'fewestcalls',_0x72e2('0x7'),_0x72e2('0x8'),_0x72e2('0x9'),_0x72e2('0xa'),_0x72e2('0xb')),'allowNull':![],'defaultValue':_0x72e2('0xc'),'set':function(_0x4130d3){this[_0x72e2('0xd')](_0x72e2('0xe'),_0x4130d3?_0x4130d3:_0x72e2('0x8'));},'get':function(){var _0x9342ae=this[_0x72e2('0xf')](_0x72e2('0x10'));var _0x5d7ebf=this[_0x72e2('0xf')]('dialMethod');var _0x3f3f4c=this[_0x72e2('0xf')]('strategy');if(_0x9342ae==='outbound'){if(_0x5d7ebf===_0x72e2('0x11')){return null;}if(_0x5d7ebf===_0x72e2('0x12')&&![_0x72e2('0x8'),'roundrobin'][_0x72e2('0x13')](_0x3f3f4c)){this[_0x72e2('0xd')](_0x72e2('0xe'),_0x72e2('0x8'));}}return _0x3f3f4c;}},'servicelevel':{'type':Sequelize[_0x72e2('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x72e2('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x72e2('0x14')](0xb)},'timeout':{'type':Sequelize[_0x72e2('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x72e2('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x72e2('0x2')]},'weight':{'type':Sequelize[_0x72e2('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x72e2('0x5')](_0x72e2('0x15'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x72e2('0x5')](_0x72e2('0x15'),'no',_0x72e2('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x72e2('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x72e2('0x5')](_0x72e2('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x72e2('0x5')](_0x72e2('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x72e2('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x72e2('0x5')](_0x72e2('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x72e2('0x5')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x72e2('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x72e2('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x72e2('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x72e2('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x72e2('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x72e2('0x5')](_0x72e2('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x72e2('0x5')](_0x72e2('0x15'),'no'),'defaultValue':_0x72e2('0x15')},'announce_holdtime':{'type':Sequelize[_0x72e2('0x5')]('yes','no',_0x72e2('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x72e2('0x5')](_0x72e2('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x72e2('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x72e2('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x72e2('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x72e2('0x2')]},'queue_youarenext':{'type':Sequelize[_0x72e2('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x72e2('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x72e2('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x72e2('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x72e2('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x72e2('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x72e2('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x72e2('0x2')]},'queue_quantity1':{'type':Sequelize[_0x72e2('0x2')]},'queue_quantity2':{'type':Sequelize[_0x72e2('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x72e2('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0xb56237){this['setDataValue']('periodic_announce',_0xb56237?_0xb56237[_0x72e2('0x18')](','):[]);},'get':function(){return this[_0x72e2('0xf')](_0x72e2('0x19'))?this[_0x72e2('0xf')](_0x72e2('0x19'))[_0x72e2('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x72e2('0x2')],'defaultValue':'yes','set':function(_0x39fb8c){this[_0x72e2('0xd')](_0x72e2('0x1b'),_0x39fb8c?_0x39fb8c[_0x72e2('0x18')](','):undefined);},'get':function(){return this[_0x72e2('0xf')](_0x72e2('0x1b'))?this[_0x72e2('0xf')](_0x72e2('0x1b'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x72e2('0x2')],'defaultValue':'no','set':function(_0x4524ed){this[_0x72e2('0xd')](_0x72e2('0x1c'),_0x4524ed?_0x4524ed[_0x72e2('0x18')](','):undefined);},'get':function(){return this[_0x72e2('0xf')]('leavewhenempty')?this[_0x72e2('0xf')](_0x72e2('0x1c'))[_0x72e2('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x72e2('0x5')](_0x72e2('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x72e2('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x72e2('0x5')](_0x72e2('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x72e2('0x2')]},'description':{'type':Sequelize[_0x72e2('0x2')]},'acw':{'type':Sequelize[_0x72e2('0x1d')],'defaultValue':0x0,'set':function(_0x56abf9){this[_0x72e2('0xd')]('acw',_0x56abf9);if(_0x56abf9){if(this['getDataValue']('wrapuptime')<0x2){this[_0x72e2('0xd')](_0x72e2('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x72e2('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x72e2('0x1d')],'defaultValue':0x0,'comment':_0x72e2('0x1f')},'dialMethod':{'type':Sequelize[_0x72e2('0x5')](_0x72e2('0x11'),'progressive',_0x72e2('0x20'),_0x72e2('0x21'),_0x72e2('0x12')),'defaultValue':_0x72e2('0x22'),'comment':_0x72e2('0x23')},'dialLimitChannel':{'type':Sequelize[_0x72e2('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x72e2('0x24')},'dialLimitQueue':{'type':Sequelize[_0x72e2('0x14')](0x4)[_0x72e2('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x72e2('0x26')},'dialPowerLevel':{'type':Sequelize[_0x72e2('0x27')](0x2)[_0x72e2('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x72e2('0x5')]('agentBusyFactor',_0x72e2('0x28')),'defaultValue':_0x72e2('0x28'),'comment':_0x72e2('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x72e2('0x27')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x72e2('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x72e2('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x72e2('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x72e2('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x72e2('0x14')](0x3)[_0x72e2('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72e2('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x72e2('0x2')],'defaultValue':'tTxX','comment':_0x72e2('0x2d')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x72e2('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72e2('0x2e')},'dialQueueProject':{'type':Sequelize[_0x72e2('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x72e2('0x14')](0x3)[_0x72e2('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72e2('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x72e2('0x14')](0x5)[_0x72e2('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72e2('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x72e2('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72e2('0x31')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x72e2('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72e2('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x72e2('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x72e2('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x72e2('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72e2('0x34')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x72e2('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x72e2('0x35')},'dialTimezone':{'type':Sequelize[_0x72e2('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x72e2('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x72e2('0x5')](_0x72e2('0x36'),_0x72e2('0x37'),_0x72e2('0x38')),'defaultValue':_0x72e2('0x36')},'dialAMDActive':{'type':Sequelize[_0x72e2('0x1d')],'defaultValue':0x0,'comment':_0x72e2('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x72e2('0x14')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x72e2('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x72e2('0x14')](0x9)[_0x72e2('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x72e2('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x72e2('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x72e2('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x72e2('0x14')](0x9)[_0x72e2('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x72e2('0x14')](0x9)[_0x72e2('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x72e2('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x72e2('0x14')](0x9)[_0x72e2('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x72e2('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x72e2('0x14')](0x9)[_0x72e2('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x72e2('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x72e2('0x14')](0x5)[_0x72e2('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x72e2('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x72e2('0x14')](0x9)[_0x72e2('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x72e2('0x14')](0x5)[_0x72e2('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x72e2('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x72e2('0x1d')],'defaultValue':0x0,'comment':_0x72e2('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x72e2('0x5')](_0x72e2('0x43'),'ASC'),'defaultValue':_0x72e2('0x43')},'dialQueueProject2':{'type':Sequelize[_0x72e2('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x72e2('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x72e2('0x14')](0x3)[_0x72e2('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x72e2('0x14')](0x3)[_0x72e2('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x72e2('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x72e2('0x14')](0x5)[_0x72e2('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72e2('0x44')},'dialDropMaxRetry':{'type':Sequelize[_0x72e2('0x14')](0x3)[_0x72e2('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72e2('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x72e2('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72e2('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x72e2('0x14')](0x3)[_0x72e2('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72e2('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x72e2('0x14')](0x5)[_0x72e2('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72e2('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x72e2('0x14')](0x3)[_0x72e2('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72e2('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x72e2('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72e2('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x72e2('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x72e2('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x72e2('0x14')](0x5)[_0x72e2('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x72e2('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x72e2('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x72e2('0x1d')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2e4797){if(!_0x2e4797)this[_0x72e2('0xd')](_0x72e2('0x4d'),null);this[_0x72e2('0xd')](_0x72e2('0x4e'),_0x2e4797);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x72e2('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x72e2('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x72e2('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x72e2('0x14')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x72e2('0x1d')],'defaultValue':![]}}; \ No newline at end of file +var _0x0aca=['Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#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','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\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)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','STRING','name','outbound','inbound','default','ringall','fewestcalls','random','rrmemory','linear','wrandom','rrordered','getDataValue','type','dialMethod','strategy','preview','roundrobin','includes','setDataValue','INTEGER','yes','ENUM','all','once','periodic_announce','join','joinempty','split','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','progressive','power','predictive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','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'];(function(_0x4a3936,_0x971058){var _0x3a66fa=function(_0x2bdcb9){while(--_0x2bdcb9){_0x4a3936['push'](_0x4a3936['shift']());}};_0x3a66fa(++_0x971058);}(_0x0aca,0x116));var _0xa0ac=function(_0x9c6c7d,_0x2d8484){_0x9c6c7d=_0x9c6c7d-0x0;var _0x433f1e=_0x0aca[_0x9c6c7d];return _0x433f1e;};'use strict';var Sequelize=require(_0xa0ac('0x0'));module[_0xa0ac('0x1')]={'name':{'type':Sequelize[_0xa0ac('0x2')],'allowNull':![],'unique':_0xa0ac('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0xa0ac('0x4')),'allowNull':![],'defaultValue':_0xa0ac('0x5')},'musiconhold':{'type':Sequelize[_0xa0ac('0x2')],'defaultValue':_0xa0ac('0x6')},'announce':{'type':Sequelize[_0xa0ac('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xa0ac('0x7'),'leastrecent',_0xa0ac('0x8'),_0xa0ac('0x9'),_0xa0ac('0xa'),_0xa0ac('0xb'),_0xa0ac('0xc'),_0xa0ac('0xd')),'allowNull':![],'defaultValue':_0xa0ac('0x7'),'set':function(_0x13fa15){this['setDataValue']('strategy',_0x13fa15?_0x13fa15:_0xa0ac('0xa'));},'get':function(){var _0x2eabae=this[_0xa0ac('0xe')](_0xa0ac('0xf'));var _0x253342=this[_0xa0ac('0xe')](_0xa0ac('0x10'));var _0x1479aa=this[_0xa0ac('0xe')](_0xa0ac('0x11'));if(_0x2eabae===_0xa0ac('0x4')){if(_0x253342===_0xa0ac('0x12')){return null;}if(_0x253342==='booked'&&![_0xa0ac('0xa'),_0xa0ac('0x13')][_0xa0ac('0x14')](_0x1479aa)){this[_0xa0ac('0x15')](_0xa0ac('0x11'),_0xa0ac('0xa'));}}return _0x1479aa;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xa0ac('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xa0ac('0x16')](0xb)},'timeout':{'type':Sequelize[_0xa0ac('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xa0ac('0x2')]},'weight':{'type':Sequelize[_0xa0ac('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xa0ac('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xa0ac('0x17'),'no'),'defaultValue':_0xa0ac('0x17')},'autopause':{'type':Sequelize[_0xa0ac('0x18')]('yes','no',_0xa0ac('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xa0ac('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0xa0ac('0x18')](_0xa0ac('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xa0ac('0x18')](_0xa0ac('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xa0ac('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xa0ac('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xa0ac('0x18')](_0xa0ac('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xa0ac('0x18')](_0xa0ac('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xa0ac('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xa0ac('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xa0ac('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xa0ac('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xa0ac('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xa0ac('0x18')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xa0ac('0x17'),'no'),'defaultValue':_0xa0ac('0x17')},'announce_holdtime':{'type':Sequelize[_0xa0ac('0x18')](_0xa0ac('0x17'),'no',_0xa0ac('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xa0ac('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xa0ac('0x18')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xa0ac('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xa0ac('0x18')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xa0ac('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xa0ac('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xa0ac('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xa0ac('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xa0ac('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xa0ac('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xa0ac('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xa0ac('0x2')]},'queue_less_than':{'type':Sequelize[_0xa0ac('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x33f895){this['setDataValue'](_0xa0ac('0x1b'),_0x33f895?_0x33f895[_0xa0ac('0x1c')](','):[]);},'get':function(){return this[_0xa0ac('0xe')]('periodic_announce')?this[_0xa0ac('0xe')](_0xa0ac('0x1b'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xa0ac('0x2')],'defaultValue':'yes','set':function(_0x42002e){this[_0xa0ac('0x15')](_0xa0ac('0x1d'),_0x42002e?_0x42002e[_0xa0ac('0x1c')](','):undefined);},'get':function(){return this[_0xa0ac('0xe')](_0xa0ac('0x1d'))?this[_0xa0ac('0xe')]('joinempty')[_0xa0ac('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xa0ac('0x2')],'defaultValue':'no','set':function(_0x449aad){this[_0xa0ac('0x15')](_0xa0ac('0x1f'),_0x449aad?_0x449aad[_0xa0ac('0x1c')](','):undefined);},'get':function(){return this[_0xa0ac('0xe')](_0xa0ac('0x1f'))?this[_0xa0ac('0xe')](_0xa0ac('0x1f'))[_0xa0ac('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xa0ac('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xa0ac('0x18')](_0xa0ac('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xa0ac('0x2')]},'description':{'type':Sequelize[_0xa0ac('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x54bd71){this[_0xa0ac('0x15')](_0xa0ac('0x20'),_0x54bd71);if(_0x54bd71){if(this[_0xa0ac('0xe')](_0xa0ac('0x21'))<0x2){this[_0xa0ac('0x15')](_0xa0ac('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xa0ac('0x22')],'defaultValue':0x0,'comment':_0xa0ac('0x23')},'dialMethod':{'type':Sequelize[_0xa0ac('0x18')](_0xa0ac('0x12'),_0xa0ac('0x24'),_0xa0ac('0x25'),_0xa0ac('0x26'),'booked'),'defaultValue':_0xa0ac('0x24'),'comment':_0xa0ac('0x27')},'dialLimitChannel':{'type':Sequelize[_0xa0ac('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa0ac('0x28')},'dialLimitQueue':{'type':Sequelize[_0xa0ac('0x16')](0x4)[_0xa0ac('0x29')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xa0ac('0x29')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xa0ac('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0xa0ac('0x18')](_0xa0ac('0x2b'),'dropRate'),'defaultValue':_0xa0ac('0x2c'),'comment':_0xa0ac('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xa0ac('0x2e')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xa0ac('0x29')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xa0ac('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa0ac('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa0ac('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xa0ac('0x16')](0x3)[_0xa0ac('0x29')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xa0ac('0x2')],'defaultValue':_0xa0ac('0x30'),'comment':_0xa0ac('0x31')},'dialQueueTimeout':{'type':Sequelize[_0xa0ac('0x16')](0x3)[_0xa0ac('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa0ac('0x32')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xa0ac('0x33')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa0ac('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa0ac('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa0ac('0x35')},'dialBusyMaxRetry':{'type':Sequelize[_0xa0ac('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa0ac('0x36')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa0ac('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa0ac('0x37')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa0ac('0x29')],'defaultValue':0x3,'comment':_0xa0ac('0x38')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa0ac('0x16')](0x5)[_0xa0ac('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa0ac('0x39')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa0ac('0x16')](0x3)[_0xa0ac('0x29')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xa0ac('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xa0ac('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xa0ac('0x3a'),'never',_0xa0ac('0x3b')),'defaultValue':_0xa0ac('0x3a')},'dialAMDActive':{'type':Sequelize[_0xa0ac('0x22')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xa0ac('0x16')](0x9)[_0xa0ac('0x29')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa0ac('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0xa0ac('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa0ac('0x16')](0x9)[_0xa0ac('0x29')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa0ac('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa0ac('0x16')](0x9)[_0xa0ac('0x29')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa0ac('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0xa0ac('0x16')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa0ac('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa0ac('0x16')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa0ac('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa0ac('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa0ac('0x16')](0x5)[_0xa0ac('0x29')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa0ac('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa0ac('0x16')](0x9)[_0xa0ac('0x29')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa0ac('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0xa0ac('0x16')](0x5)[_0xa0ac('0x29')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xa0ac('0x44')},'dialRecallInQueue':{'type':Sequelize[_0xa0ac('0x22')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xa0ac('0x18')](_0xa0ac('0x45'),_0xa0ac('0x46')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xa0ac('0x2')],'comment':_0xa0ac('0x33')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xa0ac('0x29')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa0ac('0x47')},'dialCutDigit':{'type':Sequelize[_0xa0ac('0x16')](0x3)[_0xa0ac('0x29')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa0ac('0x16')](0x3)[_0xa0ac('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa0ac('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa0ac('0x16')](0x5)[_0xa0ac('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa0ac('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0xa0ac('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa0ac('0x4a')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa0ac('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa0ac('0x16')](0x3)[_0xa0ac('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa0ac('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa0ac('0x16')](0x5)[_0xa0ac('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa0ac('0x4c')},'dialMachineMaxRetry':{'type':Sequelize[_0xa0ac('0x16')](0x3)[_0xa0ac('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa0ac('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa0ac('0x16')](0x5)[_0xa0ac('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa0ac('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa0ac('0x29')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa0ac('0x16')](0x5)[_0xa0ac('0x29')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa0ac('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xa0ac('0x50')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa0ac('0x51'),'set':function(_0x332bb4){if(!_0x332bb4)this[_0xa0ac('0x15')]('mandatoryDispositionPauseId',null);this[_0xa0ac('0x15')]('mandatoryDisposition',_0x332bb4);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xa0ac('0x16')](0x3)[_0xa0ac('0x29')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xa0ac('0x22')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xa0ac('0x22')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 7d60c7c..677e3d2 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 _0x34e8=['body','role','user','QueueCampaigns','find','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','includeAll','merge','options','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','hasOwnProperty','nolimit','order','sort','pick','VoiceQueueId','where','filter','CmHopper','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','interface','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','isEmpty','removeAgents','userVoiceQueue:remove','spread','push','isArray','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','cm_hopper','fromQuery','phone','scheduledAt','CmListId','ListId','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','ContactId','cm_contacts','ListId\x20=\x20?','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','then','destroy','get','VoiceQueues','inbound','outbound','ignore','map','value','type','UserProfileResource','error','stack','name','VoiceQueue','rawAttributes','fieldName','key','getOptions','include','query','findAll','catch','show','keys','filters','model','attributes','intersection','fields','length','create'];(function(_0x32e268,_0x510f00){var _0x5cd714=function(_0x270a5c){while(--_0x270a5c){_0x32e268['push'](_0x32e268['shift']());}};_0x5cd714(++_0x510f00);}(_0x34e8,0x12c));var _0x834e=function(_0xac6c14,_0x238603){_0xac6c14=_0xac6c14-0x0;var _0x4f907b=_0x34e8[_0xac6c14];return _0x4f907b;};'use strict';var moment=require(_0x834e('0x0'));var BPromise=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));var squel=require('squel');var Redis=require(_0x834e('0x4'));var qs=require(_0x834e('0x5'));var logger=require(_0x834e('0x6'))(_0x834e('0x7'));var config=require(_0x834e('0x8'));var db=require(_0x834e('0x9'))['db'];config[_0x834e('0xa')]=_['defaults'](config[_0x834e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x834e('0xb'))(new Redis(config[_0x834e('0xa')]));require(_0x834e('0xc'))[_0x834e('0xd')](socket);function respondWithStatusCode(_0x33ea05,_0x23501c){_0x23501c=_0x23501c||0xcc;return function(_0x363786){if(_0x363786){return _0x33ea05[_0x834e('0xe')](_0x23501c);}return _0x33ea05[_0x834e('0xf')](_0x23501c)[_0x834e('0x10')]();};}function respondWithResult(_0x1e41fe,_0x36e124){_0x36e124=_0x36e124||0xc8;return function(_0x14038b){if(_0x14038b){return _0x1e41fe[_0x834e('0xf')](_0x36e124)[_0x834e('0x11')](_0x14038b);}};}function respondWithFilteredResult(_0x1e00de,_0x2fd95c){return function(_0x538bb3){if(_0x538bb3){var _0x5e5b6d=typeof _0x2fd95c[_0x834e('0x12')]==='undefined'&&typeof _0x2fd95c[_0x834e('0x13')]===_0x834e('0x14');var _0x28e659=_0x538bb3[_0x834e('0x15')];var _0x50e860=_0x5e5b6d?0x0:_0x2fd95c[_0x834e('0x12')];var _0x302cbd=_0x5e5b6d?_0x538bb3['count']:_0x2fd95c[_0x834e('0x12')]+_0x2fd95c['limit'];var _0x38a8cd;if(_0x302cbd>=_0x28e659){_0x302cbd=_0x28e659;_0x38a8cd=0xc8;}else{_0x38a8cd=0xce;}_0x1e00de[_0x834e('0xf')](_0x38a8cd);return _0x1e00de['set'](_0x834e('0x16'),_0x50e860+'-'+_0x302cbd+'/'+_0x28e659)[_0x834e('0x11')](_0x538bb3);}return null;};}function saveUpdates(_0x370fb5){return function(_0x50b3f6){if(_0x50b3f6){return _0x50b3f6[_0x834e('0x17')](_0x370fb5)[_0x834e('0x18')](function(_0x34e41a){return _0x34e41a;});}return null;};}function removeEntity(_0xb993a1){return function(_0x237947){if(_0x237947){return _0x237947[_0x834e('0x19')]()[_0x834e('0x18')](function(){var _0x595515=_0x237947[_0x834e('0x1a')]({'plain':!![]});var _0x1fd2c6=[{'name':_0x834e('0x1b'),'value':_0x834e('0x1c'),'ignore':![]},{'name':'QueueCampaigns','value':_0x834e('0x1d'),'ignore':![]}];var _0x62f8f1=_(_0x1fd2c6)['filter'](_0x834e('0x1e'))[_0x834e('0x1f')](_0x834e('0x20'))['value']();if(_['includes'](_0x62f8f1,_0x595515[_0x834e('0x21')])){return;}var _0x34563b=_['find'](_0x1fd2c6,[_0x834e('0x20'),_0x595515[_0x834e('0x21')]])['name'];return db[_0x834e('0x22')][_0x834e('0x19')]({'where':{'type':_0x34563b,'resourceId':_0x595515['id']}})[_0x834e('0x18')](function(){return _0x237947;});})['then'](function(){_0xb993a1[_0x834e('0xf')](0xcc)[_0x834e('0x10')]();});}};}function handleEntityNotFound(_0x5e1cc5){return function(_0x5bef62){if(!_0x5bef62){_0x5e1cc5[_0x834e('0xe')](0x194);}return _0x5bef62;};}function handleError(_0x508a1d,_0x2826ec){_0x2826ec=_0x2826ec||0x1f4;return function(_0x3f1b0b){logger[_0x834e('0x23')](_0x3f1b0b[_0x834e('0x24')]);if(_0x3f1b0b[_0x834e('0x25')]){delete _0x3f1b0b[_0x834e('0x25')];}_0x508a1d['status'](_0x2826ec)['send'](_0x3f1b0b);};}exports['index']=function(_0x58c1d7,_0x2c7a8d){var _0x567cea={};var _0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x1f')](db[_0x834e('0x26')][_0x834e('0x27')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x28')],'type':_0x1e026a[_0x834e('0x21')][_0x834e('0x29')]};});_0x567cea=qs[_0x834e('0x2a')](_0x5dacc1,_0x58c1d7);var _0x278db3={'where':_0x567cea['where']};return db[_0x834e('0x26')]['count'](_0x278db3)[_0x834e('0x18')](function(_0x3787b0){_0x106d6a[_0x834e('0x15')]=_0x3787b0;_0x567cea[_0x834e('0x2b')]=qs[_0x834e('0x2b')](_0x58c1d7[_0x834e('0x2c')]);return db[_0x834e('0x26')][_0x834e('0x2d')](_0x567cea);})[_0x834e('0x18')](function(_0x12b2bc){_0x106d6a['rows']=_0x12b2bc;return _0x106d6a;})[_0x834e('0x18')](respondWithFilteredResult(_0x2c7a8d,_0x567cea))[_0x834e('0x2e')](handleError(_0x2c7a8d,null));};exports[_0x834e('0x2f')]=function(_0xaf01f4,_0x595cc0){var _0x3f88ad={'raw':![],'where':{'id':_0xaf01f4['params']['id']}},_0x379d60={};_0x379d60['model']=_['keys'](db[_0x834e('0x26')][_0x834e('0x27')]);_0x379d60[_0x834e('0x2c')]=_[_0x834e('0x30')](_0xaf01f4[_0x834e('0x2c')]);_0x379d60[_0x834e('0x31')]=_['intersection'](_0x379d60[_0x834e('0x32')],_0x379d60['query']);_0x3f88ad[_0x834e('0x33')]=_[_0x834e('0x34')](_0x379d60['model'],qs[_0x834e('0x35')](_0xaf01f4[_0x834e('0x2c')]['fields']));_0x3f88ad['attributes']=_0x3f88ad[_0x834e('0x33')][_0x834e('0x36')]?_0x3f88ad[_0x834e('0x33')]:_0x379d60[_0x834e('0x32')];if(_0xaf01f4[_0x834e('0x2c')]['includeAll']){_0x3f88ad[_0x834e('0x2b')]=[{'all':!![]}];}_0x3f88ad=_['merge']({},_0x3f88ad,_0xaf01f4['options']);return db[_0x834e('0x26')]['find'](_0x3f88ad)[_0x834e('0x18')](handleEntityNotFound(_0x595cc0,null))[_0x834e('0x18')](respondWithResult(_0x595cc0,null))[_0x834e('0x2e')](handleError(_0x595cc0,null));};exports[_0x834e('0x37')]=function(_0x2b7933,_0x574ea8){return db[_0x834e('0x26')][_0x834e('0x37')](_0x2b7933[_0x834e('0x38')],{})['then'](function(_0x35380e){var _0x16ac45=_0x2b7933['user'][_0x834e('0x1a')]({'plain':!![]});if(!_0x16ac45)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16ac45[_0x834e('0x39')]===_0x834e('0x3a')){var _0x4a18bb=_0x35380e['get']({'plain':!![]});var _0x22ea21=[{'name':_0x834e('0x1b'),'value':_0x834e('0x1c')},{'name':_0x834e('0x3b'),'value':_0x834e('0x1d')}];var _0x23feea=_[_0x834e('0x3c')](_0x22ea21,['value',_0x4a18bb[_0x834e('0x21')]])['name'];return db[_0x834e('0x3d')]['find']({'where':{'name':_0x23feea,'userProfileId':_0x16ac45[_0x834e('0x3e')]},'raw':!![]})['then'](function(_0x361f60){if(_0x361f60&&_0x361f60[_0x834e('0x3f')]===0x0){return db['UserProfileResource'][_0x834e('0x37')]({'name':_0x4a18bb[_0x834e('0x25')],'resourceId':_0x4a18bb['id'],'type':_0x361f60[_0x834e('0x25')],'sectionId':_0x361f60['id']},{})[_0x834e('0x18')](function(){return _0x35380e;});}else{return _0x35380e;}})[_0x834e('0x2e')](function(_0x1a7149){logger[_0x834e('0x23')](_0x834e('0x40'),_0x1a7149);throw _0x1a7149;});}return _0x35380e;})[_0x834e('0x18')](respondWithResult(_0x574ea8,0xc9))[_0x834e('0x2e')](handleError(_0x574ea8,null));};exports['clone']=function(_0x3124be,_0x6fff27){var _0x47a8a9={'where':{'id':_0x3124be[_0x834e('0x41')]['id']}},_0x112306={};_0x112306[_0x834e('0x32')]=_[_0x834e('0x30')](db[_0x834e('0x26')][_0x834e('0x27')]);_0x47a8a9['attributes']=_['intersection'](_0x112306[_0x834e('0x32')],qs[_0x834e('0x35')](_0x3124be[_0x834e('0x2c')][_0x834e('0x35')]));_0x47a8a9[_0x834e('0x33')]=_0x47a8a9[_0x834e('0x33')][_0x834e('0x36')]?_0x47a8a9[_0x834e('0x33')]:_0x112306[_0x834e('0x32')];if(_0x3124be[_0x834e('0x2c')][_0x834e('0x42')]){_0x47a8a9[_0x834e('0x2b')]=[{'all':!![]}];}_0x47a8a9=_[_0x834e('0x43')]({},_0x47a8a9,_0x3124be[_0x834e('0x44')]);return db[_0x834e('0x26')][_0x834e('0x3c')](_0x47a8a9)[_0x834e('0x18')](handleEntityNotFound(_0x6fff27,null))[_0x834e('0x18')](function(_0x420841){if(_0x420841){var _0x1adf86=_0x420841['get']({'plain':!![]});_0x1adf86=qs[_0x834e('0x45')](_0x1adf86,['id',_0x834e('0x46'),'updatedAt']);_0x3124be[_0x834e('0x38')]=_[_0x834e('0x45')](_0x3124be['body'],['id',_0x834e('0x46'),_0x834e('0x47')]);return db[_0x834e('0x26')][_0x834e('0x37')](_[_0x834e('0x43')](_0x1adf86,_0x3124be[_0x834e('0x38')]),{'include':_0x3124be[_0x834e('0x2c')]['includeAll']?[{'all':!![]}]:undefined})[_0x834e('0x18')](function(_0x8bc6c6){var _0x3e0550=_0x3124be[_0x834e('0x3a')][_0x834e('0x1a')]({'plain':!![]});if(!_0x3e0550)throw new Error(_0x834e('0x48'));if(_0x3e0550[_0x834e('0x39')]===_0x834e('0x3a')){var _0x5afa07=_0x8bc6c6[_0x834e('0x1a')]({'plain':!![]});var _0x4dc104=[{'name':_0x834e('0x1b'),'value':'inbound'},{'name':_0x834e('0x3b'),'value':'outbound'}];var _0x527eef=_[_0x834e('0x3c')](_0x4dc104,[_0x834e('0x20'),_0x5afa07['type']])['name'];return db[_0x834e('0x3d')][_0x834e('0x3c')]({'where':{'name':_0x527eef,'userProfileId':_0x3e0550[_0x834e('0x3e')]},'raw':!![]})[_0x834e('0x18')](function(_0x21c417){if(_0x21c417&&_0x21c417[_0x834e('0x3f')]===0x0){return db[_0x834e('0x22')][_0x834e('0x37')]({'name':_0x5afa07['name'],'resourceId':_0x5afa07['id'],'type':_0x21c417[_0x834e('0x25')],'sectionId':_0x21c417['id']},{})[_0x834e('0x18')](function(){return _0x8bc6c6;});}else{return _0x8bc6c6;}})['catch'](function(_0x281342){logger['error'](_0x834e('0x40'),_0x281342);throw _0x281342;});}return _0x8bc6c6;});}})[_0x834e('0x18')](respondWithResult(_0x6fff27,0xc9))['catch'](handleError(_0x6fff27,null));};exports[_0x834e('0x17')]=function(_0x37ee0e,_0x2de29a){if(_0x37ee0e[_0x834e('0x38')]['id']){delete _0x37ee0e['body']['id'];}return db[_0x834e('0x26')][_0x834e('0x3c')]({'where':{'id':_0x37ee0e[_0x834e('0x41')]['id']}})['then'](handleEntityNotFound(_0x2de29a,null))[_0x834e('0x18')](saveUpdates(_0x37ee0e[_0x834e('0x38')],null))[_0x834e('0x18')](respondWithResult(_0x2de29a,null))[_0x834e('0x2e')](handleError(_0x2de29a,null));};exports[_0x834e('0x19')]=function(_0x125f37,_0x3a1426){return db[_0x834e('0x26')][_0x834e('0x3c')]({'where':{'id':_0x125f37[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x3a1426,null))[_0x834e('0x18')](removeEntity(_0x3a1426,null))[_0x834e('0x2e')](handleError(_0x3a1426,null));};exports[_0x834e('0x49')]=function(_0x460a7a,_0x17b8e3){var _0x297cce={'raw':![],'where':{}};var _0x14ed83={};var _0x193a15={'count':0x0,'rows':[]};return db[_0x834e('0x26')][_0x834e('0x4a')]({'where':{'id':_0x460a7a[_0x834e('0x41')]['id']}})['then'](handleEntityNotFound(_0x17b8e3,null))[_0x834e('0x18')](function(_0x25d6f4){if(_0x25d6f4){_0x14ed83[_0x834e('0x32')]=_[_0x834e('0x30')](db['CmHopper'][_0x834e('0x27')]);_0x14ed83['query']=_['keys'](_0x460a7a[_0x834e('0x2c')]);_0x14ed83[_0x834e('0x31')]=_[_0x834e('0x34')](_0x14ed83[_0x834e('0x32')],_0x14ed83[_0x834e('0x2c')]);_0x297cce[_0x834e('0x33')]=_[_0x834e('0x34')](_0x14ed83[_0x834e('0x32')],qs['fields'](_0x460a7a[_0x834e('0x2c')]['fields']));_0x297cce[_0x834e('0x33')]=_0x297cce[_0x834e('0x33')]['length']?_0x297cce['attributes']:_0x14ed83[_0x834e('0x32')];if(!_0x460a7a[_0x834e('0x2c')][_0x834e('0x4b')](_0x834e('0x4c'))){_0x297cce[_0x834e('0x13')]=qs['limit'](_0x460a7a[_0x834e('0x2c')][_0x834e('0x13')]);_0x297cce[_0x834e('0x12')]=qs[_0x834e('0x12')](_0x460a7a[_0x834e('0x2c')][_0x834e('0x12')]);}_0x297cce[_0x834e('0x4d')]=qs[_0x834e('0x4e')](_0x460a7a[_0x834e('0x2c')][_0x834e('0x4e')]);_0x297cce['where']=qs[_0x834e('0x31')](_[_0x834e('0x4f')](_0x460a7a[_0x834e('0x2c')],_0x14ed83[_0x834e('0x31')]));_0x297cce['where'][_0x834e('0x50')]=_0x25d6f4['id'];if(_0x460a7a['query']['filter']){_0x297cce['where']=_[_0x834e('0x43')](_0x297cce[_0x834e('0x51')],{'$or':_['map'](_0x297cce[_0x834e('0x33')],function(_0x1b200d){var _0x4d4477={};_0x4d4477[_0x1b200d]={'$like':'%'+_0x460a7a[_0x834e('0x2c')][_0x834e('0x52')]+'%'};return _0x4d4477;})});}_0x297cce=_['merge']({},_0x297cce,_0x460a7a['options']);return db[_0x834e('0x53')][_0x834e('0x15')]({'where':_0x297cce[_0x834e('0x51')]})[_0x834e('0x18')](function(_0x1d8e7){_0x193a15['count']=_0x1d8e7;if(_0x460a7a[_0x834e('0x2c')]['includeAll']){_0x297cce[_0x834e('0x2b')]=[{'all':!![]}];}return db[_0x834e('0x53')][_0x834e('0x2d')](_0x297cce);})['then'](function(_0x33a3cd){_0x193a15[_0x834e('0x54')]=_0x33a3cd;return _0x193a15;});}})['then'](respondWithFilteredResult(_0x17b8e3,_0x297cce))[_0x834e('0x2e')](handleError(_0x17b8e3,null));};exports[_0x834e('0x55')]=function(_0xb4e130,_0x50d0a3){var _0x214014={'raw':!![],'where':{}};var _0x1d4e66={};var _0x402692={'count':0x0,'rows':[]};return db[_0x834e('0x26')][_0x834e('0x4a')]({'where':{'id':_0xb4e130[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x50d0a3,null))[_0x834e('0x18')](function(_0xd49002){if(_0xd49002){_0x1d4e66[_0x834e('0x32')]=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x1d4e66[_0x834e('0x2c')]=_[_0x834e('0x30')](_0xb4e130[_0x834e('0x2c')]);_0x1d4e66[_0x834e('0x31')]=_[_0x834e('0x34')](_0x1d4e66['model'],_0x1d4e66['query']);_0x214014[_0x834e('0x33')]=_[_0x834e('0x34')](_0x1d4e66[_0x834e('0x32')],qs[_0x834e('0x35')](_0xb4e130[_0x834e('0x2c')]['fields']));_0x214014[_0x834e('0x33')]=_0x214014[_0x834e('0x33')][_0x834e('0x36')]?_0x214014['attributes']:_0x1d4e66[_0x834e('0x32')];if(!_0xb4e130[_0x834e('0x2c')][_0x834e('0x4b')](_0x834e('0x4c'))){_0x214014[_0x834e('0x13')]=qs['limit'](_0xb4e130['query'][_0x834e('0x13')]);_0x214014[_0x834e('0x12')]=qs['offset'](_0xb4e130[_0x834e('0x2c')]['offset']);}_0x214014[_0x834e('0x4d')]=qs[_0x834e('0x4e')](_0xb4e130[_0x834e('0x2c')]['sort']);_0x214014[_0x834e('0x51')]=qs['filters'](_['pick'](_0xb4e130['query'],_0x1d4e66[_0x834e('0x31')]));_0x214014[_0x834e('0x51')][_0x834e('0x50')]=_0xd49002['id'];if(_0xb4e130[_0x834e('0x2c')][_0x834e('0x52')]){_0x214014[_0x834e('0x51')]=_[_0x834e('0x43')](_0x214014[_0x834e('0x51')],{'$or':_[_0x834e('0x1f')](_0x214014['attributes'],function(_0x2f775a){var _0x54e70d={};_0x54e70d[_0x2f775a]={'$like':'%'+_0xb4e130[_0x834e('0x2c')][_0x834e('0x52')]+'%'};return _0x54e70d;})});}_0x214014=_[_0x834e('0x43')]({},_0x214014,_0xb4e130[_0x834e('0x44')]);return db[_0x834e('0x56')][_0x834e('0x15')]({'where':_0x214014['where']})['then'](function(_0xeb096d){_0x402692[_0x834e('0x15')]=_0xeb096d;if(_0xb4e130['query'][_0x834e('0x42')]){_0x214014[_0x834e('0x2b')]=[{'all':!![]}];}return db[_0x834e('0x56')][_0x834e('0x2d')](_0x214014);})[_0x834e('0x18')](function(_0x5a75e3){_0x402692[_0x834e('0x54')]=_0x5a75e3;return _0x402692;});}})[_0x834e('0x18')](respondWithFilteredResult(_0x50d0a3,_0x214014))['catch'](handleError(_0x50d0a3,null));};exports['getHopperFinals']=function(_0x5ede29,_0x1e5252){var _0x1f3e26={'raw':!![],'where':{}};var _0x4f716d={};var _0x23ce49={'count':0x0,'rows':[]};return db[_0x834e('0x26')]['findOne']({'where':{'id':_0x5ede29[_0x834e('0x41')]['id']}})['then'](handleEntityNotFound(_0x1e5252,null))['then'](function(_0x41dfd9){if(_0x41dfd9){_0x4f716d[_0x834e('0x32')]=_[_0x834e('0x30')](db[_0x834e('0x57')]['rawAttributes']);_0x4f716d[_0x834e('0x2c')]=_[_0x834e('0x30')](_0x5ede29[_0x834e('0x2c')]);_0x4f716d[_0x834e('0x31')]=_[_0x834e('0x34')](_0x4f716d[_0x834e('0x32')],_0x4f716d[_0x834e('0x2c')]);_0x1f3e26[_0x834e('0x33')]=_[_0x834e('0x34')](_0x4f716d[_0x834e('0x32')],qs[_0x834e('0x35')](_0x5ede29[_0x834e('0x2c')][_0x834e('0x35')]));_0x1f3e26[_0x834e('0x33')]=_0x1f3e26[_0x834e('0x33')][_0x834e('0x36')]?_0x1f3e26[_0x834e('0x33')]:_0x4f716d[_0x834e('0x32')];if(!_0x5ede29[_0x834e('0x2c')][_0x834e('0x4b')](_0x834e('0x4c'))){_0x1f3e26[_0x834e('0x13')]=qs['limit'](_0x5ede29[_0x834e('0x2c')][_0x834e('0x13')]);_0x1f3e26[_0x834e('0x12')]=qs[_0x834e('0x12')](_0x5ede29[_0x834e('0x2c')][_0x834e('0x12')]);}_0x1f3e26[_0x834e('0x4d')]=qs[_0x834e('0x4e')](_0x5ede29[_0x834e('0x2c')]['sort']);_0x1f3e26['where']=qs['filters'](_[_0x834e('0x4f')](_0x5ede29['query'],_0x4f716d[_0x834e('0x31')]));_0x1f3e26[_0x834e('0x51')][_0x834e('0x50')]=_0x41dfd9['id'];if(_0x5ede29['query'][_0x834e('0x52')]){_0x1f3e26[_0x834e('0x51')]=_[_0x834e('0x43')](_0x1f3e26[_0x834e('0x51')],{'$or':_[_0x834e('0x1f')](_0x1f3e26[_0x834e('0x33')],function(_0x528052){var _0x10dd7b={};_0x10dd7b[_0x528052]={'$like':'%'+_0x5ede29[_0x834e('0x2c')][_0x834e('0x52')]+'%'};return _0x10dd7b;})});}_0x1f3e26=_[_0x834e('0x43')]({},_0x1f3e26,_0x5ede29[_0x834e('0x44')]);return db['CmHopperFinal']['count']({'where':_0x1f3e26['where']})['then'](function(_0x1dfa2e){_0x23ce49[_0x834e('0x15')]=_0x1dfa2e;if(_0x5ede29['query'][_0x834e('0x42')]){_0x1f3e26[_0x834e('0x2b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x834e('0x2d')](_0x1f3e26);})[_0x834e('0x18')](function(_0xbf7693){_0x23ce49[_0x834e('0x54')]=_0xbf7693;return _0x23ce49;});}})[_0x834e('0x18')](respondWithFilteredResult(_0x1e5252,_0x1f3e26))[_0x834e('0x2e')](handleError(_0x1e5252,null));};exports['getHopperBlacks']=function(_0x5a49fc,_0x43b92f){var _0x30ab20={'raw':!![],'where':{}};var _0x1d2e12={};var _0x58bdd6={'count':0x0,'rows':[]};return db[_0x834e('0x26')][_0x834e('0x4a')]({'where':{'id':_0x5a49fc['params']['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x43b92f,null))[_0x834e('0x18')](function(_0x216d1f){if(_0x216d1f){_0x1d2e12[_0x834e('0x32')]=_['keys'](db[_0x834e('0x58')]['rawAttributes']);_0x1d2e12['query']=_[_0x834e('0x30')](_0x5a49fc[_0x834e('0x2c')]);_0x1d2e12[_0x834e('0x31')]=_[_0x834e('0x34')](_0x1d2e12[_0x834e('0x32')],_0x1d2e12[_0x834e('0x2c')]);_0x30ab20['attributes']=_['intersection'](_0x1d2e12[_0x834e('0x32')],qs[_0x834e('0x35')](_0x5a49fc[_0x834e('0x2c')][_0x834e('0x35')]));_0x30ab20[_0x834e('0x33')]=_0x30ab20[_0x834e('0x33')][_0x834e('0x36')]?_0x30ab20['attributes']:_0x1d2e12[_0x834e('0x32')];if(!_0x5a49fc[_0x834e('0x2c')]['hasOwnProperty'](_0x834e('0x4c'))){_0x30ab20[_0x834e('0x13')]=qs[_0x834e('0x13')](_0x5a49fc[_0x834e('0x2c')][_0x834e('0x13')]);_0x30ab20[_0x834e('0x12')]=qs[_0x834e('0x12')](_0x5a49fc[_0x834e('0x2c')][_0x834e('0x12')]);}_0x30ab20[_0x834e('0x4d')]=qs[_0x834e('0x4e')](_0x5a49fc[_0x834e('0x2c')][_0x834e('0x4e')]);_0x30ab20[_0x834e('0x51')]=qs['filters'](_[_0x834e('0x4f')](_0x5a49fc[_0x834e('0x2c')],_0x1d2e12['filters']));_0x30ab20[_0x834e('0x51')]['VoiceQueueId']=_0x216d1f['id'];if(_0x5a49fc[_0x834e('0x2c')]['filter']){_0x30ab20[_0x834e('0x51')]=_['merge'](_0x30ab20[_0x834e('0x51')],{'$or':_[_0x834e('0x1f')](_0x30ab20[_0x834e('0x33')],function(_0x1aac37){var _0x57ee25={};_0x57ee25[_0x1aac37]={'$like':'%'+_0x5a49fc[_0x834e('0x2c')][_0x834e('0x52')]+'%'};return _0x57ee25;})});}_0x30ab20=_[_0x834e('0x43')]({},_0x30ab20,_0x5a49fc[_0x834e('0x44')]);return db[_0x834e('0x58')][_0x834e('0x15')]({'where':_0x30ab20[_0x834e('0x51')]})[_0x834e('0x18')](function(_0x2aa430){_0x58bdd6[_0x834e('0x15')]=_0x2aa430;if(_0x5a49fc[_0x834e('0x2c')][_0x834e('0x42')]){_0x30ab20[_0x834e('0x2b')]=[{'all':!![]}];}return db[_0x834e('0x58')][_0x834e('0x2d')](_0x30ab20);})[_0x834e('0x18')](function(_0xe84914){_0x58bdd6['rows']=_0xe84914;return _0x58bdd6;});}})['then'](respondWithFilteredResult(_0x43b92f,_0x30ab20))[_0x834e('0x2e')](handleError(_0x43b92f,null));};exports[_0x834e('0x59')]=function(_0x3f52b9,_0x213303){var _0x3bf1b6={};var _0x31f336={};var _0x22f90d;var _0x40fd40;return db[_0x834e('0x26')][_0x834e('0x4a')]({'where':{'id':_0x3f52b9[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x213303,null))['then'](function(_0x1bd254){if(_0x1bd254){_0x22f90d=_0x1bd254;_0x31f336['model']=_[_0x834e('0x30')](db[_0x834e('0x5a')][_0x834e('0x27')]);_0x31f336['query']=_[_0x834e('0x30')](_0x3f52b9[_0x834e('0x2c')]);_0x31f336['filters']=_['intersection'](_0x31f336[_0x834e('0x32')],_0x31f336[_0x834e('0x2c')]);_0x3bf1b6['attributes']=_[_0x834e('0x34')](_0x31f336[_0x834e('0x32')],qs[_0x834e('0x35')](_0x3f52b9[_0x834e('0x2c')][_0x834e('0x35')]));_0x3bf1b6['attributes']=_0x3bf1b6['attributes'][_0x834e('0x36')]?_0x3bf1b6['attributes']:_0x31f336['model'];_0x3bf1b6['order']=qs[_0x834e('0x4e')](_0x3f52b9[_0x834e('0x2c')]['sort']);_0x3bf1b6[_0x834e('0x51')]=qs[_0x834e('0x31')](_[_0x834e('0x4f')](_0x3f52b9[_0x834e('0x2c')],_0x31f336['filters']));if(_0x3f52b9[_0x834e('0x2c')][_0x834e('0x52')]){_0x3bf1b6[_0x834e('0x51')]=_['merge'](_0x3bf1b6[_0x834e('0x51')],{'$or':_['map'](_0x3bf1b6[_0x834e('0x33')],function(_0x4af2a2){var _0x461420={};_0x461420[_0x4af2a2]={'$like':'%'+_0x3f52b9[_0x834e('0x2c')]['filter']+'%'};return _0x461420;})});}_0x3bf1b6=_[_0x834e('0x43')]({},_0x3bf1b6,_0x3f52b9[_0x834e('0x44')]);return _0x22f90d[_0x834e('0x59')](_0x3bf1b6);}})[_0x834e('0x18')](function(_0x410895){if(_0x410895){_0x40fd40=_0x410895[_0x834e('0x36')];if(!_0x3f52b9['query'][_0x834e('0x4b')](_0x834e('0x4c'))){_0x3bf1b6[_0x834e('0x13')]=qs[_0x834e('0x13')](_0x3f52b9[_0x834e('0x2c')][_0x834e('0x13')]);_0x3bf1b6['offset']=qs[_0x834e('0x12')](_0x3f52b9['query']['offset']);}return _0x22f90d[_0x834e('0x59')](_0x3bf1b6);}})['then'](function(_0x4c5da4){if(_0x4c5da4){return _0x4c5da4?{'count':_0x40fd40,'rows':_0x4c5da4}:null;}})[_0x834e('0x18')](respondWithResult(_0x213303,null))[_0x834e('0x2e')](handleError(_0x213303,null));};exports[_0x834e('0x5b')]=function(_0x2e5886,_0x38fbc4){var _0x3e0ee6=_0x2e5886[_0x834e('0x38')][_0x834e('0x5c')];var _0x1d3ca9=_[_0x834e('0x1f')](_0x3e0ee6,'id');return db[_0x834e('0x5a')][_0x834e('0x2d')]({'where':{'id':_0x1d3ca9},'attributes':['id'],'include':[{'model':db[_0x834e('0x5d')],'as':_0x834e('0x5e'),'attributes':['id','name',_0x834e('0x5f'),'voicePause',_0x834e('0x60')],'raw':!![]}]})[_0x834e('0x18')](function(_0x284412){if(_0x284412){var _0x2cdbe0=_['flatMap'](_0x284412,function(_0x5f558a){var _0x37d8dd=_0x5f558a[_0x834e('0x1a')]({'plain':!![]});_0x37d8dd['Agents'][_0x834e('0x61')](function(_0xfa7b14){_0xfa7b14['penalty']=_[_0x834e('0x3c')](_0x3e0ee6,{'id':_0x37d8dd['id']})[_0x834e('0x62')];});return _0x37d8dd[_0x834e('0x5e')];});return db[_0x834e('0x26')]['find']({'where':{'id':_0x2e5886['params']['id']}})['then'](function(_0x48e14c){return db[_0x834e('0x63')][_0x834e('0x64')](function(_0x47891e){return _0x48e14c[_0x834e('0x5b')](_0x1d3ca9,{'transaction':_0x47891e})['then'](function(){return BPromise[_0x834e('0x65')](_0x3e0ee6,function(_0x13b39a){return db[_0x834e('0x66')][_0x834e('0x67')]({'TeamId':_0x13b39a['id'],'VoiceQueueId':_0x2e5886[_0x834e('0x41')]['id'],'penalty':_0x13b39a[_0x834e('0x62')]},{'transaction':_0x47891e});});})[_0x834e('0x18')](function(){return BPromise['each'](_0x2cdbe0,function(_0x12a0f3){return db[_0x834e('0x68')]['findOrCreate']({'where':{'UserId':_0x12a0f3['id'],'VoiceQueueId':_0x2e5886[_0x834e('0x41')]['id']},'defaults':{'penalty':_0x12a0f3[_0x834e('0x62')]},'transaction':_0x47891e});});})['then'](function(){return BPromise['each'](_['filter'](_0x2cdbe0,{'online':!![]}),function(_0x3edbbb){return db[_0x834e('0x69')][_0x834e('0x67')]({'membername':_0x3edbbb['name'],'UserId':_0x3edbbb['id'],'queue_name':_0x48e14c[_0x834e('0x25')],'VoiceQueueId':_0x48e14c['id'],'interface':_[_0x834e('0x6a')](_0x3edbbb[_0x834e('0x60')])?util[_0x834e('0x6b')](_0x834e('0x6c'),_0x3edbbb[_0x834e('0x25')]):_0x3edbbb[_0x834e('0x60')],'paused':_0x3edbbb[_0x834e('0x6d')]||![],'penalty':_0x3edbbb[_0x834e('0x62')]},{'transaction':_0x47891e});});})[_0x834e('0x18')](function(){_0x2cdbe0['forEach'](function(_0x5d6b66){socket[_0x834e('0x6e')](_0x834e('0x6f'),{'UserId':_0x5d6b66['id'],'VoiceQueueId':_0x48e14c['id']});});});});});}})[_0x834e('0x18')](respondWithStatusCode(_0x38fbc4,null))[_0x834e('0x2e')](handleError(_0x38fbc4,null));};exports[_0x834e('0x70')]=function(_0xd22e8f,_0x281922){return db[_0x834e('0x5a')][_0x834e('0x2d')]({'where':{'id':_0xd22e8f[_0x834e('0x2c')][_0x834e('0x71')]},'attributes':['id'],'include':[{'model':db[_0x834e('0x5d')],'as':_0x834e('0x5e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x281922,null))[_0x834e('0x18')](function(_0x3b13be){var _0x3f5b2e=_[_0x834e('0x1f')](_0x3b13be,'id');var _0x495697=[];var _0x5943a3=[];var _0x4e7c43=squel[_0x834e('0x72')]();_0x4e7c43[_0x834e('0x73')](_0x834e('0x74'))[_0x834e('0x75')](_0x834e('0x76'),'tq')[_0x834e('0x77')](_0x834e('0x78'),'ut',_0x834e('0x79'))['where']('VoiceQueueId\x20=\x20?',_0xd22e8f['params']['id']);for(var _0x5a5602=0x0;_0x5a5602<_0x3b13be[_0x834e('0x36')];_0x5a5602+=0x1){let _0xd108fa=_0x3b13be[_0x5a5602];for(var _0x37defd=0x0;_0x37defd<_0xd108fa[_0x834e('0x5e')][_0x834e('0x36')];_0x37defd+=0x1){let _0x386e10=_0xd108fa[_0x834e('0x5e')][_0x37defd];var _0x29ef2f=_0x4e7c43[_0x834e('0x7a')]();_0x29ef2f['where']('ut.UserId\x20=\x20?',_0x386e10['id']);_0x5943a3['push'](db['sequelize'][_0x834e('0x2c')](_0x29ef2f[_0x834e('0x7b')](),{'type':db[_0x834e('0x63')][_0x834e('0x7c')][_0x834e('0x7d')]})[_0x834e('0x18')](function(_0x416bea){if(_0x416bea[_0x834e('0x36')]===0x1){return _0x386e10['id'];}else{var _0x86d08c=_[_0x834e('0x7e')](_[_0x834e('0x1f')](_0x416bea,_0x834e('0x7f')),function(_0x1fd72b){return _[_0x834e('0x80')](_0x3f5b2e,_0x1fd72b);});if(_0x86d08c){return _0x386e10['id'];}}}));}}return BPromise[_0x834e('0x81')](_0x5943a3)[_0x834e('0x18')](function(_0x5022f2){_0x495697=_(_0x495697)[_0x834e('0x82')](_0x5022f2)['compact']()[_0x834e('0x20')]();return db[_0x834e('0x26')][_0x834e('0x3c')]({'where':{'id':_0xd22e8f['params']['id']}})[_0x834e('0x18')](function(_0x3d9d85){return db['sequelize']['transaction'](function(_0x1c3b23){return _0x3d9d85[_0x834e('0x70')](_0xd22e8f[_0x834e('0x2c')][_0x834e('0x71')],{'transaction':_0x1c3b23})[_0x834e('0x18')](function(){if(!_[_0x834e('0x83')](_0x495697)){return _0x3d9d85[_0x834e('0x84')](_0x495697,{'transaction':_0x1c3b23})[_0x834e('0x18')](function(){return db['UserVoiceQueueRt'][_0x834e('0x19')]({'where':{'VoiceQueueId':_0xd22e8f[_0x834e('0x41')]['id'],'UserId':_0x495697},'transaction':_0x1c3b23});});}})[_0x834e('0x18')](function(){_0x495697[_0x834e('0x61')](function(_0x1912e6){socket[_0x834e('0x6e')](_0x834e('0x85'),{'UserId':_0x1912e6,'VoiceQueueId':_0x3d9d85['id']});});});});});});})['then'](respondWithStatusCode(_0x281922,null))[_0x834e('0x2e')](handleError(_0x281922,null));};exports['addAgents']=function(_0x586fa5,_0x1115b7){var _0x1e0bc9,_0x4b16fa;return db[_0x834e('0x26')][_0x834e('0x3c')]({'where':{'id':_0x586fa5['params']['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x1115b7,null))[_0x834e('0x18')](function(_0x5d994e){if(_0x5d994e){_0x4b16fa=_0x5d994e;return _0x5d994e['addAgents'](_0x586fa5[_0x834e('0x38')][_0x834e('0x71')],_['omit'](_0x586fa5['body'],[_0x834e('0x71'),'id'])||{})[_0x834e('0x86')](function(_0x5d6f5e){for(var _0x480290=0x0;_0x480290<_0x586fa5['body']['ids'][_0x834e('0x36')];_0x480290+=0x1){socket['emit'](_0x834e('0x6f'),{'UserId':Number(_0x586fa5['body'][_0x834e('0x71')][_0x480290]),'VoiceQueueId':Number(_0x586fa5[_0x834e('0x41')]['id'])});}return _0x5d6f5e;});}})[_0x834e('0x18')](function(_0x3d2569){_0x1e0bc9=_0x3d2569||[];if(_0x4b16fa){return db['User'][_0x834e('0x2d')]({'where':{'id':_0x586fa5[_0x834e('0x38')][_0x834e('0x71')]},'attributes':['id',_0x834e('0x25'),_0x834e('0x5f'),_0x834e('0x6d'),_0x834e('0x60')],'raw':!![]});}})[_0x834e('0x18')](function(_0x464ae6){if(!_[_0x834e('0x83')](_0x464ae6)){var _0x590e52=[];for(var _0x40e12e=0x0;_0x40e12e<_0x464ae6['length'];_0x40e12e++){if(_0x464ae6[_0x40e12e][_0x834e('0x5f')]){_0x590e52[_0x834e('0x87')](db[_0x834e('0x69')][_0x834e('0x67')]({'membername':_0x464ae6[_0x40e12e][_0x834e('0x25')],'UserId':_0x464ae6[_0x40e12e]['id'],'queue_name':_0x4b16fa['name'],'VoiceQueueId':_0x4b16fa['id'],'interface':_[_0x834e('0x6a')](_0x464ae6[_0x40e12e]['interface'])?util['format'](_0x834e('0x6c'),_0x464ae6[_0x40e12e][_0x834e('0x25')]):_0x464ae6[_0x40e12e][_0x834e('0x60')],'paused':_0x464ae6[_0x40e12e]['voicePause']||![],'penalty':_0x586fa5[_0x834e('0x38')][_0x834e('0x62')]||0x0}));}}return BPromise[_0x834e('0x81')](_0x590e52);}})[_0x834e('0x18')](function(){return _0x1e0bc9;})[_0x834e('0x18')](respondWithResult(_0x1115b7,null))[_0x834e('0x2e')](handleError(_0x1115b7,null));};exports[_0x834e('0x84')]=function(_0x687dab,_0x125787){return db[_0x834e('0x26')][_0x834e('0x3c')]({'where':{'id':_0x687dab['params']['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x125787,null))[_0x834e('0x18')](function(_0x121d4f){if(_0x121d4f){return _0x121d4f[_0x834e('0x84')](_0x687dab[_0x834e('0x2c')][_0x834e('0x71')])['then'](function(){if(_[_0x834e('0x88')](_0x687dab[_0x834e('0x2c')][_0x834e('0x71')])){for(var _0x37dea1=0x0;_0x37dea1<_0x687dab[_0x834e('0x2c')][_0x834e('0x71')][_0x834e('0x36')];_0x37dea1+=0x1){socket[_0x834e('0x6e')](_0x834e('0x85'),{'UserId':Number(_0x687dab[_0x834e('0x2c')]['ids'][_0x37dea1]),'VoiceQueueId':Number(_0x687dab['params']['id'])});}}else{socket[_0x834e('0x6e')]('userVoiceQueue:remove',{'UserId':Number(_0x687dab[_0x834e('0x2c')][_0x834e('0x71')]),'VoiceQueueId':Number(_0x687dab[_0x834e('0x41')]['id'])});}});}})[_0x834e('0x18')](function(_0x1daa58){return db[_0x834e('0x69')]['destroy']({'where':{'VoiceQueueId':_0x687dab[_0x834e('0x41')]['id'],'UserId':_0x687dab['query']['ids']}})['then'](function(){return _0x1daa58;});})[_0x834e('0x18')](respondWithStatusCode(_0x125787,null))[_0x834e('0x2e')](handleError(_0x125787,null));};exports['getAgents']=function(_0x5cb379,_0x494e08){var _0x2515f6={};var _0x45c8e6={};var _0x3512d8;var _0x5e0bfe;return db[_0x834e('0x26')][_0x834e('0x4a')]({'where':{'id':_0x5cb379[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x494e08,null))[_0x834e('0x18')](function(_0x3c1a19){if(_0x3c1a19){_0x3512d8=_0x3c1a19;_0x45c8e6['model']=_['keys'](db['User']['rawAttributes']);_0x45c8e6[_0x834e('0x2c')]=_[_0x834e('0x30')](_0x5cb379[_0x834e('0x2c')]);_0x45c8e6[_0x834e('0x31')]=_[_0x834e('0x34')](_0x45c8e6[_0x834e('0x32')],_0x45c8e6[_0x834e('0x2c')]);_0x2515f6[_0x834e('0x33')]=_[_0x834e('0x34')](_0x45c8e6[_0x834e('0x32')],qs[_0x834e('0x35')](_0x5cb379[_0x834e('0x2c')][_0x834e('0x35')]));_0x2515f6[_0x834e('0x33')]=_0x2515f6[_0x834e('0x33')]['length']?_0x2515f6['attributes']:_0x45c8e6[_0x834e('0x32')];_0x2515f6[_0x834e('0x4d')]=qs[_0x834e('0x4e')](_0x5cb379['query'][_0x834e('0x4e')]);_0x2515f6[_0x834e('0x51')]=qs[_0x834e('0x31')](_[_0x834e('0x4f')](_0x5cb379[_0x834e('0x2c')],_0x45c8e6[_0x834e('0x31')]));if(_0x5cb379[_0x834e('0x2c')][_0x834e('0x52')]){_0x2515f6[_0x834e('0x51')]=_['merge'](_0x2515f6[_0x834e('0x51')],{'$or':_[_0x834e('0x1f')](_0x2515f6[_0x834e('0x33')],function(_0x2f1de8){var _0x4b6834={};_0x4b6834[_0x2f1de8]={'$like':'%'+_0x5cb379[_0x834e('0x2c')][_0x834e('0x52')]+'%'};return _0x4b6834;})});}_0x2515f6=_[_0x834e('0x43')]({},_0x2515f6,_0x5cb379[_0x834e('0x44')]);return _0x3512d8[_0x834e('0x89')](_0x2515f6);}})[_0x834e('0x18')](function(_0x3f6ead){if(_0x3f6ead){_0x5e0bfe=_0x3f6ead[_0x834e('0x36')];if(!_0x5cb379[_0x834e('0x2c')]['hasOwnProperty'](_0x834e('0x4c'))){_0x2515f6['limit']=qs[_0x834e('0x13')](_0x5cb379['query'][_0x834e('0x13')]);_0x2515f6[_0x834e('0x12')]=qs[_0x834e('0x12')](_0x5cb379[_0x834e('0x2c')][_0x834e('0x12')]);}return _0x3512d8['getAgents'](_0x2515f6);}})[_0x834e('0x18')](function(_0x29f970){if(_0x29f970){return _0x29f970?{'count':_0x5e0bfe,'rows':_0x29f970}:null;}})['then'](respondWithResult(_0x494e08,null))['catch'](handleError(_0x494e08,null));};exports[_0x834e('0x8a')]=function(_0x4db3c5,_0x4e6a75){var _0x57a989={};var _0x26cb93={};var _0x39bd0c;var _0xbd9400;return db[_0x834e('0x26')][_0x834e('0x4a')]({'where':{'id':_0x4db3c5[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x4e6a75,null))['then'](function(_0x28825c){if(_0x28825c){_0x39bd0c=_0x28825c;_0x26cb93[_0x834e('0x32')]=_['keys'](db['UserVoiceQueueRt'][_0x834e('0x27')]);_0x26cb93[_0x834e('0x2c')]=_['keys'](_0x4db3c5['query']);_0x26cb93[_0x834e('0x31')]=_[_0x834e('0x34')](_0x26cb93[_0x834e('0x32')],_0x26cb93['query']);_0x57a989[_0x834e('0x33')]=_[_0x834e('0x34')](_0x26cb93[_0x834e('0x32')],qs['fields'](_0x4db3c5[_0x834e('0x2c')]['fields']));_0x57a989[_0x834e('0x33')]=_0x57a989[_0x834e('0x33')][_0x834e('0x36')]?_0x57a989[_0x834e('0x33')]:_0x26cb93[_0x834e('0x32')];_0x57a989['order']=qs[_0x834e('0x4e')](_0x4db3c5[_0x834e('0x2c')][_0x834e('0x4e')]);_0x57a989[_0x834e('0x51')]=qs[_0x834e('0x31')](_['pick'](_0x4db3c5['query'],_0x26cb93[_0x834e('0x31')]));if(_0x4db3c5[_0x834e('0x2c')][_0x834e('0x52')]){_0x57a989['where']=_[_0x834e('0x43')](_0x57a989[_0x834e('0x51')],{'$or':_[_0x834e('0x1f')](_0x57a989[_0x834e('0x33')],function(_0x53faec){var _0x3cc563={};_0x3cc563[_0x53faec]={'$like':'%'+_0x4db3c5[_0x834e('0x2c')]['filter']+'%'};return _0x3cc563;})});}_0x57a989=_[_0x834e('0x43')]({},_0x57a989,_0x4db3c5[_0x834e('0x44')]);return _0x39bd0c[_0x834e('0x8a')](_0x57a989);}})[_0x834e('0x18')](function(_0x4b0246){if(_0x4b0246){_0xbd9400=_0x4b0246[_0x834e('0x36')];if(!_0x4db3c5['query'][_0x834e('0x4b')](_0x834e('0x4c'))){_0x57a989[_0x834e('0x13')]=qs[_0x834e('0x13')](_0x4db3c5[_0x834e('0x2c')][_0x834e('0x13')]);_0x57a989['offset']=qs['offset'](_0x4db3c5[_0x834e('0x2c')][_0x834e('0x12')]);}return _0x39bd0c['getMembers'](_0x57a989);}})[_0x834e('0x18')](function(_0x4af796){return _0x4af796?{'count':_0xbd9400,'rows':_0x4af796}:null;})[_0x834e('0x18')](respondWithResult(_0x4e6a75,null))[_0x834e('0x2e')](handleError(_0x4e6a75,null));};exports[_0x834e('0x8b')]=function(_0x151b58,_0x2ec7b0){var _0x1ca24b={};var _0x36836f={};var _0x56ae60;var _0x122b03;return db[_0x834e('0x26')][_0x834e('0x4a')]({'where':{'id':_0x151b58[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x2ec7b0,null))['then'](function(_0x167642){if(_0x167642){_0x56ae60=_0x167642;_0x36836f[_0x834e('0x32')]=_[_0x834e('0x30')](db['CmList']['rawAttributes']);_0x36836f['query']=_[_0x834e('0x30')](_0x151b58[_0x834e('0x2c')]);_0x36836f[_0x834e('0x31')]=_[_0x834e('0x34')](_0x36836f[_0x834e('0x32')],_0x36836f[_0x834e('0x2c')]);_0x1ca24b[_0x834e('0x33')]=_[_0x834e('0x34')](_0x36836f[_0x834e('0x32')],qs[_0x834e('0x35')](_0x151b58[_0x834e('0x2c')]['fields']));_0x1ca24b[_0x834e('0x33')]=_0x1ca24b[_0x834e('0x33')][_0x834e('0x36')]?_0x1ca24b[_0x834e('0x33')]:_0x36836f[_0x834e('0x32')];_0x1ca24b[_0x834e('0x4d')]=qs[_0x834e('0x4e')](_0x151b58[_0x834e('0x2c')]['sort']);_0x1ca24b[_0x834e('0x51')]=qs[_0x834e('0x31')](_['pick'](_0x151b58[_0x834e('0x2c')],_0x36836f[_0x834e('0x31')]));if(_0x151b58[_0x834e('0x2c')][_0x834e('0x52')]){_0x1ca24b['where']=_['merge'](_0x1ca24b[_0x834e('0x51')],{'$or':_['map'](_0x1ca24b[_0x834e('0x33')],function(_0x433cb4){var _0x18638d={};_0x18638d[_0x433cb4]={'$like':'%'+_0x151b58[_0x834e('0x2c')][_0x834e('0x52')]+'%'};return _0x18638d;})});}_0x1ca24b=_['merge']({},_0x1ca24b,_0x151b58[_0x834e('0x44')]);return _0x56ae60['getLists'](_0x1ca24b);}})['then'](function(_0x3d8b08){if(_0x3d8b08){_0x122b03=_0x3d8b08[_0x834e('0x36')];if(!_0x151b58[_0x834e('0x2c')][_0x834e('0x4b')](_0x834e('0x4c'))){_0x1ca24b[_0x834e('0x13')]=qs['limit'](_0x151b58[_0x834e('0x2c')][_0x834e('0x13')]);_0x1ca24b['offset']=qs[_0x834e('0x12')](_0x151b58[_0x834e('0x2c')]['offset']);}return _0x56ae60[_0x834e('0x8b')](_0x1ca24b);}})[_0x834e('0x18')](function(_0x47a239){if(_0x47a239){return _0x47a239?{'count':_0x122b03,'rows':_0x47a239}:null;}})[_0x834e('0x18')](respondWithResult(_0x2ec7b0,null))[_0x834e('0x2e')](handleError(_0x2ec7b0,null));};exports[_0x834e('0x8c')]=function(_0x3b658a,_0x34a13d){var _0x29b8fd=moment()[_0x834e('0x6b')](_0x834e('0x8d'));var _0x208bbe,_0xe0b3;return db['VoiceQueue'][_0x834e('0x3c')]({'where':{'id':_0x3b658a[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x34a13d,null))[_0x834e('0x18')](function(_0x371767){if(_0x371767){_0xe0b3=_0x371767;return _0x371767[_0x834e('0x8c')](_0x3b658a[_0x834e('0x38')][_0x834e('0x71')],_[_0x834e('0x45')](_0x3b658a[_0x834e('0x38')],[_0x834e('0x71'),'id'])||{});}return null;})[_0x834e('0x86')](function(_0x5af6fc){var _0x2ddbc0;_0x208bbe=_0x5af6fc||[];var _0x1cd122=[];if(_0x5af6fc){for(var _0x49be08=0x0;_0x49be08<_0x5af6fc['length'];_0x49be08+=0x1){var _0x563f20=_0x5af6fc[_0x49be08][_0x834e('0x1a')]({'plain':!![]});_0xe0b3[_0x834e('0x8e')]=_0x3b658a[_0x834e('0x38')][_0x834e('0x8e')]?_0x3b658a[_0x834e('0x38')][_0x834e('0x8e')]:_0xe0b3[_0x834e('0x8e')];switch(_0xe0b3['dialCheckDuplicateType']){case'always':_0x2ddbc0=squel['insert']()['into'](_0x834e('0x8f'))[_0x834e('0x90')]([_0x834e('0x91'),'scheduledAt','ContactId','ListId',_0x834e('0x50'),'createdAt','updatedAt'],squel[_0x834e('0x72')]()[_0x834e('0x73')](_0x834e('0x91'),_0x834e('0x91'))[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27',_0x834e('0x92'))[_0x834e('0x73')]('id','ContactId')[_0x834e('0x73')](_0x563f20[_0x834e('0x93')][_0x834e('0x7b')](),_0x834e('0x94'))[_0x834e('0x73')](_0x3b658a['params']['id'][_0x834e('0x7b')](),'VoiceQueueId')[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27',_0x834e('0x46'))[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27','updatedAt')['from']('cm_contacts')['where'](_0x834e('0x95'))[_0x834e('0x51')]('ListId\x20=\x20?',_0x563f20['CmListId'][_0x834e('0x7b')]())[_0x834e('0x51')](_0x834e('0x96'))['where'](_0x834e('0x97'),squel[_0x834e('0x72')]()[_0x834e('0x73')]('COALESCE(calleridnum,\x27\x27)')[_0x834e('0x75')](_0x834e('0x98'))[_0x834e('0x51')](_0x834e('0x99'),_0x3b658a[_0x834e('0x41')]['id'][_0x834e('0x7b')]()))[_0x834e('0x51')]('phone\x20NOT\x20IN\x20(?)',squel[_0x834e('0x72')]()[_0x834e('0x73')](_0x834e('0x9a'))['from'](_0x834e('0x8f'))[_0x834e('0x51')](_0x834e('0x99'),_0x3b658a[_0x834e('0x41')]['id'][_0x834e('0x7b')]())))[_0x834e('0x7b')]();break;case _0x834e('0x9b'):_0x2ddbc0=squel[_0x834e('0x9c')]()[_0x834e('0x9d')](_0x834e('0x8f'))[_0x834e('0x90')]([_0x834e('0x91'),'scheduledAt',_0x834e('0x9e'),'ListId',_0x834e('0x50'),'createdAt',_0x834e('0x47')],squel[_0x834e('0x72')]()[_0x834e('0x73')](_0x834e('0x91'),_0x834e('0x91'))[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27',_0x834e('0x92'))[_0x834e('0x73')]('id','ContactId')['field'](_0x563f20['CmListId'][_0x834e('0x7b')](),_0x834e('0x94'))[_0x834e('0x73')](_0x3b658a[_0x834e('0x41')]['id'][_0x834e('0x7b')](),_0x834e('0x50'))[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27',_0x834e('0x46'))['field']('\x27'+_0x29b8fd+'\x27','updatedAt')[_0x834e('0x75')](_0x834e('0x9f'))[_0x834e('0x51')]('deletedAt\x20IS\x20NULL')['where'](_0x834e('0xa0'),_0x563f20['CmListId'][_0x834e('0x7b')]())[_0x834e('0x51')](_0x834e('0x96'))['where'](_0x834e('0x97'),squel[_0x834e('0x72')]()[_0x834e('0x73')](_0x834e('0x9a'))[_0x834e('0x75')](_0x834e('0x8f'))[_0x834e('0x51')]('VoiceQueueId\x20=\x20?',_0x3b658a[_0x834e('0x41')]['id'][_0x834e('0x7b')]())))[_0x834e('0x7b')]();break;default:_0x2ddbc0=squel[_0x834e('0x9c')]()[_0x834e('0x9d')](_0x834e('0x8f'))[_0x834e('0x90')](['phone','scheduledAt',_0x834e('0x9e'),'ListId','VoiceQueueId',_0x834e('0x46'),_0x834e('0x47')],squel['select']()[_0x834e('0x73')]('phone','phone')[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27','scheduledAt')[_0x834e('0x73')]('id',_0x834e('0x9e'))[_0x834e('0x73')](_0x563f20[_0x834e('0x93')][_0x834e('0x7b')](),_0x834e('0x94'))[_0x834e('0x73')](_0x3b658a[_0x834e('0x41')]['id'][_0x834e('0x7b')](),'VoiceQueueId')[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27',_0x834e('0x46'))[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27',_0x834e('0x47'))['from']('cm_contacts')[_0x834e('0x51')](_0x834e('0x95'))['where'](_0x834e('0xa0'),_0x563f20['CmListId'][_0x834e('0x7b')]())[_0x834e('0x51')](_0x834e('0x96')))[_0x834e('0x7b')]();}_0x1cd122[_0x834e('0x87')](db[_0x834e('0x63')]['query'](_0x2ddbc0));}return BPromise['all'](_0x1cd122);}})['then'](function(){var _0xbafedb=[];var _0x1d004f=squel[_0x834e('0x9c')]()['into']('cm_hopper_additional_phones')[_0x834e('0x90')]([_0x834e('0xa1'),_0x834e('0x91'),_0x834e('0xa2'),_0x834e('0x46'),_0x834e('0x47')],squel[_0x834e('0x72')]()[_0x834e('0x73')](_0x834e('0xa3'))[_0x834e('0x73')](_0x834e('0xa4'))['field'](_0x834e('0xa5'))[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27','createdAt')[_0x834e('0x73')]('\x27'+_0x29b8fd+'\x27',_0x834e('0x47'))[_0x834e('0x75')](_0x834e('0xa6'),'ci')[_0x834e('0x77')](_0x834e('0x8f'),'h',_0x834e('0xa7'))[_0x834e('0x51')](_0x834e('0xa8'),_0x29b8fd)[_0x834e('0x51')](_0x834e('0xa9'),_0x834e('0xaa')))[_0x834e('0x7b')]();_0xbafedb[_0x834e('0x87')](db[_0x834e('0x63')][_0x834e('0x2c')](_0x1d004f));return BPromise[_0x834e('0x81')](_0xbafedb);})[_0x834e('0x18')](function(){return _0x208bbe;})[_0x834e('0x18')](respondWithResult(_0x34a13d,null))[_0x834e('0x2e')](handleError(_0x34a13d,null));};exports[_0x834e('0xab')]=function(_0x239efd,_0x2f7170){return db['VoiceQueue'][_0x834e('0x3c')]({'where':{'id':_0x239efd[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x2f7170,null))[_0x834e('0x18')](function(_0x3fd7a3){if(_0x3fd7a3){return _0x3fd7a3[_0x834e('0xab')](_0x239efd[_0x834e('0x2c')][_0x834e('0x71')]);}})[_0x834e('0x18')](function(_0x41d0a7){if(_0x41d0a7){return db[_0x834e('0x53')][_0x834e('0x19')]({'where':{'ListId':_0x239efd['query'][_0x834e('0x71')],'VoiceQueueId':_0x239efd[_0x834e('0x41')]['id']}})['then'](function(){return _0x41d0a7;});}})[_0x834e('0x18')](respondWithStatusCode(_0x2f7170,null))[_0x834e('0x2e')](handleError(_0x2f7170,null));};exports['getBlackLists']=function(_0x16a7a9,_0x18b8c7){var _0x576ece={};var _0x51c877={};var _0x54915f;var _0x32d06c;return db[_0x834e('0x26')][_0x834e('0x4a')]({'where':{'id':_0x16a7a9[_0x834e('0x41')]['id']}})['then'](handleEntityNotFound(_0x18b8c7,null))[_0x834e('0x18')](function(_0x132711){if(_0x132711){_0x54915f=_0x132711;_0x51c877[_0x834e('0x32')]=_['keys'](db[_0x834e('0xac')][_0x834e('0x27')]);_0x51c877[_0x834e('0x2c')]=_['keys'](_0x16a7a9[_0x834e('0x2c')]);_0x51c877[_0x834e('0x31')]=_['intersection'](_0x51c877[_0x834e('0x32')],_0x51c877[_0x834e('0x2c')]);_0x576ece['attributes']=_[_0x834e('0x34')](_0x51c877[_0x834e('0x32')],qs[_0x834e('0x35')](_0x16a7a9[_0x834e('0x2c')][_0x834e('0x35')]));_0x576ece['attributes']=_0x576ece['attributes'][_0x834e('0x36')]?_0x576ece[_0x834e('0x33')]:_0x51c877[_0x834e('0x32')];_0x576ece['order']=qs[_0x834e('0x4e')](_0x16a7a9[_0x834e('0x2c')][_0x834e('0x4e')]);_0x576ece[_0x834e('0x51')]=qs[_0x834e('0x31')](_[_0x834e('0x4f')](_0x16a7a9['query'],_0x51c877[_0x834e('0x31')]));if(_0x16a7a9[_0x834e('0x2c')][_0x834e('0x52')]){_0x576ece[_0x834e('0x51')]=_[_0x834e('0x43')](_0x576ece['where'],{'$or':_['map'](_0x576ece[_0x834e('0x33')],function(_0x5eca84){var _0xcb4fe4={};_0xcb4fe4[_0x5eca84]={'$like':'%'+_0x16a7a9[_0x834e('0x2c')][_0x834e('0x52')]+'%'};return _0xcb4fe4;})});}_0x576ece=_[_0x834e('0x43')]({},_0x576ece,_0x16a7a9[_0x834e('0x44')]);return _0x54915f[_0x834e('0xad')](_0x576ece);}})[_0x834e('0x18')](function(_0x5b4718){if(_0x5b4718){_0x32d06c=_0x5b4718[_0x834e('0x36')];if(!_0x16a7a9[_0x834e('0x2c')]['hasOwnProperty'](_0x834e('0x4c'))){_0x576ece[_0x834e('0x13')]=qs[_0x834e('0x13')](_0x16a7a9['query'][_0x834e('0x13')]);_0x576ece['offset']=qs[_0x834e('0x12')](_0x16a7a9['query'][_0x834e('0x12')]);}return _0x54915f[_0x834e('0xad')](_0x576ece);}})['then'](function(_0x3757bf){if(_0x3757bf){return _0x3757bf?{'count':_0x32d06c,'rows':_0x3757bf}:null;}})['then'](respondWithResult(_0x18b8c7,null))[_0x834e('0x2e')](handleError(_0x18b8c7,null));};exports[_0x834e('0xae')]=function(_0x395b48,_0x5b4208){var _0x4c9b90;return db[_0x834e('0x26')][_0x834e('0x3c')]({'where':{'id':_0x395b48[_0x834e('0x41')]['id']}})[_0x834e('0x18')](handleEntityNotFound(_0x5b4208,null))[_0x834e('0x18')](function(_0x414ff2){if(_0x414ff2){return _0x414ff2[_0x834e('0xae')](_0x395b48[_0x834e('0x38')][_0x834e('0x71')],_[_0x834e('0x45')](_0x395b48[_0x834e('0x38')],[_0x834e('0x71'),'id'])||{});}return null;})[_0x834e('0x86')](function(_0x3aeca7){var _0x1d9e00;_0x4c9b90=_0x3aeca7||[];var _0x11db76=[];if(_0x3aeca7){for(var _0x37f058=0x0;_0x37f058<_0x3aeca7[_0x834e('0x36')];_0x37f058+=0x1){var _0x354497=_0x3aeca7[_0x37f058]['get']({'plain':!![]});_0x1d9e00=squel[_0x834e('0x9c')]()['into'](_0x834e('0xaf'))[_0x834e('0x90')]([_0x834e('0x91'),_0x834e('0x9e'),_0x834e('0x94'),'VoiceQueueId',_0x834e('0x46'),_0x834e('0x47')],squel[_0x834e('0x72')]()[_0x834e('0x73')]('phone','phone')[_0x834e('0x73')]('id',_0x834e('0x9e'))[_0x834e('0x73')](_0x354497[_0x834e('0x93')]['toString'](),'ListId')['field'](_0x395b48['params']['id'][_0x834e('0x7b')](),'VoiceQueueId')[_0x834e('0x73')]('NOW()',_0x834e('0x46'))[_0x834e('0x73')](_0x834e('0xb0'),'updatedAt')[_0x834e('0x75')]('cm_contacts')[_0x834e('0x51')]('deletedAt\x20IS\x20NULL')[_0x834e('0x51')]('ListId\x20=\x20?',_0x354497[_0x834e('0x93')][_0x834e('0x7b')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x11db76['push'](db[_0x834e('0x63')][_0x834e('0x2c')](_0x1d9e00));}return BPromise['all'](_0x11db76);}})[_0x834e('0x18')](function(){return _0x4c9b90;})[_0x834e('0x18')](respondWithResult(_0x5b4208,null))[_0x834e('0x2e')](handleError(_0x5b4208,null));};exports['removeBlackLists']=function(_0x5cb260,_0x5b3fda){return db[_0x834e('0x26')][_0x834e('0x3c')]({'where':{'id':_0x5cb260[_0x834e('0x41')]['id']}})['then'](handleEntityNotFound(_0x5b3fda,null))[_0x834e('0x18')](function(_0x1e5e2a){if(_0x1e5e2a){return _0x1e5e2a[_0x834e('0xb1')](_0x5cb260[_0x834e('0x2c')][_0x834e('0x71')]);}})[_0x834e('0x18')](function(_0x549c2f){if(_0x549c2f){return db['CmHopperBlack'][_0x834e('0x19')]({'where':{'ListId':_0x5cb260[_0x834e('0x2c')][_0x834e('0x71')],'VoiceQueueId':_0x5cb260[_0x834e('0x41')]['id']}})[_0x834e('0x18')](function(){return _0x549c2f;});}})[_0x834e('0x18')](respondWithStatusCode(_0x5b3fda,null))[_0x834e('0x2e')](handleError(_0x5b3fda,null));}; \ No newline at end of file +var _0xe14b=['QueueCampaigns','outbound','filter','map','value','type','find','name','end','error','stack','index','VoiceQueue','rawAttributes','fieldName','key','getOptions','where','include','show','params','model','keys','query','intersection','attributes','fields','length','includeAll','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','autoAssociation','UserProfileResource','clone','merge','omit','createdAt','updatedAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','filters','hasOwnProperty','nolimit','order','sort','pick','VoiceQueueId','findAll','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','Agents','online','interface','flatMap','penalty','sequelize','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','voicePause','forEach','emit','userVoiceQueue:save','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','transaction','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','bluebird','squel','ioredis','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','inbound'];(function(_0x57b74b,_0x65317d){var _0x136375=function(_0x4f3bf5){while(--_0x4f3bf5){_0x57b74b['push'](_0x57b74b['shift']());}};_0x136375(++_0x65317d);}(_0xe14b,0x93));var _0xbe14=function(_0x13a291,_0x269ee8){_0x13a291=_0x13a291-0x0;var _0x1540c7=_0xe14b[_0x13a291];return _0x1540c7;};'use strict';var moment=require(_0xbe14('0x0'));var BPromise=require(_0xbe14('0x1'));var util=require('util');var _=require('lodash');var squel=require(_0xbe14('0x2'));var Redis=require(_0xbe14('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xbe14('0x4'))('api');var config=require('../../config/environment');var db=require(_0xbe14('0x5'))['db'];config[_0xbe14('0x6')]=_[_0xbe14('0x7')](config[_0xbe14('0x6')],{'host':_0xbe14('0x8'),'port':0x18eb});var socket=require(_0xbe14('0x9'))(new Redis(config[_0xbe14('0x6')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x496063,_0x30c355){_0x30c355=_0x30c355||0xcc;return function(_0x6fceff){if(_0x6fceff){return _0x496063[_0xbe14('0xa')](_0x30c355);}return _0x496063[_0xbe14('0xb')](_0x30c355)['end']();};}function respondWithResult(_0x5b9fc6,_0x113243){_0x113243=_0x113243||0xc8;return function(_0x3f70cb){if(_0x3f70cb){return _0x5b9fc6['status'](_0x113243)[_0xbe14('0xc')](_0x3f70cb);}};}function respondWithFilteredResult(_0x35aa19,_0x886a5e){return function(_0x3d38c2){if(_0x3d38c2){var _0x27792f=typeof _0x886a5e[_0xbe14('0xd')]===_0xbe14('0xe')&&typeof _0x886a5e[_0xbe14('0xf')]===_0xbe14('0xe');var _0xa2cf72=_0x3d38c2[_0xbe14('0x10')];var _0x33fd54=_0x27792f?0x0:_0x886a5e[_0xbe14('0xd')];var _0x530538=_0x27792f?_0x3d38c2['count']:_0x886a5e[_0xbe14('0xd')]+_0x886a5e[_0xbe14('0xf')];var _0xf4ac9;if(_0x530538>=_0xa2cf72){_0x530538=_0xa2cf72;_0xf4ac9=0xc8;}else{_0xf4ac9=0xce;}_0x35aa19[_0xbe14('0xb')](_0xf4ac9);return _0x35aa19['set'](_0xbe14('0x11'),_0x33fd54+'-'+_0x530538+'/'+_0xa2cf72)[_0xbe14('0xc')](_0x3d38c2);}return null;};}function saveUpdates(_0xfd7b8f){return function(_0x123ede){if(_0x123ede){return _0x123ede[_0xbe14('0x12')](_0xfd7b8f)[_0xbe14('0x13')](function(_0x17ae86){return _0x17ae86;});}return null;};}function removeEntity(_0x5ea1f8){return function(_0x137ee5){if(_0x137ee5){return _0x137ee5[_0xbe14('0x14')]()[_0xbe14('0x13')](function(){var _0x433459=_0x137ee5[_0xbe14('0x15')]({'plain':!![]});var _0x37e4c1=[{'name':'VoiceQueues','value':_0xbe14('0x16'),'ignore':![]},{'name':_0xbe14('0x17'),'value':_0xbe14('0x18'),'ignore':![]}];var _0xc12977=_(_0x37e4c1)[_0xbe14('0x19')]('ignore')[_0xbe14('0x1a')]('value')[_0xbe14('0x1b')]();if(_['includes'](_0xc12977,_0x433459[_0xbe14('0x1c')])){return;}var _0x4a25fa=_[_0xbe14('0x1d')](_0x37e4c1,[_0xbe14('0x1b'),_0x433459['type']])[_0xbe14('0x1e')];return db['UserProfileResource'][_0xbe14('0x14')]({'where':{'type':_0x4a25fa,'resourceId':_0x433459['id']}})['then'](function(){return _0x137ee5;});})[_0xbe14('0x13')](function(){_0x5ea1f8[_0xbe14('0xb')](0xcc)[_0xbe14('0x1f')]();});}};}function handleEntityNotFound(_0x39cc81){return function(_0x15ef02){if(!_0x15ef02){_0x39cc81[_0xbe14('0xa')](0x194);}return _0x15ef02;};}function handleError(_0x55d001,_0x1822e0){_0x1822e0=_0x1822e0||0x1f4;return function(_0x1ba46a){logger[_0xbe14('0x20')](_0x1ba46a[_0xbe14('0x21')]);if(_0x1ba46a['name']){delete _0x1ba46a[_0xbe14('0x1e')];}_0x55d001[_0xbe14('0xb')](_0x1822e0)['send'](_0x1ba46a);};}exports[_0xbe14('0x22')]=function(_0x3b3e84,_0x1c7cc7){var _0x19252f={};var _0x34d648={'count':0x0,'rows':[]};var _0x36d4b2=_[_0xbe14('0x1a')](db[_0xbe14('0x23')][_0xbe14('0x24')],function(_0x16a159){return{'name':_0x16a159[_0xbe14('0x25')],'type':_0x16a159[_0xbe14('0x1c')][_0xbe14('0x26')]};});_0x19252f=qs[_0xbe14('0x27')](_0x36d4b2,_0x3b3e84);var _0x223f7a={'where':_0x19252f[_0xbe14('0x28')]};return db[_0xbe14('0x23')][_0xbe14('0x10')](_0x223f7a)[_0xbe14('0x13')](function(_0x14e7c4){_0x34d648['count']=_0x14e7c4;_0x19252f[_0xbe14('0x29')]=qs['include'](_0x3b3e84['query']);return db[_0xbe14('0x23')]['findAll'](_0x19252f);})[_0xbe14('0x13')](function(_0x345b0){_0x34d648['rows']=_0x345b0;return _0x34d648;})['then'](respondWithFilteredResult(_0x1c7cc7,_0x19252f))['catch'](handleError(_0x1c7cc7,null));};exports[_0xbe14('0x2a')]=function(_0xa3d24,_0x5f27b6){var _0x46c570={'raw':![],'where':{'id':_0xa3d24[_0xbe14('0x2b')]['id']}},_0x1faf3e={};_0x1faf3e[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db['VoiceQueue']['rawAttributes']);_0x1faf3e[_0xbe14('0x2e')]=_['keys'](_0xa3d24['query']);_0x1faf3e['filters']=_[_0xbe14('0x2f')](_0x1faf3e[_0xbe14('0x2c')],_0x1faf3e[_0xbe14('0x2e')]);_0x46c570[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x1faf3e[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0xa3d24[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x46c570[_0xbe14('0x30')]=_0x46c570[_0xbe14('0x30')][_0xbe14('0x32')]?_0x46c570['attributes']:_0x1faf3e['model'];if(_0xa3d24[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x46c570[_0xbe14('0x29')]=[{'all':!![]}];}_0x46c570=_['merge']({},_0x46c570,_0xa3d24[_0xbe14('0x34')]);return db[_0xbe14('0x23')][_0xbe14('0x1d')](_0x46c570)[_0xbe14('0x13')](handleEntityNotFound(_0x5f27b6,null))[_0xbe14('0x13')](respondWithResult(_0x5f27b6,null))[_0xbe14('0x35')](handleError(_0x5f27b6,null));};exports[_0xbe14('0x36')]=function(_0x128843,_0x1b2608){return db['VoiceQueue'][_0xbe14('0x36')](_0x128843[_0xbe14('0x37')],{})[_0xbe14('0x13')](function(_0x1b3118){var _0x3287b9=_0x128843[_0xbe14('0x38')]['get']({'plain':!![]});if(!_0x3287b9)throw new Error(_0xbe14('0x39'));if(_0x3287b9[_0xbe14('0x3a')]===_0xbe14('0x38')){var _0x36263c=_0x1b3118['get']({'plain':!![]});var _0x4bfa96=[{'name':_0xbe14('0x3b'),'value':_0xbe14('0x16')},{'name':_0xbe14('0x17'),'value':'outbound'}];var _0x5d5318=_[_0xbe14('0x1d')](_0x4bfa96,['value',_0x36263c['type']])[_0xbe14('0x1e')];return db[_0xbe14('0x3c')][_0xbe14('0x1d')]({'where':{'name':_0x5d5318,'userProfileId':_0x3287b9['userProfileId']},'raw':!![]})['then'](function(_0x5aaa4f){if(_0x5aaa4f&&_0x5aaa4f[_0xbe14('0x3d')]===0x0){return db[_0xbe14('0x3e')][_0xbe14('0x36')]({'name':_0x36263c['name'],'resourceId':_0x36263c['id'],'type':_0x5aaa4f[_0xbe14('0x1e')],'sectionId':_0x5aaa4f['id']},{})[_0xbe14('0x13')](function(){return _0x1b3118;});}else{return _0x1b3118;}})[_0xbe14('0x35')](function(_0x3ab0f6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ab0f6);throw _0x3ab0f6;});}return _0x1b3118;})[_0xbe14('0x13')](respondWithResult(_0x1b2608,0xc9))[_0xbe14('0x35')](handleError(_0x1b2608,null));};exports[_0xbe14('0x3f')]=function(_0xb2b285,_0x2550dc){var _0x4f2d95={'where':{'id':_0xb2b285[_0xbe14('0x2b')]['id']}},_0x51023a={};_0x51023a[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x23')]['rawAttributes']);_0x4f2d95[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x51023a['model'],qs[_0xbe14('0x31')](_0xb2b285[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x4f2d95[_0xbe14('0x30')]=_0x4f2d95['attributes']['length']?_0x4f2d95[_0xbe14('0x30')]:_0x51023a[_0xbe14('0x2c')];if(_0xb2b285['query']['includeAll']){_0x4f2d95[_0xbe14('0x29')]=[{'all':!![]}];}_0x4f2d95=_[_0xbe14('0x40')]({},_0x4f2d95,_0xb2b285[_0xbe14('0x34')]);return db[_0xbe14('0x23')][_0xbe14('0x1d')](_0x4f2d95)[_0xbe14('0x13')](handleEntityNotFound(_0x2550dc,null))[_0xbe14('0x13')](function(_0x5a4068){if(_0x5a4068){var _0xf32e93=_0x5a4068[_0xbe14('0x15')]({'plain':!![]});_0xf32e93=qs[_0xbe14('0x41')](_0xf32e93,['id',_0xbe14('0x42'),_0xbe14('0x43')]);_0xb2b285['body']=_[_0xbe14('0x41')](_0xb2b285[_0xbe14('0x37')],['id',_0xbe14('0x42'),_0xbe14('0x43')]);return db[_0xbe14('0x23')][_0xbe14('0x36')](_['merge'](_0xf32e93,_0xb2b285['body']),{'include':_0xb2b285[_0xbe14('0x2e')][_0xbe14('0x33')]?[{'all':!![]}]:undefined})[_0xbe14('0x13')](function(_0x48554a){var _0x497b00=_0xb2b285[_0xbe14('0x38')][_0xbe14('0x15')]({'plain':!![]});if(!_0x497b00)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x497b00[_0xbe14('0x3a')]===_0xbe14('0x38')){var _0x50c2a0=_0x48554a[_0xbe14('0x15')]({'plain':!![]});var _0x4a40d2=[{'name':_0xbe14('0x3b'),'value':_0xbe14('0x16')},{'name':_0xbe14('0x17'),'value':'outbound'}];var _0x435c8d=_[_0xbe14('0x1d')](_0x4a40d2,['value',_0x50c2a0[_0xbe14('0x1c')]])[_0xbe14('0x1e')];return db[_0xbe14('0x3c')][_0xbe14('0x1d')]({'where':{'name':_0x435c8d,'userProfileId':_0x497b00[_0xbe14('0x44')]},'raw':!![]})['then'](function(_0x42a346){if(_0x42a346&&_0x42a346[_0xbe14('0x3d')]===0x0){return db[_0xbe14('0x3e')][_0xbe14('0x36')]({'name':_0x50c2a0[_0xbe14('0x1e')],'resourceId':_0x50c2a0['id'],'type':_0x42a346[_0xbe14('0x1e')],'sectionId':_0x42a346['id']},{})[_0xbe14('0x13')](function(){return _0x48554a;});}else{return _0x48554a;}})['catch'](function(_0x72c875){logger[_0xbe14('0x20')](_0xbe14('0x45'),_0x72c875);throw _0x72c875;});}return _0x48554a;});}})[_0xbe14('0x13')](respondWithResult(_0x2550dc,0xc9))[_0xbe14('0x35')](handleError(_0x2550dc,null));};exports[_0xbe14('0x12')]=function(_0xd8f78f,_0x32df3c){if(_0xd8f78f[_0xbe14('0x37')]['id']){delete _0xd8f78f[_0xbe14('0x37')]['id'];}return db[_0xbe14('0x23')]['find']({'where':{'id':_0xd8f78f['params']['id']}})['then'](handleEntityNotFound(_0x32df3c,null))[_0xbe14('0x13')](saveUpdates(_0xd8f78f[_0xbe14('0x37')],null))[_0xbe14('0x13')](respondWithResult(_0x32df3c,null))[_0xbe14('0x35')](handleError(_0x32df3c,null));};exports[_0xbe14('0x14')]=function(_0x66ddf,_0x16ee48){return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x66ddf[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x16ee48,null))[_0xbe14('0x13')](removeEntity(_0x16ee48,null))[_0xbe14('0x35')](handleError(_0x16ee48,null));};exports[_0xbe14('0x46')]=function(_0x1c831a,_0xcef8e3){var _0x179077={'raw':![],'where':{}};var _0x2225d9={};var _0x29761b={'count':0x0,'rows':[]};return db[_0xbe14('0x23')]['findOne']({'where':{'id':_0x1c831a[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0xcef8e3,null))[_0xbe14('0x13')](function(_0x46b49c){if(_0x46b49c){_0x2225d9[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x47')][_0xbe14('0x24')]);_0x2225d9[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x1c831a['query']);_0x2225d9[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x2225d9[_0xbe14('0x2c')],_0x2225d9[_0xbe14('0x2e')]);_0x179077[_0xbe14('0x30')]=_['intersection'](_0x2225d9[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x179077[_0xbe14('0x30')]=_0x179077['attributes'][_0xbe14('0x32')]?_0x179077[_0xbe14('0x30')]:_0x2225d9[_0xbe14('0x2c')];if(!_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x179077[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x1c831a['query'][_0xbe14('0xf')]);_0x179077[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x1c831a[_0xbe14('0x2e')][_0xbe14('0xd')]);}_0x179077[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x1c831a['query']['sort']);_0x179077[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_[_0xbe14('0x4d')](_0x1c831a[_0xbe14('0x2e')],_0x2225d9[_0xbe14('0x48')]));_0x179077[_0xbe14('0x28')][_0xbe14('0x4e')]=_0x46b49c['id'];if(_0x1c831a[_0xbe14('0x2e')]['filter']){_0x179077['where']=_[_0xbe14('0x40')](_0x179077[_0xbe14('0x28')],{'$or':_[_0xbe14('0x1a')](_0x179077['attributes'],function(_0x76e91e){var _0x16bca1={};_0x16bca1[_0x76e91e]={'$like':'%'+_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x16bca1;})});}_0x179077=_[_0xbe14('0x40')]({},_0x179077,_0x1c831a[_0xbe14('0x34')]);return db[_0xbe14('0x47')]['count']({'where':_0x179077[_0xbe14('0x28')]})[_0xbe14('0x13')](function(_0x3baa26){_0x29761b[_0xbe14('0x10')]=_0x3baa26;if(_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x179077[_0xbe14('0x29')]=[{'all':!![]}];}return db['CmHopper'][_0xbe14('0x4f')](_0x179077);})[_0xbe14('0x13')](function(_0x3cd17e){_0x29761b[_0xbe14('0x50')]=_0x3cd17e;return _0x29761b;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0xcef8e3,_0x179077))[_0xbe14('0x35')](handleError(_0xcef8e3,null));};exports[_0xbe14('0x51')]=function(_0xd756b2,_0x5d064e){var _0x1e5ce1={'raw':!![],'where':{}};var _0x401968={};var _0x362999={'count':0x0,'rows':[]};return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0xd756b2[_0xbe14('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5d064e,null))[_0xbe14('0x13')](function(_0x175213){if(_0x175213){_0x401968[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db['CmHopperHistory'][_0xbe14('0x24')]);_0x401968[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0xd756b2[_0xbe14('0x2e')]);_0x401968[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x401968[_0xbe14('0x2c')],_0x401968['query']);_0x1e5ce1[_0xbe14('0x30')]=_['intersection'](_0x401968[_0xbe14('0x2c')],qs['fields'](_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x1e5ce1[_0xbe14('0x30')]=_0x1e5ce1['attributes'][_0xbe14('0x32')]?_0x1e5ce1[_0xbe14('0x30')]:_0x401968[_0xbe14('0x2c')];if(!_0xd756b2['query'][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x1e5ce1[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0xd756b2['query'][_0xbe14('0xf')]);_0x1e5ce1[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0xd756b2[_0xbe14('0x2e')][_0xbe14('0xd')]);}_0x1e5ce1[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0xd756b2['query'][_0xbe14('0x4c')]);_0x1e5ce1[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_['pick'](_0xd756b2[_0xbe14('0x2e')],_0x401968[_0xbe14('0x48')]));_0x1e5ce1[_0xbe14('0x28')]['VoiceQueueId']=_0x175213['id'];if(_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x1e5ce1['where']=_[_0xbe14('0x40')](_0x1e5ce1['where'],{'$or':_[_0xbe14('0x1a')](_0x1e5ce1[_0xbe14('0x30')],function(_0x4dfa19){var _0x55d729={};_0x55d729[_0x4dfa19]={'$like':'%'+_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x55d729;})});}_0x1e5ce1=_[_0xbe14('0x40')]({},_0x1e5ce1,_0xd756b2['options']);return db[_0xbe14('0x53')][_0xbe14('0x10')]({'where':_0x1e5ce1[_0xbe14('0x28')]})[_0xbe14('0x13')](function(_0x5ee624){_0x362999['count']=_0x5ee624;if(_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x1e5ce1[_0xbe14('0x29')]=[{'all':!![]}];}return db[_0xbe14('0x53')][_0xbe14('0x4f')](_0x1e5ce1);})[_0xbe14('0x13')](function(_0x139aab){_0x362999['rows']=_0x139aab;return _0x362999;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0x5d064e,_0x1e5ce1))['catch'](handleError(_0x5d064e,null));};exports[_0xbe14('0x54')]=function(_0x3a01bb,_0x8d47f2){var _0x2382c4={'raw':!![],'where':{}};var _0x55a3ae={};var _0x1e160b={'count':0x0,'rows':[]};return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x3a01bb['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x8d47f2,null))[_0xbe14('0x13')](function(_0x4090bc){if(_0x4090bc){_0x55a3ae[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x55')][_0xbe14('0x24')]);_0x55a3ae[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x3a01bb[_0xbe14('0x2e')]);_0x55a3ae[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x55a3ae[_0xbe14('0x2c')],_0x55a3ae[_0xbe14('0x2e')]);_0x2382c4[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x55a3ae[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x2382c4['attributes']=_0x2382c4[_0xbe14('0x30')]['length']?_0x2382c4[_0xbe14('0x30')]:_0x55a3ae[_0xbe14('0x2c')];if(!_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x2382c4['limit']=qs['limit'](_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x2382c4[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x3a01bb['query'][_0xbe14('0xd')]);}_0x2382c4[_0xbe14('0x4b')]=qs['sort'](_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x2382c4[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_['pick'](_0x3a01bb[_0xbe14('0x2e')],_0x55a3ae['filters']));_0x2382c4['where'][_0xbe14('0x4e')]=_0x4090bc['id'];if(_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x2382c4[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x2382c4['where'],{'$or':_[_0xbe14('0x1a')](_0x2382c4[_0xbe14('0x30')],function(_0x5dc793){var _0x4e35ed={};_0x4e35ed[_0x5dc793]={'$like':'%'+_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x4e35ed;})});}_0x2382c4=_['merge']({},_0x2382c4,_0x3a01bb[_0xbe14('0x34')]);return db['CmHopperFinal'][_0xbe14('0x10')]({'where':_0x2382c4['where']})[_0xbe14('0x13')](function(_0x5d4431){_0x1e160b[_0xbe14('0x10')]=_0x5d4431;if(_0x3a01bb['query'][_0xbe14('0x33')]){_0x2382c4[_0xbe14('0x29')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x2382c4);})[_0xbe14('0x13')](function(_0x4db7e8){_0x1e160b['rows']=_0x4db7e8;return _0x1e160b;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0x8d47f2,_0x2382c4))[_0xbe14('0x35')](handleError(_0x8d47f2,null));};exports[_0xbe14('0x56')]=function(_0x11c341,_0x1a780a){var _0x313a87={'raw':!![],'where':{}};var _0x30d2b0={};var _0x57ad22={'count':0x0,'rows':[]};return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x11c341[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x1a780a,null))['then'](function(_0x26372a){if(_0x26372a){_0x30d2b0[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db['CmHopperBlack'][_0xbe14('0x24')]);_0x30d2b0[_0xbe14('0x2e')]=_['keys'](_0x11c341[_0xbe14('0x2e')]);_0x30d2b0['filters']=_[_0xbe14('0x2f')](_0x30d2b0[_0xbe14('0x2c')],_0x30d2b0[_0xbe14('0x2e')]);_0x313a87['attributes']=_[_0xbe14('0x2f')](_0x30d2b0['model'],qs[_0xbe14('0x31')](_0x11c341['query']['fields']));_0x313a87[_0xbe14('0x30')]=_0x313a87['attributes'][_0xbe14('0x32')]?_0x313a87['attributes']:_0x30d2b0[_0xbe14('0x2c')];if(!_0x11c341[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x313a87[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x11c341[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x313a87[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x11c341[_0xbe14('0x2e')][_0xbe14('0xd')]);}_0x313a87[_0xbe14('0x4b')]=qs['sort'](_0x11c341[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x313a87[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_[_0xbe14('0x4d')](_0x11c341['query'],_0x30d2b0['filters']));_0x313a87[_0xbe14('0x28')][_0xbe14('0x4e')]=_0x26372a['id'];if(_0x11c341[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x313a87[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x313a87[_0xbe14('0x28')],{'$or':_[_0xbe14('0x1a')](_0x313a87[_0xbe14('0x30')],function(_0x26e7a7){var _0x761b3d={};_0x761b3d[_0x26e7a7]={'$like':'%'+_0x11c341[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x761b3d;})});}_0x313a87=_[_0xbe14('0x40')]({},_0x313a87,_0x11c341[_0xbe14('0x34')]);return db[_0xbe14('0x57')][_0xbe14('0x10')]({'where':_0x313a87[_0xbe14('0x28')]})[_0xbe14('0x13')](function(_0x28a1e9){_0x57ad22[_0xbe14('0x10')]=_0x28a1e9;if(_0x11c341[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x313a87[_0xbe14('0x29')]=[{'all':!![]}];}return db[_0xbe14('0x57')]['findAll'](_0x313a87);})[_0xbe14('0x13')](function(_0x3303a4){_0x57ad22[_0xbe14('0x50')]=_0x3303a4;return _0x57ad22;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0x1a780a,_0x313a87))[_0xbe14('0x35')](handleError(_0x1a780a,null));};exports[_0xbe14('0x58')]=function(_0x52b75d,_0x5b161c){var _0x165b7a={};var _0x4a44e0={};var _0x3730d1;var _0x4babba;return db[_0xbe14('0x23')]['findOne']({'where':{'id':_0x52b75d[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x5b161c,null))[_0xbe14('0x13')](function(_0x12498f){if(_0x12498f){_0x3730d1=_0x12498f;_0x4a44e0[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x59')][_0xbe14('0x24')]);_0x4a44e0[_0xbe14('0x2e')]=_['keys'](_0x52b75d[_0xbe14('0x2e')]);_0x4a44e0[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x4a44e0[_0xbe14('0x2c')],_0x4a44e0['query']);_0x165b7a[_0xbe14('0x30')]=_['intersection'](_0x4a44e0[_0xbe14('0x2c')],qs['fields'](_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x165b7a[_0xbe14('0x30')]=_0x165b7a['attributes'][_0xbe14('0x32')]?_0x165b7a['attributes']:_0x4a44e0[_0xbe14('0x2c')];_0x165b7a[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x165b7a[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_[_0xbe14('0x4d')](_0x52b75d[_0xbe14('0x2e')],_0x4a44e0['filters']));if(_0x52b75d[_0xbe14('0x2e')]['filter']){_0x165b7a[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x165b7a[_0xbe14('0x28')],{'$or':_['map'](_0x165b7a[_0xbe14('0x30')],function(_0x1c5fbc){var _0x219403={};_0x219403[_0x1c5fbc]={'$like':'%'+_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x219403;})});}_0x165b7a=_['merge']({},_0x165b7a,_0x52b75d['options']);return _0x3730d1[_0xbe14('0x58')](_0x165b7a);}})['then'](function(_0x16b1c8){if(_0x16b1c8){_0x4babba=_0x16b1c8[_0xbe14('0x32')];if(!_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x49')]('nolimit')){_0x165b7a[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x52b75d['query'][_0xbe14('0xf')]);_0x165b7a[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x52b75d[_0xbe14('0x2e')]['offset']);}return _0x3730d1[_0xbe14('0x58')](_0x165b7a);}})[_0xbe14('0x13')](function(_0x37aff6){if(_0x37aff6){return _0x37aff6?{'count':_0x4babba,'rows':_0x37aff6}:null;}})[_0xbe14('0x13')](respondWithResult(_0x5b161c,null))[_0xbe14('0x35')](handleError(_0x5b161c,null));};exports[_0xbe14('0x5a')]=function(_0x208fae,_0x310d42){var _0x9c229f=_0x208fae[_0xbe14('0x37')]['teams'];var _0xdb5515=_[_0xbe14('0x1a')](_0x9c229f,'id');return db[_0xbe14('0x59')][_0xbe14('0x4f')]({'where':{'id':_0xdb5515},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbe14('0x5b'),'attributes':['id',_0xbe14('0x1e'),_0xbe14('0x5c'),'voicePause',_0xbe14('0x5d')],'raw':!![]}]})[_0xbe14('0x13')](function(_0x1ec868){if(_0x1ec868){var _0x1a7321=_[_0xbe14('0x5e')](_0x1ec868,function(_0x2306f6){var _0x426189=_0x2306f6['get']({'plain':!![]});_0x426189[_0xbe14('0x5b')]['forEach'](function(_0x24d528){_0x24d528[_0xbe14('0x5f')]=_[_0xbe14('0x1d')](_0x9c229f,{'id':_0x426189['id']})[_0xbe14('0x5f')];});return _0x426189[_0xbe14('0x5b')];});return db['VoiceQueue']['find']({'where':{'id':_0x208fae[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](function(_0x29a892){return db[_0xbe14('0x60')]['transaction'](function(_0x46a251){return _0x29a892[_0xbe14('0x5a')](_0xdb5515,{'transaction':_0x46a251})[_0xbe14('0x13')](function(){return BPromise['each'](_0x9c229f,function(_0xe69b0e){return db['TeamVoiceQueue']['upsert']({'TeamId':_0xe69b0e['id'],'VoiceQueueId':_0x208fae[_0xbe14('0x2b')]['id'],'penalty':_0xe69b0e[_0xbe14('0x5f')]},{'transaction':_0x46a251});});})[_0xbe14('0x13')](function(){return BPromise['each'](_0x1a7321,function(_0x3ea9c2){return db[_0xbe14('0x61')]['findOrCreate']({'where':{'UserId':_0x3ea9c2['id'],'VoiceQueueId':_0x208fae[_0xbe14('0x2b')]['id']},'defaults':{'penalty':_0x3ea9c2[_0xbe14('0x5f')]},'transaction':_0x46a251});});})[_0xbe14('0x13')](function(){return BPromise['each'](_[_0xbe14('0x19')](_0x1a7321,{'online':!![]}),function(_0x1e2559){return db[_0xbe14('0x62')][_0xbe14('0x63')]({'membername':_0x1e2559[_0xbe14('0x1e')],'UserId':_0x1e2559['id'],'queue_name':_0x29a892['name'],'VoiceQueueId':_0x29a892['id'],'interface':_[_0xbe14('0x64')](_0x1e2559[_0xbe14('0x5d')])?util[_0xbe14('0x65')]('SIP/%s',_0x1e2559[_0xbe14('0x1e')]):_0x1e2559[_0xbe14('0x5d')],'paused':_0x1e2559[_0xbe14('0x66')]||![],'penalty':_0x1e2559[_0xbe14('0x5f')]},{'transaction':_0x46a251});});})[_0xbe14('0x13')](function(){_0x1a7321[_0xbe14('0x67')](function(_0x1b22a0){socket[_0xbe14('0x68')](_0xbe14('0x69'),{'UserId':_0x1b22a0['id'],'VoiceQueueId':_0x29a892['id']});});});});});}})[_0xbe14('0x13')](respondWithStatusCode(_0x310d42,null))[_0xbe14('0x35')](handleError(_0x310d42,null));};exports['removeTeams']=function(_0xf549ec,_0x2c3647){return db[_0xbe14('0x59')]['findAll']({'where':{'id':_0xf549ec[_0xbe14('0x2e')][_0xbe14('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xbe14('0x6b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbe14('0x13')](handleEntityNotFound(_0x2c3647,null))['then'](function(_0x2d4b18){var _0xcd8cf6=_['map'](_0x2d4b18,'id');var _0x269e5a=[];var _0x4c7e2b=[];var _0x587f58=squel[_0xbe14('0x6c')]();_0x587f58[_0xbe14('0x6d')](_0xbe14('0x6e'))[_0xbe14('0x6f')](_0xbe14('0x70'),'tq')[_0xbe14('0x71')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xbe14('0x28')](_0xbe14('0x72'),_0xf549ec[_0xbe14('0x2b')]['id']);for(var _0x3c23fc=0x0;_0x3c23fc<_0x2d4b18['length'];_0x3c23fc+=0x1){let _0x1d5333=_0x2d4b18[_0x3c23fc];for(var _0x4cb29c=0x0;_0x4cb29c<_0x1d5333[_0xbe14('0x5b')][_0xbe14('0x32')];_0x4cb29c+=0x1){let _0x5270b2=_0x1d5333[_0xbe14('0x5b')][_0x4cb29c];var _0x273df5=_0x587f58[_0xbe14('0x3f')]();_0x273df5[_0xbe14('0x28')](_0xbe14('0x73'),_0x5270b2['id']);_0x4c7e2b[_0xbe14('0x74')](db[_0xbe14('0x60')][_0xbe14('0x2e')](_0x273df5[_0xbe14('0x75')](),{'type':db[_0xbe14('0x60')][_0xbe14('0x76')][_0xbe14('0x77')]})['then'](function(_0x20f196){if(_0x20f196[_0xbe14('0x32')]===0x1){return _0x5270b2['id'];}else{var _0x1eb33b=_[_0xbe14('0x78')](_['map'](_0x20f196,_0xbe14('0x79')),function(_0xede1c1){return _['includes'](_0xcd8cf6,_0xede1c1);});if(_0x1eb33b){return _0x5270b2['id'];}}}));}}return BPromise[_0xbe14('0x7a')](_0x4c7e2b)[_0xbe14('0x13')](function(_0x11085c){_0x269e5a=_(_0x269e5a)['union'](_0x11085c)[_0xbe14('0x7b')]()[_0xbe14('0x1b')]();return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0xf549ec[_0xbe14('0x2b')]['id']}})['then'](function(_0x23208d){return db[_0xbe14('0x60')][_0xbe14('0x7c')](function(_0x3f7732){return _0x23208d[_0xbe14('0x7d')](_0xf549ec['query'][_0xbe14('0x6a')],{'transaction':_0x3f7732})[_0xbe14('0x13')](function(){if(!_[_0xbe14('0x7e')](_0x269e5a)){return _0x23208d[_0xbe14('0x7f')](_0x269e5a,{'transaction':_0x3f7732})[_0xbe14('0x13')](function(){return db[_0xbe14('0x62')][_0xbe14('0x14')]({'where':{'VoiceQueueId':_0xf549ec[_0xbe14('0x2b')]['id'],'UserId':_0x269e5a},'transaction':_0x3f7732});});}})['then'](function(){_0x269e5a['forEach'](function(_0x129ef6){socket[_0xbe14('0x68')](_0xbe14('0x80'),{'UserId':_0x129ef6,'VoiceQueueId':_0x23208d['id']});});});});});});})[_0xbe14('0x13')](respondWithStatusCode(_0x2c3647,null))[_0xbe14('0x35')](handleError(_0x2c3647,null));};exports['addAgents']=function(_0x15c93c,_0xf6ff8){var _0x3eaabe,_0x1ea11a;return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x15c93c[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0xf6ff8,null))['then'](function(_0xf6da38){if(_0xf6da38){_0x1ea11a=_0xf6da38;return _0xf6da38[_0xbe14('0x81')](_0x15c93c['body']['ids'],_[_0xbe14('0x41')](_0x15c93c['body'],[_0xbe14('0x6a'),'id'])||{})[_0xbe14('0x82')](function(_0x776e93){for(var _0x3f5ca3=0x0;_0x3f5ca3<_0x15c93c[_0xbe14('0x37')]['ids'][_0xbe14('0x32')];_0x3f5ca3+=0x1){socket[_0xbe14('0x68')](_0xbe14('0x69'),{'UserId':Number(_0x15c93c[_0xbe14('0x37')][_0xbe14('0x6a')][_0x3f5ca3]),'VoiceQueueId':Number(_0x15c93c[_0xbe14('0x2b')]['id'])});}return _0x776e93;});}})['then'](function(_0x4eea48){_0x3eaabe=_0x4eea48||[];if(_0x1ea11a){return db[_0xbe14('0x6b')]['findAll']({'where':{'id':_0x15c93c[_0xbe14('0x37')][_0xbe14('0x6a')]},'attributes':['id',_0xbe14('0x1e'),'online',_0xbe14('0x66'),_0xbe14('0x5d')],'raw':!![]});}})[_0xbe14('0x13')](function(_0x1ad15d){if(!_[_0xbe14('0x7e')](_0x1ad15d)){var _0x2e5106=[];for(var _0x156fb3=0x0;_0x156fb3<_0x1ad15d['length'];_0x156fb3++){if(_0x1ad15d[_0x156fb3][_0xbe14('0x5c')]){_0x2e5106['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0x1ad15d[_0x156fb3]['name'],'UserId':_0x1ad15d[_0x156fb3]['id'],'queue_name':_0x1ea11a[_0xbe14('0x1e')],'VoiceQueueId':_0x1ea11a['id'],'interface':_[_0xbe14('0x64')](_0x1ad15d[_0x156fb3]['interface'])?util[_0xbe14('0x65')]('SIP/%s',_0x1ad15d[_0x156fb3][_0xbe14('0x1e')]):_0x1ad15d[_0x156fb3]['interface'],'paused':_0x1ad15d[_0x156fb3][_0xbe14('0x66')]||![],'penalty':_0x15c93c[_0xbe14('0x37')][_0xbe14('0x5f')]||0x0}));}}return BPromise[_0xbe14('0x7a')](_0x2e5106);}})[_0xbe14('0x13')](function(){return _0x3eaabe;})['then'](respondWithResult(_0xf6ff8,null))[_0xbe14('0x35')](handleError(_0xf6ff8,null));};exports[_0xbe14('0x7f')]=function(_0x3aaa54,_0x413893){return db['VoiceQueue']['find']({'where':{'id':_0x3aaa54['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x413893,null))[_0xbe14('0x13')](function(_0x3826cf){if(_0x3826cf){return _0x3826cf[_0xbe14('0x7f')](_0x3aaa54[_0xbe14('0x2e')]['ids'])['then'](function(){if(_[_0xbe14('0x83')](_0x3aaa54[_0xbe14('0x2e')][_0xbe14('0x6a')])){for(var _0x26092b=0x0;_0x26092b<_0x3aaa54[_0xbe14('0x2e')]['ids'][_0xbe14('0x32')];_0x26092b+=0x1){socket['emit'](_0xbe14('0x80'),{'UserId':Number(_0x3aaa54[_0xbe14('0x2e')][_0xbe14('0x6a')][_0x26092b]),'VoiceQueueId':Number(_0x3aaa54[_0xbe14('0x2b')]['id'])});}}else{socket['emit'](_0xbe14('0x80'),{'UserId':Number(_0x3aaa54[_0xbe14('0x2e')][_0xbe14('0x6a')]),'VoiceQueueId':Number(_0x3aaa54[_0xbe14('0x2b')]['id'])});}});}})['then'](function(_0x44c341){return db[_0xbe14('0x62')][_0xbe14('0x14')]({'where':{'VoiceQueueId':_0x3aaa54['params']['id'],'UserId':_0x3aaa54['query'][_0xbe14('0x6a')]}})[_0xbe14('0x13')](function(){return _0x44c341;});})[_0xbe14('0x13')](respondWithStatusCode(_0x413893,null))['catch'](handleError(_0x413893,null));};exports[_0xbe14('0x84')]=function(_0x2f0d14,_0x180e61){var _0x952322={};var _0x3ae00b={};var _0x41962a;var _0x4ebf01;return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x2f0d14[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x180e61,null))[_0xbe14('0x13')](function(_0x5f28dd){if(_0x5f28dd){_0x41962a=_0x5f28dd;_0x3ae00b['model']=_[_0xbe14('0x2d')](db['User'][_0xbe14('0x24')]);_0x3ae00b['query']=_[_0xbe14('0x2d')](_0x2f0d14[_0xbe14('0x2e')]);_0x3ae00b[_0xbe14('0x48')]=_['intersection'](_0x3ae00b[_0xbe14('0x2c')],_0x3ae00b[_0xbe14('0x2e')]);_0x952322[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x3ae00b[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x952322[_0xbe14('0x30')]=_0x952322[_0xbe14('0x30')]['length']?_0x952322[_0xbe14('0x30')]:_0x3ae00b[_0xbe14('0x2c')];_0x952322[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x952322[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_['pick'](_0x2f0d14[_0xbe14('0x2e')],_0x3ae00b[_0xbe14('0x48')]));if(_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x952322[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x952322['where'],{'$or':_['map'](_0x952322['attributes'],function(_0x598ccc){var _0x446b3f={};_0x446b3f[_0x598ccc]={'$like':'%'+_0x2f0d14[_0xbe14('0x2e')]['filter']+'%'};return _0x446b3f;})});}_0x952322=_[_0xbe14('0x40')]({},_0x952322,_0x2f0d14['options']);return _0x41962a[_0xbe14('0x84')](_0x952322);}})[_0xbe14('0x13')](function(_0x111ff0){if(_0x111ff0){_0x4ebf01=_0x111ff0[_0xbe14('0x32')];if(!_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x49')]('nolimit')){_0x952322[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x952322[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0xd')]);}return _0x41962a[_0xbe14('0x84')](_0x952322);}})['then'](function(_0x2eb5e6){if(_0x2eb5e6){return _0x2eb5e6?{'count':_0x4ebf01,'rows':_0x2eb5e6}:null;}})['then'](respondWithResult(_0x180e61,null))[_0xbe14('0x35')](handleError(_0x180e61,null));};exports['getMembers']=function(_0x49cddc,_0x3bdbf7){var _0x19a1ae={};var _0x167dee={};var _0x4f6252;var _0x4536b9;return db['VoiceQueue'][_0xbe14('0x52')]({'where':{'id':_0x49cddc['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x3bdbf7,null))[_0xbe14('0x13')](function(_0x21f14e){if(_0x21f14e){_0x4f6252=_0x21f14e;_0x167dee[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x62')]['rawAttributes']);_0x167dee[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x49cddc['query']);_0x167dee['filters']=_['intersection'](_0x167dee[_0xbe14('0x2c')],_0x167dee[_0xbe14('0x2e')]);_0x19a1ae[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x167dee[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x49cddc[_0xbe14('0x2e')]['fields']));_0x19a1ae[_0xbe14('0x30')]=_0x19a1ae[_0xbe14('0x30')][_0xbe14('0x32')]?_0x19a1ae['attributes']:_0x167dee[_0xbe14('0x2c')];_0x19a1ae[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x49cddc['query']['sort']);_0x19a1ae[_0xbe14('0x28')]=qs['filters'](_[_0xbe14('0x4d')](_0x49cddc[_0xbe14('0x2e')],_0x167dee[_0xbe14('0x48')]));if(_0x49cddc[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x19a1ae[_0xbe14('0x28')]=_['merge'](_0x19a1ae[_0xbe14('0x28')],{'$or':_['map'](_0x19a1ae[_0xbe14('0x30')],function(_0x2d0568){var _0x26bb56={};_0x26bb56[_0x2d0568]={'$like':'%'+_0x49cddc['query'][_0xbe14('0x19')]+'%'};return _0x26bb56;})});}_0x19a1ae=_[_0xbe14('0x40')]({},_0x19a1ae,_0x49cddc['options']);return _0x4f6252['getMembers'](_0x19a1ae);}})[_0xbe14('0x13')](function(_0x3d9061){if(_0x3d9061){_0x4536b9=_0x3d9061[_0xbe14('0x32')];if(!_0x49cddc['query'][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x19a1ae['limit']=qs['limit'](_0x49cddc['query']['limit']);_0x19a1ae[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x49cddc['query']['offset']);}return _0x4f6252[_0xbe14('0x85')](_0x19a1ae);}})[_0xbe14('0x13')](function(_0x1046a0){return _0x1046a0?{'count':_0x4536b9,'rows':_0x1046a0}:null;})['then'](respondWithResult(_0x3bdbf7,null))[_0xbe14('0x35')](handleError(_0x3bdbf7,null));};exports[_0xbe14('0x86')]=function(_0x3933c7,_0x416c65){var _0x56f870={};var _0x28b3c4={};var _0x6fe862;var _0x5f4675;return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x3933c7[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x416c65,null))[_0xbe14('0x13')](function(_0x4c4ab9){if(_0x4c4ab9){_0x6fe862=_0x4c4ab9;_0x28b3c4['model']=_[_0xbe14('0x2d')](db[_0xbe14('0x87')][_0xbe14('0x24')]);_0x28b3c4[_0xbe14('0x2e')]=_['keys'](_0x3933c7[_0xbe14('0x2e')]);_0x28b3c4[_0xbe14('0x48')]=_['intersection'](_0x28b3c4[_0xbe14('0x2c')],_0x28b3c4['query']);_0x56f870[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x28b3c4['model'],qs[_0xbe14('0x31')](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x56f870[_0xbe14('0x30')]=_0x56f870[_0xbe14('0x30')][_0xbe14('0x32')]?_0x56f870[_0xbe14('0x30')]:_0x28b3c4[_0xbe14('0x2c')];_0x56f870['order']=qs[_0xbe14('0x4c')](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x56f870['where']=qs['filters'](_['pick'](_0x3933c7[_0xbe14('0x2e')],_0x28b3c4[_0xbe14('0x48')]));if(_0x3933c7[_0xbe14('0x2e')]['filter']){_0x56f870['where']=_[_0xbe14('0x40')](_0x56f870[_0xbe14('0x28')],{'$or':_[_0xbe14('0x1a')](_0x56f870[_0xbe14('0x30')],function(_0x2ac6c0){var _0x3d381e={};_0x3d381e[_0x2ac6c0]={'$like':'%'+_0x3933c7[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x3d381e;})});}_0x56f870=_[_0xbe14('0x40')]({},_0x56f870,_0x3933c7['options']);return _0x6fe862[_0xbe14('0x86')](_0x56f870);}})[_0xbe14('0x13')](function(_0x2ca4de){if(_0x2ca4de){_0x5f4675=_0x2ca4de[_0xbe14('0x32')];if(!_0x3933c7[_0xbe14('0x2e')]['hasOwnProperty'](_0xbe14('0x4a'))){_0x56f870['limit']=qs['limit'](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x56f870['offset']=qs['offset'](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0xd')]);}return _0x6fe862[_0xbe14('0x86')](_0x56f870);}})[_0xbe14('0x13')](function(_0x2e7c31){if(_0x2e7c31){return _0x2e7c31?{'count':_0x5f4675,'rows':_0x2e7c31}:null;}})['then'](respondWithResult(_0x416c65,null))['catch'](handleError(_0x416c65,null));};exports[_0xbe14('0x88')]=function(_0x4b07fc,_0x76e84){var _0x3f687f=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x4f4b69,_0x43d760;return db['VoiceQueue'][_0xbe14('0x1d')]({'where':{'id':_0x4b07fc[_0xbe14('0x2b')]['id']}})['then'](handleEntityNotFound(_0x76e84,null))[_0xbe14('0x13')](function(_0x30657c){if(_0x30657c){_0x43d760=_0x30657c;return _0x30657c[_0xbe14('0x88')](_0x4b07fc[_0xbe14('0x37')][_0xbe14('0x6a')],_['omit'](_0x4b07fc[_0xbe14('0x37')],[_0xbe14('0x6a'),'id'])||{});}return null;})[_0xbe14('0x82')](function(_0xd97d02){var _0x15082b;_0x4f4b69=_0xd97d02||[];var _0x5d15c7=[];if(_0xd97d02){for(var _0x66b6a7=0x0;_0x66b6a7<_0xd97d02[_0xbe14('0x32')];_0x66b6a7+=0x1){var _0x4dfe2c=_0xd97d02[_0x66b6a7][_0xbe14('0x15')]({'plain':!![]});_0x43d760['dialCheckDuplicateType']=_0x4b07fc[_0xbe14('0x37')][_0xbe14('0x89')]?_0x4b07fc[_0xbe14('0x37')][_0xbe14('0x89')]:_0x43d760[_0xbe14('0x89')];switch(_0x43d760[_0xbe14('0x89')]){case'always':_0x15082b=squel[_0xbe14('0x8a')]()[_0xbe14('0x8b')](_0xbe14('0x8c'))[_0xbe14('0x8d')]([_0xbe14('0x8e'),_0xbe14('0x8f'),_0xbe14('0x90'),_0xbe14('0x91'),_0xbe14('0x4e'),_0xbe14('0x42'),'updatedAt'],squel[_0xbe14('0x6c')]()[_0xbe14('0x6d')]('phone',_0xbe14('0x8e'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x8f'))[_0xbe14('0x6d')]('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x4dfe2c[_0xbe14('0x92')][_0xbe14('0x75')](),'ListId')[_0xbe14('0x6d')](_0x4b07fc['params']['id'][_0xbe14('0x75')](),_0xbe14('0x4e'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x42'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xbe14('0x28')](_0xbe14('0x93'),_0x4dfe2c['CmListId'][_0xbe14('0x75')]())[_0xbe14('0x28')](_0xbe14('0x94'))[_0xbe14('0x28')](_0xbe14('0x95'),squel[_0xbe14('0x6c')]()[_0xbe14('0x6d')](_0xbe14('0x96'))[_0xbe14('0x6f')](_0xbe14('0x97'))[_0xbe14('0x28')]('VoiceQueueId\x20=\x20?',_0x4b07fc[_0xbe14('0x2b')]['id']['toString']()))[_0xbe14('0x28')](_0xbe14('0x95'),squel[_0xbe14('0x6c')]()['field'](_0xbe14('0x98'))[_0xbe14('0x6f')]('cm_hopper')[_0xbe14('0x28')](_0xbe14('0x72'),_0x4b07fc[_0xbe14('0x2b')]['id']['toString']())))[_0xbe14('0x75')]();break;case _0xbe14('0x99'):_0x15082b=squel['insert']()[_0xbe14('0x8b')]('cm_hopper')[_0xbe14('0x8d')]([_0xbe14('0x8e'),_0xbe14('0x8f'),_0xbe14('0x90'),'ListId','VoiceQueueId',_0xbe14('0x42'),_0xbe14('0x43')],squel['select']()['field'](_0xbe14('0x8e'),'phone')[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x8f'))[_0xbe14('0x6d')]('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x4dfe2c[_0xbe14('0x92')][_0xbe14('0x75')](),_0xbe14('0x91'))[_0xbe14('0x6d')](_0x4b07fc[_0xbe14('0x2b')]['id']['toString'](),'VoiceQueueId')['field']('\x27'+_0x3f687f+'\x27',_0xbe14('0x42'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')](_0xbe14('0x9a'))[_0xbe14('0x28')](_0xbe14('0x9b'))[_0xbe14('0x28')](_0xbe14('0x93'),_0x4dfe2c['CmListId'][_0xbe14('0x75')]())[_0xbe14('0x28')](_0xbe14('0x94'))['where'](_0xbe14('0x95'),squel[_0xbe14('0x6c')]()[_0xbe14('0x6d')](_0xbe14('0x98'))[_0xbe14('0x6f')](_0xbe14('0x8c'))[_0xbe14('0x28')]('VoiceQueueId\x20=\x20?',_0x4b07fc[_0xbe14('0x2b')]['id'][_0xbe14('0x75')]())))['toString']();break;default:_0x15082b=squel['insert']()[_0xbe14('0x8b')](_0xbe14('0x8c'))[_0xbe14('0x8d')](['phone',_0xbe14('0x8f'),_0xbe14('0x90'),_0xbe14('0x91'),_0xbe14('0x4e'),_0xbe14('0x42'),_0xbe14('0x43')],squel['select']()[_0xbe14('0x6d')]('phone',_0xbe14('0x8e'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x8f'))['field']('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x4dfe2c['CmListId'][_0xbe14('0x75')](),'ListId')[_0xbe14('0x6d')](_0x4b07fc['params']['id'][_0xbe14('0x75')](),'VoiceQueueId')[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x42'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')]('cm_contacts')[_0xbe14('0x28')](_0xbe14('0x9b'))['where'](_0xbe14('0x93'),_0x4dfe2c[_0xbe14('0x92')]['toString']())[_0xbe14('0x28')](_0xbe14('0x94')))[_0xbe14('0x75')]();}_0x5d15c7['push'](db[_0xbe14('0x60')][_0xbe14('0x2e')](_0x15082b));}return BPromise[_0xbe14('0x7a')](_0x5d15c7);}})[_0xbe14('0x13')](function(){var _0x4bc564=[];var _0x19e7ce=squel[_0xbe14('0x8a')]()[_0xbe14('0x8b')](_0xbe14('0x9c'))[_0xbe14('0x8d')]([_0xbe14('0x9d'),_0xbe14('0x8e'),_0xbe14('0x9e'),_0xbe14('0x42'),'updatedAt'],squel[_0xbe14('0x6c')]()['field']('h.id')[_0xbe14('0x6d')](_0xbe14('0x9f'))['field'](_0xbe14('0xa0'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27','createdAt')[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')](_0xbe14('0xa1'),'ci')[_0xbe14('0x71')](_0xbe14('0x8c'),'h','h.ContactId=ci.CmContactId')['where'](_0xbe14('0xa2'),_0x3f687f)['where'](_0xbe14('0xa3'),_0xbe14('0xa4')))['toString']();_0x4bc564[_0xbe14('0x74')](db[_0xbe14('0x60')][_0xbe14('0x2e')](_0x19e7ce));return BPromise[_0xbe14('0x7a')](_0x4bc564);})[_0xbe14('0x13')](function(){return _0x4f4b69;})[_0xbe14('0x13')](respondWithResult(_0x76e84,null))[_0xbe14('0x35')](handleError(_0x76e84,null));};exports['removeLists']=function(_0x4ceca6,_0x23f4a3){return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x4ceca6[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x23f4a3,null))[_0xbe14('0x13')](function(_0x2fe8b0){if(_0x2fe8b0){return _0x2fe8b0[_0xbe14('0xa5')](_0x4ceca6['query'][_0xbe14('0x6a')]);}})[_0xbe14('0x13')](function(_0x186284){if(_0x186284){return db['CmHopper'][_0xbe14('0x14')]({'where':{'ListId':_0x4ceca6[_0xbe14('0x2e')][_0xbe14('0x6a')],'VoiceQueueId':_0x4ceca6[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](function(){return _0x186284;});}})['then'](respondWithStatusCode(_0x23f4a3,null))[_0xbe14('0x35')](handleError(_0x23f4a3,null));};exports[_0xbe14('0xa6')]=function(_0x4c9319,_0x1173f0){var _0x1e0c81={};var _0x5349a7={};var _0x5e3819;var _0x28c5fe;return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x4c9319['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x1173f0,null))[_0xbe14('0x13')](function(_0x59434a){if(_0x59434a){_0x5e3819=_0x59434a;_0x5349a7[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x87')]['rawAttributes']);_0x5349a7[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x4c9319[_0xbe14('0x2e')]);_0x5349a7[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x5349a7[_0xbe14('0x2c')],_0x5349a7[_0xbe14('0x2e')]);_0x1e0c81[_0xbe14('0x30')]=_['intersection'](_0x5349a7[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x4c9319[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x1e0c81[_0xbe14('0x30')]=_0x1e0c81['attributes'][_0xbe14('0x32')]?_0x1e0c81[_0xbe14('0x30')]:_0x5349a7[_0xbe14('0x2c')];_0x1e0c81[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x4c9319[_0xbe14('0x2e')]['sort']);_0x1e0c81['where']=qs['filters'](_[_0xbe14('0x4d')](_0x4c9319[_0xbe14('0x2e')],_0x5349a7['filters']));if(_0x4c9319[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x1e0c81[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x1e0c81['where'],{'$or':_[_0xbe14('0x1a')](_0x1e0c81[_0xbe14('0x30')],function(_0x52bbc1){var _0x2797ef={};_0x2797ef[_0x52bbc1]={'$like':'%'+_0x4c9319['query']['filter']+'%'};return _0x2797ef;})});}_0x1e0c81=_[_0xbe14('0x40')]({},_0x1e0c81,_0x4c9319[_0xbe14('0x34')]);return _0x5e3819[_0xbe14('0xa6')](_0x1e0c81);}})[_0xbe14('0x13')](function(_0x47bba1){if(_0x47bba1){_0x28c5fe=_0x47bba1[_0xbe14('0x32')];if(!_0x4c9319[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x1e0c81['limit']=qs[_0xbe14('0xf')](_0x4c9319[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x1e0c81[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x4c9319[_0xbe14('0x2e')][_0xbe14('0xd')]);}return _0x5e3819[_0xbe14('0xa6')](_0x1e0c81);}})['then'](function(_0x2592ab){if(_0x2592ab){return _0x2592ab?{'count':_0x28c5fe,'rows':_0x2592ab}:null;}})[_0xbe14('0x13')](respondWithResult(_0x1173f0,null))['catch'](handleError(_0x1173f0,null));};exports['addBlackLists']=function(_0x6a0f29,_0x3d04b9){var _0x21f793;return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x6a0f29[_0xbe14('0x2b')]['id']}})['then'](handleEntityNotFound(_0x3d04b9,null))[_0xbe14('0x13')](function(_0x37e5e8){if(_0x37e5e8){return _0x37e5e8['addBlackLists'](_0x6a0f29[_0xbe14('0x37')][_0xbe14('0x6a')],_[_0xbe14('0x41')](_0x6a0f29[_0xbe14('0x37')],[_0xbe14('0x6a'),'id'])||{});}return null;})[_0xbe14('0x82')](function(_0x14cec7){var _0x524603;_0x21f793=_0x14cec7||[];var _0x38d720=[];if(_0x14cec7){for(var _0x379446=0x0;_0x379446<_0x14cec7[_0xbe14('0x32')];_0x379446+=0x1){var _0x1489c9=_0x14cec7[_0x379446][_0xbe14('0x15')]({'plain':!![]});_0x524603=squel[_0xbe14('0x8a')]()[_0xbe14('0x8b')](_0xbe14('0xa7'))['fromQuery']([_0xbe14('0x8e'),_0xbe14('0x90'),_0xbe14('0x91'),'VoiceQueueId',_0xbe14('0x42'),_0xbe14('0x43')],squel[_0xbe14('0x6c')]()['field'](_0xbe14('0x8e'),'phone')[_0xbe14('0x6d')]('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x1489c9[_0xbe14('0x92')][_0xbe14('0x75')](),_0xbe14('0x91'))[_0xbe14('0x6d')](_0x6a0f29['params']['id'][_0xbe14('0x75')](),_0xbe14('0x4e'))[_0xbe14('0x6d')](_0xbe14('0xa8'),_0xbe14('0x42'))[_0xbe14('0x6d')](_0xbe14('0xa8'),'updatedAt')[_0xbe14('0x6f')](_0xbe14('0x9a'))[_0xbe14('0x28')](_0xbe14('0x9b'))[_0xbe14('0x28')](_0xbe14('0x93'),_0x1489c9[_0xbe14('0x92')][_0xbe14('0x75')]())[_0xbe14('0x28')](_0xbe14('0x94')))[_0xbe14('0x75')]();_0x38d720[_0xbe14('0x74')](db['sequelize'][_0xbe14('0x2e')](_0x524603));}return BPromise[_0xbe14('0x7a')](_0x38d720);}})['then'](function(){return _0x21f793;})['then'](respondWithResult(_0x3d04b9,null))[_0xbe14('0x35')](handleError(_0x3d04b9,null));};exports[_0xbe14('0xa9')]=function(_0x7533c3,_0x3ec670){return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x7533c3[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x3ec670,null))['then'](function(_0x3ee9e2){if(_0x3ee9e2){return _0x3ee9e2['removeBlackLists'](_0x7533c3[_0xbe14('0x2e')][_0xbe14('0x6a')]);}})[_0xbe14('0x13')](function(_0x1d343a){if(_0x1d343a){return db[_0xbe14('0x57')][_0xbe14('0x14')]({'where':{'ListId':_0x7533c3['query']['ids'],'VoiceQueueId':_0x7533c3['params']['id']}})['then'](function(){return _0x1d343a;});}})['then'](respondWithStatusCode(_0x3ec670,null))[_0xbe14('0x35')](handleError(_0x3ec670,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 69405af..afbef29 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 _0x2599=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x5ef741,_0x4a8ce6){var _0xceffd0=function(_0x47ab38){while(--_0x47ab38){_0x5ef741['push'](_0x5ef741['shift']());}};_0xceffd0(++_0x4a8ce6);}(_0x2599,0x1be));var _0x9259=function(_0x50def4,_0xde3b2a){_0x50def4=_0x50def4-0x0;var _0x36fe80=_0x2599[_0x50def4];return _0x36fe80;};'use strict';var EventEmitter=require(_0x9259('0x0'));var VoiceQueue=require(_0x9259('0x1'))['db'][_0x9259('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x9259('0x3')](0x0);var events={'afterCreate':_0x9259('0x4'),'afterUpdate':'update','afterDestroy':_0x9259('0x5')};function emitEvent(_0x4c24ba){return function(_0x143569,_0x5df51f,_0x2b3fd1){VoiceQueueEvents[_0x9259('0x6')](_0x4c24ba+':'+_0x143569['id'],_0x143569);VoiceQueueEvents[_0x9259('0x6')](_0x4c24ba,_0x143569);_0x2b3fd1(null);};}for(var e in events){if(events[_0x9259('0x7')](e)){var event=events[e];VoiceQueue[_0x9259('0x8')](e,emitEvent(event));}}module[_0x9259('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x11b3=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue'];(function(_0x170493,_0x30930b){var _0x4875cb=function(_0x1b6f96){while(--_0x1b6f96){_0x170493['push'](_0x170493['shift']());}};_0x4875cb(++_0x30930b);}(_0x11b3,0x101));var _0x311b=function(_0x39fee2,_0x299662){_0x39fee2=_0x39fee2-0x0;var _0x35e0df=_0x11b3[_0x39fee2];return _0x35e0df;};'use strict';var EventEmitter=require(_0x311b('0x0'));var VoiceQueue=require(_0x311b('0x1'))['db'][_0x311b('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x311b('0x3'),'afterUpdate':_0x311b('0x4'),'afterDestroy':_0x311b('0x5')};function emitEvent(_0x7c010e){return function(_0x30f7f4,_0x5ad8c5,_0x35e5b0){VoiceQueueEvents['emit'](_0x7c010e+':'+_0x30f7f4['id'],_0x30f7f4);VoiceQueueEvents[_0x311b('0x6')](_0x7c010e,_0x30f7f4);_0x35e5b0(null);};}for(var e in events){if(events[_0x311b('0x7')](e)){var event=events[e];VoiceQueue[_0x311b('0x8')](e,emitEvent(event));}}module[_0x311b('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 2aa98a7..9b000df 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 _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x305486,_0x24acd4){var _0xa04940=function(_0x29e866){while(--_0x29e866){_0x305486['push'](_0x305486['shift']());}};_0xa04940(++_0x24acd4);}(_0x55ca,0x126));var _0xa55c=function(_0x2f6233,_0x90172){_0x2f6233=_0x2f6233-0x0;var _0x1c9c36=_0x55ca[_0x2f6233];return _0x1c9c36;};'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')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x11d20c,_0x1969ac){var _0x509259=function(_0x365d01){while(--_0x365d01){_0x11d20c['push'](_0x11d20c['shift']());}};_0x509259(++_0x1969ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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':'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 db2bf75..0847501 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 _0x0dfe=['util','moment','randomstring','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','map','include','model','attributes','debug','ShowVoiceQueue','lodash'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x0dfe,0x11f));var _0xe0df=function(_0x3f0706,_0x38792c){_0x3f0706=_0x3f0706-0x0;var _0x25060f=_0x0dfe[_0x3f0706];return _0x25060f;};'use strict';var _=require(_0xe0df('0x0'));var util=require(_0xe0df('0x1'));var moment=require(_0xe0df('0x2'));var BPromise=require('bluebird');var rs=require(_0xe0df('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe0df('0x4'));var logger=require('../../config/logger')(_0xe0df('0x5'));var config=require(_0xe0df('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe0df('0x7')][_0xe0df('0x8')]({'port':0x232a});config[_0xe0df('0x9')]=_[_0xe0df('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe0df('0xb'))(new Redis(config[_0xe0df('0x9')]));require(_0xe0df('0xc'))[_0xe0df('0xd')](socket);function respondWithRpcPromise(_0x28a130,_0x98b84b,_0x437e4b){return new BPromise(function(_0x2f542e,_0x5efcfb){return client[_0xe0df('0xe')](_0x28a130,_0x437e4b)[_0xe0df('0xf')](function(_0x223734){logger[_0xe0df('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x98b84b,'request\x20sent');logger['debug'](_0xe0df('0x11'),_0x98b84b,'request\x20sent',JSON[_0xe0df('0x12')](_0x223734));if(_0x223734['error']){if(_0x223734[_0xe0df('0x13')][_0xe0df('0x14')]===0x1f4){logger[_0xe0df('0x13')](_0xe0df('0x15'),_0x98b84b,_0x223734[_0xe0df('0x13')]['message']);return _0x5efcfb(_0x223734['error'][_0xe0df('0x16')]);}logger[_0xe0df('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x98b84b,_0x223734[_0xe0df('0x13')][_0xe0df('0x16')]);return _0x2f542e(_0x223734['error'][_0xe0df('0x16')]);}else{logger[_0xe0df('0x10')](_0xe0df('0x15'),_0x98b84b,'request\x20sent');_0x2f542e(_0x223734[_0xe0df('0x17')][_0xe0df('0x16')]);}})[_0xe0df('0x18')](function(_0x2bd594){logger[_0xe0df('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x98b84b,_0x2bd594);_0x5efcfb(_0x2bd594);});});}exports[_0xe0df('0x19')]=function(_0x69c73){var _0x27ffef=this;return new Promise(function(_0x29c47f,_0x1e5bd2){return db[_0xe0df('0x1a')]['findAll']({'raw':_0x69c73['options']?_0x69c73[_0xe0df('0x1b')][_0xe0df('0x1c')]===undefined?!![]:![]:!![],'where':_0x69c73[_0xe0df('0x1b')]?_0x69c73[_0xe0df('0x1b')][_0xe0df('0x1d')]||null:null,'attributes':_0x69c73[_0xe0df('0x1b')]?_0x69c73[_0xe0df('0x1b')]['attributes']||null:null,'limit':_0x69c73[_0xe0df('0x1b')]?_0x69c73[_0xe0df('0x1b')]['limit']||null:null,'include':_0x69c73[_0xe0df('0x1b')]?_0x69c73['options']['include']?_[_0xe0df('0x1e')](_0x69c73[_0xe0df('0x1b')][_0xe0df('0x1f')],function(_0x1f5695){return{'model':db[_0x1f5695[_0xe0df('0x20')]],'as':_0x1f5695['as'],'attributes':_0x1f5695[_0xe0df('0x21')],'include':_0x1f5695[_0xe0df('0x1f')]?_['map'](_0x1f5695[_0xe0df('0x1f')],function(_0x2c7225){return{'model':db[_0x2c7225[_0xe0df('0x20')]],'as':_0x2c7225['as'],'attributes':_0x2c7225[_0xe0df('0x21')],'include':_0x2c7225['include']?_[_0xe0df('0x1e')](_0x2c7225['include'],function(_0x47be51){return{'model':db[_0x47be51[_0xe0df('0x20')]],'as':_0x47be51['as'],'attributes':_0x47be51['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x6de65b){logger['info'](_0xe0df('0x19'),_0x69c73);logger[_0xe0df('0x22')](_0xe0df('0x19'),_0x69c73,JSON[_0xe0df('0x12')](_0x6de65b));_0x29c47f(_0x6de65b);})[_0xe0df('0x18')](function(_0x52d1f4){logger[_0xe0df('0x13')](_0xe0df('0x19'),_0x52d1f4[_0xe0df('0x16')],_0x69c73);_0x1e5bd2(_0x27ffef['error'](0x1f4,_0x52d1f4['message']));});});};exports[_0xe0df('0x23')]=function(_0x5acb60){var _0x3b80e6=this;return new Promise(function(_0x5b5894,_0xba2b3a){return db[_0xe0df('0x1a')]['find']({'raw':_0x5acb60[_0xe0df('0x1b')]?_0x5acb60[_0xe0df('0x1b')][_0xe0df('0x1c')]===undefined?!![]:![]:!![],'where':_0x5acb60[_0xe0df('0x1b')]?_0x5acb60[_0xe0df('0x1b')][_0xe0df('0x1d')]||null:null,'attributes':_0x5acb60[_0xe0df('0x1b')]?_0x5acb60[_0xe0df('0x1b')][_0xe0df('0x21')]||null:null,'include':_0x5acb60['options']?_0x5acb60[_0xe0df('0x1b')]['include']?_[_0xe0df('0x1e')](_0x5acb60[_0xe0df('0x1b')][_0xe0df('0x1f')],function(_0x3268a3){return{'model':db[_0x3268a3[_0xe0df('0x20')]],'as':_0x3268a3['as'],'attributes':_0x3268a3['attributes'],'include':_0x3268a3[_0xe0df('0x1f')]?_[_0xe0df('0x1e')](_0x3268a3[_0xe0df('0x1f')],function(_0x398f37){return{'model':db[_0x398f37[_0xe0df('0x20')]],'as':_0x398f37['as'],'attributes':_0x398f37[_0xe0df('0x21')],'include':_0x398f37['include']?_['map'](_0x398f37[_0xe0df('0x1f')],function(_0x52cd59){return{'model':db[_0x52cd59[_0xe0df('0x20')]],'as':_0x52cd59['as'],'attributes':_0x52cd59[_0xe0df('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1900dc){logger[_0xe0df('0x10')]('ShowVoiceQueue',_0x5acb60);logger[_0xe0df('0x22')](_0xe0df('0x23'),_0x5acb60,JSON[_0xe0df('0x12')](_0x1900dc));_0x5b5894(_0x1900dc);})[_0xe0df('0x18')](function(_0x3f3bf5){logger['error'](_0xe0df('0x23'),_0x3f3bf5['message'],_0x5acb60);_0xba2b3a(_0x3b80e6[_0xe0df('0x13')](0x1f4,_0x3f3bf5[_0xe0df('0x16')]));});});}; \ No newline at end of file +var _0xd072=['stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowVoiceQueue','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x1c8e6f,_0x59bed7){var _0x72924f=function(_0x3c5de4){while(--_0x3c5de4){_0x1c8e6f['push'](_0x1c8e6f['shift']());}};_0x72924f(++_0x59bed7);}(_0xd072,0xe0));var _0x2d07=function(_0x3fa120,_0xb410e0){_0x3fa120=_0x3fa120-0x0;var _0x4ca33a=_0xd072[_0x3fa120];return _0x4ca33a;};'use strict';var _=require(_0x2d07('0x0'));var util=require(_0x2d07('0x1'));var moment=require(_0x2d07('0x2'));var BPromise=require(_0x2d07('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2d07('0x4'));var logger=require(_0x2d07('0x5'))(_0x2d07('0x6'));var config=require(_0x2d07('0x7'));var jayson=require(_0x2d07('0x8'));var client=jayson[_0x2d07('0x9')][_0x2d07('0xa')]({'port':0x232a});config['redis']=_[_0x2d07('0xb')](config[_0x2d07('0xc')],{'host':_0x2d07('0xd'),'port':0x18eb});var socket=require(_0x2d07('0xe'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x2d07('0xf')](socket);function respondWithRpcPromise(_0x50687d,_0x5e63f5,_0x53709a){return new BPromise(function(_0xfd289e,_0x19e786){return client[_0x2d07('0x10')](_0x50687d,_0x53709a)[_0x2d07('0x11')](function(_0xb84faa){logger[_0x2d07('0x12')](_0x2d07('0x13'),_0x5e63f5,'request\x20sent');logger[_0x2d07('0x14')](_0x2d07('0x15'),_0x5e63f5,'request\x20sent',JSON[_0x2d07('0x16')](_0xb84faa));if(_0xb84faa[_0x2d07('0x17')]){if(_0xb84faa[_0x2d07('0x17')][_0x2d07('0x18')]===0x1f4){logger['error'](_0x2d07('0x13'),_0x5e63f5,_0xb84faa[_0x2d07('0x17')]['message']);return _0x19e786(_0xb84faa[_0x2d07('0x17')][_0x2d07('0x19')]);}logger[_0x2d07('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x5e63f5,_0xb84faa[_0x2d07('0x17')][_0x2d07('0x19')]);return _0xfd289e(_0xb84faa[_0x2d07('0x17')][_0x2d07('0x19')]);}else{logger[_0x2d07('0x12')](_0x2d07('0x13'),_0x5e63f5,'request\x20sent');_0xfd289e(_0xb84faa[_0x2d07('0x1a')][_0x2d07('0x19')]);}})[_0x2d07('0x1b')](function(_0x51dbbc){logger[_0x2d07('0x17')](_0x2d07('0x13'),_0x5e63f5,_0x51dbbc);_0x19e786(_0x51dbbc);});});}exports[_0x2d07('0x1c')]=function(_0x5695e1){var _0x1711c9=this;return new Promise(function(_0x27f5d4,_0x37164a){return db[_0x2d07('0x1d')][_0x2d07('0x1e')]({'raw':_0x5695e1[_0x2d07('0x1f')]?_0x5695e1[_0x2d07('0x1f')][_0x2d07('0x20')]===undefined?!![]:![]:!![],'where':_0x5695e1[_0x2d07('0x1f')]?_0x5695e1[_0x2d07('0x1f')][_0x2d07('0x21')]||null:null,'attributes':_0x5695e1['options']?_0x5695e1[_0x2d07('0x1f')][_0x2d07('0x22')]||null:null,'limit':_0x5695e1[_0x2d07('0x1f')]?_0x5695e1[_0x2d07('0x1f')][_0x2d07('0x23')]||null:null,'include':_0x5695e1['options']?_0x5695e1[_0x2d07('0x1f')][_0x2d07('0x24')]?_[_0x2d07('0x25')](_0x5695e1[_0x2d07('0x1f')][_0x2d07('0x24')],function(_0x156ecb){return{'model':db[_0x156ecb[_0x2d07('0x26')]],'as':_0x156ecb['as'],'attributes':_0x156ecb[_0x2d07('0x22')],'include':_0x156ecb[_0x2d07('0x24')]?_[_0x2d07('0x25')](_0x156ecb[_0x2d07('0x24')],function(_0x17fa4e){return{'model':db[_0x17fa4e[_0x2d07('0x26')]],'as':_0x17fa4e['as'],'attributes':_0x17fa4e[_0x2d07('0x22')],'include':_0x17fa4e[_0x2d07('0x24')]?_['map'](_0x17fa4e[_0x2d07('0x24')],function(_0x12977b){return{'model':db[_0x12977b['model']],'as':_0x12977b['as'],'attributes':_0x12977b[_0x2d07('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2d07('0x11')](function(_0x348296){logger['info'](_0x2d07('0x1c'),_0x5695e1);logger[_0x2d07('0x14')]('GetVoiceQueue',_0x5695e1,JSON[_0x2d07('0x16')](_0x348296));_0x27f5d4(_0x348296);})['catch'](function(_0xf41777){logger['error']('GetVoiceQueue',_0xf41777['message'],_0x5695e1);_0x37164a(_0x1711c9['error'](0x1f4,_0xf41777[_0x2d07('0x19')]));});});};exports['ShowVoiceQueue']=function(_0x55bc14){var _0x286d17=this;return new Promise(function(_0x63fdf4,_0x4e8e71){return db[_0x2d07('0x1d')][_0x2d07('0x27')]({'raw':_0x55bc14[_0x2d07('0x1f')]?_0x55bc14['options']['raw']===undefined?!![]:![]:!![],'where':_0x55bc14['options']?_0x55bc14[_0x2d07('0x1f')][_0x2d07('0x21')]||null:null,'attributes':_0x55bc14[_0x2d07('0x1f')]?_0x55bc14[_0x2d07('0x1f')][_0x2d07('0x22')]||null:null,'include':_0x55bc14[_0x2d07('0x1f')]?_0x55bc14['options'][_0x2d07('0x24')]?_['map'](_0x55bc14[_0x2d07('0x1f')][_0x2d07('0x24')],function(_0x16554b){return{'model':db[_0x16554b['model']],'as':_0x16554b['as'],'attributes':_0x16554b[_0x2d07('0x22')],'include':_0x16554b[_0x2d07('0x24')]?_[_0x2d07('0x25')](_0x16554b[_0x2d07('0x24')],function(_0x4a2890){return{'model':db[_0x4a2890[_0x2d07('0x26')]],'as':_0x4a2890['as'],'attributes':_0x4a2890[_0x2d07('0x22')],'include':_0x4a2890['include']?_[_0x2d07('0x25')](_0x4a2890[_0x2d07('0x24')],function(_0x40eba7){return{'model':db[_0x40eba7[_0x2d07('0x26')]],'as':_0x40eba7['as'],'attributes':_0x40eba7[_0x2d07('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2d07('0x11')](function(_0x39b271){logger[_0x2d07('0x12')](_0x2d07('0x28'),_0x55bc14);logger['debug'](_0x2d07('0x28'),_0x55bc14,JSON['stringify'](_0x39b271));_0x63fdf4(_0x39b271);})[_0x2d07('0x1b')](function(_0x2a8bf9){logger[_0x2d07('0x17')](_0x2d07('0x28'),_0x2a8bf9[_0x2d07('0x19')],_0x55bc14);_0x4e8e71(_0x286d17[_0x2d07('0x17')](0x1f4,_0x2a8bf9[_0x2d07('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 0ff3798..4dc1c75 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 _0xc928=['register','length','./voiceQueue.events','update'];(function(_0x6cb0bf,_0x490d33){var _0x5e6555=function(_0x24be5d){while(--_0x24be5d){_0x6cb0bf['push'](_0x6cb0bf['shift']());}};_0x5e6555(++_0x490d33);}(_0xc928,0x1ca));var _0x8c92=function(_0x1b3afc,_0x329380){_0x1b3afc=_0x1b3afc-0x0;var _0x392dbb=_0xc928[_0x1b3afc];return _0x392dbb;};'use strict';var VoiceQueueEvents=require(_0x8c92('0x0'));var events=['save','remove',_0x8c92('0x1')];function createListener(_0x1fe9d1,_0x5645bd){return function(_0x280ef2){_0x5645bd['emit'](_0x1fe9d1,_0x280ef2);};}function removeListener(_0x6724e4,_0xd2860c){return function(){VoiceQueueEvents['removeListener'](_0x6724e4,_0xd2860c);};}exports[_0x8c92('0x2')]=function(_0x4bb2d0){for(var _0xdedda6=0x0,_0x39757a=events[_0x8c92('0x3')];_0xdedda6<_0x39757a;_0xdedda6++){var _0x453d8e=events[_0xdedda6];var _0x182952=createListener('voiceQueue:'+_0x453d8e,_0x4bb2d0);VoiceQueueEvents['on'](_0x453d8e,_0x182952);}}; \ No newline at end of file +var _0xfa4f=['removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove','update','emit'];(function(_0x1c57cc,_0x5aef70){var _0x21d48a=function(_0x2f401f){while(--_0x2f401f){_0x1c57cc['push'](_0x1c57cc['shift']());}};_0x21d48a(++_0x5aef70);}(_0xfa4f,0xd3));var _0xffa4=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xfa4f[_0x1b2ff7];return _0x31656a;};'use strict';var VoiceQueueEvents=require(_0xffa4('0x0'));var events=[_0xffa4('0x1'),_0xffa4('0x2'),_0xffa4('0x3')];function createListener(_0x422bb8,_0x45a8ff){return function(_0x36223c){_0x45a8ff[_0xffa4('0x4')](_0x422bb8,_0x36223c);};}function removeListener(_0x26ab44,_0x18e902){return function(){VoiceQueueEvents[_0xffa4('0x5')](_0x26ab44,_0x18e902);};}exports[_0xffa4('0x6')]=function(_0x1137af){for(var _0x59ca28=0x0,_0x533d53=events[_0xffa4('0x7')];_0x59ca28<_0x533d53;_0x59ca28++){var _0x5716d2=events[_0x59ca28];var _0x4331e7=createListener(_0xffa4('0x8')+_0x5716d2,_0x1137af);VoiceQueueEvents['on'](_0x5716d2,_0x4331e7);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index af91a67..5b22520 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 _0xf402=['post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show'];(function(_0x4a070c,_0x1aec05){var _0x1dcbd9=function(_0x439058){while(--_0x439058){_0x4a070c['push'](_0x4a070c['shift']());}};_0x1dcbd9(++_0x1aec05);}(_0xf402,0x19e));var _0x2f40=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xf402[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x2f40('0x0'));var util=require(_0x2f40('0x1'));var path=require(_0x2f40('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f40('0x3'));var router=express[_0x2f40('0x4')]();var fs_extra=require(_0x2f40('0x5'));var auth=require(_0x2f40('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2f40('0x7'));var controller=require(_0x2f40('0x8'));router[_0x2f40('0x9')]('/',auth[_0x2f40('0xa')](),controller[_0x2f40('0xb')]);router[_0x2f40('0x9')](_0x2f40('0xc'),auth[_0x2f40('0xa')](),controller[_0x2f40('0xd')]);router[_0x2f40('0x9')](_0x2f40('0xe'),auth[_0x2f40('0xa')](),controller[_0x2f40('0xf')]);router[_0x2f40('0x9')](_0x2f40('0x10'),auth[_0x2f40('0xa')](),controller[_0x2f40('0x11')]);router[_0x2f40('0x12')]('/',auth[_0x2f40('0xa')](),controller[_0x2f40('0x13')]);router[_0x2f40('0x14')](_0x2f40('0x10'),auth[_0x2f40('0xa')](),controller[_0x2f40('0x15')]);router[_0x2f40('0x16')]('/:id',auth[_0x2f40('0xa')](),controller[_0x2f40('0x17')]);module['exports']=router; \ No newline at end of file +var _0xcdd1=['show','post','create','put','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','isAuthenticated','index','get','describe','getVoiceQueuesReport','/:id'];(function(_0x1773f7,_0x54318f){var _0x1983fb=function(_0x50b543){while(--_0x50b543){_0x1773f7['push'](_0x1773f7['shift']());}};_0x1983fb(++_0x54318f);}(_0xcdd1,0xd7));var _0x1cdd=function(_0x101be8,_0x1ea713){_0x101be8=_0x101be8-0x0;var _0x32fb9c=_0xcdd1[_0x101be8];return _0x32fb9c;};'use strict';var multer=require(_0x1cdd('0x0'));var util=require(_0x1cdd('0x1'));var path=require(_0x1cdd('0x2'));var timeout=require(_0x1cdd('0x3'));var express=require('express');var router=express[_0x1cdd('0x4')]();var fs_extra=require(_0x1cdd('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1cdd('0x6'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0x1cdd('0x7')](),controller[_0x1cdd('0x8')]);router[_0x1cdd('0x9')]('/describe',auth[_0x1cdd('0x7')](),controller[_0x1cdd('0xa')]);router[_0x1cdd('0x9')]('/index',auth[_0x1cdd('0x7')](),controller[_0x1cdd('0xb')]);router[_0x1cdd('0x9')](_0x1cdd('0xc'),auth[_0x1cdd('0x7')](),controller[_0x1cdd('0xd')]);router[_0x1cdd('0xe')]('/',auth['isAuthenticated'](),controller[_0x1cdd('0xf')]);router[_0x1cdd('0x10')](_0x1cdd('0xc'),auth[_0x1cdd('0x7')](),controller[_0x1cdd('0x11')]);router[_0x1cdd('0x12')]('/:id',auth[_0x1cdd('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 8b6c1fa..a9ee879 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 _0xf68a=['seconds','setDataValue','queuecallerleaveAt','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x20b347,_0x4c15a1){var _0x50be8c=function(_0x3ed7f4){while(--_0x3ed7f4){_0x20b347['push'](_0x20b347['shift']());}};_0x50be8c(++_0x4c15a1);}(_0xf68a,0x160));var _0xaf68=function(_0x1c36d4,_0x4bc756){_0x1c36d4=_0x1c36d4-0x0;var _0x161da=_0xf68a[_0x1c36d4];return _0x161da;};'use strict';var Sequelize=require(_0xaf68('0x0'));var moment=require(_0xaf68('0x1'));module[_0xaf68('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xaf68('0x3')]},'calleridnum':{'type':Sequelize[_0xaf68('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xaf68('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xaf68('0x4')],'set':function(_0x2444dd){var _0x5a8c5e=moment(_0x2444dd);var _0x2d2a57=moment(this['getDataValue'](_0xaf68('0x5')))[_0xaf68('0x6')](_0xaf68('0x7'));var _0x37ab82=_0x5a8c5e['diff'](_0x2d2a57,_0xaf68('0x8'));this[_0xaf68('0x9')](_0xaf68('0xa'),_0x2444dd);this[_0xaf68('0x9')]('holdtime',_0x37ab82||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xaf68('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xaf68('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xaf68('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xaf68('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xaf68('0xc')},'originalposition':{'type':Sequelize[_0xaf68('0xd')]},'channel':{'type':Sequelize[_0xaf68('0x3')]},'connectedlinenum':{'type':Sequelize[_0xaf68('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xaf68('0x3')]},'priority':{'type':Sequelize[_0xaf68('0x3')]},'holdtime':{'type':Sequelize[_0xaf68('0xd')]},'mohtime':{'type':Sequelize[_0xaf68('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xaf68('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xaf68('0x3')],'comment':_0xaf68('0xe')},'transferexten':{'type':Sequelize[_0xaf68('0x3')]},'transferuniqueid':{'type':Sequelize[_0xaf68('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xaf68('0x3')]},'thirdDisposition':{'type':Sequelize[_0xaf68('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xaf68('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0xaf68('0x3')]}}; \ No newline at end of file +var _0xd18c=['setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','seconds'];(function(_0x2b6b12,_0x41b52d){var _0x5d7176=function(_0x2c1805){while(--_0x2c1805){_0x2b6b12['push'](_0x2b6b12['shift']());}};_0x5d7176(++_0x41b52d);}(_0xd18c,0x163));var _0xcd18=function(_0x25bb9d,_0x4f12cc){_0x25bb9d=_0x25bb9d-0x0;var _0x5e7a45=_0xd18c[_0x25bb9d];return _0x5e7a45;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xcd18('0x0'));module[_0xcd18('0x1')]={'type':{'type':Sequelize[_0xcd18('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xcd18('0x2')]},'queue':{'type':Sequelize[_0xcd18('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xcd18('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x1c4378){var _0x4a5c32=moment(_0x1c4378);var _0x1fd65d=moment(this[_0xcd18('0x4')](_0xcd18('0x5')))[_0xcd18('0x6')](_0xcd18('0x7'));var _0x47da52=_0x4a5c32['diff'](_0x1fd65d,_0xcd18('0x8'));this[_0xcd18('0x9')](_0xcd18('0xa'),_0x1c4378);this['setDataValue'](_0xcd18('0xb'),_0x47da52||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xcd18('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xcd18('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xcd18('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xcd18('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xcd18('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xcd18('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xcd18('0x2')]},'accountcode':{'type':Sequelize[_0xcd18('0x2')]},'context':{'type':Sequelize[_0xcd18('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xcd18('0x2')]},'holdtime':{'type':Sequelize[_0xcd18('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xcd18('0x2')]},'transfer':{'type':Sequelize[_0xcd18('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xcd18('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xcd18('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xcd18('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xcd18('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0xcd18('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 6401cd1..28ecf91 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 _0x330f=['localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','apply','reject','then','destroy','error','stack','send','index','map','VoiceQueueReport','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','getVoiceQueuesReport','fast-json-patch','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/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x330f,0x12c));var _0xf330=function(_0x1fb7d1,_0x108781){_0x1fb7d1=_0x1fb7d1-0x0;var _0x2480d8=_0x330f[_0x1fb7d1];return _0x2480d8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf330('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf330('0x1'));var util=require('util');var path=require(_0xf330('0x2'));var sox=require(_0xf330('0x3'));var csv=require(_0xf330('0x4'));var ejs=require(_0xf330('0x5'));var fs=require('fs');var fs_extra=require(_0xf330('0x6'));var _=require(_0xf330('0x7'));var squel=require(_0xf330('0x8'));var crypto=require(_0xf330('0x9'));var jsforce=require(_0xf330('0xa'));var deskjs=require(_0xf330('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf330('0xc'));var Papa=require(_0xf330('0xd'));var Redis=require('ioredis');var authService=require(_0xf330('0xe'));var qs=require(_0xf330('0xf'));var as=require(_0xf330('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf330('0x11'))('api');var utils=require(_0xf330('0x12'));var config=require(_0xf330('0x13'));var licenseUtil=require(_0xf330('0x14'));var db=require(_0xf330('0x15'))['db'];config[_0xf330('0x16')]=_[_0xf330('0x17')](config[_0xf330('0x16')],{'host':_0xf330('0x18'),'port':0x18eb});var socket=require(_0xf330('0x19'))(new Redis(config['redis']));require(_0xf330('0x1a'))[_0xf330('0x1b')](socket);function respondWithStatusCode(_0x1529e7,_0x3b5112){_0x3b5112=_0x3b5112||0xcc;return function(_0x1d2290){if(_0x1d2290){return _0x1529e7[_0xf330('0x1c')](_0x3b5112);}return _0x1529e7[_0xf330('0x1d')](_0x3b5112)[_0xf330('0x1e')]();};}function respondWithResult(_0x921ec8,_0x3de3d4){_0x3de3d4=_0x3de3d4||0xc8;return function(_0x497c58){if(_0x497c58){return _0x921ec8['status'](_0x3de3d4)[_0xf330('0x1f')](_0x497c58);}};}function respondWithFilteredResult(_0x4d4ded,_0x1f23ef){return function(_0x435559){if(_0x435559){var _0x4708e0=typeof _0x1f23ef['offset']===_0xf330('0x20')&&typeof _0x1f23ef['limit']===_0xf330('0x20');var _0x2f1d90=_0x435559[_0xf330('0x21')];var _0x45ff4e=_0x4708e0?0x0:_0x1f23ef[_0xf330('0x22')];var _0x10b609=_0x4708e0?_0x435559[_0xf330('0x21')]:_0x1f23ef['offset']+_0x1f23ef[_0xf330('0x23')];var _0x40a1d8;if(_0x10b609>=_0x2f1d90){_0x10b609=_0x2f1d90;_0x40a1d8=0xc8;}else{_0x40a1d8=0xce;}_0x4d4ded[_0xf330('0x1d')](_0x40a1d8);return _0x4d4ded['set']('Content-Range',_0x45ff4e+'-'+_0x10b609+'/'+_0x2f1d90)[_0xf330('0x1f')](_0x435559);}return null;};}function patchUpdates(_0x395cf0){return function(_0x2e9a9e){try{jsonpatch[_0xf330('0x24')](_0x2e9a9e,_0x395cf0,!![]);}catch(_0x47d42e){return BPromise[_0xf330('0x25')](_0x47d42e);}return _0x2e9a9e['save']();};}function saveUpdates(_0x311cb7,_0x5c47a0){return function(_0x1b6154){if(_0x1b6154){return _0x1b6154['update'](_0x311cb7)[_0xf330('0x26')](function(_0x38d08){return _0x38d08;});}return null;};}function removeEntity(_0x463ce4,_0x1284b0){return function(_0x361c3e){if(_0x361c3e){return _0x361c3e[_0xf330('0x27')]()['then'](function(){_0x463ce4[_0xf330('0x1d')](0xcc)[_0xf330('0x1e')]();});}};}function handleEntityNotFound(_0x57bba1,_0x56642a){return function(_0x158008){if(!_0x158008){_0x57bba1[_0xf330('0x1c')](0x194);}return _0x158008;};}function handleError(_0x115c3e,_0x443dd4){_0x443dd4=_0x443dd4||0x1f4;return function(_0x437aa5){logger[_0xf330('0x28')](_0x437aa5[_0xf330('0x29')]);if(_0x437aa5['name']){delete _0x437aa5['name'];}_0x115c3e[_0xf330('0x1d')](_0x443dd4)[_0xf330('0x2a')](_0x437aa5);};}exports[_0xf330('0x2b')]=function(_0x17fc9f,_0x6acc7e){var _0xb4dd41={},_0x8e66a2={},_0x2bc24c={'count':0x0,'rows':[]};var _0x1f2a95=_[_0xf330('0x2c')](db[_0xf330('0x2d')]['rawAttributes'],function(_0x548cc5){return{'name':_0x548cc5[_0xf330('0x2e')],'type':_0x548cc5[_0xf330('0x2f')][_0xf330('0x30')]};});_0x8e66a2[_0xf330('0x31')]=_['map'](_0x1f2a95,_0xf330('0x32'));_0x8e66a2[_0xf330('0x33')]=_[_0xf330('0x34')](_0x17fc9f[_0xf330('0x33')]);_0x8e66a2[_0xf330('0x35')]=_['intersection'](_0x8e66a2[_0xf330('0x31')],_0x8e66a2[_0xf330('0x33')]);_0xb4dd41[_0xf330('0x36')]=_[_0xf330('0x37')](_0x8e66a2[_0xf330('0x31')],qs[_0xf330('0x38')](_0x17fc9f[_0xf330('0x33')][_0xf330('0x38')]));_0xb4dd41[_0xf330('0x36')]=_0xb4dd41[_0xf330('0x36')][_0xf330('0x39')]?_0xb4dd41[_0xf330('0x36')]:_0x8e66a2['model'];if(!_0x17fc9f[_0xf330('0x33')][_0xf330('0x3a')](_0xf330('0x3b'))){_0xb4dd41['limit']=qs[_0xf330('0x23')](_0x17fc9f[_0xf330('0x33')][_0xf330('0x23')]);_0xb4dd41['offset']=qs[_0xf330('0x22')](_0x17fc9f[_0xf330('0x33')][_0xf330('0x22')]);}_0xb4dd41[_0xf330('0x3c')]=qs[_0xf330('0x3d')](_0x17fc9f[_0xf330('0x33')][_0xf330('0x3d')]);_0xb4dd41[_0xf330('0x3e')]=qs[_0xf330('0x35')](_[_0xf330('0x3f')](_0x17fc9f[_0xf330('0x33')],_0x8e66a2[_0xf330('0x35')]),_0x1f2a95);if(_0x17fc9f[_0xf330('0x33')]['filter']){_0xb4dd41[_0xf330('0x3e')]=_['merge'](_0xb4dd41[_0xf330('0x3e')],{'$or':_[_0xf330('0x2c')](_0x1f2a95,function(_0x3418c6){if(_0x3418c6['type']!==_0xf330('0x40')){var _0x470934={};_0x470934[_0x3418c6['name']]={'$like':'%'+_0x17fc9f[_0xf330('0x33')][_0xf330('0x41')]+'%'};return _0x470934;}})});}_0xb4dd41=_[_0xf330('0x42')]({},_0xb4dd41,_0x17fc9f[_0xf330('0x43')]);var _0x38b75f={'where':_0xb4dd41['where']};return db[_0xf330('0x2d')]['count'](_0x38b75f)[_0xf330('0x26')](function(_0x3d3e60){_0x2bc24c[_0xf330('0x21')]=_0x3d3e60;if(_0x17fc9f[_0xf330('0x33')][_0xf330('0x44')]){_0xb4dd41[_0xf330('0x45')]=[{'all':!![]}];}return db[_0xf330('0x2d')][_0xf330('0x46')](_0xb4dd41);})['then'](function(_0x26fd6c){_0x2bc24c[_0xf330('0x47')]=_0x26fd6c;return _0x2bc24c;})[_0xf330('0x26')](respondWithFilteredResult(_0x6acc7e,_0xb4dd41))[_0xf330('0x48')](handleError(_0x6acc7e,null));};exports[_0xf330('0x49')]=function(_0x36743b,_0x4a3ba7){var _0x51f7e7={'raw':![],'where':{'id':_0x36743b[_0xf330('0x4a')]['id']}},_0x56b4d5={};_0x56b4d5[_0xf330('0x31')]=_[_0xf330('0x34')](db[_0xf330('0x2d')][_0xf330('0x4b')]);_0x56b4d5[_0xf330('0x33')]=_[_0xf330('0x34')](_0x36743b['query']);_0x56b4d5[_0xf330('0x35')]=_[_0xf330('0x37')](_0x56b4d5['model'],_0x56b4d5[_0xf330('0x33')]);_0x51f7e7[_0xf330('0x36')]=_[_0xf330('0x37')](_0x56b4d5[_0xf330('0x31')],qs[_0xf330('0x38')](_0x36743b[_0xf330('0x33')][_0xf330('0x38')]));_0x51f7e7[_0xf330('0x36')]=_0x51f7e7['attributes']['length']?_0x51f7e7['attributes']:_0x56b4d5[_0xf330('0x31')];if(_0x36743b['query'][_0xf330('0x44')]){_0x51f7e7[_0xf330('0x45')]=[{'all':!![]}];}_0x51f7e7=_[_0xf330('0x42')]({},_0x51f7e7,_0x36743b['options']);return db[_0xf330('0x2d')][_0xf330('0x4c')](_0x51f7e7)['then'](handleEntityNotFound(_0x4a3ba7,null))[_0xf330('0x26')](respondWithResult(_0x4a3ba7,null))[_0xf330('0x48')](handleError(_0x4a3ba7,null));};exports['create']=function(_0x330ecc,_0x485f9a){return db[_0xf330('0x2d')][_0xf330('0x4d')](_0x330ecc[_0xf330('0x4e')],{})['then'](respondWithResult(_0x485f9a,0xc9))[_0xf330('0x48')](handleError(_0x485f9a,null));};exports['update']=function(_0x2f438b,_0x433916){if(_0x2f438b[_0xf330('0x4e')]['id']){delete _0x2f438b[_0xf330('0x4e')]['id'];}return db['VoiceQueueReport'][_0xf330('0x4c')]({'where':{'id':_0x2f438b[_0xf330('0x4a')]['id']}})[_0xf330('0x26')](handleEntityNotFound(_0x433916,null))[_0xf330('0x26')](saveUpdates(_0x2f438b[_0xf330('0x4e')],null))[_0xf330('0x26')](respondWithResult(_0x433916,null))[_0xf330('0x48')](handleError(_0x433916,null));};exports[_0xf330('0x27')]=function(_0x45d4c2,_0x424a34){return db[_0xf330('0x2d')][_0xf330('0x4c')]({'where':{'id':_0x45d4c2[_0xf330('0x4a')]['id']}})[_0xf330('0x26')](handleEntityNotFound(_0x424a34,null))['then'](removeEntity(_0x424a34,null))[_0xf330('0x48')](handleError(_0x424a34,null));};exports['describe']=function(_0x49c2c3,_0x313a1f){return db['VoiceQueueReport'][_0xf330('0x4f')]()[_0xf330('0x26')](respondWithResult(_0x313a1f,null))[_0xf330('0x48')](handleError(_0x313a1f,null));};exports['getVoiceQueuesReport']=function(_0x34e656,_0xedaff5){var _0x9cb08b={},_0x5383f8={},_0x1f83cd={'count':0x0,'rows':[]};_0x5383f8['model']=_['keys'](db['VoiceQueueReport'][_0xf330('0x4b')]);_0x5383f8['query']=_[_0xf330('0x34')](_0x34e656[_0xf330('0x33')]);_0x5383f8[_0xf330('0x35')]=_[_0xf330('0x37')](_0x5383f8[_0xf330('0x31')],_0x5383f8[_0xf330('0x33')]);_0x9cb08b[_0xf330('0x36')]=_[_0xf330('0x37')](_0x5383f8[_0xf330('0x31')],qs[_0xf330('0x38')](_0x34e656[_0xf330('0x33')][_0xf330('0x38')]));_0x9cb08b[_0xf330('0x36')]=_0x9cb08b[_0xf330('0x36')][_0xf330('0x39')]?_0x9cb08b[_0xf330('0x36')]:_0x5383f8[_0xf330('0x31')];if(!_0x34e656[_0xf330('0x33')][_0xf330('0x3a')](_0xf330('0x3b'))){_0x9cb08b[_0xf330('0x23')]=qs[_0xf330('0x23')](_0x34e656[_0xf330('0x33')][_0xf330('0x23')]);_0x9cb08b[_0xf330('0x22')]=qs[_0xf330('0x22')](_0x34e656['query'][_0xf330('0x22')]);}_0x9cb08b[_0xf330('0x3c')]=qs[_0xf330('0x3d')](_0x34e656[_0xf330('0x33')][_0xf330('0x3d')]);_0x9cb08b[_0xf330('0x3e')]=qs[_0xf330('0x35')](_[_0xf330('0x3f')](_0x34e656[_0xf330('0x33')],_0x5383f8[_0xf330('0x35')]));if(_0x34e656[_0xf330('0x33')][_0xf330('0x41')]){_0x9cb08b[_0xf330('0x3e')]=_['merge'](_0x9cb08b[_0xf330('0x3e')],{'$or':_['map'](_0x9cb08b[_0xf330('0x36')],function(_0x107be2){var _0x13f31d={};_0x13f31d[_0x107be2]={'$like':'%'+_0x34e656['query'][_0xf330('0x41')]+'%'};return _0x13f31d;})});}_0x9cb08b=_['merge']({},_0x9cb08b,_0x34e656[_0xf330('0x43')]);var _0x46bae4={'where':_0x9cb08b[_0xf330('0x3e')]};return db['VoiceQueueReport']['count'](_0x46bae4)[_0xf330('0x26')](function(_0x48d7d9){_0x1f83cd[_0xf330('0x21')]=_0x48d7d9;if(_0x34e656[_0xf330('0x33')][_0xf330('0x44')]){_0x9cb08b[_0xf330('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x9cb08b);})[_0xf330('0x26')](function(_0x147a76){_0x1f83cd[_0xf330('0x47')]=_0x147a76;return _0x1f83cd;})[_0xf330('0x26')](respondWithFilteredResult(_0xedaff5,_0x9cb08b,'getVoiceQueuesReport'))[_0xf330('0x48')](handleError(_0xedaff5,null,_0xf330('0x50')));}; \ No newline at end of file +var _0x28f6=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','find','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','defaults','socket.io-emitter','./voiceQueueReport.socket','register','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','stack','name','send','fieldName','type','key','model','map','query','filters'];(function(_0x5a55c9,_0x2b01dc){var _0x1bc51c=function(_0x5cce99){while(--_0x5cce99){_0x5a55c9['push'](_0x5a55c9['shift']());}};_0x1bc51c(++_0x2b01dc);}(_0x28f6,0x75));var _0x628f=function(_0x39dbeb,_0x437b01){_0x39dbeb=_0x39dbeb-0x0;var _0x52827b=_0x28f6[_0x39dbeb];return _0x52827b;};'use strict';var emlformat=require(_0x628f('0x0'));var rimraf=require(_0x628f('0x1'));var zipdir=require(_0x628f('0x2'));var jsonpatch=require(_0x628f('0x3'));var rp=require(_0x628f('0x4'));var moment=require(_0x628f('0x5'));var BPromise=require(_0x628f('0x6'));var Mustache=require(_0x628f('0x7'));var util=require(_0x628f('0x8'));var path=require(_0x628f('0x9'));var sox=require(_0x628f('0xa'));var csv=require(_0x628f('0xb'));var ejs=require(_0x628f('0xc'));var fs=require('fs');var fs_extra=require(_0x628f('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x628f('0xe'));var jsforce=require(_0x628f('0xf'));var deskjs=require(_0x628f('0x10'));var toCsv=require(_0x628f('0xb'));var querystring=require(_0x628f('0x11'));var Papa=require(_0x628f('0x12'));var Redis=require(_0x628f('0x13'));var authService=require(_0x628f('0x14'));var qs=require(_0x628f('0x15'));var as=require(_0x628f('0x16'));var hardwareService=require(_0x628f('0x17'));var logger=require(_0x628f('0x18'))(_0x628f('0x19'));var utils=require(_0x628f('0x1a'));var config=require(_0x628f('0x1b'));var licenseUtil=require(_0x628f('0x1c'));var db=require(_0x628f('0x1d'))['db'];config[_0x628f('0x1e')]=_[_0x628f('0x1f')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x628f('0x20'))(new Redis(config[_0x628f('0x1e')]));require(_0x628f('0x21'))[_0x628f('0x22')](socket);function respondWithStatusCode(_0x459a68,_0x216c61){_0x216c61=_0x216c61||0xcc;return function(_0x3982d7){if(_0x3982d7){return _0x459a68['sendStatus'](_0x216c61);}return _0x459a68[_0x628f('0x23')](_0x216c61)[_0x628f('0x24')]();};}function respondWithResult(_0x843f94,_0x1d4b41){_0x1d4b41=_0x1d4b41||0xc8;return function(_0x192a6a){if(_0x192a6a){return _0x843f94[_0x628f('0x23')](_0x1d4b41)[_0x628f('0x25')](_0x192a6a);}};}function respondWithFilteredResult(_0x84ec06,_0x53e4fe){return function(_0x48e2e0){if(_0x48e2e0){var _0x21240b=typeof _0x53e4fe[_0x628f('0x26')]===_0x628f('0x27')&&typeof _0x53e4fe['limit']===_0x628f('0x27');var _0x31e425=_0x48e2e0[_0x628f('0x28')];var _0x2b2860=_0x21240b?0x0:_0x53e4fe[_0x628f('0x26')];var _0x2aed73=_0x21240b?_0x48e2e0[_0x628f('0x28')]:_0x53e4fe[_0x628f('0x26')]+_0x53e4fe[_0x628f('0x29')];var _0x35058d;if(_0x2aed73>=_0x31e425){_0x2aed73=_0x31e425;_0x35058d=0xc8;}else{_0x35058d=0xce;}_0x84ec06['status'](_0x35058d);return _0x84ec06[_0x628f('0x2a')]('Content-Range',_0x2b2860+'-'+_0x2aed73+'/'+_0x31e425)[_0x628f('0x25')](_0x48e2e0);}return null;};}function patchUpdates(_0x447592){return function(_0x1cebbe){try{jsonpatch[_0x628f('0x2b')](_0x1cebbe,_0x447592,!![]);}catch(_0x21fb10){return BPromise[_0x628f('0x2c')](_0x21fb10);}return _0x1cebbe[_0x628f('0x2d')]();};}function saveUpdates(_0x5f43b9,_0x55f35e){return function(_0xc95e73){if(_0xc95e73){return _0xc95e73[_0x628f('0x2e')](_0x5f43b9)[_0x628f('0x2f')](function(_0x58e8f9){return _0x58e8f9;});}return null;};}function removeEntity(_0x3025a3,_0x33420a){return function(_0xcec81a){if(_0xcec81a){return _0xcec81a[_0x628f('0x30')]()['then'](function(){_0x3025a3[_0x628f('0x23')](0xcc)[_0x628f('0x24')]();});}};}function handleEntityNotFound(_0xb97818,_0x570802){return function(_0x5bda8d){if(!_0x5bda8d){_0xb97818['sendStatus'](0x194);}return _0x5bda8d;};}function handleError(_0x5d34fb,_0x31cd63){_0x31cd63=_0x31cd63||0x1f4;return function(_0x1b2163){logger['error'](_0x1b2163[_0x628f('0x31')]);if(_0x1b2163[_0x628f('0x32')]){delete _0x1b2163['name'];}_0x5d34fb[_0x628f('0x23')](_0x31cd63)[_0x628f('0x33')](_0x1b2163);};}exports['index']=function(_0x120605,_0x3cbc38){var _0x5552ee={},_0x2a490d={},_0x5f2626={'count':0x0,'rows':[]};var _0x2b09e4=_['map'](db['VoiceQueueReport']['rawAttributes'],function(_0x2c4d69){return{'name':_0x2c4d69[_0x628f('0x34')],'type':_0x2c4d69[_0x628f('0x35')][_0x628f('0x36')]};});_0x2a490d[_0x628f('0x37')]=_[_0x628f('0x38')](_0x2b09e4,_0x628f('0x32'));_0x2a490d[_0x628f('0x39')]=_['keys'](_0x120605[_0x628f('0x39')]);_0x2a490d[_0x628f('0x3a')]=_[_0x628f('0x3b')](_0x2a490d[_0x628f('0x37')],_0x2a490d[_0x628f('0x39')]);_0x5552ee[_0x628f('0x3c')]=_[_0x628f('0x3b')](_0x2a490d[_0x628f('0x37')],qs[_0x628f('0x3d')](_0x120605[_0x628f('0x39')][_0x628f('0x3d')]));_0x5552ee['attributes']=_0x5552ee[_0x628f('0x3c')]['length']?_0x5552ee[_0x628f('0x3c')]:_0x2a490d[_0x628f('0x37')];if(!_0x120605[_0x628f('0x39')][_0x628f('0x3e')](_0x628f('0x3f'))){_0x5552ee[_0x628f('0x29')]=qs['limit'](_0x120605[_0x628f('0x39')][_0x628f('0x29')]);_0x5552ee[_0x628f('0x26')]=qs[_0x628f('0x26')](_0x120605['query']['offset']);}_0x5552ee[_0x628f('0x40')]=qs[_0x628f('0x41')](_0x120605[_0x628f('0x39')][_0x628f('0x41')]);_0x5552ee[_0x628f('0x42')]=qs['filters'](_[_0x628f('0x43')](_0x120605[_0x628f('0x39')],_0x2a490d[_0x628f('0x3a')]),_0x2b09e4);if(_0x120605[_0x628f('0x39')][_0x628f('0x44')]){_0x5552ee[_0x628f('0x42')]=_[_0x628f('0x45')](_0x5552ee[_0x628f('0x42')],{'$or':_[_0x628f('0x38')](_0x2b09e4,function(_0x40bc7d){if(_0x40bc7d[_0x628f('0x35')]!==_0x628f('0x46')){var _0x458f58={};_0x458f58[_0x40bc7d['name']]={'$like':'%'+_0x120605[_0x628f('0x39')][_0x628f('0x44')]+'%'};return _0x458f58;}})});}_0x5552ee=_[_0x628f('0x45')]({},_0x5552ee,_0x120605[_0x628f('0x47')]);var _0x489dd2={'where':_0x5552ee[_0x628f('0x42')]};return db[_0x628f('0x48')]['count'](_0x489dd2)[_0x628f('0x2f')](function(_0x37ca85){_0x5f2626['count']=_0x37ca85;if(_0x120605['query'][_0x628f('0x49')]){_0x5552ee[_0x628f('0x4a')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x628f('0x4b')](_0x5552ee);})[_0x628f('0x2f')](function(_0x4a98f3){_0x5f2626[_0x628f('0x4c')]=_0x4a98f3;return _0x5f2626;})[_0x628f('0x2f')](respondWithFilteredResult(_0x3cbc38,_0x5552ee))[_0x628f('0x4d')](handleError(_0x3cbc38,null));};exports[_0x628f('0x4e')]=function(_0x3a0957,_0x5e9251){var _0x52d1e9={'raw':![],'where':{'id':_0x3a0957[_0x628f('0x4f')]['id']}},_0x5aa6f8={};_0x5aa6f8[_0x628f('0x37')]=_[_0x628f('0x50')](db[_0x628f('0x48')][_0x628f('0x51')]);_0x5aa6f8[_0x628f('0x39')]=_['keys'](_0x3a0957[_0x628f('0x39')]);_0x5aa6f8[_0x628f('0x3a')]=_[_0x628f('0x3b')](_0x5aa6f8[_0x628f('0x37')],_0x5aa6f8[_0x628f('0x39')]);_0x52d1e9[_0x628f('0x3c')]=_[_0x628f('0x3b')](_0x5aa6f8['model'],qs[_0x628f('0x3d')](_0x3a0957[_0x628f('0x39')]['fields']));_0x52d1e9[_0x628f('0x3c')]=_0x52d1e9['attributes'][_0x628f('0x52')]?_0x52d1e9[_0x628f('0x3c')]:_0x5aa6f8[_0x628f('0x37')];if(_0x3a0957[_0x628f('0x39')][_0x628f('0x49')]){_0x52d1e9[_0x628f('0x4a')]=[{'all':!![]}];}_0x52d1e9=_[_0x628f('0x45')]({},_0x52d1e9,_0x3a0957['options']);return db[_0x628f('0x48')][_0x628f('0x53')](_0x52d1e9)['then'](handleEntityNotFound(_0x5e9251,null))[_0x628f('0x2f')](respondWithResult(_0x5e9251,null))[_0x628f('0x4d')](handleError(_0x5e9251,null));};exports['create']=function(_0x3a47bf,_0x2bae4f){return db['VoiceQueueReport'][_0x628f('0x54')](_0x3a47bf[_0x628f('0x55')],{})[_0x628f('0x2f')](respondWithResult(_0x2bae4f,0xc9))[_0x628f('0x4d')](handleError(_0x2bae4f,null));};exports[_0x628f('0x2e')]=function(_0x3cc8a0,_0x50e7e5){if(_0x3cc8a0[_0x628f('0x55')]['id']){delete _0x3cc8a0[_0x628f('0x55')]['id'];}return db[_0x628f('0x48')][_0x628f('0x53')]({'where':{'id':_0x3cc8a0[_0x628f('0x4f')]['id']}})[_0x628f('0x2f')](handleEntityNotFound(_0x50e7e5,null))[_0x628f('0x2f')](saveUpdates(_0x3cc8a0[_0x628f('0x55')],null))[_0x628f('0x2f')](respondWithResult(_0x50e7e5,null))[_0x628f('0x4d')](handleError(_0x50e7e5,null));};exports[_0x628f('0x30')]=function(_0x39adb8,_0xa15875){return db[_0x628f('0x48')]['find']({'where':{'id':_0x39adb8[_0x628f('0x4f')]['id']}})[_0x628f('0x2f')](handleEntityNotFound(_0xa15875,null))[_0x628f('0x2f')](removeEntity(_0xa15875,null))[_0x628f('0x4d')](handleError(_0xa15875,null));};exports['describe']=function(_0xdef7f5,_0x35a804){return db['VoiceQueueReport'][_0x628f('0x56')]()[_0x628f('0x2f')](respondWithResult(_0x35a804,null))[_0x628f('0x4d')](handleError(_0x35a804,null));};exports[_0x628f('0x57')]=function(_0xc1cba6,_0x5ef163){var _0x4b9aae={},_0x5a9e8f={},_0x551c5e={'count':0x0,'rows':[]};_0x5a9e8f[_0x628f('0x37')]=_[_0x628f('0x50')](db[_0x628f('0x48')][_0x628f('0x51')]);_0x5a9e8f['query']=_[_0x628f('0x50')](_0xc1cba6[_0x628f('0x39')]);_0x5a9e8f[_0x628f('0x3a')]=_[_0x628f('0x3b')](_0x5a9e8f['model'],_0x5a9e8f['query']);_0x4b9aae[_0x628f('0x3c')]=_[_0x628f('0x3b')](_0x5a9e8f['model'],qs['fields'](_0xc1cba6[_0x628f('0x39')][_0x628f('0x3d')]));_0x4b9aae[_0x628f('0x3c')]=_0x4b9aae[_0x628f('0x3c')][_0x628f('0x52')]?_0x4b9aae[_0x628f('0x3c')]:_0x5a9e8f[_0x628f('0x37')];if(!_0xc1cba6[_0x628f('0x39')][_0x628f('0x3e')](_0x628f('0x3f'))){_0x4b9aae[_0x628f('0x29')]=qs['limit'](_0xc1cba6[_0x628f('0x39')][_0x628f('0x29')]);_0x4b9aae[_0x628f('0x26')]=qs['offset'](_0xc1cba6[_0x628f('0x39')][_0x628f('0x26')]);}_0x4b9aae['order']=qs[_0x628f('0x41')](_0xc1cba6[_0x628f('0x39')][_0x628f('0x41')]);_0x4b9aae[_0x628f('0x42')]=qs['filters'](_[_0x628f('0x43')](_0xc1cba6[_0x628f('0x39')],_0x5a9e8f[_0x628f('0x3a')]));if(_0xc1cba6['query'][_0x628f('0x44')]){_0x4b9aae['where']=_['merge'](_0x4b9aae[_0x628f('0x42')],{'$or':_[_0x628f('0x38')](_0x4b9aae[_0x628f('0x3c')],function(_0x1c7d30){var _0x52b7e0={};_0x52b7e0[_0x1c7d30]={'$like':'%'+_0xc1cba6[_0x628f('0x39')]['filter']+'%'};return _0x52b7e0;})});}_0x4b9aae=_[_0x628f('0x45')]({},_0x4b9aae,_0xc1cba6[_0x628f('0x47')]);var _0x49172b={'where':_0x4b9aae[_0x628f('0x42')]};return db[_0x628f('0x48')]['count'](_0x49172b)['then'](function(_0x16c3b2){_0x551c5e[_0x628f('0x28')]=_0x16c3b2;if(_0xc1cba6[_0x628f('0x39')]['includeAll']){_0x4b9aae[_0x628f('0x4a')]=[{'all':!![]}];}return db[_0x628f('0x48')][_0x628f('0x4b')](_0x4b9aae);})[_0x628f('0x2f')](function(_0x181bad){_0x551c5e[_0x628f('0x4c')]=_0x181bad;return _0x551c5e;})[_0x628f('0x2f')](respondWithFilteredResult(_0x5ef163,_0x4b9aae,_0x628f('0x57')))['catch'](handleError(_0x5ef163,null,_0x628f('0x57')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 8b5c1b6..5b78862 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 _0x6832=['hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x390ca8,_0x500e36){var _0xccf140=function(_0x7eb74e){while(--_0x7eb74e){_0x390ca8['push'](_0x390ca8['shift']());}};_0xccf140(++_0x500e36);}(_0x6832,0xb9));var _0x2683=function(_0x50de3e,_0x4f46d4){_0x50de3e=_0x50de3e-0x0;var _0x1d646d=_0x6832[_0x50de3e];return _0x1d646d;};'use strict';var EventEmitter=require(_0x2683('0x0'));var VoiceQueueReport=require(_0x2683('0x1'))['db'][_0x2683('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x2683('0x3')](0x0);var events={'afterCreate':_0x2683('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5ae0ce){return function(_0x1ee5c7,_0x4d0113,_0x42dad6){VoiceQueueReportEvents['emit'](_0x5ae0ce+':'+_0x1ee5c7['id'],_0x1ee5c7);VoiceQueueReportEvents[_0x2683('0x5')](_0x5ae0ce,_0x1ee5c7);_0x42dad6(null);};}for(var e in events){if(events[_0x2683('0x6')](e)){var event=events[e];VoiceQueueReport[_0x2683('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0xfa72=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','emit','hook','events'];(function(_0x2f35ec,_0x2d2b6c){var _0xc8b618=function(_0x452a3a){while(--_0x452a3a){_0x2f35ec['push'](_0x2f35ec['shift']());}};_0xc8b618(++_0x2d2b6c);}(_0xfa72,0xbc));var _0x2fa7=function(_0x9c8898,_0x14987c){_0x9c8898=_0x9c8898-0x0;var _0x5d84ed=_0xfa72[_0x9c8898];return _0x5d84ed;};'use strict';var EventEmitter=require(_0x2fa7('0x0'));var VoiceQueueReport=require(_0x2fa7('0x1'))['db'][_0x2fa7('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x2fa7('0x3')](0x0);var events={'afterCreate':_0x2fa7('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2475a2){return function(_0x13790d,_0x78145c,_0x1fe46a){VoiceQueueReportEvents['emit'](_0x2475a2+':'+_0x13790d['id'],_0x13790d);VoiceQueueReportEvents[_0x2fa7('0x5')](_0x2475a2,_0x13790d);_0x1fe46a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x2fa7('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index a6b10a6..67106c6 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 _0xe283=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash'];(function(_0x86268a,_0x87d96a){var _0x20d169=function(_0x11504e){while(--_0x11504e){_0x86268a['push'](_0x86268a['shift']());}};_0x20d169(++_0x87d96a);}(_0xe283,0xdf));var _0x3e28=function(_0x592df4,_0x4e719b){_0x592df4=_0x592df4-0x0;var _0x3b4fe4=_0xe283[_0x592df4];return _0x3b4fe4;};'use strict';var _=require(_0x3e28('0x0'));var util=require(_0x3e28('0x1'));var logger=require(_0x3e28('0x2'))(_0x3e28('0x3'));var moment=require(_0x3e28('0x4'));var BPromise=require('bluebird');var rp=require(_0x3e28('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e28('0x6'));var config=require(_0x3e28('0x7'));var attributes=require(_0x3e28('0x8'));module['exports']=function(_0x20fc4d,_0x2780c7){return _0x20fc4d[_0x3e28('0x9')](_0x3e28('0xa'),attributes,{'tableName':_0x3e28('0xb'),'paranoid':![],'indexes':[{'fields':[_0x3e28('0xc')]},{'fields':[_0x3e28('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x861c=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum'];(function(_0x49e59c,_0x37ec1f){var _0x34240e=function(_0x3f7a16){while(--_0x3f7a16){_0x49e59c['push'](_0x49e59c['shift']());}};_0x34240e(++_0x37ec1f);}(_0x861c,0x1c0));var _0xc861=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x861c[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0xc861('0x0'));var logger=require(_0xc861('0x1'))(_0xc861('0x2'));var moment=require(_0xc861('0x3'));var BPromise=require(_0xc861('0x4'));var rp=require(_0xc861('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc861('0x6'));var config=require(_0xc861('0x7'));var attributes=require(_0xc861('0x8'));module[_0xc861('0x9')]=function(_0x4445b0,_0x540084){return _0x4445b0['define'](_0xc861('0xa'),attributes,{'tableName':_0xc861('0xb'),'paranoid':![],'indexes':[{'fields':[_0xc861('0xc')]},{'fields':[_0xc861('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 bf22865..7d026ab 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 _0x9884=['socket.io-emitter','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','model','map','debug','stringify','CreateVoiceQueueReport','VoiceQueueReport','create','body','catch','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x3baac0,_0x240918){var _0x2ec5cd=function(_0x58aa3b){while(--_0x58aa3b){_0x3baac0['push'](_0x3baac0['shift']());}};_0x2ec5cd(++_0x240918);}(_0x9884,0xee));var _0x4988=function(_0x5e2310,_0x21c269){_0x5e2310=_0x5e2310-0x0;var _0x4f78cd=_0x9884[_0x5e2310];return _0x4f78cd;};'use strict';var _=require(_0x4988('0x0'));var util=require(_0x4988('0x1'));var moment=require(_0x4988('0x2'));var BPromise=require(_0x4988('0x3'));var rs=require(_0x4988('0x4'));var fs=require('fs');var Redis=require(_0x4988('0x5'));var db=require(_0x4988('0x6'))['db'];var utils=require(_0x4988('0x7'));var logger=require('../../config/logger')(_0x4988('0x8'));var config=require(_0x4988('0x9'));var jayson=require(_0x4988('0xa'));var client=jayson['client'][_0x4988('0xb')]({'port':0x232a});config[_0x4988('0xc')]=_[_0x4988('0xd')](config[_0x4988('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4988('0xe'))(new Redis(config[_0x4988('0xc')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x5a67bc,_0x4c1ec0,_0x513957){return new BPromise(function(_0x2e3094,_0x992585){return client[_0x4988('0xf')](_0x5a67bc,_0x513957)[_0x4988('0x10')](function(_0x10b3f6){logger[_0x4988('0x11')](_0x4988('0x12'),_0x4c1ec0,_0x4988('0x13'));logger['debug'](_0x4988('0x14'),_0x4c1ec0,_0x4988('0x13'),JSON['stringify'](_0x10b3f6));if(_0x10b3f6[_0x4988('0x15')]){if(_0x10b3f6[_0x4988('0x15')][_0x4988('0x16')]===0x1f4){logger[_0x4988('0x15')](_0x4988('0x12'),_0x4c1ec0,_0x10b3f6['error'][_0x4988('0x17')]);return _0x992585(_0x10b3f6['error'][_0x4988('0x17')]);}logger[_0x4988('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x4c1ec0,_0x10b3f6['error'][_0x4988('0x17')]);return _0x2e3094(_0x10b3f6[_0x4988('0x15')][_0x4988('0x17')]);}else{logger['info'](_0x4988('0x12'),_0x4c1ec0,_0x4988('0x13'));_0x2e3094(_0x10b3f6['result'][_0x4988('0x17')]);}})['catch'](function(_0x48a449){logger[_0x4988('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x4c1ec0,_0x48a449);_0x992585(_0x48a449);});});}exports[_0x4988('0x18')]=function(_0x38daa0){var _0x606488=this;return new Promise(function(_0x4fd1da,_0x580bf3){return db['VoiceQueueReport'][_0x4988('0x19')]({'raw':_0x38daa0['options']?_0x38daa0[_0x4988('0x1a')][_0x4988('0x1b')]===undefined?!![]:![]:!![],'where':_0x38daa0[_0x4988('0x1a')]?_0x38daa0[_0x4988('0x1a')][_0x4988('0x1c')]||null:null,'attributes':_0x38daa0[_0x4988('0x1a')]?_0x38daa0[_0x4988('0x1a')][_0x4988('0x1d')]||null:null,'limit':_0x38daa0[_0x4988('0x1a')]?_0x38daa0['options'][_0x4988('0x1e')]||null:null,'include':_0x38daa0['options']?_0x38daa0[_0x4988('0x1a')]['include']?_['map'](_0x38daa0[_0x4988('0x1a')][_0x4988('0x1f')],function(_0x1eacae){return{'model':db[_0x1eacae[_0x4988('0x20')]],'as':_0x1eacae['as'],'attributes':_0x1eacae[_0x4988('0x1d')],'include':_0x1eacae[_0x4988('0x1f')]?_['map'](_0x1eacae[_0x4988('0x1f')],function(_0x4884f5){return{'model':db[_0x4884f5['model']],'as':_0x4884f5['as'],'attributes':_0x4884f5[_0x4988('0x1d')],'include':_0x4884f5[_0x4988('0x1f')]?_[_0x4988('0x21')](_0x4884f5[_0x4988('0x1f')],function(_0x17862c){return{'model':db[_0x17862c[_0x4988('0x20')]],'as':_0x17862c['as'],'attributes':_0x17862c['attributes']};}):[]};}):[]};}):[]:[]})[_0x4988('0x10')](function(_0x4e1576){logger[_0x4988('0x11')](_0x4988('0x18'),_0x38daa0);logger[_0x4988('0x22')]('GetVoiceQueueReport',_0x38daa0,JSON[_0x4988('0x23')](_0x4e1576));_0x4fd1da(_0x4e1576);})['catch'](function(_0x3e9752){logger['error'](_0x4988('0x18'),_0x3e9752['message'],_0x38daa0);_0x580bf3(_0x606488['error'](0x1f4,_0x3e9752[_0x4988('0x17')]));});});};exports[_0x4988('0x24')]=function(_0x566b96){var _0x1d5db8=this;return new Promise(function(_0x3b087d,_0x415f05){return db[_0x4988('0x25')][_0x4988('0x26')](_0x566b96[_0x4988('0x27')],{'raw':_0x566b96[_0x4988('0x1a')]?_0x566b96[_0x4988('0x1a')][_0x4988('0x1b')]===undefined?!![]:![]:!![]})[_0x4988('0x10')](function(_0x3f7519){logger[_0x4988('0x11')](_0x4988('0x24'),_0x566b96);logger[_0x4988('0x22')](_0x4988('0x24'),_0x566b96,JSON[_0x4988('0x23')](_0x3f7519));_0x3b087d(_0x3f7519);})[_0x4988('0x28')](function(_0x212ab6){logger['error'](_0x4988('0x24'),_0x212ab6['message'],_0x566b96);_0x415f05(_0x1d5db8['error'](0x1f4,_0x212ab6[_0x4988('0x17')]));});});};exports[_0x4988('0x29')]=function(_0x6c3dfb){var _0x18b2ef=this;return new Promise(function(_0x35360f,_0x2f56dc){return db[_0x4988('0x25')]['update'](_0x6c3dfb['body'],{'raw':_0x6c3dfb[_0x4988('0x1a')]?_0x6c3dfb[_0x4988('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6c3dfb['options']?_0x6c3dfb[_0x4988('0x1a')][_0x4988('0x1c')]||null:null,'attributes':_0x6c3dfb['options']?_0x6c3dfb[_0x4988('0x1a')][_0x4988('0x1d')]||null:null,'limit':_0x6c3dfb[_0x4988('0x1a')]?_0x6c3dfb[_0x4988('0x1a')]['limit']||null:null})[_0x4988('0x10')](function(_0x3fc3e0){logger['info'](_0x4988('0x29'),_0x6c3dfb);logger['debug']('UpdateVoiceQueueReport',_0x6c3dfb,JSON[_0x4988('0x23')](_0x3fc3e0));_0x35360f(_0x3fc3e0);})[_0x4988('0x28')](function(_0x1552dc){logger[_0x4988('0x15')](_0x4988('0x29'),_0x1552dc[_0x4988('0x17')],_0x6c3dfb);_0x2f56dc(_0x18b2ef[_0x4988('0x15')](0x1f4,_0x1552dc['message']));});});}; \ No newline at end of file +var _0x9dfc=['body','UpdateVoiceQueueReport','update','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','CreateVoiceQueueReport','create'];(function(_0x4459b8,_0x3271b8){var _0x4a4b07=function(_0x3075f8){while(--_0x3075f8){_0x4459b8['push'](_0x4459b8['shift']());}};_0x4a4b07(++_0x3271b8);}(_0x9dfc,0xda));var _0xc9df=function(_0x1ae6f8,_0x29a90b){_0x1ae6f8=_0x1ae6f8-0x0;var _0x2bff39=_0x9dfc[_0x1ae6f8];return _0x2bff39;};'use strict';var _=require(_0xc9df('0x0'));var util=require(_0xc9df('0x1'));var moment=require(_0xc9df('0x2'));var BPromise=require('bluebird');var rs=require(_0xc9df('0x3'));var fs=require('fs');var Redis=require(_0xc9df('0x4'));var db=require(_0xc9df('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc9df('0x6'));var config=require(_0xc9df('0x7'));var jayson=require(_0xc9df('0x8'));var client=jayson[_0xc9df('0x9')][_0xc9df('0xa')]({'port':0x232a});config[_0xc9df('0xb')]=_['defaults'](config[_0xc9df('0xb')],{'host':_0xc9df('0xc'),'port':0x18eb});var socket=require(_0xc9df('0xd'))(new Redis(config['redis']));require(_0xc9df('0xe'))['register'](socket);function respondWithRpcPromise(_0x16603f,_0x181324,_0x496e5b){return new BPromise(function(_0x1fab74,_0x4445ec){return client[_0xc9df('0xf')](_0x16603f,_0x496e5b)[_0xc9df('0x10')](function(_0x3e3c66){logger['info'](_0xc9df('0x11'),_0x181324,'request\x20sent');logger[_0xc9df('0x12')](_0xc9df('0x13'),_0x181324,_0xc9df('0x14'),JSON[_0xc9df('0x15')](_0x3e3c66));if(_0x3e3c66['error']){if(_0x3e3c66[_0xc9df('0x16')][_0xc9df('0x17')]===0x1f4){logger[_0xc9df('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x181324,_0x3e3c66[_0xc9df('0x16')][_0xc9df('0x18')]);return _0x4445ec(_0x3e3c66['error'][_0xc9df('0x18')]);}logger[_0xc9df('0x16')](_0xc9df('0x11'),_0x181324,_0x3e3c66[_0xc9df('0x16')]['message']);return _0x1fab74(_0x3e3c66['error'][_0xc9df('0x18')]);}else{logger[_0xc9df('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x181324,'request\x20sent');_0x1fab74(_0x3e3c66[_0xc9df('0x1a')][_0xc9df('0x18')]);}})[_0xc9df('0x1b')](function(_0x13ed1c){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x181324,_0x13ed1c);_0x4445ec(_0x13ed1c);});});}exports[_0xc9df('0x1c')]=function(_0x22226e){var _0x3c50a2=this;return new Promise(function(_0x19e1c4,_0x4694f8){return db[_0xc9df('0x1d')][_0xc9df('0x1e')]({'raw':_0x22226e[_0xc9df('0x1f')]?_0x22226e['options'][_0xc9df('0x20')]===undefined?!![]:![]:!![],'where':_0x22226e[_0xc9df('0x1f')]?_0x22226e[_0xc9df('0x1f')][_0xc9df('0x21')]||null:null,'attributes':_0x22226e['options']?_0x22226e['options'][_0xc9df('0x22')]||null:null,'limit':_0x22226e[_0xc9df('0x1f')]?_0x22226e[_0xc9df('0x1f')]['limit']||null:null,'include':_0x22226e[_0xc9df('0x1f')]?_0x22226e[_0xc9df('0x1f')][_0xc9df('0x23')]?_[_0xc9df('0x24')](_0x22226e[_0xc9df('0x1f')][_0xc9df('0x23')],function(_0xcb843d){return{'model':db[_0xcb843d[_0xc9df('0x25')]],'as':_0xcb843d['as'],'attributes':_0xcb843d[_0xc9df('0x22')],'include':_0xcb843d[_0xc9df('0x23')]?_['map'](_0xcb843d[_0xc9df('0x23')],function(_0x24f95c){return{'model':db[_0x24f95c[_0xc9df('0x25')]],'as':_0x24f95c['as'],'attributes':_0x24f95c['attributes'],'include':_0x24f95c[_0xc9df('0x23')]?_['map'](_0x24f95c[_0xc9df('0x23')],function(_0x408b70){return{'model':db[_0x408b70['model']],'as':_0x408b70['as'],'attributes':_0x408b70[_0xc9df('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc9df('0x10')](function(_0x50b924){logger[_0xc9df('0x19')](_0xc9df('0x1c'),_0x22226e);logger[_0xc9df('0x12')](_0xc9df('0x1c'),_0x22226e,JSON['stringify'](_0x50b924));_0x19e1c4(_0x50b924);})['catch'](function(_0x23ab1b){logger['error']('GetVoiceQueueReport',_0x23ab1b[_0xc9df('0x18')],_0x22226e);_0x4694f8(_0x3c50a2[_0xc9df('0x16')](0x1f4,_0x23ab1b[_0xc9df('0x18')]));});});};exports[_0xc9df('0x26')]=function(_0xb7edd3){var _0x186776=this;return new Promise(function(_0x15b05c,_0x5cee12){return db[_0xc9df('0x1d')][_0xc9df('0x27')](_0xb7edd3[_0xc9df('0x28')],{'raw':_0xb7edd3[_0xc9df('0x1f')]?_0xb7edd3[_0xc9df('0x1f')][_0xc9df('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2f675b){logger[_0xc9df('0x19')](_0xc9df('0x26'),_0xb7edd3);logger[_0xc9df('0x12')]('CreateVoiceQueueReport',_0xb7edd3,JSON['stringify'](_0x2f675b));_0x15b05c(_0x2f675b);})[_0xc9df('0x1b')](function(_0xab1c37){logger['error'](_0xc9df('0x26'),_0xab1c37[_0xc9df('0x18')],_0xb7edd3);_0x5cee12(_0x186776[_0xc9df('0x16')](0x1f4,_0xab1c37['message']));});});};exports[_0xc9df('0x29')]=function(_0x3b20d0){var _0x57def3=this;return new Promise(function(_0x118fbf,_0x2b7e25){return db[_0xc9df('0x1d')][_0xc9df('0x2a')](_0x3b20d0[_0xc9df('0x28')],{'raw':_0x3b20d0[_0xc9df('0x1f')]?_0x3b20d0[_0xc9df('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b20d0[_0xc9df('0x1f')]?_0x3b20d0[_0xc9df('0x1f')][_0xc9df('0x21')]||null:null,'attributes':_0x3b20d0[_0xc9df('0x1f')]?_0x3b20d0[_0xc9df('0x1f')][_0xc9df('0x22')]||null:null,'limit':_0x3b20d0['options']?_0x3b20d0['options']['limit']||null:null})[_0xc9df('0x10')](function(_0x18c53d){logger[_0xc9df('0x19')]('UpdateVoiceQueueReport',_0x3b20d0);logger[_0xc9df('0x12')](_0xc9df('0x29'),_0x3b20d0,JSON[_0xc9df('0x15')](_0x18c53d));_0x118fbf(_0x18c53d);})[_0xc9df('0x1b')](function(_0x5c6713){logger[_0xc9df('0x16')](_0xc9df('0x29'),_0x5c6713[_0xc9df('0x18')],_0x3b20d0);_0x2b7e25(_0x57def3['error'](0x1f4,_0x5c6713[_0xc9df('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 3e9f4e4..b51a360 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 _0x96f1=['emit','removeListener','register','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0x4a208f,_0x565d7f){var _0xeb0072=function(_0x5f1a72){while(--_0x5f1a72){_0x4a208f['push'](_0x4a208f['shift']());}};_0xeb0072(++_0x565d7f);}(_0x96f1,0x19c));var _0x196f=function(_0x1d173c,_0x45b9b7){_0x1d173c=_0x1d173c-0x0;var _0x33a0a1=_0x96f1[_0x1d173c];return _0x33a0a1;};'use strict';var VoiceQueueReportEvents=require(_0x196f('0x0'));var events=[_0x196f('0x1'),_0x196f('0x2'),_0x196f('0x3')];function createListener(_0x227254,_0x219e87){return function(_0xe61e26){_0x219e87[_0x196f('0x4')](_0x227254,_0xe61e26);};}function removeListener(_0x5b8eb5,_0x56fc61){return function(){VoiceQueueReportEvents[_0x196f('0x5')](_0x5b8eb5,_0x56fc61);};}exports[_0x196f('0x6')]=function(_0x267906){for(var _0x1f401c=0x0,_0x17f603=events['length'];_0x1f401c<_0x17f603;_0x1f401c++){var _0x427333=events[_0x1f401c];var _0x425e5c=createListener(_0x196f('0x7')+_0x427333,_0x267906);VoiceQueueReportEvents['on'](_0x427333,_0x425e5c);}}; \ No newline at end of file +var _0xa2d7=['length','./voiceQueueReport.events','save','remove','emit','removeListener','register'];(function(_0x324012,_0x23f45f){var _0x435cf2=function(_0x378a82){while(--_0x378a82){_0x324012['push'](_0x324012['shift']());}};_0x435cf2(++_0x23f45f);}(_0xa2d7,0x1ba));var _0x7a2d=function(_0x7c1523,_0x2aac09){_0x7c1523=_0x7c1523-0x0;var _0x4e7026=_0xa2d7[_0x7c1523];return _0x4e7026;};'use strict';var VoiceQueueReportEvents=require(_0x7a2d('0x0'));var events=[_0x7a2d('0x1'),_0x7a2d('0x2'),'update'];function createListener(_0x55e1aa,_0x38b15d){return function(_0x28a5ab){_0x38b15d[_0x7a2d('0x3')](_0x55e1aa,_0x28a5ab);};}function removeListener(_0x1f517d,_0x57b3fd){return function(){VoiceQueueReportEvents[_0x7a2d('0x4')](_0x1f517d,_0x57b3fd);};}exports[_0x7a2d('0x5')]=function(_0x33e10e){for(var _0x114a51=0x0,_0x5c5c77=events[_0x7a2d('0x6')];_0x114a51<_0x5c5c77;_0x114a51++){var _0x2dfdc9=events[_0x114a51];var _0x3889a2=createListener('voiceQueueReport:'+_0x2dfdc9,_0x33e10e);VoiceQueueReportEvents['on'](_0x2dfdc9,_0x3889a2);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index cc00e71..5bd7c5d 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 _0x5119=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','isAuthenticated','show','post','create','put','delete','/:id','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2547f7,_0x19d480){var _0x1bc01e=function(_0x15aff3){while(--_0x15aff3){_0x2547f7['push'](_0x2547f7['shift']());}};_0x1bc01e(++_0x19d480);}(_0x5119,0xc0));var _0x9511=function(_0x58ae9f,_0xcaa7d7){_0x58ae9f=_0x58ae9f-0x0;var _0x4c966d=_0x5119[_0x58ae9f];return _0x4c966d;};'use strict';var multer=require(_0x9511('0x0'));var util=require('util');var path=require(_0x9511('0x1'));var timeout=require(_0x9511('0x2'));var express=require(_0x9511('0x3'));var router=express[_0x9511('0x4')]();var fs_extra=require(_0x9511('0x5'));var auth=require(_0x9511('0x6'));var interaction=require(_0x9511('0x7'));var config=require(_0x9511('0x8'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9511('0x9')]);router['get']('/:id',auth[_0x9511('0xa')](),controller[_0x9511('0xb')]);router[_0x9511('0xc')]('/',auth[_0x9511('0xa')](),controller[_0x9511('0xd')]);router[_0x9511('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9511('0xf')](_0x9511('0x10'),auth[_0x9511('0xa')](),controller['destroy']);module[_0x9511('0x11')]=router; \ No newline at end of file +var _0xdff8=['update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','put'];(function(_0x329dd0,_0x47e04f){var _0x4f5b90=function(_0x7d2728){while(--_0x7d2728){_0x329dd0['push'](_0x329dd0['shift']());}};_0x4f5b90(++_0x47e04f);}(_0xdff8,0x159));var _0x8dff=function(_0x2e81c9,_0x15a07c){_0x2e81c9=_0x2e81c9-0x0;var _0x217cf2=_0xdff8[_0x2e81c9];return _0x217cf2;};'use strict';var multer=require(_0x8dff('0x0'));var util=require(_0x8dff('0x1'));var path=require(_0x8dff('0x2'));var timeout=require(_0x8dff('0x3'));var express=require(_0x8dff('0x4'));var router=express['Router']();var fs_extra=require(_0x8dff('0x5'));var auth=require(_0x8dff('0x6'));var interaction=require(_0x8dff('0x7'));var config=require(_0x8dff('0x8'));var controller=require(_0x8dff('0x9'));router[_0x8dff('0xa')]('/',auth[_0x8dff('0xb')](),controller[_0x8dff('0xc')]);router[_0x8dff('0xa')](_0x8dff('0xd'),auth[_0x8dff('0xb')](),controller[_0x8dff('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8dff('0xf')](_0x8dff('0xd'),auth['isAuthenticated'](),controller[_0x8dff('0x10')]);router['delete'](_0x8dff('0xd'),auth[_0x8dff('0xb')](),controller[_0x8dff('0x11')]);module[_0x8dff('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 23a39ef..38cb745 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 _0x9b31=['STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x9b31,0x1d2));var _0x19b3=function(_0x3bcc1e,_0x427914){_0x3bcc1e=_0x3bcc1e-0x0;var _0x126b10=_0x9b31[_0x3bcc1e];return _0x126b10;};'use strict';var Sequelize=require(_0x19b3('0x0'));var moment=require(_0x19b3('0x1'));module[_0x19b3('0x2')]={'time':{'type':Sequelize[_0x19b3('0x3')]},'callid':{'type':Sequelize[_0x19b3('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x19b3('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x19b3('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x19b3('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x19b3('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x19b3('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x19b3('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x19b3('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x19b3('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x19b3('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x19b3('0x5')](_0x19b3('0x6'))}}; \ No newline at end of file +var _0x4775=['STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports'];(function(_0x475450,_0x13844b){var _0x29c425=function(_0x9188e6){while(--_0x9188e6){_0x475450['push'](_0x475450['shift']());}};_0x29c425(++_0x13844b);}(_0x4775,0x170));var _0x5477=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x4775[_0x616290];return _0x453879;};'use strict';var Sequelize=require(_0x5477('0x0'));var moment=require(_0x5477('0x1'));module[_0x5477('0x2')]={'time':{'type':Sequelize[_0x5477('0x3')]},'callid':{'type':Sequelize[_0x5477('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x5477('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x5477('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x5477('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5477('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x5477('0x5')](_0x5477('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index e9e6384..1f0370e 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 _0x4f8c=['lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f8c,0x1b7));var _0xc4f8=function(_0x396736,_0x10da9b){_0x396736=_0x396736-0x0;var _0x2b0960=_0x4f8c[_0x396736];return _0x2b0960;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc4f8('0x0'));var zipdir=require(_0xc4f8('0x1'));var jsonpatch=require(_0xc4f8('0x2'));var rp=require(_0xc4f8('0x3'));var moment=require(_0xc4f8('0x4'));var BPromise=require(_0xc4f8('0x5'));var Mustache=require(_0xc4f8('0x6'));var util=require(_0xc4f8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc4f8('0x8'));var ejs=require(_0xc4f8('0x9'));var fs=require('fs');var fs_extra=require(_0xc4f8('0xa'));var _=require(_0xc4f8('0xb'));var squel=require(_0xc4f8('0xc'));var crypto=require(_0xc4f8('0xd'));var jsforce=require(_0xc4f8('0xe'));var deskjs=require(_0xc4f8('0xf'));var toCsv=require(_0xc4f8('0x8'));var querystring=require('querystring');var Papa=require(_0xc4f8('0x10'));var Redis=require('ioredis');var authService=require(_0xc4f8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc4f8('0x12'));var hardwareService=require(_0xc4f8('0x13'));var logger=require(_0xc4f8('0x14'))(_0xc4f8('0x15'));var utils=require(_0xc4f8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc4f8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x226611,_0x160dc0){_0x160dc0=_0x160dc0||0xcc;return function(_0x44a993){if(_0x44a993){return _0x226611[_0xc4f8('0x18')](_0x160dc0);}return _0x226611[_0xc4f8('0x19')](_0x160dc0)[_0xc4f8('0x1a')]();};}function respondWithResult(_0x48e1be,_0x1d0dbe){_0x1d0dbe=_0x1d0dbe||0xc8;return function(_0x3aa69d){if(_0x3aa69d){return _0x48e1be[_0xc4f8('0x19')](_0x1d0dbe)['json'](_0x3aa69d);}};}function respondWithFilteredResult(_0x2e1656,_0x424f2f){return function(_0x48f3c3){if(_0x48f3c3){var _0x226a68=typeof _0x424f2f[_0xc4f8('0x1b')]===_0xc4f8('0x1c')&&typeof _0x424f2f[_0xc4f8('0x1d')]===_0xc4f8('0x1c');var _0x2419c2=_0x48f3c3[_0xc4f8('0x1e')];var _0x28227c=_0x226a68?0x0:_0x424f2f[_0xc4f8('0x1b')];var _0x51b6ef=_0x226a68?_0x48f3c3['count']:_0x424f2f[_0xc4f8('0x1b')]+_0x424f2f[_0xc4f8('0x1d')];var _0x134985;if(_0x51b6ef>=_0x2419c2){_0x51b6ef=_0x2419c2;_0x134985=0xc8;}else{_0x134985=0xce;}_0x2e1656[_0xc4f8('0x19')](_0x134985);return _0x2e1656[_0xc4f8('0x1f')](_0xc4f8('0x20'),_0x28227c+'-'+_0x51b6ef+'/'+_0x2419c2)[_0xc4f8('0x21')](_0x48f3c3);}return null;};}function patchUpdates(_0x3e2aef){return function(_0x4e07ff){try{jsonpatch[_0xc4f8('0x22')](_0x4e07ff,_0x3e2aef,!![]);}catch(_0x251ebf){return BPromise[_0xc4f8('0x23')](_0x251ebf);}return _0x4e07ff['save']();};}function saveUpdates(_0xe45b84,_0x31b147){return function(_0x53a4a9){if(_0x53a4a9){return _0x53a4a9[_0xc4f8('0x24')](_0xe45b84)['then'](function(_0x19c5e4){return _0x19c5e4;});}return null;};}function removeEntity(_0x21b06a,_0x22b4bb){return function(_0x56d72b){if(_0x56d72b){return _0x56d72b[_0xc4f8('0x25')]()[_0xc4f8('0x26')](function(){_0x21b06a[_0xc4f8('0x19')](0xcc)[_0xc4f8('0x1a')]();});}};}function handleEntityNotFound(_0x3b071d,_0x4ca0c2){return function(_0x3ada2e){if(!_0x3ada2e){_0x3b071d['sendStatus'](0x194);}return _0x3ada2e;};}function handleError(_0x3fb92b,_0x52754d){_0x52754d=_0x52754d||0x1f4;return function(_0x4e3356){logger[_0xc4f8('0x27')](_0x4e3356[_0xc4f8('0x28')]);if(_0x4e3356['name']){delete _0x4e3356[_0xc4f8('0x29')];}_0x3fb92b[_0xc4f8('0x19')](_0x52754d)[_0xc4f8('0x2a')](_0x4e3356);};}exports[_0xc4f8('0x2b')]=function(_0x199fee,_0x269db1){var _0x234c30={},_0x313445={},_0x3a9a43={'count':0x0,'rows':[]};var _0x260f80=_['map'](db[_0xc4f8('0x2c')][_0xc4f8('0x2d')],function(_0x3f9ad5){return{'name':_0x3f9ad5[_0xc4f8('0x2e')],'type':_0x3f9ad5['type']['key']};});_0x313445[_0xc4f8('0x2f')]=_[_0xc4f8('0x30')](_0x260f80,_0xc4f8('0x29'));_0x313445[_0xc4f8('0x31')]=_[_0xc4f8('0x32')](_0x199fee[_0xc4f8('0x31')]);_0x313445[_0xc4f8('0x33')]=_['intersection'](_0x313445[_0xc4f8('0x2f')],_0x313445[_0xc4f8('0x31')]);_0x234c30[_0xc4f8('0x34')]=_[_0xc4f8('0x35')](_0x313445[_0xc4f8('0x2f')],qs[_0xc4f8('0x36')](_0x199fee[_0xc4f8('0x31')][_0xc4f8('0x36')]));_0x234c30[_0xc4f8('0x34')]=_0x234c30[_0xc4f8('0x34')][_0xc4f8('0x37')]?_0x234c30[_0xc4f8('0x34')]:_0x313445[_0xc4f8('0x2f')];if(!_0x199fee[_0xc4f8('0x31')][_0xc4f8('0x38')](_0xc4f8('0x39'))){_0x234c30['limit']=qs['limit'](_0x199fee[_0xc4f8('0x31')][_0xc4f8('0x1d')]);_0x234c30['offset']=qs[_0xc4f8('0x1b')](_0x199fee[_0xc4f8('0x31')][_0xc4f8('0x1b')]);}_0x234c30['order']=qs[_0xc4f8('0x3a')](_0x199fee[_0xc4f8('0x31')]['sort']);_0x234c30[_0xc4f8('0x3b')]=qs['filters'](_['pick'](_0x199fee['query'],_0x313445[_0xc4f8('0x33')]),_0x260f80);if(_0x199fee[_0xc4f8('0x31')][_0xc4f8('0x3c')]){_0x234c30[_0xc4f8('0x3b')]=_[_0xc4f8('0x3d')](_0x234c30['where'],{'$or':_['map'](_0x260f80,function(_0x170714){if(_0x170714[_0xc4f8('0x3e')]!==_0xc4f8('0x3f')){var _0x41ff7e={};_0x41ff7e[_0x170714[_0xc4f8('0x29')]]={'$like':'%'+_0x199fee[_0xc4f8('0x31')][_0xc4f8('0x3c')]+'%'};return _0x41ff7e;}})});}_0x234c30=_['merge']({},_0x234c30,_0x199fee[_0xc4f8('0x40')]);var _0x3ca4b1={'where':_0x234c30[_0xc4f8('0x3b')]};return db[_0xc4f8('0x2c')][_0xc4f8('0x1e')](_0x3ca4b1)['then'](function(_0x2dd006){_0x3a9a43[_0xc4f8('0x1e')]=_0x2dd006;if(_0x199fee[_0xc4f8('0x31')][_0xc4f8('0x41')]){_0x234c30[_0xc4f8('0x42')]=[{'all':!![]}];}return db[_0xc4f8('0x2c')][_0xc4f8('0x43')](_0x234c30);})[_0xc4f8('0x26')](function(_0x1a7631){_0x3a9a43[_0xc4f8('0x44')]=_0x1a7631;return _0x3a9a43;})['then'](respondWithFilteredResult(_0x269db1,_0x234c30))[_0xc4f8('0x45')](handleError(_0x269db1,null));};exports[_0xc4f8('0x46')]=function(_0x1d4d5d,_0x4c7be3){var _0x10a03e={'raw':!![],'where':{'id':_0x1d4d5d[_0xc4f8('0x47')]['id']}},_0x1e5d1d={};_0x1e5d1d['model']=_['keys'](db['VoiceQueuesLog']['rawAttributes']);_0x1e5d1d[_0xc4f8('0x31')]=_[_0xc4f8('0x32')](_0x1d4d5d[_0xc4f8('0x31')]);_0x1e5d1d[_0xc4f8('0x33')]=_['intersection'](_0x1e5d1d['model'],_0x1e5d1d[_0xc4f8('0x31')]);_0x10a03e[_0xc4f8('0x34')]=_[_0xc4f8('0x35')](_0x1e5d1d[_0xc4f8('0x2f')],qs['fields'](_0x1d4d5d['query'][_0xc4f8('0x36')]));_0x10a03e[_0xc4f8('0x34')]=_0x10a03e[_0xc4f8('0x34')][_0xc4f8('0x37')]?_0x10a03e['attributes']:_0x1e5d1d[_0xc4f8('0x2f')];if(_0x1d4d5d[_0xc4f8('0x31')]['includeAll']){_0x10a03e[_0xc4f8('0x42')]=[{'all':!![]}];}_0x10a03e=_[_0xc4f8('0x3d')]({},_0x10a03e,_0x1d4d5d[_0xc4f8('0x40')]);return db[_0xc4f8('0x2c')][_0xc4f8('0x48')](_0x10a03e)[_0xc4f8('0x26')](handleEntityNotFound(_0x4c7be3,null))[_0xc4f8('0x26')](respondWithResult(_0x4c7be3,null))[_0xc4f8('0x45')](handleError(_0x4c7be3,null));};exports[_0xc4f8('0x49')]=function(_0x17e68d,_0x10c51c){return db['VoiceQueuesLog'][_0xc4f8('0x49')](_0x17e68d['body'],{})['then'](respondWithResult(_0x10c51c,0xc9))[_0xc4f8('0x45')](handleError(_0x10c51c,null));};exports[_0xc4f8('0x24')]=function(_0x52e471,_0xe41aa2){if(_0x52e471[_0xc4f8('0x4a')]['id']){delete _0x52e471[_0xc4f8('0x4a')]['id'];}return db['VoiceQueuesLog'][_0xc4f8('0x48')]({'where':{'id':_0x52e471['params']['id']}})['then'](handleEntityNotFound(_0xe41aa2,null))[_0xc4f8('0x26')](saveUpdates(_0x52e471['body'],null))[_0xc4f8('0x26')](respondWithResult(_0xe41aa2,null))[_0xc4f8('0x45')](handleError(_0xe41aa2,null));};exports[_0xc4f8('0x25')]=function(_0x8a3947,_0x2b89cc){return db[_0xc4f8('0x2c')][_0xc4f8('0x48')]({'where':{'id':_0x8a3947['params']['id']}})[_0xc4f8('0x26')](handleEntityNotFound(_0x2b89cc,null))[_0xc4f8('0x26')](removeEntity(_0x2b89cc,null))[_0xc4f8('0x45')](handleError(_0x2b89cc,null));}; \ No newline at end of file +var _0x9b2e=['undefined','limit','count','set','Content-Range','apply','save','destroy','then','error','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','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','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x650e61,_0x40055a){var _0x288cfa=function(_0x29c403){while(--_0x29c403){_0x650e61['push'](_0x650e61['shift']());}};_0x288cfa(++_0x40055a);}(_0x9b2e,0xc9));var _0xe9b2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9b2e[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xe9b2('0x0'));var rimraf=require(_0xe9b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9b2('0x2'));var rp=require(_0xe9b2('0x3'));var moment=require(_0xe9b2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe9b2('0x5'));var util=require(_0xe9b2('0x6'));var path=require(_0xe9b2('0x7'));var sox=require(_0xe9b2('0x8'));var csv=require(_0xe9b2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9b2('0xa'));var _=require(_0xe9b2('0xb'));var squel=require('squel');var crypto=require(_0xe9b2('0xc'));var jsforce=require(_0xe9b2('0xd'));var deskjs=require(_0xe9b2('0xe'));var toCsv=require(_0xe9b2('0x9'));var querystring=require(_0xe9b2('0xf'));var Papa=require(_0xe9b2('0x10'));var Redis=require(_0xe9b2('0x11'));var authService=require(_0xe9b2('0x12'));var qs=require(_0xe9b2('0x13'));var as=require(_0xe9b2('0x14'));var hardwareService=require(_0xe9b2('0x15'));var logger=require(_0xe9b2('0x16'))(_0xe9b2('0x17'));var utils=require(_0xe9b2('0x18'));var config=require(_0xe9b2('0x19'));var licenseUtil=require(_0xe9b2('0x1a'));var db=require(_0xe9b2('0x1b'))['db'];function respondWithStatusCode(_0x1c1548,_0x5b1644){_0x5b1644=_0x5b1644||0xcc;return function(_0x17cd3c){if(_0x17cd3c){return _0x1c1548[_0xe9b2('0x1c')](_0x5b1644);}return _0x1c1548[_0xe9b2('0x1d')](_0x5b1644)[_0xe9b2('0x1e')]();};}function respondWithResult(_0x2132fd,_0x5d6af9){_0x5d6af9=_0x5d6af9||0xc8;return function(_0x2b2d9a){if(_0x2b2d9a){return _0x2132fd['status'](_0x5d6af9)[_0xe9b2('0x1f')](_0x2b2d9a);}};}function respondWithFilteredResult(_0x3769b1,_0x36c60f){return function(_0x3b3f70){if(_0x3b3f70){var _0x4a1c36=typeof _0x36c60f[_0xe9b2('0x20')]===_0xe9b2('0x21')&&typeof _0x36c60f[_0xe9b2('0x22')]===_0xe9b2('0x21');var _0x275e84=_0x3b3f70[_0xe9b2('0x23')];var _0x2aa0bc=_0x4a1c36?0x0:_0x36c60f[_0xe9b2('0x20')];var _0x148778=_0x4a1c36?_0x3b3f70[_0xe9b2('0x23')]:_0x36c60f[_0xe9b2('0x20')]+_0x36c60f[_0xe9b2('0x22')];var _0x27a6ee;if(_0x148778>=_0x275e84){_0x148778=_0x275e84;_0x27a6ee=0xc8;}else{_0x27a6ee=0xce;}_0x3769b1[_0xe9b2('0x1d')](_0x27a6ee);return _0x3769b1[_0xe9b2('0x24')](_0xe9b2('0x25'),_0x2aa0bc+'-'+_0x148778+'/'+_0x275e84)['json'](_0x3b3f70);}return null;};}function patchUpdates(_0x299b00){return function(_0x4e9093){try{jsonpatch[_0xe9b2('0x26')](_0x4e9093,_0x299b00,!![]);}catch(_0x39c937){return BPromise['reject'](_0x39c937);}return _0x4e9093[_0xe9b2('0x27')]();};}function saveUpdates(_0x442fa4,_0x497af6){return function(_0x48decb){if(_0x48decb){return _0x48decb['update'](_0x442fa4)['then'](function(_0x112c22){return _0x112c22;});}return null;};}function removeEntity(_0x1ab5c5,_0x45e8f9){return function(_0x5b0862){if(_0x5b0862){return _0x5b0862[_0xe9b2('0x28')]()[_0xe9b2('0x29')](function(){_0x1ab5c5[_0xe9b2('0x1d')](0xcc)[_0xe9b2('0x1e')]();});}};}function handleEntityNotFound(_0x1437fe,_0x4c9b35){return function(_0x44324b){if(!_0x44324b){_0x1437fe[_0xe9b2('0x1c')](0x194);}return _0x44324b;};}function handleError(_0x2febe8,_0x2e6299){_0x2e6299=_0x2e6299||0x1f4;return function(_0x4c93e0){logger[_0xe9b2('0x2a')](_0x4c93e0['stack']);if(_0x4c93e0['name']){delete _0x4c93e0[_0xe9b2('0x2b')];}_0x2febe8[_0xe9b2('0x1d')](_0x2e6299)[_0xe9b2('0x2c')](_0x4c93e0);};}exports['index']=function(_0xde4ff9,_0x3f946d){var _0x1bbe39={},_0x2545a5={},_0x180144={'count':0x0,'rows':[]};var _0x3d0091=_[_0xe9b2('0x2d')](db[_0xe9b2('0x2e')][_0xe9b2('0x2f')],function(_0x35100c){return{'name':_0x35100c[_0xe9b2('0x30')],'type':_0x35100c[_0xe9b2('0x31')][_0xe9b2('0x32')]};});_0x2545a5[_0xe9b2('0x33')]=_[_0xe9b2('0x2d')](_0x3d0091,_0xe9b2('0x2b'));_0x2545a5[_0xe9b2('0x34')]=_[_0xe9b2('0x35')](_0xde4ff9['query']);_0x2545a5[_0xe9b2('0x36')]=_[_0xe9b2('0x37')](_0x2545a5['model'],_0x2545a5[_0xe9b2('0x34')]);_0x1bbe39[_0xe9b2('0x38')]=_[_0xe9b2('0x37')](_0x2545a5[_0xe9b2('0x33')],qs[_0xe9b2('0x39')](_0xde4ff9['query'][_0xe9b2('0x39')]));_0x1bbe39[_0xe9b2('0x38')]=_0x1bbe39['attributes']['length']?_0x1bbe39[_0xe9b2('0x38')]:_0x2545a5[_0xe9b2('0x33')];if(!_0xde4ff9['query'][_0xe9b2('0x3a')](_0xe9b2('0x3b'))){_0x1bbe39[_0xe9b2('0x22')]=qs['limit'](_0xde4ff9[_0xe9b2('0x34')]['limit']);_0x1bbe39[_0xe9b2('0x20')]=qs['offset'](_0xde4ff9[_0xe9b2('0x34')]['offset']);}_0x1bbe39['order']=qs['sort'](_0xde4ff9[_0xe9b2('0x34')][_0xe9b2('0x3c')]);_0x1bbe39[_0xe9b2('0x3d')]=qs[_0xe9b2('0x36')](_[_0xe9b2('0x3e')](_0xde4ff9[_0xe9b2('0x34')],_0x2545a5['filters']),_0x3d0091);if(_0xde4ff9['query'][_0xe9b2('0x3f')]){_0x1bbe39[_0xe9b2('0x3d')]=_[_0xe9b2('0x40')](_0x1bbe39[_0xe9b2('0x3d')],{'$or':_[_0xe9b2('0x2d')](_0x3d0091,function(_0x1ecb9d){if(_0x1ecb9d[_0xe9b2('0x31')]!==_0xe9b2('0x41')){var _0x5351bf={};_0x5351bf[_0x1ecb9d[_0xe9b2('0x2b')]]={'$like':'%'+_0xde4ff9[_0xe9b2('0x34')][_0xe9b2('0x3f')]+'%'};return _0x5351bf;}})});}_0x1bbe39=_['merge']({},_0x1bbe39,_0xde4ff9[_0xe9b2('0x42')]);var _0x28c187={'where':_0x1bbe39[_0xe9b2('0x3d')]};return db[_0xe9b2('0x2e')][_0xe9b2('0x23')](_0x28c187)[_0xe9b2('0x29')](function(_0x2c0e71){_0x180144[_0xe9b2('0x23')]=_0x2c0e71;if(_0xde4ff9['query'][_0xe9b2('0x43')]){_0x1bbe39[_0xe9b2('0x44')]=[{'all':!![]}];}return db[_0xe9b2('0x2e')][_0xe9b2('0x45')](_0x1bbe39);})[_0xe9b2('0x29')](function(_0x31e0e3){_0x180144[_0xe9b2('0x46')]=_0x31e0e3;return _0x180144;})[_0xe9b2('0x29')](respondWithFilteredResult(_0x3f946d,_0x1bbe39))['catch'](handleError(_0x3f946d,null));};exports[_0xe9b2('0x47')]=function(_0xaef1ec,_0x4404ec){var _0x23e8ea={'raw':!![],'where':{'id':_0xaef1ec[_0xe9b2('0x48')]['id']}},_0x4bba0d={};_0x4bba0d[_0xe9b2('0x33')]=_['keys'](db[_0xe9b2('0x2e')][_0xe9b2('0x2f')]);_0x4bba0d[_0xe9b2('0x34')]=_[_0xe9b2('0x35')](_0xaef1ec[_0xe9b2('0x34')]);_0x4bba0d[_0xe9b2('0x36')]=_[_0xe9b2('0x37')](_0x4bba0d['model'],_0x4bba0d[_0xe9b2('0x34')]);_0x23e8ea[_0xe9b2('0x38')]=_['intersection'](_0x4bba0d[_0xe9b2('0x33')],qs[_0xe9b2('0x39')](_0xaef1ec[_0xe9b2('0x34')]['fields']));_0x23e8ea[_0xe9b2('0x38')]=_0x23e8ea[_0xe9b2('0x38')][_0xe9b2('0x49')]?_0x23e8ea['attributes']:_0x4bba0d[_0xe9b2('0x33')];if(_0xaef1ec['query'][_0xe9b2('0x43')]){_0x23e8ea['include']=[{'all':!![]}];}_0x23e8ea=_['merge']({},_0x23e8ea,_0xaef1ec[_0xe9b2('0x42')]);return db[_0xe9b2('0x2e')][_0xe9b2('0x4a')](_0x23e8ea)['then'](handleEntityNotFound(_0x4404ec,null))[_0xe9b2('0x29')](respondWithResult(_0x4404ec,null))[_0xe9b2('0x4b')](handleError(_0x4404ec,null));};exports[_0xe9b2('0x4c')]=function(_0x41a071,_0x244a46){return db['VoiceQueuesLog']['create'](_0x41a071['body'],{})['then'](respondWithResult(_0x244a46,0xc9))[_0xe9b2('0x4b')](handleError(_0x244a46,null));};exports['update']=function(_0x11235c,_0x560069){if(_0x11235c[_0xe9b2('0x4d')]['id']){delete _0x11235c[_0xe9b2('0x4d')]['id'];}return db[_0xe9b2('0x2e')][_0xe9b2('0x4a')]({'where':{'id':_0x11235c[_0xe9b2('0x48')]['id']}})['then'](handleEntityNotFound(_0x560069,null))[_0xe9b2('0x29')](saveUpdates(_0x11235c[_0xe9b2('0x4d')],null))[_0xe9b2('0x29')](respondWithResult(_0x560069,null))[_0xe9b2('0x4b')](handleError(_0x560069,null));};exports[_0xe9b2('0x28')]=function(_0x82c63b,_0x4e6ae3){return db[_0xe9b2('0x2e')][_0xe9b2('0x4a')]({'where':{'id':_0x82c63b['params']['id']}})[_0xe9b2('0x29')](handleEntityNotFound(_0x4e6ae3,null))[_0xe9b2('0x29')](removeEntity(_0x4e6ae3,null))['catch'](handleError(_0x4e6ae3,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 7e33589..e626c84 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 _0x9063=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','exports','event_dtm','event','dtm','lodash','util'];(function(_0x2192ae,_0x197b1e){var _0x5d8404=function(_0x11e731){while(--_0x11e731){_0x2192ae['push'](_0x2192ae['shift']());}};_0x5d8404(++_0x197b1e);}(_0x9063,0x1a2));var _0x3906=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x9063[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x3906('0x0'));var util=require(_0x3906('0x1'));var logger=require(_0x3906('0x2'))(_0x3906('0x3'));var moment=require(_0x3906('0x4'));var BPromise=require(_0x3906('0x5'));var rp=require(_0x3906('0x6'));var fs=require('fs');var path=require(_0x3906('0x7'));var rimraf=require('rimraf');var config=require(_0x3906('0x8'));var attributes=require(_0x3906('0x9'));module[_0x3906('0xa')]=function(_0x17c286,_0x79d5ae){return _0x17c286['define']('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x3906('0xb'),'fields':[_0x3906('0xc'),_0x3906('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x4ee3=['voice_queues_log','event_dtm','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./voiceQueuesLog.attributes','define'];(function(_0xc7bb50,_0x59965a){var _0x826f0c=function(_0x403338){while(--_0x403338){_0xc7bb50['push'](_0xc7bb50['shift']());}};_0x826f0c(++_0x59965a);}(_0x4ee3,0x120));var _0x34ee=function(_0x2e6dd3,_0x2365ce){_0x2e6dd3=_0x2e6dd3-0x0;var _0x54f4b1=_0x4ee3[_0x2e6dd3];return _0x54f4b1;};'use strict';var _=require(_0x34ee('0x0'));var util=require(_0x34ee('0x1'));var logger=require(_0x34ee('0x2'))('api');var moment=require(_0x34ee('0x3'));var BPromise=require(_0x34ee('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34ee('0x5'));var rimraf=require(_0x34ee('0x6'));var config=require('../../config/environment');var attributes=require(_0x34ee('0x7'));module['exports']=function(_0xd9ffb8,_0x12abdb){return _0xd9ffb8[_0x34ee('0x8')]('VoiceQueuesLog',attributes,{'tableName':_0x34ee('0x9'),'paranoid':![],'indexes':[{'name':_0x34ee('0xa'),'fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 35ef83c..998de60 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 _0x26bc=['VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x268a87,_0x3b8736){var _0xa8d093=function(_0x5f0fe9){while(--_0x5f0fe9){_0x268a87['push'](_0x268a87['shift']());}};_0xa8d093(++_0x3b8736);}(_0x26bc,0x162));var _0xc26b=function(_0x49f281,_0x2f106d){_0x49f281=_0x49f281-0x0;var _0x3318da=_0x26bc[_0x49f281];return _0x3318da;};'use strict';var _=require(_0xc26b('0x0'));var util=require(_0xc26b('0x1'));var moment=require(_0xc26b('0x2'));var BPromise=require(_0xc26b('0x3'));var rs=require(_0xc26b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc26b('0x5'))['db'];var utils=require(_0xc26b('0x6'));var logger=require(_0xc26b('0x7'))('rpc');var config=require(_0xc26b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc26b('0x9')][_0xc26b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13d90e,_0x5c2f6f,_0x11c6f5){return new BPromise(function(_0x453491,_0x465c89){return client[_0xc26b('0xb')](_0x13d90e,_0x11c6f5)[_0xc26b('0xc')](function(_0x1fb2b5){logger[_0xc26b('0xd')](_0xc26b('0xe'),_0x5c2f6f,_0xc26b('0xf'));logger[_0xc26b('0x10')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x5c2f6f,_0xc26b('0xf'),JSON[_0xc26b('0x11')](_0x1fb2b5));if(_0x1fb2b5[_0xc26b('0x12')]){if(_0x1fb2b5[_0xc26b('0x12')][_0xc26b('0x13')]===0x1f4){logger[_0xc26b('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5c2f6f,_0x1fb2b5[_0xc26b('0x12')]['message']);return _0x465c89(_0x1fb2b5['error'][_0xc26b('0x14')]);}logger[_0xc26b('0x12')](_0xc26b('0xe'),_0x5c2f6f,_0x1fb2b5[_0xc26b('0x12')]['message']);return _0x453491(_0x1fb2b5[_0xc26b('0x12')][_0xc26b('0x14')]);}else{logger[_0xc26b('0xd')](_0xc26b('0xe'),_0x5c2f6f,_0xc26b('0xf'));_0x453491(_0x1fb2b5[_0xc26b('0x15')]['message']);}})[_0xc26b('0x16')](function(_0x2713f6){logger['error'](_0xc26b('0xe'),_0x5c2f6f,_0x2713f6);_0x465c89(_0x2713f6);});});} \ No newline at end of file +var _0x6b06=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1c7db9,_0x204c7a){var _0x3add90=function(_0x1dd8b8){while(--_0x1dd8b8){_0x1c7db9['push'](_0x1c7db9['shift']());}};_0x3add90(++_0x204c7a);}(_0x6b06,0x143));var _0x66b0=function(_0x1d705c,_0x313c01){_0x1d705c=_0x1d705c-0x0;var _0x2485b1=_0x6b06[_0x1d705c];return _0x2485b1;};'use strict';var _=require(_0x66b0('0x0'));var util=require(_0x66b0('0x1'));var moment=require(_0x66b0('0x2'));var BPromise=require(_0x66b0('0x3'));var rs=require(_0x66b0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66b0('0x5'))['db'];var utils=require(_0x66b0('0x6'));var logger=require(_0x66b0('0x7'))(_0x66b0('0x8'));var config=require(_0x66b0('0x9'));var jayson=require(_0x66b0('0xa'));var client=jayson['client'][_0x66b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29c842,_0x3d2690,_0x52b2dc){return new BPromise(function(_0x4abb71,_0x1617c1){return client['request'](_0x29c842,_0x52b2dc)[_0x66b0('0xc')](function(_0x26c2fc){logger[_0x66b0('0xd')](_0x66b0('0xe'),_0x3d2690,_0x66b0('0xf'));logger[_0x66b0('0x10')](_0x66b0('0x11'),_0x3d2690,'request\x20sent',JSON[_0x66b0('0x12')](_0x26c2fc));if(_0x26c2fc[_0x66b0('0x13')]){if(_0x26c2fc[_0x66b0('0x13')][_0x66b0('0x14')]===0x1f4){logger['error'](_0x66b0('0xe'),_0x3d2690,_0x26c2fc['error'][_0x66b0('0x15')]);return _0x1617c1(_0x26c2fc[_0x66b0('0x13')][_0x66b0('0x15')]);}logger['error'](_0x66b0('0xe'),_0x3d2690,_0x26c2fc[_0x66b0('0x13')][_0x66b0('0x15')]);return _0x4abb71(_0x26c2fc[_0x66b0('0x13')][_0x66b0('0x15')]);}else{logger['info'](_0x66b0('0xe'),_0x3d2690,_0x66b0('0xf'));_0x4abb71(_0x26c2fc['result']['message']);}})['catch'](function(_0x441371){logger[_0x66b0('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3d2690,_0x441371);_0x1617c1(_0x441371);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index a44ae7d..b7c9641 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 _0x482d=['../../components/interaction/service','../../config/environment','./voiceRecording.controller','index','get','/describe','isAuthenticated','/:id','show','/:id/download','download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5db32d,_0x2849c6){var _0x2d4d9d=function(_0x50ff35){while(--_0x50ff35){_0x5db32d['push'](_0x5db32d['shift']());}};_0x2d4d9d(++_0x2849c6);}(_0x482d,0x1b4));var _0xd482=function(_0x416aea,_0x542d9c){_0x416aea=_0x416aea-0x0;var _0x2400b9=_0x482d[_0x416aea];return _0x2400b9;};'use strict';var multer=require('multer');var util=require(_0xd482('0x0'));var path=require(_0xd482('0x1'));var timeout=require('connect-timeout');var express=require(_0xd482('0x2'));var router=express[_0xd482('0x3')]();var fs_extra=require(_0xd482('0x4'));var auth=require(_0xd482('0x5'));var interaction=require(_0xd482('0x6'));var config=require(_0xd482('0x7'));var controller=require(_0xd482('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd482('0x9')]);router[_0xd482('0xa')](_0xd482('0xb'),auth[_0xd482('0xc')](),controller['describe']);router[_0xd482('0xa')](_0xd482('0xd'),auth[_0xd482('0xc')](),controller[_0xd482('0xe')]);router[_0xd482('0xa')](_0xd482('0xf'),auth['isAuthenticated'](),controller[_0xd482('0x10')]);router['get'](_0xd482('0x11'),controller['downloads']);router[_0xd482('0xa')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0xd482('0x12')]);router[_0xd482('0x13')]('/',auth[_0xd482('0xc')](),controller[_0xd482('0x14')]);router[_0xd482('0x13')](_0xd482('0x15'),auth[_0xd482('0xc')](),controller['runTranscribe']);router[_0xd482('0x16')](_0xd482('0xd'),auth['isAuthenticated'](),controller[_0xd482('0x17')]);router[_0xd482('0x18')]('/:id',auth[_0xd482('0xc')](),controller[_0xd482('0x19')]);module['exports']=router; \ No newline at end of file +var _0x1b50=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/:id','/:id/download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4bcdde,_0x4d2f0d){var _0x929af5=function(_0x49bd35){while(--_0x49bd35){_0x4bcdde['push'](_0x4bcdde['shift']());}};_0x929af5(++_0x4d2f0d);}(_0x1b50,0x7a));var _0x01b5=function(_0x8a32b5,_0x225a07){_0x8a32b5=_0x8a32b5-0x0;var _0x19b81=_0x1b50[_0x8a32b5];return _0x19b81;};'use strict';var multer=require(_0x01b5('0x0'));var util=require(_0x01b5('0x1'));var path=require(_0x01b5('0x2'));var timeout=require(_0x01b5('0x3'));var express=require(_0x01b5('0x4'));var router=express[_0x01b5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x01b5('0x6'));var interaction=require(_0x01b5('0x7'));var config=require(_0x01b5('0x8'));var controller=require(_0x01b5('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x01b5('0xa')]('/describe',auth[_0x01b5('0xb')](),controller['describe']);router[_0x01b5('0xa')](_0x01b5('0xc'),auth[_0x01b5('0xb')](),controller['show']);router[_0x01b5('0xa')](_0x01b5('0xd'),auth[_0x01b5('0xb')](),controller['download']);router[_0x01b5('0xa')](_0x01b5('0xe'),controller[_0x01b5('0xf')]);router[_0x01b5('0xa')](_0x01b5('0x10'),auth[_0x01b5('0xb')](),controller[_0x01b5('0x11')]);router[_0x01b5('0x12')]('/',auth[_0x01b5('0xb')](),controller['create']);router['post'](_0x01b5('0x10'),auth['isAuthenticated'](),controller[_0x01b5('0x13')]);router[_0x01b5('0x14')](_0x01b5('0xc'),auth[_0x01b5('0xb')](),controller[_0x01b5('0x15')]);router[_0x01b5('0x16')](_0x01b5('0xc'),auth[_0x01b5('0xb')](),controller[_0x01b5('0x17')]);module[_0x01b5('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index f0799a9..0c63b73 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(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 6db8242..b228fd1 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 _0x4a26=['[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','findOne','secrets','Voice\x20Recording\x20not\x20found','transcribe','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','data1','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','type','key','model','differenceBy','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','VoiceRecording','then','includeAll','include','findAll','show','params','length','catch','create','body','find','describe','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','download','message','VoiceRecording\x20not\x20found','downloads','sequelize','MD5','col','token','$and','push','format','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','unlinkSync','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync'];(function(_0x59f935,_0x2a4870){var _0x239127=function(_0x301d23){while(--_0x301d23){_0x59f935['push'](_0x59f935['shift']());}};_0x239127(++_0x2a4870);}(_0x4a26,0x1e7));var _0x64a2=function(_0x36f8aa,_0x1d007a){_0x36f8aa=_0x36f8aa-0x0;var _0x2985f9=_0x4a26[_0x36f8aa];return _0x2985f9;};'use strict';var emlformat=require(_0x64a2('0x0'));var rimraf=require(_0x64a2('0x1'));var zipdir=require(_0x64a2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x64a2('0x3'));var moment=require(_0x64a2('0x4'));var BPromise=require(_0x64a2('0x5'));var Mustache=require(_0x64a2('0x6'));var util=require(_0x64a2('0x7'));var path=require(_0x64a2('0x8'));var sox=require(_0x64a2('0x9'));var csv=require(_0x64a2('0xa'));var ejs=require(_0x64a2('0xb'));var fs=require('fs');var fs_extra=require(_0x64a2('0xc'));var _=require(_0x64a2('0xd'));var squel=require(_0x64a2('0xe'));var crypto=require(_0x64a2('0xf'));var jsforce=require(_0x64a2('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x64a2('0xa'));var querystring=require(_0x64a2('0x11'));var Papa=require(_0x64a2('0x12'));var AWS=require(_0x64a2('0x13'));var uuidv4=require('uuid/v4');var Redis=require(_0x64a2('0x14'));var authService=require(_0x64a2('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x64a2('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x64a2('0x17'))(_0x64a2('0x18'));var utils=require('../../config/utils');var config=require(_0x64a2('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x218286,_0x2bb6b7){_0x2bb6b7=_0x2bb6b7||0xcc;return function(_0x406420){if(_0x406420){return _0x218286[_0x64a2('0x1a')](_0x2bb6b7);}return _0x218286[_0x64a2('0x1b')](_0x2bb6b7)[_0x64a2('0x1c')]();};}function respondWithResult(_0x390e55,_0x18dba7){_0x18dba7=_0x18dba7||0xc8;return function(_0x333b76){if(_0x333b76){return _0x390e55[_0x64a2('0x1b')](_0x18dba7)[_0x64a2('0x1d')](_0x333b76);}};}function respondWithFilteredResult(_0x8d8874,_0x185727){return function(_0x131a44){if(_0x131a44){var _0x4f8d95=typeof _0x185727[_0x64a2('0x1e')]==='undefined'&&typeof _0x185727[_0x64a2('0x1f')]===_0x64a2('0x20');var _0x26f42d=_0x131a44[_0x64a2('0x21')];var _0x342c67=_0x4f8d95?0x0:_0x185727[_0x64a2('0x1e')];var _0x31145a=_0x4f8d95?_0x131a44['count']:_0x185727['offset']+_0x185727[_0x64a2('0x1f')];var _0x1a5b9f;if(_0x31145a>=_0x26f42d){_0x31145a=_0x26f42d;_0x1a5b9f=0xc8;}else{_0x1a5b9f=0xce;}_0x8d8874[_0x64a2('0x1b')](_0x1a5b9f);return _0x8d8874[_0x64a2('0x22')](_0x64a2('0x23'),_0x342c67+'-'+_0x31145a+'/'+_0x26f42d)['json'](_0x131a44);}return null;};}function patchUpdates(_0x404039){return function(_0x3f1ea1){try{jsonpatch[_0x64a2('0x24')](_0x3f1ea1,_0x404039,!![]);}catch(_0x1f7983){return BPromise[_0x64a2('0x25')](_0x1f7983);}return _0x3f1ea1[_0x64a2('0x26')]();};}function saveUpdates(_0x2678e5,_0x304cf9){return function(_0x431734){if(_0x431734){return _0x431734[_0x64a2('0x27')](_0x2678e5)['then'](function(_0x3d1c8f){return _0x3d1c8f;});}return null;};}function removeEntity(_0x3c6704,_0x5cfce7){return function(_0x87ef6){if(_0x87ef6){return _0x87ef6[_0x64a2('0x28')]()['then'](function(){_0x3c6704[_0x64a2('0x1b')](0xcc)[_0x64a2('0x1c')]();});}};}function handleEntityNotFound(_0x17cd3d,_0x2a934f){return function(_0x1f6ca7){if(!_0x1f6ca7){_0x17cd3d['sendStatus'](0x194);}return _0x1f6ca7;};}function handleError(_0x522d1e,_0x511144){_0x511144=_0x511144||0x1f4;return function(_0x2e45e9){logger['error'](_0x2e45e9['stack']);if(_0x2e45e9[_0x64a2('0x29')]){delete _0x2e45e9[_0x64a2('0x29')];}_0x522d1e['status'](_0x511144)[_0x64a2('0x2a')](_0x2e45e9);};}exports[_0x64a2('0x2b')]=function(_0xaeb7ae,_0x1b0425){var _0x20046f={},_0x481017={},_0x157f84={'count':0x0,'rows':[]};var _0x1ee6b5=_[_0x64a2('0x2c')](db['VoiceRecording'][_0x64a2('0x2d')],function(_0x7b15eb){return{'name':_0x7b15eb['fieldName'],'type':_0x7b15eb[_0x64a2('0x2e')][_0x64a2('0x2f')]};});_0x481017[_0x64a2('0x30')]=_[_0x64a2('0x31')](_[_0x64a2('0x2c')](_0x1ee6b5,_0x64a2('0x29')),['format']);_0x481017[_0x64a2('0x32')]=_[_0x64a2('0x33')](_0xaeb7ae[_0x64a2('0x32')]);_0x481017[_0x64a2('0x34')]=_['intersection'](_0x481017[_0x64a2('0x30')],_0x481017[_0x64a2('0x32')]);_0x20046f[_0x64a2('0x35')]=_[_0x64a2('0x36')](_0x481017[_0x64a2('0x30')],qs['fields'](_0xaeb7ae[_0x64a2('0x32')][_0x64a2('0x37')]));_0x20046f['attributes']=_0x20046f[_0x64a2('0x35')]['length']?_0x20046f[_0x64a2('0x35')]:_0x481017[_0x64a2('0x30')];if(!_0xaeb7ae[_0x64a2('0x32')][_0x64a2('0x38')](_0x64a2('0x39'))){_0x20046f['limit']=qs[_0x64a2('0x1f')](_0xaeb7ae['query'][_0x64a2('0x1f')]);_0x20046f[_0x64a2('0x1e')]=qs['offset'](_0xaeb7ae['query'][_0x64a2('0x1e')]);}_0x20046f[_0x64a2('0x3a')]=qs['sort'](_0xaeb7ae[_0x64a2('0x32')]['sort']);_0x20046f[_0x64a2('0x3b')]=qs[_0x64a2('0x34')](_['pick'](_0xaeb7ae['query'],_0x481017[_0x64a2('0x34')]),_0x1ee6b5);if(_0xaeb7ae[_0x64a2('0x32')][_0x64a2('0x3c')]){_0x20046f[_0x64a2('0x3b')]=_[_0x64a2('0x3d')](_0x20046f['where'],{'$or':_['map'](_0x1ee6b5,function(_0x444adc){if(_0x444adc[_0x64a2('0x2e')]!==_0x64a2('0x3e')){var _0x36192f={};_0x36192f[_0x444adc[_0x64a2('0x29')]]={'$like':'%'+_0xaeb7ae[_0x64a2('0x32')]['filter']+'%'};return _0x36192f;}})});}_0x20046f=_[_0x64a2('0x3d')]({},_0x20046f,_0xaeb7ae[_0x64a2('0x3f')]);var _0x329b02={'where':_0x20046f[_0x64a2('0x3b')]};return db[_0x64a2('0x40')][_0x64a2('0x21')](_0x329b02)[_0x64a2('0x41')](function(_0x222a5b){_0x157f84[_0x64a2('0x21')]=_0x222a5b;if(_0xaeb7ae[_0x64a2('0x32')][_0x64a2('0x42')]){_0x20046f[_0x64a2('0x43')]=[{'all':!![]}];}return db[_0x64a2('0x40')][_0x64a2('0x44')](_0x20046f);})[_0x64a2('0x41')](function(_0x10c87){_0x157f84['rows']=_0x10c87;return _0x157f84;})[_0x64a2('0x41')](respondWithFilteredResult(_0x1b0425,_0x20046f))['catch'](handleError(_0x1b0425,null));};exports[_0x64a2('0x45')]=function(_0x43dca5,_0x2d313e){var _0x264eb4={'raw':![],'where':{'id':_0x43dca5[_0x64a2('0x46')]['id']}},_0x55cc78={};_0x55cc78[_0x64a2('0x30')]=_['keys'](db['VoiceRecording'][_0x64a2('0x2d')]);_0x55cc78[_0x64a2('0x32')]=_[_0x64a2('0x33')](_0x43dca5[_0x64a2('0x32')]);_0x55cc78[_0x64a2('0x34')]=_[_0x64a2('0x36')](_0x55cc78[_0x64a2('0x30')],_0x55cc78[_0x64a2('0x32')]);_0x264eb4[_0x64a2('0x35')]=_[_0x64a2('0x36')](_0x55cc78[_0x64a2('0x30')],qs[_0x64a2('0x37')](_0x43dca5['query'][_0x64a2('0x37')]));_0x264eb4[_0x64a2('0x35')]=_0x264eb4['attributes'][_0x64a2('0x47')]?_0x264eb4[_0x64a2('0x35')]:_0x55cc78['model'];if(_0x43dca5['query'][_0x64a2('0x42')]){_0x264eb4[_0x64a2('0x43')]=[{'all':!![]}];}_0x264eb4=_[_0x64a2('0x3d')]({},_0x264eb4,_0x43dca5[_0x64a2('0x3f')]);return db[_0x64a2('0x40')]['find'](_0x264eb4)['then'](handleEntityNotFound(_0x2d313e,null))[_0x64a2('0x41')](respondWithResult(_0x2d313e,null))[_0x64a2('0x48')](handleError(_0x2d313e,null));};exports[_0x64a2('0x49')]=function(_0xadee67,_0x2a4ca4){return db[_0x64a2('0x40')][_0x64a2('0x49')](_0xadee67[_0x64a2('0x4a')],{})['then'](respondWithResult(_0x2a4ca4,0xc9))[_0x64a2('0x48')](handleError(_0x2a4ca4,null));};exports[_0x64a2('0x27')]=function(_0x5da8f5,_0x4c7993){if(_0x5da8f5['body']['id']){delete _0x5da8f5[_0x64a2('0x4a')]['id'];}return db[_0x64a2('0x40')][_0x64a2('0x4b')]({'where':{'id':_0x5da8f5[_0x64a2('0x46')]['id']}})['then'](handleEntityNotFound(_0x4c7993,null))[_0x64a2('0x41')](saveUpdates(_0x5da8f5[_0x64a2('0x4a')],null))['then'](respondWithResult(_0x4c7993,null))['catch'](handleError(_0x4c7993,null));};exports[_0x64a2('0x4c')]=function(_0x5a8136,_0x190599){return db[_0x64a2('0x40')]['describe']()[_0x64a2('0x41')](respondWithResult(_0x190599,null))[_0x64a2('0x48')](handleError(_0x190599,null));};exports['download']=function(_0x5a5574,_0x3835cb,_0x368280){var _0x5bb8db=require(_0x64a2('0x4d'));var _0x117ef5=![];var _0xfc3fc0={};if(_0x5a5574[_0x64a2('0x32')][_0x64a2('0x2e')]&&_0x5a5574[_0x64a2('0x32')][_0x64a2('0x2e')]==='uniqueid'){_0xfc3fc0[_0x64a2('0x4e')]=_0x5a5574[_0x64a2('0x46')]['id'];}else{_0xfc3fc0['id']=_0x5a5574[_0x64a2('0x46')]['id'];}return db[_0x64a2('0x40')][_0x64a2('0x4b')]({'where':_0xfc3fc0,'attributes':['id',_0x64a2('0x4f')],'raw':!![]})[_0x64a2('0x41')](handleEntityNotFound(_0x3835cb,null))[_0x64a2('0x41')](function(_0x737b42){if(_0x737b42){var _0x4826bb=_0x737b42['value'];var _0x19c893=util['format'](_0x64a2('0x50'),_0x4826bb);if(fs['existsSync'](_0x19c893)){_0x117ef5=!![];return _0x5bb8db[_0x64a2('0x51')](_0x19c893,_0x4826bb,config['secrets'][_0x64a2('0x52')])[_0x64a2('0x41')](function(){return _0x737b42;});}return _0x737b42;}})[_0x64a2('0x41')](function(_0x7343fa){if(_0x7343fa){var _0x206797=_0x7343fa['value'];if(!fs[_0x64a2('0x53')](_0x206797)){throw new db[(_0x64a2('0x54'))][(_0x64a2('0x55'))]('VoiceRecording\x20not\x20found');}if(_0x7343fa[_0x64a2('0x56')]){return _0x3835cb['download'](_0x206797,_0x7343fa[_0x64a2('0x56')]+path[_0x64a2('0x57')](_0x206797),function(){if(_0x117ef5){fs[_0x64a2('0x58')](_0x206797);}});}else{return _0x3835cb[_0x64a2('0x59')](_0x206797,function(_0x2990d4){if(_0x117ef5){fs[_0x64a2('0x58')](_0x206797);}});}}})[_0x64a2('0x48')](function(_0x20455b){if(_0x20455b[_0x64a2('0x5a')]===_0x64a2('0x5b')){_0x3835cb[_0x64a2('0x1b')](0x194)[_0x64a2('0x2a')]('Not\x20found');}else{return handleError(_0x3835cb,null);}});};exports[_0x64a2('0x5c')]=function(_0x296716,_0x25a10f,_0xd0fa8c){var _0x168f00=require(_0x64a2('0x4d'));var _0x21c4c3=![];var _0x2f17ba={'$and':[db[_0x64a2('0x5d')][_0x64a2('0x3b')](db[_0x64a2('0x5d')]['fn'](_0x64a2('0x5e'),db[_0x64a2('0x5d')][_0x64a2('0x5f')](_0x64a2('0x4e'))),_0x296716[_0x64a2('0x32')][_0x64a2('0x60')])]};if(_0x296716[_0x64a2('0x32')][_0x64a2('0x2e')]&&_0x296716[_0x64a2('0x32')]['type']==='uniqueid'){_0x2f17ba[_0x64a2('0x61')][_0x64a2('0x62')]({'uniqueid':_0x296716[_0x64a2('0x46')]['id']});}else{_0x2f17ba[_0x64a2('0x61')][_0x64a2('0x62')]({'id':_0x296716[_0x64a2('0x46')]['id']});}return db[_0x64a2('0x40')][_0x64a2('0x4b')]({'where':_0x2f17ba,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x25a10f,null))[_0x64a2('0x41')](function(_0x534464){if(_0x534464){var _0x391434=util[_0x64a2('0x63')]('%s.cypher',_0x534464[_0x64a2('0x4f')]);if(fs['existsSync'](_0x391434)){_0x21c4c3=!![];return _0x168f00[_0x64a2('0x51')](_0x391434,_0x534464[_0x64a2('0x4f')],config['secrets'][_0x64a2('0x52')])[_0x64a2('0x41')](function(){return _0x534464;});}return _0x534464;}})[_0x64a2('0x41')](function(_0x176d22){if(_0x176d22){if(!fs['existsSync'](_0x176d22[_0x64a2('0x4f')])){throw new db[(_0x64a2('0x54'))][(_0x64a2('0x55'))](_0x64a2('0x5b'));}if(_0x176d22[_0x64a2('0x56')]){return _0x25a10f['download'](_0x176d22['value'],_0x176d22[_0x64a2('0x56')]+path[_0x64a2('0x57')](_0x176d22[_0x64a2('0x4f')]),function(){if(_0x21c4c3){fs[_0x64a2('0x58')](_0x176d22['value']);}});}else{return _0x25a10f['download'](_0x176d22[_0x64a2('0x4f')],function(_0x59b8ef){if(_0x21c4c3){fs['unlink'](_0x176d22[_0x64a2('0x4f')]);}});}}})[_0x64a2('0x48')](handleError(_0x25a10f,null));};exports['destroy']=function(_0x4b893c,_0x5babd1){return db['VoiceRecording'][_0x64a2('0x4b')]({'where':{'id':_0x4b893c['params']['id']}})[_0x64a2('0x41')](function(_0x8286ea){if(_['isNil'](_0x8286ea)){throw new ReferenceError(_0x64a2('0x64'));}return _0x8286ea;})[_0x64a2('0x41')](function(_0xe94e39){var _0x43d2e7=_0xe94e39[_0x64a2('0x4f')];logger[_0x64a2('0x65')](_0x64a2('0x66'),_0x43d2e7);if(!_[_0x64a2('0x67')](_0xe94e39[_0x64a2('0x4f')])&&fs[_0x64a2('0x53')](_0x43d2e7)){logger['info']('File:\x20\x22'+_0x43d2e7+_0x64a2('0x68'));fs['unlinkSync'](_0x43d2e7);}_0x43d2e7=_0x43d2e7+_0x64a2('0x69');if(!_[_0x64a2('0x67')](_0xe94e39[_0x64a2('0x4f')])&&fs[_0x64a2('0x53')](_0x43d2e7)){logger[_0x64a2('0x65')](_0x64a2('0x6a')+_0x43d2e7+_0x64a2('0x68'));fs[_0x64a2('0x6b')](_0x43d2e7);}return _0xe94e39;})[_0x64a2('0x41')](function(_0x21ed62){if(!_0x21ed62)throw new InternalError();return _0x21ed62[_0x64a2('0x28')]();})[_0x64a2('0x41')](function(){_0x5babd1['status'](0xcc)[_0x64a2('0x1c')]();})['catch'](handleError(_0x5babd1,null));};function getBucketslist(_0x33500a,_0x407948,_0x5e9676){return new Promise(function(_0x56e3af,_0x3c0950){var _0x10e2c7=new AWS['S3']({'accessKeyId':_0x407948,'secretAccessKey':_0x33500a,'region':_0x5e9676});_0x10e2c7['listBuckets']({},function(_0x207093,_0x4a4c1c){if(_0x207093){return _0x3c0950(_0x207093);}else{return _0x56e3af(_0x4a4c1c);}});});}function createBucket(_0x32a5d4,_0x35553f,_0x510ca8,_0x5f5928){return new Promise(function(_0x2f953d,_0x1f34f4){var _0x58ef04=new AWS['S3']({'accessKeyId':_0x35553f,'secretAccessKey':_0x32a5d4,'region':_0x510ca8});_0x58ef04['createBucket']({'Bucket':_0x5f5928},function(_0x68a4f9,_0x3acf64){if(_0x68a4f9){return _0x1f34f4(_0x68a4f9);}else{return _0x2f953d(_0x3acf64);}});});}function uploadFile(_0x1f8e52,_0x2db765,_0x132b15,_0x4b11bf,_0x2eb28c,_0x40ac41){return new Promise(function(_0x4b168a,_0x2aa353){var _0x18e672=new AWS['S3']({'accessKeyId':_0x2db765,'secretAccessKey':_0x1f8e52,'region':_0x132b15});_0x18e672[_0x64a2('0x6c')]({'Bucket':_0x4b11bf,'Key':_0x2eb28c,'Body':_0x40ac41},function(_0x2010c9,_0x2bc725){if(_0x2010c9){return _0x2aa353(_0x2010c9);}else{return _0x4b168a(_0x2bc725);}});});}function startTranscribe(_0x3c5e14,_0x2783c2,_0x4b8aab,_0x447ef1,_0x1ad899,_0x1e2138){return new Promise(function(_0x42a399,_0x30b0a7){var _0x5d7bdb=new AWS[(_0x64a2('0x6d'))]({'accessKeyId':_0x2783c2,'secretAccessKey':_0x3c5e14,'region':_0x4b8aab});_0x5d7bdb['startTranscriptionJob']({'TranscriptionJobName':_0x447ef1,'LanguageCode':_0x1ad899,'Media':{'MediaFileUri':_0x1e2138}},function(_0x1d15c7,_0x5d1bec){if(_0x1d15c7){return _0x30b0a7(_0x1d15c7);}else{return _0x42a399(_0x5d1bec);}});});}function transcribe(_0x1413d0,_0x5ed97c,_0x154040,_0x36fdb5,_0x246c94,_0x14c54e,_0x2a0095){return new Promise(function(_0x2f49d1,_0xd347e4){var _0x3a543a={};logger['info'](util[_0x64a2('0x63')](_0x64a2('0x6e'),_0x1413d0,_0x246c94));return uploadFile(_0x5ed97c,_0x154040,_0x36fdb5,_0x246c94,path[_0x64a2('0x6f')](_0x14c54e),fs[_0x64a2('0x70')](_0x14c54e))[_0x64a2('0x41')](function(_0x4147c6){logger[_0x64a2('0x65')](util['format'](_0x64a2('0x71'),_0x1413d0,_0x246c94,_0x4147c6[_0x64a2('0x72')]));_0x3a543a[_0x64a2('0x73')]=_0x4147c6['Bucket'];_0x3a543a[_0x64a2('0x74')]=_0x4147c6[_0x64a2('0x72')];logger[_0x64a2('0x65')](util['format'](_0x64a2('0x75'),_0x1413d0));return startTranscribe(_0x5ed97c,_0x154040,_0x36fdb5,uuidv4(),_0x2a0095,_0x4147c6[_0x64a2('0x72')]);})[_0x64a2('0x41')](function(_0x5d4c09){logger[_0x64a2('0x65')](util[_0x64a2('0x63')](_0x64a2('0x76'),_0x1413d0,_0x5d4c09[_0x64a2('0x77')][_0x64a2('0x78')]));_0x3a543a['transcribeName']=_0x5d4c09['TranscriptionJob'][_0x64a2('0x78')];_0x3a543a[_0x64a2('0x79')]=_0x5d4c09['TranscriptionJob']['TranscriptionJobStatus'];return _0x2f49d1(_0x3a543a);})[_0x64a2('0x48')](function(_0x15d85b){return _0xd347e4(_0x15d85b);});});}exports['runTranscribe']=function(_0xfb26d5,_0x162951,_0x344432){var _0x189713;var _0x5d1be9;var _0x510396;var _0xacc2f3=require('../../components/encryptor');return db[_0x64a2('0x40')][_0x64a2('0x7a')]({'where':{'id':_0xfb26d5[_0x64a2('0x46')]['id']}})[_0x64a2('0x41')](function(_0x4d1a9a){if(_0x4d1a9a){var _0x33d893=util[_0x64a2('0x63')](_0x64a2('0x50'),_0x4d1a9a[_0x64a2('0x4f')]);if(fs[_0x64a2('0x53')](_0x33d893)){cypher=!![];return _0xacc2f3['decryptFile'](_0x33d893,_0x4d1a9a[_0x64a2('0x4f')],config[_0x64a2('0x7b')]['recording'])[_0x64a2('0x41')](function(){return _0x4d1a9a;});}return _0x4d1a9a;}})['then'](function(_0xaf36c1){if(!_0xaf36c1){throw new db['Sequelize'][(_0x64a2('0x55'))](_0x64a2('0x7c'));}_0x5d1be9=_0xaf36c1;return db['Setting'][_0x64a2('0x7a')]({'where':{'id':0x1}});})[_0x64a2('0x41')](handleEntityNotFound(_0x162951,null))[_0x64a2('0x41')](function(_0x514da9){if(_0x514da9){_0x189713=_0x514da9;if(!_0x189713[_0x64a2('0x7d')]||!_0x189713['transcribeAccountId']||!_0x189713[_0x64a2('0x7e')]||!_0x189713[_0x64a2('0x7f')]||!_0x189713[_0x64a2('0x73')]){throw new db[(_0x64a2('0x54'))][(_0x64a2('0x55'))](_0x64a2('0x80'));}if(_0xfb26d5[_0x64a2('0x4a')][_0x64a2('0x81')]&&(!_0x189713['sentiment']||!_0x189713[_0x64a2('0x82')]||!_0x189713[_0x64a2('0x83')]||!_0x189713[_0x64a2('0x7f')]||!_0x189713[_0x64a2('0x73')])){throw new db[(_0x64a2('0x54'))][(_0x64a2('0x55'))](_0x64a2('0x84'));}return db[_0x64a2('0x85')][_0x64a2('0x7a')]({'where':{'id':_0x189713[_0x64a2('0x86')]}});}})['then'](function(_0x484098){if(!_0x484098){throw new db[(_0x64a2('0x54'))][(_0x64a2('0x55'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x484098[_0x64a2('0x87')]||!_0x484098[_0x64a2('0x88')]){throw new db['Sequelize'][(_0x64a2('0x55'))]('Cloud\x20Provider\x20not\x20configured');}_0x510396=_0x484098;return getBucketslist(_0x510396[_0x64a2('0x87')],_0x510396['data2'],_0x189713[_0x64a2('0x7e')]);})[_0x64a2('0x41')](function(_0x7b7e7d){if(_0x7b7e7d&&_0x7b7e7d[_0x64a2('0x89')]){var _0x4bf426=_['find'](_0x7b7e7d[_0x64a2('0x89')],function(_0x3fca5d){return _0x3fca5d['Name']===_0x189713[_0x64a2('0x73')];});if(!_0x4bf426){logger['info'](util[_0x64a2('0x63')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0xfb26d5[_0x64a2('0x46')]['id'],_0x189713[_0x64a2('0x73')]));return createBucket(_0x510396[_0x64a2('0x87')],_0x510396[_0x64a2('0x88')],_0x189713['transcribeRegion'],_0x189713[_0x64a2('0x73')]);}logger[_0x64a2('0x65')](util[_0x64a2('0x63')](_0x64a2('0x8a'),_0xfb26d5[_0x64a2('0x46')]['id'],_0x189713[_0x64a2('0x73')]));return;}})[_0x64a2('0x41')](function(_0x542f3e){if(_0x5d1be9[_0x64a2('0x79')]===_0x64a2('0x8b')){return transcribe(_0xfb26d5[_0x64a2('0x46')]['id'],_0x510396['data1'],_0x510396[_0x64a2('0x88')],_0x189713['transcribeRegion'],_0x189713[_0x64a2('0x73')],_0x5d1be9[_0x64a2('0x4f')],_0x189713[_0x64a2('0x7f')]);}else{logger[_0x64a2('0x65')](util[_0x64a2('0x63')](_0x64a2('0x8c'),_0xfb26d5[_0x64a2('0x46')]['id']));return{'transcribeStatus':_0x64a2('0x8d')};}})[_0x64a2('0x41')](function(_0x1231d9){if(_0x1231d9){_0x1231d9['tempSentiment']=_0xfb26d5[_0x64a2('0x4a')][_0x64a2('0x81')];return _0x5d1be9[_0x64a2('0x8e')](_0x1231d9);}})[_0x64a2('0x41')](respondWithResult(_0x162951,null))['catch'](handleError(_0x162951,null));};function writeFile(_0x408434,_0x208d0f){return new Promise(function(_0x52b1d6,_0x1c84b7){fs[_0x64a2('0x8f')](_0x208d0f,_0x408434,function(_0xcbc52,_0x1c56d8){if(_0xcbc52){return _0x1c84b7(_0xcbc52);}else{return _0x52b1d6(_0x1c56d8);}});});}exports[_0x64a2('0x90')]=function(_0x848dfb,_0x3b22d4,_0x394b96){return db[_0x64a2('0x40')][_0x64a2('0x7a')]({'where':{'id':_0x848dfb[_0x64a2('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b22d4))['then'](function(_0x1bbaa9){if(_0x1bbaa9&&_0x1bbaa9[_0x64a2('0x91')]){var _0x126841=_0x1bbaa9[_0x64a2('0x91')];var _0x3a79a1=config[_0x64a2('0x92')]+_0x64a2('0x93')+_0x1bbaa9['id']+_0x64a2('0x94');if(fs[_0x64a2('0x53')](_0x3a79a1)){return _0x3a79a1;}return writeFile(_0x126841,_0x3a79a1)[_0x64a2('0x41')](function(){return _0x3a79a1;});}else{throw new db[(_0x64a2('0x54'))][(_0x64a2('0x55'))](_0x64a2('0x95'));}})[_0x64a2('0x41')](function(_0x5a6025){return _0x3b22d4['download'](_0x5a6025);})[_0x64a2('0x48')](handleError(_0x3b22d4));}; \ No newline at end of file +var _0xcffb=['papaparse','aws-sdk','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','json','update','then','destroy','error','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','model','differenceBy','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','downloads','sequelize','MD5','$and','push','secrets','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Setting','transcribe','transcribeRegion','language','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\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','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0xcffb,0x88));var _0xbcff=function(_0x4e7f7a,_0x57d89c){_0x4e7f7a=_0x4e7f7a-0x0;var _0x227ea7=_0xcffb[_0x4e7f7a];return _0x227ea7;};'use strict';var emlformat=require(_0xbcff('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbcff('0x1'));var rp=require(_0xbcff('0x2'));var moment=require(_0xbcff('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbcff('0x4'));var util=require(_0xbcff('0x5'));var path=require(_0xbcff('0x6'));var sox=require(_0xbcff('0x7'));var csv=require(_0xbcff('0x8'));var ejs=require(_0xbcff('0x9'));var fs=require('fs');var fs_extra=require(_0xbcff('0xa'));var _=require(_0xbcff('0xb'));var squel=require('squel');var crypto=require(_0xbcff('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbcff('0x8'));var querystring=require(_0xbcff('0xd'));var Papa=require(_0xbcff('0xe'));var AWS=require(_0xbcff('0xf'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbcff('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbcff('0x11'))(_0xbcff('0x12'));var utils=require('../../config/utils');var config=require(_0xbcff('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xbcff('0x14'))['db'];function respondWithStatusCode(_0x646bf1,_0x3c9061){_0x3c9061=_0x3c9061||0xcc;return function(_0x8d4959){if(_0x8d4959){return _0x646bf1[_0xbcff('0x15')](_0x3c9061);}return _0x646bf1[_0xbcff('0x16')](_0x3c9061)[_0xbcff('0x17')]();};}function respondWithResult(_0x41b389,_0x357837){_0x357837=_0x357837||0xc8;return function(_0x5b9186){if(_0x5b9186){return _0x41b389['status'](_0x357837)['json'](_0x5b9186);}};}function respondWithFilteredResult(_0x3869d4,_0xd80b02){return function(_0x47aa8d){if(_0x47aa8d){var _0x54560e=typeof _0xd80b02[_0xbcff('0x18')]==='undefined'&&typeof _0xd80b02['limit']===_0xbcff('0x19');var _0x43eab5=_0x47aa8d[_0xbcff('0x1a')];var _0x4516b2=_0x54560e?0x0:_0xd80b02[_0xbcff('0x18')];var _0xddf415=_0x54560e?_0x47aa8d[_0xbcff('0x1a')]:_0xd80b02[_0xbcff('0x18')]+_0xd80b02['limit'];var _0x4fb5b9;if(_0xddf415>=_0x43eab5){_0xddf415=_0x43eab5;_0x4fb5b9=0xc8;}else{_0x4fb5b9=0xce;}_0x3869d4[_0xbcff('0x16')](_0x4fb5b9);return _0x3869d4[_0xbcff('0x1b')]('Content-Range',_0x4516b2+'-'+_0xddf415+'/'+_0x43eab5)[_0xbcff('0x1c')](_0x47aa8d);}return null;};}function patchUpdates(_0x46b5e1){return function(_0x3df696){try{jsonpatch['apply'](_0x3df696,_0x46b5e1,!![]);}catch(_0x157aa9){return BPromise['reject'](_0x157aa9);}return _0x3df696['save']();};}function saveUpdates(_0x3ec549,_0x2ff92e){return function(_0xcc71d){if(_0xcc71d){return _0xcc71d[_0xbcff('0x1d')](_0x3ec549)[_0xbcff('0x1e')](function(_0x291fd2){return _0x291fd2;});}return null;};}function removeEntity(_0x1a2d1c,_0x4a9f9f){return function(_0x3dd203){if(_0x3dd203){return _0x3dd203[_0xbcff('0x1f')]()['then'](function(){_0x1a2d1c[_0xbcff('0x16')](0xcc)[_0xbcff('0x17')]();});}};}function handleEntityNotFound(_0x317758,_0x730869){return function(_0x2886e7){if(!_0x2886e7){_0x317758['sendStatus'](0x194);}return _0x2886e7;};}function handleError(_0xd9beb8,_0x5135fb){_0x5135fb=_0x5135fb||0x1f4;return function(_0x5a4be7){logger[_0xbcff('0x20')](_0x5a4be7['stack']);if(_0x5a4be7[_0xbcff('0x21')]){delete _0x5a4be7[_0xbcff('0x21')];}_0xd9beb8['status'](_0x5135fb)[_0xbcff('0x22')](_0x5a4be7);};}exports[_0xbcff('0x23')]=function(_0x2c4727,_0x245757){var _0x432102={},_0x1ee51e={},_0x43a4c9={'count':0x0,'rows':[]};var _0x2717ae=_[_0xbcff('0x24')](db[_0xbcff('0x25')][_0xbcff('0x26')],function(_0x2c64fc){return{'name':_0x2c64fc[_0xbcff('0x27')],'type':_0x2c64fc[_0xbcff('0x28')]['key']};});_0x1ee51e[_0xbcff('0x29')]=_[_0xbcff('0x2a')](_['map'](_0x2717ae,'name'),['format']);_0x1ee51e['query']=_[_0xbcff('0x2b')](_0x2c4727[_0xbcff('0x2c')]);_0x1ee51e[_0xbcff('0x2d')]=_['intersection'](_0x1ee51e['model'],_0x1ee51e[_0xbcff('0x2c')]);_0x432102[_0xbcff('0x2e')]=_[_0xbcff('0x2f')](_0x1ee51e['model'],qs[_0xbcff('0x30')](_0x2c4727['query'][_0xbcff('0x30')]));_0x432102[_0xbcff('0x2e')]=_0x432102[_0xbcff('0x2e')][_0xbcff('0x31')]?_0x432102[_0xbcff('0x2e')]:_0x1ee51e[_0xbcff('0x29')];if(!_0x2c4727[_0xbcff('0x2c')][_0xbcff('0x32')](_0xbcff('0x33'))){_0x432102[_0xbcff('0x34')]=qs[_0xbcff('0x34')](_0x2c4727['query'][_0xbcff('0x34')]);_0x432102[_0xbcff('0x18')]=qs[_0xbcff('0x18')](_0x2c4727[_0xbcff('0x2c')]['offset']);}_0x432102[_0xbcff('0x35')]=qs[_0xbcff('0x36')](_0x2c4727['query'][_0xbcff('0x36')]);_0x432102['where']=qs[_0xbcff('0x2d')](_['pick'](_0x2c4727[_0xbcff('0x2c')],_0x1ee51e[_0xbcff('0x2d')]),_0x2717ae);if(_0x2c4727[_0xbcff('0x2c')][_0xbcff('0x37')]){_0x432102['where']=_['merge'](_0x432102[_0xbcff('0x38')],{'$or':_[_0xbcff('0x24')](_0x2717ae,function(_0x4753ea){if(_0x4753ea[_0xbcff('0x28')]!==_0xbcff('0x39')){var _0x557725={};_0x557725[_0x4753ea[_0xbcff('0x21')]]={'$like':'%'+_0x2c4727[_0xbcff('0x2c')][_0xbcff('0x37')]+'%'};return _0x557725;}})});}_0x432102=_[_0xbcff('0x3a')]({},_0x432102,_0x2c4727[_0xbcff('0x3b')]);var _0x42b82d={'where':_0x432102[_0xbcff('0x38')]};return db[_0xbcff('0x25')][_0xbcff('0x1a')](_0x42b82d)['then'](function(_0x1123ad){_0x43a4c9[_0xbcff('0x1a')]=_0x1123ad;if(_0x2c4727[_0xbcff('0x2c')][_0xbcff('0x3c')]){_0x432102[_0xbcff('0x3d')]=[{'all':!![]}];}return db[_0xbcff('0x25')][_0xbcff('0x3e')](_0x432102);})[_0xbcff('0x1e')](function(_0xe8e4e3){_0x43a4c9[_0xbcff('0x3f')]=_0xe8e4e3;return _0x43a4c9;})[_0xbcff('0x1e')](respondWithFilteredResult(_0x245757,_0x432102))[_0xbcff('0x40')](handleError(_0x245757,null));};exports[_0xbcff('0x41')]=function(_0x20e284,_0x1f0f9c){var _0x4ff59e={'raw':![],'where':{'id':_0x20e284[_0xbcff('0x42')]['id']}},_0x17927b={};_0x17927b[_0xbcff('0x29')]=_[_0xbcff('0x2b')](db['VoiceRecording'][_0xbcff('0x26')]);_0x17927b[_0xbcff('0x2c')]=_[_0xbcff('0x2b')](_0x20e284[_0xbcff('0x2c')]);_0x17927b['filters']=_[_0xbcff('0x2f')](_0x17927b['model'],_0x17927b['query']);_0x4ff59e[_0xbcff('0x2e')]=_[_0xbcff('0x2f')](_0x17927b[_0xbcff('0x29')],qs['fields'](_0x20e284[_0xbcff('0x2c')][_0xbcff('0x30')]));_0x4ff59e['attributes']=_0x4ff59e['attributes'][_0xbcff('0x31')]?_0x4ff59e[_0xbcff('0x2e')]:_0x17927b[_0xbcff('0x29')];if(_0x20e284[_0xbcff('0x2c')][_0xbcff('0x3c')]){_0x4ff59e[_0xbcff('0x3d')]=[{'all':!![]}];}_0x4ff59e=_[_0xbcff('0x3a')]({},_0x4ff59e,_0x20e284[_0xbcff('0x3b')]);return db[_0xbcff('0x25')][_0xbcff('0x43')](_0x4ff59e)[_0xbcff('0x1e')](handleEntityNotFound(_0x1f0f9c,null))['then'](respondWithResult(_0x1f0f9c,null))[_0xbcff('0x40')](handleError(_0x1f0f9c,null));};exports[_0xbcff('0x44')]=function(_0x57d6cd,_0x640b41){return db[_0xbcff('0x25')][_0xbcff('0x44')](_0x57d6cd[_0xbcff('0x45')],{})[_0xbcff('0x1e')](respondWithResult(_0x640b41,0xc9))['catch'](handleError(_0x640b41,null));};exports[_0xbcff('0x1d')]=function(_0x44993f,_0x2438c6){if(_0x44993f['body']['id']){delete _0x44993f[_0xbcff('0x45')]['id'];}return db['VoiceRecording'][_0xbcff('0x43')]({'where':{'id':_0x44993f[_0xbcff('0x42')]['id']}})[_0xbcff('0x1e')](handleEntityNotFound(_0x2438c6,null))[_0xbcff('0x1e')](saveUpdates(_0x44993f[_0xbcff('0x45')],null))[_0xbcff('0x1e')](respondWithResult(_0x2438c6,null))[_0xbcff('0x40')](handleError(_0x2438c6,null));};exports[_0xbcff('0x46')]=function(_0x343763,_0x2470ba){return db['VoiceRecording'][_0xbcff('0x46')]()[_0xbcff('0x1e')](respondWithResult(_0x2470ba,null))['catch'](handleError(_0x2470ba,null));};exports[_0xbcff('0x47')]=function(_0x3a0bc2,_0x35787d,_0x95d188){var _0x4d96a1=require(_0xbcff('0x48'));var _0x8975e7=![];var _0x4c0061={};if(_0x3a0bc2[_0xbcff('0x2c')]['type']&&_0x3a0bc2['query'][_0xbcff('0x28')]===_0xbcff('0x49')){_0x4c0061['uniqueid']=_0x3a0bc2[_0xbcff('0x42')]['id'];}else{_0x4c0061['id']=_0x3a0bc2[_0xbcff('0x42')]['id'];}return db[_0xbcff('0x25')][_0xbcff('0x43')]({'where':_0x4c0061,'attributes':['id',_0xbcff('0x4a')],'raw':!![]})[_0xbcff('0x1e')](handleEntityNotFound(_0x35787d,null))['then'](function(_0xc7d5c4){if(_0xc7d5c4){var _0x5474c8=_0xc7d5c4['value'];var _0x1a4142=util[_0xbcff('0x4b')](_0xbcff('0x4c'),_0x5474c8);if(fs[_0xbcff('0x4d')](_0x1a4142)){_0x8975e7=!![];return _0x4d96a1[_0xbcff('0x4e')](_0x1a4142,_0x5474c8,config['secrets'][_0xbcff('0x4f')])[_0xbcff('0x1e')](function(){return _0xc7d5c4;});}return _0xc7d5c4;}})[_0xbcff('0x1e')](function(_0xd4a07c){if(_0xd4a07c){var _0x161ebc=_0xd4a07c['value'];if(!fs[_0xbcff('0x4d')](_0x161ebc)){throw new db[(_0xbcff('0x50'))][(_0xbcff('0x51'))](_0xbcff('0x52'));}if(_0xd4a07c['filename']){return _0x35787d[_0xbcff('0x47')](_0x161ebc,_0xd4a07c[_0xbcff('0x53')]+path[_0xbcff('0x54')](_0x161ebc),function(){if(_0x8975e7){fs[_0xbcff('0x55')](_0x161ebc);}});}else{return _0x35787d[_0xbcff('0x47')](_0x161ebc,function(_0x173578){if(_0x8975e7){fs['unlink'](_0x161ebc);}});}}})['catch'](function(_0x3b527a){if(_0x3b527a['message']===_0xbcff('0x52')){_0x35787d[_0xbcff('0x16')](0x194)[_0xbcff('0x22')](_0xbcff('0x56'));}else{return handleError(_0x35787d,null);}});};exports[_0xbcff('0x57')]=function(_0x481e40,_0x4507c9,_0x160503){var _0x31d56e=require(_0xbcff('0x48'));var _0x140a9b=![];var _0x5bc0c6={'$and':[db['sequelize']['where'](db[_0xbcff('0x58')]['fn'](_0xbcff('0x59'),db[_0xbcff('0x58')]['col'](_0xbcff('0x49'))),_0x481e40['query']['token'])]};if(_0x481e40[_0xbcff('0x2c')]['type']&&_0x481e40[_0xbcff('0x2c')][_0xbcff('0x28')]==='uniqueid'){_0x5bc0c6[_0xbcff('0x5a')][_0xbcff('0x5b')]({'uniqueid':_0x481e40['params']['id']});}else{_0x5bc0c6[_0xbcff('0x5a')][_0xbcff('0x5b')]({'id':_0x481e40[_0xbcff('0x42')]['id']});}return db[_0xbcff('0x25')][_0xbcff('0x43')]({'where':_0x5bc0c6,'attributes':['id',_0xbcff('0x4a')],'raw':!![]})[_0xbcff('0x1e')](handleEntityNotFound(_0x4507c9,null))[_0xbcff('0x1e')](function(_0x58b43a){if(_0x58b43a){var _0x9bd615=util['format'](_0xbcff('0x4c'),_0x58b43a[_0xbcff('0x4a')]);if(fs[_0xbcff('0x4d')](_0x9bd615)){_0x140a9b=!![];return _0x31d56e[_0xbcff('0x4e')](_0x9bd615,_0x58b43a[_0xbcff('0x4a')],config[_0xbcff('0x5c')]['recording'])[_0xbcff('0x1e')](function(){return _0x58b43a;});}return _0x58b43a;}})['then'](function(_0x44dae0){if(_0x44dae0){if(!fs['existsSync'](_0x44dae0['value'])){throw new db[(_0xbcff('0x50'))][(_0xbcff('0x51'))](_0xbcff('0x52'));}if(_0x44dae0['filename']){return _0x4507c9['download'](_0x44dae0['value'],_0x44dae0[_0xbcff('0x53')]+path[_0xbcff('0x54')](_0x44dae0[_0xbcff('0x4a')]),function(){if(_0x140a9b){fs[_0xbcff('0x55')](_0x44dae0[_0xbcff('0x4a')]);}});}else{return _0x4507c9[_0xbcff('0x47')](_0x44dae0[_0xbcff('0x4a')],function(_0x55f4a){if(_0x140a9b){fs[_0xbcff('0x55')](_0x44dae0['value']);}});}}})[_0xbcff('0x40')](handleError(_0x4507c9,null));};exports[_0xbcff('0x1f')]=function(_0x2ecccb,_0x54775c){return db[_0xbcff('0x25')][_0xbcff('0x43')]({'where':{'id':_0x2ecccb[_0xbcff('0x42')]['id']}})['then'](function(_0x3f1001){if(_[_0xbcff('0x5d')](_0x3f1001)){throw new ReferenceError(_0xbcff('0x5e'));}return _0x3f1001;})['then'](function(_0x505d17){var _0x36bf87=_0x505d17[_0xbcff('0x4a')];logger['info'](_0xbcff('0x5f'),_0x36bf87);if(!_[_0xbcff('0x5d')](_0x505d17[_0xbcff('0x4a')])&&fs[_0xbcff('0x4d')](_0x36bf87)){logger[_0xbcff('0x60')](_0xbcff('0x61')+_0x36bf87+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xbcff('0x62')](_0x36bf87);}_0x36bf87=_0x36bf87+_0xbcff('0x63');if(!_[_0xbcff('0x5d')](_0x505d17[_0xbcff('0x4a')])&&fs[_0xbcff('0x4d')](_0x36bf87)){logger[_0xbcff('0x60')]('File:\x20\x22'+_0x36bf87+_0xbcff('0x64'));fs[_0xbcff('0x62')](_0x36bf87);}return _0x505d17;})[_0xbcff('0x1e')](function(_0x30a4c0){if(!_0x30a4c0)throw new InternalError();return _0x30a4c0[_0xbcff('0x1f')]();})[_0xbcff('0x1e')](function(){_0x54775c[_0xbcff('0x16')](0xcc)[_0xbcff('0x17')]();})[_0xbcff('0x40')](handleError(_0x54775c,null));};function getBucketslist(_0x3f2405,_0x135371,_0x1a736f){return new Promise(function(_0x17c54b,_0x315e26){var _0x32abfd=new AWS['S3']({'accessKeyId':_0x135371,'secretAccessKey':_0x3f2405,'region':_0x1a736f});_0x32abfd['listBuckets']({},function(_0x35ea04,_0x1e39b8){if(_0x35ea04){return _0x315e26(_0x35ea04);}else{return _0x17c54b(_0x1e39b8);}});});}function createBucket(_0xe3a3b7,_0x48cd24,_0x1e90ab,_0x5d8989){return new Promise(function(_0x4db11b,_0x380edb){var _0x1a06ae=new AWS['S3']({'accessKeyId':_0x48cd24,'secretAccessKey':_0xe3a3b7,'region':_0x1e90ab});_0x1a06ae[_0xbcff('0x65')]({'Bucket':_0x5d8989},function(_0x4792a3,_0x44012f){if(_0x4792a3){return _0x380edb(_0x4792a3);}else{return _0x4db11b(_0x44012f);}});});}function uploadFile(_0x2d4c5b,_0x1c4baf,_0x47d9bf,_0xbe01fc,_0x3ef38b,_0x2ec51f){return new Promise(function(_0x48b623,_0x202d38){var _0x54c893=new AWS['S3']({'accessKeyId':_0x1c4baf,'secretAccessKey':_0x2d4c5b,'region':_0x47d9bf});_0x54c893[_0xbcff('0x66')]({'Bucket':_0xbe01fc,'Key':_0x3ef38b,'Body':_0x2ec51f},function(_0x2bc710,_0x1418b1){if(_0x2bc710){return _0x202d38(_0x2bc710);}else{return _0x48b623(_0x1418b1);}});});}function startTranscribe(_0x4a9cc7,_0x452a69,_0x5a953e,_0x97553e,_0x1d2bd0,_0x54ccf4){return new Promise(function(_0x35244e,_0x5c39f7){var _0x532aca=new AWS['TranscribeService']({'accessKeyId':_0x452a69,'secretAccessKey':_0x4a9cc7,'region':_0x5a953e});_0x532aca[_0xbcff('0x67')]({'TranscriptionJobName':_0x97553e,'LanguageCode':_0x1d2bd0,'Media':{'MediaFileUri':_0x54ccf4}},function(_0xf72bf1,_0xf50169){if(_0xf72bf1){return _0x5c39f7(_0xf72bf1);}else{return _0x35244e(_0xf50169);}});});}function transcribe(_0x119ac4,_0x51c653,_0x1a75b2,_0x3296af,_0x42f366,_0x50aa19,_0x251abe){return new Promise(function(_0x1212d8,_0x4b3929){var _0x4a1f41={};logger[_0xbcff('0x60')](util[_0xbcff('0x4b')](_0xbcff('0x68'),_0x119ac4,_0x42f366));return uploadFile(_0x51c653,_0x1a75b2,_0x3296af,_0x42f366,path[_0xbcff('0x69')](_0x50aa19),fs['readFileSync'](_0x50aa19))[_0xbcff('0x1e')](function(_0xbb721c){logger['info'](util[_0xbcff('0x4b')](_0xbcff('0x6a'),_0x119ac4,_0x42f366,_0xbb721c[_0xbcff('0x6b')]));_0x4a1f41[_0xbcff('0x6c')]=_0xbb721c[_0xbcff('0x6d')];_0x4a1f41[_0xbcff('0x6e')]=_0xbb721c[_0xbcff('0x6b')];logger[_0xbcff('0x60')](util[_0xbcff('0x4b')](_0xbcff('0x6f'),_0x119ac4));return startTranscribe(_0x51c653,_0x1a75b2,_0x3296af,uuidv4(),_0x251abe,_0xbb721c[_0xbcff('0x6b')]);})[_0xbcff('0x1e')](function(_0x59332b){logger[_0xbcff('0x60')](util[_0xbcff('0x4b')](_0xbcff('0x70'),_0x119ac4,_0x59332b[_0xbcff('0x71')]['TranscriptionJobName']));_0x4a1f41[_0xbcff('0x72')]=_0x59332b[_0xbcff('0x71')][_0xbcff('0x73')];_0x4a1f41[_0xbcff('0x74')]=_0x59332b[_0xbcff('0x71')][_0xbcff('0x75')];return _0x1212d8(_0x4a1f41);})[_0xbcff('0x40')](function(_0x25f2a5){return _0x4b3929(_0x25f2a5);});});}exports[_0xbcff('0x76')]=function(_0x167c47,_0x2afc28,_0xcfbf2a){var _0x4f7b33;var _0x19ab82;var _0x319ef5;var _0x3e9d1c=require(_0xbcff('0x48'));return db[_0xbcff('0x25')][_0xbcff('0x77')]({'where':{'id':_0x167c47[_0xbcff('0x42')]['id']}})[_0xbcff('0x1e')](function(_0x52a718){if(_0x52a718){var _0x1e7070=util[_0xbcff('0x4b')](_0xbcff('0x4c'),_0x52a718[_0xbcff('0x4a')]);if(fs[_0xbcff('0x4d')](_0x1e7070)){cypher=!![];return _0x3e9d1c[_0xbcff('0x4e')](_0x1e7070,_0x52a718[_0xbcff('0x4a')],config[_0xbcff('0x5c')][_0xbcff('0x4f')])[_0xbcff('0x1e')](function(){return _0x52a718;});}return _0x52a718;}})[_0xbcff('0x1e')](function(_0x4d41a1){if(!_0x4d41a1){throw new db[(_0xbcff('0x50'))][(_0xbcff('0x51'))]('Voice\x20Recording\x20not\x20found');}_0x19ab82=_0x4d41a1;return db[_0xbcff('0x78')][_0xbcff('0x77')]({'where':{'id':0x1}});})[_0xbcff('0x1e')](handleEntityNotFound(_0x2afc28,null))[_0xbcff('0x1e')](function(_0x16b9e0){if(_0x16b9e0){_0x4f7b33=_0x16b9e0;if(!_0x4f7b33[_0xbcff('0x79')]||!_0x4f7b33['transcribeAccountId']||!_0x4f7b33[_0xbcff('0x7a')]||!_0x4f7b33[_0xbcff('0x7b')]||!_0x4f7b33[_0xbcff('0x6c')]){throw new db[(_0xbcff('0x50'))][(_0xbcff('0x51'))]('Transcribe\x20not\x20configured');}if(_0x167c47[_0xbcff('0x45')][_0xbcff('0x7c')]&&(!_0x4f7b33[_0xbcff('0x7d')]||!_0x4f7b33[_0xbcff('0x7e')]||!_0x4f7b33[_0xbcff('0x7f')]||!_0x4f7b33[_0xbcff('0x7b')]||!_0x4f7b33['bucket'])){throw new db['Sequelize']['ValidationError'](_0xbcff('0x80'));}return db[_0xbcff('0x81')][_0xbcff('0x77')]({'where':{'id':_0x4f7b33[_0xbcff('0x82')]}});}})[_0xbcff('0x1e')](function(_0x4cfae7){if(!_0x4cfae7){throw new db[(_0xbcff('0x50'))]['ValidationError'](_0xbcff('0x83'));}if(!_0x4cfae7[_0xbcff('0x84')]||!_0x4cfae7[_0xbcff('0x85')]){throw new db[(_0xbcff('0x50'))][(_0xbcff('0x51'))]('Cloud\x20Provider\x20not\x20configured');}_0x319ef5=_0x4cfae7;return getBucketslist(_0x319ef5[_0xbcff('0x84')],_0x319ef5[_0xbcff('0x85')],_0x4f7b33[_0xbcff('0x7a')]);})[_0xbcff('0x1e')](function(_0x306cee){if(_0x306cee&&_0x306cee[_0xbcff('0x86')]){var _0x51a37c=_['find'](_0x306cee[_0xbcff('0x86')],function(_0x4e4fe0){return _0x4e4fe0[_0xbcff('0x87')]===_0x4f7b33['bucket'];});if(!_0x51a37c){logger[_0xbcff('0x60')](util[_0xbcff('0x4b')](_0xbcff('0x88'),_0x167c47[_0xbcff('0x42')]['id'],_0x4f7b33[_0xbcff('0x6c')]));return createBucket(_0x319ef5['data1'],_0x319ef5['data2'],_0x4f7b33[_0xbcff('0x7a')],_0x4f7b33[_0xbcff('0x6c')]);}logger[_0xbcff('0x60')](util[_0xbcff('0x4b')](_0xbcff('0x89'),_0x167c47['params']['id'],_0x4f7b33[_0xbcff('0x6c')]));return;}})[_0xbcff('0x1e')](function(_0x34df85){if(_0x19ab82[_0xbcff('0x74')]===_0xbcff('0x8a')){return transcribe(_0x167c47[_0xbcff('0x42')]['id'],_0x319ef5[_0xbcff('0x84')],_0x319ef5['data2'],_0x4f7b33['transcribeRegion'],_0x4f7b33['bucket'],_0x19ab82[_0xbcff('0x4a')],_0x4f7b33[_0xbcff('0x7b')]);}else{logger[_0xbcff('0x60')](util[_0xbcff('0x4b')](_0xbcff('0x8b'),_0x167c47[_0xbcff('0x42')]['id']));return{'transcribeStatus':_0xbcff('0x8c')};}})[_0xbcff('0x1e')](function(_0x5933bf){if(_0x5933bf){_0x5933bf[_0xbcff('0x8d')]=_0x167c47[_0xbcff('0x45')][_0xbcff('0x7c')];return _0x19ab82[_0xbcff('0x8e')](_0x5933bf);}})[_0xbcff('0x1e')](respondWithResult(_0x2afc28,null))[_0xbcff('0x40')](handleError(_0x2afc28,null));};function writeFile(_0x352024,_0x136948){return new Promise(function(_0x218d29,_0x4adbe1){fs[_0xbcff('0x8f')](_0x136948,_0x352024,function(_0x59e0d8,_0x54ff8a){if(_0x59e0d8){return _0x4adbe1(_0x59e0d8);}else{return _0x218d29(_0x54ff8a);}});});}exports[_0xbcff('0x90')]=function(_0x187e6f,_0x35fb73,_0x3c2654){return db[_0xbcff('0x25')][_0xbcff('0x77')]({'where':{'id':_0x187e6f[_0xbcff('0x42')]['id']}})[_0xbcff('0x1e')](handleEntityNotFound(_0x35fb73))['then'](function(_0xd90593){if(_0xd90593&&_0xd90593[_0xbcff('0x91')]){var _0x3f2496=_0xd90593[_0xbcff('0x91')];var _0x56f2af=config[_0xbcff('0x92')]+_0xbcff('0x93')+_0xd90593['id']+_0xbcff('0x94');if(fs[_0xbcff('0x4d')](_0x56f2af)){return _0x56f2af;}return writeFile(_0x3f2496,_0x56f2af)[_0xbcff('0x1e')](function(){return _0x56f2af;});}else{throw new db[(_0xbcff('0x50'))]['ValidationError'](_0xbcff('0x95'));}})['then'](function(_0x5ac83d){return _0x35fb73['download'](_0x5ac83d);})['catch'](handleError(_0x35fb73));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 60b1654..ac6e5a4 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 _0x6953=['./voiceRecording.attributes','exports','VoiceRecording','uniqueid','transcribeStatus'];(function(_0x379640,_0x5b857b){var _0x4733f5=function(_0x3704a0){while(--_0x3704a0){_0x379640['push'](_0x379640['shift']());}};_0x4733f5(++_0x5b857b);}(_0x6953,0x91));var _0x3695=function(_0x3758a1,_0x3934dc){_0x3758a1=_0x3758a1-0x0;var _0x51306f=_0x6953[_0x3758a1];return _0x51306f;};'use strict';var attributes=require(_0x3695('0x0'));module[_0x3695('0x1')]=function(_0x4f40b5,_0x56a828){return _0x4f40b5['define'](_0x3695('0x2'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x3695('0x3'),'fields':[_0x3695('0x3')]},{'name':_0x3695('0x4'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9a19=['voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording'];(function(_0x16eb11,_0x1a2251){var _0x3ae7ef=function(_0x575a01){while(--_0x575a01){_0x16eb11['push'](_0x16eb11['shift']());}};_0x3ae7ef(++_0x1a2251);}(_0x9a19,0x114));var _0x99a1=function(_0x5581ba,_0x268887){_0x5581ba=_0x5581ba-0x0;var _0x1e927f=_0x9a19[_0x5581ba];return _0x1e927f;};'use strict';var attributes=require(_0x99a1('0x0'));module[_0x99a1('0x1')]=function(_0x3d860b,_0x51ef2b){return _0x3d860b[_0x99a1('0x2')](_0x99a1('0x3'),attributes,{'tableName':_0x99a1('0x4'),'paranoid':![],'indexes':[{'name':_0x99a1('0x5'),'fields':[_0x99a1('0x5')]},{'name':_0x99a1('0x6'),'fields':[_0x99a1('0x6')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 453ddfc..0915bc7 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 _0x4325=['attributes','CreateVoiceRecording','Setting','findOne','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where'];(function(_0x2b76de,_0x2c174c){var _0x4bbf3e=function(_0x422977){while(--_0x422977){_0x2b76de['push'](_0x2b76de['shift']());}};_0x4bbf3e(++_0x2c174c);}(_0x4325,0x1da));var _0x5432=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4325[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var moment=require('moment');var BPromise=require(_0x5432('0x2'));var rs=require(_0x5432('0x3'));var fs=require('fs');var Redis=require(_0x5432('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5432('0x5'))(_0x5432('0x6'));var config=require(_0x5432('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5432('0x8')][_0x5432('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a6e76,_0x106ec9,_0x50394d){return new BPromise(function(_0xc8252e,_0x1c9762){return client[_0x5432('0xa')](_0x4a6e76,_0x50394d)[_0x5432('0xb')](function(_0x263a0c){logger['info'](_0x5432('0xc'),_0x106ec9,'request\x20sent');logger[_0x5432('0xd')](_0x5432('0xe'),_0x106ec9,_0x5432('0xf'),JSON[_0x5432('0x10')](_0x263a0c));if(_0x263a0c['error']){if(_0x263a0c['error'][_0x5432('0x11')]===0x1f4){logger[_0x5432('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x106ec9,_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);return _0x1c9762(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x263a0c['error']['message']);return _0xc8252e(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}else{logger[_0x5432('0x14')](_0x5432('0xc'),_0x106ec9,_0x5432('0xf'));_0xc8252e(_0x263a0c[_0x5432('0x15')]['message']);}})[_0x5432('0x16')](function(_0x49e8fd){logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x49e8fd);_0x1c9762(_0x49e8fd);});});}exports[_0x5432('0x17')]=function(_0x32fe60){var _0x4221a8=this;return new Promise(function(_0x5f011f,_0x3f3873){return db[_0x5432('0x18')][_0x5432('0x19')](_0x32fe60[_0x5432('0x1a')],{'raw':_0x32fe60[_0x5432('0x1b')]?_0x32fe60[_0x5432('0x1b')][_0x5432('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32fe60['options']?_0x32fe60[_0x5432('0x1b')][_0x5432('0x1d')]||null:null,'attributes':_0x32fe60[_0x5432('0x1b')]?_0x32fe60[_0x5432('0x1b')][_0x5432('0x1e')]||null:null,'limit':_0x32fe60['options']?_0x32fe60['options']['limit']||null:null})[_0x5432('0xb')](function(_0xb900f2){logger[_0x5432('0x14')](_0x5432('0x17'),_0x32fe60);logger['debug']('UpdateVoiceRecording',_0x32fe60,JSON[_0x5432('0x10')](_0xb900f2));_0x5f011f(_0xb900f2);})[_0x5432('0x16')](function(_0x4a40fc){logger[_0x5432('0x12')](_0x5432('0x17'),_0x4a40fc[_0x5432('0x13')],_0x32fe60);_0x3f3873(_0x4221a8['error'](0x1f4,_0x4a40fc[_0x5432('0x13')]));});});};exports[_0x5432('0x1f')]=function(_0xe7eda2){var _0x520da1=this;return new Promise(function(_0x4ab09d,_0x1f2055){var _0x2114b8=require('../../components/encryptor');var _0x1abe73;return db[_0x5432('0x20')][_0x5432('0x21')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5432('0xb')](function(_0x5be867){_0x1abe73=_0x5be867;return db['VoiceRecording'][_0x5432('0x22')](_0xe7eda2['body']);})[_0x5432('0xb')](function(_0x578281){if(_0x1abe73['callRecordingEncryption']&&fs[_0x5432('0x23')](_0x578281[_0x5432('0x24')])){var _0x345b51=util['format'](_0x5432('0x25'),_0x578281[_0x5432('0x24')]);return _0x2114b8[_0x5432('0x26')](_0x578281[_0x5432('0x24')],_0x345b51,config[_0x5432('0x27')][_0x5432('0x28')])[_0x5432('0xb')](function(){fs[_0x5432('0x29')](_0x578281[_0x5432('0x24')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x578281;});}return _0x578281;})[_0x5432('0xb')](function(_0x42ab1e){logger[_0x5432('0x14')](_0x5432('0x1f'),_0xe7eda2);logger[_0x5432('0xd')]('CreateVoiceRecording',_0xe7eda2,JSON[_0x5432('0x10')](_0x42ab1e));_0x4ab09d(_0x42ab1e);})['catch'](function(_0x2955e0){logger[_0x5432('0x12')](_0x5432('0x1f'),_0x2955e0[_0x5432('0x13')],_0xe7eda2);_0x1f2055(_0x520da1[_0x5432('0x12')](0x1f4,_0x2955e0[_0x5432('0x13')]));});});}; \ No newline at end of file +var _0xef0f=['CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','body','value','%s.cypher','unlink','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','attributes'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0xef0f,0x168));var _0xfef0=function(_0x84f0b5,_0x151f34){_0x84f0b5=_0x84f0b5-0x0;var _0x2e6958=_0xef0f[_0x84f0b5];return _0x2e6958;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('VoiceRecording,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});}exports[_0xfef0('0x18')]=function(_0x581459){var _0xd60678=this;return new Promise(function(_0x1642cd,_0x1577fa){return db[_0xfef0('0x19')][_0xfef0('0x1a')](_0x581459['body'],{'raw':_0x581459[_0xfef0('0x1b')]?_0x581459['options'][_0xfef0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x581459[_0xfef0('0x1b')]?_0x581459[_0xfef0('0x1b')]['where']||null:null,'attributes':_0x581459[_0xfef0('0x1b')]?_0x581459['options'][_0xfef0('0x1d')]||null:null,'limit':_0x581459[_0xfef0('0x1b')]?_0x581459['options']['limit']||null:null})['then'](function(_0x19fde8){logger['info'](_0xfef0('0x18'),_0x581459);logger[_0xfef0('0x10')](_0xfef0('0x18'),_0x581459,JSON[_0xfef0('0x12')](_0x19fde8));_0x1642cd(_0x19fde8);})[_0xfef0('0x17')](function(_0xd687ed){logger['error']('UpdateVoiceRecording',_0xd687ed[_0xfef0('0x15')],_0x581459);_0x1577fa(_0xd60678[_0xfef0('0x13')](0x1f4,_0xd687ed[_0xfef0('0x15')]));});});};exports[_0xfef0('0x1e')]=function(_0xab231c){var _0xf60f2=this;return new Promise(function(_0x5df04f,_0x168b98){var _0x391279=require('../../components/encryptor');var _0x1a6758;return db[_0xfef0('0x1f')][_0xfef0('0x20')]({'attributes':['id',_0xfef0('0x21')],'where':{'id':0x1},'raw':!![]})[_0xfef0('0xc')](function(_0x1ac4a3){_0x1a6758=_0x1ac4a3;return db[_0xfef0('0x19')][_0xfef0('0x22')](_0xab231c[_0xfef0('0x23')]);})[_0xfef0('0xc')](function(_0x3ee42f){if(_0x1a6758[_0xfef0('0x21')]&&fs['existsSync'](_0x3ee42f[_0xfef0('0x24')])){var _0x5806bd=util['format'](_0xfef0('0x25'),_0x3ee42f[_0xfef0('0x24')]);return _0x391279['encryptFile'](_0x3ee42f['value'],_0x5806bd,config['secrets']['recording'])['then'](function(){fs[_0xfef0('0x26')](_0x3ee42f[_0xfef0('0x24')]);logger[_0xfef0('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x3ee42f;});}return _0x3ee42f;})['then'](function(_0x50430e){logger[_0xfef0('0xd')]('CreateVoiceRecording',_0xab231c);logger[_0xfef0('0x10')](_0xfef0('0x1e'),_0xab231c,JSON[_0xfef0('0x12')](_0x50430e));_0x5df04f(_0x50430e);})['catch'](function(_0x3cad13){logger['error'](_0xfef0('0x1e'),_0x3cad13[_0xfef0('0x15')],_0xab231c);_0x168b98(_0xf60f2[_0xfef0('0x13')](0x1f4,_0x3cad13[_0xfef0('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index abf64e2..54cafb3 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 _0x9cdf=['../../config/environment','index','get','/describe','isAuthenticated','describe','show','post','put','update','/:id','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x193d47,_0x272136){var _0x4a5632=function(_0x122e62){while(--_0x122e62){_0x193d47['push'](_0x193d47['shift']());}};_0x4a5632(++_0x272136);}(_0x9cdf,0x117));var _0xf9cd=function(_0x11dce1,_0x47613b){_0x11dce1=_0x11dce1-0x0;var _0x1f2862=_0x9cdf[_0x11dce1];return _0x1f2862;};'use strict';var multer=require(_0xf9cd('0x0'));var util=require('util');var path=require(_0xf9cd('0x1'));var timeout=require('connect-timeout');var express=require(_0xf9cd('0x2'));var router=express[_0xf9cd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf9cd('0x4'));var interaction=require(_0xf9cd('0x5'));var config=require(_0xf9cd('0x6'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf9cd('0x7')]);router[_0xf9cd('0x8')](_0xf9cd('0x9'),auth[_0xf9cd('0xa')](),controller[_0xf9cd('0xb')]);router[_0xf9cd('0x8')]('/:id',auth[_0xf9cd('0xa')](),controller[_0xf9cd('0xc')]);router[_0xf9cd('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf9cd('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf9cd('0xf')]);router['delete'](_0xf9cd('0x10'),auth['isAuthenticated'](),controller[_0xf9cd('0x11')]);module[_0xf9cd('0x12')]=router; \ No newline at end of file +var _0x2c7d=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','post','create','put','update'];(function(_0x4f4de2,_0x257b5d){var _0x1cbf3a=function(_0x68163){while(--_0x68163){_0x4f4de2['push'](_0x4f4de2['shift']());}};_0x1cbf3a(++_0x257b5d);}(_0x2c7d,0x11f));var _0xd2c7=function(_0x370874,_0x2ae4ab){_0x370874=_0x370874-0x0;var _0x1748c0=_0x2c7d[_0x370874];return _0x1748c0;};'use strict';var multer=require(_0xd2c7('0x0'));var util=require('util');var path=require(_0xd2c7('0x1'));var timeout=require(_0xd2c7('0x2'));var express=require(_0xd2c7('0x3'));var router=express[_0xd2c7('0x4')]();var fs_extra=require(_0xd2c7('0x5'));var auth=require(_0xd2c7('0x6'));var interaction=require(_0xd2c7('0x7'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router[_0xd2c7('0x8')]('/',auth[_0xd2c7('0x9')](),controller[_0xd2c7('0xa')]);router[_0xd2c7('0x8')](_0xd2c7('0xb'),auth[_0xd2c7('0x9')](),controller['describe']);router[_0xd2c7('0x8')](_0xd2c7('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd2c7('0xd')]('/',auth[_0xd2c7('0x9')](),controller[_0xd2c7('0xe')]);router[_0xd2c7('0xf')](_0xd2c7('0xc'),auth[_0xd2c7('0x9')](),controller[_0xd2c7('0x10')]);router['delete'](_0xd2c7('0xc'),auth[_0xd2c7('0x9')](),controller[_0xd2c7('0x11')]);module[_0xd2c7('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 1532b07..5d61985 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 _0xfa2c=['Yes','sequelize','moment','exports','ENUM','attended','STRING'];(function(_0x55701e,_0x25167e){var _0x409cf9=function(_0x31f1c4){while(--_0x31f1c4){_0x55701e['push'](_0x55701e['shift']());}};_0x409cf9(++_0x25167e);}(_0xfa2c,0x135));var _0xcfa2=function(_0x380192,_0x2764e5){_0x380192=_0x380192-0x0;var _0x22fae4=_0xfa2c[_0x380192];return _0x22fae4;};'use strict';var Sequelize=require(_0xcfa2('0x0'));var moment=require(_0xcfa2('0x1'));module[_0xcfa2('0x2')]={'type':{'type':Sequelize[_0xcfa2('0x3')]('blind',_0xcfa2('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xcfa2('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xcfa2('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xcfa2('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xcfa2('0x5')]},'transfererexten':{'type':Sequelize[_0xcfa2('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xcfa2('0x5')]},'transfereechannel':{'type':Sequelize[_0xcfa2('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xcfa2('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xcfa2('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xcfa2('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0xcfa2('0x5')]},'isexternal':{'type':Sequelize[_0xcfa2('0x3')](_0xcfa2('0x6'),'No')},'context':{'type':Sequelize[_0xcfa2('0x5')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa7fc=['Yes','moment','ENUM','blind','attended','STRING'];(function(_0x305eb6,_0x2d6ec2){var _0x455adb=function(_0x1c0ae9){while(--_0x1c0ae9){_0x305eb6['push'](_0x305eb6['shift']());}};_0x455adb(++_0x2d6ec2);}(_0xa7fc,0xb5));var _0xca7f=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0xa7fc[_0x4f5108];return _0x2d56ca;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xca7f('0x0'));module['exports']={'type':{'type':Sequelize[_0xca7f('0x1')](_0xca7f('0x2'),_0xca7f('0x3'))},'result':{'type':Sequelize[_0xca7f('0x4')]},'transfererchannel':{'type':Sequelize[_0xca7f('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xca7f('0x4')]},'transferercalleridname':{'type':Sequelize[_0xca7f('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xca7f('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xca7f('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xca7f('0x4')]},'transfererexten':{'type':Sequelize[_0xca7f('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xca7f('0x4')]},'transfereechannel':{'type':Sequelize[_0xca7f('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xca7f('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xca7f('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xca7f('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xca7f('0x4')]},'transfereecontext':{'type':Sequelize[_0xca7f('0x4')]},'transfereeexten':{'type':Sequelize[_0xca7f('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xca7f('0x4')]},'isexternal':{'type':Sequelize[_0xca7f('0x1')](_0xca7f('0x5'),'No')},'context':{'type':Sequelize[_0xca7f('0x4')]},'extension':{'type':Sequelize[_0xca7f('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 9832ecd..0d5ee36 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 _0x0a4d=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','attributes','fields','length','nolimit','order','where','pick','filter','merge','options','VoiceTransferReport','include','findAll','rows','show','params','keys','intersection','includeAll','create','body','catch','find','destroy','describe','rimraf','fast-json-patch','moment','bluebird'];(function(_0x5929e8,_0x5e6795){var _0x2c48f3=function(_0x2e40fc){while(--_0x2e40fc){_0x5929e8['push'](_0x5929e8['shift']());}};_0x2c48f3(++_0x5e6795);}(_0x0a4d,0x138));var _0xd0a4=function(_0x44df86,_0x3a532c){_0x44df86=_0x44df86-0x0;var _0x1f4bf2=_0x0a4d[_0x44df86];return _0x1f4bf2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0a4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd0a4('0x1'));var rp=require('request-promise');var moment=require(_0xd0a4('0x2'));var BPromise=require(_0xd0a4('0x3'));var Mustache=require(_0xd0a4('0x4'));var util=require(_0xd0a4('0x5'));var path=require(_0xd0a4('0x6'));var sox=require(_0xd0a4('0x7'));var csv=require(_0xd0a4('0x8'));var ejs=require(_0xd0a4('0x9'));var fs=require('fs');var fs_extra=require(_0xd0a4('0xa'));var _=require(_0xd0a4('0xb'));var squel=require(_0xd0a4('0xc'));var crypto=require(_0xd0a4('0xd'));var jsforce=require(_0xd0a4('0xe'));var deskjs=require(_0xd0a4('0xf'));var toCsv=require(_0xd0a4('0x8'));var querystring=require(_0xd0a4('0x10'));var Papa=require(_0xd0a4('0x11'));var Redis=require(_0xd0a4('0x12'));var authService=require(_0xd0a4('0x13'));var qs=require(_0xd0a4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0a4('0x15'));var logger=require(_0xd0a4('0x16'))(_0xd0a4('0x17'));var utils=require(_0xd0a4('0x18'));var config=require(_0xd0a4('0x19'));var licenseUtil=require(_0xd0a4('0x1a'));var db=require(_0xd0a4('0x1b'))['db'];function respondWithStatusCode(_0xe7ad2d,_0x582d10){_0x582d10=_0x582d10||0xcc;return function(_0x1309cd){if(_0x1309cd){return _0xe7ad2d[_0xd0a4('0x1c')](_0x582d10);}return _0xe7ad2d[_0xd0a4('0x1d')](_0x582d10)[_0xd0a4('0x1e')]();};}function respondWithResult(_0x328704,_0x42e679){_0x42e679=_0x42e679||0xc8;return function(_0xd37166){if(_0xd37166){return _0x328704['status'](_0x42e679)[_0xd0a4('0x1f')](_0xd37166);}};}function respondWithFilteredResult(_0x33d519,_0x1c9246){return function(_0x96a05c){if(_0x96a05c){var _0x445e78=typeof _0x1c9246[_0xd0a4('0x20')]===_0xd0a4('0x21')&&typeof _0x1c9246[_0xd0a4('0x22')]===_0xd0a4('0x21');var _0x25d11e=_0x96a05c[_0xd0a4('0x23')];var _0x15f655=_0x445e78?0x0:_0x1c9246['offset'];var _0x2546d9=_0x445e78?_0x96a05c[_0xd0a4('0x23')]:_0x1c9246[_0xd0a4('0x20')]+_0x1c9246[_0xd0a4('0x22')];var _0x7ced3c;if(_0x2546d9>=_0x25d11e){_0x2546d9=_0x25d11e;_0x7ced3c=0xc8;}else{_0x7ced3c=0xce;}_0x33d519[_0xd0a4('0x1d')](_0x7ced3c);return _0x33d519[_0xd0a4('0x24')](_0xd0a4('0x25'),_0x15f655+'-'+_0x2546d9+'/'+_0x25d11e)['json'](_0x96a05c);}return null;};}function patchUpdates(_0x5200ca){return function(_0x3fcb88){try{jsonpatch[_0xd0a4('0x26')](_0x3fcb88,_0x5200ca,!![]);}catch(_0x1cebd6){return BPromise[_0xd0a4('0x27')](_0x1cebd6);}return _0x3fcb88[_0xd0a4('0x28')]();};}function saveUpdates(_0x549002,_0x5b6a19){return function(_0x5b7420){if(_0x5b7420){return _0x5b7420[_0xd0a4('0x29')](_0x549002)[_0xd0a4('0x2a')](function(_0x17b384){return _0x17b384;});}return null;};}function removeEntity(_0x3db7a7,_0x3e5a42){return function(_0x33d6ed){if(_0x33d6ed){return _0x33d6ed['destroy']()[_0xd0a4('0x2a')](function(){_0x3db7a7[_0xd0a4('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x491b95,_0x44189a){return function(_0x127181){if(!_0x127181){_0x491b95[_0xd0a4('0x1c')](0x194);}return _0x127181;};}function handleError(_0x545f8d,_0x177aea){_0x177aea=_0x177aea||0x1f4;return function(_0x466539){logger['error'](_0x466539[_0xd0a4('0x2b')]);if(_0x466539[_0xd0a4('0x2c')]){delete _0x466539[_0xd0a4('0x2c')];}_0x545f8d[_0xd0a4('0x1d')](_0x177aea)[_0xd0a4('0x2d')](_0x466539);};}exports[_0xd0a4('0x2e')]=function(_0x4f6ffc,_0xffdfab){var _0xf6bac9={},_0x579dd0={},_0x59bb89={'count':0x0,'rows':[]};var _0x50210c=_['map'](db['VoiceTransferReport'][_0xd0a4('0x2f')],function(_0x2df196){return{'name':_0x2df196['fieldName'],'type':_0x2df196[_0xd0a4('0x30')][_0xd0a4('0x31')]};});_0x579dd0[_0xd0a4('0x32')]=_[_0xd0a4('0x33')](_0x50210c,_0xd0a4('0x2c'));_0x579dd0['query']=_['keys'](_0x4f6ffc[_0xd0a4('0x34')]);_0x579dd0[_0xd0a4('0x35')]=_['intersection'](_0x579dd0[_0xd0a4('0x32')],_0x579dd0[_0xd0a4('0x34')]);_0xf6bac9[_0xd0a4('0x36')]=_['intersection'](_0x579dd0[_0xd0a4('0x32')],qs[_0xd0a4('0x37')](_0x4f6ffc[_0xd0a4('0x34')][_0xd0a4('0x37')]));_0xf6bac9[_0xd0a4('0x36')]=_0xf6bac9[_0xd0a4('0x36')][_0xd0a4('0x38')]?_0xf6bac9[_0xd0a4('0x36')]:_0x579dd0[_0xd0a4('0x32')];if(!_0x4f6ffc[_0xd0a4('0x34')]['hasOwnProperty'](_0xd0a4('0x39'))){_0xf6bac9[_0xd0a4('0x22')]=qs['limit'](_0x4f6ffc['query'][_0xd0a4('0x22')]);_0xf6bac9[_0xd0a4('0x20')]=qs['offset'](_0x4f6ffc['query'][_0xd0a4('0x20')]);}_0xf6bac9[_0xd0a4('0x3a')]=qs['sort'](_0x4f6ffc[_0xd0a4('0x34')]['sort']);_0xf6bac9[_0xd0a4('0x3b')]=qs[_0xd0a4('0x35')](_[_0xd0a4('0x3c')](_0x4f6ffc[_0xd0a4('0x34')],_0x579dd0[_0xd0a4('0x35')]),_0x50210c);if(_0x4f6ffc[_0xd0a4('0x34')][_0xd0a4('0x3d')]){_0xf6bac9[_0xd0a4('0x3b')]=_[_0xd0a4('0x3e')](_0xf6bac9[_0xd0a4('0x3b')],{'$or':_[_0xd0a4('0x33')](_0x50210c,function(_0x535fa5){if(_0x535fa5[_0xd0a4('0x30')]!=='VIRTUAL'){var _0x3b1350={};_0x3b1350[_0x535fa5[_0xd0a4('0x2c')]]={'$like':'%'+_0x4f6ffc[_0xd0a4('0x34')][_0xd0a4('0x3d')]+'%'};return _0x3b1350;}})});}_0xf6bac9=_[_0xd0a4('0x3e')]({},_0xf6bac9,_0x4f6ffc[_0xd0a4('0x3f')]);var _0x55395a={'where':_0xf6bac9[_0xd0a4('0x3b')]};return db[_0xd0a4('0x40')][_0xd0a4('0x23')](_0x55395a)['then'](function(_0x192e00){_0x59bb89[_0xd0a4('0x23')]=_0x192e00;if(_0x4f6ffc[_0xd0a4('0x34')]['includeAll']){_0xf6bac9[_0xd0a4('0x41')]=[{'all':!![]}];}return db[_0xd0a4('0x40')][_0xd0a4('0x42')](_0xf6bac9);})['then'](function(_0x199e24){_0x59bb89[_0xd0a4('0x43')]=_0x199e24;return _0x59bb89;})[_0xd0a4('0x2a')](respondWithFilteredResult(_0xffdfab,_0xf6bac9))['catch'](handleError(_0xffdfab,null));};exports[_0xd0a4('0x44')]=function(_0x4a263a,_0x1189aa){var _0x52a766={'raw':!![],'where':{'id':_0x4a263a[_0xd0a4('0x45')]['id']}},_0x3e229b={};_0x3e229b[_0xd0a4('0x32')]=_['keys'](db['VoiceTransferReport'][_0xd0a4('0x2f')]);_0x3e229b['query']=_[_0xd0a4('0x46')](_0x4a263a['query']);_0x3e229b[_0xd0a4('0x35')]=_[_0xd0a4('0x47')](_0x3e229b[_0xd0a4('0x32')],_0x3e229b[_0xd0a4('0x34')]);_0x52a766[_0xd0a4('0x36')]=_[_0xd0a4('0x47')](_0x3e229b['model'],qs[_0xd0a4('0x37')](_0x4a263a[_0xd0a4('0x34')][_0xd0a4('0x37')]));_0x52a766[_0xd0a4('0x36')]=_0x52a766[_0xd0a4('0x36')]['length']?_0x52a766[_0xd0a4('0x36')]:_0x3e229b[_0xd0a4('0x32')];if(_0x4a263a['query'][_0xd0a4('0x48')]){_0x52a766[_0xd0a4('0x41')]=[{'all':!![]}];}_0x52a766=_[_0xd0a4('0x3e')]({},_0x52a766,_0x4a263a['options']);return db[_0xd0a4('0x40')]['find'](_0x52a766)[_0xd0a4('0x2a')](handleEntityNotFound(_0x1189aa,null))['then'](respondWithResult(_0x1189aa,null))['catch'](handleError(_0x1189aa,null));};exports['create']=function(_0x41d078,_0x5d2e09){return db['VoiceTransferReport'][_0xd0a4('0x49')](_0x41d078[_0xd0a4('0x4a')],{})[_0xd0a4('0x2a')](respondWithResult(_0x5d2e09,0xc9))[_0xd0a4('0x4b')](handleError(_0x5d2e09,null));};exports[_0xd0a4('0x29')]=function(_0x420ddd,_0x1fc4c2){if(_0x420ddd[_0xd0a4('0x4a')]['id']){delete _0x420ddd[_0xd0a4('0x4a')]['id'];}return db[_0xd0a4('0x40')][_0xd0a4('0x4c')]({'where':{'id':_0x420ddd['params']['id']}})[_0xd0a4('0x2a')](handleEntityNotFound(_0x1fc4c2,null))[_0xd0a4('0x2a')](saveUpdates(_0x420ddd[_0xd0a4('0x4a')],null))[_0xd0a4('0x2a')](respondWithResult(_0x1fc4c2,null))[_0xd0a4('0x4b')](handleError(_0x1fc4c2,null));};exports[_0xd0a4('0x4d')]=function(_0x5776ed,_0x213347){return db['VoiceTransferReport'][_0xd0a4('0x4c')]({'where':{'id':_0x5776ed[_0xd0a4('0x45')]['id']}})['then'](handleEntityNotFound(_0x213347,null))[_0xd0a4('0x2a')](removeEntity(_0x213347,null))['catch'](handleError(_0x213347,null));};exports[_0xd0a4('0x4e')]=function(_0x212199,_0x3b73f3){return db['VoiceTransferReport'][_0xd0a4('0x4e')]()[_0xd0a4('0x2a')](respondWithResult(_0x3b73f3,null))['catch'](handleError(_0x3b73f3,null));}; \ No newline at end of file +var _0x3416=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','save','update','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','key','model'];(function(_0x26fab0,_0x45e762){var _0x378971=function(_0x5cef9c){while(--_0x5cef9c){_0x26fab0['push'](_0x26fab0['shift']());}};_0x378971(++_0x45e762);}(_0x3416,0x68));var _0x6341=function(_0x1b25c1,_0x2c6ce6){_0x1b25c1=_0x1b25c1-0x0;var _0x1e4447=_0x3416[_0x1b25c1];return _0x1e4447;};'use strict';var emlformat=require(_0x6341('0x0'));var rimraf=require(_0x6341('0x1'));var zipdir=require(_0x6341('0x2'));var jsonpatch=require(_0x6341('0x3'));var rp=require(_0x6341('0x4'));var moment=require('moment');var BPromise=require(_0x6341('0x5'));var Mustache=require(_0x6341('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6341('0x7'));var csv=require(_0x6341('0x8'));var ejs=require(_0x6341('0x9'));var fs=require('fs');var fs_extra=require(_0x6341('0xa'));var _=require(_0x6341('0xb'));var squel=require(_0x6341('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6341('0xd'));var toCsv=require(_0x6341('0x8'));var querystring=require('querystring');var Papa=require(_0x6341('0xe'));var Redis=require(_0x6341('0xf'));var authService=require(_0x6341('0x10'));var qs=require(_0x6341('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6341('0x12'));var logger=require(_0x6341('0x13'))(_0x6341('0x14'));var utils=require(_0x6341('0x15'));var config=require(_0x6341('0x16'));var licenseUtil=require(_0x6341('0x17'));var db=require(_0x6341('0x18'))['db'];function respondWithStatusCode(_0x1fe7cc,_0x5dc3eb){_0x5dc3eb=_0x5dc3eb||0xcc;return function(_0x38e6d5){if(_0x38e6d5){return _0x1fe7cc[_0x6341('0x19')](_0x5dc3eb);}return _0x1fe7cc[_0x6341('0x1a')](_0x5dc3eb)[_0x6341('0x1b')]();};}function respondWithResult(_0x1635c2,_0x4a65aa){_0x4a65aa=_0x4a65aa||0xc8;return function(_0x2a86d8){if(_0x2a86d8){return _0x1635c2[_0x6341('0x1a')](_0x4a65aa)[_0x6341('0x1c')](_0x2a86d8);}};}function respondWithFilteredResult(_0x27ee12,_0x30770f){return function(_0x5ce78e){if(_0x5ce78e){var _0x37b724=typeof _0x30770f['offset']==='undefined'&&typeof _0x30770f[_0x6341('0x1d')]===_0x6341('0x1e');var _0x26bc52=_0x5ce78e[_0x6341('0x1f')];var _0x5d451c=_0x37b724?0x0:_0x30770f[_0x6341('0x20')];var _0x34ebf0=_0x37b724?_0x5ce78e[_0x6341('0x1f')]:_0x30770f[_0x6341('0x20')]+_0x30770f['limit'];var _0x3da9ac;if(_0x34ebf0>=_0x26bc52){_0x34ebf0=_0x26bc52;_0x3da9ac=0xc8;}else{_0x3da9ac=0xce;}_0x27ee12[_0x6341('0x1a')](_0x3da9ac);return _0x27ee12[_0x6341('0x21')]('Content-Range',_0x5d451c+'-'+_0x34ebf0+'/'+_0x26bc52)[_0x6341('0x1c')](_0x5ce78e);}return null;};}function patchUpdates(_0x31937f){return function(_0x57f4be){try{jsonpatch[_0x6341('0x22')](_0x57f4be,_0x31937f,!![]);}catch(_0x1a8569){return BPromise['reject'](_0x1a8569);}return _0x57f4be[_0x6341('0x23')]();};}function saveUpdates(_0x37801a,_0x5b90e3){return function(_0x1196b4){if(_0x1196b4){return _0x1196b4[_0x6341('0x24')](_0x37801a)[_0x6341('0x25')](function(_0x19738b){return _0x19738b;});}return null;};}function removeEntity(_0x595e4e,_0x4342b6){return function(_0x82d40d){if(_0x82d40d){return _0x82d40d[_0x6341('0x26')]()[_0x6341('0x25')](function(){_0x595e4e[_0x6341('0x1a')](0xcc)[_0x6341('0x1b')]();});}};}function handleEntityNotFound(_0x3ed840,_0x2b2899){return function(_0x52aef8){if(!_0x52aef8){_0x3ed840[_0x6341('0x19')](0x194);}return _0x52aef8;};}function handleError(_0x44caf0,_0xe0330d){_0xe0330d=_0xe0330d||0x1f4;return function(_0x4cb4f5){logger[_0x6341('0x27')](_0x4cb4f5[_0x6341('0x28')]);if(_0x4cb4f5[_0x6341('0x29')]){delete _0x4cb4f5[_0x6341('0x29')];}_0x44caf0[_0x6341('0x1a')](_0xe0330d)[_0x6341('0x2a')](_0x4cb4f5);};}exports[_0x6341('0x2b')]=function(_0x3bedd5,_0x171ba1){var _0x42616d={},_0x16b03d={},_0x26341e={'count':0x0,'rows':[]};var _0xc53802=_[_0x6341('0x2c')](db[_0x6341('0x2d')][_0x6341('0x2e')],function(_0x3a16ac){return{'name':_0x3a16ac[_0x6341('0x2f')],'type':_0x3a16ac['type'][_0x6341('0x30')]};});_0x16b03d[_0x6341('0x31')]=_[_0x6341('0x2c')](_0xc53802,'name');_0x16b03d[_0x6341('0x32')]=_[_0x6341('0x33')](_0x3bedd5[_0x6341('0x32')]);_0x16b03d[_0x6341('0x34')]=_[_0x6341('0x35')](_0x16b03d[_0x6341('0x31')],_0x16b03d[_0x6341('0x32')]);_0x42616d['attributes']=_[_0x6341('0x35')](_0x16b03d['model'],qs[_0x6341('0x36')](_0x3bedd5[_0x6341('0x32')][_0x6341('0x36')]));_0x42616d[_0x6341('0x37')]=_0x42616d[_0x6341('0x37')][_0x6341('0x38')]?_0x42616d[_0x6341('0x37')]:_0x16b03d[_0x6341('0x31')];if(!_0x3bedd5[_0x6341('0x32')][_0x6341('0x39')](_0x6341('0x3a'))){_0x42616d[_0x6341('0x1d')]=qs['limit'](_0x3bedd5[_0x6341('0x32')]['limit']);_0x42616d[_0x6341('0x20')]=qs[_0x6341('0x20')](_0x3bedd5[_0x6341('0x32')][_0x6341('0x20')]);}_0x42616d['order']=qs[_0x6341('0x3b')](_0x3bedd5[_0x6341('0x32')][_0x6341('0x3b')]);_0x42616d[_0x6341('0x3c')]=qs['filters'](_[_0x6341('0x3d')](_0x3bedd5['query'],_0x16b03d['filters']),_0xc53802);if(_0x3bedd5[_0x6341('0x32')][_0x6341('0x3e')]){_0x42616d[_0x6341('0x3c')]=_[_0x6341('0x3f')](_0x42616d[_0x6341('0x3c')],{'$or':_['map'](_0xc53802,function(_0x32e816){if(_0x32e816[_0x6341('0x40')]!==_0x6341('0x41')){var _0x563acf={};_0x563acf[_0x32e816[_0x6341('0x29')]]={'$like':'%'+_0x3bedd5[_0x6341('0x32')][_0x6341('0x3e')]+'%'};return _0x563acf;}})});}_0x42616d=_[_0x6341('0x3f')]({},_0x42616d,_0x3bedd5[_0x6341('0x42')]);var _0x30d990={'where':_0x42616d[_0x6341('0x3c')]};return db[_0x6341('0x2d')][_0x6341('0x1f')](_0x30d990)[_0x6341('0x25')](function(_0x4150b4){_0x26341e['count']=_0x4150b4;if(_0x3bedd5[_0x6341('0x32')][_0x6341('0x43')]){_0x42616d[_0x6341('0x44')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x6341('0x45')](_0x42616d);})['then'](function(_0x57cfa9){_0x26341e['rows']=_0x57cfa9;return _0x26341e;})[_0x6341('0x25')](respondWithFilteredResult(_0x171ba1,_0x42616d))[_0x6341('0x46')](handleError(_0x171ba1,null));};exports[_0x6341('0x47')]=function(_0x4a4e15,_0x5792be){var _0x31c3b8={'raw':!![],'where':{'id':_0x4a4e15['params']['id']}},_0x2bf2c8={};_0x2bf2c8[_0x6341('0x31')]=_[_0x6341('0x33')](db[_0x6341('0x2d')]['rawAttributes']);_0x2bf2c8[_0x6341('0x32')]=_[_0x6341('0x33')](_0x4a4e15[_0x6341('0x32')]);_0x2bf2c8[_0x6341('0x34')]=_['intersection'](_0x2bf2c8[_0x6341('0x31')],_0x2bf2c8['query']);_0x31c3b8[_0x6341('0x37')]=_[_0x6341('0x35')](_0x2bf2c8['model'],qs[_0x6341('0x36')](_0x4a4e15[_0x6341('0x32')][_0x6341('0x36')]));_0x31c3b8[_0x6341('0x37')]=_0x31c3b8['attributes'][_0x6341('0x38')]?_0x31c3b8['attributes']:_0x2bf2c8[_0x6341('0x31')];if(_0x4a4e15['query'][_0x6341('0x43')]){_0x31c3b8['include']=[{'all':!![]}];}_0x31c3b8=_[_0x6341('0x3f')]({},_0x31c3b8,_0x4a4e15[_0x6341('0x42')]);return db[_0x6341('0x2d')][_0x6341('0x48')](_0x31c3b8)[_0x6341('0x25')](handleEntityNotFound(_0x5792be,null))[_0x6341('0x25')](respondWithResult(_0x5792be,null))[_0x6341('0x46')](handleError(_0x5792be,null));};exports[_0x6341('0x49')]=function(_0x2922b6,_0x526cac){return db[_0x6341('0x2d')][_0x6341('0x49')](_0x2922b6[_0x6341('0x4a')],{})[_0x6341('0x25')](respondWithResult(_0x526cac,0xc9))['catch'](handleError(_0x526cac,null));};exports[_0x6341('0x24')]=function(_0x4ff48c,_0xd4532b){if(_0x4ff48c[_0x6341('0x4a')]['id']){delete _0x4ff48c[_0x6341('0x4a')]['id'];}return db['VoiceTransferReport'][_0x6341('0x48')]({'where':{'id':_0x4ff48c['params']['id']}})[_0x6341('0x25')](handleEntityNotFound(_0xd4532b,null))['then'](saveUpdates(_0x4ff48c[_0x6341('0x4a')],null))[_0x6341('0x25')](respondWithResult(_0xd4532b,null))[_0x6341('0x46')](handleError(_0xd4532b,null));};exports[_0x6341('0x26')]=function(_0x7160f,_0x336416){return db[_0x6341('0x2d')][_0x6341('0x48')]({'where':{'id':_0x7160f[_0x6341('0x4b')]['id']}})['then'](handleEntityNotFound(_0x336416,null))[_0x6341('0x25')](removeEntity(_0x336416,null))['catch'](handleError(_0x336416,null));};exports['describe']=function(_0x45ca19,_0x663f41){return db[_0x6341('0x2d')][_0x6341('0x4c')]()[_0x6341('0x25')](respondWithResult(_0x663f41,null))[_0x6341('0x46')](handleError(_0x663f41,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 56b7806..6ca0cf2 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 _0x275d=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x275d,0x1da));var _0xd275=function(_0x4480b9,_0x5c2949){_0x4480b9=_0x4480b9-0x0;var _0x3f0f02=_0x275d[_0x4480b9];return _0x3f0f02;};'use strict';var _=require(_0xd275('0x0'));var util=require(_0xd275('0x1'));var logger=require(_0xd275('0x2'))(_0xd275('0x3'));var moment=require('moment');var BPromise=require(_0xd275('0x4'));var rp=require(_0xd275('0x5'));var fs=require('fs');var path=require(_0xd275('0x6'));var rimraf=require(_0xd275('0x7'));var config=require(_0xd275('0x8'));var attributes=require(_0xd275('0x9'));module[_0xd275('0xa')]=function(_0x1b0338,_0x34c38c){return _0x1b0338[_0xd275('0xb')](_0xd275('0xc'),attributes,{'tableName':_0xd275('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8528=['../../config/environment','./voiceTransferReport.attributes','VoiceTransferReport','report_call_transfer','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1ad0c1,_0x2f5433){var _0x1b56ae=function(_0x44fcc2){while(--_0x44fcc2){_0x1ad0c1['push'](_0x1ad0c1['shift']());}};_0x1b56ae(++_0x2f5433);}(_0x8528,0x1d2));var _0x8852=function(_0xfa818,_0x53748f){_0xfa818=_0xfa818-0x0;var _0x1bb8d4=_0x8528[_0xfa818];return _0x1bb8d4;};'use strict';var _=require('lodash');var util=require(_0x8852('0x0'));var logger=require(_0x8852('0x1'))(_0x8852('0x2'));var moment=require(_0x8852('0x3'));var BPromise=require(_0x8852('0x4'));var rp=require(_0x8852('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8852('0x6'));var config=require(_0x8852('0x7'));var attributes=require(_0x8852('0x8'));module['exports']=function(_0xfd65,_0x35cfff){return _0xfd65['define'](_0x8852('0x9'),attributes,{'tableName':_0x8852('0xa'),'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 68b5ed5..021672d 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 _0x2189=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','util','moment'];(function(_0x66f73d,_0x2f3c76){var _0x5999d9=function(_0x1818c0){while(--_0x1818c0){_0x66f73d['push'](_0x66f73d['shift']());}};_0x5999d9(++_0x2f3c76);}(_0x2189,0x142));var _0x9218=function(_0x3cfa10,_0x2c0ddb){_0x3cfa10=_0x3cfa10-0x0;var _0x5dc234=_0x2189[_0x3cfa10];return _0x5dc234;};'use strict';var _=require('lodash');var util=require(_0x9218('0x0'));var moment=require(_0x9218('0x1'));var BPromise=require(_0x9218('0x2'));var rs=require(_0x9218('0x3'));var fs=require('fs');var Redis=require(_0x9218('0x4'));var db=require(_0x9218('0x5'))['db'];var utils=require(_0x9218('0x6'));var logger=require(_0x9218('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9218('0x8'));var client=jayson[_0x9218('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x301901,_0x5bc984,_0x57b636){return new BPromise(function(_0x7a9176,_0x571c58){return client[_0x9218('0xa')](_0x301901,_0x57b636)[_0x9218('0xb')](function(_0x258ee0){logger[_0x9218('0xc')](_0x9218('0xd'),_0x5bc984,_0x9218('0xe'));logger[_0x9218('0xf')](_0x9218('0x10'),_0x5bc984,_0x9218('0xe'),JSON[_0x9218('0x11')](_0x258ee0));if(_0x258ee0['error']){if(_0x258ee0['error']['code']===0x1f4){logger[_0x9218('0x12')](_0x9218('0xd'),_0x5bc984,_0x258ee0[_0x9218('0x12')]['message']);return _0x571c58(_0x258ee0['error']['message']);}logger[_0x9218('0x12')](_0x9218('0xd'),_0x5bc984,_0x258ee0['error'][_0x9218('0x13')]);return _0x7a9176(_0x258ee0['error']['message']);}else{logger[_0x9218('0xc')](_0x9218('0xd'),_0x5bc984,_0x9218('0xe'));_0x7a9176(_0x258ee0['result'][_0x9218('0x13')]);}})[_0x9218('0x14')](function(_0x298bdf){logger[_0x9218('0x12')](_0x9218('0xd'),_0x5bc984,_0x298bdf);_0x571c58(_0x298bdf);});});}exports[_0x9218('0x15')]=function(_0x167ea9){var _0x2406be=this;return new Promise(function(_0xc23e4a,_0x22bedd){return db[_0x9218('0x16')][_0x9218('0x17')](_0x167ea9[_0x9218('0x18')],{'raw':_0x167ea9[_0x9218('0x19')]?_0x167ea9[_0x9218('0x19')][_0x9218('0x1a')]===undefined?!![]:![]:!![]})[_0x9218('0xb')](function(_0x28176a){logger[_0x9218('0xc')](_0x9218('0x15'),_0x167ea9);logger[_0x9218('0xf')](_0x9218('0x15'),_0x167ea9,JSON[_0x9218('0x11')](_0x28176a));_0xc23e4a(_0x28176a);})['catch'](function(_0x3cb0ea){logger['error']('CreateVoiceTransferReport',_0x3cb0ea['message'],_0x167ea9);_0x22bedd(_0x2406be[_0x9218('0x12')](0x1f4,_0x3cb0ea[_0x9218('0x13')]));});});}; \ No newline at end of file +var _0xacb8=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','stringify','error','code','message','catch','VoiceTransferReport,\x20%s,\x20%s','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','then','info','lodash'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xacb8,0x1ca));var _0x8acb=function(_0x3b29cf,_0x171bc9){_0x3b29cf=_0x3b29cf-0x0;var _0x1dc73b=_0xacb8[_0x3b29cf];return _0x1dc73b;};'use strict';var _=require(_0x8acb('0x0'));var util=require(_0x8acb('0x1'));var moment=require(_0x8acb('0x2'));var BPromise=require(_0x8acb('0x3'));var rs=require(_0x8acb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8acb('0x5'));var logger=require(_0x8acb('0x6'))(_0x8acb('0x7'));var config=require(_0x8acb('0x8'));var jayson=require(_0x8acb('0x9'));var client=jayson[_0x8acb('0xa')][_0x8acb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53bbe2,_0x34ba79,_0x50bcb9){return new BPromise(function(_0x1aad1e,_0xd25d51){return client[_0x8acb('0xc')](_0x53bbe2,_0x50bcb9)['then'](function(_0x48cf3a){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x34ba79,_0x8acb('0xd'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x34ba79,'request\x20sent',JSON[_0x8acb('0xe')](_0x48cf3a));if(_0x48cf3a[_0x8acb('0xf')]){if(_0x48cf3a[_0x8acb('0xf')][_0x8acb('0x10')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x34ba79,_0x48cf3a[_0x8acb('0xf')][_0x8acb('0x11')]);return _0xd25d51(_0x48cf3a['error'][_0x8acb('0x11')]);}logger[_0x8acb('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x34ba79,_0x48cf3a[_0x8acb('0xf')]['message']);return _0x1aad1e(_0x48cf3a[_0x8acb('0xf')]['message']);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x34ba79,_0x8acb('0xd'));_0x1aad1e(_0x48cf3a['result'][_0x8acb('0x11')]);}})[_0x8acb('0x12')](function(_0x13ed67){logger['error'](_0x8acb('0x13'),_0x34ba79,_0x13ed67);_0xd25d51(_0x13ed67);});});}exports[_0x8acb('0x14')]=function(_0x2ecdcc){var _0x4d60e8=this;return new Promise(function(_0x1828e4,_0xd07e0b){return db[_0x8acb('0x15')][_0x8acb('0x16')](_0x2ecdcc['body'],{'raw':_0x2ecdcc[_0x8acb('0x17')]?_0x2ecdcc[_0x8acb('0x17')][_0x8acb('0x18')]===undefined?!![]:![]:!![]})[_0x8acb('0x19')](function(_0x3aae0f){logger[_0x8acb('0x1a')](_0x8acb('0x14'),_0x2ecdcc);logger['debug'](_0x8acb('0x14'),_0x2ecdcc,JSON[_0x8acb('0xe')](_0x3aae0f));_0x1828e4(_0x3aae0f);})[_0x8acb('0x12')](function(_0x48b714){logger[_0x8acb('0xf')](_0x8acb('0x14'),_0x48b714[_0x8acb('0x11')],_0x2ecdcc);_0xd07e0b(_0x4d60e8['error'](0x1f4,_0x48b714[_0x8acb('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 37e8689..67f11b5 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 _0xe14d=['hangup','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','originate','post','/hangup','isWebrtcLicence'];(function(_0x2d7116,_0x37bee1){var _0x522d5a=function(_0x34cba3){while(--_0x34cba3){_0x2d7116['push'](_0x2d7116['shift']());}};_0x522d5a(++_0x37bee1);}(_0xe14d,0x1ee));var _0xde14=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xe14d[_0xb0f7c3];return _0x28ea68;};'use strict';var express=require(_0xde14('0x0'));var router=express[_0xde14('0x1')]();var auth=require(_0xde14('0x2'));var controller=require(_0xde14('0x3'));router['post'](_0xde14('0x4'),auth[_0xde14('0x5')](),auth['isWebrtcLicence'](),controller[_0xde14('0x6')]);router[_0xde14('0x7')](_0xde14('0x8'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router['post']('/answer',auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xb')]);router[_0xde14('0x7')](_0xde14('0xc'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router['post'](_0xde14('0xe'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xf')]);router[_0xde14('0x7')](_0xde14('0x10'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x11')]);router[_0xde14('0x7')](_0xde14('0x12'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x13')]);module[_0xde14('0x14')]=router; \ No newline at end of file +var _0x91a7=['/originate','isWebrtcLicence','/hangup','isAuthenticated','hangup','/answer','answer','post','/hold','/unhold','unhold','/calls','/transfer','transfer','exports','Router','../../components/auth/service','./webbar.controller'];(function(_0x3891de,_0x55cfe5){var _0x521696=function(_0x1a8b8e){while(--_0x1a8b8e){_0x3891de['push'](_0x3891de['shift']());}};_0x521696(++_0x55cfe5);}(_0x91a7,0xe7));var _0x791a=function(_0x5a36c3,_0xc0a6a6){_0x5a36c3=_0x5a36c3-0x0;var _0xebca21=_0x91a7[_0x5a36c3];return _0xebca21;};'use strict';var express=require('express');var router=express[_0x791a('0x0')]();var auth=require(_0x791a('0x1'));var controller=require(_0x791a('0x2'));router['post'](_0x791a('0x3'),auth['isAuthenticated'](),auth[_0x791a('0x4')](),controller['originate']);router['post'](_0x791a('0x5'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x7')]);router['post'](_0x791a('0x8'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x9')]);router[_0x791a('0xa')](_0x791a('0xb'),auth[_0x791a('0x6')](),auth[_0x791a('0x4')](),controller['hold']);router[_0x791a('0xa')](_0x791a('0xc'),auth['isAuthenticated'](),auth[_0x791a('0x4')](),controller[_0x791a('0xd')]);router[_0x791a('0xa')](_0x791a('0xe'),auth[_0x791a('0x6')](),auth[_0x791a('0x4')](),controller['calls']);router['post'](_0x791a('0xf'),auth[_0x791a('0x6')](),auth['isWebrtcLicence'](),controller[_0x791a('0x10')]);module[_0x791a('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index e1cb828..b2ca0e9 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 _0x4746=['VoiceChannels','conference','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','path','lodash','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','ioredis','redis','localhost','socket.io-emitter','validate','number','string','userId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','then','code','message','catch','User','all','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate','body','json','userId','callbackUrl','entityFound:','originate\x20executed!','hangup','hangup\x20fired:','format','user:%s','hangup\x20executed!','answer\x20fired:','hold','webbar:hold','hold\x20executed!','webbar:unhold','calls\x20fired:'];(function(_0x5b4c5d,_0x10026d){var _0x194ef4=function(_0x10fbdd){while(--_0x10fbdd){_0x5b4c5d['push'](_0x5b4c5d['shift']());}};_0x194ef4(++_0x10026d);}(_0x4746,0xc6));var _0x6474=function(_0x380a22,_0x5776a2){_0x380a22=_0x380a22-0x0;var _0x364c8c=_0x4746[_0x380a22];return _0x364c8c;};'use strict';var path=require(_0x6474('0x0'));var fs=require('fs');var _=require(_0x6474('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x6474('0x2'));var util=require('util');var BPromise=require(_0x6474('0x3'));var jayson=require(_0x6474('0x4'));var amiClient=jayson[_0x6474('0x5')][_0x6474('0x6')]({'port':0x232a});var logger=require(_0x6474('0x7'))('webbarapi');var Redis=require(_0x6474('0x8'));config[_0x6474('0x9')]=_['defaults'](config[_0x6474('0x9')],{'host':_0x6474('0xa'),'port':0x18eb});var io=require(_0x6474('0xb'))(new Redis(config[_0x6474('0x9')]));var Schema=require(_0x6474('0xc'));var originateValidation=new Schema({'userId':{'type':_0x6474('0xd'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x6474('0xe'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0x6474('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x6474('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x6474('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x6474('0xf')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x6474('0xd'),'required':[!![],_0x6474('0xf')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],_0x6474('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0x6474('0xd'),'required':[!![],_0x6474('0xf')]},'sessionId':{'type':_0x6474('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x6474('0xd'),'required':[!![],_0x6474('0xf')]},'sessionId':{'type':_0x6474('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x6474('0xd'),'required':[!![],_0x6474('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});function emit(_0x583afa,_0x205df7,_0x9a7ff1){logger[_0x6474('0x11')](_0x583afa,_0x205df7,JSON[_0x6474('0x12')](_0x9a7ff1));io['to'](_0x583afa)[_0x6474('0x13')](_0x205df7,_0x9a7ff1);}function handleError(_0x502755){return function(_0x1505fc){console[_0x6474('0x14')](_0x6474('0x15'),_0x1505fc,_0x1505fc instanceof RangeError);logger[_0x6474('0x16')](_0x1505fc[_0x6474('0x17')]);if(_0x1505fc instanceof RangeError){if(_0x1505fc[_0x6474('0x18')]){delete _0x1505fc[_0x6474('0x18')];}_0x502755[_0x6474('0x19')](0x194)['send'](_0x1505fc);}else{if(_0x1505fc[_0x6474('0x18')]){delete _0x1505fc['name'];}_0x502755[_0x6474('0x19')](0x1f4)[_0x6474('0x1a')](_0x1505fc);}};}function checkError(){return function(_0x2be8fe){if(!_0x2be8fe){throw new RangeError(_0x6474('0x1b'));}return _0x2be8fe;};}function respondWithRpcPromise(_0x271b12,_0x171fc8){return new BPromise(function(_0x382ebf,_0x5d0e5c){var _0xf3cd65=amiClient;return _0xf3cd65['request'](_0x271b12,_0x171fc8)[_0x6474('0x1c')](function(_0x4dc277){if(_0x4dc277['error']){if(_0x4dc277['error'][_0x6474('0x1d')]===0x1f4){return _0x5d0e5c(_0x4dc277[_0x6474('0x16')][_0x6474('0x1e')]);}return _0x382ebf(_0x4dc277[_0x6474('0x16')][_0x6474('0x1e')]);}else{_0x382ebf(_0x4dc277['result']);}})[_0x6474('0x1f')](function(_0x388d2d){_0x5d0e5c(_0x388d2d);});});}function getAgent(_0x46bf4f){return db[_0x6474('0x20')]['findOne']({'where':{'id':_0x46bf4f,'role':'agent'}})[_0x6474('0x1c')](checkError());}function getAgentCheckSession(_0x12d05f,_0xca66ba){return new BPromise(function(_0x39a591,_0x59c42b){var _0x4dc02b=respondWithRpcPromise('VoiceChannels');var _0x4b81f3=getAgent(_0x12d05f);Promise[_0x6474('0x21')]([_0x4dc02b,_0x4b81f3])[_0x6474('0x1c')](function(_0x1751bc){var _0x2387e9=_0x1751bc[0x0];var _0x52e64b=_0x1751bc[0x1];var _0x13af68=_[_0x6474('0x22')](_0x2387e9[_0x6474('0x23')],function(_0x2e01fa){return _0x2e01fa[_0x6474('0x24')]==_0x52e64b['id']&&_0x2e01fa[_0x6474('0x25')]==_0xca66ba;});if(_0x13af68[_0x6474('0x26')]==0x1){_0x39a591(_0x52e64b);}else{_0x59c42b(new RangeError('sessionId\x20'+_0xca66ba+_0x6474('0x27')));}});});}exports[_0x6474('0x28')]=function(_0x1a1ae7,_0x34fea6){logger['info']('originate\x20fired:',_0x1a1ae7['body']);var _0x6f3d6f=originateValidation[_0x6474('0xc')](_0x1a1ae7[_0x6474('0x29')]);if(_0x6f3d6f['length']>0x0){return _0x34fea6[_0x6474('0x19')](0x190)[_0x6474('0x2a')](_0x6f3d6f);}var _0x16f6ec=_0x1a1ae7['body'][_0x6474('0x2b')];var _0x3dc0ee=_0x1a1ae7[_0x6474('0x29')]['callNumber'];var _0xcdd818=_0x1a1ae7[_0x6474('0x29')]['callerId'];var _0x43f7f1=_0x1a1ae7[_0x6474('0x29')][_0x6474('0x2c')];return getAgent(_0x16f6ec)[_0x6474('0x1c')](function(_0x3a5521){logger['info'](_0x6474('0x2d'),_0x3a5521[_0x6474('0x18')]);emit(util['format']('user:%s',_0x3a5521[_0x6474('0x18')]),'webbar:originate',{'callNumber':_0x3dc0ee,'callerId':_0xcdd818,'callbackUrl':_0x43f7f1});return _0x34fea6[_0x6474('0x19')](0xc8)[_0x6474('0x2a')]({'error':![],'message':_0x6474('0x2e')});})[_0x6474('0x1f')](handleError(_0x34fea6));};exports[_0x6474('0x2f')]=function(_0x551202,_0x5e42f5){logger[_0x6474('0x11')](_0x6474('0x30'),_0x551202[_0x6474('0x29')]);var _0x55cf83=hangupValidation[_0x6474('0xc')](_0x551202['body']);if(_0x55cf83[_0x6474('0x26')]>0x0){return _0x5e42f5['status'](0x190)['json'](_0x55cf83);}var _0x53be2e=_0x551202[_0x6474('0x29')][_0x6474('0x2b')];var _0x2879c7=_0x551202[_0x6474('0x29')][_0x6474('0x25')];return getAgent(_0x53be2e)[_0x6474('0x1c')](function(_0x52497f){logger[_0x6474('0x11')](_0x6474('0x2d'),_0x52497f['name']);emit(util[_0x6474('0x31')](_0x6474('0x32'),_0x52497f[_0x6474('0x18')]),'webbar:hangup',{'sessionId':_0x2879c7});return _0x5e42f5[_0x6474('0x19')](0xc8)[_0x6474('0x2a')]({'error':![],'message':_0x6474('0x33')});})['catch'](handleError(_0x5e42f5));};exports['answer']=function(_0x43f669,_0x254a73){logger['info'](_0x6474('0x34'),_0x43f669[_0x6474('0x29')]);var _0x9bdba5=answerValidation[_0x6474('0xc')](_0x43f669['body']);if(_0x9bdba5['length']>0x0){return _0x254a73[_0x6474('0x19')](0x190)['json'](_0x9bdba5);}var _0x391be9=_0x43f669[_0x6474('0x29')][_0x6474('0x2b')];var _0x54e797=_0x43f669[_0x6474('0x29')][_0x6474('0x25')];return getAgent(_0x391be9)['then'](function(_0x27a232){logger[_0x6474('0x11')](_0x6474('0x2d'),_0x27a232[_0x6474('0x18')]);emit(util[_0x6474('0x31')](_0x6474('0x32'),_0x27a232[_0x6474('0x18')]),'webbar:answer',{'sessionId':_0x54e797});return _0x254a73[_0x6474('0x19')](0xc8)[_0x6474('0x2a')]({'error':![],'message':'answer\x20executed!'});})[_0x6474('0x1f')](handleError(_0x254a73));};exports[_0x6474('0x35')]=function(_0x5748d3,_0x550dc2){logger['info']('hold\x20fired:',_0x5748d3[_0x6474('0x29')]);var _0x406246=holdValidation[_0x6474('0xc')](_0x5748d3[_0x6474('0x29')]);if(_0x406246['length']>0x0){return _0x550dc2[_0x6474('0x19')](0x190)[_0x6474('0x2a')](_0x406246);}var _0x1c411e=_0x5748d3[_0x6474('0x29')][_0x6474('0x2b')];var _0x9fe65c=_0x5748d3['body'][_0x6474('0x25')];return getAgent(_0x1c411e)[_0x6474('0x1c')](function(_0x394ff9){logger['info'](_0x6474('0x2d'),_0x394ff9[_0x6474('0x18')]);emit(util['format'](_0x6474('0x32'),_0x394ff9[_0x6474('0x18')]),_0x6474('0x36'),{'sessionId':_0x9fe65c});return _0x550dc2[_0x6474('0x19')](0xc8)[_0x6474('0x2a')]({'error':![],'message':_0x6474('0x37')});})[_0x6474('0x1f')](handleError(_0x550dc2));};exports['unhold']=function(_0x27ebf9,_0x3697a0){logger[_0x6474('0x11')]('unhold\x20fired:',_0x27ebf9[_0x6474('0x29')]);var _0x22181c=unholdValidation[_0x6474('0xc')](_0x27ebf9['body']);if(_0x22181c['length']>0x0){return _0x3697a0[_0x6474('0x19')](0x190)[_0x6474('0x2a')](_0x22181c);}var _0x4ce208=_0x27ebf9['body'][_0x6474('0x2b')];var _0x4e1e3b=_0x27ebf9[_0x6474('0x29')][_0x6474('0x25')];return getAgent(_0x4ce208)[_0x6474('0x1c')](function(_0x26c588){logger[_0x6474('0x11')](_0x6474('0x2d'),_0x26c588[_0x6474('0x18')]);emit(util[_0x6474('0x31')](_0x6474('0x32'),_0x26c588[_0x6474('0x18')]),_0x6474('0x38'),{'sessionId':_0x4e1e3b});return _0x3697a0[_0x6474('0x19')](0xc8)[_0x6474('0x2a')]({'error':![],'message':'unhold\x20executed!'});})[_0x6474('0x1f')](handleError(_0x3697a0));};exports['calls']=function(_0x5a3c6b,_0x1fb309){logger[_0x6474('0x11')](_0x6474('0x39'),_0x1fb309[_0x6474('0x29')]);var _0x5c245d=callsValidation[_0x6474('0xc')](_0x5a3c6b[_0x6474('0x29')]);if(_0x5c245d[_0x6474('0x26')]>0x0){return _0x1fb309[_0x6474('0x19')](0x190)[_0x6474('0x2a')](_0x5c245d);}var _0x671a89=_0x5a3c6b[_0x6474('0x29')][_0x6474('0x2b')];var _0xd59b8c=respondWithRpcPromise(_0x6474('0x3a'));var _0x3d50ac=getAgent(_0x671a89);return Promise[_0x6474('0x21')]([_0xd59b8c,_0x3d50ac])['then'](function(_0x5a4dc5){var _0x1e8a8f=_0x5a4dc5[0x0];var _0x4b4f14=_0x5a4dc5[0x1];var _0x3500bd=_[_0x6474('0x22')](_0x1e8a8f[_0x6474('0x23')],function(_0x68cad9){return _0x68cad9[_0x6474('0x24')]==_0x4b4f14['id'];});return _0x1fb309['status'](0xc8)['json']({'count':_0x3500bd[_0x6474('0x26')],'rows':_0x3500bd});})[_0x6474('0x1f')](handleError(_0x1fb309));};exports[_0x6474('0x3b')]=function(_0x47fb13,_0x3ceaa9){logger[_0x6474('0x11')]('conference\x20fired:',_0x47fb13[_0x6474('0x29')]);var _0x519106=conferenceValidation[_0x6474('0xc')](_0x47fb13[_0x6474('0x29')]);if(_0x519106[_0x6474('0x26')]>0x0){return _0x3ceaa9[_0x6474('0x19')](0x190)['json'](_0x519106);}var _0x3a2a49=_0x47fb13[_0x6474('0x29')][_0x6474('0x2b')];return getAgent(_0x3a2a49)[_0x6474('0x1c')](function(_0x1adc23){logger[_0x6474('0x11')](_0x6474('0x2d'),_0x1adc23[_0x6474('0x18')]);emit(util[_0x6474('0x31')](_0x6474('0x32'),_0x1adc23['name']),_0x6474('0x3c'));return _0x3ceaa9['status'](0xc8)[_0x6474('0x2a')]({'error':![],'message':_0x6474('0x3d')});})[_0x6474('0x1f')](handleError(_0x3ceaa9));};exports[_0x6474('0x3e')]=function(_0xe1844c,_0x2e5a25){logger[_0x6474('0x11')](_0x6474('0x3f'),_0xe1844c['body']);var _0x1cdc62=transferValidation['validate'](_0xe1844c[_0x6474('0x29')]);if(_0x1cdc62[_0x6474('0x26')]>0x0){return _0x2e5a25[_0x6474('0x19')](0x190)['json'](_0x1cdc62);}var _0x5b0ffc=_0xe1844c[_0x6474('0x29')][_0x6474('0x2b')];var _0x45a987=_0xe1844c['body'][_0x6474('0x25')];var _0x53bca1=_0xe1844c[_0x6474('0x29')]['transferNumber'];return getAgent(_0x5b0ffc)['then'](function(_0x53d662){logger[_0x6474('0x11')](_0x6474('0x2d'),_0x53d662[_0x6474('0x18')]);emit(util[_0x6474('0x31')]('user:%s',_0x53d662[_0x6474('0x18')]),'webbar:transfer',{'sessionId':_0x45a987,'transferNumber':_0x53bca1});return _0x2e5a25[_0x6474('0x19')](0xc8)[_0x6474('0x2a')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x2e5a25));}; \ No newline at end of file +var _0x4fef=['client','http','../../config/logger','webbarapi','ioredis','redis','localhost','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','handleError:','error','stack','name','status','send','NotFound','then','code','message','catch','User','findOne','agent','UserId','length','sessionId\x20','\x20not\x20found!','originate','info','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20executed!','sessionId','answer\x20executed!','hold','webbar:hold','hold\x20executed!','unhold','webbar:unhold','calls\x20fired:','filter','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','../../config/environment','bluebird','jayson/promise'];(function(_0x4a21bd,_0x40577f){var _0x1e7841=function(_0x5366c4){while(--_0x5366c4){_0x4a21bd['push'](_0x4a21bd['shift']());}};_0x1e7841(++_0x40577f);}(_0x4fef,0x10f));var _0xf4fe=function(_0x35d754,_0x5494d5){_0x35d754=_0x35d754-0x0;var _0x4b04df=_0x4fef[_0x35d754];return _0x4b04df;};'use strict';var path=require(_0xf4fe('0x0'));var fs=require('fs');var _=require(_0xf4fe('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xf4fe('0x2'));var util=require('util');var BPromise=require(_0xf4fe('0x3'));var jayson=require(_0xf4fe('0x4'));var amiClient=jayson[_0xf4fe('0x5')][_0xf4fe('0x6')]({'port':0x232a});var logger=require(_0xf4fe('0x7'))(_0xf4fe('0x8'));var Redis=require(_0xf4fe('0x9'));config[_0xf4fe('0xa')]=_['defaults'](config[_0xf4fe('0xa')],{'host':_0xf4fe('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf4fe('0xa')]));var Schema=require(_0xf4fe('0xc'));var originateValidation=new Schema({'userId':{'type':_0xf4fe('0xd'),'required':[!![],_0xf4fe('0xe')]},'callNumber':{'type':_0xf4fe('0xf'),'required':[!![],_0xf4fe('0x10')]},'callerId':{'type':_0xf4fe('0xf')},'callbackUrl':{'type':_0xf4fe('0xf')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf4fe('0xe')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xf4fe('0xd'),'required':[!![],_0xf4fe('0xe')]},'sessionId':{'type':_0xf4fe('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xf4fe('0xd'),'required':[!![],_0xf4fe('0xe')]},'sessionId':{'type':'string','required':[!![],_0xf4fe('0x11')]},'transferNumber':{'type':_0xf4fe('0xf'),'required':[!![],_0xf4fe('0x12')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf4fe('0xe')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf4fe('0xd'),'required':[!![],_0xf4fe('0xe')]},'sessionId':{'type':_0xf4fe('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xf4fe('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xf4fe('0xd'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x2a00ea,_0x362e4d,_0x3493cd){logger['info'](_0x2a00ea,_0x362e4d,JSON['stringify'](_0x3493cd));io['to'](_0x2a00ea)[_0xf4fe('0x13')](_0x362e4d,_0x3493cd);}function handleError(_0x225eee){return function(_0x5ad86c){console['log'](_0xf4fe('0x14'),_0x5ad86c,_0x5ad86c instanceof RangeError);logger[_0xf4fe('0x15')](_0x5ad86c[_0xf4fe('0x16')]);if(_0x5ad86c instanceof RangeError){if(_0x5ad86c[_0xf4fe('0x17')]){delete _0x5ad86c[_0xf4fe('0x17')];}_0x225eee[_0xf4fe('0x18')](0x194)[_0xf4fe('0x19')](_0x5ad86c);}else{if(_0x5ad86c[_0xf4fe('0x17')]){delete _0x5ad86c[_0xf4fe('0x17')];}_0x225eee[_0xf4fe('0x18')](0x1f4)[_0xf4fe('0x19')](_0x5ad86c);}};}function checkError(){return function(_0x3c09d0){if(!_0x3c09d0){throw new RangeError(_0xf4fe('0x1a'));}return _0x3c09d0;};}function respondWithRpcPromise(_0xe2b5cc,_0x554eae){return new BPromise(function(_0x3e1d03,_0x5e8e18){var _0x502b3c=amiClient;return _0x502b3c['request'](_0xe2b5cc,_0x554eae)[_0xf4fe('0x1b')](function(_0x518d0d){if(_0x518d0d['error']){if(_0x518d0d[_0xf4fe('0x15')][_0xf4fe('0x1c')]===0x1f4){return _0x5e8e18(_0x518d0d[_0xf4fe('0x15')][_0xf4fe('0x1d')]);}return _0x3e1d03(_0x518d0d[_0xf4fe('0x15')][_0xf4fe('0x1d')]);}else{_0x3e1d03(_0x518d0d['result']);}})[_0xf4fe('0x1e')](function(_0x5ca51d){_0x5e8e18(_0x5ca51d);});});}function getAgent(_0x186ef0){return db[_0xf4fe('0x1f')][_0xf4fe('0x20')]({'where':{'id':_0x186ef0,'role':_0xf4fe('0x21')}})[_0xf4fe('0x1b')](checkError());}function getAgentCheckSession(_0x5790f9,_0x35ae34){return new BPromise(function(_0x112b80,_0x1c455a){var _0x5c3f68=respondWithRpcPromise('VoiceChannels');var _0x2c94c9=getAgent(_0x5790f9);Promise['all']([_0x5c3f68,_0x2c94c9])['then'](function(_0x3d5133){var _0xcfc7b5=_0x3d5133[0x0];var _0x461367=_0x3d5133[0x1];var _0x1ffadb=_['filter'](_0xcfc7b5['rows'],function(_0x4b4832){return _0x4b4832[_0xf4fe('0x22')]==_0x461367['id']&&_0x4b4832['sessionId']==_0x35ae34;});if(_0x1ffadb[_0xf4fe('0x23')]==0x1){_0x112b80(_0x461367);}else{_0x1c455a(new RangeError(_0xf4fe('0x24')+_0x35ae34+_0xf4fe('0x25')));}});});}exports[_0xf4fe('0x26')]=function(_0x171f83,_0x3a0109){logger[_0xf4fe('0x27')](_0xf4fe('0x28'),_0x171f83[_0xf4fe('0x29')]);var _0x1d65c6=originateValidation[_0xf4fe('0xc')](_0x171f83[_0xf4fe('0x29')]);if(_0x1d65c6[_0xf4fe('0x23')]>0x0){return _0x3a0109['status'](0x190)[_0xf4fe('0x2a')](_0x1d65c6);}var _0x13de6a=_0x171f83['body'][_0xf4fe('0x2b')];var _0x3019ff=_0x171f83['body'][_0xf4fe('0x2c')];var _0x1cfa98=_0x171f83[_0xf4fe('0x29')][_0xf4fe('0x2d')];var _0x1270de=_0x171f83[_0xf4fe('0x29')]['callbackUrl'];return getAgent(_0x13de6a)[_0xf4fe('0x1b')](function(_0x10f729){logger['info'](_0xf4fe('0x2e'),_0x10f729[_0xf4fe('0x17')]);emit(util[_0xf4fe('0x2f')](_0xf4fe('0x30'),_0x10f729[_0xf4fe('0x17')]),'webbar:originate',{'callNumber':_0x3019ff,'callerId':_0x1cfa98,'callbackUrl':_0x1270de});return _0x3a0109[_0xf4fe('0x18')](0xc8)[_0xf4fe('0x2a')]({'error':![],'message':_0xf4fe('0x31')});})['catch'](handleError(_0x3a0109));};exports[_0xf4fe('0x32')]=function(_0x19945f,_0x4ea16a){logger[_0xf4fe('0x27')]('hangup\x20fired:',_0x19945f['body']);var _0x392729=hangupValidation[_0xf4fe('0xc')](_0x19945f[_0xf4fe('0x29')]);if(_0x392729['length']>0x0){return _0x4ea16a[_0xf4fe('0x18')](0x190)[_0xf4fe('0x2a')](_0x392729);}var _0x29396a=_0x19945f[_0xf4fe('0x29')][_0xf4fe('0x2b')];var _0x532784=_0x19945f[_0xf4fe('0x29')]['sessionId'];return getAgent(_0x29396a)['then'](function(_0x3e806c){logger[_0xf4fe('0x27')](_0xf4fe('0x2e'),_0x3e806c[_0xf4fe('0x17')]);emit(util['format'](_0xf4fe('0x30'),_0x3e806c[_0xf4fe('0x17')]),'webbar:hangup',{'sessionId':_0x532784});return _0x4ea16a[_0xf4fe('0x18')](0xc8)[_0xf4fe('0x2a')]({'error':![],'message':_0xf4fe('0x33')});})[_0xf4fe('0x1e')](handleError(_0x4ea16a));};exports['answer']=function(_0xb25f9e,_0x1fe567){logger[_0xf4fe('0x27')]('answer\x20fired:',_0xb25f9e[_0xf4fe('0x29')]);var _0x25c098=answerValidation[_0xf4fe('0xc')](_0xb25f9e[_0xf4fe('0x29')]);if(_0x25c098['length']>0x0){return _0x1fe567[_0xf4fe('0x18')](0x190)[_0xf4fe('0x2a')](_0x25c098);}var _0x3ecd8b=_0xb25f9e[_0xf4fe('0x29')][_0xf4fe('0x2b')];var _0x5effba=_0xb25f9e[_0xf4fe('0x29')][_0xf4fe('0x34')];return getAgent(_0x3ecd8b)[_0xf4fe('0x1b')](function(_0x3d76a8){logger[_0xf4fe('0x27')](_0xf4fe('0x2e'),_0x3d76a8[_0xf4fe('0x17')]);emit(util[_0xf4fe('0x2f')]('user:%s',_0x3d76a8[_0xf4fe('0x17')]),'webbar:answer',{'sessionId':_0x5effba});return _0x1fe567[_0xf4fe('0x18')](0xc8)[_0xf4fe('0x2a')]({'error':![],'message':_0xf4fe('0x35')});})['catch'](handleError(_0x1fe567));};exports[_0xf4fe('0x36')]=function(_0xaf567c,_0xbcfd5){logger[_0xf4fe('0x27')]('hold\x20fired:',_0xaf567c[_0xf4fe('0x29')]);var _0x4b3184=holdValidation[_0xf4fe('0xc')](_0xaf567c[_0xf4fe('0x29')]);if(_0x4b3184[_0xf4fe('0x23')]>0x0){return _0xbcfd5[_0xf4fe('0x18')](0x190)[_0xf4fe('0x2a')](_0x4b3184);}var _0x4a0cf0=_0xaf567c[_0xf4fe('0x29')]['userId'];var _0x6c5690=_0xaf567c[_0xf4fe('0x29')][_0xf4fe('0x34')];return getAgent(_0x4a0cf0)['then'](function(_0x59de95){logger['info'](_0xf4fe('0x2e'),_0x59de95[_0xf4fe('0x17')]);emit(util[_0xf4fe('0x2f')](_0xf4fe('0x30'),_0x59de95[_0xf4fe('0x17')]),_0xf4fe('0x37'),{'sessionId':_0x6c5690});return _0xbcfd5[_0xf4fe('0x18')](0xc8)['json']({'error':![],'message':_0xf4fe('0x38')});})[_0xf4fe('0x1e')](handleError(_0xbcfd5));};exports[_0xf4fe('0x39')]=function(_0x4bf5d7,_0x8b8fd9){logger[_0xf4fe('0x27')]('unhold\x20fired:',_0x4bf5d7[_0xf4fe('0x29')]);var _0x17f367=unholdValidation[_0xf4fe('0xc')](_0x4bf5d7['body']);if(_0x17f367['length']>0x0){return _0x8b8fd9[_0xf4fe('0x18')](0x190)[_0xf4fe('0x2a')](_0x17f367);}var _0x3f3385=_0x4bf5d7[_0xf4fe('0x29')]['userId'];var _0xdaeaa3=_0x4bf5d7[_0xf4fe('0x29')][_0xf4fe('0x34')];return getAgent(_0x3f3385)[_0xf4fe('0x1b')](function(_0x3acba3){logger[_0xf4fe('0x27')]('entityFound:',_0x3acba3[_0xf4fe('0x17')]);emit(util[_0xf4fe('0x2f')]('user:%s',_0x3acba3[_0xf4fe('0x17')]),_0xf4fe('0x3a'),{'sessionId':_0xdaeaa3});return _0x8b8fd9[_0xf4fe('0x18')](0xc8)[_0xf4fe('0x2a')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x8b8fd9));};exports['calls']=function(_0x681557,_0x2ce7de){logger['info'](_0xf4fe('0x3b'),_0x2ce7de[_0xf4fe('0x29')]);var _0x1f21a4=callsValidation[_0xf4fe('0xc')](_0x681557[_0xf4fe('0x29')]);if(_0x1f21a4[_0xf4fe('0x23')]>0x0){return _0x2ce7de[_0xf4fe('0x18')](0x190)['json'](_0x1f21a4);}var _0x3a1cae=_0x681557[_0xf4fe('0x29')]['userId'];var _0x385d17=respondWithRpcPromise('VoiceChannels');var _0x427fef=getAgent(_0x3a1cae);return Promise['all']([_0x385d17,_0x427fef])[_0xf4fe('0x1b')](function(_0x453e83){var _0x36f2bc=_0x453e83[0x0];var _0x45f666=_0x453e83[0x1];var _0x28e559=_[_0xf4fe('0x3c')](_0x36f2bc[_0xf4fe('0x3d')],function(_0x335b0f){return _0x335b0f[_0xf4fe('0x22')]==_0x45f666['id'];});return _0x2ce7de['status'](0xc8)['json']({'count':_0x28e559[_0xf4fe('0x23')],'rows':_0x28e559});})[_0xf4fe('0x1e')](handleError(_0x2ce7de));};exports[_0xf4fe('0x3e')]=function(_0x525375,_0x21331d){logger[_0xf4fe('0x27')](_0xf4fe('0x3f'),_0x525375[_0xf4fe('0x29')]);var _0x4e345d=conferenceValidation[_0xf4fe('0xc')](_0x525375[_0xf4fe('0x29')]);if(_0x4e345d[_0xf4fe('0x23')]>0x0){return _0x21331d['status'](0x190)['json'](_0x4e345d);}var _0x1c3b42=_0x525375[_0xf4fe('0x29')][_0xf4fe('0x2b')];return getAgent(_0x1c3b42)['then'](function(_0x5b73e1){logger[_0xf4fe('0x27')](_0xf4fe('0x2e'),_0x5b73e1[_0xf4fe('0x17')]);emit(util[_0xf4fe('0x2f')](_0xf4fe('0x30'),_0x5b73e1[_0xf4fe('0x17')]),_0xf4fe('0x40'));return _0x21331d[_0xf4fe('0x18')](0xc8)['json']({'error':![],'message':_0xf4fe('0x41')});})[_0xf4fe('0x1e')](handleError(_0x21331d));};exports['transfer']=function(_0x48435d,_0x366ef1){logger[_0xf4fe('0x27')](_0xf4fe('0x42'),_0x48435d[_0xf4fe('0x29')]);var _0x5af151=transferValidation[_0xf4fe('0xc')](_0x48435d['body']);if(_0x5af151[_0xf4fe('0x23')]>0x0){return _0x366ef1[_0xf4fe('0x18')](0x190)[_0xf4fe('0x2a')](_0x5af151);}var _0x4b0f3d=_0x48435d['body']['userId'];var _0x2e625e=_0x48435d[_0xf4fe('0x29')][_0xf4fe('0x34')];var _0x4d770f=_0x48435d[_0xf4fe('0x29')][_0xf4fe('0x43')];return getAgent(_0x4b0f3d)[_0xf4fe('0x1b')](function(_0x3cb883){logger[_0xf4fe('0x27')](_0xf4fe('0x2e'),_0x3cb883['name']);emit(util[_0xf4fe('0x2f')](_0xf4fe('0x30'),_0x3cb883['name']),'webbar:transfer',{'sessionId':_0x2e625e,'transferNumber':_0x4d770f});return _0x366ef1['status'](0xc8)[_0xf4fe('0x2a')]({'error':![],'message':_0xf4fe('0x44')});})[_0xf4fe('0x1e')](handleError(_0x366ef1));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index f473352..2e0783e 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 _0x9345=['get','describe','/:id','isAuthenticated','show','getDispositions','/:id/canned_answers','getAnswers','getApplications','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/users','/:id/send','send','put','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1189bc,_0x27ada2){var _0x21a762=function(_0x1e7b63){while(--_0x1e7b63){_0x1189bc['push'](_0x1189bc['shift']());}};_0x21a762(++_0x27ada2);}(_0x9345,0x106));var _0x5934=function(_0x4d934b,_0x52f8e9){_0x4d934b=_0x4d934b-0x0;var _0xc0338b=_0x9345[_0x4d934b];return _0xc0338b;};'use strict';var multer=require(_0x5934('0x0'));var util=require(_0x5934('0x1'));var path=require(_0x5934('0x2'));var timeout=require(_0x5934('0x3'));var express=require('express');var router=express[_0x5934('0x4')]();var fs_extra=require(_0x5934('0x5'));var auth=require(_0x5934('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5934('0x7'));var controller=require('./whatsappAccount.controller');router[_0x5934('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5934('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x5934('0x9')]);router[_0x5934('0x8')](_0x5934('0xa'),auth[_0x5934('0xb')](),controller[_0x5934('0xc')]);router[_0x5934('0x8')]('/:id/dispositions',auth[_0x5934('0xb')](),controller[_0x5934('0xd')]);router[_0x5934('0x8')](_0x5934('0xe'),auth[_0x5934('0xb')](),controller[_0x5934('0xf')]);router[_0x5934('0x8')]('/:id/users',auth[_0x5934('0xb')](),controller['getAgents']);router[_0x5934('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0x5934('0x10')]);router[_0x5934('0x11')]('/',auth['isAuthenticated'](),controller[_0x5934('0x12')]);router[_0x5934('0x11')](_0x5934('0x13'),auth['isAuthenticated'](),controller[_0x5934('0x14')]);router[_0x5934('0x11')](_0x5934('0xe'),auth[_0x5934('0xb')](),controller[_0x5934('0x15')]);router[_0x5934('0x11')](_0x5934('0x16'),auth[_0x5934('0xb')](),controller['addAgents']);router[_0x5934('0x11')]('/:id/applications',auth[_0x5934('0xb')](),controller['addApplications']);router['post']('/:id/notify',controller['notify']);router['post'](_0x5934('0x17'),auth['isAuthenticated'](),controller[_0x5934('0x18')]);router[_0x5934('0x19')]('/:id',auth[_0x5934('0xb')](),controller['update']);router['delete'](_0x5934('0xa'),auth[_0x5934('0xb')](),controller['destroy']);router[_0x5934('0x1a')](_0x5934('0x13'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x5934('0x1a')](_0x5934('0xe'),auth[_0x5934('0xb')](),controller[_0x5934('0x1b')]);router[_0x5934('0x1a')](_0x5934('0x16'),auth[_0x5934('0xb')](),controller[_0x5934('0x1c')]);module[_0x5934('0x1d')]=router; \ No newline at end of file +var _0x4a11=['/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','create','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3132c2,_0x5a5e74){var _0x318560=function(_0x222546){while(--_0x222546){_0x3132c2['push'](_0x3132c2['shift']());}};_0x318560(++_0x5a5e74);}(_0x4a11,0xb7));var _0x14a1=function(_0x16bb4b,_0x5fe431){_0x16bb4b=_0x16bb4b-0x0;var _0x8aeb84=_0x4a11[_0x16bb4b];return _0x8aeb84;};'use strict';var multer=require(_0x14a1('0x0'));var util=require(_0x14a1('0x1'));var path=require(_0x14a1('0x2'));var timeout=require(_0x14a1('0x3'));var express=require(_0x14a1('0x4'));var router=express[_0x14a1('0x5')]();var fs_extra=require(_0x14a1('0x6'));var auth=require(_0x14a1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x14a1('0x8'));var controller=require('./whatsappAccount.controller');router[_0x14a1('0x9')]('/',auth[_0x14a1('0xa')](),controller[_0x14a1('0xb')]);router['get'](_0x14a1('0xc'),auth[_0x14a1('0xa')](),controller[_0x14a1('0xd')]);router[_0x14a1('0x9')](_0x14a1('0xe'),auth[_0x14a1('0xa')](),controller[_0x14a1('0xf')]);router[_0x14a1('0x9')](_0x14a1('0x10'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x14a1('0x9')](_0x14a1('0x11'),auth[_0x14a1('0xa')](),controller[_0x14a1('0x12')]);router[_0x14a1('0x9')](_0x14a1('0x13'),auth[_0x14a1('0xa')](),controller[_0x14a1('0x14')]);router[_0x14a1('0x9')](_0x14a1('0x15'),auth[_0x14a1('0xa')](),controller['getApplications']);router[_0x14a1('0x16')]('/',auth['isAuthenticated'](),controller[_0x14a1('0x17')]);router[_0x14a1('0x16')]('/:id/dispositions',auth[_0x14a1('0xa')](),controller['addDisposition']);router[_0x14a1('0x16')](_0x14a1('0x11'),auth[_0x14a1('0xa')](),controller[_0x14a1('0x18')]);router['post'](_0x14a1('0x13'),auth[_0x14a1('0xa')](),controller[_0x14a1('0x19')]);router[_0x14a1('0x16')](_0x14a1('0x15'),auth['isAuthenticated'](),controller[_0x14a1('0x1a')]);router[_0x14a1('0x16')](_0x14a1('0x1b'),controller[_0x14a1('0x1c')]);router[_0x14a1('0x16')](_0x14a1('0x1d'),auth[_0x14a1('0xa')](),controller[_0x14a1('0x1e')]);router[_0x14a1('0x1f')](_0x14a1('0xe'),auth['isAuthenticated'](),controller[_0x14a1('0x20')]);router[_0x14a1('0x21')](_0x14a1('0xe'),auth['isAuthenticated'](),controller[_0x14a1('0x22')]);router[_0x14a1('0x21')](_0x14a1('0x10'),auth['isAuthenticated'](),controller[_0x14a1('0x23')]);router[_0x14a1('0x21')](_0x14a1('0x11'),auth['isAuthenticated'](),controller[_0x14a1('0x24')]);router[_0x14a1('0x21')](_0x14a1('0x13'),auth[_0x14a1('0xa')](),controller[_0x14a1('0x25')]);module[_0x14a1('0x26')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 07e37ec..d3247cb 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 _0x6645=['exports','STRING','name','twilio','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'];(function(_0xa65ffb,_0x53dd5b){var _0x491769=function(_0x237134){while(--_0x237134){_0xa65ffb['push'](_0xa65ffb['shift']());}};_0x491769(++_0x53dd5b);}(_0x6645,0x16c));var _0x5664=function(_0xe2708a,_0x3c4f7a){_0xe2708a=_0xe2708a-0x0;var _0x415d9b=_0x6645[_0xe2708a];return _0x415d9b;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x5664('0x0')]={'name':{'type':Sequelize[_0x5664('0x1')],'unique':_0x5664('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x5664('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x5664('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x5664('0x1')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x5664('0x1')]},'type':{'type':Sequelize['ENUM'](_0x5664('0x3'),'sinch')},'accountSid':{'type':Sequelize[_0x5664('0x1')]},'baseUrl':{'type':Sequelize[_0x5664('0x1')]},'authToken':{'type':Sequelize[_0x5664('0x1')]},'notificationTemplate':{'type':Sequelize[_0x5664('0x4')],'defaultValue':function(){return _0x5664('0x5');}},'notificationSound':{'type':Sequelize[_0x5664('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5664('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5664('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x5664('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5664('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5664('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5664('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5664('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5664('0x7')],'comment':_0x5664('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x5664('0x6')],'defaultValue':![],'comment':_0x5664('0x9'),'set':function(_0x2ee55c){if(!_0x2ee55c){this[_0x5664('0xa')](_0x5664('0xb'),null);}this[_0x5664('0xa')](_0x5664('0xc'),_0x2ee55c);}},'description':{'type':Sequelize[_0x5664('0x1')]}}; \ No newline at end of file +var _0x20b3=['setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x410e30,_0x46daa0){var _0x5bb274=function(_0x2043fa){while(--_0x2043fa){_0x410e30['push'](_0x410e30['shift']());}};_0x5bb274(++_0x46daa0);}(_0x20b3,0x1a6));var _0x320b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20b3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x320b('0x0'));var rs=require(_0x320b('0x1'));module[_0x320b('0x2')]={'name':{'type':Sequelize[_0x320b('0x3')],'unique':_0x320b('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x320b('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x320b('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x320b('0x3')],'defaultValue':function(){return rs[_0x320b('0x5')]();}},'phone':{'type':Sequelize[_0x320b('0x3')]},'type':{'type':Sequelize[_0x320b('0x6')]('twilio','sinch')},'accountSid':{'type':Sequelize[_0x320b('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x320b('0x7')],'defaultValue':function(){return _0x320b('0x8');}},'notificationSound':{'type':Sequelize[_0x320b('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x320b('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x320b('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x320b('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x320b('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x320b('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x320b('0xb'),'set':function(_0x56c85d){if(!_0x56c85d){this[_0x320b('0xc')]('mandatoryDispositionPauseId',null);}this[_0x320b('0xc')](_0x320b('0xd'),_0x56c85d);}},'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 c60dcf8..c8dc433 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 _0xf59f=['request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply','save','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','Pause','WhatsappAccount','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','body','describe','WhatsappAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','priority','finally','WhatsappApplication','getApplications','notify','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','applications','orderBy','asc','CmContact','Sequelize','createdAt','updatedAt','difference','ListId','mobile','twilio','from','whatsapp:','messageId','MessageSid','notifications','message_id','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','push','close','*,*,*,*','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x5232c9,_0x2a86a3){var _0x412830=function(_0x3c7713){while(--_0x3c7713){_0x5232c9['push'](_0x5232c9['shift']());}};_0x412830(++_0x2a86a3);}(_0xf59f,0x182));var _0xff59=function(_0x14507f,_0x30cb23){_0x14507f=_0x14507f-0x0;var _0x25f890=_0xf59f[_0x14507f];return _0x25f890;};'use strict';var emlformat=require(_0xff59('0x0'));var rimraf=require(_0xff59('0x1'));var zipdir=require(_0xff59('0x2'));var jsonpatch=require(_0xff59('0x3'));var rp=require(_0xff59('0x4'));var moment=require(_0xff59('0x5'));var BPromise=require(_0xff59('0x6'));var Mustache=require(_0xff59('0x7'));var util=require(_0xff59('0x8'));var path=require(_0xff59('0x9'));var sox=require('sox');var csv=require(_0xff59('0xa'));var ejs=require(_0xff59('0xb'));var fs=require('fs');var fs_extra=require(_0xff59('0xc'));var _=require(_0xff59('0xd'));var squel=require('squel');var crypto=require(_0xff59('0xe'));var jsforce=require(_0xff59('0xf'));var deskjs=require(_0xff59('0x10'));var toCsv=require(_0xff59('0xa'));var querystring=require(_0xff59('0x11'));var Papa=require(_0xff59('0x12'));var Redis=require('ioredis');var authService=require(_0xff59('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xff59('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff59('0x15'))(_0xff59('0x16'));var utils=require('../../config/utils');var config=require(_0xff59('0x17'));var licenseUtil=require(_0xff59('0x18'));var db=require('../../mysqldb')['db'];config[_0xff59('0x19')]=_[_0xff59('0x1a')](config['redis'],{'host':_0xff59('0x1b'),'port':0x18eb});var socket=require(_0xff59('0x1c'))(new Redis(config['redis']));require(_0xff59('0x1d'))[_0xff59('0x1e')](socket);var jayson=require(_0xff59('0x1f'));var client=jayson[_0xff59('0x20')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1cb02c,_0x4a30fe,_0x5c6bab,_0x530e83){return new BPromise(function(_0x13cd4c,_0xfc3f11){var _0x199477=_0x530e83||client;return _0x199477[_0xff59('0x21')](_0x1cb02c,_0x5c6bab)[_0xff59('0x22')](function(_0x3fd88e){logger[_0xff59('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x4a30fe,'request\x20sent');logger[_0xff59('0x24')](_0xff59('0x25'),_0x4a30fe,_0xff59('0x26'),JSON[_0xff59('0x27')](_0x3fd88e));if(_0x3fd88e[_0xff59('0x28')]){if(_0x3fd88e[_0xff59('0x28')][_0xff59('0x29')]===0x1f4){logger[_0xff59('0x28')](_0xff59('0x2a'),_0x4a30fe,_0x3fd88e[_0xff59('0x28')]['message']);return _0xfc3f11(_0x3fd88e[_0xff59('0x28')][_0xff59('0x2b')]);}logger[_0xff59('0x28')](_0xff59('0x2a'),_0x4a30fe,_0x3fd88e[_0xff59('0x28')][_0xff59('0x2b')]);return _0x13cd4c(_0x3fd88e[_0xff59('0x28')][_0xff59('0x2b')]);}else{logger[_0xff59('0x23')](_0xff59('0x2a'),_0x4a30fe,_0xff59('0x26'));_0x13cd4c(_0x3fd88e[_0xff59('0x2c')][_0xff59('0x2b')]);}})[_0xff59('0x2d')](function(_0x55db30){logger['error'](_0xff59('0x2a'),_0x4a30fe,_0x55db30);_0xfc3f11(_0x55db30);});});}function respondWithStatusCode(_0x264003,_0x2244fe){_0x2244fe=_0x2244fe||0xcc;return function(_0x29d967){if(_0x29d967){return _0x264003[_0xff59('0x2e')](_0x2244fe);}return _0x264003[_0xff59('0x2f')](_0x2244fe)[_0xff59('0x30')]();};}function respondWithResult(_0x2a343f,_0x16f52e){_0x16f52e=_0x16f52e||0xc8;return function(_0x44ef1e){if(_0x44ef1e){return _0x2a343f['status'](_0x16f52e)[_0xff59('0x31')](_0x44ef1e);}};}function respondWithFilteredResult(_0x3e626f,_0x394968){return function(_0x48442e){if(_0x48442e){var _0x7b422=typeof _0x394968['offset']==='undefined'&&typeof _0x394968[_0xff59('0x32')]===_0xff59('0x33');var _0x514d79=_0x48442e['count'];var _0x5404be=_0x7b422?0x0:_0x394968[_0xff59('0x34')];var _0x7dbbab=_0x7b422?_0x48442e[_0xff59('0x35')]:_0x394968[_0xff59('0x34')]+_0x394968[_0xff59('0x32')];var _0x43baaa;if(_0x7dbbab>=_0x514d79){_0x7dbbab=_0x514d79;_0x43baaa=0xc8;}else{_0x43baaa=0xce;}_0x3e626f[_0xff59('0x2f')](_0x43baaa);return _0x3e626f['set'](_0xff59('0x36'),_0x5404be+'-'+_0x7dbbab+'/'+_0x514d79)[_0xff59('0x31')](_0x48442e);}return null;};}function patchUpdates(_0x467028){return function(_0x2c881c){try{jsonpatch[_0xff59('0x37')](_0x2c881c,_0x467028,!![]);}catch(_0xc27a97){return BPromise['reject'](_0xc27a97);}return _0x2c881c[_0xff59('0x38')]();};}function saveUpdates(_0x2756f3,_0x4d7e3c){return function(_0x3b180a){if(_0x3b180a){return _0x3b180a['update'](_0x2756f3)[_0xff59('0x22')](function(_0x436321){return _0x436321;});}return null;};}function removeEntity(_0x4db043,_0x2b4be2){return function(_0x54213f){if(_0x54213f){return _0x54213f[_0xff59('0x39')]()[_0xff59('0x22')](function(){var _0xbac893=_0x54213f[_0xff59('0x3a')]({'plain':!![]});var _0x4d4c4d=_0xff59('0x3b');return db[_0xff59('0x3c')][_0xff59('0x39')]({'where':{'type':_0x4d4c4d,'resourceId':_0xbac893['id']}})[_0xff59('0x22')](function(){return _0x54213f;});})[_0xff59('0x22')](function(){_0x4db043['status'](0xcc)[_0xff59('0x30')]();});}};}function handleEntityNotFound(_0x2a94d4,_0x66fb15){return function(_0x2b3544){if(!_0x2b3544){_0x2a94d4[_0xff59('0x2e')](0x194);}return _0x2b3544;};}function handleError(_0x3cc76f,_0x6d7965){_0x6d7965=_0x6d7965||0x1f4;return function(_0x22fd62){logger[_0xff59('0x28')](_0x22fd62[_0xff59('0x3d')]);if(_0x22fd62[_0xff59('0x3e')]){delete _0x22fd62['name'];}_0x3cc76f[_0xff59('0x2f')](_0x6d7965)[_0xff59('0x3f')](_0x22fd62);};}exports[_0xff59('0x40')]=function(_0x38a3e8,_0x31a119){var _0x2298ee={'include':[{'model':db['Pause'],'as':_0xff59('0x41')}]},_0x321701={},_0x50df25={'count':0x0,'rows':[]};var _0x2a3cb0=_[_0xff59('0x42')](db['WhatsappAccount'][_0xff59('0x43')],function(_0x463a33){return{'name':_0x463a33[_0xff59('0x44')],'type':_0x463a33[_0xff59('0x45')][_0xff59('0x46')]};});_0x321701[_0xff59('0x47')]=_['map'](_0x2a3cb0,_0xff59('0x3e'));_0x321701[_0xff59('0x48')]=_[_0xff59('0x49')](_0x38a3e8['query']);_0x321701[_0xff59('0x4a')]=_[_0xff59('0x4b')](_0x321701[_0xff59('0x47')],_0x321701['query']);_0x2298ee[_0xff59('0x4c')]=_['intersection'](_0x321701[_0xff59('0x47')],qs[_0xff59('0x4d')](_0x38a3e8[_0xff59('0x48')][_0xff59('0x4d')]));_0x2298ee[_0xff59('0x4c')]=_0x2298ee[_0xff59('0x4c')][_0xff59('0x4e')]?_0x2298ee[_0xff59('0x4c')]:_0x321701[_0xff59('0x47')];if(!_0x38a3e8[_0xff59('0x48')][_0xff59('0x4f')](_0xff59('0x50'))){_0x2298ee[_0xff59('0x32')]=qs[_0xff59('0x32')](_0x38a3e8[_0xff59('0x48')][_0xff59('0x32')]);_0x2298ee[_0xff59('0x34')]=qs['offset'](_0x38a3e8[_0xff59('0x48')][_0xff59('0x34')]);}_0x2298ee[_0xff59('0x51')]=qs[_0xff59('0x52')](_0x38a3e8[_0xff59('0x48')]['sort']);_0x2298ee[_0xff59('0x53')]=qs['filters'](_[_0xff59('0x54')](_0x38a3e8[_0xff59('0x48')],_0x321701['filters']),_0x2a3cb0);if(_0x38a3e8[_0xff59('0x48')][_0xff59('0x55')]){_0x2298ee[_0xff59('0x53')]=_[_0xff59('0x56')](_0x2298ee[_0xff59('0x53')],{'$or':_[_0xff59('0x42')](_0x2a3cb0,function(_0x475961){if(_0x475961['type']!=='VIRTUAL'){var _0xbb450b={};_0xbb450b[_0x475961[_0xff59('0x3e')]]={'$like':'%'+_0x38a3e8[_0xff59('0x48')][_0xff59('0x55')]+'%'};return _0xbb450b;}})});}_0x2298ee=_[_0xff59('0x56')]({},_0x2298ee,_0x38a3e8[_0xff59('0x57')]);var _0x159fa7={'where':_0x2298ee['where']};return db['WhatsappAccount'][_0xff59('0x35')](_0x159fa7)[_0xff59('0x22')](function(_0x59e1a1){_0x50df25[_0xff59('0x35')]=_0x59e1a1;if(_0x38a3e8['query'][_0xff59('0x58')]){_0x2298ee[_0xff59('0x59')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xff59('0x5a')](_0x2298ee);})[_0xff59('0x22')](function(_0x369ca6){_0x50df25[_0xff59('0x5b')]=_0x369ca6;return _0x50df25;})['then'](respondWithFilteredResult(_0x31a119,_0x2298ee))[_0xff59('0x2d')](handleError(_0x31a119,null));};exports['show']=function(_0x1935bd,_0x428be6){var _0xe3358f={'raw':![],'where':{'id':_0x1935bd[_0xff59('0x5c')]['id']},'include':[{'model':db[_0xff59('0x5d')],'as':_0xff59('0x41')}]},_0x23c35b={};_0x23c35b[_0xff59('0x47')]=_[_0xff59('0x49')](db[_0xff59('0x5e')][_0xff59('0x43')]);_0x23c35b['query']=_[_0xff59('0x49')](_0x1935bd[_0xff59('0x48')]);_0x23c35b['filters']=_[_0xff59('0x4b')](_0x23c35b['model'],_0x23c35b['query']);_0xe3358f[_0xff59('0x4c')]=_['intersection'](_0x23c35b[_0xff59('0x47')],qs[_0xff59('0x4d')](_0x1935bd['query']['fields']));_0xe3358f['attributes']=_0xe3358f['attributes'][_0xff59('0x4e')]?_0xe3358f[_0xff59('0x4c')]:_0x23c35b[_0xff59('0x47')];if(_0x1935bd[_0xff59('0x48')][_0xff59('0x58')]){_0xe3358f[_0xff59('0x59')]=[{'all':!![]}];}_0xe3358f=_[_0xff59('0x56')]({},_0xe3358f,_0x1935bd[_0xff59('0x57')]);return db['WhatsappAccount'][_0xff59('0x5f')](_0xe3358f)[_0xff59('0x22')](handleEntityNotFound(_0x428be6,null))[_0xff59('0x22')](respondWithResult(_0x428be6,null))[_0xff59('0x2d')](handleError(_0x428be6,null));};exports[_0xff59('0x60')]=function(_0x92ed7f,_0x4421e1){return db[_0xff59('0x5e')]['create'](_0x92ed7f['body'],{})[_0xff59('0x22')](function(_0x3c8694){var _0x40e31a=_0x92ed7f[_0xff59('0x61')]['get']({'plain':!![]});if(!_0x40e31a)throw new Error(_0xff59('0x62'));if(_0x40e31a['role']===_0xff59('0x61')){var _0x2caeb2=_0x3c8694[_0xff59('0x3a')]({'plain':!![]});var _0xa854e1=_0xff59('0x3b');return db['UserProfileSection'][_0xff59('0x5f')]({'where':{'name':_0xa854e1,'userProfileId':_0x40e31a['userProfileId']},'raw':!![]})[_0xff59('0x22')](function(_0x3cb6d6){if(_0x3cb6d6&&_0x3cb6d6['autoAssociation']===0x0){return db[_0xff59('0x3c')][_0xff59('0x60')]({'name':_0x2caeb2[_0xff59('0x3e')],'resourceId':_0x2caeb2['id'],'type':_0x3cb6d6[_0xff59('0x3e')],'sectionId':_0x3cb6d6['id']},{})['then'](function(){return _0x3c8694;});}else{return _0x3c8694;}})[_0xff59('0x2d')](function(_0x2d11d1){logger[_0xff59('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d11d1);throw _0x2d11d1;});}return _0x3c8694;})[_0xff59('0x22')](respondWithResult(_0x4421e1,0xc9))[_0xff59('0x2d')](handleError(_0x4421e1,null));};exports[_0xff59('0x63')]=function(_0x4c1398,_0xd0d1bb){if(_0x4c1398[_0xff59('0x64')]['id']){delete _0x4c1398[_0xff59('0x64')]['id'];}return db[_0xff59('0x5e')][_0xff59('0x5f')]({'where':{'id':_0x4c1398[_0xff59('0x5c')]['id']},'include':[{'model':db[_0xff59('0x5d')],'as':_0xff59('0x41')}]})[_0xff59('0x22')](handleEntityNotFound(_0xd0d1bb,null))['then'](saveUpdates(_0x4c1398['body'],null))['then'](respondWithResult(_0xd0d1bb,null))[_0xff59('0x2d')](handleError(_0xd0d1bb,null));};exports[_0xff59('0x39')]=function(_0x2f347d,_0x5221c7){return db[_0xff59('0x5e')][_0xff59('0x5f')]({'where':{'id':_0x2f347d[_0xff59('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5221c7,null))[_0xff59('0x22')](removeEntity(_0x5221c7,null))['catch'](handleError(_0x5221c7,null));};exports['describe']=function(_0x5249e9,_0x1ecac2){return db[_0xff59('0x5e')][_0xff59('0x65')]()['then'](respondWithResult(_0x1ecac2,null))['catch'](handleError(_0x1ecac2,null));};exports['addDisposition']=function(_0x42bbdc,_0x4a296f,_0x5672fa){if(_0x42bbdc[_0xff59('0x64')]['id']){delete _0x42bbdc[_0xff59('0x64')]['id'];}return db[_0xff59('0x5e')][_0xff59('0x5f')]({'where':{'id':_0x42bbdc[_0xff59('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4a296f,null))[_0xff59('0x22')](function(_0x5e35f4){if(_0x5e35f4){_0x42bbdc[_0xff59('0x64')][_0xff59('0x66')]=_0x5e35f4['id'];return db[_0xff59('0x67')][_0xff59('0x60')](_0x42bbdc['body']);}})[_0xff59('0x22')](respondWithResult(_0x4a296f,null))['catch'](handleError(_0x4a296f,null));};exports[_0xff59('0x68')]=function(_0x16c9b9,_0x2a1132,_0x3c776f){var _0x46038a={'raw':![],'where':{}};var _0x569dfa={};var _0x33705e={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x16c9b9['params']['id']}})['then'](handleEntityNotFound(_0x2a1132,null))['then'](function(_0x57ce4a){if(_0x57ce4a){_0x569dfa[_0xff59('0x47')]=_['keys'](db['Disposition']['rawAttributes']);_0x569dfa[_0xff59('0x48')]=_[_0xff59('0x49')](_0x16c9b9['query']);_0x569dfa[_0xff59('0x4a')]=_[_0xff59('0x4b')](_0x569dfa['model'],_0x569dfa[_0xff59('0x48')]);_0x46038a['attributes']=_[_0xff59('0x4b')](_0x569dfa[_0xff59('0x47')],qs['fields'](_0x16c9b9[_0xff59('0x48')]['fields']));_0x46038a[_0xff59('0x4c')]=_0x46038a[_0xff59('0x4c')][_0xff59('0x4e')]?_0x46038a[_0xff59('0x4c')]:_0x569dfa['model'];if(!_0x16c9b9[_0xff59('0x48')][_0xff59('0x4f')](_0xff59('0x50'))){_0x46038a[_0xff59('0x32')]=qs[_0xff59('0x32')](_0x16c9b9[_0xff59('0x48')][_0xff59('0x32')]);_0x46038a[_0xff59('0x34')]=qs[_0xff59('0x34')](_0x16c9b9[_0xff59('0x48')][_0xff59('0x34')]);}_0x46038a[_0xff59('0x51')]=qs[_0xff59('0x52')](_0x16c9b9[_0xff59('0x48')][_0xff59('0x52')]);_0x46038a[_0xff59('0x53')]=qs[_0xff59('0x4a')](_[_0xff59('0x54')](_0x16c9b9['query'],_0x569dfa['filters']));_0x46038a[_0xff59('0x53')][_0xff59('0x66')]=_0x57ce4a['id'];if(_0x16c9b9[_0xff59('0x48')][_0xff59('0x55')]){_0x46038a[_0xff59('0x53')]=_[_0xff59('0x56')](_0x46038a['where'],{'$or':_[_0xff59('0x42')](_0x46038a[_0xff59('0x4c')],function(_0x5f1a58){var _0x5daa42={};_0x5daa42[_0x5f1a58]={'$like':'%'+_0x16c9b9[_0xff59('0x48')]['filter']+'%'};return _0x5daa42;})});}_0x46038a=_[_0xff59('0x56')]({},_0x46038a,_0x16c9b9['options']);return db[_0xff59('0x67')][_0xff59('0x35')]({'where':_0x46038a['where']})[_0xff59('0x22')](function(_0x59b79e){_0x33705e[_0xff59('0x35')]=_0x59b79e;if(_0x16c9b9[_0xff59('0x48')][_0xff59('0x58')]){_0x46038a[_0xff59('0x59')]=[{'all':!![]}];}return db[_0xff59('0x67')][_0xff59('0x5a')](_0x46038a);})['then'](function(_0x5e6eaf){_0x33705e[_0xff59('0x5b')]=_0x5e6eaf;return _0x33705e;});}})[_0xff59('0x22')](respondWithFilteredResult(_0x2a1132,_0x46038a))[_0xff59('0x2d')](handleError(_0x2a1132,null));};exports[_0xff59('0x69')]=function(_0x5c8cc5,_0x3d9eef,_0x6cf8a9){return db[_0xff59('0x5e')][_0xff59('0x5f')]({'where':{'id':_0x5c8cc5[_0xff59('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3d9eef,null))[_0xff59('0x22')](function(_0x24684d){if(_0x24684d){return _0x24684d[_0xff59('0x69')](_0x5c8cc5[_0xff59('0x48')][_0xff59('0x6a')]);}})[_0xff59('0x22')](respondWithStatusCode(_0x3d9eef,null))['catch'](handleError(_0x3d9eef,null));};exports[_0xff59('0x6b')]=function(_0x10dfda,_0x12cdd4,_0x583336){if(_0x10dfda[_0xff59('0x64')]['id']){delete _0x10dfda['body']['id'];}return db[_0xff59('0x5e')][_0xff59('0x5f')]({'where':{'id':_0x10dfda['params']['id']}})['then'](handleEntityNotFound(_0x12cdd4,null))['then'](function(_0x50ccc3){if(_0x50ccc3){_0x10dfda[_0xff59('0x64')][_0xff59('0x66')]=_0x50ccc3['id'];return db['CannedAnswer'][_0xff59('0x60')](_0x10dfda['body']);}})[_0xff59('0x22')](respondWithResult(_0x12cdd4,null))['catch'](handleError(_0x12cdd4,null));};exports[_0xff59('0x6c')]=function(_0x561e43,_0x1fd515,_0x30d8f0){var _0x4badce={'raw':![],'where':{}};var _0x3a97a8={};var _0x1336ac={'count':0x0,'rows':[]};return db[_0xff59('0x5e')][_0xff59('0x6d')]({'where':{'id':_0x561e43[_0xff59('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1fd515,null))[_0xff59('0x22')](function(_0x5dc2bc){if(_0x5dc2bc){_0x3a97a8['model']=_[_0xff59('0x49')](db[_0xff59('0x6e')][_0xff59('0x43')]);_0x3a97a8[_0xff59('0x48')]=_[_0xff59('0x49')](_0x561e43[_0xff59('0x48')]);_0x3a97a8['filters']=_[_0xff59('0x4b')](_0x3a97a8[_0xff59('0x47')],_0x3a97a8['query']);_0x4badce[_0xff59('0x4c')]=_[_0xff59('0x4b')](_0x3a97a8[_0xff59('0x47')],qs[_0xff59('0x4d')](_0x561e43[_0xff59('0x48')][_0xff59('0x4d')]));_0x4badce[_0xff59('0x4c')]=_0x4badce['attributes'][_0xff59('0x4e')]?_0x4badce[_0xff59('0x4c')]:_0x3a97a8[_0xff59('0x47')];if(!_0x561e43[_0xff59('0x48')][_0xff59('0x4f')](_0xff59('0x50'))){_0x4badce[_0xff59('0x32')]=qs[_0xff59('0x32')](_0x561e43[_0xff59('0x48')][_0xff59('0x32')]);_0x4badce['offset']=qs[_0xff59('0x34')](_0x561e43[_0xff59('0x48')][_0xff59('0x34')]);}_0x4badce[_0xff59('0x51')]=qs[_0xff59('0x52')](_0x561e43[_0xff59('0x48')][_0xff59('0x52')]);_0x4badce[_0xff59('0x53')]=qs[_0xff59('0x4a')](_[_0xff59('0x54')](_0x561e43[_0xff59('0x48')],_0x3a97a8[_0xff59('0x4a')]));_0x4badce[_0xff59('0x53')][_0xff59('0x66')]=_0x5dc2bc['id'];if(_0x561e43[_0xff59('0x48')]['filter']){_0x4badce[_0xff59('0x53')]=_[_0xff59('0x56')](_0x4badce[_0xff59('0x53')],{'$or':_[_0xff59('0x42')](_0x4badce[_0xff59('0x4c')],function(_0x4ea65b){var _0x104928={};_0x104928[_0x4ea65b]={'$like':'%'+_0x561e43[_0xff59('0x48')]['filter']+'%'};return _0x104928;})});}_0x4badce=_[_0xff59('0x56')]({},_0x4badce,_0x561e43[_0xff59('0x57')]);return db['CannedAnswer'][_0xff59('0x35')]({'where':_0x4badce[_0xff59('0x53')]})['then'](function(_0x28f49a){_0x1336ac[_0xff59('0x35')]=_0x28f49a;if(_0x561e43['query'][_0xff59('0x58')]){_0x4badce[_0xff59('0x59')]=[{'all':!![]}];}return db[_0xff59('0x6e')][_0xff59('0x5a')](_0x4badce);})['then'](function(_0x2936b9){_0x1336ac[_0xff59('0x5b')]=_0x2936b9;return _0x1336ac;});}})['then'](respondWithFilteredResult(_0x1fd515,_0x4badce))[_0xff59('0x2d')](handleError(_0x1fd515,null));};exports[_0xff59('0x6f')]=function(_0x576f03,_0x3f11fb,_0x46b454){return db[_0xff59('0x5e')][_0xff59('0x5f')]({'where':{'id':_0x576f03[_0xff59('0x5c')]['id']}})[_0xff59('0x22')](handleEntityNotFound(_0x3f11fb,null))[_0xff59('0x22')](function(_0xe35440){if(_0xe35440){return _0xe35440[_0xff59('0x6f')](_0x576f03['query'][_0xff59('0x6a')]);}})[_0xff59('0x22')](respondWithStatusCode(_0x3f11fb,null))[_0xff59('0x2d')](handleError(_0x3f11fb,null));};exports[_0xff59('0x70')]=function(_0x19e2a6,_0x1901fa,_0x3fb343){return db[_0xff59('0x5e')][_0xff59('0x5f')]({'where':{'id':_0x19e2a6['params']['id']}})[_0xff59('0x22')](handleEntityNotFound(_0x1901fa,null))[_0xff59('0x22')](function(_0x509aab){if(_0x509aab){return _0x509aab[_0xff59('0x70')](_0x19e2a6[_0xff59('0x64')][_0xff59('0x6a')],_[_0xff59('0x71')](_0x19e2a6[_0xff59('0x64')],[_0xff59('0x6a'),'id'])||{})[_0xff59('0x72')](function(_0x1a063c){for(var _0x47ea11=0x0;_0x47ea11<_0x19e2a6[_0xff59('0x64')][_0xff59('0x6a')][_0xff59('0x4e')];_0x47ea11+=0x1){socket[_0xff59('0x73')]('userWhatsappAccount:save',{'UserId':Number(_0x19e2a6['body'][_0xff59('0x6a')][_0x47ea11]),'WhatsappAccountId':Number(_0x19e2a6['params']['id'])});}return _0x1a063c;});}})[_0xff59('0x22')](respondWithResult(_0x1901fa,null))[_0xff59('0x2d')](handleError(_0x1901fa,null));};exports[_0xff59('0x74')]=function(_0xab4f5a,_0x37f6ee,_0x4c26aa){return db[_0xff59('0x5e')][_0xff59('0x5f')]({'where':{'id':_0xab4f5a[_0xff59('0x5c')]['id']}})['then'](handleEntityNotFound(_0x37f6ee,null))['then'](function(_0x43cb7d){if(_0x43cb7d){return _0x43cb7d[_0xff59('0x74')](_0xab4f5a['query']['ids'])[_0xff59('0x22')](function(){if(_[_0xff59('0x75')](_0xab4f5a[_0xff59('0x48')][_0xff59('0x6a')])){for(var _0x2ce7b1=0x0;_0x2ce7b1<_0xab4f5a[_0xff59('0x48')][_0xff59('0x6a')][_0xff59('0x4e')];_0x2ce7b1+=0x1){socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0xab4f5a['query']['ids'][_0x2ce7b1]),'WhatsappAccountId':Number(_0xab4f5a[_0xff59('0x5c')]['id'])});}}else{socket[_0xff59('0x73')](_0xff59('0x76'),{'UserId':Number(_0xab4f5a[_0xff59('0x48')]['ids']),'WhatsappAccountId':Number(_0xab4f5a[_0xff59('0x5c')]['id'])});}});}})[_0xff59('0x22')](respondWithStatusCode(_0x37f6ee,null))['catch'](handleError(_0x37f6ee,null));};exports[_0xff59('0x77')]=function(_0x81d313,_0x39ecb6,_0x3cc610){var _0x2ca1b0={};var _0x2391e4={};var _0x4f20a3;var _0x3deaca;return db[_0xff59('0x5e')][_0xff59('0x6d')]({'where':{'id':_0x81d313[_0xff59('0x5c')]['id']}})['then'](handleEntityNotFound(_0x39ecb6,null))[_0xff59('0x22')](function(_0xba5e24){if(_0xba5e24){_0x4f20a3=_0xba5e24;_0x2391e4[_0xff59('0x47')]=_[_0xff59('0x49')](db[_0xff59('0x78')][_0xff59('0x43')]);_0x2391e4['query']=_[_0xff59('0x49')](_0x81d313['query']);_0x2391e4['filters']=_[_0xff59('0x4b')](_0x2391e4[_0xff59('0x47')],_0x2391e4[_0xff59('0x48')]);_0x2ca1b0[_0xff59('0x4c')]=_[_0xff59('0x4b')](_0x2391e4['model'],qs[_0xff59('0x4d')](_0x81d313['query']['fields']));_0x2ca1b0[_0xff59('0x4c')]=_0x2ca1b0[_0xff59('0x4c')][_0xff59('0x4e')]?_0x2ca1b0['attributes']:_0x2391e4[_0xff59('0x47')];_0x2ca1b0['order']=qs[_0xff59('0x52')](_0x81d313[_0xff59('0x48')]['sort']);_0x2ca1b0[_0xff59('0x53')]=qs[_0xff59('0x4a')](_[_0xff59('0x54')](_0x81d313[_0xff59('0x48')],_0x2391e4[_0xff59('0x4a')]));if(_0x81d313['query'][_0xff59('0x55')]){_0x2ca1b0[_0xff59('0x53')]=_['merge'](_0x2ca1b0[_0xff59('0x53')],{'$or':_[_0xff59('0x42')](_0x2ca1b0[_0xff59('0x4c')],function(_0x2805c4){var _0x56a27f={};_0x56a27f[_0x2805c4]={'$like':'%'+_0x81d313[_0xff59('0x48')][_0xff59('0x55')]+'%'};return _0x56a27f;})});}_0x2ca1b0=_[_0xff59('0x56')]({},_0x2ca1b0,_0x81d313[_0xff59('0x57')]);return _0x4f20a3[_0xff59('0x77')](_0x2ca1b0);}})[_0xff59('0x22')](function(_0x47e933){if(_0x47e933){_0x3deaca=_0x47e933['length'];if(!_0x81d313[_0xff59('0x48')][_0xff59('0x4f')](_0xff59('0x50'))){_0x2ca1b0['limit']=qs['limit'](_0x81d313[_0xff59('0x48')][_0xff59('0x32')]);_0x2ca1b0[_0xff59('0x34')]=qs[_0xff59('0x34')](_0x81d313[_0xff59('0x48')][_0xff59('0x34')]);}return _0x4f20a3[_0xff59('0x77')](_0x2ca1b0);}})['then'](function(_0x5f06aa){if(_0x5f06aa){return _0x5f06aa?{'count':_0x3deaca,'rows':_0x5f06aa}:null;}})[_0xff59('0x22')](respondWithResult(_0x39ecb6,null))['catch'](handleError(_0x39ecb6,null));};exports['addApplications']=function(_0x26569b,_0x73e28){var _0x27d5ea=_0x26569b[_0xff59('0x5c')]['id'];var _0x552a3b=_0x26569b[_0xff59('0x64')];var _0xa94c34=0xc8;var _0x3b781b=null;return db[_0xff59('0x79')][_0xff59('0x7a')]({'isolationLevel':db[_0xff59('0x79')][_0xff59('0x7b')]['ISOLATION_LEVELS'][_0xff59('0x7c')]},function(_0x3ad70d){return db[_0xff59('0x5e')][_0xff59('0x6d')]({'where':{'id':_0x27d5ea},'transaction':_0x3ad70d})['then'](function(_0x40ae31){if(_0x40ae31){return db['WhatsappApplication'][_0xff59('0x39')]({'where':{'WhatsappAccountId':_0x27d5ea},'transaction':_0x3ad70d})[_0xff59('0x22')](function(){var _0x4f3f64=_[_0xff59('0x42')](_0x552a3b,function(_0xe43556){_0xe43556[_0xff59('0x66')]=_0x27d5ea;return _0xe43556;});return db['WhatsappApplication'][_0xff59('0x7d')](_0x4f3f64,{'transaction':_0x3ad70d});});}else{_0xa94c34=0x194;_0x3b781b=[];}});})[_0xff59('0x22')](function(){if(_0xa94c34!==0x194){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x27d5ea},'order':_0xff59('0x7e')})[_0xff59('0x22')](function(_0x1a6bac){_0x3b781b=_0x1a6bac;});}})[_0xff59('0x2d')](function(_0x19f992){_0xa94c34=0x1f4;logger[_0xff59('0x28')](_0x19f992[_0xff59('0x3d')]);if(_0x19f992['name']){delete _0x19f992['name'];}_0x3b781b=_0x19f992;})[_0xff59('0x7f')](function(){if(_0x3b781b===null){_0x73e28[_0xff59('0x2e')](_0xa94c34);}else{if(_0xa94c34===0x1f4){_0x73e28[_0xff59('0x2f')](_0xa94c34)[_0xff59('0x3f')](_0x3b781b);}else{_0x73e28[_0xff59('0x2f')](_0xa94c34)[_0xff59('0x31')](_0x3b781b);}}});};exports['getApplications']=function(_0x2b0275,_0x489e84,_0x6dccb6){var _0x1602b1={};var _0x336a4f={};var _0x41d655;var _0x4dbb7b;return db[_0xff59('0x5e')][_0xff59('0x6d')]({'where':{'id':_0x2b0275[_0xff59('0x5c')]['id']}})[_0xff59('0x22')](handleEntityNotFound(_0x489e84,null))[_0xff59('0x22')](function(_0x3dbd6f){if(_0x3dbd6f){_0x41d655=_0x3dbd6f;_0x336a4f[_0xff59('0x47')]=_[_0xff59('0x49')](db[_0xff59('0x80')]['rawAttributes']);_0x336a4f[_0xff59('0x48')]=_[_0xff59('0x49')](_0x2b0275[_0xff59('0x48')]);_0x336a4f[_0xff59('0x4a')]=_[_0xff59('0x4b')](_0x336a4f['model'],_0x336a4f['query']);_0x1602b1[_0xff59('0x4c')]=_['intersection'](_0x336a4f[_0xff59('0x47')],qs[_0xff59('0x4d')](_0x2b0275['query']['fields']));_0x1602b1['attributes']=_0x1602b1['attributes']['length']?_0x1602b1[_0xff59('0x4c')]:_0x336a4f[_0xff59('0x47')];_0x1602b1[_0xff59('0x51')]=qs['sort'](_0x2b0275[_0xff59('0x48')][_0xff59('0x52')]);_0x1602b1[_0xff59('0x53')]=qs['filters'](_[_0xff59('0x54')](_0x2b0275[_0xff59('0x48')],_0x336a4f['filters']));if(_0x2b0275['query'][_0xff59('0x55')]){_0x1602b1[_0xff59('0x53')]=_[_0xff59('0x56')](_0x1602b1[_0xff59('0x53')],{'$or':_[_0xff59('0x42')](_0x1602b1['attributes'],function(_0x3d69dc){var _0x5a5ac1={};_0x5a5ac1[_0x3d69dc]={'$like':'%'+_0x2b0275['query'][_0xff59('0x55')]+'%'};return _0x5a5ac1;})});}_0x1602b1=_[_0xff59('0x56')]({},_0x1602b1,_0x2b0275[_0xff59('0x57')]);return _0x41d655[_0xff59('0x81')](_0x1602b1);}})[_0xff59('0x22')](function(_0x370cd9){if(_0x370cd9){_0x4dbb7b=_0x370cd9[_0xff59('0x4e')];if(!_0x2b0275[_0xff59('0x48')]['hasOwnProperty'](_0xff59('0x50'))){_0x1602b1[_0xff59('0x32')]=qs[_0xff59('0x32')](_0x2b0275[_0xff59('0x48')][_0xff59('0x32')]);_0x1602b1[_0xff59('0x34')]=qs[_0xff59('0x34')](_0x2b0275['query'][_0xff59('0x34')]);}return _0x41d655['getApplications'](_0x1602b1);}})[_0xff59('0x22')](function(_0x42568f){if(_0x42568f){return _0x42568f?{'count':_0x4dbb7b,'rows':_0x42568f}:null;}})[_0xff59('0x22')](respondWithResult(_0x489e84,null))[_0xff59('0x2d')](handleError(_0x489e84,null));};exports[_0xff59('0x82')]=function(_0xc4730f,_0x260e75,_0x2110d0){var _0xc59259={'channel':'whatsapp'};var _0x57c547=[];var _0x9757ca=[];var _0x57c934={};return db['WhatsappAccount'][_0xff59('0x5f')]({'where':{'id':_0xc4730f[_0xff59('0x5c')]['id']},'include':[{'model':db[_0xff59('0x80')],'as':_0xff59('0x83')}]})[_0xff59('0x22')](handleEntityNotFound(_0x260e75,null))[_0xff59('0x22')](function(_0x18935c){_0xc59259[_0xff59('0x84')]=_0x18935c;if(_0xc59259[_0xff59('0x84')]&&_0xc59259['account'][_0xff59('0x45')]===_0xff59('0x85')&&_0xc4730f[_0xff59('0x64')]['statuses']){if(_0xc4730f[_0xff59('0x64')]['statuses'][_0xff59('0x4e')]===0x0)return;if(_0xc4730f[_0xff59('0x64')][_0xff59('0x86')][0x0][_0xff59('0x87')]!==_0xff59('0x88'))return;return db[_0xff59('0x89')][_0xff59('0x63')]({'read':!![],'readAt':_0xc4730f[_0xff59('0x64')][_0xff59('0x86')][0x0][_0xff59('0x8a')]},{'where':{'messageId':_0xc4730f[_0xff59('0x64')]['statuses'][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x29d169){return _0x260e75['status'](0xc8)['json'](_0x29d169);});}_0xc59259[_0xff59('0x8b')]=_[_0xff59('0x8c')](_0x18935c[_0xff59('0x83')],[_0xff59('0x7e')],[_0xff59('0x8d')]);if(_0xc59259['account'][_0xff59('0x83')]){delete _0xc59259['account'][_0xff59('0x83')];}return db[_0xff59('0x8e')][_0xff59('0x65')]()[_0xff59('0x22')](function(_0x5c0b66){if(!_0x5c0b66){throw new db[(_0xff59('0x8f'))]['ValidationError']('no\x20available\x20attributes');}_0x57c547=_['difference'](_[_0xff59('0x49')](_0x5c0b66),[_0xff59('0x90'),_0xff59('0x91')]);_0x9757ca=_[_0xff59('0x92')](_[_0xff59('0x49')](_0x5c0b66),[_0xff59('0x90'),_0xff59('0x91'),'CompanyId',_0xff59('0x93')]);_0xc59259[_0xff59('0x64')]={'mapKey':_0xff59('0x94')};if(_0xc59259[_0xff59('0x84')]&&_0xc59259[_0xff59('0x84')][_0xff59('0x45')]===_0xff59('0x95')){_0xc59259[_0xff59('0x64')][_0xff59('0x96')]=_0xc4730f['body']['From']['replace'](_0xff59('0x97'),'');_0xc59259[_0xff59('0x64')][_0xff59('0x64')]=_0xc4730f[_0xff59('0x64')]['Body'];_0xc59259[_0xff59('0x64')][_0xff59('0x98')]=_0xc4730f[_0xff59('0x64')][_0xff59('0x99')];}if(_0xc59259[_0xff59('0x84')]&&_0xc59259['account']['type']==='sinch'){_0xc59259[_0xff59('0x64')]['from']=_0xc4730f[_0xff59('0x64')][_0xff59('0x9a')][0x0][_0xff59('0x96')];_0xc59259[_0xff59('0x64')][_0xff59('0x64')]=_0xc4730f['body'][_0xff59('0x9a')][0x0][_0xff59('0x2b')][_0xff59('0x64')];_0xc59259[_0xff59('0x64')][_0xff59('0x98')]=_0xc4730f[_0xff59('0x64')][_0xff59('0x9a')][0x0][_0xff59('0x9b')];}if(_0xc59259[_0xff59('0x64')]['id']){delete _0xc59259[_0xff59('0x64')]['id'];}if(_[_0xff59('0x9c')](_0xc59259['body'][_0xff59('0x96')])){throw new db['Sequelize'][(_0xff59('0x9d'))](_0xff59('0x9e'));}if(_[_0xff59('0x9c')](_0xc59259[_0xff59('0x64')][_0xff59('0x64')])||_0xc59259['body'][_0xff59('0x64')]===''){throw new db[(_0xff59('0x8f'))][(_0xff59('0x9d'))](_0xff59('0x9f'));}if(_['isNil'](_0xc59259['body'][_0xff59('0xa0')])){throw new db[(_0xff59('0x8f'))][(_0xff59('0x9d'))](_0xff59('0xa1')+_0x9757ca);}if(!_[_0xff59('0xa2')](_0x9757ca,_0xc59259['body']['mapKey'])){throw new db[(_0xff59('0x8f'))][(_0xff59('0x9d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9757ca);}_0x57c934[_0xc59259[_0xff59('0x64')][_0xff59('0xa0')]]=_0xc59259[_0xff59('0x64')][_0xff59('0x96')];return db[_0xff59('0xa3')]['find']({'where':{'id':_0xc59259[_0xff59('0x84')]['ListId']},'include':[{'model':db[_0xff59('0x8e')],'as':_0xff59('0xa4'),'where':_0x57c934,'limit':0x1,'order':[['updatedAt',_0xff59('0xa5')]]}]});})['then'](handleEntityNotFound(_0x260e75,null))[_0xff59('0x22')](function(_0x29f6c9){if(_0x29f6c9){_0xc59259[_0xff59('0xa6')]=_[_0xff59('0x71')](_0x29f6c9,[_0xff59('0xa4')]);if(_0x29f6c9[_0xff59('0xa4')][_0xff59('0x4e')]){return _0x29f6c9['Contacts'][0x0];}var _0x30cb9d=_['defaults'](_0xc59259['body'],{'firstName':_0xc59259[_0xff59('0x64')][_0xff59('0x96')],'ListId':_0x29f6c9['id']});_0x30cb9d[_0xc59259[_0xff59('0x64')][_0xff59('0xa0')]]=_0xc59259[_0xff59('0x64')]['from'];return db['CmContact'][_0xff59('0x60')](_0x30cb9d,{'fields':_0x57c547,'raw':!![]});}})['then'](handleEntityNotFound(_0x260e75,null))[_0xff59('0x22')](function(_0x22eda2){if(_0x22eda2){_0xc59259[_0xff59('0xa7')]=_0x22eda2;var _0x3d71da={'ContactId':_0x22eda2['id'],'phone':_0xc59259['body'][_0xff59('0x96')],'WhatsappAccountId':_0xc4730f[_0xff59('0x5c')]['id']};var _0x4b8cec={'ContactId':_0x22eda2['id'],'WhatsappAccountId':_0xc4730f['params']['id'],'closed':![]};return db[_0xff59('0xa8')]['find']({'where':_0x4b8cec})[_0xff59('0x22')](function(_0x39e81c){if(_0x39e81c){return[_0x39e81c,![]];}return db[_0xff59('0xa8')][_0xff59('0x60')](_0x3d71da)[_0xff59('0x22')](function(_0x1ccdcd){return[_0x1ccdcd,!![]];});});}})['spread'](function(_0x870db8,_0x257435){_0xc59259['interaction']=_0x870db8[_0xff59('0x3a')]({'plain':!![]});_0xc59259[_0xff59('0xa9')][_0xff59('0xaa')]=![];if(_0x257435){if(_0xc59259['account'][_0xff59('0xab')]){_0xc59259['applications'][_0xff59('0xac')]({'id':0x0,'priority':_0xc59259[_0xff59('0x8b')]['length']+0x1,'app':_0xff59('0xad'),'appdata':'unmanaged','interval':_0xff59('0xae')});}_0xc59259['interaction'][_0xff59('0xaa')]=!![];}return db[_0xff59('0x89')][_0xff59('0x60')]({'phone':_0xc59259[_0xff59('0x64')][_0xff59('0x96')],'messageId':_0xc59259['body'][_0xff59('0x98')],'body':_0xc59259['body'][_0xff59('0x64')],'WhatsappAccountId':_0xc4730f[_0xff59('0x5c')]['id'],'WhatsappInteractionId':_0x870db8['id'],'direction':'in','ContactId':_0x870db8[_0xff59('0xaf')],'AttachmentId':_0xc59259[_0xff59('0x64')][_0xff59('0xb0')]});})['then'](function(_0x6af7f2){_0xc59259[_0xff59('0x2b')]=_0x6af7f2;if(!_0xc59259[_0xff59('0xa9')][_0xff59('0xb1')])return;return db[_0xff59('0x78')][_0xff59('0x5f')]({'attributes':['id',_0xff59('0x3e')],'where':{'id':_0xc59259[_0xff59('0xa9')][_0xff59('0xb1')]}});})[_0xff59('0x22')](function(_0x22aa0a){if(_0x22aa0a){_0xc59259[_0xff59('0x8b')][_0xff59('0xb2')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x22aa0a[_0xff59('0x3e')]+','+(_0xc59259[_0xff59('0x84')][_0xff59('0xb3')]||0xa),'interval':_0xff59('0xae')});}if(!_0xc59259['interaction'][_0xff59('0xb4')])return;return db['WhatsappQueue'][_0xff59('0x5f')]({'attributes':['id',_0xff59('0x3e')],'where':{'id':_0xc59259[_0xff59('0xa9')][_0xff59('0xb4')]}});})[_0xff59('0x22')](function(_0x191b93){if(_0x191b93){_0xc59259[_0xff59('0x8b')]['unshift']({'id':0x0,'priority':0x1,'app':_0xff59('0xb5'),'appdata':_0x191b93[_0xff59('0x3e')]+','+(_0xc59259[_0xff59('0x84')][_0xff59('0xb6')]||0x12c),'interval':_0xff59('0xae')});}return respondWithRpcPromise('Start',_0xff59('0xb7'),_0xc59259);})['then'](function(_0x1664f3){if(_0x1664f3){var _0x1797ed=0xc8;var _0x2aac16=_0xff59('0xb8');logger[_0xff59('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x2aac16,_0x1797ed,_0xff59('0xb9'));logger[_0xff59('0x24')](_0xff59('0xba'),_0x2aac16,_0x1797ed,_0xff59('0xb9'),JSON[_0xff59('0x27')](_0x1664f3));if(_0xc59259[_0xff59('0x84')][_0xff59('0x45')]===_0xff59('0x95')){return _0x260e75[_0xff59('0x2f')](_0x1797ed)['set'](_0xff59('0xbb'),_0xff59('0xbc'))[_0xff59('0x3f')](_0xff59('0xbd'));}else{return _0x260e75[_0xff59('0x2f')](_0x1797ed)['json'](_0x1664f3);}}});})['catch'](handleError(_0x260e75,null));};exports[_0xff59('0x3f')]=function(_0x3d637a,_0x45aa8e,_0xabcbcf){var _0x2b02dc,_0x3839e7,_0x466d76;if(_[_0xff59('0x9c')](_0x3d637a[_0xff59('0x64')][_0xff59('0x64')])||_0x3d637a[_0xff59('0x64')]['body']===''){throw new db['Sequelize'][(_0xff59('0x9d'))](_0xff59('0x9f'));}if(_['isNil'](_0x3d637a[_0xff59('0x64')]['to'])){throw new db[(_0xff59('0x8f'))][(_0xff59('0x9d'))](_0xff59('0xbe'));}_0x2b02dc=_0x3d637a[_0xff59('0x64')]['to'];return db['WhatsappAccount'][_0xff59('0x5f')]({'where':{'id':_0x3d637a['params']['id']},'include':[{'model':db[_0xff59('0xa3')],'as':_0xff59('0xbf'),'include':[{'model':db[_0xff59('0x8e')],'as':_0xff59('0xa4'),'where':{'mobile':_0x2b02dc},'limit':0x1,'order':[[_0xff59('0x91'),_0xff59('0xa5')]]}]}]})[_0xff59('0x22')](handleEntityNotFound(_0x45aa8e,null))[_0xff59('0x22')](function(_0x34ecab){if(_0x34ecab&&_0x34ecab[_0xff59('0xbf')]){_0x3839e7=_0x34ecab[_0xff59('0x3a')]({'plain':!![]});if(_0x3839e7[_0xff59('0xbf')]&&_0x3839e7[_0xff59('0xbf')][_0xff59('0xa4')][_0xff59('0x4e')]){return _0x3839e7[_0xff59('0xbf')][_0xff59('0xa4')][0x0];}return db[_0xff59('0x8e')]['create'](_[_0xff59('0x1a')](_0x3d637a['body'],{'firstName':_0x2b02dc,'mobile':_0x2b02dc,'phone':_0x2b02dc,'ListId':_0x3839e7[_0xff59('0x93')]}));}})[_0xff59('0x22')](handleEntityNotFound(_0x45aa8e,null))[_0xff59('0x22')](function(_0x2d2cce){if(_0x2d2cce){_0x466d76=_0x2d2cce;return db[_0xff59('0xa8')]['find']({'where':{'ContactId':_0x466d76['id'],'closed':![],'WhatsappAccountId':_0x3839e7['id']}})[_0xff59('0x22')](function(_0x2a42ff){if(_0x2a42ff){return[_0x2a42ff,![]];}return db[_0xff59('0xa8')][_0xff59('0x60')]({'UserId':_0x3d637a[_0xff59('0x61')]['id'],'ContactId':_0x466d76['id'],'WhatsappAccountId':_0x3839e7['id'],'phone':_0x2b02dc,'firstMsgDirection':_0xff59('0xc0'),'Messages':[_[_0xff59('0x56')](_0x3d637a[_0xff59('0x64')],{'read':![],'body':_0x3d637a[_0xff59('0x64')][_0xff59('0x64')],'phone':_0x2b02dc,'WhatsappAccountId':_0x3839e7['id'],'UserId':_0x3d637a['user']['id'],'ContactId':_0x466d76['id']})]},{'include':[{'model':db[_0xff59('0x89')],'as':_0xff59('0xc1')}]})[_0xff59('0x22')](function(_0x22e8aa){return[_0x22e8aa,!![]];});});}})[_0xff59('0x72')](function(_0x5b2098,_0x36a568){if(_0x36a568){return _0x5b2098;}return db[_0xff59('0x89')][_0xff59('0x60')](_[_0xff59('0x56')](_0x3d637a[_0xff59('0x64')],{'read':![],'body':_0x3d637a[_0xff59('0x64')][_0xff59('0x64')],'phone':_0x2b02dc,'WhatsappAccountId':_0x3839e7['id'],'WhatsappInteractionId':_0x5b2098['id'],'UserId':_0x3d637a[_0xff59('0x61')]['id'],'ContactId':_0x466d76['id']}))[_0xff59('0x22')](function(_0xa3494a){_0x5b2098['dataValues'][_0xff59('0xc1')]=[];_0x5b2098[_0xff59('0xc2')]['Messages'][_0xff59('0xac')](_0xa3494a['dataValues']);return _0x5b2098;});})[_0xff59('0x22')](respondWithResult(_0x45aa8e,null))[_0xff59('0x2d')](handleError(_0x45aa8e,null));}; \ No newline at end of file +var _0x6582=['timestamp','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','ListId','mobile','twilio','from','replace','whatsapp:','Body','messageId','MessageSid','sinch','notifications','message_id','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','Contacts','updatedAt','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','WhatsappQueue','queueId','queue','waitForTheAssignedQueue','Start','entity\x20found','stringify','Content-Type','text/xml','send','\x0a','CmList','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','result','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','WhatsappAccounts','UserProfileResource','name','Pause','map','WhatsappAccount','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','rows','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','getApplications','notify','Applications','account','type','statuses','state','WhatsappMessage'];(function(_0xedd0d5,_0x46cfc9){var _0x4800f4=function(_0x4e1017){while(--_0x4e1017){_0xedd0d5['push'](_0xedd0d5['shift']());}};_0x4800f4(++_0x46cfc9);}(_0x6582,0x108));var _0x2658=function(_0x3de822,_0x5d1466){_0x3de822=_0x3de822-0x0;var _0x1475c9=_0x6582[_0x3de822];return _0x1475c9;};'use strict';var emlformat=require(_0x2658('0x0'));var rimraf=require(_0x2658('0x1'));var zipdir=require(_0x2658('0x2'));var jsonpatch=require(_0x2658('0x3'));var rp=require(_0x2658('0x4'));var moment=require('moment');var BPromise=require(_0x2658('0x5'));var Mustache=require(_0x2658('0x6'));var util=require(_0x2658('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2658('0x8'));var fs=require('fs');var fs_extra=require(_0x2658('0x9'));var _=require(_0x2658('0xa'));var squel=require(_0x2658('0xb'));var crypto=require(_0x2658('0xc'));var jsforce=require(_0x2658('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2658('0xe'));var querystring=require(_0x2658('0xf'));var Papa=require(_0x2658('0x10'));var Redis=require(_0x2658('0x11'));var authService=require(_0x2658('0x12'));var qs=require(_0x2658('0x13'));var as=require(_0x2658('0x14'));var hardwareService=require(_0x2658('0x15'));var logger=require(_0x2658('0x16'))('api');var utils=require(_0x2658('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2658('0x18'));var db=require(_0x2658('0x19'))['db'];config[_0x2658('0x1a')]=_[_0x2658('0x1b')](config[_0x2658('0x1a')],{'host':_0x2658('0x1c'),'port':0x18eb});var socket=require(_0x2658('0x1d'))(new Redis(config['redis']));require(_0x2658('0x1e'))[_0x2658('0x1f')](socket);var jayson=require(_0x2658('0x20'));var client=jayson[_0x2658('0x21')][_0x2658('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x59013b,_0x2fc995,_0x5d8ed5,_0x15bd54){return new BPromise(function(_0x496524,_0xc820a){var _0x44c6d2=_0x15bd54||client;return _0x44c6d2[_0x2658('0x23')](_0x59013b,_0x5d8ed5)[_0x2658('0x24')](function(_0x5c65a7){logger[_0x2658('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x2fc995,_0x2658('0x26'));logger[_0x2658('0x27')](_0x2658('0x28'),_0x2fc995,_0x2658('0x26'),JSON['stringify'](_0x5c65a7));if(_0x5c65a7[_0x2658('0x29')]){if(_0x5c65a7[_0x2658('0x29')][_0x2658('0x2a')]===0x1f4){logger[_0x2658('0x29')](_0x2658('0x2b'),_0x2fc995,_0x5c65a7[_0x2658('0x29')]['message']);return _0xc820a(_0x5c65a7[_0x2658('0x29')]['message']);}logger['error'](_0x2658('0x2b'),_0x2fc995,_0x5c65a7[_0x2658('0x29')]['message']);return _0x496524(_0x5c65a7[_0x2658('0x29')]['message']);}else{logger[_0x2658('0x25')](_0x2658('0x2b'),_0x2fc995,_0x2658('0x26'));_0x496524(_0x5c65a7[_0x2658('0x2c')][_0x2658('0x2d')]);}})[_0x2658('0x2e')](function(_0xe9f81){logger[_0x2658('0x29')](_0x2658('0x2b'),_0x2fc995,_0xe9f81);_0xc820a(_0xe9f81);});});}function respondWithStatusCode(_0x43b6c0,_0x566cec){_0x566cec=_0x566cec||0xcc;return function(_0x2062ef){if(_0x2062ef){return _0x43b6c0[_0x2658('0x2f')](_0x566cec);}return _0x43b6c0[_0x2658('0x30')](_0x566cec)[_0x2658('0x31')]();};}function respondWithResult(_0x25f837,_0x3a4b45){_0x3a4b45=_0x3a4b45||0xc8;return function(_0x58385f){if(_0x58385f){return _0x25f837[_0x2658('0x30')](_0x3a4b45)[_0x2658('0x32')](_0x58385f);}};}function respondWithFilteredResult(_0x2a3141,_0x255759){return function(_0x27e0f5){if(_0x27e0f5){var _0x1492cb=typeof _0x255759[_0x2658('0x33')]===_0x2658('0x34')&&typeof _0x255759[_0x2658('0x35')]===_0x2658('0x34');var _0x2d1fad=_0x27e0f5[_0x2658('0x36')];var _0x291bb4=_0x1492cb?0x0:_0x255759[_0x2658('0x33')];var _0x2c6172=_0x1492cb?_0x27e0f5[_0x2658('0x36')]:_0x255759[_0x2658('0x33')]+_0x255759[_0x2658('0x35')];var _0x47ea74;if(_0x2c6172>=_0x2d1fad){_0x2c6172=_0x2d1fad;_0x47ea74=0xc8;}else{_0x47ea74=0xce;}_0x2a3141[_0x2658('0x30')](_0x47ea74);return _0x2a3141[_0x2658('0x37')](_0x2658('0x38'),_0x291bb4+'-'+_0x2c6172+'/'+_0x2d1fad)['json'](_0x27e0f5);}return null;};}function patchUpdates(_0x3955eb){return function(_0x44db3c){try{jsonpatch[_0x2658('0x39')](_0x44db3c,_0x3955eb,!![]);}catch(_0x5e9e6f){return BPromise[_0x2658('0x3a')](_0x5e9e6f);}return _0x44db3c[_0x2658('0x3b')]();};}function saveUpdates(_0x324403,_0x455e1b){return function(_0x28b0bf){if(_0x28b0bf){return _0x28b0bf[_0x2658('0x3c')](_0x324403)[_0x2658('0x24')](function(_0x1f0640){return _0x1f0640;});}return null;};}function removeEntity(_0xfc7d10,_0x4b96ce){return function(_0x2a9fc9){if(_0x2a9fc9){return _0x2a9fc9[_0x2658('0x3d')]()[_0x2658('0x24')](function(){var _0x4e7578=_0x2a9fc9['get']({'plain':!![]});var _0x5c0f51=_0x2658('0x3e');return db[_0x2658('0x3f')][_0x2658('0x3d')]({'where':{'type':_0x5c0f51,'resourceId':_0x4e7578['id']}})[_0x2658('0x24')](function(){return _0x2a9fc9;});})[_0x2658('0x24')](function(){_0xfc7d10[_0x2658('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b2351,_0x302e36){return function(_0x2b3b99){if(!_0x2b3b99){_0x2b2351['sendStatus'](0x194);}return _0x2b3b99;};}function handleError(_0xb8fd62,_0x3798ba){_0x3798ba=_0x3798ba||0x1f4;return function(_0x117010){logger[_0x2658('0x29')](_0x117010['stack']);if(_0x117010[_0x2658('0x40')]){delete _0x117010[_0x2658('0x40')];}_0xb8fd62['status'](_0x3798ba)['send'](_0x117010);};}exports['index']=function(_0x4fb397,_0x2b5083){var _0x1f6b70={'include':[{'model':db[_0x2658('0x41')],'as':'mandatoryDispositionPause'}]},_0x370026={},_0x5e728d={'count':0x0,'rows':[]};var _0x54d14b=_[_0x2658('0x42')](db[_0x2658('0x43')][_0x2658('0x44')],function(_0x52e358){return{'name':_0x52e358['fieldName'],'type':_0x52e358['type']['key']};});_0x370026[_0x2658('0x45')]=_[_0x2658('0x42')](_0x54d14b,_0x2658('0x40'));_0x370026[_0x2658('0x46')]=_['keys'](_0x4fb397[_0x2658('0x46')]);_0x370026[_0x2658('0x47')]=_[_0x2658('0x48')](_0x370026[_0x2658('0x45')],_0x370026[_0x2658('0x46')]);_0x1f6b70['attributes']=_[_0x2658('0x48')](_0x370026[_0x2658('0x45')],qs[_0x2658('0x49')](_0x4fb397[_0x2658('0x46')][_0x2658('0x49')]));_0x1f6b70[_0x2658('0x4a')]=_0x1f6b70[_0x2658('0x4a')][_0x2658('0x4b')]?_0x1f6b70[_0x2658('0x4a')]:_0x370026[_0x2658('0x45')];if(!_0x4fb397[_0x2658('0x46')][_0x2658('0x4c')]('nolimit')){_0x1f6b70['limit']=qs[_0x2658('0x35')](_0x4fb397[_0x2658('0x46')][_0x2658('0x35')]);_0x1f6b70['offset']=qs[_0x2658('0x33')](_0x4fb397[_0x2658('0x46')][_0x2658('0x33')]);}_0x1f6b70[_0x2658('0x4d')]=qs['sort'](_0x4fb397[_0x2658('0x46')][_0x2658('0x4e')]);_0x1f6b70[_0x2658('0x4f')]=qs[_0x2658('0x47')](_[_0x2658('0x50')](_0x4fb397[_0x2658('0x46')],_0x370026['filters']),_0x54d14b);if(_0x4fb397[_0x2658('0x46')]['filter']){_0x1f6b70[_0x2658('0x4f')]=_[_0x2658('0x51')](_0x1f6b70['where'],{'$or':_[_0x2658('0x42')](_0x54d14b,function(_0x21f380){if(_0x21f380['type']!==_0x2658('0x52')){var _0x14f5ac={};_0x14f5ac[_0x21f380[_0x2658('0x40')]]={'$like':'%'+_0x4fb397[_0x2658('0x46')][_0x2658('0x53')]+'%'};return _0x14f5ac;}})});}_0x1f6b70=_['merge']({},_0x1f6b70,_0x4fb397[_0x2658('0x54')]);var _0x2a43f3={'where':_0x1f6b70['where']};return db[_0x2658('0x43')][_0x2658('0x36')](_0x2a43f3)[_0x2658('0x24')](function(_0x1efb33){_0x5e728d['count']=_0x1efb33;if(_0x4fb397[_0x2658('0x46')][_0x2658('0x55')]){_0x1f6b70[_0x2658('0x56')]=[{'all':!![]}];}return db[_0x2658('0x43')][_0x2658('0x57')](_0x1f6b70);})[_0x2658('0x24')](function(_0x994264){_0x5e728d['rows']=_0x994264;return _0x5e728d;})[_0x2658('0x24')](respondWithFilteredResult(_0x2b5083,_0x1f6b70))['catch'](handleError(_0x2b5083,null));};exports[_0x2658('0x58')]=function(_0x51e522,_0x30da5c){var _0xf4d19f={'raw':![],'where':{'id':_0x51e522[_0x2658('0x59')]['id']},'include':[{'model':db[_0x2658('0x41')],'as':'mandatoryDispositionPause'}]},_0x228d3d={};_0x228d3d[_0x2658('0x45')]=_[_0x2658('0x5a')](db[_0x2658('0x43')]['rawAttributes']);_0x228d3d[_0x2658('0x46')]=_[_0x2658('0x5a')](_0x51e522[_0x2658('0x46')]);_0x228d3d[_0x2658('0x47')]=_['intersection'](_0x228d3d[_0x2658('0x45')],_0x228d3d['query']);_0xf4d19f['attributes']=_[_0x2658('0x48')](_0x228d3d[_0x2658('0x45')],qs[_0x2658('0x49')](_0x51e522['query'][_0x2658('0x49')]));_0xf4d19f[_0x2658('0x4a')]=_0xf4d19f['attributes'][_0x2658('0x4b')]?_0xf4d19f['attributes']:_0x228d3d['model'];if(_0x51e522[_0x2658('0x46')][_0x2658('0x55')]){_0xf4d19f['include']=[{'all':!![]}];}_0xf4d19f=_[_0x2658('0x51')]({},_0xf4d19f,_0x51e522[_0x2658('0x54')]);return db[_0x2658('0x43')]['find'](_0xf4d19f)['then'](handleEntityNotFound(_0x30da5c,null))[_0x2658('0x24')](respondWithResult(_0x30da5c,null))['catch'](handleError(_0x30da5c,null));};exports['create']=function(_0x263a29,_0x5502bb){return db[_0x2658('0x43')][_0x2658('0x5b')](_0x263a29[_0x2658('0x5c')],{})[_0x2658('0x24')](function(_0x22f2dc){var _0x182c0c=_0x263a29[_0x2658('0x5d')]['get']({'plain':!![]});if(!_0x182c0c)throw new Error(_0x2658('0x5e'));if(_0x182c0c['role']===_0x2658('0x5d')){var _0x121405=_0x22f2dc[_0x2658('0x5f')]({'plain':!![]});var _0x41208a='WhatsappAccounts';return db['UserProfileSection'][_0x2658('0x60')]({'where':{'name':_0x41208a,'userProfileId':_0x182c0c[_0x2658('0x61')]},'raw':!![]})['then'](function(_0x5dce22){if(_0x5dce22&&_0x5dce22[_0x2658('0x62')]===0x0){return db[_0x2658('0x3f')][_0x2658('0x5b')]({'name':_0x121405[_0x2658('0x40')],'resourceId':_0x121405['id'],'type':_0x5dce22[_0x2658('0x40')],'sectionId':_0x5dce22['id']},{})['then'](function(){return _0x22f2dc;});}else{return _0x22f2dc;}})[_0x2658('0x2e')](function(_0x566d11){logger[_0x2658('0x29')](_0x2658('0x63'),_0x566d11);throw _0x566d11;});}return _0x22f2dc;})['then'](respondWithResult(_0x5502bb,0xc9))[_0x2658('0x2e')](handleError(_0x5502bb,null));};exports[_0x2658('0x3c')]=function(_0x55b1ec,_0x2405e3){if(_0x55b1ec[_0x2658('0x5c')]['id']){delete _0x55b1ec[_0x2658('0x5c')]['id'];}return db[_0x2658('0x43')]['find']({'where':{'id':_0x55b1ec['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x2658('0x24')](handleEntityNotFound(_0x2405e3,null))['then'](saveUpdates(_0x55b1ec[_0x2658('0x5c')],null))[_0x2658('0x24')](respondWithResult(_0x2405e3,null))[_0x2658('0x2e')](handleError(_0x2405e3,null));};exports[_0x2658('0x3d')]=function(_0x47a6bb,_0x12e573){return db['WhatsappAccount'][_0x2658('0x60')]({'where':{'id':_0x47a6bb[_0x2658('0x59')]['id']}})[_0x2658('0x24')](handleEntityNotFound(_0x12e573,null))[_0x2658('0x24')](removeEntity(_0x12e573,null))['catch'](handleError(_0x12e573,null));};exports[_0x2658('0x64')]=function(_0x4b1610,_0x191889){return db[_0x2658('0x43')][_0x2658('0x64')]()[_0x2658('0x24')](respondWithResult(_0x191889,null))[_0x2658('0x2e')](handleError(_0x191889,null));};exports[_0x2658('0x65')]=function(_0x12ed12,_0x37cab0,_0x5cd263){if(_0x12ed12[_0x2658('0x5c')]['id']){delete _0x12ed12[_0x2658('0x5c')]['id'];}return db[_0x2658('0x43')]['find']({'where':{'id':_0x12ed12[_0x2658('0x59')]['id']}})['then'](handleEntityNotFound(_0x37cab0,null))[_0x2658('0x24')](function(_0x4e69c4){if(_0x4e69c4){_0x12ed12[_0x2658('0x5c')][_0x2658('0x66')]=_0x4e69c4['id'];return db[_0x2658('0x67')]['create'](_0x12ed12['body']);}})['then'](respondWithResult(_0x37cab0,null))['catch'](handleError(_0x37cab0,null));};exports['getDispositions']=function(_0x2d4bb9,_0xd51c51,_0x446895){var _0x107a9e={'raw':![],'where':{}};var _0x4e26f2={};var _0x4267c1={'count':0x0,'rows':[]};return db[_0x2658('0x43')]['findOne']({'where':{'id':_0x2d4bb9[_0x2658('0x59')]['id']}})['then'](handleEntityNotFound(_0xd51c51,null))[_0x2658('0x24')](function(_0x3f62c9){if(_0x3f62c9){_0x4e26f2[_0x2658('0x45')]=_[_0x2658('0x5a')](db[_0x2658('0x67')][_0x2658('0x44')]);_0x4e26f2[_0x2658('0x46')]=_[_0x2658('0x5a')](_0x2d4bb9[_0x2658('0x46')]);_0x4e26f2['filters']=_['intersection'](_0x4e26f2[_0x2658('0x45')],_0x4e26f2[_0x2658('0x46')]);_0x107a9e[_0x2658('0x4a')]=_['intersection'](_0x4e26f2[_0x2658('0x45')],qs[_0x2658('0x49')](_0x2d4bb9[_0x2658('0x46')][_0x2658('0x49')]));_0x107a9e[_0x2658('0x4a')]=_0x107a9e['attributes'][_0x2658('0x4b')]?_0x107a9e[_0x2658('0x4a')]:_0x4e26f2[_0x2658('0x45')];if(!_0x2d4bb9['query'][_0x2658('0x4c')](_0x2658('0x68'))){_0x107a9e[_0x2658('0x35')]=qs[_0x2658('0x35')](_0x2d4bb9['query']['limit']);_0x107a9e['offset']=qs[_0x2658('0x33')](_0x2d4bb9[_0x2658('0x46')][_0x2658('0x33')]);}_0x107a9e[_0x2658('0x4d')]=qs[_0x2658('0x4e')](_0x2d4bb9[_0x2658('0x46')][_0x2658('0x4e')]);_0x107a9e['where']=qs['filters'](_[_0x2658('0x50')](_0x2d4bb9[_0x2658('0x46')],_0x4e26f2['filters']));_0x107a9e['where'][_0x2658('0x66')]=_0x3f62c9['id'];if(_0x2d4bb9[_0x2658('0x46')][_0x2658('0x53')]){_0x107a9e[_0x2658('0x4f')]=_[_0x2658('0x51')](_0x107a9e[_0x2658('0x4f')],{'$or':_[_0x2658('0x42')](_0x107a9e['attributes'],function(_0x4fcfe6){var _0x13e029={};_0x13e029[_0x4fcfe6]={'$like':'%'+_0x2d4bb9['query'][_0x2658('0x53')]+'%'};return _0x13e029;})});}_0x107a9e=_[_0x2658('0x51')]({},_0x107a9e,_0x2d4bb9[_0x2658('0x54')]);return db[_0x2658('0x67')][_0x2658('0x36')]({'where':_0x107a9e['where']})[_0x2658('0x24')](function(_0x4318b7){_0x4267c1[_0x2658('0x36')]=_0x4318b7;if(_0x2d4bb9[_0x2658('0x46')][_0x2658('0x55')]){_0x107a9e['include']=[{'all':!![]}];}return db[_0x2658('0x67')]['findAll'](_0x107a9e);})[_0x2658('0x24')](function(_0x40f776){_0x4267c1['rows']=_0x40f776;return _0x4267c1;});}})[_0x2658('0x24')](respondWithFilteredResult(_0xd51c51,_0x107a9e))['catch'](handleError(_0xd51c51,null));};exports[_0x2658('0x69')]=function(_0x13bc43,_0x272fcb,_0x54aac0){return db[_0x2658('0x43')]['find']({'where':{'id':_0x13bc43['params']['id']}})['then'](handleEntityNotFound(_0x272fcb,null))[_0x2658('0x24')](function(_0x4610e4){if(_0x4610e4){return _0x4610e4[_0x2658('0x69')](_0x13bc43[_0x2658('0x46')][_0x2658('0x6a')]);}})['then'](respondWithStatusCode(_0x272fcb,null))[_0x2658('0x2e')](handleError(_0x272fcb,null));};exports[_0x2658('0x6b')]=function(_0x3a0218,_0x15ba41,_0x368696){if(_0x3a0218[_0x2658('0x5c')]['id']){delete _0x3a0218[_0x2658('0x5c')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x3a0218[_0x2658('0x59')]['id']}})[_0x2658('0x24')](handleEntityNotFound(_0x15ba41,null))[_0x2658('0x24')](function(_0x4c210c){if(_0x4c210c){_0x3a0218[_0x2658('0x5c')][_0x2658('0x66')]=_0x4c210c['id'];return db[_0x2658('0x6c')][_0x2658('0x5b')](_0x3a0218['body']);}})[_0x2658('0x24')](respondWithResult(_0x15ba41,null))[_0x2658('0x2e')](handleError(_0x15ba41,null));};exports[_0x2658('0x6d')]=function(_0x5ecd9b,_0x1a3d83,_0x4c3523){var _0x57d05d={'raw':![],'where':{}};var _0x2a131f={};var _0x5a832a={'count':0x0,'rows':[]};return db[_0x2658('0x43')][_0x2658('0x6e')]({'where':{'id':_0x5ecd9b[_0x2658('0x59')]['id']}})[_0x2658('0x24')](handleEntityNotFound(_0x1a3d83,null))[_0x2658('0x24')](function(_0x207aec){if(_0x207aec){_0x2a131f[_0x2658('0x45')]=_[_0x2658('0x5a')](db[_0x2658('0x6c')][_0x2658('0x44')]);_0x2a131f[_0x2658('0x46')]=_[_0x2658('0x5a')](_0x5ecd9b[_0x2658('0x46')]);_0x2a131f[_0x2658('0x47')]=_[_0x2658('0x48')](_0x2a131f[_0x2658('0x45')],_0x2a131f[_0x2658('0x46')]);_0x57d05d[_0x2658('0x4a')]=_[_0x2658('0x48')](_0x2a131f['model'],qs['fields'](_0x5ecd9b[_0x2658('0x46')][_0x2658('0x49')]));_0x57d05d[_0x2658('0x4a')]=_0x57d05d[_0x2658('0x4a')]['length']?_0x57d05d[_0x2658('0x4a')]:_0x2a131f['model'];if(!_0x5ecd9b[_0x2658('0x46')]['hasOwnProperty'](_0x2658('0x68'))){_0x57d05d[_0x2658('0x35')]=qs[_0x2658('0x35')](_0x5ecd9b[_0x2658('0x46')][_0x2658('0x35')]);_0x57d05d['offset']=qs[_0x2658('0x33')](_0x5ecd9b[_0x2658('0x46')][_0x2658('0x33')]);}_0x57d05d[_0x2658('0x4d')]=qs[_0x2658('0x4e')](_0x5ecd9b['query'][_0x2658('0x4e')]);_0x57d05d[_0x2658('0x4f')]=qs[_0x2658('0x47')](_[_0x2658('0x50')](_0x5ecd9b[_0x2658('0x46')],_0x2a131f[_0x2658('0x47')]));_0x57d05d[_0x2658('0x4f')]['WhatsappAccountId']=_0x207aec['id'];if(_0x5ecd9b[_0x2658('0x46')][_0x2658('0x53')]){_0x57d05d[_0x2658('0x4f')]=_[_0x2658('0x51')](_0x57d05d['where'],{'$or':_[_0x2658('0x42')](_0x57d05d[_0x2658('0x4a')],function(_0x19c57f){var _0x308b74={};_0x308b74[_0x19c57f]={'$like':'%'+_0x5ecd9b[_0x2658('0x46')][_0x2658('0x53')]+'%'};return _0x308b74;})});}_0x57d05d=_['merge']({},_0x57d05d,_0x5ecd9b[_0x2658('0x54')]);return db[_0x2658('0x6c')]['count']({'where':_0x57d05d[_0x2658('0x4f')]})[_0x2658('0x24')](function(_0x1b0fcb){_0x5a832a[_0x2658('0x36')]=_0x1b0fcb;if(_0x5ecd9b['query'][_0x2658('0x55')]){_0x57d05d[_0x2658('0x56')]=[{'all':!![]}];}return db[_0x2658('0x6c')][_0x2658('0x57')](_0x57d05d);})[_0x2658('0x24')](function(_0x33ee12){_0x5a832a[_0x2658('0x6f')]=_0x33ee12;return _0x5a832a;});}})[_0x2658('0x24')](respondWithFilteredResult(_0x1a3d83,_0x57d05d))[_0x2658('0x2e')](handleError(_0x1a3d83,null));};exports['removeAnswers']=function(_0x33d7ae,_0x4d638b,_0x2b9784){return db[_0x2658('0x43')]['find']({'where':{'id':_0x33d7ae[_0x2658('0x59')]['id']}})['then'](handleEntityNotFound(_0x4d638b,null))[_0x2658('0x24')](function(_0x4fef69){if(_0x4fef69){return _0x4fef69['removeAnswers'](_0x33d7ae['query']['ids']);}})[_0x2658('0x24')](respondWithStatusCode(_0x4d638b,null))[_0x2658('0x2e')](handleError(_0x4d638b,null));};exports[_0x2658('0x70')]=function(_0x5c41d3,_0x20e4b8,_0x4b5746){return db[_0x2658('0x43')][_0x2658('0x60')]({'where':{'id':_0x5c41d3[_0x2658('0x59')]['id']}})['then'](handleEntityNotFound(_0x20e4b8,null))[_0x2658('0x24')](function(_0x2fe806){if(_0x2fe806){return _0x2fe806[_0x2658('0x70')](_0x5c41d3[_0x2658('0x5c')][_0x2658('0x6a')],_[_0x2658('0x71')](_0x5c41d3[_0x2658('0x5c')],[_0x2658('0x6a'),'id'])||{})[_0x2658('0x72')](function(_0xa4be8b){for(var _0xa6f685=0x0;_0xa6f685<_0x5c41d3[_0x2658('0x5c')][_0x2658('0x6a')][_0x2658('0x4b')];_0xa6f685+=0x1){socket[_0x2658('0x73')](_0x2658('0x74'),{'UserId':Number(_0x5c41d3[_0x2658('0x5c')][_0x2658('0x6a')][_0xa6f685]),'WhatsappAccountId':Number(_0x5c41d3[_0x2658('0x59')]['id'])});}return _0xa4be8b;});}})[_0x2658('0x24')](respondWithResult(_0x20e4b8,null))[_0x2658('0x2e')](handleError(_0x20e4b8,null));};exports[_0x2658('0x75')]=function(_0x11181a,_0x16a4fe,_0x519492){return db[_0x2658('0x43')][_0x2658('0x60')]({'where':{'id':_0x11181a[_0x2658('0x59')]['id']}})[_0x2658('0x24')](handleEntityNotFound(_0x16a4fe,null))['then'](function(_0x3ae5cb){if(_0x3ae5cb){return _0x3ae5cb[_0x2658('0x75')](_0x11181a[_0x2658('0x46')][_0x2658('0x6a')])['then'](function(){if(_[_0x2658('0x76')](_0x11181a[_0x2658('0x46')][_0x2658('0x6a')])){for(var _0x4568ec=0x0;_0x4568ec<_0x11181a[_0x2658('0x46')][_0x2658('0x6a')]['length'];_0x4568ec+=0x1){socket[_0x2658('0x73')](_0x2658('0x77'),{'UserId':Number(_0x11181a[_0x2658('0x46')][_0x2658('0x6a')][_0x4568ec]),'WhatsappAccountId':Number(_0x11181a['params']['id'])});}}else{socket[_0x2658('0x73')](_0x2658('0x77'),{'UserId':Number(_0x11181a[_0x2658('0x46')][_0x2658('0x6a')]),'WhatsappAccountId':Number(_0x11181a['params']['id'])});}});}})[_0x2658('0x24')](respondWithStatusCode(_0x16a4fe,null))[_0x2658('0x2e')](handleError(_0x16a4fe,null));};exports['getAgents']=function(_0x46733a,_0x4c3361,_0x2010c3){var _0x2573a1={};var _0x3c1443={};var _0xf05e7b;var _0x44f274;return db['WhatsappAccount']['findOne']({'where':{'id':_0x46733a[_0x2658('0x59')]['id']}})[_0x2658('0x24')](handleEntityNotFound(_0x4c3361,null))[_0x2658('0x24')](function(_0x21bfa8){if(_0x21bfa8){_0xf05e7b=_0x21bfa8;_0x3c1443[_0x2658('0x45')]=_[_0x2658('0x5a')](db[_0x2658('0x78')][_0x2658('0x44')]);_0x3c1443['query']=_['keys'](_0x46733a[_0x2658('0x46')]);_0x3c1443[_0x2658('0x47')]=_[_0x2658('0x48')](_0x3c1443[_0x2658('0x45')],_0x3c1443['query']);_0x2573a1[_0x2658('0x4a')]=_[_0x2658('0x48')](_0x3c1443[_0x2658('0x45')],qs[_0x2658('0x49')](_0x46733a[_0x2658('0x46')][_0x2658('0x49')]));_0x2573a1[_0x2658('0x4a')]=_0x2573a1[_0x2658('0x4a')][_0x2658('0x4b')]?_0x2573a1[_0x2658('0x4a')]:_0x3c1443['model'];_0x2573a1['order']=qs[_0x2658('0x4e')](_0x46733a['query']['sort']);_0x2573a1[_0x2658('0x4f')]=qs['filters'](_[_0x2658('0x50')](_0x46733a[_0x2658('0x46')],_0x3c1443[_0x2658('0x47')]));if(_0x46733a[_0x2658('0x46')][_0x2658('0x53')]){_0x2573a1[_0x2658('0x4f')]=_['merge'](_0x2573a1[_0x2658('0x4f')],{'$or':_['map'](_0x2573a1[_0x2658('0x4a')],function(_0x27abad){var _0x232e7d={};_0x232e7d[_0x27abad]={'$like':'%'+_0x46733a['query']['filter']+'%'};return _0x232e7d;})});}_0x2573a1=_[_0x2658('0x51')]({},_0x2573a1,_0x46733a[_0x2658('0x54')]);return _0xf05e7b[_0x2658('0x79')](_0x2573a1);}})[_0x2658('0x24')](function(_0x40dc27){if(_0x40dc27){_0x44f274=_0x40dc27['length'];if(!_0x46733a['query'][_0x2658('0x4c')]('nolimit')){_0x2573a1[_0x2658('0x35')]=qs[_0x2658('0x35')](_0x46733a[_0x2658('0x46')]['limit']);_0x2573a1[_0x2658('0x33')]=qs['offset'](_0x46733a['query'][_0x2658('0x33')]);}return _0xf05e7b[_0x2658('0x79')](_0x2573a1);}})[_0x2658('0x24')](function(_0x64e85d){if(_0x64e85d){return _0x64e85d?{'count':_0x44f274,'rows':_0x64e85d}:null;}})[_0x2658('0x24')](respondWithResult(_0x4c3361,null))['catch'](handleError(_0x4c3361,null));};exports['addApplications']=function(_0x485550,_0x56fd08){var _0x178059=_0x485550['params']['id'];var _0x19a8e7=_0x485550[_0x2658('0x5c')];var _0x364bc1=0xc8;var _0x4a762d=null;return db['sequelize'][_0x2658('0x7a')]({'isolationLevel':db[_0x2658('0x7b')][_0x2658('0x7c')][_0x2658('0x7d')][_0x2658('0x7e')]},function(_0x5524b7){return db[_0x2658('0x43')][_0x2658('0x6e')]({'where':{'id':_0x178059},'transaction':_0x5524b7})[_0x2658('0x24')](function(_0x16c654){if(_0x16c654){return db[_0x2658('0x7f')][_0x2658('0x3d')]({'where':{'WhatsappAccountId':_0x178059},'transaction':_0x5524b7})['then'](function(){var _0x417d02=_['map'](_0x19a8e7,function(_0x302ceb){_0x302ceb[_0x2658('0x66')]=_0x178059;return _0x302ceb;});return db['WhatsappApplication']['bulkCreate'](_0x417d02,{'transaction':_0x5524b7});});}else{_0x364bc1=0x194;_0x4a762d=[];}});})[_0x2658('0x24')](function(){if(_0x364bc1!==0x194){return db[_0x2658('0x7f')][_0x2658('0x80')]({'where':{'WhatsappAccountId':_0x178059},'order':_0x2658('0x81')})[_0x2658('0x24')](function(_0x225ab1){_0x4a762d=_0x225ab1;});}})[_0x2658('0x2e')](function(_0x4c0472){_0x364bc1=0x1f4;logger[_0x2658('0x29')](_0x4c0472['stack']);if(_0x4c0472['name']){delete _0x4c0472[_0x2658('0x40')];}_0x4a762d=_0x4c0472;})['finally'](function(){if(_0x4a762d===null){_0x56fd08[_0x2658('0x2f')](_0x364bc1);}else{if(_0x364bc1===0x1f4){_0x56fd08[_0x2658('0x30')](_0x364bc1)['send'](_0x4a762d);}else{_0x56fd08[_0x2658('0x30')](_0x364bc1)['json'](_0x4a762d);}}});};exports[_0x2658('0x82')]=function(_0x2f02fb,_0x5d899a,_0x1c0ac5){var _0x843f40={};var _0x37f859={};var _0x13839b;var _0x4bc412;return db[_0x2658('0x43')][_0x2658('0x6e')]({'where':{'id':_0x2f02fb[_0x2658('0x59')]['id']}})['then'](handleEntityNotFound(_0x5d899a,null))[_0x2658('0x24')](function(_0x26a2c3){if(_0x26a2c3){_0x13839b=_0x26a2c3;_0x37f859[_0x2658('0x45')]=_['keys'](db['WhatsappApplication']['rawAttributes']);_0x37f859['query']=_[_0x2658('0x5a')](_0x2f02fb[_0x2658('0x46')]);_0x37f859[_0x2658('0x47')]=_['intersection'](_0x37f859[_0x2658('0x45')],_0x37f859['query']);_0x843f40['attributes']=_[_0x2658('0x48')](_0x37f859[_0x2658('0x45')],qs[_0x2658('0x49')](_0x2f02fb[_0x2658('0x46')]['fields']));_0x843f40['attributes']=_0x843f40['attributes'][_0x2658('0x4b')]?_0x843f40[_0x2658('0x4a')]:_0x37f859[_0x2658('0x45')];_0x843f40['order']=qs[_0x2658('0x4e')](_0x2f02fb[_0x2658('0x46')][_0x2658('0x4e')]);_0x843f40[_0x2658('0x4f')]=qs[_0x2658('0x47')](_[_0x2658('0x50')](_0x2f02fb['query'],_0x37f859[_0x2658('0x47')]));if(_0x2f02fb[_0x2658('0x46')][_0x2658('0x53')]){_0x843f40[_0x2658('0x4f')]=_[_0x2658('0x51')](_0x843f40[_0x2658('0x4f')],{'$or':_[_0x2658('0x42')](_0x843f40[_0x2658('0x4a')],function(_0x35a007){var _0x475cbb={};_0x475cbb[_0x35a007]={'$like':'%'+_0x2f02fb[_0x2658('0x46')][_0x2658('0x53')]+'%'};return _0x475cbb;})});}_0x843f40=_[_0x2658('0x51')]({},_0x843f40,_0x2f02fb[_0x2658('0x54')]);return _0x13839b['getApplications'](_0x843f40);}})['then'](function(_0x38120f){if(_0x38120f){_0x4bc412=_0x38120f[_0x2658('0x4b')];if(!_0x2f02fb['query'][_0x2658('0x4c')]('nolimit')){_0x843f40[_0x2658('0x35')]=qs['limit'](_0x2f02fb[_0x2658('0x46')][_0x2658('0x35')]);_0x843f40[_0x2658('0x33')]=qs[_0x2658('0x33')](_0x2f02fb[_0x2658('0x46')]['offset']);}return _0x13839b[_0x2658('0x82')](_0x843f40);}})[_0x2658('0x24')](function(_0x5a64e5){if(_0x5a64e5){return _0x5a64e5?{'count':_0x4bc412,'rows':_0x5a64e5}:null;}})['then'](respondWithResult(_0x5d899a,null))['catch'](handleError(_0x5d899a,null));};exports[_0x2658('0x83')]=function(_0x113285,_0x29c984,_0x3dc03e){var _0x2b4969={'channel':'whatsapp'};var _0x133359=[];var _0x23dcbd=[];var _0x38e6ad={};return db['WhatsappAccount']['find']({'where':{'id':_0x113285['params']['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x2658('0x84')}]})['then'](handleEntityNotFound(_0x29c984,null))[_0x2658('0x24')](function(_0x1404cc){_0x2b4969[_0x2658('0x85')]=_0x1404cc;if(_0x2b4969[_0x2658('0x85')]&&_0x2b4969[_0x2658('0x85')][_0x2658('0x86')]==='sinch'&&_0x113285[_0x2658('0x5c')][_0x2658('0x87')]){if(_0x113285['body'][_0x2658('0x87')][_0x2658('0x4b')]===0x0)return;if(_0x113285[_0x2658('0x5c')][_0x2658('0x87')][0x0][_0x2658('0x88')]!=='read')return;return db[_0x2658('0x89')][_0x2658('0x3c')]({'read':!![],'readAt':_0x113285[_0x2658('0x5c')][_0x2658('0x87')][0x0][_0x2658('0x8a')]},{'where':{'messageId':_0x113285['body'][_0x2658('0x87')][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0xafb481){return _0x29c984[_0x2658('0x30')](0xc8)['json'](_0xafb481);});}_0x2b4969[_0x2658('0x8b')]=_[_0x2658('0x8c')](_0x1404cc[_0x2658('0x84')],[_0x2658('0x81')],[_0x2658('0x8d')]);if(_0x2b4969[_0x2658('0x85')][_0x2658('0x84')]){delete _0x2b4969[_0x2658('0x85')][_0x2658('0x84')];}return db[_0x2658('0x8e')][_0x2658('0x64')]()[_0x2658('0x24')](function(_0xfc20ad){if(!_0xfc20ad){throw new db[(_0x2658('0x8f'))][(_0x2658('0x90'))](_0x2658('0x91'));}_0x133359=_[_0x2658('0x92')](_[_0x2658('0x5a')](_0xfc20ad),[_0x2658('0x93'),'updatedAt']);_0x23dcbd=_['difference'](_[_0x2658('0x5a')](_0xfc20ad),['createdAt','updatedAt','CompanyId',_0x2658('0x94')]);_0x2b4969[_0x2658('0x5c')]={'mapKey':_0x2658('0x95')};if(_0x2b4969[_0x2658('0x85')]&&_0x2b4969[_0x2658('0x85')][_0x2658('0x86')]===_0x2658('0x96')){_0x2b4969[_0x2658('0x5c')][_0x2658('0x97')]=_0x113285[_0x2658('0x5c')]['From'][_0x2658('0x98')](_0x2658('0x99'),'');_0x2b4969['body']['body']=_0x113285[_0x2658('0x5c')][_0x2658('0x9a')];_0x2b4969[_0x2658('0x5c')][_0x2658('0x9b')]=_0x113285[_0x2658('0x5c')][_0x2658('0x9c')];}if(_0x2b4969[_0x2658('0x85')]&&_0x2b4969[_0x2658('0x85')]['type']===_0x2658('0x9d')){_0x2b4969[_0x2658('0x5c')]['from']=_0x113285['body'][_0x2658('0x9e')][0x0][_0x2658('0x97')];_0x2b4969[_0x2658('0x5c')][_0x2658('0x5c')]=_0x113285['body']['notifications'][0x0][_0x2658('0x2d')][_0x2658('0x5c')];_0x2b4969['body'][_0x2658('0x9b')]=_0x113285[_0x2658('0x5c')][_0x2658('0x9e')][0x0][_0x2658('0x9f')];}if(_0x2b4969['body']['id']){delete _0x2b4969[_0x2658('0x5c')]['id'];}if(_['isNil'](_0x2b4969[_0x2658('0x5c')][_0x2658('0x97')])){throw new db[(_0x2658('0x8f'))][(_0x2658('0x90'))](_0x2658('0xa0'));}if(_[_0x2658('0xa1')](_0x2b4969[_0x2658('0x5c')][_0x2658('0x5c')])||_0x2b4969[_0x2658('0x5c')]['body']===''){throw new db['Sequelize'][(_0x2658('0x90'))](_0x2658('0xa2'));}if(_[_0x2658('0xa1')](_0x2b4969[_0x2658('0x5c')][_0x2658('0xa3')])){throw new db['Sequelize'][(_0x2658('0x90'))](_0x2658('0xa4')+_0x23dcbd);}if(!_[_0x2658('0xa5')](_0x23dcbd,_0x2b4969[_0x2658('0x5c')][_0x2658('0xa3')])){throw new db[(_0x2658('0x8f'))][(_0x2658('0x90'))](_0x2658('0xa6')+_0x23dcbd);}_0x38e6ad[_0x2b4969['body'][_0x2658('0xa3')]]=_0x2b4969[_0x2658('0x5c')]['from'];return db['CmList'][_0x2658('0x60')]({'where':{'id':_0x2b4969[_0x2658('0x85')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x2658('0xa7'),'where':_0x38e6ad,'limit':0x1,'order':[[_0x2658('0xa8'),_0x2658('0xa9')]]}]});})[_0x2658('0x24')](handleEntityNotFound(_0x29c984,null))[_0x2658('0x24')](function(_0x1c4325){if(_0x1c4325){_0x2b4969[_0x2658('0xaa')]=_[_0x2658('0x71')](_0x1c4325,['Contacts']);if(_0x1c4325['Contacts'][_0x2658('0x4b')]){return _0x1c4325[_0x2658('0xa7')][0x0];}var _0x4640ad=_[_0x2658('0x1b')](_0x2b4969['body'],{'firstName':_0x2b4969[_0x2658('0x5c')][_0x2658('0x97')],'ListId':_0x1c4325['id']});_0x4640ad[_0x2b4969[_0x2658('0x5c')][_0x2658('0xa3')]]=_0x2b4969['body'][_0x2658('0x97')];return db['CmContact'][_0x2658('0x5b')](_0x4640ad,{'fields':_0x133359,'raw':!![]});}})[_0x2658('0x24')](handleEntityNotFound(_0x29c984,null))['then'](function(_0x568eb3){if(_0x568eb3){_0x2b4969[_0x2658('0xab')]=_0x568eb3;var _0x4f31a7={'ContactId':_0x568eb3['id'],'phone':_0x2b4969[_0x2658('0x5c')][_0x2658('0x97')],'WhatsappAccountId':_0x113285[_0x2658('0x59')]['id']};var _0x419bc5={'ContactId':_0x568eb3['id'],'WhatsappAccountId':_0x113285[_0x2658('0x59')]['id'],'closed':![]};return db[_0x2658('0xac')][_0x2658('0x60')]({'where':_0x419bc5})[_0x2658('0x24')](function(_0x4242f1){if(_0x4242f1){return[_0x4242f1,![]];}return db[_0x2658('0xac')]['create'](_0x4f31a7)[_0x2658('0x24')](function(_0x287992){return[_0x287992,!![]];});});}})[_0x2658('0x72')](function(_0x15d30c,_0x3fe72c){_0x2b4969['interaction']=_0x15d30c['get']({'plain':!![]});_0x2b4969[_0x2658('0xad')][_0x2658('0xae')]=![];if(_0x3fe72c){if(_0x2b4969[_0x2658('0x85')][_0x2658('0xaf')]){_0x2b4969[_0x2658('0x8b')][_0x2658('0xb0')]({'id':0x0,'priority':_0x2b4969[_0x2658('0x8b')][_0x2658('0x4b')]+0x1,'app':_0x2658('0xb1'),'appdata':_0x2658('0xb2'),'interval':'*,*,*,*'});}_0x2b4969[_0x2658('0xad')][_0x2658('0xae')]=!![];}return db['WhatsappMessage'][_0x2658('0x5b')]({'phone':_0x2b4969['body']['from'],'messageId':_0x2b4969[_0x2658('0x5c')][_0x2658('0x9b')],'body':_0x2b4969[_0x2658('0x5c')][_0x2658('0x5c')],'WhatsappAccountId':_0x113285[_0x2658('0x59')]['id'],'WhatsappInteractionId':_0x15d30c['id'],'direction':'in','ContactId':_0x15d30c['ContactId'],'AttachmentId':_0x2b4969['body'][_0x2658('0xb3')]});})['then'](function(_0x287e51){_0x2b4969['message']=_0x287e51;if(!_0x2b4969[_0x2658('0xad')][_0x2658('0xb4')])return;return db['User']['find']({'attributes':['id',_0x2658('0x40')],'where':{'id':_0x2b4969['interaction'][_0x2658('0xb4')]}});})[_0x2658('0x24')](function(_0x2084f8){if(_0x2084f8){_0x2b4969[_0x2658('0x8b')][_0x2658('0xb5')]({'id':0x0,'priority':0x0,'app':_0x2658('0xb6'),'appdata':_0x2084f8[_0x2658('0x40')]+','+(_0x2b4969[_0x2658('0x85')][_0x2658('0xb7')]||0xa),'interval':_0x2658('0xb8')});}if(!_0x2b4969[_0x2658('0xad')]['queueId'])return;return db[_0x2658('0xb9')][_0x2658('0x60')]({'attributes':['id','name'],'where':{'id':_0x2b4969[_0x2658('0xad')][_0x2658('0xba')]}});})[_0x2658('0x24')](function(_0x44bf0f){if(_0x44bf0f){_0x2b4969[_0x2658('0x8b')]['unshift']({'id':0x0,'priority':0x1,'app':_0x2658('0xbb'),'appdata':_0x44bf0f[_0x2658('0x40')]+','+(_0x2b4969[_0x2658('0x85')][_0x2658('0xbc')]||0x12c),'interval':_0x2658('0xb8')});}return respondWithRpcPromise(_0x2658('0xbd'),'startRouting',_0x2b4969);})[_0x2658('0x24')](function(_0x48c0de){if(_0x48c0de){var _0x41cdc4=0xc8;var _0x2d77c4='receiveMessage';logger[_0x2658('0x25')](_0x2658('0x28'),_0x2d77c4,_0x41cdc4,_0x2658('0xbe'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x2d77c4,_0x41cdc4,_0x2658('0xbe'),JSON[_0x2658('0xbf')](_0x48c0de));if(_0x2b4969['account'][_0x2658('0x86')]===_0x2658('0x96')){return _0x29c984['status'](_0x41cdc4)[_0x2658('0x37')](_0x2658('0xc0'),_0x2658('0xc1'))[_0x2658('0xc2')](_0x2658('0xc3'));}else{return _0x29c984[_0x2658('0x30')](_0x41cdc4)[_0x2658('0x32')](_0x48c0de);}}});})[_0x2658('0x2e')](handleError(_0x29c984,null));};exports[_0x2658('0xc2')]=function(_0x3ee50e,_0x3a5f0a,_0x4e35d8){var _0x1182b7,_0x2a4d1c,_0x2e4f95;if(_[_0x2658('0xa1')](_0x3ee50e[_0x2658('0x5c')][_0x2658('0x5c')])||_0x3ee50e[_0x2658('0x5c')]['body']===''){throw new db[(_0x2658('0x8f'))]['ValidationError'](_0x2658('0xa2'));}if(_[_0x2658('0xa1')](_0x3ee50e[_0x2658('0x5c')]['to'])){throw new db['Sequelize'][(_0x2658('0x90'))]('to\x20is\x20mandatory');}_0x1182b7=_0x3ee50e[_0x2658('0x5c')]['to'];return db[_0x2658('0x43')]['find']({'where':{'id':_0x3ee50e['params']['id']},'include':[{'model':db[_0x2658('0xc4')],'as':'List','include':[{'model':db[_0x2658('0x8e')],'as':_0x2658('0xa7'),'where':{'mobile':_0x1182b7},'limit':0x1,'order':[['updatedAt',_0x2658('0xa9')]]}]}]})[_0x2658('0x24')](handleEntityNotFound(_0x3a5f0a,null))[_0x2658('0x24')](function(_0x5886d2){if(_0x5886d2&&_0x5886d2[_0x2658('0xc5')]){_0x2a4d1c=_0x5886d2[_0x2658('0x5f')]({'plain':!![]});if(_0x2a4d1c['List']&&_0x2a4d1c['List'][_0x2658('0xa7')][_0x2658('0x4b')]){return _0x2a4d1c[_0x2658('0xc5')][_0x2658('0xa7')][0x0];}return db[_0x2658('0x8e')][_0x2658('0x5b')](_[_0x2658('0x1b')](_0x3ee50e['body'],{'firstName':_0x1182b7,'mobile':_0x1182b7,'phone':_0x1182b7,'ListId':_0x2a4d1c[_0x2658('0x94')]}));}})[_0x2658('0x24')](handleEntityNotFound(_0x3a5f0a,null))['then'](function(_0xb1f1c5){if(_0xb1f1c5){_0x2e4f95=_0xb1f1c5;return db['WhatsappInteraction'][_0x2658('0x60')]({'where':{'ContactId':_0x2e4f95['id'],'closed':![],'WhatsappAccountId':_0x2a4d1c['id']}})[_0x2658('0x24')](function(_0x5b6ac4){if(_0x5b6ac4){return[_0x5b6ac4,![]];}return db[_0x2658('0xac')][_0x2658('0x5b')]({'UserId':_0x3ee50e[_0x2658('0x5d')]['id'],'ContactId':_0x2e4f95['id'],'WhatsappAccountId':_0x2a4d1c['id'],'phone':_0x1182b7,'firstMsgDirection':_0x2658('0xc6'),'Messages':[_[_0x2658('0x51')](_0x3ee50e[_0x2658('0x5c')],{'read':![],'body':_0x3ee50e['body'][_0x2658('0x5c')],'phone':_0x1182b7,'WhatsappAccountId':_0x2a4d1c['id'],'UserId':_0x3ee50e[_0x2658('0x5d')]['id'],'ContactId':_0x2e4f95['id']})]},{'include':[{'model':db[_0x2658('0x89')],'as':_0x2658('0xc7')}]})[_0x2658('0x24')](function(_0x2a600c){return[_0x2a600c,!![]];});});}})[_0x2658('0x72')](function(_0x4f80de,_0x254390){if(_0x254390){return _0x4f80de;}return db['WhatsappMessage'][_0x2658('0x5b')](_[_0x2658('0x51')](_0x3ee50e[_0x2658('0x5c')],{'read':![],'body':_0x3ee50e[_0x2658('0x5c')][_0x2658('0x5c')],'phone':_0x1182b7,'WhatsappAccountId':_0x2a4d1c['id'],'WhatsappInteractionId':_0x4f80de['id'],'UserId':_0x3ee50e['user']['id'],'ContactId':_0x2e4f95['id']}))[_0x2658('0x24')](function(_0x3cf308){_0x4f80de['dataValues']['Messages']=[];_0x4f80de[_0x2658('0xc8')][_0x2658('0xc7')]['push'](_0x3cf308[_0x2658('0xc8')]);return _0x4f80de;});})[_0x2658('0x24')](respondWithResult(_0x3a5f0a,null))[_0x2658('0x2e')](handleError(_0x3a5f0a,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 32a0e77..4ee0f44 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 _0x6fdc=['hook','../../mysqldb','WhatsappAccount','setMaxListeners','save','remove'];(function(_0x4bfd95,_0x1c3b3b){var _0x1484cd=function(_0x2c622b){while(--_0x2c622b){_0x4bfd95['push'](_0x4bfd95['shift']());}};_0x1484cd(++_0x1c3b3b);}(_0x6fdc,0xdf));var _0xc6fd=function(_0x3f4f3b,_0x2d7be2){_0x3f4f3b=_0x3f4f3b-0x0;var _0xfc6f02=_0x6fdc[_0x3f4f3b];return _0xfc6f02;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xc6fd('0x0'))['db'][_0xc6fd('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xc6fd('0x2')](0x0);var events={'afterCreate':_0xc6fd('0x3'),'afterUpdate':'update','afterDestroy':_0xc6fd('0x4')};function emitEvent(_0x30135d){return function(_0x1631c8,_0x417d48,_0x14f893){WhatsappAccountEvents['emit'](_0x30135d+':'+_0x1631c8['id'],_0x1631c8);WhatsappAccountEvents['emit'](_0x30135d,_0x1631c8);_0x14f893(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xc6fd('0x5')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0xc56f=['emit','../../mysqldb','WhatsappAccount','setMaxListeners','update','remove'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xc56f,0x17b));var _0xfc56=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xc56f[_0x164eca];return _0x2ce562;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xfc56('0x0'))['db'][_0xfc56('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xfc56('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfc56('0x3'),'afterDestroy':_0xfc56('0x4')};function emitEvent(_0x41122c){return function(_0x55845a,_0x37afcf,_0xb1537d){WhatsappAccountEvents[_0xfc56('0x5')](_0x41122c+':'+_0x55845a['id'],_0x55845a);WhatsappAccountEvents[_0xfc56('0x5')](_0x41122c,_0x55845a);_0xb1537d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 6280262..cf61b40 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 _0x3283=['moment','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api'];(function(_0x513c0d,_0x354bb7){var _0x5f4fc2=function(_0x33be2d){while(--_0x33be2d){_0x513c0d['push'](_0x513c0d['shift']());}};_0x5f4fc2(++_0x354bb7);}(_0x3283,0x184));var _0x3328=function(_0x33e453,_0x3df44e){_0x33e453=_0x33e453-0x0;var _0xea660a=_0x3283[_0x33e453];return _0xea660a;};'use strict';var _=require(_0x3328('0x0'));var util=require(_0x3328('0x1'));var logger=require(_0x3328('0x2'))(_0x3328('0x3'));var moment=require(_0x3328('0x4'));var BPromise=require('bluebird');var rp=require(_0x3328('0x5'));var fs=require('fs');var path=require(_0x3328('0x6'));var rimraf=require(_0x3328('0x7'));var config=require(_0x3328('0x8'));var attributes=require(_0x3328('0x9'));module[_0x3328('0xa')]=function(_0x54f093,_0x2afb24){return _0x54f093[_0x3328('0xb')](_0x3328('0xc'),attributes,{'tableName':_0x3328('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa5c=['exports','define','whatsapp_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./whatsappAccount.attributes'];(function(_0x1d55c3,_0x1429d0){var _0x2be1c9=function(_0x3ed0e9){while(--_0x3ed0e9){_0x1d55c3['push'](_0x1d55c3['shift']());}};_0x2be1c9(++_0x1429d0);}(_0xaa5c,0x9d));var _0xcaa5=function(_0x36489a,_0x2878ac){_0x36489a=_0x36489a-0x0;var _0x4fc5ce=_0xaa5c[_0x36489a];return _0x4fc5ce;};'use strict';var _=require(_0xcaa5('0x0'));var util=require('util');var logger=require(_0xcaa5('0x1'))(_0xcaa5('0x2'));var moment=require(_0xcaa5('0x3'));var BPromise=require(_0xcaa5('0x4'));var rp=require(_0xcaa5('0x5'));var fs=require('fs');var path=require(_0xcaa5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcaa5('0x7'));module[_0xcaa5('0x8')]=function(_0x62c7bc,_0x37abec){return _0x62c7bc[_0xcaa5('0x9')]('WhatsappAccount',attributes,{'tableName':_0xcaa5('0xa'),'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 fb9b85b..46af753 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 _0x57c2=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','include','model','attributes','map','catch','lodash','util','moment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x57c2,0x115));var _0x257c=function(_0xb81d62,_0x863f81){_0xb81d62=_0xb81d62-0x0;var _0x9d227=_0x57c2[_0xb81d62];return _0x9d227;};'use strict';var _=require(_0x257c('0x0'));var util=require(_0x257c('0x1'));var moment=require(_0x257c('0x2'));var BPromise=require('bluebird');var rs=require(_0x257c('0x3'));var fs=require('fs');var Redis=require(_0x257c('0x4'));var db=require(_0x257c('0x5'))['db'];var utils=require(_0x257c('0x6'));var logger=require(_0x257c('0x7'))('rpc');var config=require(_0x257c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x257c('0x9')][_0x257c('0xa')]({'port':0x232a});config['redis']=_[_0x257c('0xb')](config[_0x257c('0xc')],{'host':_0x257c('0xd'),'port':0x18eb});var socket=require(_0x257c('0xe'))(new Redis(config['redis']));require(_0x257c('0xf'))[_0x257c('0x10')](socket);function respondWithRpcPromise(_0x2890fd,_0x2b33dc,_0x56fc7b){return new BPromise(function(_0x296bfa,_0x1df4dc){return client[_0x257c('0x11')](_0x2890fd,_0x56fc7b)[_0x257c('0x12')](function(_0x587e46){logger[_0x257c('0x13')](_0x257c('0x14'),_0x2b33dc,_0x257c('0x15'));logger[_0x257c('0x16')](_0x257c('0x17'),_0x2b33dc,_0x257c('0x15'),JSON[_0x257c('0x18')](_0x587e46));if(_0x587e46['error']){if(_0x587e46['error'][_0x257c('0x19')]===0x1f4){logger[_0x257c('0x1a')](_0x257c('0x14'),_0x2b33dc,_0x587e46['error'][_0x257c('0x1b')]);return _0x1df4dc(_0x587e46[_0x257c('0x1a')]['message']);}logger[_0x257c('0x1a')](_0x257c('0x14'),_0x2b33dc,_0x587e46[_0x257c('0x1a')][_0x257c('0x1b')]);return _0x296bfa(_0x587e46[_0x257c('0x1a')][_0x257c('0x1b')]);}else{logger[_0x257c('0x13')](_0x257c('0x14'),_0x2b33dc,'request\x20sent');_0x296bfa(_0x587e46[_0x257c('0x1c')][_0x257c('0x1b')]);}})['catch'](function(_0x46f877){logger['error'](_0x257c('0x14'),_0x2b33dc,_0x46f877);_0x1df4dc(_0x46f877);});});}exports[_0x257c('0x1d')]=function(_0x3bccd8){var _0x4f7cd0=this;return new Promise(function(_0x35362f,_0x3e5c29){return db[_0x257c('0x1e')][_0x257c('0x1f')]({'raw':_0x3bccd8[_0x257c('0x20')]?_0x3bccd8['options'][_0x257c('0x21')]===undefined?!![]:![]:!![],'where':_0x3bccd8[_0x257c('0x20')]?_0x3bccd8[_0x257c('0x20')][_0x257c('0x22')]||null:null,'attributes':_0x3bccd8['options']?_0x3bccd8[_0x257c('0x20')]['attributes']||null:null,'include':_0x3bccd8['options']?_0x3bccd8[_0x257c('0x20')][_0x257c('0x23')]?_['map'](_0x3bccd8[_0x257c('0x20')][_0x257c('0x23')],function(_0x2bb239){return{'model':db[_0x2bb239[_0x257c('0x24')]],'as':_0x2bb239['as'],'attributes':_0x2bb239[_0x257c('0x25')],'include':_0x2bb239[_0x257c('0x23')]?_[_0x257c('0x26')](_0x2bb239[_0x257c('0x23')],function(_0x1723b5){return{'model':db[_0x1723b5[_0x257c('0x24')]],'as':_0x1723b5['as'],'attributes':_0x1723b5[_0x257c('0x25')],'include':_0x1723b5[_0x257c('0x23')]?_[_0x257c('0x26')](_0x1723b5[_0x257c('0x23')],function(_0x189ac5){return{'model':db[_0x189ac5[_0x257c('0x24')]],'as':_0x189ac5['as'],'attributes':_0x189ac5[_0x257c('0x25')]};}):[]};}):[]};}):[]:[]})[_0x257c('0x12')](function(_0x5f4313){logger[_0x257c('0x13')]('ShowWhatsappAccount',_0x3bccd8);logger[_0x257c('0x16')](_0x257c('0x1d'),_0x3bccd8,JSON[_0x257c('0x18')](_0x5f4313));_0x35362f(_0x5f4313);})[_0x257c('0x27')](function(_0x5a7685){logger['error'](_0x257c('0x1d'),_0x5a7685[_0x257c('0x1b')],_0x3bccd8);_0x3e5c29(_0x4f7cd0[_0x257c('0x1a')](0x1f4,_0x5a7685['message']));});});}; \ No newline at end of file +var _0x7fbe=['ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','WhatsappAccount,\x20%s,\x20%s'];(function(_0x4e42ed,_0xd26a6){var _0x16dbac=function(_0x17fbf3){while(--_0x17fbf3){_0x4e42ed['push'](_0x4e42ed['shift']());}};_0x16dbac(++_0xd26a6);}(_0x7fbe,0xbe));var _0xe7fb=function(_0x1a9f8b,_0x53ac1b){_0x1a9f8b=_0x1a9f8b-0x0;var _0x12a2c1=_0x7fbe[_0x1a9f8b];return _0x12a2c1;};'use strict';var _=require(_0xe7fb('0x0'));var util=require(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require('../../config/logger')(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var jayson=require(_0xe7fb('0x8'));var client=jayson[_0xe7fb('0x9')][_0xe7fb('0xa')]({'port':0x232a});config[_0xe7fb('0xb')]=_[_0xe7fb('0xc')](config[_0xe7fb('0xb')],{'host':_0xe7fb('0xd'),'port':0x18eb});var socket=require(_0xe7fb('0xe'))(new Redis(config['redis']));require(_0xe7fb('0xf'))['register'](socket);function respondWithRpcPromise(_0x510118,_0x33eaec,_0xf5f625){return new BPromise(function(_0x142261,_0x196335){return client[_0xe7fb('0x10')](_0x510118,_0xf5f625)[_0xe7fb('0x11')](function(_0x49ce3a){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x33eaec,'request\x20sent');logger[_0xe7fb('0x12')](_0xe7fb('0x13'),_0x33eaec,_0xe7fb('0x14'),JSON[_0xe7fb('0x15')](_0x49ce3a));if(_0x49ce3a['error']){if(_0x49ce3a['error']['code']===0x1f4){logger[_0xe7fb('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x33eaec,_0x49ce3a['error']['message']);return _0x196335(_0x49ce3a[_0xe7fb('0x16')][_0xe7fb('0x17')]);}logger[_0xe7fb('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x33eaec,_0x49ce3a[_0xe7fb('0x16')][_0xe7fb('0x17')]);return _0x142261(_0x49ce3a[_0xe7fb('0x16')][_0xe7fb('0x17')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x33eaec,_0xe7fb('0x14'));_0x142261(_0x49ce3a['result'][_0xe7fb('0x17')]);}})[_0xe7fb('0x18')](function(_0x3bb92a){logger[_0xe7fb('0x16')](_0xe7fb('0x19'),_0x33eaec,_0x3bb92a);_0x196335(_0x3bb92a);});});}exports[_0xe7fb('0x1a')]=function(_0x1ec229){var _0x53b787=this;return new Promise(function(_0x30308c,_0x1590d5){return db[_0xe7fb('0x1b')][_0xe7fb('0x1c')]({'raw':_0x1ec229[_0xe7fb('0x1d')]?_0x1ec229[_0xe7fb('0x1d')][_0xe7fb('0x1e')]===undefined?!![]:![]:!![],'where':_0x1ec229[_0xe7fb('0x1d')]?_0x1ec229[_0xe7fb('0x1d')][_0xe7fb('0x1f')]||null:null,'attributes':_0x1ec229['options']?_0x1ec229[_0xe7fb('0x1d')][_0xe7fb('0x20')]||null:null,'include':_0x1ec229[_0xe7fb('0x1d')]?_0x1ec229[_0xe7fb('0x1d')][_0xe7fb('0x21')]?_[_0xe7fb('0x22')](_0x1ec229['options'][_0xe7fb('0x21')],function(_0x5a56eb){return{'model':db[_0x5a56eb[_0xe7fb('0x23')]],'as':_0x5a56eb['as'],'attributes':_0x5a56eb['attributes'],'include':_0x5a56eb['include']?_[_0xe7fb('0x22')](_0x5a56eb[_0xe7fb('0x21')],function(_0x543604){return{'model':db[_0x543604['model']],'as':_0x543604['as'],'attributes':_0x543604[_0xe7fb('0x20')],'include':_0x543604['include']?_[_0xe7fb('0x22')](_0x543604[_0xe7fb('0x21')],function(_0x5e1883){return{'model':db[_0x5e1883['model']],'as':_0x5e1883['as'],'attributes':_0x5e1883[_0xe7fb('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe7fb('0x11')](function(_0x3a7770){logger['info']('ShowWhatsappAccount',_0x1ec229);logger[_0xe7fb('0x12')](_0xe7fb('0x1a'),_0x1ec229,JSON[_0xe7fb('0x15')](_0x3a7770));_0x30308c(_0x3a7770);})[_0xe7fb('0x18')](function(_0x25b2ee){logger[_0xe7fb('0x16')](_0xe7fb('0x1a'),_0x25b2ee['message'],_0x1ec229);_0x1590d5(_0x53b787[_0xe7fb('0x16')](0x1f4,_0x25b2ee[_0xe7fb('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 91c5d26..4888240 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 _0x31ac=['save','update','removeListener','register','length','whatsappAccount:'];(function(_0x2d43e3,_0x814574){var _0x4b46d9=function(_0xb9ec98){while(--_0xb9ec98){_0x2d43e3['push'](_0x2d43e3['shift']());}};_0x4b46d9(++_0x814574);}(_0x31ac,0x1c8));var _0xc31a=function(_0x2ffcac,_0x13706e){_0x2ffcac=_0x2ffcac-0x0;var _0x1ae5a=_0x31ac[_0x2ffcac];return _0x1ae5a;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xc31a('0x0'),'remove',_0xc31a('0x1')];function createListener(_0x373a13,_0x1d5be3){return function(_0x1ae156){_0x1d5be3['emit'](_0x373a13,_0x1ae156);};}function removeListener(_0x39f941,_0xfbf3c1){return function(){WhatsappAccountEvents[_0xc31a('0x2')](_0x39f941,_0xfbf3c1);};}exports[_0xc31a('0x3')]=function(_0x2a3c8b){for(var _0x5f18a0=0x0,_0x6b5948=events[_0xc31a('0x4')];_0x5f18a0<_0x6b5948;_0x5f18a0++){var _0x32cd40=events[_0x5f18a0];var _0x41d885=createListener(_0xc31a('0x5')+_0x32cd40,_0x2a3c8b);WhatsappAccountEvents['on'](_0x32cd40,_0x41d885);}}; \ No newline at end of file +var _0x9044=['update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events','remove'];(function(_0x478f10,_0x194d86){var _0x47c5e9=function(_0x58f932){while(--_0x58f932){_0x478f10['push'](_0x478f10['shift']());}};_0x47c5e9(++_0x194d86);}(_0x9044,0x86));var _0x4904=function(_0x22033b,_0x15843b){_0x22033b=_0x22033b-0x0;var _0x5eb7e5=_0x9044[_0x22033b];return _0x5eb7e5;};'use strict';var WhatsappAccountEvents=require(_0x4904('0x0'));var events=['save',_0x4904('0x1'),_0x4904('0x2')];function createListener(_0x31f6d5,_0x51e550){return function(_0x4b274a){_0x51e550[_0x4904('0x3')](_0x31f6d5,_0x4b274a);};}function removeListener(_0x96ac38,_0x2233b9){return function(){WhatsappAccountEvents[_0x4904('0x4')](_0x96ac38,_0x2233b9);};}exports[_0x4904('0x5')]=function(_0x4c6eb1){for(var _0x5bd14a=0x0,_0x4547d5=events[_0x4904('0x6')];_0x5bd14a<_0x4547d5;_0x5bd14a++){var _0x4e7a90=events[_0x5bd14a];var _0x24898e=createListener(_0x4904('0x7')+_0x4e7a90,_0x4c6eb1);WhatsappAccountEvents['on'](_0x4e7a90,_0x24898e);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index d9c916a..0bae465 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 _0x5bc8=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','update','delete','exports','util','path','connect-timeout'];(function(_0x59b0c5,_0x327501){var _0x20c952=function(_0x5673d0){while(--_0x5673d0){_0x59b0c5['push'](_0x59b0c5['shift']());}};_0x20c952(++_0x327501);}(_0x5bc8,0x7b));var _0x85bc=function(_0x25a42a,_0x3d489b){_0x25a42a=_0x25a42a-0x0;var _0x1129b1=_0x5bc8[_0x25a42a];return _0x1129b1;};'use strict';var multer=require('multer');var util=require(_0x85bc('0x0'));var path=require(_0x85bc('0x1'));var timeout=require(_0x85bc('0x2'));var express=require(_0x85bc('0x3'));var router=express[_0x85bc('0x4')]();var fs_extra=require(_0x85bc('0x5'));var auth=require(_0x85bc('0x6'));var interaction=require(_0x85bc('0x7'));var config=require(_0x85bc('0x8'));var controller=require('./whatsappApplication.controller');router[_0x85bc('0x9')]('/',auth[_0x85bc('0xa')](),controller[_0x85bc('0xb')]);router['get'](_0x85bc('0xc'),auth[_0x85bc('0xa')](),controller['show']);router[_0x85bc('0xd')]('/',auth[_0x85bc('0xa')](),controller[_0x85bc('0xe')]);router['put'](_0x85bc('0xc'),auth[_0x85bc('0xa')](),controller[_0x85bc('0xf')]);router[_0x85bc('0x10')]('/:id',auth[_0x85bc('0xa')](),controller['destroy']);module[_0x85bc('0x11')]=router; \ No newline at end of file +var _0x38d3=['isAuthenticated','create','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','show'];(function(_0x7cb10c,_0x2fcc3a){var _0x11df59=function(_0x75305f){while(--_0x75305f){_0x7cb10c['push'](_0x7cb10c['shift']());}};_0x11df59(++_0x2fcc3a);}(_0x38d3,0xef));var _0x338d=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x38d3[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x338d('0x0'));var util=require(_0x338d('0x1'));var path=require(_0x338d('0x2'));var timeout=require(_0x338d('0x3'));var express=require(_0x338d('0x4'));var router=express['Router']();var fs_extra=require(_0x338d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x338d('0x6'));var config=require(_0x338d('0x7'));var controller=require(_0x338d('0x8'));router[_0x338d('0x9')]('/',auth['isAuthenticated'](),controller[_0x338d('0xa')]);router[_0x338d('0x9')](_0x338d('0xb'),auth['isAuthenticated'](),controller[_0x338d('0xc')]);router['post']('/',auth[_0x338d('0xd')](),controller[_0x338d('0xe')]);router[_0x338d('0xf')](_0x338d('0xb'),auth[_0x338d('0xd')](),controller[_0x338d('0x10')]);router['delete'](_0x338d('0xb'),auth[_0x338d('0xd')](),controller[_0x338d('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index ade8943..657aebf 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 _0xbf26=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x20c5b1,_0x1e98f5){var _0x856c2e=function(_0x3a00cd){while(--_0x3a00cd){_0x20c5b1['push'](_0x20c5b1['shift']());}};_0x856c2e(++_0x1e98f5);}(_0xbf26,0xcf));var _0x6bf2=function(_0x1a4e65,_0x477f1b){_0x1a4e65=_0x1a4e65-0x0;var _0x3c371e=_0xbf26[_0x1a4e65];return _0x3c371e;};'use strict';var Sequelize=require('sequelize');module[_0x6bf2('0x0')]={'priority':{'type':Sequelize[_0x6bf2('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x6bf2('0x2')],'allowNull':![],'defaultValue':_0x6bf2('0x3')},'appdata':{'type':Sequelize[_0x6bf2('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6bf2('0x5')}}; \ No newline at end of file +var _0xc4b7=['sequelize','exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x1dfef9,_0x38e3d5){var _0x47326c=function(_0x1022dd){while(--_0x1022dd){_0x1dfef9['push'](_0x1dfef9['shift']());}};_0x47326c(++_0x38e3d5);}(_0xc4b7,0x10a));var _0x7c4b=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xc4b7[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require(_0x7c4b('0x0'));module[_0x7c4b('0x1')]={'priority':{'type':Sequelize[_0x7c4b('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7c4b('0x3')},'appdata':{'type':Sequelize[_0x7c4b('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7c4b('0x5')],'defaultValue':_0x7c4b('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index fd633ea..08101a7 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 _0x9b09=['create','body','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','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','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','includeAll','rows','catch','include','find'];(function(_0x4fb14d,_0x40b7ea){var _0x269f6c=function(_0x23ee02){while(--_0x23ee02){_0x4fb14d['push'](_0x4fb14d['shift']());}};_0x269f6c(++_0x40b7ea);}(_0x9b09,0x1ad));var _0x99b0=function(_0x3c2666,_0x15fd23){_0x3c2666=_0x3c2666-0x0;var _0x10c814=_0x9b09[_0x3c2666];return _0x10c814;};'use strict';var emlformat=require(_0x99b0('0x0'));var rimraf=require(_0x99b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99b0('0x2'));var rp=require(_0x99b0('0x3'));var moment=require('moment');var BPromise=require(_0x99b0('0x4'));var Mustache=require('mustache');var util=require(_0x99b0('0x5'));var path=require('path');var sox=require(_0x99b0('0x6'));var csv=require(_0x99b0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99b0('0x8'));var _=require(_0x99b0('0x9'));var squel=require('squel');var crypto=require(_0x99b0('0xa'));var jsforce=require(_0x99b0('0xb'));var deskjs=require(_0x99b0('0xc'));var toCsv=require(_0x99b0('0x7'));var querystring=require(_0x99b0('0xd'));var Papa=require('papaparse');var Redis=require(_0x99b0('0xe'));var authService=require(_0x99b0('0xf'));var qs=require(_0x99b0('0x10'));var as=require(_0x99b0('0x11'));var hardwareService=require(_0x99b0('0x12'));var logger=require('../../config/logger')(_0x99b0('0x13'));var utils=require(_0x99b0('0x14'));var config=require(_0x99b0('0x15'));var licenseUtil=require(_0x99b0('0x16'));var db=require(_0x99b0('0x17'))['db'];function respondWithStatusCode(_0x42be76,_0x57d64d){_0x57d64d=_0x57d64d||0xcc;return function(_0x256c0b){if(_0x256c0b){return _0x42be76['sendStatus'](_0x57d64d);}return _0x42be76[_0x99b0('0x18')](_0x57d64d)[_0x99b0('0x19')]();};}function respondWithResult(_0x5baf0c,_0x5bba73){_0x5bba73=_0x5bba73||0xc8;return function(_0x27142a){if(_0x27142a){return _0x5baf0c[_0x99b0('0x18')](_0x5bba73)[_0x99b0('0x1a')](_0x27142a);}};}function respondWithFilteredResult(_0x590aa4,_0x4cfd10){return function(_0x4a6b01){if(_0x4a6b01){var _0x2e176f=typeof _0x4cfd10[_0x99b0('0x1b')]==='undefined'&&typeof _0x4cfd10[_0x99b0('0x1c')]===_0x99b0('0x1d');var _0xaa1009=_0x4a6b01[_0x99b0('0x1e')];var _0x1cb302=_0x2e176f?0x0:_0x4cfd10[_0x99b0('0x1b')];var _0x193512=_0x2e176f?_0x4a6b01['count']:_0x4cfd10[_0x99b0('0x1b')]+_0x4cfd10[_0x99b0('0x1c')];var _0x1fb89b;if(_0x193512>=_0xaa1009){_0x193512=_0xaa1009;_0x1fb89b=0xc8;}else{_0x1fb89b=0xce;}_0x590aa4[_0x99b0('0x18')](_0x1fb89b);return _0x590aa4[_0x99b0('0x1f')](_0x99b0('0x20'),_0x1cb302+'-'+_0x193512+'/'+_0xaa1009)[_0x99b0('0x1a')](_0x4a6b01);}return null;};}function patchUpdates(_0x1783ca){return function(_0x310894){try{jsonpatch[_0x99b0('0x21')](_0x310894,_0x1783ca,!![]);}catch(_0x3988c4){return BPromise[_0x99b0('0x22')](_0x3988c4);}return _0x310894[_0x99b0('0x23')]();};}function saveUpdates(_0x1d5f41,_0x462af1){return function(_0x93dcb1){if(_0x93dcb1){return _0x93dcb1[_0x99b0('0x24')](_0x1d5f41)[_0x99b0('0x25')](function(_0x1d7022){return _0x1d7022;});}return null;};}function removeEntity(_0x27b238,_0x35bae9){return function(_0x28f11d){if(_0x28f11d){return _0x28f11d[_0x99b0('0x26')]()[_0x99b0('0x25')](function(){_0x27b238['status'](0xcc)[_0x99b0('0x19')]();});}};}function handleEntityNotFound(_0x4a6c0f,_0x55f4f1){return function(_0x34075a){if(!_0x34075a){_0x4a6c0f[_0x99b0('0x27')](0x194);}return _0x34075a;};}function handleError(_0x123f1b,_0x8df666){_0x8df666=_0x8df666||0x1f4;return function(_0x3ba9c1){logger['error'](_0x3ba9c1[_0x99b0('0x28')]);if(_0x3ba9c1[_0x99b0('0x29')]){delete _0x3ba9c1[_0x99b0('0x29')];}_0x123f1b[_0x99b0('0x18')](_0x8df666)['send'](_0x3ba9c1);};}exports[_0x99b0('0x2a')]=function(_0x2e0850,_0x5429cd){var _0x3421e3={},_0x35ecdb={},_0x27ced8={'count':0x0,'rows':[]};var _0x22a098=_[_0x99b0('0x2b')](db[_0x99b0('0x2c')][_0x99b0('0x2d')],function(_0x398885){return{'name':_0x398885[_0x99b0('0x2e')],'type':_0x398885['type'][_0x99b0('0x2f')]};});_0x35ecdb[_0x99b0('0x30')]=_[_0x99b0('0x2b')](_0x22a098,_0x99b0('0x29'));_0x35ecdb[_0x99b0('0x31')]=_[_0x99b0('0x32')](_0x2e0850['query']);_0x35ecdb[_0x99b0('0x33')]=_[_0x99b0('0x34')](_0x35ecdb[_0x99b0('0x30')],_0x35ecdb[_0x99b0('0x31')]);_0x3421e3[_0x99b0('0x35')]=_[_0x99b0('0x34')](_0x35ecdb[_0x99b0('0x30')],qs[_0x99b0('0x36')](_0x2e0850['query'][_0x99b0('0x36')]));_0x3421e3['attributes']=_0x3421e3[_0x99b0('0x35')][_0x99b0('0x37')]?_0x3421e3['attributes']:_0x35ecdb[_0x99b0('0x30')];if(!_0x2e0850['query']['hasOwnProperty'](_0x99b0('0x38'))){_0x3421e3[_0x99b0('0x1c')]=qs['limit'](_0x2e0850['query'][_0x99b0('0x1c')]);_0x3421e3[_0x99b0('0x1b')]=qs['offset'](_0x2e0850[_0x99b0('0x31')]['offset']);}_0x3421e3[_0x99b0('0x39')]=qs['sort'](_0x2e0850[_0x99b0('0x31')][_0x99b0('0x3a')]);_0x3421e3[_0x99b0('0x3b')]=qs['filters'](_[_0x99b0('0x3c')](_0x2e0850['query'],_0x35ecdb[_0x99b0('0x33')]),_0x22a098);if(_0x2e0850['query'][_0x99b0('0x3d')]){_0x3421e3[_0x99b0('0x3b')]=_[_0x99b0('0x3e')](_0x3421e3[_0x99b0('0x3b')],{'$or':_[_0x99b0('0x2b')](_0x22a098,function(_0x38af80){if(_0x38af80['type']!=='VIRTUAL'){var _0xb9e8a9={};_0xb9e8a9[_0x38af80[_0x99b0('0x29')]]={'$like':'%'+_0x2e0850[_0x99b0('0x31')][_0x99b0('0x3d')]+'%'};return _0xb9e8a9;}})});}_0x3421e3=_[_0x99b0('0x3e')]({},_0x3421e3,_0x2e0850['options']);var _0xace47b={'where':_0x3421e3['where']};return db['WhatsappApplication'][_0x99b0('0x1e')](_0xace47b)[_0x99b0('0x25')](function(_0x42b7b4){_0x27ced8['count']=_0x42b7b4;if(_0x2e0850['query'][_0x99b0('0x3f')]){_0x3421e3['include']=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x3421e3);})['then'](function(_0x1469eb){_0x27ced8[_0x99b0('0x40')]=_0x1469eb;return _0x27ced8;})['then'](respondWithFilteredResult(_0x5429cd,_0x3421e3))[_0x99b0('0x41')](handleError(_0x5429cd,null));};exports['show']=function(_0x68e138,_0x46ae3c){var _0x2911dd={'raw':!![],'where':{'id':_0x68e138['params']['id']}},_0x1ad5be={};_0x1ad5be['model']=_['keys'](db[_0x99b0('0x2c')][_0x99b0('0x2d')]);_0x1ad5be[_0x99b0('0x31')]=_[_0x99b0('0x32')](_0x68e138['query']);_0x1ad5be['filters']=_[_0x99b0('0x34')](_0x1ad5be[_0x99b0('0x30')],_0x1ad5be[_0x99b0('0x31')]);_0x2911dd[_0x99b0('0x35')]=_['intersection'](_0x1ad5be[_0x99b0('0x30')],qs[_0x99b0('0x36')](_0x68e138[_0x99b0('0x31')]['fields']));_0x2911dd[_0x99b0('0x35')]=_0x2911dd[_0x99b0('0x35')]['length']?_0x2911dd['attributes']:_0x1ad5be[_0x99b0('0x30')];if(_0x68e138['query'][_0x99b0('0x3f')]){_0x2911dd[_0x99b0('0x42')]=[{'all':!![]}];}_0x2911dd=_[_0x99b0('0x3e')]({},_0x2911dd,_0x68e138['options']);return db[_0x99b0('0x2c')][_0x99b0('0x43')](_0x2911dd)[_0x99b0('0x25')](handleEntityNotFound(_0x46ae3c,null))[_0x99b0('0x25')](respondWithResult(_0x46ae3c,null))['catch'](handleError(_0x46ae3c,null));};exports['create']=function(_0x57cea0,_0x663789){return db['WhatsappApplication'][_0x99b0('0x44')](_0x57cea0[_0x99b0('0x45')],{})[_0x99b0('0x25')](respondWithResult(_0x663789,0xc9))[_0x99b0('0x41')](handleError(_0x663789,null));};exports[_0x99b0('0x24')]=function(_0x1ddf18,_0x4bcb1d){if(_0x1ddf18['body']['id']){delete _0x1ddf18[_0x99b0('0x45')]['id'];}return db['WhatsappApplication'][_0x99b0('0x43')]({'where':{'id':_0x1ddf18[_0x99b0('0x46')]['id']}})[_0x99b0('0x25')](handleEntityNotFound(_0x4bcb1d,null))[_0x99b0('0x25')](saveUpdates(_0x1ddf18[_0x99b0('0x45')],null))[_0x99b0('0x25')](respondWithResult(_0x4bcb1d,null))[_0x99b0('0x41')](handleError(_0x4bcb1d,null));};exports[_0x99b0('0x26')]=function(_0x2a15dc,_0x5ca074){return db[_0x99b0('0x2c')][_0x99b0('0x43')]({'where':{'id':_0x2a15dc[_0x99b0('0x46')]['id']}})[_0x99b0('0x25')](handleEntityNotFound(_0x5ca074,null))[_0x99b0('0x25')](removeEntity(_0x5ca074,null))[_0x99b0('0x41')](handleError(_0x5ca074,null));}; \ No newline at end of file +var _0x10ad=['filters','intersection','attributes','fields','length','model','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','save','update','then','destroy','end','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','query','keys'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x10ad,0xf4));var _0xd10a=function(_0x5d8086,_0x4f3f72){_0x5d8086=_0x5d8086-0x0;var _0x55857f=_0x10ad[_0x5d8086];return _0x55857f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd10a('0x0'));var rp=require('request-promise');var moment=require(_0xd10a('0x1'));var BPromise=require(_0xd10a('0x2'));var Mustache=require(_0xd10a('0x3'));var util=require(_0xd10a('0x4'));var path=require('path');var sox=require(_0xd10a('0x5'));var csv=require(_0xd10a('0x6'));var ejs=require(_0xd10a('0x7'));var fs=require('fs');var fs_extra=require(_0xd10a('0x8'));var _=require(_0xd10a('0x9'));var squel=require(_0xd10a('0xa'));var crypto=require(_0xd10a('0xb'));var jsforce=require(_0xd10a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd10a('0xd'));var Papa=require('papaparse');var Redis=require(_0xd10a('0xe'));var authService=require(_0xd10a('0xf'));var qs=require(_0xd10a('0x10'));var as=require(_0xd10a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd10a('0x12'))(_0xd10a('0x13'));var utils=require(_0xd10a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd10a('0x15'));var db=require(_0xd10a('0x16'))['db'];function respondWithStatusCode(_0x45441a,_0x42b94d){_0x42b94d=_0x42b94d||0xcc;return function(_0x2142be){if(_0x2142be){return _0x45441a[_0xd10a('0x17')](_0x42b94d);}return _0x45441a['status'](_0x42b94d)['end']();};}function respondWithResult(_0x289066,_0x388c6f){_0x388c6f=_0x388c6f||0xc8;return function(_0x30f838){if(_0x30f838){return _0x289066[_0xd10a('0x18')](_0x388c6f)['json'](_0x30f838);}};}function respondWithFilteredResult(_0x50403e,_0x1c04a7){return function(_0x17fdd7){if(_0x17fdd7){var _0x143557=typeof _0x1c04a7[_0xd10a('0x19')]===_0xd10a('0x1a')&&typeof _0x1c04a7[_0xd10a('0x1b')]===_0xd10a('0x1a');var _0x1ec13f=_0x17fdd7[_0xd10a('0x1c')];var _0x48a07b=_0x143557?0x0:_0x1c04a7['offset'];var _0x40dd9f=_0x143557?_0x17fdd7[_0xd10a('0x1c')]:_0x1c04a7['offset']+_0x1c04a7['limit'];var _0x53ca7c;if(_0x40dd9f>=_0x1ec13f){_0x40dd9f=_0x1ec13f;_0x53ca7c=0xc8;}else{_0x53ca7c=0xce;}_0x50403e[_0xd10a('0x18')](_0x53ca7c);return _0x50403e[_0xd10a('0x1d')]('Content-Range',_0x48a07b+'-'+_0x40dd9f+'/'+_0x1ec13f)[_0xd10a('0x1e')](_0x17fdd7);}return null;};}function patchUpdates(_0x449c8c){return function(_0x48af70){try{jsonpatch['apply'](_0x48af70,_0x449c8c,!![]);}catch(_0x3ff3f0){return BPromise['reject'](_0x3ff3f0);}return _0x48af70[_0xd10a('0x1f')]();};}function saveUpdates(_0x35e066,_0x3b20e6){return function(_0x44d295){if(_0x44d295){return _0x44d295[_0xd10a('0x20')](_0x35e066)[_0xd10a('0x21')](function(_0x5dc935){return _0x5dc935;});}return null;};}function removeEntity(_0x43095a,_0x13eefe){return function(_0x4782c6){if(_0x4782c6){return _0x4782c6[_0xd10a('0x22')]()[_0xd10a('0x21')](function(){_0x43095a[_0xd10a('0x18')](0xcc)[_0xd10a('0x23')]();});}};}function handleEntityNotFound(_0x3715fe,_0x50724d){return function(_0x497a38){if(!_0x497a38){_0x3715fe['sendStatus'](0x194);}return _0x497a38;};}function handleError(_0x2a87ff,_0xaf25b5){_0xaf25b5=_0xaf25b5||0x1f4;return function(_0x58f500){logger[_0xd10a('0x24')](_0x58f500[_0xd10a('0x25')]);if(_0x58f500[_0xd10a('0x26')]){delete _0x58f500[_0xd10a('0x26')];}_0x2a87ff[_0xd10a('0x18')](_0xaf25b5)['send'](_0x58f500);};}exports[_0xd10a('0x27')]=function(_0x198715,_0x11de73){var _0x3c5f47={},_0x41e582={},_0xfede68={'count':0x0,'rows':[]};var _0x23f0ff=_[_0xd10a('0x28')](db[_0xd10a('0x29')][_0xd10a('0x2a')],function(_0xa285ad){return{'name':_0xa285ad[_0xd10a('0x2b')],'type':_0xa285ad[_0xd10a('0x2c')][_0xd10a('0x2d')]};});_0x41e582['model']=_['map'](_0x23f0ff,_0xd10a('0x26'));_0x41e582[_0xd10a('0x2e')]=_[_0xd10a('0x2f')](_0x198715[_0xd10a('0x2e')]);_0x41e582[_0xd10a('0x30')]=_[_0xd10a('0x31')](_0x41e582['model'],_0x41e582[_0xd10a('0x2e')]);_0x3c5f47[_0xd10a('0x32')]=_['intersection'](_0x41e582['model'],qs[_0xd10a('0x33')](_0x198715[_0xd10a('0x2e')][_0xd10a('0x33')]));_0x3c5f47[_0xd10a('0x32')]=_0x3c5f47['attributes'][_0xd10a('0x34')]?_0x3c5f47['attributes']:_0x41e582[_0xd10a('0x35')];if(!_0x198715['query']['hasOwnProperty'](_0xd10a('0x36'))){_0x3c5f47[_0xd10a('0x1b')]=qs[_0xd10a('0x1b')](_0x198715['query'][_0xd10a('0x1b')]);_0x3c5f47['offset']=qs[_0xd10a('0x19')](_0x198715[_0xd10a('0x2e')][_0xd10a('0x19')]);}_0x3c5f47[_0xd10a('0x37')]=qs[_0xd10a('0x38')](_0x198715[_0xd10a('0x2e')][_0xd10a('0x38')]);_0x3c5f47['where']=qs[_0xd10a('0x30')](_[_0xd10a('0x39')](_0x198715[_0xd10a('0x2e')],_0x41e582[_0xd10a('0x30')]),_0x23f0ff);if(_0x198715['query'][_0xd10a('0x3a')]){_0x3c5f47[_0xd10a('0x3b')]=_[_0xd10a('0x3c')](_0x3c5f47['where'],{'$or':_['map'](_0x23f0ff,function(_0x42f0a2){if(_0x42f0a2[_0xd10a('0x2c')]!==_0xd10a('0x3d')){var _0x1100f0={};_0x1100f0[_0x42f0a2['name']]={'$like':'%'+_0x198715[_0xd10a('0x2e')]['filter']+'%'};return _0x1100f0;}})});}_0x3c5f47=_[_0xd10a('0x3c')]({},_0x3c5f47,_0x198715[_0xd10a('0x3e')]);var _0x46720a={'where':_0x3c5f47[_0xd10a('0x3b')]};return db[_0xd10a('0x29')][_0xd10a('0x1c')](_0x46720a)[_0xd10a('0x21')](function(_0x5c48aa){_0xfede68[_0xd10a('0x1c')]=_0x5c48aa;if(_0x198715['query']['includeAll']){_0x3c5f47[_0xd10a('0x3f')]=[{'all':!![]}];}return db[_0xd10a('0x29')][_0xd10a('0x40')](_0x3c5f47);})[_0xd10a('0x21')](function(_0x4c14a7){_0xfede68[_0xd10a('0x41')]=_0x4c14a7;return _0xfede68;})[_0xd10a('0x21')](respondWithFilteredResult(_0x11de73,_0x3c5f47))[_0xd10a('0x42')](handleError(_0x11de73,null));};exports[_0xd10a('0x43')]=function(_0x2af23e,_0x3c74e1){var _0x39e48b={'raw':!![],'where':{'id':_0x2af23e[_0xd10a('0x44')]['id']}},_0x32505c={};_0x32505c[_0xd10a('0x35')]=_[_0xd10a('0x2f')](db['WhatsappApplication'][_0xd10a('0x2a')]);_0x32505c[_0xd10a('0x2e')]=_[_0xd10a('0x2f')](_0x2af23e[_0xd10a('0x2e')]);_0x32505c[_0xd10a('0x30')]=_[_0xd10a('0x31')](_0x32505c[_0xd10a('0x35')],_0x32505c['query']);_0x39e48b[_0xd10a('0x32')]=_[_0xd10a('0x31')](_0x32505c[_0xd10a('0x35')],qs[_0xd10a('0x33')](_0x2af23e[_0xd10a('0x2e')]['fields']));_0x39e48b[_0xd10a('0x32')]=_0x39e48b[_0xd10a('0x32')][_0xd10a('0x34')]?_0x39e48b[_0xd10a('0x32')]:_0x32505c[_0xd10a('0x35')];if(_0x2af23e[_0xd10a('0x2e')][_0xd10a('0x45')]){_0x39e48b[_0xd10a('0x3f')]=[{'all':!![]}];}_0x39e48b=_[_0xd10a('0x3c')]({},_0x39e48b,_0x2af23e[_0xd10a('0x3e')]);return db[_0xd10a('0x29')][_0xd10a('0x46')](_0x39e48b)[_0xd10a('0x21')](handleEntityNotFound(_0x3c74e1,null))[_0xd10a('0x21')](respondWithResult(_0x3c74e1,null))[_0xd10a('0x42')](handleError(_0x3c74e1,null));};exports['create']=function(_0x2aa46a,_0xe55621){return db[_0xd10a('0x29')][_0xd10a('0x47')](_0x2aa46a[_0xd10a('0x48')],{})['then'](respondWithResult(_0xe55621,0xc9))[_0xd10a('0x42')](handleError(_0xe55621,null));};exports[_0xd10a('0x20')]=function(_0x429494,_0x807b4a){if(_0x429494[_0xd10a('0x48')]['id']){delete _0x429494[_0xd10a('0x48')]['id'];}return db[_0xd10a('0x29')][_0xd10a('0x46')]({'where':{'id':_0x429494[_0xd10a('0x44')]['id']}})[_0xd10a('0x21')](handleEntityNotFound(_0x807b4a,null))[_0xd10a('0x21')](saveUpdates(_0x429494[_0xd10a('0x48')],null))[_0xd10a('0x21')](respondWithResult(_0x807b4a,null))[_0xd10a('0x42')](handleError(_0x807b4a,null));};exports[_0xd10a('0x22')]=function(_0x1abc93,_0x2c5d67){return db[_0xd10a('0x29')]['find']({'where':{'id':_0x1abc93['params']['id']}})['then'](handleEntityNotFound(_0x2c5d67,null))[_0xd10a('0x21')](removeEntity(_0x2c5d67,null))[_0xd10a('0x42')](handleError(_0x2c5d67,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 6ee6960..326d133 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 _0x6bdc=['define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4fe5ad,_0x4a889e){var _0x182629=function(_0xf43078){while(--_0xf43078){_0x4fe5ad['push'](_0x4fe5ad['shift']());}};_0x182629(++_0x4a889e);}(_0x6bdc,0x14e));var _0xc6bd=function(_0x1432d7,_0x444cbc){_0x1432d7=_0x1432d7-0x0;var _0x2fc0dd=_0x6bdc[_0x1432d7];return _0x2fc0dd;};'use strict';var _=require(_0xc6bd('0x0'));var util=require(_0xc6bd('0x1'));var logger=require(_0xc6bd('0x2'))(_0xc6bd('0x3'));var moment=require(_0xc6bd('0x4'));var BPromise=require(_0xc6bd('0x5'));var rp=require(_0xc6bd('0x6'));var fs=require('fs');var path=require(_0xc6bd('0x7'));var rimraf=require(_0xc6bd('0x8'));var config=require(_0xc6bd('0x9'));var attributes=require('./whatsappApplication.attributes');module[_0xc6bd('0xa')]=function(_0x26218a,_0x158271){return _0x26218a[_0xc6bd('0xb')](_0xc6bd('0xc'),attributes,{'tableName':_0xc6bd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc6bd('0xe')});}; \ No newline at end of file +var _0x6658=['whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication'];(function(_0xabd6a,_0x32d0ff){var _0x59694f=function(_0x1d1843){while(--_0x1d1843){_0xabd6a['push'](_0xabd6a['shift']());}};_0x59694f(++_0x32d0ff);}(_0x6658,0x198));var _0x8665=function(_0x5d50cc,_0x3ef3af){_0x5d50cc=_0x5d50cc-0x0;var _0x588d5b=_0x6658[_0x5d50cc];return _0x588d5b;};'use strict';var _=require(_0x8665('0x0'));var util=require(_0x8665('0x1'));var logger=require(_0x8665('0x2'))(_0x8665('0x3'));var moment=require(_0x8665('0x4'));var BPromise=require(_0x8665('0x5'));var rp=require(_0x8665('0x6'));var fs=require('fs');var path=require(_0x8665('0x7'));var rimraf=require('rimraf');var config=require(_0x8665('0x8'));var attributes=require(_0x8665('0x9'));module['exports']=function(_0x562829,_0x203780){return _0x562829[_0x8665('0xa')](_0x8665('0xb'),attributes,{'tableName':_0x8665('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8665('0xd'),'collate':_0x8665('0xe')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 56b552d..c10a68e 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 _0x70e0=['code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1324b5,_0xf25cf7){var _0x22d5a6=function(_0x47b777){while(--_0x47b777){_0x1324b5['push'](_0x1324b5['shift']());}};_0x22d5a6(++_0xf25cf7);}(_0x70e0,0x17b));var _0x070e=function(_0xa734de,_0xfa7ed9){_0xa734de=_0xa734de-0x0;var _0x14f461=_0x70e0[_0xa734de];return _0x14f461;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0x4bc3=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x565eda,_0x32c0d0){var _0x45453f=function(_0x5c88a5){while(--_0x5c88a5){_0x565eda['push'](_0x565eda['shift']());}};_0x45453f(++_0x32c0d0);}(_0x4bc3,0x16e));var _0x34bc=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x4bc3[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var moment=require('moment');var BPromise=require(_0x34bc('0x2'));var rs=require(_0x34bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34bc('0x4'))['db'];var utils=require(_0x34bc('0x5'));var logger=require(_0x34bc('0x6'))(_0x34bc('0x7'));var config=require(_0x34bc('0x8'));var jayson=require(_0x34bc('0x9'));var client=jayson[_0x34bc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21451b,_0x50320d,_0x502087){return new BPromise(function(_0x18a01c,_0x474108){return client[_0x34bc('0xb')](_0x21451b,_0x502087)[_0x34bc('0xc')](function(_0x409105){logger[_0x34bc('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x50320d,'request\x20sent');logger[_0x34bc('0xe')](_0x34bc('0xf'),_0x50320d,_0x34bc('0x10'),JSON['stringify'](_0x409105));if(_0x409105[_0x34bc('0x11')]){if(_0x409105['error'][_0x34bc('0x12')]===0x1f4){logger[_0x34bc('0x11')](_0x34bc('0x13'),_0x50320d,_0x409105['error'][_0x34bc('0x14')]);return _0x474108(_0x409105['error'][_0x34bc('0x14')]);}logger[_0x34bc('0x11')](_0x34bc('0x13'),_0x50320d,_0x409105['error']['message']);return _0x18a01c(_0x409105[_0x34bc('0x11')]['message']);}else{logger[_0x34bc('0xd')](_0x34bc('0x13'),_0x50320d,_0x34bc('0x10'));_0x18a01c(_0x409105[_0x34bc('0x15')][_0x34bc('0x14')]);}})[_0x34bc('0x16')](function(_0x5e132d){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x50320d,_0x5e132d);_0x474108(_0x5e132d);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 4589983..3d27af2 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 _0x8958=['destroy','removeTags','util','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','whatsapp','addTags','put','tracked','whatsappinteraction:update','update','delete','whatsappinteraction:destroy'];(function(_0x27ff13,_0x19e031){var _0x14c083=function(_0x228a55){while(--_0x228a55){_0x27ff13['push'](_0x27ff13['shift']());}};_0x14c083(++_0x19e031);}(_0x8958,0x93));var _0x8895=function(_0x1e37ba,_0x384d1d){_0x1e37ba=_0x1e37ba-0x0;var _0x12a356=_0x8958[_0x1e37ba];return _0x12a356;};'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']('/',auth[_0x8895('0x5')](),controller[_0x8895('0x6')]);router[_0x8895('0x7')](_0x8895('0x8'),auth[_0x8895('0x5')](),controller['describe']);router[_0x8895('0x7')](_0x8895('0x9'),auth[_0x8895('0x5')](),controller[_0x8895('0xa')]);router[_0x8895('0x7')](_0x8895('0xb'),auth[_0x8895('0x5')](),controller[_0x8895('0xc')]);router[_0x8895('0x7')](_0x8895('0xd'),auth['isAuthenticated'](),controller[_0x8895('0xe')]);router[_0x8895('0xf')]('/',auth[_0x8895('0x5')](),controller[_0x8895('0x10')]);router[_0x8895('0xf')](_0x8895('0xb'),auth['isAuthenticated'](),controller[_0x8895('0x11')]);router[_0x8895('0xf')](_0x8895('0x12'),auth['isAuthenticated'](),interaction['tracked'](_0x8895('0x13'),'whatsappinteraction:addtags'),controller[_0x8895('0x14')]);router[_0x8895('0x15')](_0x8895('0x9'),auth[_0x8895('0x5')](),interaction[_0x8895('0x16')]('whatsapp',_0x8895('0x17')),controller[_0x8895('0x18')]);router[_0x8895('0x19')](_0x8895('0x9'),auth[_0x8895('0x5')](),interaction[_0x8895('0x16')](_0x8895('0x13'),_0x8895('0x1a')),controller[_0x8895('0x1b')]);router[_0x8895('0x19')](_0x8895('0x12'),auth[_0x8895('0x5')](),controller[_0x8895('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xce68=['Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','describe','get','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','multer','path','connect-timeout','express'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xce68,0x10c));var _0x8ce6=function(_0x42b6cb,_0x31621d){_0x42b6cb=_0x42b6cb-0x0;var _0x76c634=_0xce68[_0x42b6cb];return _0x76c634;};'use strict';var multer=require(_0x8ce6('0x0'));var util=require('util');var path=require(_0x8ce6('0x1'));var timeout=require(_0x8ce6('0x2'));var express=require(_0x8ce6('0x3'));var router=express[_0x8ce6('0x4')]();var fs_extra=require(_0x8ce6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8ce6('0x6'));var config=require(_0x8ce6('0x7'));var controller=require(_0x8ce6('0x8'));router['get']('/',auth[_0x8ce6('0x9')](),controller[_0x8ce6('0xa')]);router['get']('/describe',auth[_0x8ce6('0x9')](),controller[_0x8ce6('0xb')]);router[_0x8ce6('0xc')](_0x8ce6('0xd'),auth['isAuthenticated'](),controller[_0x8ce6('0xe')]);router[_0x8ce6('0xc')](_0x8ce6('0xf'),auth[_0x8ce6('0x9')](),controller[_0x8ce6('0x10')]);router[_0x8ce6('0xc')](_0x8ce6('0x11'),auth[_0x8ce6('0x9')](),controller[_0x8ce6('0x12')]);router[_0x8ce6('0x13')]('/',auth[_0x8ce6('0x9')](),controller[_0x8ce6('0x14')]);router[_0x8ce6('0x13')](_0x8ce6('0xf'),auth[_0x8ce6('0x9')](),controller[_0x8ce6('0x15')]);router[_0x8ce6('0x13')](_0x8ce6('0x16'),auth['isAuthenticated'](),interaction[_0x8ce6('0x17')]('whatsapp',_0x8ce6('0x18')),controller[_0x8ce6('0x19')]);router[_0x8ce6('0x1a')](_0x8ce6('0xd'),auth[_0x8ce6('0x9')](),interaction[_0x8ce6('0x17')](_0x8ce6('0x1b'),_0x8ce6('0x1c')),controller[_0x8ce6('0x1d')]);router[_0x8ce6('0x1e')]('/:id',auth[_0x8ce6('0x9')](),interaction['tracked'](_0x8ce6('0x1b'),_0x8ce6('0x1f')),controller[_0x8ce6('0x20')]);router['delete']('/:id/tags',auth[_0x8ce6('0x9')](),controller[_0x8ce6('0x21')]);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 cc4fa1e..645e1d7 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 _0xb4e2=['BOOLEAN','STRING','DATE','ENUM','out','INTEGER','sequelize'];(function(_0x77b0a3,_0xe20ba){var _0x16157b=function(_0x2db8f0){while(--_0x2db8f0){_0x77b0a3['push'](_0x77b0a3['shift']());}};_0x16157b(++_0xe20ba);}(_0xb4e2,0x1aa));var _0x2b4e=function(_0x24497d,_0x480367){_0x24497d=_0x24497d-0x0;var _0x5d8cd9=_0xb4e2[_0x24497d];return _0x5d8cd9;};'use strict';var Sequelize=require(_0x2b4e('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x2b4e('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2b4e('0x2')]},'note':{'type':Sequelize[_0x2b4e('0x2')]},'phone':{'type':Sequelize[_0x2b4e('0x2')]},'read1stAt':{'type':Sequelize[_0x2b4e('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2b4e('0x4')]('in',_0x2b4e('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2b4e('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2b4e('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2b4e('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x2b4e('0x6')]}}; \ No newline at end of file +var _0x689b=['BOOLEAN','INTEGER','sequelize','exports','STRING','DATE','ENUM','out'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x689b,0x142));var _0xb689=function(_0x22229e,_0x5b047b){_0x22229e=_0x22229e-0x0;var _0x3a10c6=_0x689b[_0x22229e];return _0x3a10c6;};'use strict';var Sequelize=require(_0xb689('0x0'));var moment=require('moment');module[_0xb689('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb689('0x2')]},'secondDisposition':{'type':Sequelize[_0xb689('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb689('0x2')]},'note':{'type':Sequelize[_0xb689('0x2')]},'phone':{'type':Sequelize[_0xb689('0x2')]},'read1stAt':{'type':Sequelize[_0xb689('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb689('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb689('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb689('0x4')]('in',_0xb689('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb689('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xb689('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 40fb8f1..ad6bcb9 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 _0x1c57=['getOptions','query','catch','show','params','model','keys','filters','intersection','attributes','length','includeAll','include','merge','options','WhatsappInteraction','find','create','body','describe','addMessage','WhatsappMessage','ids','getMessages','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','format','rows','addTags','omit','spread','Tag','findAll','whatsappInteractionTags:save','removeTags','download','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','Owner','get','N.A.','YYYY-MM-DD\x20HH:mm:ss','toString','closed','closedAt','disposition','existsSync','createReadStream','out','System','value','renderFile','downloadInteraction.ejs','transcript-','Whatsapp','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','undefined','offset','count','limit','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key'];(function(_0x2b81be,_0x544bdf){var _0x8ed4a7=function(_0x4a7bf4){while(--_0x4a7bf4){_0x2b81be['push'](_0x2b81be['shift']());}};_0x8ed4a7(++_0x544bdf);}(_0x1c57,0x144));var _0x71c5=function(_0x5043eb,_0x22914b){_0x5043eb=_0x5043eb-0x0;var _0x51f9b0=_0x1c57[_0x5043eb];return _0x51f9b0;};'use strict';var rimraf=require(_0x71c5('0x0'));var zipdir=require(_0x71c5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x71c5('0x2'));var path=require(_0x71c5('0x3'));var ejs=require(_0x71c5('0x4'));var fs=require('fs');var _=require(_0x71c5('0x5'));var Redis=require('ioredis');var interaction=require(_0x71c5('0x6'));var qs=require(_0x71c5('0x7'));var pdf=require('../../components/export/pdf');var logger=require(_0x71c5('0x8'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x71c5('0x9')]=_[_0x71c5('0xa')](config[_0x71c5('0x9')],{'host':_0x71c5('0xb'),'port':0x18eb});var socket=require(_0x71c5('0xc'))(new Redis(config[_0x71c5('0x9')]));require('./whatsappInteraction.socket')[_0x71c5('0xd')](socket);function respondWithStatusCode(_0x3d25fb,_0x2f7218){_0x2f7218=_0x2f7218||0xcc;return function(_0x37b6fc){if(_0x37b6fc){return _0x3d25fb[_0x71c5('0xe')](_0x2f7218);}return _0x3d25fb['status'](_0x2f7218)[_0x71c5('0xf')]();};}function respondWithResult(_0xb35dd4,_0x2a439a){_0x2a439a=_0x2a439a||0xc8;return function(_0x4e8da7){if(_0x4e8da7){return _0xb35dd4[_0x71c5('0x10')](_0x2a439a)[_0x71c5('0x11')](_0x4e8da7);}};}function respondWithFilteredResult(_0x34b704,_0x1779eb){return function(_0x1b3666){if(_0x1b3666){var _0x210e7c=typeof _0x1779eb['offset']===_0x71c5('0x12')&&typeof _0x1779eb['limit']==='undefined';var _0x340a73=_0x1b3666['count'];var _0x1b4efd=_0x210e7c?0x0:_0x1779eb[_0x71c5('0x13')];var _0x3120d3=_0x210e7c?_0x1b3666[_0x71c5('0x14')]:_0x1779eb[_0x71c5('0x13')]+_0x1779eb[_0x71c5('0x15')];var _0x4e32ab;if(_0x3120d3>=_0x340a73){_0x3120d3=_0x340a73;_0x4e32ab=0xc8;}else{_0x4e32ab=0xce;}_0x34b704[_0x71c5('0x10')](_0x4e32ab);return _0x34b704['set']('Content-Range',_0x1b4efd+'-'+_0x3120d3+'/'+_0x340a73)[_0x71c5('0x11')](_0x1b3666);}return null;};}function saveUpdates(_0x78a874){return function(_0x126a78){if(_0x126a78){return _0x126a78[_0x71c5('0x16')](_0x78a874)[_0x71c5('0x17')](function(_0x27e4cb){return _0x27e4cb;});}return null;};}function removeEntity(_0x227f7f){return function(_0x26de19){if(_0x26de19){return _0x26de19[_0x71c5('0x18')]()[_0x71c5('0x17')](function(){_0x227f7f['status'](0xcc)[_0x71c5('0xf')]();});}};}function handleEntityNotFound(_0x693e43){return function(_0x110194){if(!_0x110194){_0x693e43['sendStatus'](0x194);}return _0x110194;};}function handleError(_0x3b2267,_0x508d10){_0x508d10=_0x508d10||0x1f4;return function(_0x43a165){logger[_0x71c5('0x19')](_0x43a165[_0x71c5('0x1a')]);if(_0x43a165[_0x71c5('0x1b')]){delete _0x43a165['name'];}_0x3b2267[_0x71c5('0x10')](_0x508d10)[_0x71c5('0x1c')](_0x43a165);};}exports['index']=function(_0x434633,_0x33f6f6){var _0x59033d={};var _0x2872f0=_[_0x71c5('0x1d')](db['WhatsappInteraction'][_0x71c5('0x1e')],function(_0x507ac1){return{'name':_0x507ac1[_0x71c5('0x1f')],'type':_0x507ac1['type'][_0x71c5('0x20')]};});_0x59033d=qs[_0x71c5('0x21')](_0x2872f0,_0x434633);return interaction['findAll']('whatsapp',_0x434633[_0x71c5('0x22')],_0x434633['user'],_0x59033d,_0x2872f0)[_0x71c5('0x17')](respondWithFilteredResult(_0x33f6f6,_0x59033d))[_0x71c5('0x23')](handleError(_0x33f6f6,null));};exports[_0x71c5('0x24')]=function(_0x2d73f9,_0x18f6cd){var _0x4965d9={'raw':![],'where':{'id':_0x2d73f9[_0x71c5('0x25')]['id']}},_0x57861a={};_0x57861a[_0x71c5('0x26')]=_[_0x71c5('0x27')](db['WhatsappInteraction']['rawAttributes']);_0x57861a[_0x71c5('0x22')]=_[_0x71c5('0x27')](_0x2d73f9['query']);_0x57861a[_0x71c5('0x28')]=_[_0x71c5('0x29')](_0x57861a['model'],_0x57861a[_0x71c5('0x22')]);_0x4965d9[_0x71c5('0x2a')]=_[_0x71c5('0x29')](_0x57861a['model'],qs['fields'](_0x2d73f9[_0x71c5('0x22')]['fields']));_0x4965d9[_0x71c5('0x2a')]=_0x4965d9[_0x71c5('0x2a')][_0x71c5('0x2b')]?_0x4965d9['attributes']:_0x57861a[_0x71c5('0x26')];if(_0x2d73f9[_0x71c5('0x22')][_0x71c5('0x2c')]){_0x4965d9[_0x71c5('0x2d')]=[{'all':!![]}];}_0x4965d9=_[_0x71c5('0x2e')]({},_0x4965d9,_0x2d73f9[_0x71c5('0x2f')]);return db[_0x71c5('0x30')][_0x71c5('0x31')](_0x4965d9)[_0x71c5('0x17')](handleEntityNotFound(_0x18f6cd,null))[_0x71c5('0x17')](respondWithResult(_0x18f6cd,null))[_0x71c5('0x23')](handleError(_0x18f6cd,null));};exports['create']=function(_0x2a7684,_0x5b9e12){return db[_0x71c5('0x30')][_0x71c5('0x32')](_0x2a7684['body'],{})['then'](respondWithResult(_0x5b9e12,0xc9))['catch'](handleError(_0x5b9e12,null));};exports[_0x71c5('0x16')]=function(_0x34e55b,_0x37f5fc){if(_0x34e55b[_0x71c5('0x33')]['id']){delete _0x34e55b[_0x71c5('0x33')]['id'];}return db[_0x71c5('0x30')][_0x71c5('0x31')]({'where':{'id':_0x34e55b[_0x71c5('0x25')]['id']}})[_0x71c5('0x17')](handleEntityNotFound(_0x37f5fc,null))[_0x71c5('0x17')](saveUpdates(_0x34e55b[_0x71c5('0x33')],null))[_0x71c5('0x17')](respondWithResult(_0x37f5fc,null))[_0x71c5('0x23')](handleError(_0x37f5fc,null));};exports[_0x71c5('0x18')]=function(_0x2c8e5a,_0x11ba91){return db[_0x71c5('0x30')][_0x71c5('0x31')]({'where':{'id':_0x2c8e5a['params']['id']}})['then'](handleEntityNotFound(_0x11ba91,null))['then'](removeEntity(_0x11ba91,null))[_0x71c5('0x23')](handleError(_0x11ba91,null));};exports[_0x71c5('0x34')]=function(_0x3dcd8c,_0x3f2c55){return db[_0x71c5('0x30')]['describe']()[_0x71c5('0x17')](respondWithResult(_0x3f2c55,null))[_0x71c5('0x23')](handleError(_0x3f2c55,null));};exports[_0x71c5('0x35')]=function(_0x2b55ec,_0x4cfb75){return db[_0x71c5('0x36')][_0x71c5('0x31')]({'where':{'id':_0x2b55ec[_0x71c5('0x25')]['id']}})['then'](handleEntityNotFound(_0x4cfb75,null))[_0x71c5('0x17')](function(_0x28b208){if(_0x28b208){return _0x28b208[_0x71c5('0x35')](_0x2b55ec['body'][_0x71c5('0x37')],_['omit'](_0x2b55ec[_0x71c5('0x33')],[_0x71c5('0x37'),'id'])||{});}})['then'](respondWithResult(_0x4cfb75,null))[_0x71c5('0x23')](handleError(_0x4cfb75,null));};exports[_0x71c5('0x38')]=function(_0x474ef9,_0x2dd00e){var _0xa859={'raw':![],'where':{}};var _0x54e365={};var _0x349bfd={'count':0x0,'rows':[]};return db['WhatsappInteraction']['findOne']({'where':{'id':_0x474ef9[_0x71c5('0x25')]['id']}})[_0x71c5('0x17')](handleEntityNotFound(_0x2dd00e,null))[_0x71c5('0x17')](function(_0x43aef0){if(_0x43aef0){_0x54e365[_0x71c5('0x26')]=_[_0x71c5('0x27')](db[_0x71c5('0x36')]['rawAttributes']);_0x54e365['query']=_[_0x71c5('0x27')](_0x474ef9[_0x71c5('0x22')]);_0x54e365[_0x71c5('0x28')]=_['intersection'](_0x54e365[_0x71c5('0x26')],_0x54e365[_0x71c5('0x22')]);_0xa859[_0x71c5('0x2a')]=_['intersection'](_0x54e365['model'],qs['fields'](_0x474ef9['query'][_0x71c5('0x39')]));_0xa859[_0x71c5('0x2a')]=_0xa859[_0x71c5('0x2a')][_0x71c5('0x2b')]?_0xa859[_0x71c5('0x2a')]:_0x54e365['model'];if(!_0x474ef9[_0x71c5('0x22')][_0x71c5('0x3a')](_0x71c5('0x3b'))){_0xa859[_0x71c5('0x15')]=qs['limit'](_0x474ef9[_0x71c5('0x22')][_0x71c5('0x15')]);_0xa859[_0x71c5('0x13')]=qs[_0x71c5('0x13')](_0x474ef9[_0x71c5('0x22')]['offset']);}_0xa859[_0x71c5('0x3c')]=qs[_0x71c5('0x3d')](_0x474ef9['query'][_0x71c5('0x3d')]);_0xa859[_0x71c5('0x3e')]=qs[_0x71c5('0x28')](_[_0x71c5('0x3f')](_0x474ef9[_0x71c5('0x22')],_0x54e365['filters']));_0xa859['where']['WhatsappInteractionId']=_0x43aef0['id'];if(_0x474ef9[_0x71c5('0x22')]['filter']){_0xa859['where']=_['merge'](_0xa859['where'],{'$or':_[_0x71c5('0x1d')](_0xa859['attributes'],function(_0x444d26){var _0x11120c={};_0x11120c[_0x444d26]={'$like':'%'+_0x474ef9[_0x71c5('0x22')][_0x71c5('0x40')]+'%'};return _0x11120c;})});}if(_0x474ef9['query'][_0x71c5('0x41')]){var _0x143f09=_0x474ef9[_0x71c5('0x22')][_0x71c5('0x41')][_0x71c5('0x42')](',');var _0xeb9a37={};_0xeb9a37[_0x143f09[0x0]]={'$gte':moment(_0x143f09[0x1])[_0x71c5('0x43')]('YYYY-MM-DD\x20HH:mm:ss')};_0xa859['where']=_[_0x71c5('0x2e')](_0xa859[_0x71c5('0x3e')],_0xeb9a37);}_0xa859=_[_0x71c5('0x2e')]({},_0xa859,_0x474ef9['options']);return db['WhatsappMessage'][_0x71c5('0x14')]({'where':_0xa859['where']})['then'](function(_0x2f0c24){_0x349bfd['count']=_0x2f0c24;if(_0x474ef9[_0x71c5('0x22')][_0x71c5('0x2c')]){_0xa859['include']=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0xa859);})['then'](function(_0xc99eba){_0x349bfd[_0x71c5('0x44')]=_0xc99eba;return _0x349bfd;});}})[_0x71c5('0x17')](respondWithFilteredResult(_0x2dd00e,_0xa859))[_0x71c5('0x23')](handleError(_0x2dd00e,null));};exports[_0x71c5('0x45')]=function(_0x5a5f92,_0x5bdfe9){return db[_0x71c5('0x30')][_0x71c5('0x31')]({'where':{'id':_0x5a5f92[_0x71c5('0x25')]['id']}})[_0x71c5('0x17')](handleEntityNotFound(_0x5bdfe9,null))[_0x71c5('0x17')](function(_0x5b91c4){if(_0x5b91c4){return _0x5b91c4['setTags'](_0x5a5f92[_0x71c5('0x33')][_0x71c5('0x37')],_[_0x71c5('0x46')](_0x5a5f92[_0x71c5('0x33')],[_0x71c5('0x37'),'id'])||{})[_0x71c5('0x47')](function(){return db[_0x71c5('0x48')][_0x71c5('0x49')]({'attributes':['id',_0x71c5('0x1b'),'color'],'where':{'id':_0x5a5f92[_0x71c5('0x33')][_0x71c5('0x37')]}});})[_0x71c5('0x17')](function(_0x5ecf0a){socket['emit'](_0x71c5('0x4a'),{'id':Number(_0x5a5f92['params']['id']),'tags':_0x5ecf0a||[]});return{'id':Number(_0x5a5f92[_0x71c5('0x25')]['id']),'tags':_0x5ecf0a||[]};});}})[_0x71c5('0x17')](respondWithResult(_0x5bdfe9,null))[_0x71c5('0x23')](handleError(_0x5bdfe9,null));};exports[_0x71c5('0x4b')]=function(_0x29d18d,_0x1af4f3){return db[_0x71c5('0x30')][_0x71c5('0x31')]({'where':{'id':_0x29d18d[_0x71c5('0x25')]['id']}})[_0x71c5('0x17')](handleEntityNotFound(_0x1af4f3,null))[_0x71c5('0x17')](function(_0x348069){if(_0x348069){return _0x348069[_0x71c5('0x4b')](_0x29d18d['query']['ids']);}})['then'](respondWithStatusCode(_0x1af4f3,null))[_0x71c5('0x23')](handleError(_0x1af4f3,null));};exports[_0x71c5('0x4c')]=function(_0x5ac190,_0x588306){var _0xc64593=moment()['unix']()['toString']();var _0x2c3470=path[_0x71c5('0x4d')](config['root'],_0x71c5('0x4e'),'files',_0x71c5('0x4f'));var _0x196541=path[_0x71c5('0x4d')](config[_0x71c5('0x50')],_0x71c5('0x4e'),_0x71c5('0x51'),_0x71c5('0x52'));var _0x3ce2ca=path[_0x71c5('0x4d')](_0x2c3470,_0xc64593);var _0x567547=util['format'](_0x71c5('0x53'),_0x5ac190[_0x71c5('0x25')]['id'],_0xc64593);var _0x206c04=path[_0x71c5('0x4d')](_0x2c3470,_0x567547);var _0x5a962b=[];_0x5a962b[_0x71c5('0x54')]({'model':db[_0x71c5('0x55')],'as':_0x71c5('0x55'),'attributes':['id',_0x71c5('0x56')],'raw':!![]});_0x5a962b[_0x71c5('0x54')]({'model':db[_0x71c5('0x57')],'as':_0x71c5('0x58'),'attributes':['id',_0x71c5('0x59'),_0x71c5('0x5a')],'raw':!![]});if(_0x5ac190[_0x71c5('0x22')][_0x71c5('0x52')]){_0x5a962b['push']({'model':db[_0x71c5('0x5b')],'as':_0x71c5('0x5b'),'raw':!![]});}var _0x29e32f=[{'model':db[_0x71c5('0x36')],'as':_0x71c5('0x5c'),'attributes':['id',_0x71c5('0x33'),_0x71c5('0x5d'),_0x71c5('0x5e'),_0x71c5('0x5f'),_0x71c5('0x60')],'include':_0x5a962b}];_0x29e32f[_0x71c5('0x54')]({'model':db[_0x71c5('0x61')],'as':_0x71c5('0x62'),'attributes':['id',_0x71c5('0x1b')]});_0x29e32f['push']({'model':db[_0x71c5('0x55')],'as':_0x71c5('0x63'),'attributes':['id',_0x71c5('0x56')]});return db[_0x71c5('0x30')]['find']({'where':{'id':_0x5ac190['params']['id']},'include':_0x29e32f})[_0x71c5('0x17')](handleEntityNotFound(_0x588306,null))['then'](function(_0x31f15d){if(_0x31f15d){var _0x540dec=_0x31f15d[_0x71c5('0x64')]({'plain':!![]});fs['mkdirSync'](_0x3ce2ca);var _0x551eba={'channel':'Whatsapp','account':_0x540dec['Account'][_0x71c5('0x1b')],'agent':_0x540dec[_0x71c5('0x63')]?_0x540dec[_0x71c5('0x63')][_0x71c5('0x56')]:_0x71c5('0x65'),'createdAt':moment(_0x540dec[_0x71c5('0x5d')])[_0x71c5('0x43')](_0x71c5('0x66'))[_0x71c5('0x67')](),'closedAt':_0x540dec[_0x71c5('0x68')]?moment(_0x540dec[_0x71c5('0x69')])[_0x71c5('0x43')](_0x71c5('0x66'))[_0x71c5('0x67')]():'','disposition':_0x540dec[_0x71c5('0x6a')],'messages':_(_0x540dec[_0x71c5('0x5c')])[_0x71c5('0x40')]({'secret':![]})[_0x71c5('0x1d')](function(_0x27e599){if(_0x27e599[_0x71c5('0x5b')]){var _0x115c1d=path[_0x71c5('0x4d')](_0x196541,_0x27e599[_0x71c5('0x5b')]['basename']);if(fs[_0x71c5('0x6b')](_0x115c1d)){fs[_0x71c5('0x6c')](_0x115c1d)['pipe'](fs['createWriteStream'](path[_0x71c5('0x4d')](_0x3ce2ca,_0x27e599[_0x71c5('0x5b')]['basename'])));}}return{'date':moment(_0x27e599['createdAt'])['format'](_0x71c5('0x66'))[_0x71c5('0x67')](),'sender':_0x27e599[_0x71c5('0x5e')]===_0x71c5('0x6d')?_0x27e599['User']?_0x27e599[_0x71c5('0x55')][_0x71c5('0x56')]:_0x71c5('0x6e'):_0x27e599[_0x71c5('0x58')]['firstName']+(_0x27e599['Contact'][_0x71c5('0x5a')]?'\x20'+_0x27e599['Contact'][_0x71c5('0x5a')]:''),'body':_0x27e599['Attachment']?_0x27e599['Attachment']['basename']:_0x27e599[_0x71c5('0x33')],'direction':_0x27e599[_0x71c5('0x5e')]==='out'?'A':'C','secret':_0x27e599[_0x71c5('0x5f')],'read':_0x27e599[_0x71c5('0x60')],'attachment':_0x27e599[_0x71c5('0x5b')]};})[_0x71c5('0x6f')]()};return ejs[_0x71c5('0x70')](path[_0x71c5('0x4d')](config[_0x71c5('0x50')],_0x71c5('0x4e'),'views',_0x71c5('0x71')),{'interaction':_0x551eba})[_0x71c5('0x17')](function(_0x2391c0){var _0x560dd0=path['join'](_0x3ce2ca,_0x71c5('0x72')+_0x540dec['id']+'-'+_0xc64593+'.pdf');var _0x78fb82={'path':_0x560dd0,'channel':_0x71c5('0x73'),'interactionId':_0x540dec['id']};return pdf[_0x71c5('0x74')](_0x2391c0,_0x78fb82);})[_0x71c5('0x17')](function(){return new BPromise(function(_0x193b4f,_0x4ded34){zipdir(_0x3ce2ca,{'saveTo':_0x206c04},function(_0x41802f,_0x41ceb3){if(_0x41802f)return _0x4ded34(_0x41802f);return _0x193b4f(_0x41ceb3);});})[_0x71c5('0x17')](function(){return new BPromise(function(_0xd4c17,_0x158023){rimraf(_0x3ce2ca,function(_0x1b9bf9){if(_0x1b9bf9)_0x158023(_0x1b9bf9);return _0xd4c17();});});})['then'](function(){return _0x588306[_0x71c5('0x4c')](_0x206c04,_0x567547,function(_0x4be2f1){if(_0x4be2f1){console['log'](_0x71c5('0x75'),_0x4be2f1);}else{fs[_0x71c5('0x76')](_0x206c04);}});});});}else{return _0x588306[_0x71c5('0xe')](0xc8);}})['catch'](handleError(_0x588306,null));}; \ No newline at end of file +var _0x541e=['split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','setTags','omit','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','Attachment','Messages','createdAt','direction','Account','Owner','get','mkdirSync','fullname','N.A.','closed','closedAt','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','lastName','secret','read','value','renderFile','views','downloadInteraction.ejs','transcript-','Whatsapp','createPdfFromHTML','rimraf','zip-dir','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','end','json','limit','undefined','count','offset','status','set','update','sendStatus','error','name','index','map','WhatsappInteraction','rawAttributes','type','key','getOptions','findAll','whatsapp','query','user','then','catch','params','model','keys','intersection','attributes','fields','includeAll','options','create','body','find','destroy','describe','addMessage','WhatsappMessage','ids','findOne','filters','nolimit','order','sort','pick','where','WhatsappInteractionId','filter','merge','$gte'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x541e,0x1b5));var _0xe541=function(_0x47bcae,_0x43b7b6){_0x47bcae=_0x47bcae-0x0;var _0x59b299=_0x541e[_0x47bcae];return _0x59b299;};'use strict';var rimraf=require(_0xe541('0x0'));var zipdir=require(_0xe541('0x1'));var moment=require('moment');var BPromise=require(_0xe541('0x2'));var util=require(_0xe541('0x3'));var path=require(_0xe541('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe541('0x5'));var Redis=require(_0xe541('0x6'));var interaction=require(_0xe541('0x7'));var qs=require(_0xe541('0x8'));var pdf=require(_0xe541('0x9'));var logger=require(_0xe541('0xa'))(_0xe541('0xb'));var config=require(_0xe541('0xc'));var db=require(_0xe541('0xd'))['db'];config[_0xe541('0xe')]=_[_0xe541('0xf')](config[_0xe541('0xe')],{'host':_0xe541('0x10'),'port':0x18eb});var socket=require(_0xe541('0x11'))(new Redis(config[_0xe541('0xe')]));require(_0xe541('0x12'))['register'](socket);function respondWithStatusCode(_0x427d2e,_0x39a428){_0x39a428=_0x39a428||0xcc;return function(_0x18a9eb){if(_0x18a9eb){return _0x427d2e['sendStatus'](_0x39a428);}return _0x427d2e['status'](_0x39a428)[_0xe541('0x13')]();};}function respondWithResult(_0x2cbac6,_0x44d284){_0x44d284=_0x44d284||0xc8;return function(_0x1ea83c){if(_0x1ea83c){return _0x2cbac6['status'](_0x44d284)[_0xe541('0x14')](_0x1ea83c);}};}function respondWithFilteredResult(_0x3cc452,_0x52e5aa){return function(_0x5c6e33){if(_0x5c6e33){var _0x105b45=typeof _0x52e5aa['offset']==='undefined'&&typeof _0x52e5aa[_0xe541('0x15')]===_0xe541('0x16');var _0x598960=_0x5c6e33[_0xe541('0x17')];var _0x418691=_0x105b45?0x0:_0x52e5aa[_0xe541('0x18')];var _0x2df97a=_0x105b45?_0x5c6e33[_0xe541('0x17')]:_0x52e5aa[_0xe541('0x18')]+_0x52e5aa[_0xe541('0x15')];var _0x232451;if(_0x2df97a>=_0x598960){_0x2df97a=_0x598960;_0x232451=0xc8;}else{_0x232451=0xce;}_0x3cc452[_0xe541('0x19')](_0x232451);return _0x3cc452[_0xe541('0x1a')]('Content-Range',_0x418691+'-'+_0x2df97a+'/'+_0x598960)[_0xe541('0x14')](_0x5c6e33);}return null;};}function saveUpdates(_0x4d304b){return function(_0x26d61c){if(_0x26d61c){return _0x26d61c[_0xe541('0x1b')](_0x4d304b)['then'](function(_0x16d6b3){return _0x16d6b3;});}return null;};}function removeEntity(_0xb7f5ad){return function(_0x3ac8c8){if(_0x3ac8c8){return _0x3ac8c8['destroy']()['then'](function(){_0xb7f5ad[_0xe541('0x19')](0xcc)[_0xe541('0x13')]();});}};}function handleEntityNotFound(_0x69f430){return function(_0x214c32){if(!_0x214c32){_0x69f430[_0xe541('0x1c')](0x194);}return _0x214c32;};}function handleError(_0x35efd9,_0x7bacdf){_0x7bacdf=_0x7bacdf||0x1f4;return function(_0x32cd59){logger[_0xe541('0x1d')](_0x32cd59['stack']);if(_0x32cd59[_0xe541('0x1e')]){delete _0x32cd59[_0xe541('0x1e')];}_0x35efd9[_0xe541('0x19')](_0x7bacdf)['send'](_0x32cd59);};}exports[_0xe541('0x1f')]=function(_0x364620,_0x463daa){var _0x1f7941={};var _0x4e3a7b=_[_0xe541('0x20')](db[_0xe541('0x21')][_0xe541('0x22')],function(_0x3a4553){return{'name':_0x3a4553['fieldName'],'type':_0x3a4553[_0xe541('0x23')][_0xe541('0x24')]};});_0x1f7941=qs[_0xe541('0x25')](_0x4e3a7b,_0x364620);return interaction[_0xe541('0x26')](_0xe541('0x27'),_0x364620[_0xe541('0x28')],_0x364620[_0xe541('0x29')],_0x1f7941,_0x4e3a7b)[_0xe541('0x2a')](respondWithFilteredResult(_0x463daa,_0x1f7941))[_0xe541('0x2b')](handleError(_0x463daa,null));};exports['show']=function(_0x3fd332,_0x5c1ebe){var _0x1196c9={'raw':![],'where':{'id':_0x3fd332[_0xe541('0x2c')]['id']}},_0x262c3f={};_0x262c3f[_0xe541('0x2d')]=_['keys'](db[_0xe541('0x21')][_0xe541('0x22')]);_0x262c3f[_0xe541('0x28')]=_[_0xe541('0x2e')](_0x3fd332[_0xe541('0x28')]);_0x262c3f['filters']=_[_0xe541('0x2f')](_0x262c3f['model'],_0x262c3f[_0xe541('0x28')]);_0x1196c9[_0xe541('0x30')]=_[_0xe541('0x2f')](_0x262c3f[_0xe541('0x2d')],qs[_0xe541('0x31')](_0x3fd332['query'][_0xe541('0x31')]));_0x1196c9[_0xe541('0x30')]=_0x1196c9['attributes']['length']?_0x1196c9[_0xe541('0x30')]:_0x262c3f['model'];if(_0x3fd332['query'][_0xe541('0x32')]){_0x1196c9['include']=[{'all':!![]}];}_0x1196c9=_['merge']({},_0x1196c9,_0x3fd332[_0xe541('0x33')]);return db[_0xe541('0x21')]['find'](_0x1196c9)[_0xe541('0x2a')](handleEntityNotFound(_0x5c1ebe,null))[_0xe541('0x2a')](respondWithResult(_0x5c1ebe,null))[_0xe541('0x2b')](handleError(_0x5c1ebe,null));};exports[_0xe541('0x34')]=function(_0x5903d3,_0x14197d){return db['WhatsappInteraction'][_0xe541('0x34')](_0x5903d3['body'],{})[_0xe541('0x2a')](respondWithResult(_0x14197d,0xc9))[_0xe541('0x2b')](handleError(_0x14197d,null));};exports[_0xe541('0x1b')]=function(_0x159f6a,_0x1038c8){if(_0x159f6a['body']['id']){delete _0x159f6a[_0xe541('0x35')]['id'];}return db['WhatsappInteraction'][_0xe541('0x36')]({'where':{'id':_0x159f6a['params']['id']}})[_0xe541('0x2a')](handleEntityNotFound(_0x1038c8,null))['then'](saveUpdates(_0x159f6a[_0xe541('0x35')],null))[_0xe541('0x2a')](respondWithResult(_0x1038c8,null))['catch'](handleError(_0x1038c8,null));};exports[_0xe541('0x37')]=function(_0x56893f,_0x43f8e0){return db[_0xe541('0x21')][_0xe541('0x36')]({'where':{'id':_0x56893f['params']['id']}})[_0xe541('0x2a')](handleEntityNotFound(_0x43f8e0,null))[_0xe541('0x2a')](removeEntity(_0x43f8e0,null))[_0xe541('0x2b')](handleError(_0x43f8e0,null));};exports[_0xe541('0x38')]=function(_0x5d70f3,_0x5ad200){return db[_0xe541('0x21')]['describe']()[_0xe541('0x2a')](respondWithResult(_0x5ad200,null))['catch'](handleError(_0x5ad200,null));};exports[_0xe541('0x39')]=function(_0x324ec5,_0x5633c1){return db[_0xe541('0x3a')][_0xe541('0x36')]({'where':{'id':_0x324ec5[_0xe541('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5633c1,null))['then'](function(_0x19b499){if(_0x19b499){return _0x19b499[_0xe541('0x39')](_0x324ec5[_0xe541('0x35')][_0xe541('0x3b')],_['omit'](_0x324ec5[_0xe541('0x35')],[_0xe541('0x3b'),'id'])||{});}})[_0xe541('0x2a')](respondWithResult(_0x5633c1,null))[_0xe541('0x2b')](handleError(_0x5633c1,null));};exports['getMessages']=function(_0x33cc09,_0x578c1d){var _0x39a797={'raw':![],'where':{}};var _0x1307a9={};var _0x1b7dc6={'count':0x0,'rows':[]};return db[_0xe541('0x21')][_0xe541('0x3c')]({'where':{'id':_0x33cc09[_0xe541('0x2c')]['id']}})[_0xe541('0x2a')](handleEntityNotFound(_0x578c1d,null))[_0xe541('0x2a')](function(_0x944bda){if(_0x944bda){_0x1307a9[_0xe541('0x2d')]=_[_0xe541('0x2e')](db[_0xe541('0x3a')][_0xe541('0x22')]);_0x1307a9['query']=_[_0xe541('0x2e')](_0x33cc09[_0xe541('0x28')]);_0x1307a9[_0xe541('0x3d')]=_[_0xe541('0x2f')](_0x1307a9[_0xe541('0x2d')],_0x1307a9[_0xe541('0x28')]);_0x39a797[_0xe541('0x30')]=_[_0xe541('0x2f')](_0x1307a9[_0xe541('0x2d')],qs['fields'](_0x33cc09[_0xe541('0x28')][_0xe541('0x31')]));_0x39a797[_0xe541('0x30')]=_0x39a797[_0xe541('0x30')]['length']?_0x39a797[_0xe541('0x30')]:_0x1307a9[_0xe541('0x2d')];if(!_0x33cc09[_0xe541('0x28')]['hasOwnProperty'](_0xe541('0x3e'))){_0x39a797['limit']=qs['limit'](_0x33cc09[_0xe541('0x28')]['limit']);_0x39a797[_0xe541('0x18')]=qs[_0xe541('0x18')](_0x33cc09[_0xe541('0x28')][_0xe541('0x18')]);}_0x39a797[_0xe541('0x3f')]=qs['sort'](_0x33cc09[_0xe541('0x28')][_0xe541('0x40')]);_0x39a797['where']=qs[_0xe541('0x3d')](_[_0xe541('0x41')](_0x33cc09['query'],_0x1307a9['filters']));_0x39a797[_0xe541('0x42')][_0xe541('0x43')]=_0x944bda['id'];if(_0x33cc09[_0xe541('0x28')][_0xe541('0x44')]){_0x39a797[_0xe541('0x42')]=_[_0xe541('0x45')](_0x39a797['where'],{'$or':_[_0xe541('0x20')](_0x39a797[_0xe541('0x30')],function(_0x5a95d9){var _0xa66277={};_0xa66277[_0x5a95d9]={'$like':'%'+_0x33cc09[_0xe541('0x28')]['filter']+'%'};return _0xa66277;})});}if(_0x33cc09[_0xe541('0x28')][_0xe541('0x46')]){var _0x36c484=_0x33cc09[_0xe541('0x28')]['$gte'][_0xe541('0x47')](',');var _0x268125={};_0x268125[_0x36c484[0x0]]={'$gte':moment(_0x36c484[0x1])[_0xe541('0x48')](_0xe541('0x49'))};_0x39a797[_0xe541('0x42')]=_[_0xe541('0x45')](_0x39a797[_0xe541('0x42')],_0x268125);}_0x39a797=_[_0xe541('0x45')]({},_0x39a797,_0x33cc09['options']);return db['WhatsappMessage'][_0xe541('0x17')]({'where':_0x39a797['where']})[_0xe541('0x2a')](function(_0x390144){_0x1b7dc6[_0xe541('0x17')]=_0x390144;if(_0x33cc09[_0xe541('0x28')][_0xe541('0x32')]){_0x39a797[_0xe541('0x4a')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xe541('0x26')](_0x39a797);})['then'](function(_0x325e8a){_0x1b7dc6[_0xe541('0x4b')]=_0x325e8a;return _0x1b7dc6;});}})[_0xe541('0x2a')](respondWithFilteredResult(_0x578c1d,_0x39a797))['catch'](handleError(_0x578c1d,null));};exports['addTags']=function(_0x5ead85,_0x3b2756){return db[_0xe541('0x21')][_0xe541('0x36')]({'where':{'id':_0x5ead85[_0xe541('0x2c')]['id']}})[_0xe541('0x2a')](handleEntityNotFound(_0x3b2756,null))[_0xe541('0x2a')](function(_0xb3a134){if(_0xb3a134){return _0xb3a134[_0xe541('0x4c')](_0x5ead85['body'][_0xe541('0x3b')],_[_0xe541('0x4d')](_0x5ead85['body'],[_0xe541('0x3b'),'id'])||{})['spread'](function(){return db[_0xe541('0x4e')][_0xe541('0x26')]({'attributes':['id',_0xe541('0x1e'),_0xe541('0x4f')],'where':{'id':_0x5ead85[_0xe541('0x35')][_0xe541('0x3b')]}});})[_0xe541('0x2a')](function(_0x197327){socket[_0xe541('0x50')](_0xe541('0x51'),{'id':Number(_0x5ead85[_0xe541('0x2c')]['id']),'tags':_0x197327||[]});return{'id':Number(_0x5ead85[_0xe541('0x2c')]['id']),'tags':_0x197327||[]};});}})['then'](respondWithResult(_0x3b2756,null))[_0xe541('0x2b')](handleError(_0x3b2756,null));};exports[_0xe541('0x52')]=function(_0x203047,_0x249322){return db[_0xe541('0x21')]['find']({'where':{'id':_0x203047[_0xe541('0x2c')]['id']}})[_0xe541('0x2a')](handleEntityNotFound(_0x249322,null))[_0xe541('0x2a')](function(_0x3e89e9){if(_0x3e89e9){return _0x3e89e9[_0xe541('0x52')](_0x203047[_0xe541('0x28')][_0xe541('0x3b')]);}})[_0xe541('0x2a')](respondWithStatusCode(_0x249322,null))['catch'](handleError(_0x249322,null));};exports[_0xe541('0x53')]=function(_0x3a4dc4,_0x40cc66){var _0x58df84=moment()[_0xe541('0x54')]()[_0xe541('0x55')]();var _0x18c4ee=path[_0xe541('0x56')](config[_0xe541('0x57')],_0xe541('0x58'),'files',_0xe541('0x59'));var _0x587212=path[_0xe541('0x56')](config[_0xe541('0x57')],_0xe541('0x58'),_0xe541('0x5a'),_0xe541('0x5b'));var _0x2e4bae=path[_0xe541('0x56')](_0x18c4ee,_0x58df84);var _0x155bdf=util[_0xe541('0x48')](_0xe541('0x5c'),_0x3a4dc4[_0xe541('0x2c')]['id'],_0x58df84);var _0x125aa3=path['join'](_0x18c4ee,_0x155bdf);var _0x2452cf=[];_0x2452cf[_0xe541('0x5d')]({'model':db[_0xe541('0x5e')],'as':_0xe541('0x5e'),'attributes':['id','fullname'],'raw':!![]});_0x2452cf[_0xe541('0x5d')]({'model':db[_0xe541('0x5f')],'as':_0xe541('0x60'),'attributes':['id',_0xe541('0x61'),'lastName'],'raw':!![]});if(_0x3a4dc4[_0xe541('0x28')][_0xe541('0x5b')]){_0x2452cf[_0xe541('0x5d')]({'model':db[_0xe541('0x62')],'as':_0xe541('0x62'),'raw':!![]});}var _0x12c227=[{'model':db[_0xe541('0x3a')],'as':_0xe541('0x63'),'attributes':['id',_0xe541('0x35'),_0xe541('0x64'),_0xe541('0x65'),'secret','read'],'include':_0x2452cf}];_0x12c227[_0xe541('0x5d')]({'model':db['WhatsappAccount'],'as':_0xe541('0x66'),'attributes':['id','name']});_0x12c227['push']({'model':db[_0xe541('0x5e')],'as':_0xe541('0x67'),'attributes':['id','fullname']});return db[_0xe541('0x21')][_0xe541('0x36')]({'where':{'id':_0x3a4dc4['params']['id']},'include':_0x12c227})['then'](handleEntityNotFound(_0x40cc66,null))[_0xe541('0x2a')](function(_0x332a8d){if(_0x332a8d){var _0x2f9f79=_0x332a8d[_0xe541('0x68')]({'plain':!![]});fs[_0xe541('0x69')](_0x2e4bae);var _0xce7159={'channel':'Whatsapp','account':_0x2f9f79[_0xe541('0x66')][_0xe541('0x1e')],'agent':_0x2f9f79['Owner']?_0x2f9f79[_0xe541('0x67')][_0xe541('0x6a')]:_0xe541('0x6b'),'createdAt':moment(_0x2f9f79[_0xe541('0x64')])[_0xe541('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe541('0x55')](),'closedAt':_0x2f9f79[_0xe541('0x6c')]?moment(_0x2f9f79[_0xe541('0x6d')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x2f9f79['disposition'],'messages':_(_0x2f9f79[_0xe541('0x63')])[_0xe541('0x44')]({'secret':![]})[_0xe541('0x20')](function(_0x1ae2f4){if(_0x1ae2f4[_0xe541('0x62')]){var _0x2174ee=path['join'](_0x587212,_0x1ae2f4['Attachment'][_0xe541('0x6e')]);if(fs[_0xe541('0x6f')](_0x2174ee)){fs[_0xe541('0x70')](_0x2174ee)[_0xe541('0x71')](fs[_0xe541('0x72')](path[_0xe541('0x56')](_0x2e4bae,_0x1ae2f4['Attachment'][_0xe541('0x6e')])));}}return{'date':moment(_0x1ae2f4[_0xe541('0x64')])[_0xe541('0x48')](_0xe541('0x49'))['toString'](),'sender':_0x1ae2f4[_0xe541('0x65')]===_0xe541('0x73')?_0x1ae2f4[_0xe541('0x5e')]?_0x1ae2f4['User'][_0xe541('0x6a')]:_0xe541('0x74'):_0x1ae2f4[_0xe541('0x60')]['firstName']+(_0x1ae2f4[_0xe541('0x60')][_0xe541('0x75')]?'\x20'+_0x1ae2f4['Contact'][_0xe541('0x75')]:''),'body':_0x1ae2f4['Attachment']?_0x1ae2f4[_0xe541('0x62')][_0xe541('0x6e')]:_0x1ae2f4[_0xe541('0x35')],'direction':_0x1ae2f4[_0xe541('0x65')]==='out'?'A':'C','secret':_0x1ae2f4[_0xe541('0x76')],'read':_0x1ae2f4[_0xe541('0x77')],'attachment':_0x1ae2f4['Attachment']};})[_0xe541('0x78')]()};return ejs[_0xe541('0x79')](path['join'](config['root'],_0xe541('0x58'),_0xe541('0x7a'),_0xe541('0x7b')),{'interaction':_0xce7159})[_0xe541('0x2a')](function(_0x1ef20f){var _0x441f1f=path[_0xe541('0x56')](_0x2e4bae,_0xe541('0x7c')+_0x2f9f79['id']+'-'+_0x58df84+'.pdf');var _0x44000b={'path':_0x441f1f,'channel':_0xe541('0x7d'),'interactionId':_0x2f9f79['id']};return pdf[_0xe541('0x7e')](_0x1ef20f,_0x44000b);})[_0xe541('0x2a')](function(){return new BPromise(function(_0x36a391,_0x23b442){zipdir(_0x2e4bae,{'saveTo':_0x125aa3},function(_0x1b2287,_0x2ce0b8){if(_0x1b2287)return _0x23b442(_0x1b2287);return _0x36a391(_0x2ce0b8);});})[_0xe541('0x2a')](function(){return new BPromise(function(_0x2d735a,_0x3db09d){rimraf(_0x2e4bae,function(_0xd48f94){if(_0xd48f94)_0x3db09d(_0xd48f94);return _0x2d735a();});});})[_0xe541('0x2a')](function(){return _0x40cc66[_0xe541('0x53')](_0x125aa3,_0x155bdf,function(_0x5d4bad){if(_0x5d4bad){console['log']('err',_0x5d4bad);}else{fs['unlinkSync'](_0x125aa3);}});});});}else{return _0x40cc66['sendStatus'](0xc8);}})[_0xe541('0x2b')](handleError(_0x40cc66,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 105492d..1952ee8 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 _0x1120=['remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','update'];(function(_0x294f8e,_0x53d51d){var _0x2f3eca=function(_0x18ee67){while(--_0x18ee67){_0x294f8e['push'](_0x294f8e['shift']());}};_0x2f3eca(++_0x53d51d);}(_0x1120,0x140));var _0x0112=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x1120[_0x934425];return _0x31d596;};'use strict';var EventEmitter=require(_0x0112('0x0'));var WhatsappInteraction=require(_0x0112('0x1'))['db'][_0x0112('0x2')];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0112('0x3'),'afterDestroy':_0x0112('0x4')};function emitEvent(_0x1d9e34){return function(_0xa78633,_0x419307,_0x10fdca){_0xa78633[_0x0112('0x5')]({'attributes':['id'],'raw':!![]})[_0x0112('0x6')](function(_0x31d67a){_0xa78633[_0x0112('0x7')](_0x0112('0x8'),_0x31d67a[_0x0112('0x9')](function(_0x4bf145){return{'id':_0x4bf145['id']};}));return WhatsappMessage[_0x0112('0xa')]({'where':{'WhatsappInteractionId':_0xa78633['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0112('0x6')](function(_0x2f9a7d){_0xa78633[_0x0112('0x7')](_0x0112('0xb'),_0x2f9a7d[_0x0112('0xc')]);WhatsappInteractionEvents[_0x0112('0xd')](_0x1d9e34+':'+_0xa78633['id'],_0xa78633);WhatsappInteractionEvents['emit'](_0x1d9e34,_0xa78633);_0x10fdca(null);})[_0x0112('0xe')](_0x10fdca(null));};}for(var e in events){if(events[_0x0112('0xf')](e)){var event=events[e];WhatsappInteraction[_0x0112('0x10')](e,emitEvent(event));}}module[_0x0112('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x8868=['../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','length','catch','hook','exports','events'];(function(_0x55014d,_0x592cc2){var _0x425283=function(_0xa3b08e){while(--_0xa3b08e){_0x55014d['push'](_0x55014d['shift']());}};_0x425283(++_0x592cc2);}(_0x8868,0x1ca));var _0x8886=function(_0x4a05ad,_0x30842f){_0x4a05ad=_0x4a05ad-0x0;var _0x46e0d4=_0x8868[_0x4a05ad];return _0x46e0d4;};'use strict';var EventEmitter=require(_0x8886('0x0'));var WhatsappInteraction=require(_0x8886('0x1'))['db'][_0x8886('0x2')];var WhatsappMessage=require(_0x8886('0x1'))['db'][_0x8886('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x8886('0x4')](0x0);var events={'afterCreate':_0x8886('0x5'),'afterUpdate':_0x8886('0x6'),'afterDestroy':_0x8886('0x7')};function emitEvent(_0x224e93){return function(_0x433880,_0x59fca9,_0x544272){_0x433880[_0x8886('0x8')]({'attributes':['id'],'raw':!![]})[_0x8886('0x9')](function(_0x5e2a73){_0x433880[_0x8886('0xa')]('Users',_0x5e2a73[_0x8886('0xb')](function(_0x36c0dd){return{'id':_0x36c0dd['id']};}));return WhatsappMessage[_0x8886('0xc')]({'where':{'WhatsappInteractionId':_0x433880['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8886('0x9')](function(_0x1d25b0){_0x433880[_0x8886('0xa')]('unreadMessages',_0x1d25b0[_0x8886('0xd')]);WhatsappInteractionEvents['emit'](_0x224e93+':'+_0x433880['id'],_0x433880);WhatsappInteractionEvents['emit'](_0x224e93,_0x433880);_0x544272(null);})[_0x8886('0xe')](_0x544272(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x8886('0xf')](e,emitEvent(event));}}module[_0x8886('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 692a8c5..e8943da 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 _0x659c=['exports','define','WhatsappInteraction','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','request-promise','path','./whatsappInteraction.attributes'];(function(_0xf363f0,_0x3b5eeb){var _0x55a386=function(_0x548349){while(--_0x548349){_0xf363f0['push'](_0xf363f0['shift']());}};_0x55a386(++_0x3b5eeb);}(_0x659c,0x1aa));var _0xc659=function(_0x134de4,_0x49c839){_0x134de4=_0x134de4-0x0;var _0xe97f36=_0x659c[_0x134de4];return _0xe97f36;};'use strict';var _=require(_0xc659('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc659('0x1'));var moment=require(_0xc659('0x2'));var BPromise=require('bluebird');var rp=require(_0xc659('0x3'));var fs=require('fs');var path=require(_0xc659('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc659('0x5'));module[_0xc659('0x6')]=function(_0x369dc0,_0x312440){return _0x369dc0[_0xc659('0x7')](_0xc659('0x8'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51b67f,_0x2cc93d,_0x56885a){if(_0x51b67f['changed']('closed')){_0x51b67f[_0xc659('0x9')]=moment()[_0xc659('0xa')](_0xc659('0xb'));}_0x56885a(null,_0x51b67f);}}});}; \ No newline at end of file +var _0x77b0=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','changed'];(function(_0x569998,_0x361b8d){var _0x2f8256=function(_0x3354f1){while(--_0x3354f1){_0x569998['push'](_0x569998['shift']());}};_0x2f8256(++_0x361b8d);}(_0x77b0,0xd4));var _0x077b=function(_0x4ba36a,_0x5d51ab){_0x4ba36a=_0x4ba36a-0x0;var _0x4437e5=_0x77b0[_0x4ba36a];return _0x4437e5;};'use strict';var _=require('lodash');var util=require(_0x077b('0x0'));var logger=require(_0x077b('0x1'))('api');var moment=require(_0x077b('0x2'));var BPromise=require(_0x077b('0x3'));var rp=require(_0x077b('0x4'));var fs=require('fs');var path=require(_0x077b('0x5'));var rimraf=require(_0x077b('0x6'));var config=require('../../config/environment');var attributes=require(_0x077b('0x7'));module[_0x077b('0x8')]=function(_0x28d2ae,_0x4848ec){return _0x28d2ae[_0x077b('0x9')](_0x077b('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57843c,_0x30d0de,_0x5d2b34){if(_0x57843c[_0x077b('0xb')](_0x077b('0xc'))){_0x57843c[_0x077b('0xd')]=moment()[_0x077b('0xe')](_0x077b('0xf'));}_0x5d2b34(null,_0x57843c);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 1267d62..d187e9b 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 _0xbd1f=['stringify','error','code','message','result','catch','WhatsappInteraction','update','body','options','where','UpdateWhatsappInteraction','find','addTags','ids','omit','AddTags','debug','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x402d22,_0x428cfd){var _0x12a902=function(_0x370afb){while(--_0x370afb){_0x402d22['push'](_0x402d22['shift']());}};_0x12a902(++_0x428cfd);}(_0xbd1f,0x14a));var _0xfbd1=function(_0x4fa3d2,_0x1bb8db){_0x4fa3d2=_0x4fa3d2-0x0;var _0x1ea3fd=_0xbd1f[_0x4fa3d2];return _0x1ea3fd;};'use strict';var _=require(_0xfbd1('0x0'));var util=require('util');var moment=require(_0xfbd1('0x1'));var BPromise=require('bluebird');var rs=require(_0xfbd1('0x2'));var fs=require('fs');var Redis=require(_0xfbd1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbd1('0x4'));var logger=require(_0xfbd1('0x5'))(_0xfbd1('0x6'));var config=require(_0xfbd1('0x7'));var jayson=require(_0xfbd1('0x8'));var client=jayson[_0xfbd1('0x9')][_0xfbd1('0xa')]({'port':0x232a});config[_0xfbd1('0xb')]=_[_0xfbd1('0xc')](config[_0xfbd1('0xb')],{'host':_0xfbd1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0xfbd1('0xe')](socket);function respondWithRpcPromise(_0x349300,_0x461c47,_0x5923a9){return new BPromise(function(_0x350236,_0x51d207){return client[_0xfbd1('0xf')](_0x349300,_0x5923a9)[_0xfbd1('0x10')](function(_0x27ee1e){logger[_0xfbd1('0x11')](_0xfbd1('0x12'),_0x461c47,_0xfbd1('0x13'));logger['debug'](_0xfbd1('0x14'),_0x461c47,_0xfbd1('0x13'),JSON[_0xfbd1('0x15')](_0x27ee1e));if(_0x27ee1e[_0xfbd1('0x16')]){if(_0x27ee1e['error'][_0xfbd1('0x17')]===0x1f4){logger[_0xfbd1('0x16')](_0xfbd1('0x12'),_0x461c47,_0x27ee1e[_0xfbd1('0x16')][_0xfbd1('0x18')]);return _0x51d207(_0x27ee1e['error'][_0xfbd1('0x18')]);}logger[_0xfbd1('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x461c47,_0x27ee1e[_0xfbd1('0x16')][_0xfbd1('0x18')]);return _0x350236(_0x27ee1e['error'][_0xfbd1('0x18')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x461c47,_0xfbd1('0x13'));_0x350236(_0x27ee1e[_0xfbd1('0x19')][_0xfbd1('0x18')]);}})[_0xfbd1('0x1a')](function(_0x4bf510){logger[_0xfbd1('0x16')](_0xfbd1('0x12'),_0x461c47,_0x4bf510);_0x51d207(_0x4bf510);});});}exports['UpdateWhatsappInteraction']=function(_0x8aef34){var _0xc1fb3f=this;return new Promise(function(_0x42fcdb,_0x4c11fe){return db[_0xfbd1('0x1b')][_0xfbd1('0x1c')](_0x8aef34[_0xfbd1('0x1d')],{'raw':_0x8aef34[_0xfbd1('0x1e')]?_0x8aef34[_0xfbd1('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8aef34[_0xfbd1('0x1e')]?_0x8aef34[_0xfbd1('0x1e')][_0xfbd1('0x1f')]||null:null,'attributes':_0x8aef34['options']?_0x8aef34['options']['attributes']||null:null,'limit':_0x8aef34[_0xfbd1('0x1e')]?_0x8aef34[_0xfbd1('0x1e')]['limit']||null:null})[_0xfbd1('0x10')](function(_0x1bb837){logger[_0xfbd1('0x11')](_0xfbd1('0x20'),_0x8aef34);logger['debug'](_0xfbd1('0x20'),_0x8aef34,JSON[_0xfbd1('0x15')](_0x1bb837));_0x42fcdb(_0x1bb837);})['catch'](function(_0x130213){logger[_0xfbd1('0x16')]('UpdateWhatsappInteraction',_0x130213['message'],_0x8aef34);_0x4c11fe(_0xc1fb3f[_0xfbd1('0x16')](0x1f4,_0x130213['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x22ad7e){return new Promise(function(_0x5c3989,_0x306800){return db['WhatsappInteraction'][_0xfbd1('0x21')]({'where':_0x22ad7e[_0xfbd1('0x1e')]?_0x22ad7e[_0xfbd1('0x1e')][_0xfbd1('0x1f')]||null:null})[_0xfbd1('0x10')](function(_0x2c6819){if(_0x2c6819){return _0x2c6819[_0xfbd1('0x22')](_0x22ad7e[_0xfbd1('0x1d')][_0xfbd1('0x23')],_[_0xfbd1('0x24')](_0x22ad7e[_0xfbd1('0x1d')],['ids','id'])||{});}})['spread'](function(_0x14436b){logger['info'](_0xfbd1('0x25'),_0x22ad7e);logger[_0xfbd1('0x26')](_0xfbd1('0x25'),_0x22ad7e,JSON[_0xfbd1('0x15')](_0x14436b));_0x5c3989(_0x14436b);})[_0xfbd1('0x1a')](function(_0x407599){logger[_0xfbd1('0x16')](_0xfbd1('0x25'),_0x407599[_0xfbd1('0x18')],_0x22ad7e);_0x306800(_this['error'](0x1f4,_0x407599[_0xfbd1('0x18')]));});});}; \ No newline at end of file +var _0x89b9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./whatsappInteraction.socket','then','info','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','catch','body','options','attributes','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags','ids','omit','AddTags','debug','lodash','util','moment'];(function(_0x384166,_0x4dadc3){var _0x4d8dc0=function(_0x42d207){while(--_0x42d207){_0x384166['push'](_0x384166['shift']());}};_0x4d8dc0(++_0x4dadc3);}(_0x89b9,0x91));var _0x989b=function(_0x4392cf,_0x18c407){_0x4392cf=_0x4392cf-0x0;var _0x32d8d9=_0x89b9[_0x4392cf];return _0x32d8d9;};'use strict';var _=require(_0x989b('0x0'));var util=require(_0x989b('0x1'));var moment=require(_0x989b('0x2'));var BPromise=require(_0x989b('0x3'));var rs=require(_0x989b('0x4'));var fs=require('fs');var Redis=require(_0x989b('0x5'));var db=require(_0x989b('0x6'))['db'];var utils=require(_0x989b('0x7'));var logger=require('../../config/logger')(_0x989b('0x8'));var config=require(_0x989b('0x9'));var jayson=require(_0x989b('0xa'));var client=jayson[_0x989b('0xb')]['http']({'port':0x232a});config[_0x989b('0xc')]=_['defaults'](config[_0x989b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x989b('0xd'))(new Redis(config[_0x989b('0xc')]));require(_0x989b('0xe'))['register'](socket);function respondWithRpcPromise(_0x5c7c8e,_0x45429c,_0x3cff12){return new BPromise(function(_0x23cfcb,_0x37dbb4){return client['request'](_0x5c7c8e,_0x3cff12)[_0x989b('0xf')](function(_0x471c0b){logger[_0x989b('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x45429c,_0x989b('0x11'));logger['debug'](_0x989b('0x12'),_0x45429c,_0x989b('0x11'),JSON[_0x989b('0x13')](_0x471c0b));if(_0x471c0b[_0x989b('0x14')]){if(_0x471c0b[_0x989b('0x14')][_0x989b('0x15')]===0x1f4){logger['error'](_0x989b('0x16'),_0x45429c,_0x471c0b[_0x989b('0x14')][_0x989b('0x17')]);return _0x37dbb4(_0x471c0b[_0x989b('0x14')][_0x989b('0x17')]);}logger[_0x989b('0x14')](_0x989b('0x16'),_0x45429c,_0x471c0b[_0x989b('0x14')][_0x989b('0x17')]);return _0x23cfcb(_0x471c0b[_0x989b('0x14')][_0x989b('0x17')]);}else{logger[_0x989b('0x10')](_0x989b('0x16'),_0x45429c,_0x989b('0x11'));_0x23cfcb(_0x471c0b['result'][_0x989b('0x17')]);}})[_0x989b('0x18')](function(_0x3e4699){logger['error'](_0x989b('0x16'),_0x45429c,_0x3e4699);_0x37dbb4(_0x3e4699);});});}exports['UpdateWhatsappInteraction']=function(_0x484425){var _0x179862=this;return new Promise(function(_0x566930,_0x2fe13b){return db['WhatsappInteraction']['update'](_0x484425[_0x989b('0x19')],{'raw':_0x484425[_0x989b('0x1a')]?_0x484425['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x484425[_0x989b('0x1a')]?_0x484425[_0x989b('0x1a')]['where']||null:null,'attributes':_0x484425[_0x989b('0x1a')]?_0x484425[_0x989b('0x1a')][_0x989b('0x1b')]||null:null,'limit':_0x484425[_0x989b('0x1a')]?_0x484425[_0x989b('0x1a')]['limit']||null:null})['then'](function(_0x1f3c98){logger[_0x989b('0x10')]('UpdateWhatsappInteraction',_0x484425);logger['debug'](_0x989b('0x1c'),_0x484425,JSON['stringify'](_0x1f3c98));_0x566930(_0x1f3c98);})[_0x989b('0x18')](function(_0xeefc76){logger[_0x989b('0x14')]('UpdateWhatsappInteraction',_0xeefc76[_0x989b('0x17')],_0x484425);_0x2fe13b(_0x179862['error'](0x1f4,_0xeefc76[_0x989b('0x17')]));});});};exports[_0x989b('0x1d')]=function(_0x57787a){return new Promise(function(_0x281f48,_0x250606){return db[_0x989b('0x1e')][_0x989b('0x1f')]({'where':_0x57787a[_0x989b('0x1a')]?_0x57787a[_0x989b('0x1a')]['where']||null:null})[_0x989b('0xf')](function(_0x37cea6){if(_0x37cea6){return _0x37cea6[_0x989b('0x20')](_0x57787a['body'][_0x989b('0x21')],_[_0x989b('0x22')](_0x57787a[_0x989b('0x19')],['ids','id'])||{});}})['spread'](function(_0x43843c){logger[_0x989b('0x10')](_0x989b('0x23'),_0x57787a);logger[_0x989b('0x24')](_0x989b('0x23'),_0x57787a,JSON[_0x989b('0x13')](_0x43843c));_0x281f48(_0x43843c);})['catch'](function(_0x3a5f9f){logger[_0x989b('0x14')]('AddTags',_0x3a5f9f[_0x989b('0x17')],_0x57787a);_0x250606(_this['error'](0x1f4,_0x3a5f9f['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 10d6224..6ad4c0e 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 _0xb6c0=['./whatsappInteraction.events','save','remove','emit','removeListener','length','whatsappInteraction:'];(function(_0x4df88c,_0x3585cf){var _0x2312b9=function(_0x44d3b7){while(--_0x44d3b7){_0x4df88c['push'](_0x4df88c['shift']());}};_0x2312b9(++_0x3585cf);}(_0xb6c0,0x7e));var _0x0b6c=function(_0x289d11,_0x2925a5){_0x289d11=_0x289d11-0x0;var _0x13de3f=_0xb6c0[_0x289d11];return _0x13de3f;};'use strict';var WhatsappInteractionEvents=require(_0x0b6c('0x0'));var events=[_0x0b6c('0x1'),_0x0b6c('0x2'),'update'];function createListener(_0x4a3a0f,_0x34b42d){return function(_0x2d0bba){_0x34b42d[_0x0b6c('0x3')](_0x4a3a0f,_0x2d0bba);};}function removeListener(_0x10d58e,_0x15ee10){return function(){WhatsappInteractionEvents[_0x0b6c('0x4')](_0x10d58e,_0x15ee10);};}exports['register']=function(_0x180534){for(var _0x39dfdb=0x0,_0x17291c=events[_0x0b6c('0x5')];_0x39dfdb<_0x17291c;_0x39dfdb++){var _0xca12d9=events[_0x39dfdb];var _0x159b1b=createListener(_0x0b6c('0x6')+_0xca12d9,_0x180534);WhatsappInteractionEvents['on'](_0xca12d9,_0x159b1b);}}; \ No newline at end of file +var _0xa879=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit'];(function(_0x15b25b,_0x5af32f){var _0x56a7c3=function(_0x1374c6){while(--_0x1374c6){_0x15b25b['push'](_0x15b25b['shift']());}};_0x56a7c3(++_0x5af32f);}(_0xa879,0x123));var _0x9a87=function(_0x3c80b1,_0x10698d){_0x3c80b1=_0x3c80b1-0x0;var _0xa84632=_0xa879[_0x3c80b1];return _0xa84632;};'use strict';var WhatsappInteractionEvents=require(_0x9a87('0x0'));var events=[_0x9a87('0x1'),_0x9a87('0x2'),_0x9a87('0x3')];function createListener(_0x580698,_0x1c1c60){return function(_0x5d6967){_0x1c1c60[_0x9a87('0x4')](_0x580698,_0x5d6967);};}function removeListener(_0x547ab7,_0x2ae7bf){return function(){WhatsappInteractionEvents['removeListener'](_0x547ab7,_0x2ae7bf);};}exports[_0x9a87('0x5')]=function(_0x7edf09){for(var _0x397d03=0x0,_0x29324a=events[_0x9a87('0x6')];_0x397d03<_0x29324a;_0x397d03++){var _0x5562b4=events[_0x397d03];var _0x6233fa=createListener(_0x9a87('0x7')+_0x5562b4,_0x7edf09);WhatsappInteractionEvents['on'](_0x5562b4,_0x6233fa);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index d6a93ce..8ee8160 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 _0xec85=['/:id/status','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','tracked','whatsapp','whatsappmessage:create','create','post'];(function(_0x1453d0,_0x63d4f){var _0x8b9e3b=function(_0x247cdf){while(--_0x247cdf){_0x1453d0['push'](_0x1453d0['shift']());}};_0x8b9e3b(++_0x63d4f);}(_0xec85,0x148));var _0x5ec8=function(_0x3023f2,_0x278d8b){_0x3023f2=_0x3023f2-0x0;var _0x8315d2=_0xec85[_0x3023f2];return _0x8315d2;};'use strict';var multer=require(_0x5ec8('0x0'));var util=require(_0x5ec8('0x1'));var path=require(_0x5ec8('0x2'));var timeout=require('connect-timeout');var express=require(_0x5ec8('0x3'));var router=express[_0x5ec8('0x4')]();var fs_extra=require(_0x5ec8('0x5'));var auth=require(_0x5ec8('0x6'));var interaction=require(_0x5ec8('0x7'));var config=require(_0x5ec8('0x8'));var controller=require('./whatsappMessage.controller');router[_0x5ec8('0x9')]('/',auth[_0x5ec8('0xa')](),controller[_0x5ec8('0xb')]);router['get'](_0x5ec8('0xc'),auth[_0x5ec8('0xa')](),controller[_0x5ec8('0xd')]);router[_0x5ec8('0x9')](_0x5ec8('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction[_0x5ec8('0xf')](_0x5ec8('0x10'),_0x5ec8('0x11')),controller[_0x5ec8('0x12')]);router[_0x5ec8('0x13')](_0x5ec8('0x14'),controller['status']);router[_0x5ec8('0x15')](_0x5ec8('0xe'),auth[_0x5ec8('0xa')](),controller[_0x5ec8('0x16')]);router['put'](_0x5ec8('0x17'),auth[_0x5ec8('0xa')](),controller[_0x5ec8('0x18')]);router['put'](_0x5ec8('0x19'),auth[_0x5ec8('0xa')](),controller[_0x5ec8('0x1a')]);router[_0x5ec8('0x1b')](_0x5ec8('0xe'),auth[_0x5ec8('0xa')](),controller['destroy']);module[_0x5ec8('0x1c')]=router; \ No newline at end of file +var _0xfd7b=['/:id','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','get','/describe','describe','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status'];(function(_0x3d1b44,_0x87f8ec){var _0x535e56=function(_0x133433){while(--_0x133433){_0x3d1b44['push'](_0x3d1b44['shift']());}};_0x535e56(++_0x87f8ec);}(_0xfd7b,0x159));var _0xbfd7=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0xfd7b[_0x1ca9e9];return _0x309f3c;};'use strict';var multer=require(_0xbfd7('0x0'));var util=require(_0xbfd7('0x1'));var path=require('path');var timeout=require(_0xbfd7('0x2'));var express=require(_0xbfd7('0x3'));var router=express[_0xbfd7('0x4')]();var fs_extra=require(_0xbfd7('0x5'));var auth=require(_0xbfd7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbfd7('0x7'));var controller=require(_0xbfd7('0x8'));router['get']('/',auth[_0xbfd7('0x9')](),controller['index']);router[_0xbfd7('0xa')](_0xbfd7('0xb'),auth['isAuthenticated'](),controller[_0xbfd7('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xbfd7('0xd')]('/',auth[_0xbfd7('0x9')](),interaction[_0xbfd7('0xe')](_0xbfd7('0xf'),_0xbfd7('0x10')),controller['create']);router[_0xbfd7('0xd')](_0xbfd7('0x11'),controller[_0xbfd7('0x12')]);router['put'](_0xbfd7('0x13'),auth[_0xbfd7('0x9')](),controller['update']);router['put'](_0xbfd7('0x14'),auth['isAuthenticated'](),controller[_0xbfd7('0x15')]);router[_0xbfd7('0x16')](_0xbfd7('0x17'),auth['isAuthenticated'](),controller[_0xbfd7('0x18')]);router[_0xbfd7('0x19')](_0xbfd7('0x13'),auth[_0xbfd7('0x9')](),controller[_0xbfd7('0x1a')]);module[_0xbfd7('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 317787c..4ea7211 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 _0x8066=['STRING','DATE','TEXT','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x5dee2a,_0x47d02a){var _0x31e98e=function(_0x48b1e9){while(--_0x48b1e9){_0x5dee2a['push'](_0x5dee2a['shift']());}};_0x31e98e(++_0x47d02a);}(_0x8066,0x83));var _0x6806=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8066[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x6806('0x0'));module[_0x6806('0x1')]={'body':{'type':Sequelize['TEXT'](_0x6806('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6806('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6806('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x6806('0x5')](0xbe)},'phone':{'type':Sequelize[_0x6806('0x5')]},'readAt':{'type':Sequelize[_0x6806('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x6806('0x5')]},'providerResponse':{'type':Sequelize[_0x6806('0x7')]}}; \ No newline at end of file +var _0xd82a=['out','STRING','DATE','BOOLEAN','TEXT','sequelize','medium','ENUM'];(function(_0x589b37,_0x5a7483){var _0x5f2c82=function(_0x1c0f7d){while(--_0x1c0f7d){_0x589b37['push'](_0x589b37['shift']());}};_0x5f2c82(++_0x5a7483);}(_0xd82a,0x7d));var _0xad82=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0xd82a[_0x1f36bb];return _0xaf97fa;};'use strict';var Sequelize=require(_0xad82('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xad82('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xad82('0x2')]('in',_0xad82('0x3')),'defaultValue':_0xad82('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xad82('0x4')](0xbe)},'phone':{'type':Sequelize[_0xad82('0x4')]},'readAt':{'type':Sequelize[_0xad82('0x5')]},'secret':{'type':Sequelize[_0xad82('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xad82('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 70fa90e..b9e6334 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 _0x0ad3=['read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','WhatsappInteraction','WhatsappInteractionId','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','email','WhatsappAccount','WhatsappAccountId','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappMessage','includeAll','include','findAll','rows','params','keys','create','body','find','describe','whatsapp-interactions','whatsapp'];(function(_0x9b53a6,_0x4d90f1){var _0x346ba1=function(_0x568507){while(--_0x568507){_0x9b53a6['push'](_0x9b53a6['shift']());}};_0x346ba1(++_0x4d90f1);}(_0x0ad3,0x1ce));var _0x30ad=function(_0x2f624d,_0x221262){_0x2f624d=_0x2f624d-0x0;var _0x56c440=_0x0ad3[_0x2f624d];return _0x56c440;};'use strict';var emlformat=require(_0x30ad('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x30ad('0x1'));var rp=require('request-promise');var moment=require(_0x30ad('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x30ad('0x3'));var util=require(_0x30ad('0x4'));var path=require(_0x30ad('0x5'));var sox=require(_0x30ad('0x6'));var csv=require(_0x30ad('0x7'));var ejs=require(_0x30ad('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x30ad('0x9'));var squel=require('squel');var crypto=require(_0x30ad('0xa'));var jsforce=require(_0x30ad('0xb'));var deskjs=require(_0x30ad('0xc'));var toCsv=require(_0x30ad('0x7'));var querystring=require(_0x30ad('0xd'));var Papa=require(_0x30ad('0xe'));var Redis=require(_0x30ad('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x30ad('0x10'));var as=require(_0x30ad('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x30ad('0x12'))('api');var utils=require(_0x30ad('0x13'));var config=require(_0x30ad('0x14'));var licenseUtil=require(_0x30ad('0x15'));var db=require(_0x30ad('0x16'))['db'];config[_0x30ad('0x17')]=_[_0x30ad('0x18')](config[_0x30ad('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x30ad('0x19'))(new Redis(config[_0x30ad('0x17')]));require('./whatsappMessage.socket')[_0x30ad('0x1a')](socket);var jayson=require(_0x30ad('0x1b'));var client=jayson[_0x30ad('0x1c')][_0x30ad('0x1d')]({'port':0x232c});var client9002=jayson[_0x30ad('0x1c')][_0x30ad('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1c94f6,_0x4e38d1,_0x8b206,_0x4929ad){return new BPromise(function(_0xe38b60,_0x57c5f5){var _0x37b118=_0x4929ad||client;return _0x37b118[_0x30ad('0x1e')](_0x1c94f6,_0x8b206)[_0x30ad('0x1f')](function(_0x240fa1){logger[_0x30ad('0x20')](_0x30ad('0x21'),_0x4e38d1,_0x30ad('0x22'));logger[_0x30ad('0x23')](_0x30ad('0x24'),_0x4e38d1,_0x30ad('0x22'),JSON[_0x30ad('0x25')](_0x240fa1));if(_0x240fa1[_0x30ad('0x26')]){if(_0x240fa1[_0x30ad('0x26')][_0x30ad('0x27')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x4e38d1,_0x240fa1[_0x30ad('0x26')][_0x30ad('0x28')]);return _0x57c5f5(_0x240fa1['error'][_0x30ad('0x28')]);}logger['error'](_0x30ad('0x21'),_0x4e38d1,_0x240fa1[_0x30ad('0x26')][_0x30ad('0x28')]);return _0xe38b60(_0x240fa1['error'][_0x30ad('0x28')]);}else{logger[_0x30ad('0x20')](_0x30ad('0x21'),_0x4e38d1,'request\x20sent');_0xe38b60(_0x240fa1['result']['message']);}})[_0x30ad('0x29')](function(_0x4f485c){logger['error'](_0x30ad('0x21'),_0x4e38d1,_0x4f485c);_0x57c5f5(_0x4f485c);});});}function respondWithStatusCode(_0x343cc4,_0xbadb07){_0xbadb07=_0xbadb07||0xcc;return function(_0x1dfadb){if(_0x1dfadb){return _0x343cc4[_0x30ad('0x2a')](_0xbadb07);}return _0x343cc4[_0x30ad('0x2b')](_0xbadb07)[_0x30ad('0x2c')]();};}function respondWithResult(_0x681901,_0x188d9b){_0x188d9b=_0x188d9b||0xc8;return function(_0x209e31){if(_0x209e31){return _0x681901['status'](_0x188d9b)[_0x30ad('0x2d')](_0x209e31);}};}function respondWithFilteredResult(_0x3fcd28,_0x46d77a){return function(_0x1ff077){if(_0x1ff077){var _0x1f3f25=typeof _0x46d77a['offset']===_0x30ad('0x2e')&&typeof _0x46d77a[_0x30ad('0x2f')]===_0x30ad('0x2e');var _0x23a802=_0x1ff077['count'];var _0x4bfe9a=_0x1f3f25?0x0:_0x46d77a[_0x30ad('0x30')];var _0xd55063=_0x1f3f25?_0x1ff077[_0x30ad('0x31')]:_0x46d77a[_0x30ad('0x30')]+_0x46d77a[_0x30ad('0x2f')];var _0x202b12;if(_0xd55063>=_0x23a802){_0xd55063=_0x23a802;_0x202b12=0xc8;}else{_0x202b12=0xce;}_0x3fcd28['status'](_0x202b12);return _0x3fcd28[_0x30ad('0x32')](_0x30ad('0x33'),_0x4bfe9a+'-'+_0xd55063+'/'+_0x23a802)[_0x30ad('0x2d')](_0x1ff077);}return null;};}function patchUpdates(_0x5d471a){return function(_0x15d855){try{jsonpatch[_0x30ad('0x34')](_0x15d855,_0x5d471a,!![]);}catch(_0x15d27b){return BPromise[_0x30ad('0x35')](_0x15d27b);}return _0x15d855[_0x30ad('0x36')]();};}function saveUpdates(_0x44ba11,_0x34912c){return function(_0x570e5a){if(_0x570e5a){return _0x570e5a[_0x30ad('0x37')](_0x44ba11)[_0x30ad('0x1f')](function(_0x4dce94){return _0x4dce94;});}return null;};}function removeEntity(_0x2c7de5,_0x50b8e3){return function(_0x31abad){if(_0x31abad){return _0x31abad[_0x30ad('0x38')]()[_0x30ad('0x1f')](function(){_0x2c7de5[_0x30ad('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c4a6c,_0x5e4546){return function(_0x106051){if(!_0x106051){_0x2c4a6c[_0x30ad('0x2a')](0x194);}return _0x106051;};}function handleError(_0x1c6f22,_0x3bfd8f){_0x3bfd8f=_0x3bfd8f||0x1f4;return function(_0x2eda96){logger[_0x30ad('0x26')](_0x2eda96[_0x30ad('0x39')]);if(_0x2eda96[_0x30ad('0x3a')]){delete _0x2eda96[_0x30ad('0x3a')];}_0x1c6f22[_0x30ad('0x2b')](_0x3bfd8f)['send'](_0x2eda96);};}exports[_0x30ad('0x3b')]=function(_0x433df1,_0x6436dc){var _0x1c78e7={},_0x261fc8={},_0x79efe0={'count':0x0,'rows':[]};var _0x820f5=_[_0x30ad('0x3c')](db['WhatsappMessage'][_0x30ad('0x3d')],function(_0x488f82){return{'name':_0x488f82[_0x30ad('0x3e')],'type':_0x488f82[_0x30ad('0x3f')][_0x30ad('0x40')]};});_0x261fc8[_0x30ad('0x41')]=_[_0x30ad('0x3c')](_0x820f5,_0x30ad('0x3a'));_0x261fc8['query']=_['keys'](_0x433df1[_0x30ad('0x42')]);_0x261fc8[_0x30ad('0x43')]=_[_0x30ad('0x44')](_0x261fc8[_0x30ad('0x41')],_0x261fc8[_0x30ad('0x42')]);_0x1c78e7[_0x30ad('0x45')]=_['intersection'](_0x261fc8[_0x30ad('0x41')],qs[_0x30ad('0x46')](_0x433df1[_0x30ad('0x42')][_0x30ad('0x46')]));_0x1c78e7[_0x30ad('0x45')]=_0x1c78e7[_0x30ad('0x45')][_0x30ad('0x47')]?_0x1c78e7['attributes']:_0x261fc8[_0x30ad('0x41')];if(!_0x433df1[_0x30ad('0x42')]['hasOwnProperty'](_0x30ad('0x48'))){_0x1c78e7['limit']=qs[_0x30ad('0x2f')](_0x433df1[_0x30ad('0x42')][_0x30ad('0x2f')]);_0x1c78e7[_0x30ad('0x30')]=qs['offset'](_0x433df1[_0x30ad('0x42')][_0x30ad('0x30')]);}_0x1c78e7[_0x30ad('0x49')]=qs['sort'](_0x433df1[_0x30ad('0x42')][_0x30ad('0x4a')]);_0x1c78e7[_0x30ad('0x4b')]=qs['filters'](_[_0x30ad('0x4c')](_0x433df1[_0x30ad('0x42')],_0x261fc8['filters']),_0x820f5);if(_0x433df1['query'][_0x30ad('0x4d')]){_0x1c78e7[_0x30ad('0x4b')]=_[_0x30ad('0x4e')](_0x1c78e7[_0x30ad('0x4b')],{'$or':_[_0x30ad('0x3c')](_0x820f5,function(_0x1e68c7){if(_0x1e68c7[_0x30ad('0x3f')]!==_0x30ad('0x4f')){var _0x3b4454={};_0x3b4454[_0x1e68c7[_0x30ad('0x3a')]]={'$like':'%'+_0x433df1[_0x30ad('0x42')][_0x30ad('0x4d')]+'%'};return _0x3b4454;}})});}_0x1c78e7=_[_0x30ad('0x4e')]({},_0x1c78e7,_0x433df1[_0x30ad('0x50')]);var _0x34e3d1={'where':_0x1c78e7[_0x30ad('0x4b')]};return db[_0x30ad('0x51')][_0x30ad('0x31')](_0x34e3d1)[_0x30ad('0x1f')](function(_0x2b6821){_0x79efe0[_0x30ad('0x31')]=_0x2b6821;if(_0x433df1[_0x30ad('0x42')][_0x30ad('0x52')]){_0x1c78e7[_0x30ad('0x53')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x30ad('0x54')](_0x1c78e7);})['then'](function(_0x2fc81d){_0x79efe0[_0x30ad('0x55')]=_0x2fc81d;return _0x79efe0;})['then'](respondWithFilteredResult(_0x6436dc,_0x1c78e7))[_0x30ad('0x29')](handleError(_0x6436dc,null));};exports['show']=function(_0x1ca0dd,_0xdeb9bd){var _0x4c8a23={'raw':!![],'where':{'id':_0x1ca0dd[_0x30ad('0x56')]['id']}},_0x2628b7={};_0x2628b7[_0x30ad('0x41')]=_[_0x30ad('0x57')](db[_0x30ad('0x51')]['rawAttributes']);_0x2628b7[_0x30ad('0x42')]=_[_0x30ad('0x57')](_0x1ca0dd[_0x30ad('0x42')]);_0x2628b7[_0x30ad('0x43')]=_['intersection'](_0x2628b7['model'],_0x2628b7[_0x30ad('0x42')]);_0x4c8a23['attributes']=_[_0x30ad('0x44')](_0x2628b7[_0x30ad('0x41')],qs[_0x30ad('0x46')](_0x1ca0dd['query']['fields']));_0x4c8a23[_0x30ad('0x45')]=_0x4c8a23['attributes'][_0x30ad('0x47')]?_0x4c8a23['attributes']:_0x2628b7[_0x30ad('0x41')];if(_0x1ca0dd['query']['includeAll']){_0x4c8a23['include']=[{'all':!![]}];}_0x4c8a23=_[_0x30ad('0x4e')]({},_0x4c8a23,_0x1ca0dd['options']);return db[_0x30ad('0x51')]['find'](_0x4c8a23)['then'](handleEntityNotFound(_0xdeb9bd,null))[_0x30ad('0x1f')](respondWithResult(_0xdeb9bd,null))[_0x30ad('0x29')](handleError(_0xdeb9bd,null));};exports['create']=function(_0x555cc4,_0x5e16b3){return db[_0x30ad('0x51')][_0x30ad('0x58')](_0x555cc4[_0x30ad('0x59')],{})[_0x30ad('0x1f')](respondWithResult(_0x5e16b3,0xc9))['catch'](handleError(_0x5e16b3,null));};exports['update']=function(_0x289daa,_0x2f491c){if(_0x289daa[_0x30ad('0x59')]['id']){delete _0x289daa['body']['id'];}return db[_0x30ad('0x51')][_0x30ad('0x5a')]({'where':{'id':_0x289daa[_0x30ad('0x56')]['id']}})[_0x30ad('0x1f')](handleEntityNotFound(_0x2f491c,null))[_0x30ad('0x1f')](saveUpdates(_0x289daa[_0x30ad('0x59')],null))['then'](respondWithResult(_0x2f491c,null))[_0x30ad('0x29')](handleError(_0x2f491c,null));};exports[_0x30ad('0x38')]=function(_0x31119b,_0x54f1cb){return db[_0x30ad('0x51')]['find']({'where':{'id':_0x31119b[_0x30ad('0x56')]['id']}})[_0x30ad('0x1f')](handleEntityNotFound(_0x54f1cb,null))[_0x30ad('0x1f')](removeEntity(_0x54f1cb,null))['catch'](handleError(_0x54f1cb,null));};exports[_0x30ad('0x5b')]=function(_0xe496d0,_0xc42f9a){return db['WhatsappMessage'][_0x30ad('0x5b')]()[_0x30ad('0x1f')](respondWithResult(_0xc42f9a,null))[_0x30ad('0x29')](handleError(_0xc42f9a,null));};var interaction_log=require(_0x30ad('0x12'))(_0x30ad('0x5c'));exports['accept']=function(_0x2529c0,_0x3d67cc,_0x14dbe3){var _0x2f0a24={'agent':{},'channel':_0x30ad('0x5d')};if(_0x2529c0[_0x30ad('0x59')]['id']){delete _0x2529c0['body']['id'];}_0x2529c0[_0x30ad('0x59')][_0x30ad('0x5e')]=!![];_0x2529c0['body'][_0x30ad('0x5f')]=moment()[_0x30ad('0x60')](_0x30ad('0x61'));_0x2529c0['body'][_0x30ad('0x62')]=_0x2529c0[_0x30ad('0x59')][_0x30ad('0x62')]||_0x2529c0[_0x30ad('0x63')]['id'];_0x2f0a24[_0x30ad('0x64')]['id']=_0x2529c0[_0x30ad('0x59')]['UserId'];return db[_0x30ad('0x51')][_0x30ad('0x5a')]({'where':{'id':_0x2529c0[_0x30ad('0x56')]['id'],'UserId':null}})[_0x30ad('0x1f')](handleEntityNotFound(_0x3d67cc,null))[_0x30ad('0x1f')](saveUpdates(_0x2529c0['body'],null))[_0x30ad('0x1f')](function(_0x371cce){if(_0x371cce){_0x2f0a24[_0x30ad('0x28')]=_0x371cce[_0x30ad('0x65')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x371cce['WhatsappInteractionId']}});}return null;})[_0x30ad('0x1f')](handleEntityNotFound(_0x3d67cc,null))['then'](function(_0x1b99c5){if(_0x1b99c5){return _0x1b99c5[_0x30ad('0x37')]({'UserId':_0x2529c0['body'][_0x30ad('0x62')],'read1stAt':_[_0x30ad('0x66')](_0x1b99c5[_0x30ad('0x67')])?moment()['format'](_0x30ad('0x61')):undefined});}return null;})['then'](function(_0x5200be){if(_0x5200be){_0x2f0a24[_0x30ad('0x68')]=_0x5200be[_0x30ad('0x65')]({'plain':!![]});interaction_log[_0x30ad('0x20')](_0x30ad('0x69'),_0x2529c0[_0x30ad('0x63')]['id'],_0x2529c0[_0x30ad('0x63')][_0x30ad('0x3a')],_0x2529c0[_0x30ad('0x63')][_0x30ad('0x6a')],_0x2f0a24['interaction']['id'],_0x2529c0[_0x30ad('0x59')]?JSON[_0x30ad('0x25')](_0x2529c0[_0x30ad('0x59')]):_0x30ad('0x6b'));return respondWithRpcPromise(_0x30ad('0x6c'),_0x30ad('0x6d'),_0x2f0a24);}return null;})['then'](function(_0x258a12){var _0x4ef436='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x258a12[_0x30ad('0x28')][_0x30ad('0x6e')];return db[_0x30ad('0x6f')][_0x30ad('0x42')](_0x4ef436,{'type':db['Sequelize'][_0x30ad('0x70')][_0x30ad('0x71')],'raw':!![]})[_0x30ad('0x1f')](function(_0x5a4ab8){return _0x5a4ab8;});})['then'](function(_0x2d17a4){if(_0x2d17a4){_0x2f0a24[_0x30ad('0x28')]['contact']=_0x2d17a4[0x0];if(!_0x2529c0[_0x30ad('0x59')][_0x30ad('0x62')])return;return db[_0x30ad('0x72')][_0x30ad('0x5a')]({'where':{'id':_0x2529c0[_0x30ad('0x59')][_0x30ad('0x62')],'role':_0x30ad('0x64')},'attributes':['id',_0x30ad('0x3a'),_0x30ad('0x73'),'email',_0x30ad('0x74')],'raw':!![]});}return null;})[_0x30ad('0x1f')](function(_0x19a51e){if(!_0x19a51e)return null;_0x2f0a24[_0x30ad('0x28')]['agent']=_0x19a51e;return _0x2f0a24;})[_0x30ad('0x1f')](function(_0x3b3057){if(_0x3b3057){if(_0x2529c0['body'][_0x30ad('0x75')]){_0x2f0a24[_0x30ad('0x28')][_0x30ad('0x76')]=util[_0x30ad('0x60')](_0x30ad('0x77'),_0x2529c0[_0x30ad('0x63')][_0x30ad('0x3a')]);_0x2f0a24[_0x30ad('0x28')][_0x30ad('0x78')]=_0x2f0a24[_0x30ad('0x78')];_0x2f0a24['message'][_0x30ad('0x79')]=_0x2f0a24['channel'];_0x2f0a24[_0x30ad('0x28')][_0x30ad('0x7a')]=_0x30ad('0x7b');return respondWithRpcPromise(_0x30ad('0x7c'),_0x30ad('0x7c'),{'event':_0x30ad('0x7d'),'message':_0x2f0a24[_0x30ad('0x28')]},client9002)[_0x30ad('0x1f')](function(){return _0x2f0a24;});}return _0x2f0a24;}return null;})[_0x30ad('0x1f')](respondWithResult(_0x3d67cc,null))[_0x30ad('0x29')](handleError(_0x3d67cc,null));};var interaction_log=require(_0x30ad('0x12'))(_0x30ad('0x5c'));exports[_0x30ad('0x35')]=function(_0x54ee41,_0x4cdae7,_0x13c7eb){var _0x5be10b={'agent':{},'channel':_0x30ad('0x5d')};if(_0x54ee41[_0x30ad('0x59')]['id']){delete _0x54ee41[_0x30ad('0x59')]['id'];}_0x54ee41['body']['UserId']=_0x54ee41[_0x30ad('0x59')][_0x30ad('0x62')]||_0x54ee41[_0x30ad('0x63')]['id'];_0x5be10b[_0x30ad('0x64')]['id']=_0x54ee41[_0x30ad('0x59')]['UserId'];return db['WhatsappMessage'][_0x30ad('0x5a')]({'where':{'id':_0x54ee41[_0x30ad('0x56')]['id'],'UserId':null}})[_0x30ad('0x1f')](handleEntityNotFound(_0x4cdae7,null))[_0x30ad('0x1f')](function(_0x62ad4a){if(_0x62ad4a){_0x5be10b['message']=_0x62ad4a['get']({'plain':!![]});return db[_0x30ad('0x7e')]['find']({'where':{'id':_0x62ad4a[_0x30ad('0x7f')]}});}return null;})[_0x30ad('0x1f')](handleEntityNotFound(_0x4cdae7,null))[_0x30ad('0x1f')](function(_0x879295){if(_0x879295){_0x5be10b[_0x30ad('0x68')]=_0x879295[_0x30ad('0x65')]({'plain':!![]});interaction_log[_0x30ad('0x20')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x54ee41[_0x30ad('0x63')]['id'],_0x54ee41[_0x30ad('0x63')][_0x30ad('0x3a')],_0x54ee41['user'][_0x30ad('0x6a')],_0x5be10b[_0x30ad('0x68')]['id'],_0x54ee41[_0x30ad('0x59')]?JSON[_0x30ad('0x25')](_0x54ee41[_0x30ad('0x59')]):_0x30ad('0x6b'));return respondWithRpcPromise(_0x30ad('0x80'),'rejectMessage',_0x5be10b);}return null;})['then'](function(_0x43d4f3){var _0x544e6e=_0x30ad('0x81')+_0x43d4f3[_0x30ad('0x28')]['ContactId'];return db[_0x30ad('0x6f')]['query'](_0x544e6e,{'type':db[_0x30ad('0x82')][_0x30ad('0x70')]['SELECT'],'raw':!![]})[_0x30ad('0x1f')](function(_0xca1ff2){return _0xca1ff2;});})[_0x30ad('0x1f')](function(_0x454e6f){if(_0x454e6f){_0x5be10b[_0x30ad('0x28')]['contact']=_0x454e6f[0x0];if(!_0x54ee41['body'][_0x30ad('0x62')])return;return db[_0x30ad('0x72')][_0x30ad('0x5a')]({'where':{'id':_0x54ee41['body']['UserId'],'role':'agent'},'attributes':['id',_0x30ad('0x3a'),_0x30ad('0x73'),_0x30ad('0x83'),'internal'],'raw':!![]});}return null;})[_0x30ad('0x1f')](function(_0x304c9b){if(!_0x304c9b)return null;_0x5be10b[_0x30ad('0x28')][_0x30ad('0x64')]=_0x304c9b;return _0x5be10b;})[_0x30ad('0x1f')](function(_0x516584){if(_0x516584){_0x516584['message'][_0x30ad('0x76')]=util[_0x30ad('0x60')](_0x30ad('0x77'),_0x54ee41[_0x30ad('0x63')][_0x30ad('0x3a')]);_0x516584[_0x30ad('0x28')][_0x30ad('0x78')]=_0x5be10b[_0x30ad('0x78')];_0x516584[_0x30ad('0x28')][_0x30ad('0x79')]=_0x5be10b['channel'];_0x516584[_0x30ad('0x28')][_0x30ad('0x7a')]=_0x30ad('0x35');respondWithRpcPromise('EventManager',_0x30ad('0x7c'),{'event':'rejectmessage','message':_0x516584['message']},client9002);return _0x5be10b;}return null;})['then'](respondWithResult(_0x4cdae7,null))[_0x30ad('0x29')](handleError(_0x4cdae7,null));};exports['status']=function(_0x77478b,_0x35b161,_0x3ddbd6){if(_0x77478b['body']['id']){delete _0x77478b[_0x30ad('0x59')]['id'];}var _0x5f4676;return db[_0x30ad('0x51')]['find']({'where':{'id':_0x77478b[_0x30ad('0x56')]['id']}})[_0x30ad('0x1f')](handleEntityNotFound(_0x35b161,null))[_0x30ad('0x1f')](function(_0x5463bf){if(_0x5463bf){_0x5f4676=_0x5463bf;return db[_0x30ad('0x84')][_0x30ad('0x5a')]({'where':{'id':_0x5463bf[_0x30ad('0x85')]}});}})[_0x30ad('0x1f')](handleEntityNotFound(_0x35b161,null))['then'](function(_0x5ef3d0){if(_0x5ef3d0){logger[_0x30ad('0x23')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x30ad('0x2b'),'received\x20delivery\x20report\x20from',_0x5ef3d0[_0x30ad('0x3f')],util[_0x30ad('0x86')](_0x77478b[_0x30ad('0x59')],{'showHidden':![],'depth':null}));switch(_0x5ef3d0[_0x30ad('0x3f')]){case _0x30ad('0x87'):if(_0x77478b[_0x30ad('0x59')][_0x30ad('0x88')]&&_0x77478b['body'][_0x30ad('0x88')]===_0x5f4676['messageId']&&_0x77478b[_0x30ad('0x59')]['MessageStatus']&&_0x77478b[_0x30ad('0x59')][_0x30ad('0x89')]===_0x30ad('0x5e')){return _0x5f4676[_0x30ad('0x37')]({'read':!![]});}else{logger[_0x30ad('0x26')](_0x30ad('0x8a'),_0x30ad('0x2b'),_0x30ad('0x87'),util['inspect'](_0x77478b[_0x30ad('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x5f4676;}})['then'](respondWithResult(_0x35b161,null))[_0x30ad('0x29')](handleError(_0x35b161,null));}; \ No newline at end of file +var _0xa04a=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','name','send','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows','show','options','create','body','update','find','params','describe','whatsapp-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','QueryTypes','motionChannel','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x9c4b0e,_0x16e233){var _0x2743b8=function(_0x3c1ddc){while(--_0x3c1ddc){_0x9c4b0e['push'](_0x9c4b0e['shift']());}};_0x2743b8(++_0x16e233);}(_0xa04a,0x19c));var _0xaa04=function(_0x1b4587,_0x2add59){_0x1b4587=_0x1b4587-0x0;var _0x771ed4=_0xa04a[_0x1b4587];return _0x771ed4;};'use strict';var emlformat=require(_0xaa04('0x0'));var rimraf=require(_0xaa04('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa04('0x2'));var rp=require(_0xaa04('0x3'));var moment=require(_0xaa04('0x4'));var BPromise=require(_0xaa04('0x5'));var Mustache=require('mustache');var util=require(_0xaa04('0x6'));var path=require(_0xaa04('0x7'));var sox=require(_0xaa04('0x8'));var csv=require('to-csv');var ejs=require(_0xaa04('0x9'));var fs=require('fs');var fs_extra=require(_0xaa04('0xa'));var _=require(_0xaa04('0xb'));var squel=require(_0xaa04('0xc'));var crypto=require(_0xaa04('0xd'));var jsforce=require(_0xaa04('0xe'));var deskjs=require(_0xaa04('0xf'));var toCsv=require('to-csv');var querystring=require(_0xaa04('0x10'));var Papa=require('papaparse');var Redis=require(_0xaa04('0x11'));var authService=require(_0xaa04('0x12'));var qs=require(_0xaa04('0x13'));var as=require(_0xaa04('0x14'));var hardwareService=require(_0xaa04('0x15'));var logger=require(_0xaa04('0x16'))(_0xaa04('0x17'));var utils=require(_0xaa04('0x18'));var config=require(_0xaa04('0x19'));var licenseUtil=require(_0xaa04('0x1a'));var db=require('../../mysqldb')['db'];config[_0xaa04('0x1b')]=_[_0xaa04('0x1c')](config[_0xaa04('0x1b')],{'host':_0xaa04('0x1d'),'port':0x18eb});var socket=require(_0xaa04('0x1e'))(new Redis(config[_0xaa04('0x1b')]));require(_0xaa04('0x1f'))['register'](socket);var jayson=require(_0xaa04('0x20'));var client=jayson[_0xaa04('0x21')][_0xaa04('0x22')]({'port':0x232c});var client9002=jayson[_0xaa04('0x21')][_0xaa04('0x22')]({'port':0x232a});function respondWithRpcPromise(_0xfe32,_0x4dfd44,_0x107c33,_0x37f8e9){return new BPromise(function(_0xf6109a,_0x127807){var _0x1cd339=_0x37f8e9||client;return _0x1cd339[_0xaa04('0x23')](_0xfe32,_0x107c33)[_0xaa04('0x24')](function(_0x4087f3){logger[_0xaa04('0x25')](_0xaa04('0x26'),_0x4dfd44,'request\x20sent');logger[_0xaa04('0x27')](_0xaa04('0x28'),_0x4dfd44,'request\x20sent',JSON[_0xaa04('0x29')](_0x4087f3));if(_0x4087f3['error']){if(_0x4087f3[_0xaa04('0x2a')][_0xaa04('0x2b')]===0x1f4){logger[_0xaa04('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0x4dfd44,_0x4087f3[_0xaa04('0x2a')][_0xaa04('0x2c')]);return _0x127807(_0x4087f3[_0xaa04('0x2a')]['message']);}logger[_0xaa04('0x2a')](_0xaa04('0x26'),_0x4dfd44,_0x4087f3[_0xaa04('0x2a')][_0xaa04('0x2c')]);return _0xf6109a(_0x4087f3[_0xaa04('0x2a')][_0xaa04('0x2c')]);}else{logger[_0xaa04('0x25')](_0xaa04('0x26'),_0x4dfd44,'request\x20sent');_0xf6109a(_0x4087f3['result'][_0xaa04('0x2c')]);}})[_0xaa04('0x2d')](function(_0x5c7732){logger[_0xaa04('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0x4dfd44,_0x5c7732);_0x127807(_0x5c7732);});});}function respondWithStatusCode(_0x5d773d,_0xe085e7){_0xe085e7=_0xe085e7||0xcc;return function(_0x315001){if(_0x315001){return _0x5d773d[_0xaa04('0x2e')](_0xe085e7);}return _0x5d773d[_0xaa04('0x2f')](_0xe085e7)[_0xaa04('0x30')]();};}function respondWithResult(_0x25fc98,_0x3e295d){_0x3e295d=_0x3e295d||0xc8;return function(_0x5c44e7){if(_0x5c44e7){return _0x25fc98[_0xaa04('0x2f')](_0x3e295d)['json'](_0x5c44e7);}};}function respondWithFilteredResult(_0x2117cc,_0x232c38){return function(_0x47c96a){if(_0x47c96a){var _0x5a5725=typeof _0x232c38[_0xaa04('0x31')]===_0xaa04('0x32')&&typeof _0x232c38[_0xaa04('0x33')]===_0xaa04('0x32');var _0x11fbe7=_0x47c96a['count'];var _0x3f129d=_0x5a5725?0x0:_0x232c38[_0xaa04('0x31')];var _0xe0b51=_0x5a5725?_0x47c96a[_0xaa04('0x34')]:_0x232c38['offset']+_0x232c38[_0xaa04('0x33')];var _0x8df37f;if(_0xe0b51>=_0x11fbe7){_0xe0b51=_0x11fbe7;_0x8df37f=0xc8;}else{_0x8df37f=0xce;}_0x2117cc['status'](_0x8df37f);return _0x2117cc[_0xaa04('0x35')](_0xaa04('0x36'),_0x3f129d+'-'+_0xe0b51+'/'+_0x11fbe7)[_0xaa04('0x37')](_0x47c96a);}return null;};}function patchUpdates(_0x6aca8d){return function(_0x4e639b){try{jsonpatch[_0xaa04('0x38')](_0x4e639b,_0x6aca8d,!![]);}catch(_0x28db4d){return BPromise[_0xaa04('0x39')](_0x28db4d);}return _0x4e639b[_0xaa04('0x3a')]();};}function saveUpdates(_0x539c2c,_0x5508fe){return function(_0x185a07){if(_0x185a07){return _0x185a07['update'](_0x539c2c)['then'](function(_0x44ae51){return _0x44ae51;});}return null;};}function removeEntity(_0x39227e,_0x53db9c){return function(_0x19e777){if(_0x19e777){return _0x19e777[_0xaa04('0x3b')]()[_0xaa04('0x24')](function(){_0x39227e['status'](0xcc)[_0xaa04('0x30')]();});}};}function handleEntityNotFound(_0x4194f0,_0x187c89){return function(_0x309fce){if(!_0x309fce){_0x4194f0['sendStatus'](0x194);}return _0x309fce;};}function handleError(_0x195ada,_0x14b519){_0x14b519=_0x14b519||0x1f4;return function(_0x42c9b2){logger[_0xaa04('0x2a')](_0x42c9b2['stack']);if(_0x42c9b2['name']){delete _0x42c9b2[_0xaa04('0x3c')];}_0x195ada[_0xaa04('0x2f')](_0x14b519)[_0xaa04('0x3d')](_0x42c9b2);};}exports['index']=function(_0x4d129b,_0x4b63dc){var _0x310e03={},_0x2b0c5b={},_0x49e047={'count':0x0,'rows':[]};var _0x3af23f=_[_0xaa04('0x3e')](db[_0xaa04('0x3f')][_0xaa04('0x40')],function(_0x3d24a0){return{'name':_0x3d24a0[_0xaa04('0x41')],'type':_0x3d24a0[_0xaa04('0x42')][_0xaa04('0x43')]};});_0x2b0c5b[_0xaa04('0x44')]=_[_0xaa04('0x3e')](_0x3af23f,_0xaa04('0x3c'));_0x2b0c5b[_0xaa04('0x45')]=_[_0xaa04('0x46')](_0x4d129b['query']);_0x2b0c5b['filters']=_[_0xaa04('0x47')](_0x2b0c5b[_0xaa04('0x44')],_0x2b0c5b[_0xaa04('0x45')]);_0x310e03[_0xaa04('0x48')]=_['intersection'](_0x2b0c5b['model'],qs['fields'](_0x4d129b[_0xaa04('0x45')][_0xaa04('0x49')]));_0x310e03[_0xaa04('0x48')]=_0x310e03[_0xaa04('0x48')][_0xaa04('0x4a')]?_0x310e03[_0xaa04('0x48')]:_0x2b0c5b[_0xaa04('0x44')];if(!_0x4d129b['query'][_0xaa04('0x4b')]('nolimit')){_0x310e03[_0xaa04('0x33')]=qs[_0xaa04('0x33')](_0x4d129b[_0xaa04('0x45')][_0xaa04('0x33')]);_0x310e03[_0xaa04('0x31')]=qs['offset'](_0x4d129b['query'][_0xaa04('0x31')]);}_0x310e03['order']=qs[_0xaa04('0x4c')](_0x4d129b[_0xaa04('0x45')][_0xaa04('0x4c')]);_0x310e03[_0xaa04('0x4d')]=qs['filters'](_[_0xaa04('0x4e')](_0x4d129b['query'],_0x2b0c5b[_0xaa04('0x4f')]),_0x3af23f);if(_0x4d129b[_0xaa04('0x45')][_0xaa04('0x50')]){_0x310e03['where']=_[_0xaa04('0x51')](_0x310e03[_0xaa04('0x4d')],{'$or':_[_0xaa04('0x3e')](_0x3af23f,function(_0x3f969f){if(_0x3f969f['type']!=='VIRTUAL'){var _0x4ea763={};_0x4ea763[_0x3f969f['name']]={'$like':'%'+_0x4d129b['query'][_0xaa04('0x50')]+'%'};return _0x4ea763;}})});}_0x310e03=_[_0xaa04('0x51')]({},_0x310e03,_0x4d129b['options']);var _0x59779f={'where':_0x310e03[_0xaa04('0x4d')]};return db[_0xaa04('0x3f')]['count'](_0x59779f)[_0xaa04('0x24')](function(_0x3aa967){_0x49e047[_0xaa04('0x34')]=_0x3aa967;if(_0x4d129b['query'][_0xaa04('0x52')]){_0x310e03[_0xaa04('0x53')]=[{'all':!![]}];}return db[_0xaa04('0x3f')][_0xaa04('0x54')](_0x310e03);})['then'](function(_0x55df23){_0x49e047[_0xaa04('0x55')]=_0x55df23;return _0x49e047;})[_0xaa04('0x24')](respondWithFilteredResult(_0x4b63dc,_0x310e03))[_0xaa04('0x2d')](handleError(_0x4b63dc,null));};exports[_0xaa04('0x56')]=function(_0x5a549a,_0x1ab456){var _0x389dd8={'raw':!![],'where':{'id':_0x5a549a['params']['id']}},_0x1d5b3a={};_0x1d5b3a[_0xaa04('0x44')]=_['keys'](db['WhatsappMessage'][_0xaa04('0x40')]);_0x1d5b3a[_0xaa04('0x45')]=_[_0xaa04('0x46')](_0x5a549a[_0xaa04('0x45')]);_0x1d5b3a[_0xaa04('0x4f')]=_[_0xaa04('0x47')](_0x1d5b3a[_0xaa04('0x44')],_0x1d5b3a[_0xaa04('0x45')]);_0x389dd8[_0xaa04('0x48')]=_[_0xaa04('0x47')](_0x1d5b3a[_0xaa04('0x44')],qs['fields'](_0x5a549a[_0xaa04('0x45')][_0xaa04('0x49')]));_0x389dd8['attributes']=_0x389dd8[_0xaa04('0x48')][_0xaa04('0x4a')]?_0x389dd8['attributes']:_0x1d5b3a[_0xaa04('0x44')];if(_0x5a549a[_0xaa04('0x45')][_0xaa04('0x52')]){_0x389dd8[_0xaa04('0x53')]=[{'all':!![]}];}_0x389dd8=_[_0xaa04('0x51')]({},_0x389dd8,_0x5a549a[_0xaa04('0x57')]);return db['WhatsappMessage']['find'](_0x389dd8)[_0xaa04('0x24')](handleEntityNotFound(_0x1ab456,null))['then'](respondWithResult(_0x1ab456,null))[_0xaa04('0x2d')](handleError(_0x1ab456,null));};exports['create']=function(_0xe4e4fd,_0x4988e2){return db['WhatsappMessage'][_0xaa04('0x58')](_0xe4e4fd[_0xaa04('0x59')],{})['then'](respondWithResult(_0x4988e2,0xc9))[_0xaa04('0x2d')](handleError(_0x4988e2,null));};exports[_0xaa04('0x5a')]=function(_0x13d910,_0x22fc17){if(_0x13d910[_0xaa04('0x59')]['id']){delete _0x13d910['body']['id'];}return db[_0xaa04('0x3f')][_0xaa04('0x5b')]({'where':{'id':_0x13d910[_0xaa04('0x5c')]['id']}})[_0xaa04('0x24')](handleEntityNotFound(_0x22fc17,null))[_0xaa04('0x24')](saveUpdates(_0x13d910[_0xaa04('0x59')],null))[_0xaa04('0x24')](respondWithResult(_0x22fc17,null))[_0xaa04('0x2d')](handleError(_0x22fc17,null));};exports[_0xaa04('0x3b')]=function(_0x54fb92,_0x1b2206){return db[_0xaa04('0x3f')]['find']({'where':{'id':_0x54fb92['params']['id']}})[_0xaa04('0x24')](handleEntityNotFound(_0x1b2206,null))[_0xaa04('0x24')](removeEntity(_0x1b2206,null))[_0xaa04('0x2d')](handleError(_0x1b2206,null));};exports['describe']=function(_0x27991f,_0x48a745){return db['WhatsappMessage'][_0xaa04('0x5d')]()[_0xaa04('0x24')](respondWithResult(_0x48a745,null))[_0xaa04('0x2d')](handleError(_0x48a745,null));};var interaction_log=require(_0xaa04('0x16'))(_0xaa04('0x5e'));exports[_0xaa04('0x5f')]=function(_0x441376,_0x3e3036,_0x5e0c1d){var _0x1c5161={'agent':{},'channel':'whatsapp'};if(_0x441376['body']['id']){delete _0x441376[_0xaa04('0x59')]['id'];}_0x441376[_0xaa04('0x59')][_0xaa04('0x60')]=!![];_0x441376['body'][_0xaa04('0x61')]=moment()['format'](_0xaa04('0x62'));_0x441376[_0xaa04('0x59')][_0xaa04('0x63')]=_0x441376[_0xaa04('0x59')][_0xaa04('0x63')]||_0x441376[_0xaa04('0x64')]['id'];_0x1c5161[_0xaa04('0x65')]['id']=_0x441376[_0xaa04('0x59')]['UserId'];return db[_0xaa04('0x3f')][_0xaa04('0x5b')]({'where':{'id':_0x441376[_0xaa04('0x5c')]['id'],'UserId':null}})[_0xaa04('0x24')](handleEntityNotFound(_0x3e3036,null))['then'](saveUpdates(_0x441376['body'],null))[_0xaa04('0x24')](function(_0x258b04){if(_0x258b04){_0x1c5161[_0xaa04('0x2c')]=_0x258b04[_0xaa04('0x66')]({'plain':!![]});return db[_0xaa04('0x67')]['find']({'where':{'id':_0x258b04[_0xaa04('0x68')]}});}return null;})[_0xaa04('0x24')](handleEntityNotFound(_0x3e3036,null))[_0xaa04('0x24')](function(_0x13e71f){if(_0x13e71f){return _0x13e71f[_0xaa04('0x5a')]({'UserId':_0x441376[_0xaa04('0x59')][_0xaa04('0x63')],'read1stAt':_[_0xaa04('0x69')](_0x13e71f[_0xaa04('0x6a')])?moment()[_0xaa04('0x6b')](_0xaa04('0x62')):undefined});}return null;})[_0xaa04('0x24')](function(_0x17fe0f){if(_0x17fe0f){_0x1c5161['interaction']=_0x17fe0f[_0xaa04('0x66')]({'plain':!![]});interaction_log['info'](_0xaa04('0x6c'),_0x441376['user']['id'],_0x441376[_0xaa04('0x64')][_0xaa04('0x3c')],_0x441376['user'][_0xaa04('0x6d')],_0x1c5161[_0xaa04('0x6e')]['id'],_0x441376['body']?JSON[_0xaa04('0x29')](_0x441376[_0xaa04('0x59')]):'null');return respondWithRpcPromise(_0xaa04('0x6f'),'acceptMessage',_0x1c5161);}return null;})[_0xaa04('0x24')](function(_0x4c91bf){var _0x1b08c1=_0xaa04('0x70')+_0x4c91bf[_0xaa04('0x2c')][_0xaa04('0x71')];return db['sequelize'][_0xaa04('0x45')](_0x1b08c1,{'type':db[_0xaa04('0x72')]['QueryTypes'][_0xaa04('0x73')],'raw':!![]})[_0xaa04('0x24')](function(_0x94f33){return _0x94f33;});})['then'](function(_0x2cd4ae){if(_0x2cd4ae){_0x1c5161[_0xaa04('0x2c')][_0xaa04('0x74')]=_0x2cd4ae[0x0];if(!_0x441376[_0xaa04('0x59')][_0xaa04('0x63')])return;return db[_0xaa04('0x75')][_0xaa04('0x5b')]({'where':{'id':_0x441376[_0xaa04('0x59')][_0xaa04('0x63')],'role':_0xaa04('0x65')},'attributes':['id','name',_0xaa04('0x76'),_0xaa04('0x77'),_0xaa04('0x78')],'raw':!![]});}return null;})[_0xaa04('0x24')](function(_0x423460){if(!_0x423460)return null;_0x1c5161['message'][_0xaa04('0x65')]=_0x423460;return _0x1c5161;})[_0xaa04('0x24')](function(_0x103058){if(_0x103058){if(_0x441376[_0xaa04('0x59')]['manual']){_0x1c5161[_0xaa04('0x2c')][_0xaa04('0x79')]=util['format'](_0xaa04('0x7a'),_0x441376[_0xaa04('0x64')]['name']);_0x1c5161[_0xaa04('0x2c')][_0xaa04('0x7b')]=_0x1c5161[_0xaa04('0x7b')];_0x1c5161['message']['motionChannel']=_0x1c5161[_0xaa04('0x7b')];_0x1c5161[_0xaa04('0x2c')][_0xaa04('0x7c')]=_0xaa04('0x5f');return respondWithRpcPromise(_0xaa04('0x7d'),_0xaa04('0x7d'),{'event':_0xaa04('0x7e'),'message':_0x1c5161['message']},client9002)[_0xaa04('0x24')](function(){return _0x1c5161;});}return _0x1c5161;}return null;})[_0xaa04('0x24')](respondWithResult(_0x3e3036,null))[_0xaa04('0x2d')](handleError(_0x3e3036,null));};var interaction_log=require('../../config/logger')(_0xaa04('0x5e'));exports[_0xaa04('0x39')]=function(_0xac4819,_0x1bedad,_0x5416c7){var _0x378f14={'agent':{},'channel':_0xaa04('0x7f')};if(_0xac4819[_0xaa04('0x59')]['id']){delete _0xac4819[_0xaa04('0x59')]['id'];}_0xac4819[_0xaa04('0x59')][_0xaa04('0x63')]=_0xac4819[_0xaa04('0x59')]['UserId']||_0xac4819[_0xaa04('0x64')]['id'];_0x378f14['agent']['id']=_0xac4819['body'][_0xaa04('0x63')];return db[_0xaa04('0x3f')][_0xaa04('0x5b')]({'where':{'id':_0xac4819[_0xaa04('0x5c')]['id'],'UserId':null}})[_0xaa04('0x24')](handleEntityNotFound(_0x1bedad,null))[_0xaa04('0x24')](function(_0x4573fc){if(_0x4573fc){_0x378f14[_0xaa04('0x2c')]=_0x4573fc[_0xaa04('0x66')]({'plain':!![]});return db[_0xaa04('0x67')]['find']({'where':{'id':_0x4573fc['WhatsappInteractionId']}});}return null;})[_0xaa04('0x24')](handleEntityNotFound(_0x1bedad,null))[_0xaa04('0x24')](function(_0x450b87){if(_0x450b87){_0x378f14[_0xaa04('0x6e')]=_0x450b87['get']({'plain':!![]});interaction_log[_0xaa04('0x25')](_0xaa04('0x80'),_0xac4819['user']['id'],_0xac4819[_0xaa04('0x64')][_0xaa04('0x3c')],_0xac4819[_0xaa04('0x64')]['role'],_0x378f14[_0xaa04('0x6e')]['id'],_0xac4819[_0xaa04('0x59')]?JSON[_0xaa04('0x29')](_0xac4819[_0xaa04('0x59')]):_0xaa04('0x81'));return respondWithRpcPromise(_0xaa04('0x82'),_0xaa04('0x83'),_0x378f14);}return null;})['then'](function(_0x527fb5){var _0x552d7a=_0xaa04('0x70')+_0x527fb5[_0xaa04('0x2c')]['ContactId'];return db[_0xaa04('0x84')]['query'](_0x552d7a,{'type':db[_0xaa04('0x72')][_0xaa04('0x85')]['SELECT'],'raw':!![]})[_0xaa04('0x24')](function(_0x2303bd){return _0x2303bd;});})['then'](function(_0x421edb){if(_0x421edb){_0x378f14[_0xaa04('0x2c')]['contact']=_0x421edb[0x0];if(!_0xac4819[_0xaa04('0x59')][_0xaa04('0x63')])return;return db[_0xaa04('0x75')][_0xaa04('0x5b')]({'where':{'id':_0xac4819[_0xaa04('0x59')][_0xaa04('0x63')],'role':'agent'},'attributes':['id','name',_0xaa04('0x76'),_0xaa04('0x77'),_0xaa04('0x78')],'raw':!![]});}return null;})[_0xaa04('0x24')](function(_0x3cebfa){if(!_0x3cebfa)return null;_0x378f14[_0xaa04('0x2c')][_0xaa04('0x65')]=_0x3cebfa;return _0x378f14;})[_0xaa04('0x24')](function(_0x604ad7){if(_0x604ad7){_0x604ad7['message'][_0xaa04('0x79')]=util[_0xaa04('0x6b')](_0xaa04('0x7a'),_0xac4819[_0xaa04('0x64')]['name']);_0x604ad7[_0xaa04('0x2c')][_0xaa04('0x7b')]=_0x378f14[_0xaa04('0x7b')];_0x604ad7[_0xaa04('0x2c')][_0xaa04('0x86')]=_0x378f14['channel'];_0x604ad7['message'][_0xaa04('0x7c')]=_0xaa04('0x39');respondWithRpcPromise(_0xaa04('0x7d'),_0xaa04('0x7d'),{'event':_0xaa04('0x87'),'message':_0x604ad7[_0xaa04('0x2c')]},client9002);return _0x378f14;}return null;})['then'](respondWithResult(_0x1bedad,null))['catch'](handleError(_0x1bedad,null));};exports[_0xaa04('0x2f')]=function(_0x513feb,_0x597ffe,_0x3055d2){if(_0x513feb[_0xaa04('0x59')]['id']){delete _0x513feb[_0xaa04('0x59')]['id'];}var _0x515775;return db[_0xaa04('0x3f')][_0xaa04('0x5b')]({'where':{'id':_0x513feb[_0xaa04('0x5c')]['id']}})[_0xaa04('0x24')](handleEntityNotFound(_0x597ffe,null))['then'](function(_0x96c407){if(_0x96c407){_0x515775=_0x96c407;return db['WhatsappAccount'][_0xaa04('0x5b')]({'where':{'id':_0x96c407[_0xaa04('0x88')]}});}})['then'](handleEntityNotFound(_0x597ffe,null))[_0xaa04('0x24')](function(_0x5d24b4){if(_0x5d24b4){logger[_0xaa04('0x27')](_0xaa04('0x89'),_0xaa04('0x2f'),_0xaa04('0x8a'),_0x5d24b4[_0xaa04('0x42')],util[_0xaa04('0x8b')](_0x513feb['body'],{'showHidden':![],'depth':null}));switch(_0x5d24b4[_0xaa04('0x42')]){case _0xaa04('0x8c'):if(_0x513feb[_0xaa04('0x59')][_0xaa04('0x8d')]&&_0x513feb[_0xaa04('0x59')][_0xaa04('0x8d')]===_0x515775['messageId']&&_0x513feb['body'][_0xaa04('0x8e')]&&_0x513feb['body'][_0xaa04('0x8e')]==='read'){return _0x515775['update']({'read':!![]});}else{logger[_0xaa04('0x2a')](_0xaa04('0x8f'),_0xaa04('0x2f'),_0xaa04('0x8c'),util[_0xaa04('0x8b')](_0x513feb[_0xaa04('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x515775;}})[_0xaa04('0x24')](respondWithResult(_0x597ffe,null))['catch'](handleError(_0x597ffe,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index c9218ff..9647744 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 _0x2547=['hasOwnProperty','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','emit'];(function(_0x50abc4,_0x558d64){var _0x5a745d=function(_0x4e835b){while(--_0x4e835b){_0x50abc4['push'](_0x50abc4['shift']());}};_0x5a745d(++_0x558d64);}(_0x2547,0x1cd));var _0x7254=function(_0x117c0f,_0x37948f){_0x117c0f=_0x117c0f-0x0;var _0x25ee86=_0x2547[_0x117c0f];return _0x25ee86;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x7254('0x0'))['db'][_0x7254('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x7254('0x2')](0x0);var events={'afterCreate':_0x7254('0x3'),'afterUpdate':_0x7254('0x4'),'afterDestroy':_0x7254('0x5')};function emitEvent(_0x9f3435){return function(_0x265ebf,_0x53a02f,_0x2ddeae){WhatsappMessageEvents[_0x7254('0x6')](_0x9f3435+':'+_0x265ebf['id'],_0x265ebf);WhatsappMessageEvents[_0x7254('0x6')](_0x9f3435,_0x265ebf);_0x2ddeae(null);};}for(var e in events){if(events[_0x7254('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x7254('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0x80ed=['remove','emit','hasOwnProperty','exports','events','WhatsappMessage','setMaxListeners','save'];(function(_0x4b8e8a,_0xcbb7a){var _0x547ceb=function(_0x1416ec){while(--_0x1416ec){_0x4b8e8a['push'](_0x4b8e8a['shift']());}};_0x547ceb(++_0xcbb7a);}(_0x80ed,0x11c));var _0xd80e=function(_0x4fe505,_0x2e3c7b){_0x4fe505=_0x4fe505-0x0;var _0x287421=_0x80ed[_0x4fe505];return _0x287421;};'use strict';var EventEmitter=require(_0xd80e('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xd80e('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xd80e('0x2')](0x0);var events={'afterCreate':_0xd80e('0x3'),'afterUpdate':'update','afterDestroy':_0xd80e('0x4')};function emitEvent(_0x46876f){return function(_0x2b742b,_0x3413d4,_0x5ae6c6){WhatsappMessageEvents[_0xd80e('0x5')](_0x46876f+':'+_0x2b742b['id'],_0x2b742b);WhatsappMessageEvents[_0xd80e('0x5')](_0x46876f,_0x2b742b);_0x5ae6c6(null);};}for(var e in events){if(events[_0xd80e('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xd80e('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index e9d8cd4..f7bc4d3 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 _0xac0f=['sinch','/whatsapp/v1/','/messages/','POST','application/json','message_id','statuses','finally','utf8mb4','lodash','../../config/logger','api','bluebird','node-fetch','path','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','messageId','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','then','update','catch','error','WhatsappAccountId','type','twilio','accountSid','authToken','messages','create','body','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','sid','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken'];(function(_0x44f939,_0x3f1b5c){var _0x5eb8ab=function(_0x49fa97){while(--_0x49fa97){_0x44f939['push'](_0x44f939['shift']());}};_0x5eb8ab(++_0x3f1b5c);}(_0xac0f,0x147));var _0xfac0=function(_0x2fff83,_0x29d5fe){_0x2fff83=_0x2fff83-0x0;var _0xa2a722=_0xac0f[_0x2fff83];return _0xa2a722;};'use strict';var _=require(_0xfac0('0x0'));var util=require('util');var logger=require(_0xfac0('0x1'))(_0xfac0('0x2'));var moment=require('moment');var BPromise=require(_0xfac0('0x3'));var rp=require('request-promise');var fetch=require(_0xfac0('0x4'));var fs=require('fs');var path=require(_0xfac0('0x5'));var rimraf=require('rimraf');var config=require(_0xfac0('0x6'));var attributes=require(_0xfac0('0x7'));module[_0xfac0('0x8')]=function(_0x524d95,_0x2eb625){return _0x524d95['define'](_0xfac0('0x9'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xfac0('0xa'),'fields':[_0xfac0('0xa')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0xfac0('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b1660,_0x1f6a10,_0x8ae761){var _0x3e1b47=_0x524d95[_0xfac0('0xc')];var _0x353109=_0x4b1660[_0xfac0('0xd')]({'plain':!![]});if(_0x353109[_0xfac0('0xe')]['toLowerCase']()==='in'||_0x353109[_0xfac0('0xe')][_0xfac0('0xf')]()===_0xfac0('0x10')&&!_0x353109[_0xfac0('0x11')]&&!_[_0xfac0('0x12')](_0x353109[_0xfac0('0x13')])){_0x3e1b47[_0xfac0('0x14')][_0xfac0('0x15')]({'where':{'id':_0x353109['WhatsappInteractionId']}})[_0xfac0('0x16')](function(_0x54a82f){if(_0x54a82f){_0x54a82f[_0xfac0('0x17')]({'lastMsgAt':_0x353109['createdAt'],'lastMsgDirection':_0x353109['direction'][_0xfac0('0xf')]()});}})[_0xfac0('0x18')](function(_0x52b259){console[_0xfac0('0x19')](_0x52b259);});}if(_0x353109['direction']===_0xfac0('0x10')&&!_0x353109[_0xfac0('0x11')]){var _0x209e45;_0x3e1b47['WhatsappAccount']['find']({'where':{'id':_0x353109[_0xfac0('0x1a')]},'raw':!![]})[_0xfac0('0x16')](function(_0x20f7e6){_0x209e45=_0x20f7e6;if(_0x209e45&&_0x209e45['type']){switch(_0x209e45[_0xfac0('0x1b')]){case _0xfac0('0x1c'):var _0xd05743=require('twilio');if(_0x209e45[_0xfac0('0x1d')]&&_0x209e45['authToken']&&_0x209e45['phone']){var _0x9695f4=new _0xd05743(_0x209e45[_0xfac0('0x1d')],_0x209e45[_0xfac0('0x1e')]);_0x9695f4[_0xfac0('0x1f')][_0xfac0('0x20')]({'body':_0x353109[_0xfac0('0x21')],'to':_0xfac0('0x22')+_0x353109[_0xfac0('0x23')],'from':_0xfac0('0x22')+_0x209e45[_0xfac0('0x23')],'statusCallback':_0x209e45[_0xfac0('0x24')]+_0xfac0('0x25')+_0x353109['id']+_0xfac0('0x26')+_0x209e45['token']})[_0xfac0('0x16')](function(_0x3c1ba8){if(_0x3c1ba8[_0xfac0('0x27')]){return _0x4b1660[_0xfac0('0x17')]({'messageId':_0x3c1ba8['sid']});}})[_0xfac0('0x18')](function(_0x1c62e8){logger[_0xfac0('0x19')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xfac0('0x28'),'twilio',util[_0xfac0('0x29')](_0x1c62e8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfac0('0x2a'),_0xfac0('0x28'),_0xfac0('0x1c'),_0xfac0('0x2b'));}break;case _0xfac0('0x2c'):var _0x413fd9=_0x209e45[_0xfac0('0x1d')];var _0x2c2d02=_0x209e45[_0xfac0('0x1e')];var _0x3ff959=_0x209e45['baseUrl']+_0xfac0('0x2d')+_0x413fd9+_0xfac0('0x2e');var _0x137ca9={'to':[_0x353109[_0xfac0('0x23')]],'message':{'type':'text','text':_0x353109['body']}};var _0x4ca5a2={'method':_0xfac0('0x2f'),'uri':_0x3ff959,'headers':{'Authorization':'Bearer\x20'+_0x2c2d02,'Content-Type':_0xfac0('0x30')},'body':_0x137ca9,'json':!![]};rp(_0x4ca5a2)[_0xfac0('0x16')](function(_0x5dddc6){if(_0x5dddc6['statuses'][0x0][_0xfac0('0x31')]){return _0x4b1660[_0xfac0('0x17')]({'messageId':_0x5dddc6[_0xfac0('0x32')][0x0][_0xfac0('0x31')]});}})[_0xfac0('0x18')](function(_0xe44a94){logger['err']('WhatsappMessage,\x20%s',_0xe44a94);});break;}}})[_0xfac0('0x33')](function(){_0x8ae761();});}else{_0x8ae761();}}},'charset':_0xfac0('0x34'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1340=['api','moment','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','isNil','UserId','WhatsappInteraction','then','update','createdAt','catch','error','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','baseUrl','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','util','../../config/logger'];(function(_0x1ed7a5,_0x48a26a){var _0x2a6d0e=function(_0xe2aa6b){while(--_0xe2aa6b){_0x1ed7a5['push'](_0x1ed7a5['shift']());}};_0x2a6d0e(++_0x48a26a);}(_0x1340,0x74));var _0x0134=function(_0x2dd163,_0x314ac1){_0x2dd163=_0x2dd163-0x0;var _0x225b2f=_0x1340[_0x2dd163];return _0x225b2f;};'use strict';var _=require('lodash');var util=require(_0x0134('0x0'));var logger=require(_0x0134('0x1'))(_0x0134('0x2'));var moment=require(_0x0134('0x3'));var BPromise=require('bluebird');var rp=require(_0x0134('0x4'));var fetch=require(_0x0134('0x5'));var fs=require('fs');var path=require(_0x0134('0x6'));var rimraf=require(_0x0134('0x7'));var config=require(_0x0134('0x8'));var attributes=require(_0x0134('0x9'));module[_0x0134('0xa')]=function(_0x1686a8,_0x4a250a){return _0x1686a8[_0x0134('0xb')](_0x0134('0xc'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x0134('0xd'),'fields':['messageId']},{'name':_0x0134('0xe'),'fields':[_0x0134('0xf')],'type':_0x0134('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x310f84,_0x346d9f,_0x52495b){var _0x4b07d1=_0x1686a8[_0x0134('0x11')];var _0x36ed3a=_0x310f84[_0x0134('0x12')]({'plain':!![]});if(_0x36ed3a[_0x0134('0x13')][_0x0134('0x14')]()==='in'||_0x36ed3a['direction'][_0x0134('0x14')]()==='out'&&!_0x36ed3a['secret']&&!_[_0x0134('0x15')](_0x36ed3a[_0x0134('0x16')])){_0x4b07d1[_0x0134('0x17')]['findOne']({'where':{'id':_0x36ed3a['WhatsappInteractionId']}})[_0x0134('0x18')](function(_0x37c401){if(_0x37c401){_0x37c401[_0x0134('0x19')]({'lastMsgAt':_0x36ed3a[_0x0134('0x1a')],'lastMsgDirection':_0x36ed3a['direction'][_0x0134('0x14')]()});}})[_0x0134('0x1b')](function(_0x518603){console[_0x0134('0x1c')](_0x518603);});}if(_0x36ed3a[_0x0134('0x13')]==='out'&&!_0x36ed3a[_0x0134('0x1d')]){var _0x3037e3;_0x4b07d1[_0x0134('0x1e')][_0x0134('0x1f')]({'where':{'id':_0x36ed3a[_0x0134('0x20')]},'raw':!![]})[_0x0134('0x18')](function(_0x1f2c2d){_0x3037e3=_0x1f2c2d;if(_0x3037e3&&_0x3037e3[_0x0134('0x21')]){switch(_0x3037e3[_0x0134('0x21')]){case _0x0134('0x22'):var _0xde68ba=require(_0x0134('0x22'));if(_0x3037e3[_0x0134('0x23')]&&_0x3037e3[_0x0134('0x24')]&&_0x3037e3[_0x0134('0x25')]){var _0x54e1d4=new _0xde68ba(_0x3037e3[_0x0134('0x23')],_0x3037e3[_0x0134('0x24')]);_0x54e1d4[_0x0134('0x26')][_0x0134('0x27')]({'body':_0x36ed3a[_0x0134('0xf')],'to':_0x0134('0x28')+_0x36ed3a[_0x0134('0x25')],'from':'whatsapp:'+_0x3037e3['phone'],'statusCallback':_0x3037e3[_0x0134('0x29')]+_0x0134('0x2a')+_0x36ed3a['id']+_0x0134('0x2b')+_0x3037e3[_0x0134('0x2c')]})[_0x0134('0x18')](function(_0x3ca411){if(_0x3ca411[_0x0134('0x2d')]){return _0x310f84[_0x0134('0x19')]({'messageId':_0x3ca411['sid']});}})[_0x0134('0x1b')](function(_0x1621e4){logger['error'](_0x0134('0x2e'),_0x0134('0x2f'),_0x0134('0x22'),util[_0x0134('0x30')](_0x1621e4,{'showHidden':![],'depth':null}));});}else{logger[_0x0134('0x1c')](_0x0134('0x2e'),'afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'sinch':var _0x315be1=_0x3037e3[_0x0134('0x23')];var _0x1e4677=_0x3037e3[_0x0134('0x24')];var _0x183180=_0x3037e3[_0x0134('0x31')]+'/whatsapp/v1/'+_0x315be1+'/messages/';var _0x42fcfd={'to':[_0x36ed3a[_0x0134('0x25')]],'message':{'type':'text','text':_0x36ed3a[_0x0134('0xf')]}};var _0x5f4238={'method':_0x0134('0x32'),'uri':_0x183180,'headers':{'Authorization':_0x0134('0x33')+_0x1e4677,'Content-Type':_0x0134('0x34')},'body':_0x42fcfd,'json':!![]};rp(_0x5f4238)[_0x0134('0x18')](function(_0x4ccd1c){if(_0x4ccd1c[_0x0134('0x35')][0x0][_0x0134('0x36')]){return _0x310f84[_0x0134('0x19')]({'messageId':_0x4ccd1c[_0x0134('0x35')][0x0][_0x0134('0x36')]});}})['catch'](function(_0x581ed8){logger[_0x0134('0x37')](_0x0134('0x38'),_0x581ed8);});break;}}})[_0x0134('0x39')](function(){_0x52495b();});}else{_0x52495b();}}},'charset':_0x0134('0x3a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index c51b939..2c3a7da 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 _0x56a6=['request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','body','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x56a6,0x137));var _0x656a=function(_0x38fb3a,_0x3a7c6b){_0x38fb3a=_0x38fb3a-0x0;var _0x2f5ef0=_0x56a6[_0x38fb3a];return _0x2f5ef0;};'use strict';var _=require(_0x656a('0x0'));var util=require(_0x656a('0x1'));var moment=require(_0x656a('0x2'));var BPromise=require('bluebird');var rs=require(_0x656a('0x3'));var fs=require('fs');var Redis=require(_0x656a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x656a('0x5'));var logger=require('../../config/logger')(_0x656a('0x6'));var config=require(_0x656a('0x7'));var jayson=require(_0x656a('0x8'));var client=jayson['client'][_0x656a('0x9')]({'port':0x232a});config[_0x656a('0xa')]=_[_0x656a('0xb')](config[_0x656a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x656a('0xc'))(new Redis(config[_0x656a('0xa')]));require(_0x656a('0xd'))[_0x656a('0xe')](socket);function respondWithRpcPromise(_0x13175b,_0x5bd152,_0x169a26){return new BPromise(function(_0x19b912,_0x51a195){return client[_0x656a('0xf')](_0x13175b,_0x169a26)[_0x656a('0x10')](function(_0x8a9fce){logger[_0x656a('0x11')](_0x656a('0x12'),_0x5bd152,_0x656a('0x13'));logger[_0x656a('0x14')](_0x656a('0x15'),_0x5bd152,_0x656a('0x13'),JSON[_0x656a('0x16')](_0x8a9fce));if(_0x8a9fce[_0x656a('0x17')]){if(_0x8a9fce[_0x656a('0x17')]['code']===0x1f4){logger['error'](_0x656a('0x12'),_0x5bd152,_0x8a9fce['error'][_0x656a('0x18')]);return _0x51a195(_0x8a9fce[_0x656a('0x17')][_0x656a('0x18')]);}logger[_0x656a('0x17')](_0x656a('0x12'),_0x5bd152,_0x8a9fce[_0x656a('0x17')][_0x656a('0x18')]);return _0x19b912(_0x8a9fce[_0x656a('0x17')][_0x656a('0x18')]);}else{logger[_0x656a('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x5bd152,_0x656a('0x13'));_0x19b912(_0x8a9fce[_0x656a('0x19')][_0x656a('0x18')]);}})[_0x656a('0x1a')](function(_0x10d062){logger[_0x656a('0x17')](_0x656a('0x12'),_0x5bd152,_0x10d062);_0x51a195(_0x10d062);});});}exports[_0x656a('0x1b')]=function(_0x3a3d8c){var _0x36b9e7=this;return new Promise(function(_0x4b9e85,_0x524bc0){return db[_0x656a('0x1c')]['create'](_0x3a3d8c[_0x656a('0x1d')],{'raw':_0x3a3d8c['options']?_0x3a3d8c['options']['raw']===undefined?!![]:![]:!![]})[_0x656a('0x10')](function(_0xc9d577){logger['info']('CreateWhatsappMessage',_0x3a3d8c);logger[_0x656a('0x14')](_0x656a('0x1b'),_0x3a3d8c,JSON[_0x656a('0x16')](_0xc9d577));_0x4b9e85(_0xc9d577);})['catch'](function(_0x14ce83){logger[_0x656a('0x17')](_0x656a('0x1b'),_0x14ce83[_0x656a('0x18')],_0x3a3d8c);_0x524bc0(_0x36b9e7[_0x656a('0x17')](0x1f4,_0x14ce83[_0x656a('0x18')]));});});}; \ No newline at end of file +var _0xccaf=['defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x32cefe,_0x1befba){var _0x283e79=function(_0x1609f1){while(--_0x1609f1){_0x32cefe['push'](_0x32cefe['shift']());}};_0x283e79(++_0x1befba);}(_0xccaf,0xf6));var _0xfcca=function(_0x173dd9,_0x4ecf44){_0x173dd9=_0x173dd9-0x0;var _0x5a0d5a=_0xccaf[_0x173dd9];return _0x5a0d5a;};'use strict';var _=require(_0xfcca('0x0'));var util=require(_0xfcca('0x1'));var moment=require(_0xfcca('0x2'));var BPromise=require(_0xfcca('0x3'));var rs=require(_0xfcca('0x4'));var fs=require('fs');var Redis=require(_0xfcca('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfcca('0x6'));var logger=require('../../config/logger')(_0xfcca('0x7'));var config=require(_0xfcca('0x8'));var jayson=require(_0xfcca('0x9'));var client=jayson[_0xfcca('0xa')][_0xfcca('0xb')]({'port':0x232a});config[_0xfcca('0xc')]=_[_0xfcca('0xd')](config[_0xfcca('0xc')],{'host':_0xfcca('0xe'),'port':0x18eb});var socket=require(_0xfcca('0xf'))(new Redis(config[_0xfcca('0xc')]));require(_0xfcca('0x10'))[_0xfcca('0x11')](socket);function respondWithRpcPromise(_0x537194,_0x3614c8,_0x591d18){return new BPromise(function(_0x4a4743,_0x1d9fe1){return client[_0xfcca('0x12')](_0x537194,_0x591d18)[_0xfcca('0x13')](function(_0x505593){logger[_0xfcca('0x14')](_0xfcca('0x15'),_0x3614c8,_0xfcca('0x16'));logger[_0xfcca('0x17')](_0xfcca('0x18'),_0x3614c8,_0xfcca('0x16'),JSON[_0xfcca('0x19')](_0x505593));if(_0x505593[_0xfcca('0x1a')]){if(_0x505593[_0xfcca('0x1a')][_0xfcca('0x1b')]===0x1f4){logger[_0xfcca('0x1a')](_0xfcca('0x15'),_0x3614c8,_0x505593['error'][_0xfcca('0x1c')]);return _0x1d9fe1(_0x505593['error'][_0xfcca('0x1c')]);}logger[_0xfcca('0x1a')](_0xfcca('0x15'),_0x3614c8,_0x505593[_0xfcca('0x1a')]['message']);return _0x4a4743(_0x505593['error'][_0xfcca('0x1c')]);}else{logger[_0xfcca('0x14')](_0xfcca('0x15'),_0x3614c8,_0xfcca('0x16'));_0x4a4743(_0x505593[_0xfcca('0x1d')][_0xfcca('0x1c')]);}})[_0xfcca('0x1e')](function(_0x1e7293){logger['error'](_0xfcca('0x15'),_0x3614c8,_0x1e7293);_0x1d9fe1(_0x1e7293);});});}exports[_0xfcca('0x1f')]=function(_0x11ea82){var _0x364bdb=this;return new Promise(function(_0x21f913,_0x2588c9){return db[_0xfcca('0x20')][_0xfcca('0x21')](_0x11ea82[_0xfcca('0x22')],{'raw':_0x11ea82[_0xfcca('0x23')]?_0x11ea82[_0xfcca('0x23')][_0xfcca('0x24')]===undefined?!![]:![]:!![]})[_0xfcca('0x13')](function(_0x9d09b4){logger[_0xfcca('0x14')]('CreateWhatsappMessage',_0x11ea82);logger['debug']('CreateWhatsappMessage',_0x11ea82,JSON[_0xfcca('0x19')](_0x9d09b4));_0x21f913(_0x9d09b4);})[_0xfcca('0x1e')](function(_0x29f0f7){logger[_0xfcca('0x1a')]('CreateWhatsappMessage',_0x29f0f7['message'],_0x11ea82);_0x2588c9(_0x364bdb['error'](0x1f4,_0x29f0f7[_0xfcca('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index a9b0c71..3c55166 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 _0xaefd=['removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save','remove','emit'];(function(_0x1d7973,_0x357676){var _0x43190c=function(_0x4dd797){while(--_0x4dd797){_0x1d7973['push'](_0x1d7973['shift']());}};_0x43190c(++_0x357676);}(_0xaefd,0x1b4));var _0xdaef=function(_0x3e7f40,_0x49389b){_0x3e7f40=_0x3e7f40-0x0;var _0x9a9a1f=_0xaefd[_0x3e7f40];return _0x9a9a1f;};'use strict';var WhatsappMessageEvents=require(_0xdaef('0x0'));var events=[_0xdaef('0x1'),_0xdaef('0x2'),'update'];function createListener(_0x2df95c,_0x411342){return function(_0x39be97){_0x411342[_0xdaef('0x3')](_0x2df95c,_0x39be97);};}function removeListener(_0x2a75e9,_0x199b46){return function(){WhatsappMessageEvents[_0xdaef('0x4')](_0x2a75e9,_0x199b46);};}exports[_0xdaef('0x5')]=function(_0x175e5b){for(var _0xc156a5=0x0,_0x10bae5=events[_0xdaef('0x6')];_0xc156a5<_0x10bae5;_0xc156a5++){var _0x5a8771=events[_0xc156a5];var _0x46053d=createListener(_0xdaef('0x7')+_0x5a8771,_0x175e5b);WhatsappMessageEvents['on'](_0x5a8771,_0x46053d);}}; \ No newline at end of file +var _0x776c=['emit','removeListener','register','length','./whatsappMessage.events','save','remove'];(function(_0xc5d3bf,_0x4c1804){var _0x2bdf29=function(_0x3d7198){while(--_0x3d7198){_0xc5d3bf['push'](_0xc5d3bf['shift']());}};_0x2bdf29(++_0x4c1804);}(_0x776c,0x7b));var _0xc776=function(_0x3e3111,_0x48b78a){_0x3e3111=_0x3e3111-0x0;var _0x4795ca=_0x776c[_0x3e3111];return _0x4795ca;};'use strict';var WhatsappMessageEvents=require(_0xc776('0x0'));var events=[_0xc776('0x1'),_0xc776('0x2'),'update'];function createListener(_0x2eb3d9,_0x485cd5){return function(_0x37cbc8){_0x485cd5[_0xc776('0x3')](_0x2eb3d9,_0x37cbc8);};}function removeListener(_0x1af6fa,_0x17ea52){return function(){WhatsappMessageEvents[_0xc776('0x4')](_0x1af6fa,_0x17ea52);};}exports[_0xc776('0x5')]=function(_0x1a3ab8){for(var _0x1ed5d6=0x0,_0x1d717d=events[_0xc776('0x6')];_0x1ed5d6<_0x1d717d;_0x1ed5d6++){var _0x2a8201=events[_0x1ed5d6];var _0x1b69aa=createListener('whatsappMessage:'+_0x2a8201,_0x1a3ab8);WhatsappMessageEvents['on'](_0x2a8201,_0x1b69aa);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 10c947d..8a535ab 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 _0x530a=['/:id','/:id/members','getTeams','getAgents','post','create','/:id/teams','put','update','destroy','delete','removeTeams','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','isAuthenticated','describe','get'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x530a,0xed));var _0xa530=function(_0x53e09d,_0xc2e39){_0x53e09d=_0x53e09d-0x0;var _0x3111bb=_0x530a[_0x53e09d];return _0x3111bb;};'use strict';var multer=require(_0xa530('0x0'));var util=require(_0xa530('0x1'));var path=require(_0xa530('0x2'));var timeout=require(_0xa530('0x3'));var express=require('express');var router=express[_0xa530('0x4')]();var fs_extra=require(_0xa530('0x5'));var auth=require(_0xa530('0x6'));var interaction=require(_0xa530('0x7'));var config=require(_0xa530('0x8'));var controller=require('./whatsappQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa530('0x9')]);router['get']('/describe',auth[_0xa530('0xa')](),controller[_0xa530('0xb')]);router[_0xa530('0xc')](_0xa530('0xd'),auth[_0xa530('0xa')](),controller['show']);router[_0xa530('0xc')](_0xa530('0xe'),auth[_0xa530('0xa')](),controller['getMembers']);router[_0xa530('0xc')]('/:id/teams',auth[_0xa530('0xa')](),controller[_0xa530('0xf')]);router[_0xa530('0xc')]('/:id/users',auth['isAuthenticated'](),controller[_0xa530('0x10')]);router[_0xa530('0x11')]('/',auth['isAuthenticated'](),controller[_0xa530('0x12')]);router[_0xa530('0x11')](_0xa530('0x13'),auth[_0xa530('0xa')](),controller['addTeams']);router[_0xa530('0x11')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xa530('0x14')](_0xa530('0xd'),auth[_0xa530('0xa')](),controller[_0xa530('0x15')]);router['delete']('/:id',auth[_0xa530('0xa')](),controller[_0xa530('0x16')]);router[_0xa530('0x17')](_0xa530('0x13'),auth[_0xa530('0xa')](),controller[_0xa530('0x18')]);router[_0xa530('0x17')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xd5b4=['util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','multer'];(function(_0x3b4922,_0x2fa365){var _0x239729=function(_0x82fd7){while(--_0x82fd7){_0x3b4922['push'](_0x3b4922['shift']());}};_0x239729(++_0x2fa365);}(_0xd5b4,0x6f));var _0x4d5b=function(_0x276398,_0x4c1251){_0x276398=_0x276398-0x0;var _0x37ad83=_0xd5b4[_0x276398];return _0x37ad83;};'use strict';var multer=require(_0x4d5b('0x0'));var util=require(_0x4d5b('0x1'));var path=require(_0x4d5b('0x2'));var timeout=require(_0x4d5b('0x3'));var express=require(_0x4d5b('0x4'));var router=express[_0x4d5b('0x5')]();var fs_extra=require(_0x4d5b('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4d5b('0x7'));var controller=require(_0x4d5b('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4d5b('0x9')]('/describe',auth[_0x4d5b('0xa')](),controller[_0x4d5b('0xb')]);router[_0x4d5b('0x9')](_0x4d5b('0xc'),auth[_0x4d5b('0xa')](),controller[_0x4d5b('0xd')]);router[_0x4d5b('0x9')]('/:id/members',auth[_0x4d5b('0xa')](),controller[_0x4d5b('0xe')]);router[_0x4d5b('0x9')](_0x4d5b('0xf'),auth[_0x4d5b('0xa')](),controller['getTeams']);router[_0x4d5b('0x9')](_0x4d5b('0x10'),auth[_0x4d5b('0xa')](),controller[_0x4d5b('0x11')]);router['post']('/',auth[_0x4d5b('0xa')](),controller[_0x4d5b('0x12')]);router[_0x4d5b('0x13')](_0x4d5b('0xf'),auth[_0x4d5b('0xa')](),controller[_0x4d5b('0x14')]);router[_0x4d5b('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x4d5b('0x15')]);router[_0x4d5b('0x16')](_0x4d5b('0xc'),auth[_0x4d5b('0xa')](),controller[_0x4d5b('0x17')]);router[_0x4d5b('0x18')](_0x4d5b('0xc'),auth[_0x4d5b('0xa')](),controller[_0x4d5b('0x19')]);router[_0x4d5b('0x18')](_0x4d5b('0xf'),auth[_0x4d5b('0xa')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x4d5b('0xa')](),controller[_0x4d5b('0x1a')]);module[_0x4d5b('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 ba8875b..36fb82d 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 _0x76dc=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x76dc,0x1f2));var _0xc76d=function(_0x3b18a1,_0x44053c){_0x3b18a1=_0x3b18a1-0x0;var _0x39079a=_0x76dc[_0x3b18a1];return _0x39079a;};'use strict';var Sequelize=require(_0xc76d('0x0'));module[_0xc76d('0x1')]={'name':{'type':Sequelize[_0xc76d('0x2')],'unique':_0xc76d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc76d('0x4')](_0xc76d('0x5'),'beepall',_0xc76d('0x6'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf2c7=['STRING','name','ENUM','rrmemory','sequelize','exports'];(function(_0x68e9f5,_0x4b5bf1){var _0x26beca=function(_0x1e83aa){while(--_0x1e83aa){_0x68e9f5['push'](_0x68e9f5['shift']());}};_0x26beca(++_0x4b5bf1);}(_0xf2c7,0x1d8));var _0x7f2c=function(_0x3b19ea,_0x518b6b){_0x3b19ea=_0x3b19ea-0x0;var _0x40ece9=_0xf2c7[_0x3b19ea];return _0x40ece9;};'use strict';var Sequelize=require(_0x7f2c('0x0'));module[_0x7f2c('0x1')]={'name':{'type':Sequelize[_0x7f2c('0x2')],'unique':_0x7f2c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7f2c('0x4')](_0x7f2c('0x5'),'beepall','roundrobin')},'description':{'type':Sequelize[_0x7f2c('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index de55459..2ff2f44 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 _0xba76=['redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','get','WhatsappQueues','UserProfileResource','destroy','name','index','map','WhatsappQueue','fieldName','key','getOptions','where','include','findAll','catch','show','params','model','keys','rawAttributes','query','intersection','fields','attributes','length','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserWhatsappQueue','filters','nolimit','order','sort','WhatsappQueueId','filter','options','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','rows','%s/%s','updatedAt','getTeams','Team','pick','hasOwnProperty','ids','Agents','online','voicePause','interface','flatMap','addTeams','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','compact','transaction','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','findOne','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x5b146d,_0x541a46){var _0x85650d=function(_0xdec0ce){while(--_0xdec0ce){_0x5b146d['push'](_0x5b146d['shift']());}};_0x85650d(++_0x541a46);}(_0xba76,0x16c));var _0x6ba7=function(_0x188c60,_0x1d0d8f){_0x188c60=_0x188c60-0x0;var _0x580a07=_0xba76[_0x188c60];return _0x580a07;};'use strict';var BPromise=require(_0x6ba7('0x0'));var util=require(_0x6ba7('0x1'));var _=require(_0x6ba7('0x2'));var squel=require(_0x6ba7('0x3'));var Redis=require('ioredis');var qs=require(_0x6ba7('0x4'));var logger=require(_0x6ba7('0x5'))('api');var config=require(_0x6ba7('0x6'));var db=require(_0x6ba7('0x7'))['db'];config[_0x6ba7('0x8')]=_[_0x6ba7('0x9')](config[_0x6ba7('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x6ba7('0xa'))(new Redis(config['redis']));require(_0x6ba7('0xb'))[_0x6ba7('0xc')](socket);function respondWithStatusCode(_0x469af2,_0x125a73){_0x125a73=_0x125a73||0xcc;return function(_0x5e05ed){if(_0x5e05ed){return _0x469af2[_0x6ba7('0xd')](_0x125a73);}return _0x469af2[_0x6ba7('0xe')](_0x125a73)[_0x6ba7('0xf')]();};}function respondWithResult(_0x944763,_0x4a8380){_0x4a8380=_0x4a8380||0xc8;return function(_0x487f3d){if(_0x487f3d){return _0x944763['status'](_0x4a8380)[_0x6ba7('0x10')](_0x487f3d);}};}function respondWithFilteredResult(_0x18dd55,_0x34e1d6){return function(_0x534998){if(_0x534998){var _0x421b13=typeof _0x34e1d6[_0x6ba7('0x11')]===_0x6ba7('0x12')&&typeof _0x34e1d6[_0x6ba7('0x13')]==='undefined';var _0x3ec9ce=_0x534998['count'];var _0x63afb2=_0x421b13?0x0:_0x34e1d6[_0x6ba7('0x11')];var _0x3ffb63=_0x421b13?_0x534998[_0x6ba7('0x14')]:_0x34e1d6[_0x6ba7('0x11')]+_0x34e1d6['limit'];var _0xd595c1;if(_0x3ffb63>=_0x3ec9ce){_0x3ffb63=_0x3ec9ce;_0xd595c1=0xc8;}else{_0xd595c1=0xce;}_0x18dd55[_0x6ba7('0xe')](_0xd595c1);return _0x18dd55[_0x6ba7('0x15')](_0x6ba7('0x16'),_0x63afb2+'-'+_0x3ffb63+'/'+_0x3ec9ce)[_0x6ba7('0x10')](_0x534998);}return null;};}function saveUpdates(_0x47c71d){return function(_0x2eb9eb){if(_0x2eb9eb){return _0x2eb9eb[_0x6ba7('0x17')](_0x47c71d)['then'](function(_0x28942c){return _0x28942c;});}return null;};}function removeEntity(_0x31dc5f){return function(_0x3c081b){if(_0x3c081b){return _0x3c081b['destroy']()[_0x6ba7('0x18')](function(){var _0x47dd74=_0x3c081b[_0x6ba7('0x19')]({'plain':!![]});var _0x2818c7=_0x6ba7('0x1a');return db[_0x6ba7('0x1b')][_0x6ba7('0x1c')]({'where':{'type':_0x2818c7,'resourceId':_0x47dd74['id']}})[_0x6ba7('0x18')](function(){return _0x3c081b;});})[_0x6ba7('0x18')](function(){_0x31dc5f['status'](0xcc)[_0x6ba7('0xf')]();});}};}function handleEntityNotFound(_0x371ae5){return function(_0x6065e6){if(!_0x6065e6){_0x371ae5[_0x6ba7('0xd')](0x194);}return _0x6065e6;};}function handleError(_0x51e644,_0x20db71){_0x20db71=_0x20db71||0x1f4;return function(_0x113ede){logger['error'](_0x113ede['stack']);if(_0x113ede[_0x6ba7('0x1d')]){delete _0x113ede[_0x6ba7('0x1d')];}_0x51e644[_0x6ba7('0xe')](_0x20db71)['send'](_0x113ede);};}exports[_0x6ba7('0x1e')]=function(_0x4839f8,_0x219529){var _0x227e27={};var _0x366b2a={'count':0x0,'rows':[]};var _0x17a1a2=_[_0x6ba7('0x1f')](db[_0x6ba7('0x20')]['rawAttributes'],function(_0x19ffa6){return{'name':_0x19ffa6[_0x6ba7('0x21')],'type':_0x19ffa6['type'][_0x6ba7('0x22')]};});_0x227e27=qs[_0x6ba7('0x23')](_0x17a1a2,_0x4839f8);var _0x25b1c4={'where':_0x227e27[_0x6ba7('0x24')]};return db[_0x6ba7('0x20')][_0x6ba7('0x14')](_0x25b1c4)['then'](function(_0x779c53){_0x366b2a['count']=_0x779c53;_0x227e27['include']=qs[_0x6ba7('0x25')](_0x4839f8['query']);return db[_0x6ba7('0x20')][_0x6ba7('0x26')](_0x227e27);})[_0x6ba7('0x18')](function(_0x1117a2){_0x366b2a['rows']=_0x1117a2;return _0x366b2a;})['then'](respondWithFilteredResult(_0x219529,_0x227e27))[_0x6ba7('0x27')](handleError(_0x219529,null));};exports[_0x6ba7('0x28')]=function(_0x402369,_0x3b7425){var _0x5eddd2={'raw':!![],'where':{'id':_0x402369[_0x6ba7('0x29')]['id']}},_0xe0a273={};_0xe0a273[_0x6ba7('0x2a')]=_[_0x6ba7('0x2b')](db[_0x6ba7('0x20')][_0x6ba7('0x2c')]);_0xe0a273['query']=_[_0x6ba7('0x2b')](_0x402369[_0x6ba7('0x2d')]);_0xe0a273['filters']=_[_0x6ba7('0x2e')](_0xe0a273['model'],_0xe0a273[_0x6ba7('0x2d')]);_0x5eddd2['attributes']=_['intersection'](_0xe0a273['model'],qs['fields'](_0x402369[_0x6ba7('0x2d')][_0x6ba7('0x2f')]));_0x5eddd2['attributes']=_0x5eddd2[_0x6ba7('0x30')][_0x6ba7('0x31')]?_0x5eddd2[_0x6ba7('0x30')]:_0xe0a273[_0x6ba7('0x2a')];if(_0x402369[_0x6ba7('0x2d')][_0x6ba7('0x32')]){_0x5eddd2[_0x6ba7('0x25')]=[{'all':!![]}];}_0x5eddd2=_[_0x6ba7('0x33')]({},_0x5eddd2,_0x402369['options']);return db[_0x6ba7('0x20')][_0x6ba7('0x34')](_0x5eddd2)[_0x6ba7('0x18')](handleEntityNotFound(_0x3b7425,null))[_0x6ba7('0x18')](respondWithResult(_0x3b7425,null))['catch'](handleError(_0x3b7425,null));};exports[_0x6ba7('0x35')]=function(_0x480c31,_0x5102d7){return db['WhatsappQueue'][_0x6ba7('0x35')](_0x480c31[_0x6ba7('0x36')],{})[_0x6ba7('0x18')](function(_0x1e3bf1){var _0x277721=_0x480c31[_0x6ba7('0x37')]['get']({'plain':!![]});if(!_0x277721)throw new Error(_0x6ba7('0x38'));if(_0x277721[_0x6ba7('0x39')]===_0x6ba7('0x37')){var _0x1ef764=_0x1e3bf1[_0x6ba7('0x19')]({'plain':!![]});var _0x560a76='WhatsappQueues';return db['UserProfileSection']['find']({'where':{'name':_0x560a76,'userProfileId':_0x277721[_0x6ba7('0x3a')]},'raw':!![]})[_0x6ba7('0x18')](function(_0x2e1a4d){if(_0x2e1a4d&&_0x2e1a4d[_0x6ba7('0x3b')]===0x0){return db['UserProfileResource'][_0x6ba7('0x35')]({'name':_0x1ef764[_0x6ba7('0x1d')],'resourceId':_0x1ef764['id'],'type':_0x2e1a4d[_0x6ba7('0x1d')],'sectionId':_0x2e1a4d['id']},{})[_0x6ba7('0x18')](function(){return _0x1e3bf1;});}else{return _0x1e3bf1;}})[_0x6ba7('0x27')](function(_0x523110){logger[_0x6ba7('0x3c')](_0x6ba7('0x3d'),_0x523110);throw _0x523110;});}return _0x1e3bf1;})[_0x6ba7('0x18')](respondWithResult(_0x5102d7,0xc9))[_0x6ba7('0x27')](handleError(_0x5102d7,null));};exports[_0x6ba7('0x17')]=function(_0xe12536,_0x543589){if(_0xe12536[_0x6ba7('0x36')]['id']){delete _0xe12536[_0x6ba7('0x36')]['id'];}return db[_0x6ba7('0x20')]['find']({'where':{'id':_0xe12536[_0x6ba7('0x29')]['id']}})['then'](handleEntityNotFound(_0x543589,null))[_0x6ba7('0x18')](saveUpdates(_0xe12536[_0x6ba7('0x36')],null))[_0x6ba7('0x18')](respondWithResult(_0x543589,null))['catch'](handleError(_0x543589,null));};exports[_0x6ba7('0x1c')]=function(_0x2b281b,_0x2a487f){return db[_0x6ba7('0x20')][_0x6ba7('0x34')]({'where':{'id':_0x2b281b[_0x6ba7('0x29')]['id']}})[_0x6ba7('0x18')](handleEntityNotFound(_0x2a487f,null))[_0x6ba7('0x18')](removeEntity(_0x2a487f,null))[_0x6ba7('0x27')](handleError(_0x2a487f,null));};exports[_0x6ba7('0x3e')]=function(_0x5499bf,_0x2d12de){return db[_0x6ba7('0x20')][_0x6ba7('0x3e')]()[_0x6ba7('0x18')](respondWithResult(_0x2d12de,null))[_0x6ba7('0x27')](handleError(_0x2d12de,null));};exports[_0x6ba7('0x3f')]=function(_0x40d241,_0x56f6f4){var _0x502c72={'raw':!![],'where':{}},_0x1c16a9={},_0xcbd8db;return db[_0x6ba7('0x20')]['findOne']({'where':{'id':_0x40d241[_0x6ba7('0x29')]['id']}})[_0x6ba7('0x18')](handleEntityNotFound(_0x56f6f4,null))[_0x6ba7('0x18')](function(_0x2e3949){if(_0x2e3949){_0xcbd8db=_0x2e3949[_0x6ba7('0x19')]({'plain':!![]});_0x1c16a9[_0x6ba7('0x2a')]=_[_0x6ba7('0x2b')](db[_0x6ba7('0x40')][_0x6ba7('0x2c')]);_0x1c16a9['query']=_['keys'](_0x40d241[_0x6ba7('0x2d')]);_0x1c16a9[_0x6ba7('0x41')]=_[_0x6ba7('0x2e')](_0x1c16a9[_0x6ba7('0x2a')],_0x1c16a9[_0x6ba7('0x2d')]);_0x502c72[_0x6ba7('0x30')]=_['intersection'](_0x1c16a9[_0x6ba7('0x2a')],qs[_0x6ba7('0x2f')](_0x40d241[_0x6ba7('0x2d')]['fields']));_0x502c72[_0x6ba7('0x30')]=_0x502c72[_0x6ba7('0x30')][_0x6ba7('0x31')]?_0x502c72['attributes']:_0x1c16a9[_0x6ba7('0x2a')];if(!_0x40d241[_0x6ba7('0x2d')]['hasOwnProperty'](_0x6ba7('0x42'))){_0x502c72[_0x6ba7('0x13')]=qs['limit'](_0x40d241['query'][_0x6ba7('0x13')]);_0x502c72[_0x6ba7('0x11')]=qs[_0x6ba7('0x11')](_0x40d241[_0x6ba7('0x2d')][_0x6ba7('0x11')]);}_0x502c72[_0x6ba7('0x43')]=qs[_0x6ba7('0x44')](_0x40d241['query'][_0x6ba7('0x44')]);_0x502c72[_0x6ba7('0x24')]=qs['filters'](_['pick'](_0x40d241[_0x6ba7('0x2d')],_0x1c16a9[_0x6ba7('0x41')]));_0x502c72['where'][_0x6ba7('0x45')]=_0x2e3949['id'];if(_0x40d241['query']['filter']){_0x502c72['where']=_[_0x6ba7('0x33')](_0x502c72['where'],{'$or':_[_0x6ba7('0x1f')](_0x502c72[_0x6ba7('0x30')],function(_0x375542){var _0x3757bc={};_0x3757bc[_0x375542]={'$like':'%'+_0x40d241['query'][_0x6ba7('0x46')]+'%'};return _0x3757bc;})});}_0x502c72=_[_0x6ba7('0x33')]({},_0x502c72,_0x40d241[_0x6ba7('0x47')]);return db['UserWhatsappQueue'][_0x6ba7('0x26')](_0x502c72);}})[_0x6ba7('0x18')](function(_0x57dace){if(_0x57dace){return db[_0x6ba7('0x48')][_0x6ba7('0x49')]({'where':{'id':_['map'](_0x57dace,_0x6ba7('0x4a')),'role':_0x6ba7('0x4b')},'attributes':['id',_0x6ba7('0x1d'),_0x6ba7('0x4c'),'updatedAt',_0x6ba7('0x4d')]});}})['then'](function(_0x2ef114){if(_0x2ef114){return{'count':_0x2ef114[_0x6ba7('0x14')],'rows':_[_0x6ba7('0x1f')](_0x2ef114[_0x6ba7('0x4e')],function(_0x3cc265){return{'membername':_0x3cc265[_0x6ba7('0x1d')],'UserId':_0x3cc265['id'],'queue_name':_0xcbd8db['name'],'WhatsappQueueId':_0xcbd8db['id'],'interface':util['format'](_0x6ba7('0x4f'),'SIP',_0x3cc265[_0x6ba7('0x1d')]),'penalty':0x0,'paused':_0x3cc265['whatsappPause'],'createdAt':_0x3cc265[_0x6ba7('0x4d')],'updatedAt':_0x3cc265[_0x6ba7('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6ba7('0x18')](respondWithFilteredResult(_0x56f6f4,_0x502c72))['catch'](handleError(_0x56f6f4,null));};exports[_0x6ba7('0x51')]=function(_0x9a167d,_0x537ffe){var _0x277aff={};var _0xd29fc5={};var _0x1aed50;var _0x2c9f83;return db[_0x6ba7('0x20')]['findOne']({'where':{'id':_0x9a167d['params']['id']}})[_0x6ba7('0x18')](handleEntityNotFound(_0x537ffe,null))[_0x6ba7('0x18')](function(_0x5d21b1){if(_0x5d21b1){_0x1aed50=_0x5d21b1;_0xd29fc5['model']=_[_0x6ba7('0x2b')](db[_0x6ba7('0x52')][_0x6ba7('0x2c')]);_0xd29fc5[_0x6ba7('0x2d')]=_[_0x6ba7('0x2b')](_0x9a167d[_0x6ba7('0x2d')]);_0xd29fc5[_0x6ba7('0x41')]=_['intersection'](_0xd29fc5['model'],_0xd29fc5[_0x6ba7('0x2d')]);_0x277aff[_0x6ba7('0x30')]=_['intersection'](_0xd29fc5[_0x6ba7('0x2a')],qs[_0x6ba7('0x2f')](_0x9a167d[_0x6ba7('0x2d')][_0x6ba7('0x2f')]));_0x277aff[_0x6ba7('0x30')]=_0x277aff[_0x6ba7('0x30')][_0x6ba7('0x31')]?_0x277aff[_0x6ba7('0x30')]:_0xd29fc5[_0x6ba7('0x2a')];_0x277aff[_0x6ba7('0x43')]=qs[_0x6ba7('0x44')](_0x9a167d[_0x6ba7('0x2d')][_0x6ba7('0x44')]);_0x277aff[_0x6ba7('0x24')]=qs[_0x6ba7('0x41')](_[_0x6ba7('0x53')](_0x9a167d[_0x6ba7('0x2d')],_0xd29fc5[_0x6ba7('0x41')]));if(_0x9a167d[_0x6ba7('0x2d')][_0x6ba7('0x46')]){_0x277aff['where']=_[_0x6ba7('0x33')](_0x277aff[_0x6ba7('0x24')],{'$or':_[_0x6ba7('0x1f')](_0x277aff[_0x6ba7('0x30')],function(_0x4d7865){var _0x3ca805={};_0x3ca805[_0x4d7865]={'$like':'%'+_0x9a167d['query'][_0x6ba7('0x46')]+'%'};return _0x3ca805;})});}_0x277aff=_[_0x6ba7('0x33')]({},_0x277aff,_0x9a167d['options']);return _0x1aed50[_0x6ba7('0x51')](_0x277aff);}})[_0x6ba7('0x18')](function(_0x43ea68){if(_0x43ea68){_0x2c9f83=_0x43ea68[_0x6ba7('0x31')];if(!_0x9a167d[_0x6ba7('0x2d')][_0x6ba7('0x54')](_0x6ba7('0x42'))){_0x277aff['limit']=qs[_0x6ba7('0x13')](_0x9a167d['query'][_0x6ba7('0x13')]);_0x277aff[_0x6ba7('0x11')]=qs[_0x6ba7('0x11')](_0x9a167d[_0x6ba7('0x2d')][_0x6ba7('0x11')]);}return _0x1aed50[_0x6ba7('0x51')](_0x277aff);}})[_0x6ba7('0x18')](function(_0x1b1186){if(_0x1b1186){return _0x1b1186?{'count':_0x2c9f83,'rows':_0x1b1186}:null;}})['then'](respondWithResult(_0x537ffe,null))[_0x6ba7('0x27')](handleError(_0x537ffe,null));};exports['addTeams']=function(_0x4c038b,_0x1971ef){var _0x4208d3=_0x4c038b['body'][_0x6ba7('0x55')];return db['Team'][_0x6ba7('0x26')]({'where':{'id':_0x4208d3},'attributes':['id'],'include':[{'model':db[_0x6ba7('0x48')],'as':_0x6ba7('0x56'),'attributes':['id',_0x6ba7('0x1d'),_0x6ba7('0x57'),_0x6ba7('0x58'),_0x6ba7('0x59')],'raw':!![]}]})[_0x6ba7('0x18')](function(_0x63dd3d){if(_0x63dd3d){var _0x47622b=_[_0x6ba7('0x5a')](_0x63dd3d,function(_0x348fad){var _0x252931=_0x348fad[_0x6ba7('0x19')]({'plain':!![]});return _0x252931[_0x6ba7('0x56')];});return db[_0x6ba7('0x20')][_0x6ba7('0x34')]({'where':{'id':_0x4c038b[_0x6ba7('0x29')]['id']}})[_0x6ba7('0x18')](function(_0x5a8e7b){return db['sequelize']['transaction'](function(_0x2f7eaa){return _0x5a8e7b[_0x6ba7('0x5b')](_0x4208d3,{'transaction':_0x2f7eaa})['then'](function(){return BPromise[_0x6ba7('0x5c')](_0x47622b,function(_0x598932){return db[_0x6ba7('0x40')][_0x6ba7('0x5d')]({'where':{'UserId':_0x598932['id'],'WhatsappQueueId':_0x4c038b['params']['id']},'transaction':_0x2f7eaa});});})[_0x6ba7('0x18')](function(){_0x47622b[_0x6ba7('0x5e')](function(_0x279a92){socket[_0x6ba7('0x5f')](_0x6ba7('0x60'),{'UserId':_0x279a92['id'],'WhatsappQueueId':_0x5a8e7b['id']});});});});});}})[_0x6ba7('0x18')](respondWithStatusCode(_0x1971ef,null))[_0x6ba7('0x27')](handleError(_0x1971ef,null));};exports[_0x6ba7('0x61')]=function(_0x4cc0d0,_0x1e82d4){return db['Team']['findAll']({'where':{'id':_0x4cc0d0[_0x6ba7('0x2d')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6ba7('0x48')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x6ba7('0x18')](handleEntityNotFound(_0x1e82d4,null))[_0x6ba7('0x18')](function(_0x5b2922){var _0x522677=_['map'](_0x5b2922,'id');var _0x504805=[];var _0x3ad232=[];var _0x4a8850=squel[_0x6ba7('0x62')]();_0x4a8850[_0x6ba7('0x63')](_0x6ba7('0x64'))[_0x6ba7('0x65')](_0x6ba7('0x66'),'tq')[_0x6ba7('0x67')](_0x6ba7('0x68'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6ba7('0x24')](_0x6ba7('0x69'),_0x4cc0d0[_0x6ba7('0x29')]['id']);for(var _0x33ef5b=0x0;_0x33ef5b<_0x5b2922[_0x6ba7('0x31')];_0x33ef5b+=0x1){let _0x2401a8=_0x5b2922[_0x33ef5b];for(var _0x12caf5=0x0;_0x12caf5<_0x2401a8[_0x6ba7('0x56')][_0x6ba7('0x31')];_0x12caf5+=0x1){let _0x39b864=_0x2401a8[_0x6ba7('0x56')][_0x12caf5];var _0xdb1ba3=_0x4a8850[_0x6ba7('0x6a')]();_0xdb1ba3[_0x6ba7('0x24')](_0x6ba7('0x6b'),_0x39b864['id']);_0x3ad232[_0x6ba7('0x6c')](db[_0x6ba7('0x6d')][_0x6ba7('0x2d')](_0xdb1ba3['toString'](),{'type':db['sequelize'][_0x6ba7('0x6e')][_0x6ba7('0x6f')]})[_0x6ba7('0x18')](function(_0x2eeebc){if(_0x2eeebc['length']===0x1){return _0x39b864['id'];}else{var _0x3bdd39=_[_0x6ba7('0x70')](_[_0x6ba7('0x1f')](_0x2eeebc,_0x6ba7('0x71')),function(_0x3f1ac4){return _['includes'](_0x522677,_0x3f1ac4);});if(_0x3bdd39){return _0x39b864['id'];}}}));}}return BPromise['all'](_0x3ad232)[_0x6ba7('0x18')](function(_0x1c0d6c){_0x504805=_(_0x504805)['union'](_0x1c0d6c)[_0x6ba7('0x72')]()['value']();return db[_0x6ba7('0x20')][_0x6ba7('0x34')]({'where':{'id':_0x4cc0d0['params']['id']}})['then'](function(_0xd8f0e9){return db[_0x6ba7('0x6d')][_0x6ba7('0x73')](function(_0x45db0d){return _0xd8f0e9['removeTeams'](_0x4cc0d0['query']['ids'],{'transaction':_0x45db0d})[_0x6ba7('0x18')](function(){if(!_[_0x6ba7('0x74')](_0x504805)){return _0xd8f0e9[_0x6ba7('0x75')](_0x504805,{'transaction':_0x45db0d});}})[_0x6ba7('0x18')](function(){_0x504805[_0x6ba7('0x5e')](function(_0x319886){socket[_0x6ba7('0x5f')](_0x6ba7('0x76'),{'UserId':_0x319886,'WhatsappQueueId':_0xd8f0e9['id']});});});});});});})['then'](respondWithStatusCode(_0x1e82d4,null))[_0x6ba7('0x27')](handleError(_0x1e82d4,null));};exports[_0x6ba7('0x77')]=function(_0xb8bdbe,_0x5d1b74){return db[_0x6ba7('0x20')][_0x6ba7('0x34')]({'where':{'id':_0xb8bdbe['params']['id']}})[_0x6ba7('0x18')](handleEntityNotFound(_0x5d1b74,null))[_0x6ba7('0x18')](function(_0x4f1399){if(_0x4f1399){return _0x4f1399['addAgents'](_0xb8bdbe[_0x6ba7('0x36')][_0x6ba7('0x55')],_['omit'](_0xb8bdbe['body'],[_0x6ba7('0x55'),'id'])||{})[_0x6ba7('0x78')](function(_0x134d2a){for(var _0x547953=0x0;_0x547953<_0xb8bdbe[_0x6ba7('0x36')][_0x6ba7('0x55')]['length'];_0x547953+=0x1){socket['emit'](_0x6ba7('0x60'),{'UserId':Number(_0xb8bdbe['body'][_0x6ba7('0x55')][_0x547953]),'WhatsappQueueId':Number(_0xb8bdbe[_0x6ba7('0x29')]['id'])});}return _0x134d2a;});}})[_0x6ba7('0x18')](respondWithResult(_0x5d1b74,null))[_0x6ba7('0x27')](handleError(_0x5d1b74,null));};exports[_0x6ba7('0x75')]=function(_0x507cfa,_0x29d73f){return db['WhatsappQueue'][_0x6ba7('0x34')]({'where':{'id':_0x507cfa[_0x6ba7('0x29')]['id']}})['then'](handleEntityNotFound(_0x29d73f,null))[_0x6ba7('0x18')](function(_0x35dc9c){if(_0x35dc9c){return _0x35dc9c['removeAgents'](_0x507cfa[_0x6ba7('0x2d')]['ids'])[_0x6ba7('0x18')](function(){if(_[_0x6ba7('0x79')](_0x507cfa[_0x6ba7('0x2d')][_0x6ba7('0x55')])){for(var _0x3e53be=0x0;_0x3e53be<_0x507cfa[_0x6ba7('0x2d')][_0x6ba7('0x55')][_0x6ba7('0x31')];_0x3e53be+=0x1){socket[_0x6ba7('0x5f')](_0x6ba7('0x76'),{'UserId':Number(_0x507cfa[_0x6ba7('0x2d')][_0x6ba7('0x55')][_0x3e53be]),'WhatsappQueueId':Number(_0x507cfa[_0x6ba7('0x29')]['id'])});}}else{socket[_0x6ba7('0x5f')]('userWhatsappQueue:remove',{'UserId':Number(_0x507cfa[_0x6ba7('0x2d')]['ids']),'WhatsappQueueId':Number(_0x507cfa[_0x6ba7('0x29')]['id'])});}});}})['then'](respondWithStatusCode(_0x29d73f,null))[_0x6ba7('0x27')](handleError(_0x29d73f,null));};exports[_0x6ba7('0x7a')]=function(_0x58d4ef,_0x38c7a5){var _0xeed61b={};var _0x5f1857={};var _0x42be3a;var _0x366b3a;return db['WhatsappQueue'][_0x6ba7('0x7b')]({'where':{'id':_0x58d4ef[_0x6ba7('0x29')]['id']}})['then'](handleEntityNotFound(_0x38c7a5,null))[_0x6ba7('0x18')](function(_0x21fcc7){if(_0x21fcc7){_0x42be3a=_0x21fcc7;_0x5f1857['model']=_[_0x6ba7('0x2b')](db[_0x6ba7('0x48')]['rawAttributes']);_0x5f1857[_0x6ba7('0x2d')]=_[_0x6ba7('0x2b')](_0x58d4ef[_0x6ba7('0x2d')]);_0x5f1857['filters']=_[_0x6ba7('0x2e')](_0x5f1857['model'],_0x5f1857[_0x6ba7('0x2d')]);_0xeed61b[_0x6ba7('0x30')]=_[_0x6ba7('0x2e')](_0x5f1857[_0x6ba7('0x2a')],qs['fields'](_0x58d4ef[_0x6ba7('0x2d')][_0x6ba7('0x2f')]));_0xeed61b[_0x6ba7('0x30')]=_0xeed61b[_0x6ba7('0x30')][_0x6ba7('0x31')]?_0xeed61b['attributes']:_0x5f1857[_0x6ba7('0x2a')];_0xeed61b[_0x6ba7('0x43')]=qs[_0x6ba7('0x44')](_0x58d4ef[_0x6ba7('0x2d')][_0x6ba7('0x44')]);_0xeed61b[_0x6ba7('0x24')]=qs[_0x6ba7('0x41')](_[_0x6ba7('0x53')](_0x58d4ef[_0x6ba7('0x2d')],_0x5f1857[_0x6ba7('0x41')]));if(_0x58d4ef['query'][_0x6ba7('0x46')]){_0xeed61b[_0x6ba7('0x24')]=_['merge'](_0xeed61b[_0x6ba7('0x24')],{'$or':_[_0x6ba7('0x1f')](_0xeed61b[_0x6ba7('0x30')],function(_0x1f0af0){var _0x1bc081={};_0x1bc081[_0x1f0af0]={'$like':'%'+_0x58d4ef[_0x6ba7('0x2d')][_0x6ba7('0x46')]+'%'};return _0x1bc081;})});}_0xeed61b=_['merge']({},_0xeed61b,_0x58d4ef[_0x6ba7('0x47')]);return _0x42be3a[_0x6ba7('0x7a')](_0xeed61b);}})['then'](function(_0x2b3bed){if(_0x2b3bed){_0x366b3a=_0x2b3bed[_0x6ba7('0x31')];if(!_0x58d4ef[_0x6ba7('0x2d')]['hasOwnProperty']('nolimit')){_0xeed61b[_0x6ba7('0x13')]=qs[_0x6ba7('0x13')](_0x58d4ef[_0x6ba7('0x2d')][_0x6ba7('0x13')]);_0xeed61b['offset']=qs['offset'](_0x58d4ef[_0x6ba7('0x2d')][_0x6ba7('0x11')]);}return _0x42be3a[_0x6ba7('0x7a')](_0xeed61b);}})[_0x6ba7('0x18')](function(_0x3e21e0){if(_0x3e21e0){return _0x3e21e0?{'count':_0x366b3a,'rows':_0x3e21e0}:null;}})[_0x6ba7('0x18')](respondWithResult(_0x38c7a5,null))[_0x6ba7('0x27')](handleError(_0x38c7a5,null));}; \ No newline at end of file +var _0xbfab=['compact','removeTeams','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','pick','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','name','index','map','WhatsappQueue','rawAttributes','type','getOptions','where','include','query','findAll','catch','show','params','model','keys','filters','intersection','attributes','fields','includeAll','merge','find','create','body','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserWhatsappQueue','nolimit','order','sort','filter','options','UserId','agent','whatsappPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','length','hasOwnProperty','addTeams','ids','User','Agents','voicePause','interface','flatMap','sequelize','transaction','each','emit','userWhatsappQueue:save','select','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union'];(function(_0x80a5a6,_0xc903eb){var _0xd239bd=function(_0x2f3bea){while(--_0x2f3bea){_0x80a5a6['push'](_0x80a5a6['shift']());}};_0xd239bd(++_0xc903eb);}(_0xbfab,0x82));var _0xbbfa=function(_0x118139,_0x7ce965){_0x118139=_0x118139-0x0;var _0x2fece9=_0xbfab[_0x118139];return _0x2fece9;};'use strict';var BPromise=require(_0xbbfa('0x0'));var util=require(_0xbbfa('0x1'));var _=require(_0xbbfa('0x2'));var squel=require(_0xbbfa('0x3'));var Redis=require(_0xbbfa('0x4'));var qs=require(_0xbbfa('0x5'));var logger=require(_0xbbfa('0x6'))(_0xbbfa('0x7'));var config=require('../../config/environment');var db=require(_0xbbfa('0x8'))['db'];config['redis']=_['defaults'](config[_0xbbfa('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xbbfa('0xa'))(new Redis(config['redis']));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x2fa6ca,_0x4fa99e){_0x4fa99e=_0x4fa99e||0xcc;return function(_0x391e4f){if(_0x391e4f){return _0x2fa6ca[_0xbbfa('0xb')](_0x4fa99e);}return _0x2fa6ca[_0xbbfa('0xc')](_0x4fa99e)[_0xbbfa('0xd')]();};}function respondWithResult(_0x31e692,_0x709bcf){_0x709bcf=_0x709bcf||0xc8;return function(_0x2bdcf8){if(_0x2bdcf8){return _0x31e692['status'](_0x709bcf)['json'](_0x2bdcf8);}};}function respondWithFilteredResult(_0xe41694,_0x3a0f6c){return function(_0x638ebe){if(_0x638ebe){var _0x3bb42d=typeof _0x3a0f6c['offset']===_0xbbfa('0xe')&&typeof _0x3a0f6c[_0xbbfa('0xf')]===_0xbbfa('0xe');var _0x53c01b=_0x638ebe[_0xbbfa('0x10')];var _0x38fe7d=_0x3bb42d?0x0:_0x3a0f6c[_0xbbfa('0x11')];var _0x3d6a12=_0x3bb42d?_0x638ebe[_0xbbfa('0x10')]:_0x3a0f6c['offset']+_0x3a0f6c[_0xbbfa('0xf')];var _0x2f4a14;if(_0x3d6a12>=_0x53c01b){_0x3d6a12=_0x53c01b;_0x2f4a14=0xc8;}else{_0x2f4a14=0xce;}_0xe41694['status'](_0x2f4a14);return _0xe41694[_0xbbfa('0x12')](_0xbbfa('0x13'),_0x38fe7d+'-'+_0x3d6a12+'/'+_0x53c01b)[_0xbbfa('0x14')](_0x638ebe);}return null;};}function saveUpdates(_0x2e7e48){return function(_0x3ead6b){if(_0x3ead6b){return _0x3ead6b[_0xbbfa('0x15')](_0x2e7e48)[_0xbbfa('0x16')](function(_0x3f23d0){return _0x3f23d0;});}return null;};}function removeEntity(_0x101624){return function(_0x17efb9){if(_0x17efb9){return _0x17efb9[_0xbbfa('0x17')]()[_0xbbfa('0x16')](function(){var _0x387c7f=_0x17efb9[_0xbbfa('0x18')]({'plain':!![]});var _0x548245=_0xbbfa('0x19');return db[_0xbbfa('0x1a')]['destroy']({'where':{'type':_0x548245,'resourceId':_0x387c7f['id']}})[_0xbbfa('0x16')](function(){return _0x17efb9;});})['then'](function(){_0x101624[_0xbbfa('0xc')](0xcc)[_0xbbfa('0xd')]();});}};}function handleEntityNotFound(_0x149065){return function(_0x1ac4b2){if(!_0x1ac4b2){_0x149065[_0xbbfa('0xb')](0x194);}return _0x1ac4b2;};}function handleError(_0x241f83,_0xfbc1c8){_0xfbc1c8=_0xfbc1c8||0x1f4;return function(_0x5df663){logger[_0xbbfa('0x1b')](_0x5df663['stack']);if(_0x5df663['name']){delete _0x5df663[_0xbbfa('0x1c')];}_0x241f83['status'](_0xfbc1c8)['send'](_0x5df663);};}exports[_0xbbfa('0x1d')]=function(_0x21a634,_0xe4d74){var _0x2e46b0={};var _0x3116f4={'count':0x0,'rows':[]};var _0x1393bf=_[_0xbbfa('0x1e')](db[_0xbbfa('0x1f')][_0xbbfa('0x20')],function(_0x16ca45){return{'name':_0x16ca45['fieldName'],'type':_0x16ca45[_0xbbfa('0x21')]['key']};});_0x2e46b0=qs[_0xbbfa('0x22')](_0x1393bf,_0x21a634);var _0x2eab93={'where':_0x2e46b0[_0xbbfa('0x23')]};return db[_0xbbfa('0x1f')]['count'](_0x2eab93)[_0xbbfa('0x16')](function(_0x199b92){_0x3116f4[_0xbbfa('0x10')]=_0x199b92;_0x2e46b0[_0xbbfa('0x24')]=qs[_0xbbfa('0x24')](_0x21a634[_0xbbfa('0x25')]);return db[_0xbbfa('0x1f')][_0xbbfa('0x26')](_0x2e46b0);})[_0xbbfa('0x16')](function(_0x4def44){_0x3116f4['rows']=_0x4def44;return _0x3116f4;})[_0xbbfa('0x16')](respondWithFilteredResult(_0xe4d74,_0x2e46b0))[_0xbbfa('0x27')](handleError(_0xe4d74,null));};exports[_0xbbfa('0x28')]=function(_0x227244,_0x15c782){var _0x568445={'raw':!![],'where':{'id':_0x227244[_0xbbfa('0x29')]['id']}},_0x233c36={};_0x233c36[_0xbbfa('0x2a')]=_[_0xbbfa('0x2b')](db['WhatsappQueue'][_0xbbfa('0x20')]);_0x233c36[_0xbbfa('0x25')]=_['keys'](_0x227244[_0xbbfa('0x25')]);_0x233c36[_0xbbfa('0x2c')]=_[_0xbbfa('0x2d')](_0x233c36[_0xbbfa('0x2a')],_0x233c36[_0xbbfa('0x25')]);_0x568445[_0xbbfa('0x2e')]=_[_0xbbfa('0x2d')](_0x233c36['model'],qs[_0xbbfa('0x2f')](_0x227244[_0xbbfa('0x25')][_0xbbfa('0x2f')]));_0x568445['attributes']=_0x568445[_0xbbfa('0x2e')]['length']?_0x568445[_0xbbfa('0x2e')]:_0x233c36[_0xbbfa('0x2a')];if(_0x227244[_0xbbfa('0x25')][_0xbbfa('0x30')]){_0x568445['include']=[{'all':!![]}];}_0x568445=_[_0xbbfa('0x31')]({},_0x568445,_0x227244['options']);return db[_0xbbfa('0x1f')][_0xbbfa('0x32')](_0x568445)[_0xbbfa('0x16')](handleEntityNotFound(_0x15c782,null))[_0xbbfa('0x16')](respondWithResult(_0x15c782,null))[_0xbbfa('0x27')](handleError(_0x15c782,null));};exports[_0xbbfa('0x33')]=function(_0x149011,_0x1fc0c8){return db[_0xbbfa('0x1f')][_0xbbfa('0x33')](_0x149011[_0xbbfa('0x34')],{})[_0xbbfa('0x16')](function(_0x9fc127){var _0x30e0f0=_0x149011['user'][_0xbbfa('0x18')]({'plain':!![]});if(!_0x30e0f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30e0f0[_0xbbfa('0x35')]===_0xbbfa('0x36')){var _0x24ea9a=_0x9fc127[_0xbbfa('0x18')]({'plain':!![]});var _0x2f44aa=_0xbbfa('0x19');return db[_0xbbfa('0x37')]['find']({'where':{'name':_0x2f44aa,'userProfileId':_0x30e0f0['userProfileId']},'raw':!![]})[_0xbbfa('0x16')](function(_0x38dba4){if(_0x38dba4&&_0x38dba4['autoAssociation']===0x0){return db[_0xbbfa('0x1a')][_0xbbfa('0x33')]({'name':_0x24ea9a[_0xbbfa('0x1c')],'resourceId':_0x24ea9a['id'],'type':_0x38dba4[_0xbbfa('0x1c')],'sectionId':_0x38dba4['id']},{})[_0xbbfa('0x16')](function(){return _0x9fc127;});}else{return _0x9fc127;}})[_0xbbfa('0x27')](function(_0x4255b0){logger['error'](_0xbbfa('0x38'),_0x4255b0);throw _0x4255b0;});}return _0x9fc127;})['then'](respondWithResult(_0x1fc0c8,0xc9))[_0xbbfa('0x27')](handleError(_0x1fc0c8,null));};exports[_0xbbfa('0x15')]=function(_0x185a27,_0xa2b9cb){if(_0x185a27[_0xbbfa('0x34')]['id']){delete _0x185a27[_0xbbfa('0x34')]['id'];}return db['WhatsappQueue']['find']({'where':{'id':_0x185a27[_0xbbfa('0x29')]['id']}})[_0xbbfa('0x16')](handleEntityNotFound(_0xa2b9cb,null))['then'](saveUpdates(_0x185a27[_0xbbfa('0x34')],null))[_0xbbfa('0x16')](respondWithResult(_0xa2b9cb,null))[_0xbbfa('0x27')](handleError(_0xa2b9cb,null));};exports[_0xbbfa('0x17')]=function(_0x3b895d,_0x5c30c4){return db[_0xbbfa('0x1f')][_0xbbfa('0x32')]({'where':{'id':_0x3b895d[_0xbbfa('0x29')]['id']}})[_0xbbfa('0x16')](handleEntityNotFound(_0x5c30c4,null))[_0xbbfa('0x16')](removeEntity(_0x5c30c4,null))[_0xbbfa('0x27')](handleError(_0x5c30c4,null));};exports[_0xbbfa('0x39')]=function(_0x551625,_0x1179e1){return db['WhatsappQueue']['describe']()[_0xbbfa('0x16')](respondWithResult(_0x1179e1,null))[_0xbbfa('0x27')](handleError(_0x1179e1,null));};exports['getMembers']=function(_0x5687f4,_0x565d8a){var _0x42f02b={'raw':!![],'where':{}},_0x1a5c6f={},_0x1cd544;return db[_0xbbfa('0x1f')][_0xbbfa('0x3a')]({'where':{'id':_0x5687f4[_0xbbfa('0x29')]['id']}})[_0xbbfa('0x16')](handleEntityNotFound(_0x565d8a,null))[_0xbbfa('0x16')](function(_0x2353c5){if(_0x2353c5){_0x1cd544=_0x2353c5[_0xbbfa('0x18')]({'plain':!![]});_0x1a5c6f['model']=_['keys'](db[_0xbbfa('0x3b')]['rawAttributes']);_0x1a5c6f[_0xbbfa('0x25')]=_[_0xbbfa('0x2b')](_0x5687f4[_0xbbfa('0x25')]);_0x1a5c6f[_0xbbfa('0x2c')]=_[_0xbbfa('0x2d')](_0x1a5c6f['model'],_0x1a5c6f[_0xbbfa('0x25')]);_0x42f02b[_0xbbfa('0x2e')]=_['intersection'](_0x1a5c6f[_0xbbfa('0x2a')],qs[_0xbbfa('0x2f')](_0x5687f4[_0xbbfa('0x25')][_0xbbfa('0x2f')]));_0x42f02b[_0xbbfa('0x2e')]=_0x42f02b[_0xbbfa('0x2e')]['length']?_0x42f02b[_0xbbfa('0x2e')]:_0x1a5c6f['model'];if(!_0x5687f4[_0xbbfa('0x25')]['hasOwnProperty'](_0xbbfa('0x3c'))){_0x42f02b[_0xbbfa('0xf')]=qs['limit'](_0x5687f4['query'][_0xbbfa('0xf')]);_0x42f02b[_0xbbfa('0x11')]=qs[_0xbbfa('0x11')](_0x5687f4[_0xbbfa('0x25')][_0xbbfa('0x11')]);}_0x42f02b[_0xbbfa('0x3d')]=qs[_0xbbfa('0x3e')](_0x5687f4[_0xbbfa('0x25')][_0xbbfa('0x3e')]);_0x42f02b['where']=qs[_0xbbfa('0x2c')](_['pick'](_0x5687f4[_0xbbfa('0x25')],_0x1a5c6f[_0xbbfa('0x2c')]));_0x42f02b[_0xbbfa('0x23')]['WhatsappQueueId']=_0x2353c5['id'];if(_0x5687f4[_0xbbfa('0x25')][_0xbbfa('0x3f')]){_0x42f02b['where']=_[_0xbbfa('0x31')](_0x42f02b[_0xbbfa('0x23')],{'$or':_['map'](_0x42f02b[_0xbbfa('0x2e')],function(_0xf09554){var _0x4a7198={};_0x4a7198[_0xf09554]={'$like':'%'+_0x5687f4[_0xbbfa('0x25')][_0xbbfa('0x3f')]+'%'};return _0x4a7198;})});}_0x42f02b=_[_0xbbfa('0x31')]({},_0x42f02b,_0x5687f4[_0xbbfa('0x40')]);return db[_0xbbfa('0x3b')]['findAll'](_0x42f02b);}})[_0xbbfa('0x16')](function(_0x1e6aee){if(_0x1e6aee){return db['User']['findAndCountAll']({'where':{'id':_[_0xbbfa('0x1e')](_0x1e6aee,_0xbbfa('0x41')),'role':_0xbbfa('0x42')},'attributes':['id',_0xbbfa('0x1c'),_0xbbfa('0x43'),_0xbbfa('0x44'),_0xbbfa('0x45')]});}})[_0xbbfa('0x16')](function(_0x38b081){if(_0x38b081){return{'count':_0x38b081[_0xbbfa('0x10')],'rows':_[_0xbbfa('0x1e')](_0x38b081[_0xbbfa('0x46')],function(_0x13708c){return{'membername':_0x13708c[_0xbbfa('0x1c')],'UserId':_0x13708c['id'],'queue_name':_0x1cd544[_0xbbfa('0x1c')],'WhatsappQueueId':_0x1cd544['id'],'interface':util[_0xbbfa('0x47')](_0xbbfa('0x48'),_0xbbfa('0x49'),_0x13708c['name']),'penalty':0x0,'paused':_0x13708c[_0xbbfa('0x43')],'createdAt':_0x13708c['createdAt'],'updatedAt':_0x13708c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x565d8a,_0x42f02b))[_0xbbfa('0x27')](handleError(_0x565d8a,null));};exports[_0xbbfa('0x4a')]=function(_0x7e3c65,_0xb126f1){var _0x3c97e2={};var _0x271993={};var _0x2c9d6b;var _0x47cf4d;return db['WhatsappQueue'][_0xbbfa('0x3a')]({'where':{'id':_0x7e3c65[_0xbbfa('0x29')]['id']}})['then'](handleEntityNotFound(_0xb126f1,null))[_0xbbfa('0x16')](function(_0x54dc3b){if(_0x54dc3b){_0x2c9d6b=_0x54dc3b;_0x271993['model']=_[_0xbbfa('0x2b')](db['Team'][_0xbbfa('0x20')]);_0x271993[_0xbbfa('0x25')]=_['keys'](_0x7e3c65[_0xbbfa('0x25')]);_0x271993[_0xbbfa('0x2c')]=_['intersection'](_0x271993['model'],_0x271993['query']);_0x3c97e2[_0xbbfa('0x2e')]=_[_0xbbfa('0x2d')](_0x271993[_0xbbfa('0x2a')],qs['fields'](_0x7e3c65['query'][_0xbbfa('0x2f')]));_0x3c97e2['attributes']=_0x3c97e2[_0xbbfa('0x2e')][_0xbbfa('0x4b')]?_0x3c97e2[_0xbbfa('0x2e')]:_0x271993[_0xbbfa('0x2a')];_0x3c97e2[_0xbbfa('0x3d')]=qs[_0xbbfa('0x3e')](_0x7e3c65[_0xbbfa('0x25')][_0xbbfa('0x3e')]);_0x3c97e2[_0xbbfa('0x23')]=qs[_0xbbfa('0x2c')](_['pick'](_0x7e3c65[_0xbbfa('0x25')],_0x271993[_0xbbfa('0x2c')]));if(_0x7e3c65[_0xbbfa('0x25')][_0xbbfa('0x3f')]){_0x3c97e2['where']=_[_0xbbfa('0x31')](_0x3c97e2[_0xbbfa('0x23')],{'$or':_[_0xbbfa('0x1e')](_0x3c97e2[_0xbbfa('0x2e')],function(_0x1445f9){var _0xa9110c={};_0xa9110c[_0x1445f9]={'$like':'%'+_0x7e3c65['query'][_0xbbfa('0x3f')]+'%'};return _0xa9110c;})});}_0x3c97e2=_[_0xbbfa('0x31')]({},_0x3c97e2,_0x7e3c65[_0xbbfa('0x40')]);return _0x2c9d6b[_0xbbfa('0x4a')](_0x3c97e2);}})[_0xbbfa('0x16')](function(_0x1478ab){if(_0x1478ab){_0x47cf4d=_0x1478ab[_0xbbfa('0x4b')];if(!_0x7e3c65[_0xbbfa('0x25')][_0xbbfa('0x4c')](_0xbbfa('0x3c'))){_0x3c97e2['limit']=qs[_0xbbfa('0xf')](_0x7e3c65[_0xbbfa('0x25')]['limit']);_0x3c97e2[_0xbbfa('0x11')]=qs['offset'](_0x7e3c65['query'][_0xbbfa('0x11')]);}return _0x2c9d6b[_0xbbfa('0x4a')](_0x3c97e2);}})[_0xbbfa('0x16')](function(_0x80f57){if(_0x80f57){return _0x80f57?{'count':_0x47cf4d,'rows':_0x80f57}:null;}})[_0xbbfa('0x16')](respondWithResult(_0xb126f1,null))[_0xbbfa('0x27')](handleError(_0xb126f1,null));};exports[_0xbbfa('0x4d')]=function(_0x51d87b,_0x4a78f7){var _0x4d52b8=_0x51d87b['body'][_0xbbfa('0x4e')];return db['Team'][_0xbbfa('0x26')]({'where':{'id':_0x4d52b8},'attributes':['id'],'include':[{'model':db[_0xbbfa('0x4f')],'as':_0xbbfa('0x50'),'attributes':['id',_0xbbfa('0x1c'),'online',_0xbbfa('0x51'),_0xbbfa('0x52')],'raw':!![]}]})[_0xbbfa('0x16')](function(_0x3e2762){if(_0x3e2762){var _0x2083ec=_[_0xbbfa('0x53')](_0x3e2762,function(_0x27d224){var _0x242f1c=_0x27d224['get']({'plain':!![]});return _0x242f1c[_0xbbfa('0x50')];});return db[_0xbbfa('0x1f')]['find']({'where':{'id':_0x51d87b['params']['id']}})[_0xbbfa('0x16')](function(_0x39f6b0){return db[_0xbbfa('0x54')][_0xbbfa('0x55')](function(_0x550be0){return _0x39f6b0[_0xbbfa('0x4d')](_0x4d52b8,{'transaction':_0x550be0})['then'](function(){return BPromise[_0xbbfa('0x56')](_0x2083ec,function(_0x392992){return db[_0xbbfa('0x3b')]['findOrCreate']({'where':{'UserId':_0x392992['id'],'WhatsappQueueId':_0x51d87b[_0xbbfa('0x29')]['id']},'transaction':_0x550be0});});})[_0xbbfa('0x16')](function(){_0x2083ec['forEach'](function(_0x1006a1){socket[_0xbbfa('0x57')](_0xbbfa('0x58'),{'UserId':_0x1006a1['id'],'WhatsappQueueId':_0x39f6b0['id']});});});});});}})[_0xbbfa('0x16')](respondWithStatusCode(_0x4a78f7,null))[_0xbbfa('0x27')](handleError(_0x4a78f7,null));};exports['removeTeams']=function(_0x43e0ce,_0x4b4d95){return db['Team'][_0xbbfa('0x26')]({'where':{'id':_0x43e0ce[_0xbbfa('0x25')][_0xbbfa('0x4e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbbfa('0x50'),'attributes':['id'],'raw':!![]}]})[_0xbbfa('0x16')](handleEntityNotFound(_0x4b4d95,null))['then'](function(_0x5da751){var _0x21b8c6=_['map'](_0x5da751,'id');var _0x1f416b=[];var _0x13ec10=[];var _0x1e4866=squel[_0xbbfa('0x59')]();_0x1e4866['field'](_0xbbfa('0x5a'))[_0xbbfa('0x5b')](_0xbbfa('0x5c'),'tq')['join'](_0xbbfa('0x5d'),'ut',_0xbbfa('0x5e'))[_0xbbfa('0x23')](_0xbbfa('0x5f'),_0x43e0ce[_0xbbfa('0x29')]['id']);for(var _0x52615d=0x0;_0x52615d<_0x5da751['length'];_0x52615d+=0x1){let _0x45d198=_0x5da751[_0x52615d];for(var _0x6aad14=0x0;_0x6aad14<_0x45d198['Agents']['length'];_0x6aad14+=0x1){let _0x4acd13=_0x45d198[_0xbbfa('0x50')][_0x6aad14];var _0x2f2290=_0x1e4866[_0xbbfa('0x60')]();_0x2f2290[_0xbbfa('0x23')](_0xbbfa('0x61'),_0x4acd13['id']);_0x13ec10[_0xbbfa('0x62')](db[_0xbbfa('0x54')][_0xbbfa('0x25')](_0x2f2290[_0xbbfa('0x63')](),{'type':db[_0xbbfa('0x54')][_0xbbfa('0x64')][_0xbbfa('0x65')]})[_0xbbfa('0x16')](function(_0x491301){if(_0x491301['length']===0x1){return _0x4acd13['id'];}else{var _0x2f837b=_[_0xbbfa('0x66')](_[_0xbbfa('0x1e')](_0x491301,_0xbbfa('0x67')),function(_0x19ce8d){return _[_0xbbfa('0x68')](_0x21b8c6,_0x19ce8d);});if(_0x2f837b){return _0x4acd13['id'];}}}));}}return BPromise['all'](_0x13ec10)['then'](function(_0x264bab){_0x1f416b=_(_0x1f416b)[_0xbbfa('0x69')](_0x264bab)[_0xbbfa('0x6a')]()['value']();return db[_0xbbfa('0x1f')][_0xbbfa('0x32')]({'where':{'id':_0x43e0ce[_0xbbfa('0x29')]['id']}})['then'](function(_0x497a23){return db[_0xbbfa('0x54')]['transaction'](function(_0x1fb607){return _0x497a23[_0xbbfa('0x6b')](_0x43e0ce['query'][_0xbbfa('0x4e')],{'transaction':_0x1fb607})[_0xbbfa('0x16')](function(){if(!_[_0xbbfa('0x6c')](_0x1f416b)){return _0x497a23[_0xbbfa('0x6d')](_0x1f416b,{'transaction':_0x1fb607});}})[_0xbbfa('0x16')](function(){_0x1f416b[_0xbbfa('0x6e')](function(_0x3c2175){socket[_0xbbfa('0x57')](_0xbbfa('0x6f'),{'UserId':_0x3c2175,'WhatsappQueueId':_0x497a23['id']});});});});});});})[_0xbbfa('0x16')](respondWithStatusCode(_0x4b4d95,null))['catch'](handleError(_0x4b4d95,null));};exports[_0xbbfa('0x70')]=function(_0x3fca84,_0x1a31dd){return db['WhatsappQueue']['find']({'where':{'id':_0x3fca84[_0xbbfa('0x29')]['id']}})['then'](handleEntityNotFound(_0x1a31dd,null))[_0xbbfa('0x16')](function(_0x294381){if(_0x294381){return _0x294381[_0xbbfa('0x70')](_0x3fca84['body'][_0xbbfa('0x4e')],_[_0xbbfa('0x71')](_0x3fca84[_0xbbfa('0x34')],['ids','id'])||{})[_0xbbfa('0x72')](function(_0x1c2d68){for(var _0x4262fa=0x0;_0x4262fa<_0x3fca84[_0xbbfa('0x34')][_0xbbfa('0x4e')][_0xbbfa('0x4b')];_0x4262fa+=0x1){socket[_0xbbfa('0x57')](_0xbbfa('0x58'),{'UserId':Number(_0x3fca84['body'][_0xbbfa('0x4e')][_0x4262fa]),'WhatsappQueueId':Number(_0x3fca84[_0xbbfa('0x29')]['id'])});}return _0x1c2d68;});}})['then'](respondWithResult(_0x1a31dd,null))[_0xbbfa('0x27')](handleError(_0x1a31dd,null));};exports['removeAgents']=function(_0x4e6dac,_0x126c88){return db[_0xbbfa('0x1f')][_0xbbfa('0x32')]({'where':{'id':_0x4e6dac[_0xbbfa('0x29')]['id']}})[_0xbbfa('0x16')](handleEntityNotFound(_0x126c88,null))[_0xbbfa('0x16')](function(_0x3906a){if(_0x3906a){return _0x3906a[_0xbbfa('0x6d')](_0x4e6dac[_0xbbfa('0x25')][_0xbbfa('0x4e')])[_0xbbfa('0x16')](function(){if(_[_0xbbfa('0x73')](_0x4e6dac[_0xbbfa('0x25')]['ids'])){for(var _0x5d85ad=0x0;_0x5d85ad<_0x4e6dac['query'][_0xbbfa('0x4e')]['length'];_0x5d85ad+=0x1){socket[_0xbbfa('0x57')](_0xbbfa('0x6f'),{'UserId':Number(_0x4e6dac['query']['ids'][_0x5d85ad]),'WhatsappQueueId':Number(_0x4e6dac[_0xbbfa('0x29')]['id'])});}}else{socket[_0xbbfa('0x57')](_0xbbfa('0x6f'),{'UserId':Number(_0x4e6dac[_0xbbfa('0x25')][_0xbbfa('0x4e')]),'WhatsappQueueId':Number(_0x4e6dac[_0xbbfa('0x29')]['id'])});}});}})[_0xbbfa('0x16')](respondWithStatusCode(_0x126c88,null))[_0xbbfa('0x27')](handleError(_0x126c88,null));};exports[_0xbbfa('0x74')]=function(_0x12ab9e,_0x265f41){var _0x366879={};var _0x5a3302={};var _0x4a5f04;var _0x41d7de;return db[_0xbbfa('0x1f')][_0xbbfa('0x3a')]({'where':{'id':_0x12ab9e['params']['id']}})[_0xbbfa('0x16')](handleEntityNotFound(_0x265f41,null))['then'](function(_0xccb406){if(_0xccb406){_0x4a5f04=_0xccb406;_0x5a3302[_0xbbfa('0x2a')]=_[_0xbbfa('0x2b')](db[_0xbbfa('0x4f')][_0xbbfa('0x20')]);_0x5a3302[_0xbbfa('0x25')]=_[_0xbbfa('0x2b')](_0x12ab9e[_0xbbfa('0x25')]);_0x5a3302['filters']=_['intersection'](_0x5a3302['model'],_0x5a3302[_0xbbfa('0x25')]);_0x366879[_0xbbfa('0x2e')]=_[_0xbbfa('0x2d')](_0x5a3302[_0xbbfa('0x2a')],qs[_0xbbfa('0x2f')](_0x12ab9e[_0xbbfa('0x25')][_0xbbfa('0x2f')]));_0x366879[_0xbbfa('0x2e')]=_0x366879['attributes'][_0xbbfa('0x4b')]?_0x366879[_0xbbfa('0x2e')]:_0x5a3302[_0xbbfa('0x2a')];_0x366879[_0xbbfa('0x3d')]=qs[_0xbbfa('0x3e')](_0x12ab9e[_0xbbfa('0x25')][_0xbbfa('0x3e')]);_0x366879[_0xbbfa('0x23')]=qs[_0xbbfa('0x2c')](_[_0xbbfa('0x75')](_0x12ab9e['query'],_0x5a3302[_0xbbfa('0x2c')]));if(_0x12ab9e[_0xbbfa('0x25')][_0xbbfa('0x3f')]){_0x366879[_0xbbfa('0x23')]=_[_0xbbfa('0x31')](_0x366879[_0xbbfa('0x23')],{'$or':_['map'](_0x366879[_0xbbfa('0x2e')],function(_0x13b001){var _0x22e841={};_0x22e841[_0x13b001]={'$like':'%'+_0x12ab9e['query'][_0xbbfa('0x3f')]+'%'};return _0x22e841;})});}_0x366879=_[_0xbbfa('0x31')]({},_0x366879,_0x12ab9e[_0xbbfa('0x40')]);return _0x4a5f04['getAgents'](_0x366879);}})[_0xbbfa('0x16')](function(_0x4c8c11){if(_0x4c8c11){_0x41d7de=_0x4c8c11[_0xbbfa('0x4b')];if(!_0x12ab9e[_0xbbfa('0x25')][_0xbbfa('0x4c')](_0xbbfa('0x3c'))){_0x366879['limit']=qs['limit'](_0x12ab9e[_0xbbfa('0x25')][_0xbbfa('0xf')]);_0x366879[_0xbbfa('0x11')]=qs[_0xbbfa('0x11')](_0x12ab9e[_0xbbfa('0x25')][_0xbbfa('0x11')]);}return _0x4a5f04[_0xbbfa('0x74')](_0x366879);}})[_0xbbfa('0x16')](function(_0xf5b62d){if(_0xf5b62d){return _0xf5b62d?{'count':_0x41d7de,'rows':_0xf5b62d}:null;}})['then'](respondWithResult(_0x265f41,null))['catch'](handleError(_0x265f41,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 3ee0aef..d185a0a 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 _0x60c4=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','remove'];(function(_0x293ab9,_0x4d3d62){var _0x55a235=function(_0x10a9fe){while(--_0x10a9fe){_0x293ab9['push'](_0x293ab9['shift']());}};_0x55a235(++_0x4d3d62);}(_0x60c4,0x194));var _0x460c=function(_0x53dc28,_0x7b5ea){_0x53dc28=_0x53dc28-0x0;var _0x12b34e=_0x60c4[_0x53dc28];return _0x12b34e;};'use strict';var EventEmitter=require(_0x460c('0x0'));var WhatsappQueue=require(_0x460c('0x1'))['db'][_0x460c('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x460c('0x3')](0x0);var events={'afterCreate':_0x460c('0x4'),'afterUpdate':'update','afterDestroy':_0x460c('0x5')};function emitEvent(_0x26708c){return function(_0x545e95,_0x100c8c,_0x347ea1){WhatsappQueueEvents[_0x460c('0x6')](_0x26708c+':'+_0x545e95['id'],_0x545e95);WhatsappQueueEvents[_0x460c('0x6')](_0x26708c,_0x545e95);_0x347ea1(null);};}for(var e in events){if(events[_0x460c('0x7')](e)){var event=events[e];WhatsappQueue[_0x460c('0x8')](e,emitEvent(event));}}module[_0x460c('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0xc128=['hook','exports','WhatsappQueue','setMaxListeners','save','emit'];(function(_0x350182,_0x2a9feb){var _0x4a0892=function(_0x2c994d){while(--_0x2c994d){_0x350182['push'](_0x350182['shift']());}};_0x4a0892(++_0x2a9feb);}(_0xc128,0x1d6));var _0x8c12=function(_0x181384,_0x31b344){_0x181384=_0x181384-0x0;var _0x37b1e0=_0xc128[_0x181384];return _0x37b1e0;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x8c12('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8c12('0x1')](0x0);var events={'afterCreate':_0x8c12('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x403b95){return function(_0x5c349b,_0x316ee8,_0x4ce50e){WhatsappQueueEvents['emit'](_0x403b95+':'+_0x5c349b['id'],_0x5c349b);WhatsappQueueEvents[_0x8c12('0x3')](_0x403b95,_0x5c349b);_0x4ce50e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x8c12('0x4')](e,emitEvent(event));}}module[_0x8c12('0x5')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 117cd29..f7b7e3c 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 _0x5669=['rimraf','../../config/environment','define','whatsapp_queues','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x5669,0x19e));var _0x9566=function(_0x9388c8,_0x2cdf84){_0x9388c8=_0x9388c8-0x0;var _0x6f1d3a=_0x5669[_0x9388c8];return _0x6f1d3a;};'use strict';var _=require(_0x9566('0x0'));var util=require(_0x9566('0x1'));var logger=require(_0x9566('0x2'))('api');var moment=require(_0x9566('0x3'));var BPromise=require('bluebird');var rp=require(_0x9566('0x4'));var fs=require('fs');var path=require(_0x9566('0x5'));var rimraf=require(_0x9566('0x6'));var config=require(_0x9566('0x7'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x383a4e,_0x4bcf7b){return _0x383a4e[_0x9566('0x8')]('WhatsappQueue',attributes,{'tableName':_0x9566('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf981=['define','WhatsappQueue','whatsapp_queues','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2c0dc0,_0x19900d){var _0x4c0990=function(_0x530791){while(--_0x530791){_0x2c0dc0['push'](_0x2c0dc0['shift']());}};_0x4c0990(++_0x19900d);}(_0xf981,0x177));var _0x1f98=function(_0x2f5bfa,_0x3f590b){_0x2f5bfa=_0x2f5bfa-0x0;var _0x25449c=_0xf981[_0x2f5bfa];return _0x25449c;};'use strict';var _=require(_0x1f98('0x0'));var util=require(_0x1f98('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1f98('0x2'));var BPromise=require(_0x1f98('0x3'));var rp=require(_0x1f98('0x4'));var fs=require('fs');var path=require(_0x1f98('0x5'));var rimraf=require(_0x1f98('0x6'));var config=require(_0x1f98('0x7'));var attributes=require('./whatsappQueue.attributes');module[_0x1f98('0x8')]=function(_0x5c52d9,_0x3c7441){return _0x5c52d9[_0x1f98('0x9')](_0x1f98('0xa'),attributes,{'tableName':_0x1f98('0xb'),'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 315f2dd..d1a8165 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 _0x29dd=['model','then','ShowWhatsappQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetWhatsappQueue','findAll','options','where','attributes','limit','include','map'];(function(_0x4258c0,_0x338808){var _0x458113=function(_0x1734c7){while(--_0x1734c7){_0x4258c0['push'](_0x4258c0['shift']());}};_0x458113(++_0x338808);}(_0x29dd,0x1f2));var _0xd29d=function(_0x3ed1b6,_0x21927f){_0x3ed1b6=_0x3ed1b6-0x0;var _0x43f4f1=_0x29dd[_0x3ed1b6];return _0x43f4f1;};'use strict';var _=require('lodash');var util=require(_0xd29d('0x0'));var moment=require(_0xd29d('0x1'));var BPromise=require(_0xd29d('0x2'));var rs=require(_0xd29d('0x3'));var fs=require('fs');var Redis=require(_0xd29d('0x4'));var db=require(_0xd29d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd29d('0x6'))(_0xd29d('0x7'));var config=require('../../config/environment');var jayson=require(_0xd29d('0x8'));var client=jayson[_0xd29d('0x9')]['http']({'port':0x232a});config[_0xd29d('0xa')]=_[_0xd29d('0xb')](config[_0xd29d('0xa')],{'host':_0xd29d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd29d('0xa')]));require(_0xd29d('0xd'))[_0xd29d('0xe')](socket);function respondWithRpcPromise(_0x4ebb0d,_0x3e9be6,_0x2af8c0){return new BPromise(function(_0x1a394d,_0x189623){return client[_0xd29d('0xf')](_0x4ebb0d,_0x2af8c0)['then'](function(_0x308da4){logger[_0xd29d('0x10')](_0xd29d('0x11'),_0x3e9be6,_0xd29d('0x12'));logger[_0xd29d('0x13')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x3e9be6,_0xd29d('0x12'),JSON[_0xd29d('0x14')](_0x308da4));if(_0x308da4[_0xd29d('0x15')]){if(_0x308da4['error'][_0xd29d('0x16')]===0x1f4){logger[_0xd29d('0x15')](_0xd29d('0x11'),_0x3e9be6,_0x308da4[_0xd29d('0x15')]['message']);return _0x189623(_0x308da4[_0xd29d('0x15')][_0xd29d('0x17')]);}logger[_0xd29d('0x15')](_0xd29d('0x11'),_0x3e9be6,_0x308da4[_0xd29d('0x15')][_0xd29d('0x17')]);return _0x1a394d(_0x308da4[_0xd29d('0x15')]['message']);}else{logger[_0xd29d('0x10')](_0xd29d('0x11'),_0x3e9be6,_0xd29d('0x12'));_0x1a394d(_0x308da4[_0xd29d('0x18')][_0xd29d('0x17')]);}})[_0xd29d('0x19')](function(_0x5c74d9){logger[_0xd29d('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x3e9be6,_0x5c74d9);_0x189623(_0x5c74d9);});});}exports[_0xd29d('0x1a')]=function(_0x14ade0){var _0x19dba3=this;return new Promise(function(_0x436af6,_0x3b5a9f){return db['WhatsappQueue'][_0xd29d('0x1b')]({'raw':_0x14ade0['options']?_0x14ade0[_0xd29d('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x14ade0[_0xd29d('0x1c')]?_0x14ade0['options'][_0xd29d('0x1d')]||null:null,'attributes':_0x14ade0[_0xd29d('0x1c')]?_0x14ade0[_0xd29d('0x1c')][_0xd29d('0x1e')]||null:null,'limit':_0x14ade0[_0xd29d('0x1c')]?_0x14ade0['options'][_0xd29d('0x1f')]||null:null,'include':_0x14ade0[_0xd29d('0x1c')]?_0x14ade0[_0xd29d('0x1c')][_0xd29d('0x20')]?_[_0xd29d('0x21')](_0x14ade0['options'][_0xd29d('0x20')],function(_0x2745e3){return{'model':db[_0x2745e3[_0xd29d('0x22')]],'as':_0x2745e3['as'],'attributes':_0x2745e3[_0xd29d('0x1e')],'include':_0x2745e3[_0xd29d('0x20')]?_['map'](_0x2745e3[_0xd29d('0x20')],function(_0x1d455b){return{'model':db[_0x1d455b[_0xd29d('0x22')]],'as':_0x1d455b['as'],'attributes':_0x1d455b['attributes'],'include':_0x1d455b[_0xd29d('0x20')]?_[_0xd29d('0x21')](_0x1d455b['include'],function(_0x377b3f){return{'model':db[_0x377b3f[_0xd29d('0x22')]],'as':_0x377b3f['as'],'attributes':_0x377b3f[_0xd29d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd29d('0x23')](function(_0x241369){logger[_0xd29d('0x10')](_0xd29d('0x1a'),_0x14ade0);logger[_0xd29d('0x13')](_0xd29d('0x1a'),_0x14ade0,JSON['stringify'](_0x241369));_0x436af6(_0x241369);})['catch'](function(_0x5d2a06){logger[_0xd29d('0x15')]('GetWhatsappQueue',_0x5d2a06[_0xd29d('0x17')],_0x14ade0);_0x3b5a9f(_0x19dba3['error'](0x1f4,_0x5d2a06['message']));});});};exports[_0xd29d('0x24')]=function(_0x142c86){var _0x240533=this;return new Promise(function(_0x1a7976,_0x3769d6){return db['WhatsappQueue'][_0xd29d('0x25')]({'raw':_0x142c86['options']?_0x142c86[_0xd29d('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x142c86[_0xd29d('0x1c')]?_0x142c86[_0xd29d('0x1c')][_0xd29d('0x1d')]||null:null,'attributes':_0x142c86['options']?_0x142c86['options'][_0xd29d('0x1e')]||null:null,'include':_0x142c86[_0xd29d('0x1c')]?_0x142c86[_0xd29d('0x1c')]['include']?_['map'](_0x142c86[_0xd29d('0x1c')][_0xd29d('0x20')],function(_0x5e989c){return{'model':db[_0x5e989c[_0xd29d('0x22')]],'as':_0x5e989c['as'],'attributes':_0x5e989c['attributes'],'include':_0x5e989c[_0xd29d('0x20')]?_['map'](_0x5e989c['include'],function(_0x5337b1){return{'model':db[_0x5337b1[_0xd29d('0x22')]],'as':_0x5337b1['as'],'attributes':_0x5337b1[_0xd29d('0x1e')],'include':_0x5337b1[_0xd29d('0x20')]?_[_0xd29d('0x21')](_0x5337b1[_0xd29d('0x20')],function(_0x5588f6){return{'model':db[_0x5588f6[_0xd29d('0x22')]],'as':_0x5588f6['as'],'attributes':_0x5588f6[_0xd29d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd29d('0x23')](function(_0x245f4d){logger[_0xd29d('0x10')](_0xd29d('0x24'),_0x142c86);logger['debug'](_0xd29d('0x24'),_0x142c86,JSON[_0xd29d('0x14')](_0x245f4d));_0x1a7976(_0x245f4d);})[_0xd29d('0x19')](function(_0xe02ad0){logger['error']('ShowWhatsappQueue',_0xe02ad0['message'],_0x142c86);_0x3769d6(_0x240533[_0xd29d('0x15')](0x1f4,_0xe02ad0['message']));});});}; \ No newline at end of file +var _0x8836=['defaults','localhost','socket.io-emitter','register','request','then','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','info','result','catch','WhatsappQueue','options','raw','where','map','include','model','attributes','GetWhatsappQueue','debug','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8836,0x93));var _0x6883=function(_0x278e33,_0x5f3d85){_0x278e33=_0x278e33-0x0;var _0x35089e=_0x8836[_0x278e33];return _0x35089e;};'use strict';var _=require(_0x6883('0x0'));var util=require(_0x6883('0x1'));var moment=require(_0x6883('0x2'));var BPromise=require(_0x6883('0x3'));var rs=require(_0x6883('0x4'));var fs=require('fs');var Redis=require(_0x6883('0x5'));var db=require(_0x6883('0x6'))['db'];var utils=require(_0x6883('0x7'));var logger=require(_0x6883('0x8'))('rpc');var config=require(_0x6883('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6883('0xa')][_0x6883('0xb')]({'port':0x232a});config[_0x6883('0xc')]=_[_0x6883('0xd')](config['redis'],{'host':_0x6883('0xe'),'port':0x18eb});var socket=require(_0x6883('0xf'))(new Redis(config[_0x6883('0xc')]));require('./whatsappQueue.socket')[_0x6883('0x10')](socket);function respondWithRpcPromise(_0x3df4f0,_0x42e511,_0x18bc1){return new BPromise(function(_0x23c974,_0x1045f0){return client[_0x6883('0x11')](_0x3df4f0,_0x18bc1)[_0x6883('0x12')](function(_0x103069){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x42e511,'request\x20sent');logger['debug'](_0x6883('0x13'),_0x42e511,_0x6883('0x14'),JSON[_0x6883('0x15')](_0x103069));if(_0x103069[_0x6883('0x16')]){if(_0x103069['error'][_0x6883('0x17')]===0x1f4){logger['error'](_0x6883('0x18'),_0x42e511,_0x103069[_0x6883('0x16')]['message']);return _0x1045f0(_0x103069['error'][_0x6883('0x19')]);}logger[_0x6883('0x16')](_0x6883('0x18'),_0x42e511,_0x103069[_0x6883('0x16')][_0x6883('0x19')]);return _0x23c974(_0x103069[_0x6883('0x16')][_0x6883('0x19')]);}else{logger[_0x6883('0x1a')](_0x6883('0x18'),_0x42e511,_0x6883('0x14'));_0x23c974(_0x103069[_0x6883('0x1b')][_0x6883('0x19')]);}})[_0x6883('0x1c')](function(_0x58b69c){logger[_0x6883('0x16')](_0x6883('0x18'),_0x42e511,_0x58b69c);_0x1045f0(_0x58b69c);});});}exports['GetWhatsappQueue']=function(_0x5d651d){var _0x2b2404=this;return new Promise(function(_0x260fa1,_0x102342){return db[_0x6883('0x1d')]['findAll']({'raw':_0x5d651d[_0x6883('0x1e')]?_0x5d651d[_0x6883('0x1e')][_0x6883('0x1f')]===undefined?!![]:![]:!![],'where':_0x5d651d[_0x6883('0x1e')]?_0x5d651d[_0x6883('0x1e')][_0x6883('0x20')]||null:null,'attributes':_0x5d651d[_0x6883('0x1e')]?_0x5d651d['options']['attributes']||null:null,'limit':_0x5d651d['options']?_0x5d651d[_0x6883('0x1e')]['limit']||null:null,'include':_0x5d651d[_0x6883('0x1e')]?_0x5d651d[_0x6883('0x1e')]['include']?_[_0x6883('0x21')](_0x5d651d[_0x6883('0x1e')][_0x6883('0x22')],function(_0x15714a){return{'model':db[_0x15714a[_0x6883('0x23')]],'as':_0x15714a['as'],'attributes':_0x15714a[_0x6883('0x24')],'include':_0x15714a[_0x6883('0x22')]?_[_0x6883('0x21')](_0x15714a[_0x6883('0x22')],function(_0x40c396){return{'model':db[_0x40c396[_0x6883('0x23')]],'as':_0x40c396['as'],'attributes':_0x40c396[_0x6883('0x24')],'include':_0x40c396[_0x6883('0x22')]?_[_0x6883('0x21')](_0x40c396[_0x6883('0x22')],function(_0x4dbef6){return{'model':db[_0x4dbef6[_0x6883('0x23')]],'as':_0x4dbef6['as'],'attributes':_0x4dbef6[_0x6883('0x24')]};}):[]};}):[]};}):[]:[]})[_0x6883('0x12')](function(_0x3ce50c){logger[_0x6883('0x1a')](_0x6883('0x25'),_0x5d651d);logger[_0x6883('0x26')](_0x6883('0x25'),_0x5d651d,JSON[_0x6883('0x15')](_0x3ce50c));_0x260fa1(_0x3ce50c);})[_0x6883('0x1c')](function(_0x435a04){logger[_0x6883('0x16')]('GetWhatsappQueue',_0x435a04['message'],_0x5d651d);_0x102342(_0x2b2404[_0x6883('0x16')](0x1f4,_0x435a04[_0x6883('0x19')]));});});};exports[_0x6883('0x27')]=function(_0x23a105){var _0x6f4bde=this;return new Promise(function(_0x3b3d19,_0x232aa7){return db['WhatsappQueue']['find']({'raw':_0x23a105[_0x6883('0x1e')]?_0x23a105[_0x6883('0x1e')][_0x6883('0x1f')]===undefined?!![]:![]:!![],'where':_0x23a105[_0x6883('0x1e')]?_0x23a105[_0x6883('0x1e')][_0x6883('0x20')]||null:null,'attributes':_0x23a105['options']?_0x23a105[_0x6883('0x1e')][_0x6883('0x24')]||null:null,'include':_0x23a105[_0x6883('0x1e')]?_0x23a105[_0x6883('0x1e')]['include']?_[_0x6883('0x21')](_0x23a105['options']['include'],function(_0x42f459){return{'model':db[_0x42f459['model']],'as':_0x42f459['as'],'attributes':_0x42f459[_0x6883('0x24')],'include':_0x42f459['include']?_[_0x6883('0x21')](_0x42f459['include'],function(_0x31e86a){return{'model':db[_0x31e86a[_0x6883('0x23')]],'as':_0x31e86a['as'],'attributes':_0x31e86a['attributes'],'include':_0x31e86a[_0x6883('0x22')]?_[_0x6883('0x21')](_0x31e86a[_0x6883('0x22')],function(_0xe3ba67){return{'model':db[_0xe3ba67[_0x6883('0x23')]],'as':_0xe3ba67['as'],'attributes':_0xe3ba67[_0x6883('0x24')]};}):[]};}):[]};}):[]:[]})[_0x6883('0x12')](function(_0x564bd5){logger[_0x6883('0x1a')](_0x6883('0x27'),_0x23a105);logger[_0x6883('0x26')](_0x6883('0x27'),_0x23a105,JSON[_0x6883('0x15')](_0x564bd5));_0x3b3d19(_0x564bd5);})[_0x6883('0x1c')](function(_0x2ec22d){logger[_0x6883('0x16')](_0x6883('0x27'),_0x2ec22d[_0x6883('0x19')],_0x23a105);_0x232aa7(_0x6f4bde[_0x6883('0x16')](0x1f4,_0x2ec22d['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 19bf6b6..facedac 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 _0xf59f=['length','whatsappQueue:','./whatsappQueue.events','save','update','emit','removeListener','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf59f,0xda));var _0xff59=function(_0x1d27ee,_0x43f228){_0x1d27ee=_0x1d27ee-0x0;var _0x4ed9b5=_0xf59f[_0x1d27ee];return _0x4ed9b5;};'use strict';var WhatsappQueueEvents=require(_0xff59('0x0'));var events=[_0xff59('0x1'),'remove',_0xff59('0x2')];function createListener(_0x5bc817,_0x3d802b){return function(_0x4e6e5b){_0x3d802b[_0xff59('0x3')](_0x5bc817,_0x4e6e5b);};}function removeListener(_0x1bc277,_0x566360){return function(){WhatsappQueueEvents[_0xff59('0x4')](_0x1bc277,_0x566360);};}exports[_0xff59('0x5')]=function(_0x22f2d9){for(var _0xdd4aa1=0x0,_0x3103c7=events[_0xff59('0x6')];_0xdd4aa1<_0x3103c7;_0xdd4aa1++){var _0x2a352b=events[_0xdd4aa1];var _0x304991=createListener(_0xff59('0x7')+_0x2a352b,_0x22f2d9);WhatsappQueueEvents['on'](_0x2a352b,_0x304991);}}; \ No newline at end of file +var _0x8acc=['length','whatsappQueue:','./whatsappQueue.events','remove','update','removeListener','register'];(function(_0x31c6ca,_0x5b37b3){var _0x1b5088=function(_0x3c840b){while(--_0x3c840b){_0x31c6ca['push'](_0x31c6ca['shift']());}};_0x1b5088(++_0x5b37b3);}(_0x8acc,0xa3));var _0xc8ac=function(_0x3c2567,_0x31b78e){_0x3c2567=_0x3c2567-0x0;var _0x4ba02e=_0x8acc[_0x3c2567];return _0x4ba02e;};'use strict';var WhatsappQueueEvents=require(_0xc8ac('0x0'));var events=['save',_0xc8ac('0x1'),_0xc8ac('0x2')];function createListener(_0x2a22a0,_0x322a7d){return function(_0x9ef3cb){_0x322a7d['emit'](_0x2a22a0,_0x9ef3cb);};}function removeListener(_0x281f6f,_0x2d5694){return function(){WhatsappQueueEvents[_0xc8ac('0x3')](_0x281f6f,_0x2d5694);};}exports[_0xc8ac('0x4')]=function(_0x271f78){for(var _0x20fba2=0x0,_0x5a1be2=events[_0xc8ac('0x5')];_0x20fba2<_0x5a1be2;_0x20fba2++){var _0x14d8b6=events[_0x20fba2];var _0x38db96=createListener(_0xc8ac('0x6')+_0x14d8b6,_0x271f78);WhatsappQueueEvents['on'](_0x14d8b6,_0x38db96);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 9a7438f..1a3c96b 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 _0xce3e=['index','/describe','/:id','isAuthenticated','show','post','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get'];(function(_0x1a9c88,_0x35de4d){var _0x56329c=function(_0x4affa9){while(--_0x4affa9){_0x1a9c88['push'](_0x1a9c88['shift']());}};_0x56329c(++_0x35de4d);}(_0xce3e,0x13b));var _0xece3=function(_0xbeb0e4,_0x204d46){_0xbeb0e4=_0xbeb0e4-0x0;var _0x3783e5=_0xce3e[_0xbeb0e4];return _0x3783e5;};'use strict';var multer=require(_0xece3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xece3('0x1'));var express=require(_0xece3('0x2'));var router=express[_0xece3('0x3')]();var fs_extra=require(_0xece3('0x4'));var auth=require(_0xece3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xece3('0x6'));var controller=require(_0xece3('0x7'));router[_0xece3('0x8')]('/',auth['isAuthenticated'](),controller[_0xece3('0x9')]);router[_0xece3('0x8')](_0xece3('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xece3('0xb'),auth[_0xece3('0xc')](),controller[_0xece3('0xd')]);router[_0xece3('0xe')]('/',auth[_0xece3('0xc')](),controller['create']);router['put']('/:id',auth[_0xece3('0xc')](),controller[_0xece3('0xf')]);router['delete'](_0xece3('0xb'),auth[_0xece3('0xc')](),controller[_0xece3('0x10')]);module[_0xece3('0x11')]=router; \ No newline at end of file +var _0xb0e3=['describe','/:id','show','post','isAuthenticated','create','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe'];(function(_0x38c43b,_0x5baacd){var _0x322dfb=function(_0x56b68e){while(--_0x56b68e){_0x38c43b['push'](_0x38c43b['shift']());}};_0x322dfb(++_0x5baacd);}(_0xb0e3,0x1c3));var _0x3b0e=function(_0x47df7d,_0x47c809){_0x47df7d=_0x47df7d-0x0;var _0x1ef4d2=_0xb0e3[_0x47df7d];return _0x1ef4d2;};'use strict';var multer=require(_0x3b0e('0x0'));var util=require('util');var path=require(_0x3b0e('0x1'));var timeout=require(_0x3b0e('0x2'));var express=require('express');var router=express[_0x3b0e('0x3')]();var fs_extra=require(_0x3b0e('0x4'));var auth=require(_0x3b0e('0x5'));var interaction=require(_0x3b0e('0x6'));var config=require(_0x3b0e('0x7'));var controller=require('./whatsappQueueReport.controller');router[_0x3b0e('0x8')]('/',auth['isAuthenticated'](),controller[_0x3b0e('0x9')]);router[_0x3b0e('0x8')](_0x3b0e('0xa'),auth['isAuthenticated'](),controller[_0x3b0e('0xb')]);router[_0x3b0e('0x8')](_0x3b0e('0xc'),auth['isAuthenticated'](),controller[_0x3b0e('0xd')]);router[_0x3b0e('0xe')]('/',auth[_0x3b0e('0xf')](),controller[_0x3b0e('0x10')]);router[_0x3b0e('0x11')](_0x3b0e('0xc'),auth[_0x3b0e('0xf')](),controller['update']);router[_0x3b0e('0x12')](_0x3b0e('0xc'),auth[_0x3b0e('0xf')](),controller[_0x3b0e('0x13')]);module[_0x3b0e('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 2f84f10..75d8e2c 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x6dccb8,_0x3e0466){var _0xe8bb25=function(_0x5a842e){while(--_0x5a842e){_0x6dccb8['push'](_0x6dccb8['shift']());}};_0xe8bb25(++_0x3e0466);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0xda13c3,_0x27e6ac){var _0x5bcda8=function(_0x19c14b){while(--_0x19c14b){_0xda13c3['push'](_0xda13c3['shift']());}};_0x5bcda8(++_0x27e6ac);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 1f22858..9e7572b 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c00=['fields','length','nolimit','offset','order','sort','pick','type','VIRTUAL','filter','options','where','then','include','findAll','rows','catch','show','params','keys','includeAll','merge','create','body','find','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','update','destroy','error','stack','name','index','map','WhatsappQueueReport','rawAttributes','key','model','query','filters','intersection','attributes'];(function(_0x19ec36,_0x488837){var _0x105202=function(_0x13497e){while(--_0x13497e){_0x19ec36['push'](_0x19ec36['shift']());}};_0x105202(++_0x488837);}(_0x9c00,0x1a0));var _0x09c0=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0x9c00[_0x10852d];return _0x13a8d6;};'use strict';var emlformat=require(_0x09c0('0x0'));var rimraf=require(_0x09c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09c0('0x2'));var moment=require(_0x09c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x09c0('0x4'));var util=require(_0x09c0('0x5'));var path=require(_0x09c0('0x6'));var sox=require(_0x09c0('0x7'));var csv=require(_0x09c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var as=require(_0x09c0('0x13'));var hardwareService=require(_0x09c0('0x14'));var logger=require(_0x09c0('0x15'))(_0x09c0('0x16'));var utils=require(_0x09c0('0x17'));var config=require(_0x09c0('0x18'));var licenseUtil=require(_0x09c0('0x19'));var db=require(_0x09c0('0x1a'))['db'];function respondWithStatusCode(_0x144271,_0x3b95cc){_0x3b95cc=_0x3b95cc||0xcc;return function(_0x331905){if(_0x331905){return _0x144271[_0x09c0('0x1b')](_0x3b95cc);}return _0x144271[_0x09c0('0x1c')](_0x3b95cc)[_0x09c0('0x1d')]();};}function respondWithResult(_0x3649d2,_0x16e490){_0x16e490=_0x16e490||0xc8;return function(_0x254598){if(_0x254598){return _0x3649d2[_0x09c0('0x1c')](_0x16e490)[_0x09c0('0x1e')](_0x254598);}};}function respondWithFilteredResult(_0x33c3d6,_0x2fdf11){return function(_0x4ff6b7){if(_0x4ff6b7){var _0x590129=typeof _0x2fdf11['offset']===_0x09c0('0x1f')&&typeof _0x2fdf11[_0x09c0('0x20')]===_0x09c0('0x1f');var _0x628272=_0x4ff6b7['count'];var _0x2c4440=_0x590129?0x0:_0x2fdf11['offset'];var _0x4c29a7=_0x590129?_0x4ff6b7[_0x09c0('0x21')]:_0x2fdf11['offset']+_0x2fdf11[_0x09c0('0x20')];var _0x319c36;if(_0x4c29a7>=_0x628272){_0x4c29a7=_0x628272;_0x319c36=0xc8;}else{_0x319c36=0xce;}_0x33c3d6[_0x09c0('0x1c')](_0x319c36);return _0x33c3d6['set'](_0x09c0('0x22'),_0x2c4440+'-'+_0x4c29a7+'/'+_0x628272)[_0x09c0('0x1e')](_0x4ff6b7);}return null;};}function patchUpdates(_0x8ad645){return function(_0x3447c5){try{jsonpatch[_0x09c0('0x23')](_0x3447c5,_0x8ad645,!![]);}catch(_0xa5d16f){return BPromise[_0x09c0('0x24')](_0xa5d16f);}return _0x3447c5['save']();};}function saveUpdates(_0x1695e8,_0x46f171){return function(_0x473fbd){if(_0x473fbd){return _0x473fbd[_0x09c0('0x25')](_0x1695e8)['then'](function(_0x4f6824){return _0x4f6824;});}return null;};}function removeEntity(_0x321bcc,_0x25fdb5){return function(_0x1e8a1c){if(_0x1e8a1c){return _0x1e8a1c[_0x09c0('0x26')]()['then'](function(){_0x321bcc[_0x09c0('0x1c')](0xcc)[_0x09c0('0x1d')]();});}};}function handleEntityNotFound(_0x56d883,_0x2c7202){return function(_0x163a59){if(!_0x163a59){_0x56d883[_0x09c0('0x1b')](0x194);}return _0x163a59;};}function handleError(_0x30c2a1,_0x1f8131){_0x1f8131=_0x1f8131||0x1f4;return function(_0x1d2d9d){logger[_0x09c0('0x27')](_0x1d2d9d[_0x09c0('0x28')]);if(_0x1d2d9d[_0x09c0('0x29')]){delete _0x1d2d9d[_0x09c0('0x29')];}_0x30c2a1[_0x09c0('0x1c')](_0x1f8131)['send'](_0x1d2d9d);};}exports[_0x09c0('0x2a')]=function(_0x1bdde9,_0x53a7b8){var _0x1d09e0={},_0x5aa0b9={},_0x3f5b10={'count':0x0,'rows':[]};var _0x4d6bdc=_[_0x09c0('0x2b')](db[_0x09c0('0x2c')][_0x09c0('0x2d')],function(_0x4159bc){return{'name':_0x4159bc['fieldName'],'type':_0x4159bc['type'][_0x09c0('0x2e')]};});_0x5aa0b9[_0x09c0('0x2f')]=_[_0x09c0('0x2b')](_0x4d6bdc,'name');_0x5aa0b9[_0x09c0('0x30')]=_['keys'](_0x1bdde9[_0x09c0('0x30')]);_0x5aa0b9[_0x09c0('0x31')]=_[_0x09c0('0x32')](_0x5aa0b9['model'],_0x5aa0b9[_0x09c0('0x30')]);_0x1d09e0[_0x09c0('0x33')]=_[_0x09c0('0x32')](_0x5aa0b9[_0x09c0('0x2f')],qs[_0x09c0('0x34')](_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x34')]));_0x1d09e0['attributes']=_0x1d09e0[_0x09c0('0x33')][_0x09c0('0x35')]?_0x1d09e0[_0x09c0('0x33')]:_0x5aa0b9[_0x09c0('0x2f')];if(!_0x1bdde9[_0x09c0('0x30')]['hasOwnProperty'](_0x09c0('0x36'))){_0x1d09e0[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x20')]);_0x1d09e0['offset']=qs[_0x09c0('0x37')](_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x37')]);}_0x1d09e0[_0x09c0('0x38')]=qs[_0x09c0('0x39')](_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x39')]);_0x1d09e0['where']=qs[_0x09c0('0x31')](_[_0x09c0('0x3a')](_0x1bdde9[_0x09c0('0x30')],_0x5aa0b9[_0x09c0('0x31')]),_0x4d6bdc);if(_0x1bdde9[_0x09c0('0x30')]['filter']){_0x1d09e0['where']=_['merge'](_0x1d09e0['where'],{'$or':_[_0x09c0('0x2b')](_0x4d6bdc,function(_0x15c631){if(_0x15c631[_0x09c0('0x3b')]!==_0x09c0('0x3c')){var _0x1a8c0c={};_0x1a8c0c[_0x15c631['name']]={'$like':'%'+_0x1bdde9[_0x09c0('0x30')][_0x09c0('0x3d')]+'%'};return _0x1a8c0c;}})});}_0x1d09e0=_['merge']({},_0x1d09e0,_0x1bdde9[_0x09c0('0x3e')]);var _0x5d50b9={'where':_0x1d09e0[_0x09c0('0x3f')]};return db['WhatsappQueueReport'][_0x09c0('0x21')](_0x5d50b9)[_0x09c0('0x40')](function(_0x56a511){_0x3f5b10[_0x09c0('0x21')]=_0x56a511;if(_0x1bdde9[_0x09c0('0x30')]['includeAll']){_0x1d09e0[_0x09c0('0x41')]=[{'all':!![]}];}return db[_0x09c0('0x2c')][_0x09c0('0x42')](_0x1d09e0);})[_0x09c0('0x40')](function(_0xeb8191){_0x3f5b10[_0x09c0('0x43')]=_0xeb8191;return _0x3f5b10;})['then'](respondWithFilteredResult(_0x53a7b8,_0x1d09e0))[_0x09c0('0x44')](handleError(_0x53a7b8,null));};exports[_0x09c0('0x45')]=function(_0x2d6344,_0x57835c){var _0x193ed2={'raw':!![],'where':{'id':_0x2d6344[_0x09c0('0x46')]['id']}},_0x30c0c5={};_0x30c0c5['model']=_[_0x09c0('0x47')](db[_0x09c0('0x2c')]['rawAttributes']);_0x30c0c5['query']=_[_0x09c0('0x47')](_0x2d6344[_0x09c0('0x30')]);_0x30c0c5['filters']=_[_0x09c0('0x32')](_0x30c0c5[_0x09c0('0x2f')],_0x30c0c5['query']);_0x193ed2[_0x09c0('0x33')]=_[_0x09c0('0x32')](_0x30c0c5[_0x09c0('0x2f')],qs[_0x09c0('0x34')](_0x2d6344[_0x09c0('0x30')]['fields']));_0x193ed2[_0x09c0('0x33')]=_0x193ed2['attributes']['length']?_0x193ed2[_0x09c0('0x33')]:_0x30c0c5[_0x09c0('0x2f')];if(_0x2d6344[_0x09c0('0x30')][_0x09c0('0x48')]){_0x193ed2[_0x09c0('0x41')]=[{'all':!![]}];}_0x193ed2=_[_0x09c0('0x49')]({},_0x193ed2,_0x2d6344['options']);return db['WhatsappQueueReport']['find'](_0x193ed2)[_0x09c0('0x40')](handleEntityNotFound(_0x57835c,null))[_0x09c0('0x40')](respondWithResult(_0x57835c,null))[_0x09c0('0x44')](handleError(_0x57835c,null));};exports['create']=function(_0xdf1553,_0xff9650){return db[_0x09c0('0x2c')][_0x09c0('0x4a')](_0xdf1553[_0x09c0('0x4b')],{})[_0x09c0('0x40')](respondWithResult(_0xff9650,0xc9))[_0x09c0('0x44')](handleError(_0xff9650,null));};exports[_0x09c0('0x25')]=function(_0x3f6d14,_0x38085c){if(_0x3f6d14[_0x09c0('0x4b')]['id']){delete _0x3f6d14[_0x09c0('0x4b')]['id'];}return db[_0x09c0('0x2c')][_0x09c0('0x4c')]({'where':{'id':_0x3f6d14[_0x09c0('0x46')]['id']}})[_0x09c0('0x40')](handleEntityNotFound(_0x38085c,null))[_0x09c0('0x40')](saveUpdates(_0x3f6d14[_0x09c0('0x4b')],null))[_0x09c0('0x40')](respondWithResult(_0x38085c,null))[_0x09c0('0x44')](handleError(_0x38085c,null));};exports['destroy']=function(_0x4acf54,_0x44befb){return db[_0x09c0('0x2c')][_0x09c0('0x4c')]({'where':{'id':_0x4acf54[_0x09c0('0x46')]['id']}})['then'](handleEntityNotFound(_0x44befb,null))[_0x09c0('0x40')](removeEntity(_0x44befb,null))[_0x09c0('0x44')](handleError(_0x44befb,null));};exports[_0x09c0('0x4d')]=function(_0x4a92c0,_0xe0b82a){return db[_0x09c0('0x2c')][_0x09c0('0x4d')]()[_0x09c0('0x40')](respondWithResult(_0xe0b82a,null))[_0x09c0('0x44')](handleError(_0xe0b82a,null));}; \ No newline at end of file +var _0x0713=['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','index','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','params','keys','find','catch','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x54e3be,_0x59c6d2){var _0xb2dbbc=function(_0x1451a5){while(--_0x1451a5){_0x54e3be['push'](_0x54e3be['shift']());}};_0xb2dbbc(++_0x59c6d2);}(_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={},_0x292205={},_0x254fc8={'count':0x0,'rows':[]};var _0x5aba96=_['map'](db[_0x3071('0x2d')][_0x3071('0x2e')],function(_0x6ddf96){return{'name':_0x6ddf96[_0x3071('0x2f')],'type':_0x6ddf96[_0x3071('0x30')][_0x3071('0x31')]};});_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x5aba96,'name');_0x292205['query']=_['keys'](_0x177b5f[_0x3071('0x34')]);_0x292205[_0x3071('0x35')]=_['intersection'](_0x292205[_0x3071('0x32')],_0x292205[_0x3071('0x34')]);_0x32f1b4[_0x3071('0x36')]=_[_0x3071('0x37')](_0x292205['model'],qs[_0x3071('0x38')](_0x177b5f[_0x3071('0x34')][_0x3071('0x38')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x39')]?_0x32f1b4[_0x3071('0x36')]:_0x292205[_0x3071('0x32')];if(!_0x177b5f['query'][_0x3071('0x3a')]('nolimit')){_0x32f1b4['limit']=qs[_0x3071('0x20')](_0x177b5f[_0x3071('0x34')]['limit']);_0x32f1b4[_0x3071('0x1e')]=qs[_0x3071('0x1e')](_0x177b5f[_0x3071('0x34')][_0x3071('0x1e')]);}_0x32f1b4[_0x3071('0x3b')]=qs[_0x3071('0x3c')](_0x177b5f['query'][_0x3071('0x3c')]);_0x32f1b4[_0x3071('0x3d')]=qs['filters'](_[_0x3071('0x3e')](_0x177b5f['query'],_0x292205[_0x3071('0x35')]),_0x5aba96);if(_0x177b5f[_0x3071('0x34')]['filter']){_0x32f1b4['where']=_[_0x3071('0x3f')](_0x32f1b4[_0x3071('0x3d')],{'$or':_[_0x3071('0x33')](_0x5aba96,function(_0x55afa6){if(_0x55afa6[_0x3071('0x30')]!=='VIRTUAL'){var _0x1ac90a={};_0x1ac90a[_0x55afa6['name']]={'$like':'%'+_0x177b5f[_0x3071('0x34')][_0x3071('0x40')]+'%'};return _0x1ac90a;}})});}_0x32f1b4=_[_0x3071('0x3f')]({},_0x32f1b4,_0x177b5f[_0x3071('0x41')]);var _0x30ab68={'where':_0x32f1b4['where']};return db['WhatsappQueueReport'][_0x3071('0x21')](_0x30ab68)[_0x3071('0x27')](function(_0x1455be){_0x254fc8[_0x3071('0x21')]=_0x1455be;if(_0x177b5f['query'][_0x3071('0x42')]){_0x32f1b4[_0x3071('0x43')]=[{'all':!![]}];}return db[_0x3071('0x2d')][_0x3071('0x44')](_0x32f1b4);})[_0x3071('0x27')](function(_0xb9a4b8){_0x254fc8['rows']=_0xb9a4b8;return _0x254fc8;})[_0x3071('0x27')](respondWithFilteredResult(_0x3921a1,_0x32f1b4))['catch'](handleError(_0x3921a1,null));};exports['show']=function(_0x4dc9d1,_0x47ceaf){var _0x2992e6={'raw':!![],'where':{'id':_0x4dc9d1[_0x3071('0x45')]['id']}},_0x1be8b6={};_0x1be8b6[_0x3071('0x32')]=_[_0x3071('0x46')](db[_0x3071('0x2d')][_0x3071('0x2e')]);_0x1be8b6[_0x3071('0x34')]=_['keys'](_0x4dc9d1[_0x3071('0x34')]);_0x1be8b6[_0x3071('0x35')]=_[_0x3071('0x37')](_0x1be8b6[_0x3071('0x32')],_0x1be8b6[_0x3071('0x34')]);_0x2992e6['attributes']=_['intersection'](_0x1be8b6[_0x3071('0x32')],qs[_0x3071('0x38')](_0x4dc9d1[_0x3071('0x34')][_0x3071('0x38')]));_0x2992e6[_0x3071('0x36')]=_0x2992e6['attributes'][_0x3071('0x39')]?_0x2992e6['attributes']:_0x1be8b6[_0x3071('0x32')];if(_0x4dc9d1['query']['includeAll']){_0x2992e6[_0x3071('0x43')]=[{'all':!![]}];}_0x2992e6=_['merge']({},_0x2992e6,_0x4dc9d1[_0x3071('0x41')]);return db['WhatsappQueueReport'][_0x3071('0x47')](_0x2992e6)[_0x3071('0x27')](handleEntityNotFound(_0x47ceaf,null))[_0x3071('0x27')](respondWithResult(_0x47ceaf,null))[_0x3071('0x48')](handleError(_0x47ceaf,null));};exports['create']=function(_0x2d70bf,_0x575c12){return db[_0x3071('0x2d')]['create'](_0x2d70bf[_0x3071('0x49')],{})[_0x3071('0x27')](respondWithResult(_0x575c12,0xc9))['catch'](handleError(_0x575c12,null));};exports[_0x3071('0x26')]=function(_0x117e73,_0x224a70){if(_0x117e73[_0x3071('0x49')]['id']){delete _0x117e73[_0x3071('0x49')]['id'];}return db[_0x3071('0x2d')][_0x3071('0x47')]({'where':{'id':_0x117e73['params']['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x224a70,null))[_0x3071('0x27')](saveUpdates(_0x117e73[_0x3071('0x49')],null))[_0x3071('0x27')](respondWithResult(_0x224a70,null))['catch'](handleError(_0x224a70,null));};exports[_0x3071('0x28')]=function(_0x2aea37,_0x1b832e){return db[_0x3071('0x2d')][_0x3071('0x47')]({'where':{'id':_0x2aea37[_0x3071('0x45')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x1b832e,null))[_0x3071('0x27')](removeEntity(_0x1b832e,null))[_0x3071('0x48')](handleError(_0x1b832e,null));};exports[_0x3071('0x4a')]=function(_0x4371e7,_0x111115){return db[_0x3071('0x2d')][_0x3071('0x4a')]()[_0x3071('0x27')](respondWithResult(_0x111115,null))[_0x3071('0x48')](handleError(_0x111115,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index cb45ebe..c789946 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 _0x3993=['request-promise','path','rimraf','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api','moment','bluebird'];(function(_0x4080f3,_0x18eb36){var _0x3314f5=function(_0x58d499){while(--_0x58d499){_0x4080f3['push'](_0x4080f3['shift']());}};_0x3314f5(++_0x18eb36);}(_0x3993,0x1d7));var _0x3399=function(_0x252204,_0x186460){_0x252204=_0x252204-0x0;var _0x1ff50b=_0x3993[_0x252204];return _0x1ff50b;};'use strict';var _=require('lodash');var util=require(_0x3399('0x0'));var logger=require(_0x3399('0x1'))(_0x3399('0x2'));var moment=require(_0x3399('0x3'));var BPromise=require(_0x3399('0x4'));var rp=require(_0x3399('0x5'));var fs=require('fs');var path=require(_0x3399('0x6'));var rimraf=require(_0x3399('0x7'));var config=require('../../config/environment');var attributes=require(_0x3399('0x8'));module[_0x3399('0x9')]=function(_0x46afae,_0x406593){return _0x46afae[_0x3399('0xa')](_0x3399('0xb'),attributes,{'tableName':_0x3399('0xc'),'paranoid':![],'indexes':[{'name':_0x3399('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xce7c=['api','moment','bluebird','request-promise','rimraf','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xce7c,0xcd));var _0xcce7=function(_0x413f2a,_0x1006e4){_0x413f2a=_0x413f2a-0x0;var _0x1932ec=_0xce7c[_0x413f2a];return _0x1932ec;};'use strict';var _=require(_0xcce7('0x0'));var util=require(_0xcce7('0x1'));var logger=require(_0xcce7('0x2'))(_0xcce7('0x3'));var moment=require(_0xcce7('0x4'));var BPromise=require(_0xcce7('0x5'));var rp=require(_0xcce7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcce7('0x7'));var config=require('../../config/environment');var attributes=require(_0xcce7('0x8'));module['exports']=function(_0x1966a1,_0xdc7a1a){return _0x1966a1[_0xcce7('0x9')](_0xcce7('0xa'),attributes,{'tableName':_0xcce7('0xb'),'paranoid':![],'indexes':[{'name':_0xcce7('0xc'),'fields':[_0xcce7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index c476109..a771c82 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 _0x2527=['error','message','result','catch','WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x26462e,_0x416ff7){var _0x31c3f0=function(_0xd387ea){while(--_0xd387ea){_0x26462e['push'](_0x26462e['shift']());}};_0x31c3f0(++_0x416ff7);}(_0x2527,0xf5));var _0x7252=function(_0xca22ba,_0x201b8c){_0xca22ba=_0xca22ba-0x0;var _0x2ca134=_0x2527[_0xca22ba];return _0x2ca134;};'use strict';var _=require(_0x7252('0x0'));var util=require(_0x7252('0x1'));var moment=require(_0x7252('0x2'));var BPromise=require(_0x7252('0x3'));var rs=require(_0x7252('0x4'));var fs=require('fs');var Redis=require(_0x7252('0x5'));var db=require(_0x7252('0x6'))['db'];var utils=require(_0x7252('0x7'));var logger=require(_0x7252('0x8'))(_0x7252('0x9'));var config=require(_0x7252('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x7252('0xb')][_0x7252('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x34c51c,_0x4d17e1,_0x29d182){return new BPromise(function(_0x27ffcf,_0x2f218e){return client['request'](_0x34c51c,_0x29d182)[_0x7252('0xd')](function(_0x3c42c9){logger[_0x7252('0xe')](_0x7252('0xf'),_0x4d17e1,_0x7252('0x10'));logger[_0x7252('0x11')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x4d17e1,_0x7252('0x10'),JSON[_0x7252('0x12')](_0x3c42c9));if(_0x3c42c9[_0x7252('0x13')]){if(_0x3c42c9['error']['code']===0x1f4){logger[_0x7252('0x13')](_0x7252('0xf'),_0x4d17e1,_0x3c42c9[_0x7252('0x13')][_0x7252('0x14')]);return _0x2f218e(_0x3c42c9['error'][_0x7252('0x14')]);}logger[_0x7252('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4d17e1,_0x3c42c9[_0x7252('0x13')][_0x7252('0x14')]);return _0x27ffcf(_0x3c42c9['error'][_0x7252('0x14')]);}else{logger[_0x7252('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4d17e1,_0x7252('0x10'));_0x27ffcf(_0x3c42c9[_0x7252('0x15')][_0x7252('0x14')]);}})[_0x7252('0x16')](function(_0x3ba9ca){logger['error'](_0x7252('0xf'),_0x4d17e1,_0x3ba9ca);_0x2f218e(_0x3ba9ca);});});}exports['CreateWhatsappQueueReport']=function(_0x24f4f9){var _0x422a90=this;return new Promise(function(_0x35125b,_0x3a2f01){return db[_0x7252('0x17')][_0x7252('0x18')](_0x24f4f9[_0x7252('0x19')],{'raw':_0x24f4f9[_0x7252('0x1a')]?_0x24f4f9[_0x7252('0x1a')][_0x7252('0x1b')]===undefined?!![]:![]:!![]})[_0x7252('0xd')](function(_0x5a733e){logger[_0x7252('0xe')]('CreateWhatsappQueueReport',_0x24f4f9);logger['debug']('CreateWhatsappQueueReport',_0x24f4f9,JSON[_0x7252('0x12')](_0x5a733e));_0x35125b(_0x5a733e);})[_0x7252('0x16')](function(_0x348916){logger[_0x7252('0x13')](_0x7252('0x1c'),_0x348916[_0x7252('0x14')],_0x24f4f9);_0x3a2f01(_0x422a90['error'](0x1f4,_0x348916[_0x7252('0x14')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x92a2f4){var _0x483af1=this;return new Promise(function(_0x5660d8,_0x54afd7){return db[_0x7252('0x17')]['update'](_0x92a2f4[_0x7252('0x19')],{'raw':_0x92a2f4[_0x7252('0x1a')]?_0x92a2f4[_0x7252('0x1a')][_0x7252('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x92a2f4[_0x7252('0x1a')]?_0x92a2f4[_0x7252('0x1a')][_0x7252('0x1d')]||null:null,'attributes':_0x92a2f4[_0x7252('0x1a')]?_0x92a2f4[_0x7252('0x1a')][_0x7252('0x1e')]||null:null,'limit':_0x92a2f4[_0x7252('0x1a')]?_0x92a2f4['options'][_0x7252('0x1f')]||null:null})[_0x7252('0xd')](function(_0x178c4f){logger[_0x7252('0xe')](_0x7252('0x20'),_0x92a2f4);logger[_0x7252('0x11')](_0x7252('0x20'),_0x92a2f4,JSON[_0x7252('0x12')](_0x178c4f));_0x5660d8(_0x178c4f);})[_0x7252('0x16')](function(_0x2ff451){logger[_0x7252('0x13')]('UpdateWhatsappQueueReport',_0x2ff451[_0x7252('0x14')],_0x92a2f4);_0x54afd7(_0x483af1[_0x7252('0x13')](0x1f4,_0x2ff451[_0x7252('0x14')]));});});}; \ No newline at end of file +var _0x3f39=['http','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','debug','UpdateWhatsappQueueReport','update','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5c6aa1,_0x5792a2){var _0x23b899=function(_0x336149){while(--_0x336149){_0x5c6aa1['push'](_0x5c6aa1['shift']());}};_0x23b899(++_0x5792a2);}(_0x3f39,0x106));var _0x93f3=function(_0x3df626,_0x6d324){_0x3df626=_0x3df626-0x0;var _0x57b238=_0x3f39[_0x3df626];return _0x57b238;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x93f3('0x0'));var BPromise=require(_0x93f3('0x1'));var rs=require(_0x93f3('0x2'));var fs=require('fs');var Redis=require(_0x93f3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x93f3('0x4'));var logger=require(_0x93f3('0x5'))(_0x93f3('0x6'));var config=require(_0x93f3('0x7'));var jayson=require(_0x93f3('0x8'));var client=jayson[_0x93f3('0x9')][_0x93f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bff34,_0x3917fe,_0x50f0fb){return new BPromise(function(_0x36fb2a,_0x4aae8d){return client['request'](_0x5bff34,_0x50f0fb)[_0x93f3('0xb')](function(_0x282a98){logger[_0x93f3('0xc')](_0x93f3('0xd'),_0x3917fe,_0x93f3('0xe'));logger['debug'](_0x93f3('0xf'),_0x3917fe,_0x93f3('0xe'),JSON[_0x93f3('0x10')](_0x282a98));if(_0x282a98[_0x93f3('0x11')]){if(_0x282a98[_0x93f3('0x11')][_0x93f3('0x12')]===0x1f4){logger[_0x93f3('0x11')](_0x93f3('0xd'),_0x3917fe,_0x282a98[_0x93f3('0x11')][_0x93f3('0x13')]);return _0x4aae8d(_0x282a98[_0x93f3('0x11')][_0x93f3('0x13')]);}logger[_0x93f3('0x11')](_0x93f3('0xd'),_0x3917fe,_0x282a98[_0x93f3('0x11')][_0x93f3('0x13')]);return _0x36fb2a(_0x282a98[_0x93f3('0x11')]['message']);}else{logger[_0x93f3('0xc')](_0x93f3('0xd'),_0x3917fe,_0x93f3('0xe'));_0x36fb2a(_0x282a98[_0x93f3('0x14')][_0x93f3('0x13')]);}})[_0x93f3('0x15')](function(_0x92fff4){logger[_0x93f3('0x11')](_0x93f3('0xd'),_0x3917fe,_0x92fff4);_0x4aae8d(_0x92fff4);});});}exports[_0x93f3('0x16')]=function(_0x1b0fdd){var _0x1f758b=this;return new Promise(function(_0xb0b31a,_0xa6638){return db[_0x93f3('0x17')][_0x93f3('0x18')](_0x1b0fdd[_0x93f3('0x19')],{'raw':_0x1b0fdd[_0x93f3('0x1a')]?_0x1b0fdd['options'][_0x93f3('0x1b')]===undefined?!![]:![]:!![]})[_0x93f3('0xb')](function(_0xd0498b){logger[_0x93f3('0xc')]('CreateWhatsappQueueReport',_0x1b0fdd);logger[_0x93f3('0x1c')](_0x93f3('0x16'),_0x1b0fdd,JSON['stringify'](_0xd0498b));_0xb0b31a(_0xd0498b);})[_0x93f3('0x15')](function(_0x5dc398){logger['error'](_0x93f3('0x16'),_0x5dc398[_0x93f3('0x13')],_0x1b0fdd);_0xa6638(_0x1f758b[_0x93f3('0x11')](0x1f4,_0x5dc398[_0x93f3('0x13')]));});});};exports[_0x93f3('0x1d')]=function(_0x3c616b){var _0x146a84=this;return new Promise(function(_0x95bb79,_0x5020cc){return db[_0x93f3('0x17')][_0x93f3('0x1e')](_0x3c616b[_0x93f3('0x19')],{'raw':_0x3c616b[_0x93f3('0x1a')]?_0x3c616b[_0x93f3('0x1a')][_0x93f3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c616b[_0x93f3('0x1a')]?_0x3c616b['options'][_0x93f3('0x1f')]||null:null,'attributes':_0x3c616b['options']?_0x3c616b[_0x93f3('0x1a')][_0x93f3('0x20')]||null:null,'limit':_0x3c616b[_0x93f3('0x1a')]?_0x3c616b['options'][_0x93f3('0x21')]||null:null})[_0x93f3('0xb')](function(_0x56eb64){logger[_0x93f3('0xc')](_0x93f3('0x1d'),_0x3c616b);logger[_0x93f3('0x1c')](_0x93f3('0x1d'),_0x3c616b,JSON[_0x93f3('0x10')](_0x56eb64));_0x95bb79(_0x56eb64);})['catch'](function(_0x42106f){logger[_0x93f3('0x11')](_0x93f3('0x1d'),_0x42106f[_0x93f3('0x13')],_0x3c616b);_0x5020cc(_0x146a84['error'](0x1f4,_0x42106f['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 3c0deaa..8242604 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 _0xc11f=['exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy'];(function(_0x19dd95,_0x3eef82){var _0x5127d9=function(_0x14e6de){while(--_0x14e6de){_0x19dd95['push'](_0x19dd95['shift']());}};_0x5127d9(++_0x3eef82);}(_0xc11f,0x100));var _0xfc11=function(_0x18c7e4,_0x1691a0){_0x18c7e4=_0x18c7e4-0x0;var _0x3d059b=_0xc11f[_0x18c7e4];return _0x3d059b;};'use strict';var multer=require(_0xfc11('0x0'));var util=require('util');var path=require(_0xfc11('0x1'));var timeout=require(_0xfc11('0x2'));var express=require('express');var router=express[_0xfc11('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfc11('0x4'));var config=require(_0xfc11('0x5'));var controller=require('./whatsappTransferReport.controller');router[_0xfc11('0x6')]('/',auth[_0xfc11('0x7')](),controller['index']);router[_0xfc11('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xfc11('0x8')]);router[_0xfc11('0x6')](_0xfc11('0x9'),auth[_0xfc11('0x7')](),controller[_0xfc11('0xa')]);router[_0xfc11('0xb')]('/',auth['isAuthenticated'](),controller[_0xfc11('0xc')]);router[_0xfc11('0xd')](_0xfc11('0x9'),auth[_0xfc11('0x7')](),controller['update']);router[_0xfc11('0xe')](_0xfc11('0x9'),auth[_0xfc11('0x7')](),controller[_0xfc11('0xf')]);module[_0xfc11('0x10')]=router; \ No newline at end of file +var _0x92d1=['index','get','isAuthenticated','describe','show','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller'];(function(_0x29ce14,_0x334166){var _0x48f289=function(_0x288d11){while(--_0x288d11){_0x29ce14['push'](_0x29ce14['shift']());}};_0x48f289(++_0x334166);}(_0x92d1,0x1cb));var _0x192d=function(_0x7942ee,_0x3b8e77){_0x7942ee=_0x7942ee-0x0;var _0x210ff7=_0x92d1[_0x7942ee];return _0x210ff7;};'use strict';var multer=require(_0x192d('0x0'));var util=require(_0x192d('0x1'));var path=require('path');var timeout=require(_0x192d('0x2'));var express=require(_0x192d('0x3'));var router=express[_0x192d('0x4')]();var fs_extra=require(_0x192d('0x5'));var auth=require(_0x192d('0x6'));var interaction=require(_0x192d('0x7'));var config=require('../../config/environment');var controller=require(_0x192d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x192d('0x9')]);router[_0x192d('0xa')]('/describe',auth[_0x192d('0xb')](),controller[_0x192d('0xc')]);router[_0x192d('0xa')]('/:id',auth[_0x192d('0xb')](),controller[_0x192d('0xd')]);router['post']('/',auth[_0x192d('0xb')](),controller['create']);router['put'](_0x192d('0xe'),auth['isAuthenticated'](),controller[_0x192d('0xf')]);router[_0x192d('0x10')](_0x192d('0xe'),auth[_0x192d('0xb')](),controller['destroy']);module[_0x192d('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 706779f..d92f61a 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 _0x0972=['exports','ENUM','agent','queue'];(function(_0x33ebf5,_0x156cbc){var _0x34cfb7=function(_0x4b5946){while(--_0x4b5946){_0x33ebf5['push'](_0x33ebf5['shift']());}};_0x34cfb7(++_0x156cbc);}(_0x0972,0x64));var _0x2097=function(_0xc2ffb9,_0x18a0a8){_0xc2ffb9=_0xc2ffb9-0x0;var _0x422763=_0x0972[_0xc2ffb9];return _0x422763;};'use strict';var Sequelize=require('sequelize');module[_0x2097('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2097('0x1')]('account',_0x2097('0x2'),_0x2097('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x88a6=['DATE','exports','STRING','account','agent','queue'];(function(_0x4da1e6,_0x1566be){var _0x36c34e=function(_0x3d91da){while(--_0x3d91da){_0x4da1e6['push'](_0x4da1e6['shift']());}};_0x36c34e(++_0x1566be);}(_0x88a6,0x121));var _0x688a=function(_0x5f1d74,_0x33e095){_0x5f1d74=_0x5f1d74-0x0;var _0xab75f5=_0x88a6[_0x5f1d74];return _0xab75f5;};'use strict';var Sequelize=require('sequelize');module[_0x688a('0x0')]={'uniqueid':{'type':Sequelize[_0x688a('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x688a('0x2'),_0x688a('0x3'),_0x688a('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x688a('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 0177bce..c6b74e1 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 _0xa7f8=['update','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','pick','merge','where','type','options','WhatsappTransferReport','includeAll','include','findAll','rows','show','params','length','find','catch','create','body'];(function(_0x27662b,_0x3f3347){var _0x3d4405=function(_0x443f02){while(--_0x443f02){_0x27662b['push'](_0x27662b['shift']());}};_0x3d4405(++_0x3f3347);}(_0xa7f8,0x160));var _0x8a7f=function(_0x321ccf,_0x2e780d){_0x321ccf=_0x321ccf-0x0;var _0x3a9a2a=_0xa7f8[_0x321ccf];return _0x3a9a2a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a7f('0x0'));var zipdir=require(_0x8a7f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a7f('0x2'));var moment=require('moment');var BPromise=require(_0x8a7f('0x3'));var Mustache=require(_0x8a7f('0x4'));var util=require(_0x8a7f('0x5'));var path=require('path');var sox=require(_0x8a7f('0x6'));var csv=require(_0x8a7f('0x7'));var ejs=require(_0x8a7f('0x8'));var fs=require('fs');var fs_extra=require(_0x8a7f('0x9'));var _=require(_0x8a7f('0xa'));var squel=require(_0x8a7f('0xb'));var crypto=require(_0x8a7f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8a7f('0xd'));var toCsv=require(_0x8a7f('0x7'));var querystring=require(_0x8a7f('0xe'));var Papa=require('papaparse');var Redis=require(_0x8a7f('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8a7f('0x10'));var hardwareService=require(_0x8a7f('0x11'));var logger=require('../../config/logger')(_0x8a7f('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8a7f('0x13'));var db=require(_0x8a7f('0x14'))['db'];function respondWithStatusCode(_0x2424b8,_0x4ba434){_0x4ba434=_0x4ba434||0xcc;return function(_0x347cac){if(_0x347cac){return _0x2424b8[_0x8a7f('0x15')](_0x4ba434);}return _0x2424b8[_0x8a7f('0x16')](_0x4ba434)[_0x8a7f('0x17')]();};}function respondWithResult(_0x210f43,_0x5d96fe){_0x5d96fe=_0x5d96fe||0xc8;return function(_0x42b6cd){if(_0x42b6cd){return _0x210f43[_0x8a7f('0x16')](_0x5d96fe)['json'](_0x42b6cd);}};}function respondWithFilteredResult(_0x2d8e12,_0x52c38c){return function(_0x5ead6e){if(_0x5ead6e){var _0x9ce1d3=typeof _0x52c38c[_0x8a7f('0x18')]===_0x8a7f('0x19')&&typeof _0x52c38c[_0x8a7f('0x1a')]===_0x8a7f('0x19');var _0x18ad9f=_0x5ead6e[_0x8a7f('0x1b')];var _0x3a0804=_0x9ce1d3?0x0:_0x52c38c[_0x8a7f('0x18')];var _0x42ca11=_0x9ce1d3?_0x5ead6e[_0x8a7f('0x1b')]:_0x52c38c[_0x8a7f('0x18')]+_0x52c38c[_0x8a7f('0x1a')];var _0xb041eb;if(_0x42ca11>=_0x18ad9f){_0x42ca11=_0x18ad9f;_0xb041eb=0xc8;}else{_0xb041eb=0xce;}_0x2d8e12['status'](_0xb041eb);return _0x2d8e12[_0x8a7f('0x1c')](_0x8a7f('0x1d'),_0x3a0804+'-'+_0x42ca11+'/'+_0x18ad9f)[_0x8a7f('0x1e')](_0x5ead6e);}return null;};}function patchUpdates(_0xb31f89){return function(_0x16cca9){try{jsonpatch[_0x8a7f('0x1f')](_0x16cca9,_0xb31f89,!![]);}catch(_0x8e3965){return BPromise['reject'](_0x8e3965);}return _0x16cca9['save']();};}function saveUpdates(_0x32069a,_0x1c6d26){return function(_0x59d203){if(_0x59d203){return _0x59d203['update'](_0x32069a)[_0x8a7f('0x20')](function(_0x215675){return _0x215675;});}return null;};}function removeEntity(_0x91c152,_0x13716b){return function(_0x564bfb){if(_0x564bfb){return _0x564bfb[_0x8a7f('0x21')]()[_0x8a7f('0x20')](function(){_0x91c152[_0x8a7f('0x16')](0xcc)[_0x8a7f('0x17')]();});}};}function handleEntityNotFound(_0x5b628e,_0x3dba81){return function(_0x21a190){if(!_0x21a190){_0x5b628e[_0x8a7f('0x15')](0x194);}return _0x21a190;};}function handleError(_0xfe25fb,_0x47cc58){_0x47cc58=_0x47cc58||0x1f4;return function(_0x14c35e){logger[_0x8a7f('0x22')](_0x14c35e[_0x8a7f('0x23')]);if(_0x14c35e[_0x8a7f('0x24')]){delete _0x14c35e['name'];}_0xfe25fb[_0x8a7f('0x16')](_0x47cc58)['send'](_0x14c35e);};}exports[_0x8a7f('0x25')]=function(_0x4fe0f5,_0xb72ac5){var _0xdacea6={},_0x2416b0={},_0x4cfd96={'count':0x0,'rows':[]};var _0x16fc73=_[_0x8a7f('0x26')](db['WhatsappTransferReport'][_0x8a7f('0x27')],function(_0x344de4){return{'name':_0x344de4[_0x8a7f('0x28')],'type':_0x344de4['type']['key']};});_0x2416b0['model']=_[_0x8a7f('0x26')](_0x16fc73,_0x8a7f('0x24'));_0x2416b0[_0x8a7f('0x29')]=_[_0x8a7f('0x2a')](_0x4fe0f5[_0x8a7f('0x29')]);_0x2416b0[_0x8a7f('0x2b')]=_[_0x8a7f('0x2c')](_0x2416b0['model'],_0x2416b0[_0x8a7f('0x29')]);_0xdacea6[_0x8a7f('0x2d')]=_[_0x8a7f('0x2c')](_0x2416b0[_0x8a7f('0x2e')],qs[_0x8a7f('0x2f')](_0x4fe0f5[_0x8a7f('0x29')][_0x8a7f('0x2f')]));_0xdacea6[_0x8a7f('0x2d')]=_0xdacea6[_0x8a7f('0x2d')]['length']?_0xdacea6[_0x8a7f('0x2d')]:_0x2416b0[_0x8a7f('0x2e')];if(!_0x4fe0f5['query']['hasOwnProperty'](_0x8a7f('0x30'))){_0xdacea6[_0x8a7f('0x1a')]=qs['limit'](_0x4fe0f5[_0x8a7f('0x29')][_0x8a7f('0x1a')]);_0xdacea6[_0x8a7f('0x18')]=qs[_0x8a7f('0x18')](_0x4fe0f5[_0x8a7f('0x29')]['offset']);}_0xdacea6[_0x8a7f('0x31')]=qs[_0x8a7f('0x32')](_0x4fe0f5[_0x8a7f('0x29')]['sort']);_0xdacea6['where']=qs[_0x8a7f('0x2b')](_[_0x8a7f('0x33')](_0x4fe0f5['query'],_0x2416b0[_0x8a7f('0x2b')]),_0x16fc73);if(_0x4fe0f5[_0x8a7f('0x29')]['filter']){_0xdacea6['where']=_[_0x8a7f('0x34')](_0xdacea6[_0x8a7f('0x35')],{'$or':_[_0x8a7f('0x26')](_0x16fc73,function(_0xf3b8de){if(_0xf3b8de[_0x8a7f('0x36')]!=='VIRTUAL'){var _0x1c0bff={};_0x1c0bff[_0xf3b8de['name']]={'$like':'%'+_0x4fe0f5[_0x8a7f('0x29')]['filter']+'%'};return _0x1c0bff;}})});}_0xdacea6=_[_0x8a7f('0x34')]({},_0xdacea6,_0x4fe0f5[_0x8a7f('0x37')]);var _0x1f4a34={'where':_0xdacea6[_0x8a7f('0x35')]};return db[_0x8a7f('0x38')][_0x8a7f('0x1b')](_0x1f4a34)['then'](function(_0x233e72){_0x4cfd96['count']=_0x233e72;if(_0x4fe0f5[_0x8a7f('0x29')][_0x8a7f('0x39')]){_0xdacea6[_0x8a7f('0x3a')]=[{'all':!![]}];}return db[_0x8a7f('0x38')][_0x8a7f('0x3b')](_0xdacea6);})[_0x8a7f('0x20')](function(_0x4b2ff5){_0x4cfd96[_0x8a7f('0x3c')]=_0x4b2ff5;return _0x4cfd96;})[_0x8a7f('0x20')](respondWithFilteredResult(_0xb72ac5,_0xdacea6))['catch'](handleError(_0xb72ac5,null));};exports[_0x8a7f('0x3d')]=function(_0x6721da,_0x27ba3e){var _0x44da99={'raw':!![],'where':{'id':_0x6721da[_0x8a7f('0x3e')]['id']}},_0x870c71={};_0x870c71[_0x8a7f('0x2e')]=_[_0x8a7f('0x2a')](db[_0x8a7f('0x38')]['rawAttributes']);_0x870c71[_0x8a7f('0x29')]=_[_0x8a7f('0x2a')](_0x6721da[_0x8a7f('0x29')]);_0x870c71['filters']=_['intersection'](_0x870c71[_0x8a7f('0x2e')],_0x870c71[_0x8a7f('0x29')]);_0x44da99[_0x8a7f('0x2d')]=_[_0x8a7f('0x2c')](_0x870c71[_0x8a7f('0x2e')],qs[_0x8a7f('0x2f')](_0x6721da['query']['fields']));_0x44da99[_0x8a7f('0x2d')]=_0x44da99['attributes'][_0x8a7f('0x3f')]?_0x44da99['attributes']:_0x870c71[_0x8a7f('0x2e')];if(_0x6721da[_0x8a7f('0x29')][_0x8a7f('0x39')]){_0x44da99[_0x8a7f('0x3a')]=[{'all':!![]}];}_0x44da99=_[_0x8a7f('0x34')]({},_0x44da99,_0x6721da[_0x8a7f('0x37')]);return db[_0x8a7f('0x38')][_0x8a7f('0x40')](_0x44da99)[_0x8a7f('0x20')](handleEntityNotFound(_0x27ba3e,null))[_0x8a7f('0x20')](respondWithResult(_0x27ba3e,null))[_0x8a7f('0x41')](handleError(_0x27ba3e,null));};exports['create']=function(_0x1ba20e,_0x242a53){return db['WhatsappTransferReport'][_0x8a7f('0x42')](_0x1ba20e[_0x8a7f('0x43')],{})[_0x8a7f('0x20')](respondWithResult(_0x242a53,0xc9))[_0x8a7f('0x41')](handleError(_0x242a53,null));};exports[_0x8a7f('0x44')]=function(_0x5714b1,_0x49dbc8){if(_0x5714b1[_0x8a7f('0x43')]['id']){delete _0x5714b1[_0x8a7f('0x43')]['id'];}return db['WhatsappTransferReport'][_0x8a7f('0x40')]({'where':{'id':_0x5714b1[_0x8a7f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x49dbc8,null))['then'](saveUpdates(_0x5714b1['body'],null))[_0x8a7f('0x20')](respondWithResult(_0x49dbc8,null))[_0x8a7f('0x41')](handleError(_0x49dbc8,null));};exports[_0x8a7f('0x21')]=function(_0x5c2ef3,_0x386ab0){return db['WhatsappTransferReport']['find']({'where':{'id':_0x5c2ef3[_0x8a7f('0x3e')]['id']}})[_0x8a7f('0x20')](handleEntityNotFound(_0x386ab0,null))[_0x8a7f('0x20')](removeEntity(_0x386ab0,null))[_0x8a7f('0x41')](handleError(_0x386ab0,null));};exports[_0x8a7f('0x45')]=function(_0x388daf,_0x18f13c){return db[_0x8a7f('0x38')][_0x8a7f('0x45')]()[_0x8a7f('0x20')](respondWithResult(_0x18f13c,null))[_0x8a7f('0x41')](handleError(_0x18f13c,null));}; \ No newline at end of file +var _0x34d7=['show','params','filters','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','keys','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x32b1c3,_0x3db4cd){var _0x34e47b=function(_0xf550e){while(--_0xf550e){_0x32b1c3['push'](_0x32b1c3['shift']());}};_0x34e47b(++_0x3db4cd);}(_0x34d7,0x13c));var _0x734d=function(_0x1a39c8,_0x453b65){_0x1a39c8=_0x1a39c8-0x0;var _0x53bfde=_0x34d7[_0x1a39c8];return _0x53bfde;};'use strict';var emlformat=require(_0x734d('0x0'));var rimraf=require(_0x734d('0x1'));var zipdir=require(_0x734d('0x2'));var jsonpatch=require(_0x734d('0x3'));var rp=require(_0x734d('0x4'));var moment=require(_0x734d('0x5'));var BPromise=require(_0x734d('0x6'));var Mustache=require(_0x734d('0x7'));var util=require(_0x734d('0x8'));var path=require(_0x734d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x734d('0xa'));var fs=require('fs');var fs_extra=require(_0x734d('0xb'));var _=require(_0x734d('0xc'));var squel=require(_0x734d('0xd'));var crypto=require('crypto');var jsforce=require(_0x734d('0xe'));var deskjs=require(_0x734d('0xf'));var toCsv=require(_0x734d('0x10'));var querystring=require('querystring');var Papa=require(_0x734d('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x734d('0x12'));var as=require(_0x734d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x734d('0x14'))('api');var utils=require(_0x734d('0x15'));var config=require(_0x734d('0x16'));var licenseUtil=require(_0x734d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bd755,_0x2b46b3){_0x2b46b3=_0x2b46b3||0xcc;return function(_0x5c1a3e){if(_0x5c1a3e){return _0x5bd755[_0x734d('0x18')](_0x2b46b3);}return _0x5bd755['status'](_0x2b46b3)[_0x734d('0x19')]();};}function respondWithResult(_0x27a22c,_0x2b06d7){_0x2b06d7=_0x2b06d7||0xc8;return function(_0xc8986b){if(_0xc8986b){return _0x27a22c[_0x734d('0x1a')](_0x2b06d7)[_0x734d('0x1b')](_0xc8986b);}};}function respondWithFilteredResult(_0x5a8aa7,_0x34b57a){return function(_0x18d675){if(_0x18d675){var _0x2c1be6=typeof _0x34b57a['offset']===_0x734d('0x1c')&&typeof _0x34b57a[_0x734d('0x1d')]===_0x734d('0x1c');var _0x5de199=_0x18d675[_0x734d('0x1e')];var _0x5f02a4=_0x2c1be6?0x0:_0x34b57a[_0x734d('0x1f')];var _0x7aa671=_0x2c1be6?_0x18d675['count']:_0x34b57a[_0x734d('0x1f')]+_0x34b57a[_0x734d('0x1d')];var _0x44297f;if(_0x7aa671>=_0x5de199){_0x7aa671=_0x5de199;_0x44297f=0xc8;}else{_0x44297f=0xce;}_0x5a8aa7[_0x734d('0x1a')](_0x44297f);return _0x5a8aa7[_0x734d('0x20')]('Content-Range',_0x5f02a4+'-'+_0x7aa671+'/'+_0x5de199)[_0x734d('0x1b')](_0x18d675);}return null;};}function patchUpdates(_0x437b84){return function(_0x385d03){try{jsonpatch[_0x734d('0x21')](_0x385d03,_0x437b84,!![]);}catch(_0x2f3cd9){return BPromise[_0x734d('0x22')](_0x2f3cd9);}return _0x385d03[_0x734d('0x23')]();};}function saveUpdates(_0x47a658,_0x47d6ea){return function(_0x2c51c7){if(_0x2c51c7){return _0x2c51c7[_0x734d('0x24')](_0x47a658)['then'](function(_0x5093e4){return _0x5093e4;});}return null;};}function removeEntity(_0x5e1a62,_0x4b10e5){return function(_0x6729aa){if(_0x6729aa){return _0x6729aa[_0x734d('0x25')]()[_0x734d('0x26')](function(){_0x5e1a62[_0x734d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b9e89,_0x2955df){return function(_0x515185){if(!_0x515185){_0x4b9e89['sendStatus'](0x194);}return _0x515185;};}function handleError(_0x5519c9,_0x4f3ac2){_0x4f3ac2=_0x4f3ac2||0x1f4;return function(_0x4ea7de){logger[_0x734d('0x27')](_0x4ea7de[_0x734d('0x28')]);if(_0x4ea7de[_0x734d('0x29')]){delete _0x4ea7de[_0x734d('0x29')];}_0x5519c9['status'](_0x4f3ac2)[_0x734d('0x2a')](_0x4ea7de);};}exports[_0x734d('0x2b')]=function(_0x419656,_0x3c11ee){var _0x5176a0={},_0x439cc5={},_0x32295b={'count':0x0,'rows':[]};var _0x44b211=_[_0x734d('0x2c')](db[_0x734d('0x2d')][_0x734d('0x2e')],function(_0x87d016){return{'name':_0x87d016[_0x734d('0x2f')],'type':_0x87d016[_0x734d('0x30')]['key']};});_0x439cc5['model']=_[_0x734d('0x2c')](_0x44b211,_0x734d('0x29'));_0x439cc5['query']=_[_0x734d('0x31')](_0x419656[_0x734d('0x32')]);_0x439cc5['filters']=_[_0x734d('0x33')](_0x439cc5['model'],_0x439cc5[_0x734d('0x32')]);_0x5176a0[_0x734d('0x34')]=_[_0x734d('0x33')](_0x439cc5[_0x734d('0x35')],qs['fields'](_0x419656[_0x734d('0x32')][_0x734d('0x36')]));_0x5176a0['attributes']=_0x5176a0['attributes']['length']?_0x5176a0['attributes']:_0x439cc5[_0x734d('0x35')];if(!_0x419656['query'][_0x734d('0x37')](_0x734d('0x38'))){_0x5176a0['limit']=qs[_0x734d('0x1d')](_0x419656[_0x734d('0x32')][_0x734d('0x1d')]);_0x5176a0[_0x734d('0x1f')]=qs[_0x734d('0x1f')](_0x419656[_0x734d('0x32')][_0x734d('0x1f')]);}_0x5176a0['order']=qs[_0x734d('0x39')](_0x419656[_0x734d('0x32')][_0x734d('0x39')]);_0x5176a0[_0x734d('0x3a')]=qs['filters'](_[_0x734d('0x3b')](_0x419656['query'],_0x439cc5['filters']),_0x44b211);if(_0x419656[_0x734d('0x32')][_0x734d('0x3c')]){_0x5176a0[_0x734d('0x3a')]=_[_0x734d('0x3d')](_0x5176a0[_0x734d('0x3a')],{'$or':_[_0x734d('0x2c')](_0x44b211,function(_0x935547){if(_0x935547[_0x734d('0x30')]!==_0x734d('0x3e')){var _0xe1848b={};_0xe1848b[_0x935547[_0x734d('0x29')]]={'$like':'%'+_0x419656['query'][_0x734d('0x3c')]+'%'};return _0xe1848b;}})});}_0x5176a0=_[_0x734d('0x3d')]({},_0x5176a0,_0x419656[_0x734d('0x3f')]);var _0x7bb81e={'where':_0x5176a0[_0x734d('0x3a')]};return db[_0x734d('0x2d')][_0x734d('0x1e')](_0x7bb81e)['then'](function(_0x4785d6){_0x32295b[_0x734d('0x1e')]=_0x4785d6;if(_0x419656[_0x734d('0x32')][_0x734d('0x40')]){_0x5176a0[_0x734d('0x41')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x734d('0x42')](_0x5176a0);})['then'](function(_0x3ef0b1){_0x32295b[_0x734d('0x43')]=_0x3ef0b1;return _0x32295b;})[_0x734d('0x26')](respondWithFilteredResult(_0x3c11ee,_0x5176a0))[_0x734d('0x44')](handleError(_0x3c11ee,null));};exports[_0x734d('0x45')]=function(_0x122f40,_0x3f014a){var _0x4a3f5a={'raw':!![],'where':{'id':_0x122f40[_0x734d('0x46')]['id']}},_0x5a711f={};_0x5a711f['model']=_[_0x734d('0x31')](db[_0x734d('0x2d')][_0x734d('0x2e')]);_0x5a711f['query']=_[_0x734d('0x31')](_0x122f40[_0x734d('0x32')]);_0x5a711f[_0x734d('0x47')]=_[_0x734d('0x33')](_0x5a711f[_0x734d('0x35')],_0x5a711f['query']);_0x4a3f5a[_0x734d('0x34')]=_['intersection'](_0x5a711f[_0x734d('0x35')],qs[_0x734d('0x36')](_0x122f40[_0x734d('0x32')][_0x734d('0x36')]));_0x4a3f5a[_0x734d('0x34')]=_0x4a3f5a[_0x734d('0x34')][_0x734d('0x48')]?_0x4a3f5a['attributes']:_0x5a711f[_0x734d('0x35')];if(_0x122f40[_0x734d('0x32')]['includeAll']){_0x4a3f5a['include']=[{'all':!![]}];}_0x4a3f5a=_[_0x734d('0x3d')]({},_0x4a3f5a,_0x122f40[_0x734d('0x3f')]);return db['WhatsappTransferReport'][_0x734d('0x49')](_0x4a3f5a)[_0x734d('0x26')](handleEntityNotFound(_0x3f014a,null))[_0x734d('0x26')](respondWithResult(_0x3f014a,null))[_0x734d('0x44')](handleError(_0x3f014a,null));};exports[_0x734d('0x4a')]=function(_0x31e141,_0x2d9769){return db[_0x734d('0x2d')][_0x734d('0x4a')](_0x31e141[_0x734d('0x4b')],{})[_0x734d('0x26')](respondWithResult(_0x2d9769,0xc9))[_0x734d('0x44')](handleError(_0x2d9769,null));};exports['update']=function(_0x1fe3cd,_0x5cd2bc){if(_0x1fe3cd[_0x734d('0x4b')]['id']){delete _0x1fe3cd['body']['id'];}return db['WhatsappTransferReport'][_0x734d('0x49')]({'where':{'id':_0x1fe3cd[_0x734d('0x46')]['id']}})[_0x734d('0x26')](handleEntityNotFound(_0x5cd2bc,null))[_0x734d('0x26')](saveUpdates(_0x1fe3cd[_0x734d('0x4b')],null))[_0x734d('0x26')](respondWithResult(_0x5cd2bc,null))[_0x734d('0x44')](handleError(_0x5cd2bc,null));};exports[_0x734d('0x25')]=function(_0x5ee3aa,_0x2cf974){return db[_0x734d('0x2d')]['find']({'where':{'id':_0x5ee3aa['params']['id']}})['then'](handleEntityNotFound(_0x2cf974,null))[_0x734d('0x26')](removeEntity(_0x2cf974,null))[_0x734d('0x44')](handleError(_0x2cf974,null));};exports[_0x734d('0x4c')]=function(_0x1441f0,_0x2b9128){return db[_0x734d('0x2d')][_0x734d('0x4c')]()['then'](respondWithResult(_0x2b9128,null))[_0x734d('0x44')](handleError(_0x2b9128,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index d5208df..3d4d4fd 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 _0x2db3=['exports','WhatsappTransferReport','report_whatsapp_transfer','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappTransferReport.attributes'];(function(_0x6c0156,_0x5e2948){var _0x35d770=function(_0x588667){while(--_0x588667){_0x6c0156['push'](_0x6c0156['shift']());}};_0x35d770(++_0x5e2948);}(_0x2db3,0x1a7));var _0x32db=function(_0x15fc3c,_0x35665b){_0x15fc3c=_0x15fc3c-0x0;var _0x94c5c8=_0x2db3[_0x15fc3c];return _0x94c5c8;};'use strict';var _=require(_0x32db('0x0'));var util=require('util');var logger=require(_0x32db('0x1'))(_0x32db('0x2'));var moment=require(_0x32db('0x3'));var BPromise=require(_0x32db('0x4'));var rp=require(_0x32db('0x5'));var fs=require('fs');var path=require(_0x32db('0x6'));var rimraf=require('rimraf');var config=require(_0x32db('0x7'));var attributes=require(_0x32db('0x8'));module[_0x32db('0x9')]=function(_0x230b0a,_0x5b896f){return _0x230b0a['define'](_0x32db('0xa'),attributes,{'tableName':_0x32db('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x880a=['api','bluebird','request-promise','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x2ab423,_0x5481bd){var _0x3d79a8=function(_0x93949a){while(--_0x93949a){_0x2ab423['push'](_0x2ab423['shift']());}};_0x3d79a8(++_0x5481bd);}(_0x880a,0xa6));var _0xa880=function(_0xeaf15e,_0x58a614){_0xeaf15e=_0xeaf15e-0x0;var _0x12c623=_0x880a[_0xeaf15e];return _0x12c623;};'use strict';var _=require(_0xa880('0x0'));var util=require(_0xa880('0x1'));var logger=require(_0xa880('0x2'))(_0xa880('0x3'));var moment=require('moment');var BPromise=require(_0xa880('0x4'));var rp=require(_0xa880('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa880('0x6'));var attributes=require(_0xa880('0x7'));module[_0xa880('0x8')]=function(_0x108e69,_0xa1f58a){return _0x108e69[_0xa880('0x9')](_0xa880('0xa'),attributes,{'tableName':_0xa880('0xb'),'paranoid':![],'indexes':[{'name':_0xa880('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 9cd8553..1f6d312 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 _0x47f5=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2c5c41,_0x175953){var _0x307177=function(_0x5a1124){while(--_0x5a1124){_0x2c5c41['push'](_0x2c5c41['shift']());}};_0x307177(++_0x175953);}(_0x47f5,0xa8));var _0x547f=function(_0x4f32de,_0x5bd4a){_0x4f32de=_0x4f32de-0x0;var _0x149821=_0x47f5[_0x4f32de];return _0x149821;};'use strict';var _=require(_0x547f('0x0'));var util=require('util');var moment=require(_0x547f('0x1'));var BPromise=require(_0x547f('0x2'));var rs=require(_0x547f('0x3'));var fs=require('fs');var Redis=require(_0x547f('0x4'));var db=require(_0x547f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x547f('0x6'))('rpc');var config=require(_0x547f('0x7'));var jayson=require(_0x547f('0x8'));var client=jayson[_0x547f('0x9')][_0x547f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x571c0d,_0x3cdc4e,_0x486d24){return new BPromise(function(_0x5a2855,_0x200371){return client[_0x547f('0xb')](_0x571c0d,_0x486d24)[_0x547f('0xc')](function(_0xa7fa4c){logger[_0x547f('0xd')](_0x547f('0xe'),_0x3cdc4e,_0x547f('0xf'));logger[_0x547f('0x10')](_0x547f('0x11'),_0x3cdc4e,_0x547f('0xf'),JSON[_0x547f('0x12')](_0xa7fa4c));if(_0xa7fa4c[_0x547f('0x13')]){if(_0xa7fa4c[_0x547f('0x13')][_0x547f('0x14')]===0x1f4){logger[_0x547f('0x13')](_0x547f('0xe'),_0x3cdc4e,_0xa7fa4c[_0x547f('0x13')][_0x547f('0x15')]);return _0x200371(_0xa7fa4c[_0x547f('0x13')][_0x547f('0x15')]);}logger[_0x547f('0x13')](_0x547f('0xe'),_0x3cdc4e,_0xa7fa4c[_0x547f('0x13')][_0x547f('0x15')]);return _0x5a2855(_0xa7fa4c[_0x547f('0x13')][_0x547f('0x15')]);}else{logger[_0x547f('0xd')](_0x547f('0xe'),_0x3cdc4e,_0x547f('0xf'));_0x5a2855(_0xa7fa4c[_0x547f('0x16')]['message']);}})[_0x547f('0x17')](function(_0xc12fc1){logger[_0x547f('0x13')](_0x547f('0xe'),_0x3cdc4e,_0xc12fc1);_0x200371(_0xc12fc1);});});} \ No newline at end of file +var _0xe987=['request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x2e0967,_0x3fd097){var _0x180b59=function(_0x1048f2){while(--_0x1048f2){_0x2e0967['push'](_0x2e0967['shift']());}};_0x180b59(++_0x3fd097);}(_0xe987,0x162));var _0x7e98=function(_0x57e196,_0x428408){_0x57e196=_0x57e196-0x0;var _0x5941ab=_0xe987[_0x57e196];return _0x5941ab;};'use strict';var _=require('lodash');var util=require(_0x7e98('0x0'));var moment=require(_0x7e98('0x1'));var BPromise=require(_0x7e98('0x2'));var rs=require(_0x7e98('0x3'));var fs=require('fs');var Redis=require(_0x7e98('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e98('0x5'));var logger=require(_0x7e98('0x6'))(_0x7e98('0x7'));var config=require(_0x7e98('0x8'));var jayson=require(_0x7e98('0x9'));var client=jayson[_0x7e98('0xa')][_0x7e98('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e3fe8,_0x4638ac,_0x5aa9bb){return new BPromise(function(_0xb3986c,_0x3a4b7b){return client[_0x7e98('0xc')](_0x4e3fe8,_0x5aa9bb)['then'](function(_0x1c526e){logger[_0x7e98('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4638ac,_0x7e98('0xe'));logger[_0x7e98('0xf')](_0x7e98('0x10'),_0x4638ac,_0x7e98('0xe'),JSON['stringify'](_0x1c526e));if(_0x1c526e['error']){if(_0x1c526e[_0x7e98('0x11')][_0x7e98('0x12')]===0x1f4){logger[_0x7e98('0x11')](_0x7e98('0x13'),_0x4638ac,_0x1c526e[_0x7e98('0x11')][_0x7e98('0x14')]);return _0x3a4b7b(_0x1c526e[_0x7e98('0x11')]['message']);}logger[_0x7e98('0x11')](_0x7e98('0x13'),_0x4638ac,_0x1c526e['error'][_0x7e98('0x14')]);return _0xb3986c(_0x1c526e[_0x7e98('0x11')][_0x7e98('0x14')]);}else{logger[_0x7e98('0xd')](_0x7e98('0x13'),_0x4638ac,_0x7e98('0xe'));_0xb3986c(_0x1c526e[_0x7e98('0x15')][_0x7e98('0x14')]);}})[_0x7e98('0x16')](function(_0x3aa15b){logger['error'](_0x7e98('0x13'),_0x4638ac,_0x3aa15b);_0x3a4b7b(_0x3aa15b);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 3a889dd..9a0a812 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e9=['./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','seedDB','default','then','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','Online\x20apps:','online','name','join','Offline\x20apps:','App\x20Ready!','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','exit','./mysqldb','./config/seedDB','./rpc','./config/environment','app'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0x70e9,0x193));var _0x970e=function(_0x72980a,_0x119bd1){_0x72980a=_0x72980a-0x0;var _0x543cc3=_0x70e9[_0x72980a];return _0x543cc3;};'use strict';var _=require('lodash');var db=require(_0x970e('0x0'))['db'];var seedDb=require(_0x970e('0x1'));var checkLicense=require('./config/license');var rpc=require(_0x970e('0x2'));var config=require(_0x970e('0x3'));var logger=require('./config/logger')(_0x970e('0x4'));var pm2=require('./config/pm2');var pm2Config=require(_0x970e('0x5'));var schedule=require(_0x970e('0x6'));var chat=require(_0x970e('0x7'));var whatsapp=require(_0x970e('0x8'));var transcribe=require(_0x970e('0x9'));var provider=require(_0x970e('0xa'));function main(){return db[_0x970e('0xb')]['sync']()['then'](function(){if(config[_0x970e('0xc')]){return seedDb[_0x970e('0xd')]();}})['then'](function(){return checkLicense[_0x970e('0xd')]();})[_0x970e('0xe')](function(){return rpc[_0x970e('0xf')]();})['then'](function(_0x17256c){logger[_0x970e('0x10')](_0x17256c);return chat[_0x970e('0x11')]();})[_0x970e('0xe')](function(){return whatsapp[_0x970e('0x11')]();})[_0x970e('0xe')](function(){return schedule['start']();})[_0x970e('0xe')](function(){return transcribe[_0x970e('0x11')]();})[_0x970e('0xe')](function(){return provider[_0x970e('0x11')]();})[_0x970e('0xe')](function(_0x2d7b55){logger[_0x970e('0x10')](_0x2d7b55);return pm2[_0x970e('0x11')](pm2Config);})['then'](function(_0x15576b){var _0x389a08=_0x15576b['filter'](function(_0x270ebe){return typeof _0x270ebe[_0x970e('0x12')]===_0x970e('0x13')&&_0x270ebe[_0x970e('0x12')]>=0x0;});if(_0x389a08['length']>0x0){throw new Error(_0x389a08[_0x970e('0x14')]+_0x970e('0x15')+_[_0x970e('0x16')](_0x389a08,function(_0x4244a2){return'\x22'+_0x4244a2['pm2_env']['name']+'\x22';}));}logger[_0x970e('0x10')](_0x970e('0x17'),_[_0x970e('0x16')](_['filter'](_0x15576b,{'status':_0x970e('0x18')}),_0x970e('0x19'))[_0x970e('0x1a')]());logger[_0x970e('0x10')](_0x970e('0x1b'),_['map'](_['filter'](_0x15576b,function(_0x24a007){return _0x24a007['status']!==_0x970e('0x18');}),_0x970e('0x19'))[_0x970e('0x1a')]()||'None');console['log'](_0x970e('0x1c'));})[_0x970e('0x1d')](function(_0x3b4466){console[_0x970e('0x1e')](_0x970e('0x1f'),_0x3b4466);logger[_0x970e('0x20')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x3b4466);process[_0x970e('0x21')](0x1);});}main(); \ No newline at end of file +var _0x0f9f=['default','listen','info','start','number','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','name','Online\x20apps:','filter','online','join','Offline\x20apps:','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then'];(function(_0x1f5f5a,_0x2bd54c){var _0x28aab6=function(_0x164913){while(--_0x164913){_0x1f5f5a['push'](_0x1f5f5a['shift']());}};_0x28aab6(++_0x2bd54c);}(_0x0f9f,0xae));var _0xf0f9=function(_0x49d27a,_0x166543){_0x49d27a=_0x49d27a-0x0;var _0x3f0b62=_0x0f9f[_0x49d27a];return _0x3f0b62;};'use strict';var _=require(_0xf0f9('0x0'));var db=require(_0xf0f9('0x1'))['db'];var seedDb=require(_0xf0f9('0x2'));var checkLicense=require(_0xf0f9('0x3'));var rpc=require(_0xf0f9('0x4'));var config=require(_0xf0f9('0x5'));var logger=require(_0xf0f9('0x6'))(_0xf0f9('0x7'));var pm2=require(_0xf0f9('0x8'));var pm2Config=require(_0xf0f9('0x9'));var schedule=require(_0xf0f9('0xa'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xf0f9('0xb'));var transcribe=require(_0xf0f9('0xc'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0xf0f9('0xd')][_0xf0f9('0xe')]()[_0xf0f9('0xf')](function(){if(config['seedDB']){return seedDb[_0xf0f9('0x10')]();}})[_0xf0f9('0xf')](function(){return checkLicense['default']();})[_0xf0f9('0xf')](function(){return rpc[_0xf0f9('0x11')]();})[_0xf0f9('0xf')](function(_0x3be7af){logger[_0xf0f9('0x12')](_0x3be7af);return chat[_0xf0f9('0x13')]();})[_0xf0f9('0xf')](function(){return whatsapp[_0xf0f9('0x13')]();})['then'](function(){return schedule[_0xf0f9('0x13')]();})[_0xf0f9('0xf')](function(){return transcribe[_0xf0f9('0x13')]();})[_0xf0f9('0xf')](function(){return provider['start']();})[_0xf0f9('0xf')](function(_0xd4e645){logger['info'](_0xd4e645);return pm2[_0xf0f9('0x13')](pm2Config);})['then'](function(_0x538864){var _0x2c832a=_0x538864['filter'](function(_0x3e1587){return typeof _0x3e1587['exitCode']===_0xf0f9('0x14')&&_0x3e1587[_0xf0f9('0x15')]>=0x0;});if(_0x2c832a[_0xf0f9('0x16')]>0x0){throw new Error(_0x2c832a[_0xf0f9('0x16')]+_0xf0f9('0x17')+_[_0xf0f9('0x18')](_0x2c832a,function(_0x10dae6){return'\x22'+_0x10dae6['pm2_env'][_0xf0f9('0x19')]+'\x22';}));}logger[_0xf0f9('0x12')](_0xf0f9('0x1a'),_[_0xf0f9('0x18')](_[_0xf0f9('0x1b')](_0x538864,{'status':_0xf0f9('0x1c')}),_0xf0f9('0x19'))[_0xf0f9('0x1d')]());logger['info'](_0xf0f9('0x1e'),_['map'](_[_0xf0f9('0x1b')](_0x538864,function(_0x510119){return _0x510119[_0xf0f9('0x1f')]!==_0xf0f9('0x1c');}),_0xf0f9('0x19'))[_0xf0f9('0x1d')]()||_0xf0f9('0x20'));console[_0xf0f9('0x21')]('App\x20Ready!');})[_0xf0f9('0x22')](function(_0x535c2c){console[_0xf0f9('0x21')](_0xf0f9('0x23'),_0x535c2c);logger['error'](_0xf0f9('0x24'),_0x535c2c);process[_0xf0f9('0x25')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 2782290..aebd77e 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 _0x0abf=['ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','disposition','closed','unmanaged','json','Forbidden.','headers','authorization','startsWith','User','then','authenticate','Bearer','status','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','findOne','allowedLoginAttempts','blockDuration','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','add','minutes','Invalid\x20API\x20access\x20key','catch','find','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isWebrtcLicence','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey','regenerateApiKey','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','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','ValidationError','updatePasswordsHistory','length','unshift','encryptString','join','promisify','sign','secret','payload','session','randomBytes','toString','hex','floor','apiKeyIat','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','name','internal','userpic','permissions','md5secret','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments'];(function(_0xb54c57,_0x1fc398){var _0x591003=function(_0x54b56e){while(--_0x54b56e){_0xb54c57['push'](_0xb54c57['shift']());}};_0x591003(++_0x1fc398);}(_0x0abf,0xe8));var _0xf0ab=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0abf[_0x2f5ac5];return _0x37c9a8;};'use strict';var db=require(_0xf0ab('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xf0ab('0x1'));var licenseUtil=require(_0xf0ab('0x2'));var encryptor=require('../encryptor');var _=require('lodash');var jwt=require(_0xf0ab('0x3'));var expressJwt=require('express-jwt');var compose=require(_0xf0ab('0x4'));var basicAuth=require(_0xf0ab('0x5'));var crypto=require(_0xf0ab('0x6'));var BPromise=require(_0xf0ab('0x7'));var util=require(_0xf0ab('0x8'));var moment=require(_0xf0ab('0x9'));var validateJwt=expressJwt({'secret':config[_0xf0ab('0xa')]['session']});var userAttributes=['id',_0xf0ab('0xb'),_0xf0ab('0xc'),_0xf0ab('0xd'),_0xf0ab('0xe'),'email',_0xf0ab('0xf'),_0xf0ab('0x10'),_0xf0ab('0x11'),'voicePause','chatPause',_0xf0ab('0x12'),'faxPause',_0xf0ab('0x13'),_0xf0ab('0x14'),_0xf0ab('0x15'),_0xf0ab('0x16'),_0xf0ab('0x17'),_0xf0ab('0x18'),_0xf0ab('0x19'),'allowmessenger',_0xf0ab('0x1a'),_0xf0ab('0x1b'),_0xf0ab('0x1c'),_0xf0ab('0x1d'),_0xf0ab('0x1e'),_0xf0ab('0x1f'),_0xf0ab('0x20'),_0xf0ab('0x21'),_0xf0ab('0x22'),_0xf0ab('0x23'),_0xf0ab('0x24'),_0xf0ab('0x25'),_0xf0ab('0x26'),_0xf0ab('0x27'),_0xf0ab('0x28'),'privacyEnabled',_0xf0ab('0x29'),_0xf0ab('0x2a'),_0xf0ab('0x2b'),_0xf0ab('0x2c'),_0xf0ab('0x2d'),_0xf0ab('0x2e'),_0xf0ab('0x2f'),_0xf0ab('0x30'),_0xf0ab('0x31'),_0xf0ab('0x32'),_0xf0ab('0x33'),_0xf0ab('0x34'),_0xf0ab('0x35'),_0xf0ab('0x36'),_0xf0ab('0x37'),_0xf0ab('0x38'),'faxAutoanswerDelay',_0xf0ab('0x39'),_0xf0ab('0x3a'),_0xf0ab('0x3b')];exports[_0xf0ab('0x3c')]=function(){return this[_0xf0ab('0x3d')](!![])[_0xf0ab('0x3e')](function(_0x250317,_0x20140b,_0x36ad01){if(_0x250317[_0xf0ab('0x3f')]){_0x36ad01();}else{return db[_0xf0ab('0x40')]['findOne']({'where':{'id':_0x250317['params']['id']},'attributes':['id','closed',_0xf0ab('0x41')],'raw':!![]})['then'](function(_0x3eca32){if(_0x3eca32&&_0x3eca32[_0xf0ab('0x42')]){return _0x20140b['status'](_0x3eca32[_0xf0ab('0x41')]===_0xf0ab('0x43')?0x195:0x193)[_0xf0ab('0x44')]({'message':_0x3eca32[_0xf0ab('0x41')]===_0xf0ab('0x43')?'Unmanaged.':_0xf0ab('0x45')});}else{_0x36ad01();}})['catch'](function(_0x55d799){_0x36ad01(_0x55d799);});}});};exports[_0xf0ab('0x3d')]=function isAuthenticated(_0x4306c6){return compose()[_0xf0ab('0x3e')](function(_0x445160,_0x43476c,_0x174052){var _0x367302;if(_0x445160[_0xf0ab('0x46')][_0xf0ab('0x47')]){if(_[_0xf0ab('0x48')](_0x445160[_0xf0ab('0x46')][_0xf0ab('0x47')],'Basic')){var _0x1e1ffb=basicAuth(_0x445160);db[_0xf0ab('0x49')]['find']({'where':{'name':_0x1e1ffb['name']}})[_0xf0ab('0x4a')](function(_0x1dc84e){if(!_0x1dc84e||!_0x1dc84e[_0xf0ab('0x4b')](_0x1e1ffb['pass'])){return _0x43476c['status'](0x191)[_0xf0ab('0x44')]({'message':'Wrong\x20credentials.'});}_0x445160[_0xf0ab('0x3f')]={'id':_0x1dc84e['id']};_0x174052();})['catch'](function(_0x3f66fa){_0x174052(_0x3f66fa);});}else if(_[_0xf0ab('0x48')](_0x445160['headers']['authorization'],_0xf0ab('0x4c'))){validateJwt(_0x445160,_0x43476c,_0x174052);}else{if(_0x4306c6){_0x174052();}else{return _0x43476c[_0xf0ab('0x4d')](0x193)[_0xf0ab('0x44')]({'message':_0xf0ab('0x4e')});}}}else if(_0x445160[_0xf0ab('0x4f')][_0xf0ab('0x50')]){try{var _0x17f3b3={'audience':hardwareConf[_0xf0ab('0x51')](),'issuer':hardwareConf[_0xf0ab('0x51')]()};verifyJwt(_0x445160[_0xf0ab('0x4f')][_0xf0ab('0x50')],_0x17f3b3)[_0xf0ab('0x4a')](function(_0x22dcfe){return db[_0xf0ab('0x49')]['find']({'where':{'id':_0x22dcfe[_0xf0ab('0x52')]}})[_0xf0ab('0x4a')](function(_0xc575ed){_0x367302=_0xc575ed;return db['Setting'][_0xf0ab('0x53')]({'where':{'id':0x1},'attributes':[_0xf0ab('0x54'),_0xf0ab('0x55')],'raw':!![]});})['then'](function(_0x396c71){if(!_0x367302||!_['isEqual'](_0x367302[_0xf0ab('0x56')],_0x22dcfe['nonce'])){return _0x43476c[_0xf0ab('0x4d')](0x191)[_0xf0ab('0x44')]({'message':_0xf0ab('0x57')});}if(_0x367302[_0xf0ab('0x58')]){return _0x43476c[_0xf0ab('0x4d')](0x191)[_0xf0ab('0x44')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x367302[_0xf0ab('0x59')]){if(_0x396c71[_0xf0ab('0x55')]>0x0){if(moment(_0x367302['blockedAt'])[_0xf0ab('0x5a')](_0x396c71[_0xf0ab('0x55')],_0xf0ab('0x5b'))>moment()){return _0x43476c[_0xf0ab('0x4d')](0x191)[_0xf0ab('0x44')]({'message':_0xf0ab('0x5c')});}}else{return _0x43476c[_0xf0ab('0x4d')](0x191)['json']({'message':_0xf0ab('0x5c')});}}_0x445160[_0xf0ab('0x3f')]={'id':_0x367302['id']};_0x174052();});})[_0xf0ab('0x5d')](function(){return _0x43476c['status'](0x191)[_0xf0ab('0x44')]({'message':_0xf0ab('0x5c')});});}catch(_0x44077b){_0x174052(_0x44077b);}}else if(_0x4306c6){_0x174052();}else{return _0x43476c[_0xf0ab('0x4d')](0x193)[_0xf0ab('0x44')]({'message':'Unknown\x20authorization\x20format'});}})[_0xf0ab('0x3e')](function(_0x39a212,_0x28e7a4,_0x197955){if(_0x39a212[_0xf0ab('0x3f')]){db[_0xf0ab('0x49')][_0xf0ab('0x5e')]({'where':{'id':_0x39a212[_0xf0ab('0x3f')]['id']},'attributes':userAttributes})[_0xf0ab('0x4a')](function(_0x3b214a){if(!_0x3b214a){return _0x28e7a4[_0xf0ab('0x4d')](0x194)[_0xf0ab('0x44')]({'message':_0xf0ab('0x5f')});}_0x39a212['user']=_0x3b214a;_0x197955();})['catch'](function(_0x2fc677){_0x197955(_0x2fc677);});}else if(_0x4306c6){_0x197955();}else{return _0x28e7a4['status'](0x194)[_0xf0ab('0x44')]({'message':_0xf0ab('0x60')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xf0ab('0x3e')](function(_0x17ac48,_0x591d37,_0x35051f){return licenseUtil[_0xf0ab('0x61')]()[_0xf0ab('0x4a')](function(_0x1cb47a){if(_0x1cb47a[_0xf0ab('0x62')]){_0x35051f();}else{return _0x591d37[_0xf0ab('0x4d')](0x193)[_0xf0ab('0x44')]({'message':_0xf0ab('0x63')});}})[_0xf0ab('0x5d')](function(_0xe0cabc){_0x35051f(_0xe0cabc);});});};exports[_0xf0ab('0x64')]=function isWebrtcLicence(){return compose()[_0xf0ab('0x3e')](function(_0x13b477,_0x99ce7,_0x58fea3){return licenseUtil['getLicense']()[_0xf0ab('0x4a')](function(_0x4da898){if(_0x4da898['webrtc']){_0x58fea3();}else{return _0x99ce7['status'](0x193)[_0xf0ab('0x44')]({'message':_0xf0ab('0x63')});}})[_0xf0ab('0x5d')](function(_0x2df69a){_0x58fea3(_0x2df69a);});});};exports[_0xf0ab('0x65')]=function(_0x132ada,_0x472c1b,_0x1a0f21){_0x132ada[_0xf0ab('0x65')]=!![];return _0x1a0f21();};exports[_0xf0ab('0x66')]=function signToken(_0x344389){return signJwt(_0x344389);};exports[_0xf0ab('0x67')]=function(_0x4e6c9b,_0x393c9a){if(!_0x4e6c9b[_0xf0ab('0x3f')]){return _0x393c9a[_0xf0ab('0x4d')](0x194)[_0xf0ab('0x44')]({'message':_0xf0ab('0x68')});}var _0x29fb03={'payload':{'id':_0x4e6c9b[_0xf0ab('0x3f')]['id'],'role':_0x4e6c9b[_0xf0ab('0x3f')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x29fb03)['then'](function(_0x51b4a9){_0x393c9a[_0xf0ab('0x69')](_0xf0ab('0x6a'),_0x51b4a9);_0x393c9a['redirect'](_0xf0ab('0x6b'));})[_0xf0ab('0x5d')](function(_0x4edb01){return _0x393c9a[_0xf0ab('0x4d')](0x1f4)[_0xf0ab('0x6c')](_0x4edb01);});};exports[_0xf0ab('0x6d')]=function(_0xe4ef6d){if(_[_0xf0ab('0x6e')](_0xe4ef6d[_0xf0ab('0x56')])||_[_0xf0ab('0x6e')](_0xe4ef6d['apiKeyIat'])){return null;}else{return createJwt(_0xe4ef6d);}};exports[_0xf0ab('0x6f')]=function(_0x59e7dd){_0x59e7dd[_0xf0ab('0x56')]=generateNonce();_0x59e7dd['apiKeyIat']=generateIssuedAt();return createJwt(_0x59e7dd);};exports[_0xf0ab('0x70')]=function(_0x5c721a,_0x535274){var _0x1e3b91=_0x5c721a['query'][_0xf0ab('0x50')];if(_0x1e3b91){var _0x54efed={'nonce':_0x535274[_0xf0ab('0x56')],'iat':_0x535274['apiKeyIat'],'audience':hardwareConf[_0xf0ab('0x51')](),'issuer':hardwareConf[_0xf0ab('0x51')]()};return verifyJwt(_0x1e3b91,_0x54efed)[_0xf0ab('0x4a')](function(){return generateApiKey(_0x535274);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x57b05f){var _0x2db43d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2db43d[_0xf0ab('0x71')](_0x57b05f))throw new db['Sequelize']['ValidationError'](_0xf0ab('0x72'));return;};exports[_0xf0ab('0x73')]=function(_0x8df75a,_0x4ead7d,_0x227597){var _0x41ea9d=encryptor[_0xf0ab('0x74')](_0x4ead7d)[_0xf0ab('0x75')](',');for(var _0x1d7616=0x0;_0x1d7616<_0x227597;_0x1d7616++){if(!_0x41ea9d[_0x1d7616])break;if(_0x8df75a[_0xf0ab('0x76')]()===_0x41ea9d[_0x1d7616][_0xf0ab('0x76')]()){var _0x4d80a6=util[_0xf0ab('0x77')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x227597);if(_0x227597===0x1){_0x4d80a6=_0xf0ab('0x78');}throw new db[(_0xf0ab('0x79'))][(_0xf0ab('0x7a'))](_0x4d80a6);}}return;};exports[_0xf0ab('0x7b')]=function(_0x3e1b85,_0x3c168f){var _0x152e80=_0x3c168f?encryptor[_0xf0ab('0x74')](_0x3c168f)[_0xf0ab('0x75')](','):[];if(_0x152e80[_0xf0ab('0x7c')]===0x5){_0x152e80['splice'](-0x1,0x1);}_0x152e80[_0xf0ab('0x7d')](_0x3e1b85);return encryptor[_0xf0ab('0x7e')](_0x152e80[_0xf0ab('0x7f')](','));};function signJwt(_0x1d4a72){var _0x2232eb=BPromise[_0xf0ab('0x80')](jwt[_0xf0ab('0x81')],{'context':jwt});var _0x14f61e=_0x1d4a72[_0xf0ab('0x82')]||config['secrets']['session'];return new BPromise(function(_0x7e0318,_0x5c286d){_0x2232eb(_0x1d4a72[_0xf0ab('0x83')],_0x14f61e,_0x1d4a72['options'])[_0xf0ab('0x4a')](function(_0x1cc702){_0x7e0318(_0x1cc702);})[_0xf0ab('0x5d')](function(_0x5daeda){_0x5c286d(_0x5daeda);});});}function verifyJwt(_0x2c1a44,_0x16522b,_0x3fc57e){var _0x3d333f=BPromise[_0xf0ab('0x80')](jwt['verify'],{'context':jwt});var _0x3f0e11=_0x3fc57e||config[_0xf0ab('0xa')][_0xf0ab('0x84')];return new BPromise(function(_0x4531ae,_0x14cd6f){_0x3d333f(_0x2c1a44,_0x3f0e11,_0x16522b)[_0xf0ab('0x4a')](function(_0xe3fc19){_0x4531ae(_0xe3fc19);})[_0xf0ab('0x5d')](function(_0x2d9194){_0x14cd6f(_0x2d9194);});});}function generateNonce(){return crypto[_0xf0ab('0x85')](0x10)[_0xf0ab('0x86')](_0xf0ab('0x87'));}function generateIssuedAt(){return Math[_0xf0ab('0x88')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x3e1f1e){var _0x1490de={'payload':{'iat':_0x3e1f1e[_0xf0ab('0x89')],'nonce':_0x3e1f1e['apiKeyNonce']},'options':{'algorithm':_0xf0ab('0x8a'),'subject':_0x3e1f1e['id']['toString'](),'issuer':hardwareConf[_0xf0ab('0x51')](),'audience':hardwareConf[_0xf0ab('0x51')]()}};return signJwt(_0x1490de)[_0xf0ab('0x4a')](function(_0x52e201){return{'iat':_0x3e1f1e[_0xf0ab('0x89')],'nonce':_0x3e1f1e['apiKeyNonce'],'token':_0x52e201};});} \ No newline at end of file +var _0x6cb4=['../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','util','secrets','session','role','fullname','name','internal','userpic','permissions','voicePause','chatPause','faxPause','smsPause','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','privacyEnabled','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','closed','disposition','then','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','User','find','pass','json','Wrong\x20credentials.','startsWith','status','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blocked','add','Invalid\x20API\x20access\x20key','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isWebrtcLicence','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','length','unshift','encryptString','join','promisify','sign','secret','options','verify','toString','hex','floor','now','../../mysqldb','../../config/environment','../../config/license/hardware'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x6cb4,0xff));var _0x46cb=function(_0x4db7b3,_0xa7135){_0x4db7b3=_0x4db7b3-0x0;var _0x2c7318=_0x6cb4[_0x4db7b3];return _0x2c7318;};'use strict';var db=require(_0x46cb('0x0'))['db'];var config=require(_0x46cb('0x1'));var hardwareConf=require(_0x46cb('0x2'));var licenseUtil=require(_0x46cb('0x3'));var encryptor=require(_0x46cb('0x4'));var _=require(_0x46cb('0x5'));var jwt=require(_0x46cb('0x6'));var expressJwt=require(_0x46cb('0x7'));var compose=require(_0x46cb('0x8'));var basicAuth=require('basic-auth');var crypto=require(_0x46cb('0x9'));var BPromise=require('bluebird');var util=require(_0x46cb('0xa'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x46cb('0xb')][_0x46cb('0xc')]});var userAttributes=['id',_0x46cb('0xd'),_0x46cb('0xe'),_0x46cb('0xf'),_0x46cb('0x10'),'email',_0x46cb('0x11'),_0x46cb('0x12'),'md5secret',_0x46cb('0x13'),_0x46cb('0x14'),'mailPause',_0x46cb('0x15'),_0x46cb('0x16'),'openchannelPause','pauseType','showWebBar',_0x46cb('0x17'),_0x46cb('0x18'),_0x46cb('0x19'),_0x46cb('0x1a'),'passwordResetAt',_0x46cb('0x1b'),_0x46cb('0x1c'),_0x46cb('0x1d'),_0x46cb('0x1e'),_0x46cb('0x1f'),_0x46cb('0x20'),_0x46cb('0x21'),_0x46cb('0x22'),_0x46cb('0x23'),_0x46cb('0x24'),_0x46cb('0x25'),'hotdesk',_0x46cb('0x26'),'userProfileId',_0x46cb('0x27'),'settingsEnabled','wssPort','downloadVoiceRecordings',_0x46cb('0x28'),_0x46cb('0x29'),_0x46cb('0x2a'),_0x46cb('0x2b'),_0x46cb('0x2c'),_0x46cb('0x2d'),_0x46cb('0x2e'),_0x46cb('0x2f'),_0x46cb('0x30'),_0x46cb('0x31'),_0x46cb('0x32'),_0x46cb('0x33'),_0x46cb('0x34'),_0x46cb('0x35'),_0x46cb('0x36'),_0x46cb('0x37'),_0x46cb('0x38')];exports[_0x46cb('0x39')]=function(){return this[_0x46cb('0x3a')](!![])[_0x46cb('0x3b')](function(_0x32a59b,_0x1e9e38,_0x309e4b){if(_0x32a59b[_0x46cb('0x3c')]){_0x309e4b();}else{return db[_0x46cb('0x3d')]['findOne']({'where':{'id':_0x32a59b['params']['id']},'attributes':['id',_0x46cb('0x3e'),_0x46cb('0x3f')],'raw':!![]})[_0x46cb('0x40')](function(_0xe078a8){if(_0xe078a8&&_0xe078a8[_0x46cb('0x3e')]){return _0x1e9e38['status'](_0xe078a8[_0x46cb('0x3f')]==='unmanaged'?0x195:0x193)['json']({'message':_0xe078a8['disposition']===_0x46cb('0x41')?_0x46cb('0x42'):_0x46cb('0x43')});}else{_0x309e4b();}})[_0x46cb('0x44')](function(_0x7cd177){_0x309e4b(_0x7cd177);});}});};exports[_0x46cb('0x3a')]=function isAuthenticated(_0x378dc7){return compose()[_0x46cb('0x3b')](function(_0x2b846a,_0x12e01e,_0x4620ef){var _0x4a1517;if(_0x2b846a[_0x46cb('0x45')][_0x46cb('0x46')]){if(_['startsWith'](_0x2b846a['headers'][_0x46cb('0x46')],'Basic')){var _0x27c22d=basicAuth(_0x2b846a);db[_0x46cb('0x47')][_0x46cb('0x48')]({'where':{'name':_0x27c22d[_0x46cb('0xf')]}})[_0x46cb('0x40')](function(_0x33c248){if(!_0x33c248||!_0x33c248['authenticate'](_0x27c22d[_0x46cb('0x49')])){return _0x12e01e['status'](0x191)[_0x46cb('0x4a')]({'message':_0x46cb('0x4b')});}_0x2b846a['user']={'id':_0x33c248['id']};_0x4620ef();})[_0x46cb('0x44')](function(_0x3f0eb4){_0x4620ef(_0x3f0eb4);});}else if(_[_0x46cb('0x4c')](_0x2b846a[_0x46cb('0x45')][_0x46cb('0x46')],'Bearer')){validateJwt(_0x2b846a,_0x12e01e,_0x4620ef);}else{if(_0x378dc7){_0x4620ef();}else{return _0x12e01e[_0x46cb('0x4d')](0x193)['json']({'message':_0x46cb('0x4e')});}}}else if(_0x2b846a[_0x46cb('0x4f')][_0x46cb('0x50')]){try{var _0x50000e={'audience':hardwareConf[_0x46cb('0x51')](),'issuer':hardwareConf[_0x46cb('0x51')]()};verifyJwt(_0x2b846a['query'][_0x46cb('0x50')],_0x50000e)[_0x46cb('0x40')](function(_0x3ba467){return db[_0x46cb('0x47')][_0x46cb('0x48')]({'where':{'id':_0x3ba467[_0x46cb('0x52')]}})[_0x46cb('0x40')](function(_0x3dabed){_0x4a1517=_0x3dabed;return db[_0x46cb('0x53')][_0x46cb('0x54')]({'where':{'id':0x1},'attributes':[_0x46cb('0x55'),'blockDuration'],'raw':!![]});})['then'](function(_0x4ed12c){if(!_0x4a1517||!_[_0x46cb('0x56')](_0x4a1517[_0x46cb('0x57')],_0x3ba467[_0x46cb('0x58')])){return _0x12e01e[_0x46cb('0x4d')](0x191)[_0x46cb('0x4a')]({'message':_0x46cb('0x59')});}if(_0x4a1517['disabled']){return _0x12e01e[_0x46cb('0x4d')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}if(_0x4a1517[_0x46cb('0x5a')]){if(_0x4ed12c['blockDuration']>0x0){if(moment(_0x4a1517['blockedAt'])[_0x46cb('0x5b')](_0x4ed12c['blockDuration'],'minutes')>moment()){return _0x12e01e[_0x46cb('0x4d')](0x191)[_0x46cb('0x4a')]({'message':_0x46cb('0x5c')});}}else{return _0x12e01e[_0x46cb('0x4d')](0x191)[_0x46cb('0x4a')]({'message':_0x46cb('0x5c')});}}_0x2b846a[_0x46cb('0x3c')]={'id':_0x4a1517['id']};_0x4620ef();});})['catch'](function(){return _0x12e01e[_0x46cb('0x4d')](0x191)['json']({'message':_0x46cb('0x5c')});});}catch(_0x58e8fe){_0x4620ef(_0x58e8fe);}}else if(_0x378dc7){_0x4620ef();}else{return _0x12e01e[_0x46cb('0x4d')](0x193)[_0x46cb('0x4a')]({'message':_0x46cb('0x4e')});}})['use'](function(_0x43b5d2,_0x440a89,_0x4d24b6){if(_0x43b5d2[_0x46cb('0x3c')]){db[_0x46cb('0x47')][_0x46cb('0x48')]({'where':{'id':_0x43b5d2[_0x46cb('0x3c')]['id']},'attributes':userAttributes})[_0x46cb('0x40')](function(_0x524558){if(!_0x524558){return _0x440a89['status'](0x194)[_0x46cb('0x4a')]({'message':'User\x20not\x20found.'});}_0x43b5d2[_0x46cb('0x3c')]=_0x524558;_0x4d24b6();})[_0x46cb('0x44')](function(_0x563e9b){_0x4d24b6(_0x563e9b);});}else if(_0x378dc7){_0x4d24b6();}else{return _0x440a89[_0x46cb('0x4d')](0x194)[_0x46cb('0x4a')]({'message':_0x46cb('0x5d')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x5cbdad,_0x57fedd,_0x2da047){return licenseUtil[_0x46cb('0x5e')]()[_0x46cb('0x40')](function(_0x58eb69){if(_0x58eb69[_0x46cb('0x5f')]){_0x2da047();}else{return _0x57fedd['status'](0x193)['json']({'message':_0x46cb('0x60')});}})[_0x46cb('0x44')](function(_0x5203bf){_0x2da047(_0x5203bf);});});};exports[_0x46cb('0x61')]=function isWebrtcLicence(){return compose()[_0x46cb('0x3b')](function(_0x12f31e,_0x22fbbd,_0x189809){return licenseUtil[_0x46cb('0x5e')]()[_0x46cb('0x40')](function(_0x535a68){if(_0x535a68['webrtc']){_0x189809();}else{return _0x22fbbd[_0x46cb('0x4d')](0x193)['json']({'message':_0x46cb('0x60')});}})[_0x46cb('0x44')](function(_0x1e3f80){_0x189809(_0x1e3f80);});});};exports['isMiddleware']=function(_0x37163b,_0x5c1665,_0x5c02c9){_0x37163b[_0x46cb('0x62')]=!![];return _0x5c02c9();};exports[_0x46cb('0x63')]=function signToken(_0x2c96b7){return signJwt(_0x2c96b7);};exports[_0x46cb('0x64')]=function(_0x1b2072,_0x26adb4){if(!_0x1b2072[_0x46cb('0x3c')]){return _0x26adb4['status'](0x194)['json']({'message':_0x46cb('0x65')});}var _0x12bb44={'payload':{'id':_0x1b2072['user']['id'],'role':_0x1b2072[_0x46cb('0x3c')][_0x46cb('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x12bb44)[_0x46cb('0x40')](function(_0x3b8ae1){_0x26adb4[_0x46cb('0x66')]('motion.token',_0x3b8ae1);_0x26adb4[_0x46cb('0x67')](_0x46cb('0x68'));})[_0x46cb('0x44')](function(_0x52d1a7){return _0x26adb4[_0x46cb('0x4d')](0x1f4)['send'](_0x52d1a7);});};exports['retrieveApiKey']=function(_0x1e46cc){if(_[_0x46cb('0x69')](_0x1e46cc[_0x46cb('0x57')])||_[_0x46cb('0x69')](_0x1e46cc[_0x46cb('0x6a')])){return null;}else{return createJwt(_0x1e46cc);}};exports['generateApiKey']=function(_0x30d3a6){_0x30d3a6[_0x46cb('0x57')]=generateNonce();_0x30d3a6['apiKeyIat']=generateIssuedAt();return createJwt(_0x30d3a6);};exports['regenerateApiKey']=function(_0x1230db,_0xfccf57){var _0x108e57=_0x1230db['query'][_0x46cb('0x50')];if(_0x108e57){var _0x44060a={'nonce':_0xfccf57[_0x46cb('0x57')],'iat':_0xfccf57[_0x46cb('0x6a')],'audience':hardwareConf[_0x46cb('0x51')](),'issuer':hardwareConf[_0x46cb('0x51')]()};return verifyJwt(_0x108e57,_0x44060a)[_0x46cb('0x40')](function(){return generateApiKey(_0xfccf57);});}else{throw{'message':_0x46cb('0x6b')};}};exports[_0x46cb('0x6c')]=function(_0x5d7466){var _0x23f673=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x23f673['test'](_0x5d7466))throw new db[(_0x46cb('0x6d'))][(_0x46cb('0x6e'))](_0x46cb('0x6f'));return;};exports[_0x46cb('0x70')]=function(_0x532aa2,_0x67fb77,_0x13d25f){var _0xc80b74=encryptor[_0x46cb('0x71')](_0x67fb77)[_0x46cb('0x72')](',');for(var _0x28ebe2=0x0;_0x28ebe2<_0x13d25f;_0x28ebe2++){if(!_0xc80b74[_0x28ebe2])break;if(_0x532aa2[_0x46cb('0x73')]()===_0xc80b74[_0x28ebe2][_0x46cb('0x73')]()){var _0x57c29b=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x13d25f);if(_0x13d25f===0x1){_0x57c29b='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0x46cb('0x6d'))][(_0x46cb('0x6e'))](_0x57c29b);}}return;};exports['updatePasswordsHistory']=function(_0x429b39,_0xfa28a8){var _0x10c3f9=_0xfa28a8?encryptor['decryptString'](_0xfa28a8)['split'](','):[];if(_0x10c3f9[_0x46cb('0x74')]===0x5){_0x10c3f9['splice'](-0x1,0x1);}_0x10c3f9[_0x46cb('0x75')](_0x429b39);return encryptor[_0x46cb('0x76')](_0x10c3f9[_0x46cb('0x77')](','));};function signJwt(_0xdd2480){var _0x47455d=BPromise[_0x46cb('0x78')](jwt[_0x46cb('0x79')],{'context':jwt});var _0x1ba8c0=_0xdd2480[_0x46cb('0x7a')]||config[_0x46cb('0xb')][_0x46cb('0xc')];return new BPromise(function(_0x472bb2,_0xc4b991){_0x47455d(_0xdd2480['payload'],_0x1ba8c0,_0xdd2480[_0x46cb('0x7b')])['then'](function(_0x3be7b4){_0x472bb2(_0x3be7b4);})[_0x46cb('0x44')](function(_0x3f2936){_0xc4b991(_0x3f2936);});});}function verifyJwt(_0x19ff4f,_0x4f02e9,_0x3dc4bd){var _0x656601=BPromise['promisify'](jwt[_0x46cb('0x7c')],{'context':jwt});var _0x1b5a00=_0x3dc4bd||config[_0x46cb('0xb')][_0x46cb('0xc')];return new BPromise(function(_0x4f65f9,_0x11184e){_0x656601(_0x19ff4f,_0x1b5a00,_0x4f02e9)[_0x46cb('0x40')](function(_0x6dc790){_0x4f65f9(_0x6dc790);})[_0x46cb('0x44')](function(_0x442243){_0x11184e(_0x442243);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x46cb('0x7d')](_0x46cb('0x7e'));}function generateIssuedAt(){return Math[_0x46cb('0x7f')](Date[_0x46cb('0x80')]()/0x3e8)[_0x46cb('0x7d')]();}function createJwt(_0x1938e6){var _0xc94cca={'payload':{'iat':_0x1938e6[_0x46cb('0x6a')],'nonce':_0x1938e6['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x1938e6['id']['toString'](),'issuer':hardwareConf[_0x46cb('0x51')](),'audience':hardwareConf[_0x46cb('0x51')]()}};return signJwt(_0xc94cca)[_0x46cb('0x40')](function(_0xd2ab18){return{'iat':_0x1938e6[_0x46cb('0x6a')],'nonce':_0x1938e6[_0x46cb('0x57')],'token':_0xd2ab18};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index e60758d..6c37f24 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6486=['where','default','fields','filter','user','clause','tags','tag','countFilteredContacts','count','User','buildContactsQuery','getFilteredContacts','catch','describe','CmContact','keys','startsWith','cf_','map','CmCustomField','findOne','slice','all','length','type','lodash','./sql-utils','../../mysqldb','skipContactsQuery','resolve','then','search'];(function(_0x24759f,_0x138533){var _0x25d89f=function(_0x1b6c61){while(--_0x1b6c61){_0x24759f['push'](_0x24759f['shift']());}};_0x25d89f(++_0x138533);}(_0x6486,0x7d));var _0x6648=function(_0x24c733,_0x525907){_0x24c733=_0x24c733-0x0;var _0x21a2d3=_0x6486[_0x24c733];return _0x21a2d3;};'use strict';var _=require(_0x6648('0x0'));var sqlUtils=require(_0x6648('0x1'));var db=require(_0x6648('0x2'))['db'];exports['findAll']=function(_0x1059ef,_0x9f0440,_0x1be1b4,_0xd9338d){var _0x1da5ea={'count':0x0,'rows':[]};var _0x136d15=sqlUtils[_0x6648('0x3')](_0x9f0440,_0x1059ef);if(_0x136d15){return Promise['resolve'](_0x1da5ea);}var _0x55e814=sqlUtils['getContactsSubquery']();var _0xd7de87={};var _0x400052=![];var _0x5c4003=![];return Promise[_0x6648('0x4')]()[_0x6648('0x5')](function(){if(_0x1059ef[_0x6648('0x6')]){return sqlUtils['parseAdvancedSearchFilter'](_0x1059ef[_0x6648('0x6')],_0xd9338d);}else{return sqlUtils['parseQueryParameters'](_0x1059ef,_0xd9338d);}})['then'](function(_0x4bc94c){_0x55e814[_0x6648('0x7')](_0x4bc94c[_0x6648('0x8')]);_0x55e814[_0x6648('0x7')](_0x4bc94c[_0x6648('0x9')]);_0x55e814['where'](_0x4bc94c[_0x6648('0xa')]);_0x55e814['where'](_0x4bc94c[_0x6648('0xb')][_0x6648('0xc')]);_0xd7de87=_0x4bc94c[_0x6648('0xd')];_0x5c4003=_0x4bc94c[_0x6648('0xb')]['skip'];return sqlUtils['checkListsRestrictions'](_0x9f0440,_0x1059ef,_0x5c4003);})['then'](function(_0x341cdf){_0x55e814[_0x6648('0x7')](_0x341cdf);var _0x37899f=_0x1059ef[_0x6648('0x6')]?_0xd7de87['ids']:_0x1059ef[_0x6648('0xe')];_0x400052=_0x37899f?!![]:![];return sqlUtils[_0x6648('0xf')](_0x55e814,_0x37899f);})[_0x6648('0x5')](function(_0x4c94ab){_0x1da5ea[_0x6648('0x10')]=_0x4c94ab;if(_0x1da5ea[_0x6648('0x10')]===0x0){return;}if(_0x1059ef[_0x6648('0x11')]){_0x5c4003=!![];}return sqlUtils[_0x6648('0x12')](_0x55e814,_0x1059ef['fields'],_0x1be1b4,_0x400052,_0xd7de87['clause'],_0x5c4003);})[_0x6648('0x5')](function(_0x570500){if(!_0x570500){return[];}return sqlUtils[_0x6648('0x13')](_0x570500,_0x1059ef,_0x1be1b4);})[_0x6648('0x5')](function(_0x3b0d63){_0x1da5ea['rows']=_0x3b0d63;return _0x1da5ea;})[_0x6648('0x14')](function(_0x17024c){throw _0x17024c;});};exports[_0x6648('0x15')]=function(){var _0x5b6164={};var _0x4e3d17=[];return db[_0x6648('0x16')]['describe']()[_0x6648('0x5')](function(_0x3356b3){_0x5b6164=_0x3356b3;var _0x598770=Object[_0x6648('0x17')](_0x5b6164)['filter'](function(_0x4378f4){return _[_0x6648('0x18')](_0x4378f4,_0x6648('0x19'))?_0x4378f4:undefined;});var _0x1c79c8=_0x598770[_0x6648('0x1a')](function(_0x4cbf08){return db[_0x6648('0x1b')][_0x6648('0x1c')]({'where':{'id':_0x4cbf08[_0x6648('0x1d')](0x3)},'raw':!![]});});return Promise[_0x6648('0x1e')](_0x1c79c8);})['then'](function(_0x270cbe){for(var _0x2f9eb0=0x0;_0x2f9eb0<_0x270cbe[_0x6648('0x1f')];_0x2f9eb0++){if(_0x270cbe[_0x2f9eb0]){var _0x5b26a0=_0x6648('0x19')+_0x270cbe[_0x2f9eb0]['id'];_0x5b6164[_0x5b26a0]['fieldType']=_0x270cbe[_0x2f9eb0][_0x6648('0x20')];}}_0x4e3d17=_[_0x6648('0x1a')](Object[_0x6648('0x17')](_0x5b6164),function(_0x3f979d){return{'name':_0x3f979d,'type':_0x5b6164[_0x3f979d][_0x6648('0x20')]};});return _0x4e3d17;})['catch'](function(_0x119b03){throw _0x119b03;});}; \ No newline at end of file +var _0x0d0f=['../../mysqldb','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','default','where','user','clause','tags','checkListsRestrictions','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','keys','filter','map','CmCustomField','findOne','slice','all','cf_','type','./sql-utils'];(function(_0x5a715e,_0x5551e7){var _0x25d0f1=function(_0x314a8c){while(--_0x314a8c){_0x5a715e['push'](_0x5a715e['shift']());}};_0x25d0f1(++_0x5551e7);}(_0x0d0f,0x192));var _0xf0d0=function(_0x864853,_0x1b7287){_0x864853=_0x864853-0x0;var _0x2d1509=_0x0d0f[_0x864853];return _0x2d1509;};'use strict';var _=require('lodash');var sqlUtils=require(_0xf0d0('0x0'));var db=require(_0xf0d0('0x1'))['db'];exports['findAll']=function(_0x130133,_0x2e9666,_0x443cfc,_0x4e65b1){var _0x3368f0={'count':0x0,'rows':[]};var _0x427a7c=sqlUtils['skipContactsQuery'](_0x2e9666,_0x130133);if(_0x427a7c){return Promise[_0xf0d0('0x2')](_0x3368f0);}var _0x3e6e6c=sqlUtils[_0xf0d0('0x3')]();var _0x208798={};var _0x3b68c2=![];var _0x5316f5=![];return Promise[_0xf0d0('0x2')]()[_0xf0d0('0x4')](function(){if(_0x130133[_0xf0d0('0x5')]){return sqlUtils[_0xf0d0('0x6')](_0x130133[_0xf0d0('0x5')],_0x4e65b1);}else{return sqlUtils['parseQueryParameters'](_0x130133,_0x4e65b1);}})['then'](function(_0x1bc795){_0x3e6e6c['where'](_0x1bc795[_0xf0d0('0x7')]);_0x3e6e6c[_0xf0d0('0x8')](_0x1bc795['fields']);_0x3e6e6c['where'](_0x1bc795['filter']);_0x3e6e6c[_0xf0d0('0x8')](_0x1bc795[_0xf0d0('0x9')][_0xf0d0('0xa')]);_0x208798=_0x1bc795[_0xf0d0('0xb')];_0x5316f5=_0x1bc795[_0xf0d0('0x9')]['skip'];return sqlUtils[_0xf0d0('0xc')](_0x2e9666,_0x130133,_0x5316f5);})[_0xf0d0('0x4')](function(_0x4e6662){_0x3e6e6c[_0xf0d0('0x8')](_0x4e6662);var _0x6ad1e=_0x130133[_0xf0d0('0x5')]?_0x208798[_0xf0d0('0xd')]:_0x130133[_0xf0d0('0xe')];_0x3b68c2=_0x6ad1e?!![]:![];return sqlUtils[_0xf0d0('0xf')](_0x3e6e6c,_0x6ad1e);})[_0xf0d0('0x4')](function(_0x4b881a){_0x3368f0[_0xf0d0('0x10')]=_0x4b881a;if(_0x3368f0[_0xf0d0('0x10')]===0x0){return;}if(_0x130133['User']){_0x5316f5=!![];}return sqlUtils[_0xf0d0('0x11')](_0x3e6e6c,_0x130133['fields'],_0x443cfc,_0x3b68c2,_0x208798[_0xf0d0('0xa')],_0x5316f5);})['then'](function(_0x48be5e){if(!_0x48be5e){return[];}return sqlUtils[_0xf0d0('0x12')](_0x48be5e,_0x130133,_0x443cfc);})[_0xf0d0('0x4')](function(_0x278e0c){_0x3368f0[_0xf0d0('0x13')]=_0x278e0c;return _0x3368f0;})[_0xf0d0('0x14')](function(_0x156f87){throw _0x156f87;});};exports['describe']=function(){var _0x106b60={};var _0x4ca96f=[];return db['CmContact'][_0xf0d0('0x15')]()[_0xf0d0('0x4')](function(_0x5f58d0){_0x106b60=_0x5f58d0;var _0x178173=Object[_0xf0d0('0x16')](_0x106b60)[_0xf0d0('0x17')](function(_0x25085a){return _['startsWith'](_0x25085a,'cf_')?_0x25085a:undefined;});var _0x579984=_0x178173[_0xf0d0('0x18')](function(_0x44bffa){return db[_0xf0d0('0x19')][_0xf0d0('0x1a')]({'where':{'id':_0x44bffa[_0xf0d0('0x1b')](0x3)},'raw':!![]});});return Promise[_0xf0d0('0x1c')](_0x579984);})[_0xf0d0('0x4')](function(_0x19dd38){for(var _0x509c3c=0x0;_0x509c3c<_0x19dd38['length'];_0x509c3c++){if(_0x19dd38[_0x509c3c]){var _0x1c23f4=_0xf0d0('0x1d')+_0x19dd38[_0x509c3c]['id'];_0x106b60[_0x1c23f4]['fieldType']=_0x19dd38[_0x509c3c][_0xf0d0('0x1e')];}}_0x4ca96f=_[_0xf0d0('0x18')](Object['keys'](_0x106b60),function(_0x16f670){return{'name':_0x16f670,'type':_0x106b60[_0x16f670][_0xf0d0('0x1e')]};});return _0x4ca96f;})['catch'](function(_0x25b0a9){throw _0x25b0a9;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 6df467f..c424bb5 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e22=['sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','DATE','type','default','start','value','end','map','tags','ids','user','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','User','and','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','fields','tag','then','clause','filter','resolve','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','Tags','clone','COUNT(*)','group','c.id','isEmpty','squel','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','ct.CmContactId\x20=\x20','tools_tags','firstName','phone','mobile','fax','email','createdAt','updatedAt','deletedAt','includes','push','forEach','TagIds','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e22,0x115));var _0x20e2=function(_0x409682,_0x370090){_0x409682=_0x409682-0x0;var _0x1ee901=_0x0e22[_0x409682];return _0x1ee901;};'use strict';var _=require('lodash');var squel=require(_0x20e2('0x0'));var as=require('../parsers/advancedSearch');var qs=require(_0x20e2('0x1'));var utils=require(_0x20e2('0x2'));var db=require(_0x20e2('0x3'))['db'];function skipContactsQuery(_0xca1120,_0x58caca){var _0x1a3190=![];if(_0xca1120[_0x20e2('0x4')]===_0x20e2('0x5')&&!_0x58caca[_0x20e2('0x6')]&&!_0x58caca[_0x20e2('0x7')]&&_0x58caca[_0x20e2('0x8')]!==_0x20e2('0x9')){_0x1a3190=!![];}return _0x1a3190;}function getContactsSubquery(){return squel[_0x20e2('0xa')]()[_0x20e2('0xb')](_0x20e2('0xc'),'c')[_0x20e2('0xd')](_0x20e2('0xe'));}function applyJoinClauses(_0x4c78a9,_0x400121){var _0x513129=_0x400121?'c':_0x20e2('0xf');_0x4c78a9[_0x20e2('0x10')](_0x20e2('0x11'),'uc',_0x20e2('0x12')+_0x513129+_0x20e2('0x13'))[_0x20e2('0x10')]('cm_contact_has_tags','ct',_0x20e2('0x14')+_0x513129+_0x20e2('0x13'))[_0x20e2('0x10')](_0x20e2('0x15'),'t','t.id\x20=\x20ct.TagId');return _0x4c78a9;}function addFieldsToQuery(_0x15369d,_0x451d5b,_0x3eb834,_0x5651df,_0x2c7f2e){var _0x4ddba0=_0x2c7f2e?'c':_0x20e2('0xf');if(!_0x451d5b){_0x451d5b=['id',_0x20e2('0x16'),'lastName',_0x20e2('0x17'),_0x20e2('0x18'),_0x20e2('0x19'),_0x20e2('0x1a'),_0x20e2('0x7'),'CompanyId',_0x20e2('0x1b'),_0x20e2('0x1c'),_0x20e2('0x1d'),'TagIds'];}else if(!_0x451d5b[_0x20e2('0x1e')]('id')){_0x451d5b[_0x20e2('0x1f')]('id');}var _0x28ebcf=_0x3eb834&&_0x2c7f2e||!_0x3eb834&&!_0x2c7f2e;if(_0x5651df){_0x28ebcf=_0x5651df&&_0x2c7f2e||!_0x5651df&&!_0x2c7f2e;}_0x451d5b[_0x20e2('0x20')](function(_0x28ea2a){if(_0x28ea2a===_0x20e2('0x21')){if(_0x28ebcf){_0x15369d[_0x20e2('0x22')](_0x20e2('0x23'),_0x28ea2a);}else if(_0x3eb834||_0x5651df){_0x15369d[_0x20e2('0x22')](_0x4ddba0+'.'+_0x28ea2a);}}else{_0x15369d[_0x20e2('0x22')](_0x4ddba0+'.'+_0x28ea2a);}});return _0x15369d;}function getSqlClauses(){var _0x2863ad={'default':squel[_0x20e2('0x24')](),'fields':squel[_0x20e2('0x24')](),'filter':squel[_0x20e2('0x24')](),'tags':{'clause':squel[_0x20e2('0x24')](),'ids':null},'user':{'clause':squel[_0x20e2('0x24')](),'skip':![]}};return _0x2863ad;}function parseTagParameter(_0x319c44){var _0xc9c17d=squel['expr']();if(_0x319c44){var _0x4bcc45=utils[_0x20e2('0x25')](_0x319c44);_0x4bcc45[_0x20e2('0x20')](function(_0xb3da84){_0xc9c17d['or'](_0x20e2('0x26'),'%,'+_0xb3da84+',%');});}return _0xc9c17d;}function parseSearchFilter(_0x19ec55){var _0x10f4c4=squel['expr']();if(_0x19ec55){var _0x2b2ceb=_0x19ec55[_0x20e2('0x27')]('\x5c','\x5c\x5c')[_0x20e2('0x27')](/'/g,'\x27\x27');if(_0x2b2ceb[_0x20e2('0x28')]('\x20')[_0x20e2('0x29')]>0x1){_0x10f4c4['or'](_0x20e2('0x2a'),qs['getFullTextValue'](_0x2b2ceb,!![]),null);}else{if(qs[_0x20e2('0x2b')](_0x2b2ceb)){_0x10f4c4['or']('c.id\x20LIKE\x20?',_0x2b2ceb+'%');_0x10f4c4['or'](_0x20e2('0x2c'),_0x2b2ceb+'%');_0x10f4c4['or'](_0x20e2('0x2d'),_0x2b2ceb+'%');_0x10f4c4['or']('c.fax\x20LIKE\x20?',_0x2b2ceb+'%');}else if(qs['isEmail'](_0x2b2ceb)){_0x10f4c4['or']('c.email\x20LIKE\x20?',_0x2b2ceb+'%');}else{_0x10f4c4['or'](_0x20e2('0x2e'),'%'+_0x2b2ceb+'%');_0x10f4c4['or'](_0x20e2('0x2f'),'%'+_0x2b2ceb+'%');_0x10f4c4['or'](_0x20e2('0x30'),'%'+_0x2b2ceb+'%');}}}return _0x10f4c4;}function parseAdvancedSearchFilter(_0xeeec92,_0x3cc003){var _0x41ef69=getSqlClauses();var _0x1d9ba0=as[_0x20e2('0x31')](_0xeeec92);var _0x2f59ea=_0x1d9ba0[_0x20e2('0x32')];for(var _0x12d731=0x0;_0x12d731<_0x1d9ba0[_0x20e2('0x33')]['length'];_0x12d731++){var _0x4ed877=_0x1d9ba0[_0x20e2('0x33')][_0x12d731];var _0x50b061='c';var _0x2224cc=_[_0x20e2('0x34')](_0x3cc003,[_0x20e2('0x35'),_0x4ed877['field']]);if(_0x2224cc){if(_0x4ed877[_0x20e2('0x22')]===_0x20e2('0x36')||_0x2224cc[_0x20e2('0x37')]===_0x20e2('0x38')){_0x4ed877['castTo']=_0x20e2('0x39');}var _0x144d6d=as['buildExpression'](_0x50b061,_0x2224cc[_0x20e2('0x3a')],_0x4ed877);_0x41ef69[_0x20e2('0x3b')][_0x2f59ea](_0x144d6d['text'],_0x144d6d['value'][_0x20e2('0x3c')],_0x144d6d[_0x20e2('0x3d')][_0x20e2('0x3e')]);}else{if(_0x4ed877[_0x20e2('0x22')]==='Tag'){var _0x350b34=_0x4ed877[_0x20e2('0x3d')]['split'](',')[_0x20e2('0x3f')](function(_0xe6160){return Number(_0xe6160);});var _0x4c438e=parseTagParameter(_0x350b34);_0x41ef69['tags']['clause']['and'](_0x4c438e);_0x41ef69[_0x20e2('0x40')][_0x20e2('0x41')]=_0x350b34;}else if(_0x4ed877[_0x20e2('0x22')]==='User'){_0x41ef69[_0x20e2('0x42')]['clause']['and'](_0x20e2('0x43'),_0x4ed877[_0x20e2('0x3d')]);_0x41ef69[_0x20e2('0x42')][_0x20e2('0x44')]=!![];}}}return _0x41ef69;}function parseModelFields(_0x1493bf,_0x56415a){var _0x3694e6=squel[_0x20e2('0x24')]();var _0x355f71=_(_0x1493bf)[_0x20e2('0x45')]()[_0x20e2('0x3f')](function(_0x33c433){return _[_0x20e2('0x46')](_0x56415a,[_0x20e2('0x35'),_0x33c433])?_0x33c433:undefined;})[_0x20e2('0x47')]()[_0x20e2('0x3d')]();if(_0x1493bf[_0x20e2('0x48')]){_0x355f71[_0x20e2('0x1f')](_0x20e2('0x48'));}if(_0x1493bf[_0x20e2('0x49')]){_0x355f71[_0x20e2('0x1f')]('User');}if(_0x355f71[_0x20e2('0x29')]>0x0){_0x355f71[_0x20e2('0x20')](function(_0x427a90){if(_0x427a90==='ListId'){_0x3694e6[_0x20e2('0x4a')]('c.ListId\x20IN\x20?',[][_0x20e2('0x4b')](_0x1493bf[_0x427a90]));}else if(_0x427a90===_0x20e2('0x48')){var _0x398da2='%'+_0x1493bf[_0x427a90]+'%';_0x3694e6['and'](_0x20e2('0x4c'),_0x398da2);}else if(_0x427a90===_0x20e2('0x49')){_0x3694e6[_0x20e2('0x4a')](_0x20e2('0x43'),_0x1493bf[_0x427a90]);}else{_0x3694e6[_0x20e2('0x4a')]('c.'+_0x427a90+_0x20e2('0x4d'),_0x1493bf[_0x427a90]);}});}return _0x3694e6;}function parseQueryParameters(_0x4cebfe,_0x18d78a){var _0x1b72e6=getSqlClauses();return Promise['resolve']()['then'](function(){return parseModelFields(_0x4cebfe,_0x18d78a);})['then'](function(_0x497137){_0x1b72e6[_0x20e2('0x4e')][_0x20e2('0x4a')](_0x497137);return parseTagParameter(_0x4cebfe[_0x20e2('0x4f')]);})[_0x20e2('0x50')](function(_0x523ee8){_0x1b72e6['tags'][_0x20e2('0x51')][_0x20e2('0x4a')](_0x523ee8);return parseSearchFilter(_0x4cebfe['filter']);})[_0x20e2('0x50')](function(_0x1d6f2b){_0x1b72e6[_0x20e2('0x52')]=_0x1d6f2b;return _0x1b72e6;});}function checkListsRestrictions(_0x213058,_0x4934aa,_0x4fa98e){var _0x2a8529=squel[_0x20e2('0x24')]();return Promise[_0x20e2('0x53')]()[_0x20e2('0x50')](function(){if(_0x4934aa[_0x20e2('0x6')]&&_0x213058[_0x20e2('0x4')]===_0x20e2('0x5')&&!_0x4fa98e){return _0x213058[_0x20e2('0x54')]({'attributes':['id'],'raw':!![]});}})[_0x20e2('0x50')](function(_0xd37f85){if(_0xd37f85){if(_0xd37f85[_0x20e2('0x29')]===0x0){_0x2a8529[_0x20e2('0x4a')](_0x20e2('0x55'));}else{_0x2a8529[_0x20e2('0x4a')](_0x20e2('0x56'),_[_0x20e2('0x3f')](_0xd37f85,'id'));}}})[_0x20e2('0x50')](function(){return _0x2a8529;});}function buildContactsQuery(_0x7abc5c,_0x2bf032,_0x227fe9,_0x51f87b,_0x207cc0,_0x425545){if(_0x2bf032){_0x2bf032=_0x227fe9['attributes'];}_0x7abc5c=addFieldsToQuery(_0x7abc5c,_0x2bf032,_0x51f87b,_0x425545,!![]);var _0x45ee31=squel['select']();_0x45ee31=addFieldsToQuery(_0x45ee31,_0x2bf032,_0x51f87b,_0x425545,![]);if(_0x51f87b||_0x425545){_0x7abc5c=applyJoinClauses(_0x7abc5c,!![]);_0x7abc5c['group']('c.id');if(_0x227fe9[_0x20e2('0x57')]){_0x45ee31[_0x20e2('0x57')](_0x227fe9[_0x20e2('0x57')]);}if(_0x227fe9[_0x20e2('0x58')]){_0x45ee31[_0x20e2('0x58')](_0x227fe9[_0x20e2('0x58')]);}}else{_0x45ee31=applyJoinClauses(_0x45ee31,![]);_0x45ee31['group'](_0x20e2('0x59'));if(_0x227fe9[_0x20e2('0x57')]){_0x7abc5c[_0x20e2('0x57')](_0x227fe9[_0x20e2('0x57')]);}if(_0x227fe9[_0x20e2('0x58')]){_0x7abc5c['offset'](_0x227fe9[_0x20e2('0x58')]);}}_0x45ee31[_0x20e2('0x5a')](_0x207cc0);if(_0x227fe9[_0x20e2('0x5b')]){_0x227fe9[_0x20e2('0x5b')]['forEach'](function(_0x2841e0){_0x7abc5c[_0x20e2('0x5b')]('c.'+_0x2841e0[0x0],_0x2841e0[0x1]===_0x20e2('0x5c')?![]:!![]);_0x45ee31['order'](_0x20e2('0x5d')+_0x2841e0[0x0],_0x2841e0[0x1]===_0x20e2('0x5c')?![]:!![]);});}_0x45ee31['from'](_0x7abc5c,_0x20e2('0xf'));return _0x45ee31;}function getFilteredContacts(_0x1044dd){var _0x2685b8=[];return db['Tag'][_0x20e2('0x5e')]({'attributes':['id',_0x20e2('0x35'),_0x20e2('0x5f')],'raw':!![]})[_0x20e2('0x50')](function(_0x3d2f45){_0x2685b8=_[_0x20e2('0x60')](_0x3d2f45,'id');var _0xe0e7e5={'type':db[_0x20e2('0x61')][_0x20e2('0x62')][_0x20e2('0x63')],'model':db[_0x20e2('0x64')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x20e2('0x65')][_0x20e2('0x66')](_0x1044dd['toString'](),_0xe0e7e5);})[_0x20e2('0x50')](function(_0x2e0518){_0x2e0518['forEach'](function(_0x590aea){if(_0x590aea[_0x20e2('0x21')]){_0x590aea[_0x20e2('0x67')]=[];_0x590aea[_0x20e2('0x21')][_0x20e2('0x28')](',')[_0x20e2('0x20')](function(_0x3d0cc1){_0x590aea[_0x20e2('0x67')][_0x20e2('0x1f')](_0x2685b8[_0x3d0cc1]);});}delete _0x590aea[_0x20e2('0x21')];});return _0x2e0518;});}function countFilteredContacts(_0x2c0b37,_0x1bc51b){var _0xf9ce57=_0x2c0b37[_0x20e2('0x68')]();_0xf9ce57['field'](_0x20e2('0x69'));_0xf9ce57=applyJoinClauses(_0xf9ce57,!![]);_0x2c0b37[_0x20e2('0x6a')](_0x20e2('0x6b'));var _0x546f8=utils[_0x20e2('0x25')](_0x1bc51b);if(!_[_0x20e2('0x6c')](_0x546f8)){_0xf9ce57[_0x20e2('0xd')]('t.id\x20IN\x20?',_0x546f8);}var _0x479d07={'type':db[_0x20e2('0x61')][_0x20e2('0x62')][_0x20e2('0x63')],'raw':!![]};return db[_0x20e2('0x65')][_0x20e2('0x66')](_0xf9ce57['toString'](),_0x479d07)['then'](function(_0x1f9610){return _0x1f9610[0x0]['COUNT(*)'];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x106e=['tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','CompanyId','updatedAt','deletedAt','TagIds','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','find','name','dateOfBirth','fieldType','castTo','DATE','type','value','start','Tag','split','map','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','then','fields','filter','resolve','c.ListId\x20IS\x20NULL','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','keyBy','QueryTypes','SELECT','CmContact','sequelize','toString','Tags','push','clone','group','where','t.id\x20IN\x20?','Sequelize','query','exports','lodash','../parsers/qs','../interaction/utils','role','agent','search','select','cm_contacts','subqry','left_join','uc.CmContactId\x20=\x20','cm_contact_has_tags','ct.CmContactId\x20=\x20','.id'];(function(_0x4d519a,_0x3f4429){var _0x467964=function(_0x3c94cd){while(--_0x3c94cd){_0x4d519a['push'](_0x4d519a['shift']());}};_0x467964(++_0x3f4429);}(_0x106e,0x11e));var _0xe106=function(_0x4cfdd3,_0x315e71){_0x4cfdd3=_0x4cfdd3-0x0;var _0x54edd5=_0x106e[_0x4cfdd3];return _0x54edd5;};'use strict';var _=require(_0xe106('0x0'));var squel=require('squel');var as=require('../parsers/advancedSearch');var qs=require(_0xe106('0x1'));var utils=require(_0xe106('0x2'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x2c3df7,_0x95e156){var _0x32afa2=![];if(_0x2c3df7[_0xe106('0x3')]===_0xe106('0x4')&&!_0x95e156[_0xe106('0x5')]&&!_0x95e156['ListId']&&_0x95e156['autocomplete']!=='true'){_0x32afa2=!![];}return _0x32afa2;}function getContactsSubquery(){return squel[_0xe106('0x6')]()['from'](_0xe106('0x7'),'c')['where']('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x4b9fc7,_0x339a80){var _0x54c11a=_0x339a80?'c':_0xe106('0x8');_0x4b9fc7[_0xe106('0x9')]('cm_user_has_contacts','uc',_0xe106('0xa')+_0x54c11a+'.id')[_0xe106('0x9')](_0xe106('0xb'),'ct',_0xe106('0xc')+_0x54c11a+_0xe106('0xd'))['left_join'](_0xe106('0xe'),'t',_0xe106('0xf'));return _0x4b9fc7;}function addFieldsToQuery(_0x188f84,_0x3c3d53,_0x15c88c,_0x34d5b3,_0x856a6d){var _0x5cf75d=_0x856a6d?'c':'subqry';if(!_0x3c3d53){_0x3c3d53=['id',_0xe106('0x10'),_0xe106('0x11'),_0xe106('0x12'),_0xe106('0x13'),_0xe106('0x14'),'email','ListId',_0xe106('0x15'),'createdAt',_0xe106('0x16'),_0xe106('0x17'),_0xe106('0x18')];}else if(!_0x3c3d53['includes']('id')){_0x3c3d53['push']('id');}var _0x4e30d0=_0x15c88c&&_0x856a6d||!_0x15c88c&&!_0x856a6d;if(_0x34d5b3){_0x4e30d0=_0x34d5b3&&_0x856a6d||!_0x34d5b3&&!_0x856a6d;}_0x3c3d53[_0xe106('0x19')](function(_0x2338cd){if(_0x2338cd===_0xe106('0x18')){if(_0x4e30d0){_0x188f84['field'](_0xe106('0x1a'),_0x2338cd);}else if(_0x15c88c||_0x34d5b3){_0x188f84[_0xe106('0x1b')](_0x5cf75d+'.'+_0x2338cd);}}else{_0x188f84[_0xe106('0x1b')](_0x5cf75d+'.'+_0x2338cd);}});return _0x188f84;}function getSqlClauses(){var _0x1df647={'default':squel[_0xe106('0x1c')](),'fields':squel['expr'](),'filter':squel[_0xe106('0x1c')](),'tags':{'clause':squel[_0xe106('0x1c')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x1df647;}function parseTagParameter(_0x1bb2da){var _0x4ad94f=squel[_0xe106('0x1c')]();if(_0x1bb2da){var _0x3026a0=utils[_0xe106('0x1d')](_0x1bb2da);_0x3026a0[_0xe106('0x19')](function(_0x18d329){_0x4ad94f['or'](_0xe106('0x1e'),'%,'+_0x18d329+',%');});}return _0x4ad94f;}function parseSearchFilter(_0x11297f){var _0x233087=squel['expr']();if(_0x11297f){var _0x5d51d2=_0x11297f[_0xe106('0x1f')]('\x5c','\x5c\x5c')[_0xe106('0x1f')](/'/g,'\x27\x27');if(_0x5d51d2['split']('\x20')[_0xe106('0x20')]>0x1){_0x233087['or'](_0xe106('0x21'),qs[_0xe106('0x22')](_0x5d51d2,!![]),null);}else{if(qs[_0xe106('0x23')](_0x5d51d2)){_0x233087['or'](_0xe106('0x24'),_0x5d51d2+'%');_0x233087['or'](_0xe106('0x25'),_0x5d51d2+'%');_0x233087['or'](_0xe106('0x26'),_0x5d51d2+'%');_0x233087['or']('c.fax\x20LIKE\x20?',_0x5d51d2+'%');}else if(qs['isEmail'](_0x5d51d2)){_0x233087['or']('c.email\x20LIKE\x20?',_0x5d51d2+'%');}else{_0x233087['or'](_0xe106('0x27'),'%'+_0x5d51d2+'%');_0x233087['or']('c.lastName\x20LIKE\x20?','%'+_0x5d51d2+'%');_0x233087['or'](_0xe106('0x28'),'%'+_0x5d51d2+'%');}}}return _0x233087;}function parseAdvancedSearchFilter(_0x2e9df9,_0x2e37b9){var _0x1dea08=getSqlClauses();var _0x4d74d3=as[_0xe106('0x29')](_0x2e9df9);var _0xecbe24=_0x4d74d3[_0xe106('0x2a')];for(var _0x5152da=0x0;_0x5152da<_0x4d74d3['conditions'][_0xe106('0x20')];_0x5152da++){var _0x7acc72=_0x4d74d3['conditions'][_0x5152da];var _0x5269d7='c';var _0x359df1=_[_0xe106('0x2b')](_0x2e37b9,[_0xe106('0x2c'),_0x7acc72['field']]);if(_0x359df1){if(_0x7acc72['field']===_0xe106('0x2d')||_0x359df1[_0xe106('0x2e')]==='datetime'){_0x7acc72[_0xe106('0x2f')]=_0xe106('0x30');}var _0xc921c6=as['buildExpression'](_0x5269d7,_0x359df1[_0xe106('0x31')],_0x7acc72);_0x1dea08['default'][_0xecbe24](_0xc921c6['text'],_0xc921c6[_0xe106('0x32')][_0xe106('0x33')],_0xc921c6[_0xe106('0x32')]['end']);}else{if(_0x7acc72[_0xe106('0x1b')]===_0xe106('0x34')){var _0x54fb49=_0x7acc72['value'][_0xe106('0x35')](',')[_0xe106('0x36')](function(_0x7ab0e5){return Number(_0x7ab0e5);});var _0xb3290f=parseTagParameter(_0x54fb49);_0x1dea08[_0xe106('0x37')][_0xe106('0x38')][_0xe106('0x39')](_0xb3290f);_0x1dea08[_0xe106('0x37')][_0xe106('0x3a')]=_0x54fb49;}else if(_0x7acc72[_0xe106('0x1b')]===_0xe106('0x3b')){_0x1dea08[_0xe106('0x3c')][_0xe106('0x38')][_0xe106('0x39')](_0xe106('0x3d'),_0x7acc72[_0xe106('0x32')]);_0x1dea08[_0xe106('0x3c')][_0xe106('0x3e')]=!![];}}}return _0x1dea08;}function parseModelFields(_0x1e4a5e,_0x4962b3){var _0x5a4030=squel['expr']();var _0x22da01=_(_0x1e4a5e)[_0xe106('0x3f')]()['map'](function(_0x490801){return _[_0xe106('0x40')](_0x4962b3,['name',_0x490801])?_0x490801:undefined;})[_0xe106('0x41')]()[_0xe106('0x32')]();if(_0x1e4a5e[_0xe106('0x42')]){_0x22da01['push']('Contact');}if(_0x1e4a5e[_0xe106('0x3b')]){_0x22da01['push'](_0xe106('0x3b'));}if(_0x22da01[_0xe106('0x20')]>0x0){_0x22da01[_0xe106('0x19')](function(_0x19ba12){if(_0x19ba12===_0xe106('0x43')){_0x5a4030[_0xe106('0x39')](_0xe106('0x44'),[][_0xe106('0x45')](_0x1e4a5e[_0x19ba12]));}else if(_0x19ba12==='Contact'){var _0x35a901='%'+_0x1e4a5e[_0x19ba12]+'%';_0x5a4030['and'](_0xe106('0x46'),_0x35a901);}else if(_0x19ba12===_0xe106('0x3b')){_0x5a4030[_0xe106('0x39')](_0xe106('0x3d'),_0x1e4a5e[_0x19ba12]);}else{_0x5a4030[_0xe106('0x39')]('c.'+_0x19ba12+'\x20=\x20?',_0x1e4a5e[_0x19ba12]);}});}return _0x5a4030;}function parseQueryParameters(_0x3ac230,_0x4ae983){var _0x3242a4=getSqlClauses();return Promise['resolve']()[_0xe106('0x47')](function(){return parseModelFields(_0x3ac230,_0x4ae983);})[_0xe106('0x47')](function(_0x5af017){_0x3242a4[_0xe106('0x48')][_0xe106('0x39')](_0x5af017);return parseTagParameter(_0x3ac230['tag']);})[_0xe106('0x47')](function(_0x50ff28){_0x3242a4[_0xe106('0x37')][_0xe106('0x38')][_0xe106('0x39')](_0x50ff28);return parseSearchFilter(_0x3ac230['filter']);})[_0xe106('0x47')](function(_0x2e9950){_0x3242a4[_0xe106('0x49')]=_0x2e9950;return _0x3242a4;});}function checkListsRestrictions(_0x4b1131,_0x4a0f36,_0x501526){var _0x4c5d6c=squel['expr']();return Promise[_0xe106('0x4a')]()[_0xe106('0x47')](function(){if(_0x4a0f36[_0xe106('0x5')]&&_0x4b1131[_0xe106('0x3')]===_0xe106('0x4')&&!_0x501526){return _0x4b1131['getLists']({'attributes':['id'],'raw':!![]});}})['then'](function(_0xb8cab8){if(_0xb8cab8){if(_0xb8cab8[_0xe106('0x20')]===0x0){_0x4c5d6c[_0xe106('0x39')](_0xe106('0x4b'));}else{_0x4c5d6c[_0xe106('0x39')]('c.ListId\x20IN\x20?',_[_0xe106('0x36')](_0xb8cab8,'id'));}}})[_0xe106('0x47')](function(){return _0x4c5d6c;});}function buildContactsQuery(_0x11a8df,_0x3476af,_0x3a0701,_0x1c0345,_0x47e3ad,_0x5c3e10){if(_0x3476af){_0x3476af=_0x3a0701['attributes'];}_0x11a8df=addFieldsToQuery(_0x11a8df,_0x3476af,_0x1c0345,_0x5c3e10,!![]);var _0x13f707=squel[_0xe106('0x6')]();_0x13f707=addFieldsToQuery(_0x13f707,_0x3476af,_0x1c0345,_0x5c3e10,![]);if(_0x1c0345||_0x5c3e10){_0x11a8df=applyJoinClauses(_0x11a8df,!![]);_0x11a8df['group'](_0xe106('0x4c'));if(_0x3a0701['limit']){_0x13f707[_0xe106('0x4d')](_0x3a0701[_0xe106('0x4d')]);}if(_0x3a0701[_0xe106('0x4e')]){_0x13f707[_0xe106('0x4e')](_0x3a0701[_0xe106('0x4e')]);}}else{_0x13f707=applyJoinClauses(_0x13f707,![]);_0x13f707['group'](_0xe106('0x4f'));if(_0x3a0701[_0xe106('0x4d')]){_0x11a8df[_0xe106('0x4d')](_0x3a0701[_0xe106('0x4d')]);}if(_0x3a0701[_0xe106('0x4e')]){_0x11a8df[_0xe106('0x4e')](_0x3a0701[_0xe106('0x4e')]);}}_0x13f707[_0xe106('0x50')](_0x47e3ad);if(_0x3a0701['order']){_0x3a0701[_0xe106('0x51')][_0xe106('0x19')](function(_0x29c485){_0x11a8df['order']('c.'+_0x29c485[0x0],_0x29c485[0x1]===_0xe106('0x52')?![]:!![]);_0x13f707[_0xe106('0x51')](_0xe106('0x53')+_0x29c485[0x0],_0x29c485[0x1]===_0xe106('0x52')?![]:!![]);});}_0x13f707['from'](_0x11a8df,_0xe106('0x8'));return _0x13f707;}function getFilteredContacts(_0x4575fa){var _0x2691e0=[];return db[_0xe106('0x34')][_0xe106('0x54')]({'attributes':['id',_0xe106('0x2c'),'color'],'raw':!![]})[_0xe106('0x47')](function(_0x7ffad0){_0x2691e0=_[_0xe106('0x55')](_0x7ffad0,'id');var _0x435c24={'type':db['Sequelize'][_0xe106('0x56')][_0xe106('0x57')],'model':db[_0xe106('0x58')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xe106('0x59')]['query'](_0x4575fa[_0xe106('0x5a')](),_0x435c24);})[_0xe106('0x47')](function(_0x544cfe){_0x544cfe['forEach'](function(_0x30ab69){if(_0x30ab69[_0xe106('0x18')]){_0x30ab69[_0xe106('0x5b')]=[];_0x30ab69[_0xe106('0x18')][_0xe106('0x35')](',')[_0xe106('0x19')](function(_0x303026){_0x30ab69['Tags'][_0xe106('0x5c')](_0x2691e0[_0x303026]);});}delete _0x30ab69['TagIds'];});return _0x544cfe;});}function countFilteredContacts(_0x3b76c4,_0x4ed87d){var _0xefa2d5=_0x3b76c4[_0xe106('0x5d')]();_0xefa2d5[_0xe106('0x1b')]('COUNT(*)');_0xefa2d5=applyJoinClauses(_0xefa2d5,!![]);_0x3b76c4[_0xe106('0x5e')](_0xe106('0x4c'));var _0x593826=utils['getSelectedTags'](_0x4ed87d);if(!_['isEmpty'](_0x593826)){_0xefa2d5[_0xe106('0x5f')](_0xe106('0x60'),_0x593826);}var _0x2b67dd={'type':db[_0xe106('0x61')]['QueryTypes'][_0xe106('0x57')],'raw':!![]};return db[_0xe106('0x59')][_0xe106('0x62')](_0xefa2d5[_0xe106('0x5a')](),_0x2b67dd)[_0xe106('0x47')](function(_0x4b5af7){return _0x4b5af7[0x0]['COUNT(*)'];});}module[_0xe106('0x63')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index b678279..215c9c2 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 _0x0e7a=['decryptString','crypto','bluebird','../../config/environment','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createWriteStream','data','update','binary','write','end','close','decryptFile','createReadStream','createDecipher','final','unlink','encryptString','secret','createCipher','utf8','base64'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0e7a,0xef));var _0xa0e7=function(_0x5be431,_0x2cc74f){_0x5be431=_0x5be431-0x0;var _0x18664c=_0x0e7a[_0x5be431];return _0x18664c;};'use strict';var crypto=require(_0xa0e7('0x0'));var fs=require('fs');var BPromise=require(_0xa0e7('0x1'));var _=require('lodash');var config=require(_0xa0e7('0x2'));var logger=require('../../config/logger')(_0xa0e7('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xa0e7('0x4')]['session'],'algorithm':_0xa0e7('0x5')};const fileOptions={'algorithm':_0xa0e7('0x6')};if(config[_0xa0e7('0x7')]&&config[_0xa0e7('0x7')][_0xa0e7('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xa0e7('0x8')]);if(isSupported){fileOptions[_0xa0e7('0x8')]=config[_0xa0e7('0x7')][_0xa0e7('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xa0e7('0x9')](',\x20');logger['error'](config['encrypt']['algorithm'],_0xa0e7('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x19c0b7){return AES_SUPPORTED_RX[_0xa0e7('0xb')](_0x19c0b7);}function getSupportedCiphers(){return crypto[_0xa0e7('0xc')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x52dc32){return getSupportedCiphers()[_0xa0e7('0xd')](_0x52dc32)>-0x1;}function combineOptions(_0x1c0003){var _0x31f6c0={};for(var _0x5c353b in fileOptions){if(fileOptions[_0xa0e7('0xe')](_0x5c353b)){_0x31f6c0[_0x5c353b]=fileOptions[_0x5c353b];}}if(_0x1c0003){for(var _0x415648 in _0x1c0003){if(_0x1c0003[_0xa0e7('0xe')](_0x415648)){_0x31f6c0[_0x415648]=_0x1c0003[_0x415648];}}}return _0x31f6c0;}exports[_0xa0e7('0xf')]=function(_0xe0254,_0x395486,_0x40dbcc,_0x1df154){return new BPromise(function(_0x17b239,_0x2d9423){_0x1df154=combineOptions(_0x1df154);var _0x31b462=new Buffer(_0x40dbcc);var _0x4fc2f5=fs['createReadStream'](_0xe0254);var _0x143b1c=fs[_0xa0e7('0x10')](_0x395486);var _0x55a8be=crypto['createCipher'](_0x1df154[_0xa0e7('0x8')],_0x31b462);_0x4fc2f5['on'](_0xa0e7('0x11'),function(_0x40279c){var _0x1cd4a1=new Buffer(_0x55a8be[_0xa0e7('0x12')](_0x40279c),_0xa0e7('0x13'));_0x143b1c[_0xa0e7('0x14')](_0x1cd4a1);});_0x4fc2f5['on'](_0xa0e7('0x15'),function(){try{var _0x3c23ad=new Buffer(_0x55a8be['final']('binary'),_0xa0e7('0x13'));_0x143b1c[_0xa0e7('0x14')](_0x3c23ad);_0x143b1c[_0xa0e7('0x15')]();_0x143b1c['on'](_0xa0e7('0x16'),function(){return _0x17b239(_0x395486);});}catch(_0x1f6120){fs['unlink'](_0x395486);return _0x2d9423(_0x1f6120);}});});};exports[_0xa0e7('0x17')]=function(_0x4b6e58,_0x47c629,_0x5814eb,_0x1ca0c4){return new BPromise(function(_0x5a7d50,_0x400c58){_0x1ca0c4=combineOptions(_0x1ca0c4);var _0x284698=new Buffer(_0x5814eb);var _0x126734=fs[_0xa0e7('0x18')](_0x4b6e58);var _0x18240f=fs[_0xa0e7('0x10')](_0x47c629);var _0x21e70d=crypto[_0xa0e7('0x19')](_0x1ca0c4['algorithm'],_0x284698);_0x126734['on'](_0xa0e7('0x11'),function(_0x400a6d){var _0x4956d0=new Buffer(_0x21e70d['update'](_0x400a6d),_0xa0e7('0x13'));_0x18240f[_0xa0e7('0x14')](_0x4956d0);});_0x126734['on'](_0xa0e7('0x15'),function(){try{var _0x1ea156=new Buffer(_0x21e70d[_0xa0e7('0x1a')]('binary'),_0xa0e7('0x13'));_0x18240f['write'](_0x1ea156);_0x18240f['end']();_0x18240f['on'](_0xa0e7('0x16'),function(){return _0x5a7d50(_0x47c629);});}catch(_0x3de774){fs[_0xa0e7('0x1b')](_0x47c629);return _0x400c58(_0x3de774);}});});};exports[_0xa0e7('0x1c')]=function(_0x374ba6,_0x2293c1,_0x5de845){var _0x37bfa0=_0x5de845||stringOptions[_0xa0e7('0x8')];var _0x563523=_0x2293c1||stringOptions[_0xa0e7('0x1d')];var _0x40b80e=crypto[_0xa0e7('0x1e')](_0x37bfa0,_0x563523);var _0x2857be=_0x40b80e[_0xa0e7('0x12')](_0x374ba6,_0xa0e7('0x1f'),'base64');_0x2857be+=_0x40b80e['final'](_0xa0e7('0x20'));return _0x2857be;};exports[_0xa0e7('0x21')]=function(_0x1762b3,_0x3da6be,_0x53f67c){var _0x209e3a=_0x53f67c||stringOptions['algorithm'];var _0x9873e0=_0x3da6be||stringOptions[_0xa0e7('0x1d')];var _0x1fe3a9=crypto[_0xa0e7('0x19')](_0x209e3a,_0x9873e0);var _0x516ec8=_0x1fe3a9[_0xa0e7('0x12')](_0x1762b3,_0xa0e7('0x20'),_0xa0e7('0x1f'));_0x516ec8+=_0x1fe3a9['final'](_0xa0e7('0x1f'));return _0x516ec8;}; \ No newline at end of file +var _0x3066=['decryptFile','createWriteStream','createDecipher','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher','data','update','binary','end','final','write','unlink'];(function(_0x3b9653,_0x3a7e27){var _0x14c4b8=function(_0x448025){while(--_0x448025){_0x3b9653['push'](_0x3b9653['shift']());}};_0x14c4b8(++_0x3a7e27);}(_0x3066,0x128));var _0x6306=function(_0xd99597,_0x27f78e){_0xd99597=_0xd99597-0x0;var _0x3a8b30=_0x3066[_0xd99597];return _0x3a8b30;};'use strict';var crypto=require(_0x6306('0x0'));var fs=require('fs');var BPromise=require(_0x6306('0x1'));var _=require(_0x6306('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x6306('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x6306('0x4')][_0x6306('0x5')],'algorithm':_0x6306('0x6')};const fileOptions={'algorithm':_0x6306('0x7')};if(config[_0x6306('0x8')]&&config[_0x6306('0x8')][_0x6306('0x9')]){var isSupported=isAlgorithmSupported(config[_0x6306('0x8')]['algorithm']);if(isSupported){fileOptions[_0x6306('0x9')]=config[_0x6306('0x8')][_0x6306('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x6306('0xa')](',\x20');logger['error'](config[_0x6306('0x8')]['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x2097a5){return AES_SUPPORTED_RX['test'](_0x2097a5);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x6306('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x439d24){return getSupportedCiphers()[_0x6306('0xc')](_0x439d24)>-0x1;}function combineOptions(_0x5392a6){var _0x5e9285={};for(var _0x36ce43 in fileOptions){if(fileOptions[_0x6306('0xd')](_0x36ce43)){_0x5e9285[_0x36ce43]=fileOptions[_0x36ce43];}}if(_0x5392a6){for(var _0x37e7b1 in _0x5392a6){if(_0x5392a6['hasOwnProperty'](_0x37e7b1)){_0x5e9285[_0x37e7b1]=_0x5392a6[_0x37e7b1];}}}return _0x5e9285;}exports[_0x6306('0xe')]=function(_0x524fc1,_0x3e5607,_0x42aba5,_0x4b8770){return new BPromise(function(_0x1a578c,_0x4e6648){_0x4b8770=combineOptions(_0x4b8770);var _0x3d2014=new Buffer(_0x42aba5);var _0x220c78=fs[_0x6306('0xf')](_0x524fc1);var _0x173e39=fs['createWriteStream'](_0x3e5607);var _0x2155e1=crypto[_0x6306('0x10')](_0x4b8770[_0x6306('0x9')],_0x3d2014);_0x220c78['on'](_0x6306('0x11'),function(_0x4ee2e1){var _0x26f419=new Buffer(_0x2155e1[_0x6306('0x12')](_0x4ee2e1),_0x6306('0x13'));_0x173e39['write'](_0x26f419);});_0x220c78['on'](_0x6306('0x14'),function(){try{var _0x767ade=new Buffer(_0x2155e1[_0x6306('0x15')](_0x6306('0x13')),_0x6306('0x13'));_0x173e39[_0x6306('0x16')](_0x767ade);_0x173e39[_0x6306('0x14')]();_0x173e39['on']('close',function(){return _0x1a578c(_0x3e5607);});}catch(_0x1083bc){fs[_0x6306('0x17')](_0x3e5607);return _0x4e6648(_0x1083bc);}});});};exports[_0x6306('0x18')]=function(_0x56d30f,_0xdc3420,_0x508d99,_0x299b3e){return new BPromise(function(_0x34aa20,_0x19a648){_0x299b3e=combineOptions(_0x299b3e);var _0x1cabae=new Buffer(_0x508d99);var _0x40de14=fs[_0x6306('0xf')](_0x56d30f);var _0x23752f=fs[_0x6306('0x19')](_0xdc3420);var _0x245efd=crypto[_0x6306('0x1a')](_0x299b3e[_0x6306('0x9')],_0x1cabae);_0x40de14['on'](_0x6306('0x11'),function(_0x56a7c4){var _0x33577c=new Buffer(_0x245efd['update'](_0x56a7c4),'binary');_0x23752f['write'](_0x33577c);});_0x40de14['on'](_0x6306('0x14'),function(){try{var _0x5317d=new Buffer(_0x245efd[_0x6306('0x15')](_0x6306('0x13')),'binary');_0x23752f['write'](_0x5317d);_0x23752f[_0x6306('0x14')]();_0x23752f['on']('close',function(){return _0x34aa20(_0xdc3420);});}catch(_0x4d2c1b){fs['unlink'](_0xdc3420);return _0x19a648(_0x4d2c1b);}});});};exports[_0x6306('0x1b')]=function(_0x1b3c21,_0x41d7ba,_0x563cf4){var _0x3f8e8b=_0x563cf4||stringOptions['algorithm'];var _0x139d23=_0x41d7ba||stringOptions[_0x6306('0x1c')];var _0x26b918=crypto[_0x6306('0x10')](_0x3f8e8b,_0x139d23);var _0x174fe1=_0x26b918[_0x6306('0x12')](_0x1b3c21,_0x6306('0x1d'),_0x6306('0x1e'));_0x174fe1+=_0x26b918['final']('base64');return _0x174fe1;};exports[_0x6306('0x1f')]=function(_0x56a954,_0x9d0a00,_0x3b7593){var _0xd0eb4=_0x3b7593||stringOptions[_0x6306('0x9')];var _0xe6419e=_0x9d0a00||stringOptions[_0x6306('0x1c')];var _0x291b7f=crypto['createDecipher'](_0xd0eb4,_0xe6419e);var _0x4cfb1f=_0x291b7f[_0x6306('0x12')](_0x56a954,_0x6306('0x1e'),'utf8');_0x4cfb1f+=_0x291b7f[_0x6306('0x15')](_0x6306('0x1d'));return _0x4cfb1f;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index c4a271e..b7a075b 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 _0x8147=['Empty','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','existsSync','join','each','%s%d.%s','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT'];(function(_0x4725a4,_0x16d525){var _0x39ffb8=function(_0x42e55f){while(--_0x42e55f){_0x4725a4['push'](_0x4725a4['shift']());}};_0x39ffb8(++_0x16d525);}(_0x8147,0x198));var _0x7814=function(_0x2b8e4b,_0x3a3536){_0x2b8e4b=_0x2b8e4b-0x0;var _0x568288=_0x8147[_0x2b8e4b];return _0x568288;};'use strict';var util=require(_0x7814('0x0'));var path=require(_0x7814('0x1'));var _=require(_0x7814('0x2'));var csv=require(_0x7814('0x3'));var fs=require('fs');var BPromise=require(_0x7814('0x4'));var zipdir=require(_0x7814('0x5'));var rimraf=require(_0x7814('0x6'));var db=require(_0x7814('0x7'))['db'];var dbH=require(_0x7814('0x7'))[_0x7814('0x8')];var logger=require(_0x7814('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x368469,_0x2c6def){var _0x455e81={'status':_0x368469};var _0x348664={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2c6def){_0x455e81['savename']=_0x2c6def;}return db[_0x7814('0xa')][_0x7814('0xb')](_0x455e81,_0x348664);}function main(){var _0x49c45a=0x1388;var _0x9f4c70;logger[_0x7814('0xc')](util[_0x7814('0xd')](_0x7814('0xe'),EXTRACTED_REPORT_ID,_0x7814('0xf')));return db['Setting'][_0x7814('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7814('0x11'),_0x7814('0x12')]})[_0x7814('0x13')](function(_0x16c8ec){if(_0x16c8ec){_0x9f4c70=_0x16c8ec;_0x49c45a=_0x9f4c70['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0x7814('0x14')][_0x7814('0x15')](util[_0x7814('0xd')](_0x7814('0x16'),QUERY),{'type':dbH[_0x7814('0x14')]['QueryTypes'][_0x7814('0x17')]});})['then'](function(_0x36a585){if(!_0x36a585[0x0]['num']){return analyticExtractedReport(_0x7814('0x18'));}var _0x1c39fa=[];var _0x163fb1=0x0;if(_0x9f4c70[_0x7814('0x11')]){if(_0x36a585&&_0x36a585[_0x7814('0x19')]){var _0x5e60f2=_[_0x7814('0x1a')](_0x36a585[0x0][_0x7814('0x1b')]/_0x49c45a);var _0x5d2637=Number[_0x7814('0x1c')](_0x36a585[0x0][_0x7814('0x1b')]/_0x49c45a)?_0x36a585[0x0][_0x7814('0x1b')]%_0x49c45a:0x0;_0x5e60f2[_0x7814('0x1d')](function(_0x5b82b8){if(_0x5b82b8>0x0){_0x163fb1+=_0x49c45a;}_0x1c39fa[_0x7814('0x1e')](dbH['sequelize']['query'](util['format'](_0x7814('0x1f'),QUERY,_0x49c45a,_0x163fb1),{'type':dbH[_0x7814('0x14')][_0x7814('0x20')][_0x7814('0x17')]}));});if(_0x5d2637>0x0){_0x163fb1+=_0x49c45a;_0x1c39fa[_0x7814('0x1e')](dbH[_0x7814('0x14')][_0x7814('0x15')](util['format'](_0x7814('0x1f'),QUERY,_0x5d2637,_0x163fb1),{'type':dbH[_0x7814('0x14')][_0x7814('0x20')][_0x7814('0x17')]}));}}}else{_0x1c39fa[_0x7814('0x1e')](dbH['sequelize'][_0x7814('0x15')](QUERY,{'type':dbH[_0x7814('0x14')][_0x7814('0x20')][_0x7814('0x17')]}));}var _0x54169a=path[_0x7814('0x21')](PATH);var _0x59d71c=path[_0x7814('0x22')](PATH,_0x7814('0x23'));var _0x5bc720=_0x9f4c70[_0x7814('0x11')]&&_0x1c39fa['length']>0x1;var _0xc41453=[];if(!fs[_0x7814('0x24')](path['join'](_0x54169a,_0x59d71c))&&_0x5bc720){fs['mkdirSync'](path[_0x7814('0x25')](_0x54169a,_0x59d71c));}return BPromise[_0x7814('0x26')](_0x1c39fa,function(_0x5bb655){_0xc41453[_0x7814('0x1e')](_0x5bb655);})[_0x7814('0x13')](function(){for(var _0x1461b3=0x0;_0x1461b3<_0xc41453[_0x7814('0x19')];_0x1461b3+=0x1){var _0xc0d7bd;var _0x3a85e8=_0xc41453[_0x1461b3];if(_0x5bc720){_0xc0d7bd=path[_0x7814('0x25')](_0x54169a,_0x59d71c,util['format'](_0x7814('0x27'),_0x59d71c,_0x1461b3,_0x7814('0x28')));}else{_0xc0d7bd=path[_0x7814('0x25')](_0x54169a,util[_0x7814('0xd')](_0x7814('0x29'),_0x59d71c,_0x7814('0x28')));}fs['writeFileSync'](_0xc0d7bd,csv(_0x3a85e8));}})[_0x7814('0x13')](function(){if(_0x5bc720){return new Promise(function(_0x38f78e){zipdir(path[_0x7814('0x25')](_0x54169a,_0x59d71c),{'saveTo':path[_0x7814('0x25')](_0x54169a,util['format'](_0x7814('0x29'),_0x59d71c,_0x7814('0x2a')))},function(_0x25f98b,_0x1c368f){rimraf(path[_0x7814('0x25')](_0x54169a,_0x59d71c),function(){});_0x38f78e('zip\x20finished');});});}})[_0x7814('0x13')](function(){logger['info'](util[_0x7814('0xd')](_0x7814('0x2b'),EXTRACTED_REPORT_ID,_0x7814('0xf')));return analyticExtractedReport('Completed',_0x5bc720?util[_0x7814('0xd')](_0x7814('0x29'),_0x59d71c,_0x5bc720?_0x7814('0x2a'):'csv'):null);});})[_0x7814('0x2c')](function(_0x6750f1){logger['info'](util['format'](_0x7814('0x2d'),EXTRACTED_REPORT_ID,_0x7814('0xf')),util[_0x7814('0x2e')](_0x6750f1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x7814('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xd262=['savename','AnalyticExtractedReport','update','info','CSV','Setting','find','splitSizeCsv','then','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','split','length','range','num','forEach','push','dirname','basename','.csv','join','each','%s%d.%s','csv','writeFileSync','%s.%s','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Failed','finally','util','path','lodash','to-csv','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd262,0x19d));var _0x2d26=function(_0x33ffd7,_0x53db21){_0x33ffd7=_0x33ffd7-0x0;var _0x39f97a=_0xd262[_0x33ffd7];return _0x39f97a;};'use strict';var util=require(_0x2d26('0x0'));var path=require(_0x2d26('0x1'));var _=require(_0x2d26('0x2'));var csv=require(_0x2d26('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x2d26('0x4'));var db=require(_0x2d26('0x5'))['db'];var dbH=require(_0x2d26('0x5'))[_0x2d26('0x6')];var logger=require(_0x2d26('0x7'))(_0x2d26('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x2d26('0x9')][0x3];var PATH=process[_0x2d26('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x463379,_0x4082f6){var _0x706a60={'status':_0x463379};var _0x409733={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4082f6){_0x706a60[_0x2d26('0xa')]=_0x4082f6;}return db[_0x2d26('0xb')][_0x2d26('0xc')](_0x706a60,_0x409733);}function main(){var _0x5c766f=0x1388;var _0x4c7031;logger[_0x2d26('0xd')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2d26('0xe')));return db[_0x2d26('0xf')][_0x2d26('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x2d26('0x11')]})[_0x2d26('0x12')](function(_0x350f2d){if(_0x350f2d){_0x4c7031=_0x350f2d;_0x5c766f=_0x4c7031[_0x2d26('0x11')]||0x1388;}})[_0x2d26('0x12')](function(){return dbH['sequelize'][_0x2d26('0x13')](util[_0x2d26('0x14')](_0x2d26('0x15'),QUERY),{'type':dbH[_0x2d26('0x16')][_0x2d26('0x17')][_0x2d26('0x18')]});})[_0x2d26('0x12')](function(_0x408006){if(!_0x408006[0x0]['num']){return analyticExtractedReport('Empty');}var _0x5522e7=[];var _0x4212f5=0x0;if(_0x4c7031[_0x2d26('0x19')]){if(_0x408006&&_0x408006[_0x2d26('0x1a')]){var _0x4a7e68=_[_0x2d26('0x1b')](_0x408006[0x0][_0x2d26('0x1c')]/_0x5c766f);var _0x1c9f51=Number['isInteger'](_0x408006[0x0]['num']/_0x5c766f)?_0x408006[0x0][_0x2d26('0x1c')]%_0x5c766f:0x0;_0x4a7e68[_0x2d26('0x1d')](function(_0x16adf5){if(_0x16adf5>0x0){_0x4212f5+=_0x5c766f;}_0x5522e7[_0x2d26('0x1e')](dbH[_0x2d26('0x16')][_0x2d26('0x13')](util[_0x2d26('0x14')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5c766f,_0x4212f5),{'type':dbH[_0x2d26('0x16')][_0x2d26('0x17')]['SELECT']}));});if(_0x1c9f51>0x0){_0x4212f5+=_0x5c766f;_0x5522e7[_0x2d26('0x1e')](dbH[_0x2d26('0x16')][_0x2d26('0x13')](util[_0x2d26('0x14')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1c9f51,_0x4212f5),{'type':dbH[_0x2d26('0x16')][_0x2d26('0x17')]['SELECT']}));}}}else{_0x5522e7[_0x2d26('0x1e')](dbH[_0x2d26('0x16')][_0x2d26('0x13')](QUERY,{'type':dbH[_0x2d26('0x16')][_0x2d26('0x17')]['SELECT']}));}var _0x222c2f=path[_0x2d26('0x1f')](PATH);var _0x476abf=path[_0x2d26('0x20')](PATH,_0x2d26('0x21'));var _0x56b960=_0x4c7031['split']&&_0x5522e7[_0x2d26('0x1a')]>0x1;var _0x27e0f3=[];if(!fs['existsSync'](path[_0x2d26('0x22')](_0x222c2f,_0x476abf))&&_0x56b960){fs['mkdirSync'](path[_0x2d26('0x22')](_0x222c2f,_0x476abf));}return BPromise[_0x2d26('0x23')](_0x5522e7,function(_0x5c2c99){_0x27e0f3[_0x2d26('0x1e')](_0x5c2c99);})[_0x2d26('0x12')](function(){for(var _0x317f5e=0x0;_0x317f5e<_0x27e0f3[_0x2d26('0x1a')];_0x317f5e+=0x1){var _0x1af164;var _0x437aa8=_0x27e0f3[_0x317f5e];if(_0x56b960){_0x1af164=path['join'](_0x222c2f,_0x476abf,util[_0x2d26('0x14')](_0x2d26('0x24'),_0x476abf,_0x317f5e,'csv'));}else{_0x1af164=path[_0x2d26('0x22')](_0x222c2f,util[_0x2d26('0x14')]('%s.%s',_0x476abf,_0x2d26('0x25')));}fs[_0x2d26('0x26')](_0x1af164,csv(_0x437aa8));}})[_0x2d26('0x12')](function(){if(_0x56b960){return new Promise(function(_0x4f2f52){zipdir(path[_0x2d26('0x22')](_0x222c2f,_0x476abf),{'saveTo':path['join'](_0x222c2f,util['format'](_0x2d26('0x27'),_0x476abf,'zip'))},function(_0x35dd57,_0x549ea3){rimraf(path[_0x2d26('0x22')](_0x222c2f,_0x476abf),function(){});_0x4f2f52(_0x2d26('0x28'));});});}})['then'](function(){logger[_0x2d26('0xd')](util[_0x2d26('0x14')](_0x2d26('0x29'),EXTRACTED_REPORT_ID,_0x2d26('0xe')));return analyticExtractedReport(_0x2d26('0x2a'),_0x56b960?util[_0x2d26('0x14')]('%s.%s',_0x476abf,_0x56b960?_0x2d26('0x2b'):_0x2d26('0x25')):null);});})[_0x2d26('0x2c')](function(_0x2065b6){logger['info'](util[_0x2d26('0x14')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2d26('0xe')),util['inspect'](_0x2065b6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2d26('0x2d'));})[_0x2d26('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 3a3b3e9..cb94b13 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 _0x2d3a=['Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','splitSizePdf','then','split','range','isInteger','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','basename','.pdf','existsSync','join','mkdirSync','each','createPdfKitDocument','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','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-bold.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','createPdfFromHTML','lodash','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','toString','value','fill','length','push','body','chunk','keys'];(function(_0x588c36,_0x1146b2){var _0x511c30=function(_0x17c531){while(--_0x17c531){_0x588c36['push'](_0x588c36['shift']());}};_0x511c30(++_0x1146b2);}(_0x2d3a,0x100));var _0xa2d3=function(_0x29e0eb,_0x9acb52){_0x29e0eb=_0x29e0eb-0x0;var _0x597d2d=_0x2d3a[_0x29e0eb];return _0x597d2d;};'use strict';var _=require(_0xa2d3('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xa2d3('0x1'));var moment=require(_0xa2d3('0x2'));var htmlToPdfmake=require(_0xa2d3('0x3'));var PdfPrinter=require(_0xa2d3('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xa2d3('0x5'));var JSDOM=require(_0xa2d3('0x6'))[_0xa2d3('0x7')];var window=new JSDOM('')[_0xa2d3('0x8')];var BPromise=require(_0xa2d3('0x9'));var db=require(_0xa2d3('0xa'))['db'];var dbH=require(_0xa2d3('0xa'))[_0xa2d3('0xb')];var logger=require(_0xa2d3('0xc'))(_0xa2d3('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xa2d3('0xe')][0x2]);var QUERY=process[_0xa2d3('0xe')][0x3];var PATH=process[_0xa2d3('0xe')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xa2d3('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3e4d67,_0x40c511){var _0x173adb={'status':_0x3e4d67};var _0x591e6c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x40c511){_0x173adb[_0xa2d3('0x10')]=_0x40c511;}return db[_0xa2d3('0x11')][_0xa2d3('0x12')](_0x173adb,_0x591e6c);}function getHeaders(_0x15e2ef){return _[_0xa2d3('0x13')](_0x15e2ef,function(_0x250038){return{'text':_0x250038,'style':_0xa2d3('0x14')};});}function getRows(_0x4e519a,_0x2ea16d){return _[_0xa2d3('0x13')](_0x2ea16d,function(_0x5d9e3a){return _(_0x5d9e3a)['pick'](_0x4e519a)[_0xa2d3('0x13')](function(_0x5db37d){return _0x5db37d?_[_0xa2d3('0x15')](_0x5db37d):'';})[_0xa2d3('0x16')]();});}function createTable(_0x17bcca,_0x22a076){var _0x250282={'widths':_[_0xa2d3('0x17')](Array(_0x17bcca[_0xa2d3('0x18')]),0x91),'heights':function(_0x5c257f){return _0x5c257f===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1e498c=getHeaders(_0x17bcca);_0x250282['body'][_0xa2d3('0x19')](_0x1e498c);var _0x2c792f=getRows(_0x17bcca,_0x22a076);_0x250282[_0xa2d3('0x1a')]=_0x250282[_0xa2d3('0x1a')]['concat'](_0x2c792f);return _0x250282;}function createTables(_0x3849f0){var _0x19dbbc=[];var _0x38f844=_[_0xa2d3('0x1b')](Object[_0xa2d3('0x1c')](_0x3849f0[0x0]),0x5);_0x38f844['forEach'](function(_0x11a108){_0x19dbbc['push'](createTable(_0x11a108,_0x3849f0));});return _0x19dbbc;}function getPDFDocDefinition(_0x4d9406){var _0x52bc77=util['format'](_0xa2d3('0x1d'),NAME,EXTRACTED_REPORT[_0xa2d3('0x1e')],moment(EXTRACTED_REPORT[_0xa2d3('0x1f')])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x597528=[];for(var _0x41b051=0x0;_0x41b051<_0x4d9406[_0xa2d3('0x18')];_0x41b051++){var _0x3614b0=[];if(_0x41b051===0x0){_0x3614b0[_0xa2d3('0x19')]({'text':_0x52bc77,'style':_0xa2d3('0x20')});}var _0xa1f6c5={'table':_0x4d9406[_0x41b051]};if(_0x41b051>0x0){_0xa1f6c5[_0xa2d3('0x21')]=_0xa2d3('0x22');_0xa1f6c5[_0xa2d3('0x23')]=[0x0,0x46,0x0,0x0];}_0x3614b0[_0xa2d3('0x19')](_0xa1f6c5);_0x597528['push'](_0x3614b0);}return{'pageSize':'A4','pageOrientation':_0xa2d3('0x24'),'content':_0x597528,'footer':function(_0x35e136,_0x588622){return{'text':_0x35e136['toString']()+_0xa2d3('0x25')+_0x588622,'style':_0xa2d3('0x26')};},'defaultStyle':{'font':_0xa2d3('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xa2d3('0x28')},'footer':{'alignment':_0xa2d3('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x240474){var _0x547672=0x1388;var _0x167c66;if(!_0x240474[0x0][_0xa2d3('0x2a')]){return analyticExtractedReport(_0xa2d3('0x2b'));}return db[_0xa2d3('0x2c')][_0xa2d3('0x2d')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xa2d3('0x2e')]})['then'](function(_0x62923){if(_0x62923){_0x167c66=_0x62923;_0x547672=_0x167c66[_0xa2d3('0x2e')]||0x3e8;}})[_0xa2d3('0x2f')](function(){var _0x3f751f=[];var _0x46175c=0x0;if(_0x167c66[_0xa2d3('0x30')]){if(_0x240474&&_0x240474['length']){var _0x3c0e1d=_[_0xa2d3('0x31')](_0x240474[0x0][_0xa2d3('0x2a')]/_0x547672);var _0x47b3a0=Number[_0xa2d3('0x32')](_0x240474[0x0]['num']/_0x547672)?_0x240474[0x0][_0xa2d3('0x2a')]%_0x547672:0x0;_0x3c0e1d['forEach'](function(_0xffa350){if(_0xffa350>0x0){_0x46175c+=_0x547672;}_0x3f751f['push'](dbH[_0xa2d3('0x33')][_0xa2d3('0x34')](util[_0xa2d3('0x35')](_0xa2d3('0x36'),QUERY,_0x547672,_0x46175c),{'type':dbH[_0xa2d3('0x33')]['QueryTypes'][_0xa2d3('0x37')]}));});if(_0x47b3a0>0x0){_0x46175c+=_0x547672;_0x3f751f['push'](dbH[_0xa2d3('0x33')]['query'](util[_0xa2d3('0x35')](_0xa2d3('0x36'),QUERY,_0x47b3a0,_0x46175c),{'type':dbH['sequelize'][_0xa2d3('0x38')]['SELECT']}));}}}else{_0x3f751f[_0xa2d3('0x19')](dbH[_0xa2d3('0x33')][_0xa2d3('0x34')](QUERY,{'type':dbH[_0xa2d3('0x33')][_0xa2d3('0x38')][_0xa2d3('0x37')]}));}var _0x110ed1=path[_0xa2d3('0x39')](PATH);var _0x1f7692=path[_0xa2d3('0x3a')](PATH,_0xa2d3('0x3b'));var _0x1745ce=_0x167c66['split']&&_0x3f751f[_0xa2d3('0x18')]>0x1;var _0x9ad24a=[];if(!fs[_0xa2d3('0x3c')](path[_0xa2d3('0x3d')](_0x110ed1,_0x1f7692))&&_0x1745ce){fs[_0xa2d3('0x3e')](path[_0xa2d3('0x3d')](_0x110ed1,_0x1f7692));}return BPromise[_0xa2d3('0x3f')](_0x3f751f,function(_0x5b9c9e){_0x9ad24a['push'](_0x5b9c9e);})[_0xa2d3('0x2f')](function(){var _0x3e0472=[];for(var _0x6d9d05=0x0;_0x6d9d05<_0x9ad24a['length'];_0x6d9d05+=0x1){var _0x27caba=_0x9ad24a[_0x6d9d05];var _0x41ff5c=createTables(_['flatten'](_0x27caba));var _0x5054a3;var _0x2d2ac0=getPDFDocDefinition(_0x41ff5c);var _0x3e3a70=getPDFPrinter();var _0x5a1321=_0x3e3a70[_0xa2d3('0x40')](_0x2d2ac0);if(_0x1745ce){_0x5054a3=path[_0xa2d3('0x3d')](_0x110ed1,_0x1f7692,util[_0xa2d3('0x35')]('%s%d.%s',_0x1f7692,_0x6d9d05,_0xa2d3('0x41')));}else{_0x5054a3=path[_0xa2d3('0x3d')](_0x110ed1,util[_0xa2d3('0x35')](_0xa2d3('0x42'),_0x1f7692,_0xa2d3('0x41')));}_0x3e0472[_0xa2d3('0x19')](writePDFDocument(_0x5a1321,_0x5054a3));}return Promise[_0xa2d3('0x43')](_0x3e0472);})[_0xa2d3('0x2f')](function(){if(_0x1745ce){return new Promise(function(_0x2bda47){zipdir(path[_0xa2d3('0x3d')](_0x110ed1,_0x1f7692),{'saveTo':path['join'](_0x110ed1,util[_0xa2d3('0x35')]('%s.%s',_0x1f7692,_0xa2d3('0x44')))},function(){rimraf(path[_0xa2d3('0x3d')](_0x110ed1,_0x1f7692),function(){});_0x2bda47(_0xa2d3('0x45'));});});}})[_0xa2d3('0x2f')](function(){if(!_0x1745ce)return;rimraf(path['join'](_0x110ed1,_0x1f7692),function(){});})[_0xa2d3('0x2f')](function(){logger[_0xa2d3('0x46')](util[_0xa2d3('0x35')](_0xa2d3('0x47'),EXTRACTED_REPORT_ID,_0xa2d3('0x48')));return analyticExtractedReport('Completed',_0x1745ce?util[_0xa2d3('0x35')](_0xa2d3('0x42'),_0x1f7692,_0x1745ce?_0xa2d3('0x44'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xa2d3('0x46')](util[_0xa2d3('0x35')](_0xa2d3('0x49'),EXTRACTED_REPORT_ID,_0xa2d3('0x48')));return db[_0xa2d3('0x11')][_0xa2d3('0x4a')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x5ab251){EXTRACTED_REPORT=_0x5ab251;return dbH[_0xa2d3('0x33')][_0xa2d3('0x34')](util[_0xa2d3('0x35')](_0xa2d3('0x4b'),QUERY),{'type':dbH[_0xa2d3('0x33')][_0xa2d3('0x38')]['SELECT']});})[_0xa2d3('0x2f')](extractReport)[_0xa2d3('0x4c')](function(_0x2d8f35){logger[_0xa2d3('0x46')](util[_0xa2d3('0x35')](_0xa2d3('0x4d'),EXTRACTED_REPORT_ID,_0xa2d3('0x48')),util[_0xa2d3('0x4e')](_0x2d8f35,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa2d3('0x4f'));})[_0xa2d3('0x50')](function(){process[_0xa2d3('0x51')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x142137=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xa2d3('0x52'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xa2d3('0x53')}});return _0x142137;}function getPDFDocDefinitionFromHTML(_0x2f4352,_0x1bd47e){var _0x4f2605=util[_0xa2d3('0x35')]('%s\x20#%d',_0x1bd47e[_0xa2d3('0x54')],_0x1bd47e[_0xa2d3('0x55')]);var _0x593ca8=moment()['format'](_0xa2d3('0x56'))['toString']();var _0x10f94c=htmlToPdfmake(_0x2f4352,{'window':window,'tableAutoSize':!![]});return{'content':[_0x10f94c],'defaultStyle':{'font':_0xa2d3('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xa2d3('0x57'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xa2d3('0x57'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xa2d3('0x57')}},'header':function(){return[{'text':_0xa2d3('0x58'),'style':'header'}];},'footer':function(_0x223c63,_0xc16e11){return[{'text':util['format'](_0xa2d3('0x59'),_0x4f2605,_0x223c63,_0xc16e11,_0x593ca8),'style':_0xa2d3('0x26')}];}};}function writePDFDocument(_0x3c24f2,_0x7b8365){return new Promise(function(_0x490404,_0x431170){var _0x53847b=_0x3c24f2[_0xa2d3('0x5a')](fs[_0xa2d3('0x5b')](_0x7b8365));_0x53847b['on'](_0xa2d3('0x5c'),function(){_0x490404(_0xa2d3('0x5c'));});_0x53847b['on'](_0xa2d3('0x5d'),function(_0x55d32e){_0x431170(_0x55d32e);});_0x3c24f2['end']();});}exports[_0xa2d3('0x5e')]=function(_0x327a0f,_0x3a12e5){var _0x504592=getPDFPrinter();var _0x4f098f=getPDFDocDefinitionFromHTML(_0x327a0f,_0x3a12e5);var _0x52d364=_0x504592['createPdfKitDocument'](_0x4f098f);return writePDFDocument(_0x52d364,_0x3a12e5[_0xa2d3('0x1')])[_0xa2d3('0x4c')](function(_0x4ecef3){throw _0x4ecef3;});}; \ No newline at end of file +var _0x88c4=['path','catch','lodash','util','moment','pdfmake/src/printer','rimraf','window','bluebird','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','pick','toString','value','fill','length','auto','body','push','chunk','forEach','name','format','endDate','header','pageBreak','before','margin','\x20/\x20','Arial','right','num','splitSizePdf','then','split','range','isInteger','query','sequelize','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf','existsSync','mkdirSync','flatten','createPdfKitDocument','join','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','error','end','createPdfFromHTML'];(function(_0x2f6584,_0x318b6b){var _0x115d2d=function(_0x3966aa){while(--_0x3966aa){_0x2f6584['push'](_0x2f6584['shift']());}};_0x115d2d(++_0x318b6b);}(_0x88c4,0xae));var _0x488c=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x88c4[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x488c('0x0'));var fs=require('fs');var util=require(_0x488c('0x1'));var path=require('path');var moment=require(_0x488c('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x488c('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x488c('0x4'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')[_0x488c('0x5')];var BPromise=require(_0x488c('0x6'));var db=require(_0x488c('0x7'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')(_0x488c('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x488c('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x488c('0x9')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x488c('0xa');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x45d68e,_0x2ee17a){var _0x5c68be={'status':_0x45d68e};var _0x1134e9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ee17a){_0x5c68be[_0x488c('0xb')]=_0x2ee17a;}return db['AnalyticExtractedReport'][_0x488c('0xc')](_0x5c68be,_0x1134e9);}function getHeaders(_0xa74055){return _[_0x488c('0xd')](_0xa74055,function(_0x4e846f){return{'text':_0x4e846f,'style':_0x488c('0xe')};});}function getRows(_0x5f4af9,_0x4c3852){return _['map'](_0x4c3852,function(_0x4223e7){return _(_0x4223e7)[_0x488c('0xf')](_0x5f4af9)[_0x488c('0xd')](function(_0x20c362){return _0x20c362?_[_0x488c('0x10')](_0x20c362):'';})[_0x488c('0x11')]();});}function createTable(_0x2c7364,_0x29d791){var _0x2d58a7={'widths':_[_0x488c('0x12')](Array(_0x2c7364[_0x488c('0x13')]),0x91),'heights':function(_0x4232ae){return _0x4232ae===0x0?_0x488c('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2a1cc1=getHeaders(_0x2c7364);_0x2d58a7[_0x488c('0x15')][_0x488c('0x16')](_0x2a1cc1);var _0x26c11=getRows(_0x2c7364,_0x29d791);_0x2d58a7[_0x488c('0x15')]=_0x2d58a7['body']['concat'](_0x26c11);return _0x2d58a7;}function createTables(_0x5e586d){var _0x25a03a=[];var _0x1d6a85=_[_0x488c('0x17')](Object['keys'](_0x5e586d[0x0]),0x5);_0x1d6a85[_0x488c('0x18')](function(_0x5f0984){_0x25a03a[_0x488c('0x16')](createTable(_0x5f0984,_0x5e586d));});return _0x25a03a;}function getPDFDocDefinition(_0x188e99){var _0x11b8c0=util['format']('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x488c('0x19')],moment(EXTRACTED_REPORT['startDate'])[_0x488c('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x488c('0x1b')])[_0x488c('0x1a')](FORMAT));var _0x5d7964=[];for(var _0xc5700e=0x0;_0xc5700e<_0x188e99[_0x488c('0x13')];_0xc5700e++){var _0x3e2b9a=[];if(_0xc5700e===0x0){_0x3e2b9a[_0x488c('0x16')]({'text':_0x11b8c0,'style':_0x488c('0x1c')});}var _0x2bed76={'table':_0x188e99[_0xc5700e]};if(_0xc5700e>0x0){_0x2bed76[_0x488c('0x1d')]=_0x488c('0x1e');_0x2bed76[_0x488c('0x1f')]=[0x0,0x46,0x0,0x0];}_0x3e2b9a['push'](_0x2bed76);_0x5d7964[_0x488c('0x16')](_0x3e2b9a);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x5d7964,'footer':function(_0x465b08,_0x2fd83d){return{'text':_0x465b08['toString']()+_0x488c('0x20')+_0x2fd83d,'style':'footer'};},'defaultStyle':{'font':_0x488c('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x488c('0x22'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2848b6){var _0x2d8923=0x1388;var _0x419445;if(!_0x2848b6[0x0][_0x488c('0x23')]){return analyticExtractedReport('Empty');}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x488c('0x24')]})[_0x488c('0x25')](function(_0x2bd923){if(_0x2bd923){_0x419445=_0x2bd923;_0x2d8923=_0x419445[_0x488c('0x24')]||0x3e8;}})[_0x488c('0x25')](function(){var _0x58234f=[];var _0x46c0cb=0x0;if(_0x419445[_0x488c('0x26')]){if(_0x2848b6&&_0x2848b6[_0x488c('0x13')]){var _0x240f08=_[_0x488c('0x27')](_0x2848b6[0x0][_0x488c('0x23')]/_0x2d8923);var _0x48fefb=Number[_0x488c('0x28')](_0x2848b6[0x0][_0x488c('0x23')]/_0x2d8923)?_0x2848b6[0x0]['num']%_0x2d8923:0x0;_0x240f08[_0x488c('0x18')](function(_0x300eb9){if(_0x300eb9>0x0){_0x46c0cb+=_0x2d8923;}_0x58234f['push'](dbH['sequelize'][_0x488c('0x29')](util[_0x488c('0x1a')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2d8923,_0x46c0cb),{'type':dbH[_0x488c('0x2a')][_0x488c('0x2b')][_0x488c('0x2c')]}));});if(_0x48fefb>0x0){_0x46c0cb+=_0x2d8923;_0x58234f[_0x488c('0x16')](dbH[_0x488c('0x2a')]['query'](util[_0x488c('0x1a')](_0x488c('0x2d'),QUERY,_0x48fefb,_0x46c0cb),{'type':dbH['sequelize'][_0x488c('0x2b')][_0x488c('0x2c')]}));}}}else{_0x58234f[_0x488c('0x16')](dbH[_0x488c('0x2a')][_0x488c('0x29')](QUERY,{'type':dbH[_0x488c('0x2a')][_0x488c('0x2b')][_0x488c('0x2c')]}));}var _0x2d9af6=path[_0x488c('0x2e')](PATH);var _0x121339=path[_0x488c('0x2f')](PATH,_0x488c('0x30'));var _0x2c1f4f=_0x419445['split']&&_0x58234f[_0x488c('0x13')]>0x1;var _0x1a1bf1=[];if(!fs[_0x488c('0x31')](path['join'](_0x2d9af6,_0x121339))&&_0x2c1f4f){fs[_0x488c('0x32')](path['join'](_0x2d9af6,_0x121339));}return BPromise['each'](_0x58234f,function(_0x576665){_0x1a1bf1[_0x488c('0x16')](_0x576665);})[_0x488c('0x25')](function(){var _0x57fa5e=[];for(var _0x4cde98=0x0;_0x4cde98<_0x1a1bf1[_0x488c('0x13')];_0x4cde98+=0x1){var _0x9e877f=_0x1a1bf1[_0x4cde98];var _0x1b93b5=createTables(_[_0x488c('0x33')](_0x9e877f));var _0x5cde21;var _0x675a25=getPDFDocDefinition(_0x1b93b5);var _0x18959d=getPDFPrinter();var _0x2fa54d=_0x18959d[_0x488c('0x34')](_0x675a25);if(_0x2c1f4f){_0x5cde21=path[_0x488c('0x35')](_0x2d9af6,_0x121339,util[_0x488c('0x1a')](_0x488c('0x36'),_0x121339,_0x4cde98,_0x488c('0x37')));}else{_0x5cde21=path[_0x488c('0x35')](_0x2d9af6,util[_0x488c('0x1a')](_0x488c('0x38'),_0x121339,_0x488c('0x37')));}_0x57fa5e[_0x488c('0x16')](writePDFDocument(_0x2fa54d,_0x5cde21));}return Promise[_0x488c('0x39')](_0x57fa5e);})[_0x488c('0x25')](function(){if(_0x2c1f4f){return new Promise(function(_0x5024d9){zipdir(path[_0x488c('0x35')](_0x2d9af6,_0x121339),{'saveTo':path['join'](_0x2d9af6,util['format'](_0x488c('0x38'),_0x121339,_0x488c('0x3a')))},function(){rimraf(path[_0x488c('0x35')](_0x2d9af6,_0x121339),function(){});_0x5024d9(_0x488c('0x3b'));});});}})[_0x488c('0x25')](function(){if(!_0x2c1f4f)return;rimraf(path[_0x488c('0x35')](_0x2d9af6,_0x121339),function(){});})[_0x488c('0x25')](function(){logger[_0x488c('0x3c')](util[_0x488c('0x1a')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x488c('0x3d')));return analyticExtractedReport('Completed',_0x2c1f4f?util['format'](_0x488c('0x38'),_0x121339,_0x2c1f4f?_0x488c('0x3a'):_0x488c('0x37')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x488c('0x1a')](_0x488c('0x3e'),EXTRACTED_REPORT_ID,_0x488c('0x3d')));return db[_0x488c('0x3f')][_0x488c('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x488c('0x25')](function(_0x1ec71d){EXTRACTED_REPORT=_0x1ec71d;return dbH[_0x488c('0x2a')][_0x488c('0x29')](util[_0x488c('0x1a')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x488c('0x2a')]['QueryTypes']['SELECT']});})[_0x488c('0x25')](extractReport)['catch'](function(_0x24e151){logger['info'](util[_0x488c('0x1a')](_0x488c('0x41'),EXTRACTED_REPORT_ID,_0x488c('0x3d')),util[_0x488c('0x42')](_0x24e151,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x488c('0x43')](function(){process[_0x488c('0x44')](EXIT_CODE);});}main();function getPDFPrinter(){var _0xe9f424=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x488c('0x45'),'italics':__dirname+_0x488c('0x46'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0xe9f424;}function getPDFDocDefinitionFromHTML(_0x205bd2,_0x1d57a9){var _0x413708=util[_0x488c('0x1a')](_0x488c('0x47'),_0x1d57a9['channel'],_0x1d57a9[_0x488c('0x48')]);var _0x4e91f3=moment()['format'](_0x488c('0x49'))[_0x488c('0x10')]();var _0x1c89dc=htmlToPdfmake(_0x205bd2,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1c89dc],'defaultStyle':{'font':_0x488c('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x488c('0x4a'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x488c('0x4a'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x488c('0x4a')}},'header':function(){return[{'text':_0x488c('0x4b'),'style':_0x488c('0x1c')}];},'footer':function(_0x552567,_0x3c7d3a){return[{'text':util[_0x488c('0x1a')](_0x488c('0x4c'),_0x413708,_0x552567,_0x3c7d3a,_0x4e91f3),'style':_0x488c('0x4d')}];}};}function writePDFDocument(_0x25ee6d,_0x4c3a9d){return new Promise(function(_0x54465c,_0x51d3eb){var _0x583fb2=_0x25ee6d[_0x488c('0x4e')](fs[_0x488c('0x4f')](_0x4c3a9d));_0x583fb2['on'](_0x488c('0x50'),function(){_0x54465c(_0x488c('0x50'));});_0x583fb2['on'](_0x488c('0x51'),function(_0x508d73){_0x51d3eb(_0x508d73);});_0x25ee6d[_0x488c('0x52')]();});}exports[_0x488c('0x53')]=function(_0x276e80,_0xb13cef){var _0x3c6d44=getPDFPrinter();var _0x26133a=getPDFDocDefinitionFromHTML(_0x276e80,_0xb13cef);var _0x320a37=_0x3c6d44[_0x488c('0x34')](_0x26133a);return writePDFDocument(_0x320a37,_0xb13cef[_0x488c('0x54')])[_0x488c('0x55')](function(_0x32c6c4){throw _0x32c6c4;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index c300766..64a4d63 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 _0xdcde=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','query','QueryTypes','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','xlsx','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','%s.%s','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','json2xls','bluebird','zip-dir','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize'];(function(_0x4fad39,_0x57960b){var _0x466e9a=function(_0x3cdce1){while(--_0x3cdce1){_0x4fad39['push'](_0x4fad39['shift']());}};_0x466e9a(++_0x57960b);}(_0xdcde,0x1d0));var _0xedcd=function(_0x5ed73b,_0x314c57){_0x5ed73b=_0x5ed73b-0x0;var _0x667d43=_0xdcde[_0x5ed73b];return _0x667d43;};'use strict';var util=require(_0xedcd('0x0'));var path=require(_0xedcd('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xedcd('0x2'));var BPromise=require(_0xedcd('0x3'));var zipdir=require(_0xedcd('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xedcd('0x5')];var logger=require(_0xedcd('0x6'))(_0xedcd('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xedcd('0x8')][0x3];var PATH=process[_0xedcd('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x106aaa,_0x2d0c81){var _0x50a7df={'status':_0x106aaa};var _0x24e96a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2d0c81){_0x50a7df[_0xedcd('0x9')]=_0x2d0c81;}return db[_0xedcd('0xa')][_0xedcd('0xb')](_0x50a7df,_0x24e96a);}function main(){var _0x94fdc8=0x1388;var _0x3712ad;logger[_0xedcd('0xc')](util[_0xedcd('0xd')](_0xedcd('0xe'),EXTRACTED_REPORT_ID,_0xedcd('0xf')));return db[_0xedcd('0x10')][_0xedcd('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xedcd('0x12'),_0xedcd('0x13')]})[_0xedcd('0x14')](function(_0x7f32be){if(_0x7f32be){_0x3712ad=_0x7f32be;_0x94fdc8=_0x3712ad['splitSizeXlsx']||0x1388;}})[_0xedcd('0x14')](function(){return dbH[_0xedcd('0x15')]['query'](util[_0xedcd('0xd')](_0xedcd('0x16'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xedcd('0x17')]});})['then'](function(_0x546af9){if(!_0x546af9[0x0][_0xedcd('0x18')]){return analyticExtractedReport(_0xedcd('0x19'));}var _0x48a5f7=[];var _0x543628=0x0;if(_0x3712ad[_0xedcd('0x12')]){if(_0x546af9&&_0x546af9[_0xedcd('0x1a')]){var _0x503bd3=_[_0xedcd('0x1b')](_0x546af9[0x0][_0xedcd('0x18')]/_0x94fdc8);var _0x2e0095=Number[_0xedcd('0x1c')](_0x546af9[0x0]['num']/_0x94fdc8)?_0x546af9[0x0]['num']%_0x94fdc8:0x0;_0x503bd3[_0xedcd('0x1d')](function(_0x23d850){if(_0x23d850>0x0){_0x543628+=_0x94fdc8;}_0x48a5f7[_0xedcd('0x1e')](dbH[_0xedcd('0x15')]['query'](util[_0xedcd('0xd')](_0xedcd('0x1f'),QUERY,_0x94fdc8,_0x543628),{'type':dbH[_0xedcd('0x15')]['QueryTypes'][_0xedcd('0x17')]}));});if(_0x2e0095>0x0){_0x543628+=_0x94fdc8;_0x48a5f7['push'](dbH[_0xedcd('0x15')][_0xedcd('0x20')](util[_0xedcd('0xd')](_0xedcd('0x1f'),QUERY,_0x2e0095,_0x543628),{'type':dbH[_0xedcd('0x15')]['QueryTypes']['SELECT']}));}}}else{_0x48a5f7[_0xedcd('0x1e')](dbH[_0xedcd('0x15')][_0xedcd('0x20')](QUERY,{'type':dbH['sequelize'][_0xedcd('0x21')]['SELECT']}));}var _0x3e5b1d=path[_0xedcd('0x22')](PATH);var _0xa7558e=path[_0xedcd('0x23')](PATH,_0xedcd('0x24'));var _0x574660=_0x3712ad[_0xedcd('0x12')]&&_0x48a5f7['length']>0x1;var _0x246c41=[];if(!fs[_0xedcd('0x25')](path[_0xedcd('0x26')](_0x3e5b1d,_0xa7558e))&&_0x574660){fs[_0xedcd('0x27')](path[_0xedcd('0x26')](_0x3e5b1d,_0xa7558e));}return BPromise[_0xedcd('0x28')](_0x48a5f7,function(_0x3e6aab){_0x246c41[_0xedcd('0x1e')](_0x3e6aab);})[_0xedcd('0x14')](function(){for(var _0x359e1b=0x0;_0x359e1b<_0x246c41[_0xedcd('0x1a')];_0x359e1b+=0x1){var _0x561b14;var _0xd1ec62=_0x246c41[_0x359e1b];if(_0x574660){_0x561b14=path[_0xedcd('0x26')](_0x3e5b1d,_0xa7558e,util[_0xedcd('0xd')]('%s%d.%s',_0xa7558e,_0x359e1b,_0xedcd('0x29')));}else{_0x561b14=path[_0xedcd('0x26')](_0x3e5b1d,util[_0xedcd('0xd')]('%s.%s',_0xa7558e,_0xedcd('0x29')));}fs['writeFileSync'](_0x561b14,json2xls(_0xd1ec62),_0xedcd('0x2a'));}})[_0xedcd('0x14')](function(){if(_0x574660){return new Promise(function(_0x7f79cd){zipdir(path[_0xedcd('0x26')](_0x3e5b1d,_0xa7558e),{'saveTo':path[_0xedcd('0x26')](_0x3e5b1d,util[_0xedcd('0xd')]('%s.%s',_0xa7558e,_0xedcd('0x2b')))},function(_0x17c802,_0x410361){rimraf(path[_0xedcd('0x26')](_0x3e5b1d,_0xa7558e),function(){});_0x7f79cd(_0xedcd('0x2c'));});});}})['then'](function(){logger['info'](util[_0xedcd('0xd')](_0xedcd('0x2d'),EXTRACTED_REPORT_ID,_0xedcd('0xf')));return analyticExtractedReport(_0xedcd('0x2e'),_0x574660?util[_0xedcd('0xd')](_0xedcd('0x2f'),_0xa7558e,_0x574660?_0xedcd('0x2b'):'xlsx'):null);});})[_0xedcd('0x30')](function(_0x147f31){logger['info'](util[_0xedcd('0xd')](_0xedcd('0x31'),EXTRACTED_REPORT_ID,_0xedcd('0xf')),util[_0xedcd('0x32')](_0x147f31,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xedcd('0x33'));})[_0xedcd('0x34')](function(){process[_0xedcd('0x35')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x4628=['xlsx','writeFileSync','binary','%s.%s','zip','zip\x20finished','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','path','bluebird','rimraf','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','split','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s'];(function(_0x50200a,_0x6ed783){var _0xa65ece=function(_0x292fc){while(--_0x292fc){_0x50200a['push'](_0x50200a['shift']());}};_0xa65ece(++_0x6ed783);}(_0x4628,0x70));var _0x8462=function(_0x1a89df,_0x55a137){_0x1a89df=_0x1a89df-0x0;var _0x282029=_0x4628[_0x1a89df];return _0x282029;};'use strict';var util=require('util');var path=require(_0x8462('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x8462('0x1'));var zipdir=require('zip-dir');var rimraf=require(_0x8462('0x2'));var db=require('../../mysqldb')['db'];var dbH=require(_0x8462('0x3'))[_0x8462('0x4')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x8462('0x5')][0x2]);var QUERY=process[_0x8462('0x5')][0x3];var PATH=process[_0x8462('0x5')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x36a09d,_0x470457){var _0x578718={'status':_0x36a09d};var _0x1d4de9={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x470457){_0x578718[_0x8462('0x6')]=_0x470457;}return db[_0x8462('0x7')]['update'](_0x578718,_0x1d4de9);}function main(){var _0x4a76bc=0x1388;var _0x5eacf7;logger[_0x8462('0x8')](util['format'](_0x8462('0x9'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0x8462('0xa')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x8462('0xb')]})[_0x8462('0xc')](function(_0x1651b1){if(_0x1651b1){_0x5eacf7=_0x1651b1;_0x4a76bc=_0x5eacf7[_0x8462('0xb')]||0x1388;}})[_0x8462('0xc')](function(){return dbH[_0x8462('0xd')][_0x8462('0xe')](util[_0x8462('0xf')](_0x8462('0x10'),QUERY),{'type':dbH[_0x8462('0xd')]['QueryTypes'][_0x8462('0x11')]});})[_0x8462('0xc')](function(_0x4038a1){if(!_0x4038a1[0x0][_0x8462('0x12')]){return analyticExtractedReport(_0x8462('0x13'));}var _0x3dae65=[];var _0x59face=0x0;if(_0x5eacf7[_0x8462('0x14')]){if(_0x4038a1&&_0x4038a1[_0x8462('0x15')]){var _0x49ba1b=_[_0x8462('0x16')](_0x4038a1[0x0][_0x8462('0x12')]/_0x4a76bc);var _0x2ec4d3=Number[_0x8462('0x17')](_0x4038a1[0x0][_0x8462('0x12')]/_0x4a76bc)?_0x4038a1[0x0][_0x8462('0x12')]%_0x4a76bc:0x0;_0x49ba1b[_0x8462('0x18')](function(_0x6d7f81){if(_0x6d7f81>0x0){_0x59face+=_0x4a76bc;}_0x3dae65[_0x8462('0x19')](dbH['sequelize'][_0x8462('0xe')](util[_0x8462('0xf')](_0x8462('0x1a'),QUERY,_0x4a76bc,_0x59face),{'type':dbH[_0x8462('0xd')][_0x8462('0x1b')][_0x8462('0x11')]}));});if(_0x2ec4d3>0x0){_0x59face+=_0x4a76bc;_0x3dae65[_0x8462('0x19')](dbH[_0x8462('0xd')][_0x8462('0xe')](util[_0x8462('0xf')](_0x8462('0x1a'),QUERY,_0x2ec4d3,_0x59face),{'type':dbH[_0x8462('0xd')][_0x8462('0x1b')][_0x8462('0x11')]}));}}}else{_0x3dae65[_0x8462('0x19')](dbH[_0x8462('0xd')]['query'](QUERY,{'type':dbH[_0x8462('0xd')][_0x8462('0x1b')][_0x8462('0x11')]}));}var _0x5ad9b4=path['dirname'](PATH);var _0x305e6b=path[_0x8462('0x1c')](PATH,_0x8462('0x1d'));var _0x352ff4=_0x5eacf7[_0x8462('0x14')]&&_0x3dae65['length']>0x1;var _0x2d262d=[];if(!fs[_0x8462('0x1e')](path[_0x8462('0x1f')](_0x5ad9b4,_0x305e6b))&&_0x352ff4){fs[_0x8462('0x20')](path[_0x8462('0x1f')](_0x5ad9b4,_0x305e6b));}return BPromise[_0x8462('0x21')](_0x3dae65,function(_0x4a3ef1){_0x2d262d[_0x8462('0x19')](_0x4a3ef1);})[_0x8462('0xc')](function(){for(var _0x1d7f99=0x0;_0x1d7f99<_0x2d262d[_0x8462('0x15')];_0x1d7f99+=0x1){var _0xc0e9c2;var _0x3d56a4=_0x2d262d[_0x1d7f99];if(_0x352ff4){_0xc0e9c2=path['join'](_0x5ad9b4,_0x305e6b,util[_0x8462('0xf')](_0x8462('0x22'),_0x305e6b,_0x1d7f99,_0x8462('0x23')));}else{_0xc0e9c2=path[_0x8462('0x1f')](_0x5ad9b4,util[_0x8462('0xf')]('%s.%s',_0x305e6b,_0x8462('0x23')));}fs[_0x8462('0x24')](_0xc0e9c2,json2xls(_0x3d56a4),_0x8462('0x25'));}})['then'](function(){if(_0x352ff4){return new Promise(function(_0x2a134f){zipdir(path['join'](_0x5ad9b4,_0x305e6b),{'saveTo':path[_0x8462('0x1f')](_0x5ad9b4,util[_0x8462('0xf')](_0x8462('0x26'),_0x305e6b,_0x8462('0x27')))},function(_0x5874a5,_0x3347b4){rimraf(path[_0x8462('0x1f')](_0x5ad9b4,_0x305e6b),function(){});_0x2a134f(_0x8462('0x28'));});});}})[_0x8462('0xc')](function(){logger[_0x8462('0x8')](util[_0x8462('0xf')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x8462('0x29')));return analyticExtractedReport(_0x8462('0x2a'),_0x352ff4?util[_0x8462('0xf')](_0x8462('0x26'),_0x305e6b,_0x352ff4?_0x8462('0x27'):_0x8462('0x23')):null);});})[_0x8462('0x2b')](function(_0x5ddd89){logger['info'](util[_0x8462('0xf')](_0x8462('0x2c'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x8462('0x2d')](_0x5ddd89,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8462('0x2e'));})[_0x8462('0x2f')](function(){process[_0x8462('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 c7d3bb7..994e149 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 _0xb5ca=['_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','context','VoiceExtensionId','CDR(routeid)=','outbound','cutdigits','${EXTEN:','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none'];(function(_0xe0a10c,_0x6a3df2){var _0x42eabe=function(_0x264bb7){while(--_0x264bb7){_0xe0a10c['push'](_0xe0a10c['shift']());}};_0x42eabe(++_0x6a3df2);}(_0xb5ca,0x13e));var _0xab5c=function(_0x47dd26,_0x2600d1){_0x47dd26=_0x47dd26-0x0;var _0x92e102=_0xb5ca[_0x47dd26];return _0x92e102;};'use strict';var _=require(_0xab5c('0x0'));var util=require('util');function rewrite(_0x2c97d8,_0x19f9b9){var _0x3d1482=this;return _0x2c97d8[_0xab5c('0x1')][_0xab5c('0x2')][_0xab5c('0x3')]({'raw':!![]})[_0xab5c('0x4')](function(_0xf407f5){_0x3d1482[_0xab5c('0x5')]=_0xf407f5;return _0x2c97d8[_0xab5c('0x1')][_0xab5c('0x6')][_0xab5c('0x3')]({'where':{'IntervalId':_0x19f9b9[_0xab5c('0x7')]},'raw':!![]});})['then'](function(_0x4ae932){return _0x2c97d8[_0xab5c('0x1')][_0xab5c('0x6')][_0xab5c('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0xab5c('0x8')](_0x4ae932,_0xab5c('0x9')))}},'order':[{'raw':_0xab5c('0xa')}],'raw':!![]});})[_0xab5c('0x4')](function(_0xb3299a){var _0x2a862a=_[_0xab5c('0xb')](_0xb3299a,{'priority':'1'});var _0x36a2f8=_[_0xab5c('0xb')](_0xb3299a,{'isApp':0x1});var _0x4bfb64=_[_0xab5c('0xc')](_0x36a2f8,_0xab5c('0x9'));var _0x5d905b=[_0xab5c('0xd'),_0xab5c('0xe')];var _0x38fd29=[];var _0x1e16af=[];for(var _0x556151 in _0x4bfb64){if(_0x4bfb64[_0xab5c('0xf')](_0x556151)){_0x3d1482[_0xab5c('0x10')]=0x2;_0x3d1482[_0xab5c('0x11')]=[];_0x3d1482[_0xab5c('0x12')]=_[_0xab5c('0x13')](_0x2a862a,{'exten':_0x4bfb64[_0x556151][0x0][_0xab5c('0x9')]});_0x3d1482[_0xab5c('0x11')][_0xab5c('0x14')]({'type':_0x4bfb64[_0x556151][0x0][_0xab5c('0x15')],'app':_0xab5c('0x16'),'appdata':util[_0xab5c('0x17')]('CDR(type)=%s',_0x4bfb64[_0x556151][0x0]['type']),'context':_0x4bfb64[_0x556151][0x0][_0xab5c('0x18')],'exten':_0x4bfb64[_0x556151][0x0]['exten'],'priority':_0x3d1482[_0xab5c('0x10')]++,'VoiceExtensionId':_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')]});if(_0x4bfb64[_0x556151][0x0][_0xab5c('0x15')]==='inbound'){_0x3d1482[_0xab5c('0x11')][_0xab5c('0x14')]({'type':_0x4bfb64[_0x556151][0x0][_0xab5c('0x15')],'app':'Set','appdata':_0xab5c('0x1a')+_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')],'context':_0x4bfb64[_0x556151][0x0][_0xab5c('0x18')],'exten':_0x4bfb64[_0x556151][0x0]['exten'],'priority':_0x3d1482[_0xab5c('0x10')]++,'VoiceExtensionId':_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')]});}else if(_0x4bfb64[_0x556151][0x0][_0xab5c('0x15')]===_0xab5c('0x1b')){if(_0x3d1482['extension']){_0x3d1482['extensions']['push']({'type':_0x4bfb64[_0x556151][0x0]['type'],'app':_0xab5c('0x16'),'appdata':'CDR(destination)='+(_0x3d1482['extension'][_0xab5c('0x1c')]?_0xab5c('0x1d')+_0x3d1482[_0xab5c('0x12')][_0xab5c('0x1c')]+'}':'${EXTEN}'),'context':_0x4bfb64[_0x556151][0x0][_0xab5c('0x18')],'exten':_0x4bfb64[_0x556151][0x0][_0xab5c('0x9')],'priority':_0x3d1482['priority']++,'VoiceExtensionId':_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')]});}_0x3d1482[_0xab5c('0x11')][_0xab5c('0x14')]({'type':_0x4bfb64[_0x556151][0x0][_0xab5c('0x15')],'app':_0xab5c('0x16'),'appdata':_0xab5c('0x1a')+_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')],'context':_0x4bfb64[_0x556151][0x0][_0xab5c('0x18')],'exten':_0x4bfb64[_0x556151][0x0]['exten'],'priority':_0x3d1482[_0xab5c('0x10')]++,'VoiceExtensionId':_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')]});var _0x1a900e=_0x3d1482['priority']++;_0x3d1482[_0xab5c('0x11')][_0xab5c('0x14')]({'type':_0x4bfb64[_0x556151][0x0][_0xab5c('0x15')],'app':_0xab5c('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x1a900e+0x2)+_0xab5c('0x1f')+(_0x1a900e+0x1)+')','context':_0x4bfb64[_0x556151][0x0][_0xab5c('0x18')],'exten':_0x4bfb64[_0x556151][0x0][_0xab5c('0x9')],'priority':_0x1a900e,'VoiceExtensionId':_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')]});if(_0x3d1482[_0xab5c('0x12')]){_0x3d1482[_0xab5c('0x11')][_0xab5c('0x14')]({'type':_0x4bfb64[_0x556151][0x0][_0xab5c('0x15')],'app':_0xab5c('0x16'),'appdata':_0x3d1482[_0xab5c('0x12')][_0xab5c('0x1c')]?_0xab5c('0x20')+_0x3d1482[_0xab5c('0x12')][_0xab5c('0x1c')]+'}':_0xab5c('0x21'),'context':_0x4bfb64[_0x556151][0x0][_0xab5c('0x18')],'exten':_0x4bfb64[_0x556151][0x0]['exten'],'priority':_0x3d1482[_0xab5c('0x10')]++,'VoiceExtensionId':_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')]});}_0x3d1482['extensions'][_0xab5c('0x14')]({'type':_0x4bfb64[_0x556151][0x0]['type'],'app':_0xab5c('0x16'),'appdata':_0xab5c('0x22')+_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')],'context':_0x4bfb64[_0x556151][0x0][_0xab5c('0x18')],'exten':_0x4bfb64[_0x556151][0x0]['exten'],'priority':_0x3d1482[_0xab5c('0x10')]++,'VoiceExtensionId':_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')]});if(_0x3d1482[_0xab5c('0x12')]&&_0x3d1482['extension'][_0xab5c('0xf')](_0xab5c('0x23'))&&_0x3d1482['extension'][_0xab5c('0x23')]!==_0xab5c('0x24')){_0x3d1482[_0xab5c('0x11')][_0xab5c('0x14')]({'type':_0x4bfb64[_0x556151][0x0][_0xab5c('0x15')],'app':_0xab5c('0x16'),'appdata':_0xab5c('0x25'),'context':_0x4bfb64[_0x556151][0x0]['context'],'exten':_0x4bfb64[_0x556151][0x0][_0xab5c('0x9')],'priority':_0x3d1482[_0xab5c('0x10')]++,'VoiceExtensionId':_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')]});_0x3d1482[_0xab5c('0x11')][_0xab5c('0x14')]({'type':_0x4bfb64[_0x556151][0x0]['type'],'app':_0xab5c('0x16'),'appdata':_0xab5c('0x26')+_0x3d1482[_0xab5c('0x12')][_0xab5c('0x23')]||_0xab5c('0x27'),'context':_0x4bfb64[_0x556151][0x0]['context'],'exten':_0x4bfb64[_0x556151][0x0]['exten'],'priority':_0x3d1482['priority']++,'VoiceExtensionId':_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')]});}}_0x3d1482[_0xab5c('0x11')][_0xab5c('0x14')]({'type':_0x4bfb64[_0x556151][0x0][_0xab5c('0x15')],'app':_0xab5c('0x16'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4bfb64[_0x556151][0x0][_0xab5c('0x18')],'exten':_0x4bfb64[_0x556151][0x0][_0xab5c('0x9')],'priority':_0x3d1482['priority']++,'VoiceExtensionId':_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')]});_0x3d1482[_0xab5c('0x11')][_0xab5c('0x14')]({'type':_0x4bfb64[_0x556151][0x0][_0xab5c('0x15')],'app':_0xab5c('0x16'),'appdata':_0xab5c('0x28'),'context':_0x4bfb64[_0x556151][0x0][_0xab5c('0x18')],'exten':_0x4bfb64[_0x556151][0x0][_0xab5c('0x9')],'priority':_0x3d1482[_0xab5c('0x10')]++,'VoiceExtensionId':_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')]});_0x3d1482['extensions'][_0xab5c('0x14')]({'type':_0x4bfb64[_0x556151][0x0][_0xab5c('0x15')],'app':'Set','appdata':_0xab5c('0x29'),'context':_0x4bfb64[_0x556151][0x0][_0xab5c('0x18')],'exten':_0x4bfb64[_0x556151][0x0][_0xab5c('0x9')],'priority':_0x3d1482[_0xab5c('0x10')]++,'VoiceExtensionId':_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')]});for(var _0x1d90f3=0x0,_0xb6b68f=0x0;_0x1d90f3<_0x4bfb64[_0x556151][_0xab5c('0x2a')];_0x1d90f3+=0x1,_0xb6b68f=0x0){var _0x517e32=_0x4bfb64[_0x556151][_0x1d90f3];if(_0x517e32[_0xab5c('0x15')]){_0x517e32[_0xab5c('0x15')]=_0x517e32[_0xab5c('0x15')][_0xab5c('0x2b')]();}var _0xdc299b=[];var _0x4b70ea=[];delete _0x517e32['id'];delete _0x517e32['createdAt'];delete _0x517e32[_0xab5c('0x2c')];var _0x5709d7=_0x517e32[_0xab5c('0x2d')]!=='*,*,*,*'?[_0x517e32[_0xab5c('0x2d')]]:_0x517e32[_0xab5c('0x7')]?_[_0xab5c('0x8')](_[_0xab5c('0xb')](_0x3d1482['intervals'],{'IntervalId':_0x517e32['IntervalId']}),_0xab5c('0x2d')):[];if(_0x517e32['hasOwnProperty'](_0xab5c('0x2e'))){if(_0x517e32[_0xab5c('0x2e')]&&_0x517e32[_0xab5c('0x2e')]!=='--'){_0xdc299b[_0xab5c('0x14')]({'type':_0x517e32[_0xab5c('0x15')],'app':_0xab5c('0x16'),'appdata':_0xab5c('0x2f')+_0x517e32[_0xab5c('0x2e')],'context':_0x517e32[_0xab5c('0x18')],'exten':_0x517e32['exten'],'priority':_0x5709d7[_0xab5c('0x2a')]+_0x3d1482[_0xab5c('0x10')]+_0xb6b68f++,'VoiceExtensionId':_0x517e32[_0xab5c('0x19')]});}}if(_0x517e32[_0xab5c('0x15')]==='outbound'&&_0x517e32[_0xab5c('0xf')]('callerID')){if(_0x517e32[_0xab5c('0x30')]){_0xdc299b[_0xab5c('0x14')]({'type':_0x517e32['type'],'app':_0xab5c('0x1e'),'appdata':_0xab5c('0x31')+_0x517e32[_0xab5c('0x30')]+')','context':_0x517e32['context'],'exten':_0x517e32['exten'],'priority':_0x5709d7[_0xab5c('0x2a')]+_0x3d1482[_0xab5c('0x10')]+_0xb6b68f++,'VoiceExtensionId':_0x517e32[_0xab5c('0x19')]});}else{_0xdc299b[_0xab5c('0x14')]({'type':_0x517e32[_0xab5c('0x15')],'app':_0xab5c('0x1e'),'appdata':_0xab5c('0x32'),'context':_0x517e32['context'],'exten':_0x517e32['exten'],'priority':_0x5709d7[_0xab5c('0x2a')]+_0x3d1482[_0xab5c('0x10')]+_0xb6b68f++,'VoiceExtensionId':_0x517e32[_0xab5c('0x19')]});}}if(_0x517e32[_0xab5c('0xf')]('answer')){if(_0x5d905b[_0xab5c('0x33')](_0x517e32['app']['toLowerCase']())>=0x0&&_0x517e32[_0xab5c('0x34')]!==_0xab5c('0x35')){if(_0x517e32[_0xab5c('0x36')]){_0xdc299b[_0xab5c('0x14')]({'type':_0x517e32[_0xab5c('0x15')],'app':_0xab5c('0x1e'),'appdata':_0xab5c('0x37'),'context':_0x517e32[_0xab5c('0x18')],'exten':_0x517e32[_0xab5c('0x9')],'priority':_0x5709d7[_0xab5c('0x2a')]+_0x3d1482[_0xab5c('0x10')]+_0xb6b68f++,'VoiceExtensionId':_0x517e32[_0xab5c('0x19')]});_0xdc299b[_0xab5c('0x14')]({'type':_0x517e32[_0xab5c('0x15')],'app':'Set','appdata':_0xab5c('0x38'),'context':_0x517e32[_0xab5c('0x18')],'exten':_0x517e32[_0xab5c('0x9')],'priority':_0x5709d7[_0xab5c('0x2a')]+_0x3d1482['priority']+_0xb6b68f++,'VoiceExtensionId':_0x517e32[_0xab5c('0x19')]});}else{_0xdc299b[_0xab5c('0x14')]({'type':_0x517e32['type'],'app':_0xab5c('0x1e'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x517e32[_0xab5c('0x18')],'exten':_0x517e32[_0xab5c('0x9')],'priority':_0x5709d7['length']+_0x3d1482['priority']+_0xb6b68f++,'VoiceExtensionId':_0x517e32[_0xab5c('0x19')]});_0xdc299b[_0xab5c('0x14')]({'type':_0x517e32[_0xab5c('0x15')],'app':_0xab5c('0x16'),'appdata':_0xab5c('0x39'),'context':_0x517e32[_0xab5c('0x18')],'exten':_0x517e32['exten'],'priority':_0x5709d7[_0xab5c('0x2a')]+_0x3d1482[_0xab5c('0x10')]+_0xb6b68f++,'VoiceExtensionId':_0x517e32['VoiceExtensionId']});}}}for(var _0x2732ef=0x0;_0x2732ef<_0x5709d7[_0xab5c('0x2a')];_0x2732ef+=0x1){var _0x515e0d=_0x3d1482[_0xab5c('0x10')]+_0x5709d7[_0xab5c('0x2a')];var _0x3770ff=_0x2732ef===_0x5709d7[_0xab5c('0x2a')]-0x1?_0x3d1482[_0xab5c('0x10')]+_0xdc299b[_0xab5c('0x2a')]+_0x4b70ea[_0xab5c('0x2a')]+0x2:_0x3d1482[_0xab5c('0x10')]+_0x2732ef+0x1;_0xdc299b[_0xab5c('0x3a')](_0x2732ef,0x0,{'type':_0x517e32[_0xab5c('0x15')],'app':_0xab5c('0x3b'),'appdata':_0x5709d7[_0x2732ef]+'?'+_0x517e32[_0xab5c('0x18')]+_0xab5c('0x3c')+_0x515e0d+':'+_0x517e32['context']+_0xab5c('0x3c')+_0x3770ff,'exten':_0x517e32[_0xab5c('0x9')],'context':_0x517e32[_0xab5c('0x18')],'priority':_0x3d1482[_0xab5c('0x10')]+_0x2732ef,'VoiceExtensionId':_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')]});}_0x517e32[_0xab5c('0x10')]=_0xdc299b[_0xab5c('0x2a')]?_[_0xab5c('0x3d')](_0xdc299b)[_0xab5c('0x10')]+0x1:_0x3d1482[_0xab5c('0x10')];_0x3d1482[_0xab5c('0x10')]=(_0x4b70ea['length']?_[_0xab5c('0x3d')](_0x4b70ea)['priority']:_0x517e32['priority'])+0x1;_0x3d1482['extensions']=_[_0xab5c('0x3e')](_0x3d1482[_0xab5c('0x11')],_0xdc299b,[_0x517e32],_0x4b70ea);}_0x3d1482[_0xab5c('0x11')][_0xab5c('0x14')]({'type':_0x4bfb64[_0x556151][0x0][_0xab5c('0x15')],'app':_0xab5c('0x3f'),'exten':_0x4bfb64[_0x556151][0x0][_0xab5c('0x9')],'context':_0x4bfb64[_0x556151][0x0][_0xab5c('0x18')],'priority':_0x3d1482[_0xab5c('0x10')],'VoiceExtensionId':_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')]});_0x38fd29[_0xab5c('0x14')](_0x4bfb64[_0x556151][0x0][_0xab5c('0x19')]);_0x1e16af=_[_0xab5c('0x3e')](_0x1e16af,_0x3d1482[_0xab5c('0x11')]);}}return _0x2c97d8[_0xab5c('0x40')](function(_0x258d4c){return _0x2c97d8['models'][_0xab5c('0x6')][_0xab5c('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x38fd29}},'transaction':_0x258d4c})['then'](function(_0x2be613){return _0x2c97d8[_0xab5c('0x1')][_0xab5c('0x6')][_0xab5c('0x42')](_[_0xab5c('0x43')](_0x1e16af,_0xab5c('0x10')),{'transaction':_0x258d4c});});});})[_0xab5c('0x44')](function(_0x2515d3){console[_0xab5c('0x45')](_0x2515d3);});}exports[_0xab5c('0x46')]=rewrite; \ No newline at end of file +var _0x7e83=['$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','map','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','VoiceExtension','destroy','catch','rewrite','lodash','util','models','Interval','findAll','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','then','filter','groupBy','queue','hasOwnProperty','extension','push','type','format','context','priority','VoiceExtensionId','inbound','extensions','Set','CDR(routeid)=','outbound','cutdigits','${EXTEN}','ExecIf'];(function(_0x141749,_0x477b04){var _0x3e6932=function(_0x47b3f2){while(--_0x47b3f2){_0x141749['push'](_0x141749['shift']());}};_0x3e6932(++_0x477b04);}(_0x7e83,0xa9));var _0x37e8=function(_0x483d2a,_0x4bffba){_0x483d2a=_0x483d2a-0x0;var _0x5ba5d5=_0x7e83[_0x483d2a];return _0x5ba5d5;};'use strict';var _=require(_0x37e8('0x0'));var util=require(_0x37e8('0x1'));function rewrite(_0x2173e0,_0x1cecb3){var _0x2ad105=this;return _0x2173e0[_0x37e8('0x2')][_0x37e8('0x3')][_0x37e8('0x4')]({'raw':!![]})['then'](function(_0x270bb5){_0x2ad105['intervals']=_0x270bb5;return _0x2173e0['models']['VoiceExtension'][_0x37e8('0x4')]({'where':{'IntervalId':_0x1cecb3[_0x37e8('0x5')]},'raw':!![]});})['then'](function(_0x3fea53){return _0x2173e0['models']['VoiceExtension'][_0x37e8('0x4')]({'where':{'exten':{'$in':_[_0x37e8('0x6')](_['map'](_0x3fea53,_0x37e8('0x7')))}},'order':[{'raw':_0x37e8('0x8')}],'raw':!![]});})[_0x37e8('0x9')](function(_0x3567d4){var _0x38846e=_[_0x37e8('0xa')](_0x3567d4,{'priority':'1'});var _0x2d5a99=_[_0x37e8('0xa')](_0x3567d4,{'isApp':0x1});var _0x3da2fc=_[_0x37e8('0xb')](_0x2d5a99,_0x37e8('0x7'));var _0x28cc6c=[_0x37e8('0xc'),'playback'];var _0x2ee002=[];var _0x1691f6=[];for(var _0x246554 in _0x3da2fc){if(_0x3da2fc[_0x37e8('0xd')](_0x246554)){_0x2ad105['priority']=0x2;_0x2ad105['extensions']=[];_0x2ad105[_0x37e8('0xe')]=_['find'](_0x38846e,{'exten':_0x3da2fc[_0x246554][0x0]['exten']});_0x2ad105['extensions'][_0x37e8('0xf')]({'type':_0x3da2fc[_0x246554][0x0][_0x37e8('0x10')],'app':'Set','appdata':util[_0x37e8('0x11')]('CDR(type)=%s',_0x3da2fc[_0x246554][0x0][_0x37e8('0x10')]),'context':_0x3da2fc[_0x246554][0x0][_0x37e8('0x12')],'exten':_0x3da2fc[_0x246554][0x0]['exten'],'priority':_0x2ad105[_0x37e8('0x13')]++,'VoiceExtensionId':_0x3da2fc[_0x246554][0x0][_0x37e8('0x14')]});if(_0x3da2fc[_0x246554][0x0]['type']===_0x37e8('0x15')){_0x2ad105[_0x37e8('0x16')][_0x37e8('0xf')]({'type':_0x3da2fc[_0x246554][0x0][_0x37e8('0x10')],'app':_0x37e8('0x17'),'appdata':_0x37e8('0x18')+_0x3da2fc[_0x246554][0x0][_0x37e8('0x14')],'context':_0x3da2fc[_0x246554][0x0][_0x37e8('0x12')],'exten':_0x3da2fc[_0x246554][0x0]['exten'],'priority':_0x2ad105[_0x37e8('0x13')]++,'VoiceExtensionId':_0x3da2fc[_0x246554][0x0][_0x37e8('0x14')]});}else if(_0x3da2fc[_0x246554][0x0][_0x37e8('0x10')]===_0x37e8('0x19')){if(_0x2ad105['extension']){_0x2ad105[_0x37e8('0x16')][_0x37e8('0xf')]({'type':_0x3da2fc[_0x246554][0x0][_0x37e8('0x10')],'app':_0x37e8('0x17'),'appdata':'CDR(destination)='+(_0x2ad105['extension'][_0x37e8('0x1a')]?'${EXTEN:'+_0x2ad105[_0x37e8('0xe')][_0x37e8('0x1a')]+'}':_0x37e8('0x1b')),'context':_0x3da2fc[_0x246554][0x0][_0x37e8('0x12')],'exten':_0x3da2fc[_0x246554][0x0][_0x37e8('0x7')],'priority':_0x2ad105['priority']++,'VoiceExtensionId':_0x3da2fc[_0x246554][0x0]['VoiceExtensionId']});}_0x2ad105[_0x37e8('0x16')][_0x37e8('0xf')]({'type':_0x3da2fc[_0x246554][0x0][_0x37e8('0x10')],'app':_0x37e8('0x17'),'appdata':_0x37e8('0x18')+_0x3da2fc[_0x246554][0x0]['VoiceExtensionId'],'context':_0x3da2fc[_0x246554][0x0][_0x37e8('0x12')],'exten':_0x3da2fc[_0x246554][0x0][_0x37e8('0x7')],'priority':_0x2ad105['priority']++,'VoiceExtensionId':_0x3da2fc[_0x246554][0x0][_0x37e8('0x14')]});var _0x418432=_0x2ad105['priority']++;_0x2ad105[_0x37e8('0x16')][_0x37e8('0xf')]({'type':_0x3da2fc[_0x246554][0x0][_0x37e8('0x10')],'app':_0x37e8('0x1c'),'appdata':_0x37e8('0x1d')+(_0x418432+0x2)+'):Goto('+(_0x418432+0x1)+')','context':_0x3da2fc[_0x246554][0x0][_0x37e8('0x12')],'exten':_0x3da2fc[_0x246554][0x0][_0x37e8('0x7')],'priority':_0x418432,'VoiceExtensionId':_0x3da2fc[_0x246554][0x0][_0x37e8('0x14')]});if(_0x2ad105[_0x37e8('0xe')]){_0x2ad105[_0x37e8('0x16')][_0x37e8('0xf')]({'type':_0x3da2fc[_0x246554][0x0][_0x37e8('0x10')],'app':_0x37e8('0x17'),'appdata':_0x2ad105['extension'][_0x37e8('0x1a')]?'CDR(prefix)=${EXTEN:0:'+_0x2ad105[_0x37e8('0xe')][_0x37e8('0x1a')]+'}':_0x37e8('0x1e'),'context':_0x3da2fc[_0x246554][0x0][_0x37e8('0x12')],'exten':_0x3da2fc[_0x246554][0x0][_0x37e8('0x7')],'priority':_0x2ad105['priority']++,'VoiceExtensionId':_0x3da2fc[_0x246554][0x0][_0x37e8('0x14')]});}_0x2ad105['extensions'][_0x37e8('0xf')]({'type':_0x3da2fc[_0x246554][0x0][_0x37e8('0x10')],'app':_0x37e8('0x17'),'appdata':_0x37e8('0x1f')+_0x3da2fc[_0x246554][0x0]['VoiceExtensionId'],'context':_0x3da2fc[_0x246554][0x0][_0x37e8('0x12')],'exten':_0x3da2fc[_0x246554][0x0]['exten'],'priority':_0x2ad105[_0x37e8('0x13')]++,'VoiceExtensionId':_0x3da2fc[_0x246554][0x0]['VoiceExtensionId']});if(_0x2ad105[_0x37e8('0xe')]&&_0x2ad105['extension'][_0x37e8('0xd')](_0x37e8('0x20'))&&_0x2ad105[_0x37e8('0xe')][_0x37e8('0x20')]!==_0x37e8('0x21')){_0x2ad105[_0x37e8('0x16')][_0x37e8('0xf')]({'type':_0x3da2fc[_0x246554][0x0]['type'],'app':_0x37e8('0x17'),'appdata':_0x37e8('0x22'),'context':_0x3da2fc[_0x246554][0x0][_0x37e8('0x12')],'exten':_0x3da2fc[_0x246554][0x0][_0x37e8('0x7')],'priority':_0x2ad105[_0x37e8('0x13')]++,'VoiceExtensionId':_0x3da2fc[_0x246554][0x0]['VoiceExtensionId']});_0x2ad105['extensions'][_0x37e8('0xf')]({'type':_0x3da2fc[_0x246554][0x0]['type'],'app':_0x37e8('0x17'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x2ad105[_0x37e8('0xe')]['recordingFormat']||_0x37e8('0x23'),'context':_0x3da2fc[_0x246554][0x0][_0x37e8('0x12')],'exten':_0x3da2fc[_0x246554][0x0][_0x37e8('0x7')],'priority':_0x2ad105[_0x37e8('0x13')]++,'VoiceExtensionId':_0x3da2fc[_0x246554][0x0]['VoiceExtensionId']});}}_0x2ad105[_0x37e8('0x16')][_0x37e8('0xf')]({'type':_0x3da2fc[_0x246554][0x0][_0x37e8('0x10')],'app':'Set','appdata':_0x37e8('0x24'),'context':_0x3da2fc[_0x246554][0x0][_0x37e8('0x12')],'exten':_0x3da2fc[_0x246554][0x0][_0x37e8('0x7')],'priority':_0x2ad105[_0x37e8('0x13')]++,'VoiceExtensionId':_0x3da2fc[_0x246554][0x0][_0x37e8('0x14')]});_0x2ad105['extensions'][_0x37e8('0xf')]({'type':_0x3da2fc[_0x246554][0x0][_0x37e8('0x10')],'app':_0x37e8('0x17'),'appdata':_0x37e8('0x25'),'context':_0x3da2fc[_0x246554][0x0][_0x37e8('0x12')],'exten':_0x3da2fc[_0x246554][0x0][_0x37e8('0x7')],'priority':_0x2ad105['priority']++,'VoiceExtensionId':_0x3da2fc[_0x246554][0x0]['VoiceExtensionId']});_0x2ad105[_0x37e8('0x16')][_0x37e8('0xf')]({'type':_0x3da2fc[_0x246554][0x0][_0x37e8('0x10')],'app':_0x37e8('0x17'),'appdata':_0x37e8('0x26'),'context':_0x3da2fc[_0x246554][0x0]['context'],'exten':_0x3da2fc[_0x246554][0x0][_0x37e8('0x7')],'priority':_0x2ad105['priority']++,'VoiceExtensionId':_0x3da2fc[_0x246554][0x0][_0x37e8('0x14')]});for(var _0x122156=0x0,_0x51a520=0x0;_0x122156<_0x3da2fc[_0x246554][_0x37e8('0x27')];_0x122156+=0x1,_0x51a520=0x0){var _0x452f4c=_0x3da2fc[_0x246554][_0x122156];if(_0x452f4c['type']){_0x452f4c['type']=_0x452f4c[_0x37e8('0x10')][_0x37e8('0x28')]();}var _0x38cd41=[];var _0x2c244c=[];delete _0x452f4c['id'];delete _0x452f4c[_0x37e8('0x29')];delete _0x452f4c['updatedAt'];var _0x4af0f5=_0x452f4c[_0x37e8('0x2a')]!==_0x37e8('0x2b')?[_0x452f4c[_0x37e8('0x2a')]]:_0x452f4c[_0x37e8('0x5')]?_[_0x37e8('0x2c')](_[_0x37e8('0xa')](_0x2ad105[_0x37e8('0x2d')],{'IntervalId':_0x452f4c[_0x37e8('0x5')]}),'interval'):[];if(_0x452f4c[_0x37e8('0xd')]('tag')){if(_0x452f4c[_0x37e8('0x2e')]&&_0x452f4c[_0x37e8('0x2e')]!=='--'){_0x38cd41[_0x37e8('0xf')]({'type':_0x452f4c[_0x37e8('0x10')],'app':'Set','appdata':_0x37e8('0x2f')+_0x452f4c[_0x37e8('0x2e')],'context':_0x452f4c[_0x37e8('0x12')],'exten':_0x452f4c[_0x37e8('0x7')],'priority':_0x4af0f5[_0x37e8('0x27')]+_0x2ad105[_0x37e8('0x13')]+_0x51a520++,'VoiceExtensionId':_0x452f4c['VoiceExtensionId']});}}if(_0x452f4c[_0x37e8('0x10')]==='outbound'&&_0x452f4c['hasOwnProperty']('callerID')){if(_0x452f4c[_0x37e8('0x30')]){_0x38cd41[_0x37e8('0xf')]({'type':_0x452f4c['type'],'app':_0x37e8('0x1c'),'appdata':_0x37e8('0x31')+_0x452f4c[_0x37e8('0x30')]+')','context':_0x452f4c[_0x37e8('0x12')],'exten':_0x452f4c['exten'],'priority':_0x4af0f5[_0x37e8('0x27')]+_0x2ad105[_0x37e8('0x13')]+_0x51a520++,'VoiceExtensionId':_0x452f4c[_0x37e8('0x14')]});}else{_0x38cd41[_0x37e8('0xf')]({'type':_0x452f4c[_0x37e8('0x10')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x452f4c[_0x37e8('0x12')],'exten':_0x452f4c[_0x37e8('0x7')],'priority':_0x4af0f5[_0x37e8('0x27')]+_0x2ad105[_0x37e8('0x13')]+_0x51a520++,'VoiceExtensionId':_0x452f4c[_0x37e8('0x14')]});}}if(_0x452f4c[_0x37e8('0xd')](_0x37e8('0x32'))){if(_0x28cc6c[_0x37e8('0x33')](_0x452f4c['app'][_0x37e8('0x28')]())>=0x0&&_0x452f4c['appType']!==_0x37e8('0x34')){if(_0x452f4c[_0x37e8('0x32')]){_0x38cd41['push']({'type':_0x452f4c[_0x37e8('0x10')],'app':_0x37e8('0x1c'),'appdata':_0x37e8('0x35'),'context':_0x452f4c[_0x37e8('0x12')],'exten':_0x452f4c[_0x37e8('0x7')],'priority':_0x4af0f5[_0x37e8('0x27')]+_0x2ad105[_0x37e8('0x13')]+_0x51a520++,'VoiceExtensionId':_0x452f4c[_0x37e8('0x14')]});_0x38cd41[_0x37e8('0xf')]({'type':_0x452f4c[_0x37e8('0x10')],'app':_0x37e8('0x17'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x452f4c[_0x37e8('0x12')],'exten':_0x452f4c['exten'],'priority':_0x4af0f5[_0x37e8('0x27')]+_0x2ad105[_0x37e8('0x13')]+_0x51a520++,'VoiceExtensionId':_0x452f4c[_0x37e8('0x14')]});}else{_0x38cd41['push']({'type':_0x452f4c[_0x37e8('0x10')],'app':_0x37e8('0x1c'),'appdata':_0x37e8('0x36'),'context':_0x452f4c[_0x37e8('0x12')],'exten':_0x452f4c[_0x37e8('0x7')],'priority':_0x4af0f5[_0x37e8('0x27')]+_0x2ad105[_0x37e8('0x13')]+_0x51a520++,'VoiceExtensionId':_0x452f4c[_0x37e8('0x14')]});_0x38cd41['push']({'type':_0x452f4c[_0x37e8('0x10')],'app':_0x37e8('0x17'),'appdata':_0x37e8('0x37'),'context':_0x452f4c[_0x37e8('0x12')],'exten':_0x452f4c[_0x37e8('0x7')],'priority':_0x4af0f5['length']+_0x2ad105['priority']+_0x51a520++,'VoiceExtensionId':_0x452f4c[_0x37e8('0x14')]});}}}for(var _0x1a6d74=0x0;_0x1a6d74<_0x4af0f5[_0x37e8('0x27')];_0x1a6d74+=0x1){var _0x10017d=_0x2ad105[_0x37e8('0x13')]+_0x4af0f5['length'];var _0x27b50b=_0x1a6d74===_0x4af0f5['length']-0x1?_0x2ad105[_0x37e8('0x13')]+_0x38cd41[_0x37e8('0x27')]+_0x2c244c[_0x37e8('0x27')]+0x2:_0x2ad105[_0x37e8('0x13')]+_0x1a6d74+0x1;_0x38cd41[_0x37e8('0x38')](_0x1a6d74,0x0,{'type':_0x452f4c[_0x37e8('0x10')],'app':_0x37e8('0x39'),'appdata':_0x4af0f5[_0x1a6d74]+'?'+_0x452f4c[_0x37e8('0x12')]+_0x37e8('0x3a')+_0x10017d+':'+_0x452f4c[_0x37e8('0x12')]+_0x37e8('0x3a')+_0x27b50b,'exten':_0x452f4c[_0x37e8('0x7')],'context':_0x452f4c[_0x37e8('0x12')],'priority':_0x2ad105['priority']+_0x1a6d74,'VoiceExtensionId':_0x3da2fc[_0x246554][0x0][_0x37e8('0x14')]});}_0x452f4c[_0x37e8('0x13')]=_0x38cd41['length']?_[_0x37e8('0x3b')](_0x38cd41)['priority']+0x1:_0x2ad105[_0x37e8('0x13')];_0x2ad105[_0x37e8('0x13')]=(_0x2c244c[_0x37e8('0x27')]?_[_0x37e8('0x3b')](_0x2c244c)[_0x37e8('0x13')]:_0x452f4c[_0x37e8('0x13')])+0x1;_0x2ad105[_0x37e8('0x16')]=_['concat'](_0x2ad105['extensions'],_0x38cd41,[_0x452f4c],_0x2c244c);}_0x2ad105[_0x37e8('0x16')][_0x37e8('0xf')]({'type':_0x3da2fc[_0x246554][0x0][_0x37e8('0x10')],'app':_0x37e8('0x3c'),'exten':_0x3da2fc[_0x246554][0x0]['exten'],'context':_0x3da2fc[_0x246554][0x0][_0x37e8('0x12')],'priority':_0x2ad105[_0x37e8('0x13')],'VoiceExtensionId':_0x3da2fc[_0x246554][0x0][_0x37e8('0x14')]});_0x2ee002[_0x37e8('0xf')](_0x3da2fc[_0x246554][0x0][_0x37e8('0x14')]);_0x1691f6=_[_0x37e8('0x3d')](_0x1691f6,_0x2ad105[_0x37e8('0x16')]);}}return _0x2173e0['transaction'](function(_0x149a9a){return _0x2173e0['models'][_0x37e8('0x3e')][_0x37e8('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x2ee002}},'transaction':_0x149a9a})[_0x37e8('0x9')](function(_0x12de54){return _0x2173e0['models'][_0x37e8('0x3e')]['bulkCreate'](_['sortBy'](_0x1691f6,_0x37e8('0x13')),{'transaction':_0x149a9a});});});})[_0x37e8('0x40')](function(_0x113f2c){console['error'](_0x113f2c);});}exports[_0x37e8('0x41')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 2351289..7f1be00 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 _0x0537=['field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','id\x20IN\x20?','str','cm_hopper_final','\x20=\x20?','VoiceQueue','findAll','outbound','Lists','get','dialCheckDuplicateType','always','query','onlyIfOpen','sequelize','VoiceQueueId','all','CmList','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resume','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','localhost','register','argv','undefined','null','Missing\x20binding\x20parameters!','split','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','errors','length','message','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','CompanyId','duplicate','Duplicate\x20Contact','CmContact','then','push','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select'];(function(_0x4a20cd,_0x5de998){var _0x2a218=function(_0x1abb74){while(--_0x1abb74){_0x4a20cd['push'](_0x4a20cd['shift']());}};_0x2a218(++_0x5de998);}(_0x0537,0x93));var _0x7053=function(_0x5d76ad,_0x26158d){_0x5d76ad=_0x5d76ad-0x0;var _0x4f7937=_0x0537[_0x5d76ad];return _0x4f7937;};'use strict';var BPromise=require(_0x7053('0x0'));var util=require(_0x7053('0x1'));var _=require(_0x7053('0x2'));var fs=require('fs');var squel=require(_0x7053('0x3'));var Papa=require(_0x7053('0x4'));var Redis=require(_0x7053('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x7053('0x6'));var logger=require(_0x7053('0x7'))(_0x7053('0x8'));config['redis']=_['defaults'](config[_0x7053('0x9')],{'host':_0x7053('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7053('0x9')]));require('../../../api/cmContact/cmContact.socket')[_0x7053('0xb')](socket);try{if(!process[_0x7053('0xc')][0x2]||process['argv'][0x2]===_0x7053('0xd')||process[_0x7053('0xc')][0x2]===_0x7053('0xe')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x7053('0xc')][0x2];if(!process[_0x7053('0xc')][0x3]||process[_0x7053('0xc')][0x3]===_0x7053('0xd')||process['argv'][0x3]==='null'||!process[_0x7053('0xc')][0x4]||process[_0x7053('0xc')][0x4]===_0x7053('0xd')||process[_0x7053('0xc')][0x4]==='null'){throw new Error(_0x7053('0xf'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0x7053('0x10')](','),process[_0x7053('0xc')][0x4][_0x7053('0x10')](','));if(!process[_0x7053('0xc')][0x5]||process[_0x7053('0xc')][0x5]==='undefined'||process['argv'][0x5]===_0x7053('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x7053('0xc')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x7053('0xc')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x7053('0xe')?process[_0x7053('0xc')][0x6]:null;var DUPLICATES=process[_0x7053('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x7053('0xc')][0x7]!=='null'?process['argv'][0x7]:null;if(!process[_0x7053('0xc')][0x8]||process[_0x7053('0xc')][0x8]===_0x7053('0xd')||process['argv'][0x8]===_0x7053('0xe')){throw new Error(_0x7053('0x11'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x4e11d9){logger[_0x7053('0x12')](_0x4e11d9);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(_0x48ff24,_0xc4ece5,_0x162107,_0x1604b7){var _0x52bcd2={'message':_0xc4ece5};_0x52bcd2[_0x48ff24]=!![];if(_0x162107){_0x52bcd2[_0x7053('0x13')]=_0x162107;}if(_0x1604b7){_0x52bcd2['index']=_0x1604b7;}return _0x52bcd2;}function isEmail(_0x1822a7){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))*$/[_0x7053('0x14')](_0x1822a7);}function checkRow(_0x542729,_0x1f1172,_0x389d12){return new BPromise(function(_0x3e8851,_0x1bb439){if(_[_0x7053('0x15')](_0x542729)){return _0x1bb439(handleCheckRowError(_0x7053('0x12'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x389d12));}if(_0x542729[_0x7053('0x16')]&&_0x542729['errors'][_0x7053('0x17')]){var _0x1745d6=_['map'](_0x542729[_0x7053('0x16')],_0x7053('0x18'))['join'](';');return _0x1bb439(handleCheckRowError(_0x7053('0x12'),_0x1745d6,null,_0x389d12));}var _0x1aa7f1={};for(var _0x406d79 in FIELDS){if(FIELDS[_0x7053('0x19')](_0x406d79)&&FIELDS[_0x406d79]){_0x1aa7f1[_0x406d79]=_0x542729[_0x7053('0x1a')][0x0][FIELDS[_0x406d79]]||_0x542729[_0x7053('0x1a')][0x0]['\ufeff'+FIELDS[_0x406d79]];}}if(!_0x1aa7f1[_0x7053('0x1b')]){return _0x1bb439(handleCheckRowError(_0x7053('0x12'),'firstName\x20not\x20specified!',null,_0x389d12));}if(!_0x1aa7f1[_0x7053('0x1c')]){return _0x1bb439(handleCheckRowError(_0x7053('0x12'),_0x7053('0x1d'),null,_0x389d12));}if(_0x1aa7f1[_0x7053('0x1e')]){var _0x775696=moment(_0x1aa7f1[_0x7053('0x1e')],'YYYY-MM-DD');if(!_0x775696[_0x7053('0x1f')]()){return _0x1bb439(handleCheckRowError(_0x7053('0x12'),_0x7053('0x20'),null,_0x389d12));}}if(_0x1aa7f1['email']){if(!isEmail(_0x1aa7f1['email'])){return _0x1bb439(handleCheckRowError('error',_0x7053('0x21'),null,_0x389d12));}}_0x1aa7f1['ListId']=LISTID;_0x1aa7f1[_0x7053('0x22')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x7053('0x17')]&&_0x1f1172){var _0x59fb8f={};for(var _0x1611df=0x0,_0x305a85=DUPLICATES['length'];_0x1611df<_0x305a85;_0x1611df+=0x1){_0x59fb8f[DUPLICATES[_0x1611df]]=_0x1aa7f1[DUPLICATES[_0x1611df]];}var _0x2a3997=_['find'](_0x1f1172,_0x59fb8f);if(_0x2a3997){return _0x1bb439(handleCheckRowError(_0x7053('0x23'),_0x7053('0x24'),_0x2a3997,_0x389d12));}}return db[_0x7053('0x25')]['create'](_0x1aa7f1,{'raw':!![],'hooks':![],'fields':_['keys'](_0x1aa7f1)})[_0x7053('0x26')](function(_0x1d152c){if(DUPLICATES&&DUPLICATES[_0x7053('0x17')]&&_0x1f1172){_0x1f1172[_0x7053('0x27')](_['pick'](_0x1aa7f1,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1d152c['id'];return _0x3e8851();})[_0x7053('0x28')](function(_0x534f1c){return _0x1bb439(handleCheckRowError(_0x7053('0x12'),_0x7053('0x29')+(_0x534f1c[_0x7053('0x18')]||JSON['stringify'](_0x534f1c)),null,_0x389d12));});});}function checkHopper(){function _0x49af1f(){return function(_0xcc93b4){logger['error'](_0x7053('0x2a'),_0x7053('0x2b'),util[_0x7053('0x2c')](_0xcc93b4,{'showHidden':![],'depth':null}));};}var _0x54e5d0=function(_0x525d5b,_0xf76063){var _0x386c24=squel[_0x7053('0x2d')]()[_0x7053('0x2e')](_0x7053('0x2f'))[_0x7053('0x30')]([_0x7053('0x1c'),_0x7053('0x31'),_0x7053('0x32'),_0x7053('0x33'),_0xf76063,_0x7053('0x34'),_0x7053('0x35')],squel[_0x7053('0x36')]()[_0x7053('0x37')](_0x7053('0x1c'),_0x7053('0x1c'))[_0x7053('0x37')](_0x7053('0x38'),_0x7053('0x31'))[_0x7053('0x37')]('id','ContactId')[_0x7053('0x37')](LISTID[_0x7053('0x39')](),_0x7053('0x33'))[_0x7053('0x37')](_0x525d5b['id'][_0x7053('0x39')](),_0xf76063)[_0x7053('0x37')](_0x7053('0x38'),_0x7053('0x34'))['field'](_0x7053('0x38'),_0x7053('0x35'))['from'](_0x7053('0x3a'))[_0x7053('0x3b')](_0x7053('0x3c'))[_0x7053('0x3b')](_0x7053('0x3d'),LISTID['toString']())[_0x7053('0x3b')](_0x7053('0x3e'))[_0x7053('0x3b')](_0x7053('0x3f'),squel[_0x7053('0x36')]()['field'](_0x7053('0x1c'))[_0x7053('0x40')](_0x7053('0x2f'))[_0x7053('0x3b')](_0xf76063+'\x20=\x20?',_0x525d5b['id'][_0x7053('0x39')]())))['toString']();return _0x386c24;};var _0x157325=function(_0x20fc42,_0x5d19f7){var _0x3e8dce=squel[_0x7053('0x2d')]()['into'](_0x7053('0x2f'))['fromQuery']([_0x7053('0x1c'),_0x7053('0x31'),_0x7053('0x32'),'ListId',_0x5d19f7,_0x7053('0x34'),_0x7053('0x35')],squel[_0x7053('0x36')]()[_0x7053('0x37')](_0x7053('0x1c'),_0x7053('0x1c'))['field'](_0x7053('0x38'),_0x7053('0x31'))[_0x7053('0x37')]('id',_0x7053('0x32'))[_0x7053('0x37')](LISTID[_0x7053('0x39')](),_0x7053('0x33'))[_0x7053('0x37')](_0x20fc42['id']['toString'](),_0x5d19f7)[_0x7053('0x37')](_0x7053('0x38'),'createdAt')[_0x7053('0x37')](_0x7053('0x38'),_0x7053('0x35'))[_0x7053('0x40')](_0x7053('0x3a'))[_0x7053('0x3b')]('deletedAt\x20IS\x20NULL')[_0x7053('0x3b')](_0x7053('0x3d'),LISTID[_0x7053('0x39')]())[_0x7053('0x3b')](_0x7053('0x41'),squel[_0x7053('0x42')](hopperContacts))['where'](_0x7053('0x3e'))[_0x7053('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7053('0x36')]()['field']('calleridnum')['from'](_0x7053('0x43'))['where'](_0x5d19f7+'\x20=\x20?',_0x20fc42['id'][_0x7053('0x39')]()))[_0x7053('0x3b')](_0x7053('0x3f'),squel['select']()[_0x7053('0x37')](_0x7053('0x1c'))[_0x7053('0x40')]('cm_hopper')[_0x7053('0x3b')](_0x5d19f7+_0x7053('0x44'),_0x20fc42['id'][_0x7053('0x39')]())))[_0x7053('0x39')]();return _0x3e8dce;};function _0x43f177(_0x495afb,_0x32990a){var _0x12dd58=squel[_0x7053('0x2d')]()[_0x7053('0x2e')](_0x7053('0x2f'))['fromQuery']([_0x7053('0x1c'),_0x7053('0x31'),_0x7053('0x32'),'ListId',_0x32990a,_0x7053('0x34'),'updatedAt'],squel[_0x7053('0x36')]()[_0x7053('0x37')](_0x7053('0x1c'),_0x7053('0x1c'))[_0x7053('0x37')]('NOW()','scheduledAt')['field']('id',_0x7053('0x32'))[_0x7053('0x37')](LISTID[_0x7053('0x39')](),_0x7053('0x33'))['field'](_0x495afb['id']['toString'](),_0x32990a)[_0x7053('0x37')](_0x7053('0x38'),'createdAt')[_0x7053('0x37')](_0x7053('0x38'),'updatedAt')[_0x7053('0x40')](_0x7053('0x3a'))[_0x7053('0x3b')]('deletedAt\x20IS\x20NULL')[_0x7053('0x3b')](_0x7053('0x3d'),LISTID[_0x7053('0x39')]())['where']('id\x20IN\x20?',squel[_0x7053('0x42')](hopperContacts))[_0x7053('0x3b')](_0x7053('0x3e')))['toString']();return _0x12dd58;}function _0x4214d1(_0x5b928a,_0x256c82){var _0x16826c=squel[_0x7053('0x2d')]()[_0x7053('0x2e')]('cm_hopper_black')[_0x7053('0x30')]([_0x7053('0x1c'),_0x7053('0x32'),_0x7053('0x33'),_0x256c82,'createdAt',_0x7053('0x35')],squel['select']()[_0x7053('0x37')](_0x7053('0x1c'),_0x7053('0x1c'))['field']('id',_0x7053('0x32'))[_0x7053('0x37')](LISTID[_0x7053('0x39')](),_0x7053('0x33'))[_0x7053('0x37')](_0x5b928a['id'][_0x7053('0x39')](),_0x256c82)[_0x7053('0x37')]('NOW()',_0x7053('0x34'))[_0x7053('0x37')](_0x7053('0x38'),'updatedAt')[_0x7053('0x40')](_0x7053('0x3a'))[_0x7053('0x3b')](_0x7053('0x3c'))[_0x7053('0x3b')](_0x7053('0x3d'),LISTID[_0x7053('0x39')]())[_0x7053('0x3b')](_0x7053('0x41'),squel[_0x7053('0x42')](hopperContacts))[_0x7053('0x3b')](_0x7053('0x3e')))[_0x7053('0x39')]();return _0x16826c;}return db[_0x7053('0x45')][_0x7053('0x46')]({'where':{'type':_0x7053('0x47')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x7053('0x48'),'where':{'id':LISTID}}]})['then'](function(_0x125022){var _0x40a8ba=[];if(_0x125022){var _0x351157;for(var _0x29fb7a=0x0,_0x47eacd;_0x29fb7a<_0x125022['length'];_0x29fb7a+=0x1){_0x47eacd=_0x125022[_0x29fb7a][_0x7053('0x49')]({'plain':!![]});switch(_0x47eacd[_0x7053('0x4a')]){case _0x7053('0x4b'):_0x40a8ba[_0x7053('0x27')](db['sequelize'][_0x7053('0x4c')](_0x157325(_0x47eacd,'VoiceQueueId'))[_0x7053('0x26')](function(){})[_0x7053('0x28')](_0x49af1f()));break;case _0x7053('0x4d'):_0x40a8ba['push'](db[_0x7053('0x4e')][_0x7053('0x4c')](_0x54e5d0(_0x47eacd,_0x7053('0x4f')))[_0x7053('0x26')](function(){})[_0x7053('0x28')](_0x49af1f()));break;default:_0x40a8ba[_0x7053('0x27')](db[_0x7053('0x4e')]['query'](_0x43f177(_0x47eacd,_0x7053('0x4f')))['then'](function(){})['catch'](_0x49af1f()));}}}return _0x40a8ba;})[_0x7053('0x50')]()[_0x7053('0x26')](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0x7053('0x47')},'attributes':['id'],'include':[{'model':db[_0x7053('0x51')],'as':_0x7053('0x52'),'where':{'id':LISTID}}]})['then'](function(_0x5a569b){var _0x1875b0=[];if(_0x5a569b){var _0x4fe6c2;for(var _0x37affc=0x0,_0xbc94f6;_0x37affc<_0x5a569b['length'];_0x37affc+=0x1){_0xbc94f6=_0x5a569b[_0x37affc][_0x7053('0x49')]({'plain':!![]});_0x1875b0[_0x7053('0x27')](db[_0x7053('0x4e')][_0x7053('0x4c')](_0x4214d1(_0xbc94f6,_0x7053('0x4f')))[_0x7053('0x26')](function(){})[_0x7053('0x28')](_0x49af1f()));}}return _0x1875b0;})[_0x7053('0x50')]();})[_0x7053('0x26')](function(){return db[_0x7053('0x53')][_0x7053('0x46')]({'attributes':['id',_0x7053('0x4a')],'include':[{'model':db[_0x7053('0x51')],'as':_0x7053('0x48'),'where':{'id':LISTID}}]})['then'](function(_0x4bf007){var _0x15f0d2=[];if(_0x4bf007){for(var _0x10926b=0x0,_0x2de4e7;_0x10926b<_0x4bf007[_0x7053('0x17')];_0x10926b+=0x1){_0x2de4e7=_0x4bf007[_0x10926b][_0x7053('0x49')]({'plain':!![]});switch(_0x2de4e7['dialCheckDuplicateType']){case _0x7053('0x4b'):_0x15f0d2[_0x7053('0x27')](db[_0x7053('0x4e')][_0x7053('0x4c')](_0x157325(_0x2de4e7,_0x7053('0x54')))[_0x7053('0x26')](function(){})['catch'](_0x49af1f()));break;case'onlyIfOpen':_0x15f0d2[_0x7053('0x27')](db['sequelize'][_0x7053('0x4c')](_0x54e5d0(_0x2de4e7,_0x7053('0x54')))[_0x7053('0x26')](function(){})['catch'](_0x49af1f()));break;default:_0x15f0d2['push'](db[_0x7053('0x4e')]['query'](_0x43f177(_0x2de4e7,_0x7053('0x54')))[_0x7053('0x26')](function(){})[_0x7053('0x28')](_0x49af1f()));}}}return _0x15f0d2;})['all']();})['then'](function(){return db[_0x7053('0x53')][_0x7053('0x46')]({'attributes':['id'],'include':[{'model':db[_0x7053('0x51')],'as':_0x7053('0x52'),'where':{'id':LISTID}}]})['then'](function(_0x27e8b0){var _0x2f12f2=[];if(_0x27e8b0){for(var _0x346907=0x0,_0x33c4d8;_0x346907<_0x27e8b0[_0x7053('0x17')];_0x346907+=0x1){_0x33c4d8=_0x27e8b0[_0x346907]['get']({'plain':!![]});_0x2f12f2['push'](db[_0x7053('0x4e')][_0x7053('0x4c')](_0x4214d1(_0x33c4d8,_0x7053('0x54')))[_0x7053('0x26')](function(){})[_0x7053('0x28')](_0x49af1f()));}}return _0x2f12f2;})[_0x7053('0x50')]();})[_0x7053('0x28')](function(_0x265bdb){logger[_0x7053('0x12')](_0x7053('0x55'),'generalCheckHopper',_0x265bdb[_0x7053('0x18')]);});}var processPromises=function(_0x56b1ec){return BPromise['all'](promises)[_0x7053('0x26')](function(_0x28e460){})[_0x7053('0x28')](function(_0x11e5e3){logger['error'](_0x7053('0x56'),JSON[_0x7053('0x57')](_0x11e5e3));})[_0x7053('0x58')](function(){socket[_0x7053('0x59')](_0x7053('0x5a')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x56b1ec){return _0x56b1ec[_0x7053('0x5b')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x7053('0x26')](function(){if(hopperContacts){return checkHopper();}})[_0x7053('0x26')](function(){socket[_0x7053('0x59')](_0x7053('0x5a')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x420c49){logger[_0x7053('0x12')](_0x7053('0x5c'),JSON['stringify'](_0x420c49));}finally{process[_0x7053('0x5d')](0x0);}});};process['on'](_0x7053('0x5e'),function(){logger[_0x7053('0x5f')](_0x7053('0x60'));endCsv();});function main(){return BPromise[_0x7053('0x61')]()[_0x7053('0x26')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x7053('0x10')](',');return db[_0x7053('0x25')][_0x7053('0x46')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x54c8be){var _0x3ce71a=fs[_0x7053('0x62')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x3ce71a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x366702,_0x300568){total+=0x1;var _0x4f61c7=total;promises[_0x7053('0x27')](checkRow(_0x366702,_0x54c8be,_0x4f61c7)[_0x7053('0x26')](function(){success+=0x1;})[_0x7053('0x28')](function(_0x60ed9f){if(_0x60ed9f[_0x7053('0x12')]){errors+=0x1;delete _0x60ed9f[_0x7053('0x12')];}else if(_0x60ed9f[_0x7053('0x23')]){duplicates+=0x1;delete _0x60ed9f[_0x7053('0x23')];}rows['push'](_0x60ed9f);}));if(total%0xc8===0x0){_0x300568['pause']();return processPromises(_0x300568);}},'complete':function(){return processPromises()[_0x7053('0x26')](function(){logger['info'](_0x7053('0x63'));endCsv();});},'error':function(_0x1a2247,_0xcd2075){logger['info']('CSV\x20parse\x20error',JSON['stringify'](_0x1a2247));endCsv();}});})[_0x7053('0x28')](function(_0xabe046){logger['error'](_0x7053('0x64'),JSON[_0x7053('0x57')](_0xabe046));});}main(); \ No newline at end of file +var _0xc2f5=['split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','Duplicate\x20Contact','CmContact','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','NOW()','field','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','into','ListId\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','query','VoiceQueueId','onlyIfOpen','all','sequelize','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject'];(function(_0x4a98fe,_0x224ed8){var _0x3ff59c=function(_0xd3ffbe){while(--_0xd3ffbe){_0x4a98fe['push'](_0x4a98fe['shift']());}};_0x3ff59c(++_0x224ed8);}(_0xc2f5,0x1b8));var _0x5c2f=function(_0x55c1be,_0x5b4b3e){_0x55c1be=_0x55c1be-0x0;var _0x1f1114=_0xc2f5[_0x55c1be];return _0x1f1114;};'use strict';var BPromise=require(_0x5c2f('0x0'));var util=require(_0x5c2f('0x1'));var _=require(_0x5c2f('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x5c2f('0x3'));var Redis=require(_0x5c2f('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x5c2f('0x5'));var logger=require(_0x5c2f('0x6'))(_0x5c2f('0x7'));config[_0x5c2f('0x8')]=_[_0x5c2f('0x9')](config[_0x5c2f('0x8')],{'host':_0x5c2f('0xa'),'port':0x18eb});var socket=require(_0x5c2f('0xb'))(new Redis(config[_0x5c2f('0x8')]));require(_0x5c2f('0xc'))[_0x5c2f('0xd')](socket);try{if(!process[_0x5c2f('0xe')][0x2]||process['argv'][0x2]===_0x5c2f('0xf')||process[_0x5c2f('0xe')][0x2]==='null'){throw new Error(_0x5c2f('0x10'));}var FILEPATH=process[_0x5c2f('0xe')][0x2];if(!process[_0x5c2f('0xe')][0x3]||process[_0x5c2f('0xe')][0x3]===_0x5c2f('0xf')||process[_0x5c2f('0xe')][0x3]==='null'||!process[_0x5c2f('0xe')][0x4]||process[_0x5c2f('0xe')][0x4]===_0x5c2f('0xf')||process[_0x5c2f('0xe')][0x4]===_0x5c2f('0x11')){throw new Error(_0x5c2f('0x12'));}var FIELDS=_[_0x5c2f('0x13')](process['argv'][0x3][_0x5c2f('0x14')](','),process['argv'][0x4][_0x5c2f('0x14')](','));if(!process[_0x5c2f('0xe')][0x5]||process[_0x5c2f('0xe')][0x5]==='undefined'||process[_0x5c2f('0xe')][0x5]==='null'){throw new Error(_0x5c2f('0x15'));}var LISTID=process[_0x5c2f('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process['argv'][0x6]!==_0x5c2f('0xf')&&process['argv'][0x6]!=='null'?process[_0x5c2f('0xe')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x5c2f('0xe')][0x7]!==_0x5c2f('0xf')&&process[_0x5c2f('0xe')][0x7]!==_0x5c2f('0x11')?process['argv'][0x7]:null;if(!process[_0x5c2f('0xe')][0x8]||process['argv'][0x8]===_0x5c2f('0xf')||process['argv'][0x8]===_0x5c2f('0x11')){throw new Error(_0x5c2f('0x16'));}var SOCKET_TIMESTAMP=process[_0x5c2f('0xe')][0x8];}catch(_0x33dbb4){logger['error'](_0x33dbb4);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(_0x10f780,_0x2e59e7,_0x55ae11,_0x31f506){var _0x7faa98={'message':_0x2e59e7};_0x7faa98[_0x10f780]=!![];if(_0x55ae11){_0x7faa98[_0x5c2f('0x17')]=_0x55ae11;}if(_0x31f506){_0x7faa98[_0x5c2f('0x18')]=_0x31f506;}return _0x7faa98;}function isEmail(_0x5a422d){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))*$/[_0x5c2f('0x19')](_0x5a422d);}function checkRow(_0x47898c,_0xd912ee,_0x434dc8){return new BPromise(function(_0x232b31,_0xc07aed){if(_[_0x5c2f('0x1a')](_0x47898c)){return _0xc07aed(handleCheckRowError(_0x5c2f('0x1b'),_0x5c2f('0x1c'),null,_0x434dc8));}if(_0x47898c[_0x5c2f('0x1d')]&&_0x47898c[_0x5c2f('0x1d')]['length']){var _0x43e4f6=_['map'](_0x47898c[_0x5c2f('0x1d')],_0x5c2f('0x1e'))[_0x5c2f('0x1f')](';');return _0xc07aed(handleCheckRowError(_0x5c2f('0x1b'),_0x43e4f6,null,_0x434dc8));}var _0x652bda={};for(var _0x58c34d in FIELDS){if(FIELDS[_0x5c2f('0x20')](_0x58c34d)&&FIELDS[_0x58c34d]){_0x652bda[_0x58c34d]=_0x47898c[_0x5c2f('0x21')][0x0][FIELDS[_0x58c34d]]||_0x47898c[_0x5c2f('0x21')][0x0]['\ufeff'+FIELDS[_0x58c34d]];}}if(!_0x652bda['firstName']){return _0xc07aed(handleCheckRowError(_0x5c2f('0x1b'),_0x5c2f('0x22'),null,_0x434dc8));}if(!_0x652bda[_0x5c2f('0x23')]){return _0xc07aed(handleCheckRowError(_0x5c2f('0x1b'),_0x5c2f('0x24'),null,_0x434dc8));}if(_0x652bda[_0x5c2f('0x25')]){var _0x151e74=moment(_0x652bda[_0x5c2f('0x25')],_0x5c2f('0x26'));if(!_0x151e74[_0x5c2f('0x27')]()){return _0xc07aed(handleCheckRowError(_0x5c2f('0x1b'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x434dc8));}}if(_0x652bda[_0x5c2f('0x28')]){if(!isEmail(_0x652bda[_0x5c2f('0x28')])){return _0xc07aed(handleCheckRowError('error',_0x5c2f('0x29'),null,_0x434dc8));}}_0x652bda[_0x5c2f('0x2a')]=LISTID;_0x652bda[_0x5c2f('0x2b')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0xd912ee){var _0x5d6ffe={};for(var _0x33d36=0x0,_0x5f1f28=DUPLICATES[_0x5c2f('0x2c')];_0x33d36<_0x5f1f28;_0x33d36+=0x1){_0x5d6ffe[DUPLICATES[_0x33d36]]=_0x652bda[DUPLICATES[_0x33d36]];}var _0x1c57cb=_[_0x5c2f('0x2d')](_0xd912ee,_0x5d6ffe);if(_0x1c57cb){return _0xc07aed(handleCheckRowError('duplicate',_0x5c2f('0x2e'),_0x1c57cb,_0x434dc8));}}return db[_0x5c2f('0x2f')]['create'](_0x652bda,{'raw':!![],'hooks':![],'fields':_[_0x5c2f('0x30')](_0x652bda)})[_0x5c2f('0x31')](function(_0x4cb082){if(DUPLICATES&&DUPLICATES['length']&&_0xd912ee){_0xd912ee[_0x5c2f('0x32')](_['pick'](_0x652bda,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4cb082['id'];return _0x232b31();})[_0x5c2f('0x33')](function(_0x585759){return _0xc07aed(handleCheckRowError('error',_0x5c2f('0x34')+(_0x585759['message']||JSON[_0x5c2f('0x35')](_0x585759)),null,_0x434dc8));});});}function checkHopper(){function _0x3803db(){return function(_0x2990cc){logger[_0x5c2f('0x1b')]('cmContact','checkHopper',util[_0x5c2f('0x36')](_0x2990cc,{'showHidden':![],'depth':null}));};}var _0x5c040c=function(_0x499de0,_0x5bafac){var _0x16be86=squel[_0x5c2f('0x37')]()['into'](_0x5c2f('0x38'))[_0x5c2f('0x39')]([_0x5c2f('0x23'),_0x5c2f('0x3a'),_0x5c2f('0x3b'),_0x5c2f('0x2a'),_0x5bafac,_0x5c2f('0x3c'),_0x5c2f('0x3d')],squel[_0x5c2f('0x3e')]()['field'](_0x5c2f('0x23'),_0x5c2f('0x23'))['field'](_0x5c2f('0x3f'),_0x5c2f('0x3a'))[_0x5c2f('0x40')]('id',_0x5c2f('0x3b'))[_0x5c2f('0x40')](LISTID[_0x5c2f('0x41')](),'ListId')[_0x5c2f('0x40')](_0x499de0['id'][_0x5c2f('0x41')](),_0x5bafac)['field']('NOW()','createdAt')[_0x5c2f('0x40')]('NOW()',_0x5c2f('0x3d'))[_0x5c2f('0x42')](_0x5c2f('0x43'))[_0x5c2f('0x44')](_0x5c2f('0x45'))[_0x5c2f('0x44')]('ListId\x20=\x20?',LISTID['toString']())[_0x5c2f('0x44')](_0x5c2f('0x46'))[_0x5c2f('0x44')](_0x5c2f('0x47'),squel[_0x5c2f('0x3e')]()[_0x5c2f('0x40')](_0x5c2f('0x23'))[_0x5c2f('0x42')]('cm_hopper')[_0x5c2f('0x44')](_0x5bafac+'\x20=\x20?',_0x499de0['id'][_0x5c2f('0x41')]())))['toString']();return _0x16be86;};var _0x3307e3=function(_0x45340d,_0x5aaca2){var _0x14bbe3=squel[_0x5c2f('0x37')]()[_0x5c2f('0x48')](_0x5c2f('0x38'))[_0x5c2f('0x39')]([_0x5c2f('0x23'),_0x5c2f('0x3a'),'ContactId',_0x5c2f('0x2a'),_0x5aaca2,_0x5c2f('0x3c'),_0x5c2f('0x3d')],squel[_0x5c2f('0x3e')]()[_0x5c2f('0x40')](_0x5c2f('0x23'),_0x5c2f('0x23'))[_0x5c2f('0x40')](_0x5c2f('0x3f'),'scheduledAt')[_0x5c2f('0x40')]('id',_0x5c2f('0x3b'))[_0x5c2f('0x40')](LISTID[_0x5c2f('0x41')](),_0x5c2f('0x2a'))[_0x5c2f('0x40')](_0x45340d['id'][_0x5c2f('0x41')](),_0x5aaca2)[_0x5c2f('0x40')](_0x5c2f('0x3f'),_0x5c2f('0x3c'))['field']('NOW()',_0x5c2f('0x3d'))[_0x5c2f('0x42')](_0x5c2f('0x43'))[_0x5c2f('0x44')](_0x5c2f('0x45'))[_0x5c2f('0x44')](_0x5c2f('0x49'),LISTID[_0x5c2f('0x41')]())[_0x5c2f('0x44')](_0x5c2f('0x4a'),squel[_0x5c2f('0x4b')](hopperContacts))[_0x5c2f('0x44')](_0x5c2f('0x46'))[_0x5c2f('0x44')](_0x5c2f('0x47'),squel[_0x5c2f('0x3e')]()[_0x5c2f('0x40')](_0x5c2f('0x4c'))[_0x5c2f('0x42')](_0x5c2f('0x4d'))['where'](_0x5aaca2+_0x5c2f('0x4e'),_0x45340d['id'][_0x5c2f('0x41')]()))[_0x5c2f('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x5c2f('0x3e')]()[_0x5c2f('0x40')](_0x5c2f('0x23'))[_0x5c2f('0x42')]('cm_hopper')[_0x5c2f('0x44')](_0x5aaca2+'\x20=\x20?',_0x45340d['id'][_0x5c2f('0x41')]())))[_0x5c2f('0x41')]();return _0x14bbe3;};function _0x2e9752(_0x23f283,_0x16ab5f){var _0x153a6a=squel['insert']()['into'](_0x5c2f('0x38'))[_0x5c2f('0x39')](['phone',_0x5c2f('0x3a'),_0x5c2f('0x3b'),_0x5c2f('0x2a'),_0x16ab5f,'createdAt',_0x5c2f('0x3d')],squel[_0x5c2f('0x3e')]()[_0x5c2f('0x40')](_0x5c2f('0x23'),_0x5c2f('0x23'))[_0x5c2f('0x40')](_0x5c2f('0x3f'),'scheduledAt')[_0x5c2f('0x40')]('id',_0x5c2f('0x3b'))[_0x5c2f('0x40')](LISTID[_0x5c2f('0x41')](),_0x5c2f('0x2a'))[_0x5c2f('0x40')](_0x23f283['id'][_0x5c2f('0x41')](),_0x16ab5f)[_0x5c2f('0x40')](_0x5c2f('0x3f'),_0x5c2f('0x3c'))['field']('NOW()',_0x5c2f('0x3d'))[_0x5c2f('0x42')](_0x5c2f('0x43'))[_0x5c2f('0x44')](_0x5c2f('0x45'))[_0x5c2f('0x44')](_0x5c2f('0x49'),LISTID[_0x5c2f('0x41')]())[_0x5c2f('0x44')](_0x5c2f('0x4a'),squel[_0x5c2f('0x4b')](hopperContacts))[_0x5c2f('0x44')](_0x5c2f('0x46')))[_0x5c2f('0x41')]();return _0x153a6a;}function _0x271908(_0x64f0be,_0x325189){var _0x5b2c75=squel['insert']()[_0x5c2f('0x48')](_0x5c2f('0x4f'))[_0x5c2f('0x39')]([_0x5c2f('0x23'),_0x5c2f('0x3b'),_0x5c2f('0x2a'),_0x325189,_0x5c2f('0x3c'),_0x5c2f('0x3d')],squel[_0x5c2f('0x3e')]()[_0x5c2f('0x40')]('phone',_0x5c2f('0x23'))[_0x5c2f('0x40')]('id',_0x5c2f('0x3b'))[_0x5c2f('0x40')](LISTID[_0x5c2f('0x41')](),_0x5c2f('0x2a'))[_0x5c2f('0x40')](_0x64f0be['id'][_0x5c2f('0x41')](),_0x325189)[_0x5c2f('0x40')](_0x5c2f('0x3f'),_0x5c2f('0x3c'))[_0x5c2f('0x40')](_0x5c2f('0x3f'),'updatedAt')[_0x5c2f('0x42')](_0x5c2f('0x43'))[_0x5c2f('0x44')](_0x5c2f('0x45'))[_0x5c2f('0x44')]('ListId\x20=\x20?',LISTID[_0x5c2f('0x41')]())[_0x5c2f('0x44')]('id\x20IN\x20?',squel[_0x5c2f('0x4b')](hopperContacts))[_0x5c2f('0x44')](_0x5c2f('0x46')))[_0x5c2f('0x41')]();return _0x5b2c75;}return db[_0x5c2f('0x50')][_0x5c2f('0x51')]({'where':{'type':_0x5c2f('0x52')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x5c2f('0x53')],'as':_0x5c2f('0x54'),'where':{'id':LISTID}}]})['then'](function(_0x2600b9){var _0x431aa8=[];if(_0x2600b9){var _0x7b1e9b;for(var _0x4df4c1=0x0,_0x4151a7;_0x4df4c1<_0x2600b9['length'];_0x4df4c1+=0x1){_0x4151a7=_0x2600b9[_0x4df4c1][_0x5c2f('0x55')]({'plain':!![]});switch(_0x4151a7[_0x5c2f('0x56')]){case _0x5c2f('0x57'):_0x431aa8[_0x5c2f('0x32')](db['sequelize'][_0x5c2f('0x58')](_0x3307e3(_0x4151a7,_0x5c2f('0x59')))[_0x5c2f('0x31')](function(){})[_0x5c2f('0x33')](_0x3803db()));break;case _0x5c2f('0x5a'):_0x431aa8[_0x5c2f('0x32')](db['sequelize']['query'](_0x5c040c(_0x4151a7,_0x5c2f('0x59')))['then'](function(){})[_0x5c2f('0x33')](_0x3803db()));break;default:_0x431aa8[_0x5c2f('0x32')](db['sequelize'][_0x5c2f('0x58')](_0x2e9752(_0x4151a7,_0x5c2f('0x59')))[_0x5c2f('0x31')](function(){})[_0x5c2f('0x33')](_0x3803db()));}}}return _0x431aa8;})[_0x5c2f('0x5b')]()['then'](function(){return db[_0x5c2f('0x50')][_0x5c2f('0x51')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x5c2f('0x53')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x5c2f('0x31')](function(_0xafdedd){var _0x4d398a=[];if(_0xafdedd){var _0x47e67d;for(var _0x48fe2e=0x0,_0x42488a;_0x48fe2e<_0xafdedd[_0x5c2f('0x2c')];_0x48fe2e+=0x1){_0x42488a=_0xafdedd[_0x48fe2e]['get']({'plain':!![]});_0x4d398a[_0x5c2f('0x32')](db[_0x5c2f('0x5c')][_0x5c2f('0x58')](_0x271908(_0x42488a,_0x5c2f('0x59')))[_0x5c2f('0x31')](function(){})[_0x5c2f('0x33')](_0x3803db()));}}return _0x4d398a;})[_0x5c2f('0x5b')]();})['then'](function(){return db[_0x5c2f('0x5d')][_0x5c2f('0x51')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x5c2f('0x53')],'as':_0x5c2f('0x54'),'where':{'id':LISTID}}]})[_0x5c2f('0x31')](function(_0x25d83c){var _0x126ff1=[];if(_0x25d83c){for(var _0xecda34=0x0,_0x52b7ae;_0xecda34<_0x25d83c[_0x5c2f('0x2c')];_0xecda34+=0x1){_0x52b7ae=_0x25d83c[_0xecda34][_0x5c2f('0x55')]({'plain':!![]});switch(_0x52b7ae[_0x5c2f('0x56')]){case'always':_0x126ff1[_0x5c2f('0x32')](db['sequelize']['query'](_0x3307e3(_0x52b7ae,'CampaignId'))['then'](function(){})[_0x5c2f('0x33')](_0x3803db()));break;case _0x5c2f('0x5a'):_0x126ff1[_0x5c2f('0x32')](db[_0x5c2f('0x5c')]['query'](_0x5c040c(_0x52b7ae,_0x5c2f('0x5e')))[_0x5c2f('0x31')](function(){})[_0x5c2f('0x33')](_0x3803db()));break;default:_0x126ff1['push'](db[_0x5c2f('0x5c')]['query'](_0x2e9752(_0x52b7ae,_0x5c2f('0x5e')))[_0x5c2f('0x31')](function(){})[_0x5c2f('0x33')](_0x3803db()));}}}return _0x126ff1;})[_0x5c2f('0x5b')]();})[_0x5c2f('0x31')](function(){return db[_0x5c2f('0x5d')][_0x5c2f('0x51')]({'attributes':['id'],'include':[{'model':db[_0x5c2f('0x53')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x216604){var _0x5b059f=[];if(_0x216604){for(var _0x4e1926=0x0,_0x20699a;_0x4e1926<_0x216604['length'];_0x4e1926+=0x1){_0x20699a=_0x216604[_0x4e1926][_0x5c2f('0x55')]({'plain':!![]});_0x5b059f[_0x5c2f('0x32')](db[_0x5c2f('0x5c')]['query'](_0x271908(_0x20699a,_0x5c2f('0x5e')))['then'](function(){})[_0x5c2f('0x33')](_0x3803db()));}}return _0x5b059f;})['all']();})[_0x5c2f('0x33')](function(_0x1af8c4){logger['error'](_0x5c2f('0x5f'),_0x5c2f('0x60'),_0x1af8c4[_0x5c2f('0x1e')]);});}var processPromises=function(_0x5c8c4a){return BPromise[_0x5c2f('0x5b')](promises)['then'](function(_0x270a2a){})[_0x5c2f('0x33')](function(_0x2c2e16){logger['error'](_0x5c2f('0x61'),JSON[_0x5c2f('0x35')](_0x2c2e16));})['finally'](function(){socket[_0x5c2f('0x62')](_0x5c2f('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5c8c4a){return _0x5c8c4a[_0x5c2f('0x64')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x5c2f('0x31')](function(){if(hopperContacts){return checkHopper();}})[_0x5c2f('0x31')](function(){socket[_0x5c2f('0x62')](_0x5c2f('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x5c2f('0x65')](FILEPATH);}catch(_0x357b94){logger[_0x5c2f('0x1b')](_0x5c2f('0x66'),JSON[_0x5c2f('0x35')](_0x357b94));}finally{process[_0x5c2f('0x67')](0x0);}});};process['on'](_0x5c2f('0x68'),function(){logger[_0x5c2f('0x69')](_0x5c2f('0x6a'));endCsv();});function main(){return BPromise[_0x5c2f('0x6b')]()[_0x5c2f('0x31')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x5c2f('0x14')](',');return db[_0x5c2f('0x2f')][_0x5c2f('0x51')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x5c2f('0x31')](function(_0x83c56b){var _0x558556=fs[_0x5c2f('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x5c2f('0x6d')](_0x558556,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2c7a5a,_0x412241){total+=0x1;var _0x3e7012=total;promises[_0x5c2f('0x32')](checkRow(_0x2c7a5a,_0x83c56b,_0x3e7012)['then'](function(){success+=0x1;})[_0x5c2f('0x33')](function(_0x4d35b1){if(_0x4d35b1[_0x5c2f('0x1b')]){errors+=0x1;delete _0x4d35b1[_0x5c2f('0x1b')];}else if(_0x4d35b1[_0x5c2f('0x6e')]){duplicates+=0x1;delete _0x4d35b1[_0x5c2f('0x6e')];}rows[_0x5c2f('0x32')](_0x4d35b1);}));if(total%0xc8===0x0){_0x412241[_0x5c2f('0x6f')]();return processPromises(_0x412241);}},'complete':function(){return processPromises()[_0x5c2f('0x31')](function(){logger[_0x5c2f('0x69')](_0x5c2f('0x70'));endCsv();});},'error':function(_0x3e9959,_0x50d7c2){logger['info'](_0x5c2f('0x71'),JSON[_0x5c2f('0x35')](_0x3e9959));endCsv();}});})[_0x5c2f('0x33')](function(_0x28f468){logger[_0x5c2f('0x1b')](_0x5c2f('0x72'),JSON[_0x5c2f('0x35')](_0x28f468));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index f87c33c..d4db04d 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 _0x0df4=['select','field','from','.id\x20=\x20','where','\x20=\x20','findAll','AdditionalPhones','then','length','push','split','filter','CmContactHasItem','findOne','update','updated','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','join','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','insert','cm_hopper_black','.CmListId','cm_contacts.createdAt\x20=\x20?','phone','date_add(cm_contacts.scheduledat,interval\x20','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','errors','sequelize','query','catch','error','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','spread','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','all','timezones','isNil','utcOffset','set','offset','dialTimezone','main','stringify','start','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','ContactItemType','name','_description','createReadStream','data','rows','find','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','replace','appendFileSync','emit','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','CampaignId','campaigns_has_cm_blacklists','VoiceQueueId','voice_queues_has_cm_blacklists','finish','affectedRows','contact:import:','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x0df4,0xac));var _0x40df=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x0df4[_0x4709c0];return _0x13348b;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x40df('0x0'));var Papa=require(_0x40df('0x1'));var util=require(_0x40df('0x2'));var BPromise=require(_0x40df('0x3'));var moment=require(_0x40df('0x4'));var squel=require(_0x40df('0x5'));var Redis=require('ioredis');var db=require(_0x40df('0x6'))['db'];var config=require(_0x40df('0x7'));var shared=require('../../../config/environment/shared');var logger=require(_0x40df('0x8'))('import');config[_0x40df('0x9')]=_[_0x40df('0xa')](config['redis'],{'host':_0x40df('0xb'),'port':0x18eb});var socket=require(_0x40df('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x40df('0xd')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x40df('0xd')](_0x40df('0xe'));function isEmail(_0x2b057d){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))*$/[_0x40df('0xf')](_0x2b057d);}function selectNotIn(_0x51fdaf,_0x58a78d,_0xcd34ae,_0x5e295a,_0x3fd5d9){return squel[_0x40df('0x10')]()[_0x40df('0x11')]('phone')[_0x40df('0x12')](_0x5e295a)['join'](_0x58a78d,null,_0x58a78d+_0x40df('0x13')+_0x5e295a+'.'+_0xcd34ae)[_0x40df('0x14')](_0x5e295a+'.'+_0xcd34ae+_0x40df('0x15')+_0x51fdaf+'.'+_0xcd34ae)[_0x40df('0x14')](_0x58a78d+'.dialCheckDuplicateType\x20IN\x20('+_0x3fd5d9['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x581bdc,_0x4703b5){promisesAdditionalPhones=[];return db['CmContact'][_0x40df('0x16')]({'raw':!![],'attributes':['id',_0x40df('0x17')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x40df('0x18')](function(_0xf2e3e7){if(_0xf2e3e7!==null){var _0x182c36=[];for(var _0x173a10=0x0;_0x173a10<_0xf2e3e7[_0x40df('0x19')];_0x173a10++){var _0x2af89f=_0xf2e3e7[_0x173a10];_0x182c36[_0x40df('0x1a')](insertAdditionalPhones(_0x2af89f));}}Promise['all'](_0x182c36)[_0x40df('0x18')](function(){_0x581bdc({'val':0x1});});});});}function insertAdditionalPhones(_0x19fbe8){return new Promise(function(_0x4a2df7,_0x188f66){var _0x3a0ceb=_0x19fbe8[_0x40df('0x17')];var _0x50ca58=_0x3a0ceb[_0x40df('0x1b')](';');var _0x1f32e0=[];orderBy=0x0;for(var _0x4d5317=0x0;_0x4d5317<_0x50ca58[_0x40df('0x19')];_0x4d5317++){_0x1f32e0[_0x40df('0x1a')](splitAdditionalPhone(_0x19fbe8['id'],_0x50ca58[_0x4d5317]));}Promise['all'](_0x1f32e0)[_0x40df('0x18')](function(){_0x4a2df7({'val':_0x50ca58[_0x40df('0x19')]});});});}function splitAdditionalPhone(_0x6e6863,_0x16cdaf){return new Promise(function(_0x505208,_0x2f3a7e){var _0xa0b18b=_0x16cdaf[_0x40df('0x1b')](':');var _0x1a0a54=_0xa0b18b[0x0];var _0x18db04=_0xa0b18b[0x1];if(!_['isNil'](_0x18db04)){var _0x4a99e2=_0x18db04[_0x40df('0x1b')]('|');var _0x267679=[];for(var _0x57026d=0x0;_0x57026d<_0x4a99e2['length'];_0x57026d++){if(_0x4a99e2[_0x57026d]!==''){var _0x26c586=_[_0x40df('0x1c')](promisesAdditionalPhones,{'contactId':_0x6e6863,'phone':_0x4a99e2[_0x57026d]});if(_0x26c586[_0x40df('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0x40df('0x1a')]({'contactId':_0x6e6863,'contactTypeId':_0x1a0a54,'phone':_0x4a99e2[_0x57026d],'orderBy':orderBy});}}}_0x505208({'ok':0x1});}else _0x505208({'res':0x0});});}function createAdditionalPhone(_0x474448,_0xb7d9e6,_0x1df99d,_0x33a14f){var _0x5e3f71='';var _0x21539c='';var _0x515706=_0x1df99d[_0x40df('0x1b')]('§');_0x5e3f71=_0x515706[0x0];if(_0x515706[_0x40df('0x19')]==0x2)_0x21539c=_0x515706[0x1];return new Promise(function(_0x4bc890,_0x2bf179){return db[_0x40df('0x1d')][_0x40df('0x1e')]({'where':{'CmContactId':_0x474448,'item':_0x5e3f71}})['then'](function(_0x1d049c){if(_0x1d049c){return db[_0x40df('0x1d')][_0x40df('0x1f')]({'ItemTypeId':_0xb7d9e6,'description':_0x21539c,'OrderBy':_0x33a14f},{'where':{'CmContactId':_0x474448,'item':_0x5e3f71}})[_0x40df('0x18')](function(_0x3c2da9){_0x4bc890({'res':_0x40df('0x20')});});}else{return db[_0x40df('0x1d')][_0x40df('0x21')]({'CmContactId':_0x474448,'item':_0x5e3f71,'description':_0x21539c,'ItemTypeId':_0xb7d9e6,'OrderBy':_0x33a14f,'ItemClass':'PHONE'})[_0x40df('0x18')](function(_0x31754c){_0x4bc890({'res':_0x40df('0x22')});});}});});}function insertCmHopper(_0xa2c2e6,_0x37009e,_0x30069a,_0x350319,_0x529dbc){var _0x2fc98a=[_0x40df('0x23'),_0x40df('0x24'),_0x40df('0x25'),_0x40df('0x26'),_0x37009e+'.'+_0x350319,_0x40df('0x27'),_0x40df('0x28'),_0x40df('0x29'),_0x40df('0x2a'),'\x22'+_0x529dbc+'\x22'];return squel['insert']()[_0x40df('0x2b')](_0x40df('0x2c'))[_0x40df('0x2d')](['phone',_0x40df('0x2e'),_0x40df('0x2f'),_0x40df('0x30'),_0x350319,_0x40df('0x31'),_0x40df('0x32'),_0x40df('0x33'),_0x40df('0x34'),_0x40df('0x35')],squel[_0x40df('0x10')]()[_0x40df('0x36')](_0x2fc98a)[_0x40df('0x12')](_0x37009e)[_0x40df('0x37')](_0x40df('0x38'),null,_0x40df('0x39')+_0x37009e+'.CmListId')[_0x40df('0x37')](_0x30069a,null,_0x30069a+'.id\x20=\x20'+_0x37009e+'.'+_0x350319)[_0x40df('0x14')](_0x37009e+_0x40df('0x3a'),_0xa2c2e6)[_0x40df('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x40df('0x14')](_0x40df('0x3b'),selectNotIn(_0x37009e,_0x30069a,_0x350319,_0x40df('0x2c'),[_0x40df('0x3c'),_0x40df('0x3d')]))[_0x40df('0x14')](_0x40df('0x3b'),selectNotIn(_0x37009e,_0x30069a,_0x350319,_0x40df('0x2c'),['\x22always\x22'])))[_0x40df('0x3e')]();}function insertCmHopperBlack(_0x2b307a,_0xf35db6,_0x347afa,_0xd6392f){var _0x1822f7=['cm_contacts.phone','cm_contacts.id',_0x40df('0x26'),_0xf35db6+'.'+_0xd6392f,_0x40df('0x27'),_0x40df('0x28')];return squel[_0x40df('0x3f')]()[_0x40df('0x2b')](_0x40df('0x40'))['fromQuery'](['phone','ContactId','ListId',_0xd6392f,_0x40df('0x31'),'updatedAt'],squel['select']()['fields'](_0x1822f7)['from'](_0xf35db6)['join'](_0x40df('0x38'),null,_0x40df('0x39')+_0xf35db6+_0x40df('0x41'))[_0x40df('0x37')](_0x347afa,null,_0x347afa+_0x40df('0x13')+_0xf35db6+'.'+_0xd6392f)[_0x40df('0x14')](_0xf35db6+_0x40df('0x3a'),_0x2b307a)[_0x40df('0x14')](_0x40df('0x42'),NOW)[_0x40df('0x14')](_0x40df('0x3b'),squel[_0x40df('0x10')]()[_0x40df('0x11')](_0x40df('0x43'))[_0x40df('0x12')]('cm_hopper_black')[_0x40df('0x14')]('ListId\x20=\x20?',_0x2b307a)[_0x40df('0x14')](_0xd6392f+_0x40df('0x15')+_0xf35db6+'.'+_0xd6392f)))[_0x40df('0x3e')]();}function insertTzCmHopper(_0x520356,_0x491b61,_0x5d87d9,_0x5a5264,_0x175b1d,_0xaf771e){var _0x1cecd2=[_0x40df('0x23'),_0x40df('0x44')+_0xaf771e+'.offset-cm_contacts.utcOffset\x20minute)',_0x40df('0x25'),_0x40df('0x26'),_0x491b61+'.'+_0x5a5264,_0x40df('0x27'),_0x40df('0x28'),_0x40df('0x29'),_0x40df('0x2a'),'\x22'+_0x175b1d+'\x22'];var _0x39063b=squel[_0x40df('0x3f')]()[_0x40df('0x2b')](_0x40df('0x2c'))[_0x40df('0x2d')]([_0x40df('0x43'),_0x40df('0x2e'),_0x40df('0x2f'),_0x40df('0x30'),_0x5a5264,_0x40df('0x31'),_0x40df('0x32'),_0x40df('0x33'),_0x40df('0x34'),_0x40df('0x35')],squel[_0x40df('0x10')]()[_0x40df('0x36')](_0x1cecd2)[_0x40df('0x12')](_0x491b61)[_0x40df('0x37')](_0x40df('0x38'),null,'cm_contacts.ListId\x20=\x20'+_0x491b61+'.CmListId')[_0x40df('0x37')](_0x5d87d9,null,_0x5d87d9+_0x40df('0x13')+_0x491b61+'.'+_0x5a5264)['join'](_0xaf771e,null,_0xaf771e+_0x40df('0x13')+_0x491b61+'.'+_0x5a5264)[_0x40df('0x14')](_0x491b61+'.CmListId\x20=\x20?',_0x520356)[_0x40df('0x14')](_0x40df('0x42'),NOW)[_0x40df('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x491b61,_0x5d87d9,_0x5a5264,_0x40df('0x2c'),['\x22always\x22',_0x40df('0x3d')]))[_0x40df('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x491b61,_0x5d87d9,_0x5a5264,_0x40df('0x2c'),[_0x40df('0x3c')])))[_0x40df('0x3e')]();return _0x39063b;}function insertTzCmHopperBlack(_0x25a1e0,_0x35d4a3,_0x5e3b89,_0x415a08){var _0x81b51d=[_0x40df('0x23'),_0x40df('0x25'),_0x40df('0x26'),_0x35d4a3+'.'+_0x415a08,_0x40df('0x27'),_0x40df('0x28')];return squel[_0x40df('0x3f')]()[_0x40df('0x2b')](_0x40df('0x40'))[_0x40df('0x2d')]([_0x40df('0x43'),_0x40df('0x2f'),_0x40df('0x30'),_0x415a08,_0x40df('0x31'),_0x40df('0x32')],squel['select']()[_0x40df('0x36')](_0x81b51d)[_0x40df('0x12')](_0x35d4a3)[_0x40df('0x37')](_0x40df('0x38'),null,_0x40df('0x39')+_0x35d4a3+'.CmListId')[_0x40df('0x37')](_0x5e3b89,null,_0x5e3b89+_0x40df('0x13')+_0x35d4a3+'.'+_0x415a08)[_0x40df('0x14')](_0x35d4a3+_0x40df('0x3a'),_0x25a1e0)[_0x40df('0x14')](_0x40df('0x42'),NOW)[_0x40df('0x14')](_0x40df('0x3b'),squel[_0x40df('0x10')]()[_0x40df('0x11')](_0x40df('0x43'))[_0x40df('0x12')](_0x40df('0x40'))[_0x40df('0x14')]('ListId\x20=\x20?',_0x25a1e0)[_0x40df('0x14')](_0x415a08+'\x20=\x20'+_0x35d4a3+'.'+_0x415a08)))['toString']();}function insertCmHopperAdditionalPhones(_0x5a2672){var _0x188c69=[_0x40df('0x45'),_0x40df('0x46'),_0x40df('0x47'),_0x40df('0x48'),_0x40df('0x49')];return squel['insert']()[_0x40df('0x2b')]('cm_hopper_additional_phones')[_0x40df('0x2d')]([_0x40df('0x4a'),_0x40df('0x43'),_0x40df('0x4b'),_0x40df('0x31'),'updatedAt'],squel[_0x40df('0x10')]()[_0x40df('0x36')](_0x188c69)[_0x40df('0x12')](_0x40df('0x2c'))['join'](_0x40df('0x38'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x40df('0x37')](_0x40df('0x4c'),null,_0x40df('0x4d'))[_0x40df('0x14')]('cm_hopper.ListId\x20=\x20?',_0x5a2672)['where'](_0x40df('0x42'),NOW))[_0x40df('0x3e')]();}function insertCmContact(_0x1e934b,_0x194fbb,_0x27e2f1,_0x31166f){var _0x330d97=_[_0x40df('0x4e')](_[_0x40df('0x4f')](_0x31166f),['ListId',_0x40df('0x50'),_0x40df('0x31'),_0x40df('0x32'),'scheduledAt']);return squel[_0x40df('0x3f')]()[_0x40df('0x2b')]('cm_contacts')[_0x40df('0x2d')](_0x330d97,squel[_0x40df('0x10')]()['fields'](_0x330d97)[_0x40df('0x12')](_0x194fbb)['where']('('+_0x27e2f1[_0x40df('0x37')](',')+')\x20NOT\x20IN\x20?',squel[_0x40df('0x10')]()['fields'](_0x27e2f1)[_0x40df('0x12')](_0x40df('0x38'))['where'](_0x40df('0x51'),_0x1e934b)[_0x40df('0x14')](_0x40df('0x52')))[_0x40df('0x14')](_0x40df('0x53'),squel[_0x40df('0x10')]()['field'](_0x40df('0x54'),_0x40df('0x55'))['from'](_0x194fbb)[_0x40df('0x56')](_0x27e2f1['join'](','))))[_0x40df('0x3e')]();}function handleStop(){logger[_0x40df('0x57')](_0x40df('0x58'));stopped=!![];}function handleUncaughtException(_0x5b4bd9){logger['error'](_0x5b4bd9[_0x40df('0x59')]);process['exit'](0x1);}function handleError(_0x473fdf,_0xd0138b){stats[_0x40df('0x5a')][_0x40df('0x1a')]({'name':_0xd0138b['code'],'message':_0xd0138b[_0x40df('0x59')],'row':_0x473fdf});}function handleQuery(_0x5c97ba){logger[_0x40df('0x57')](_0x5c97ba);return db[_0x40df('0x5b')][_0x40df('0x5c')](_0x5c97ba)['spread'](function(_0x23ff95){results[_0x40df('0x1a')](_0x23ff95);})[_0x40df('0x5d')](function(_0x1d3751){logger[_0x40df('0x5e')](_0x1d3751['message']);});}function updateTzCampaigns(_0x468494){return new Promise(function(_0x245a3f,_0x176416){var _0x8e2c0f=squel['select']()[_0x40df('0x36')]([_0x40df('0x5f'),_0x40df('0x60')])[_0x40df('0x12')](_0x40df('0x61'))[_0x40df('0x37')](_0x40df('0x62'),null,_0x40df('0x63'))[_0x40df('0x14')](_0x40df('0x64')+_0x468494);db[_0x40df('0x5b')]['query'](_0x8e2c0f[_0x40df('0x3e')]())[_0x40df('0x65')](function(_0x546ab4){var _0x46bd66=[];for(var _0x538e04=0x0;_0x538e04<_0x546ab4[_0x40df('0x19')];_0x538e04++){_0x46bd66[_0x40df('0x1a')](getTimezoneData(_0x546ab4[_0x538e04],tmp_campaigns));}BPromise['all'](_0x46bd66)[_0x40df('0x18')](function(){_0x245a3f({'val':0x1});});})[_0x40df('0x5d')](function(_0x3edbc1){logger[_0x40df('0x5e')](_0x3edbc1[_0x40df('0x59')]);_0x245a3f({'val':0x0});});});}function updateTzVoiceQueues(_0x48896c){return new Promise(function(_0x14f04c,_0x42b2d3){var _0x3d10b5=squel['select']()['fields'](['voice_queues.id',_0x40df('0x66')])[_0x40df('0x12')](_0x40df('0x67'))[_0x40df('0x37')](_0x40df('0x68'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')['where']('voice_queues_has_cm_lists.CmListId='+_0x48896c);db[_0x40df('0x5b')][_0x40df('0x5c')](_0x3d10b5[_0x40df('0x3e')]())[_0x40df('0x65')](function(_0x341f2d){var _0x22e52f=[];for(var _0x73eccf=0x0;_0x73eccf<_0x341f2d['length'];_0x73eccf++){_0x22e52f[_0x40df('0x1a')](getTimezoneData(_0x341f2d[_0x73eccf],tmp_voice_queues));}BPromise[_0x40df('0x69')](_0x22e52f)[_0x40df('0x18')](function(){_0x14f04c({'val':0x1});});})['catch'](function(_0x3a511f){logger[_0x40df('0x5e')](_0x3a511f['message']);_0x14f04c({'val':0x0});});});}function getTimezoneData(_0x5f5729,_0x3b89a6){return new Promise(function(_0x255092,_0x4e38d2){var _0x23dd1b=shared[_0x40df('0x6a')];var _0x533cb2=_0x23dd1b[_0x5f5729['dialTimezone']];if(_[_0x40df('0x6b')](_0x533cb2)){_0x255092({'ret':0x1});}else{var _0x2b6cf6=_0x533cb2[_0x40df('0x6c')];var _0x4aa8e3=squel[_0x40df('0x3f')]()[_0x40df('0x2b')](_0x3b89a6)[_0x40df('0x6d')]('id',_0x5f5729['id'])[_0x40df('0x6d')](_0x40df('0x6e'),_0x2b6cf6)[_0x40df('0x6d')](_0x40df('0x6f'),_0x5f5729['dialTimezone'])[_0x40df('0x3e')]();return db[_0x40df('0x5b')][_0x40df('0x5c')](_0x4aa8e3)['spread'](function(_0x26caed){_0x255092({'ret':0x1});})[_0x40df('0x5d')](function(_0x1a1633){logger[_0x40df('0x5e')](_0x1a1633['message']);_0x4e38d2({'ret':0x1});});}});}function handleTZQuery(_0x3e7bcd){logger[_0x40df('0x57')](_0x3e7bcd);return db[_0x40df('0x5b')][_0x40df('0x5c')](_0x3e7bcd)['spread'](function(_0x372cbc){})[_0x40df('0x5d')](function(_0x272265){logger[_0x40df('0x5e')](_0x272265['message']);});}function main(_0x27ac47,_0x29710d,_0x660a6c,_0x2cb5ec){logger[_0x40df('0x57')](_0x40df('0x70'),_0x27ac47,JSON[_0x40df('0x71')](_0x29710d));process['send'](_0x40df('0x72'));var _0x179865=_0x29710d['binding'];var _0x4f34bc=_[_0x40df('0x73')](_0x179865);var _0x1ac31a=_0x29710d[_0x40df('0x74')];var _0x467400=path[_0x40df('0x37')](config[_0x40df('0x75')],_0x40df('0x76'),_0x1ac31a+_0x40df('0x77'));hasTZ=_[_0x40df('0x4f')](_0x179865)[_0x40df('0x78')](_0x40df('0x6f'));var _0x4da5a9=_[_0x40df('0x4f')](_0x179865)[_0x40df('0x37')]();logger['info'](_0x40df('0x79'),_0x4da5a9);db[_0x40df('0x7a')]['findAll']({'raw':!![],'attributes':['id',_0x40df('0x7b')]})[_0x40df('0x18')](function(_0x3656ef){for(var _0x5abaa2=0x0;_0x5abaa2<_0x3656ef[_0x40df('0x19')];_0x5abaa2++){if(_0x3656ef[_0x5abaa2][_0x40df('0x7b')]in _0x179865){contactItemTypes[_0x40df('0x1a')](_0x3656ef[_0x5abaa2]);delete _0x4f34bc[_0x3656ef[_0x5abaa2]['name']];hasAdditionalPhones=!![];}for(var _0x29082e in _0x179865){if(_0x3656ef[_0x5abaa2][_0x40df('0x7b')]+_0x40df('0x7c')===_0x29082e){phoneDescriptions['push']({'itemTypeId':_0x3656ef[_0x5abaa2]['id'],'description':_0x29082e});delete _0x4f34bc[_0x29082e];}}}if(hasAdditionalPhones)_0x4f34bc[_0x40df('0x17')]='';var _0x129b43=_[_0x40df('0x4f')](_0x4f34bc)[_0x40df('0x37')]();logger[_0x40df('0x57')](_0x40df('0x79'),_0x129b43);fs['writeFileSync'](_0x467400,_0x129b43+'\x0a');Papa['parse'](fs[_0x40df('0x7d')](_0x27ac47),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2e65f6,_0x17203c){try{for(var _0x33a9b8=0x0,_0xa2cd58=[];_0x33a9b8<_0x2e65f6[_0x40df('0x7e')][_0x40df('0x19')];_0x33a9b8++){stats[_0x40df('0x7f')]+=0x1;if(_0x2e65f6[_0x40df('0x5a')][_0x33a9b8]){handleError(_0x2e65f6['data'][_0x33a9b8],_0x2e65f6[_0x40df('0x5a')][_0x33a9b8]);}else{var _0x60fb4b=[];var _0x1af52c=[];var _0x4b6156={};for(var _0x4d1283 in _0x179865){let _0x4a0de9=contactItemTypes['find'](_0x1f3837=>_0x1f3837[_0x40df('0x7b')]===_0x4d1283);let _0x56d5e5=contactItemTypes[_0x40df('0x80')](_0x23e6db=>_0x23e6db[_0x40df('0x7b')]+_0x40df('0x7c')===_0x4d1283);if(_[_0x40df('0x6b')](_0x4a0de9)&&_[_0x40df('0x6b')](_0x56d5e5)){if(_0x179865[_0x40df('0x81')](_0x4d1283)){if(_0x2e65f6['data'][_0x33a9b8][_0x179865[_0x4d1283]]){var _0x4ae8de=_[_0x40df('0x82')](_0x2e65f6[_0x40df('0x7e')][_0x33a9b8][_0x179865[_0x4d1283]]['replace'](/"/g,'\x27'));switch(_0x4d1283){case _0x40df('0x2e'):var _0x4d1a58=moment(_0x4ae8de,_0x40df('0xe'),!![]);if(_0x4d1a58[_0x40df('0x83')]()){_0xa2cd58[_0x40df('0x1a')]('\x22'+_0x4ae8de+'\x22');}else{_0x60fb4b['push'](_0x40df('0x84'));}break;case _0x40df('0x33'):var _0x21a22b=parseInt(_0x4ae8de);_0x4ae8de=_[_0x40df('0x85')](_0x21a22b)||_0x21a22b<0x0||_0x21a22b>0x4?_0x2cb5ec?0x3:0x2:_0x21a22b;_0xa2cd58[_0x40df('0x1a')]('\x22'+_0x4ae8de+'\x22');break;case _0x40df('0x34'):var _0x1b8a61=parseInt(_0x4ae8de);if(_[_0x40df('0x86')](_0x1b8a61)&&_[_0x40df('0x78')](_0x660a6c,_0x1b8a61)){_0xa2cd58[_0x40df('0x1a')]('\x22'+_0x1b8a61+'\x22');}else{_0x60fb4b[_0x40df('0x1a')](_0x40df('0x87'));}break;case _0x40df('0x88'):if(isEmail(_0x4ae8de)){_0xa2cd58[_0x40df('0x1a')]('\x22'+_0x4ae8de+'\x22');}else{_0x60fb4b[_0x40df('0x1a')](_0x40df('0x89'));}break;case _0x40df('0x8a'):var _0x283779=moment(_0x4ae8de,_0x40df('0x8b'),!![]);if(_0x283779[_0x40df('0x83')]()){_0xa2cd58['push']('\x22'+_0x4ae8de+'\x22');}else{_0x60fb4b['push'](_0x40df('0x8c'));}break;case _0x40df('0x6f'):var _0x8e6163=shared['timezones'];var _0x2fae6f=_0x8e6163[_0x4ae8de];if(!_['isNil'](_0x2fae6f)){var _0x5d5468=_0x2fae6f[_0x40df('0x6c')];_0xa2cd58[_0x40df('0x1a')]('\x22'+_0x4ae8de+'\x22');_0xa2cd58[_0x40df('0x1a')]('\x22'+_0x5d5468+'\x22');}break;default:_0xa2cd58[_0x40df('0x1a')]('\x22'+_0x4ae8de+'\x22');}}else{switch(_0x4d1283){case _0x40df('0x8d'):case _0x40df('0x43'):_0x60fb4b['push'](_0x4d1283+_0x40df('0x8e'));break;default:_0xa2cd58['push']('\x22\x22');}}}}else{var _0x22250a='';if(!_['isNil'](_0x4a0de9)){if(!_0x4b6156[_0x40df('0x81')](_0x4a0de9['id'])){if(!_['isNil'](_0x2e65f6['data'][_0x33a9b8][_0x179865[_0x4d1283]])){var _0x4ae8de=_[_0x40df('0x82')](_0x2e65f6[_0x40df('0x7e')][_0x33a9b8][_0x179865[_0x4d1283]]['replace'](/"/g,'\x27'));var _0x24d4b4=phoneDescriptions[_0x40df('0x80')](_0x3b4d21=>_0x3b4d21[_0x40df('0x8f')]===_0x4a0de9['id']);if(!_[_0x40df('0x6b')](_0x24d4b4)){var _0x4752bf=_[_0x40df('0x82')](_0x2e65f6[_0x40df('0x7e')][_0x33a9b8][_0x179865[_0x24d4b4['description']]][_0x40df('0x90')](/"/g,'\x27'));if(!_['isNil'](_0x4752bf))_0x4ae8de=_0x4ae8de+'§'+_0x4752bf;}if(_0x22250a=='')_0x22250a=_0x4ae8de;else _0x22250a+='|'+_0x4ae8de;}_0x1af52c['push'](_0x4a0de9['id']+':'+_0x22250a);_0x4b6156[_0x4a0de9['id']]=0x1;}}}}if(hasAdditionalPhones){_0xa2cd58['push']('\x22'+_0x1af52c[_0x40df('0x37')](';')+'\x22');}if(_0x60fb4b[_0x40df('0x19')]){handleError(_0x2e65f6[_0x40df('0x7e')][_0x33a9b8],{'code':'SystemRow','message':_0x60fb4b['join']()});}else{fs[_0x40df('0x91')](_0x467400,_0xa2cd58[_0x40df('0x37')]()+'\x0a');}_0xa2cd58=[];}if(!(stats[_0x40df('0x7f')]%0xc8)){socket[_0x40df('0x92')]('contact:import:'+_0x1ac31a,stats);stats[_0x40df('0x5a')]=[];}}if(stopped){logger[_0x40df('0x57')](_0x40df('0x93'));_0x17203c[_0x40df('0x94')]();}}catch(_0x45ab18){handleError(_0x2e65f6[_0x40df('0x7e')][_0x33a9b8],{'code':_0x40df('0x95'),'message':_0x45ab18['message']});logger[_0x40df('0x5e')](_0x40df('0x96'),_0x45ab18[_0x40df('0x59')]);}},'complete':function(){try{var _0x1cb154=[];var _0x3d4d7f=[];var _0x4d2215=_0x40df('0x38');if(_0x29710d[_0x40df('0x97')]&&_0x29710d['duplicates']['length']){_0x4d2215=_0x40df('0x98')+_0x1ac31a;_0x1cb154[_0x40df('0x1a')](_0x40df('0x99')+_0x4d2215+_0x40df('0x9a'));}tmp_campaigns=_0x40df('0x9b')+_0x1ac31a;tmp_voice_queues='voice_queues_'+_0x1ac31a;_0x3d4d7f[_0x40df('0x1a')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x40df('0x9c'));_0x3d4d7f['push'](_0x40df('0x99')+tmp_voice_queues+_0x40df('0x9c'));BPromise[_0x40df('0x9d')](_0x3d4d7f,handleTZQuery)[_0x40df('0x18')](function(_0x21ecf0){updateTzCampaigns(_0x29710d['ListId'])[_0x40df('0x18')](function(_0x26ea84){updateTzVoiceQueues(_0x29710d['ListId'])[_0x40df('0x18')](function(_0x3f7cac){if(hasTZ)_0x129b43=_0x129b43[_0x40df('0x90')](_0x40df('0x6f'),_0x40df('0x9e'));var _0x40c73b=util[_0x40df('0xd')](_0x40df('0x9f'),_0x467400,_0x4d2215,_0x129b43,_0x29710d[_0x40df('0x30')],_0x29710d[_0x40df('0x50')]||null,NOW,NOW);if(_[_0x40df('0x6b')](_0x179865[_0x40df('0x2e')])){_0x40c73b+=_0x40df('0xa0');}_0x1cb154[_0x40df('0x1a')](_0x40c73b);if(_0x29710d['duplicates']&&_0x29710d[_0x40df('0x97')][_0x40df('0x19')]){_0x1cb154[_0x40df('0x1a')](insertCmContact(_0x29710d['ListId'],_0x4d2215,_0x29710d['duplicates'],_0x179865));_0x1cb154[_0x40df('0x1a')](_0x40df('0xa1')+_0x4d2215+';');}BPromise[_0x40df('0x9d')](_0x1cb154,handleQuery)[_0x40df('0x18')](function(_0x567ee0){BPromise[_0x40df('0x69')]([handleAdditionalPhones()])['then'](function(){_0x1cb154=[];for(var _0x10dc7d=0x0;_0x10dc7d_0x4ba1ac[_0xb9cc('0x74')]===_0xd55cfa);let _0x221fe2=contactItemTypes[_0xb9cc('0x7a')](_0x37dc2f=>_0x37dc2f[_0xb9cc('0x74')]+_0xb9cc('0x75')===_0xd55cfa);if(_[_0xb9cc('0x1d')](_0x18e7c2)&&_[_0xb9cc('0x1d')](_0x221fe2)){if(_0x2ca09e['hasOwnProperty'](_0xd55cfa)){if(_0x5bf1cd[_0xb9cc('0x78')][_0x4442a9][_0x2ca09e[_0xd55cfa]]){var _0x36d712=_[_0xb9cc('0x7b')](_0x5bf1cd['data'][_0x4442a9][_0x2ca09e[_0xd55cfa]][_0xb9cc('0x7c')](/"/g,'\x27'));switch(_0xd55cfa){case'scheduledat':var _0xa08b75=moment(_0x36d712,_0xb9cc('0xb'),!![]);if(_0xa08b75['isValid']()){_0x188691[_0xb9cc('0x19')]('\x22'+_0x36d712+'\x22');}else{_0x27f7b8[_0xb9cc('0x19')](_0xb9cc('0x7d'));}break;case _0xb9cc('0x45'):var _0x4b4205=parseInt(_0x36d712);_0x36d712=_[_0xb9cc('0x7e')](_0x4b4205)||_0x4b4205<0x0||_0x4b4205>0x4?_0x2424f7?0x3:0x2:_0x4b4205;_0x188691[_0xb9cc('0x19')]('\x22'+_0x36d712+'\x22');break;case _0xb9cc('0x31'):var _0x5a6464=parseInt(_0x36d712);if(_['isNumber'](_0x5a6464)&&_[_0xb9cc('0x7f')](_0x4eea24,_0x5a6464)){_0x188691[_0xb9cc('0x19')]('\x22'+_0x5a6464+'\x22');}else{_0x27f7b8[_0xb9cc('0x19')]('agent\x20not\x20exists');}break;case _0xb9cc('0x80'):if(isEmail(_0x36d712)){_0x188691[_0xb9cc('0x19')]('\x22'+_0x36d712+'\x22');}else{_0x27f7b8['push']('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x29a47c=moment(_0x36d712,'YYYY-MM-DD',!![]);if(_0x29a47c[_0xb9cc('0x81')]()){_0x188691['push']('\x22'+_0x36d712+'\x22');}else{_0x27f7b8[_0xb9cc('0x19')](_0xb9cc('0x82'));}break;case _0xb9cc('0x69'):var _0x36a4fd=shared[_0xb9cc('0x68')];var _0x1c7dbe=_0x36a4fd[_0x36d712];if(!_[_0xb9cc('0x1d')](_0x1c7dbe)){var _0x233dbb=_0x1c7dbe[_0xb9cc('0x6a')];_0x188691[_0xb9cc('0x19')]('\x22'+_0x36d712+'\x22');_0x188691[_0xb9cc('0x19')]('\x22'+_0x233dbb+'\x22');}break;default:_0x188691[_0xb9cc('0x19')]('\x22'+_0x36d712+'\x22');}}else{switch(_0xd55cfa){case'firstName':case _0xb9cc('0xe'):_0x27f7b8['push'](_0xd55cfa+_0xb9cc('0x83'));break;default:_0x188691[_0xb9cc('0x19')]('\x22\x22');}}}}else{var _0x180226='';if(!_[_0xb9cc('0x1d')](_0x18e7c2)){if(!_0x17f919[_0xb9cc('0x84')](_0x18e7c2['id'])){if(!_[_0xb9cc('0x1d')](_0x5bf1cd[_0xb9cc('0x78')][_0x4442a9][_0x2ca09e[_0xd55cfa]])){var _0x36d712=_[_0xb9cc('0x7b')](_0x5bf1cd[_0xb9cc('0x78')][_0x4442a9][_0x2ca09e[_0xd55cfa]][_0xb9cc('0x7c')](/"/g,'\x27'));var _0x5522c0=phoneDescriptions[_0xb9cc('0x7a')](_0x10cdba=>_0x10cdba[_0xb9cc('0x85')]===_0x18e7c2['id']);if(!_[_0xb9cc('0x1d')](_0x5522c0)){var _0x25d48b=_['trim'](_0x5bf1cd['data'][_0x4442a9][_0x2ca09e[_0x5522c0[_0xb9cc('0x86')]]]['replace'](/"/g,'\x27'));if(!_[_0xb9cc('0x1d')](_0x25d48b))_0x36d712=_0x36d712+'§'+_0x25d48b;}if(_0x180226=='')_0x180226=_0x36d712;else _0x180226+='|'+_0x36d712;}_0x6eab27[_0xb9cc('0x19')](_0x18e7c2['id']+':'+_0x180226);_0x17f919[_0x18e7c2['id']]=0x1;}}}}if(hasAdditionalPhones){_0x188691[_0xb9cc('0x19')]('\x22'+_0x6eab27[_0xb9cc('0x10')](';')+'\x22');}if(_0x27f7b8[_0xb9cc('0x1c')]){handleError(_0x5bf1cd[_0xb9cc('0x78')][_0x4442a9],{'code':'SystemRow','message':_0x27f7b8[_0xb9cc('0x10')]()});}else{fs[_0xb9cc('0x87')](_0x54b027,_0x188691[_0xb9cc('0x10')]()+'\x0a');}_0x188691=[];}if(!(stats[_0xb9cc('0x79')]%0xc8)){socket[_0xb9cc('0x88')]('contact:import:'+_0x1bad89,stats);stats[_0xb9cc('0x59')]=[];}}if(stopped){logger[_0xb9cc('0x5a')](_0xb9cc('0x89'));_0x22d8fc[_0xb9cc('0x8a')]();}}catch(_0x11e8db){handleError(_0x5bf1cd[_0xb9cc('0x78')][_0x4442a9],{'code':_0xb9cc('0x8b'),'message':_0x11e8db[_0xb9cc('0x58')]});logger[_0xb9cc('0x5f')](_0xb9cc('0x8c'),_0x11e8db[_0xb9cc('0x58')]);}},'complete':function(){try{var _0x24ee41=[];var _0x41d300=[];var _0xa858f1=_0xb9cc('0x32');if(_0x271197[_0xb9cc('0x8d')]&&_0x271197[_0xb9cc('0x8d')]['length']){_0xa858f1=_0xb9cc('0x8e')+_0x1bad89;_0x24ee41['push'](_0xb9cc('0x8f')+_0xa858f1+'\x20LIKE\x20cm_contacts;');}tmp_campaigns='campaigns_'+_0x1bad89;tmp_voice_queues=_0xb9cc('0x90')+_0x1bad89;_0x41d300['push'](_0xb9cc('0x8f')+tmp_campaigns+_0xb9cc('0x91'));_0x41d300[_0xb9cc('0x19')](_0xb9cc('0x8f')+tmp_voice_queues+_0xb9cc('0x91'));BPromise[_0xb9cc('0x92')](_0x41d300,handleTZQuery)['then'](function(_0x3a92ab){updateTzCampaigns(_0x271197[_0xb9cc('0x2e')])[_0xb9cc('0x18')](function(_0x168f7d){updateTzVoiceQueues(_0x271197[_0xb9cc('0x2e')])[_0xb9cc('0x18')](function(_0x1c7be3){if(hasTZ)_0x44f4ce=_0x44f4ce[_0xb9cc('0x7c')](_0xb9cc('0x69'),'dialTimezone,utcOffset');var _0x2d46f0=util[_0xb9cc('0xa')]('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',_0x54b027,_0xa858f1,_0x44f4ce,_0x271197[_0xb9cc('0x2e')],_0x271197['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x2ca09e[_0xb9cc('0x2d')])){_0x2d46f0+=_0xb9cc('0x93');}_0x24ee41[_0xb9cc('0x19')](_0x2d46f0);if(_0x271197[_0xb9cc('0x8d')]&&_0x271197[_0xb9cc('0x8d')][_0xb9cc('0x1c')]){_0x24ee41[_0xb9cc('0x19')](insertCmContact(_0x271197[_0xb9cc('0x2e')],_0xa858f1,_0x271197[_0xb9cc('0x8d')],_0x2ca09e));_0x24ee41[_0xb9cc('0x19')](_0xb9cc('0x94')+_0xa858f1+';');}BPromise['each'](_0x24ee41,handleQuery)['then'](function(_0x4e8029){BPromise[_0xb9cc('0x1a')]([handleAdditionalPhones()])[_0xb9cc('0x18')](function(){_0x24ee41=[];for(var _0x494fbd=0x0;_0x494fbd\x20\x20');}var _0x4e829c=path['join'](config[_0xb9cc('0x71')],_0xb9cc('0xa1'),process['argv'][0x2]);if(!fs['existsSync'](_0x4e829c)){throw new Error(_0xb9cc('0xa2'));}var _0x5f4494={};try{_0x5f4494=JSON[_0xb9cc('0xa3')](process[_0xb9cc('0xa4')][0x3]);if(!_0x5f4494[_0xb9cc('0xa5')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x5f4494['binding'][_0xb9cc('0xe')]){throw new Error(_0xb9cc('0xa6'));}if(!_0x5f4494[_0xb9cc('0xa5')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x56dc85=0x0;if(_0x5f4494['binding']['UserId']){_0x56dc85=0x1;}if(!_0x5f4494['ListId']){throw new Error(_0xb9cc('0xa7'));}}catch(_0x3f6b05){throw new Error('body\x20id\x20mandatory');}var _0x253ab4=[];try{_0x253ab4=_['map'](JSON[_0xb9cc('0xa3')](process['argv'][0x4]),'id');}catch(_0x40a25e){logger[_0xb9cc('0x5a')](_0xb9cc('0xa8'));}main(_0x4e829c,_0x5f4494,_0x253ab4,_0x56dc85);}validate();process['on']('SIGINT',handleStop);process['on'](_0xb9cc('0xa9'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index 453b0b8..d8cc92b 100644 --- a/server/components/import/cm/csvUpdates.js +++ b/server/components/import/cm/csvUpdates.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61d0=['cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','keys','CompanyId','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','errors','code','sequelize','send','start','binding','clone','socket_timestamp','root','ContactItemType','findAll','name','_description','writeFileSync','parse','createReadStream','rows','data','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','find','description','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','contact','contactId','contactTypeId','orderBy','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','moment','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','cm_contacts_temp_','YYYYMMDDHHmmss','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','query','select\x20*\x20from\x20','spread','isNil','phone','push','all','catch','error','message','AdditionalPhones','split','length','then','filter','CmContactHasItem','findOne','update','updated','create','CmContact','CmHopper','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.updatedAt','cm_hopper_black','fields','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy'];(function(_0x227242,_0x1f77a6){var _0x2711e8=function(_0x4b1d73){while(--_0x4b1d73){_0x227242['push'](_0x227242['shift']());}};_0x2711e8(++_0x1f77a6);}(_0x61d0,0x187));var _0x061d=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0x61d0[_0x1ca9e9];return _0x309f3c;};'use strict';var fs=require('fs');var path=require(_0x061d('0x0'));var _=require('lodash');var Papa=require(_0x061d('0x1'));var util=require(_0x061d('0x2'));var BPromise=require('bluebird');var moment=require(_0x061d('0x3'));var squel=require('squel');var Redis=require(_0x061d('0x4'));var db=require(_0x061d('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x061d('0x6'))(_0x061d('0x7'));config[_0x061d('0x8')]=_[_0x061d('0x9')](config[_0x061d('0x8')],{'host':_0x061d('0xa'),'port':0x18eb});var socket=require(_0x061d('0xb'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x061d('0xc')+moment()['format'](_0x061d('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x148e76){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x148e76);}function selectNotIn(_0x295620,_0x1e9b5b,_0x12c87e,_0x30bd01,_0x1ede76){return squel[_0x061d('0xe')]()[_0x061d('0xf')]('phone')[_0x061d('0x10')](_0x30bd01)[_0x061d('0x11')](_0x1e9b5b,null,_0x1e9b5b+_0x061d('0x12')+_0x30bd01+'.'+_0x12c87e)[_0x061d('0x13')](_0x30bd01+'.'+_0x12c87e+_0x061d('0x14')+_0x295620+'.'+_0x12c87e)[_0x061d('0x13')](_0x1e9b5b+_0x061d('0x15')+_0x1ede76[_0x061d('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x46fd62,_0x346aa5){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x061d('0x16')](_0x061d('0x17')+tempTableName)[_0x061d('0x18')](function(_0x4f926b){if(_0x4f926b!==null){var _0x28a1db=[];for(var _0x4fda9e=0x0;_0x4fda9e<_0x4f926b['length'];_0x4fda9e++){var _0x2195fe=_0x4f926b[_0x4fda9e];if(!_[_0x061d('0x19')](_0x2195fe[_0x061d('0x1a')])){if(!_[_0x061d('0x19')](_0x2195fe['AdditionalPhones']))_0x28a1db[_0x061d('0x1b')](insertAdditionalPhones(_0x2195fe));promisesContact[_0x061d('0x1b')]({'contact':_0x2195fe});}}}Promise[_0x061d('0x1c')](_0x28a1db)['then'](function(){_0x46fd62({'val':0x1});});})[_0x061d('0x1d')](function(_0x1ee23c){logger[_0x061d('0x1e')](_0x1ee23c[_0x061d('0x1f')]);});});}function insertAdditionalPhones(_0x4a0615){return new Promise(function(_0x17b8ed,_0x2ffca2){var _0x5be53b=_0x4a0615[_0x061d('0x20')];if(_[_0x061d('0x19')](_0x5be53b))_0x2ffca2({'val':0x0});else{var _0x4b1380=_0x5be53b[_0x061d('0x21')](';');var _0xc3ded6=[];orderBy=0x0;for(var _0x45e2eb=0x0;_0x45e2eb<_0x4b1380[_0x061d('0x22')];_0x45e2eb++){_0xc3ded6[_0x061d('0x1b')](splitAdditionalPhone(_0x4a0615['id'],_0x4b1380[_0x45e2eb]));}Promise['all'](_0xc3ded6)[_0x061d('0x23')](function(){_0x17b8ed({'val':_0x4b1380[_0x061d('0x22')]});});}});}function splitAdditionalPhone(_0x5512f9,_0x40ba43){return new Promise(function(_0x3d5148,_0x5b884a){var _0x5a94bb=_0x40ba43[_0x061d('0x21')](':');var _0x3d9087=_0x5a94bb[0x0];var _0x1f5df7=_0x5a94bb[0x1];if(_0x1f5df7!==''){var _0x2bace6=_0x1f5df7[_0x061d('0x21')]('|');var _0x41e3db=[];for(var _0x5d49d7=0x0;_0x5d49d7<_0x2bace6['length'];_0x5d49d7++){if(_0x2bace6[_0x5d49d7]!==''){var _0x2d189c=_[_0x061d('0x24')](promisesAdditionalPhones,{'contactId':_0x5512f9,'phone':_0x2bace6[_0x5d49d7]});if(_0x2d189c['length']==0x0){orderBy++;promisesAdditionalPhones[_0x061d('0x1b')]({'contactId':_0x5512f9,'contactTypeId':_0x3d9087,'phone':_0x2bace6[_0x5d49d7],'orderBy':orderBy});}}}_0x3d5148({'ok':0x1});}else _0x3d5148({'res':0x0});});}function createAdditionalPhone(_0x4bcb93,_0xed0570,_0x1d3d76,_0x2179d5){var _0x366188='';var _0xc8f0cd='';var _0x30ee72=_0x1d3d76[_0x061d('0x21')]('§');_0x366188=_0x30ee72[0x0];if(_0x30ee72[_0x061d('0x22')]==0x2)_0xc8f0cd=_0x30ee72[0x1];return new Promise(function(_0x429b16,_0x16f00c){return db[_0x061d('0x25')][_0x061d('0x26')]({'where':{'CmContactId':_0x4bcb93,'item':_0x366188}})['then'](function(_0x17fd4a){if(_0x17fd4a){return db[_0x061d('0x25')][_0x061d('0x27')]({'ItemTypeId':_0xed0570,'description':_0xc8f0cd,'OrderBy':_0x2179d5},{'where':{'CmContactId':_0x4bcb93,'item':_0x366188}})[_0x061d('0x23')](function(_0x545d34){_0x429b16({'res':_0x061d('0x28')});});}else{return db['CmContactHasItem'][_0x061d('0x29')]({'CmContactId':_0x4bcb93,'item':_0x366188,'ItemTypeId':_0xed0570,'description':_0xc8f0cd,'OrderBy':_0x2179d5,'ItemClass':'PHONE'})[_0x061d('0x23')](function(_0x3c00c0){_0x429b16({'res':'inserted'});});}});});}function updateContact(_0x3b32e0){return new Promise(function(_0x4a9983,_0x12b4c3){var _0x3376fe=_0x3b32e0['id'];delete _0x3b32e0['id'];return db[_0x061d('0x2a')][_0x061d('0x27')](_0x3b32e0,{'where':{'id':_0x3376fe}})[_0x061d('0x23')](function(_0x5a46a8){updatedRows+=0x1;return db[_0x061d('0x2b')][_0x061d('0x27')]({'phone':_0x3b32e0[_0x061d('0x1a')]},{'where':{'ContactId':_0x3376fe}})[_0x061d('0x23')](function(_0x6f67f7){_0x4a9983({'ret':'OK'});});});});}function insertCmHopper(_0x1db6cf,_0x1a4be3,_0x48838e,_0x3e79d7,_0xcf4749){var _0x4ebdb6=[_0x061d('0x2c'),'cm_contacts.scheduledat',_0x061d('0x2d'),_0x061d('0x2e'),_0x1a4be3+'.'+_0x3e79d7,_0x061d('0x2f'),'cm_contacts.updatedAt',_0x061d('0x30'),_0x061d('0x31'),'\x22'+_0xcf4749+'\x22'];return squel[_0x061d('0x32')]()[_0x061d('0x33')]('cm_hopper')[_0x061d('0x34')]([_0x061d('0x1a'),_0x061d('0x35'),_0x061d('0x36'),_0x061d('0x37'),_0x3e79d7,_0x061d('0x38'),_0x061d('0x39'),_0x061d('0x3a'),_0x061d('0x3b'),'recallme'],squel[_0x061d('0xe')]()['fields'](_0x4ebdb6)[_0x061d('0x10')](_0x1a4be3)['join'](_0x061d('0x3c'),null,_0x061d('0x3d')+_0x1a4be3+'.CmListId')['join'](_0x48838e,null,_0x48838e+'.id\x20=\x20'+_0x1a4be3+'.'+_0x3e79d7)[_0x061d('0x13')](_0x1a4be3+_0x061d('0x3e'),_0x1db6cf)['where'](_0x061d('0x3f'),NOW)[_0x061d('0x13')](_0x061d('0x40'),selectNotIn(_0x1a4be3,_0x48838e,_0x3e79d7,_0x061d('0x41'),[_0x061d('0x42'),_0x061d('0x43')]))[_0x061d('0x13')](_0x061d('0x40'),selectNotIn(_0x1a4be3,_0x48838e,_0x3e79d7,_0x061d('0x41'),['\x22always\x22'])))[_0x061d('0x44')]();}function insertCmHopperBlack(_0x53dbf2,_0x37397b,_0x17daf9,_0xd6ce34){var _0x4f948d=[_0x061d('0x2c'),_0x061d('0x2d'),_0x061d('0x2e'),_0x37397b+'.'+_0xd6ce34,'cm_contacts.createdAt',_0x061d('0x45')];return squel[_0x061d('0x32')]()[_0x061d('0x33')](_0x061d('0x46'))[_0x061d('0x34')]([_0x061d('0x1a'),_0x061d('0x36'),_0x061d('0x37'),_0xd6ce34,_0x061d('0x38'),_0x061d('0x39')],squel[_0x061d('0xe')]()[_0x061d('0x47')](_0x4f948d)[_0x061d('0x10')](_0x37397b)['join']('cm_contacts',null,_0x061d('0x3d')+_0x37397b+'.CmListId')[_0x061d('0x11')](_0x17daf9,null,_0x17daf9+_0x061d('0x12')+_0x37397b+'.'+_0xd6ce34)[_0x061d('0x13')](_0x37397b+_0x061d('0x3e'),_0x53dbf2)[_0x061d('0x13')](_0x061d('0x3f'),NOW)[_0x061d('0x13')](_0x061d('0x40'),squel[_0x061d('0xe')]()['field']('phone')['from'](_0x061d('0x46'))[_0x061d('0x13')](_0x061d('0x48'),_0x53dbf2)[_0x061d('0x13')](_0xd6ce34+_0x061d('0x49'),_0x37397b+'.'+_0xd6ce34)))[_0x061d('0x44')]();}function insertCmHopperAdditionalPhones(_0x3a06bb){var _0x1e3871=['cm_hopper.id',_0x061d('0x4a'),'cm_contact_has_items.OrderBy',_0x061d('0x4b'),_0x061d('0x4c')];return squel[_0x061d('0x32')]()[_0x061d('0x33')](_0x061d('0x4d'))[_0x061d('0x34')]([_0x061d('0x4e'),_0x061d('0x1a'),_0x061d('0x4f'),_0x061d('0x38'),'updatedAt'],squel['select']()[_0x061d('0x47')](_0x1e3871)[_0x061d('0x10')](_0x061d('0x41'))['join']('cm_contacts',null,_0x061d('0x50'))[_0x061d('0x11')](_0x061d('0x51'),null,_0x061d('0x52'))['where']('cm_hopper.ListId\x20=\x20?',_0x3a06bb)[_0x061d('0x13')](_0x061d('0x3f'),NOW))[_0x061d('0x44')]();}function insertCmContact(_0xb3051f,_0x474c08,_0x5d2f11,_0x55358b){var _0x4c785b=_['concat'](_[_0x061d('0x53')](_0x55358b),[_0x061d('0x37'),_0x061d('0x54'),_0x061d('0x38'),_0x061d('0x39')]);return squel[_0x061d('0x32')]()[_0x061d('0x33')]('cm_contacts')[_0x061d('0x34')](_0x4c785b,squel[_0x061d('0xe')]()[_0x061d('0x47')](_0x4c785b)[_0x061d('0x10')](_0x474c08)[_0x061d('0x13')]('('+_0x5d2f11[_0x061d('0x11')](',')+')\x20NOT\x20IN\x20?',squel[_0x061d('0xe')]()[_0x061d('0x47')](_0x5d2f11)[_0x061d('0x10')](_0x061d('0x3c'))['where'](_0x061d('0x48'),_0xb3051f))['where'](_0x061d('0x55'),squel[_0x061d('0xe')]()[_0x061d('0xf')]('MIN(id)',_0x061d('0x56'))['from'](_0x474c08)[_0x061d('0x57')](_0x5d2f11[_0x061d('0x11')](','))))[_0x061d('0x44')]();}function handleStop(){logger[_0x061d('0x58')](_0x061d('0x59'));stopped=!![];}function handleUncaughtException(_0x41a215){logger[_0x061d('0x1e')](_0x41a215[_0x061d('0x1f')]);process['exit'](0x1);}function handleError(_0x5b34b1,_0x96971e){stats[_0x061d('0x5a')][_0x061d('0x1b')]({'name':_0x96971e[_0x061d('0x5b')],'message':_0x96971e[_0x061d('0x1f')],'row':_0x5b34b1});}function handleQuery(_0x2ca812){logger['info'](_0x2ca812);return db[_0x061d('0x5c')][_0x061d('0x16')](_0x2ca812)['spread'](function(_0x195e04){results[_0x061d('0x1b')](_0x195e04);})['catch'](function(_0x2d2067){logger[_0x061d('0x1e')](_0x2d2067[_0x061d('0x1f')]);});}function main(_0x2a78e9,_0x5839c2,_0x28f5f5,_0x437a8d){logger[_0x061d('0x58')]('main',_0x2a78e9,JSON['stringify'](_0x5839c2));process[_0x061d('0x5d')](_0x061d('0x5e'));var _0x24e924=_0x5839c2[_0x061d('0x5f')];var _0x3c9bfe=_[_0x061d('0x60')](_0x24e924);var _0x3bdb6f=_0x5839c2[_0x061d('0x61')];var _0xc21481=path[_0x061d('0x11')](config[_0x061d('0x62')],'server/files/tmp',_0x3bdb6f+'.csv');logger['info']('body',_0x5839c2);db[_0x061d('0x63')][_0x061d('0x64')]({'raw':!![],'attributes':['id','name']})[_0x061d('0x23')](function(_0xb9e929){for(var _0x5762a9=0x0;_0x5762a9<_0xb9e929[_0x061d('0x22')];_0x5762a9++){if(_0xb9e929[_0x5762a9][_0x061d('0x65')]in _0x24e924){contactItemTypes[_0x061d('0x1b')](_0xb9e929[_0x5762a9]);delete _0x3c9bfe[_0xb9e929[_0x5762a9][_0x061d('0x65')]];hasAdditionalPhones=!![];}for(var _0x27de9b in _0x24e924){if(_0xb9e929[_0x5762a9]['name']+_0x061d('0x66')===_0x27de9b){phoneDescriptions[_0x061d('0x1b')]({'itemTypeId':_0xb9e929[_0x5762a9]['id'],'description':_0x27de9b});delete _0x3c9bfe[_0x27de9b];}}}if(hasAdditionalPhones)_0x3c9bfe['AdditionalPhones']='';var _0x1ff824=_['keys'](_0x3c9bfe)['join']();logger[_0x061d('0x58')]('header',_0x1ff824);fs[_0x061d('0x67')](_0xc21481,_0x1ff824+'\x0a');Papa[_0x061d('0x68')](fs[_0x061d('0x69')](_0x2a78e9),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3ff255,_0x19ebbe){try{for(var _0x10eef5=0x0,_0x21355f=[];_0x10eef5<_0x3ff255['data'][_0x061d('0x22')];_0x10eef5++){stats[_0x061d('0x6a')]+=0x1;if(_0x3ff255['errors'][_0x10eef5]){handleError(_0x3ff255[_0x061d('0x6b')][_0x10eef5],_0x3ff255['errors'][_0x10eef5]);}else{var _0x50fba5=[];var _0x17acac=[];var _0x578f01={};for(var _0x514710 in _0x24e924){let _0x24d5c9=contactItemTypes['find'](_0x5f2270=>_0x5f2270[_0x061d('0x65')]===_0x514710);let _0x45194c=contactItemTypes['find'](_0x31a4e8=>_0x31a4e8[_0x061d('0x65')]+'_description'===_0x514710);if(_[_0x061d('0x19')](_0x24d5c9)&&_['isNil'](_0x45194c)){if(_0x24e924[_0x061d('0x6c')](_0x514710)){if(_0x3ff255['data'][_0x10eef5][_0x24e924[_0x514710]]){var _0x4aa129=_[_0x061d('0x6d')](_0x3ff255[_0x061d('0x6b')][_0x10eef5][_0x24e924[_0x514710]][_0x061d('0x6e')](/"/g,'\x27'));switch(_0x514710){case _0x061d('0x35'):var _0x3ac594=moment(_0x4aa129,_0x061d('0x6f'),!![]);if(_0x3ac594[_0x061d('0x70')]()){_0x21355f[_0x061d('0x1b')]('\x22'+_0x4aa129+'\x22');}else{_0x50fba5[_0x061d('0x1b')](_0x061d('0x71'));}break;case _0x061d('0x3a'):var _0x3a9637=parseInt(_0x4aa129);_0x4aa129=_[_0x061d('0x72')](_0x3a9637)||_0x3a9637<0x0||_0x3a9637>0x4?_0x437a8d?0x3:0x2:_0x3a9637;_0x21355f[_0x061d('0x1b')]('\x22'+_0x4aa129+'\x22');break;case _0x061d('0x3b'):var _0x11a8fc=parseInt(_0x4aa129);if(_[_0x061d('0x73')](_0x11a8fc)&&_[_0x061d('0x74')](_0x28f5f5,_0x11a8fc)){_0x21355f['push']('\x22'+_0x11a8fc+'\x22');}else{_0x50fba5[_0x061d('0x1b')](_0x061d('0x75'));}break;case _0x061d('0x76'):if(isEmail(_0x4aa129)){_0x21355f[_0x061d('0x1b')]('\x22'+_0x4aa129+'\x22');}else{_0x50fba5[_0x061d('0x1b')]('email\x20wrong\x20format');}break;case _0x061d('0x77'):var _0x4b6a30=moment(_0x4aa129,'YYYY-MM-DD',!![]);if(_0x4b6a30['isValid']()){_0x21355f[_0x061d('0x1b')]('\x22'+_0x4aa129+'\x22');}else{_0x50fba5['push'](_0x061d('0x78'));}break;default:_0x21355f[_0x061d('0x1b')]('\x22'+_0x4aa129+'\x22');}}else{switch(_0x514710){case _0x061d('0x79'):case _0x061d('0x1a'):_0x50fba5[_0x061d('0x1b')](_0x514710+_0x061d('0x7a'));break;default:_0x21355f['push']('\x22\x22');}}}}else{var _0x26367e='';if(!_[_0x061d('0x19')](_0x24d5c9)){if(!_0x578f01[_0x061d('0x6c')](_0x24d5c9['id'])){for(var _0x1f0a6f=0x0;_0x1f0a6f<_0x24e924[_0x514710][_0x061d('0x22')];_0x1f0a6f++){var _0x4aa129=_[_0x061d('0x6d')](_0x3ff255[_0x061d('0x6b')][_0x10eef5][_0x24e924[_0x514710][_0x1f0a6f]][_0x061d('0x6e')](/"/g,'\x27'));var _0x7f6a13=phoneDescriptions[_0x061d('0x7b')](_0x3c867d=>_0x3c867d['itemTypeId']===_0x24d5c9['id']);if(!_['isNil'](_0x7f6a13)){var _0x3b32f9=_['trim'](_0x3ff255[_0x061d('0x6b')][_0x10eef5][_0x24e924[_0x7f6a13[_0x061d('0x7c')]][0x0]][_0x061d('0x6e')](/"/g,'\x27'));if(!_[_0x061d('0x19')](_0x3b32f9))_0x4aa129=_0x4aa129+'§'+_0x3b32f9;}if(_0x26367e=='')_0x26367e=_0x4aa129;else _0x26367e+='|'+_0x4aa129;}_0x17acac[_0x061d('0x1b')](_0x24d5c9['id']+':'+_0x26367e);_0x578f01[_0x24d5c9['id']]=0x1;}}}}if(hasAdditionalPhones){_0x21355f[_0x061d('0x1b')]('\x22'+_0x17acac['join'](';')+'\x22');}if(_0x50fba5[_0x061d('0x22')]){handleError(_0x3ff255['data'][_0x10eef5],{'code':_0x061d('0x7d'),'message':_0x50fba5[_0x061d('0x11')]()});}else{fs[_0x061d('0x7e')](_0xc21481,_0x21355f[_0x061d('0x11')]()+'\x0a');}_0x21355f=[];}if(!(stats[_0x061d('0x6a')]%0xc8)){socket[_0x061d('0x7f')](_0x061d('0x80')+_0x3bdb6f,stats);stats[_0x061d('0x5a')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x19ebbe[_0x061d('0x81')]();}}catch(_0x580b83){handleError(_0x3ff255[_0x061d('0x6b')][_0x10eef5],{'code':_0x061d('0x82'),'message':_0x580b83[_0x061d('0x1f')]});logger['error'](_0x061d('0x83'),_0x580b83[_0x061d('0x1f')]);}},'complete':function(){try{var _0x5d6cef=[];var _0x3f8dae=tempTableName;_0x5d6cef[_0x061d('0x1b')](_0x061d('0x84')+_0x3f8dae+_0x061d('0x85'));logger[_0x061d('0x58')](_0x061d('0x86'),contactItemTypes['length']);var _0x31a572=util['format'](_0x061d('0x87'),_0xc21481,_0x3f8dae,_0x1ff824,_0x5839c2[_0x061d('0x37')],_0x5839c2[_0x061d('0x54')]||null,NOW,NOW);if(_[_0x061d('0x19')](_0x24e924['scheduledat'])){_0x31a572+=_0x061d('0x88');}_0x5d6cef['push'](_0x31a572);BPromise['each'](_0x5d6cef,handleQuery)['then'](function(_0x4372d7){BPromise['all']([handleAdditionalPhones()])[_0x061d('0x23')](function(){_0x5d6cef=[];for(var _0x349f88=0x0;_0x349f88\x20\x20','existsSync','file\x20doesn\x27t\x20exists','map','SIGINT','uncaughtException','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','length','isNil','phone','AdditionalPhones','push','catch','error','message','split','all','then','filter','CmContactHasItem','update','updated','create','inserted','CmContact','CmHopper','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_contacts.createdAt','cm_contacts.updatedAt','insert','cm_hopper_black','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_hopper.ListId\x20=\x20?','CompanyId','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','exit','errors','code','spread','main','stringify','send','start'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xb5a4,0x17d));var _0x4b5a=function(_0x2fa2ad,_0x6f1532){_0x2fa2ad=_0x2fa2ad-0x0;var _0x502023=_0xb5a4[_0x2fa2ad];return _0x502023;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x4b5a('0x0'));var Papa=require(_0x4b5a('0x1'));var util=require(_0x4b5a('0x2'));var BPromise=require('bluebird');var moment=require(_0x4b5a('0x3'));var squel=require(_0x4b5a('0x4'));var Redis=require(_0x4b5a('0x5'));var db=require(_0x4b5a('0x6'))['db'];var config=require(_0x4b5a('0x7'));var logger=require(_0x4b5a('0x8'))(_0x4b5a('0x9'));config[_0x4b5a('0xa')]=_[_0x4b5a('0xb')](config['redis'],{'host':_0x4b5a('0xc'),'port':0x18eb});var socket=require(_0x4b5a('0xd'))(new Redis(config[_0x4b5a('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x4b5a('0xe')](_0x4b5a('0xf'));var tempTableName=_0x4b5a('0x10')+moment()[_0x4b5a('0xe')](_0x4b5a('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x5b8213){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))*$/[_0x4b5a('0x12')](_0x5b8213);}function selectNotIn(_0x53f6cd,_0x59395e,_0x1637f4,_0x57b03a,_0x191734){return squel[_0x4b5a('0x13')]()[_0x4b5a('0x14')]('phone')['from'](_0x57b03a)[_0x4b5a('0x15')](_0x59395e,null,_0x59395e+_0x4b5a('0x16')+_0x57b03a+'.'+_0x1637f4)[_0x4b5a('0x17')](_0x57b03a+'.'+_0x1637f4+_0x4b5a('0x18')+_0x53f6cd+'.'+_0x1637f4)[_0x4b5a('0x17')](_0x59395e+_0x4b5a('0x19')+_0x191734['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x50d548,_0x245e99){promisesAdditionalPhones=[];promisesContact=[];return db[_0x4b5a('0x1a')][_0x4b5a('0x1b')]('select\x20*\x20from\x20'+tempTableName)['spread'](function(_0x240552){if(_0x240552!==null){var _0x4fc505=[];for(var _0x3b972d=0x0;_0x3b972d<_0x240552[_0x4b5a('0x1c')];_0x3b972d++){var _0x4f95e2=_0x240552[_0x3b972d];if(!_[_0x4b5a('0x1d')](_0x4f95e2[_0x4b5a('0x1e')])){if(!_[_0x4b5a('0x1d')](_0x4f95e2[_0x4b5a('0x1f')]))_0x4fc505[_0x4b5a('0x20')](insertAdditionalPhones(_0x4f95e2));promisesContact['push']({'contact':_0x4f95e2});}}}Promise['all'](_0x4fc505)['then'](function(){_0x50d548({'val':0x1});});})[_0x4b5a('0x21')](function(_0x3e261e){logger[_0x4b5a('0x22')](_0x3e261e[_0x4b5a('0x23')]);});});}function insertAdditionalPhones(_0x402eb1){return new Promise(function(_0x5140c1,_0x2d7386){var _0x3e504c=_0x402eb1[_0x4b5a('0x1f')];if(_[_0x4b5a('0x1d')](_0x3e504c))_0x2d7386({'val':0x0});else{var _0x485a33=_0x3e504c[_0x4b5a('0x24')](';');var _0x36952f=[];orderBy=0x0;for(var _0x2d4899=0x0;_0x2d4899<_0x485a33['length'];_0x2d4899++){_0x36952f[_0x4b5a('0x20')](splitAdditionalPhone(_0x402eb1['id'],_0x485a33[_0x2d4899]));}Promise[_0x4b5a('0x25')](_0x36952f)[_0x4b5a('0x26')](function(){_0x5140c1({'val':_0x485a33[_0x4b5a('0x1c')]});});}});}function splitAdditionalPhone(_0x3ec6f3,_0x4aa921){return new Promise(function(_0x1938f2,_0x9bcf2){var _0x60f7f5=_0x4aa921['split'](':');var _0x23d677=_0x60f7f5[0x0];var _0x2d4fc8=_0x60f7f5[0x1];if(_0x2d4fc8!==''){var _0x49887a=_0x2d4fc8[_0x4b5a('0x24')]('|');var _0xbe520e=[];for(var _0x561f0f=0x0;_0x561f0f<_0x49887a[_0x4b5a('0x1c')];_0x561f0f++){if(_0x49887a[_0x561f0f]!==''){var _0x2036c2=_[_0x4b5a('0x27')](promisesAdditionalPhones,{'contactId':_0x3ec6f3,'phone':_0x49887a[_0x561f0f]});if(_0x2036c2[_0x4b5a('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0x4b5a('0x20')]({'contactId':_0x3ec6f3,'contactTypeId':_0x23d677,'phone':_0x49887a[_0x561f0f],'orderBy':orderBy});}}}_0x1938f2({'ok':0x1});}else _0x1938f2({'res':0x0});});}function createAdditionalPhone(_0x245054,_0x4902ba,_0x517d99,_0x41ba9e){var _0x399db1='';var _0x3b2ba5='';var _0x51c187=_0x517d99['split']('§');_0x399db1=_0x51c187[0x0];if(_0x51c187[_0x4b5a('0x1c')]==0x2)_0x3b2ba5=_0x51c187[0x1];return new Promise(function(_0x448e94,_0x133932){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x245054,'item':_0x399db1}})['then'](function(_0x282cc1){if(_0x282cc1){return db[_0x4b5a('0x28')][_0x4b5a('0x29')]({'ItemTypeId':_0x4902ba,'description':_0x3b2ba5,'OrderBy':_0x41ba9e},{'where':{'CmContactId':_0x245054,'item':_0x399db1}})[_0x4b5a('0x26')](function(_0x2f9507){_0x448e94({'res':_0x4b5a('0x2a')});});}else{return db[_0x4b5a('0x28')][_0x4b5a('0x2b')]({'CmContactId':_0x245054,'item':_0x399db1,'ItemTypeId':_0x4902ba,'description':_0x3b2ba5,'OrderBy':_0x41ba9e,'ItemClass':'PHONE'})[_0x4b5a('0x26')](function(_0x2a0d84){_0x448e94({'res':_0x4b5a('0x2c')});});}});});}function updateContact(_0x7bab9c){return new Promise(function(_0x36cf86,_0x22050f){var _0x41e336=_0x7bab9c['id'];delete _0x7bab9c['id'];return db[_0x4b5a('0x2d')][_0x4b5a('0x29')](_0x7bab9c,{'where':{'id':_0x41e336}})['then'](function(_0x2b2283){updatedRows+=0x1;return db[_0x4b5a('0x2e')][_0x4b5a('0x29')]({'phone':_0x7bab9c['phone']},{'where':{'ContactId':_0x41e336}})['then'](function(_0x3604c){_0x36cf86({'ret':'OK'});});});});}function insertCmHopper(_0x5b38a0,_0x57489c,_0x3a6a76,_0x1e90e8,_0x4aec39){var _0x52b000=['cm_contacts.phone',_0x4b5a('0x2f'),_0x4b5a('0x30'),_0x4b5a('0x31'),_0x57489c+'.'+_0x1e90e8,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x4b5a('0x32'),_0x4b5a('0x33'),'\x22'+_0x4aec39+'\x22'];return squel['insert']()[_0x4b5a('0x34')](_0x4b5a('0x35'))[_0x4b5a('0x36')]([_0x4b5a('0x1e'),_0x4b5a('0x37'),_0x4b5a('0x38'),_0x4b5a('0x39'),_0x1e90e8,_0x4b5a('0x3a'),_0x4b5a('0x3b'),_0x4b5a('0x3c'),_0x4b5a('0x3d'),_0x4b5a('0x3e')],squel['select']()[_0x4b5a('0x3f')](_0x52b000)[_0x4b5a('0x40')](_0x57489c)[_0x4b5a('0x15')](_0x4b5a('0x41'),null,_0x4b5a('0x42')+_0x57489c+_0x4b5a('0x43'))[_0x4b5a('0x15')](_0x3a6a76,null,_0x3a6a76+'.id\x20=\x20'+_0x57489c+'.'+_0x1e90e8)[_0x4b5a('0x17')](_0x57489c+_0x4b5a('0x44'),_0x5b38a0)['where'](_0x4b5a('0x45'),NOW)['where'](_0x4b5a('0x46'),selectNotIn(_0x57489c,_0x3a6a76,_0x1e90e8,_0x4b5a('0x35'),[_0x4b5a('0x47'),_0x4b5a('0x48')]))[_0x4b5a('0x17')](_0x4b5a('0x46'),selectNotIn(_0x57489c,_0x3a6a76,_0x1e90e8,_0x4b5a('0x35'),['\x22always\x22'])))[_0x4b5a('0x49')]();}function insertCmHopperBlack(_0x3ea009,_0x181fd6,_0x5b786a,_0x3e004f){var _0x5db1ca=[_0x4b5a('0x4a'),_0x4b5a('0x30'),_0x4b5a('0x31'),_0x181fd6+'.'+_0x3e004f,_0x4b5a('0x4b'),_0x4b5a('0x4c')];return squel[_0x4b5a('0x4d')]()[_0x4b5a('0x34')](_0x4b5a('0x4e'))[_0x4b5a('0x36')]([_0x4b5a('0x1e'),_0x4b5a('0x38'),_0x4b5a('0x39'),_0x3e004f,_0x4b5a('0x3a'),_0x4b5a('0x3b')],squel[_0x4b5a('0x13')]()[_0x4b5a('0x3f')](_0x5db1ca)[_0x4b5a('0x40')](_0x181fd6)[_0x4b5a('0x15')]('cm_contacts',null,_0x4b5a('0x42')+_0x181fd6+_0x4b5a('0x43'))[_0x4b5a('0x15')](_0x5b786a,null,_0x5b786a+_0x4b5a('0x16')+_0x181fd6+'.'+_0x3e004f)[_0x4b5a('0x17')](_0x181fd6+'.CmListId\x20=\x20?',_0x3ea009)[_0x4b5a('0x17')](_0x4b5a('0x45'),NOW)['where'](_0x4b5a('0x46'),squel[_0x4b5a('0x13')]()[_0x4b5a('0x14')](_0x4b5a('0x1e'))['from']('cm_hopper_black')[_0x4b5a('0x17')]('ListId\x20=\x20?',_0x3ea009)[_0x4b5a('0x17')](_0x3e004f+_0x4b5a('0x4f'),_0x181fd6+'.'+_0x3e004f)))[_0x4b5a('0x49')]();}function insertCmHopperAdditionalPhones(_0xfb5f5c){var _0x27c846=[_0x4b5a('0x50'),_0x4b5a('0x51'),_0x4b5a('0x52'),_0x4b5a('0x53'),_0x4b5a('0x54')];return squel[_0x4b5a('0x4d')]()[_0x4b5a('0x34')](_0x4b5a('0x55'))[_0x4b5a('0x36')]([_0x4b5a('0x56'),_0x4b5a('0x1e'),_0x4b5a('0x57'),_0x4b5a('0x3a'),'updatedAt'],squel['select']()[_0x4b5a('0x3f')](_0x27c846)['from']('cm_hopper')[_0x4b5a('0x15')](_0x4b5a('0x41'),null,_0x4b5a('0x58'))[_0x4b5a('0x15')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x4b5a('0x17')](_0x4b5a('0x59'),_0xfb5f5c)[_0x4b5a('0x17')](_0x4b5a('0x45'),NOW))[_0x4b5a('0x49')]();}function insertCmContact(_0x236ca4,_0x220fe4,_0x1be47f,_0x46d4e8){var _0x503616=_['concat'](_['keys'](_0x46d4e8),['ListId',_0x4b5a('0x5a'),_0x4b5a('0x3a'),'updatedAt']);return squel[_0x4b5a('0x4d')]()[_0x4b5a('0x34')]('cm_contacts')[_0x4b5a('0x36')](_0x503616,squel[_0x4b5a('0x13')]()[_0x4b5a('0x3f')](_0x503616)[_0x4b5a('0x40')](_0x220fe4)[_0x4b5a('0x17')]('('+_0x1be47f[_0x4b5a('0x15')](',')+')\x20NOT\x20IN\x20?',squel[_0x4b5a('0x13')]()[_0x4b5a('0x3f')](_0x1be47f)[_0x4b5a('0x40')](_0x4b5a('0x41'))[_0x4b5a('0x17')](_0x4b5a('0x5b'),_0x236ca4))[_0x4b5a('0x17')](_0x4b5a('0x5c'),squel['select']()[_0x4b5a('0x14')](_0x4b5a('0x5d'),_0x4b5a('0x5e'))['from'](_0x220fe4)['group'](_0x1be47f[_0x4b5a('0x15')](','))))[_0x4b5a('0x49')]();}function handleStop(){logger[_0x4b5a('0x5f')](_0x4b5a('0x60'));stopped=!![];}function handleUncaughtException(_0x4bea3e){logger[_0x4b5a('0x22')](_0x4bea3e[_0x4b5a('0x23')]);process[_0x4b5a('0x61')](0x1);}function handleError(_0x2e9880,_0xd9cf1f){stats[_0x4b5a('0x62')]['push']({'name':_0xd9cf1f[_0x4b5a('0x63')],'message':_0xd9cf1f[_0x4b5a('0x23')],'row':_0x2e9880});}function handleQuery(_0x6f50ff){logger[_0x4b5a('0x5f')](_0x6f50ff);return db[_0x4b5a('0x1a')]['query'](_0x6f50ff)[_0x4b5a('0x64')](function(_0x4ed25b){results[_0x4b5a('0x20')](_0x4ed25b);})[_0x4b5a('0x21')](function(_0x292178){logger[_0x4b5a('0x22')](_0x292178[_0x4b5a('0x23')]);});}function main(_0x74569d,_0x4caa12,_0x317828,_0x430336){logger[_0x4b5a('0x5f')](_0x4b5a('0x65'),_0x74569d,JSON[_0x4b5a('0x66')](_0x4caa12));process[_0x4b5a('0x67')](_0x4b5a('0x68'));var _0x527f29=_0x4caa12[_0x4b5a('0x69')];var _0x594405=_[_0x4b5a('0x6a')](_0x527f29);var _0x1e97fd=_0x4caa12['socket_timestamp'];var _0x33cbc6=path[_0x4b5a('0x15')](config[_0x4b5a('0x6b')],_0x4b5a('0x6c'),_0x1e97fd+_0x4b5a('0x6d'));logger['info'](_0x4b5a('0x6e'),_0x4caa12);db['ContactItemType'][_0x4b5a('0x6f')]({'raw':!![],'attributes':['id',_0x4b5a('0x70')]})[_0x4b5a('0x26')](function(_0x32778e){for(var _0x195b04=0x0;_0x195b04<_0x32778e['length'];_0x195b04++){if(_0x32778e[_0x195b04][_0x4b5a('0x70')]in _0x527f29){contactItemTypes[_0x4b5a('0x20')](_0x32778e[_0x195b04]);delete _0x594405[_0x32778e[_0x195b04][_0x4b5a('0x70')]];hasAdditionalPhones=!![];}for(var _0x357730 in _0x527f29){if(_0x32778e[_0x195b04]['name']+_0x4b5a('0x71')===_0x357730){phoneDescriptions['push']({'itemTypeId':_0x32778e[_0x195b04]['id'],'description':_0x357730});delete _0x594405[_0x357730];}}}if(hasAdditionalPhones)_0x594405['AdditionalPhones']='';var _0x38201c=_[_0x4b5a('0x72')](_0x594405)[_0x4b5a('0x15')]();logger[_0x4b5a('0x5f')]('header',_0x38201c);fs[_0x4b5a('0x73')](_0x33cbc6,_0x38201c+'\x0a');Papa[_0x4b5a('0x74')](fs[_0x4b5a('0x75')](_0x74569d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x538deb,_0x1cb017){try{for(var _0xb9b311=0x0,_0x58cb97=[];_0xb9b311<_0x538deb['data']['length'];_0xb9b311++){stats[_0x4b5a('0x76')]+=0x1;if(_0x538deb[_0x4b5a('0x62')][_0xb9b311]){handleError(_0x538deb[_0x4b5a('0x77')][_0xb9b311],_0x538deb[_0x4b5a('0x62')][_0xb9b311]);}else{var _0x440b37=[];var _0x224dd4=[];var _0x3de8ea={};for(var _0x10c40a in _0x527f29){let _0x3995a9=contactItemTypes[_0x4b5a('0x78')](_0x1f4770=>_0x1f4770[_0x4b5a('0x70')]===_0x10c40a);let _0x298d37=contactItemTypes[_0x4b5a('0x78')](_0x2447e2=>_0x2447e2[_0x4b5a('0x70')]+_0x4b5a('0x71')===_0x10c40a);if(_[_0x4b5a('0x1d')](_0x3995a9)&&_['isNil'](_0x298d37)){if(_0x527f29['hasOwnProperty'](_0x10c40a)){if(_0x538deb[_0x4b5a('0x77')][_0xb9b311][_0x527f29[_0x10c40a]]){var _0x45920c=_[_0x4b5a('0x79')](_0x538deb['data'][_0xb9b311][_0x527f29[_0x10c40a]]['replace'](/"/g,'\x27'));switch(_0x10c40a){case _0x4b5a('0x37'):var _0x4dca61=moment(_0x45920c,_0x4b5a('0xf'),!![]);if(_0x4dca61[_0x4b5a('0x7a')]()){_0x58cb97[_0x4b5a('0x20')]('\x22'+_0x45920c+'\x22');}else{_0x440b37['push'](_0x4b5a('0x7b'));}break;case _0x4b5a('0x3c'):var _0xc83921=parseInt(_0x45920c);_0x45920c=_[_0x4b5a('0x7c')](_0xc83921)||_0xc83921<0x0||_0xc83921>0x4?_0x430336?0x3:0x2:_0xc83921;_0x58cb97['push']('\x22'+_0x45920c+'\x22');break;case _0x4b5a('0x3d'):var _0x2f42e2=parseInt(_0x45920c);if(_['isNumber'](_0x2f42e2)&&_[_0x4b5a('0x7d')](_0x317828,_0x2f42e2)){_0x58cb97['push']('\x22'+_0x2f42e2+'\x22');}else{_0x440b37[_0x4b5a('0x20')](_0x4b5a('0x7e'));}break;case _0x4b5a('0x7f'):if(isEmail(_0x45920c)){_0x58cb97['push']('\x22'+_0x45920c+'\x22');}else{_0x440b37['push']('email\x20wrong\x20format');}break;case _0x4b5a('0x80'):var _0x442987=moment(_0x45920c,_0x4b5a('0x81'),!![]);if(_0x442987[_0x4b5a('0x7a')]()){_0x58cb97['push']('\x22'+_0x45920c+'\x22');}else{_0x440b37[_0x4b5a('0x20')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x58cb97[_0x4b5a('0x20')]('\x22'+_0x45920c+'\x22');}}else{switch(_0x10c40a){case _0x4b5a('0x82'):case'phone':_0x440b37[_0x4b5a('0x20')](_0x10c40a+_0x4b5a('0x83'));break;default:_0x58cb97[_0x4b5a('0x20')]('\x22\x22');}}}}else{var _0x433156='';if(!_[_0x4b5a('0x1d')](_0x3995a9)){if(!_0x3de8ea[_0x4b5a('0x84')](_0x3995a9['id'])){for(var _0x48dd4e=0x0;_0x48dd4e<_0x527f29[_0x10c40a]['length'];_0x48dd4e++){var _0x45920c=_['trim'](_0x538deb[_0x4b5a('0x77')][_0xb9b311][_0x527f29[_0x10c40a][_0x48dd4e]][_0x4b5a('0x85')](/"/g,'\x27'));var _0x490294=phoneDescriptions['find'](_0x20198b=>_0x20198b[_0x4b5a('0x86')]===_0x3995a9['id']);if(!_['isNil'](_0x490294)){var _0x154513=_[_0x4b5a('0x79')](_0x538deb[_0x4b5a('0x77')][_0xb9b311][_0x527f29[_0x490294['description']][0x0]][_0x4b5a('0x85')](/"/g,'\x27'));if(!_[_0x4b5a('0x1d')](_0x154513))_0x45920c=_0x45920c+'§'+_0x154513;}if(_0x433156=='')_0x433156=_0x45920c;else _0x433156+='|'+_0x45920c;}_0x224dd4[_0x4b5a('0x20')](_0x3995a9['id']+':'+_0x433156);_0x3de8ea[_0x3995a9['id']]=0x1;}}}}if(hasAdditionalPhones){_0x58cb97['push']('\x22'+_0x224dd4[_0x4b5a('0x15')](';')+'\x22');}if(_0x440b37[_0x4b5a('0x1c')]){handleError(_0x538deb['data'][_0xb9b311],{'code':_0x4b5a('0x87'),'message':_0x440b37['join']()});}else{fs['appendFileSync'](_0x33cbc6,_0x58cb97['join']()+'\x0a');}_0x58cb97=[];}if(!(stats[_0x4b5a('0x76')]%0xc8)){socket[_0x4b5a('0x88')](_0x4b5a('0x89')+_0x1e97fd,stats);stats['errors']=[];}}if(stopped){logger[_0x4b5a('0x5f')]('Abort\x20parser');_0x1cb017[_0x4b5a('0x8a')]();}}catch(_0x7d0d5){handleError(_0x538deb['data'][_0xb9b311],{'code':_0x4b5a('0x8b'),'message':_0x7d0d5['message']});logger[_0x4b5a('0x22')](_0x4b5a('0x8c'),_0x7d0d5[_0x4b5a('0x23')]);}},'complete':function(){try{var _0x12231b=[];var _0x605dc1=tempTableName;_0x12231b[_0x4b5a('0x20')](_0x4b5a('0x8d')+_0x605dc1+_0x4b5a('0x8e'));logger[_0x4b5a('0x5f')](_0x4b5a('0x8f'),contactItemTypes[_0x4b5a('0x1c')]);var _0x1697cb=util['format'](_0x4b5a('0x90'),_0x33cbc6,_0x605dc1,_0x38201c,_0x4caa12['ListId'],_0x4caa12[_0x4b5a('0x5a')]||null,NOW,NOW);if(_[_0x4b5a('0x1d')](_0x527f29[_0x4b5a('0x37')])){_0x1697cb+=',\x20scheduledAt\x20=\x20NOW()';}_0x12231b[_0x4b5a('0x20')](_0x1697cb);BPromise[_0x4b5a('0x91')](_0x12231b,handleQuery)[_0x4b5a('0x26')](function(_0x53ada3){BPromise[_0x4b5a('0x25')]([handleAdditionalPhones()])['then'](function(){_0x12231b=[];for(var _0x5df486=0x0;_0x5df486\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','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','toString','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','where','t.id\x20IN\x20?','exports','lodash','../parsers/advancedSearch','./update-interaction','updateInteraction','getAccountFK','role','agent','search','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.fullname','ui.','left_join','u.id\x20=\x20ui.UserId','length','map','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','accounts','messages','me.','\x20=\x20i.id','it.','t.id\x20=\x20it.TagId','expr','forEach','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','buildExpression','type','text','value','start','end','unreadMessages','and','operator','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','Tag'];(function(_0x51aee3,_0x30c7e4){var _0x346280=function(_0x456939){while(--_0x456939){_0x51aee3['push'](_0x51aee3['shift']());}};_0x346280(++_0x30c7e4);}(_0x9723,0x198));var _0x3972=function(_0x5e6cb8,_0x1d1eb5){_0x5e6cb8=_0x5e6cb8-0x0;var _0x41754f=_0x9723[_0x5e6cb8];return _0x41754f;};'use strict';var _=require(_0x3972('0x0'));var squel=require('squel');var as=require(_0x3972('0x1'));var qs=require('../parsers/qs');var updateInteraction=require(_0x3972('0x2'))[_0x3972('0x3')];var utils=require('./utils');var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x5d8acb,_0x10357b,_0x13b02b){var _0x7924cf=![];var _0x46e135=utils[_0x3972('0x4')](_0x5d8acb);if(_0x10357b[_0x3972('0x5')]===_0x3972('0x6')&&!_0x13b02b[_0x3972('0x7')]&&!_0x13b02b[_0x46e135]){_0x7924cf=!![];}return _0x7924cf;}function getTagsQuery(){return squel[_0x3972('0x8')]()[_0x3972('0x9')]('id')[_0x3972('0x9')](_0x3972('0xa'))['field'](_0x3972('0xb'))[_0x3972('0xc')](_0x3972('0xd'));}function getUsersQuery(_0x24628b,_0x7dec01){var _0x5a36ce=utils[_0x3972('0xe')](_0x24628b);var _0x41b43a=_0x3972('0xf')+_0x24628b+_0x3972('0x10');var _0x2e6e97=squel['select']()[_0x3972('0x9')]('u.id')[_0x3972('0x9')](_0x3972('0x11'))[_0x3972('0x9')](_0x3972('0x12')+_0x5a36ce)[_0x3972('0xc')](_0x41b43a,'ui')[_0x3972('0x13')]('users','u',_0x3972('0x14'));if(_0x7dec01[_0x3972('0x15')]>0x0){_0x2e6e97['where'](_0x3972('0x12')+_0x5a36ce+'\x20IN\x20?',_[_0x3972('0x16')](_0x7dec01,'id'));}return _0x2e6e97;}function getInteractionsQuery(_0x592360){var _0x3de7e6=utils['getInteractionsTables'](_0x592360);var _0x399f0a=utils[_0x3972('0x4')](_0x592360);var _0x5ee44e=utils[_0x3972('0xe')](_0x592360);return squel['select']()[_0x3972('0xc')](_0x3de7e6['interactions'],'i')[_0x3972('0x13')]('cm_contacts','c',_0x3972('0x17'))['left_join'](_0x3972('0x18'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x3de7e6[_0x3972('0x19')],'a','a.id\x20=\x20i.'+_0x399f0a)['left_join'](_0x3de7e6[_0x3972('0x1a')],'me',_0x3972('0x1b')+_0x5ee44e+_0x3972('0x1c'))[_0x3972('0x13')](_0x3de7e6['interactionsTags'],'it',_0x3972('0x1d')+_0x5ee44e+_0x3972('0x1c'))[_0x3972('0x13')](_0x3972('0xd'),'t',_0x3972('0x1e'));}function getSqlClauses(){var _0x4b5394={'body':squel[_0x3972('0x1f')](),'contact':squel['expr'](),'default':squel[_0x3972('0x1f')](),'fields':squel['expr'](),'filter':squel['expr'](),'read':squel[_0x3972('0x1f')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel['expr']()};return _0x4b5394;}function parseTagParameter(_0x47af5d){var _0x48f151=squel[_0x3972('0x1f')]();if(_0x47af5d){var _0x314783=utils['getSelectedTags'](_0x47af5d);_0x314783[_0x3972('0x20')](function(_0x3e1156){_0x48f151['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3e1156+',%');});}return _0x48f151;}function parseReadParameter(_0x5ee668){var _0x3d9e14='';if(_0x5ee668){_0x3d9e14='unreadMessages\x20{OPERATOR}\x200';if(_0x5ee668==='1'){_0x3d9e14=_0x3d9e14[_0x3972('0x21')](_0x3972('0x22'),'=');}else{_0x3d9e14=_0x3d9e14['replace'](_0x3972('0x22'),'>');}}return _0x3d9e14;}function parseSearchFilter(_0x13f1da,_0x37650d){var _0x319a50=squel[_0x3972('0x1f')]();if(_0x37650d){var _0xcc3883=_0x37650d[_0x3972('0x21')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0xcc3883)){_0x319a50['or'](_0x3972('0x23'),_0xcc3883+'%');if([_0x3972('0x24'),_0x3972('0x25')][_0x3972('0x26')](_0x13f1da)){_0x319a50['or'](_0x3972('0x27'),_0xcc3883+'%');}else if(_0x13f1da===_0x3972('0x28')){_0x319a50['or'](_0x3972('0x29'),_0xcc3883+'%');}else if(_0x13f1da===_0x3972('0x2a')){_0x319a50['or'](_0x3972('0x2b'),_0xcc3883+'%');}}else if(_0x13f1da===_0x3972('0x2c')&&qs[_0x3972('0x2d')](_0xcc3883)){_0x319a50['or'](_0x3972('0x2e'),_0xcc3883+'%');}else{if(_0x13f1da==='mail'){_0x319a50['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3972('0x2f')](_0xcc3883,!![]))['or'](_0x3972('0x30'),qs[_0x3972('0x2f')](_0xcc3883));}else if(_0x13f1da!==_0x3972('0x28')){_0x319a50['or'](_0x3972('0x31'),qs[_0x3972('0x2f')](_0xcc3883));}_0x319a50['or'](_0x3972('0x32'),qs[_0x3972('0x2f')](_0xcc3883,!![]),null);}}return _0x319a50;}function parseAdvancedSearchFilter(_0x529972,_0x59e8a0){var _0x2fde9e=getSqlClauses();var _0x2f8c80=as[_0x3972('0x33')](_0x529972);var _0x2cde3f=_0x2f8c80[_0x3972('0x34')];for(var _0x59a840=0x0;_0x59a840<_0x2f8c80[_0x3972('0x35')]['length'];_0x59a840++){var _0xe2365=_0x2f8c80[_0x3972('0x35')][_0x59a840];var _0x4b0a4d='i';var _0x1f40d7=_[_0x3972('0x36')](_0x59e8a0,[_0x3972('0xa'),_0xe2365[_0x3972('0x9')]]);if(_0x1f40d7){var _0x3893ac=as[_0x3972('0x37')](_0x4b0a4d,_0x1f40d7[_0x3972('0x38')],_0xe2365);_0x2fde9e['default'][_0x2cde3f](_0x3893ac[_0x3972('0x39')],_0x3893ac[_0x3972('0x3a')][_0x3972('0x3b')],_0x3893ac['value'][_0x3972('0x3c')]);}else{switch(_0xe2365[_0x3972('0x9')]){case _0x3972('0x3d'):var _0x436014=parseReadParameter(_0xe2365[_0x3972('0x3a')]);_0x2fde9e['read'][_0x3972('0x3e')](_0x436014);break;case'Contact':if(_0xe2365[_0x3972('0x3f')]==='$substring'){if(_0xe2365[_0x3972('0x3a')][_0x3972('0x40')]('\x20')[_0x3972('0x15')]>0x1){_0x2fde9e[_0x3972('0x41')][_0x2cde3f]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3972('0x2f')](_0xe2365[_0x3972('0x3a')],!![]),null);}else{var _0x23bee3='%'+_0xe2365['value']+'%';_0x2fde9e[_0x3972('0x41')][_0x2cde3f](_0x3972('0x42'),_0x23bee3,_0x23bee3,_0x23bee3);}}else{_0x1f40d7=_['find'](_0x59e8a0,[_0x3972('0xa'),_0x3972('0x43')]);_0xe2365[_0x3972('0x9')]=_0x3972('0x43');_0x3893ac=as[_0x3972('0x37')](_0x4b0a4d,_0x1f40d7[_0x3972('0x38')],_0xe2365);_0x2fde9e[_0x3972('0x41')][_0x2cde3f](_0x3893ac[_0x3972('0x39')],_0x3893ac['value'][_0x3972('0x3b')],_0x3893ac[_0x3972('0x3a')][_0x3972('0x3c')]);}break;case _0x3972('0x44'):var _0x3d911d=_0xe2365['value'][_0x3972('0x40')](',')[_0x3972('0x16')](function(_0x4982d6){return Number(_0x4982d6);});var _0x2baf2b=parseTagParameter(_0x3d911d);_0x2fde9e[_0x3972('0x45')][_0x3972('0x46')]['and'](_0x2baf2b);_0x2fde9e[_0x3972('0x45')][_0x3972('0x47')]=_0x3d911d;break;case _0x3972('0x48'):if(_0xe2365[_0x3972('0x3f')]==='$substring'){_0x2fde9e[_0x3972('0x49')][_0x2cde3f](_0x3972('0x4a'),'%'+_0xe2365[_0x3972('0x3a')]+'%',null);}else{_0x1f40d7=_[_0x3972('0x36')](_0x59e8a0,[_0x3972('0xa'),_0x3972('0x4b')]);_0xe2365['field']=_0x3972('0x4b');_0x3893ac=as[_0x3972('0x37')](_0x4b0a4d,_0x1f40d7[_0x3972('0x38')],_0xe2365);_0x2fde9e['user'][_0x2cde3f](_0x3893ac[_0x3972('0x39')],_0x3893ac[_0x3972('0x3a')][_0x3972('0x3b')],_0x3893ac[_0x3972('0x3a')][_0x3972('0x3c')]);}break;case'body':case'plainBody':_0x3893ac=as[_0x3972('0x37')]('me',null,_0xe2365);_0x2fde9e[_0x3972('0x4c')][_0x2cde3f](_0x3893ac[_0x3972('0x39')],_0x3893ac[_0x3972('0x3a')][_0x3972('0x3b')],_0x3893ac['value'][_0x3972('0x3c')]);break;}}}return _0x2fde9e;}function parseModelFields(_0x3c493a,_0x1ff93b,_0x13b361){var _0x4f893b=utils[_0x3972('0x4')](_0x3c493a);var _0x8a0cf3=squel[_0x3972('0x1f')]();var _0x55466d=_(_0x1ff93b)[_0x3972('0x4d')]()[_0x3972('0x16')](function(_0x1ad600){return _['some'](_0x13b361,[_0x3972('0xa'),_0x1ad600])?_0x1ad600:undefined;})[_0x3972('0x4e')]()[_0x3972('0x3a')]();if(_0x55466d[_0x3972('0x15')]>0x0){_0x55466d[_0x3972('0x20')](function(_0x58999b){if(_0x58999b===_0x4f893b){_0x8a0cf3['and']('i.'+_0x4f893b+'\x20IN\x20?',[][_0x3972('0x4f')](_0x1ff93b[_0x58999b]));}else if(_0x58999b===_0x3972('0x50')){var _0x486474=JSON[_0x3972('0x51')](_0x1ff93b[_0x58999b])[_0x3972('0x52')];var _0x3647a3=JSON['parse'](_0x1ff93b[_0x58999b])[_0x3972('0x53')];_0x8a0cf3['and'](_0x3972('0x54'),_0x486474,_0x3647a3);}else{if(_0x1ff93b[_0x58999b]===_0x3972('0x55')){_0x8a0cf3['and']('i.'+_0x58999b+'\x20IS\x20NULL');}else{_0x8a0cf3[_0x3972('0x3e')]('i.'+_0x58999b+_0x3972('0x56'),_0x1ff93b[_0x58999b]);}}});}return _0x8a0cf3;}function parseQueryParameters(_0x34798e,_0x122a57,_0x15df92){var _0x126b85=getSqlClauses();return Promise[_0x3972('0x57')]()[_0x3972('0x58')](function(){return parseModelFields(_0x34798e,_0x122a57,_0x15df92);})[_0x3972('0x58')](function(_0x13cb6e){_0x126b85[_0x3972('0x59')]['and'](_0x13cb6e);return parseReadParameter(_0x122a57['read']);})[_0x3972('0x58')](function(_0x39f2c9){_0x126b85[_0x3972('0x5a')]['and'](_0x39f2c9);return parseTagParameter(_0x122a57['tag']);})['then'](function(_0x1d058b){_0x126b85['tags'][_0x3972('0x46')][_0x3972('0x3e')](_0x1d058b);return parseSearchFilter(_0x34798e,_0x122a57[_0x3972('0x5b')]);})['then'](function(_0x5bb789){_0x126b85['filter']=_0x5bb789;return _0x126b85;});}function checkAccountsRestrictions(_0x1ea206,_0x583734,_0x4d73a3){var _0x21cbb5=utils['getAccountFK'](_0x1ea206);var _0x185cb0='get'+_[_0x3972('0x5c')](_0x1ea206)+(_0x1ea206==='chat'?_0x3972('0x5d'):'Accounts');var _0xfa993=squel[_0x3972('0x1f')]();return Promise[_0x3972('0x57')]()[_0x3972('0x58')](function(){if(_0x4d73a3['search']&&_0x583734['role']==='agent'){return _0x583734[_0x185cb0]({'attributes':['id'],'raw':!![]});}})[_0x3972('0x58')](function(_0x403d82){if(_0x403d82){if(_0x403d82[_0x3972('0x15')]===0x0){_0xfa993[_0x3972('0x3e')]('i.'+_0x21cbb5+_0x3972('0x5e'));}else{_0xfa993[_0x3972('0x3e')]('i.'+_0x21cbb5+_0x3972('0x5f'),_[_0x3972('0x16')](_0x403d82,'id'));}}else if(!_0x4d73a3[_0x21cbb5]){_0xfa993[_0x3972('0x3e')]('i.'+_0x21cbb5+_0x3972('0x60'));}})['then'](function(){return _0xfa993;});}function getClosedOrderClause(_0x5ddea9,_0x526f71){var _0x5cad53='';var _0x380d34=['i.thirdDisposition',_0x3972('0x61'),_0x3972('0x62')];if(_0x5ddea9===_0x3972('0x2c')){_0x380d34[_0x3972('0x63')](_0x3972('0x64'));}if(_0x526f71[_0x3972('0x65')]==='0'&&_0x5ddea9===_0x3972('0x2c')){_0x5cad53='i.substatus';}else{if(_0x526f71['closed']==='1'){_0x380d34[_0x3972('0x66')]();}_0x5cad53=_0x3972('0x67')+_0x380d34['join'](',\x20')+')';}return _0x5cad53;}function getFilteredInteractions(_0x9fb426,_0x18b014,_0x8e9ba8,_0x258402){var _0x508ea4=utils['getInteractionFK'](_0x9fb426);var _0x36ad95=_[_0x3972('0x5c')](_0x9fb426)+'Interaction';var _0x119a8e=[];var _0x2271c6=getTagsQuery();var _0x319b98={'type':db[_0x3972('0x68')]['QueryTypes'][_0x3972('0x69')],'raw':!![]};var _0x39c942=[];var _0x10cb86=[];return db[_0x3972('0x6a')][_0x3972('0x6b')](_0x2271c6['toString'](),_0x319b98)['then'](function(_0x364c4b){_0x119a8e=_[_0x3972('0x6c')](_0x364c4b,'id');_0x319b98=_[_0x3972('0x6d')](_0x319b98,{'model':db[_0x36ad95],'mapToModel':!![],'nest':!![]});if(_0x8e9ba8[_0x3972('0x59')]){_0x258402[_0x3972('0x6e')]['forEach'](function(_0x20921f){_0x18b014['field']('i.'+_0x20921f);});}else{_0x18b014[_0x3972('0x9')](_0x3972('0x6f'),_0x3972('0x3d'));_0x18b014['field']('a.key',_0x3972('0x70'));_0x18b014[_0x3972('0x9')](_0x3972('0x71'),'Account.mandatoryDisposition');if(_0x9fb426===_0x3972('0x2c')){_0x18b014[_0x3972('0x9')](_0x3972('0x72'),_0x3972('0x73'));_0x18b014['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_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');_0x18b014['field']('i.id');_0x18b014[_0x3972('0x9')](_0x3972('0x74'));_0x18b014[_0x3972('0x9')](_0x3972('0x75'));_0x18b014[_0x3972('0x9')](_0x3972('0x76'));_0x18b014['field'](_0x3972('0x77'));_0x18b014['field'](_0x3972('0x78'));_0x18b014[_0x3972('0x9')](_0x3972('0x79'));_0x18b014[_0x3972('0x9')](_0x3972('0x7a'));_0x18b014[_0x3972('0x9')](_0x3972('0x7b'));_0x18b014['field'](_0x3972('0x62'));_0x18b014['field']('i.secondDisposition');_0x18b014[_0x3972('0x9')](_0x3972('0x7c'));_0x18b014[_0x3972('0x9')](_0x3972('0x64'));_0x18b014['field'](_0x3972('0x7d'));_0x18b014[_0x3972('0x9')](_0x3972('0x7e'));_0x18b014[_0x3972('0x9')]('i.MailAccountId');_0x18b014['field']('i.UserId');}else if(_0x9fb426===_0x3972('0x2a')){_0x18b014[_0x3972('0x9')](_0x3972('0x7f'),_0x3972('0x80'));}else{_0x18b014[_0x3972('0x9')]('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',_0x3972('0x80'));}if(_0x9fb426!==_0x3972('0x2c')){_0x18b014['field']('i.*');}_0x18b014[_0x3972('0x9')](_0x3972('0x81'),_0x3972('0x82'));_0x18b014[_0x3972('0x9')](_0x3972('0x83'),_0x3972('0x84'));_0x18b014[_0x3972('0x9')](_0x3972('0x85'),_0x3972('0x86'));_0x18b014[_0x3972('0x9')](_0x3972('0x87'),'Contact.phone');_0x18b014[_0x3972('0x9')](_0x3972('0x88'),'Contact.mobile');_0x18b014[_0x3972('0x9')](_0x3972('0x89'),_0x3972('0x8a'));_0x18b014['field'](_0x3972('0x8b'),_0x3972('0x8c'));_0x18b014['field'](_0x3972('0x8d'),_0x3972('0x8e'));_0x18b014[_0x3972('0x9')](_0x3972('0x8f'),_0x3972('0x90'));}if(_0x258402['limit']){_0x18b014[_0x3972('0x91')](_0x258402[_0x3972('0x91')]);}if(_0x258402['offset']){_0x18b014[_0x3972('0x92')](_0x258402[_0x3972('0x92')]);}return db[_0x3972('0x6a')][_0x3972('0x6b')](_0x18b014[_0x3972('0x93')](),_0x319b98);})[_0x3972('0x58')](function(_0x4c37ad){_0x39c942=_0x4c37ad;var _0x2a6570=getUsersQuery(_0x9fb426,_0x39c942);return db['sequelize'][_0x3972('0x6b')](_0x2a6570[_0x3972('0x93')](),_0x319b98);})[_0x3972('0x58')](function(_0x26c9fc){_0x10cb86=_[_0x3972('0x94')](_0x26c9fc,_0x508ea4);if(_0x9fb426==='mail'){return db[_0x3972('0x95')][_0x3972('0x96')]({'attributes':['enableEmailPreview'],'raw':!![]});}})['then'](function(_0x56416e){var _0x538f61=_0x56416e?_0x56416e[_0x3972('0x97')]:undefined;var _0x7d9636=_0x39c942[_0x3972('0x16')](function(_0x2528d6){return updateInteraction(_0x2528d6,_0x119a8e,_0x10cb86,_0x538f61);});return Promise[_0x3972('0x98')](_0x7d9636);});}function countFilteredInteractions(_0x323955,_0x568e0a){var _0x3a866a=_0x323955[_0x3972('0x99')]();_0x3a866a[_0x3972('0x9')](_0x3972('0x9a'));_0x3a866a[_0x3972('0x9')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');var _0x4ae4f5=utils['getSelectedTags'](_0x568e0a);if(!_[_0x3972('0x9b')](_0x4ae4f5)){_0x3a866a[_0x3972('0x9c')](_0x3972('0x9d'),_0x4ae4f5);}var _0x4f57fb={'type':db[_0x3972('0x68')]['QueryTypes'][_0x3972('0x69')],'raw':!![]};return db['sequelize'][_0x3972('0x6b')](_0x3a866a[_0x3972('0x93')](),_0x4f57fb);}module[_0x3972('0x9e')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x4fcf=['getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','sqlOperator','conditions','find','name','buildExpression','type','default','text','start','value','end','unreadMessages','read','and','Contact','operator','$substring','contact','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?','Tag','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','keys','some','compact','forEach','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','resolve','then','fields','tag','filter','capitalize','chat','Websites','Accounts','role','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','mail','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Sequelize','QueryTypes','SELECT','sequelize','query','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.lastMsgAt','i.subject','i.to','i.ContactId','i.MailAccountId','i.UserId','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','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','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','findOne','all','clone','COUNT(*)','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','./update-interaction','getAccountFK','agent','search','select','field','color','from','tools_tags','getInteractionFK','user_has_','u.id','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','\x20=\x20i.id','interactionsTags','it.','expr','getSelectedTags','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','includes','fax','openchannel','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)'];(function(_0x543744,_0x254850){var _0x405ab8=function(_0x4ce39a){while(--_0x4ce39a){_0x543744['push'](_0x543744['shift']());}};_0x405ab8(++_0x254850);}(_0x4fcf,0x72));var _0xf4fc=function(_0x43f4a7,_0x5083ba){_0x43f4a7=_0x43f4a7-0x0;var _0x125146=_0x4fcf[_0x43f4a7];return _0x125146;};'use strict';var _=require(_0xf4fc('0x0'));var squel=require(_0xf4fc('0x1'));var as=require(_0xf4fc('0x2'));var qs=require('../parsers/qs');var updateInteraction=require(_0xf4fc('0x3'))['updateInteraction'];var utils=require('./utils');var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x564dcd,_0x191813,_0x1dbce4){var _0x2f7037=![];var _0x5c876d=utils[_0xf4fc('0x4')](_0x564dcd);if(_0x191813['role']===_0xf4fc('0x5')&&!_0x1dbce4[_0xf4fc('0x6')]&&!_0x1dbce4[_0x5c876d]){_0x2f7037=!![];}return _0x2f7037;}function getTagsQuery(){return squel[_0xf4fc('0x7')]()[_0xf4fc('0x8')]('id')['field']('name')[_0xf4fc('0x8')](_0xf4fc('0x9'))[_0xf4fc('0xa')](_0xf4fc('0xb'));}function getUsersQuery(_0x1ed1f7,_0x390f06){var _0x27a521=utils[_0xf4fc('0xc')](_0x1ed1f7);var _0x3a20b8=_0xf4fc('0xd')+_0x1ed1f7+'_interactions';var _0x1ad527=squel[_0xf4fc('0x7')]()[_0xf4fc('0x8')](_0xf4fc('0xe'))[_0xf4fc('0x8')]('u.fullname')[_0xf4fc('0x8')](_0xf4fc('0xf')+_0x27a521)['from'](_0x3a20b8,'ui')[_0xf4fc('0x10')](_0xf4fc('0x11'),'u',_0xf4fc('0x12'));if(_0x390f06[_0xf4fc('0x13')]>0x0){_0x1ad527[_0xf4fc('0x14')](_0xf4fc('0xf')+_0x27a521+_0xf4fc('0x15'),_[_0xf4fc('0x16')](_0x390f06,'id'));}return _0x1ad527;}function getInteractionsQuery(_0x46904e){var _0x575a76=utils[_0xf4fc('0x17')](_0x46904e);var _0x1bfd74=utils['getAccountFK'](_0x46904e);var _0x4fe674=utils[_0xf4fc('0xc')](_0x46904e);return squel[_0xf4fc('0x7')]()['from'](_0x575a76['interactions'],'i')[_0xf4fc('0x10')](_0xf4fc('0x18'),'c',_0xf4fc('0x19'))['left_join'](_0xf4fc('0x11'),'o',_0xf4fc('0x1a'))['left_join'](_0x575a76[_0xf4fc('0x1b')],'a',_0xf4fc('0x1c')+_0x1bfd74)[_0xf4fc('0x10')](_0x575a76['messages'],'me','me.'+_0x4fe674+_0xf4fc('0x1d'))[_0xf4fc('0x10')](_0x575a76[_0xf4fc('0x1e')],'it',_0xf4fc('0x1f')+_0x4fe674+'\x20=\x20i.id')[_0xf4fc('0x10')](_0xf4fc('0xb'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x52642d={'body':squel[_0xf4fc('0x20')](),'contact':squel[_0xf4fc('0x20')](),'default':squel[_0xf4fc('0x20')](),'fields':squel[_0xf4fc('0x20')](),'filter':squel[_0xf4fc('0x20')](),'read':squel[_0xf4fc('0x20')](),'tags':{'clause':squel[_0xf4fc('0x20')](),'ids':null},'user':squel[_0xf4fc('0x20')]()};return _0x52642d;}function parseTagParameter(_0x2d8963){var _0x3d386e=squel[_0xf4fc('0x20')]();if(_0x2d8963){var _0x412c0f=utils[_0xf4fc('0x21')](_0x2d8963);_0x412c0f['forEach'](function(_0x38fa40){_0x3d386e['or'](_0xf4fc('0x22'),'%,'+_0x38fa40+',%');});}return _0x3d386e;}function parseReadParameter(_0x1685c1){var _0x34692e='';if(_0x1685c1){_0x34692e=_0xf4fc('0x23');if(_0x1685c1==='1'){_0x34692e=_0x34692e[_0xf4fc('0x24')](_0xf4fc('0x25'),'=');}else{_0x34692e=_0x34692e[_0xf4fc('0x24')](_0xf4fc('0x25'),'>');}}return _0x34692e;}function parseSearchFilter(_0x2f24bf,_0x30c189){var _0x282361=squel[_0xf4fc('0x20')]();if(_0x30c189){var _0x26fa9f=_0x30c189[_0xf4fc('0x24')]('\x5c','\x5c\x5c')[_0xf4fc('0x24')](/'/g,'\x27\x27');if(qs[_0xf4fc('0x26')](_0x26fa9f)){_0x282361['or'](_0xf4fc('0x27'),_0x26fa9f+'%');if([_0xf4fc('0x28'),'whatsapp'][_0xf4fc('0x29')](_0x2f24bf)){_0x282361['or']('i.phone\x20LIKE\x20?',_0x26fa9f+'%');}else if(_0x2f24bf===_0xf4fc('0x2a')){_0x282361['or']('i.fax\x20LIKE\x20?',_0x26fa9f+'%');}else if(_0x2f24bf===_0xf4fc('0x2b')){_0x282361['or']('i.from\x20LIKE\x20?',_0x26fa9f+'%');}}else if(_0x2f24bf==='mail'&&qs['isEmail'](_0x26fa9f)){_0x282361['or'](_0xf4fc('0x2c'),_0x26fa9f+'%');}else{if(_0x2f24bf==='mail'){_0x282361['or'](_0xf4fc('0x2d'),qs[_0xf4fc('0x2e')](_0x26fa9f,!![]))['or'](_0xf4fc('0x2f'),qs[_0xf4fc('0x2e')](_0x26fa9f));}else if(_0x2f24bf!==_0xf4fc('0x2a')){_0x282361['or'](_0xf4fc('0x30'),qs['getFullTextValue'](_0x26fa9f));}_0x282361['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf4fc('0x2e')](_0x26fa9f,!![]),null);}}return _0x282361;}function parseAdvancedSearchFilter(_0x342227,_0x22c438){var _0x5a5ddd=getSqlClauses();var _0xa5c66f=as['parseSearch'](_0x342227);var _0x14022b=_0xa5c66f[_0xf4fc('0x31')];for(var _0x1c8098=0x0;_0x1c8098<_0xa5c66f[_0xf4fc('0x32')]['length'];_0x1c8098++){var _0x521b8f=_0xa5c66f[_0xf4fc('0x32')][_0x1c8098];var _0xf7232b='i';var _0xa3d19c=_[_0xf4fc('0x33')](_0x22c438,[_0xf4fc('0x34'),_0x521b8f[_0xf4fc('0x8')]]);if(_0xa3d19c){var _0xe52f7f=as[_0xf4fc('0x35')](_0xf7232b,_0xa3d19c[_0xf4fc('0x36')],_0x521b8f);_0x5a5ddd[_0xf4fc('0x37')][_0x14022b](_0xe52f7f[_0xf4fc('0x38')],_0xe52f7f['value'][_0xf4fc('0x39')],_0xe52f7f[_0xf4fc('0x3a')][_0xf4fc('0x3b')]);}else{switch(_0x521b8f['field']){case _0xf4fc('0x3c'):var _0x373327=parseReadParameter(_0x521b8f[_0xf4fc('0x3a')]);_0x5a5ddd[_0xf4fc('0x3d')][_0xf4fc('0x3e')](_0x373327);break;case _0xf4fc('0x3f'):if(_0x521b8f[_0xf4fc('0x40')]===_0xf4fc('0x41')){if(_0x521b8f[_0xf4fc('0x3a')]['split']('\x20')['length']>0x1){_0x5a5ddd[_0xf4fc('0x42')][_0x14022b](_0xf4fc('0x43'),qs['getFullTextValue'](_0x521b8f[_0xf4fc('0x3a')],!![]),null);}else{var _0xefe0d1='%'+_0x521b8f[_0xf4fc('0x3a')]+'%';_0x5a5ddd[_0xf4fc('0x42')][_0x14022b](_0xf4fc('0x44'),_0xefe0d1,_0xefe0d1,_0xefe0d1);}}else{_0xa3d19c=_['find'](_0x22c438,[_0xf4fc('0x34'),'ContactId']);_0x521b8f[_0xf4fc('0x8')]='ContactId';_0xe52f7f=as[_0xf4fc('0x35')](_0xf7232b,_0xa3d19c[_0xf4fc('0x36')],_0x521b8f);_0x5a5ddd[_0xf4fc('0x42')][_0x14022b](_0xe52f7f['text'],_0xe52f7f[_0xf4fc('0x3a')][_0xf4fc('0x39')],_0xe52f7f['value']['end']);}break;case _0xf4fc('0x45'):var _0x309a73=_0x521b8f[_0xf4fc('0x3a')]['split'](',')[_0xf4fc('0x16')](function(_0x11185f){return Number(_0x11185f);});var _0x74e4b2=parseTagParameter(_0x309a73);_0x5a5ddd[_0xf4fc('0x46')][_0xf4fc('0x47')][_0xf4fc('0x3e')](_0x74e4b2);_0x5a5ddd['tags'][_0xf4fc('0x48')]=_0x309a73;break;case _0xf4fc('0x49'):if(_0x521b8f[_0xf4fc('0x40')]==='$substring'){_0x5a5ddd[_0xf4fc('0x4a')][_0x14022b](_0xf4fc('0x4b'),'%'+_0x521b8f[_0xf4fc('0x3a')]+'%',null);}else{_0xa3d19c=_[_0xf4fc('0x33')](_0x22c438,[_0xf4fc('0x34'),_0xf4fc('0x4c')]);_0x521b8f[_0xf4fc('0x8')]='UserId';_0xe52f7f=as['buildExpression'](_0xf7232b,_0xa3d19c[_0xf4fc('0x36')],_0x521b8f);_0x5a5ddd[_0xf4fc('0x4a')][_0x14022b](_0xe52f7f['text'],_0xe52f7f[_0xf4fc('0x3a')][_0xf4fc('0x39')],_0xe52f7f[_0xf4fc('0x3a')][_0xf4fc('0x3b')]);}break;case _0xf4fc('0x4d'):case _0xf4fc('0x4e'):_0xe52f7f=as[_0xf4fc('0x35')]('me',null,_0x521b8f);_0x5a5ddd[_0xf4fc('0x4d')][_0x14022b](_0xe52f7f['text'],_0xe52f7f['value'][_0xf4fc('0x39')],_0xe52f7f[_0xf4fc('0x3a')][_0xf4fc('0x3b')]);break;}}}return _0x5a5ddd;}function parseModelFields(_0x570cf5,_0x4c87ee,_0x525b6a){var _0x5bd49c=utils['getAccountFK'](_0x570cf5);var _0x4ee5be=squel['expr']();var _0xde2586=_(_0x4c87ee)[_0xf4fc('0x4f')]()['map'](function(_0x9825f5){return _[_0xf4fc('0x50')](_0x525b6a,[_0xf4fc('0x34'),_0x9825f5])?_0x9825f5:undefined;})[_0xf4fc('0x51')]()['value']();if(_0xde2586[_0xf4fc('0x13')]>0x0){_0xde2586[_0xf4fc('0x52')](function(_0x12b794){if(_0x12b794===_0x5bd49c){_0x4ee5be[_0xf4fc('0x3e')]('i.'+_0x5bd49c+_0xf4fc('0x15'),[][_0xf4fc('0x53')](_0x4c87ee[_0x12b794]));}else if(_0x12b794===_0xf4fc('0x54')){var _0x3bbec3=JSON['parse'](_0x4c87ee[_0x12b794])[_0xf4fc('0x55')];var _0x2306fe=JSON['parse'](_0x4c87ee[_0x12b794])[_0xf4fc('0x56')];_0x4ee5be[_0xf4fc('0x3e')](_0xf4fc('0x57'),_0x3bbec3,_0x2306fe);}else{if(_0x4c87ee[_0x12b794]==='null'){_0x4ee5be[_0xf4fc('0x3e')]('i.'+_0x12b794+_0xf4fc('0x58'));}else{_0x4ee5be[_0xf4fc('0x3e')]('i.'+_0x12b794+'\x20=\x20?',_0x4c87ee[_0x12b794]);}}});}return _0x4ee5be;}function parseQueryParameters(_0xe88d8f,_0x1215e3,_0x309845){var _0x3860e1=getSqlClauses();return Promise[_0xf4fc('0x59')]()[_0xf4fc('0x5a')](function(){return parseModelFields(_0xe88d8f,_0x1215e3,_0x309845);})[_0xf4fc('0x5a')](function(_0x29e71f){_0x3860e1[_0xf4fc('0x5b')][_0xf4fc('0x3e')](_0x29e71f);return parseReadParameter(_0x1215e3[_0xf4fc('0x3d')]);})['then'](function(_0xe08a35){_0x3860e1[_0xf4fc('0x3d')]['and'](_0xe08a35);return parseTagParameter(_0x1215e3[_0xf4fc('0x5c')]);})[_0xf4fc('0x5a')](function(_0x2f261a){_0x3860e1[_0xf4fc('0x46')]['clause'][_0xf4fc('0x3e')](_0x2f261a);return parseSearchFilter(_0xe88d8f,_0x1215e3[_0xf4fc('0x5d')]);})['then'](function(_0x4d1712){_0x3860e1[_0xf4fc('0x5d')]=_0x4d1712;return _0x3860e1;});}function checkAccountsRestrictions(_0x121998,_0xcc8b5a,_0x3644fb){var _0x225dbb=utils[_0xf4fc('0x4')](_0x121998);var _0x13157d='get'+_[_0xf4fc('0x5e')](_0x121998)+(_0x121998===_0xf4fc('0x5f')?_0xf4fc('0x60'):_0xf4fc('0x61'));var _0x13e491=squel[_0xf4fc('0x20')]();return Promise[_0xf4fc('0x59')]()[_0xf4fc('0x5a')](function(){if(_0x3644fb[_0xf4fc('0x6')]&&_0xcc8b5a[_0xf4fc('0x62')]===_0xf4fc('0x5')){return _0xcc8b5a[_0x13157d]({'attributes':['id'],'raw':!![]});}})[_0xf4fc('0x5a')](function(_0x956a7b){if(_0x956a7b){if(_0x956a7b['length']===0x0){_0x13e491[_0xf4fc('0x3e')]('i.'+_0x225dbb+_0xf4fc('0x58'));}else{_0x13e491['and']('i.'+_0x225dbb+'\x20IN\x20?',_[_0xf4fc('0x16')](_0x956a7b,'id'));}}else if(!_0x3644fb[_0x225dbb]){_0x13e491[_0xf4fc('0x3e')]('i.'+_0x225dbb+_0xf4fc('0x63'));}})[_0xf4fc('0x5a')](function(){return _0x13e491;});}function getClosedOrderClause(_0x6f52a2,_0x12cd4c){var _0xbf4c81='';var _0xffea78=[_0xf4fc('0x64'),_0xf4fc('0x65'),_0xf4fc('0x66')];if(_0x6f52a2===_0xf4fc('0x67')){_0xffea78[_0xf4fc('0x68')](_0xf4fc('0x69'));}if(_0x12cd4c[_0xf4fc('0x6a')]==='0'&&_0x6f52a2==='mail'){_0xbf4c81='i.substatus';}else{if(_0x12cd4c[_0xf4fc('0x6a')]==='1'){_0xffea78[_0xf4fc('0x6b')]();}_0xbf4c81=_0xf4fc('0x6c')+_0xffea78[_0xf4fc('0x6d')](',\x20')+')';}return _0xbf4c81;}function getFilteredInteractions(_0x40be04,_0x1b04e6,_0x47b5aa,_0x4716ee){var _0x1827cf=utils[_0xf4fc('0xc')](_0x40be04);var _0xa4bfbf=_[_0xf4fc('0x5e')](_0x40be04)+'Interaction';var _0x4a140f=[];var _0xdfc7cc=getTagsQuery();var _0x2ce489={'type':db[_0xf4fc('0x6e')][_0xf4fc('0x6f')][_0xf4fc('0x70')],'raw':!![]};var _0x17b6a7=[];var _0x94b8a5=[];return db[_0xf4fc('0x71')][_0xf4fc('0x72')](_0xdfc7cc[_0xf4fc('0x73')](),_0x2ce489)[_0xf4fc('0x5a')](function(_0x143c62){_0x4a140f=_[_0xf4fc('0x74')](_0x143c62,'id');_0x2ce489=_[_0xf4fc('0x75')](_0x2ce489,{'model':db[_0xa4bfbf],'mapToModel':!![],'nest':!![]});if(_0x47b5aa['fields']){_0x4716ee['attributes'][_0xf4fc('0x52')](function(_0x5ef7d4){_0x1b04e6[_0xf4fc('0x8')]('i.'+_0x5ef7d4);});}else{_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x76'),_0xf4fc('0x3c'));_0x1b04e6[_0xf4fc('0x8')]('a.key','Account.key');_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x77'),_0xf4fc('0x78'));if(_0x40be04==='mail'){_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x79'),_0xf4fc('0x7a'));_0x1b04e6[_0xf4fc('0x8')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_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',_0xf4fc('0x7b'));_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x7c'));_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x7d'));_0x1b04e6['field'](_0xf4fc('0x7e'));_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x7f'));_0x1b04e6[_0xf4fc('0x8')]('i.closedAt');_0x1b04e6[_0xf4fc('0x8')]('i.attach');_0x1b04e6['field'](_0xf4fc('0x80'));_0x1b04e6[_0xf4fc('0x8')]('i.lastMsgDirection');_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x81'));_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x66'));_0x1b04e6[_0xf4fc('0x8')]('i.secondDisposition');_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x64'));_0x1b04e6[_0xf4fc('0x8')]('i.substatus');_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x82'));_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x83'));_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x84'));_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x85'));}else if(_0x40be04==='openchannel'){_0x1b04e6['field'](_0xf4fc('0x86'),_0xf4fc('0x7b'));}else{_0x1b04e6['field'](_0xf4fc('0x87'),'contactName');}if(_0x40be04!==_0xf4fc('0x67')){_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x88'));}_0x1b04e6['field'](_0xf4fc('0x89'),'Contact.firstName');_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x8a'),_0xf4fc('0x8b'));_0x1b04e6['field'](_0xf4fc('0x8c'),_0xf4fc('0x8d'));_0x1b04e6[_0xf4fc('0x8')]('c.phone',_0xf4fc('0x8e'));_0x1b04e6['field']('c.mobile',_0xf4fc('0x8f'));_0x1b04e6[_0xf4fc('0x8')]('c.fax',_0xf4fc('0x90'));_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x91'),'Owner.fullname');_0x1b04e6['field'](_0xf4fc('0x92'),_0xf4fc('0x93'));_0x1b04e6[_0xf4fc('0x8')](_0xf4fc('0x94'),_0xf4fc('0x95'));}if(_0x4716ee[_0xf4fc('0x96')]){_0x1b04e6['limit'](_0x4716ee['limit']);}if(_0x4716ee[_0xf4fc('0x97')]){_0x1b04e6[_0xf4fc('0x97')](_0x4716ee[_0xf4fc('0x97')]);}return db[_0xf4fc('0x71')][_0xf4fc('0x72')](_0x1b04e6[_0xf4fc('0x73')](),_0x2ce489);})[_0xf4fc('0x5a')](function(_0x5e35a0){_0x17b6a7=_0x5e35a0;var _0x1b1809=getUsersQuery(_0x40be04,_0x17b6a7);return db[_0xf4fc('0x71')][_0xf4fc('0x72')](_0x1b1809[_0xf4fc('0x73')](),_0x2ce489);})[_0xf4fc('0x5a')](function(_0x5aad44){_0x94b8a5=_[_0xf4fc('0x98')](_0x5aad44,_0x1827cf);if(_0x40be04==='mail'){return db[_0xf4fc('0x99')][_0xf4fc('0x9a')]({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0xf4fc('0x5a')](function(_0x312c84){var _0x10fde0=_0x312c84?_0x312c84['enableEmailPreview']:undefined;var _0x5dd515=_0x17b6a7[_0xf4fc('0x16')](function(_0x30304f){return updateInteraction(_0x30304f,_0x4a140f,_0x94b8a5,_0x10fde0);});return Promise[_0xf4fc('0x9b')](_0x5dd515);});}function countFilteredInteractions(_0x840982,_0xf7788f){var _0x37f990=_0x840982[_0xf4fc('0x9c')]();_0x37f990['field'](_0xf4fc('0x9d'));_0x37f990[_0xf4fc('0x8')](_0xf4fc('0x76'),_0xf4fc('0x3c'));var _0xf9d5d1=utils[_0xf4fc('0x21')](_0xf7788f);if(!_['isEmpty'](_0xf9d5d1)){_0x37f990[_0xf4fc('0x14')](_0xf4fc('0x9e'),_0xf9d5d1);}var _0x4494d2={'type':db[_0xf4fc('0x6e')][_0xf4fc('0x6f')][_0xf4fc('0x70')],'raw':!![]};return db[_0xf4fc('0x71')]['query'](_0x37f990['toString'](),_0x4494d2);}module[_0xf4fc('0x9f')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index a0ac694..def41a2 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa30d=['../../mysqldb','map','fullname','split','forEach','push','waiting','answered','unmanaged','abandoned','total','disposition','UserId','talking','MailMessage','findOne','-id','then','plainBody','trimStart','catch','updateInteraction','Users','TagIds','Tags','lodash'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa30d,0x67));var _0xda30=function(_0x5edf2d,_0x36fca4){_0x5edf2d=_0x5edf2d-0x0;var _0x1c3216=_0xa30d[_0x5edf2d];return _0x1c3216;};'use strict';var _=require(_0xda30('0x0'));var db=require(_0xda30('0x1'))['db'];function getInteractionUsers(_0x413486,_0x51b1cb){return new Promise(function(_0x5b3382,_0x3e5d93){try{var _0x442b82=[];if(_0x51b1cb[_0x413486]){_0x442b82=_0x51b1cb[_0x413486][_0xda30('0x2')](function(_0x2d0304){return{'id':_0x2d0304['id'],'fullname':_0x2d0304[_0xda30('0x3')]};});}return _0x5b3382(_0x442b82);}catch(_0x4477d7){_0x3e5d93(_0x4477d7);}});}function getInteractionTags(_0x50665a,_0x53ec0c){var _0x4fdc94=[];if(_0x50665a){_0x50665a[_0xda30('0x4')](',')[_0xda30('0x5')](function(_0xd3d259){_0x4fdc94[_0xda30('0x6')](_0x53ec0c[_0xd3d259]);});}return _0x4fdc94;}function updateWaitingCounter(_0x301389){if(_0x301389[_0xda30('0x7')]){_0x301389[_0xda30('0x7')]-=0x1;}}function updateInteractionCounters(_0x5a7d67){_0x5a7d67[_0xda30('0x7')]=0x0;_0x5a7d67['talking']=0x0;_0x5a7d67[_0xda30('0x8')]=0x0;_0x5a7d67[_0xda30('0x9')]=0x0;_0x5a7d67[_0xda30('0xa')]=0x0;_0x5a7d67[_0xda30('0xb')]=0x0;if(_0x5a7d67['closed']){if(_0x5a7d67[_0xda30('0xc')]===_0xda30('0xa')){_0x5a7d67[_0xda30('0xa')]+=0x1;updateWaitingCounter(_0x5a7d67);}if(_0x5a7d67[_0xda30('0xd')]){_0x5a7d67[_0xda30('0x8')]+=0x1;if(_0x5a7d67[_0xda30('0xe')]){_0x5a7d67['talking']-=0x1;}}else{if(_0x5a7d67['disposition']){_0x5a7d67[_0xda30('0x9')]+=0x1;updateWaitingCounter(_0x5a7d67);}}}else{if(!_0x5a7d67[_0xda30('0xd')]){_0x5a7d67[_0xda30('0x7')]+=0x1;}if(_0x5a7d67[_0xda30('0xd')]){_0x5a7d67[_0xda30('0xe')]+=0x1;updateWaitingCounter(_0x5a7d67);}}_0x5a7d67[_0xda30('0xb')]+=0x1;return _0x5a7d67;}function getLastMessageText(_0xb0a7e7){return db[_0xda30('0xf')][_0xda30('0x10')]({'where':{'$and':[{'MailInteractionId':_0xb0a7e7['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xda30('0x11'),'raw':!![]})[_0xda30('0x12')](function(_0x138455){if(_0x138455&&_0x138455[_0xda30('0x13')]){_0xb0a7e7['lastMsgText']=_[_0xda30('0x14')](_0x138455[_0xda30('0x13')]);}return _0xb0a7e7;})[_0xda30('0x15')](function(_0x76d36a){throw _0x76d36a;});}exports[_0xda30('0x16')]=function(_0x5d19b6,_0x5b1c90,_0x1dda76,_0x456b37){return new Promise(function(_0x1343b3,_0x561c1a){return getInteractionUsers(_0x5d19b6['id'],_0x1dda76)['then'](function(_0x18f3ac){_0x5d19b6[_0xda30('0x17')]=_0x18f3ac;return getInteractionTags(_0x5d19b6[_0xda30('0x18')],_0x5b1c90);})[_0xda30('0x12')](function(_0x2c3d50){_0x5d19b6[_0xda30('0x19')]=_0x2c3d50;delete _0x5d19b6[_0xda30('0x18')];return updateInteractionCounters(_0x5d19b6);})[_0xda30('0x12')](function(_0x2d2846){if(_0x456b37){return getLastMessageText(_0x2d2846);}else{return _0x2d2846;}})[_0xda30('0x12')](function(_0x1b2709){_0x1343b3(_0x1b2709);})[_0xda30('0x15')](function(_0x4947c2){_0x561c1a(_0x4947c2);});});}; \ No newline at end of file +var _0x5ee8=['abandoned','total','UserId','disposition','out','plainBody','-id','then','lastMsgText','updateInteraction','TagIds','catch','lodash','map','fullname','push','waiting','talking','unmanaged'];(function(_0x2cc52e,_0x1fd216){var _0x2c5429=function(_0x4cd55a){while(--_0x4cd55a){_0x2cc52e['push'](_0x2cc52e['shift']());}};_0x2c5429(++_0x1fd216);}(_0x5ee8,0xf0));var _0x85ee=function(_0x19cd79,_0x4884cd){_0x19cd79=_0x19cd79-0x0;var _0x5380ae=_0x5ee8[_0x19cd79];return _0x5380ae;};'use strict';var _=require(_0x85ee('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x2bac74,_0x5c5189){return new Promise(function(_0x3b4f1c,_0x4b3b8d){try{var _0x515f50=[];if(_0x5c5189[_0x2bac74]){_0x515f50=_0x5c5189[_0x2bac74][_0x85ee('0x1')](function(_0x696d08){return{'id':_0x696d08['id'],'fullname':_0x696d08[_0x85ee('0x2')]};});}return _0x3b4f1c(_0x515f50);}catch(_0x2590a6){_0x4b3b8d(_0x2590a6);}});}function getInteractionTags(_0x37b2ba,_0x48879a){var _0x4a7aa3=[];if(_0x37b2ba){_0x37b2ba['split'](',')['forEach'](function(_0x50d0f8){_0x4a7aa3[_0x85ee('0x3')](_0x48879a[_0x50d0f8]);});}return _0x4a7aa3;}function updateWaitingCounter(_0x212fd5){if(_0x212fd5[_0x85ee('0x4')]){_0x212fd5['waiting']-=0x1;}}function updateInteractionCounters(_0x26d34c){_0x26d34c[_0x85ee('0x4')]=0x0;_0x26d34c[_0x85ee('0x5')]=0x0;_0x26d34c['answered']=0x0;_0x26d34c[_0x85ee('0x6')]=0x0;_0x26d34c[_0x85ee('0x7')]=0x0;_0x26d34c[_0x85ee('0x8')]=0x0;if(_0x26d34c['closed']){if(_0x26d34c['disposition']===_0x85ee('0x7')){_0x26d34c[_0x85ee('0x7')]+=0x1;updateWaitingCounter(_0x26d34c);}if(_0x26d34c[_0x85ee('0x9')]){_0x26d34c['answered']+=0x1;if(_0x26d34c[_0x85ee('0x5')]){_0x26d34c[_0x85ee('0x5')]-=0x1;}}else{if(_0x26d34c[_0x85ee('0xa')]){_0x26d34c['unmanaged']+=0x1;updateWaitingCounter(_0x26d34c);}}}else{if(!_0x26d34c[_0x85ee('0x9')]){_0x26d34c[_0x85ee('0x4')]+=0x1;}if(_0x26d34c[_0x85ee('0x9')]){_0x26d34c[_0x85ee('0x5')]+=0x1;updateWaitingCounter(_0x26d34c);}}_0x26d34c['total']+=0x1;return _0x26d34c;}function getLastMessageText(_0x11dfdc){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x11dfdc['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x85ee('0xb')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x85ee('0xc')],'order':_0x85ee('0xd'),'raw':!![]})[_0x85ee('0xe')](function(_0x32f714){if(_0x32f714&&_0x32f714[_0x85ee('0xc')]){_0x11dfdc[_0x85ee('0xf')]=_['trimStart'](_0x32f714[_0x85ee('0xc')]);}return _0x11dfdc;})['catch'](function(_0x17e677){throw _0x17e677;});}exports[_0x85ee('0x10')]=function(_0xc59343,_0x2aae37,_0x2769d7,_0x2d1a5f){return new Promise(function(_0x3b0936,_0x2be6a1){return getInteractionUsers(_0xc59343['id'],_0x2769d7)[_0x85ee('0xe')](function(_0x2f803b){_0xc59343['Users']=_0x2f803b;return getInteractionTags(_0xc59343[_0x85ee('0x11')],_0x2aae37);})[_0x85ee('0xe')](function(_0x51cf71){_0xc59343['Tags']=_0x51cf71;delete _0xc59343[_0x85ee('0x11')];return updateInteractionCounters(_0xc59343);})['then'](function(_0x5e5c9d){if(_0x2d1a5f){return getLastMessageText(_0x5e5c9d);}else{return _0x5e5c9d;}})[_0x85ee('0xe')](function(_0x13e73b){_0x3b0936(_0x13e73b);})[_0x85ee('0x12')](function(_0x2a0f30){_0x2be6a1(_0x2a0f30);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index bc5c009..175d7e5 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe126=['accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','Interaction','update','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','chat-interactions','whatsapp-interactions','chat','capitalize','InteractionId','upperFirst','websites'];(function(_0x5206fc,_0x2eec61){var _0x12acf6=function(_0x21c5aa){while(--_0x21c5aa){_0x5206fc['push'](_0x5206fc['shift']());}};_0x12acf6(++_0x2eec61);}(_0xe126,0x10d));var _0x6e12=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0xe126[_0x25d386];return _0x857f4a;};'use strict';var _=require(_0x6e12('0x0'));var db=require(_0x6e12('0x1'))['db'];var loggers={'openchannel':require(_0x6e12('0x2'))(_0x6e12('0x3')),'mail':require(_0x6e12('0x2'))('mail-interactions'),'fax':require(_0x6e12('0x2'))('fax-interactions'),'sms':require(_0x6e12('0x2'))('sms-interactions'),'chat':require('../../config/logger')(_0x6e12('0x4')),'whatsapp':require('../../config/logger')(_0x6e12('0x5'))};function getAccountFK(_0x1515cf){return _['capitalize'](_0x1515cf)+(_0x1515cf===_0x6e12('0x6')?'Website':'Account')+'Id';}function getInteractionFK(_0x1960e7){return _[_0x6e12('0x7')](_0x1960e7)+_0x6e12('0x8');}function getInteractionId(_0x165040,_0x5cec72,_0x1e1bf5){if(_0x165040&&_0x165040[_[_0x6e12('0x9')](_0x1e1bf5)+_0x6e12('0x8')]){return _0x165040[_[_0x6e12('0x9')](_0x1e1bf5)+_0x6e12('0x8')];}else if(_0x165040&&_0x165040['id']){return _0x165040['id'];}else if(_0x5cec72&&_0x5cec72['id']){return _0x5cec72['id'];}else{return'unknown';}}function getInteractionsTables(_0x5bc9f9){return{'accounts':_0x5bc9f9+'_'+(_0x5bc9f9===_0x6e12('0x6')?_0x6e12('0xa'):_0x6e12('0xb')),'interactions':_0x5bc9f9+_0x6e12('0xc'),'interactionsTags':_0x5bc9f9+_0x6e12('0xd'),'messages':_0x5bc9f9+_0x6e12('0xe'),'userInteractions':_0x6e12('0xf')+_0x5bc9f9+'_interactions'};}function getSelectedTags(_0x56df92){var _0x5eb19d=[];if(_0x56df92){_0x5eb19d=Array[_0x6e12('0x10')](_0x56df92)?_0x56df92:[_0x56df92];}return _0x5eb19d;}function log(_0x1e344e,_0x507b37,_0x2d2008,_0x4da1b0,_0x4aebda,_0x315d52){loggers[_0x4aebda[_0x6e12('0x11')]()][_0x1e344e](_0x6e12('0x12'),_0x315d52['toUpperCase'](),_0x507b37?_0x507b37['id']:null,_0x507b37?_0x507b37['name']:null,_0x507b37?_0x507b37[_0x6e12('0x13')]:null,getInteractionId(_0x2d2008,_0x4da1b0,_0x4aebda),_0x2d2008?JSON[_0x6e12('0x14')](_0x2d2008):_0x6e12('0x15'));}function updateUser(_0x17d319,_0x19bc92,_0x525ad4,_0x50a850,_0x762d09){db[_[_0x6e12('0x9')](_0x50a850)+_0x6e12('0x16')]['findOne']({'where':{'id':getInteractionId(_0x19bc92,_0x525ad4,_0x50a850)}})['then'](function(_0x5d5fb4){if(_0x5d5fb4){return _0x5d5fb4[_0x6e12('0x17')]({'UserId':_0x17d319?_0x17d319['id']:null});}})['then'](function(_0x72910d){if(_0x72910d){log(_0x6e12('0x18'),_0x17d319,_0x19bc92,_0x525ad4,_0x50a850,_0x762d09);}})[_0x6e12('0x19')](function(){log(_0x6e12('0x1a'),_0x17d319,_0x19bc92,_0x525ad4,_0x50a850,_0x762d09);});}module[_0x6e12('0x1b')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x4443=['../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_messages','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','then','update','info','catch','error'];(function(_0x3c8826,_0x14486d){var _0x11c9c4=function(_0x38f5f0){while(--_0x38f5f0){_0x3c8826['push'](_0x3c8826['shift']());}};_0x11c9c4(++_0x14486d);}(_0x4443,0x13f));var _0x3444=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x4443[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var db=require(_0x3444('0x0'))['db'];var loggers={'openchannel':require(_0x3444('0x1'))(_0x3444('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x3444('0x1'))(_0x3444('0x3')),'chat':require('../../config/logger')(_0x3444('0x4')),'whatsapp':require(_0x3444('0x1'))(_0x3444('0x5'))};function getAccountFK(_0x1158a4){return _[_0x3444('0x6')](_0x1158a4)+(_0x1158a4===_0x3444('0x7')?_0x3444('0x8'):_0x3444('0x9'))+'Id';}function getInteractionFK(_0x1c3fde){return _[_0x3444('0x6')](_0x1c3fde)+_0x3444('0xa');}function getInteractionId(_0x22d27a,_0x3786d3,_0x5943e5){if(_0x22d27a&&_0x22d27a[_[_0x3444('0xb')](_0x5943e5)+_0x3444('0xa')]){return _0x22d27a[_['upperFirst'](_0x5943e5)+_0x3444('0xa')];}else if(_0x22d27a&&_0x22d27a['id']){return _0x22d27a['id'];}else if(_0x3786d3&&_0x3786d3['id']){return _0x3786d3['id'];}else{return _0x3444('0xc');}}function getInteractionsTables(_0x40d014){return{'accounts':_0x40d014+'_'+(_0x40d014==='chat'?_0x3444('0xd'):_0x3444('0xe')),'interactions':_0x40d014+_0x3444('0xf'),'interactionsTags':_0x40d014+'_interaction_has_tags','messages':_0x40d014+_0x3444('0x10'),'userInteractions':'user_has_'+_0x40d014+_0x3444('0xf')};}function getSelectedTags(_0x3aa853){var _0x5e0623=[];if(_0x3aa853){_0x5e0623=Array['isArray'](_0x3aa853)?_0x3aa853:[_0x3aa853];}return _0x5e0623;}function log(_0x5e2388,_0xe48277,_0x42e054,_0x3fb16c,_0x5b7909,_0x18c043){loggers[_0x5b7909[_0x3444('0x11')]()][_0x5e2388](_0x3444('0x12'),_0x18c043[_0x3444('0x13')](),_0xe48277?_0xe48277['id']:null,_0xe48277?_0xe48277[_0x3444('0x14')]:null,_0xe48277?_0xe48277[_0x3444('0x15')]:null,getInteractionId(_0x42e054,_0x3fb16c,_0x5b7909),_0x42e054?JSON[_0x3444('0x16')](_0x42e054):'null');}function updateUser(_0x437119,_0xcf34da,_0x5c7464,_0x7c54db,_0x52a15e){db[_[_0x3444('0xb')](_0x7c54db)+_0x3444('0x17')]['findOne']({'where':{'id':getInteractionId(_0xcf34da,_0x5c7464,_0x7c54db)}})[_0x3444('0x18')](function(_0x52877c){if(_0x52877c){return _0x52877c[_0x3444('0x19')]({'UserId':_0x437119?_0x437119['id']:null});}})['then'](function(_0x4105ba){if(_0x4105ba){log(_0x3444('0x1a'),_0x437119,_0xcf34da,_0x5c7464,_0x7c54db,_0x52a15e);}})[_0x3444('0x1b')](function(){log(_0x3444('0x1c'),_0x437119,_0xcf34da,_0x5c7464,_0x7c54db,_0x52a15e);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 4bc2b55..9a2cb0c 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 _0xf11a=['%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','format'];(function(_0x53957d,_0x2aedce){var _0x52e8f7=function(_0x59fb9f){while(--_0x59fb9f){_0x53957d['push'](_0x53957d['shift']());}};_0x52e8f7(++_0x2aedce);}(_0xf11a,0xf3));var _0xaf11=function(_0x5093e9,_0x5154d0){_0x5093e9=_0x5093e9-0x0;var _0x4c9a22=_0xf11a[_0x5093e9];return _0x4c9a22;};'use strict';var crypto=require(_0xaf11('0x0'));var util=require(_0xaf11('0x1'));var compose=require('composable-middleware');var db=require(_0xaf11('0x2'))['db'];var config=require(_0xaf11('0x3'));function getValueFromLicense(_0x1adfd0,_0x489b0b){if(_0x1adfd0&&_0x489b0b){if(_0x489b0b[_0xaf11('0x4')]&&_0x489b0b[_0xaf11('0x5')]){var _0x380703=_0x489b0b[_0xaf11('0x4')];var _0xe6e66f=_0x489b0b[_0xaf11('0x5')];var _0x3103fe=_0x380703[_0xaf11('0x6')]('-')[0x4];var _0x5e5edb=_0x380703[_0xaf11('0x6')]('-')[0x0];var _0x20376b=crypto[_0xaf11('0x7')]('aes-256-ctr',util[_0xaf11('0x8')](_0xaf11('0x9'),_0x3103fe,_0x380703,_0x5e5edb));var _0x4a0829=_0x20376b[_0xaf11('0xa')](_0xe6e66f,_0xaf11('0xb'),_0xaf11('0xc'));_0x4a0829+=_0x20376b[_0xaf11('0xd')]('utf8');var _0xa5c3a=JSON[_0xaf11('0xe')](_0x4a0829);return _0xa5c3a[_0xaf11('0xf')](_0x1adfd0)?_0xa5c3a[_0x1adfd0]:null;}}return null;}function isLimit(_0x46d688,_0x5966d7,_0x5d586c,_0x4ecfaf){var _0x2a7ee8=_0x5966d7;return compose()[_0xaf11('0x10')](function(_0x454c21,_0x7fcb95,_0xf4d3c6){return db[_0xaf11('0x11')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xaf11('0x12')](function(_0x4877f5){var _0x47ef18=getValueFromLicense(_0x46d688,_0x4877f5);return _0x47ef18?_0x47ef18:_0x2a7ee8;})[_0xaf11('0x12')](function(_0x55b386){_0x2a7ee8=_0x55b386;return _0x5d586c[_0xaf11('0x13')](_0x4ecfaf);})[_0xaf11('0x12')](function(_0x2c04cc){if(_0x2c04cc>=_0x2a7ee8){return _0x7fcb95[_0xaf11('0x14')](0x193)[_0xaf11('0x15')]({'message':util[_0xaf11('0x8')](_0xaf11('0x16'),_0x46d688)});}_0xf4d3c6();})[_0xaf11('0x17')](function(_0x2cda71){_0xf4d3c6(_0x2cda71);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xaf11('0x18')],{'where':{'$or':[{'role':_0xaf11('0x19')},{'role':_0xaf11('0x1a')}]}});}exports[_0xaf11('0x1b')]=isUserLimit; \ No newline at end of file +var _0xe931=['User','admin','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','License','findOne','then','count','json','catch'];(function(_0x21f9b7,_0x3afd00){var _0x2c3857=function(_0x148ddb){while(--_0x148ddb){_0x21f9b7['push'](_0x21f9b7['shift']());}};_0x2c3857(++_0x3afd00);}(_0xe931,0x162));var _0x1e93=function(_0x4409b2,_0x5ed5a8){_0x4409b2=_0x4409b2-0x0;var _0x61b710=_0xe931[_0x4409b2];return _0x61b710;};'use strict';var crypto=require('crypto');var util=require(_0x1e93('0x0'));var compose=require('composable-middleware');var db=require(_0x1e93('0x1'))['db'];var config=require(_0x1e93('0x2'));function getValueFromLicense(_0x539071,_0x96fd31){if(_0x539071&&_0x96fd31){if(_0x96fd31[_0x1e93('0x3')]&&_0x96fd31[_0x1e93('0x4')]){var _0x1cfce8=_0x96fd31[_0x1e93('0x3')];var _0x410955=_0x96fd31[_0x1e93('0x4')];var _0x439c80=_0x1cfce8[_0x1e93('0x5')]('-')[0x4];var _0x494a40=_0x1cfce8[_0x1e93('0x5')]('-')[0x0];var _0x513aff=crypto[_0x1e93('0x6')](_0x1e93('0x7'),util[_0x1e93('0x8')](_0x1e93('0x9'),_0x439c80,_0x1cfce8,_0x494a40));var _0x12d477=_0x513aff[_0x1e93('0xa')](_0x410955,_0x1e93('0xb'),_0x1e93('0xc'));_0x12d477+=_0x513aff[_0x1e93('0xd')](_0x1e93('0xc'));var _0xcb4250=JSON['parse'](_0x12d477);return _0xcb4250['hasOwnProperty'](_0x539071)?_0xcb4250[_0x539071]:null;}}return null;}function isLimit(_0x496e4d,_0x50b8e8,_0x558952,_0xddcd9b){var _0x4b1fd6=_0x50b8e8;return compose()['use'](function(_0x5ecbef,_0xd29f4,_0x5a3e36){return db[_0x1e93('0xe')][_0x1e93('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x1e93('0x10')](function(_0x444b5f){var _0x483361=getValueFromLicense(_0x496e4d,_0x444b5f);return _0x483361?_0x483361:_0x4b1fd6;})[_0x1e93('0x10')](function(_0x498641){_0x4b1fd6=_0x498641;return _0x558952[_0x1e93('0x11')](_0xddcd9b);})[_0x1e93('0x10')](function(_0x2537e4){if(_0x2537e4>=_0x4b1fd6){return _0xd29f4['status'](0x193)[_0x1e93('0x12')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x496e4d)});}_0x5a3e36();})[_0x1e93('0x13')](function(_0xc62d4){_0x5a3e36(_0xc62d4);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x1e93('0x14')],{'where':{'$or':[{'role':_0x1e93('0x15')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index fa98829..0dd305d 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 _0xb95d=['utcOffset','minutes','seconds','lodash','parseSearch','sqlOperator','and','replace','[$and]','[$or]','split','length','forEach','shift','map','conditions','push','buildExpression','DATE','operator','$between','value','includes','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','$ne','$notIn','$in','$eq','=\x20?','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','$gt','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','pop'];(function(_0x38b170,_0x14d12b){var _0x3a5619=function(_0x3be0f3){while(--_0x3be0f3){_0x38b170['push'](_0x38b170['shift']());}};_0x3a5619(++_0x14d12b);}(_0xb95d,0x183));var _0xdb95=function(_0x3911a0,_0x399077){_0x3911a0=_0x3911a0-0x0;var _0xf3dd14=_0xb95d[_0x3911a0];return _0xf3dd14;};'use strict';var _=require(_0xdb95('0x0'));var moment=require('moment');exports[_0xdb95('0x1')]=function(_0x13e620){var _0x489137={'conditions':[]};_0x489137[_0xdb95('0x2')]=_['startsWith'](_0x13e620,'[$or]')?'or':_0xdb95('0x3');var _0x10df36=_0x13e620[_0xdb95('0x4')](_0xdb95('0x5'),'')['replace'](_0xdb95('0x6'),'')[_0xdb95('0x7')]('||');for(var _0x480b83=0x0;_0x480b83<_0x10df36[_0xdb95('0x8')];_0x480b83++){var _0x19fed5=_0x10df36[_0x480b83][_0xdb95('0x7')](':=');var _0x22d76a=_0x19fed5[0x0];var _0xa3c9b8=_0x19fed5['slice'](0x1);_0xa3c9b8[_0xdb95('0x9')](function(_0x394f22){var _0x5db464=_0x394f22[_0xdb95('0x7')]('[')[_0xdb95('0xa')]();var _0x39660f=_0x394f22['match'](/\[(.*?)\]/g);_0x39660f['forEach'](function(_0x2bb126){var _0x22b42e=_0x2bb126[_0xdb95('0x7')]('[')['filter'](function(_0x12f735){return _0x12f735['indexOf'](']')>-0x1;})[_0xdb95('0xb')](function(_0x408c1d){return _0x408c1d[_0xdb95('0x7')](']')[0x0];})[0x0];_0x489137[_0xdb95('0xc')][_0xdb95('0xd')]({'field':_0x22d76a,'operator':_0x5db464,'value':_0x22b42e});});});}return _0x489137;};exports[_0xdb95('0xe')]=function(_0x24000b,_0x4c282a,_0x5cb978){var _0x33c58e={};if(_0x4c282a===_0xdb95('0xf')){if(_0x5cb978['operator']==='$eq'){_0x5cb978[_0xdb95('0x10')]=_0xdb95('0x11');_0x5cb978['value']+=','+_0x5cb978[_0xdb95('0x12')];}else if(_[_0xdb95('0x13')](['$gt',_0xdb95('0x14')],_0x5cb978['operator'])){_0x5cb978[_0xdb95('0x12')]=moment(_0x5cb978['value'])[_0xdb95('0x15')](0x1,_0xdb95('0x16'))[_0xdb95('0x17')](_0xdb95('0x18'));}}if(_0x5cb978['castTo']){_0x4c282a=_0x5cb978[_0xdb95('0x19')];_0x33c58e[_0xdb95('0x1a')]=_0xdb95('0x1b')+_0x24000b+'.'+_0x5cb978[_0xdb95('0x1c')]+'\x20AS\x20'+_0x5cb978[_0xdb95('0x19')]+')\x20'+parseOperator(_0x5cb978['operator']);}else{_0x33c58e['text']=_0x24000b+'.'+_0x5cb978[_0xdb95('0x1c')]+'\x20'+parseOperator(_0x5cb978[_0xdb95('0x10')]);}if(_[_0xdb95('0x13')]([_0xdb95('0x1d'),_0xdb95('0x1e')],_0x5cb978[_0xdb95('0x10')]))_0x33c58e['text']='('+_0x33c58e['text']+'\x20OR\x20'+_0x24000b+'.'+_0x5cb978[_0xdb95('0x1c')]+'\x20IS\x20NULL)';_0x33c58e[_0xdb95('0x12')]=parseValue(_0x4c282a,_0x5cb978[_0xdb95('0x10')],_0x5cb978[_0xdb95('0x12')]);return _0x33c58e;};function parseOperator(_0x49de85){var _0x99372d;switch(_0x49de85){case _0xdb95('0x1f'):_0x99372d='IN\x20?';break;case _0xdb95('0x1e'):_0x99372d='NOT\x20IN\x20?';break;case _0xdb95('0x20'):_0x99372d=_0xdb95('0x21');break;case'$ne':_0x99372d=_0xdb95('0x22');break;case _0xdb95('0x23'):case _0xdb95('0x24'):case'$endsWith':_0x99372d=_0xdb95('0x25');break;case _0xdb95('0x26'):_0x99372d='<\x20?';break;case _0xdb95('0x27'):_0x99372d='>\x20?';break;case _0xdb95('0x14'):_0x99372d=_0xdb95('0x28');break;case _0xdb95('0x29'):_0x99372d='>=\x20?';break;case _0xdb95('0x11'):_0x99372d=_0xdb95('0x2a');break;}return _0x99372d;}function parseValue(_0x34936b,_0x222abc,_0x2807c4){var _0x1793c4={'start':undefined,'end':undefined};switch(_0x222abc){case _0xdb95('0x1f'):case _0xdb95('0x1e'):_0x1793c4['start']=_0x2807c4[_0xdb95('0x7')](',');break;case _0xdb95('0x23'):_0x1793c4[_0xdb95('0x2b')]='%'+_0x2807c4+'%';break;case _0xdb95('0x24'):_0x1793c4[_0xdb95('0x2b')]=_0x2807c4+'%';break;case'$endsWith':_0x1793c4[_0xdb95('0x2b')]='%'+_0x2807c4;break;case _0xdb95('0x11'):var _0x49d3c4=_0x2807c4[_0xdb95('0x7')](',');var _0x2807c4=_0x49d3c4['shift']();var _0x2e49c5=_0x49d3c4[_0xdb95('0x2c')]();if(_0x34936b===_0xdb95('0xf')){_0x2807c4=moment(_0x2807c4)[_0xdb95('0x2d')](0x0,!![])[_0xdb95('0x17')]();_0x2e49c5=moment(_0x2e49c5)[_0xdb95('0x2d')](0x0,!![])[_0xdb95('0x15')](0x17,'hours')[_0xdb95('0x15')](0x3b,_0xdb95('0x2e'))['add'](0x3b,_0xdb95('0x2f'))[_0xdb95('0x17')]();}_0x1793c4={'start':_0x2807c4,'end':_0x2e49c5};break;default:_0x1793c4[_0xdb95('0x2b')]=_0x2807c4;break;}return _0x1793c4;} \ No newline at end of file +var _0xf878=['text','CAST(','field','\x20AS\x20','$ne','\x20IS\x20NULL)','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','<\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','$in','start','shift','pop','utcOffset','add','minutes','seconds','lodash','moment','parseSearch','sqlOperator','replace','[$or]','split','slice','forEach','match','filter','indexOf','map','push','operator','$eq','$between','value','includes','$gt','format','YYYY-MM-DD','castTo'];(function(_0x5a9130,_0x1a32f3){var _0x53580d=function(_0x357363){while(--_0x357363){_0x5a9130['push'](_0x5a9130['shift']());}};_0x53580d(++_0x1a32f3);}(_0xf878,0x1e7));var _0x8f87=function(_0x1dba2,_0xbada75){_0x1dba2=_0x1dba2-0x0;var _0x191f97=_0xf878[_0x1dba2];return _0x191f97;};'use strict';var _=require(_0x8f87('0x0'));var moment=require(_0x8f87('0x1'));exports[_0x8f87('0x2')]=function(_0x5a5704){var _0x22049b={'conditions':[]};_0x22049b[_0x8f87('0x3')]=_['startsWith'](_0x5a5704,'[$or]')?'or':'and';var _0x23d55b=_0x5a5704[_0x8f87('0x4')]('[$and]','')['replace'](_0x8f87('0x5'),'')[_0x8f87('0x6')]('||');for(var _0x546b6f=0x0;_0x546b6f<_0x23d55b['length'];_0x546b6f++){var _0x2a7c02=_0x23d55b[_0x546b6f]['split'](':=');var _0x36324f=_0x2a7c02[0x0];var _0x3ca8e2=_0x2a7c02[_0x8f87('0x7')](0x1);_0x3ca8e2[_0x8f87('0x8')](function(_0x557ba0){var _0x4e5663=_0x557ba0[_0x8f87('0x6')]('[')['shift']();var _0x38a181=_0x557ba0[_0x8f87('0x9')](/\[(.*?)\]/g);_0x38a181[_0x8f87('0x8')](function(_0x4e84d7){var _0xd74655=_0x4e84d7[_0x8f87('0x6')]('[')[_0x8f87('0xa')](function(_0x189884){return _0x189884[_0x8f87('0xb')](']')>-0x1;})[_0x8f87('0xc')](function(_0x44bb8c){return _0x44bb8c[_0x8f87('0x6')](']')[0x0];})[0x0];_0x22049b['conditions'][_0x8f87('0xd')]({'field':_0x36324f,'operator':_0x4e5663,'value':_0xd74655});});});}return _0x22049b;};exports['buildExpression']=function(_0x43145e,_0x539f74,_0x51209b){var _0x400477={};if(_0x539f74==='DATE'){if(_0x51209b[_0x8f87('0xe')]===_0x8f87('0xf')){_0x51209b[_0x8f87('0xe')]=_0x8f87('0x10');_0x51209b[_0x8f87('0x11')]+=','+_0x51209b[_0x8f87('0x11')];}else if(_[_0x8f87('0x12')]([_0x8f87('0x13'),'$lte'],_0x51209b['operator'])){_0x51209b[_0x8f87('0x11')]=moment(_0x51209b[_0x8f87('0x11')])['add'](0x1,'days')[_0x8f87('0x14')](_0x8f87('0x15'));}}if(_0x51209b[_0x8f87('0x16')]){_0x539f74=_0x51209b[_0x8f87('0x16')];_0x400477[_0x8f87('0x17')]=_0x8f87('0x18')+_0x43145e+'.'+_0x51209b[_0x8f87('0x19')]+_0x8f87('0x1a')+_0x51209b[_0x8f87('0x16')]+')\x20'+parseOperator(_0x51209b[_0x8f87('0xe')]);}else{_0x400477[_0x8f87('0x17')]=_0x43145e+'.'+_0x51209b[_0x8f87('0x19')]+'\x20'+parseOperator(_0x51209b[_0x8f87('0xe')]);}if(_[_0x8f87('0x12')]([_0x8f87('0x1b'),'$notIn'],_0x51209b['operator']))_0x400477[_0x8f87('0x17')]='('+_0x400477[_0x8f87('0x17')]+'\x20OR\x20'+_0x43145e+'.'+_0x51209b[_0x8f87('0x19')]+_0x8f87('0x1c');_0x400477['value']=parseValue(_0x539f74,_0x51209b[_0x8f87('0xe')],_0x51209b[_0x8f87('0x11')]);return _0x400477;};function parseOperator(_0xbad20d){var _0x144145;switch(_0xbad20d){case'$in':_0x144145=_0x8f87('0x1d');break;case _0x8f87('0x1e'):_0x144145=_0x8f87('0x1f');break;case _0x8f87('0xf'):_0x144145=_0x8f87('0x20');break;case'$ne':_0x144145=_0x8f87('0x21');break;case _0x8f87('0x22'):case'$startsWith':case _0x8f87('0x23'):_0x144145=_0x8f87('0x24');break;case'$lt':_0x144145=_0x8f87('0x25');break;case _0x8f87('0x13'):_0x144145=_0x8f87('0x26');break;case _0x8f87('0x27'):_0x144145=_0x8f87('0x28');break;case _0x8f87('0x29'):_0x144145=_0x8f87('0x2a');break;case _0x8f87('0x10'):_0x144145='BETWEEN\x20?\x20AND\x20?';break;}return _0x144145;}function parseValue(_0x429262,_0x27ff0f,_0x5151fb){var _0x3baa96={'start':undefined,'end':undefined};switch(_0x27ff0f){case _0x8f87('0x2b'):case'$notIn':_0x3baa96[_0x8f87('0x2c')]=_0x5151fb['split'](',');break;case _0x8f87('0x22'):_0x3baa96[_0x8f87('0x2c')]='%'+_0x5151fb+'%';break;case'$startsWith':_0x3baa96[_0x8f87('0x2c')]=_0x5151fb+'%';break;case _0x8f87('0x23'):_0x3baa96[_0x8f87('0x2c')]='%'+_0x5151fb;break;case _0x8f87('0x10'):var _0x2a2fc9=_0x5151fb[_0x8f87('0x6')](',');var _0x5151fb=_0x2a2fc9[_0x8f87('0x2d')]();var _0x49bb2b=_0x2a2fc9[_0x8f87('0x2e')]();if(_0x429262==='DATE'){_0x5151fb=moment(_0x5151fb)['utcOffset'](0x0,!![])[_0x8f87('0x14')]();_0x49bb2b=moment(_0x49bb2b)[_0x8f87('0x2f')](0x0,!![])[_0x8f87('0x30')](0x17,'hours')[_0x8f87('0x30')](0x3b,_0x8f87('0x31'))[_0x8f87('0x30')](0x3b,_0x8f87('0x32'))['format']();}_0x3baa96={'start':_0x5151fb,'end':_0x49bb2b};break;default:_0x3baa96[_0x8f87('0x2c')]=_0x5151fb;break;}return _0x3baa96;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 215044e..3878989 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 _0xb209=['substr','DESC','cast','col','unsigned','ASC','length','isObject','isString','unset','hasOwnProperty','omit','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','query','$id','model','intersection','attributes','nolimit','sort','where','pick','filter','object','value','merge','lower','options','includeAll','include','lodash','sequelize','moment','../../mysqldb','includes','parse','keys','alias','fields','raw','split','filters','isEmpty','forOwn','type','DATE','isPlainObject','format','utc','$lte','YYYY-MM-DD','name','uniqueid','isArray','limit','offset','map','indexOf','priority'];(function(_0x2848da,_0x33cd72){var _0x20bfa3=function(_0x59a3f5){while(--_0x59a3f5){_0x2848da['push'](_0x2848da['shift']());}};_0x20bfa3(++_0x33cd72);}(_0xb209,0x6d));var _0x9b20=function(_0x319831,_0x1a99f0){_0x319831=_0x319831-0x0;var _0x233be4=_0xb209[_0x319831];return _0x233be4;};'use strict';var _=require(_0x9b20('0x0'));var sequelize=require(_0x9b20('0x1'));var moment=require(_0x9b20('0x2'));var db=require(_0x9b20('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x495033){var _0x8c8f2e=['ne'];try{var _0x416414=JSON['parse'](_0x495033);var _0x457b6b=Object['keys'](_0x416414)[0x0];return _0x8c8f2e[_0x9b20('0x4')](_0x457b6b);}catch(_0x71a533){return![];}}function getOperatorValue(_0xed304d){var _0x46d43d=JSON[_0x9b20('0x5')](_0xed304d);var _0xf80424=Object[_0x9b20('0x6')](_0x46d43d)[0x0];var _0xd8aba3=_0x46d43d[_0xf80424];return{['$'+_0xf80424]:_0xd8aba3};}function parseIncludeModel(_0x1a7678){var _0xf65b82=JSON[_0x9b20('0x5')](_0x1a7678);return{'model':db[_0xf65b82['model']],'as':_0xf65b82[_0x9b20('0x7')],'attributes':_0xf65b82[_0x9b20('0x8')],'raw':_0xf65b82[_0x9b20('0x9')]};}exports[_0x9b20('0x8')]=function(_0x46a19a){var _0x229908=null;if(_0x46a19a){_0x229908=_0x46a19a[_0x9b20('0xa')](',');}return _0x229908;};exports[_0x9b20('0xb')]=function(_0x33fbb9,_0x286d35){var _0x548834={};if(!_[_0x9b20('0xc')](_0x33fbb9)){_[_0x9b20('0xd')](_0x33fbb9,function(_0x10c7ec,_0x322500){try{if(_0x286d35){var _0x319020=_['find'](_0x286d35,{'name':_0x322500})||{};if(hasSequelizeOperator(_0x10c7ec)){_0x548834[_0x322500]=getOperatorValue(_0x10c7ec);}else if(_0x319020[_0x9b20('0xe')]===_0x9b20('0xf')&&_[_0x9b20('0x10')](_0x10c7ec)){var _0x88c758=JSON[_0x9b20('0x5')](_0x10c7ec);var _0x39dcae={'$gte':moment(moment(_0x88c758['$gte'])[_0x9b20('0x11')]('YYYY-MM-DD'))[_0x9b20('0x12')]()[_0x9b20('0x11')](),'$lte':moment(moment(_0x88c758[_0x9b20('0x13')])[_0x9b20('0x11')](_0x9b20('0x14')))[_0x9b20('0x12')]()['subtract'](0x1,'s')[_0x9b20('0x11')]()};_0x548834[_0x322500]=_0x39dcae;}else if(_0x319020[_0x9b20('0x15')]===_0x9b20('0x16')){_0x548834[_0x322500]=_0x10c7ec;}else{_0x548834[_0x322500]=_[_0x9b20('0x17')](_0x10c7ec)?_0x10c7ec:JSON[_0x9b20('0x5')](_0x10c7ec);}}else{_0x548834[_0x322500]=_[_0x9b20('0x17')](_0x10c7ec)?_0x10c7ec:JSON['parse'](_0x10c7ec);}}catch(_0x4c5480){_0x548834[_0x322500]=_0x10c7ec['split'](',');}});}return _0x548834;};exports[_0x9b20('0x18')]=function(_0x1acfb8){_0x1acfb8=parseInt(_0x1acfb8,0xa);if(!_0x1acfb8||_0x1acfb8<0x0){_0x1acfb8=LIMIT_VALUE;}return _0x1acfb8;};exports[_0x9b20('0x19')]=function(_0x57b5e6){_0x57b5e6=parseInt(_0x57b5e6,0xa);if(!_0x57b5e6||_0x57b5e6<0x0){_0x57b5e6=0x0;}return _0x57b5e6;};exports['sort']=function(_0x184990){var _0xb864f9,_0x29ce61=null;if(_0x184990){_0xb864f9=_0x184990[_0x9b20('0xa')](',');_0x29ce61=_[_0x9b20('0x1a')](_0xb864f9,function(_0x533ca0){if(_0x533ca0[_0x9b20('0x1b')]('-')===0x0){return[_0x533ca0===_0x9b20('0x1c')?sequelize['cast'](sequelize['col'](_0x9b20('0x1c')),'unsigned'):_0x533ca0[_0x9b20('0x1d')](0x1),_0x9b20('0x1e')];}else{return[_0x533ca0===_0x9b20('0x1c')?sequelize[_0x9b20('0x1f')](sequelize[_0x9b20('0x20')](_0x9b20('0x1c')),_0x9b20('0x21')):_0x533ca0,_0x9b20('0x22')];}});}return _0x29ce61;};exports['omit']=function(_0x51b9dc,_0x37bba0){if(_[_0x9b20('0xc')](_0x51b9dc)){return _0x51b9dc;}if(_[_0x9b20('0x17')](_0x51b9dc)){for(var _0x2e13ec=0x0;_0x2e13ec<_0x51b9dc[_0x9b20('0x23')];_0x2e13ec+=0x1){_0x51b9dc[_0x2e13ec]=this['omit'](_0x51b9dc[_0x2e13ec],_0x37bba0);}return _0x51b9dc;}if(!_[_0x9b20('0x24')](_0x51b9dc)){return _0x51b9dc;}if(_[_0x9b20('0x25')](_0x37bba0)){_0x37bba0=[_0x37bba0];}if(!_['isArray'](_0x37bba0)){return _0x51b9dc;}for(var _0x40bfb3=0x0;_0x40bfb3<_0x37bba0['length'];_0x40bfb3+=0x1){_[_0x9b20('0x26')](_0x51b9dc,_0x37bba0[_0x40bfb3]);}for(var _0x4b1bb7 in _0x51b9dc){if(_0x51b9dc[_0x9b20('0x27')](_0x4b1bb7)){_0x51b9dc[_0x4b1bb7]=this[_0x9b20('0x28')](_0x51b9dc[_0x4b1bb7],_0x37bba0);}}return _0x51b9dc;};exports[_0x9b20('0x29')]=function(_0x16b120){return _0x16b120[_0x9b20('0x2a')](RegExp(_0x9b20('0x2b')))?!![]:![];};exports[_0x9b20('0x2c')]=function(_0xd63cdc){return _0xd63cdc[_0x9b20('0x2a')](/^\S+@\S+$/)?!![]:![];};exports[_0x9b20('0x2d')]=function(_0x593c4c,_0x110b64){var _0x5f5d85=[];var _0x2f484f=/[ `!@#$%^&*()_\-?~]/;var _0x2faf4b=_0x110b64?_0x9b20('0x2e'):_0x9b20('0x2f');_0x593c4c[_0x9b20('0xa')](/[ ,]+/)[_0x9b20('0x30')](function(_0x5837da){_0x5837da=_0x5837da[_0x9b20('0x31')](/([^:]")"+/g,'$1');_0x5837da='+'+_0x5837da+'*';var _0x5e4f5f=_0x5837da[_0x9b20('0x2a')](_0x2f484f);if(_0x5e4f5f){_0x5837da='\x22'+_0x5837da+'\x22';}_0x5f5d85[_0x9b20('0x32')](_0x5837da);});_0x2faf4b=_0x2faf4b[_0x9b20('0x31')]('{EXPR}',_0x5f5d85[_0x9b20('0x33')]('\x20'));return _0x2faf4b;};exports['getOptions']=function(_0x3269b5,_0x5a79af,_0x4542be){var _0x2b37ff={},_0x5a7e0b={};if(_0x5a79af[_0x9b20('0x34')][_0x9b20('0x35')]){_0x5a79af[_0x9b20('0x34')]['id']=_0x5a79af['query'][_0x9b20('0x35')];delete _0x5a79af[_0x9b20('0x34')][_0x9b20('0x35')];}_0x2b37ff[_0x9b20('0x36')]=_[_0x9b20('0x1a')](_0x3269b5,'name');_0x2b37ff['query']=_[_0x9b20('0x6')](_0x5a79af[_0x9b20('0x34')]);_0x2b37ff[_0x9b20('0xb')]=_[_0x9b20('0x37')](_0x2b37ff['model'],_0x2b37ff[_0x9b20('0x34')]);_0x5a7e0b[_0x9b20('0x38')]=_['intersection'](_0x2b37ff[_0x9b20('0x36')],this[_0x9b20('0x8')](_0x5a79af[_0x9b20('0x34')]['fields']));_0x5a7e0b['attributes']=_0x5a7e0b['attributes'][_0x9b20('0x23')]?_0x5a7e0b[_0x9b20('0x38')]:_0x2b37ff[_0x9b20('0x36')];if(!_0x5a79af[_0x9b20('0x34')][_0x9b20('0x27')](_0x9b20('0x39'))){_0x5a7e0b[_0x9b20('0x18')]=this[_0x9b20('0x18')](_0x5a79af[_0x9b20('0x34')][_0x9b20('0x18')]);_0x5a7e0b[_0x9b20('0x19')]=this[_0x9b20('0x19')](_0x5a79af[_0x9b20('0x34')][_0x9b20('0x19')]);}_0x5a7e0b['order']=this['sort'](_0x5a79af[_0x9b20('0x34')][_0x9b20('0x3a')]);_0x5a7e0b[_0x9b20('0x3b')]=this['filters'](_[_0x9b20('0x3c')](_0x5a79af['query'],_0x2b37ff['filters']),_0x3269b5);if(_0x5a79af['query'][_0x9b20('0x3d')]){var _0x4860bd=_0x3269b5;var _0x20aab8=_0x5a79af[_0x9b20('0x34')]['filter'];if(typeof _0x20aab8===_0x9b20('0x3e')){_0x4860bd=_[_0x9b20('0x3d')](_0x3269b5,function(_0x1dfe23){return _[_0x9b20('0x4')](_0x20aab8['columns'],_0x1dfe23['name']);});_0x20aab8=_0x20aab8[_0x9b20('0x3f')];}_0x5a7e0b[_0x9b20('0x3b')]=_[_0x9b20('0x40')](_0x5a7e0b[_0x9b20('0x3b')],{'$or':_[_0x9b20('0x1a')](_0x4860bd,function(_0x1ebe93){if(_0x1ebe93[_0x9b20('0xe')]!=='VIRTUAL'){if(_0x4542be){return sequelize[_0x9b20('0x3b')](sequelize['fn']('lower',sequelize[_0x9b20('0x20')](_0x1ebe93[_0x9b20('0x15')])),{'$like':sequelize['fn'](_0x9b20('0x41'),'%'+_0x5a79af[_0x9b20('0x34')][_0x9b20('0x3d')]+'%')});}else{var _0x64f33f={};_0x64f33f[_0x1ebe93['name']]={'$like':'%'+_0x5a79af[_0x9b20('0x34')][_0x9b20('0x3d')]+'%'};return _0x64f33f;}}})});}_0x5a7e0b=_[_0x9b20('0x40')]({},_0x5a7e0b,_0x5a79af[_0x9b20('0x42')]);return _0x5a7e0b;};exports['include']=function(_0x3c974d){var _0x4a23a9=[];if(_0x3c974d[_0x9b20('0x43')]){_0x4a23a9[_0x9b20('0x32')]({'all':!![]});}else if(_0x3c974d[_0x9b20('0x44')]){if(Array[_0x9b20('0x17')](_0x3c974d[_0x9b20('0x44')])){_0x4a23a9=Object[_0x9b20('0x6')](_0x3c974d[_0x9b20('0x44')])['map'](function(_0x553738){return parseIncludeModel(_0x3c974d[_0x9b20('0x44')][_0x553738]);});}else{var _0x1771fe=parseIncludeModel(_0x3c974d['include']);_0x4a23a9['push'](_0x1771fe);}}return _0x4a23a9;}; \ No newline at end of file +var _0x21cd=['filters','isEmpty','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','isArray','limit','sort','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','length','isObject','isString','unset','isNumeric','match','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','getOptions','query','$id','model','intersection','attributes','hasOwnProperty','nolimit','offset','pick','filter','object','includes','columns','value','where','merge','VIRTUAL','lower','options','include','includeAll','map','lodash','sequelize','../../mysqldb','keys','parse','alias','raw','fields','split'];(function(_0x5a27e8,_0x492a2f){var _0x4e38f7=function(_0x2a4048){while(--_0x2a4048){_0x5a27e8['push'](_0x5a27e8['shift']());}};_0x4e38f7(++_0x492a2f);}(_0x21cd,0x14b));var _0xd21c=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x21cd[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xd21c('0x0'));var sequelize=require(_0xd21c('0x1'));var moment=require('moment');var db=require(_0xd21c('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x594ccc){var _0x54588d=['ne'];try{var _0x5b225f=JSON['parse'](_0x594ccc);var _0x50d0fe=Object[_0xd21c('0x3')](_0x5b225f)[0x0];return _0x54588d['includes'](_0x50d0fe);}catch(_0x1414f0){return![];}}function getOperatorValue(_0x48790f){var _0x2be42f=JSON[_0xd21c('0x4')](_0x48790f);var _0x68ed7b=Object[_0xd21c('0x3')](_0x2be42f)[0x0];var _0x2874a3=_0x2be42f[_0x68ed7b];return{['$'+_0x68ed7b]:_0x2874a3};}function parseIncludeModel(_0xa99d0c){var _0x53cc02=JSON[_0xd21c('0x4')](_0xa99d0c);return{'model':db[_0x53cc02['model']],'as':_0x53cc02[_0xd21c('0x5')],'attributes':_0x53cc02['fields'],'raw':_0x53cc02[_0xd21c('0x6')]};}exports[_0xd21c('0x7')]=function(_0x2495b5){var _0x1ea878=null;if(_0x2495b5){_0x1ea878=_0x2495b5[_0xd21c('0x8')](',');}return _0x1ea878;};exports[_0xd21c('0x9')]=function(_0x45866a,_0xe1ab56){var _0x1e5f37={};if(!_[_0xd21c('0xa')](_0x45866a)){_['forOwn'](_0x45866a,function(_0x507193,_0x2a0a1d){try{if(_0xe1ab56){var _0x4d3e39=_[_0xd21c('0xb')](_0xe1ab56,{'name':_0x2a0a1d})||{};if(hasSequelizeOperator(_0x507193)){_0x1e5f37[_0x2a0a1d]=getOperatorValue(_0x507193);}else if(_0x4d3e39[_0xd21c('0xc')]===_0xd21c('0xd')&&_[_0xd21c('0xe')](_0x507193)){var _0x3e48b6=JSON['parse'](_0x507193);var _0x50c5de={'$gte':moment(moment(_0x3e48b6[_0xd21c('0xf')])[_0xd21c('0x10')](_0xd21c('0x11')))[_0xd21c('0x12')]()[_0xd21c('0x10')](),'$lte':moment(moment(_0x3e48b6[_0xd21c('0x13')])['format'](_0xd21c('0x11')))[_0xd21c('0x12')]()[_0xd21c('0x14')](0x1,'s')['format']()};_0x1e5f37[_0x2a0a1d]=_0x50c5de;}else if(_0x4d3e39[_0xd21c('0x15')]==='uniqueid'){_0x1e5f37[_0x2a0a1d]=_0x507193;}else{_0x1e5f37[_0x2a0a1d]=_[_0xd21c('0x16')](_0x507193)?_0x507193:JSON[_0xd21c('0x4')](_0x507193);}}else{_0x1e5f37[_0x2a0a1d]=_[_0xd21c('0x16')](_0x507193)?_0x507193:JSON[_0xd21c('0x4')](_0x507193);}}catch(_0x4e9f2f){_0x1e5f37[_0x2a0a1d]=_0x507193['split'](',');}});}return _0x1e5f37;};exports[_0xd21c('0x17')]=function(_0x7229f1){_0x7229f1=parseInt(_0x7229f1,0xa);if(!_0x7229f1||_0x7229f1<0x0){_0x7229f1=LIMIT_VALUE;}return _0x7229f1;};exports['offset']=function(_0x2de5a5){_0x2de5a5=parseInt(_0x2de5a5,0xa);if(!_0x2de5a5||_0x2de5a5<0x0){_0x2de5a5=0x0;}return _0x2de5a5;};exports[_0xd21c('0x18')]=function(_0x45778a){var _0x343290,_0x13f5e4=null;if(_0x45778a){_0x343290=_0x45778a[_0xd21c('0x8')](',');_0x13f5e4=_['map'](_0x343290,function(_0x12e54a){if(_0x12e54a[_0xd21c('0x19')]('-')===0x0){return[_0x12e54a===_0xd21c('0x1a')?sequelize[_0xd21c('0x1b')](sequelize[_0xd21c('0x1c')](_0xd21c('0x1a')),_0xd21c('0x1d')):_0x12e54a[_0xd21c('0x1e')](0x1),_0xd21c('0x1f')];}else{return[_0x12e54a===_0xd21c('0x1a')?sequelize[_0xd21c('0x1b')](sequelize[_0xd21c('0x1c')]('priority'),_0xd21c('0x1d')):_0x12e54a,_0xd21c('0x20')];}});}return _0x13f5e4;};exports[_0xd21c('0x21')]=function(_0x57490d,_0x551baf){if(_['isEmpty'](_0x57490d)){return _0x57490d;}if(_[_0xd21c('0x16')](_0x57490d)){for(var _0x5641f7=0x0;_0x5641f7<_0x57490d[_0xd21c('0x22')];_0x5641f7+=0x1){_0x57490d[_0x5641f7]=this[_0xd21c('0x21')](_0x57490d[_0x5641f7],_0x551baf);}return _0x57490d;}if(!_[_0xd21c('0x23')](_0x57490d)){return _0x57490d;}if(_[_0xd21c('0x24')](_0x551baf)){_0x551baf=[_0x551baf];}if(!_['isArray'](_0x551baf)){return _0x57490d;}for(var _0x9b351d=0x0;_0x9b351d<_0x551baf[_0xd21c('0x22')];_0x9b351d+=0x1){_[_0xd21c('0x25')](_0x57490d,_0x551baf[_0x9b351d]);}for(var _0xcce9be in _0x57490d){if(_0x57490d['hasOwnProperty'](_0xcce9be)){_0x57490d[_0xcce9be]=this[_0xd21c('0x21')](_0x57490d[_0xcce9be],_0x551baf);}}return _0x57490d;};exports[_0xd21c('0x26')]=function(_0x1b71a7){return _0x1b71a7[_0xd21c('0x27')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x2fda08){return _0x2fda08[_0xd21c('0x27')](/^\S+@\S+$/)?!![]:![];};exports[_0xd21c('0x28')]=function(_0x390a85,_0xf4b557){var _0x550bed=[];var _0x5eed0d=/[ `!@#$%^&*()_\-?~]/;var _0x49952b=_0xf4b557?_0xd21c('0x29'):_0xd21c('0x2a');_0x390a85[_0xd21c('0x8')](/[ ,]+/)[_0xd21c('0x2b')](function(_0x5d0803){_0x5d0803=_0x5d0803['replace'](/([^:]")"+/g,'$1');_0x5d0803='+'+_0x5d0803+'*';var _0x982995=_0x5d0803[_0xd21c('0x27')](_0x5eed0d);if(_0x982995){_0x5d0803='\x22'+_0x5d0803+'\x22';}_0x550bed['push'](_0x5d0803);});_0x49952b=_0x49952b[_0xd21c('0x2c')](_0xd21c('0x2a'),_0x550bed['join']('\x20'));return _0x49952b;};exports[_0xd21c('0x2d')]=function(_0xe1c126,_0x2451a4,_0x3a0f3b){var _0x55a281={},_0x1223d8={};if(_0x2451a4[_0xd21c('0x2e')][_0xd21c('0x2f')]){_0x2451a4['query']['id']=_0x2451a4[_0xd21c('0x2e')]['$id'];delete _0x2451a4[_0xd21c('0x2e')]['$id'];}_0x55a281[_0xd21c('0x30')]=_['map'](_0xe1c126,_0xd21c('0x15'));_0x55a281['query']=_[_0xd21c('0x3')](_0x2451a4[_0xd21c('0x2e')]);_0x55a281[_0xd21c('0x9')]=_[_0xd21c('0x31')](_0x55a281[_0xd21c('0x30')],_0x55a281[_0xd21c('0x2e')]);_0x1223d8[_0xd21c('0x32')]=_['intersection'](_0x55a281[_0xd21c('0x30')],this[_0xd21c('0x7')](_0x2451a4['query']['fields']));_0x1223d8[_0xd21c('0x32')]=_0x1223d8['attributes']['length']?_0x1223d8[_0xd21c('0x32')]:_0x55a281[_0xd21c('0x30')];if(!_0x2451a4[_0xd21c('0x2e')][_0xd21c('0x33')](_0xd21c('0x34'))){_0x1223d8[_0xd21c('0x17')]=this['limit'](_0x2451a4[_0xd21c('0x2e')]['limit']);_0x1223d8[_0xd21c('0x35')]=this[_0xd21c('0x35')](_0x2451a4[_0xd21c('0x2e')][_0xd21c('0x35')]);}_0x1223d8['order']=this[_0xd21c('0x18')](_0x2451a4[_0xd21c('0x2e')][_0xd21c('0x18')]);_0x1223d8['where']=this[_0xd21c('0x9')](_[_0xd21c('0x36')](_0x2451a4[_0xd21c('0x2e')],_0x55a281['filters']),_0xe1c126);if(_0x2451a4[_0xd21c('0x2e')][_0xd21c('0x37')]){var _0xd838e4=_0xe1c126;var _0x5141d4=_0x2451a4[_0xd21c('0x2e')][_0xd21c('0x37')];if(typeof _0x5141d4===_0xd21c('0x38')){_0xd838e4=_[_0xd21c('0x37')](_0xe1c126,function(_0x425887){return _[_0xd21c('0x39')](_0x5141d4[_0xd21c('0x3a')],_0x425887['name']);});_0x5141d4=_0x5141d4[_0xd21c('0x3b')];}_0x1223d8[_0xd21c('0x3c')]=_[_0xd21c('0x3d')](_0x1223d8[_0xd21c('0x3c')],{'$or':_['map'](_0xd838e4,function(_0x340ea9){if(_0x340ea9[_0xd21c('0xc')]!==_0xd21c('0x3e')){if(_0x3a0f3b){return sequelize[_0xd21c('0x3c')](sequelize['fn']('lower',sequelize[_0xd21c('0x1c')](_0x340ea9['name'])),{'$like':sequelize['fn'](_0xd21c('0x3f'),'%'+_0x2451a4['query'][_0xd21c('0x37')]+'%')});}else{var _0x47c527={};_0x47c527[_0x340ea9[_0xd21c('0x15')]]={'$like':'%'+_0x2451a4['query'][_0xd21c('0x37')]+'%'};return _0x47c527;}}})});}_0x1223d8=_['merge']({},_0x1223d8,_0x2451a4[_0xd21c('0x40')]);return _0x1223d8;};exports[_0xd21c('0x41')]=function(_0x3ba900){var _0x498e0f=[];if(_0x3ba900[_0xd21c('0x42')]){_0x498e0f['push']({'all':!![]});}else if(_0x3ba900['include']){if(Array[_0xd21c('0x16')](_0x3ba900[_0xd21c('0x41')])){_0x498e0f=Object['keys'](_0x3ba900['include'])[_0xd21c('0x43')](function(_0x17890d){return parseIncludeModel(_0x3ba900[_0xd21c('0x41')][_0x17890d]);});}else{var _0x1693f4=parseIncludeModel(_0x3ba900[_0xd21c('0x41')]);_0x498e0f['push'](_0x1693f4);}}return _0x498e0f;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 89283cc..e1f8997 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['faxStatusTime','voiceStatusTime','queue','phoneBarEnableScreenRecordingByAgent','routealias','omit','pick','filterAgentAttributes','role','chatStatusTime','whatsappStatusTime','openchannelCurrentCapacity','phoneBarEnableAutomaticScreenRecording','destconnectedlinenum','onhold','screenrecording','getRealtimeAgentsQueryFields','lodash','client','http','chatPause','faxPause','mailPause','smsPause','voicePause','whatsappPause','every','length','idle','unknown','ringing','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','all','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','findAll','name','fullname','openchannelPause','pauseType','find','merge','getSortedAgentsIdsByStatus','split','filter','globalStatus','startsWith','DESC','ASC','getUpdatedSortOptions','validateSortParameter','toLowerCase','userpic','lastLoginAt','lastPauseAt','internal','address','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','smsStatus','whatsappStatus','openchannelStatusTime','mailStatusTime','smsStatusTime'];(function(_0x4cea81,_0x46525){var _0x43e77d=function(_0x5ae2fe){while(--_0x5ae2fe){_0x4cea81['push'](_0x4cea81['shift']());}};_0x43e77d(++_0x46525);}(_0x326f,0xd1));var _0xf326=function(_0x274a2c,_0x32266d){_0x274a2c=_0x274a2c-0x0;var _0x2f175=_0x326f[_0x274a2c];return _0x2f175;};'use strict';var _=require(_0xf326('0x0'));var jayson=require('jayson/promise');var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xf326('0x1')][_0xf326('0x2')]({'port':0x232a});var routingClient=jayson[_0xf326('0x1')][_0xf326('0x2')]({'port':0x232c});function isAgentPaused(_0x27e8d7,_0x120a26){var _0x9445c6=[_0x27e8d7[_0xf326('0x3')],_0x27e8d7[_0xf326('0x4')],_0x27e8d7[_0xf326('0x5')],_0x27e8d7['openchannelPause'],_0x27e8d7[_0xf326('0x6')],_0x27e8d7[_0xf326('0x7')],_0x27e8d7[_0xf326('0x8')]];if(!_0x120a26)return _[_0xf326('0x9')](_0x9445c6);var _0x515bfa=_['filter'](_0x9445c6);return _0x515bfa['length']>0x0&&_0x515bfa[_0xf326('0xa')]<_0x9445c6[_0xf326('0xa')]?!![]:![];}function isIdle(_0x163416){return _0x163416===_0xf326('0xb')||_0x163416===_0xf326('0xc')||_0x163416==='unavailable'||_0x163416===_0xf326('0xd')||_['isNil'](_0x163416);}function isAgentIdle(_0x1cf441){if(_0x1cf441['voiceStatus']!==_0xf326('0xb')&&_0x1cf441['voicePause']){_0x1cf441[_0xf326('0xe')]=_0xf326('0xf');return![];}return _['every']([_0x1cf441[_0xf326('0x10')],_0x1cf441[_0xf326('0x11')],_0x1cf441[_0xf326('0x12')],_0x1cf441[_0xf326('0x13')],_0x1cf441['smsStatus'],_0x1cf441[_0xf326('0xe')],_0x1cf441['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0xf326('0x14'),{})[_0xf326('0x15')](function(_0x1f2e5a){if(_0x1f2e5a[_0xf326('0x16')]){throw new Error(_0xf326('0x17'));}var _0x287a2a=_0x1f2e5a[_0xf326('0x18')];return routingClient[_0xf326('0x19')]('Agents',{})[_0xf326('0x15')](function(_0x453100){if(_0x453100[_0xf326('0x16')]){throw new Error(_0xf326('0x1a'));}var _0xcef2b5=_0x453100[_0xf326('0x18')];return _['merge']({},_0x287a2a,_0xcef2b5);});})['catch'](function(_0x56ad41){throw _0x56ad41;});}exports[_0xf326('0x1b')]=getRealtimeAgents;function getAgentStatus(_0x289f4b){var _0x484cbe='unknown';if(isAgentPaused(_0x289f4b))_0x484cbe=_0xf326('0xf');else if(isAgentPaused(_0x289f4b,!![]))_0x484cbe='*pause';else if(isAgentIdle(_0x289f4b))_0x484cbe='idle';else _0x484cbe=_0xf326('0x1c');return _0x484cbe;}exports[_0xf326('0x1d')]=getAgentStatus;function getAgentIdsByQueues(_0x549b46,_0x5aa184){var _0x19b8ba=_[_0xf326('0x1e')](_0x549b46)?_0x549b46:[_0x549b46];var _0x5f21a2=_[_0xf326('0x1f')](_0x5aa184)+_0xf326('0x20');var _0x43c53e=_[_0xf326('0x21')](_0x19b8ba,function(_0x17c157){return db[_0x5f21a2][_0xf326('0x22')]({'where':{'id':_0x17c157}})['then'](function(_0x55b9f4){if(!_0x55b9f4)return[];return _0x55b9f4['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xf326('0x23')](_0x43c53e)[_0xf326('0x15')](function(_0x2cd45a){var _0x1ff2b5=_(_0x2cd45a)[_0xf326('0x24')]()[_0xf326('0x21')]('id')['uniq']()[_0xf326('0x25')]();return _0x1ff2b5;});}exports[_0xf326('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x212d5d,_0x581531,_0x1617d2){try{if(_0x581531['length']>0x0){_0x212d5d=_0x212d5d['filter'](function(_0x6a8e89){return _0x581531[_0xf326('0x27')](_0x6a8e89['id']);});}var _0x2fa28e=_0x212d5d['filter'](function(_0xc115d9){var _0x292500='busy';if(isAgentIdle(_0xc115d9)){_0x292500=_0xf326('0xb');}return _0x292500===_0x1617d2;});return _[_0xf326('0x21')](_0x2fa28e,'id');}catch(_0xd77aba){throw _0xd77aba;}}exports[_0xf326('0x28')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xa80156,_0x269be9,_0x161143){return Promise[_0xf326('0x29')]()[_0xf326('0x15')](function(){if(_0x269be9[_0xf326('0xa')]>0x0){_0xa80156=_0xa80156['filter'](function(_0x1035ed){return _0x269be9[_0xf326('0x27')](_0x1035ed['id']);});}return _0xa80156;})[_0xf326('0x15')](function(){return db['User'][_0xf326('0x2a')]({'attributes':['id',_0xf326('0x2b'),_0xf326('0x2c'),'chatPause','faxPause',_0xf326('0x5'),_0xf326('0x2d'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x2e')],'where':{'id':{'$in':_[_0xf326('0x21')](_0xa80156,'id')}},'raw':!![]});})[_0xf326('0x15')](function(_0x580374){return _0x580374[_0xf326('0x21')](function(_0x1981bc){var _0x51207a=_[_0xf326('0x2f')](_0xa80156,['id',_0x1981bc['id']]);var _0x4e5d7c=filterAgentAttributes(_0x51207a);_[_0xf326('0x30')](_0x1981bc,_0x4e5d7c);_0x1981bc['globalStatus']=getAgentStatus(_0x1981bc);return _0x1981bc;});})['then'](function(_0xadb020){var _0x4d8eac=sortAgentsByStatus(_0xadb020,_0x161143);return _[_0xf326('0x21')](_0x4d8eac,'id');})['catch'](function(_0x310dbb){throw _0x310dbb;});}exports[_0xf326('0x31')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2750ae){var _0x529cbb={'fields':[],'order':null};var _0x3dcc7e=_0x2750ae[_0xf326('0x32')](',');_0x529cbb['fields']=_[_0xf326('0x33')](_0x3dcc7e,function(_0xf64dd0){if(!_0xf64dd0[_0xf326('0x27')](_0xf326('0x34'))){return!![];}_0x529cbb['order']=_[_0xf326('0x35')](_0xf64dd0,'-')?_0xf326('0x36'):_0xf326('0x37');return![];});return _0x529cbb;}exports[_0xf326('0x38')]=getUpdatedSortOptions;function validateSortParameter(_0x1d88ed){if(!_0x1d88ed){_0x1d88ed='fullname,internal';}if(_0x1d88ed[_0xf326('0x27')](_0xf326('0x2c'))&&!_0x1d88ed['includes']('internal')){var _0x40564e=_0x1d88ed['substring'](0x0,_0x1d88ed['indexOf'](_0xf326('0x2c')));_0x1d88ed+=','+_0x40564e+'internal';}return _0x1d88ed;}exports[_0xf326('0x39')]=validateSortParameter;function sortAgentsByStatus(_0x37a95b,_0x2c1e7f){var _0x39611e=_0x37a95b['sort'](function(_0x9dda89,_0x45d344){if(_0x9dda89[_0xf326('0x34')]===_0x45d344[_0xf326('0x34')]){if(_0x9dda89[_0xf326('0x34')]===_0xf326('0xf')){if(_0x2c1e7f===_0xf326('0x36')){return(_0x9dda89[_0xf326('0x2e')]||'')<(_0x45d344[_0xf326('0x2e')]||'')||_0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()>_0x45d344[_0xf326('0x2c')]['toLowerCase']()?0x1:-0x1;}else{return(_0x9dda89[_0xf326('0x2e')]||'')<(_0x45d344[_0xf326('0x2e')]||'')||_0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()>_0x45d344[_0xf326('0x2c')][_0xf326('0x3a')]()?-0x1:0x1;}}else{if(_0x2c1e7f==='DESC'){return _0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()<_0x45d344['fullname'][_0xf326('0x3a')]()?0x1:-0x1;}else{return _0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()<_0x45d344[_0xf326('0x2c')][_0xf326('0x3a')]()?-0x1:0x1;}}}else{if(_0x2c1e7f==='DESC'){return _0x9dda89['globalStatus']<_0x45d344[_0xf326('0x34')]?0x1:-0x1;}else{return _0x9dda89[_0xf326('0x34')]<_0x45d344['globalStatus']?-0x1:0x1;}}});return _0x39611e;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x8e318d){var _0x269e89=[_0xf326('0x3b'),'online',_0xf326('0x3c'),_0xf326('0x3d'),_0xf326('0x2e'),_0xf326('0x3d'),_0xf326('0x3e'),_0xf326('0x3f'),_0xf326('0x3'),_0xf326('0x2d'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x8'),_0xf326('0x4'),_0xf326('0x7'),_0xf326('0x40'),_0xf326('0x41'),'mailCapacity',_0xf326('0x42'),_0xf326('0x43'),_0xf326('0x44'),_0xf326('0x45'),'openchannelCurrentCapacity',_0xf326('0x46'),_0xf326('0x47'),_0xf326('0x48'),_0xf326('0x49'),'chatStatus',_0xf326('0x13'),_0xf326('0x12'),_0xf326('0x4a'),_0xf326('0x4b'),_0xf326('0x11'),'voiceStatus','chatStatusTime',_0xf326('0x4c'),_0xf326('0x4d'),_0xf326('0x4e'),'whatsappStatusTime',_0xf326('0x4f'),_0xf326('0x50'),_0xf326('0x51'),'destconnectedlinenum','screenrecording',_0xf326('0x52'),'phoneBarEnableAutomaticScreenRecording',_0xf326('0x53')];var _0x554277=[_0xf326('0x3'),_0xf326('0x2d'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x8'),_0xf326('0x4'),_0xf326('0x7'),'online'];var _0xcdaf3f=_(_0x8e318d)[_0xf326('0x54')](_0x554277)[_0xf326('0x55')](_0x269e89)['value']();return _0xcdaf3f;}exports[_0xf326('0x56')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xf326('0x2b'),_0xf326('0x2c'),_0xf326('0x57'),_0xf326('0x3e'),'online',_0xf326('0x34'),_0xf326('0x3b'),_0xf326('0x3c'),_0xf326('0x2e'),'lastPauseAt',_0xf326('0x4'),_0xf326('0x3'),_0xf326('0x5'),_0xf326('0x2d'),'smsPause','voicePause',_0xf326('0x8'),_0xf326('0x10'),'faxStatus',_0xf326('0x12'),_0xf326('0x13'),_0xf326('0x4a'),_0xf326('0xe'),'whatsappStatus',_0xf326('0x58'),'faxStatusTime','mailStatusTime',_0xf326('0x4c'),'smsStatusTime',_0xf326('0x50'),_0xf326('0x59'),_0xf326('0x40'),'faxCapacity','mailCapacity',_0xf326('0x41'),_0xf326('0x42'),_0xf326('0x43'),'chatCurrentCapacity',_0xf326('0x49'),'mailCurrentCapacity',_0xf326('0x5a'),_0xf326('0x47'),_0xf326('0x48'),_0xf326('0x52'),_0xf326('0x5b'),_0xf326('0x5c'),_0xf326('0x5d'),_0xf326('0x51'),_0xf326('0x53'),_0xf326('0x5e')];}exports[_0xf326('0x5f')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x9c5a=['getAgents','all','value','getAgentIdsByQueues','filter','includes','resolve','findAll','name','fullname','chatPause','mailPause','pauseType','globalStatus','getSortedAgentsIdsByStatus','split','fields','startsWith','DESC','ASC','getUpdatedSortOptions','fullname,internal','internal','substring','indexOf','validateSortParameter','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','mailCapacity','smsCapacity','whatsappCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','role','faxStatus','voiceStatusTime','chatCapacity','faxCapacity','chatCurrentCapacity','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','client','http','faxPause','openchannelPause','smsPause','every','length','idle','ringing','isNil','voiceStatus','voicePause','pause','chatStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','getAgentStatus','isArray','map','findOne'];(function(_0x517e67,_0x46d63c){var _0x4d7215=function(_0x4d4208){while(--_0x4d4208){_0x517e67['push'](_0x517e67['shift']());}};_0x4d7215(++_0x46d63c);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x28cee9,_0xffd3d5){_0x28cee9=_0x28cee9-0x0;var _0x2546e4=_0x9c5a[_0x28cee9];return _0x2546e4;};'use strict';var _=require(_0xa9c5('0x0'));var jayson=require(_0xa9c5('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xa9c5('0x2')][_0xa9c5('0x3')]({'port':0x232a});var routingClient=jayson[_0xa9c5('0x2')][_0xa9c5('0x3')]({'port':0x232c});function isAgentPaused(_0x4f5552,_0x2acfaf){var _0x3051b1=[_0x4f5552['chatPause'],_0x4f5552[_0xa9c5('0x4')],_0x4f5552['mailPause'],_0x4f5552[_0xa9c5('0x5')],_0x4f5552[_0xa9c5('0x6')],_0x4f5552['voicePause'],_0x4f5552['whatsappPause']];if(!_0x2acfaf)return _[_0xa9c5('0x7')](_0x3051b1);var _0x16f331=_['filter'](_0x3051b1);return _0x16f331[_0xa9c5('0x8')]>0x0&&_0x16f331[_0xa9c5('0x8')]<_0x3051b1['length']?!![]:![];}function isIdle(_0x2e4f45){return _0x2e4f45===_0xa9c5('0x9')||_0x2e4f45==='unknown'||_0x2e4f45==='unavailable'||_0x2e4f45===_0xa9c5('0xa')||_[_0xa9c5('0xb')](_0x2e4f45);}function isAgentIdle(_0x45f8d8){if(_0x45f8d8[_0xa9c5('0xc')]!==_0xa9c5('0x9')&&_0x45f8d8[_0xa9c5('0xd')]){_0x45f8d8[_0xa9c5('0xc')]=_0xa9c5('0xe');return![];}return _[_0xa9c5('0x7')]([_0x45f8d8[_0xa9c5('0xf')],_0x45f8d8['faxStatus'],_0x45f8d8[_0xa9c5('0x10')],_0x45f8d8[_0xa9c5('0x11')],_0x45f8d8[_0xa9c5('0x12')],_0x45f8d8[_0xa9c5('0xc')],_0x45f8d8[_0xa9c5('0x13')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xa9c5('0x14')](_0xa9c5('0x15'),{})[_0xa9c5('0x16')](function(_0x19a43e){if(_0x19a43e[_0xa9c5('0x17')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x2b0d73=_0x19a43e[_0xa9c5('0x18')];return routingClient[_0xa9c5('0x14')]('Agents',{})[_0xa9c5('0x16')](function(_0x1142d9){if(_0x1142d9[_0xa9c5('0x17')]){throw new Error(_0xa9c5('0x19'));}var _0x452a9b=_0x1142d9[_0xa9c5('0x18')];return _[_0xa9c5('0x1a')]({},_0x2b0d73,_0x452a9b);});})[_0xa9c5('0x1b')](function(_0x2c7cd5){throw _0x2c7cd5;});}exports[_0xa9c5('0x1c')]=getRealtimeAgents;function getAgentStatus(_0x113c8f){var _0x2d95f8='unknown';if(isAgentPaused(_0x113c8f))_0x2d95f8=_0xa9c5('0xe');else if(isAgentPaused(_0x113c8f,!![]))_0x2d95f8=_0xa9c5('0x1d');else if(isAgentIdle(_0x113c8f))_0x2d95f8='idle';else _0x2d95f8='busy';return _0x2d95f8;}exports[_0xa9c5('0x1e')]=getAgentStatus;function getAgentIdsByQueues(_0x366f5c,_0x10b208){var _0x3b497a=_[_0xa9c5('0x1f')](_0x366f5c)?_0x366f5c:[_0x366f5c];var _0xd4b8a1=_['startCase'](_0x10b208)+'Queue';var _0x3d4e1b=_[_0xa9c5('0x20')](_0x3b497a,function(_0x4b0f05){return db[_0xd4b8a1][_0xa9c5('0x21')]({'where':{'id':_0x4b0f05}})[_0xa9c5('0x16')](function(_0x306c9b){if(!_0x306c9b)return[];return _0x306c9b[_0xa9c5('0x22')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xa9c5('0x23')](_0x3d4e1b)[_0xa9c5('0x16')](function(_0xe44e6d){var _0x51b64a=_(_0xe44e6d)['flatten']()[_0xa9c5('0x20')]('id')['uniq']()[_0xa9c5('0x24')]();return _0x51b64a;});}exports[_0xa9c5('0x25')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x4caefa,_0x11a723,_0x320dc0){try{if(_0x11a723['length']>0x0){_0x4caefa=_0x4caefa[_0xa9c5('0x26')](function(_0x32baf9){return _0x11a723[_0xa9c5('0x27')](_0x32baf9['id']);});}var _0x185eb8=_0x4caefa[_0xa9c5('0x26')](function(_0x4f6e70){var _0x36f267='busy';if(isAgentIdle(_0x4f6e70)){_0x36f267=_0xa9c5('0x9');}return _0x36f267===_0x320dc0;});return _[_0xa9c5('0x20')](_0x185eb8,'id');}catch(_0x2eeed1){throw _0x2eeed1;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xc6d0c1,_0xbe29c5,_0x5bc9bb){return Promise[_0xa9c5('0x28')]()[_0xa9c5('0x16')](function(){if(_0xbe29c5[_0xa9c5('0x8')]>0x0){_0xc6d0c1=_0xc6d0c1[_0xa9c5('0x26')](function(_0x22ee21){return _0xbe29c5[_0xa9c5('0x27')](_0x22ee21['id']);});}return _0xc6d0c1;})[_0xa9c5('0x16')](function(){return db['User'][_0xa9c5('0x29')]({'attributes':['id',_0xa9c5('0x2a'),_0xa9c5('0x2b'),_0xa9c5('0x2c'),_0xa9c5('0x4'),_0xa9c5('0x2d'),_0xa9c5('0x5'),_0xa9c5('0x6'),'voicePause','whatsappPause',_0xa9c5('0x2e')],'where':{'id':{'$in':_[_0xa9c5('0x20')](_0xc6d0c1,'id')}},'raw':!![]});})[_0xa9c5('0x16')](function(_0x1313b2){return _0x1313b2[_0xa9c5('0x20')](function(_0x25121e){var _0x4dfdb5=_['find'](_0xc6d0c1,['id',_0x25121e['id']]);var _0x517b9a=filterAgentAttributes(_0x4dfdb5);_[_0xa9c5('0x1a')](_0x25121e,_0x517b9a);_0x25121e[_0xa9c5('0x2f')]=getAgentStatus(_0x25121e);return _0x25121e;});})['then'](function(_0x13a1f5){var _0x56eb82=sortAgentsByStatus(_0x13a1f5,_0x5bc9bb);return _[_0xa9c5('0x20')](_0x56eb82,'id');})[_0xa9c5('0x1b')](function(_0x2567be){throw _0x2567be;});}exports[_0xa9c5('0x30')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x593be8){var _0x675588={'fields':[],'order':null};var _0x2cd721=_0x593be8[_0xa9c5('0x31')](',');_0x675588[_0xa9c5('0x32')]=_[_0xa9c5('0x26')](_0x2cd721,function(_0x17ef8e){if(!_0x17ef8e[_0xa9c5('0x27')](_0xa9c5('0x2f'))){return!![];}_0x675588['order']=_[_0xa9c5('0x33')](_0x17ef8e,'-')?_0xa9c5('0x34'):_0xa9c5('0x35');return![];});return _0x675588;}exports[_0xa9c5('0x36')]=getUpdatedSortOptions;function validateSortParameter(_0x1132e0){if(!_0x1132e0){_0x1132e0=_0xa9c5('0x37');}if(_0x1132e0['includes'](_0xa9c5('0x2b'))&&!_0x1132e0['includes'](_0xa9c5('0x38'))){var _0x5c89e7=_0x1132e0[_0xa9c5('0x39')](0x0,_0x1132e0[_0xa9c5('0x3a')](_0xa9c5('0x2b')));_0x1132e0+=','+_0x5c89e7+'internal';}return _0x1132e0;}exports[_0xa9c5('0x3b')]=validateSortParameter;function sortAgentsByStatus(_0x1ddd72,_0x3a2b67){var _0x26dd0c=_0x1ddd72['sort'](function(_0x2dbb48,_0x97803f){if(_0x2dbb48[_0xa9c5('0x2f')]===_0x97803f[_0xa9c5('0x2f')]){if(_0x2dbb48[_0xa9c5('0x2f')]==='pause'){if(_0x3a2b67===_0xa9c5('0x34')){return(_0x2dbb48['pauseType']||'')<(_0x97803f[_0xa9c5('0x2e')]||'')||_0x2dbb48[_0xa9c5('0x2b')][_0xa9c5('0x3c')]()>_0x97803f[_0xa9c5('0x2b')][_0xa9c5('0x3c')]()?0x1:-0x1;}else{return(_0x2dbb48[_0xa9c5('0x2e')]||'')<(_0x97803f[_0xa9c5('0x2e')]||'')||_0x2dbb48[_0xa9c5('0x2b')][_0xa9c5('0x3c')]()>_0x97803f[_0xa9c5('0x2b')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x3a2b67===_0xa9c5('0x34')){return _0x2dbb48[_0xa9c5('0x2b')][_0xa9c5('0x3c')]()<_0x97803f[_0xa9c5('0x2b')][_0xa9c5('0x3c')]()?0x1:-0x1;}else{return _0x2dbb48[_0xa9c5('0x2b')]['toLowerCase']()<_0x97803f[_0xa9c5('0x2b')][_0xa9c5('0x3c')]()?-0x1:0x1;}}}else{if(_0x3a2b67==='DESC'){return _0x2dbb48['globalStatus']<_0x97803f['globalStatus']?0x1:-0x1;}else{return _0x2dbb48['globalStatus']<_0x97803f['globalStatus']?-0x1:0x1;}}});return _0x26dd0c;}exports[_0xa9c5('0x3d')]=sortAgentsByStatus;function filterAgentAttributes(_0x569185){var _0x245f9d=[_0xa9c5('0x3e'),_0xa9c5('0x3f'),_0xa9c5('0x40'),_0xa9c5('0x41'),_0xa9c5('0x2e'),_0xa9c5('0x41'),_0xa9c5('0x38'),_0xa9c5('0x42'),_0xa9c5('0x2c'),_0xa9c5('0x5'),'mailPause',_0xa9c5('0x6'),'whatsappPause',_0xa9c5('0x4'),_0xa9c5('0xd'),'chatCapacity','openchannelCapacity',_0xa9c5('0x43'),_0xa9c5('0x44'),_0xa9c5('0x45'),'faxCapacity','chatCurrentCapacity',_0xa9c5('0x46'),_0xa9c5('0x47'),'smsCurrentCapacity',_0xa9c5('0x48'),_0xa9c5('0x49'),_0xa9c5('0xf'),_0xa9c5('0x11'),_0xa9c5('0x10'),_0xa9c5('0x12'),'whatsappStatus','faxStatus','voiceStatus',_0xa9c5('0x4a'),_0xa9c5('0x4b'),_0xa9c5('0x4c'),_0xa9c5('0x4d'),_0xa9c5('0x4e'),_0xa9c5('0x4f'),'voiceStatusTime',_0xa9c5('0x50'),_0xa9c5('0x51'),_0xa9c5('0x52'),_0xa9c5('0x53'),_0xa9c5('0x54'),_0xa9c5('0x55')];var _0x547654=['chatPause',_0xa9c5('0x5'),'mailPause',_0xa9c5('0x6'),'whatsappPause',_0xa9c5('0x4'),_0xa9c5('0xd'),_0xa9c5('0x3f')];var _0x5c7d7c=_(_0x569185)[_0xa9c5('0x56')](_0x547654)[_0xa9c5('0x57')](_0x245f9d)[_0xa9c5('0x24')]();return _0x5c7d7c;}exports[_0xa9c5('0x58')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id','name','fullname',_0xa9c5('0x59'),_0xa9c5('0x38'),_0xa9c5('0x3f'),'globalStatus',_0xa9c5('0x3e'),_0xa9c5('0x40'),_0xa9c5('0x2e'),_0xa9c5('0x41'),_0xa9c5('0x4'),_0xa9c5('0x2c'),_0xa9c5('0x2d'),_0xa9c5('0x5'),'smsPause',_0xa9c5('0xd'),'whatsappPause',_0xa9c5('0xf'),_0xa9c5('0x5a'),_0xa9c5('0x10'),'openchannelStatus',_0xa9c5('0x12'),_0xa9c5('0xc'),'whatsappStatus',_0xa9c5('0x4a'),_0xa9c5('0x4f'),_0xa9c5('0x4c'),_0xa9c5('0x4b'),'smsStatusTime',_0xa9c5('0x5b'),_0xa9c5('0x4e'),_0xa9c5('0x5c'),_0xa9c5('0x5d'),'mailCapacity','openchannelCapacity',_0xa9c5('0x44'),_0xa9c5('0x45'),_0xa9c5('0x5e'),_0xa9c5('0x49'),_0xa9c5('0x47'),_0xa9c5('0x46'),'smsCurrentCapacity',_0xa9c5('0x48'),_0xa9c5('0x53'),_0xa9c5('0x54'),_0xa9c5('0x51'),_0xa9c5('0x5f'),_0xa9c5('0x50'),_0xa9c5('0x55'),_0xa9c5('0x52')];}exports[_0xa9c5('0x60')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index f9fbb82..f745d00 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf511=['dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','concat','outbound','map','get','waiting','merge','initializeQueues','lodash','client','http','available','loggedIn','paused','busy','loggedInDb','ringInUse','talking','unavailable','unknown','pTalking','originated','message','statusMessage'];(function(_0xa98302,_0x844f27){var _0x1ad8e3=function(_0x57e51d){while(--_0x57e51d){_0xa98302['push'](_0xa98302['shift']());}};_0x1ad8e3(++_0x844f27);}(_0xf511,0x160));var _0x1f51=function(_0x4ed1d4,_0x512d9a){_0x4ed1d4=_0x4ed1d4-0x0;var _0x28e363=_0xf511[_0x4ed1d4];return _0x28e363;};'use strict';var _=require(_0x1f51('0x0'));var jayson=require('jayson/promise');var util=require('util');var amiClient=jayson[_0x1f51('0x1')][_0x1f51('0x2')]({'port':0x232a});var routingClient=jayson[_0x1f51('0x1')][_0x1f51('0x2')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x1f51('0x3'),_0x1f51('0x4'),_0x1f51('0x5'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x1f51('0x6'),'inUse','invalid',_0x1f51('0x7'),'notInUse','onHold','ringing',_0x1f51('0x8'),_0x1f51('0x9'),_0x1f51('0xa'),_0x1f51('0xb')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x1f51('0xc'),_0x1f51('0xd'),_0x1f51('0xe'),_0x1f51('0xf'),_0x1f51('0x10'),_0x1f51('0x11'),_0x1f51('0x12'),_0x1f51('0x13'),_0x1f51('0x14'),_0x1f51('0x15'),_0x1f51('0x16'),_0x1f51('0x17'),'erlangBusyFactor',_0x1f51('0x18'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable',_0x1f51('0x19'),_0x1f51('0x1a'),_0x1f51('0x1b'),_0x1f51('0x1c'),_0x1f51('0x1d'),_0x1f51('0x1e')];function getRealtimeQueues(_0x1a51f8,_0x2e032e){var _0x3612ac=_0x2e032e===_0x1f51('0x1f')?amiClient:routingClient;return _0x3612ac[_0x1f51('0x20')](_['startCase'](_0x2e032e)+_0x1f51('0x21'),_0x1a51f8)['then'](function(_0xfc96a4){if(_0xfc96a4[_0x1f51('0x22')])throw new Error(util[_0x1f51('0x23')](_0x1f51('0x24'),_0x2e032e));return _0xfc96a4[_0x1f51('0x25')];})[_0x1f51('0x26')](function(_0x55327a){throw _0x55327a;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x54f7c6,_0x1f63c2,_0x172df5,_0x33ca0f){var _0x1dd995=DEFAULT_QUEUE_ATTRIBUTES;if(_0x172df5==='voice'){if(_0x33ca0f==='inbound'){_0x1dd995=_0x1dd995[_0x1f51('0x27')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x33ca0f===_0x1f51('0x28')){_0x1dd995=_0x1dd995[_0x1f51('0x27')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x54f7c6[_0x1f51('0x29')](function(_0x3fb559){var _0x246c83=_0x3fb559[_0x1f51('0x2a')]({'plain':!![]});_0x246c83[_0x1f51('0x5')]=0x0;_0x246c83[_0x1f51('0x7')]=0x0;_0x246c83[_0x1f51('0x4')]=0x0;_0x246c83[_0x1f51('0x3')]=0x0;_0x246c83[_0x1f51('0x2b')]=0x0;if(_0x172df5==='voice'){_0x246c83[_0x1f51('0x9')]=0x0;_0x246c83['busy']=0x0;if(_0x33ca0f===_0x1f51('0x28')){_0x246c83[_0x1f51('0xc')]=0x0;_0x246c83[_0x1f51('0xd')]=0x0;}}var _0x16d11a=_['find'](_0x1f63c2,['id',_0x246c83['id']]);if(_0x16d11a){_[_0x1f51('0x2c')](_0x246c83,_['pick'](_0x16d11a,_0x1dd995));}return _0x246c83;});}exports[_0x1f51('0x2d')]=initializeQueues; \ No newline at end of file +var _0x9656=['erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','voice','startCase','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','getRealtimeQueues','inbound','outbound','concat','get','talking','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','paused','waiting','busy','inUse','loggedInDb','notInUse','onHold','unavailable','unknown','pTalking','originated','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond'];(function(_0x1debda,_0xe91aba){var _0x30cde6=function(_0x252ac3){while(--_0x252ac3){_0x1debda['push'](_0x1debda['shift']());}};_0x30cde6(++_0xe91aba);}(_0x9656,0x84));var _0x6965=function(_0xfa6653,_0x59db99){_0xfa6653=_0xfa6653-0x0;var _0x565afa=_0x9656[_0xfa6653];return _0x565afa;};'use strict';var _=require(_0x6965('0x0'));var jayson=require(_0x6965('0x1'));var util=require(_0x6965('0x2'));var amiClient=jayson[_0x6965('0x3')][_0x6965('0x4')]({'port':0x232a});var routingClient=jayson[_0x6965('0x3')][_0x6965('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x6965('0x5'),_0x6965('0x6'),_0x6965('0x7'),_0x6965('0x8')];var VOICE_QUEUE_ATTRIBUTES=[_0x6965('0x9'),_0x6965('0xa'),'invalid',_0x6965('0xb'),_0x6965('0xc'),_0x6965('0xd'),'ringing','ringInUse','talking',_0x6965('0xe'),_0x6965('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x6965('0x10'),_0x6965('0x11'),_0x6965('0x12'),_0x6965('0x13'),_0x6965('0x14'),_0x6965('0x15'),_0x6965('0x16'),_0x6965('0x17'),_0x6965('0x18'),_0x6965('0x19'),_0x6965('0x1a'),_0x6965('0x1b'),_0x6965('0x1c'),'dialPredictiveInterval',_0x6965('0x1d'),'dialPredictiveIntervalMinThreshold',_0x6965('0x1e'),_0x6965('0x1f'),_0x6965('0x20'),_0x6965('0x21'),_0x6965('0x22'),_0x6965('0x23'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x474606,_0x1f15ff){var _0x4ba0a9=_0x1f15ff===_0x6965('0x24')?amiClient:routingClient;return _0x4ba0a9['request'](_[_0x6965('0x25')](_0x1f15ff)+'Queues',_0x474606)[_0x6965('0x26')](function(_0x3a4ab1){if(_0x3a4ab1[_0x6965('0x27')])throw new Error(util[_0x6965('0x28')](_0x6965('0x29'),_0x1f15ff));return _0x3a4ab1['result'];})[_0x6965('0x2a')](function(_0x6c470a){throw _0x6c470a;});}exports[_0x6965('0x2b')]=getRealtimeQueues;function initializeQueues(_0x1fb856,_0xde9266,_0x5b96fb,_0x349cb1){var _0x494530=DEFAULT_QUEUE_ATTRIBUTES;if(_0x5b96fb===_0x6965('0x24')){if(_0x349cb1===_0x6965('0x2c')){_0x494530=_0x494530['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x349cb1===_0x6965('0x2d')){_0x494530=_0x494530[_0x6965('0x2e')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1fb856['map'](function(_0x3b0a8c){var _0x45d20f=_0x3b0a8c[_0x6965('0x2f')]({'plain':!![]});_0x45d20f[_0x6965('0x7')]=0x0;_0x45d20f['loggedInDb']=0x0;_0x45d20f['loggedIn']=0x0;_0x45d20f[_0x6965('0x5')]=0x0;_0x45d20f[_0x6965('0x8')]=0x0;if(_0x5b96fb===_0x6965('0x24')){_0x45d20f[_0x6965('0x30')]=0x0;_0x45d20f[_0x6965('0x9')]=0x0;if(_0x349cb1===_0x6965('0x2d')){_0x45d20f[_0x6965('0x10')]=0x0;_0x45d20f[_0x6965('0x11')]=0x0;}}var _0x3eccf3=_[_0x6965('0x31')](_0xde9266,['id',_0x45d20f['id']]);if(_0x3eccf3){_[_0x6965('0x32')](_0x45d20f,_[_0x6965('0x33')](_0x3eccf3,_0x494530));}return _0x45d20f;});}exports[_0x6965('0x34')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index a98ea3b..6f5ca69 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x49a1a0,_0x48f776){var _0x518a4f=function(_0x313633){while(--_0x313633){_0x49a1a0['push'](_0x49a1a0['shift']());}};_0x518a4f(++_0x48f776);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 700e51a..82852fb 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 _0xcd6b=['execSync','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','createHash','md5','update','digest','hex','getUuid','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid'];(function(_0x270ca1,_0x5a24ef){var _0x29fbb7=function(_0x17b339){while(--_0x17b339){_0x270ca1['push'](_0x270ca1['shift']());}};_0x29fbb7(++_0x5a24ef);}(_0xcd6b,0x1eb));var _0xbcd6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd6b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbcd6('0x0'));var os=require('os');var crypto=require(_0xbcd6('0x1'));var machine=require(_0xbcd6('0x2'));var exec=require('child_process')[_0xbcd6('0x3')];var config=require('../environment');function getInterfaces(){var _0x540165=[];var _0x4a71e3=os[_0xbcd6('0x4')]();var _0x2221c5=_[_0xbcd6('0x5')](_[_0xbcd6('0x6')](_0x4a71e3));for(var _0x55c59b=0x0;_0x55c59b<_0x2221c5[_0xbcd6('0x7')];_0x55c59b++){var _0x217e32=_0x4a71e3[_0x2221c5[_0x55c59b]][_0xbcd6('0x8')](function(_0x4ace58){return _0x4ace58[_0xbcd6('0x9')]===_0xbcd6('0xa')&&_0x4ace58[_0xbcd6('0xb')]===![];});_0x540165=_0x540165[_0xbcd6('0xc')](_0x217e32);}return _0x540165;}function getFirstInterface(){var _0xfdf160=_[_0xbcd6('0xd')](getInterfaces());return{'macAddress':_0xfdf160&&_0xfdf160['mac']?_0xfdf160[_0xbcd6('0xe')]:_0xbcd6('0xf'),'ipAddress':_0xfdf160&&_0xfdf160[_0xbcd6('0x10')]?_0xfdf160[_0xbcd6('0x10')]:_0xbcd6('0x11')};}exports[_0xbcd6('0x12')]=getFirstInterface;function getCPUhash(){var _0x18f08f=_[_0xbcd6('0x5')](os[_0xbcd6('0x13')]()[_0xbcd6('0x14')](function(_0x202a7b){return _0x202a7b[_0xbcd6('0x15')];}))['join'](':');return crypto[_0xbcd6('0x16')](_0xbcd6('0x17'))[_0xbcd6('0x18')](_0x18f08f)[_0xbcd6('0x19')](_0xbcd6('0x1a'));}exports[_0xbcd6('0x1b')]=function(){var _0x1847a4=os['platform']();var _0x12c27f=/[0-9a-f-]{36}/;if(config[_0xbcd6('0x1c')]&&_0x12c27f[_0xbcd6('0x1d')](config[_0xbcd6('0x1c')])){return config['licenseToken'];}else if(_0x1847a4===_0xbcd6('0x1e')){return exec(_0xbcd6('0x1f'),{'encoding':_0xbcd6('0x20')})[_0xbcd6('0x21')]('\x0d\x0a','');}else{var _0xfb21a8=getFirstInterface();var _0x166d59=getCPUhash();var _0x591327=_0x166d59+'|'+os[_0xbcd6('0x22')]()+'|'+_0xfb21a8[_0xbcd6('0x23')]+'|'+_0xfb21a8[_0xbcd6('0x24')];var _0x2de5bd=crypto[_0xbcd6('0x16')]('md5')['update'](_0x591327)[_0xbcd6('0x19')]('hex');return _0x2de5bd[_0xbcd6('0x25')](0x0,0x8)+'-'+_0x2de5bd[_0xbcd6('0x25')](0x8,0xc)+'-'+_0x2de5bd['substring'](0xc,0x10)+'-'+_0x2de5bd[_0xbcd6('0x25')](0x10,0x14)+'-'+_0x2de5bd['substring'](0x14);}}; \ No newline at end of file +var _0xa3c8=['utf8','replace','hostname','ipAddress','lodash','crypto','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','internal','concat','head','mac','127.0.0.1','getFirstInterface','cpus','model','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xa3c8,0x88));var _0x8a3c=function(_0x26aeb6,_0x2ab628){_0x26aeb6=_0x26aeb6-0x0;var _0x341a17=_0xa3c8[_0x26aeb6];return _0x341a17;};'use strict';var _=require(_0x8a3c('0x0'));var os=require('os');var crypto=require(_0x8a3c('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x8a3c('0x2'))[_0x8a3c('0x3')];var config=require(_0x8a3c('0x4'));function getInterfaces(){var _0x559aba=[];var _0x2e49c7=os[_0x8a3c('0x5')]();var _0x5d8a9b=_[_0x8a3c('0x6')](_[_0x8a3c('0x7')](_0x2e49c7));for(var _0x146dd7=0x0;_0x146dd7<_0x5d8a9b[_0x8a3c('0x8')];_0x146dd7++){var _0x44ef11=_0x2e49c7[_0x5d8a9b[_0x146dd7]][_0x8a3c('0x9')](function(_0x438ef9){return _0x438ef9[_0x8a3c('0xa')]==='IPv4'&&_0x438ef9[_0x8a3c('0xb')]===![];});_0x559aba=_0x559aba[_0x8a3c('0xc')](_0x44ef11);}return _0x559aba;}function getFirstInterface(){var _0x47a8c4=_[_0x8a3c('0xd')](getInterfaces());return{'macAddress':_0x47a8c4&&_0x47a8c4[_0x8a3c('0xe')]?_0x47a8c4[_0x8a3c('0xe')]:'00:00:00:00:00:00','ipAddress':_0x47a8c4&&_0x47a8c4['address']?_0x47a8c4['address']:_0x8a3c('0xf')};}exports[_0x8a3c('0x10')]=getFirstInterface;function getCPUhash(){var _0x3c0123=_[_0x8a3c('0x6')](os[_0x8a3c('0x11')]()['map'](function(_0x9da047){return _0x9da047[_0x8a3c('0x12')];}))['join'](':');return crypto[_0x8a3c('0x13')](_0x8a3c('0x14'))[_0x8a3c('0x15')](_0x3c0123)[_0x8a3c('0x16')](_0x8a3c('0x17'));}exports[_0x8a3c('0x18')]=function(){var _0x4835a2=os[_0x8a3c('0x19')]();var _0x3878ec=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x3878ec['test'](config[_0x8a3c('0x1a')])){return config[_0x8a3c('0x1a')];}else if(_0x4835a2===_0x8a3c('0x1b')){return exec(_0x8a3c('0x1c'),{'encoding':_0x8a3c('0x1d')})[_0x8a3c('0x1e')]('\x0d\x0a','');}else{var _0x5c8da1=getFirstInterface();var _0x1a4143=getCPUhash();var _0x16cac3=_0x1a4143+'|'+os[_0x8a3c('0x1f')]()+'|'+_0x5c8da1['macAddress']+'|'+_0x5c8da1[_0x8a3c('0x20')];var _0x14b19e=crypto[_0x8a3c('0x13')](_0x8a3c('0x14'))[_0x8a3c('0x15')](_0x16cac3)[_0x8a3c('0x16')](_0x8a3c('0x17'));return _0x14b19e['substring'](0x0,0x8)+'-'+_0x14b19e['substring'](0x8,0xc)+'-'+_0x14b19e['substring'](0xc,0x10)+'-'+_0x14b19e['substring'](0x10,0x14)+'-'+_0x14b19e['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index e663063..9987770 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 _0x7a79=['message','default','util','moment','request-promise','pkginfo','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data2','data1','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','days','error','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s'];(function(_0x2ca993,_0x5837f2){var _0x3e146f=function(_0x4a6155){while(--_0x4a6155){_0x2ca993['push'](_0x2ca993['shift']());}};_0x3e146f(++_0x5837f2);}(_0x7a79,0x13a));var _0x97a7=function(_0x17a9a4,_0x103238){_0x17a9a4=_0x17a9a4-0x0;var _0x148d98=_0x7a79[_0x17a9a4];return _0x148d98;};'use strict';var util=require(_0x97a7('0x0'));var moment=require(_0x97a7('0x1'));var rp=require(_0x97a7('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x97a7('0x3'))(module,'version');var db=require(_0x97a7('0x4'))['db'];var encryptor=require(_0x97a7('0x5'));var hardware=require('./hardware');var logger=require(_0x97a7('0x6'))(_0x97a7('0x7'));var HOST=_0x97a7('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x108902){return new BPromise(function(_0x2bda75,_0x76a05b){var _0x2e6e36=util[_0x97a7('0x9')](_0x97a7('0xa'),HOST,_0x108902,module[_0x97a7('0xb')]['version']);if(oldToken){_0x2e6e36=util[_0x97a7('0x9')](_0x97a7('0xc'),HOST,_0x108902,module[_0x97a7('0xb')]['version'],oldToken);}var _0x5222d1={'uri':_0x2e6e36,'method':_0x97a7('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x5222d1)[_0x97a7('0xe')](function(_0x2d3cff){_0x2bda75(_0x2d3cff);})[_0x97a7('0xf')](function(_0x2937b1){_0x76a05b(_0x2937b1);});});}function manageLicense(_0x969d10,_0x44700a){var _0x15a998=_0x44700a[_0x97a7('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x15a998['data1']!==_0x969d10&&!_0x15a998[_0x97a7('0x11')]){oldToken=_0x15a998[_0x97a7('0x12')];}httpRequest(_0x969d10)[_0x97a7('0xe')](function(_0x49e0ac){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x49e0ac['active']){isOldTokenSent=![];if(!_0x15a998[_0x97a7('0x7')]&&_0x15a998[_0x97a7('0x7')]!=_0x49e0ac[_0x97a7('0x7')]||_0x15a998[_0x97a7('0x7')]&&_0x15a998[_0x97a7('0x11')]){logger[_0x97a7('0x13')](_0x97a7('0x14'));}if(_0x15a998[_0x97a7('0x7')]&&!_0x15a998[_0x97a7('0x11')]&&_0x15a998[_0x97a7('0x7')]!=_0x49e0ac['license']){logger['info'](_0x97a7('0x15'));}if(_0x15a998[_0x97a7('0x7')]&&!_0x15a998[_0x97a7('0x11')]&&_0x15a998[_0x97a7('0x7')]==_0x49e0ac[_0x97a7('0x7')]){return _0x44700a;}return _0x44700a[_0x97a7('0x16')]({'data1':_0x969d10,'data2':null,'license':_0x49e0ac['license']});}else{if(_0x49e0ac['license']||_0x15a998['license']){if(!_0x15a998['data2']){if(_0x15a998[_0x97a7('0x12')]==_0x969d10){GRAY_PERIOD_REASON=_0x97a7('0x17');logger[_0x97a7('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x97a7('0x18');logger[_0x97a7('0x13')](_0x97a7('0x19'),_0x15a998['data1'],_0x969d10);}logger[_0x97a7('0x13')](_0x97a7('0x1a'),GRAY_PERIOD_REASON[_0x97a7('0x1b')](),moment()[_0x97a7('0x9')](_0x97a7('0x1c')));return _0x44700a['update']({'data2':encryptor[_0x97a7('0x1d')](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor[_0x97a7('0x1e')](_0x15a998[_0x97a7('0x11')]),_0x97a7('0x1f'))>DAYS){logger[_0x97a7('0x13')]('DEMO\x20START\x20AT\x20%s',moment()['format'](_0x97a7('0x1c')));isOldTokenSent=![];return _0x44700a['update']({'data1':_0x969d10,'data2':null,'license':null});}}}else{if(_0x15a998[_0x97a7('0x12')]!=_0x969d10){logger[_0x97a7('0x13')](_0x97a7('0x19'),_0x15a998['data1'],_0x969d10);return _0x44700a['update']({'data1':_0x969d10,'data2':null,'license':null});}}}return _0x44700a;})[_0x97a7('0xe')](function(_0x29a44c){_0x44700a=_0x29a44c;})[_0x97a7('0xf')](function(_0x1d0d09){logger[_0x97a7('0x20')](_0x1d0d09['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x97a7('0x21')](),_0x44700a);},TIME);});}function defaultLicense(){var _0x2f40ac=hardware[_0x97a7('0x21')]();if(_0x2f40ac){return db[_0x97a7('0x22')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x2f40ac}})[_0x97a7('0x23')](function(_0x4d8737,_0x30479e){logger[_0x97a7('0x13')](_0x97a7('0x24'),_0x2f40ac);manageLicense(_0x2f40ac,_0x4d8737);})['catch'](function(_0x1b1027){logger[_0x97a7('0x20')](_0x1b1027[_0x97a7('0x25')]);});}}exports[_0x97a7('0x26')]=defaultLicense; \ No newline at end of file +var _0x2812=['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','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','error','finally','getUuid','License','findOrCreate','spread','message','default','util','moment','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','exports','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x2812,0x6b));var _0x2281=function(_0x5cb97e,_0x132a39){_0x5cb97e=_0x5cb97e-0x0;var _0x1714b4=_0x2812[_0x5cb97e];return _0x1714b4;};'use strict';var util=require(_0x2281('0x0'));var moment=require(_0x2281('0x1'));var rp=require(_0x2281('0x2'));var BPromise=require(_0x2281('0x3'));var pkginfo=require('pkginfo')(module,_0x2281('0x4'));var db=require(_0x2281('0x5'))['db'];var encryptor=require(_0x2281('0x6'));var hardware=require(_0x2281('0x7'));var logger=require(_0x2281('0x8'))(_0x2281('0x9'));var HOST=_0x2281('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4e0116){return new BPromise(function(_0x1c8eea,_0x477a33){var _0x212c80=util[_0x2281('0xb')]('%s/api/servers/%s/check?version=%s',HOST,_0x4e0116,module[_0x2281('0xc')][_0x2281('0x4')]);if(oldToken){_0x212c80=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x4e0116,module['exports'][_0x2281('0x4')],oldToken);}var _0x29da1e={'uri':_0x212c80,'method':_0x2281('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x29da1e)[_0x2281('0xe')](function(_0x57fe79){_0x1c8eea(_0x57fe79);})[_0x2281('0xf')](function(_0x5e4679){_0x477a33(_0x5e4679);});});}function manageLicense(_0x33452b,_0x528631){var _0x449868=_0x528631[_0x2281('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x449868[_0x2281('0x11')]!==_0x33452b&&!_0x449868[_0x2281('0x12')]){oldToken=_0x449868[_0x2281('0x11')];}httpRequest(_0x33452b)[_0x2281('0xe')](function(_0x1f4842){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1f4842[_0x2281('0x13')]){isOldTokenSent=![];if(!_0x449868[_0x2281('0x9')]&&_0x449868['license']!=_0x1f4842[_0x2281('0x9')]||_0x449868[_0x2281('0x9')]&&_0x449868[_0x2281('0x12')]){logger[_0x2281('0x14')](_0x2281('0x15'));}if(_0x449868[_0x2281('0x9')]&&!_0x449868[_0x2281('0x12')]&&_0x449868[_0x2281('0x9')]!=_0x1f4842[_0x2281('0x9')]){logger['info'](_0x2281('0x16'));}if(_0x449868['license']&&!_0x449868[_0x2281('0x12')]&&_0x449868[_0x2281('0x9')]==_0x1f4842[_0x2281('0x9')]){return _0x528631;}return _0x528631[_0x2281('0x17')]({'data1':_0x33452b,'data2':null,'license':_0x1f4842['license']});}else{if(_0x1f4842[_0x2281('0x9')]||_0x449868[_0x2281('0x9')]){if(!_0x449868[_0x2281('0x12')]){if(_0x449868['data1']==_0x33452b){GRAY_PERIOD_REASON=_0x2281('0x18');logger[_0x2281('0x14')](_0x2281('0x19'));}else{GRAY_PERIOD_REASON=_0x2281('0x1a');logger[_0x2281('0x14')](_0x2281('0x1b'),_0x449868[_0x2281('0x11')],_0x33452b);}logger[_0x2281('0x14')](_0x2281('0x1c'),GRAY_PERIOD_REASON[_0x2281('0x1d')](),moment()[_0x2281('0xb')](_0x2281('0x1e')));return _0x528631['update']({'data2':encryptor[_0x2281('0x1f')](moment()[_0x2281('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x2281('0x20')](encryptor[_0x2281('0x21')](_0x449868['data2']),_0x2281('0x22'))>DAYS){logger[_0x2281('0x14')]('DEMO\x20START\x20AT\x20%s',moment()[_0x2281('0xb')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x528631[_0x2281('0x17')]({'data1':_0x33452b,'data2':null,'license':null});}}}else{if(_0x449868['data1']!=_0x33452b){logger[_0x2281('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x449868[_0x2281('0x11')],_0x33452b);return _0x528631[_0x2281('0x17')]({'data1':_0x33452b,'data2':null,'license':null});}}}return _0x528631;})[_0x2281('0xe')](function(_0x28cfac){_0x528631=_0x28cfac;})[_0x2281('0xf')](function(_0x57057a){logger[_0x2281('0x23')](_0x57057a['message']);})[_0x2281('0x24')](function(){setTimeout(function(){manageLicense(hardware[_0x2281('0x25')](),_0x528631);},TIME);});}function defaultLicense(){var _0x23f32f=hardware[_0x2281('0x25')]();if(_0x23f32f){return db[_0x2281('0x26')][_0x2281('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x23f32f}})[_0x2281('0x28')](function(_0x18a5de,_0x4bcc5c){logger[_0x2281('0x14')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x23f32f);manageLicense(_0x23f32f,_0x18a5de);})[_0x2281('0xf')](function(_0x3ee4da){logger[_0x2281('0x23')](_0x3ee4da[_0x2281('0x29')]);});}}exports[_0x2281('0x2a')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index b607142..b471413 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 _0xd183=['decryptString','%s:%s:%s','parse','demo','gray','deadline','days','format','grayReason','machineUuid','disabled','message','User','findAll','role','sequelize','col','admin','user','telephones','forEach','count','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20telephones','exports','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split'];(function(_0x4c0121,_0x451888){var _0x205464=function(_0x2a999d){while(--_0x2a999d){_0x4c0121['push'](_0x4c0121['shift']());}};_0x205464(++_0x451888);}(_0xd183,0x156));var _0x3d18=function(_0x86883c,_0x54d699){_0x86883c=_0x86883c-0x0;var _0x231dc3=_0xd183[_0x86883c];return _0x231dc3;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');var BPromise=require(_0x3d18('0x0'));var hardware=require('./hardware');var encryptor=require(_0x3d18('0x1'));var db=require(_0x3d18('0x2'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3d18('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x3d18('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'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':![],'update':![],'description':_0x3d18('0x5'),'machineUuid':hardware[_0x3d18('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5d6585){return new BPromise(function(_0x45740d,_0x23caa3){return db[_0x3d18('0x6')][_0x3d18('0x7')](_[_0x3d18('0x8')](_0x5d6585,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0xe78b68){return checkLicense(_0xe78b68,null);})[_0x3d18('0x9')](function(_0x2d0735){_0x45740d(_0x2d0735);return;})[_0x3d18('0xa')](function(_0x20ebe3){_0x23caa3(_0x20ebe3);});});}function checkLicense(_0x4587a5,_0x44fa29){if(!_0x4587a5){demoLicense[_0x3d18('0xb')]=_0x4587a5[_0x3d18('0xc')];return demoLicense;}try{var _0x3f60df=_0x44fa29||_0x4587a5[_0x3d18('0xd')];if(_[_0x3d18('0xe')](_0x3f60df)){throw new Error(_0x3d18('0xf'));}var _0x43c1bd=_0x4587a5[_0x3d18('0xc')];var _0x22021c=_0x4587a5[_0x3d18('0x10')];var _0x5394aa=_0x43c1bd['split']('-')[0x4];var _0x106579=_0x43c1bd[_0x3d18('0x11')]('-')[0x0];var _0x4d3da8=encryptor[_0x3d18('0x12')](_0x3f60df,util['format'](_0x3d18('0x13'),_0x5394aa,_0x43c1bd,_0x106579));var _0x1a8bcf=JSON[_0x3d18('0x14')](_0x4d3da8);_0x1a8bcf[_0x3d18('0x15')]=![];_0x1a8bcf[_0x3d18('0xb')]=_0x43c1bd;_0x1a8bcf['machineUuid']=hardware[_0x3d18('0x4')]();if(_0x22021c){var _0x115de7=encryptor['decryptString'](_0x22021c);_0x1a8bcf[_0x3d18('0x16')]=_0x115de7;_0x1a8bcf[_0x3d18('0x17')]=moment(_0x115de7)['add'](0x7,_0x3d18('0x18'))[_0x3d18('0x19')]();_0x1a8bcf[_0x3d18('0x1a')]=_0x1a8bcf[_0x3d18('0xb')]!=_0x1a8bcf[_0x3d18('0x1b')]?'changed':_0x3d18('0x1c');}return _0x1a8bcf;}catch(_0x32406d){breakingLicense['uuid']=_0x4587a5[_0x3d18('0xc')];breakingLicense['message']=_0x32406d[_0x3d18('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3f71e1,_0x142898){getLicense()[_0x3d18('0x9')](function(_0x307b27){return db[_0x3d18('0x1e')][_0x3d18('0x1f')]({'attributes':[_0x3d18('0x20'),[db[_0x3d18('0x21')]['fn']('COUNT',db[_0x3d18('0x21')][_0x3d18('0x22')](_0x3d18('0x20'))),'count']],'group':_0x3d18('0x20'),'where':{'role':{'$or':[_0x3d18('0x23'),_0x3d18('0x24'),'telephone']}},'raw':!![]})[_0x3d18('0x9')](function(_0x5d81d9){var _0x4edd78={'user':_0x307b27['users']||0x0,'telephone':_0x307b27[_0x3d18('0x25')]||0x0};_0x5d81d9[_0x3d18('0x26')](function(_0x5df50e){var _0x3eb28c=_0x5df50e[_0x3d18('0x20')]===_0x3d18('0x23')?_0x3d18('0x24'):_0x5df50e['role'];_0x4edd78[_0x3eb28c]-=_0x5df50e[_0x3d18('0x27')];if(_0x4edd78[_0x3eb28c]<0x0)_0x4edd78[_0x3eb28c]=0x0;});_0x3f71e1(_0x4edd78);return;});})[_0x3d18('0xa')](function(_0x4a1f44){_0x142898(_0x4a1f44);});});}function checkUserLimits(_0x4596c0){return new BPromise(function(_0x58c4fb,_0x4f52f9){getLimits()[_0x3d18('0x9')](function(_0x42046f){var _0x2d9cce=_[_0x3d18('0x28')](_[_0x3d18('0x29')](_0x4596c0,_0x3d18('0x20')),[_0x3d18('0x23'),_0x3d18('0x24'),_0x3d18('0x2a')]);var _0x37aab3=(_0x2d9cce[_0x3d18('0x23')]||0x0)+(_0x2d9cce[_0x3d18('0x24')]||0x0);var _0x30a26f=_0x2d9cce[_0x3d18('0x2a')]||0x0;if(_0x37aab3>_0x42046f[_0x3d18('0x24')])return _0x4f52f9('License\x20limit\x20reached\x20for\x20users');if(_0x30a26f>_0x42046f[_0x3d18('0x2a')])return _0x4f52f9(_0x3d18('0x2b'));return _0x58c4fb();})[_0x3d18('0xa')](function(_0x2efcf0){_0x4f52f9(_0x2efcf0);});});}module[_0x3d18('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xb4a8=['add','changed','disabled','message','User','findAll','role','sequelize','COUNT','count','admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','./hardware','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','isEmpty','split','format','%s:%s:%s','demo','machineUuid','gray','deadline'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0xb4a8,0x142));var _0x8b4a=function(_0x1ab0e6,_0x17ba8d){_0x1ab0e6=_0x1ab0e6-0x0;var _0x248815=_0xb4a8[_0x1ab0e6];return _0x248815;};'use strict';var util=require(_0x8b4a('0x0'));var _=require('lodash');var moment=require(_0x8b4a('0x1'));var BPromise=require(_0x8b4a('0x2'));var hardware=require(_0x8b4a('0x3'));var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8b4a('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x8b4a('0x5'),'machineUuid':hardware[_0x8b4a('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8b4a('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x8b4a('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xcbeca2){return new BPromise(function(_0x3cbee3,_0x4827ae){return db[_0x8b4a('0x7')][_0x8b4a('0x8')](_[_0x8b4a('0x9')](_0xcbeca2,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x2f47ab){return checkLicense(_0x2f47ab,null);})[_0x8b4a('0xa')](function(_0x480a0b){_0x3cbee3(_0x480a0b);return;})[_0x8b4a('0xb')](function(_0x4d0845){_0x4827ae(_0x4d0845);});});}function checkLicense(_0xf7eca5,_0x16a358){if(!_0xf7eca5){demoLicense[_0x8b4a('0xc')]=_0xf7eca5[_0x8b4a('0xd')];return demoLicense;}try{var _0x7cd0ec=_0x16a358||_0xf7eca5['license'];if(_[_0x8b4a('0xe')](_0x7cd0ec)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x23f5b6=_0xf7eca5[_0x8b4a('0xd')];var _0x23d5a3=_0xf7eca5['data2'];var _0x2d387e=_0x23f5b6[_0x8b4a('0xf')]('-')[0x4];var _0x1b5910=_0x23f5b6[_0x8b4a('0xf')]('-')[0x0];var _0x4c9c39=encryptor['decryptString'](_0x7cd0ec,util[_0x8b4a('0x10')](_0x8b4a('0x11'),_0x2d387e,_0x23f5b6,_0x1b5910));var _0x3d9787=JSON['parse'](_0x4c9c39);_0x3d9787[_0x8b4a('0x12')]=![];_0x3d9787['uuid']=_0x23f5b6;_0x3d9787[_0x8b4a('0x13')]=hardware[_0x8b4a('0x6')]();if(_0x23d5a3){var _0x4bf53d=encryptor['decryptString'](_0x23d5a3);_0x3d9787[_0x8b4a('0x14')]=_0x4bf53d;_0x3d9787[_0x8b4a('0x15')]=moment(_0x4bf53d)[_0x8b4a('0x16')](0x7,'days')[_0x8b4a('0x10')]();_0x3d9787['grayReason']=_0x3d9787[_0x8b4a('0xc')]!=_0x3d9787[_0x8b4a('0x13')]?_0x8b4a('0x17'):_0x8b4a('0x18');}return _0x3d9787;}catch(_0x1aedf9){breakingLicense[_0x8b4a('0xc')]=_0xf7eca5['data1'];breakingLicense[_0x8b4a('0x19')]=_0x1aedf9[_0x8b4a('0x19')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x472d1b,_0x23db93){getLicense()['then'](function(_0x43f538){return db[_0x8b4a('0x1a')][_0x8b4a('0x1b')]({'attributes':[_0x8b4a('0x1c'),[db[_0x8b4a('0x1d')]['fn'](_0x8b4a('0x1e'),db['sequelize']['col']('role')),_0x8b4a('0x1f')]],'group':'role','where':{'role':{'$or':[_0x8b4a('0x20'),_0x8b4a('0x21'),_0x8b4a('0x22')]}},'raw':!![]})[_0x8b4a('0xa')](function(_0x39eea7){var _0x125976={'user':_0x43f538[_0x8b4a('0x23')]||0x0,'telephone':_0x43f538[_0x8b4a('0x24')]||0x0};_0x39eea7[_0x8b4a('0x25')](function(_0x81c1af){var _0x591c1f=_0x81c1af[_0x8b4a('0x1c')]===_0x8b4a('0x20')?_0x8b4a('0x21'):_0x81c1af[_0x8b4a('0x1c')];_0x125976[_0x591c1f]-=_0x81c1af[_0x8b4a('0x1f')];if(_0x125976[_0x591c1f]<0x0)_0x125976[_0x591c1f]=0x0;});_0x472d1b(_0x125976);return;});})[_0x8b4a('0xb')](function(_0x42dc56){_0x23db93(_0x42dc56);});});}function checkUserLimits(_0x173e2e){return new BPromise(function(_0x4f81a1,_0x42aa24){getLimits()[_0x8b4a('0xa')](function(_0x374966){var _0x4264dd=_[_0x8b4a('0x26')](_[_0x8b4a('0x27')](_0x173e2e,_0x8b4a('0x1c')),['admin',_0x8b4a('0x21'),_0x8b4a('0x22')]);var _0x512617=(_0x4264dd[_0x8b4a('0x20')]||0x0)+(_0x4264dd[_0x8b4a('0x21')]||0x0);var _0x385d72=_0x4264dd[_0x8b4a('0x22')]||0x0;if(_0x512617>_0x374966[_0x8b4a('0x21')])return _0x42aa24(_0x8b4a('0x28'));if(_0x385d72>_0x374966[_0x8b4a('0x22')])return _0x42aa24(_0x8b4a('0x29'));return _0x4f81a1();})[_0x8b4a('0xb')](function(_0x1dc4a9){_0x42aa24(_0x1dc4a9);});});}module[_0x8b4a('0x2a')]={'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 ae18022..088ad65 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 _0x4b17=['secret','exports','myappanuglar-secret'];(function(_0x2a99a1,_0x89652a){var _0x59a31e=function(_0x4604c1){while(--_0x4604c1){_0x2a99a1['push'](_0x2a99a1['shift']());}};_0x59a31e(++_0x89652a);}(_0x4b17,0x10f));var _0x74b1=function(_0x305b20,_0x5e57e9){_0x305b20=_0x305b20-0x0;var _0x26d64a=_0x4b17[_0x305b20];return _0x26d64a;};'use strict';module[_0x74b1('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x74b1('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x74b1('0x2'),'DEBUG':''}; \ No newline at end of file +var _0xdd4f=['exports','secret'];(function(_0xd6f9e,_0x1f120c){var _0x32ff57=function(_0x433f77){while(--_0x433f77){_0xd6f9e['push'](_0xd6f9e['shift']());}};_0x32ff57(++_0x1f120c);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0xcec852,_0x2a90fa){_0xcec852=_0xcec852-0x0;var _0x54f473=_0xdd4f[_0xcec852];return _0x54f473;};'use strict';module[_0xfdd4('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xfdd4('0x1'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index d033dbf..446d34d 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb504=['exports','../utils/loggers','fileLogger'];(function(_0x52355b,_0x89404e){var _0xf86f90=function(_0x146a84){while(--_0x146a84){_0x52355b['push'](_0x52355b['shift']());}};_0xf86f90(++_0x89404e);}(_0xb504,0x1cf));var _0x4b50=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xb504[_0x1facfa];return _0x9ec701;};'use strict';var fileLogger=require(_0x4b50('0x0'))[_0x4b50('0x1')];module[_0x4b50('0x2')]=fileLogger; \ No newline at end of file +var _0x069b=['fileLogger','../utils/loggers'];(function(_0x193aec,_0x446cec){var _0x5363c1=function(_0x423706){while(--_0x423706){_0x193aec['push'](_0x193aec['shift']());}};_0x5363c1(++_0x446cec);}(_0x069b,0x17d));var _0xb069=function(_0x14951a,_0x28b1d6){_0x14951a=_0x14951a-0x0;var _0x1e2696=_0x069b[_0x14951a];return _0x1e2696;};'use strict';var fileLogger=require(_0xb069('0x0'))[_0xb069('0x1')];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 0dddd6d..179d943 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 _0xc731=['agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports','path','../../config/environment','resolve','root','legacy-libs','express','../../services/express/index.js','ami','join','../../services/ami/index.js'];(function(_0x3597a8,_0x21ed84){var _0x5dacc7=function(_0x1bc00b){while(--_0x1bc00b){_0x3597a8['push'](_0x3597a8['shift']());}};_0x5dacc7(++_0x21ed84);}(_0xc731,0x98));var _0x1c73=function(_0x3b9496,_0x4f538a){_0x3b9496=_0x3b9496-0x0;var _0x5b9202=_0xc731[_0x3b9496];return _0x5b9202;};'use strict';var path=require(_0x1c73('0x0'));var cfg=require(_0x1c73('0x1'));var env={'NODE_PATH':path[_0x1c73('0x2')](path['join'](cfg[_0x1c73('0x3')],_0x1c73('0x4')))};var pm2config={'apps':[{'name':_0x1c73('0x5'),'script':path['join'](__dirname,_0x1c73('0x6')),'env':env},{'name':_0x1c73('0x7'),'script':path[_0x1c73('0x8')](__dirname,_0x1c73('0x9')),'env':env},{'name':_0x1c73('0xa'),'script':path[_0x1c73('0x8')](__dirname,_0x1c73('0xb')),'env':env},{'name':_0x1c73('0xc'),'script':path['join'](__dirname,_0x1c73('0xd')),'env':env},{'name':_0x1c73('0xe'),'script':path[_0x1c73('0x8')](__dirname,_0x1c73('0xf')),'env':env},{'name':_0x1c73('0x10'),'script':path[_0x1c73('0x8')](__dirname,'../../services/xdr/index.js'),'env':env}]};module[_0x1c73('0x11')]=pm2config; \ No newline at end of file +var _0x20b2=['../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','../../config/environment','resolve','join','legacy-libs','express'];(function(_0x4bab23,_0x252745){var _0xc1776e=function(_0x59c760){while(--_0x59c760){_0x4bab23['push'](_0x4bab23['shift']());}};_0xc1776e(++_0x252745);}(_0x20b2,0xb0));var _0x220b=function(_0x2cf0fc,_0x5528a5){_0x2cf0fc=_0x2cf0fc-0x0;var _0x5e0275=_0x20b2[_0x2cf0fc];return _0x5e0275;};'use strict';var path=require(_0x220b('0x0'));var cfg=require(_0x220b('0x1'));var env={'NODE_PATH':path[_0x220b('0x2')](path[_0x220b('0x3')](cfg['root'],_0x220b('0x4')))};var pm2config={'apps':[{'name':_0x220b('0x5'),'script':path['join'](__dirname,_0x220b('0x6')),'env':env},{'name':_0x220b('0x7'),'script':path[_0x220b('0x3')](__dirname,_0x220b('0x8')),'env':env},{'name':'agi','script':path[_0x220b('0x3')](__dirname,_0x220b('0x9')),'env':env},{'name':'email','script':path[_0x220b('0x3')](__dirname,_0x220b('0xa')),'env':env},{'name':'routing','script':path['join'](__dirname,_0x220b('0xb')),'env':env},{'name':_0x220b('0xc'),'script':path['join'](__dirname,_0x220b('0xd')),'env':env}]};module['exports']=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index fddf01d..13cc7f3 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 _0xb9fa=['saved','pm2','bluebird','connect','connected','start','then','disconnect','stop','restart','describe','delete','dump'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xb9fa,0xb7));var _0xab9f=function(_0x48edf1,_0x342345){_0x48edf1=_0x48edf1-0x0;var _0x34894b=_0xb9fa[_0x48edf1];return _0x34894b;};'use strict';var pm2=require(_0xab9f('0x0'));var BPromise=require(_0xab9f('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x5ddb6f,_0x244489){return pm2[_0xab9f('0x2')](function(_0x3188cf){if(_0x3188cf){return _0x244489(_0x3188cf);}return _0x5ddb6f(_0xab9f('0x3'));});});};exports[_0xab9f('0x4')]=function(_0x41c1cd){return connect()[_0xab9f('0x5')](function(){return new BPromise(function(_0x195e0a,_0x2a0dc7){return pm2['start'](_0x41c1cd,function(_0x35229f,_0x36d59c){if(_0x35229f){return _0x2a0dc7(_0x35229f);}pm2[_0xab9f('0x6')]();return _0x195e0a(_0x36d59c);});});});};exports[_0xab9f('0x7')]=function(_0x387192){return connect()[_0xab9f('0x5')](function(){return new BPromise(function(_0x415b12,_0x22e01f){return pm2[_0xab9f('0x7')](_0x387192,function(_0x26c4b6,_0x1965b3){if(_0x26c4b6){return _0x22e01f(_0x26c4b6);}pm2[_0xab9f('0x6')]();return _0x415b12(_0x1965b3);});});});};exports['restart']=function(_0x2db208){return connect()[_0xab9f('0x5')](function(){return new BPromise(function(_0x17ff39,_0x1a3681){return pm2[_0xab9f('0x8')](_0x2db208,function(_0x5ccb80,_0x37e141){if(_0x5ccb80){return _0x1a3681(_0x5ccb80);}pm2[_0xab9f('0x6')]();return _0x17ff39(_0x37e141);});});});};exports['list']=function(){return connect()[_0xab9f('0x5')](function(){return new BPromise(function(_0x4c0dc2,_0x47836b){return pm2['list'](function(_0x2c598d,_0x224d2b){if(_0x2c598d){return _0x47836b(_0x2c598d);}pm2['disconnect']();return _0x4c0dc2(_0x224d2b);});});});};exports['describe']=function(_0x3f48fe){return connect()[_0xab9f('0x5')](function(){return new BPromise(function(_0xe9e4b,_0x49b94d){return pm2[_0xab9f('0x9')](_0x3f48fe,function(_0x48649a,_0x2051c1){if(_0x48649a){return _0x49b94d(_0x48649a);}pm2[_0xab9f('0x6')]();return _0xe9e4b(_0x2051c1);});});});};exports[_0xab9f('0xa')]=function(_0xa070bc){return connect()['then'](function(){return new BPromise(function(_0x1756c8,_0x3cda44){return pm2[_0xab9f('0xa')](_0xa070bc,function(_0x1922da,_0x1da3f5){if(_0x1922da){return _0x3cda44(_0x1922da);}pm2[_0xab9f('0x6')]();return _0x1756c8(_0x1da3f5);});});});};exports[_0xab9f('0xb')]=function(){return connect()[_0xab9f('0x5')](function(){return new BPromise(function(_0x2581ff,_0x4e0499){return pm2['dump'](function(_0xef56a9){if(_0xef56a9){return _0x4e0499(_0xef56a9);}return _0x2581ff(_0xab9f('0xc'));});});});}; \ No newline at end of file +var _0x9468=['./config','connect','start','then','stop','restart','disconnect','list','describe','delete','dump','pm2','bluebird'];(function(_0x3838a4,_0x2ae1e6){var _0x3c56b4=function(_0x4cbf64){while(--_0x4cbf64){_0x3838a4['push'](_0x3838a4['shift']());}};_0x3c56b4(++_0x2ae1e6);}(_0x9468,0xb4));var _0x8946=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x9468[_0x3ea913];return _0x2b4f28;};'use strict';var pm2=require(_0x8946('0x0'));var BPromise=require(_0x8946('0x1'));var config=require(_0x8946('0x2'));function connect(){return new BPromise(function(_0x2a3d88,_0x31dfca){return pm2[_0x8946('0x3')](function(_0x1c2d1a){if(_0x1c2d1a){return _0x31dfca(_0x1c2d1a);}return _0x2a3d88('connected');});});};exports[_0x8946('0x4')]=function(_0x17bdf0){return connect()[_0x8946('0x5')](function(){return new BPromise(function(_0x29e4bc,_0x3ae915){return pm2[_0x8946('0x4')](_0x17bdf0,function(_0x476d40,_0xd4e482){if(_0x476d40){return _0x3ae915(_0x476d40);}pm2['disconnect']();return _0x29e4bc(_0xd4e482);});});});};exports[_0x8946('0x6')]=function(_0xacc8e5){return connect()[_0x8946('0x5')](function(){return new BPromise(function(_0x22dd20,_0x2af301){return pm2['stop'](_0xacc8e5,function(_0x284e40,_0x8e578d){if(_0x284e40){return _0x2af301(_0x284e40);}pm2['disconnect']();return _0x22dd20(_0x8e578d);});});});};exports[_0x8946('0x7')]=function(_0x16b208){return connect()['then'](function(){return new BPromise(function(_0x926def,_0x21ec58){return pm2['restart'](_0x16b208,function(_0xbee81a,_0x49e98c){if(_0xbee81a){return _0x21ec58(_0xbee81a);}pm2[_0x8946('0x8')]();return _0x926def(_0x49e98c);});});});};exports['list']=function(){return connect()[_0x8946('0x5')](function(){return new BPromise(function(_0x26d02f,_0x592d28){return pm2[_0x8946('0x9')](function(_0x43d29f,_0x44165a){if(_0x43d29f){return _0x592d28(_0x43d29f);}pm2[_0x8946('0x8')]();return _0x26d02f(_0x44165a);});});});};exports['describe']=function(_0x29d93b){return connect()[_0x8946('0x5')](function(){return new BPromise(function(_0x418be6,_0x5c6bee){return pm2[_0x8946('0xa')](_0x29d93b,function(_0x5a0be3,_0x45bb49){if(_0x5a0be3){return _0x5c6bee(_0x5a0be3);}pm2[_0x8946('0x8')]();return _0x418be6(_0x45bb49);});});});};exports[_0x8946('0xb')]=function(_0x3bf06d){return connect()[_0x8946('0x5')](function(){return new BPromise(function(_0x418f83,_0x2874e6){return pm2['delete'](_0x3bf06d,function(_0x550eba,_0x15d984){if(_0x550eba){return _0x2874e6(_0x550eba);}pm2[_0x8946('0x8')]();return _0x418f83(_0x15d984);});});});};exports[_0x8946('0xc')]=function(){return connect()[_0x8946('0x5')](function(){return new BPromise(function(_0x4191a8,_0x1c27ab){return pm2[_0x8946('0xc')](function(_0x69bc26){if(_0x69bc26){return _0x1c27ab(_0x69bc26);}return _0x4191a8('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index c2f5c0e..804fe59 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 _0x3733=['then','ChatInteraction','findAll','lastMsgAt','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','inspect','start','lodash','moment','util','../../config/environment','../logger','schedule','defaults','redis','localhost','Setting','chatTimeout'];(function(_0x406d5c,_0x467738){var _0x2e4af6=function(_0x5529d2){while(--_0x5529d2){_0x406d5c['push'](_0x406d5c['shift']());}};_0x2e4af6(++_0x467738);}(_0x3733,0x1c6));var _0x3373=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3733[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3373('0x0'));var moment=require(_0x3373('0x1'));var Redis=require('ioredis');var util=require(_0x3373('0x2'));var config=require(_0x3373('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x3373('0x4'))(_0x3373('0x5'));config['redis']=_[_0x3373('0x6')](config[_0x3373('0x7')],{'host':_0x3373('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3373('0x7')]));function closeInteractions(){var _0x22d1b3=0x0;var _0xae733d=[];return db[_0x3373('0x9')]['find']({'raw':!![],'attributes':['id',_0x3373('0xa')],'where':{'id':0x1}})[_0x3373('0xb')](function(_0x571322){_0x22d1b3=_0x571322[_0x3373('0xa')];if(_0x22d1b3){return db[_0x3373('0xc')][_0x3373('0xd')]({'raw':!![],'attributes':['id',_0x3373('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x3373('0xf')](_0x571322['chatTimeout'],'minutes')}}});}else{return[];}})['then'](function(_0xb88684){if(_0xb88684&&_0xb88684[_0x3373('0x10')]){_0xae733d=_[_0x3373('0x11')](_0xb88684||[],'id');logger[_0x3373('0x12')](_0x3373('0x13'),_0xae733d[_0x3373('0x14')]());return db[_0x3373('0xc')]['update']({'closeReason':_0x3373('0x15'),'disposition':_0x3373('0x16'),'closed':!![],'closedAt':moment()[_0x3373('0x17')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0xae733d}});}})['then'](function(){if(_0xae733d&&_0xae733d[_0x3373('0x10')]){logger[_0x3373('0x12')](_0x3373('0x18'),_0xae733d['join']());for(var _0x405725=0x0;_0x405725<_0xae733d[_0x3373('0x10')];_0x405725++){io[_0x3373('0x19')](_0x3373('0x1a'),{'id':_0xae733d[_0x405725],'closed':!![]});}}})[_0x3373('0x1b')](function(_0x4519f1){logger[_0x3373('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x4519f1?util[_0x3373('0x1d')](_0x4519f1,{'showHidden':![],'depth':null}):'');});}exports[_0x3373('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x4909=['system','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../config/environment','../../mysqldb','schedule','localhost','socket.io-emitter','Setting','chatTimeout','then','findAll','lastMsgAt','subtract','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','update'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x4909,0x10e));var _0x9490=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0x4909[_0x263f4c];return _0x3a78d3;};'use strict';var _=require(_0x9490('0x0'));var moment=require(_0x9490('0x1'));var Redis=require(_0x9490('0x2'));var util=require('util');var config=require(_0x9490('0x3'));var db=require(_0x9490('0x4'))['db'];var logger=require('../logger')(_0x9490('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0x9490('0x6'),'port':0x18eb});var io=require(_0x9490('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x41ee67=0x0;var _0x22400b=[];return db[_0x9490('0x8')]['find']({'raw':!![],'attributes':['id',_0x9490('0x9')],'where':{'id':0x1}})[_0x9490('0xa')](function(_0x182c32){_0x41ee67=_0x182c32[_0x9490('0x9')];if(_0x41ee67){return db['ChatInteraction'][_0x9490('0xb')]({'raw':!![],'attributes':['id',_0x9490('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x9490('0xd')](_0x182c32[_0x9490('0x9')],_0x9490('0xe'))}}});}else{return[];}})[_0x9490('0xa')](function(_0x2ced45){if(_0x2ced45&&_0x2ced45[_0x9490('0xf')]){_0x22400b=_['map'](_0x2ced45||[],'id');logger[_0x9490('0x10')](_0x9490('0x11'),_0x22400b[_0x9490('0x12')]());return db['ChatInteraction'][_0x9490('0x13')]({'closeReason':_0x9490('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x9490('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x22400b}});}})[_0x9490('0xa')](function(){if(_0x22400b&&_0x22400b[_0x9490('0xf')]){logger['info'](_0x9490('0x16'),_0x22400b[_0x9490('0x12')]());for(var _0x5e92c6=0x0;_0x5e92c6<_0x22400b[_0x9490('0xf')];_0x5e92c6++){io['emit'](_0x9490('0x17'),{'id':_0x22400b[_0x5e92c6],'closed':!![]});}}})[_0x9490('0x18')](function(_0xc8cb0b){logger[_0x9490('0x19')](_0x9490('0x1a'),_0xc8cb0b?util[_0x9490('0x1b')](_0xc8cb0b,{'showHidden':![],'depth':null}):'');});}exports[_0x9490('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index b780677..221e23e 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c56=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x474476,_0x53ec8c){var _0x4abd6c=function(_0x1df20f){while(--_0x1df20f){_0x474476['push'](_0x474476['shift']());}};_0x4abd6c(++_0x53ec8c);}(_0x3c56,0xea));var _0x63c5=function(_0x41f747,_0x4ebc43){_0x41f747=_0x41f747-0x0;var _0x5dcf17=_0x3c56[_0x41f747];return _0x5dcf17;};'use strict';function start(){var _0x4991b6=require(_0x63c5('0x0'));return _0x4991b6['startAllRefreshIntervals']();}module[_0x63c5('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x6f92=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x3202c7,_0x498049){var _0x312e0c=function(_0x5a8b48){while(--_0x5a8b48){_0x3202c7['push'](_0x3202c7['shift']());}};_0x312e0c(++_0x498049);}(_0x6f92,0x99));var _0x26f9=function(_0x57e50b,_0x5f0fb8){_0x57e50b=_0x57e50b-0x0;var _0x314279=_0x6f92[_0x57e50b];return _0x314279;};'use strict';function start(){var _0x450c99=require(_0x26f9('0x0'));return _0x450c99[_0x26f9('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index a2b3e33..319ef9e 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 _0x0d93=['../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','user','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','zip','status','Sent','message','text','stringify','existsSync','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','then','CustomReportId','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','start','deleteJob','update','update\x20cron','stop\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller'];(function(_0x578131,_0x15425f){var _0x3f1b45=function(_0x53b32e){while(--_0x53b32e){_0x578131['push'](_0x578131['shift']());}};_0x3f1b45(++_0x15425f);}(_0x0d93,0xa4));var _0x30d9=function(_0x571c1d,_0x3b0586){_0x571c1d=_0x571c1d-0x0;var _0x33c609=_0x0d93[_0x571c1d];return _0x33c609;};'use strict';var fs=require('fs');var util=require(_0x30d9('0x0'));var path=require(_0x30d9('0x1'));var _=require(_0x30d9('0x2'));var moment=require(_0x30d9('0x3'));var CronJobManager=require(_0x30d9('0x4'));var jayson=require(_0x30d9('0x5'));var BPromise=require(_0x30d9('0x6'));var logger=require(_0x30d9('0x7'))(_0x30d9('0x8'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x30d9('0x9'));var analyticDefaultReportController=require(_0x30d9('0xa'));var client=jayson[_0x30d9('0xb')][_0x30d9('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x47a88d,_0x1edd0a){return function(){logger[_0x30d9('0xd')](_0x30d9('0xe'),_0x47a88d[_0x30d9('0xf')]);var _0x38db2f=!![];var _0xce3749=_0x47a88d[_0x30d9('0x10')][_0x30d9('0x11')]();var _0x29b6a3={'account':_0xce3749,'message':{'from':util[_0x30d9('0x12')](_0x30d9('0x13'),_0x47a88d[_0x30d9('0x10')][_0x30d9('0x14')],_0x47a88d[_0x30d9('0x10')][_0x30d9('0xf')]||_0x47a88d[_0x30d9('0x10')][_0x30d9('0x15')][_0x30d9('0x16')]),'to':_0x47a88d[_0x30d9('0xf')],'cc':_0x47a88d['cc'],'bcc':_0x47a88d['bcc'],'subject':util['format'](_0x30d9('0x17'),_0x1edd0a['name'],_0x47a88d['subtractNumber'],_0x47a88d[_0x30d9('0x18')])}};var _0x43dc35=path[_0x30d9('0x19')](__dirname,_0x30d9('0x1a'));var _0x19f47a=_0x1edd0a[_0x30d9('0x1b')];var _0x5d1b43=util['format'](_0x30d9('0x1c'),path['basename'](_0x1edd0a['savename'],path['extname'](_0x1edd0a[_0x30d9('0x1b')])),_0x30d9('0x1d'));var _0x5d4f41=path['join'](_0x43dc35,_0x19f47a);var _0x53cc07=path[_0x30d9('0x19')](_0x43dc35,_0x5d1b43);if(fs['existsSync'](_0x5d4f41)){_0x1edd0a[_0x30d9('0x1e')]=_0x30d9('0x1f');_0x29b6a3[_0x30d9('0x20')]['attachments']=[{'filename':_0x19f47a,'path':_0x5d4f41}];_0x29b6a3[_0x30d9('0x20')][_0x30d9('0x21')]=util[_0x30d9('0x12')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x30d9('0x22')](_0x1edd0a,null,0x2));}else if(fs[_0x30d9('0x23')](_0x53cc07)){_0x1edd0a[_0x30d9('0x1e')]=_0x30d9('0x1f');_0x29b6a3[_0x30d9('0x20')][_0x30d9('0x24')]=[{'filename':_0x5d1b43,'path':_0x53cc07}];}else{_0x29b6a3[_0x30d9('0x20')][_0x30d9('0x21')]=_0x30d9('0x25');if(!_0x47a88d[_0x30d9('0x26')]){_0x38db2f=![];logger[_0x30d9('0xd')](_0x30d9('0x27'));}}if(_0x38db2f){return client[_0x30d9('0x28')]('SendMail',_0x29b6a3)['then'](function(_0x2a68a0){if(_0x2a68a0[_0x30d9('0x29')]){return logger[_0x30d9('0x29')](_0x30d9('0x2a'),JSON[_0x30d9('0x22')](_0x2a68a0));}return logger[_0x30d9('0xd')](_0x30d9('0x2b'));})[_0x30d9('0x2c')](function(_0x3b82cf){return logger[_0x30d9('0x29')](_0x30d9('0x2a'),JSON[_0x30d9('0x22')](_0x3b82cf));});}};}function handleError(){return function(_0x2bd9b8){return logger['error'](JSON[_0x30d9('0x22')](_0x2bd9b8));};}function handleResult(_0x14075e){return function(_0xdf8b67){logger[_0x30d9('0xd')]('data',JSON['stringify'](_0xdf8b67));if(_0x14075e[_0x30d9('0x10')]&&_0x14075e[_0x30d9('0x10')][_0x30d9('0x15')]&&!_[_0x30d9('0x2d')](_0x14075e['email'])){setTimeout(handleSendEmail(_0x14075e,_0xdf8b67),0x3c*0x3e8);}};}function handleJob(_0x4e93c9){return function(){try{if(_['isNil'](_0x4e93c9[_0x30d9('0x2e')])){return logger[_0x30d9('0xd')](_0x30d9('0x2f'));}if(_[_0x30d9('0x2d')](_0x4e93c9[_0x30d9('0x18')])){return logger[_0x30d9('0xd')]('subtractUnit\x20null\x20or\x20undefined');}var _0x447808={'startDate':moment()[_0x30d9('0x30')](_0x4e93c9[_0x30d9('0x2e')],_0x4e93c9[_0x30d9('0x18')])[_0x30d9('0x12')](_0x30d9('0x31')),'endDate':moment()[_0x30d9('0x12')](_0x30d9('0x31')),'type':_0x30d9('0x32'),'output':_0x4e93c9[_0x30d9('0x33')],'name':_0x4e93c9[_0x30d9('0x14')]};if(!_[_0x30d9('0x2d')](_0x4e93c9[_0x30d9('0x34')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x4e93c9[_0x30d9('0x34')]);return analyticDefaultReportController['runReport']({'id':_0x4e93c9[_0x30d9('0x34')]},_0x447808)[_0x30d9('0x35')](handleResult(_0x4e93c9))['catch'](handleError());}if(!_['isNil'](_0x4e93c9[_0x30d9('0x36')])){logger[_0x30d9('0xd')]('exec\x20custom\x20report\x20id:%s',_0x4e93c9['CustomReportId']);return analyticCustomReportController[_0x30d9('0x37')]({'id':_0x4e93c9[_0x30d9('0x36')]},_0x447808)[_0x30d9('0x35')](handleResult(_0x4e93c9))[_0x30d9('0x2c')](handleError());}}catch(_0x365b63){logger[_0x30d9('0x29')](JSON[_0x30d9('0x22')](_0x365b63));}return logger[_0x30d9('0xd')](_0x30d9('0x38'));};}function getJobs(_0x3e9366){var _0x2cd6da={};if(_0x3e9366){_0x2cd6da['id']=_0x3e9366;}return db[_0x30d9('0x39')][_0x30d9('0x3a')]({'where':_0x2cd6da,'include':[{'model':db[_0x30d9('0x10')],'attributes':['id','name',_0x30d9('0xf')],'include':[{'model':db[_0x30d9('0x3b')],'as':_0x30d9('0x15'),'include':[{'model':db['CloudProvider'],'as':_0x30d9('0x3c')}]}]}]})[_0x30d9('0x35')](function(_0x4f77dd){var _0x5a3e01=_[_0x30d9('0x3d')](manager[_0x30d9('0x3e')]);var _0x21fca6=_[_0x30d9('0x3f')](_0x4f77dd,function(_0x9a7136){return _0x9a7136['id'][_0x30d9('0x40')]();});var _0x535145=_[_0x30d9('0x41')](_0x4f77dd,function(_0x1163cc){return _0x1163cc['id'][_0x30d9('0x40')]();});var _0x4118bc=_0x3e9366?_0x21fca6:_[_0x30d9('0x42')](_0x21fca6,_0x5a3e01);var _0x57334a=_[_0x30d9('0x43')](_0x21fca6,_0x5a3e01);var _0x1b7b20=_[_0x30d9('0x42')](_0x5a3e01,_0x21fca6);var _0x5edc69;var _0x3d19a7;for(_0x5edc69=0x0;_0x5edc69<_0x1b7b20[_0x30d9('0x44')]&&!_0x3e9366;_0x5edc69+=0x1){_0x3d19a7=_0x1b7b20[_0x5edc69][_0x30d9('0x40')]();if(manager[_0x30d9('0x45')](_0x3d19a7)){manager[_0x30d9('0x46')](_0x3d19a7);manager['deleteJob'](_0x3d19a7);logger[_0x30d9('0xd')](_0x30d9('0x47'),_0x3d19a7);}}logger[_0x30d9('0xd')](_0x30d9('0x48'),JSON[_0x30d9('0x22')](_0x4118bc));for(_0x5edc69=0x0;_0x5edc69<_0x4118bc[_0x30d9('0x44')];_0x5edc69+=0x1){_0x3d19a7=_0x4118bc[_0x5edc69][_0x30d9('0x40')]();logger[_0x30d9('0xd')](_0x30d9('0x49'),_0x3d19a7);if(_0x3e9366){logger[_0x30d9('0xd')](_0x30d9('0x4a'),_0x3e9366);logger[_0x30d9('0xd')](JSON[_0x30d9('0x22')](_0x535145[_0x3d19a7]));BPromise[_0x30d9('0x4b')]()[_0x30d9('0x35')](handleJob(_0x535145[_0x3d19a7]));logger[_0x30d9('0xd')](_0x30d9('0x4c'),_0x535145[_0x3d19a7][_0x30d9('0x14')],_0x535145[_0x3d19a7][_0x30d9('0x4d')]);}else if(_0x535145[_0x3d19a7][_0x30d9('0x4d')]&&_0x535145[_0x3d19a7]['active']&&moment()[_0x30d9('0x4e')](_0x535145[_0x3d19a7][_0x30d9('0x4f')],_0x535145[_0x3d19a7][_0x30d9('0x50')])){manager['add'](_0x3d19a7,_0x535145[_0x3d19a7][_0x30d9('0x4d')],handleJob(_0x535145[_0x3d19a7]));manager[_0x30d9('0x51')](_0x3d19a7);logger[_0x30d9('0xd')]('add\x20cron',_0x535145[_0x3d19a7][_0x30d9('0x14')],_0x535145[_0x3d19a7]['cron']);}else if(manager['exists'](_0x3d19a7)){manager[_0x30d9('0x46')](_0x3d19a7);manager[_0x30d9('0x52')](_0x3d19a7);logger['info']('stop\x20cron',_0x535145[_0x3d19a7][_0x30d9('0x14')],_0x535145[_0x3d19a7]['cron']);}}for(_0x5edc69=0x0,_0x3d19a7;_0x5edc69<_0x57334a[_0x30d9('0x44')]&&!_0x3e9366;_0x5edc69+=0x1){_0x3d19a7=_0x57334a[_0x5edc69]['toString']();if(manager['exists'](_0x3d19a7)){if(_0x535145[_0x3d19a7][_0x30d9('0x4d')]&&_0x535145[_0x3d19a7]['active']&&moment()[_0x30d9('0x4e')](_0x535145[_0x3d19a7]['startAt'],_0x535145[_0x3d19a7]['endAt'])){manager[_0x30d9('0x53')](_0x3d19a7,_0x535145[_0x3d19a7][_0x30d9('0x4d')],handleJob(_0x535145[_0x3d19a7]));logger[_0x30d9('0xd')](_0x30d9('0x54'),_0x535145[_0x3d19a7][_0x30d9('0x14')],_0x535145[_0x3d19a7][_0x30d9('0x4d')]);}else{manager[_0x30d9('0x46')](_0x3d19a7);manager[_0x30d9('0x52')](_0x3d19a7);logger['info'](_0x30d9('0x55'),_0x535145[_0x3d19a7]['name'],_0x535145[_0x3d19a7][_0x30d9('0x4d')]);}}}})[_0x30d9('0x2c')](function(_0x59814d){logger['error'](JSON[_0x30d9('0x22')](_0x59814d));});}exports[_0x30d9('0x56')]=function(_0x233e21){return getJobs(_0x233e21);};exports[_0x30d9('0x51')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xa701=['findAll','MailServerOut','Smtp','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','deleteJob','delete\x20cron','length','index','my\x20id','resolve','run\x20job','cron','startAt','add','exists','stop','stop\x20cron','isBetween','endAt','update','update\x20cron','run','util','lodash','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','user','bcc','subtractNumber','subtractUnit','join','../../files/reports','basename','extname','savename','message','attachments','text','stringify','existsSync','status','Sent','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','then','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xa701,0x72));var _0x1a70=function(_0x26e97d,_0x18ea53){_0x26e97d=_0x26e97d-0x0;var _0x3b5db1=_0xa701[_0x26e97d];return _0x3b5db1;};'use strict';var fs=require('fs');var util=require(_0x1a70('0x0'));var path=require('path');var _=require(_0x1a70('0x1'));var moment=require('moment');var CronJobManager=require(_0x1a70('0x2'));var jayson=require(_0x1a70('0x3'));var BPromise=require(_0x1a70('0x4'));var logger=require(_0x1a70('0x5'))(_0x1a70('0x6'));var db=require(_0x1a70('0x7'))['db'];var analyticCustomReportController=require(_0x1a70('0x8'));var analyticDefaultReportController=require(_0x1a70('0x9'));var client=jayson[_0x1a70('0xa')][_0x1a70('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4671f2,_0x36c4ae){return function(){logger[_0x1a70('0xc')](_0x1a70('0xd'),_0x4671f2[_0x1a70('0xe')]);var _0x204cc6=!![];var _0x2de824=_0x4671f2[_0x1a70('0xf')][_0x1a70('0x10')]();var _0x1f9caa={'account':_0x2de824,'message':{'from':util[_0x1a70('0x11')](_0x1a70('0x12'),_0x4671f2['MailAccount'][_0x1a70('0x13')],_0x4671f2[_0x1a70('0xf')][_0x1a70('0xe')]||_0x4671f2[_0x1a70('0xf')]['Smtp'][_0x1a70('0x14')]),'to':_0x4671f2[_0x1a70('0xe')],'cc':_0x4671f2['cc'],'bcc':_0x4671f2[_0x1a70('0x15')],'subject':util[_0x1a70('0x11')]('Report\x20%s\x20last\x20%s\x20%s',_0x36c4ae[_0x1a70('0x13')],_0x4671f2[_0x1a70('0x16')],_0x4671f2[_0x1a70('0x17')])}};var _0x281a25=path[_0x1a70('0x18')](__dirname,_0x1a70('0x19'));var _0x90abd3=_0x36c4ae['savename'];var _0x299b5f=util[_0x1a70('0x11')]('%s.%s',path[_0x1a70('0x1a')](_0x36c4ae['savename'],path[_0x1a70('0x1b')](_0x36c4ae[_0x1a70('0x1c')])),'zip');var _0xb6189a=path[_0x1a70('0x18')](_0x281a25,_0x90abd3);var _0x1e4b44=path[_0x1a70('0x18')](_0x281a25,_0x299b5f);if(fs['existsSync'](_0xb6189a)){_0x36c4ae['status']='Sent';_0x1f9caa[_0x1a70('0x1d')][_0x1a70('0x1e')]=[{'filename':_0x90abd3,'path':_0xb6189a}];_0x1f9caa['message'][_0x1a70('0x1f')]=util['format']('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x1a70('0x20')](_0x36c4ae,null,0x2));}else if(fs[_0x1a70('0x21')](_0x1e4b44)){_0x36c4ae[_0x1a70('0x22')]=_0x1a70('0x23');_0x1f9caa[_0x1a70('0x1d')][_0x1a70('0x1e')]=[{'filename':_0x299b5f,'path':_0x1e4b44}];}else{_0x1f9caa['message'][_0x1a70('0x1f')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x4671f2[_0x1a70('0x24')]){_0x204cc6=![];logger[_0x1a70('0xc')](_0x1a70('0x25'));}}if(_0x204cc6){return client['request']('SendMail',_0x1f9caa)[_0x1a70('0x26')](function(_0x515e5f){if(_0x515e5f[_0x1a70('0x27')]){return logger['error'](_0x1a70('0x28'),JSON['stringify'](_0x515e5f));}return logger[_0x1a70('0xc')]('email\x20sent');})[_0x1a70('0x29')](function(_0x41c81d){return logger['error'](_0x1a70('0x28'),JSON[_0x1a70('0x20')](_0x41c81d));});}};}function handleError(){return function(_0x104a4b){return logger['error'](JSON['stringify'](_0x104a4b));};}function handleResult(_0x5f5dab){return function(_0x3afd9e){logger[_0x1a70('0xc')](_0x1a70('0x2a'),JSON[_0x1a70('0x20')](_0x3afd9e));if(_0x5f5dab[_0x1a70('0xf')]&&_0x5f5dab[_0x1a70('0xf')]['Smtp']&&!_['isNil'](_0x5f5dab['email'])){setTimeout(handleSendEmail(_0x5f5dab,_0x3afd9e),0x3c*0x3e8);}};}function handleJob(_0x5c1366){return function(){try{if(_[_0x1a70('0x2b')](_0x5c1366[_0x1a70('0x16')])){return logger[_0x1a70('0xc')](_0x1a70('0x2c'));}if(_[_0x1a70('0x2b')](_0x5c1366[_0x1a70('0x17')])){return logger[_0x1a70('0xc')](_0x1a70('0x2d'));}var _0xdb6874={'startDate':moment()[_0x1a70('0x2e')](_0x5c1366[_0x1a70('0x16')],_0x5c1366[_0x1a70('0x17')])[_0x1a70('0x11')](_0x1a70('0x2f')),'endDate':moment()[_0x1a70('0x11')](_0x1a70('0x2f')),'type':'scheduled','output':_0x5c1366[_0x1a70('0x30')],'name':_0x5c1366['name']};if(!_[_0x1a70('0x2b')](_0x5c1366[_0x1a70('0x31')])){logger[_0x1a70('0xc')](_0x1a70('0x32'),_0x5c1366[_0x1a70('0x31')]);return analyticDefaultReportController[_0x1a70('0x33')]({'id':_0x5c1366['DefaultReportId']},_0xdb6874)[_0x1a70('0x26')](handleResult(_0x5c1366))[_0x1a70('0x29')](handleError());}if(!_[_0x1a70('0x2b')](_0x5c1366[_0x1a70('0x34')])){logger[_0x1a70('0xc')](_0x1a70('0x35'),_0x5c1366[_0x1a70('0x34')]);return analyticCustomReportController['runReport']({'id':_0x5c1366['CustomReportId']},_0xdb6874)[_0x1a70('0x26')](handleResult(_0x5c1366))[_0x1a70('0x29')](handleError());}}catch(_0x3320a3){logger[_0x1a70('0x27')](JSON[_0x1a70('0x20')](_0x3320a3));}return logger[_0x1a70('0xc')](_0x1a70('0x36'));};}function getJobs(_0x19391c){var _0x302977={};if(_0x19391c){_0x302977['id']=_0x19391c;}return db[_0x1a70('0x37')][_0x1a70('0x38')]({'where':_0x302977,'include':[{'model':db[_0x1a70('0xf')],'attributes':['id',_0x1a70('0x13'),'email'],'include':[{'model':db[_0x1a70('0x39')],'as':_0x1a70('0x3a'),'include':[{'model':db[_0x1a70('0x3b')],'as':_0x1a70('0x3b')}]}]}]})[_0x1a70('0x26')](function(_0x4e8b85){var _0xb3440a=_[_0x1a70('0x3c')](manager[_0x1a70('0x3d')]);var _0x2c9eb8=_[_0x1a70('0x3e')](_0x4e8b85,function(_0x377150){return _0x377150['id'][_0x1a70('0x3f')]();});var _0x470c9f=_[_0x1a70('0x40')](_0x4e8b85,function(_0x5bff00){return _0x5bff00['id'][_0x1a70('0x3f')]();});var _0x289526=_0x19391c?_0x2c9eb8:_[_0x1a70('0x41')](_0x2c9eb8,_0xb3440a);var _0x50866c=_[_0x1a70('0x42')](_0x2c9eb8,_0xb3440a);var _0x38c319=_[_0x1a70('0x41')](_0xb3440a,_0x2c9eb8);var _0x8095c3;var _0x2dbe8c;for(_0x8095c3=0x0;_0x8095c3<_0x38c319['length']&&!_0x19391c;_0x8095c3+=0x1){_0x2dbe8c=_0x38c319[_0x8095c3][_0x1a70('0x3f')]();if(manager['exists'](_0x2dbe8c)){manager['stop'](_0x2dbe8c);manager[_0x1a70('0x43')](_0x2dbe8c);logger[_0x1a70('0xc')](_0x1a70('0x44'),_0x2dbe8c);}}logger[_0x1a70('0xc')]('toRun',JSON[_0x1a70('0x20')](_0x289526));for(_0x8095c3=0x0;_0x8095c3<_0x289526[_0x1a70('0x45')];_0x8095c3+=0x1){_0x2dbe8c=_0x289526[_0x8095c3][_0x1a70('0x3f')]();logger['info'](_0x1a70('0x46'),_0x2dbe8c);if(_0x19391c){logger[_0x1a70('0xc')](_0x1a70('0x47'),_0x19391c);logger[_0x1a70('0xc')](JSON[_0x1a70('0x20')](_0x470c9f[_0x2dbe8c]));BPromise[_0x1a70('0x48')]()['then'](handleJob(_0x470c9f[_0x2dbe8c]));logger['info'](_0x1a70('0x49'),_0x470c9f[_0x2dbe8c][_0x1a70('0x13')],_0x470c9f[_0x2dbe8c][_0x1a70('0x4a')]);}else if(_0x470c9f[_0x2dbe8c]['cron']&&_0x470c9f[_0x2dbe8c]['active']&&moment()['isBetween'](_0x470c9f[_0x2dbe8c][_0x1a70('0x4b')],_0x470c9f[_0x2dbe8c]['endAt'])){manager[_0x1a70('0x4c')](_0x2dbe8c,_0x470c9f[_0x2dbe8c][_0x1a70('0x4a')],handleJob(_0x470c9f[_0x2dbe8c]));manager['start'](_0x2dbe8c);logger['info']('add\x20cron',_0x470c9f[_0x2dbe8c][_0x1a70('0x13')],_0x470c9f[_0x2dbe8c][_0x1a70('0x4a')]);}else if(manager[_0x1a70('0x4d')](_0x2dbe8c)){manager[_0x1a70('0x4e')](_0x2dbe8c);manager[_0x1a70('0x43')](_0x2dbe8c);logger[_0x1a70('0xc')](_0x1a70('0x4f'),_0x470c9f[_0x2dbe8c]['name'],_0x470c9f[_0x2dbe8c][_0x1a70('0x4a')]);}}for(_0x8095c3=0x0,_0x2dbe8c;_0x8095c3<_0x50866c[_0x1a70('0x45')]&&!_0x19391c;_0x8095c3+=0x1){_0x2dbe8c=_0x50866c[_0x8095c3][_0x1a70('0x3f')]();if(manager[_0x1a70('0x4d')](_0x2dbe8c)){if(_0x470c9f[_0x2dbe8c][_0x1a70('0x4a')]&&_0x470c9f[_0x2dbe8c]['active']&&moment()[_0x1a70('0x50')](_0x470c9f[_0x2dbe8c][_0x1a70('0x4b')],_0x470c9f[_0x2dbe8c][_0x1a70('0x51')])){manager[_0x1a70('0x52')](_0x2dbe8c,_0x470c9f[_0x2dbe8c][_0x1a70('0x4a')],handleJob(_0x470c9f[_0x2dbe8c]));logger['info'](_0x1a70('0x53'),_0x470c9f[_0x2dbe8c][_0x1a70('0x13')],_0x470c9f[_0x2dbe8c][_0x1a70('0x4a')]);}else{manager[_0x1a70('0x4e')](_0x2dbe8c);manager[_0x1a70('0x43')](_0x2dbe8c);logger[_0x1a70('0xc')](_0x1a70('0x4f'),_0x470c9f[_0x2dbe8c][_0x1a70('0x13')],_0x470c9f[_0x2dbe8c]['cron']);}}}})[_0x1a70('0x29')](function(_0x2a257f){logger[_0x1a70('0x27')](JSON[_0x1a70('0x20')](_0x2a257f));});}exports[_0x1a70('0x54')]=function(_0x3902a2){return getJobs(_0x3902a2);};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 b836ec9..c5e744b 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 _0x85de=['aws-sdk','request-promise','util','bluebird','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','substring','info','format','transcribeName','data1','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data2','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','SentimentScore','Negative','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','sentiment','Sentiment','Positive','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','Setting','Settings\x20not\x20available','transcribe','transcribeAccountId','forEach','push','all','error','start','lodash'];(function(_0x2df0bf,_0x13990c){var _0x5c46a3=function(_0x5716ea){while(--_0x5716ea){_0x2df0bf['push'](_0x2df0bf['shift']());}};_0x5c46a3(++_0x13990c);}(_0x85de,0x1f0));var _0xe85d=function(_0x3de62d,_0x53b2f){_0x3de62d=_0x3de62d-0x0;var _0x10b7e9=_0x85de[_0x3de62d];return _0x10b7e9;};var _=require(_0xe85d('0x0'));var AWS=require(_0xe85d('0x1'));var rp=require(_0xe85d('0x2'));var util=require(_0xe85d('0x3'));var BPromise=require(_0xe85d('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0xe85d('0x5'))('transcribe');function getTranscriptionJob(_0x4d2fcf,_0x46f08a,_0x2a28a9,_0x514fc9){return new Promise(function(_0x1e9dea,_0xb70e1d){var _0x220e10=new AWS[(_0xe85d('0x6'))]({'accessKeyId':_0x46f08a,'secretAccessKey':_0x4d2fcf,'region':_0x2a28a9});_0x220e10[_0xe85d('0x7')]({'TranscriptionJobName':_0x514fc9},function(_0x888738,_0xc86467){if(_0x888738){return _0xb70e1d(_0x888738);}else{return _0x1e9dea(_0xc86467);}});});}function sentiment(_0x1cd2db,_0x4b6cfb,_0x4128d5,_0x1e4093,_0x4562be){return new Promise(function(_0x6a51f6,_0x1a769e){var _0x574d34=new AWS[(_0xe85d('0x8'))]({'accessKeyId':_0x4b6cfb,'secretAccessKey':_0x1cd2db,'region':_0x4128d5});_0x574d34['detectSentiment']({'Text':_0x1e4093,'LanguageCode':_0x4562be[_0xe85d('0x9')](0x0,0x2)},function(_0x47fb6d,_0x399e91){if(_0x47fb6d){return _0x1a769e(_0x47fb6d);}else{return _0x6a51f6(_0x399e91);}});});}function checkTranscribeJob(_0x548209,_0x3ec59a,_0x1fc972){var _0x10dd73;return new BPromise(function(_0x3544e9,_0x324972){logger[_0xe85d('0xa')](util[_0xe85d('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x548209['id'],_0x548209[_0xe85d('0xc')]));return getTranscriptionJob(_0x1fc972[_0xe85d('0xd')],_0x1fc972['data2'],_0x3ec59a[_0xe85d('0xe')],_0x548209[_0xe85d('0xc')])[_0xe85d('0xf')](function(_0x1e56c5){logger[_0xe85d('0xa')](util[_0xe85d('0xb')](_0xe85d('0x10'),_0x548209['id'],_0x548209[_0xe85d('0xc')],_0x1e56c5[_0xe85d('0x11')]['TranscriptionJobStatus']));if(!_0x548209[_0xe85d('0x12')]){switch(_0x1e56c5['TranscriptionJob'][_0xe85d('0x13')]){case'COMPLETED':var _0x511b92={'transcribeStatus':_0x1e56c5['TranscriptionJob'][_0xe85d('0x13')],'fileUri':_0x1e56c5[_0xe85d('0x11')][_0xe85d('0x14')]['TranscriptFileUri']};logger[_0xe85d('0xa')](util[_0xe85d('0xb')](_0xe85d('0x15'),_0x548209['id']));return rp({'uri':_0x1e56c5[_0xe85d('0x11')][_0xe85d('0x14')][_0xe85d('0x16')],'json':!![]})[_0xe85d('0xf')](function(_0x2f77d8){logger['info'](util[_0xe85d('0xb')](_0xe85d('0x17'),_0x548209['id']));if(_0x2f77d8&&_0x2f77d8[_0xe85d('0x18')]&&_0x2f77d8[_0xe85d('0x18')][_0xe85d('0x19')]&&_0x2f77d8['results'][_0xe85d('0x19')][_0xe85d('0x1a')]){_0x511b92['fileText']='';for(var _0x44a48c=0x0;_0x44a48c<_0x2f77d8[_0xe85d('0x18')][_0xe85d('0x19')][_0xe85d('0x1a')];_0x44a48c++){_0x511b92[_0xe85d('0x12')]+=_0x2f77d8[_0xe85d('0x18')][_0xe85d('0x19')][_0x44a48c][_0xe85d('0x1b')]+'';}}return _0x548209['update'](_0x511b92);})[_0xe85d('0xf')](function(){logger[_0xe85d('0xa')](util[_0xe85d('0xb')](_0xe85d('0x1c'),_0x548209['id']));if(!_0x548209[_0xe85d('0x1d')]){throw new db[(_0xe85d('0x1e'))][(_0xe85d('0x1f'))](_0xe85d('0x20'));}if(!_0x3ec59a['sentiment']||!_0x3ec59a[_0xe85d('0x21')]||!_0x3ec59a[_0xe85d('0x22')]||!_0x3ec59a[_0xe85d('0x23')]||!_0x3ec59a[_0xe85d('0x24')]){throw new db['Sequelize'][(_0xe85d('0x1f'))](_0xe85d('0x25'));}if(!_0x511b92[_0xe85d('0x12')]){throw new Error(_0xe85d('0x26'));}if(_0x3ec59a[_0xe85d('0x21')]===_0x1fc972['id']){return _0x1fc972;}else{return db[_0xe85d('0x27')][_0xe85d('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x3d2ffb){if(!_0x3d2ffb){throw new db[(_0xe85d('0x1e'))][(_0xe85d('0x1f'))](_0xe85d('0x29'));}if(!_0x3d2ffb[_0xe85d('0xd')]||!_0x3d2ffb['data2']){throw new db[(_0xe85d('0x1e'))][(_0xe85d('0x1f'))](_0xe85d('0x2a'));}_0x10dd73=_0x3d2ffb;logger[_0xe85d('0xa')](util['format'](_0xe85d('0x2b'),_0x548209['id']));return sentiment(_0x10dd73[_0xe85d('0xd')],_0x10dd73[_0xe85d('0x2c')],_0x3ec59a['sentimentRegion'],_0x511b92[_0xe85d('0x12')],_0x3ec59a['language']);})[_0xe85d('0xf')](function(_0x268b19){logger[_0xe85d('0xa')](util[_0xe85d('0xb')](_0xe85d('0x2d'),_0x548209['id']));return _0x548209[_0xe85d('0x2e')]({'sentiment':_0x268b19['Sentiment'],'sPositive':_0x268b19[_0xe85d('0x2f')]['Positive'],'sNegative':_0x268b19[_0xe85d('0x2f')][_0xe85d('0x30')],'sMixed':_0x268b19[_0xe85d('0x2f')]['Mixed'],'sNeutral':_0x268b19[_0xe85d('0x2f')][_0xe85d('0x31')]});})['then'](function(){logger[_0xe85d('0xa')](util[_0xe85d('0xb')](_0xe85d('0x1c'),_0x548209['id']));_0x3544e9();});case _0xe85d('0x32'):return _0x548209[_0xe85d('0x2e')]({'transcribeStatus':_0xe85d('0x32'),'failureReason':_0x1e56c5['TranscriptionJob']['FailureReason']})[_0xe85d('0xf')](function(){logger[_0xe85d('0xa')](util[_0xe85d('0xb')](_0xe85d('0x1c'),_0x548209['id']));_0x3544e9();});default:logger[_0xe85d('0xa')](util['format'](_0xe85d('0x33'),_0x548209['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x548209['tempSentiment']){throw new db[(_0xe85d('0x1e'))][(_0xe85d('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x3ec59a[_0xe85d('0x34')]||!_0x3ec59a[_0xe85d('0x21')]||!_0x3ec59a[_0xe85d('0x22')]||!_0x3ec59a[_0xe85d('0x23')]||!_0x3ec59a[_0xe85d('0x24')]){throw new db[(_0xe85d('0x1e'))][(_0xe85d('0x1f'))](_0xe85d('0x25'));}if(!_0x548209[_0xe85d('0x12')]){throw new Error(_0xe85d('0x26'));}if(_0x3ec59a['sentimentAccountId']===_0x1fc972['id']){return _0x1fc972;}else{return db[_0xe85d('0x27')][_0xe85d('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xe85d('0xf')](function(_0x2086f8){if(!_0x2086f8){throw new db[(_0xe85d('0x1e'))]['ValidationError'](_0xe85d('0x29'));}if(!_0x2086f8['data1']||!_0x2086f8[_0xe85d('0x2c')]){throw new db[(_0xe85d('0x1e'))][(_0xe85d('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x10dd73=_0x2086f8;logger[_0xe85d('0xa')](util[_0xe85d('0xb')](_0xe85d('0x2b'),_0x548209['id']));return sentiment(_0x10dd73['data1'],_0x10dd73[_0xe85d('0x2c')],_0x3ec59a[_0xe85d('0x22')],_0x548209[_0xe85d('0x12')],_0x3ec59a[_0xe85d('0x23')]);})['then'](function(_0x26400b){logger[_0xe85d('0xa')](util['format'](_0xe85d('0x2d'),_0x548209['id']));return _0x548209['update']({'sentiment':_0x26400b[_0xe85d('0x35')],'sPositive':_0x26400b[_0xe85d('0x2f')][_0xe85d('0x36')],'sNegative':_0x26400b[_0xe85d('0x2f')][_0xe85d('0x30')],'sMixed':_0x26400b[_0xe85d('0x2f')]['Mixed'],'sNeutral':_0x26400b[_0xe85d('0x2f')][_0xe85d('0x31')],'transcribeStatus':'COMPLETED'});})[_0xe85d('0xf')](function(){logger['info'](util[_0xe85d('0xb')](_0xe85d('0x1c'),_0x548209['id']));_0x3544e9();});}})[_0xe85d('0x37')](function(_0x2b20a3){if(_0x2b20a3){if(!_0x2b20a3['name']||_0x2b20a3[_0xe85d('0x38')]!==_0xe85d('0x39')){logger['error'](util[_0xe85d('0xb')](_0xe85d('0x3a'),_0x548209['id']),util[_0xe85d('0x3b')](_0x2b20a3,{'showHidden':![],'depth':null}));}}_0x3544e9();});});}function checkTranscribe(){var _0x5a0489;var _0x2637ce;var _0x5e9641;return db[_0xe85d('0x3c')][_0xe85d('0x3d')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xe85d('0xf')](function(_0x3c9d14){if(!_0x3c9d14||!_0x3c9d14['length']){throw new db[(_0xe85d('0x1e'))][(_0xe85d('0x1f'))]('No\x20transcribe\x20job\x20to\x20check');}_0x5a0489=_0x3c9d14;return db[_0xe85d('0x3e')][_0xe85d('0x28')]({'where':{'id':0x1}});})['then'](function(_0x340790){if(!_0x340790){throw new db[(_0xe85d('0x1e'))]['ValidationError'](_0xe85d('0x3f'));}_0x2637ce=_0x340790;if(!_0x2637ce[_0xe85d('0x40')]||!_0x2637ce[_0xe85d('0x41')]||!_0x2637ce[_0xe85d('0xe')]||!_0x2637ce['language']||!_0x2637ce[_0xe85d('0x24')]){throw new db['Sequelize'][(_0xe85d('0x1f'))]('Transcribe\x20not\x20configured');}return db[_0xe85d('0x27')][_0xe85d('0x28')]({'where':{'id':_0x2637ce[_0xe85d('0x41')]}});})[_0xe85d('0xf')](function(_0x43ead1){if(!_0x43ead1){throw new db[(_0xe85d('0x1e'))][(_0xe85d('0x1f'))](_0xe85d('0x29'));}if(!_0x43ead1[_0xe85d('0xd')]||!_0x43ead1['data2']){throw new db[(_0xe85d('0x1e'))][(_0xe85d('0x1f'))](_0xe85d('0x2a'));}_0x5e9641=_0x43ead1;var _0x22e667=[];_0x5a0489[_0xe85d('0x42')](function(_0x4336b7){_0x22e667[_0xe85d('0x43')](checkTranscribeJob(_0x4336b7,_0x2637ce,_0x5e9641));});return BPromise[_0xe85d('0x44')](_0x22e667);})['catch'](function(_0xcfc5b){if(_0xcfc5b){if(!_0xcfc5b['name']||_0xcfc5b[_0xe85d('0x38')]!==_0xe85d('0x39')){logger[_0xe85d('0x45')](util['inspect'](_0xcfc5b,{'showHidden':![],'depth':null}));}}});}exports[_0xe85d('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x7b37=['util','bluebird','../../config/logger','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','transcripts','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Positive','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','push','all','start','lodash','aws-sdk'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b37,0xd9));var _0x77b3=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0x7b37[_0x562f3b];return _0x1edd55;};var _=require(_0x77b3('0x0'));var AWS=require(_0x77b3('0x1'));var rp=require('request-promise');var util=require(_0x77b3('0x2'));var BPromise=require(_0x77b3('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x77b3('0x4'))('transcribe');function getTranscriptionJob(_0x2719f2,_0x2c94ea,_0x2d64f7,_0x579ea7){return new Promise(function(_0x3acdea,_0x32345c){var _0x515f06=new AWS['TranscribeService']({'accessKeyId':_0x2c94ea,'secretAccessKey':_0x2719f2,'region':_0x2d64f7});_0x515f06[_0x77b3('0x5')]({'TranscriptionJobName':_0x579ea7},function(_0x5b3fb4,_0x35becb){if(_0x5b3fb4){return _0x32345c(_0x5b3fb4);}else{return _0x3acdea(_0x35becb);}});});}function sentiment(_0x37fafb,_0x4b3a98,_0x46dc45,_0x31b2ac,_0x24f2a1){return new Promise(function(_0x27bfa6,_0x203a71){var _0x29c263=new AWS[(_0x77b3('0x6'))]({'accessKeyId':_0x4b3a98,'secretAccessKey':_0x37fafb,'region':_0x46dc45});_0x29c263[_0x77b3('0x7')]({'Text':_0x31b2ac,'LanguageCode':_0x24f2a1[_0x77b3('0x8')](0x0,0x2)},function(_0x3e100c,_0x58f30a){if(_0x3e100c){return _0x203a71(_0x3e100c);}else{return _0x27bfa6(_0x58f30a);}});});}function checkTranscribeJob(_0x13bc8e,_0x48adca,_0x804b7){var _0x16692f;return new BPromise(function(_0x3ee308,_0x363de1){logger[_0x77b3('0x9')](util[_0x77b3('0xa')](_0x77b3('0xb'),_0x13bc8e['id'],_0x13bc8e[_0x77b3('0xc')]));return getTranscriptionJob(_0x804b7[_0x77b3('0xd')],_0x804b7[_0x77b3('0xe')],_0x48adca['transcribeRegion'],_0x13bc8e[_0x77b3('0xc')])[_0x77b3('0xf')](function(_0x1c995c){logger[_0x77b3('0x9')](util['format'](_0x77b3('0x10'),_0x13bc8e['id'],_0x13bc8e['transcribeName'],_0x1c995c['TranscriptionJob'][_0x77b3('0x11')]));if(!_0x13bc8e[_0x77b3('0x12')]){switch(_0x1c995c[_0x77b3('0x13')][_0x77b3('0x11')]){case'COMPLETED':var _0x26f445={'transcribeStatus':_0x1c995c['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x1c995c[_0x77b3('0x13')][_0x77b3('0x14')][_0x77b3('0x15')]};logger['info'](util[_0x77b3('0xa')](_0x77b3('0x16'),_0x13bc8e['id']));return rp({'uri':_0x1c995c[_0x77b3('0x13')][_0x77b3('0x14')][_0x77b3('0x15')],'json':!![]})[_0x77b3('0xf')](function(_0x174058){logger[_0x77b3('0x9')](util[_0x77b3('0xa')](_0x77b3('0x17'),_0x13bc8e['id']));if(_0x174058&&_0x174058['results']&&_0x174058[_0x77b3('0x18')]['transcripts']&&_0x174058[_0x77b3('0x18')]['transcripts'][_0x77b3('0x19')]){_0x26f445[_0x77b3('0x12')]='';for(var _0x37de70=0x0;_0x37de70<_0x174058[_0x77b3('0x18')][_0x77b3('0x1a')]['length'];_0x37de70++){_0x26f445['fileText']+=_0x174058[_0x77b3('0x18')][_0x77b3('0x1a')][_0x37de70][_0x77b3('0x1b')]+'';}}return _0x13bc8e['update'](_0x26f445);})[_0x77b3('0xf')](function(){logger[_0x77b3('0x9')](util[_0x77b3('0xa')](_0x77b3('0x1c'),_0x13bc8e['id']));if(!_0x13bc8e[_0x77b3('0x1d')]){throw new db[(_0x77b3('0x1e'))]['ValidationError'](_0x77b3('0x1f'));}if(!_0x48adca[_0x77b3('0x20')]||!_0x48adca['sentimentAccountId']||!_0x48adca['sentimentRegion']||!_0x48adca[_0x77b3('0x21')]||!_0x48adca[_0x77b3('0x22')]){throw new db[(_0x77b3('0x1e'))][(_0x77b3('0x23'))](_0x77b3('0x24'));}if(!_0x26f445[_0x77b3('0x12')]){throw new Error(_0x77b3('0x25'));}if(_0x48adca[_0x77b3('0x26')]===_0x804b7['id']){return _0x804b7;}else{return db[_0x77b3('0x27')][_0x77b3('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x17b4ec){if(!_0x17b4ec){throw new db[(_0x77b3('0x1e'))]['ValidationError'](_0x77b3('0x29'));}if(!_0x17b4ec[_0x77b3('0xd')]||!_0x17b4ec[_0x77b3('0xe')]){throw new db[(_0x77b3('0x1e'))]['ValidationError'](_0x77b3('0x2a'));}_0x16692f=_0x17b4ec;logger[_0x77b3('0x9')](util[_0x77b3('0xa')](_0x77b3('0x2b'),_0x13bc8e['id']));return sentiment(_0x16692f[_0x77b3('0xd')],_0x16692f[_0x77b3('0xe')],_0x48adca[_0x77b3('0x2c')],_0x26f445['fileText'],_0x48adca['language']);})[_0x77b3('0xf')](function(_0x5ed77f){logger['info'](util['format'](_0x77b3('0x2d'),_0x13bc8e['id']));return _0x13bc8e[_0x77b3('0x2e')]({'sentiment':_0x5ed77f[_0x77b3('0x2f')],'sPositive':_0x5ed77f[_0x77b3('0x30')]['Positive'],'sNegative':_0x5ed77f[_0x77b3('0x30')][_0x77b3('0x31')],'sMixed':_0x5ed77f[_0x77b3('0x30')][_0x77b3('0x32')],'sNeutral':_0x5ed77f['SentimentScore'][_0x77b3('0x33')]});})[_0x77b3('0xf')](function(){logger['info'](util['format'](_0x77b3('0x1c'),_0x13bc8e['id']));_0x3ee308();});case _0x77b3('0x34'):return _0x13bc8e['update']({'transcribeStatus':_0x77b3('0x34'),'failureReason':_0x1c995c['TranscriptionJob'][_0x77b3('0x35')]})[_0x77b3('0xf')](function(){logger[_0x77b3('0x9')](util['format'](_0x77b3('0x1c'),_0x13bc8e['id']));_0x3ee308();});default:logger[_0x77b3('0x9')](util[_0x77b3('0xa')](_0x77b3('0x36'),_0x13bc8e['id']));break;}}else{return BPromise['resolve']()[_0x77b3('0xf')](function(){if(!_0x13bc8e[_0x77b3('0x1d')]){throw new db['Sequelize'][(_0x77b3('0x23'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x48adca[_0x77b3('0x20')]||!_0x48adca[_0x77b3('0x26')]||!_0x48adca[_0x77b3('0x2c')]||!_0x48adca[_0x77b3('0x21')]||!_0x48adca[_0x77b3('0x22')]){throw new db[(_0x77b3('0x1e'))]['ValidationError'](_0x77b3('0x24'));}if(!_0x13bc8e[_0x77b3('0x12')]){throw new Error(_0x77b3('0x25'));}if(_0x48adca[_0x77b3('0x26')]===_0x804b7['id']){return _0x804b7;}else{return db[_0x77b3('0x27')][_0x77b3('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x77b3('0xf')](function(_0x10568f){if(!_0x10568f){throw new db[(_0x77b3('0x1e'))]['ValidationError'](_0x77b3('0x29'));}if(!_0x10568f['data1']||!_0x10568f[_0x77b3('0xe')]){throw new db['Sequelize'][(_0x77b3('0x23'))](_0x77b3('0x2a'));}_0x16692f=_0x10568f;logger[_0x77b3('0x9')](util[_0x77b3('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x13bc8e['id']));return sentiment(_0x16692f[_0x77b3('0xd')],_0x16692f[_0x77b3('0xe')],_0x48adca[_0x77b3('0x2c')],_0x13bc8e[_0x77b3('0x12')],_0x48adca['language']);})[_0x77b3('0xf')](function(_0x5bba05){logger['info'](util[_0x77b3('0xa')](_0x77b3('0x2d'),_0x13bc8e['id']));return _0x13bc8e[_0x77b3('0x2e')]({'sentiment':_0x5bba05[_0x77b3('0x2f')],'sPositive':_0x5bba05[_0x77b3('0x30')][_0x77b3('0x37')],'sNegative':_0x5bba05[_0x77b3('0x30')][_0x77b3('0x31')],'sMixed':_0x5bba05['SentimentScore'][_0x77b3('0x32')],'sNeutral':_0x5bba05[_0x77b3('0x30')][_0x77b3('0x33')],'transcribeStatus':'COMPLETED'});})[_0x77b3('0xf')](function(){logger[_0x77b3('0x9')](util[_0x77b3('0xa')](_0x77b3('0x1c'),_0x13bc8e['id']));_0x3ee308();});}})[_0x77b3('0x38')](function(_0x2f373a){if(_0x2f373a){if(!_0x2f373a[_0x77b3('0x39')]||_0x2f373a[_0x77b3('0x39')]!==_0x77b3('0x3a')){logger[_0x77b3('0x3b')](util[_0x77b3('0xa')](_0x77b3('0x3c'),_0x13bc8e['id']),util[_0x77b3('0x3d')](_0x2f373a,{'showHidden':![],'depth':null}));}}_0x3ee308();});});}function checkTranscribe(){var _0xe26db1;var _0xc8b1bb;var _0x127a14;return db['VoiceRecording'][_0x77b3('0x3e')]({'where':{'transcribeStatus':_0x77b3('0x3f')}})[_0x77b3('0xf')](function(_0x45c38b){if(!_0x45c38b||!_0x45c38b[_0x77b3('0x19')]){throw new db[(_0x77b3('0x1e'))][(_0x77b3('0x23'))](_0x77b3('0x40'));}_0xe26db1=_0x45c38b;return db['Setting'][_0x77b3('0x28')]({'where':{'id':0x1}});})[_0x77b3('0xf')](function(_0x1cdff7){if(!_0x1cdff7){throw new db[(_0x77b3('0x1e'))][(_0x77b3('0x23'))](_0x77b3('0x41'));}_0xc8b1bb=_0x1cdff7;if(!_0xc8b1bb[_0x77b3('0x42')]||!_0xc8b1bb[_0x77b3('0x43')]||!_0xc8b1bb[_0x77b3('0x44')]||!_0xc8b1bb[_0x77b3('0x21')]||!_0xc8b1bb[_0x77b3('0x22')]){throw new db[(_0x77b3('0x1e'))][(_0x77b3('0x23'))](_0x77b3('0x45'));}return db[_0x77b3('0x27')][_0x77b3('0x28')]({'where':{'id':_0xc8b1bb['transcribeAccountId']}});})['then'](function(_0x142aff){if(!_0x142aff){throw new db[(_0x77b3('0x1e'))][(_0x77b3('0x23'))](_0x77b3('0x29'));}if(!_0x142aff[_0x77b3('0xd')]||!_0x142aff[_0x77b3('0xe')]){throw new db['Sequelize'][(_0x77b3('0x23'))](_0x77b3('0x2a'));}_0x127a14=_0x142aff;var _0x280eb7=[];_0xe26db1['forEach'](function(_0x106309){_0x280eb7[_0x77b3('0x46')](checkTranscribeJob(_0x106309,_0xc8b1bb,_0x127a14));});return BPromise[_0x77b3('0x47')](_0x280eb7);})[_0x77b3('0x38')](function(_0x3dd7b9){if(_0x3dd7b9){if(!_0x3dd7b9['name']||_0x3dd7b9[_0x77b3('0x39')]!==_0x77b3('0x3a')){logger[_0x77b3('0x3b')](util[_0x77b3('0x3d')](_0x3dd7b9,{'showHidden':![],'depth':null}));}}});}exports[_0x77b3('0x48')]=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 38b25af..6fec1f4 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 _0x8d92=['redis','localhost','socket.io-emitter','WhatsappInteraction','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','catch','error','inspect','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule'];(function(_0x1bdd6a,_0x364b61){var _0xbb9f31=function(_0x3a84fa){while(--_0x3a84fa){_0x1bdd6a['push'](_0x1bdd6a['shift']());}};_0xbb9f31(++_0x364b61);}(_0x8d92,0x1c9));var _0x28d9=function(_0x21f7c2,_0x1b2426){_0x21f7c2=_0x21f7c2-0x0;var _0x3f3279=_0x8d92[_0x21f7c2];return _0x3f3279;};'use strict';var _=require(_0x28d9('0x0'));var moment=require(_0x28d9('0x1'));var Redis=require(_0x28d9('0x2'));var util=require(_0x28d9('0x3'));var config=require('../../config/environment');var db=require(_0x28d9('0x4'))['db'];var logger=require(_0x28d9('0x5'))(_0x28d9('0x6'));config[_0x28d9('0x7')]=_['defaults'](config[_0x28d9('0x7')],{'host':_0x28d9('0x8'),'port':0x18eb});var io=require(_0x28d9('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x4726a9=[];return db[_0x28d9('0xa')]['findAll']({'raw':!![],'attributes':['id',_0x28d9('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x28d9('0xc')](0x18,_0x28d9('0xd'))}}})[_0x28d9('0xe')](function(_0x56b87f){if(_0x56b87f&&_0x56b87f[_0x28d9('0xf')]){_0x4726a9=_[_0x28d9('0x10')](_0x56b87f||[],'id');logger[_0x28d9('0x11')](_0x28d9('0x12'),_0x4726a9[_0x28d9('0x13')]());return db[_0x28d9('0xa')][_0x28d9('0x14')]({'closeReason':_0x28d9('0x15'),'disposition':_0x28d9('0x16'),'closed':!![],'closedAt':moment()[_0x28d9('0x17')](_0x28d9('0x18'))},{'where':{'id':_0x4726a9}});}})[_0x28d9('0xe')](function(){if(_0x4726a9&&_0x4726a9[_0x28d9('0xf')]){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x4726a9[_0x28d9('0x13')]());for(var _0x15deea=0x0;_0x15deea<_0x4726a9[_0x28d9('0xf')];_0x15deea++){io[_0x28d9('0x19')]('whatsappInteraction:update',{'id':_0x4726a9[_0x15deea],'closed':!![]});}}})[_0x28d9('0x1a')](function(_0xab55c6){logger[_0x28d9('0x1b')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0xab55c6?util[_0x28d9('0x1c')](_0xab55c6,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x6ac3=['findAll','lastMsgAt','subtract','then','length','map','info','join','WhatsappInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter'];(function(_0x32e649,_0x228649){var _0x14d386=function(_0x3fb3ed){while(--_0x3fb3ed){_0x32e649['push'](_0x32e649['shift']());}};_0x14d386(++_0x228649);}(_0x6ac3,0xb1));var _0x36ac=function(_0x575b5a,_0x3af816){_0x575b5a=_0x575b5a-0x0;var _0x486649=_0x6ac3[_0x575b5a];return _0x486649;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x36ac('0x0'));var util=require(_0x36ac('0x1'));var config=require(_0x36ac('0x2'));var db=require(_0x36ac('0x3'))['db'];var logger=require('../logger')(_0x36ac('0x4'));config[_0x36ac('0x5')]=_[_0x36ac('0x6')](config[_0x36ac('0x5')],{'host':_0x36ac('0x7'),'port':0x18eb});var io=require(_0x36ac('0x8'))(new Redis(config[_0x36ac('0x5')]));function closeInteractions(){var _0x2f86a8=[];return db['WhatsappInteraction'][_0x36ac('0x9')]({'raw':!![],'attributes':['id',_0x36ac('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x36ac('0xb')](0x18,'hours')}}})[_0x36ac('0xc')](function(_0x20cde3){if(_0x20cde3&&_0x20cde3[_0x36ac('0xd')]){_0x2f86a8=_[_0x36ac('0xe')](_0x20cde3||[],'id');logger[_0x36ac('0xf')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x2f86a8[_0x36ac('0x10')]());return db[_0x36ac('0x11')][_0x36ac('0x12')]({'closeReason':_0x36ac('0x13'),'disposition':_0x36ac('0x14'),'closed':!![],'closedAt':moment()[_0x36ac('0x15')](_0x36ac('0x16'))},{'where':{'id':_0x2f86a8}});}})[_0x36ac('0xc')](function(){if(_0x2f86a8&&_0x2f86a8[_0x36ac('0xd')]){logger[_0x36ac('0xf')](_0x36ac('0x17'),_0x2f86a8['join']());for(var _0x2c951a=0x0;_0x2c951a<_0x2f86a8['length'];_0x2c951a++){io[_0x36ac('0x18')](_0x36ac('0x19'),{'id':_0x2f86a8[_0x2c951a],'closed':!![]});}}})[_0x36ac('0x1a')](function(_0x1e07b3){logger[_0x36ac('0x1b')](_0x36ac('0x1c'),_0x1e07b3?util[_0x36ac('0x1d')](_0x1e07b3,{'showHidden':![],'depth':null}):'');});}exports[_0x36ac('0x1e')]=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 dccaf0e..655167a 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2da=['@xcally.com','CmContact','destroy','then','bulkCreate','contacts1','log','finished\x20populating','hopper1','contacts2','CmHopper','hopper2','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now'];(function(_0x181eb4,_0x237405){var _0x1bbcbd=function(_0x26c4cc){while(--_0x26c4cc){_0x181eb4['push'](_0x181eb4['shift']());}};_0x1bbcbd(++_0x237405);}(_0xd2da,0xca));var _0xad2d=function(_0x35a140,_0x3aeac6){_0x35a140=_0x35a140-0x0;var _0x30ab82=_0xd2da[_0x35a140];return _0x30ab82;};'use strict';var util=require(_0xad2d('0x0'));var db=require(_0xad2d('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xad2d('0x2')]({'id':i,'firstName':_0xad2d('0x3')+i,'lastName':_0xad2d('0x4')+i,'phone':0xf879fb460+i,'email':_0xad2d('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xad2d('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xad2d('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xad2d('0x2')]({'id':i,'firstName':_0xad2d('0x3')+i,'lastName':_0xad2d('0x4')+i,'phone':0xf879fb460+i,'email':_0xad2d('0x5')+i+_0xad2d('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xad2d('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xad2d('0x6')](),'updatedAt':Date[_0xad2d('0x6')]()});}db[_0xad2d('0x8')][_0xad2d('0x9')]({'where':{}})[_0xad2d('0xa')](function(){return db['CmContact'][_0xad2d('0xb')](contacts);})['then'](function(){console['log']('finished\x20populating',_0xad2d('0xc'));return db['CmHopper']['destroy']({'where':{}});})[_0xad2d('0xa')](function(){return db['CmHopper'][_0xad2d('0xb')](hopper);})[_0xad2d('0xa')](function(){console[_0xad2d('0xd')](_0xad2d('0xe'),_0xad2d('0xf'));return db[_0xad2d('0x8')][_0xad2d('0xb')](contacts2);})['then'](function(){console['log'](_0xad2d('0xe'),_0xad2d('0x10'));return db[_0xad2d('0x11')][_0xad2d('0xb')](hopper2);})[_0xad2d('0xa')](function(){console[_0xad2d('0xd')]('finished\x20populating',_0xad2d('0x12'));})['catch'](function(_0x56e126){console[_0xad2d('0xd')](_0x56e126);}); \ No newline at end of file +var _0x14f5=['Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','log','CmHopper','then','finished\x20populating','hopper1','bulkCreate','contacts2','hopper2','catch','util','../mysqldb','push'];(function(_0x527fb4,_0xc15f2e){var _0x4d50cd=function(_0xb9ecaa){while(--_0xb9ecaa){_0x527fb4['push'](_0x527fb4['shift']());}};_0x4d50cd(++_0xc15f2e);}(_0x14f5,0x82));var _0x514f=function(_0x2f48d4,_0x29b0fd){_0x2f48d4=_0x2f48d4-0x0;var _0x515c6f=_0x14f5[_0x2f48d4];return _0x515c6f;};'use strict';var util=require(_0x514f('0x0'));var db=require(_0x514f('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x514f('0x2')]({'id':i,'firstName':_0x514f('0x3')+i,'lastName':_0x514f('0x4')+i,'phone':0xf879fb460+i,'email':_0x514f('0x5')+i+_0x514f('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x514f('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x514f('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x514f('0x2')]({'id':i,'firstName':_0x514f('0x3')+i,'lastName':_0x514f('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x514f('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x514f('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x514f('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x514f('0x7')](),'updatedAt':Date[_0x514f('0x7')]()});}db[_0x514f('0x8')][_0x514f('0x9')]({'where':{}})['then'](function(){return db[_0x514f('0x8')]['bulkCreate'](contacts);})['then'](function(){console[_0x514f('0xa')]('finished\x20populating','contacts1');return db[_0x514f('0xb')]['destroy']({'where':{}});})[_0x514f('0xc')](function(){return db[_0x514f('0xb')]['bulkCreate'](hopper);})['then'](function(){console[_0x514f('0xa')](_0x514f('0xd'),_0x514f('0xe'));return db[_0x514f('0x8')][_0x514f('0xf')](contacts2);})[_0x514f('0xc')](function(){console[_0x514f('0xa')](_0x514f('0xd'),_0x514f('0x10'));return db[_0x514f('0xb')][_0x514f('0xf')](hopper2);})[_0x514f('0xc')](function(){console[_0x514f('0xa')](_0x514f('0xd'),_0x514f('0x11'));})[_0x514f('0x12')](function(_0x49a90e){console[_0x514f('0xa')](_0x49a90e);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 9fd49f0..8088c3f 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5bda=['\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user','catch','util','push','format','%s%s','agent','%s%s@xcally.com','friend','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5bda,0x9e));var _0xa5bd=function(_0x302a84,_0xfaf37c){_0x302a84=_0x302a84-0x0;var _0x28ef60=_0x5bda[_0x302a84];return _0x28ef60;};'use strict';var util=require(_0xa5bd('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xa5bd('0x1')]({'name':util[_0xa5bd('0x2')](_0xa5bd('0x3'),_0xa5bd('0x4'),i),'fullname':util['format']('%s%s',_0xa5bd('0x4'),i),'email':util[_0xa5bd('0x2')](_0xa5bd('0x5'),_0xa5bd('0x4'),i),'role':_0xa5bd('0x4'),'password':'password','internal':0xfa0+i,'type':_0xa5bd('0x6'),'transport':[_0xa5bd('0x7'),'ws',_0xa5bd('0x8')],'disallow':['all'],'allow':[_0xa5bd('0x9')],'defaultuser':util[_0xa5bd('0x2')]('%s%s',_0xa5bd('0x4'),i),'encryption':'yes','avpf':_0xa5bd('0xa'),'force_avp':_0xa5bd('0xa'),'icesupport':_0xa5bd('0xa'),'dtlsenable':_0xa5bd('0xa'),'dtlsverify':'no','dtlscertfile':_0xa5bd('0xb'),'dtlsprivatekey':_0xa5bd('0xc'),'dtlssetup':'actpass','callerid':util[_0xa5bd('0x2')](_0xa5bd('0xd'),util[_0xa5bd('0x2')](_0xa5bd('0x3'),_0xa5bd('0x4'),i),0xfa0+i)});}db[_0xa5bd('0xe')][_0xa5bd('0xf')](users)['then'](function(){console[_0xa5bd('0x10')](_0xa5bd('0x11'));})[_0xa5bd('0x12')](function(_0x5347f3){console[_0xa5bd('0x10')](_0x5347f3);}); \ No newline at end of file +var _0x0c32=['../mysqldb','push','format','%s%s','agent','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','bulkCreate','then','log','add\x20user','catch'];(function(_0x3cb616,_0x166419){var _0x37f4cc=function(_0x1cc7f0){while(--_0x1cc7f0){_0x3cb616['push'](_0x3cb616['shift']());}};_0x37f4cc(++_0x166419);}(_0x0c32,0x143));var _0x20c3=function(_0x136bc8,_0x5e5bd4){_0x136bc8=_0x136bc8-0x0;var _0x33e395=_0x0c32[_0x136bc8];return _0x33e395;};'use strict';var util=require('util');var db=require(_0x20c3('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x20c3('0x1')]({'name':util[_0x20c3('0x2')](_0x20c3('0x3'),_0x20c3('0x4'),i),'fullname':util[_0x20c3('0x2')](_0x20c3('0x3'),_0x20c3('0x4'),i),'email':util[_0x20c3('0x2')]('%s%s@xcally.com','agent',i),'role':_0x20c3('0x4'),'password':_0x20c3('0x5'),'internal':0xfa0+i,'type':_0x20c3('0x6'),'transport':[_0x20c3('0x7'),'ws',_0x20c3('0x8')],'disallow':[_0x20c3('0x9')],'allow':[_0x20c3('0xa')],'defaultuser':util[_0x20c3('0x2')](_0x20c3('0x3'),_0x20c3('0x4'),i),'encryption':'yes','avpf':'yes','force_avp':_0x20c3('0xb'),'icesupport':_0x20c3('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x20c3('0xc'),'dtlssetup':_0x20c3('0xd'),'callerid':util['format']('\x22%s\x22\x20<%s>',util['format'](_0x20c3('0x3'),_0x20c3('0x4'),i),0xfa0+i)});}db['User'][_0x20c3('0xe')](users)[_0x20c3('0xf')](function(){console[_0x20c3('0x10')](_0x20c3('0x11'));})[_0x20c3('0x12')](function(_0x5cadb4){console[_0x20c3('0x10')](_0x5cadb4);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index ef57cd4..7089c35 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2eba=['bluebird','../mysqldb','./environment','User','role','agent','name','telephone','ivr','findOne','then','VoiceQueues','ChatQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','type','format','%s:queue:%s','Agents','user:%s','handshake','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','hasOwnProperty','include','ChatQueue','FaxQueue','push','SmsQueue','MailQueue','WhatsappQueue','Trunk','user','VoiceQueue','FaxQueues','MailQueues','OpenchannelQueue','voice:inbound','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','all','length','voice','sms','mail','whatsapp','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','remoteAddress','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','util'];(function(_0x276fed,_0x22bb9e){var _0x31d98e=function(_0x25907d){while(--_0x25907d){_0x276fed['push'](_0x276fed['shift']());}};_0x31d98e(++_0x22bb9e);}(_0x2eba,0xc7));var _0xa2eb=function(_0x3cdc04,_0xc1e020){_0x3cdc04=_0x3cdc04-0x0;var _0x175499=_0x2eba[_0x3cdc04];return _0x175499;};'use strict';var _=require('lodash');var util=require(_0xa2eb('0x0'));var BPromise=require(_0xa2eb('0x1'));var db=require(_0xa2eb('0x2'))['db'];var config=require(_0xa2eb('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0xa2eb('0x4')],'attributes':['id','name',_0xa2eb('0x5')],'raw':!![],'where':{'role':_0xa2eb('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xa2eb('0x7')],'where':{'role':_0xa2eb('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xa2eb('0x7'),'type'],'where':{'type':_0xa2eb('0x9')}};function getAssociatedResources(_0x2fb8e6,_0x42a486,_0x5480a1){return db['UserProfileSection'][_0xa2eb('0xa')]({'where':{'name':_0x2fb8e6,'userProfileId':_0x42a486},'raw':!![]})[_0xa2eb('0xb')](function(_0x1c9cb6){if(_0x1c9cb6){if(_0x1c9cb6['autoAssociation']){switch(_0x2fb8e6){case _0xa2eb('0xc'):case _0xa2eb('0xd'):case'FaxQueues':case _0xa2eb('0xe'):case'MailQueues':case _0xa2eb('0xf'):case _0xa2eb('0x10'):return db[_0x5480a1][_0xa2eb('0x11')](queryQueues);case _0xa2eb('0x12'):return db[_0x5480a1][_0xa2eb('0x11')](queryTelephones);case _0xa2eb('0x13'):return db[_0x5480a1]['findAll'](queryTrunks);case _0xa2eb('0x14'):return db[_0x5480a1][_0xa2eb('0x11')](queryCampaigns);}}else{return db[_0xa2eb('0x15')][_0xa2eb('0x11')]({'attributes':[_0xa2eb('0x16')],'where':{'sectionId':_0x1c9cb6['id']},'raw':!![]})[_0xa2eb('0xb')](function(_0x34aa65){if(_0x34aa65){var _0x2a5b1f={'where':{'id':_[_0xa2eb('0x17')](_0x34aa65,_0xa2eb('0x16'))},'raw':!![]};switch(_0x5480a1){case _0xa2eb('0x4'):_0x2a5b1f[_0xa2eb('0x18')]['role']='telephone';break;case _0xa2eb('0x19'):_0x2a5b1f[_0xa2eb('0x18')][_0xa2eb('0x1a')]=_0xa2eb('0x9');break;}return db[_0x5480a1][_0xa2eb('0x11')](_0x2a5b1f);}else{return[];}});}}else{return[];}})[_0xa2eb('0xb')](function(_0xe18d){return _0xe18d;});}function joinOrLeaveQueues(_0x5836ee,_0x19b6f7,_0x3ece61,_0x2a9935){_0x5836ee[_0x19b6f7](util[_0xa2eb('0x1b')](_0xa2eb('0x1c'),_0x3ece61,_0x2a9935['name']));if(_0x2a9935['Agents']){for(var _0x6a54b8=0x0;_0x6a54b8<_0x2a9935[_0xa2eb('0x1d')]['length'];_0x6a54b8+=0x1){_0x5836ee[_0x19b6f7](util[_0xa2eb('0x1b')](_0xa2eb('0x1e'),_0x2a9935['Agents'][_0x6a54b8]['name']));}}}function joinOrLeave(_0x185ce0,_0x14a329,_0x15ee1e){var _0x1a95f6;if(_0x185ce0[_0xa2eb('0x1f')]['query']['id']){db[_0xa2eb('0x4')][_0xa2eb('0x20')]({'attributes':['id',_0xa2eb('0x7'),_0xa2eb('0x5'),_0xa2eb('0x21')],'where':{'id':_0x185ce0[_0xa2eb('0x1f')]['query']['id']},'include':[{'model':db[_0xa2eb('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xa2eb('0x23')],'as':_0xa2eb('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xa2eb('0x25')],'as':_0xa2eb('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xa2eb('0x27')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xa2eb('0x28')],'as':_0xa2eb('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xa2eb('0x2a')],'as':_0xa2eb('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xa2eb('0xb')](function(_0x245658){if(_0x245658){_0x1a95f6=_0x245658;_0x185ce0[_0x14a329](util[_0xa2eb('0x1b')]('user:%s',_0x245658['name']));var _0x5572ff=[];switch(_0x245658[_0xa2eb('0x5')]){case _0xa2eb('0x2c'):_0x185ce0[_0x14a329]('voice:inbound');_0x185ce0[_0x14a329](_0xa2eb('0x2d'));if(queryQueues[_0xa2eb('0x2e')]('include')){delete queryQueues[_0xa2eb('0x2f')];}_0x5572ff['push'](db['VoiceQueue'][_0xa2eb('0x11')](queryQueues));_0x5572ff['push'](db[_0xa2eb('0x30')]['findAll'](queryQueues));_0x5572ff['push'](db[_0xa2eb('0x31')][_0xa2eb('0x11')](queryQueues));_0x5572ff[_0xa2eb('0x32')](db[_0xa2eb('0x33')][_0xa2eb('0x11')](queryQueues));_0x5572ff[_0xa2eb('0x32')](db[_0xa2eb('0x34')][_0xa2eb('0x11')](queryQueues));_0x5572ff[_0xa2eb('0x32')](db['OpenchannelQueue'][_0xa2eb('0x11')](queryQueues));_0x5572ff[_0xa2eb('0x32')](db[_0xa2eb('0x35')][_0xa2eb('0x11')](queryQueues));_0x5572ff[_0xa2eb('0x32')](db[_0xa2eb('0x4')][_0xa2eb('0x11')](queryTelephones));_0x5572ff[_0xa2eb('0x32')](db[_0xa2eb('0x36')]['findAll'](queryTrunks));_0x5572ff[_0xa2eb('0x32')](db[_0xa2eb('0x19')]['findAll'](queryCampaigns));_0x5572ff[_0xa2eb('0x32')](db[_0xa2eb('0x4')][_0xa2eb('0x11')](queryAgents));break;case _0xa2eb('0x37'):_0x185ce0[_0x14a329]('voice:inbound');_0x185ce0[_0x14a329](_0xa2eb('0x2d'));_0x5572ff[_0xa2eb('0x32')](getAssociatedResources(_0xa2eb('0xc'),_0x245658[_0xa2eb('0x21')],_0xa2eb('0x38')));_0x5572ff[_0xa2eb('0x32')](getAssociatedResources(_0xa2eb('0xd'),_0x245658[_0xa2eb('0x21')],_0xa2eb('0x30')));_0x5572ff[_0xa2eb('0x32')](getAssociatedResources(_0xa2eb('0x39'),_0x245658[_0xa2eb('0x21')],_0xa2eb('0x31')));_0x5572ff[_0xa2eb('0x32')](getAssociatedResources('SmsQueues',_0x245658['userProfileId'],'SmsQueue'));_0x5572ff[_0xa2eb('0x32')](getAssociatedResources(_0xa2eb('0x3a'),_0x245658[_0xa2eb('0x21')],_0xa2eb('0x34')));_0x5572ff[_0xa2eb('0x32')](getAssociatedResources(_0xa2eb('0xf'),_0x245658['userProfileId'],_0xa2eb('0x3b')));_0x5572ff['push'](getAssociatedResources(_0xa2eb('0x10'),_0x245658[_0xa2eb('0x21')],_0xa2eb('0x35')));_0x5572ff[_0xa2eb('0x32')](getAssociatedResources(_0xa2eb('0x12'),_0x245658['userProfileId'],_0xa2eb('0x4')));_0x5572ff[_0xa2eb('0x32')](getAssociatedResources('Trunks',_0x245658['userProfileId'],_0xa2eb('0x36')));_0x5572ff[_0xa2eb('0x32')](getAssociatedResources(_0xa2eb('0x14'),_0x245658[_0xa2eb('0x21')],'Campaign'));_0x5572ff['push'](db[_0xa2eb('0x4')][_0xa2eb('0x11')](queryAgents));break;case'agent':_0x185ce0[_0x14a329](_0xa2eb('0x3c'));_0x185ce0[_0x14a329]('voice:outbound');_0x5572ff['push'](_0x245658[_0xa2eb('0x3d')]({'attributes':['id',_0xa2eb('0x7')]}));_0x5572ff[_0xa2eb('0x32')](_0x245658[_0xa2eb('0x3e')]({'attributes':['id','name']}));_0x5572ff[_0xa2eb('0x32')](_0x245658['getFaxQueues']({'attributes':['id',_0xa2eb('0x7')]}));_0x5572ff[_0xa2eb('0x32')](_0x245658[_0xa2eb('0x3f')]({'attributes':['id',_0xa2eb('0x7')]}));_0x5572ff[_0xa2eb('0x32')](_0x245658[_0xa2eb('0x40')]({'attributes':['id',_0xa2eb('0x7')]}));_0x5572ff[_0xa2eb('0x32')](_0x245658['getOpenchannelQueues']({'attributes':['id','name']}));_0x5572ff['push'](_0x245658['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise[_0xa2eb('0x41')](_0x5572ff);}})[_0xa2eb('0xb')](function(_0x2dec33){if(_0x2dec33&&_0x2dec33[_0xa2eb('0x42')]){for(var _0x2947b8=0x0;_0x2947b8<_0x2dec33[_0xa2eb('0x42')];_0x2947b8+=0x1){for(var _0x338255=0x0;_0x338255<_0x2dec33[_0x2947b8][_0xa2eb('0x42')];_0x338255+=0x1){switch(_0x2947b8){case 0x0:joinOrLeaveQueues(_0x185ce0,_0x14a329,_0xa2eb('0x43'),_0x2dec33[_0x2947b8][_0x338255]);break;case 0x1:joinOrLeaveQueues(_0x185ce0,_0x14a329,'chat',_0x2dec33[_0x2947b8][_0x338255]);break;case 0x2:joinOrLeaveQueues(_0x185ce0,_0x14a329,'fax',_0x2dec33[_0x2947b8][_0x338255]);break;case 0x3:joinOrLeaveQueues(_0x185ce0,_0x14a329,_0xa2eb('0x44'),_0x2dec33[_0x2947b8][_0x338255]);break;case 0x4:joinOrLeaveQueues(_0x185ce0,_0x14a329,_0xa2eb('0x45'),_0x2dec33[_0x2947b8][_0x338255]);break;case 0x5:joinOrLeaveQueues(_0x185ce0,_0x14a329,'openchannel',_0x2dec33[_0x2947b8][_0x338255]);break;case 0x6:joinOrLeaveQueues(_0x185ce0,_0x14a329,_0xa2eb('0x46'),_0x2dec33[_0x2947b8][_0x338255]);break;case 0x7:if(_0x1a95f6[_0xa2eb('0x5')]!==_0xa2eb('0x6'))_0x185ce0[_0x14a329](util[_0xa2eb('0x1b')]('telephone:%s',_0x2dec33[_0x2947b8][_0x338255][_0xa2eb('0x7')]));break;case 0x8:if(_0x1a95f6[_0xa2eb('0x5')]!==_0xa2eb('0x6'))_0x185ce0[_0x14a329](util[_0xa2eb('0x1b')](_0xa2eb('0x47'),_0x2dec33[_0x2947b8][_0x338255]['name']));break;case 0x9:if(_0x1a95f6['role']!==_0xa2eb('0x6'))_0x185ce0[_0x14a329](util[_0xa2eb('0x1b')](_0xa2eb('0x48'),_0x2dec33[_0x2947b8][_0x338255][_0xa2eb('0x1a')],_0x2dec33[_0x2947b8][_0x338255][_0xa2eb('0x7')]));break;case 0xa:_0x185ce0[_0x14a329](util[_0xa2eb('0x1b')]('user:%s',_0x2dec33[_0x2947b8][_0x338255][_0xa2eb('0x7')]));break;}}}}})[_0xa2eb('0xb')](function(){if(_0x14a329===_0xa2eb('0x49')){var _0x224c23=_['map'](_0x1a95f6[_0xa2eb('0x4a')],'id');return _0x1a95f6[_0xa2eb('0x4b')](_0x224c23)[_0xa2eb('0xb')](function(){for(var _0xe4faf6=0x0;_0xe4faf6<_0x224c23[_0xa2eb('0x42')];_0xe4faf6+=0x1){_0x15ee1e[_0xa2eb('0x4c')](_0xa2eb('0x4d'),{'ChatInteractionId':Number(_0x224c23[_0xe4faf6]),'UserId':Number(_0x1a95f6['id'])});}});}})['then'](function(){if(_0x14a329===_0xa2eb('0x49')){var _0xfaa581=_['map'](_0x1a95f6[_0xa2eb('0x24')],'id');return _0x1a95f6[_0xa2eb('0x4e')](_0xfaa581)[_0xa2eb('0xb')](function(){for(var _0x1413bd=0x0;_0x1413bd<_0xfaa581[_0xa2eb('0x42')];_0x1413bd+=0x1){_0x15ee1e[_0xa2eb('0x4c')](_0xa2eb('0x4f'),{'MailInteractionId':Number(_0xfaa581[_0x1413bd]),'UserId':Number(_0x1a95f6['id'])});}});}})[_0xa2eb('0xb')](function(){if(_0x14a329==='leave'){var _0x1be3ec=_['map'](_0x1a95f6['FaxInteractions'],'id');return _0x1a95f6['removeFaxInteractions'](_0x1be3ec)[_0xa2eb('0xb')](function(){for(var _0x3426ee=0x0;_0x3426ee<_0x1be3ec[_0xa2eb('0x42')];_0x3426ee+=0x1){_0x15ee1e[_0xa2eb('0x4c')](_0xa2eb('0x50'),{'FaxInteractionId':Number(_0x1be3ec[_0x3426ee]),'UserId':Number(_0x1a95f6['id'])});}});}})['then'](function(){if(_0x14a329==='leave'){var _0xb3a748=_[_0xa2eb('0x17')](_0x1a95f6[_0xa2eb('0x51')],'id');return _0x1a95f6[_0xa2eb('0x52')](_0xb3a748)[_0xa2eb('0xb')](function(){for(var _0x30986c=0x0;_0x30986c<_0xb3a748[_0xa2eb('0x42')];_0x30986c+=0x1){_0x15ee1e[_0xa2eb('0x4c')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0xb3a748[_0x30986c]),'UserId':Number(_0x1a95f6['id'])});}});}})[_0xa2eb('0xb')](function(){if(_0x14a329==='leave'){var _0x2d89cc=_[_0xa2eb('0x17')](_0x1a95f6[_0xa2eb('0x29')],'id');return _0x1a95f6[_0xa2eb('0x53')](_0x2d89cc)[_0xa2eb('0xb')](function(){for(var _0x4991c3=0x0;_0x4991c3<_0x2d89cc['length'];_0x4991c3+=0x1){_0x15ee1e[_0xa2eb('0x4c')](_0xa2eb('0x54'),{'OpenchannelInteractionId':Number(_0x2d89cc[_0x4991c3]),'UserId':Number(_0x1a95f6['id'])});}});}})[_0xa2eb('0xb')](function(){if(_0x14a329===_0xa2eb('0x49')){var _0x226254=_[_0xa2eb('0x17')](_0x1a95f6[_0xa2eb('0x2b')],'id');return _0x1a95f6[_0xa2eb('0x55')](_0x226254)[_0xa2eb('0xb')](function(){for(var _0x261ecf=0x0;_0x261ecf<_0x226254[_0xa2eb('0x42')];_0x261ecf+=0x1){_0x15ee1e[_0xa2eb('0x4c')](_0xa2eb('0x56'),{'WhatsappInteractionId':Number(_0x226254[_0x261ecf]),'UserId':Number(_0x1a95f6['id'])});}});}})['catch'](function(_0x3d8d0f){_0x185ce0[_0xa2eb('0x57')](_0x3d8d0f);});}}function onDisconnect(_0x3c2060,_0x133f49){joinOrLeave(_0x3c2060,'leave',_0x133f49);}function onConnect(_0x2b103b){joinOrLeave(_0x2b103b,_0xa2eb('0x58'));}exports[_0xa2eb('0x59')]=function(_0x4e5b1e){_0x4e5b1e['on']('connection',function(_0x130b88){_0x130b88['setMaxListeners'](0x0);_0x130b88['address']=_0x130b88['request'][_0xa2eb('0x5a')][_0xa2eb('0x5b')]+':'+_0x130b88[_0xa2eb('0x5c')]['connection'][_0xa2eb('0x5d')];_0x130b88[_0xa2eb('0x5e')]=new Date();_0x130b88[_0xa2eb('0x57')]=function(_0x2d8eb8){console[_0xa2eb('0x57')](_0xa2eb('0x5f')+_0x130b88[_0xa2eb('0x60')]['name']+'['+_0x130b88['address']+']',_0x2d8eb8);};_0x130b88['on'](_0xa2eb('0x61'),function(){onDisconnect(_0x130b88,_0x4e5b1e);_0x130b88[_0xa2eb('0x57')](_0xa2eb('0x62'));});onConnect(_0x130b88);_0x130b88['log'](_0xa2eb('0x63'));});}; \ No newline at end of file +var _0x87bc=['resourceId','User','where','role','Campaign','type','format','%s:queue:%s','length','query','find','handshake','ChatInteraction','ChatInteractions','MailInteraction','SmsInteraction','SmsInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','userProfileId','ChatQueues','WhatsappQueue','Telephones','Trunks','agent','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','user_has_mail_interactions:remove','FaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners','address','request','remotePort','connectedAt','log','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','Agents','name','telephone','ivr','UserProfileSection','findOne','then','autoAssociation','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','IvrCampaigns','UserProfileResource','map'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0x87bc,0x189));var _0xc87b=function(_0x29613d,_0x3cf648){_0x29613d=_0x29613d-0x0;var _0xc3a20c=_0x87bc[_0x29613d];return _0xc3a20c;};'use strict';var _=require(_0xc87b('0x0'));var util=require(_0xc87b('0x1'));var BPromise=require('bluebird');var db=require(_0xc87b('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0xc87b('0x3'),'model':db['User'],'attributes':['id',_0xc87b('0x4'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xc87b('0x5')}};var queryTrunks={'raw':!![],'attributes':['id',_0xc87b('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xc87b('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name','type'],'where':{'type':_0xc87b('0x6')}};function getAssociatedResources(_0x169bbb,_0x1144cc,_0x19b571){return db[_0xc87b('0x7')][_0xc87b('0x8')]({'where':{'name':_0x169bbb,'userProfileId':_0x1144cc},'raw':!![]})[_0xc87b('0x9')](function(_0x1d834a){if(_0x1d834a){if(_0x1d834a[_0xc87b('0xa')]){switch(_0x169bbb){case'VoiceQueues':case'ChatQueues':case _0xc87b('0xb'):case'SmsQueues':case _0xc87b('0xc'):case _0xc87b('0xd'):case _0xc87b('0xe'):return db[_0x19b571][_0xc87b('0xf')](queryQueues);case'Telephones':return db[_0x19b571][_0xc87b('0xf')](queryTelephones);case'Trunks':return db[_0x19b571][_0xc87b('0xf')](queryTrunks);case _0xc87b('0x10'):return db[_0x19b571]['findAll'](queryCampaigns);}}else{return db[_0xc87b('0x11')][_0xc87b('0xf')]({'attributes':['resourceId'],'where':{'sectionId':_0x1d834a['id']},'raw':!![]})[_0xc87b('0x9')](function(_0x21f1d1){if(_0x21f1d1){var _0x34195e={'where':{'id':_[_0xc87b('0x12')](_0x21f1d1,_0xc87b('0x13'))},'raw':!![]};switch(_0x19b571){case _0xc87b('0x14'):_0x34195e[_0xc87b('0x15')][_0xc87b('0x16')]='telephone';break;case _0xc87b('0x17'):_0x34195e['where'][_0xc87b('0x18')]=_0xc87b('0x6');break;}return db[_0x19b571]['findAll'](_0x34195e);}else{return[];}});}}else{return[];}})[_0xc87b('0x9')](function(_0x372665){return _0x372665;});}function joinOrLeaveQueues(_0x4f56a0,_0x35b58f,_0x4cceeb,_0x36c8c4){_0x4f56a0[_0x35b58f](util[_0xc87b('0x19')](_0xc87b('0x1a'),_0x4cceeb,_0x36c8c4[_0xc87b('0x4')]));if(_0x36c8c4[_0xc87b('0x3')]){for(var _0x211b3c=0x0;_0x211b3c<_0x36c8c4[_0xc87b('0x3')][_0xc87b('0x1b')];_0x211b3c+=0x1){_0x4f56a0[_0x35b58f](util[_0xc87b('0x19')]('user:%s',_0x36c8c4[_0xc87b('0x3')][_0x211b3c]['name']));}}}function joinOrLeave(_0x3c6d50,_0x42d099,_0x147731){var _0x4bff29;if(_0x3c6d50['handshake'][_0xc87b('0x1c')]['id']){db[_0xc87b('0x14')][_0xc87b('0x1d')]({'attributes':['id',_0xc87b('0x4'),_0xc87b('0x16'),'userProfileId'],'where':{'id':_0x3c6d50[_0xc87b('0x1e')][_0xc87b('0x1c')]['id']},'include':[{'model':db[_0xc87b('0x1f')],'as':_0xc87b('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0xc87b('0x21')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc87b('0x22')],'as':_0xc87b('0x23'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc87b('0x24')],'as':_0xc87b('0x25'),'attributes':['id'],'raw':!![]}]})[_0xc87b('0x9')](function(_0x4e02d7){if(_0x4e02d7){_0x4bff29=_0x4e02d7;_0x3c6d50[_0x42d099](util[_0xc87b('0x19')](_0xc87b('0x26'),_0x4e02d7[_0xc87b('0x4')]));var _0x4b1ac6=[];switch(_0x4e02d7[_0xc87b('0x16')]){case _0xc87b('0x27'):_0x3c6d50[_0x42d099](_0xc87b('0x28'));_0x3c6d50[_0x42d099](_0xc87b('0x29'));if(queryQueues[_0xc87b('0x2a')](_0xc87b('0x2b'))){delete queryQueues[_0xc87b('0x2b')];}_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x2d')][_0xc87b('0xf')](queryQueues));_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x2e')]['findAll'](queryQueues));_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x2f')]['findAll'](queryQueues));_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x30')][_0xc87b('0xf')](queryQueues));_0x4b1ac6['push'](db[_0xc87b('0x31')][_0xc87b('0xf')](queryQueues));_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x32')][_0xc87b('0xf')](queryQueues));_0x4b1ac6['push'](db['WhatsappQueue'][_0xc87b('0xf')](queryQueues));_0x4b1ac6['push'](db[_0xc87b('0x14')][_0xc87b('0xf')](queryTelephones));_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x33')]['findAll'](queryTrunks));_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x17')][_0xc87b('0xf')](queryCampaigns));_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x14')][_0xc87b('0xf')](queryAgents));break;case _0xc87b('0x34'):_0x3c6d50[_0x42d099]('voice:inbound');_0x3c6d50[_0x42d099](_0xc87b('0x29'));_0x4b1ac6['push'](getAssociatedResources('VoiceQueues',_0x4e02d7[_0xc87b('0x35')],_0xc87b('0x2d')));_0x4b1ac6[_0xc87b('0x2c')](getAssociatedResources(_0xc87b('0x36'),_0x4e02d7[_0xc87b('0x35')],_0xc87b('0x2e')));_0x4b1ac6['push'](getAssociatedResources(_0xc87b('0xb'),_0x4e02d7[_0xc87b('0x35')],_0xc87b('0x2f')));_0x4b1ac6[_0xc87b('0x2c')](getAssociatedResources('SmsQueues',_0x4e02d7[_0xc87b('0x35')],_0xc87b('0x30')));_0x4b1ac6[_0xc87b('0x2c')](getAssociatedResources(_0xc87b('0xc'),_0x4e02d7['userProfileId'],'MailQueue'));_0x4b1ac6['push'](getAssociatedResources(_0xc87b('0xd'),_0x4e02d7[_0xc87b('0x35')],'OpenchannelQueue'));_0x4b1ac6[_0xc87b('0x2c')](getAssociatedResources(_0xc87b('0xe'),_0x4e02d7[_0xc87b('0x35')],_0xc87b('0x37')));_0x4b1ac6[_0xc87b('0x2c')](getAssociatedResources(_0xc87b('0x38'),_0x4e02d7[_0xc87b('0x35')],_0xc87b('0x14')));_0x4b1ac6[_0xc87b('0x2c')](getAssociatedResources(_0xc87b('0x39'),_0x4e02d7[_0xc87b('0x35')],_0xc87b('0x33')));_0x4b1ac6[_0xc87b('0x2c')](getAssociatedResources(_0xc87b('0x10'),_0x4e02d7[_0xc87b('0x35')],'Campaign'));_0x4b1ac6[_0xc87b('0x2c')](db[_0xc87b('0x14')][_0xc87b('0xf')](queryAgents));break;case _0xc87b('0x3a'):_0x3c6d50[_0x42d099](_0xc87b('0x28'));_0x3c6d50[_0x42d099]('voice:outbound');_0x4b1ac6['push'](_0x4e02d7[_0xc87b('0x3b')]({'attributes':['id',_0xc87b('0x4')]}));_0x4b1ac6['push'](_0x4e02d7[_0xc87b('0x3c')]({'attributes':['id',_0xc87b('0x4')]}));_0x4b1ac6[_0xc87b('0x2c')](_0x4e02d7[_0xc87b('0x3d')]({'attributes':['id',_0xc87b('0x4')]}));_0x4b1ac6[_0xc87b('0x2c')](_0x4e02d7['getSmsQueues']({'attributes':['id','name']}));_0x4b1ac6[_0xc87b('0x2c')](_0x4e02d7[_0xc87b('0x3e')]({'attributes':['id',_0xc87b('0x4')]}));_0x4b1ac6[_0xc87b('0x2c')](_0x4e02d7[_0xc87b('0x3f')]({'attributes':['id',_0xc87b('0x4')]}));_0x4b1ac6[_0xc87b('0x2c')](_0x4e02d7[_0xc87b('0x40')]({'attributes':['id',_0xc87b('0x4')]}));break;}return BPromise[_0xc87b('0x41')](_0x4b1ac6);}})[_0xc87b('0x9')](function(_0x2fe333){if(_0x2fe333&&_0x2fe333[_0xc87b('0x1b')]){for(var _0x5ee6ea=0x0;_0x5ee6ea<_0x2fe333[_0xc87b('0x1b')];_0x5ee6ea+=0x1){for(var _0x3b6d31=0x0;_0x3b6d31<_0x2fe333[_0x5ee6ea]['length'];_0x3b6d31+=0x1){switch(_0x5ee6ea){case 0x0:joinOrLeaveQueues(_0x3c6d50,_0x42d099,_0xc87b('0x42'),_0x2fe333[_0x5ee6ea][_0x3b6d31]);break;case 0x1:joinOrLeaveQueues(_0x3c6d50,_0x42d099,_0xc87b('0x43'),_0x2fe333[_0x5ee6ea][_0x3b6d31]);break;case 0x2:joinOrLeaveQueues(_0x3c6d50,_0x42d099,_0xc87b('0x44'),_0x2fe333[_0x5ee6ea][_0x3b6d31]);break;case 0x3:joinOrLeaveQueues(_0x3c6d50,_0x42d099,_0xc87b('0x45'),_0x2fe333[_0x5ee6ea][_0x3b6d31]);break;case 0x4:joinOrLeaveQueues(_0x3c6d50,_0x42d099,_0xc87b('0x46'),_0x2fe333[_0x5ee6ea][_0x3b6d31]);break;case 0x5:joinOrLeaveQueues(_0x3c6d50,_0x42d099,_0xc87b('0x47'),_0x2fe333[_0x5ee6ea][_0x3b6d31]);break;case 0x6:joinOrLeaveQueues(_0x3c6d50,_0x42d099,_0xc87b('0x48'),_0x2fe333[_0x5ee6ea][_0x3b6d31]);break;case 0x7:if(_0x4bff29['role']!=='agent')_0x3c6d50[_0x42d099](util[_0xc87b('0x19')]('telephone:%s',_0x2fe333[_0x5ee6ea][_0x3b6d31][_0xc87b('0x4')]));break;case 0x8:if(_0x4bff29[_0xc87b('0x16')]!==_0xc87b('0x3a'))_0x3c6d50[_0x42d099](util['format'](_0xc87b('0x49'),_0x2fe333[_0x5ee6ea][_0x3b6d31][_0xc87b('0x4')]));break;case 0x9:if(_0x4bff29[_0xc87b('0x16')]!==_0xc87b('0x3a'))_0x3c6d50[_0x42d099](util[_0xc87b('0x19')](_0xc87b('0x4a'),_0x2fe333[_0x5ee6ea][_0x3b6d31][_0xc87b('0x18')],_0x2fe333[_0x5ee6ea][_0x3b6d31]['name']));break;case 0xa:_0x3c6d50[_0x42d099](util['format'](_0xc87b('0x26'),_0x2fe333[_0x5ee6ea][_0x3b6d31][_0xc87b('0x4')]));break;}}}}})[_0xc87b('0x9')](function(){if(_0x42d099===_0xc87b('0x4b')){var _0xe73d52=_['map'](_0x4bff29['ChatInteractions'],'id');return _0x4bff29[_0xc87b('0x4c')](_0xe73d52)[_0xc87b('0x9')](function(){for(var _0x4ac1ca=0x0;_0x4ac1ca<_0xe73d52[_0xc87b('0x1b')];_0x4ac1ca+=0x1){_0x147731[_0xc87b('0x4d')](_0xc87b('0x4e'),{'ChatInteractionId':Number(_0xe73d52[_0x4ac1ca]),'UserId':Number(_0x4bff29['id'])});}});}})[_0xc87b('0x9')](function(){if(_0x42d099==='leave'){var _0x1a38e5=_[_0xc87b('0x12')](_0x4bff29[_0xc87b('0x4f')],'id');return _0x4bff29['removeMailInteractions'](_0x1a38e5)[_0xc87b('0x9')](function(){for(var _0x1d5a58=0x0;_0x1d5a58<_0x1a38e5['length'];_0x1d5a58+=0x1){_0x147731[_0xc87b('0x4d')](_0xc87b('0x50'),{'MailInteractionId':Number(_0x1a38e5[_0x1d5a58]),'UserId':Number(_0x4bff29['id'])});}});}})[_0xc87b('0x9')](function(){if(_0x42d099===_0xc87b('0x4b')){var _0x2fbaf0=_[_0xc87b('0x12')](_0x4bff29[_0xc87b('0x51')],'id');return _0x4bff29['removeFaxInteractions'](_0x2fbaf0)['then'](function(){for(var _0x27f74d=0x0;_0x27f74d<_0x2fbaf0[_0xc87b('0x1b')];_0x27f74d+=0x1){_0x147731[_0xc87b('0x4d')](_0xc87b('0x52'),{'FaxInteractionId':Number(_0x2fbaf0[_0x27f74d]),'UserId':Number(_0x4bff29['id'])});}});}})[_0xc87b('0x9')](function(){if(_0x42d099===_0xc87b('0x4b')){var _0x57dbec=_['map'](_0x4bff29[_0xc87b('0x23')],'id');return _0x4bff29['removeSmsInteractions'](_0x57dbec)['then'](function(){for(var _0x2ef012=0x0;_0x2ef012<_0x57dbec[_0xc87b('0x1b')];_0x2ef012+=0x1){_0x147731[_0xc87b('0x4d')](_0xc87b('0x53'),{'SmsInteractionId':Number(_0x57dbec[_0x2ef012]),'UserId':Number(_0x4bff29['id'])});}});}})[_0xc87b('0x9')](function(){if(_0x42d099===_0xc87b('0x4b')){var _0x3f1a63=_['map'](_0x4bff29[_0xc87b('0x54')],'id');return _0x4bff29[_0xc87b('0x55')](_0x3f1a63)[_0xc87b('0x9')](function(){for(var _0x1594e8=0x0;_0x1594e8<_0x3f1a63[_0xc87b('0x1b')];_0x1594e8+=0x1){_0x147731[_0xc87b('0x4d')](_0xc87b('0x56'),{'OpenchannelInteractionId':Number(_0x3f1a63[_0x1594e8]),'UserId':Number(_0x4bff29['id'])});}});}})[_0xc87b('0x9')](function(){if(_0x42d099===_0xc87b('0x4b')){var _0x5f4553=_[_0xc87b('0x12')](_0x4bff29[_0xc87b('0x25')],'id');return _0x4bff29[_0xc87b('0x57')](_0x5f4553)[_0xc87b('0x9')](function(){for(var _0x5337c9=0x0;_0x5337c9<_0x5f4553[_0xc87b('0x1b')];_0x5337c9+=0x1){_0x147731['emit'](_0xc87b('0x58'),{'WhatsappInteractionId':Number(_0x5f4553[_0x5337c9]),'UserId':Number(_0x4bff29['id'])});}});}})[_0xc87b('0x59')](function(_0xaf8206){_0x3c6d50['log'](_0xaf8206);});}}function onDisconnect(_0x3a7e5b,_0x1900c9){joinOrLeave(_0x3a7e5b,_0xc87b('0x4b'),_0x1900c9);}function onConnect(_0x438abe){joinOrLeave(_0x438abe,_0xc87b('0x5a'));}exports[_0xc87b('0x5b')]=function(_0x342f05){_0x342f05['on'](_0xc87b('0x5c'),function(_0x1c0807){_0x1c0807[_0xc87b('0x5d')](0x0);_0x1c0807[_0xc87b('0x5e')]=_0x1c0807[_0xc87b('0x5f')][_0xc87b('0x5c')]['remoteAddress']+':'+_0x1c0807['request'][_0xc87b('0x5c')][_0xc87b('0x60')];_0x1c0807[_0xc87b('0x61')]=new Date();_0x1c0807[_0xc87b('0x62')]=function(_0x58a215){console[_0xc87b('0x62')](_0xc87b('0x63')+_0x1c0807['nsp'][_0xc87b('0x4')]+'['+_0x1c0807[_0xc87b('0x5e')]+']',_0x58a215);};_0x1c0807['on'](_0xc87b('0x64'),function(){onDisconnect(_0x1c0807,_0x342f05);_0x1c0807[_0xc87b('0x62')](_0xc87b('0x65'));});onConnect(_0x1c0807);_0x1c0807[_0xc87b('0x62')](_0xc87b('0x66'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index de2036f..efa5f81 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 _0x57ec=['FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','info','Trigger,\x20%s','code','error','catch','channel','resolve','ContactId','sequelize','query','QueryTypes','SELECT','contact','UserId','undefined','SIP/%s','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','get','motionChannel','event','offlineMessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','AfterCreate','changed','closed','substatus','Sequelize','interface','find','fullname','internal','length','model','hook','callback','toLowerCase','condition','util','jayson/promise','../logger','triggers','client','http','Chat','afterCreate','newinteraction','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','ChatOfflineMessage','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x57ec,0x1a6));var _0xc57e=function(_0x54a9e3,_0x4a3813){_0x54a9e3=_0x54a9e3-0x0;var _0x247cce=_0x57ec[_0x54a9e3];return _0x247cce;};'use strict';var util=require(_0xc57e('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xc57e('0x1'));var logger=require(_0xc57e('0x2'))(_0xc57e('0x3'));var client=jayson[_0xc57e('0x4')][_0xc57e('0x5')]({'port':0x232a});var triggers=[{'channel':_0xc57e('0x6'),'model':'ChatInteraction','event':_0xc57e('0x7'),'condition':_0xc57e('0x8'),'callback':afterCreate},{'channel':_0xc57e('0x6'),'model':_0xc57e('0x9'),'event':_0xc57e('0xa'),'condition':_0xc57e('0xb'),'callback':afterUpdate},{'channel':'Chat','model':_0xc57e('0xc'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xc57e('0x6'),'model':_0xc57e('0xd'),'event':_0xc57e('0x7'),'condition':_0xc57e('0xe'),'callback':afterCreateOfflineMessage},{'channel':_0xc57e('0xf'),'model':'SmsInteraction','event':_0xc57e('0x7'),'condition':_0xc57e('0x8'),'callback':afterCreate},{'channel':_0xc57e('0xf'),'model':_0xc57e('0x10'),'event':_0xc57e('0xa'),'condition':_0xc57e('0xb'),'callback':afterUpdate},{'channel':'Sms','model':_0xc57e('0x11'),'event':_0xc57e('0x7'),'condition':_0xc57e('0xe'),'callback':afterCreateMessage},{'channel':_0xc57e('0x12'),'model':_0xc57e('0x13'),'event':_0xc57e('0x7'),'condition':_0xc57e('0x8'),'callback':afterCreate},{'channel':_0xc57e('0x12'),'model':_0xc57e('0x13'),'event':_0xc57e('0xa'),'condition':_0xc57e('0xb'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0xc57e('0x14'),'event':_0xc57e('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xc57e('0x15'),'model':_0xc57e('0x16'),'event':_0xc57e('0x7'),'condition':_0xc57e('0x8'),'callback':afterCreate},{'channel':'Fax','model':_0xc57e('0x16'),'event':'afterUpdate','condition':_0xc57e('0xb'),'callback':afterUpdate},{'channel':_0xc57e('0x15'),'model':_0xc57e('0x17'),'event':_0xc57e('0x7'),'condition':_0xc57e('0xe'),'callback':afterCreateMessage},{'channel':_0xc57e('0x18'),'model':_0xc57e('0x19'),'event':'afterCreate','condition':_0xc57e('0x8'),'callback':afterCreate},{'channel':'Mail','model':_0xc57e('0x19'),'event':_0xc57e('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xc57e('0x18'),'model':_0xc57e('0x1a'),'event':_0xc57e('0x7'),'condition':_0xc57e('0xe'),'callback':afterCreateMessage},{'channel':_0xc57e('0x1b'),'model':_0xc57e('0x1c'),'event':'afterCreate','condition':_0xc57e('0x8'),'callback':afterCreate},{'channel':'Openchannel','model':_0xc57e('0x1c'),'event':'afterUpdate','condition':_0xc57e('0xb'),'callback':afterUpdate},{'channel':_0xc57e('0x1b'),'model':'OpenchannelMessage','event':_0xc57e('0x7'),'condition':_0xc57e('0xe'),'callback':afterCreateMessage}];function request(_0xb14fe){return client[_0xc57e('0x1d')](_0xc57e('0x1e'),_0xb14fe)[_0xc57e('0x1f')](function(_0x1b8f7f){logger[_0xc57e('0x20')](_0xc57e('0x21'),_0xc57e('0x1e'),_0x1b8f7f);if(_0x1b8f7f['error']){if(_0x1b8f7f['error'][_0xc57e('0x22')]===0x1f4){logger['error'](_0xc57e('0x21'),'EventManager',_0x1b8f7f[_0xc57e('0x23')]);}}})[_0xc57e('0x24')](function(_0x1b8bc1){logger[_0xc57e('0x23')](_0xc57e('0x21'),'EventManager',_0x1b8bc1);});}function afterCreateMessage(_0x483077){return function(_0x38f10e){_0x38f10e=_0x38f10e['get']({'plain':!![]});_0x38f10e[_0xc57e('0x25')]=_0x483077;_0x38f10e['motionChannel']=_0x483077;_0x38f10e['event']=_0x38f10e['direction'];Promise[_0xc57e('0x26')]()[_0xc57e('0x1f')](function(){if(typeof _0x38f10e[_0xc57e('0x27')]==='undefined')return null;var _0x143742='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x38f10e[_0xc57e('0x27')];return db[_0xc57e('0x28')][_0xc57e('0x29')](_0x143742,{'type':db['Sequelize'][_0xc57e('0x2a')][_0xc57e('0x2b')],'raw':!![]});})['then'](function(_0xc8375){if(_0xc8375){_0x38f10e[_0xc57e('0x2c')]=_0xc8375[0x0];}if(typeof _0x38f10e[_0xc57e('0x2d')]===_0xc57e('0x2e'))return;return getAgent(_0x38f10e[_0xc57e('0x2d')]);})[_0xc57e('0x1f')](function(_0x5c0a5d){if(_0x5c0a5d){_0x38f10e['interface']=util['format'](_0xc57e('0x2f'),_0x5c0a5d[_0xc57e('0x30')]);_0x38f10e[_0xc57e('0x31')]=_0x5c0a5d;_0x38f10e[_0xc57e('0x25')]=_0x483077;return request({'event':_0xc57e('0x32'),'message':_0x38f10e});}else{return request({'event':_0xc57e('0x33'),'message':_0x38f10e});}})[_0xc57e('0x24')](function(_0x3fe539){logger[_0xc57e('0x23')](_0xc57e('0x21'),_0xc57e('0x34'),_0x3fe539);});};}function afterCreateOfflineMessage(_0x4395f2){return function(_0x1db4c3){_0x1db4c3=_0x1db4c3[_0xc57e('0x35')]({'plain':!![]});_0x1db4c3[_0xc57e('0x25')]=_0x4395f2;_0x1db4c3[_0xc57e('0x36')]=_0x4395f2;_0x1db4c3[_0xc57e('0x37')]=_0xc57e('0x38');return request({'event':_0x1db4c3[_0xc57e('0x37')],'message':_0x1db4c3});};}function afterCreate(_0x2444e5,_0x4c16d8){return function(_0x49eb25){_0x49eb25=_0x49eb25[_0xc57e('0x35')]({'plain':!![]});_0x49eb25[_0xc57e('0x25')]=_0x2444e5;_0x49eb25[_0xc57e('0x36')]=_0x2444e5;_0x49eb25[_0xc57e('0x37')]=_0xc57e('0x39');Promise[_0xc57e('0x26')]()[_0xc57e('0x1f')](function(){var _0x5d22a4=_0xc57e('0x3a')+_0x49eb25[_0xc57e('0x27')];return db[_0xc57e('0x28')][_0xc57e('0x29')](_0x5d22a4,{'type':db['Sequelize']['QueryTypes'][_0xc57e('0x2b')],'raw':!![]});})['then'](function(_0x413ec6){if(_0x413ec6){_0x49eb25['contact']=_0x413ec6[0x0];}if(typeof _0x49eb25['UserId']===_0xc57e('0x2e'))return;return getAgent(_0x49eb25[_0xc57e('0x2d')]);})[_0xc57e('0x1f')](function(_0x2531ef){if(_0x2531ef){_0x49eb25['interface']=util['format'](_0xc57e('0x2f'),_0x2531ef[_0xc57e('0x30')]);_0x49eb25[_0xc57e('0x31')]=_0x2531ef;}return request({'event':_0x4c16d8,'message':_0x49eb25});})['catch'](function(_0x156d0e){logger[_0xc57e('0x23')]('Trigger,\x20%s',_0xc57e('0x3b'),_0x156d0e);});};}function afterUpdate(_0x529118){return function(_0xabea61){var _0x220a80=_0xabea61[_0xc57e('0x3c')]('closed')&&_0xabea61[_0xc57e('0x3d')];var _0x476f78=_0xabea61['changed'](_0xc57e('0x3e'));if(_0x220a80||_0x476f78){var _0x44b4b8=_0x220a80?_0xc57e('0xb'):_0xc57e('0x3e');var _0x5ef869=_0xabea61['get']({'plain':!![]});_0x5ef869['channel']=_0x529118;_0x5ef869[_0xc57e('0x36')]=_0x529118;_0x5ef869[_0xc57e('0x37')]=_0x220a80?_0xc57e('0x3d'):_0xc57e('0x3e');var _0x2545f1=_0xc57e('0x3a')+_0x5ef869[_0xc57e('0x27')];return db[_0xc57e('0x28')]['query'](_0x2545f1,{'type':db[_0xc57e('0x3f')][_0xc57e('0x2a')][_0xc57e('0x2b')],'raw':!![]})[_0xc57e('0x1f')](function(_0x1e9db0){if(_0x1e9db0){_0x5ef869[_0xc57e('0x2c')]=_0x1e9db0[0x0];}if(typeof _0x5ef869[_0xc57e('0x2d')]===_0xc57e('0x2e'))return;return getAgent(_0x5ef869[_0xc57e('0x2d')]);})[_0xc57e('0x1f')](function(_0x213c7b){if(_0x213c7b){_0x5ef869[_0xc57e('0x40')]=util['format'](_0xc57e('0x2f'),_0x213c7b[_0xc57e('0x30')]);_0x5ef869[_0xc57e('0x31')]=_0x213c7b;}return request({'event':_0x44b4b8,'message':_0x5ef869});})[_0xc57e('0x24')](function(_0x2a86a7){logger['error'](_0xc57e('0x21'),'AfterUpdate',_0x2a86a7);});}};}function getAgent(_0xb9c9fc){return db['User'][_0xc57e('0x41')]({'where':{'id':_0xb9c9fc},'attributes':['id','name',_0xc57e('0x42'),'email',_0xc57e('0x43')],'raw':!![]})[_0xc57e('0x1f')](function(_0x46c322){return _0x46c322;});}exports['default']=function(){for(var _0x2d732d=0x0;_0x2d732d=_0x19a1d9[_0x746f('0x15')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x10af9d(_0x228917);})[_0x746f('0x16')](function(_0x341c54){_0x14a96d(_0x341c54);});});}; \ No newline at end of file +var _0xdeea=['count','agent','then','agents','catch','bluebird','../mysqldb','./license/util','chat','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','User'];(function(_0xab3ed0,_0x21c26e){var _0x1af3a0=function(_0xc5e810){while(--_0xc5e810){_0xab3ed0['push'](_0xab3ed0['shift']());}};_0x1af3a0(++_0x21c26e);}(_0xdeea,0xd4));var _0xadee=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0xdeea[_0x1f36bb];return _0xaf97fa;};'use strict';var _=require('lodash');var BPromise=require(_0xadee('0x0'));var db=require(_0xadee('0x1'))['db'];var util=require(_0xadee('0x2'));var channels=['voice','mail',_0xadee('0x3'),_0xadee('0x4'),_0xadee('0x5'),_0xadee('0x6'),_0xadee('0x7')];exports[_0xadee('0x8')]=function(){return channels;};exports[_0xadee('0x9')]=function(_0x54ec91){_0x54ec91=_0x54ec91[_0xadee('0xa')]();return _[_0xadee('0xb')](channels,_0x54ec91);};exports[_0xadee('0xc')]=function(_0x318bfd,_0x538691,_0x510dd6,_0x12ec42){var _0x2e81d6={'loginAttempts':_0x538691,'blocked':_0x510dd6};if(!_[_0xadee('0xd')](_0x12ec42)){_0x2e81d6[_0xadee('0xe')]=_0x12ec42;}return _0x318bfd[_0xadee('0xf')](_0x2e81d6);};exports[_0xadee('0x10')]=function(_0x3726c4){return new BPromise(function(_0x3518b4,_0x25be53){var _0x43206e=0x0;if(_0x3726c4['role']!=='agent'){_0x3518b4(_0x3726c4);}db[_0xadee('0x11')][_0xadee('0x12')]({'where':{'role':_0xadee('0x13'),'online':!![],'id':{'$ne':_0x3726c4['id']}}})[_0xadee('0x14')](function(_0x583012){_0x43206e=_0x583012;return util[_0xadee('0x10')]();})[_0xadee('0x14')](function(_0x50fec1){if(_0x50fec1&&_0x50fec1[_0xadee('0x15')]&&_0x43206e>=_0x50fec1[_0xadee('0x15')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x3518b4(_0x3726c4);})[_0xadee('0x16')](function(_0x5830c3){_0x25be53(_0x5830c3);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 3651701..c813fb3 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error','statusMessage','status','send','exports','../config/logger','message','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found'];(function(_0x455582,_0xe40e92){var _0x4048ff=function(_0x55f96b){while(--_0x55f96b){_0x455582['push'](_0x455582['shift']());}};_0x4048ff(++_0xe40e92);}(_0xadb5,0xad));var _0x5adb=function(_0x380e59,_0x552b46){_0x380e59=_0x380e59-0x0;var _0x477163=_0xadb5[_0x380e59];return _0x477163;};'use strict';var util=require('util');var logger=require(_0x5adb('0x0'))('api');var APIError=function(_0x3d6340,_0x38f67f){this[_0x5adb('0x1')]=_0x3d6340||'Internal\x20Server\x20Error';this[_0x5adb('0x2')]=_0x38f67f||_0x5adb('0x3');util[_0x5adb('0x4')](APIError,Error);};var APIBadRequestError=function(_0x4cb1d1){this[_0x5adb('0x1')]=_0x4cb1d1||_0x5adb('0x5');this[_0x5adb('0x2')]=_0x5adb('0x5');util[_0x5adb('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x353885){this[_0x5adb('0x1')]=_0x353885||_0x5adb('0x6');this[_0x5adb('0x2')]=_0x5adb('0x7');util[_0x5adb('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x336bad){this[_0x5adb('0x1')]=_0x336bad||_0x5adb('0x8');this['name']='Out\x20Of\x20Interval';util[_0x5adb('0x4')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x1ea238){switch(_0x1ea238){case _0x5adb('0x5'):return 0x190;case'Forbidden',_0x5adb('0x9'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x2a0b70){if(_0x2a0b70==='Out\x20Of\x20Interval')return _0x2a0b70;return null;}function handleError(_0x8cfcc6){return function(_0x39a0b3){logger[_0x5adb('0xa')](_0x39a0b3['stack']);var _0x2a545b=getStatusCode(_0x39a0b3[_0x5adb('0x2')]);var _0xf82f72=getCustomStatusMessage(_0x39a0b3['name']);if(_0x39a0b3[_0x5adb('0x2')])delete _0x39a0b3['name'];if(_0xf82f72)_0x8cfcc6[_0x5adb('0xb')]=_0xf82f72;return _0x8cfcc6[_0x5adb('0xc')](_0x2a545b)[_0x5adb('0xd')](_0x39a0b3);};}module[_0x5adb('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xc4aa=['stack','statusMessage','status','exports','util','../config/logger','api','message','inherits','Bad\x20Request','name','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error'];(function(_0x492b00,_0x5a84b8){var _0x10289d=function(_0x1c47ff){while(--_0x1c47ff){_0x492b00['push'](_0x492b00['shift']());}};_0x10289d(++_0x5a84b8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xc4aa[_0x4d613c];return _0x301fe3;};'use strict';var util=require(_0xac4a('0x0'));var logger=require(_0xac4a('0x1'))(_0xac4a('0x2'));var APIError=function(_0x351dd5,_0x275161){this[_0xac4a('0x3')]=_0x351dd5||'Internal\x20Server\x20Error';this['name']=_0x275161||'Error';util[_0xac4a('0x4')](APIError,Error);};var APIBadRequestError=function(_0x15b967){this[_0xac4a('0x3')]=_0x15b967||_0xac4a('0x5');this[_0xac4a('0x6')]=_0xac4a('0x5');util[_0xac4a('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x10525b){this['message']=_0x10525b||'Entity\x20not\x20found';this[_0xac4a('0x6')]=_0xac4a('0x7');util[_0xac4a('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x4f4146){this[_0xac4a('0x3')]=_0x4f4146||_0xac4a('0x8');this[_0xac4a('0x6')]='Out\x20Of\x20Interval';util[_0xac4a('0x4')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x488e3c){switch(_0x488e3c){case _0xac4a('0x5'):return 0x190;case'Forbidden',_0xac4a('0x9'):return 0x193;case _0xac4a('0x7'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x24291d){if(_0x24291d==='Out\x20Of\x20Interval')return _0x24291d;return null;}function handleError(_0x21a79){return function(_0x68424a){logger[_0xac4a('0xa')](_0x68424a[_0xac4a('0xb')]);var _0x1b4313=getStatusCode(_0x68424a[_0xac4a('0x6')]);var _0x34bc01=getCustomStatusMessage(_0x68424a[_0xac4a('0x6')]);if(_0x68424a[_0xac4a('0x6')])delete _0x68424a[_0xac4a('0x6')];if(_0x34bc01)_0x21a79[_0xac4a('0xc')]=_0x34bc01;return _0x21a79[_0xac4a('0xd')](_0x1b4313)['send'](_0x68424a);};}module[_0xac4a('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 2d318ea..659eb11 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4809=['exports','status','render','send'];(function(_0x123f0b,_0x30123a){var _0x441a2a=function(_0xf33b67){while(--_0xf33b67){_0x123f0b['push'](_0x123f0b['shift']());}};_0x441a2a(++_0x30123a);}(_0x4809,0x1e0));var _0x9480=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0x4809[_0xd22d95];return _0x15d7a3;};'use strict';module[_0x9480('0x0')][0x194]=function pageNotFound(_0x26ea43,_0x1cfdb1){var _0x1e16f3='404';var _0x51883d=0x194;var _0x2987c3={'status':_0x51883d};_0x1cfdb1[_0x9480('0x1')](_0x2987c3['status']);_0x1cfdb1[_0x9480('0x2')](_0x1e16f3,{},function(_0x5e93a6,_0x1e9807){if(_0x5e93a6){return _0x1cfdb1[_0x9480('0x1')](_0x2987c3['status'])['json'](_0x2987c3);}_0x1cfdb1[_0x9480('0x3')](_0x1e9807);});}; \ No newline at end of file +var _0x867d=['status','render','json','404'];(function(_0xa45c07,_0x3b5dec){var _0x3ca164=function(_0x4891e2){while(--_0x4891e2){_0xa45c07['push'](_0xa45c07['shift']());}};_0x3ca164(++_0x3b5dec);}(_0x867d,0x147));var _0xd867=function(_0x514bbc,_0x2b4631){_0x514bbc=_0x514bbc-0x0;var _0x434fed=_0x867d[_0x514bbc];return _0x434fed;};'use strict';module['exports'][0x194]=function pageNotFound(_0xf46b8,_0x4ef153){var _0x465592=_0xd867('0x0');var _0x5853d7=0x194;var _0x2ae911={'status':_0x5853d7};_0x4ef153[_0xd867('0x1')](_0x2ae911[_0xd867('0x1')]);_0x4ef153[_0xd867('0x2')](_0x465592,{},function(_0x36260c,_0x3761a6){if(_0x36260c){return _0x4ef153[_0xd867('0x1')](_0x2ae911[_0xd867('0x1')])[_0xd867('0x3')](_0x2ae911);}_0x4ef153['send'](_0x3761a6);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 6f98aa8..135e685 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../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','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','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','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x398294,_0x5ceb9d){var _0x2a872d=function(_0x390883){while(--_0x390883){_0x398294['push'](_0x398294['shift']());}};_0x2a872d(++_0x5ceb9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=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/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=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/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=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/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=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['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.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['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.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['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.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/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=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('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../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','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','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','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x200aa5,_0x197802){var _0x458200=function(_0x594959){while(--_0x594959){_0x200aa5['push'](_0x200aa5['shift']());}};_0x458200(++_0x197802);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=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/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=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/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=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/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=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['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.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['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.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['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.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/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=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('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 8f22520..c55a481 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22fb=['/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','./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/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','./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/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','/api/userProfile/sections','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','/api/logs','/apidoc','static','join','/www','root','/demo','/snippet','/plugins','/server/files/plugins','route','get','sendFile','resolve','/index.html','./errors','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/sms/accounts','./api/smsAccount','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/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/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','/api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','/api/templates','./api/template','./api/trigger','/api/variables'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x22fb,0x192));var _0xb22f=function(_0x4d6eaf,_0x291ed7){_0x4d6eaf=_0x4d6eaf-0x0;var _0x4fbf1a=_0x22fb[_0x4d6eaf];return _0x4fbf1a;};'use strict';var path=require('path');var express=require('express');var errors=require(_0xb22f('0x0'));var config=require('./config/environment');var setupLoggers=require(_0xb22f('0x1'))[_0xb22f('0x2')];var clientSideLogs=require(_0xb22f('0x3'));exports[_0xb22f('0x4')]=function(_0x201512){return setupLoggers(_0x201512)['then'](function(){_0x201512[_0xb22f('0x5')](_0xb22f('0x6'),require(_0xb22f('0x7')));_0x201512[_0xb22f('0x5')](_0xb22f('0x8'),require(_0xb22f('0x9')));_0x201512['use'](_0xb22f('0xa'),require(_0xb22f('0xb')));_0x201512[_0xb22f('0x5')](_0xb22f('0xc'),require(_0xb22f('0xd')));_0x201512[_0xb22f('0x5')](_0xb22f('0xe'),require(_0xb22f('0xf')));_0x201512[_0xb22f('0x5')](_0xb22f('0x10'),require(_0xb22f('0x11')));_0x201512['use']('/api/voice/recordings',require('./api/voiceRecording'));_0x201512[_0xb22f('0x5')]('/api/screen/recordings',require('./api/screenRecording'));_0x201512['use'](_0xb22f('0x12'),require(_0xb22f('0x13')));_0x201512[_0xb22f('0x5')](_0xb22f('0x14'),require(_0xb22f('0x15')));_0x201512[_0xb22f('0x5')]('/api/voice/calls/reports',require(_0xb22f('0x16')));_0x201512['use'](_0xb22f('0x17'),require('./api/voiceDialReport'));_0x201512[_0xb22f('0x5')](_0xb22f('0x18'),require(_0xb22f('0x19')));_0x201512[_0xb22f('0x5')](_0xb22f('0x1a'),require('./api/voiceQueueReport'));_0x201512[_0xb22f('0x5')]('/api/members/reports',require(_0xb22f('0x1b')));_0x201512[_0xb22f('0x5')](_0xb22f('0x1c'),require(_0xb22f('0x1d')));_0x201512[_0xb22f('0x5')](_0xb22f('0x1e'),require('./api/voiceTransferReport'));_0x201512[_0xb22f('0x5')]('/api/mail/out_servers',require(_0xb22f('0x1f')));_0x201512[_0xb22f('0x5')](_0xb22f('0x20'),require(_0xb22f('0x21')));_0x201512[_0xb22f('0x5')]('/api/mail/queues',require('./api/mailQueue'));_0x201512[_0xb22f('0x5')](_0xb22f('0x22'),require(_0xb22f('0x23')));_0x201512[_0xb22f('0x5')](_0xb22f('0x24'),require(_0xb22f('0x25')));_0x201512[_0xb22f('0x5')](_0xb22f('0x26'),require('./api/mailMessage'));_0x201512['use'](_0xb22f('0x27'),require(_0xb22f('0x28')));_0x201512['use'](_0xb22f('0x29'),require(_0xb22f('0x2a')));_0x201512['use'](_0xb22f('0x2b'),require(_0xb22f('0x2c')));_0x201512['use'](_0xb22f('0x2d'),require(_0xb22f('0x2e')));_0x201512[_0xb22f('0x5')](_0xb22f('0x2f'),require(_0xb22f('0x30')));_0x201512[_0xb22f('0x5')](_0xb22f('0x31'),require(_0xb22f('0x32')));_0x201512['use']('/api/fax/interactions',require('./api/faxInteraction'));_0x201512[_0xb22f('0x5')]('/api/fax/messages',require(_0xb22f('0x33')));_0x201512[_0xb22f('0x5')](_0xb22f('0x34'),require(_0xb22f('0x35')));_0x201512[_0xb22f('0x5')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x201512[_0xb22f('0x5')](_0xb22f('0x36'),require(_0xb22f('0x37')));_0x201512[_0xb22f('0x5')]('/api/sms/applications',require(_0xb22f('0x38')));_0x201512[_0xb22f('0x5')]('/api/sms/interactions',require(_0xb22f('0x39')));_0x201512[_0xb22f('0x5')](_0xb22f('0x3a'),require(_0xb22f('0x3b')));_0x201512[_0xb22f('0x5')]('/api/sms/queues',require('./api/smsQueue'));_0x201512[_0xb22f('0x5')](_0xb22f('0x3c'),require(_0xb22f('0x3d')));_0x201512[_0xb22f('0x5')](_0xb22f('0x3e'),require(_0xb22f('0x3f')));_0x201512[_0xb22f('0x5')](_0xb22f('0x40'),require(_0xb22f('0x41')));_0x201512['use'](_0xb22f('0x42'),require('./api/openchannelMessage'));_0x201512['use'](_0xb22f('0x43'),require(_0xb22f('0x44')));_0x201512[_0xb22f('0x5')](_0xb22f('0x45'),require(_0xb22f('0x46')));_0x201512[_0xb22f('0x5')](_0xb22f('0x47'),require(_0xb22f('0x48')));_0x201512[_0xb22f('0x5')](_0xb22f('0x49'),require(_0xb22f('0x4a')));_0x201512[_0xb22f('0x5')](_0xb22f('0x4b'),require('./api/chatInteraction'));_0x201512['use'](_0xb22f('0x4c'),require(_0xb22f('0x4d')));_0x201512[_0xb22f('0x5')]('/api/chat/offline_messages',require(_0xb22f('0x4e')));_0x201512[_0xb22f('0x5')]('/api/chat/queues',require('./api/chatQueue'));_0x201512[_0xb22f('0x5')]('/api/chat/groups',require(_0xb22f('0x4f')));_0x201512['use'](_0xb22f('0x50'),require(_0xb22f('0x51')));_0x201512[_0xb22f('0x5')]('/api/cm/companies',require(_0xb22f('0x52')));_0x201512[_0xb22f('0x5')](_0xb22f('0x53'),require('./api/cmContact'));_0x201512[_0xb22f('0x5')](_0xb22f('0x54'),require(_0xb22f('0x55')));_0x201512[_0xb22f('0x5')](_0xb22f('0x56'),require(_0xb22f('0x57')));_0x201512[_0xb22f('0x5')](_0xb22f('0x58'),require(_0xb22f('0x59')));_0x201512[_0xb22f('0x5')]('/api/cm/hopper_history',require(_0xb22f('0x5a')));_0x201512[_0xb22f('0x5')]('/api/cm/custom_fields',require(_0xb22f('0x5b')));_0x201512['use']('/api/actions',require(_0xb22f('0x5c')));_0x201512[_0xb22f('0x5')](_0xb22f('0x5d'),require(_0xb22f('0x5e')));_0x201512['use'](_0xb22f('0x5f'),require('./api/cannedAnswer'));_0x201512[_0xb22f('0x5')](_0xb22f('0x60'),require(_0xb22f('0x61')));_0x201512[_0xb22f('0x5')](_0xb22f('0x62'),require(_0xb22f('0x63')));_0x201512['use'](_0xb22f('0x64'),require('./api/interval'));_0x201512[_0xb22f('0x5')](_0xb22f('0x65'),require('./api/pause'));_0x201512[_0xb22f('0x5')](_0xb22f('0x66'),require('./api/cdr'));_0x201512['use'](_0xb22f('0x67'),require('./api/voiceQueuesLog'));_0x201512[_0xb22f('0x5')](_0xb22f('0x68'),require(_0xb22f('0x69')));_0x201512[_0xb22f('0x5')]('/api/sounds',require(_0xb22f('0x6a')));_0x201512[_0xb22f('0x5')]('/api/tags',require(_0xb22f('0x6b')));_0x201512[_0xb22f('0x5')](_0xb22f('0x6c'),require(_0xb22f('0x6d')));_0x201512[_0xb22f('0x5')]('/api/cm_contact_has_items',require(_0xb22f('0x6e')));_0x201512['use']('/api/cm_hopper_additional_phones',require(_0xb22f('0x6f')));_0x201512[_0xb22f('0x5')](_0xb22f('0x70'),require(_0xb22f('0x71')));_0x201512[_0xb22f('0x5')]('/api/triggers',require(_0xb22f('0x72')));_0x201512['use'](_0xb22f('0x73'),require('./api/variable'));_0x201512[_0xb22f('0x5')](_0xb22f('0x74'),require(_0xb22f('0x75')));_0x201512['use'](_0xb22f('0x76'),require(_0xb22f('0x77')));_0x201512['use'](_0xb22f('0x78'),require(_0xb22f('0x79')));_0x201512['use']('/api/analytics/default_reports',require(_0xb22f('0x7a')));_0x201512[_0xb22f('0x5')]('/api/analytics/extracted_reports',require(_0xb22f('0x7b')));_0x201512[_0xb22f('0x5')]('/api/analytics/metrics',require('./api/analyticMetric'));_0x201512[_0xb22f('0x5')](_0xb22f('0x7c'),require('./api/analyticFieldReport'));_0x201512[_0xb22f('0x5')](_0xb22f('0x7d'),require(_0xb22f('0x7e')));_0x201512[_0xb22f('0x5')]('/api/integrations/salesforce/accounts',require(_0xb22f('0x7f')));_0x201512[_0xb22f('0x5')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x201512[_0xb22f('0x5')](_0xb22f('0x80'),require(_0xb22f('0x81')));_0x201512[_0xb22f('0x5')]('/api/integrations/sugarcrm/accounts',require(_0xb22f('0x82')));_0x201512[_0xb22f('0x5')]('/api/integrations/sugarcrm/configurations',require(_0xb22f('0x83')));_0x201512[_0xb22f('0x5')](_0xb22f('0x84'),require(_0xb22f('0x85')));_0x201512[_0xb22f('0x5')](_0xb22f('0x86'),require(_0xb22f('0x87')));_0x201512['use'](_0xb22f('0x88'),require(_0xb22f('0x89')));_0x201512[_0xb22f('0x5')](_0xb22f('0x8a'),require(_0xb22f('0x8b')));_0x201512['use']('/api/integrations/zoho/accounts',require(_0xb22f('0x8c')));_0x201512[_0xb22f('0x5')](_0xb22f('0x8d'),require('./api/intZohoConfiguration'));_0x201512[_0xb22f('0x5')](_0xb22f('0x8e'),require(_0xb22f('0x8f')));_0x201512[_0xb22f('0x5')](_0xb22f('0x90'),require(_0xb22f('0x91')));_0x201512[_0xb22f('0x5')](_0xb22f('0x92'),require('./api/intZendeskConfiguration'));_0x201512['use'](_0xb22f('0x93'),require(_0xb22f('0x94')));_0x201512['use']('/api/integrations/freshdesk/accounts',require(_0xb22f('0x95')));_0x201512[_0xb22f('0x5')]('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x201512[_0xb22f('0x5')]('/api/integrations/freshdesk/fields',require(_0xb22f('0x96')));_0x201512[_0xb22f('0x5')](_0xb22f('0x97'),require('./api/intVtigerAccount'));_0x201512['use'](_0xb22f('0x98'),require('./api/intVtigerConfiguration'));_0x201512[_0xb22f('0x5')](_0xb22f('0x99'),require(_0xb22f('0x9a')));_0x201512['use']('/api/integrations/servicenow/accounts',require(_0xb22f('0x9b')));_0x201512['use'](_0xb22f('0x9c'),require(_0xb22f('0x9d')));_0x201512[_0xb22f('0x5')]('/api/integrations/servicenow/fields',require(_0xb22f('0x9e')));_0x201512['use'](_0xb22f('0x9f'),require(_0xb22f('0xa0')));_0x201512[_0xb22f('0x5')](_0xb22f('0xa1'),require(_0xb22f('0xa2')));_0x201512[_0xb22f('0x5')](_0xb22f('0xa3'),require(_0xb22f('0xa4')));_0x201512[_0xb22f('0x5')]('/api/integrations/freshsales/accounts',require(_0xb22f('0xa5')));_0x201512[_0xb22f('0x5')](_0xb22f('0xa6'),require('./api/intFreshsalesConfiguration'));_0x201512[_0xb22f('0x5')](_0xb22f('0xa7'),require(_0xb22f('0xa8')));_0x201512[_0xb22f('0x5')]('/api/networks',require('./api/network'));_0x201512[_0xb22f('0x5')]('/api/chat/reports/queue',require(_0xb22f('0xa9')));_0x201512[_0xb22f('0x5')](_0xb22f('0xaa'),require(_0xb22f('0xab')));_0x201512[_0xb22f('0x5')](_0xb22f('0xac'),require(_0xb22f('0xad')));_0x201512[_0xb22f('0x5')](_0xb22f('0xae'),require(_0xb22f('0xaf')));_0x201512[_0xb22f('0x5')](_0xb22f('0xb0'),require(_0xb22f('0xb1')));_0x201512['use'](_0xb22f('0xb2'),require(_0xb22f('0xb3')));_0x201512[_0xb22f('0x5')](_0xb22f('0xb4'),require(_0xb22f('0xb5')));_0x201512[_0xb22f('0x5')](_0xb22f('0xb6'),require(_0xb22f('0xb7')));_0x201512[_0xb22f('0x5')](_0xb22f('0xb8'),require(_0xb22f('0xb9')));_0x201512[_0xb22f('0x5')]('/api/settings',require('./api/setting'));_0x201512['use'](_0xb22f('0xba'),require(_0xb22f('0xbb')));_0x201512['use'](_0xb22f('0xbc'),require(_0xb22f('0xbd')));_0x201512['use'](_0xb22f('0xbe'),require(_0xb22f('0xbf')));_0x201512[_0xb22f('0x5')](_0xb22f('0xc0'),require(_0xb22f('0xc1')));_0x201512['use']('/api/teams',require('./api/team'));_0x201512[_0xb22f('0x5')](_0xb22f('0xc2'),require(_0xb22f('0xc3')));_0x201512['use'](_0xb22f('0xc4'),require(_0xb22f('0xc5')));_0x201512['use'](_0xb22f('0xc6'),require(_0xb22f('0xc7')));_0x201512[_0xb22f('0x5')](_0xb22f('0xc8'),require(_0xb22f('0xc9')));_0x201512[_0xb22f('0x5')](_0xb22f('0xca'),require(_0xb22f('0xcb')));_0x201512[_0xb22f('0x5')](_0xb22f('0xcc'),require('./api/mailTransferReport'));_0x201512[_0xb22f('0x5')](_0xb22f('0xcd'),require(_0xb22f('0xce')));_0x201512[_0xb22f('0x5')](_0xb22f('0xcf'),require(_0xb22f('0xd0')));_0x201512[_0xb22f('0x5')]('/api/openchannel/reports/transfer',require(_0xb22f('0xd1')));_0x201512[_0xb22f('0x5')](_0xb22f('0xd2'),require(_0xb22f('0xd3')));_0x201512[_0xb22f('0x5')](_0xb22f('0xd4'),require('./api/cmList'));_0x201512[_0xb22f('0x5')](_0xb22f('0xd5'),require('./api/voicePrefix'));_0x201512[_0xb22f('0x5')]('/api/userProfiles',require('./api/userProfile'));_0x201512['use'](_0xb22f('0xd6'),require('./api/userProfileSection'));_0x201512[_0xb22f('0x5')]('/api/userProfile/resources',require('./api/userProfileResource'));_0x201512[_0xb22f('0x5')](_0xb22f('0xd7'),require('./api/userNotification'));_0x201512['use'](_0xb22f('0xd8'),require(_0xb22f('0xd9')));_0x201512['use'](_0xb22f('0xda'),require('./api/whatsappApplication'));_0x201512['use'](_0xb22f('0xdb'),require(_0xb22f('0xdc')));_0x201512[_0xb22f('0x5')]('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x201512['use'](_0xb22f('0xdd'),require(_0xb22f('0xde')));_0x201512[_0xb22f('0x5')](_0xb22f('0xdf'),require('./api/whatsappTransferReport'));_0x201512[_0xb22f('0x5')](_0xb22f('0xe0'),require(_0xb22f('0xe1')));_0x201512[_0xb22f('0x5')](_0xb22f('0xe2'),require('./api/cloudProvider'));_0x201512[_0xb22f('0x5')]('/api/realtime',require('./api/realtime'));_0x201512[_0xb22f('0x5')](_0xb22f('0xe3'),require(_0xb22f('0xe4')));_0x201512['use'](_0xb22f('0xe5'),require(_0xb22f('0xe6')));_0x201512[_0xb22f('0x5')](_0xb22f('0xe7'),require(_0xb22f('0xe8')));_0x201512[_0xb22f('0x5')](_0xb22f('0xe9'),require(_0xb22f('0xea')));_0x201512[_0xb22f('0x5')](_0xb22f('0xeb'),require(_0xb22f('0xec')));_0x201512['use']('/api/rpc',require(_0xb22f('0xed')));_0x201512[_0xb22f('0x5')]('/api/version',require(_0xb22f('0xee')));_0x201512[_0xb22f('0x5')](_0xb22f('0xef'),require(_0xb22f('0xf0')));_0x201512[_0xb22f('0x5')](_0xb22f('0xf1'),require(_0xb22f('0xf2')));_0x201512[_0xb22f('0x5')]('/api/webbar',require(_0xb22f('0xf3')));_0x201512[_0xb22f('0x5')](_0xb22f('0xf4'),clientSideLogs);_0x201512['use'](_0xb22f('0xf5'),express[_0xb22f('0xf6')](path[_0xb22f('0xf7')](config['root'],_0xb22f('0xf5'))));_0x201512['use'](_0xb22f('0xf8'),express[_0xb22f('0xf6')](path[_0xb22f('0xf7')](config[_0xb22f('0xf9')],_0xb22f('0xf8'))));_0x201512[_0xb22f('0x5')](_0xb22f('0xfa'),express[_0xb22f('0xf6')](path[_0xb22f('0xf7')](config['root'],_0xb22f('0xfa'))));_0x201512[_0xb22f('0x5')](_0xb22f('0xfb'),express['static'](path[_0xb22f('0xf7')](config['root'],'snippet','3.5.0')));_0x201512[_0xb22f('0x5')](_0xb22f('0xfc'),express[_0xb22f('0xf6')](path[_0xb22f('0xf7')](config[_0xb22f('0xf9')],_0xb22f('0xfd'))));_0x201512[_0xb22f('0xfe')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xb22f('0xff')](errors[0x194]);_0x201512[_0xb22f('0xfe')]('/*')[_0xb22f('0xff')](function(_0x1fa410,_0x141fa4){_0x141fa4[_0xb22f('0x100')](path[_0xb22f('0x101')](_0x201512[_0xb22f('0xff')]('appPath')+_0xb22f('0x102')));});return _0x201512;});}; \ No newline at end of file +var _0x32c0=['./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/schedule','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/integration','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./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/intDynamics365Configuration','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./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/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','/api/sms/reports/transfer','./api/cmList','/api/userProfiles','./api/userProfile','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','./api/pm2','./api/webbar','join','root','/www','static','/demo','3.5.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','path','express','./config/environment','./utils/client-side-logger','./api/client-side-logs','default','then','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceContext','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications'];(function(_0x38cef2,_0x20dc5b){var _0x5f3a53=function(_0x37147b){while(--_0x37147b){_0x38cef2['push'](_0x38cef2['shift']());}};_0x5f3a53(++_0x20dc5b);}(_0x32c0,0x1f3));var _0x032c=function(_0x1d8880,_0x7b2a22){_0x1d8880=_0x1d8880-0x0;var _0x9eb010=_0x32c0[_0x1d8880];return _0x9eb010;};'use strict';var path=require(_0x032c('0x0'));var express=require(_0x032c('0x1'));var errors=require('./errors');var config=require(_0x032c('0x2'));var setupLoggers=require(_0x032c('0x3'))['setupLoggers'];var clientSideLogs=require(_0x032c('0x4'));exports[_0x032c('0x5')]=function(_0x283b77){return setupLoggers(_0x283b77)[_0x032c('0x6')](function(){_0x283b77['use'](_0x032c('0x7'),require(_0x032c('0x8')));_0x283b77[_0x032c('0x9')](_0x032c('0xa'),require('./api/voiceChanSpy'));_0x283b77[_0x032c('0x9')]('/api/voice/contexts',require(_0x032c('0xb')));_0x283b77[_0x032c('0x9')]('/api/voice/extensions',require('./api/voiceExtension'));_0x283b77[_0x032c('0x9')]('/api/voice/mohs',require(_0x032c('0xc')));_0x283b77['use'](_0x032c('0xd'),require(_0x032c('0xe')));_0x283b77[_0x032c('0x9')](_0x032c('0xf'),require(_0x032c('0x10')));_0x283b77[_0x032c('0x9')]('/api/screen/recordings',require(_0x032c('0x11')));_0x283b77[_0x032c('0x9')](_0x032c('0x12'),require(_0x032c('0x13')));_0x283b77['use'](_0x032c('0x14'),require(_0x032c('0x15')));_0x283b77[_0x032c('0x9')](_0x032c('0x16'),require(_0x032c('0x17')));_0x283b77[_0x032c('0x9')]('/api/voice/dials/reports',require(_0x032c('0x18')));_0x283b77[_0x032c('0x9')](_0x032c('0x19'),require(_0x032c('0x1a')));_0x283b77[_0x032c('0x9')](_0x032c('0x1b'),require('./api/voiceQueueReport'));_0x283b77[_0x032c('0x9')](_0x032c('0x1c'),require(_0x032c('0x1d')));_0x283b77[_0x032c('0x9')](_0x032c('0x1e'),require(_0x032c('0x1f')));_0x283b77[_0x032c('0x9')](_0x032c('0x20'),require(_0x032c('0x21')));_0x283b77[_0x032c('0x9')](_0x032c('0x22'),require(_0x032c('0x23')));_0x283b77[_0x032c('0x9')]('/api/mail/accounts',require(_0x032c('0x24')));_0x283b77['use']('/api/mail/queues',require('./api/mailQueue'));_0x283b77['use'](_0x032c('0x25'),require('./api/mailSubstatus'));_0x283b77[_0x032c('0x9')](_0x032c('0x26'),require(_0x032c('0x27')));_0x283b77['use'](_0x032c('0x28'),require(_0x032c('0x29')));_0x283b77[_0x032c('0x9')](_0x032c('0x2a'),require(_0x032c('0x2b')));_0x283b77[_0x032c('0x9')](_0x032c('0x2c'),require('./api/mailQueueReport'));_0x283b77[_0x032c('0x9')](_0x032c('0x2d'),require(_0x032c('0x2e')));_0x283b77['use'](_0x032c('0x2f'),require(_0x032c('0x30')));_0x283b77[_0x032c('0x9')](_0x032c('0x31'),require('./api/faxAccount'));_0x283b77[_0x032c('0x9')](_0x032c('0x32'),require(_0x032c('0x33')));_0x283b77[_0x032c('0x9')]('/api/fax/interactions',require(_0x032c('0x34')));_0x283b77[_0x032c('0x9')](_0x032c('0x35'),require(_0x032c('0x36')));_0x283b77[_0x032c('0x9')](_0x032c('0x37'),require(_0x032c('0x38')));_0x283b77['use']('/api/fax/reports/queue',require(_0x032c('0x39')));_0x283b77['use'](_0x032c('0x3a'),require(_0x032c('0x3b')));_0x283b77['use'](_0x032c('0x3c'),require(_0x032c('0x3d')));_0x283b77[_0x032c('0x9')](_0x032c('0x3e'),require('./api/smsInteraction'));_0x283b77[_0x032c('0x9')](_0x032c('0x3f'),require('./api/smsMessage'));_0x283b77[_0x032c('0x9')](_0x032c('0x40'),require(_0x032c('0x41')));_0x283b77[_0x032c('0x9')](_0x032c('0x42'),require('./api/openchannelAccount'));_0x283b77[_0x032c('0x9')]('/api/openchannel/applications',require(_0x032c('0x43')));_0x283b77['use'](_0x032c('0x44'),require(_0x032c('0x45')));_0x283b77[_0x032c('0x9')](_0x032c('0x46'),require(_0x032c('0x47')));_0x283b77[_0x032c('0x9')]('/api/openchannel/queues',require(_0x032c('0x48')));_0x283b77[_0x032c('0x9')]('/api/chat/websites',require(_0x032c('0x49')));_0x283b77[_0x032c('0x9')](_0x032c('0x4a'),require('./api/openchannelQueueReport'));_0x283b77[_0x032c('0x9')](_0x032c('0x4b'),require(_0x032c('0x4c')));_0x283b77[_0x032c('0x9')](_0x032c('0x4d'),require(_0x032c('0x4e')));_0x283b77[_0x032c('0x9')]('/api/chat/messages',require(_0x032c('0x4f')));_0x283b77[_0x032c('0x9')](_0x032c('0x50'),require(_0x032c('0x51')));_0x283b77[_0x032c('0x9')](_0x032c('0x52'),require(_0x032c('0x53')));_0x283b77[_0x032c('0x9')]('/api/chat/groups',require(_0x032c('0x54')));_0x283b77['use'](_0x032c('0x55'),require('./api/chatProactiveAction'));_0x283b77['use'](_0x032c('0x56'),require(_0x032c('0x57')));_0x283b77['use']('/api/cm/contacts',require(_0x032c('0x58')));_0x283b77['use']('/api/cm/hopper',require(_0x032c('0x59')));_0x283b77[_0x032c('0x9')](_0x032c('0x5a'),require(_0x032c('0x5b')));_0x283b77[_0x032c('0x9')](_0x032c('0x5c'),require('./api/cmHopperFinal'));_0x283b77[_0x032c('0x9')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x283b77[_0x032c('0x9')](_0x032c('0x5d'),require(_0x032c('0x5e')));_0x283b77[_0x032c('0x9')](_0x032c('0x5f'),require('./api/action'));_0x283b77['use'](_0x032c('0x60'),require('./api/automation'));_0x283b77[_0x032c('0x9')](_0x032c('0x61'),require(_0x032c('0x62')));_0x283b77[_0x032c('0x9')](_0x032c('0x63'),require(_0x032c('0x64')));_0x283b77[_0x032c('0x9')](_0x032c('0x65'),require(_0x032c('0x66')));_0x283b77['use'](_0x032c('0x67'),require('./api/interval'));_0x283b77['use'](_0x032c('0x68'),require(_0x032c('0x69')));_0x283b77[_0x032c('0x9')](_0x032c('0x6a'),require(_0x032c('0x6b')));_0x283b77['use']('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x283b77[_0x032c('0x9')]('/api/schedules',require(_0x032c('0x6c')));_0x283b77[_0x032c('0x9')]('/api/sounds',require(_0x032c('0x6d')));_0x283b77[_0x032c('0x9')](_0x032c('0x6e'),require(_0x032c('0x6f')));_0x283b77[_0x032c('0x9')](_0x032c('0x70'),require(_0x032c('0x71')));_0x283b77[_0x032c('0x9')](_0x032c('0x72'),require('./api/cmContactHasItem'));_0x283b77[_0x032c('0x9')]('/api/cm_hopper_additional_phones',require(_0x032c('0x73')));_0x283b77[_0x032c('0x9')](_0x032c('0x74'),require(_0x032c('0x75')));_0x283b77[_0x032c('0x9')](_0x032c('0x76'),require(_0x032c('0x77')));_0x283b77[_0x032c('0x9')](_0x032c('0x78'),require('./api/variable'));_0x283b77[_0x032c('0x9')]('/api/integrations',require(_0x032c('0x79')));_0x283b77[_0x032c('0x9')]('/api/integrations/reports',require(_0x032c('0x7a')));_0x283b77[_0x032c('0x9')]('/api/analytics/custom_reports',require(_0x032c('0x7b')));_0x283b77[_0x032c('0x9')](_0x032c('0x7c'),require('./api/analyticDefaultReport'));_0x283b77[_0x032c('0x9')](_0x032c('0x7d'),require(_0x032c('0x7e')));_0x283b77[_0x032c('0x9')](_0x032c('0x7f'),require(_0x032c('0x80')));_0x283b77[_0x032c('0x9')](_0x032c('0x81'),require(_0x032c('0x82')));_0x283b77[_0x032c('0x9')]('/api/analytics/tree_reports',require(_0x032c('0x83')));_0x283b77[_0x032c('0x9')](_0x032c('0x84'),require(_0x032c('0x85')));_0x283b77[_0x032c('0x9')](_0x032c('0x86'),require(_0x032c('0x87')));_0x283b77[_0x032c('0x9')]('/api/integrations/salesforce/fields',require(_0x032c('0x88')));_0x283b77[_0x032c('0x9')](_0x032c('0x89'),require(_0x032c('0x8a')));_0x283b77[_0x032c('0x9')]('/api/integrations/sugarcrm/configurations',require(_0x032c('0x8b')));_0x283b77[_0x032c('0x9')](_0x032c('0x8c'),require(_0x032c('0x8d')));_0x283b77[_0x032c('0x9')](_0x032c('0x8e'),require(_0x032c('0x8f')));_0x283b77[_0x032c('0x9')](_0x032c('0x90'),require(_0x032c('0x91')));_0x283b77[_0x032c('0x9')]('/api/integrations/desk/fields',require('./api/intDeskField'));_0x283b77[_0x032c('0x9')](_0x032c('0x92'),require(_0x032c('0x93')));_0x283b77[_0x032c('0x9')]('/api/integrations/zoho/configurations',require(_0x032c('0x94')));_0x283b77[_0x032c('0x9')](_0x032c('0x95'),require(_0x032c('0x96')));_0x283b77[_0x032c('0x9')](_0x032c('0x97'),require(_0x032c('0x98')));_0x283b77[_0x032c('0x9')](_0x032c('0x99'),require('./api/intZendeskConfiguration'));_0x283b77[_0x032c('0x9')](_0x032c('0x9a'),require(_0x032c('0x9b')));_0x283b77[_0x032c('0x9')]('/api/integrations/freshdesk/accounts',require(_0x032c('0x9c')));_0x283b77[_0x032c('0x9')](_0x032c('0x9d'),require(_0x032c('0x9e')));_0x283b77[_0x032c('0x9')]('/api/integrations/freshdesk/fields',require(_0x032c('0x9f')));_0x283b77[_0x032c('0x9')](_0x032c('0xa0'),require(_0x032c('0xa1')));_0x283b77[_0x032c('0x9')](_0x032c('0xa2'),require(_0x032c('0xa3')));_0x283b77[_0x032c('0x9')]('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x283b77[_0x032c('0x9')]('/api/integrations/servicenow/accounts',require(_0x032c('0xa4')));_0x283b77['use'](_0x032c('0xa5'),require(_0x032c('0xa6')));_0x283b77[_0x032c('0x9')](_0x032c('0xa7'),require(_0x032c('0xa8')));_0x283b77['use'](_0x032c('0xa9'),require(_0x032c('0xaa')));_0x283b77['use'](_0x032c('0xab'),require(_0x032c('0xac')));_0x283b77[_0x032c('0x9')]('/api/integrations/dynamics365/fields',require(_0x032c('0xad')));_0x283b77[_0x032c('0x9')]('/api/integrations/freshsales/accounts',require(_0x032c('0xae')));_0x283b77[_0x032c('0x9')](_0x032c('0xaf'),require(_0x032c('0xb0')));_0x283b77[_0x032c('0x9')](_0x032c('0xb1'),require('./api/intFreshsalesField'));_0x283b77[_0x032c('0x9')](_0x032c('0xb2'),require(_0x032c('0xb3')));_0x283b77[_0x032c('0x9')](_0x032c('0xb4'),require(_0x032c('0xb5')));_0x283b77[_0x032c('0x9')](_0x032c('0xb6'),require(_0x032c('0xb7')));_0x283b77['use'](_0x032c('0xb8'),require(_0x032c('0xb9')));_0x283b77[_0x032c('0x9')](_0x032c('0xba'),require(_0x032c('0xbb')));_0x283b77[_0x032c('0x9')](_0x032c('0xbc'),require(_0x032c('0xbd')));_0x283b77[_0x032c('0x9')](_0x032c('0xbe'),require(_0x032c('0xbf')));_0x283b77[_0x032c('0x9')](_0x032c('0xc0'),require(_0x032c('0xc1')));_0x283b77[_0x032c('0x9')](_0x032c('0xc2'),require(_0x032c('0xc3')));_0x283b77[_0x032c('0x9')](_0x032c('0xc4'),require('./api/jscriptyProject'));_0x283b77['use']('/api/settings',require(_0x032c('0xc5')));_0x283b77['use'](_0x032c('0xc6'),require(_0x032c('0xc7')));_0x283b77[_0x032c('0x9')]('/api/square/projects',require(_0x032c('0xc8')));_0x283b77[_0x032c('0x9')](_0x032c('0xc9'),require(_0x032c('0xca')));_0x283b77[_0x032c('0x9')](_0x032c('0xcb'),require(_0x032c('0xcc')));_0x283b77[_0x032c('0x9')]('/api/teams',require(_0x032c('0xcd')));_0x283b77['use'](_0x032c('0xce'),require(_0x032c('0xcf')));_0x283b77[_0x032c('0x9')](_0x032c('0xd0'),require(_0x032c('0xd1')));_0x283b77[_0x032c('0x9')](_0x032c('0xd2'),require('./api/migration'));_0x283b77['use'](_0x032c('0xd3'),require(_0x032c('0xd4')));_0x283b77['use'](_0x032c('0xd5'),require(_0x032c('0xd6')));_0x283b77['use'](_0x032c('0xd7'),require(_0x032c('0xd8')));_0x283b77['use']('/api/chat/reports/transfer',require(_0x032c('0xd9')));_0x283b77[_0x032c('0x9')](_0x032c('0xda'),require('./api/faxTransferReport'));_0x283b77['use']('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x283b77['use'](_0x032c('0xdb'),require('./api/smsTransferReport'));_0x283b77[_0x032c('0x9')]('/api/cm/lists',require(_0x032c('0xdc')));_0x283b77[_0x032c('0x9')]('/api/voice/prefixes',require('./api/voicePrefix'));_0x283b77[_0x032c('0x9')](_0x032c('0xdd'),require(_0x032c('0xde')));_0x283b77[_0x032c('0x9')]('/api/userProfile/sections',require(_0x032c('0xdf')));_0x283b77[_0x032c('0x9')]('/api/userProfile/resources',require(_0x032c('0xe0')));_0x283b77[_0x032c('0x9')](_0x032c('0xe1'),require(_0x032c('0xe2')));_0x283b77[_0x032c('0x9')](_0x032c('0xe3'),require(_0x032c('0xe4')));_0x283b77[_0x032c('0x9')](_0x032c('0xe5'),require(_0x032c('0xe6')));_0x283b77[_0x032c('0x9')]('/api/whatsapp/interactions',require(_0x032c('0xe7')));_0x283b77['use'](_0x032c('0xe8'),require(_0x032c('0xe9')));_0x283b77[_0x032c('0x9')]('/api/whatsapp/reports/queue',require(_0x032c('0xea')));_0x283b77['use']('/api/whatsapp/reports/transfer',require(_0x032c('0xeb')));_0x283b77[_0x032c('0x9')](_0x032c('0xec'),require(_0x032c('0xed')));_0x283b77[_0x032c('0x9')](_0x032c('0xee'),require(_0x032c('0xef')));_0x283b77[_0x032c('0x9')]('/api/realtime',require(_0x032c('0xf0')));_0x283b77[_0x032c('0x9')](_0x032c('0xf1'),require(_0x032c('0xf2')));_0x283b77['use'](_0x032c('0xf3'),require(_0x032c('0xf4')));_0x283b77[_0x032c('0x9')](_0x032c('0xf5'),require(_0x032c('0xf6')));_0x283b77[_0x032c('0x9')](_0x032c('0xf7'),require('./api/authActiveDirectory'));_0x283b77[_0x032c('0x9')](_0x032c('0xf8'),require(_0x032c('0xf9')));_0x283b77[_0x032c('0x9')](_0x032c('0xfa'),require(_0x032c('0xfb')));_0x283b77[_0x032c('0x9')]('/api/version',require(_0x032c('0xfc')));_0x283b77[_0x032c('0x9')](_0x032c('0xfd'),require(_0x032c('0xfe')));_0x283b77[_0x032c('0x9')]('/api/pm2',require(_0x032c('0xff')));_0x283b77[_0x032c('0x9')]('/api/webbar',require(_0x032c('0x100')));_0x283b77['use']('/api/logs',clientSideLogs);_0x283b77[_0x032c('0x9')]('/apidoc',express['static'](path[_0x032c('0x101')](config[_0x032c('0x102')],'/apidoc')));_0x283b77[_0x032c('0x9')](_0x032c('0x103'),express[_0x032c('0x104')](path[_0x032c('0x101')](config['root'],_0x032c('0x103'))));_0x283b77[_0x032c('0x9')](_0x032c('0x105'),express[_0x032c('0x104')](path[_0x032c('0x101')](config['root'],_0x032c('0x105'))));_0x283b77['use']('/snippet',express[_0x032c('0x104')](path[_0x032c('0x101')](config[_0x032c('0x102')],'snippet',_0x032c('0x106'))));_0x283b77[_0x032c('0x9')](_0x032c('0x107'),express[_0x032c('0x104')](path[_0x032c('0x101')](config[_0x032c('0x102')],_0x032c('0x108'))));_0x283b77[_0x032c('0x109')](_0x032c('0x10a'))['get'](errors[0x194]);_0x283b77[_0x032c('0x109')]('/*')[_0x032c('0x10b')](function(_0x4238ef,_0x2970fe){_0x2970fe[_0x032c('0x10c')](path[_0x032c('0x10d')](_0x283b77[_0x032c('0x10b')](_0x032c('0x10e'))+'/index.html'));});return _0x283b77;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index e3fd475..18bcb53 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0821=['../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.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','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.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/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc'];(function(_0x2dd92e,_0x5fb8e4){var _0x1c75e8=function(_0x229437){while(--_0x229437){_0x2dd92e['push'](_0x2dd92e['shift']());}};_0x1c75e8(++_0x5fb8e4);}(_0x0821,0x186));var _0x1082=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x0821[_0xbb091];return _0x467a04;};'use strict';var jayson=require(_0x1082('0x0'));var _=require('lodash');var config=require(_0x1082('0x1'));exports[_0x1082('0x2')]=function(){return new Promise(function(_0x2ee75a,_0x163c0d){var _0x5bcf8e={};_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require('../api/user/user.rpc'));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x4')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require('../api/voiceQueue/voiceQueue.rpc'));_0x5bcf8e=_['merge'](_0x5bcf8e,require(_0x1082('0x5')));_0x5bcf8e=_['merge'](_0x5bcf8e,require(_0x1082('0x6')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x7')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x5bcf8e=_['merge'](_0x5bcf8e,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x5bcf8e=_['merge'](_0x5bcf8e,require(_0x1082('0x8')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x9')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0xa')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0xb')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require('../api/mailServerIn/mailServerIn.rpc'));_0x5bcf8e=_['merge'](_0x5bcf8e,require(_0x1082('0xc')));_0x5bcf8e=_['merge'](_0x5bcf8e,require(_0x1082('0xd')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0xe')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require('../api/mailMessage/mailMessage.rpc'));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0xf')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x10')));_0x5bcf8e=_['merge'](_0x5bcf8e,require(_0x1082('0x11')));_0x5bcf8e=_['merge'](_0x5bcf8e,require(_0x1082('0x12')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require('../api/faxInteraction/faxInteraction.rpc'));_0x5bcf8e=_['merge'](_0x5bcf8e,require('../api/faxMessage/faxMessage.rpc'));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x13')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x14')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x15')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x16')));_0x5bcf8e=_['merge'](_0x5bcf8e,require(_0x1082('0x17')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x18')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x19')));_0x5bcf8e=_['merge'](_0x5bcf8e,require(_0x1082('0x1a')));_0x5bcf8e=_['merge'](_0x5bcf8e,require(_0x1082('0x1b')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x1c')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x1d')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x1e')));_0x5bcf8e=_['merge'](_0x5bcf8e,require('../api/chatMessage/chatMessage.rpc'));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x1f')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x20')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x21')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x22')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x23')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x24')));_0x5bcf8e=_['merge'](_0x5bcf8e,require(_0x1082('0x25')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x26')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x27')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x28')));_0x5bcf8e=_['merge'](_0x5bcf8e,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x29')));_0x5bcf8e=_['merge'](_0x5bcf8e,require(_0x1082('0x2a')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x2b')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x2c')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x2d')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x2e')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x2f')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x30')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x31')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x32')));_0x5bcf8e=_['merge'](_0x5bcf8e,require(_0x1082('0x33')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x34')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x35')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x36')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x37')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x38')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x39')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x3a')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x3b')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require('../api/attachment/attachment.rpc'));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x3c')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x3d')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x3e')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x3f')));_0x5bcf8e=_[_0x1082('0x3')](_0x5bcf8e,require(_0x1082('0x40')));_0x5bcf8e=_['merge'](_0x5bcf8e,require(_0x1082('0x41')));var _0x29c08b=jayson[_0x1082('0x42')](_0x5bcf8e)[_0x1082('0x43')]();var _0x30f483=config[_0x1082('0x44')]['port']||config['port']+0x1;var _0x237f6b=config[_0x1082('0x44')]['ip']||_0x1082('0x45');_0x29c08b['on'](_0x1082('0x46'),function(_0x516dd1){return _0x163c0d(_0x516dd1);});_0x29c08b[_0x1082('0x2')](_0x30f483,_0x237f6b,function(){console['log'](_0x1082('0x47'),_0x237f6b,_0x30f483);require('../config/triggers')['default']();return _0x2ee75a(_0x1082('0x48')+_0x237f6b+':'+_0x30f483);});});}; \ No newline at end of file +var _0x6a83=['../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.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/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','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/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc'];(function(_0x5d8631,_0x44944b){var _0x34c15e=function(_0x4448f8){while(--_0x4448f8){_0x5d8631['push'](_0x5d8631['shift']());}};_0x34c15e(++_0x44944b);}(_0x6a83,0xd2));var _0x36a8=function(_0x129b6d,_0x214a22){_0x129b6d=_0x129b6d-0x0;var _0x5ab808=_0x6a83[_0x129b6d];return _0x5ab808;};'use strict';var jayson=require(_0x36a8('0x0'));var _=require(_0x36a8('0x1'));var config=require(_0x36a8('0x2'));exports[_0x36a8('0x3')]=function(){return new Promise(function(_0x125ca1,_0x367db7){var _0x1f59f3={};_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x5')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x6')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x7')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x8')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x9')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0xa')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0xb')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0xc')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require('../api/memberReport/memberReport.rpc'));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0xd')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0xe')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0xf')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x10')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x11')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require('../api/mailQueue/mailQueue.rpc'));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x12')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x13')));_0x1f59f3=_['merge'](_0x1f59f3,require('../api/mailApplication/mailApplication.rpc'));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x14')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x15')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x16')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require('../api/faxInteraction/faxInteraction.rpc'));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x17')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require('../api/faxQueue/faxQueue.rpc'));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x18')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require('../api/smsInteraction/smsInteraction.rpc'));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x19')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0x1a')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x1b')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x1c')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x1d')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0x1e')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require('../api/chatInteraction/chatInteraction.rpc'));_0x1f59f3=_['merge'](_0x1f59f3,require('../api/chatMessage/chatMessage.rpc'));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x1f')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x20')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0x21')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0x22')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0x23')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0x24')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x25')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x26')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0x27')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x28')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0x29')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x2a')));_0x1f59f3=_['merge'](_0x1f59f3,require('../api/trigger/trigger.rpc'));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x2b')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x2c')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x2d')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0x2e')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x2f')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x30')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x31')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x32')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x33')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x34')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x35')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x36')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x37')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0x38')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0x39')));_0x1f59f3=_['merge'](_0x1f59f3,require('../api/setting/setting.rpc'));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0x3a')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0x3b')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0x3c')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x3d')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x3e')));_0x1f59f3=_['merge'](_0x1f59f3,require('../api/attachment/attachment.rpc'));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x3f')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x40')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x41')));_0x1f59f3=_[_0x36a8('0x4')](_0x1f59f3,require(_0x36a8('0x42')));_0x1f59f3=_['merge'](_0x1f59f3,require(_0x36a8('0x43')));var _0x2597fc=jayson[_0x36a8('0x44')](_0x1f59f3)[_0x36a8('0x45')]();var _0x706d00=config[_0x36a8('0x46')][_0x36a8('0x47')]||config['port']+0x1;var _0x58bde1=config['rpc']['ip']||_0x36a8('0x48');_0x2597fc['on'](_0x36a8('0x49'),function(_0x491f2d){return _0x367db7(_0x491f2d);});_0x2597fc[_0x36a8('0x3')](_0x706d00,_0x58bde1,function(){console[_0x36a8('0x4a')](_0x36a8('0x4b'),_0x58bde1,_0x706d00);require('../config/triggers')[_0x36a8('0x4c')]();return _0x125ca1(_0x36a8('0x4d')+_0x58bde1+':'+_0x706d00);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 577ff74..06b6609 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 _0xc4af=['emit','ready','line','toLowerCase','hangup','substring','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','inherits','prototype','sendRequest','sync','answer','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','continueAt','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers'];(function(_0x1f5250,_0x39ae00){var _0x53666c=function(_0x2ac949){while(--_0x2ac949){_0x1f5250['push'](_0x1f5250['shift']());}};_0x53666c(++_0x39ae00);}(_0xc4af,0x88));var _0xfc4a=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xc4af[_0x47b58b];return _0x46bebe;};'use strict';var util=require(_0xfc4a('0x0'));var _=require('lodash');var EventEmitter=require(_0xfc4a('0x1'))[_0xfc4a('0x2')];var AGIReply=require(_0xfc4a('0x3'));var AGIError=require(_0xfc4a('0x4'));function AGIChannel(_0x3589b9){var _0x52daf8=this,_0x19487f=new AGIReply(),_0x147436=![],_0xc930f0={};EventEmitter[_0xfc4a('0x5')](_0x52daf8);_0x3589b9[_0xfc4a('0x6')](_0xfc4a('0x7'));_0x3589b9[_0xfc4a('0x8')](0x8*0x3c*0x3c*0x3e8);_0x19487f[_0xfc4a('0x6')](_0xfc4a('0x7'));_0x19487f['on'](_0xfc4a('0x9'),function(_0x1979f5){for(var _0x18f5f3 in _0x1979f5){_0x52daf8[_0x18f5f3]=_0x1979f5[_0x18f5f3];}_0x52daf8[_0xfc4a('0xa')](_0xfc4a('0xb'));});_0x19487f['on'](_0xfc4a('0xc'),function(_0x28f7e3){if(_0x28f7e3[_0xfc4a('0xd')]()==_0xfc4a('0xe')){_0x52daf8[_0xfc4a('0xa')]('hangup');return;}if(_0x28f7e3[_0xfc4a('0xf')](0x0,0xb)=='520-Invalid'){_0x147436=!![];}if(_0x147436){_0xc930f0['rx']+=_0x28f7e3+'\x0a';if(_0x28f7e3['search'](_0xfc4a('0x10'))!=-0x1){_0x147436=![];}}else{_0xc930f0['rx']=_0x28f7e3;}if(_0x147436){return;}if(typeof _0xc930f0['cb']==_0xfc4a('0x11')){var _0x2c6538=_0xc930f0['rx'][_0xfc4a('0xf')](0x0,0x3),_0x58cddf=null,_0x241d50=null;_0x2c6538=parseInt(_0x2c6538);if(isNaN(_0x2c6538)){_0xc930f0['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xfc4a('0x12')});return;}if(_0x2c6538!=0xc8){_0xc930f0['cb'](null,{'code':_0x2c6538,'result':-0x1,'extra':'KO'});return;}_0x58cddf=_0xc930f0['rx'][_0xfc4a('0xf')](0x4)[_0xfc4a('0x13')]('result=','');if(_0x58cddf[_0xfc4a('0x14')]('\x20')!=-0x1){_0x58cddf=_0x58cddf[_0xfc4a('0x15')](0x0,_0x58cddf[_0xfc4a('0x14')]('\x20'));}if(_[_0xfc4a('0x16')](_0x58cddf,'-1')){_0x58cddf=parseInt(_0x58cddf);}_0x241d50=_0xc930f0['rx'][_0xfc4a('0x17')]('\x20');if(_0x241d50['length']==0x3){_0x241d50=_0x241d50[0x2]['substring'](0x1,_0x241d50[0x2]['length']-0x1);}else if(_0x241d50[_0xfc4a('0x18')]>0x3){var _0x25fcee=/\((.+)\)/;var _0x351106=_0xc930f0['rx'][_0xfc4a('0x19')](_0x25fcee);if(_0x351106){_0x241d50=_0x351106[0x1];}else{_0x241d50=null;}}else{_0x241d50=null;}_0xc930f0['cb'](null,{'code':_0x2c6538,'result':_0x58cddf,'extra':_0x241d50});}});_0x3589b9['on'](_0xfc4a('0x1a'),function(_0x2fa963){_0x52daf8[_0xfc4a('0xa')](_0xfc4a('0x1a'),new AGIError('E_AGI_SOCKET_ERROR',_0x2fa963[_0xfc4a('0x1b')]));});_0x3589b9['on'](_0xfc4a('0x1c'),function(){_0x52daf8['emit']('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x3589b9['on'](_0xfc4a('0x1d'),function(){_0x52daf8[_0xfc4a('0xa')]('timeout',new AGIError(_0xfc4a('0x1e')));_0x3589b9[_0xfc4a('0x1f')]();});_0x3589b9['pipe'](_0x19487f);this[_0xfc4a('0x20')]=function(_0x149f24,_0x178d7c){var _0x149f24=_0x149f24||'',_0x178d7c=typeof _0x178d7c==_0xfc4a('0x11')?_0x178d7c:new Function();_0xc930f0={'tx':_0x149f24,'rx':'','cb':_0x178d7c};_0x3589b9[_0xfc4a('0x21')](_0x149f24+'\x0a');},this[_0xfc4a('0x1c')]=function(){_0x3589b9[_0xfc4a('0x1f')]();};}util[_0xfc4a('0x22')](AGIChannel,EventEmitter);AGIChannel[_0xfc4a('0x23')][_0xfc4a('0x24')]=function(_0x4c1045){return this['command'][_0xfc4a('0x25')](this,_0x4c1045);};AGIChannel['prototype'][_0xfc4a('0x26')]=function(){return this['sendRequest']('ANSWER');};AGIChannel['prototype']['getData']=function(_0x45a04b,_0x547945,_0x3c446b){_0x45a04b=_0x45a04b===undefined?_0xfc4a('0x27'):_0x45a04b;_0x547945=_0x547945===undefined?'5':_0x547945;_0x3c446b=_0x3c446b===undefined?'1':_0x3c446b;return this['sendRequest'](util[_0xfc4a('0x28')](_0xfc4a('0x29'),_0x45a04b,_0x547945*0x3e8,_0x3c446b));};AGIChannel[_0xfc4a('0x23')]['noop']=function(_0xf0c25){_0xf0c25=_0xf0c25||_0xfc4a('0x2a');return this['sendRequest'](util['format'](_0xfc4a('0x2b'),_0xf0c25));};AGIChannel[_0xfc4a('0x23')][_0xfc4a('0x2c')]=function(_0x5023fd,_0x407190){if(_[_0xfc4a('0x2d')](_0x407190)){return this[_0xfc4a('0x24')](util['format'](_0xfc4a('0x2e'),_0x5023fd,_0x407190[_0xfc4a('0x2f')](',')));}return this['sendRequest'](util['format'](_0xfc4a('0x2e'),_0x5023fd,_0x407190));};AGIChannel['prototype'][_0xfc4a('0x30')]=function(_0x384ffc){return this[_0xfc4a('0x24')](util[_0xfc4a('0x28')](_0xfc4a('0x31'),_0x384ffc));};AGIChannel[_0xfc4a('0x23')]['setExtension']=function(_0x17a3dc){return this['sendRequest'](util[_0xfc4a('0x28')]('SET\x20EXTENSION\x20%s',_0x17a3dc));};AGIChannel[_0xfc4a('0x23')][_0xfc4a('0x32')]=function(_0x568b05){return this[_0xfc4a('0x24')](util[_0xfc4a('0x28')](_0xfc4a('0x33'),_0x568b05));};AGIChannel['prototype'][_0xfc4a('0xe')]=function(){return this[_0xfc4a('0x24')](_0xfc4a('0x34'));};AGIChannel[_0xfc4a('0x23')][_0xfc4a('0x35')]=function(_0x1f683b,_0x4bf201){var _0x32f668=_[_0xfc4a('0x36')](_0x4bf201)||_['isNumber'](_0x4bf201)?_0x4bf201['toString']():_0x4bf201;return this[_0xfc4a('0x24')](util[_0xfc4a('0x28')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x1f683b,_0x32f668?_0x32f668['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xfc4a('0x23')][_0xfc4a('0x37')]=function(_0x1115d9,_0x5357b9){return this[_0xfc4a('0x24')](util[_0xfc4a('0x28')](_0xfc4a('0x38'),_0x1115d9,_0x5357b9));};AGIChannel[_0xfc4a('0x23')][_0xfc4a('0x39')]=function(_0x43e2c5,_0x5ba34a){return this[_0xfc4a('0x24')](util[_0xfc4a('0x28')](_0xfc4a('0x3a'),_0x43e2c5,_0x5ba34a));};AGIChannel[_0xfc4a('0x23')]['sayPhonetic']=function(_0x448fa9,_0x1bc98e){return this[_0xfc4a('0x24')](util[_0xfc4a('0x28')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x448fa9,_0x1bc98e));};AGIChannel[_0xfc4a('0x23')][_0xfc4a('0x3b')]=function(_0x5895aa,_0x5a0c65,_0x5123b3){_0x5a0c65=_0x5a0c65||this['extension'];_0x5123b3=_0x5123b3||0x1;this[_0xfc4a('0x30')](_0x5895aa);this['setExtension'](_0x5a0c65);this['setPriority'](_0x5123b3);return this['noop'](util[_0xfc4a('0x28')](_0xfc4a('0x3c'),_0x5895aa,_0x5a0c65,_0x5123b3));};AGIChannel['prototype'][_0xfc4a('0x3d')]=function(_0x36fa1f){return this[_0xfc4a('0x24')](util[_0xfc4a('0x28')]('GET\x20VARIABLE\x20\x22%s\x22',_0x36fa1f));};AGIChannel['prototype'][_0xfc4a('0x3e')]=function(_0x3b3493,_0x49f4e3,_0x58951e,_0x4cecb1,_0x3ed297,_0x5e8bef){_0x49f4e3=_0x49f4e3||_0xfc4a('0x3f');_0x58951e=_0x58951e||'';_0x4cecb1=_0x4cecb1===undefined?-0x1:_0x4cecb1==='-1'?-0x1:_0x4cecb1*0x3e8;_0x3ed297=_0x3ed297===undefined?'':'s='+_0x3ed297;_0x5e8bef=_0x5e8bef?_0xfc4a('0x40'):'';return this[_0xfc4a('0x24')](util[_0xfc4a('0x28')](_0xfc4a('0x41'),_0x3b3493,_0x49f4e3,_0x58951e,_0x4cecb1,_0x5e8bef,_0x3ed297));};AGIChannel['prototype'][_0xfc4a('0x42')]=function(_0x29fd51,_0x13085e){_0x13085e=_0x13085e||'';return this[_0xfc4a('0x24')](util[_0xfc4a('0x28')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x29fd51,_0x13085e));};AGIChannel[_0xfc4a('0x23')]['agi']=function(_0x15b90f){return this[_0xfc4a('0x2c')](_0xfc4a('0x43'),_0x15b90f);};AGIChannel[_0xfc4a('0x23')][_0xfc4a('0x44')]=function(_0x5678e){return this[_0xfc4a('0x2c')](_0xfc4a('0x45'),_0x5678e);};AGIChannel[_0xfc4a('0x23')][_0xfc4a('0x1a')]=function(_0xb634aa,_0x512d7b){this['noop'](util[_0xfc4a('0x28')](_0xfc4a('0x46'),_0xb634aa['id'],_0xb634aa[_0xfc4a('0x47')],_0x512d7b));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xfc4a('0x48')]=AGIChannel; \ No newline at end of file +var _0xe14a=['setEncoding','utf8','setTimeout','headers','emit','toLowerCase','hangup','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','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','write','inherits','sync','prototype','answer','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','setPriority','getVariable','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','WAIT','exports','./error','call'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0xe14a,0x94));var _0xae14=function(_0x35c1ce,_0x3e3740){_0x35c1ce=_0x35c1ce-0x0;var _0x4c324b=_0xe14a[_0x35c1ce];return _0x4c324b;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require('events')['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0xae14('0x0'));function AGIChannel(_0xb92ae1){var _0x5cdfa7=this,_0x16bd5f=new AGIReply(),_0x2736f8=![],_0x2ec016={};EventEmitter[_0xae14('0x1')](_0x5cdfa7);_0xb92ae1[_0xae14('0x2')](_0xae14('0x3'));_0xb92ae1[_0xae14('0x4')](0x8*0x3c*0x3c*0x3e8);_0x16bd5f[_0xae14('0x2')](_0xae14('0x3'));_0x16bd5f['on'](_0xae14('0x5'),function(_0x103029){for(var _0x3b8063 in _0x103029){_0x5cdfa7[_0x3b8063]=_0x103029[_0x3b8063];}_0x5cdfa7[_0xae14('0x6')]('ready');});_0x16bd5f['on']('line',function(_0x2edf05){if(_0x2edf05[_0xae14('0x7')]()==_0xae14('0x8')){_0x5cdfa7[_0xae14('0x6')](_0xae14('0x8'));return;}if(_0x2edf05['substring'](0x0,0xb)=='520-Invalid'){_0x2736f8=!![];}if(_0x2736f8){_0x2ec016['rx']+=_0x2edf05+'\x0a';if(_0x2edf05[_0xae14('0x9')](_0xae14('0xa'))!=-0x1){_0x2736f8=![];}}else{_0x2ec016['rx']=_0x2edf05;}if(_0x2736f8){return;}if(typeof _0x2ec016['cb']==_0xae14('0xb')){var _0x1d795c=_0x2ec016['rx'][_0xae14('0xc')](0x0,0x3),_0x45f3e3=null,_0x1fb669=null;_0x1d795c=parseInt(_0x1d795c);if(isNaN(_0x1d795c)){_0x2ec016['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xae14('0xd')});return;}if(_0x1d795c!=0xc8){_0x2ec016['cb'](null,{'code':_0x1d795c,'result':-0x1,'extra':'KO'});return;}_0x45f3e3=_0x2ec016['rx'][_0xae14('0xc')](0x4)[_0xae14('0xe')]('result=','');if(_0x45f3e3[_0xae14('0xf')]('\x20')!=-0x1){_0x45f3e3=_0x45f3e3[_0xae14('0x10')](0x0,_0x45f3e3['indexOf']('\x20'));}if(_[_0xae14('0x11')](_0x45f3e3,'-1')){_0x45f3e3=parseInt(_0x45f3e3);}_0x1fb669=_0x2ec016['rx'][_0xae14('0x12')]('\x20');if(_0x1fb669[_0xae14('0x13')]==0x3){_0x1fb669=_0x1fb669[0x2][_0xae14('0xc')](0x1,_0x1fb669[0x2][_0xae14('0x13')]-0x1);}else if(_0x1fb669['length']>0x3){var _0x5c7cf7=/\((.+)\)/;var _0x40160f=_0x2ec016['rx'][_0xae14('0x14')](_0x5c7cf7);if(_0x40160f){_0x1fb669=_0x40160f[0x1];}else{_0x1fb669=null;}}else{_0x1fb669=null;}_0x2ec016['cb'](null,{'code':_0x1d795c,'result':_0x45f3e3,'extra':_0x1fb669});}});_0xb92ae1['on'](_0xae14('0x15'),function(_0x4913e7){_0x5cdfa7['emit'](_0xae14('0x15'),new AGIError(_0xae14('0x16'),_0x4913e7[_0xae14('0x17')]));});_0xb92ae1['on'](_0xae14('0x18'),function(){_0x5cdfa7[_0xae14('0x6')](_0xae14('0x18'),new AGIError(_0xae14('0x19')));});_0xb92ae1['on'](_0xae14('0x1a'),function(){_0x5cdfa7['emit'](_0xae14('0x1a'),new AGIError(_0xae14('0x1b')));_0xb92ae1[_0xae14('0x1c')]();});_0xb92ae1[_0xae14('0x1d')](_0x16bd5f);this[_0xae14('0x1e')]=function(_0x1e2fbc,_0x45fec8){var _0x1e2fbc=_0x1e2fbc||'',_0x45fec8=typeof _0x45fec8==_0xae14('0xb')?_0x45fec8:new Function();_0x2ec016={'tx':_0x1e2fbc,'rx':'','cb':_0x45fec8};_0xb92ae1[_0xae14('0x1f')](_0x1e2fbc+'\x0a');},this[_0xae14('0x18')]=function(){_0xb92ae1[_0xae14('0x1c')]();};}util[_0xae14('0x20')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x5ca2f8){return this[_0xae14('0x1e')][_0xae14('0x21')](this,_0x5ca2f8);};AGIChannel[_0xae14('0x22')][_0xae14('0x23')]=function(){return this[_0xae14('0x24')](_0xae14('0x25'));};AGIChannel[_0xae14('0x22')][_0xae14('0x26')]=function(_0x30c9f1,_0x338ab0,_0x46d91e){_0x30c9f1=_0x30c9f1===undefined?_0xae14('0x27'):_0x30c9f1;_0x338ab0=_0x338ab0===undefined?'5':_0x338ab0;_0x46d91e=_0x46d91e===undefined?'1':_0x46d91e;return this['sendRequest'](util[_0xae14('0x28')](_0xae14('0x29'),_0x30c9f1,_0x338ab0*0x3e8,_0x46d91e));};AGIChannel[_0xae14('0x22')][_0xae14('0x2a')]=function(_0x43c0e8){_0x43c0e8=_0x43c0e8||_0xae14('0x2b');return this[_0xae14('0x24')](util['format'](_0xae14('0x2c'),_0x43c0e8));};AGIChannel[_0xae14('0x22')][_0xae14('0x2d')]=function(_0x5d3561,_0x535e79){if(_[_0xae14('0x2e')](_0x535e79)){return this[_0xae14('0x24')](util[_0xae14('0x28')](_0xae14('0x2f'),_0x5d3561,_0x535e79['join'](',')));}return this[_0xae14('0x24')](util[_0xae14('0x28')](_0xae14('0x2f'),_0x5d3561,_0x535e79));};AGIChannel['prototype']['setContext']=function(_0x584adc){return this[_0xae14('0x24')](util[_0xae14('0x28')](_0xae14('0x30'),_0x584adc));};AGIChannel['prototype'][_0xae14('0x31')]=function(_0x156ee5){return this[_0xae14('0x24')](util['format'](_0xae14('0x32'),_0x156ee5));};AGIChannel[_0xae14('0x22')]['setPriority']=function(_0x3fe77b){return this[_0xae14('0x24')](util[_0xae14('0x28')](_0xae14('0x33'),_0x3fe77b));};AGIChannel['prototype'][_0xae14('0x8')]=function(){return this[_0xae14('0x24')]('HANGUP');};AGIChannel[_0xae14('0x22')][_0xae14('0x34')]=function(_0x510a64,_0x482003){var _0x29680a=_['isBoolean'](_0x482003)||_[_0xae14('0x35')](_0x482003)?_0x482003[_0xae14('0x36')]():_0x482003;return this[_0xae14('0x24')](util['format'](_0xae14('0x37'),_0x510a64,_0x29680a?_0x29680a[_0xae14('0x36')]()[_0xae14('0xe')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xae14('0x22')][_0xae14('0x38')]=function(_0x7d969,_0x2e9410){return this['sendRequest'](util[_0xae14('0x28')](_0xae14('0x39'),_0x7d969,_0x2e9410));};AGIChannel[_0xae14('0x22')][_0xae14('0x3a')]=function(_0x1b4383,_0x138afc){return this[_0xae14('0x24')](util[_0xae14('0x28')](_0xae14('0x3b'),_0x1b4383,_0x138afc));};AGIChannel[_0xae14('0x22')][_0xae14('0x3c')]=function(_0x484f24,_0x5ae91b){return this[_0xae14('0x24')](util['format'](_0xae14('0x3d'),_0x484f24,_0x5ae91b));};AGIChannel[_0xae14('0x22')][_0xae14('0x3e')]=function(_0x5ac9a3,_0x1e19af,_0xab3352){_0x1e19af=_0x1e19af||this[_0xae14('0x3f')];_0xab3352=_0xab3352||0x1;this[_0xae14('0x40')](_0x5ac9a3);this['setExtension'](_0x1e19af);this[_0xae14('0x41')](_0xab3352);return this['noop'](util[_0xae14('0x28')]('GOTO\x20%s\x20%s\x20%s',_0x5ac9a3,_0x1e19af,_0xab3352));};AGIChannel[_0xae14('0x22')][_0xae14('0x42')]=function(_0x3cfc2c){return this['sendRequest'](util[_0xae14('0x28')]('GET\x20VARIABLE\x20\x22%s\x22',_0x3cfc2c));};AGIChannel[_0xae14('0x22')][_0xae14('0x43')]=function(_0x18f945,_0x4efda1,_0x1f3d81,_0x2452a2,_0x513934,_0x56d3d4){_0x4efda1=_0x4efda1||'wav';_0x1f3d81=_0x1f3d81||'';_0x2452a2=_0x2452a2===undefined?-0x1:_0x2452a2==='-1'?-0x1:_0x2452a2*0x3e8;_0x513934=_0x513934===undefined?'':'s='+_0x513934;_0x56d3d4=_0x56d3d4?_0xae14('0x44'):'';return this[_0xae14('0x24')](util['format'](_0xae14('0x45'),_0x18f945,_0x4efda1,_0x1f3d81,_0x2452a2,_0x56d3d4,_0x513934));};AGIChannel[_0xae14('0x22')][_0xae14('0x46')]=function(_0xa942ea,_0x17df55){_0x17df55=_0x17df55||'';return this[_0xae14('0x24')](util['format'](_0xae14('0x47'),_0xa942ea,_0x17df55));};AGIChannel[_0xae14('0x22')]['agi']=function(_0x3642a6){return this[_0xae14('0x2d')](_0xae14('0x48'),_0x3642a6);};AGIChannel['prototype']['wait']=function(_0xe44447){return this[_0xae14('0x2d')](_0xae14('0x49'),_0xe44447);};AGIChannel[_0xae14('0x22')][_0xae14('0x15')]=function(_0x443850,_0x578be2){this[_0xae14('0x2a')](util[_0xae14('0x28')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x443850['id'],_0x443850['label'],_0x578be2));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xae14('0x4a')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 39cd86c..dfac844 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 _0x46c6=['Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','message','name','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x32f3d3,_0x598398){var _0x543e6b=function(_0x6ba448){while(--_0x6ba448){_0x32f3d3['push'](_0x32f3d3['shift']());}};_0x543e6b(++_0x598398);}(_0x46c6,0x86));var _0x646c=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x46c6[_0x4fbfd9];return _0x31dc94;};'use strict';var util=require(_0x646c('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x646c('0x1'),'E_AGI_SERVER_ERROR':_0x646c('0x2'),'E_AGI_SERVER_CLOSE':_0x646c('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x646c('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x646c('0x5'),'E_AGI_SOCKET_ERROR':_0x646c('0x6'),'E_AGI_SOCKET_CLOSE':_0x646c('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x646c('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x646c('0x9'),'E_AGI_IVR_ENTRY':_0x646c('0xa')};function AGIError(_0xa230e7){var _0xa230e7=_0xa230e7||null,_0x197b2b=_0x197b2b||[],_0x2862ce=0x1,_0x4cdf88='';if(!error[_0xa230e7]){_0xa230e7=_0x646c('0xb');}_0x197b2b[_0x646c('0xc')](error[_0xa230e7]);while(arguments[_0x2862ce]){_0x197b2b['push'](arguments[_0x2862ce]);_0x2862ce++;}_0x4cdf88=util['format'][_0x646c('0xd')](util,_0x197b2b);this[_0x646c('0xe')]=_0x4cdf88;this[_0x646c('0xf')]=_0xa230e7;}module['exports']=AGIError; \ No newline at end of file +var _0x25ab=['util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','format','apply','message'];(function(_0x51e42a,_0x2e2098){var _0x483535=function(_0x2f453a){while(--_0x2f453a){_0x51e42a['push'](_0x51e42a['shift']());}};_0x483535(++_0x2e2098);}(_0x25ab,0x170));var _0xb25a=function(_0x50c74c,_0x525747){_0x50c74c=_0x50c74c-0x0;var _0x1da5d2=_0x25ab[_0x50c74c];return _0x1da5d2;};'use strict';var util=require(_0xb25a('0x0'));var error={'E_AGI_UNDEFINED':_0xb25a('0x1'),'E_AGI_ARGUMENT_PORT':_0xb25a('0x2'),'E_AGI_SERVER_ERROR':_0xb25a('0x3'),'E_AGI_SERVER_CLOSE':_0xb25a('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xb25a('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xb25a('0x6'),'E_AGI_SOCKET_ERROR':_0xb25a('0x7'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xb25a('0x8'),'E_AGI_COMMAND_EMPTY':_0xb25a('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xb25a('0xa'),'E_AGI_IVR_ENTRY':_0xb25a('0xb')};function AGIError(_0x4b6eeb){var _0x4b6eeb=_0x4b6eeb||null,_0x45ef18=_0x45ef18||[],_0x1f98f9=0x1,_0x4901e5='';if(!error[_0x4b6eeb]){_0x4b6eeb=_0xb25a('0xc');}_0x45ef18['push'](error[_0x4b6eeb]);while(arguments[_0x1f98f9]){_0x45ef18['push'](arguments[_0x1f98f9]);_0x1f98f9++;}_0x4901e5=util[_0xb25a('0xd')][_0xb25a('0xe')](util,_0x45ef18);this[_0xb25a('0xf')]=_0x4901e5;this['name']=_0x4b6eeb;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 693f3a8..da3b8d5 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a38=['E_AGI_SERVER_ERROR','exports','events','./error','../../config/environment','redis','defaults','localhost','subscribe','agi','emit','error','message','parse'];(function(_0x5c8761,_0x4ad0b9){var _0x5047a8=function(_0x5a5779){while(--_0x5a5779){_0x5c8761['push'](_0x5c8761['shift']());}};_0x5047a8(++_0x4ad0b9);}(_0x8a38,0x160));var _0x88a3=function(_0xe3b7bb,_0x263836){_0xe3b7bb=_0xe3b7bb-0x0;var _0x2df486=_0x8a38[_0xe3b7bb];return _0x2df486;};'use strict';var _=require('lodash');var EventEmitter=require(_0x88a3('0x0'))['EventEmitter'];var Redis=require('ioredis');var AGIError=require(_0x88a3('0x1'));var config=require(_0x88a3('0x2'));config[_0x88a3('0x3')]=_[_0x88a3('0x4')](config[_0x88a3('0x3')],{'host':_0x88a3('0x5'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0x88a3('0x6')](_0x88a3('0x7'),function(_0x68c14b){if(_0x68c14b)return eventEmitter[_0x88a3('0x8')](_0x88a3('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x68c14b));});sub['on'](_0x88a3('0xa'),function(_0x3adbab,_0x5d6467){if(_0x3adbab!==_0x88a3('0x7'))return;try{var _0x3ffcb1=JSON[_0x88a3('0xb')](_0x5d6467);eventEmitter[_0x88a3('0x8')]('projectUpdate',_0x3ffcb1);}catch(_0x4c39be){eventEmitter[_0x88a3('0x8')](_0x88a3('0x9'),new AGIError(_0x88a3('0xc'),_0x4c39be));}});module[_0x88a3('0xd')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xd68a=['error','E_AGI_SERVER_ERROR','message','agi','parse','exports','lodash','events','EventEmitter','ioredis','./error','defaults','redis','localhost','subscribe','emit'];(function(_0x144b30,_0x77072d){var _0x1bb7bc=function(_0x1082cc){while(--_0x1082cc){_0x144b30['push'](_0x144b30['shift']());}};_0x1bb7bc(++_0x77072d);}(_0xd68a,0x136));var _0xad68=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xd68a[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0xad68('0x0'));var EventEmitter=require(_0xad68('0x1'))[_0xad68('0x2')];var Redis=require(_0xad68('0x3'));var AGIError=require(_0xad68('0x4'));var config=require('../../config/environment');config['redis']=_[_0xad68('0x5')](config[_0xad68('0x6')],{'host':_0xad68('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xad68('0x6')]);sub[_0xad68('0x8')]('agi',function(_0x360fad){if(_0x360fad)return eventEmitter[_0xad68('0x9')](_0xad68('0xa'),new AGIError(_0xad68('0xb'),_0x360fad));});sub['on'](_0xad68('0xc'),function(_0x48be91,_0x141f17){if(_0x48be91!==_0xad68('0xd'))return;try{var _0x48cf88=JSON[_0xad68('0xe')](_0x141f17);eventEmitter[_0xad68('0x9')]('projectUpdate',_0x48cf88);}catch(_0x3fa7cb){eventEmitter['emit'](_0xad68('0xa'),new AGIError('E_AGI_SERVER_ERROR',_0x3fa7cb));}});module[_0xad68('0xf')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 4e1e9f4..346cdf8 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 _0x3cdc=['includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','vertices','relations','getVertex','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3cdc,0x10c));var _0xc3cd=function(_0x1a08ba,_0x51b51d){_0x1a08ba=_0x1a08ba-0x0;var _0x2e66ba=_0x3cdc[_0x1a08ba];return _0x2e66ba;};'use strict';var _=require(_0xc3cd('0x0'));var logger=require(_0xc3cd('0x1'))(_0xc3cd('0x2'));var verticesWithRetry=[_0xc3cd('0x3'),_0xc3cd('0x4'),_0xc3cd('0x5')];var Graph=function(){this['vertices']={};this[_0xc3cd('0x6')]={};this[_0xc3cd('0x7')]=0x0;};Graph[_0xc3cd('0x8')][_0xc3cd('0x9')]=function(_0x11ff14){this['vertices'][_0x11ff14['id']]=_0x11ff14;this[_0xc3cd('0x6')][_0x11ff14['id']]=[];};Graph[_0xc3cd('0x8')][_0xc3cd('0xa')]=function(_0x5730d4,_0x202b1b,_0x50e631){this[_0xc3cd('0x6')][_0x5730d4][_0xc3cd('0xb')]({'target':_0x202b1b,'condition':_0x50e631});this[_0xc3cd('0x7')]+=0x1;};Graph[_0xc3cd('0x8')]['size']=function(){return _[_0xc3cd('0xc')](this[_0xc3cd('0xd')]);};Graph[_0xc3cd('0x8')][_0xc3cd('0xe')]=function(){return this[_0xc3cd('0x7')];};Graph[_0xc3cd('0x8')][_0xc3cd('0xf')]=function(_0x2b24d2){return this['vertices'][_0x2b24d2];};Graph[_0xc3cd('0x8')][_0xc3cd('0x10')]=function(_0x2da8b4,_0x3761d2){if(!this[_0xc3cd('0xd')][_0x2da8b4]){return logger['info']('no\x20vertex\x20found');}var _0x31fae1=_0x3761d2(this[_0xc3cd('0xd')][_0x2da8b4]);if(!_0x31fae1){return logger[_0xc3cd('0x11')](_0xc3cd('0x12'));}if(this[_0xc3cd('0x6')][_0x2da8b4][_0xc3cd('0x13')]===0x0){return logger[_0xc3cd('0x11')](_0xc3cd('0x14'));}for(var _0x29d1b2=0x0,_0x295e86=[],_0x17b549=![];_0x29d1b2\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','evtHangup','createSquareReport','catch','hasOwnProperty','indexOf','agi_','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','handleNotFound','production','handleUnpublished','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','finally','./server','listening','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','./project','EventEmitter','defaults','projectUpdate'];(function(_0x1fec86,_0x422ed7){var _0x55e897=function(_0x5750ca){while(--_0x5750ca){_0x1fec86['push'](_0x1fec86['shift']());}};_0x55e897(++_0x422ed7);}(_0x7f37,0xde));var _0x77f3=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7f37[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x77f3('0x0'));var syncho=require(_0x77f3('0x1'));var util=require(_0x77f3('0x2'));var config=require(_0x77f3('0x3'));var logger=require(_0x77f3('0x4'))(_0x77f3('0x5'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var Project=require(_0x77f3('0x6'));var AGIEmitter=require('./events')[_0x77f3('0x7')];var projects=[];config[_0x77f3('0x5')]=_[_0x77f3('0x8')](config[_0x77f3('0x5')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x77f3('0x9'),projectUpdateHandler);function connectionHandler(_0x2cf355){process[_0x77f3('0xa')](function(){syncho(function(){try{setChannelVariables(_0x2cf355);agiHandler(_0x2cf355);}catch(_0x1e7a83){logger[_0x77f3('0xb')](_0x1e7a83[_0x77f3('0xc')]);}});});}function projectUpdateHandler(_0x5b5cb3){try{var _0x2079a9=_[_0x77f3('0xd')](projects,['id',_0x5b5cb3['id']]);if(_0x2079a9>-0x1){if(_0x5b5cb3[_0x77f3('0xe')]===!![]){projects[_0x77f3('0xf')](_0x2079a9,0x1);}else{projects[_0x2079a9]=_0x5b5cb3;}}else{projects[_0x77f3('0x10')](_0x5b5cb3);}}catch(_0x2e9088){logger[_0x77f3('0xb')](_0x2e9088['stack']);}}function listeningHandler(){console[_0x77f3('0x11')](_0x77f3('0x12'),config[_0x77f3('0x5')][_0x77f3('0x13')]);logger['info'](util[_0x77f3('0x14')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x77f3('0x5')]['ip'],config[_0x77f3('0x5')][_0x77f3('0x13')]));}function errorHandler(_0x5819a2){if(_0x5819a2&&_0x5819a2['name']&&_0x5819a2[_0x77f3('0x15')]){logger['error'](util['format'](_0x77f3('0x16'),_0x5819a2[_0x77f3('0x17')],_0x5819a2['message']));}else{logger[_0x77f3('0xb')](util[_0x77f3('0x14')](_0x77f3('0x18'),_0x5819a2[_0x77f3('0xc')]));}}function closeHandler(){logger[_0x77f3('0x19')](util['format'](_0x77f3('0x1a'),this['arg_1'],this[_0x77f3('0x1b')],this[_0x77f3('0x1c')],this[_0x77f3('0x1d')],this[_0x77f3('0x1e')]));try{createSquareReport(this);}catch(_0x875217){logger['error'](_0x875217[_0x77f3('0xc')]);}}function timeoutHandler(){logger[_0x77f3('0x19')](util['format'](_0x77f3('0x1f'),this['arg_1'],this[_0x77f3('0x1b')],this[_0x77f3('0x1c')],this[_0x77f3('0x1d')],this['uniqueid']));}function hangupHandler(){logger[_0x77f3('0x19')](util[_0x77f3('0x14')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x77f3('0x1b')],this[_0x77f3('0x1c')],this[_0x77f3('0x1d')],this[_0x77f3('0x1e')]));this[_0x77f3('0x20')]=!![];}function createSquareReport(_0x141306,_0x53545e){rpc[_0x77f3('0x21')](_0x141306)['then'](function(_0xbc9c86){if(_0x53545e){_0x53545e(null,_0xbc9c86);}})[_0x77f3('0x22')](function(_0x209b29){if(_0x53545e){_0x53545e(null,_0x209b29);}});}function setChannelVariables(_0x752bae){for(var _0x251631 in _0x752bae){if(_0x752bae[_0x77f3('0x23')](_0x251631)){if(_0x251631[_0x77f3('0x24')](_0x77f3('0x25'))===0x0){_0x752bae[_0x251631[_0x77f3('0x26')](0x4)]=_0x752bae[_0x251631];delete _0x752bae[_0x251631];}}}}function agiHandler(_0x218b11){logger['debug'](_0x77f3('0x27'),JSON[_0x77f3('0x28')](_0x218b11,null,0x2));logger[_0x77f3('0x19')](util[_0x77f3('0x14')](_0x77f3('0x29'),_0x218b11['arg_1'],_0x218b11['calleridname'],_0x218b11[_0x77f3('0x1c')],_0x218b11[_0x77f3('0x1d')],_0x218b11['uniqueid']));_0x218b11['on']('error',errorHandler);_0x218b11['on'](_0x77f3('0x2a'),closeHandler);_0x218b11['on']('timeout',timeoutHandler);_0x218b11[_0x77f3('0x20')]=![];_0x218b11['on'](_0x77f3('0x2b'),hangupHandler);var _0x56c5bf=_['find'](projects,['name',_0x218b11['arg_1']]);if(!_0x56c5bf)return Project[_0x77f3('0x2c')](_0x218b11);if(!_0x56c5bf[_0x77f3('0x2d')])return Project[_0x77f3('0x2e')](_0x218b11);return Project['initialize'](_0x56c5bf,_0x218b11);}function main(){var _0x141ae4;return utilLicense[_0x77f3('0x2f')]()[_0x77f3('0x30')](function(_0x4c37b0){if(!_0x4c37b0)return;if(_0x4c37b0[_0x77f3('0x31')]){if(_0x4c37b0[_0x77f3('0x32')]&&_0x4c37b0[_0x77f3('0x32')]>0x0){logger[_0x77f3('0x19')](util[_0x77f3('0x14')]('[LICENSE]\x20CHANNELS:\x20%s',_0x4c37b0[_0x77f3('0x32')]));_0x141ae4=_0x4c37b0[_0x77f3('0x32')];}else{logger[_0x77f3('0x19')](_0x77f3('0x33'));}}else{logger[_0x77f3('0x19')](_0x77f3('0x34'));_0x141ae4=-0x1;}})['then'](function(){return Project['getAll']();})[_0x77f3('0x30')](function(_0x339924){projects=_0x339924;return;})[_0x77f3('0x22')](function(_0x1743a1){logger[_0x77f3('0xb')](_0x77f3('0x35'),_0x1743a1['stack']);})[_0x77f3('0x36')](function(){var _0x3d8cdd=require(_0x77f3('0x37'))(config[_0x77f3('0x5')]['port'],config[_0x77f3('0x5')]['ip'],_0x141ae4);_0x3d8cdd['on'](_0x77f3('0xb'),errorHandler);_0x3d8cdd['on'](_0x77f3('0x38'),listeningHandler);_0x3d8cdd['on'](_0x77f3('0x39'),connectionHandler);_0x3d8cdd['on'](_0x77f3('0x2a'),closeHandler);});}main(); \ No newline at end of file +var _0xe454=['hasOwnProperty','indexOf','agi_','substring','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','find','production','handleUnpublished','initialize','getLicense','voice','[LICENSE]\x20CHANNELS:\x20%s','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','finally','./server','listening','connection','syncho','util','../../config/environment','../../config/logger','./project','./events','EventEmitter','agi','defaults','nextTick','findIndex','deleted','splice','push','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','message','[%s]\x20%s','name','[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','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch'];(function(_0x535784,_0x3cf9d9){var _0x2356d7=function(_0x4e7ba1){while(--_0x4e7ba1){_0x535784['push'](_0x535784['shift']());}};_0x2356d7(++_0x3cf9d9);}(_0xe454,0x138));var _0x4e45=function(_0x16e738,_0x59d6b4){_0x16e738=_0x16e738-0x0;var _0x40de75=_0xe454[_0x16e738];return _0x40de75;};'use strict';var _=require('lodash');var syncho=require(_0x4e45('0x0'));var util=require(_0x4e45('0x1'));var config=require(_0x4e45('0x2'));var logger=require(_0x4e45('0x3'))('agi');var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var Project=require(_0x4e45('0x4'));var AGIEmitter=require(_0x4e45('0x5'))[_0x4e45('0x6')];var projects=[];config[_0x4e45('0x7')]=_[_0x4e45('0x8')](config[_0x4e45('0x7')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x24e3e2){process[_0x4e45('0x9')](function(){syncho(function(){try{setChannelVariables(_0x24e3e2);agiHandler(_0x24e3e2);}catch(_0x10fefe){logger['error'](_0x10fefe['stack']);}});});}function projectUpdateHandler(_0x3ac1f5){try{var _0x59a704=_[_0x4e45('0xa')](projects,['id',_0x3ac1f5['id']]);if(_0x59a704>-0x1){if(_0x3ac1f5[_0x4e45('0xb')]===!![]){projects[_0x4e45('0xc')](_0x59a704,0x1);}else{projects[_0x59a704]=_0x3ac1f5;}}else{projects[_0x4e45('0xd')](_0x3ac1f5);}}catch(_0x104f3c){logger[_0x4e45('0xe')](_0x104f3c[_0x4e45('0xf')]);}}function listeningHandler(){console['log'](_0x4e45('0x10'),config[_0x4e45('0x7')][_0x4e45('0x11')]);logger['info'](util[_0x4e45('0x12')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x4e45('0x7')]['ip'],config[_0x4e45('0x7')][_0x4e45('0x11')]));}function errorHandler(_0x3bc1eb){if(_0x3bc1eb&&_0x3bc1eb['name']&&_0x3bc1eb[_0x4e45('0x13')]){logger[_0x4e45('0xe')](util['format'](_0x4e45('0x14'),_0x3bc1eb[_0x4e45('0x15')],_0x3bc1eb[_0x4e45('0x13')]));}else{logger[_0x4e45('0xe')](util[_0x4e45('0x12')](_0x4e45('0x16'),_0x3bc1eb[_0x4e45('0xf')]));}}function closeHandler(){logger[_0x4e45('0x17')](util['format'](_0x4e45('0x18'),this['arg_1'],this[_0x4e45('0x19')],this[_0x4e45('0x1a')],this['dnid'],this[_0x4e45('0x1b')]));try{createSquareReport(this);}catch(_0x24d234){logger['error'](_0x24d234[_0x4e45('0xf')]);}}function timeoutHandler(){logger['info'](util[_0x4e45('0x12')](_0x4e45('0x1c'),this[_0x4e45('0x1d')],this[_0x4e45('0x19')],this[_0x4e45('0x1a')],this[_0x4e45('0x1e')],this[_0x4e45('0x1b')]));}function hangupHandler(){logger[_0x4e45('0x17')](util['format'](_0x4e45('0x1f'),this[_0x4e45('0x1d')],this['calleridname'],this[_0x4e45('0x1a')],this[_0x4e45('0x1e')],this['uniqueid']));this[_0x4e45('0x20')]=!![];}function createSquareReport(_0x2f2c97,_0x5d9859){rpc[_0x4e45('0x21')](_0x2f2c97)[_0x4e45('0x22')](function(_0x531c9b){if(_0x5d9859){_0x5d9859(null,_0x531c9b);}})[_0x4e45('0x23')](function(_0x32cf3f){if(_0x5d9859){_0x5d9859(null,_0x32cf3f);}});}function setChannelVariables(_0x2018f8){for(var _0x217bf0 in _0x2018f8){if(_0x2018f8[_0x4e45('0x24')](_0x217bf0)){if(_0x217bf0[_0x4e45('0x25')](_0x4e45('0x26'))===0x0){_0x2018f8[_0x217bf0[_0x4e45('0x27')](0x4)]=_0x2018f8[_0x217bf0];delete _0x2018f8[_0x217bf0];}}}}function agiHandler(_0x4da9b0){logger['debug'](_0x4e45('0x28'),JSON['stringify'](_0x4da9b0,null,0x2));logger[_0x4e45('0x17')](util[_0x4e45('0x12')](_0x4e45('0x29'),_0x4da9b0['arg_1'],_0x4da9b0[_0x4e45('0x19')],_0x4da9b0[_0x4e45('0x1a')],_0x4da9b0[_0x4e45('0x1e')],_0x4da9b0[_0x4e45('0x1b')]));_0x4da9b0['on'](_0x4e45('0xe'),errorHandler);_0x4da9b0['on'](_0x4e45('0x2a'),closeHandler);_0x4da9b0['on']('timeout',timeoutHandler);_0x4da9b0[_0x4e45('0x20')]=![];_0x4da9b0['on']('hangup',hangupHandler);var _0x302f91=_[_0x4e45('0x2b')](projects,[_0x4e45('0x15'),_0x4da9b0[_0x4e45('0x1d')]]);if(!_0x302f91)return Project['handleNotFound'](_0x4da9b0);if(!_0x302f91[_0x4e45('0x2c')])return Project[_0x4e45('0x2d')](_0x4da9b0);return Project[_0x4e45('0x2e')](_0x302f91,_0x4da9b0);}function main(){var _0xebebbc;return utilLicense[_0x4e45('0x2f')]()[_0x4e45('0x22')](function(_0x311fb3){if(!_0x311fb3)return;if(_0x311fb3[_0x4e45('0x30')]){if(_0x311fb3['callysquare']&&_0x311fb3['callysquare']>0x0){logger[_0x4e45('0x17')](util[_0x4e45('0x12')](_0x4e45('0x31'),_0x311fb3[_0x4e45('0x32')]));_0xebebbc=_0x311fb3[_0x4e45('0x32')];}else{logger[_0x4e45('0x17')](_0x4e45('0x33'));}}else{logger[_0x4e45('0x17')](_0x4e45('0x34'));_0xebebbc=-0x1;}})[_0x4e45('0x22')](function(){return Project['getAll']();})['then'](function(_0x5f4d46){projects=_0x5f4d46;return;})[_0x4e45('0x23')](function(_0x208e8a){logger[_0x4e45('0xe')](_0x4e45('0x35'),_0x208e8a['stack']);})[_0x4e45('0x36')](function(){var _0xb978b6=require(_0x4e45('0x37'))(config[_0x4e45('0x7')][_0x4e45('0x11')],config[_0x4e45('0x7')]['ip'],_0xebebbc);_0xb978b6['on'](_0x4e45('0xe'),errorHandler);_0xb978b6['on'](_0x4e45('0x38'),listeningHandler);_0xb978b6['on'](_0x4e45('0x39'),connectionHandler);_0xb978b6['on']('close',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 c00c7c1..db0500c 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 _0xb0bb=['SendMail','bluebird','jayson/promise','client','request','then','error','message','result','catch','sendMailMessage'];(function(_0x160814,_0x57b5c6){var _0x427a69=function(_0x3f1485){while(--_0x3f1485){_0x160814['push'](_0x160814['shift']());}};_0x427a69(++_0x57b5c6);}(_0xb0bb,0x1e5));var _0xbb0b=function(_0x2446bd,_0x3d3c72){_0x2446bd=_0x2446bd-0x0;var _0x2c16a5=_0xb0bb[_0x2446bd];return _0x2c16a5;};'use strict';var BPromise=require(_0xbb0b('0x0'));var jayson=require(_0xbb0b('0x1'));var client=jayson[_0xbb0b('0x2')]['http']({'port':0x232b});function request(_0x41224d,_0x265285){return new BPromise(function(_0x289360,_0x1afebf){return client[_0xbb0b('0x3')](_0x41224d,_0x265285)[_0xbb0b('0x4')](function(_0x1eeed3){if(_0x1eeed3[_0xbb0b('0x5')]){return _0x1afebf(_0x1eeed3['error'][_0xbb0b('0x6')]);}else{return _0x289360(_0x1eeed3[_0xbb0b('0x7')]);}})[_0xbb0b('0x8')](function(_0x5ac742){return _0x1afebf(_0x5ac742);});});}exports[_0xbb0b('0x9')]=function(_0x4e0720,_0x419597){return request(_0xbb0b('0xa'),{'account':_0x4e0720,'message':_0x419597});}; \ No newline at end of file +var _0x6e3b=['request','then','error','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http'];(function(_0x45ea78,_0x31678e){var _0xd722b7=function(_0x25710a){while(--_0x25710a){_0x45ea78['push'](_0x45ea78['shift']());}};_0xd722b7(++_0x31678e);}(_0x6e3b,0x1d5));var _0xb6e3=function(_0x593303,_0x4e7e34){_0x593303=_0x593303-0x0;var _0x36b5bb=_0x6e3b[_0x593303];return _0x36b5bb;};'use strict';var BPromise=require(_0xb6e3('0x0'));var jayson=require(_0xb6e3('0x1'));var client=jayson[_0xb6e3('0x2')][_0xb6e3('0x3')]({'port':0x232b});function request(_0x12f7f4,_0x2c30af){return new BPromise(function(_0x47bf65,_0x1a495a){return client[_0xb6e3('0x4')](_0x12f7f4,_0x2c30af)[_0xb6e3('0x5')](function(_0x55c5ea){if(_0x55c5ea['error']){return _0x1a495a(_0x55c5ea[_0xb6e3('0x6')]['message']);}else{return _0x47bf65(_0x55c5ea[_0xb6e3('0x7')]);}})[_0xb6e3('0x8')](function(_0x14c14a){return _0x1a495a(_0x14c14a);});});}exports[_0xb6e3('0x9')]=function(_0x4ba78a,_0x199cf8){return request(_0xb6e3('0xa'),{'account':_0x4ba78a,'message':_0x199cf8});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 5408ed4..f203157 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaf73=['traverseBFS','start','clear','debug','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','vertex','[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\x20found','continueAt','Project\x20%s\x20not\x20published','exports','lodash','moment','util','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','stack','hasOwnProperty','retry','maxRetry','addVertex','omit','isArray','length','source','target','toJson','root','production','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid'];(function(_0x300870,_0x21ecba){var _0x21bad2=function(_0x55d124){while(--_0x55d124){_0x300870['push'](_0x300870['shift']());}};_0x21bad2(++_0x21ecba);}(_0xaf73,0x113));var _0x3af7=function(_0xb39895,_0x2d22d4){_0xb39895=_0xb39895-0x0;var _0x286310=_0xaf73[_0xb39895];return _0x286310;};'use strict';var _=require(_0x3af7('0x0'));var moment=require(_0x3af7('0x1'));var parser=require('xml2json');var util=require(_0x3af7('0x2'));var logger=require('../../config/logger')(_0x3af7('0x3'));var rpc=require(_0x3af7('0x4'));var mailRpc=require(_0x3af7('0x5'));var Graph=require(_0x3af7('0x6'));var Vertices=require(_0x3af7('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x3af7('0x8')]()[_0x3af7('0x9')](function(_0x829c0e){logger[_0x3af7('0xa')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x829c0e[_0x3af7('0xb')]);return[];});}function addVertex(_0x26318a,_0x20b02e,_0x770d81){_0x20b02e['agicommand']=_0x770d81;if(_0x20b02e[_0x3af7('0xc')](_0x3af7('0xd'))){_0x20b02e[_0x3af7('0xe')]=parseInt(_0x20b02e[_0x3af7('0xd')],0xa);}_0x26318a[_0x3af7('0xf')](_[_0x3af7('0x10')](_0x20b02e,'mxCell'));}function initGraph(_0x3e32a7,_0x20f513){var _0x440799=new Graph();for(var _0x4202c1 in _0x3e32a7){if(_0x3e32a7[_0x3af7('0xc')](_0x4202c1)){if(_[_0x3af7('0x11')](_0x3e32a7[_0x4202c1])){for(var _0x408de8=0x0;_0x408de8<_0x3e32a7[_0x4202c1]['length'];_0x408de8+=0x1){addVertex(_0x440799,_0x3e32a7[_0x4202c1][_0x408de8],_0x4202c1);}}else{addVertex(_0x440799,_0x3e32a7[_0x4202c1],_0x4202c1);}}}for(var _0x1d7f93=0x0;_0x1d7f93<_0x20f513[_0x3af7('0x12')];_0x1d7f93+=0x1){if(_0x20f513[_0x1d7f93][_0x3af7('0x13')]&&_0x20f513[_0x1d7f93][_0x3af7('0x14')]){_0x440799['addEdge'](_0x20f513[_0x1d7f93][_0x3af7('0x13')],_0x20f513[_0x1d7f93][_0x3af7('0x14')],_0x20f513[_0x1d7f93]['value']);}}return _0x440799;}function getRoot(_0x5a8cb6){return parser[_0x3af7('0x15')](_0x5a8cb6,{'object':!![]})['mxGraphModel'][_0x3af7('0x16')];}function inspect(_0xe71685){return util['inspect'](_0xe71685,{'showHidden':![],'depth':null});}function initialize(_0x120661,_0x4d6ad8){var _0x574ef7=getRoot(_0x120661[_0x3af7('0x17')]);if(!_0x574ef7||!_0x574ef7['start'])return;var _0x41d074,_0x4f48a9,_0xc00fe5;logger['debug'](_0x3af7('0x16'),JSON[_0x3af7('0x18')](_0x574ef7,null,0x2));_0x4d6ad8[_0x3af7('0x19')]=moment()[_0x3af7('0x1a')](_0x3af7('0x1b'));_0x41d074=initGraph(_[_0x3af7('0x10')](_0x574ef7,_0x3af7('0x1c')),_0x574ef7['mxCell']);_0x4f48a9=new Vertices(_0x4d6ad8,rpc,mailRpc);logger[_0x3af7('0x1d')](util[_0x3af7('0x1a')](_0x3af7('0x1e'),_0x4d6ad8[_0x3af7('0x1f')],_0x4d6ad8[_0x3af7('0x20')],_0x4d6ad8['callerid'],_0x4d6ad8[_0x3af7('0x21')],_0x4d6ad8[_0x3af7('0x22')]));_0x41d074[_0x3af7('0x23')](_0x574ef7[_0x3af7('0x24')]['id'],function(_0xa835fa){try{_0xa835fa=_0x4f48a9[_0x3af7('0x25')](_0xa835fa);logger[_0x3af7('0x26')]('vertex',JSON['stringify'](_0xa835fa,null,0x2));if(_0xa835fa[_0x3af7('0x27')]===_0x3af7('0x28')){logger[_0x3af7('0x1d')](_0x3af7('0x29'));_0x4d6ad8[_0x3af7('0x2a')]=_0xa835fa['context']||_0x4d6ad8[_0x3af7('0x2a')];_0x4d6ad8[_0x3af7('0x2b')]=_0xa835fa[_0x3af7('0x2b')];_0x4d6ad8[_0x3af7('0x2c')]=_0xa835fa[_0x3af7('0x2c')]?_0xa835fa[_0x3af7('0x2c')]-0x1:0x1;return null;}else if(_0xa835fa&&_0x4f48a9[_0xa835fa[_0x3af7('0x27')]]){_0xc00fe5=_0x4f48a9[_0xa835fa[_0x3af7('0x27')]](_0xa835fa);logger[_0x3af7('0x1d')](_0x3af7('0x2d'),JSON[_0x3af7('0x18')](_0xc00fe5,null,0x2));if(_0xc00fe5&&_0xc00fe5['code']===AGI_CODE_SUCCESS&&_0xc00fe5[_0x3af7('0x2e')]!==AGI_RESULT_ERROR&&!_0x4d6ad8[_0x3af7('0x2f')]){logger[_0x3af7('0x26')](_0x3af7('0x2d'),inspect(_0xc00fe5));return _[_0x3af7('0x30')](_0xc00fe5[_0x3af7('0x2e')])?null:_0xc00fe5['result'][_0x3af7('0x31')]();}else{logger[_0x3af7('0xa')](_0x3af7('0x2d'),inspect(_0xc00fe5));return null;}}else{logger[_0x3af7('0xa')](_0x3af7('0x32'));return null;}}catch(_0x5c1d17){logger['error'](_0x5c1d17[_0x3af7('0xb')]);return null;}});if(_0x574ef7[_0x3af7('0x33')]){logger[_0x3af7('0x1d')](util[_0x3af7('0x1a')](_0x3af7('0x34'),_0x4d6ad8['arg_1'],_0x4d6ad8[_0x3af7('0x20')],_0x4d6ad8[_0x3af7('0x35')],_0x4d6ad8[_0x3af7('0x21')],_0x4d6ad8[_0x3af7('0x22')]));_0x41d074['traverseBFS'](_0x574ef7[_0x3af7('0x33')]['id'],function(_0x264f3d){try{_0x264f3d=_0x4f48a9[_0x3af7('0x25')](_0x264f3d);logger[_0x3af7('0x26')](_0x3af7('0x36'),JSON[_0x3af7('0x18')](_0x264f3d,null,0x2));if(_0x264f3d&&_0x4f48a9[_0x264f3d[_0x3af7('0x27')]]){_0xc00fe5=_0x4f48a9[_0x264f3d[_0x3af7('0x27')]](_0x264f3d);if(_0xc00fe5){logger[_0x3af7('0x26')]('response',inspect(_0xc00fe5));return _[_0x3af7('0x30')](_0xc00fe5[_0x3af7('0x2e')])?null:_0xc00fe5[_0x3af7('0x2e')][_0x3af7('0x31')]();}else{logger[_0x3af7('0xa')](_0x3af7('0x2d'),inspect(_0xc00fe5));return null;}}else{logger[_0x3af7('0xa')](_0x3af7('0x32'));return null;}}catch(_0x337a31){logger['error'](_0x337a31[_0x3af7('0xb')]);return null;}});}logger[_0x3af7('0x1d')](util['format'](_0x3af7('0x37'),_0x4d6ad8['arg_1'],_0x4d6ad8[_0x3af7('0x20')],_0x4d6ad8['callerid'],_0x4d6ad8[_0x3af7('0x21')],_0x4d6ad8[_0x3af7('0x22')]));logger[_0x3af7('0x1d')](util[_0x3af7('0x1a')](_0x3af7('0x38'),_0x4d6ad8['context'],_0x4d6ad8[_0x3af7('0x2b')],parseInt(_0x4d6ad8[_0x3af7('0x2c')],0xa)+0x1));_0x4d6ad8['continueAt'](_0x4d6ad8['context'],_0x4d6ad8[_0x3af7('0x2b')],parseInt(_0x4d6ad8['priority'],0xa)+0x1);_0x4d6ad8[_0x3af7('0x39')]();}function handleNotFound(_0x466e50){logger[_0x3af7('0xa')](util['format'](_0x3af7('0x3a'),_0x466e50['arg_1']));_0x466e50[_0x3af7('0x3b')](_0x466e50[_0x3af7('0x2a')],_0x466e50[_0x3af7('0x2b')],parseInt(_0x466e50['priority'],0xa)+0x1);_0x466e50[_0x3af7('0x39')]();}function handleUnpublished(_0xef51fe){logger['error'](util['format'](_0x3af7('0x3c'),_0xef51fe[_0x3af7('0x1f')]));_0xef51fe['continueAt'](_0xef51fe['context'],_0xef51fe[_0x3af7('0x2b')],parseInt(_0xef51fe['priority'],0xa)+0x1);_0xef51fe[_0x3af7('0x39')]();}module[_0x3af7('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x8e19=['callerid','dnid','uniqueid','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','response','result','evtHangup','debug','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','isUndefined','[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','priority','continueAt','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','close','lodash','xml2json','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','production','start','root','stringify','joinAt','format','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname'];(function(_0x1fe730,_0xd1c412){var _0x52e5d1=function(_0x41d5aa){while(--_0x41d5aa){_0x1fe730['push'](_0x1fe730['shift']());}};_0x52e5d1(++_0xd1c412);}(_0x8e19,0x19b));var _0x98e1=function(_0x5d0347,_0x49ebd2){_0x5d0347=_0x5d0347-0x0;var _0xaaf756=_0x8e19[_0x5d0347];return _0xaaf756;};'use strict';var _=require(_0x98e1('0x0'));var moment=require('moment');var parser=require(_0x98e1('0x1'));var util=require('util');var logger=require(_0x98e1('0x2'))(_0x98e1('0x3'));var rpc=require(_0x98e1('0x4'));var mailRpc=require(_0x98e1('0x5'));var Graph=require(_0x98e1('0x6'));var Vertices=require(_0x98e1('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x98e1('0x8')]()[_0x98e1('0x9')](function(_0x131103){logger[_0x98e1('0xa')](_0x98e1('0xb'),_0x131103[_0x98e1('0xc')]);return[];});}function addVertex(_0x42c9c3,_0x3cff51,_0xcf3a39){_0x3cff51[_0x98e1('0xd')]=_0xcf3a39;if(_0x3cff51['hasOwnProperty'](_0x98e1('0xe'))){_0x3cff51[_0x98e1('0xf')]=parseInt(_0x3cff51['retry'],0xa);}_0x42c9c3[_0x98e1('0x10')](_[_0x98e1('0x11')](_0x3cff51,_0x98e1('0x12')));}function initGraph(_0x2fef1c,_0x356e55){var _0x32321f=new Graph();for(var _0x2e596c in _0x2fef1c){if(_0x2fef1c[_0x98e1('0x13')](_0x2e596c)){if(_[_0x98e1('0x14')](_0x2fef1c[_0x2e596c])){for(var _0xf55350=0x0;_0xf55350<_0x2fef1c[_0x2e596c]['length'];_0xf55350+=0x1){addVertex(_0x32321f,_0x2fef1c[_0x2e596c][_0xf55350],_0x2e596c);}}else{addVertex(_0x32321f,_0x2fef1c[_0x2e596c],_0x2e596c);}}}for(var _0x5b1046=0x0;_0x5b1046<_0x356e55[_0x98e1('0x15')];_0x5b1046+=0x1){if(_0x356e55[_0x5b1046][_0x98e1('0x16')]&&_0x356e55[_0x5b1046][_0x98e1('0x17')]){_0x32321f[_0x98e1('0x18')](_0x356e55[_0x5b1046]['source'],_0x356e55[_0x5b1046][_0x98e1('0x17')],_0x356e55[_0x5b1046][_0x98e1('0x19')]);}}return _0x32321f;}function getRoot(_0x59baeb){return parser[_0x98e1('0x1a')](_0x59baeb,{'object':!![]})[_0x98e1('0x1b')]['root'];}function inspect(_0x1d9715){return util['inspect'](_0x1d9715,{'showHidden':![],'depth':null});}function initialize(_0x2a2bcd,_0x1724f7){var _0x2257fb=getRoot(_0x2a2bcd[_0x98e1('0x1c')]);if(!_0x2257fb||!_0x2257fb[_0x98e1('0x1d')])return;var _0x345248,_0x99e4ab,_0x97bf3f;logger['debug'](_0x98e1('0x1e'),JSON[_0x98e1('0x1f')](_0x2257fb,null,0x2));_0x1724f7[_0x98e1('0x20')]=moment()[_0x98e1('0x21')]('YYYY-MM-DD\x20HH:mm:ss');_0x345248=initGraph(_[_0x98e1('0x11')](_0x2257fb,_0x98e1('0x12')),_0x2257fb[_0x98e1('0x12')]);_0x99e4ab=new Vertices(_0x1724f7,rpc,mailRpc);logger[_0x98e1('0x22')](util[_0x98e1('0x21')](_0x98e1('0x23'),_0x1724f7['arg_1'],_0x1724f7[_0x98e1('0x24')],_0x1724f7[_0x98e1('0x25')],_0x1724f7[_0x98e1('0x26')],_0x1724f7[_0x98e1('0x27')]));_0x345248[_0x98e1('0x28')](_0x2257fb['start']['id'],function(_0x4d59b8){try{_0x4d59b8=_0x99e4ab[_0x98e1('0x29')](_0x4d59b8);logger['debug'](_0x98e1('0x2a'),JSON[_0x98e1('0x1f')](_0x4d59b8,null,0x2));if(_0x4d59b8[_0x98e1('0xd')]===_0x98e1('0x2b')){logger[_0x98e1('0x22')](_0x98e1('0x2c'));_0x1724f7[_0x98e1('0x2d')]=_0x4d59b8[_0x98e1('0x2d')]||_0x1724f7[_0x98e1('0x2d')];_0x1724f7['extension']=_0x4d59b8[_0x98e1('0x2e')];_0x1724f7['priority']=_0x4d59b8['priority']?_0x4d59b8['priority']-0x1:0x1;return null;}else if(_0x4d59b8&&_0x99e4ab[_0x4d59b8['agicommand']]){_0x97bf3f=_0x99e4ab[_0x4d59b8[_0x98e1('0xd')]](_0x4d59b8);logger[_0x98e1('0x22')](_0x98e1('0x2f'),JSON[_0x98e1('0x1f')](_0x97bf3f,null,0x2));if(_0x97bf3f&&_0x97bf3f['code']===AGI_CODE_SUCCESS&&_0x97bf3f[_0x98e1('0x30')]!==AGI_RESULT_ERROR&&!_0x1724f7[_0x98e1('0x31')]){logger[_0x98e1('0x32')](_0x98e1('0x2f'),inspect(_0x97bf3f));return _['isUndefined'](_0x97bf3f[_0x98e1('0x30')])?null:_0x97bf3f[_0x98e1('0x30')][_0x98e1('0x33')]();}else{logger[_0x98e1('0xa')](_0x98e1('0x2f'),inspect(_0x97bf3f));return null;}}else{logger['error'](_0x98e1('0x34'));return null;}}catch(_0x4b83f0){logger[_0x98e1('0xa')](_0x4b83f0[_0x98e1('0xc')]);return null;}});if(_0x2257fb[_0x98e1('0x35')]){logger[_0x98e1('0x22')](util[_0x98e1('0x21')](_0x98e1('0x36'),_0x1724f7[_0x98e1('0x37')],_0x1724f7[_0x98e1('0x24')],_0x1724f7[_0x98e1('0x25')],_0x1724f7[_0x98e1('0x26')],_0x1724f7[_0x98e1('0x27')]));_0x345248[_0x98e1('0x28')](_0x2257fb[_0x98e1('0x35')]['id'],function(_0x2e621e){try{_0x2e621e=_0x99e4ab[_0x98e1('0x29')](_0x2e621e);logger[_0x98e1('0x32')](_0x98e1('0x2a'),JSON[_0x98e1('0x1f')](_0x2e621e,null,0x2));if(_0x2e621e&&_0x99e4ab[_0x2e621e[_0x98e1('0xd')]]){_0x97bf3f=_0x99e4ab[_0x2e621e[_0x98e1('0xd')]](_0x2e621e);if(_0x97bf3f){logger[_0x98e1('0x32')]('response',inspect(_0x97bf3f));return _[_0x98e1('0x38')](_0x97bf3f['result'])?null:_0x97bf3f[_0x98e1('0x30')]['toString']();}else{logger[_0x98e1('0xa')]('response',inspect(_0x97bf3f));return null;}}else{logger[_0x98e1('0xa')](_0x98e1('0x34'));return null;}}catch(_0x410c3d){logger[_0x98e1('0xa')](_0x410c3d[_0x98e1('0xc')]);return null;}});}logger[_0x98e1('0x22')](util[_0x98e1('0x21')](_0x98e1('0x39'),_0x1724f7[_0x98e1('0x37')],_0x1724f7['calleridname'],_0x1724f7[_0x98e1('0x25')],_0x1724f7['dnid'],_0x1724f7['uniqueid']));logger['info'](util[_0x98e1('0x21')](_0x98e1('0x3a'),_0x1724f7[_0x98e1('0x2d')],_0x1724f7[_0x98e1('0x2e')],parseInt(_0x1724f7[_0x98e1('0x3b')],0xa)+0x1));_0x1724f7[_0x98e1('0x3c')](_0x1724f7['context'],_0x1724f7[_0x98e1('0x2e')],parseInt(_0x1724f7[_0x98e1('0x3b')],0xa)+0x1);_0x1724f7['close']();}function handleNotFound(_0x5cbaa4){logger[_0x98e1('0xa')](util[_0x98e1('0x21')](_0x98e1('0x3d'),_0x5cbaa4[_0x98e1('0x37')]));_0x5cbaa4['continueAt'](_0x5cbaa4[_0x98e1('0x2d')],_0x5cbaa4[_0x98e1('0x2e')],parseInt(_0x5cbaa4[_0x98e1('0x3b')],0xa)+0x1);_0x5cbaa4['close']();}function handleUnpublished(_0x413831){logger['error'](util[_0x98e1('0x21')](_0x98e1('0x3e'),_0x413831['arg_1']));_0x413831[_0x98e1('0x3c')](_0x413831[_0x98e1('0x2d')],_0x413831[_0x98e1('0x2e')],parseInt(_0x413831[_0x98e1('0x3b')],0xa)+0x1);_0x413831[_0x98e1('0x3f')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 57462b4..21407c1 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 _0xb226=['stream','Transform','call','_inBody','inherits','prototype','_transform','_localBuffer','substring','length','split','indexOf','slice','trim','headers','emit','line','exports','util'];(function(_0x4fcc05,_0x531262){var _0x38a9eb=function(_0x565d6b){while(--_0x565d6b){_0x4fcc05['push'](_0x4fcc05['shift']());}};_0x38a9eb(++_0x531262);}(_0xb226,0x11c));var _0x6b22=function(_0x435193,_0x24b26b){_0x435193=_0x435193-0x0;var _0x429c61=_0xb226[_0x435193];return _0x429c61;};'use strict';var util=require(_0x6b22('0x0'));var Transform=require(_0x6b22('0x1'))[_0x6b22('0x2')];function AGIReply(_0x51edf6){Transform[_0x6b22('0x3')](this,_0x51edf6);this['_localBuffer']='';this[_0x6b22('0x4')]=![];}util[_0x6b22('0x5')](AGIReply,Transform);AGIReply[_0x6b22('0x6')][_0x6b22('0x7')]=function(_0x501ed5,_0x3e8fb7,_0x1a7574){var _0x3edcd0='\x0a',_0x38fd1f=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x412fa4=-0x1,_0x221f3f=-0x1,_0x1bc8a7='',_0x255010=0x0,_0x219a88='',_0x7c5fa4='';this[_0x6b22('0x8')]+=_0x501ed5['toString']();_0x219a88=this[_0x6b22('0x8')];if(!this[_0x6b22('0x4')]){_0x255010=0x0;while(_0x38fd1f[_0x255010]){while((_0x221f3f=_0x219a88['indexOf'](_0x38fd1f[_0x255010]))!=-0x1){_0x1bc8a7=_0x38fd1f[_0x255010];_0x7c5fa4=_0x219a88[_0x6b22('0x9')](0x0,_0x221f3f);_0x219a88=_0x219a88['substring'](_0x221f3f+_0x1bc8a7[_0x6b22('0xa')]);var _0x121148=_0x7c5fa4[_0x6b22('0xb')](_0x3edcd0),_0x427fbb=0x0,_0x3e69db={},_0x1d3e25='',_0x2ad007='',_0xe26e19=-0x1;while(_0x121148[_0x427fbb]){_0xe26e19=_0x121148[_0x427fbb][_0x6b22('0xc')](':');if(_0xe26e19!=-0x1){_0x1d3e25=_0x121148[_0x427fbb][_0x6b22('0xd')](0x0,_0xe26e19)[_0x6b22('0xe')]();_0x2ad007=_0x121148[_0x427fbb]['slice'](_0xe26e19+0x1)[_0x6b22('0xe')]();if(_0x1d3e25[_0x6b22('0xa')]>0x0){_0x3e69db[_0x1d3e25]=_0x2ad007;}}else{}_0x427fbb++;}this['emit'](_0x6b22('0xf'),_0x3e69db);this['_inBody']=!![];}_0x255010++;}this['_localBuffer']=_0x219a88;}else{while((_0x412fa4=_0x219a88['indexOf'](_0x3edcd0))!=-0x1){_0x7c5fa4=_0x219a88[_0x6b22('0x9')](0x0,_0x412fa4);this[_0x6b22('0x10')](_0x6b22('0x11'),_0x7c5fa4);_0x219a88=_0x219a88[_0x6b22('0x9')](_0x412fa4+_0x3edcd0['length']);}this[_0x6b22('0x8')]=_0x219a88;}_0x1a7574();};module[_0x6b22('0x12')]=AGIReply; \ No newline at end of file +var _0xba47=['emit','headers','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','_transform','toString','indexOf','substring','slice','trim','length'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xba47,0x1ac));var _0x7ba4=function(_0x19d2d0,_0xbe044a){_0x19d2d0=_0x19d2d0-0x0;var _0xe418c4=_0xba47[_0x19d2d0];return _0xe418c4;};'use strict';var util=require(_0x7ba4('0x0'));var Transform=require(_0x7ba4('0x1'))[_0x7ba4('0x2')];function AGIReply(_0x4c18e5){Transform[_0x7ba4('0x3')](this,_0x4c18e5);this[_0x7ba4('0x4')]='';this[_0x7ba4('0x5')]=![];}util[_0x7ba4('0x6')](AGIReply,Transform);AGIReply['prototype'][_0x7ba4('0x7')]=function(_0x3df285,_0x47ac80,_0x4f8c2d){var _0x565107='\x0a',_0x11ea18=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x932508=-0x1,_0x227abe=-0x1,_0x7963fa='',_0x380790=0x0,_0xa58ac3='',_0x224ec0='';this['_localBuffer']+=_0x3df285[_0x7ba4('0x8')]();_0xa58ac3=this['_localBuffer'];if(!this[_0x7ba4('0x5')]){_0x380790=0x0;while(_0x11ea18[_0x380790]){while((_0x227abe=_0xa58ac3[_0x7ba4('0x9')](_0x11ea18[_0x380790]))!=-0x1){_0x7963fa=_0x11ea18[_0x380790];_0x224ec0=_0xa58ac3[_0x7ba4('0xa')](0x0,_0x227abe);_0xa58ac3=_0xa58ac3[_0x7ba4('0xa')](_0x227abe+_0x7963fa['length']);var _0x143384=_0x224ec0['split'](_0x565107),_0xea3411=0x0,_0x4ffe3c={},_0x83d2c='',_0x266be2='',_0x2fdee0=-0x1;while(_0x143384[_0xea3411]){_0x2fdee0=_0x143384[_0xea3411][_0x7ba4('0x9')](':');if(_0x2fdee0!=-0x1){_0x83d2c=_0x143384[_0xea3411][_0x7ba4('0xb')](0x0,_0x2fdee0)[_0x7ba4('0xc')]();_0x266be2=_0x143384[_0xea3411][_0x7ba4('0xb')](_0x2fdee0+0x1)[_0x7ba4('0xc')]();if(_0x83d2c[_0x7ba4('0xd')]>0x0){_0x4ffe3c[_0x83d2c]=_0x266be2;}}else{}_0xea3411++;}this[_0x7ba4('0xe')](_0x7ba4('0xf'),_0x4ffe3c);this[_0x7ba4('0x5')]=!![];}_0x380790++;}this['_localBuffer']=_0xa58ac3;}else{while((_0x932508=_0xa58ac3['indexOf'](_0x565107))!=-0x1){_0x224ec0=_0xa58ac3[_0x7ba4('0xa')](0x0,_0x932508);this[_0x7ba4('0xe')]('line',_0x224ec0);_0xa58ac3=_0xa58ac3[_0x7ba4('0xa')](_0x932508+_0x565107[_0x7ba4('0xd')]);}this[_0x7ba4('0x4')]=_0xa58ac3;}_0x4f8c2d();};module[_0x7ba4('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 3898fab..3119570 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 _0xbe02=['getPauseById','agentLogin','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment','jayson/promise','client','request','then','error','message','result','getSquareProjects','production','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','CloudProvider','getSquareProjectById','name','ShowVoiceQueue','getVariableById','ShowSquareOdbc','dsn','getUserById','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact'];(function(_0x1aab33,_0x327f92){var _0x4bf0df=function(_0x278ffa){while(--_0x278ffa){_0x1aab33['push'](_0x1aab33['shift']());}};_0x4bf0df(++_0x327f92);}(_0xbe02,0x124));var _0x2be0=function(_0x50d6be,_0x41fb7b){_0x50d6be=_0x50d6be-0x0;var _0x590b47=_0xbe02[_0x50d6be];return _0x590b47;};'use strict';var _=require('lodash');var moment=require(_0x2be0('0x0'));var jayson=require(_0x2be0('0x1'));var client=jayson[_0x2be0('0x2')]['http']({'port':0x2329});function request(_0x499c2b,_0x1d7a85){return new Promise(function(_0x248e93,_0x506aad){return client[_0x2be0('0x3')](_0x499c2b,_0x1d7a85)[_0x2be0('0x4')](function(_0x443ace){if(_0x443ace[_0x2be0('0x5')]){return _0x506aad(_0x443ace[_0x2be0('0x5')][_0x2be0('0x6')]);}else{return _0x248e93(_0x443ace[_0x2be0('0x7')]);}})['catch'](function(_0xdf1605){return _0x506aad(_0xdf1605);});});}exports[_0x2be0('0x8')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id','name',_0x2be0('0x9')]}});};exports['getSquareProject']=function(_0xebe843){return request(_0x2be0('0xa'),{'options':{'raw':![],'where':{'name':_0xebe843},'attributes':[_0x2be0('0x9')]}});};exports[_0x2be0('0xb')]=function(_0x104667){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x104667},'include':[{'model':_0x2be0('0xc'),'as':_0x2be0('0xd'),'include':[{'model':_0x2be0('0xe'),'as':_0x2be0('0xe')}]}],'attributes':['id','name','email'],'smtp':!![]}});};exports[_0x2be0('0xf')]=function(_0x3baa57){return request(_0x2be0('0xa'),{'options':{'where':{'id':_0x3baa57},'attributes':[_0x2be0('0x10')]}});};exports['getVoiceQueueById']=function(_0x44d709){return request(_0x2be0('0x11'),{'options':{'where':{'id':_0x44d709},'attributes':[_0x2be0('0x10')]}});};exports[_0x2be0('0x12')]=function(_0x818f20){return request('ShowVariable',{'options':{'where':{'id':_0x818f20},'attributes':[_0x2be0('0x10')]}});};exports['getSquareOdbcById']=function(_0x698b89){return request(_0x2be0('0x13'),{'options':{'where':{'id':_0x698b89},'attributes':[_0x2be0('0x14')]}});};exports[_0x2be0('0x15')]=function(_0x3c247e){return request('ShowUser',{'options':{'where':{'id':_0x3c247e},'attributes':[_0x2be0('0x10')]}});};exports['getContactByPhone']=function(_0x473c97){return request(_0x2be0('0x16'),{'options':{'where':{'phone':_0x473c97[_0x2be0('0x17')]},'attributes':['id']}});};exports[_0x2be0('0x18')]=function(_0xc3b92a){return request(_0x2be0('0x19'),{'options':{'where':{'id':_0xc3b92a},'attributes':[_0x2be0('0x10')]}});};exports[_0x2be0('0x1a')]=function(_0x98bad6){return request('ShowSound',{'options':{'where':{'id':_0x98bad6},'attributes':[_0x2be0('0x1b')]}});};exports[_0x2be0('0x1c')]=function(_0x2cba28){return request(_0x2be0('0x1d'),{'options':{'raw':![],'where':{'id':_0x2cba28},'include':[{'model':'Interval','as':_0x2be0('0x1e')}]}});};exports[_0x2be0('0x1f')]=function(_0x55ea94){return request('ShowSmsAccount',{'options':{'where':{'id':_0x55ea94},'attributes':['id',_0x2be0('0x10')]}});};exports['createSmsMessage']=function(_0x20eb86){return request(_0x2be0('0x20'),{'body':_0x20eb86});};exports[_0x2be0('0x21')]=function(_0x4e6e4c){return request(_0x2be0('0x22'),{'body':_0x4e6e4c});};exports[_0x2be0('0x23')]=function(_0xab3a77){return request(_0x2be0('0x24'),{'body':_[_0x2be0('0x25')](_0xab3a77,{'project_name':_0xab3a77[_0x2be0('0x26')],'prev_project_name':_0xab3a77['arg_2']||'','is_subproject':_0xab3a77[_0x2be0('0x27')]?!![]:![],'leaveAt':moment()[_0x2be0('0x28')](_0x2be0('0x29'))})});};exports[_0x2be0('0x2a')]=function(_0x4686ca){return request(_0x2be0('0x2b'),{'body':_0x4686ca});};exports[_0x2be0('0x2c')]=function(_0xb83ebf){return request(_0x2be0('0x2d'),{'body':_0xb83ebf});};exports[_0x2be0('0x2e')]=function(_0x131dfb){return request(_0x2be0('0x2f'),{'options':{'raw':![],'where':{'phone':_0x131dfb[_0x2be0('0x17')],'ListId':_0x131dfb[_0x2be0('0x30')]}}})[_0x2be0('0x4')](function(_0x273df5){if(_0x273df5){return _0x273df5;}return request(_0x2be0('0x31'),{'body':_0x131dfb});});};exports[_0x2be0('0x32')]=function(_0x36d7c7){return request('ShowPause',{'options':{'where':{'id':_0x36d7c7},'attributes':['name']}});};exports[_0x2be0('0x33')]=function(_0x263479,_0x2745b9){return request('LoginUser',{'body':{'interface':_0x2745b9},'options':{'where':_0x263479}});};exports['agentPause']=function(_0x41ad52,_0x53020e,_0x316d9f){return request(_0x2be0('0x34'),{'body':{'type':_0x53020e,'uniqueid':_0x316d9f},'options':{'where':_0x41ad52}});};exports[_0x2be0('0x35')]=function(_0x229d7d){return request(_0x2be0('0x36'),{'body':{},'options':{'where':_0x229d7d}});};exports[_0x2be0('0x37')]=function(_0x44e36b){return request(_0x2be0('0x38'),{'body':{},'options':{'where':_0x44e36b}});}; \ No newline at end of file +var _0x2557=['getMailAccountById','ShowMailAccount','Smtp','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','LogoutUser','lodash','jayson/promise','client','http','error','message','result','catch','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','production'];(function(_0x2be367,_0xd557e5){var _0x30239d=function(_0x322b45){while(--_0x322b45){_0x2be367['push'](_0x2be367['shift']());}};_0x30239d(++_0xd557e5);}(_0x2557,0x11e));var _0x7255=function(_0x1de895,_0x11cb4b){_0x1de895=_0x1de895-0x0;var _0x4b7c19=_0x2557[_0x1de895];return _0x4b7c19;};'use strict';var _=require(_0x7255('0x0'));var moment=require('moment');var jayson=require(_0x7255('0x1'));var client=jayson[_0x7255('0x2')][_0x7255('0x3')]({'port':0x2329});function request(_0x1d8176,_0x1db25c){return new Promise(function(_0x20bb40,_0x5994ca){return client['request'](_0x1d8176,_0x1db25c)['then'](function(_0x572124){if(_0x572124[_0x7255('0x4')]){return _0x5994ca(_0x572124[_0x7255('0x4')][_0x7255('0x5')]);}else{return _0x20bb40(_0x572124[_0x7255('0x6')]);}})[_0x7255('0x7')](function(_0x5b6aa4){return _0x5994ca(_0x5b6aa4);});});}exports[_0x7255('0x8')]=function(){return request(_0x7255('0x9'),{'options':{'raw':![],'attributes':['id',_0x7255('0xa'),'production']}});};exports[_0x7255('0xb')]=function(_0x18f985){return request(_0x7255('0xc'),{'options':{'raw':![],'where':{'name':_0x18f985},'attributes':[_0x7255('0xd')]}});};exports[_0x7255('0xe')]=function(_0x17601b){return request(_0x7255('0xf'),{'options':{'raw':![],'where':{'id':_0x17601b},'include':[{'model':'MailServerOut','as':_0x7255('0x10'),'include':[{'model':'CloudProvider','as':'CloudProvider'}]}],'attributes':['id','name',_0x7255('0x11')],'smtp':!![]}});};exports[_0x7255('0x12')]=function(_0x2bb148){return request(_0x7255('0xc'),{'options':{'where':{'id':_0x2bb148},'attributes':[_0x7255('0xa')]}});};exports[_0x7255('0x13')]=function(_0x44a4de){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x44a4de},'attributes':[_0x7255('0xa')]}});};exports[_0x7255('0x14')]=function(_0x1c565b){return request(_0x7255('0x15'),{'options':{'where':{'id':_0x1c565b},'attributes':[_0x7255('0xa')]}});};exports[_0x7255('0x16')]=function(_0xa7b77d){return request(_0x7255('0x17'),{'options':{'where':{'id':_0xa7b77d},'attributes':[_0x7255('0x18')]}});};exports[_0x7255('0x19')]=function(_0x2e6489){return request(_0x7255('0x1a'),{'options':{'where':{'id':_0x2e6489},'attributes':[_0x7255('0xa')]}});};exports[_0x7255('0x1b')]=function(_0x3db713){return request(_0x7255('0x1c'),{'options':{'where':{'phone':_0x3db713[_0x7255('0x1d')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x4f26da){return request(_0x7255('0x1e'),{'options':{'where':{'id':_0x4f26da},'attributes':[_0x7255('0xa')]}});};exports[_0x7255('0x1f')]=function(_0xf8fb0){return request('ShowSound',{'options':{'where':{'id':_0xf8fb0},'attributes':[_0x7255('0x20')]}});};exports[_0x7255('0x21')]=function(_0x1be0c4){return request(_0x7255('0x22'),{'options':{'raw':![],'where':{'id':_0x1be0c4},'include':[{'model':_0x7255('0x23'),'as':_0x7255('0x24')}]}});};exports[_0x7255('0x25')]=function(_0x9fdfea){return request('ShowSmsAccount',{'options':{'where':{'id':_0x9fdfea},'attributes':['id',_0x7255('0xa')]}});};exports[_0x7255('0x26')]=function(_0x3f6fea){return request(_0x7255('0x27'),{'body':_0x3f6fea});};exports[_0x7255('0x28')]=function(_0x35dd34){return request(_0x7255('0x29'),{'body':_0x35dd34});};exports['createSquareReport']=function(_0xbf4285){return request(_0x7255('0x2a'),{'body':_[_0x7255('0x2b')](_0xbf4285,{'project_name':_0xbf4285['arg_1'],'prev_project_name':_0xbf4285[_0x7255('0x2c')]||'','is_subproject':_0xbf4285['arg_2']?!![]:![],'leaveAt':moment()[_0x7255('0x2d')](_0x7255('0x2e'))})});};exports['createSquareRecording']=function(_0xe0b108){return request(_0x7255('0x2f'),{'body':_0xe0b108});};exports[_0x7255('0x30')]=function(_0x3dc004){return request(_0x7255('0x31'),{'body':_0x3dc004});};exports[_0x7255('0x32')]=function(_0x54e53a){return request(_0x7255('0x33'),{'options':{'raw':![],'where':{'phone':_0x54e53a[_0x7255('0x1d')],'ListId':_0x54e53a['ListId']}}})['then'](function(_0x22cc6e){if(_0x22cc6e){return _0x22cc6e;}return request(_0x7255('0x34'),{'body':_0x54e53a});});};exports[_0x7255('0x35')]=function(_0x3eeb50){return request(_0x7255('0x36'),{'options':{'where':{'id':_0x3eeb50},'attributes':[_0x7255('0xa')]}});};exports[_0x7255('0x37')]=function(_0x464bc0,_0x5bcb34){return request(_0x7255('0x38'),{'body':{'interface':_0x5bcb34},'options':{'where':_0x464bc0}});};exports['agentPause']=function(_0x162169,_0x5af1af,_0x11635f){return request(_0x7255('0x39'),{'body':{'type':_0x5af1af,'uniqueid':_0x11635f},'options':{'where':_0x162169}});};exports[_0x7255('0x3a')]=function(_0x576583){return request('UnpauseUser',{'body':{},'options':{'where':_0x576583}});};exports['agentLogout']=function(_0x1c019f){return request(_0x7255('0x3b'),{'body':{},'options':{'where':_0x1c019f}});}; \ 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 6761691..abe2cc2 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 _0x4300=['./polly'];(function(_0x4232dc,_0x55876d){var _0x4c758c=function(_0x4797b2){while(--_0x4797b2){_0x4232dc['push'](_0x4232dc['shift']());}};_0x4c758c(++_0x55876d);}(_0x4300,0x1a6));var _0x0430=function(_0x5e103f,_0x5111e4){_0x5e103f=_0x5e103f-0x0;var _0x1b439c=_0x4300[_0x5e103f];return _0x1b439c;};var polly=require(_0x0430('0x0'));var lex=require('./lex');module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x8f6b=['./lex','exports','./polly'];(function(_0x284d20,_0x5c4157){var _0x4283d6=function(_0x1c0d7e){while(--_0x1c0d7e){_0x284d20['push'](_0x284d20['shift']());}};_0x4283d6(++_0x5c4157);}(_0x8f6b,0x146));var _0xb8f6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x8f6b[_0x397e5f];return _0x5302b8;};var polly=require(_0xb8f6('0x0'));var lex=require(_0xb8f6('0x1'));module[_0xb8f6('0x2')]={'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 efee299..f29c86e 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 _0x6f7a=['./lib/api','exports'];(function(_0x5084f4,_0x446901){var _0x3c0d8d=function(_0x5a4d00){while(--_0x5a4d00){_0x5084f4['push'](_0x5084f4['shift']());}};_0x3c0d8d(++_0x446901);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x1b3790,_0x2621dc){_0x1b3790=_0x1b3790-0x0;var _0x4821c2=_0x6f7a[_0x1b3790];return _0x4821c2;};'use strict';var lex=require(_0xa6f7('0x0'));module[_0xa6f7('0x1')]=function(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8){return lex(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8);}; \ No newline at end of file +var _0xe706=['exports','./lib/api'];(function(_0x300f36,_0x32d8ab){var _0x43b53d=function(_0x3fe5d2){while(--_0x3fe5d2){_0x300f36['push'](_0x300f36['shift']());}};_0x43b53d(++_0x32d8ab);}(_0xe706,0xa3));var _0x6e70=function(_0x26a906,_0x3d135c){_0x26a906=_0x26a906-0x0;var _0x495575=_0xe706[_0x26a906];return _0x495575;};'use strict';var lex=require(_0x6e70('0x0'));module[_0x6e70('0x1')]=function(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3){return lex(_0x311951,_0x5e8446,_0x2cae77,_0x315629,_0x2ca810,_0x7dfbc3);}; \ 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 8ace1d6..b0a6525 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(_0xaecb2b,_0x1a4fab){var _0x38c762=function(_0x5f0e30){while(--_0x5f0e30){_0xaecb2b['push'](_0xaecb2b['shift']());}};_0x38c762(++_0x1a4fab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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(_0x21fcf8,_0x37a019){var _0x5184df=function(_0xb58854){while(--_0xb58854){_0x21fcf8['push'](_0x21fcf8['shift']());}};_0x5184df(++_0x37a019);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 7d6f260..29f615e 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 _0x848d=['./lib/api','exports'];(function(_0x5a7618,_0x3f44c2){var _0x12dc65=function(_0x3cc4cd){while(--_0x3cc4cd){_0x5a7618['push'](_0x5a7618['shift']());}};_0x12dc65(++_0x3f44c2);}(_0x848d,0x64));var _0xd848=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x848d[_0x3dd15e];return _0x231fd0;};'use strict';var polly=require(_0xd848('0x0'));module[_0xd848('0x1')]=function(_0x508595,_0x43dc31,_0x3dbd47,_0x3494e0,_0x4a6952,_0x5786d6,_0x3e8217){return polly(_0x508595,_0x43dc31,_0x3dbd47,_0x3494e0,_0x4a6952,_0x5786d6,_0x3e8217);}; \ No newline at end of file +var _0x1bc8=['exports','./lib/api'];(function(_0xe62d5,_0x35cbb4){var _0x2973ae=function(_0x2980de){while(--_0x2980de){_0xe62d5['push'](_0xe62d5['shift']());}};_0x2973ae(++_0x35cbb4);}(_0x1bc8,0xbd));var _0x81bc=function(_0x4282aa,_0xe66504){_0x4282aa=_0x4282aa-0x0;var _0x5085f0=_0x1bc8[_0x4282aa];return _0x5085f0;};'use strict';var polly=require(_0x81bc('0x0'));module[_0x81bc('0x1')]=function(_0x195fec,_0x91021a,_0x2751bd,_0x20abd3,_0x2c2366,_0x15a0a7,_0x3729dc){return polly(_0x195fec,_0x91021a,_0x2751bd,_0x20abd3,_0x2c2366,_0x15a0a7,_0x3729dc);}; \ 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 148be2b..807e9cd 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 _0x111b=['path','aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x111b,0xfa));var _0xb111=function(_0xfce093,_0x4e9dab){_0xfce093=_0xfce093-0x0;var _0x582743=_0x111b[_0xfce093];return _0x582743;};'use strict';var fs=require('fs');var path=require(_0xb111('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0xb111('0x1'));function pollyResult(_0x4a6a75,_0x1b66f5,_0x103b0a){return new BPromise(function(_0x148a45,_0x1a9fb7){_0x4a6a75[_0xb111('0x2')](_0x1b66f5,function(_0x3c0ee2,_0x27d4e2){if(_0x3c0ee2){_0x1a9fb7(_0x3c0ee2);}else if(_0x27d4e2){if(_0x27d4e2['AudioStream']instanceof Buffer){fs[_0xb111('0x3')](_0x103b0a,_0x27d4e2[_0xb111('0x4')],function(_0x4d9a31){if(_0x4d9a31){_0x1a9fb7(_0x4d9a31);}else{_0x148a45();}});}else{_0x1a9fb7(new Error(_0xb111('0x5')));}}else{_0x1a9fb7(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xb111('0x6')]=function(_0x2173b9,_0x4f886d,_0x4e09c1,_0x152407,_0x492fcf,_0x45a2a2,_0x16a728){var _0x55bf3c=new AWS[(_0xb111('0x7'))]({'accessKeyId':_0x2173b9,'secretAccessKey':_0x4f886d,'region':_0x4e09c1});var _0x26a059={'Text':_0x492fcf,'TextType':_0x45a2a2||_0xb111('0x8'),'OutputFormat':_0xb111('0x9'),'VoiceId':_0x152407};return pollyResult(_0x55bf3c,_0x26a059,_0x16a728);}; \ No newline at end of file +var _0x972e=['exports','Polly','mp3','path','bluebird','randomstring','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x121b1a,_0x42fdb7){var _0x2d89a6=function(_0x1b6027){while(--_0x1b6027){_0x121b1a['push'](_0x121b1a['shift']());}};_0x2d89a6(++_0x42fdb7);}(_0x972e,0x1c6));var _0xe972=function(_0x776f54,_0x3c001c){_0x776f54=_0x776f54-0x0;var _0x2a04fc=_0x972e[_0x776f54];return _0x2a04fc;};'use strict';var fs=require('fs');var path=require(_0xe972('0x0'));var BPromise=require(_0xe972('0x1'));var rs=require(_0xe972('0x2'));var AWS=require(_0xe972('0x3'));function pollyResult(_0x3ca441,_0xd34869,_0x1645cb){return new BPromise(function(_0x3f0e5a,_0x18f4b8){_0x3ca441['synthesizeSpeech'](_0xd34869,function(_0x4c564c,_0x306001){if(_0x4c564c){_0x18f4b8(_0x4c564c);}else if(_0x306001){if(_0x306001[_0xe972('0x4')]instanceof Buffer){fs[_0xe972('0x5')](_0x1645cb,_0x306001['AudioStream'],function(_0x34e2ee){if(_0x34e2ee){_0x18f4b8(_0x34e2ee);}else{_0x3f0e5a();}});}else{_0x18f4b8(new Error(_0xe972('0x6')));}}else{_0x18f4b8(new Error(_0xe972('0x7')));}});});}module[_0xe972('0x8')]=function(_0x57e028,_0xdd218,_0x321ce7,_0x4cff0d,_0x586d49,_0x257f8e,_0x1dd76a){var _0x54176c=new AWS[(_0xe972('0x9'))]({'accessKeyId':_0x57e028,'secretAccessKey':_0xdd218,'region':_0x321ce7});var _0x1295a0={'Text':_0x586d49,'TextType':_0x257f8e||'text','OutputFormat':_0xe972('0xa'),'VoiceId':_0x4cff0d};return pollyResult(_0x54176c,_0x1295a0,_0x1dd76a);}; \ 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 f556588..deb9712 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10fc=['./lib/api','exports'];(function(_0x179d07,_0x29431a){var _0xbcbe0b=function(_0xaefa24){while(--_0xaefa24){_0x179d07['push'](_0x179d07['shift']());}};_0xbcbe0b(++_0x29431a);}(_0x10fc,0x64));var _0xc10f=function(_0x44bb2d,_0x250ab5){_0x44bb2d=_0x44bb2d-0x0;var _0x47c1fa=_0x10fc[_0x44bb2d];return _0x47c1fa;};'use strict';var asr=require(_0xc10f('0x0'));module[_0xc10f('0x1')]=function(_0x11007f,_0x14d8de,_0x804977,_0x14d29d){return asr(_0x11007f,_0x14d8de,_0x804977);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x43aedc,_0x3cc3c9,_0x457a19,_0x2a1660){return asr(_0x43aedc,_0x3cc3c9,_0x457a19);}; \ 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 fb41b22..95b03cc 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 _0xbd3b=['POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xbd3b,0x1c3));var _0xbbd3=function(_0xca04ff,_0xcb449f){_0xca04ff=_0xca04ff-0x0;var _0x6b547=_0xbd3b[_0xca04ff];return _0x6b547;};'use strict';var url=require(_0xbbd3('0x0'));var BPromise=require(_0xbbd3('0x1'));var fs=require('fs');var host=_0xbbd3('0x2');module['exports']=function(_0x5e9577,_0xe94b7b,_0x1cf5ef){return new BPromise(function(_0x13b296,_0x4e911b){var _0x173684;if(typeof _0x5e9577!==_0xbbd3('0x3')||_0x5e9577['length']===0x0){return _0x4e911b(_0xbbd3('0x4'));}if(typeof _0xe94b7b!=='string'||_0xe94b7b[_0xbbd3('0x5')]===0x0){return _0x4e911b(_0xbbd3('0x6'));}if(typeof _0x1cf5ef!==_0xbbd3('0x7')&&(typeof _0x1cf5ef!=='string'||_0x1cf5ef[_0xbbd3('0x5')]===0x0)){return _0x4e911b(_0xbbd3('0x8'));}try{_0x173684=fs[_0xbbd3('0x9')](_0x5e9577)[_0xbbd3('0xa')]('base64');}catch(_0xeade3a){return _0x4e911b(_0xeade3a);}return _0x13b296({'method':_0xbbd3('0xb'),'uri':host+_0xbbd3('0xc')+_0xe94b7b,'body':{'config':{'encoding':_0xbbd3('0xd'),'sampleRateHertz':'8000','languageCode':_0x1cf5ef},'audio':{'content':_0x173684}},'json':!![]});});}; \ No newline at end of file +var _0x063c=['undefined','length','readFileSync','toString','POST','LINEAR16','bluebird','https://speech.googleapis.com','exports','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string'];(function(_0x2fd7d5,_0x3ac631){var _0x54bb19=function(_0x5663d0){while(--_0x5663d0){_0x2fd7d5['push'](_0x2fd7d5['shift']());}};_0x54bb19(++_0x3ac631);}(_0x063c,0xba));var _0xc063=function(_0x3e4b7a,_0x2e4e1a){_0x3e4b7a=_0x3e4b7a-0x0;var _0x54e20d=_0x063c[_0x3e4b7a];return _0x54e20d;};'use strict';var url=require('url');var BPromise=require(_0xc063('0x0'));var fs=require('fs');var host=_0xc063('0x1');module[_0xc063('0x2')]=function(_0x25e61c,_0x314f1b,_0x33d075){return new BPromise(function(_0x5aa766,_0x3803ac){var _0x5ec48e;if(typeof _0x25e61c!=='string'||_0x25e61c['length']===0x0){return _0x3803ac(_0xc063('0x3'));}if(typeof _0x314f1b!==_0xc063('0x4')||_0x314f1b['length']===0x0){return _0x3803ac(_0xc063('0x5'));}if(typeof _0x33d075!==_0xc063('0x6')&&(typeof _0x33d075!==_0xc063('0x4')||_0x33d075[_0xc063('0x7')]===0x0)){return _0x3803ac('lang\x20should\x20be\x20a\x20string');}try{_0x5ec48e=fs[_0xc063('0x8')](_0x25e61c)[_0xc063('0x9')]('base64');}catch(_0x34d40a){return _0x3803ac(_0x34d40a);}return _0x5aa766({'method':_0xc063('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x314f1b,'body':{'config':{'encoding':_0xc063('0xb'),'sampleRateHertz':'8000','languageCode':_0x33d075},'audio':{'content':_0x5ec48e}},'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 0b36e59..714637a 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 _0x61b7=['exports','./asr'];(function(_0x1f09fa,_0x3265ca){var _0x197c8d=function(_0x91c3b){while(--_0x91c3b){_0x1f09fa['push'](_0x1f09fa['shift']());}};_0x197c8d(++_0x3265ca);}(_0x61b7,0x1d1));var _0x761b=function(_0x18aed6,_0x490395){_0x18aed6=_0x18aed6-0x0;var _0x52195e=_0x61b7[_0x18aed6];return _0x52195e;};var asr=require(_0x761b('0x0'));module[_0x761b('0x1')]={'asr':asr}; \ No newline at end of file +var _0x32be=['exports'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x32be,0x153));var _0xe32b=function(_0x321df4,_0x3efec5){_0x321df4=_0x321df4-0x0;var _0x50d06c=_0x32be[_0x321df4];return _0x50d06c;};var asr=require('./asr');module[_0xe32b('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 91a7eed..a11452c 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 _0x7669=['freeform=3','parse','sestekNDA','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','http','md5','request-promise','randomstring','sox','google-tts-api','url','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https:','host','path','WHAT_EVER','get','statusCode','error','statusMessage','request\x20to\x20','createWriteStream','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','protocol','\x20failed,\x20status\x20code\x20=\x20','wav','error\x20convert','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','then','chmodSync','split','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','.mp3','from','audioContent','writeFile','777','resolve','googleTTS','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','data','length','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','uri','results','map','alternatives','transcript','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','confidence','polly','awsLex','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'];(function(_0x5e4ebb,_0x3deec1){var _0x51c7a7=function(_0x2e7112){while(--_0x2e7112){_0x5e4ebb['push'](_0x5e4ebb['shift']());}};_0x51c7a7(++_0x3deec1);}(_0x7669,0x99));var _0x9766=function(_0x5d6d41,_0x4eb737){_0x5d6d41=_0x5d6d41-0x0;var _0x429a8c=_0x7669[_0x5d6d41];return _0x429a8c;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x9766('0x0'));var https=require('https');var md5=require(_0x9766('0x1'));var path=require('path');var querystring=require('querystring');var rp=require(_0x9766('0x2'));var rs=require(_0x9766('0x3'));var sox=require(_0x9766('0x4'));var tts=require(_0x9766('0x5'));var urlParse=require(_0x9766('0x6'))['parse'];var util=require(_0x9766('0x7'));var aws=require(_0x9766('0x8'));var google=require(_0x9766('0x9'));var sestek=require(_0x9766('0xa'));var tilde=require(_0x9766('0xb'));var logger=require(_0x9766('0xc'))(_0x9766('0xd'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x22bdc0,_0x5b8c6c){return new BPromise(function(_0x1ab903,_0x2fd8ae){var _0x3db975=urlParse(_0x22bdc0);var _0x2486aa=_0x3db975['protocol']===_0x9766('0xe')?https:http;var _0x55ee0d={'host':_0x3db975[_0x9766('0xf')],'path':_0x3db975[_0x9766('0x10')],'headers':{'user-agent':_0x9766('0x11')}};_0x2486aa[_0x9766('0x12')](_0x55ee0d,function(_0x421ef1){if(_0x421ef1[_0x9766('0x13')]!==0xc8){logger[_0x9766('0x14')]('request\x20to\x20'+_0x22bdc0+'\x20failed,\x20status\x20code\x20=\x20'+_0x421ef1[_0x9766('0x13')]+'\x20('+_0x421ef1[_0x9766('0x15')]+')');_0x2fd8ae(new Error(_0x9766('0x16')+_0x22bdc0+'\x20failed,\x20status\x20code\x20=\x20'+_0x421ef1[_0x9766('0x13')]+'\x20('+_0x421ef1[_0x9766('0x15')]+')'));return;}var _0x346a90=fs[_0x9766('0x17')](_0x5b8c6c);_0x346a90['on']('finish',function(){logger[_0x9766('0x18')](_0x9766('0x19'));_0x346a90[_0x9766('0x1a')](_0x1ab903);});_0x346a90['on'](_0x9766('0x14'),function(_0x51bc3e){fs[_0x9766('0x1b')](_0x5b8c6c);logger[_0x9766('0x14')](_0x9766('0x1c'),_0x51bc3e);_0x2fd8ae(_0x51bc3e);});_0x421ef1[_0x9766('0x1d')](_0x346a90);})['on'](_0x9766('0x14'),function(_0x4c9e39){logger[_0x9766('0x14')](_0x4c9e39);_0x2fd8ae(_0x4c9e39);})[_0x9766('0x1e')]();});}function uploadFile(_0x1f464f){return new BPromise(function(_0x60b70b,_0x1294b6){var _0x3cce23=urlParse(_0x1f464f);var _0x17d4dd=_0x3cce23[_0x9766('0x1f')]===_0x9766('0xe')?https:http;var _0x30be01={'host':_0x3cce23[_0x9766('0xf')],'path':_0x3cce23['path'],'headers':{'user-agent':_0x9766('0x11')}};_0x17d4dd[_0x9766('0x12')](_0x30be01,function(_0x50c02e){if(_0x50c02e[_0x9766('0x13')]!==0xc8){_0x1294b6(new Error(_0x9766('0x16')+_0x1f464f+_0x9766('0x20')+_0x50c02e['statusCode']+'\x20('+_0x50c02e[_0x9766('0x15')]+')'));return;}var _0x1f6a30='';_0x50c02e['on']('data',function(_0x383ff4){_0x1f6a30+=_0x383ff4;});_0x50c02e['on'](_0x9766('0x1e'),function(){_0x60b70b(_0x1f6a30);});})['on'](_0x9766('0x14'),function(_0x22ab15){_0x1294b6(_0x22ab15);})[_0x9766('0x1e')]();});}function convertFile(_0x5bd22d,_0x3f169f){return new BPromise(function(_0x52662b,_0x593e01){var _0x3d7cea=sox['transcode'](_0x5bd22d,_0x3f169f,{'sampleRate':0x1f40,'format':_0x9766('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3d7cea['on'](_0x9766('0x14'),function(_0x1fe21a){logger[_0x9766('0x14')](_0x9766('0x22'),_0x1fe21a);_0x593e01(_0x1fe21a);});_0x3d7cea['on']('end',function(){logger[_0x9766('0x18')](_0x9766('0x23'));_0x52662b();});_0x3d7cea[_0x9766('0x24')]();});}function base64Decode(_0x1704ed,_0x105cc2){var _0x421fba=path['resolve'](__dirname,_0x9766('0x25'),rs[_0x9766('0x26')](0x4)+_0x9766('0x27'));fs[_0x9766('0x28')](_0x421fba,_0x1704ed,'base64');return convertFile(_0x421fba,_0x105cc2)[_0x9766('0x29')](function(){try{fs[_0x9766('0x1b')](_0x421fba);fs[_0x9766('0x2a')](_0x105cc2,'777');}catch(_0x52f4be){logger[_0x9766('0x14')](_0x52f4be);}return _0x105cc2[_0x9766('0x2b')]('.')[0x0];});}function base64Encode(_0x59c322){var _0x365129=fs[_0x9766('0x2c')](_0x59c322);return new Buffer(_0x365129)[_0x9766('0x2d')](_0x9766('0x2e'));}exports[_0x9766('0x2f')]=function(_0x28ee4a,_0x11cf69,_0x16d2b8,_0x586f3,_0x3fdee6,_0x551205){var _0x4123c5,_0x47cda5;var _0x17218e=_0x9766('0x30');var _0xcb4807=_0x9766('0x31')+_0x28ee4a;var _0x2768ac={};if(_0x11cf69===_0x9766('0x32')){_0x2768ac[_0x9766('0x33')]={'ssml':_0x16d2b8};}else{_0x2768ac[_0x9766('0x33')]={'text':_0x16d2b8};};_0x2768ac[_0x9766('0x34')]={'languageCode':_0x586f3,'ssmlGender':_0x3fdee6};_0x2768ac[_0x9766('0x35')]={'audioEncoding':_0x9766('0x36'),'sampleRateHertz':0x1f40};var _0xac0323={'url':_0x17218e+_0x9766('0x37')+_0xcb4807,'method':'POST','json':!![],'body':_0x2768ac};return rp(_0xac0323)[_0x9766('0x29')](function(_0x352a30){return new BPromise(function(_0x3fadc5,_0x3f744b){_0x4123c5=path['resolve'](__dirname,'tmp',rs[_0x9766('0x26')](0x4)+_0x9766('0x38'));var _0x4e422d=Buffer[_0x9766('0x39')](_0x352a30[_0x9766('0x3a')],_0x9766('0x2e'));return fs[_0x9766('0x3b')](_0x4123c5,_0x4e422d,function(_0x2af9a3){_0x3f744b(_0x2af9a3);},function(_0x404b80){fs[_0x9766('0x2a')](_0x4123c5,_0x9766('0x3c'));_0x3fadc5(_0x404b80);});});})[_0x9766('0x29')](function(_0x160435){_0x47cda5=path[_0x9766('0x3d')](__dirname,_0x9766('0x25'),rs['generate'](0x4)+'.wav');return convertFile(_0x4123c5,_0x47cda5);})[_0x9766('0x29')](function(){try{fs['unlink'](_0x4123c5);fs['chmodSync'](_0x47cda5,_0x9766('0x3c'));}catch(_0x52844c){logger[_0x9766('0x14')](_0x52844c);}logger[_0x9766('0x18')]('googleCloudTTS\x20path',_0x47cda5['split']('.')[0x0]);return _0x47cda5[_0x9766('0x2b')]('.')[0x0];});};exports[_0x9766('0x3e')]=function(_0x1b14a8,_0x4031ad){var _0x2a50d1=_0x9766('0x3f');var _0x59c7cc,_0x192064;var _0x7a765b;var _0x2ffc9a={'encoding':_0x9766('0x40'),'method':_0x9766('0x41'),'timeout':0x2710,'url':_0x2a50d1,'headers':{'Content-Type':_0x9766('0x42')},'body':_0x9766('0x43')+encodeURIComponent(JSON[_0x9766('0x44')]([[[_0x9766('0x45'),JSON[_0x9766('0x44')]([_0x1b14a8,_0x4031ad||'en',![],_0x9766('0x46')]),null,_0x9766('0x47')]]]))};return rp(_0x2ffc9a)['then'](function(_0xa769c2){try{_0x7a765b=eval(_0xa769c2[_0x9766('0x48')](0x5))[0x0][0x2];}catch(_0x184f0b){throw new Error(_0x9766('0x49')+_0xa769c2[_0x9766('0x4a')]);}if(!_0x7a765b){if(_0x1b14a8[_0x9766('0x4b')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x9766('0x4c')+_0x4031ad+_0x9766('0x4d'));}}try{_0x7a765b=eval(_0x7a765b)[0x0];}catch(_0x46f913){throw new Error(_0x9766('0x49')+res[_0x9766('0x4a')]);}const _0x54a973=_0x7a765b;_0x59c7cc=path[_0x9766('0x3d')](__dirname,_0x9766('0x25'),rs['generate'](0x4)+_0x9766('0x38'));fs['writeFileSync'](_0x59c7cc,_0x7a765b,{'encoding':_0x9766('0x2e')});_0x192064=path[_0x9766('0x3d')](__dirname,'tmp',rs[_0x9766('0x26')](0x4)+_0x9766('0x27'));return convertFile(_0x59c7cc,_0x192064);})[_0x9766('0x29')](function(){try{fs['unlink'](_0x59c7cc);fs['chmodSync'](_0x192064,_0x9766('0x3c'));}catch(_0x51a010){logger[_0x9766('0x14')](_0x51a010);}logger['info'](_0x9766('0x4e'),_0x192064[_0x9766('0x2b')]('.')[0x0]);return _0x192064['split']('.')[0x0];});};exports['googleASR']=function(_0x1b054b,_0x6b5323,_0x26a406){return google['asr'](_0x1b054b,_0x6b5323,_0x26a406)[_0x9766('0x29')](function(_0x5e70f3){logger[_0x9766('0x18')](_0x5e70f3[_0x9766('0x4f')]);return rp(_0x5e70f3);})[_0x9766('0x29')](function(_0x4b02ab){var _0x552941='';var _0x4ea901=0x0;try{fs[_0x9766('0x1b')](_0x1b054b);}catch(_0x3d5af5){logger['error'](_0x3d5af5);}if(_0x4b02ab&&_0x4b02ab[_0x9766('0x50')]){_0x552941=_0x4b02ab[_0x9766('0x50')][_0x9766('0x51')](function(_0x3e07d8){return _0x3e07d8&&_0x3e07d8[_0x9766('0x52')][0x0]&&_0x3e07d8[_0x9766('0x52')][0x0][_0x9766('0x53')]?_0x3e07d8[_0x9766('0x52')][0x0][_0x9766('0x53')]:'';})[_0x9766('0x54')]('\x0a');_0x4ea901=_0x4b02ab[_0x9766('0x50')][_0x9766('0x51')](function(_0x1c98c5){return _0x1c98c5&&_0x1c98c5[_0x9766('0x52')][0x0]&&_0x1c98c5[_0x9766('0x52')][0x0]['confidence']?_0x1c98c5['alternatives'][0x0]['confidence']:0x0;})[_0x9766('0x54')]('\x0a');}logger['info'](_0x9766('0x55'),_0x552941);logger[_0x9766('0x18')](_0x9766('0x56'),_0x4ea901);return{'transcript':_0x552941,'confidence':_0x4ea901};})[_0x9766('0x57')](function(_0x195bbb){logger[_0x9766('0x14')](_0x9766('0x58'),_0x195bbb[_0x9766('0x13')],_0x195bbb[_0x9766('0x59')],_0x195bbb[_0x9766('0x5a')]);});};exports[_0x9766('0x5b')]=function(_0x327c8f,_0x4be491,_0x1a198d,_0x3aeee3){var _0xd3ac58=apiai(_0x4be491,{'language':_0x3aeee3||'en'});return _0xd3ac58[_0x9766('0x5c')](_0x1a198d,{'sessionId':md5(_0x327c8f)})[_0x9766('0x29')](function(_0x147eba){logger[_0x9766('0x18')](JSON[_0x9766('0x44')](_0x147eba));return{'source':_0x147eba[_0x9766('0x5d')][_0x9766('0x5e')],'resolvedQuery':_0x147eba[_0x9766('0x5d')][_0x9766('0x5f')],'action':_0x147eba[_0x9766('0x5d')][_0x9766('0x60')],'actionIncomplete':_0x147eba[_0x9766('0x5d')][_0x9766('0x61')],'speech':_0x147eba[_0x9766('0x5d')][_0x9766('0x62')][_0x9766('0x63')],'score':_0x147eba[_0x9766('0x5d')][_0x9766('0x64')],'statusCode':_0x147eba[_0x9766('0x65')][_0x9766('0x66')],'endConversation':_0x147eba[_0x9766('0x5d')][_0x9766('0x67')][_0x9766('0x68')]||![],'isFallbackIntent':_0x147eba[_0x9766('0x5d')]['metadata'][_0x9766('0x69')]};});};exports[_0x9766('0x6a')]=function(_0x2c3ab1,_0x3a85af,_0x58ca7f,_0xc4a006,_0x21154c,_0x360cae){var _0x863ae5=_0xc4a006[_0x9766('0x6b')](/\\n/g,'\x0a');var _0x392d2f={'credentials':{'private_key':_0x863ae5,'client_email':_0x58ca7f}};var _0x34695f=new dialogflow[(_0x9766('0x6c'))](_0x392d2f);var _0x440544=_0x34695f[_0x9766('0x6d')](_0x3a85af,md5(_0x2c3ab1));var _0x11a00d={'session':_0x440544,'queryInput':{'text':{'text':_0x21154c,'languageCode':_0x360cae}}};return _0x34695f['detectIntent'](_0x11a00d)[_0x9766('0x29')](function(_0x1d6daf){if(_0x1d6daf&&_0x1d6daf['length']){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0x9766('0x44')](_0x1d6daf));var _0x543ec6=_0x1d6daf[0x0];if(_0x543ec6){var _0x5ee724={'action':_0x543ec6[_0x9766('0x6e')][_0x9766('0x60')],'allRequiredParamsPresent':_0x543ec6[_0x9766('0x6e')][_0x9766('0x6f')],'endConversation':_0x543ec6[_0x9766('0x6e')][_0x9766('0x70')]&&_0x543ec6[_0x9766('0x6e')][_0x9766('0x70')][_0x9766('0x71')]?_0x543ec6[_0x9766('0x6e')][_0x9766('0x70')][_0x9766('0x71')][_0x9766('0x72')]['boolValue']:![],'fulfillmentText':_0x543ec6[_0x9766('0x6e')][_0x9766('0x73')],'intentName':_0x543ec6[_0x9766('0x6e')][_0x9766('0x74')]['name'],'intentDisplayName':_0x543ec6[_0x9766('0x6e')][_0x9766('0x74')][_0x9766('0x75')],'isFallbackIntent':_0x543ec6[_0x9766('0x6e')][_0x9766('0x74')][_0x9766('0x76')],'languageCode':_0x543ec6[_0x9766('0x6e')][_0x9766('0x77')],'queryText':_0x543ec6[_0x9766('0x6e')][_0x9766('0x78')],'responseId':_0x543ec6[_0x9766('0x79')],'score':_0x543ec6['queryResult'][_0x9766('0x7a')],'speech':_0x543ec6[_0x9766('0x6e')][_0x9766('0x73')],'providerResponse':JSON['stringify'](_0x1d6daf)};return _0x5ee724;}}});};exports[_0x9766('0x7b')]=function(_0x364e80,_0x156de7,_0x5d17f4,_0x28e480){return tilde[_0x9766('0x7c')](_0x364e80,_0x156de7,_0x5d17f4,_0x28e480)['then'](function(_0x2e4107){try{fs[_0x9766('0x1b')](_0x364e80);}catch(_0x1b36d1){logger['error'](_0x1b36d1);}logger[_0x9766('0x18')](_0x9766('0x7d'),_0x2e4107[_0x9766('0x53')]);logger[_0x9766('0x18')](_0x9766('0x7e'),_0x2e4107[_0x9766('0x7f')]);return _0x2e4107;});};exports['awsPolly']=function(_0x36292b,_0x5b164d,_0x20928c,_0x995dbb,_0x13837e,_0x31a68a){var _0x3f9118=path['resolve'](__dirname,'tmp',rs[_0x9766('0x26')](0x4)+_0x9766('0x38'));var _0x570668;return aws[_0x9766('0x80')](_0x36292b,_0x5b164d,_0x20928c,_0x995dbb,_0x13837e,_0x31a68a,_0x3f9118)['then'](function(){_0x570668=path[_0x9766('0x3d')](__dirname,_0x9766('0x25'),rs[_0x9766('0x26')](0x4)+'.wav');return convertFile(_0x3f9118,_0x570668);})[_0x9766('0x29')](function(){try{fs[_0x9766('0x1b')](_0x3f9118);fs[_0x9766('0x2a')](_0x570668,_0x9766('0x3c'));}catch(_0x78ec14){logger[_0x9766('0x14')](_0x78ec14);}return _0x570668[_0x9766('0x2b')]('.')[0x0];});};exports[_0x9766('0x81')]=function(_0x45a9af,_0x564261,_0x122033,_0x44bc79,_0x1a0807,_0x4c4613){return aws['lex'](_0x45a9af,_0x564261,_0x122033,_0x44bc79,_0x1a0807,_0x4c4613)[_0x9766('0x29')](function(_0x280d81){logger[_0x9766('0x18')](JSON[_0x9766('0x44')](_0x280d81));return _0x280d81;});};exports['ispeechTTS']=function(_0x2b2df1,_0x2e9e40,_0x3293e7,_0x2f11a4){var _0xa79b93=util[_0x9766('0x82')](_0x9766('0x83'),ISPEECH_API,_0x2b2df1,encodeURIComponent(_0x2e9e40),_0x3293e7,_0x2f11a4);var _0x28d25d=path[_0x9766('0x3d')](__dirname,_0x9766('0x25'),rs[_0x9766('0x26')](0x4)+_0x9766('0x38'));var _0x4350c3;return downloadFile(_0xa79b93,_0x28d25d)[_0x9766('0x29')](function(){_0x4350c3=path[_0x9766('0x3d')](__dirname,_0x9766('0x25'),rs['generate'](0x4)+_0x9766('0x27'));return convertFile(_0x28d25d,_0x4350c3);})[_0x9766('0x29')](function(){try{fs[_0x9766('0x1b')](_0x28d25d);fs[_0x9766('0x2a')](_0x4350c3,_0x9766('0x3c'));}catch(_0x9d0ac8){logger['error'](_0x9d0ac8);}return _0x4350c3[_0x9766('0x2b')]('.')[0x0];});};exports[_0x9766('0x84')]=function(_0x258446,_0x39c7f4,_0x3ca720,_0xeef9c3){var _0x31b1b9=util['format'](_0x9766('0x85'),ISPEECH_API,_0x39c7f4,_0x3ca720,base64Encode(_0x258446),_0xeef9c3?util[_0x9766('0x82')](_0x9766('0x86'),encodeURIComponent(_0xeef9c3)):_0x9766('0x87'));return uploadFile(_0x31b1b9)['then'](function(_0x57dc98){return querystring[_0x9766('0x88')](_0x57dc98);});};exports[_0x9766('0x89')]=function(_0x117877,_0x393a11){return sestek['nda'](_0x117877,_0x393a11)[_0x9766('0x29')](function(_0x3ddc18){logger[_0x9766('0x18')](JSON[_0x9766('0x44')](_0x3ddc18));var _0xf6fd9b={'speech':_0x3ddc18['text'],'action':_0x3ddc18[_0x9766('0x8a')]?_0x3ddc18[_0x9766('0x8a')][_0x9766('0x8b')]:undefined,'actiondata':_0x3ddc18[_0x9766('0x8a')]?_0x3ddc18[_0x9766('0x8a')][_0x9766('0x8c')]:undefined};if(_0x3ddc18[_0x9766('0x8a')]&&_0x3ddc18[_0x9766('0x8a')][_0x9766('0x8d')]){return base64Decode(_0x3ddc18['channelData'][_0x9766('0x8d')][_0x9766('0x8e')],path['resolve'](__dirname,'tmp',rs[_0x9766('0x26')](0x4)+_0x9766('0x27')))['then'](function(_0x5cd115){_0xf6fd9b[_0x9766('0x8f')]=_0x5cd115;return _0xf6fd9b;});}return _0xf6fd9b;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xf95b=['apiai-promise','bluebird','dialogflow','md5','path','querystring','url','parse','util','./aws','./google','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','request\x20to\x20','statusCode','statusMessage','\x20failed,\x20status\x20code\x20=\x20','info','finish\x20download\x20file','unlink','error','pipe','end','get','data','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','.wav','base64','then','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','text:synthesize','POST','tmp','.mp3','from','audioContent','writeFile','chmodSync','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','writeFileSync','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','code','metadata','isFallbackIntent','SessionsClient','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','generate','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','channelData','CustomActionData','Data','audiofile','dirName'];(function(_0x20d7c3,_0x58591d){var _0xc1729e=function(_0x29c111){while(--_0x29c111){_0x20d7c3['push'](_0x20d7c3['shift']());}};_0xc1729e(++_0x58591d);}(_0xf95b,0x195));var _0xbf95=function(_0x205d7b,_0x1bf0b1){_0x205d7b=_0x205d7b-0x0;var _0x6fd0cc=_0xf95b[_0x205d7b];return _0x6fd0cc;};'use strict';var apiai=require(_0xbf95('0x0'));var BPromise=require(_0xbf95('0x1'));var dialogflow=require(_0xbf95('0x2'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0xbf95('0x3'));var path=require(_0xbf95('0x4'));var querystring=require(_0xbf95('0x5'));var rp=require('request-promise');var rs=require('randomstring');var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0xbf95('0x6'))[_0xbf95('0x7')];var util=require(_0xbf95('0x8'));var aws=require(_0xbf95('0x9'));var google=require(_0xbf95('0xa'));var sestek=require('./sestek');var tilde=require(_0xbf95('0xb'));var logger=require(_0xbf95('0xc'))(_0xbf95('0xd'));var ISPEECH_API=_0xbf95('0xe');function downloadFile(_0x469076,_0x4958e4){return new BPromise(function(_0x16999f,_0x46b748){var _0x4134a9=urlParse(_0x469076);var _0x44f2b4=_0x4134a9[_0xbf95('0xf')]==='https:'?https:http;var _0x5586b6={'host':_0x4134a9[_0xbf95('0x10')],'path':_0x4134a9['path'],'headers':{'user-agent':_0xbf95('0x11')}};_0x44f2b4['get'](_0x5586b6,function(_0x27a7b6){if(_0x27a7b6['statusCode']!==0xc8){logger['error'](_0xbf95('0x12')+_0x469076+'\x20failed,\x20status\x20code\x20=\x20'+_0x27a7b6[_0xbf95('0x13')]+'\x20('+_0x27a7b6[_0xbf95('0x14')]+')');_0x46b748(new Error(_0xbf95('0x12')+_0x469076+_0xbf95('0x15')+_0x27a7b6['statusCode']+'\x20('+_0x27a7b6[_0xbf95('0x14')]+')'));return;}var _0x38ea70=fs['createWriteStream'](_0x4958e4);_0x38ea70['on']('finish',function(){logger[_0xbf95('0x16')](_0xbf95('0x17'));_0x38ea70['close'](_0x16999f);});_0x38ea70['on']('error',function(_0x4416c3){fs[_0xbf95('0x18')](_0x4958e4);logger[_0xbf95('0x19')]('download\x20error',_0x4416c3);_0x46b748(_0x4416c3);});_0x27a7b6[_0xbf95('0x1a')](_0x38ea70);})['on'](_0xbf95('0x19'),function(_0xf48937){logger[_0xbf95('0x19')](_0xf48937);_0x46b748(_0xf48937);})[_0xbf95('0x1b')]();});}function uploadFile(_0x140d5f){return new BPromise(function(_0x1a9405,_0x24c916){var _0x406678=urlParse(_0x140d5f);var _0x237f76=_0x406678['protocol']==='https:'?https:http;var _0x223c91={'host':_0x406678['host'],'path':_0x406678[_0xbf95('0x4')],'headers':{'user-agent':_0xbf95('0x11')}};_0x237f76[_0xbf95('0x1c')](_0x223c91,function(_0x320650){if(_0x320650[_0xbf95('0x13')]!==0xc8){_0x24c916(new Error('request\x20to\x20'+_0x140d5f+'\x20failed,\x20status\x20code\x20=\x20'+_0x320650[_0xbf95('0x13')]+'\x20('+_0x320650[_0xbf95('0x14')]+')'));return;}var _0x12ad71='';_0x320650['on'](_0xbf95('0x1d'),function(_0x4ed469){_0x12ad71+=_0x4ed469;});_0x320650['on']('end',function(){_0x1a9405(_0x12ad71);});})['on'](_0xbf95('0x19'),function(_0x599431){_0x24c916(_0x599431);})[_0xbf95('0x1b')]();});}function convertFile(_0x530033,_0x684e22){return new BPromise(function(_0x4417ee,_0x526406){var _0x6c18c7=sox[_0xbf95('0x1e')](_0x530033,_0x684e22,{'sampleRate':0x1f40,'format':_0xbf95('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x6c18c7['on'](_0xbf95('0x19'),function(_0x547bdf){logger[_0xbf95('0x19')](_0xbf95('0x20'),_0x547bdf);_0x526406(_0x547bdf);});_0x6c18c7['on'](_0xbf95('0x1b'),function(){logger[_0xbf95('0x16')](_0xbf95('0x21'));_0x4417ee();});_0x6c18c7['start']();});}function base64Decode(_0x223914,_0x304a94){var _0x53b762=path[_0xbf95('0x22')](__dirname,'tmp',rs['generate'](0x4)+_0xbf95('0x23'));fs['writeFileSync'](_0x53b762,_0x223914,_0xbf95('0x24'));return convertFile(_0x53b762,_0x304a94)[_0xbf95('0x25')](function(){try{fs[_0xbf95('0x18')](_0x53b762);fs['chmodSync'](_0x304a94,_0xbf95('0x26'));}catch(_0x1325aa){logger[_0xbf95('0x19')](_0x1325aa);}return _0x304a94[_0xbf95('0x27')]('.')[0x0];});}function base64Encode(_0x2cce8e){var _0x13b524=fs[_0xbf95('0x28')](_0x2cce8e);return new Buffer(_0x13b524)[_0xbf95('0x29')](_0xbf95('0x24'));}exports['googleCloudTTS']=function(_0x1f3e2b,_0x3ff826,_0x95feab,_0x2959f9,_0x4371b3,_0x85dae8){var _0x29b4c5,_0x3363b2;var _0x32c60c=_0xbf95('0x2a');var _0x12797e=_0xbf95('0x2b')+_0x1f3e2b;var _0x4e81b4={};if(_0x3ff826===_0xbf95('0x2c')){_0x4e81b4[_0xbf95('0x2d')]={'ssml':_0x95feab};}else{_0x4e81b4[_0xbf95('0x2d')]={'text':_0x95feab};};_0x4e81b4[_0xbf95('0x2e')]={'languageCode':_0x2959f9,'ssmlGender':_0x4371b3};_0x4e81b4[_0xbf95('0x2f')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x4535d4={'url':_0x32c60c+_0xbf95('0x30')+_0x12797e,'method':_0xbf95('0x31'),'json':!![],'body':_0x4e81b4};return rp(_0x4535d4)['then'](function(_0x5d1bd7){return new BPromise(function(_0x253892,_0x43359e){_0x29b4c5=path['resolve'](__dirname,_0xbf95('0x32'),rs['generate'](0x4)+_0xbf95('0x33'));var _0xa78fc9=Buffer[_0xbf95('0x34')](_0x5d1bd7[_0xbf95('0x35')],_0xbf95('0x24'));return fs[_0xbf95('0x36')](_0x29b4c5,_0xa78fc9,function(_0x1a07cc){_0x43359e(_0x1a07cc);},function(_0x4769f5){fs[_0xbf95('0x37')](_0x29b4c5,_0xbf95('0x26'));_0x253892(_0x4769f5);});});})[_0xbf95('0x25')](function(_0x590898){_0x3363b2=path[_0xbf95('0x22')](__dirname,'tmp',rs['generate'](0x4)+_0xbf95('0x23'));return convertFile(_0x29b4c5,_0x3363b2);})['then'](function(){try{fs[_0xbf95('0x18')](_0x29b4c5);fs['chmodSync'](_0x3363b2,_0xbf95('0x26'));}catch(_0x52b1d4){logger[_0xbf95('0x19')](_0x52b1d4);}logger[_0xbf95('0x16')](_0xbf95('0x38'),_0x3363b2[_0xbf95('0x27')]('.')[0x0]);return _0x3363b2['split']('.')[0x0];});};exports[_0xbf95('0x39')]=function(_0x156c38,_0x51796d){var _0x1e2a3c=_0xbf95('0x3a');var _0x36eb27,_0x559633;var _0x1e6310;var _0x402aad={'encoding':_0xbf95('0x3b'),'method':_0xbf95('0x31'),'timeout':0x2710,'url':_0x1e2a3c,'headers':{'Content-Type':_0xbf95('0x3c')},'body':_0xbf95('0x3d')+encodeURIComponent(JSON[_0xbf95('0x3e')]([[['jQ1olc',JSON[_0xbf95('0x3e')]([_0x156c38,_0x51796d||'en',![],_0xbf95('0x3f')]),null,_0xbf95('0x40')]]]))};return rp(_0x402aad)[_0xbf95('0x25')](function(_0x45b15e){try{_0x1e6310=eval(_0x45b15e['slice'](0x5))[0x0][0x2];}catch(_0x53bcf7){throw new Error(_0xbf95('0x41')+_0x45b15e[_0xbf95('0x1d')]);}if(!_0x1e6310){if(_0x156c38[_0xbf95('0x42')]>0xc8){throw new Error(_0xbf95('0x43'));}else{throw new Error(_0xbf95('0x44')+_0x51796d+'\x22\x20might\x20not\x20exist');}}try{_0x1e6310=eval(_0x1e6310)[0x0];}catch(_0x9b477d){throw new Error(_0xbf95('0x41')+res[_0xbf95('0x1d')]);}const _0x218ec8=_0x1e6310;_0x36eb27=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xbf95('0x33'));fs[_0xbf95('0x45')](_0x36eb27,_0x1e6310,{'encoding':_0xbf95('0x24')});_0x559633=path[_0xbf95('0x22')](__dirname,_0xbf95('0x32'),rs['generate'](0x4)+_0xbf95('0x23'));return convertFile(_0x36eb27,_0x559633);})[_0xbf95('0x25')](function(){try{fs[_0xbf95('0x18')](_0x36eb27);fs[_0xbf95('0x37')](_0x559633,_0xbf95('0x26'));}catch(_0x15c787){logger['error'](_0x15c787);}logger[_0xbf95('0x16')](_0xbf95('0x46'),_0x559633[_0xbf95('0x27')]('.')[0x0]);return _0x559633[_0xbf95('0x27')]('.')[0x0];});};exports[_0xbf95('0x47')]=function(_0x3571c1,_0x53ffee,_0x113695){return google[_0xbf95('0x48')](_0x3571c1,_0x53ffee,_0x113695)[_0xbf95('0x25')](function(_0x16b2f6){logger[_0xbf95('0x16')](_0x16b2f6['uri']);return rp(_0x16b2f6);})[_0xbf95('0x25')](function(_0x277bdb){var _0x472cb3='';var _0x47beb6=0x0;try{fs['unlink'](_0x3571c1);}catch(_0x3e9267){logger[_0xbf95('0x19')](_0x3e9267);}if(_0x277bdb&&_0x277bdb[_0xbf95('0x49')]){_0x472cb3=_0x277bdb[_0xbf95('0x49')][_0xbf95('0x4a')](function(_0x193f3f){return _0x193f3f&&_0x193f3f['alternatives'][0x0]&&_0x193f3f[_0xbf95('0x4b')][0x0][_0xbf95('0x4c')]?_0x193f3f[_0xbf95('0x4b')][0x0][_0xbf95('0x4c')]:'';})['join']('\x0a');_0x47beb6=_0x277bdb[_0xbf95('0x49')][_0xbf95('0x4a')](function(_0x162eea){return _0x162eea&&_0x162eea['alternatives'][0x0]&&_0x162eea[_0xbf95('0x4b')][0x0][_0xbf95('0x4d')]?_0x162eea['alternatives'][0x0][_0xbf95('0x4d')]:0x0;})[_0xbf95('0x4e')]('\x0a');}logger['info'](_0xbf95('0x4f'),_0x472cb3);logger['info'](_0xbf95('0x50'),_0x47beb6);return{'transcript':_0x472cb3,'confidence':_0x47beb6};})[_0xbf95('0x51')](function(_0xa088c5){logger[_0xbf95('0x19')](_0xbf95('0x52'),_0xa088c5[_0xbf95('0x13')],_0xa088c5[_0xbf95('0x53')],_0xa088c5[_0xbf95('0x54')]);});};exports[_0xbf95('0x55')]=function(_0x5b21b8,_0x4578ca,_0x26c8d3,_0x24c4bb){var _0x390140=apiai(_0x4578ca,{'language':_0x24c4bb||'en'});return _0x390140[_0xbf95('0x56')](_0x26c8d3,{'sessionId':md5(_0x5b21b8)})[_0xbf95('0x25')](function(_0x2bf0a1){logger[_0xbf95('0x16')](JSON[_0xbf95('0x3e')](_0x2bf0a1));return{'source':_0x2bf0a1[_0xbf95('0x57')][_0xbf95('0x58')],'resolvedQuery':_0x2bf0a1['result'][_0xbf95('0x59')],'action':_0x2bf0a1['result'][_0xbf95('0x5a')],'actionIncomplete':_0x2bf0a1['result'][_0xbf95('0x5b')],'speech':_0x2bf0a1['result'][_0xbf95('0x5c')][_0xbf95('0x5d')],'score':_0x2bf0a1[_0xbf95('0x57')]['score'],'statusCode':_0x2bf0a1['status'][_0xbf95('0x5e')],'endConversation':_0x2bf0a1['result'][_0xbf95('0x5f')]['endConversation']||![],'isFallbackIntent':_0x2bf0a1[_0xbf95('0x57')][_0xbf95('0x5f')][_0xbf95('0x60')]};});};exports['googleDialogflowV2']=function(_0x87b705,_0x166cb2,_0x145787,_0x1f30e4,_0xc19b7c,_0x3a17cf){var _0x5eddd5=_0x1f30e4['replace'](/\\n/g,'\x0a');var _0x93c324={'credentials':{'private_key':_0x5eddd5,'client_email':_0x145787}};var _0x5ae39c=new dialogflow[(_0xbf95('0x61'))](_0x93c324);var _0x2bb644=_0x5ae39c[_0xbf95('0x62')](_0x166cb2,md5(_0x87b705));var _0x19be65={'session':_0x2bb644,'queryInput':{'text':{'text':_0xc19b7c,'languageCode':_0x3a17cf}}};return _0x5ae39c[_0xbf95('0x63')](_0x19be65)[_0xbf95('0x25')](function(_0x55cc07){if(_0x55cc07&&_0x55cc07[_0xbf95('0x42')]){logger[_0xbf95('0x16')]('Dialogflow\x20V2\x20response:',JSON[_0xbf95('0x3e')](_0x55cc07));var _0x227804=_0x55cc07[0x0];if(_0x227804){var _0x283f88={'action':_0x227804[_0xbf95('0x64')]['action'],'allRequiredParamsPresent':_0x227804[_0xbf95('0x64')][_0xbf95('0x65')],'endConversation':_0x227804['queryResult']['diagnosticInfo']&&_0x227804[_0xbf95('0x64')][_0xbf95('0x66')][_0xbf95('0x67')]?_0x227804[_0xbf95('0x64')][_0xbf95('0x66')]['fields'][_0xbf95('0x68')][_0xbf95('0x69')]:![],'fulfillmentText':_0x227804[_0xbf95('0x64')][_0xbf95('0x6a')],'intentName':_0x227804[_0xbf95('0x64')][_0xbf95('0x6b')][_0xbf95('0x53')],'intentDisplayName':_0x227804[_0xbf95('0x64')][_0xbf95('0x6b')][_0xbf95('0x6c')],'isFallbackIntent':_0x227804[_0xbf95('0x64')]['intent'][_0xbf95('0x6d')],'languageCode':_0x227804[_0xbf95('0x64')][_0xbf95('0x6e')],'queryText':_0x227804[_0xbf95('0x64')][_0xbf95('0x6f')],'responseId':_0x227804[_0xbf95('0x70')],'score':_0x227804['queryResult'][_0xbf95('0x71')],'speech':_0x227804[_0xbf95('0x64')]['fulfillmentText'],'providerResponse':JSON[_0xbf95('0x3e')](_0x55cc07)};return _0x283f88;}}});};exports[_0xbf95('0x72')]=function(_0x320070,_0x1a2872,_0x57f2de,_0x5960f9){return tilde[_0xbf95('0x48')](_0x320070,_0x1a2872,_0x57f2de,_0x5960f9)[_0xbf95('0x25')](function(_0x25d6a7){try{fs[_0xbf95('0x18')](_0x320070);}catch(_0xa40f4e){logger[_0xbf95('0x19')](_0xa40f4e);}logger[_0xbf95('0x16')](_0xbf95('0x73'),_0x25d6a7[_0xbf95('0x4c')]);logger[_0xbf95('0x16')](_0xbf95('0x74'),_0x25d6a7['confidence']);return _0x25d6a7;});};exports[_0xbf95('0x75')]=function(_0x3db0a2,_0x2f36fb,_0x45a38e,_0x4a9c13,_0x207ed3,_0x1f57e8){var _0x12ede0=path[_0xbf95('0x22')](__dirname,'tmp',rs[_0xbf95('0x76')](0x4)+_0xbf95('0x33'));var _0x340e55;return aws[_0xbf95('0x77')](_0x3db0a2,_0x2f36fb,_0x45a38e,_0x4a9c13,_0x207ed3,_0x1f57e8,_0x12ede0)[_0xbf95('0x25')](function(){_0x340e55=path['resolve'](__dirname,_0xbf95('0x32'),rs[_0xbf95('0x76')](0x4)+_0xbf95('0x23'));return convertFile(_0x12ede0,_0x340e55);})['then'](function(){try{fs[_0xbf95('0x18')](_0x12ede0);fs[_0xbf95('0x37')](_0x340e55,_0xbf95('0x26'));}catch(_0x2ae9b4){logger[_0xbf95('0x19')](_0x2ae9b4);}return _0x340e55[_0xbf95('0x27')]('.')[0x0];});};exports['awsLex']=function(_0x4f6c58,_0x5293cc,_0x4256f1,_0x203328,_0x41b25b,_0xb911d7){return aws[_0xbf95('0x78')](_0x4f6c58,_0x5293cc,_0x4256f1,_0x203328,_0x41b25b,_0xb911d7)['then'](function(_0xc5ebb9){logger[_0xbf95('0x16')](JSON[_0xbf95('0x3e')](_0xc5ebb9));return _0xc5ebb9;});};exports[_0xbf95('0x79')]=function(_0x3a82cf,_0x21a67a,_0x5e1550,_0x1989b0){var _0x41a385=util[_0xbf95('0x7a')](_0xbf95('0x7b'),ISPEECH_API,_0x3a82cf,encodeURIComponent(_0x21a67a),_0x5e1550,_0x1989b0);var _0x3e1777=path[_0xbf95('0x22')](__dirname,'tmp',rs[_0xbf95('0x76')](0x4)+_0xbf95('0x33'));var _0x5f3998;return downloadFile(_0x41a385,_0x3e1777)[_0xbf95('0x25')](function(){_0x5f3998=path[_0xbf95('0x22')](__dirname,_0xbf95('0x32'),rs[_0xbf95('0x76')](0x4)+_0xbf95('0x23'));return convertFile(_0x3e1777,_0x5f3998);})[_0xbf95('0x25')](function(){try{fs[_0xbf95('0x18')](_0x3e1777);fs[_0xbf95('0x37')](_0x5f3998,_0xbf95('0x26'));}catch(_0x45b6a8){logger['error'](_0x45b6a8);}return _0x5f3998[_0xbf95('0x27')]('.')[0x0];});};exports[_0xbf95('0x7c')]=function(_0x148f66,_0x45b4b5,_0x4179a0,_0x478075){var _0x23725f=util[_0xbf95('0x7a')](_0xbf95('0x7d'),ISPEECH_API,_0x45b4b5,_0x4179a0,base64Encode(_0x148f66),_0x478075?util[_0xbf95('0x7a')](_0xbf95('0x7e'),encodeURIComponent(_0x478075)):_0xbf95('0x7f'));return uploadFile(_0x23725f)[_0xbf95('0x25')](function(_0x3f630a){return querystring[_0xbf95('0x7')](_0x3f630a);});};exports[_0xbf95('0x80')]=function(_0x102cd6,_0x1e6c87){return sestek[_0xbf95('0x81')](_0x102cd6,_0x1e6c87)['then'](function(_0x7e5bdd){logger[_0xbf95('0x16')](JSON[_0xbf95('0x3e')](_0x7e5bdd));var _0x2a4869={'speech':_0x7e5bdd['text'],'action':_0x7e5bdd[_0xbf95('0x82')]?_0x7e5bdd['channelData']['CustomAction']:undefined,'actiondata':_0x7e5bdd['channelData']?_0x7e5bdd['channelData'][_0xbf95('0x83')]:undefined};if(_0x7e5bdd['channelData']&&_0x7e5bdd[_0xbf95('0x82')]['AudioFromTts']){return base64Decode(_0x7e5bdd[_0xbf95('0x82')]['AudioFromTts'][_0xbf95('0x84')],path[_0xbf95('0x22')](__dirname,_0xbf95('0x32'),rs[_0xbf95('0x76')](0x4)+_0xbf95('0x23')))[_0xbf95('0x25')](function(_0x16e1a7){_0x2a4869[_0xbf95('0x85')]=_0x16e1a7;return _0x2a4869;});}return _0x2a4869;});};exports[_0xbf95('0x86')]=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 dc26df6..3a8d1ed 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 _0x554e=['exports','./nda'];(function(_0x58db4e,_0x439d8d){var _0x40139a=function(_0x34cae4){while(--_0x34cae4){_0x58db4e['push'](_0x58db4e['shift']());}};_0x40139a(++_0x439d8d);}(_0x554e,0x67));var _0xe554=function(_0x14064a,_0xdc7bf0){_0x14064a=_0x14064a-0x0;var _0x4f993e=_0x554e[_0x14064a];return _0x4f993e;};var nda=require(_0xe554('0x0'));module[_0xe554('0x1')]={'nda':nda}; \ No newline at end of file +var _0x69f6=['./nda'];(function(_0x153e72,_0x1cde75){var _0x2d060f=function(_0xdfa3b0){while(--_0xdfa3b0){_0x153e72['push'](_0x153e72['shift']());}};_0x2d060f(++_0x1cde75);}(_0x69f6,0x16c));var _0x669f=function(_0x57e092,_0x230223){_0x57e092=_0x57e092-0x0;var _0x4dd71e=_0x69f6[_0x57e092];return _0x4dd71e;};var nda=require(_0x669f('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 966f885..5f36592 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 _0xfbac=['resolve','ndauth_url','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','body','channelData','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','url','../../../../../config/logger','agi','exports'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0xfbac,0x167));var _0xcfba=function(_0x4d229a,_0x4e359f){_0x4d229a=_0x4d229a-0x0;var _0x3c544f=_0xfbac[_0x4d229a];return _0x3c544f;};'use strict';var rp=require('request-promise');var url=require(_0xcfba('0x0'));var logger=require(_0xcfba('0x1'))(_0xcfba('0x2'));module[_0xcfba('0x3')]=function(_0x9aacde,_0x59384a){var _0x54c2c5={'method':'POST','uri':url[_0xcfba('0x4')](_0x59384a[_0xcfba('0x5')],'/token'),'form':{'grant_type':'password','username':_0x59384a[_0xcfba('0x6')],'password':_0x59384a['password']},'json':!![]};return rp(_0x54c2c5)[_0xcfba('0x7')](function(_0x5b7669){var _0x15e8d6={'method':_0xcfba('0x8'),'uri':url['resolve'](_0x59384a[_0xcfba('0x9')],_0xcfba('0xa')),'body':{'type':_0x59384a[_0xcfba('0xb')]||_0xcfba('0xc'),'channelId':_0xcfba('0xd'),'conversation':{'id':_0x9aacde[_0xcfba('0xe')]},'from':{'id':_0x9aacde[_0xcfba('0xf')],'name':_0x9aacde[_0xcfba('0x10')]},'recipient':{'id':_0x9aacde[_0xcfba('0x11')],'name':_0x9aacde[_0xcfba('0x12')]},'text':_0x59384a[_0xcfba('0x13')],'channelData':{}},'headers':{'Authorization':_0xcfba('0x14')+_0x5b7669['access_token']},'json':!![]};if(_0x59384a['project']){_0x15e8d6[_0xcfba('0x15')][_0xcfba('0x16')]['ProjectName']=_0x59384a[_0xcfba('0x17')];}if(_0x59384a[_0xcfba('0x18')]=='1'){_0x15e8d6[_0xcfba('0x15')][_0xcfba('0x16')][_0xcfba('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xcfba('0x1a')};}if(_0x59384a[_0xcfba('0x1b')]){_0x15e8d6[_0xcfba('0x15')][_0xcfba('0x16')][_0xcfba('0x1c')]=_0x59384a[_0xcfba('0x1b')];if(_0x59384a[_0xcfba('0x1d')]){_0x15e8d6[_0xcfba('0x15')]['channelData'][_0xcfba('0x1e')]=_0x59384a[_0xcfba('0x1d')];}}logger[_0xcfba('0x1f')](JSON[_0xcfba('0x20')](_0x15e8d6));return rp(_0x15e8d6);});}; \ No newline at end of file +var _0xa739=['message','uniqueid','callerid','dnid','extension','text','access_token','project','body','ProjectName','channelData','audio/wav','CustomAction','custom_action_data','CustomActionData','info','stringify','url','agi','exports','POST','ndauth_url','/token','password','username','then','resolve','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type'];(function(_0x23ec5b,_0x51912f){var _0x5d971e=function(_0x56dab6){while(--_0x56dab6){_0x23ec5b['push'](_0x23ec5b['shift']());}};_0x5d971e(++_0x51912f);}(_0xa739,0x1e1));var _0x9a73=function(_0x375323,_0x5e9589){_0x375323=_0x375323-0x0;var _0x51505e=_0xa739[_0x375323];return _0x51505e;};'use strict';var rp=require('request-promise');var url=require(_0x9a73('0x0'));var logger=require('../../../../../config/logger')(_0x9a73('0x1'));module[_0x9a73('0x2')]=function(_0x524293,_0x149e72){var _0x352cec={'method':_0x9a73('0x3'),'uri':url['resolve'](_0x149e72[_0x9a73('0x4')],_0x9a73('0x5')),'form':{'grant_type':_0x9a73('0x6'),'username':_0x149e72[_0x9a73('0x7')],'password':_0x149e72[_0x9a73('0x6')]},'json':!![]};return rp(_0x352cec)[_0x9a73('0x8')](function(_0x3a6506){var _0x125177={'method':'POST','uri':url[_0x9a73('0x9')](_0x149e72['ndassistant_url'],_0x9a73('0xa')),'body':{'type':_0x149e72[_0x9a73('0xb')]||_0x9a73('0xc'),'channelId':'Nda','conversation':{'id':_0x524293[_0x9a73('0xd')]},'from':{'id':_0x524293[_0x9a73('0xe')],'name':_0x524293['calleridname']},'recipient':{'id':_0x524293[_0x9a73('0xf')],'name':_0x524293[_0x9a73('0x10')]},'text':_0x149e72[_0x9a73('0x11')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x3a6506[_0x9a73('0x12')]},'json':!![]};if(_0x149e72[_0x9a73('0x13')]){_0x125177[_0x9a73('0x14')]['channelData'][_0x9a73('0x15')]=_0x149e72[_0x9a73('0x13')];}if(_0x149e72['ndagenerate_audio']=='1'){_0x125177[_0x9a73('0x14')][_0x9a73('0x16')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x9a73('0x17')};}if(_0x149e72['custom_action']){_0x125177[_0x9a73('0x14')]['channelData'][_0x9a73('0x18')]=_0x149e72['custom_action'];if(_0x149e72[_0x9a73('0x19')]){_0x125177[_0x9a73('0x14')][_0x9a73('0x16')][_0x9a73('0x1a')]=_0x149e72[_0x9a73('0x19')];}}logger[_0x9a73('0x1b')](JSON[_0x9a73('0x1c')](_0x125177));return rp(_0x125177);});}; \ 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 797a062..3c8d19f 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3f0=['./lib/api','exports'];(function(_0x57a25d,_0x406e57){var _0x7d9159=function(_0x347ad3){while(--_0x347ad3){_0x57a25d['push'](_0x57a25d['shift']());}};_0x7d9159(++_0x406e57);}(_0xd3f0,0x17e));var _0x0d3f=function(_0x16369d,_0x41408d){_0x16369d=_0x16369d-0x0;var _0x51a9fa=_0xd3f0[_0x16369d];return _0x51a9fa;};'use strict';var asr=require(_0x0d3f('0x0'));module[_0x0d3f('0x1')]=function(_0x4a8843,_0x14c9d6,_0x456a3f,_0x55d36b){return asr(_0x4a8843,_0x14c9d6,_0x456a3f,_0x55d36b);}; \ No newline at end of file +var _0x2b27=['./lib/api'];(function(_0xee812b,_0x25df13){var _0x57b3e1=function(_0x4bff46){while(--_0x4bff46){_0xee812b['push'](_0xee812b['shift']());}};_0x57b3e1(++_0x25df13);}(_0x2b27,0x1e0));var _0x72b2=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0x2b27[_0x146a97];return _0x259d5c;};'use strict';var asr=require(_0x72b2('0x0'));module['exports']=function(_0x353162,_0x1e54d0,_0x3ce850,_0x221367){return asr(_0x353162,_0x1e54d0,_0x3ce850,_0x221367);}; \ 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 35c3824..88e9549 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 _0x5238=['data','close','error','Tilde\x20ASR\x20send\x20error','terminate','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','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.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','info','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','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify'];(function(_0x152fd1,_0xafde11){var _0x1f196e=function(_0x3a8f94){while(--_0x3a8f94){_0x152fd1['push'](_0x152fd1['shift']());}};_0x1f196e(++_0xafde11);}(_0x5238,0x75));var _0x8523=function(_0xae8d69,_0x5ba612){_0xae8d69=_0xae8d69-0x0;var _0x13b0f8=_0x5238[_0xae8d69];return _0x13b0f8;};'use strict';var BPromise=require(_0x8523('0x0'));var _=require(_0x8523('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x8523('0x2'));var crypto=require(_0x8523('0x3'));var logger=require(_0x8523('0x4'))('agi');module[_0x8523('0x5')]=function(_0x4ba6ee,_0x407db7,_0x7771f5,_0x4ab20c){return new BPromise(function(_0x239230,_0x3b0943){logger[_0x8523('0x6')]('Tilde\x20URI',_0x4ab20c||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x495355=new WebSocket(_0x4ab20c||_0x8523('0x7'),{'perMessageDeflate':![]});var _0xc0cdf6='';var _0x457f90='0';var _0x5c9346='1';var _0x4952aa=_0x8523('0x8');function _0x1dae4b(_0x375bb6){var _0x1f8763=crypto['createHash'](_0x8523('0x9'));_0x1f8763['update'](_0x375bb6);return _0x1f8763[_0x8523('0xa')](_0x8523('0xb'));}function _0x1c441b(){try{logger[_0x8523('0x6')](_0x8523('0xc'));var _0x1eec4f=moment()['unix']();var _0x18360f=_0x1dae4b(_0x1eec4f+_0x407db7+_0x7771f5);_0x495355[_0x8523('0xd')](JSON[_0x8523('0xe')]({'appID':_0x407db7,'timestamp':_0x1eec4f,'appKey':_0x18360f}));var _0x109adf=fs['createReadStream'](_0x4ba6ee);_0x109adf['on'](_0x8523('0xf'),function(_0x293875){_0x495355[_0x8523('0xd')](_0x293875);});_0x109adf['on'](_0x8523('0x10'),function(){_0x495355[_0x8523('0xd')]('EOS');});}catch(_0x4d948e){logger[_0x8523('0x11')](_0x8523('0x12'),JSON[_0x8523('0xe')](_0x4d948e));_0x495355[_0x8523('0x13')]();}}function _0x29d93a(_0x34ff82){try{if(_0x34ff82){var _0x293315=JSON['parse'](_0x34ff82);switch(_0x293315['status']){case 0x0:if(_0x293315[_0x8523('0x14')]){if(_0x293315[_0x8523('0x14')][_0x8523('0x15')]){logger[_0x8523('0x6')](_0x8523('0x16'),JSON[_0x8523('0xe')](_0x293315[_0x8523('0x14')][_0x8523('0x17')]));_0xc0cdf6=_0x293315[_0x8523('0x14')]['hypotheses'][0x0][_0x8523('0x18')];_0x457f90=_0x293315['result'][_0x8523('0x17')][0x0][_0x8523('0x19')];_0x5c9346='0';_0x4952aa='Success.';_0x495355['terminate']();}}break;case 0x1:logger[_0x8523('0x6')](_0x8523('0x8'));_0x5c9346='1';_0x4952aa=_0x8523('0x8');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x5c9346='2';_0x4952aa=_0x8523('0x1a');break;case 0x9:logger[_0x8523('0x6')](_0x8523('0x1b'));_0x5c9346='9';_0x4952aa='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x8523('0x6')]('Authentication\x20failed.');_0x5c9346='10';_0x4952aa=_0x8523('0x1c');break;case 0xb:logger[_0x8523('0x6')](_0x8523('0x1d'));_0x5c9346='11';_0x4952aa=_0x8523('0x1d');}}}catch(_0x4abb46){logger[_0x8523('0x11')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x8523('0xe')](_0x4abb46));_0x495355[_0x8523('0x13')]();}}function _0x57d4e9(){logger[_0x8523('0x6')](_0x8523('0x1e'));_0x239230({'transcript':_0xc0cdf6,'confidence':_0x457f90,'status':_0x5c9346,'status_message':_0x4952aa});}function _0xfee767(_0x16d68f){logger[_0x8523('0x11')](_0x8523('0x1f'));if(!_[_0x8523('0x20')](_0x16d68f)){logger[_0x8523('0x11')](_['isObject'](_0x16d68f)?JSON[_0x8523('0xe')](_0x16d68f):_0x16d68f);}}_0x495355['on']('open',_0x1c441b);_0x495355['on']('message',_0x29d93a);_0x495355['on'](_0x8523('0x10'),_0x57d4e9);_0x495355['on'](_0x8523('0x11'),_0xfee767);});}; \ No newline at end of file +var _0xbd9f=['sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','send','createReadStream','data','close','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd9f,0x1a3));var _0xfbd9=function(_0x31c910,_0x18554){_0x31c910=_0x31c910-0x0;var _0x7d9a41=_0xbd9f[_0x31c910];return _0x7d9a41;};'use strict';var BPromise=require(_0xfbd9('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xfbd9('0x1'));var crypto=require(_0xfbd9('0x2'));var logger=require(_0xfbd9('0x3'))(_0xfbd9('0x4'));module[_0xfbd9('0x5')]=function(_0x2c3387,_0x175dc9,_0x3976a8,_0x529301){return new BPromise(function(_0x95755d,_0x119c85){logger[_0xfbd9('0x6')](_0xfbd9('0x7'),_0x529301||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x17d433=new WebSocket(_0x529301||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x16d3f4='';var _0x1e5926='0';var _0x3ad9ad='1';var _0x346b2c=_0xfbd9('0x8');function _0x536b51(_0x239b12){var _0x1afb03=crypto[_0xfbd9('0x9')](_0xfbd9('0xa'));_0x1afb03[_0xfbd9('0xb')](_0x239b12);return _0x1afb03['digest'](_0xfbd9('0xc'));}function _0x36a207(){try{logger[_0xfbd9('0x6')](_0xfbd9('0xd'));var _0x515557=moment()['unix']();var _0x2deec7=_0x536b51(_0x515557+_0x175dc9+_0x3976a8);_0x17d433[_0xfbd9('0xe')](JSON['stringify']({'appID':_0x175dc9,'timestamp':_0x515557,'appKey':_0x2deec7}));var _0x1a6eb4=fs[_0xfbd9('0xf')](_0x2c3387);_0x1a6eb4['on'](_0xfbd9('0x10'),function(_0x1933aa){_0x17d433['send'](_0x1933aa);});_0x1a6eb4['on'](_0xfbd9('0x11'),function(){_0x17d433[_0xfbd9('0xe')]('EOS');});}catch(_0x59eb67){logger[_0xfbd9('0x12')](_0xfbd9('0x13'),JSON[_0xfbd9('0x14')](_0x59eb67));_0x17d433[_0xfbd9('0x15')]();}}function _0x3d36e7(_0x3a38ae){try{if(_0x3a38ae){var _0xcf06a2=JSON[_0xfbd9('0x16')](_0x3a38ae);switch(_0xcf06a2['status']){case 0x0:if(_0xcf06a2['result']){if(_0xcf06a2[_0xfbd9('0x17')][_0xfbd9('0x18')]){logger['info'](_0xfbd9('0x19'),JSON[_0xfbd9('0x14')](_0xcf06a2[_0xfbd9('0x17')][_0xfbd9('0x1a')]));_0x16d3f4=_0xcf06a2[_0xfbd9('0x17')]['hypotheses'][0x0]['transcript'];_0x1e5926=_0xcf06a2[_0xfbd9('0x17')]['hypotheses'][0x0][_0xfbd9('0x1b')];_0x3ad9ad='0';_0x346b2c=_0xfbd9('0x1c');_0x17d433[_0xfbd9('0x15')]();}}break;case 0x1:logger[_0xfbd9('0x6')](_0xfbd9('0x8'));_0x3ad9ad='1';_0x346b2c='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xfbd9('0x6')](_0xfbd9('0x1d'));_0x3ad9ad='2';_0x346b2c=_0xfbd9('0x1d');break;case 0x9:logger[_0xfbd9('0x6')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x3ad9ad='9';_0x346b2c=_0xfbd9('0x1e');break;case 0xa:logger['info'](_0xfbd9('0x1f'));_0x3ad9ad='10';_0x346b2c=_0xfbd9('0x1f');break;case 0xb:logger[_0xfbd9('0x6')](_0xfbd9('0x20'));_0x3ad9ad='11';_0x346b2c=_0xfbd9('0x20');}}}catch(_0x317361){logger[_0xfbd9('0x12')](_0xfbd9('0x21'),JSON['stringify'](_0x317361));_0x17d433[_0xfbd9('0x15')]();}}function _0xd3537a(){logger[_0xfbd9('0x6')](_0xfbd9('0x22'));_0x95755d({'transcript':_0x16d3f4,'confidence':_0x1e5926,'status':_0x3ad9ad,'status_message':_0x346b2c});}function _0x59abf1(_0x3a6c39){logger[_0xfbd9('0x12')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xfbd9('0x23')](_0x3a6c39)){logger[_0xfbd9('0x12')](_[_0xfbd9('0x24')](_0x3a6c39)?JSON[_0xfbd9('0x14')](_0x3a6c39):_0x3a6c39);}}_0x17d433['on'](_0xfbd9('0x25'),_0x36a207);_0x17d433['on'](_0xfbd9('0x26'),_0x3d36e7);_0x17d433['on'](_0xfbd9('0x11'),_0xd3537a);_0x17d433['on'](_0xfbd9('0x12'),_0x59abf1);});}; \ 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 f165eef..10cb4be 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 _0xd933=['exports','./asr'];(function(_0x1bf1ab,_0x272b0d){var _0x433fb0=function(_0x51cd2a){while(--_0x51cd2a){_0x1bf1ab['push'](_0x1bf1ab['shift']());}};_0x433fb0(++_0x272b0d);}(_0xd933,0x12d));var _0x3d93=function(_0x38060f,_0x31ce58){_0x38060f=_0x38060f-0x0;var _0x17441b=_0xd933[_0x38060f];return _0x17441b;};var asr=require(_0x3d93('0x0'));module[_0x3d93('0x1')]={'asr':asr}; \ No newline at end of file +var asr=require('./asr');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 f1f4a75..8effc03 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 _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x74892f,_0x1e981b){var _0x10ee61=function(_0x3c480a){while(--_0x3c480a){_0x74892f['push'](_0x74892f['shift']());}};_0x10ee61(++_0x1e981b);}(_0xe706,0xa3));var _0x6e70=function(_0x111692,_0x19f8a9){_0x111692=_0x111692-0x0;var _0x11836f=_0xe706[_0x111692];return _0x11836f;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file +var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x1dab5f,_0x10cd21){var _0x40c2f3=function(_0x325a0d){while(--_0x325a0d){_0x1dab5f['push'](_0x1dab5f['shift']());}};_0x40c2f3(++_0x10cd21);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 2a8c533..0d51961 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 _0xb07f=['no\x20list\x20selected','delay','add','minutes','sync','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','Executed\x20command\x20%s','DIAL','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','Trying\x20SestekNDA:\x20%s','sesteknda','audiofile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','variable_id','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','appsecret','no\x20appsecret\x20configured','wav','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','unlink','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','AGENT\x20%s\x20NOT\x20FOUND\x20BY','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','200','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','XMCS-UNIQUEID','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','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','host','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20no\x20stored','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','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','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','then','name','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','accountcode','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','render','stringify','body','statusCode','statusMessage','message','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','uri','clear','includes','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','setVariable','split','getVariable','getAndSetVariable','result','extra','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block'];(function(_0x423c1b,_0xd06dbf){var _0x427080=function(_0x3a28e6){while(--_0x3a28e6){_0x423c1b['push'](_0x423c1b['shift']());}};_0x427080(++_0xd06dbf);}(_0xb07f,0x109));var _0xfb07=function(_0x26018c,_0x3c0903){_0x26018c=_0x26018c-0x0;var _0x1efc45=_0xb07f[_0x26018c];return _0x1efc45;};'use strict';var fs=require('fs');var util=require(_0xfb07('0x0'));var _=require(_0xfb07('0x1'));var sh=require(_0xfb07('0x2'));var odbc=require(_0xfb07('0x3'))();var rs=require(_0xfb07('0x4'));var moment=require(_0xfb07('0x5'));var Mustache=require(_0xfb07('0x6'));var rp=require(_0xfb07('0x7'));var logger=require(_0xfb07('0x8'))(_0xfb07('0x9'));var config=require(_0xfb07('0xa'));var scripts=require('./scripts');var FILES_PATH=_0xfb07('0xb');var recursiveMapAttributes=[_0xfb07('0xc'),_0xfb07('0xd')];var verticesWithRetry=[_0xfb07('0xe'),_0xfb07('0xf'),_0xfb07('0x10')];var AGIVertices=function(_0x2b5000,_0x42aaea,_0x22d0f8){this[_0xfb07('0x11')]=_0x2b5000;this[_0xfb07('0x12')]=_0x42aaea;this[_0xfb07('0x13')]=_0x22d0f8;};AGIVertices['prototype']['getVariable']=function(_0x575c96,_0x3d91db){this[_0xfb07('0x12')]['getVariableById'](_0x575c96)[_0xfb07('0x14')](function(_0x18f5f4){_0x3d91db(null,_0x18f5f4?_0x18f5f4[_0xfb07('0x15')]:![]);})[_0xfb07('0x16')](function(_0x2ad2cf){_0x3d91db(_0x2ad2cf);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x18')]=function(_0x528550,_0x5780f8){this[_0xfb07('0x12')][_0xfb07('0x19')](_0x528550)[_0xfb07('0x14')](function(_0x2423f2){_0x5780f8(null,_0x2423f2?_0x2423f2[_0xfb07('0x15')]:![]);})[_0xfb07('0x16')](function(_0x228e2a){_0x5780f8(_0x228e2a);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x1a')]=function(_0x3dde76,_0x1cfc43){this[_0xfb07('0x12')][_0xfb07('0x1b')](_0x3dde76)['then'](function(_0x57fc39){_0x1cfc43(null,_0x57fc39?_0x57fc39[_0xfb07('0x15')]:![]);})[_0xfb07('0x16')](function(_0x197f12){_0x1cfc43(_0x197f12);});};AGIVertices['prototype'][_0xfb07('0x1c')]=function(_0x3a88d9,_0x527c4e){this['rpc'][_0xfb07('0x1d')](_0x3a88d9)[_0xfb07('0x14')](function(_0x2d2d33){_0x527c4e(null,_0x2d2d33?_0x2d2d33[_0xfb07('0x1e')]:![]);})[_0xfb07('0x16')](function(_0x323bec){_0x527c4e(_0x323bec);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x1f')]=function(_0x19ad99,_0x578bb2){this[_0xfb07('0x12')]['getUserById'](_0x19ad99)[_0xfb07('0x14')](function(_0x14c771){_0x578bb2(null,_0x14c771?_0x14c771[_0xfb07('0x15')]:![]);})[_0xfb07('0x16')](function(_0xb2063a){_0x578bb2(_0xb2063a);});};AGIVertices['prototype'][_0xfb07('0x20')]=function(_0x451cd8,_0x10835a){this[_0xfb07('0x12')][_0xfb07('0x21')](_0x451cd8)[_0xfb07('0x14')](function(_0x531346){_0x10835a(null,_0x531346?_0x531346[_0xfb07('0x15')]:![]);})[_0xfb07('0x16')](function(_0x581508){_0x10835a(_0x581508);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x22')]=function(_0xe813a7,_0x149ac0){var _0x46927a=this;this[_0xfb07('0x12')][_0xfb07('0x23')](_0xe813a7)[_0xfb07('0x14')](function(_0x95f1d){_0x149ac0(null,_0x95f1d?_0x46927a[_0xfb07('0x24')](_0x95f1d[_0xfb07('0x25')]):![]);})['catch'](function(_0x217932){_0x149ac0(_0x217932);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x26')]=function(_0x11569f,_0x5dd4c9){this[_0xfb07('0x12')][_0xfb07('0x27')](_0x11569f)['then'](function(_0x36da2a){_0x5dd4c9(null,_0x36da2a?_0x36da2a:![]);})['catch'](function(_0x328d2e){_0x5dd4c9(_0x328d2e);});};AGIVertices['prototype'][_0xfb07('0x28')]=function(_0x4a8d4c,_0xf33bd0,_0x3a6e9a){this[_0xfb07('0x13')][_0xfb07('0x28')](_0x4a8d4c,_0xf33bd0)[_0xfb07('0x14')](function(){_0x3a6e9a(null);})[_0xfb07('0x16')](function(_0x586c15){_0x3a6e9a(_0x586c15);});};AGIVertices['prototype'][_0xfb07('0x29')]=function(_0x1cccdd,_0x394e67){this[_0xfb07('0x12')]['getIntervalById'](_0x1cccdd)['then'](function(_0x22ef8c){if(_0x22ef8c){if(_0x22ef8c[_0xfb07('0x2a')]){_0x394e67(null,[_0x22ef8c[_0xfb07('0x2b')]]);}else{_0x394e67(null,_[_0xfb07('0x2c')](_0x22ef8c[_0xfb07('0x2d')],_0xfb07('0x2b')));}}else{_0x394e67(null,![]);}})['catch'](function(_0x4b285d){_0x394e67(_0x4b285d);});};AGIVertices['prototype'][_0xfb07('0x24')]=function(_0x3daa5a){return util[_0xfb07('0x2e')](_0xfb07('0x2f'),FILES_PATH,_0x3daa5a);};AGIVertices['prototype']['getQueryOdbc']=function(_0x9b59fc,_0x1d0132,_0x59c27d){odbc['open'](_0x9b59fc,function(_0x5e9933){if(_0x5e9933){logger[_0xfb07('0x30')](_0xfb07('0x31'),_0x5e9933);_0x59c27d(_0x5e9933);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0xfb07('0x32')](_0x1d0132,function(_0xfe26cc,_0x18c41f){if(_0xfe26cc){logger[_0xfb07('0x33')](_0xfb07('0x34'),_0x1d0132);_0x59c27d(_0xfe26cc);}else{logger['info'](_0xfb07('0x35'),_0x1d0132);odbc[_0xfb07('0x36')](function(_0xac769b){if(_0xac769b){logger[_0xfb07('0x30')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0xac769b);}_0x59c27d(null,_0x18c41f);});}});}});};AGIVertices['prototype'][_0xfb07('0x37')]=function(_0x7a274c,_0x1d55bd){this[_0xfb07('0x12')][_0xfb07('0x38')](_0x7a274c)[_0xfb07('0x14')](function(_0x244aed){_0x1d55bd(null,_0x244aed?_0x244aed:![]);})['catch'](function(_0x5c59d1){_0x1d55bd(_0x5c59d1);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x39')]=function(_0x4e5127,_0x5df46c){this[_0xfb07('0x12')][_0xfb07('0x39')](_0x4e5127)[_0xfb07('0x14')](function(_0x48c179){_0x5df46c(null,_0x48c179);})['catch'](function(_0x14fcc2){_0x5df46c(_0x14fcc2);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x3a')]=function(_0x123e3d,_0xb87b68,_0x3e8a51){this[_0xfb07('0x12')][_0xfb07('0x3a')]({'uniqueid':this[_0xfb07('0x11')]['uniqueid'],'node':_0x123e3d[_0xfb07('0x3b')],'application':_0x123e3d[_0xfb07('0x3c')],'data':_0xb87b68||null,'project_name':this[_0xfb07('0x11')][_0xfb07('0x3d')],'callerid':this[_0xfb07('0x11')][_0xfb07('0x3e')]})[_0xfb07('0x14')](function(_0x34c4bf){if(_0x3e8a51){_0x3e8a51(null,_0x34c4bf);}})[_0xfb07('0x16')](function(_0x26e1c3){if(_0x3e8a51){_0x3e8a51(_0x26e1c3);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x256967,_0x2d1d4d,_0x4b7404,_0x3f56c6){this[_0xfb07('0x12')][_0xfb07('0x3f')]({'uniqueid':this[_0xfb07('0x11')][_0xfb07('0x40')],'callerid':this['channel']['callerid'],'calleridname':this[_0xfb07('0x11')][_0xfb07('0x41')],'context':this[_0xfb07('0x11')][_0xfb07('0x42')],'extension':this[_0xfb07('0x11')][_0xfb07('0x43')],'priority':this[_0xfb07('0x11')][_0xfb07('0x44')],'accountcode':this[_0xfb07('0x11')][_0xfb07('0x45')],'dnid':this['channel']['dnid'],'projectName':this['channel'][_0xfb07('0x3d')],'saveName':_0x2d1d4d,'filename':_0x256967['file']||_0x2d1d4d,'savePath':_0x4b7404})[_0xfb07('0x14')](function(_0x31cca8){_0x3f56c6(null,_0x31cca8);})[_0xfb07('0x16')](function(_0x11ec85){_0x3f56c6(_0x11ec85);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x46')]=function(_0x4d464e,_0x3b2cce,_0x9f553c,_0x2d4a4d,_0x2231d3){this[_0xfb07('0x12')]['createSquareMessage']({'uniqueid':this[_0xfb07('0x11')][_0xfb07('0x40')],'body':_0x4d464e,'direction':_0x3b2cce,'providerName':_0x9f553c,'providerResponse':_0x2d4a4d})[_0xfb07('0x14')](function(_0x443b3d){if(_0x2231d3){_0x2231d3(null,_0x443b3d);}})[_0xfb07('0x16')](function(_0x5179c2){if(_0x2231d3){_0x2231d3(_0x5179c2);}});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x47')]=function(_0x38b30e,_0x3b84a0){this[_0xfb07('0x12')]['createCmContact']({'firstName':_[_0xfb07('0x48')](_0x38b30e[_0xfb07('0x15')])||_[_0xfb07('0x49')](_0x38b30e[_0xfb07('0x15')])?'callback_'+Math[_0xfb07('0x4a')]():_0x38b30e[_0xfb07('0x15')],'lastName':_[_0xfb07('0x48')](_0x38b30e[_0xfb07('0x4b')])||_[_0xfb07('0x49')](_0x38b30e[_0xfb07('0x4b')])?null:_0x38b30e[_0xfb07('0x4b')],'phone':_0x38b30e[_0xfb07('0x4c')],'ListId':_0x38b30e[_0xfb07('0x4d')],'scheduledat':_0x38b30e[_0xfb07('0x4e')],'callbackUniqueid':this['channel'][_0xfb07('0x40')],'tags':'callback','description':_0xfb07('0x4f')+_0x38b30e[_0xfb07('0x4e')][_0xfb07('0x50')](),'priority':_0x38b30e[_0xfb07('0x51')]})[_0xfb07('0x14')](function(_0x7746bb){_0x3b84a0(null,_0x7746bb);})[_0xfb07('0x16')](function(_0x4cc860){_0x3b84a0(_0x4cc860);});};AGIVertices['prototype']['getPause']=function(_0x395d99,_0x19db07){this[_0xfb07('0x12')]['getPauseById'](_0x395d99)[_0xfb07('0x14')](function(_0x4ef1a4){_0x19db07(null,_0x4ef1a4?_0x4ef1a4[_0xfb07('0x15')]:![]);})[_0xfb07('0x16')](function(_0x4be871){_0x19db07(_0x4be871);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x52')]=function(_0x18d0de,_0xc122ae,_0x294dc8){var _0x474711={'role':_0xfb07('0x53')};_0x474711[_0x18d0de]=this[_0xfb07('0x11')][_0xfb07('0x3e')];this[_0xfb07('0x12')][_0xfb07('0x52')](_0x474711,_0xc122ae,this[_0xfb07('0x11')][_0xfb07('0x40')])[_0xfb07('0x14')](function(_0x5387ce){_0x294dc8(null,_[_0xfb07('0x49')](_0x5387ce)?![]:!![]);})[_0xfb07('0x16')](function(_0x56fb6c){logger['error'](_0x56fb6c);_0x294dc8(null,![]);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x54')]=function(_0x168d64,_0x491925){var _0x440887={'role':'agent'};_0x440887[_0x168d64]=this['channel']['callerid'];this['rpc'][_0xfb07('0x54')](_0x440887)[_0xfb07('0x14')](function(_0x22863b){_0x491925(null,_[_0xfb07('0x49')](_0x22863b)?![]:!![]);})[_0xfb07('0x16')](function(_0x11ceba){logger[_0xfb07('0x30')](_0x11ceba);_0x491925(null,![]);});};AGIVertices['prototype'][_0xfb07('0x55')]=function(_0x45a88f,_0x280903){var _0x37267d={'role':_0xfb07('0x53')};_0x37267d[_0x45a88f]=this[_0xfb07('0x11')][_0xfb07('0x3e')];this[_0xfb07('0x12')]['agentLogout'](_0x37267d)[_0xfb07('0x14')](function(_0x3eea5f){_0x280903(null,_[_0xfb07('0x49')](_0x3eea5f)?![]:!![]);})[_0xfb07('0x16')](function(_0x2678d2){logger['error'](_0x2678d2);_0x280903(null,![]);});};AGIVertices['prototype'][_0xfb07('0x56')]=function(_0x231247,_0x5ddd00){var _0x18ccd6={'role':_0xfb07('0x53')};_0x18ccd6[_0x231247]=this[_0xfb07('0x11')][_0xfb07('0x3e')];var _0x127392=_0x231247!=_0xfb07('0x57')?util[_0xfb07('0x2e')]('%s/%s@from-sip/n','LOCAL',this[_0xfb07('0x11')]['callerid']):undefined;this[_0xfb07('0x12')][_0xfb07('0x56')](_0x18ccd6,_0x127392)[_0xfb07('0x14')](function(_0x393a61){_0x5ddd00(null,_[_0xfb07('0x49')](_0x393a61)?![]:!![]);})[_0xfb07('0x16')](function(_0x40892d){logger[_0xfb07('0x30')](_0x40892d);_0x5ddd00(null,![]);});};AGIVertices[_0xfb07('0x17')]['shellCommand']=function(_0x1827d0,_0x3e013c){sh[_0xfb07('0x58')](_[_0xfb07('0x59')](_0x1827d0),function(_0x3d1b8c,_0x5e0399){var _0x1e63aa=_0x5e0399[_0xfb07('0x5a')](/(\r\n|\n|\r)/gm,'');_0x3e013c(null,_0x1e63aa);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x5b')]=function(_0x572afa,_0xc64fd3){scripts['googleCloudTTS'](_0x572afa['apiKey'],_0x572afa[_0xfb07('0x5c')]||_0xfb07('0x5d'),_0x572afa[_0xfb07('0x5d')],_0x572afa[_0xfb07('0x5e')]||_0xfb07('0x5f'),_0x572afa[_0xfb07('0x60')]||'MALE',_0x572afa[_0xfb07('0x61')]||_0xfb07('0x62'))[_0xfb07('0x14')](function(_0x47742d){_0xc64fd3(null,_0x47742d);})[_0xfb07('0x16')](function(_0x1533d7){_0xc64fd3(_0x1533d7);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x63')]=function(_0x31f85e,_0x354c53){scripts[_0xfb07('0x63')](_0x31f85e[_0xfb07('0x5d')],_0x31f85e[_0xfb07('0x64')]||'en',0x1)[_0xfb07('0x14')](function(_0x194193){_0x354c53(null,_0x194193);})[_0xfb07('0x16')](function(_0x5e2e34){_0x354c53(_0x5e2e34);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x65')]=function(_0x3d5466,_0x2a3dd1){var _0x3a45af={'uri':_0x3d5466[_0xfb07('0x66')],'method':_0x3d5466[_0xfb07('0x67')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3d5466[_0xfb07('0x68')])===_0xfb07('0x69')&&parseInt(_0x3d5466[_0xfb07('0x68')])>=0x1?parseInt(_0x3d5466[_0xfb07('0x68')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST',_0xfb07('0x6a')],_0x3a45af[_0xfb07('0x67')][_0xfb07('0x6b')]())){try{_0x3a45af['body']=_0x3d5466[_0xfb07('0xd')]?JSON[_0xfb07('0x6c')](_0x3d5466[_0xfb07('0xd')]):{};}catch(_0x4c661f){logger[_0xfb07('0x30')](_0xfb07('0x6d'),_0x4c661f);}}try{_0x3a45af[_0xfb07('0x6e')]=_0x3d5466[_0xfb07('0xc')]?JSON['parse'](_0x3d5466[_0xfb07('0xc')]):{};}catch(_0x317146){logger[_0xfb07('0x30')](_0xfb07('0x6f'),_0x317146);}if(_0x3d5466['computedVariables']){try{var _0x3f0842=require(_0x3d5466[_0xfb07('0x70')])['sync'](this,_0x3a45af);_0x3a45af['uri']=Mustache[_0xfb07('0x71')](_0x3d5466[_0xfb07('0x66')],_0x3f0842,{},['$$','$$']);if(_0x3a45af['headers']){_0x3a45af['headers']=JSON[_0xfb07('0x6c')](Mustache[_0xfb07('0x71')](JSON[_0xfb07('0x72')](_0x3a45af['headers']),_0x3f0842,{},['$$','$$']));}if(_0x3a45af[_0xfb07('0x73')]){_0x3a45af['body']=JSON[_0xfb07('0x6c')](Mustache[_0xfb07('0x71')](JSON[_0xfb07('0x72')](_0x3a45af[_0xfb07('0x73')]),_0x3f0842,{},['$$','$$']));}}catch(_0x3d4bc7){logger[_0xfb07('0x30')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3d4bc7);}}rp(_0x3a45af)['then'](function(_0x27e5d4){var _0x3c7319={'statusCode':_0x27e5d4[_0xfb07('0x74')]||0xc8,'statusMessage':_0x27e5d4[_0xfb07('0x75')]||'OK','headers':_0x27e5d4['headers']||{},'body':_0x27e5d4[_0xfb07('0x73')]||{}};_0x2a3dd1(null,_0x3c7319);})[_0xfb07('0x16')](function(_0x8868d3){var _0x1a1edf={'statusCode':_0x8868d3[_0xfb07('0x74')]||0x1f4,'statusMessage':_0x8868d3[_0xfb07('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x8868d3[_0xfb07('0x77')][_0xfb07('0x6e')]||{},'body':_0x8868d3[_0xfb07('0x77')][_0xfb07('0x73')]||{}};_0x2a3dd1(null,_0x1a1edf);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x78')]=function(_0x473d67,_0x2b5319){scripts[_0xfb07('0x78')](this['channel'][_0xfb07('0x40')],_0x473d67[_0xfb07('0x79')],_0x473d67[_0xfb07('0x5d')],_0x473d67['dialogflow_language']||'en')[_0xfb07('0x14')](function(_0x39670c){_0x2b5319(null,_0x39670c);})['catch'](function(_0x43231e){_0x2b5319(_0x43231e);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x7a')]=function(_0x406f02,_0x516b97){scripts[_0xfb07('0x7a')](this[_0xfb07('0x11')][_0xfb07('0x40')],_0x406f02[_0xfb07('0x7b')],_0x406f02[_0xfb07('0x7c')],_0x406f02['private_key'],_0x406f02[_0xfb07('0x5d')],_0x406f02['dialogflowV2_language']||'en')[_0xfb07('0x14')](function(_0x566137){_0x516b97(null,_0x566137);})[_0xfb07('0x16')](function(_0x3f36f0){_0x516b97(_0x3f36f0);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x7d')]=function(_0xe18422,_0x2b8fc8){scripts[_0xfb07('0x7d')](this[_0xfb07('0x11')],_0xe18422)[_0xfb07('0x14')](function(_0x1fcee4){_0x2b8fc8(null,_0x1fcee4);})[_0xfb07('0x16')](function(_0x13010a){_0x2b8fc8(_0x13010a);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x7e')]=function(_0x5c9890,_0xfa4aa6){scripts['ispeechTTS'](_0x5c9890[_0xfb07('0x79')],_0x5c9890[_0xfb07('0x5d')],_0x5c9890[_0xfb07('0x7f')]||_0xfb07('0x5f'),_0x5c9890['speed'])[_0xfb07('0x14')](function(_0x15f8b3){_0xfa4aa6(null,_0x15f8b3);})[_0xfb07('0x16')](function(_0x81c3a0){_0xfa4aa6(_0x81c3a0);});};AGIVertices['prototype'][_0xfb07('0x80')]=function(_0x5d0b6b,_0x235032,_0x1714b5){scripts[_0xfb07('0x80')](_0x235032,_0x5d0b6b[_0xfb07('0x79')],_0x5d0b6b[_0xfb07('0x81')]||_0xfb07('0x5f'),this[_0xfb07('0x82')](_0x5d0b6b[_0xfb07('0x83')])?_0x5d0b6b[_0xfb07('0x83')]:undefined)[_0xfb07('0x14')](function(_0x4d90af){_0x1714b5(null,_0x4d90af);})[_0xfb07('0x16')](function(_0x36f304){_0x1714b5(_0x36f304);});};AGIVertices['prototype'][_0xfb07('0x84')]=function(_0x21dc41,_0x36f6ab){scripts['awsPolly'](_0x21dc41[_0xfb07('0x85')],_0x21dc41['aws_secret_access_key'],_0x21dc41[_0xfb07('0x86')],_0x21dc41[_0xfb07('0x87')]||_0xfb07('0x88'),_0x21dc41[_0xfb07('0x5d')],_0x21dc41[_0xfb07('0x89')]||_0xfb07('0x5d'))['then'](function(_0x24dff2){_0x36f6ab(null,_0x24dff2);})[_0xfb07('0x16')](function(_0x4fdd58){_0x36f6ab(_0x4fdd58);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x8a')]=function(_0xfc42be,_0x759be3){scripts[_0xfb07('0x8a')](this[_0xfb07('0x11')]['uniqueid'],_0xfc42be[_0xfb07('0x85')],_0xfc42be[_0xfb07('0x8b')],_0xfc42be['aws_lex_region'],_0xfc42be[_0xfb07('0x5d')],_0xfc42be[_0xfb07('0x8c')])[_0xfb07('0x14')](function(_0x1f4163){_0x759be3(null,_0x1f4163);})[_0xfb07('0x16')](function(_0x72ae3){_0x759be3(_0x72ae3);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x8d')]=function(_0x2a7d25,_0x3a6fde,_0x368058){scripts[_0xfb07('0x8d')](_0x3a6fde,_0x2a7d25[_0xfb07('0x79')],_0x2a7d25[_0xfb07('0x8e')]||_0xfb07('0x5f'))[_0xfb07('0x14')](function(_0x32d9cb){_0x368058(null,_0x32d9cb);})[_0xfb07('0x16')](function(_0x4477d0){_0x368058(_0x4477d0);});};AGIVertices[_0xfb07('0x17')][_0xfb07('0x8f')]=function(_0x115f41,_0x2ded6f,_0xa3a9ea){scripts[_0xfb07('0x8f')](_0x2ded6f,_0x115f41[_0xfb07('0x90')],_0x115f41['appsecret'],_0x115f41[_0xfb07('0x91')])[_0xfb07('0x14')](function(_0x129af1){_0xa3a9ea(null,_0x129af1);})[_0xfb07('0x16')](function(_0x1e9bc9){_0xa3a9ea(_0x1e9bc9);});};AGIVertices['prototype'][_0xfb07('0x92')]=function(_0x9f79da){var _0xec7d03=_[_0xfb07('0x93')](verticesWithRetry,_0x9f79da[_0xfb07('0x3c')])?_0x9f79da:_[_0xfb07('0x94')](_0x9f79da);for(var _0x3bf1d9 in _0xec7d03){if(_0xec7d03[_0xfb07('0x95')](_0x3bf1d9)){if(_0xec7d03[_0x3bf1d9]&&_[_0xfb07('0x96')](_0xec7d03[_0x3bf1d9])){if(_[_0xfb07('0x93')](recursiveMapAttributes,_0x3bf1d9)){_0xec7d03[_0x3bf1d9]=this[_0xfb07('0x97')](_0xec7d03[_0x3bf1d9]);}else{_0xec7d03[_0x3bf1d9]=this[_0xfb07('0x98')](_0xec7d03[_0x3bf1d9]);}}}}return _0xec7d03;};AGIVertices[_0xfb07('0x17')]['recursiveNodeIndex']=function(_0x3e326c){for(var _0x19bdd3 in _0x3e326c){if(_0x3e326c[_0xfb07('0x95')](_0x19bdd3)){if(_[_0xfb07('0x99')](_0x3e326c[_0x19bdd3])){this[_0xfb07('0x9a')](_0x3e326c[_0x19bdd3]);}else if(_[_0xfb07('0x9b')](_0x3e326c[_0x19bdd3])){for(var _0x3140f9=0x0;_0x3140f9<_0x3e326c[_0x19bdd3][_0xfb07('0x9c')];_0x3140f9++){this[_0xfb07('0x9a')](_0x3e326c[_0x19bdd3][_0x3140f9]);}}else if(_['isString'](_0x3e326c[_0x19bdd3])){_0x3e326c[_0x19bdd3]=this['replaceAllVariables'](_0x3e326c[_0x19bdd3]);}}}};AGIVertices[_0xfb07('0x17')][_0xfb07('0x9d')]=function(_0x2bf666,_0x5109f0){for(var _0x5de899 in _0x2bf666){if(_0x2bf666[_0xfb07('0x95')](_0x5de899)){if(_['isPlainObject'](_0x2bf666[_0x5de899])){if(!_[_0xfb07('0x48')](_0x2bf666[_0x5de899])){this['saveRestApiResult'](_0x2bf666[_0x5de899],util[_0xfb07('0x2e')]('%s.%s',_0x5109f0,_0x5de899));}}else if(_['isArray'](_0x2bf666[_0x5de899])){for(var _0x175f6e=0x0;_0x175f6e<_0x2bf666[_0x5de899][_0xfb07('0x9c')];_0x175f6e++){this[_0xfb07('0x9d')](_0x2bf666[_0x5de899][_0x175f6e],util[_0xfb07('0x2e')](_0xfb07('0x9e'),_0x5109f0,_0x5de899+'['+_0x175f6e+']'));}}else{if(!_[_0xfb07('0x49')](_0x2bf666[_0x5de899])){this[_0xfb07('0x11')][_0xfb07('0x9f')](util[_0xfb07('0x2e')](_0xfb07('0x9e'),_0x5109f0,_0x5de899),_0x2bf666[_0x5de899]);}}}}};AGIVertices['prototype'][_0xfb07('0x97')]=function(_0x2c3793){try{var _0x466479=JSON['parse'](_0x2c3793);this[_0xfb07('0x9a')](_0x466479);return JSON[_0xfb07('0x72')](_0x466479);}catch(_0x5d19b8){return this[_0xfb07('0x98')](_0x2c3793);}};AGIVertices[_0xfb07('0x17')][_0xfb07('0x98')]=function(_0x3b87c4){var _0x4bc25f=_0x3b87c4[_0xfb07('0xa0')]('{');for(var _0x59c128=0x1;_0x59c128<_0x4bc25f[_0xfb07('0x9c')];_0x59c128+=0x1){var _0x4fa751=_0x4bc25f[_0x59c128][_0xfb07('0xa0')]('}');if(_0x4fa751[_0xfb07('0x9c')]>0x1){_0x3b87c4=_0x3b87c4['replaceAll']('{'+_0x4fa751[0x0]+'}',this['channel'][_0xfb07('0xa1')](_0x4fa751[0x0])['extra']||_0x4fa751[0x0]);}}if(_0x4bc25f[_0xfb07('0x9c')]===0x1){return _0x3b87c4['toString']();}return this[_0xfb07('0x98')](_0x3b87c4);};AGIVertices[_0xfb07('0x17')][_0xfb07('0xa2')]=function(_0x15fb06,_0x3ac69f){var _0x50d699=this['channel'][_0xfb07('0xa1')](_0x15fb06);if(_0x50d699[_0xfb07('0xa3')]===-0x1){return _0x50d699;}logger[_0xfb07('0x33')](util[_0xfb07('0x2e')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x3ac69f,_0x50d699['extra']));return this[_0xfb07('0x11')][_0xfb07('0x9f')](_0x3ac69f,_0x50d699[_0xfb07('0xa4')]);};AGIVertices[_0xfb07('0x17')]['isConfigured']=function(_0x69b967){return _0x69b967&&_0x69b967!=='0'&&_0x69b967!=='-1'&&_0x69b967!=='';};AGIVertices[_0xfb07('0x17')][_0xfb07('0xa5')]=function(_0x491445){this[_0xfb07('0x3a')]['sync'](this,_0x491445,'-');_0x491445[_0xfb07('0xa6')]=_0x491445['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xfb07('0xa7')]=function(_0xe76d86){logger[_0xfb07('0x33')](util['format'](_0xfb07('0xa8'),_0xe76d86[_0xfb07('0x3b')]));if(!this['isConfigured'](_0xe76d86[_0xfb07('0x5d')])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0xaa'));}var _0x36442f='\x22'+_0xe76d86['text']+'\x22';if(this[_0xfb07('0x82')](_0xe76d86[_0xfb07('0x77')])){_0x36442f+=','+_0xe76d86[_0xfb07('0x77')];}var _0x1f4a9d=this[_0xfb07('0x11')]['exec'](_0xfb07('0xab'),_0x36442f);if(_0x1f4a9d[_0xfb07('0xa3')]===-0x1){return _0x1f4a9d;}return this['channel']['noop'](util[_0xfb07('0x2e')](_0xfb07('0xac'),_0x36442f));};AGIVertices[_0xfb07('0x17')][_0xfb07('0xad')]=function(_0x1f2968){logger['info'](util['format'](_0xfb07('0xae'),_0x1f2968[_0xfb07('0x3b')]));if(!this['isConfigured'](_0x1f2968[_0xfb07('0xaf')])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0xb0'));}var _0x3da3a8=_0x1f2968[_0xfb07('0xaf')];if(this[_0xfb07('0x82')](_0x1f2968['options'])){_0x3da3a8+=','+_0x1f2968[_0xfb07('0x77')];}var _0x4c83ba=this[_0xfb07('0x11')][_0xfb07('0x58')](_0xfb07('0xb1'),_0x3da3a8);if(_0x4c83ba['result']===-0x1){return _0x4c83ba;}var _0x322317=this[_0xfb07('0xa2')](_0xfb07('0xb2'),_0xfb07('0xb3'));if(_0x322317[_0xfb07('0xa3')]===-0x1){return _0x322317;}var _0xa089f6=this[_0xfb07('0xa2')](_0xfb07('0xb4'),'MRCP_RECOG_TRANSCRIPT');if(_0xa089f6[_0xfb07('0xa3')]===-0x1){return _0xa089f6;}var _0x580b50=this[_0xfb07('0xa2')](_0xfb07('0xb5'),'MRCP_RECOG_INSTANCE');if(_0x580b50[_0xfb07('0xa3')]===-0x1){return _0x580b50;}return this[_0xfb07('0x11')][_0xfb07('0xa9')](util['format'](_0xfb07('0xb6'),_0x3da3a8));};AGIVertices[_0xfb07('0x17')][_0xfb07('0x9')]=function(_0x536ccd){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0xb7'),_0x536ccd[_0xfb07('0x3b')]));return this[_0xfb07('0x11')][_0xfb07('0x9')]([_0x536ccd[_0xfb07('0xb8')],_0x536ccd[_0xfb07('0xb9')]]);};AGIVertices[_0xfb07('0x17')][_0xfb07('0xba')]=function(_0x21618a){logger['info'](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x21618a[_0xfb07('0x3b')]));if(this['isConfigured'](_0x21618a[_0xfb07('0x68')])){logger[_0xfb07('0x33')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x21618a[_0xfb07('0x68')]));var _0x5e5512=this[_0xfb07('0x11')]['wait'](_0x21618a[_0xfb07('0x68')]);if(_0x5e5512[_0xfb07('0xa3')]===-0x1){return _0x5e5512;}}return this['channel']['answer']();};AGIVertices[_0xfb07('0x17')][_0xfb07('0xbb')]=function(_0x51c2e6){logger['info'](util['format'](_0xfb07('0xbc'),_0x51c2e6[_0xfb07('0x3b')]));if(!this['isConfigured'](_0x51c2e6[_0xfb07('0x4d')])){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x51c2e6,_0xfb07('0xbd'));}_0x51c2e6['scheduledAt']=moment();if(this[_0xfb07('0x82')](_0x51c2e6[_0xfb07('0xbe')])){_0x51c2e6[_0xfb07('0x4e')]=moment()[_0xfb07('0xbf')](_0x51c2e6['delay'],_0xfb07('0xc0'));}if(!this['isConfigured'](_0x51c2e6[_0xfb07('0x51')])){_0x51c2e6[_0xfb07('0x51')]=0x2;}this[_0xfb07('0x47')][_0xfb07('0xc1')](this,_0x51c2e6);return this['channel'][_0xfb07('0xa9')](util[_0xfb07('0x2e')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x51c2e6['phone'],_0x51c2e6[_0xfb07('0x4d')],_0x51c2e6['scheduledAt']));};AGIVertices[_0xfb07('0x17')][_0xfb07('0xc2')]=function(_0x385752){logger['info'](util[_0xfb07('0x2e')](_0xfb07('0xc3'),_0x385752[_0xfb07('0x3b')]));var _0x31578f=this[_0xfb07('0x11')][_0xfb07('0x58')](_0x385752[_0xfb07('0xc4')],_0x385752['options']);if(_0x31578f[_0xfb07('0xa3')]===-0x1){return _0x31578f;}return this[_0xfb07('0x11')][_0xfb07('0xa9')](util['format'](_0xfb07('0xc5'),_0x385752['application'],_0x385752[_0xfb07('0x77')]));};AGIVertices[_0xfb07('0x17')]['lumenvoxtts']=function(_0x55d973){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0xc6'),_0x55d973[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x55d973[_0xfb07('0x5d')])){return this[_0xfb07('0x11')]['noop']('no\x20text\x20configured');}var _0x57ecc8='\x22'+_0x55d973[_0xfb07('0x5d')]+'\x22';if(this[_0xfb07('0x82')](_0x55d973['options'])){_0x57ecc8+=','+_0x55d973['options'];}var _0x45ea8d=this[_0xfb07('0x11')][_0xfb07('0x58')](_0xfb07('0xab'),_0x57ecc8);if(_0x45ea8d['result']===-0x1){return _0x45ea8d;}return this['channel'][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0xac'),_0x57ecc8));};AGIVertices[_0xfb07('0x17')]['sestektts']=function(_0xe4e1fb){logger['info'](util[_0xfb07('0x2e')](_0xfb07('0xc7'),_0xe4e1fb['label']));if(!this[_0xfb07('0x82')](_0xe4e1fb[_0xfb07('0x5d')])){return this['channel'][_0xfb07('0xa9')](_0xfb07('0xaa'));}var _0x5b6b98='\x22'+_0xe4e1fb[_0xfb07('0x5d')]+'\x22';if(this['isConfigured'](_0xe4e1fb['options'])){_0x5b6b98+=','+_0xe4e1fb['options'];}var _0x657ccf=this['channel']['exec'](_0xfb07('0xab'),_0x5b6b98);if(_0x657ccf['result']===-0x1){return _0x657ccf;}return this[_0xfb07('0x11')][_0xfb07('0xa9')](util['format'](_0xfb07('0xac'),_0x5b6b98));};AGIVertices[_0xfb07('0x17')][_0xfb07('0xc8')]=function(_0xd61b5c){logger['info'](util[_0xfb07('0x2e')](_0xfb07('0xc9'),_0xd61b5c[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0xd61b5c['grammar'])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0xb0'));}var _0x426b83=_0xd61b5c[_0xfb07('0xaf')];if(this['isConfigured'](_0xd61b5c[_0xfb07('0x77')])){_0x426b83+=','+_0xd61b5c['options'];}var _0x3589f8=this[_0xfb07('0x11')]['exec']('MRCPRecog',_0x426b83);if(_0x3589f8['result']===-0x1){return _0x3589f8;}var _0x169795=this[_0xfb07('0xa2')](_0xfb07('0xb2'),_0xfb07('0xca'));if(_0x169795['result']===-0x1){return _0x169795;}var _0x1c7e0b=this['getAndSetVariable'](_0xfb07('0xb4'),_0xfb07('0xcb'));if(_0x1c7e0b['result']===-0x1){return _0x1c7e0b;}var _0xf71267=this['getAndSetVariable'](_0xfb07('0xb5'),_0xfb07('0xcc'));if(_0xf71267[_0xfb07('0xa3')]===-0x1){return _0xf71267;}return this['channel'][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0xb6'),_0x426b83));};AGIVertices[_0xfb07('0x17')][_0xfb07('0xcd')]=function(_0x449634){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0xce'),_0x449634[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x449634[_0xfb07('0xaf')])){return this[_0xfb07('0x11')]['noop'](_0xfb07('0xb0'));}var _0x27daa6=_0x449634['grammar'];if(this[_0xfb07('0x82')](_0x449634[_0xfb07('0x77')])){_0x27daa6+=','+_0x449634[_0xfb07('0x77')];}var _0x3512df=this[_0xfb07('0x11')]['exec'](_0xfb07('0xb1'),_0x27daa6);if(_0x3512df[_0xfb07('0xa3')]===-0x1){return _0x3512df;}var _0x3a74e1=this[_0xfb07('0xa2')](_0xfb07('0xb2'),_0xfb07('0xcf'));if(_0x3a74e1[_0xfb07('0xa3')]===-0x1){return _0x3a74e1;}var _0x305b01=this[_0xfb07('0xa2')](_0xfb07('0xb4'),'SESTEK_ASR_TRANSCRIPT');if(_0x305b01[_0xfb07('0xa3')]===-0x1){return _0x305b01;}var _0x5548bb=this[_0xfb07('0xa2')]('RECOG_INSTANCE()',_0xfb07('0xd0'));if(_0x5548bb['result']===-0x1){return _0x5548bb;}return this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0xb6'),_0x27daa6));};AGIVertices[_0xfb07('0x17')]['database']=function(_0x2d3e62){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0xd1'),_0x2d3e62[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x2d3e62[_0xfb07('0xd2')])){return this['channel'][_0xfb07('0x30')](_0x2d3e62,_0xfb07('0xd3'));}var _0x4c4c42=this[_0xfb07('0x1c')]['sync'](this,_0x2d3e62[_0xfb07('0xd2')]);if(!_0x4c4c42){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x2d3e62,_0xfb07('0xd4'));}if(!this[_0xfb07('0x82')](_0x2d3e62[_0xfb07('0x32')])){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x2d3e62,_0xfb07('0xd5'));}var _0x5ce2d5=_0x2d3e62[_0xfb07('0x32')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xfb07('0x11')]['noop'](util[_0xfb07('0x2e')]('query:\x20%s',_0x5ce2d5));var _0x1fe864=this['getQueryOdbc'][_0xfb07('0xc1')](this,_0x4c4c42,_0x5ce2d5);this[_0xfb07('0x3a')][_0xfb07('0xc1')](this,_0x2d3e62,_0x5ce2d5);if(!this[_0xfb07('0x82')](_0x2d3e62['variable_id'])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0xd6'));}var _0x2172e8=this['getVariable']['sync'](this,_0x2d3e62['variable_id']);if(!_0x2172e8){return this['channel'][_0xfb07('0x30')](_0x2d3e62,_0xfb07('0xd7'));}var _0x3843de=this;_0x1fe864[_0xfb07('0xd8')](function(_0x15051d,_0x28d685){Object[_0xfb07('0xd9')](_0x15051d)[_0xfb07('0xd8')](function(_0x2054aa){_0x3843de['channel'][_0xfb07('0x9f')](util[_0xfb07('0x2e')](_0xfb07('0xda'),_0x2172e8,_0x28d685,_0x2054aa),_0x15051d[_0x2054aa]);});});this[_0xfb07('0x11')][_0xfb07('0x9f')](util[_0xfb07('0x2e')](_0xfb07('0xdb'),_0x2172e8),_0x1fe864[_0xfb07('0x9c')]);return this['channel'][_0xfb07('0xa9')](util['format']('variable\x20%s\x20set',_0x2172e8));};AGIVertices[_0xfb07('0x17')][_0xfb07('0xdc')]=function(_0x293892){logger[_0xfb07('0xdd')](util[_0xfb07('0x2e')](_0xfb07('0xde'),_0x293892[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x293892[_0xfb07('0xdf')])){return this[_0xfb07('0x11')]['error'](_0x293892,_0xfb07('0xe0'));}var _0x3d62bf=this[_0xfb07('0x1f')]['sync'](this,_0x293892[_0xfb07('0xdf')]);if(!_0x3d62bf){return this['channel'][_0xfb07('0x30')](_0x293892,_0xfb07('0xe1'));}var _0x341c7a=this[_0xfb07('0x11')][_0xfb07('0x58')]('DIAL',[util[_0xfb07('0x2e')]('SIP/%s',_0x3d62bf),_0x293892[_0xfb07('0x68')],_0x293892['opts'],_0x293892[_0xfb07('0x66')]]);if(_0x341c7a['result']===-0x1){return _0x341c7a;}return this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0xe2'),_0xfb07('0xe3')));};AGIVertices[_0xfb07('0x17')][_0xfb07('0xe4')]=function(_0x241a45){logger['info'](util[_0xfb07('0x2e')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x241a45[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x241a45[_0xfb07('0x79')])){return this[_0xfb07('0x11')]['noop'](_0xfb07('0xe5'));}if(!this['isConfigured'](_0x241a45[_0xfb07('0x5d')])){return this['channel'][_0xfb07('0xa9')](_0xfb07('0xaa'));}this[_0xfb07('0x11')][_0xfb07('0xe6')]=!![];this[_0xfb07('0x3a')](_0x241a45);this['createSquareMessage'](_0x241a45[_0xfb07('0x5d')],'in','','');this['channel'][_0xfb07('0xa9')](util['format'](_0xfb07('0xe7'),_0x241a45[_0xfb07('0x5d')]));var _0x3f568d=this[_0xfb07('0x78')][_0xfb07('0xc1')](this,_0x241a45);if(_0x3f568d){for(var _0x3cbd94 in _0x3f568d){if(_0x3f568d[_0xfb07('0x95')](_0x3cbd94)){this['channel'][_0xfb07('0x9f')](util[_0xfb07('0x2e')](_0xfb07('0xe8'),_0x3cbd94[_0xfb07('0x6b')]()),_0x3f568d[_0x3cbd94]);}}this[_0xfb07('0x46')](_0x3f568d[_0xfb07('0xe9')],_0xfb07('0xea'),'dialogflow','');return this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0xeb'),_0x3f568d[_0xfb07('0xe9')]));}return this['channel']['error'](_0x241a45,_0xfb07('0xec'));};AGIVertices[_0xfb07('0x17')][_0xfb07('0xed')]=function(_0x9f07da){logger[_0xfb07('0x33')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x9f07da[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x9f07da[_0xfb07('0x7b')])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0xee'));}if(!this[_0xfb07('0x82')](_0x9f07da[_0xfb07('0x7c')])){return this['channel'][_0xfb07('0xa9')]('no\x20client_email\x20configured');}if(!this[_0xfb07('0x82')](_0x9f07da[_0xfb07('0xef')])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0xf0'));}if(!this[_0xfb07('0x82')](_0x9f07da['dialogflowV2_language'])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0xf1'));}if(!this[_0xfb07('0x82')](_0x9f07da[_0xfb07('0x5d')])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0xaa'));}this[_0xfb07('0x11')][_0xfb07('0xe6')]=!![];this[_0xfb07('0x3a')](_0x9f07da);this[_0xfb07('0x46')](_0x9f07da[_0xfb07('0x5d')],'in','','');this['channel'][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0xf2'),_0x9f07da['text']));var _0x39eadd=this[_0xfb07('0x7a')][_0xfb07('0xc1')](this,_0x9f07da);if(_0x39eadd){for(var _0x49ee1a in _0x39eadd){if(_0x39eadd['hasOwnProperty'](_0x49ee1a)){if(_0x49ee1a!=='providerResponse'){this[_0xfb07('0x11')]['setVariable'](util[_0xfb07('0x2e')]('DIALOGFLOW_%s',_0x49ee1a[_0xfb07('0x6b')]()),_0x39eadd[_0x49ee1a]);}}}this[_0xfb07('0x46')](_0x39eadd['speech'],_0xfb07('0xea'),'dialogflowV2',_0x39eadd[_0xfb07('0xf3')]);return this[_0xfb07('0x11')][_0xfb07('0xa9')](util['format'](_0xfb07('0xf4'),_0x39eadd[_0xfb07('0xe9')]));}return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x9f07da,_0xfb07('0xf5'));};AGIVertices[_0xfb07('0x17')]['sesteknda']=function(_0x1b323f){logger['info'](util[_0xfb07('0x2e')](_0xfb07('0xf6'),_0x1b323f['label']));if(!this['isConfigured'](_0x1b323f[_0xfb07('0xf7')])){return this['channel'][_0xfb07('0xa9')](_0xfb07('0xf8'));}if(!this[_0xfb07('0x82')](_0x1b323f['username'])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0xf9'));}if(!this[_0xfb07('0x82')](_0x1b323f[_0xfb07('0xfa')])){return this['channel']['noop']('no\x20password\x20configured');}if(!this[_0xfb07('0x82')](_0x1b323f['ndassistant_url'])){return this[_0xfb07('0x11')]['noop'](_0xfb07('0xaa'));}this[_0xfb07('0x11')][_0xfb07('0xe6')]=!![];this[_0xfb07('0x3a')](_0x1b323f);this['createSquareMessage'](_0x1b323f[_0xfb07('0x5d')],'in','','');this['channel']['noop'](util[_0xfb07('0x2e')](_0xfb07('0xfb'),_0x1b323f[_0xfb07('0x5d')]));var _0x303c0c=this[_0xfb07('0x7d')][_0xfb07('0xc1')](this,_0x1b323f);if(_0x303c0c){for(var _0x42d6c2 in _0x303c0c){if(_0x303c0c[_0xfb07('0x95')](_0x42d6c2)){this[_0xfb07('0x11')][_0xfb07('0x9f')](util[_0xfb07('0x2e')]('SESTEK_NDA_%s',_0x42d6c2[_0xfb07('0x6b')]()),_0x303c0c[_0x42d6c2]);}}this[_0xfb07('0x46')](_0x303c0c[_0xfb07('0xe9')],_0xfb07('0xea'),_0xfb07('0xfc'),'');if(_0x303c0c[_0xfb07('0xfd')]){this['channel']['noop'](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x303c0c[_0xfb07('0xfd')]));var _0x5f2e80=this[_0xfb07('0x11')]['streamFile'](_0x303c0c[_0xfb07('0xfd')]);try{fs['unlink'](_0x303c0c['audiofile']+_0xfb07('0xfe'));}catch(_0x2e0bb0){logger[_0xfb07('0x30')](_0x2e0bb0);}return _0x5f2e80;}else{return this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0xff'),_0x303c0c[_0xfb07('0xe9')]));}}return this['channel']['error'](_0x1b323f,_0xfb07('0x100'));};AGIVertices['prototype'][_0xfb07('0x101')]=function(_0x5e1f58){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x102'),_0x5e1f58[_0xfb07('0x3b')]));return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0x101'));};AGIVertices[_0xfb07('0x17')][_0xfb07('0x103')]=function(_0x29873a){logger['info'](util[_0xfb07('0x2e')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x29873a[_0xfb07('0x3b')]));var _0x5df908='';if(_0x29873a[_0xfb07('0x104')]){if(!this[_0xfb07('0x82')](_0x29873a['trunk_id'])){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x29873a,_0xfb07('0x105'));}else{var _0x3db3d9=parseInt(_0x29873a['trunk_id'],0xa);if(isNaN(_0x3db3d9)){_0x5df908=_0x29873a[_0xfb07('0x104')];}else{_0x5df908=this[_0xfb07('0x20')][_0xfb07('0xc1')](this,_0x29873a[_0xfb07('0x104')]);if(!_0x5df908){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x29873a,'no\x20trunk\x20found');}}}}else if(_0x29873a[_0xfb07('0x106')]){_0x5df908=_0x29873a[_0xfb07('0x106')];}else{return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x29873a,_0xfb07('0x105'));}var _0x4b8039=this[_0xfb07('0x11')]['exec'](_0xfb07('0xe3'),[util[_0xfb07('0x2e')](_0xfb07('0x107'),_0x5df908,_0x29873a['phone']),_0x29873a[_0xfb07('0x68')],_0x29873a[_0xfb07('0x108')],_0x29873a[_0xfb07('0x66')]]);if(_0x4b8039[_0xfb07('0xa3')]===-0x1){return _0x4b8039;}return this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0xe2'),'DIAL'));};AGIVertices[_0xfb07('0x17')][_0xfb07('0x109')]=function(_0x54a7a6){logger[_0xfb07('0x33')](util['format'](_0xfb07('0x10a'),_0x54a7a6[_0xfb07('0x3b')]));return this[_0xfb07('0x11')]['noop']('finally');};AGIVertices[_0xfb07('0x17')]['getdigits']=function(_0x22f1db){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x10b'),_0x22f1db[_0xfb07('0x3b')]));if(_0x22f1db[_0xfb07('0xa6')]===0x0){return this[_0xfb07('0xa5')](_0x22f1db);}_0x22f1db['retry']-=0x1;if(!this['isConfigured'](_0x22f1db['file_id'])){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x22f1db,_0xfb07('0x10c'));}var _0x25ce7f=this['getSound'][_0xfb07('0xc1')](this,_0x22f1db['file_id']);if(!_0x25ce7f){return this['channel'][_0xfb07('0x30')](_0x22f1db,_0xfb07('0x10d'));}if(!this[_0xfb07('0x82')](_0x22f1db[_0xfb07('0x10e')])){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0xfb07('0xd6'));}var _0x1b27be=this[_0xfb07('0x11')][_0xfb07('0x10f')](_0x25ce7f,_0x22f1db[_0xfb07('0x110')],_0x22f1db[_0xfb07('0x111')]);var _0x1076d1=_0x1b27be[_0xfb07('0xa3')]?_0x1b27be[_0xfb07('0xa3')][_0xfb07('0x50')]():'';logger['info'](_0xfb07('0x112'),JSON[_0xfb07('0x72')](_0x1b27be));if(_0x1b27be[_0xfb07('0xa3')]===-0x1){this[_0xfb07('0x3a')]['sync'](this,_0x22f1db,_0x1076d1);return _0x1b27be;}else if(_0x1b27be[_0xfb07('0xa4')]==='timeout'){_0x1b27be[_0xfb07('0xa3')]=_0x1076d1['length']>=parseInt(_0x22f1db['mindigit'])?'x':'i';}else{_0x1b27be[_0xfb07('0xa3')]=_0x1076d1[_0xfb07('0x9c')]>=parseInt(_0x22f1db[_0xfb07('0x113')])&&_0x1076d1[_0xfb07('0x9c')]<=parseInt(_0x22f1db[_0xfb07('0x111')])?'x':'i';}var _0x293313=this[_0xfb07('0xa1')][_0xfb07('0xc1')](this,_0x22f1db[_0xfb07('0x10e')]);if(!_0x293313){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x22f1db,_0xfb07('0xd7'));}this['channel'][_0xfb07('0x9f')](_0x293313,_0x1076d1);if(this['isConfigured'](_0x22f1db['hiddendigitsnum'])){var _0x1db0d1=parseInt(_0x22f1db[_0xfb07('0x114')],0xa);var _0x35f7d4=rs[_0xfb07('0x115')]({'charset':'*','length':_0x1db0d1});var _0x557475=_0x1076d1[_0xfb07('0x9c')];if(_0x557475>0x0){if(_0x557475>_0x1db0d1){this[_0xfb07('0x3a')][_0xfb07('0xc1')](this,_0x22f1db,_0x22f1db[_0xfb07('0x116')]===_0xfb07('0x117')?_0x35f7d4+_0x1076d1[_0xfb07('0x118')](_0x1db0d1):_0x1076d1['substr'](0x0,_0x557475-_0x1db0d1)+_0x35f7d4);}else{this[_0xfb07('0x3a')][_0xfb07('0xc1')](this,_0x22f1db,rs[_0xfb07('0x115')]({'charset':'*','length':_0x557475}));}}else{this[_0xfb07('0x3a')][_0xfb07('0xc1')](this,_0x22f1db,'');}}else{this[_0xfb07('0x3a')][_0xfb07('0xc1')](this,_0x22f1db,_0x1076d1);}return _0x1b27be;};AGIVertices['prototype'][_0xfb07('0x10')]=function(_0x921ef6){logger[_0xfb07('0x33')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x921ef6['label']));return this[_0xfb07('0xf')](_0x921ef6);};AGIVertices[_0xfb07('0x17')][_0xfb07('0x119')]=function(_0x1ece11){logger[_0xfb07('0x33')](util['format'](_0xfb07('0x11a'),_0x1ece11[_0xfb07('0x3b')]));this[_0xfb07('0x3a')][_0xfb07('0xc1')](this,_0x1ece11,_0x1ece11[_0xfb07('0x11b')]);return this[_0xfb07('0x11')][_0xfb07('0xa9')](util['format'](_0xfb07('0x11c'),_0x1ece11[_0xfb07('0x11b')]));};AGIVertices[_0xfb07('0x17')][_0xfb07('0x11d')]=function(_0x244713){logger[_0xfb07('0x33')](util['format'](_0xfb07('0x11e'),_0x244713[_0xfb07('0x3b')]));if(!this['isConfigured'](_0x244713['aws_access_key_id'])||!this[_0xfb07('0x82')](_0x244713[_0xfb07('0x8b')])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0x11f'));}if(!this[_0xfb07('0x82')](_0x244713[_0xfb07('0x5d')])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0xaa'));}this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0x120'),_0x244713[_0xfb07('0x5d')]));var _0x5e16cd=this['awsPolly']['sync'](this,_0x244713);if(_0x5e16cd){this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0x121'),_0x5e16cd));var _0x3b9b69=this[_0xfb07('0x11')][_0xfb07('0x122')](_0x5e16cd);try{fs['unlink'](_0x5e16cd+_0xfb07('0xfe'));}catch(_0x23979e){logger[_0xfb07('0x30')](_0x23979e);}return _0x3b9b69;}return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x244713,_0xfb07('0x123'));};AGIVertices['prototype'][_0xfb07('0x124')]=function(_0x515e16){logger['info'](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x515e16['label']));if(!this[_0xfb07('0x82')](_0x515e16[_0xfb07('0x85')])||!this[_0xfb07('0x82')](_0x515e16[_0xfb07('0x8b')])){return this[_0xfb07('0x11')]['noop'](_0xfb07('0x11f'));}if(!this[_0xfb07('0x82')](_0x515e16[_0xfb07('0x8c')])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0x125'));}if(!this[_0xfb07('0x82')](_0x515e16['text'])){return this[_0xfb07('0x11')]['noop'](_0xfb07('0xaa'));}this[_0xfb07('0x11')]['bot']=!![];this[_0xfb07('0x3a')](_0x515e16);this[_0xfb07('0x46')](_0x515e16['text'],'in','','');this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')]('Trying\x20Amazon\x20Lex:\x20%s',_0x515e16[_0xfb07('0x5d')]));var _0x317603=this[_0xfb07('0x8a')][_0xfb07('0xc1')](this,_0x515e16);if(_0x317603){for(var _0x411ae3 in _0x317603){if(_0x317603[_0xfb07('0x95')](_0x411ae3)&&_[_0xfb07('0x96')](_0x317603[_0x411ae3])){this[_0xfb07('0x11')][_0xfb07('0x9f')](util[_0xfb07('0x2e')](_0xfb07('0x126'),_0x411ae3[_0xfb07('0x6b')]()),_0x317603[_0x411ae3]);}}if(_['isNil'](_0x317603[_0xfb07('0x76')])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0x127'));}else{this[_0xfb07('0x46')](_0x317603['message'],_0xfb07('0xea'),_0xfb07('0x128'),'');return this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0x129'),_0x317603[_0xfb07('0x76')]));}}return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x515e16,_0xfb07('0x12a'));};AGIVertices[_0xfb07('0x17')][_0xfb07('0x12b')]=function(_0x220e85){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x12c'),_0x220e85[_0xfb07('0x3b')],_0x220e85[_0xfb07('0x68')]));if(!this[_0xfb07('0x82')](_0x220e85[_0xfb07('0x79')])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0xe5'));}var _0x589c4a='wav';var _0x3e032d=util[_0xfb07('0x2e')](_0xfb07('0x12d'),FILES_PATH,rs[_0xfb07('0x115')](0x4));var _0x176c59=util[_0xfb07('0x2e')](_0xfb07('0x9e'),_0x3e032d,_0x589c4a);var _0x59c1b5=!![];if(_0x220e85[_0xfb07('0x12e')]===_0xfb07('0x12f')){_0x59c1b5=![];}var _0x31bf1a=this[_0xfb07('0x11')][_0xfb07('0x130')](_0x3e032d,_0x589c4a,_0x220e85[_0xfb07('0x131')],_0x220e85[_0xfb07('0x68')],undefined,_0x59c1b5);if(_0x31bf1a[_0xfb07('0xa3')]!==-0x1){this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0x132'),_0x176c59));var _0x1084f3=this[_0xfb07('0x8d')][_0xfb07('0xc1')](this,_0x220e85,_0x176c59);if(_0x1084f3){for(var _0x1a945c in _0x1084f3){if(_0x1084f3[_0xfb07('0x95')](_0x1a945c)){this[_0xfb07('0x11')][_0xfb07('0x9f')](util[_0xfb07('0x2e')]('GOOGLE_ASR_%s',_0x1a945c[_0xfb07('0x6b')]()),_0x1084f3[_0x1a945c]);}}return this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0x133'),JSON[_0xfb07('0x72')](_0x1084f3)));}}return _0x31bf1a;};AGIVertices[_0xfb07('0x17')][_0xfb07('0x134')]=function(_0x4db8a0){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x4db8a0[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x4db8a0[_0xfb07('0x90')])){return this[_0xfb07('0x11')][_0xfb07('0xa9')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x4db8a0[_0xfb07('0x135')])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0x136'));}var _0x74bd61=_0xfb07('0x137');var _0x3c8f2e=util[_0xfb07('0x2e')](_0xfb07('0x12d'),FILES_PATH,rs[_0xfb07('0x115')](0x4));var _0xa45d78=util[_0xfb07('0x2e')]('%s.%s',_0x3c8f2e,_0x74bd61);var _0x4b0cac=!![];if(_0x4db8a0[_0xfb07('0x12e')]===_0xfb07('0x12f')){_0x4b0cac=![];}var _0x3c3e22=this[_0xfb07('0x11')][_0xfb07('0x130')](_0x3c8f2e,_0x74bd61,_0x4db8a0[_0xfb07('0x131')],_0x4db8a0[_0xfb07('0x68')],undefined,_0x4b0cac);if(_0x3c3e22[_0xfb07('0xa3')]!==-0x1){this[_0xfb07('0x11')][_0xfb07('0xa9')](util['format'](_0xfb07('0x138'),_0xa45d78));var _0x54691d=this[_0xfb07('0x8f')][_0xfb07('0xc1')](this,_0x4db8a0,_0xa45d78);if(_0x54691d){for(var _0x592f1f in _0x54691d){if(_0x54691d[_0xfb07('0x95')](_0x592f1f)){this['channel'][_0xfb07('0x9f')](util[_0xfb07('0x2e')](_0xfb07('0x139'),_0x592f1f['toUpperCase']()),_0x54691d[_0x592f1f]);}}return this['channel'][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0x13a'),JSON['stringify'](_0x54691d)));}}return _0x3c3e22;};AGIVertices[_0xfb07('0x17')][_0xfb07('0x13b')]=function(_0x55c0ed){logger['info'](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x55c0ed[_0xfb07('0x3b')]));return this[_0xfb07('0x11')][_0xfb07('0x13c')](_0x55c0ed[_0xfb07('0x42')],_0x55c0ed['extension'],_0x55c0ed['priority']);};AGIVertices[_0xfb07('0x17')][_0xfb07('0x13d')]=function(_0x17fdab){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x13e'),_0x17fdab[_0xfb07('0x3b')]));if(!this['isConfigured'](_0x17fdab[_0xfb07('0x13f')])){return this[_0xfb07('0x11')]['error'](_0x17fdab,_0xfb07('0x140'));}try{var _0xdfbc9f=eval(_0x17fdab[_0xfb07('0x13f')])?_0xfb07('0x141'):_0xfb07('0x142');this['channel'][_0xfb07('0xa9')](util['format'](_0xfb07('0x143'),_0x17fdab[_0xfb07('0x13f')],_0xdfbc9f));return{'code':0xc8,'result':_0xdfbc9f};}catch(_0x4f863a){return{'code':0xc8,'result':_0xfb07('0x142')};}};AGIVertices['prototype'][_0xfb07('0x144')]=function(_0x25dce9){logger['info'](util[_0xfb07('0x2e')](_0xfb07('0x145'),_0x25dce9[_0xfb07('0x3b')]));if(!this['isConfigured'](_0x25dce9[_0xfb07('0x146')])){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x25dce9,'no\x20interval\x20configured');}var _0x3b1e98=this[_0xfb07('0x29')][_0xfb07('0xc1')](this,_0x25dce9[_0xfb07('0x146')]);if(!_0x3b1e98){return this['channel'][_0xfb07('0x30')](_0x25dce9,'no\x20intervals\x20found');}for(var _0x47fc5e=0x0;_0x47fc5e<_0x3b1e98['length'];_0x47fc5e+=0x1){var _0x131ba2=this[_0xfb07('0x11')]['getVariable'](util[_0xfb07('0x2e')]('IFTIME(%s?true:false)',_0x3b1e98[_0x47fc5e]));if(_0x131ba2[_0xfb07('0xa3')]===-0x1){return _0x131ba2;}logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x147'),_0x3b1e98[_0x47fc5e],_0x131ba2[_0xfb07('0xa4')]));if(_0x131ba2['extra']===_0xfb07('0x141')){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x147'),_0x3b1e98[_0x47fc5e],_0xfb07('0x141')));this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0x147'),_0x3b1e98[_0x47fc5e],'true'));return{'code':0xc8,'result':_0xfb07('0x141')};}else{logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x147'),_0x3b1e98[_0x47fc5e],_0xfb07('0x142')));this['channel'][_0xfb07('0xa9')](util['format'](_0xfb07('0x147'),_0x3b1e98[_0x47fc5e],_0xfb07('0x142')));}}return{'code':0xc8,'result':_0xfb07('0x142')};};AGIVertices[_0xfb07('0x17')][_0xfb07('0x148')]=function(_0x5d1a95){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x149'),_0x5d1a95[_0xfb07('0x3b')]));return this[_0xfb07('0x11')][_0xfb07('0x148')]();};AGIVertices['prototype']['ispeechasr']=function(_0x3a6b5d){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x14a'),_0x3a6b5d[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x3a6b5d['key'])){return this[_0xfb07('0x11')][_0xfb07('0xa9')]('no\x20key\x20configured');}var _0x3fafb2='wav';var _0x392a3b=util[_0xfb07('0x2e')]('%s/recordings/%s',FILES_PATH,rs[_0xfb07('0x115')](0x4));var _0xa87515=util[_0xfb07('0x2e')](_0xfb07('0x9e'),_0x392a3b,_0x3fafb2);var _0x11eb2a=!![];if(_0x3a6b5d[_0xfb07('0x12e')]==='NOBEEP'){_0x11eb2a=![];}var _0x20a6d5=this[_0xfb07('0x11')][_0xfb07('0x130')](_0x392a3b,_0x3fafb2,_0x3a6b5d['intKey'],_0x3a6b5d['timeout'],undefined,_0x11eb2a);if(_0x20a6d5[_0xfb07('0xa3')]!==-0x1){this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0x14b'),_0xa87515));var _0x57ff9a=this[_0xfb07('0x80')][_0xfb07('0xc1')](this,_0x3a6b5d,_0xa87515);if(_0x57ff9a){for(var _0x22cd8d in _0x57ff9a){if(_0x57ff9a[_0xfb07('0x95')](_0x22cd8d)){this[_0xfb07('0x11')][_0xfb07('0x9f')](util['format'](_0xfb07('0x14c'),_0x22cd8d[_0xfb07('0x6b')]()),_0x57ff9a[_0x22cd8d]);}}return this['channel']['noop'](util[_0xfb07('0x2e')](_0xfb07('0x14d'),JSON[_0xfb07('0x72')](_0x57ff9a)));}}return _0x20a6d5;};AGIVertices[_0xfb07('0x17')][_0xfb07('0x14e')]=function(_0x289df9){logger['info'](util[_0xfb07('0x2e')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x289df9[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x289df9['key'])){return this['channel'][_0xfb07('0xa9')](_0xfb07('0xe5'));}if(!this['isConfigured'](_0x289df9[_0xfb07('0x5d')])){return this['channel']['noop'](_0xfb07('0xaa'));}this[_0xfb07('0x11')][_0xfb07('0xa9')](util['format'](_0xfb07('0x14f'),_0x289df9[_0xfb07('0x5d')]));var _0x4c1200=this['ispeechTTS'][_0xfb07('0xc1')](this,_0x289df9);if(_0x4c1200){this['channel'][_0xfb07('0xa9')](util['format'](_0xfb07('0x14b'),_0x4c1200));var _0x5eb188=this[_0xfb07('0x11')]['streamFile'](_0x4c1200,_0x289df9[_0xfb07('0x131')]);try{fs[_0xfb07('0x150')](_0x4c1200+_0xfb07('0xfe'));}catch(_0x19a2d6){logger[_0xfb07('0x30')](_0x19a2d6);}return _0x5eb188;}return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x289df9,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xfb07('0x17')]['login']=function(_0x37ca2f){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x151'),_0x37ca2f[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x37ca2f[_0xfb07('0x152')])){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x37ca2f,_0xfb07('0x153'));}logger[_0xfb07('0x33')](util['format'](_0xfb07('0x154'),this['channel'][_0xfb07('0x3e')],_0x37ca2f['findBy']));var _0x3cdf9b=this[_0xfb07('0x56')][_0xfb07('0xc1')](this,_0x37ca2f[_0xfb07('0x152')]);if(_0x3cdf9b){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x155'),this['channel']['callerid'],_0x37ca2f[_0xfb07('0x152')]));this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0x155'),this[_0xfb07('0x11')][_0xfb07('0x3e')],_0x37ca2f[_0xfb07('0x152')]));return{'code':0xc8,'result':_0xfb07('0x156')};}else{logger[_0xfb07('0x33')](util[_0xfb07('0x2e')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x37ca2f[_0xfb07('0x152')]));this[_0xfb07('0x11')][_0xfb07('0xa9')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfb07('0x11')][_0xfb07('0x3e')],_0x37ca2f['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xfb07('0x17')][_0xfb07('0x157')]=function(_0x4b53d1){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x158'),_0x4b53d1[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x4b53d1[_0xfb07('0x152')])){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x4b53d1,_0xfb07('0x153'));}logger[_0xfb07('0x33')](util[_0xfb07('0x2e')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xfb07('0x11')][_0xfb07('0x3e')],_0x4b53d1[_0xfb07('0x152')]));var _0x59349e=this[_0xfb07('0x55')][_0xfb07('0xc1')](this,_0x4b53d1[_0xfb07('0x152')]);if(_0x59349e){logger['info'](util[_0xfb07('0x2e')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xfb07('0x11')][_0xfb07('0x3e')],_0x4b53d1[_0xfb07('0x152')]));this[_0xfb07('0x11')]['noop'](util[_0xfb07('0x2e')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xfb07('0x11')][_0xfb07('0x3e')],_0x4b53d1[_0xfb07('0x152')]));return{'code':0xc8,'result':_0xfb07('0x156')};}else{logger[_0xfb07('0x33')](util[_0xfb07('0x2e')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xfb07('0x3e')],_0x4b53d1['findBy']));this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfb07('0x11')][_0xfb07('0x3e')],_0x4b53d1[_0xfb07('0x152')]));return{'code':0xc8,'result':_0xfb07('0x159')};}};AGIVertices[_0xfb07('0x17')]['math']=function(_0x102f4c){logger['info'](util[_0xfb07('0x2e')](_0xfb07('0x15a'),_0x102f4c[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x102f4c[_0xfb07('0x15b')])){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x102f4c,_0xfb07('0x15c'));}this[_0xfb07('0x11')]['noop'](util['format'](_0xfb07('0x15d'),_0x102f4c['operation']));var _0x82e4fe=eval(_0x102f4c['operation']);if(!this[_0xfb07('0x82')](_0x102f4c[_0xfb07('0x10e')])){return this[_0xfb07('0x11')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x85bf54=this['getVariable'][_0xfb07('0xc1')](this,_0x102f4c[_0xfb07('0x10e')]);if(!_0x85bf54){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x102f4c,_0xfb07('0xd7'));}if(_[_0xfb07('0x9b')](_0x82e4fe)){var _0x17ace8=this;_0x82e4fe[_0xfb07('0xd8')](function(_0x2c7956,_0x25e30f){_0x17ace8['channel'][_0xfb07('0x9f')](util[_0xfb07('0x2e')](_0xfb07('0x15e'),_0x85bf54,_0x25e30f),_0x2c7956);});return this[_0xfb07('0x11')][_0xfb07('0xa9')](util['format'](_0xfb07('0x15f'),_0x85bf54));}else{return this[_0xfb07('0x11')]['setVariable'](_0x85bf54,_0x82e4fe);}};AGIVertices[_0xfb07('0x17')][_0xfb07('0xe')]=function(_0x32a9bc){logger['info'](util[_0xfb07('0x2e')](_0xfb07('0x160'),_0x32a9bc[_0xfb07('0x3b')]));if(_0x32a9bc[_0xfb07('0xa6')]===0x0){return this[_0xfb07('0xa5')](_0x32a9bc);}_0x32a9bc[_0xfb07('0xa6')]-=0x1;if(!this[_0xfb07('0x82')](_0x32a9bc[_0xfb07('0x161')])){return this[_0xfb07('0x11')]['error'](_0x32a9bc,_0xfb07('0x10c'));}var _0x41657d=this[_0xfb07('0x22')][_0xfb07('0xc1')](this,_0x32a9bc[_0xfb07('0x161')]);if(!_0x41657d){return this[_0xfb07('0x11')]['error'](_0x32a9bc,_0xfb07('0x10d'));}var _0x3e6679=this[_0xfb07('0x11')][_0xfb07('0x10f')](_0x41657d,_0x32a9bc[_0xfb07('0x110')],_0x32a9bc[_0xfb07('0x162')]);var _0x51cbe1=_0x3e6679[_0xfb07('0xa3')];if(_0x3e6679[_0xfb07('0xa3')]===-0x1){this[_0xfb07('0x3a')][_0xfb07('0xc1')](this,_0x32a9bc,'-1');return _0x3e6679;}else if(_0x3e6679['extra']===_0xfb07('0x68')){_0x3e6679['result']=_0x3e6679[_0xfb07('0xa3')][_0xfb07('0x9c')]>0x0?_0x3e6679[_0xfb07('0xa3')]:'t';}else if(_[_0xfb07('0x48')](_0x3e6679['result'])){_0x3e6679[_0xfb07('0xa3')]='#';_0x51cbe1='#';}if(!this[_0xfb07('0x82')](_0x32a9bc[_0xfb07('0x10e')])){this[_0xfb07('0x11')]['noop'](_0xfb07('0xd6'));}else{var _0x3a09d2=this[_0xfb07('0xa1')]['sync'](this,_0x32a9bc['variable_id']);if(!_0x3a09d2){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x32a9bc,_0xfb07('0xd7'));}this['channel'][_0xfb07('0x9f')](_0x3a09d2,_0x51cbe1);}this[_0xfb07('0x3a')][_0xfb07('0xc1')](this,_0x32a9bc,_0x51cbe1);return _0x3e6679;};AGIVertices[_0xfb07('0x17')][_0xfb07('0xa9')]=function(_0x218950){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x163'),_0x218950[_0xfb07('0x3b')]));return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0x218950['output']||_0x218950[_0xfb07('0x3b')]);};AGIVertices[_0xfb07('0x17')][_0xfb07('0x164')]=function(_0x1a2a78){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x165'),_0x1a2a78[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x1a2a78[_0xfb07('0x152')])){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x1a2a78,_0xfb07('0x153'));}logger[_0xfb07('0x33')](util[_0xfb07('0x2e')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x1a2a78['findBy']));var _0x19f84b=this[_0xfb07('0x166')]['sync'](this,_0x1a2a78[_0xfb07('0x167')]);var _0x22f6c4=this[_0xfb07('0x52')][_0xfb07('0xc1')](this,_0x1a2a78[_0xfb07('0x152')],_0x19f84b);if(_0x22f6c4){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x155'),this[_0xfb07('0x11')][_0xfb07('0x3e')],_0x1a2a78[_0xfb07('0x152')]));this[_0xfb07('0x11')][_0xfb07('0xa9')](util['format'](_0xfb07('0x155'),this[_0xfb07('0x11')][_0xfb07('0x3e')],_0x1a2a78[_0xfb07('0x152')]));return{'code':0xc8,'result':'success'};}else{logger[_0xfb07('0x33')](util['format'](_0xfb07('0x168'),this[_0xfb07('0x11')]['callerid'],_0x1a2a78['findBy']));this[_0xfb07('0x11')]['noop'](util[_0xfb07('0x2e')](_0xfb07('0x155'),this['channel']['callerid'],_0x1a2a78[_0xfb07('0x152')]));return{'code':0xc8,'result':_0xfb07('0x159')};}};AGIVertices[_0xfb07('0x17')][_0xfb07('0x169')]=function(_0x4950a1){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x16a'),_0x4950a1[_0xfb07('0x3b')]));if(!this['isConfigured'](_0x4950a1[_0xfb07('0x161')])){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x4950a1,_0xfb07('0x10c'));}var _0x377d82=this['getSound'][_0xfb07('0xc1')](this,_0x4950a1['file_id']);if(!_0x377d82){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x4950a1,_0xfb07('0x10d'));}var _0x175d2b=this[_0xfb07('0x11')]['exec']('PLAYBACK',[_0x377d82,_0x4950a1[_0xfb07('0x108')]]);if(_0x175d2b[_0xfb07('0xa3')]===-0x1){return _0x175d2b;}return this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')]('Executed\x20command\x20%s\x20%s',_0xfb07('0x16b'),_0x377d82));};AGIVertices[_0xfb07('0x17')][_0xfb07('0x16c')]=function(_0x59e64e){logger[_0xfb07('0x33')](util['format'](_0xfb07('0x16d'),_0x59e64e[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x59e64e[_0xfb07('0x16e')])){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x59e64e,_0xfb07('0x16f'));}var _0x3c5b72='';var _0x2027b6=parseInt(_0x59e64e[_0xfb07('0x16e')],0xa);if(isNaN(_0x2027b6)){_0x3c5b72=_0x59e64e[_0xfb07('0x16e')];}else{_0x3c5b72=this[_0xfb07('0x18')][_0xfb07('0xc1')](this,_0x59e64e[_0xfb07('0x16e')]);if(!_0x3c5b72){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x59e64e,_0xfb07('0x170'));}}var _0x3d8a81='';if(this[_0xfb07('0x82')](_0x59e64e[_0xfb07('0x161')])){var _0x31fcc9=this[_0xfb07('0x22')][_0xfb07('0xc1')](this,_0x59e64e['file_id']);if(_0x31fcc9){_0x3d8a81=_0x31fcc9;}}this['createSquareDetailsReport'][_0xfb07('0xc1')](this,_0x59e64e,_0x3c5b72);if(_0x59e64e[_0xfb07('0x108')][_0xfb07('0x171')]('x')<0x0){_0x59e64e[_0xfb07('0x108')]+='x';}if(_0x59e64e[_0xfb07('0x108')][_0xfb07('0x171')]('X')<0x0){_0x59e64e[_0xfb07('0x108')]+='X';}this[_0xfb07('0x11')][_0xfb07('0x9f')]('XMCS-QUEUE',_0x3c5b72?_0x3c5b72['toLowerCase']():'');var _0xa2a0ef=this['channel'][_0xfb07('0x58')](_0xfb07('0x172'),[_0x3c5b72,_0x59e64e[_0xfb07('0x108')],_0x59e64e[_0xfb07('0x66')],_0x3d8a81,_0x59e64e[_0xfb07('0x68')],_0x59e64e[_0xfb07('0x9')],_0x59e64e[_0xfb07('0x173')],_0x59e64e[_0xfb07('0x174')],'',_0x59e64e[_0xfb07('0x175')]]);if(_0xa2a0ef['result']===-0x1){return _0xa2a0ef;}return this['channel'][_0xfb07('0xa9')](util['format'](_0xfb07('0xc5'),_0xfb07('0x172'),_0x3c5b72));};AGIVertices[_0xfb07('0x17')]['record']=function(_0x5e55b3){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x176'),_0x5e55b3[_0xfb07('0x3b')]));var _0x5b2d8a=_0x5e55b3[_0xfb07('0x177')]||_0xfb07('0x137');var _0x47ec53=util[_0xfb07('0x2e')]('%s_%s',this['channel']['uniqueid'],rs[_0xfb07('0x115')](0x5));var _0x4ec761=util[_0xfb07('0x2e')]('%s/recordings/%s.%s',FILES_PATH,_0x47ec53,_0x5b2d8a);var _0x515ff1=util[_0xfb07('0x2e')](_0xfb07('0x12d'),FILES_PATH,_0x47ec53);this['createSquareRecording'][_0xfb07('0xc1')](this,_0x5e55b3,_0x47ec53,_0x4ec761);this[_0xfb07('0x11')][_0xfb07('0x9f')](_0xfb07('0x178'),_0x47ec53);logger[_0xfb07('0x33')](_0xfb07('0x179'),_0x515ff1,_0x5b2d8a,_0x5e55b3['escape_digits'],_0x5e55b3[_0xfb07('0x68')]);return this[_0xfb07('0x11')][_0xfb07('0x130')](_0x515ff1,_0x5b2d8a,_0x5e55b3[_0xfb07('0x17a')],_0x5e55b3['timeout'],undefined,!![]);};AGIVertices[_0xfb07('0x17')][_0xfb07('0x17b')]=function(_0x326769){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x326769[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x326769[_0xfb07('0x66')])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0x17c'));}var _0x830e80=this[_0xfb07('0x65')]['sync'](this,_0x326769);logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x17d'),util[_0xfb07('0x17e')](_0x830e80,{'showHidden':![],'depth':null})));if(!this[_0xfb07('0x82')](_0x326769[_0xfb07('0x10e')])){return this[_0xfb07('0x11')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x569a54=this[_0xfb07('0xa1')][_0xfb07('0xc1')](this,_0x326769[_0xfb07('0x10e')]);if(!_0x569a54){return this['channel'][_0xfb07('0x30')](_0x326769,_0xfb07('0xd7'));}this[_0xfb07('0x11')]['setVariable'](util[_0xfb07('0x2e')](_0xfb07('0x17f'),_0x569a54),_0x830e80[_0xfb07('0x74')]?_0x830e80[_0xfb07('0x74')]:_0xfb07('0x180'));this['channel'][_0xfb07('0x9f')](util['format']('%s_STATUS_MESSAGE',_0x569a54),_0x830e80[_0xfb07('0x75')]?_0x830e80[_0xfb07('0x75')]:'OK');if(_0x830e80[_0xfb07('0x73')]){try{this[_0xfb07('0x9d')](_0x830e80['body'],_0x569a54);}catch(_0x77dc4){logger[_0xfb07('0x30')](util[_0xfb07('0x2e')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x569a54));}}return this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0x181'),_0x569a54));};AGIVertices[_0xfb07('0x17')][_0xfb07('0x182')]=function(_0x31d340){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x183'),_0x31d340[_0xfb07('0x3b')]));return this[_0xfb07('0x11')][_0xfb07('0x184')](_0x31d340[_0xfb07('0x185')][_0xfb07('0x5a')](/\s+/g,''),_0x31d340[_0xfb07('0x17a')]);};AGIVertices[_0xfb07('0x17')][_0xfb07('0x186')]=function(_0x29539a){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x29539a[_0xfb07('0x3b')]));return this['channel'][_0xfb07('0x187')](_0x29539a['number'][_0xfb07('0x5a')](/\s+/g,''),_0x29539a[_0xfb07('0x17a')]);};AGIVertices[_0xfb07('0x17')][_0xfb07('0x188')]=function(_0x1eda46){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x189'),_0x1eda46['label']));return this['channel'][_0xfb07('0x18a')](_0x1eda46[_0xfb07('0x5d')],_0x1eda46[_0xfb07('0x17a')]);};AGIVertices[_0xfb07('0x17')][_0xfb07('0x18b')]=function(_0x2c7883){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x18c'),_0x2c7883['label']));if(!this[_0xfb07('0x82')](_0x2c7883[_0xfb07('0x18d')])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0x18e'));}var _0x82274c=this['getMailAccount']['sync'](this,_0x2c7883[_0xfb07('0x18d')]);if(!_0x82274c||!_0x82274c[_0xfb07('0x18f')]){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x2c7883,_0xfb07('0x190'));}var _0x13189b={'from':util['format']('\x22%s\x22\x20<%s>',_0x82274c[_0xfb07('0x15')],_0x82274c[_0xfb07('0x191')]||_0x82274c['Smtp']['user']),'to':_0x2c7883['to']||'','cc':_0x2c7883['cc']||'','bcc':_0x2c7883['bcc']||'','subject':_0x2c7883[_0xfb07('0x192')],'html':_0x2c7883['text'],'text':_0x2c7883[_0xfb07('0x5d')]};if(this[_0xfb07('0x82')](_0x2c7883[_0xfb07('0x193')])){}logger['debug']('sendMail\x20message',JSON[_0xfb07('0x72')](_0x13189b));this[_0xfb07('0x3a')][_0xfb07('0xc1')](this,_0x2c7883,_0x2c7883[_0xfb07('0x18d')]);this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0x194'),_0x82274c['name']));this[_0xfb07('0x28')][_0xfb07('0xc1')](this,_0x82274c[_0xfb07('0x195')],_0x13189b);return this['channel'][_0xfb07('0xa9')](_0xfb07('0x196'));};AGIVertices[_0xfb07('0x17')]['sendFax']=function(_0x275d09){logger['info'](util['format'](_0xfb07('0x197'),_0x275d09['label']));return this[_0xfb07('0x11')][_0xfb07('0xa9')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xfb07('0x17')][_0xfb07('0x198')]=function(_0x2974c4){logger['info'](util[_0xfb07('0x2e')](_0xfb07('0x199'),_0x2974c4[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x2974c4[_0xfb07('0x19a')])){return this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0x19b'));}var _0x17de96=this['getSmsAccount'][_0xfb07('0xc1')](this,_0x2974c4[_0xfb07('0x19a')]);if(!_0x17de96){return this[_0xfb07('0x11')]['error'](_0x2974c4,'no\x20sms\x20account\x20found');}var _0x1d999b={'body':_0x2974c4[_0xfb07('0x19c')],'phone':_0x2974c4['to']||'','SmsAccountId':_0x17de96['id']};logger[_0xfb07('0xdd')](_0xfb07('0x19d'),JSON[_0xfb07('0x72')](_0x1d999b));this['createSquareDetailsReport']['sync'](this,_0x2974c4,_0x2974c4[_0xfb07('0x19a')]);this['channel'][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0x19e'),_0x17de96['name']));this[_0xfb07('0x39')][_0xfb07('0xc1')](this,_0x1d999b);return this['channel'][_0xfb07('0xa9')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xfb07('0x19f')]=function(_0x4ab800){logger[_0xfb07('0x33')](util['format'](_0xfb07('0x1a0'),_0x4ab800[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x4ab800[_0xfb07('0x10e')])){return this[_0xfb07('0x11')]['error'](_0x4ab800,'no\x20variable\x20selected');}var _0x47bfa3=this['getVariable'][_0xfb07('0xc1')](this,_0x4ab800['variable_id']);if(!_0x47bfa3){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x4ab800,'no\x20variable\x20found');}return this['channel'][_0xfb07('0x9f')](_0x47bfa3,_0x4ab800[_0xfb07('0x1a1')]);};AGIVertices[_0xfb07('0x17')][_0xfb07('0x1a2')]=function(_0x3aeb20){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x1a3'),_0x3aeb20[_0xfb07('0x3b')]));this[_0xfb07('0x11')][_0xfb07('0xa9')]('START\x20CALLY\x20SQUARE');var _0x5cf866=this[_0xfb07('0x11')][_0xfb07('0xa1')](_0xfb07('0x1a4'));if(!_[_0xfb07('0x48')](_0x5cf866[_0xfb07('0xa4')])){this['channel'][_0xfb07('0x40')]=_0x5cf866['extra'];}if(_0x3aeb20[_0xfb07('0xba')]===_0xfb07('0x1a5')){this[_0xfb07('0x11')][_0xfb07('0xa9')](_0xfb07('0x1a6'));return this[_0xfb07('0x11')][_0xfb07('0xba')]();}return this[_0xfb07('0x11')][_0xfb07('0xa9')]('Skipped\x20Answer');};AGIVertices['prototype'][_0xfb07('0x1a7')]=function(_0x49f385){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x1a8'),_0x49f385[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x49f385[_0xfb07('0x1a9')])){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x49f385,'no\x20subproject\x20selected');}var _0x5cca0e=this[_0xfb07('0x1a')][_0xfb07('0xc1')](this,_0x49f385[_0xfb07('0x1a9')]);if(!this[_0xfb07('0x82')](_0x5cca0e)){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x49f385,util[_0xfb07('0x2e')](_0xfb07('0x1aa'),_0x49f385['project_id']));}if(_0x5cca0e===this[_0xfb07('0x11')][_0xfb07('0x3d')]){return this[_0xfb07('0x11')]['error'](_0x49f385,_0xfb07('0x1ab'));}this[_0xfb07('0x3a')]['sync'](this,_0x49f385,_0x5cca0e);var _0x3dda0d=this['channel'][_0xfb07('0x58')](_0xfb07('0x1ac'),util['format'](_0xfb07('0x1ad'),config[_0xfb07('0x9')][_0xfb07('0x1ae')]||'127.0.0.1',_0x5cca0e,this[_0xfb07('0x11')][_0xfb07('0x3d')]));if(_0x3dda0d['result']===-0x1){return _0x3dda0d;}return this['channel'][_0xfb07('0xa9')](util['format'](_0xfb07('0xc5'),_0xfb07('0x1ac'),_0x5cca0e));};AGIVertices[_0xfb07('0x17')][_0xfb07('0x1af')]=function(_0x2d4eba){logger['info'](util[_0xfb07('0x2e')](_0xfb07('0x1b0'),_0x2d4eba['label']));var _0x365fc5=this[_0xfb07('0x1b1')][_0xfb07('0xc1')](this,_0x2d4eba['command']);this[_0xfb07('0x3a')][_0xfb07('0xc1')](this,_0x2d4eba,_0x2d4eba[_0xfb07('0xb8')]);if(this['isConfigured'](_0x2d4eba[_0xfb07('0x10e')])){var _0x1caca6=this[_0xfb07('0xa1')][_0xfb07('0xc1')](this,_0x2d4eba[_0xfb07('0x10e')]);if(_0x1caca6){this['channel']['setVariable'](_0x1caca6,_0x365fc5);return this[_0xfb07('0x11')][_0xfb07('0xa9')](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x2d4eba[_0xfb07('0xb8')],_0x1caca6));}}return this[_0xfb07('0x11')]['noop'](util[_0xfb07('0x2e')](_0xfb07('0x1b2'),_0x2d4eba[_0xfb07('0xb8')]));};AGIVertices[_0xfb07('0x17')]['google_cloud_tts']=function(_0xd25194){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0xd25194['label']));_0xd25194[_0xfb07('0x5d')]=_0xd25194[_0xfb07('0x5d')][_0xfb07('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0xd25194[_0xfb07('0x1b3')])){return this[_0xfb07('0x11')]['noop'](_0xfb07('0x1b4'));}if(!this[_0xfb07('0x82')](_0xd25194[_0xfb07('0x5d')])){return this[_0xfb07('0x11')]['noop'](_0xfb07('0xaa'));}this['channel'][_0xfb07('0xa9')](util[_0xfb07('0x2e')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0xd25194[_0xfb07('0x5d')]));var _0x3e8edb=this[_0xfb07('0x5b')]['sync'](this,_0xd25194);if(_0x3e8edb){this[_0xfb07('0x11')]['noop'](util[_0xfb07('0x2e')](_0xfb07('0x1b5'),_0x3e8edb));var _0x2aabd8=this['channel'][_0xfb07('0x122')](_0x3e8edb);try{fs[_0xfb07('0x150')](_0x3e8edb+'.wav');}catch(_0x3d5759){logger['error'](_0x3d5759);}return _0x2aabd8;}return this[_0xfb07('0x11')][_0xfb07('0x30')](_0xd25194,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xfb07('0x17')][_0xfb07('0x1b6')]=function(_0x3dccce){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x1b7'),_0x3dccce[_0xfb07('0x3b')]));_0x3dccce['text']=_0x3dccce[_0xfb07('0x5d')][_0xfb07('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3dccce[_0xfb07('0x5d')])){return this[_0xfb07('0x11')][_0xfb07('0xa9')]('no\x20text\x20configured');}this['channel'][_0xfb07('0xa9')](util['format'](_0xfb07('0x1b8'),_0x3dccce[_0xfb07('0x5d')]));var _0x18f975=this[_0xfb07('0x63')][_0xfb07('0xc1')](this,_0x3dccce);if(_0x18f975){this['channel']['noop'](util[_0xfb07('0x2e')](_0xfb07('0x1b9'),_0x18f975));var _0x1e6260=this[_0xfb07('0x11')][_0xfb07('0x122')](_0x18f975);try{fs[_0xfb07('0x150')](_0x18f975+_0xfb07('0xfe'));}catch(_0x581621){logger['error'](_0x581621);}return _0x1e6260;}return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x3dccce,_0xfb07('0x1ba'));};AGIVertices[_0xfb07('0x17')][_0xfb07('0x1bb')]=function(_0x45387c){logger['info'](util[_0xfb07('0x2e')](_0xfb07('0x1bc'),_0x45387c[_0xfb07('0x3b')]));if(!this['isConfigured'](_0x45387c['findBy'])){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x45387c,_0xfb07('0x153'));}logger['info'](util['format'](_0xfb07('0x154'),this[_0xfb07('0x11')][_0xfb07('0x3e')],_0x45387c[_0xfb07('0x152')]));var _0x99ac9c=this['agentUnpause'][_0xfb07('0xc1')](this,_0x45387c[_0xfb07('0x152')]);if(_0x99ac9c){logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x155'),this['channel'][_0xfb07('0x3e')],_0x45387c['findBy']));this['channel'][_0xfb07('0xa9')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xfb07('0x11')][_0xfb07('0x3e')],_0x45387c[_0xfb07('0x152')]));return{'code':0xc8,'result':'success'};}else{logger[_0xfb07('0x33')](util[_0xfb07('0x2e')](_0xfb07('0x168'),this['channel'][_0xfb07('0x3e')],_0x45387c[_0xfb07('0x152')]));this[_0xfb07('0x11')][_0xfb07('0xa9')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xfb07('0x3e')],_0x45387c[_0xfb07('0x152')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xfb07('0x1bd')]=function(_0x24a5ca){logger['info'](util['format'](_0xfb07('0x1be'),_0x24a5ca[_0xfb07('0x3b')]));var _0x1dbc9d=this[_0xfb07('0x11')][_0xfb07('0x58')](_0xfb07('0x1bf'),[_0x24a5ca[_0xfb07('0x1c0')],_0x24a5ca[_0xfb07('0x77')]]);if(_0x1dbc9d['result']===-0x1){return _0x1dbc9d;}return this[_0xfb07('0x11')][_0xfb07('0xa9')](util[_0xfb07('0x2e')](_0xfb07('0xc5'),_0xfb07('0x1bf'),_0x24a5ca['mailbox']));};AGIVertices['prototype'][_0xfb07('0x1c1')]=function(_0x52137f){logger['info'](util[_0xfb07('0x2e')](_0xfb07('0x1c2'),_0x52137f[_0xfb07('0x3b')]));if(!this[_0xfb07('0x82')](_0x52137f[_0xfb07('0x10e')])){return this['channel'][_0xfb07('0x30')](_0x52137f,'no\x20variable\x20selected');}var _0x199b6d=this['getVariable']['sync'](this,_0x52137f[_0xfb07('0x10e')]);if(!_0x199b6d){return this[_0xfb07('0x11')][_0xfb07('0x30')](_0x52137f,_0xfb07('0xd7'));}var _0x2cc9ed=this[_0xfb07('0x11')]['getVariable'](_0x199b6d);return{'code':0xc8,'result':_0x2cc9ed[_0xfb07('0xa4')]?_0x2cc9ed[_0xfb07('0xa4')]:'-'};};String[_0xfb07('0x17')][_0xfb07('0x1c3')]=function(_0x507d96,_0x8a42ad){return this['split'](_0x507d96)[_0xfb07('0x1c4')](_0x8a42ad);};module[_0xfb07('0x1c5')]=AGIVertices; \ No newline at end of file +var _0x008c=['googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','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','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','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_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','getVariable','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','mrcpsynth','label','noop','no\x20text\x20configured','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','getUser','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','no\x20trunk\x20selected','trunk_id','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','maxdigit','mindigit','no\x20variable\x20found','hiddendigitsnum','hiddendigitspos','first','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','bot','Trying\x20Amazon\x20Lex:\x20%s','message','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','generate','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','appsecret','no\x20appsecret\x20configured','%s/recordings/%s','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','wav','NOBEEP','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','operation','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','agentPause','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%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','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','statusMessage','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','replace','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','getMailAccount','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','subject','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','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','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','channel','rpc','getVariableById','then','name','catch','prototype','getVoiceQueueById','getSquareProjectById','getUserById','getTrunk','getSoundById','save_name','sendMailMessage','mailRpc','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','context','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','exec'];(function(_0x193e28,_0x3dac1d){var _0x20ef59=function(_0x48047e){while(--_0x48047e){_0x193e28['push'](_0x193e28['shift']());}};_0x20ef59(++_0x3dac1d);}(_0x008c,0x188));var _0xc008=function(_0x26c7d3,_0x31be42){_0x26c7d3=_0x26c7d3-0x0;var _0x430566=_0x008c[_0x26c7d3];return _0x430566;};'use strict';var fs=require('fs');var util=require(_0xc008('0x0'));var _=require(_0xc008('0x1'));var sh=require(_0xc008('0x2'));var odbc=require(_0xc008('0x3'))();var rs=require(_0xc008('0x4'));var moment=require('moment');var Mustache=require(_0xc008('0x5'));var rp=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var scripts=require(_0xc008('0xa'));var FILES_PATH=_0xc008('0xb');var recursiveMapAttributes=[_0xc008('0xc'),_0xc008('0xd')];var verticesWithRetry=['menu',_0xc008('0xe'),'getsecretdigits'];var AGIVertices=function(_0x30be38,_0x5b64f8,_0x52041f){this[_0xc008('0xf')]=_0x30be38;this[_0xc008('0x10')]=_0x5b64f8;this['mailRpc']=_0x52041f;};AGIVertices['prototype']['getVariable']=function(_0x1eacfa,_0xc881aa){this['rpc'][_0xc008('0x11')](_0x1eacfa)[_0xc008('0x12')](function(_0x2ea200){_0xc881aa(null,_0x2ea200?_0x2ea200[_0xc008('0x13')]:![]);})[_0xc008('0x14')](function(_0x1819c6){_0xc881aa(_0x1819c6);});};AGIVertices[_0xc008('0x15')]['getVoiceQueue']=function(_0x560e28,_0x33f44c){this['rpc'][_0xc008('0x16')](_0x560e28)[_0xc008('0x12')](function(_0x2073ef){_0x33f44c(null,_0x2073ef?_0x2073ef[_0xc008('0x13')]:![]);})[_0xc008('0x14')](function(_0x5ee00b){_0x33f44c(_0x5ee00b);});};AGIVertices['prototype']['getSquareProject']=function(_0x11ef38,_0x15a6ad){this[_0xc008('0x10')][_0xc008('0x17')](_0x11ef38)['then'](function(_0x53b06e){_0x15a6ad(null,_0x53b06e?_0x53b06e['name']:![]);})['catch'](function(_0x46042b){_0x15a6ad(_0x46042b);});};AGIVertices[_0xc008('0x15')]['getSquareOdbc']=function(_0x813397,_0x5906e6){this['rpc']['getSquareOdbcById'](_0x813397)['then'](function(_0x5754a0){_0x5906e6(null,_0x5754a0?_0x5754a0['dsn']:![]);})['catch'](function(_0x590a71){_0x5906e6(_0x590a71);});};AGIVertices['prototype']['getUser']=function(_0x13a263,_0x4777a6){this[_0xc008('0x10')][_0xc008('0x18')](_0x13a263)[_0xc008('0x12')](function(_0x110128){_0x4777a6(null,_0x110128?_0x110128['name']:![]);})[_0xc008('0x14')](function(_0x5c85f2){_0x4777a6(_0x5c85f2);});};AGIVertices['prototype'][_0xc008('0x19')]=function(_0x36f358,_0x2e3cfb){this[_0xc008('0x10')]['getTrunkById'](_0x36f358)['then'](function(_0x5de1e9){_0x2e3cfb(null,_0x5de1e9?_0x5de1e9[_0xc008('0x13')]:![]);})[_0xc008('0x14')](function(_0x92c582){_0x2e3cfb(_0x92c582);});};AGIVertices[_0xc008('0x15')]['getSound']=function(_0x5e2aca,_0x4fce9c){var _0x4adbab=this;this['rpc'][_0xc008('0x1a')](_0x5e2aca)[_0xc008('0x12')](function(_0x25eae4){_0x4fce9c(null,_0x25eae4?_0x4adbab['getSoundPath'](_0x25eae4[_0xc008('0x1b')]):![]);})[_0xc008('0x14')](function(_0x209591){_0x4fce9c(_0x209591);});};AGIVertices[_0xc008('0x15')]['getMailAccount']=function(_0xcdb32b,_0x2e0b4e){this['rpc']['getMailAccountById'](_0xcdb32b)['then'](function(_0x1032b2){_0x2e0b4e(null,_0x1032b2?_0x1032b2:![]);})[_0xc008('0x14')](function(_0xf831f2){_0x2e0b4e(_0xf831f2);});};AGIVertices[_0xc008('0x15')][_0xc008('0x1c')]=function(_0xceebc3,_0x294f97,_0x22d8e8){this[_0xc008('0x1d')][_0xc008('0x1c')](_0xceebc3,_0x294f97)[_0xc008('0x12')](function(){_0x22d8e8(null);})[_0xc008('0x14')](function(_0x596ee8){_0x22d8e8(_0x596ee8);});};AGIVertices[_0xc008('0x15')][_0xc008('0x1e')]=function(_0x499754,_0xaf4b84){this[_0xc008('0x10')][_0xc008('0x1f')](_0x499754)[_0xc008('0x12')](function(_0xd0e05a){if(_0xd0e05a){if(_0xd0e05a[_0xc008('0x20')]){_0xaf4b84(null,[_0xd0e05a[_0xc008('0x21')]]);}else{_0xaf4b84(null,_[_0xc008('0x22')](_0xd0e05a[_0xc008('0x23')],'interval'));}}else{_0xaf4b84(null,![]);}})[_0xc008('0x14')](function(_0x389a40){_0xaf4b84(_0x389a40);});};AGIVertices[_0xc008('0x15')][_0xc008('0x24')]=function(_0x40002f){return util[_0xc008('0x25')](_0xc008('0x26'),FILES_PATH,_0x40002f);};AGIVertices['prototype'][_0xc008('0x27')]=function(_0x21763f,_0x50e1d4,_0x399b64){odbc[_0xc008('0x28')](_0x21763f,function(_0x5e38d5){if(_0x5e38d5){logger[_0xc008('0x29')](_0xc008('0x2a'),_0x5e38d5);_0x399b64(_0x5e38d5);}else{logger[_0xc008('0x2b')]('ODBC\x20connection\x20successfully');odbc['query'](_0x50e1d4,function(_0x478810,_0x234f2a){if(_0x478810){logger['info'](_0xc008('0x2c'),_0x50e1d4);_0x399b64(_0x478810);}else{logger[_0xc008('0x2b')](_0xc008('0x2d'),_0x50e1d4);odbc[_0xc008('0x2e')](function(_0x3148e1){if(_0x3148e1){logger[_0xc008('0x29')](_0xc008('0x2f'),_0x3148e1);}_0x399b64(null,_0x234f2a);});}});}});};AGIVertices[_0xc008('0x15')][_0xc008('0x30')]=function(_0x387dfd,_0x3ebb83){this[_0xc008('0x10')][_0xc008('0x31')](_0x387dfd)[_0xc008('0x12')](function(_0x4cace5){_0x3ebb83(null,_0x4cace5?_0x4cace5:![]);})[_0xc008('0x14')](function(_0x23c4db){_0x3ebb83(_0x23c4db);});};AGIVertices[_0xc008('0x15')][_0xc008('0x32')]=function(_0x49a16d,_0x2c4964){this[_0xc008('0x10')][_0xc008('0x32')](_0x49a16d)[_0xc008('0x12')](function(_0x2d142d){_0x2c4964(null,_0x2d142d);})['catch'](function(_0x398cdd){_0x2c4964(_0x398cdd);});};AGIVertices[_0xc008('0x15')][_0xc008('0x33')]=function(_0x3e9a99,_0x7279e8,_0x4f93a4){this[_0xc008('0x10')][_0xc008('0x33')]({'uniqueid':this[_0xc008('0xf')][_0xc008('0x34')],'node':_0x3e9a99['label'],'application':_0x3e9a99[_0xc008('0x35')],'data':_0x7279e8||null,'project_name':this[_0xc008('0xf')][_0xc008('0x36')],'callerid':this['channel'][_0xc008('0x37')]})['then'](function(_0x3dd097){if(_0x4f93a4){_0x4f93a4(null,_0x3dd097);}})['catch'](function(_0x46fa8f){if(_0x4f93a4){_0x4f93a4(_0x46fa8f);}});};AGIVertices[_0xc008('0x15')]['createSquareRecording']=function(_0x31007c,_0x24ba0f,_0x6d6d4c,_0x5caaa2){this[_0xc008('0x10')][_0xc008('0x38')]({'uniqueid':this[_0xc008('0xf')][_0xc008('0x34')],'callerid':this[_0xc008('0xf')][_0xc008('0x37')],'calleridname':this['channel']['calleridname'],'context':this['channel'][_0xc008('0x39')],'extension':this[_0xc008('0xf')][_0xc008('0x3a')],'priority':this[_0xc008('0xf')][_0xc008('0x3b')],'accountcode':this[_0xc008('0xf')][_0xc008('0x3c')],'dnid':this[_0xc008('0xf')]['dnid'],'projectName':this['channel']['arg_1'],'saveName':_0x24ba0f,'filename':_0x31007c[_0xc008('0x3d')]||_0x24ba0f,'savePath':_0x6d6d4c})[_0xc008('0x12')](function(_0x158eae){_0x5caaa2(null,_0x158eae);})['catch'](function(_0x28bc33){_0x5caaa2(_0x28bc33);});};AGIVertices[_0xc008('0x15')][_0xc008('0x3e')]=function(_0x1c2c50,_0x4981b4,_0x56e4ac,_0x17ec90,_0x405e87){this[_0xc008('0x10')][_0xc008('0x3e')]({'uniqueid':this['channel']['uniqueid'],'body':_0x1c2c50,'direction':_0x4981b4,'providerName':_0x56e4ac,'providerResponse':_0x17ec90})[_0xc008('0x12')](function(_0x51cb14){if(_0x405e87){_0x405e87(null,_0x51cb14);}})[_0xc008('0x14')](function(_0x36e6f8){if(_0x405e87){_0x405e87(_0x36e6f8);}});};AGIVertices[_0xc008('0x15')]['createCmContact']=function(_0x144ab2,_0x32b435){this[_0xc008('0x10')][_0xc008('0x3f')]({'firstName':_[_0xc008('0x40')](_0x144ab2['name'])||_[_0xc008('0x41')](_0x144ab2[_0xc008('0x13')])?'callback_'+Math[_0xc008('0x42')]():_0x144ab2[_0xc008('0x13')],'lastName':_['isEmpty'](_0x144ab2['lastName'])||_[_0xc008('0x41')](_0x144ab2[_0xc008('0x43')])?null:_0x144ab2[_0xc008('0x43')],'phone':_0x144ab2[_0xc008('0x44')],'ListId':_0x144ab2[_0xc008('0x45')],'scheduledat':_0x144ab2['scheduledAt'],'callbackUniqueid':this['channel'][_0xc008('0x34')],'tags':'callback','description':_0xc008('0x46')+_0x144ab2[_0xc008('0x47')][_0xc008('0x48')](),'priority':_0x144ab2[_0xc008('0x49')]})[_0xc008('0x12')](function(_0x27a167){_0x32b435(null,_0x27a167);})['catch'](function(_0x2ea742){_0x32b435(_0x2ea742);});};AGIVertices[_0xc008('0x15')][_0xc008('0x4a')]=function(_0x2b350c,_0x4424f5){this['rpc'][_0xc008('0x4b')](_0x2b350c)['then'](function(_0x535e6e){_0x4424f5(null,_0x535e6e?_0x535e6e['name']:![]);})[_0xc008('0x14')](function(_0x1bcbb1){_0x4424f5(_0x1bcbb1);});};AGIVertices[_0xc008('0x15')]['agentPause']=function(_0x3aeeab,_0x2d8361,_0x3dda82){var _0x47a58b={'role':_0xc008('0x4c')};_0x47a58b[_0x3aeeab]=this[_0xc008('0xf')][_0xc008('0x37')];this[_0xc008('0x10')]['agentPause'](_0x47a58b,_0x2d8361,this[_0xc008('0xf')]['uniqueid'])[_0xc008('0x12')](function(_0x422e1f){_0x3dda82(null,_[_0xc008('0x41')](_0x422e1f)?![]:!![]);})[_0xc008('0x14')](function(_0x192c87){logger[_0xc008('0x29')](_0x192c87);_0x3dda82(null,![]);});};AGIVertices['prototype'][_0xc008('0x4d')]=function(_0x570001,_0x5bf4a9){var _0x37ce5e={'role':_0xc008('0x4c')};_0x37ce5e[_0x570001]=this['channel'][_0xc008('0x37')];this[_0xc008('0x10')][_0xc008('0x4d')](_0x37ce5e)[_0xc008('0x12')](function(_0x21ee6d){_0x5bf4a9(null,_[_0xc008('0x41')](_0x21ee6d)?![]:!![]);})[_0xc008('0x14')](function(_0x57ce9a){logger[_0xc008('0x29')](_0x57ce9a);_0x5bf4a9(null,![]);});};AGIVertices[_0xc008('0x15')][_0xc008('0x4e')]=function(_0x2a60e6,_0xb3ca0f){var _0x167425={'role':_0xc008('0x4c')};_0x167425[_0x2a60e6]=this[_0xc008('0xf')][_0xc008('0x37')];this[_0xc008('0x10')][_0xc008('0x4e')](_0x167425)[_0xc008('0x12')](function(_0x131b81){_0xb3ca0f(null,_[_0xc008('0x41')](_0x131b81)?![]:!![]);})['catch'](function(_0x36a08e){logger[_0xc008('0x29')](_0x36a08e);_0xb3ca0f(null,![]);});};AGIVertices[_0xc008('0x15')]['agentLogin']=function(_0xd7d020,_0x3214df){var _0x5e76d8={'role':'agent'};_0x5e76d8[_0xd7d020]=this[_0xc008('0xf')][_0xc008('0x37')];var _0x7bad14=_0xd7d020!=_0xc008('0x4f')?util[_0xc008('0x25')](_0xc008('0x50'),_0xc008('0x51'),this[_0xc008('0xf')][_0xc008('0x37')]):undefined;this[_0xc008('0x10')][_0xc008('0x52')](_0x5e76d8,_0x7bad14)['then'](function(_0x336516){_0x3214df(null,_[_0xc008('0x41')](_0x336516)?![]:!![]);})[_0xc008('0x14')](function(_0x27dc80){logger['error'](_0x27dc80);_0x3214df(null,![]);});};AGIVertices[_0xc008('0x15')]['shellCommand']=function(_0x3a1de5,_0x46fa7b){sh[_0xc008('0x53')](_['trim'](_0x3a1de5),function(_0x1c31f5,_0x2e5e2b){var _0xa80000=_0x2e5e2b['replace'](/(\r\n|\n|\r)/gm,'');_0x46fa7b(null,_0xa80000);});};AGIVertices[_0xc008('0x15')]['googleCloudTTS']=function(_0x50ee03,_0xee7a85){scripts[_0xc008('0x54')](_0x50ee03[_0xc008('0x55')],_0x50ee03[_0xc008('0x56')]||'text',_0x50ee03[_0xc008('0x57')],_0x50ee03[_0xc008('0x58')]||'en-US',_0x50ee03[_0xc008('0x59')]||'MALE',_0x50ee03[_0xc008('0x5a')]||'MP3')[_0xc008('0x12')](function(_0x498cfb){_0xee7a85(null,_0x498cfb);})[_0xc008('0x14')](function(_0x103d75){_0xee7a85(_0x103d75);});};AGIVertices[_0xc008('0x15')][_0xc008('0x5b')]=function(_0x5a94ff,_0x57752c){scripts[_0xc008('0x5b')](_0x5a94ff[_0xc008('0x57')],_0x5a94ff[_0xc008('0x5c')]||'en',0x1)[_0xc008('0x12')](function(_0x13ef78){_0x57752c(null,_0x13ef78);})[_0xc008('0x14')](function(_0x3b46e4){_0x57752c(_0x3b46e4);});};AGIVertices['prototype'][_0xc008('0x5d')]=function(_0x530c2f,_0x511477){var _0x4c84da={'uri':_0x530c2f[_0xc008('0x5e')],'method':_0x530c2f[_0xc008('0x5f')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x530c2f[_0xc008('0x60')])===_0xc008('0x61')&&parseInt(_0x530c2f[_0xc008('0x60')])>=0x1?parseInt(_0x530c2f[_0xc008('0x60')])*0x3e8:0x5*0x3e8};if(_[_0xc008('0x62')]([_0xc008('0x63'),_0xc008('0x64')],_0x4c84da['method'][_0xc008('0x65')]())){try{_0x4c84da[_0xc008('0x66')]=_0x530c2f[_0xc008('0xd')]?JSON[_0xc008('0x67')](_0x530c2f[_0xc008('0xd')]):{};}catch(_0x3b2669){logger[_0xc008('0x29')](_0xc008('0x68'),_0x3b2669);}}try{_0x4c84da[_0xc008('0x69')]=_0x530c2f[_0xc008('0xc')]?JSON[_0xc008('0x67')](_0x530c2f[_0xc008('0xc')]):{};}catch(_0x582814){logger['error'](_0xc008('0x6a'),_0x582814);}if(_0x530c2f[_0xc008('0x6b')]){try{var _0x41e92e=require(_0x530c2f['computedVariables'])[_0xc008('0x6c')](this,_0x4c84da);_0x4c84da[_0xc008('0x6d')]=Mustache['render'](_0x530c2f['url'],_0x41e92e,{},['$$','$$']);if(_0x4c84da['headers']){_0x4c84da[_0xc008('0x69')]=JSON[_0xc008('0x67')](Mustache[_0xc008('0x6e')](JSON[_0xc008('0x6f')](_0x4c84da[_0xc008('0x69')]),_0x41e92e,{},['$$','$$']));}if(_0x4c84da[_0xc008('0x66')]){_0x4c84da[_0xc008('0x66')]=JSON[_0xc008('0x67')](Mustache[_0xc008('0x6e')](JSON[_0xc008('0x6f')](_0x4c84da['body']),_0x41e92e,{},['$$','$$']));}}catch(_0x57b8ad){logger[_0xc008('0x29')](_0xc008('0x70'),_0x57b8ad);}}rp(_0x4c84da)[_0xc008('0x12')](function(_0x3f1e41){var _0x2b94b2={'statusCode':_0x3f1e41[_0xc008('0x71')]||0xc8,'statusMessage':_0x3f1e41['statusMessage']||'OK','headers':_0x3f1e41['headers']||{},'body':_0x3f1e41[_0xc008('0x66')]||{}};_0x511477(null,_0x2b94b2);})[_0xc008('0x14')](function(_0x33e130){var _0x558105={'statusCode':_0x33e130['statusCode']||0x1f4,'statusMessage':_0x33e130['message']||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x33e130['options']['headers']||{},'body':_0x33e130[_0xc008('0x72')]['body']||{}};_0x511477(null,_0x558105);});};AGIVertices[_0xc008('0x15')]['googleDialogflow']=function(_0x2772c9,_0x41151e){scripts[_0xc008('0x73')](this['channel']['uniqueid'],_0x2772c9[_0xc008('0x74')],_0x2772c9['text'],_0x2772c9[_0xc008('0x75')]||'en')[_0xc008('0x12')](function(_0x544519){_0x41151e(null,_0x544519);})[_0xc008('0x14')](function(_0x4db90b){_0x41151e(_0x4db90b);});};AGIVertices['prototype'][_0xc008('0x76')]=function(_0x1d50ac,_0x48de26){scripts[_0xc008('0x76')](this[_0xc008('0xf')][_0xc008('0x34')],_0x1d50ac['dialogflowV2_project_id'],_0x1d50ac[_0xc008('0x77')],_0x1d50ac[_0xc008('0x78')],_0x1d50ac[_0xc008('0x57')],_0x1d50ac[_0xc008('0x79')]||'en')[_0xc008('0x12')](function(_0x1b5b91){_0x48de26(null,_0x1b5b91);})['catch'](function(_0x6dfd99){_0x48de26(_0x6dfd99);});};AGIVertices[_0xc008('0x15')][_0xc008('0x7a')]=function(_0x4946d3,_0x477b14){scripts[_0xc008('0x7a')](this[_0xc008('0xf')],_0x4946d3)['then'](function(_0x48c38b){_0x477b14(null,_0x48c38b);})['catch'](function(_0x46cf1c){_0x477b14(_0x46cf1c);});};AGIVertices[_0xc008('0x15')][_0xc008('0x7b')]=function(_0x3c5da1,_0x1c90d7){scripts[_0xc008('0x7b')](_0x3c5da1[_0xc008('0x74')],_0x3c5da1[_0xc008('0x57')],_0x3c5da1['ispeech_tts_language']||_0xc008('0x7c'),_0x3c5da1[_0xc008('0x7d')])['then'](function(_0x58949b){_0x1c90d7(null,_0x58949b);})[_0xc008('0x14')](function(_0x128123){_0x1c90d7(_0x128123);});};AGIVertices[_0xc008('0x15')][_0xc008('0x7e')]=function(_0x11d33e,_0x49e822,_0xe988da){scripts[_0xc008('0x7e')](_0x49e822,_0x11d33e['key'],_0x11d33e[_0xc008('0x7f')]||_0xc008('0x7c'),this[_0xc008('0x80')](_0x11d33e[_0xc008('0x81')])?_0x11d33e['model']:undefined)[_0xc008('0x12')](function(_0x2d42e0){_0xe988da(null,_0x2d42e0);})[_0xc008('0x14')](function(_0x3004f9){_0xe988da(_0x3004f9);});};AGIVertices['prototype'][_0xc008('0x82')]=function(_0x1d4cdc,_0x57cf19){scripts['awsPolly'](_0x1d4cdc[_0xc008('0x83')],_0x1d4cdc['aws_secret_access_key'],_0x1d4cdc[_0xc008('0x84')],_0x1d4cdc[_0xc008('0x85')]||'Amy',_0x1d4cdc[_0xc008('0x57')],_0x1d4cdc[_0xc008('0x86')]||_0xc008('0x57'))[_0xc008('0x12')](function(_0x3c335f){_0x57cf19(null,_0x3c335f);})[_0xc008('0x14')](function(_0x56fa88){_0x57cf19(_0x56fa88);});};AGIVertices[_0xc008('0x15')][_0xc008('0x87')]=function(_0x2fcad1,_0x59e7eb){scripts['awsLex'](this[_0xc008('0xf')][_0xc008('0x34')],_0x2fcad1['aws_access_key_id'],_0x2fcad1[_0xc008('0x88')],_0x2fcad1[_0xc008('0x89')],_0x2fcad1[_0xc008('0x57')],_0x2fcad1['aws_bot_name'])[_0xc008('0x12')](function(_0x38239a){_0x59e7eb(null,_0x38239a);})[_0xc008('0x14')](function(_0x3eeebd){_0x59e7eb(_0x3eeebd);});};AGIVertices[_0xc008('0x15')][_0xc008('0x8a')]=function(_0x3c9518,_0x5bd010,_0x1530d6){scripts['googleASR'](_0x5bd010,_0x3c9518[_0xc008('0x74')],_0x3c9518[_0xc008('0x8b')]||_0xc008('0x7c'))['then'](function(_0x752b50){_0x1530d6(null,_0x752b50);})[_0xc008('0x14')](function(_0x41143f){_0x1530d6(_0x41143f);});};AGIVertices[_0xc008('0x15')][_0xc008('0x8c')]=function(_0x729d48,_0x872247,_0x287492){scripts[_0xc008('0x8c')](_0x872247,_0x729d48[_0xc008('0x8d')],_0x729d48['appsecret'],_0x729d48[_0xc008('0x6d')])[_0xc008('0x12')](function(_0x15dca4){_0x287492(null,_0x15dca4);})[_0xc008('0x14')](function(_0x43dc6c){_0x287492(_0x43dc6c);});};AGIVertices['prototype'][_0xc008('0x8e')]=function(_0x3dd13f){var _0x36a581=_[_0xc008('0x62')](verticesWithRetry,_0x3dd13f[_0xc008('0x35')])?_0x3dd13f:_[_0xc008('0x8f')](_0x3dd13f);for(var _0x3c3067 in _0x36a581){if(_0x36a581[_0xc008('0x90')](_0x3c3067)){if(_0x36a581[_0x3c3067]&&_[_0xc008('0x91')](_0x36a581[_0x3c3067])){if(_[_0xc008('0x62')](recursiveMapAttributes,_0x3c3067)){_0x36a581[_0x3c3067]=this[_0xc008('0x92')](_0x36a581[_0x3c3067]);}else{_0x36a581[_0x3c3067]=this[_0xc008('0x93')](_0x36a581[_0x3c3067]);}}}}return _0x36a581;};AGIVertices[_0xc008('0x15')][_0xc008('0x94')]=function(_0x16bcc5){for(var _0x5ca2fb in _0x16bcc5){if(_0x16bcc5['hasOwnProperty'](_0x5ca2fb)){if(_[_0xc008('0x95')](_0x16bcc5[_0x5ca2fb])){this[_0xc008('0x94')](_0x16bcc5[_0x5ca2fb]);}else if(_[_0xc008('0x96')](_0x16bcc5[_0x5ca2fb])){for(var _0xfd1b6f=0x0;_0xfd1b6f<_0x16bcc5[_0x5ca2fb][_0xc008('0x97')];_0xfd1b6f++){this[_0xc008('0x94')](_0x16bcc5[_0x5ca2fb][_0xfd1b6f]);}}else if(_[_0xc008('0x91')](_0x16bcc5[_0x5ca2fb])){_0x16bcc5[_0x5ca2fb]=this[_0xc008('0x93')](_0x16bcc5[_0x5ca2fb]);}}}};AGIVertices[_0xc008('0x15')]['saveRestApiResult']=function(_0x9e53af,_0x2bbadf){for(var _0x54fd75 in _0x9e53af){if(_0x9e53af[_0xc008('0x90')](_0x54fd75)){if(_[_0xc008('0x95')](_0x9e53af[_0x54fd75])){if(!_[_0xc008('0x40')](_0x9e53af[_0x54fd75])){this[_0xc008('0x98')](_0x9e53af[_0x54fd75],util[_0xc008('0x25')](_0xc008('0x99'),_0x2bbadf,_0x54fd75));}}else if(_['isArray'](_0x9e53af[_0x54fd75])){for(var _0x26617c=0x0;_0x26617c<_0x9e53af[_0x54fd75][_0xc008('0x97')];_0x26617c++){this[_0xc008('0x98')](_0x9e53af[_0x54fd75][_0x26617c],util[_0xc008('0x25')]('%s.%s',_0x2bbadf,_0x54fd75+'['+_0x26617c+']'));}}else{if(!_[_0xc008('0x41')](_0x9e53af[_0x54fd75])){this['channel'][_0xc008('0x9a')](util[_0xc008('0x25')]('%s.%s',_0x2bbadf,_0x54fd75),_0x9e53af[_0x54fd75]);}}}}};AGIVertices[_0xc008('0x15')]['replaceObjectAllVariables']=function(_0xc35f69){try{var _0x4cb7d7=JSON['parse'](_0xc35f69);this['recursiveNodeIndex'](_0x4cb7d7);return JSON[_0xc008('0x6f')](_0x4cb7d7);}catch(_0x402b67){return this['replaceAllVariables'](_0xc35f69);}};AGIVertices[_0xc008('0x15')][_0xc008('0x93')]=function(_0x4a7692){var _0x40dbd2=_0x4a7692[_0xc008('0x9b')]('{');for(var _0x1564a9=0x1;_0x1564a9<_0x40dbd2['length'];_0x1564a9+=0x1){var _0x33cad3=_0x40dbd2[_0x1564a9][_0xc008('0x9b')]('}');if(_0x33cad3[_0xc008('0x97')]>0x1){_0x4a7692=_0x4a7692[_0xc008('0x9c')]('{'+_0x33cad3[0x0]+'}',this[_0xc008('0xf')][_0xc008('0x9d')](_0x33cad3[0x0])[_0xc008('0x9e')]||_0x33cad3[0x0]);}}if(_0x40dbd2[_0xc008('0x97')]===0x1){return _0x4a7692[_0xc008('0x48')]();}return this[_0xc008('0x93')](_0x4a7692);};AGIVertices[_0xc008('0x15')]['getAndSetVariable']=function(_0x35c753,_0x138ce1){var _0x14c6c2=this['channel'][_0xc008('0x9d')](_0x35c753);if(_0x14c6c2[_0xc008('0x9f')]===-0x1){return _0x14c6c2;}logger[_0xc008('0x2b')](util['format'](_0xc008('0xa0'),_0x138ce1,_0x14c6c2['extra']));return this[_0xc008('0xf')][_0xc008('0x9a')](_0x138ce1,_0x14c6c2[_0xc008('0x9e')]);};AGIVertices['prototype'][_0xc008('0x80')]=function(_0x11cbc7){return _0x11cbc7&&_0x11cbc7!=='0'&&_0x11cbc7!=='-1'&&_0x11cbc7!=='';};AGIVertices[_0xc008('0x15')][_0xc008('0xa1')]=function(_0x3ccb7b){this[_0xc008('0x33')][_0xc008('0x6c')](this,_0x3ccb7b,'-');_0x3ccb7b['retry']=_0x3ccb7b[_0xc008('0xa1')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xc008('0x15')][_0xc008('0xa2')]=function(_0x39d1fd){logger['info'](util[_0xc008('0x25')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x39d1fd[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x39d1fd[_0xc008('0x57')])){return this[_0xc008('0xf')][_0xc008('0xa4')](_0xc008('0xa5'));}var _0x45b3ab='\x22'+_0x39d1fd['text']+'\x22';if(this[_0xc008('0x80')](_0x39d1fd[_0xc008('0x72')])){_0x45b3ab+=','+_0x39d1fd[_0xc008('0x72')];}var _0x3e5a69=this['channel'][_0xc008('0x53')]('MRCPSynth',_0x45b3ab);if(_0x3e5a69[_0xc008('0x9f')]===-0x1){return _0x3e5a69;}return this[_0xc008('0xf')][_0xc008('0xa4')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x45b3ab));};AGIVertices[_0xc008('0x15')]['mrcprecog']=function(_0x4016fc){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0xa6'),_0x4016fc['label']));if(!this[_0xc008('0x80')](_0x4016fc[_0xc008('0xa7')])){return this['channel']['noop'](_0xc008('0xa8'));}var _0x1edf41=_0x4016fc['grammar'];if(this[_0xc008('0x80')](_0x4016fc[_0xc008('0x72')])){_0x1edf41+=','+_0x4016fc[_0xc008('0x72')];}var _0x3d571=this['channel'][_0xc008('0x53')](_0xc008('0xa9'),_0x1edf41);if(_0x3d571[_0xc008('0x9f')]===-0x1){return _0x3d571;}var _0x1337a0=this[_0xc008('0xaa')](_0xc008('0xab'),_0xc008('0xac'));if(_0x1337a0[_0xc008('0x9f')]===-0x1){return _0x1337a0;}var _0x2f0e45=this[_0xc008('0xaa')](_0xc008('0xad'),_0xc008('0xae'));if(_0x2f0e45[_0xc008('0x9f')]===-0x1){return _0x2f0e45;}var _0x555825=this['getAndSetVariable'](_0xc008('0xaf'),_0xc008('0xb0'));if(_0x555825[_0xc008('0x9f')]===-0x1){return _0x555825;}return this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0xb1'),_0x1edf41));};AGIVertices['prototype']['agi']=function(_0x44415c){logger[_0xc008('0x2b')](util[_0xc008('0x25')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x44415c[_0xc008('0xa3')]));return this[_0xc008('0xf')][_0xc008('0x8')]([_0x44415c[_0xc008('0xb2')],_0x44415c[_0xc008('0xb3')]]);};AGIVertices[_0xc008('0x15')][_0xc008('0xb4')]=function(_0x39e8e3){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0xb5'),_0x39e8e3[_0xc008('0xa3')]));if(this['isConfigured'](_0x39e8e3['timeout'])){logger[_0xc008('0x2b')](util[_0xc008('0x25')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x39e8e3[_0xc008('0x60')]));var _0x1d44fa=this[_0xc008('0xf')][_0xc008('0xb6')](_0x39e8e3[_0xc008('0x60')]);if(_0x1d44fa[_0xc008('0x9f')]===-0x1){return _0x1d44fa;}}return this[_0xc008('0xf')][_0xc008('0xb4')]();};AGIVertices[_0xc008('0x15')]['callback']=function(_0x51b305){logger['info'](util[_0xc008('0x25')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x51b305[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x51b305[_0xc008('0x45')])){return this[_0xc008('0xf')][_0xc008('0x29')](_0x51b305,_0xc008('0xb7'));}_0x51b305[_0xc008('0x47')]=moment();if(this[_0xc008('0x80')](_0x51b305[_0xc008('0xb8')])){_0x51b305[_0xc008('0x47')]=moment()[_0xc008('0xb9')](_0x51b305[_0xc008('0xb8')],_0xc008('0xba'));}if(!this[_0xc008('0x80')](_0x51b305[_0xc008('0x49')])){_0x51b305[_0xc008('0x49')]=0x2;}this[_0xc008('0x3f')]['sync'](this,_0x51b305);return this[_0xc008('0xf')]['noop'](util[_0xc008('0x25')](_0xc008('0xbb'),_0x51b305[_0xc008('0x44')],_0x51b305['list_id'],_0x51b305[_0xc008('0x47')]));};AGIVertices[_0xc008('0x15')][_0xc008('0xbc')]=function(_0x2f9cc){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0xbd'),_0x2f9cc['label']));var _0x1cad4b=this[_0xc008('0xf')][_0xc008('0x53')](_0x2f9cc[_0xc008('0xbe')],_0x2f9cc['options']);if(_0x1cad4b['result']===-0x1){return _0x1cad4b;}return this['channel']['noop'](util[_0xc008('0x25')](_0xc008('0xbf'),_0x2f9cc[_0xc008('0xbe')],_0x2f9cc[_0xc008('0x72')]));};AGIVertices['prototype'][_0xc008('0xc0')]=function(_0x13fcee){logger[_0xc008('0x2b')](util['format'](_0xc008('0xc1'),_0x13fcee['label']));if(!this[_0xc008('0x80')](_0x13fcee['text'])){return this[_0xc008('0xf')][_0xc008('0xa4')](_0xc008('0xa5'));}var _0x1a5cc7='\x22'+_0x13fcee['text']+'\x22';if(this[_0xc008('0x80')](_0x13fcee[_0xc008('0x72')])){_0x1a5cc7+=','+_0x13fcee[_0xc008('0x72')];}var _0xa67842=this[_0xc008('0xf')][_0xc008('0x53')](_0xc008('0xc2'),_0x1a5cc7);if(_0xa67842['result']===-0x1){return _0xa67842;}return this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1a5cc7));};AGIVertices['prototype'][_0xc008('0xc3')]=function(_0x36a4b6){logger[_0xc008('0x2b')](util[_0xc008('0x25')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x36a4b6[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x36a4b6['text'])){return this['channel']['noop'](_0xc008('0xa5'));}var _0x573b21='\x22'+_0x36a4b6[_0xc008('0x57')]+'\x22';if(this['isConfigured'](_0x36a4b6[_0xc008('0x72')])){_0x573b21+=','+_0x36a4b6[_0xc008('0x72')];}var _0x32c62a=this[_0xc008('0xf')]['exec']('MRCPSynth',_0x573b21);if(_0x32c62a[_0xc008('0x9f')]===-0x1){return _0x32c62a;}return this[_0xc008('0xf')][_0xc008('0xa4')](util['format'](_0xc008('0xc4'),_0x573b21));};AGIVertices[_0xc008('0x15')][_0xc008('0xc5')]=function(_0x272d98){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0xc6'),_0x272d98[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x272d98[_0xc008('0xa7')])){return this[_0xc008('0xf')]['noop']('no\x20grammar\x20configured');}var _0x2f8ef9=_0x272d98['grammar'];if(this[_0xc008('0x80')](_0x272d98[_0xc008('0x72')])){_0x2f8ef9+=','+_0x272d98['options'];}var _0x487c0d=this[_0xc008('0xf')][_0xc008('0x53')](_0xc008('0xa9'),_0x2f8ef9);if(_0x487c0d[_0xc008('0x9f')]===-0x1){return _0x487c0d;}var _0x3e0b78=this[_0xc008('0xaa')]('RECOG_CONFIDENCE()',_0xc008('0xc7'));if(_0x3e0b78[_0xc008('0x9f')]===-0x1){return _0x3e0b78;}var _0x62e889=this['getAndSetVariable'](_0xc008('0xad'),_0xc008('0xc8'));if(_0x62e889[_0xc008('0x9f')]===-0x1){return _0x62e889;}var _0x42bbae=this['getAndSetVariable']('RECOG_INSTANCE()',_0xc008('0xc9'));if(_0x42bbae['result']===-0x1){return _0x42bbae;}return this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0xb1'),_0x2f8ef9));};AGIVertices[_0xc008('0x15')]['sestekasr']=function(_0x4da1dc){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0xca'),_0x4da1dc[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x4da1dc[_0xc008('0xa7')])){return this[_0xc008('0xf')]['noop'](_0xc008('0xa8'));}var _0x283639=_0x4da1dc[_0xc008('0xa7')];if(this[_0xc008('0x80')](_0x4da1dc[_0xc008('0x72')])){_0x283639+=','+_0x4da1dc[_0xc008('0x72')];}var _0x3af9d0=this[_0xc008('0xf')][_0xc008('0x53')](_0xc008('0xa9'),_0x283639);if(_0x3af9d0[_0xc008('0x9f')]===-0x1){return _0x3af9d0;}var _0x328284=this['getAndSetVariable'](_0xc008('0xab'),_0xc008('0xcb'));if(_0x328284['result']===-0x1){return _0x328284;}var _0x40cb66=this[_0xc008('0xaa')](_0xc008('0xad'),_0xc008('0xcc'));if(_0x40cb66[_0xc008('0x9f')]===-0x1){return _0x40cb66;}var _0xf871fe=this[_0xc008('0xaa')](_0xc008('0xaf'),_0xc008('0xcd'));if(_0xf871fe[_0xc008('0x9f')]===-0x1){return _0xf871fe;}return this[_0xc008('0xf')]['noop'](util[_0xc008('0x25')](_0xc008('0xb1'),_0x283639));};AGIVertices[_0xc008('0x15')][_0xc008('0xce')]=function(_0x33c990){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0xcf'),_0x33c990[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x33c990[_0xc008('0xd0')])){return this[_0xc008('0xf')][_0xc008('0x29')](_0x33c990,_0xc008('0xd1'));}var _0x26b5c8=this[_0xc008('0xd2')]['sync'](this,_0x33c990['odbc_id']);if(!_0x26b5c8){return this['channel'][_0xc008('0x29')](_0x33c990,_0xc008('0xd3'));}if(!this[_0xc008('0x80')](_0x33c990[_0xc008('0xd4')])){return this[_0xc008('0xf')][_0xc008('0x29')](_0x33c990,_0xc008('0xd5'));}var _0x47bc33=_0x33c990[_0xc008('0xd4')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xc008('0xa4')](util[_0xc008('0x25')]('query:\x20%s',_0x47bc33));var _0x43521e=this[_0xc008('0x27')][_0xc008('0x6c')](this,_0x26b5c8,_0x47bc33);this['createSquareDetailsReport'][_0xc008('0x6c')](this,_0x33c990,_0x47bc33);if(!this[_0xc008('0x80')](_0x33c990[_0xc008('0xd6')])){return this['channel'][_0xc008('0xa4')](_0xc008('0xd7'));}var _0x3b1ab3=this[_0xc008('0x9d')][_0xc008('0x6c')](this,_0x33c990[_0xc008('0xd6')]);if(!_0x3b1ab3){return this[_0xc008('0xf')][_0xc008('0x29')](_0x33c990,'no\x20variable\x20found');}var _0x46eda5=this;_0x43521e[_0xc008('0xd8')](function(_0x2bcebe,_0x1b5f8c){Object[_0xc008('0xd9')](_0x2bcebe)['forEach'](function(_0xb04a1c){_0x46eda5[_0xc008('0xf')][_0xc008('0x9a')](util[_0xc008('0x25')](_0xc008('0xda'),_0x3b1ab3,_0x1b5f8c,_0xb04a1c),_0x2bcebe[_0xb04a1c]);});});this[_0xc008('0xf')][_0xc008('0x9a')](util[_0xc008('0x25')]('%s_ROWS_COUNT',_0x3b1ab3),_0x43521e[_0xc008('0x97')]);return this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')]('variable\x20%s\x20set',_0x3b1ab3));};AGIVertices['prototype'][_0xc008('0xdb')]=function(_0xbff325){logger['debug'](util[_0xc008('0x25')](_0xc008('0xdc'),_0xbff325[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0xbff325[_0xc008('0xdd')])){return this[_0xc008('0xf')][_0xc008('0x29')](_0xbff325,'no\x20user\x20selected');}var _0x56316d=this[_0xc008('0xde')]['sync'](this,_0xbff325[_0xc008('0xdd')]);if(!_0x56316d){return this[_0xc008('0xf')][_0xc008('0x29')](_0xbff325,_0xc008('0xdf'));}var _0x2ea1db=this[_0xc008('0xf')][_0xc008('0x53')](_0xc008('0xe0'),[util[_0xc008('0x25')](_0xc008('0xe1'),_0x56316d),_0xbff325[_0xc008('0x60')],_0xbff325['opts'],_0xbff325[_0xc008('0x5e')]]);if(_0x2ea1db[_0xc008('0x9f')]===-0x1){return _0x2ea1db;}return this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0xe2'),_0xc008('0xe0')));};AGIVertices['prototype'][_0xc008('0xe3')]=function(_0x36c97d){logger[_0xc008('0x2b')](util['format'](_0xc008('0xe4'),_0x36c97d[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x36c97d[_0xc008('0x74')])){return this[_0xc008('0xf')][_0xc008('0xa4')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x36c97d[_0xc008('0x57')])){return this[_0xc008('0xf')][_0xc008('0xa4')](_0xc008('0xa5'));}this[_0xc008('0xf')]['bot']=!![];this[_0xc008('0x33')](_0x36c97d);this['createSquareMessage'](_0x36c97d[_0xc008('0x57')],'in','','');this[_0xc008('0xf')]['noop'](util[_0xc008('0x25')](_0xc008('0xe5'),_0x36c97d[_0xc008('0x57')]));var _0x3d0882=this['googleDialogflow'][_0xc008('0x6c')](this,_0x36c97d);if(_0x3d0882){for(var _0x2d5590 in _0x3d0882){if(_0x3d0882[_0xc008('0x90')](_0x2d5590)){this[_0xc008('0xf')][_0xc008('0x9a')](util['format'](_0xc008('0xe6'),_0x2d5590[_0xc008('0x65')]()),_0x3d0882[_0x2d5590]);}}this[_0xc008('0x3e')](_0x3d0882['speech'],_0xc008('0xe7'),_0xc008('0xe3'),'');return this[_0xc008('0xf')][_0xc008('0xa4')](util['format'](_0xc008('0xe8'),_0x3d0882[_0xc008('0xe9')]));}return this[_0xc008('0xf')][_0xc008('0x29')](_0x36c97d,_0xc008('0xea'));};AGIVertices['prototype'][_0xc008('0xeb')]=function(_0x541892){logger['info'](util[_0xc008('0x25')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x541892[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x541892[_0xc008('0xec')])){return this[_0xc008('0xf')][_0xc008('0xa4')](_0xc008('0xed'));}if(!this[_0xc008('0x80')](_0x541892['client_email'])){return this[_0xc008('0xf')][_0xc008('0xa4')](_0xc008('0xee'));}if(!this[_0xc008('0x80')](_0x541892[_0xc008('0x78')])){return this[_0xc008('0xf')]['noop'](_0xc008('0xef'));}if(!this[_0xc008('0x80')](_0x541892[_0xc008('0x79')])){return this[_0xc008('0xf')][_0xc008('0xa4')](_0xc008('0xf0'));}if(!this[_0xc008('0x80')](_0x541892[_0xc008('0x57')])){return this['channel']['noop'](_0xc008('0xa5'));}this[_0xc008('0xf')]['bot']=!![];this[_0xc008('0x33')](_0x541892);this['createSquareMessage'](_0x541892[_0xc008('0x57')],'in','','');this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0xf1'),_0x541892[_0xc008('0x57')]));var _0x1bd857=this['googleDialogflowV2'][_0xc008('0x6c')](this,_0x541892);if(_0x1bd857){for(var _0x54f526 in _0x1bd857){if(_0x1bd857[_0xc008('0x90')](_0x54f526)){if(_0x54f526!==_0xc008('0xf2')){this[_0xc008('0xf')][_0xc008('0x9a')](util[_0xc008('0x25')](_0xc008('0xe6'),_0x54f526[_0xc008('0x65')]()),_0x1bd857[_0x54f526]);}}}this['createSquareMessage'](_0x1bd857[_0xc008('0xe9')],_0xc008('0xe7'),'dialogflowV2',_0x1bd857[_0xc008('0xf2')]);return this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0xf3'),_0x1bd857[_0xc008('0xe9')]));}return this['channel'][_0xc008('0x29')](_0x541892,_0xc008('0xf4'));};AGIVertices[_0xc008('0x15')][_0xc008('0xf5')]=function(_0x47d263){logger['info'](util['format'](_0xc008('0xf6'),_0x47d263[_0xc008('0xa3')]));if(!this['isConfigured'](_0x47d263['ndauth_url'])){return this['channel']['noop'](_0xc008('0xf7'));}if(!this[_0xc008('0x80')](_0x47d263['username'])){return this[_0xc008('0xf')][_0xc008('0xa4')](_0xc008('0xf8'));}if(!this[_0xc008('0x80')](_0x47d263[_0xc008('0xf9')])){return this['channel']['noop'](_0xc008('0xfa'));}if(!this[_0xc008('0x80')](_0x47d263[_0xc008('0xfb')])){return this[_0xc008('0xf')][_0xc008('0xa4')](_0xc008('0xa5'));}this[_0xc008('0xf')]['bot']=!![];this[_0xc008('0x33')](_0x47d263);this[_0xc008('0x3e')](_0x47d263[_0xc008('0x57')],'in','','');this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0xfc'),_0x47d263['text']));var _0x583226=this[_0xc008('0x7a')][_0xc008('0x6c')](this,_0x47d263);if(_0x583226){for(var _0x11bcba in _0x583226){if(_0x583226[_0xc008('0x90')](_0x11bcba)){this[_0xc008('0xf')][_0xc008('0x9a')](util[_0xc008('0x25')](_0xc008('0xfd'),_0x11bcba[_0xc008('0x65')]()),_0x583226[_0x11bcba]);}}this[_0xc008('0x3e')](_0x583226[_0xc008('0xe9')],_0xc008('0xe7'),_0xc008('0xf5'),'');if(_0x583226['audiofile']){this['channel'][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0xfe'),_0x583226[_0xc008('0xff')]));var _0x25c7dd=this[_0xc008('0xf')][_0xc008('0x100')](_0x583226['audiofile']);try{fs['unlink'](_0x583226['audiofile']+_0xc008('0x101'));}catch(_0x4b7132){logger['error'](_0x4b7132);}return _0x25c7dd;}else{return this['channel'][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x102'),_0x583226[_0xc008('0xe9')]));}}return this[_0xc008('0xf')][_0xc008('0x29')](_0x47d263,_0xc008('0x103'));};AGIVertices[_0xc008('0x15')][_0xc008('0x104')]=function(_0xdcda1f){logger[_0xc008('0x2b')](util[_0xc008('0x25')]('Enter\x20in\x20END\x20(%s)\x20block',_0xdcda1f['label']));return this[_0xc008('0xf')][_0xc008('0xa4')](_0xc008('0x104'));};AGIVertices[_0xc008('0x15')][_0xc008('0x105')]=function(_0x12a200){logger[_0xc008('0x2b')](util[_0xc008('0x25')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x12a200[_0xc008('0xa3')]));var _0x532c62='';if(_0x12a200['trunk_id']){if(!this['isConfigured'](_0x12a200['trunk_id'])){return this[_0xc008('0xf')]['error'](_0x12a200,_0xc008('0x106'));}else{var _0x38efaa=parseInt(_0x12a200[_0xc008('0x107')],0xa);if(isNaN(_0x38efaa)){_0x532c62=_0x12a200['trunk_id'];}else{_0x532c62=this['getTrunk'][_0xc008('0x6c')](this,_0x12a200[_0xc008('0x107')]);if(!_0x532c62){return this['channel'][_0xc008('0x29')](_0x12a200,_0xc008('0x108'));}}}}else if(_0x12a200[_0xc008('0x109')]){_0x532c62=_0x12a200[_0xc008('0x109')];}else{return this[_0xc008('0xf')][_0xc008('0x29')](_0x12a200,_0xc008('0x106'));}var _0x300a07=this[_0xc008('0xf')][_0xc008('0x53')]('DIAL',[util[_0xc008('0x25')](_0xc008('0x10a'),_0x532c62,_0x12a200['phone']),_0x12a200['timeout'],_0x12a200[_0xc008('0x10b')],_0x12a200[_0xc008('0x5e')]]);if(_0x300a07[_0xc008('0x9f')]===-0x1){return _0x300a07;}return this['channel']['noop'](util['format']('Executed\x20command\x20%s',_0xc008('0xe0')));};AGIVertices[_0xc008('0x15')][_0xc008('0x10c')]=function(_0x347b74){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x10d'),_0x347b74['label']));return this[_0xc008('0xf')][_0xc008('0xa4')](_0xc008('0x10c'));};AGIVertices[_0xc008('0x15')][_0xc008('0xe')]=function(_0x5104ec){logger[_0xc008('0x2b')](util[_0xc008('0x25')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x5104ec[_0xc008('0xa3')]));if(_0x5104ec[_0xc008('0x10e')]===0x0){return this[_0xc008('0xa1')](_0x5104ec);}_0x5104ec[_0xc008('0x10e')]-=0x1;if(!this['isConfigured'](_0x5104ec[_0xc008('0x10f')])){return this['channel'][_0xc008('0x29')](_0x5104ec,_0xc008('0x110'));}var _0x27cc7e=this[_0xc008('0x111')][_0xc008('0x6c')](this,_0x5104ec['file_id']);if(!_0x27cc7e){return this[_0xc008('0xf')][_0xc008('0x29')](_0x5104ec,_0xc008('0x112'));}if(!this[_0xc008('0x80')](_0x5104ec['variable_id'])){return this[_0xc008('0xf')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x33ac3f=this[_0xc008('0xf')][_0xc008('0x113')](_0x27cc7e,_0x5104ec['response'],_0x5104ec[_0xc008('0x114')]);var _0x41acd9=_0x33ac3f['result']?_0x33ac3f[_0xc008('0x9f')][_0xc008('0x48')]():'';logger['info']('test',JSON[_0xc008('0x6f')](_0x33ac3f));if(_0x33ac3f['result']===-0x1){this['createSquareDetailsReport'][_0xc008('0x6c')](this,_0x5104ec,_0x41acd9);return _0x33ac3f;}else if(_0x33ac3f['extra']===_0xc008('0x60')){_0x33ac3f[_0xc008('0x9f')]=_0x41acd9[_0xc008('0x97')]>=parseInt(_0x5104ec[_0xc008('0x115')])?'x':'i';}else{_0x33ac3f[_0xc008('0x9f')]=_0x41acd9['length']>=parseInt(_0x5104ec['mindigit'])&&_0x41acd9[_0xc008('0x97')]<=parseInt(_0x5104ec['maxdigit'])?'x':'i';}var _0x120338=this['getVariable']['sync'](this,_0x5104ec['variable_id']);if(!_0x120338){return this[_0xc008('0xf')]['error'](_0x5104ec,_0xc008('0x116'));}this[_0xc008('0xf')]['setVariable'](_0x120338,_0x41acd9);if(this['isConfigured'](_0x5104ec[_0xc008('0x117')])){var _0x202623=parseInt(_0x5104ec[_0xc008('0x117')],0xa);var _0x477482=rs['generate']({'charset':'*','length':_0x202623});var _0x54536d=_0x41acd9[_0xc008('0x97')];if(_0x54536d>0x0){if(_0x54536d>_0x202623){this['createSquareDetailsReport']['sync'](this,_0x5104ec,_0x5104ec[_0xc008('0x118')]===_0xc008('0x119')?_0x477482+_0x41acd9['substr'](_0x202623):_0x41acd9['substr'](0x0,_0x54536d-_0x202623)+_0x477482);}else{this['createSquareDetailsReport'][_0xc008('0x6c')](this,_0x5104ec,rs['generate']({'charset':'*','length':_0x54536d}));}}else{this[_0xc008('0x33')][_0xc008('0x6c')](this,_0x5104ec,'');}}else{this[_0xc008('0x33')][_0xc008('0x6c')](this,_0x5104ec,_0x41acd9);}return _0x33ac3f;};AGIVertices[_0xc008('0x15')]['getsecretdigits']=function(_0x529fa7){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x11a'),_0x529fa7[_0xc008('0xa3')]));return this[_0xc008('0xe')](_0x529fa7);};AGIVertices[_0xc008('0x15')][_0xc008('0x11b')]=function(_0x2e65fb){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x11c'),_0x2e65fb[_0xc008('0xa3')]));this['createSquareDetailsReport'][_0xc008('0x6c')](this,_0x2e65fb,_0x2e65fb[_0xc008('0x11d')]);return this[_0xc008('0xf')][_0xc008('0xa4')](util['format'](_0xc008('0x11e'),_0x2e65fb[_0xc008('0x11d')]));};AGIVertices[_0xc008('0x15')][_0xc008('0x11f')]=function(_0x122084){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x120'),_0x122084['label']));if(!this[_0xc008('0x80')](_0x122084[_0xc008('0x83')])||!this[_0xc008('0x80')](_0x122084[_0xc008('0x88')])){return this[_0xc008('0xf')][_0xc008('0xa4')](_0xc008('0x121'));}if(!this['isConfigured'](_0x122084[_0xc008('0x57')])){return this['channel'][_0xc008('0xa4')](_0xc008('0xa5'));}this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x122'),_0x122084[_0xc008('0x57')]));var _0x22a459=this[_0xc008('0x82')][_0xc008('0x6c')](this,_0x122084);if(_0x22a459){this['channel'][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x123'),_0x22a459));var _0x1ddd81=this[_0xc008('0xf')][_0xc008('0x100')](_0x22a459);try{fs[_0xc008('0x124')](_0x22a459+_0xc008('0x101'));}catch(_0x2cd23b){logger[_0xc008('0x29')](_0x2cd23b);}return _0x1ddd81;}return this[_0xc008('0xf')][_0xc008('0x29')](_0x122084,_0xc008('0x125'));};AGIVertices['prototype'][_0xc008('0x126')]=function(_0x4dfecc){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x127'),_0x4dfecc[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x4dfecc[_0xc008('0x83')])||!this['isConfigured'](_0x4dfecc[_0xc008('0x88')])){return this[_0xc008('0xf')][_0xc008('0xa4')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x4dfecc['aws_bot_name'])){return this[_0xc008('0xf')][_0xc008('0xa4')](_0xc008('0x128'));}if(!this[_0xc008('0x80')](_0x4dfecc[_0xc008('0x57')])){return this[_0xc008('0xf')][_0xc008('0xa4')]('no\x20text\x20configured');}this[_0xc008('0xf')][_0xc008('0x129')]=!![];this[_0xc008('0x33')](_0x4dfecc);this[_0xc008('0x3e')](_0x4dfecc[_0xc008('0x57')],'in','','');this['channel'][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x12a'),_0x4dfecc[_0xc008('0x57')]));var _0x41877e=this[_0xc008('0x87')][_0xc008('0x6c')](this,_0x4dfecc);if(_0x41877e){for(var _0x3485a3 in _0x41877e){if(_0x41877e[_0xc008('0x90')](_0x3485a3)&&_[_0xc008('0x91')](_0x41877e[_0x3485a3])){this[_0xc008('0xf')]['setVariable'](util[_0xc008('0x25')]('AWS_LEX_%s',_0x3485a3[_0xc008('0x65')]()),_0x41877e[_0x3485a3]);}}if(_[_0xc008('0x41')](_0x41877e[_0xc008('0x12b')])){return this['channel'][_0xc008('0xa4')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xc008('0x3e')](_0x41877e[_0xc008('0x12b')],_0xc008('0xe7'),_0xc008('0x12c'),'');return this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x12d'),_0x41877e[_0xc008('0x12b')]));}}return this[_0xc008('0xf')]['error'](_0x4dfecc,_0xc008('0x12e'));};AGIVertices['prototype']['googleasr']=function(_0x35edb8){logger['info'](util[_0xc008('0x25')](_0xc008('0x12f'),_0x35edb8[_0xc008('0xa3')],_0x35edb8[_0xc008('0x60')]));if(!this['isConfigured'](_0x35edb8[_0xc008('0x74')])){return this[_0xc008('0xf')][_0xc008('0xa4')](_0xc008('0x130'));}var _0xc5b3de='wav';var _0x2b9571=util[_0xc008('0x25')]('%s/recordings/%s',FILES_PATH,rs[_0xc008('0x131')](0x4));var _0x1cfb31=util[_0xc008('0x25')](_0xc008('0x99'),_0x2b9571,_0xc5b3de);var _0x252c44=!![];if(_0x35edb8[_0xc008('0x132')]==='NOBEEP'){_0x252c44=![];}var _0x2922a9=this[_0xc008('0xf')][_0xc008('0x133')](_0x2b9571,_0xc5b3de,_0x35edb8[_0xc008('0x134')],_0x35edb8[_0xc008('0x60')],undefined,_0x252c44);if(_0x2922a9[_0xc008('0x9f')]!==-0x1){this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x135'),_0x1cfb31));var _0x5d74df=this[_0xc008('0x8a')][_0xc008('0x6c')](this,_0x35edb8,_0x1cfb31);if(_0x5d74df){for(var _0x298783 in _0x5d74df){if(_0x5d74df[_0xc008('0x90')](_0x298783)){this['channel'][_0xc008('0x9a')](util[_0xc008('0x25')](_0xc008('0x136'),_0x298783[_0xc008('0x65')]()),_0x5d74df[_0x298783]);}}return this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x137'),JSON[_0xc008('0x6f')](_0x5d74df)));}}return _0x2922a9;};AGIVertices[_0xc008('0x15')][_0xc008('0x138')]=function(_0x15a061){logger[_0xc008('0x2b')](util[_0xc008('0x25')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x15a061[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x15a061[_0xc008('0x8d')])){return this[_0xc008('0xf')][_0xc008('0xa4')]('no\x20appid\x20configured');}if(!this[_0xc008('0x80')](_0x15a061[_0xc008('0x139')])){return this['channel'][_0xc008('0xa4')](_0xc008('0x13a'));}var _0x552498='wav';var _0x4871bf=util['format'](_0xc008('0x13b'),FILES_PATH,rs['generate'](0x4));var _0x48791d=util[_0xc008('0x25')](_0xc008('0x99'),_0x4871bf,_0x552498);var _0x186dcf=!![];if(_0x15a061['beep']==='NOBEEP'){_0x186dcf=![];}var _0x4c6c36=this[_0xc008('0xf')][_0xc008('0x133')](_0x4871bf,_0x552498,_0x15a061[_0xc008('0x134')],_0x15a061['timeout'],undefined,_0x186dcf);if(_0x4c6c36[_0xc008('0x9f')]!==-0x1){this[_0xc008('0xf')]['noop'](util[_0xc008('0x25')]('tilde\x20%s\x20file\x20created',_0x48791d));var _0x5aedcb=this[_0xc008('0x8c')][_0xc008('0x6c')](this,_0x15a061,_0x48791d);if(_0x5aedcb){for(var _0x545f41 in _0x5aedcb){if(_0x5aedcb['hasOwnProperty'](_0x545f41)){this[_0xc008('0xf')][_0xc008('0x9a')](util['format'](_0xc008('0x13c'),_0x545f41['toUpperCase']()),_0x5aedcb[_0x545f41]);}}return this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x13d'),JSON[_0xc008('0x6f')](_0x5aedcb)));}}return _0x4c6c36;};AGIVertices[_0xc008('0x15')][_0xc008('0x13e')]=function(_0x41a8a6){logger['info'](util[_0xc008('0x25')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x41a8a6[_0xc008('0xa3')]));return this['channel']['continueAt'](_0x41a8a6[_0xc008('0x39')],_0x41a8a6[_0xc008('0x3a')],_0x41a8a6[_0xc008('0x3b')]);};AGIVertices[_0xc008('0x15')][_0xc008('0x13f')]=function(_0x52d6a3){logger['info'](util[_0xc008('0x25')](_0xc008('0x140'),_0x52d6a3['label']));if(!this['isConfigured'](_0x52d6a3[_0xc008('0x141')])){return this[_0xc008('0xf')][_0xc008('0x29')](_0x52d6a3,_0xc008('0x142'));}try{var _0x166e8a=eval(_0x52d6a3[_0xc008('0x141')])?_0xc008('0x143'):_0xc008('0x144');this['channel'][_0xc008('0xa4')](util[_0xc008('0x25')]('EVAL\x20CONDITION\x20%s\x20%s',_0x52d6a3[_0xc008('0x141')],_0x166e8a));return{'code':0xc8,'result':_0x166e8a};}catch(_0x1859d7){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xc008('0x15')]['gotoiftime']=function(_0x29af3c){logger['info'](util[_0xc008('0x25')](_0xc008('0x145'),_0x29af3c['label']));if(!this[_0xc008('0x80')](_0x29af3c['interval_id'])){return this[_0xc008('0xf')][_0xc008('0x29')](_0x29af3c,_0xc008('0x146'));}var _0x34d4c0=this[_0xc008('0x1e')][_0xc008('0x6c')](this,_0x29af3c[_0xc008('0x147')]);if(!_0x34d4c0){return this[_0xc008('0xf')][_0xc008('0x29')](_0x29af3c,'no\x20intervals\x20found');}for(var _0x194e84=0x0;_0x194e84<_0x34d4c0[_0xc008('0x97')];_0x194e84+=0x1){var _0xd2ce8e=this[_0xc008('0xf')][_0xc008('0x9d')](util['format'](_0xc008('0x148'),_0x34d4c0[_0x194e84]));if(_0xd2ce8e[_0xc008('0x9f')]===-0x1){return _0xd2ce8e;}logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x149'),_0x34d4c0[_0x194e84],_0xd2ce8e[_0xc008('0x9e')]));if(_0xd2ce8e[_0xc008('0x9e')]===_0xc008('0x143')){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x149'),_0x34d4c0[_0x194e84],_0xc008('0x143')));this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x149'),_0x34d4c0[_0x194e84],'true'));return{'code':0xc8,'result':_0xc008('0x143')};}else{logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x149'),_0x34d4c0[_0x194e84],_0xc008('0x144')));this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x149'),_0x34d4c0[_0x194e84],_0xc008('0x144')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xc008('0x15')][_0xc008('0x14a')]=function(_0x49cb34){logger[_0xc008('0x2b')](util[_0xc008('0x25')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x49cb34[_0xc008('0xa3')]));return this[_0xc008('0xf')][_0xc008('0x14a')]();};AGIVertices[_0xc008('0x15')][_0xc008('0x14b')]=function(_0x2863f8){logger['info'](util[_0xc008('0x25')](_0xc008('0x14c'),_0x2863f8[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x2863f8[_0xc008('0x74')])){return this['channel'][_0xc008('0xa4')](_0xc008('0x130'));}var _0x326860=_0xc008('0x14d');var _0x3a1dfb=util[_0xc008('0x25')](_0xc008('0x13b'),FILES_PATH,rs[_0xc008('0x131')](0x4));var _0x5d3265=util[_0xc008('0x25')](_0xc008('0x99'),_0x3a1dfb,_0x326860);var _0x441dd1=!![];if(_0x2863f8[_0xc008('0x132')]===_0xc008('0x14e')){_0x441dd1=![];}var _0x47b2a0=this[_0xc008('0xf')][_0xc008('0x133')](_0x3a1dfb,_0x326860,_0x2863f8[_0xc008('0x134')],_0x2863f8['timeout'],undefined,_0x441dd1);if(_0x47b2a0['result']!==-0x1){this['channel'][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x14f'),_0x5d3265));var _0x5d350e=this[_0xc008('0x7e')][_0xc008('0x6c')](this,_0x2863f8,_0x5d3265);if(_0x5d350e){for(var _0x1fa562 in _0x5d350e){if(_0x5d350e[_0xc008('0x90')](_0x1fa562)){this['channel'][_0xc008('0x9a')](util[_0xc008('0x25')](_0xc008('0x150'),_0x1fa562[_0xc008('0x65')]()),_0x5d350e[_0x1fa562]);}}return this[_0xc008('0xf')][_0xc008('0xa4')](util['format']('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x5d350e)));}}return _0x47b2a0;};AGIVertices[_0xc008('0x15')][_0xc008('0x151')]=function(_0x5708a7){logger['info'](util[_0xc008('0x25')](_0xc008('0x152'),_0x5708a7[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x5708a7[_0xc008('0x74')])){return this['channel']['noop'](_0xc008('0x130'));}if(!this[_0xc008('0x80')](_0x5708a7[_0xc008('0x57')])){return this['channel'][_0xc008('0xa4')](_0xc008('0xa5'));}this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x153'),_0x5708a7[_0xc008('0x57')]));var _0x5f0e69=this['ispeechTTS'][_0xc008('0x6c')](this,_0x5708a7);if(_0x5f0e69){this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x14f'),_0x5f0e69));var _0x5a406d=this[_0xc008('0xf')]['streamFile'](_0x5f0e69,_0x5708a7['intKey']);try{fs[_0xc008('0x124')](_0x5f0e69+'.wav');}catch(_0x35daed){logger['error'](_0x35daed);}return _0x5a406d;}return this['channel']['error'](_0x5708a7,_0xc008('0x154'));};AGIVertices['prototype'][_0xc008('0x155')]=function(_0x429cc4){logger['info'](util[_0xc008('0x25')](_0xc008('0x156'),_0x429cc4[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x429cc4['findBy'])){return this['channel'][_0xc008('0x29')](_0x429cc4,_0xc008('0x157'));}logger[_0xc008('0x2b')](util[_0xc008('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xc008('0xf')]['callerid'],_0x429cc4[_0xc008('0x158')]));var _0x3af896=this[_0xc008('0x52')][_0xc008('0x6c')](this,_0x429cc4['findBy']);if(_0x3af896){logger['info'](util[_0xc008('0x25')](_0xc008('0x159'),this[_0xc008('0xf')]['callerid'],_0x429cc4[_0xc008('0x158')]));this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x159'),this['channel']['callerid'],_0x429cc4[_0xc008('0x158')]));return{'code':0xc8,'result':_0xc008('0x15a')};}else{logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x15b'),this[_0xc008('0xf')][_0xc008('0x37')],_0x429cc4[_0xc008('0x158')]));this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x15b'),this[_0xc008('0xf')][_0xc008('0x37')],_0x429cc4[_0xc008('0x158')]));return{'code':0xc8,'result':_0xc008('0x15c')};}};AGIVertices['prototype'][_0xc008('0x15d')]=function(_0x651201){logger[_0xc008('0x2b')](util['format'](_0xc008('0x15e'),_0x651201[_0xc008('0xa3')]));if(!this['isConfigured'](_0x651201[_0xc008('0x158')])){return this['channel'][_0xc008('0x29')](_0x651201,_0xc008('0x157'));}logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x15f'),this[_0xc008('0xf')]['callerid'],_0x651201[_0xc008('0x158')]));var _0x893638=this[_0xc008('0x4e')][_0xc008('0x6c')](this,_0x651201[_0xc008('0x158')]);if(_0x893638){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x159'),this[_0xc008('0xf')]['callerid'],_0x651201[_0xc008('0x158')]));this[_0xc008('0xf')][_0xc008('0xa4')](util['format'](_0xc008('0x159'),this[_0xc008('0xf')][_0xc008('0x37')],_0x651201[_0xc008('0x158')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xc008('0x25')](_0xc008('0x15b'),this['channel'][_0xc008('0x37')],_0x651201['findBy']));this[_0xc008('0xf')]['noop'](util[_0xc008('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xc008('0xf')][_0xc008('0x37')],_0x651201[_0xc008('0x158')]));return{'code':0xc8,'result':_0xc008('0x15c')};}};AGIVertices[_0xc008('0x15')][_0xc008('0x160')]=function(_0x534a20){logger['info'](util[_0xc008('0x25')](_0xc008('0x161'),_0x534a20['label']));if(!this['isConfigured'](_0x534a20['operation'])){return this[_0xc008('0xf')][_0xc008('0x29')](_0x534a20,_0xc008('0x162'));}this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')]('math\x20%s',_0x534a20['operation']));var _0x2fae6e=eval(_0x534a20[_0xc008('0x163')]);if(!this[_0xc008('0x80')](_0x534a20[_0xc008('0xd6')])){return this[_0xc008('0xf')]['noop'](_0xc008('0xd7'));}var _0x9e896a=this['getVariable'][_0xc008('0x6c')](this,_0x534a20[_0xc008('0xd6')]);if(!_0x9e896a){return this[_0xc008('0xf')][_0xc008('0x29')](_0x534a20,_0xc008('0x116'));}if(_['isArray'](_0x2fae6e)){var _0x653f1e=this;_0x2fae6e[_0xc008('0xd8')](function(_0x5139d9,_0x32eda5){_0x653f1e[_0xc008('0xf')]['setVariable'](util[_0xc008('0x25')](_0xc008('0x164'),_0x9e896a,_0x32eda5),_0x5139d9);});return this[_0xc008('0xf')]['noop'](util[_0xc008('0x25')](_0xc008('0x165'),_0x9e896a));}else{return this[_0xc008('0xf')][_0xc008('0x9a')](_0x9e896a,_0x2fae6e);}};AGIVertices[_0xc008('0x15')][_0xc008('0x166')]=function(_0xa21caf){logger[_0xc008('0x2b')](util['format'](_0xc008('0x167'),_0xa21caf[_0xc008('0xa3')]));if(_0xa21caf[_0xc008('0x10e')]===0x0){return this[_0xc008('0xa1')](_0xa21caf);}_0xa21caf['retry']-=0x1;if(!this[_0xc008('0x80')](_0xa21caf['file_id'])){return this['channel'][_0xc008('0x29')](_0xa21caf,'no\x20file\x20audio\x20selected');}var _0xc3738f=this[_0xc008('0x111')][_0xc008('0x6c')](this,_0xa21caf[_0xc008('0x10f')]);if(!_0xc3738f){return this[_0xc008('0xf')]['error'](_0xa21caf,_0xc008('0x112'));}var _0x471938=this[_0xc008('0xf')]['getData'](_0xc3738f,_0xa21caf[_0xc008('0x168')],_0xa21caf[_0xc008('0x169')]);var _0x464b6d=_0x471938[_0xc008('0x9f')];if(_0x471938['result']===-0x1){this[_0xc008('0x33')][_0xc008('0x6c')](this,_0xa21caf,'-1');return _0x471938;}else if(_0x471938[_0xc008('0x9e')]===_0xc008('0x60')){_0x471938['result']=_0x471938[_0xc008('0x9f')][_0xc008('0x97')]>0x0?_0x471938['result']:'t';}else if(_[_0xc008('0x40')](_0x471938['result'])){_0x471938['result']='#';_0x464b6d='#';}if(!this['isConfigured'](_0xa21caf[_0xc008('0xd6')])){this[_0xc008('0xf')][_0xc008('0xa4')](_0xc008('0xd7'));}else{var _0x85aeb3=this[_0xc008('0x9d')][_0xc008('0x6c')](this,_0xa21caf[_0xc008('0xd6')]);if(!_0x85aeb3){return this[_0xc008('0xf')]['error'](_0xa21caf,'no\x20variable\x20found');}this[_0xc008('0xf')][_0xc008('0x9a')](_0x85aeb3,_0x464b6d);}this['createSquareDetailsReport'][_0xc008('0x6c')](this,_0xa21caf,_0x464b6d);return _0x471938;};AGIVertices[_0xc008('0x15')][_0xc008('0xa4')]=function(_0x32ad54){logger[_0xc008('0x2b')](util['format'](_0xc008('0x16a'),_0x32ad54[_0xc008('0xa3')]));return this[_0xc008('0xf')]['noop'](_0x32ad54[_0xc008('0x16b')]||_0x32ad54['label']);};AGIVertices[_0xc008('0x15')][_0xc008('0x16c')]=function(_0x596b13){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x16d'),_0x596b13['label']));if(!this['isConfigured'](_0x596b13[_0xc008('0x158')])){return this[_0xc008('0xf')][_0xc008('0x29')](_0x596b13,'no\x20find\x20by\x20configured');}logger['info'](util[_0xc008('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xc008('0x37')],_0x596b13[_0xc008('0x158')]));var _0x143e71=this[_0xc008('0x4a')][_0xc008('0x6c')](this,_0x596b13[_0xc008('0x16e')]);var _0x359bcc=this[_0xc008('0x16f')]['sync'](this,_0x596b13['findBy'],_0x143e71);if(_0x359bcc){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x159'),this[_0xc008('0xf')][_0xc008('0x37')],_0x596b13[_0xc008('0x158')]));this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x159'),this[_0xc008('0xf')][_0xc008('0x37')],_0x596b13[_0xc008('0x158')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xc008('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xc008('0xf')]['callerid'],_0x596b13[_0xc008('0x158')]));this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x159'),this['channel'][_0xc008('0x37')],_0x596b13['findBy']));return{'code':0xc8,'result':_0xc008('0x15c')};}};AGIVertices['prototype'][_0xc008('0x170')]=function(_0x466d46){logger[_0xc008('0x2b')](util[_0xc008('0x25')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x466d46[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x466d46[_0xc008('0x10f')])){return this[_0xc008('0xf')][_0xc008('0x29')](_0x466d46,_0xc008('0x110'));}var _0x8855e3=this['getSound']['sync'](this,_0x466d46[_0xc008('0x10f')]);if(!_0x8855e3){return this['channel'][_0xc008('0x29')](_0x466d46,_0xc008('0x112'));}var _0x453e1a=this[_0xc008('0xf')][_0xc008('0x53')]('PLAYBACK',[_0x8855e3,_0x466d46[_0xc008('0x10b')]]);if(_0x453e1a[_0xc008('0x9f')]===-0x1){return _0x453e1a;}return this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0xbf'),_0xc008('0x171'),_0x8855e3));};AGIVertices[_0xc008('0x15')][_0xc008('0x172')]=function(_0x537459){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x173'),_0x537459[_0xc008('0xa3')]));if(!this['isConfigured'](_0x537459[_0xc008('0x174')])){return this[_0xc008('0xf')][_0xc008('0x29')](_0x537459,'no\x20queue\x20selected');}var _0x564149='';var _0xdc3675=parseInt(_0x537459[_0xc008('0x174')],0xa);if(isNaN(_0xdc3675)){_0x564149=_0x537459[_0xc008('0x174')];}else{_0x564149=this['getVoiceQueue']['sync'](this,_0x537459[_0xc008('0x174')]);if(!_0x564149){return this[_0xc008('0xf')][_0xc008('0x29')](_0x537459,_0xc008('0x175'));}}var _0x29e610='';if(this[_0xc008('0x80')](_0x537459[_0xc008('0x10f')])){var _0x52cd65=this['getSound'][_0xc008('0x6c')](this,_0x537459[_0xc008('0x10f')]);if(_0x52cd65){_0x29e610=_0x52cd65;}}this[_0xc008('0x33')]['sync'](this,_0x537459,_0x564149);if(_0x537459['opts'][_0xc008('0x176')]('x')<0x0){_0x537459[_0xc008('0x10b')]+='x';}if(_0x537459[_0xc008('0x10b')][_0xc008('0x176')]('X')<0x0){_0x537459[_0xc008('0x10b')]+='X';}this[_0xc008('0xf')][_0xc008('0x9a')](_0xc008('0x177'),_0x564149?_0x564149[_0xc008('0x178')]():'');var _0x126381=this[_0xc008('0xf')]['exec'](_0xc008('0x179'),[_0x564149,_0x537459['opts'],_0x537459[_0xc008('0x5e')],_0x29e610,_0x537459[_0xc008('0x60')],_0x537459[_0xc008('0x8')],_0x537459[_0xc008('0x17a')],_0x537459[_0xc008('0x17b')],'',_0x537459[_0xc008('0x17c')]]);if(_0x126381['result']===-0x1){return _0x126381;}return this['channel']['noop'](util[_0xc008('0x25')]('Executed\x20command\x20%s\x20%s',_0xc008('0x179'),_0x564149));};AGIVertices[_0xc008('0x15')][_0xc008('0x17d')]=function(_0x3796f2){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x17e'),_0x3796f2[_0xc008('0xa3')]));var _0x17ae61=_0x3796f2[_0xc008('0x17f')]||_0xc008('0x14d');var _0x1c2f3e=util[_0xc008('0x25')](_0xc008('0x180'),this[_0xc008('0xf')]['uniqueid'],rs[_0xc008('0x131')](0x5));var _0x58805a=util[_0xc008('0x25')](_0xc008('0x181'),FILES_PATH,_0x1c2f3e,_0x17ae61);var _0x4fdfc7=util[_0xc008('0x25')](_0xc008('0x13b'),FILES_PATH,_0x1c2f3e);this[_0xc008('0x38')][_0xc008('0x6c')](this,_0x3796f2,_0x1c2f3e,_0x58805a);this[_0xc008('0xf')][_0xc008('0x9a')](_0xc008('0x182'),_0x1c2f3e);logger['info'](_0xc008('0x183'),_0x4fdfc7,_0x17ae61,_0x3796f2[_0xc008('0x184')],_0x3796f2[_0xc008('0x60')]);return this[_0xc008('0xf')][_0xc008('0x133')](_0x4fdfc7,_0x17ae61,_0x3796f2[_0xc008('0x184')],_0x3796f2['timeout'],undefined,!![]);};AGIVertices[_0xc008('0x15')][_0xc008('0x185')]=function(_0x375e6d){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x186'),_0x375e6d[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x375e6d['url'])){return this[_0xc008('0xf')]['noop'](_0xc008('0x187'));}var _0x270c07=this[_0xc008('0x5d')]['sync'](this,_0x375e6d);logger[_0xc008('0x2b')](util['format'](_0xc008('0x188'),util[_0xc008('0x189')](_0x270c07,{'showHidden':![],'depth':null})));if(!this[_0xc008('0x80')](_0x375e6d['variable_id'])){return this[_0xc008('0xf')]['noop'](_0xc008('0x18a'));}var _0x268963=this['getVariable']['sync'](this,_0x375e6d[_0xc008('0xd6')]);if(!_0x268963){return this[_0xc008('0xf')]['error'](_0x375e6d,_0xc008('0x116'));}this[_0xc008('0xf')][_0xc008('0x9a')](util[_0xc008('0x25')](_0xc008('0x18b'),_0x268963),_0x270c07[_0xc008('0x71')]?_0x270c07[_0xc008('0x71')]:'200');this['channel'][_0xc008('0x9a')](util[_0xc008('0x25')](_0xc008('0x18c'),_0x268963),_0x270c07[_0xc008('0x18d')]?_0x270c07[_0xc008('0x18d')]:'OK');if(_0x270c07['body']){try{this[_0xc008('0x98')](_0x270c07[_0xc008('0x66')],_0x268963);}catch(_0x108342){logger[_0xc008('0x29')](util[_0xc008('0x25')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x268963));}}return this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x18e'),_0x268963));};AGIVertices[_0xc008('0x15')][_0xc008('0x18f')]=function(_0x54a213){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x190'),_0x54a213[_0xc008('0xa3')]));return this[_0xc008('0xf')][_0xc008('0x191')](_0x54a213['digits'][_0xc008('0x192')](/\s+/g,''),_0x54a213[_0xc008('0x184')]);};AGIVertices[_0xc008('0x15')][_0xc008('0x193')]=function(_0x11b7f3){logger[_0xc008('0x2b')](util['format'](_0xc008('0x194'),_0x11b7f3[_0xc008('0xa3')]));return this[_0xc008('0xf')]['sayNumber'](_0x11b7f3[_0xc008('0x61')]['replace'](/\s+/g,''),_0x11b7f3[_0xc008('0x184')]);};AGIVertices[_0xc008('0x15')][_0xc008('0x195')]=function(_0x522d53){logger[_0xc008('0x2b')](util['format'](_0xc008('0x196'),_0x522d53[_0xc008('0xa3')]));return this[_0xc008('0xf')][_0xc008('0x197')](_0x522d53['text'],_0x522d53[_0xc008('0x184')]);};AGIVertices[_0xc008('0x15')][_0xc008('0x198')]=function(_0x114505){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x199'),_0x114505['label']));if(!this[_0xc008('0x80')](_0x114505['account_id'])){return this['channel']['noop'](_0xc008('0x19a'));}var _0x556bb5=this[_0xc008('0x19b')][_0xc008('0x6c')](this,_0x114505[_0xc008('0x19c')]);if(!_0x556bb5||!_0x556bb5[_0xc008('0x19d')]){return this['channel'][_0xc008('0x29')](_0x114505,_0xc008('0x19e'));}var _0x4c5939={'from':util[_0xc008('0x25')](_0xc008('0x19f'),_0x556bb5[_0xc008('0x13')],_0x556bb5[_0xc008('0x1a0')]||_0x556bb5[_0xc008('0x19d')][_0xc008('0x1a1')]),'to':_0x114505['to']||'','cc':_0x114505['cc']||'','bcc':_0x114505['bcc']||'','subject':_0x114505[_0xc008('0x1a2')],'html':_0x114505[_0xc008('0x57')],'text':_0x114505[_0xc008('0x57')]};if(this[_0xc008('0x80')](_0x114505[_0xc008('0x1a3')])){}logger[_0xc008('0x1a4')](_0xc008('0x1a5'),JSON[_0xc008('0x6f')](_0x4c5939));this[_0xc008('0x33')][_0xc008('0x6c')](this,_0x114505,_0x114505[_0xc008('0x19c')]);this[_0xc008('0xf')]['noop'](util[_0xc008('0x25')](_0xc008('0x1a6'),_0x556bb5['name']));this[_0xc008('0x1c')][_0xc008('0x6c')](this,_0x556bb5[_0xc008('0x1a7')],_0x4c5939);return this['channel'][_0xc008('0xa4')](_0xc008('0x1a8'));};AGIVertices['prototype'][_0xc008('0x1a9')]=function(_0x532c31){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x1aa'),_0x532c31[_0xc008('0xa3')]));return this[_0xc008('0xf')][_0xc008('0xa4')](_0xc008('0x1ab'));};AGIVertices[_0xc008('0x15')][_0xc008('0x1ac')]=function(_0x161b9a){logger[_0xc008('0x2b')](util[_0xc008('0x25')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x161b9a[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x161b9a[_0xc008('0x1ad')])){return this[_0xc008('0xf')]['noop'](_0xc008('0x1ae'));}var _0x387763=this['getSmsAccount'][_0xc008('0x6c')](this,_0x161b9a[_0xc008('0x1ad')]);if(!_0x387763){return this[_0xc008('0xf')][_0xc008('0x29')](_0x161b9a,_0xc008('0x1af'));}var _0x1c80e4={'body':_0x161b9a[_0xc008('0x1b0')],'phone':_0x161b9a['to']||'','SmsAccountId':_0x387763['id']};logger[_0xc008('0x1a4')](_0xc008('0x1b1'),JSON['stringify'](_0x1c80e4));this['createSquareDetailsReport']['sync'](this,_0x161b9a,_0x161b9a[_0xc008('0x1ad')]);this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x1b2'),_0x387763['name']));this[_0xc008('0x32')]['sync'](this,_0x1c80e4);return this['channel'][_0xc008('0xa4')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xc008('0x15')][_0xc008('0x1b3')]=function(_0x310560){logger[_0xc008('0x2b')](util['format'](_0xc008('0x1b4'),_0x310560[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x310560[_0xc008('0xd6')])){return this[_0xc008('0xf')][_0xc008('0x29')](_0x310560,_0xc008('0x1b5'));}var _0x20d0de=this['getVariable'][_0xc008('0x6c')](this,_0x310560[_0xc008('0xd6')]);if(!_0x20d0de){return this[_0xc008('0xf')][_0xc008('0x29')](_0x310560,_0xc008('0x116'));}return this[_0xc008('0xf')]['setVariable'](_0x20d0de,_0x310560['variable_value']);};AGIVertices[_0xc008('0x15')]['start']=function(_0x310725){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x1b6'),_0x310725[_0xc008('0xa3')]));this['channel'][_0xc008('0xa4')](_0xc008('0x1b7'));var _0x1580c5=this['channel'][_0xc008('0x9d')](_0xc008('0x1b8'));if(!_[_0xc008('0x40')](_0x1580c5['extra'])){this[_0xc008('0xf')]['uniqueid']=_0x1580c5[_0xc008('0x9e')];}if(_0x310725[_0xc008('0xb4')]===_0xc008('0x1b9')){this['channel'][_0xc008('0xa4')](_0xc008('0x1ba'));return this[_0xc008('0xf')]['answer']();}return this[_0xc008('0xf')]['noop'](_0xc008('0x1bb'));};AGIVertices[_0xc008('0x15')][_0xc008('0x1bc')]=function(_0x50b5ce){logger['info'](util[_0xc008('0x25')](_0xc008('0x1bd'),_0x50b5ce[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x50b5ce[_0xc008('0x1be')])){return this[_0xc008('0xf')][_0xc008('0x29')](_0x50b5ce,_0xc008('0x1bf'));}var _0x57a188=this['getSquareProject'][_0xc008('0x6c')](this,_0x50b5ce[_0xc008('0x1be')]);if(!this['isConfigured'](_0x57a188)){return this[_0xc008('0xf')][_0xc008('0x29')](_0x50b5ce,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0x50b5ce[_0xc008('0x1be')]));}if(_0x57a188===this['channel'][_0xc008('0x36')]){return this[_0xc008('0xf')][_0xc008('0x29')](_0x50b5ce,_0xc008('0x1c0'));}this['createSquareDetailsReport']['sync'](this,_0x50b5ce,_0x57a188);var _0x1c588c=this[_0xc008('0xf')][_0xc008('0x53')]('AGI',util['format'](_0xc008('0x1c1'),config[_0xc008('0x8')][_0xc008('0x1c2')]||_0xc008('0x1c3'),_0x57a188,this[_0xc008('0xf')][_0xc008('0x36')]));if(_0x1c588c[_0xc008('0x9f')]===-0x1){return _0x1c588c;}return this['channel']['noop'](util[_0xc008('0x25')](_0xc008('0xbf'),_0xc008('0x1c4'),_0x57a188));};AGIVertices[_0xc008('0x15')][_0xc008('0x1c5')]=function(_0xb7fda0){logger[_0xc008('0x2b')](util[_0xc008('0x25')](_0xc008('0x1c6'),_0xb7fda0['label']));var _0x5a2336=this[_0xc008('0x1c7')]['sync'](this,_0xb7fda0[_0xc008('0xb2')]);this['createSquareDetailsReport'][_0xc008('0x6c')](this,_0xb7fda0,_0xb7fda0[_0xc008('0xb2')]);if(this[_0xc008('0x80')](_0xb7fda0[_0xc008('0xd6')])){var _0xe65a0=this[_0xc008('0x9d')][_0xc008('0x6c')](this,_0xb7fda0[_0xc008('0xd6')]);if(_0xe65a0){this['channel']['setVariable'](_0xe65a0,_0x5a2336);return this[_0xc008('0xf')]['noop'](util[_0xc008('0x25')](_0xc008('0x1c8'),_0xb7fda0[_0xc008('0xb2')],_0xe65a0));}}return this[_0xc008('0xf')][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x1c9'),_0xb7fda0[_0xc008('0xb2')]));};AGIVertices[_0xc008('0x15')][_0xc008('0x1ca')]=function(_0x2ac2f2){logger[_0xc008('0x2b')](util[_0xc008('0x25')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x2ac2f2[_0xc008('0xa3')]));_0x2ac2f2[_0xc008('0x57')]=_0x2ac2f2['text'][_0xc008('0x192')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2ac2f2[_0xc008('0x55')])){return this['channel'][_0xc008('0xa4')]('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0x2ac2f2[_0xc008('0x57')])){return this[_0xc008('0xf')][_0xc008('0xa4')](_0xc008('0xa5'));}this[_0xc008('0xf')][_0xc008('0xa4')](util['format'](_0xc008('0x1cb'),_0x2ac2f2[_0xc008('0x57')]));var _0x51b2b0=this[_0xc008('0x54')][_0xc008('0x6c')](this,_0x2ac2f2);if(_0x51b2b0){this['channel'][_0xc008('0xa4')](util['format'](_0xc008('0x1cc'),_0x51b2b0));var _0x74ef75=this[_0xc008('0xf')][_0xc008('0x100')](_0x51b2b0);try{fs['unlink'](_0x51b2b0+_0xc008('0x101'));}catch(_0x2d12e0){logger[_0xc008('0x29')](_0x2d12e0);}return _0x74ef75;}return this[_0xc008('0xf')][_0xc008('0x29')](_0x2ac2f2,_0xc008('0x1cd'));};AGIVertices['prototype'][_0xc008('0x1ce')]=function(_0x26f044){logger[_0xc008('0x2b')](util['format'](_0xc008('0x1cf'),_0x26f044[_0xc008('0xa3')]));_0x26f044['text']=_0x26f044['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xc008('0x80')](_0x26f044[_0xc008('0x57')])){return this[_0xc008('0xf')]['noop'](_0xc008('0xa5'));}this['channel'][_0xc008('0xa4')](util[_0xc008('0x25')](_0xc008('0x1d0'),_0x26f044[_0xc008('0x57')]));var _0x1a7b13=this[_0xc008('0x5b')]['sync'](this,_0x26f044);if(_0x1a7b13){this[_0xc008('0xf')]['noop'](util['format'](_0xc008('0x1d1'),_0x1a7b13));var _0x404996=this[_0xc008('0xf')][_0xc008('0x100')](_0x1a7b13);try{fs[_0xc008('0x124')](_0x1a7b13+_0xc008('0x101'));}catch(_0x674155){logger[_0xc008('0x29')](_0x674155);}return _0x404996;}return this[_0xc008('0xf')][_0xc008('0x29')](_0x26f044,_0xc008('0x1d2'));};AGIVertices['prototype'][_0xc008('0x1d3')]=function(_0x2f8b0d){logger['info'](util[_0xc008('0x25')](_0xc008('0x1d4'),_0x2f8b0d['label']));if(!this[_0xc008('0x80')](_0x2f8b0d[_0xc008('0x158')])){return this['channel'][_0xc008('0x29')](_0x2f8b0d,_0xc008('0x157'));}logger[_0xc008('0x2b')](util[_0xc008('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xc008('0xf')]['callerid'],_0x2f8b0d[_0xc008('0x158')]));var _0x5dfdd6=this[_0xc008('0x4d')][_0xc008('0x6c')](this,_0x2f8b0d['findBy']);if(_0x5dfdd6){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xc008('0xf')][_0xc008('0x37')],_0x2f8b0d[_0xc008('0x158')]));this[_0xc008('0xf')][_0xc008('0xa4')](util['format'](_0xc008('0x159'),this[_0xc008('0xf')][_0xc008('0x37')],_0x2f8b0d['findBy']));return{'code':0xc8,'result':_0xc008('0x15a')};}else{logger['info'](util[_0xc008('0x25')](_0xc008('0x15b'),this[_0xc008('0xf')][_0xc008('0x37')],_0x2f8b0d[_0xc008('0x158')]));this[_0xc008('0xf')][_0xc008('0xa4')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xc008('0xf')][_0xc008('0x37')],_0x2f8b0d['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xc008('0x1d5')]=function(_0x5d2994){logger[_0xc008('0x2b')](util[_0xc008('0x25')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x5d2994[_0xc008('0xa3')]));var _0x479af5=this[_0xc008('0xf')][_0xc008('0x53')](_0xc008('0x1d6'),[_0x5d2994[_0xc008('0x1d7')],_0x5d2994[_0xc008('0x72')]]);if(_0x479af5[_0xc008('0x9f')]===-0x1){return _0x479af5;}return this['channel']['noop'](util[_0xc008('0x25')]('Executed\x20command\x20%s\x20%s',_0xc008('0x1d6'),_0x5d2994[_0xc008('0x1d7')]));};AGIVertices[_0xc008('0x15')][_0xc008('0x1d8')]=function(_0x9ca0fa){logger[_0xc008('0x2b')](util['format'](_0xc008('0x1d9'),_0x9ca0fa[_0xc008('0xa3')]));if(!this[_0xc008('0x80')](_0x9ca0fa[_0xc008('0xd6')])){return this[_0xc008('0xf')]['error'](_0x9ca0fa,_0xc008('0x1b5'));}var _0x4cbac9=this[_0xc008('0x9d')][_0xc008('0x6c')](this,_0x9ca0fa[_0xc008('0xd6')]);if(!_0x4cbac9){return this[_0xc008('0xf')][_0xc008('0x29')](_0x9ca0fa,_0xc008('0x116'));}var _0x5664b0=this[_0xc008('0xf')][_0xc008('0x9d')](_0x4cbac9);return{'code':0xc8,'result':_0x5664b0[_0xc008('0x9e')]?_0x5664b0[_0xc008('0x9e')]:'-'};};String[_0xc008('0x15')][_0xc008('0x9c')]=function(_0x263a0a,_0x319c2f){return this[_0xc008('0x9b')](_0x263a0a)[_0xc008('0x1da')](_0x319c2f);};module[_0xc008('0x1db')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 6899731..dfab2b5 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 _0x85b0=['blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','updateAcw','timer','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','channels','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','getAgent','then','voicePause','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','pauseType','ACW','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','startAcw','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer'];(function(_0x28fb5d,_0x1d622c){var _0x423b88=function(_0x2a807d){while(--_0x2a807d){_0x28fb5d['push'](_0x28fb5d['shift']());}};_0x423b88(++_0x1d622c);}(_0x85b0,0x1ba));var _0x085b=function(_0x51990b,_0x3ea2c9){_0x51990b=_0x51990b-0x0;var _0xbdb9e7=_0x85b0[_0x51990b];return _0xbdb9e7;};'use strict';var _=require(_0x085b('0x0'));var moment=require(_0x085b('0x1'));var ami=require(_0x085b('0x2'));var logger=require(_0x085b('0x3'))(_0x085b('0x4'));var RpcUser=require(_0x085b('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x155762){this['voiceQueues']=_0x155762[_0x085b('0x6')];this['agents']=_0x155762[_0x085b('0x7')];this[_0x085b('0x8')]=_0x155762[_0x085b('0x8')];this['channels']={};ami['on'](_0x085b('0x9'),this[_0x085b('0xa')][_0x085b('0xb')](this));ami['on'](_0x085b('0xc'),this['syncHangupRequest'][_0x085b('0xb')](this));ami['on'](_0x085b('0xd'),this[_0x085b('0xe')][_0x085b('0xb')](this));ami['on'](_0x085b('0xf'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x085b('0x10'),this[_0x085b('0x11')][_0x085b('0xb')](this));ami['on'](_0x085b('0x12'),this[_0x085b('0x13')][_0x085b('0xb')](this));ami['on'](_0x085b('0x14'),this[_0x085b('0x15')][_0x085b('0xb')](this));}function getDiff(_0x58fc6e){var _0x5dea14=moment()[_0x085b('0x16')](0x0);var _0x2ba218=moment(_0x58fc6e)['milliseconds'](0x0);return _0x5dea14[_0x085b('0x17')](_0x2ba218,'seconds');}Acw[_0x085b('0x18')][_0x085b('0x19')]=function(_0x287656,_0x1159e9){var _0x3ba82b=this;var _0x9a3332=getDiff(_0x3ba82b[_0x085b('0x8')][_0x287656]['lastPauseAt']);clearTimeout(_0x3ba82b[_0x085b('0x8')][_0x287656]['timer']);_0x3ba82b[_0x085b('0x8')][_0x287656][_0x085b('0x1a')]=![];return RpcVoiceAgentReport[_0x085b('0x1b')]({'acwtime':_0x9a3332},_0x3ba82b[_0x085b('0x8')][_0x287656][_0x085b('0x1c')],_0x287656)['then'](function(_0x3dbd3a){logger['info'](_0x085b('0x1d'),_0x1159e9,_0x9a3332,_0x3dbd3a);})[_0x085b('0x1e')](function(_0x3ccceb){logger[_0x085b('0x1f')]('[%s][UPDATE][ERRORS:%s]',_0x1159e9,_0x3ccceb);})['finally'](function(){delete _0x3ba82b[_0x085b('0x8')][_0x287656];});};Acw[_0x085b('0x18')]['startAcw']=function(_0x5694c6){try{var _0xecacc=this;var _0x56d924=this[_0x085b('0x20')][_0x5694c6][_0x085b('0x21')];var _0x2fc8c9=this[_0x085b('0x20')][_0x5694c6][_0x085b('0x22')];var _0x26c914=this[_0x085b('0x6')][_0x2fc8c9];var _0xd15f5e=![];var _0x14f4b5='ACW';if(_0x26c914[_0x085b('0x23')]&&_0x26c914[_0x085b('0x24')]['name']){_0xd15f5e=!![];_0x14f4b5=_0x26c914[_0x085b('0x24')][_0x085b('0x25')];}if(!_0xecacc[_0x085b('0x7')][_0x56d924]){return Promise['resolve']();}return RpcUser[_0x085b('0x26')](_0xecacc[_0x085b('0x7')][_0x56d924]['id'])[_0x085b('0x27')](function(_0x4e44fa){if(!_0x4e44fa||_0x4e44fa[_0x085b('0x28')]){logger[_0x085b('0x29')](_0x085b('0x2a'),_0x5694c6,_0x56d924,_0x2fc8c9);return;}logger[_0x085b('0x29')](_0x085b('0x2b'),_0x5694c6,_0x56d924,_0x2fc8c9);var _0x33f9d7=_0xecacc[_0x085b('0x20')][_0x5694c6][_0x085b('0x2c')]&&_0xecacc[_0x085b('0x20')][_0x5694c6][_0x085b('0x2d')]?_0xecacc[_0x085b('0x20')][_0x5694c6][_0x085b('0x2d')]:_0x5694c6;return RpcUser[_0x085b('0x2e')](_0xecacc['agents'][_0x56d924],_0x14f4b5,_0x33f9d7)[_0x085b('0x27')](function(){_0xecacc[_0x085b('0x6')][_0x2fc8c9][_0x085b('0x2f')]-=0x1;_0xecacc[_0x085b('0x6')][_0x2fc8c9]['paused']+=0x1;});})[_0x085b('0x27')](function(_0x3f7e91){if(_0xd15f5e||!_0x3f7e91){return;}_0xecacc[_0x085b('0x8')][_0x56d924]={};logger[_0x085b('0x29')](_0x085b('0x30'),_0x5694c6,_0xecacc['voiceQueues'][_0x2fc8c9][_0x085b('0x31')],_0x56d924,_0x2fc8c9);_0xecacc[_0x085b('0x8')][_0x56d924][_0x085b('0x1a')]=setTimeout(_0xecacc[_0x085b('0x32')][_0x085b('0xb')](_0xecacc,_0x56d924),_0xecacc[_0x085b('0x6')][_0x2fc8c9][_0x085b('0x31')]*0x3e8);_0xecacc['timers'][_0x56d924][_0x085b('0x33')]=moment()[_0x085b('0x34')](_0x085b('0x35'));_0xecacc[_0x085b('0x8')][_0x56d924]['uniqueid']=_0x5694c6;_0xecacc[_0x085b('0x8')][_0x56d924][_0x085b('0x22')]=_0x2fc8c9;_0xecacc[_0x085b('0x8')][_0x56d924][_0x085b('0x19')]=_0xecacc['updateAcw'][_0x085b('0xb')](_0xecacc,_0x56d924,_0x5694c6);})[_0x085b('0x1e')](function(){logger['error'](_0x085b('0x30'),_0x5694c6,_0xecacc[_0x085b('0x6')][_0x2fc8c9][_0x085b('0x31')],_0x56d924,_0x2fc8c9);})[_0x085b('0x36')](function(){delete _0xecacc[_0x085b('0x20')][_0x5694c6];});}catch(_0x563292){logger[_0x085b('0x1f')](_0x085b('0x37'),_0x563292[_0x085b('0x38')]);}};Acw['prototype']['stopAcw']=function(_0x430314){try{var _0x2f4b21=this;if(_0x2f4b21[_0x085b('0x8')][_0x430314]){_0x2f4b21[_0x085b('0x8')][_0x430314][_0x085b('0x1a')]=![];var _0x58af43=_0x2f4b21[_0x085b('0x8')][_0x430314][_0x085b('0x1c')];var _0x1b8765=_0x2f4b21['timers'][_0x430314][_0x085b('0x22')];var _0x3a8e2d=_0x2f4b21[_0x085b('0x6')][_0x1b8765][_0x085b('0x31')];logger[_0x085b('0x29')](_0x085b('0x39'),_0x58af43,_0x430314);RpcUser[_0x085b('0x26')](this[_0x085b('0x7')][_0x430314]['id'])[_0x085b('0x27')](function(_0x4a2153){if(_0x4a2153[_0x085b('0x3a')]===_0x085b('0x3b')){return RpcUser[_0x085b('0x3c')](_0x2f4b21[_0x085b('0x7')][_0x430314]);}});RpcVoiceAgentReport[_0x085b('0x1b')]({'acwtime':_0x3a8e2d,'agentacw':!![]},_0x58af43,_0x430314)['then'](function(_0x30e810){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x58af43,_0x3a8e2d,_0x30e810);})['catch'](function(_0x4c0fcc){logger[_0x085b('0x1f')](_0x085b('0x3d'),_0x58af43,_0x4c0fcc);});}else{logger[_0x085b('0x1f')](_0x085b('0x3e'),_0x430314);if(_0x2f4b21[_0x085b('0x8')]){logger[_0x085b('0x29')](_0x085b('0x3f'),JSON[_0x085b('0x40')](_0x2f4b21[_0x085b('0x8')]));}}}catch(_0x19b78d){logger[_0x085b('0x1f')]('[ACW][STOP]\x20%s',_0x19b78d[_0x085b('0x38')]);}};Acw[_0x085b('0x18')][_0x085b('0xa')]=function(_0x1ce44a){try{if(this[_0x085b('0x6')][_0x1ce44a['queue']]&&(this[_0x085b('0x6')][_0x1ce44a[_0x085b('0x22')]][_0x085b('0x4')]||this[_0x085b('0x6')][_0x1ce44a[_0x085b('0x22')]][_0x085b('0x23')])){if(this[_0x085b('0x7')][_0x1ce44a[_0x085b('0x21')]]){this[_0x085b('0x20')][_0x1ce44a[_0x085b('0x1c')]]={'queue':_0x1ce44a['queue'],'interface':_0x1ce44a['interface'],'destlinkedid':_0x1ce44a['destlinkedid']};}}}catch(_0x4d04ce){logger['error'](_0x085b('0x41'),_0x4d04ce[_0x085b('0x38')]);}};Acw[_0x085b('0x18')][_0x085b('0x15')]=function(_0x2170ac){try{if(this['voiceQueues'][_0x2170ac[_0x085b('0x22')]]&&(this[_0x085b('0x6')][_0x2170ac[_0x085b('0x22')]][_0x085b('0x4')]||this['voiceQueues'][_0x2170ac['queue']][_0x085b('0x23')])){if(this['agents'][_0x2170ac['interface']]){this[_0x085b('0x20')][_0x2170ac[_0x085b('0x1c')]]={'queue':_0x2170ac[_0x085b('0x22')],'interface':_0x2170ac[_0x085b('0x21')]};}}}catch(_0x5248a5){logger[_0x085b('0x1f')](_0x085b('0x42'),_0x5248a5[_0x085b('0x38')]);}};Acw['prototype'][_0x085b('0x43')]=function(_0x2b49ce){try{if(this['channels'][_0x2b49ce[_0x085b('0x1c')]]&&_[_0x085b('0x44')](this[_0x085b('0x20')][_0x2b49ce[_0x085b('0x1c')]][_0x085b('0x2c')])){logger[_0x085b('0x29')]('[%s][HANGUP:UNIQUEID]',_0x2b49ce[_0x085b('0x1c')]);this[_0x085b('0x45')](_0x2b49ce[_0x085b('0x1c')]);}else if(this[_0x085b('0x20')][_0x2b49ce[_0x085b('0x46')]]&&_[_0x085b('0x44')](this['channels'][_0x2b49ce['linkedid']][_0x085b('0x2c')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x2b49ce[_0x085b('0x46')]);this[_0x085b('0x45')](_0x2b49ce['linkedid']);}}catch(_0x133ba8){logger['error'](_0x085b('0x47'),_0x133ba8['message']);}};Acw['prototype']['syncHangup']=function(_0x5df4a1){try{if(this[_0x085b('0x20')][_0x5df4a1[_0x085b('0x1c')]]&&this[_0x085b('0x20')][_0x5df4a1['uniqueid']][_0x085b('0x2c')]){logger['info'](_0x085b('0x48'),_0x5df4a1['uniqueid']);this[_0x085b('0x45')](_0x5df4a1[_0x085b('0x1c')]);}else if(this[_0x085b('0x20')][_0x5df4a1['linkedid']]&&this[_0x085b('0x20')][_0x5df4a1[_0x085b('0x46')]][_0x085b('0x2c')]){logger[_0x085b('0x29')](_0x085b('0x49'),_0x5df4a1[_0x085b('0x46')]);this[_0x085b('0x45')](_0x5df4a1[_0x085b('0x46')]);}}catch(_0x5e5264){logger[_0x085b('0x1f')](_0x085b('0x4a'),_0x5e5264[_0x085b('0x38')]);}};Acw['prototype'][_0x085b('0x11')]=function(_0x2ae844){try{if(!_[_0x085b('0x4b')](this[_0x085b('0x20')][_0x2ae844['transfereeuniqueid']])){this['startAcw'](_0x2ae844['transfereeuniqueid']);if(this[_0x085b('0x20')][_0x2ae844[_0x085b('0x4c')]]){this[_0x085b('0x20')][_0x2ae844['secondtransfereruniqueid']]['attended']=!![];this['channels'][_0x2ae844[_0x085b('0x4d')]]=this[_0x085b('0x20')][_0x2ae844[_0x085b('0x4c')]];delete this[_0x085b('0x20')][_0x2ae844[_0x085b('0x4c')]];}}else if(!_[_0x085b('0x4b')](this[_0x085b('0x20')][_0x2ae844[_0x085b('0x4d')]])){this[_0x085b('0x45')](_0x2ae844[_0x085b('0x4d')]);if(this['channels'][_0x2ae844['origtransfereruniqueid']]){this[_0x085b('0x20')][_0x2ae844[_0x085b('0x4e')]][_0x085b('0x2c')]=!![];this['channels'][_0x2ae844[_0x085b('0x4f')]]=this[_0x085b('0x20')][_0x2ae844[_0x085b('0x4e')]];delete this[_0x085b('0x20')][_0x2ae844['origtransfereruniqueid']];}}}catch(_0x13009f){logger['error'](_0x085b('0x50'),_0x13009f[_0x085b('0x38')]);}};Acw[_0x085b('0x18')][_0x085b('0x13')]=function(_0x41f2a5){try{if(this[_0x085b('0x20')][_0x41f2a5[_0x085b('0x51')]]){logger[_0x085b('0x29')](_0x085b('0x52'),JSON[_0x085b('0x40')](_0x41f2a5[_0x085b('0x51')]));this['startAcw'](_0x41f2a5['transfereruniqueid']);}else if(this[_0x085b('0x20')][_0x41f2a5['transfererlinkedid']]){logger[_0x085b('0x29')](_0x085b('0x53'),JSON[_0x085b('0x40')](_0x41f2a5[_0x085b('0x54')]));this[_0x085b('0x45')](_0x41f2a5[_0x085b('0x54')]);}}catch(_0x3cc993){logger[_0x085b('0x1f')](_0x085b('0x55'),_0x3cc993[_0x085b('0x38')]);}};Acw[_0x085b('0x18')][_0x085b('0x56')]=function(_0x2e64ac){try{if(this[_0x085b('0x6')][_0x2e64ac[_0x085b('0x22')]]&&this['voiceQueues'][_0x2e64ac[_0x085b('0x22')]][_0x085b('0x57')]===_0x085b('0x58')){if(this[_0x085b('0x7')][_0x2e64ac[_0x085b('0x21')]]){logger[_0x085b('0x29')](_0x085b('0x59'),_0x2e64ac[_0x085b('0x1c')],_0x2e64ac[_0x085b('0x21')],_0x2e64ac['queue']);return RpcUser[_0x085b('0x2e')](this[_0x085b('0x7')][_0x2e64ac['interface']],_0x085b('0x5a'),_0x2e64ac['uniqueid']);}}}catch(_0x4b01f5){logger[_0x085b('0x1f')](_0x085b('0x5b'),_0x4b01f5[_0x085b('0x38')]);}};module['exports']=Acw; \ No newline at end of file +var _0xae3c=['lodash','moment','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','updateAcw','lastPauseAt','timer','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','finally','queue','ACW','mandatoryDisposition','name','agents','getAgent','info','destlinkedid','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','error','message','[%s][TIMER][STOP][AGENT:%s]','then','pauseType','saveUnpause','catch','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','interface','[ACW][syncAgentConnect]\x20%s','attended','startAcw','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','exports'];(function(_0x547267,_0x2f5db3){var _0x5b93d5=function(_0x474a12){while(--_0x474a12){_0x547267['push'](_0x547267['shift']());}};_0x5b93d5(++_0x2f5db3);}(_0xae3c,0x19a));var _0xcae3=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0xae3c[_0x5f4cd7];return _0x47c93f;};'use strict';var _=require(_0xcae3('0x0'));var moment=require(_0xcae3('0x1'));var ami=require('../ami');var logger=require(_0xcae3('0x2'))(_0xcae3('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xcae3('0x4'));function Acw(_0x354e90){this[_0xcae3('0x5')]=_0x354e90[_0xcae3('0x5')];this['agents']=_0x354e90['agents'];this[_0xcae3('0x6')]=_0x354e90[_0xcae3('0x6')];this[_0xcae3('0x7')]={};ami['on']('agentconnect',this[_0xcae3('0x8')][_0xcae3('0x9')](this));ami['on'](_0xcae3('0xa'),this[_0xcae3('0xb')]['bind'](this));ami['on'](_0xcae3('0xc'),this[_0xcae3('0xd')][_0xcae3('0x9')](this));ami['on'](_0xcae3('0xe'),this[_0xcae3('0xf')][_0xcae3('0x9')](this));ami['on'](_0xcae3('0x10'),this[_0xcae3('0x11')][_0xcae3('0x9')](this));ami['on']('blindtransfer',this[_0xcae3('0x12')][_0xcae3('0x9')](this));ami['on'](_0xcae3('0x13'),this[_0xcae3('0x14')][_0xcae3('0x9')](this));}function getDiff(_0x2a5044){var _0xb8ebd0=moment()[_0xcae3('0x15')](0x0);var _0x4b38b4=moment(_0x2a5044)[_0xcae3('0x15')](0x0);return _0xb8ebd0[_0xcae3('0x16')](_0x4b38b4,'seconds');}Acw[_0xcae3('0x17')][_0xcae3('0x18')]=function(_0x55bec8,_0x58c932){var _0x48869f=this;var _0x54738b=getDiff(_0x48869f['timers'][_0x55bec8][_0xcae3('0x19')]);clearTimeout(_0x48869f[_0xcae3('0x6')][_0x55bec8][_0xcae3('0x1a')]);_0x48869f[_0xcae3('0x6')][_0x55bec8][_0xcae3('0x1a')]=![];return RpcVoiceAgentReport[_0xcae3('0x1b')]({'acwtime':_0x54738b},_0x48869f[_0xcae3('0x6')][_0x55bec8][_0xcae3('0x1c')],_0x55bec8)['then'](function(_0x16cbc5){logger['info'](_0xcae3('0x1d'),_0x58c932,_0x54738b,_0x16cbc5);})['catch'](function(_0x417920){logger['error'](_0xcae3('0x1e'),_0x58c932,_0x417920);})[_0xcae3('0x1f')](function(){delete _0x48869f['timers'][_0x55bec8];});};Acw[_0xcae3('0x17')]['startAcw']=function(_0x4be343){try{var _0xc3b73d=this;var _0x97b47f=this[_0xcae3('0x7')][_0x4be343]['interface'];var _0x539dd7=this[_0xcae3('0x7')][_0x4be343][_0xcae3('0x20')];var _0x3e0176=this[_0xcae3('0x5')][_0x539dd7];var _0x4b1d15=![];var _0x2b2114=_0xcae3('0x21');if(_0x3e0176[_0xcae3('0x22')]&&_0x3e0176['mandatoryDispositionPause'][_0xcae3('0x23')]){_0x4b1d15=!![];_0x2b2114=_0x3e0176['mandatoryDispositionPause']['name'];}if(!_0xc3b73d[_0xcae3('0x24')][_0x97b47f]){return Promise['resolve']();}return RpcUser[_0xcae3('0x25')](_0xc3b73d[_0xcae3('0x24')][_0x97b47f]['id'])['then'](function(_0x121b52){if(!_0x121b52||_0x121b52['voicePause']){logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x4be343,_0x97b47f,_0x539dd7);return;}logger[_0xcae3('0x26')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x4be343,_0x97b47f,_0x539dd7);var _0x574285=_0xc3b73d[_0xcae3('0x7')][_0x4be343]['attended']&&_0xc3b73d[_0xcae3('0x7')][_0x4be343]['destlinkedid']?_0xc3b73d[_0xcae3('0x7')][_0x4be343][_0xcae3('0x27')]:_0x4be343;return RpcUser['savePause'](_0xc3b73d[_0xcae3('0x24')][_0x97b47f],_0x2b2114,_0x574285)['then'](function(){_0xc3b73d[_0xcae3('0x5')][_0x539dd7][_0xcae3('0x28')]-=0x1;_0xc3b73d[_0xcae3('0x5')][_0x539dd7][_0xcae3('0x29')]+=0x1;});})['then'](function(_0x439665){if(_0x4b1d15||!_0x439665){return;}_0xc3b73d[_0xcae3('0x6')][_0x97b47f]={};logger['info'](_0xcae3('0x2a'),_0x4be343,_0xc3b73d[_0xcae3('0x5')][_0x539dd7][_0xcae3('0x2b')],_0x97b47f,_0x539dd7);_0xc3b73d[_0xcae3('0x6')][_0x97b47f][_0xcae3('0x1a')]=setTimeout(_0xc3b73d[_0xcae3('0x2c')][_0xcae3('0x9')](_0xc3b73d,_0x97b47f),_0xc3b73d[_0xcae3('0x5')][_0x539dd7][_0xcae3('0x2b')]*0x3e8);_0xc3b73d[_0xcae3('0x6')][_0x97b47f][_0xcae3('0x19')]=moment()[_0xcae3('0x2d')](_0xcae3('0x2e'));_0xc3b73d[_0xcae3('0x6')][_0x97b47f]['uniqueid']=_0x4be343;_0xc3b73d[_0xcae3('0x6')][_0x97b47f][_0xcae3('0x20')]=_0x539dd7;_0xc3b73d[_0xcae3('0x6')][_0x97b47f][_0xcae3('0x18')]=_0xc3b73d[_0xcae3('0x18')][_0xcae3('0x9')](_0xc3b73d,_0x97b47f,_0x4be343);})['catch'](function(){logger[_0xcae3('0x2f')](_0xcae3('0x2a'),_0x4be343,_0xc3b73d['voiceQueues'][_0x539dd7][_0xcae3('0x2b')],_0x97b47f,_0x539dd7);})[_0xcae3('0x1f')](function(){delete _0xc3b73d['channels'][_0x4be343];});}catch(_0x133089){logger['error']('[ACW][START]\x20%s',_0x133089[_0xcae3('0x30')]);}};Acw[_0xcae3('0x17')][_0xcae3('0x2c')]=function(_0x962744){try{var _0x1f51bf=this;if(_0x1f51bf[_0xcae3('0x6')][_0x962744]){_0x1f51bf[_0xcae3('0x6')][_0x962744][_0xcae3('0x1a')]=![];var _0x4490db=_0x1f51bf[_0xcae3('0x6')][_0x962744]['uniqueid'];var _0x15e98a=_0x1f51bf['timers'][_0x962744][_0xcae3('0x20')];var _0x211289=_0x1f51bf['voiceQueues'][_0x15e98a][_0xcae3('0x2b')];logger['info'](_0xcae3('0x31'),_0x4490db,_0x962744);RpcUser[_0xcae3('0x25')](this[_0xcae3('0x24')][_0x962744]['id'])[_0xcae3('0x32')](function(_0x411da3){if(_0x411da3[_0xcae3('0x33')]===_0xcae3('0x21')){return RpcUser[_0xcae3('0x34')](_0x1f51bf[_0xcae3('0x24')][_0x962744]);}});RpcVoiceAgentReport['update']({'acwtime':_0x211289,'agentacw':!![]},_0x4490db,_0x962744)[_0xcae3('0x32')](function(_0x5394b4){logger[_0xcae3('0x26')](_0xcae3('0x1d'),_0x4490db,_0x211289,_0x5394b4);})[_0xcae3('0x35')](function(_0x188ec7){logger[_0xcae3('0x2f')](_0xcae3('0x1e'),_0x4490db,_0x188ec7);});}else{logger[_0xcae3('0x2f')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x962744);if(_0x1f51bf['timers']){logger[_0xcae3('0x26')](_0xcae3('0x36'),JSON[_0xcae3('0x37')](_0x1f51bf[_0xcae3('0x6')]));}}}catch(_0x354702){logger[_0xcae3('0x2f')](_0xcae3('0x38'),_0x354702[_0xcae3('0x30')]);}};Acw[_0xcae3('0x17')]['syncAgentConnect']=function(_0x409c15){try{if(this[_0xcae3('0x5')][_0x409c15['queue']]&&(this['voiceQueues'][_0x409c15[_0xcae3('0x20')]][_0xcae3('0x3')]||this['voiceQueues'][_0x409c15[_0xcae3('0x20')]][_0xcae3('0x22')])){if(this[_0xcae3('0x24')][_0x409c15[_0xcae3('0x39')]]){this[_0xcae3('0x7')][_0x409c15[_0xcae3('0x1c')]]={'queue':_0x409c15['queue'],'interface':_0x409c15[_0xcae3('0x39')],'destlinkedid':_0x409c15[_0xcae3('0x27')]};}}}catch(_0x45f82b){logger[_0xcae3('0x2f')](_0xcae3('0x3a'),_0x45f82b[_0xcae3('0x30')]);}};Acw[_0xcae3('0x17')][_0xcae3('0x14')]=function(_0x57e9fa){try{if(this[_0xcae3('0x5')][_0x57e9fa[_0xcae3('0x20')]]&&(this[_0xcae3('0x5')][_0x57e9fa[_0xcae3('0x20')]][_0xcae3('0x3')]||this[_0xcae3('0x5')][_0x57e9fa[_0xcae3('0x20')]][_0xcae3('0x22')])){if(this[_0xcae3('0x24')][_0x57e9fa['interface']]){this[_0xcae3('0x7')][_0x57e9fa['uniqueid']]={'queue':_0x57e9fa[_0xcae3('0x20')],'interface':_0x57e9fa[_0xcae3('0x39')]};}}}catch(_0x426206){logger[_0xcae3('0x2f')]('[ACW][syncAgentConnectPreview]\x20%s',_0x426206[_0xcae3('0x30')]);}};Acw['prototype'][_0xcae3('0xb')]=function(_0x8898d7){try{if(this[_0xcae3('0x7')][_0x8898d7[_0xcae3('0x1c')]]&&_['isUndefined'](this['channels'][_0x8898d7[_0xcae3('0x1c')]][_0xcae3('0x3b')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x8898d7['uniqueid']);this[_0xcae3('0x3c')](_0x8898d7[_0xcae3('0x1c')]);}else if(this[_0xcae3('0x7')][_0x8898d7['linkedid']]&&_[_0xcae3('0x3d')](this[_0xcae3('0x7')][_0x8898d7[_0xcae3('0x3e')]][_0xcae3('0x3b')])){logger[_0xcae3('0x26')](_0xcae3('0x3f'),_0x8898d7[_0xcae3('0x3e')]);this['startAcw'](_0x8898d7['linkedid']);}}catch(_0x3506b8){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x3506b8[_0xcae3('0x30')]);}};Acw[_0xcae3('0x17')][_0xcae3('0xd')]=function(_0x136a5d){try{if(this['channels'][_0x136a5d[_0xcae3('0x1c')]]&&this['channels'][_0x136a5d[_0xcae3('0x1c')]][_0xcae3('0x3b')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x136a5d['uniqueid']);this[_0xcae3('0x3c')](_0x136a5d[_0xcae3('0x1c')]);}else if(this[_0xcae3('0x7')][_0x136a5d[_0xcae3('0x3e')]]&&this['channels'][_0x136a5d[_0xcae3('0x3e')]]['attended']){logger[_0xcae3('0x26')](_0xcae3('0x40'),_0x136a5d[_0xcae3('0x3e')]);this['startAcw'](_0x136a5d[_0xcae3('0x3e')]);}}catch(_0x4813d6){logger[_0xcae3('0x2f')]('[ACW][syncHangup]\x20%s',_0x4813d6[_0xcae3('0x30')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x3daa0f){try{if(!_[_0xcae3('0x41')](this['channels'][_0x3daa0f[_0xcae3('0x42')]])){this[_0xcae3('0x3c')](_0x3daa0f[_0xcae3('0x42')]);if(this[_0xcae3('0x7')][_0x3daa0f[_0xcae3('0x43')]]){this[_0xcae3('0x7')][_0x3daa0f[_0xcae3('0x43')]][_0xcae3('0x3b')]=!![];this[_0xcae3('0x7')][_0x3daa0f[_0xcae3('0x44')]]=this[_0xcae3('0x7')][_0x3daa0f['secondtransfereruniqueid']];delete this[_0xcae3('0x7')][_0x3daa0f[_0xcae3('0x43')]];}}else if(!_[_0xcae3('0x41')](this[_0xcae3('0x7')][_0x3daa0f[_0xcae3('0x44')]])){this[_0xcae3('0x3c')](_0x3daa0f[_0xcae3('0x44')]);if(this[_0xcae3('0x7')][_0x3daa0f[_0xcae3('0x45')]]){this['channels'][_0x3daa0f[_0xcae3('0x45')]][_0xcae3('0x3b')]=!![];this['channels'][_0x3daa0f['transfereeuniqueid']]=this['channels'][_0x3daa0f[_0xcae3('0x45')]];delete this[_0xcae3('0x7')][_0x3daa0f['origtransfereruniqueid']];}}}catch(_0x47ceee){logger[_0xcae3('0x2f')](_0xcae3('0x46'),_0x47ceee[_0xcae3('0x30')]);}};Acw[_0xcae3('0x17')]['syncBlindTransfer']=function(_0x579f93){try{if(this[_0xcae3('0x7')][_0x579f93['transfereruniqueid']]){logger[_0xcae3('0x26')](_0xcae3('0x47'),JSON['stringify'](_0x579f93['transfereruniqueid']));this[_0xcae3('0x3c')](_0x579f93[_0xcae3('0x48')]);}else if(this[_0xcae3('0x7')][_0x579f93[_0xcae3('0x49')]]){logger[_0xcae3('0x26')](_0xcae3('0x4a'),JSON[_0xcae3('0x37')](_0x579f93[_0xcae3('0x49')]));this[_0xcae3('0x3c')](_0x579f93['transfererlinkedid']);}}catch(_0x1474c2){logger[_0xcae3('0x2f')](_0xcae3('0x4b'),_0x1474c2[_0xcae3('0x30')]);}};Acw[_0xcae3('0x17')][_0xcae3('0xf')]=function(_0x2df0a6){try{if(this[_0xcae3('0x5')][_0x2df0a6[_0xcae3('0x20')]]&&this[_0xcae3('0x5')][_0x2df0a6[_0xcae3('0x20')]][_0xcae3('0x4c')]===_0xcae3('0x4d')){if(this['agents'][_0x2df0a6['interface']]){logger[_0xcae3('0x26')](_0xcae3('0x4e'),_0x2df0a6[_0xcae3('0x1c')],_0x2df0a6[_0xcae3('0x39')],_0x2df0a6[_0xcae3('0x20')]);return RpcUser[_0xcae3('0x4f')](this[_0xcae3('0x24')][_0x2df0a6[_0xcae3('0x39')]],_0xcae3('0x50'),_0x2df0a6[_0xcae3('0x1c')]);}}}catch(_0x4aad01){logger[_0xcae3('0x2f')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x4aad01[_0xcae3('0x30')]);}};module[_0xcae3('0x51')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 13c52fb..849abf7 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 _0x2de8=['actionCoreShowChannels','coreshowchannels','info','once','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionQueueSummary','catch','[ami.js][fullybooted]','close','asterisk-manager','bluebird','util','../../config/logger','../../config/environment','asterisk','password','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','port','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x2de8,0x15f));var _0x82de=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x2de8[_0x82129b];return _0x2ae5dc;};'use strict';var Manager=require(_0x82de('0x0'));var BPromise=require(_0x82de('0x1'));var util=require(_0x82de('0x2'));var logger=require(_0x82de('0x3'))('ami');var config=require(_0x82de('0x4'));var ami=new Manager(config['asterisk']['port'],config[_0x82de('0x5')]['ip'],config[_0x82de('0x5')]['username'],config[_0x82de('0x5')][_0x82de('0x6')],!![]);ami[_0x82de('0x7')]();ami[_0x82de('0x8')]=BPromise[_0x82de('0x9')](ami[_0x82de('0xa')]);function error(_0x43ef84){logger[_0x82de('0xb')](util[_0x82de('0xc')](_0x82de('0xd'),config[_0x82de('0x5')]['username'],config[_0x82de('0x5')]['ip'],config['asterisk']['port'],util[_0x82de('0xe')](_0x43ef84,![],null)));}function close(){logger[_0x82de('0xb')](util[_0x82de('0xc')](_0x82de('0xf'),config['asterisk'][_0x82de('0x10')],config[_0x82de('0x5')]['ip'],config[_0x82de('0x5')][_0x82de('0x11')]));}ami[_0x82de('0x12')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0x82de('0x13')]=function(){return function(){return ami['Action']({'action':_0x82de('0x14')});};};ami[_0x82de('0x15')]=function(){return function(){return ami['Action']({'action':_0x82de('0x16')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x82de('0x8')]({'action':'queuesummary'});};};ami[_0x82de('0x17')]=function(){return function(){return ami[_0x82de('0x8')]({'action':_0x82de('0x18')});};};function connect(){logger[_0x82de('0x19')](util[_0x82de('0xc')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x82de('0x5')][_0x82de('0x10')],config[_0x82de('0x5')]['ip'],config[_0x82de('0x5')][_0x82de('0x11')]));ami[_0x82de('0x1a')](_0x82de('0xb'),error);ami[_0x82de('0x1a')]('close',close);}ami['on']('connect',connect);ami['on'](_0x82de('0x1b'),function(_0x12ed96){logger[_0x82de('0x19')](util[_0x82de('0xc')](_0x82de('0x1c'),config['asterisk'][_0x82de('0x10')],config[_0x82de('0x5')]['ip'],config[_0x82de('0x5')][_0x82de('0x11')],util[_0x82de('0xe')](_0x12ed96,![],null)));});ami['on']('fullybooted',function(){logger[_0x82de('0x19')](util[_0x82de('0xc')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x82de('0x5')][_0x82de('0x10')],config[_0x82de('0x5')]['ip'],config['asterisk'][_0x82de('0x11')]));return Promise['resolve']()[_0x82de('0x1d')](ami[_0x82de('0x12')]())[_0x82de('0x1d')](ami[_0x82de('0x13')]())[_0x82de('0x1d')](ami[_0x82de('0x15')]())[_0x82de('0x1d')](ami[_0x82de('0x1e')]())[_0x82de('0x1d')](ami[_0x82de('0x17')]())[_0x82de('0x1f')](function(_0x21f23f){logger['error'](_0x82de('0x20'),util[_0x82de('0xe')](_0x21f23f,{'showHidden':![],'depth':null}));});});ami[_0x82de('0x1a')](_0x82de('0xb'),error);ami['once'](_0x82de('0x21'),close);module['exports']=ami; \ No newline at end of file +var _0x8b12=['sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','catch','bluebird','util','../../config/logger','asterisk','port','username','password','keepConnected','Action','promisify','error','format','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus'];(function(_0x49e02b,_0x17a0ed){var _0x38e779=function(_0x463ed0){while(--_0x463ed0){_0x49e02b['push'](_0x49e02b['shift']());}};_0x38e779(++_0x17a0ed);}(_0x8b12,0x1c2));var _0x28b1=function(_0x59f0c4,_0x443d24){_0x59f0c4=_0x59f0c4-0x0;var _0x2ee8c6=_0x8b12[_0x59f0c4];return _0x2ee8c6;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x28b1('0x0'));var util=require(_0x28b1('0x1'));var logger=require(_0x28b1('0x2'))('ami');var config=require('../../config/environment');var ami=new Manager(config[_0x28b1('0x3')][_0x28b1('0x4')],config[_0x28b1('0x3')]['ip'],config['asterisk'][_0x28b1('0x5')],config[_0x28b1('0x3')][_0x28b1('0x6')],!![]);ami[_0x28b1('0x7')]();ami[_0x28b1('0x8')]=BPromise[_0x28b1('0x9')](ami['action']);function error(_0x561002){logger[_0x28b1('0xa')](util[_0x28b1('0xb')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x28b1('0x3')][_0x28b1('0x5')],config[_0x28b1('0x3')]['ip'],config['asterisk'][_0x28b1('0x4')],util[_0x28b1('0xc')](_0x561002,![],null)));}function close(){logger['error'](util[_0x28b1('0xb')](_0x28b1('0xd'),config['asterisk'][_0x28b1('0x5')],config[_0x28b1('0x3')]['ip'],config[_0x28b1('0x3')]['port']));}ami[_0x28b1('0xe')]=function(){return function(){return ami['Action']({'action':_0x28b1('0xf')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x28b1('0x8')]({'action':_0x28b1('0x10')});};};ami[_0x28b1('0x11')]=function(){return function(){return ami[_0x28b1('0x8')]({'action':_0x28b1('0x12')});};};ami[_0x28b1('0x13')]=function(){return function(){return ami[_0x28b1('0x8')]({'action':_0x28b1('0x14')});};};ami[_0x28b1('0x15')]=function(){return function(){return ami[_0x28b1('0x8')]({'action':_0x28b1('0x16')});};};function connect(){logger[_0x28b1('0x17')](util[_0x28b1('0xb')](_0x28b1('0x18'),config[_0x28b1('0x3')][_0x28b1('0x5')],config[_0x28b1('0x3')]['ip'],config['asterisk']['port']));ami[_0x28b1('0x19')](_0x28b1('0xa'),error);ami[_0x28b1('0x19')](_0x28b1('0x1a'),close);}ami['on'](_0x28b1('0x1b'),connect);ami['on'](_0x28b1('0x1c'),function(_0x2dce10){logger[_0x28b1('0x17')](util[_0x28b1('0xb')](_0x28b1('0x1d'),config[_0x28b1('0x3')][_0x28b1('0x5')],config[_0x28b1('0x3')]['ip'],config[_0x28b1('0x3')]['port'],util[_0x28b1('0xc')](_0x2dce10,![],null)));});ami['on'](_0x28b1('0x1e'),function(){logger[_0x28b1('0x17')](util[_0x28b1('0xb')](_0x28b1('0x1f'),config['asterisk'][_0x28b1('0x5')],config[_0x28b1('0x3')]['ip'],config['asterisk'][_0x28b1('0x4')]));return Promise[_0x28b1('0x20')]()[_0x28b1('0x21')](ami[_0x28b1('0xe')]())[_0x28b1('0x21')](ami[_0x28b1('0x22')]())[_0x28b1('0x21')](ami[_0x28b1('0x11')]())[_0x28b1('0x21')](ami[_0x28b1('0x13')]())[_0x28b1('0x21')](ami[_0x28b1('0x15')]())[_0x28b1('0x23')](function(_0x44c984){logger[_0x28b1('0xa')]('[ami.js][fullybooted]',util[_0x28b1('0xc')](_0x44c984,{'showHidden':![],'depth':null}));});});ami['once'](_0x28b1('0xa'),error);ami[_0x28b1('0x19')](_0x28b1('0x1a'),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 85ffef2..acac1c9 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 _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x128a73,_0x26c676){var _0x210caa=function(_0x47ac0f){while(--_0x47ac0f){_0x128a73['push'](_0x128a73['shift']());}};_0x210caa(++_0x26c676);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file +var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x1f0679,_0x53d43c){var _0x3dc3a4=function(_0x49ba8f){while(--_0x49ba8f){_0x1f0679['push'](_0x1f0679['shift']());}};_0x3dc3a4(++_0x53d43c);}(_0xe706,0xa3));var _0x6e70=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe706[_0x3b380d];return _0x54502b;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index d96a54d..cbbcb2b 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 _0x4673=['originated','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','stringify','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','Trunk','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','prototype','checkIfTimeIntervals','ifTime','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','Failure','\x20Timezone\x20unknow\x20','isArray','push','Action','format','iftime\x20%s,%s','content','indexOf','catch','command','true','all','some','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','undefined','isIVRCampaign','resolve','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','launchHandleIvr','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_GLOBAL_INTERVAL','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','queue','uniqueId','uniqueid','ivr','updateOriginated','answertime','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncQueueCallerAbandon','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','countdropretry','countglobal','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','rescheduleContact','add','dialDropRetryFrequency','minutes','ListId','CampaignId','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','queueCallerAbandonCreateState','countabandonedretry','ContactId','VoiceQueueId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','rrmemory','isNil','locked','paused','stateinterface','strategy','roundrobin','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','finally','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','responsetime','getQueue','response','Success','callProgressDetecting','variable','amdstatus','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','custom:amd','[syncAgentComplete][createHistory][0]','countnoanswerretry','countagentrejectretry','dialGlobalMaxRetry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[syncHangupInAMDIvr][createHistory]','countbusyretry','countcongestionretry','countnosuchnumberretry','stateGlobal','reason19\x20machine....','[rescheduleContact][Machine]','[syncHangupIvr][createHistory]','moveContactManagedDialer','[syncHangupIvr]','dialQueueProject','outboundUnknownCallsDay','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','talking','pTalking','ACTIVE','[syncQueueSummary]','queueSummaryCountersUpdated','assign','filter','dialPreviewRecallmeReminder','online','length','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','emptyContact','notFound','saveInDb','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','handleIvr','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','custom:agentnosuchnumber','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','checkRetriveMax','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','reason\x205\x20busy','outboundCongestionCallsDay','congestion','dialCongestionMaxRetry','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','available','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','Predictive\x20after\x20first\x20interval','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','dialPredictiveOptimization','abandonmentRate','busyFactor','[getDataPredictive]','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','erlangCallToSecond','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','dialRecallMeTimeout','voicePause','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','checkContactEmpty','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkContactBlack','dialLimitQueue','not_inuse','countReScheduled','[countReScheduled]\x20','checkIsBlackList','loggerHandler','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','dialOrderByScheduledAt','[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','p\x20=\x20','Amax\x20=\x20','erlangb','----\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]','interval\x20=\x20','util','lodash','moment','ioredis','./utils','./utils/hopper','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/setting','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','syncAgentConnect','bind','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','isUndefined','emit','type','outbound','debug','inspect','voice_queue:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','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','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','---------\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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','getSeconds','name','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','temp','message','CAMPAIGN_STATUS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','campaign:ivr:%s','campaign:save','sendMessageOneNotActive'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0x4673,0x199));var _0x3467=function(_0x1cf913,_0x2e9e0){_0x1cf913=_0x1cf913-0x0;var _0xeb972f=_0x4673[_0x1cf913];return _0xeb972f;};'use strict';var util=require(_0x3467('0x0'));var _=require(_0x3467('0x1'));var uuid=require('uuid');var moment=require(_0x3467('0x2'));var rr=require('rr');var Redis=require(_0x3467('0x3'));var utils=require(_0x3467('0x4'));var hopperUtils=require(_0x3467('0x5'));var ut=require('../preview/util/util');var config=require(_0x3467('0x6'));var logger=require(_0x3467('0x7'))(_0x3467('0x8'));var loggerBooked=require(_0x3467('0x7'))(_0x3467('0x9'));var loggerPredictive=require(_0x3467('0x7'))(_0x3467('0xa'));var loggerPredictiveCalls=require(_0x3467('0x7'))(_0x3467('0xb'));var loggerSyncQueueSummary=require(_0x3467('0x7'))(_0x3467('0xc'));var ami=require(_0x3467('0xd'));config[_0x3467('0xe')]=_[_0x3467('0xf')](config[_0x3467('0xe')],{'host':_0x3467('0x10'),'port':0x18eb});var io=require(_0x3467('0x11'))(new Redis(config[_0x3467('0xe')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x3467('0x12'));var Interval=require('../rpc/interval');var Action=require('./models/action');var History=require('./models/history');var Final=require(_0x3467('0x13'));var AgentComplete=require(_0x3467('0x14'));var QueueCallerAbandon=require(_0x3467('0x15'));var Hangup=require(_0x3467('0x16'));var ipAgi=process[_0x3467('0x17')][_0x3467('0x18')]||_0x3467('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0x3467('0x1a')]=function(_0xb4fcab){this[_0x3467('0x1b')]=this['tail']?this[_0x3467('0x1b')]['finally'](_0xb4fcab):_0xb4fcab();};function Dialer(_0x2be7d9,_0x322e9a){this[_0x3467('0x1c')]=new Sequence();this[_0x3467('0x1d')]=_0x322e9a;this[_0x3467('0x1e')]=_0x2be7d9['voiceQueues'];this[_0x3467('0x1f')]=_0x2be7d9['campaigns'];this[_0x3467('0x20')]=_0x2be7d9[_0x3467('0x20')];this[_0x3467('0x21')]=_0x2be7d9[_0x3467('0x21')];this[_0x3467('0x22')]=config[_0x3467('0x22')]||0x2;this[_0x3467('0x23')]={};this[_0x3467('0x24')]={};this[_0x3467('0x25')]={};this['uniqueId']={};this[_0x3467('0x26')]={};this[_0x3467('0x27')]={};this[_0x3467('0x28')]={};this[_0x3467('0x29')]={};this[_0x3467('0x2a')]={};this[_0x3467('0x2b')]={};this[_0x3467('0x2c')]={};ami['on']('agentconnect',this[_0x3467('0x2d')][_0x3467('0x2e')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x3467('0x2e')](this));ami['on'](_0x3467('0x2f'),this['syncOriginateResponse'][_0x3467('0x2e')](this));ami['on'](_0x3467('0x30'),this[_0x3467('0x31')][_0x3467('0x2e')](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0x3467('0x2e')](this));ami['on'](_0x3467('0x32'),this[_0x3467('0x33')]['bind'](this));ami['on'](_0x3467('0x34'),this[_0x3467('0x35')]['bind'](this));ami['on'](_0x3467('0x36'),this[_0x3467('0x37')][_0x3467('0x2e')](this));ami['on'](_0x3467('0x38'),this[_0x3467('0x39')][_0x3467('0x2e')](this));ami['on'](_0x3467('0x3a'),this[_0x3467('0x3b')][_0x3467('0x2e')](this));ami['on'](_0x3467('0x3c'),this[_0x3467('0x3d')][_0x3467('0x2e')](this));this['loopCampaigns']();this[_0x3467('0x3e')]();RpcSetting[_0x3467('0x3f')]()[_0x3467('0x40')](function(_0x5a598c){previewRecallmeReminderInterval=_0x5a598c['previewRecallmeReminderInterval'];});}function isNotNull(_0x8a6c0e){return _0x8a6c0e!==null&&!_[_0x3467('0x41')](_0x8a6c0e);}function msgResponse(_0x1e41d7,_0x30dc4b,_0x36785a){return{'action':_0x1e41d7,'response':_0x30dc4b,'message':_0x36785a,'stack':_0x36785a};}function emit(_0x4154d2,_0x36e618,_0xa35127){io['to'](_0x4154d2)[_0x3467('0x42')](_0x36e618,_0xa35127);}function emitOutboundVoiceQueueSummary(_0x2f9f50){if(_0x2f9f50[_0x3467('0x43')]===_0x3467('0x44')){logger[_0x3467('0x45')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x3467('0x46')](_0x2f9f50,{'showHidden':![],'depth':null}));emit(util['format']('voice:queue:%s',_0x2f9f50['name']),_0x3467('0x47'),_0x2f9f50);}}function checkGetDataPredictive(_0x201fb3){if(isNotNull(_0x201fb3)&&!_[_0x3467('0x48')](_0x201fb3)){loggerPredictive['info'](_0x3467('0x49'));loggerPredictive[_0x3467('0x4a')](_0x3467('0x4b'),_0x201fb3[_0x3467('0x4c')]);loggerPredictive[_0x3467('0x4a')](_0x3467('0x4d'),_0x201fb3['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x3467('0x4a')](_0x3467('0x4e'),_0x201fb3[_0x3467('0x4f')]);loggerPredictive[_0x3467('0x4a')](_0x3467('0x50'),_0x201fb3[_0x3467('0x51')]);loggerPredictive[_0x3467('0x4a')](_0x3467('0x52'),_0x201fb3['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x3467('0x4a')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x201fb3[_0x3467('0x53')]);loggerPredictive[_0x3467('0x4a')](_0x3467('0x54'));if(_0x201fb3['predictiveIntervalTotalCalls']>0x0){if(!_[_0x3467('0x41')](_0x201fb3[_0x3467('0x53')])&&_0x201fb3['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x3467('0x41')](_0x201fb3[_0x3467('0x55')])&&_0x201fb3[_0x3467('0x55')]>0x0){return!![];}loggerPredictive[_0x3467('0x4a')](_0x3467('0x56'));}else{loggerPredictive[_0x3467('0x4a')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x3467('0x4a')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x3e285f){return function(_0x2862be){loggerPredictive['info'](_0x3467('0x57'));loggerPredictive[_0x3467('0x4a')](_0x3467('0x58'),_0x2862be[_0x3467('0x59')]);loggerPredictive[_0x3467('0x4a')](_0x3467('0x5a'),_0x2862be['erlangCallToSecond']);loggerPredictive[_0x3467('0x4a')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2862be[_0x3467('0x5b')]);loggerPredictive[_0x3467('0x4a')](_0x3467('0x5c'),_0x2862be[_0x3467('0x5d')]);loggerPredictive[_0x3467('0x4a')](_0x3467('0x5e'),_0x2862be['erlangAbandonmentRate']);loggerPredictive[_0x3467('0x4a')](_0x3467('0x54'));_[_0x3467('0x5f')](_0x3e285f,_0x2862be);};}function ifInterval(_0x4e0293,_0x553a75){if(_[_0x3467('0x41')](_0x553a75)){return![];}return utils[_0x3467('0x60')](undefined,_0x553a75)<_0x4e0293*0x3c;}function clearPredictiveAttributes(_0xc5f6f8){if(_0xc5f6f8[_0x3467('0x28')]){_0xc5f6f8[_0x3467('0x28')]=undefined;loggerPredictive['debug'](_0xc5f6f8[_0x3467('0x61')],_0x3467('0x62'));}if(_0xc5f6f8[_0x3467('0x27')]){_0xc5f6f8[_0x3467('0x27')]=undefined;loggerPredictive[_0x3467('0x45')](_0xc5f6f8[_0x3467('0x61')],_0x3467('0x63'));}if(_0xc5f6f8[_0x3467('0x64')]){clearInterval(_0xc5f6f8[_0x3467('0x64')]);_0xc5f6f8['handlePredictive']=undefined;loggerPredictive[_0x3467('0x45')](_0xc5f6f8[_0x3467('0x61')],_0x3467('0x65'));}}function loggerCatchPredictive(_0x17e98b,_0x345d78){return function(_0x47bee1){loggerPredictive[_0x3467('0x66')](_0x345d78['name'],_0x17e98b);loggerPredictive['error'](_0x47bee1['stack']);clearPredictiveAttributes(_0x345d78);};}function loggerCatch(_0x1a0f13){return function(_0x46d248){logger[_0x3467('0x66')](_0x1a0f13,util[_0x3467('0x46')](_0x46d248,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x459f72,_0xcd9ccd,_0xaa436f){return function(_0x2ec50e){utils[_0x3467('0x67')](_0xcd9ccd,_0xaa436f,0x0);_0xcd9ccd[_0x3467('0x68')]=0x0;logger['error'](_0x459f72,util[_0x3467('0x46')](_0x2ec50e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x23e396){return function(_0x5653a3){if(isNotNull(_0x5653a3)&&isNotNull(_0x5653a3[0x0])){if(_0x5653a3[0x0]['contactsRescheduled']>0x0){_0x23e396[_0x3467('0x69')]=utils[_0x3467('0x6a')]['CONTACTS_RESCHEDULED'];logger[_0x3467('0x4a')](_0x3467('0x6b')+_0x23e396[_0x3467('0x61')],_0x5653a3[0x0][_0x3467('0x6c')],_0x3467('0x6d'));}else{_0x23e396[_0x3467('0x69')]=utils[_0x3467('0x6a')][_0x3467('0x6e')];logger[_0x3467('0x4a')](_0x3467('0x6f')+_0x23e396[_0x3467('0x61')]);}}};}function createObjHistory(_0x4de2e7,_0x52eee2,_0x1458ae,_0x39b17a,_0x13790a){_0x4de2e7[_0x3467('0x69')]=_0x1458ae;var _0x31a2ab=new Action(_0x4de2e7,_0x52eee2);var _0x2d9cf0=new History(_0x31a2ab);_0x2d9cf0[_0x3467('0x70')]=_0x39b17a;_0x2d9cf0[_0x3467('0x71')]=_0x13790a;_0x2d9cf0[_0x3467('0x72')]=_0x31a2ab['starttime'];return _0x2d9cf0;}function unlockQueueStatus(_0x4ab353,_0x556d12){setTimeout(function(){if(_[_0x3467('0x41')](_0x4ab353[_0x3467('0x73')])){loggerBooked[_0x3467('0x66')](_0x3467('0x74'),_0x556d12);}_0x4ab353[_0x3467('0x73')]=!![];loggerBooked[_0x3467('0x4a')](_0x3467('0x75'),_0x556d12,JSON['stringify'](_[_0x3467('0x76')](_0x4ab353,[_0x3467('0x61'),_0x3467('0x73')])));},0x1f3);}function checkInterval(_0x47a6dc){return function(){if(!isNotNull(_0x47a6dc[_0x3467('0x77')])){_0x47a6dc[_0x3467('0x69')]=utils['CAMPAIGN_STATUS'][_0x3467('0x78')];throw _0x47a6dc[_0x3467('0x61')]+_0x3467('0x79');}if(!isNotNull(_0x47a6dc['Interval'][_0x3467('0x7a')])){_0x47a6dc[_0x3467('0x69')]=utils[_0x3467('0x6a')][_0x3467('0x78')];throw _0x47a6dc['name']+_0x3467('0x79');}if(!isNotNull(_[_0x3467('0x48')](_0x47a6dc[_0x3467('0x77')]['Intervals']))){_0x47a6dc['message']=utils['CAMPAIGN_STATUS'][_0x3467('0x78')];throw _0x47a6dc[_0x3467('0x61')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x2a4c3f){return function(){if(!utils[_0x3467('0x7b')](_0x2a4c3f)){_0x2a4c3f['message']=utils[_0x3467('0x6a')][_0x3467('0x7c')];throw _0x2a4c3f['name']+_0x3467('0x7d');}};}function emitCampaignSummary(_0x303b45){if(utils['isIVRCampaign'](_0x303b45)){emit(util['format'](_0x3467('0x7e'),_0x303b45[_0x3467('0x61')]),_0x3467('0x7f'),_0x303b45);}}function loggerCatchQueueSummary(_0x28d7d8,_0xe6e4c7){return function(_0x1f24ef){clearPredictiveAttributes(_0xe6e4c7);emitCampaignSummary(_0xe6e4c7);loggerSyncQueueSummary[_0x3467('0x45')](_0x28d7d8,util[_0x3467('0x46')](_0x1f24ef,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x4ea53b){if(_0x4ea53b[_0x3467('0x80')]){if(_0x4ea53b[_0x3467('0x81')]===0x0){_0x4ea53b[_0x3467('0x80')]=![];_0x4ea53b[_0x3467('0x69')]=utils[_0x3467('0x6a')][_0x3467('0x7c')];loggerSyncQueueSummary[_0x3467('0x45')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4ea53b[_0x3467('0x61')],'is\x20not\x20active');}else{_0x4ea53b[_0x3467('0x69')]=utils[_0x3467('0x6a')][_0x3467('0x82')];loggerSyncQueueSummary[_0x3467('0x45')](_0x3467('0x83'),_0x4ea53b[_0x3467('0x61')],_0x3467('0x84'));}emitCampaignSummary(_0x4ea53b);}}function myreject(_0x3d15ab){return function(_0x176702){return _0x3d15ab(msgResponse(_0x3467('0x85'),_0x3467('0x86'),JSON[_0x3467('0x87')](_0x176702)));};}Dialer['prototype'][_0x3467('0x88')]=function(_0x486625){return!_['isUndefined'](_0x486625)&&_0x486625&&!_[_0x3467('0x41')](_0x486625[_0x3467('0x61')])&&!_[_0x3467('0x41')](_0x486625[_0x3467('0x89')])&&_0x486625[_0x3467('0x89')]&&(this['trunks'][util['format'](_0x3467('0x8a'),_0x486625['name'])][_0x3467('0x8b')]===_0x3467('0x8c')||this[_0x3467('0x21')][util['format'](_0x3467('0x8a'),_0x486625[_0x3467('0x61')])]['status']===_0x3467('0x8d'));};Dialer['prototype']['checkIsTrunkReachable']=function(_0x364e6d){var _0x33966e=this;return function(){if(!_0x33966e[_0x3467('0x88')](_0x364e6d[_0x3467('0x8e')])){if(!_0x33966e['isTrunkReachable'](_0x364e6d['TrunkBackup'])){_0x364e6d[_0x3467('0x69')]=utils[_0x3467('0x6a')]['TRUNK_NOT_REACHABLE'];throw _0x364e6d[_0x3467('0x61')]+_0x3467('0x8f');}}};};Dialer['prototype'][_0x3467('0x90')]=function(_0x418eb3,_0x3b3824,_0x176d9c,_0x3976d9){var _0x5786aa=this;return function(){var _0x354a56=!![];return _0x5786aa[_0x3467('0x91')](_0x418eb3,_0x3b3824,_0x176d9c,_0x3976d9,_0x354a56);};};Dialer[_0x3467('0x92')][_0x3467('0x93')]=function(_0x10967b,_0x58600e,_0x400e8d,_0x23ede3){var _0x276ad2=this;return function(){var _0x12bb11=![];return _0x276ad2['ifTimeIvr'](_0x10967b[_0x3467('0x7a')],_0x58600e,_0x400e8d,_0x23ede3,_0x12bb11);};};Dialer[_0x3467('0x92')]['ifTimeIvr']=function(_0xe24476,_0x32d311,_0x2a6cfe,_0x39794c,_0x3632c0){var _0x103ab6=[];return new Promise(function(_0x8b9e4f,_0x3816a2){if(!isNotNull(_0xe24476)){_0x39794c[_0x3467('0x69')]=utils[_0x3467('0x6a')][_0x3467('0x78')];return _0x3816a2(msgResponse(_0x3467('0x94'),'Failure',_0x2a6cfe+_0x3467('0x95')));}if(_[_0x3467('0x48')](_0xe24476)){_0x39794c[_0x3467('0x69')]=utils[_0x3467('0x6a')][_0x3467('0x96')];return _0x3816a2(msgResponse(_0x3467('0x94'),'Failure',_0x2a6cfe+_0x3467('0x97')));}if(_0x32d311&&_[_0x3467('0x41')](config[_0x3467('0x98')][_0x32d311])){_0x39794c[_0x3467('0x69')]=utils[_0x3467('0x6a')][_0x3467('0x99')];return _0x3816a2(msgResponse('ifTime',_0x3467('0x9a'),_0x2a6cfe+_0x3467('0x9b')+_0x32d311));}if(_[_0x3467('0x9c')](_0xe24476)){for(var _0x34bc3b=0x0;_0x34bc3b<_0xe24476['length'];_0x34bc3b+=0x1){_0x103ab6[_0x3467('0x9d')](ami[_0x3467('0x9e')]({'action':'command','command':util[_0x3467('0x9f')](_0x3467('0xa0'),_0xe24476[_0x34bc3b]['interval'],!_['isUndefined'](config['timezones'][_0x32d311])?_0x32d311:'')})[_0x3467('0x40')](function(_0x18f963){return _0x18f963[_0x3467('0xa1')][_0x3467('0xa2')]('true')>=0x0;})[_0x3467('0xa3')](myreject(_0x3816a2)));}}else{_0x103ab6[_0x3467('0x9d')](ami[_0x3467('0x9e')]({'action':_0x3467('0xa4'),'command':util[_0x3467('0x9f')]('iftime\x20%s,%s',_0xe24476,!_[_0x3467('0x41')](config['timezones'][_0x32d311])?_0x32d311:'')})[_0x3467('0x40')](function(_0x53e864){return _0x53e864['content'][_0x3467('0xa2')](_0x3467('0xa5'))>=0x0;})[_0x3467('0xa3')](myreject(_0x3816a2)));}Promise[_0x3467('0xa6')](_0x103ab6)[_0x3467('0x40')](function(_0x30dfcc){var _0x2a7e26=_[_0x3467('0xa7')](_0x30dfcc);if(_0x2a7e26){return _0x8b9e4f(_0x2a7e26);}else{_0x39794c[_0x3467('0x69')]=_0x3632c0?utils[_0x3467('0x6a')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x3467('0x6a')][_0x3467('0xa8')];return _0x3816a2(msgResponse(_0x3467('0xa9'),_0x3467('0x9a'),_0x3467('0xaa')+_0x3632c0+'\x20'+_0x2a6cfe+_0x3467('0xab')+util['inspect'](_0xe24476,{'showHidden':![],'depth':null})+_0x3467('0xac')+_0x32d311));}})[_0x3467('0xa3')](function(_0x398f16){return _0x3816a2(msgResponse(_0x3467('0x94'),'Failure',JSON[_0x3467('0x87')](_0x398f16)));});});};Dialer[_0x3467('0x92')][_0x3467('0xad')]=function(){var _0x374206=this;return cmHopper[_0x3467('0xae')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x374206[_0x3467('0xaf')]();},0x3e8);});};Dialer['prototype']['syncCampaigns']=function(){var _0xab2cef=this;var _0x2ba1d0;for(var _0x419496 in this[_0x3467('0x1f')]){if(typeof this[_0x3467('0x1f')][_0x419496]!==_0x3467('0xb0')){_0x2ba1d0=this['campaigns'][_0x419496];if(utils[_0x3467('0xb1')](_0x2ba1d0)&&utils[_0x3467('0x7b')](_0x2ba1d0)){_0x2ba1d0[_0x3467('0x80')]=!![];Promise[_0x3467('0xb2')]()[_0x3467('0x40')](checkIsIVRCampaignActive(_0x2ba1d0))['then'](checkInterval(_0x2ba1d0))['then'](_0xab2cef[_0x3467('0xb3')](_0x2ba1d0))[_0x3467('0x40')](_0xab2cef[_0x3467('0x90')](_0x2ba1d0[_0x3467('0xb4')],_0x2ba1d0[_0x3467('0xb5')],_0x2ba1d0[_0x3467('0x61')],_0x2ba1d0))[_0x3467('0x40')](_0xab2cef[_0x3467('0x93')](_0x2ba1d0[_0x3467('0x77')],_0x2ba1d0[_0x3467('0xb5')],_0x2ba1d0[_0x3467('0x61')],_0x2ba1d0))[_0x3467('0x40')](_0xab2cef[_0x3467('0xb6')](_0x2ba1d0))[_0x3467('0xa3')](loggerCatchQueueSummary('[syncCampaigns]',_0x2ba1d0));}else{notSendMessagesCampaign(_0x2ba1d0);}}}};Dialer[_0x3467('0x92')][_0x3467('0xb7')]=function(_0x5c02f1){if(_0x5c02f1[_0x3467('0xb8')]!==_0x3467('0xa')){clearPredictiveAttributes(_0x5c02f1);}switch(_0x5c02f1['dialMethod']){case _0x3467('0xb9'):this[_0x3467('0xba')](_0x5c02f1,0x1);break;case _0x3467('0xbb'):this[_0x3467('0xba')](_0x5c02f1,_0x5c02f1[_0x3467('0xbc')]);break;case _0x3467('0xa'):this[_0x3467('0xa')](_0x5c02f1);break;case _0x3467('0x9'):this[_0x3467('0xba')](_0x5c02f1,0x1);break;default:logger[_0x3467('0x66')](_0x3467('0xbd'),_0x5c02f1[_0x3467('0x61')],_0x3467('0xbe'));}};Dialer['prototype']['ifTime']=function(_0x2e3161,_0x29cc33){var _0x2738fd=_0x2e3161[_0x3467('0xb5')];var _0x31905a=_0x29cc33?_0x2e3161[_0x3467('0xb4')]:_0x2e3161[_0x3467('0x77')]['Intervals'];logger[_0x3467('0xbf')]('Dialer::ifTime()',_0x31905a,_0x2738fd,_0x2e3161[_0x3467('0x61')],util['format'](_0x3467('0xc0'),_0x2e3161['name'],_0x2e3161['id']));var _0x452ec4=null;return Interval[_0x3467('0xc1')](_0x31905a,_0x2738fd)['then'](function(_0xb498a4){if(_0xb498a4===!![]){return _0xb498a4;}else{_0x2e3161[_0x3467('0x69')]=_0x29cc33?utils[_0x3467('0x6a')][_0x3467('0xc2')]:utils[_0x3467('0x6a')]['OVERTIME_INTERVAL'];_0x452ec4=msgResponse(_0x3467('0xa9'),_0x3467('0x9a'),'Global:\x20'+_0x29cc33+'\x20'+_0x2e3161[_0x3467('0x61')]+'\x20Interval\x20is\x20overtime:\x20'+util[_0x3467('0x46')](_0x31905a,{'showHidden':![],'depth':null})+_0x3467('0xac')+_0x2738fd);}if(_0x452ec4!==null){logger[_0x3467('0xbf')](_0x3467('0xc3'),_0x452ec4);_0x452ec4['isGlobal']=_0x29cc33;throw _0x452ec4;}})[_0x3467('0xa3')](function(_0x5c76b7){logger[_0x3467('0x66')](_0x3467('0xc4'),_0x5c76b7);throw msgResponse(_0x3467('0x85'),_0x3467('0x86'),util[_0x3467('0x46')](_0x5c76b7,{'showHidden':![],'depth':null}));});};Dialer[_0x3467('0x92')][_0x3467('0x2d')]=function(_0x8d19e4){if(this[_0x3467('0x1e')][_0x8d19e4[_0x3467('0xc5')]]){if(this[_0x3467('0xc6')][_0x8d19e4[_0x3467('0xc7')]]&&this['uniqueId'][_0x8d19e4['uniqueid']][_0x3467('0x43')]!==_0x3467('0xc8')){this[_0x3467('0xc9')](this[_0x3467('0x1e')][_0x8d19e4[_0x3467('0xc5')]]);this[_0x3467('0xc6')][_0x8d19e4[_0x3467('0xc7')]][_0x3467('0xca')]=moment()[_0x3467('0x9f')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x3467('0x92')][_0x3467('0x31')]=function(_0x1ad5e3){var _0x35c16a=this['uniqueId'][_0x1ad5e3[_0x3467('0xc7')]];if(this[_0x3467('0x1e')][_0x1ad5e3[_0x3467('0xc5')]]){if(_0x35c16a&&_0x35c16a[_0x3467('0x43')]!==_0x3467('0xc8')){delete this[_0x3467('0xc6')][_0x1ad5e3[_0x3467('0xc7')]];this['voiceQueues'][_0x1ad5e3['queue']][_0x3467('0xcb')]+=0x1;var _0x44fd44=new AgentComplete(_0x35c16a,_0x1ad5e3);if(_0x1ad5e3[_0x3467('0xcc')]===_0x3467('0xcd')){_0x44fd44[_0x3467('0xce')]=this[_0x3467('0x1e')][_0x1ad5e3['queue']][_0x3467('0xcf')]&&this[_0x3467('0x1e')][_0x1ad5e3['queue']][_0x3467('0xd0')]?moment()[_0x3467('0x9f')](_0x3467('0xd1')):undefined;}hopperUtils['createHistory'](_0x44fd44)['catch'](loggerCatch(_0x3467('0xd2')));hopperUtils['moveContactManagedDialer'](_0x44fd44)[_0x3467('0xa3')](loggerCatch(_0x3467('0xd3')));}}};Dialer[_0x3467('0x92')][_0x3467('0xd4')]=function(_0x30a8ca){var _0x12d36f=this['uniqueId'][_0x30a8ca[_0x3467('0xc7')]];var _0x9fa646=this;var _0x59ff3e=![];var _0x1519f9;var _0x27aa47;if(this[_0x3467('0x1e')][_0x30a8ca[_0x3467('0xc5')]]){if(_0x12d36f&&_0x12d36f['type']!==_0x3467('0xc8')){delete this['uniqueId'][_0x30a8ca['uniqueid']];this[_0x3467('0xc9')](this[_0x3467('0x1e')][_0x30a8ca[_0x3467('0xc5')]]);_0x12d36f[_0x3467('0xd5')]=moment()[_0x3467('0x9f')](_0x3467('0xd1'));var _0x169f2d=new QueueCallerAbandon(_0x12d36f,_0x30a8ca);if(utils[_0x3467('0x60')](_0x12d36f[_0x3467('0xd5')],_0x12d36f['responsetime'])>=_0x12d36f[_0x3467('0xd6')]){this[_0x3467('0x1e')][_0x30a8ca[_0x3467('0xc5')]][_0x3467('0x4f')]+=0x1;this[_0x3467('0x1e')][_0x30a8ca['queue']][_0x3467('0xd7')]+=0x1;this['voiceQueues'][_0x30a8ca['queue']][_0x3467('0xd8')]+=0x1;_0x169f2d[_0x3467('0x70')]=0xa;_0x169f2d[_0x3467('0x71')]=_0x3467('0xd9');_0x169f2d[_0x3467('0xda')]=_0x3467('0xdb');_0x169f2d[_0x3467('0xce')]=this[_0x3467('0x1e')][_0x30a8ca[_0x3467('0xc5')]][_0x3467('0xcf')]?moment()[_0x3467('0x9f')](_0x3467('0xd1')):undefined;_0x169f2d[_0x3467('0xdc')]+=0x1;_0x169f2d[_0x3467('0xdd')]+=0x1;_0x1519f9=this['voiceQueues'][_0x30a8ca[_0x3467('0xc5')]]['dialDropRetryFrequency'];_0x27aa47=this[_0x3467('0x1e')][_0x30a8ca['queue']]['callAdditionalPhoneAfterMin'];hopperUtils[_0x3467('0xde')](_0x169f2d,_0x169f2d[_0x3467('0x70')],_0x12d36f[_0x3467('0xdf')])['then'](function(_0x52c8a8){_0x59ff3e=_0x52c8a8[_0x3467('0xe0')]==0x1;if(_0x169f2d[_0x3467('0xdc')]>=_0x9fa646[_0x3467('0x1e')][_0x30a8ca[_0x3467('0xc5')]][_0x3467('0xe1')]){_0x9fa646['queueCallerAbandonCreateState'](_0x169f2d,_0x52c8a8[_0x3467('0xe0')]);}else{hopperUtils[_0x3467('0xe2')]({'active':![],'countdropretry':_0x169f2d[_0x3467('0xdc')],'scheduledat':moment()[_0x3467('0xe3')](_0x9fa646[_0x3467('0x1e')][_0x30a8ca[_0x3467('0xc5')]][_0x3467('0xe4')],_0x3467('0xe5'))[_0x3467('0x9f')](_0x3467('0xd1')),'ContactId':_0x12d36f['ContactId'],'ListId':_0x12d36f[_0x3467('0xe6')],'VoiceQueueId':_0x12d36f['VoiceQueueId']||undefined,'CampaignId':_0x12d36f[_0x3467('0xe7')]||undefined})[_0x3467('0xa3')](loggerCatch(_0x3467('0xe8')));var _0xf1aa37=new History(_0x169f2d);_0xf1aa37[_0x3467('0x70')]=0xa;_0xf1aa37['statedesc']='Drop';_0xf1aa37[_0x3467('0xe9')]=moment()['format'](_0x3467('0xd1'));_0xf1aa37[_0x3467('0x72')]=_0xf1aa37['starttime'];_0xf1aa37[_0x3467('0xea')]=_0x169f2d[_0x3467('0xea')];_0xf1aa37[_0x3467('0xeb')]=_0x169f2d[_0x3467('0xeb')];hopperUtils[_0x3467('0xec')](_0xf1aa37)[_0x3467('0xa3')](loggerCatch(_0x3467('0xed')));}})[_0x3467('0x40')](function(){if(_0x59ff3e)hopperUtils[_0x3467('0xee')](_0x169f2d,_0x1519f9,_0x27aa47)[_0x3467('0x40')](function(){return 0x1;});});}else{this[_0x3467('0x1e')][_0x30a8ca['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x30a8ca['queue']][_0x3467('0xef')]+=0x1;_0x169f2d['state']=0xb;_0x169f2d[_0x3467('0x71')]=_0x3467('0xf0');_0x169f2d[_0x3467('0xda')]=_0x3467('0xf1');_0x169f2d['countabandonedretry']+=0x1;_0x169f2d[_0x3467('0xdd')]+=0x1;_0x1519f9=this['voiceQueues'][_0x30a8ca[_0x3467('0xc5')]][_0x3467('0xf2')];_0x27aa47=this[_0x3467('0x1e')][_0x30a8ca[_0x3467('0xc5')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x3467('0xde')](_0x169f2d,_0x169f2d[_0x3467('0x70')],_0x12d36f[_0x3467('0xdf')])[_0x3467('0x40')](function(_0x285f2d){if(_0x169f2d['countabandonedretry']>=_0x9fa646[_0x3467('0x1e')][_0x30a8ca[_0x3467('0xc5')]][_0x3467('0xf3')]){_0x9fa646[_0x3467('0xf4')](_0x169f2d,_0x285f2d[_0x3467('0xe0')]);}else{hopperUtils[_0x3467('0xe2')]({'active':![],'countabandonedretry':_0x169f2d[_0x3467('0xf5')],'scheduledat':moment()['add'](_0x9fa646[_0x3467('0x1e')][_0x30a8ca[_0x3467('0xc5')]]['dialAbandonedRetryFrequency'],_0x3467('0xe5'))[_0x3467('0x9f')](_0x3467('0xd1')),'ContactId':_0x12d36f[_0x3467('0xf6')],'ListId':_0x12d36f[_0x3467('0xe6')],'VoiceQueueId':_0x12d36f[_0x3467('0xf7')]||undefined,'CampaignId':_0x12d36f[_0x3467('0xe7')]||undefined})[_0x3467('0xa3')](loggerCatch(_0x3467('0xf8')));var _0x2ca3e0=new History(_0x169f2d);_0x2ca3e0[_0x3467('0x70')]=0xb;_0x2ca3e0[_0x3467('0x71')]=_0x3467('0xf0');_0x2ca3e0[_0x3467('0xe9')]=moment()[_0x3467('0x9f')](_0x3467('0xd1'));_0x2ca3e0[_0x3467('0x72')]=_0x2ca3e0[_0x3467('0xe9')];_0x2ca3e0[_0x3467('0xea')]=_0x169f2d[_0x3467('0xea')];_0x2ca3e0[_0x3467('0xeb')]=_0x169f2d[_0x3467('0xeb')];hopperUtils[_0x3467('0xec')](_0x2ca3e0)[_0x3467('0xa3')](loggerCatch(_0x3467('0xf9')));}})[_0x3467('0x40')](function(){if(_0x59ff3e)hopperUtils[_0x3467('0xee')](_0x169f2d,_0x1519f9,_0x27aa47)['then'](function(){return 0x1;});});}}}};Dialer['prototype'][_0x3467('0x37')]=function(_0x2d436f){if(this[_0x3467('0x24')][_0x2d436f['uniqueid']]){this[_0x3467('0x24')][_0x2d436f[_0x3467('0xc7')]][_0x3467('0xfa')]=_0x2d436f[_0x3467('0xfa')];}if(this[_0x3467('0xc6')][_0x2d436f[_0x3467('0xc7')]]){this[_0x3467('0xc6')][_0x2d436f['uniqueid']]['channel']=_0x2d436f[_0x3467('0xfa')];}};Dialer['prototype'][_0x3467('0x3b')]=function(_0x1de3db){if(!this[_0x3467('0x24')][_0x1de3db[_0x3467('0xfb')]]){return;}var _0xeeda19=this['voiceQueues'][this[_0x3467('0x24')][_0x1de3db[_0x3467('0xfb')]]['queue']]['strategy']||_0x3467('0xfc');if(_0xeeda19==='roundrobin'){if(this[_0x3467('0x24')][_0x1de3db[_0x3467('0xfb')]]&&_[_0x3467('0xfd')](this['actions'][_0x1de3db[_0x3467('0xfb')]][_0x3467('0xfe')])&&_0x1de3db[_0x3467('0x8b')]==='1'&&_0x1de3db[_0x3467('0xff')]==='0'){if(this[_0x3467('0x20')][_0x1de3db[_0x3467('0x100')]]){if(!this['agents'][_0x1de3db['stateinterface']][_0x3467('0xfe')]){this['agents'][_0x1de3db['stateinterface']][_0x3467('0xfe')]=!![];this[_0x3467('0x24')][_0x1de3db[_0x3467('0xfb')]][_0x3467('0xfe')]=!![];this[_0x3467('0x24')][_0x1de3db[_0x3467('0xfb')]][_0x3467('0x100')]=_0x1de3db[_0x3467('0x100')];}}}}else if(_0xeeda19===_0x3467('0xfc')){if(this[_0x3467('0x24')][_0x1de3db[_0x3467('0xfb')]]){if(this['agents'][_0x1de3db['stateinterface']]){this[_0x3467('0x24')][_0x1de3db['actionid']][_0x3467('0x100')]=_0x1de3db['stateinterface'];if(_[_0x3467('0xfd')](this[_0x3467('0x2a')][this[_0x3467('0x24')][_0x1de3db[_0x3467('0xfb')]][_0x3467('0xc5')]])){this['queueBooked'][this['actions'][_0x1de3db[_0x3467('0xfb')]][_0x3467('0xc5')]]=[];}this[_0x3467('0x2a')][this[_0x3467('0x24')][_0x1de3db[_0x3467('0xfb')]][_0x3467('0xc5')]][_0x3467('0x9d')](_['merge'](_['pick'](this[_0x3467('0x24')][_0x1de3db[_0x3467('0xfb')]],['idHopper',_0x3467('0x100')]),{'status':_0x1de3db[_0x3467('0x8b')],'paused':_0x1de3db[_0x3467('0xff')]}));}}}};Dialer[_0x3467('0x92')][_0x3467('0x3d')]=function(_0x549ca1){if(!this[_0x3467('0x24')][_0x549ca1[_0x3467('0xfb')]]){return;}var _0xf541fc=this;var _0x414739=this['voiceQueues'][this[_0x3467('0x24')][_0x549ca1[_0x3467('0xfb')]][_0x3467('0xc5')]];var _0x2b7b25=_0x414739[_0x3467('0x101')]||_0x3467('0xfc');if(_0x2b7b25===_0x3467('0x102')){if(this[_0x3467('0x24')][_0x549ca1['actionid']]&&this[_0x3467('0x24')][_0x549ca1[_0x3467('0xfb')]][_0x3467('0x100')]){this[_0x3467('0x1d')][_0x3467('0x103')](this[_0x3467('0x24')][_0x549ca1[_0x3467('0xfb')]][_0x3467('0x104')],this['actions'][_0x549ca1[_0x3467('0xfb')]][_0x3467('0x100')])[_0x3467('0xa3')](function(_0xa41f7b){logger['error'](_0x3467('0x105'),util['inspect'](_0xa41f7b,{'showHidden':![],'depth':null}));})['finally'](function(){_0xf541fc[_0x3467('0xc9')](_0xf541fc[_0x3467('0x1e')][_0xf541fc[_0x3467('0x24')][_0x549ca1[_0x3467('0xfb')]][_0x3467('0xc5')]]);_0xf541fc[_0x3467('0x20')][_0xf541fc[_0x3467('0x24')][_0x549ca1[_0x3467('0xfb')]][_0x3467('0x100')]]['locked']=![];delete _0xf541fc[_0x3467('0x24')][_0x549ca1[_0x3467('0xfb')]];unlockQueueStatus(_0x414739);});}else{this[_0x3467('0xc9')](this[_0x3467('0x1e')][this['actions'][_0x549ca1['actionid']][_0x3467('0xc5')]]);hopperUtils[_0x3467('0xe2')]({'active':![],'ContactId':this['actions'][_0x549ca1['actionid']]['ContactId'],'ListId':this['actions'][_0x549ca1[_0x3467('0xfb')]][_0x3467('0xe6')],'VoiceQueueId':this[_0x3467('0x24')][_0x549ca1[_0x3467('0xfb')]][_0x3467('0xf7')]||undefined,'CampaignId':this[_0x3467('0x24')][_0x549ca1[_0x3467('0xfb')]][_0x3467('0xe7')]||undefined})[_0x3467('0xa3')](loggerCatch(_0x3467('0x106')));delete this['actions'][_0x549ca1['actionid']];unlockQueueStatus(_0x414739);}}else if(_0x2b7b25==='rrmemory'){var _0x4a3f67;if(this[_0x3467('0x24')][_0x549ca1[_0x3467('0xfb')]]&&!_['isEmpty'](this[_0x3467('0x2a')][this['actions'][_0x549ca1[_0x3467('0xfb')]][_0x3467('0xc5')]])){if(this[_0x3467('0x2b')][_0xf541fc['actions'][_0x549ca1[_0x3467('0xfb')]]['queue']]){this[_0x3467('0x2b')][_0xf541fc[_0x3467('0x24')][_0x549ca1[_0x3467('0xfb')]][_0x3467('0xc5')]]=this[_0x3467('0x2b')][this['actions'][_0x549ca1['actionid']][_0x3467('0xc5')]]?this[_0x3467('0x2b')][this[_0x3467('0x24')][_0x549ca1[_0x3467('0xfb')]][_0x3467('0xc5')]]:this[_0x3467('0x2a')][this[_0x3467('0x24')][_0x549ca1[_0x3467('0xfb')]][_0x3467('0xc5')]]?this[_0x3467('0x2a')][this[_0x3467('0x24')][_0x549ca1[_0x3467('0xfb')]][_0x3467('0xc5')]][_0x3467('0x107')]||0x0:0x0;}this[_0x3467('0x2a')][this['actions'][_0x549ca1[_0x3467('0xfb')]][_0x3467('0xc5')]]['_rr']=this[_0x3467('0x2b')][this[_0x3467('0x24')][_0x549ca1[_0x3467('0xfb')]][_0x3467('0xc5')]];for(var _0x34c3e1=0x0;_0x34c3e1=_0x1c0cf8[_0x3467('0x12a')]){_0x3b05d5['stateGlobal'](_0x64e05,_0x4dd76b,_0xef80a6,'reason19\x20machine....');}else{if(_0x64e05['countmachineretry']>=_0x1c0cf8[_0x3467('0x12b')]){_0x3b05d5[_0x3467('0x12c')](_0x64e05,_0x4dd76b,_0xef80a6,_0x3467('0x12d'));}else{hopperUtils[_0x3467('0xe2')]({'active':![],'countmachineretry':_0x64e05[_0x3467('0x125')],'scheduledat':moment()[_0x3467('0xe3')](_0x1c0cf8[_0x3467('0x12e')],_0x3467('0xe5'))['format'](_0x3467('0xd1')),'ContactId':_0x64e05[_0x3467('0xf6')],'ListId':_0x64e05[_0x3467('0xe6')],'VoiceQueueId':_0x64e05[_0x3467('0xf7')]||undefined,'CampaignId':_0x64e05[_0x3467('0xe7')]||undefined})[_0x3467('0xa3')](loggerCatch('[rescheduleContact][Machine]'));_0x4dd76b({'reschedule':0x1});}}});}if(_0x15e0cd[_0x3467('0x43')]===_0x3467('0xc8')&&this[_0x3467('0x1f')][_0x15e0cd[_0x3467('0xc5')]]['dialAMDActive']&&_0x5ab980[_0x3467('0x119')]==='HANGUP'){delete this[_0x3467('0xc6')][_0x5ab980[_0x3467('0xc7')]];this[_0x3467('0xc9')](this[_0x3467('0x1f')][_0x15e0cd[_0x3467('0xc5')]]);_0x27051e=new Hangup(_0x15e0cd,_0x5ab980);_0x27051e[_0x3467('0x70')]=0x12;_0x27051e[_0x3467('0x71')]=_0x3467('0x11c');_0x27051e[_0x3467('0x11d')]=_0x3467('0x11e');ami[_0x3467('0x42')](_0x3467('0x126'),ut[_0x3467('0x11f')](_0x27051e,_0x3467('0x120')));this['saveInDb'](_0x27051e,_0x3467('0x12f'),'[syncHangupInAMDIvr]');}if(_0x15e0cd[_0x3467('0x43')]===_0x3467('0xc8')&&this[_0x3467('0x1f')][_0x15e0cd[_0x3467('0xc5')]][_0x3467('0x118')]&&_0x5ab980['value']===_0x3467('0x123')){return new Promise(function(_0x3dab6c,_0x547886){delete _0x3b05d5[_0x3467('0xc6')][_0x5ab980['uniqueid']];_0x3b05d5[_0x3467('0xc9')](_0x3b05d5[_0x3467('0x1f')][_0x15e0cd[_0x3467('0xc5')]]);_0x3b05d5[_0x3467('0x1f')][_0x15e0cd['queue']][_0x3467('0xcb')]+=0x1;_0x3b05d5[_0x3467('0x1f')][_0x15e0cd[_0x3467('0xc5')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x56a95b=_0x3b05d5[_0x3467('0x1f')][_0x15e0cd['queue']];var _0x2c1267=new Hangup(_0x15e0cd,_0x5ab980);_0x2c1267['state']=0x13;_0x2c1267[_0x3467('0x71')]=_0x3467('0x124');_0x2c1267['membername']=_0x3467('0x11e');_0x2c1267[_0x3467('0x125')]+=0x1;_0x2c1267['countglobal']+=0x1;_0x2c1267[_0x3467('0x120')]=!![];ami['emit'](_0x3467('0x126'),ut[_0x3467('0x11f')](_0x2c1267,_0x3467('0x120')));hopperUtils[_0x3467('0xec')](_0x2c1267)[_0x3467('0xa3')](loggerCatch(_0x3467('0x127')));if(_0x2c1267[_0x3467('0x130')]+_0x2c1267[_0x3467('0x131')]+_0x2c1267[_0x3467('0x128')]+_0x2c1267[_0x3467('0x132')]+_0x2c1267[_0x3467('0xdc')]+_0x2c1267[_0x3467('0xf5')]+_0x2c1267[_0x3467('0x125')]+_0x2c1267[_0x3467('0x129')]>=_0x56a95b[_0x3467('0x12a')]){_0x3b05d5[_0x3467('0x133')](_0x2c1267,_0x3dab6c,_0x547886,_0x3467('0x134'));}else{if(_0x2c1267[_0x3467('0x125')]>=_0x56a95b[_0x3467('0x12b')]){_0x3b05d5[_0x3467('0x12c')](_0x2c1267,_0x3dab6c,_0x547886,_0x3467('0x12d'));}else{hopperUtils[_0x3467('0xe2')]({'active':![],'countmachineretry':_0x2c1267['countmachineretry'],'scheduledat':moment()[_0x3467('0xe3')](_0x56a95b[_0x3467('0x12e')],_0x3467('0xe5'))[_0x3467('0x9f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2c1267[_0x3467('0xf6')],'ListId':_0x2c1267[_0x3467('0xe6')],'VoiceQueueId':_0x2c1267[_0x3467('0xf7')]||undefined,'CampaignId':_0x2c1267[_0x3467('0xe7')]||undefined})[_0x3467('0xa3')](loggerCatch(_0x3467('0x135')));_0x3dab6c({'reschedule':0x1});}}});}}};Dialer[_0x3467('0x92')][_0x3467('0x35')]=function(_0x1c5a82){var _0x5b537a=this[_0x3467('0xc6')][_0x1c5a82[_0x3467('0xc7')]];var _0x471748;if(_0x5b537a&&_0x5b537a['type']==='ivr'){delete this[_0x3467('0xc6')][_0x1c5a82[_0x3467('0xc7')]];this['updateOriginated'](this[_0x3467('0x1f')][_0x5b537a[_0x3467('0xc5')]]);this[_0x3467('0x1f')][_0x5b537a[_0x3467('0xc5')]]['ivrAnswerCallsDay']+=0x1;_0x471748=new Hangup(_0x5b537a,_0x1c5a82);hopperUtils[_0x3467('0xec')](_0x471748)['catch'](loggerCatch(_0x3467('0x136')));hopperUtils[_0x3467('0x137')](_0x471748)[_0x3467('0xa3')](loggerCatch(_0x3467('0x138')));}if(_0x5b537a&&_0x5b537a[_0x3467('0x43')]!==_0x3467('0xc8')&&isNotNull(this[_0x3467('0x1e')][_0x5b537a['queue']][_0x3467('0x139')])){delete this[_0x3467('0xc6')][_0x1c5a82['uniqueid']];this[_0x3467('0xc9')](this['voiceQueues'][_0x5b537a['queue']]);this[_0x3467('0x1e')][_0x5b537a['queue']][_0x3467('0xcb')]+=0x1;this[_0x3467('0x1e')][_0x5b537a['queue']][_0x3467('0x11b')]+=0x1;_0x471748=new Hangup(_0x5b537a,_0x1c5a82);_0x471748[_0x3467('0x70')]=0x10;_0x471748[_0x3467('0x71')]='AnswerAGI';_0x471748['membername']='AGI';hopperUtils[_0x3467('0xec')](_0x471748)[_0x3467('0xa3')](loggerCatch(_0x3467('0x136')));hopperUtils[_0x3467('0x137')](_0x471748)[_0x3467('0xa3')](loggerCatch(_0x3467('0x138')));}if(_0x5b537a&&_0x5b537a[_0x3467('0x43')]!=='ivr'&&!isNotNull(this[_0x3467('0x1e')][_0x5b537a[_0x3467('0xc5')]][_0x3467('0x139')])){delete this['uniqueId'][_0x1c5a82[_0x3467('0xc7')]];this['updateOriginated'](this[_0x3467('0x1e')][_0x5b537a[_0x3467('0xc5')]]);this[_0x3467('0x1e')][_0x5b537a['queue']][_0x3467('0x13a')]+=0x1;_0x471748=new Hangup(_0x5b537a,_0x1c5a82);_0x471748[_0x3467('0x70')]=0xc;_0x471748['statedesc']=_0x1c5a82['cause-txt'];_0x471748[_0x3467('0x11d')]=_0x3467('0x13b');hopperUtils[_0x3467('0xec')](_0x471748)[_0x3467('0xa3')](loggerCatch(_0x3467('0x136')));hopperUtils[_0x3467('0x137')](_0x471748)['catch'](loggerCatch(_0x3467('0x138')));}};Dialer[_0x3467('0x92')]['syncQueueSummary']=function(_0x5b9c68){var _0x5f3249=this;if(!_0x5f3249[_0x3467('0x2c')][_0x5b9c68[_0x3467('0x61')]]){_0x5f3249['queuesSummary'][_0x5b9c68[_0x3467('0x61')]]={'running':![]};}else if(_0x5f3249[_0x3467('0x2c')][_0x5b9c68[_0x3467('0x61')]][_0x3467('0x13c')]===!![]){return;}else if(_0x5f3249[_0x3467('0x2c')][_0x5b9c68[_0x3467('0x61')]][_0x3467('0x13c')]===![]){_0x5f3249[_0x3467('0x2c')][_0x5b9c68[_0x3467('0x61')]][_0x3467('0x13c')]=!![];}var _0x343f20=_0x5f3249['voiceQueues'][_0x5b9c68['name']];var _0x8f6a55=_0x343f20[_0x3467('0x69')]!==utils['CAMPAIGN_STATUS'][_0x3467('0x7c')];var _0x39cfec=utils[_0x3467('0x13d')](_0x343f20);_0x343f20[_0x3467('0x13e')]=utils[_0x3467('0x13f')](_0x343f20,_0x5f3249[_0x3467('0x21')]);Promise[_0x3467('0xb2')]()[_0x3467('0x40')](function(){if(_0x343f20['statusMessage']===utils[_0x3467('0x6a')][_0x3467('0x7c')]){if(_0x8f6a55){clearPredictiveAttributes(_0x343f20);_0x5b9c68[_0x3467('0x27')]=undefined;_0x5b9c68['startProgressive']=undefined;}if(_0x343f20[_0x3467('0x13e')]===utils[_0x3467('0x6a')][_0x3467('0x7c')]){_0x5b9c68['available']=0x0;_0x5b9c68[_0x3467('0xff')]=0x0;_0x5b9c68['inUse']=0x0;_0x5b9c68[_0x3467('0x140')]=0x0;_0x5b9c68[_0x3467('0x141')]=0x0;}}else if(_0x343f20[_0x3467('0x13e')]===utils[_0x3467('0x6a')][_0x3467('0x142')]&&!_0x39cfec){return _0x5f3249[_0x3467('0x94')](_0x343f20,!![])[_0x3467('0x40')](function(){return _0x5f3249['ifTime'](_0x343f20,![]);})[_0x3467('0x40')](function(){return _0x5f3249[_0x3467('0xb7')](_0x343f20);})[_0x3467('0xa3')](function(_0x51a9c3){loggerSyncQueueSummary[_0x3467('0x45')](_0x3467('0x143'),util[_0x3467('0x46')](_0x51a9c3,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x343f20);});}else{clearPredictiveAttributes(_0x343f20);}})['then'](function(){var _0x4f9a9a=_0x5b9c68['compareToOutboundQueue'](_0x343f20);if(_0x4f9a9a||_0x343f20[_0x3467('0x144')]){_0x343f20['queueSummaryCountersUpdated']=![];_0x5b9c68['updateReportFromOutboundQueue'](_0x343f20);Object[_0x3467('0x145')](_0x343f20,_0x5b9c68);emitOutboundVoiceQueueSummary(_0x5b9c68);}_0x5f3249[_0x3467('0x2c')][_0x343f20[_0x3467('0x61')]][_0x3467('0x13c')]=![];})['catch'](function(_0x1f2e8e){logger[_0x3467('0x66')](_0x3467('0x143'),util[_0x3467('0x46')](_0x1f2e8e,{'showHidden':![],'depth':null}));_0x5f3249[_0x3467('0x2c')][_0x343f20[_0x3467('0x61')]][_0x3467('0x13c')]=![];});};Dialer[_0x3467('0x92')][_0x3467('0x33')]=_['throttle'](function(){var _0x3fda8a=_[_0x3467('0x146')](this['voiceQueues'],function(_0x3665bf){return _0x3665bf[_0x3467('0x147')];});var _0x3778d5=_['filter'](this[_0x3467('0x20')],function(_0x1b90de){return _0x1b90de[_0x3467('0x148')]&&_0x1b90de[_0x3467('0x8b')]===_0x3467('0x8c');});if(_0x3fda8a[_0x3467('0x149')]>0x0&&_0x3778d5[_0x3467('0x149')]>0x0){return Promise[_0x3467('0xb2')]()[_0x3467('0x40')](cmHopper[_0x3467('0x14a')](_[_0x3467('0x14b')](_0x3fda8a,'id'),previewRecallmeReminderInterval,_['map'](_0x3778d5,'id')))['then'](function(_0x4893fe){for(var _0x44af42=0x0;_0x44af42<_0x4893fe[_0x3467('0x149')];_0x44af42++){var _0x2c4847=_0x4893fe[_0x44af42][_0x3467('0x14c')][_0x3467('0x61')];if(_0x2c4847)io['to'](util[_0x3467('0x9f')]('user:%s',_0x2c4847))[_0x3467('0x42')](_0x3467('0x14d'),{'hopper':_0x4893fe[_0x44af42]});}})['catch'](function(_0x59b3b6){logger[_0x3467('0x66')](_0x3467('0x14e'),_0x59b3b6);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x3467('0x92')][_0x3467('0x3e')]=function(){var _0x31fce8=this;setInterval(function(){_0x31fce8[_0x3467('0x14f')](_0x31fce8[_0x3467('0xc6')],_0x3467('0x150'));_0x31fce8[_0x3467('0x14f')](_0x31fce8[_0x3467('0x24')],_0x3467('0x151'));},0x32c8);};Dialer[_0x3467('0x92')][_0x3467('0x14f')]=function(_0x119cac,_0x20cb7d){var _0x9cd90e=this;for(var _0x232be9 in _0x119cac){if(typeof _0x119cac[_0x232be9]!==_0x3467('0xb0')){this['sequence'][_0x3467('0x1a')](function(){if(!_[_0x3467('0xfd')](_0x119cac[_0x232be9])){return ami['Action']({'action':_0x3467('0x8b'),'channel':_0x119cac[_0x232be9]['channel']})[_0x3467('0xa3')](function(_0x55f348){if(_0x55f348[_0x3467('0x69')]===_0x3467('0x152')){setTimeout(function(){if(_0x119cac[_0x232be9]&&_0x119cac[_0x232be9]['type']!==_0x3467('0xc8')){_0x9cd90e['updateOriginated'](_0x9cd90e[_0x3467('0x1e')][_0x119cac[_0x232be9][_0x3467('0xc5')]]);logger[_0x3467('0x66')](_0x3467('0x153'),_0x20cb7d,_0x232be9,_0x119cac[_0x232be9][_0x3467('0xc5')]);delete _0x119cac[_0x232be9];}if(_0x119cac[_0x232be9]&&_0x119cac[_0x232be9][_0x3467('0x43')]===_0x3467('0xc8')){_0x9cd90e[_0x3467('0xc9')](_0x9cd90e[_0x3467('0x1f')][_0x119cac[_0x232be9]['queue']]);logger[_0x3467('0x66')](_0x3467('0x154'),_0x20cb7d,_0x232be9,_0x119cac[_0x232be9][_0x3467('0xc5')]);delete _0x119cac[_0x232be9];}},0x2328);}});}});}}};Dialer[_0x3467('0x92')][_0x3467('0x155')]=function(_0x9fd38d){return Promise[_0x3467('0xb2')]()[_0x3467('0x40')](voiceQueueRt[_0x3467('0x155')](_0x9fd38d))['catch'](loggerCatch(_0x3467('0x156')));};Dialer['prototype'][_0x3467('0xc9')]=function(_0x32b44b){if(!_[_0x3467('0x41')](_0x32b44b)&&_0x32b44b!==null){if(typeof _0x32b44b[_0x3467('0x81')]!==_0x3467('0xb0')){if(_0x32b44b['originated']>0x0){_0x32b44b[_0x3467('0x81')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x3467('0x66')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x3467('0x92')]['loggerHandler']=function(_0x1794d1,_0x2c1320){var _0x3c07fd=this;return function(_0x45a7fa){_0x3c07fd[_0x3467('0xc9')](_0x2c1320);logger[_0x3467('0x66')](_0x1794d1,util[_0x3467('0x46')](_0x45a7fa,{'showHidden':![],'depth':null}));};};Dialer[_0x3467('0x92')][_0x3467('0x157')]=function(_0x2bf9f6,_0x45d592,_0x407307){var _0x18839d={'state':0x19,'statedesc':_0x3467('0x158')};this[_0x3467('0xc9')](_0x45d592);this[_0x3467('0x159')](_[_0x3467('0x5f')](_0x18839d,_[_0x3467('0x76')](_0x407307,[_0x3467('0xf6'),_0x3467('0xe6'),'UserId',_0x3467('0xf7'),_0x3467('0xe7')])),_0x3467('0x15a'),_0x3467('0x15b'));logger[_0x3467('0x66')](_0x2bf9f6);};Dialer[_0x3467('0x92')][_0x3467('0x159')]=function(_0xea5543,_0x577341,_0xa780b2){hopperUtils[_0x3467('0xec')](_0xea5543)[_0x3467('0xa3')](loggerCatch(_0x577341));hopperUtils[_0x3467('0x137')](_0xea5543)['catch'](loggerCatch(_0xa780b2));};Dialer[_0x3467('0x92')][_0x3467('0xf4')]=function(_0xcb2779,_0x1ab190){hopperUtils[_0x3467('0xec')](_0xcb2779)[_0x3467('0xa3')](loggerCatch(_0x3467('0xd2')));if(_0x1ab190==0x0){hopperUtils['moveContactManagedDialer'](_0xcb2779)[_0x3467('0xa3')](loggerCatch(_0x3467('0x15c')));}};Dialer[_0x3467('0x92')][_0x3467('0x14e')]=function(_0xbd758){return Promise['resolve']()[_0x3467('0x40')](cmHopper[_0x3467('0x14a')](_0xbd758['id'],previewRecallmeReminderInterval))['then'](function(_0x5ed62c){for(var _0xa8f2a=0x0;_0xa8f2a<_0x5ed62c['length'];_0xa8f2a++){var _0x250225=_0x5ed62c[_0xa8f2a][_0x3467('0x14c')][_0x3467('0x61')];if(_0x250225)io['to'](util['format']('user:%s',_0x250225))[_0x3467('0x42')]('user:dialPreviewRecallReminder',{'hopper':_0x5ed62c[_0xa8f2a]});}})[_0x3467('0xa3')](function(){});};Dialer[_0x3467('0x92')][_0x3467('0xb6')]=function(_0x18a692){var _0x20b2ae=this;return function(){_0x20b2ae[_0x3467('0x15d')](_0x18a692);};};Dialer[_0x3467('0x92')]['actionOriginate']=function(_0x256db4,_0x21322d){var _0xb45cb0=this;var _0x204d70=uuid['v4']();this['actions'][_0x204d70]=new Action(_0x256db4,_0x21322d,_0x204d70);return new Promise(function(_0x13c37a,_0x4e7dfd){if(_[_0x3467('0x41')](_0x256db4)&&typeof _0x256db4!==_0x3467('0x15e')){return _0x4e7dfd(msgResponse(_0x3467('0x15f'),'Failure',_0x3467('0x160')));}if(_[_0x3467('0x41')](_0x21322d[_0x3467('0x161')])||_0x21322d[_0x3467('0x161')]===null){return _0x4e7dfd(msgResponse(_0x3467('0x15f'),'Failure',_0x3467('0x162')));}var _0x1084ac={'XMD-CALLERID':_0xb45cb0[_0x3467('0x24')][_0x204d70]['getCaller'](),'XMD-AGI':_0x256db4[_0x3467('0x139')]?util[_0x3467('0x9f')](_0x3467('0x163'),ipAgi,_0x256db4[_0x3467('0x139')]):_0x3467('0x164'),'XMD-AGIAFTER':_0x256db4['dialQueueProject2']?util['format'](_0x3467('0x163'),ipAgi,_0x256db4[_0x3467('0xcf')]):_0x3467('0x164'),'XMD-QUEUE':utils[_0x3467('0x165')](_0x256db4)?util[_0x3467('0x9f')](_0x3467('0x166'),_0x256db4['name'],_0x256db4[_0x3467('0x167')]||'',_0x256db4['dialAgiAfterHangupAgent']?'c':'',_0x256db4[_0x3467('0xd6')]||0x3):_0x3467('0x164'),'XMD-CONTACTID':_0x21322d[_0x3467('0xf6')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xb45cb0[_0x3467('0x24')][_0x204d70][_0x3467('0x168')](),'XMD-AMD':_0x256db4[_0x3467('0x118')]?_0x3467('0x142'):_0x3467('0x164'),'XMD-DESTINATION':_0x3467('0x169')};if(_0x256db4['dialAMDActive']){_0x1084ac[_0x3467('0x16a')]=_0x256db4[_0x3467('0x16b')]||0x9c4;_0x1084ac['XMD-AMDGREETING']=_0x256db4[_0x3467('0x16c')]||0x5dc;_0x1084ac[_0x3467('0x16d')]=_0x256db4[_0x3467('0x16e')]||0x320;_0x1084ac[_0x3467('0x16f')]=_0x256db4[_0x3467('0x170')]||0x1388;_0x1084ac['XMD-AMDMINWORDLENGTH']=_0x256db4['dialAMDMinWordLength']||0x64;_0x1084ac[_0x3467('0x171')]=_0x256db4[_0x3467('0x172')]||0x32;_0x1084ac['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x256db4[_0x3467('0x173')]||0x3;_0x1084ac['XMD-AMDSILENCETHRESHOLD']=_0x256db4[_0x3467('0x174')]||0x100;_0x1084ac[_0x3467('0x175')]=_0x256db4['dialAMDMaximumWordLength']||0x1388;}if(utils['isOutboundQueue'](_0x256db4)){_0x1084ac[_0x3467('0x176')]=_0x21322d[_0x3467('0xf7')];}else{_0x1084ac[_0x3467('0x177')]=_0x21322d[_0x3467('0xe7')];}var _0x2a9391=utils[_0x3467('0x178')](_0x21322d[_0x3467('0x179')]);Object[_0x3467('0x145')](_0x1084ac,_0x2a9391);var _0xf2dd85=_0xb45cb0[_0x3467('0x88')](_0x256db4['Trunk'])?utils['getCallerId'](_0x256db4[_0x3467('0x8e')][_0x3467('0x17a')],_0x256db4[_0x3467('0x17b')],_0x256db4[_0x3467('0x17c')]>0x0?utils[_0x3467('0x17d')](_0x256db4[_0x3467('0x17e')],_0x256db4[_0x3467('0x17c')]):_0x256db4[_0x3467('0x17e')]):utils[_0x3467('0x17f')](_['isNil'](_0x256db4['TrunkBackup'])?_0x256db4[_0x3467('0x8e')][_0x3467('0x17a')]:_0x256db4[_0x3467('0x180')][_0x3467('0x17a')],_0x256db4[_0x3467('0x17b')],_0x256db4[_0x3467('0x17c')]>0x0?utils[_0x3467('0x17d')](_0x256db4[_0x3467('0x17e')],_0x256db4[_0x3467('0x17c')]):_0x256db4[_0x3467('0x17e')]);if(_0xf2dd85){_0x1084ac[_0x3467('0x181')]=_0xb45cb0[_0x3467('0x24')][_0x204d70][_0x3467('0x182')]=utils[_0x3467('0x183')](_0xf2dd85);_0x1084ac[_0x3467('0x184')]=_0x21322d[_0x3467('0x161')];}_0x256db4[_0x3467('0x185')]=_0x1084ac;return ami[_0x3467('0x9e')]({'actionid':_0x204d70,'action':_0x3467('0x15f'),'channel':_0xb45cb0['isTrunkReachable'](_0x256db4[_0x3467('0x8e')])?util['format'](_0x3467('0x186'),_0x256db4[_0x3467('0x8e')][_0x3467('0x61')],isNotNull(_0x256db4['dialPrefix'])?_0x256db4[_0x3467('0x187')]['trim']()||'':'',_0x256db4[_0x3467('0x188')]>0x0?_0x21322d[_0x3467('0x161')][_0x3467('0x189')](_0x256db4[_0x3467('0x188')]):_0x21322d[_0x3467('0x161')]):util[_0x3467('0x9f')](_0x3467('0x186'),_[_0x3467('0xfd')](_0x256db4['TrunkBackup'])?_0x256db4['Trunk'][_0x3467('0x61')]:_0x256db4[_0x3467('0x180')][_0x3467('0x61')],isNotNull(_0x256db4[_0x3467('0x187')])?_0x256db4[_0x3467('0x187')][_0x3467('0x18a')]()||'':'',_0x256db4[_0x3467('0x188')]>0x0?_0x21322d[_0x3467('0x161')]['substring'](_0x256db4[_0x3467('0x188')]):_0x21322d[_0x3467('0x161')]),'callerid':_0xf2dd85,'Exten':_0x3467('0x169'),'Context':_0x3467('0x18b'),'Priority':'1','variable':_0x1084ac,'timeout':(_0x256db4[_0x3467('0x18c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x204d70})[_0x3467('0x40')](function(_0x15e7aa){return _0x13c37a(_0x15e7aa);})['catch'](function(_0xc4cf89){_0x256db4[_0x3467('0x18d')]+=0x1;var _0x3afa45=new History(_0xb45cb0['actions'][_0x204d70]);logger['error'](util[_0x3467('0x9f')](_0x3467('0x18e'),JSON[_0x3467('0x87')](_0xc4cf89)));_0x3afa45[_0x3467('0x70')]=0xe;_0x3afa45['statedesc']=_0x3467('0x18f');_0x3afa45[_0x3467('0xe9')]=moment()[_0x3467('0x9f')](_0x3467('0xd1'));_0x3afa45['endtime']=_0x3afa45[_0x3467('0xe9')];hopperUtils[_0x3467('0xec')](_0x3afa45)['catch'](loggerCatch(_0x3467('0x190')));_0xb45cb0[_0x3467('0x137')](_0x3afa45)[_0x3467('0xa3')](loggerCatch(_0x3467('0x190')))['finally'](function(){delete _0xb45cb0[_0x3467('0x24')][_0x204d70];return _0x4e7dfd(msgResponse('originate','Error',_0x3467('0x191')));});});});};Dialer[_0x3467('0x92')]['checkRetriveMax']=function(_0x3f6c6c,_0x2bb879,_0x224ce7){var _0x4f53c0=new History(_0x2bb879);if(_0x4f53c0[_0x3467('0x130')]+_0x4f53c0[_0x3467('0x131')]+_0x4f53c0['countnoanswerretry']+_0x4f53c0[_0x3467('0x132')]+_0x4f53c0[_0x3467('0xdc')]+_0x4f53c0['countabandonedretry']+_0x4f53c0['countmachineretry']+_0x4f53c0['countagentrejectretry']>=_0x224ce7[_0x3467('0x12a')]-0x1){return!![];}switch(_0x3f6c6c){case 0x3:if(_0x4f53c0[_0x3467('0x128')]>=_0x224ce7[_0x3467('0x192')]-0x1){return!![];}hopperUtils[_0x3467('0xe2')]({'active':![],'countnoanswerretry':_0x4f53c0[_0x3467('0x128')]+=0x1,'scheduledat':moment()[_0x3467('0xe3')](_0x224ce7['dialNoAnswerRetryFrequency'],_0x3467('0xe5'))[_0x3467('0x9f')](_0x3467('0xd1')),'ContactId':_0x4f53c0[_0x3467('0xf6')],'ListId':_0x4f53c0[_0x3467('0xe6')],'VoiceQueueId':_0x4f53c0[_0x3467('0xf7')]||undefined,'CampaignId':_0x4f53c0[_0x3467('0xe7')]||undefined})[_0x3467('0xa3')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x4f53c0['countbusyretry']>=_0x224ce7[_0x3467('0x193')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x4f53c0[_0x3467('0x130')]+=0x1,'scheduledat':moment()[_0x3467('0xe3')](_0x224ce7[_0x3467('0x194')],'minutes')['format'](_0x3467('0xd1')),'ContactId':_0x4f53c0['ContactId'],'ListId':_0x4f53c0[_0x3467('0xe6')],'VoiceQueueId':_0x4f53c0[_0x3467('0xf7')]||undefined,'CampaignId':_0x4f53c0['CampaignId']||undefined})['catch'](loggerCatch(_0x3467('0x195')));break;case 0x8:if(_0x4f53c0['countcongestionretry']>=_0x224ce7['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0x3467('0xe2')]({'active':![],'countcongestionretry':_0x4f53c0[_0x3467('0x131')]+=0x1,'scheduledat':moment()[_0x3467('0xe3')](_0x224ce7[_0x3467('0x196')],'minutes')['format'](_0x3467('0xd1')),'ContactId':_0x4f53c0[_0x3467('0xf6')],'ListId':_0x4f53c0['ListId'],'VoiceQueueId':_0x4f53c0[_0x3467('0xf7')]||undefined,'CampaignId':_0x4f53c0[_0x3467('0xe7')]||undefined})[_0x3467('0xa3')](loggerCatch(_0x3467('0x197')));break;case 0x0:if(_0x4f53c0[_0x3467('0x132')]>=_0x224ce7['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0x3467('0xe2')]({'active':![],'countnosuchnumberretry':_0x4f53c0[_0x3467('0x132')]+=0x1,'scheduledat':moment()[_0x3467('0xe3')](_0x224ce7['dialNoSuchNumberRetryFrequency'],'minutes')[_0x3467('0x9f')](_0x3467('0xd1')),'ContactId':_0x4f53c0[_0x3467('0xf6')],'ListId':_0x4f53c0[_0x3467('0xe6')],'VoiceQueueId':_0x4f53c0[_0x3467('0xf7')]||undefined,'CampaignId':_0x4f53c0[_0x3467('0xe7')]||undefined})[_0x3467('0xa3')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x4f53c0['countdropretry']>=_0x224ce7['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0x3467('0xe2')]({'active':![],'countdropretry':_0x4f53c0['countdropretry']+=0x1,'scheduledat':moment()[_0x3467('0xe3')](_0x224ce7[_0x3467('0xe4')],'minutes')['format'](_0x3467('0xd1')),'ContactId':_0x4f53c0[_0x3467('0xf6')],'ListId':_0x4f53c0[_0x3467('0xe6')],'VoiceQueueId':_0x4f53c0[_0x3467('0xf7')]||undefined,'CampaignId':_0x4f53c0['CampaignId']||undefined})[_0x3467('0xa3')](loggerCatch(_0x3467('0xe8')));break;case 0xb:if(_0x4f53c0[_0x3467('0xf5')]>=_0x224ce7[_0x3467('0xf3')]-0x1){return!![];}hopperUtils[_0x3467('0xe2')]({'active':![],'countabandonedretry':_0x4f53c0[_0x3467('0xf5')]+=0x1,'scheduledat':moment()[_0x3467('0xe3')](_0x224ce7[_0x3467('0xf2')],_0x3467('0xe5'))[_0x3467('0x9f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f53c0[_0x3467('0xf6')],'ListId':_0x4f53c0[_0x3467('0xe6')],'VoiceQueueId':_0x4f53c0[_0x3467('0xf7')]||undefined,'CampaignId':_0x4f53c0[_0x3467('0xe7')]||undefined})[_0x3467('0xa3')](loggerCatch(_0x3467('0xf8')));break;case 0x13:if(_0x4f53c0[_0x3467('0x125')]>=_0x224ce7[_0x3467('0x12b')]-0x1){return!![];}hopperUtils[_0x3467('0xe2')]({'active':![],'countmachineretry':_0x4f53c0[_0x3467('0x125')]+=0x1,'scheduledat':moment()['add'](_0x224ce7[_0x3467('0x12e')],'minutes')[_0x3467('0x9f')](_0x3467('0xd1')),'ContactId':_0x4f53c0[_0x3467('0xf6')],'ListId':_0x4f53c0['ListId'],'VoiceQueueId':_0x4f53c0[_0x3467('0xf7')]||undefined,'CampaignId':_0x4f53c0[_0x3467('0xe7')]||undefined})['catch'](loggerCatch(_0x3467('0x135')));break;case 0x14:if(_0x4f53c0['countagentrejectretry']>=_0x224ce7['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x3467('0xe2')]({'active':![],'countagentrejectretry':_0x4f53c0['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x3467('0xe3')](_0x224ce7[_0x3467('0x198')],_0x3467('0xe5'))[_0x3467('0x9f')](_0x3467('0xd1')),'ContactId':_0x4f53c0[_0x3467('0xf6')],'ListId':_0x4f53c0[_0x3467('0xe6')],'VoiceQueueId':_0x4f53c0[_0x3467('0xf7')]||undefined,'CampaignId':_0x4f53c0[_0x3467('0xe7')]||undefined})[_0x3467('0xa3')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x3467('0x92')][_0x3467('0x115')]=function(_0x463f3c,_0x3a3176,_0x303654){var _0x560c87=this;var _0x4d9a62=new History(_0x463f3c);var _0x4d2b39=![];var _0x324ae2;var _0x5709af;return new Promise(function(_0x75c31,_0x55f999){if(_[_0x3467('0x41')](_0x3a3176)&&typeof _0x3a3176!==_0x3467('0x15e')){return _0x55f999(msgResponse(_0x3467('0x199'),'Failure',_0x3467('0x19a')));}if(_[_0x3467('0x41')](_0x303654)&&typeof _0x303654!==_0x3467('0x15e')){return _0x55f999(msgResponse(_0x3467('0x199'),_0x3467('0x9a'),_0x3467('0x19b')));}hopperUtils[_0x3467('0xde')](_0x4d9a62,_0x303654['reason'],_0x3a3176)['then'](function(_0x482c75){if(_0x482c75['additional']==0x1)_0x4d2b39=!![];switch(_0x303654[_0x3467('0xcc')]){case'0':_0x3a3176['outboundNoSuchCallsDay']+=0x1;_0x4d9a62[_0x3467('0x70')]=0x0;_0x4d9a62[_0x3467('0x71')]='NoSuchNumber';_0x4d9a62['countnosuchnumberretry']+=0x1;_0x4d9a62[_0x3467('0xdd')]+=0x1;ami[_0x3467('0x42')](_0x3467('0x19c'),ut[_0x3467('0x11f')](_0x463f3c,'nosuchnumber'));_0x324ae2=_0x3a3176[_0x3467('0x19d')];_0x5709af=_0x3a3176[_0x3467('0x19e')];hopperUtils[_0x3467('0xec')](_0x4d9a62)[_0x3467('0xa3')](loggerCatch(_0x3467('0x127')));if(_0x560c87[_0x3467('0x19f')](0x0,_0x463f3c,_0x3a3176)&&!_0x4d2b39){if(_0x4d9a62[_0x3467('0x132')]>=_0x3a3176[_0x3467('0x1a0')]){_0x560c87[_0x3467('0x12c')](_0x4d9a62,_0x75c31,_0x55f999,_0x3467('0x1a1'));}else{_0x560c87[_0x3467('0x133')](_0x4d9a62,_0x75c31,_0x55f999,_0x3467('0x1a1'));}}break;case'3':_0x3a3176['outboundNoAnswerCallsDay']+=0x1;_0x4d9a62[_0x3467('0x70')]=0x3;_0x4d9a62[_0x3467('0x71')]=_0x3467('0x1a2');_0x4d9a62[_0x3467('0x128')]+=0x1;_0x4d9a62['countglobal']+=0x1;var _0x557b08=ut[_0x3467('0x1a3')](_0x463f3c,_0x3a3176);ami[_0x3467('0x42')](_0x3467('0x1a4'),_0x557b08);_0x324ae2=_0x3a3176[_0x3467('0x1a5')];_0x5709af=_0x3a3176[_0x3467('0x19e')];hopperUtils[_0x3467('0xec')](_0x4d9a62)[_0x3467('0xa3')](loggerCatch(_0x3467('0x1a6')));if(_0x560c87[_0x3467('0x19f')](0x3,_0x463f3c,_0x3a3176)&&!_0x4d2b39){if(_0x4d9a62[_0x3467('0x128')]>=_0x3a3176[_0x3467('0x192')]){_0x560c87['createStateFinal'](_0x4d9a62,_0x75c31,_0x55f999,_0x3467('0x1a7'));}else{_0x560c87['stateGlobal'](_0x4d9a62,_0x75c31,_0x55f999,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x3a3176[_0x3467('0x1a8')]+=0x1;_0x4d9a62[_0x3467('0x70')]=0x5;_0x4d9a62[_0x3467('0x71')]='Busy';_0x4d9a62[_0x3467('0x130')]+=0x1;_0x4d9a62[_0x3467('0xdd')]+=0x1;ami['emit'](_0x3467('0x1a9'),ut['buildObj'](_0x463f3c,_0x3467('0x1aa')));_0x324ae2=_0x3a3176[_0x3467('0x194')];_0x5709af=_0x3a3176[_0x3467('0x19e')];hopperUtils['createHistory'](_0x4d9a62)[_0x3467('0xa3')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x560c87[_0x3467('0x19f')](0x5,_0x463f3c,_0x3a3176)&&!_0x4d2b39){if(_0x4d9a62[_0x3467('0x130')]>=_0x3a3176[_0x3467('0x193')]){_0x560c87[_0x3467('0x12c')](_0x4d9a62,_0x75c31,_0x55f999,_0x3467('0x1ab'));}else{_0x560c87[_0x3467('0x133')](_0x4d9a62,_0x75c31,_0x55f999,_0x3467('0x1ab'));}}break;case'8':_0x3a3176[_0x3467('0x1ac')]+=0x1;_0x4d9a62[_0x3467('0x70')]=0x8;_0x4d9a62[_0x3467('0x71')]='Congestion';_0x4d9a62[_0x3467('0x131')]+=0x1;_0x4d9a62[_0x3467('0xdd')]+=0x1;_0x324ae2=_0x3a3176['dialCongestionRetryFrequency'];_0x5709af=_0x3a3176['callAdditionalPhoneAfterMin'];ami[_0x3467('0x42')]('custom:agentcongestion',ut[_0x3467('0x11f')](_0x463f3c,_0x3467('0x1ad')));hopperUtils[_0x3467('0xec')](_0x4d9a62)[_0x3467('0xa3')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x560c87[_0x3467('0x19f')](0x8,_0x463f3c,_0x3a3176)&&!_0x4d2b39){if(_0x4d9a62[_0x3467('0x131')]>=_0x3a3176[_0x3467('0x1ae')]){_0x560c87[_0x3467('0x12c')](_0x4d9a62,_0x75c31,_0x55f999,_0x3467('0x1af'));}else{_0x560c87[_0x3467('0x133')](_0x4d9a62,_0x75c31,_0x55f999,_0x3467('0x1af'));}}break;case'11':_0x3a3176['outboundAbandonedCallsDay']+=0x1;_0x4d9a62[_0x3467('0x70')]=0xb;_0x4d9a62[_0x3467('0x71')]=_0x3467('0xf0');_0x4d9a62[_0x3467('0xf5')]+=0x1;_0x4d9a62[_0x3467('0xdd')]+=0x1;_0x324ae2=_0x3a3176[_0x3467('0xf2')];_0x5709af=_0x3a3176[_0x3467('0x19e')];hopperUtils[_0x3467('0xec')](_0x4d9a62)[_0x3467('0xa3')](loggerCatch(_0x3467('0xf9')));if(_0x560c87[_0x3467('0x19f')](0xb,_0x463f3c,_0x3a3176)&&!_0x4d2b39){if(_0x4d9a62[_0x3467('0xf5')]>=_0x3a3176[_0x3467('0xf3')]){_0x560c87[_0x3467('0x12c')](_0x4d9a62,_0x75c31,_0x55f999,_0x3467('0x1b0'));}else{_0x560c87[_0x3467('0x133')](_0x4d9a62,_0x75c31,_0x55f999,_0x3467('0x1b0'));}}break;case'20':_0x3a3176[_0x3467('0x1b1')]+=0x1;_0x4d9a62['state']=0x14;_0x4d9a62[_0x3467('0x71')]=_0x3467('0x1b2');_0x4d9a62[_0x3467('0x129')]+=0x1;_0x4d9a62[_0x3467('0xdd')]+=0x1;_0x324ae2=_0x3a3176['dialAgentRejectRetryFrequency'];_0x5709af=_0x3a3176['callAdditionalPhoneAfterMin'];ami[_0x3467('0x42')](_0x3467('0x1b3'),ut['buildObj'](_0x463f3c,_0x3467('0x1b4')));hopperUtils[_0x3467('0xec')](_0x4d9a62)[_0x3467('0xa3')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x560c87['checkRetriveMax'](0x14,_0x463f3c,_0x3a3176)&&!_0x4d2b39){if(_0x4d9a62[_0x3467('0x129')]>=_0x3a3176['dialAgentRejectMaxRetry']){_0x560c87['createStateFinal'](_0x4d9a62,_0x75c31,_0x55f999,_0x3467('0x1b5'));}else{_0x560c87[_0x3467('0x133')](_0x4d9a62,_0x75c31,_0x55f999,'reason\x2020\x20agentreject');}}break;default:_0x3a3176[_0x3467('0x13a')]+=0x1;_0x4d9a62[_0x3467('0x70')]=0xc;_0x4d9a62['statedesc']=_0x303654[_0x3467('0xcc')];_0x324ae2=_0x3a3176['dialAgentRejectRetryFrequency'];_0x5709af=_0x3a3176['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x4d9a62)[_0x3467('0xa3')](loggerCatch(_0x3467('0x1b6')));if(_0x560c87['checkRetriveMax'](_0x303654[_0x3467('0xcc')],_0x463f3c,_0x3a3176)&&!_0x4d2b39){if(_0x4d9a62[_0x3467('0x130')]+_0x4d9a62[_0x3467('0x131')]+_0x4d9a62['countnoanswerretry']+_0x4d9a62[_0x3467('0x132')]+_0x4d9a62['countdropretry']+_0x4d9a62[_0x3467('0xf5')]+_0x4d9a62['countmachineretry']+_0x4d9a62[_0x3467('0x129')]>=_0x3a3176[_0x3467('0x12a')]){_0x560c87[_0x3467('0x133')](_0x4d9a62,_0x75c31,_0x55f999,_0x303654[_0x3467('0xcc')]);}else{_0x560c87[_0x3467('0x12c')](_0x4d9a62,_0x75c31,_0x55f999,_0x303654['reason']);}}}})[_0x3467('0x40')](function(){if(_0x4d2b39){hopperUtils[_0x3467('0xee')](_0x4d9a62,_0x324ae2,_0x5709af)[_0x3467('0x40')](function(){return _0x75c31(0x1);});}});});};Dialer[_0x3467('0x92')][_0x3467('0x133')]=function(_0x179112,_0x4b5a7e,_0x75950d,_0x53e305){var _0x2e0446=new Final(_0x179112);_0x2e0446[_0x3467('0x70')]=0xf;_0x2e0446[_0x3467('0x71')]=_0x3467('0x1b7');this[_0x3467('0x12c')](_0x2e0446,_0x4b5a7e,_0x75950d,_0x53e305);};Dialer[_0x3467('0x92')][_0x3467('0x12c')]=function(_0x3ecd98,_0x5ea9d0,_0x55ec56,_0x5a968b){hopperUtils[_0x3467('0x137')](_0x3ecd98)[_0x3467('0x40')](function(){return _0x5ea9d0(msgResponse(_0x3467('0x199'),_0x3467('0x114'),_0x5a968b));})[_0x3467('0xa3')](function(){return _0x55ec56(msgResponse(_0x3467('0x1b8'),_0x3467('0x9a'),_0x3467('0x1b9')));});};Dialer[_0x3467('0x92')][_0x3467('0xa')]=function(_0x157840){var _0x534f21=_0x157840[_0x3467('0x1ba')]/0x64;var _0x205a06=_0x157840['outboundDropCallsDayTimeout']/(_0x157840[_0x3467('0xd7')]+_0x157840['outboundAnswerCallsDay']);var _0x587d96=Math[_0x3467('0x1bb')](_0x157840[_0x3467('0x1bc')]*(_0x157840['predictiveIntervalMaxThreshold']/0x64));var _0xe4cbbb=Math[_0x3467('0x1bb')](_0x157840[_0x3467('0x1bc')]*(_0x157840[_0x3467('0x1bd')]/0x64));var _0x545d19=_0x157840[_0x3467('0x1be')]+_0x157840[_0x3467('0x140')];var _0x5f34da=Math['floor'](_0x157840['erlangCalls']*_0x157840[_0x3467('0x5b')]*_0x157840[_0x3467('0x1bf')]*_0x157840[_0x3467('0x1c0')]);if(_[_0x3467('0x41')](_0x157840[_0x3467('0x28')])){if(!_[_0x3467('0x41')](_0x157840[_0x3467('0x27')])){_0x157840[_0x3467('0x27')]=undefined;loggerPredictive[_0x3467('0x66')](_0x3467('0x1c1'),_0x3467('0x1c2'));}if(!_['isUndefined'](_0x157840[_0x3467('0x64')])){loggerPredictive[_0x3467('0x66')](_0x3467('0x1c1'),_0x3467('0x1c3'));clearInterval(_0x157840[_0x3467('0x64')]);_0x157840[_0x3467('0x64')]=undefined;}_0x157840[_0x3467('0x28')]=moment()[_0x3467('0x9f')](_0x3467('0xd1'));loggerPredictive[_0x3467('0x4a')](_0x157840[_0x3467('0x61')],_0x3467('0x1c4'),_0x157840['startProgressive']);this[_0x3467('0xba')](_0x157840,0x1);}else if(ifInterval(_0x157840['dialPredictiveInterval'],_0x157840['startProgressive'])){this['handlePower'](_0x157840,0x1);loggerPredictiveCalls[_0x3467('0x4a')]('[startMethodPredictive][StartProgressive][Loop]',_0x157840[_0x3467('0x28')],_0x157840[_0x3467('0x61')]);_0x157840[_0x3467('0x59')]=0x0;_0x157840[_0x3467('0xd8')]=0x0;}else if(_0x534f21<_0x205a06&&_0x157840['dialPredictiveOptimization']===_0x3467('0x1c5')){clearPredictiveAttributes(_0x157840);loggerPredictive[_0x3467('0x4a')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x3467('0x1c6'),_0x205a06,_0x3467('0x28'),_0x157840[_0x3467('0x61')]);}else if(_0x5f34da<_0x157840[_0x3467('0xd8')]&&_0x157840['dialPredictiveOptimization']==='dropRate'){clearPredictiveAttributes(_0x157840);loggerPredictive[_0x3467('0x4a')](_0x3467('0x1c7'),'Max\x20Drop\x20',_0x5f34da,_0x3467('0x1c8'),_0x157840[_0x3467('0xd8')],_0x3467('0x28'),_0x157840[_0x3467('0x61')]);}else if(!ifInterval(_0x157840[_0x3467('0x1c9')],_0x157840[_0x3467('0x28')])&&_[_0x3467('0x41')](_0x157840[_0x3467('0x27')])&&!_['isUndefined'](_0x157840[_0x3467('0x28')])){_0x157840[_0x3467('0x27')]=moment()[_0x3467('0x9f')](_0x3467('0xd1'));loggerPredictive['info'](_0x157840[_0x3467('0x61')],_0x3467('0x1ca'),_0x157840[_0x3467('0x27')]);hopperUtils['avgHandleTime'](_0x157840[_0x3467('0x1c9')])[_0x3467('0x40')](this['getDataPredictive'](_0x157840))[_0x3467('0x40')](mergeDataErlangB(_0x157840))[_0x3467('0x40')](this['startMethodPredictive'](_0x157840))[_0x3467('0xa3')](loggerCatchPredictive(_0x3467('0x1cb'),_0x157840));}else if(!ifInterval(_0x157840[_0x3467('0x1c9')],_0x157840['startPredictive'])){_0x157840[_0x3467('0xd8')]=0x0;_0x157840['startPredictive']=moment()[_0x3467('0x9f')](_0x3467('0xd1'));loggerPredictive[_0x3467('0x4a')](_0x157840[_0x3467('0x61')],'recalculate\x20predictive\x20at',_0x157840[_0x3467('0x27')]);clearInterval(_0x157840[_0x3467('0x64')]);_0x157840[_0x3467('0x64')]=undefined;hopperUtils[_0x3467('0x1cc')](_0x157840[_0x3467('0x1c9')])['then'](this[_0x3467('0x1cd')](_0x157840))['then'](mergeDataErlangB(_0x157840))[_0x3467('0x40')](this[_0x3467('0x1ce')](_0x157840))[_0x3467('0xa3')](loggerCatchPredictive(_0x3467('0x1cf'),_0x157840));}else if(_0x157840['predictiveIntervalAvailable']&&_0x545d19<_0x157840[_0x3467('0x1bc')]-_0xe4cbbb){clearPredictiveAttributes(_0x157840);loggerPredictive[_0x3467('0x4a')](_0x157840['name'],_0x3467('0x1d0'),_0x545d19,_0x3467('0x1d1'),_0x157840['predictiveIntervalAvailable'],'-',_0xe4cbbb,'=',_0x157840[_0x3467('0x1bc')]-_0xe4cbbb,')');}else if(_0x157840[_0x3467('0x1bc')]&&_0x545d19>_0x157840[_0x3467('0x1bc')]+_0x587d96){clearPredictiveAttributes(_0x157840);loggerPredictive[_0x3467('0x4a')](_0x157840[_0x3467('0x61')],_0x3467('0x1d0'),_0x545d19,')\x20are\x20more\x20than\x20threshold\x20(',_0x157840['predictiveIntervalAvailable'],'+',_0x587d96,'=',_0x157840['predictiveIntervalAvailable']+_0x587d96,')');}};Dialer[_0x3467('0x92')][_0x3467('0x1cd')]=function(_0x55e189){var _0x3d28dd=this;return function(_0x2e40fb){return new Promise(function(_0x2eb012,_0x39f911){_[_0x3467('0x5f')](_0x55e189,_0x2e40fb[0x0]);if(checkGetDataPredictive(_0x2e40fb[0x0])){var _0x588287=_0x55e189[_0x3467('0x1bc')]=_0x55e189[_0x3467('0x140')]+_0x55e189[_0x3467('0x1be')];var _0x23cf59=_0x55e189[_0x3467('0x1c9')]*0x3c;var _0x30d137=_0x2e40fb[0x0]['predictiveIntervalAvgTalktime']+_0x2e40fb[0x0][_0x3467('0x55')];var _0x1b0c2f=(_0x2e40fb[0x0][_0x3467('0x1d2')]+_0x2e40fb[0x0][_0x3467('0x4f')]+_0x2e40fb[0x0][_0x3467('0x51')])/_0x2e40fb[0x0]['predictiveIntervalTotalCalls'];_0x55e189[_0x3467('0x1bf')]=_0x1b0c2f>0x0?_0x1b0c2f:0x1;switch(_0x55e189[_0x3467('0x1d3')]){case _0x3467('0x1c5'):var _0x57ddb5=_0x55e189[_0x3467('0x1ba')]/0x64;return _0x3d28dd[_0x3467('0x1d4')](_0x588287,_0x23cf59,_0x30d137,_0x1b0c2f,_0x57ddb5)['then'](function(_0x40b961){return _0x2eb012(_0x40b961);});case'agentBusyFactor':var _0x383643=_0x55e189[_0x3467('0x1ba')]/0x64;return _0x3d28dd[_0x3467('0x1d5')](_0x588287,_0x23cf59,_0x30d137,_0x1b0c2f,_0x383643)['then'](function(_0x3b2dd1){return _0x2eb012(_0x3b2dd1);});default:return _0x39f911(msgResponse(_0x3467('0x1d6'),'Failure','Unknown\x20Predictive'));}}else{return _0x39f911(msgResponse(_0x3467('0x1d6'),_0x3467('0x9a'),_0x3467('0x1d7')));}});};};Dialer[_0x3467('0x92')]['getDataPredictiveOld']=function(_0x984147){var _0x553fbc=this;return function(_0x521d75){return new Promise(function(_0x196f41,_0x502de0){_[_0x3467('0x5f')](_0x984147,_0x521d75[0x0]);if(checkGetDataPredictive(_0x521d75[0x0])){loggerPredictive[_0x3467('0x4a')](JSON[_0x3467('0x87')](_0x521d75[0x0]));if(_0x984147['dialPredictiveOptimization']===_0x3467('0x1c5')){return _0x553fbc[_0x3467('0x155')](_0x984147['id'])[_0x3467('0x40')](function(_0x5d6085){var _0x162dfa=_0x984147[_0x3467('0x1d8')]-_0x5d6085[0x0][_0x3467('0x1d9')];var _0xa57a46=_0x984147[_0x3467('0x1c9')]*0x3c;var _0x21fd94=_0x521d75[0x0][_0x3467('0x53')]+_0x521d75[0x0]['predictiveIntervalAvgHoldtime'];var _0x238570=(_0x521d75[0x0][_0x3467('0x1d2')]+_0x521d75[0x0][_0x3467('0x4f')]+_0x521d75[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x521d75[0x0][_0x3467('0x4c')];var _0x166c02=_0x984147[_0x3467('0x1ba')]/0x64;_0x984147[_0x3467('0x1da')]=_0x5d6085[0x0]['outboundQueuePauses']||0x0;_0x984147['predictiveIntervalHitRate']=_0x238570>0x0?_0x238570:0x1;return _0x553fbc['abandonmentRate'](_0x162dfa,_0xa57a46,_0x21fd94,_0x238570,_0x166c02);})[_0x3467('0x40')](function(_0x513669){return _0x196f41(_0x513669);})[_0x3467('0xa3')](function(_0x4769cf){return _0x502de0(msgResponse(_0x3467('0x1db'),'Failure',JSON[_0x3467('0x87')](_0x4769cf)));});}if(_0x984147[_0x3467('0x1d3')]===_0x3467('0x1dc')){return _0x553fbc[_0x3467('0x155')](_0x984147['id'])[_0x3467('0x40')](function(_0x3c22e7){var _0x22c7b6=_0x984147[_0x3467('0x1d8')]-_0x3c22e7[0x0][_0x3467('0x1d9')];var _0x197f5e=_0x984147[_0x3467('0x1c9')]*0x3c;var _0x21d9da=_0x521d75[0x0][_0x3467('0x53')]+_0x521d75[0x0][_0x3467('0x55')];var _0x7a993f=(_0x521d75[0x0][_0x3467('0x1d2')]+_0x521d75[0x0][_0x3467('0x4f')]+_0x521d75[0x0][_0x3467('0x51')])/_0x521d75[0x0][_0x3467('0x4c')];var _0x3a5b12=_0x984147[_0x3467('0x1ba')]/0x64;_0x984147[_0x3467('0x1da')]=_0x3c22e7[0x0][_0x3467('0x1d9')]||0x0;_0x984147[_0x3467('0x1bf')]=_0x7a993f>0x0?_0x7a993f:0x1;return _0x553fbc[_0x3467('0x1d5')](_0x22c7b6,_0x197f5e,_0x21d9da,_0x7a993f,_0x3a5b12);})[_0x3467('0x40')](function(_0x3ba3cd){return _0x196f41(_0x3ba3cd);})[_0x3467('0xa3')](function(_0x3f7c8f){return _0x502de0(msgResponse(_0x3467('0x1db'),_0x3467('0x9a'),JSON[_0x3467('0x87')](_0x3f7c8f)));});}}else{return _0x502de0(msgResponse(_0x3467('0x1d6'),_0x3467('0x9a'),_0x3467('0x1d7')));}});};};Dialer[_0x3467('0x92')][_0x3467('0x1ce')]=function(_0x18d13a){var _0x6f633d=this;return function(){var _0x127acb=0x0;var _0xc7ac30=Math['floor'](_0x18d13a[_0x3467('0x1dd')]*0x3e8);if(_0xc7ac30>0x0){_0xc7ac30=_0xc7ac30<0x64?0x64:_0xc7ac30;loggerPredictive[_0x3467('0x4a')](_0x18d13a['name'],'one\x20call\x20every:',_0xc7ac30,_0x3467('0x1de'));_0x18d13a['handlePredictive']=setInterval(function(){_0x6f633d['handlePredictive'](_0x18d13a);loggerPredictiveCalls[_0x3467('0x4a')](_0x3467('0x1df'),_0x127acb+=0x1);},_0xc7ac30);}else{loggerPredictive[_0x3467('0x4a')](_0x18d13a[_0x3467('0x61')],_0x3467('0x1e0'));}};};Dialer['prototype']['checkContactBlack']=function(_0x2bbdf1,_0x484416){var _0x39e0a8=this;return function(_0x44f5b0){if(_['isEmpty'](_0x44f5b0)){if(_[_0x3467('0xfd')](_0x484416['UserId'])||!_0x484416[_0x3467('0x1e1')]){if(_0x2bbdf1['dialMethod']===_0x3467('0x9')){_0x2bbdf1['queueStatusComplete']=_[_0x3467('0x41')](_0x2bbdf1[_0x3467('0x73')])?!![]:_0x2bbdf1[_0x3467('0x73')];var _0x296f99=uuid['v4']();_0x39e0a8[_0x3467('0x24')][_0x296f99]=new Action(_0x2bbdf1,_0x484416,_0x296f99);loggerBooked[_0x3467('0x4a')](_0x3467('0x1e2'),_0x296f99,_0x3467('0x1e3'),JSON[_0x3467('0x87')](_0x2bbdf1['queueStatusComplete']),_0x3467('0x1e4'),_0x2bbdf1[_0x3467('0x61')]);if(_0x2bbdf1[_0x3467('0x73')]){_0x2bbdf1[_0x3467('0x73')]=![];_0x39e0a8['queueBooked'][_0x39e0a8[_0x3467('0x24')][_0x296f99][_0x3467('0xc5')]]=[];ami['Action']({'actionid':_0x296f99,'action':_0x3467('0x1e5'),'queue':_0x2bbdf1[_0x3467('0x61')]})[_0x3467('0xa3')](function(){_0x39e0a8[_0x3467('0xc9')](_0x2bbdf1);hopperUtils[_0x3467('0xe2')]({'active':![],'ContactId':_0x39e0a8[_0x3467('0x24')][_0x296f99][_0x3467('0xf6')],'ListId':_0x39e0a8[_0x3467('0x24')][_0x296f99][_0x3467('0xe6')],'VoiceQueueId':_0x39e0a8[_0x3467('0x24')][_0x296f99][_0x3467('0xf7')]||undefined,'CampaignId':_0x39e0a8[_0x3467('0x24')][_0x296f99][_0x3467('0xe7')]||undefined})['catch'](loggerCatch(_0x3467('0x1e6')));delete _0x39e0a8[_0x3467('0x24')][_0x296f99];});}else{loggerBooked[_0x3467('0x4a')]('[booked][checkContactBlack][else]',JSON[_0x3467('0x87')](_0x2bbdf1[_0x3467('0x73')]),_0x3467('0x1e4'),_0x2bbdf1['name']);_0x39e0a8[_0x3467('0xc9')](_0x2bbdf1);hopperUtils[_0x3467('0xe2')]({'active':![],'ContactId':_0x39e0a8['actions'][_0x296f99][_0x3467('0xf6')],'ListId':_0x39e0a8[_0x3467('0x24')][_0x296f99][_0x3467('0xe6')],'VoiceQueueId':_0x39e0a8[_0x3467('0x24')][_0x296f99]['VoiceQueueId']||undefined,'CampaignId':_0x39e0a8[_0x3467('0x24')][_0x296f99]['CampaignId']||undefined})[_0x3467('0xa3')](loggerCatch(_0x3467('0x1e6')));delete _0x39e0a8['actions'][_0x296f99];}}else{return _0x39e0a8[_0x3467('0x1e7')](_0x2bbdf1,_0x484416);}}else{if(utils[_0x3467('0x60')](undefined,_0x484416['scheduledat'])<_0x2bbdf1[_0x3467('0x1e8')]*0x3c){if(_0x484416[_0x3467('0x14c')]&&!_0x484416[_0x3467('0x14c')][_0x3467('0x1e9')]){_0x39e0a8[_0x3467('0x1d')][_0x3467('0x103')](_0x484416['id'])['finally'](function(){_0x39e0a8[_0x3467('0xc9')](_0x2bbdf1);});}else{hopperUtils[_0x3467('0x1ea')]({'active':![]},_0x484416['id'],0x1)[_0x3467('0x10c')](function(){_0x39e0a8[_0x3467('0xc9')](_0x2bbdf1);});}}else{_0x2bbdf1['outboundReCallsDay']+=0x1;_0x39e0a8['updateOriginated'](_0x2bbdf1);if(_0x2bbdf1[_0x3467('0x1eb')]){hopperUtils[_0x3467('0xe2')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x484416[_0x3467('0xf6')],'ListId':_0x484416['ListId'],'VoiceQueueId':_0x484416[_0x3467('0xf7')]||undefined,'CampaignId':_0x484416[_0x3467('0xe7')]||undefined})[_0x3467('0xa3')](loggerCatch(_0x3467('0x1ec')));hopperUtils['createHistory'](createObjHistory(_0x2bbdf1,_0x484416,utils[_0x3467('0x6a')][_0x3467('0x1ed')],0x17,_0x3467('0x1ee')))[_0x3467('0xa3')](loggerCatch(_0x3467('0x1ef')));}else{_0x39e0a8[_0x3467('0x159')](createObjHistory(_0x2bbdf1,_0x484416,utils[_0x3467('0x6a')]['RECALL_TIMEOUT'],0x16,_0x3467('0x1f0')),_0x3467('0x1f1'),_0x3467('0x1f2'));}}}}else{_0x2bbdf1[_0x3467('0x1f3')]+=0x1;_0x39e0a8[_0x3467('0x159')](createObjHistory(_0x2bbdf1,_0x484416,utils[_0x3467('0x6a')][_0x3467('0x1f4')],0xd,_0x3467('0x1f5')),_0x3467('0x1f6'),_0x3467('0x1f7'));throw'inBlackList';}};};Dialer[_0x3467('0x92')][_0x3467('0x15d')]=function(_0x2769fc){var _0xa959d4=this;var _0x582042=_0x2769fc['limitCalls']-_0x2769fc['originated'];emitCampaignSummary(_0x2769fc);if(_0x582042>0x0&&_0x2769fc[_0x3467('0x68')]==0x0){if(_0x582042>this[_0x3467('0x22')]){_0x582042=this['maxNumberOriginate'];}_0x2769fc[_0x3467('0x68')]=0x1;hopperUtils['getContactDialerIvr'](_0x2769fc,_0x582042)['then'](function(_0x3bf88b){_0x2769fc[_0x3467('0x68')]=0x0;if(_0x3bf88b){if(!utils[_0x3467('0x1f8')](_0x3bf88b)){_0x2769fc[_0x3467('0x69')]=utils[_0x3467('0x6a')][_0x3467('0x6e')];logger[_0x3467('0x4a')]('[getContactCampaign2][Empty]'+_0x2769fc['name']);}else{_0x2769fc[_0x3467('0x81')]+=_0x3bf88b[_0x3467('0x149')];_0x2769fc['message']=utils[_0x3467('0x6a')][_0x3467('0x1f9')];for(var _0x553071=0x0;_0x553071<_0x3bf88b[_0x3467('0x149')];_0x553071+=0x1){_0x2769fc[_0x3467('0x1fa')]+=0x1;if(_[_0x3467('0xfd')](_0x3bf88b[_0x553071])||_[_0x3467('0xfd')](_0x3bf88b[_0x553071][_0x3467('0x179')])||_[_0x3467('0xfd')](_0x3bf88b[_0x553071][_0x3467('0x161')])){_0xa959d4[_0x3467('0x157')](_0x3467('0x1fb'),_0x2769fc,_0x3bf88b[_0x553071]);}else{hopperUtils['checkIsBlackListIvr'](_[_0x3467('0x76')](_0x3bf88b[_0x553071],[_0x3467('0xe7'),'phone']))[_0x3467('0x40')](_0xa959d4[_0x3467('0x1fc')](_0x2769fc,_0x3bf88b[_0x553071]))['catch'](_0xa959d4['loggerHandler']('[actionOriginateIvr]\x20',_0x2769fc));}}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x2769fc,_0x582042));}};Dialer['prototype']['handlePower']=function(_0x500f73,_0x314562){var _0x5877fb=this;var _0x447c4d=[];if(_0x314562<0x1||_0x500f73[_0x3467('0xb8')]===_0x3467('0x9')){_0x314562=0x1;}var _0x58ff20=Math['floor'](_0x500f73[_0x3467('0x1be')]*_0x314562)-_0x500f73[_0x3467('0x81')];if(_0x500f73[_0x3467('0x1fd')]>0x0){var _0x513fa=_0x500f73['dialLimitQueue']-_0x500f73[_0x3467('0x81')]-_0x500f73[_0x3467('0x140')]-_0x500f73[_0x3467('0x141')];if(_0x58ff20>_0x513fa){_0x58ff20=_0x513fa;}}if(_0x58ff20>0x0&&_0x500f73[_0x3467('0x68')]==0x0){if(_0x500f73[_0x3467('0xb8')]===_0x3467('0x9')){_0x58ff20=0x1;}if(_0x58ff20>this['maxNumberOriginate']){_0x58ff20=this['maxNumberOriginate'];}for(var _0x1ef025 in this['agents']){if(typeof this[_0x3467('0x20')][_0x1ef025]!==_0x3467('0xb0')){if(this[_0x3467('0x20')][_0x1ef025][_0x3467('0x70')]===_0x3467('0x1fe')&&this[_0x3467('0x20')][_0x1ef025][_0x3467('0x8b')]===_0x3467('0x8c')){_0x447c4d[_0x3467('0x9d')](this[_0x3467('0x20')][_0x1ef025]['id']);}}}_0x500f73[_0x3467('0x68')]=0x1;hopperUtils['getContactDialer'](_0x500f73,_0x447c4d,_0x58ff20)['then'](function(_0x553362){_0x500f73[_0x3467('0x68')]=0x0;if(_0x553362){if(!utils[_0x3467('0x1f8')](_0x553362)){hopperUtils[_0x3467('0x1ff')](_0x500f73)['then'](sendMessageReschedule(_0x500f73))['catch'](loggerCatch(_0x3467('0x200')));}else{_0x500f73[_0x3467('0x81')]+=_0x553362[_0x3467('0x149')];_0x500f73['message']=_0x500f73[_0x3467('0xb8')]==='booked'?utils[_0x3467('0x6a')][_0x3467('0x142')]:utils[_0x3467('0x6a')][_0x3467('0x1f9')];for(var _0x290cb3=0x0;_0x290cb3<_0x553362['length'];_0x290cb3+=0x1){if(_[_0x3467('0xfd')](_0x553362[_0x290cb3])||_['isNil'](_0x553362[_0x290cb3][_0x3467('0x179')])||_[_0x3467('0xfd')](_0x553362[_0x290cb3][_0x3467('0x161')])){_0x5877fb[_0x3467('0x157')](_0x3467('0x1fb'),_0x500f73,_0x553362[_0x290cb3]);}else{hopperUtils[_0x3467('0x201')](_['pick'](_0x553362[_0x290cb3],[_0x3467('0xf7'),_0x3467('0x161')]))['then'](_0x5877fb[_0x3467('0x1fc')](_0x500f73,_0x553362[_0x290cb3]))[_0x3467('0xa3')](_0x5877fb[_0x3467('0x202')]('[actionOriginate]\x20',_0x500f73));}}}}})[_0x3467('0xa3')](loggerGetContactDialer(_0x3467('0x203'),_0x500f73,_0x58ff20));}};Dialer['prototype'][_0x3467('0x64')]=function(_0x28d1ce){if(_0x28d1ce['dialLimitQueue']>0x0){var _0x2ec0c3=_0x28d1ce['dialLimitQueue']-_0x28d1ce[_0x3467('0x81')]-_0x28d1ce[_0x3467('0x140')];if(_0x2ec0c3>0x0&&_0x28d1ce[_0x3467('0x68')]==0x0){this[_0x3467('0x204')](_0x28d1ce);}else{loggerPredictiveCalls['info'](_0x3467('0x205'));}}else{this['tryOriginatePredictive'](_0x28d1ce);}};Dialer[_0x3467('0x92')]['tryOriginatePredictive']=function(_0x5bf70c){var _0x2460cb=this;var _0x5326c2=[];_0x5bf70c[_0x3467('0x81')]+=0x1;for(var _0x437e20 in this[_0x3467('0x20')]){if(typeof this['agents'][_0x437e20]!==_0x3467('0xb0')){if(this[_0x3467('0x20')][_0x437e20][_0x3467('0x70')]===_0x3467('0x1fe')&&this['agents'][_0x437e20]['status']===_0x3467('0x8c')){_0x5326c2[_0x3467('0x9d')](this[_0x3467('0x20')][_0x437e20]['id']);}}}_0x5bf70c[_0x3467('0x68')]=0x1;return this[_0x3467('0x206')](_0x5bf70c['id'],_0x5326c2,0x1,_0x5bf70c[_0x3467('0x207')],_0x5bf70c)[_0x3467('0x40')](function(_0x111617){_0x5bf70c['temp']=0x1;if(_0x111617){if(!utils['checkContactEmpty'](_0x111617)){utils['checkContactLowerLimitOriginate'](_0x5bf70c,0x1,0x0);return hopperUtils['countReScheduled'](_0x5bf70c)['then'](sendMessageReschedule(_0x5bf70c))[_0x3467('0xa3')](loggerCatch(_0x3467('0x200')));}else{_0x5bf70c[_0x3467('0x69')]=utils[_0x3467('0x6a')]['RUNNING'];if(_['isNil'](_0x111617[0x0])||_[_0x3467('0xfd')](_0x111617[0x0][_0x3467('0x179')])||_[_0x3467('0xfd')](_0x111617[0x0][_0x3467('0x161')])){_0x2460cb['emptyContact'](_0x3467('0x1fb'),_0x5bf70c,_0x111617[0x0]);}else{return hopperUtils[_0x3467('0x201')](_['pick'](_0x111617[0x0],['VoiceQueueId',_0x3467('0x161')]))[_0x3467('0x40')](_0x2460cb[_0x3467('0x1fc')](_0x5bf70c,_0x111617[0x0]))[_0x3467('0xa3')](_0x2460cb[_0x3467('0x202')](_0x3467('0x208'),_0x5bf70c));}}}})['catch'](loggerGetContactDialer(_0x3467('0x209'),_0x5bf70c,0x1));};Dialer['prototype'][_0x3467('0x1d4')]=function(_0x31186e,_0x398b71,_0x3d62d4,_0x48631e,_0x4b1624,_0x4fb602){loggerPredictive[_0x3467('0x4a')](_0x3467('0x20a'));loggerPredictive[_0x3467('0x4a')](_0x3467('0x20b'),_0x31186e);loggerPredictive[_0x3467('0x4a')](_0x3467('0x20c'),_0x398b71);loggerPredictive[_0x3467('0x4a')](_0x3467('0x20d'),_0x3d62d4);loggerPredictive[_0x3467('0x4a')](_0x3467('0x20e'),_0x48631e);loggerPredictive['info'](_0x3467('0x20f'),_0x4b1624);loggerPredictive[_0x3467('0x4a')]('---------------------------');return new Promise(function(_0x3005e0,_0x520ed1){if(_0x31186e<=0x0||isNaN(_0x31186e)){return _0x520ed1(msgResponse(_0x3467('0x210'),_0x3467('0x86'),_0x3467('0x211')+_0x31186e));}if(_0x3d62d4<=0x0||isNaN(_0x3d62d4)){return _0x520ed1(msgResponse(_0x3467('0x210'),_0x3467('0x86'),_0x3467('0x212')+_0x3d62d4));}if(_0x48631e<=0x0||isNaN(_0x48631e)){return _0x520ed1(msgResponse(_0x3467('0x210'),_0x3467('0x86'),_0x3467('0x213')+_0x48631e));}if(_0x398b71<=0x0||isNaN(_0x398b71)){return _0x520ed1(msgResponse(_0x3467('0x210'),_0x3467('0x86'),'interval\x20=\x20'+_0x398b71));}if(_0x4b1624<=0x0||isNaN(_0x4b1624)){return _0x520ed1(msgResponse(_0x3467('0x210'),'Error',_0x3467('0x214')+_0x4b1624));}_0x4fb602=_0x4fb602||0x0;var _0x4e0f7b=0x1/_0x3d62d4;var _0x1c442c=0x0;var _0x39994a=0x0;var _0x375ad3=0x0;var _0x1110b5=0x0;for(var _0x24373b=0x0;_0x375ad3<_0x4b1624;_0x24373b+=0x1){_0x39994a=_0x24373b/_0x398b71;_0x1c442c=(_0x48631e*_0x39994a+_0x4fb602)/_0x4e0f7b;_0x375ad3=utils[_0x3467('0x215')](_0x1c442c,_0x31186e);_0x1110b5=_0x1c442c/_0x31186e*(0x1-utils['erlangb'](_0x1c442c,_0x31186e));}return _0x3005e0({'erlangCalls':_0x24373b,'erlangCallToSecond':_0x398b71/_0x24373b,'erlangAbandonmentRate':_0x375ad3,'erlangBusyFactor':_0x1110b5});});};Dialer[_0x3467('0x92')][_0x3467('0x1d5')]=function(_0x252018,_0x2147c4,_0xf3b94a,_0xa6584d,_0x8cf1dd,_0x59ecb6){loggerPredictive[_0x3467('0x4a')](_0x3467('0x216'));loggerPredictive[_0x3467('0x4a')](_0x3467('0x20b'),_0x252018);loggerPredictive[_0x3467('0x4a')](_0x3467('0x20c'),_0x2147c4);loggerPredictive['info'](_0x3467('0x20d'),_0xf3b94a);loggerPredictive[_0x3467('0x4a')](_0x3467('0x20e'),_0xa6584d);loggerPredictive[_0x3467('0x4a')](_0x3467('0x217'),_0x8cf1dd);loggerPredictive[_0x3467('0x4a')](_0x3467('0x54'));return new Promise(function(_0x59ae7,_0x56506b){if(_0x252018<=0x0||isNaN(_0x252018)){return _0x56506b(msgResponse(_0x3467('0x218'),'Error','m\x20=\x20'+_0x252018));}if(_0xf3b94a<=0x0||isNaN(_0xf3b94a)){return _0x56506b(msgResponse(_0x3467('0x218'),'Error','Ts\x20=\x20'+_0xf3b94a));}if(_0xa6584d<=0x0||isNaN(_0xa6584d)){return _0x56506b(msgResponse(_0x3467('0x218'),'Error',_0x3467('0x213')+_0xa6584d));}if(_0x2147c4<=0x0||isNaN(_0x2147c4)){return _0x56506b(msgResponse('[busyFactor]',_0x3467('0x86'),_0x3467('0x219')+_0x2147c4));}if(_0x8cf1dd<=0x0||isNaN(_0x8cf1dd)){return _0x56506b(msgResponse(_0x3467('0x218'),_0x3467('0x86'),'Umin\x20=\x20'+_0x8cf1dd));}_0x59ecb6=_0x59ecb6||0x0;var _0x1718a4=0x1/_0xf3b94a;var _0x11fc4f=0x0;var _0x33cbfc=0x0;var _0x3acd02=0x0;var _0x515e7a=0x0;for(var _0x237d1e=0x0;_0x515e7a<_0x8cf1dd;_0x237d1e+=0x1){_0x33cbfc=_0x237d1e/_0x2147c4;_0x11fc4f=(_0xa6584d*_0x33cbfc+_0x59ecb6)/_0x1718a4;_0x3acd02=utils[_0x3467('0x215')](_0x11fc4f,_0x252018);_0x515e7a=_0x11fc4f/_0x252018*(0x1-utils[_0x3467('0x215')](_0x11fc4f,_0x252018));}return _0x59ae7({'erlangCalls':_0x237d1e,'erlangCallToSecond':_0x2147c4/_0x237d1e,'erlangAbandonmentRate':_0x3acd02,'erlangBusyFactor':_0x515e7a});});};module['exports']=Dialer; \ No newline at end of file +var _0xaba5=['reason','agiafterat','dialAgiAfterHangupAgent','createHistory','moveContactManagedDialer','[syncAgentComplete]','updateOriginated','droptime','responsetime','outboundDropCallsDayTimeout','Drop','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','minutes','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','add','ContactId','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','isNil','paused','stateinterface','locked','merge','roundrobin','preview','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','membername','AMD','custom:amd','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','countmachineretry','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','Machine','dialMachineMaxRetry','createStateFinal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','No\x20such\x20channel','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','handleIvr','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','Trunk','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','substring','dialCutDigit','trim','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','reason\x205\x20busy','outboundCongestionCallsDay','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','outboundUnknownCallsDay','[callProgressDetecting]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','agentBusyFactor','loggedIn','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','checkContactEmpty','NO_AVAILABLE_CONTACTS','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','getContactDialer','dialOrderByScheduledAt','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','moment','ioredis','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','emit','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','name','voice_queue:save','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','info','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','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','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','isUndefined','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','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','erlangBusyFactor','erlangAbandonmentRate','getSeconds','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','CAMPAIGN_STATUS','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','stringify','pick','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Interval','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','format','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','TrunkBackup','TRUNK_NOT_REACHABLE','checkIfTime','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','UNKNOWN_TIMEZONE','isArray','Action','content','indexOf','push','command','iftime\x20%s,%s','timezones','true','catch','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','queue','uniqueid','type','ivr','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaba5,0x154));var _0x5aba=function(_0x15f72d,_0x210047){_0x15f72d=_0x15f72d-0x0;var _0x497fac=_0xaba5[_0x15f72d];return _0x497fac;};'use strict';var util=require(_0x5aba('0x0'));var _=require(_0x5aba('0x1'));var uuid=require('uuid');var moment=require(_0x5aba('0x2'));var rr=require('rr');var Redis=require(_0x5aba('0x3'));var utils=require('./utils');var hopperUtils=require(_0x5aba('0x4'));var ut=require(_0x5aba('0x5'));var config=require(_0x5aba('0x6'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0x5aba('0x7'))(_0x5aba('0x8'));var loggerPredictive=require(_0x5aba('0x7'))(_0x5aba('0x9'));var loggerPredictiveCalls=require(_0x5aba('0x7'))(_0x5aba('0xa'));var loggerSyncQueueSummary=require(_0x5aba('0x7'))(_0x5aba('0xb'));var ami=require(_0x5aba('0xc'));config['redis']=_[_0x5aba('0xd')](config[_0x5aba('0xe')],{'host':_0x5aba('0xf'),'port':0x18eb});var io=require(_0x5aba('0x10'))(new Redis(config['redis']));var cmHopper=require(_0x5aba('0x11'));var voiceQueueRt=require(_0x5aba('0x12'));var RpcSetting=require(_0x5aba('0x13'));var Interval=require(_0x5aba('0x14'));var Action=require(_0x5aba('0x15'));var History=require(_0x5aba('0x16'));var Final=require(_0x5aba('0x17'));var AgentComplete=require(_0x5aba('0x18'));var QueueCallerAbandon=require(_0x5aba('0x19'));var Hangup=require(_0x5aba('0x1a'));var ipAgi=process[_0x5aba('0x1b')][_0x5aba('0x1c')]||_0x5aba('0x1d');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x5aba('0x1e')][_0x5aba('0x1f')]=function(_0x1f8f2e){this[_0x5aba('0x20')]=this['tail']?this[_0x5aba('0x20')][_0x5aba('0x21')](_0x1f8f2e):_0x1f8f2e();};function Dialer(_0x4a9bb5,_0x3b6853){this[_0x5aba('0x22')]=new Sequence();this['preview']=_0x3b6853;this[_0x5aba('0x23')]=_0x4a9bb5[_0x5aba('0x23')];this[_0x5aba('0x24')]=_0x4a9bb5[_0x5aba('0x24')];this[_0x5aba('0x25')]=_0x4a9bb5[_0x5aba('0x25')];this[_0x5aba('0x26')]=_0x4a9bb5[_0x5aba('0x26')];this[_0x5aba('0x27')]=config[_0x5aba('0x27')]||0x2;this['channels']={};this[_0x5aba('0x28')]={};this['contactsId']={};this[_0x5aba('0x29')]={};this[_0x5aba('0x2a')]={};this[_0x5aba('0x2b')]={};this[_0x5aba('0x2c')]={};this[_0x5aba('0x2d')]={};this[_0x5aba('0x2e')]={};this[_0x5aba('0x2f')]={};this[_0x5aba('0x30')]={};ami['on'](_0x5aba('0x31'),this[_0x5aba('0x32')][_0x5aba('0x33')](this));ami['on'](_0x5aba('0x34'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x5aba('0x35'),this[_0x5aba('0x36')][_0x5aba('0x33')](this));ami['on'](_0x5aba('0x37'),this[_0x5aba('0x38')][_0x5aba('0x33')](this));ami['on'](_0x5aba('0x39'),this[_0x5aba('0xb')][_0x5aba('0x33')](this));ami['on'](_0x5aba('0x3a'),this['syncQueueSummaryComplete'][_0x5aba('0x33')](this));ami['on'](_0x5aba('0x3b'),this[_0x5aba('0x3c')]['bind'](this));ami['on'](_0x5aba('0x3d'),this[_0x5aba('0x3e')][_0x5aba('0x33')](this));ami['on'](_0x5aba('0x3f'),this[_0x5aba('0x40')][_0x5aba('0x33')](this));ami['on'](_0x5aba('0x41'),this[_0x5aba('0x42')][_0x5aba('0x33')](this));ami['on'](_0x5aba('0x43'),this[_0x5aba('0x44')][_0x5aba('0x33')](this));this[_0x5aba('0x45')]();this[_0x5aba('0x46')]();RpcSetting[_0x5aba('0x47')]()[_0x5aba('0x48')](function(_0x4c26b2){previewRecallmeReminderInterval=_0x4c26b2[_0x5aba('0x49')];});}function isNotNull(_0x2d5717){return _0x2d5717!==null&&!_['isUndefined'](_0x2d5717);}function msgResponse(_0x33b2d4,_0x29f308,_0x337edb){return{'action':_0x33b2d4,'response':_0x29f308,'message':_0x337edb,'stack':_0x337edb};}function emit(_0xe1c180,_0x531fce,_0x544342){io['to'](_0xe1c180)[_0x5aba('0x4a')](_0x531fce,_0x544342);}function emitOutboundVoiceQueueSummary(_0x4bace7){if(_0x4bace7['type']==='outbound'){logger[_0x5aba('0x4b')](_0x5aba('0x4c'),util[_0x5aba('0x4d')](_0x4bace7,{'showHidden':![],'depth':null}));emit(util['format'](_0x5aba('0x4e'),_0x4bace7[_0x5aba('0x4f')]),_0x5aba('0x50'),_0x4bace7);}}function checkGetDataPredictive(_0x2ae465){if(isNotNull(_0x2ae465)&&!_['isEmpty'](_0x2ae465)){loggerPredictive['info'](_0x5aba('0x51'));loggerPredictive['info'](_0x5aba('0x52'),_0x2ae465[_0x5aba('0x53')]);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x55'),_0x2ae465[_0x5aba('0x56')]);loggerPredictive['info'](_0x5aba('0x57'),_0x2ae465[_0x5aba('0x58')]);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x59'),_0x2ae465['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x5a'),_0x2ae465[_0x5aba('0x5b')]);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x5c'),_0x2ae465[_0x5aba('0x5d')]);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x5e'));if(_0x2ae465[_0x5aba('0x53')]>0x0){if(!_[_0x5aba('0x5f')](_0x2ae465[_0x5aba('0x5d')])&&_0x2ae465[_0x5aba('0x5d')]>0x0){return!![];}loggerPredictive[_0x5aba('0x54')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x2ae465[_0x5aba('0x5b')])&&_0x2ae465[_0x5aba('0x5b')]>0x0){return!![];}loggerPredictive[_0x5aba('0x54')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x5aba('0x54')](_0x5aba('0x60'));}}else{loggerPredictive[_0x5aba('0x54')](_0x5aba('0x61'));}return![];}function mergeDataErlangB(_0xe72527){return function(_0x1bf018){loggerPredictive[_0x5aba('0x54')](_0x5aba('0x62'));loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1bf018[_0x5aba('0x63')]);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x64'),_0x1bf018[_0x5aba('0x65')]);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x66'),_0x1bf018['erlangAbandonmentRate']);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x67'),_0x1bf018[_0x5aba('0x68')]);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x66'),_0x1bf018[_0x5aba('0x69')]);loggerPredictive['info'](_0x5aba('0x5e'));_['merge'](_0xe72527,_0x1bf018);};}function ifInterval(_0x387c59,_0x2054c5){if(_[_0x5aba('0x5f')](_0x2054c5)){return![];}return utils[_0x5aba('0x6a')](undefined,_0x2054c5)<_0x387c59*0x3c;}function clearPredictiveAttributes(_0x47cb3c){if(_0x47cb3c[_0x5aba('0x2c')]){_0x47cb3c[_0x5aba('0x2c')]=undefined;loggerPredictive[_0x5aba('0x4b')](_0x47cb3c['name'],_0x5aba('0x6b'));}if(_0x47cb3c[_0x5aba('0x2b')]){_0x47cb3c[_0x5aba('0x2b')]=undefined;loggerPredictive['debug'](_0x47cb3c['name'],_0x5aba('0x6c'));}if(_0x47cb3c[_0x5aba('0x6d')]){clearInterval(_0x47cb3c[_0x5aba('0x6d')]);_0x47cb3c['handlePredictive']=undefined;loggerPredictive[_0x5aba('0x4b')](_0x47cb3c['name'],_0x5aba('0x6e'));}}function loggerCatchPredictive(_0x3cbaf7,_0x144824){return function(_0x38f515){loggerPredictive[_0x5aba('0x6f')](_0x144824[_0x5aba('0x4f')],_0x3cbaf7);loggerPredictive[_0x5aba('0x6f')](_0x38f515[_0x5aba('0x70')]);clearPredictiveAttributes(_0x144824);};}function loggerCatch(_0x1a13e2){return function(_0x247847){logger[_0x5aba('0x6f')](_0x1a13e2,util[_0x5aba('0x4d')](_0x247847,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x4915f4,_0x3c5923,_0x102874){return function(_0x3b9c03){utils[_0x5aba('0x71')](_0x3c5923,_0x102874,0x0);_0x3c5923[_0x5aba('0x72')]=0x0;logger[_0x5aba('0x6f')](_0x4915f4,util[_0x5aba('0x4d')](_0x3b9c03,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x44f987){return function(_0x233f4f){if(isNotNull(_0x233f4f)&&isNotNull(_0x233f4f[0x0])){if(_0x233f4f[0x0][_0x5aba('0x73')]>0x0){_0x44f987[_0x5aba('0x74')]=utils['CAMPAIGN_STATUS'][_0x5aba('0x75')];logger['info'](_0x5aba('0x76')+_0x44f987[_0x5aba('0x4f')],_0x233f4f[0x0][_0x5aba('0x73')],_0x5aba('0x77'));}else{_0x44f987[_0x5aba('0x74')]=utils[_0x5aba('0x78')]['NO_AVAILABLE_CONTACTS'];logger[_0x5aba('0x54')]('[getContactDialer2][Empty]'+_0x44f987[_0x5aba('0x4f')]);}}};}function createObjHistory(_0x37e43c,_0x3cf4cb,_0x909795,_0x454289,_0x3f104f){_0x37e43c[_0x5aba('0x74')]=_0x909795;var _0x5426c6=new Action(_0x37e43c,_0x3cf4cb);var _0x341bee=new History(_0x5426c6);_0x341bee[_0x5aba('0x79')]=_0x454289;_0x341bee[_0x5aba('0x7a')]=_0x3f104f;_0x341bee[_0x5aba('0x7b')]=_0x5426c6[_0x5aba('0x7c')];return _0x341bee;}function unlockQueueStatus(_0x24ccb7,_0x8eef36){setTimeout(function(){if(_[_0x5aba('0x5f')](_0x24ccb7[_0x5aba('0x7d')])){loggerBooked[_0x5aba('0x6f')](_0x5aba('0x7e'),_0x8eef36);}_0x24ccb7[_0x5aba('0x7d')]=!![];loggerBooked[_0x5aba('0x54')]('[booked][unlockQueueStatus]',_0x8eef36,JSON[_0x5aba('0x7f')](_[_0x5aba('0x80')](_0x24ccb7,['name',_0x5aba('0x7d')])));},0x1f3);}function checkInterval(_0x3dda0c){return function(){if(!isNotNull(_0x3dda0c['Interval'])){_0x3dda0c[_0x5aba('0x74')]=utils[_0x5aba('0x78')][_0x5aba('0x81')];throw _0x3dda0c[_0x5aba('0x4f')]+_0x5aba('0x82');}if(!isNotNull(_0x3dda0c['Interval'][_0x5aba('0x83')])){_0x3dda0c[_0x5aba('0x74')]=utils[_0x5aba('0x78')][_0x5aba('0x81')];throw _0x3dda0c[_0x5aba('0x4f')]+_0x5aba('0x82');}if(!isNotNull(_[_0x5aba('0x84')](_0x3dda0c[_0x5aba('0x85')]['Intervals']))){_0x3dda0c['message']=utils[_0x5aba('0x78')]['NULL_INTERVAL'];throw _0x3dda0c[_0x5aba('0x4f')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x2d9225){return function(){if(!utils[_0x5aba('0x86')](_0x2d9225)){_0x2d9225[_0x5aba('0x74')]=utils[_0x5aba('0x78')][_0x5aba('0x87')];throw _0x2d9225['name']+_0x5aba('0x88');}};}function emitCampaignSummary(_0x3de237){if(utils[_0x5aba('0x89')](_0x3de237)){emit(util[_0x5aba('0x8a')](_0x5aba('0x8b'),_0x3de237['name']),_0x5aba('0x8c'),_0x3de237);}}function loggerCatchQueueSummary(_0x42ad26,_0x1e5049){return function(_0x306382){clearPredictiveAttributes(_0x1e5049);emitCampaignSummary(_0x1e5049);loggerSyncQueueSummary[_0x5aba('0x4b')](_0x42ad26,util[_0x5aba('0x4d')](_0x306382,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x3ae30a){if(_0x3ae30a[_0x5aba('0x8d')]){if(_0x3ae30a[_0x5aba('0x8e')]===0x0){_0x3ae30a['sendMessageOneNotActive']=![];_0x3ae30a['message']=utils[_0x5aba('0x78')]['INACTIVE'];loggerSyncQueueSummary['debug'](_0x5aba('0x8f'),_0x3ae30a['name'],_0x5aba('0x90'));}else{_0x3ae30a['message']=utils[_0x5aba('0x78')][_0x5aba('0x91')];loggerSyncQueueSummary[_0x5aba('0x4b')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3ae30a[_0x5aba('0x4f')],_0x5aba('0x92'));}emitCampaignSummary(_0x3ae30a);}}function myreject(_0x5886a0){return function(_0x12bd82){return _0x5886a0(msgResponse(_0x5aba('0x93'),_0x5aba('0x94'),JSON['stringify'](_0x12bd82)));};}Dialer[_0x5aba('0x1e')][_0x5aba('0x95')]=function(_0x218c21){return!_[_0x5aba('0x5f')](_0x218c21)&&_0x218c21&&!_[_0x5aba('0x5f')](_0x218c21[_0x5aba('0x4f')])&&!_[_0x5aba('0x5f')](_0x218c21[_0x5aba('0x96')])&&_0x218c21[_0x5aba('0x96')]&&(this[_0x5aba('0x26')][util[_0x5aba('0x8a')](_0x5aba('0x97'),_0x218c21[_0x5aba('0x4f')])][_0x5aba('0x98')]===_0x5aba('0x99')||this[_0x5aba('0x26')][util[_0x5aba('0x8a')](_0x5aba('0x97'),_0x218c21[_0x5aba('0x4f')])][_0x5aba('0x98')]===_0x5aba('0x9a'));};Dialer['prototype']['checkIsTrunkReachable']=function(_0x2cd6f1){var _0x12ed25=this;return function(){if(!_0x12ed25[_0x5aba('0x95')](_0x2cd6f1['Trunk'])){if(!_0x12ed25[_0x5aba('0x95')](_0x2cd6f1[_0x5aba('0x9b')])){_0x2cd6f1[_0x5aba('0x74')]=utils[_0x5aba('0x78')][_0x5aba('0x9c')];throw _0x2cd6f1[_0x5aba('0x4f')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x5aba('0x1e')][_0x5aba('0x9d')]=function(_0x17547e,_0x4cc6c9,_0x186168,_0x38cd9e){var _0x32da03=this;return function(){var _0x25c660=!![];return _0x32da03[_0x5aba('0x9e')](_0x17547e,_0x4cc6c9,_0x186168,_0x38cd9e,_0x25c660);};};Dialer[_0x5aba('0x1e')]['checkIfTimeIntervals']=function(_0x13d960,_0x18b0cf,_0x59ea81,_0x34419f){var _0x4bf92f=this;return function(){var _0x48db46=![];return _0x4bf92f['ifTimeIvr'](_0x13d960[_0x5aba('0x83')],_0x18b0cf,_0x59ea81,_0x34419f,_0x48db46);};};Dialer[_0x5aba('0x1e')][_0x5aba('0x9e')]=function(_0xe44988,_0x462d35,_0x1f86e0,_0x3def33,_0x5a1752){var _0x5c8efa=[];return new Promise(function(_0x596931,_0x54570c){if(!isNotNull(_0xe44988)){_0x3def33['message']=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0x54570c(msgResponse(_0x5aba('0x9f'),_0x5aba('0xa0'),_0x1f86e0+_0x5aba('0xa1')));}if(_[_0x5aba('0x84')](_0xe44988)){_0x3def33[_0x5aba('0x74')]=utils[_0x5aba('0x78')]['EMPTY_INTERVAL'];return _0x54570c(msgResponse(_0x5aba('0x9f'),_0x5aba('0xa0'),_0x1f86e0+'\x20Intervals\x20is\x20empty\x20'));}if(_0x462d35&&_['isUndefined'](config['timezones'][_0x462d35])){_0x3def33[_0x5aba('0x74')]=utils[_0x5aba('0x78')][_0x5aba('0xa2')];return _0x54570c(msgResponse('ifTime',_0x5aba('0xa0'),_0x1f86e0+'\x20Timezone\x20unknow\x20'+_0x462d35));}if(_[_0x5aba('0xa3')](_0xe44988)){for(var _0xc7bb20=0x0;_0xc7bb20<_0xe44988['length'];_0xc7bb20+=0x1){_0x5c8efa['push'](ami[_0x5aba('0xa4')]({'action':'command','command':util[_0x5aba('0x8a')]('iftime\x20%s,%s',_0xe44988[_0xc7bb20]['interval'],!_[_0x5aba('0x5f')](config['timezones'][_0x462d35])?_0x462d35:'')})[_0x5aba('0x48')](function(_0x4354ad){return _0x4354ad[_0x5aba('0xa5')][_0x5aba('0xa6')]('true')>=0x0;})['catch'](myreject(_0x54570c)));}}else{_0x5c8efa[_0x5aba('0xa7')](ami[_0x5aba('0xa4')]({'action':_0x5aba('0xa8'),'command':util[_0x5aba('0x8a')](_0x5aba('0xa9'),_0xe44988,!_[_0x5aba('0x5f')](config[_0x5aba('0xaa')][_0x462d35])?_0x462d35:'')})[_0x5aba('0x48')](function(_0x41ef88){return _0x41ef88[_0x5aba('0xa5')][_0x5aba('0xa6')](_0x5aba('0xab'))>=0x0;})[_0x5aba('0xac')](myreject(_0x54570c)));}Promise[_0x5aba('0xad')](_0x5c8efa)[_0x5aba('0x48')](function(_0x5303ca){var _0xfb4b79=_[_0x5aba('0xae')](_0x5303ca);if(_0xfb4b79){return _0x596931(_0xfb4b79);}else{_0x3def33[_0x5aba('0x74')]=_0x5a1752?utils[_0x5aba('0x78')][_0x5aba('0xaf')]:utils[_0x5aba('0x78')][_0x5aba('0xb0')];return _0x54570c(msgResponse(_0x5aba('0xb1'),_0x5aba('0xa0'),'Global:\x20'+_0x5a1752+'\x20'+_0x1f86e0+_0x5aba('0xb2')+util['inspect'](_0xe44988,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x462d35));}})[_0x5aba('0xac')](function(_0x46d6f9){return _0x54570c(msgResponse(_0x5aba('0x9f'),_0x5aba('0xa0'),JSON[_0x5aba('0x7f')](_0x46d6f9)));});});};Dialer[_0x5aba('0x1e')][_0x5aba('0x45')]=function(){var _0xfd4b63=this;return cmHopper[_0x5aba('0xb3')]({'active':![]},{'where':{'active':!![]}})[_0x5aba('0x48')](function(){setInterval(function(){_0xfd4b63['syncCampaigns']();},0x3e8);});};Dialer[_0x5aba('0x1e')][_0x5aba('0xb4')]=function(){var _0x27ee44=this;var _0x1edc74;for(var _0x3d8f75 in this[_0x5aba('0x24')]){if(typeof this[_0x5aba('0x24')][_0x3d8f75]!==_0x5aba('0xb5')){_0x1edc74=this[_0x5aba('0x24')][_0x3d8f75];if(utils['isIVRCampaign'](_0x1edc74)&&utils[_0x5aba('0x86')](_0x1edc74)){_0x1edc74[_0x5aba('0x8d')]=!![];Promise[_0x5aba('0xb6')]()[_0x5aba('0x48')](checkIsIVRCampaignActive(_0x1edc74))[_0x5aba('0x48')](checkInterval(_0x1edc74))[_0x5aba('0x48')](_0x27ee44[_0x5aba('0xb7')](_0x1edc74))[_0x5aba('0x48')](_0x27ee44[_0x5aba('0x9d')](_0x1edc74[_0x5aba('0xb8')],_0x1edc74[_0x5aba('0xb9')],_0x1edc74[_0x5aba('0x4f')],_0x1edc74))[_0x5aba('0x48')](_0x27ee44[_0x5aba('0xba')](_0x1edc74[_0x5aba('0x85')],_0x1edc74['dialTimezone'],_0x1edc74[_0x5aba('0x4f')],_0x1edc74))[_0x5aba('0x48')](_0x27ee44[_0x5aba('0xbb')](_0x1edc74))[_0x5aba('0xac')](loggerCatchQueueSummary(_0x5aba('0xbc'),_0x1edc74));}else{notSendMessagesCampaign(_0x1edc74);}}}};Dialer[_0x5aba('0x1e')][_0x5aba('0xbd')]=function(_0x423c56){if(_0x423c56[_0x5aba('0xbe')]!=='predictive'){clearPredictiveAttributes(_0x423c56);}switch(_0x423c56[_0x5aba('0xbe')]){case _0x5aba('0xbf'):this[_0x5aba('0xc0')](_0x423c56,0x1);break;case _0x5aba('0xc1'):this[_0x5aba('0xc0')](_0x423c56,_0x423c56[_0x5aba('0xc2')]);break;case _0x5aba('0x9'):this[_0x5aba('0x9')](_0x423c56);break;case'booked':this[_0x5aba('0xc0')](_0x423c56,0x1);break;default:logger['error'](_0x5aba('0xc3'),_0x423c56['name'],_0x5aba('0xc4'));}};Dialer['prototype'][_0x5aba('0x9f')]=function(_0x57f4a7,_0x358a32){var _0x18c4f3=_0x57f4a7[_0x5aba('0xb9')];var _0x3666c6=_0x358a32?_0x57f4a7['dialGlobalInterval']:_0x57f4a7[_0x5aba('0x85')][_0x5aba('0x83')];logger[_0x5aba('0xc5')](_0x5aba('0xc6'),_0x3666c6,_0x18c4f3,_0x57f4a7['name'],util['format'](_0x5aba('0xc7'),_0x57f4a7[_0x5aba('0x4f')],_0x57f4a7['id']));var _0x35ace2=null;return Interval[_0x5aba('0xc8')](_0x3666c6,_0x18c4f3)[_0x5aba('0x48')](function(_0x160d16){if(_0x160d16===!![]){return _0x160d16;}else{_0x57f4a7[_0x5aba('0x74')]=_0x358a32?utils[_0x5aba('0x78')][_0x5aba('0xaf')]:utils[_0x5aba('0x78')]['OVERTIME_INTERVAL'];_0x35ace2=msgResponse(_0x5aba('0xb1'),_0x5aba('0xa0'),'Global:\x20'+_0x358a32+'\x20'+_0x57f4a7[_0x5aba('0x4f')]+_0x5aba('0xb2')+util[_0x5aba('0x4d')](_0x3666c6,{'showHidden':![],'depth':null})+_0x5aba('0xc9')+_0x18c4f3);}if(_0x35ace2!==null){logger['silly'](_0x5aba('0xca'),_0x35ace2);_0x35ace2[_0x5aba('0xcb')]=_0x358a32;throw _0x35ace2;}})['catch'](function(_0x36ca84){logger[_0x5aba('0x6f')]('AMI\x20IfTime',_0x36ca84);throw msgResponse(_0x5aba('0x93'),_0x5aba('0x94'),util['inspect'](_0x36ca84,{'showHidden':![],'depth':null}));});};Dialer[_0x5aba('0x1e')]['syncAgentConnect']=function(_0x1add8a){if(this[_0x5aba('0x23')][_0x1add8a[_0x5aba('0xcc')]]){if(this['uniqueId'][_0x1add8a[_0x5aba('0xcd')]]&&this[_0x5aba('0x29')][_0x1add8a[_0x5aba('0xcd')]][_0x5aba('0xce')]!==_0x5aba('0xcf')){this['updateOriginated'](this['voiceQueues'][_0x1add8a[_0x5aba('0xcc')]]);this[_0x5aba('0x29')][_0x1add8a[_0x5aba('0xcd')]]['answertime']=moment()[_0x5aba('0x8a')](_0x5aba('0xd0'));}}};Dialer[_0x5aba('0x1e')][_0x5aba('0x38')]=function(_0x4338f9){var _0x540d18=this[_0x5aba('0x29')][_0x4338f9[_0x5aba('0xcd')]];if(this[_0x5aba('0x23')][_0x4338f9[_0x5aba('0xcc')]]){if(_0x540d18&&_0x540d18[_0x5aba('0xce')]!=='ivr'){delete this[_0x5aba('0x29')][_0x4338f9['uniqueid']];this['voiceQueues'][_0x4338f9['queue']]['outboundAnswerCallsDay']+=0x1;var _0x364cba=new AgentComplete(_0x540d18,_0x4338f9);if(_0x4338f9[_0x5aba('0xd1')]==='agent'){_0x364cba[_0x5aba('0xd2')]=this[_0x5aba('0x23')][_0x4338f9[_0x5aba('0xcc')]]['dialQueueProject2']&&this[_0x5aba('0x23')][_0x4338f9[_0x5aba('0xcc')]][_0x5aba('0xd3')]?moment()['format'](_0x5aba('0xd0')):undefined;}hopperUtils[_0x5aba('0xd4')](_0x364cba)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x5aba('0xd5')](_0x364cba)[_0x5aba('0xac')](loggerCatch(_0x5aba('0xd6')));}}};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x4a7a9b){var _0xeac363=this[_0x5aba('0x29')][_0x4a7a9b[_0x5aba('0xcd')]];var _0x4a8621=this;var _0x4a3c50=![];var _0x365032;var _0x125e64;if(this[_0x5aba('0x23')][_0x4a7a9b['queue']]){if(_0xeac363&&_0xeac363['type']!==_0x5aba('0xcf')){delete this[_0x5aba('0x29')][_0x4a7a9b[_0x5aba('0xcd')]];this[_0x5aba('0xd7')](this[_0x5aba('0x23')][_0x4a7a9b['queue']]);_0xeac363[_0x5aba('0xd8')]=moment()['format'](_0x5aba('0xd0'));var _0x2dcd63=new QueueCallerAbandon(_0xeac363,_0x4a7a9b);if(utils[_0x5aba('0x6a')](_0xeac363['droptime'],_0xeac363[_0x5aba('0xd9')])>=_0xeac363['dialQueueTimeout']){this[_0x5aba('0x23')][_0x4a7a9b[_0x5aba('0xcc')]][_0x5aba('0x58')]+=0x1;this[_0x5aba('0x23')][_0x4a7a9b[_0x5aba('0xcc')]][_0x5aba('0xda')]+=0x1;this[_0x5aba('0x23')][_0x4a7a9b[_0x5aba('0xcc')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x2dcd63['state']=0xa;_0x2dcd63['statedesc']=_0x5aba('0xdb');_0x2dcd63['dropreason']=_0x5aba('0xdc');_0x2dcd63[_0x5aba('0xd2')]=this[_0x5aba('0x23')][_0x4a7a9b['queue']]['dialQueueProject2']?moment()[_0x5aba('0x8a')](_0x5aba('0xd0')):undefined;_0x2dcd63[_0x5aba('0xdd')]+=0x1;_0x2dcd63[_0x5aba('0xde')]+=0x1;_0x365032=this[_0x5aba('0x23')][_0x4a7a9b[_0x5aba('0xcc')]][_0x5aba('0xdf')];_0x125e64=this[_0x5aba('0x23')][_0x4a7a9b[_0x5aba('0xcc')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x5aba('0xe0')](_0x2dcd63,_0x2dcd63['state'],_0xeac363[_0x5aba('0xe1')])[_0x5aba('0x48')](function(_0x2badf9){_0x4a3c50=_0x2badf9[_0x5aba('0xe2')]==0x1;if(_0x2dcd63['countdropretry']>=_0x4a8621[_0x5aba('0x23')][_0x4a7a9b[_0x5aba('0xcc')]][_0x5aba('0xe3')]){_0x4a8621[_0x5aba('0xe4')](_0x2dcd63,_0x2badf9[_0x5aba('0xe2')]);}else{hopperUtils[_0x5aba('0xe5')]({'active':![],'countdropretry':_0x2dcd63['countdropretry'],'scheduledat':moment()['add'](_0x4a8621[_0x5aba('0x23')][_0x4a7a9b[_0x5aba('0xcc')]][_0x5aba('0xdf')],_0x5aba('0xe6'))[_0x5aba('0x8a')](_0x5aba('0xd0')),'ContactId':_0xeac363['ContactId'],'ListId':_0xeac363[_0x5aba('0xe7')],'VoiceQueueId':_0xeac363[_0x5aba('0xe8')]||undefined,'CampaignId':_0xeac363[_0x5aba('0xe9')]||undefined})[_0x5aba('0xac')](loggerCatch(_0x5aba('0xea')));var _0x3a645d=new History(_0x2dcd63);_0x3a645d[_0x5aba('0x79')]=0xa;_0x3a645d[_0x5aba('0x7a')]=_0x5aba('0xdb');_0x3a645d[_0x5aba('0x7c')]=moment()[_0x5aba('0x8a')](_0x5aba('0xd0'));_0x3a645d['endtime']=_0x3a645d['starttime'];_0x3a645d[_0x5aba('0xeb')]=_0x2dcd63[_0x5aba('0xeb')];_0x3a645d[_0x5aba('0xec')]=_0x2dcd63[_0x5aba('0xec')];hopperUtils['createHistory'](_0x3a645d)[_0x5aba('0xac')](loggerCatch(_0x5aba('0xed')));}})[_0x5aba('0x48')](function(){if(_0x4a3c50)hopperUtils[_0x5aba('0xee')](_0x2dcd63,_0x365032,_0x125e64)[_0x5aba('0x48')](function(){return 0x1;});});}else{this[_0x5aba('0x23')][_0x4a7a9b[_0x5aba('0xcc')]][_0x5aba('0xef')]+=0x1;this[_0x5aba('0x23')][_0x4a7a9b[_0x5aba('0xcc')]][_0x5aba('0xf0')]+=0x1;_0x2dcd63[_0x5aba('0x79')]=0xb;_0x2dcd63[_0x5aba('0x7a')]=_0x5aba('0xf1');_0x2dcd63['dropreason']=_0x5aba('0xf2');_0x2dcd63[_0x5aba('0xf3')]+=0x1;_0x2dcd63[_0x5aba('0xde')]+=0x1;_0x365032=this[_0x5aba('0x23')][_0x4a7a9b[_0x5aba('0xcc')]][_0x5aba('0xf4')];_0x125e64=this[_0x5aba('0x23')][_0x4a7a9b['queue']][_0x5aba('0xf5')];hopperUtils[_0x5aba('0xe0')](_0x2dcd63,_0x2dcd63[_0x5aba('0x79')],_0xeac363['voiceQueue'])[_0x5aba('0x48')](function(_0x30feef){if(_0x2dcd63[_0x5aba('0xf3')]>=_0x4a8621['voiceQueues'][_0x4a7a9b[_0x5aba('0xcc')]][_0x5aba('0xf6')]){_0x4a8621[_0x5aba('0xe4')](_0x2dcd63,_0x30feef[_0x5aba('0xe2')]);}else{hopperUtils[_0x5aba('0xe5')]({'active':![],'countabandonedretry':_0x2dcd63['countabandonedretry'],'scheduledat':moment()[_0x5aba('0xf7')](_0x4a8621[_0x5aba('0x23')][_0x4a7a9b['queue']]['dialAbandonedRetryFrequency'],_0x5aba('0xe6'))[_0x5aba('0x8a')](_0x5aba('0xd0')),'ContactId':_0xeac363[_0x5aba('0xf8')],'ListId':_0xeac363[_0x5aba('0xe7')],'VoiceQueueId':_0xeac363['VoiceQueueId']||undefined,'CampaignId':_0xeac363[_0x5aba('0xe9')]||undefined})[_0x5aba('0xac')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x24bb60=new History(_0x2dcd63);_0x24bb60[_0x5aba('0x79')]=0xb;_0x24bb60[_0x5aba('0x7a')]=_0x5aba('0xf1');_0x24bb60[_0x5aba('0x7c')]=moment()[_0x5aba('0x8a')](_0x5aba('0xd0'));_0x24bb60[_0x5aba('0x7b')]=_0x24bb60[_0x5aba('0x7c')];_0x24bb60[_0x5aba('0xeb')]=_0x2dcd63[_0x5aba('0xeb')];_0x24bb60[_0x5aba('0xec')]=_0x2dcd63[_0x5aba('0xec')];hopperUtils['createHistory'](_0x24bb60)['catch'](loggerCatch(_0x5aba('0xf9')));}})[_0x5aba('0x48')](function(){if(_0x4a3c50)hopperUtils[_0x5aba('0xee')](_0x2dcd63,_0x365032,_0x125e64)['then'](function(){return 0x1;});});}}}};Dialer['prototype'][_0x5aba('0x3e')]=function(_0x22e612){if(this['actions'][_0x22e612['uniqueid']]){this[_0x5aba('0x28')][_0x22e612[_0x5aba('0xcd')]][_0x5aba('0xfa')]=_0x22e612['channel'];}if(this[_0x5aba('0x29')][_0x22e612[_0x5aba('0xcd')]]){this['uniqueId'][_0x22e612[_0x5aba('0xcd')]]['channel']=_0x22e612[_0x5aba('0xfa')];}};Dialer[_0x5aba('0x1e')]['syncQueueMember']=function(_0x58c519){if(!this[_0x5aba('0x28')][_0x58c519['actionid']]){return;}var _0x5e4790=this['voiceQueues'][this['actions'][_0x58c519[_0x5aba('0xfb')]]['queue']][_0x5aba('0xfc')]||_0x5aba('0xfd');if(_0x5e4790==='roundrobin'){if(this[_0x5aba('0x28')][_0x58c519[_0x5aba('0xfb')]]&&_[_0x5aba('0xfe')](this['actions'][_0x58c519['actionid']]['locked'])&&_0x58c519['status']==='1'&&_0x58c519[_0x5aba('0xff')]==='0'){if(this[_0x5aba('0x25')][_0x58c519['stateinterface']]){if(!this[_0x5aba('0x25')][_0x58c519[_0x5aba('0x100')]][_0x5aba('0x101')]){this[_0x5aba('0x25')][_0x58c519['stateinterface']][_0x5aba('0x101')]=!![];this[_0x5aba('0x28')][_0x58c519[_0x5aba('0xfb')]]['locked']=!![];this['actions'][_0x58c519['actionid']][_0x5aba('0x100')]=_0x58c519[_0x5aba('0x100')];}}}}else if(_0x5e4790==='rrmemory'){if(this['actions'][_0x58c519[_0x5aba('0xfb')]]){if(this[_0x5aba('0x25')][_0x58c519[_0x5aba('0x100')]]){this[_0x5aba('0x28')][_0x58c519[_0x5aba('0xfb')]][_0x5aba('0x100')]=_0x58c519[_0x5aba('0x100')];if(_['isNil'](this['queueBooked'][this['actions'][_0x58c519['actionid']][_0x5aba('0xcc')]])){this[_0x5aba('0x2e')][this['actions'][_0x58c519[_0x5aba('0xfb')]]['queue']]=[];}this['queueBooked'][this[_0x5aba('0x28')][_0x58c519[_0x5aba('0xfb')]][_0x5aba('0xcc')]][_0x5aba('0xa7')](_[_0x5aba('0x102')](_[_0x5aba('0x80')](this[_0x5aba('0x28')][_0x58c519[_0x5aba('0xfb')]],['idHopper','stateinterface']),{'status':_0x58c519[_0x5aba('0x98')],'paused':_0x58c519[_0x5aba('0xff')]}));}}}};Dialer[_0x5aba('0x1e')][_0x5aba('0x44')]=function(_0x1464ab){if(!this[_0x5aba('0x28')][_0x1464ab['actionid']]){return;}var _0x442e8f=this;var _0x5a832f=this[_0x5aba('0x23')][this['actions'][_0x1464ab[_0x5aba('0xfb')]][_0x5aba('0xcc')]];var _0x411ec0=_0x5a832f[_0x5aba('0xfc')]||_0x5aba('0xfd');if(_0x411ec0===_0x5aba('0x103')){if(this['actions'][_0x1464ab['actionid']]&&this[_0x5aba('0x28')][_0x1464ab[_0x5aba('0xfb')]][_0x5aba('0x100')]){this[_0x5aba('0x104')][_0x5aba('0x105')](this[_0x5aba('0x28')][_0x1464ab[_0x5aba('0xfb')]][_0x5aba('0x106')],this[_0x5aba('0x28')][_0x1464ab[_0x5aba('0xfb')]][_0x5aba('0x100')])[_0x5aba('0xac')](function(_0x1ee325){logger[_0x5aba('0x6f')](_0x5aba('0x107'),util['inspect'](_0x1ee325,{'showHidden':![],'depth':null}));})[_0x5aba('0x21')](function(){_0x442e8f[_0x5aba('0xd7')](_0x442e8f['voiceQueues'][_0x442e8f[_0x5aba('0x28')][_0x1464ab[_0x5aba('0xfb')]]['queue']]);_0x442e8f['agents'][_0x442e8f['actions'][_0x1464ab[_0x5aba('0xfb')]][_0x5aba('0x100')]][_0x5aba('0x101')]=![];delete _0x442e8f[_0x5aba('0x28')][_0x1464ab[_0x5aba('0xfb')]];unlockQueueStatus(_0x5a832f);});}else{this[_0x5aba('0xd7')](this[_0x5aba('0x23')][this[_0x5aba('0x28')][_0x1464ab[_0x5aba('0xfb')]][_0x5aba('0xcc')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x5aba('0x28')][_0x1464ab[_0x5aba('0xfb')]][_0x5aba('0xf8')],'ListId':this[_0x5aba('0x28')][_0x1464ab['actionid']][_0x5aba('0xe7')],'VoiceQueueId':this[_0x5aba('0x28')][_0x1464ab[_0x5aba('0xfb')]][_0x5aba('0xe8')]||undefined,'CampaignId':this[_0x5aba('0x28')][_0x1464ab[_0x5aba('0xfb')]][_0x5aba('0xe9')]||undefined})[_0x5aba('0xac')](loggerCatch(_0x5aba('0x108')));delete this['actions'][_0x1464ab[_0x5aba('0xfb')]];unlockQueueStatus(_0x5a832f);}}else if(_0x411ec0==='rrmemory'){var _0x5bb2;if(this[_0x5aba('0x28')][_0x1464ab[_0x5aba('0xfb')]]&&!_[_0x5aba('0x84')](this[_0x5aba('0x2e')][this['actions'][_0x1464ab['actionid']][_0x5aba('0xcc')]])){if(this[_0x5aba('0x2f')][_0x442e8f[_0x5aba('0x28')][_0x1464ab[_0x5aba('0xfb')]][_0x5aba('0xcc')]]){this[_0x5aba('0x2f')][_0x442e8f['actions'][_0x1464ab[_0x5aba('0xfb')]][_0x5aba('0xcc')]]=this['queueBookedRR'][this[_0x5aba('0x28')][_0x1464ab[_0x5aba('0xfb')]][_0x5aba('0xcc')]]?this['queueBookedRR'][this[_0x5aba('0x28')][_0x1464ab[_0x5aba('0xfb')]][_0x5aba('0xcc')]]:this[_0x5aba('0x2e')][this[_0x5aba('0x28')][_0x1464ab[_0x5aba('0xfb')]][_0x5aba('0xcc')]]?this[_0x5aba('0x2e')][this[_0x5aba('0x28')][_0x1464ab[_0x5aba('0xfb')]][_0x5aba('0xcc')]][_0x5aba('0x109')]||0x0:0x0;}this[_0x5aba('0x2e')][this['actions'][_0x1464ab[_0x5aba('0xfb')]][_0x5aba('0xcc')]]['_rr']=this[_0x5aba('0x2f')][this[_0x5aba('0x28')][_0x1464ab[_0x5aba('0xfb')]]['queue']];for(var _0x938562=0x0;_0x938562=_0x3b399d[_0x5aba('0x12e')]){_0xc97b7b[_0x5aba('0x12f')](_0x45435d,_0x2485b1,_0xc62e45,_0x5aba('0x130'));}else{if(_0x45435d[_0x5aba('0x127')]>=_0x3b399d['dialMachineMaxRetry']){_0xc97b7b['createStateFinal'](_0x45435d,_0x2485b1,_0xc62e45,_0x5aba('0x131'));}else{hopperUtils[_0x5aba('0xe5')]({'active':![],'countmachineretry':_0x45435d['countmachineretry'],'scheduledat':moment()[_0x5aba('0xf7')](_0x3b399d[_0x5aba('0x132')],_0x5aba('0xe6'))['format'](_0x5aba('0xd0')),'ContactId':_0x45435d[_0x5aba('0xf8')],'ListId':_0x45435d[_0x5aba('0xe7')],'VoiceQueueId':_0x45435d[_0x5aba('0xe8')]||undefined,'CampaignId':_0x45435d[_0x5aba('0xe9')]||undefined})[_0x5aba('0xac')](loggerCatch(_0x5aba('0x133')));_0x2485b1({'reschedule':0x1});}}});}if(_0x4eb6b5[_0x5aba('0xce')]===_0x5aba('0xcf')&&this[_0x5aba('0x24')][_0x4eb6b5[_0x5aba('0xcc')]]['dialAMDActive']&&_0x35f9d4['value']===_0x5aba('0x11d')){delete this[_0x5aba('0x29')][_0x35f9d4[_0x5aba('0xcd')]];this[_0x5aba('0xd7')](this[_0x5aba('0x24')][_0x4eb6b5[_0x5aba('0xcc')]]);_0x59a65c=new Hangup(_0x4eb6b5,_0x35f9d4);_0x59a65c['state']=0x12;_0x59a65c[_0x5aba('0x7a')]='HangupInAMD';_0x59a65c[_0x5aba('0x120')]=_0x5aba('0x121');ami[_0x5aba('0x4a')](_0x5aba('0x122'),ut[_0x5aba('0x128')](_0x59a65c,_0x5aba('0x123')));this[_0x5aba('0x124')](_0x59a65c,_0x5aba('0x134'),_0x5aba('0x135'));}if(_0x4eb6b5['type']==='ivr'&&this[_0x5aba('0x24')][_0x4eb6b5[_0x5aba('0xcc')]]['dialAMDActive']&&_0x35f9d4['value']===_0x5aba('0x136')){return new Promise(function(_0x6abfcd,_0x2ff82c){delete _0xc97b7b[_0x5aba('0x29')][_0x35f9d4[_0x5aba('0xcd')]];_0xc97b7b['updateOriginated'](_0xc97b7b[_0x5aba('0x24')][_0x4eb6b5[_0x5aba('0xcc')]]);_0xc97b7b['campaigns'][_0x4eb6b5[_0x5aba('0xcc')]][_0x5aba('0x11e')]+=0x1;_0xc97b7b[_0x5aba('0x24')][_0x4eb6b5['queue']][_0x5aba('0x11f')]+=0x1;var _0x300445=_0xc97b7b[_0x5aba('0x24')][_0x4eb6b5['queue']];var _0xb32231=new Hangup(_0x4eb6b5,_0x35f9d4);_0xb32231[_0x5aba('0x79')]=0x13;_0xb32231[_0x5aba('0x7a')]=_0x5aba('0x137');_0xb32231[_0x5aba('0x120')]=_0x5aba('0x121');_0xb32231[_0x5aba('0x127')]+=0x1;_0xb32231['countglobal']+=0x1;_0xb32231[_0x5aba('0x123')]=!![];ami[_0x5aba('0x4a')](_0x5aba('0x122'),ut[_0x5aba('0x128')](_0xb32231,_0x5aba('0x123')));hopperUtils[_0x5aba('0xd4')](_0xb32231)[_0x5aba('0xac')](loggerCatch(_0x5aba('0x129')));if(_0xb32231[_0x5aba('0x12a')]+_0xb32231[_0x5aba('0x12b')]+_0xb32231['countnoanswerretry']+_0xb32231[_0x5aba('0x12c')]+_0xb32231['countdropretry']+_0xb32231[_0x5aba('0xf3')]+_0xb32231[_0x5aba('0x127')]+_0xb32231['countagentrejectretry']>=_0x300445[_0x5aba('0x12e')]){_0xc97b7b[_0x5aba('0x12f')](_0xb32231,_0x6abfcd,_0x2ff82c,'reason19\x20machine....');}else{if(_0xb32231[_0x5aba('0x127')]>=_0x300445[_0x5aba('0x138')]){_0xc97b7b[_0x5aba('0x139')](_0xb32231,_0x6abfcd,_0x2ff82c,_0x5aba('0x131'));}else{hopperUtils[_0x5aba('0xe5')]({'active':![],'countmachineretry':_0xb32231[_0x5aba('0x127')],'scheduledat':moment()['add'](_0x300445[_0x5aba('0x132')],_0x5aba('0xe6'))[_0x5aba('0x8a')](_0x5aba('0xd0')),'ContactId':_0xb32231[_0x5aba('0xf8')],'ListId':_0xb32231[_0x5aba('0xe7')],'VoiceQueueId':_0xb32231[_0x5aba('0xe8')]||undefined,'CampaignId':_0xb32231[_0x5aba('0xe9')]||undefined})[_0x5aba('0xac')](loggerCatch(_0x5aba('0x133')));_0x6abfcd({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x5aba('0x3c')]=function(_0x4d75fb){var _0x10d0d2=this[_0x5aba('0x29')][_0x4d75fb['uniqueid']];var _0x33a37b;if(_0x10d0d2&&_0x10d0d2[_0x5aba('0xce')]===_0x5aba('0xcf')){delete this[_0x5aba('0x29')][_0x4d75fb[_0x5aba('0xcd')]];this[_0x5aba('0xd7')](this[_0x5aba('0x24')][_0x10d0d2['queue']]);this[_0x5aba('0x24')][_0x10d0d2[_0x5aba('0xcc')]][_0x5aba('0x13a')]+=0x1;_0x33a37b=new Hangup(_0x10d0d2,_0x4d75fb);hopperUtils[_0x5aba('0xd4')](_0x33a37b)['catch'](loggerCatch(_0x5aba('0x13b')));hopperUtils[_0x5aba('0xd5')](_0x33a37b)[_0x5aba('0xac')](loggerCatch(_0x5aba('0x13c')));}if(_0x10d0d2&&_0x10d0d2[_0x5aba('0xce')]!==_0x5aba('0xcf')&&isNotNull(this['voiceQueues'][_0x10d0d2[_0x5aba('0xcc')]][_0x5aba('0x13d')])){delete this[_0x5aba('0x29')][_0x4d75fb[_0x5aba('0xcd')]];this[_0x5aba('0xd7')](this[_0x5aba('0x23')][_0x10d0d2[_0x5aba('0xcc')]]);this[_0x5aba('0x23')][_0x10d0d2['queue']][_0x5aba('0x11e')]+=0x1;this[_0x5aba('0x23')][_0x10d0d2[_0x5aba('0xcc')]][_0x5aba('0x11f')]+=0x1;_0x33a37b=new Hangup(_0x10d0d2,_0x4d75fb);_0x33a37b[_0x5aba('0x79')]=0x10;_0x33a37b[_0x5aba('0x7a')]=_0x5aba('0x13e');_0x33a37b['membername']=_0x5aba('0x13f');hopperUtils[_0x5aba('0xd4')](_0x33a37b)[_0x5aba('0xac')](loggerCatch(_0x5aba('0x13b')));hopperUtils[_0x5aba('0xd5')](_0x33a37b)['catch'](loggerCatch(_0x5aba('0x13c')));}if(_0x10d0d2&&_0x10d0d2['type']!==_0x5aba('0xcf')&&!isNotNull(this[_0x5aba('0x23')][_0x10d0d2[_0x5aba('0xcc')]][_0x5aba('0x13d')])){delete this[_0x5aba('0x29')][_0x4d75fb[_0x5aba('0xcd')]];this[_0x5aba('0xd7')](this[_0x5aba('0x23')][_0x10d0d2[_0x5aba('0xcc')]]);this[_0x5aba('0x23')][_0x10d0d2[_0x5aba('0xcc')]]['outboundUnknownCallsDay']+=0x1;_0x33a37b=new Hangup(_0x10d0d2,_0x4d75fb);_0x33a37b[_0x5aba('0x79')]=0xc;_0x33a37b[_0x5aba('0x7a')]=_0x4d75fb[_0x5aba('0x140')];_0x33a37b[_0x5aba('0x120')]=_0x5aba('0x141');hopperUtils[_0x5aba('0xd4')](_0x33a37b)[_0x5aba('0xac')](loggerCatch(_0x5aba('0x13b')));hopperUtils[_0x5aba('0xd5')](_0x33a37b)['catch'](loggerCatch(_0x5aba('0x13c')));}};Dialer['prototype'][_0x5aba('0xb')]=function(_0xa35f14){var _0x37be4c=this;if(!_0x37be4c['queuesSummary'][_0xa35f14['name']]){_0x37be4c[_0x5aba('0x30')][_0xa35f14[_0x5aba('0x4f')]]={'running':![]};}else if(_0x37be4c[_0x5aba('0x30')][_0xa35f14['name']]['running']===!![]){return;}else if(_0x37be4c[_0x5aba('0x30')][_0xa35f14[_0x5aba('0x4f')]][_0x5aba('0x142')]===![]){_0x37be4c[_0x5aba('0x30')][_0xa35f14['name']]['running']=!![];}var _0x15f213=_0x37be4c['voiceQueues'][_0xa35f14[_0x5aba('0x4f')]];var _0x112b7a=_0x15f213[_0x5aba('0x74')]!==utils[_0x5aba('0x78')][_0x5aba('0x87')];var _0x21d37b=utils[_0x5aba('0x143')](_0x15f213);_0x15f213[_0x5aba('0x144')]=utils[_0x5aba('0x145')](_0x15f213,_0x37be4c[_0x5aba('0x26')]);Promise[_0x5aba('0xb6')]()[_0x5aba('0x48')](function(){if(_0x15f213['statusMessage']===utils['CAMPAIGN_STATUS']['INACTIVE']){if(_0x112b7a){clearPredictiveAttributes(_0x15f213);_0xa35f14[_0x5aba('0x2b')]=undefined;_0xa35f14[_0x5aba('0x2c')]=undefined;}if(_0x15f213['statusMessage']===utils[_0x5aba('0x78')]['INACTIVE']){_0xa35f14[_0x5aba('0x146')]=0x0;_0xa35f14['paused']=0x0;_0xa35f14[_0x5aba('0x147')]=0x0;_0xa35f14[_0x5aba('0x148')]=0x0;_0xa35f14[_0x5aba('0x149')]=0x0;}}else if(_0x15f213[_0x5aba('0x144')]===utils['CAMPAIGN_STATUS'][_0x5aba('0x14a')]&&!_0x21d37b){return _0x37be4c[_0x5aba('0x9f')](_0x15f213,!![])[_0x5aba('0x48')](function(){return _0x37be4c['ifTime'](_0x15f213,![]);})[_0x5aba('0x48')](function(){return _0x37be4c[_0x5aba('0xbd')](_0x15f213);})['catch'](function(_0x4ca86e){loggerSyncQueueSummary[_0x5aba('0x4b')](_0x5aba('0x14b'),util[_0x5aba('0x4d')](_0x4ca86e,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x15f213);});}else{clearPredictiveAttributes(_0x15f213);}})['then'](function(){var _0x58951a=_0xa35f14[_0x5aba('0x14c')](_0x15f213);if(_0x58951a||_0x15f213[_0x5aba('0x14d')]){_0x15f213[_0x5aba('0x14d')]=![];_0xa35f14[_0x5aba('0x14e')](_0x15f213);Object[_0x5aba('0x14f')](_0x15f213,_0xa35f14);emitOutboundVoiceQueueSummary(_0xa35f14);}_0x37be4c[_0x5aba('0x30')][_0x15f213[_0x5aba('0x4f')]]['running']=![];})['catch'](function(_0x18aa79){logger[_0x5aba('0x6f')](_0x5aba('0x14b'),util[_0x5aba('0x4d')](_0x18aa79,{'showHidden':![],'depth':null}));_0x37be4c['queuesSummary'][_0x15f213[_0x5aba('0x4f')]][_0x5aba('0x142')]=![];});};Dialer[_0x5aba('0x1e')][_0x5aba('0x150')]=_[_0x5aba('0x151')](function(){var _0xd48d0=_[_0x5aba('0x152')](this[_0x5aba('0x23')],function(_0x453bf0){return _0x453bf0[_0x5aba('0x153')];});var _0x378eda=_[_0x5aba('0x152')](this[_0x5aba('0x25')],function(_0x3ea6f9){return _0x3ea6f9['online']&&_0x3ea6f9[_0x5aba('0x98')]===_0x5aba('0x99');});if(_0xd48d0[_0x5aba('0x10a')]>0x0&&_0x378eda[_0x5aba('0x10a')]>0x0){return Promise['resolve']()[_0x5aba('0x48')](cmHopper[_0x5aba('0x154')](_[_0x5aba('0x155')](_0xd48d0,'id'),previewRecallmeReminderInterval,_[_0x5aba('0x155')](_0x378eda,'id')))[_0x5aba('0x48')](function(_0x23d343){for(var _0x125a4a=0x0;_0x125a4a<_0x23d343[_0x5aba('0x10a')];_0x125a4a++){var _0x2d67cc=_0x23d343[_0x125a4a][_0x5aba('0x156')][_0x5aba('0x4f')];if(_0x2d67cc)io['to'](util[_0x5aba('0x8a')](_0x5aba('0x157'),_0x2d67cc))[_0x5aba('0x4a')](_0x5aba('0x158'),{'hopper':_0x23d343[_0x125a4a]});}})[_0x5aba('0xac')](function(_0x1e7fa0){logger[_0x5aba('0x6f')](_0x5aba('0x159'),_0x1e7fa0);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x5aba('0x1e')][_0x5aba('0x46')]=function(){var _0x21d91d=this;setInterval(function(){_0x21d91d[_0x5aba('0x15a')](_0x21d91d[_0x5aba('0x29')],_0x5aba('0x15b'));_0x21d91d[_0x5aba('0x15a')](_0x21d91d['actions'],_0x5aba('0x15c'));},0x32c8);};Dialer[_0x5aba('0x1e')]['clearZombieChannels']=function(_0x1684c6,_0x3dafe7){var _0x32d6bd=this;for(var _0x392650 in _0x1684c6){if(typeof _0x1684c6[_0x392650]!==_0x5aba('0xb5')){this[_0x5aba('0x22')][_0x5aba('0x1f')](function(){if(!_[_0x5aba('0xfe')](_0x1684c6[_0x392650])){return ami['Action']({'action':_0x5aba('0x98'),'channel':_0x1684c6[_0x392650]['channel']})['catch'](function(_0x3e76ee){if(_0x3e76ee[_0x5aba('0x74')]===_0x5aba('0x15d')){setTimeout(function(){if(_0x1684c6[_0x392650]&&_0x1684c6[_0x392650][_0x5aba('0xce')]!==_0x5aba('0xcf')){_0x32d6bd['updateOriginated'](_0x32d6bd[_0x5aba('0x23')][_0x1684c6[_0x392650]['queue']]);logger[_0x5aba('0x6f')]('[Dialer][checkChannel]',_0x3dafe7,_0x392650,_0x1684c6[_0x392650][_0x5aba('0xcc')]);delete _0x1684c6[_0x392650];}if(_0x1684c6[_0x392650]&&_0x1684c6[_0x392650][_0x5aba('0xce')]===_0x5aba('0xcf')){_0x32d6bd[_0x5aba('0xd7')](_0x32d6bd['campaigns'][_0x1684c6[_0x392650][_0x5aba('0xcc')]]);logger[_0x5aba('0x6f')]('[Dialer][checkChannel][ivr]',_0x3dafe7,_0x392650,_0x1684c6[_0x392650]['queue']);delete _0x1684c6[_0x392650];}},0x2328);}});}});}}};Dialer[_0x5aba('0x1e')][_0x5aba('0x15e')]=function(_0x2da712){return Promise[_0x5aba('0xb6')]()['then'](voiceQueueRt[_0x5aba('0x15e')](_0x2da712))['catch'](loggerCatch(_0x5aba('0x15f')));};Dialer['prototype'][_0x5aba('0xd7')]=function(_0x339e7a){if(!_[_0x5aba('0x5f')](_0x339e7a)&&_0x339e7a!==null){if(typeof _0x339e7a[_0x5aba('0x8e')]!==_0x5aba('0xb5')){if(_0x339e7a[_0x5aba('0x8e')]>0x0){_0x339e7a[_0x5aba('0x8e')]-=0x1;}else{logger[_0x5aba('0x6f')](_0x5aba('0x160'));}}}else{logger[_0x5aba('0x6f')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x5aba('0x1e')][_0x5aba('0x161')]=function(_0x7ef75c,_0x2f3896){var _0x4a1abd=this;return function(_0x32d82d){_0x4a1abd['updateOriginated'](_0x2f3896);logger[_0x5aba('0x6f')](_0x7ef75c,util['inspect'](_0x32d82d,{'showHidden':![],'depth':null}));};};Dialer[_0x5aba('0x1e')][_0x5aba('0x162')]=function(_0x1d2ded,_0x2b670d,_0x250c77){var _0xa78600={'state':0x19,'statedesc':_0x5aba('0x163')};this['updateOriginated'](_0x2b670d);this[_0x5aba('0x124')](_['merge'](_0xa78600,_[_0x5aba('0x80')](_0x250c77,[_0x5aba('0xf8'),_0x5aba('0xe7'),_0x5aba('0x164'),_0x5aba('0xe8'),_0x5aba('0xe9')])),_0x5aba('0x165'),'[emptyContact]');logger[_0x5aba('0x6f')](_0x1d2ded);};Dialer[_0x5aba('0x1e')][_0x5aba('0x124')]=function(_0x2d68c8,_0x3ebd7d,_0x55f641){hopperUtils[_0x5aba('0xd4')](_0x2d68c8)[_0x5aba('0xac')](loggerCatch(_0x3ebd7d));hopperUtils[_0x5aba('0xd5')](_0x2d68c8)['catch'](loggerCatch(_0x55f641));};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x272c34,_0x2253d6){hopperUtils[_0x5aba('0xd4')](_0x272c34)['catch'](loggerCatch(_0x5aba('0x166')));if(_0x2253d6==0x0){hopperUtils['moveContactManagedDialer'](_0x272c34)[_0x5aba('0xac')](loggerCatch(_0x5aba('0x167')));}};Dialer[_0x5aba('0x1e')][_0x5aba('0x159')]=function(_0x65bd7d){return Promise[_0x5aba('0xb6')]()[_0x5aba('0x48')](cmHopper[_0x5aba('0x154')](_0x65bd7d['id'],previewRecallmeReminderInterval))['then'](function(_0x37e4db){for(var _0x4d62d8=0x0;_0x4d62d8<_0x37e4db[_0x5aba('0x10a')];_0x4d62d8++){var _0x2c5f6f=_0x37e4db[_0x4d62d8][_0x5aba('0x156')][_0x5aba('0x4f')];if(_0x2c5f6f)io['to'](util['format'](_0x5aba('0x157'),_0x2c5f6f))[_0x5aba('0x4a')]('user:dialPreviewRecallReminder',{'hopper':_0x37e4db[_0x4d62d8]});}})['catch'](function(){});};Dialer[_0x5aba('0x1e')]['launchHandleIvr']=function(_0x322090){var _0x1b8f5f=this;return function(){_0x1b8f5f[_0x5aba('0x168')](_0x322090);};};Dialer[_0x5aba('0x1e')]['actionOriginate']=function(_0x577cc1,_0x42e698){var _0x369edf=this;var _0x189452=uuid['v4']();this[_0x5aba('0x28')][_0x189452]=new Action(_0x577cc1,_0x42e698,_0x189452);return new Promise(function(_0x96ef92,_0x4ddd5e){if(_[_0x5aba('0x5f')](_0x577cc1)&&typeof _0x577cc1!==_0x5aba('0x169')){return _0x4ddd5e(msgResponse(_0x5aba('0x16a'),_0x5aba('0xa0'),_0x5aba('0x16b')));}if(_[_0x5aba('0x5f')](_0x42e698[_0x5aba('0x16c')])||_0x42e698[_0x5aba('0x16c')]===null){return _0x4ddd5e(msgResponse(_0x5aba('0x16a'),'Failure',_0x5aba('0x16d')));}var _0xc5ef01={'XMD-CALLERID':_0x369edf[_0x5aba('0x28')][_0x189452][_0x5aba('0x16e')](),'XMD-AGI':_0x577cc1['dialQueueProject']?util[_0x5aba('0x8a')](_0x5aba('0x16f'),ipAgi,_0x577cc1['dialQueueProject']):_0x5aba('0x170'),'XMD-AGIAFTER':_0x577cc1[_0x5aba('0x171')]?util['format'](_0x5aba('0x16f'),ipAgi,_0x577cc1['dialQueueProject2']):_0x5aba('0x170'),'XMD-QUEUE':utils[_0x5aba('0x172')](_0x577cc1)?util[_0x5aba('0x8a')](_0x5aba('0x173'),_0x577cc1['name'],_0x577cc1[_0x5aba('0x174')]||'',_0x577cc1[_0x5aba('0xd3')]?'c':'',_0x577cc1['dialQueueTimeout']||0x3):_0x5aba('0x170'),'XMD-CONTACTID':_0x42e698[_0x5aba('0xf8')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x369edf['actions'][_0x189452][_0x5aba('0x16e')](),'XMD-AMD':_0x577cc1[_0x5aba('0x11c')]?_0x5aba('0x14a'):_0x5aba('0x170'),'XMD-DESTINATION':_0x5aba('0x11b')};if(_0x577cc1[_0x5aba('0x11c')]){_0xc5ef01['XMD-AMDINITIALSILENCE']=_0x577cc1[_0x5aba('0x175')]||0x9c4;_0xc5ef01[_0x5aba('0x176')]=_0x577cc1[_0x5aba('0x177')]||0x5dc;_0xc5ef01['XMD-AMDAFTERGREETINGSILENCE']=_0x577cc1[_0x5aba('0x178')]||0x320;_0xc5ef01[_0x5aba('0x179')]=_0x577cc1['dialAMDTotalAnalysisTime']||0x1388;_0xc5ef01[_0x5aba('0x17a')]=_0x577cc1[_0x5aba('0x17b')]||0x64;_0xc5ef01['XMD-AMDBETWEENWORDSSILENCE']=_0x577cc1['dialAMDBetweenWordsSilence']||0x32;_0xc5ef01[_0x5aba('0x17c')]=_0x577cc1[_0x5aba('0x17d')]||0x3;_0xc5ef01['XMD-AMDSILENCETHRESHOLD']=_0x577cc1[_0x5aba('0x17e')]||0x100;_0xc5ef01[_0x5aba('0x17f')]=_0x577cc1['dialAMDMaximumWordLength']||0x1388;}if(utils['isOutboundQueue'](_0x577cc1)){_0xc5ef01[_0x5aba('0x180')]=_0x42e698[_0x5aba('0xe8')];}else{_0xc5ef01[_0x5aba('0x181')]=_0x42e698['CampaignId'];}var _0x24aa66=utils[_0x5aba('0x182')](_0x42e698[_0x5aba('0x183')]);Object[_0x5aba('0x14f')](_0xc5ef01,_0x24aa66);var _0x1dce45=_0x369edf[_0x5aba('0x95')](_0x577cc1[_0x5aba('0x184')])?utils[_0x5aba('0x185')](_0x577cc1[_0x5aba('0x184')][_0x5aba('0x186')],_0x577cc1[_0x5aba('0x187')],_0x577cc1[_0x5aba('0x188')]>0x0?utils[_0x5aba('0x189')](_0x577cc1[_0x5aba('0x18a')],_0x577cc1[_0x5aba('0x188')]):_0x577cc1[_0x5aba('0x18a')]):utils[_0x5aba('0x185')](_[_0x5aba('0xfe')](_0x577cc1['TrunkBackup'])?_0x577cc1[_0x5aba('0x184')][_0x5aba('0x186')]:_0x577cc1[_0x5aba('0x9b')][_0x5aba('0x186')],_0x577cc1[_0x5aba('0x187')],_0x577cc1[_0x5aba('0x188')]>0x0?utils[_0x5aba('0x189')](_0x577cc1['dialOriginateCallerIdNumber'],_0x577cc1['dialRandomLastDigitCallerIdNumber']):_0x577cc1[_0x5aba('0x18a')]);if(_0x1dce45){_0xc5ef01[_0x5aba('0x18b')]=_0x369edf['actions'][_0x189452][_0x5aba('0x18c')]=utils[_0x5aba('0x18d')](_0x1dce45);_0xc5ef01[_0x5aba('0x18e')]=_0x42e698[_0x5aba('0x16c')];}_0x577cc1[_0x5aba('0x18f')]=_0xc5ef01;return ami['Action']({'actionid':_0x189452,'action':_0x5aba('0x16a'),'channel':_0x369edf[_0x5aba('0x95')](_0x577cc1[_0x5aba('0x184')])?util[_0x5aba('0x8a')](_0x5aba('0x190'),_0x577cc1['Trunk'][_0x5aba('0x4f')],isNotNull(_0x577cc1[_0x5aba('0x191')])?_0x577cc1[_0x5aba('0x191')]['trim']()||'':'',_0x577cc1['dialCutDigit']>0x0?_0x42e698[_0x5aba('0x16c')][_0x5aba('0x192')](_0x577cc1[_0x5aba('0x193')]):_0x42e698[_0x5aba('0x16c')]):util[_0x5aba('0x8a')](_0x5aba('0x190'),_[_0x5aba('0xfe')](_0x577cc1[_0x5aba('0x9b')])?_0x577cc1['Trunk'][_0x5aba('0x4f')]:_0x577cc1[_0x5aba('0x9b')][_0x5aba('0x4f')],isNotNull(_0x577cc1['dialPrefix'])?_0x577cc1[_0x5aba('0x191')][_0x5aba('0x194')]()||'':'',_0x577cc1[_0x5aba('0x193')]>0x0?_0x42e698['phone'][_0x5aba('0x192')](_0x577cc1[_0x5aba('0x193')]):_0x42e698[_0x5aba('0x16c')]),'callerid':_0x1dce45,'Exten':'xcally-motion-dialer','Context':_0x5aba('0x195'),'Priority':'1','variable':_0xc5ef01,'timeout':(_0x577cc1[_0x5aba('0x196')]||0x1e)*0x3e8,'async':!![],'channelid':_0x189452})[_0x5aba('0x48')](function(_0x33c1cd){return _0x96ef92(_0x33c1cd);})[_0x5aba('0xac')](function(_0x25b925){_0x577cc1[_0x5aba('0x197')]+=0x1;var _0x1030ca=new History(_0x369edf[_0x5aba('0x28')][_0x189452]);logger[_0x5aba('0x6f')](util['format'](_0x5aba('0x198'),JSON[_0x5aba('0x7f')](_0x25b925)));_0x1030ca[_0x5aba('0x79')]=0xe;_0x1030ca[_0x5aba('0x7a')]=_0x5aba('0x199');_0x1030ca[_0x5aba('0x7c')]=moment()[_0x5aba('0x8a')](_0x5aba('0xd0'));_0x1030ca['endtime']=_0x1030ca[_0x5aba('0x7c')];hopperUtils['createHistory'](_0x1030ca)[_0x5aba('0xac')](loggerCatch(_0x5aba('0x19a')));_0x369edf[_0x5aba('0xd5')](_0x1030ca)[_0x5aba('0xac')](loggerCatch(_0x5aba('0x19a')))['finally'](function(){delete _0x369edf[_0x5aba('0x28')][_0x189452];return _0x4ddd5e(msgResponse('originate',_0x5aba('0x94'),'originate\x20action\x20Error'));});});});};Dialer['prototype']['checkRetriveMax']=function(_0x3664e7,_0x4c769e,_0x294244){var _0x224f0b=new History(_0x4c769e);if(_0x224f0b[_0x5aba('0x12a')]+_0x224f0b[_0x5aba('0x12b')]+_0x224f0b[_0x5aba('0x19b')]+_0x224f0b[_0x5aba('0x12c')]+_0x224f0b['countdropretry']+_0x224f0b[_0x5aba('0xf3')]+_0x224f0b[_0x5aba('0x127')]+_0x224f0b[_0x5aba('0x12d')]>=_0x294244['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x3664e7){case 0x3:if(_0x224f0b[_0x5aba('0x19b')]>=_0x294244[_0x5aba('0x19c')]-0x1){return!![];}hopperUtils[_0x5aba('0xe5')]({'active':![],'countnoanswerretry':_0x224f0b[_0x5aba('0x19b')]+=0x1,'scheduledat':moment()[_0x5aba('0xf7')](_0x294244[_0x5aba('0x19d')],'minutes')[_0x5aba('0x8a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x224f0b['ContactId'],'ListId':_0x224f0b['ListId'],'VoiceQueueId':_0x224f0b['VoiceQueueId']||undefined,'CampaignId':_0x224f0b[_0x5aba('0xe9')]||undefined})[_0x5aba('0xac')](loggerCatch(_0x5aba('0x19e')));break;case 0x5:if(_0x224f0b['countbusyretry']>=_0x294244[_0x5aba('0x19f')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x224f0b[_0x5aba('0x12a')]+=0x1,'scheduledat':moment()[_0x5aba('0xf7')](_0x294244[_0x5aba('0x1a0')],_0x5aba('0xe6'))[_0x5aba('0x8a')](_0x5aba('0xd0')),'ContactId':_0x224f0b['ContactId'],'ListId':_0x224f0b[_0x5aba('0xe7')],'VoiceQueueId':_0x224f0b[_0x5aba('0xe8')]||undefined,'CampaignId':_0x224f0b[_0x5aba('0xe9')]||undefined})[_0x5aba('0xac')](loggerCatch(_0x5aba('0x1a1')));break;case 0x8:if(_0x224f0b[_0x5aba('0x12b')]>=_0x294244[_0x5aba('0x1a2')]-0x1){return!![];}hopperUtils[_0x5aba('0xe5')]({'active':![],'countcongestionretry':_0x224f0b[_0x5aba('0x12b')]+=0x1,'scheduledat':moment()[_0x5aba('0xf7')](_0x294244[_0x5aba('0x1a3')],'minutes')[_0x5aba('0x8a')](_0x5aba('0xd0')),'ContactId':_0x224f0b[_0x5aba('0xf8')],'ListId':_0x224f0b['ListId'],'VoiceQueueId':_0x224f0b['VoiceQueueId']||undefined,'CampaignId':_0x224f0b[_0x5aba('0xe9')]||undefined})[_0x5aba('0xac')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x224f0b['countnosuchnumberretry']>=_0x294244[_0x5aba('0x1a4')]-0x1){return!![];}else{hopperUtils[_0x5aba('0xe5')]({'active':![],'countnosuchnumberretry':_0x224f0b[_0x5aba('0x12c')]+=0x1,'scheduledat':moment()[_0x5aba('0xf7')](_0x294244['dialNoSuchNumberRetryFrequency'],_0x5aba('0xe6'))['format'](_0x5aba('0xd0')),'ContactId':_0x224f0b[_0x5aba('0xf8')],'ListId':_0x224f0b['ListId'],'VoiceQueueId':_0x224f0b[_0x5aba('0xe8')]||undefined,'CampaignId':_0x224f0b[_0x5aba('0xe9')]||undefined})[_0x5aba('0xac')](loggerCatch(_0x5aba('0x1a5')));}break;case 0xa:if(_0x224f0b['countdropretry']>=_0x294244['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0x5aba('0xe5')]({'active':![],'countdropretry':_0x224f0b[_0x5aba('0xdd')]+=0x1,'scheduledat':moment()[_0x5aba('0xf7')](_0x294244[_0x5aba('0xdf')],_0x5aba('0xe6'))[_0x5aba('0x8a')](_0x5aba('0xd0')),'ContactId':_0x224f0b[_0x5aba('0xf8')],'ListId':_0x224f0b[_0x5aba('0xe7')],'VoiceQueueId':_0x224f0b[_0x5aba('0xe8')]||undefined,'CampaignId':_0x224f0b[_0x5aba('0xe9')]||undefined})[_0x5aba('0xac')](loggerCatch(_0x5aba('0xea')));break;case 0xb:if(_0x224f0b['countabandonedretry']>=_0x294244[_0x5aba('0xf6')]-0x1){return!![];}hopperUtils[_0x5aba('0xe5')]({'active':![],'countabandonedretry':_0x224f0b['countabandonedretry']+=0x1,'scheduledat':moment()[_0x5aba('0xf7')](_0x294244[_0x5aba('0xf4')],_0x5aba('0xe6'))[_0x5aba('0x8a')](_0x5aba('0xd0')),'ContactId':_0x224f0b[_0x5aba('0xf8')],'ListId':_0x224f0b[_0x5aba('0xe7')],'VoiceQueueId':_0x224f0b['VoiceQueueId']||undefined,'CampaignId':_0x224f0b[_0x5aba('0xe9')]||undefined})[_0x5aba('0xac')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x224f0b[_0x5aba('0x127')]>=_0x294244[_0x5aba('0x138')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x224f0b[_0x5aba('0x127')]+=0x1,'scheduledat':moment()['add'](_0x294244[_0x5aba('0x132')],_0x5aba('0xe6'))[_0x5aba('0x8a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x224f0b[_0x5aba('0xf8')],'ListId':_0x224f0b[_0x5aba('0xe7')],'VoiceQueueId':_0x224f0b[_0x5aba('0xe8')]||undefined,'CampaignId':_0x224f0b[_0x5aba('0xe9')]||undefined})[_0x5aba('0xac')](loggerCatch(_0x5aba('0x133')));break;case 0x14:if(_0x224f0b['countagentrejectretry']>=_0x294244['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x5aba('0xe5')]({'active':![],'countagentrejectretry':_0x224f0b[_0x5aba('0x12d')]+=0x1,'scheduledat':moment()[_0x5aba('0xf7')](_0x294244[_0x5aba('0x1a6')],_0x5aba('0xe6'))[_0x5aba('0x8a')](_0x5aba('0xd0')),'ContactId':_0x224f0b[_0x5aba('0xf8')],'ListId':_0x224f0b['ListId'],'VoiceQueueId':_0x224f0b[_0x5aba('0xe8')]||undefined,'CampaignId':_0x224f0b[_0x5aba('0xe9')]||undefined})[_0x5aba('0xac')](loggerCatch(_0x5aba('0x1a7')));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x4c3ce7,_0x2c370a,_0x591dc2){var _0x4f857d=this;var _0x447867=new History(_0x4c3ce7);var _0x36bdc5=![];var _0x5e88e9;var _0x13e4c6;return new Promise(function(_0x2db7e3,_0x190c87){if(_['isUndefined'](_0x2c370a)&&typeof _0x2c370a!==_0x5aba('0x169')){return _0x190c87(msgResponse('[callProgressDetecting]',_0x5aba('0xa0'),_0x5aba('0x1a8')));}if(_[_0x5aba('0x5f')](_0x591dc2)&&typeof _0x591dc2!==_0x5aba('0x169')){return _0x190c87(msgResponse('[callProgressDetecting]','Failure',_0x5aba('0x1a9')));}hopperUtils[_0x5aba('0xe0')](_0x447867,_0x591dc2['reason'],_0x2c370a)[_0x5aba('0x48')](function(_0x56bcf2){if(_0x56bcf2[_0x5aba('0xe2')]==0x1)_0x36bdc5=!![];switch(_0x591dc2[_0x5aba('0xd1')]){case'0':_0x2c370a['outboundNoSuchCallsDay']+=0x1;_0x447867[_0x5aba('0x79')]=0x0;_0x447867['statedesc']='NoSuchNumber';_0x447867[_0x5aba('0x12c')]+=0x1;_0x447867[_0x5aba('0xde')]+=0x1;ami['emit'](_0x5aba('0x1aa'),ut[_0x5aba('0x128')](_0x4c3ce7,_0x5aba('0x1ab')));_0x5e88e9=_0x2c370a[_0x5aba('0x1ac')];_0x13e4c6=_0x2c370a[_0x5aba('0xf5')];hopperUtils[_0x5aba('0xd4')](_0x447867)[_0x5aba('0xac')](loggerCatch(_0x5aba('0x129')));if(_0x4f857d[_0x5aba('0x1ad')](0x0,_0x4c3ce7,_0x2c370a)&&!_0x36bdc5){if(_0x447867[_0x5aba('0x12c')]>=_0x2c370a[_0x5aba('0x1a4')]){_0x4f857d[_0x5aba('0x139')](_0x447867,_0x2db7e3,_0x190c87,_0x5aba('0x1ae'));}else{_0x4f857d[_0x5aba('0x12f')](_0x447867,_0x2db7e3,_0x190c87,_0x5aba('0x1ae'));}}break;case'3':_0x2c370a[_0x5aba('0x1af')]+=0x1;_0x447867[_0x5aba('0x79')]=0x3;_0x447867[_0x5aba('0x7a')]=_0x5aba('0x1b0');_0x447867[_0x5aba('0x19b')]+=0x1;_0x447867[_0x5aba('0xde')]+=0x1;var _0x13dc31=ut[_0x5aba('0x1b1')](_0x4c3ce7,_0x2c370a);ami[_0x5aba('0x4a')](_0x5aba('0x1b2'),_0x13dc31);_0x5e88e9=_0x2c370a[_0x5aba('0x19d')];_0x13e4c6=_0x2c370a['callAdditionalPhoneAfterMin'];hopperUtils[_0x5aba('0xd4')](_0x447867)[_0x5aba('0xac')](loggerCatch(_0x5aba('0x1b3')));if(_0x4f857d['checkRetriveMax'](0x3,_0x4c3ce7,_0x2c370a)&&!_0x36bdc5){if(_0x447867[_0x5aba('0x19b')]>=_0x2c370a[_0x5aba('0x19c')]){_0x4f857d[_0x5aba('0x139')](_0x447867,_0x2db7e3,_0x190c87,_0x5aba('0x1b4'));}else{_0x4f857d['stateGlobal'](_0x447867,_0x2db7e3,_0x190c87,_0x5aba('0x1b4'));}}break;case'5':_0x2c370a['outboundBusyCallsDay']+=0x1;_0x447867[_0x5aba('0x79')]=0x5;_0x447867['statedesc']=_0x5aba('0x1b5');_0x447867[_0x5aba('0x12a')]+=0x1;_0x447867[_0x5aba('0xde')]+=0x1;ami[_0x5aba('0x4a')](_0x5aba('0x1b6'),ut['buildObj'](_0x4c3ce7,_0x5aba('0x1b7')));_0x5e88e9=_0x2c370a[_0x5aba('0x1a0')];_0x13e4c6=_0x2c370a[_0x5aba('0xf5')];hopperUtils[_0x5aba('0xd4')](_0x447867)[_0x5aba('0xac')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x4f857d['checkRetriveMax'](0x5,_0x4c3ce7,_0x2c370a)&&!_0x36bdc5){if(_0x447867[_0x5aba('0x12a')]>=_0x2c370a['dialBusyMaxRetry']){_0x4f857d[_0x5aba('0x139')](_0x447867,_0x2db7e3,_0x190c87,_0x5aba('0x1b8'));}else{_0x4f857d['stateGlobal'](_0x447867,_0x2db7e3,_0x190c87,_0x5aba('0x1b8'));}}break;case'8':_0x2c370a[_0x5aba('0x1b9')]+=0x1;_0x447867['state']=0x8;_0x447867[_0x5aba('0x7a')]='Congestion';_0x447867[_0x5aba('0x12b')]+=0x1;_0x447867[_0x5aba('0xde')]+=0x1;_0x5e88e9=_0x2c370a['dialCongestionRetryFrequency'];_0x13e4c6=_0x2c370a[_0x5aba('0xf5')];ami[_0x5aba('0x4a')]('custom:agentcongestion',ut[_0x5aba('0x128')](_0x4c3ce7,_0x5aba('0x1ba')));hopperUtils[_0x5aba('0xd4')](_0x447867)[_0x5aba('0xac')](loggerCatch(_0x5aba('0x1bb')));if(_0x4f857d['checkRetriveMax'](0x8,_0x4c3ce7,_0x2c370a)&&!_0x36bdc5){if(_0x447867['countcongestionretry']>=_0x2c370a[_0x5aba('0x1a2')]){_0x4f857d[_0x5aba('0x139')](_0x447867,_0x2db7e3,_0x190c87,_0x5aba('0x1bc'));}else{_0x4f857d['stateGlobal'](_0x447867,_0x2db7e3,_0x190c87,_0x5aba('0x1bc'));}}break;case'11':_0x2c370a['outboundAbandonedCallsDay']+=0x1;_0x447867[_0x5aba('0x79')]=0xb;_0x447867['statedesc']='Abandoned';_0x447867['countabandonedretry']+=0x1;_0x447867[_0x5aba('0xde')]+=0x1;_0x5e88e9=_0x2c370a[_0x5aba('0xf4')];_0x13e4c6=_0x2c370a['callAdditionalPhoneAfterMin'];hopperUtils[_0x5aba('0xd4')](_0x447867)['catch'](loggerCatch(_0x5aba('0xf9')));if(_0x4f857d[_0x5aba('0x1ad')](0xb,_0x4c3ce7,_0x2c370a)&&!_0x36bdc5){if(_0x447867['countabandonedretry']>=_0x2c370a[_0x5aba('0xf6')]){_0x4f857d['createStateFinal'](_0x447867,_0x2db7e3,_0x190c87,_0x5aba('0x1bd'));}else{_0x4f857d[_0x5aba('0x12f')](_0x447867,_0x2db7e3,_0x190c87,'reason\x2011\x20abandoned');}}break;case'20':_0x2c370a[_0x5aba('0x1be')]+=0x1;_0x447867['state']=0x14;_0x447867[_0x5aba('0x7a')]='AgentReject';_0x447867[_0x5aba('0x12d')]+=0x1;_0x447867[_0x5aba('0xde')]+=0x1;_0x5e88e9=_0x2c370a[_0x5aba('0x1a6')];_0x13e4c6=_0x2c370a[_0x5aba('0xf5')];ami['emit'](_0x5aba('0x1bf'),ut['buildObj'](_0x4c3ce7,_0x5aba('0x1c0')));hopperUtils[_0x5aba('0xd4')](_0x447867)[_0x5aba('0xac')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x4f857d[_0x5aba('0x1ad')](0x14,_0x4c3ce7,_0x2c370a)&&!_0x36bdc5){if(_0x447867[_0x5aba('0x12d')]>=_0x2c370a[_0x5aba('0x1c1')]){_0x4f857d[_0x5aba('0x139')](_0x447867,_0x2db7e3,_0x190c87,_0x5aba('0x1c2'));}else{_0x4f857d['stateGlobal'](_0x447867,_0x2db7e3,_0x190c87,_0x5aba('0x1c2'));}}break;default:_0x2c370a[_0x5aba('0x1c3')]+=0x1;_0x447867[_0x5aba('0x79')]=0xc;_0x447867['statedesc']=_0x591dc2[_0x5aba('0xd1')];_0x5e88e9=_0x2c370a[_0x5aba('0x1a6')];_0x13e4c6=_0x2c370a[_0x5aba('0xf5')];hopperUtils['createHistory'](_0x447867)[_0x5aba('0xac')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x4f857d[_0x5aba('0x1ad')](_0x591dc2[_0x5aba('0xd1')],_0x4c3ce7,_0x2c370a)&&!_0x36bdc5){if(_0x447867['countbusyretry']+_0x447867['countcongestionretry']+_0x447867[_0x5aba('0x19b')]+_0x447867[_0x5aba('0x12c')]+_0x447867[_0x5aba('0xdd')]+_0x447867[_0x5aba('0xf3')]+_0x447867[_0x5aba('0x127')]+_0x447867[_0x5aba('0x12d')]>=_0x2c370a[_0x5aba('0x12e')]){_0x4f857d[_0x5aba('0x12f')](_0x447867,_0x2db7e3,_0x190c87,_0x591dc2[_0x5aba('0xd1')]);}else{_0x4f857d[_0x5aba('0x139')](_0x447867,_0x2db7e3,_0x190c87,_0x591dc2[_0x5aba('0xd1')]);}}}})[_0x5aba('0x48')](function(){if(_0x36bdc5){hopperUtils[_0x5aba('0xee')](_0x447867,_0x5e88e9,_0x13e4c6)[_0x5aba('0x48')](function(){return _0x2db7e3(0x1);});}});});};Dialer['prototype']['stateGlobal']=function(_0x109552,_0xff4c31,_0x433953,_0x15573f){var _0x599560=new Final(_0x109552);_0x599560['state']=0xf;_0x599560['statedesc']='Global';this[_0x5aba('0x139')](_0x599560,_0xff4c31,_0x433953,_0x15573f);};Dialer[_0x5aba('0x1e')][_0x5aba('0x139')]=function(_0x1df23f,_0x3caf66,_0xa6561b,_0x38e18f){hopperUtils[_0x5aba('0xd5')](_0x1df23f)[_0x5aba('0x48')](function(){return _0x3caf66(msgResponse(_0x5aba('0x1c4'),_0x5aba('0x115'),_0x38e18f));})['catch'](function(){return _0xa6561b(msgResponse('[moveContactManagedDialer][0]',_0x5aba('0xa0'),_0x5aba('0x1c5')));});};Dialer[_0x5aba('0x1e')][_0x5aba('0x9')]=function(_0x4b4887){var _0x55e055=_0x4b4887[_0x5aba('0x1c6')]/0x64;var _0x3fa5f3=_0x4b4887[_0x5aba('0xda')]/(_0x4b4887[_0x5aba('0xda')]+_0x4b4887['outboundAnswerCallsDay']);var _0x59b314=Math['round'](_0x4b4887[_0x5aba('0x1c7')]*(_0x4b4887[_0x5aba('0x1c8')]/0x64));var _0x5b7544=Math[_0x5aba('0x1c9')](_0x4b4887[_0x5aba('0x1c7')]*(_0x4b4887['predictiveIntervalMinThreshold']/0x64));var _0xe04c83=_0x4b4887[_0x5aba('0x146')]+_0x4b4887[_0x5aba('0x148')];var _0x89088a=Math[_0x5aba('0x1ca')](_0x4b4887['erlangCalls']*_0x4b4887[_0x5aba('0x69')]*_0x4b4887[_0x5aba('0x1cb')]*_0x4b4887[_0x5aba('0x1cc')]);if(_['isUndefined'](_0x4b4887['startProgressive'])){if(!_[_0x5aba('0x5f')](_0x4b4887[_0x5aba('0x2b')])){_0x4b4887['startPredictive']=undefined;loggerPredictive[_0x5aba('0x6f')]('[startMethodPredictive][StartProgressive]',_0x5aba('0x1cd'));}if(!_[_0x5aba('0x5f')](_0x4b4887[_0x5aba('0x6d')])){loggerPredictive['error'](_0x5aba('0x1ce'),_0x5aba('0x1cf'));clearInterval(_0x4b4887[_0x5aba('0x6d')]);_0x4b4887['handlePredictive']=undefined;}_0x4b4887[_0x5aba('0x2c')]=moment()[_0x5aba('0x8a')](_0x5aba('0xd0'));loggerPredictive['info'](_0x4b4887[_0x5aba('0x4f')],'collection\x20data\x20in\x20progressive\x20at',_0x4b4887[_0x5aba('0x2c')]);this[_0x5aba('0xc0')](_0x4b4887,0x1);}else if(ifInterval(_0x4b4887[_0x5aba('0x1d0')],_0x4b4887[_0x5aba('0x2c')])){this[_0x5aba('0xc0')](_0x4b4887,0x1);loggerPredictiveCalls[_0x5aba('0x54')]('[startMethodPredictive][StartProgressive][Loop]',_0x4b4887['startProgressive'],_0x4b4887[_0x5aba('0x4f')]);_0x4b4887['erlangCalls']=0x0;_0x4b4887['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x55e055<_0x3fa5f3&&_0x4b4887['dialPredictiveOptimization']===_0x5aba('0x1d1')){clearPredictiveAttributes(_0x4b4887);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x1d2'),_0x5aba('0x1d3'),_0x3fa5f3,'startProgressive',_0x4b4887[_0x5aba('0x4f')]);}else if(_0x89088a<_0x4b4887[_0x5aba('0x1d4')]&&_0x4b4887[_0x5aba('0x1d5')]===_0x5aba('0x1d1')){clearPredictiveAttributes(_0x4b4887);loggerPredictive[_0x5aba('0x54')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x5aba('0x1d6'),_0x89088a,_0x5aba('0x1d7'),_0x4b4887[_0x5aba('0x1d4')],_0x5aba('0x2c'),_0x4b4887[_0x5aba('0x4f')]);}else if(!ifInterval(_0x4b4887[_0x5aba('0x1d0')],_0x4b4887['startProgressive'])&&_[_0x5aba('0x5f')](_0x4b4887[_0x5aba('0x2b')])&&!_[_0x5aba('0x5f')](_0x4b4887[_0x5aba('0x2c')])){_0x4b4887[_0x5aba('0x2b')]=moment()['format'](_0x5aba('0xd0'));loggerPredictive[_0x5aba('0x54')](_0x4b4887[_0x5aba('0x4f')],_0x5aba('0x1d8'),_0x4b4887[_0x5aba('0x2b')]);hopperUtils['avgHandleTime'](_0x4b4887[_0x5aba('0x1d0')])['then'](this[_0x5aba('0x1d9')](_0x4b4887))[_0x5aba('0x48')](mergeDataErlangB(_0x4b4887))[_0x5aba('0x48')](this[_0x5aba('0x1da')](_0x4b4887))[_0x5aba('0xac')](loggerCatchPredictive(_0x5aba('0x1db'),_0x4b4887));}else if(!ifInterval(_0x4b4887[_0x5aba('0x1d0')],_0x4b4887['startPredictive'])){_0x4b4887['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x4b4887[_0x5aba('0x2b')]=moment()[_0x5aba('0x8a')](_0x5aba('0xd0'));loggerPredictive[_0x5aba('0x54')](_0x4b4887[_0x5aba('0x4f')],_0x5aba('0x1dc'),_0x4b4887['startPredictive']);clearInterval(_0x4b4887[_0x5aba('0x6d')]);_0x4b4887[_0x5aba('0x6d')]=undefined;hopperUtils['avgHandleTime'](_0x4b4887[_0x5aba('0x1d0')])[_0x5aba('0x48')](this['getDataPredictive'](_0x4b4887))[_0x5aba('0x48')](mergeDataErlangB(_0x4b4887))[_0x5aba('0x48')](this[_0x5aba('0x1da')](_0x4b4887))[_0x5aba('0xac')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x4b4887));}else if(_0x4b4887[_0x5aba('0x1c7')]&&_0xe04c83<_0x4b4887[_0x5aba('0x1c7')]-_0x5b7544){clearPredictiveAttributes(_0x4b4887);loggerPredictive[_0x5aba('0x54')](_0x4b4887[_0x5aba('0x4f')],_0x5aba('0x1dd'),_0xe04c83,')\x20are\x20less\x20than\x20threshold\x20(',_0x4b4887[_0x5aba('0x1c7')],'-',_0x5b7544,'=',_0x4b4887[_0x5aba('0x1c7')]-_0x5b7544,')');}else if(_0x4b4887[_0x5aba('0x1c7')]&&_0xe04c83>_0x4b4887['predictiveIntervalAvailable']+_0x59b314){clearPredictiveAttributes(_0x4b4887);loggerPredictive[_0x5aba('0x54')](_0x4b4887['name'],_0x5aba('0x1dd'),_0xe04c83,_0x5aba('0x1de'),_0x4b4887[_0x5aba('0x1c7')],'+',_0x59b314,'=',_0x4b4887[_0x5aba('0x1c7')]+_0x59b314,')');}};Dialer[_0x5aba('0x1e')]['getDataPredictive']=function(_0x30d4cc){var _0x260834=this;return function(_0x1f0c48){return new Promise(function(_0x8db285,_0x15ba16){_[_0x5aba('0x102')](_0x30d4cc,_0x1f0c48[0x0]);if(checkGetDataPredictive(_0x1f0c48[0x0])){var _0x46e17e=_0x30d4cc[_0x5aba('0x1c7')]=_0x30d4cc[_0x5aba('0x148')]+_0x30d4cc[_0x5aba('0x146')];var _0x381bfc=_0x30d4cc[_0x5aba('0x1d0')]*0x3c;var _0x28ed7a=_0x1f0c48[0x0][_0x5aba('0x5d')]+_0x1f0c48[0x0][_0x5aba('0x5b')];var _0x169ac1=(_0x1f0c48[0x0][_0x5aba('0x56')]+_0x1f0c48[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1f0c48[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1f0c48[0x0]['predictiveIntervalTotalCalls'];_0x30d4cc[_0x5aba('0x1cb')]=_0x169ac1>0x0?_0x169ac1:0x1;switch(_0x30d4cc[_0x5aba('0x1d5')]){case _0x5aba('0x1d1'):var _0x6b4f8e=_0x30d4cc[_0x5aba('0x1c6')]/0x64;return _0x260834['abandonmentRate'](_0x46e17e,_0x381bfc,_0x28ed7a,_0x169ac1,_0x6b4f8e)[_0x5aba('0x48')](function(_0x522aed){return _0x8db285(_0x522aed);});case'agentBusyFactor':var _0x49191b=_0x30d4cc[_0x5aba('0x1c6')]/0x64;return _0x260834[_0x5aba('0x1df')](_0x46e17e,_0x381bfc,_0x28ed7a,_0x169ac1,_0x49191b)[_0x5aba('0x48')](function(_0x55c95d){return _0x8db285(_0x55c95d);});default:return _0x15ba16(msgResponse('[getDataPredictive]',_0x5aba('0xa0'),_0x5aba('0x1e0')));}}else{return _0x15ba16(msgResponse(_0x5aba('0x1e1'),_0x5aba('0xa0'),_0x5aba('0x1e2')));}});};};Dialer[_0x5aba('0x1e')][_0x5aba('0x1e3')]=function(_0x2c830a){var _0x4d4a2f=this;return function(_0x2038d7){return new Promise(function(_0x704675,_0x57b688){_['merge'](_0x2c830a,_0x2038d7[0x0]);if(checkGetDataPredictive(_0x2038d7[0x0])){loggerPredictive[_0x5aba('0x54')](JSON[_0x5aba('0x7f')](_0x2038d7[0x0]));if(_0x2c830a[_0x5aba('0x1d5')]==='dropRate'){return _0x4d4a2f[_0x5aba('0x15e')](_0x2c830a['id'])[_0x5aba('0x48')](function(_0x41aa76){var _0x39c977=_0x2c830a['loggedIn']-_0x41aa76[0x0][_0x5aba('0x1e4')];var _0x45e667=_0x2c830a[_0x5aba('0x1d0')]*0x3c;var _0x4e0b0a=_0x2038d7[0x0]['predictiveIntervalAvgTalktime']+_0x2038d7[0x0][_0x5aba('0x5b')];var _0x23618e=(_0x2038d7[0x0][_0x5aba('0x56')]+_0x2038d7[0x0][_0x5aba('0x58')]+_0x2038d7[0x0][_0x5aba('0xef')])/_0x2038d7[0x0]['predictiveIntervalTotalCalls'];var _0x4bda3a=_0x2c830a['dialPredictiveOptimizationPercentage']/0x64;_0x2c830a[_0x5aba('0x1e5')]=_0x41aa76[0x0]['outboundQueuePauses']||0x0;_0x2c830a[_0x5aba('0x1cb')]=_0x23618e>0x0?_0x23618e:0x1;return _0x4d4a2f[_0x5aba('0x1e6')](_0x39c977,_0x45e667,_0x4e0b0a,_0x23618e,_0x4bda3a);})[_0x5aba('0x48')](function(_0x1a1a4b){return _0x704675(_0x1a1a4b);})[_0x5aba('0xac')](function(_0x21f48b){return _0x57b688(msgResponse(_0x5aba('0x1e7'),_0x5aba('0xa0'),JSON[_0x5aba('0x7f')](_0x21f48b)));});}if(_0x2c830a[_0x5aba('0x1d5')]===_0x5aba('0x1e8')){return _0x4d4a2f['getVoiceQueueRtPauses'](_0x2c830a['id'])[_0x5aba('0x48')](function(_0x51448c){var _0x238f7d=_0x2c830a[_0x5aba('0x1e9')]-_0x51448c[0x0][_0x5aba('0x1e4')];var _0x179531=_0x2c830a[_0x5aba('0x1d0')]*0x3c;var _0x493f8b=_0x2038d7[0x0]['predictiveIntervalAvgTalktime']+_0x2038d7[0x0][_0x5aba('0x5b')];var _0x2d9e5a=(_0x2038d7[0x0][_0x5aba('0x56')]+_0x2038d7[0x0][_0x5aba('0x58')]+_0x2038d7[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2038d7[0x0]['predictiveIntervalTotalCalls'];var _0x4f5abb=_0x2c830a['dialPredictiveOptimizationPercentage']/0x64;_0x2c830a[_0x5aba('0x1e5')]=_0x51448c[0x0][_0x5aba('0x1e4')]||0x0;_0x2c830a['predictiveIntervalHitRate']=_0x2d9e5a>0x0?_0x2d9e5a:0x1;return _0x4d4a2f[_0x5aba('0x1df')](_0x238f7d,_0x179531,_0x493f8b,_0x2d9e5a,_0x4f5abb);})[_0x5aba('0x48')](function(_0x4607de){return _0x704675(_0x4607de);})[_0x5aba('0xac')](function(_0xa08904){return _0x57b688(msgResponse(_0x5aba('0x1e7'),_0x5aba('0xa0'),JSON[_0x5aba('0x7f')](_0xa08904)));});}}else{return _0x57b688(msgResponse(_0x5aba('0x1e1'),_0x5aba('0xa0'),_0x5aba('0x1e2')));}});};};Dialer[_0x5aba('0x1e')]['startMethodPredictive']=function(_0x296c1e){var _0x44f0d4=this;return function(){var _0x1b4695=0x0;var _0x18799b=Math[_0x5aba('0x1ca')](_0x296c1e[_0x5aba('0x65')]*0x3e8);if(_0x18799b>0x0){_0x18799b=_0x18799b<0x64?0x64:_0x18799b;loggerPredictive['info'](_0x296c1e[_0x5aba('0x4f')],_0x5aba('0x1ea'),_0x18799b,_0x5aba('0x1eb'));_0x296c1e[_0x5aba('0x6d')]=setInterval(function(){_0x44f0d4[_0x5aba('0x6d')](_0x296c1e);loggerPredictiveCalls['info'](_0x5aba('0x1ec'),_0x1b4695+=0x1);},_0x18799b);}else{loggerPredictive[_0x5aba('0x54')](_0x296c1e[_0x5aba('0x4f')],_0x5aba('0x1ed'));}};};Dialer[_0x5aba('0x1e')][_0x5aba('0x1ee')]=function(_0x1da7e5,_0x28d9a3){var _0xf402bc=this;return function(_0xefd3f4){if(_[_0x5aba('0x84')](_0xefd3f4)){if(_['isNil'](_0x28d9a3[_0x5aba('0x164')])||!_0x28d9a3['recallme']){if(_0x1da7e5['dialMethod']==='booked'){_0x1da7e5[_0x5aba('0x7d')]=_[_0x5aba('0x5f')](_0x1da7e5[_0x5aba('0x7d')])?!![]:_0x1da7e5[_0x5aba('0x7d')];var _0x4fd5f8=uuid['v4']();_0xf402bc[_0x5aba('0x28')][_0x4fd5f8]=new Action(_0x1da7e5,_0x28d9a3,_0x4fd5f8);loggerBooked[_0x5aba('0x54')](_0x5aba('0x1ef'),_0x4fd5f8,_0x5aba('0x1f0'),JSON[_0x5aba('0x7f')](_0x1da7e5[_0x5aba('0x7d')]),_0x5aba('0x1f1'),_0x1da7e5[_0x5aba('0x4f')]);if(_0x1da7e5[_0x5aba('0x7d')]){_0x1da7e5[_0x5aba('0x7d')]=![];_0xf402bc[_0x5aba('0x2e')][_0xf402bc[_0x5aba('0x28')][_0x4fd5f8][_0x5aba('0xcc')]]=[];ami[_0x5aba('0xa4')]({'actionid':_0x4fd5f8,'action':'queuestatus','queue':_0x1da7e5[_0x5aba('0x4f')]})[_0x5aba('0xac')](function(){_0xf402bc['updateOriginated'](_0x1da7e5);hopperUtils[_0x5aba('0xe5')]({'active':![],'ContactId':_0xf402bc[_0x5aba('0x28')][_0x4fd5f8]['ContactId'],'ListId':_0xf402bc[_0x5aba('0x28')][_0x4fd5f8][_0x5aba('0xe7')],'VoiceQueueId':_0xf402bc[_0x5aba('0x28')][_0x4fd5f8][_0x5aba('0xe8')]||undefined,'CampaignId':_0xf402bc[_0x5aba('0x28')][_0x4fd5f8][_0x5aba('0xe9')]||undefined})[_0x5aba('0xac')](loggerCatch(_0x5aba('0x1f2')));delete _0xf402bc[_0x5aba('0x28')][_0x4fd5f8];});}else{loggerBooked[_0x5aba('0x54')](_0x5aba('0x1f3'),JSON['stringify'](_0x1da7e5['queueStatusComplete']),_0x5aba('0x1f1'),_0x1da7e5[_0x5aba('0x4f')]);_0xf402bc[_0x5aba('0xd7')](_0x1da7e5);hopperUtils[_0x5aba('0xe5')]({'active':![],'ContactId':_0xf402bc[_0x5aba('0x28')][_0x4fd5f8][_0x5aba('0xf8')],'ListId':_0xf402bc['actions'][_0x4fd5f8][_0x5aba('0xe7')],'VoiceQueueId':_0xf402bc['actions'][_0x4fd5f8]['VoiceQueueId']||undefined,'CampaignId':_0xf402bc[_0x5aba('0x28')][_0x4fd5f8][_0x5aba('0xe9')]||undefined})[_0x5aba('0xac')](loggerCatch(_0x5aba('0x1f2')));delete _0xf402bc[_0x5aba('0x28')][_0x4fd5f8];}}else{return _0xf402bc[_0x5aba('0x1f4')](_0x1da7e5,_0x28d9a3);}}else{if(utils[_0x5aba('0x6a')](undefined,_0x28d9a3[_0x5aba('0x1f5')])<_0x1da7e5['dialRecallMeTimeout']*0x3c){if(_0x28d9a3['Agent']&&!_0x28d9a3[_0x5aba('0x156')]['voicePause']){_0xf402bc[_0x5aba('0x104')][_0x5aba('0x105')](_0x28d9a3['id'])[_0x5aba('0x21')](function(){_0xf402bc[_0x5aba('0xd7')](_0x1da7e5);});}else{hopperUtils[_0x5aba('0x1f6')]({'active':![]},_0x28d9a3['id'],0x1)[_0x5aba('0x21')](function(){_0xf402bc['updateOriginated'](_0x1da7e5);});}}else{_0x1da7e5['outboundReCallsDay']+=0x1;_0xf402bc[_0x5aba('0xd7')](_0x1da7e5);if(_0x1da7e5[_0x5aba('0x1f7')]){hopperUtils[_0x5aba('0xe5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x28d9a3['ContactId'],'ListId':_0x28d9a3['ListId'],'VoiceQueueId':_0x28d9a3[_0x5aba('0xe8')]||undefined,'CampaignId':_0x28d9a3[_0x5aba('0xe9')]||undefined})['catch'](loggerCatch(_0x5aba('0x1f8')));hopperUtils[_0x5aba('0xd4')](createObjHistory(_0x1da7e5,_0x28d9a3,utils[_0x5aba('0x78')][_0x5aba('0x1f9')],0x17,_0x5aba('0x1fa')))[_0x5aba('0xac')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0xf402bc[_0x5aba('0x124')](createObjHistory(_0x1da7e5,_0x28d9a3,utils[_0x5aba('0x78')][_0x5aba('0x1fb')],0x16,_0x5aba('0x1fc')),'[Originate][HistoryRecallClose][historyCatch]',_0x5aba('0x1fd'));}}}}else{_0x1da7e5[_0x5aba('0x1fe')]+=0x1;_0xf402bc[_0x5aba('0x124')](createObjHistory(_0x1da7e5,_0x28d9a3,utils[_0x5aba('0x78')][_0x5aba('0x1ff')],0xd,_0x5aba('0x200')),_0x5aba('0x201'),'[Originate][MoveBlacklist]');throw _0x5aba('0x202');}};};Dialer[_0x5aba('0x1e')][_0x5aba('0x168')]=function(_0x42c02e){var _0x224a5e=this;var _0x5ef5ca=_0x42c02e[_0x5aba('0x203')]-_0x42c02e['originated'];emitCampaignSummary(_0x42c02e);if(_0x5ef5ca>0x0&&_0x42c02e[_0x5aba('0x72')]==0x0){if(_0x5ef5ca>this[_0x5aba('0x27')]){_0x5ef5ca=this[_0x5aba('0x27')];}_0x42c02e[_0x5aba('0x72')]=0x1;hopperUtils['getContactDialerIvr'](_0x42c02e,_0x5ef5ca)[_0x5aba('0x48')](function(_0x508db1){_0x42c02e[_0x5aba('0x72')]=0x0;if(_0x508db1){if(!utils[_0x5aba('0x204')](_0x508db1)){_0x42c02e[_0x5aba('0x74')]=utils[_0x5aba('0x78')][_0x5aba('0x205')];logger['info'](_0x5aba('0x206')+_0x42c02e[_0x5aba('0x4f')]);}else{_0x42c02e['originated']+=_0x508db1[_0x5aba('0x10a')];_0x42c02e[_0x5aba('0x74')]=utils[_0x5aba('0x78')][_0x5aba('0x207')];for(var _0x2244f8=0x0;_0x2244f8<_0x508db1[_0x5aba('0x10a')];_0x2244f8+=0x1){_0x42c02e['ivrTotalCallsDays']+=0x1;if(_[_0x5aba('0xfe')](_0x508db1[_0x2244f8])||_[_0x5aba('0xfe')](_0x508db1[_0x2244f8][_0x5aba('0x183')])||_[_0x5aba('0xfe')](_0x508db1[_0x2244f8][_0x5aba('0x16c')])){_0x224a5e[_0x5aba('0x162')](_0x5aba('0x208'),_0x42c02e,_0x508db1[_0x2244f8]);}else{hopperUtils['checkIsBlackListIvr'](_['pick'](_0x508db1[_0x2244f8],[_0x5aba('0xe9'),'phone']))[_0x5aba('0x48')](_0x224a5e[_0x5aba('0x1ee')](_0x42c02e,_0x508db1[_0x2244f8]))[_0x5aba('0xac')](_0x224a5e['loggerHandler'](_0x5aba('0x209'),_0x42c02e));}}}}})[_0x5aba('0xac')](loggerGetContactDialer(_0x5aba('0x20a'),_0x42c02e,_0x5ef5ca));}};Dialer[_0x5aba('0x1e')]['handlePower']=function(_0x3a1b9b,_0x25b988){var _0x1ffb20=this;var _0xef4ab9=[];if(_0x25b988<0x1||_0x3a1b9b[_0x5aba('0xbe')]===_0x5aba('0x8')){_0x25b988=0x1;}var _0x453e4a=Math['floor'](_0x3a1b9b['available']*_0x25b988)-_0x3a1b9b[_0x5aba('0x8e')];if(_0x3a1b9b[_0x5aba('0x20b')]>0x0){var _0x494205=_0x3a1b9b['dialLimitQueue']-_0x3a1b9b['originated']-_0x3a1b9b['talking']-_0x3a1b9b[_0x5aba('0x149')];if(_0x453e4a>_0x494205){_0x453e4a=_0x494205;}}if(_0x453e4a>0x0&&_0x3a1b9b['temp']==0x0){if(_0x3a1b9b[_0x5aba('0xbe')]===_0x5aba('0x8')){_0x453e4a=0x1;}if(_0x453e4a>this[_0x5aba('0x27')]){_0x453e4a=this['maxNumberOriginate'];}for(var _0x4ea249 in this[_0x5aba('0x25')]){if(typeof this['agents'][_0x4ea249]!==_0x5aba('0xb5')){if(this[_0x5aba('0x25')][_0x4ea249][_0x5aba('0x79')]===_0x5aba('0x20c')&&this[_0x5aba('0x25')][_0x4ea249]['status']===_0x5aba('0x99')){_0xef4ab9[_0x5aba('0xa7')](this[_0x5aba('0x25')][_0x4ea249]['id']);}}}_0x3a1b9b[_0x5aba('0x72')]=0x1;hopperUtils['getContactDialer'](_0x3a1b9b,_0xef4ab9,_0x453e4a)['then'](function(_0x598da3){_0x3a1b9b['temp']=0x0;if(_0x598da3){if(!utils[_0x5aba('0x204')](_0x598da3)){hopperUtils[_0x5aba('0x20d')](_0x3a1b9b)['then'](sendMessageReschedule(_0x3a1b9b))[_0x5aba('0xac')](loggerCatch('[countReScheduled]\x20'));}else{_0x3a1b9b['originated']+=_0x598da3[_0x5aba('0x10a')];_0x3a1b9b[_0x5aba('0x74')]=_0x3a1b9b['dialMethod']===_0x5aba('0x8')?utils['CAMPAIGN_STATUS'][_0x5aba('0x14a')]:utils[_0x5aba('0x78')][_0x5aba('0x207')];for(var _0x20ad04=0x0;_0x20ad04<_0x598da3[_0x5aba('0x10a')];_0x20ad04+=0x1){if(_[_0x5aba('0xfe')](_0x598da3[_0x20ad04])||_['isNil'](_0x598da3[_0x20ad04][_0x5aba('0x183')])||_[_0x5aba('0xfe')](_0x598da3[_0x20ad04][_0x5aba('0x16c')])){_0x1ffb20['emptyContact'](_0x5aba('0x208'),_0x3a1b9b,_0x598da3[_0x20ad04]);}else{hopperUtils[_0x5aba('0x20e')](_['pick'](_0x598da3[_0x20ad04],['VoiceQueueId',_0x5aba('0x16c')]))[_0x5aba('0x48')](_0x1ffb20['checkContactBlack'](_0x3a1b9b,_0x598da3[_0x20ad04]))['catch'](_0x1ffb20['loggerHandler'](_0x5aba('0x208'),_0x3a1b9b));}}}}})[_0x5aba('0xac')](loggerGetContactDialer(_0x5aba('0x20f'),_0x3a1b9b,_0x453e4a));}};Dialer[_0x5aba('0x1e')]['handlePredictive']=function(_0x4a7514){if(_0x4a7514[_0x5aba('0x20b')]>0x0){var _0x32d88e=_0x4a7514[_0x5aba('0x20b')]-_0x4a7514[_0x5aba('0x8e')]-_0x4a7514[_0x5aba('0x148')];if(_0x32d88e>0x0&&_0x4a7514[_0x5aba('0x72')]==0x0){this[_0x5aba('0x210')](_0x4a7514);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0x5aba('0x210')](_0x4a7514);}};Dialer['prototype'][_0x5aba('0x210')]=function(_0x42893c){var _0x588b60=this;var _0x4cf672=[];_0x42893c[_0x5aba('0x8e')]+=0x1;for(var _0x3f9a6c in this[_0x5aba('0x25')]){if(typeof this['agents'][_0x3f9a6c]!==_0x5aba('0xb5')){if(this[_0x5aba('0x25')][_0x3f9a6c][_0x5aba('0x79')]===_0x5aba('0x20c')&&this[_0x5aba('0x25')][_0x3f9a6c][_0x5aba('0x98')]===_0x5aba('0x99')){_0x4cf672['push'](this[_0x5aba('0x25')][_0x3f9a6c]['id']);}}}_0x42893c[_0x5aba('0x72')]=0x1;return this[_0x5aba('0x211')](_0x42893c['id'],_0x4cf672,0x1,_0x42893c[_0x5aba('0x212')],_0x42893c)[_0x5aba('0x48')](function(_0x73b065){_0x42893c[_0x5aba('0x72')]=0x1;if(_0x73b065){if(!utils['checkContactEmpty'](_0x73b065)){utils[_0x5aba('0x71')](_0x42893c,0x1,0x0);return hopperUtils[_0x5aba('0x20d')](_0x42893c)[_0x5aba('0x48')](sendMessageReschedule(_0x42893c))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x42893c[_0x5aba('0x74')]=utils['CAMPAIGN_STATUS'][_0x5aba('0x207')];if(_[_0x5aba('0xfe')](_0x73b065[0x0])||_[_0x5aba('0xfe')](_0x73b065[0x0]['Contact'])||_['isNil'](_0x73b065[0x0][_0x5aba('0x16c')])){_0x588b60[_0x5aba('0x162')]('[actionOriginate]\x20',_0x42893c,_0x73b065[0x0]);}else{return hopperUtils[_0x5aba('0x20e')](_[_0x5aba('0x80')](_0x73b065[0x0],['VoiceQueueId','phone']))[_0x5aba('0x48')](_0x588b60[_0x5aba('0x1ee')](_0x42893c,_0x73b065[0x0]))['catch'](_0x588b60[_0x5aba('0x161')]('[actionOriginatePredictive]\x20',_0x42893c));}}}})[_0x5aba('0xac')](loggerGetContactDialer('[getContactDialerPredictive]',_0x42893c,0x1));};Dialer[_0x5aba('0x1e')][_0x5aba('0x1e6')]=function(_0x45c82d,_0x5b009b,_0x30c97f,_0x36ff06,_0x163487,_0x555648){loggerPredictive['info'](_0x5aba('0x213'));loggerPredictive[_0x5aba('0x54')](_0x5aba('0x214'),_0x45c82d);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x215'),_0x5b009b);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x216'),_0x30c97f);loggerPredictive[_0x5aba('0x54')]('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',_0x36ff06);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x217'),_0x163487);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x5e'));return new Promise(function(_0x44b770,_0x4a9099){if(_0x45c82d<=0x0||isNaN(_0x45c82d)){return _0x4a9099(msgResponse(_0x5aba('0x218'),'Error',_0x5aba('0x219')+_0x45c82d));}if(_0x30c97f<=0x0||isNaN(_0x30c97f)){return _0x4a9099(msgResponse(_0x5aba('0x218'),_0x5aba('0x94'),'Ts\x20=\x20'+_0x30c97f));}if(_0x36ff06<=0x0||isNaN(_0x36ff06)){return _0x4a9099(msgResponse(_0x5aba('0x218'),_0x5aba('0x94'),_0x5aba('0x21a')+_0x36ff06));}if(_0x5b009b<=0x0||isNaN(_0x5b009b)){return _0x4a9099(msgResponse(_0x5aba('0x218'),_0x5aba('0x94'),_0x5aba('0x21b')+_0x5b009b));}if(_0x163487<=0x0||isNaN(_0x163487)){return _0x4a9099(msgResponse(_0x5aba('0x218'),_0x5aba('0x94'),_0x5aba('0x21c')+_0x163487));}_0x555648=_0x555648||0x0;var _0xdf8e35=0x1/_0x30c97f;var _0x1e0f18=0x0;var _0x414b92=0x0;var _0x49bf24=0x0;var _0x3042f=0x0;for(var _0x3a3e5d=0x0;_0x49bf24<_0x163487;_0x3a3e5d+=0x1){_0x414b92=_0x3a3e5d/_0x5b009b;_0x1e0f18=(_0x36ff06*_0x414b92+_0x555648)/_0xdf8e35;_0x49bf24=utils[_0x5aba('0x21d')](_0x1e0f18,_0x45c82d);_0x3042f=_0x1e0f18/_0x45c82d*(0x1-utils[_0x5aba('0x21d')](_0x1e0f18,_0x45c82d));}return _0x44b770({'erlangCalls':_0x3a3e5d,'erlangCallToSecond':_0x5b009b/_0x3a3e5d,'erlangAbandonmentRate':_0x49bf24,'erlangBusyFactor':_0x3042f});});};Dialer[_0x5aba('0x1e')][_0x5aba('0x1df')]=function(_0x45d7f0,_0x42ffd6,_0x245e4c,_0x851c9a,_0x4c8c77,_0x372a0a){loggerPredictive['info'](_0x5aba('0x21e'));loggerPredictive[_0x5aba('0x54')](_0x5aba('0x214'),_0x45d7f0);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x215'),_0x42ffd6);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x216'),_0x245e4c);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x21f'),_0x851c9a);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x220'),_0x4c8c77);loggerPredictive[_0x5aba('0x54')](_0x5aba('0x5e'));return new Promise(function(_0x444b34,_0x45c0d8){if(_0x45d7f0<=0x0||isNaN(_0x45d7f0)){return _0x45c0d8(msgResponse(_0x5aba('0x221'),'Error',_0x5aba('0x219')+_0x45d7f0));}if(_0x245e4c<=0x0||isNaN(_0x245e4c)){return _0x45c0d8(msgResponse(_0x5aba('0x221'),_0x5aba('0x94'),_0x5aba('0x222')+_0x245e4c));}if(_0x851c9a<=0x0||isNaN(_0x851c9a)){return _0x45c0d8(msgResponse(_0x5aba('0x221'),_0x5aba('0x94'),_0x5aba('0x21a')+_0x851c9a));}if(_0x42ffd6<=0x0||isNaN(_0x42ffd6)){return _0x45c0d8(msgResponse(_0x5aba('0x221'),_0x5aba('0x94'),'interval\x20=\x20'+_0x42ffd6));}if(_0x4c8c77<=0x0||isNaN(_0x4c8c77)){return _0x45c0d8(msgResponse(_0x5aba('0x221'),_0x5aba('0x94'),_0x5aba('0x223')+_0x4c8c77));}_0x372a0a=_0x372a0a||0x0;var _0x2e4776=0x1/_0x245e4c;var _0x5106ee=0x0;var _0x17fd93=0x0;var _0x21f815=0x0;var _0x42171a=0x0;for(var _0x219af3=0x0;_0x42171a<_0x4c8c77;_0x219af3+=0x1){_0x17fd93=_0x219af3/_0x42ffd6;_0x5106ee=(_0x851c9a*_0x17fd93+_0x372a0a)/_0x2e4776;_0x21f815=utils[_0x5aba('0x21d')](_0x5106ee,_0x45d7f0);_0x42171a=_0x5106ee/_0x45d7f0*(0x1-utils[_0x5aba('0x21d')](_0x5106ee,_0x45d7f0));}return _0x444b34({'erlangCalls':_0x219af3,'erlangCallToSecond':_0x42ffd6/_0x219af3,'erlangAbandonmentRate':_0x21f815,'erlangBusyFactor':_0x42171a});});};module[_0x5aba('0x224')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 8381a84..f016846 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x544e=['getQueue','queue','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ContactId','ListId','VoiceQueueId','CampaignId','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','prototype'];(function(_0x3f6932,_0x863654){var _0x2c9f50=function(_0x424d3b){while(--_0x424d3b){_0x3f6932['push'](_0x3f6932['shift']());}};_0x2c9f50(++_0x863654);}(_0x544e,0x1c5));var _0xe544=function(_0x3602ce,_0x21518c){_0x3602ce=_0x3602ce-0x0;var _0x57720a=_0x544e[_0x3602ce];return _0x57720a;};'use strict';var util=require('util');var _=require(_0xe544('0x0'));var moment=require(_0xe544('0x1'));function checkNameSurname(_0x2e9640,_0x27180b,_0x3b649c){var _0x2ef586='';if(!_[_0xe544('0x2')](_0x27180b)&&_0xe544('0x3')===typeof _0x27180b){_0x2ef586+=_0x27180b;}if(!_['isNil'](_0x3b649c)&&'string'===typeof _0x3b649c){_0x2ef586+='\x20'+_0x3b649c;}if(_0x2ef586!==''){return _0x2ef586;}return _0x2e9640;}function Action(_0x114a57,_0x11262e,_0x4d729d){this[_0xe544('0x4')]=_0x114a57;this[_0xe544('0x5')]=_0x4d729d||undefined;this[_0xe544('0x6')]=checkNameSurname(_0x11262e[_0xe544('0x7')][_0xe544('0x8')],_0x11262e[_0xe544('0x7')][_0xe544('0x9')],_0x11262e[_0xe544('0x7')]['lastName']);this[_0xe544('0xa')]=_0x11262e[_0xe544('0x8')];this['queue']=_0x114a57[_0xe544('0x6')];this[_0xe544('0xb')]=_0x11262e['active']||![];this[_0xe544('0xc')]=_0x114a57[_0xe544('0xc')];this[_0xe544('0xd')]=_0x114a57[_0xe544('0xd')]||0x3;this['scheduledat']=_0x11262e[_0xe544('0xe')];this['countbusyretry']=_0x11262e[_0xe544('0xf')];this[_0xe544('0x10')]=_0x11262e[_0xe544('0x10')];this[_0xe544('0x11')]=_0x11262e[_0xe544('0x11')];this['countnosuchnumberretry']=_0x11262e[_0xe544('0x12')];this['countdropretry']=_0x11262e[_0xe544('0x13')];this['countabandonedretry']=_0x11262e['countabandonedretry'];this['countmachineretry']=_0x11262e[_0xe544('0x14')];this['countagentrejectretry']=_0x11262e[_0xe544('0x15')];this[_0xe544('0x16')]=_0x11262e['ContactId'];this[_0xe544('0x17')]=_0x11262e[_0xe544('0x17')];this['UserId']=_0x11262e['UserId'];this[_0xe544('0x18')]=_0x11262e['VoiceQueueId'];this[_0xe544('0x19')]=_0x11262e['CampaignId'];this['idHopper']=_0x11262e['id'];this[_0xe544('0x1a')]=_0x11262e[_0xe544('0x7')][_0xe544('0x9')]||'';this['starttime']=moment()[_0xe544('0x1b')](_0xe544('0x1c'));this['callback']=_0x11262e[_0xe544('0x1d')];this['callbackuniqueid']=_0x11262e[_0xe544('0x1e')];this['callbackat']=_0x11262e['callbackat'];this[_0xe544('0x1f')]=_0x11262e[_0xe544('0x1f')];this[_0xe544('0x20')]='';this[_0xe544('0x21')]='';}Action['prototype'][_0xe544('0x22')]=function(){return util[_0xe544('0x1b')](_0xe544('0x23'),this['name'],this[_0xe544('0x4')][_0xe544('0x24')]>0x0?this['number'][_0xe544('0x25')](this[_0xe544('0x4')][_0xe544('0x24')]):this[_0xe544('0xa')]);};Action[_0xe544('0x26')][_0xe544('0x27')]=function(){return this[_0xe544('0x28')];};module['exports']=Action; \ No newline at end of file +var _0xaaac=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','CampaignId','idHopper','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','queue','exports','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','number','active','type','scheduledat'];(function(_0x47fb59,_0x862899){var _0x2bf187=function(_0x1d629){while(--_0x1d629){_0x47fb59['push'](_0x47fb59['shift']());}};_0x2bf187(++_0x862899);}(_0xaaac,0x1df));var _0xcaaa=function(_0x1a5f5b,_0x1944f1){_0x1a5f5b=_0x1a5f5b-0x0;var _0x11acaf=_0xaaac[_0x1a5f5b];return _0x11acaf;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xcaaa('0x0'));function checkNameSurname(_0x526b66,_0x474a6b,_0x25655b){var _0x2347ad='';if(!_[_0xcaaa('0x1')](_0x474a6b)&&_0xcaaa('0x2')===typeof _0x474a6b){_0x2347ad+=_0x474a6b;}if(!_[_0xcaaa('0x1')](_0x25655b)&&'string'===typeof _0x25655b){_0x2347ad+='\x20'+_0x25655b;}if(_0x2347ad!==''){return _0x2347ad;}return _0x526b66;}function Action(_0x48bfc5,_0x375ab6,_0x25b22d){this[_0xcaaa('0x3')]=_0x48bfc5;this[_0xcaaa('0x4')]=_0x25b22d||undefined;this[_0xcaaa('0x5')]=checkNameSurname(_0x375ab6[_0xcaaa('0x6')][_0xcaaa('0x7')],_0x375ab6[_0xcaaa('0x6')][_0xcaaa('0x8')],_0x375ab6[_0xcaaa('0x6')]['lastName']);this[_0xcaaa('0x9')]=_0x375ab6[_0xcaaa('0x7')];this['queue']=_0x48bfc5[_0xcaaa('0x5')];this[_0xcaaa('0xa')]=_0x375ab6['active']||![];this[_0xcaaa('0xb')]=_0x48bfc5['type'];this['dialQueueTimeout']=_0x48bfc5['dialQueueTimeout']||0x3;this[_0xcaaa('0xc')]=_0x375ab6[_0xcaaa('0xc')];this[_0xcaaa('0xd')]=_0x375ab6[_0xcaaa('0xd')];this[_0xcaaa('0xe')]=_0x375ab6[_0xcaaa('0xe')];this[_0xcaaa('0xf')]=_0x375ab6[_0xcaaa('0xf')];this[_0xcaaa('0x10')]=_0x375ab6['countnosuchnumberretry'];this[_0xcaaa('0x11')]=_0x375ab6[_0xcaaa('0x11')];this[_0xcaaa('0x12')]=_0x375ab6[_0xcaaa('0x12')];this[_0xcaaa('0x13')]=_0x375ab6[_0xcaaa('0x13')];this[_0xcaaa('0x14')]=_0x375ab6[_0xcaaa('0x14')];this[_0xcaaa('0x15')]=_0x375ab6['ContactId'];this[_0xcaaa('0x16')]=_0x375ab6[_0xcaaa('0x16')];this[_0xcaaa('0x17')]=_0x375ab6['UserId'];this['VoiceQueueId']=_0x375ab6['VoiceQueueId'];this[_0xcaaa('0x18')]=_0x375ab6[_0xcaaa('0x18')];this[_0xcaaa('0x19')]=_0x375ab6['id'];this['ContactFirstName']=_0x375ab6[_0xcaaa('0x6')]['firstName']||'';this[_0xcaaa('0x1a')]=moment()['format'](_0xcaaa('0x1b'));this[_0xcaaa('0x1c')]=_0x375ab6[_0xcaaa('0x1c')];this[_0xcaaa('0x1d')]=_0x375ab6[_0xcaaa('0x1d')];this[_0xcaaa('0x1e')]=_0x375ab6[_0xcaaa('0x1e')];this[_0xcaaa('0x1f')]=_0x375ab6[_0xcaaa('0x1f')];this['originatecalleridnum']='';this[_0xcaaa('0x20')]='';}Action[_0xcaaa('0x21')][_0xcaaa('0x22')]=function(){return util['format'](_0xcaaa('0x23'),this['name'],this[_0xcaaa('0x3')]['dialCutDigit']>0x0?this[_0xcaaa('0x9')][_0xcaaa('0x24')](this[_0xcaaa('0x3')][_0xcaaa('0x25')]):this['number']);};Action[_0xcaaa('0x21')][_0xcaaa('0x26')]=function(){return this[_0xcaaa('0x27')];};module[_0xcaaa('0x28')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 8742aa4..4a7db74 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f09=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','ringtime','getSeconds','talktime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue'];(function(_0x2b78da,_0x20351e){var _0x3159c4=function(_0x12655a){while(--_0x12655a){_0x2b78da['push'](_0x2b78da['shift']());}};_0x3159c4(++_0x20351e);}(_0x1f09,0x131));var _0x91f0=function(_0x517165,_0x2b6517){_0x517165=_0x517165-0x0;var _0x5648cf=_0x1f09[_0x517165];return _0x5648cf;};'use strict';var moment=require(_0x91f0('0x0'));var utils=require(_0x91f0('0x1'));function AgentComplete(_0x28b3e4,_0x816718){this[_0x91f0('0x2')]=0x4;this[_0x91f0('0x3')]=_0x91f0('0x4');this[_0x91f0('0x5')]=_0x28b3e4[_0x91f0('0x5')];this[_0x91f0('0x6')]=_0x28b3e4[_0x91f0('0x6')];this[_0x91f0('0x7')]=_0x28b3e4['type']===_0x91f0('0x8')?_0x91f0('0x9'):_0x28b3e4[_0x91f0('0x6')];this[_0x91f0('0xa')]=_0x28b3e4[_0x91f0('0xa')];this[_0x91f0('0xb')]=_0x28b3e4[_0x91f0('0xb')];this['countnoanswerretry']=_0x28b3e4[_0x91f0('0xc')];this[_0x91f0('0xd')]=_0x28b3e4[_0x91f0('0xa')]+_0x28b3e4[_0x91f0('0xb')]+_0x28b3e4[_0x91f0('0xc')]+_0x28b3e4['countnosuchnumberretry']+_0x28b3e4[_0x91f0('0xe')]+_0x28b3e4[_0x91f0('0xf')]+_0x28b3e4[_0x91f0('0x10')]+_0x28b3e4['countagentrejectretry'];this['countnosuchnumberretry']=_0x28b3e4[_0x91f0('0x11')];this[_0x91f0('0xe')]=_0x28b3e4[_0x91f0('0xe')];this[_0x91f0('0xf')]=_0x28b3e4[_0x91f0('0xf')];this['countmachineretry']=_0x28b3e4[_0x91f0('0x10')];this[_0x91f0('0x12')]=_0x28b3e4[_0x91f0('0x12')];this[_0x91f0('0x13')]=_0x816718[_0x91f0('0x13')];this[_0x91f0('0x14')]=_0x28b3e4[_0x91f0('0x15')];this[_0x91f0('0x16')]=_0x28b3e4['number'];this[_0x91f0('0x17')]=_0x28b3e4[_0x91f0('0x17')];this['responsetime']=_0x28b3e4[_0x91f0('0x18')];this[_0x91f0('0x19')]=_0x28b3e4[_0x91f0('0x19')];this[_0x91f0('0x1a')]=moment()[_0x91f0('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x91f0('0x1c')]=utils[_0x91f0('0x1d')](_0x28b3e4[_0x91f0('0x18')],_0x28b3e4[_0x91f0('0x17')]);this['holdtime']=utils[_0x91f0('0x1d')](_0x28b3e4[_0x91f0('0x19')],_0x28b3e4[_0x91f0('0x18')]);this[_0x91f0('0x1e')]=utils[_0x91f0('0x1d')](this[_0x91f0('0x1a')],_0x28b3e4[_0x91f0('0x19')]);this[_0x91f0('0x9')]=_0x816718[_0x91f0('0x9')];this[_0x91f0('0x1f')]=_0x816718[_0x91f0('0x1f')];this[_0x91f0('0x20')]=_0x816718[_0x91f0('0x20')];this[_0x91f0('0x21')]=_0x28b3e4['callback'];this['callbackuniqueid']=_0x28b3e4['callbackuniqueid'];this[_0x91f0('0x22')]=_0x28b3e4[_0x91f0('0x22')];this[_0x91f0('0x23')]=_0x28b3e4[_0x91f0('0x23')];this[_0x91f0('0x24')]=_0x28b3e4['ContactId'];this['ListId']=_0x28b3e4[_0x91f0('0x25')];this['UserId']=_0x28b3e4[_0x91f0('0x26')];this['VoiceQueueId']=_0x28b3e4[_0x91f0('0x27')];this[_0x91f0('0x28')]=_0x28b3e4[_0x91f0('0x28')];this['originatecalleridnum']=_0x28b3e4[_0x91f0('0x29')]||'';this['originatecalleridname']=_0x28b3e4[_0x91f0('0x2a')]||'';this[_0x91f0('0x2b')]=_0x28b3e4['agiafterat'];}module[_0x91f0('0x2c')]=AgentComplete; \ No newline at end of file +var _0x3ae8=['holdtime','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridnum','starttime','responsetime','answertime','endtime','format','getSeconds'];(function(_0x47cbbe,_0x4182f2){var _0xbba106=function(_0x3f4598){while(--_0x3f4598){_0x47cbbe['push'](_0x47cbbe['shift']());}};_0xbba106(++_0x4182f2);}(_0x3ae8,0x177));var _0x83ae=function(_0x9029d8,_0x254ec4){_0x9029d8=_0x9029d8-0x0;var _0x1d58bd=_0x3ae8[_0x9029d8];return _0x1d58bd;};'use strict';var moment=require(_0x83ae('0x0'));var utils=require('../utils');function AgentComplete(_0x5ac1f5,_0x4fbdda){this[_0x83ae('0x1')]=0x4;this['statedesc']=_0x83ae('0x2');this[_0x83ae('0x3')]=_0x5ac1f5[_0x83ae('0x3')];this[_0x83ae('0x4')]=_0x5ac1f5['type'];this[_0x83ae('0x5')]=_0x5ac1f5[_0x83ae('0x4')]===_0x83ae('0x6')?_0x83ae('0x7'):_0x5ac1f5['type'];this[_0x83ae('0x8')]=_0x5ac1f5[_0x83ae('0x8')];this[_0x83ae('0x9')]=_0x5ac1f5['countcongestionretry'];this[_0x83ae('0xa')]=_0x5ac1f5[_0x83ae('0xa')];this[_0x83ae('0xb')]=_0x5ac1f5[_0x83ae('0x8')]+_0x5ac1f5[_0x83ae('0x9')]+_0x5ac1f5[_0x83ae('0xa')]+_0x5ac1f5['countnosuchnumberretry']+_0x5ac1f5[_0x83ae('0xc')]+_0x5ac1f5[_0x83ae('0xd')]+_0x5ac1f5[_0x83ae('0xe')]+_0x5ac1f5[_0x83ae('0xf')];this[_0x83ae('0x10')]=_0x5ac1f5['countnosuchnumberretry'];this[_0x83ae('0xc')]=_0x5ac1f5[_0x83ae('0xc')];this[_0x83ae('0xd')]=_0x5ac1f5[_0x83ae('0xd')];this[_0x83ae('0xe')]=_0x5ac1f5[_0x83ae('0xe')];this[_0x83ae('0xf')]=_0x5ac1f5['countagentrejectretry'];this[_0x83ae('0x11')]=_0x4fbdda['uniqueid'];this['calleridname']=_0x5ac1f5['name'];this[_0x83ae('0x12')]=_0x5ac1f5['number'];this[_0x83ae('0x13')]=_0x5ac1f5['starttime'];this[_0x83ae('0x14')]=_0x5ac1f5[_0x83ae('0x14')];this[_0x83ae('0x15')]=_0x5ac1f5[_0x83ae('0x15')];this[_0x83ae('0x16')]=moment()[_0x83ae('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=utils[_0x83ae('0x18')](_0x5ac1f5[_0x83ae('0x14')],_0x5ac1f5['starttime']);this[_0x83ae('0x19')]=utils[_0x83ae('0x18')](_0x5ac1f5['answertime'],_0x5ac1f5[_0x83ae('0x14')]);this[_0x83ae('0x1a')]=utils[_0x83ae('0x18')](this['endtime'],_0x5ac1f5[_0x83ae('0x15')]);this[_0x83ae('0x7')]=_0x4fbdda['queue'];this[_0x83ae('0x1b')]=_0x4fbdda['membername'];this['reason']=_0x4fbdda['reason'];this[_0x83ae('0x1c')]=_0x5ac1f5[_0x83ae('0x1c')];this[_0x83ae('0x1d')]=_0x5ac1f5[_0x83ae('0x1d')];this[_0x83ae('0x1e')]=_0x5ac1f5[_0x83ae('0x1e')];this[_0x83ae('0x1f')]=_0x5ac1f5[_0x83ae('0x1f')];this['ContactId']=_0x5ac1f5['ContactId'];this[_0x83ae('0x20')]=_0x5ac1f5[_0x83ae('0x20')];this[_0x83ae('0x21')]=_0x5ac1f5[_0x83ae('0x21')];this[_0x83ae('0x22')]=_0x5ac1f5[_0x83ae('0x22')];this[_0x83ae('0x23')]=_0x5ac1f5[_0x83ae('0x23')];this[_0x83ae('0x24')]=_0x5ac1f5[_0x83ae('0x24')]||'';this[_0x83ae('0x25')]=_0x5ac1f5[_0x83ae('0x25')]||'';this['agiafterat']=_0x5ac1f5[_0x83ae('0x26')];}module[_0x83ae('0x27')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 6daf8c4..432ddf1 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6206=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0xc4966b,_0x6cd5e0){var _0x1802bb=function(_0x12f623){while(--_0x12f623){_0xc4966b['push'](_0xc4966b['shift']());}};_0x1802bb(++_0x6cd5e0);}(_0x6206,0x184));var _0x6620=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x6206[_0x119d5a];return _0x15bff4;};'use strict';function Final(_0x12b91c){this['uniqueid']=_0x12b91c[_0x6620('0x0')];this['scheduledat']=_0x12b91c[_0x6620('0x1')];this[_0x6620('0x2')]=_0x12b91c[_0x6620('0x2')];this[_0x6620('0x3')]=_0x12b91c['type']===_0x6620('0x4')?_0x6620('0x5'):_0x12b91c[_0x6620('0x2')];this[_0x6620('0x6')]=_0x12b91c['countbusyretry'];this[_0x6620('0x7')]=_0x12b91c[_0x6620('0x7')];this[_0x6620('0x8')]=_0x12b91c[_0x6620('0x8')];this[_0x6620('0x9')]=_0x12b91c['countbusyretry']+_0x12b91c[_0x6620('0x7')]+_0x12b91c[_0x6620('0x8')]+_0x12b91c[_0x6620('0xa')]+_0x12b91c[_0x6620('0xb')]+_0x12b91c[_0x6620('0xc')]+_0x12b91c[_0x6620('0xd')]+_0x12b91c[_0x6620('0xe')];this[_0x6620('0xa')]=_0x12b91c[_0x6620('0xa')];this[_0x6620('0xb')]=_0x12b91c[_0x6620('0xb')];this[_0x6620('0xc')]=_0x12b91c[_0x6620('0xc')];this[_0x6620('0xd')]=_0x12b91c[_0x6620('0xd')];this[_0x6620('0xe')]=_0x12b91c[_0x6620('0xe')];this['queue']=_0x12b91c[_0x6620('0x5')];this[_0x6620('0xf')]=_0x12b91c[_0x6620('0xf')];this[_0x6620('0x10')]=_0x12b91c[_0x6620('0x10')];this[_0x6620('0x11')]=_0x12b91c['starttime'];this['responsetime']=_0x12b91c[_0x6620('0x12')];this[_0x6620('0x13')]=_0x12b91c[_0x6620('0x12')];this[_0x6620('0x14')]=_0x12b91c['ringtime']||0x0;this['holdtime']=_0x12b91c[_0x6620('0x15')]||0x0;this['talktime']=_0x12b91c[_0x6620('0x16')]||0x0;this[_0x6620('0x17')]=_0x12b91c['callback'];this[_0x6620('0x18')]=_0x12b91c[_0x6620('0x18')];this[_0x6620('0x19')]=_0x12b91c[_0x6620('0x19')];this[_0x6620('0x1a')]=_0x12b91c[_0x6620('0x1a')];this[_0x6620('0x1b')]=_0x12b91c[_0x6620('0x1b')];this['ListId']=_0x12b91c['ListId'];this[_0x6620('0x1c')]=_0x12b91c[_0x6620('0x1c')];this[_0x6620('0x1d')]=_0x12b91c[_0x6620('0x1d')];this[_0x6620('0x1e')]=_0x12b91c['CampaignId'];this['originatecalleridnum']=_0x12b91c[_0x6620('0x1f')]||'';this[_0x6620('0x20')]=_0x12b91c[_0x6620('0x20')]||'';this[_0x6620('0x21')]=_0x12b91c['state'];this[_0x6620('0x22')]=_0x12b91c[_0x6620('0x22')];}module[_0x6620('0x23')]=Final; \ No newline at end of file +var _0xbb56=['scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0xbb56,0x65));var _0x6bb5=function(_0xe7908d,_0x38c980){_0xe7908d=_0xe7908d-0x0;var _0x58d6c7=_0xbb56[_0xe7908d];return _0x58d6c7;};'use strict';function Final(_0x3d63ae){this[_0x6bb5('0x0')]=_0x3d63ae[_0x6bb5('0x0')];this['scheduledat']=_0x3d63ae[_0x6bb5('0x1')];this[_0x6bb5('0x2')]=_0x3d63ae[_0x6bb5('0x2')];this[_0x6bb5('0x3')]=_0x3d63ae[_0x6bb5('0x2')]==='outbound'?_0x6bb5('0x4'):_0x3d63ae['type'];this[_0x6bb5('0x5')]=_0x3d63ae[_0x6bb5('0x5')];this[_0x6bb5('0x6')]=_0x3d63ae['countcongestionretry'];this[_0x6bb5('0x7')]=_0x3d63ae[_0x6bb5('0x7')];this[_0x6bb5('0x8')]=_0x3d63ae[_0x6bb5('0x5')]+_0x3d63ae[_0x6bb5('0x6')]+_0x3d63ae[_0x6bb5('0x7')]+_0x3d63ae[_0x6bb5('0x9')]+_0x3d63ae['countdropretry']+_0x3d63ae[_0x6bb5('0xa')]+_0x3d63ae['countmachineretry']+_0x3d63ae['countagentrejectretry'];this[_0x6bb5('0x9')]=_0x3d63ae[_0x6bb5('0x9')];this[_0x6bb5('0xb')]=_0x3d63ae[_0x6bb5('0xb')];this[_0x6bb5('0xa')]=_0x3d63ae[_0x6bb5('0xa')];this['countmachineretry']=_0x3d63ae[_0x6bb5('0xc')];this[_0x6bb5('0xd')]=_0x3d63ae[_0x6bb5('0xd')];this[_0x6bb5('0x4')]=_0x3d63ae[_0x6bb5('0x4')];this[_0x6bb5('0xe')]=_0x3d63ae['calleridname'];this[_0x6bb5('0xf')]=_0x3d63ae[_0x6bb5('0xf')];this[_0x6bb5('0x10')]=_0x3d63ae[_0x6bb5('0x10')];this['responsetime']=_0x3d63ae['responsetime'];this[_0x6bb5('0x11')]=_0x3d63ae['responsetime'];this[_0x6bb5('0x12')]=_0x3d63ae[_0x6bb5('0x12')]||0x0;this[_0x6bb5('0x13')]=_0x3d63ae[_0x6bb5('0x13')]||0x0;this[_0x6bb5('0x14')]=_0x3d63ae[_0x6bb5('0x14')]||0x0;this[_0x6bb5('0x15')]=_0x3d63ae[_0x6bb5('0x15')];this[_0x6bb5('0x16')]=_0x3d63ae[_0x6bb5('0x16')];this[_0x6bb5('0x17')]=_0x3d63ae[_0x6bb5('0x17')];this[_0x6bb5('0x18')]=_0x3d63ae['recallme'];this[_0x6bb5('0x19')]=_0x3d63ae[_0x6bb5('0x19')];this[_0x6bb5('0x1a')]=_0x3d63ae[_0x6bb5('0x1a')];this[_0x6bb5('0x1b')]=_0x3d63ae[_0x6bb5('0x1b')];this[_0x6bb5('0x1c')]=_0x3d63ae[_0x6bb5('0x1c')];this[_0x6bb5('0x1d')]=_0x3d63ae['CampaignId'];this[_0x6bb5('0x1e')]=_0x3d63ae['originatecalleridnum']||'';this[_0x6bb5('0x1f')]=_0x3d63ae[_0x6bb5('0x1f')]||'';this['state']=_0x3d63ae[_0x6bb5('0x20')];this[_0x6bb5('0x21')]=_0x3d63ae[_0x6bb5('0x21')];}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 5535d23..524638a 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9362=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','starttime','holdtime','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','name','calleridnum','number','responsetime'];(function(_0x13e8a1,_0x539097){var _0x247998=function(_0x3f715f){while(--_0x3f715f){_0x13e8a1['push'](_0x13e8a1['shift']());}};_0x247998(++_0x539097);}(_0x9362,0xbb));var _0x2936=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9362[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x2936('0x0'));var utils=require(_0x2936('0x1'));function Hangup(_0x1a2e53,_0x352fb7){this[_0x2936('0x2')]=0x4;this[_0x2936('0x3')]='Answer';this[_0x2936('0x4')]=_0x1a2e53[_0x2936('0x4')];this[_0x2936('0x5')]=_0x1a2e53[_0x2936('0x5')];this[_0x2936('0x6')]=_0x1a2e53['type']===_0x2936('0x7')?_0x2936('0x8'):_0x1a2e53[_0x2936('0x5')];this[_0x2936('0x9')]=_0x1a2e53[_0x2936('0x9')]||![];this[_0x2936('0xa')]=_0x1a2e53[_0x2936('0xa')];this['countcongestionretry']=_0x1a2e53[_0x2936('0xb')];this[_0x2936('0xc')]=_0x1a2e53['countnoanswerretry'];this['countglobal']=_0x1a2e53[_0x2936('0xa')]+_0x1a2e53[_0x2936('0xb')]+_0x1a2e53[_0x2936('0xc')]+_0x1a2e53['countnosuchnumberretry']+_0x1a2e53[_0x2936('0xd')]+_0x1a2e53['countabandonedretry']+_0x1a2e53[_0x2936('0xe')]+_0x1a2e53[_0x2936('0xf')];this['countnosuchnumberretry']=_0x1a2e53[_0x2936('0x10')];this[_0x2936('0xd')]=_0x1a2e53[_0x2936('0xd')];this[_0x2936('0x11')]=_0x1a2e53[_0x2936('0x11')];this[_0x2936('0xe')]=_0x1a2e53[_0x2936('0xe')];this[_0x2936('0xf')]=_0x1a2e53['countagentrejectretry'];this[_0x2936('0x12')]=_0x352fb7[_0x2936('0x12')];this['calleridname']=_0x1a2e53[_0x2936('0x13')];this[_0x2936('0x14')]=_0x1a2e53[_0x2936('0x15')];this['starttime']=_0x1a2e53['starttime'];this[_0x2936('0x16')]=_0x1a2e53[_0x2936('0x16')];this[_0x2936('0x17')]=moment()[_0x2936('0x18')](_0x2936('0x19'));this['ringtime']=utils[_0x2936('0x1a')](_0x1a2e53['responsetime'],_0x1a2e53[_0x2936('0x1b')]);this[_0x2936('0x1c')]=0x0;this[_0x2936('0x1d')]=utils['getSeconds'](this[_0x2936('0x17')],_0x1a2e53[_0x2936('0x16')]);this[_0x2936('0x8')]=_0x1a2e53[_0x2936('0x8')];this['membername']=_0x2936('0x1e');this[_0x2936('0x1f')]=_0x352fb7[_0x2936('0x20')];this[_0x2936('0x21')]=_0x1a2e53[_0x2936('0x21')];this[_0x2936('0x22')]=_0x1a2e53[_0x2936('0x22')];this[_0x2936('0x23')]=_0x1a2e53['callbackat'];this['recallme']=_0x1a2e53['recallme'];this[_0x2936('0x24')]=_0x1a2e53['ContactId'];this[_0x2936('0x25')]=_0x1a2e53[_0x2936('0x25')];this[_0x2936('0x26')]=_0x1a2e53['UserId'];this[_0x2936('0x27')]=_0x1a2e53[_0x2936('0x27')];this[_0x2936('0x28')]=_0x1a2e53[_0x2936('0x28')];}module[_0x2936('0x29')]=Hangup; \ No newline at end of file +var _0x6697=['UserId','VoiceQueueId','CampaignId','exports','../utils','state','statedesc','scheduledat','type','campaigntype','outbound','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','queue','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x2170e4,_0x5b969e){var _0xec86f5=function(_0x44e53e){while(--_0x44e53e){_0x2170e4['push'](_0x2170e4['shift']());}};_0xec86f5(++_0x5b969e);}(_0x6697,0x10c));var _0x7669=function(_0x3df7b8,_0x55db91){_0x3df7b8=_0x3df7b8-0x0;var _0x16f05d=_0x6697[_0x3df7b8];return _0x16f05d;};'use strict';var moment=require('moment');var utils=require(_0x7669('0x0'));function Hangup(_0x433005,_0x19a4cb){this[_0x7669('0x1')]=0x4;this[_0x7669('0x2')]='Answer';this[_0x7669('0x3')]=_0x433005[_0x7669('0x3')];this['type']=_0x433005[_0x7669('0x4')];this[_0x7669('0x5')]=_0x433005[_0x7669('0x4')]===_0x7669('0x6')?'queue':_0x433005[_0x7669('0x4')];this[_0x7669('0x7')]=_0x433005['amd']||![];this[_0x7669('0x8')]=_0x433005[_0x7669('0x8')];this[_0x7669('0x9')]=_0x433005[_0x7669('0x9')];this[_0x7669('0xa')]=_0x433005[_0x7669('0xa')];this[_0x7669('0xb')]=_0x433005['countbusyretry']+_0x433005[_0x7669('0x9')]+_0x433005[_0x7669('0xa')]+_0x433005[_0x7669('0xc')]+_0x433005[_0x7669('0xd')]+_0x433005[_0x7669('0xe')]+_0x433005[_0x7669('0xf')]+_0x433005['countagentrejectretry'];this[_0x7669('0xc')]=_0x433005[_0x7669('0xc')];this[_0x7669('0xd')]=_0x433005['countdropretry'];this[_0x7669('0xe')]=_0x433005[_0x7669('0xe')];this[_0x7669('0xf')]=_0x433005[_0x7669('0xf')];this[_0x7669('0x10')]=_0x433005[_0x7669('0x10')];this[_0x7669('0x11')]=_0x19a4cb[_0x7669('0x11')];this['calleridname']=_0x433005[_0x7669('0x12')];this[_0x7669('0x13')]=_0x433005[_0x7669('0x14')];this[_0x7669('0x15')]=_0x433005[_0x7669('0x15')];this['responsetime']=_0x433005[_0x7669('0x16')];this[_0x7669('0x17')]=moment()[_0x7669('0x18')](_0x7669('0x19'));this[_0x7669('0x1a')]=utils[_0x7669('0x1b')](_0x433005[_0x7669('0x16')],_0x433005['starttime']);this[_0x7669('0x1c')]=0x0;this[_0x7669('0x1d')]=utils[_0x7669('0x1b')](this[_0x7669('0x17')],_0x433005[_0x7669('0x16')]);this[_0x7669('0x1e')]=_0x433005[_0x7669('0x1e')];this[_0x7669('0x1f')]=_0x7669('0x20');this['reason']=_0x19a4cb[_0x7669('0x21')];this[_0x7669('0x22')]=_0x433005[_0x7669('0x22')];this[_0x7669('0x23')]=_0x433005[_0x7669('0x23')];this[_0x7669('0x24')]=_0x433005[_0x7669('0x24')];this['recallme']=_0x433005[_0x7669('0x25')];this[_0x7669('0x26')]=_0x433005[_0x7669('0x26')];this[_0x7669('0x27')]=_0x433005[_0x7669('0x27')];this[_0x7669('0x28')]=_0x433005['UserId'];this['VoiceQueueId']=_0x433005[_0x7669('0x29')];this[_0x7669('0x2a')]=_0x433005['CampaignId'];}module[_0x7669('0x2b')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 6e2541b..96d7522 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6432=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','countbusyretry'];(function(_0x720f58,_0x51ad3d){var _0x4a7755=function(_0x21db74){while(--_0x21db74){_0x720f58['push'](_0x720f58['shift']());}};_0x4a7755(++_0x51ad3d);}(_0x6432,0x1d8));var _0x2643=function(_0x8a0d92,_0x2d9477){_0x8a0d92=_0x8a0d92-0x0;var _0x4e515e=_0x6432[_0x8a0d92];return _0x4e515e;};'use strict';var utils=require('../utils');function History(_0x53b503){this[_0x2643('0x0')]=_0x53b503[_0x2643('0x0')];this[_0x2643('0x1')]=_0x53b503[_0x2643('0x1')]||undefined;this['type']=_0x53b503[_0x2643('0x2')];this['campaigntype']=_0x53b503[_0x2643('0x2')]==='outbound'?'queue':_0x53b503[_0x2643('0x2')];this['countbusyretry']=_0x53b503[_0x2643('0x3')];this[_0x2643('0x4')]=_0x53b503[_0x2643('0x4')];this[_0x2643('0x5')]=_0x53b503[_0x2643('0x5')];this[_0x2643('0x6')]=_0x53b503[_0x2643('0x3')]+_0x53b503[_0x2643('0x4')]+_0x53b503[_0x2643('0x5')]+_0x53b503[_0x2643('0x7')]+_0x53b503[_0x2643('0x8')]+_0x53b503[_0x2643('0x9')]+_0x53b503[_0x2643('0xa')]+_0x53b503[_0x2643('0xb')];this[_0x2643('0x7')]=_0x53b503[_0x2643('0x7')];this[_0x2643('0x8')]=_0x53b503[_0x2643('0x8')];this['countabandonedretry']=_0x53b503[_0x2643('0x9')];this['countmachineretry']=_0x53b503[_0x2643('0xa')];this[_0x2643('0xb')]=_0x53b503[_0x2643('0xb')];this[_0x2643('0xc')]=_0x53b503['queue'];this[_0x2643('0xd')]=_0x53b503['name'];this['calleridnum']=_0x53b503[_0x2643('0xe')];this[_0x2643('0xf')]=_0x53b503['starttime'];this[_0x2643('0x10')]=_0x53b503[_0x2643('0x10')];this[_0x2643('0x11')]=_0x53b503[_0x2643('0x10')];this[_0x2643('0x12')]=utils[_0x2643('0x13')](_0x53b503['responsetime'],_0x53b503[_0x2643('0xf')]);this[_0x2643('0x14')]=0x0;this[_0x2643('0x15')]=0x0;this[_0x2643('0x16')]=_0x53b503[_0x2643('0x16')];this[_0x2643('0x17')]=_0x53b503[_0x2643('0x17')];this['callbackat']=_0x53b503['callbackat'];this[_0x2643('0x18')]=_0x53b503[_0x2643('0x18')];this[_0x2643('0x19')]=_0x53b503['ContactId'];this[_0x2643('0x1a')]=_0x53b503['ListId'];this[_0x2643('0x1b')]=_0x53b503[_0x2643('0x1b')];this['VoiceQueueId']=_0x53b503[_0x2643('0x1c')];this[_0x2643('0x1d')]=_0x53b503[_0x2643('0x1d')];this[_0x2643('0x1e')]=_0x53b503['originatecalleridnum']||'';this[_0x2643('0x1f')]=_0x53b503[_0x2643('0x1f')]||'';this[_0x2643('0x20')]=_0x53b503[_0x2643('0x20')];this[_0x2643('0x21')]=_0x53b503[_0x2643('0x21')];}module['exports']=History; \ No newline at end of file +var _0xce8d=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','starttime','endtime','responsetime','getSeconds','holdtime'];(function(_0xe406bc,_0x45e9af){var _0x56cbd4=function(_0x29f11a){while(--_0x29f11a){_0xe406bc['push'](_0xe406bc['shift']());}};_0x56cbd4(++_0x45e9af);}(_0xce8d,0x7e));var _0xdce8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce8d[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0xdce8('0x0'));function History(_0x39b551){this[_0xdce8('0x1')]=_0x39b551[_0xdce8('0x1')];this['scheduledat']=_0x39b551[_0xdce8('0x2')]||undefined;this[_0xdce8('0x3')]=_0x39b551['type'];this[_0xdce8('0x4')]=_0x39b551['type']===_0xdce8('0x5')?_0xdce8('0x6'):_0x39b551[_0xdce8('0x3')];this['countbusyretry']=_0x39b551[_0xdce8('0x7')];this[_0xdce8('0x8')]=_0x39b551[_0xdce8('0x8')];this[_0xdce8('0x9')]=_0x39b551['countnoanswerretry'];this[_0xdce8('0xa')]=_0x39b551[_0xdce8('0x7')]+_0x39b551['countcongestionretry']+_0x39b551['countnoanswerretry']+_0x39b551[_0xdce8('0xb')]+_0x39b551[_0xdce8('0xc')]+_0x39b551[_0xdce8('0xd')]+_0x39b551[_0xdce8('0xe')]+_0x39b551[_0xdce8('0xf')];this[_0xdce8('0xb')]=_0x39b551['countnosuchnumberretry'];this[_0xdce8('0xc')]=_0x39b551[_0xdce8('0xc')];this['countabandonedretry']=_0x39b551[_0xdce8('0xd')];this[_0xdce8('0xe')]=_0x39b551['countmachineretry'];this[_0xdce8('0xf')]=_0x39b551[_0xdce8('0xf')];this['queue']=_0x39b551[_0xdce8('0x6')];this['calleridname']=_0x39b551[_0xdce8('0x10')];this['calleridnum']=_0x39b551['number'];this[_0xdce8('0x11')]=_0x39b551[_0xdce8('0x11')];this['responsetime']=_0x39b551['responsetime'];this[_0xdce8('0x12')]=_0x39b551[_0xdce8('0x13')];this['ringtime']=utils[_0xdce8('0x14')](_0x39b551[_0xdce8('0x13')],_0x39b551[_0xdce8('0x11')]);this[_0xdce8('0x15')]=0x0;this[_0xdce8('0x16')]=0x0;this['callback']=_0x39b551[_0xdce8('0x17')];this['callbackuniqueid']=_0x39b551[_0xdce8('0x18')];this[_0xdce8('0x19')]=_0x39b551['callbackat'];this[_0xdce8('0x1a')]=_0x39b551[_0xdce8('0x1a')];this[_0xdce8('0x1b')]=_0x39b551['ContactId'];this[_0xdce8('0x1c')]=_0x39b551[_0xdce8('0x1c')];this[_0xdce8('0x1d')]=_0x39b551[_0xdce8('0x1d')];this[_0xdce8('0x1e')]=_0x39b551[_0xdce8('0x1e')];this['CampaignId']=_0x39b551[_0xdce8('0x1f')];this[_0xdce8('0x20')]=_0x39b551[_0xdce8('0x20')]||'';this[_0xdce8('0x21')]=_0x39b551[_0xdce8('0x21')]||'';this[_0xdce8('0x22')]=_0x39b551[_0xdce8('0x22')];this[_0xdce8('0x23')]=_0x39b551[_0xdce8('0x23')];}module[_0xdce8('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 1966d86..062f64f 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x749c=['countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','../utils','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x451c21,_0x5db01d){var _0x31f101=function(_0x219242){while(--_0x219242){_0x451c21['push'](_0x451c21['shift']());}};_0x31f101(++_0x5db01d);}(_0x749c,0xc6));var _0xc749=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x749c[_0x5d80de];return _0x1c7556;};'use strict';var utils=require(_0xc749('0x0'));function QueueCallerAbandon(_0x28924d,_0x289447){this[_0xc749('0x1')]=_0x28924d[_0xc749('0x1')];this[_0xc749('0x2')]=_0x28924d[_0xc749('0x2')];this['campaigntype']=_0x28924d[_0xc749('0x2')]===_0xc749('0x3')?_0xc749('0x4'):_0x28924d['type'];this[_0xc749('0x5')]=_0x28924d[_0xc749('0x5')];this['countcongestionretry']=_0x28924d[_0xc749('0x6')];this[_0xc749('0x7')]=_0x28924d[_0xc749('0x7')];this['countglobal']=_0x28924d[_0xc749('0x5')]+_0x28924d[_0xc749('0x6')]+_0x28924d[_0xc749('0x7')]+_0x28924d[_0xc749('0x8')]+_0x28924d[_0xc749('0x9')]+_0x28924d[_0xc749('0xa')]+_0x28924d[_0xc749('0xb')]+_0x28924d[_0xc749('0xc')];this['countnosuchnumberretry']=_0x28924d[_0xc749('0x8')];this[_0xc749('0x9')]=_0x28924d[_0xc749('0x9')];this[_0xc749('0xa')]=_0x28924d[_0xc749('0xa')];this[_0xc749('0xb')]=_0x28924d[_0xc749('0xb')];this[_0xc749('0xc')]=_0x28924d['countagentrejectretry'];this[_0xc749('0xd')]=_0x289447[_0xc749('0xd')];this[_0xc749('0xe')]=_0x28924d[_0xc749('0xf')];this[_0xc749('0x10')]=_0x28924d[_0xc749('0x11')];this[_0xc749('0x12')]=_0x28924d[_0xc749('0x12')];this['responsetime']=_0x28924d[_0xc749('0x13')];this[_0xc749('0x14')]=_0x28924d[_0xc749('0x14')];this['dropreason']=_0x28924d[_0xc749('0x15')];this[_0xc749('0x16')]=this[_0xc749('0x14')];this['ringtime']=utils[_0xc749('0x17')](_0x28924d['responsetime'],_0x28924d[_0xc749('0x12')]);this[_0xc749('0x18')]=utils['getSeconds'](this[_0xc749('0x14')],_0x28924d['responsetime']);this[_0xc749('0x19')]=0x0;this[_0xc749('0x4')]=_0x289447['queue'];this[_0xc749('0x1a')]=_0x289447['connectedlinename'];this[_0xc749('0x1b')]=_0x289447[_0xc749('0x1b')];this[_0xc749('0x1c')]=_0x28924d['callback'];this[_0xc749('0x1d')]=_0x28924d[_0xc749('0x1d')];this[_0xc749('0x1e')]=_0x28924d['callbackat'];this[_0xc749('0x1f')]=_0x28924d[_0xc749('0x1f')];this[_0xc749('0x20')]=_0x28924d[_0xc749('0x20')];this[_0xc749('0x21')]=_0x28924d[_0xc749('0x21')];this[_0xc749('0x22')]=_0x28924d[_0xc749('0x22')];this[_0xc749('0x23')]=_0x28924d['VoiceQueueId'];this[_0xc749('0x24')]=_0x28924d[_0xc749('0x24')];this[_0xc749('0x25')]=_0x28924d[_0xc749('0x25')]||'';this[_0xc749('0x26')]=_0x28924d['originatecalleridname']||'';this[_0xc749('0x27')]=_0x28924d[_0xc749('0x27')];this['state']=_0x28924d[_0xc749('0x28')];this[_0xc749('0x29')]=_0x28924d[_0xc749('0x29')];}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xe72f=['responsetime','droptime','dropreason','endtime','ringtime','getSeconds','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime'];(function(_0x124f88,_0x3ad501){var _0xed0e3b=function(_0x43a67d){while(--_0x43a67d){_0x124f88['push'](_0x124f88['shift']());}};_0xed0e3b(++_0x3ad501);}(_0xe72f,0x191));var _0xfe72=function(_0x25def1,_0x283b4b){_0x25def1=_0x25def1-0x0;var _0x4c26d5=_0xe72f[_0x25def1];return _0x4c26d5;};'use strict';var utils=require(_0xfe72('0x0'));function QueueCallerAbandon(_0x2cf537,_0x2674bd){this[_0xfe72('0x1')]=_0x2cf537[_0xfe72('0x1')];this[_0xfe72('0x2')]=_0x2cf537[_0xfe72('0x2')];this[_0xfe72('0x3')]=_0x2cf537[_0xfe72('0x2')]==='outbound'?_0xfe72('0x4'):_0x2cf537['type'];this[_0xfe72('0x5')]=_0x2cf537['countbusyretry'];this[_0xfe72('0x6')]=_0x2cf537[_0xfe72('0x6')];this[_0xfe72('0x7')]=_0x2cf537[_0xfe72('0x7')];this[_0xfe72('0x8')]=_0x2cf537['countbusyretry']+_0x2cf537['countcongestionretry']+_0x2cf537[_0xfe72('0x7')]+_0x2cf537[_0xfe72('0x9')]+_0x2cf537[_0xfe72('0xa')]+_0x2cf537[_0xfe72('0xb')]+_0x2cf537[_0xfe72('0xc')]+_0x2cf537[_0xfe72('0xd')];this[_0xfe72('0x9')]=_0x2cf537[_0xfe72('0x9')];this[_0xfe72('0xa')]=_0x2cf537[_0xfe72('0xa')];this[_0xfe72('0xb')]=_0x2cf537['countabandonedretry'];this[_0xfe72('0xc')]=_0x2cf537[_0xfe72('0xc')];this['countagentrejectretry']=_0x2cf537[_0xfe72('0xd')];this[_0xfe72('0xe')]=_0x2674bd['uniqueid'];this[_0xfe72('0xf')]=_0x2cf537[_0xfe72('0x10')];this['calleridnum']=_0x2cf537[_0xfe72('0x11')];this['starttime']=_0x2cf537[_0xfe72('0x12')];this[_0xfe72('0x13')]=_0x2cf537[_0xfe72('0x13')];this['droptime']=_0x2cf537[_0xfe72('0x14')];this['dropreason']=_0x2cf537[_0xfe72('0x15')];this[_0xfe72('0x16')]=this['droptime'];this[_0xfe72('0x17')]=utils[_0xfe72('0x18')](_0x2cf537['responsetime'],_0x2cf537['starttime']);this['holdtime']=utils['getSeconds'](this['droptime'],_0x2cf537[_0xfe72('0x13')]);this['talktime']=0x0;this[_0xfe72('0x4')]=_0x2674bd['queue'];this[_0xfe72('0x19')]=_0x2674bd[_0xfe72('0x1a')];this[_0xfe72('0x1b')]=_0x2674bd['reason'];this['callback']=_0x2cf537['callback'];this[_0xfe72('0x1c')]=_0x2cf537[_0xfe72('0x1c')];this[_0xfe72('0x1d')]=_0x2cf537[_0xfe72('0x1d')];this[_0xfe72('0x1e')]=_0x2cf537[_0xfe72('0x1e')];this[_0xfe72('0x1f')]=_0x2cf537['ContactId'];this[_0xfe72('0x20')]=_0x2cf537[_0xfe72('0x20')];this[_0xfe72('0x21')]=_0x2cf537['UserId'];this[_0xfe72('0x22')]=_0x2cf537['VoiceQueueId'];this['CampaignId']=_0x2cf537[_0xfe72('0x23')];this['originatecalleridnum']=_0x2cf537[_0xfe72('0x24')]||'';this[_0xfe72('0x25')]=_0x2cf537[_0xfe72('0x25')]||'';this[_0xfe72('0x26')]=_0x2cf537[_0xfe72('0x26')];this[_0xfe72('0x27')]=_0x2cf537[_0xfe72('0x27')];this['statedesc']=_0x2cf537[_0xfe72('0x28')];}module[_0xfe72('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index b96cd88..832e116 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6050=['getContactDialer','catch','temp','[getContactDialerIvr]','getContactDialerIvr','countReScheduled','[countReScheduled]','rescheduleContact','[unlockContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','inspect','dialOrderByScheduledAt','error','[getContactDialer]'];(function(_0x142d3e,_0x353e86){var _0x493084=function(_0x14aa15){while(--_0x14aa15){_0x142d3e['push'](_0x142d3e['shift']());}};_0x493084(++_0x353e86);}(_0x6050,0x196));var _0x0605=function(_0x3c05d8,_0x35ae53){_0x3c05d8=_0x3c05d8-0x0;var _0x189e51=_0x6050[_0x3c05d8];return _0x189e51;};'use strict';var util=require(_0x0605('0x0'));var logger=require(_0x0605('0x1'))(_0x0605('0x2'));var cmHopper=require(_0x0605('0x3'));var cmHopperAdditionalPhone=require(_0x0605('0x4'));var cmHopperBlack=require(_0x0605('0x5'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x22d595){return util[_0x0605('0x6')](_0x22d595,{'showHidden':![],'depth':null});}function getContactDialer(_0x43403d,_0x5797b0,_0x533b6d){return cmHopper['getContactDialer'](_0x43403d['id'],_0x5797b0,_0x533b6d,_0x43403d[_0x0605('0x7')])['catch'](function(_0x58f7d2){_0x43403d['temp']=0x0;logger[_0x0605('0x8')](_0x0605('0x9'),inspectError(_0x58f7d2));});}exports[_0x0605('0xa')]=getContactDialer;function getContactDialerIvr(_0x5bb96,_0x44fdd3){return cmHopper['getContactDialerIvr'](_0x5bb96['id'],_0x44fdd3,_0x5bb96[_0x0605('0x7')])[_0x0605('0xb')](function(_0xe54b22){_0x5bb96[_0x0605('0xc')]=0x0;logger[_0x0605('0x8')](_0x0605('0xd'),inspectError(_0xe54b22));});}exports[_0x0605('0xe')]=getContactDialerIvr;function countReScheduled(_0x4af103){return cmHopper[_0x0605('0xf')](_0x4af103)[_0x0605('0xb')](function(_0xd22e35){logger[_0x0605('0x8')](_0x0605('0x10'),inspectError(_0xd22e35));});}exports[_0x0605('0xf')]=countReScheduled;function rescheduleContact(_0x22c011){return cmHopper[_0x0605('0x11')](_0x22c011)[_0x0605('0xb')](function(_0x65a20b){logger[_0x0605('0x8')]('[rescheduleContact]',inspectError(_0x65a20b));});}exports[_0x0605('0x11')]=rescheduleContact;function unlockContact(_0x1a802b,_0x4993ab,_0x5ce56a){return cmHopper['unlockContact'](_0x1a802b,_0x4993ab,_0x5ce56a)[_0x0605('0xb')](function(_0xd0996d){logger[_0x0605('0x8')](_0x0605('0x12'),inspectError(_0xd0996d));});}exports[_0x0605('0x13')]=unlockContact;function moveContactManagedDialer(_0x351dbd){return cmHopper[_0x0605('0x14')](_0x351dbd)[_0x0605('0xb')](function(_0x193520){logger[_0x0605('0x8')](_0x0605('0x15'),inspectError(_0x193520));});}exports[_0x0605('0x14')]=moveContactManagedDialer;function checkIsBlackList(_0x2e2204){return cmHopperBlack[_0x0605('0x16')](_0x2e2204)['catch'](function(_0x254020){logger[_0x0605('0x8')](_0x0605('0x17'),inspectError(_0x254020));});}exports[_0x0605('0x16')]=checkIsBlackList;function checkIsBlackListIvr(_0x1e8c6d){return cmHopperBlack[_0x0605('0x18')](_0x1e8c6d)[_0x0605('0xb')](function(_0x2c90ed){logger[_0x0605('0x8')]('[checkIsBlackListIvr]',inspectError(_0x2c90ed));});}exports[_0x0605('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x4fe293,_0x3efc38,_0x118e9c){return cmHopperAdditionalPhone[_0x0605('0x19')](_0x4fe293,_0x3efc38,_0x118e9c)[_0x0605('0xb')](function(_0x10c575){logger[_0x0605('0x8')](_0x0605('0x1a'),inspectError(_0x10c575));});}exports[_0x0605('0x19')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x234231,_0x2896d7,_0x9f2833){return cmHopperAdditionalPhone[_0x0605('0x1b')](_0x234231,_0x2896d7,_0x9f2833)['catch'](function(_0x6bc204){logger[_0x0605('0x8')]('[swapAdditionalPhone]',inspectError(_0x6bc204));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x55ebd8){return cmHopperHistory[_0x0605('0x1c')](_0x55ebd8)[_0x0605('0xb')](function(_0x4163cd){logger[_0x0605('0x8')](_0x0605('0x1d'),inspectError(_0x4163cd));});}exports[_0x0605('0x1c')]=avgHandleTime;function createHistory(_0x4e32ef){return cmHopperHistory[_0x0605('0x1e')](_0x4e32ef)['catch'](function(_0xa836f2){logger[_0x0605('0x8')](_0x0605('0x1f'),inspectError(_0xa836f2));});}exports[_0x0605('0x1e')]=createHistory; \ No newline at end of file +var _0xffd6=['[getContactDialerIvr]','getContactDialerIvr','countReScheduled','[countReScheduled]','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','checkIsBlackList','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','[swapAdditionalPhone]','avgHandleTime','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','getContactDialer','catch','temp','error','[getContactDialer]','dialOrderByScheduledAt'];(function(_0x15369e,_0x3a1a71){var _0x5367ee=function(_0xfd58ba){while(--_0xfd58ba){_0x15369e['push'](_0x15369e['shift']());}};_0x5367ee(++_0x3a1a71);}(_0xffd6,0x97));var _0x6ffd=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0xffd6[_0x296923];return _0x29af70;};'use strict';var util=require(_0x6ffd('0x0'));var logger=require(_0x6ffd('0x1'))(_0x6ffd('0x2'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x6ffd('0x3'));var cmHopperHistory=require(_0x6ffd('0x4'));function inspectError(_0x39fd49){return util['inspect'](_0x39fd49,{'showHidden':![],'depth':null});}function getContactDialer(_0x1d12e3,_0x173979,_0x3b8a46){return cmHopper[_0x6ffd('0x5')](_0x1d12e3['id'],_0x173979,_0x3b8a46,_0x1d12e3['dialOrderByScheduledAt'])[_0x6ffd('0x6')](function(_0xeefe34){_0x1d12e3[_0x6ffd('0x7')]=0x0;logger[_0x6ffd('0x8')](_0x6ffd('0x9'),inspectError(_0xeefe34));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x455dda,_0x417f34){return cmHopper['getContactDialerIvr'](_0x455dda['id'],_0x417f34,_0x455dda[_0x6ffd('0xa')])[_0x6ffd('0x6')](function(_0x23f7f2){_0x455dda[_0x6ffd('0x7')]=0x0;logger[_0x6ffd('0x8')](_0x6ffd('0xb'),inspectError(_0x23f7f2));});}exports[_0x6ffd('0xc')]=getContactDialerIvr;function countReScheduled(_0x5892e1){return cmHopper[_0x6ffd('0xd')](_0x5892e1)[_0x6ffd('0x6')](function(_0x5e8d6d){logger[_0x6ffd('0x8')](_0x6ffd('0xe'),inspectError(_0x5e8d6d));});}exports[_0x6ffd('0xd')]=countReScheduled;function rescheduleContact(_0x1a00d9){return cmHopper['rescheduleContact'](_0x1a00d9)[_0x6ffd('0x6')](function(_0x594cb3){logger[_0x6ffd('0x8')]('[rescheduleContact]',inspectError(_0x594cb3));});}exports[_0x6ffd('0xf')]=rescheduleContact;function unlockContact(_0x261ed7,_0x45db49,_0x5d8aff){return cmHopper[_0x6ffd('0x10')](_0x261ed7,_0x45db49,_0x5d8aff)[_0x6ffd('0x6')](function(_0x350c94){logger[_0x6ffd('0x8')](_0x6ffd('0x11'),inspectError(_0x350c94));});}exports[_0x6ffd('0x10')]=unlockContact;function moveContactManagedDialer(_0x3f38e7){return cmHopper[_0x6ffd('0x12')](_0x3f38e7)['catch'](function(_0x11a609){logger['error']('[moveContactManagedDialer]',inspectError(_0x11a609));});}exports[_0x6ffd('0x12')]=moveContactManagedDialer;function checkIsBlackList(_0x359d09){return cmHopperBlack['checkIsBlackList'](_0x359d09)[_0x6ffd('0x6')](function(_0x4612a3){logger['error']('[checkIsBlackList]',inspectError(_0x4612a3));});}exports[_0x6ffd('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x1c9d19){return cmHopperBlack['checkIsBlackListIvr'](_0x1c9d19)[_0x6ffd('0x6')](function(_0x39f25c){logger[_0x6ffd('0x8')]('[checkIsBlackListIvr]',inspectError(_0x39f25c));});}exports[_0x6ffd('0x14')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x2efeb5,_0x50896b,_0x356c9c){return cmHopperAdditionalPhone[_0x6ffd('0x15')](_0x2efeb5,_0x50896b,_0x356c9c)['catch'](function(_0x31fb22){logger[_0x6ffd('0x8')](_0x6ffd('0x16'),inspectError(_0x31fb22));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x46631e,_0x3e5726,_0x46b03f){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x46631e,_0x3e5726,_0x46b03f)[_0x6ffd('0x6')](function(_0x5a55e2){logger[_0x6ffd('0x8')](_0x6ffd('0x17'),inspectError(_0x5a55e2));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x520258){return cmHopperHistory[_0x6ffd('0x18')](_0x520258)[_0x6ffd('0x6')](function(_0x1934d4){logger['error']('[avgHandleTime]',inspectError(_0x1934d4));});}exports[_0x6ffd('0x18')]=avgHandleTime;function createHistory(_0x48feb4){return cmHopperHistory[_0x6ffd('0x19')](_0x48feb4)[_0x6ffd('0x6')](function(_0x51fdb6){logger[_0x6ffd('0x8')](_0x6ffd('0x1a'),inspectError(_0x51fdb6));});}exports[_0x6ffd('0x19')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 754eed0..a7360d5 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7743=['getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','\x22%s\x22\x20<%s>','format','getCallerId','pow','replace','getCallerIdRandom','error','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','tags','updatedAt','undefined','%s%s','XMD-','setXMDContactVariables','lodash','util','../../../../config/logger','dialer','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','CAMPAIGN_STATUS','preview','type','ivr','isIVRCampaign','outbound','dialActive','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','dialMethod','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','active','dialGlobalInterval','isNil','Interval','Intervals','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','name','status','TrunkBackup','includes','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage'];(function(_0x155cd2,_0x94dd79){var _0x4cab3c=function(_0x2fac27){while(--_0x2fac27){_0x155cd2['push'](_0x155cd2['shift']());}};_0x4cab3c(++_0x94dd79);}(_0x7743,0x175));var _0x3774=function(_0x5e0cf5,_0x2f19e9){_0x5e0cf5=_0x5e0cf5-0x0;var _0x3ed110=_0x7743[_0x5e0cf5];return _0x3ed110;};'use strict';var _=require(_0x3774('0x0'));var moment=require('moment');var util=require(_0x3774('0x1'));var logger=require(_0x3774('0x2'))(_0x3774('0x3'));var timezones=require('../../../../config/environment/shared')[_0x3774('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0x3774('0x5'),'BLACKLIST':_0x3774('0x6'),'CONTACTS_RESCHEDULED':_0x3774('0x7'),'DEACTIVATED':_0x3774('0x8'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0x3774('0x9'),'INACTIVE':_0x3774('0xa'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x3774('0xb'),'NULL_INTERVAL':_0x3774('0xc'),'OVERTIME_INTERVAL':_0x3774('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0x3774('0xe'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x3774('0xf'),'RUNNING':_0x3774('0x10'),'UNKNOWN_TIMEZONE':_0x3774('0x11'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0x3774('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x315e6){return _0x315e6['dialMethod']===_0x3774('0x13');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x445532){return _0x445532[_0x3774('0x14')]===_0x3774('0x15');}exports[_0x3774('0x16')]=isIVRCampaign;function isOutboundQueue(_0x17f075){return _0x17f075[_0x3774('0x14')]===_0x3774('0x17');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x4e9f0a){return _0x4e9f0a[_0x3774('0x18')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x52cff8){return _0x52cff8['active'];}exports[_0x3774('0x19')]=isIVRCampaignActive;function getSeconds(_0x1346c6,_0x25fed1){var _0x5b2683=moment(_0x1346c6)[_0x3774('0x1a')](0x0);var _0x4b361d=moment(_0x25fed1)[_0x3774('0x1a')](0x0);return _0x5b2683[_0x3774('0x1b')](_0x4b361d,_0x3774('0x1c'));}exports[_0x3774('0x1d')]=getSeconds;function hasQueueCampaignDataChanged(_0x2e455c,_0x3f65c4){var _0x1c285d=![];var _0x121158=_0x2e455c[_0x3774('0x1e')]!==_0x3f65c4[_0x3774('0x1e')]||_0x2e455c[_0x3774('0x18')]!==_0x3f65c4['dialActive']||_0x2e455c[_0x3774('0x1f')]!==_0x3f65c4[_0x3774('0x1f')];var _0x1484e5=_0x2e455c['available']!==_0x3f65c4[_0x3774('0x20')]||_0x2e455c[_0x3774('0x21')]!==_0x3f65c4[_0x3774('0x21')]||_0x2e455c[_0x3774('0x22')]!==_0x3f65c4['loggedInDb']||_0x2e455c[_0x3774('0x23')]!==_0x3f65c4['paused']||_0x2e455c[_0x3774('0x24')]!==_0x3f65c4[_0x3774('0x24')]||_0x2e455c[_0x3774('0x25')]!==_0x3f65c4[_0x3774('0x25')]||_0x2e455c[_0x3774('0x26')]!==_0x3f65c4['waiting']||_0x2e455c[_0x3774('0x27')]!==_0x3f65c4[_0x3774('0x27')]||_0x2e455c['originated']!==_0x3f65c4[_0x3774('0x28')];if(_0x2e455c[_0x3774('0x29')]&&_0x3f65c4[_0x3774('0x29')]){_0x1c285d=_0x2e455c[_0x3774('0x29')]['name']!==_0x3f65c4['Trunk']['name']||_0x2e455c[_0x3774('0x29')][_0x3774('0x2a')]!==_0x3f65c4[_0x3774('0x29')][_0x3774('0x2a')];}return _0x121158||_0x1484e5||_0x1c285d;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x5cfec5){var _0x1e92d9=null;var _0x298201=_0x5cfec5['dialTimezone'];if(_['isNil'](_0x5cfec5[_0x3774('0x2b')])||_[_0x3774('0x2c')](_0x5cfec5[_0x3774('0x2d')])||_['isNil'](_0x5cfec5[_0x3774('0x2d')][_0x3774('0x2e')])){_0x1e92d9=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0x3774('0x2f')](_0x5cfec5[_0x3774('0x2b')])||_[_0x3774('0x2f')](_0x5cfec5[_0x3774('0x2d')][_0x3774('0x2e')])){_0x1e92d9=CAMPAIGN_STATUS[_0x3774('0x30')];}else if(_0x298201&&!timezones[_0x298201]){_0x1e92d9=CAMPAIGN_STATUS[_0x3774('0x31')];}return _0x1e92d9;}function checkAnyValidTrunk(_0x1a04a3,_0x5f3a46){var _0x4a85d2=null;var _0x22171a=_0x3774('0x32');var _0x57fdb4=[_0x3774('0x33'),_0x3774('0x34')];var _0x1e36ac=!![];if(_0x1a04a3[_0x3774('0x29')]&&_0x1a04a3[_0x3774('0x29')][_0x3774('0x2a')]){_0x22171a+=_0x1a04a3[_0x3774('0x29')][_0x3774('0x35')];_0x4a85d2=_0x5f3a46[_0x22171a];_0x1e36ac=_0x57fdb4['includes'](_0x4a85d2[_0x3774('0x36')]);}else if(_0x1a04a3[_0x3774('0x37')]&&_0x1a04a3[_0x3774('0x37')][_0x3774('0x2a')]){_0x22171a+=_0x1a04a3['TrunkBackup']['name'];_0x4a85d2=_0x5f3a46[_0x22171a];_0x1e36ac=_0x57fdb4[_0x3774('0x38')](_0x4a85d2['status']);}return _0x1e36ac;}function getQueueCampaignStatusMessage(_0x18866d,_0xc26ea6){var _0x20fb22=CAMPAIGN_STATUS[_0x3774('0x5')];var _0x309488=isPreviewCampaign(_0x18866d);if(!isQueueCampaignActive(_0x18866d)){if(_0x309488){_0x20fb22=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x18866d[_0x3774('0x28')]===0x0&&_0x18866d['talking']===0x0&&_0x18866d[_0x3774('0x26')]===0x0&&(_0x18866d[_0x3774('0x25')]||0x0)===0x0){_0x20fb22=CAMPAIGN_STATUS[_0x3774('0x39')];}else{_0x20fb22=CAMPAIGN_STATUS[_0x3774('0x3a')];}}}else if(_0x18866d[_0x3774('0x21')]===0x0){_0x20fb22=CAMPAIGN_STATUS[_0x3774('0x3b')];}else if(!checkAnyValidTrunk(_0x18866d,_0xc26ea6)){_0x20fb22=CAMPAIGN_STATUS[_0x3774('0x3c')];}else if(!isPreviewCampaign(_0x18866d)){var _0x399237=checkAnyValidQueueCampaignInterval(_0x18866d);if(_0x399237){_0x20fb22=_0x399237;}}return _0x20fb22;}exports[_0x3774('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x3ccbbc){var _0x2e1b53=CAMPAIGN_STATUS[_0x3774('0x3a')];if(_0x3ccbbc[_0x3774('0x28')]===0x0&&_0x3ccbbc['talking']===0x0&&_0x3ccbbc[_0x3774('0x26')]===0x0&&(_0x3ccbbc[_0x3774('0x25')]||0x0)===0x0){_0x2e1b53=CAMPAIGN_STATUS[_0x3774('0x39')];}return _0x2e1b53;}exports[_0x3774('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x35814f){var _0x5e29ed=_0x35814f[_0x3774('0x3f')](/"(.*?)"/);return _0x5e29ed?_0x5e29ed[0x1]:_0x35814f;}exports[_0x3774('0x40')]=extractCalleridName;function getCallerId(_0x5326c7,_0xd0590d,_0x4c3988){if(!_[_0x3774('0x41')](_0x4c3988)&&typeof _0x4c3988===_0x3774('0x42')&&!_[_0x3774('0x2f')](_0x4c3988)){if(!_['isUndefined'](_0xd0590d)&&typeof _0xd0590d===_0x3774('0x42')&&!_['isEmpty'](_0xd0590d)){return util['format'](_0x3774('0x43'),_0xd0590d,_0x4c3988);}return util[_0x3774('0x44')](_0x3774('0x43'),_0x4c3988,_0x4c3988);}if(!_['isUndefined'](_0x5326c7)&&typeof _0x5326c7===_0x3774('0x42')&&!_[_0x3774('0x2f')](_0x5326c7)){return _0x5326c7;}return'\x22\x22\x20<>';}exports[_0x3774('0x45')]=getCallerId;function getCallerIdRandom(_0x2e92bb,_0x5018e6){var _0x9a3604;var _0x384cb7;var _0x28c1fc;if(_0x5018e6<=0x0){_0x5018e6=0x1;}_0x9a3604=new RegExp('\x5cw{0,'+_0x5018e6+'}$');_0x384cb7=Math['pow'](0xa,_0x5018e6-0x1);_0x28c1fc=Math[_0x3774('0x46')](0xa,_0x5018e6)-0x1;return util[_0x3774('0x44')]('%s',_[_0x3774('0x47')](_0x2e92bb,_0x9a3604,_['random'](_0x384cb7,_0x28c1fc)['toString']()));}exports[_0x3774('0x48')]=getCallerIdRandom;function decrementOriginate(_0x5939ca){if(_0x5939ca[_0x3774('0x28')]&&_0x5939ca[_0x3774('0x28')]>0x0){_0x5939ca[_0x3774('0x28')]-=0x1;}else{logger[_0x3774('0x49')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0x3774('0x4a')]=decrementOriginate;function checkContactEmpty(_0x1adc00){return _0x1adc00&&_0x1adc00[_0x3774('0x4b')]>0x0;}exports[_0x3774('0x4c')]=checkContactEmpty;function erlangb(_0x5ae119,_0x3d5415){if(_0x3d5415===0x0){return 0x0;}var _0x447412=0x1;for(var _0x139b4f=0x1;_0x139b4f<=_0x3d5415;_0x139b4f+=0x1){_0x447412=0x1+_0x447412*_0x139b4f/_0x5ae119;}return 0x1/_0x447412;}exports[_0x3774('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x27a5ab,_0x3b6d16,_0x4db547){if(_0x3b6d16>_0x4db547){for(var _0x498c90=0x0;_0x498c90<_0x3b6d16-_0x4db547;_0x498c90+=0x1){decrementOriginate(_0x27a5ab);}}}exports[_0x3774('0x4e')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x30155c){var _0xef41c7={};var _0x6aa443=['id',_0x3774('0x4f'),_0x3774('0x50'),_0x3774('0x51'),_0x3774('0x52')];if(_0x30155c){for(var _0x11f394 in _0x30155c){if(typeof _0x30155c[_0x11f394]!==_0x3774('0x53')){if(!_['isNil'](_0x30155c[_0x11f394])&&!_0x6aa443[_0x3774('0x38')](_0x11f394)){_0xef41c7[util['format'](_0x3774('0x54'),_0x3774('0x55'),_0x11f394['toUpperCase']())]=_0x30155c[_0x11f394];}}}}return _0xef41c7;}exports[_0x3774('0x56')]=setXMDContactVariables; \ No newline at end of file +var _0x5bff=['string','format','\x22%s\x22\x20<%s>','getCallerId','pow','replace','random','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','tags','undefined','%s%s','XMD-','toUpperCase','setXMDContactVariables','lodash','moment','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','ivr','isIVRCampaign','type','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','Intervals','isEmpty','EMPTY_INTERVAL','reachable','includes','status','TrunkBackup','INACTIVE','DISACTIVED','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','isUndefined'];(function(_0x2ddb09,_0xe3a959){var _0x4b8417=function(_0x10592c){while(--_0x10592c){_0x2ddb09['push'](_0x2ddb09['shift']());}};_0x4b8417(++_0xe3a959);}(_0x5bff,0x6d));var _0xf5bf=function(_0x4d2e0c,_0x1bdedd){_0x4d2e0c=_0x4d2e0c-0x0;var _0x1c446c=_0x5bff[_0x4d2e0c];return _0x1c446c;};'use strict';var _=require(_0xf5bf('0x0'));var moment=require(_0xf5bf('0x1'));var util=require('util');var logger=require(_0xf5bf('0x2'))(_0xf5bf('0x3'));var timezones=require(_0xf5bf('0x4'))[_0xf5bf('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0xf5bf('0x6'),'BLACKLIST':_0xf5bf('0x7'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':'DEACTIVATED','DISACTIVED':_0xf5bf('0x8'),'EMPTY_INTERVAL':_0xf5bf('0x9'),'INACTIVE':_0xf5bf('0xa'),'NO_AGENTS_LOGGED':_0xf5bf('0xb'),'NO_AVAILABLE_CONTACTS':_0xf5bf('0xc'),'NULL_INTERVAL':_0xf5bf('0xd'),'OVERTIME_INTERVAL':_0xf5bf('0xe'),'OVERTIME_GLOBAL_INTERVAL':_0xf5bf('0xf'),'QUEUE_RECALL':_0xf5bf('0x10'),'RECALL_TIMEOUT':_0xf5bf('0x11'),'RUNNING':_0xf5bf('0x12'),'UNKNOWN_TIMEZONE':_0xf5bf('0x13'),'UNREACHABLE_TRUNK':_0xf5bf('0x14')};exports[_0xf5bf('0x15')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x3f689e){return _0x3f689e[_0xf5bf('0x16')]===_0xf5bf('0x17');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0xde3a96){return _0xde3a96['type']===_0xf5bf('0x18');}exports[_0xf5bf('0x19')]=isIVRCampaign;function isOutboundQueue(_0xec47e0){return _0xec47e0[_0xf5bf('0x1a')]==='outbound';}exports[_0xf5bf('0x1b')]=isOutboundQueue;function isQueueCampaignActive(_0x5cccd5){return _0x5cccd5[_0xf5bf('0x1c')];}exports[_0xf5bf('0x1d')]=isQueueCampaignActive;function isIVRCampaignActive(_0x476b14){return _0x476b14[_0xf5bf('0x1e')];}exports[_0xf5bf('0x1f')]=isIVRCampaignActive;function getSeconds(_0x59aa19,_0x1d8001){var _0x28b2a3=moment(_0x59aa19)[_0xf5bf('0x20')](0x0);var _0x4d6e77=moment(_0x1d8001)[_0xf5bf('0x20')](0x0);return _0x28b2a3[_0xf5bf('0x21')](_0x4d6e77,_0xf5bf('0x22'));}exports[_0xf5bf('0x23')]=getSeconds;function hasQueueCampaignDataChanged(_0x35eddf,_0x2721a1){var _0x286aa9=![];var _0x4aa541=_0x35eddf[_0xf5bf('0x16')]!==_0x2721a1[_0xf5bf('0x16')]||_0x35eddf[_0xf5bf('0x1c')]!==_0x2721a1[_0xf5bf('0x1c')]||_0x35eddf[_0xf5bf('0x24')]!==_0x2721a1[_0xf5bf('0x24')];var _0x449d65=_0x35eddf[_0xf5bf('0x25')]!==_0x2721a1[_0xf5bf('0x25')]||_0x35eddf[_0xf5bf('0x26')]!==_0x2721a1[_0xf5bf('0x26')]||_0x35eddf[_0xf5bf('0x27')]!==_0x2721a1[_0xf5bf('0x27')]||_0x35eddf[_0xf5bf('0x28')]!==_0x2721a1[_0xf5bf('0x28')]||_0x35eddf[_0xf5bf('0x29')]!==_0x2721a1[_0xf5bf('0x29')]||_0x35eddf[_0xf5bf('0x2a')]!==_0x2721a1['pTalking']||_0x35eddf[_0xf5bf('0x2b')]!==_0x2721a1[_0xf5bf('0x2b')]||_0x35eddf[_0xf5bf('0x2c')]!==_0x2721a1[_0xf5bf('0x2c')]||_0x35eddf['originated']!==_0x2721a1[_0xf5bf('0x2d')];if(_0x35eddf['Trunk']&&_0x2721a1[_0xf5bf('0x2e')]){_0x286aa9=_0x35eddf[_0xf5bf('0x2e')][_0xf5bf('0x2f')]!==_0x2721a1['Trunk'][_0xf5bf('0x2f')]||_0x35eddf['Trunk']['active']!==_0x2721a1[_0xf5bf('0x2e')][_0xf5bf('0x1e')];}return _0x4aa541||_0x449d65||_0x286aa9;}exports[_0xf5bf('0x30')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x15f073){var _0x4c9e68=null;var _0x37616c=_0x15f073['dialTimezone'];if(_[_0xf5bf('0x31')](_0x15f073[_0xf5bf('0x32')])||_[_0xf5bf('0x31')](_0x15f073['Interval'])||_[_0xf5bf('0x31')](_0x15f073[_0xf5bf('0x33')][_0xf5bf('0x34')])){_0x4c9e68=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0xf5bf('0x35')](_0x15f073[_0xf5bf('0x32')])||_[_0xf5bf('0x35')](_0x15f073['Interval']['Intervals'])){_0x4c9e68=CAMPAIGN_STATUS[_0xf5bf('0x36')];}else if(_0x37616c&&!timezones[_0x37616c]){_0x4c9e68=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0x4c9e68;}function checkAnyValidTrunk(_0x1affb7,_0xaf5f1e){var _0x124fe6=null;var _0x1d92dd='SIP/';var _0x1c56f6=[_0xf5bf('0x37'),'unmonitored'];var _0x2b7b8a=!![];if(_0x1affb7[_0xf5bf('0x2e')]&&_0x1affb7['Trunk'][_0xf5bf('0x1e')]){_0x1d92dd+=_0x1affb7['Trunk'][_0xf5bf('0x2f')];_0x124fe6=_0xaf5f1e[_0x1d92dd];_0x2b7b8a=_0x1c56f6[_0xf5bf('0x38')](_0x124fe6[_0xf5bf('0x39')]);}else if(_0x1affb7[_0xf5bf('0x3a')]&&_0x1affb7[_0xf5bf('0x3a')][_0xf5bf('0x1e')]){_0x1d92dd+=_0x1affb7[_0xf5bf('0x3a')][_0xf5bf('0x2f')];_0x124fe6=_0xaf5f1e[_0x1d92dd];_0x2b7b8a=_0x1c56f6['includes'](_0x124fe6[_0xf5bf('0x39')]);}return _0x2b7b8a;}function getQueueCampaignStatusMessage(_0x963a8d,_0x257229){var _0x476568=CAMPAIGN_STATUS[_0xf5bf('0x6')];var _0x14b892=isPreviewCampaign(_0x963a8d);if(!isQueueCampaignActive(_0x963a8d)){if(_0x14b892){_0x476568=CAMPAIGN_STATUS[_0xf5bf('0x3b')];}else{if(_0x963a8d[_0xf5bf('0x2d')]===0x0&&_0x963a8d['talking']===0x0&&_0x963a8d[_0xf5bf('0x2b')]===0x0&&(_0x963a8d['pTalking']||0x0)===0x0){_0x476568=CAMPAIGN_STATUS[_0xf5bf('0x3b')];}else{_0x476568=CAMPAIGN_STATUS[_0xf5bf('0x3c')];}}}else if(_0x963a8d[_0xf5bf('0x26')]===0x0){_0x476568=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x963a8d,_0x257229)){_0x476568=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x963a8d)){var _0x5076e2=checkAnyValidQueueCampaignInterval(_0x963a8d);if(_0x5076e2){_0x476568=_0x5076e2;}}return _0x476568;}exports[_0xf5bf('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x29bf9e){var _0x16aab1=CAMPAIGN_STATUS[_0xf5bf('0x3c')];if(_0x29bf9e[_0xf5bf('0x2d')]===0x0&&_0x29bf9e[_0xf5bf('0x29')]===0x0&&_0x29bf9e[_0xf5bf('0x2b')]===0x0&&(_0x29bf9e[_0xf5bf('0x2a')]||0x0)===0x0){_0x16aab1=CAMPAIGN_STATUS['INACTIVE'];}return _0x16aab1;}exports[_0xf5bf('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x3982fb){var _0x38666e=_0x3982fb[_0xf5bf('0x3f')](/"(.*?)"/);return _0x38666e?_0x38666e[0x1]:_0x3982fb;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x1cbed9,_0x2bbbdc,_0x5c8975){if(!_[_0xf5bf('0x40')](_0x5c8975)&&typeof _0x5c8975===_0xf5bf('0x41')&&!_[_0xf5bf('0x35')](_0x5c8975)){if(!_[_0xf5bf('0x40')](_0x2bbbdc)&&typeof _0x2bbbdc===_0xf5bf('0x41')&&!_[_0xf5bf('0x35')](_0x2bbbdc)){return util[_0xf5bf('0x42')](_0xf5bf('0x43'),_0x2bbbdc,_0x5c8975);}return util[_0xf5bf('0x42')](_0xf5bf('0x43'),_0x5c8975,_0x5c8975);}if(!_['isUndefined'](_0x1cbed9)&&typeof _0x1cbed9===_0xf5bf('0x41')&&!_[_0xf5bf('0x35')](_0x1cbed9)){return _0x1cbed9;}return'\x22\x22\x20<>';}exports[_0xf5bf('0x44')]=getCallerId;function getCallerIdRandom(_0x2e109f,_0x1a691a){var _0x12b9c3;var _0xa6f9e0;var _0x20db91;if(_0x1a691a<=0x0){_0x1a691a=0x1;}_0x12b9c3=new RegExp('\x5cw{0,'+_0x1a691a+'}$');_0xa6f9e0=Math['pow'](0xa,_0x1a691a-0x1);_0x20db91=Math[_0xf5bf('0x45')](0xa,_0x1a691a)-0x1;return util[_0xf5bf('0x42')]('%s',_[_0xf5bf('0x46')](_0x2e109f,_0x12b9c3,_[_0xf5bf('0x47')](_0xa6f9e0,_0x20db91)[_0xf5bf('0x48')]()));}exports[_0xf5bf('0x49')]=getCallerIdRandom;function decrementOriginate(_0xfe3d85){if(_0xfe3d85[_0xf5bf('0x2d')]&&_0xfe3d85[_0xf5bf('0x2d')]>0x0){_0xfe3d85[_0xf5bf('0x2d')]-=0x1;}else{logger['error'](_0xf5bf('0x4a'));}}exports[_0xf5bf('0x4b')]=decrementOriginate;function checkContactEmpty(_0x62775){return _0x62775&&_0x62775[_0xf5bf('0x4c')]>0x0;}exports[_0xf5bf('0x4d')]=checkContactEmpty;function erlangb(_0x1cff3f,_0x441015){if(_0x441015===0x0){return 0x0;}var _0x292929=0x1;for(var _0x2b5202=0x1;_0x2b5202<=_0x441015;_0x2b5202+=0x1){_0x292929=0x1+_0x292929*_0x2b5202/_0x1cff3f;}return 0x1/_0x292929;}exports[_0xf5bf('0x4e')]=erlangb;function checkContactLowerLimitOriginate(_0x3362aa,_0x4cc27e,_0x57c673){if(_0x4cc27e>_0x57c673){for(var _0x39c80b=0x0;_0x39c80b<_0x4cc27e-_0x57c673;_0x39c80b+=0x1){decrementOriginate(_0x3362aa);}}}exports[_0xf5bf('0x4f')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x3a7a9b){var _0x49a6c3={};var _0x3980ec=['id',_0xf5bf('0x50'),'description',_0xf5bf('0x51'),'updatedAt'];if(_0x3a7a9b){for(var _0x5f4ba2 in _0x3a7a9b){if(typeof _0x3a7a9b[_0x5f4ba2]!==_0xf5bf('0x52')){if(!_[_0xf5bf('0x31')](_0x3a7a9b[_0x5f4ba2])&&!_0x3980ec[_0xf5bf('0x38')](_0x5f4ba2)){_0x49a6c3[util['format'](_0xf5bf('0x53'),_0xf5bf('0x54'),_0x5f4ba2[_0xf5bf('0x55')]())]=_0x3a7a9b[_0x5f4ba2];}}}}return _0x49a6c3;}exports[_0xf5bf('0x56')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 4b0d54f..1a78ae5 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(_0x59e590,_0x2381b5){var _0x133a2c=function(_0x29aeec){while(--_0x29aeec){_0x59e590['push'](_0x59e590['shift']());}};_0x133a2c(++_0x2381b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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(_0x365917,_0x545bcc){var _0x20f7a0=function(_0x31965e){while(--_0x31965e){_0x365917['push'](_0x365917['shift']());}};_0x20f7a0(++_0x545bcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 c52fda4..4f6d224 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 _0xba54=['newexten','faxstatus','syncFaxStatus','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstatedesc','syncNewExten','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[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','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isTrunkReachable','isNil','active','SIP/%s','reachable','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','fax','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','lodash','bluebird','uuid','path','./util/gs','../ami','./channel','./util/util','./action','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','syncNewState'];(function(_0x27a7a9,_0x3ff625){var _0x415b63=function(_0x448cb0){while(--_0x448cb0){_0x27a7a9['push'](_0x27a7a9['shift']());}};_0x415b63(++_0x3ff625);}(_0xba54,0xcb));var _0x4ba5=function(_0x59a9a3,_0x3eec0f){_0x59a9a3=_0x59a9a3-0x0;var _0x5e7662=_0xba54[_0x59a9a3];return _0x5e7662;};'use strict';var util=require('util');var _=require(_0x4ba5('0x0'));var BPromise=require(_0x4ba5('0x1'));var uuid=require(_0x4ba5('0x2'));var moment=require('moment');var path=require(_0x4ba5('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x4ba5('0x4'));var logger=require('../../../config/logger')('fax');var ami=require(_0x4ba5('0x5'));var rpcDb=require('./rpcDb');var Channel=require(_0x4ba5('0x6'));var ut=require(_0x4ba5('0x7'));var Action=require(_0x4ba5('0x8'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x4ba5('0x9'));function Fax(_0x8fe8b7){this['channels']={};this[_0x4ba5('0xa')]=_0x8fe8b7[_0x4ba5('0xa')];this[_0x4ba5('0xb')]=_0x8fe8b7[_0x4ba5('0xb')];this[_0x4ba5('0xc')]={};ami['on'](_0x4ba5('0xd'),this['syncNewchannel'][_0x4ba5('0xe')](this));ami['on'](_0x4ba5('0xf'),this[_0x4ba5('0x10')][_0x4ba5('0xe')](this));ami['on'](_0x4ba5('0x11'),this[_0x4ba5('0x12')]['bind'](this));ami['on'](_0x4ba5('0x13'),this['syncNewExten'][_0x4ba5('0xe')](this));ami['on'](_0x4ba5('0x14'),this[_0x4ba5('0x15')][_0x4ba5('0xe')](this));ami['on']('receivefax',this[_0x4ba5('0x16')][_0x4ba5('0xe')](this));ami['on']('hangup',this[_0x4ba5('0x17')][_0x4ba5('0xe')](this));ami['on'](_0x4ba5('0x18'),this[_0x4ba5('0x19')]['bind'](this));}Fax[_0x4ba5('0x1a')]['syncNewchannel']=function(_0x2d4e8a){if(_0x2d4e8a[_0x4ba5('0x1b')]===_0x4ba5('0x1c')){for(var _0x321c51 in this[_0x4ba5('0xa')]){if(this['faxAccounts'][_0x4ba5('0x1d')](_0x321c51)){if(_0x2d4e8a[_0x4ba5('0x1e')]===this[_0x4ba5('0xa')][_0x321c51]['localstationid']){this[_0x4ba5('0x1f')][_0x2d4e8a[_0x4ba5('0x20')]]={};this[_0x4ba5('0x1f')][_0x2d4e8a[_0x4ba5('0x20')]][_0x4ba5('0x21')]=_0x2d4e8a[_0x4ba5('0x21')];this[_0x4ba5('0x1f')][_0x2d4e8a[_0x4ba5('0x20')]]['id']=this['faxAccounts'][_0x321c51]['id'];this[_0x4ba5('0x1f')][_0x2d4e8a[_0x4ba5('0x20')]][_0x4ba5('0x22')]=this[_0x4ba5('0xa')][_0x321c51][_0x4ba5('0x22')];logger[_0x4ba5('0x23')](_0x2d4e8a[_0x4ba5('0x20')],_0x4ba5('0x24'));}}}}if(this['actions'][_0x2d4e8a[_0x4ba5('0x20')]]){this[_0x4ba5('0x1f')][_0x2d4e8a['uniqueid']]={};this[_0x4ba5('0x1f')][_0x2d4e8a[_0x4ba5('0x20')]][_0x4ba5('0x21')]=_0x2d4e8a[_0x4ba5('0x21')];logger[_0x4ba5('0x23')](_0x2d4e8a[_0x4ba5('0x20')],_0x4ba5('0x24'));}};Fax['prototype'][_0x4ba5('0x10')]=function(_0x5b3d29){if(this[_0x4ba5('0x1f')][_0x5b3d29[_0x4ba5('0x20')]]){for(var _0x3282fd in _0x5b3d29[_0x4ba5('0x25')]){if(_0x5b3d29[_0x4ba5('0x25')][_0x4ba5('0x1d')](_0x3282fd)){this[_0x4ba5('0x1f')][_0x5b3d29[_0x4ba5('0x20')]][_0x3282fd]=_0x5b3d29[_0x4ba5('0x26')];}}}};Fax['prototype'][_0x4ba5('0x12')]=function(_0x427d0a){if(this[_0x4ba5('0x1f')][_0x427d0a[_0x4ba5('0x20')]]){this['channels'][_0x427d0a['uniqueid']]['channelstate']=_0x427d0a['channelstate'];this[_0x4ba5('0x1f')][_0x427d0a[_0x4ba5('0x20')]][_0x4ba5('0x27')]=_0x427d0a['channelstatedesc'];}};Fax[_0x4ba5('0x1a')][_0x4ba5('0x28')]=function(_0x2d3c2e){if(this[_0x4ba5('0x1f')][_0x2d3c2e[_0x4ba5('0x20')]]){for(var _0x3944f2 in _0x2d3c2e[_0x4ba5('0x25')]){if(_0x2d3c2e[_0x4ba5('0x25')][_0x4ba5('0x1d')](_0x3944f2)){this['channels'][_0x2d3c2e[_0x4ba5('0x20')]][_0x3944f2]=_0x2d3c2e['value'];}}}};Fax['prototype']['syncFaxStatus']=function(_0x1cd8b8){if(this[_0x4ba5('0x1f')][_0x1cd8b8[_0x4ba5('0x20')]]){this[_0x4ba5('0x1f')][_0x1cd8b8[_0x4ba5('0x20')]][_0x4ba5('0x29')]=_0x1cd8b8[_0x4ba5('0x29')];this[_0x4ba5('0x1f')][_0x1cd8b8[_0x4ba5('0x20')]][_0x4ba5('0x2a')]=_0x1cd8b8['status'];this[_0x4ba5('0x1f')][_0x1cd8b8['uniqueid']][_0x4ba5('0x2b')]=_0x1cd8b8['localstationid'];this['channels'][_0x1cd8b8[_0x4ba5('0x20')]][_0x4ba5('0x2c')]=_0x1cd8b8['filename'];logger[_0x4ba5('0x23')](_0x1cd8b8[_0x4ba5('0x20')],_0x4ba5('0x2d'));}};Fax[_0x4ba5('0x1a')][_0x4ba5('0x16')]=function(_0x57be32){var _0x77177f=this;if(this[_0x4ba5('0x1f')][_0x57be32[_0x4ba5('0x20')]]){var _0x5d3fc9=this['channels'][_0x57be32['uniqueid']]['id'];this[_0x4ba5('0x1f')][_0x57be32['uniqueid']]['remotestationid']=_0x57be32[_0x4ba5('0x2e')];this['channels'][_0x57be32[_0x4ba5('0x20')]][_0x4ba5('0x2f')]=_0x57be32['pagestransferred'];this[_0x4ba5('0x1f')][_0x57be32[_0x4ba5('0x20')]][_0x4ba5('0x2b')]=_0x57be32['localstationid'];this['channels'][_0x57be32[_0x4ba5('0x20')]]['resolution']=_0x57be32['resolution'];this['channels'][_0x57be32[_0x4ba5('0x20')]]['transferrate']=_0x57be32[_0x4ba5('0x30')];this[_0x4ba5('0x1f')][_0x57be32['uniqueid']]['filename']=_0x57be32['filename'];this['channels'][_0x57be32['uniqueid']][_0x4ba5('0x31')]=_0x57be32['calleridnum'];if(this[_0x4ba5('0x1f')][_0x57be32[_0x4ba5('0x20')]][_0x4ba5('0x2f')]>0x0){tiff2pdf(_0x57be32[_0x4ba5('0x2c')],_0x4ba5('0x32'),function(_0x450a08){logger[_0x4ba5('0x23')](_0x57be32[_0x4ba5('0x20')],_0x4ba5('0x33'),_0x450a08['message']);attachment['create']({'name':path[_0x4ba5('0x34')](_0x57be32[_0x4ba5('0x2c')])[_0x4ba5('0x22')],'basename':path[_0x4ba5('0x34')](_0x57be32[_0x4ba5('0x2c')])['name']+_0x4ba5('0x35'),'type':_0x4ba5('0x36')})[_0x4ba5('0x37')](function(_0x47c4a3){faxAccount[_0x4ba5('0x38')](_0x5d3fc9,{'from':_0x57be32[_0x4ba5('0x31')],'mapKey':'fax','body':path[_0x4ba5('0x34')](_0x57be32[_0x4ba5('0x2c')])['name']+_0x4ba5('0x35'),'AttachmentId':_0x47c4a3['id']})[_0x4ba5('0x39')](function(_0x3ea65b){logger[_0x4ba5('0x3a')](_0x57be32[_0x4ba5('0x20')],_0x4ba5('0x3b'),JSON['stringify'](_0x3ea65b));});})['catch'](function(_0xb591a0){logger[_0x4ba5('0x3a')](_0x57be32[_0x4ba5('0x20')],'\x20receiveFax\x20',JSON[_0x4ba5('0x3c')](_0xb591a0));});});}logger[_0x4ba5('0x23')](_0x57be32[_0x4ba5('0x20')],_0x4ba5('0x3d'));}};Fax['prototype'][_0x4ba5('0x19')]=function(_0x313745){if(this[_0x4ba5('0xc')][_0x313745[_0x4ba5('0x20')]]){_[_0x4ba5('0x3e')](this['channels'][_0x313745[_0x4ba5('0x20')]],_['pick'](_0x313745,['response',_0x4ba5('0x3f')]));}};function updateStatus(_0x4ffd3a){if(_0x4ffd3a[_0x4ba5('0x40')]){faxMessage[_0x4ba5('0x41')](_0x4ffd3a['AttachmentId'],{'failMessage':_0x4ba5('0x42')})[_0x4ba5('0x37')](function(_0x2ccb09){ut[_0x4ba5('0x43')](_0x4ba5('0x44'),_0x2ccb09);})[_0x4ba5('0x39')](function(_0x1e2c0e){ut['logger'](_0x4ba5('0x45'),_0x1e2c0e);});}else{ut[_0x4ba5('0x43')](_0x4ba5('0x46'));}}Fax[_0x4ba5('0x1a')][_0x4ba5('0x47')]=function(_0x3f9901,_0x2447bb,_0x55b209){var _0x4451de=this;var _0x45d066={};if(_0x2447bb){_0x45d066={'read':_0x2447bb};}else{_0x45d066={'failMessage':_0x55b209};}if(this[_0x4ba5('0xc')][_0x3f9901][_0x4ba5('0x40')]){faxMessage[_0x4ba5('0x41')](this['actions'][_0x3f9901][_0x4ba5('0x40')],_0x45d066)[_0x4ba5('0x37')](function(_0xcb2705){ut['logger'](_0x4ba5('0x48'),_0xcb2705);})[_0x4ba5('0x39')](function(_0x76d791){ut[_0x4ba5('0x43')](_0x4ba5('0x49'),_0x76d791);})[_0x4ba5('0x4a')](function(){delete _0x4451de[_0x4ba5('0x1f')][_0x3f9901];delete _0x4451de[_0x4ba5('0xc')][_0x3f9901];});}else{ut[_0x4ba5('0x43')](_0x4ba5('0x4b'));delete this[_0x4ba5('0x1f')][_0x3f9901];delete this[_0x4ba5('0xc')][_0x3f9901];}};Fax[_0x4ba5('0x1a')][_0x4ba5('0x17')]=function(_0x2c89f3){var _0x415a34=this;if(this[_0x4ba5('0x1f')][_0x2c89f3[_0x4ba5('0x20')]]){if(this['actions'][_0x2c89f3['uniqueid']]){this[_0x4ba5('0x1f')][_0x2c89f3['uniqueid']]['id']=this['actions'][_0x2c89f3[_0x4ba5('0x20')]]['id'];this[_0x4ba5('0x1f')][_0x2c89f3[_0x4ba5('0x20')]][_0x4ba5('0x22')]=this[_0x4ba5('0xc')][_0x2c89f3[_0x4ba5('0x20')]][_0x4ba5('0x22')];}logger[_0x4ba5('0x23')](_0x2c89f3[_0x4ba5('0x20')],this[_0x4ba5('0xc')][_0x2c89f3[_0x4ba5('0x20')]]?_0x4ba5('0x4c'):_0x4ba5('0x4d'),JSON[_0x4ba5('0x3c')](this[_0x4ba5('0x1f')][_0x2c89f3[_0x4ba5('0x20')]]));if(this[_0x4ba5('0xc')][_0x2c89f3[_0x4ba5('0x20')]]){if(this[_0x4ba5('0x1f')][_0x2c89f3['uniqueid']][_0x4ba5('0x4e')]>0x0&&this[_0x4ba5('0x1f')][_0x2c89f3[_0x4ba5('0x20')]][_0x4ba5('0x14')]==='SUCCESS'){this[_0x4ba5('0x47')](_0x2c89f3[_0x4ba5('0x20')],!![]);}else{this[_0x4ba5('0x47')](_0x2c89f3[_0x4ba5('0x20')],![],this[_0x4ba5('0x1f')][_0x2c89f3[_0x4ba5('0x20')]][_0x4ba5('0x4f')]?_0x4ba5('0x50')+this[_0x4ba5('0x1f')][_0x2c89f3['uniqueid']][_0x4ba5('0x4f')]:_0x4ba5('0x51'));}}}};Fax['prototype'][_0x4ba5('0x52')]=function(_0x3e981a){var _0x3f65cb=this;return new BPromise(function(_0x1ebdf4,_0x6035f2){_0x3f65cb[_0x4ba5('0x53')](_0x3e981a,_0x3f65cb[_0x4ba5('0xa')][_0x3e981a[_0x4ba5('0x54')]])['then'](function(_0x5aaa13){ut[_0x4ba5('0x43')](_0x4ba5('0x55'),_0x5aaa13);_0x1ebdf4(ut['message'](_0x4ba5('0x56')));})[_0x4ba5('0x39')](function(_0x28552d){ut['logger'](_0x4ba5('0x57'),_0x28552d);updateStatus(_0x3e981a);_0x6035f2(ut['message']('Fax\x20failed'));});});};Fax[_0x4ba5('0x1a')][_0x4ba5('0x58')]=function(_0x2b1758){var _0xd42c58=this;return new BPromise(function(_0x32dd79,_0x4eb0e3){var _0x1f980a=_0xd42c58['checkTrunk'](_0xd42c58[_0x4ba5('0xa')][_0x2b1758[_0x4ba5('0x54')]]['Trunk'],_0x2b1758);if(_0x1f980a[_0x4ba5('0x59')]){_0x32dd79(ut['message']('Trunk\x20Reachable'));}else{_0x4eb0e3(ut['message'](_0x1f980a['message']));}});};function originate(_0x2ab046,_0x3f9eb3,_0x37c4b6){return new BPromise(function(_0x48b12a,_0x210918){if(_0x37c4b6){var _0x59d5cb=util[_0x4ba5('0x5a')](_0x4ba5('0x5b'),path['parse'](_0x2ab046[_0x4ba5('0x3')])['name'],_0x2ab046['path']);gs[_0x4ba5('0x5c')](_0x59d5cb)[_0x4ba5('0x37')](function(){_0x2ab046[_0x4ba5('0x3')]=util[_0x4ba5('0x5a')]('%s/%s.tif',path['parse'](_0x2ab046[_0x4ba5('0x3')])[_0x4ba5('0x5d')],path[_0x4ba5('0x34')](_0x2ab046[_0x4ba5('0x3')])[_0x4ba5('0x22')]);_0x3f9eb3[_0x4ba5('0x5e')]=_0x2ab046[_0x4ba5('0x3')];ut['logger'](_0x4ba5('0x5f'),'');ami[_0x4ba5('0x60')](ut[_0x4ba5('0x61')](_0x2ab046,_0x3f9eb3))[_0x4ba5('0x37')](function(_0x56c438){_0x48b12a(_0x56c438);})['catch'](function(_0x342627){_0x210918(_0x342627);});})[_0x4ba5('0x39')](function(_0x1b7d63){_0x210918(_0x1b7d63);});}else{ami['Action'](ut['variablesAction'](_0x2ab046,_0x3f9eb3))[_0x4ba5('0x37')](function(_0x4d1ae0){_0x48b12a(_0x4d1ae0);})['catch'](function(_0x291568){_0x210918(_0x291568);});}});}Fax[_0x4ba5('0x1a')][_0x4ba5('0x53')]=function(_0x2f3e3a,_0x1f6352){var _0xd06c43=this;return new BPromise(function(_0x17dfae,_0x2defd5){var _0x122db9=uuid['v4']();var _0x26e3db=ut['addVariables'](_0x2f3e3a,_0x1f6352);_0xd06c43['actions'][_0x122db9]=new Action(_0x122db9,_0x1f6352,_0x2f3e3a);var _0x583972=_0xd06c43['actions'][_0x122db9];if(path['parse'](_0x2f3e3a[_0x4ba5('0x3')])['ext']==='.pdf'){originate(_0x583972,_0x26e3db,!![])[_0x4ba5('0x37')](function(_0x7d927a){_0x17dfae(_0x7d927a);})['catch'](function(_0x28f722){_0x2defd5(_0x28f722);});}else{originate(_0x583972,_0x26e3db,![])[_0x4ba5('0x37')](function(_0x3e32da){_0x17dfae(_0x3e32da);})['catch'](function(_0x5b590d){_0x2defd5(_0x5b590d);});}});};Fax[_0x4ba5('0x1a')][_0x4ba5('0x62')]=function(_0x55fd8a){return!_[_0x4ba5('0x63')](_0x55fd8a)&&!_['isNil'](_0x55fd8a['name'])&&!_[_0x4ba5('0x63')](_0x55fd8a['active'])&&_0x55fd8a[_0x4ba5('0x64')]&&!_['isNil'](this[_0x4ba5('0xb')][util[_0x4ba5('0x5a')](_0x4ba5('0x65'),_0x55fd8a[_0x4ba5('0x22')])])&&!_[_0x4ba5('0x63')](this[_0x4ba5('0xb')][util['format']('SIP/%s',_0x55fd8a[_0x4ba5('0x22')])][_0x4ba5('0x2a')])&&(this['trunks'][util[_0x4ba5('0x5a')](_0x4ba5('0x65'),_0x55fd8a['name'])][_0x4ba5('0x2a')]===_0x4ba5('0x66')||this['trunks'][util['format'](_0x4ba5('0x65'),_0x55fd8a[_0x4ba5('0x22')])][_0x4ba5('0x2a')]==='unmonitored');};Fax['prototype'][_0x4ba5('0x67')]=function(_0x5673b5,_0x2645cb){if(!this[_0x4ba5('0x62')](_0x5673b5)){ut[_0x4ba5('0x43')](_0x4ba5('0x68'),_['isNil'](_0x5673b5)?'':_0x5673b5['name']+_0x4ba5('0x69'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0x4ba5('0x63')](_0x2645cb[_0x4ba5('0x6a')])){ut[_0x4ba5('0x43')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x4ba5('0x3c')](_0x2645cb));return{'isValid':![],'message':_0x4ba5('0x6b')};}if(_[_0x4ba5('0x63')](_0x2645cb['path'])){ut[_0x4ba5('0x43')](_0x4ba5('0x6c'),JSON[_0x4ba5('0x3c')](_0x2645cb));return{'isValid':![],'message':_0x4ba5('0x6d')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x4ba5('0x6e')]=Fax; \ No newline at end of file +var _0xe14f=['path','./util/gs','fax','../ami','./rpcDb','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncOriginateResponse','prototype','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','hasOwnProperty','value','channelstate','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','parse','.pdf','catch','error','\x20notify\x20','\x20receiveFax\x20','stringify','merge','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','then','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','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','%s/%s.tif','dir','XMF-PATH','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','format','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','bluebird','uuid','moment'];(function(_0x4b763b,_0x579baa){var _0x1f4ef3=function(_0x57eea5){while(--_0x57eea5){_0x4b763b['push'](_0x4b763b['shift']());}};_0x1f4ef3(++_0x579baa);}(_0xe14f,0xdf));var _0xfe14=function(_0x427f99,_0x5915a8){_0x427f99=_0x427f99-0x0;var _0xe65cec=_0xe14f[_0x427f99];return _0xe65cec;};'use strict';var util=require(_0xfe14('0x0'));var _=require(_0xfe14('0x1'));var BPromise=require(_0xfe14('0x2'));var uuid=require(_0xfe14('0x3'));var moment=require(_0xfe14('0x4'));var path=require(_0xfe14('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xfe14('0x6'));var logger=require('../../../config/logger')(_0xfe14('0x7'));var ami=require(_0xfe14('0x8'));var rpcDb=require(_0xfe14('0x9'));var Channel=require('./channel');var ut=require(_0xfe14('0xa'));var Action=require('./action');var faxAccount=require(_0xfe14('0xb'));var attachment=require(_0xfe14('0xc'));var faxMessage=require(_0xfe14('0xd'));function Fax(_0x4d5ff0){this[_0xfe14('0xe')]={};this[_0xfe14('0xf')]=_0x4d5ff0['faxAccounts'];this['trunks']=_0x4d5ff0[_0xfe14('0x10')];this['actions']={};ami['on'](_0xfe14('0x11'),this[_0xfe14('0x12')][_0xfe14('0x13')](this));ami['on'](_0xfe14('0x14'),this[_0xfe14('0x15')]['bind'](this));ami['on'](_0xfe14('0x16'),this[_0xfe14('0x17')][_0xfe14('0x13')](this));ami['on'](_0xfe14('0x18'),this[_0xfe14('0x19')][_0xfe14('0x13')](this));ami['on'](_0xfe14('0x1a'),this[_0xfe14('0x1b')][_0xfe14('0x13')](this));ami['on'](_0xfe14('0x1c'),this[_0xfe14('0x1d')]['bind'](this));ami['on'](_0xfe14('0x1e'),this['syncHangup'][_0xfe14('0x13')](this));ami['on']('originateresponse',this[_0xfe14('0x1f')][_0xfe14('0x13')](this));}Fax[_0xfe14('0x20')][_0xfe14('0x12')]=function(_0xa0c41e){if(_0xa0c41e['context']==='from-voip-provider'){for(var _0x575362 in this['faxAccounts']){if(this['faxAccounts']['hasOwnProperty'](_0x575362)){if(_0xa0c41e['exten']===this[_0xfe14('0xf')][_0x575362][_0xfe14('0x21')]){this[_0xfe14('0xe')][_0xa0c41e[_0xfe14('0x22')]]={};this['channels'][_0xa0c41e[_0xfe14('0x22')]][_0xfe14('0x23')]=_0xa0c41e[_0xfe14('0x23')];this[_0xfe14('0xe')][_0xa0c41e[_0xfe14('0x22')]]['id']=this[_0xfe14('0xf')][_0x575362]['id'];this[_0xfe14('0xe')][_0xa0c41e[_0xfe14('0x22')]]['name']=this[_0xfe14('0xf')][_0x575362][_0xfe14('0x24')];logger[_0xfe14('0x25')](_0xa0c41e[_0xfe14('0x22')],_0xfe14('0x26'));}}}}if(this[_0xfe14('0x27')][_0xa0c41e[_0xfe14('0x22')]]){this['channels'][_0xa0c41e[_0xfe14('0x22')]]={};this['channels'][_0xa0c41e['uniqueid']][_0xfe14('0x23')]=_0xa0c41e[_0xfe14('0x23')];logger[_0xfe14('0x25')](_0xa0c41e[_0xfe14('0x22')],_0xfe14('0x26'));}};Fax[_0xfe14('0x20')][_0xfe14('0x15')]=function(_0x5e0f0a){if(this[_0xfe14('0xe')][_0x5e0f0a['uniqueid']]){for(var _0x9da29f in _0x5e0f0a['variable']){if(_0x5e0f0a[_0xfe14('0x28')][_0xfe14('0x29')](_0x9da29f)){this[_0xfe14('0xe')][_0x5e0f0a[_0xfe14('0x22')]][_0x9da29f]=_0x5e0f0a[_0xfe14('0x2a')];}}}};Fax[_0xfe14('0x20')][_0xfe14('0x17')]=function(_0x37d2f){if(this['channels'][_0x37d2f['uniqueid']]){this[_0xfe14('0xe')][_0x37d2f[_0xfe14('0x22')]][_0xfe14('0x2b')]=_0x37d2f['channelstate'];this[_0xfe14('0xe')][_0x37d2f[_0xfe14('0x22')]]['channelstatedesc']=_0x37d2f['channelstatedesc'];}};Fax[_0xfe14('0x20')]['syncNewExten']=function(_0xe1ddb0){if(this[_0xfe14('0xe')][_0xe1ddb0[_0xfe14('0x22')]]){for(var _0x5e8c2c in _0xe1ddb0[_0xfe14('0x28')]){if(_0xe1ddb0[_0xfe14('0x28')][_0xfe14('0x29')](_0x5e8c2c)){this[_0xfe14('0xe')][_0xe1ddb0['uniqueid']][_0x5e8c2c]=_0xe1ddb0[_0xfe14('0x2a')];}}}};Fax[_0xfe14('0x20')][_0xfe14('0x1b')]=function(_0x1eaa69){if(this[_0xfe14('0xe')][_0x1eaa69[_0xfe14('0x22')]]){this[_0xfe14('0xe')][_0x1eaa69['uniqueid']][_0xfe14('0x2c')]=_0x1eaa69[_0xfe14('0x2c')];this['channels'][_0x1eaa69['uniqueid']]['status']=_0x1eaa69[_0xfe14('0x2d')];this[_0xfe14('0xe')][_0x1eaa69['uniqueid']][_0xfe14('0x21')]=_0x1eaa69[_0xfe14('0x21')];this[_0xfe14('0xe')][_0x1eaa69['uniqueid']]['filename']=_0x1eaa69[_0xfe14('0x2e')];logger[_0xfe14('0x25')](_0x1eaa69[_0xfe14('0x22')],_0xfe14('0x2f'));}};Fax['prototype'][_0xfe14('0x1d')]=function(_0x41e3f1){var _0x2c5beb=this;if(this['channels'][_0x41e3f1[_0xfe14('0x22')]]){var _0x2fa52f=this[_0xfe14('0xe')][_0x41e3f1[_0xfe14('0x22')]]['id'];this[_0xfe14('0xe')][_0x41e3f1[_0xfe14('0x22')]][_0xfe14('0x30')]=_0x41e3f1[_0xfe14('0x30')];this[_0xfe14('0xe')][_0x41e3f1[_0xfe14('0x22')]][_0xfe14('0x31')]=_0x41e3f1[_0xfe14('0x31')];this['channels'][_0x41e3f1[_0xfe14('0x22')]][_0xfe14('0x21')]=_0x41e3f1[_0xfe14('0x21')];this[_0xfe14('0xe')][_0x41e3f1[_0xfe14('0x22')]][_0xfe14('0x32')]=_0x41e3f1[_0xfe14('0x32')];this['channels'][_0x41e3f1['uniqueid']]['transferrate']=_0x41e3f1[_0xfe14('0x33')];this[_0xfe14('0xe')][_0x41e3f1[_0xfe14('0x22')]][_0xfe14('0x2e')]=_0x41e3f1['filename'];this[_0xfe14('0xe')][_0x41e3f1[_0xfe14('0x22')]][_0xfe14('0x34')]=_0x41e3f1[_0xfe14('0x34')];if(this[_0xfe14('0xe')][_0x41e3f1[_0xfe14('0x22')]]['pagestransferred']>0x0){tiff2pdf(_0x41e3f1[_0xfe14('0x2e')],_0xfe14('0x35'),function(_0x2f8411){logger['info'](_0x41e3f1[_0xfe14('0x22')],'\x20result\x20conversion\x20file\x20',_0x2f8411['message']);attachment['create']({'name':path[_0xfe14('0x36')](_0x41e3f1[_0xfe14('0x2e')])[_0xfe14('0x24')],'basename':path[_0xfe14('0x36')](_0x41e3f1[_0xfe14('0x2e')])[_0xfe14('0x24')]+_0xfe14('0x37'),'type':'application/pdf'})['then'](function(_0x17fa72){faxAccount['notify'](_0x2fa52f,{'from':_0x41e3f1[_0xfe14('0x34')],'mapKey':_0xfe14('0x7'),'body':path[_0xfe14('0x36')](_0x41e3f1['filename'])['name']+_0xfe14('0x37'),'AttachmentId':_0x17fa72['id']})[_0xfe14('0x38')](function(_0x292a40){logger[_0xfe14('0x39')](_0x41e3f1[_0xfe14('0x22')],_0xfe14('0x3a'),JSON['stringify'](_0x292a40));});})[_0xfe14('0x38')](function(_0x3a0086){logger['error'](_0x41e3f1[_0xfe14('0x22')],_0xfe14('0x3b'),JSON[_0xfe14('0x3c')](_0x3a0086));});});}logger[_0xfe14('0x25')](_0x41e3f1[_0xfe14('0x22')],_0xfe14('0x3b'));}};Fax[_0xfe14('0x20')][_0xfe14('0x1f')]=function(_0x43ce78){if(this[_0xfe14('0x27')][_0x43ce78[_0xfe14('0x22')]]){_[_0xfe14('0x3d')](this[_0xfe14('0xe')][_0x43ce78[_0xfe14('0x22')]],_['pick'](_0x43ce78,[_0xfe14('0x3e'),_0xfe14('0x3f')]));}};function updateStatus(_0x35a6d2){if(_0x35a6d2['AttachmentId']){faxMessage[_0xfe14('0x40')](_0x35a6d2[_0xfe14('0x41')],{'failMessage':_0xfe14('0x42')})['then'](function(_0x23c897){ut[_0xfe14('0x43')](_0xfe14('0x44'),_0x23c897);})['catch'](function(_0x24ecb4){ut[_0xfe14('0x43')](_0xfe14('0x45'),_0x24ecb4);});}else{ut[_0xfe14('0x43')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xfe14('0x20')][_0xfe14('0x46')]=function(_0x50ef37,_0x4b47ea,_0x44ec3c){var _0x40f437=this;var _0x477018={};if(_0x4b47ea){_0x477018={'read':_0x4b47ea};}else{_0x477018={'failMessage':_0x44ec3c};}if(this[_0xfe14('0x27')][_0x50ef37]['AttachmentId']){faxMessage[_0xfe14('0x40')](this['actions'][_0x50ef37][_0xfe14('0x41')],_0x477018)[_0xfe14('0x47')](function(_0x538b36){ut['logger'](_0xfe14('0x48'),_0x538b36);})['catch'](function(_0xc7a491){ut['logger']('[Fax][Message][NoUpdate1]',_0xc7a491);})[_0xfe14('0x49')](function(){delete _0x40f437['channels'][_0x50ef37];delete _0x40f437[_0xfe14('0x27')][_0x50ef37];});}else{ut[_0xfe14('0x43')](_0xfe14('0x4a'));delete this[_0xfe14('0xe')][_0x50ef37];delete this['actions'][_0x50ef37];}};Fax[_0xfe14('0x20')]['syncHangup']=function(_0x4709ba){var _0x3306e9=this;if(this[_0xfe14('0xe')][_0x4709ba['uniqueid']]){if(this[_0xfe14('0x27')][_0x4709ba[_0xfe14('0x22')]]){this[_0xfe14('0xe')][_0x4709ba['uniqueid']]['id']=this[_0xfe14('0x27')][_0x4709ba['uniqueid']]['id'];this['channels'][_0x4709ba[_0xfe14('0x22')]][_0xfe14('0x24')]=this['actions'][_0x4709ba['uniqueid']][_0xfe14('0x24')];}logger[_0xfe14('0x25')](_0x4709ba[_0xfe14('0x22')],this[_0xfe14('0x27')][_0x4709ba[_0xfe14('0x22')]]?_0xfe14('0x4b'):_0xfe14('0x4c'),JSON['stringify'](this['channels'][_0x4709ba[_0xfe14('0x22')]]));if(this[_0xfe14('0x27')][_0x4709ba['uniqueid']]){if(this[_0xfe14('0xe')][_0x4709ba[_0xfe14('0x22')]][_0xfe14('0x4d')]>0x0&&this[_0xfe14('0xe')][_0x4709ba[_0xfe14('0x22')]]['faxstatus']===_0xfe14('0x4e')){this[_0xfe14('0x46')](_0x4709ba[_0xfe14('0x22')],!![]);}else{this[_0xfe14('0x46')](_0x4709ba[_0xfe14('0x22')],![],this[_0xfe14('0xe')][_0x4709ba[_0xfe14('0x22')]][_0xfe14('0x4f')]?_0xfe14('0x50')+this[_0xfe14('0xe')][_0x4709ba[_0xfe14('0x22')]][_0xfe14('0x4f')]:_0xfe14('0x51'));}}}};Fax[_0xfe14('0x20')][_0xfe14('0x52')]=function(_0x2ddf82){var _0x5484de=this;return new BPromise(function(_0x486689,_0x594f1e){_0x5484de[_0xfe14('0x53')](_0x2ddf82,_0x5484de['faxAccounts'][_0x2ddf82[_0xfe14('0x54')]])[_0xfe14('0x47')](function(_0x5a7e0b){ut[_0xfe14('0x43')](_0xfe14('0x55'),_0x5a7e0b);_0x486689(ut[_0xfe14('0x56')](_0xfe14('0x57')));})[_0xfe14('0x38')](function(_0xaa46c3){ut[_0xfe14('0x43')](_0xfe14('0x58'),_0xaa46c3);updateStatus(_0x2ddf82);_0x594f1e(ut[_0xfe14('0x56')](_0xfe14('0x59')));});});};Fax[_0xfe14('0x20')][_0xfe14('0x5a')]=function(_0x52fdd9){var _0x27938a=this;return new BPromise(function(_0x5ad3c1,_0x3702a2){var _0x513678=_0x27938a['checkTrunk'](_0x27938a['faxAccounts'][_0x52fdd9[_0xfe14('0x54')]][_0xfe14('0x5b')],_0x52fdd9);if(_0x513678[_0xfe14('0x5c')]){_0x5ad3c1(ut[_0xfe14('0x56')]('Trunk\x20Reachable'));}else{_0x3702a2(ut[_0xfe14('0x56')](_0x513678[_0xfe14('0x56')]));}});};function originate(_0x18fe9c,_0x231c00,_0x59cb5c){return new BPromise(function(_0x272e42,_0xbe755c){if(_0x59cb5c){var _0x8ace98=util['format'](_0xfe14('0x5d'),path[_0xfe14('0x36')](_0x18fe9c[_0xfe14('0x5')])[_0xfe14('0x24')],_0x18fe9c[_0xfe14('0x5')]);gs['execute'](_0x8ace98)[_0xfe14('0x47')](function(){_0x18fe9c['path']=util['format'](_0xfe14('0x5e'),path[_0xfe14('0x36')](_0x18fe9c['path'])[_0xfe14('0x5f')],path[_0xfe14('0x36')](_0x18fe9c['path'])['name']);_0x231c00[_0xfe14('0x60')]=_0x18fe9c['path'];ut[_0xfe14('0x43')]('Convert\x20pdf\x20to\x20tif','');ami['Action'](ut[_0xfe14('0x61')](_0x18fe9c,_0x231c00))[_0xfe14('0x47')](function(_0x4c55ef){_0x272e42(_0x4c55ef);})[_0xfe14('0x38')](function(_0x29e55e){_0xbe755c(_0x29e55e);});})[_0xfe14('0x38')](function(_0x52a0fe){_0xbe755c(_0x52a0fe);});}else{ami[_0xfe14('0x62')](ut[_0xfe14('0x61')](_0x18fe9c,_0x231c00))['then'](function(_0x120027){_0x272e42(_0x120027);})[_0xfe14('0x38')](function(_0x579bb7){_0xbe755c(_0x579bb7);});}});}Fax[_0xfe14('0x20')][_0xfe14('0x53')]=function(_0x46ab32,_0x2ce00c){var _0xcbe2c0=this;return new BPromise(function(_0xd91d51,_0x5bd725){var _0x510853=uuid['v4']();var _0x2f6017=ut[_0xfe14('0x63')](_0x46ab32,_0x2ce00c);_0xcbe2c0['actions'][_0x510853]=new Action(_0x510853,_0x2ce00c,_0x46ab32);var _0x33097c=_0xcbe2c0[_0xfe14('0x27')][_0x510853];if(path['parse'](_0x46ab32[_0xfe14('0x5')])[_0xfe14('0x64')]===_0xfe14('0x37')){originate(_0x33097c,_0x2f6017,!![])[_0xfe14('0x47')](function(_0x46d3c7){_0xd91d51(_0x46d3c7);})[_0xfe14('0x38')](function(_0x29e238){_0x5bd725(_0x29e238);});}else{originate(_0x33097c,_0x2f6017,![])[_0xfe14('0x47')](function(_0x50bb92){_0xd91d51(_0x50bb92);})[_0xfe14('0x38')](function(_0x90b8c9){_0x5bd725(_0x90b8c9);});}});};Fax[_0xfe14('0x20')][_0xfe14('0x65')]=function(_0x53d655){return!_[_0xfe14('0x66')](_0x53d655)&&!_[_0xfe14('0x66')](_0x53d655[_0xfe14('0x24')])&&!_[_0xfe14('0x66')](_0x53d655[_0xfe14('0x67')])&&_0x53d655[_0xfe14('0x67')]&&!_[_0xfe14('0x66')](this[_0xfe14('0x10')][util[_0xfe14('0x68')](_0xfe14('0x69'),_0x53d655[_0xfe14('0x24')])])&&!_[_0xfe14('0x66')](this['trunks'][util['format'](_0xfe14('0x69'),_0x53d655['name'])][_0xfe14('0x2d')])&&(this[_0xfe14('0x10')][util['format']('SIP/%s',_0x53d655[_0xfe14('0x24')])][_0xfe14('0x2d')]===_0xfe14('0x6a')||this[_0xfe14('0x10')][util[_0xfe14('0x68')](_0xfe14('0x69'),_0x53d655[_0xfe14('0x24')])][_0xfe14('0x2d')]==='unmonitored');};Fax['prototype']['checkTrunk']=function(_0x11be97,_0x4a472e){if(!this[_0xfe14('0x65')](_0x11be97)){ut['logger'](_0xfe14('0x6b'),_[_0xfe14('0x66')](_0x11be97)?'':_0x11be97[_0xfe14('0x24')]+_0xfe14('0x6c'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_['isNil'](_0x4a472e[_0xfe14('0x7')])){ut[_0xfe14('0x43')](_0xfe14('0x6d'),JSON[_0xfe14('0x3c')](_0x4a472e));return{'isValid':![],'message':_0xfe14('0x6e')};}if(_[_0xfe14('0x66')](_0x4a472e[_0xfe14('0x5')])){ut[_0xfe14('0x43')](_0xfe14('0x6f'),JSON[_0xfe14('0x3c')](_0x4a472e));return{'isValid':![],'message':_0xfe14('0x70')};}return{'isValid':!![],'message':_0xfe14('0x71')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 91c5c3c..b4955f8 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 _0xd8d8=['resolve','then','catch','util','bluebird','lodash','../rpc/faxAccount','error','inspect','notify'];(function(_0x1a19f5,_0x3065f3){var _0xd78eb4=function(_0x1279ee){while(--_0x1279ee){_0x1a19f5['push'](_0x1a19f5['shift']());}};_0xd78eb4(++_0x3065f3);}(_0xd8d8,0xf3));var _0x8d8d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd8d8[_0x17d9e3];return _0x14192d;};'use strict';var util=require(_0x8d8d('0x0'));var BPromise=require(_0x8d8d('0x1'));var logger=require('../../../config/logger')('preview');var _=require(_0x8d8d('0x2'));var faxAccount=require(_0x8d8d('0x3'));function loggerCatch(_0x2caee2){return function(_0xf27684){logger[_0x8d8d('0x4')](_0x2caee2,util[_0x8d8d('0x5')](_0xf27684,{'showHidden':![],'depth':null}));};}exports[_0x8d8d('0x6')]=function(_0x8fabf9,_0x4c8197){return BPromise[_0x8d8d('0x7')]()[_0x8d8d('0x8')](faxAccount['notify'](_0x8fabf9,_0x4c8197))[_0x8d8d('0x9')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xa5dc=['[Notify]\x20','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','then','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa5dc,0x169));var _0xca5d=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xa5dc[_0x3c8e9a];return _0x2d4c57;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xca5d('0x0'))(_0xca5d('0x1'));var _=require(_0xca5d('0x2'));var faxAccount=require(_0xca5d('0x3'));function loggerCatch(_0x316f68){return function(_0xfad042){logger[_0xca5d('0x4')](_0x316f68,util[_0xca5d('0x5')](_0xfad042,{'showHidden':![],'depth':null}));};}exports[_0xca5d('0x6')]=function(_0x49a360,_0x112e96){return BPromise['resolve']()[_0xca5d('0x7')](faxAccount[_0xca5d('0x6')](_0x49a360,_0x112e96))[_0xca5d('0x8')](loggerCatch(_0xca5d('0x9')));}; \ 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 4600161..60255b5 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 _0x6dbd=['util','../../../../config/logger','fax','exec','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x4f103e,_0x284aaf){var _0x474b4d=function(_0x1448ae){while(--_0x1448ae){_0x4f103e['push'](_0x4f103e['shift']());}};_0x474b4d(++_0x284aaf);}(_0x6dbd,0xa0));var _0xd6db=function(_0x5da792,_0x2d44b4){_0x5da792=_0x5da792-0x0;var _0x49ae6d=_0x6dbd[_0x5da792];return _0x49ae6d;};'use strict';var util=require(_0xd6db('0x0'));var logger=require(_0xd6db('0x1'))(_0xd6db('0x2'));var BPromise=require('bluebird');var exec=require('child_process')[_0xd6db('0x3')];exports['execute']=function(_0x2841d){return new BPromise(function(_0x361312,_0x1b6285){exec(_0x2841d,function(_0x48692a,_0x298dc4,_0x2634f7){logger[_0xd6db('0x4')](_0xd6db('0x5'),_0x298dc4);if(_0x48692a){logger[_0xd6db('0x4')](_0xd6db('0x5'),_0xd6db('0x6'),util[_0xd6db('0x7')](_0x48692a,{'showHidden':![],'depth':null}),_0x298dc4,_0x2634f7);_0x1b6285(_0x48692a);}_0x361312(_0x298dc4);});});}; \ No newline at end of file +var _0x589f=['info','Exec\x20gs','\x20Error\x20:','util','fax','child_process','exec','execute'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0x589f,0x13b));var _0xf589=function(_0x21a7aa,_0x2248dc){_0x21a7aa=_0x21a7aa-0x0;var _0x20c622=_0x589f[_0x21a7aa];return _0x20c622;};'use strict';var util=require(_0xf589('0x0'));var logger=require('../../../../config/logger')(_0xf589('0x1'));var BPromise=require('bluebird');var exec=require(_0xf589('0x2'))[_0xf589('0x3')];exports[_0xf589('0x4')]=function(_0x22a44b){return new BPromise(function(_0x1f7170,_0x2a4c55){exec(_0x22a44b,function(_0x29ee62,_0x30b16c,_0x2b12ca){logger[_0xf589('0x5')](_0xf589('0x6'),_0x30b16c);if(_0x29ee62){logger[_0xf589('0x5')](_0xf589('0x6'),_0xf589('0x7'),util['inspect'](_0x29ee62,{'showHidden':![],'depth':null}),_0x30b16c,_0x2b12ca);_0x2a4c55(_0x29ee62);}_0x1f7170(_0x30b16c);});});}; \ 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 c245084..9d66e50 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 _0x9f27=['t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','ecm','headerinfo','maxrate','format','\x22%s\x22','gateway','faxdetect'];(function(_0x179c89,_0x3a69b2){var _0x4b87e5=function(_0xbdf6f2){while(--_0xbdf6f2){_0x179c89['push'](_0x179c89['shift']());}};_0x4b87e5(++_0x3a69b2);}(_0x9f27,0x1cc));var _0x79f2=function(_0x5d75ff,_0x5bc7ac){_0x5d75ff=_0x5d75ff-0x0;var _0x1c1894=_0x9f27[_0x5d75ff];return _0x1c1894;};'use strict';var util=require('util');var _=require(_0x79f2('0x0'));var moment=require(_0x79f2('0x1'));var logger=require(_0x79f2('0x2'))(_0x79f2('0x3'));exports[_0x79f2('0x4')]=function(_0x286b14){return{'message':_0x286b14};};exports[_0x79f2('0x5')]=function(_0x3912eb,_0x104541){logger[_0x79f2('0x6')](_0x3912eb,util[_0x79f2('0x7')](_0x104541,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x456b25,_0x299793){var _0x3a779b={'XMF-ECM':_0x299793[_0x79f2('0x8')],'XMF-HEADERINFO':_0x299793[_0x79f2('0x9')],'XMF-MINRATE':_0x299793['minrate'],'XMF-MAXRATE':_0x299793[_0x79f2('0xa')],'XMF-MODEM':util[_0x79f2('0xb')](_0x79f2('0xc'),_0x299793['modem']),'XMF-GATEWAY':_0x299793[_0x79f2('0xd')],'XMF-FAXDETECT':_0x299793[_0x79f2('0xe')],'XMF-T38TIMEOUT':_0x299793[_0x79f2('0xf')],'XMF-LOCALSTATIONID':_0x299793[_0x79f2('0x10')],'XMF-PATH':_0x456b25[_0x79f2('0x11')]};return _0x3a779b;};exports[_0x79f2('0x12')]=function(_0x2f45d1,_0x4ad26b){return{'actionid':_0x2f45d1[_0x79f2('0x13')],'action':_0x79f2('0x14'),'channel':_0x2f45d1[_0x79f2('0x15')],'Exten':_0x79f2('0x16'),'Context':_0x79f2('0x17'),'Priority':'1','callerid':util[_0x79f2('0xb')](_0x79f2('0x18'),_0x2f45d1[_0x79f2('0x9')]?_0x2f45d1[_0x79f2('0x9')]:'',_0x2f45d1[_0x79f2('0x10')]),'variable':_0x4ad26b,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2f45d1['uniqueid']};}; \ No newline at end of file +var _0x8a66=['uniqueid','util','lodash','../../../../config/logger','message','logger','info','addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','gateway','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','format'];(function(_0x36d754,_0x573330){var _0xfff8bd=function(_0x5aca27){while(--_0x5aca27){_0x36d754['push'](_0x36d754['shift']());}};_0xfff8bd(++_0x573330);}(_0x8a66,0x1e1));var _0x68a6=function(_0x5d4876,_0x11e6b0){_0x5d4876=_0x5d4876-0x0;var _0x6927ac=_0x8a66[_0x5d4876];return _0x6927ac;};'use strict';var util=require(_0x68a6('0x0'));var _=require(_0x68a6('0x1'));var moment=require('moment');var logger=require(_0x68a6('0x2'))('fax');exports[_0x68a6('0x3')]=function(_0x3215b8){return{'message':_0x3215b8};};exports[_0x68a6('0x4')]=function(_0x40d25b,_0x41561a){logger[_0x68a6('0x5')](_0x40d25b,util['inspect'](_0x41561a,{'showHidden':![],'depth':null}));};exports[_0x68a6('0x6')]=function(_0x205704,_0x3ad8af){var _0x3d9a14={'XMF-ECM':_0x3ad8af[_0x68a6('0x7')],'XMF-HEADERINFO':_0x3ad8af[_0x68a6('0x8')],'XMF-MINRATE':_0x3ad8af[_0x68a6('0x9')],'XMF-MAXRATE':_0x3ad8af[_0x68a6('0xa')],'XMF-MODEM':util['format'](_0x68a6('0xb'),_0x3ad8af[_0x68a6('0xc')]),'XMF-GATEWAY':_0x3ad8af[_0x68a6('0xd')],'XMF-FAXDETECT':_0x3ad8af['faxdetect'],'XMF-T38TIMEOUT':_0x3ad8af[_0x68a6('0xe')],'XMF-LOCALSTATIONID':_0x3ad8af[_0x68a6('0xf')],'XMF-PATH':_0x205704[_0x68a6('0x10')]};return _0x3d9a14;};exports[_0x68a6('0x11')]=function(_0x18da0d,_0x5348a8){return{'actionid':_0x18da0d['uniqueid'],'action':_0x68a6('0x12'),'channel':_0x18da0d[_0x68a6('0x13')],'Exten':_0x68a6('0x14'),'Context':_0x68a6('0x15'),'Priority':'1','callerid':util[_0x68a6('0x16')]('\x22%s\x22\x20<%s>',_0x18da0d[_0x68a6('0x8')]?_0x18da0d[_0x68a6('0x8')]:'',_0x18da0d[_0x68a6('0xf')]),'variable':_0x5348a8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x18da0d[_0x68a6('0x17')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 5e57dd0..df813ec 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 _0x00c8=['ami','get','hour','resolve','then','getAgents','initAgents','initTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initZohoAccounts','getVtigerAccounts','getServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','inspect','listen','catch','util','./realtime','./report','./acw','./trigger','./dialer','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x00c8,0xe2));var _0x800c=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x00c8[_0x2aea9e];return _0x430b92;};'use strict';var util=require(_0x800c('0x0'));var moment=require('moment');var server=require('./server');var Realtime=require(_0x800c('0x1'));var Report=require(_0x800c('0x2'));var Acw=require(_0x800c('0x3'));var Trigger=require(_0x800c('0x4'));var Dialer=require(_0x800c('0x5'));var Preview=require('./preview');var Fax=require('./fax');var user=require(_0x800c('0x6'));var voiceQueue=require(_0x800c('0x7'));var voiceQueueReport=require(_0x800c('0x8'));var voiceCallReport=require(_0x800c('0x9'));var trunk=require(_0x800c('0xa'));var trigger=require(_0x800c('0xb'));var template=require(_0x800c('0xc'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x800c('0xd'));var salesforce=require(_0x800c('0xe'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x800c('0xf'));var desk=require(_0x800c('0x10'));var zoho=require(_0x800c('0x11'));var vtiger=require(_0x800c('0x12'));var freshsales=require(_0x800c('0x13'));var servicenow=require(_0x800c('0x14'));var dynamics365=require(_0x800c('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 logger=require('../../config/logger')(_0x800c('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x800c('0x17')](_0x800c('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x800c('0x17')](_0x800c('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x800c('0x19')]()[_0x800c('0x1a')](user[_0x800c('0x1b')]())[_0x800c('0x1a')](realtime[_0x800c('0x1c')]())[_0x800c('0x1a')](user['getTelephones']())[_0x800c('0x1a')](realtime[_0x800c('0x1d')]())[_0x800c('0x1a')](trunk[_0x800c('0x1e')]())[_0x800c('0x1a')](realtime[_0x800c('0x1f')]())['then'](voiceQueue['getVoiceQueues']())[_0x800c('0x1a')](realtime[_0x800c('0x20')]())['then'](trigger[_0x800c('0x21')]())[_0x800c('0x1a')](realtime[_0x800c('0x22')]())[_0x800c('0x1a')](template[_0x800c('0x23')]())[_0x800c('0x1a')](realtime['initTemplates']())[_0x800c('0x1a')](zendesk[_0x800c('0x24')]())[_0x800c('0x1a')](realtime['initZendeskAccounts']())[_0x800c('0x1a')](salesforce[_0x800c('0x25')]())['then'](realtime[_0x800c('0x26')]())['then'](sugarcrm[_0x800c('0x27')]())[_0x800c('0x1a')](realtime[_0x800c('0x28')]())[_0x800c('0x1a')](freshdesk[_0x800c('0x29')]())[_0x800c('0x1a')](realtime[_0x800c('0x2a')]())[_0x800c('0x1a')](desk['getDeskAccounts']())['then'](realtime['initDeskAccounts']())[_0x800c('0x1a')](zoho['getZohoAccounts']())[_0x800c('0x1a')](realtime[_0x800c('0x2b')]())[_0x800c('0x1a')](vtiger[_0x800c('0x2c')]())[_0x800c('0x1a')](realtime['initVtigerAccounts']())['then'](freshsales['getFreshsalesAccounts']())[_0x800c('0x1a')](realtime['initFreshsalesAccounts']())[_0x800c('0x1a')](servicenow[_0x800c('0x2d')]())[_0x800c('0x1a')](realtime['initServicenowAccounts']())[_0x800c('0x1a')](dynamics365['getDynamics365Accounts']())[_0x800c('0x1a')](realtime[_0x800c('0x2e')]())[_0x800c('0x1a')](campaign[_0x800c('0x2f')]())[_0x800c('0x1a')](realtime[_0x800c('0x30')]())[_0x800c('0x1a')](voiceExtension[_0x800c('0x31')]())[_0x800c('0x1a')](realtime[_0x800c('0x32')]())[_0x800c('0x1a')](faxAccount['getFaxAccounts']())['then'](realtime[_0x800c('0x33')]())[_0x800c('0x1a')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x800c('0x1a')](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0x800c('0x34')]())[_0x800c('0x1a')](cmHopperHistory[_0x800c('0x35')]())[_0x800c('0x1a')](realtime[_0x800c('0x36')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0x800c('0x1a')](realtime[_0x800c('0x37')]())['then'](voiceCallReport[_0x800c('0x38')]())[_0x800c('0x1a')](realtime[_0x800c('0x39')]())['catch'](function(_0x286022){logger[_0x800c('0x3a')]('[index.js][initParams]',util[_0x800c('0x3b')](_0x286022,{'showHidden':![],'depth':null}));});}function main(){return server[_0x800c('0x3c')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x800c('0x1a')](function(){return initParams();})[_0x800c('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x800c('0x3d')](function(_0x1c2b43){logger[_0x800c('0x3a')]('[index.js][main]',util[_0x800c('0x3b')](_0x1c2b43,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x2e77=['getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','inspect','listen','moment','./server','./acw','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','getAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initTemplates','getZendeskAccounts','initZendeskAccounts'];(function(_0x16bb5a,_0x33c482){var _0x4f4103=function(_0x198e4d){while(--_0x198e4d){_0x16bb5a['push'](_0x16bb5a['shift']());}};_0x4f4103(++_0x33c482);}(_0x2e77,0x1e3));var _0x72e7=function(_0x585ac4,_0x2c3b3e){_0x585ac4=_0x585ac4-0x0;var _0x48d2bd=_0x2e77[_0x585ac4];return _0x48d2bd;};'use strict';var util=require('util');var moment=require(_0x72e7('0x0'));var server=require(_0x72e7('0x1'));var Realtime=require('./realtime');var Report=require('./report');var Acw=require(_0x72e7('0x2'));var Trigger=require('./trigger');var Dialer=require(_0x72e7('0x3'));var Preview=require(_0x72e7('0x4'));var Fax=require('./fax');var user=require(_0x72e7('0x5'));var voiceQueue=require(_0x72e7('0x6'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x72e7('0x7'));var trunk=require(_0x72e7('0x8'));var trigger=require(_0x72e7('0x9'));var template=require(_0x72e7('0xa'));var cmHopperHistory=require(_0x72e7('0xb'));var campaign=require(_0x72e7('0xc'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x72e7('0xd'));var salesforce=require(_0x72e7('0xe'));var sugarcrm=require(_0x72e7('0xf'));var freshdesk=require(_0x72e7('0x10'));var desk=require(_0x72e7('0x11'));var zoho=require(_0x72e7('0x12'));var vtiger=require(_0x72e7('0x13'));var freshsales=require(_0x72e7('0x14'));var servicenow=require(_0x72e7('0x15'));var dynamics365=require(_0x72e7('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x72e7('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x72e7('0x18')](_0x72e7('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x72e7('0x18')](_0x72e7('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x72e7('0x1a')]()[_0x72e7('0x1b')](user[_0x72e7('0x1c')]())[_0x72e7('0x1b')](realtime['initAgents']())[_0x72e7('0x1b')](user[_0x72e7('0x1d')]())['then'](realtime[_0x72e7('0x1e')]())[_0x72e7('0x1b')](trunk[_0x72e7('0x1f')]())[_0x72e7('0x1b')](realtime[_0x72e7('0x20')]())[_0x72e7('0x1b')](voiceQueue[_0x72e7('0x21')]())[_0x72e7('0x1b')](realtime['initVoiceQueues']())[_0x72e7('0x1b')](trigger['getTriggers']())[_0x72e7('0x1b')](realtime['initTriggers']())[_0x72e7('0x1b')](template['getTemplates']())[_0x72e7('0x1b')](realtime[_0x72e7('0x22')]())[_0x72e7('0x1b')](zendesk[_0x72e7('0x23')]())[_0x72e7('0x1b')](realtime[_0x72e7('0x24')]())['then'](salesforce[_0x72e7('0x25')]())[_0x72e7('0x1b')](realtime[_0x72e7('0x26')]())['then'](sugarcrm[_0x72e7('0x27')]())[_0x72e7('0x1b')](realtime[_0x72e7('0x28')]())[_0x72e7('0x1b')](freshdesk[_0x72e7('0x29')]())['then'](realtime[_0x72e7('0x2a')]())['then'](desk[_0x72e7('0x2b')]())[_0x72e7('0x1b')](realtime[_0x72e7('0x2c')]())[_0x72e7('0x1b')](zoho[_0x72e7('0x2d')]())['then'](realtime[_0x72e7('0x2e')]())['then'](vtiger[_0x72e7('0x2f')]())[_0x72e7('0x1b')](realtime['initVtigerAccounts']())[_0x72e7('0x1b')](freshsales[_0x72e7('0x30')]())[_0x72e7('0x1b')](realtime[_0x72e7('0x31')]())[_0x72e7('0x1b')](servicenow[_0x72e7('0x32')]())[_0x72e7('0x1b')](realtime['initServicenowAccounts']())[_0x72e7('0x1b')](dynamics365[_0x72e7('0x33')]())[_0x72e7('0x1b')](realtime[_0x72e7('0x34')]())['then'](campaign[_0x72e7('0x35')]())[_0x72e7('0x1b')](realtime['initCampaigns']())[_0x72e7('0x1b')](voiceExtension['getVoiceExtensions']())[_0x72e7('0x1b')](realtime[_0x72e7('0x36')]())[_0x72e7('0x1b')](faxAccount[_0x72e7('0x37')]())[_0x72e7('0x1b')](realtime[_0x72e7('0x38')]())[_0x72e7('0x1b')](function(){return realtime;});}function initParams(){return Promise[_0x72e7('0x1a')]()[_0x72e7('0x1b')](voiceQueueReport['getVoiceQueueReports']())[_0x72e7('0x1b')](realtime[_0x72e7('0x39')]())[_0x72e7('0x1b')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime['initVoiceQueueHopperHistory']())[_0x72e7('0x1b')](cmHopperHistory[_0x72e7('0x3a')]())[_0x72e7('0x1b')](realtime['initCampaignHopperHistory']())[_0x72e7('0x1b')](voiceCallReport[_0x72e7('0x3b')]())[_0x72e7('0x1b')](realtime[_0x72e7('0x3c')]())[_0x72e7('0x3d')](function(_0x39fbdd){logger[_0x72e7('0x3e')]('[index.js][initParams]',util[_0x72e7('0x3f')](_0x39fbdd,{'showHidden':![],'depth':null}));});}function main(){return server[_0x72e7('0x40')](realtime,preview,fax)[_0x72e7('0x1b')](function(){return initRealtime();})[_0x72e7('0x1b')](function(){return initParams();})[_0x72e7('0x1b')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x72e7('0x3d')](function(_0x5ae357){logger[_0x72e7('0x3e')]('[index.js][main]',util[_0x72e7('0x3f')](_0x5ae357,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 3370506..382029d 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 _0x29aa=['status','unknown','address','mobile','interface','online','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','not_inuse','idle','inuse','talking','voiceStatus','statePause','voiceStatusTime','toNumber','format','accountcode','stateTime','name','emit','omit','user:presence','lodash','moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','email','fullname','state'];(function(_0x46ab02,_0x46f430){var _0x39d9a4=function(_0x6ec26a){while(--_0x6ec26a){_0x46ab02['push'](_0x46ab02['shift']());}};_0x39d9a4(++_0x46f430);}(_0x29aa,0xb3));var _0xa29a=function(_0x3da3fb,_0x3b8934){_0x3da3fb=_0x3da3fb-0x0;var _0x54979c=_0x29aa[_0x3da3fb];return _0x54979c;};'use strict';var _=require(_0xa29a('0x0'));var util=require('util');var moment=require(_0xa29a('0x1'));var md5=require(_0xa29a('0x2'));var Redis=require(_0xa29a('0x3'));var config=require('../../../config/environment');config[_0xa29a('0x4')]=_[_0xa29a('0x5')](config[_0xa29a('0x4')],{'host':_0xa29a('0x6'),'port':0x18eb});var io=require(_0xa29a('0x7'))(new Redis(config[_0xa29a('0x4')]));function Agent(_0x385b65){this['id']=_0x385b65['id']||0x0;this['name']=_0x385b65['name']||'';this[_0xa29a('0x8')]=_0x385b65['email']||'';this['accountcode']=_0x385b65['accountcode']||'';this[_0xa29a('0x9')]=_0x385b65[_0xa29a('0x9')]||'';this[_0xa29a('0xa')]='unknown';this['stateTime']=0x0;this[_0xa29a('0xb')]=_0xa29a('0xc');this[_0xa29a('0xd')]='';this['phone']='';this[_0xa29a('0xe')]='';this[_0xa29a('0xf')]='';this['online']=_0x385b65[_0xa29a('0x10')]||![];this['voiceStatus']='unknown';this['voiceStatusTime']=0x0;this[_0xa29a('0x11')]='';this[_0xa29a('0x12')]='';this[_0xa29a('0x13')]=![];this[_0xa29a('0x14')]=![];this['md5']='';}Agent[_0xa29a('0x15')][_0xa29a('0x16')]=function(_0xafbf5d){var _0x1d0b91;if(_0xafbf5d&&_0xafbf5d[_0xa29a('0xa')]){_0x1d0b91=_0xafbf5d[_0xa29a('0xa')]['toLowerCase']();switch(_0x1d0b91){case _0xa29a('0x17'):_0x1d0b91=_0xa29a('0x18');break;case _0xa29a('0x19'):_0x1d0b91=_0xa29a('0x1a');break;}}if(_0x1d0b91&&this[_0xa29a('0x1b')]!==_0x1d0b91||_0xafbf5d[_0xa29a('0x1c')]){this[_0xa29a('0x1d')]=_[_0xa29a('0x1e')](moment()[_0xa29a('0x1f')]('x'));}if(_0x1d0b91){this['voiceStatus']=_0x1d0b91;}var _0x11a698={'id':this['id'],'name':this['name'],'email':this['email'],'accountcode':this[_0xa29a('0x20')],'fullname':this[_0xa29a('0x9')],'state':this[_0xa29a('0xa')],'stateTime':this[_0xa29a('0x21')],'status':this[_0xa29a('0xb')],'address':this[_0xa29a('0xd')],'online':this['online'],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0xa29a('0x1d')],'voiceStatusCallerIdNumber':this[_0xa29a('0x11')],'voiceStatusQueue':this[_0xa29a('0x12')],'interface':this[_0xa29a('0xf')],'onhold':this[_0xa29a('0x13')]};var _0xe8752e=md5(JSON['stringify'](_0x11a698));if(this['md5']!==_0xe8752e){this['md5']=_0xe8752e;io['to'](util[_0xa29a('0x1f')]('user:%s',_0x11a698[_0xa29a('0x22')]))[_0xa29a('0x23')]('user:ami:update',_[_0xa29a('0x24')](_0x11a698,[_0xa29a('0x10')]));io['emit'](_0xa29a('0x25'),_0x11a698);}};module['exports']=Agent; \ No newline at end of file +var _0x07b1=['omit','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','email','accountcode','fullname','stateTime','status','unknown','phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','md5','prototype','updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','name','interface','stringify','format','emit'];(function(_0x4ef836,_0x31e02b){var _0x256a91=function(_0x10b7c4){while(--_0x10b7c4){_0x4ef836['push'](_0x4ef836['shift']());}};_0x256a91(++_0x31e02b);}(_0x07b1,0x79));var _0x107b=function(_0x51046c,_0x41f340){_0x51046c=_0x51046c-0x0;var _0x2a19c4=_0x07b1[_0x51046c];return _0x2a19c4;};'use strict';var _=require(_0x107b('0x0'));var util=require(_0x107b('0x1'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x107b('0x2'));var config=require(_0x107b('0x3'));config[_0x107b('0x4')]=_[_0x107b('0x5')](config[_0x107b('0x4')],{'host':_0x107b('0x6'),'port':0x18eb});var io=require(_0x107b('0x7'))(new Redis(config['redis']));function Agent(_0xf0f68f){this['id']=_0xf0f68f['id']||0x0;this['name']=_0xf0f68f['name']||'';this[_0x107b('0x8')]=_0xf0f68f[_0x107b('0x8')]||'';this[_0x107b('0x9')]=_0xf0f68f[_0x107b('0x9')]||'';this[_0x107b('0xa')]=_0xf0f68f[_0x107b('0xa')]||'';this['state']='unknown';this[_0x107b('0xb')]=0x0;this[_0x107b('0xc')]=_0x107b('0xd');this['address']='';this[_0x107b('0xe')]='';this[_0x107b('0xf')]='';this['interface']='';this[_0x107b('0x10')]=_0xf0f68f['online']||![];this[_0x107b('0x11')]=_0x107b('0xd');this[_0x107b('0x12')]=0x0;this[_0x107b('0x13')]='';this[_0x107b('0x14')]='';this[_0x107b('0x15')]=![];this[_0x107b('0x16')]=![];this[_0x107b('0x17')]='';}Agent[_0x107b('0x18')][_0x107b('0x19')]=function(_0x3da6a5){var _0x104b66;if(_0x3da6a5&&_0x3da6a5['state']){_0x104b66=_0x3da6a5[_0x107b('0x1a')][_0x107b('0x1b')]();switch(_0x104b66){case _0x107b('0x1c'):_0x104b66=_0x107b('0x1d');break;case _0x107b('0x1e'):_0x104b66=_0x107b('0x1f');break;}}if(_0x104b66&&this[_0x107b('0x11')]!==_0x104b66||_0x3da6a5[_0x107b('0x20')]){this[_0x107b('0x12')]=_[_0x107b('0x21')](moment()['format']('x'));}if(_0x104b66){this[_0x107b('0x11')]=_0x104b66;}var _0x5a8467={'id':this['id'],'name':this[_0x107b('0x22')],'email':this[_0x107b('0x8')],'accountcode':this[_0x107b('0x9')],'fullname':this['fullname'],'state':this['state'],'stateTime':this[_0x107b('0xb')],'status':this[_0x107b('0xc')],'address':this['address'],'online':this[_0x107b('0x10')],'voiceStatus':this[_0x107b('0x11')],'voiceStatusTime':this[_0x107b('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x107b('0x14')],'interface':this[_0x107b('0x23')],'onhold':this[_0x107b('0x15')]};var _0x13390d=md5(JSON[_0x107b('0x24')](_0x5a8467));if(this[_0x107b('0x17')]!==_0x13390d){this['md5']=_0x13390d;io['to'](util[_0x107b('0x25')]('user:%s',_0x5a8467[_0x107b('0x22')]))[_0x107b('0x26')]('user:ami:update',_[_0x107b('0x27')](_0x5a8467,[_0x107b('0x10')]));io['emit']('user:presence',_0x5a8467);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index c729162..6e10670 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 _0xc79b=['dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency'];(function(_0x1fe337,_0x3a509c){var _0x1e5f6c=function(_0x569d93){while(--_0x569d93){_0x1fe337['push'](_0x1fe337['shift']());}};_0x1e5f6c(++_0x3a509c);}(_0xc79b,0x1d1));var _0xbc79=function(_0x364aab,_0x23ee0d){_0x364aab=_0x364aab-0x0;var _0x174e4c=_0xc79b[_0x364aab];return _0x174e4c;};'use strict';function Campaign(_0x548b24){this['id']=_0x548b24['id']||0x0;this['name']=_0x548b24[_0xbc79('0x0')]||'';this[_0xbc79('0x1')]=_0x548b24[_0xbc79('0x1')]||_0xbc79('0x2');this['originated']=0x0;this[_0xbc79('0x3')]=0x0;this[_0xbc79('0x4')]=0x0;this[_0xbc79('0x5')]=0x0;this['message']='';this[_0xbc79('0x6')]=!![];this['active']=_0x548b24[_0xbc79('0x7')];this[_0xbc79('0x8')]=_0x548b24[_0xbc79('0x8')];this['dialTimezone']=_0x548b24[_0xbc79('0x9')]||null;this[_0xbc79('0xa')]=_0x548b24[_0xbc79('0xa')]?_0x548b24['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x548b24[_0xbc79('0xb')];this['dialOriginateCallerIdNumber']=_0x548b24[_0xbc79('0xc')];this[_0xbc79('0xd')]=_0x548b24[_0xbc79('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x548b24[_0xbc79('0xe')];this[_0xbc79('0xf')]=_0x548b24[_0xbc79('0xf')];this[_0xbc79('0x10')]=_0x548b24[_0xbc79('0x10')];this[_0xbc79('0x11')]=_0x548b24[_0xbc79('0x11')];this[_0xbc79('0x12')]=_0x548b24[_0xbc79('0x12')];this[_0xbc79('0x13')]=_0x548b24[_0xbc79('0x13')];this[_0xbc79('0x14')]=_0x548b24['dialGlobalMaxRetry'];this[_0xbc79('0x15')]=_0x548b24['dialNoSuchNumberMaxRetry']||0x3;this[_0xbc79('0x16')]=_0x548b24['dialNoSuchNumberRetryFrequency']||0x96;this[_0xbc79('0x17')]=_0x548b24[_0xbc79('0x17')]||0x3;this[_0xbc79('0x18')]=_0x548b24[_0xbc79('0x18')]||0x96;this[_0xbc79('0x19')]=_0x548b24['dialAbandonedMaxRetry']||0x3;this[_0xbc79('0x1a')]=_0x548b24[_0xbc79('0x1a')]||0x96;this[_0xbc79('0x1b')]=_0x548b24[_0xbc79('0x1b')]||0x3;this[_0xbc79('0x1c')]=_0x548b24[_0xbc79('0x1c')]||0x96;this[_0xbc79('0x1d')]=_0x548b24['dialAgentRejectMaxRetry']||0x3;this[_0xbc79('0x1e')]=_0x548b24['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x548b24[_0xbc79('0x1f')]||_0xbc79('0x20');this[_0xbc79('0x21')]=_0x548b24['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x548b24['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xbc79('0x22')]=_0x548b24[_0xbc79('0x22')]||undefined;this[_0xbc79('0x23')]=_0x548b24[_0xbc79('0x23')]?_0x548b24[_0xbc79('0x23')]:undefined;this[_0xbc79('0x24')]=_0x548b24[_0xbc79('0x24')]?_0x548b24['Trunk']:undefined;this['Interval']=_0x548b24[_0xbc79('0x25')]?_0x548b24[_0xbc79('0x25')]:undefined;this[_0xbc79('0x26')]=_0x548b24['SquareProject']?_0x548b24['SquareProject']:undefined;this['dialQueueProject']=_0x548b24[_0xbc79('0x26')]?_0x548b24['SquareProject'][_0xbc79('0x0')]:undefined;this['dialAMDActive']=_0x548b24[_0xbc79('0x27')]||![];this[_0xbc79('0x28')]=_0x548b24[_0xbc79('0x28')];this[_0xbc79('0x29')]=_0x548b24[_0xbc79('0x29')];this['dialAMDAfterGreetingSilence']=_0x548b24['dialAMDAfterGreetingSilence'];this[_0xbc79('0x2a')]=_0x548b24[_0xbc79('0x2a')];this[_0xbc79('0x2b')]=_0x548b24['dialAMDMinWordLength'];this[_0xbc79('0x2c')]=_0x548b24[_0xbc79('0x2c')];this[_0xbc79('0x2d')]=_0x548b24[_0xbc79('0x2d')];this[_0xbc79('0x2e')]=_0x548b24[_0xbc79('0x2e')];this[_0xbc79('0x2f')]=_0x548b24['dialAMDMaximumWordLength'];}module[_0xbc79('0x30')]=Campaign; \ No newline at end of file +var _0x5c9c=['ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp'];(function(_0x364a57,_0x2e1b62){var _0x49fd2b=function(_0x10d7ba){while(--_0x10d7ba){_0x364a57['push'](_0x364a57['shift']());}};_0x49fd2b(++_0x2e1b62);}(_0x5c9c,0x16c));var _0xc5c9=function(_0xd5cf5a,_0xaaf828){_0xd5cf5a=_0xd5cf5a-0x0;var _0x21053a=_0x5c9c[_0xd5cf5a];return _0x21053a;};'use strict';function Campaign(_0x231623){this['id']=_0x231623['id']||0x0;this[_0xc5c9('0x0')]=_0x231623[_0xc5c9('0x0')]||'';this[_0xc5c9('0x1')]=_0x231623[_0xc5c9('0x1')]||_0xc5c9('0x2');this['originated']=0x0;this[_0xc5c9('0x3')]=0x0;this[_0xc5c9('0x4')]=0x0;this[_0xc5c9('0x5')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0xc5c9('0x6')]=_0x231623[_0xc5c9('0x6')];this[_0xc5c9('0x7')]=_0x231623['limitCalls'];this[_0xc5c9('0x8')]=_0x231623['dialTimezone']||null;this[_0xc5c9('0x9')]=_0x231623[_0xc5c9('0x9')]?_0x231623[_0xc5c9('0x9')]:null;this[_0xc5c9('0xa')]=_0x231623['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x231623[_0xc5c9('0xb')];this['dialOriginateTimeout']=_0x231623['dialOriginateTimeout']||0x1e;this[_0xc5c9('0xc')]=_0x231623[_0xc5c9('0xc')];this[_0xc5c9('0xd')]=_0x231623['dialCongestionRetryFrequency'];this[_0xc5c9('0xe')]=_0x231623['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x231623[_0xc5c9('0xf')];this[_0xc5c9('0x10')]=_0x231623[_0xc5c9('0x10')];this[_0xc5c9('0x11')]=_0x231623['dialNoAnswerRetryFrequency'];this[_0xc5c9('0x12')]=_0x231623[_0xc5c9('0x12')];this['dialNoSuchNumberMaxRetry']=_0x231623['dialNoSuchNumberMaxRetry']||0x3;this[_0xc5c9('0x13')]=_0x231623[_0xc5c9('0x13')]||0x96;this[_0xc5c9('0x14')]=_0x231623[_0xc5c9('0x14')]||0x3;this['dialDropRetryFrequency']=_0x231623['dialDropRetryFrequency']||0x96;this[_0xc5c9('0x15')]=_0x231623['dialAbandonedMaxRetry']||0x3;this[_0xc5c9('0x16')]=_0x231623[_0xc5c9('0x16')]||0x96;this['dialMachineMaxRetry']=_0x231623['dialMachineMaxRetry']||0x3;this[_0xc5c9('0x17')]=_0x231623['dialMachineRetryFrequency']||0x96;this[_0xc5c9('0x18')]=_0x231623['dialAgentRejectMaxRetry']||0x3;this[_0xc5c9('0x19')]=_0x231623[_0xc5c9('0x19')]||0x96;this[_0xc5c9('0x1a')]=_0x231623[_0xc5c9('0x1a')]||'DESC';this[_0xc5c9('0x1b')]=_0x231623['dialPrefix']||undefined;this[_0xc5c9('0x1c')]=_0x231623['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xc5c9('0x1d')]=_0x231623[_0xc5c9('0x1d')]||undefined;this[_0xc5c9('0x1e')]=_0x231623[_0xc5c9('0x1e')]?_0x231623[_0xc5c9('0x1e')]:undefined;this[_0xc5c9('0x1f')]=_0x231623[_0xc5c9('0x1f')]?_0x231623[_0xc5c9('0x1f')]:undefined;this[_0xc5c9('0x20')]=_0x231623[_0xc5c9('0x20')]?_0x231623[_0xc5c9('0x20')]:undefined;this['SquareProject']=_0x231623[_0xc5c9('0x21')]?_0x231623[_0xc5c9('0x21')]:undefined;this[_0xc5c9('0x22')]=_0x231623['SquareProject']?_0x231623[_0xc5c9('0x21')]['name']:undefined;this['dialAMDActive']=_0x231623[_0xc5c9('0x23')]||![];this[_0xc5c9('0x24')]=_0x231623[_0xc5c9('0x24')];this['dialAMDGreeting']=_0x231623[_0xc5c9('0x25')];this['dialAMDAfterGreetingSilence']=_0x231623[_0xc5c9('0x26')];this[_0xc5c9('0x27')]=_0x231623[_0xc5c9('0x27')];this[_0xc5c9('0x28')]=_0x231623[_0xc5c9('0x28')];this[_0xc5c9('0x29')]=_0x231623[_0xc5c9('0x29')];this[_0xc5c9('0x2a')]=_0x231623[_0xc5c9('0x2a')];this[_0xc5c9('0x2b')]=_0x231623['dialAMDSilenceThreshold'];this[_0xc5c9('0x2c')]=_0x231623[_0xc5c9('0x2c')];}module[_0xc5c9('0x2d')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 054821b..345d5f5 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 _0xaf60=['queue','transferconnectedlinenum','transferType','mohtime','starttime','channel','destinationchannel','connectedlinenum','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','duration','billableseconds','holdtime','monitor'];(function(_0x4e6e72,_0x74bc7){var _0x33c203=function(_0x2169ea){while(--_0x2169ea){_0x4e6e72['push'](_0x4e6e72['shift']());}};_0x33c203(++_0x74bc7);}(_0xaf60,0x82));var _0x0af6=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xaf60[_0xbca1b1];return _0x4e1686;};'use strict';function Channel(){this[_0x0af6('0x0')]=null;this[_0x0af6('0x1')]='';this[_0x0af6('0x2')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0x0af6('0x3')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x0af6('0x4')]='';this[_0x0af6('0x5')]=0x0;this[_0x0af6('0x6')]=0x0;this[_0x0af6('0x7')]=0x0;this[_0x0af6('0x8')]=![];this[_0x0af6('0x9')]=null;this[_0x0af6('0xa')]=null;this['unmanaged']=![];this[_0x0af6('0xb')]=![];this[_0x0af6('0xc')]='';this['lastdata']='';this[_0x0af6('0xd')]=0x0;this[_0x0af6('0xe')]=0x0;this[_0x0af6('0xf')]=0x0;this['type']=null;this['tag']=null;this['disposition']=null;this[_0x0af6('0x10')]=![];this['monitorFilename']=null;this[_0x0af6('0x11')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0x0af6('0x12')]=undefined;this[_0x0af6('0x13')]=undefined;this[_0x0af6('0x14')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x41fa=['transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answered','endtime','unmanaged','abandoned','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitor','queue','monitors'];(function(_0x4a2b57,_0x31879c){var _0x2e65a1=function(_0x318a55){while(--_0x318a55){_0x4a2b57['push'](_0x4a2b57['shift']());}};_0x2e65a1(++_0x31879c);}(_0x41fa,0x1f1));var _0xa41f=function(_0x13cab0,_0x14d825){_0x13cab0=_0x13cab0-0x0;var _0x38804f=_0x41fa[_0x13cab0];return _0x38804f;};'use strict';function Channel(){this[_0xa41f('0x0')]=null;this[_0xa41f('0x1')]='';this[_0xa41f('0x2')]='';this[_0xa41f('0x3')]=0x0;this[_0xa41f('0x4')]='';this[_0xa41f('0x5')]=undefined;this['connectedlinename']=undefined;this[_0xa41f('0x6')]=0x0;this[_0xa41f('0x7')]='';this[_0xa41f('0x8')]=0x0;this[_0xa41f('0x9')]=0x0;this[_0xa41f('0xa')]=0x0;this[_0xa41f('0xb')]=![];this['answertime']=null;this[_0xa41f('0xc')]=null;this[_0xa41f('0xd')]=![];this[_0xa41f('0xe')]=![];this['lastapplication']='';this[_0xa41f('0xf')]='';this[_0xa41f('0x10')]=0x0;this[_0xa41f('0x11')]=0x0;this[_0xa41f('0x12')]=0x0;this[_0xa41f('0x13')]=null;this[_0xa41f('0x14')]=null;this[_0xa41f('0x15')]=null;this[_0xa41f('0x16')]=![];this['monitorFilename']=null;this[_0xa41f('0x17')]=null;this[_0xa41f('0x18')]=[];this[_0xa41f('0x19')]=undefined;this[_0xa41f('0x1a')]=undefined;this['transferType']=undefined;this[_0xa41f('0x1b')]=0x0;}module[_0xa41f('0x1c')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index b4090d9..16ce6b4 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 _0xe642=['authType','password','consumerKey','consumerSecret','token','tokenSecret','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x4315f1,_0x3923ab){var _0x246e32=function(_0x3c0739){while(--_0x3c0739){_0x4315f1['push'](_0x4315f1['shift']());}};_0x246e32(++_0x3923ab);}(_0xe642,0x81));var _0x2e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe642[_0x3dd15e];return _0x231fd0;};'use strict';function DeskAccount(_0x5cf93a){this['id']=_0x5cf93a['id']||0x0;this[_0x2e64('0x0')]=_0x5cf93a[_0x2e64('0x0')]||'';this[_0x2e64('0x1')]=_0x5cf93a[_0x2e64('0x1')]||'';this[_0x2e64('0x2')]=_0x5cf93a[_0x2e64('0x2')]||'';this[_0x2e64('0x3')]=_0x5cf93a[_0x2e64('0x3')]||'';this[_0x2e64('0x4')]=_0x5cf93a[_0x2e64('0x4')]||'';this[_0x2e64('0x5')]=_0x5cf93a[_0x2e64('0x5')]||'';this[_0x2e64('0x6')]=_0x5cf93a[_0x2e64('0x6')]||'';this[_0x2e64('0x7')]=_0x5cf93a[_0x2e64('0x7')]||'';this[_0x2e64('0x8')]=_0x5cf93a[_0x2e64('0x8')]||'';this['type']=_0x5cf93a['type']||'';this[_0x2e64('0x9')]=_0x5cf93a['serverUrl']||'';this['Configurations']=_0x5cf93a[_0x2e64('0xa')]||{};}module[_0x2e64('0xb')]=DeskAccount; \ No newline at end of file +var _0x335c=['username','remoteUri','authType','password','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name'];(function(_0x1c3dcf,_0x2bab00){var _0x343dc1=function(_0x16d4b6){while(--_0x16d4b6){_0x1c3dcf['push'](_0x1c3dcf['shift']());}};_0x343dc1(++_0x2bab00);}(_0x335c,0x1a3));var _0xc335=function(_0x17699f,_0x5981af){_0x17699f=_0x17699f-0x0;var _0x190a6b=_0x335c[_0x17699f];return _0x190a6b;};'use strict';function DeskAccount(_0x1c825b){this['id']=_0x1c825b['id']||0x0;this[_0xc335('0x0')]=_0x1c825b['name']||'';this[_0xc335('0x1')]=_0x1c825b['username']||'';this[_0xc335('0x2')]=_0x1c825b[_0xc335('0x2')]||'';this[_0xc335('0x3')]=_0x1c825b['authType']||'';this['password']=_0x1c825b[_0xc335('0x4')]||'';this['consumerKey']=_0x1c825b['consumerKey']||'';this[_0xc335('0x5')]=_0x1c825b[_0xc335('0x5')]||'';this[_0xc335('0x6')]=_0x1c825b[_0xc335('0x6')]||'';this[_0xc335('0x7')]=_0x1c825b[_0xc335('0x7')]||'';this[_0xc335('0x8')]=_0x1c825b[_0xc335('0x8')]||'';this[_0xc335('0x9')]=_0x1c825b[_0xc335('0x9')]||'';this['Configurations']=_0x1c825b[_0xc335('0xa')]||{};}module[_0xc335('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index c484bed..b09620d 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 _0x49ff=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x399a7a,_0x320a23){var _0xc13f40=function(_0x25fb99){while(--_0x25fb99){_0x399a7a['push'](_0x399a7a['shift']());}};_0xc13f40(++_0x320a23);}(_0x49ff,0xe5));var _0xf49f=function(_0x4af3e7,_0x526823){_0x4af3e7=_0x4af3e7-0x0;var _0x544823=_0x49ff[_0x4af3e7];return _0x544823;};'use strict';function Dynamics365Account(_0x2a64f7){this['id']=_0x2a64f7['id']||0x0;this[_0xf49f('0x0')]=_0x2a64f7[_0xf49f('0x0')]||'';this[_0xf49f('0x1')]=_0x2a64f7[_0xf49f('0x1')]||'';this[_0xf49f('0x2')]=_0x2a64f7['password']||'';this[_0xf49f('0x3')]=_0x2a64f7[_0xf49f('0x3')]||'';this[_0xf49f('0x4')]=_0x2a64f7[_0xf49f('0x4')]||'';this['clientId']=_0x2a64f7[_0xf49f('0x5')]||'';this['clientSecret']=_0x2a64f7[_0xf49f('0x6')]||{};this['serverUrl']=_0x2a64f7[_0xf49f('0x7')]||'';this[_0xf49f('0x8')]=_0x2a64f7[_0xf49f('0x8')]||![];this[_0xf49f('0x9')]=_0x2a64f7['Configurations']||{};this[_0xf49f('0xa')]=_0x2a64f7['CloudProvider']||{};}module[_0xf49f('0xb')]=Dynamics365Account; \ No newline at end of file +var _0xd565=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x1084a5,_0x579890){var _0xf18360=function(_0x595ade){while(--_0x595ade){_0x1084a5['push'](_0x1084a5['shift']());}};_0xf18360(++_0x579890);}(_0xd565,0xb5));var _0x5d56=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd565[_0xfae23b];return _0x200640;};'use strict';function Dynamics365Account(_0x3e1431){this['id']=_0x3e1431['id']||0x0;this[_0x5d56('0x0')]=_0x3e1431[_0x5d56('0x0')]||'';this[_0x5d56('0x1')]=_0x3e1431[_0x5d56('0x1')]||'';this[_0x5d56('0x2')]=_0x3e1431['password']||'';this[_0x5d56('0x3')]=_0x3e1431['remoteUri']||'';this[_0x5d56('0x4')]=_0x3e1431['tenantId']||'';this[_0x5d56('0x5')]=_0x3e1431[_0x5d56('0x5')]||'';this[_0x5d56('0x6')]=_0x3e1431[_0x5d56('0x6')]||{};this[_0x5d56('0x7')]=_0x3e1431[_0x5d56('0x7')]||'';this[_0x5d56('0x8')]=_0x3e1431[_0x5d56('0x8')]||![];this['Configurations']=_0x3e1431[_0x5d56('0x9')]||{};this[_0x5d56('0xa')]=_0x3e1431[_0x5d56('0xa')]||{};}module[_0x5d56('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index ca01f32..e269de1 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 _0x8748=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8748,0x176));var _0x8874=function(_0x47c910,_0x9db31c){_0x47c910=_0x47c910-0x0;var _0x55805f=_0x8748[_0x47c910];return _0x55805f;};'use strict';function FaxAccount(_0x1e6d3c){this['id']=_0x1e6d3c['id']||0x0;this[_0x8874('0x0')]=_0x1e6d3c[_0x8874('0x0')]||'';this[_0x8874('0x1')]=_0x1e6d3c[_0x8874('0x1')];this['ecm']=_0x1e6d3c[_0x8874('0x2')];this['headerinfo']=_0x1e6d3c[_0x8874('0x3')];this[_0x8874('0x4')]=_0x1e6d3c[_0x8874('0x4')];this[_0x8874('0x5')]=_0x1e6d3c[_0x8874('0x5')]||0x960;this[_0x8874('0x6')]=_0x1e6d3c[_0x8874('0x6')]||0x3840;this[_0x8874('0x7')]=_0x1e6d3c[_0x8874('0x7')]||_0x8874('0x8');this['gateway']=_0x1e6d3c['gateway']||'no';this[_0x8874('0x9')]=_0x1e6d3c[_0x8874('0x9')]||'no';this[_0x8874('0xa')]=_0x1e6d3c[_0x8874('0xa')]||0x1388;this[_0x8874('0xb')]=_0x1e6d3c[_0x8874('0xb')]||_0x8874('0xc');this[_0x8874('0xd')]=_0x1e6d3c[_0x8874('0xd')]?_0x1e6d3c[_0x8874('0xd')]:undefined;this[_0x8874('0xe')]=_0x1e6d3c[_0x8874('0xe')];this[_0x8874('0xf')]=_0x1e6d3c[_0x8874('0xf')];}module[_0x8874('0x10')]=FaxAccount; \ No newline at end of file +var _0xfa40=['exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','t38timeout','Trunk','ListId','key'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xfa40,0x97));var _0x0fa4=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xfa40[_0x297fd3];return _0x2af381;};'use strict';function FaxAccount(_0x20f44b){this['id']=_0x20f44b['id']||0x0;this['name']=_0x20f44b[_0x0fa4('0x0')]||'';this['description']=_0x20f44b[_0x0fa4('0x1')];this[_0x0fa4('0x2')]=_0x20f44b[_0x0fa4('0x2')];this[_0x0fa4('0x3')]=_0x20f44b[_0x0fa4('0x3')];this[_0x0fa4('0x4')]=_0x20f44b[_0x0fa4('0x4')];this[_0x0fa4('0x5')]=_0x20f44b[_0x0fa4('0x5')]||0x960;this[_0x0fa4('0x6')]=_0x20f44b[_0x0fa4('0x6')]||0x3840;this[_0x0fa4('0x7')]=_0x20f44b[_0x0fa4('0x7')]||_0x0fa4('0x8');this[_0x0fa4('0x9')]=_0x20f44b[_0x0fa4('0x9')]||'no';this['faxdetect']=_0x20f44b['faxdetect']||'no';this[_0x0fa4('0xa')]=_0x20f44b['t38timeout']||0x1388;this['tech']=_0x20f44b['tech']||'SIP';this[_0x0fa4('0xb')]=_0x20f44b['Trunk']?_0x20f44b[_0x0fa4('0xb')]:undefined;this[_0x0fa4('0xc')]=_0x20f44b[_0x0fa4('0xc')];this['key']=_0x20f44b[_0x0fa4('0xd')];}module[_0x0fa4('0xe')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 011898e..49f7806 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 _0x20ed=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x35ca47,_0x3602c2){var _0x3b670c=function(_0x4bf47a){while(--_0x4bf47a){_0x35ca47['push'](_0x35ca47['shift']());}};_0x3b670c(++_0x3602c2);}(_0x20ed,0x9f));var _0xd20e=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x20ed[_0x220f3f];return _0x1f170e;};'use strict';function FreshdeskAccount(_0x44627c){this['id']=_0x44627c['id']||0x0;this[_0xd20e('0x0')]=_0x44627c[_0xd20e('0x0')]||'';this[_0xd20e('0x1')]=_0x44627c[_0xd20e('0x1')]||'';this[_0xd20e('0x2')]=_0x44627c[_0xd20e('0x3')]||'';this[_0xd20e('0x4')]=_0x44627c[_0xd20e('0x4')]||'';this[_0xd20e('0x5')]=_0x44627c[_0xd20e('0x5')]||'';this[_0xd20e('0x6')]=_0x44627c['Configurations']||{};}module[_0xd20e('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x6818=['name','username','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0x6818,0x1a4));var _0x8681=function(_0x433cb2,_0x47d9cc){_0x433cb2=_0x433cb2-0x0;var _0x569420=_0x6818[_0x433cb2];return _0x569420;};'use strict';function FreshdeskAccount(_0x41276d){this['id']=_0x41276d['id']||0x0;this[_0x8681('0x0')]=_0x41276d[_0x8681('0x0')]||'';this[_0x8681('0x1')]=_0x41276d[_0x8681('0x1')]||'';this['apiKey']=_0x41276d[_0x8681('0x2')]||'';this[_0x8681('0x3')]=_0x41276d[_0x8681('0x3')]||'';this[_0x8681('0x4')]=_0x41276d[_0x8681('0x4')]||'';this[_0x8681('0x5')]=_0x41276d[_0x8681('0x5')]||{};}module[_0x8681('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 722bed9..a6e8666 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 _0x4fb4=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x67c161,_0x5286c5){var _0x23ef2f=function(_0x4d7c7c){while(--_0x4d7c7c){_0x67c161['push'](_0x67c161['shift']());}};_0x23ef2f(++_0x5286c5);}(_0x4fb4,0x190));var _0x44fb=function(_0x99c4d0,_0x7006fe){_0x99c4d0=_0x99c4d0-0x0;var _0x4f8cda=_0x4fb4[_0x99c4d0];return _0x4f8cda;};'use strict';function FreshsalesAccount(_0x2983b0){this['id']=_0x2983b0['id']||0x0;this[_0x44fb('0x0')]=_0x2983b0[_0x44fb('0x0')]||'';this[_0x44fb('0x1')]=_0x2983b0[_0x44fb('0x1')]||'';this[_0x44fb('0x2')]=_0x2983b0[_0x44fb('0x3')]||'';this['remoteUri']=_0x2983b0[_0x44fb('0x4')]||'';this[_0x44fb('0x5')]=_0x2983b0[_0x44fb('0x5')]||'';this[_0x44fb('0x6')]=_0x2983b0[_0x44fb('0x6')]||{};}module[_0x44fb('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xa751=['Configurations','exports','name','username','apiKey','remoteUri','serverUrl'];(function(_0x3259c0,_0x26e295){var _0x2b56e1=function(_0x48f40f){while(--_0x48f40f){_0x3259c0['push'](_0x3259c0['shift']());}};_0x2b56e1(++_0x26e295);}(_0xa751,0x175));var _0x1a75=function(_0x54d3a5,_0x491440){_0x54d3a5=_0x54d3a5-0x0;var _0x51a5cb=_0xa751[_0x54d3a5];return _0x51a5cb;};'use strict';function FreshsalesAccount(_0x1e981b){this['id']=_0x1e981b['id']||0x0;this[_0x1a75('0x0')]=_0x1e981b[_0x1a75('0x0')]||'';this[_0x1a75('0x1')]=_0x1e981b['username']||'';this[_0x1a75('0x2')]=_0x1e981b['token']||'';this[_0x1a75('0x3')]=_0x1e981b[_0x1a75('0x3')]||'';this[_0x1a75('0x4')]=_0x1e981b['serverUrl']||'';this[_0x1a75('0x5')]=_0x1e981b[_0x1a75('0x5')]||{};}module[_0x1a75('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 786280e..7498ff6 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 _0x4366=['channel','connectedlinenum','connectedlinename','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','routealias','mohtime','variables','exports','type','inbound','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt'];(function(_0x1266f9,_0xbba76f){var _0x282acb=function(_0x3237f9){while(--_0x3237f9){_0x1266f9['push'](_0x1266f9['shift']());}};_0x282acb(++_0xbba76f);}(_0x4366,0x1b7));var _0x6436=function(_0x5f4c66,_0x497ab3){_0x5f4c66=_0x5f4c66-0x0;var _0x14129b=_0x4366[_0x5f4c66];return _0x14129b;};'use strict';function QueueReport(){this[_0x6436('0x0')]=_0x6436('0x1');this[_0x6436('0x2')]='';this['calleridnum']='';this['calleridname']='';this[_0x6436('0x3')]='';this[_0x6436('0x4')]=null;this[_0x6436('0x5')]=null;this['position']=0x1;this[_0x6436('0x6')]=0x1;this['queuecallerabandon']=![];this[_0x6436('0x7')]=null;this['queuecallercomplete']=![];this[_0x6436('0x8')]=null;this[_0x6436('0x9')]=![];this[_0x6436('0xa')]=null;this['originalposition']=0x1;this[_0x6436('0xb')]='';this[_0x6436('0xc')]='';this[_0x6436('0xd')]='';this['accountcode']='';this['context']='';this[_0x6436('0xe')]='';this[_0x6436('0xf')]='';this[_0x6436('0x10')]=0x0;this[_0x6436('0x11')]=![];this[_0x6436('0x12')]='';this[_0x6436('0x13')]=_0x6436('0x14');this[_0x6436('0x15')]=null;this[_0x6436('0x16')]=0x0;this[_0x6436('0x17')]={};}module[_0x6436('0x18')]=QueueReport; \ No newline at end of file +var _0xb99d=['uniqueid','calleridnum','calleridname','queue','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','assigned','routealias','mohtime','variables','exports','type'];(function(_0x3c08ec,_0x360de7){var _0x1fe698=function(_0x1beabc){while(--_0x1beabc){_0x3c08ec['push'](_0x3c08ec['shift']());}};_0x1fe698(++_0x360de7);}(_0xb99d,0xc5));var _0xdb99=function(_0x38ac44,_0x38c414){_0x38ac44=_0x38ac44-0x0;var _0x42e9ae=_0xb99d[_0x38ac44];return _0x42e9ae;};'use strict';function QueueReport(){this[_0xdb99('0x0')]='inbound';this[_0xdb99('0x1')]='';this[_0xdb99('0x2')]='';this[_0xdb99('0x3')]='';this[_0xdb99('0x4')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this['position']=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0xdb99('0x5')]=null;this['queuecallercomplete']=![];this[_0xdb99('0x6')]=null;this[_0xdb99('0x7')]=![];this[_0xdb99('0x8')]=null;this[_0xdb99('0x9')]=0x1;this[_0xdb99('0xa')]='';this[_0xdb99('0xb')]='';this[_0xdb99('0xc')]='';this[_0xdb99('0xd')]='';this[_0xdb99('0xe')]='';this[_0xdb99('0xf')]='';this[_0xdb99('0x10')]='';this['holdtime']=0x0;this[_0xdb99('0x11')]=![];this['lastAssignedTo']='';this['motionChannel']='voice';this[_0xdb99('0x12')]=null;this[_0xdb99('0x13')]=0x0;this[_0xdb99('0x14')]={};}module[_0xdb99('0x15')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index bfa330a..f1a0b91 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 _0x7a2f=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','name'];(function(_0x22fcb8,_0x469168){var _0xddc292=function(_0x175949){while(--_0x175949){_0x22fcb8['push'](_0x22fcb8['shift']());}};_0xddc292(++_0x469168);}(_0x7a2f,0x1c2));var _0xf7a2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7a2f[_0x17d9e3];return _0x14192d;};'use strict';function SalesforceAccount(_0x5c0b74){this['id']=_0x5c0b74['id']||0x0;this[_0xf7a2('0x0')]=_0x5c0b74['name']||'';this[_0xf7a2('0x1')]=_0x5c0b74[_0xf7a2('0x1')]||'';this['remoteUri']=_0x5c0b74[_0xf7a2('0x2')]||'';this[_0xf7a2('0x3')]=_0x5c0b74[_0xf7a2('0x3')]||'';this['clientId']=_0x5c0b74[_0xf7a2('0x4')]||'';this[_0xf7a2('0x5')]=_0x5c0b74[_0xf7a2('0x5')]||'';this[_0xf7a2('0x6')]=_0x5c0b74[_0xf7a2('0x6')]||'';this[_0xf7a2('0x7')]=_0x5c0b74['type']||_0xf7a2('0x8');this[_0xf7a2('0x9')]=_0x5c0b74[_0xf7a2('0x9')]||'';this[_0xf7a2('0xa')]=_0x5c0b74[_0xf7a2('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x3059=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x295148,_0x585dfa){var _0xaf3076=function(_0x43ecd6){while(--_0x43ecd6){_0x295148['push'](_0x295148['shift']());}};_0xaf3076(++_0x585dfa);}(_0x3059,0x1df));var _0x9305=function(_0xede2d3,_0x57a45f){_0xede2d3=_0xede2d3-0x0;var _0x298652=_0x3059[_0xede2d3];return _0x298652;};'use strict';function SalesforceAccount(_0x1ce1c7){this['id']=_0x1ce1c7['id']||0x0;this[_0x9305('0x0')]=_0x1ce1c7[_0x9305('0x0')]||'';this[_0x9305('0x1')]=_0x1ce1c7[_0x9305('0x1')]||'';this['remoteUri']=_0x1ce1c7[_0x9305('0x2')]||'';this[_0x9305('0x3')]=_0x1ce1c7['password']||'';this[_0x9305('0x4')]=_0x1ce1c7[_0x9305('0x4')]||'';this[_0x9305('0x5')]=_0x1ce1c7[_0x9305('0x5')]||'';this[_0x9305('0x6')]=_0x1ce1c7['securityToken']||'';this['type']=_0x1ce1c7[_0x9305('0x7')]||_0x9305('0x8');this['serverUrl']=_0x1ce1c7[_0x9305('0x9')]||'';this[_0x9305('0xa')]=_0x1ce1c7[_0x9305('0xa')]||{};}module[_0x9305('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index c992d93..3721e8d 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 _0xe51f=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x5c1ac6,_0x20a614){var _0x472bbf=function(_0xea0d8){while(--_0xea0d8){_0x5c1ac6['push'](_0x5c1ac6['shift']());}};_0x472bbf(++_0x20a614);}(_0xe51f,0xbb));var _0xfe51=function(_0x3a1a27,_0x378bef){_0x3a1a27=_0x3a1a27-0x0;var _0x33f1fd=_0xe51f[_0x3a1a27];return _0x33f1fd;};'use strict';function ServicenowAccount(_0x59aa15){this['id']=_0x59aa15['id']||0x0;this[_0xfe51('0x0')]=_0x59aa15[_0xfe51('0x0')]||'';this[_0xfe51('0x1')]=_0x59aa15[_0xfe51('0x1')]||'';this[_0xfe51('0x2')]=_0x59aa15[_0xfe51('0x2')]||'';this[_0xfe51('0x3')]=_0x59aa15[_0xfe51('0x3')]||'';this[_0xfe51('0x4')]=_0x59aa15[_0xfe51('0x4')]||'';this[_0xfe51('0x5')]=_0x59aa15['Configurations']||{};}module[_0xfe51('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xaa52=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x12aaf4,_0x38785a){var _0x4d76e0=function(_0x4332f0){while(--_0x4332f0){_0x12aaf4['push'](_0x12aaf4['shift']());}};_0x4d76e0(++_0x38785a);}(_0xaa52,0x187));var _0x2aa5=function(_0x2888e1,_0x29068a){_0x2888e1=_0x2888e1-0x0;var _0x339066=_0xaa52[_0x2888e1];return _0x339066;};'use strict';function ServicenowAccount(_0x3bdc2f){this['id']=_0x3bdc2f['id']||0x0;this[_0x2aa5('0x0')]=_0x3bdc2f[_0x2aa5('0x0')]||'';this[_0x2aa5('0x1')]=_0x3bdc2f[_0x2aa5('0x1')]||'';this[_0x2aa5('0x2')]=_0x3bdc2f[_0x2aa5('0x2')]||'';this['remoteUri']=_0x3bdc2f[_0x2aa5('0x3')]||'';this[_0x2aa5('0x4')]=_0x3bdc2f[_0x2aa5('0x4')]||'';this['Configurations']=_0x3bdc2f[_0x2aa5('0x5')]||{};}module[_0x2aa5('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index f6c583f..08f81c9 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 _0xaea8=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0xaea8,0x71));var _0x8aea=function(_0x2bd7bf,_0x655792){_0x2bd7bf=_0x2bd7bf-0x0;var _0xb96d6b=_0xaea8[_0x2bd7bf];return _0xb96d6b;};'use strict';function SugarcrmAccount(_0xf37e2d){this['id']=_0xf37e2d['id']||0x0;this[_0x8aea('0x0')]=_0xf37e2d['name']||'';this[_0x8aea('0x1')]=_0xf37e2d[_0x8aea('0x1')]||'';this[_0x8aea('0x2')]=_0xf37e2d['password']||'';this[_0x8aea('0x3')]=_0xf37e2d['remoteUri']||'';this['serverUrl']=_0xf37e2d[_0x8aea('0x4')]||'';this[_0x8aea('0x5')]=_0xf37e2d[_0x8aea('0x5')]||{};}module[_0x8aea('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xb8c2=['serverUrl','exports','name','username','remoteUri'];(function(_0x5e422a,_0x45cf44){var _0x501344=function(_0x92d2a4){while(--_0x92d2a4){_0x5e422a['push'](_0x5e422a['shift']());}};_0x501344(++_0x45cf44);}(_0xb8c2,0x1ab));var _0x2b8c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb8c2[_0x321bb2];return _0x9c12ed;};'use strict';function SugarcrmAccount(_0x1ec964){this['id']=_0x1ec964['id']||0x0;this[_0x2b8c('0x0')]=_0x1ec964[_0x2b8c('0x0')]||'';this[_0x2b8c('0x1')]=_0x1ec964[_0x2b8c('0x1')]||'';this['password']=_0x1ec964['password']||'';this[_0x2b8c('0x2')]=_0x1ec964['remoteUri']||'';this[_0x2b8c('0x3')]=_0x1ec964[_0x2b8c('0x3')]||'';this['Configurations']=_0x1ec964['Configurations']||{};}module[_0x2b8c('0x4')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 5846a4f..30b5623 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 _0x4fad=['status','address','exports','name','accountcode','state','unknown','stateTime'];(function(_0x3048ea,_0x3838c2){var _0x1a13c4=function(_0x2c6a6b){while(--_0x2c6a6b){_0x3048ea['push'](_0x3048ea['shift']());}};_0x1a13c4(++_0x3838c2);}(_0x4fad,0xcb));var _0xd4fa=function(_0x5a0cb2,_0x43a6e4){_0x5a0cb2=_0x5a0cb2-0x0;var _0x32b526=_0x4fad[_0x5a0cb2];return _0x32b526;};'use strict';function Telephone(_0x2e71db){this['id']=_0x2e71db['id']||0x0;this[_0xd4fa('0x0')]=_0x2e71db[_0xd4fa('0x0')]||'';this['accountcode']=_0x2e71db[_0xd4fa('0x1')]||'';this[_0xd4fa('0x2')]=_0xd4fa('0x3');this[_0xd4fa('0x4')]=0x0;this[_0xd4fa('0x5')]=_0xd4fa('0x3');this[_0xd4fa('0x6')]='';}module[_0xd4fa('0x7')]=Telephone; \ No newline at end of file +var _0x3a61=['address','exports','accountcode','state','unknown','stateTime','status'];(function(_0x4dd5c6,_0x4d5c81){var _0x56b748=function(_0x373ff4){while(--_0x373ff4){_0x4dd5c6['push'](_0x4dd5c6['shift']());}};_0x56b748(++_0x4d5c81);}(_0x3a61,0xd4));var _0x13a6=function(_0xce8299,_0x55ec18){_0xce8299=_0xce8299-0x0;var _0xa39773=_0x3a61[_0xce8299];return _0xa39773;};'use strict';function Telephone(_0x141625){this['id']=_0x141625['id']||0x0;this['name']=_0x141625['name']||'';this[_0x13a6('0x0')]=_0x141625[_0x13a6('0x0')]||'';this[_0x13a6('0x1')]=_0x13a6('0x2');this[_0x13a6('0x3')]=0x0;this[_0x13a6('0x4')]=_0x13a6('0x2');this[_0x13a6('0x5')]='';}module[_0x13a6('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index cdfa7be..e2124e5 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x274b1b,_0x5acf07){var _0x5c9676=function(_0x34864a){while(--_0x34864a){_0x274b1b['push'](_0x274b1b['shift']());}};_0x5c9676(++_0x5acf07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0xcf9fab,_0x478cc4){var _0xd613fe=function(_0xf5f817){while(--_0xf5f817){_0xcf9fab['push'](_0xcf9fab['shift']());}};_0xd613fe(++_0x478cc4);}(_0xb10b,0x12a));var _0xbb10=function(_0x41d02a,_0x355e19){_0x41d02a=_0x41d02a-0x0;var _0x4c3983=_0xb10b[_0x41d02a];return _0x4c3983;};'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 diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index f523ea1..0405f81 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 _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1a85,0x178));var _0x51a8=function(_0x79ebc5,_0x2df5d1){_0x79ebc5=_0x79ebc5-0x0;var _0x3813b6=_0x1a85[_0x79ebc5];return _0x3813b6;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x0b0e=['channel','voice','status','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0x0b0e[_0x1b1a3b];return _0x385347;};'use strict';function Trigger(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['channel']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||![];this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||[];this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||[];this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||[];}module[_0xe0b0('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index b656ae8..7fe30dc 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 _0x6901=['name','state','unknown','registry','indexOf','split','host','port','domain','domainport','refresh','address','defaultuser','active'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0x6901,0xb5));var _0x1690=function(_0x168c28,_0x19b5d6){_0x168c28=_0x168c28-0x0;var _0x41f9bd=_0x6901[_0x168c28];return _0x41f9bd;};'use strict';function Trunk(_0x20b9db){this['id']=_0x20b9db['id']||0x0;this[_0x1690('0x0')]=_0x20b9db[_0x1690('0x0')]||![];this[_0x1690('0x1')]=_0x20b9db['name']||'';this[_0x1690('0x2')]=_0x1690('0x3');this['stateTime']=0x0;this['status']=_0x1690('0x3');this[_0x1690('0x4')]=_0x20b9db[_0x1690('0x4')]&&_0x20b9db[_0x1690('0x4')][_0x1690('0x5')](':')?_0x20b9db[_0x1690('0x4')][_0x1690('0x6')](':')[0x0]:'';this[_0x1690('0x7')]='';this[_0x1690('0x8')]='';this[_0x1690('0x9')]='';this[_0x1690('0xa')]='';this[_0x1690('0xb')]='';this['stateRegistry']=_0x1690('0x3');this['registrationtime']='';this[_0x1690('0xc')]='';this[_0x1690('0xd')]=_0x20b9db[_0x1690('0xd')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0x93a3=['stateRegistry','address','defaultuser','exports','active','name','state','stateTime','status','unknown','registry','split','host','port','domain'];(function(_0x111394,_0x4b31f8){var _0x4b7106=function(_0x43705d){while(--_0x43705d){_0x111394['push'](_0x111394['shift']());}};_0x4b7106(++_0x4b31f8);}(_0x93a3,0x112));var _0x393a=function(_0x18212e,_0xa0b65c){_0x18212e=_0x18212e-0x0;var _0x1ab331=_0x93a3[_0x18212e];return _0x1ab331;};'use strict';function Trunk(_0x11921d){this['id']=_0x11921d['id']||0x0;this[_0x393a('0x0')]=_0x11921d[_0x393a('0x0')]||![];this[_0x393a('0x1')]=_0x11921d[_0x393a('0x1')]||'';this[_0x393a('0x2')]='unknown';this[_0x393a('0x3')]=0x0;this[_0x393a('0x4')]=_0x393a('0x5');this['registry']=_0x11921d[_0x393a('0x6')]&&_0x11921d['registry']['indexOf'](':')?_0x11921d[_0x393a('0x6')][_0x393a('0x7')](':')[0x0]:'';this[_0x393a('0x8')]='';this[_0x393a('0x9')]='';this[_0x393a('0xa')]='';this['domainport']='';this['refresh']='';this[_0x393a('0xb')]=_0x393a('0x5');this['registrationtime']='';this[_0x393a('0xc')]='';this[_0x393a('0xd')]=_0x11921d['defaultuser']||'';}module[_0x393a('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 6cce05d..4597d3f 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 _0xb996=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xb996,0x179));var _0x6b99=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xb996[_0x5037ab];return _0x512adb;};'use strict';function voiceExtension(_0x26f947){this['id']=_0x26f947['id']||0x0;this[_0x6b99('0x0')]=_0x26f947[_0x6b99('0x0')]||'';this['recordingFormat']=_0x26f947[_0x6b99('0x1')]||_0x6b99('0x2');this[_0x6b99('0x3')]=_0x26f947[_0x6b99('0x3')]||![];}module[_0x6b99('0x4')]=voiceExtension; \ No newline at end of file +var _0x3ec1=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x22521d,_0x5a1982){var _0x370439=function(_0xe40491){while(--_0xe40491){_0x22521d['push'](_0x22521d['shift']());}};_0x370439(++_0x5a1982);}(_0x3ec1,0x160));var _0x13ec=function(_0x270eac,_0x5d3d11){_0x270eac=_0x270eac-0x0;var _0x54f346=_0x3ec1[_0x270eac];return _0x54f346;};'use strict';function voiceExtension(_0x335338){this['id']=_0x335338['id']||0x0;this['exten']=_0x335338[_0x13ec('0x0')]||'';this[_0x13ec('0x1')]=_0x335338[_0x13ec('0x1')]||_0x13ec('0x2');this['mandatoryDisposition']=_0x335338[_0x13ec('0x3')]||![];}module[_0x13ec('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index e561552..eb425a1 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 _0x42f0=['dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','wav','wav49','gsm','fewestcalls','leastrecent','linear','random','ringall','rrmemory','rrordered','wrandom','name','monitor_format','type','total','sumDuration','unmanaged','abandoned','available','invalid','onHold','paused','ringing','ringInUse','talking','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','queueStatusComplete'];(function(_0x2b948f,_0x398e62){var _0x1237bc=function(_0x3c1843){while(--_0x3c1843){_0x2b948f['push'](_0x2b948f['shift']());}};_0x1237bc(++_0x398e62);}(_0x42f0,0x1b4));var _0x042f=function(_0x48120f,_0x1da1b8){_0x48120f=_0x48120f-0x0;var _0x39a62e=_0x42f0[_0x48120f];return _0x39a62e;};'use strict';var monitorFormat={'wav':_0x042f('0x0'),'wav49':_0x042f('0x1'),'gsm':_0x042f('0x2')};var strategy={'fewestcalls':_0x042f('0x3'),'leastrecent':_0x042f('0x4'),'linear':_0x042f('0x5'),'random':_0x042f('0x6'),'ringall':_0x042f('0x7'),'rr':'roundrobin','rrmemory':_0x042f('0x8'),'rrordered':_0x042f('0x9'),'wrandom':_0x042f('0xa')};function VoiceQueue(_0x225e13){this['id']=_0x225e13['id']||0x0;this[_0x042f('0xb')]=_0x225e13[_0x042f('0xb')]||'';this[_0x042f('0xc')]=_0x225e13['monitor_format']||'';this[_0x042f('0xd')]=_0x225e13[_0x042f('0xd')]||'inbound';this['waiting']=0x0;this[_0x042f('0xe')]=0x0;this['answered']=0x0;this[_0x042f('0xf')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0x042f('0x10')]=0x0;this[_0x042f('0x11')]=0x0;this[_0x042f('0x12')]=0x0;this['busy']=0x0;this['inUse']=0x0;this[_0x042f('0x13')]=0x0;this['loggedIn']=0x0;this['notInUse']=0x0;this[_0x042f('0x14')]=0x0;this[_0x042f('0x15')]=0x0;this[_0x042f('0x16')]=0x0;this[_0x042f('0x17')]=0x0;this[_0x042f('0x18')]=0x0;this['unavailable']=0x0;this[_0x042f('0x19')]=0x0;this[_0x042f('0x1a')]=_0x225e13[_0x042f('0x1a')]||![];this['acwTimeout']=_0x225e13[_0x042f('0x1b')]||0xa;this['autopause']=_0x225e13[_0x042f('0x1c')]||'no';this[_0x042f('0x1d')]=!![];this[_0x042f('0x1e')]='';this['statusMessage']='';this['originated']=0x0;this['temp']=0x0;this[_0x042f('0x1f')]=_0x225e13[_0x042f('0x1f')]||null;this[_0x042f('0x20')]=_0x225e13[_0x042f('0x20')]?_0x225e13[_0x042f('0x20')]:null;this[_0x042f('0x21')]=_0x225e13[_0x042f('0x21')];this[_0x042f('0x22')]=_0x225e13[_0x042f('0x22')]||_0x042f('0x23');this['dialLimitChannel']=_0x225e13['dialLimitChannel']||0x0;this[_0x042f('0x24')]=_0x225e13['dialLimitQueue']||0x0;this[_0x042f('0x25')]=_0x225e13[_0x042f('0x25')]||0x1;this[_0x042f('0x26')]=_0x225e13[_0x042f('0x26')]||_0x042f('0x27');this[_0x042f('0x28')]=_0x225e13[_0x042f('0x28')]||0.03;this['dialPredictiveInterval']=_0x225e13[_0x042f('0x29')]||0x258;this[_0x042f('0x2a')]=_0x225e13[_0x042f('0x2a')]||_0x042f('0x2b');this['dialOriginateCallerIdNumber']=_0x225e13[_0x042f('0x2c')]||_0x042f('0x2b');this[_0x042f('0x2d')]=_0x225e13[_0x042f('0x2d')]||0x1e;this['dialQueueOptions']=_0x225e13[_0x042f('0x2e')]||_0x042f('0x2f');this['dialQueueTimeout']=_0x225e13[_0x042f('0x30')]||0x3;this['dialQueueProject']=_0x225e13[_0x042f('0x31')]||undefined;this['dialCongestionMaxRetry']=_0x225e13['dialCongestionMaxRetry']||0x3;this[_0x042f('0x32')]=_0x225e13[_0x042f('0x32')]||0x96;this[_0x042f('0x33')]=_0x225e13['dialBusyMaxRetry']||0x3;this[_0x042f('0x34')]=_0x225e13[_0x042f('0x34')]||0x96;this[_0x042f('0x35')]=_0x225e13['dialNoAnswerMaxRetry']||0x3;this[_0x042f('0x36')]=_0x225e13[_0x042f('0x36')]||0x96;this[_0x042f('0x37')]=_0x225e13[_0x042f('0x37')]||0x3;this[_0x042f('0x38')]=_0x225e13[_0x042f('0x38')]||0x96;this['dialDropMaxRetry']=_0x225e13[_0x042f('0x39')]||0x3;this[_0x042f('0x3a')]=_0x225e13[_0x042f('0x3a')]||0x96;this[_0x042f('0x3b')]=_0x225e13['dialAbandonedMaxRetry']||0x3;this[_0x042f('0x3c')]=_0x225e13[_0x042f('0x3c')]||0x96;this['dialMachineMaxRetry']=_0x225e13[_0x042f('0x3d')]||0x3;this[_0x042f('0x3e')]=_0x225e13[_0x042f('0x3e')]||0x96;this[_0x042f('0x3f')]=_0x225e13[_0x042f('0x3f')]||0x3;this[_0x042f('0x40')]=_0x225e13[_0x042f('0x40')]||0x96;this['callAdditionalPhoneAfterMin']=_0x225e13[_0x042f('0x41')]||0x3;this['dialGlobalMaxRetry']=_0x225e13[_0x042f('0x42')]||0x4;this[_0x042f('0x43')]=_0x225e13[_0x042f('0x43')]?_0x225e13[_0x042f('0x43')]:undefined;this['TrunkBackup']=_0x225e13[_0x042f('0x44')]?_0x225e13[_0x042f('0x44')]:undefined;this[_0x042f('0x45')]=_0x225e13[_0x042f('0x45')]||undefined;this['Interval']=_0x225e13[_0x042f('0x46')]?_0x225e13[_0x042f('0x46')]:undefined;this[_0x042f('0x47')]=_0x225e13[_0x042f('0x47')]||_0x042f('0x48');this[_0x042f('0x49')]=_0x225e13[_0x042f('0x49')]||undefined;this[_0x042f('0x4a')]=_0x225e13[_0x042f('0x4a')]||undefined;this['strategy']=strategy[_0x225e13['strategy']];this[_0x042f('0x4b')]=!![];this['dialAMDActive']=_0x225e13[_0x042f('0x4c')]||![];this['dialAMDInitialSilence']=_0x225e13[_0x042f('0x4d')];this['dialAMDGreeting']=_0x225e13[_0x042f('0x4e')];this[_0x042f('0x4f')]=_0x225e13[_0x042f('0x4f')];this[_0x042f('0x50')]=_0x225e13['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x225e13[_0x042f('0x51')];this[_0x042f('0x52')]=_0x225e13[_0x042f('0x52')];this[_0x042f('0x53')]=_0x225e13[_0x042f('0x53')];this[_0x042f('0x54')]=_0x225e13[_0x042f('0x54')];this[_0x042f('0x55')]=_0x225e13[_0x042f('0x55')];this['outboundRejectCallsDay']=0x0;this[_0x042f('0x56')]=0x0;this[_0x042f('0x57')]=_0x225e13['timeout'];this[_0x042f('0x58')]=0x0;this[_0x042f('0x59')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x042f('0x5a')]=0x0;this[_0x042f('0x5b')]=0x0;this[_0x042f('0x5c')]=0x0;this[_0x042f('0x5d')]=0x0;this[_0x042f('0x5e')]=0x0;this[_0x042f('0x5f')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x042f('0x60')]=0x0;this[_0x042f('0x61')]=0x0;this[_0x042f('0x62')]=0x0;this[_0x042f('0x63')]=0x0;this[_0x042f('0x64')]=undefined;this['startPredictive']=undefined;this[_0x042f('0x65')]=undefined;this[_0x042f('0x66')]=1.05;this[_0x042f('0x67')]=0x0;this[_0x042f('0x68')]=0x0;this[_0x042f('0x69')]=0x0;this[_0x042f('0x6a')]=0x0;this[_0x042f('0x6b')]=0x0;this[_0x042f('0x6c')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x042f('0x6d')]=0x0;this[_0x042f('0x6e')]=_0x225e13['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x042f('0x6f')]=_0x225e13['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x042f('0x70')]=0x0;this[_0x042f('0x71')]=0x0;this[_0x042f('0x72')]=0x1;this[_0x042f('0x73')]=0x0;this['erlangCallToSecond']=0x0;this[_0x042f('0x74')]=0x0;this[_0x042f('0x75')]=0x0;this[_0x042f('0x76')]=_0x225e13['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x225e13[_0x042f('0x77')]||![];this[_0x042f('0x78')]=!!_0x225e13[_0x042f('0x78')]||![];this[_0x042f('0x79')]=!!_0x225e13[_0x042f('0x79')]||![];this[_0x042f('0x7a')]=_0x225e13['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x225e13[_0x042f('0x7b')]||![];this[_0x042f('0x7c')]=_0x225e13[_0x042f('0x7c')]||![];this[_0x042f('0xc')]=monitorFormat[_0x225e13[_0x042f('0xc')]]?monitorFormat[_0x225e13[_0x042f('0xc')]]:undefined;this['mandatoryDisposition']=_0x225e13[_0x042f('0x7d')]||![];this[_0x042f('0x7e')]=_0x225e13['mandatoryDispositionPause']?_0x225e13[_0x042f('0x7e')]:undefined;this[_0x042f('0x7f')]=![];}module['exports']=VoiceQueue; \ No newline at end of file +var _0x9e8a=['predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','random','ringall','roundrobin','name','monitor_format','type','inbound','waiting','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','busy','inUse','invalid','loggedIn','notInUse','onHold','paused','ringing','talking','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls'];(function(_0xc9b988,_0x429150){var _0x5f14fe=function(_0x5c76a8){while(--_0x5c76a8){_0xc9b988['push'](_0xc9b988['shift']());}};_0x5f14fe(++_0x429150);}(_0x9e8a,0x112));var _0xa9e8=function(_0x22f303,_0x1d6034){_0x22f303=_0x22f303-0x0;var _0x295071=_0x9e8a[_0x22f303];return _0x295071;};'use strict';var monitorFormat={'wav':_0xa9e8('0x0'),'wav49':_0xa9e8('0x1'),'gsm':_0xa9e8('0x2')};var strategy={'fewestcalls':_0xa9e8('0x3'),'leastrecent':_0xa9e8('0x4'),'linear':_0xa9e8('0x5'),'random':_0xa9e8('0x6'),'ringall':_0xa9e8('0x7'),'rr':_0xa9e8('0x8'),'rrmemory':'rrmemory','rrordered':'rrordered','wrandom':'wrandom'};function VoiceQueue(_0x5272b7){this['id']=_0x5272b7['id']||0x0;this[_0xa9e8('0x9')]=_0x5272b7[_0xa9e8('0x9')]||'';this[_0xa9e8('0xa')]=_0x5272b7[_0xa9e8('0xa')]||'';this[_0xa9e8('0xb')]=_0x5272b7['type']||_0xa9e8('0xc');this[_0xa9e8('0xd')]=0x0;this[_0xa9e8('0xe')]=0x0;this[_0xa9e8('0xf')]=0x0;this['sumDuration']=0x0;this[_0xa9e8('0x10')]=0x0;this[_0xa9e8('0x11')]=0x0;this[_0xa9e8('0x12')]=0x0;this[_0xa9e8('0x13')]=0x0;this['available']=0x0;this[_0xa9e8('0x14')]=0x0;this[_0xa9e8('0x15')]=0x0;this[_0xa9e8('0x16')]=0x0;this[_0xa9e8('0x17')]=0x0;this[_0xa9e8('0x18')]=0x0;this[_0xa9e8('0x19')]=0x0;this[_0xa9e8('0x1a')]=0x0;this[_0xa9e8('0x1b')]=0x0;this['ringInUse']=0x0;this[_0xa9e8('0x1c')]=0x0;this['unavailable']=0x0;this['unknown']=0x0;this['acw']=_0x5272b7['acw']||![];this['acwTimeout']=_0x5272b7[_0xa9e8('0x1d')]||0xa;this[_0xa9e8('0x1e')]=_0x5272b7[_0xa9e8('0x1e')]||'no';this[_0xa9e8('0x1f')]=!![];this[_0xa9e8('0x20')]='';this[_0xa9e8('0x21')]='';this[_0xa9e8('0x22')]=0x0;this[_0xa9e8('0x23')]=0x0;this['dialTimezone']=_0x5272b7['dialTimezone']||null;this['dialGlobalInterval']=_0x5272b7[_0xa9e8('0x24')]?_0x5272b7[_0xa9e8('0x24')]:null;this[_0xa9e8('0x25')]=_0x5272b7['dialActive'];this[_0xa9e8('0x26')]=_0x5272b7[_0xa9e8('0x26')]||_0xa9e8('0x27');this[_0xa9e8('0x28')]=_0x5272b7[_0xa9e8('0x28')]||0x0;this[_0xa9e8('0x29')]=_0x5272b7[_0xa9e8('0x29')]||0x0;this[_0xa9e8('0x2a')]=_0x5272b7[_0xa9e8('0x2a')]||0x1;this[_0xa9e8('0x2b')]=_0x5272b7[_0xa9e8('0x2b')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x5272b7[_0xa9e8('0x2c')]||0.03;this[_0xa9e8('0x2d')]=_0x5272b7[_0xa9e8('0x2d')]||0x258;this[_0xa9e8('0x2e')]=_0x5272b7[_0xa9e8('0x2e')]||'anonymous';this[_0xa9e8('0x2f')]=_0x5272b7['dialOriginateCallerIdNumber']||_0xa9e8('0x30');this[_0xa9e8('0x31')]=_0x5272b7[_0xa9e8('0x31')]||0x1e;this[_0xa9e8('0x32')]=_0x5272b7[_0xa9e8('0x32')]||_0xa9e8('0x33');this['dialQueueTimeout']=_0x5272b7[_0xa9e8('0x34')]||0x3;this['dialQueueProject']=_0x5272b7[_0xa9e8('0x35')]||undefined;this[_0xa9e8('0x36')]=_0x5272b7['dialCongestionMaxRetry']||0x3;this[_0xa9e8('0x37')]=_0x5272b7['dialCongestionRetryFrequency']||0x96;this[_0xa9e8('0x38')]=_0x5272b7[_0xa9e8('0x38')]||0x3;this[_0xa9e8('0x39')]=_0x5272b7['dialBusyRetryFrequency']||0x96;this[_0xa9e8('0x3a')]=_0x5272b7['dialNoAnswerMaxRetry']||0x3;this[_0xa9e8('0x3b')]=_0x5272b7[_0xa9e8('0x3b')]||0x96;this[_0xa9e8('0x3c')]=_0x5272b7[_0xa9e8('0x3c')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x5272b7[_0xa9e8('0x3d')]||0x96;this[_0xa9e8('0x3e')]=_0x5272b7[_0xa9e8('0x3e')]||0x3;this['dialDropRetryFrequency']=_0x5272b7[_0xa9e8('0x3f')]||0x96;this['dialAbandonedMaxRetry']=_0x5272b7[_0xa9e8('0x40')]||0x3;this[_0xa9e8('0x41')]=_0x5272b7[_0xa9e8('0x41')]||0x96;this[_0xa9e8('0x42')]=_0x5272b7[_0xa9e8('0x42')]||0x3;this[_0xa9e8('0x43')]=_0x5272b7[_0xa9e8('0x43')]||0x96;this[_0xa9e8('0x44')]=_0x5272b7[_0xa9e8('0x44')]||0x3;this[_0xa9e8('0x45')]=_0x5272b7[_0xa9e8('0x45')]||0x96;this[_0xa9e8('0x46')]=_0x5272b7[_0xa9e8('0x46')]||0x3;this['dialGlobalMaxRetry']=_0x5272b7[_0xa9e8('0x47')]||0x4;this[_0xa9e8('0x48')]=_0x5272b7[_0xa9e8('0x48')]?_0x5272b7['Trunk']:undefined;this['TrunkBackup']=_0x5272b7[_0xa9e8('0x49')]?_0x5272b7[_0xa9e8('0x49')]:undefined;this[_0xa9e8('0x4a')]=_0x5272b7[_0xa9e8('0x4a')]||undefined;this[_0xa9e8('0x4b')]=_0x5272b7[_0xa9e8('0x4b')]?_0x5272b7[_0xa9e8('0x4b')]:undefined;this[_0xa9e8('0x4c')]=_0x5272b7[_0xa9e8('0x4c')]||_0xa9e8('0x4d');this[_0xa9e8('0x4e')]=_0x5272b7[_0xa9e8('0x4e')]||undefined;this[_0xa9e8('0x4f')]=_0x5272b7[_0xa9e8('0x4f')]||undefined;this[_0xa9e8('0x50')]=strategy[_0x5272b7[_0xa9e8('0x50')]];this[_0xa9e8('0x51')]=!![];this[_0xa9e8('0x52')]=_0x5272b7[_0xa9e8('0x52')]||![];this['dialAMDInitialSilence']=_0x5272b7['dialAMDInitialSilence'];this[_0xa9e8('0x53')]=_0x5272b7['dialAMDGreeting'];this[_0xa9e8('0x54')]=_0x5272b7[_0xa9e8('0x54')];this[_0xa9e8('0x55')]=_0x5272b7[_0xa9e8('0x55')];this[_0xa9e8('0x56')]=_0x5272b7['dialAMDMinWordLength'];this[_0xa9e8('0x57')]=_0x5272b7[_0xa9e8('0x57')];this[_0xa9e8('0x58')]=_0x5272b7[_0xa9e8('0x58')];this[_0xa9e8('0x59')]=_0x5272b7[_0xa9e8('0x59')];this[_0xa9e8('0x5a')]=_0x5272b7[_0xa9e8('0x5a')];this[_0xa9e8('0x5b')]=0x0;this[_0xa9e8('0x5c')]=0x0;this[_0xa9e8('0x5d')]=_0x5272b7[_0xa9e8('0x5d')];this[_0xa9e8('0x5e')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xa9e8('0x5f')]=0x0;this[_0xa9e8('0x60')]=0x0;this[_0xa9e8('0x61')]=0x0;this[_0xa9e8('0x62')]=0x0;this[_0xa9e8('0x63')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xa9e8('0x64')]=0x0;this[_0xa9e8('0x65')]=0x0;this[_0xa9e8('0x66')]=0x0;this[_0xa9e8('0x67')]=0x0;this['startProgressive']=undefined;this[_0xa9e8('0x68')]=undefined;this[_0xa9e8('0x69')]=undefined;this[_0xa9e8('0x6a')]=1.05;this[_0xa9e8('0x6b')]=0x0;this[_0xa9e8('0x6c')]=0x0;this[_0xa9e8('0x6d')]=0x0;this[_0xa9e8('0x6e')]=0x0;this[_0xa9e8('0x6f')]=0x0;this[_0xa9e8('0x70')]=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xa9e8('0x71')]=_0x5272b7['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x5272b7[_0xa9e8('0x72')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xa9e8('0x73')]=0x0;this[_0xa9e8('0x74')]=0x1;this[_0xa9e8('0x75')]=0x0;this['erlangCallToSecond']=0x0;this[_0xa9e8('0x76')]=0x0;this[_0xa9e8('0x77')]=0x0;this[_0xa9e8('0x78')]=_0x5272b7['dialRecallMeTimeout']||0x1e;this[_0xa9e8('0x79')]=_0x5272b7[_0xa9e8('0x79')]||![];this['dialPreviewAutoRecallMe']=!!_0x5272b7[_0xa9e8('0x7a')]||![];this['dialPreviewRecallmeReminder']=!!_0x5272b7['dialPreviewRecallmeReminder']||![];this[_0xa9e8('0x7b')]=_0x5272b7[_0xa9e8('0x7b')]||undefined;this[_0xa9e8('0x7c')]=_0x5272b7[_0xa9e8('0x7c')]||![];this[_0xa9e8('0x7d')]=_0x5272b7[_0xa9e8('0x7d')]||![];this['monitor_format']=monitorFormat[_0x5272b7[_0xa9e8('0xa')]]?monitorFormat[_0x5272b7[_0xa9e8('0xa')]]:undefined;this[_0xa9e8('0x7e')]=_0x5272b7[_0xa9e8('0x7e')]||![];this[_0xa9e8('0x7f')]=_0x5272b7[_0xa9e8('0x7f')]?_0x5272b7[_0xa9e8('0x7f')]:undefined;this[_0xa9e8('0x80')]=![];}module[_0xa9e8('0x81')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 90e66f5..7c7b75b 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac21=['available','inUse','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','paused','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','answered','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','talking','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','prototype','createReport','loggedin','callers','length','SIP/','online','includes','status','booked','keys','queue','some','compareToOutboundQueue','active','outboundNoAnswerCallsDay','preview','exports','loggedIn','loggedInDb','ringing','waiting'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xac21,0x1af));var _0x1ac2=function(_0x123892,_0x2ae90b){_0x123892=_0x123892-0x0;var _0x5d47db=_0xac21[_0x123892];return _0x5d47db;};'use strict';var INBOUND_COUNTERS=['available',_0x1ac2('0x0'),_0x1ac2('0x1'),'paused',_0x1ac2('0x2'),'talking',_0x1ac2('0x3')];var OUTBOUND_COUNTERS=[_0x1ac2('0x4'),'answered',_0x1ac2('0x5'),'loggedIn',_0x1ac2('0x1'),_0x1ac2('0x6'),_0x1ac2('0x7'),_0x1ac2('0x8'),_0x1ac2('0x9'),_0x1ac2('0xa'),_0x1ac2('0xb'),'outboundNoAnswerCallsDay',_0x1ac2('0xc'),_0x1ac2('0xd'),_0x1ac2('0xe'),_0x1ac2('0xf'),_0x1ac2('0x10'),_0x1ac2('0x11'),'talking',_0x1ac2('0x12'),_0x1ac2('0x13'),_0x1ac2('0x14'),_0x1ac2('0x3')];function VoiceQueueSummary(_0x405ca6){this['id']=_0x405ca6['id'];this[_0x1ac2('0x15')]=_0x405ca6['name'];this[_0x1ac2('0x16')]=_0x405ca6[_0x1ac2('0x16')];this[_0x1ac2('0x17')]=_0x405ca6[_0x1ac2('0x17')]||0x0;this[_0x1ac2('0x18')]=_0x405ca6[_0x1ac2('0x18')]||0x0;this[_0x1ac2('0x4')]=_0x405ca6[_0x1ac2('0x4')]||0x0;this[_0x1ac2('0x19')]=_0x405ca6['busy']||0x0;this[_0x1ac2('0x5')]=_0x405ca6[_0x1ac2('0x5')]||0x0;this[_0x1ac2('0x1a')]=_0x405ca6[_0x1ac2('0x1a')]||0x0;this[_0x1ac2('0x0')]=_0x405ca6[_0x1ac2('0x0')]||0x0;this[_0x1ac2('0x1')]=_0x405ca6[_0x1ac2('0x1')]||0x0;this['onHold']=_0x405ca6[_0x1ac2('0x1b')]||0x0;this[_0x1ac2('0x1c')]=_0x405ca6['notInUse']||0x0;this[_0x1ac2('0x10')]=_0x405ca6[_0x1ac2('0x10')]||0x0;this['ringing']=_0x405ca6[_0x1ac2('0x2')]||0x0;this['ringInUse']=_0x405ca6[_0x1ac2('0x1d')];this[_0x1ac2('0x12')]=_0x405ca6['sumBillable'];this[_0x1ac2('0x13')]=_0x405ca6[_0x1ac2('0x13')];this[_0x1ac2('0x1e')]=_0x405ca6[_0x1ac2('0x1e')]||0x0;this[_0x1ac2('0x1f')]=_0x405ca6[_0x1ac2('0x1f')]||0x0;this[_0x1ac2('0x14')]=_0x405ca6[_0x1ac2('0x14')]||0x0;this[_0x1ac2('0x20')]=_0x405ca6[_0x1ac2('0x20')];this[_0x1ac2('0x21')]=_0x405ca6['unavailable']||0x0;this[_0x1ac2('0x22')]=_0x405ca6[_0x1ac2('0x22')]||0x0;this[_0x1ac2('0x23')]=_0x405ca6[_0x1ac2('0x23')]||0x0;this[_0x1ac2('0x3')]=_0x405ca6[_0x1ac2('0x3')]||0x0;if(_0x405ca6['type']===_0x1ac2('0x24')){this[_0x1ac2('0x11')]=_0x405ca6[_0x1ac2('0x11')]||0x0;this[_0x1ac2('0x25')]=_0x405ca6[_0x1ac2('0x25')];this['dialMethod']=_0x405ca6[_0x1ac2('0x26')];this[_0x1ac2('0x27')]=_0x405ca6[_0x1ac2('0x27')];this[_0x1ac2('0x28')]=_0x405ca6[_0x1ac2('0x28')];this['dialOriginateTimeout']=_0x405ca6[_0x1ac2('0x29')];this[_0x1ac2('0x2a')]=_0x405ca6['dialPrefix'];this[_0x1ac2('0x2b')]=_0x405ca6['temp'];this[_0x1ac2('0x2c')]=_0x405ca6[_0x1ac2('0x2c')];this[_0x1ac2('0x8')]=_0x405ca6['outboundAnswerCallsDay'];this[_0x1ac2('0x9')]=_0x405ca6['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x405ca6[_0x1ac2('0xa')];this[_0x1ac2('0xb')]=_0x405ca6[_0x1ac2('0xb')];this[_0x1ac2('0x2d')]=_0x405ca6[_0x1ac2('0x2d')];this[_0x1ac2('0x2e')]=_0x405ca6[_0x1ac2('0x2e')];this['outboundDropCallsDayTimeout']=_0x405ca6['outboundDropCallsDayTimeout'];this['outboundNoAnswerCallsDay']=_0x405ca6['outboundNoAnswerCallsDay'];this[_0x1ac2('0xc')]=_0x405ca6[_0x1ac2('0xc')];this[_0x1ac2('0x2f')]=_0x405ca6['outboundOriginateFailureCallsDay'];this[_0x1ac2('0xd')]=_0x405ca6[_0x1ac2('0xd')];this['outboundRejectCallsDay']=_0x405ca6[_0x1ac2('0xe')];this[_0x1ac2('0xf')]=_0x405ca6['outboundUnknownCallsDay'];this[_0x1ac2('0x30')]=_0x405ca6[_0x1ac2('0x30')];this[_0x1ac2('0x31')]=_0x405ca6[_0x1ac2('0x31')];this[_0x1ac2('0x32')]=_0x405ca6['predictiveIntervalAvgTalktime'];this[_0x1ac2('0x33')]=_0x405ca6[_0x1ac2('0x33')];this['predictiveIntervalDroppedCallsTimeout']=_0x405ca6[_0x1ac2('0x34')];this[_0x1ac2('0x35')]=_0x405ca6[_0x1ac2('0x35')];this['predictiveIntervalErlangCallsDroppedCalls']=_0x405ca6[_0x1ac2('0x36')];this[_0x1ac2('0x37')]=_0x405ca6[_0x1ac2('0x37')];this[_0x1ac2('0x38')]=_0x405ca6[_0x1ac2('0x38')];this[_0x1ac2('0x39')]=_0x405ca6[_0x1ac2('0x39')];this[_0x1ac2('0x3a')]=_0x405ca6['predictiveIntervalAvailable'];this[_0x1ac2('0x3b')]=_0x405ca6[_0x1ac2('0x3b')];this['originated']=_0x405ca6[_0x1ac2('0x6')];this[_0x1ac2('0x3c')]=_0x405ca6[_0x1ac2('0x3c')];this[_0x1ac2('0x3d')]=_0x405ca6[_0x1ac2('0x3d')];this[_0x1ac2('0x3e')]=_0x405ca6[_0x1ac2('0x3e')];this[_0x1ac2('0x3f')]=_0x405ca6[_0x1ac2('0x3f')];this[_0x1ac2('0x40')]=_0x405ca6[_0x1ac2('0x40')];this[_0x1ac2('0x41')]=_0x405ca6['startProgressive'];this['message']=_0x405ca6[_0x1ac2('0x42')];this[_0x1ac2('0x43')]=_0x405ca6[_0x1ac2('0x43')];}if(_0x405ca6['Trunk']){this['Trunk']={'id':_0x405ca6[_0x1ac2('0x44')]['id'],'name':_0x405ca6[_0x1ac2('0x44')]['name'],'active':_0x405ca6['Trunk']['active'],'callerid':_0x405ca6[_0x1ac2('0x44')]['callerid']};}}VoiceQueueSummary[_0x1ac2('0x45')][_0x1ac2('0x46')]=function(_0x3c2538,_0x374419,_0x82b44,_0x36b42f){this['loggedInDb']=0x0;this[_0x1ac2('0x1f')]=0x0;this['paused']=0x0;this[_0x1ac2('0x22')]=0x0;this[_0x1ac2('0x1c')]=0x0;this[_0x1ac2('0x5')]=0x0;this['busy']=0x0;this['invalid']=0x0;this[_0x1ac2('0x21')]=0x0;this['ringing']=0x0;this[_0x1ac2('0x1d')]=0x0;this[_0x1ac2('0x1b')]=0x0;if(_0x82b44){if(_0x82b44['available']){this[_0x1ac2('0x4')]=Number(_0x82b44['available']);}if(_0x82b44[_0x1ac2('0x47')]){this['loggedIn']=Number(_0x82b44['loggedin']);}if(_0x82b44[_0x1ac2('0x48')]){this['waiting']=Number(_0x82b44[_0x1ac2('0x48')]);}}for(var _0x4df450=0x0;_0x4df450<_0x3c2538[_0x1ac2('0x49')];_0x4df450++){var _0x297a0c=_0x374419[_0x1ac2('0x4a')+_0x3c2538[_0x4df450][_0x1ac2('0x15')]];if(_0x297a0c&&_0x297a0c[_0x1ac2('0x4b')]){this[_0x1ac2('0x1')]+=0x1;}if(_0x3c2538[_0x4df450]['incall']==='1'){this[_0x1ac2('0x1f')]+=0x1;}if(_0x3c2538[_0x4df450][_0x1ac2('0x10')]==='1'&&!['2','7','8'][_0x1ac2('0x4c')](_0x3c2538[_0x4df450]['status'])){this[_0x1ac2('0x10')]+=0x1;}switch(_0x3c2538[_0x4df450][_0x1ac2('0x4d')]){case'0':this[_0x1ac2('0x22')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0x1ac2('0x5')]+=0x1;break;case'3':this[_0x1ac2('0x19')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0x1ac2('0x2')]+=0x1;break;case'7':this[_0x1ac2('0x1d')]+=0x1;break;case'8':this[_0x1ac2('0x1b')]+=0x1;break;}}if(this['dialMethod']===_0x1ac2('0x4e')){var _0x318d98=Object[_0x1ac2('0x4f')](_0x36b42f);for(var _0x39129d=0x0;_0x39129d<_0x318d98[_0x1ac2('0x49')];_0x39129d++){var _0x3e06e2=_0x318d98[_0x39129d];var _0x29527e=_0x36b42f[_0x3e06e2];if(_0x29527e[_0x1ac2('0x50')]===this[_0x1ac2('0x15')]&&_0x29527e[_0x1ac2('0x20')]==='dialer'&&_0x29527e['exten']==='xcally-motion-preview'){this[_0x1ac2('0x1f')]+=0x1;}}if(this[_0x1ac2('0x1f')]>this[_0x1ac2('0x5')]){this[_0x1ac2('0x1f')]=this[_0x1ac2('0x5')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary['prototype']['compareToInboundQueue']=function(_0x2acf50){var _0x1879ae=![];if(_0x2acf50){_0x1879ae=INBOUND_COUNTERS[_0x1ac2('0x51')](function(_0x1f153c){return this[_0x1f153c]!==_0x2acf50[_0x1f153c];},this);}return _0x1879ae;};VoiceQueueSummary['prototype'][_0x1ac2('0x52')]=function(_0x14d04a){var _0x56d721=![];var _0x411ab3=![];var _0x404be5=![];if(_0x14d04a){_0x56d721=this[_0x1ac2('0x26')]!==_0x14d04a[_0x1ac2('0x26')]||this['dialActive']!==_0x14d04a[_0x1ac2('0x25')]||this['message']!==_0x14d04a[_0x1ac2('0x42')]||this[_0x1ac2('0x43')]!==_0x14d04a['statusMessage'];_0x411ab3=OUTBOUND_COUNTERS[_0x1ac2('0x51')](function(_0x230e0e){return this[_0x230e0e]!==_0x14d04a[_0x230e0e];},this);if(this[_0x1ac2('0x44')]&&_0x14d04a[_0x1ac2('0x44')]){_0x404be5=this[_0x1ac2('0x44')][_0x1ac2('0x15')]!==_0x14d04a[_0x1ac2('0x44')][_0x1ac2('0x15')]||this[_0x1ac2('0x44')][_0x1ac2('0x53')]!==_0x14d04a['Trunk']['active'];}}return _0x56d721||_0x411ab3||_0x404be5;};VoiceQueueSummary[_0x1ac2('0x45')]['updateReportFromOutboundQueue']=function(_0x5ab826){this[_0x1ac2('0x18')]=_0x5ab826[_0x1ac2('0x18')];this[_0x1ac2('0x42')]=_0x5ab826[_0x1ac2('0x42')];this[_0x1ac2('0x43')]=_0x5ab826['statusMessage'];this[_0x1ac2('0x6')]=_0x5ab826[_0x1ac2('0x6')];this[_0x1ac2('0x7')]=_0x5ab826[_0x1ac2('0x7')];this[_0x1ac2('0x8')]=_0x5ab826[_0x1ac2('0x8')];this['outboundBlacklistCallsDay']=_0x5ab826[_0x1ac2('0x9')];this['outboundBusyCallsDay']=_0x5ab826['outboundBusyCallsDay'];this[_0x1ac2('0xb')]=_0x5ab826['outboundCongestionCallsDay'];this[_0x1ac2('0x54')]=_0x5ab826[_0x1ac2('0x54')];this['outboundNoSuchCallsDay']=_0x5ab826['outboundNoSuchCallsDay'];this[_0x1ac2('0xd')]=_0x5ab826[_0x1ac2('0xd')];this[_0x1ac2('0xe')]=_0x5ab826[_0x1ac2('0xe')];this[_0x1ac2('0xf')]=_0x5ab826[_0x1ac2('0xf')];this[_0x1ac2('0x12')]=_0x5ab826[_0x1ac2('0x12')];this[_0x1ac2('0x13')]=_0x5ab826['sumDuration'];this['total']=_0x5ab826[_0x1ac2('0x14')];if(this[_0x1ac2('0x26')]===_0x1ac2('0x55')){this[_0x1ac2('0x11')]=_0x5ab826[_0x1ac2('0x11')];}};module[_0x1ac2('0x56')]=VoiceQueueSummary; \ No newline at end of file +var _0xfd0f=['outboundRejectCallsDay','outboundUnknownCallsDay','sumBillable','sumDuration','name','strategy','abandoned','answered','invalid','onHold','notInUse','ringInUse','sumHoldTime','total','type','unavailable','unknown','unmanaged','waiting','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','prototype','createReport','busy','loggedin','callers','length','SIP/','online','incall','includes','status','booked','keys','queue','exten','xcally-motion-preview','compareToInboundQueue','compareToOutboundQueue','some','active','updateReportFromOutboundQueue','preview','available','loggedIn','paused','ringing','talking','inUse','loggedInDb','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundReCallsDay'];(function(_0x3e719b,_0xa44458){var _0x20740d=function(_0x22626b){while(--_0x22626b){_0x3e719b['push'](_0x3e719b['shift']());}};_0x20740d(++_0xa44458);}(_0xfd0f,0x1b8));var _0xffd0=function(_0xa0e4d9,_0x456bff){_0xa0e4d9=_0xa0e4d9-0x0;var _0x958984=_0xfd0f[_0xa0e4d9];return _0x958984;};'use strict';var INBOUND_COUNTERS=[_0xffd0('0x0'),_0xffd0('0x1'),'loggedInDb',_0xffd0('0x2'),_0xffd0('0x3'),_0xffd0('0x4'),'waiting'];var OUTBOUND_COUNTERS=[_0xffd0('0x0'),'answered',_0xffd0('0x5'),_0xffd0('0x1'),_0xffd0('0x6'),_0xffd0('0x7'),_0xffd0('0x8'),_0xffd0('0x9'),_0xffd0('0xa'),_0xffd0('0xb'),_0xffd0('0xc'),'outboundNoAnswerCallsDay',_0xffd0('0xd'),_0xffd0('0xe'),_0xffd0('0xf'),_0xffd0('0x10'),'paused','pTalking',_0xffd0('0x4'),_0xffd0('0x11'),_0xffd0('0x12'),'total','waiting'];function VoiceQueueSummary(_0xa824cc){this['id']=_0xa824cc['id'];this[_0xffd0('0x13')]=_0xa824cc['name'];this[_0xffd0('0x14')]=_0xa824cc[_0xffd0('0x14')];this[_0xffd0('0x15')]=_0xa824cc['abandoned']||0x0;this[_0xffd0('0x16')]=_0xa824cc[_0xffd0('0x16')]||0x0;this['available']=_0xa824cc[_0xffd0('0x0')]||0x0;this['busy']=_0xa824cc['busy']||0x0;this[_0xffd0('0x5')]=_0xa824cc['inUse']||0x0;this[_0xffd0('0x17')]=_0xa824cc[_0xffd0('0x17')]||0x0;this[_0xffd0('0x1')]=_0xa824cc[_0xffd0('0x1')]||0x0;this[_0xffd0('0x6')]=_0xa824cc['loggedInDb']||0x0;this['onHold']=_0xa824cc[_0xffd0('0x18')]||0x0;this[_0xffd0('0x19')]=_0xa824cc[_0xffd0('0x19')]||0x0;this[_0xffd0('0x2')]=_0xa824cc[_0xffd0('0x2')]||0x0;this[_0xffd0('0x3')]=_0xa824cc[_0xffd0('0x3')]||0x0;this[_0xffd0('0x1a')]=_0xa824cc[_0xffd0('0x1a')];this[_0xffd0('0x11')]=_0xa824cc[_0xffd0('0x11')];this[_0xffd0('0x12')]=_0xa824cc[_0xffd0('0x12')];this[_0xffd0('0x1b')]=_0xa824cc[_0xffd0('0x1b')]||0x0;this[_0xffd0('0x4')]=_0xa824cc['talking']||0x0;this['total']=_0xa824cc[_0xffd0('0x1c')]||0x0;this[_0xffd0('0x1d')]=_0xa824cc[_0xffd0('0x1d')];this['unavailable']=_0xa824cc[_0xffd0('0x1e')]||0x0;this['unknown']=_0xa824cc[_0xffd0('0x1f')]||0x0;this[_0xffd0('0x20')]=_0xa824cc[_0xffd0('0x20')]||0x0;this[_0xffd0('0x21')]=_0xa824cc[_0xffd0('0x21')]||0x0;if(_0xa824cc[_0xffd0('0x1d')]===_0xffd0('0x22')){this[_0xffd0('0x23')]=_0xa824cc[_0xffd0('0x23')]||0x0;this[_0xffd0('0x24')]=_0xa824cc[_0xffd0('0x24')];this[_0xffd0('0x25')]=_0xa824cc[_0xffd0('0x25')];this['dialOriginateCallerIdName']=_0xa824cc['dialOriginateCallerIdName'];this[_0xffd0('0x26')]=_0xa824cc['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0xa824cc[_0xffd0('0x27')];this[_0xffd0('0x28')]=_0xa824cc[_0xffd0('0x28')];this[_0xffd0('0x29')]=_0xa824cc[_0xffd0('0x29')];this[_0xffd0('0x2a')]=_0xa824cc['outboundAnswerAgiCallsDay'];this[_0xffd0('0x9')]=_0xa824cc['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0xa824cc['outboundBlacklistCallsDay'];this[_0xffd0('0xb')]=_0xa824cc[_0xffd0('0xb')];this[_0xffd0('0xc')]=_0xa824cc[_0xffd0('0xc')];this[_0xffd0('0x2b')]=_0xa824cc[_0xffd0('0x2b')];this['outboundDropCallsDayCallersExit']=_0xa824cc['outboundDropCallsDayCallersExit'];this['outboundDropCallsDayTimeout']=_0xa824cc[_0xffd0('0x2c')];this['outboundNoAnswerCallsDay']=_0xa824cc[_0xffd0('0x2d')];this[_0xffd0('0xd')]=_0xa824cc['outboundNoSuchCallsDay'];this[_0xffd0('0x2e')]=_0xa824cc['outboundOriginateFailureCallsDay'];this['outboundReCallsDay']=_0xa824cc['outboundReCallsDay'];this[_0xffd0('0xf')]=_0xa824cc[_0xffd0('0xf')];this[_0xffd0('0x10')]=_0xa824cc[_0xffd0('0x10')];this[_0xffd0('0x2f')]=_0xa824cc['predictiveIntervalAnsweredCalls'];this[_0xffd0('0x30')]=_0xa824cc[_0xffd0('0x30')];this['predictiveIntervalAvgTalktime']=_0xa824cc[_0xffd0('0x31')];this[_0xffd0('0x32')]=_0xa824cc[_0xffd0('0x32')];this[_0xffd0('0x33')]=_0xa824cc[_0xffd0('0x33')];this[_0xffd0('0x34')]=_0xa824cc['predictiveIntervalErlangCalls'];this[_0xffd0('0x35')]=_0xa824cc[_0xffd0('0x35')];this['predictiveIntervalHitRate']=_0xa824cc[_0xffd0('0x36')];this[_0xffd0('0x37')]=_0xa824cc['predictiveIntervalMultiplicativeFactor'];this[_0xffd0('0x38')]=_0xa824cc[_0xffd0('0x38')];this['predictiveIntervalAvailable']=_0xa824cc[_0xffd0('0x39')];this['predictiveIntervalTotalCalls']=_0xa824cc[_0xffd0('0x3a')];this[_0xffd0('0x7')]=_0xa824cc['originated'];this[_0xffd0('0x3b')]=_0xa824cc[_0xffd0('0x3b')];this[_0xffd0('0x3c')]=_0xa824cc[_0xffd0('0x3c')];this[_0xffd0('0x3d')]=_0xa824cc[_0xffd0('0x3d')];this[_0xffd0('0x3e')]=_0xa824cc[_0xffd0('0x3e')];this[_0xffd0('0x3f')]=_0xa824cc[_0xffd0('0x3f')];this[_0xffd0('0x40')]=_0xa824cc[_0xffd0('0x40')];this[_0xffd0('0x41')]=_0xa824cc[_0xffd0('0x41')];this[_0xffd0('0x42')]=_0xa824cc[_0xffd0('0x42')];}if(_0xa824cc[_0xffd0('0x43')]){this['Trunk']={'id':_0xa824cc[_0xffd0('0x43')]['id'],'name':_0xa824cc[_0xffd0('0x43')][_0xffd0('0x13')],'active':_0xa824cc[_0xffd0('0x43')]['active'],'callerid':_0xa824cc['Trunk'][_0xffd0('0x44')]};}}VoiceQueueSummary[_0xffd0('0x45')][_0xffd0('0x46')]=function(_0xc0aa,_0x47e2f3,_0x38980a,_0x129362){this[_0xffd0('0x6')]=0x0;this[_0xffd0('0x4')]=0x0;this[_0xffd0('0x2')]=0x0;this[_0xffd0('0x1f')]=0x0;this[_0xffd0('0x19')]=0x0;this[_0xffd0('0x5')]=0x0;this[_0xffd0('0x47')]=0x0;this[_0xffd0('0x17')]=0x0;this[_0xffd0('0x1e')]=0x0;this[_0xffd0('0x3')]=0x0;this[_0xffd0('0x1a')]=0x0;this[_0xffd0('0x18')]=0x0;if(_0x38980a){if(_0x38980a[_0xffd0('0x0')]){this[_0xffd0('0x0')]=Number(_0x38980a[_0xffd0('0x0')]);}if(_0x38980a[_0xffd0('0x48')]){this[_0xffd0('0x1')]=Number(_0x38980a[_0xffd0('0x48')]);}if(_0x38980a[_0xffd0('0x49')]){this['waiting']=Number(_0x38980a[_0xffd0('0x49')]);}}for(var _0x46832f=0x0;_0x46832f<_0xc0aa[_0xffd0('0x4a')];_0x46832f++){var _0x35ce9b=_0x47e2f3[_0xffd0('0x4b')+_0xc0aa[_0x46832f][_0xffd0('0x13')]];if(_0x35ce9b&&_0x35ce9b[_0xffd0('0x4c')]){this[_0xffd0('0x6')]+=0x1;}if(_0xc0aa[_0x46832f][_0xffd0('0x4d')]==='1'){this['talking']+=0x1;}if(_0xc0aa[_0x46832f][_0xffd0('0x2')]==='1'&&!['2','7','8'][_0xffd0('0x4e')](_0xc0aa[_0x46832f][_0xffd0('0x4f')])){this[_0xffd0('0x2')]+=0x1;}switch(_0xc0aa[_0x46832f][_0xffd0('0x4f')]){case'0':this['unknown']+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this[_0xffd0('0x47')]+=0x1;break;case'4':this[_0xffd0('0x17')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0xffd0('0x3')]+=0x1;break;case'7':this[_0xffd0('0x1a')]+=0x1;break;case'8':this[_0xffd0('0x18')]+=0x1;break;}}if(this[_0xffd0('0x25')]===_0xffd0('0x50')){var _0x40c14d=Object[_0xffd0('0x51')](_0x129362);for(var _0x2c0ffd=0x0;_0x2c0ffd<_0x40c14d[_0xffd0('0x4a')];_0x2c0ffd++){var _0x27f8a2=_0x40c14d[_0x2c0ffd];var _0x27e4ed=_0x129362[_0x27f8a2];if(_0x27e4ed[_0xffd0('0x52')]===this[_0xffd0('0x13')]&&_0x27e4ed['type']==='dialer'&&_0x27e4ed[_0xffd0('0x53')]===_0xffd0('0x54')){this[_0xffd0('0x4')]+=0x1;}}if(this['talking']>this[_0xffd0('0x5')]){this['talking']=this[_0xffd0('0x5')];}this[_0xffd0('0x23')]=0x0;}return this;};VoiceQueueSummary[_0xffd0('0x45')][_0xffd0('0x55')]=function(_0x55f221){var _0x5e8681=![];if(_0x55f221){_0x5e8681=INBOUND_COUNTERS['some'](function(_0x2a0302){return this[_0x2a0302]!==_0x55f221[_0x2a0302];},this);}return _0x5e8681;};VoiceQueueSummary[_0xffd0('0x45')][_0xffd0('0x56')]=function(_0xab0969){var _0x22e958=![];var _0x320cfb=![];var _0x464838=![];if(_0xab0969){_0x22e958=this[_0xffd0('0x25')]!==_0xab0969[_0xffd0('0x25')]||this[_0xffd0('0x24')]!==_0xab0969[_0xffd0('0x24')]||this[_0xffd0('0x41')]!==_0xab0969['message']||this[_0xffd0('0x42')]!==_0xab0969[_0xffd0('0x42')];_0x320cfb=OUTBOUND_COUNTERS[_0xffd0('0x57')](function(_0x304a52){return this[_0x304a52]!==_0xab0969[_0x304a52];},this);if(this[_0xffd0('0x43')]&&_0xab0969[_0xffd0('0x43')]){_0x464838=this[_0xffd0('0x43')]['name']!==_0xab0969[_0xffd0('0x43')][_0xffd0('0x13')]||this[_0xffd0('0x43')][_0xffd0('0x58')]!==_0xab0969['Trunk']['active'];}}return _0x22e958||_0x320cfb||_0x464838;};VoiceQueueSummary['prototype'][_0xffd0('0x59')]=function(_0x336451){this[_0xffd0('0x16')]=_0x336451[_0xffd0('0x16')];this[_0xffd0('0x41')]=_0x336451[_0xffd0('0x41')];this[_0xffd0('0x42')]=_0x336451['statusMessage'];this[_0xffd0('0x7')]=_0x336451[_0xffd0('0x7')];this[_0xffd0('0x8')]=_0x336451[_0xffd0('0x8')];this[_0xffd0('0x9')]=_0x336451[_0xffd0('0x9')];this[_0xffd0('0xa')]=_0x336451['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x336451[_0xffd0('0xb')];this[_0xffd0('0xc')]=_0x336451[_0xffd0('0xc')];this['outboundNoAnswerCallsDay']=_0x336451[_0xffd0('0x2d')];this[_0xffd0('0xd')]=_0x336451[_0xffd0('0xd')];this[_0xffd0('0xe')]=_0x336451['outboundReCallsDay'];this['outboundRejectCallsDay']=_0x336451[_0xffd0('0xf')];this['outboundUnknownCallsDay']=_0x336451[_0xffd0('0x10')];this['sumBillable']=_0x336451['sumBillable'];this['sumDuration']=_0x336451['sumDuration'];this[_0xffd0('0x1c')]=_0x336451[_0xffd0('0x1c')];if(this[_0xffd0('0x25')]===_0xffd0('0x5a')){this['pTalking']=_0x336451[_0xffd0('0x23')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index d4ca014..3a2fe99 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 _0xd890=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x90b372,_0xd01696){var _0x4a5f5e=function(_0x9550e4){while(--_0x9550e4){_0x90b372['push'](_0x90b372['shift']());}};_0x4a5f5e(++_0xd01696);}(_0xd890,0x190));var _0x0d89=function(_0x4c9380,_0x2fefc0){_0x4c9380=_0x4c9380-0x0;var _0x49a523=_0xd890[_0x4c9380];return _0x49a523;};'use strict';function VtigerAccount(_0x3393a0){this['id']=_0x3393a0['id']||0x0;this['name']=_0x3393a0[_0x0d89('0x0')]||'';this[_0x0d89('0x1')]=_0x3393a0['username']||'';this[_0x0d89('0x2')]=_0x3393a0[_0x0d89('0x2')]||'';this[_0x0d89('0x3')]=_0x3393a0[_0x0d89('0x3')]||'';this['serverUrl']=_0x3393a0[_0x0d89('0x4')]||'';this[_0x0d89('0x5')]=_0x3393a0[_0x0d89('0x5')]||{};}module[_0x0d89('0x6')]=VtigerAccount; \ No newline at end of file +var _0x6642=['remoteUri','serverUrl','Configurations','name','username','accessKey'];(function(_0x69a35f,_0x4fcd24){var _0x4964d1=function(_0x10a3fb){while(--_0x10a3fb){_0x69a35f['push'](_0x69a35f['shift']());}};_0x4964d1(++_0x4fcd24);}(_0x6642,0x81));var _0x2664=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6642[_0x3dd15e];return _0x231fd0;};'use strict';function VtigerAccount(_0x1be20e){this['id']=_0x1be20e['id']||0x0;this['name']=_0x1be20e[_0x2664('0x0')]||'';this[_0x2664('0x1')]=_0x1be20e[_0x2664('0x1')]||'';this[_0x2664('0x2')]=_0x1be20e[_0x2664('0x2')]||'';this[_0x2664('0x3')]=_0x1be20e[_0x2664('0x3')]||'';this[_0x2664('0x4')]=_0x1be20e[_0x2664('0x4')]||'';this['Configurations']=_0x1be20e[_0x2664('0x5')]||{};}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 76b9ec5..b4fba79 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 _0xb96c=['authType','type','integrationTab','Configurations','exports','name','username','password','remoteUri'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0xb96c,0xf8));var _0xcb96=function(_0x18dd84,_0x5f2ba0){_0x18dd84=_0x18dd84-0x0;var _0x5e740c=_0xb96c[_0x18dd84];return _0x5e740c;};'use strict';function ZendeskAccount(_0x46295b){this['id']=_0x46295b['id']||0x0;this[_0xcb96('0x0')]=_0x46295b['name']||'';this[_0xcb96('0x1')]=_0x46295b['username']||'';this['password']=_0x46295b[_0xcb96('0x2')]||'';this['token']=_0x46295b['token']||'';this[_0xcb96('0x3')]=_0x46295b[_0xcb96('0x3')]||'';this['authType']=_0x46295b[_0xcb96('0x4')]||'';this[_0xcb96('0x5')]=_0x46295b[_0xcb96('0x5')]||_0xcb96('0x6');this['serverUrl']=_0x46295b['serverUrl']||'';this[_0xcb96('0x7')]=_0x46295b[_0xcb96('0x7')]||{};}module[_0xcb96('0x8')]=ZendeskAccount; \ No newline at end of file +var _0x9492=['authType','type','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x9492,0x13b));var _0x2949=function(_0x3b8837,_0x34da1a){_0x3b8837=_0x3b8837-0x0;var _0x35be05=_0x9492[_0x3b8837];return _0x35be05;};'use strict';function ZendeskAccount(_0x3d69d5){this['id']=_0x3d69d5['id']||0x0;this['name']=_0x3d69d5[_0x2949('0x0')]||'';this[_0x2949('0x1')]=_0x3d69d5['username']||'';this[_0x2949('0x2')]=_0x3d69d5['password']||'';this[_0x2949('0x3')]=_0x3d69d5[_0x2949('0x3')]||'';this[_0x2949('0x4')]=_0x3d69d5[_0x2949('0x4')]||'';this['authType']=_0x3d69d5[_0x2949('0x5')]||'';this['type']=_0x3d69d5[_0x2949('0x6')]||'integrationTab';this[_0x2949('0x7')]=_0x3d69d5['serverUrl']||'';this[_0x2949('0x8')]=_0x3d69d5[_0x2949('0x8')]||{};}module[_0x2949('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 4d8e37f..5f5b4b7 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 _0x30f9=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x30f9,0x7e));var _0x930f=function(_0x31b31b,_0x5f044e){_0x31b31b=_0x31b31b-0x0;var _0x2c8fc2=_0x30f9[_0x31b31b];return _0x2c8fc2;};'use strict';function ZohoAccount(_0x2ac04b){this['id']=_0x2ac04b['id']||0x0;this[_0x930f('0x0')]=_0x2ac04b['name']||'';this[_0x930f('0x1')]=_0x2ac04b[_0x930f('0x1')]||'';this[_0x930f('0x2')]=_0x2ac04b[_0x930f('0x2')]||'';this[_0x930f('0x3')]=_0x2ac04b['zone']||'';this[_0x930f('0x4')]=_0x2ac04b['clientId']||'';this[_0x930f('0x5')]=_0x2ac04b[_0x930f('0x5')]||'';this[_0x930f('0x6')]=_0x2ac04b[_0x930f('0x6')]||'';this[_0x930f('0x7')]=_0x2ac04b['code']||'';this['refreshToken']=_0x2ac04b[_0x930f('0x8')]||'';this['Configurations']=_0x2ac04b[_0x930f('0x9')]||{};}module[_0x930f('0xa')]=ZohoAccount; \ No newline at end of file +var _0xb8a1=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name'];(function(_0x52b0ee,_0x436dbb){var _0x337060=function(_0x41e2d7){while(--_0x41e2d7){_0x52b0ee['push'](_0x52b0ee['shift']());}};_0x337060(++_0x436dbb);}(_0xb8a1,0x6d));var _0x1b8a=function(_0xdedac2,_0x41afb9){_0xdedac2=_0xdedac2-0x0;var _0x525af9=_0xb8a1[_0xdedac2];return _0x525af9;};'use strict';function ZohoAccount(_0xd680e0){this['id']=_0xd680e0['id']||0x0;this[_0x1b8a('0x0')]=_0xd680e0[_0x1b8a('0x0')]||'';this[_0x1b8a('0x1')]=_0xd680e0[_0x1b8a('0x1')]||'';this[_0x1b8a('0x2')]=_0xd680e0[_0x1b8a('0x2')]||'';this[_0x1b8a('0x3')]=_0xd680e0[_0x1b8a('0x3')]||'';this[_0x1b8a('0x4')]=_0xd680e0['clientId']||'';this[_0x1b8a('0x5')]=_0xd680e0[_0x1b8a('0x5')]||'';this[_0x1b8a('0x6')]=_0xd680e0[_0x1b8a('0x6')]||'';this[_0x1b8a('0x7')]=_0xd680e0['code']||'';this[_0x1b8a('0x8')]=_0xd680e0[_0x1b8a('0x8')]||'';this['Configurations']=_0xd680e0[_0x1b8a('0x9')]||{};}module[_0x1b8a('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 3092b38..e46a503 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 _0x5f66=['countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','lodash','isNil','uniqueid','idContact','queue','name','type','dialAnswer','membername','Agent','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry'];(function(_0xf1af27,_0x598bb1){var _0x46b274=function(_0x1dba43){while(--_0x1dba43){_0xf1af27['push'](_0xf1af27['shift']());}};_0x46b274(++_0x598bb1);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var util=require('util');var _=require(_0x65f6('0x0'));var moment=require('moment');function checkNameSurname(_0x2d5fd9,_0x2f06ae,_0x3461cd){var _0xbce843='';if(!_[_0x65f6('0x1')](_0x2f06ae)&&'string'===typeof _0x2f06ae){_0xbce843+=_0x2f06ae;}if(!_[_0x65f6('0x1')](_0x3461cd)&&'string'===typeof _0x3461cd){_0xbce843+='\x20'+_0x3461cd;}if(_0xbce843!==''){return _0xbce843;}return _0x2d5fd9;}function Action(_0x1c9f5b,_0x22b017,_0x4ec221,_0x4ed98f,_0x1c0e12){this[_0x65f6('0x2')]=_0x4ec221||undefined;this[_0x65f6('0x3')]=_0x1c9f5b['id'];this[_0x65f6('0x4')]=_0x22b017[_0x65f6('0x5')];this[_0x65f6('0x6')]=_0x22b017['type'];this['campaigntype']=_0x65f6('0x4');this[_0x65f6('0x7')]=![];this[_0x65f6('0x8')]=_[_0x65f6('0x1')](_0x1c9f5b['Agent'])?undefined:_0x1c9f5b[_0x65f6('0x9')]['name'];this['channelAgent']=this[_0x65f6('0x8')]?util['format'](_0x65f6('0xa'),this['membername']):_0x4ed98f||undefined;this[_0x65f6('0xb')]=checkNameSurname(_0x1c9f5b[_0x65f6('0xc')][_0x65f6('0xd')],_0x1c9f5b[_0x65f6('0xc')][_0x65f6('0xe')],_0x1c9f5b[_0x65f6('0xc')][_0x65f6('0xf')]);this[_0x65f6('0x10')]=_0x1c9f5b[_0x65f6('0x10')]||![];this[_0x65f6('0x11')]=_0x1c9f5b['phone'];this[_0x65f6('0x12')]=_0x1c9f5b['scheduledat'];this['countbusyretry']=_0x1c9f5b[_0x65f6('0x13')]||0x0;this[_0x65f6('0x14')]=_0x1c9f5b[_0x65f6('0x14')]||0x0;this[_0x65f6('0x15')]=_0x1c9f5b[_0x65f6('0x15')]||0x0;this[_0x65f6('0x16')]=(_0x1c9f5b[_0x65f6('0x13')]||0x0)+(_0x1c9f5b[_0x65f6('0x14')]||0x0)+(_0x1c9f5b['countnoanswerretry']||0x0)+(_0x1c9f5b['countnosuchnumberretry']||0x0)+(_0x1c9f5b[_0x65f6('0x17')]||0x0)+(_0x1c9f5b['countabandonedretry']||0x0)+(_0x1c9f5b['countmachineretry']||0x0)+(_0x1c9f5b['countagentrejectretry']||0x0);this[_0x65f6('0x18')]=_0x1c9f5b[_0x65f6('0x18')]||0x0;this['countdropretry']=_0x1c9f5b[_0x65f6('0x17')]||0x0;this[_0x65f6('0x19')]=_0x1c9f5b[_0x65f6('0x19')]||0x0;this[_0x65f6('0x1a')]=_0x1c9f5b[_0x65f6('0x1a')]||0x0;this[_0x65f6('0x1b')]=_0x1c9f5b['countagentrejectretry']||0x0;this[_0x65f6('0x1c')]=_0x1c9f5b['callback'];this['callbackuniqueid']=_0x1c9f5b[_0x65f6('0x1d')];this[_0x65f6('0x1e')]=_0x1c9f5b['callbackat'];this[_0x65f6('0x1f')]=_0x1c9f5b[_0x65f6('0x1f')];this[_0x65f6('0x20')]=_0x1c9f5b[_0x65f6('0x20')];this['ListId']=_0x1c9f5b[_0x65f6('0x21')];this[_0x65f6('0x22')]=_[_0x65f6('0x1')](_0x1c9f5b['Agent'])?_0x1c9f5b['UserId']:_0x1c9f5b['Agent']['id'];this[_0x65f6('0x23')]=_0x1c9f5b[_0x65f6('0x23')];this['originatecalleridnum']='';this[_0x65f6('0x24')]='';}Action[_0x65f6('0x25')]['getCaller']=function(){return util[_0x65f6('0x26')](_0x65f6('0x27'),this[_0x65f6('0xb')],this['number']);};module['exports']=Action; \ No newline at end of file +var _0x5c3c=['prototype','format','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','idContact','queue','type','dialAnswer','Agent','channelAgent','membername','SIP/%s','calleridname','phone','Contact','firstName','lastName','calleridnum','scheduledat','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum'];(function(_0xd0cd0b,_0x490956){var _0x59cced=function(_0x567251){while(--_0x567251){_0xd0cd0b['push'](_0xd0cd0b['shift']());}};_0x59cced(++_0x490956);}(_0x5c3c,0x132));var _0xc5c3=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x5c3c[_0x424a9a];return _0xa7831c;};'use strict';var util=require(_0xc5c3('0x0'));var _=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));function checkNameSurname(_0x32103c,_0x4b9233,_0x400726){var _0x3c5552='';if(!_[_0xc5c3('0x3')](_0x4b9233)&&_0xc5c3('0x4')===typeof _0x4b9233){_0x3c5552+=_0x4b9233;}if(!_[_0xc5c3('0x3')](_0x400726)&&_0xc5c3('0x4')===typeof _0x400726){_0x3c5552+='\x20'+_0x400726;}if(_0x3c5552!==''){return _0x3c5552;}return _0x32103c;}function Action(_0xe85098,_0x23a6b5,_0x28bdd9,_0x5a392b,_0x4b8404){this['uniqueid']=_0x28bdd9||undefined;this[_0xc5c3('0x5')]=_0xe85098['id'];this[_0xc5c3('0x6')]=_0x23a6b5['name'];this[_0xc5c3('0x7')]=_0x23a6b5[_0xc5c3('0x7')];this['campaigntype']=_0xc5c3('0x6');this[_0xc5c3('0x8')]=![];this['membername']=_[_0xc5c3('0x3')](_0xe85098[_0xc5c3('0x9')])?undefined:_0xe85098[_0xc5c3('0x9')]['name'];this[_0xc5c3('0xa')]=this[_0xc5c3('0xb')]?util['format'](_0xc5c3('0xc'),this[_0xc5c3('0xb')]):_0x5a392b||undefined;this[_0xc5c3('0xd')]=checkNameSurname(_0xe85098['Contact'][_0xc5c3('0xe')],_0xe85098[_0xc5c3('0xf')][_0xc5c3('0x10')],_0xe85098[_0xc5c3('0xf')][_0xc5c3('0x11')]);this['active']=_0xe85098['active']||![];this[_0xc5c3('0x12')]=_0xe85098[_0xc5c3('0xe')];this[_0xc5c3('0x13')]=_0xe85098[_0xc5c3('0x13')];this['countbusyretry']=_0xe85098['countbusyretry']||0x0;this[_0xc5c3('0x14')]=_0xe85098['countcongestionretry']||0x0;this[_0xc5c3('0x15')]=_0xe85098[_0xc5c3('0x15')]||0x0;this[_0xc5c3('0x16')]=(_0xe85098[_0xc5c3('0x17')]||0x0)+(_0xe85098[_0xc5c3('0x14')]||0x0)+(_0xe85098['countnoanswerretry']||0x0)+(_0xe85098[_0xc5c3('0x18')]||0x0)+(_0xe85098[_0xc5c3('0x19')]||0x0)+(_0xe85098[_0xc5c3('0x1a')]||0x0)+(_0xe85098[_0xc5c3('0x1b')]||0x0)+(_0xe85098['countagentrejectretry']||0x0);this[_0xc5c3('0x18')]=_0xe85098[_0xc5c3('0x18')]||0x0;this[_0xc5c3('0x19')]=_0xe85098[_0xc5c3('0x19')]||0x0;this[_0xc5c3('0x1a')]=_0xe85098['countabandonedretry']||0x0;this[_0xc5c3('0x1b')]=_0xe85098[_0xc5c3('0x1b')]||0x0;this[_0xc5c3('0x1c')]=_0xe85098[_0xc5c3('0x1c')]||0x0;this[_0xc5c3('0x1d')]=_0xe85098[_0xc5c3('0x1d')];this[_0xc5c3('0x1e')]=_0xe85098['callbackuniqueid'];this['callbackat']=_0xe85098[_0xc5c3('0x1f')];this[_0xc5c3('0x20')]=_0xe85098['recallme'];this['ContactId']=_0xe85098[_0xc5c3('0x21')];this[_0xc5c3('0x22')]=_0xe85098[_0xc5c3('0x22')];this['UserId']=_['isNil'](_0xe85098[_0xc5c3('0x9')])?_0xe85098[_0xc5c3('0x23')]:_0xe85098[_0xc5c3('0x9')]['id'];this[_0xc5c3('0x24')]=_0xe85098['VoiceQueueId'];this[_0xc5c3('0x25')]='';this['originatecalleridname']='';}Action[_0xc5c3('0x26')]['getCaller']=function(){return util[_0xc5c3('0x27')](_0xc5c3('0x28'),this[_0xc5c3('0xd')],this[_0xc5c3('0x29')]);};module[_0xc5c3('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 1a6f9cc..9cb25bb 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 _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x4caf6c,_0x3ae883){var _0x51630e=function(_0x4f843f){while(--_0x4f843f){_0x4caf6c['push'](_0x4caf6c['shift']());}};_0x51630e(++_0x3ae883);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x5c8db5,_0x29ad01){var _0x158eb6=function(_0x319455){while(--_0x319455){_0x5c8db5['push'](_0x5c8db5['shift']());}};_0x158eb6(++_0x29ad01);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 047e43a..6c91d53 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 _0x59d0=['getContactPreview','createHistory','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','from-sip','exten','holdtime','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','then','getContactRecallMe','[GetContactRecallMe]\x20','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','error','catch','resolve','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20'];(function(_0x339767,_0x336f75){var _0x2e484e=function(_0x28451c){while(--_0x28451c){_0x339767['push'](_0x339767['shift']());}};_0x2e484e(++_0x336f75);}(_0x59d0,0x1ac));var _0x059d=function(_0x2ab00f,_0x42b2b3){_0x2ab00f=_0x2ab00f-0x0;var _0x3ea466=_0x59d0[_0x2ab00f];return _0x3ea466;};'use strict';var util=require(_0x059d('0x0'));var BPromise=require(_0x059d('0x1'));var logger=require('../../../config/logger')(_0x059d('0x2'));var cmHopper=require(_0x059d('0x3'));var cmHopperHistory=require(_0x059d('0x4'));var cmHopperBlack=require(_0x059d('0x5'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0xcf8d3){return function(_0x779d4e){logger[_0x059d('0x6')](_0xcf8d3,util['inspect'](_0x779d4e,{'showHidden':![],'depth':null}));};}function create(_0x3aa567){return cmHopperHistory['createHistory'](_0x3aa567)[_0x059d('0x7')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x352ffc){return BPromise[_0x059d('0x8')]()['then'](agentReportPreview['createHistory'](_0x352ffc))['catch'](loggerCatch(_0x059d('0x9')));}function moveContact(_0x25483d){return cmHopper[_0x059d('0xa')](_0x25483d,!![])['catch'](loggerCatch(_0x059d('0xb')));}exports['checkIsBlackList']=function(_0x531990){return cmHopperBlack['checkIsBlackList'](_0x531990)['catch'](loggerCatch(_0x059d('0xc')));};exports[_0x059d('0xd')]=function(_0x2c0829){return BPromise[_0x059d('0x8')]()['then'](cmHopper['getContactPreview'](_0x2c0829))[_0x059d('0x7')](loggerCatch('[getContactPreview]\x20'));};exports[_0x059d('0xe')]=function(_0x33afde,_0x954b42){create(_0x33afde)[_0x059d('0x7')](loggerCatch(_0x954b42));moveContact(_0x33afde)[_0x059d('0x7')](loggerCatch(_0x954b42));};exports[_0x059d('0xf')]=function(_0x587711,_0x1290ca){createAgent(_0x587711)['catch'](loggerCatch(_0x1290ca));};exports[_0x059d('0x10')]=function(_0x50d9d8,_0x36d4d4){create(_0x50d9d8)[_0x059d('0x7')](loggerCatch(_0x36d4d4));};exports[_0x059d('0x11')]=function(_0x4fb972,_0x5b201d){moveContact(_0x4fb972)[_0x059d('0x7')](loggerCatch(_0x5b201d));};exports[_0x059d('0x12')]=function(_0xb3eab1,_0x50e392,_0x6f3b29){if(_0x50e392){_0xb3eab1['UserId']=null;}if(_0x6f3b29){_0xb3eab1[_0x059d('0x13')]=![];}return cmHopper[_0x059d('0x12')](_0xb3eab1)['catch'](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x3fcafe){return cmHopper[_0x059d('0x14')](_0x3fcafe)[_0x059d('0x7')](loggerCatch(_0x059d('0x15')));};exports[_0x059d('0x16')]=function(_0x473758){return cmHopper['unlockContact']({'UserId':null},_0x473758,0x1)[_0x059d('0x7')](loggerCatch(_0x059d('0x17')));};exports[_0x059d('0x18')]=function(_0x47249f){return cmHopper['unlockContact']({'active':![]},_0x47249f,0x1)[_0x059d('0x7')](loggerCatch(_0x059d('0x19')));};exports['crateCustomerReportQueue']=function(_0x47b988){var _0x1f80fd={};_0x1f80fd[_0x059d('0x1a')]=_0x47b988[_0x059d('0x1a')];_0x1f80fd[_0x059d('0x1b')]=_0x47b988[_0x059d('0x1b')];_0x1f80fd[_0x059d('0x1c')]=_0x47b988[_0x059d('0x1c')];_0x1f80fd['calleridname']=_0x47b988['calleridname'];_0x1f80fd[_0x059d('0x1d')]=_0x47b988['queue'];_0x1f80fd[_0x059d('0x1e')]=_0x47b988[_0x059d('0x1f')];_0x1f80fd[_0x059d('0x20')]=_0x47b988['answertime'];_0x1f80fd[_0x059d('0x21')]=0x1;_0x1f80fd[_0x059d('0x22')]=_0x47b988[_0x059d('0x23')];_0x1f80fd['connectedlinename']=_0x47b988[_0x059d('0x24')];_0x1f80fd[_0x059d('0x25')]=_0x059d('0x26');_0x1f80fd[_0x059d('0x27')]='xcally-motion-preview';_0x1f80fd[_0x059d('0x28')]=0x0;_0x1f80fd[_0x059d('0x29')]=0x1;_0x1f80fd[_0x059d('0x2a')]=_0x47b988[_0x059d('0x24')];_0x1f80fd['queuecallerexitreason']=_0x059d('0x2b');return BPromise[_0x059d('0x8')]()['then'](voiceQueueReport[_0x059d('0x2c')](_0x1f80fd))[_0x059d('0x7')](loggerCatch(_0x059d('0x2d')));};exports['getContactRecallMe']=function(_0x57c1e9,_0x400bf0){return BPromise['resolve']()[_0x059d('0x2e')](cmHopper[_0x059d('0x2f')](_0x57c1e9,_0x400bf0))[_0x059d('0x7')](loggerCatch(_0x059d('0x30')));};exports['rescheduleContactInQueue']=function(_0x373f76){return cmHopper['rescheduleContact'](_0x373f76,!![],!![])[_0x059d('0x7')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x1ea3=['createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','[createHistory]\x20','resolve','then','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory'];(function(_0xab60cf,_0x12651b){var _0x48b04c=function(_0x291301){while(--_0x291301){_0xab60cf['push'](_0xab60cf['shift']());}};_0x48b04c(++_0x12651b);}(_0x1ea3,0xcd));var _0x31ea=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x1ea3[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x31ea('0x0'));var BPromise=require('bluebird');var logger=require(_0x31ea('0x1'))('preview');var cmHopper=require(_0x31ea('0x2'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x31ea('0x3'));var agentReportPreview=require(_0x31ea('0x4'));var voiceQueueReport=require(_0x31ea('0x5'));function loggerCatch(_0x4f80ae){return function(_0x23e060){logger[_0x31ea('0x6')](_0x4f80ae,util[_0x31ea('0x7')](_0x23e060,{'showHidden':![],'depth':null}));};}function create(_0xd6f6b6){return cmHopperHistory[_0x31ea('0x8')](_0xd6f6b6)['catch'](loggerCatch(_0x31ea('0x9')));}function createAgent(_0x4a9b65){return BPromise[_0x31ea('0xa')]()[_0x31ea('0xb')](agentReportPreview[_0x31ea('0x8')](_0x4a9b65))[_0x31ea('0xc')](loggerCatch(_0x31ea('0x9')));}function moveContact(_0x5c4b77){return cmHopper[_0x31ea('0xd')](_0x5c4b77,!![])[_0x31ea('0xc')](loggerCatch(_0x31ea('0xe')));}exports['checkIsBlackList']=function(_0x3127b5){return cmHopperBlack['checkIsBlackList'](_0x3127b5)['catch'](loggerCatch(_0x31ea('0xf')));};exports[_0x31ea('0x10')]=function(_0x2f2317){return BPromise['resolve']()[_0x31ea('0xb')](cmHopper[_0x31ea('0x10')](_0x2f2317))[_0x31ea('0xc')](loggerCatch(_0x31ea('0x11')));};exports['createHistory']=function(_0x4f8c48,_0x513744){create(_0x4f8c48)[_0x31ea('0xc')](loggerCatch(_0x513744));moveContact(_0x4f8c48)[_0x31ea('0xc')](loggerCatch(_0x513744));};exports[_0x31ea('0x12')]=function(_0x28e6ec,_0x91ca96){createAgent(_0x28e6ec)['catch'](loggerCatch(_0x91ca96));};exports[_0x31ea('0x13')]=function(_0x534251,_0x4a0189){create(_0x534251)[_0x31ea('0xc')](loggerCatch(_0x4a0189));};exports[_0x31ea('0x14')]=function(_0x189dff,_0x2f6a91){moveContact(_0x189dff)[_0x31ea('0xc')](loggerCatch(_0x2f6a91));};exports['rescheduleContact']=function(_0x483e3a,_0x305f15,_0x3ec70b){if(_0x305f15){_0x483e3a[_0x31ea('0x15')]=null;}if(_0x3ec70b){_0x483e3a[_0x31ea('0x16')]=![];}return cmHopper[_0x31ea('0x17')](_0x483e3a)[_0x31ea('0xc')](loggerCatch(_0x31ea('0x18')));};exports[_0x31ea('0x19')]=function(_0x392f5a){return cmHopper[_0x31ea('0x19')](_0x392f5a)[_0x31ea('0xc')](loggerCatch('[countReScheduled]\x20'));};exports[_0x31ea('0x1a')]=function(_0x597295){return cmHopper[_0x31ea('0x1a')]({'UserId':null},_0x597295,0x1)[_0x31ea('0xc')](loggerCatch(_0x31ea('0x1b')));};exports[_0x31ea('0x1c')]=function(_0x4b6f1f){return cmHopper['unlockContact']({'active':![]},_0x4b6f1f,0x1)[_0x31ea('0xc')](loggerCatch(_0x31ea('0x1d')));};exports['crateCustomerReportQueue']=function(_0x43d698){var _0x26158c={};_0x26158c['type']=_0x43d698[_0x31ea('0x1e')];_0x26158c[_0x31ea('0x1f')]=_0x43d698['uniqueid'];_0x26158c[_0x31ea('0x20')]=_0x43d698[_0x31ea('0x20')];_0x26158c[_0x31ea('0x21')]=_0x43d698[_0x31ea('0x21')];_0x26158c[_0x31ea('0x22')]=_0x43d698[_0x31ea('0x22')];_0x26158c[_0x31ea('0x23')]=_0x43d698[_0x31ea('0x24')];_0x26158c[_0x31ea('0x25')]=_0x43d698['answertime'];_0x26158c[_0x31ea('0x26')]=0x1;_0x26158c['queuecallercompleteAt']=_0x43d698[_0x31ea('0x27')];_0x26158c[_0x31ea('0x28')]=_0x43d698[_0x31ea('0x29')];_0x26158c[_0x31ea('0x2a')]=_0x31ea('0x2b');_0x26158c[_0x31ea('0x2c')]=_0x31ea('0x2d');_0x26158c[_0x31ea('0x2e')]=0x0;_0x26158c[_0x31ea('0x2f')]=0x1;_0x26158c[_0x31ea('0x30')]=_0x43d698[_0x31ea('0x29')];_0x26158c[_0x31ea('0x31')]=_0x31ea('0x32');return BPromise[_0x31ea('0xa')]()[_0x31ea('0xb')](voiceQueueReport['create'](_0x26158c))['catch'](loggerCatch(_0x31ea('0x33')));};exports[_0x31ea('0x34')]=function(_0x4a99ca,_0x47d729){return BPromise[_0x31ea('0xa')]()[_0x31ea('0xb')](cmHopper[_0x31ea('0x34')](_0x4a99ca,_0x47d729))[_0x31ea('0xc')](loggerCatch(_0x31ea('0x35')));};exports[_0x31ea('0x36')]=function(_0x1d16a4){return cmHopper['rescheduleContact'](_0x1d16a4,!![],!![])['catch'](loggerCatch(_0x31ea('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 42cc2a1..1a6ede5 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 _0x0734=['Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','channelAgent','voice','mandatoryDisposition','buildObj','not_inuse','status','reachable','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','filterKey','type','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss','rtpaudioqoslossbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','error','inspect','logger','info','loggerError','logger2','message','isUndefined','string','isEmpty','format','\x22\x22\x20<>','isNil','addVariables','Queue','name','\x22%s\x22\x20<%s>','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','starttime','responsetime','logAgent','statedesc','ringtime','logLookAgent','membername','UserId','logCustomer','endtime','answertime','getSeconds','isFailure','variablesAction','RECALL','BOOKED','uniqueid','originate','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone'];(function(_0x383601,_0x249364){var _0x2f095f=function(_0x2abb94){while(--_0x2abb94){_0x383601['push'](_0x383601['shift']());}};_0x2f095f(++_0x249364);}(_0x0734,0xd4));var _0x4073=function(_0x21f6c2,_0xfdc48f){_0x21f6c2=_0x21f6c2-0x0;var _0x2f4df6=_0x0734[_0x21f6c2];return _0x2f4df6;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');var logger=require('../../../../config/logger')(_0x4073('0x0'));var ipAgi=process[_0x4073('0x1')][_0x4073('0x2')]||_0x4073('0x3');var utils=require(_0x4073('0x4'));exports['loggerCatch']=function(_0x20e0f0){return function(_0x4e437e){logger[_0x4073('0x5')](_0x20e0f0,util[_0x4073('0x6')](_0x4e437e,{'showHidden':![],'depth':null}));};};exports[_0x4073('0x7')]=function(_0x55f7f6,_0x321a82){logger[_0x4073('0x8')](_0x55f7f6,util['inspect'](_0x321a82,{'showHidden':![],'depth':null}));};exports[_0x4073('0x9')]=function(_0x2d4693,_0x41888b){logger[_0x4073('0x5')](_0x2d4693,util[_0x4073('0x6')](_0x41888b,{'showHidden':![],'depth':null}));};exports[_0x4073('0xa')]=function(_0x5b59bc){return function(_0x4f936e){logger['info'](_0x5b59bc,util[_0x4073('0x6')](_0x4f936e,{'showHidden':![],'depth':null}));};};exports[_0x4073('0xb')]=function(_0x3a4501,_0x15c01b,_0x505c53){return{'message':_0x3a4501,'unlock':_0x15c01b,'active':_0x505c53};};exports['getCallerId']=function(_0x567397,_0x3a639b,_0x437742){if(!_[_0x4073('0xc')](_0x437742)&&_0x4073('0xd')===typeof _0x437742&&!_[_0x4073('0xe')](_0x437742)){if(!_[_0x4073('0xc')](_0x3a639b)&&_0x4073('0xd')===typeof _0x3a639b&&!_['isEmpty'](_0x3a639b)){return util[_0x4073('0xf')]('\x22%s\x22\x20<%s>',_0x3a639b,_0x437742);}return util[_0x4073('0xf')]('\x22%s\x22\x20<%s>',_0x437742,_0x437742);}if(!_[_0x4073('0xc')](_0x567397)&&'string'===typeof _0x567397&&!_[_0x4073('0xe')](_0x567397)){return _0x567397;}return _0x4073('0x10');};exports['isActive']=function(_0x405576){if(_[_0x4073('0x11')](_0x405576)){return![];}return _0x405576;};exports[_0x4073('0x12')]=function(_0x53132a,_0x699439,_0x282f9,_0x22a8b6,_0x5b8c19,_0x4bbebc){var _0x551e64={'XMD-QUEUE':_0x699439[_0x4073('0x13')]?_0x699439[_0x4073('0x13')][_0x4073('0x14')]:'','XMD-CALLERID':_0x22a8b6,'XMD-CALLERID-PREVIEW':_0x4bbebc?util[_0x4073('0xf')](_0x4073('0x15'),_0x4bbebc[_0x4073('0x16')],_0x4bbebc[_0x4073('0x17')]):_0x22a8b6,'XMD-DIALID':_0x5b8c19,'XMD-CONTACTID':_0x699439[_0x4073('0x18')],'XMD-CDRTYPE':_0x4073('0x19'),'CALLERID(all)':_0x22a8b6,'XMD-VOICEQUEUEID':_0x699439[_0x4073('0x1a')],'XMD-DIALCHANNEL':_0x282f9,'XMD-DIALTIMEOUT':_0x53132a[_0x4073('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x4073('0xf')](_0x4073('0x1c'),_0x53132a[_0x4073('0x1d')]?'g':'',_[_0x4073('0xe')](_0x53132a[_0x4073('0x1e')])?'':_0x4073('0x1f')),'XMD-DIALURL':_0x53132a[_0x4073('0x20')]||'','XMD-AGI':_0x53132a[_0x4073('0x21')]?util[_0x4073('0xf')](_0x4073('0x22'),ipAgi,_0x53132a['dialQueueProject']):_0x4073('0x23'),'XMD-AGIAFTER':_0x53132a[_0x4073('0x1d')]?util[_0x4073('0xf')](_0x4073('0x22'),ipAgi,_0x53132a[_0x4073('0x1d')]):_0x4073('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x4bbebc?_0x4bbebc[_0x4073('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x4bbebc?_0x4bbebc[_0x4073('0x25')]:'','XMD-DESTINATION':_0x4073('0x26'),'SIPADDHEADER':_0x4073('0x27')};if(!_[_0x4073('0xe')](_0x53132a[_0x4073('0x1e')])){_0x551e64[util[_0x4073('0xf')]('%s',_0x4073('0x28'))]=_0x53132a['monitor_format'];_0x551e64[util[_0x4073('0xf')]('%s',_0x4073('0x29'))]=_0x5b8c19;}return _0x551e64;};exports[_0x4073('0x2a')]=function(_0x4171cc){var _0x3ffc4f={};for(var _0x59fb15 in _0x4171cc){if(_0x4171cc[_0x4073('0x2b')](_0x59fb15)){_0x3ffc4f[util[_0x4073('0xf')]('%s',_[_0x4073('0x2c')](_0x59fb15))]=_0x4171cc[_0x59fb15];}}return{'variables':_0x3ffc4f};};exports[_0x4073('0x2d')]=function(_0x322ab4,_0x30f3fd){if(!_[_0x4073('0x11')](_0x322ab4)){if(_0x322ab4[_0x4073('0x2b')](_0x4073('0x2e'))){if(_0x322ab4[_0x4073('0x2e')]>0x0){_0x322ab4['originated']-=0x1;}else{logger[_0x4073('0x5')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x30f3fd);}}}else{logger['error'](_0x4073('0x2f'),_0x30f3fd);}};exports[_0x4073('0x30')]=function(_0xb31467){var _0x1d378a=moment()['format'](_0x4073('0x31'));_0xb31467[_0x4073('0x32')]=0xd;_0xb31467['statedesc']='Blacklist';_0xb31467[_0x4073('0x33')]=_0x1d378a;_0xb31467[_0x4073('0x34')]=_0x1d378a;_0xb31467['endtime']=_0x1d378a;};exports[_0x4073('0x35')]=function(_0x57bf2e,_0x29dd0d,_0x52b20e){var _0x2965c9=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x57bf2e[_0x4073('0x32')]=_0x29dd0d;_0x57bf2e[_0x4073('0x36')]=_0x52b20e;_0x57bf2e[_0x4073('0x34')]=_0x2965c9;_0x57bf2e[_0x4073('0x37')]=utils['getSeconds'](_0x57bf2e['responsetime'],_0x57bf2e['starttime']);};exports[_0x4073('0x38')]=function(_0x12827c,_0x4622f2,_0x4bff6d){_0x12827c[_0x4073('0x39')]=_0x4622f2;_0x12827c[_0x4073('0x3a')]=_0x4bff6d;};exports[_0x4073('0x3b')]=function(_0x2c9f40,_0x481401,_0xb8c5e9){var _0x192c3d=moment()[_0x4073('0xf')](_0x4073('0x31'));_0x2c9f40[_0x4073('0x32')]=_0x481401;_0x2c9f40[_0x4073('0x36')]=_0xb8c5e9;_0x2c9f40[_0x4073('0x34')]=_0x2c9f40[_0x4073('0x34')]?_0x2c9f40[_0x4073('0x34')]:_0x192c3d;_0x2c9f40[_0x4073('0x3c')]=_0x2c9f40[_0x4073('0x3c')]?_0x2c9f40[_0x4073('0x3c')]:_0x192c3d;_0x2c9f40[_0x4073('0x37')]=utils['getSeconds'](_0x2c9f40[_0x4073('0x34')]||0x0,_0x2c9f40['starttime']||0x0);_0x2c9f40['talktime']=_0x2c9f40[_0x4073('0x3d')]?utils[_0x4073('0x3e')](_0x2c9f40[_0x4073('0x3c')],_0x2c9f40[_0x4073('0x3d')]):0x0;};exports[_0x4073('0x3f')]=function(_0x5e1dc1){return _0x5e1dc1==='Failure';};exports[_0x4073('0x40')]=function(_0x3381c9,_0x4cf882,_0x52b4e5,_0x26e082,_0x47f390){var _0x39452e=_0x26e082?_0x4073('0x41'):_0x3381c9[_0x4073('0x16')];_0x39452e=_0x47f390?_0x4073('0x42'):_0x39452e;return{'actionid':_0x3381c9[_0x4073('0x43')],'action':_0x4073('0x44'),'channel':_0x3381c9['channelAgent'],'callerid':util[_0x4073('0xf')](_0x4073('0x15'),_0x39452e,_0x3381c9[_0x4073('0x17')]),'Exten':_0x4073('0x26'),'Context':_0x4073('0x45'),'Priority':'1','variable':_0x52b4e5,'timeout':(_0x4cf882[_0x4073('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3381c9[_0x4073('0x43')]};};exports['totalGlobal']=function(_0x13b9a4){return _0x13b9a4[_0x4073('0x47')]+_0x13b9a4[_0x4073('0x48')]+_0x13b9a4[_0x4073('0x49')]+_0x13b9a4[_0x4073('0x4a')]+_0x13b9a4[_0x4073('0x4b')];};exports[_0x4073('0x4c')]=function(_0xd0f652){var _0x1b9cd1=_[_0x4073('0x4d')](_0xd0f652);_0x1b9cd1[_0x4073('0x32')]=0xf;_0x1b9cd1[_0x4073('0x36')]=_0x4073('0x4e');return _0x1b9cd1;};exports[_0x4073('0x4f')]=function(_0x43d4be,_0x11c179,_0x4e4f65){var _0xa830d4={};_0xa830d4[_0x11c179]=_0x43d4be[_0x11c179];_0xa830d4[_0x4073('0x50')]=![];_0xa830d4[_0x4073('0x51')]=moment()[_0x4073('0x52')](_0x4e4f65,_0x4073('0x53'))[_0x4073('0xf')](_0x4073('0x31'));_0xa830d4[_0x4073('0x18')]=_0x43d4be['ContactId'];_0xa830d4[_0x4073('0x54')]=_0x43d4be[_0x4073('0x54')];_0xa830d4['VoiceQueueId']=_0x43d4be['VoiceQueueId']||undefined;return _0xa830d4;};exports[_0x4073('0x55')]=function(_0x2a7382,_0x128175){if(!_['isNil'](_0x2a7382)){if(_0x2a7382[_0x4073('0x56')]>0x0){_0x2a7382[_0x4073('0x56')]-=0x1;}else{logger[_0x4073('0x5')](_0x128175,_0x4073('0x57'));}}else{logger['error'](_0x128175,_0x4073('0x58'));}};exports['IsNotLoggedIn']=function(_0x33c7d4){if(_0x33c7d4<=0x0){return!![];}return![];};function buildObj(_0x3d3f24,_0x576c3e,_0x3d43d7){_0x3d3f24[_0x4073('0x59')]=_0x576c3e;_0x3d3f24[_0x4073('0x14')]=_0x3d3f24[_0x4073('0x5a')];_0x3d3f24[_0x4073('0x5b')]=_0x3d3f24[_0x4073('0x5c')];_0x3d3f24['motionChannel']=_0x4073('0x5d');if(_0x3d43d7){_0x3d3f24[_0x4073('0x5e')]=_0x3d43d7['mandatoryDisposition'];}return _0x3d3f24;}exports[_0x4073('0x5f')]=buildObj;exports['agentReadyId']=function(_0x275335){var _0x5e6a00=[];for(var _0x37ed2c in _0x275335){if(_0x275335[_0x4073('0x2b')](_0x37ed2c)){if(!_['isNil'](_0x275335[_0x37ed2c])&&_0x275335[_0x37ed2c]['state']===_0x4073('0x60')&&_0x275335[_0x37ed2c][_0x4073('0x61')]===_0x4073('0x62')){_0x5e6a00[_0x4073('0x63')](_0x275335[_0x37ed2c]['id']);}}}return _0x5e6a00;};exports[_0x4073('0x64')]=function(_0x4cdb7a){var _0x4e56ea=moment()[_0x4073('0x65')](0x0);var _0x4fa3ed=moment(_0x4cdb7a)['milliseconds'](0x0);return _0x4e56ea[_0x4073('0x66')](_0x4fa3ed,_0x4073('0x67'));};exports[_0x4073('0x68')]=function(_0x40935b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x40935b[_0x4073('0x18')],'ListId':_0x40935b[_0x4073('0x54')],'VoiceQueueId':_0x40935b[_0x4073('0x1a')]||undefined,'CampaignId':_0x40935b[_0x4073('0x69')]||undefined};};exports[_0x4073('0x6a')]=function(_0x1e54cc){if(_0x1e54cc===_0x4073('0x43')||_0x1e54cc==='idContact'||_0x1e54cc===_0x4073('0x5a')||_0x1e54cc===_0x4073('0x6b')||_0x1e54cc===_0x4073('0x6c')||_0x1e54cc===_0x4073('0x6d')||_0x1e54cc===_0x4073('0x39')||_0x1e54cc==='channelAgent'||_0x1e54cc===_0x4073('0x16')||_0x1e54cc==='active'||_0x1e54cc===_0x4073('0x17')||_0x1e54cc==='scheduledat'||_0x1e54cc==='countbusyretry'||_0x1e54cc==='countcongestionretry'||_0x1e54cc===_0x4073('0x49')||_0x1e54cc===_0x4073('0x6e')||_0x1e54cc===_0x4073('0x6f')||_0x1e54cc===_0x4073('0x70')||_0x1e54cc===_0x4073('0x71')||_0x1e54cc===_0x4073('0x72')||_0x1e54cc===_0x4073('0x18')||_0x1e54cc==='ListId'||_0x1e54cc===_0x4073('0x3a')||_0x1e54cc===_0x4073('0x1a')||_0x1e54cc==='sipcallid'||_0x1e54cc===_0x4073('0x73')||_0x1e54cc===_0x4073('0x74')||_0x1e54cc===_0x4073('0x75')||_0x1e54cc===_0x4073('0x76')||_0x1e54cc==='xmd-dialurl'||_0x1e54cc===_0x4073('0x77')||_0x1e54cc===_0x4073('0x78')||_0x1e54cc===_0x4073('0x79')||_0x1e54cc==='xmd-dialchannel'||_0x1e54cc==='xmd-contactid'||_0x1e54cc==='xmd-cdrtype'||_0x1e54cc==='xmd-callerid'||_0x1e54cc===_0x4073('0x7a')||_0x1e54cc===_0x4073('0x7b')||_0x1e54cc===_0x4073('0x7c')||_0x1e54cc===_0x4073('0x7d')||_0x1e54cc===_0x4073('0x7e')||_0x1e54cc===_0x4073('0x7f')||_0x1e54cc==='rtpaudioqosloss'||_0x1e54cc==='rtpaudioqoslossbridged'||_0x1e54cc===_0x4073('0x80')||_0x1e54cc===_0x4073('0x81')||_0x1e54cc===_0x4073('0x7c')||_0x1e54cc===_0x4073('0x7d')||_0x1e54cc===_0x4073('0x7e')||_0x1e54cc===_0x4073('0x7f')||_0x1e54cc===_0x4073('0x82')||_0x1e54cc===_0x4073('0x83')||_0x1e54cc==='rtpaudioqosrtt'||_0x1e54cc===_0x4073('0x81')||_0x1e54cc===_0x4073('0x84')||_0x1e54cc==='bridgepvtcallid'||_0x1e54cc===_0x4073('0x32')||_0x1e54cc===_0x4073('0x36')){return![];}return!![];};exports[_0x4073('0x85')]=function(_0x381f43,_0x5ac9c6){var _0x1dab23,_0x396550,_0x424621;if(_0x5ac9c6<=0x0){_0x5ac9c6=0x1;}_0x1dab23=new RegExp(_0x4073('0x86')+_0x5ac9c6+'}$');_0x396550=Math[_0x4073('0x87')](0xa,_0x5ac9c6-0x1);_0x424621=Math['pow'](0xa,_0x5ac9c6)-0x1;return util[_0x4073('0xf')]('%s',_[_0x4073('0x88')](_0x381f43,_0x1dab23,_['random'](_0x396550,_0x424621)));};exports[_0x4073('0x89')]=function(_0x30da9f){var _0x216708=_0x30da9f[_0x4073('0x8a')](/"(.*?)"/);return _0x216708?_0x216708[0x1]:_0x30da9f;};exports[_0x4073('0x8b')]=function(_0x428657){var _0x22dc35=_0x428657[_0x4073('0x8a')](/<(.*?)>/);return _0x22dc35?_0x22dc35[0x1]:_0x428657;};function buildNoAnswerEventPayload(_0x1f51d0,_0x31c72a){var _0xeceb03=buildObj(_0x1f51d0,_0x4073('0x8c'));if(!_[_0x4073('0xe')](_0x31c72a['variables'])){Object['keys'](_0x31c72a[_0x4073('0x8d')])[_0x4073('0x8e')](function(_0x29f4be){_0xeceb03[_0x29f4be[_0x4073('0x8f')]()]=_0x31c72a[_0x4073('0x8d')][_0x29f4be];});}return _0xeceb03;}exports[_0x4073('0x90')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x8222=['active','countcongestionretry','countnoanswerretry','callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosloss','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','lodash','preview','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','logger','info','inspect','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridname','dialer','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','state','getSeconds','UserId','logCustomer','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','channelAgent','calleridnum','from-sip','timeout','countbusyretry','countagentrejectretry','countnosuchnumberretry','scheduledAt','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','mandatoryDisposition','buildObj','agentReadyId','not_inuse','status','reachable','push','milliseconds','diff','seconds','createBody','ContactId','CampaignId','uniqueid','idContact','type','campaigntype','dialAnswer'];(function(_0x459c75,_0x386e2e){var _0x2b4db0=function(_0xe8d63a){while(--_0xe8d63a){_0x459c75['push'](_0x459c75['shift']());}};_0x2b4db0(++_0x386e2e);}(_0x8222,0x146));var _0x2822=function(_0xe4e1d3,_0x18bf45){_0xe4e1d3=_0xe4e1d3-0x0;var _0x3ca6e1=_0x8222[_0xe4e1d3];return _0x3ca6e1;};'use strict';var util=require('util');var _=require(_0x2822('0x0'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x2822('0x1'));var ipAgi=process['env'][_0x2822('0x2')]||_0x2822('0x3');var utils=require(_0x2822('0x4'));exports[_0x2822('0x5')]=function(_0x1786f1){return function(_0x432e19){logger[_0x2822('0x6')](_0x1786f1,util['inspect'](_0x432e19,{'showHidden':![],'depth':null}));};};exports[_0x2822('0x7')]=function(_0x118840,_0x46d0f6){logger[_0x2822('0x8')](_0x118840,util[_0x2822('0x9')](_0x46d0f6,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x1f9d4f,_0x2e5d80){logger[_0x2822('0x6')](_0x1f9d4f,util[_0x2822('0x9')](_0x2e5d80,{'showHidden':![],'depth':null}));};exports[_0x2822('0xa')]=function(_0x35e22e){return function(_0x66944e){logger[_0x2822('0x8')](_0x35e22e,util[_0x2822('0x9')](_0x66944e,{'showHidden':![],'depth':null}));};};exports[_0x2822('0xb')]=function(_0x10c008,_0x104f7d,_0x1ac654){return{'message':_0x10c008,'unlock':_0x104f7d,'active':_0x1ac654};};exports[_0x2822('0xc')]=function(_0x32edd0,_0x425409,_0x3fc3b0){if(!_[_0x2822('0xd')](_0x3fc3b0)&&_0x2822('0xe')===typeof _0x3fc3b0&&!_[_0x2822('0xf')](_0x3fc3b0)){if(!_[_0x2822('0xd')](_0x425409)&&_0x2822('0xe')===typeof _0x425409&&!_[_0x2822('0xf')](_0x425409)){return util[_0x2822('0x10')](_0x2822('0x11'),_0x425409,_0x3fc3b0);}return util[_0x2822('0x10')](_0x2822('0x11'),_0x3fc3b0,_0x3fc3b0);}if(!_['isUndefined'](_0x32edd0)&&_0x2822('0xe')===typeof _0x32edd0&&!_[_0x2822('0xf')](_0x32edd0)){return _0x32edd0;}return'\x22\x22\x20<>';};exports[_0x2822('0x12')]=function(_0x56f2ab){if(_[_0x2822('0x13')](_0x56f2ab)){return![];}return _0x56f2ab;};exports[_0x2822('0x14')]=function(_0x1123db,_0x1412b9,_0x4340ea,_0x1df063,_0x3a35d6,_0x3da245){var _0x365aa4={'XMD-QUEUE':_0x1412b9[_0x2822('0x15')]?_0x1412b9['Queue'][_0x2822('0x16')]:'','XMD-CALLERID':_0x1df063,'XMD-CALLERID-PREVIEW':_0x3da245?util[_0x2822('0x10')](_0x2822('0x11'),_0x3da245[_0x2822('0x17')],_0x3da245['calleridnum']):_0x1df063,'XMD-DIALID':_0x3a35d6,'XMD-CONTACTID':_0x1412b9['ContactId'],'XMD-CDRTYPE':_0x2822('0x18'),'CALLERID(all)':_0x1df063,'XMD-VOICEQUEUEID':_0x1412b9['VoiceQueueId'],'XMD-DIALCHANNEL':_0x4340ea,'XMD-DIALTIMEOUT':_0x1123db[_0x2822('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0x2822('0x10')]('\x22rtTxX%s%s\x22',_0x1123db[_0x2822('0x1a')]?'g':'',_[_0x2822('0xf')](_0x1123db[_0x2822('0x1b')])?'':_0x2822('0x1c')),'XMD-DIALURL':_0x1123db[_0x2822('0x1d')]||'','XMD-AGI':_0x1123db['dialQueueProject']?util[_0x2822('0x10')](_0x2822('0x1e'),ipAgi,_0x1123db[_0x2822('0x1f')]):_0x2822('0x20'),'XMD-AGIAFTER':_0x1123db[_0x2822('0x1a')]?util[_0x2822('0x10')](_0x2822('0x1e'),ipAgi,_0x1123db[_0x2822('0x1a')]):_0x2822('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x3da245?_0x3da245['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x3da245?_0x3da245[_0x2822('0x21')]:'','XMD-DESTINATION':_0x2822('0x22'),'SIPADDHEADER':_0x2822('0x23')};if(!_['isEmpty'](_0x1123db[_0x2822('0x1b')])){_0x365aa4[util[_0x2822('0x10')]('%s',_0x2822('0x24'))]=_0x1123db[_0x2822('0x1b')];_0x365aa4[util[_0x2822('0x10')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x3a35d6;}return _0x365aa4;};exports[_0x2822('0x25')]=function(_0x42dc44){var _0x291d08={};for(var _0x1d4092 in _0x42dc44){if(_0x42dc44[_0x2822('0x26')](_0x1d4092)){_0x291d08[util[_0x2822('0x10')]('%s',_[_0x2822('0x27')](_0x1d4092))]=_0x42dc44[_0x1d4092];}}return{'variables':_0x291d08};};exports[_0x2822('0x28')]=function(_0x6a3967,_0x1d59e1){if(!_[_0x2822('0x13')](_0x6a3967)){if(_0x6a3967[_0x2822('0x26')]('originated')){if(_0x6a3967['originated']>0x0){_0x6a3967[_0x2822('0x29')]-=0x1;}else{logger[_0x2822('0x6')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x1d59e1);}}}else{logger[_0x2822('0x6')](_0x2822('0x2a'),_0x1d59e1);}};exports[_0x2822('0x2b')]=function(_0x358318){var _0xb8573b=moment()['format'](_0x2822('0x2c'));_0x358318['state']=0xd;_0x358318[_0x2822('0x2d')]=_0x2822('0x2e');_0x358318[_0x2822('0x2f')]=_0xb8573b;_0x358318[_0x2822('0x30')]=_0xb8573b;_0x358318[_0x2822('0x31')]=_0xb8573b;};exports[_0x2822('0x32')]=function(_0x1f52c3,_0x178b87,_0x58e66a){var _0x591f0f=moment()[_0x2822('0x10')](_0x2822('0x2c'));_0x1f52c3[_0x2822('0x33')]=_0x178b87;_0x1f52c3[_0x2822('0x2d')]=_0x58e66a;_0x1f52c3['responsetime']=_0x591f0f;_0x1f52c3['ringtime']=utils[_0x2822('0x34')](_0x1f52c3[_0x2822('0x30')],_0x1f52c3['starttime']);};exports['logLookAgent']=function(_0xb3caab,_0x4fb7c2,_0x4df000){_0xb3caab['membername']=_0x4fb7c2;_0xb3caab[_0x2822('0x35')]=_0x4df000;};exports[_0x2822('0x36')]=function(_0x2c7611,_0x557075,_0x1013df){var _0x64b092=moment()[_0x2822('0x10')](_0x2822('0x2c'));_0x2c7611[_0x2822('0x33')]=_0x557075;_0x2c7611[_0x2822('0x2d')]=_0x1013df;_0x2c7611['responsetime']=_0x2c7611[_0x2822('0x30')]?_0x2c7611[_0x2822('0x30')]:_0x64b092;_0x2c7611['endtime']=_0x2c7611[_0x2822('0x31')]?_0x2c7611[_0x2822('0x31')]:_0x64b092;_0x2c7611[_0x2822('0x37')]=utils[_0x2822('0x34')](_0x2c7611[_0x2822('0x30')]||0x0,_0x2c7611['starttime']||0x0);_0x2c7611[_0x2822('0x38')]=_0x2c7611[_0x2822('0x39')]?utils[_0x2822('0x34')](_0x2c7611[_0x2822('0x31')],_0x2c7611[_0x2822('0x39')]):0x0;};exports[_0x2822('0x3a')]=function(_0x509cfd){return _0x509cfd===_0x2822('0x3b');};exports[_0x2822('0x3c')]=function(_0x3946c5,_0x1ea13b,_0x17c31e,_0x466286,_0x13f50b){var _0x2f62f1=_0x466286?_0x2822('0x3d'):_0x3946c5[_0x2822('0x17')];_0x2f62f1=_0x13f50b?_0x2822('0x3e'):_0x2f62f1;return{'actionid':_0x3946c5['uniqueid'],'action':'originate','channel':_0x3946c5[_0x2822('0x3f')],'callerid':util[_0x2822('0x10')](_0x2822('0x11'),_0x2f62f1,_0x3946c5[_0x2822('0x40')]),'Exten':_0x2822('0x22'),'Context':_0x2822('0x41'),'Priority':'1','variable':_0x17c31e,'timeout':(_0x1ea13b[_0x2822('0x42')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3946c5['uniqueid']};};exports['totalGlobal']=function(_0xf442b){return _0xf442b[_0x2822('0x43')]+_0xf442b['countcongestionretry']+_0xf442b['countnoanswerretry']+_0xf442b[_0x2822('0x44')]+_0xf442b[_0x2822('0x45')];};exports['cloneAction']=function(_0x38e699){var _0x4d17d9=_['clone'](_0x38e699);_0x4d17d9[_0x2822('0x33')]=0xf;_0x4d17d9['statedesc']='Global';return _0x4d17d9;};exports[_0x2822('0x46')]=function(_0x4dabbf,_0x4c41eb,_0x310c7b){var _0x359787={};_0x359787[_0x4c41eb]=_0x4dabbf[_0x4c41eb];_0x359787['active']=![];_0x359787[_0x2822('0x47')]=moment()[_0x2822('0x48')](_0x310c7b,_0x2822('0x49'))['format'](_0x2822('0x2c'));_0x359787['ContactId']=_0x4dabbf['ContactId'];_0x359787[_0x2822('0x4a')]=_0x4dabbf[_0x2822('0x4a')];_0x359787[_0x2822('0x4b')]=_0x4dabbf[_0x2822('0x4b')]||undefined;return _0x359787;};exports[_0x2822('0x4c')]=function(_0x5281bc,_0x5c73e5){if(!_[_0x2822('0x13')](_0x5281bc)){if(_0x5281bc[_0x2822('0x4d')]>0x0){_0x5281bc[_0x2822('0x4d')]-=0x1;}else{logger['error'](_0x5c73e5,_0x2822('0x4e'));}}else{logger[_0x2822('0x6')](_0x5c73e5,_0x2822('0x4f'));}};exports[_0x2822('0x50')]=function(_0x1fa46f){if(_0x1fa46f<=0x0){return!![];}return![];};function buildObj(_0x1e9bb4,_0xea697b,_0x2c5823){_0x1e9bb4[_0x2822('0x51')]=_0xea697b;_0x1e9bb4['name']=_0x1e9bb4[_0x2822('0x52')];_0x1e9bb4[_0x2822('0x53')]=_0x1e9bb4[_0x2822('0x3f')];_0x1e9bb4[_0x2822('0x54')]='voice';if(_0x2c5823){_0x1e9bb4[_0x2822('0x55')]=_0x2c5823[_0x2822('0x55')];}return _0x1e9bb4;}exports[_0x2822('0x56')]=buildObj;exports[_0x2822('0x57')]=function(_0x1ca597){var _0x2ffa03=[];for(var _0x4553b2 in _0x1ca597){if(_0x1ca597['hasOwnProperty'](_0x4553b2)){if(!_[_0x2822('0x13')](_0x1ca597[_0x4553b2])&&_0x1ca597[_0x4553b2][_0x2822('0x33')]===_0x2822('0x58')&&_0x1ca597[_0x4553b2][_0x2822('0x59')]===_0x2822('0x5a')){_0x2ffa03[_0x2822('0x5b')](_0x1ca597[_0x4553b2]['id']);}}}return _0x2ffa03;};exports['getDiff']=function(_0x1d9d2f){var _0x1346ba=moment()[_0x2822('0x5c')](0x0);var _0x2d63ad=moment(_0x1d9d2f)[_0x2822('0x5c')](0x0);return _0x1346ba[_0x2822('0x5d')](_0x2d63ad,_0x2822('0x5e'));};exports[_0x2822('0x5f')]=function(_0x3aeeb3){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3aeeb3[_0x2822('0x60')],'ListId':_0x3aeeb3[_0x2822('0x4a')],'VoiceQueueId':_0x3aeeb3[_0x2822('0x4b')]||undefined,'CampaignId':_0x3aeeb3[_0x2822('0x61')]||undefined};};exports['filterKey']=function(_0x241de2){if(_0x241de2===_0x2822('0x62')||_0x241de2===_0x2822('0x63')||_0x241de2==='queue'||_0x241de2===_0x2822('0x64')||_0x241de2===_0x2822('0x65')||_0x241de2===_0x2822('0x66')||_0x241de2==='membername'||_0x241de2===_0x2822('0x3f')||_0x241de2===_0x2822('0x17')||_0x241de2===_0x2822('0x67')||_0x241de2===_0x2822('0x40')||_0x241de2===_0x2822('0x47')||_0x241de2===_0x2822('0x43')||_0x241de2===_0x2822('0x68')||_0x241de2===_0x2822('0x69')||_0x241de2==='countglobal'||_0x241de2===_0x2822('0x6a')||_0x241de2===_0x2822('0x6b')||_0x241de2==='callbackat'||_0x241de2===_0x2822('0x6c')||_0x241de2===_0x2822('0x60')||_0x241de2===_0x2822('0x4a')||_0x241de2==='UserId'||_0x241de2==='VoiceQueueId'||_0x241de2===_0x2822('0x6d')||_0x241de2===_0x2822('0x6e')||_0x241de2===_0x2822('0x6f')||_0x241de2===_0x2822('0x70')||_0x241de2===_0x2822('0x71')||_0x241de2===_0x2822('0x72')||_0x241de2===_0x2822('0x73')||_0x241de2==='xmd-dialoptions'||_0x241de2==='xmd-dialid'||_0x241de2===_0x2822('0x74')||_0x241de2===_0x2822('0x75')||_0x241de2===_0x2822('0x76')||_0x241de2==='xmd-callerid'||_0x241de2===_0x2822('0x77')||_0x241de2===_0x2822('0x78')||_0x241de2===_0x2822('0x79')||_0x241de2===_0x2822('0x7a')||_0x241de2===_0x2822('0x7b')||_0x241de2===_0x2822('0x7c')||_0x241de2==='rtpaudioqosloss'||_0x241de2===_0x2822('0x7d')||_0x241de2===_0x2822('0x7e')||_0x241de2==='rtpaudioqosrttbridged'||_0x241de2===_0x2822('0x79')||_0x241de2===_0x2822('0x7a')||_0x241de2==='rtpaudioqosjitter'||_0x241de2===_0x2822('0x7c')||_0x241de2===_0x2822('0x7f')||_0x241de2===_0x2822('0x7d')||_0x241de2===_0x2822('0x7e')||_0x241de2===_0x2822('0x80')||_0x241de2===_0x2822('0x81')||_0x241de2===_0x2822('0x82')||_0x241de2===_0x2822('0x33')||_0x241de2==='statedesc'){return![];}return!![];};exports[_0x2822('0x83')]=function(_0x28c048,_0x193686){var _0x40e9c7,_0x120738,_0x387eb9;if(_0x193686<=0x0){_0x193686=0x1;}_0x40e9c7=new RegExp(_0x2822('0x84')+_0x193686+'}$');_0x120738=Math[_0x2822('0x85')](0xa,_0x193686-0x1);_0x387eb9=Math[_0x2822('0x85')](0xa,_0x193686)-0x1;return util['format']('%s',_[_0x2822('0x86')](_0x28c048,_0x40e9c7,_['random'](_0x120738,_0x387eb9)));};exports[_0x2822('0x87')]=function(_0x1c20c1){var _0xbb72f9=_0x1c20c1[_0x2822('0x88')](/"(.*?)"/);return _0xbb72f9?_0xbb72f9[0x1]:_0x1c20c1;};exports[_0x2822('0x89')]=function(_0x4425a0){var _0x1ffb70=_0x4425a0['match'](/<(.*?)>/);return _0x1ffb70?_0x1ffb70[0x1]:_0x4425a0;};function buildNoAnswerEventPayload(_0x4fe2c0,_0x57f4ff){var _0x42acae=buildObj(_0x4fe2c0,'noanswer');if(!_[_0x2822('0xf')](_0x57f4ff[_0x2822('0x8a')])){Object[_0x2822('0x8b')](_0x57f4ff['variables'])[_0x2822('0x8c')](function(_0x29335c){_0x42acae[_0x29335c[_0x2822('0x8d')]()]=_0x57f4ff[_0x2822('0x8a')][_0x29335c];});}return _0x42acae;}exports[_0x2822('0x8e')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 06b3da5..1f1bf79 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 _0x982a=['boolean','reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','queueremove','queuepause'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x982a,0xff));var _0xa982=function(_0x27d95b,_0x468d53){_0x27d95b=_0x27d95b-0x0;var _0xb9e8a7=_0x982a[_0x27d95b];return _0xb9e8a7;};'use strict';exports[_0xa982('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xa982('0x1'),'required':!![]},'penalty':{'type':_0xa982('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xa982('0x3')]={'queue':{'type':_0xa982('0x1'),'required':!![]},'interface':{'type':_0xa982('0x1'),'required':!![]}};exports[_0xa982('0x4')]={'interface':{'type':_0xa982('0x1'),'required':!![]},'paused':{'type':_0xa982('0x5')},'reason':{'type':'string','required':![]}};exports[_0xa982('0x6')]={'module':{'type':_0xa982('0x1'),'required':![]}};exports[_0xa982('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0xa982('0x1'),'required':!![]},'filename':{'type':_0xa982('0x1')},'format':{'type':_0xa982('0x1')},'mixmonitorid':{'type':_0xa982('0x1')}};exports[_0xa982('0x8')]={'uniqueid':{'type':_0xa982('0x1'),'required':!![]}};exports[_0xa982('0x9')]={'uniqueid':{'type':_0xa982('0x1'),'required':!![]},'exten':{'type':_0xa982('0x1'),'required':!![]},'context':{'type':_0xa982('0x1')}}; \ No newline at end of file +var _0xaeac=['queueadd','string','number','boolean','queueremove','queuepause','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xaeac,0x14d));var _0xcaea=function(_0x2972b0,_0x2af5e8){_0x2972b0=_0x2972b0-0x0;var _0x4dc7bb=_0xaeac[_0x2972b0];return _0x4dc7bb;};'use strict';exports[_0xcaea('0x0')]={'queue':{'type':_0xcaea('0x1'),'required':!![]},'interface':{'type':_0xcaea('0x1'),'required':!![]},'membername':{'type':_0xcaea('0x1'),'required':!![]},'penalty':{'type':_0xcaea('0x2'),'required':![]},'paused':{'type':_0xcaea('0x3'),'required':![]}};exports[_0xcaea('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xcaea('0x1'),'required':!![]}};exports[_0xcaea('0x5')]={'interface':{'type':_0xcaea('0x1'),'required':!![]},'paused':{'type':_0xcaea('0x3')},'reason':{'type':_0xcaea('0x1'),'required':![]}};exports['reload']={'module':{'type':_0xcaea('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xcaea('0x1'),'required':!![]}};exports[_0xcaea('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0xcaea('0x1')},'mixmonitorid':{'type':_0xcaea('0x1')}};exports[_0xcaea('0x7')]={'uniqueid':{'type':_0xcaea('0x1'),'required':!![]}};exports[_0xcaea('0x8')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xcaea('0x1'),'required':!![]},'context':{'type':_0xcaea('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index e982acf..f0368a1 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 _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x361d82,_0x2367f7){var _0x2bd70f=function(_0x1821d1){while(--_0x1821d1){_0x361d82['push'](_0x361d82['shift']());}};_0x2bd70f(++_0x2367f7);}(_0xb10b,0x12a));var _0xbb10=function(_0x5bdfb2,_0x5eeb10){_0x5bdfb2=_0x5bdfb2-0x0;var _0x5f5240=_0xb10b[_0x5bdfb2];return _0x5f5240;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime; \ No newline at end of file +var _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0x4e3948,_0x4fb3c2){var _0x95e0e4=function(_0xe3a434){while(--_0xe3a434){_0x4e3948['push'](_0x4e3948['shift']());}};_0x95e0e4(++_0x4fb3c2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4a17eb,_0x2ff0bb){_0x4a17eb=_0x4a17eb-0x0;var _0x2f7cfe=_0x5f2f[_0x4a17eb];return _0x2f7cfe;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 32f23ab..36b779f 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4f6=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x62914d,_0x182791){var _0x4ce45c=function(_0xdd9a9){while(--_0xdd9a9){_0x62914d['push'](_0x62914d['shift']());}};_0x4ce45c(++_0x182791);}(_0xb4f6,0xbe));var _0x6b4f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb4f6[_0x321bb2];return _0x9c12ed;};'use strict';function mergeDBDataToRealtime(_0x148b6c,_0x438a7d){var _0x25146c=Object[_0x6b4f('0x0')]({},_0x148b6c);for(var _0x1a0b09 in _0x438a7d){if(_0x25146c[_0x6b4f('0x1')](_0x1a0b09)){_0x25146c[_0x1a0b09]=_0x438a7d[_0x1a0b09];}}return _0x25146c;}exports[_0x6b4f('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x56bf=['mergeDBDataToRealtime'];(function(_0x5a16e0,_0x17a147){var _0x4aa617=function(_0x22d329){while(--_0x22d329){_0x5a16e0['push'](_0x5a16e0['shift']());}};_0x4aa617(++_0x17a147);}(_0x56bf,0x1d9));var _0xf56b=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0x56bf[_0xe15270];return _0x1e813b;};'use strict';function mergeDBDataToRealtime(_0x381222,_0x37e63){var _0xcdfe4e=Object['assign']({},_0x381222);for(var _0x5846fb in _0x37e63){if(_0xcdfe4e['hasOwnProperty'](_0x5846fb)){_0xcdfe4e[_0x5846fb]=_0x37e63[_0x5846fb];}}return _0xcdfe4e;}exports[_0xf56b('0x0')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 3bd7a97..29489d5 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 _0x96fa=['disabled','voiceQueueReport','bind','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','isNil','accountcode','name','format','SIP/%s','length','connectedlinenum','lastAssignedTo','interface','queuecallercompleteAt','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','internal','voiceCallReport','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','from-sip','destination','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','callerid','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','create','monitors','filename','createdAt','connectedlinename','xcally-motion-dialer','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr'];(function(_0x4aba33,_0x56b41e){var _0x5086ed=function(_0x590cfa){while(--_0x590cfa){_0x4aba33['push'](_0x4aba33['shift']());}};_0x5086ed(++_0x56b41e);}(_0x96fa,0x1ed));var _0xa96f=function(_0x2f63c5,_0x1a5083){_0x2f63c5=_0x2f63c5-0x0;var _0x78a415=_0x96fa[_0x2f63c5];return _0x78a415;};'use strict';var _=require(_0xa96f('0x0'));var moment=require(_0xa96f('0x1'));var util=require(_0xa96f('0x2'));var config=require(_0xa96f('0x3'));var ami=require(_0xa96f('0x4'));var RpcVoiceAgentReport=require(_0xa96f('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xa96f('0x6'));var RpcVoiceTransferReport=require(_0xa96f('0x7'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xa96f('0x8'));var VoiceAgentReport=require(_0xa96f('0x9'));var VoiceDialReport=require(_0xa96f('0xa'));var UserReport=require('./userReport');function Report(_0x31bea1){this[_0xa96f('0xb')]=_0x31bea1;this[_0xa96f('0xc')]=_0x31bea1[_0xa96f('0xc')];this[_0xa96f('0xd')]=_0x31bea1[_0xa96f('0xd')];}Report[_0xa96f('0xe')][_0xa96f('0xf')]=function(_0x4e0e51){var _0x52689a=new VoiceQueueReport(this[_0xa96f('0xb')]);var _0x4abb16=new VoiceAgentReport(this[_0xa96f('0xb')]);var _0x32903f=new VoiceDialReport(this[_0xa96f('0xb')]);var _0x379c23=new VoiceCallReport(this[_0xa96f('0xb')]);var _0x33c617=new UserReport(this[_0xa96f('0xb')]);if(config[_0xa96f('0x10')]&&config[_0xa96f('0x10')][_0xa96f('0x11')]){ami['on']('custom:voiceQueueReport',this[_0xa96f('0x12')][_0xa96f('0x13')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0xa96f('0x13')](this));ami['on'](_0xa96f('0x14'),this[_0xa96f('0x15')]['bind'](this));ami['on']('custom:voiceDialReport',this[_0xa96f('0x16')][_0xa96f('0x13')](this));ami['on'](_0xa96f('0x17'),this['blindTransfer'][_0xa96f('0x13')](this));ami['on'](_0xa96f('0x18'),this[_0xa96f('0x19')]['bind'](this));}};Report[_0xa96f('0xe')][_0xa96f('0x1a')]=function(_0x2135e6){var _0x926580;_0x926580=_[_0xa96f('0x1b')](this['agents'],function(_0x2e1208){return _0x2e1208['accountcode']==_0x2135e6||_0x2e1208['name']==_0x2135e6;});if(_[_0xa96f('0x1c')](_0x926580)){var _0x17ea3a=_[_0xa96f('0x1b')](this[_0xa96f('0xd')],function(_0x40c05c){return _0x40c05c[_0xa96f('0x1d')]==_0x2135e6||_0x40c05c[_0xa96f('0x1e')]==_0x2135e6;});if(_0x17ea3a){_0x926580=_[_0xa96f('0x1b')](this[_0xa96f('0xc')],function(_0x3f4166){return _0x3f4166['interface']==util[_0xa96f('0x1f')](_0xa96f('0x20'),_0x17ea3a[_0xa96f('0x1e')]);});}}return _0x926580;};Report[_0xa96f('0xe')][_0xa96f('0x12')]=function(_0x3b4611){for(var _0x396e76=0x0;_0x396e76<_0x3b4611[_0xa96f('0x21')];_0x396e76+=0x1){var _0x13b113=this[_0xa96f('0x1a')](_0x3b4611[_0x396e76][_0xa96f('0x22')]);if(_0x13b113){_0x3b4611[_0x396e76][_0xa96f('0x1d')]=_0x13b113[_0xa96f('0x1d')];_0x3b4611[_0x396e76]['assigned']=!![];_0x3b4611[_0x396e76][_0xa96f('0x23')]=_0x13b113[_0xa96f('0x1e')];_0x3b4611[_0x396e76]['interface']=_[_0xa96f('0x1c')](_0x13b113[_0xa96f('0x24')])?util[_0xa96f('0x1f')](_0xa96f('0x20'),_0x13b113['name']):_0x13b113[_0xa96f('0x24')];if(_0x3b4611[_0x396e76]['queuecallercomplete']){_0x3b4611[_0x396e76][_0xa96f('0x25')]=moment()[_0xa96f('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3b4611[_0x396e76]['queuecallerexit']){_0x3b4611[_0x396e76][_0xa96f('0x26')]=moment()[_0xa96f('0x1f')](_0xa96f('0x27'));}RpcMemberReport[_0xa96f('0x12')](_0x3b4611[_0x396e76]);}RpcVoiceQueueReport['create'](_0x3b4611[_0x396e76]);}};function extractCalleridNumber(_0xc0b856){var _0x478460=_0xc0b856[_0xa96f('0x28')](/<(.*?)>/);return _0x478460?_0x478460[0x1]:_0xc0b856;}Report[_0xa96f('0xe')][_0xa96f('0x29')]=function(_0x6be399){for(var _0x16f4d2=0x0;_0x16f4d2','transfers','transfereelinkedid','linkedid','getCallType','create','monitor','monitors','monitorFilename','filename','createdAt'];(function(_0x3e885c,_0x4f295b){var _0x29278c=function(_0x3fb14a){while(--_0x3fb14a){_0x3e885c['push'](_0x3e885c['shift']());}};_0x29278c(++_0x4f295b);}(_0x1826,0xc8));var _0x6182=function(_0x2ce8b2,_0x55e8a0){_0x2ce8b2=_0x2ce8b2-0x0;var _0x59e5c1=_0x1826[_0x2ce8b2];return _0x59e5c1;};'use strict';var _=require(_0x6182('0x0'));var moment=require(_0x6182('0x1'));var util=require(_0x6182('0x2'));var config=require(_0x6182('0x3'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x6182('0x4'));var RpcMemberReport=require(_0x6182('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x6182('0x6'));var RpcVoiceTransferReport=require(_0x6182('0x7'));var VoiceQueueReport=require(_0x6182('0x8'));var VoiceCallReport=require(_0x6182('0x9'));var VoiceAgentReport=require(_0x6182('0xa'));var VoiceDialReport=require(_0x6182('0xb'));var UserReport=require('./userReport');function Report(_0xe50e21){this[_0x6182('0xc')]=_0xe50e21;this[_0x6182('0xd')]=_0xe50e21[_0x6182('0xd')];this[_0x6182('0xe')]=_0xe50e21[_0x6182('0xe')];}Report[_0x6182('0xf')][_0x6182('0x10')]=function(_0x53bc8b){var _0x40a0e3=new VoiceQueueReport(this[_0x6182('0xc')]);var _0x42b9f4=new VoiceAgentReport(this[_0x6182('0xc')]);var _0x3cd5eb=new VoiceDialReport(this[_0x6182('0xc')]);var _0x1d7d97=new VoiceCallReport(this[_0x6182('0xc')]);var _0x5d1eb2=new UserReport(this['realtime']);if(config[_0x6182('0x11')]&&config[_0x6182('0x11')][_0x6182('0x12')]){ami['on'](_0x6182('0x13'),this['voiceQueueReport'][_0x6182('0x14')](this));ami['on']('custom:voiceCallReport',this[_0x6182('0x15')][_0x6182('0x14')](this));ami['on']('custom:voiceAgentReport',this['voiceAgentReport']['bind'](this));ami['on'](_0x6182('0x16'),this[_0x6182('0x17')]['bind'](this));ami['on'](_0x6182('0x18'),this[_0x6182('0x19')][_0x6182('0x14')](this));ami['on']('attendedtransfer',this[_0x6182('0x1a')][_0x6182('0x14')](this));}};Report[_0x6182('0xf')][_0x6182('0x1b')]=function(_0x513b80){var _0x289f4b;_0x289f4b=_['find'](this[_0x6182('0xd')],function(_0x5bfc46){return _0x5bfc46[_0x6182('0x1c')]==_0x513b80||_0x5bfc46[_0x6182('0x1d')]==_0x513b80;});if(_[_0x6182('0x1e')](_0x289f4b)){var _0x967790=_['find'](this[_0x6182('0xe')],function(_0x160c6a){return _0x160c6a[_0x6182('0x1c')]==_0x513b80||_0x160c6a['name']==_0x513b80;});if(_0x967790){_0x289f4b=_[_0x6182('0x1f')](this[_0x6182('0xd')],function(_0x29ff2d){return _0x29ff2d[_0x6182('0x20')]==util[_0x6182('0x21')](_0x6182('0x22'),_0x967790['name']);});}}return _0x289f4b;};Report['prototype']['voiceQueueReport']=function(_0xafb364){for(var _0x57040e=0x0;_0x57040e<_0xafb364['length'];_0x57040e+=0x1){var _0x5899e3=this[_0x6182('0x1b')](_0xafb364[_0x57040e][_0x6182('0x23')]);if(_0x5899e3){_0xafb364[_0x57040e][_0x6182('0x1c')]=_0x5899e3[_0x6182('0x1c')];_0xafb364[_0x57040e][_0x6182('0x24')]=!![];_0xafb364[_0x57040e][_0x6182('0x25')]=_0x5899e3[_0x6182('0x1d')];_0xafb364[_0x57040e][_0x6182('0x20')]=_[_0x6182('0x1e')](_0x5899e3['interface'])?util[_0x6182('0x21')](_0x6182('0x22'),_0x5899e3[_0x6182('0x1d')]):_0x5899e3['interface'];if(_0xafb364[_0x57040e][_0x6182('0x26')]){_0xafb364[_0x57040e][_0x6182('0x27')]=moment()[_0x6182('0x21')](_0x6182('0x28'));}if(_0xafb364[_0x57040e]['queuecallerexit']){_0xafb364[_0x57040e][_0x6182('0x29')]=moment()[_0x6182('0x21')](_0x6182('0x28'));}RpcMemberReport[_0x6182('0x2a')](_0xafb364[_0x57040e]);}RpcVoiceQueueReport['create'](_0xafb364[_0x57040e]);}};function extractCalleridNumber(_0x4e4a7b){var _0x2e53df=_0x4e4a7b[_0x6182('0x2b')](/<(.*?)>/);return _0x2e53df?_0x2e53df[0x1]:_0x4e4a7b;}Report['prototype'][_0x6182('0x2c')]=function(_0x2a87f1){for(var _0x53123a=0x0;_0x53123a0x0?!![]:![];if(!_0x48dd5f){return this[_0x3f14('0x1a')](this[_0x3f14('0x15')][_0x3f14('0x6c')]);}};VoiceQueueReport[_0x3f14('0x38')][_0x3f14('0x1c')]=function(_0x46e484){var _0x4e4ae7=this[_0x3f14('0x15')]['id'];if(this[_0x3f14('0x15')][_0x3f14('0x62')][_0x4e4ae7]&&this[_0x3f14('0x15')][_0x3f14('0x62')][_0x4e4ae7][_0x46e484[_0x3f14('0x60')]]){this[_0x3f14('0x15')][_0x3f14('0x62')][_0x4e4ae7][_0x46e484[_0x3f14('0x60')]]['agents'][_0x3f14('0x6d')](_0x46e484);}};VoiceQueueReport['prototype'][_0x3f14('0x6e')]=function(_0x14b7c6){var _0xe33a27=this;try{if(this['isNotNull'](_0x14b7c6)&&this[_0x3f14('0x6f')](_0x14b7c6[_0x3f14('0x55')])){logger[_0x3f14('0x4a')](_0x3f14('0x70'),util[_0x3f14('0x41')](_0x14b7c6,{'showHidden':![],'depth':null}));var _0x2489cb=this[_0x3f14('0x47')][_0x14b7c6[_0x3f14('0x55')]];if(_0x2489cb){logger['debug'](_0x3f14('0x71'),_0x2489cb['name']);this[_0x3f14('0x15')][_0x3f14('0x5d')][_0x2489cb[_0x3f14('0x59')]]={'summaryEvent':_0x14b7c6};this['summary'][_0x3f14('0x6b')]+=0x1;return ami[_0x3f14('0x5c')]({'action':_0x3f14('0x62'),'queue':_0x2489cb['name']})[_0x3f14('0x5f')](function(_0x37de06){if(!_0xe33a27[_0x3f14('0x15')][_0x3f14('0x62')][_0x14b7c6[_0x3f14('0x60')]]){_0xe33a27[_0x3f14('0x15')][_0x3f14('0x62')][_0x14b7c6[_0x3f14('0x60')]]={};}_0xe33a27[_0x3f14('0x15')][_0x3f14('0x62')][_0x14b7c6[_0x3f14('0x60')]][_0x37de06[_0x3f14('0x60')]]={'queue':_0x2489cb['name'],'agents':[]};})['catch'](function(_0x339154){throw _0x339154;});}}}catch(_0x2446e3){logger[_0x3f14('0x3f')](_0x3f14('0x64'),util[_0x3f14('0x41')](_0x2446e3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3f14('0x38')][_0x3f14('0x1a')]=function(_0x176c58){if(this[_0x3f14('0x15')]['statusRequests']>0x0){this[_0x3f14('0x15')][_0x3f14('0x6c')]=_0x176c58;return;}logger['debug'](_0x3f14('0x72'),util['inspect'](_0x176c58,{'showHidden':![],'depth':null}));this[_0x3f14('0x15')]=initializeSummary();ami['emit']('custom:queuesummarycomplete',{});};VoiceQueueReport['prototype'][_0x3f14('0x73')]=function(_0x3b25ad){try{if(this['isNotNull'](_0x3b25ad)){logger[_0x3f14('0x4a')](_0x3f14('0x74'),_0x3b25ad[_0x3f14('0x52')],util[_0x3f14('0x41')](_0x3b25ad,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x3f14('0x10')][_0x3b25ad[_0x3f14('0x52')]])){this[_0x3f14('0x10')][_0x3b25ad[_0x3f14('0x52')]]=[];}if(_[_0x3f14('0x5b')](this[_0x3f14('0x13')][_0x3b25ad[_0x3f14('0x52')]])){this['channels'][_0x3b25ad[_0x3f14('0x52')]]={};}var _0x4fc9cf=new QueueReport();_0x4fc9cf[_0x3f14('0x55')]=_0x3b25ad[_0x3f14('0x55')];_0x4fc9cf[_0x3f14('0x69')]=this[_0x3f14('0x47')][_0x4fc9cf[_0x3f14('0x55')]]&&this[_0x3f14('0x47')][_0x4fc9cf[_0x3f14('0x55')]][_0x3f14('0x69')]?this[_0x3f14('0x47')][_0x4fc9cf[_0x3f14('0x55')]][_0x3f14('0x69')]||_0x3f14('0x58'):_0x3f14('0x58');_0x4fc9cf[_0x3f14('0x75')]=moment()['format'](_0x3f14('0x76'));_0x4fc9cf[_0x3f14('0x77')]=_0x3b25ad[_0x3f14('0x77')];_0x4fc9cf[_0x3f14('0x78')]=_0x3b25ad[_0x3f14('0x78')];_0x4fc9cf[_0x3f14('0x52')]=_0x3b25ad['uniqueid'];_0x4fc9cf[_0x3f14('0x79')]=this[_0x3f14('0x13')][_0x3b25ad[_0x3f14('0x52')]][_0x3f14('0x79')];logger[_0x3f14('0x7a')](_0x3f14('0x7b'),_0x4fc9cf[_0x3f14('0x55')],_0x4fc9cf[_0x3f14('0x69')]);Object['assign'](_0x4fc9cf,_['pick'](_0x3b25ad,_['keys'](_0x4fc9cf)));this[_0x3f14('0x10')][_0x3b25ad[_0x3f14('0x52')]]['push'](_0x4fc9cf);this[_0x3f14('0x13')][_0x3b25ad['uniqueid']]=_0x4fc9cf;this[_0x3f14('0x7c')](_0x4fc9cf,_0x3f14('0x1f'));}}catch(_0x237708){logger[_0x3f14('0x3f')](_0x3f14('0x74'),_0x3b25ad[_0x3f14('0x52')],util[_0x3f14('0x41')](_0x237708,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x5afd5a){try{if(this[_0x3f14('0x6f')](_0x5afd5a)){logger['debug'](_0x3f14('0x7d'),_0x5afd5a[_0x3f14('0x52')],util[_0x3f14('0x41')](_0x5afd5a,{'showHidden':![],'depth':null}));if(this[_0x3f14('0x10')][_0x5afd5a['uniqueid']]){var _0x2f218a=_[_0x3f14('0x7e')](this[_0x3f14('0x10')][_0x5afd5a[_0x3f14('0x52')]]);_0x2f218a[_0x3f14('0x37')]=![];_0x2f218a[_0x3f14('0x7f')]=null;_0x2f218a[_0x3f14('0x80')]=_0x5afd5a['holdtime'];_0x2f218a[_0x3f14('0x81')]=_0x5afd5a[_0x3f14('0x81')];_0x2f218a[_0x3f14('0x20')]=!![];_0x2f218a[_0x3f14('0x82')]=moment()[_0x3f14('0x4e')](_0x3f14('0x76'));_0x2f218a[_0x3f14('0x53')]='ABANDONED';_0x2f218a[_0x3f14('0x83')]=null;logger[_0x3f14('0x7a')](_0x3f14('0x84'),_0x2f218a['queue'],_0x2f218a[_0x3f14('0x69')]);this[_0x3f14('0x13')][_0x5afd5a['uniqueid']]=_0x2f218a;this[_0x3f14('0x48')](_0x2f218a,'queuecallerabandon');}}}catch(_0x5310fc){logger[_0x3f14('0x3f')]('[%s][voiceQueueReport][queuecallerabandon]',_0x5afd5a[_0x3f14('0x52')],util[_0x3f14('0x41')](_0x5310fc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3f14('0x38')][_0x3f14('0x22')]=function(_0x5445b2){try{if(this[_0x3f14('0x6f')](_0x5445b2)){logger[_0x3f14('0x4a')]('[%s][voiceQueueReport][queuecallerleave]',_0x5445b2[_0x3f14('0x52')],util[_0x3f14('0x41')](_0x5445b2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5445b2[_0x3f14('0x52')]]){var _0x1e48e2=_['last'](this[_0x3f14('0x10')][_0x5445b2[_0x3f14('0x52')]]);_0x1e48e2[_0x3f14('0x85')]=moment()[_0x3f14('0x4e')](_0x3f14('0x76'));_0x1e48e2['connectedlinenum']=_0x5445b2['connectedlinenum'];_0x1e48e2[_0x3f14('0x86')]=_0x5445b2[_0x3f14('0x86')];logger[_0x3f14('0x7a')](_0x3f14('0x87'),_0x1e48e2[_0x3f14('0x55')],_0x1e48e2[_0x3f14('0x69')],_0x5445b2[_0x3f14('0x88')],_0x5445b2[_0x3f14('0x86')]);this[_0x3f14('0x13')][_0x5445b2['uniqueid']]=_0x1e48e2;this[_0x3f14('0x7c')](_0x1e48e2,_0x3f14('0x21'));}}}catch(_0x3af252){logger['error'](_0x3f14('0x89'),_0x5445b2['uniqueid'],util[_0x3f14('0x41')](_0x3af252,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3f14('0x38')][_0x3f14('0x8a')]=function(_0x3a74ff){try{if(this['isNotNull'](_0x3a74ff)){logger[_0x3f14('0x4a')]('[%s][voiceQueueReport][agentconnect]',_0x3a74ff[_0x3f14('0x52')],util[_0x3f14('0x41')](_0x3a74ff,{'showHidden':![],'depth':null}));if(this[_0x3f14('0x10')][_0x3a74ff[_0x3f14('0x52')]]){var _0x6e7c65=_[_0x3f14('0x7e')](this[_0x3f14('0x10')][_0x3a74ff[_0x3f14('0x52')]]);_0x6e7c65[_0x3f14('0x37')]=!![];_0x6e7c65[_0x3f14('0x53')]=_0x3f14('0x8b');logger['info'](_0x3f14('0x8c'),_0x6e7c65[_0x3f14('0x55')],_0x6e7c65[_0x3f14('0x69')]);}}}catch(_0x1c1582){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x3a74ff[_0x3f14('0x52')],util[_0x3f14('0x41')](_0x1c1582,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3f14('0x38')]['syncAgentComplete']=function(_0xaf06de){try{if(this[_0x3f14('0x6f')](_0xaf06de)){logger[_0x3f14('0x4a')](_0x3f14('0x8d'),_0xaf06de[_0x3f14('0x52')],util[_0x3f14('0x41')](_0xaf06de,{'showHidden':![],'depth':null}));if(this[_0x3f14('0x10')][_0xaf06de[_0x3f14('0x52')]]){var _0xa132f=_['last'](this[_0x3f14('0x10')][_0xaf06de[_0x3f14('0x52')]]);_0xa132f['queuecallerabandon']=![];_0xa132f[_0x3f14('0x82')]=null;_0xa132f[_0x3f14('0x8e')]=!![];_0xa132f[_0x3f14('0x83')]=_0xaf06de[_0x3f14('0x8f')];_0xa132f[_0x3f14('0x80')]=_0xaf06de[_0x3f14('0x80')];_0xa132f[_0x3f14('0x37')]=!![];_0xa132f[_0x3f14('0x36')]=![];_0xa132f[_0x3f14('0x90')]=null;if(!_0xa132f[_0x3f14('0x91')]){if(_0xaf06de['reason']==_0x3f14('0x91')){_0xa132f[_0x3f14('0x53')]='COMPLETED';logger[_0x3f14('0x7a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0xa132f[_0x3f14('0x55')],_0xa132f[_0x3f14('0x69')]);}else{if(_[_0x3f14('0x92')](_0xaf06de[_0x3f14('0x3c')][_0x3f14('0x93')](),_0x3f14('0x94'))){if(this[_0x3f14('0x10')][_0xaf06de[_0x3f14('0x95')]]){var _0x342f98=_[_0x3f14('0x7e')](this['queueReports'][_0xaf06de[_0x3f14('0x95')]]);_0x342f98[_0x3f14('0x37')]=![];_0x342f98['queuecallerexit']=!![];_0x342f98['queuecallerexitAt']=moment(_0xa132f[_0x3f14('0x75')])[_0x3f14('0x96')](_0xaf06de[_0x3f14('0x80')],_0x3f14('0x97'))[_0x3f14('0x4e')](_0x3f14('0x76'));_0x342f98[_0x3f14('0x53')]=_0x3f14('0x98');_0x342f98[_0x3f14('0x91')]=!![];_0x342f98['transfertype']=_0x3f14('0x99');_0x342f98[_0x3f14('0x9a')]=_0xaf06de['destexten'];_0x342f98['transferuniqueid']=_0xaf06de[_0x3f14('0x52')];logger['info'](_0x3f14('0x9b'),_0x342f98[_0x3f14('0x55')],_0x342f98[_0x3f14('0x69')]);var _0xdc09c9=this['queueReports'][_0xaf06de['linkedid']];this[_0x3f14('0x10')][_0xaf06de['linkedid']]=this[_0x3f14('0x10')][_0xaf06de['uniqueid']];this[_0x3f14('0x10')][_0xaf06de['uniqueid']]=_0xdc09c9;}}else{_0xa132f['queuecallerexitreason']=_0x3f14('0x9c')+_0xaf06de[_0x3f14('0x9d')][_0x3f14('0x9e')]();logger[_0x3f14('0x7a')](_0x3f14('0x9f'),_0xa132f[_0x3f14('0x55')],_0xa132f[_0x3f14('0x69')],_0xa132f[_0x3f14('0x53')]);}}}this[_0x3f14('0x13')][_0xaf06de[_0x3f14('0x52')]]=_0xa132f;}}}catch(_0x4a51de){logger[_0x3f14('0x3f')](_0x3f14('0x8d'),_0xaf06de[_0x3f14('0x52')],util[_0x3f14('0x41')](_0x4a51de,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3f14('0x38')][_0x3f14('0x24')]=function(_0x191bc8){try{if(this['isNotNull'](_0x191bc8)){logger[_0x3f14('0x4a')]('[%s][voiceQueueReport][varset]',_0x191bc8[_0x3f14('0x52')],util['inspect'](_0x191bc8,{'showHidden':![],'depth':null}));this[_0x3f14('0xa0')](_0x191bc8['uniqueid'],_[_0x3f14('0xa1')](_0x191bc8[_0x3f14('0xa2')])[0x0],_0x191bc8['value']);if(this['queueReports'][_0x191bc8[_0x3f14('0x52')]]){var _0x42792b=_[_0x3f14('0x7e')](this['queueReports'][_0x191bc8[_0x3f14('0x52')]]);if(_0x42792b){if(this['isNotNull'](_0x191bc8[_0x3f14('0xa2')])&&this['isNotNull'](_0x191bc8[_0x3f14('0xa2')]['queuestatus'])){switch(_0x191bc8[_0x3f14('0xa3')]){case _0x3f14('0xa4'):_0x42792b[_0x3f14('0x36')]=![];_0x42792b[_0x3f14('0x90')]=null;break;case _0x3f14('0xa5'):_0x42792b[_0x3f14('0xa6')]=_0x3f14('0xa7');_0x42792b[_0x3f14('0x36')]=!![];_0x42792b[_0x3f14('0x90')]=moment()['format'](_0x3f14('0x76'));_0x42792b['queuecallerleaveAt']=moment()[_0x3f14('0x4e')](_0x3f14('0x76'));logger[_0x3f14('0x4a')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x191bc8[_0x3f14('0x52')],util[_0x3f14('0x41')](_0x42792b,{'showHidden':![],'depth':null}));ami[_0x3f14('0x4d')]('custom:timeout',_0x42792b);break;default:_0x42792b[_0x3f14('0x36')]=!![];_0x42792b[_0x3f14('0x90')]=moment()[_0x3f14('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x42792b[_0x3f14('0x85')]=moment()[_0x3f14('0x4e')](_0x3f14('0x76'));}_0x42792b[_0x3f14('0x20')]=![];_0x42792b[_0x3f14('0x82')]=null;_0x42792b[_0x3f14('0x53')]=_0x191bc8['value'];this['channels'][_0x191bc8[_0x3f14('0x52')]]=_0x42792b;this[_0x3f14('0x48')](_0x42792b,'varset');}else if(this['isNotNull'](_0x191bc8[_0x3f14('0xa2')])&&this[_0x3f14('0x6f')](_0x191bc8[_0x3f14('0xa2')][_0x3f14('0xa8')])){if(!_0x42792b[_0x3f14('0x20')]){_0x42792b[_0x3f14('0x36')]=!![];_0x42792b[_0x3f14('0x90')]=moment()[_0x3f14('0x4e')](_0x3f14('0x76'));_0x42792b['queuecallerexitreason']=_0x3f14('0xa9');_0x42792b[_0x3f14('0x85')]=moment()['format'](_0x3f14('0x76'));this['channels'][_0x191bc8['uniqueid']]=_0x42792b;}}logger[_0x3f14('0x7a')](_0x3f14('0xaa'),_0x191bc8['uniqueid'],_0x42792b[_0x3f14('0x55')],_0x42792b[_0x3f14('0x69')],_['keys'](_0x191bc8['variable'])[0x0],_0x191bc8[_0x3f14('0xa3')]);_0x42792b[_0x3f14('0x16')]=this[_0x3f14('0x16')][_0x191bc8[_0x3f14('0x52')]];}}}}catch(_0x50c362){logger[_0x3f14('0x3f')](_0x3f14('0xab'),_0x191bc8[_0x3f14('0x52')],util['inspect'](_0x50c362,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3f14('0x38')][_0x3f14('0xa0')]=function(_0x26035d,_0x2cec67,_0xaeaac7){var _0x4e3584=[_0x3f14('0xac'),_0x3f14('0xad'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x3f14('0xae'),_0x3f14('0xaf'),'rtpaudioqosrtt',_0x3f14('0xb0'),_0x3f14('0xb1'),_0x3f14('0xb2'),_0x3f14('0xb3'),'bridgepvtcallid',_0x3f14('0xb4'),_0x3f14('0xb5'),_0x3f14('0xb6'),_0x3f14('0xb7'),_0x3f14('0x8f'),_0x3f14('0xb8'),_0x3f14('0xb9')];if(!_[_0x3f14('0xba')](_0x2cec67)&&!_['includes'](_0x4e3584,_0x2cec67)){if(_[_0x3f14('0x5b')](this[_0x3f14('0x16')][_0x26035d])){this[_0x3f14('0x16')][_0x26035d]={};}this[_0x3f14('0x16')][_0x26035d][_0x2cec67]=_0xaeaac7;}};VoiceQueueReport[_0x3f14('0x38')][_0x3f14('0xbb')]=function(_0x337118,_0x22b7ad,_0x52237b){try{var _0x44f56e={};if(this[_0x3f14('0x10')][_0x337118]){for(var _0x1bcafa=0x0;_0x1bcafa0x0?!![]:![];if(!_0x37f978){return this[_0x7e8f('0x16')](this[_0x7e8f('0x13')]['completeEvent']);}};VoiceQueueReport[_0x7e8f('0x34')]['syncQueueMember']=function(_0x24eec7){var _0x4c92ab=this['summary']['id'];if(this[_0x7e8f('0x13')][_0x7e8f('0x5d')][_0x4c92ab]&&this[_0x7e8f('0x13')]['queuestatus'][_0x4c92ab][_0x24eec7[_0x7e8f('0x5c')]]){this['summary'][_0x7e8f('0x5d')][_0x4c92ab][_0x24eec7[_0x7e8f('0x5c')]]['agents']['push'](_0x24eec7);}};VoiceQueueReport[_0x7e8f('0x34')][_0x7e8f('0x14')]=function(_0x498238){var _0x34f11d=this;try{if(this[_0x7e8f('0x55')](_0x498238)&&this['isNotNull'](_0x498238[_0x7e8f('0x49')])){logger[_0x7e8f('0x44')](_0x7e8f('0x69'),util[_0x7e8f('0x3b')](_0x498238,{'showHidden':![],'depth':null}));var _0xc6ea04=this['voiceQueues'][_0x498238[_0x7e8f('0x49')]];if(_0xc6ea04){logger[_0x7e8f('0x44')](_0x7e8f('0x6a'),_0xc6ea04['name']);this[_0x7e8f('0x13')][_0x7e8f('0x57')][_0xc6ea04[_0x7e8f('0x53')]]={'summaryEvent':_0x498238};this[_0x7e8f('0x13')]['statusRequests']+=0x1;return ami[_0x7e8f('0x5a')]({'action':'queuestatus','queue':_0xc6ea04['name']})[_0x7e8f('0x5b')](function(_0x574d2a){if(!_0x34f11d[_0x7e8f('0x13')][_0x7e8f('0x5d')][_0x498238[_0x7e8f('0x5c')]]){_0x34f11d[_0x7e8f('0x13')]['queuestatus'][_0x498238[_0x7e8f('0x5c')]]={};}_0x34f11d['summary'][_0x7e8f('0x5d')][_0x498238[_0x7e8f('0x5c')]][_0x574d2a[_0x7e8f('0x5c')]]={'queue':_0xc6ea04[_0x7e8f('0x53')],'agents':[]};})[_0x7e8f('0x58')](function(_0x5e1b00){throw _0x5e1b00;});}}}catch(_0xbc26f2){logger[_0x7e8f('0x3a')](_0x7e8f('0x5e'),util[_0x7e8f('0x3b')](_0xbc26f2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e8f('0x34')][_0x7e8f('0x16')]=function(_0x567506){if(this[_0x7e8f('0x13')]['statusRequests']>0x0){this[_0x7e8f('0x13')][_0x7e8f('0x6b')]=_0x567506;return;}logger[_0x7e8f('0x44')](_0x7e8f('0x6c'),util['inspect'](_0x567506,{'showHidden':![],'depth':null}));this[_0x7e8f('0x13')]=initializeSummary();ami[_0x7e8f('0x42')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x7e8f('0x34')][_0x7e8f('0x1b')]=function(_0x3e0e48){try{if(this[_0x7e8f('0x55')](_0x3e0e48)){logger[_0x7e8f('0x44')](_0x7e8f('0x6d'),_0x3e0e48[_0x7e8f('0x47')],util[_0x7e8f('0x3b')](_0x3e0e48,{'showHidden':![],'depth':null}));if(_[_0x7e8f('0x6e')](this[_0x7e8f('0xe')][_0x3e0e48[_0x7e8f('0x47')]])){this[_0x7e8f('0xe')][_0x3e0e48['uniqueid']]=[];}if(_[_0x7e8f('0x6e')](this[_0x7e8f('0x10')][_0x3e0e48['uniqueid']])){this[_0x7e8f('0x10')][_0x3e0e48['uniqueid']]={};}var _0x5dae1e=new QueueReport();_0x5dae1e[_0x7e8f('0x49')]=_0x3e0e48[_0x7e8f('0x49')];_0x5dae1e[_0x7e8f('0x65')]=this[_0x7e8f('0x11')][_0x5dae1e[_0x7e8f('0x49')]]&&this[_0x7e8f('0x11')][_0x5dae1e[_0x7e8f('0x49')]][_0x7e8f('0x65')]?this[_0x7e8f('0x11')][_0x5dae1e[_0x7e8f('0x49')]][_0x7e8f('0x65')]||'inbound':_0x7e8f('0x51');_0x5dae1e['queuecallerjoinAt']=moment()[_0x7e8f('0x4d')](_0x7e8f('0x6f'));_0x5dae1e['position']=_0x3e0e48[_0x7e8f('0x70')];_0x5dae1e[_0x7e8f('0x71')]=_0x3e0e48['count'];_0x5dae1e[_0x7e8f('0x47')]=_0x3e0e48[_0x7e8f('0x47')];_0x5dae1e[_0x7e8f('0x72')]=this[_0x7e8f('0x10')][_0x3e0e48[_0x7e8f('0x47')]]['routealias'];logger[_0x7e8f('0x73')](_0x7e8f('0x74'),_0x5dae1e['queue'],_0x5dae1e[_0x7e8f('0x65')]);Object['assign'](_0x5dae1e,_['pick'](_0x3e0e48,_[_0x7e8f('0x75')](_0x5dae1e)));this[_0x7e8f('0xe')][_0x3e0e48['uniqueid']]['push'](_0x5dae1e);this[_0x7e8f('0x10')][_0x3e0e48[_0x7e8f('0x47')]]=_0x5dae1e;this['emitVoiceQueueChannelSave'](_0x5dae1e,_0x7e8f('0x1a'));}}catch(_0x1023de){logger['error'](_0x7e8f('0x6d'),_0x3e0e48['uniqueid'],util[_0x7e8f('0x3b')](_0x1023de,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e8f('0x34')]['syncQueueCallerAbandon']=function(_0x38451f){try{if(this['isNotNull'](_0x38451f)){logger[_0x7e8f('0x44')](_0x7e8f('0x76'),_0x38451f[_0x7e8f('0x47')],util['inspect'](_0x38451f,{'showHidden':![],'depth':null}));if(this[_0x7e8f('0xe')][_0x38451f[_0x7e8f('0x47')]]){var _0x4f1b21=_[_0x7e8f('0x77')](this['queueReports'][_0x38451f[_0x7e8f('0x47')]]);_0x4f1b21['queuecallercomplete']=![];_0x4f1b21[_0x7e8f('0x78')]=null;_0x4f1b21[_0x7e8f('0x79')]=_0x38451f[_0x7e8f('0x79')];_0x4f1b21['originalposition']=_0x38451f[_0x7e8f('0x7a')];_0x4f1b21[_0x7e8f('0x1c')]=!![];_0x4f1b21['queuecallerabandonAt']=moment()[_0x7e8f('0x4d')](_0x7e8f('0x6f'));_0x4f1b21[_0x7e8f('0x4b')]=_0x7e8f('0x7b');_0x4f1b21[_0x7e8f('0x7c')]=null;logger['info'](_0x7e8f('0x7d'),_0x4f1b21[_0x7e8f('0x49')],_0x4f1b21['type']);this[_0x7e8f('0x10')][_0x38451f[_0x7e8f('0x47')]]=_0x4f1b21;this[_0x7e8f('0x40')](_0x4f1b21,'queuecallerabandon');}}}catch(_0x2f8760){logger[_0x7e8f('0x3a')]('[%s][voiceQueueReport][queuecallerabandon]',_0x38451f['uniqueid'],util[_0x7e8f('0x3b')](_0x2f8760,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e8f('0x34')][_0x7e8f('0x1e')]=function(_0x3e682e){try{if(this[_0x7e8f('0x55')](_0x3e682e)){logger[_0x7e8f('0x44')](_0x7e8f('0x7e'),_0x3e682e['uniqueid'],util[_0x7e8f('0x3b')](_0x3e682e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3e682e[_0x7e8f('0x47')]]){var _0x3c75a2=_['last'](this[_0x7e8f('0xe')][_0x3e682e[_0x7e8f('0x47')]]);_0x3c75a2[_0x7e8f('0x7f')]=moment()['format'](_0x7e8f('0x6f'));_0x3c75a2['connectedlinenum']=_0x3e682e['connectedlinenum'];_0x3c75a2[_0x7e8f('0x80')]=_0x3e682e[_0x7e8f('0x80')];logger[_0x7e8f('0x73')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x3c75a2[_0x7e8f('0x49')],_0x3c75a2[_0x7e8f('0x65')],_0x3e682e[_0x7e8f('0x81')],_0x3e682e['connectedlinename']);this[_0x7e8f('0x10')][_0x3e682e['uniqueid']]=_0x3c75a2;this[_0x7e8f('0x43')](_0x3c75a2,_0x7e8f('0x82'));}}}catch(_0x38b3fa){logger[_0x7e8f('0x3a')](_0x7e8f('0x7e'),_0x3e682e[_0x7e8f('0x47')],util[_0x7e8f('0x3b')](_0x38b3fa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e8f('0x34')][_0x7e8f('0x21')]=function(_0x23a977){try{if(this['isNotNull'](_0x23a977)){logger['debug'](_0x7e8f('0x83'),_0x23a977['uniqueid'],util[_0x7e8f('0x3b')](_0x23a977,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x23a977[_0x7e8f('0x47')]]){var _0x207d15=_[_0x7e8f('0x77')](this[_0x7e8f('0xe')][_0x23a977[_0x7e8f('0x47')]]);_0x207d15[_0x7e8f('0x84')]=!![];_0x207d15[_0x7e8f('0x4b')]='COMPLETEDBYAGENT';logger[_0x7e8f('0x73')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x207d15[_0x7e8f('0x49')],_0x207d15[_0x7e8f('0x65')]);}}}catch(_0x216e89){logger[_0x7e8f('0x3a')]('[%s][voiceQueueReport][agentconnect]',_0x23a977[_0x7e8f('0x47')],util[_0x7e8f('0x3b')](_0x216e89,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e8f('0x34')][_0x7e8f('0x1f')]=function(_0x2c6976){try{if(this[_0x7e8f('0x55')](_0x2c6976)){logger[_0x7e8f('0x44')](_0x7e8f('0x85'),_0x2c6976[_0x7e8f('0x47')],util['inspect'](_0x2c6976,{'showHidden':![],'depth':null}));if(this[_0x7e8f('0xe')][_0x2c6976['uniqueid']]){var _0x54722a=_['last'](this[_0x7e8f('0xe')][_0x2c6976[_0x7e8f('0x47')]]);_0x54722a[_0x7e8f('0x1c')]=![];_0x54722a[_0x7e8f('0x86')]=null;_0x54722a[_0x7e8f('0x87')]=!![];_0x54722a['lastAssignedTo']=_0x2c6976[_0x7e8f('0x88')];_0x54722a[_0x7e8f('0x79')]=_0x2c6976['holdtime'];_0x54722a['queuecallercomplete']=!![];_0x54722a[_0x7e8f('0x33')]=![];_0x54722a[_0x7e8f('0x89')]=null;if(!_0x54722a[_0x7e8f('0x8a')]){if(_0x2c6976[_0x7e8f('0x8b')]=='transfer'){_0x54722a['queuecallerexitreason']=_0x7e8f('0x8c');logger[_0x7e8f('0x73')](_0x7e8f('0x8d'),_0x54722a[_0x7e8f('0x49')],_0x54722a[_0x7e8f('0x65')]);}else{if(_[_0x7e8f('0x8e')](_0x2c6976[_0x7e8f('0x8f')][_0x7e8f('0x90')](),'local/')){if(this[_0x7e8f('0xe')][_0x2c6976[_0x7e8f('0x91')]]){var _0x1272b4=_[_0x7e8f('0x77')](this[_0x7e8f('0xe')][_0x2c6976[_0x7e8f('0x91')]]);_0x1272b4[_0x7e8f('0x84')]=![];_0x1272b4['queuecallerexit']=!![];_0x1272b4[_0x7e8f('0x89')]=moment(_0x54722a[_0x7e8f('0x92')])[_0x7e8f('0x93')](_0x2c6976[_0x7e8f('0x79')],_0x7e8f('0x94'))[_0x7e8f('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x1272b4[_0x7e8f('0x4b')]='FORWARDTRANSFER';_0x1272b4[_0x7e8f('0x8a')]=!![];_0x1272b4['transfertype']='FORWARD';_0x1272b4[_0x7e8f('0x95')]=_0x2c6976[_0x7e8f('0x96')];_0x1272b4[_0x7e8f('0x97')]=_0x2c6976[_0x7e8f('0x47')];logger['info'](_0x7e8f('0x98'),_0x1272b4['queue'],_0x1272b4[_0x7e8f('0x65')]);var _0x321783=this[_0x7e8f('0xe')][_0x2c6976['linkedid']];this[_0x7e8f('0xe')][_0x2c6976[_0x7e8f('0x91')]]=this[_0x7e8f('0xe')][_0x2c6976[_0x7e8f('0x47')]];this[_0x7e8f('0xe')][_0x2c6976[_0x7e8f('0x47')]]=_0x321783;}}else{_0x54722a[_0x7e8f('0x4b')]=_0x7e8f('0x99')+_0x2c6976[_0x7e8f('0x8b')][_0x7e8f('0x9a')]();logger[_0x7e8f('0x73')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x54722a[_0x7e8f('0x49')],_0x54722a[_0x7e8f('0x65')],_0x54722a['queuecallerexitreason']);}}}this['channels'][_0x2c6976[_0x7e8f('0x47')]]=_0x54722a;}}}catch(_0x2e6b10){logger[_0x7e8f('0x3a')](_0x7e8f('0x85'),_0x2c6976[_0x7e8f('0x47')],util[_0x7e8f('0x3b')](_0x2e6b10,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e8f('0x34')][_0x7e8f('0x9b')]=function(_0x1d41b0){try{if(this[_0x7e8f('0x55')](_0x1d41b0)){logger['debug'](_0x7e8f('0x9c'),_0x1d41b0[_0x7e8f('0x47')],util['inspect'](_0x1d41b0,{'showHidden':![],'depth':null}));this['addVariable'](_0x1d41b0['uniqueid'],_[_0x7e8f('0x75')](_0x1d41b0[_0x7e8f('0x9d')])[0x0],_0x1d41b0[_0x7e8f('0x9e')]);if(this[_0x7e8f('0xe')][_0x1d41b0[_0x7e8f('0x47')]]){var _0x30ebd2=_[_0x7e8f('0x77')](this[_0x7e8f('0xe')][_0x1d41b0[_0x7e8f('0x47')]]);if(_0x30ebd2){if(this[_0x7e8f('0x55')](_0x1d41b0[_0x7e8f('0x9d')])&&this[_0x7e8f('0x55')](_0x1d41b0[_0x7e8f('0x9d')][_0x7e8f('0x5d')])){switch(_0x1d41b0[_0x7e8f('0x9e')]){case _0x7e8f('0x9f'):_0x30ebd2[_0x7e8f('0x33')]=![];_0x30ebd2['queuecallerexitAt']=null;break;case _0x7e8f('0xa0'):_0x30ebd2[_0x7e8f('0xa1')]=_0x7e8f('0xa2');_0x30ebd2[_0x7e8f('0x33')]=!![];_0x30ebd2[_0x7e8f('0x89')]=moment()[_0x7e8f('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x30ebd2[_0x7e8f('0x7f')]=moment()['format'](_0x7e8f('0x6f'));logger[_0x7e8f('0x44')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x1d41b0[_0x7e8f('0x47')],util[_0x7e8f('0x3b')](_0x30ebd2,{'showHidden':![],'depth':null}));ami[_0x7e8f('0x42')](_0x7e8f('0xa3'),_0x30ebd2);break;default:_0x30ebd2['queuecallerexit']=!![];_0x30ebd2[_0x7e8f('0x89')]=moment()[_0x7e8f('0x4d')](_0x7e8f('0x6f'));_0x30ebd2[_0x7e8f('0x7f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x30ebd2[_0x7e8f('0x1c')]=![];_0x30ebd2[_0x7e8f('0x86')]=null;_0x30ebd2[_0x7e8f('0x4b')]=_0x1d41b0[_0x7e8f('0x9e')];this[_0x7e8f('0x10')][_0x1d41b0['uniqueid']]=_0x30ebd2;this['emitVoiceQueueChannelRemove'](_0x30ebd2,'varset');}else if(this[_0x7e8f('0x55')](_0x1d41b0['variable'])&&this[_0x7e8f('0x55')](_0x1d41b0[_0x7e8f('0x9d')][_0x7e8f('0xa4')])){if(!_0x30ebd2['queuecallerabandon']){_0x30ebd2[_0x7e8f('0x33')]=!![];_0x30ebd2[_0x7e8f('0x89')]=moment()[_0x7e8f('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x30ebd2['queuecallerexitreason']=_0x7e8f('0xa5');_0x30ebd2[_0x7e8f('0x7f')]=moment()[_0x7e8f('0x4d')](_0x7e8f('0x6f'));this['channels'][_0x1d41b0[_0x7e8f('0x47')]]=_0x30ebd2;}}logger[_0x7e8f('0x73')](_0x7e8f('0xa6'),_0x1d41b0['uniqueid'],_0x30ebd2[_0x7e8f('0x49')],_0x30ebd2[_0x7e8f('0x65')],_[_0x7e8f('0x75')](_0x1d41b0[_0x7e8f('0x9d')])[0x0],_0x1d41b0['value']);_0x30ebd2[_0x7e8f('0x3d')]=this['variables'][_0x1d41b0[_0x7e8f('0x47')]];}}}}catch(_0x39b2d7){logger[_0x7e8f('0x3a')](_0x7e8f('0x9c'),_0x1d41b0['uniqueid'],util['inspect'](_0x39b2d7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7e8f('0x34')][_0x7e8f('0xa7')]=function(_0x1bdb71,_0x1efeb8,_0x2ee8c0){var _0x14d74d=[_0x7e8f('0xa8'),_0x7e8f('0xa9'),_0x7e8f('0xaa'),_0x7e8f('0xab'),_0x7e8f('0xac'),_0x7e8f('0xad'),_0x7e8f('0xae'),_0x7e8f('0xaf'),_0x7e8f('0xb0'),'sipuri',_0x7e8f('0xb1'),_0x7e8f('0xb2'),_0x7e8f('0xb3'),_0x7e8f('0xb4'),_0x7e8f('0xb5'),_0x7e8f('0xb6'),_0x7e8f('0x88'),_0x7e8f('0xb7'),_0x7e8f('0xb8')];if(!_[_0x7e8f('0x38')](_0x1efeb8)&&!_[_0x7e8f('0xb9')](_0x14d74d,_0x1efeb8)){if(_[_0x7e8f('0x6e')](this[_0x7e8f('0x3d')][_0x1bdb71])){this[_0x7e8f('0x3d')][_0x1bdb71]={};}this['variables'][_0x1bdb71][_0x1efeb8]=_0x2ee8c0;}};VoiceQueueReport[_0x7e8f('0x34')][_0x7e8f('0xba')]=function(_0x2711ef,_0x1495d3,_0x765596){try{var _0x2d0540={};if(this[_0x7e8f('0xe')][_0x2711ef]){for(var _0x36117d=0x0;_0x36117d=0x0?moment(_0x7a74e8[_0xddd1('0x18')])[_0xddd1('0xd')](_0x7a74e8[_0xddd1('0x17')],'seconds'):null,'data1':'outbound','data2':_0x7a74e8[_0xddd1('0x14')],'data3':_0x7a74e8[_0xddd1('0x11')],'data4':_0x7a74e8[_0xddd1('0x19')]||null,'role':_0xddd1('0x13'),'internal':_0x7a74e8['accountcode']?_[_0xddd1('0x1a')](_0x7a74e8[_0xddd1('0x14')]):undefined,'uniqueid':_0x7a74e8[_0xddd1('0x15')]},'log':_0xddd1('0x6')});}; \ No newline at end of file +var _0xafd7=['SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten','queue','agent','accountcode','uniqueid','CreateMemberReport','voice','starttime','endtime','dialstring','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','lastAssignedTo','isNil','interface'];(function(_0x422c76,_0x23e345){var _0x3c6ec4=function(_0x70f849){while(--_0x70f849){_0x422c76['push'](_0x422c76['shift']());}};_0x3c6ec4(++_0x23e345);}(_0xafd7,0x74));var _0x7afd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xafd7[_0x122ef9];return _0x42fba0;};'use strict';var moment=require('moment');var _=require('lodash');var util=require(_0x7afd('0x0'));var client=require(_0x7afd('0x1'));exports[_0x7afd('0x2')]=function(_0xa2d538){var _0x215139=_0xa2d538[_0x7afd('0x3')]||_0xa2d538[_0x7afd('0x4')];return client[_0x7afd('0x5')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0xa2d538[_0x7afd('0x6')],'interface':_[_0x7afd('0x7')](_0xa2d538[_0x7afd('0x8')])?util['format'](_0x7afd('0x9'),_0xa2d538[_0x7afd('0x6')]):_0xa2d538['interface'],'type':_0x7afd('0xa'),'enterAt':_0xa2d538[_0x7afd('0xb')],'exitAt':_0x215139,'duration':moment(_0x215139)[_0x7afd('0xc')](_0xa2d538['queuecallerleaveAt'],_0x7afd('0xd')),'data1':_0x7afd('0xe'),'data2':_0xa2d538['calleridnum'],'data3':_0xa2d538[_0x7afd('0xf')],'data4':null,'data5':_0xa2d538[_0x7afd('0x10')],'role':_0x7afd('0x11'),'internal':_0xa2d538['accountcode']?_['toNumber'](_0xa2d538[_0x7afd('0x12')]):undefined,'uniqueid':_0xa2d538[_0x7afd('0x13')]},'log':_0x7afd('0x14')});};exports['voiceDialReport']=function(_0x1c8373){return client[_0x7afd('0x5')](_0x7afd('0x14'),{'body':{'channel':_0x7afd('0x15'),'membername':_0x1c8373['membername'],'interface':_0x1c8373[_0x7afd('0x8')],'type':'TALKING','enterAt':_0x1c8373[_0x7afd('0x16')],'exitAt':_0x1c8373[_0x7afd('0x17')],'duration':moment(_0x1c8373[_0x7afd('0x17')])[_0x7afd('0xc')](_0x1c8373[_0x7afd('0x16')],_0x7afd('0xd'))>=0x0?moment(_0x1c8373[_0x7afd('0x17')])[_0x7afd('0xc')](_0x1c8373[_0x7afd('0x16')],'seconds'):null,'data1':'outbound','data2':_0x1c8373['accountcode'],'data3':_0x1c8373[_0x7afd('0xf')],'data4':_0x1c8373[_0x7afd('0x18')]||null,'role':_0x7afd('0x11'),'internal':_0x1c8373[_0x7afd('0x12')]?_['toNumber'](_0x1c8373['accountcode']):undefined,'uniqueid':_0x1c8373[_0x7afd('0x13')]},'log':_0x7afd('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index d2c3d9e..5678f72 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 _0xa195=['getSettings','ShowSetting','stopRecordingOnTransfer','GetSettings','../client'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0xa195,0x1b2));var _0x5a19=function(_0x564d9d,_0x5bfd1f){_0x564d9d=_0x564d9d-0x0;var _0x1f76c2=_0xa195[_0x564d9d];return _0x1f76c2;};'use strict';var client=require(_0x5a19('0x0'));exports[_0x5a19('0x1')]=function(){return client['Request'](_0x5a19('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5a19('0x3'),'previewRecallmeReminderInterval']},'log':_0x5a19('0x4')});}; \ No newline at end of file +var _0x66d8=['GetSettings','../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x26f750,_0x280ab7){var _0x3e194a=function(_0x4a6f05){while(--_0x4a6f05){_0x26f750['push'](_0x26f750['shift']());}};_0x3e194a(++_0x280ab7);}(_0x66d8,0x1c1));var _0x866d=function(_0x3e5d32,_0x19ce13){_0x3e5d32=_0x3e5d32-0x0;var _0x3e7822=_0x66d8[_0x3e5d32];return _0x3e7822;};'use strict';var client=require(_0x866d('0x0'));exports[_0x866d('0x1')]=function(){return client[_0x866d('0x2')](_0x866d('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x866d('0x4'),_0x866d('0x5')]},'log':_0x866d('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 512edb3..b07b5b8 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 _0x883e=['Request','GetTemplate','name','html','../client','getTemplates'];(function(_0x597fbd,_0x148bc8){var _0xf5b6ed=function(_0x1738e2){while(--_0x1738e2){_0x597fbd['push'](_0x597fbd['shift']());}};_0xf5b6ed(++_0x148bc8);}(_0x883e,0xd0));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xe883('0x0'));exports[_0xe883('0x1')]=function(_0xe29d12){return function(_0x53bba4){return client[_0xe883('0x2')](_0xe883('0x3'),{'options':{'raw':!![],'attributes':['id',_0xe883('0x4'),_0xe883('0x5')]},'log':_0xe883('0x3')});};}; \ No newline at end of file +var _0x5335=['Request','GetTemplate','name','html','../client','getTemplates'];(function(_0x116786,_0x105528){var _0x5e5d3a=function(_0x30cafd){while(--_0x30cafd){_0x116786['push'](_0x116786['shift']());}};_0x5e5d3a(++_0x105528);}(_0x5335,0xa0));var _0x5533=function(_0x53b537,_0x55bf31){_0x53b537=_0x53b537-0x0;var _0x5af388=_0x5335[_0x53b537];return _0x5af388;};'use strict';var client=require(_0x5533('0x0'));exports[_0x5533('0x1')]=function(_0xc4f9fb){return function(_0x329c44){return client[_0x5533('0x2')](_0x5533('0x3'),{'options':{'raw':!![],'attributes':['id',_0x5533('0x4'),_0x5533('0x5')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 28e4783..c483a5b 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 _0xdb34=['../client','getTriggers','channel','status','Condition','AllConditions','field','operator','AnyConditions','Actions','action','data1','data2','data3','data4','data5','data7','GetTrigger'];(function(_0x3ac0ca,_0x5697e7){var _0xa17da2=function(_0x5b1a11){while(--_0x5b1a11){_0x3ac0ca['push'](_0x3ac0ca['shift']());}};_0xa17da2(++_0x5697e7);}(_0xdb34,0x120));var _0x4db3=function(_0x7dbf2d,_0x48b480){_0x7dbf2d=_0x7dbf2d-0x0;var _0x42998d=_0xdb34[_0x7dbf2d];return _0x42998d;};'use strict';var client=require(_0x4db3('0x0'));exports[_0x4db3('0x1')]=function(_0x2543cb){return function(_0x4ae1a0){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id','name',_0x4db3('0x2'),_0x4db3('0x3')],'include':[{'model':_0x4db3('0x4'),'as':_0x4db3('0x5'),'attributes':['id',_0x4db3('0x6'),_0x4db3('0x7'),'value']},{'model':'Condition','as':_0x4db3('0x8'),'attributes':['id',_0x4db3('0x6'),'operator','value']},{'model':'Action','as':_0x4db3('0x9'),'attributes':['id',_0x4db3('0xa'),_0x4db3('0xb'),_0x4db3('0xc'),_0x4db3('0xd'),_0x4db3('0xe'),_0x4db3('0xf'),'data6',_0x4db3('0x10')]}]},'log':_0x4db3('0x11')});};}; \ No newline at end of file +var _0xbde8=['value','AnyConditions','Action','action','data1','data2','data3','data4','data5','data6','data7','GetTrigger','../client','getTriggers','Request','name','channel','status','Condition','AllConditions','field','operator'];(function(_0x1ffd43,_0x292134){var _0x2dc561=function(_0x36435d){while(--_0x36435d){_0x1ffd43['push'](_0x1ffd43['shift']());}};_0x2dc561(++_0x292134);}(_0xbde8,0xe8));var _0x8bde=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0xbde8[_0x27dba4];return _0x35ec9d;};'use strict';var client=require(_0x8bde('0x0'));exports[_0x8bde('0x1')]=function(_0x36f3e7){return function(_0x4bddaf){return client[_0x8bde('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x8bde('0x3'),_0x8bde('0x4'),_0x8bde('0x5')],'include':[{'model':_0x8bde('0x6'),'as':_0x8bde('0x7'),'attributes':['id',_0x8bde('0x8'),_0x8bde('0x9'),_0x8bde('0xa')]},{'model':_0x8bde('0x6'),'as':_0x8bde('0xb'),'attributes':['id',_0x8bde('0x8'),'operator',_0x8bde('0xa')]},{'model':_0x8bde('0xc'),'as':'Actions','attributes':['id',_0x8bde('0xd'),_0x8bde('0xe'),_0x8bde('0xf'),_0x8bde('0x10'),_0x8bde('0x11'),_0x8bde('0x12'),_0x8bde('0x13'),_0x8bde('0x14')]}]},'log':_0x8bde('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 60824db..908a5c4 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 _0x5183=['../client','getTrunks','GetTrunk','name','registry','defaultuser'];(function(_0x6182ff,_0x59d492){var _0x1cec22=function(_0x2e96f8){while(--_0x2e96f8){_0x6182ff['push'](_0x6182ff['shift']());}};_0x1cec22(++_0x59d492);}(_0x5183,0x13e));var _0x3518=function(_0x384437,_0x5a1178){_0x384437=_0x384437-0x0;var _0x1c8dea=_0x5183[_0x384437];return _0x1c8dea;};'use strict';var client=require(_0x3518('0x0'));exports[_0x3518('0x1')]=function(_0x3fc620){return function(_0x4de025){return client['Request'](_0x3518('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x3518('0x3'),_0x3518('0x4'),_0x3518('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x5cad=['../client','getTrunks','Request','GetTrunk','name','registry','defaultuser'];(function(_0x1a8af0,_0x2e4c80){var _0x40a2eb=function(_0x503755){while(--_0x503755){_0x1a8af0['push'](_0x1a8af0['shift']());}};_0x40a2eb(++_0x2e4c80);}(_0x5cad,0x8c));var _0xd5ca=function(_0x160cbc,_0x3025a6){_0x160cbc=_0x160cbc-0x0;var _0x4ac8c6=_0x5cad[_0x160cbc];return _0x4ac8c6;};'use strict';var client=require(_0xd5ca('0x0'));exports[_0xd5ca('0x1')]=function(_0x1ab40a){return function(_0x34dfc7){return client[_0xd5ca('0x2')](_0xd5ca('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xd5ca('0x4'),_0xd5ca('0x5'),_0xd5ca('0x6')]},'log':_0xd5ca('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 8c107d3..140b61f 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 _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x53435d,_0x19a791){var _0x4c1ee6=function(_0x120dde){while(--_0x120dde){_0x53435d['push'](_0x53435d['shift']());}};_0x4c1ee6(++_0x19a791);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe706,0xa3));var _0x6e70=function(_0x10d34b,_0x4fef76){_0x10d34b=_0x10d34b-0x0;var _0x92b0bf=_0xe706[_0x10d34b];return _0x92b0bf;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 7604d97..e7b9f92 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 _0xc7c2=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x512bb9,_0x254b3d){var _0x3695b3=function(_0x20729f){while(--_0x20729f){_0x512bb9['push'](_0x512bb9['shift']());}};_0x3695b3(++_0x254b3d);}(_0xc7c2,0x190));var _0x2c7c=function(_0x7dcf99,_0x36284c){_0x7dcf99=_0x7dcf99-0x0;var _0x3c18c3=_0xc7c2[_0x7dcf99];return _0x3c18c3;};'use strict';var client=require('../client');exports['create']=function(_0x72df96){return client[_0x2c7c('0x0')](_0x2c7c('0x1'),{'body':_0x72df96,'log':_0x2c7c('0x1')});};exports[_0x2c7c('0x2')]=function(_0x2d58a5,_0x3b0b4e,_0x4513b5){return client[_0x2c7c('0x0')](_0x2c7c('0x3'),{'body':_0x2d58a5,'options':{'where':{'uniqueid':_0x3b0b4e,'interface':_0x4513b5,'agentcomplete':!![]}},'log':_0x2c7c('0x3')});}; \ No newline at end of file +var _0x2556=['create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport'];(function(_0x7ed19a,_0x900bd1){var _0x31179b=function(_0x4cf93b){while(--_0x4cf93b){_0x7ed19a['push'](_0x7ed19a['shift']());}};_0x31179b(++_0x900bd1);}(_0x2556,0x118));var _0x6255=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x2556[_0x29d94e];return _0x106237;};'use strict';var client=require('../client');exports[_0x6255('0x0')]=function(_0x56b9c1){return client['Request'](_0x6255('0x1'),{'body':_0x56b9c1,'log':_0x6255('0x1')});};exports[_0x6255('0x2')]=function(_0x5a0929,_0x4a54a2,_0x4f2462){return client[_0x6255('0x3')](_0x6255('0x4'),{'body':_0x5a0929,'options':{'where':{'uniqueid':_0x4a54a2,'interface':_0x4f2462,'agentcomplete':!![]}},'log':_0x6255('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 0b3252d..fa20abe 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 _0xa6ea=['startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','util','lodash','create','Request','merge','calleridnum','context','callerid','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound'];(function(_0x20fb8b,_0xfe0c4f){var _0x3b1d17=function(_0x508517){while(--_0x508517){_0x20fb8b['push'](_0x20fb8b['shift']());}};_0x3b1d17(++_0xfe0c4f);}(_0xa6ea,0x10c));var _0xaa6e=function(_0x42bcdf,_0x4c88ec){_0x42bcdf=_0x42bcdf-0x0;var _0x4cf062=_0xa6ea[_0x42bcdf];return _0x4cf062;};'use strict';var moment=require('moment');var util=require(_0xaa6e('0x0'));var _=require(_0xaa6e('0x1'));var client=require('../client');exports[_0xaa6e('0x2')]=function(_0x2149b3){return client[_0xaa6e('0x3')]('CreateVoiceCallReport',{'body':_[_0xaa6e('0x4')](_0x2149b3,{'source':_0x2149b3[_0xaa6e('0x5')],'destinationcontext':_0x2149b3[_0xaa6e('0x6')],'callerid':_0x2149b3[_0xaa6e('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0xaa6e('0x8')});};exports[_0xaa6e('0x9')]=function(){return function(){return client[_0xaa6e('0x3')](_0xaa6e('0xa'),{'options':{'where':{'type':[_0xaa6e('0xb')],'createdAt':{'$between':[moment()[_0xaa6e('0xc')](_0xaa6e('0xd'))[_0xaa6e('0xe')](_0xaa6e('0xf')),moment()[_0xaa6e('0x10')](_0xaa6e('0xd'))[_0xaa6e('0xe')](_0xaa6e('0xf'))]}},'attributes':[_0xaa6e('0x11'),_0xaa6e('0x12'),_0xaa6e('0x13'),'billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x1d77=['CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','Request','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','GetVoiceCallReports','moment','util','lodash','create'];(function(_0x335191,_0x42f088){var _0x3bf664=function(_0x5e67f8){while(--_0x5e67f8){_0x335191['push'](_0x335191['shift']());}};_0x3bf664(++_0x42f088);}(_0x1d77,0x65));var _0x71d7=function(_0x810e4d,_0x909ef4){_0x810e4d=_0x810e4d-0x0;var _0x13f01c=_0x1d77[_0x810e4d];return _0x13f01c;};'use strict';var moment=require(_0x71d7('0x0'));var util=require(_0x71d7('0x1'));var _=require(_0x71d7('0x2'));var client=require('../client');exports[_0x71d7('0x3')]=function(_0x5d3d56){return client['Request'](_0x71d7('0x4'),{'body':_[_0x71d7('0x5')](_0x5d3d56,{'source':_0x5d3d56[_0x71d7('0x6')],'destinationcontext':_0x5d3d56[_0x71d7('0x7')],'callerid':_0x5d3d56[_0x71d7('0x8')],'amaflags':_0x71d7('0x9')}),'log':_0x71d7('0x4')});};exports[_0x71d7('0xa')]=function(){return function(){return client[_0x71d7('0xb')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x71d7('0xc')],'createdAt':{'$between':[moment()[_0x71d7('0xd')](_0x71d7('0xe'))['format'](_0x71d7('0xf')),moment()[_0x71d7('0x10')](_0x71d7('0xe'))['format'](_0x71d7('0xf'))]}},'attributes':[_0x71d7('0x11'),_0x71d7('0x12'),_0x71d7('0x13'),'billableseconds']},'log':_0x71d7('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 172d7ef..7317533 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 _0xb068=['../client','create','Request','CreateVoiceDialReport'];(function(_0x594e94,_0x439af6){var _0x295e87=function(_0x54b008){while(--_0x54b008){_0x594e94['push'](_0x594e94['shift']());}};_0x295e87(++_0x439af6);}(_0xb068,0x1a4));var _0x8b06=function(_0x1e70fa,_0x2311f9){_0x1e70fa=_0x1e70fa-0x0;var _0x286083=_0xb068[_0x1e70fa];return _0x286083;};'use strict';var client=require(_0x8b06('0x0'));exports[_0x8b06('0x1')]=function(_0x1bd68c){return client[_0x8b06('0x2')]('CreateVoiceDialReport',{'body':_0x1bd68c,'log':_0x8b06('0x3')});}; \ No newline at end of file +var _0x46ab=['CreateVoiceDialReport','../client','create','Request'];(function(_0x3cd934,_0xb38c98){var _0x2226e8=function(_0x3e88d6){while(--_0x3e88d6){_0x3cd934['push'](_0x3cd934['shift']());}};_0x2226e8(++_0xb38c98);}(_0x46ab,0x17d));var _0xb46a=function(_0x5c5cee,_0x87368c){_0x5c5cee=_0x5c5cee-0x0;var _0x1102ae=_0x46ab[_0x5c5cee];return _0x1102ae;};'use strict';var client=require(_0xb46a('0x0'));exports[_0xb46a('0x1')]=function(_0x43f5dc){return client[_0xb46a('0x2')](_0xb46a('0x3'),{'body':_0x43f5dc,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index e7d0279..7c122b1 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 _0xf6fb=['getVoiceExtensions','Request','GetVoiceExtension','recordingFormat'];(function(_0x3cb3ca,_0x44d697){var _0x214366=function(_0x6b38e1){while(--_0x6b38e1){_0x3cb3ca['push'](_0x3cb3ca['shift']());}};_0x214366(++_0x44d697);}(_0xf6fb,0x111));var _0xbf6f=function(_0x3bffc7,_0x3cd860){_0x3bffc7=_0x3bffc7-0x0;var _0x297421=_0xf6fb[_0x3bffc7];return _0x297421;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0xbf6f('0x0')](_0xbf6f('0x1'),{'options':{'raw':!![],'attributes':['id','exten',_0xbf6f('0x2')],'where':{'VoiceExtensionId':null}},'log':_0xbf6f('0x3')});};}; \ No newline at end of file +var _0x1b73=['exten','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x4d7379,_0x4b4e63){var _0x46d7cf=function(_0x53f5f0){while(--_0x53f5f0){_0x4d7379['push'](_0x4d7379['shift']());}};_0x46d7cf(++_0x4b4e63);}(_0x1b73,0x1d5));var _0x31b7=function(_0x390466,_0x5e7d23){_0x390466=_0x390466-0x0;var _0x3464f4=_0x1b73[_0x390466];return _0x3464f4;};'use strict';var client=require('../client');exports[_0x31b7('0x0')]=function(){return function(){return client[_0x31b7('0x1')](_0x31b7('0x2'),{'options':{'raw':!![],'attributes':['id',_0x31b7('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x31b7('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 52e4886..949d4c0 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 _0xb14a=['dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acwTimeout','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization'];(function(_0x4d45f1,_0xe45462){var _0x467097=function(_0x3bf0c6){while(--_0x3bf0c6){_0x4d45f1['push'](_0x4d45f1['shift']());}};_0x467097(++_0xe45462);}(_0xb14a,0xfc));var _0xab14=function(_0x18beb6,_0x7d0629){_0x18beb6=_0x18beb6-0x0;var _0x5c62fb=_0xb14a[_0x18beb6];return _0x5c62fb;};'use strict';var client=require(_0xab14('0x0'));exports[_0xab14('0x1')]=function(){return function(){return client[_0xab14('0x2')](_0xab14('0x3'),{'options':{'raw':![],'attributes':['id','name','acw',_0xab14('0x4'),'autopause',_0xab14('0x5'),_0xab14('0x6'),'dialActive',_0xab14('0x7'),_0xab14('0x8'),_0xab14('0x9'),_0xab14('0xa'),_0xab14('0xb'),_0xab14('0xc'),_0xab14('0xd'),_0xab14('0xe'),_0xab14('0xf'),_0xab14('0x10'),'dialQueueOptions',_0xab14('0x11'),_0xab14('0x12'),_0xab14('0x13'),_0xab14('0x14'),_0xab14('0x15'),_0xab14('0x16'),_0xab14('0x17'),_0xab14('0x18'),_0xab14('0x19'),_0xab14('0x1a'),_0xab14('0x1b'),_0xab14('0x1c'),'dialCheckDuplicateType',_0xab14('0x1d'),_0xab14('0x1e'),_0xab14('0x1f'),_0xab14('0x20'),_0xab14('0x21'),_0xab14('0x22'),_0xab14('0x23'),'dialAMDMaximumNumberOfWords',_0xab14('0x24'),_0xab14('0x25'),_0xab14('0x26'),_0xab14('0x27'),_0xab14('0x28'),_0xab14('0x29'),_0xab14('0x2a'),_0xab14('0x2b'),'dialQueueProject2',_0xab14('0x5'),_0xab14('0x2c'),_0xab14('0x2d'),'dialCutDigit',_0xab14('0x2e'),'dialNoSuchNumberRetryFrequency',_0xab14('0x2f'),_0xab14('0x30'),'dialAbandonedMaxRetry',_0xab14('0x31'),'dialMachineMaxRetry',_0xab14('0x32'),_0xab14('0x33'),_0xab14('0x34'),_0xab14('0x35'),_0xab14('0x36'),_0xab14('0x37'),_0xab14('0x38'),'dialPreviewRecallmeReminder'],'include':[{'model':_0xab14('0x39'),'as':_0xab14('0x39'),'attributes':['id',_0xab14('0x3a'),_0xab14('0x3b'),_0xab14('0x3c')]},{'model':_0xab14('0x3d'),'as':_0xab14('0x3e'),'attributes':['id',_0xab14('0x3a')]},{'model':_0xab14('0x39'),'as':_0xab14('0x3f'),'attributes':['id',_0xab14('0x3a'),_0xab14('0x3b'),'active']},{'model':_0xab14('0x40'),'as':_0xab14('0x40'),'attributes':['id',_0xab14('0x3a')],'include':[{'model':_0xab14('0x40'),'as':'Intervals','attributes':['id','name',_0xab14('0x41')]}]}]},'log':_0xab14('0x1')});};}; \ No newline at end of file +var _0x8498=['dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','active','Pause','TrunkBackup','callerid','Interval','Intervals','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','type','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry'];(function(_0x4fb797,_0x200ee6){var _0x34e096=function(_0x2c0f40){while(--_0x2c0f40){_0x4fb797['push'](_0x4fb797['shift']());}};_0x34e096(++_0x200ee6);}(_0x8498,0x1a7));var _0x8849=function(_0x192645,_0xf0eae4){_0x192645=_0x192645-0x0;var _0x50a630=_0x8498[_0x192645];return _0x50a630;};'use strict';var client=require('../client');exports[_0x8849('0x0')]=function(){return function(){return client[_0x8849('0x1')](_0x8849('0x2'),{'options':{'raw':![],'attributes':['id',_0x8849('0x3'),_0x8849('0x4'),'acwTimeout',_0x8849('0x5'),'monitor_format',_0x8849('0x6'),'dialActive','dialMethod',_0x8849('0x7'),_0x8849('0x8'),_0x8849('0x9'),_0x8849('0xa'),_0x8849('0xb'),_0x8849('0xc'),'dialOriginateCallerIdName',_0x8849('0xd'),'dialOriginateTimeout',_0x8849('0xe'),_0x8849('0xf'),'dialQueueProject',_0x8849('0x10'),_0x8849('0x11'),_0x8849('0x12'),_0x8849('0x13'),_0x8849('0x14'),_0x8849('0x15'),'dialGlobalMaxRetry','dialTimezone',_0x8849('0x16'),_0x8849('0x17'),_0x8849('0x18'),_0x8849('0x19'),'dialAMDInitialSilence',_0x8849('0x1a'),_0x8849('0x1b'),_0x8849('0x1c'),_0x8849('0x1d'),'dialAMDBetweenWordsSilence',_0x8849('0x1e'),_0x8849('0x1f'),_0x8849('0x20'),'timeout',_0x8849('0x21'),_0x8849('0x22'),_0x8849('0x23'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0x8849('0x24'),'monitor_format',_0x8849('0x25'),_0x8849('0x26'),'dialCutDigit',_0x8849('0x27'),'dialNoSuchNumberRetryFrequency',_0x8849('0x28'),_0x8849('0x29'),'dialAbandonedMaxRetry',_0x8849('0x2a'),'dialMachineMaxRetry',_0x8849('0x2b'),'dialAgentRejectMaxRetry',_0x8849('0x2c'),'mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0x8849('0x2d'),_0x8849('0x2e'),_0x8849('0x2f')],'include':[{'model':_0x8849('0x30'),'as':_0x8849('0x30'),'attributes':['id','name','callerid',_0x8849('0x31')]},{'model':_0x8849('0x32'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':'Trunk','as':_0x8849('0x33'),'attributes':['id','name',_0x8849('0x34'),_0x8849('0x31')]},{'model':_0x8849('0x35'),'as':'Interval','attributes':['id',_0x8849('0x3')],'include':[{'model':_0x8849('0x35'),'as':_0x8849('0x36'),'attributes':['id',_0x8849('0x3'),'interval']}]}]},'log':_0x8849('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 4f7364f..7716a2f 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(_0x2e2c48,_0x1abed5){var _0x482876=function(_0x5da24a){while(--_0x5da24a){_0x2e2c48['push'](_0x2e2c48['shift']());}};_0x482876(++_0x1abed5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x31ee0f,_0x3970c7){var _0x49bc3f=function(_0x4f9baa){while(--_0x4f9baa){_0x31ee0f['push'](_0x31ee0f['shift']());}};_0x49bc3f(++_0x3970c7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 962df66..1b2e19a 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 _0x12f7=['Request','getVoiceQueueRtPauses'];(function(_0x13032f,_0x350a6b){var _0x6be26e=function(_0x1972ec){while(--_0x1972ec){_0x13032f['push'](_0x13032f['shift']());}};_0x6be26e(++_0x350a6b);}(_0x12f7,0x137));var _0x712f=function(_0x461d7a,_0xeb2674){_0x461d7a=_0x461d7a-0x0;var _0x468349=_0x12f7[_0x461d7a];return _0x468349;};'use strict';var client=require('../client');exports[_0x712f('0x0')]=function(_0x57b824){return function(){return client[_0x712f('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x57b824,'paused':!![]},'raw':!![]},'log':_0x712f('0x0')});};}; \ No newline at end of file +var _0xbd78=['../client','getVoiceQueueRtPauses','Request'];(function(_0x41bfa8,_0x2222f0){var _0x5a689e=function(_0x9c9b27){while(--_0x9c9b27){_0x41bfa8['push'](_0x41bfa8['shift']());}};_0x5a689e(++_0x2222f0);}(_0xbd78,0x1d1));var _0x8bd7=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbd78[_0x5ddb1c];return _0x354adc;};'use strict';var client=require(_0x8bd7('0x0'));exports[_0x8bd7('0x1')]=function(_0x7a9187){return function(){return client[_0x8bd7('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x7a9187,'paused':!![]},'raw':!![]},'log':_0x8bd7('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 82c26a0..b378c00 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(_0x3b940d,_0x4e31f6){var _0x5d21f1=function(_0x5df9b6){while(--_0x5df9b6){_0x3b940d['push'](_0x3b940d['shift']());}};_0x5d21f1(++_0x4e31f6);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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(_0x23e06f,_0x235d89){var _0x50bc4c=function(_0x4dc62b){while(--_0x4dc62b){_0x23e06f['push'](_0x23e06f['shift']());}};_0x50bc4c(++_0x235d89);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 272e17e..47ec100 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 _0xa1e8=['attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0xa1e8,0x82));var _0x8a1e=function(_0x58ff8c,_0x49a369){_0x58ff8c=_0x58ff8c-0x0;var _0x5a703a=_0xa1e8[_0x58ff8c];return _0x5a703a;};'use strict';var client=require(_0x8a1e('0x0'));exports[_0x8a1e('0x1')]={};exports[_0x8a1e('0x2')]=function(_0x7d9ce9){return client[_0x8a1e('0x3')](_0x8a1e('0x4'),{'body':{'result':_0x7d9ce9[_0x8a1e('0x5')],'transfererchannel':_0x7d9ce9[_0x8a1e('0x6')],'transferercalleridnum':_0x7d9ce9[_0x8a1e('0x7')],'transferercalleridname':_0x7d9ce9[_0x8a1e('0x8')],'transfererconnectedlinenum':_0x7d9ce9[_0x8a1e('0x9')],'transfererconnectedlinename':_0x7d9ce9[_0x8a1e('0xa')],'transfereraccountcode':_0x7d9ce9[_0x8a1e('0xb')],'transferercontext':_0x7d9ce9[_0x8a1e('0xc')],'transfererexten':_0x7d9ce9['transfererexten'],'transfererlinkedid':_0x7d9ce9[_0x8a1e('0xd')],'transfereechannel':_0x7d9ce9[_0x8a1e('0xe')],'transfereecalleridnum':_0x7d9ce9[_0x8a1e('0xf')],'transfereecalleridname':_0x7d9ce9[_0x8a1e('0x10')],'transfereeconnectedlinenum':_0x7d9ce9[_0x8a1e('0x11')],'transfereeconnectedlinename':_0x7d9ce9[_0x8a1e('0x12')],'transfereeaccountcode':_0x7d9ce9['transfereeaccountcode'],'transfereecontext':_0x7d9ce9[_0x8a1e('0x13')],'transfereeexten':_0x7d9ce9[_0x8a1e('0x14')],'transfereelinkedid':_0x7d9ce9[_0x8a1e('0x15')],'isexternal':_0x7d9ce9['isexternal'],'context':_0x7d9ce9[_0x8a1e('0x16')],'extension':_0x7d9ce9[_0x8a1e('0x17')],'type':_0x8a1e('0x18')},'log':_0x8a1e('0x4')});};exports[_0x8a1e('0x19')]=function(_0x7274c7){return client['Request'](_0x8a1e('0x4'),{'body':{'result':_0x7274c7['result'],'transfererchannel':_0x7274c7[_0x8a1e('0x1a')],'transferercalleridnum':_0x7274c7['origtransferercalleridnum'],'transferercalleridname':_0x7274c7[_0x8a1e('0x1b')],'transfererconnectedlinenum':_0x7274c7[_0x8a1e('0x1c')],'transfererconnectedlinename':_0x7274c7['secondtransfererconnectedlinename'],'transfereraccountcode':_0x7274c7[_0x8a1e('0x1d')],'transferercontext':_0x7274c7[_0x8a1e('0x1e')],'transfererexten':_0x7274c7['secondtransfererexten'],'transfererlinkedid':_0x7274c7[_0x8a1e('0x1f')],'transfereechannel':_0x7274c7['transfertargetchannel'],'transfereecalleridnum':_0x7274c7[_0x8a1e('0x20')],'transfereecalleridname':_0x7274c7[_0x8a1e('0x21')],'transfereeconnectedlinenum':_0x7274c7[_0x8a1e('0x22')],'transfereeconnectedlinename':_0x7274c7[_0x8a1e('0x23')],'transfereeaccountcode':_0x7274c7[_0x8a1e('0x24')],'transfereecontext':_0x7274c7[_0x8a1e('0x25')],'transfereeexten':_0x7274c7[_0x8a1e('0x26')],'transfereelinkedid':_0x7274c7[_0x8a1e('0x27')],'isexternal':_0x7274c7[_0x8a1e('0x28')],'context':_0x7274c7[_0x8a1e('0x29')],'extension':_0x7274c7['origtransfererexten'],'type':_0x8a1e('0x2a')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x7f81=['attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','blind'];(function(_0x23f01f,_0x4c51b7){var _0x30b2c1=function(_0x3880dc){while(--_0x3880dc){_0x23f01f['push'](_0x23f01f['shift']());}};_0x30b2c1(++_0x4c51b7);}(_0x7f81,0x89));var _0x17f8=function(_0x3e314c,_0x5bc77c){_0x3e314c=_0x3e314c-0x0;var _0x58dc4f=_0x7f81[_0x3e314c];return _0x58dc4f;};'use strict';var client=require(_0x17f8('0x0'));exports[_0x17f8('0x1')]={};exports[_0x17f8('0x2')]=function(_0x41e1ce){return client[_0x17f8('0x3')](_0x17f8('0x4'),{'body':{'result':_0x41e1ce[_0x17f8('0x5')],'transfererchannel':_0x41e1ce[_0x17f8('0x6')],'transferercalleridnum':_0x41e1ce[_0x17f8('0x7')],'transferercalleridname':_0x41e1ce[_0x17f8('0x8')],'transfererconnectedlinenum':_0x41e1ce['transfererconnectedlinenum'],'transfererconnectedlinename':_0x41e1ce['transfererconnectedlinename'],'transfereraccountcode':_0x41e1ce[_0x17f8('0x9')],'transferercontext':_0x41e1ce['transferercontext'],'transfererexten':_0x41e1ce[_0x17f8('0xa')],'transfererlinkedid':_0x41e1ce[_0x17f8('0xb')],'transfereechannel':_0x41e1ce[_0x17f8('0xc')],'transfereecalleridnum':_0x41e1ce[_0x17f8('0xd')],'transfereecalleridname':_0x41e1ce[_0x17f8('0xe')],'transfereeconnectedlinenum':_0x41e1ce['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x41e1ce[_0x17f8('0xf')],'transfereeaccountcode':_0x41e1ce[_0x17f8('0x10')],'transfereecontext':_0x41e1ce[_0x17f8('0x11')],'transfereeexten':_0x41e1ce[_0x17f8('0x12')],'transfereelinkedid':_0x41e1ce[_0x17f8('0x13')],'isexternal':_0x41e1ce[_0x17f8('0x14')],'context':_0x41e1ce['context'],'extension':_0x41e1ce[_0x17f8('0x15')],'type':_0x17f8('0x16')},'log':_0x17f8('0x4')});};exports[_0x17f8('0x17')]=function(_0x136a9d){return client[_0x17f8('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x136a9d[_0x17f8('0x5')],'transfererchannel':_0x136a9d[_0x17f8('0x18')],'transferercalleridnum':_0x136a9d['origtransferercalleridnum'],'transferercalleridname':_0x136a9d[_0x17f8('0x19')],'transfererconnectedlinenum':_0x136a9d['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x136a9d[_0x17f8('0x1a')],'transfereraccountcode':_0x136a9d[_0x17f8('0x1b')],'transferercontext':_0x136a9d[_0x17f8('0x1c')],'transfererexten':_0x136a9d[_0x17f8('0x1d')],'transfererlinkedid':_0x136a9d[_0x17f8('0x1e')],'transfereechannel':_0x136a9d['transfertargetchannel'],'transfereecalleridnum':_0x136a9d[_0x17f8('0x1f')],'transfereecalleridname':_0x136a9d['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x136a9d[_0x17f8('0x20')],'transfereeconnectedlinename':_0x136a9d[_0x17f8('0x21')],'transfereeaccountcode':_0x136a9d[_0x17f8('0x22')],'transfereecontext':_0x136a9d[_0x17f8('0x23')],'transfereeexten':_0x136a9d[_0x17f8('0x24')],'transfereelinkedid':_0x136a9d[_0x17f8('0x25')],'isexternal':_0x136a9d[_0x17f8('0x14')],'context':_0x136a9d['origtransferercontext'],'extension':_0x136a9d[_0x17f8('0x26')],'type':_0x17f8('0x27')},'log':_0x17f8('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index b228a77..1d27994 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 _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x3cb1a7,_0x47c577){var _0x265411=function(_0x15ad89){while(--_0x15ad89){_0x3cb1a7['push'](_0x3cb1a7['shift']());}};_0x265411(++_0x47c577);}(_0xb10b,0x12a));var _0xbb10=function(_0x3af480,_0x455eff){_0x3af480=_0x3af480-0x0;var _0x3f317a=_0xb10b[_0x3af480];return _0x3f317a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file +var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x27c0a4,_0x58ed13){var _0x1f7bd2=function(_0x27d5cf){while(--_0x27d5cf){_0x27c0a4['push'](_0x27c0a4['shift']());}};_0x1f7bd2(++_0x58ed13);}(_0xb10b,0x12a));var _0xbb10=function(_0x49c341,_0x5b9570){_0x49c341=_0x49c341-0x0;var _0x1c106d=_0xb10b[_0x49c341];return _0x1c106d;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+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 4a50d7d..923ec08 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 _0xe2b6=['format','user:%s','trigger:%s','action','toLowerCase','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','fax','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','then','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push'];(function(_0x314e22,_0x891517){var _0x4ac0f5=function(_0x43aa65){while(--_0x43aa65){_0x314e22['push'](_0x314e22['shift']());}};_0x4ac0f5(++_0x891517);}(_0xe2b6,0x11d));var _0x6e2b=function(_0x3559b6,_0x41e427){_0x3559b6=_0x3559b6-0x0;var _0x5bedcf=_0xe2b6[_0x3559b6];return _0x5bedcf;};'use strict';var _=require('lodash');var BPromise=require(_0x6e2b('0x0'));var Redis=require(_0x6e2b('0x1'));var util=require(_0x6e2b('0x2'));var config=require(_0x6e2b('0x3'));var logger=require(_0x6e2b('0x4'))(_0x6e2b('0x5'));var cmContactRpc=require(_0x6e2b('0x6'));config[_0x6e2b('0x7')]=_[_0x6e2b('0x8')](config[_0x6e2b('0x7')],{'host':_0x6e2b('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6e2b('0x7')]));function emit(_0x4e43c4,_0x1fc32d,_0xc65820,_0x1fe4f5,_0x19f41c){logger[_0x6e2b('0xa')]('[CM][%s][%s]',_0x4e43c4,_0x1fc32d['id'],_0xc65820,_0x1fe4f5,JSON[_0x6e2b('0xb')](_0x19f41c));io['to'](_0xc65820)[_0x6e2b('0xc')](_0x1fe4f5,_0x19f41c);}exports[_0x6e2b('0xd')]=function(_0x8b4fce,_0x536490,_0xd3ec70,_0x359e5b){var _0x4be257,_0x11b3fd;var _0x21a56d={};var _0x554b59;var _0x417e89=Number(_0xd3ec70[_0x6e2b('0xe')]);var _0x4c924c=_0xd3ec70[_0x6e2b('0xf')]?Boolean(Number(_0xd3ec70['data2'])):![];var _0x10baf8;var _0x5387c1=![];if(!_[_0x6e2b('0x10')](_0xd3ec70[_0x6e2b('0x11')])){if(_0xd3ec70[_0x6e2b('0x11')]=='1')_0x5387c1=!![];}if(!_0x5387c1){if(_0x359e5b['xmd-contactid']){_0x21a56d['id']=_0x359e5b[_0x6e2b('0x12')];}}if(!_0x21a56d['id']){_0x21a56d[_0x6e2b('0x13')]=_0x417e89;_0x10baf8=_0xd3ec70['data3']&&_0xd3ec70[_0x6e2b('0x14')]!=='0'?_0xd3ec70[_0x6e2b('0x14')][_0x6e2b('0x15')](','):['phone'];_0x21a56d['$or']=_[_0x6e2b('0x16')](_0x10baf8,function(_0x5e40f1){var _0x26b3a5={};_0x26b3a5[_0x5e40f1]=_0x359e5b[_0x6e2b('0x17')]?_0x359e5b[_0x6e2b('0x18')]:_0x359e5b[_0x6e2b('0x19')];return _0x26b3a5;});_0x554b59=_0x359e5b['routeId']?_0x359e5b['destcalleridnum']:_0x359e5b[_0x6e2b('0x19')];}var _0x5d646d=['id',_0x6e2b('0x1a'),_0x6e2b('0x1b'),_0x6e2b('0x1c'),'mobile',_0x6e2b('0x1d'),_0x6e2b('0x13'),_0x6e2b('0x1e'),_0x6e2b('0x1f'),_0x6e2b('0x20')];var _0x3440c8=_[_0x6e2b('0x21')](_0x5d646d,_0x10baf8);BPromise[_0x6e2b('0x22')]()['then'](cmContactRpc[_0x6e2b('0x23')]({'attributes':_0x3440c8,'where':_0x21a56d,'phone':_0x554b59}))['then'](function(_0x42d3ab){_0x11b3fd=_0x42d3ab;if(!_[_0x6e2b('0x24')](_0x11b3fd)){if(_0x11b3fd[_0x6e2b('0x25')]===0x1){_0x4be257=_0x11b3fd[0x0];logger[_0x6e2b('0xa')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x359e5b[_0x6e2b('0x26')],_0x536490['id'],_0x4be257['id']);}else{logger[_0x6e2b('0xa')](_0x6e2b('0x27'),_0x359e5b[_0x6e2b('0x26')],_0x536490['id'],_[_0x6e2b('0x16')](_0x11b3fd,'id')['join'](','));}return;}else{logger[_0x6e2b('0xa')](_0x6e2b('0x28'),_0x359e5b[_0x6e2b('0x26')],_0x536490['id']);var _0x11a73d={'ListId':_0x417e89};var _0x52eb82=_0xd3ec70[_0x6e2b('0x29')]&&_0xd3ec70[_0x6e2b('0x29')]!=='0'?_0xd3ec70[_0x6e2b('0x29')]:_0x6e2b('0x1c');if(_0x4c924c){logger[_0x6e2b('0xa')](_0x6e2b('0x2a'),_0x359e5b[_0x6e2b('0x26')],_0x536490['id']);_0x11a73d[_0x52eb82]=_[_0x6e2b('0x10')](_0x359e5b[_0x6e2b('0x17')])?_0x359e5b[_0x6e2b('0x19')]:_0x359e5b[_0x6e2b('0x18')];if(_[_0x6e2b('0x10')](_0x359e5b[_0x6e2b('0x17')])){_0x11a73d[_0x6e2b('0x1a')]=_0x359e5b[_0x6e2b('0x2b')]&&_0x359e5b['calleridname']!==_0x6e2b('0x2c')?_0x359e5b[_0x6e2b('0x2b')]:_0x6e2b('0x2d');}else{_0x11a73d['firstName']=_0x359e5b['destcalleridname']&&_0x359e5b[_0x6e2b('0x2e')]!==''?_0x359e5b['destcalleridname']:'Unknown';}return BPromise[_0x6e2b('0x22')]()[_0x6e2b('0x2f')](cmContactRpc['createContact'](_0x11a73d))[_0x6e2b('0x2f')](function(_0x23b3a7){_0x4be257=_0x23b3a7;_0x11b3fd['push'](_0x23b3a7);if(_0x4be257){logger[_0x6e2b('0xa')](_0x6e2b('0x30'),_0x359e5b['uniqueid'],_0x536490['id'],_0x4be257['id']);}return;});}else{logger[_0x6e2b('0xa')](_0x6e2b('0x31'),_0x359e5b['uniqueid'],_0x536490['id']);_0x11a73d[_0x52eb82]=_[_0x6e2b('0x10')](_0x359e5b[_0x6e2b('0x17')])?_0x359e5b[_0x6e2b('0x19')]:_0x359e5b[_0x6e2b('0x18')];if(_['isNil'](_0x359e5b['routeId'])){_0x11a73d[_0x6e2b('0x1a')]=_0x359e5b[_0x6e2b('0x2b')]&&_0x359e5b[_0x6e2b('0x2b')]!==''?_0x359e5b[_0x6e2b('0x2b')]:_0x6e2b('0x2d');}else{_0x11a73d[_0x6e2b('0x1a')]=_0x359e5b[_0x6e2b('0x2e')]&&_0x359e5b['destcalleridname']!==_0x6e2b('0x2c')?_0x359e5b[_0x6e2b('0x2e')]:_0x6e2b('0x2d');}_0x4be257=_0x11a73d;_0x11b3fd[_0x6e2b('0x32')](_0x11a73d);return;}}})['then'](function(){if(_0x8b4fce){emit(_0x359e5b[_0x6e2b('0x26')],_0x536490,util[_0x6e2b('0x33')](_0x6e2b('0x34'),_0x8b4fce['name']),util[_0x6e2b('0x33')](_0x6e2b('0x35'),_0xd3ec70[_0x6e2b('0x36')][_0x6e2b('0x37')]()),{'evt':_['merge'](_0x359e5b,{'autoCreate':_0x4c924c}),'contact':_0x4be257===undefined?{}:_0x4be257,'contacts':_0x11b3fd[_0x6e2b('0x25')]===0x0?undefined:_0x11b3fd});}});}; \ No newline at end of file +var _0xa619=['uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','','Unknown','destcalleridname','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','format','user:%s','action','toLowerCase','merge','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','stringify','emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','destcalleridnum','calleridnum','routeId','firstName','fax','createdAt','union','resolve','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa619,0xe1));var _0x9a61=function(_0x148e07,_0x1f7134){_0x148e07=_0x148e07-0x0;var _0x3ff8c2=_0xa619[_0x148e07];return _0x3ff8c2;};'use strict';var _=require('lodash');var BPromise=require(_0x9a61('0x0'));var Redis=require(_0x9a61('0x1'));var util=require('util');var config=require(_0x9a61('0x2'));var logger=require(_0x9a61('0x3'))(_0x9a61('0x4'));var cmContactRpc=require(_0x9a61('0x5'));config['redis']=_[_0x9a61('0x6')](config[_0x9a61('0x7')],{'host':_0x9a61('0x8'),'port':0x18eb});var io=require(_0x9a61('0x9'))(new Redis(config[_0x9a61('0x7')]));function emit(_0x160ba8,_0x46417b,_0x515440,_0x210615,_0x255763){logger[_0x9a61('0xa')]('[CM][%s][%s]',_0x160ba8,_0x46417b['id'],_0x515440,_0x210615,JSON[_0x9a61('0xb')](_0x255763));io['to'](_0x515440)[_0x9a61('0xc')](_0x210615,_0x255763);}exports['exec']=function(_0x1dcc4d,_0x519da9,_0x445aed,_0x54eee8){var _0x35098a,_0x3dd3a8;var _0x597f03={};var _0x1f6626;var _0x180529=Number(_0x445aed[_0x9a61('0xd')]);var _0x7dc931=_0x445aed[_0x9a61('0xe')]?Boolean(Number(_0x445aed['data2'])):![];var _0x114355;var _0x36932a=![];if(!_[_0x9a61('0xf')](_0x445aed[_0x9a61('0x10')])){if(_0x445aed[_0x9a61('0x10')]=='1')_0x36932a=!![];}if(!_0x36932a){if(_0x54eee8[_0x9a61('0x11')]){_0x597f03['id']=_0x54eee8[_0x9a61('0x11')];}}if(!_0x597f03['id']){_0x597f03[_0x9a61('0x12')]=_0x180529;_0x114355=_0x445aed['data3']&&_0x445aed[_0x9a61('0x13')]!=='0'?_0x445aed[_0x9a61('0x13')][_0x9a61('0x14')](','):[_0x9a61('0x15')];_0x597f03['$or']=_['map'](_0x114355,function(_0x5bb696){var _0x1133a4={};_0x1133a4[_0x5bb696]=_0x54eee8['routeId']?_0x54eee8[_0x9a61('0x16')]:_0x54eee8[_0x9a61('0x17')];return _0x1133a4;});_0x1f6626=_0x54eee8[_0x9a61('0x18')]?_0x54eee8['destcalleridnum']:_0x54eee8[_0x9a61('0x17')];}var _0x33df3a=['id',_0x9a61('0x19'),'lastName',_0x9a61('0x15'),'mobile',_0x9a61('0x1a'),_0x9a61('0x12'),_0x9a61('0x1b'),'scheduledAt','updatedAt'];var _0x554e28=_[_0x9a61('0x1c')](_0x33df3a,_0x114355);BPromise[_0x9a61('0x1d')]()['then'](cmContactRpc[_0x9a61('0x1e')]({'attributes':_0x554e28,'where':_0x597f03,'phone':_0x1f6626}))[_0x9a61('0x1f')](function(_0x35d89d){_0x3dd3a8=_0x35d89d;if(!_[_0x9a61('0x20')](_0x3dd3a8)){if(_0x3dd3a8[_0x9a61('0x21')]===0x1){_0x35098a=_0x3dd3a8[0x0];logger[_0x9a61('0xa')](_0x9a61('0x22'),_0x54eee8[_0x9a61('0x23')],_0x519da9['id'],_0x35098a['id']);}else{logger[_0x9a61('0xa')](_0x9a61('0x24'),_0x54eee8[_0x9a61('0x23')],_0x519da9['id'],_[_0x9a61('0x25')](_0x3dd3a8,'id')['join'](','));}return;}else{logger[_0x9a61('0xa')](_0x9a61('0x26'),_0x54eee8[_0x9a61('0x23')],_0x519da9['id']);var _0x1d7fe3={'ListId':_0x180529};var _0xf14a3b=_0x445aed[_0x9a61('0x27')]&&_0x445aed['data4']!=='0'?_0x445aed[_0x9a61('0x27')]:_0x9a61('0x15');if(_0x7dc931){logger[_0x9a61('0xa')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x54eee8[_0x9a61('0x23')],_0x519da9['id']);_0x1d7fe3[_0xf14a3b]=_[_0x9a61('0xf')](_0x54eee8[_0x9a61('0x18')])?_0x54eee8[_0x9a61('0x17')]:_0x54eee8[_0x9a61('0x16')];if(_[_0x9a61('0xf')](_0x54eee8['routeId'])){_0x1d7fe3['firstName']=_0x54eee8[_0x9a61('0x28')]&&_0x54eee8[_0x9a61('0x28')]!==_0x9a61('0x29')?_0x54eee8[_0x9a61('0x28')]:_0x9a61('0x2a');}else{_0x1d7fe3['firstName']=_0x54eee8[_0x9a61('0x2b')]&&_0x54eee8[_0x9a61('0x2b')]!==_0x9a61('0x29')?_0x54eee8[_0x9a61('0x2b')]:_0x9a61('0x2a');}return BPromise[_0x9a61('0x1d')]()[_0x9a61('0x1f')](cmContactRpc['createContact'](_0x1d7fe3))[_0x9a61('0x1f')](function(_0x1f54dd){_0x35098a=_0x1f54dd;_0x3dd3a8['push'](_0x1f54dd);if(_0x35098a){logger[_0x9a61('0xa')](_0x9a61('0x2c'),_0x54eee8[_0x9a61('0x23')],_0x519da9['id'],_0x35098a['id']);}return;});}else{logger[_0x9a61('0xa')](_0x9a61('0x2d'),_0x54eee8[_0x9a61('0x23')],_0x519da9['id']);_0x1d7fe3[_0xf14a3b]=_[_0x9a61('0xf')](_0x54eee8[_0x9a61('0x18')])?_0x54eee8[_0x9a61('0x17')]:_0x54eee8['destcalleridnum'];if(_[_0x9a61('0xf')](_0x54eee8[_0x9a61('0x18')])){_0x1d7fe3[_0x9a61('0x19')]=_0x54eee8[_0x9a61('0x28')]&&_0x54eee8[_0x9a61('0x28')]!==_0x9a61('0x29')?_0x54eee8[_0x9a61('0x28')]:'Unknown';}else{_0x1d7fe3[_0x9a61('0x19')]=_0x54eee8['destcalleridname']&&_0x54eee8[_0x9a61('0x2b')]!==_0x9a61('0x29')?_0x54eee8[_0x9a61('0x2b')]:_0x9a61('0x2a');}_0x35098a=_0x1d7fe3;_0x3dd3a8[_0x9a61('0x2e')](_0x1d7fe3);return;}}})[_0x9a61('0x1f')](function(){if(_0x1dcc4d){emit(_0x54eee8['uniqueid'],_0x519da9,util[_0x9a61('0x2f')](_0x9a61('0x30'),_0x1dcc4d['name']),util[_0x9a61('0x2f')]('trigger:%s',_0x445aed[_0x9a61('0x31')][_0x9a61('0x32')]()),{'evt':_[_0x9a61('0x33')](_0x54eee8,{'autoCreate':_0x7dc931}),'contact':_0x35098a===undefined?{}:_0x35098a,'contacts':_0x3dd3a8[_0x9a61('0x21')]===0x0?undefined:_0x3dd3a8});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 85ee5ea..0902d87 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 _0x9a96=['field','account','ChatWebsiteId','operator','upperFirst','AccountId','value','interaction','message','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','created','exports','util','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','trigger','../ami','redis','defaults','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','zendeskAccounts','freshdeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','accounts','salesforceAccounts','dynamics365Accounts','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentbusy','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','undefined','inspect','checkTriggers','interface','hasOwnProperty','checkTrigger','variables','Actions','toLowerCase','motionbar','browser','data1','TemplateId','data2','html','template\x20not\x20found','uri','isNil','data3','data4','location','uriLocation','windowWidth','data5','windowHeight','data6','600','winApplication','winArguments','render','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','action','merge','contactmanager','exec','queue','routeId','urlforward','parse','query','search','channel','AllConditions','length','every','checkConditions','AnyConditions','some','debug','checkTrigger:\x20trigger','evt'];(function(_0x42faa0,_0x5dea87){var _0x4bda60=function(_0x29790a){while(--_0x29790a){_0x42faa0['push'](_0x42faa0['shift']());}};_0x4bda60(++_0x5dea87);}(_0x9a96,0x117));var _0x69a9=function(_0x338789,_0x7567c7){_0x338789=_0x338789-0x0;var _0x4d0a6d=_0x9a96[_0x338789];return _0x4d0a6d;};'use strict';var util=require(_0x69a9('0x0'));var _=require('lodash');var url=require(_0x69a9('0x1'));var Mustache=require(_0x69a9('0x2'));var Redis=require(_0x69a9('0x3'));var urlforward=require(_0x69a9('0x4'));var integration=require(_0x69a9('0x5'));var cmContact=require(_0x69a9('0x6'));var script=require(_0x69a9('0x7'));var config=require(_0x69a9('0x8'));var logger=require('../../../config/logger')(_0x69a9('0x9'));var ami=require(_0x69a9('0xa'));config[_0x69a9('0xb')]=_[_0x69a9('0xc')](config[_0x69a9('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x69a9('0xd'))(new Redis(config[_0x69a9('0xb')]));var operators={'equals':function(_0x3851c8,_0x1a85b0){return _0x3851c8==_0x1a85b0;},'not_equals':function(_0x4fb23d,_0x15518a){return _0x4fb23d!=_0x15518a;}};var barAndWebActions=[_0x69a9('0xe'),'url',_0x69a9('0xf')];function Trigger(_0xfc0820){this[_0x69a9('0x10')]=_0xfc0820[_0x69a9('0x10')];this[_0x69a9('0x11')]=_0xfc0820[_0x69a9('0x11')];this[_0x69a9('0x12')]=_0xfc0820[_0x69a9('0x12')];this['templates']=_0xfc0820[_0x69a9('0x13')];this['voiceExtensions']=_0xfc0820['voiceExtensions'];this[_0x69a9('0x14')]=_0xfc0820[_0x69a9('0x14')];this[_0x69a9('0x15')]=_0xfc0820[_0x69a9('0x15')];this['salesforceAccounts']=_0xfc0820['salesforceAccounts'];this[_0x69a9('0x16')]=_0xfc0820[_0x69a9('0x16')];this[_0x69a9('0x17')]=_0xfc0820[_0x69a9('0x17')];this[_0x69a9('0x18')]=_0xfc0820[_0x69a9('0x18')];this[_0x69a9('0x19')]=_0xfc0820[_0x69a9('0x19')];this['servicenowAccounts']=_0xfc0820[_0x69a9('0x1a')];this['dynamics365Accounts']=_0xfc0820['dynamics365Accounts'];this[_0x69a9('0x1b')]=_0xfc0820['freshsalesAccounts'];this[_0x69a9('0x1c')]={'zendesk':this[_0x69a9('0x14')],'salesforce':this[_0x69a9('0x1d')],'freshdesk':this[_0x69a9('0x15')],'sugarcrm':this[_0x69a9('0x16')],'zoho':this[_0x69a9('0x17')],'desk':this[_0x69a9('0x18')],'vtiger':this[_0x69a9('0x19')],'dynamics365':this[_0x69a9('0x1e')],'freshsales':this[_0x69a9('0x1b')],'servicenow':this[_0x69a9('0x1a')]};ami['on']('custom:agentcalled',this[_0x69a9('0x1f')][_0x69a9('0x20')](this));ami['on'](_0x69a9('0x21'),this[_0x69a9('0x1f')][_0x69a9('0x20')](this));ami['on'](_0x69a9('0x22'),this[_0x69a9('0x1f')]['bind'](this));ami['on']('custom:agentcomplete',this[_0x69a9('0x1f')][_0x69a9('0x20')](this));ami['on'](_0x69a9('0x23'),this['syncCustomEvent'][_0x69a9('0x20')](this));ami['on']('custom:agentnoanswer',this['syncCustomEvent'][_0x69a9('0x20')](this));ami['on'](_0x69a9('0x24'),this[_0x69a9('0x1f')][_0x69a9('0x20')](this));ami['on']('custom:agentcongestion',this[_0x69a9('0x1f')][_0x69a9('0x20')](this));ami['on'](_0x69a9('0x25'),this[_0x69a9('0x1f')][_0x69a9('0x20')](this));ami['on'](_0x69a9('0x26'),this[_0x69a9('0x1f')]['bind'](this));ami['on'](_0x69a9('0x27'),this[_0x69a9('0x1f')][_0x69a9('0x20')](this));ami['on'](_0x69a9('0x28'),this[_0x69a9('0x1f')][_0x69a9('0x20')](this));ami['on'](_0x69a9('0x29'),this['syncAgentDial'][_0x69a9('0x20')](this));ami['on'](_0x69a9('0x2a'),this[_0x69a9('0x2b')][_0x69a9('0x20')](this));ami['on'](_0x69a9('0x2c'),this['syncAgentDial'][_0x69a9('0x20')](this));ami['on'](_0x69a9('0x2d'),this['syncCustomEvent'][_0x69a9('0x20')](this));ami['on']('custom:closedinteraction',this[_0x69a9('0x1f')][_0x69a9('0x20')](this));ami['on'](_0x69a9('0x2e'),this[_0x69a9('0x1f')][_0x69a9('0x20')](this));ami['on'](_0x69a9('0x2f'),this[_0x69a9('0x1f')][_0x69a9('0x20')](this));ami['on'](_0x69a9('0x30'),this[_0x69a9('0x1f')]['bind'](this));ami['on'](_0x69a9('0x31'),this[_0x69a9('0x1f')][_0x69a9('0x20')](this));ami['on'](_0x69a9('0x32'),this[_0x69a9('0x1f')][_0x69a9('0x20')](this));ami['on'](_0x69a9('0x33'),this[_0x69a9('0x1f')][_0x69a9('0x20')](this));}Trigger[_0x69a9('0x34')][_0x69a9('0x35')]=function(_0x327bca,_0x9fd616,_0x161d98){logger[_0x69a9('0x36')](_0x327bca,_0x9fd616,JSON[_0x69a9('0x37')](_0x161d98));io['to'](_0x327bca)[_0x69a9('0x35')](_0x9fd616,_0x161d98);};Trigger[_0x69a9('0x34')][_0x69a9('0x1f')]=function(_0x4141ea){var _0x826a78=_[_0x69a9('0x38')](_0x4141ea);if(typeof _0x826a78[_0x69a9('0x39')]===_0x69a9('0x3a')){_0x826a78[_0x69a9('0x39')]='voice';}logger['debug']('syncCustomEvent',util[_0x69a9('0x3b')](_0x826a78,{'showHidden':!![],'depth':null}));this[_0x69a9('0x3c')](_0x826a78);};Trigger[_0x69a9('0x34')][_0x69a9('0x2b')]=function(_0x1f4b45){if(this[_0x69a9('0x11')][_0x1f4b45[_0x69a9('0x3d')]]){this[_0x69a9('0x1f')](_0x1f4b45);}};Trigger[_0x69a9('0x34')][_0x69a9('0x3c')]=function(_0x3b5d87){var _0x2744aa;for(var _0x969f15 in this['triggers']){if(this[_0x69a9('0x10')][_0x69a9('0x3e')](_0x969f15)){if(this[_0x69a9('0x10')][_0x969f15]['status']){_0x2744aa=this[_0x69a9('0x3f')](this['triggers'][_0x969f15],_0x3b5d87);if(_0x2744aa){_['merge'](_0x3b5d87,_0x3b5d87[_0x69a9('0x40')]);for(var _0x1f5150=0x0,_0x26f0c9,_0x36f031,_0x4ef3a9;_0x1f51500x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file +var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x20bf84,_0x5cc434){var _0x528d49=function(_0x55f2cd){while(--_0x55f2cd){_0x20bf84['push'](_0x20bf84['shift']());}};_0x528d49(++_0x5cc434);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 0742be0..f68ab21 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 _0xbf43=['remoteUri','CloudProvider','data7','tenantId','data2','data5','clientId','username','password','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','toLowerCase','outbound','destcalleridnum','calleridnum','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','GET','\x20eq\x20\x27','value','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','ticketType','POST','incidents','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','Fields','phonecall','callDirection','queue','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','md5','ioredis','dynamics365','../../../../config/environment','redis','socket.io-emitter','modernAuthentication'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xbf43,0x13a));var _0x3bf4=function(_0x3c7561,_0xc165b7){_0x3c7561=_0x3c7561-0x0;var _0x1ab4f7=_0xbf43[_0x3c7561];return _0x1ab4f7;};'use strict';var _=require(_0x3bf4('0x0'));var rp=require(_0x3bf4('0x1'));var util=require(_0x3bf4('0x2'));var intUtil=require('./util');var md5=require(_0x3bf4('0x3'));var Redis=require(_0x3bf4('0x4'));var logger=require('../../../../config/logger')(_0x3bf4('0x5'));var config=require(_0x3bf4('0x6'));config[_0x3bf4('0x7')]=_['defaults'](config[_0x3bf4('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x3bf4('0x8'))(new Redis(config[_0x3bf4('0x7')]));function getAuthToken(_0x16fb6d,_0x45c487,_0xaeadaa){if(_0x16fb6d[_0x3bf4('0x9')]){_0x16fb6d[_0x3bf4('0xa')]=_0x16fb6d[_0x3bf4('0xb')][_0x3bf4('0xc')];_0x16fb6d[_0x3bf4('0xd')]=_0x16fb6d[_0x3bf4('0xb')][_0x3bf4('0xe')];return Promise['resolve'](_0x16fb6d[_0x3bf4('0xb')][_0x3bf4('0xf')]);}var _0x5c9f89={'method':'POST','uri':_0x45c487,'form':{'client_id':_0x16fb6d[_0x3bf4('0x10')],'resource':_0x16fb6d[_0x3bf4('0xa')],'username':_0x16fb6d[_0x3bf4('0x11')],'password':_0x16fb6d[_0x3bf4('0x12')],'grant_type':_0x3bf4('0x12'),'client_secret':_0x16fb6d['clientSecret']},'json':!![]};return rp(_0x5c9f89)[_0x3bf4('0x13')](function(_0xf89823){return _0xf89823[_0x3bf4('0x14')];})['catch'](function(_0x407783){logger[_0x3bf4('0x15')]('['+[_0xaeadaa[_0x3bf4('0x16')]()]+_0x3bf4('0x17'));return _0x407783[_0x3bf4('0x18')];});}function getUser(_0x3827c3,_0x1854aa,_0xa7fb95,_0x425937,_0x2c5a0b,_0x4bfe0d){return new Promise(function(_0x84b0b1,_0xb4d331){return getAuthToken(_0x1854aa,_0x425937,_0x4bfe0d)[_0x3bf4('0x13')](function(_0x2a06ba){var _0x1ac1b2={'method':'GET','uri':_0x2c5a0b+_0x3bf4('0x19'),'headers':{'Authorization':_0x3bf4('0x1a')+_0x2a06ba,'OData-Version':_0x3bf4('0x1b')},'json':!![]};return rp(_0x1ac1b2);})[_0x3bf4('0x13')](function(_0x4dab6b){var _0x59e11b=_0x4dab6b['value'];var _0x5d436a=![];var _0x3be409=null;if(!_['isNil'](_0xa7fb95)){if(intUtil[_0x3bf4('0x1c')](_0xa7fb95[_0x3bf4('0x1d')])){_0x3827c3[_0x3bf4('0x1e')]=_0xa7fb95[_0x3bf4('0x1d')];for(_0x3be409=0x0;_0x3be409<_0x59e11b[_0x3bf4('0x1f')];_0x3be409++){if(_0x59e11b[_0x3be409][_0x3bf4('0x20')]===_0xa7fb95['email']&&!_0x59e11b[_0x3be409][_0x3bf4('0x21')]){_0x5d436a=!![];logger[_0x3bf4('0x22')]('['+[_0x4bfe0d[_0x3bf4('0x16')]()]+_0x3bf4('0x23')+_0x59e11b[_0x3be409][_0x3bf4('0x24')]+'!');_0x3827c3[_0x3bf4('0x25')]=_0x59e11b[_0x3be409][_0x3bf4('0x24')];}}}}if(!_0x5d436a){logger[_0x3bf4('0x22')]('['+[_0x4bfe0d[_0x3bf4('0x16')]()]+_0x3bf4('0x26'));_0x3827c3[_0x3bf4('0x1e')]=_0x1854aa['username'];for(_0x3be409=0x0;_0x3be409<_0x59e11b[_0x3bf4('0x1f')];_0x3be409++){if(_0x59e11b[_0x3be409][_0x3bf4('0x20')]===_0x1854aa['username']){_0x3827c3[_0x3bf4('0x25')]=_0x59e11b[_0x3be409][_0x3bf4('0x24')];}}}_0x84b0b1(_0x3827c3);})[_0x3bf4('0x27')](function(_0x460720){_0xb4d331(_0x460720[_0x3bf4('0x18')]);});});}function createEndUser(_0x182dea,_0x4395a6,_0x441373,_0x251be1,_0x1835f0,_0x2ba09e,_0x4370b7){return new Promise(function(_0x5eeca2,_0x559ef5){return getAuthToken(_0x4395a6,_0x441373,_0x2ba09e)['then'](function(_0x5c1369){var _0x5aa874=_0x2ba09e[_0x3bf4('0x28')]()===_0x3bf4('0x29')?_0x1835f0[_0x3bf4('0x2a')]:_0x1835f0[_0x3bf4('0x2b')];var _0x3b2bd7={'method':'POST','uri':_0x251be1+'contacts','body':{'fullname':_0x5aa874,'firstname':_0x5aa874,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x182dea[_0x3bf4('0x25')]+')'},'headers':{'Authorization':_0x3bf4('0x1a')+_0x5c1369,'OData-Version':_0x3bf4('0x1b')},'json':!![],'resolveWithFullResponse':!![]};_0x3b2bd7['body'][_0x4370b7]=_0x5aa874;return rp(_0x3b2bd7);})[_0x3bf4('0x13')](function(_0x18401d){var _0x348dca=_0x18401d[_0x3bf4('0x2c')][_0x3bf4('0x2d')];var _0x13b2a4=_0x348dca[_0x3bf4('0x2e')](_0x348dca[_0x3bf4('0x2f')]('(')+0x1,_0x348dca[_0x3bf4('0x2f')](')'));_0x182dea[_0x3bf4('0x30')]=_0x13b2a4;_0x5eeca2(_0x182dea);})[_0x3bf4('0x27')](function(_0x33a2c6){_0x559ef5(_0x33a2c6[_0x3bf4('0x18')]);});});}function getEndUser(_0x2d0ed9,_0x5c70b7,_0x3ade20,_0x4a7ada,_0x26efb7,_0x5bcf19,_0x8dbe85,_0xd76489){var _0x5ae22f=_0x5bcf19[_0x3bf4('0x28')]()===_0x3bf4('0x29')?_0x26efb7['destcalleridnum']:_0x26efb7[_0x3bf4('0x2b')];return getAuthToken(_0x5c70b7,_0x3ade20,_0x5bcf19)[_0x3bf4('0x13')](function(_0x12c0ff){_0xd76489=_0xd76489?_0xd76489:_0x3bf4('0x31');var _0x175ab6={'method':_0x3bf4('0x32'),'uri':_0x4a7ada+'contacts?$select='+_0xd76489+'&$filter='+_0xd76489+_0x3bf4('0x33')+_0x5ae22f['replace']('+','%2b')+'\x27','headers':{'Authorization':_0x3bf4('0x1a')+_0x12c0ff,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x175ab6);})[_0x3bf4('0x13')](function(_0x1e7ff5){var _0x4f4b77=![];if(!_0x1e7ff5)return _0x4f4b77;var _0x3b045d=_0x1e7ff5[_0x3bf4('0x34')];for(var _0x84fb75=0x0;_0x84fb75<_0x3b045d[_0x3bf4('0x1f')];_0x84fb75++){if(_0x3b045d[_0x84fb75][_0xd76489]===_0x5ae22f){_0x4f4b77=!![];_0x2d0ed9['enduserId']=_0x3b045d[_0x84fb75][_0x3bf4('0x35')];}}return _0x4f4b77;})['then'](function(_0x166bd0){if(_0x166bd0)return _0x2d0ed9;if(_0x8dbe85===_0x3bf4('0x36')){logger[_0x3bf4('0x22')]('['+[_0x5bcf19[_0x3bf4('0x16')]()]+_0x3bf4('0x37'));return _0x2d0ed9;}return createEndUser(_0x2d0ed9,_0x5c70b7,_0x3ade20,_0x4a7ada,_0x26efb7,_0x5bcf19,_0xd76489)[_0x3bf4('0x13')](function(_0x3dc31f){logger['info']('['+[_0x5bcf19[_0x3bf4('0x16')]()]+']\x20Enduser\x20created!',_0x3dc31f[_0x3bf4('0x30')]);return _0x3dc31f;});});}function getCustomFields(_0x154768,_0x2d3a7c,_0x2859f7){var _0x43caa4={};if(_0x154768['length']>0x0){_[_0x3bf4('0x38')](_0x154768,function(_0x39b1b3){if(_[_0x3bf4('0x39')]([_0x3bf4('0x3a'),_0x3bf4('0x3b')],_0x39b1b3[_0x3bf4('0x3c')])&&_0x39b1b3[_0x3bf4('0x3d')]&&!_0x39b1b3[_0x3bf4('0x3e')]){var _0x1efa1d=_0x39b1b3[_0x3bf4('0x3f')][_0x3bf4('0x28')]();var _0xbaa9d0=_0x1efa1d[_0x3bf4('0x2e')](0x0,_0x1efa1d['indexOf']('_'));var _0x125e46=_0x1efa1d['substring'](_0x1efa1d[_0x3bf4('0x40')]('_')+0x1);if(_0xbaa9d0===_0x2859f7){_0x43caa4[_0x125e46]=_0x39b1b3['content'];}}});}return _0x43caa4;}function getTicket(_0x2b11a1,_0x2e46fc,_0x2972b1,_0x2e8889,_0x149cb0,_0x2cfcc0,_0x2e85ec){return new Promise(function(_0x7117d0,_0x19c8a9){var _0xc68859;return getAuthToken(_0x2e46fc,_0x2972b1,_0x2e85ec)[_0x3bf4('0x13')](function(_0x3e28dc){if(_0x2cfcc0[_0x3bf4('0x41')]==='incident'){_0xc68859={'method':_0x3bf4('0x42'),'uri':_0x2e8889+_0x3bf4('0x43'),'body':Object[_0x3bf4('0x44')]({},{'title':intUtil[_0x3bf4('0x45')](_0x2cfcc0[_0x3bf4('0x46')],_0x149cb0,'\x20'),'description':intUtil[_0x3bf4('0x45')](_0x2cfcc0[_0x3bf4('0x47')],_0x149cb0,'\x0a'),'customerid_contact@odata.bind':_0x2b11a1[_0x3bf4('0x30')]?_0x3bf4('0x48')+_0x2b11a1['enduserId']+')':undefined,'ownerid@odata.bind':_0x3bf4('0x49')+_0x2b11a1[_0x3bf4('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x2cfcc0[_0x3bf4('0x4a')],_0x149cb0,_0x2cfcc0[_0x3bf4('0x41')])),'headers':{'Authorization':_0x3bf4('0x1a')+_0x3e28dc,'OData-Version':_0x3bf4('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2cfcc0[_0x3bf4('0x41')]===_0x3bf4('0x4b')){var _0x13e2cd=_0x2b11a1['enduserId']?[{'partyid_systemuser@odata.bind':_0x3bf4('0x49')+_0x2b11a1[_0x3bf4('0x25')]+')','participationtypemask':_0x2b11a1[_0x3bf4('0x4c')]===_0x3bf4('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':_0x3bf4('0x48')+_0x2b11a1['enduserId']+')','participationtypemask':_0x2b11a1['callDirection']===_0x3bf4('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x3bf4('0x49')+_0x2b11a1[_0x3bf4('0x25')]+')','participationtypemask':_0x2b11a1[_0x3bf4('0x4c')]===_0x3bf4('0x4d')?0x2:0x1}];_0xc68859={'method':'POST','uri':_0x2e8889+_0x3bf4('0x4e'),'body':Object[_0x3bf4('0x44')]({},{'subject':intUtil[_0x3bf4('0x45')](_0x2cfcc0['Subjects'],_0x149cb0,'\x20'),'phonenumber':String(_0x149cb0[_0x3bf4('0x2b')]),'description':intUtil[_0x3bf4('0x45')](_0x2cfcc0[_0x3bf4('0x47')],_0x149cb0,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2b11a1[_0x3bf4('0x30')]?_0x3bf4('0x48')+_0x2b11a1[_0x3bf4('0x30')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x2b11a1[_0x3bf4('0x25')]+')','directioncode':_0x2b11a1[_0x3bf4('0x4c')]===_0x3bf4('0x4d')?![]:!![],'phonecall_activity_parties':_0x13e2cd},getCustomFields(_0x2cfcc0[_0x3bf4('0x4a')],_0x149cb0,_0x2cfcc0[_0x3bf4('0x41')])),'headers':{'Authorization':_0x3bf4('0x1a')+_0x3e28dc,'OData-Version':_0x3bf4('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xc68859);})['then'](function(_0x13e000){var _0x193ea1=_0x13e000[_0x3bf4('0x2c')][_0x3bf4('0x2d')];var _0x4c0494=_0x193ea1[_0x3bf4('0x2e')](_0x193ea1[_0x3bf4('0x2f')]('(')+0x1,_0x193ea1[_0x3bf4('0x2f')](')'));_0x2b11a1[_0x3bf4('0x4f')]=_0x4c0494;_0x7117d0(_0x2b11a1);})[_0x3bf4('0x27')](function(_0x39dae7){_0x19c8a9(_0x39dae7['message']);});});}function emit(_0x5a4206,_0x2ee699,_0x2a3bd7,_0x214e32){var _0x1853f9={'uri':util[_0x3bf4('0x50')](_0x3bf4('0x51'),_0x5a4206,_0x2a3bd7,_0x214e32)};io['to'](util['format'](_0x3bf4('0x52'),_0x2ee699))[_0x3bf4('0x53')]('trigger:browser:url',_0x1853f9);}exports['cs']=function(_0x52fa36,_0x48e55a,_0x4949ce,_0x1fc573,_0x270674,_0xf16be7,_0x1795a5,_0x43773f){var _0xc3e6a2={};_0xf16be7[_0x3bf4('0xa')]=_0xf16be7[_0x3bf4('0x9')]?intUtil[_0x3bf4('0x54')](_0xf16be7[_0x3bf4('0xb')][_0x3bf4('0xc')]):intUtil[_0x3bf4('0x54')](_0xf16be7['remoteUri']);_0xf16be7[_0x3bf4('0x55')]=intUtil[_0x3bf4('0x54')](_0xf16be7[_0x3bf4('0x55')]);_0xc3e6a2[_0x3bf4('0x4c')]=_0x43773f==='queue'||_0x43773f===_0x3bf4('0x56')?_0x3bf4('0x4d'):_0x3bf4('0x29');var _0x5c4cb8=_0xf16be7[_0x3bf4('0x9')]?util['format']('%s/api/data/v9.0/',_0xf16be7[_0x3bf4('0xb')][_0x3bf4('0xc')]):util[_0x3bf4('0x50')](_0x3bf4('0x57'),_0xf16be7[_0x3bf4('0xa')]);var _0x22a0de=util['format'](_0x3bf4('0x58'),_0xf16be7[_0x3bf4('0xd')]);var _0x370952=util[_0x3bf4('0x50')](_0x3bf4('0x59'),_0xf16be7[_0x3bf4('0x55')],_0x48e55a['uniqueid'],md5(_0x48e55a[_0x3bf4('0x5a')]));if(_0x270674&&_0x270674[_0x3bf4('0x5b')]){logger[_0x3bf4('0x22')](_0x3bf4('0x5c'),_0x3bf4('0x5d'));_0x48e55a[_0x3bf4('0x5e')]=_0x370952;}else if(_0x1795a5&&_0x1795a5[_0x3bf4('0x5f')]&&_0x1795a5[_0x3bf4('0x5f')]!==_0x3bf4('0x60')){logger[_0x3bf4('0x22')](_0x3bf4('0x61'),_0x3bf4('0x5d'));_0x48e55a[_0x3bf4('0x5e')]=_0x370952;}else{_0x48e55a['recordingURL']='';}return getUser(_0xc3e6a2,_0xf16be7,_0x1fc573,_0x22a0de,_0x5c4cb8,_0x43773f)[_0x3bf4('0x13')](function(_0x9b791f){logger['info']('['+_0x43773f['toUpperCase']()+_0x3bf4('0x62'),_0x9b791f[_0x3bf4('0x25')]);logger[_0x3bf4('0x22')]('['+_0x43773f[_0x3bf4('0x16')]()+']\x20The\x20User\x20email\x20is:',_0x9b791f['userEmail']);return getEndUser(_0x9b791f,_0xf16be7,_0x22a0de,_0x5c4cb8,_0x48e55a,_0x43773f,_0x4949ce['moduleCreate'],_0x4949ce[_0x3bf4('0x63')]);})[_0x3bf4('0x13')](function(_0x2e9a6f){logger['info']('['+_0x43773f[_0x3bf4('0x16')]()+_0x3bf4('0x64'),_0x2e9a6f[_0x3bf4('0x30')]);logger[_0x3bf4('0x22')]('['+_0x43773f[_0x3bf4('0x16')]()+_0x3bf4('0x65'),_0x48e55a[_0x3bf4('0x2b')]);return getTicket(_0x2e9a6f,_0xf16be7,_0x22a0de,_0x5c4cb8,_0x48e55a,_0x4949ce,_0x43773f);})[_0x3bf4('0x13')](function(_0xdd3a61){logger['info'](util[_0x3bf4('0x50')]('['+_0x43773f['toUpperCase']()+_0x3bf4('0x66'),_0x4949ce[_0x3bf4('0x41')],_0xdd3a61[_0x3bf4('0x4f')]));logger[_0x3bf4('0x22')](util[_0x3bf4('0x50')]('['+_0x43773f[_0x3bf4('0x16')]()+_0x3bf4('0x67'),_0x43773f));if(_0x43773f!==_0x3bf4('0x56')&&_0x4949ce[_0x3bf4('0x68')]){logger[_0x3bf4('0x22')]('['+_0x43773f[_0x3bf4('0x16')]()+']',_0x3bf4('0x69'));emit(_0xf16be7[_0x3bf4('0xa')],_0x1fc573['name'],_0x4949ce[_0x3bf4('0x41')],_0xdd3a61['ticketId']);}})[_0x3bf4('0x27')](function(_0xce4c4e){logger[_0x3bf4('0x15')]('['+_0x43773f[_0x3bf4('0x16')]()+_0x3bf4('0x6a'),_0xce4c4e[_0x3bf4('0x18')]);console['error'](_0x3bf4('0x6b'),_0xce4c4e);});}; \ No newline at end of file +var _0x1f29=['recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','username','password','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','userId','systemuserid','info','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','body','odata-entityid','substring','lastIndexOf','enduserId','telephone1','GET','contacts?$select=','\x20eq\x20\x27','replace','%2b','nothing','includes','string','picklist','type','nameField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','Fields','phonecall','callDirection','queue','/contacts(','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x1f29,0x151));var _0x91f2=function(_0x188dc2,_0x1229e9){_0x188dc2=_0x188dc2-0x0;var _0x423b4a=_0x1f29[_0x188dc2];return _0x423b4a;};'use strict';var _=require(_0x91f2('0x0'));var rp=require(_0x91f2('0x1'));var util=require(_0x91f2('0x2'));var intUtil=require(_0x91f2('0x3'));var md5=require(_0x91f2('0x4'));var Redis=require(_0x91f2('0x5'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x91f2('0x6'));config[_0x91f2('0x7')]=_[_0x91f2('0x8')](config[_0x91f2('0x7')],{'host':_0x91f2('0x9'),'port':0x18eb});var io=require(_0x91f2('0xa'))(new Redis(config['redis']));function getAuthToken(_0xcd1395,_0x137728,_0x34fba3){if(_0xcd1395[_0x91f2('0xb')]){_0xcd1395[_0x91f2('0xc')]=_0xcd1395[_0x91f2('0xd')][_0x91f2('0xe')];_0xcd1395[_0x91f2('0xf')]=_0xcd1395[_0x91f2('0xd')][_0x91f2('0x10')];return Promise[_0x91f2('0x11')](_0xcd1395[_0x91f2('0xd')][_0x91f2('0x12')]);}var _0x3dfafe={'method':_0x91f2('0x13'),'uri':_0x137728,'form':{'client_id':_0xcd1395[_0x91f2('0x14')],'resource':_0xcd1395[_0x91f2('0xc')],'username':_0xcd1395[_0x91f2('0x15')],'password':_0xcd1395[_0x91f2('0x16')],'grant_type':_0x91f2('0x16'),'client_secret':_0xcd1395['clientSecret']},'json':!![]};return rp(_0x3dfafe)[_0x91f2('0x17')](function(_0x1db403){return _0x1db403['access_token'];})[_0x91f2('0x18')](function(_0x15da02){logger[_0x91f2('0x19')]('['+[_0x34fba3[_0x91f2('0x1a')]()]+_0x91f2('0x1b'));return _0x15da02[_0x91f2('0x1c')];});}function getUser(_0x55894d,_0x53ddfe,_0x40f199,_0x5a2bae,_0x4c2ca6,_0x3c3d19){return new Promise(function(_0x1ec4ce,_0x2ae0f9){return getAuthToken(_0x53ddfe,_0x5a2bae,_0x3c3d19)[_0x91f2('0x17')](function(_0x9c81b6){var _0x3eb96c={'method':'GET','uri':_0x4c2ca6+_0x91f2('0x1d'),'headers':{'Authorization':_0x91f2('0x1e')+_0x9c81b6,'OData-Version':_0x91f2('0x1f')},'json':!![]};return rp(_0x3eb96c);})[_0x91f2('0x17')](function(_0x1f60cd){var _0x2a795f=_0x1f60cd[_0x91f2('0x20')];var _0x2bbe6d=![];var _0x494cb7=null;if(!_[_0x91f2('0x21')](_0x40f199)){if(intUtil[_0x91f2('0x22')](_0x40f199[_0x91f2('0x23')])){_0x55894d[_0x91f2('0x24')]=_0x40f199[_0x91f2('0x23')];for(_0x494cb7=0x0;_0x494cb7<_0x2a795f[_0x91f2('0x25')];_0x494cb7++){if(_0x2a795f[_0x494cb7][_0x91f2('0x26')]===_0x40f199[_0x91f2('0x23')]&&!_0x2a795f[_0x494cb7][_0x91f2('0x27')]){_0x2bbe6d=!![];logger['info']('['+[_0x3c3d19['toUpperCase']()]+_0x91f2('0x28')+_0x2a795f[_0x494cb7]['systemuserid']+'!');_0x55894d[_0x91f2('0x29')]=_0x2a795f[_0x494cb7][_0x91f2('0x2a')];}}}}if(!_0x2bbe6d){logger[_0x91f2('0x2b')]('['+[_0x3c3d19[_0x91f2('0x1a')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x55894d[_0x91f2('0x24')]=_0x53ddfe[_0x91f2('0x15')];for(_0x494cb7=0x0;_0x494cb7<_0x2a795f['length'];_0x494cb7++){if(_0x2a795f[_0x494cb7]['internalemailaddress']===_0x53ddfe[_0x91f2('0x15')]){_0x55894d[_0x91f2('0x29')]=_0x2a795f[_0x494cb7][_0x91f2('0x2a')];}}}_0x1ec4ce(_0x55894d);})[_0x91f2('0x18')](function(_0x3ab28c){_0x2ae0f9(_0x3ab28c[_0x91f2('0x1c')]);});});}function createEndUser(_0x3de214,_0x390674,_0x15cb5c,_0x1dd53f,_0x7a3f7d,_0x5076ce,_0x29fbfc){return new Promise(function(_0x4c5eac,_0x1244b7){return getAuthToken(_0x390674,_0x15cb5c,_0x5076ce)[_0x91f2('0x17')](function(_0x49f5df){var _0xbb06eb=_0x5076ce[_0x91f2('0x2c')]()===_0x91f2('0x2d')?_0x7a3f7d[_0x91f2('0x2e')]:_0x7a3f7d[_0x91f2('0x2f')];var _0x3a814e={'method':'POST','uri':_0x1dd53f+'contacts','body':{'fullname':_0xbb06eb,'firstname':_0xbb06eb,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x91f2('0x30')+_0x3de214[_0x91f2('0x29')]+')'},'headers':{'Authorization':_0x91f2('0x1e')+_0x49f5df,'OData-Version':_0x91f2('0x1f')},'json':!![],'resolveWithFullResponse':!![]};_0x3a814e[_0x91f2('0x31')][_0x29fbfc]=_0xbb06eb;return rp(_0x3a814e);})[_0x91f2('0x17')](function(_0x29ca2d){var _0x4cdd78=_0x29ca2d['headers'][_0x91f2('0x32')];var _0x95ae26=_0x4cdd78[_0x91f2('0x33')](_0x4cdd78[_0x91f2('0x34')]('(')+0x1,_0x4cdd78[_0x91f2('0x34')](')'));_0x3de214[_0x91f2('0x35')]=_0x95ae26;_0x4c5eac(_0x3de214);})['catch'](function(_0x301436){_0x1244b7(_0x301436[_0x91f2('0x1c')]);});});}function getEndUser(_0x5259b5,_0x4e2de7,_0x4aeb93,_0x3ed1f4,_0x4c722c,_0x48ccb0,_0x259a43,_0x9533fd){var _0x48012f=_0x48ccb0[_0x91f2('0x2c')]()===_0x91f2('0x2d')?_0x4c722c[_0x91f2('0x2e')]:_0x4c722c['calleridnum'];return getAuthToken(_0x4e2de7,_0x4aeb93,_0x48ccb0)[_0x91f2('0x17')](function(_0x1cdf15){_0x9533fd=_0x9533fd?_0x9533fd:_0x91f2('0x36');var _0x3a83f2={'method':_0x91f2('0x37'),'uri':_0x3ed1f4+_0x91f2('0x38')+_0x9533fd+'&$filter='+_0x9533fd+_0x91f2('0x39')+_0x48012f[_0x91f2('0x3a')]('+',_0x91f2('0x3b'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1cdf15,'If-None-Match':null,'OData-Version':_0x91f2('0x1f')},'json':!![]};return rp(_0x3a83f2);})[_0x91f2('0x17')](function(_0x3a87b4){var _0x4e47e5=![];if(!_0x3a87b4)return _0x4e47e5;var _0x120ffb=_0x3a87b4[_0x91f2('0x20')];for(var _0x24907c=0x0;_0x24907c<_0x120ffb[_0x91f2('0x25')];_0x24907c++){if(_0x120ffb[_0x24907c][_0x9533fd]===_0x48012f){_0x4e47e5=!![];_0x5259b5[_0x91f2('0x35')]=_0x120ffb[_0x24907c]['contactid'];}}return _0x4e47e5;})[_0x91f2('0x17')](function(_0x1a4f9c){if(_0x1a4f9c)return _0x5259b5;if(_0x259a43===_0x91f2('0x3c')){logger[_0x91f2('0x2b')]('['+[_0x48ccb0[_0x91f2('0x1a')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x5259b5;}return createEndUser(_0x5259b5,_0x4e2de7,_0x4aeb93,_0x3ed1f4,_0x4c722c,_0x48ccb0,_0x9533fd)['then'](function(_0x3fe130){logger['info']('['+[_0x48ccb0['toUpperCase']()]+']\x20Enduser\x20created!',_0x3fe130[_0x91f2('0x35')]);return _0x3fe130;});});}function getCustomFields(_0x2556c1,_0x519681,_0x4958b7){var _0x32c7de={};if(_0x2556c1[_0x91f2('0x25')]>0x0){_['forEach'](_0x2556c1,function(_0x132b6d){if(_[_0x91f2('0x3d')]([_0x91f2('0x3e'),_0x91f2('0x3f')],_0x132b6d[_0x91f2('0x40')])&&_0x132b6d[_0x91f2('0x41')]&&!_0x132b6d['customField']){var _0x270cf7=_0x132b6d[_0x91f2('0x42')][_0x91f2('0x2c')]();var _0x2a7e99=_0x270cf7[_0x91f2('0x33')](0x0,_0x270cf7['indexOf']('_'));var _0x29cf55=_0x270cf7[_0x91f2('0x33')](_0x270cf7[_0x91f2('0x43')]('_')+0x1);if(_0x2a7e99===_0x4958b7){_0x32c7de[_0x29cf55]=_0x132b6d[_0x91f2('0x44')];}}});}return _0x32c7de;}function getTicket(_0x150086,_0x5516dd,_0x4b4a25,_0x126164,_0x11f142,_0x436829,_0x3c9600){return new Promise(function(_0x1128b8,_0xd83fc6){var _0x1c710e;return getAuthToken(_0x5516dd,_0x4b4a25,_0x3c9600)[_0x91f2('0x17')](function(_0x22e72e){if(_0x436829[_0x91f2('0x45')]===_0x91f2('0x46')){_0x1c710e={'method':_0x91f2('0x13'),'uri':_0x126164+_0x91f2('0x47'),'body':Object[_0x91f2('0x48')]({},{'title':intUtil[_0x91f2('0x49')](_0x436829[_0x91f2('0x4a')],_0x11f142,'\x20'),'description':intUtil[_0x91f2('0x49')](_0x436829[_0x91f2('0x4b')],_0x11f142,'\x0a'),'customerid_contact@odata.bind':_0x150086[_0x91f2('0x35')]?'/contacts('+_0x150086[_0x91f2('0x35')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x150086['userId']+')','caseorigincode':'1'},getCustomFields(_0x436829[_0x91f2('0x4c')],_0x11f142,_0x436829[_0x91f2('0x45')])),'headers':{'Authorization':'Bearer\x20'+_0x22e72e,'OData-Version':_0x91f2('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x436829[_0x91f2('0x45')]===_0x91f2('0x4d')){var _0x4e3907=_0x150086['enduserId']?[{'partyid_systemuser@odata.bind':_0x91f2('0x30')+_0x150086[_0x91f2('0x29')]+')','participationtypemask':_0x150086[_0x91f2('0x4e')]===_0x91f2('0x4f')?0x2:0x1},{'partyid_contact@odata.bind':_0x91f2('0x50')+_0x150086[_0x91f2('0x35')]+')','participationtypemask':_0x150086[_0x91f2('0x4e')]===_0x91f2('0x4f')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x150086['userId']+')','participationtypemask':_0x150086['callDirection']===_0x91f2('0x4f')?0x2:0x1}];_0x1c710e={'method':_0x91f2('0x13'),'uri':_0x126164+_0x91f2('0x51'),'body':Object[_0x91f2('0x48')]({},{'subject':intUtil[_0x91f2('0x49')](_0x436829['Subjects'],_0x11f142,'\x20'),'phonenumber':String(_0x11f142[_0x91f2('0x2f')]),'description':intUtil['getString'](_0x436829[_0x91f2('0x4b')],_0x11f142,'\x0a'),'regardingobjectid_contact@odata.bind':_0x150086['enduserId']?_0x91f2('0x50')+_0x150086['enduserId']+')':undefined,'ownerid@odata.bind':_0x91f2('0x30')+_0x150086[_0x91f2('0x29')]+')','directioncode':_0x150086[_0x91f2('0x4e')]===_0x91f2('0x4f')?![]:!![],'phonecall_activity_parties':_0x4e3907},getCustomFields(_0x436829['Fields'],_0x11f142,_0x436829['ticketType'])),'headers':{'Authorization':_0x91f2('0x1e')+_0x22e72e,'OData-Version':_0x91f2('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1c710e);})[_0x91f2('0x17')](function(_0x3488a2){var _0x3e794f=_0x3488a2['headers'][_0x91f2('0x32')];var _0x37c355=_0x3e794f[_0x91f2('0x33')](_0x3e794f['lastIndexOf']('(')+0x1,_0x3e794f[_0x91f2('0x34')](')'));_0x150086[_0x91f2('0x52')]=_0x37c355;_0x1128b8(_0x150086);})[_0x91f2('0x18')](function(_0x25592f){_0xd83fc6(_0x25592f['message']);});});}function emit(_0x4adbe6,_0x319d9e,_0xb19e8c,_0x464b8b){var _0x551239={'uri':util[_0x91f2('0x53')](_0x91f2('0x54'),_0x4adbe6,_0xb19e8c,_0x464b8b)};io['to'](util[_0x91f2('0x53')](_0x91f2('0x55'),_0x319d9e))[_0x91f2('0x56')]('trigger:browser:url',_0x551239);}exports['cs']=function(_0x319f01,_0x3960ec,_0x438115,_0x1ea484,_0x2276d7,_0x1bcbc9,_0x1cfba3,_0x4ebeb7){var _0x3f6c79={};_0x1bcbc9['remoteUri']=_0x1bcbc9[_0x91f2('0xb')]?intUtil['stripTrailingSlash'](_0x1bcbc9[_0x91f2('0xd')][_0x91f2('0xe')]):intUtil[_0x91f2('0x57')](_0x1bcbc9['remoteUri']);_0x1bcbc9[_0x91f2('0x58')]=intUtil[_0x91f2('0x57')](_0x1bcbc9[_0x91f2('0x58')]);_0x3f6c79[_0x91f2('0x4e')]=_0x4ebeb7==='queue'||_0x4ebeb7==='unmanaged'?_0x91f2('0x4f'):_0x91f2('0x2d');var _0x400ff8=_0x1bcbc9[_0x91f2('0xb')]?util['format'](_0x91f2('0x59'),_0x1bcbc9[_0x91f2('0xd')][_0x91f2('0xe')]):util[_0x91f2('0x53')](_0x91f2('0x59'),_0x1bcbc9[_0x91f2('0xc')]);var _0x24a35b=util[_0x91f2('0x53')](_0x91f2('0x5a'),_0x1bcbc9['tenantId']);var _0x144eab=util[_0x91f2('0x53')](_0x91f2('0x5b'),_0x1bcbc9[_0x91f2('0x58')],_0x3960ec[_0x91f2('0x5c')],md5(_0x3960ec[_0x91f2('0x5c')]));if(_0x2276d7&&_0x2276d7[_0x91f2('0x5d')]){logger[_0x91f2('0x2b')]('[QUEUE]',_0x91f2('0x5e'));_0x3960ec[_0x91f2('0x5f')]=_0x144eab;}else if(_0x1cfba3&&_0x1cfba3[_0x91f2('0x60')]&&_0x1cfba3[_0x91f2('0x60')]!==_0x91f2('0x61')){logger[_0x91f2('0x2b')]('[OUTBOUND]',_0x91f2('0x5e'));_0x3960ec[_0x91f2('0x5f')]=_0x144eab;}else{_0x3960ec[_0x91f2('0x5f')]='';}return getUser(_0x3f6c79,_0x1bcbc9,_0x1ea484,_0x24a35b,_0x400ff8,_0x4ebeb7)['then'](function(_0x384192){logger[_0x91f2('0x2b')]('['+_0x4ebeb7[_0x91f2('0x1a')]()+_0x91f2('0x62'),_0x384192[_0x91f2('0x29')]);logger[_0x91f2('0x2b')]('['+_0x4ebeb7['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x384192[_0x91f2('0x24')]);return getEndUser(_0x384192,_0x1bcbc9,_0x24a35b,_0x400ff8,_0x3960ec,_0x4ebeb7,_0x438115['moduleCreate'],_0x438115['additionalSearchContact']);})[_0x91f2('0x17')](function(_0xc284c4){logger[_0x91f2('0x2b')]('['+_0x4ebeb7['toUpperCase']()+_0x91f2('0x63'),_0xc284c4[_0x91f2('0x35')]);logger[_0x91f2('0x2b')]('['+_0x4ebeb7['toUpperCase']()+_0x91f2('0x64'),_0x3960ec[_0x91f2('0x2f')]);return getTicket(_0xc284c4,_0x1bcbc9,_0x24a35b,_0x400ff8,_0x3960ec,_0x438115,_0x4ebeb7);})[_0x91f2('0x17')](function(_0x4d2c84){logger[_0x91f2('0x2b')](util['format']('['+_0x4ebeb7[_0x91f2('0x1a')]()+_0x91f2('0x65'),_0x438115[_0x91f2('0x45')],_0x4d2c84[_0x91f2('0x52')]));logger[_0x91f2('0x2b')](util[_0x91f2('0x53')]('['+_0x4ebeb7[_0x91f2('0x1a')]()+_0x91f2('0x66'),_0x4ebeb7));if(_0x4ebeb7!=='unmanaged'&&_0x438115[_0x91f2('0x67')]){logger[_0x91f2('0x2b')]('['+_0x4ebeb7[_0x91f2('0x1a')]()+']',_0x91f2('0x68'));emit(_0x1bcbc9[_0x91f2('0xc')],_0x1ea484[_0x91f2('0x69')],_0x438115[_0x91f2('0x45')],_0x4d2c84[_0x91f2('0x52')]);}})[_0x91f2('0x18')](function(_0xba82b8){logger[_0x91f2('0x19')]('['+_0x4ebeb7['toUpperCase']()+_0x91f2('0x6a'),_0xba82b8[_0x91f2('0x1c')]);console[_0x91f2('0x19')](_0x91f2('0x6b'),_0xba82b8);});}; \ 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 439ccae..0debf82 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 _0xa827=['base64','debug','stringify','GET','forEach','includes','string','type','nameField','toLowerCase','content','idField','customField','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Authorization','destcalleridname','destcalleridnum','catch','monitor_format','lastevent','toUpperCase','error','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','Creating\x20new\x20ticket...','merge','format','calleridname','getString','Descriptions','
','Tags','name','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','toString'];(function(_0x5b89a0,_0x315a2a){var _0x44d81a=function(_0x2529f4){while(--_0x2529f4){_0x5b89a0['push'](_0x5b89a0['shift']());}};_0x44d81a(++_0x315a2a);}(_0xa827,0xe3));var _0x7a82=function(_0x59e39e,_0xe0bff8){_0x59e39e=_0x59e39e-0x0;var _0x25fb72=_0xa827[_0x59e39e];return _0x25fb72;};'use strict';var _=require(_0x7a82('0x0'));var rp=require('request-promise');var md5=require(_0x7a82('0x1'));var util=require(_0x7a82('0x2'));var Redis=require(_0x7a82('0x3'));var intUtil=require(_0x7a82('0x4'));var config=require(_0x7a82('0x5'));var logger=require(_0x7a82('0x6'))(_0x7a82('0x7'));config['redis']=_[_0x7a82('0x8')](config[_0x7a82('0x9')],{'host':_0x7a82('0xa'),'port':0x18eb});var io=require(_0x7a82('0xb'))(new Redis(config[_0x7a82('0x9')]));var headers={'Content-Type':_0x7a82('0xc'),'Accept':_0x7a82('0xc')};function emit(_0x2610bd,_0x4bbd35,_0x29623f){io['to'](_0x2610bd)['emit'](_0x4bbd35,_0x29623f);}function getTicket(_0x308723,_0x442770,_0x28e302,_0x4cf80c,_0x2d0ce2){logger['info'](_0x7a82('0xd'));var _0x5ab030=_[_0x7a82('0xe')]({'responder_id':_0x442770['id'],'requester_id':_0x28e302['id'],'name':util[_0x7a82('0xf')]('Caller\x20-\x20%s',_0x2d0ce2[_0x7a82('0x10')]),'phone':_0x2d0ce2['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x7a82('0x11')](_0x4cf80c['Subjects'],_0x2d0ce2,'\x20'),'description':intUtil['getString'](_0x4cf80c[_0x7a82('0x12')],_0x2d0ce2,_0x7a82('0x13')),'tags':getTags(_0x4cf80c[_0x7a82('0x14')],_0x7a82('0x15'))},getCustomFields(_0x4cf80c['Fields'],_0x2d0ce2));_0x5ab030[_0x7a82('0x16')]=_[_0x7a82('0x17')](_[_0x7a82('0x18')](_0x5ab030[_0x7a82('0x16')],'id'),_0x7a82('0x19'));return request({'uri':util[_0x7a82('0xf')](_0x7a82('0x1a'),_0x308723[_0x7a82('0x1b')]),'method':_0x7a82('0x1c'),'body':_0x5ab030})[_0x7a82('0x1d')](function(_0x20a68f){logger[_0x7a82('0x1e')](_0x7a82('0x1f'));return _0x20a68f;});}function getUser(_0x3e7b3c,_0x4f8ae6){if(intUtil[_0x7a82('0x20')](_0x4f8ae6)){return request({'uri':util['format'](_0x7a82('0x21'),_0x3e7b3c['remoteUri']),'qs':{'email':_0x4f8ae6}})[_0x7a82('0x1d')](function(_0x39c084){if(_0x39c084[_0x7a82('0x22')]){logger['info'](_0x7a82('0x23'));return _['find'](_0x39c084,function(_0x32afda){return _0x32afda[_0x7a82('0x24')][_0x7a82('0x25')]===_0x4f8ae6;});}else{logger[_0x7a82('0x1e')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x7a82('0xf')](_0x7a82('0x26'),_0x3e7b3c[_0x7a82('0x1b')])})['then'](function(_0x4b64f1){logger[_0x7a82('0x1e')](_0x7a82('0x27'));return _0x4b64f1;});}});}else{logger[_0x7a82('0x1e')](_0x7a82('0x28'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x3e7b3c[_0x7a82('0x1b')])})[_0x7a82('0x1d')](function(_0x31308c){logger[_0x7a82('0x1e')](_0x7a82('0x27'));return _0x31308c;});}}function getEndUser(_0x2df98e,_0x503374,_0x2658d4){logger[_0x7a82('0x1e')]('Searching\x20enduser\x20with\x20phone',_0x2658d4);return request({'uri':util['format'](_0x7a82('0x29'),_0x2df98e[_0x7a82('0x1b')]),'qs':{'phone':_0x2658d4}})[_0x7a82('0x1d')](function(_0x1fd493){if(_0x1fd493[_0x7a82('0x22')]){logger[_0x7a82('0x1e')]('Enduser\x20found!');return _[_0x7a82('0x2a')](_0x1fd493,{'phone':_0x2658d4});}else{logger[_0x7a82('0x1e')](_0x7a82('0x2b'));return request({'uri':util[_0x7a82('0xf')](_0x7a82('0x29'),_0x2df98e[_0x7a82('0x1b')]),'method':_0x7a82('0x1c'),'body':{'name':_0x503374,'phone':_0x2658d4}})['then'](function(_0x3d6213){logger[_0x7a82('0x1e')]('Enduser\x20created.');return _0x3d6213;});}});}function getAuth(_0x4df652){return util['format'](_0x7a82('0x2c'),new Buffer(_0x4df652['apiKey']+':X')[_0x7a82('0x2d')](_0x7a82('0x2e')));}function request(_0x2caaa2){logger[_0x7a82('0x2f')]('[HTTP]',JSON[_0x7a82('0x30')](_0x2caaa2));return rp(_[_0x7a82('0x8')](_0x2caaa2,{'method':_0x7a82('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x1af906,_0x2a67d5){var _0x1cad1a=[];if(_0x1af906&&_0x1af906[_0x7a82('0x22')]>0x0){_0x1cad1a=_['map'](_0x1af906,_0x2a67d5);}return _0x1cad1a;}function getCustomFields(_0x35789f,_0x1cf0f5){var _0x5e1af5=[];var _0xabfad7={'custom_fields':[]};if(_0x35789f[_0x7a82('0x22')]>0x0){_[_0x7a82('0x32')](_0x35789f,function(_0x3fe7d2){if(_[_0x7a82('0x33')]([_0x7a82('0x34'),'picklist'],_0x3fe7d2[_0x7a82('0x35')])&&_0x3fe7d2[_0x7a82('0x36')]&&!_0x3fe7d2['customField']){_0xabfad7[_0x3fe7d2[_0x7a82('0x36')][_0x7a82('0x37')]()]=_0x3fe7d2[_0x7a82('0x38')][_0x7a82('0x2d')]();}else if(_['includes']([_0x7a82('0x34'),'picklist'],_0x3fe7d2[_0x7a82('0x35')])&&_0x3fe7d2[_0x7a82('0x39')]&&_0x3fe7d2[_0x7a82('0x3a')]){_0xabfad7[_0x7a82('0x16')][_0x7a82('0x3b')]({'id':_0x3fe7d2[_0x7a82('0x39')],'value':_0x3fe7d2[_0x7a82('0x38')][_0x7a82('0x2d')]()});}else if(_0x3fe7d2[_0x7a82('0x35')]===_0x7a82('0x3c')&&_0x3fe7d2[_0x7a82('0x3d')]&&_0x3fe7d2['idField']&&_0x3fe7d2[_0x7a82('0x3a')]){_0x1cf0f5[_0x3fe7d2[_0x7a82('0x3d')]]&&_0xabfad7[_0x7a82('0x16')][_0x7a82('0x3b')]({'id':_0x3fe7d2['idField'],'value':_0x1cf0f5[_0x3fe7d2[_0x7a82('0x3d')]][_0x7a82('0x2d')]()});}else if(_0x3fe7d2[_0x7a82('0x35')]==='customVariable'&&_0x3fe7d2[_0x7a82('0x3e')]&&_0x3fe7d2[_0x7a82('0x3e')][_0x7a82('0x15')]&&_0x3fe7d2['idField']&&_0x3fe7d2[_0x7a82('0x3a')]){_0x1cf0f5[_0x3fe7d2['Variable'][_0x7a82('0x15')][_0x7a82('0x37')]()]&&_0xabfad7[_0x7a82('0x16')][_0x7a82('0x3b')]({'id':_0x3fe7d2[_0x7a82('0x39')],'value':_0x1cf0f5[_0x3fe7d2[_0x7a82('0x3e')]['name'][_0x7a82('0x37')]()]['toString']()});}});}return _0xabfad7;}exports[_0x7a82('0x3f')]=function(_0x532b2b,_0x35125c,_0x2110f5,_0x55ce37,_0x4febb4,_0x7be149){var _0x3e8eb2,_0x30de1a;_0x7be149[_0x7a82('0x1b')]=intUtil[_0x7a82('0x40')](_0x7be149[_0x7a82('0x1b')]);_0x7be149[_0x7a82('0x41')]=intUtil[_0x7a82('0x40')](_0x7be149[_0x7a82('0x41')]);if(_0x4febb4&&_0x4febb4['monitor_format']){logger[_0x7a82('0x1e')](_0x7a82('0x42'),'Recording\x20is\x20enabled!');_0x35125c[_0x7a82('0x43')]=util[_0x7a82('0xf')](_0x7a82('0x44'),_0x7be149[_0x7a82('0x41')],_0x35125c[_0x7a82('0x45')],md5(_0x35125c[_0x7a82('0x45')]));}else{_0x35125c[_0x7a82('0x43')]='';}headers['Authorization']=getAuth(_0x7be149);return getUser(_0x7be149,_0x55ce37[_0x7a82('0x25')])[_0x7a82('0x1d')](function(_0x2c1649){_0x3e8eb2=_0x2c1649;logger[_0x7a82('0x1e')](_0x7a82('0x46'),_0x3e8eb2['id']);return getEndUser(_0x7be149,_0x35125c[_0x7a82('0x10')],_0x35125c[_0x7a82('0x47')]);})[_0x7a82('0x1d')](function(_0x1e26c1){_0x30de1a=_0x1e26c1;logger['info'](_0x7a82('0x48'),_0x30de1a['id']);return getTicket(_0x7be149,_0x3e8eb2,_0x30de1a,_0x2110f5,_0x35125c);})[_0x7a82('0x1d')](function(_0x358202){if(_0x358202&&_0x358202['id']){logger['info'](_0x7a82('0x1f'));logger['info'](_0x7a82('0x49'),_0x358202['id']);logger[_0x7a82('0x1e')](_0x7a82('0x42'),_0x7a82('0x4a'));emit(util[_0x7a82('0xf')](_0x7a82('0x4b'),_0x55ce37[_0x7a82('0x15')]),_0x7a82('0x4c'),{'uri':util['format'](_0x7a82('0x4d'),_0x7be149[_0x7a82('0x1b')],_0x358202['id'])});}})['catch'](function(_0x7e5917){logger['error'](_0x7a82('0x42'),JSON[_0x7a82('0x30')](_0x7e5917));});};exports[_0x7a82('0x4e')]=function(_0x10223c,_0x1d14aa,_0x5acc3b,_0x215a65,_0x48089e,_0x5f1ff3,_0x3b86d2){var _0x561f99,_0x3ec4bd;_0x5f1ff3['remoteUri']=intUtil['stripTrailingSlash'](_0x5f1ff3[_0x7a82('0x1b')]);_0x5f1ff3[_0x7a82('0x41')]=intUtil['stripTrailingSlash'](_0x5f1ff3[_0x7a82('0x41')]);if(_0x3b86d2&&_0x3b86d2[_0x7a82('0x4f')]&&_0x3b86d2[_0x7a82('0x4f')]!==_0x7a82('0x50')){logger['info'](_0x7a82('0x51'),_0x7a82('0x52'));_0x1d14aa[_0x7a82('0x43')]=util[_0x7a82('0xf')](_0x7a82('0x44'),_0x5f1ff3[_0x7a82('0x41')],_0x1d14aa[_0x7a82('0x45')],md5(_0x1d14aa[_0x7a82('0x45')]));}headers[_0x7a82('0x53')]=getAuth(_0x5f1ff3);return getUser(_0x5f1ff3,_0x215a65[_0x7a82('0x25')])[_0x7a82('0x1d')](function(_0x4aec18){_0x561f99=_0x4aec18;logger[_0x7a82('0x1e')](_0x7a82('0x46'),_0x561f99['id']);return getEndUser(_0x5f1ff3,_0x1d14aa[_0x7a82('0x54')],_0x1d14aa[_0x7a82('0x55')]);})[_0x7a82('0x1d')](function(_0x3ae948){_0x3ec4bd=_0x3ae948;logger[_0x7a82('0x1e')]('The\x20Enduser\x20ID\x20is:',_0x3ec4bd['id']);return getTicket(_0x5f1ff3,_0x561f99,_0x3ec4bd,_0x5acc3b,_0x1d14aa);})[_0x7a82('0x1d')](function(_0xaf7074){if(_0xaf7074&&_0xaf7074['id']){logger[_0x7a82('0x1e')](_0x7a82('0x1f'));logger['info'](_0x7a82('0x49'),_0xaf7074['id']);logger[_0x7a82('0x1e')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7a82('0xf')](_0x7a82('0x4b'),_0x215a65[_0x7a82('0x15')]),_0x7a82('0x4c'),{'uri':util[_0x7a82('0xf')]('%s/helpdesk/tickets/%d',_0x5f1ff3[_0x7a82('0x1b')],_0xaf7074['id'])});}})[_0x7a82('0x56')](function(_0x2ede41){logger['error'](_0x7a82('0x51'),JSON[_0x7a82('0x30')](_0x2ede41));});};exports['unmanaged']=function(_0x3bba89,_0x22311d,_0x122cdf,_0x1a9868,_0x1af4a6,_0x532026){var _0x200058,_0x593d07;_0x532026['remoteUri']=intUtil[_0x7a82('0x40')](_0x532026[_0x7a82('0x1b')]);_0x532026[_0x7a82('0x41')]=intUtil['stripTrailingSlash'](_0x532026[_0x7a82('0x41')]);if(_0x1af4a6&&_0x1af4a6[_0x7a82('0x57')]){logger[_0x7a82('0x1e')]('['+_0x22311d[_0x7a82('0x58')][_0x7a82('0x59')]()+']',_0x7a82('0x52'));_0x22311d[_0x7a82('0x43')]=util[_0x7a82('0xf')](_0x7a82('0x44'),_0x532026['serverUrl'],_0x22311d[_0x7a82('0x45')],md5(_0x22311d[_0x7a82('0x45')]));}else{_0x22311d[_0x7a82('0x43')]='';}headers[_0x7a82('0x53')]=getAuth(_0x532026);return getUser(_0x532026,'')[_0x7a82('0x1d')](function(_0x4736b0){_0x200058=_0x4736b0;logger[_0x7a82('0x1e')](_0x7a82('0x46'),_0x200058['id']);return getEndUser(_0x532026,_0x22311d[_0x7a82('0x10')],_0x22311d[_0x7a82('0x47')]);})['then'](function(_0x4107e9){_0x593d07=_0x4107e9;logger['info'](_0x7a82('0x48'),_0x593d07['id']);return getTicket(_0x532026,_0x200058,_0x593d07,_0x122cdf,_0x22311d);})[_0x7a82('0x1d')](function(_0x38dd86){if(_0x38dd86){logger[_0x7a82('0x1e')]('Ticket\x20created!');logger['info'](_0x7a82('0x49'),_0x38dd86['id']);}})[_0x7a82('0x56')](function(_0x2abbd6){logger[_0x7a82('0x5a')]('['+_0x22311d[_0x7a82('0x58')][_0x7a82('0x59')]()+']',JSON[_0x7a82('0x30')](_0x2abbd6));});}; \ No newline at end of file +var _0x4ceb=['length','Agent\x20found!','find','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','%s/api/v2/contacts','Enduser\x20created.','apiKey','toString','base64','debug','stringify','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','push','variable','variableName','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','lodash','request-promise','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','remoteUri','POST','then','Ticket\x20created!','format','%s/api/v2/agents'];(function(_0x1d695f,_0x4d8dc8){var _0x5987b5=function(_0x48dca0){while(--_0x48dca0){_0x1d695f['push'](_0x1d695f['shift']());}};_0x5987b5(++_0x4d8dc8);}(_0x4ceb,0x18c));var _0xb4ce=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x4ceb[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0xb4ce('0x0'));var rp=require(_0xb4ce('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xb4ce('0x2'));var config=require(_0xb4ce('0x3'));var logger=require(_0xb4ce('0x4'))(_0xb4ce('0x5'));config[_0xb4ce('0x6')]=_[_0xb4ce('0x7')](config[_0xb4ce('0x6')],{'host':_0xb4ce('0x8'),'port':0x18eb});var io=require(_0xb4ce('0x9'))(new Redis(config[_0xb4ce('0x6')]));var headers={'Content-Type':_0xb4ce('0xa'),'Accept':'application/json'};function emit(_0x27b5c8,_0x19815a,_0x22bbc3){io['to'](_0x27b5c8)[_0xb4ce('0xb')](_0x19815a,_0x22bbc3);}function getTicket(_0x273813,_0x382efa,_0x5ede5d,_0x3ac813,_0xcf3c8a){logger[_0xb4ce('0xc')](_0xb4ce('0xd'));var _0x328c17=_[_0xb4ce('0xe')]({'responder_id':_0x382efa['id'],'requester_id':_0x5ede5d['id'],'name':util['format'](_0xb4ce('0xf'),_0xcf3c8a[_0xb4ce('0x10')]),'phone':_0xcf3c8a[_0xb4ce('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xb4ce('0x12')](_0x3ac813[_0xb4ce('0x13')],_0xcf3c8a,'\x20'),'description':intUtil[_0xb4ce('0x12')](_0x3ac813['Descriptions'],_0xcf3c8a,_0xb4ce('0x14')),'tags':getTags(_0x3ac813[_0xb4ce('0x15')],_0xb4ce('0x16'))},getCustomFields(_0x3ac813[_0xb4ce('0x17')],_0xcf3c8a));_0x328c17[_0xb4ce('0x18')]=_[_0xb4ce('0x19')](_[_0xb4ce('0x1a')](_0x328c17['custom_fields'],'id'),_0xb4ce('0x1b'));return request({'uri':util['format']('%s/api/v2/tickets',_0x273813[_0xb4ce('0x1c')]),'method':_0xb4ce('0x1d'),'body':_0x328c17})[_0xb4ce('0x1e')](function(_0x286a72){logger[_0xb4ce('0xc')](_0xb4ce('0x1f'));return _0x286a72;});}function getUser(_0x2757fa,_0x505b73){if(intUtil['validateEmail'](_0x505b73)){return request({'uri':util[_0xb4ce('0x20')](_0xb4ce('0x21'),_0x2757fa[_0xb4ce('0x1c')]),'qs':{'email':_0x505b73}})['then'](function(_0x1dffd){if(_0x1dffd[_0xb4ce('0x22')]){logger['info'](_0xb4ce('0x23'));return _[_0xb4ce('0x24')](_0x1dffd,function(_0x19df4e){return _0x19df4e['contact'][_0xb4ce('0x25')]===_0x505b73;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xb4ce('0x20')](_0xb4ce('0x26'),_0x2757fa['remoteUri'])})['then'](function(_0xbb629f){logger[_0xb4ce('0xc')](_0xb4ce('0x27'));return _0xbb629f;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xb4ce('0x20')](_0xb4ce('0x26'),_0x2757fa[_0xb4ce('0x1c')])})['then'](function(_0x5ddf0c){logger[_0xb4ce('0xc')]('Admin\x20account\x20selected.');return _0x5ddf0c;});}}function getEndUser(_0x505252,_0x2d1ee9,_0x5f01ad){logger[_0xb4ce('0xc')]('Searching\x20enduser\x20with\x20phone',_0x5f01ad);return request({'uri':util[_0xb4ce('0x20')]('%s/api/v2/contacts',_0x505252[_0xb4ce('0x1c')]),'qs':{'phone':_0x5f01ad}})[_0xb4ce('0x1e')](function(_0x4fddb1){if(_0x4fddb1['length']){logger[_0xb4ce('0xc')]('Enduser\x20found!');return _[_0xb4ce('0x24')](_0x4fddb1,{'phone':_0x5f01ad});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xb4ce('0x20')](_0xb4ce('0x28'),_0x505252[_0xb4ce('0x1c')]),'method':'POST','body':{'name':_0x2d1ee9,'phone':_0x5f01ad}})[_0xb4ce('0x1e')](function(_0x1f411f){logger['info'](_0xb4ce('0x29'));return _0x1f411f;});}});}function getAuth(_0x123a0f){return util[_0xb4ce('0x20')]('Basic\x20%s',new Buffer(_0x123a0f[_0xb4ce('0x2a')]+':X')[_0xb4ce('0x2b')](_0xb4ce('0x2c')));}function request(_0x101cd3){logger[_0xb4ce('0x2d')]('[HTTP]',JSON[_0xb4ce('0x2e')](_0x101cd3));return rp(_['defaults'](_0x101cd3,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x12c47b,_0x59f17a){var _0x3d6210=[];if(_0x12c47b&&_0x12c47b[_0xb4ce('0x22')]>0x0){_0x3d6210=_['map'](_0x12c47b,_0x59f17a);}return _0x3d6210;}function getCustomFields(_0x162cd4,_0xeb6f04){var _0x5df760=[];var _0x5a22a7={'custom_fields':[]};if(_0x162cd4[_0xb4ce('0x22')]>0x0){_[_0xb4ce('0x2f')](_0x162cd4,function(_0x16df3e){if(_[_0xb4ce('0x30')]([_0xb4ce('0x31'),_0xb4ce('0x32')],_0x16df3e[_0xb4ce('0x33')])&&_0x16df3e[_0xb4ce('0x34')]&&!_0x16df3e[_0xb4ce('0x35')]){_0x5a22a7[_0x16df3e[_0xb4ce('0x34')][_0xb4ce('0x36')]()]=_0x16df3e[_0xb4ce('0x37')][_0xb4ce('0x2b')]();}else if(_[_0xb4ce('0x30')]([_0xb4ce('0x31'),_0xb4ce('0x32')],_0x16df3e[_0xb4ce('0x33')])&&_0x16df3e[_0xb4ce('0x38')]&&_0x16df3e['customField']){_0x5a22a7[_0xb4ce('0x18')][_0xb4ce('0x39')]({'id':_0x16df3e['idField'],'value':_0x16df3e[_0xb4ce('0x37')][_0xb4ce('0x2b')]()});}else if(_0x16df3e[_0xb4ce('0x33')]===_0xb4ce('0x3a')&&_0x16df3e[_0xb4ce('0x3b')]&&_0x16df3e[_0xb4ce('0x38')]&&_0x16df3e[_0xb4ce('0x35')]){_0xeb6f04[_0x16df3e[_0xb4ce('0x3b')]]&&_0x5a22a7[_0xb4ce('0x18')][_0xb4ce('0x39')]({'id':_0x16df3e['idField'],'value':_0xeb6f04[_0x16df3e['variableName']][_0xb4ce('0x2b')]()});}else if(_0x16df3e[_0xb4ce('0x33')]==='customVariable'&&_0x16df3e['Variable']&&_0x16df3e[_0xb4ce('0x3c')]['name']&&_0x16df3e[_0xb4ce('0x38')]&&_0x16df3e[_0xb4ce('0x35')]){_0xeb6f04[_0x16df3e[_0xb4ce('0x3c')][_0xb4ce('0x16')]['toLowerCase']()]&&_0x5a22a7['custom_fields']['push']({'id':_0x16df3e[_0xb4ce('0x38')],'value':_0xeb6f04[_0x16df3e[_0xb4ce('0x3c')][_0xb4ce('0x16')][_0xb4ce('0x36')]()][_0xb4ce('0x2b')]()});}});}return _0x5a22a7;}exports['queue']=function(_0x308d20,_0x470117,_0x79d486,_0x11ec28,_0x2da364,_0x56320f){var _0x49dad6,_0x48cc09;_0x56320f[_0xb4ce('0x1c')]=intUtil[_0xb4ce('0x3d')](_0x56320f[_0xb4ce('0x1c')]);_0x56320f['serverUrl']=intUtil[_0xb4ce('0x3d')](_0x56320f[_0xb4ce('0x3e')]);if(_0x2da364&&_0x2da364[_0xb4ce('0x3f')]){logger[_0xb4ce('0xc')](_0xb4ce('0x40'),_0xb4ce('0x41'));_0x470117[_0xb4ce('0x42')]=util[_0xb4ce('0x20')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x56320f[_0xb4ce('0x3e')],_0x470117[_0xb4ce('0x43')],md5(_0x470117['uniqueid']));}else{_0x470117[_0xb4ce('0x42')]='';}headers[_0xb4ce('0x44')]=getAuth(_0x56320f);return getUser(_0x56320f,_0x11ec28[_0xb4ce('0x25')])[_0xb4ce('0x1e')](function(_0x32ef15){_0x49dad6=_0x32ef15;logger[_0xb4ce('0xc')](_0xb4ce('0x45'),_0x49dad6['id']);return getEndUser(_0x56320f,_0x470117[_0xb4ce('0x10')],_0x470117[_0xb4ce('0x11')]);})['then'](function(_0xf01e0b){_0x48cc09=_0xf01e0b;logger[_0xb4ce('0xc')](_0xb4ce('0x46'),_0x48cc09['id']);return getTicket(_0x56320f,_0x49dad6,_0x48cc09,_0x79d486,_0x470117);})['then'](function(_0x34b3f9){if(_0x34b3f9&&_0x34b3f9['id']){logger['info']('Ticket\x20created!');logger[_0xb4ce('0xc')]('The\x20Ticket\x20ID\x20is:',_0x34b3f9['id']);logger[_0xb4ce('0xc')](_0xb4ce('0x40'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb4ce('0x20')]('user:%s',_0x11ec28[_0xb4ce('0x16')]),'trigger:browser:url',{'uri':util['format'](_0xb4ce('0x47'),_0x56320f[_0xb4ce('0x1c')],_0x34b3f9['id'])});}})[_0xb4ce('0x48')](function(_0x1de5eb){logger[_0xb4ce('0x49')](_0xb4ce('0x40'),JSON['stringify'](_0x1de5eb));});};exports['outbound']=function(_0x228d51,_0xbfa6a9,_0xf16b3a,_0x41c73f,_0x558ba4,_0x1f6bc1,_0x214da3){var _0x9554ae,_0x1309c3;_0x1f6bc1[_0xb4ce('0x1c')]=intUtil[_0xb4ce('0x3d')](_0x1f6bc1[_0xb4ce('0x1c')]);_0x1f6bc1['serverUrl']=intUtil[_0xb4ce('0x3d')](_0x1f6bc1[_0xb4ce('0x3e')]);if(_0x214da3&&_0x214da3['recordingFormat']&&_0x214da3[_0xb4ce('0x4a')]!==_0xb4ce('0x4b')){logger[_0xb4ce('0xc')](_0xb4ce('0x4c'),'Recording\x20is\x20enabled!');_0xbfa6a9[_0xb4ce('0x42')]=util[_0xb4ce('0x20')](_0xb4ce('0x4d'),_0x1f6bc1['serverUrl'],_0xbfa6a9[_0xb4ce('0x43')],md5(_0xbfa6a9['uniqueid']));}headers[_0xb4ce('0x44')]=getAuth(_0x1f6bc1);return getUser(_0x1f6bc1,_0x41c73f[_0xb4ce('0x25')])['then'](function(_0x23bb67){_0x9554ae=_0x23bb67;logger['info']('The\x20User\x20ID\x20is:',_0x9554ae['id']);return getEndUser(_0x1f6bc1,_0xbfa6a9[_0xb4ce('0x4e')],_0xbfa6a9[_0xb4ce('0x4f')]);})[_0xb4ce('0x1e')](function(_0x1a4fe6){_0x1309c3=_0x1a4fe6;logger[_0xb4ce('0xc')](_0xb4ce('0x46'),_0x1309c3['id']);return getTicket(_0x1f6bc1,_0x9554ae,_0x1309c3,_0xf16b3a,_0xbfa6a9);})[_0xb4ce('0x1e')](function(_0x193f1c){if(_0x193f1c&&_0x193f1c['id']){logger[_0xb4ce('0xc')](_0xb4ce('0x1f'));logger[_0xb4ce('0xc')]('The\x20Ticket\x20ID\x20is:',_0x193f1c['id']);logger['info'](_0xb4ce('0x4c'),_0xb4ce('0x50'));emit(util[_0xb4ce('0x20')](_0xb4ce('0x51'),_0x41c73f[_0xb4ce('0x16')]),_0xb4ce('0x52'),{'uri':util[_0xb4ce('0x20')](_0xb4ce('0x47'),_0x1f6bc1['remoteUri'],_0x193f1c['id'])});}})[_0xb4ce('0x48')](function(_0x391353){logger[_0xb4ce('0x49')]('[OUTBOUND]',JSON[_0xb4ce('0x2e')](_0x391353));});};exports['unmanaged']=function(_0x9cf53c,_0x2812d9,_0x1de57b,_0x460c6a,_0x18d6d9,_0x48838a){var _0x5540c6,_0x1c60d0;_0x48838a[_0xb4ce('0x1c')]=intUtil[_0xb4ce('0x3d')](_0x48838a[_0xb4ce('0x1c')]);_0x48838a[_0xb4ce('0x3e')]=intUtil['stripTrailingSlash'](_0x48838a[_0xb4ce('0x3e')]);if(_0x18d6d9&&_0x18d6d9[_0xb4ce('0x3f')]){logger[_0xb4ce('0xc')]('['+_0x2812d9[_0xb4ce('0x53')][_0xb4ce('0x54')]()+']','Recording\x20is\x20enabled!');_0x2812d9[_0xb4ce('0x42')]=util[_0xb4ce('0x20')](_0xb4ce('0x4d'),_0x48838a['serverUrl'],_0x2812d9[_0xb4ce('0x43')],md5(_0x2812d9[_0xb4ce('0x43')]));}else{_0x2812d9['recordingURL']='';}headers[_0xb4ce('0x44')]=getAuth(_0x48838a);return getUser(_0x48838a,'')[_0xb4ce('0x1e')](function(_0x6c78){_0x5540c6=_0x6c78;logger[_0xb4ce('0xc')](_0xb4ce('0x45'),_0x5540c6['id']);return getEndUser(_0x48838a,_0x2812d9[_0xb4ce('0x10')],_0x2812d9[_0xb4ce('0x11')]);})[_0xb4ce('0x1e')](function(_0x267dde){_0x1c60d0=_0x267dde;logger['info']('The\x20Enduser\x20ID\x20is:',_0x1c60d0['id']);return getTicket(_0x48838a,_0x5540c6,_0x1c60d0,_0x1de57b,_0x2812d9);})[_0xb4ce('0x1e')](function(_0x3075a1){if(_0x3075a1){logger[_0xb4ce('0xc')](_0xb4ce('0x1f'));logger[_0xb4ce('0xc')](_0xb4ce('0x55'),_0x3075a1['id']);}})[_0xb4ce('0x48')](function(_0x4571e3){logger[_0xb4ce('0x49')]('['+_0x2812d9[_0xb4ce('0x53')][_0xb4ce('0x54')]()+']',JSON[_0xb4ce('0x2e')](_0x4571e3));});}; \ 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 bf3ce2c..d320cf9 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 _0xee3a=['ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','util','moment','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','users','adminId','catch','error','toUpperCase','message','info','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','User\x20found:','userId','Admin\x20selected','adminEmail','Requested\x20Resource\x20not\x20Found','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add'];(function(_0x2b12b9,_0x43e58e){var _0x45e03a=function(_0x1a2478){while(--_0x1a2478){_0x2b12b9['push'](_0x2b12b9['shift']());}};_0x45e03a(++_0x43e58e);}(_0xee3a,0x181));var _0xaee3=function(_0x5f3819,_0x46307c){_0x5f3819=_0x5f3819-0x0;var _0x171bb0=_0xee3a[_0x5f3819];return _0x171bb0;};'use strict';var _=require(_0xaee3('0x0'));var rp=require(_0xaee3('0x1'));var md5=require('md5');var util=require(_0xaee3('0x2'));var moment=require(_0xaee3('0x3'));var Promise=require('bluebird');var Redis=require(_0xaee3('0x4'));var intUtil=require(_0xaee3('0x5'));var config=require(_0xaee3('0x6'));var logger=require(_0xaee3('0x7'))(_0xaee3('0x8'));config[_0xaee3('0x9')]=_[_0xaee3('0xa')](config[_0xaee3('0x9')],{'host':_0xaee3('0xb'),'port':0x18eb});var io=require(_0xaee3('0xc'))(new Redis(config[_0xaee3('0x9')]));function getAdminId(_0x7d28cf,_0x8a919a,_0x387823,_0x295616){return new Promise(function(_0x526c1d,_0x19f8db){var _0x45e7b3=![];var _0x126d63={'method':_0xaee3('0xd'),'uri':_0x295616+_0xaee3('0xe'),'json':!![]};_0x126d63[_0xaee3('0xf')]=_0x387823;logger['info'](_0xaee3('0x10'));return rp(_0x126d63)['then'](function(_0x50dac7){if(_0x50dac7){var _0x37cf32=_0x50dac7[_0xaee3('0x11')];var _0x3e7d96=null;for(_0x3e7d96=0x0;_0x3e7d96<_0x37cf32['length'];_0x3e7d96++){if(_0x37cf32[_0x3e7d96]['email']===_0x7d28cf['adminEmail']){_0x7d28cf[_0xaee3('0x12')]=_0x37cf32[_0x3e7d96]['id'];_0x45e7b3=!![];}}if(_0x45e7b3){logger['info']('Admin\x20found:',_0x7d28cf[_0xaee3('0x12')]);_0x526c1d(_0x7d28cf);}else{_0x19f8db({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x19f8db({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xaee3('0x13')](function(_0x3ecbe7){logger[_0xaee3('0x14')]('['+[_0x8a919a[_0xaee3('0x15')]()]+']',_0x3ecbe7[_0xaee3('0x16')]);_0x19f8db(_0x3ecbe7);});});}function getUser(_0xcd84fc,_0x1a7dc6,_0x10ecff){return function(_0x330776){return new Promise(function(_0x5ca852,_0x2bb784){var _0x12a0b2={'method':_0xaee3('0xd'),'uri':_0x10ecff+'/api/selector/owners','json':!![]};_0x12a0b2['headers']=_0x1a7dc6;logger[_0xaee3('0x17')](_0xaee3('0x18'));return rp(_0x12a0b2)[_0xaee3('0x19')](function(_0x4152dc){if(_0x4152dc){var _0x4181d3=_0x4152dc[_0xaee3('0x11')];var _0x1308b2=![];var _0x1a3568=null;if(_0x330776[_0xaee3('0x1a')]!==null){logger[_0xaee3('0x17')](_0xaee3('0x1b'),_0x330776['agentEmail']);_0x330776[_0xaee3('0x1c')]=_0x330776[_0xaee3('0x1a')];for(_0x1a3568=0x0;_0x1a3568<_0x4181d3['length'];_0x1a3568++){if(_0x4181d3[_0x1a3568][_0xaee3('0x1d')]===_0x330776['agentEmail']){_0x1308b2=!![];_0x330776['userId']=_0x4181d3[_0x1a3568]['id'];logger['info'](_0xaee3('0x1e'),_0x330776[_0xaee3('0x1f')]);}}}if(!_0x1308b2){logger[_0xaee3('0x17')](_0xaee3('0x20'));_0x330776[_0xaee3('0x1c')]=_0x330776[_0xaee3('0x21')];_0x330776[_0xaee3('0x1f')]=_0x330776[_0xaee3('0x12')];_0x1308b2=!![];}if(_0x1308b2){_0x5ca852(_0x330776);}else{_0x2bb784({'statusCode':0x194,'message':_0xaee3('0x22')});}}else{_0x2bb784({'statusCode':0x194,'message':_0xaee3('0x22')});}})[_0xaee3('0x13')](function(_0x33c67a){logger[_0xaee3('0x14')]('['+[_0xcd84fc[_0xaee3('0x15')]()]+']',_0x33c67a[_0xaee3('0x16')]);_0x2bb784(_0x33c67a);});});};}function searchContact(_0x4db864,_0x159fb7,_0x9f5e1e,_0x470d77){return new Promise(function(_0xa863f7,_0x462994){var _0x41684b={'method':'GET','headers':_0x159fb7,'uri':_0x4db864+'/api/lookup?q='+_0x470d77+_0xaee3('0x23')+_0x9f5e1e+_0xaee3('0x24'),'json':!![]};rp(_0x41684b)[_0xaee3('0x19')](function(_0xf516c8){var _0x5dc076=_[_0xaee3('0x25')](_0xf516c8[_0xaee3('0x26')][_0xaee3('0x26')],[_0x9f5e1e,_0x470d77]);_0xa863f7(_0x5dc076);})[_0xaee3('0x13')](function(_0x5b0e5a){_0x462994(_0x5b0e5a);});});}function getEndUser(_0x5078c8,_0x3ef7ff,_0x5f561a){return function(_0x268f93){return new Promise(function(_0x30b5e9,_0x110593){logger[_0xaee3('0x17')](util[_0xaee3('0x27')](_0xaee3('0x28'),_0x268f93['contactNumber']));searchContact(_0x5f561a,_0x3ef7ff,_0xaee3('0x29'),_0x268f93[_0xaee3('0x2a')])[_0xaee3('0x19')](function(_0x5d85dc){if(_0x5d85dc){_0x268f93['endUserId']=_0x5d85dc['id'];logger[_0xaee3('0x17')](_0xaee3('0x2b'),_0x268f93[_0xaee3('0x2c')]);return _0x30b5e9(_0x268f93);}searchContact(_0x5f561a,_0x3ef7ff,_0xaee3('0x2d'),_0x268f93[_0xaee3('0x2a')])[_0xaee3('0x19')](function(_0x27de8d){if(_0x27de8d){_0x268f93[_0xaee3('0x2c')]=_0x27de8d['id'];logger['info'](_0xaee3('0x2e'),_0x268f93['endUserId']);return _0x30b5e9(_0x268f93);}createEndUser(_0x268f93,_0x5078c8,_0x3ef7ff,_0x5f561a)[_0xaee3('0x19')](function(_0x423a7a){logger['info'](_0xaee3('0x2f'),_0x423a7a[_0xaee3('0x2c')]);return _0x30b5e9(_0x423a7a);});});})[_0xaee3('0x13')](function(_0xf4c7b1){_0x110593(_0xf4c7b1);});});};}function createEndUser(_0x44b109,_0x21dbd8,_0x3463a9,_0x5de17e){return new Promise(function(_0x4cc86e,_0x78ce01){var _0x30b7f5=moment();var _0x485895={'method':_0xaee3('0x30'),'uri':_0x5de17e+_0xaee3('0x31'),'body':{'contact':{'last_name':_0x44b109[_0xaee3('0x2a')],'work_number':_0x44b109[_0xaee3('0x2a')],'mobile_number':_0x44b109[_0xaee3('0x2a')],'owner_id':_0x44b109['userId'],'created_at':_0x30b7f5[_0xaee3('0x27')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x485895[_0xaee3('0xf')]=_0x3463a9;logger[_0xaee3('0x17')](_0xaee3('0x32'));return rp(_0x485895)[_0xaee3('0x19')](function(_0x5c22e8){_0x44b109[_0xaee3('0x2c')]=_0x5c22e8[_0xaee3('0x33')]['id'];_0x4cc86e(_0x44b109);})[_0xaee3('0x13')](function(_0x19b462){logger[_0xaee3('0x14')]('['+[_0x21dbd8[_0xaee3('0x15')]()]+']',_0x19b462['message']);_0x78ce01(_0x19b462[_0xaee3('0x16')]);});});}function getTicket(_0x4c3af0,_0x2d4b57,_0x492aa1,_0x128d6f,_0x351ee6){return function(_0x221bb0){logger[_0xaee3('0x17')](_0xaee3('0x34'));return new Promise(function(_0x4e2aba,_0x391a69){var _0x517f57=moment();var _0x53ffc3={'method':'POST','uri':_0x492aa1+_0xaee3('0x35'),'body':{'title':intUtil[_0xaee3('0x36')](_0x128d6f[_0xaee3('0x37')],_0x351ee6,'\x20'),'description':intUtil[_0xaee3('0x36')](_0x128d6f[_0xaee3('0x38')],_0x351ee6,'\x0a'),'owner_id':_0x221bb0[_0xaee3('0x1f')],'creater_id':_0x221bb0[_0xaee3('0x12')],'targetable_id':_0x221bb0[_0xaee3('0x2c')],'targetable_type':_0xaee3('0x39'),'created_at':_0x517f57[_0xaee3('0x27')](_0xaee3('0x3a')),'due_date':_0x517f57[_0xaee3('0x3b')](0x1e,'m')[_0xaee3('0x27')](_0xaee3('0x3a'))},'json':!![]};_0x53ffc3['headers']=_0x2d4b57;return rp(_0x53ffc3)[_0xaee3('0x19')](function(_0x6fd218){_0x221bb0[_0xaee3('0x3c')]=_0x6fd218[_0xaee3('0x3d')]['id'];logger[_0xaee3('0x17')](_0xaee3('0x3e'),_0x221bb0[_0xaee3('0x3c')]);_0x4e2aba(_0x221bb0);})[_0xaee3('0x13')](function(_0x3653b6){logger['error']('['+[_0x4c3af0[_0xaee3('0x15')]()]+']',_0x3653b6[_0xaee3('0x16')]);_0x391a69(_0x3653b6[_0xaee3('0x16')]);});});};}function emit(_0x361ef8,_0x17d034,_0x39048d){var _0x4b216a={'uri':_0x361ef8+_0xaee3('0x3f')+_0x39048d};io['to'](util[_0xaee3('0x27')]('user:%s',_0x17d034))[_0xaee3('0x40')](_0xaee3('0x41'),_0x4b216a);}exports['cs']=function(_0x5eaccd,_0x450abb,_0x5c960f,_0x295c7b,_0x527f6d,_0x46b186,_0x13e71f,_0x30c34e){var _0x5d09f0={};var _0x1034c3={'Authorization':_0xaee3('0x42')+_0x46b186[_0xaee3('0x43')]};_0x46b186[_0xaee3('0x44')]=intUtil[_0xaee3('0x45')](_0x46b186['remoteUri']);_0x46b186[_0xaee3('0x46')]=intUtil['stripTrailingSlash'](_0x46b186['serverUrl']);var _0x2fee1b=_0x46b186[_0xaee3('0x44')];_0x5d09f0[_0xaee3('0x21')]=_0x46b186['username'];_0x5d09f0[_0xaee3('0x2a')]=_0x30c34e[_0xaee3('0x47')]()===_0xaee3('0x48')?_0x450abb[_0xaee3('0x49')]:_0x450abb[_0xaee3('0x4a')];_0x5d09f0['callDirection']=_0x30c34e===_0xaee3('0x4b')||_0x30c34e===_0xaee3('0x4c')?_0xaee3('0x4b'):_0xaee3('0x48');if(_0x295c7b){_0x5d09f0[_0xaee3('0x1a')]=_0x295c7b[_0xaee3('0x1d')];}var _0x3dae2e=util[_0xaee3('0x27')](_0xaee3('0x4d'),_0x46b186[_0xaee3('0x46')],_0x450abb[_0xaee3('0x4e')],md5(_0x450abb[_0xaee3('0x4e')]));if(_0x527f6d&&_0x527f6d[_0xaee3('0x4f')]){logger['info'](_0xaee3('0x50'),_0xaee3('0x51'));_0x450abb[_0xaee3('0x52')]=_0x3dae2e;}else if(_0x13e71f&&_0x13e71f['recordingFormat']&&_0x13e71f[_0xaee3('0x53')]!=='none'){logger[_0xaee3('0x17')](_0xaee3('0x54'),_0xaee3('0x51'));_0x450abb['recordingURL']=_0x3dae2e;}else{_0x450abb[_0xaee3('0x52')]='';}return getAdminId(_0x5d09f0,_0x30c34e,_0x1034c3,_0x2fee1b)[_0xaee3('0x19')](getUser(_0x30c34e,_0x1034c3,_0x2fee1b))[_0xaee3('0x19')](getEndUser(_0x30c34e,_0x1034c3,_0x2fee1b))[_0xaee3('0x19')](getTicket(_0x30c34e,_0x1034c3,_0x2fee1b,_0x5c960f,_0x450abb))[_0xaee3('0x19')](function(_0x31b3d2){logger[_0xaee3('0x17')](util[_0xaee3('0x27')](_0xaee3('0x55'),_0x31b3d2[_0xaee3('0x3c')]));if(_0x30c34e!=='unmanaged'){logger[_0xaee3('0x17')]('['+[_0x30c34e[_0xaee3('0x15')]()]+']',_0xaee3('0x56'));emit(_0x2fee1b,_0x295c7b[_0xaee3('0x57')],_0x31b3d2[_0xaee3('0x2c')]);}})[_0xaee3('0x13')](function(_0x58a911){logger['error']('['+[_0x30c34e['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xaee3('0x58')](_0x58a911,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xec31=['unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','md5','moment','bluebird','ioredis','./util','freshsales','defaults','redis','GET','/api/selector/owners','headers','info','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','Getting\x20user\x20list','agentEmail','userEmail','userId','Admin\x20selected','toUpperCase','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','ticketId','task','Task\x20created:','/contacts/','emit','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection'];(function(_0x397454,_0x11bf1a){var _0x29ef2e=function(_0x2be629){while(--_0x2be629){_0x397454['push'](_0x397454['shift']());}};_0x29ef2e(++_0x11bf1a);}(_0xec31,0x155));var _0x1ec3=function(_0x20d952,_0x935281){_0x20d952=_0x20d952-0x0;var _0x1563b4=_0xec31[_0x20d952];return _0x1563b4;};'use strict';var _=require(_0x1ec3('0x0'));var rp=require('request-promise');var md5=require(_0x1ec3('0x1'));var util=require('util');var moment=require(_0x1ec3('0x2'));var Promise=require(_0x1ec3('0x3'));var Redis=require(_0x1ec3('0x4'));var intUtil=require(_0x1ec3('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x1ec3('0x6'));config['redis']=_[_0x1ec3('0x7')](config[_0x1ec3('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1ec3('0x8')]));function getAdminId(_0x2a5e76,_0x5b2c36,_0x518ff5,_0xb231ec){return new Promise(function(_0x52d9fd,_0x968e61){var _0x118bec=![];var _0x3deb65={'method':_0x1ec3('0x9'),'uri':_0xb231ec+_0x1ec3('0xa'),'json':!![]};_0x3deb65[_0x1ec3('0xb')]=_0x518ff5;logger[_0x1ec3('0xc')]('Getting\x20admin\x20information');return rp(_0x3deb65)[_0x1ec3('0xd')](function(_0x23c896){if(_0x23c896){var _0x130a64=_0x23c896[_0x1ec3('0xe')];var _0x4816be=null;for(_0x4816be=0x0;_0x4816be<_0x130a64[_0x1ec3('0xf')];_0x4816be++){if(_0x130a64[_0x4816be][_0x1ec3('0x10')]===_0x2a5e76[_0x1ec3('0x11')]){_0x2a5e76[_0x1ec3('0x12')]=_0x130a64[_0x4816be]['id'];_0x118bec=!![];}}if(_0x118bec){logger[_0x1ec3('0xc')](_0x1ec3('0x13'),_0x2a5e76[_0x1ec3('0x12')]);_0x52d9fd(_0x2a5e76);}else{_0x968e61({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x968e61({'statusCode':0x194,'message':_0x1ec3('0x14')});}})[_0x1ec3('0x15')](function(_0x7f7d6){logger[_0x1ec3('0x16')]('['+[_0x5b2c36['toUpperCase']()]+']',_0x7f7d6[_0x1ec3('0x17')]);_0x968e61(_0x7f7d6);});});}function getUser(_0x466fd7,_0x62a3c2,_0x4defc2){return function(_0x2e59cb){return new Promise(function(_0x1961e9,_0x2566c3){var _0x2687d3={'method':_0x1ec3('0x9'),'uri':_0x4defc2+_0x1ec3('0xa'),'json':!![]};_0x2687d3[_0x1ec3('0xb')]=_0x62a3c2;logger[_0x1ec3('0xc')](_0x1ec3('0x18'));return rp(_0x2687d3)[_0x1ec3('0xd')](function(_0x2e36f9){if(_0x2e36f9){var _0x21362b=_0x2e36f9[_0x1ec3('0xe')];var _0x600fa4=![];var _0x3caa82=null;if(_0x2e59cb[_0x1ec3('0x19')]!==null){logger[_0x1ec3('0xc')]('Getting\x20user\x20with\x20email',_0x2e59cb[_0x1ec3('0x19')]);_0x2e59cb[_0x1ec3('0x1a')]=_0x2e59cb[_0x1ec3('0x19')];for(_0x3caa82=0x0;_0x3caa82<_0x21362b['length'];_0x3caa82++){if(_0x21362b[_0x3caa82][_0x1ec3('0x10')]===_0x2e59cb['agentEmail']){_0x600fa4=!![];_0x2e59cb['userId']=_0x21362b[_0x3caa82]['id'];logger[_0x1ec3('0xc')]('User\x20found:',_0x2e59cb[_0x1ec3('0x1b')]);}}}if(!_0x600fa4){logger[_0x1ec3('0xc')](_0x1ec3('0x1c'));_0x2e59cb[_0x1ec3('0x1a')]=_0x2e59cb[_0x1ec3('0x11')];_0x2e59cb['userId']=_0x2e59cb['adminId'];_0x600fa4=!![];}if(_0x600fa4){_0x1961e9(_0x2e59cb);}else{_0x2566c3({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x2566c3({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x1ec3('0x15')](function(_0x14dd4c){logger[_0x1ec3('0x16')]('['+[_0x466fd7[_0x1ec3('0x1d')]()]+']',_0x14dd4c[_0x1ec3('0x17')]);_0x2566c3(_0x14dd4c);});});};}function searchContact(_0x368281,_0x1a1436,_0x465f0a,_0x181ebf){return new Promise(function(_0x2bc51b,_0x44d976){var _0x3353c8={'method':'GET','headers':_0x1a1436,'uri':_0x368281+_0x1ec3('0x1e')+_0x181ebf+_0x1ec3('0x1f')+_0x465f0a+_0x1ec3('0x20'),'json':!![]};rp(_0x3353c8)[_0x1ec3('0xd')](function(_0x8e793){var _0x4f45e9=_[_0x1ec3('0x21')](_0x8e793[_0x1ec3('0x22')]['contacts'],[_0x465f0a,_0x181ebf]);_0x2bc51b(_0x4f45e9);})[_0x1ec3('0x15')](function(_0x307401){_0x44d976(_0x307401);});});}function getEndUser(_0xbcdc1a,_0x4d92d8,_0x5cc376){return function(_0x4f59ea){return new Promise(function(_0x5d4ba0,_0xdd6df7){logger[_0x1ec3('0xc')](util[_0x1ec3('0x23')](_0x1ec3('0x24'),_0x4f59ea[_0x1ec3('0x25')]));searchContact(_0x5cc376,_0x4d92d8,_0x1ec3('0x26'),_0x4f59ea[_0x1ec3('0x25')])[_0x1ec3('0xd')](function(_0x14260f){if(_0x14260f){_0x4f59ea[_0x1ec3('0x27')]=_0x14260f['id'];logger[_0x1ec3('0xc')](_0x1ec3('0x28'),_0x4f59ea[_0x1ec3('0x27')]);return _0x5d4ba0(_0x4f59ea);}searchContact(_0x5cc376,_0x4d92d8,_0x1ec3('0x29'),_0x4f59ea[_0x1ec3('0x25')])['then'](function(_0x217ad1){if(_0x217ad1){_0x4f59ea[_0x1ec3('0x27')]=_0x217ad1['id'];logger[_0x1ec3('0xc')](_0x1ec3('0x2a'),_0x4f59ea['endUserId']);return _0x5d4ba0(_0x4f59ea);}createEndUser(_0x4f59ea,_0xbcdc1a,_0x4d92d8,_0x5cc376)['then'](function(_0x354f7d){logger['info'](_0x1ec3('0x2b'),_0x354f7d[_0x1ec3('0x27')]);return _0x5d4ba0(_0x354f7d);});});})[_0x1ec3('0x15')](function(_0xf45b49){_0xdd6df7(_0xf45b49);});});};}function createEndUser(_0xe83031,_0x11d2d4,_0xe820d6,_0x15f2fc){return new Promise(function(_0x4d078b,_0x2baf1b){var _0x321bbe=moment();var _0x4df5ab={'method':_0x1ec3('0x2c'),'uri':_0x15f2fc+_0x1ec3('0x2d'),'body':{'contact':{'last_name':_0xe83031[_0x1ec3('0x25')],'work_number':_0xe83031[_0x1ec3('0x25')],'mobile_number':_0xe83031['contactNumber'],'owner_id':_0xe83031[_0x1ec3('0x1b')],'created_at':_0x321bbe['format'](_0x1ec3('0x2e'))}},'json':!![]};_0x4df5ab[_0x1ec3('0xb')]=_0xe820d6;logger[_0x1ec3('0xc')](_0x1ec3('0x2f'));return rp(_0x4df5ab)[_0x1ec3('0xd')](function(_0x5e63f2){_0xe83031[_0x1ec3('0x27')]=_0x5e63f2['contact']['id'];_0x4d078b(_0xe83031);})[_0x1ec3('0x15')](function(_0x3be1cd){logger[_0x1ec3('0x16')]('['+[_0x11d2d4[_0x1ec3('0x1d')]()]+']',_0x3be1cd['message']);_0x2baf1b(_0x3be1cd[_0x1ec3('0x17')]);});});}function getTicket(_0x56bf7d,_0x332b79,_0x4950da,_0x4ed77b,_0x4e058c){return function(_0x385c5f){logger['info'](_0x1ec3('0x30'));return new Promise(function(_0x1b6723,_0x485480){var _0x4989a5=moment();var _0x4de419={'method':_0x1ec3('0x2c'),'uri':_0x4950da+_0x1ec3('0x31'),'body':{'title':intUtil[_0x1ec3('0x32')](_0x4ed77b[_0x1ec3('0x33')],_0x4e058c,'\x20'),'description':intUtil[_0x1ec3('0x32')](_0x4ed77b[_0x1ec3('0x34')],_0x4e058c,'\x0a'),'owner_id':_0x385c5f['userId'],'creater_id':_0x385c5f[_0x1ec3('0x12')],'targetable_id':_0x385c5f['endUserId'],'targetable_type':_0x1ec3('0x35'),'created_at':_0x4989a5[_0x1ec3('0x23')](_0x1ec3('0x2e')),'due_date':_0x4989a5['add'](0x1e,'m')[_0x1ec3('0x23')](_0x1ec3('0x2e'))},'json':!![]};_0x4de419['headers']=_0x332b79;return rp(_0x4de419)['then'](function(_0x3c82ff){_0x385c5f[_0x1ec3('0x36')]=_0x3c82ff[_0x1ec3('0x37')]['id'];logger[_0x1ec3('0xc')](_0x1ec3('0x38'),_0x385c5f[_0x1ec3('0x36')]);_0x1b6723(_0x385c5f);})[_0x1ec3('0x15')](function(_0x1ef838){logger[_0x1ec3('0x16')]('['+[_0x56bf7d[_0x1ec3('0x1d')]()]+']',_0x1ef838[_0x1ec3('0x17')]);_0x485480(_0x1ef838[_0x1ec3('0x17')]);});});};}function emit(_0x30ed20,_0x33f76a,_0x44c227){var _0x3db231={'uri':_0x30ed20+_0x1ec3('0x39')+_0x44c227};io['to'](util['format']('user:%s',_0x33f76a))[_0x1ec3('0x3a')]('trigger:browser:url',_0x3db231);}exports['cs']=function(_0x2c51a5,_0x11fd7d,_0x380bae,_0x504828,_0x2abdcc,_0x1edfc0,_0x24748e,_0x784071){var _0x5e6b02={};var _0x377cad={'Authorization':_0x1ec3('0x3b')+_0x1edfc0[_0x1ec3('0x3c')]};_0x1edfc0['remoteUri']=intUtil[_0x1ec3('0x3d')](_0x1edfc0[_0x1ec3('0x3e')]);_0x1edfc0[_0x1ec3('0x3f')]=intUtil[_0x1ec3('0x3d')](_0x1edfc0[_0x1ec3('0x3f')]);var _0x56bb8d=_0x1edfc0[_0x1ec3('0x3e')];_0x5e6b02[_0x1ec3('0x11')]=_0x1edfc0[_0x1ec3('0x40')];_0x5e6b02['contactNumber']=_0x784071[_0x1ec3('0x41')]()===_0x1ec3('0x42')?_0x11fd7d['destcalleridnum']:_0x11fd7d[_0x1ec3('0x43')];_0x5e6b02[_0x1ec3('0x44')]=_0x784071==='queue'||_0x784071===_0x1ec3('0x45')?'queue':_0x1ec3('0x42');if(_0x504828){_0x5e6b02[_0x1ec3('0x19')]=_0x504828[_0x1ec3('0x10')];}var _0x1a300b=util[_0x1ec3('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1edfc0[_0x1ec3('0x3f')],_0x11fd7d[_0x1ec3('0x46')],md5(_0x11fd7d[_0x1ec3('0x46')]));if(_0x2abdcc&&_0x2abdcc[_0x1ec3('0x47')]){logger[_0x1ec3('0xc')](_0x1ec3('0x48'),_0x1ec3('0x49'));_0x11fd7d[_0x1ec3('0x4a')]=_0x1a300b;}else if(_0x24748e&&_0x24748e[_0x1ec3('0x4b')]&&_0x24748e['recordingFormat']!==_0x1ec3('0x4c')){logger[_0x1ec3('0xc')](_0x1ec3('0x4d'),'Recording\x20is\x20enabled!');_0x11fd7d[_0x1ec3('0x4a')]=_0x1a300b;}else{_0x11fd7d[_0x1ec3('0x4a')]='';}return getAdminId(_0x5e6b02,_0x784071,_0x377cad,_0x56bb8d)[_0x1ec3('0xd')](getUser(_0x784071,_0x377cad,_0x56bb8d))[_0x1ec3('0xd')](getEndUser(_0x784071,_0x377cad,_0x56bb8d))[_0x1ec3('0xd')](getTicket(_0x784071,_0x377cad,_0x56bb8d,_0x380bae,_0x11fd7d))[_0x1ec3('0xd')](function(_0x19b760){logger[_0x1ec3('0xc')](util[_0x1ec3('0x23')](_0x1ec3('0x4e'),_0x19b760['ticketId']));if(_0x784071!=='unmanaged'){logger[_0x1ec3('0xc')]('['+[_0x784071[_0x1ec3('0x1d')]()]+']',_0x1ec3('0x4f'));emit(_0x56bb8d,_0x504828[_0x1ec3('0x50')],_0x19b760[_0x1ec3('0x27')]);}})[_0x1ec3('0x15')](function(_0x11857c){logger[_0x1ec3('0x16')]('['+[_0x784071[_0x1ec3('0x1d')]()]+_0x1ec3('0x51'),util['inspect'](_0x11857c,{'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 204adca..0df2678 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 _0x5944=['unknown\x20integration','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','dynamics365','freshsales','servicenow','includes','data1','toLowerCase','data2','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','vtiger'];(function(_0x162498,_0x88e129){var _0x2cddf2=function(_0x49f9ee){while(--_0x49f9ee){_0x162498['push'](_0x162498['shift']());}};_0x2cddf2(++_0x88e129);}(_0x5944,0x18d));var _0x4594=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5944[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x4594('0x0'));var util=require(_0x4594('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x4594('0x2'));var sugarcrm=require(_0x4594('0x3'));var freshdesk=require(_0x4594('0x4'));var zoho=require(_0x4594('0x5'));var desk=require(_0x4594('0x6'));var vtiger=require(_0x4594('0x7'));var servicenow=require(_0x4594('0x8'));var dynamics365=require(_0x4594('0x9'));var freshsales=require(_0x4594('0xa'));var integrations=[_0x4594('0xb'),_0x4594('0xc'),_0x4594('0xd'),_0x4594('0xe'),_0x4594('0xf'),_0x4594('0x10'),'vtiger',_0x4594('0x11'),_0x4594('0x12'),_0x4594('0x13')];exports['exec']=function(_0x1c963e,_0x2542b8,_0x4c49cf,_0x42772c,_0x1119df,_0x69326c){if(_0x4c49cf){if(_[_0x4594('0x14')](integrations,_0x1c963e[_0x4594('0x15')][_0x4594('0x16')]())){try{var _0x4f364a=null;var _0x3e1994='';var _0x433790=_0x4c49cf[_0x1c963e[_0x4594('0x15')][_0x4594('0x16')]()];if(_0x433790){var _0x21e486=_0x433790[_0x1c963e[_0x4594('0x17')]];if(_0x21e486){var _0x2ff938=_['find'](_0x21e486[_0x4594('0x18')],{'id':parseInt(_0x1c963e['data3'],0xa)});if(_0x2ff938){if(_0x42772c){if(_0x1119df&&_0x2542b8[_0x4594('0x19')]){_0x3e1994=_0x4594('0x19');}else if(_0x2542b8[_0x4594('0x1a')]){_0x3e1994=_0x4594('0x1b');}else{console[_0x4594('0x1c')](_0x4594('0x1d'),_0x2542b8);}}else{_0x3e1994=_0x4594('0x1e');}switch(_0x1c963e[_0x4594('0x15')]['toLowerCase']()){case _0x4594('0xb'):zendesk[_0x3e1994](_0x1c963e,_0x2542b8,_0x2ff938,_0x42772c,_0x1119df,_0x21e486,_0x69326c);break;case'salesforce':salesforce[_0x3e1994](_0x1c963e,_0x2542b8,_0x2ff938,_0x42772c,_0x1119df,_0x21e486,_0x69326c);break;case _0x4594('0xd'):sugarcrm[_0x3e1994](_0x1c963e,_0x2542b8,_0x2ff938,_0x42772c,_0x1119df,_0x21e486,_0x69326c);break;case _0x4594('0xe'):freshdesk[_0x3e1994](_0x1c963e,_0x2542b8,_0x2ff938,_0x42772c,_0x1119df,_0x21e486,_0x69326c);break;case _0x4594('0xf'):zoho[_0x3e1994](_0x1c963e,_0x2542b8,_0x2ff938,_0x42772c,_0x1119df,_0x21e486,_0x69326c);break;case _0x4594('0x10'):desk[_0x3e1994](_0x1c963e,_0x2542b8,_0x2ff938,_0x42772c,_0x1119df,_0x21e486,_0x69326c);break;case _0x4594('0x1f'):vtiger[_0x3e1994](_0x1c963e,_0x2542b8,_0x2ff938,_0x42772c,_0x1119df,_0x21e486,_0x69326c);break;case _0x4594('0x12'):freshsales['cs'](_0x1c963e,_0x2542b8,_0x2ff938,_0x42772c,_0x1119df,_0x21e486,_0x69326c,_0x3e1994);break;case _0x4594('0x13'):servicenow['cs'](_0x1c963e,_0x2542b8,_0x2ff938,_0x42772c,_0x1119df,_0x21e486,_0x69326c,_0x3e1994);break;case'dynamics365':dynamics365['cs'](_0x1c963e,_0x2542b8,_0x2ff938,_0x42772c,_0x1119df,_0x21e486,_0x69326c,_0x3e1994);break;default:console[_0x4594('0x1c')](_0x4594('0x20'));}}else{_0x4f364a=require('../../../../config/logger')(_0x1c963e[_0x4594('0x15')]['toLowerCase']());_0x4f364a[_0x4594('0x21')](_0x4594('0x22'),util[_0x4594('0x23')](_0x4594('0x24'),_0x1c963e[_0x4594('0x15')]['toLowerCase'](),_0x1c963e['data3']));}}else{_0x4f364a=require(_0x4594('0x25'))(_0x1c963e['data1'][_0x4594('0x16')]());_0x4f364a[_0x4594('0x21')](_0x4594('0x22'),util[_0x4594('0x23')](_0x4594('0x26'),_0x1c963e['data1']['toLowerCase'](),_0x1c963e[_0x4594('0x17')]));}}else{}}catch(_0x817c77){console[_0x4594('0x21')](_0x817c77);}}}}; \ No newline at end of file +var _0xc374=['desk','unknown\x20integration','error','format','%s\x20configuration\x20#%s\x20not\x20found','data3','[EXEC]','lodash','util','./sugarcrm','./freshdesk','./zoho','./desk','./dynamics365','./freshsales','zendesk','salesforce','freshdesk','zoho','vtiger','dynamics365','freshsales','servicenow','includes','data1','toLowerCase','data2','find','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm'];(function(_0x79c37f,_0x2899a9){var _0x338ae8=function(_0x2cb1de){while(--_0x2cb1de){_0x79c37f['push'](_0x79c37f['shift']());}};_0x338ae8(++_0x2899a9);}(_0xc374,0x117));var _0x4c37=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc374[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4c37('0x0'));var util=require(_0x4c37('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0x4c37('0x2'));var freshdesk=require(_0x4c37('0x3'));var zoho=require(_0x4c37('0x4'));var desk=require(_0x4c37('0x5'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0x4c37('0x6'));var freshsales=require(_0x4c37('0x7'));var integrations=[_0x4c37('0x8'),_0x4c37('0x9'),'sugarcrm',_0x4c37('0xa'),_0x4c37('0xb'),'desk',_0x4c37('0xc'),_0x4c37('0xd'),_0x4c37('0xe'),_0x4c37('0xf')];exports['exec']=function(_0x53fe51,_0xe87fc8,_0x5e3877,_0x510033,_0x2b4879,_0x4bae85){if(_0x5e3877){if(_[_0x4c37('0x10')](integrations,_0x53fe51[_0x4c37('0x11')][_0x4c37('0x12')]())){try{var _0x554408=null;var _0x2a0685='';var _0x3bc9ba=_0x5e3877[_0x53fe51['data1'][_0x4c37('0x12')]()];if(_0x3bc9ba){var _0x44b524=_0x3bc9ba[_0x53fe51[_0x4c37('0x13')]];if(_0x44b524){var _0x350a10=_[_0x4c37('0x14')](_0x44b524['Configurations'],{'id':parseInt(_0x53fe51['data3'],0xa)});if(_0x350a10){if(_0x510033){if(_0x2b4879&&_0xe87fc8[_0x4c37('0x15')]){_0x2a0685=_0x4c37('0x15');}else if(_0xe87fc8['routeId']){_0x2a0685=_0x4c37('0x16');}else{console[_0x4c37('0x17')](_0x4c37('0x18'),_0xe87fc8);}}else{_0x2a0685=_0x4c37('0x19');}switch(_0x53fe51[_0x4c37('0x11')][_0x4c37('0x12')]()){case _0x4c37('0x8'):zendesk[_0x2a0685](_0x53fe51,_0xe87fc8,_0x350a10,_0x510033,_0x2b4879,_0x44b524,_0x4bae85);break;case _0x4c37('0x9'):salesforce[_0x2a0685](_0x53fe51,_0xe87fc8,_0x350a10,_0x510033,_0x2b4879,_0x44b524,_0x4bae85);break;case _0x4c37('0x1a'):sugarcrm[_0x2a0685](_0x53fe51,_0xe87fc8,_0x350a10,_0x510033,_0x2b4879,_0x44b524,_0x4bae85);break;case _0x4c37('0xa'):freshdesk[_0x2a0685](_0x53fe51,_0xe87fc8,_0x350a10,_0x510033,_0x2b4879,_0x44b524,_0x4bae85);break;case _0x4c37('0xb'):zoho[_0x2a0685](_0x53fe51,_0xe87fc8,_0x350a10,_0x510033,_0x2b4879,_0x44b524,_0x4bae85);break;case _0x4c37('0x1b'):desk[_0x2a0685](_0x53fe51,_0xe87fc8,_0x350a10,_0x510033,_0x2b4879,_0x44b524,_0x4bae85);break;case _0x4c37('0xc'):vtiger[_0x2a0685](_0x53fe51,_0xe87fc8,_0x350a10,_0x510033,_0x2b4879,_0x44b524,_0x4bae85);break;case _0x4c37('0xe'):freshsales['cs'](_0x53fe51,_0xe87fc8,_0x350a10,_0x510033,_0x2b4879,_0x44b524,_0x4bae85,_0x2a0685);break;case _0x4c37('0xf'):servicenow['cs'](_0x53fe51,_0xe87fc8,_0x350a10,_0x510033,_0x2b4879,_0x44b524,_0x4bae85,_0x2a0685);break;case'dynamics365':dynamics365['cs'](_0x53fe51,_0xe87fc8,_0x350a10,_0x510033,_0x2b4879,_0x44b524,_0x4bae85,_0x2a0685);break;default:console['log'](_0x4c37('0x1c'));}}else{_0x554408=require('../../../../config/logger')(_0x53fe51['data1']['toLowerCase']());_0x554408[_0x4c37('0x1d')]('[EXEC]',util[_0x4c37('0x1e')](_0x4c37('0x1f'),_0x53fe51['data1'][_0x4c37('0x12')](),_0x53fe51[_0x4c37('0x20')]));}}else{_0x554408=require('../../../../config/logger')(_0x53fe51[_0x4c37('0x11')][_0x4c37('0x12')]());_0x554408['error'](_0x4c37('0x21'),util[_0x4c37('0x1e')]('%s\x20account\x20#%s\x20not\x20found',_0x53fe51['data1'][_0x4c37('0x12')](),_0x53fe51[_0x4c37('0x13')]));}}else{}}catch(_0x11f266){console['error'](_0x11f266);}}}}; \ 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 55ae838..966e4e4 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 _0xd698=['lodash','request-promise','moment','md5','jsforce','util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','assign','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','execute','then','Email','Agent\x20%s\x20found.','resolve','Name','user_id','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','find','length','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','first','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','string','picklist','content','toString','variable','idField','variableName','customVariable','Variable','name','concat','securityToken','Connection','https://login.salesforce.com','clientId','username','Connection\x20established.','serverUrl','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stripTrailingSlash','recordingFormat','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.'];(function(_0x1e7c87,_0x4fe3a9){var _0x2d5779=function(_0x4f5c65){while(--_0x4f5c65){_0x1e7c87['push'](_0x1e7c87['shift']());}};_0x2d5779(++_0x4fe3a9);}(_0xd698,0x1ec));var _0x8d69=function(_0x4708eb,_0x1d3404){_0x4708eb=_0x4708eb-0x0;var _0x5b8f04=_0xd698[_0x4708eb];return _0x5b8f04;};'use strict';var _=require(_0x8d69('0x0'));var rp=require(_0x8d69('0x1'));var moment=require(_0x8d69('0x2'));var BPromise=require('bluebird');var md5=require(_0x8d69('0x3'));var jsforce=require(_0x8d69('0x4'));var util=require(_0x8d69('0x5'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x8d69('0x6'));var logger=require(_0x8d69('0x7'))(_0x8d69('0x8'));config[_0x8d69('0x9')]=_['defaults'](config[_0x8d69('0x9')],{'host':_0x8d69('0xa'),'port':0x18eb});var io=require(_0x8d69('0xb'))(new Redis(config[_0x8d69('0x9')]));function emit(_0x1def93,_0x540370,_0xfba56f){io['to'](_0x1def93)[_0x8d69('0xc')](_0x540370,_0xfba56f);}function getTicket(_0x310827,_0x2c8af3,_0x2b45cd,_0x459e0,_0x3d5c7b,_0x15ad3a,_0x5c7dc9,_0x467ea0){var _0x4fbf0e=Object[_0x8d69('0xd')]({},{'OwnerId':_0x2c8af3['id'],'Subject':intUtil[_0x8d69('0xe')](_0x459e0['Subjects'],_0x3d5c7b,'\x20'),'Description':intUtil[_0x8d69('0xe')](_0x459e0[_0x8d69('0xf')],_0x3d5c7b,'\x0a')},getCustomFields(_0x15ad3a,_0x3d5c7b));if(_0x2b45cd){if(_0x459e0[_0x8d69('0x10')]===_0x8d69('0x11')){_0x4fbf0e[_0x8d69('0x12')]=moment[_0x8d69('0x13')]();_0x4fbf0e['IsReminderSet']=![];_0x4fbf0e[_0x8d69('0x14')]=![];if(_0x2b45cd[_0x8d69('0x15')]===_0x8d69('0x16')||_0x2b45cd[_0x8d69('0x15')]===_0x8d69('0x17')){_0x4fbf0e[_0x8d69('0x18')]=_0x2b45cd['id'];}else if(_0x2b45cd[_0x8d69('0x15')]===_0x8d69('0x19')){_0x4fbf0e[_0x8d69('0x1a')]=_0x2b45cd['id'];}}else if(_0x459e0['ticketType']==='Case'){if(_0x2b45cd[_0x8d69('0x15')]===_0x8d69('0x16')){_0x4fbf0e[_0x8d69('0x1b')]=_0x2b45cd['id'];}else if(_0x2b45cd[_0x8d69('0x15')]===_0x8d69('0x19')){_0x4fbf0e[_0x8d69('0x1c')]=_0x2b45cd['id'];}else if(_0x2b45cd[_0x8d69('0x15')]==='lead'&&_0x459e0[_0x8d69('0x1d')]){_0x4fbf0e[_0x459e0[_0x8d69('0x1d')]]=_0x2b45cd['id'];}else{logger[_0x8d69('0x1e')](_0x8d69('0x1f'));}}}return _0x5c7dc9[_0x8d69('0x20')](_0x459e0['ticketType'])[_0x8d69('0x21')](_0x4fbf0e);}function getUser(_0x3ffcff,_0x173128,_0x265aac){if(!_[_0x8d69('0x22')](_0x173128)&&intUtil[_0x8d69('0x23')](_0x173128)){var _0x20775e={'Email':_0x173128};var _0x17287e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x265aac[_0x8d69('0x20')](_0x8d69('0x24'))['find'](_0x20775e,_0x17287e)[_0x8d69('0x25')]()[_0x8d69('0x26')](function(_0x538a9e){if(_0x538a9e['length']){var _0x1f3f2e=_['find'](_0x538a9e,function(_0x1b5b5a){return _0x1b5b5a[_0x8d69('0x27')]===_0x173128;});if(_0x1f3f2e){logger[_0x8d69('0x1e')](_0x8d69('0x28'),_0x173128);return BPromise[_0x8d69('0x29')]({'id':_0x1f3f2e['Id'],'name':_0x1f3f2e[_0x8d69('0x2a')]});}}else{logger[_0x8d69('0x1e')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x173128);return _0x265aac['identity']()[_0x8d69('0x26')](function(_0x3c8c4a){return BPromise[_0x8d69('0x29')]({'id':_0x3c8c4a[_0x8d69('0x2b')],'name':_0x3c8c4a[_0x8d69('0x2c')]});});}});}else{logger[_0x8d69('0x1e')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x173128);return _0x265aac['identity']()[_0x8d69('0x26')](function(_0x581d1){return BPromise['resolve']({'id':_0x581d1[_0x8d69('0x2b')],'name':_0x581d1[_0x8d69('0x2c')]});});}}function getEndUser(_0x1b1536,_0x2601ec,_0x5e3e7c,_0x22c09b,_0x13b98c){var _0x1dae6d={'$or':{'Phone':_0x22c09b}};var _0x305da5={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x8d69('0x26')](function(){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x22c09b,_0x2601ec[_0x8d69('0x2d')]);switch(_0x2601ec[_0x8d69('0x2d')]){case _0x8d69('0x2e'):var _0x12e910=_[_0x8d69('0x2f')](_0x1dae6d);if(_0x2601ec[_0x8d69('0x30')]){var _0x4c8b16={};_0x4c8b16[_0x2601ec[_0x8d69('0x30')]]=_0x22c09b;_['merge'](_0x12e910[_0x8d69('0x31')],_0x4c8b16);}return _0x13b98c[_0x8d69('0x20')](_0x8d69('0x32'))[_0x8d69('0x33')](_0x12e910,_0x305da5)[_0x8d69('0x25')]()[_0x8d69('0x26')](function(_0x4404d0){if(_0x4404d0&&_0x4404d0[_0x8d69('0x34')]){return _0x4404d0;}else{var _0x1bf8e3=_[_0x8d69('0x2f')](_0x1dae6d);if(_0x2601ec[_0x8d69('0x35')]){var _0x611132={};_0x611132[_0x2601ec['additionalSearchLead']]=_0x22c09b;_[_0x8d69('0x36')](_0x1bf8e3[_0x8d69('0x31')],_0x611132);}return _0x13b98c[_0x8d69('0x20')](_0x8d69('0x37'))[_0x8d69('0x33')](_0x1bf8e3,_0x305da5);}});case _0x8d69('0x38'):var _0x2e3cbc=_[_0x8d69('0x2f')](_0x1dae6d);if(_0x2601ec['additionalSearchAccount']){var _0x4c8b16={};_0x4c8b16[_0x2601ec[_0x8d69('0x39')]]=_0x22c09b;_[_0x8d69('0x36')](_0x2e3cbc[_0x8d69('0x31')],_0x4c8b16);}return _0x13b98c[_0x8d69('0x20')](_0x8d69('0x3a'))[_0x8d69('0x33')](_0x2e3cbc,_0x305da5)['execute']()['then'](function(_0x17be70){if(_0x17be70&&_0x17be70[_0x8d69('0x34')]){return _0x17be70;}else{var _0x359b93=_[_0x8d69('0x2f')](_0x1dae6d);if(_0x2601ec['additionalSearchContact']){var _0x5441f2={};_0x5441f2[_0x2601ec['additionalSearchContact']]=_0x22c09b;_[_0x8d69('0x36')](_0x359b93[_0x8d69('0x31')],_0x5441f2);}return _0x13b98c['sobject'](_0x8d69('0x32'))[_0x8d69('0x33')](_0x359b93,_0x305da5)[_0x8d69('0x26')](function(_0x5bc2fe){if(_0x5bc2fe&&_0x5bc2fe[_0x8d69('0x34')]){return _0x5bc2fe;}else{var _0x30f774=_[_0x8d69('0x2f')](_0x1dae6d);if(_0x2601ec[_0x8d69('0x35')]){var _0x1d58bf={};_0x1d58bf[_0x2601ec[_0x8d69('0x35')]]=_0x22c09b;_[_0x8d69('0x36')](_0x30f774[_0x8d69('0x31')],_0x1d58bf);}return _0x13b98c[_0x8d69('0x20')](_0x8d69('0x37'))[_0x8d69('0x33')](_0x30f774,_0x305da5);}});}});case _0x8d69('0x16'):var _0x12e910=_[_0x8d69('0x2f')](_0x1dae6d);if(_0x2601ec[_0x8d69('0x30')]){var _0x4c8b16={};_0x4c8b16[_0x2601ec[_0x8d69('0x30')]]=_0x22c09b;_[_0x8d69('0x36')](_0x12e910[_0x8d69('0x31')],_0x4c8b16);}return _0x13b98c['sobject'](_0x8d69('0x32'))[_0x8d69('0x33')](_0x12e910,_0x305da5)[_0x8d69('0x25')]();case _0x8d69('0x17'):var _0x5040c3=_[_0x8d69('0x2f')](_0x1dae6d);if(_0x2601ec['additionalSearchLead']){var _0x4c8b16={};_0x4c8b16[_0x2601ec[_0x8d69('0x35')]]=_0x22c09b;_[_0x8d69('0x36')](_0x5040c3[_0x8d69('0x31')],_0x4c8b16);}return _0x13b98c['sobject'](_0x8d69('0x37'))[_0x8d69('0x33')](_0x5040c3,_0x305da5);case'account':var _0x2e3cbc=_[_0x8d69('0x2f')](_0x1dae6d);if(_0x2601ec['additionalSearchAccount']){var _0x4c8b16={};_0x4c8b16[_0x2601ec[_0x8d69('0x39')]]=_0x22c09b;_[_0x8d69('0x36')](_0x2e3cbc[_0x8d69('0x31')],_0x4c8b16);}return _0x13b98c[_0x8d69('0x20')](_0x8d69('0x3a'))['find'](_0x2e3cbc,_0x305da5);default:return null;}})['then'](function(_0x5a90b6){if(_0x5a90b6&&_0x5a90b6[_0x8d69('0x34')]){var _0x12d996=_[_0x8d69('0x3b')](_0x5a90b6);if(_0x12d996){return BPromise['resolve']({'id':_0x12d996['Id'],'name':_0x12d996[_0x8d69('0x2a')],'phone':_0x12d996['Phone'],'endUserType':_0x12d996[_0x8d69('0x3c')][_0x8d69('0x3d')][_0x8d69('0x3e')]()});}}})[_0x8d69('0x26')](function(_0x286868){if(_0x286868){logger[_0x8d69('0x1e')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x286868['endUserType'],_0x22c09b);return BPromise['resolve'](_0x286868);}else{logger[_0x8d69('0x1e')](_0x8d69('0x3f'),_0x22c09b);var _0x56b240={'Phone':_0x22c09b};if(_0x2601ec[_0x8d69('0x40')]){if(_0x2601ec[_0x8d69('0x40')]===_0x8d69('0x16')){logger[_0x8d69('0x1e')](_0x8d69('0x41'),_0x22c09b,_0x2601ec[_0x8d69('0x40')]);_0x56b240[_0x8d69('0x42')]=_0x5e3e7c!==_0x8d69('0x43')?_0x5e3e7c:util[_0x8d69('0x44')](_0x8d69('0x45'),_0x22c09b);}else if(_0x2601ec[_0x8d69('0x40')]==='lead'){logger['info'](_0x8d69('0x41'),_0x22c09b,_0x2601ec['moduleCreate']);_0x56b240[_0x8d69('0x42')]=_0x5e3e7c!==_0x8d69('0x43')?_0x5e3e7c:util[_0x8d69('0x44')](_0x8d69('0x45'),_0x22c09b);_0x56b240[_0x8d69('0x46')]='No\x20Company';}else if(_0x2601ec[_0x8d69('0x40')]==='account'){logger[_0x8d69('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x22c09b,_0x2601ec[_0x8d69('0x40')]);_0x56b240[_0x8d69('0x2a')]=_0x5e3e7c!==_0x8d69('0x43')?_0x5e3e7c:util['format'](_0x8d69('0x45'),_0x22c09b);}else{return null;}}return _0x13b98c[_0x8d69('0x20')](_['upperFirst'](_0x2601ec[_0x8d69('0x40')]))[_0x8d69('0x21')](_0x56b240)['then'](function(_0x5f450b){return BPromise['resolve']({'id':_0x5f450b['id'],'endUserType':_0x2601ec[_0x8d69('0x40')]});});}});}function getCustomFields(_0x37dd24,_0x2d9105){var _0x555195={};if(_0x37dd24['length']>0x0){_['forEach'](_0x37dd24,function(_0x2bbaf5){if(_['includes']([_0x8d69('0x47'),_0x8d69('0x48')],_0x2bbaf5['type'])&&_0x2bbaf5['idField']){_0x555195[_0x2bbaf5['idField']]=_0x2bbaf5[_0x8d69('0x49')][_0x8d69('0x4a')]();}else if(_0x2bbaf5['type']===_0x8d69('0x4b')&&_0x2bbaf5['variableName']&&_0x2bbaf5[_0x8d69('0x4c')]){_0x2d9105[_0x2bbaf5[_0x8d69('0x4d')]]&&(_0x555195[_0x2bbaf5[_0x8d69('0x4c')]]=_0x2d9105[_0x2bbaf5[_0x8d69('0x4d')]][_0x8d69('0x4a')]());}else if(_0x2bbaf5[_0x8d69('0x3d')]===_0x8d69('0x4e')&&_0x2bbaf5[_0x8d69('0x4f')]&&_0x2bbaf5['Variable'][_0x8d69('0x50')]&&_0x2bbaf5[_0x8d69('0x4c')]){_0x2d9105[_0x2bbaf5[_0x8d69('0x4f')][_0x8d69('0x50')][_0x8d69('0x3e')]()]&&(_0x555195[_0x2bbaf5['idField']]=_0x2d9105[_0x2bbaf5[_0x8d69('0x4f')][_0x8d69('0x50')][_0x8d69('0x3e')]()][_0x8d69('0x4a')]());}});}return _0x555195;}function getConnection(_0x5f51da){var _0x20d7c0=_0x5f51da['password'][_0x8d69('0x51')](_0x5f51da[_0x8d69('0x52')]);var _0x32f2a3=new jsforce[(_0x8d69('0x53'))]({'oauth2':{'loginUrl':_0x5f51da['remoteUri']||_0x8d69('0x54'),'clientId':_0x5f51da[_0x8d69('0x55')],'clientSecret':_0x5f51da['clientSecret']}});return _0x32f2a3['login'](_0x5f51da[_0x8d69('0x56')],_0x20d7c0)[_0x8d69('0x26')](function(){logger['info'](_0x8d69('0x57'));return _0x32f2a3;});}exports['queue']=function(_0x43d562,_0x55c200,_0x53c8a1,_0x4d996e,_0x293caf,_0x2a17e5){var _0x10ee66,_0xdf26ce,_0x2c2731,_0x18b2b5;_0x2a17e5[_0x8d69('0x58')]=intUtil['stripTrailingSlash'](_0x2a17e5['serverUrl']);_0x2a17e5[_0x8d69('0x59')]=intUtil['stripTrailingSlash'](_0x2a17e5[_0x8d69('0x59')]);if(_0x293caf&&_0x293caf[_0x8d69('0x5a')]){logger['info'](_0x8d69('0x5b'),_0x8d69('0x5c'));_0x55c200['recordingURL']=util[_0x8d69('0x44')](_0x8d69('0x5d'),_0x2a17e5['serverUrl'],_0x55c200[_0x8d69('0x5e')],md5(_0x55c200[_0x8d69('0x5e')]));}else{_0x55c200['recordingURL']='';}return getConnection(_0x2a17e5)[_0x8d69('0x26')](function(_0x45f732){_0x18b2b5=_0x45f732;return getUser(_0x2a17e5,_0x4d996e[_0x8d69('0x5f')],_0x18b2b5);})[_0x8d69('0x26')](function(_0x5acbd2){_0x10ee66=_0x5acbd2;return getEndUser(_0x2a17e5,_0x53c8a1,_0x55c200[_0x8d69('0x60')],_0x55c200[_0x8d69('0x61')],_0x18b2b5);})[_0x8d69('0x26')](function(_0x6749d8){_0xdf26ce=_0x6749d8;return getTicket(_0x2a17e5,_0x10ee66,_0xdf26ce,_0x53c8a1,_0x55c200,_0x53c8a1[_0x8d69('0x62')],_0x18b2b5,_0x8d69('0x63'));})[_0x8d69('0x26')](function(_0x4e4808){_0x2c2731=_0x4e4808;logger['info'](_0x8d69('0x64'),_0x2c2731['id']);logger[_0x8d69('0x1e')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2c2731['id'],_0x4d996e['name'],_0x2a17e5[_0x8d69('0x3d')]);switch(_0x2a17e5[_0x8d69('0x3d')]){case _0x8d69('0x65'):emit(util[_0x8d69('0x44')]('user:%s',_0x4d996e['name']),_0x8d69('0x66'),{'recordId':_0x2c2731['id']});break;case _0x8d69('0x67'):emit(util[_0x8d69('0x44')](_0x8d69('0x68'),_0x4d996e[_0x8d69('0x50')]),_0x8d69('0x69'),{'uri':util[_0x8d69('0x44')](_0x8d69('0x6a'),_0x18b2b5['instanceUrl'],_0x2c2731['id'])});break;default:logger[_0x8d69('0x6b')](_0x8d69('0x6c'));}})[_0x8d69('0x6d')](function(_0x2c2c23){logger[_0x8d69('0x6b')](_0x8d69('0x5b'),_0x2c2c23);});};exports['outbound']=function(_0x4bfd8b,_0x235fb4,_0x4230d7,_0xd2bf90,_0x142295,_0x269f59,_0x49dd0e){var _0x38837c,_0x4a48d9,_0x508c13,_0x47d6b3;_0x269f59[_0x8d69('0x58')]=intUtil[_0x8d69('0x6e')](_0x269f59[_0x8d69('0x58')]);_0x269f59[_0x8d69('0x59')]=intUtil[_0x8d69('0x6e')](_0x269f59[_0x8d69('0x59')]);if(_0x49dd0e&&_0x49dd0e[_0x8d69('0x6f')]&&_0x49dd0e['recordingFormat']!=='none'){logger['info'](_0x8d69('0x70'),_0x8d69('0x5c'));_0x235fb4[_0x8d69('0x71')]=util[_0x8d69('0x44')](_0x8d69('0x5d'),_0x269f59['serverUrl'],_0x235fb4[_0x8d69('0x5e')],md5(_0x235fb4[_0x8d69('0x5e')]));}return getConnection(_0x269f59)[_0x8d69('0x26')](function(_0x4b7f64){_0x47d6b3=_0x4b7f64;return getUser(_0x269f59,_0xd2bf90['email'],_0x47d6b3);})[_0x8d69('0x26')](function(_0x68ea84){_0x38837c=_0x68ea84;return getEndUser(_0x269f59,_0x4230d7,_0x235fb4[_0x8d69('0x72')],_0x235fb4[_0x8d69('0x73')],_0x47d6b3);})[_0x8d69('0x26')](function(_0x50b8ff){_0x4a48d9=_0x50b8ff;return getTicket(_0x269f59,_0x38837c,_0x4a48d9,_0x4230d7,_0x235fb4,_0x4230d7[_0x8d69('0x62')],_0x47d6b3,_0x8d69('0x74'));})[_0x8d69('0x26')](function(_0x52ce45){_0x508c13=_0x52ce45;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x508c13['id']);logger[_0x8d69('0x1e')](_0x8d69('0x75'),_0x508c13['id'],_0xd2bf90[_0x8d69('0x50')],_0x269f59[_0x8d69('0x3d')]);switch(_0x269f59[_0x8d69('0x3d')]){case _0x8d69('0x65'):emit(util['format'](_0x8d69('0x68'),_0xd2bf90['name']),_0x8d69('0x66'),{'recordId':_0x508c13['id']});break;case _0x8d69('0x67'):emit(util[_0x8d69('0x44')](_0x8d69('0x68'),_0xd2bf90[_0x8d69('0x50')]),'trigger:browser:url',{'uri':util[_0x8d69('0x44')](_0x8d69('0x6a'),_0x47d6b3['instanceUrl'],_0x508c13['id'])});break;default:logger[_0x8d69('0x6b')]('[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x8d69('0x6d')](function(_0x391e7d){logger['error'](_0x8d69('0x70'),_0x391e7d);});};exports[_0x8d69('0x76')]=function(_0x2f6073,_0x6ba98e,_0x32d9b1,_0x5d2ee9,_0x27b737,_0x2b7c2a){var _0x19d1c2,_0x30f9ad,_0x434565,_0x680f47;_0x2b7c2a[_0x8d69('0x58')]=intUtil[_0x8d69('0x6e')](_0x2b7c2a[_0x8d69('0x58')]);_0x2b7c2a[_0x8d69('0x59')]=intUtil[_0x8d69('0x6e')](_0x2b7c2a[_0x8d69('0x59')]);if(_0x27b737&&_0x27b737[_0x8d69('0x5a')]){logger[_0x8d69('0x1e')]('['+_0x6ba98e[_0x8d69('0x77')][_0x8d69('0x78')]()+']',_0x8d69('0x5c'));_0x6ba98e[_0x8d69('0x71')]=util[_0x8d69('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b7c2a[_0x8d69('0x58')],_0x6ba98e[_0x8d69('0x5e')],md5(_0x6ba98e[_0x8d69('0x5e')]));}else{_0x6ba98e['recordingURL']='';}return getConnection(_0x2b7c2a)[_0x8d69('0x26')](function(_0x3ab113){_0x680f47=_0x3ab113;if(!_[_0x8d69('0x22')](_0x5d2ee9)){return getUser(_0x2b7c2a,_0x5d2ee9[_0x8d69('0x50')],_0x680f47);}else{return getUser(_0x2b7c2a,null,_0x680f47);}})[_0x8d69('0x26')](function(_0x5e29c4){_0x19d1c2=_0x5e29c4;return getEndUser(_0x2b7c2a,_0x32d9b1,_0x6ba98e[_0x8d69('0x60')],_0x6ba98e['calleridnum'],_0x680f47);})[_0x8d69('0x26')](function(_0x5c388b){_0x30f9ad=_0x5c388b;return getTicket(_0x2b7c2a,_0x19d1c2,_0x30f9ad,_0x32d9b1,_0x6ba98e,_0x32d9b1[_0x8d69('0x62')],_0x680f47);})[_0x8d69('0x26')](function(_0xb71ce){_0x434565=_0xb71ce;logger['info']('['+_0x6ba98e['lastevent']['toUpperCase']()+_0x8d69('0x79'),_0x434565['id']);logger['info']('['+_0x6ba98e[_0x8d69('0x77')][_0x8d69('0x78')]()+_0x8d69('0x7a'),_0x2b7c2a[_0x8d69('0x3d')]);})['catch'](function(_0x4a74ff){logger[_0x8d69('0x6b')]('['+_0x6ba98e[_0x8d69('0x77')]['toUpperCase']()+']',_0x4a74ff);});}; \ No newline at end of file +var _0xbef1=['customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','[OUTBOUND]','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','isNil','calleridnum','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','assign','getString','Subjects','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','WhatId','Case','contact','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','validateEmail','execute','length','find','resolve','Name','identity','then','user_id','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','sobject','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','first','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','format','No\x20Company','upperFirst','create','forEach','string','picklist','content','toString','variable','variableName','idField'];(function(_0x255c49,_0x1aa0c9){var _0x1aa798=function(_0x23dadc){while(--_0x23dadc){_0x255c49['push'](_0x255c49['shift']());}};_0x1aa798(++_0x1aa0c9);}(_0xbef1,0x1a3));var _0x1bef=function(_0x279996,_0x3fdce7){_0x279996=_0x279996-0x0;var _0x1e98d8=_0xbef1[_0x279996];return _0x1e98d8;};'use strict';var _=require(_0x1bef('0x0'));var rp=require(_0x1bef('0x1'));var moment=require('moment');var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x1bef('0x2'));var util=require('util');var Redis=require(_0x1bef('0x3'));var intUtil=require(_0x1bef('0x4'));var config=require(_0x1bef('0x5'));var logger=require(_0x1bef('0x6'))(_0x1bef('0x7'));config[_0x1bef('0x8')]=_[_0x1bef('0x9')](config[_0x1bef('0x8')],{'host':_0x1bef('0xa'),'port':0x18eb});var io=require(_0x1bef('0xb'))(new Redis(config[_0x1bef('0x8')]));function emit(_0x5dd3d5,_0x4ae1e7,_0x2acf78){io['to'](_0x5dd3d5)['emit'](_0x4ae1e7,_0x2acf78);}function getTicket(_0x130872,_0x5100bb,_0xbd5780,_0x42b045,_0x169d9c,_0x2fe386,_0x1bb01e,_0xce7a1d){var _0xa01c04=Object[_0x1bef('0xc')]({},{'OwnerId':_0x5100bb['id'],'Subject':intUtil[_0x1bef('0xd')](_0x42b045[_0x1bef('0xe')],_0x169d9c,'\x20'),'Description':intUtil[_0x1bef('0xd')](_0x42b045['Descriptions'],_0x169d9c,'\x0a')},getCustomFields(_0x2fe386,_0x169d9c));if(_0xbd5780){if(_0x42b045['ticketType']==='Task'){_0xa01c04[_0x1bef('0xf')]=moment[_0x1bef('0x10')]();_0xa01c04[_0x1bef('0x11')]=![];_0xa01c04[_0x1bef('0x12')]=![];if(_0xbd5780['endUserType']==='contact'||_0xbd5780[_0x1bef('0x13')]===_0x1bef('0x14')){_0xa01c04[_0x1bef('0x15')]=_0xbd5780['id'];}else if(_0xbd5780[_0x1bef('0x13')]===_0x1bef('0x16')){_0xa01c04[_0x1bef('0x17')]=_0xbd5780['id'];}}else if(_0x42b045['ticketType']===_0x1bef('0x18')){if(_0xbd5780['endUserType']===_0x1bef('0x19')){_0xa01c04[_0x1bef('0x1a')]=_0xbd5780['id'];}else if(_0xbd5780[_0x1bef('0x13')]==='account'){_0xa01c04[_0x1bef('0x1b')]=_0xbd5780['id'];}else if(_0xbd5780[_0x1bef('0x13')]===_0x1bef('0x14')&&_0x42b045[_0x1bef('0x1c')]){_0xa01c04[_0x42b045[_0x1bef('0x1c')]]=_0xbd5780['id'];}else{logger[_0x1bef('0x1d')](_0x1bef('0x1e'));}}}return _0x1bb01e['sobject'](_0x42b045['ticketType'])['create'](_0xa01c04);}function getUser(_0x25af5d,_0x31e089,_0x238151){if(!_['isNil'](_0x31e089)&&intUtil[_0x1bef('0x1f')](_0x31e089)){var _0x4048e4={'Email':_0x31e089};var _0x5dc09b={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x238151['sobject']('User')['find'](_0x4048e4,_0x5dc09b)[_0x1bef('0x20')]()['then'](function(_0x84874d){if(_0x84874d[_0x1bef('0x21')]){var _0x3f95f6=_[_0x1bef('0x22')](_0x84874d,function(_0x27c782){return _0x27c782['Email']===_0x31e089;});if(_0x3f95f6){logger[_0x1bef('0x1d')]('Agent\x20%s\x20found.',_0x31e089);return BPromise[_0x1bef('0x23')]({'id':_0x3f95f6['Id'],'name':_0x3f95f6[_0x1bef('0x24')]});}}else{logger[_0x1bef('0x1d')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x31e089);return _0x238151[_0x1bef('0x25')]()[_0x1bef('0x26')](function(_0x25d985){return BPromise[_0x1bef('0x23')]({'id':_0x25d985[_0x1bef('0x27')],'name':_0x25d985['display_name']});});}});}else{logger['info'](_0x1bef('0x28'),_0x31e089);return _0x238151['identity']()[_0x1bef('0x26')](function(_0x24c866){return BPromise[_0x1bef('0x23')]({'id':_0x24c866['user_id'],'name':_0x24c866[_0x1bef('0x29')]});});}}function getEndUser(_0x20ff7e,_0x499112,_0x540a44,_0x20e8ad,_0x5f5df2){var _0x22f891={'$or':{'Phone':_0x20e8ad}};var _0x24fa9a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1bef('0x23')]()[_0x1bef('0x26')](function(){logger[_0x1bef('0x1d')](_0x1bef('0x2a'),_0x20e8ad,_0x499112[_0x1bef('0x2b')]);switch(_0x499112[_0x1bef('0x2b')]){case'contact_lead':var _0xb69e8b=_[_0x1bef('0x2c')](_0x22f891);if(_0x499112[_0x1bef('0x2d')]){var _0x23ba6c={};_0x23ba6c[_0x499112['additionalSearchContact']]=_0x20e8ad;_[_0x1bef('0x2e')](_0xb69e8b[_0x1bef('0x2f')],_0x23ba6c);}return _0x5f5df2[_0x1bef('0x30')](_0x1bef('0x31'))['find'](_0xb69e8b,_0x24fa9a)[_0x1bef('0x20')]()[_0x1bef('0x26')](function(_0x17abc1){if(_0x17abc1&&_0x17abc1[_0x1bef('0x21')]){return _0x17abc1;}else{var _0x5962e7=_[_0x1bef('0x2c')](_0x22f891);if(_0x499112[_0x1bef('0x32')]){var _0x14239e={};_0x14239e[_0x499112['additionalSearchLead']]=_0x20e8ad;_[_0x1bef('0x2e')](_0x5962e7['$or'],_0x14239e);}return _0x5f5df2[_0x1bef('0x30')](_0x1bef('0x33'))[_0x1bef('0x22')](_0x5962e7,_0x24fa9a);}});case _0x1bef('0x34'):var _0x2d53a5=_[_0x1bef('0x2c')](_0x22f891);if(_0x499112[_0x1bef('0x35')]){var _0x23ba6c={};_0x23ba6c[_0x499112[_0x1bef('0x35')]]=_0x20e8ad;_[_0x1bef('0x2e')](_0x2d53a5[_0x1bef('0x2f')],_0x23ba6c);}return _0x5f5df2[_0x1bef('0x30')]('Account')[_0x1bef('0x22')](_0x2d53a5,_0x24fa9a)[_0x1bef('0x20')]()['then'](function(_0x1084f7){if(_0x1084f7&&_0x1084f7[_0x1bef('0x21')]){return _0x1084f7;}else{var _0x16097a=_['cloneDeep'](_0x22f891);if(_0x499112[_0x1bef('0x2d')]){var _0x4e7364={};_0x4e7364[_0x499112[_0x1bef('0x2d')]]=_0x20e8ad;_[_0x1bef('0x2e')](_0x16097a['$or'],_0x4e7364);}return _0x5f5df2['sobject'](_0x1bef('0x31'))[_0x1bef('0x22')](_0x16097a,_0x24fa9a)[_0x1bef('0x26')](function(_0x23c7b8){if(_0x23c7b8&&_0x23c7b8[_0x1bef('0x21')]){return _0x23c7b8;}else{var _0x3c4dd5=_['cloneDeep'](_0x22f891);if(_0x499112['additionalSearchLead']){var _0x49afc2={};_0x49afc2[_0x499112[_0x1bef('0x32')]]=_0x20e8ad;_['merge'](_0x3c4dd5[_0x1bef('0x2f')],_0x49afc2);}return _0x5f5df2[_0x1bef('0x30')]('Lead')[_0x1bef('0x22')](_0x3c4dd5,_0x24fa9a);}});}});case'contact':var _0xb69e8b=_[_0x1bef('0x2c')](_0x22f891);if(_0x499112[_0x1bef('0x2d')]){var _0x23ba6c={};_0x23ba6c[_0x499112[_0x1bef('0x2d')]]=_0x20e8ad;_[_0x1bef('0x2e')](_0xb69e8b[_0x1bef('0x2f')],_0x23ba6c);}return _0x5f5df2['sobject'](_0x1bef('0x31'))[_0x1bef('0x22')](_0xb69e8b,_0x24fa9a)[_0x1bef('0x20')]();case _0x1bef('0x14'):var _0x54e517=_['cloneDeep'](_0x22f891);if(_0x499112[_0x1bef('0x32')]){var _0x23ba6c={};_0x23ba6c[_0x499112[_0x1bef('0x32')]]=_0x20e8ad;_[_0x1bef('0x2e')](_0x54e517[_0x1bef('0x2f')],_0x23ba6c);}return _0x5f5df2['sobject'](_0x1bef('0x33'))['find'](_0x54e517,_0x24fa9a);case _0x1bef('0x16'):var _0x2d53a5=_['cloneDeep'](_0x22f891);if(_0x499112[_0x1bef('0x35')]){var _0x23ba6c={};_0x23ba6c[_0x499112[_0x1bef('0x35')]]=_0x20e8ad;_[_0x1bef('0x2e')](_0x2d53a5['$or'],_0x23ba6c);}return _0x5f5df2['sobject']('Account')[_0x1bef('0x22')](_0x2d53a5,_0x24fa9a);default:return null;}})[_0x1bef('0x26')](function(_0x33bd01){if(_0x33bd01&&_0x33bd01[_0x1bef('0x21')]){var _0xab0e39=_[_0x1bef('0x36')](_0x33bd01);if(_0xab0e39){return BPromise[_0x1bef('0x23')]({'id':_0xab0e39['Id'],'name':_0xab0e39['Name'],'phone':_0xab0e39[_0x1bef('0x37')],'endUserType':_0xab0e39[_0x1bef('0x38')][_0x1bef('0x39')][_0x1bef('0x3a')]()});}}})[_0x1bef('0x26')](function(_0x4b3a4b){if(_0x4b3a4b){logger[_0x1bef('0x1d')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x4b3a4b[_0x1bef('0x13')],_0x20e8ad);return BPromise[_0x1bef('0x23')](_0x4b3a4b);}else{logger[_0x1bef('0x1d')](_0x1bef('0x3b'),_0x20e8ad);var _0x1ddd62={'Phone':_0x20e8ad};if(_0x499112[_0x1bef('0x3c')]){if(_0x499112[_0x1bef('0x3c')]==='contact'){logger['info'](_0x1bef('0x3d'),_0x20e8ad,_0x499112[_0x1bef('0x3c')]);_0x1ddd62[_0x1bef('0x3e')]=_0x540a44!==_0x1bef('0x3f')?_0x540a44:util['format'](_0x1bef('0x40'),_0x20e8ad);}else if(_0x499112[_0x1bef('0x3c')]===_0x1bef('0x14')){logger[_0x1bef('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x20e8ad,_0x499112[_0x1bef('0x3c')]);_0x1ddd62[_0x1bef('0x3e')]=_0x540a44!==_0x1bef('0x3f')?_0x540a44:util[_0x1bef('0x41')](_0x1bef('0x40'),_0x20e8ad);_0x1ddd62['Company']=_0x1bef('0x42');}else if(_0x499112[_0x1bef('0x3c')]===_0x1bef('0x16')){logger[_0x1bef('0x1d')](_0x1bef('0x3d'),_0x20e8ad,_0x499112[_0x1bef('0x3c')]);_0x1ddd62[_0x1bef('0x24')]=_0x540a44!==''?_0x540a44:util[_0x1bef('0x41')]('Caller\x20-\x20%s',_0x20e8ad);}else{return null;}}return _0x5f5df2[_0x1bef('0x30')](_[_0x1bef('0x43')](_0x499112[_0x1bef('0x3c')]))[_0x1bef('0x44')](_0x1ddd62)[_0x1bef('0x26')](function(_0x4c51fc){return BPromise[_0x1bef('0x23')]({'id':_0x4c51fc['id'],'endUserType':_0x499112[_0x1bef('0x3c')]});});}});}function getCustomFields(_0x31f5a0,_0x5410e3){var _0x14d738={};if(_0x31f5a0[_0x1bef('0x21')]>0x0){_[_0x1bef('0x45')](_0x31f5a0,function(_0x5aa245){if(_['includes']([_0x1bef('0x46'),_0x1bef('0x47')],_0x5aa245['type'])&&_0x5aa245['idField']){_0x14d738[_0x5aa245['idField']]=_0x5aa245[_0x1bef('0x48')][_0x1bef('0x49')]();}else if(_0x5aa245[_0x1bef('0x39')]===_0x1bef('0x4a')&&_0x5aa245[_0x1bef('0x4b')]&&_0x5aa245[_0x1bef('0x4c')]){_0x5410e3[_0x5aa245[_0x1bef('0x4b')]]&&(_0x14d738[_0x5aa245[_0x1bef('0x4c')]]=_0x5410e3[_0x5aa245[_0x1bef('0x4b')]][_0x1bef('0x49')]());}else if(_0x5aa245[_0x1bef('0x39')]===_0x1bef('0x4d')&&_0x5aa245[_0x1bef('0x4e')]&&_0x5aa245[_0x1bef('0x4e')][_0x1bef('0x4f')]&&_0x5aa245[_0x1bef('0x4c')]){_0x5410e3[_0x5aa245[_0x1bef('0x4e')][_0x1bef('0x4f')][_0x1bef('0x3a')]()]&&(_0x14d738[_0x5aa245['idField']]=_0x5410e3[_0x5aa245[_0x1bef('0x4e')]['name']['toLowerCase']()][_0x1bef('0x49')]());}});}return _0x14d738;}function getConnection(_0x2ce884){var _0x466fbe=_0x2ce884[_0x1bef('0x50')][_0x1bef('0x51')](_0x2ce884['securityToken']);var _0x5a4b41=new jsforce[(_0x1bef('0x52'))]({'oauth2':{'loginUrl':_0x2ce884[_0x1bef('0x53')]||_0x1bef('0x54'),'clientId':_0x2ce884[_0x1bef('0x55')],'clientSecret':_0x2ce884[_0x1bef('0x56')]}});return _0x5a4b41['login'](_0x2ce884['username'],_0x466fbe)[_0x1bef('0x26')](function(){logger[_0x1bef('0x1d')](_0x1bef('0x57'));return _0x5a4b41;});}exports[_0x1bef('0x58')]=function(_0x56542c,_0x5c5c1d,_0x186b7e,_0x1b057e,_0x35c928,_0x35e1d4){var _0x1cd511,_0x11858e,_0x9922ac,_0x32706f;_0x35e1d4['serverUrl']=intUtil[_0x1bef('0x59')](_0x35e1d4[_0x1bef('0x5a')]);_0x35e1d4[_0x1bef('0x53')]=intUtil[_0x1bef('0x59')](_0x35e1d4['remoteUri']);if(_0x35c928&&_0x35c928[_0x1bef('0x5b')]){logger['info'](_0x1bef('0x5c'),_0x1bef('0x5d'));_0x5c5c1d[_0x1bef('0x5e')]=util[_0x1bef('0x41')](_0x1bef('0x5f'),_0x35e1d4['serverUrl'],_0x5c5c1d[_0x1bef('0x60')],md5(_0x5c5c1d[_0x1bef('0x60')]));}else{_0x5c5c1d[_0x1bef('0x5e')]='';}return getConnection(_0x35e1d4)[_0x1bef('0x26')](function(_0x31937d){_0x32706f=_0x31937d;return getUser(_0x35e1d4,_0x1b057e[_0x1bef('0x61')],_0x32706f);})[_0x1bef('0x26')](function(_0x3938d5){_0x1cd511=_0x3938d5;return getEndUser(_0x35e1d4,_0x186b7e,_0x5c5c1d[_0x1bef('0x62')],_0x5c5c1d['calleridnum'],_0x32706f);})[_0x1bef('0x26')](function(_0x2bbd83){_0x11858e=_0x2bbd83;return getTicket(_0x35e1d4,_0x1cd511,_0x11858e,_0x186b7e,_0x5c5c1d,_0x186b7e[_0x1bef('0x63')],_0x32706f,_0x1bef('0x58'));})['then'](function(_0x381b52){_0x9922ac=_0x381b52;logger[_0x1bef('0x1d')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x9922ac['id']);logger['info'](_0x1bef('0x64'),_0x9922ac['id'],_0x1b057e['name'],_0x35e1d4[_0x1bef('0x39')]);switch(_0x35e1d4[_0x1bef('0x39')]){case'integrationTab':emit(util[_0x1bef('0x41')]('user:%s',_0x1b057e[_0x1bef('0x4f')]),_0x1bef('0x65'),{'recordId':_0x9922ac['id']});break;case _0x1bef('0x66'):emit(util['format'](_0x1bef('0x67'),_0x1b057e[_0x1bef('0x4f')]),_0x1bef('0x68'),{'uri':util[_0x1bef('0x41')](_0x1bef('0x69'),_0x32706f[_0x1bef('0x6a')],_0x9922ac['id'])});break;default:logger[_0x1bef('0x6b')](_0x1bef('0x6c'));}})[_0x1bef('0x6d')](function(_0xf829c4){logger[_0x1bef('0x6b')]('[QUEUE]',_0xf829c4);});};exports['outbound']=function(_0x31c4ab,_0x2c1570,_0x5bb7be,_0x5c4965,_0x47c9d3,_0x1c50b3,_0x2690df){var _0x18f534,_0x420007,_0x5185f5,_0xf1b5bf;_0x1c50b3[_0x1bef('0x5a')]=intUtil['stripTrailingSlash'](_0x1c50b3[_0x1bef('0x5a')]);_0x1c50b3['remoteUri']=intUtil['stripTrailingSlash'](_0x1c50b3[_0x1bef('0x53')]);if(_0x2690df&&_0x2690df[_0x1bef('0x6e')]&&_0x2690df[_0x1bef('0x6e')]!==_0x1bef('0x6f')){logger[_0x1bef('0x1d')](_0x1bef('0x70'),'Recording\x20is\x20enabled!');_0x2c1570[_0x1bef('0x5e')]=util[_0x1bef('0x41')](_0x1bef('0x5f'),_0x1c50b3[_0x1bef('0x5a')],_0x2c1570[_0x1bef('0x60')],md5(_0x2c1570[_0x1bef('0x60')]));}return getConnection(_0x1c50b3)[_0x1bef('0x26')](function(_0x450c00){_0xf1b5bf=_0x450c00;return getUser(_0x1c50b3,_0x5c4965[_0x1bef('0x61')],_0xf1b5bf);})['then'](function(_0x1da412){_0x18f534=_0x1da412;return getEndUser(_0x1c50b3,_0x5bb7be,_0x2c1570['destcalleridname'],_0x2c1570['destcalleridnum'],_0xf1b5bf);})[_0x1bef('0x26')](function(_0x4ce1c9){_0x420007=_0x4ce1c9;return getTicket(_0x1c50b3,_0x18f534,_0x420007,_0x5bb7be,_0x2c1570,_0x5bb7be['Fields'],_0xf1b5bf,_0x1bef('0x71'));})['then'](function(_0xa5d173){_0x5185f5=_0xa5d173;logger[_0x1bef('0x1d')](_0x1bef('0x72'),_0x5185f5['id']);logger[_0x1bef('0x1d')](_0x1bef('0x73'),_0x5185f5['id'],_0x5c4965[_0x1bef('0x4f')],_0x1c50b3[_0x1bef('0x39')]);switch(_0x1c50b3['type']){case'integrationTab':emit(util['format'](_0x1bef('0x67'),_0x5c4965[_0x1bef('0x4f')]),_0x1bef('0x65'),{'recordId':_0x5185f5['id']});break;case _0x1bef('0x66'):emit(util[_0x1bef('0x41')]('user:%s',_0x5c4965[_0x1bef('0x4f')]),'trigger:browser:url',{'uri':util[_0x1bef('0x41')]('%s/%s/e',_0xf1b5bf[_0x1bef('0x6a')],_0x5185f5['id'])});break;default:logger[_0x1bef('0x6b')](_0x1bef('0x70'),_0x1bef('0x74'));}})['catch'](function(_0x9a66c1){logger['error'](_0x1bef('0x70'),_0x9a66c1);});};exports[_0x1bef('0x75')]=function(_0x1e1f77,_0x1f5382,_0x531565,_0x47ae5e,_0x5ed685,_0x4cde12){var _0x3de899,_0x4c5bb7,_0x4d0f5f,_0x3e77b3;_0x4cde12[_0x1bef('0x5a')]=intUtil['stripTrailingSlash'](_0x4cde12[_0x1bef('0x5a')]);_0x4cde12[_0x1bef('0x53')]=intUtil[_0x1bef('0x59')](_0x4cde12['remoteUri']);if(_0x5ed685&&_0x5ed685['monitor_format']){logger[_0x1bef('0x1d')]('['+_0x1f5382[_0x1bef('0x76')]['toUpperCase']()+']',_0x1bef('0x5d'));_0x1f5382[_0x1bef('0x5e')]=util[_0x1bef('0x41')](_0x1bef('0x5f'),_0x4cde12[_0x1bef('0x5a')],_0x1f5382['uniqueid'],md5(_0x1f5382['uniqueid']));}else{_0x1f5382[_0x1bef('0x5e')]='';}return getConnection(_0x4cde12)[_0x1bef('0x26')](function(_0x4761e5){_0x3e77b3=_0x4761e5;if(!_[_0x1bef('0x77')](_0x47ae5e)){return getUser(_0x4cde12,_0x47ae5e[_0x1bef('0x4f')],_0x3e77b3);}else{return getUser(_0x4cde12,null,_0x3e77b3);}})[_0x1bef('0x26')](function(_0x2a9e91){_0x3de899=_0x2a9e91;return getEndUser(_0x4cde12,_0x531565,_0x1f5382[_0x1bef('0x62')],_0x1f5382[_0x1bef('0x78')],_0x3e77b3);})[_0x1bef('0x26')](function(_0x417425){_0x4c5bb7=_0x417425;return getTicket(_0x4cde12,_0x3de899,_0x4c5bb7,_0x531565,_0x1f5382,_0x531565[_0x1bef('0x63')],_0x3e77b3);})[_0x1bef('0x26')](function(_0x38d6bd){_0x4d0f5f=_0x38d6bd;logger[_0x1bef('0x1d')]('['+_0x1f5382['lastevent'][_0x1bef('0x79')]()+_0x1bef('0x7a'),_0x4d0f5f['id']);logger[_0x1bef('0x1d')]('['+_0x1f5382[_0x1bef('0x76')]['toUpperCase']()+_0x1bef('0x7b'),_0x4cde12[_0x1bef('0x39')]);})[_0x1bef('0x6d')](function(_0x195d24){logger['error']('['+_0x1f5382[_0x1bef('0x76')]['toUpperCase']()+']',_0x195d24);});}; \ 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 4c0e2df..af7b396 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 _0x51ff=['bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','info','],\x20getAdminUser\x20crm','catch','error','message','toUpperCase','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','user','endUserNumber','System','endUserId','sys_id','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','includes','string','picklist','nameField','customField','content','toString','type','idField','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Descriptions','Fields','number','GET','Incident\x20-\x20','ticketNumber','forEach',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','sysparm_limit=1','stripTrailingSlash','serverUrl','remoteUri','isNil','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','ticketId','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect'];(function(_0x3c5e54,_0x2b991b){var _0x3ae1f3=function(_0x43f80f){while(--_0x43f80f){_0x3c5e54['push'](_0x3c5e54['shift']());}};_0x3ae1f3(++_0x2b991b);}(_0x51ff,0x65));var _0xf51f=function(_0x57809d,_0x4736db){_0x57809d=_0x57809d-0x0;var _0x5c4d48=_0x51ff[_0x57809d];return _0x5c4d48;};'use strict';var _=require('lodash');var Promise=require(_0xf51f('0x0'));var rp=require('request-promise');var util=require(_0xf51f('0x1'));var md5=require('md5');var Redis=require(_0xf51f('0x2'));var intUtil=require(_0xf51f('0x3'));var config=require(_0xf51f('0x4'));var logger=require(_0xf51f('0x5'))(_0xf51f('0x6'));config[_0xf51f('0x7')]=_[_0xf51f('0x8')](config[_0xf51f('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xf51f('0x9'))(new Redis(config[_0xf51f('0x7')]));function getAdminUser(_0xdcf751,_0x3b3e03,_0x3d9f1f,_0x195354,_0x184d0a,_0x20d91d){return new Promise(function(_0x42b514,_0x367f12){var _0x26c4c4={'method':'GET','uri':_0x195354+_0xf51f('0xa')+'&'+_0x184d0a+'&'+_0x20d91d,'auth':_0x3b3e03,'json':!![]};return rp(_0x26c4c4)[_0xf51f('0xb')](function(_0x1bc3eb){if(_0x1bc3eb[_0xf51f('0xc')][_0xf51f('0xd')]>0x0){_0x3d9f1f['adminId']=_0x1bc3eb[_0xf51f('0xc')][0x0]['sys_id'];}logger[_0xf51f('0xe')]('['+[_0xdcf751['toUpperCase']()]+_0xf51f('0xf'),_0x3d9f1f);_0x42b514(_0x3d9f1f);})[_0xf51f('0x10')](function(_0x4fe801){logger[_0xf51f('0x11')]('['+[_0xdcf751['toUpperCase']()]+']',_0x4fe801[_0xf51f('0x12')]);_0x367f12(_0x4fe801[_0xf51f('0x12')]);});});}function getUser(_0x559eef,_0x426f05,_0xd28c27,_0x1440a6,_0xa39a32){return function(_0x413d60){logger['info']('['+[_0x559eef[_0xf51f('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x413d60);return new Promise(function(_0x48c00a,_0x5f0142){if(intUtil[_0xf51f('0x14')](_0x413d60[_0xf51f('0x15')])){var _0x56f8d4={'method':'GET','uri':_0xd28c27+'sys_user?sysparm_query=email%3D'+_0x413d60[_0xf51f('0x15')]+'&'+_0x1440a6+'&'+_0xa39a32,'auth':_0x426f05,'json':!![]};logger[_0xf51f('0xe')]('['+[_0x559eef[_0xf51f('0x13')]()]+_0xf51f('0x16'),_0x56f8d4);return rp(_0x56f8d4)[_0xf51f('0xb')](function(_0x21d85a){logger[_0xf51f('0xe')]('['+[_0x559eef[_0xf51f('0x13')]()]+_0xf51f('0x17'),_0x21d85a);if(_0x21d85a[_0xf51f('0xc')][_0xf51f('0xd')]>0x0&&String(_0x21d85a[_0xf51f('0xc')][0x0][_0xf51f('0x18')])===_0xf51f('0x19')){_0x413d60[_0xf51f('0x1a')]=_0x21d85a[_0xf51f('0xc')][0x0]['sys_id'];}else{_0x413d60[_0xf51f('0x1a')]=_0x413d60[_0xf51f('0x1b')];_0x413d60['userEmail']=_0x413d60[_0xf51f('0x1c')];}logger['info']('['+[_0x559eef[_0xf51f('0x13')]()]+_0xf51f('0x1d'),_0x413d60);_0x48c00a(_0x413d60);})[_0xf51f('0x10')](function(_0x250564){logger[_0xf51f('0x11')]('['+[_0x559eef[_0xf51f('0x13')]()]+']',_0x250564[_0xf51f('0x12')]);_0x5f0142(_0x250564['message']);});}else{logger[_0xf51f('0xe')]('['+[_0x559eef[_0xf51f('0x13')]()]+_0xf51f('0x1e'));_0x413d60['userId']=_0x413d60[_0xf51f('0x1b')];_0x413d60[_0xf51f('0x15')]=_0x413d60['adminEmail'];_0x48c00a(_0x413d60);}});};}function createEndUser(_0x38c662,_0x246933,_0x5870af,_0x240919,_0x1a193a){logger['info']('['+[_0x38c662[_0xf51f('0x13')]()]+_0xf51f('0x1f'),_0x5870af);return new Promise(function(_0x2219f5,_0x539478){var _0x1e73b1={'method':_0xf51f('0x20'),'uri':_0x240919+'sys_user?'+_0x1a193a,'body':{'user_name':_0x5870af['endUserNumber'],'roles':_0xf51f('0x21'),'first_name':_0x5870af[_0xf51f('0x22')],'active':'true','date_format':_0xf51f('0x23'),'phone':_0x5870af[_0xf51f('0x22')]},'auth':_0x246933,'json':!![]};return rp(_0x1e73b1)[_0xf51f('0xb')](function(_0x5ef111){logger[_0xf51f('0xe')]('['+[_0x38c662['toUpperCase']()]+'],\x20EndUser\x20schema',_0x5ef111[_0xf51f('0xc')]);_0x5870af[_0xf51f('0x24')]=_0x5ef111[_0xf51f('0xc')][_0xf51f('0x25')];_0x2219f5(_0x5870af);})[_0xf51f('0x10')](function(_0x33dc96){logger[_0xf51f('0x11')]('['+[_0x38c662[_0xf51f('0x13')]()]+']',_0x33dc96[_0xf51f('0x12')]);_0x539478(_0x33dc96[_0xf51f('0x12')]);});});}function getEndUser(_0x59e356,_0x4afe02,_0x4468dd,_0x597b93,_0x33f8a7){return function(_0x42b0e4){logger[_0xf51f('0xe')]('['+[_0x59e356[_0xf51f('0x13')]()]+_0xf51f('0x26'),_0x42b0e4);return new Promise(function(_0x5cd073,_0x4e6201){var _0x4c416a={'method':'GET','uri':_0x4468dd+_0xf51f('0x27')+_0x42b0e4['endUserNumber']+'&'+_0x597b93+'&'+_0x33f8a7,'auth':_0x4afe02,'json':!![]};return rp(_0x4c416a)[_0xf51f('0xb')](function(_0x41f15a){if(_0x41f15a[_0xf51f('0xc')][_0xf51f('0xd')]>0x0){_0x42b0e4[_0xf51f('0x24')]=_0x41f15a[_0xf51f('0xc')][0x0][_0xf51f('0x25')];logger[_0xf51f('0xe')]('['+[_0x59e356[_0xf51f('0x13')]()]+'],\x20getEndUser\x20crm',_0x42b0e4);_0x5cd073(_0x42b0e4);}else{return createEndUser(_0x59e356,_0x4afe02,_0x42b0e4,_0x4468dd,_0x597b93)[_0xf51f('0xb')](function(_0x5e0916){logger[_0xf51f('0xe')]('['+[_0x59e356['toUpperCase']()]+_0xf51f('0x28'),_0x5e0916);_0x5cd073(_0x5e0916);});}})[_0xf51f('0x10')](function(_0x407627){logger[_0xf51f('0x11')]('['+[_0x59e356['toUpperCase']()]+']',_0x407627[_0xf51f('0x12')]);_0x4e6201(_0x407627['message']);});});};}function getCustomFields(_0x51408a,_0x4bb07f){var _0x52412d={};if(_0x51408a[_0xf51f('0xd')]>0x0){_['forEach'](_0x51408a,function(_0x517d7e){if(_[_0xf51f('0x29')]([_0xf51f('0x2a'),_0xf51f('0x2b')],_0x517d7e['type'])&&_0x517d7e[_0xf51f('0x2c')]&&!_0x517d7e[_0xf51f('0x2d')]){_0x52412d[_0x517d7e['nameField']['toLowerCase']()]=_0x517d7e[_0xf51f('0x2e')][_0xf51f('0x2f')]();}else if(_['includes'](['string',_0xf51f('0x2b')],_0x517d7e[_0xf51f('0x30')])&&_0x517d7e[_0xf51f('0x31')]&&_0x517d7e[_0xf51f('0x2d')]){_0x52412d[_0x517d7e[_0xf51f('0x31')][_0xf51f('0x32')]()]=_0x517d7e[_0xf51f('0x2e')][_0xf51f('0x2f')]();}else if(_0x517d7e[_0xf51f('0x30')]===_0xf51f('0x33')&&_0x517d7e['variableName']&&_0x517d7e[_0xf51f('0x31')]&&_0x517d7e[_0xf51f('0x2d')]){_0x52412d[_0x517d7e['idField'][_0xf51f('0x32')]()]=_0x4bb07f[_0x517d7e[_0xf51f('0x34')]]['toString']();}else if(_0x517d7e[_0xf51f('0x30')]==='customVariable'&&_0x517d7e[_0xf51f('0x35')]&&_0x517d7e[_0xf51f('0x35')]['name']&&_0x517d7e[_0xf51f('0x31')]&&_0x517d7e['customField']){_0x52412d[_0x517d7e[_0xf51f('0x31')]['toLowerCase']()]=_0x4bb07f[_0x517d7e[_0xf51f('0x35')][_0xf51f('0x36')][_0xf51f('0x32')]()][_0xf51f('0x2f')]();}});}return _0x52412d;}function getTicket(_0x2175bb,_0x2012cf,_0x1218a9,_0x2cf41b,_0x403438,_0x57af29){return function(_0x5847e4){logger['info']('['+[_0x2175bb[_0xf51f('0x13')]()]+_0xf51f('0x37'),_0x5847e4);return new Promise(function(_0x3041c0,_0x4d3e16){var _0x3a75d7=_0x2175bb[_0xf51f('0x32')]()==='outbound'?_0x5847e4[_0xf51f('0x1a')]:_0x5847e4[_0xf51f('0x24')];var _0x119e10={'method':'POST','uri':_0x1218a9+_0xf51f('0x38')+'?'+_0x57af29,'body':Object[_0xf51f('0x39')]({},{'active':'true','caller_id':_0x3a75d7,'assigned_to':_0x5847e4[_0xf51f('0x1a')],'short_description':intUtil[_0xf51f('0x3a')](_0x2cf41b['Subjects'],_0x403438,'\x20'),'description':intUtil[_0xf51f('0x3a')](_0x2cf41b[_0xf51f('0x3b')],_0x403438,'\x0a')},getCustomFields(_0x2cf41b[_0xf51f('0x3c')],_0x403438)),'auth':_0x2012cf,'json':!![]};return rp(_0x119e10)[_0xf51f('0xb')](function(_0x426176){logger[_0xf51f('0xe')]('['+[_0x2175bb['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x426176['result']);_0x5847e4['ticketId']=_0x426176[_0xf51f('0xc')][_0xf51f('0x25')];_0x5847e4['ticketNumber']=_0x426176[_0xf51f('0xc')][_0xf51f('0x3d')];logger[_0xf51f('0xe')]('['+[_0x2175bb['toUpperCase']()]+']\x20getTicket\x20crm',_0x5847e4);_0x3041c0(_0x5847e4);})[_0xf51f('0x10')](function(_0x1fa05a){logger[_0xf51f('0x11')]('['+[_0x2175bb[_0xf51f('0x13')]()]+']',_0x1fa05a[_0xf51f('0x12')]);_0x4d3e16(_0x1fa05a['message']);});});};}function createRemoteTag(_0x48e2d6,_0x4ed795,_0x32ecfd,_0x5031a5){return new Promise(function(_0x42ceb8,_0x1180c6){var _0x536374={'method':_0xf51f('0x20'),'uri':_0x32ecfd+'label'+'?'+_0x5031a5,'body':{'short_description':_0x48e2d6,'global':!![],'active':!![],'name':_0x48e2d6},'auth':_0x4ed795,'json':!![]};return rp(_0x536374)['then'](function(_0x49e5a2){var _0x3b6e58=_0x49e5a2['result']['sys_id'];_0x42ceb8(_0x3b6e58);});});}function getRemoteTag(_0x2771ea,_0x6a7d98,_0x4a1d33,_0xf255ff,_0xb1700e){return new Promise(function(_0x36fd2a,_0x1a24c2){var _0x4a9fa0={'method':_0xf51f('0x3e'),'uri':_0x4a1d33+'label'+'?sysparm_query=name%3D'+_0x2771ea+'&'+_0xf255ff,'auth':_0x6a7d98,'json':!![]};return rp(_0x4a9fa0)[_0xf51f('0xb')](function(_0x319cc9){if(_0x319cc9['result']['length']>0x0){var _0x460906=_0x319cc9['result'][0x0][_0xf51f('0x25')];_0x36fd2a(_0x460906);}else{return createRemoteTag(_0x2771ea,_0x6a7d98,_0x4a1d33,_0xf255ff)['then'](function(_0x54050b){_0x36fd2a(_0x54050b);});}});});}function assignTagToIncident(_0x2e7041,_0x4a2975,_0x366692,_0x3c6c5f,_0x44c064){return new Promise(function(_0x3dd123,_0x13d0fd){var _0x527298={'method':'POST','uri':_0x366692+'label_entry'+'?'+_0x44c064,'body':{'label':_0x2e7041,'table':_0xf51f('0x38'),'id_type':'Incident','table_key':_0x3c6c5f['ticketId'],'title':_0xf51f('0x3f')+_0x3c6c5f['ticketNumber'],'id_display':_0x3c6c5f[_0xf51f('0x40')]},'auth':_0x4a2975,'json':!![]};return rp(_0x527298)['then'](function(_0x2dcaee){_0x3dd123();})[_0xf51f('0x10')](function(){_0x3dd123();});});}function manageTags(_0x10c7ba,_0x3ba6fc,_0x3d951b,_0x3ca1ba,_0x2c1c28,_0x4d32f9,_0x3f9182){return new Promise(function(_0x591ae9,_0x3eaebe){var _0x55cb50=[];_0x3ba6fc[_0xf51f('0x41')](function(_0x52b555){_0x55cb50['push'](getRemoteTag(_0x52b555,_0x3d951b,_0x3ca1ba,_0x4d32f9,_0x3f9182));});return Promise['all'](_0x55cb50)['then'](function(_0x5152bb){if(_0x5152bb[_0xf51f('0xd')]){logger['info']('['+[_0x10c7ba[_0xf51f('0x13')]()]+_0xf51f('0x42'),_0x5152bb);var _0x3118b7=[];_0x5152bb['forEach'](function(_0x4ca308){_0x3118b7[_0xf51f('0x43')](assignTagToIncident(_0x4ca308,_0x3d951b,_0x3ca1ba,_0x2c1c28,_0x4d32f9));});return Promise[_0xf51f('0x44')](_0x3118b7)[_0xf51f('0xb')](function(){_0x591ae9();})['catch'](function(){_0x591ae9();});}else{_0x591ae9();}});});}function getTags(_0x2d16e6,_0xd2546e,_0x4b56b5,_0x57ee65,_0xfa839f,_0x5f4728){return function(_0x229038){return new Promise(function(_0x2b5da4,_0x2a05b7){var _0x569af9=[];var _0x506244=_0x57ee65[_0xf51f('0x45')];if(_0x506244&&_0x506244['length']>0x0){_0x569af9=_[_0xf51f('0x46')](_0x506244,'name');}if(_0x569af9[_0xf51f('0xd')]>0x0){return manageTags(_0x2d16e6,_0x569af9,_0xd2546e,_0x4b56b5,_0x229038,_0xfa839f,_0x5f4728)[_0xf51f('0xb')](function(){_0x2b5da4(_0x229038);});}else{_0x2b5da4(_0x229038);}});};}function emit(_0x3f5b0f,_0x3b7a89,_0x158edc){var _0x10429b=_0xf51f('0x47')+_0xf51f('0x48')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x22a7bb={'uri':_0x3f5b0f+_0xf51f('0x49')+_0x158edc+_0x10429b};io['to'](util[_0xf51f('0x4a')](_0xf51f('0x4b'),_0x3b7a89))['emit'](_0xf51f('0x4c'),_0x22a7bb);}exports['cs']=function(_0x182ba9,_0x2fb484,_0x24d431,_0x4c85e9,_0x3b843e,_0x4e686d,_0x171766,_0x3d1870){var _0x17e375={};var _0x4627f9={'user':_0x4e686d['username'],'pass':_0x4e686d['password']};var _0x171d2c=_0xf51f('0x4d');var _0x3fb7a4='sysparm_display_value=true';_0x4e686d['remoteUri']=intUtil[_0xf51f('0x4e')](_0x4e686d['remoteUri']);_0x4e686d[_0xf51f('0x4f')]=intUtil[_0xf51f('0x4e')](_0x4e686d[_0xf51f('0x4f')]);var _0x27a049=util[_0xf51f('0x4a')]('%s/api/now/table/',_0x4e686d[_0xf51f('0x50')]);_0x17e375['userEmail']=!_[_0xf51f('0x51')](_0x4c85e9)?_0x4c85e9['email']:null;_0x17e375[_0xf51f('0x1c')]=_0x4e686d['email'];_0x17e375[_0xf51f('0x22')]=_0x3d1870[_0xf51f('0x32')]()===_0xf51f('0x52')?_0x2fb484[_0xf51f('0x53')]:_0x2fb484[_0xf51f('0x54')];_0x17e375[_0xf51f('0x55')]=_0x3d1870===_0xf51f('0x56')||_0x3d1870===_0xf51f('0x57')?'queue':'outbound';var _0xe8cb2a=util['format'](_0xf51f('0x58'),_0x4e686d[_0xf51f('0x4f')],_0x2fb484[_0xf51f('0x59')],md5(_0x2fb484[_0xf51f('0x59')]));if(_0x3b843e&&_0x3b843e['monitor_format']){logger['info'](_0xf51f('0x5a'),_0xf51f('0x5b'));_0x2fb484[_0xf51f('0x5c')]=_0xe8cb2a;}else if(_0x171766&&_0x171766[_0xf51f('0x5d')]&&_0x171766['recordingFormat']!==_0xf51f('0x5e')){logger[_0xf51f('0xe')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x2fb484[_0xf51f('0x5c')]=_0xe8cb2a;}else{_0x2fb484['recordingURL']='';}return getAdminUser(_0x3d1870,_0x4627f9,_0x17e375,_0x27a049,_0x3fb7a4,_0x171d2c)[_0xf51f('0xb')](getUser(_0x3d1870,_0x4627f9,_0x27a049,_0x3fb7a4,_0x171d2c))[_0xf51f('0xb')](getEndUser(_0x3d1870,_0x4627f9,_0x27a049,_0x3fb7a4,_0x171d2c))['then'](getTicket(_0x3d1870,_0x4627f9,_0x27a049,_0x24d431,_0x2fb484,_0x3fb7a4))[_0xf51f('0xb')](function(_0x42f24b){logger[_0xf51f('0xe')](util[_0xf51f('0x4a')](_0xf51f('0x5f'),_0x42f24b[_0xf51f('0x60')]));logger['info'](util[_0xf51f('0x4a')](_0xf51f('0x61'),_0x3d1870));if(_0x3d1870!==_0xf51f('0x57')){logger[_0xf51f('0xe')]('['+[_0x3d1870[_0xf51f('0x13')]()]+']',_0xf51f('0x62'));emit(_0x4e686d[_0xf51f('0x50')],_0x4c85e9[_0xf51f('0x36')],_0x42f24b[_0xf51f('0x60')]);}})[_0xf51f('0x10')](function(_0x17cc66){logger[_0xf51f('0x11')]('['+[_0x3d1870[_0xf51f('0x13')]()]+_0xf51f('0x63'),util[_0xf51f('0x64')](_0x17cc66,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xcbf8=['outbound','incident','assign','Subjects','Descriptions','ticketId','number','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','error','message','],\x20getUser\x20input\x20crm','userEmail','],\x20getUser\x20entity','active','true','userId','sys_id','catch',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserNumber','forEach','string','type','customField','nameField','content','toString','includes','picklist','idField','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm'];(function(_0x1b6f26,_0x1016af){var _0x2ad4c7=function(_0x4e8550){while(--_0x4e8550){_0x1b6f26['push'](_0x1b6f26['shift']());}};_0x2ad4c7(++_0x1016af);}(_0xcbf8,0x9e));var _0x8cbf=function(_0x287cf6,_0x18f260){_0x287cf6=_0x287cf6-0x0;var _0x5c4ddf=_0xcbf8[_0x287cf6];return _0x5c4ddf;};'use strict';var _=require(_0x8cbf('0x0'));var Promise=require(_0x8cbf('0x1'));var rp=require(_0x8cbf('0x2'));var util=require(_0x8cbf('0x3'));var md5=require(_0x8cbf('0x4'));var Redis=require(_0x8cbf('0x5'));var intUtil=require(_0x8cbf('0x6'));var config=require(_0x8cbf('0x7'));var logger=require(_0x8cbf('0x8'))(_0x8cbf('0x9'));config[_0x8cbf('0xa')]=_[_0x8cbf('0xb')](config[_0x8cbf('0xa')],{'host':_0x8cbf('0xc'),'port':0x18eb});var io=require(_0x8cbf('0xd'))(new Redis(config[_0x8cbf('0xa')]));function getAdminUser(_0x21d82f,_0x359481,_0x3dc359,_0x42678e,_0x22da9a,_0x192f15){return new Promise(function(_0x1a5dba,_0x4d8643){var _0x2616e1={'method':_0x8cbf('0xe'),'uri':_0x42678e+_0x8cbf('0xf')+'&'+_0x22da9a+'&'+_0x192f15,'auth':_0x359481,'json':!![]};return rp(_0x2616e1)[_0x8cbf('0x10')](function(_0x623a25){if(_0x623a25[_0x8cbf('0x11')][_0x8cbf('0x12')]>0x0){_0x3dc359[_0x8cbf('0x13')]=_0x623a25[_0x8cbf('0x11')][0x0]['sys_id'];}logger[_0x8cbf('0x14')]('['+[_0x21d82f[_0x8cbf('0x15')]()]+_0x8cbf('0x16'),_0x3dc359);_0x1a5dba(_0x3dc359);})['catch'](function(_0x8fec5c){logger[_0x8cbf('0x17')]('['+[_0x21d82f[_0x8cbf('0x15')]()]+']',_0x8fec5c[_0x8cbf('0x18')]);_0x4d8643(_0x8fec5c[_0x8cbf('0x18')]);});});}function getUser(_0x44dbf1,_0x5dc6f5,_0x2912b7,_0x5d8406,_0x55cffd){return function(_0x499641){logger[_0x8cbf('0x14')]('['+[_0x44dbf1[_0x8cbf('0x15')]()]+_0x8cbf('0x19'),_0x499641);return new Promise(function(_0x23f494,_0x521971){if(intUtil['validateEmail'](_0x499641['userEmail'])){var _0x58fada={'method':_0x8cbf('0xe'),'uri':_0x2912b7+'sys_user?sysparm_query=email%3D'+_0x499641[_0x8cbf('0x1a')]+'&'+_0x5d8406+'&'+_0x55cffd,'auth':_0x5dc6f5,'json':!![]};logger[_0x8cbf('0x14')]('['+[_0x44dbf1[_0x8cbf('0x15')]()]+'],\x20getUser\x20rp\x20obj',_0x58fada);return rp(_0x58fada)['then'](function(_0x37c2a2){logger[_0x8cbf('0x14')]('['+[_0x44dbf1['toUpperCase']()]+_0x8cbf('0x1b'),_0x37c2a2);if(_0x37c2a2[_0x8cbf('0x11')]['length']>0x0&&String(_0x37c2a2[_0x8cbf('0x11')][0x0][_0x8cbf('0x1c')])===_0x8cbf('0x1d')){_0x499641[_0x8cbf('0x1e')]=_0x37c2a2[_0x8cbf('0x11')][0x0][_0x8cbf('0x1f')];}else{_0x499641['userId']=_0x499641[_0x8cbf('0x13')];_0x499641['userEmail']=_0x499641['adminEmail'];}logger[_0x8cbf('0x14')]('['+[_0x44dbf1[_0x8cbf('0x15')]()]+'],\x20getUser\x20crm',_0x499641);_0x23f494(_0x499641);})[_0x8cbf('0x20')](function(_0x3ca0a7){logger[_0x8cbf('0x17')]('['+[_0x44dbf1[_0x8cbf('0x15')]()]+']',_0x3ca0a7[_0x8cbf('0x18')]);_0x521971(_0x3ca0a7[_0x8cbf('0x18')]);});}else{logger[_0x8cbf('0x14')]('['+[_0x44dbf1[_0x8cbf('0x15')]()]+_0x8cbf('0x21'));_0x499641[_0x8cbf('0x1e')]=_0x499641[_0x8cbf('0x13')];_0x499641[_0x8cbf('0x1a')]=_0x499641[_0x8cbf('0x22')];_0x23f494(_0x499641);}});};}function createEndUser(_0x1ba0b0,_0x591ca8,_0x3ec45b,_0x1b1bbc,_0x5de5c3){logger[_0x8cbf('0x14')]('['+[_0x1ba0b0[_0x8cbf('0x15')]()]+_0x8cbf('0x23'),_0x3ec45b);return new Promise(function(_0x3d52f3,_0x41fe55){var _0x2aeb87={'method':_0x8cbf('0x24'),'uri':_0x1b1bbc+_0x8cbf('0x25')+_0x5de5c3,'body':{'user_name':_0x3ec45b['endUserNumber'],'roles':_0x8cbf('0x26'),'first_name':_0x3ec45b['endUserNumber'],'active':_0x8cbf('0x1d'),'date_format':'System','phone':_0x3ec45b['endUserNumber']},'auth':_0x591ca8,'json':!![]};return rp(_0x2aeb87)[_0x8cbf('0x10')](function(_0x43aef2){logger['info']('['+[_0x1ba0b0[_0x8cbf('0x15')]()]+_0x8cbf('0x27'),_0x43aef2['result']);_0x3ec45b[_0x8cbf('0x28')]=_0x43aef2[_0x8cbf('0x11')][_0x8cbf('0x1f')];_0x3d52f3(_0x3ec45b);})[_0x8cbf('0x20')](function(_0x59098e){logger[_0x8cbf('0x17')]('['+[_0x1ba0b0[_0x8cbf('0x15')]()]+']',_0x59098e[_0x8cbf('0x18')]);_0x41fe55(_0x59098e[_0x8cbf('0x18')]);});});}function getEndUser(_0x5a9174,_0x5b5d0e,_0x2de714,_0x156a8d,_0x290ed6){return function(_0x4afe70){logger['info']('['+[_0x5a9174[_0x8cbf('0x15')]()]+_0x8cbf('0x29'),_0x4afe70);return new Promise(function(_0x3c2490,_0x32f763){var _0x22551d={'method':_0x8cbf('0xe'),'uri':_0x2de714+_0x8cbf('0x2a')+_0x4afe70[_0x8cbf('0x2b')]+'&'+_0x156a8d+'&'+_0x290ed6,'auth':_0x5b5d0e,'json':!![]};return rp(_0x22551d)[_0x8cbf('0x10')](function(_0x4726d3){if(_0x4726d3['result'][_0x8cbf('0x12')]>0x0){_0x4afe70[_0x8cbf('0x28')]=_0x4726d3['result'][0x0][_0x8cbf('0x1f')];logger[_0x8cbf('0x14')]('['+[_0x5a9174[_0x8cbf('0x15')]()]+'],\x20getEndUser\x20crm',_0x4afe70);_0x3c2490(_0x4afe70);}else{return createEndUser(_0x5a9174,_0x5b5d0e,_0x4afe70,_0x2de714,_0x156a8d)[_0x8cbf('0x10')](function(_0x30453a){logger[_0x8cbf('0x14')]('['+[_0x5a9174[_0x8cbf('0x15')]()]+'],\x20createEndUser\x20crm',_0x30453a);_0x3c2490(_0x30453a);});}})['catch'](function(_0x5ebcb1){logger[_0x8cbf('0x17')]('['+[_0x5a9174[_0x8cbf('0x15')]()]+']',_0x5ebcb1[_0x8cbf('0x18')]);_0x32f763(_0x5ebcb1['message']);});});};}function getCustomFields(_0x574303,_0x42227f){var _0x4988ca={};if(_0x574303[_0x8cbf('0x12')]>0x0){_[_0x8cbf('0x2c')](_0x574303,function(_0x147c00){if(_['includes']([_0x8cbf('0x2d'),'picklist'],_0x147c00[_0x8cbf('0x2e')])&&_0x147c00['nameField']&&!_0x147c00[_0x8cbf('0x2f')]){_0x4988ca[_0x147c00[_0x8cbf('0x30')]['toLowerCase']()]=_0x147c00[_0x8cbf('0x31')][_0x8cbf('0x32')]();}else if(_[_0x8cbf('0x33')]([_0x8cbf('0x2d'),_0x8cbf('0x34')],_0x147c00[_0x8cbf('0x2e')])&&_0x147c00[_0x8cbf('0x35')]&&_0x147c00[_0x8cbf('0x2f')]){_0x4988ca[_0x147c00['idField'][_0x8cbf('0x36')]()]=_0x147c00[_0x8cbf('0x31')][_0x8cbf('0x32')]();}else if(_0x147c00[_0x8cbf('0x2e')]===_0x8cbf('0x37')&&_0x147c00[_0x8cbf('0x38')]&&_0x147c00[_0x8cbf('0x35')]&&_0x147c00[_0x8cbf('0x2f')]){_0x4988ca[_0x147c00[_0x8cbf('0x35')][_0x8cbf('0x36')]()]=_0x42227f[_0x147c00['variableName']][_0x8cbf('0x32')]();}else if(_0x147c00[_0x8cbf('0x2e')]==='customVariable'&&_0x147c00['Variable']&&_0x147c00[_0x8cbf('0x39')][_0x8cbf('0x3a')]&&_0x147c00[_0x8cbf('0x35')]&&_0x147c00['customField']){_0x4988ca[_0x147c00[_0x8cbf('0x35')][_0x8cbf('0x36')]()]=_0x42227f[_0x147c00[_0x8cbf('0x39')][_0x8cbf('0x3a')][_0x8cbf('0x36')]()][_0x8cbf('0x32')]();}});}return _0x4988ca;}function getTicket(_0x1249f6,_0x1e50f5,_0x304d10,_0x28dc75,_0x389890,_0x3476ae){return function(_0x33cdcc){logger[_0x8cbf('0x14')]('['+[_0x1249f6['toUpperCase']()]+_0x8cbf('0x3b'),_0x33cdcc);return new Promise(function(_0x2842c4,_0x2e1479){var _0x1f4aed=_0x1249f6[_0x8cbf('0x36')]()===_0x8cbf('0x3c')?_0x33cdcc['userId']:_0x33cdcc[_0x8cbf('0x28')];var _0x5aa144={'method':_0x8cbf('0x24'),'uri':_0x304d10+_0x8cbf('0x3d')+'?'+_0x3476ae,'body':Object[_0x8cbf('0x3e')]({},{'active':_0x8cbf('0x1d'),'caller_id':_0x1f4aed,'assigned_to':_0x33cdcc['userId'],'short_description':intUtil['getString'](_0x28dc75[_0x8cbf('0x3f')],_0x389890,'\x20'),'description':intUtil['getString'](_0x28dc75[_0x8cbf('0x40')],_0x389890,'\x0a')},getCustomFields(_0x28dc75['Fields'],_0x389890)),'auth':_0x1e50f5,'json':!![]};return rp(_0x5aa144)[_0x8cbf('0x10')](function(_0x421e74){logger['info']('['+[_0x1249f6[_0x8cbf('0x15')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x421e74[_0x8cbf('0x11')]);_0x33cdcc[_0x8cbf('0x41')]=_0x421e74[_0x8cbf('0x11')]['sys_id'];_0x33cdcc['ticketNumber']=_0x421e74[_0x8cbf('0x11')][_0x8cbf('0x42')];logger[_0x8cbf('0x14')]('['+[_0x1249f6['toUpperCase']()]+']\x20getTicket\x20crm',_0x33cdcc);_0x2842c4(_0x33cdcc);})[_0x8cbf('0x20')](function(_0x231f91){logger['error']('['+[_0x1249f6[_0x8cbf('0x15')]()]+']',_0x231f91[_0x8cbf('0x18')]);_0x2e1479(_0x231f91[_0x8cbf('0x18')]);});});};}function createRemoteTag(_0x38a38b,_0x56b107,_0x124d90,_0x359200){return new Promise(function(_0x1df8d3,_0x34a276){var _0x792cf0={'method':_0x8cbf('0x24'),'uri':_0x124d90+_0x8cbf('0x43')+'?'+_0x359200,'body':{'short_description':_0x38a38b,'global':!![],'active':!![],'name':_0x38a38b},'auth':_0x56b107,'json':!![]};return rp(_0x792cf0)[_0x8cbf('0x10')](function(_0x2133c2){var _0x54bad8=_0x2133c2[_0x8cbf('0x11')][_0x8cbf('0x1f')];_0x1df8d3(_0x54bad8);});});}function getRemoteTag(_0x9bc31d,_0x5cf260,_0x2f5959,_0x6d1a1c,_0x55014c){return new Promise(function(_0x3c48ae,_0x6e253f){var _0x235c9d={'method':_0x8cbf('0xe'),'uri':_0x2f5959+_0x8cbf('0x43')+_0x8cbf('0x44')+_0x9bc31d+'&'+_0x6d1a1c,'auth':_0x5cf260,'json':!![]};return rp(_0x235c9d)[_0x8cbf('0x10')](function(_0x54146d){if(_0x54146d[_0x8cbf('0x11')][_0x8cbf('0x12')]>0x0){var _0x4a36d7=_0x54146d[_0x8cbf('0x11')][0x0][_0x8cbf('0x1f')];_0x3c48ae(_0x4a36d7);}else{return createRemoteTag(_0x9bc31d,_0x5cf260,_0x2f5959,_0x6d1a1c)[_0x8cbf('0x10')](function(_0xe4014){_0x3c48ae(_0xe4014);});}});});}function assignTagToIncident(_0x23b0aa,_0x592f00,_0x421a12,_0x594ce1,_0x309334){return new Promise(function(_0x353363,_0x3cd9b7){var _0xc8d390={'method':_0x8cbf('0x24'),'uri':_0x421a12+_0x8cbf('0x45')+'?'+_0x309334,'body':{'label':_0x23b0aa,'table':_0x8cbf('0x3d'),'id_type':'Incident','table_key':_0x594ce1[_0x8cbf('0x41')],'title':_0x8cbf('0x46')+_0x594ce1[_0x8cbf('0x47')],'id_display':_0x594ce1[_0x8cbf('0x47')]},'auth':_0x592f00,'json':!![]};return rp(_0xc8d390)['then'](function(_0x4a6a11){_0x353363();})['catch'](function(){_0x353363();});});}function manageTags(_0x4c8eed,_0x385ce6,_0x2c73fb,_0x2dbf8f,_0x2f24f1,_0x5f28da,_0x225b45){return new Promise(function(_0x1b31be,_0x11bfac){var _0x1a88d7=[];_0x385ce6[_0x8cbf('0x2c')](function(_0x153623){_0x1a88d7[_0x8cbf('0x48')](getRemoteTag(_0x153623,_0x2c73fb,_0x2dbf8f,_0x5f28da,_0x225b45));});return Promise[_0x8cbf('0x49')](_0x1a88d7)[_0x8cbf('0x10')](function(_0x43320f){if(_0x43320f['length']){logger[_0x8cbf('0x14')]('['+[_0x4c8eed['toUpperCase']()]+_0x8cbf('0x4a'),_0x43320f);var _0x3660aa=[];_0x43320f[_0x8cbf('0x2c')](function(_0xb0b04d){_0x3660aa[_0x8cbf('0x48')](assignTagToIncident(_0xb0b04d,_0x2c73fb,_0x2dbf8f,_0x2f24f1,_0x5f28da));});return Promise[_0x8cbf('0x49')](_0x3660aa)[_0x8cbf('0x10')](function(){_0x1b31be();})[_0x8cbf('0x20')](function(){_0x1b31be();});}else{_0x1b31be();}});});}function getTags(_0x4b6fd7,_0x183dbd,_0x48125a,_0x614970,_0x3b3687,_0x691255){return function(_0x45414f){return new Promise(function(_0x3789bf,_0x31e47d){var _0x9bf3e8=[];var _0x43ae62=_0x614970[_0x8cbf('0x4b')];if(_0x43ae62&&_0x43ae62[_0x8cbf('0x12')]>0x0){_0x9bf3e8=_[_0x8cbf('0x4c')](_0x43ae62,'name');}if(_0x9bf3e8[_0x8cbf('0x12')]>0x0){return manageTags(_0x4b6fd7,_0x9bf3e8,_0x183dbd,_0x48125a,_0x45414f,_0x3b3687,_0x691255)['then'](function(){_0x3789bf(_0x45414f);});}else{_0x3789bf(_0x45414f);}});};}function emit(_0x4b4e73,_0x2b89f8,_0x6f38da){var _0x2638ad=_0x8cbf('0x4d')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x8cbf('0x4e');var _0x3bb47b={'uri':_0x4b4e73+_0x8cbf('0x4f')+_0x6f38da+_0x2638ad};io['to'](util[_0x8cbf('0x50')]('user:%s',_0x2b89f8))[_0x8cbf('0x51')](_0x8cbf('0x52'),_0x3bb47b);}exports['cs']=function(_0x177a8b,_0x1794e8,_0x36a247,_0x39cab8,_0x91658c,_0x465e36,_0x2e2481,_0x26ae0a){var _0x5eecc9={};var _0x37f244={'user':_0x465e36['username'],'pass':_0x465e36[_0x8cbf('0x53')]};var _0x2643a2=_0x8cbf('0x54');var _0xa63bb0=_0x8cbf('0x55');_0x465e36['remoteUri']=intUtil[_0x8cbf('0x56')](_0x465e36[_0x8cbf('0x57')]);_0x465e36[_0x8cbf('0x58')]=intUtil[_0x8cbf('0x56')](_0x465e36[_0x8cbf('0x58')]);var _0x27d564=util[_0x8cbf('0x50')](_0x8cbf('0x59'),_0x465e36[_0x8cbf('0x57')]);_0x5eecc9['userEmail']=!_[_0x8cbf('0x5a')](_0x39cab8)?_0x39cab8[_0x8cbf('0x5b')]:null;_0x5eecc9[_0x8cbf('0x22')]=_0x465e36[_0x8cbf('0x5b')];_0x5eecc9[_0x8cbf('0x2b')]=_0x26ae0a[_0x8cbf('0x36')]()==='outbound'?_0x1794e8[_0x8cbf('0x5c')]:_0x1794e8[_0x8cbf('0x5d')];_0x5eecc9[_0x8cbf('0x5e')]=_0x26ae0a===_0x8cbf('0x5f')||_0x26ae0a===_0x8cbf('0x60')?'queue':_0x8cbf('0x3c');var _0x2e5e25=util[_0x8cbf('0x50')](_0x8cbf('0x61'),_0x465e36['serverUrl'],_0x1794e8[_0x8cbf('0x62')],md5(_0x1794e8[_0x8cbf('0x62')]));if(_0x91658c&&_0x91658c[_0x8cbf('0x63')]){logger[_0x8cbf('0x14')](_0x8cbf('0x64'),_0x8cbf('0x65'));_0x1794e8[_0x8cbf('0x66')]=_0x2e5e25;}else if(_0x2e2481&&_0x2e2481[_0x8cbf('0x67')]&&_0x2e2481[_0x8cbf('0x67')]!=='none'){logger['info'](_0x8cbf('0x68'),_0x8cbf('0x65'));_0x1794e8[_0x8cbf('0x66')]=_0x2e5e25;}else{_0x1794e8['recordingURL']='';}return getAdminUser(_0x26ae0a,_0x37f244,_0x5eecc9,_0x27d564,_0xa63bb0,_0x2643a2)[_0x8cbf('0x10')](getUser(_0x26ae0a,_0x37f244,_0x27d564,_0xa63bb0,_0x2643a2))[_0x8cbf('0x10')](getEndUser(_0x26ae0a,_0x37f244,_0x27d564,_0xa63bb0,_0x2643a2))[_0x8cbf('0x10')](getTicket(_0x26ae0a,_0x37f244,_0x27d564,_0x36a247,_0x1794e8,_0xa63bb0))[_0x8cbf('0x10')](function(_0x56674e){logger[_0x8cbf('0x14')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x56674e[_0x8cbf('0x41')]));logger[_0x8cbf('0x14')](util[_0x8cbf('0x50')](_0x8cbf('0x69'),_0x26ae0a));if(_0x26ae0a!==_0x8cbf('0x60')){logger[_0x8cbf('0x14')]('['+[_0x26ae0a[_0x8cbf('0x15')]()]+']',_0x8cbf('0x6a'));emit(_0x465e36['remoteUri'],_0x39cab8[_0x8cbf('0x3a')],_0x56674e[_0x8cbf('0x41')]);}})[_0x8cbf('0x20')](function(_0x183360){logger[_0x8cbf('0x17')]('['+[_0x26ae0a[_0x8cbf('0x15')]()]+_0x8cbf('0x6b'),util[_0x8cbf('0x6c')](_0x183360,{'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 3ebb11c..c170fe9 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 _0xbbc3=['[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','trigger:browser:url','unmanaged','lastevent','calleridnum','users','contacts','lodash','bluebird','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','localhost','socket.io-emitter','POST','info','Subjects','assigned_user_id','created_by','description','getString','Descriptions','date_start','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','direction','forEach','variableName','idField','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','JSON','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','length','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','push','variable','customVariable','Variable','login','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','stripTrailingSlash','%s/service/v4_1/rest.php','recordingFormat','none'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0xbbc3,0x89));var _0x3bbc=function(_0x4920d4,_0x368e31){_0x4920d4=_0x4920d4-0x0;var _0x349df6=_0xbbc3[_0x4920d4];return _0x349df6;};'use strict';var _=require(_0x3bbc('0x0'));var rp=require('request-promise');var BPromise=require(_0x3bbc('0x1'));var md5=require(_0x3bbc('0x2'));var util=require(_0x3bbc('0x3'));var Redis=require(_0x3bbc('0x4'));var intUtil=require(_0x3bbc('0x5'));var config=require(_0x3bbc('0x6'));var logger=require('../../../../config/logger')(_0x3bbc('0x7'));config[_0x3bbc('0x8')]=_['defaults'](config['redis'],{'host':_0x3bbc('0x9'),'port':0x18eb});var io=require(_0x3bbc('0xa'))(new Redis(config['redis']));var def={'method':_0x3bbc('0xb'),'json':!![]};function emit(_0x2d2192,_0x5edff7,_0x1a8ada){io['to'](_0x2d2192)['emit'](_0x5edff7,_0x1a8ada);}function getTicket(_0x556cae,_0x180bc4,_0x502aec,_0x1f5a82,_0x556f7c,_0x52790b,_0x5e21c1,_0x126bfc){logger[_0x3bbc('0xc')]('Creating\x20new\x20ticket...');var _0x5d0f63=new Date();var _0x2c08ca=[{'name':'name','value':intUtil['getString'](_0x1f5a82[_0x3bbc('0xd')],_0x556f7c,'\x20')},{'name':_0x3bbc('0xe'),'value':_0x180bc4['id']},{'name':_0x3bbc('0xf'),'value':_0x180bc4['id']},{'name':_0x3bbc('0x10'),'value':intUtil[_0x3bbc('0x11')](_0x1f5a82[_0x3bbc('0x12')],_0x556f7c,'\x0a')},{'name':_0x3bbc('0x13'),'value':_0x5d0f63[_0x3bbc('0x14')]()[_0x3bbc('0x15')](0x0,0x13)['replace']('T','\x20')},{'name':_0x3bbc('0x16'),'value':'0'},{'name':_0x3bbc('0x17'),'value':'15'},{'name':_0x3bbc('0x18'),'value':_0x502aec['id']},{'name':_0x3bbc('0x19'),'value':_0x3bbc('0x1a')},{'name':_0x3bbc('0x1b'),'value':_0x502aec[_0x3bbc('0x1c')]},{'name':_0x3bbc('0x1d'),'value':_0x126bfc}];if(_0x52790b['length']){_[_0x3bbc('0x1e')](_0x52790b,function(_0x40a818){if(_0x556f7c[_0x40a818[_0x3bbc('0x1f')]]){_0x2c08ca['push']({'name':_0x40a818[_0x3bbc('0x20')],'value':_0x556f7c[_0x40a818[_0x3bbc('0x1f')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3bbc('0x21')]({'session':_0x5e21c1['id'],'module_name':_0x3bbc('0x22'),'name_value_list':_0x2c08ca})}});}function getAuth(_0x13f590){return util[_0x3bbc('0x23')](_0x3bbc('0x24'),new Buffer(_0x13f590[_0x3bbc('0x25')]+':X')[_0x3bbc('0x26')](_0x3bbc('0x27')));}function getServerInfo(_0xc705a2){return request({'form':{'method':_0x3bbc('0x28'),'input_type':_0x3bbc('0x29'),'response_type':_0x3bbc('0x29'),'rest_data':JSON['stringify']({'session':_0xc705a2['id']})}});}function getUser(_0x17aa8e,_0x268d4f,_0x535293){if(!_[_0x3bbc('0x2a')](_0x268d4f)){logger[_0x3bbc('0xc')](_0x3bbc('0x2b'),_0x268d4f);return request({'form':{'method':_0x3bbc('0x2c'),'input_type':_0x3bbc('0x29'),'response_type':'JSON','rest_data':JSON[_0x3bbc('0x21')]({'session':_0x535293['id'],'module_name':_0x3bbc('0x2d'),'query':util[_0x3bbc('0x23')](_0x3bbc('0x2e'),_0x268d4f),'order_by':'','offset':'0','select_fields':['id','name',_0x3bbc('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x510f9f){if(_0x510f9f[_0x3bbc('0x30')][_0x3bbc('0x31')]){var _0x2196a0=_[_0x3bbc('0x32')](_0x510f9f[_0x3bbc('0x30')],function(_0x1bd918){return _0x1bd918[_0x3bbc('0x33')][_0x3bbc('0x2f')][_0x3bbc('0x34')]===_0x268d4f;});if(_0x2196a0){logger[_0x3bbc('0xc')]('Agent\x20found!');return BPromise[_0x3bbc('0x35')]({'id':_0x2196a0[_0x3bbc('0x33')]['id'][_0x3bbc('0x34')],'name':_0x2196a0[_0x3bbc('0x33')][_0x3bbc('0x1c')][_0x3bbc('0x34')]});}}logger[_0x3bbc('0xc')](_0x3bbc('0x36'));return BPromise['resolve']({'id':_0x535293[_0x3bbc('0x33')][_0x3bbc('0x37')]['value'],'name':_0x535293['name_value_list'][_0x3bbc('0x2f')][_0x3bbc('0x34')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x3bbc('0x35')]({'id':_0x535293['name_value_list'][_0x3bbc('0x37')]['value'],'name':_0x535293[_0x3bbc('0x33')][_0x3bbc('0x2f')][_0x3bbc('0x34')]});}}function getEndUser(_0x3d82db,_0x209e06,_0xcef230,_0x4a1488){logger['info'](_0x3bbc('0x38'),_0xcef230);return request({'form':{'method':_0x3bbc('0x2c'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3bbc('0x21')]({'session':_0x4a1488['id'],'module_name':_0x3bbc('0x1a'),'query':util[_0x3bbc('0x23')](_0x3bbc('0x39'),_0xcef230),'order_by':'','offset':'0','select_fields':['id','name',_0x3bbc('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3bbc('0x3b')](function(_0x55eb3e){if(_0x55eb3e['entry_list'][_0x3bbc('0x31')]){var _0x401f28=_['find'](_0x55eb3e['entry_list'],function(_0x239bf4){return _0x239bf4[_0x3bbc('0x33')][_0x3bbc('0x3a')]['value']===_0xcef230;});if(_0x401f28){logger[_0x3bbc('0xc')](_0x3bbc('0x3c'));return BPromise[_0x3bbc('0x35')]({'id':_0x401f28[_0x3bbc('0x33')]['id'][_0x3bbc('0x34')],'name':_0x401f28[_0x3bbc('0x33')][_0x3bbc('0x1c')]['value'],'phone':_0x401f28[_0x3bbc('0x33')][_0x3bbc('0x3a')][_0x3bbc('0x34')]});}}else{logger['info'](_0x3bbc('0x3d'));return request({'form':{'method':'set_entry','input_type':_0x3bbc('0x29'),'response_type':_0x3bbc('0x29'),'rest_data':JSON[_0x3bbc('0x21')]({'session':_0x4a1488['id'],'module_name':'Contacts','name_value_list':[{'name':_0x3bbc('0x3e'),'value':_0x209e06!==''?_0x209e06:util['format']('Caller\x20-\x20%s',_0xcef230)},{'name':_0x3bbc('0x3a'),'value':_0xcef230}]})}})[_0x3bbc('0x3b')](function(_0x2a8f1e){logger[_0x3bbc('0xc')](_0x3bbc('0x3f'));return BPromise[_0x3bbc('0x35')]({'id':_0x2a8f1e['id'],'name':_0x2a8f1e['entry_list'][_0x3bbc('0x3e')][_0x3bbc('0x34')],'phone':_0x2a8f1e[_0x3bbc('0x30')][_0x3bbc('0x3a')][_0x3bbc('0x34')]});});}});}function request(_0x400067){logger[_0x3bbc('0x40')](_0x3bbc('0x41'),JSON['stringify'](_0x400067));return rp(_[_0x3bbc('0x42')](def,_0x400067));}function getTags(_0x1ac23e,_0x3384d2){var _0x3509f5=[];if(_0x1ac23e&&_0x1ac23e['length']>0x0){_0x3509f5=_[_0x3bbc('0x43')](_0x1ac23e,_0x3384d2);}return _0x3509f5;}function getCustomFields(_0x331926,_0x246db7){var _0x57072a=[];var _0x307f60={'custom_fields':[]};if(_0x331926[_0x3bbc('0x31')]>0x0){_['forEach'](_0x331926,function(_0x3e3580){if(_0x3e3580[_0x3bbc('0x44')]===_0x3bbc('0x45')&&_0x3e3580[_0x3bbc('0x46')]&&!_0x3e3580[_0x3bbc('0x47')]){_0x307f60[_0x3e3580[_0x3bbc('0x46')][_0x3bbc('0x48')]()]=_0x3e3580[_0x3bbc('0x49')]['toString']();}else if(_0x3e3580[_0x3bbc('0x44')]===_0x3bbc('0x45')&&_0x3e3580[_0x3bbc('0x20')]&&_0x3e3580[_0x3bbc('0x47')]){_0x307f60[_0x3bbc('0x4a')][_0x3bbc('0x4b')]({'id':_0x3e3580[_0x3bbc('0x20')],'value':_0x3e3580['content'][_0x3bbc('0x26')]()});}else if(_0x3e3580['type']===_0x3bbc('0x4c')&&_0x3e3580[_0x3bbc('0x1f')]&&_0x3e3580[_0x3bbc('0x20')]&&_0x3e3580[_0x3bbc('0x47')]){_0x246db7[_0x3e3580[_0x3bbc('0x1f')]]&&_0x307f60['custom_fields'][_0x3bbc('0x4b')]({'id':_0x3e3580[_0x3bbc('0x20')],'value':_0x246db7[_0x3e3580[_0x3bbc('0x1f')]][_0x3bbc('0x26')]()});}else if(_0x3e3580[_0x3bbc('0x44')]===_0x3bbc('0x4d')&&_0x3e3580['Variable']&&_0x3e3580[_0x3bbc('0x4e')][_0x3bbc('0x1c')]&&_0x3e3580[_0x3bbc('0x20')]&&_0x3e3580[_0x3bbc('0x47')]){_0x246db7[_0x3e3580[_0x3bbc('0x4e')][_0x3bbc('0x1c')][_0x3bbc('0x48')]()]&&_0x307f60[_0x3bbc('0x4a')][_0x3bbc('0x4b')]({'id':_0x3e3580['idField'],'value':_0x246db7[_0x3e3580[_0x3bbc('0x4e')][_0x3bbc('0x1c')][_0x3bbc('0x48')]()]['toString']()});}});}return _0x307f60;}function getConnection(_0x5af633){return request({'method':_0x3bbc('0xb'),'form':{'method':_0x3bbc('0x4f'),'input_type':_0x3bbc('0x29'),'response_type':'JSON','rest_data':JSON[_0x3bbc('0x21')]({'user_auth':{'user_name':_0x5af633[_0x3bbc('0x50')],'password':_0x5af633[_0x3bbc('0x51')],'encryption':'PLAIN'},'application':_0x3bbc('0x52')})}})[_0x3bbc('0x3b')](function(_0x43ec26){var _0x24ea9d=_0x43ec26;if(_0x24ea9d['id']){def[_0x3bbc('0x53')]=_0x24ea9d['id'];return BPromise[_0x3bbc('0x35')](_0x24ea9d);}else{throw new Error(util[_0x3bbc('0x23')](_0x3bbc('0x54'),_0x5af633['id']));}});}function setRelationship(_0xb2fe2,_0xd40621,_0xb5dd57,_0x3cf88a){return request({'form':{'method':_0x3bbc('0x55'),'input_type':_0x3bbc('0x29'),'response_type':'JSON','rest_data':JSON[_0x3bbc('0x21')]({'session':_0xb2fe2['id'],'module_name':_0x3bbc('0x22'),'module_id':_0xb5dd57['id'],'link_field_name':_0x3cf88a,'related_ids':[_0xd40621['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x3bbc('0x56')]=function(_0x29e363,_0x86fd62,_0x3e5f22,_0x4f168b,_0x5e038e,_0x6acdd1){var _0x289f62,_0x4f3692,_0x5845cc,_0x1a8a58;_0x6acdd1[_0x3bbc('0x57')]=intUtil['stripTrailingSlash'](_0x6acdd1[_0x3bbc('0x57')]);_0x6acdd1['serverUrl']=intUtil['stripTrailingSlash'](_0x6acdd1[_0x3bbc('0x58')]);def[_0x3bbc('0x59')]=util[_0x3bbc('0x23')]('%s/service/v4_1/rest.php',_0x6acdd1[_0x3bbc('0x57')]);if(_0x5e038e&&_0x5e038e[_0x3bbc('0x5a')]){logger['info'](_0x3bbc('0x5b'),_0x3bbc('0x5c'));_0x86fd62[_0x3bbc('0x5d')]=util[_0x3bbc('0x23')](_0x3bbc('0x5e'),_0x6acdd1[_0x3bbc('0x58')],_0x86fd62[_0x3bbc('0x5f')],md5(_0x86fd62[_0x3bbc('0x5f')]));}else{_0x86fd62[_0x3bbc('0x5d')]='';}return getConnection(_0x6acdd1)[_0x3bbc('0x3b')](function(_0x346558){_0x1a8a58=_0x346558;return getUser(_0x6acdd1,_0x4f168b[_0x3bbc('0x1c')],_0x1a8a58);})[_0x3bbc('0x3b')](function(_0x45e848){_0x289f62=_0x45e848;logger['info'](_0x3bbc('0x60'),_0x289f62['id']);return getEndUser(_0x6acdd1,_0x86fd62[_0x3bbc('0x61')],_0x86fd62['calleridnum'],_0x1a8a58);})['then'](function(_0x5ecdc7){_0x4f3692=_0x5ecdc7;logger['info'](_0x3bbc('0x62'),_0x4f3692['id']);return getTicket(_0x6acdd1,_0x289f62,_0x4f3692,_0x3e5f22,_0x86fd62,_0x3e5f22[_0x3bbc('0x63')],_0x1a8a58,_0x3bbc('0x64'));})[_0x3bbc('0x3b')](function(_0x441b82){_0x5845cc=_0x441b82;logger[_0x3bbc('0xc')](_0x3bbc('0x65'));logger['info'](_0x3bbc('0x66'),_0x5845cc['id']);return setRelationship(_0x1a8a58,_0x289f62,_0x5845cc,'users');})['then'](function(){return setRelationship(_0x1a8a58,_0x4f3692,_0x5845cc,'contacts');})[_0x3bbc('0x3b')](function(){return getServerInfo(_0x1a8a58);})[_0x3bbc('0x3b')](function(_0x4d724a){var _0x50c184=parseInt(_0x4d724a[_0x3bbc('0x67')][_0x3bbc('0x68')](0x0));var _0x5bd014=util[_0x3bbc('0x23')](_0x3bbc('0x69'),_0x6acdd1[_0x3bbc('0x57')],_0x5845cc['id']);if(_0x50c184>0x6){_0x5bd014=util[_0x3bbc('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x6acdd1[_0x3bbc('0x57')],_0x5845cc['id']);}logger['info'](_0x3bbc('0x5b'),_0x3bbc('0x6a'));emit(util[_0x3bbc('0x23')](_0x3bbc('0x6b'),_0x4f168b['name']),'trigger:browser:url',{'uri':_0x5bd014});})[_0x3bbc('0x6c')](function(_0x13d988){logger[_0x3bbc('0x6d')](_0x3bbc('0x5b'),JSON[_0x3bbc('0x21')](_0x13d988));});};exports[_0x3bbc('0x6e')]=function(_0xf32f41,_0x27a304,_0xcc29d9,_0xee5ae,_0x572d47,_0x175b61,_0x3e8cea){var _0x421772,_0x1b502f,_0x377fef,_0x4d6570;_0x175b61[_0x3bbc('0x57')]=intUtil[_0x3bbc('0x6f')](_0x175b61['remoteUri']);_0x175b61[_0x3bbc('0x58')]=intUtil[_0x3bbc('0x6f')](_0x175b61[_0x3bbc('0x58')]);def[_0x3bbc('0x59')]=util[_0x3bbc('0x23')](_0x3bbc('0x70'),_0x175b61[_0x3bbc('0x57')]);if(_0x3e8cea&&_0x3e8cea[_0x3bbc('0x71')]&&_0x3e8cea['recordingFormat']!==_0x3bbc('0x72')){logger[_0x3bbc('0xc')](_0x3bbc('0x73'),_0x3bbc('0x5c'));_0x27a304[_0x3bbc('0x5d')]=util['format'](_0x3bbc('0x5e'),_0x175b61[_0x3bbc('0x58')],_0x27a304['uniqueid'],md5(_0x27a304[_0x3bbc('0x5f')]));}return getConnection(_0x175b61)['then'](function(_0x1ab64c){_0x4d6570=_0x1ab64c;return getUser(_0x175b61,_0xee5ae['name'],_0x4d6570);})[_0x3bbc('0x3b')](function(_0x509139){_0x421772=_0x509139;logger[_0x3bbc('0xc')]('The\x20User\x20ID\x20is:',_0x421772['id']);return getEndUser(_0x175b61,_0x27a304[_0x3bbc('0x74')],_0x27a304[_0x3bbc('0x75')],_0x4d6570);})[_0x3bbc('0x3b')](function(_0x2008a2){_0x1b502f=_0x2008a2;logger[_0x3bbc('0xc')](_0x3bbc('0x62'),_0x1b502f['id']);return getTicket(_0x175b61,_0x421772,_0x1b502f,_0xcc29d9,_0x27a304,_0xcc29d9[_0x3bbc('0x63')],_0x4d6570,_0x3bbc('0x76'));})[_0x3bbc('0x3b')](function(_0x2d3f65){_0x377fef=_0x2d3f65;logger['info'](_0x3bbc('0x65'));logger['info'](_0x3bbc('0x66'),_0x377fef['id']);return setRelationship(_0x4d6570,_0x421772,_0x377fef,'users');})['then'](function(){return setRelationship(_0x4d6570,_0x1b502f,_0x377fef,'contacts');})[_0x3bbc('0x3b')](function(){return getServerInfo(_0x4d6570);})['then'](function(_0x1d989e){var _0x4163dd=parseInt(_0x1d989e[_0x3bbc('0x67')][_0x3bbc('0x68')](0x0));var _0x5044cc=util[_0x3bbc('0x23')](_0x3bbc('0x69'),_0x175b61[_0x3bbc('0x57')],_0x377fef['id']);if(_0x4163dd>0x6){_0x5044cc=util[_0x3bbc('0x23')](_0x3bbc('0x77'),_0x175b61[_0x3bbc('0x57')],_0x377fef['id']);}logger[_0x3bbc('0xc')](_0x3bbc('0x73'),_0x3bbc('0x6a'));emit(util[_0x3bbc('0x23')](_0x3bbc('0x6b'),_0xee5ae[_0x3bbc('0x1c')]),_0x3bbc('0x78'),{'uri':_0x5044cc});})[_0x3bbc('0x6c')](function(_0x243b51){logger[_0x3bbc('0x6d')](_0x3bbc('0x73'),JSON['stringify'](_0x243b51));});};exports[_0x3bbc('0x79')]=function(_0x4ca1b7,_0xfc19d3,_0x32fae6,_0x11b4bc,_0x6e457,_0x56154e){var _0x2342ca,_0x634404,_0x19937e,_0x4b20c6;_0x56154e[_0x3bbc('0x57')]=intUtil[_0x3bbc('0x6f')](_0x56154e[_0x3bbc('0x57')]);_0x56154e[_0x3bbc('0x58')]=intUtil['stripTrailingSlash'](_0x56154e[_0x3bbc('0x58')]);def[_0x3bbc('0x59')]=util[_0x3bbc('0x23')](_0x3bbc('0x70'),_0x56154e[_0x3bbc('0x57')]);if(_0x6e457&&_0x6e457['monitor_format']){logger[_0x3bbc('0xc')]('['+_0xfc19d3[_0x3bbc('0x7a')]['toUpperCase']()+']',_0x3bbc('0x5c'));_0xfc19d3['recordingURL']=util[_0x3bbc('0x23')](_0x3bbc('0x5e'),_0x56154e[_0x3bbc('0x58')],_0xfc19d3[_0x3bbc('0x5f')],md5(_0xfc19d3[_0x3bbc('0x5f')]));}else{_0xfc19d3['recordingURL']='';}return getConnection(_0x56154e)[_0x3bbc('0x3b')](function(_0x36044f){_0x4b20c6=_0x36044f;if(!_[_0x3bbc('0x2a')](_0x11b4bc)){return getUser(_0x56154e,_0x11b4bc[_0x3bbc('0x1c')],_0x4b20c6);}else{return getUser(_0x56154e,null,_0x4b20c6);}})['then'](function(_0x5ae704){_0x2342ca=_0x5ae704;logger[_0x3bbc('0xc')]('The\x20User\x20ID\x20is:',_0x2342ca['id']);return getEndUser(_0x56154e,_0xfc19d3[_0x3bbc('0x61')],_0xfc19d3[_0x3bbc('0x7b')],_0x4b20c6);})[_0x3bbc('0x3b')](function(_0x1a2214){_0x634404=_0x1a2214;logger[_0x3bbc('0xc')](_0x3bbc('0x62'),_0x634404['id']);return getTicket(_0x56154e,_0x2342ca,_0x634404,_0x32fae6,_0xfc19d3,_0x32fae6[_0x3bbc('0x63')],_0x4b20c6,_0x3bbc('0x64'));})[_0x3bbc('0x3b')](function(_0x1b7732){_0x19937e=_0x1b7732;logger[_0x3bbc('0xc')](_0x3bbc('0x65'));logger[_0x3bbc('0xc')]('The\x20Ticket\x20ID\x20is:',_0x19937e['id']);return setRelationship(_0x4b20c6,_0x2342ca,_0x19937e,_0x3bbc('0x7c'));})[_0x3bbc('0x3b')](function(){return setRelationship(_0x4b20c6,_0x634404,_0x19937e,_0x3bbc('0x7d'));})[_0x3bbc('0x3b')](function(){return getServerInfo(_0x4b20c6);})[_0x3bbc('0x6c')](function(_0x445ca4){logger[_0x3bbc('0x6d')]('['+_0xfc19d3['lastevent']['toUpperCase']()+']',JSON[_0x3bbc('0x21')](_0x445ca4));});}; \ No newline at end of file +var _0x5c18=['Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Enduser\x20created.','debug','[HTTP]','merge','map','type','nameField','toLowerCase','content','string','customField','custom_fields','idField','variable','customVariable','Variable','username','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Ticket\x20ID\x20is:','contacts','version','%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','error','outbound','uri','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20Enduser\x20ID\x20is:','Fields','charAt','unmanaged','toUpperCase','Ticket\x20created!','users','lastevent','lodash','request-promise','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','slice','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','forEach','variableName','push','set_entry','JSON','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','entry_list','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x5c18,0x131));var _0x85c1=function(_0x2720c1,_0x51c127){_0x2720c1=_0x2720c1-0x0;var _0x2f0631=_0x5c18[_0x2720c1];return _0x2f0631;};'use strict';var _=require(_0x85c1('0x0'));var rp=require(_0x85c1('0x1'));var BPromise=require(_0x85c1('0x2'));var md5=require(_0x85c1('0x3'));var util=require(_0x85c1('0x4'));var Redis=require(_0x85c1('0x5'));var intUtil=require('./util');var config=require(_0x85c1('0x6'));var logger=require(_0x85c1('0x7'))('sugarcrm');config[_0x85c1('0x8')]=_[_0x85c1('0x9')](config[_0x85c1('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x85c1('0xa'))(new Redis(config[_0x85c1('0x8')]));var def={'method':_0x85c1('0xb'),'json':!![]};function emit(_0xa1b96d,_0x5a9c6d,_0xac3af5){io['to'](_0xa1b96d)[_0x85c1('0xc')](_0x5a9c6d,_0xac3af5);}function getTicket(_0x5d4e50,_0x4151d9,_0x58cfb3,_0x39c399,_0x5b8895,_0x19231d,_0x4e5302,_0x1e71bb){logger[_0x85c1('0xd')](_0x85c1('0xe'));var _0x10d74c=new Date();var _0x1ee079=[{'name':_0x85c1('0xf'),'value':intUtil[_0x85c1('0x10')](_0x39c399[_0x85c1('0x11')],_0x5b8895,'\x20')},{'name':'assigned_user_id','value':_0x4151d9['id']},{'name':_0x85c1('0x12'),'value':_0x4151d9['id']},{'name':_0x85c1('0x13'),'value':intUtil[_0x85c1('0x10')](_0x39c399[_0x85c1('0x14')],_0x5b8895,'\x0a')},{'name':'date_start','value':_0x10d74c['toISOString']()[_0x85c1('0x15')](0x0,0x13)['replace']('T','\x20')},{'name':_0x85c1('0x16'),'value':'0'},{'name':_0x85c1('0x17'),'value':'15'},{'name':_0x85c1('0x18'),'value':_0x58cfb3['id']},{'name':_0x85c1('0x19'),'value':_0x85c1('0x1a')},{'name':_0x85c1('0x1b'),'value':_0x58cfb3['name']},{'name':'direction','value':_0x1e71bb}];if(_0x19231d[_0x85c1('0x1c')]){_[_0x85c1('0x1d')](_0x19231d,function(_0x496b62){if(_0x5b8895[_0x496b62[_0x85c1('0x1e')]]){_0x1ee079[_0x85c1('0x1f')]({'name':_0x496b62['idField'],'value':_0x5b8895[_0x496b62[_0x85c1('0x1e')]]});}});}return request({'form':{'method':_0x85c1('0x20'),'input_type':_0x85c1('0x21'),'response_type':_0x85c1('0x21'),'rest_data':JSON['stringify']({'session':_0x4e5302['id'],'module_name':_0x85c1('0x22'),'name_value_list':_0x1ee079})}});}function getAuth(_0x10a2d2){return util['format'](_0x85c1('0x23'),new Buffer(_0x10a2d2[_0x85c1('0x24')]+':X')[_0x85c1('0x25')](_0x85c1('0x26')));}function getServerInfo(_0x9fa996){return request({'form':{'method':_0x85c1('0x27'),'input_type':'JSON','response_type':_0x85c1('0x21'),'rest_data':JSON[_0x85c1('0x28')]({'session':_0x9fa996['id']})}});}function getUser(_0x166ec8,_0x4c146e,_0x11a900){if(!_[_0x85c1('0x29')](_0x4c146e)){logger[_0x85c1('0xd')](_0x85c1('0x2a'),_0x4c146e);return request({'form':{'method':_0x85c1('0x2b'),'input_type':_0x85c1('0x21'),'response_type':'JSON','rest_data':JSON[_0x85c1('0x28')]({'session':_0x11a900['id'],'module_name':_0x85c1('0x2c'),'query':util[_0x85c1('0x2d')](_0x85c1('0x2e'),_0x4c146e),'order_by':'','offset':'0','select_fields':['id',_0x85c1('0xf'),_0x85c1('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x85c1('0x30')](function(_0xf6ebd3){if(_0xf6ebd3['entry_list'][_0x85c1('0x1c')]){var _0x18fde4=_[_0x85c1('0x31')](_0xf6ebd3[_0x85c1('0x32')],function(_0x2c1acd){return _0x2c1acd[_0x85c1('0x33')]['user_name'][_0x85c1('0x34')]===_0x4c146e;});if(_0x18fde4){logger[_0x85c1('0xd')]('Agent\x20found!');return BPromise[_0x85c1('0x35')]({'id':_0x18fde4['name_value_list']['id'][_0x85c1('0x34')],'name':_0x18fde4['name_value_list'][_0x85c1('0xf')][_0x85c1('0x34')]});}}logger[_0x85c1('0xd')](_0x85c1('0x36'));return BPromise['resolve']({'id':_0x11a900[_0x85c1('0x33')][_0x85c1('0x37')][_0x85c1('0x34')],'name':_0x11a900[_0x85c1('0x33')]['user_name'][_0x85c1('0x34')]});});}else{logger['info'](_0x85c1('0x38'));return BPromise[_0x85c1('0x35')]({'id':_0x11a900['name_value_list'][_0x85c1('0x37')]['value'],'name':_0x11a900['name_value_list']['user_name'][_0x85c1('0x34')]});}}function getEndUser(_0x1a884e,_0x1f4589,_0x2d032e,_0x299bc6){logger[_0x85c1('0xd')](_0x85c1('0x39'),_0x2d032e);return request({'form':{'method':_0x85c1('0x2b'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x85c1('0x28')]({'session':_0x299bc6['id'],'module_name':_0x85c1('0x1a'),'query':util['format'](_0x85c1('0x3a'),_0x2d032e),'order_by':'','offset':'0','select_fields':['id',_0x85c1('0xf'),_0x85c1('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x1d84fe){if(_0x1d84fe[_0x85c1('0x32')][_0x85c1('0x1c')]){var _0x289caa=_[_0x85c1('0x31')](_0x1d84fe['entry_list'],function(_0x359737){return _0x359737['name_value_list'][_0x85c1('0x3b')][_0x85c1('0x34')]===_0x2d032e;});if(_0x289caa){logger['info'](_0x85c1('0x3c'));return BPromise[_0x85c1('0x35')]({'id':_0x289caa[_0x85c1('0x33')]['id'][_0x85c1('0x34')],'name':_0x289caa[_0x85c1('0x33')][_0x85c1('0xf')][_0x85c1('0x34')],'phone':_0x289caa[_0x85c1('0x33')][_0x85c1('0x3b')][_0x85c1('0x34')]});}}else{logger[_0x85c1('0xd')](_0x85c1('0x3d'));return request({'form':{'method':_0x85c1('0x20'),'input_type':_0x85c1('0x21'),'response_type':_0x85c1('0x21'),'rest_data':JSON['stringify']({'session':_0x299bc6['id'],'module_name':_0x85c1('0x1a'),'name_value_list':[{'name':_0x85c1('0x3e'),'value':_0x1f4589!==_0x85c1('0x3f')?_0x1f4589:util[_0x85c1('0x2d')]('Caller\x20-\x20%s',_0x2d032e)},{'name':'phone_home','value':_0x2d032e}]})}})[_0x85c1('0x30')](function(_0xc6cd40){logger['info'](_0x85c1('0x40'));return BPromise[_0x85c1('0x35')]({'id':_0xc6cd40['id'],'name':_0xc6cd40[_0x85c1('0x32')][_0x85c1('0x3e')][_0x85c1('0x34')],'phone':_0xc6cd40['entry_list']['phone_home'][_0x85c1('0x34')]});});}});}function request(_0x1eeef2){logger[_0x85c1('0x41')](_0x85c1('0x42'),JSON[_0x85c1('0x28')](_0x1eeef2));return rp(_[_0x85c1('0x43')](def,_0x1eeef2));}function getTags(_0x46a67b,_0x235553){var _0xeab506=[];if(_0x46a67b&&_0x46a67b[_0x85c1('0x1c')]>0x0){_0xeab506=_[_0x85c1('0x44')](_0x46a67b,_0x235553);}return _0xeab506;}function getCustomFields(_0x5a90cc,_0x75aa9){var _0x461bca=[];var _0x49bbd5={'custom_fields':[]};if(_0x5a90cc[_0x85c1('0x1c')]>0x0){_['forEach'](_0x5a90cc,function(_0x48c2d7){if(_0x48c2d7[_0x85c1('0x45')]==='string'&&_0x48c2d7[_0x85c1('0x46')]&&!_0x48c2d7['customField']){_0x49bbd5[_0x48c2d7[_0x85c1('0x46')][_0x85c1('0x47')]()]=_0x48c2d7[_0x85c1('0x48')][_0x85c1('0x25')]();}else if(_0x48c2d7[_0x85c1('0x45')]===_0x85c1('0x49')&&_0x48c2d7['idField']&&_0x48c2d7[_0x85c1('0x4a')]){_0x49bbd5[_0x85c1('0x4b')]['push']({'id':_0x48c2d7[_0x85c1('0x4c')],'value':_0x48c2d7['content'][_0x85c1('0x25')]()});}else if(_0x48c2d7[_0x85c1('0x45')]===_0x85c1('0x4d')&&_0x48c2d7[_0x85c1('0x1e')]&&_0x48c2d7['idField']&&_0x48c2d7[_0x85c1('0x4a')]){_0x75aa9[_0x48c2d7['variableName']]&&_0x49bbd5[_0x85c1('0x4b')][_0x85c1('0x1f')]({'id':_0x48c2d7[_0x85c1('0x4c')],'value':_0x75aa9[_0x48c2d7[_0x85c1('0x1e')]][_0x85c1('0x25')]()});}else if(_0x48c2d7[_0x85c1('0x45')]===_0x85c1('0x4e')&&_0x48c2d7[_0x85c1('0x4f')]&&_0x48c2d7[_0x85c1('0x4f')][_0x85c1('0xf')]&&_0x48c2d7[_0x85c1('0x4c')]&&_0x48c2d7['customField']){_0x75aa9[_0x48c2d7['Variable'][_0x85c1('0xf')][_0x85c1('0x47')]()]&&_0x49bbd5[_0x85c1('0x4b')][_0x85c1('0x1f')]({'id':_0x48c2d7['idField'],'value':_0x75aa9[_0x48c2d7[_0x85c1('0x4f')][_0x85c1('0xf')][_0x85c1('0x47')]()][_0x85c1('0x25')]()});}});}return _0x49bbd5;}function getConnection(_0xa49e0a){return request({'method':_0x85c1('0xb'),'form':{'method':'login','input_type':_0x85c1('0x21'),'response_type':_0x85c1('0x21'),'rest_data':JSON[_0x85c1('0x28')]({'user_auth':{'user_name':_0xa49e0a[_0x85c1('0x50')],'password':_0xa49e0a['password'],'encryption':_0x85c1('0x51')},'application':_0x85c1('0x52')})}})['then'](function(_0x386dfa){var _0x11cb30=_0x386dfa;if(_0x11cb30['id']){def['sessionID']=_0x11cb30['id'];return BPromise['resolve'](_0x11cb30);}else{throw new Error(util[_0x85c1('0x2d')](_0x85c1('0x53'),_0xa49e0a['id']));}});}function setRelationship(_0x5f23d8,_0x2f35fb,_0x99b00b,_0x22006e){return request({'form':{'method':_0x85c1('0x54'),'input_type':_0x85c1('0x21'),'response_type':_0x85c1('0x21'),'rest_data':JSON['stringify']({'session':_0x5f23d8['id'],'module_name':'Calls','module_id':_0x99b00b['id'],'link_field_name':_0x22006e,'related_ids':[_0x2f35fb['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x85c1('0x55')]=function(_0x1a94c4,_0x28472e,_0x4506e7,_0x43944f,_0x29955f,_0x3846c3){var _0x2cf7f2,_0x52d111,_0x101b3c,_0x477890;_0x3846c3[_0x85c1('0x56')]=intUtil[_0x85c1('0x57')](_0x3846c3[_0x85c1('0x56')]);_0x3846c3[_0x85c1('0x58')]=intUtil[_0x85c1('0x57')](_0x3846c3[_0x85c1('0x58')]);def['uri']=util[_0x85c1('0x2d')](_0x85c1('0x59'),_0x3846c3[_0x85c1('0x56')]);if(_0x29955f&&_0x29955f['monitor_format']){logger[_0x85c1('0xd')]('[QUEUE]',_0x85c1('0x5a'));_0x28472e[_0x85c1('0x5b')]=util[_0x85c1('0x2d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3846c3['serverUrl'],_0x28472e[_0x85c1('0x5c')],md5(_0x28472e[_0x85c1('0x5c')]));}else{_0x28472e[_0x85c1('0x5b')]='';}return getConnection(_0x3846c3)[_0x85c1('0x30')](function(_0x50604b){_0x477890=_0x50604b;return getUser(_0x3846c3,_0x43944f[_0x85c1('0xf')],_0x477890);})['then'](function(_0x3f92d0){_0x2cf7f2=_0x3f92d0;logger[_0x85c1('0xd')](_0x85c1('0x5d'),_0x2cf7f2['id']);return getEndUser(_0x3846c3,_0x28472e[_0x85c1('0x5e')],_0x28472e[_0x85c1('0x5f')],_0x477890);})[_0x85c1('0x30')](function(_0x45878a){_0x52d111=_0x45878a;logger[_0x85c1('0xd')]('The\x20Enduser\x20ID\x20is:',_0x52d111['id']);return getTicket(_0x3846c3,_0x2cf7f2,_0x52d111,_0x4506e7,_0x28472e,_0x4506e7['Fields'],_0x477890,_0x85c1('0x60'));})['then'](function(_0x2d4cbd){_0x101b3c=_0x2d4cbd;logger[_0x85c1('0xd')]('Ticket\x20created!');logger[_0x85c1('0xd')](_0x85c1('0x61'),_0x101b3c['id']);return setRelationship(_0x477890,_0x2cf7f2,_0x101b3c,'users');})[_0x85c1('0x30')](function(){return setRelationship(_0x477890,_0x52d111,_0x101b3c,_0x85c1('0x62'));})[_0x85c1('0x30')](function(){return getServerInfo(_0x477890);})[_0x85c1('0x30')](function(_0x570929){var _0x1c1c60=parseInt(_0x570929[_0x85c1('0x63')]['charAt'](0x0));var _0x3a3913=util[_0x85c1('0x2d')](_0x85c1('0x64'),_0x3846c3[_0x85c1('0x56')],_0x101b3c['id']);if(_0x1c1c60>0x6){_0x3a3913=util['format'](_0x85c1('0x65'),_0x3846c3[_0x85c1('0x56')],_0x101b3c['id']);}logger[_0x85c1('0xd')](_0x85c1('0x66'),_0x85c1('0x67'));emit(util[_0x85c1('0x2d')](_0x85c1('0x68'),_0x43944f[_0x85c1('0xf')]),_0x85c1('0x69'),{'uri':_0x3a3913});})[_0x85c1('0x6a')](function(_0x391f04){logger[_0x85c1('0x6b')](_0x85c1('0x66'),JSON[_0x85c1('0x28')](_0x391f04));});};exports[_0x85c1('0x6c')]=function(_0x1a4d67,_0x37edf2,_0x19add6,_0x235725,_0x1e5e67,_0x10ea53,_0x4a74b2){var _0x2042c6,_0x36b0f6,_0xf69ea9,_0x15f2fc;_0x10ea53[_0x85c1('0x56')]=intUtil['stripTrailingSlash'](_0x10ea53[_0x85c1('0x56')]);_0x10ea53[_0x85c1('0x58')]=intUtil[_0x85c1('0x57')](_0x10ea53[_0x85c1('0x58')]);def[_0x85c1('0x6d')]=util['format']('%s/service/v4_1/rest.php',_0x10ea53[_0x85c1('0x56')]);if(_0x4a74b2&&_0x4a74b2[_0x85c1('0x6e')]&&_0x4a74b2[_0x85c1('0x6e')]!==_0x85c1('0x6f')){logger['info'](_0x85c1('0x70'),_0x85c1('0x5a'));_0x37edf2['recordingURL']=util[_0x85c1('0x2d')](_0x85c1('0x71'),_0x10ea53[_0x85c1('0x58')],_0x37edf2[_0x85c1('0x5c')],md5(_0x37edf2[_0x85c1('0x5c')]));}return getConnection(_0x10ea53)['then'](function(_0x41319b){_0x15f2fc=_0x41319b;return getUser(_0x10ea53,_0x235725['name'],_0x15f2fc);})['then'](function(_0x15aa21){_0x2042c6=_0x15aa21;logger['info'](_0x85c1('0x5d'),_0x2042c6['id']);return getEndUser(_0x10ea53,_0x37edf2['destcalleridname'],_0x37edf2['destcalleridnum'],_0x15f2fc);})[_0x85c1('0x30')](function(_0x14a68d){_0x36b0f6=_0x14a68d;logger[_0x85c1('0xd')](_0x85c1('0x72'),_0x36b0f6['id']);return getTicket(_0x10ea53,_0x2042c6,_0x36b0f6,_0x19add6,_0x37edf2,_0x19add6[_0x85c1('0x73')],_0x15f2fc,'Outbound');})[_0x85c1('0x30')](function(_0x165184){_0xf69ea9=_0x165184;logger[_0x85c1('0xd')]('Ticket\x20created!');logger['info'](_0x85c1('0x61'),_0xf69ea9['id']);return setRelationship(_0x15f2fc,_0x2042c6,_0xf69ea9,'users');})['then'](function(){return setRelationship(_0x15f2fc,_0x36b0f6,_0xf69ea9,_0x85c1('0x62'));})['then'](function(){return getServerInfo(_0x15f2fc);})[_0x85c1('0x30')](function(_0xd84cb4){var _0x4a1eba=parseInt(_0xd84cb4['version'][_0x85c1('0x74')](0x0));var _0x2e75ec=util[_0x85c1('0x2d')](_0x85c1('0x64'),_0x10ea53[_0x85c1('0x56')],_0xf69ea9['id']);if(_0x4a1eba>0x6){_0x2e75ec=util[_0x85c1('0x2d')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x10ea53['remoteUri'],_0xf69ea9['id']);}logger['info']('[OUTBOUND]',_0x85c1('0x67'));emit(util[_0x85c1('0x2d')]('user:%s',_0x235725[_0x85c1('0xf')]),_0x85c1('0x69'),{'uri':_0x2e75ec});})[_0x85c1('0x6a')](function(_0x35752e){logger[_0x85c1('0x6b')](_0x85c1('0x70'),JSON['stringify'](_0x35752e));});};exports[_0x85c1('0x75')]=function(_0x404fc1,_0x3b6fe7,_0xcf2fa1,_0x50e79b,_0x59448e,_0x14700c){var _0x5b94b1,_0x34146e,_0x37699c,_0x5dd60c;_0x14700c['remoteUri']=intUtil[_0x85c1('0x57')](_0x14700c[_0x85c1('0x56')]);_0x14700c[_0x85c1('0x58')]=intUtil[_0x85c1('0x57')](_0x14700c[_0x85c1('0x58')]);def[_0x85c1('0x6d')]=util[_0x85c1('0x2d')](_0x85c1('0x59'),_0x14700c[_0x85c1('0x56')]);if(_0x59448e&&_0x59448e['monitor_format']){logger[_0x85c1('0xd')]('['+_0x3b6fe7['lastevent'][_0x85c1('0x76')]()+']',_0x85c1('0x5a'));_0x3b6fe7[_0x85c1('0x5b')]=util['format'](_0x85c1('0x71'),_0x14700c[_0x85c1('0x58')],_0x3b6fe7[_0x85c1('0x5c')],md5(_0x3b6fe7['uniqueid']));}else{_0x3b6fe7[_0x85c1('0x5b')]='';}return getConnection(_0x14700c)[_0x85c1('0x30')](function(_0x19e75){_0x5dd60c=_0x19e75;if(!_[_0x85c1('0x29')](_0x50e79b)){return getUser(_0x14700c,_0x50e79b['name'],_0x5dd60c);}else{return getUser(_0x14700c,null,_0x5dd60c);}})['then'](function(_0x5a91d2){_0x5b94b1=_0x5a91d2;logger[_0x85c1('0xd')](_0x85c1('0x5d'),_0x5b94b1['id']);return getEndUser(_0x14700c,_0x3b6fe7[_0x85c1('0x5e')],_0x3b6fe7[_0x85c1('0x5f')],_0x5dd60c);})[_0x85c1('0x30')](function(_0x36cd81){_0x34146e=_0x36cd81;logger[_0x85c1('0xd')](_0x85c1('0x72'),_0x34146e['id']);return getTicket(_0x14700c,_0x5b94b1,_0x34146e,_0xcf2fa1,_0x3b6fe7,_0xcf2fa1[_0x85c1('0x73')],_0x5dd60c,_0x85c1('0x60'));})[_0x85c1('0x30')](function(_0x9854d1){_0x37699c=_0x9854d1;logger[_0x85c1('0xd')](_0x85c1('0x77'));logger[_0x85c1('0xd')](_0x85c1('0x61'),_0x37699c['id']);return setRelationship(_0x5dd60c,_0x5b94b1,_0x37699c,_0x85c1('0x78'));})[_0x85c1('0x30')](function(){return setRelationship(_0x5dd60c,_0x34146e,_0x37699c,_0x85c1('0x62'));})[_0x85c1('0x30')](function(){return getServerInfo(_0x5dd60c);})[_0x85c1('0x6a')](function(_0x1be65f){logger[_0x85c1('0x6b')]('['+_0x3b6fe7[_0x85c1('0x79')][_0x85c1('0x76')]()+']',JSON[_0x85c1('0x28')](_0x1be65f));});}; \ 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 c4ba452..68ce14d 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 _0x2268=['name','Variable','toLowerCase','keyValue','keyType','key','format','keyContent','variable','%s:\x20%s','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test','lodash','util','sortBy','length','string','type','variableName','push','customVariable'];(function(_0x5898d1,_0x1a2393){var _0x3d8a34=function(_0x288024){while(--_0x288024){_0x5898d1['push'](_0x5898d1['shift']());}};_0x3d8a34(++_0x1a2393);}(_0x2268,0x1b1));var _0x8226=function(_0x2e0cc3,_0x2efba3){_0x2e0cc3=_0x2e0cc3-0x0;var _0x1c7068=_0x2268[_0x2e0cc3];return _0x1c7068;};'use strict';var _=require(_0x8226('0x0'));var util=require(_0x8226('0x1'));exports['getString']=function(_0x13530e,_0x2a387d,_0x11c066){var _0x389aa5=[];if(_0x13530e['length']>0x0){var _0x2b541e=_[_0x8226('0x2')](_0x13530e,['id']);for(var _0xa134dd=0x0;_0xa134dd<_0x2b541e[_0x8226('0x3')];_0xa134dd++){var _0x5d1520=_0x2b541e[_0xa134dd];if(_0x5d1520['type']===_0x8226('0x4')){_0x389aa5['push'](_0x5d1520['content']);}else if(_0x5d1520[_0x8226('0x5')]==='variable'&&_0x5d1520['variableName']){_0x2a387d[_0x5d1520[_0x8226('0x6')]]&&_0x389aa5[_0x8226('0x7')](_0x2a387d[_0x5d1520['variableName']]['toString']());}else if(_0x5d1520['type']===_0x8226('0x8')&&_0x5d1520['Variable']&&_0x5d1520['Variable'][_0x8226('0x9')]){_0x2a387d[_0x5d1520[_0x8226('0xa')]['name'][_0x8226('0xb')]()]&&_0x389aa5[_0x8226('0x7')](_0x2a387d[_0x5d1520[_0x8226('0xa')]['name'][_0x8226('0xb')]()]['toString']());}else if(_0x5d1520['type']===_0x8226('0xc')){if(_0x5d1520[_0x8226('0xd')]==='string'&&_0x5d1520[_0x8226('0xe')]){_0x389aa5[_0x8226('0x7')](util[_0x8226('0xf')]('%s:\x20%s',_0x5d1520[_0x8226('0xe')],_0x5d1520[_0x8226('0x10')]));}else if(_0x5d1520[_0x8226('0xd')]===_0x8226('0x11')&&_0x5d1520['variableName']&&_0x5d1520[_0x8226('0xe')]){_0x2a387d[_0x5d1520['variableName']]&&_0x389aa5[_0x8226('0x7')](util[_0x8226('0xf')](_0x8226('0x12'),_0x5d1520[_0x8226('0xe')],_0x2a387d[_0x5d1520['variableName']]));}else if(_0x5d1520[_0x8226('0xd')]===_0x8226('0x8')&&_0x5d1520['Variable']&&_0x5d1520[_0x8226('0xa')]['name']&&_0x5d1520[_0x8226('0xe')]){_0x2a387d[_0x5d1520['Variable'][_0x8226('0x9')][_0x8226('0xb')]()]&&_0x389aa5[_0x8226('0x7')](util[_0x8226('0xf')](_0x8226('0x12'),_0x5d1520[_0x8226('0xe')],_0x2a387d[_0x5d1520[_0x8226('0xa')][_0x8226('0x9')][_0x8226('0xb')]()]));}}}}return _0x389aa5[_0x8226('0x13')](_0x11c066);};exports[_0x8226('0x14')]=function(_0x11c4c7){var _0x45d9a4=_0x11c4c7[_0x8226('0x15')](-0x1);if(_0x45d9a4==='/'){_0x11c4c7=_0x11c4c7['substring'](0x0,_0x11c4c7[_0x8226('0x16')](_0x45d9a4));}return _0x11c4c7;};exports[_0x8226('0x17')]=function(_0x14b1cb){if(!_[_0x8226('0x18')](_0x14b1cb)&&_0x14b1cb!==''){var _0x290e73=/^(([^<>()\[\]\\.,;:\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 _0x290e73[_0x8226('0x19')](String(_0x14b1cb)[_0x8226('0xb')]());}else{return![];}}; \ No newline at end of file +var _0x12d8=['toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','format','key','keyContent','%s:\x20%s','join','stripTrailingSlash','substring','lastIndexOf','validateEmail','lodash','util','getString','length','string','push','content','type','variable','variableName'];(function(_0x3c9ba9,_0x41fca7){var _0x1d5210=function(_0x5835b5){while(--_0x5835b5){_0x3c9ba9['push'](_0x3c9ba9['shift']());}};_0x1d5210(++_0x41fca7);}(_0x12d8,0x1ca));var _0x812d=function(_0x9f3709,_0x154cb6){_0x9f3709=_0x9f3709-0x0;var _0x4a8a43=_0x12d8[_0x9f3709];return _0x4a8a43;};'use strict';var _=require(_0x812d('0x0'));var util=require(_0x812d('0x1'));exports[_0x812d('0x2')]=function(_0x40c925,_0x19442d,_0x5a8f4a){var _0x57e2a0=[];if(_0x40c925[_0x812d('0x3')]>0x0){var _0x745b1a=_['sortBy'](_0x40c925,['id']);for(var _0x2f6089=0x0;_0x2f6089<_0x745b1a['length'];_0x2f6089++){var _0x510e48=_0x745b1a[_0x2f6089];if(_0x510e48['type']===_0x812d('0x4')){_0x57e2a0[_0x812d('0x5')](_0x510e48[_0x812d('0x6')]);}else if(_0x510e48[_0x812d('0x7')]===_0x812d('0x8')&&_0x510e48[_0x812d('0x9')]){_0x19442d[_0x510e48['variableName']]&&_0x57e2a0['push'](_0x19442d[_0x510e48[_0x812d('0x9')]][_0x812d('0xa')]());}else if(_0x510e48[_0x812d('0x7')]===_0x812d('0xb')&&_0x510e48[_0x812d('0xc')]&&_0x510e48[_0x812d('0xc')][_0x812d('0xd')]){_0x19442d[_0x510e48[_0x812d('0xc')][_0x812d('0xd')][_0x812d('0xe')]()]&&_0x57e2a0[_0x812d('0x5')](_0x19442d[_0x510e48[_0x812d('0xc')][_0x812d('0xd')]['toLowerCase']()][_0x812d('0xa')]());}else if(_0x510e48[_0x812d('0x7')]===_0x812d('0xf')){if(_0x510e48[_0x812d('0x10')]===_0x812d('0x4')&&_0x510e48['key']){_0x57e2a0[_0x812d('0x5')](util[_0x812d('0x11')]('%s:\x20%s',_0x510e48[_0x812d('0x12')],_0x510e48[_0x812d('0x13')]));}else if(_0x510e48['keyType']===_0x812d('0x8')&&_0x510e48['variableName']&&_0x510e48['key']){_0x19442d[_0x510e48[_0x812d('0x9')]]&&_0x57e2a0[_0x812d('0x5')](util['format'](_0x812d('0x14'),_0x510e48[_0x812d('0x12')],_0x19442d[_0x510e48[_0x812d('0x9')]]));}else if(_0x510e48[_0x812d('0x10')]==='customVariable'&&_0x510e48[_0x812d('0xc')]&&_0x510e48[_0x812d('0xc')][_0x812d('0xd')]&&_0x510e48[_0x812d('0x12')]){_0x19442d[_0x510e48[_0x812d('0xc')][_0x812d('0xd')][_0x812d('0xe')]()]&&_0x57e2a0[_0x812d('0x5')](util[_0x812d('0x11')](_0x812d('0x14'),_0x510e48[_0x812d('0x12')],_0x19442d[_0x510e48[_0x812d('0xc')][_0x812d('0xd')][_0x812d('0xe')]()]));}}}}return _0x57e2a0[_0x812d('0x15')](_0x5a8f4a);};exports[_0x812d('0x16')]=function(_0x34ca17){var _0x6c6a91=_0x34ca17['slice'](-0x1);if(_0x6c6a91==='/'){_0x34ca17=_0x34ca17[_0x812d('0x17')](0x0,_0x34ca17[_0x812d('0x18')](_0x6c6a91));}return _0x34ca17;};exports[_0x812d('0x19')]=function(_0x1925aa){if(!_['isNil'](_0x1925aa)&&_0x1925aa!==''){var _0xc04646=/^(([^<>()\[\]\\.,;:\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 _0xc04646['test'](String(_0x1925aa)[_0x812d('0xe')]());}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 1434414..e271fb5 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _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(_0x137629,_0x5d475c){var _0x433b41=function(_0x2d693a){while(--_0x2d693a){_0x137629['push'](_0x137629['shift']());}};_0x433b41(++_0x5d475c);}(_0xe706,0xa3));var _0x6e70=function(_0x197d5c,_0x1936b0){_0x197d5c=_0x197d5c-0x0;var _0x13dc71=_0xe706[_0x197d5c];return _0x13dc71;};'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 diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index f52f573..796e97c 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 _0xbe4a=['string','type','idField','custom_fields','push','variable','variableName','customVariable','Variable','toLowerCase','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','Subjects','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','toString','debug','[HTTP]','stringify','GET','forEach','picklist','customField','content','includes'];(function(_0x439a03,_0x45a6f4){var _0x30c51a=function(_0x34c13d){while(--_0x34c13d){_0x439a03['push'](_0x439a03['shift']());}};_0x30c51a(++_0x45a6f4);}(_0xbe4a,0x119));var _0xabe4=function(_0x58321f,_0x5730b9){_0x58321f=_0x58321f-0x0;var _0x3728ea=_0xbe4a[_0x58321f];return _0x3728ea;};'use strict';var _=require(_0xabe4('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xabe4('0x1'));var Redis=require(_0xabe4('0x2'));var intUtil=require('./util');var config=require(_0xabe4('0x3'));var logger=require(_0xabe4('0x4'))(_0xabe4('0x5'));config[_0xabe4('0x6')]=_[_0xabe4('0x7')](config[_0xabe4('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xabe4('0x8'))(new Redis(config[_0xabe4('0x6')]));function emit(_0x4ff581,_0x589937,_0x4a70bb){io['to'](_0x4ff581)[_0xabe4('0x9')](_0x589937,_0x4a70bb);}var headers={'Content-Type':'application/json','Accept':_0xabe4('0xa')};function getTicket(_0x216809,_0x22b310,_0x3848f6,_0x386620,_0x2bf194){logger[_0xabe4('0xb')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xabe4('0xc')](_0xabe4('0xd'),_0x216809[_0xabe4('0xe')]),'method':_0xabe4('0xf'),'body':{'ticket':_[_0xabe4('0x10')]({'requester_id':_0x3848f6['id'],'submitter_id':_0x22b310?_0x22b310['id']:undefined,'assignee_id':_0x22b310?_0x22b310['id']:undefined,'tags':getTags(_0x386620[_0xabe4('0x11')],_0xabe4('0x12')),'subject':intUtil['getString'](_0x386620[_0xabe4('0x13')],_0x2bf194,'\x20'),'description':intUtil[_0xabe4('0x14')](_0x386620['Descriptions'],_0x2bf194,'\x0a'),'comment':{'public':![],'body':intUtil[_0xabe4('0x14')](_0x386620[_0xabe4('0x15')],_0x2bf194,'\x0a')}},getCustomFields(_0x386620[_0xabe4('0x16')],_0x2bf194))}})[_0xabe4('0x17')](function(_0x43eded){logger[_0xabe4('0xb')](_0xabe4('0x18'));return _0x43eded[_0xabe4('0x19')];});}function getUser(_0x37c90c,_0x329edd){if(intUtil[_0xabe4('0x1a')](_0x329edd)){logger['info'](_0xabe4('0x1b'),_0x329edd);return request({'uri':util[_0xabe4('0xc')](_0xabe4('0x1c'),_0x37c90c[_0xabe4('0xe')]),'qs':{'query':util[_0xabe4('0xc')](_0xabe4('0x1d'),_0x329edd)}})['then'](function(_0x4e7e9f){if(_0x4e7e9f[_0xabe4('0x1e')]){logger[_0xabe4('0xb')](_0xabe4('0x1f'));return _[_0xabe4('0x20')](_0x4e7e9f[_0xabe4('0x21')],{'email':_0x329edd,'role':_0xabe4('0x22')});}else{logger[_0xabe4('0xb')](_0xabe4('0x23'));return request({'uri':util[_0xabe4('0xc')]('%s/users/me.json',_0x37c90c[_0xabe4('0xe')])})['then'](function(_0x470ec4){logger[_0xabe4('0xb')](_0xabe4('0x24'));return _0x470ec4[_0xabe4('0x25')];});}});}else{logger[_0xabe4('0xb')](_0xabe4('0x23'));return request({'uri':util[_0xabe4('0xc')]('%s/users/me.json',_0x37c90c[_0xabe4('0xe')])})['then'](function(_0x146007){logger[_0xabe4('0xb')]('Admin\x20account\x20selected.');return _0x146007[_0xabe4('0x25')];});}}function getEndUser(_0x3b7c7a,_0x4eba80,_0xc3467){logger[_0xabe4('0xb')](_0xabe4('0x26'),_0xc3467);return request({'uri':util['format'](_0xabe4('0x1c'),_0x3b7c7a['remoteUri']),'qs':{'query':util['format'](_0xabe4('0x27'),_0xc3467)}})['then'](function(_0x4e0aa2){var _0x38f3d7;if(_0x4e0aa2['results']['length']){_0x4e0aa2[_0xabe4('0x21')]=_[_0xabe4('0x28')](_0x4e0aa2[_0xabe4('0x21')],{'suspended':![],'role':_0xabe4('0x29')});if(_0x4e0aa2[_0xabe4('0x21')][_0xabe4('0x2a')]){_0x38f3d7=_[_0xabe4('0x2b')](_0x4e0aa2[_0xabe4('0x21')]);}}if(_0x38f3d7){logger[_0xabe4('0xb')](_0xabe4('0x2c'));return _0x38f3d7;}else{logger[_0xabe4('0xb')](_0xabe4('0x2d'));return request({'uri':util[_0xabe4('0xc')]('%s/users.json',_0x3b7c7a[_0xabe4('0xe')]),'method':_0xabe4('0xf'),'body':{'user':{'role':'end-user','name':util[_0xabe4('0xc')](_0xabe4('0x2e'),_0x4eba80||_0xc3467),'phone':_0xc3467}}})[_0xabe4('0x17')](function(_0x54d8b4){logger[_0xabe4('0xb')](_0xabe4('0x2f'));return _0x54d8b4['user'];});}});}function getAuth(_0x1ce277){var _0x63306b;if(_0x1ce277[_0xabe4('0x30')]===_0xabe4('0x31')){_0x63306b=util[_0xabe4('0xc')](_0xabe4('0x32'),_0x1ce277[_0xabe4('0x33')],_0x1ce277[_0xabe4('0x31')]);}else if(_0x1ce277[_0xabe4('0x30')]===_0xabe4('0x34')){_0x63306b=util[_0xabe4('0xc')](_0xabe4('0x35'),_0x1ce277[_0xabe4('0x33')],_0x1ce277[_0xabe4('0x34')]);}return util[_0xabe4('0xc')]('Basic\x20%s',new Buffer(_0x63306b)[_0xabe4('0x36')]('base64'));}function request(_0x350417){logger[_0xabe4('0x37')](_0xabe4('0x38'),JSON[_0xabe4('0x39')](_0x350417));return rp(_[_0xabe4('0x7')](_0x350417,{'method':_0xabe4('0x3a'),'headers':headers,'json':!![]}));}function getTags(_0x361cad,_0x1cc42e){var _0x15f96a=[];if(_0x361cad&&_0x361cad[_0xabe4('0x2a')]>0x0){_0x15f96a=_['map'](_0x361cad,_0x1cc42e);}return _0x15f96a;}function getCustomFields(_0x265fea,_0x4fac2c){var _0x541731=[];var _0x3dfc8b={'custom_fields':[]};if(_0x265fea[_0xabe4('0x2a')]>0x0){_[_0xabe4('0x3b')](_0x265fea,function(_0x42b4be){if(_['includes'](['string',_0xabe4('0x3c')],_0x42b4be['type'])&&_0x42b4be['nameField']&&!_0x42b4be[_0xabe4('0x3d')]){_0x3dfc8b[_0x42b4be['nameField']['toLowerCase']()]=_0x42b4be[_0xabe4('0x3e')][_0xabe4('0x36')]();}else if(_[_0xabe4('0x3f')]([_0xabe4('0x40'),_0xabe4('0x3c')],_0x42b4be[_0xabe4('0x41')])&&_0x42b4be[_0xabe4('0x42')]&&_0x42b4be[_0xabe4('0x3d')]){_0x3dfc8b[_0xabe4('0x43')][_0xabe4('0x44')]({'id':_0x42b4be[_0xabe4('0x42')],'value':_0x42b4be[_0xabe4('0x3e')]['toString']()});}else if(_0x42b4be[_0xabe4('0x41')]===_0xabe4('0x45')&&_0x42b4be['variableName']&&_0x42b4be[_0xabe4('0x42')]&&_0x42b4be[_0xabe4('0x3d')]){_0x4fac2c[_0x42b4be['variableName']]&&_0x3dfc8b[_0xabe4('0x43')][_0xabe4('0x44')]({'id':_0x42b4be[_0xabe4('0x42')],'value':_0x4fac2c[_0x42b4be[_0xabe4('0x46')]][_0xabe4('0x36')]()});}else if(_0x42b4be[_0xabe4('0x41')]===_0xabe4('0x47')&&_0x42b4be['Variable']&&_0x42b4be[_0xabe4('0x48')]['name']&&_0x42b4be[_0xabe4('0x42')]&&_0x42b4be['customField']){_0x4fac2c[_0x42b4be[_0xabe4('0x48')]['name'][_0xabe4('0x49')]()]&&_0x3dfc8b[_0xabe4('0x43')]['push']({'id':_0x42b4be[_0xabe4('0x42')],'value':_0x4fac2c[_0x42b4be[_0xabe4('0x48')][_0xabe4('0x12')][_0xabe4('0x49')]()][_0xabe4('0x36')]()});}});}return _0x3dfc8b;}exports['queue']=function(_0xb0007b,_0x11d2ce,_0x4e66f0,_0xfb1c50,_0x390fe6,_0x1d8bf1){var _0x1140ef,_0x5e48bf;_0x1d8bf1[_0xabe4('0xe')]=intUtil[_0xabe4('0x4a')](_0x1d8bf1[_0xabe4('0xe')]);_0x1d8bf1['serverUrl']=intUtil['stripTrailingSlash'](_0x1d8bf1['serverUrl']);if(_0x390fe6&&_0x390fe6[_0xabe4('0x4b')]){logger[_0xabe4('0xb')]('[QUEUE]',_0xabe4('0x4c'));_0x11d2ce[_0xabe4('0x4d')]=util[_0xabe4('0xc')](_0xabe4('0x4e'),_0x1d8bf1[_0xabe4('0x4f')],_0x11d2ce[_0xabe4('0x50')],md5(_0x11d2ce[_0xabe4('0x50')]));}else{_0x11d2ce[_0xabe4('0x4d')]='';}headers[_0xabe4('0x51')]=getAuth(_0x1d8bf1);return getUser(_0x1d8bf1,_0xfb1c50['email'])[_0xabe4('0x17')](function(_0x682975){_0x1140ef=_0x682975;logger[_0xabe4('0xb')](_0xabe4('0x52'),_0x1140ef['id']);return getEndUser(_0x1d8bf1,_0x11d2ce[_0xabe4('0x53')],_0x11d2ce[_0xabe4('0x54')]);})['then'](function(_0x4994e7){_0x5e48bf=_0x4994e7;logger[_0xabe4('0xb')]('The\x20Enduser\x20ID\x20is:',_0x5e48bf['id']);return getTicket(_0x1d8bf1,_0x1140ef,_0x5e48bf,_0x4e66f0,_0x11d2ce);})['then'](function(_0x2957c1){if(_0x2957c1){logger['info'](_0xabe4('0x55'),_0x2957c1['id']);switch(_0x1d8bf1[_0xabe4('0x41')]){case _0xabe4('0x56'):logger[_0xabe4('0xb')](_0xabe4('0x57'),_0xabe4('0x58'));return request({'uri':util[_0xabe4('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x1d8bf1[_0xabe4('0xe')],_0x1140ef['id'],_0x2957c1['id']),'method':_0xabe4('0xf')});case _0xabe4('0x59'):logger['info'](_0xabe4('0x57'),_0xabe4('0x5a'));emit(util[_0xabe4('0xc')](_0xabe4('0x5b'),_0xfb1c50[_0xabe4('0x12')]),_0xabe4('0x5c'),{'uri':util['format'](_0xabe4('0x5d'),_0x1d8bf1[_0xabe4('0xe')][_0xabe4('0x5e')](_0xabe4('0x5f'),''),_0x2957c1['id'])});break;default:logger[_0xabe4('0x60')](_0xabe4('0x57'),_0xabe4('0x61'));}}})['catch'](function(_0xa4aef7){logger[_0xabe4('0x60')](_0xabe4('0x62'),util[_0xabe4('0x63')](_0xa4aef7,{'showHidden':!![],'depth':null}));});};exports[_0xabe4('0x64')]=function(_0x544f47,_0x5691e5,_0x409394,_0x4e25a4,_0x298bf4,_0x4c2f14,_0x2d0aea){var _0x44fc05,_0x3149ff;_0x4c2f14['remoteUri']=intUtil['stripTrailingSlash'](_0x4c2f14[_0xabe4('0xe')]);_0x4c2f14[_0xabe4('0x4f')]=intUtil[_0xabe4('0x4a')](_0x4c2f14[_0xabe4('0x4f')]);if(_0x2d0aea&&_0x2d0aea['recordingFormat']&&_0x2d0aea[_0xabe4('0x65')]!==_0xabe4('0x66')){logger[_0xabe4('0xb')](_0xabe4('0x67'),_0xabe4('0x4c'));_0x5691e5['recordingURL']=util[_0xabe4('0xc')](_0xabe4('0x4e'),_0x4c2f14[_0xabe4('0x4f')],_0x5691e5[_0xabe4('0x50')],md5(_0x5691e5[_0xabe4('0x50')]));}headers['Authorization']=getAuth(_0x4c2f14);return getUser(_0x4c2f14,_0x4e25a4[_0xabe4('0x68')])['then'](function(_0x2d857e){_0x44fc05=_0x2d857e;logger[_0xabe4('0xb')](_0xabe4('0x52'),_0x44fc05['id']);return getEndUser(_0x4c2f14,_0x5691e5[_0xabe4('0x69')],_0x5691e5[_0xabe4('0x6a')]);})[_0xabe4('0x17')](function(_0x545e36){_0x3149ff=_0x545e36;logger[_0xabe4('0xb')](_0xabe4('0x6b'),_0x3149ff['id']);return getTicket(_0x4c2f14,_0x44fc05,_0x3149ff,_0x409394,_0x5691e5);})[_0xabe4('0x17')](function(_0x2a1dea){if(_0x2a1dea){logger['info'](_0xabe4('0x55'),_0x2a1dea['id']);switch(_0x4c2f14[_0xabe4('0x41')]){case _0xabe4('0x56'):logger['info'](_0xabe4('0x67'),_0xabe4('0x58'));return request({'uri':util[_0xabe4('0xc')](_0xabe4('0x6c'),_0x4c2f14[_0xabe4('0xe')],_0x44fc05['id'],_0x2a1dea['id']),'method':_0xabe4('0xf')});case'newTab':logger[_0xabe4('0xb')](_0xabe4('0x67'),_0xabe4('0x5a'));emit(util[_0xabe4('0xc')]('user:%s',_0x4e25a4[_0xabe4('0x12')]),_0xabe4('0x5c'),{'uri':util[_0xabe4('0xc')](_0xabe4('0x5d'),_0x4c2f14['remoteUri']['replace']('/api/v2',''),_0x2a1dea['id'])});break;default:logger[_0xabe4('0x60')](_0xabe4('0x67'),_0xabe4('0x61'));}}})[_0xabe4('0x6d')](function(_0x46f453){logger[_0xabe4('0x60')](_0xabe4('0x6e'),util['inspect'](_0x46f453,{'showHidden':!![],'depth':null}));});};exports[_0xabe4('0x6f')]=function(_0x1935af,_0x3aaecf,_0x380a13,_0x3cd79c,_0x434c49,_0x25bb6a){var _0x5da6ee,_0x2e5590;_0x25bb6a[_0xabe4('0xe')]=intUtil[_0xabe4('0x4a')](_0x25bb6a[_0xabe4('0xe')]);_0x25bb6a[_0xabe4('0x4f')]=intUtil[_0xabe4('0x4a')](_0x25bb6a[_0xabe4('0x4f')]);if(_0x434c49&&_0x434c49[_0xabe4('0x4b')]){logger[_0xabe4('0xb')]('['+_0x3aaecf[_0xabe4('0x70')][_0xabe4('0x71')]()+']',_0xabe4('0x4c'));_0x3aaecf[_0xabe4('0x4d')]=util[_0xabe4('0xc')](_0xabe4('0x4e'),_0x25bb6a[_0xabe4('0x4f')],_0x3aaecf[_0xabe4('0x50')],md5(_0x3aaecf[_0xabe4('0x50')]));}else{_0x3aaecf[_0xabe4('0x4d')]='';}headers[_0xabe4('0x51')]=getAuth(_0x25bb6a);return getUser(_0x25bb6a)[_0xabe4('0x17')](function(_0x527812){_0x5da6ee=_0x527812;logger['info']('The\x20User\x20ID\x20is:',_0x5da6ee['id']);return getEndUser(_0x25bb6a,_0x3aaecf[_0xabe4('0x53')],_0x3aaecf[_0xabe4('0x54')]);})['then'](function(_0x29a312){_0x2e5590=_0x29a312;logger[_0xabe4('0xb')](_0xabe4('0x6b'),_0x2e5590['id']);return getTicket(_0x25bb6a,_0x5da6ee,_0x2e5590,_0x380a13,_0x3aaecf);})[_0xabe4('0x17')](function(_0xe92cf8){if(_0xe92cf8){logger[_0xabe4('0xb')](_0xabe4('0x55'),_0xe92cf8['id']);}})[_0xabe4('0x6d')](function(_0x1e0536){logger[_0xabe4('0x60')]('['+_0x3aaecf[_0xabe4('0x70')][_0xabe4('0x71')]()+']'+_0xabe4('0x72'),util[_0xabe4('0x63')](_0x1e0536,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4c5d=['replace','error','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','calleridnum','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','Subjects','getString','Descriptions','Fields','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','%s:%s','username','authType','%s/token:%s','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','map','forEach','includes','string','picklist','type','customField','nameField','content','custom_fields','push','variableName','idField','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','Authorization','email','destcalleridname','destcalleridnum','newTab'];(function(_0x43d79c,_0x3da79f){var _0x522a04=function(_0xbf362b){while(--_0xbf362b){_0x43d79c['push'](_0x43d79c['shift']());}};_0x522a04(++_0x3da79f);}(_0x4c5d,0x1ba));var _0xd4c5=function(_0x5a769e,_0x51afe3){_0x5a769e=_0x5a769e-0x0;var _0xbe7d5=_0x4c5d[_0x5a769e];return _0xbe7d5;};'use strict';var _=require('lodash');var rp=require(_0xd4c5('0x0'));var md5=require('md5');var util=require(_0xd4c5('0x1'));var Redis=require(_0xd4c5('0x2'));var intUtil=require(_0xd4c5('0x3'));var config=require(_0xd4c5('0x4'));var logger=require('../../../../config/logger')('zendesk');config[_0xd4c5('0x5')]=_[_0xd4c5('0x6')](config['redis'],{'host':_0xd4c5('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd4c5('0x5')]));function emit(_0xa51923,_0xbe38da,_0x513bad){io['to'](_0xa51923)['emit'](_0xbe38da,_0x513bad);}var headers={'Content-Type':_0xd4c5('0x8'),'Accept':_0xd4c5('0x8')};function getTicket(_0x1bbe3a,_0xaf69cf,_0x4c2ef6,_0x3e9a20,_0x2580dc){logger[_0xd4c5('0x9')](_0xd4c5('0xa'));return request({'uri':util[_0xd4c5('0xb')](_0xd4c5('0xc'),_0x1bbe3a[_0xd4c5('0xd')]),'method':_0xd4c5('0xe'),'body':{'ticket':_[_0xd4c5('0xf')]({'requester_id':_0x4c2ef6['id'],'submitter_id':_0xaf69cf?_0xaf69cf['id']:undefined,'assignee_id':_0xaf69cf?_0xaf69cf['id']:undefined,'tags':getTags(_0x3e9a20[_0xd4c5('0x10')],_0xd4c5('0x11')),'subject':intUtil['getString'](_0x3e9a20[_0xd4c5('0x12')],_0x2580dc,'\x20'),'description':intUtil['getString'](_0x3e9a20['Descriptions'],_0x2580dc,'\x0a'),'comment':{'public':![],'body':intUtil[_0xd4c5('0x13')](_0x3e9a20[_0xd4c5('0x14')],_0x2580dc,'\x0a')}},getCustomFields(_0x3e9a20[_0xd4c5('0x15')],_0x2580dc))}})[_0xd4c5('0x16')](function(_0x232546){logger['info'](_0xd4c5('0x17'));return _0x232546['ticket'];});}function getUser(_0x245973,_0x7cf663){if(intUtil[_0xd4c5('0x18')](_0x7cf663)){logger['info'](_0xd4c5('0x19'),_0x7cf663);return request({'uri':util[_0xd4c5('0xb')](_0xd4c5('0x1a'),_0x245973[_0xd4c5('0xd')]),'qs':{'query':util[_0xd4c5('0xb')](_0xd4c5('0x1b'),_0x7cf663)}})[_0xd4c5('0x16')](function(_0x5145d7){if(_0x5145d7[_0xd4c5('0x1c')]){logger['info']('Agent\x20found!');return _['find'](_0x5145d7[_0xd4c5('0x1d')],{'email':_0x7cf663,'role':_0xd4c5('0x1e')});}else{logger['info'](_0xd4c5('0x1f'));return request({'uri':util[_0xd4c5('0xb')](_0xd4c5('0x20'),_0x245973[_0xd4c5('0xd')])})[_0xd4c5('0x16')](function(_0x1aa52c){logger[_0xd4c5('0x9')](_0xd4c5('0x21'));return _0x1aa52c[_0xd4c5('0x22')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xd4c5('0x20'),_0x245973[_0xd4c5('0xd')])})[_0xd4c5('0x16')](function(_0x186b33){logger['info'](_0xd4c5('0x21'));return _0x186b33[_0xd4c5('0x22')];});}}function getEndUser(_0x348cbd,_0x467d37,_0x44d098){logger[_0xd4c5('0x9')]('Searching\x20enduser\x20with\x20phone',_0x44d098);return request({'uri':util['format']('%s/search.json',_0x348cbd['remoteUri']),'qs':{'query':util[_0xd4c5('0xb')](_0xd4c5('0x23'),_0x44d098)}})[_0xd4c5('0x16')](function(_0x167cbf){var _0x5330d9;if(_0x167cbf['results'][_0xd4c5('0x24')]){_0x167cbf['results']=_['filter'](_0x167cbf[_0xd4c5('0x1d')],{'suspended':![],'role':'end-user'});if(_0x167cbf[_0xd4c5('0x1d')][_0xd4c5('0x24')]){_0x5330d9=_['first'](_0x167cbf[_0xd4c5('0x1d')]);}}if(_0x5330d9){logger[_0xd4c5('0x9')]('Enduser\x20found!');return _0x5330d9;}else{logger['info'](_0xd4c5('0x25'));return request({'uri':util['format'](_0xd4c5('0x26'),_0x348cbd[_0xd4c5('0xd')]),'method':_0xd4c5('0xe'),'body':{'user':{'role':_0xd4c5('0x27'),'name':util[_0xd4c5('0xb')](_0xd4c5('0x28'),_0x467d37||_0x44d098),'phone':_0x44d098}}})[_0xd4c5('0x16')](function(_0xbdd3f3){logger[_0xd4c5('0x9')]('Enduser\x20created.');return _0xbdd3f3[_0xd4c5('0x22')];});}});}function getAuth(_0x3a61bb){var _0x42be7b;if(_0x3a61bb['authType']==='password'){_0x42be7b=util[_0xd4c5('0xb')](_0xd4c5('0x29'),_0x3a61bb[_0xd4c5('0x2a')],_0x3a61bb['password']);}else if(_0x3a61bb[_0xd4c5('0x2b')]==='token'){_0x42be7b=util[_0xd4c5('0xb')](_0xd4c5('0x2c'),_0x3a61bb[_0xd4c5('0x2a')],_0x3a61bb[_0xd4c5('0x2d')]);}return util[_0xd4c5('0xb')](_0xd4c5('0x2e'),new Buffer(_0x42be7b)[_0xd4c5('0x2f')](_0xd4c5('0x30')));}function request(_0x5edcca){logger[_0xd4c5('0x31')](_0xd4c5('0x32'),JSON[_0xd4c5('0x33')](_0x5edcca));return rp(_[_0xd4c5('0x6')](_0x5edcca,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x20ea80,_0x4e17d5){var _0x16f838=[];if(_0x20ea80&&_0x20ea80[_0xd4c5('0x24')]>0x0){_0x16f838=_[_0xd4c5('0x34')](_0x20ea80,_0x4e17d5);}return _0x16f838;}function getCustomFields(_0x205e2a,_0x1a6339){var _0x20347d=[];var _0x47bf74={'custom_fields':[]};if(_0x205e2a['length']>0x0){_[_0xd4c5('0x35')](_0x205e2a,function(_0x3787d6){if(_[_0xd4c5('0x36')]([_0xd4c5('0x37'),_0xd4c5('0x38')],_0x3787d6[_0xd4c5('0x39')])&&_0x3787d6['nameField']&&!_0x3787d6[_0xd4c5('0x3a')]){_0x47bf74[_0x3787d6[_0xd4c5('0x3b')]['toLowerCase']()]=_0x3787d6[_0xd4c5('0x3c')]['toString']();}else if(_[_0xd4c5('0x36')]([_0xd4c5('0x37'),'picklist'],_0x3787d6[_0xd4c5('0x39')])&&_0x3787d6['idField']&&_0x3787d6[_0xd4c5('0x3a')]){_0x47bf74[_0xd4c5('0x3d')][_0xd4c5('0x3e')]({'id':_0x3787d6['idField'],'value':_0x3787d6['content'][_0xd4c5('0x2f')]()});}else if(_0x3787d6[_0xd4c5('0x39')]==='variable'&&_0x3787d6[_0xd4c5('0x3f')]&&_0x3787d6[_0xd4c5('0x40')]&&_0x3787d6['customField']){_0x1a6339[_0x3787d6[_0xd4c5('0x3f')]]&&_0x47bf74[_0xd4c5('0x3d')][_0xd4c5('0x3e')]({'id':_0x3787d6['idField'],'value':_0x1a6339[_0x3787d6[_0xd4c5('0x3f')]][_0xd4c5('0x2f')]()});}else if(_0x3787d6[_0xd4c5('0x39')]==='customVariable'&&_0x3787d6[_0xd4c5('0x41')]&&_0x3787d6[_0xd4c5('0x41')][_0xd4c5('0x11')]&&_0x3787d6['idField']&&_0x3787d6['customField']){_0x1a6339[_0x3787d6[_0xd4c5('0x41')][_0xd4c5('0x11')][_0xd4c5('0x42')]()]&&_0x47bf74['custom_fields'][_0xd4c5('0x3e')]({'id':_0x3787d6[_0xd4c5('0x40')],'value':_0x1a6339[_0x3787d6[_0xd4c5('0x41')][_0xd4c5('0x11')]['toLowerCase']()][_0xd4c5('0x2f')]()});}});}return _0x47bf74;}exports[_0xd4c5('0x43')]=function(_0x544d49,_0x59937c,_0x53a3d2,_0xb73ed8,_0x34e1db,_0x558751){var _0xb160bd,_0x3bc407;_0x558751['remoteUri']=intUtil[_0xd4c5('0x44')](_0x558751['remoteUri']);_0x558751[_0xd4c5('0x45')]=intUtil[_0xd4c5('0x44')](_0x558751[_0xd4c5('0x45')]);if(_0x34e1db&&_0x34e1db[_0xd4c5('0x46')]){logger[_0xd4c5('0x9')](_0xd4c5('0x47'),'Recording\x20is\x20enabled!');_0x59937c[_0xd4c5('0x48')]=util[_0xd4c5('0xb')](_0xd4c5('0x49'),_0x558751[_0xd4c5('0x45')],_0x59937c[_0xd4c5('0x4a')],md5(_0x59937c[_0xd4c5('0x4a')]));}else{_0x59937c['recordingURL']='';}headers['Authorization']=getAuth(_0x558751);return getUser(_0x558751,_0xb73ed8['email'])[_0xd4c5('0x16')](function(_0xd2bb52){_0xb160bd=_0xd2bb52;logger[_0xd4c5('0x9')]('The\x20User\x20ID\x20is:',_0xb160bd['id']);return getEndUser(_0x558751,_0x59937c[_0xd4c5('0x4b')],_0x59937c['calleridnum']);})['then'](function(_0x249b50){_0x3bc407=_0x249b50;logger[_0xd4c5('0x9')](_0xd4c5('0x4c'),_0x3bc407['id']);return getTicket(_0x558751,_0xb160bd,_0x3bc407,_0x53a3d2,_0x59937c);})[_0xd4c5('0x16')](function(_0x2ad705){if(_0x2ad705){logger[_0xd4c5('0x9')](_0xd4c5('0x4d'),_0x2ad705['id']);switch(_0x558751[_0xd4c5('0x39')]){case _0xd4c5('0x4e'):logger[_0xd4c5('0x9')](_0xd4c5('0x47'),_0xd4c5('0x4f'));return request({'uri':util[_0xd4c5('0xb')](_0xd4c5('0x50'),_0x558751[_0xd4c5('0xd')],_0xb160bd['id'],_0x2ad705['id']),'method':_0xd4c5('0xe')});case'newTab':logger[_0xd4c5('0x9')]('[QUEUE]',_0xd4c5('0x51'));emit(util[_0xd4c5('0xb')](_0xd4c5('0x52'),_0xb73ed8[_0xd4c5('0x11')]),_0xd4c5('0x53'),{'uri':util[_0xd4c5('0xb')](_0xd4c5('0x54'),_0x558751['remoteUri']['replace'](_0xd4c5('0x55'),''),_0x2ad705['id'])});break;default:logger['error'](_0xd4c5('0x47'),_0xd4c5('0x56'));}}})[_0xd4c5('0x57')](function(_0x6efd0e){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xd4c5('0x58')](_0x6efd0e,{'showHidden':!![],'depth':null}));});};exports[_0xd4c5('0x59')]=function(_0x3a3cee,_0x4c126e,_0x302f7e,_0x4cfd6f,_0xc92c48,_0x1e5375,_0xabe9b0){var _0x12fbd1,_0x26075e;_0x1e5375['remoteUri']=intUtil[_0xd4c5('0x44')](_0x1e5375['remoteUri']);_0x1e5375[_0xd4c5('0x45')]=intUtil[_0xd4c5('0x44')](_0x1e5375[_0xd4c5('0x45')]);if(_0xabe9b0&&_0xabe9b0[_0xd4c5('0x5a')]&&_0xabe9b0[_0xd4c5('0x5a')]!==_0xd4c5('0x5b')){logger[_0xd4c5('0x9')](_0xd4c5('0x5c'),'Recording\x20is\x20enabled!');_0x4c126e[_0xd4c5('0x48')]=util['format'](_0xd4c5('0x49'),_0x1e5375[_0xd4c5('0x45')],_0x4c126e[_0xd4c5('0x4a')],md5(_0x4c126e[_0xd4c5('0x4a')]));}headers[_0xd4c5('0x5d')]=getAuth(_0x1e5375);return getUser(_0x1e5375,_0x4cfd6f[_0xd4c5('0x5e')])[_0xd4c5('0x16')](function(_0xe56ec9){_0x12fbd1=_0xe56ec9;logger[_0xd4c5('0x9')]('The\x20User\x20ID\x20is:',_0x12fbd1['id']);return getEndUser(_0x1e5375,_0x4c126e[_0xd4c5('0x5f')],_0x4c126e[_0xd4c5('0x60')]);})[_0xd4c5('0x16')](function(_0x5bd082){_0x26075e=_0x5bd082;logger[_0xd4c5('0x9')](_0xd4c5('0x4c'),_0x26075e['id']);return getTicket(_0x1e5375,_0x12fbd1,_0x26075e,_0x302f7e,_0x4c126e);})[_0xd4c5('0x16')](function(_0x376be7){if(_0x376be7){logger[_0xd4c5('0x9')]('The\x20Ticket\x20ID\x20is:',_0x376be7['id']);switch(_0x1e5375[_0xd4c5('0x39')]){case _0xd4c5('0x4e'):logger[_0xd4c5('0x9')](_0xd4c5('0x5c'),_0xd4c5('0x4f'));return request({'uri':util[_0xd4c5('0xb')](_0xd4c5('0x50'),_0x1e5375[_0xd4c5('0xd')],_0x12fbd1['id'],_0x376be7['id']),'method':'POST'});case _0xd4c5('0x61'):logger['info']('[OUTBOUND]',_0xd4c5('0x51'));emit(util['format'](_0xd4c5('0x52'),_0x4cfd6f[_0xd4c5('0x11')]),'trigger:browser:url',{'uri':util[_0xd4c5('0xb')](_0xd4c5('0x54'),_0x1e5375[_0xd4c5('0xd')][_0xd4c5('0x62')](_0xd4c5('0x55'),''),_0x376be7['id'])});break;default:logger[_0xd4c5('0x63')](_0xd4c5('0x5c'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x269a08){logger['error'](_0xd4c5('0x64'),util[_0xd4c5('0x58')](_0x269a08,{'showHidden':!![],'depth':null}));});};exports[_0xd4c5('0x65')]=function(_0x482f64,_0x51b1e4,_0x349eea,_0x106700,_0x49a0aa,_0x2a36af){var _0x4e12a6,_0x4c4617;_0x2a36af[_0xd4c5('0xd')]=intUtil['stripTrailingSlash'](_0x2a36af[_0xd4c5('0xd')]);_0x2a36af[_0xd4c5('0x45')]=intUtil[_0xd4c5('0x44')](_0x2a36af[_0xd4c5('0x45')]);if(_0x49a0aa&&_0x49a0aa[_0xd4c5('0x46')]){logger[_0xd4c5('0x9')]('['+_0x51b1e4[_0xd4c5('0x66')]['toUpperCase']()+']',_0xd4c5('0x67'));_0x51b1e4[_0xd4c5('0x48')]=util['format'](_0xd4c5('0x49'),_0x2a36af[_0xd4c5('0x45')],_0x51b1e4['uniqueid'],md5(_0x51b1e4['uniqueid']));}else{_0x51b1e4[_0xd4c5('0x48')]='';}headers[_0xd4c5('0x5d')]=getAuth(_0x2a36af);return getUser(_0x2a36af)['then'](function(_0x9788e2){_0x4e12a6=_0x9788e2;logger['info'](_0xd4c5('0x68'),_0x4e12a6['id']);return getEndUser(_0x2a36af,_0x51b1e4[_0xd4c5('0x4b')],_0x51b1e4[_0xd4c5('0x69')]);})[_0xd4c5('0x16')](function(_0x7f8390){_0x4c4617=_0x7f8390;logger['info'](_0xd4c5('0x4c'),_0x4c4617['id']);return getTicket(_0x2a36af,_0x4e12a6,_0x4c4617,_0x349eea,_0x51b1e4);})[_0xd4c5('0x16')](function(_0x2ebcf5){if(_0x2ebcf5){logger[_0xd4c5('0x9')]('The\x20Ticket\x20ID\x20is:',_0x2ebcf5['id']);}})[_0xd4c5('0x57')](function(_0x77bfe0){logger[_0xd4c5('0x63')]('['+_0x51b1e4[_0xd4c5('0x66')][_0xd4c5('0x6a')]()+']'+_0xd4c5('0x6b'),util['inspect'](_0x77bfe0,{'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 b2ca8fa..c9c9840 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 _0x53d0=['Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','Agent\x20found!','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','Error:\x20','catch','log','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','Subject','getString','Subjects','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','Timeout','outbound','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','details','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','recordingURL','/api/voice/recordings/','destcalleridname','Outbound','[OUTBOUND]','toUpperCase','request-promise','md5','./util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','clientSecret','refresh_token','then','add','seconds'];(function(_0x3a9a0a,_0x2b53e9){var _0x473b8d=function(_0x518e67){while(--_0x518e67){_0x3a9a0a['push'](_0x3a9a0a['shift']());}};_0x473b8d(++_0x2b53e9);}(_0x53d0,0x6c));var _0x053d=function(_0x1dddda,_0x5946f4){_0x1dddda=_0x1dddda-0x0;var _0x5311a3=_0x53d0[_0x1dddda];return _0x5311a3;};'use strict';var _=require('lodash');var rp=require(_0x053d('0x0'));var md5=require(_0x053d('0x1'));var util=require('util');var intUtil=require(_0x053d('0x2'));var moment=require('moment');var Redis=require(_0x053d('0x3'));var BPromise=require(_0x053d('0x4'));var config=require(_0x053d('0x5'));var logger=require(_0x053d('0x6'))(_0x053d('0x7'));config[_0x053d('0x8')]=_['defaults'](config['redis'],{'host':_0x053d('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x4484be,_0x236113,_0x4b8758){io['to'](_0x4484be)['emit'](_0x236113,_0x4b8758);}function request(_0x60994c){logger[_0x053d('0xa')](_0x053d('0xb'),JSON[_0x053d('0xc')](_0x60994c));return rp(_0x60994c);}function getCustomFields(_0x104b81,_0x2fcab6){var _0xe51676={};if(_0x104b81[_0x053d('0xd')]>0x0){_[_0x053d('0xe')](_0x104b81,function(_0x415b73){if(_[_0x053d('0xf')]([_0x053d('0x10'),_0x053d('0x11')],_0x415b73[_0x053d('0x12')])&&_0x415b73[_0x053d('0x13')]){_0xe51676[_0x415b73['idField']]=_0x415b73[_0x053d('0x14')][_0x053d('0x15')]();}else if(_0x415b73[_0x053d('0x12')]==='variable'&&_0x415b73[_0x053d('0x16')]&&_0x415b73[_0x053d('0x13')]&&_0x2fcab6[_0x415b73[_0x053d('0x16')]]){_0xe51676[_0x415b73[_0x053d('0x13')]]=_0x2fcab6[_0x415b73['variableName']][_0x053d('0x15')]();}else if(_0x415b73[_0x053d('0x12')]===_0x053d('0x17')&&_0x415b73[_0x053d('0x18')]&&_0x415b73['Variable'][_0x053d('0x19')]&&_0x415b73[_0x053d('0x13')]&&_0x2fcab6[_0x415b73[_0x053d('0x18')][_0x053d('0x19')][_0x053d('0x1a')]()]){_0xe51676[_0x415b73[_0x053d('0x13')]]=_0x2fcab6[_0x415b73[_0x053d('0x18')][_0x053d('0x19')][_0x053d('0x1a')]()]['toString']();}});}return _0xe51676;}function getName(_0x539d4d){if(_0x539d4d[_0x053d('0x1b')]('\x20')>0x0){var _0x29c8fa=_0x539d4d['split'](/ (.+)/);if(_0x29c8fa[0x1]){return _0x29c8fa;}}return[_0x539d4d,_0x539d4d];}var accountsTokens={};function getAccessToken(_0x2c3d40){return new Promise(function(_0x67bc8f,_0x4abccc){if(!_[_0x053d('0x1c')](accountsTokens[_0x2c3d40['id']])&&!_[_0x053d('0x1c')](accountsTokens[_0x2c3d40['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x2c3d40['id']]['expires_in'])){_0x67bc8f(accountsTokens[_0x2c3d40['id']][_0x053d('0x1d')]);}}var _0x42d84b;switch(_0x2c3d40['zone']){case'US':_0x42d84b='https://accounts.zoho.com';break;case'AU':_0x42d84b=_0x053d('0x1e');break;case'EU':_0x42d84b=_0x053d('0x1f');break;case'IN':_0x42d84b=_0x053d('0x20');break;case'CN':_0x42d84b=_0x053d('0x21');break;default:_0x42d84b=_0x053d('0x1f');break;}var _0x5657e3={'method':'POST','uri':_0x42d84b+_0x053d('0x22'),'qs':{'refresh_token':_0x2c3d40['refreshToken'],'client_id':_0x2c3d40[_0x053d('0x23')],'client_secret':_0x2c3d40[_0x053d('0x24')],'grant_type':_0x053d('0x25')},'json':!![]};return rp(_0x5657e3)[_0x053d('0x26')](function(_0x28475d){accountsTokens[_0x2c3d40['id']]={'access_token':_0x28475d[_0x053d('0x1d')],'expires_in':moment()[_0x053d('0x27')](_0x28475d['expires_in'],_0x053d('0x28'))};_0x67bc8f(_0x28475d[_0x053d('0x1d')]);})['catch'](function(_0x50c287){logger['error'](_0x053d('0x29'),_0x50c287[_0x053d('0x2a')]);_0x4abccc(_0x50c287);});});}function getUser(_0x269929,_0x4013e7,_0x5cc41b,_0x221b96){logger['info'](_0x053d('0x2b'));return request({'method':_0x053d('0x2c'),'uri':util[_0x053d('0x2d')](_0x053d('0x2e'),_0x4013e7),'qs':{'type':_0x053d('0x2f')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x269929},'json':!![]})[_0x053d('0x26')](function(_0x452b22){if(_0x452b22[_0x053d('0x30')]){var _0x1f4156=-0x1;if(_[_0x053d('0x31')](_0x452b22[_0x053d('0x30')])){if(!_[_0x053d('0x1c')](_0x221b96)){_0x1f4156=_[_0x053d('0x32')](_0x452b22[_0x053d('0x30')],function(_0x163181){return _0x163181['email']===_0x221b96;});}if(_0x1f4156>=0x0){logger['info'](_0x053d('0x33'));}else{logger[_0x053d('0x34')](_0x053d('0x35'));_0x1f4156=_[_0x053d('0x32')](_0x452b22[_0x053d('0x30')],function(_0xf1cf50){return _0xf1cf50[_0x053d('0x36')][_0x053d('0x19')]===_0x053d('0x37');});}return _0x452b22[_0x053d('0x30')][_0x1f4156];}else{if(_0x452b22[_0x053d('0x38')][_0x053d('0x36')][_0x053d('0x19')]===_0x053d('0x37')){logger[_0x053d('0x34')](_0x053d('0x35'));user=_0x452b22[_0x053d('0x38')];return user;}else{logger[_0x053d('0x39')](_0x053d('0x3a'),JSON[_0x053d('0xc')](_0x452b22));throw new Error(_0x053d('0x3b')+JSON[_0x053d('0xc')](_0x452b22));}}}else{logger[_0x053d('0x39')](_0x053d('0x3a'),JSON[_0x053d('0xc')](_0x452b22));throw new Error(_0x053d('0x3b')+JSON[_0x053d('0xc')](_0x452b22));}})['catch'](function(_0x12b348){console[_0x053d('0x39')](_0x12b348);});}function getZohoUser(_0x14db67,_0x2040cc){return new BPromise(function(_0x1813af,_0x11a538){request(_0x14db67)[_0x053d('0x26')](function(_0x21ae64){var _0x3c0cf5=null;if(_0x21ae64){_0x3c0cf5=_0x21ae64[_0x053d('0x3c')][0x0];_0x3c0cf5[_0x053d('0x3d')]=_0x2040cc;}_0x1813af(_0x3c0cf5);})['catch'](function(_0x180b8b){_0x11a538(_0x180b8b);});});}function createEndUser(_0xb54b73,_0x4c970f,_0x3668d9,_0x595273,_0x35bc34,_0x5306d1){var _0x3668d9=getName(_0x3668d9);return request({'method':_0x053d('0x3e'),'uri':_0x053d('0x3f')+_0x4c970f+_0x053d('0x40')+_[_0x053d('0x41')](_0x5306d1[_0x053d('0x42')])+'s','body':{'data':[{'Last_Name':_0x3668d9[0x1],'First_Name':_0x3668d9[0x0],'Phone':_0x595273,'Owner':{'name':!_[_0x053d('0x1c')](_0x35bc34[_0x053d('0x43')][_0x053d('0x19')])?_0x35bc34[_0x053d('0x43')][_0x053d('0x19')]:!_[_0x053d('0x1c')](_0x35bc34['first_name'])?_0x35bc34[_0x053d('0x44')]+'\x20'+_0x35bc34['last_name']:_0x35bc34[_0x053d('0x45')],'id':_0x35bc34['id']}}]},'headers':{'Authorization':_0x053d('0x46')+_0xb54b73},'json':!![]})['then'](function(_0x162c42){if(_0x162c42&&_0x162c42['data'][0x0][_0x053d('0x47')]===_0x053d('0x48')){var _0xc30a2e=_0x162c42[_0x053d('0x3c')][0x0]['details'];_0xc30a2e[_0x053d('0x3d')]=_['startCase'](_0x5306d1[_0x053d('0x42')])+'s';return _0xc30a2e;}logger[_0x053d('0x39')](_0x053d('0x3a'),JSON[_0x053d('0xc')](data));throw new Error(_0x053d('0x49')+JSON[_0x053d('0xc')](data));})[_0x053d('0x4a')](function(_0x5ae8e4){console[_0x053d('0x4b')]('CREATE\x20ERROR',_0x5ae8e4);});}function getEndUser(_0x3b2f51,_0x5707a6,_0x4c3fdb,_0x1c366d,_0x2f242,_0xb726fc,_0x3e55be){var _0x4306c9={'method':_0x053d('0x2c'),'uri':'','headers':{'Authorization':_0x053d('0x46')+_0x3b2f51},'json':!![]};switch(_0x3e55be[_0x053d('0x4c')]){case'contact_lead':_0x4306c9[_0x053d('0x4d')]='https://www.zohoapis.'+_0x5707a6+_0x053d('0x4e')+_0x2f242+'))';return getZohoUser(_0x4306c9,_0x053d('0x4f'))[_0x053d('0x26')](function(_0x195d81){if(_0x195d81)return _0x195d81;_0x4306c9[_0x053d('0x4d')]='https://www.zohoapis.'+_0x5707a6+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2f242+'))';return getZohoUser(_0x4306c9,_0x053d('0x50'))[_0x053d('0x26')](function(_0x2fc5da){if(_0x2fc5da)return _0x2fc5da;if(_0x3e55be[_0x053d('0x42')]!=_0x053d('0x51')){return createEndUser(_0x3b2f51,_0x5707a6,_0x1c366d,_0x2f242,_0xb726fc,_0x3e55be);}else{return{};}});});break;case _0x053d('0x52'):_0x4306c9['uri']=_0x053d('0x3f')+_0x5707a6+_0x053d('0x4e')+_0x2f242+'))';return getZohoUser(_0x4306c9,_0x053d('0x4f'))[_0x053d('0x26')](function(_0x3442cc){if(_0x3442cc)return _0x3442cc;if(_0x3e55be['moduleCreate']!='nothing'){return createEndUser(_0x3b2f51,_0x5707a6,_0x1c366d,_0x2f242,_0xb726fc,_0x3e55be);}else{return{};}});break;case _0x053d('0x53'):_0x4306c9['uri']='https://www.zohoapis.'+_0x5707a6+_0x053d('0x54')+_0x2f242+'))';return getZohoUser(_0x4306c9,_0x053d('0x50'))['then'](function(_0x2c70cf){if(_0x2c70cf)return _0x2c70cf;if(_0x3e55be[_0x053d('0x42')]!='nothing'){return createEndUser(_0x3b2f51,_0x5707a6,_0x1c366d,_0x2f242,_0xb726fc,_0x3e55be);}else{return{};}});break;}}function getCall(_0xbae551,_0x3da159,_0x24ed21,_0x8c5682,_0x4425f8,_0x4a490c,_0x40f04b,_0xe8ba76){logger[_0x053d('0x34')](_0x053d('0x55'));var _0x5ada26={};_0x5ada26[_0x053d('0x56')]={'name':!_[_0x053d('0x1c')](_0x8c5682[_0x053d('0x43')][_0x053d('0x19')])&&!_[_0x053d('0x1c')](_0x8c5682['profile'][_0x053d('0x19')])&&_0x8c5682[_0x053d('0x36')]['name']==='administrator'?_0x8c5682[_0x053d('0x43')][_0x053d('0x19')]:!_[_0x053d('0x1c')](_0x8c5682[_0x053d('0x44')])?_0x8c5682[_0x053d('0x44')]+'\x20'+_0x8c5682[_0x053d('0x45')]:_0x8c5682['last_name'],'id':_0x8c5682['id']};_0x5ada26[_0x053d('0x57')]=intUtil[_0x053d('0x58')](_0x4a490c[_0x053d('0x59')],_0x40f04b,'\x20');_0x5ada26['Description']=intUtil['getString'](_0x4a490c[_0x053d('0x5a')],_0x40f04b,'\x0a');if(_0x4425f8[_0x053d('0x3d')]==='Contacts'){_0x5ada26['Who_Id']={'name':!_['isNil'](_0x4425f8[_0x053d('0x5b')])?_0x4425f8[_0x053d('0x5b')]:!_['isNil'](_0x4425f8[_0x053d('0x5c')])?_0x4425f8[_0x053d('0x5c')]+'\x20'+_0x4425f8[_0x053d('0x5d')]:_0x4425f8['Last_Name'],'id':_0x4425f8['id']};}if(_0x4425f8['enduserType']===_0x053d('0x50')){_0x5ada26[_0x053d('0x5e')]={'name':!_[_0x053d('0x1c')](_0x4425f8['Full_Name'])?_0x4425f8[_0x053d('0x5b')]:!_[_0x053d('0x1c')](_0x4425f8['First_Name'])?_0x4425f8['First_Name']+'\x20'+_0x4425f8[_0x053d('0x5d')]:_0x4425f8[_0x053d('0x5d')],'id':_0x4425f8['id']};_0x5ada26[_0x053d('0x5f')]=_['startCase'](_0x4425f8[_0x053d('0x3d')]);}if(_0x40f04b[_0x053d('0x60')]){_0x5ada26['Call_Duration']=moment[_0x053d('0x61')](parseInt(_0x40f04b[_0x053d('0x60')])*0x3e8)[_0x053d('0x2d')]('mm:ss');}else if(_0x40f04b[_0x053d('0x62')]&&_0x40f04b[_0x053d('0x63')]){_0x5ada26['Call_Duration']=moment[_0x053d('0x61')](moment(_0x40f04b[_0x053d('0x63')],_0x053d('0x64'))[_0x053d('0x65')](moment(_0x40f04b[_0x053d('0x66')],_0x053d('0x64'))))['format'](_0x053d('0x67'));}switch(_0x40f04b[_0x053d('0x68')]){case _0x053d('0x69'):_0x5ada26[_0x053d('0x6a')]=_0x053d('0x6b');break;case _0x053d('0x6c'):case _0x053d('0x6d'):_0x5ada26['Call_Result']=_0x053d('0x6e');break;case _0x053d('0x6f'):_0x5ada26[_0x053d('0x6a')]=_0x053d('0x70');break;case'abandoned':_0x5ada26[_0x053d('0x6a')]='Abandoned';break;case'timeout':_0x5ada26[_0x053d('0x6a')]=_0x053d('0x71');default:}_0x5ada26['Call_Start_Time']=(_0xe8ba76===_0x053d('0x72')?moment(_0x40f04b[_0x053d('0x66')])[_0x053d('0x2d')](_0x053d('0x64')):moment(_0x40f04b['agentcalledAt'])[_0x053d('0x2d')](_0x053d('0x64')))||moment()[_0x053d('0x2d')]('YYYY-MM-DDTHH:mm:ss');_0x5ada26[_0x053d('0x73')]=_0xe8ba76||_0x053d('0x74');_0x5ada26=_[_0x053d('0x75')](_0x5ada26,getCustomFields(_0x4a490c[_0x053d('0x76')],_0x40f04b));return request({'method':_0x053d('0x3e'),'uri':_0x053d('0x3f')+_0x3da159+_0x053d('0x77'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xbae551},'body':{'data':[_0x5ada26]},'json':!![]})['then'](function(_0x53bb46){if(_0x53bb46&&_0x53bb46[_0x053d('0x3c')][0x0]['code']===_0x053d('0x48')){logger[_0x053d('0x34')](_0x053d('0x78'));return{'id':_0x53bb46[_0x053d('0x3c')][0x0][_0x053d('0x79')]['id']};}})[_0x053d('0x4a')](function(_0x398937){logger[_0x053d('0x34')](_0x053d('0x7a'),_0x398937['stack']);console[_0x053d('0x4b')](_0x053d('0x7a'),_0x398937);});}exports['queue']=function(_0x5b3838,_0x36ee24,_0x361b34,_0x5d8009,_0x155286,_0x2ae738){var _0xdc54a2,_0x3d57a6,_0x3057c4;_0x2ae738[_0x053d('0x7b')]=intUtil[_0x053d('0x7c')](_0x2ae738[_0x053d('0x7b')]);_0x2ae738[_0x053d('0x7d')]=intUtil[_0x053d('0x7c')](_0x2ae738[_0x053d('0x7d')]);if(_0x155286&&_0x155286[_0x053d('0x7e')]){logger[_0x053d('0x34')](_0x053d('0x7f'),_0x053d('0x80'));_0x36ee24['recordingURL']=_0x2ae738[_0x053d('0x7d')]+'/api/voice/recordings/'+_0x36ee24[_0x053d('0x81')]+_0x053d('0x82')+md5(_0x36ee24[_0x053d('0x81')]);}else{_0x36ee24['recordingURL']='';}var _0x390fee=_0x2ae738[_0x053d('0x7b')]===_0x053d('0x83')?'eu':_0x053d('0x84');return getAccessToken(_0x2ae738)[_0x053d('0x26')](function(_0x246c4f){_0x3057c4=_0x246c4f;return getUser(_0x3057c4,_0x390fee,_0x2ae738,_0x5d8009[_0x053d('0x85')]);})[_0x053d('0x26')](function(_0x45bf3d){_0xdc54a2=_0x45bf3d;logger['info'](_0x053d('0x86'),_0xdc54a2['id']);return getEndUser(_0x3057c4,_0x390fee,_0x2ae738,_0x36ee24[_0x053d('0x87')],_0x36ee24[_0x053d('0x88')],_0xdc54a2,_0x361b34);})[_0x053d('0x26')](function(_0x30ff6b){_0x3d57a6=_0x30ff6b;return getCall(_0x3057c4,_0x390fee,_0x2ae738,_0xdc54a2,_0x3d57a6,_0x361b34,_0x36ee24,_0x053d('0x74'));})['then'](function(_0x196060){if(_0x196060){logger[_0x053d('0x34')](_0x053d('0x89'),_0x196060['id']);logger[_0x053d('0x34')]('[QUEUE]',_0x053d('0x8a'));emit(util['format'](_0x053d('0x8b'),_0x5d8009[_0x053d('0x19')]),'trigger:browser:url',{'uri':_0x053d('0x8c')+_0x2ae738[_0x053d('0x7b')]+_0x053d('0x8d')+_0x196060['id']});}})[_0x053d('0x4a')](function(_0x28b4a7){logger[_0x053d('0x39')](_0x053d('0x7f'),JSON[_0x053d('0xc')](_0x28b4a7));});};exports[_0x053d('0x72')]=function(_0x102a33,_0x20b1be,_0x49a0e2,_0x15bdd3,_0x2bce7b,_0x105ca5,_0x5b2155){var _0x17a00c,_0x2b867a,_0xde56d7;_0x105ca5[_0x053d('0x7b')]=intUtil[_0x053d('0x7c')](_0x105ca5[_0x053d('0x7b')]);_0x105ca5[_0x053d('0x7d')]=intUtil[_0x053d('0x7c')](_0x105ca5['serverUrl']);if(_0x5b2155&&_0x5b2155[_0x053d('0x8e')]&&_0x5b2155['recordingFormat']!=='none'){logger[_0x053d('0x34')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x20b1be[_0x053d('0x8f')]=_0x105ca5[_0x053d('0x7d')]+_0x053d('0x90')+_0x20b1be[_0x053d('0x81')]+_0x053d('0x82')+md5(_0x20b1be['uniqueid']);}var _0x2ca38c=_0x105ca5[_0x053d('0x7b')]===_0x053d('0x83')?'eu':_0x053d('0x84');return getAccessToken(_0x105ca5)[_0x053d('0x26')](function(_0x24d860){_0xde56d7=_0x24d860;return getUser(_0xde56d7,_0x2ca38c,_0x105ca5,_0x15bdd3[_0x053d('0x85')]);})[_0x053d('0x26')](function(_0xae3f14){_0x17a00c=_0xae3f14;logger[_0x053d('0x34')](_0x053d('0x86'),_0x17a00c['id']);return getEndUser(_0xde56d7,_0x2ca38c,_0x105ca5,_0x20b1be[_0x053d('0x91')],_0x20b1be['destcalleridnum'],_0x17a00c,_0x49a0e2);})[_0x053d('0x26')](function(_0x446c5e){_0x2b867a=_0x446c5e;return getCall(_0xde56d7,_0x2ca38c,_0x105ca5,_0x17a00c,_0x2b867a,_0x49a0e2,_0x20b1be,_0x053d('0x92'));})[_0x053d('0x26')](function(_0x1da6c3){if(_0x1da6c3){logger['info'](_0x053d('0x89'),_0x1da6c3['id']);logger[_0x053d('0x34')](_0x053d('0x93'),_0x053d('0x8a'));emit(util[_0x053d('0x2d')](_0x053d('0x8b'),_0x15bdd3[_0x053d('0x19')]),'trigger:browser:url',{'uri':_0x053d('0x8c')+_0x105ca5[_0x053d('0x7b')]+_0x053d('0x8d')+_0x1da6c3['id']});}})[_0x053d('0x4a')](function(_0x172bc9){logger['error']('[OUTBOUND]',JSON['stringify'](_0x172bc9));});};exports['unmanaged']=function(_0x5c35d5,_0x19d228,_0x1927d1,_0x17bc14,_0x14cc7c,_0x1f6017){var _0x5cddb2,_0x1d834d,_0x53774f;_0x1f6017[_0x053d('0x7b')]=intUtil[_0x053d('0x7c')](_0x1f6017['host']);_0x1f6017[_0x053d('0x7d')]=intUtil['stripTrailingSlash'](_0x1f6017[_0x053d('0x7d')]);if(_0x14cc7c&&_0x14cc7c[_0x053d('0x7e')]){logger[_0x053d('0x34')]('['+_0x19d228[_0x053d('0x68')][_0x053d('0x94')]()+']','Recording\x20is\x20enabled!');_0x19d228['recordingURL']=_0x1f6017[_0x053d('0x7d')]+_0x053d('0x90')+_0x19d228[_0x053d('0x81')]+_0x053d('0x82')+md5(_0x19d228[_0x053d('0x81')]);}else{_0x19d228[_0x053d('0x8f')]='';}var _0x4fcb8c=_0x1f6017[_0x053d('0x7b')]==='zoho.eu'?'eu':_0x053d('0x84');return getAccessToken(_0x1f6017)['then'](function(_0x3854ff){_0x53774f=_0x3854ff;return getUser(_0x53774f,_0x4fcb8c,_0x1f6017);})['then'](function(_0x321249){_0x5cddb2=_0x321249;logger[_0x053d('0x34')](_0x053d('0x86'),_0x5cddb2['id']);return getEndUser(_0x53774f,_0x4fcb8c,_0x1f6017,_0x19d228[_0x053d('0x87')],_0x19d228[_0x053d('0x88')],_0x5cddb2,_0x1927d1);})[_0x053d('0x26')](function(_0x5aa7c4){_0x1d834d=_0x5aa7c4;return getCall(_0x53774f,_0x4fcb8c,_0x1f6017,_0x5cddb2,_0x1d834d,_0x1927d1,_0x19d228,'Inbound');})[_0x053d('0x26')](function(_0x2aafd4){if(_0x2aafd4){logger[_0x053d('0x34')](_0x053d('0x89'),_0x2aafd4['id']);}})[_0x053d('0x4a')](function(_0x4754fb){logger['error']('['+_0x19d228[_0x053d('0x68')][_0x053d('0x94')]()+']',JSON[_0x053d('0xc')](_0x4754fb));});}; \ No newline at end of file +var _0xc3f6=['Description','Descriptions','enduserType','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','complete','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','details','err','stack','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','host','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','unmanaged','toUpperCase','lodash','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','emit','debug','[HTTP]','stringify','length','forEach','includes','picklist','idField','content','variable','variableName','toString','type','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','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','then','seconds','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','profile','user','data','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','log','uri','Contacts','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','getString'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xc3f6,0xdf));var _0x6c3f=function(_0x2514fb,_0x1bba45){_0x2514fb=_0x2514fb-0x0;var _0x1e14ab=_0xc3f6[_0x2514fb];return _0x1e14ab;};'use strict';var _=require(_0x6c3f('0x0'));var rp=require('request-promise');var md5=require(_0x6c3f('0x1'));var util=require(_0x6c3f('0x2'));var intUtil=require(_0x6c3f('0x3'));var moment=require(_0x6c3f('0x4'));var Redis=require(_0x6c3f('0x5'));var BPromise=require(_0x6c3f('0x6'));var config=require(_0x6c3f('0x7'));var logger=require('../../../../config/logger')(_0x6c3f('0x8'));config[_0x6c3f('0x9')]=_[_0x6c3f('0xa')](config[_0x6c3f('0x9')],{'host':_0x6c3f('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6c3f('0x9')]));function emit(_0x37c222,_0xde54b8,_0x21e57f){io['to'](_0x37c222)[_0x6c3f('0xc')](_0xde54b8,_0x21e57f);}function request(_0x501226){logger[_0x6c3f('0xd')](_0x6c3f('0xe'),JSON[_0x6c3f('0xf')](_0x501226));return rp(_0x501226);}function getCustomFields(_0x296591,_0x1a174a){var _0x4cb297={};if(_0x296591[_0x6c3f('0x10')]>0x0){_[_0x6c3f('0x11')](_0x296591,function(_0x4e4d7d){if(_[_0x6c3f('0x12')](['string',_0x6c3f('0x13')],_0x4e4d7d['type'])&&_0x4e4d7d[_0x6c3f('0x14')]){_0x4cb297[_0x4e4d7d['idField']]=_0x4e4d7d[_0x6c3f('0x15')]['toString']();}else if(_0x4e4d7d['type']===_0x6c3f('0x16')&&_0x4e4d7d[_0x6c3f('0x17')]&&_0x4e4d7d[_0x6c3f('0x14')]&&_0x1a174a[_0x4e4d7d[_0x6c3f('0x17')]]){_0x4cb297[_0x4e4d7d[_0x6c3f('0x14')]]=_0x1a174a[_0x4e4d7d[_0x6c3f('0x17')]][_0x6c3f('0x18')]();}else if(_0x4e4d7d[_0x6c3f('0x19')]===_0x6c3f('0x1a')&&_0x4e4d7d[_0x6c3f('0x1b')]&&_0x4e4d7d['Variable'][_0x6c3f('0x1c')]&&_0x4e4d7d[_0x6c3f('0x14')]&&_0x1a174a[_0x4e4d7d[_0x6c3f('0x1b')][_0x6c3f('0x1c')][_0x6c3f('0x1d')]()]){_0x4cb297[_0x4e4d7d[_0x6c3f('0x14')]]=_0x1a174a[_0x4e4d7d[_0x6c3f('0x1b')][_0x6c3f('0x1c')]['toLowerCase']()][_0x6c3f('0x18')]();}});}return _0x4cb297;}function getName(_0x72a43a){if(_0x72a43a[_0x6c3f('0x1e')]('\x20')>0x0){var _0xaa2d07=_0x72a43a[_0x6c3f('0x1f')](/ (.+)/);if(_0xaa2d07[0x1]){return _0xaa2d07;}}return[_0x72a43a,_0x72a43a];}var accountsTokens={};function getAccessToken(_0x568ae8){return new Promise(function(_0x185963,_0x38f45d){if(!_[_0x6c3f('0x20')](accountsTokens[_0x568ae8['id']])&&!_['isNil'](accountsTokens[_0x568ae8['id']][_0x6c3f('0x21')])){if(moment()[_0x6c3f('0x22')](accountsTokens[_0x568ae8['id']][_0x6c3f('0x23')])){_0x185963(accountsTokens[_0x568ae8['id']][_0x6c3f('0x21')]);}}var _0x2118f9;switch(_0x568ae8['zone']){case'US':_0x2118f9=_0x6c3f('0x24');break;case'AU':_0x2118f9=_0x6c3f('0x25');break;case'EU':_0x2118f9=_0x6c3f('0x26');break;case'IN':_0x2118f9=_0x6c3f('0x27');break;case'CN':_0x2118f9=_0x6c3f('0x28');break;default:_0x2118f9='https://accounts.zoho.eu';break;}var _0x40be64={'method':_0x6c3f('0x29'),'uri':_0x2118f9+_0x6c3f('0x2a'),'qs':{'refresh_token':_0x568ae8[_0x6c3f('0x2b')],'client_id':_0x568ae8[_0x6c3f('0x2c')],'client_secret':_0x568ae8[_0x6c3f('0x2d')],'grant_type':_0x6c3f('0x2e')},'json':!![]};return rp(_0x40be64)[_0x6c3f('0x2f')](function(_0x446466){accountsTokens[_0x568ae8['id']]={'access_token':_0x446466['access_token'],'expires_in':moment()['add'](_0x446466['expires_in'],_0x6c3f('0x30'))};_0x185963(_0x446466[_0x6c3f('0x21')]);})[_0x6c3f('0x31')](function(_0x529b61){logger[_0x6c3f('0x32')](_0x6c3f('0x33'),_0x529b61['stack']);_0x38f45d(_0x529b61);});});}function getUser(_0x30486e,_0x5c13b2,_0x50bac1,_0x21fd5b){logger[_0x6c3f('0x34')](_0x6c3f('0x35'));return request({'method':_0x6c3f('0x36'),'uri':util[_0x6c3f('0x37')](_0x6c3f('0x38'),_0x5c13b2),'qs':{'type':_0x6c3f('0x39')},'headers':{'Authorization':_0x6c3f('0x3a')+_0x30486e},'json':!![]})[_0x6c3f('0x2f')](function(_0x53ad0e){if(_0x53ad0e['users']){var _0x426b8f=-0x1;if(_[_0x6c3f('0x3b')](_0x53ad0e[_0x6c3f('0x3c')])){if(!_[_0x6c3f('0x20')](_0x21fd5b)){_0x426b8f=_[_0x6c3f('0x3d')](_0x53ad0e[_0x6c3f('0x3c')],function(_0x37957e){return _0x37957e['email']===_0x21fd5b;});}if(_0x426b8f>=0x0){logger['info'](_0x6c3f('0x3e'));}else{logger['info'](_0x6c3f('0x3f'));_0x426b8f=_[_0x6c3f('0x3d')](_0x53ad0e[_0x6c3f('0x3c')],function(_0xe188c1){return _0xe188c1['profile'][_0x6c3f('0x1c')]===_0x6c3f('0x40');});}return _0x53ad0e[_0x6c3f('0x3c')][_0x426b8f];}else{if(_0x53ad0e['user'][_0x6c3f('0x41')][_0x6c3f('0x1c')]==='Administrator'){logger[_0x6c3f('0x34')]('Using\x20the\x20admin\x20account!');user=_0x53ad0e[_0x6c3f('0x42')];return user;}else{logger[_0x6c3f('0x32')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x53ad0e));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x6c3f('0xf')](_0x53ad0e));}}}else{logger[_0x6c3f('0x32')]('The\x20failing\x20result\x20is',JSON[_0x6c3f('0xf')](_0x53ad0e));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x6c3f('0xf')](_0x53ad0e));}})[_0x6c3f('0x31')](function(_0x612052){console[_0x6c3f('0x32')](_0x612052);});}function getZohoUser(_0x1871e1,_0x2013da){return new BPromise(function(_0x7fb3d7,_0x18c861){request(_0x1871e1)['then'](function(_0x191c99){var _0x54ce5c=null;if(_0x191c99){_0x54ce5c=_0x191c99[_0x6c3f('0x43')][0x0];_0x54ce5c['enduserType']=_0x2013da;}_0x7fb3d7(_0x54ce5c);})[_0x6c3f('0x31')](function(_0x584c28){_0x18c861(_0x584c28);});});}function createEndUser(_0xbbecbd,_0x4c4fbf,_0x2eff2b,_0x39d182,_0xb23e9d,_0x156e86){var _0x2eff2b=getName(_0x2eff2b);return request({'method':_0x6c3f('0x29'),'uri':_0x6c3f('0x44')+_0x4c4fbf+'/crm/v2/'+_[_0x6c3f('0x45')](_0x156e86[_0x6c3f('0x46')])+'s','body':{'data':[{'Last_Name':_0x2eff2b[0x1],'First_Name':_0x2eff2b[0x0],'Phone':_0x39d182,'Owner':{'name':!_['isNil'](_0xb23e9d[_0x6c3f('0x47')][_0x6c3f('0x1c')])?_0xb23e9d[_0x6c3f('0x47')]['name']:!_[_0x6c3f('0x20')](_0xb23e9d[_0x6c3f('0x48')])?_0xb23e9d['first_name']+'\x20'+_0xb23e9d[_0x6c3f('0x49')]:_0xb23e9d[_0x6c3f('0x49')],'id':_0xb23e9d['id']}}]},'headers':{'Authorization':_0x6c3f('0x3a')+_0xbbecbd},'json':!![]})[_0x6c3f('0x2f')](function(_0x201dab){if(_0x201dab&&_0x201dab[_0x6c3f('0x43')][0x0]['code']==='SUCCESS'){var _0x2540fa=_0x201dab['data'][0x0]['details'];_0x2540fa['enduserType']=_[_0x6c3f('0x45')](_0x156e86[_0x6c3f('0x46')])+'s';return _0x2540fa;}logger[_0x6c3f('0x32')]('The\x20failing\x20result\x20is',JSON[_0x6c3f('0xf')](data));throw new Error('Error:\x20'+JSON[_0x6c3f('0xf')](data));})['catch'](function(_0x1bc9e6){console[_0x6c3f('0x4a')]('CREATE\x20ERROR',_0x1bc9e6);});}function getEndUser(_0x30793e,_0xc68db1,_0x245db2,_0x3ece55,_0xa4a0a8,_0x1f1af2,_0x5315d6){var _0x591f03={'method':'GET','uri':'','headers':{'Authorization':_0x6c3f('0x3a')+_0x30793e},'json':!![]};switch(_0x5315d6['moduleSearch']){case'contact_lead':_0x591f03[_0x6c3f('0x4b')]=_0x6c3f('0x44')+_0xc68db1+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xa4a0a8+'))';return getZohoUser(_0x591f03,_0x6c3f('0x4c'))[_0x6c3f('0x2f')](function(_0x55cbad){if(_0x55cbad)return _0x55cbad;_0x591f03[_0x6c3f('0x4b')]=_0x6c3f('0x44')+_0xc68db1+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0xa4a0a8+'))';return getZohoUser(_0x591f03,_0x6c3f('0x4d'))[_0x6c3f('0x2f')](function(_0x692eb8){if(_0x692eb8)return _0x692eb8;if(_0x5315d6['moduleCreate']!=_0x6c3f('0x4e')){return createEndUser(_0x30793e,_0xc68db1,_0x3ece55,_0xa4a0a8,_0x1f1af2,_0x5315d6);}else{return{};}});});break;case _0x6c3f('0x4f'):_0x591f03[_0x6c3f('0x4b')]='https://www.zohoapis.'+_0xc68db1+_0x6c3f('0x50')+_0xa4a0a8+'))';return getZohoUser(_0x591f03,_0x6c3f('0x4c'))['then'](function(_0x274f88){if(_0x274f88)return _0x274f88;if(_0x5315d6['moduleCreate']!='nothing'){return createEndUser(_0x30793e,_0xc68db1,_0x3ece55,_0xa4a0a8,_0x1f1af2,_0x5315d6);}else{return{};}});break;case'lead':_0x591f03[_0x6c3f('0x4b')]='https://www.zohoapis.'+_0xc68db1+_0x6c3f('0x51')+_0xa4a0a8+'))';return getZohoUser(_0x591f03,'Leads')[_0x6c3f('0x2f')](function(_0x565f48){if(_0x565f48)return _0x565f48;if(_0x5315d6['moduleCreate']!=_0x6c3f('0x4e')){return createEndUser(_0x30793e,_0xc68db1,_0x3ece55,_0xa4a0a8,_0x1f1af2,_0x5315d6);}else{return{};}});break;}}function getCall(_0x266354,_0x184442,_0x17ec6c,_0x47952c,_0x322483,_0x41720c,_0x53b5a1,_0x3bdc84){logger[_0x6c3f('0x34')](_0x6c3f('0x52'));var _0x413880={};_0x413880[_0x6c3f('0x53')]={'name':!_['isNil'](_0x47952c[_0x6c3f('0x47')][_0x6c3f('0x1c')])&&!_[_0x6c3f('0x20')](_0x47952c[_0x6c3f('0x41')][_0x6c3f('0x1c')])&&_0x47952c[_0x6c3f('0x41')][_0x6c3f('0x1c')]===_0x6c3f('0x54')?_0x47952c[_0x6c3f('0x47')][_0x6c3f('0x1c')]:!_['isNil'](_0x47952c[_0x6c3f('0x48')])?_0x47952c[_0x6c3f('0x48')]+'\x20'+_0x47952c[_0x6c3f('0x49')]:_0x47952c[_0x6c3f('0x49')],'id':_0x47952c['id']};_0x413880[_0x6c3f('0x55')]=intUtil[_0x6c3f('0x56')](_0x41720c['Subjects'],_0x53b5a1,'\x20');_0x413880[_0x6c3f('0x57')]=intUtil[_0x6c3f('0x56')](_0x41720c[_0x6c3f('0x58')],_0x53b5a1,'\x0a');if(_0x322483[_0x6c3f('0x59')]===_0x6c3f('0x4c')){_0x413880[_0x6c3f('0x5a')]={'name':!_[_0x6c3f('0x20')](_0x322483[_0x6c3f('0x5b')])?_0x322483['Full_Name']:!_['isNil'](_0x322483[_0x6c3f('0x5c')])?_0x322483['First_Name']+'\x20'+_0x322483['Last_Name']:_0x322483[_0x6c3f('0x5d')],'id':_0x322483['id']};}if(_0x322483[_0x6c3f('0x59')]===_0x6c3f('0x4d')){_0x413880[_0x6c3f('0x5e')]={'name':!_[_0x6c3f('0x20')](_0x322483[_0x6c3f('0x5b')])?_0x322483[_0x6c3f('0x5b')]:!_['isNil'](_0x322483[_0x6c3f('0x5c')])?_0x322483[_0x6c3f('0x5c')]+'\x20'+_0x322483[_0x6c3f('0x5d')]:_0x322483[_0x6c3f('0x5d')],'id':_0x322483['id']};_0x413880[_0x6c3f('0x5f')]=_[_0x6c3f('0x45')](_0x322483[_0x6c3f('0x59')]);}if(_0x53b5a1[_0x6c3f('0x60')]){_0x413880[_0x6c3f('0x61')]=moment[_0x6c3f('0x62')](parseInt(_0x53b5a1[_0x6c3f('0x60')])*0x3e8)['format']('mm:ss');}else if(_0x53b5a1[_0x6c3f('0x63')]&&_0x53b5a1[_0x6c3f('0x64')]){_0x413880['Call_Duration']=moment[_0x6c3f('0x62')](moment(_0x53b5a1[_0x6c3f('0x64')],_0x6c3f('0x65'))[_0x6c3f('0x66')](moment(_0x53b5a1[_0x6c3f('0x67')],_0x6c3f('0x65'))))[_0x6c3f('0x37')](_0x6c3f('0x68'));}switch(_0x53b5a1[_0x6c3f('0x69')]){case _0x6c3f('0x6a'):_0x413880[_0x6c3f('0x6b')]='Called';break;case _0x6c3f('0x6c'):case'connect':_0x413880[_0x6c3f('0x6b')]=_0x6c3f('0x6d');break;case _0x6c3f('0x6e'):_0x413880['Call_Result']=_0x6c3f('0x6f');break;case _0x6c3f('0x70'):_0x413880['Call_Result']=_0x6c3f('0x71');break;case _0x6c3f('0x72'):_0x413880[_0x6c3f('0x6b')]=_0x6c3f('0x73');default:}_0x413880['Call_Start_Time']=(_0x3bdc84===_0x6c3f('0x74')?moment(_0x53b5a1[_0x6c3f('0x67')])['format'](_0x6c3f('0x65')):moment(_0x53b5a1[_0x6c3f('0x75')])['format'](_0x6c3f('0x65')))||moment()[_0x6c3f('0x37')](_0x6c3f('0x65'));_0x413880['Call_Type']=_0x3bdc84||_0x6c3f('0x76');_0x413880=_[_0x6c3f('0x77')](_0x413880,getCustomFields(_0x41720c[_0x6c3f('0x78')],_0x53b5a1));return request({'method':_0x6c3f('0x29'),'uri':_0x6c3f('0x44')+_0x184442+_0x6c3f('0x79'),'headers':{'Authorization':_0x6c3f('0x3a')+_0x266354},'body':{'data':[_0x413880]},'json':!![]})['then'](function(_0x4f6a2e){if(_0x4f6a2e&&_0x4f6a2e[_0x6c3f('0x43')][0x0]['code']==='SUCCESS'){logger[_0x6c3f('0x34')]('Call\x20created!');return{'id':_0x4f6a2e['data'][0x0][_0x6c3f('0x7a')]['id']};}})['catch'](function(_0x5b27f4){logger[_0x6c3f('0x34')](_0x6c3f('0x7b'),_0x5b27f4[_0x6c3f('0x7c')]);console[_0x6c3f('0x4a')](_0x6c3f('0x7b'),_0x5b27f4);});}exports[_0x6c3f('0x7d')]=function(_0x8ee48e,_0x3f3f65,_0x1917c3,_0x46e23d,_0x329eaa,_0x31e9dc){var _0x4c40ed,_0x5def4e,_0x2d24a1;_0x31e9dc['host']=intUtil[_0x6c3f('0x7e')](_0x31e9dc['host']);_0x31e9dc[_0x6c3f('0x7f')]=intUtil[_0x6c3f('0x7e')](_0x31e9dc[_0x6c3f('0x7f')]);if(_0x329eaa&&_0x329eaa[_0x6c3f('0x80')]){logger['info'](_0x6c3f('0x81'),_0x6c3f('0x82'));_0x3f3f65[_0x6c3f('0x83')]=_0x31e9dc[_0x6c3f('0x7f')]+'/api/voice/recordings/'+_0x3f3f65[_0x6c3f('0x84')]+_0x6c3f('0x85')+md5(_0x3f3f65[_0x6c3f('0x84')]);}else{_0x3f3f65[_0x6c3f('0x83')]='';}var _0x1c7592=_0x31e9dc['host']===_0x6c3f('0x86')?'eu':_0x6c3f('0x87');return getAccessToken(_0x31e9dc)[_0x6c3f('0x2f')](function(_0x29b226){_0x2d24a1=_0x29b226;return getUser(_0x2d24a1,_0x1c7592,_0x31e9dc,_0x46e23d[_0x6c3f('0x88')]);})['then'](function(_0x2fd71c){_0x4c40ed=_0x2fd71c;logger[_0x6c3f('0x34')]('The\x20User\x20ID\x20is:',_0x4c40ed['id']);return getEndUser(_0x2d24a1,_0x1c7592,_0x31e9dc,_0x3f3f65[_0x6c3f('0x89')],_0x3f3f65[_0x6c3f('0x8a')],_0x4c40ed,_0x1917c3);})['then'](function(_0x1cef69){_0x5def4e=_0x1cef69;return getCall(_0x2d24a1,_0x1c7592,_0x31e9dc,_0x4c40ed,_0x5def4e,_0x1917c3,_0x3f3f65,_0x6c3f('0x76'));})[_0x6c3f('0x2f')](function(_0x36b2b6){if(_0x36b2b6){logger[_0x6c3f('0x34')](_0x6c3f('0x8b'),_0x36b2b6['id']);logger[_0x6c3f('0x34')](_0x6c3f('0x81'),_0x6c3f('0x8c'));emit(util[_0x6c3f('0x37')](_0x6c3f('0x8d'),_0x46e23d[_0x6c3f('0x1c')]),_0x6c3f('0x8e'),{'uri':_0x6c3f('0x8f')+_0x31e9dc[_0x6c3f('0x90')]+_0x6c3f('0x91')+_0x36b2b6['id']});}})[_0x6c3f('0x31')](function(_0x106f6a){logger[_0x6c3f('0x32')]('[QUEUE]',JSON['stringify'](_0x106f6a));});};exports[_0x6c3f('0x74')]=function(_0x4e4c42,_0x333778,_0x5e8ddd,_0x176ba7,_0x181f4a,_0x39b9f3,_0x4f72ba){var _0x4f50ad,_0x5a0e53,_0x58bfae;_0x39b9f3['host']=intUtil[_0x6c3f('0x7e')](_0x39b9f3[_0x6c3f('0x90')]);_0x39b9f3[_0x6c3f('0x7f')]=intUtil[_0x6c3f('0x7e')](_0x39b9f3[_0x6c3f('0x7f')]);if(_0x4f72ba&&_0x4f72ba['recordingFormat']&&_0x4f72ba[_0x6c3f('0x92')]!==_0x6c3f('0x93')){logger[_0x6c3f('0x34')](_0x6c3f('0x94'),_0x6c3f('0x82'));_0x333778[_0x6c3f('0x83')]=_0x39b9f3[_0x6c3f('0x7f')]+_0x6c3f('0x95')+_0x333778['uniqueid']+_0x6c3f('0x85')+md5(_0x333778[_0x6c3f('0x84')]);}var _0x3ebd24=_0x39b9f3[_0x6c3f('0x90')]===_0x6c3f('0x86')?'eu':_0x6c3f('0x87');return getAccessToken(_0x39b9f3)['then'](function(_0x42f361){_0x58bfae=_0x42f361;return getUser(_0x58bfae,_0x3ebd24,_0x39b9f3,_0x176ba7['email']);})[_0x6c3f('0x2f')](function(_0x445864){_0x4f50ad=_0x445864;logger[_0x6c3f('0x34')](_0x6c3f('0x96'),_0x4f50ad['id']);return getEndUser(_0x58bfae,_0x3ebd24,_0x39b9f3,_0x333778['destcalleridname'],_0x333778[_0x6c3f('0x97')],_0x4f50ad,_0x5e8ddd);})[_0x6c3f('0x2f')](function(_0x31dc77){_0x5a0e53=_0x31dc77;return getCall(_0x58bfae,_0x3ebd24,_0x39b9f3,_0x4f50ad,_0x5a0e53,_0x5e8ddd,_0x333778,_0x6c3f('0x98'));})[_0x6c3f('0x2f')](function(_0x195361){if(_0x195361){logger[_0x6c3f('0x34')](_0x6c3f('0x8b'),_0x195361['id']);logger[_0x6c3f('0x34')](_0x6c3f('0x94'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x6c3f('0x37')](_0x6c3f('0x8d'),_0x176ba7[_0x6c3f('0x1c')]),_0x6c3f('0x8e'),{'uri':'https://crm.'+_0x39b9f3[_0x6c3f('0x90')]+'/crm/EntityInfo.do?module=Calls&id='+_0x195361['id']});}})[_0x6c3f('0x31')](function(_0x537b7c){logger[_0x6c3f('0x32')](_0x6c3f('0x94'),JSON[_0x6c3f('0xf')](_0x537b7c));});};exports[_0x6c3f('0x99')]=function(_0x4651c2,_0x1806b4,_0x4862c5,_0x35e7a2,_0x585b41,_0x210f97){var _0x1d37cb,_0x491804,_0x4d4574;_0x210f97[_0x6c3f('0x90')]=intUtil['stripTrailingSlash'](_0x210f97[_0x6c3f('0x90')]);_0x210f97[_0x6c3f('0x7f')]=intUtil[_0x6c3f('0x7e')](_0x210f97[_0x6c3f('0x7f')]);if(_0x585b41&&_0x585b41[_0x6c3f('0x80')]){logger[_0x6c3f('0x34')]('['+_0x1806b4['lastevent'][_0x6c3f('0x9a')]()+']','Recording\x20is\x20enabled!');_0x1806b4[_0x6c3f('0x83')]=_0x210f97[_0x6c3f('0x7f')]+_0x6c3f('0x95')+_0x1806b4[_0x6c3f('0x84')]+_0x6c3f('0x85')+md5(_0x1806b4[_0x6c3f('0x84')]);}else{_0x1806b4[_0x6c3f('0x83')]='';}var _0x48b8d6=_0x210f97[_0x6c3f('0x90')]===_0x6c3f('0x86')?'eu':'com';return getAccessToken(_0x210f97)[_0x6c3f('0x2f')](function(_0x55cee6){_0x4d4574=_0x55cee6;return getUser(_0x4d4574,_0x48b8d6,_0x210f97);})[_0x6c3f('0x2f')](function(_0x243147){_0x1d37cb=_0x243147;logger[_0x6c3f('0x34')](_0x6c3f('0x96'),_0x1d37cb['id']);return getEndUser(_0x4d4574,_0x48b8d6,_0x210f97,_0x1806b4[_0x6c3f('0x89')],_0x1806b4['calleridnum'],_0x1d37cb,_0x4862c5);})[_0x6c3f('0x2f')](function(_0x2700a0){_0x491804=_0x2700a0;return getCall(_0x4d4574,_0x48b8d6,_0x210f97,_0x1d37cb,_0x491804,_0x4862c5,_0x1806b4,_0x6c3f('0x76'));})[_0x6c3f('0x2f')](function(_0x2bf3a2){if(_0x2bf3a2){logger[_0x6c3f('0x34')]('The\x20Call\x20ID\x20is:',_0x2bf3a2['id']);}})[_0x6c3f('0x31')](function(_0x2587ce){logger[_0x6c3f('0x32')]('['+_0x1806b4[_0x6c3f('0x69')][_0x6c3f('0x9a')]()+']',JSON[_0x6c3f('0xf')](_0x2587ce));});}; \ 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 646ece2..c8e6dd5 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 _0xe581=['format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','../../../../config/logger','trigger','exec','data2','Script','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x1958ea,_0x365704){var _0x2e707f=function(_0x57ab41){while(--_0x57ab41){_0x1958ea['push'](_0x1958ea['shift']());}};_0x2e707f(++_0x365704);}(_0xe581,0xc5));var _0x1e58=function(_0x4709dc,_0x7cf466){_0x4709dc=_0x4709dc-0x0;var _0x1cedc3=_0xe581[_0x4709dc];return _0x1cedc3;};'use strict';var util=require('util');var sh=require(_0x1e58('0x0'));var Mustache=require('mustache');var logger=require(_0x1e58('0x1'))(_0x1e58('0x2'));exports[_0x1e58('0x3')]=function(_0x1b48e6,_0x24ff1f){var _0x298624=_0x1b48e6[_0x1e58('0x4')]?_0x1b48e6['data2']:_0x1e58('0x5');var _0x4e9d7f=_0x1b48e6[_0x1e58('0x6')]?Mustache[_0x1e58('0x7')](_0x1b48e6[_0x1e58('0x6')],_0x24ff1f):_0x24ff1f;sh[_0x1e58('0x3')](_0x4e9d7f,function(_0x1d62b0,_0x4f0bc4,_0x225efa){if(_0x1d62b0!==0x0){logger[_0x1e58('0x8')](util['format'](_0x1e58('0x9'),_0x298624,_0x4e9d7f,_0x1d62b0,_0x225efa));}else{logger[_0x1e58('0xa')](util[_0x1e58('0xb')](_0x1e58('0xc'),_0x298624,_0x4e9d7f,_0x4f0bc4));}});}; \ No newline at end of file +var _0x82b3=['trigger','exec','data2','Script','data3','render','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','mustache','../../../../config/logger'];(function(_0xbb95e,_0x308372){var _0x2b933d=function(_0x8dfdc9){while(--_0x8dfdc9){_0xbb95e['push'](_0xbb95e['shift']());}};_0x2b933d(++_0x308372);}(_0x82b3,0xf3));var _0x382b=function(_0x44a90a,_0x574c1e){_0x44a90a=_0x44a90a-0x0;var _0x34739d=_0x82b3[_0x44a90a];return _0x34739d;};'use strict';var util=require(_0x382b('0x0'));var sh=require(_0x382b('0x1'));var Mustache=require(_0x382b('0x2'));var logger=require(_0x382b('0x3'))(_0x382b('0x4'));exports[_0x382b('0x5')]=function(_0x1c18ec,_0x318d76){var _0x3b4fc7=_0x1c18ec[_0x382b('0x6')]?_0x1c18ec[_0x382b('0x6')]:_0x382b('0x7');var _0x3d3c0d=_0x1c18ec[_0x382b('0x8')]?Mustache[_0x382b('0x9')](_0x1c18ec[_0x382b('0x8')],_0x318d76):_0x318d76;sh[_0x382b('0x5')](_0x3d3c0d,function(_0x49199a,_0x151b56,_0x5ebf4c){if(_0x49199a!==0x0){logger['error'](util[_0x382b('0xa')](_0x382b('0xb'),_0x3b4fc7,_0x3d3c0d,_0x49199a,_0x5ebf4c));}else{logger[_0x382b('0xc')](util[_0x382b('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x3b4fc7,_0x3d3c0d,_0x151b56));}});}; \ 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 38985ad..6a70e48 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 _0x5fc6=['number','data5','headers','data6','parse','error','stack','GET','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data2','statusCode','catch','name','message','util','lodash','../../../../config/logger','exec','data1','toUpperCase','render'];(function(_0x19cceb,_0x11de4d){var _0x190121=function(_0x55593d){while(--_0x55593d){_0x19cceb['push'](_0x19cceb['shift']());}};_0x190121(++_0x11de4d);}(_0x5fc6,0x12f));var _0x65fc=function(_0x893fb5,_0x3072a2){_0x893fb5=_0x893fb5-0x0;var _0x12f70e=_0x5fc6[_0x893fb5];return _0x12f70e;};'use strict';var rp=require('request-promise');var util=require(_0x65fc('0x0'));var _=require(_0x65fc('0x1'));var Mustache=require('mustache');var logger=require(_0x65fc('0x2'))('trigger');exports[_0x65fc('0x3')]=function(_0x39486b,_0x5c20bc){var _0x26bf18,_0x4f5abf;var _0x38896e={'method':_0x39486b[_0x65fc('0x4')][_0x65fc('0x5')](),'uri':Mustache[_0x65fc('0x6')](_0x39486b['data2'],_0x5c20bc),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x39486b['data5'])===_0x65fc('0x7')&&parseInt(_0x39486b['data5'])>=0x1&&parseInt(_0x39486b[_0x65fc('0x8')])<=0xa?parseInt(_0x39486b['data5'])*0x3e8:0x5*0x3e8};try{_0x38896e[_0x65fc('0x9')]=_0x39486b[_0x65fc('0xa')]?JSON[_0x65fc('0xb')](Mustache[_0x65fc('0x6')](_0x39486b[_0x65fc('0xa')],_0x5c20bc)):{};}catch(_0x429730){logger[_0x65fc('0xc')](_0x429730[_0x65fc('0xd')]);}switch(_0x39486b[_0x65fc('0x4')][_0x65fc('0x5')]()){case _0x65fc('0xe'):case'DELETE':_0x26bf18=null;_0x38896e['qs']=_0x5c20bc;break;case _0x65fc('0xf'):case _0x65fc('0x10'):if(_0x39486b['data7']){try{_0x26bf18=JSON[_0x65fc('0xb')](Mustache[_0x65fc('0x6')](_0x39486b[_0x65fc('0x11')],_0x5c20bc));_0x38896e[_0x65fc('0x12')]=_0x26bf18;}catch(_0x2866e8){logger['error'](_0x2866e8[_0x65fc('0xd')]);logger['error'](_0x65fc('0x13'));}}else{_0x26bf18=_0x5c20bc;_0x38896e[_0x65fc('0x12')]=_0x26bf18;}break;}logger[_0x65fc('0x14')](util[_0x65fc('0x15')](_0x65fc('0x16'),_0x39486b['data1'],_0x39486b['data2'],JSON[_0x65fc('0x17')](_0x38896e)));rp(_0x38896e)['then'](function(_0x439727){_0x26bf18=!_[_0x65fc('0x18')](_0x26bf18)?',\x20request\x20body:\x20'+_0x26bf18:'';_0x4f5abf=typeof _0x439727[_0x65fc('0x12')]==='object'?JSON['stringify'](_0x439727[_0x65fc('0x12')]):_0x439727[_0x65fc('0x12')];logger['info'](util['format'](_0x65fc('0x19'),_0x39486b[_0x65fc('0x4')],_0x39486b[_0x65fc('0x1a')],_0x439727[_0x65fc('0x1b')],_0x4f5abf));})[_0x65fc('0x1c')](function(_0x44e631){logger['error'](util[_0x65fc('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x39486b[_0x65fc('0x4')],_0x39486b['data2'],_0x44e631[_0x65fc('0x1b')],_0x44e631[_0x65fc('0x1d')],_0x44e631[_0x65fc('0x1e')]));});}; \ No newline at end of file +var _0x7294=['data2','data5','number','headers','data6','error','stack','toUpperCase','GET','DELETE','POST','data7','parse','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil',',\x20request\x20body:\x20','object','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','render'];(function(_0x5483bb,_0x29a2ed){var _0x15b72c=function(_0x33f91e){while(--_0x33f91e){_0x5483bb['push'](_0x5483bb['shift']());}};_0x15b72c(++_0x29a2ed);}(_0x7294,0x83));var _0x4729=function(_0x4f1771,_0x82710c){_0x4f1771=_0x4f1771-0x0;var _0x1d5f87=_0x7294[_0x4f1771];return _0x1d5f87;};'use strict';var rp=require(_0x4729('0x0'));var util=require(_0x4729('0x1'));var _=require(_0x4729('0x2'));var Mustache=require(_0x4729('0x3'));var logger=require(_0x4729('0x4'))(_0x4729('0x5'));exports[_0x4729('0x6')]=function(_0x3538a7,_0x4aeea0){var _0x5672aa,_0x2fe4c9;var _0x5d63f2={'method':_0x3538a7[_0x4729('0x7')]['toUpperCase'](),'uri':Mustache[_0x4729('0x8')](_0x3538a7[_0x4729('0x9')],_0x4aeea0),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3538a7[_0x4729('0xa')])===_0x4729('0xb')&&parseInt(_0x3538a7[_0x4729('0xa')])>=0x1&&parseInt(_0x3538a7[_0x4729('0xa')])<=0xa?parseInt(_0x3538a7['data5'])*0x3e8:0x5*0x3e8};try{_0x5d63f2[_0x4729('0xc')]=_0x3538a7[_0x4729('0xd')]?JSON['parse'](Mustache[_0x4729('0x8')](_0x3538a7['data6'],_0x4aeea0)):{};}catch(_0x9fd799){logger[_0x4729('0xe')](_0x9fd799[_0x4729('0xf')]);}switch(_0x3538a7['data1'][_0x4729('0x10')]()){case _0x4729('0x11'):case _0x4729('0x12'):_0x5672aa=null;_0x5d63f2['qs']=_0x4aeea0;break;case _0x4729('0x13'):case'PUT':if(_0x3538a7[_0x4729('0x14')]){try{_0x5672aa=JSON[_0x4729('0x15')](Mustache[_0x4729('0x8')](_0x3538a7[_0x4729('0x14')],_0x4aeea0));_0x5d63f2['body']=_0x5672aa;}catch(_0x2757b0){logger['error'](_0x2757b0[_0x4729('0xf')]);logger[_0x4729('0xe')](_0x4729('0x16'));}}else{_0x5672aa=_0x4aeea0;_0x5d63f2[_0x4729('0x17')]=_0x5672aa;}break;}logger[_0x4729('0x18')](util['format'](_0x4729('0x19'),_0x3538a7[_0x4729('0x7')],_0x3538a7[_0x4729('0x9')],JSON[_0x4729('0x1a')](_0x5d63f2)));rp(_0x5d63f2)['then'](function(_0x139b64){_0x5672aa=!_[_0x4729('0x1b')](_0x5672aa)?_0x4729('0x1c')+_0x5672aa:'';_0x2fe4c9=typeof _0x139b64[_0x4729('0x17')]===_0x4729('0x1d')?JSON[_0x4729('0x1a')](_0x139b64[_0x4729('0x17')]):_0x139b64[_0x4729('0x17')];logger['info'](util[_0x4729('0x1e')](_0x4729('0x1f'),_0x3538a7[_0x4729('0x7')],_0x3538a7['data2'],_0x139b64[_0x4729('0x20')],_0x2fe4c9));})['catch'](function(_0x3ff1b5){logger[_0x4729('0xe')](util[_0x4729('0x1e')](_0x4729('0x21'),_0x3538a7[_0x4729('0x7')],_0x3538a7[_0x4729('0x9')],_0x3ff1b5[_0x4729('0x20')],_0x3ff1b5[_0x4729('0x22')],_0x3ff1b5['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 0468622..4379b51 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 _0x44a0=['then','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request','request'];(function(_0x90d6e5,_0x475f34){var _0x41112e=function(_0x325b8b){while(--_0x325b8b){_0x90d6e5['push'](_0x90d6e5['shift']());}};_0x41112e(++_0x475f34);}(_0x44a0,0x149));var _0x044a=function(_0x14ce25,_0x317b59){_0x14ce25=_0x14ce25-0x0;var _0x5971f3=_0x44a0[_0x14ce25];return _0x5971f3;};'use strict';var jayson=require(_0x044a('0x0'));var BPromise=require(_0x044a('0x1'));var logger=require(_0x044a('0x2'))(_0x044a('0x3'));var client=jayson[_0x044a('0x4')]['http']({'port':0x2329});client[_0x044a('0x5')]=function(_0x5e395a,_0xc7856c){return new BPromise(function(_0x54bc33,_0x2f384b){return client[_0x044a('0x6')](_0x5e395a,_0xc7856c)[_0x044a('0x7')](function(_0x3453c0){logger['debug'](_0x044a('0x8'),_0x044a('0x3'),_0x5e395a,_0xc7856c,_0x3453c0);if(_0x3453c0[_0x044a('0x9')]){logger[_0x044a('0x9')](_0x044a('0x8'),'routing',_0x5e395a,_0x3453c0[_0x044a('0x9')]['message'],_0xc7856c);return _0x2f384b(_0x3453c0['error'][_0x044a('0xa')]);}else{return _0x54bc33(_0x3453c0[_0x044a('0xb')]);}})[_0x044a('0xc')](function(_0xb14e92){logger[_0x044a('0x9')](_0x044a('0x8'),_0x044a('0x3'),_0x5e395a,_0xb14e92,_0xc7856c);return _0x2f384b(_0xb14e92);});});};module[_0x044a('0xd')]=client; \ No newline at end of file +var _0x9255=['jayson/promise','bluebird','routing','http','Request','request','then','debug','rpc','error','message','result','catch','exports'];(function(_0x546c68,_0x5c0116){var _0x4a2389=function(_0x5aa205){while(--_0x5aa205){_0x546c68['push'](_0x546c68['shift']());}};_0x4a2389(++_0x5c0116);}(_0x9255,0xd2));var _0x5925=function(_0x1d5cbd,_0x1bbfa7){_0x1d5cbd=_0x1d5cbd-0x0;var _0x3d2215=_0x9255[_0x1d5cbd];return _0x3d2215;};'use strict';var jayson=require(_0x5925('0x0'));var BPromise=require(_0x5925('0x1'));var logger=require('../../config/logger')(_0x5925('0x2'));var client=jayson['client'][_0x5925('0x3')]({'port':0x2329});client[_0x5925('0x4')]=function(_0x39ed2a,_0x3a5c49){return new BPromise(function(_0x356f16,_0x4a30a){return client[_0x5925('0x5')](_0x39ed2a,_0x3a5c49)[_0x5925('0x6')](function(_0xed60b7){logger[_0x5925('0x7')](_0x5925('0x8'),_0x5925('0x2'),_0x39ed2a,_0x3a5c49,_0xed60b7);if(_0xed60b7['error']){logger[_0x5925('0x9')]('rpc',_0x5925('0x2'),_0x39ed2a,_0xed60b7[_0x5925('0x9')]['message'],_0x3a5c49);return _0x4a30a(_0xed60b7[_0x5925('0x9')][_0x5925('0xa')]);}else{return _0x356f16(_0xed60b7[_0x5925('0xb')]);}})[_0x5925('0xc')](function(_0x16a179){logger['error'](_0x5925('0x8'),_0x5925('0x2'),_0x39ed2a,_0x16a179,_0x3a5c49);return _0x4a30a(_0x16a179);});});};module[_0x5925('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index c7e9218..bfaed4c 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 _0x0f77=['../../config/logger','email','resolve','then','getMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount'];(function(_0x52a857,_0xc99fa1){var _0x4e2aae=function(_0x5410d9){while(--_0x5410d9){_0x52a857['push'](_0x52a857['shift']());}};_0x4e2aae(++_0xc99fa1);}(_0x0f77,0x74));var _0x70f7=function(_0x4b69ae,_0x207c9b){_0x4b69ae=_0x4b69ae-0x0;var _0x28bdd3=_0x0f77[_0x4b69ae];return _0x28bdd3;};'use strict';var server=require(_0x70f7('0x0'));var Realtime=require(_0x70f7('0x1'));var EmailChannel=require(_0x70f7('0x2'));var mailAccount=require(_0x70f7('0x3'));var setting=require('./rpc/setting');var logger=require(_0x70f7('0x4'))(_0x70f7('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x70f7('0x6')]()[_0x70f7('0x7')](mailAccount[_0x70f7('0x8')]())[_0x70f7('0x7')](realtime['initMailAccounts']())['then'](function(){email[_0x70f7('0x9')](realtime[_0x70f7('0xa')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x70f7('0x7')](function(){return initRealtime();})['then'](function(){return setting[_0x70f7('0xb')]();})[_0x70f7('0x7')](function(_0x3634d7){return setInterval(initRealtime,_0x3634d7[_0x70f7('0xc')]*0x3e8);})['catch'](function(_0x4301f9){logger[_0x70f7('0xd')](_0x70f7('0xe'),_0x4301f9);});}main(); \ No newline at end of file +var _0x945a=['mailAccounts','listen','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./realtime','./lib/email','resolve','then','getMailAccounts','initMailAccounts'];(function(_0x2307fa,_0x266e5e){var _0x496486=function(_0x53466e){while(--_0x53466e){_0x2307fa['push'](_0x2307fa['shift']());}};_0x496486(++_0x266e5e);}(_0x945a,0xca));var _0xa945=function(_0x20c613,_0x3cda26){_0x20c613=_0x20c613-0x0;var _0x579e82=_0x945a[_0x20c613];return _0x579e82;};'use strict';var server=require('./server');var Realtime=require(_0xa945('0x0'));var EmailChannel=require(_0xa945('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var logger=require('../../config/logger')('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xa945('0x2')]()[_0xa945('0x3')](mailAccount[_0xa945('0x4')]())[_0xa945('0x3')](realtime[_0xa945('0x5')]())['then'](function(){email['refresh'](realtime[_0xa945('0x6')]);return realtime;});}function main(){return server[_0xa945('0x7')](realtime,email)[_0xa945('0x3')](function(){return initRealtime();})[_0xa945('0x3')](function(){return setting[_0xa945('0x8')]();})[_0xa945('0x3')](function(_0x1c3e4a){return setInterval(initRealtime,_0x1c3e4a[_0xa945('0x9')]*0x3e8);})[_0xa945('0xa')](function(_0x5760a9){logger[_0xa945('0xb')](_0xa945('0xc'),_0x5760a9);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index fb893c2..0a24b80 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 _0x31e2=['lastSync','sendMail','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','status','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','box','handleImapBox','bind','handleImapEmail','end','error','handleImapError','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x31e2,0x81));var _0x231e=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0x31e2[_0x26b8b5];return _0x2150a9;};'use strict';var _=require(_0x231e('0x0'));var moment=require(_0x231e('0x1'));var BPromise=require(_0x231e('0x2'));var md5=require(_0x231e('0x3'));var Redis=require(_0x231e('0x4'));var config=require(_0x231e('0x5'));var logger=require(_0x231e('0x6'))(_0x231e('0x7'));config[_0x231e('0x8')]=_[_0x231e('0x9')](config[_0x231e('0x8')],{'host':_0x231e('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x231e('0x8')]));var EmailImap=require(_0x231e('0xb'));var EmailSmtp=require(_0x231e('0xc'));var mailAccount=require(_0x231e('0xd'));var md5Accounts={};function EmailChannel(_0xdcbfa5){logger[_0x231e('0xe')]('start\x20email\x20channel');this[_0x231e('0xf')]=_0xdcbfa5[_0x231e('0xf')];this[_0x231e('0x10')]={};this[_0x231e('0x11')]=new EmailSmtp();}EmailChannel[_0x231e('0x12')][_0x231e('0x13')]=function(_0x5bb487){var _0x531e39=this[_0x231e('0xf')][_0x5bb487];var _0x542f82={'id':_0x531e39['id'],'name':_0x531e39[_0x231e('0x14')],'key':_0x531e39[_0x231e('0x15')],'active':_0x531e39[_0x231e('0x16')],'Imap':{'status':_0x531e39['Imap'][_0x231e('0x17')],'messageStatus':_0x531e39[_0x231e('0x18')][_0x231e('0x19')],'total':_0x531e39[_0x231e('0x18')][_0x231e('0x1a')]}};if(_[_0x231e('0x1b')](md5Accounts[_0x5bb487])){md5Accounts[_0x5bb487]={};}var _0x25a870=md5(JSON[_0x231e('0x1c')](_0x542f82));if(md5Accounts[_0x5bb487][_0x231e('0x3')]!==_0x25a870){md5Accounts[_0x5bb487][_0x231e('0x3')]=_0x25a870;io[_0x231e('0x13')](_0x231e('0x1d'),_0x542f82);}};EmailChannel[_0x231e('0x12')][_0x231e('0x1e')]=function(_0x1b9751){for(var _0x33abef in _0x1b9751){if(_0x1b9751[_0x231e('0x1f')](_0x33abef)){if(_0x1b9751[_0x33abef]['Imap']&&_0x1b9751[_0x33abef]['active']){var _0x31a26b=_0x1b9751[_0x33abef][_0x231e('0x18')];if(!_0x31a26b[_0x231e('0x20')]&&_0x1b9751[_0x33abef][_0x231e('0x21')]!==_0x231e('0x22'))_0x31a26b[_0x231e('0x20')]=_0x1b9751[_0x33abef][_0x231e('0x21')];if(!this[_0x231e('0x10')]['hasOwnProperty'](_0x31a26b['id'])){this[_0x231e('0x10')][_0x31a26b['id']]=new EmailImap(_0x31a26b,_0x1b9751[_0x33abef][_0x231e('0x7')]);this[_0x231e('0x10')][_0x31a26b['id']]['on'](_0x231e('0x23'),this[_0x231e('0x24')][_0x231e('0x25')](this,_0x33abef));this[_0x231e('0x10')][_0x31a26b['id']]['on'](_0x231e('0x7'),this[_0x231e('0x26')][_0x231e('0x25')](this,_0x33abef));this[_0x231e('0x10')][_0x31a26b['id']]['on'](_0x231e('0x27'),this['handleImapEnd'][_0x231e('0x25')](this,_0x33abef));this['imapAccounts'][_0x31a26b['id']]['on'](_0x231e('0x28'),this[_0x231e('0x29')][_0x231e('0x25')](this,_0x33abef));}}else{if(_[_0x231e('0x1b')](this[_0x231e('0xf')][_0x33abef]['Imap'])){this[_0x231e('0xf')][_0x33abef][_0x231e('0x18')]={};}this[_0x231e('0xf')][_0x33abef][_0x231e('0x18')][_0x231e('0x17')]=_0x231e('0x2a');this[_0x231e('0xf')][_0x33abef][_0x231e('0x18')][_0x231e('0x19')]='';this[_0x231e('0x13')](_0x33abef);}}}};EmailChannel[_0x231e('0x12')][_0x231e('0x24')]=function(_0x4f47fe,_0x45fead){if(this['mailAccounts'][_0x4f47fe]){this['mailAccounts'][_0x4f47fe][_0x231e('0x18')][_0x231e('0x17')]=_0x231e('0x2b');this[_0x231e('0xf')][_0x4f47fe][_0x231e('0x18')][_0x231e('0x19')]=_0x45fead[_0x231e('0x14')];if(_0x45fead[_0x231e('0x2c')]){this['mailAccounts'][_0x4f47fe][_0x231e('0x18')][_0x231e('0x1a')]=_0x45fead[_0x231e('0x2c')]['total'];}return this[_0x231e('0x13')](_0x4f47fe);}};EmailChannel[_0x231e('0x12')][_0x231e('0x26')]=function(_0x43807,_0x531c22){logger['info'](_0x231e('0x2d'),_0x531c22[_0x231e('0x2e')],_0x531c22[_0x231e('0x2f')],_0x531c22[_0x231e('0x30')],_0x43807);if(this[_0x231e('0xf')][_0x43807]){return mailAccount['notify'](_0x43807,_0x531c22)[_0x231e('0x31')](function(_0x2be4a3){if(_0x2be4a3){logger['info'](_0x231e('0x32'));}})[_0x231e('0x33')](function(_0x2be2ff){logger[_0x231e('0x28')](_0x231e('0x34'),JSON['stringify'](_0x2be2ff));});}};EmailChannel['prototype'][_0x231e('0x35')]=function(_0x295a6a){if(this['mailAccounts'][_0x295a6a]&&this['mailAccounts'][_0x295a6a][_0x231e('0x18')]){if(this[_0x231e('0x10')][this[_0x231e('0xf')][_0x295a6a][_0x231e('0x18')]['id']]){delete this[_0x231e('0x10')][this[_0x231e('0xf')][_0x295a6a][_0x231e('0x18')]['id']];}this[_0x231e('0xf')][_0x295a6a][_0x231e('0x18')][_0x231e('0x36')]=moment();this['emit'](_0x295a6a);}};EmailChannel[_0x231e('0x12')]['handleImapError']=function(_0x4d02c5,_0x32d4f3){if(this['mailAccounts'][_0x4d02c5]){this['mailAccounts'][_0x4d02c5]['Imap'][_0x231e('0x17')]=_0x231e('0x28');this[_0x231e('0xf')][_0x4d02c5]['Imap'][_0x231e('0x19')]=_0x32d4f3;return this[_0x231e('0x13')](_0x4d02c5);}};EmailChannel[_0x231e('0x12')][_0x231e('0x37')]=function(_0x4be036,_0x766bfb){return this[_0x231e('0x11')]['send'](_0x4be036,_0x766bfb);};EmailChannel[_0x231e('0x12')][_0x231e('0x38')]=function(_0x8cd31c){var _0x494bb3=this;if(this[_0x231e('0xf')][_0x8cd31c['id']]){if(_[_0x231e('0x1b')](this[_0x231e('0xf')][_0x8cd31c['id']]['Smtp'])){this[_0x231e('0xf')][_0x8cd31c['id']][_0x231e('0x39')]={};}this[_0x231e('0xf')][_0x8cd31c['id']][_0x231e('0x39')]['lastSync']=moment();return new BPromise(function(_0x1aadb0,_0x385adf){return _0x494bb3[_0x231e('0x11')][_0x231e('0x3a')](_0x8cd31c)['then'](function(_0x589f34){_0x494bb3[_0x231e('0xf')][_0x8cd31c['id']]['Smtp'][_0x231e('0x17')]=_0x231e('0x3b');_0x494bb3['mailAccounts'][_0x8cd31c['id']][_0x231e('0x39')][_0x231e('0x19')]='';_0x494bb3[_0x231e('0x13')](_0x8cd31c['id']);_0x1aadb0(_0x589f34);})[_0x231e('0x33')](function(_0x51eff4){_0x494bb3[_0x231e('0xf')][_0x8cd31c['id']][_0x231e('0x39')][_0x231e('0x17')]=_0x231e('0x28');_0x494bb3[_0x231e('0xf')][_0x8cd31c['id']][_0x231e('0x39')][_0x231e('0x19')]=_0x51eff4;_0x494bb3[_0x231e('0x13')](_0x8cd31c['id']);_0x385adf(_0x51eff4);});});}return this[_0x231e('0x11')][_0x231e('0x3a')](_0x8cd31c);};module[_0x231e('0x3c')]=EmailChannel; \ No newline at end of file +var _0xab99=['connected','messages','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','stringify','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','exports','md5','ioredis','../../../config/logger','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total','isNil','mailAccount:update','refresh','hasOwnProperty','service','custom','provider','imapAccounts','box','handleImapBox','bind','email','handleImapEmail','handleImapEnd','error','handleImapError','status'];(function(_0x201d3e,_0x28f61a){var _0x36d221=function(_0x5e68f4){while(--_0x5e68f4){_0x201d3e['push'](_0x201d3e['shift']());}};_0x36d221(++_0x28f61a);}(_0xab99,0x18a));var _0x9ab9=function(_0x5917b5,_0x12749f){_0x5917b5=_0x5917b5-0x0;var _0x2f7e52=_0xab99[_0x5917b5];return _0x2f7e52;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x9ab9('0x0'));var Redis=require(_0x9ab9('0x1'));var config=require('../../../config/environment');var logger=require(_0x9ab9('0x2'))('email');config['redis']=_[_0x9ab9('0x3')](config[_0x9ab9('0x4')],{'host':_0x9ab9('0x5'),'port':0x18eb});var io=require(_0x9ab9('0x6'))(new Redis(config[_0x9ab9('0x4')]));var EmailImap=require(_0x9ab9('0x7'));var EmailSmtp=require(_0x9ab9('0x8'));var mailAccount=require(_0x9ab9('0x9'));var md5Accounts={};function EmailChannel(_0x5e5249){logger[_0x9ab9('0xa')]('start\x20email\x20channel');this['mailAccounts']=_0x5e5249[_0x9ab9('0xb')];this['imapAccounts']={};this[_0x9ab9('0xc')]=new EmailSmtp();}EmailChannel[_0x9ab9('0xd')][_0x9ab9('0xe')]=function(_0x14732f){var _0x1c1551=this[_0x9ab9('0xb')][_0x14732f];var _0x3004a5={'id':_0x1c1551['id'],'name':_0x1c1551[_0x9ab9('0xf')],'key':_0x1c1551[_0x9ab9('0x10')],'active':_0x1c1551[_0x9ab9('0x11')],'Imap':{'status':_0x1c1551[_0x9ab9('0x12')]['status'],'messageStatus':_0x1c1551[_0x9ab9('0x12')][_0x9ab9('0x13')],'total':_0x1c1551[_0x9ab9('0x12')][_0x9ab9('0x14')]}};if(_[_0x9ab9('0x15')](md5Accounts[_0x14732f])){md5Accounts[_0x14732f]={};}var _0x56e22d=md5(JSON['stringify'](_0x3004a5));if(md5Accounts[_0x14732f][_0x9ab9('0x0')]!==_0x56e22d){md5Accounts[_0x14732f][_0x9ab9('0x0')]=_0x56e22d;io[_0x9ab9('0xe')](_0x9ab9('0x16'),_0x3004a5);}};EmailChannel[_0x9ab9('0xd')][_0x9ab9('0x17')]=function(_0x5c94de){for(var _0x583c88 in _0x5c94de){if(_0x5c94de[_0x9ab9('0x18')](_0x583c88)){if(_0x5c94de[_0x583c88]['Imap']&&_0x5c94de[_0x583c88][_0x9ab9('0x11')]){var _0x1e2df9=_0x5c94de[_0x583c88]['Imap'];if(!_0x1e2df9[_0x9ab9('0x19')]&&_0x5c94de[_0x583c88]['provider']!==_0x9ab9('0x1a'))_0x1e2df9['service']=_0x5c94de[_0x583c88][_0x9ab9('0x1b')];if(!this[_0x9ab9('0x1c')][_0x9ab9('0x18')](_0x1e2df9['id'])){this['imapAccounts'][_0x1e2df9['id']]=new EmailImap(_0x1e2df9,_0x5c94de[_0x583c88]['email']);this[_0x9ab9('0x1c')][_0x1e2df9['id']]['on'](_0x9ab9('0x1d'),this[_0x9ab9('0x1e')][_0x9ab9('0x1f')](this,_0x583c88));this[_0x9ab9('0x1c')][_0x1e2df9['id']]['on'](_0x9ab9('0x20'),this[_0x9ab9('0x21')][_0x9ab9('0x1f')](this,_0x583c88));this[_0x9ab9('0x1c')][_0x1e2df9['id']]['on']('end',this[_0x9ab9('0x22')]['bind'](this,_0x583c88));this['imapAccounts'][_0x1e2df9['id']]['on'](_0x9ab9('0x23'),this[_0x9ab9('0x24')][_0x9ab9('0x1f')](this,_0x583c88));}}else{if(_[_0x9ab9('0x15')](this[_0x9ab9('0xb')][_0x583c88][_0x9ab9('0x12')])){this['mailAccounts'][_0x583c88][_0x9ab9('0x12')]={};}this[_0x9ab9('0xb')][_0x583c88][_0x9ab9('0x12')][_0x9ab9('0x25')]='disabled';this['mailAccounts'][_0x583c88][_0x9ab9('0x12')][_0x9ab9('0x13')]='';this[_0x9ab9('0xe')](_0x583c88);}}}};EmailChannel[_0x9ab9('0xd')][_0x9ab9('0x1e')]=function(_0x481672,_0x31b471){if(this[_0x9ab9('0xb')][_0x481672]){this[_0x9ab9('0xb')][_0x481672][_0x9ab9('0x12')][_0x9ab9('0x25')]=_0x9ab9('0x26');this[_0x9ab9('0xb')][_0x481672][_0x9ab9('0x12')][_0x9ab9('0x13')]=_0x31b471[_0x9ab9('0xf')];if(_0x31b471['messages']){this[_0x9ab9('0xb')][_0x481672][_0x9ab9('0x12')][_0x9ab9('0x14')]=_0x31b471[_0x9ab9('0x27')][_0x9ab9('0x14')];}return this['emit'](_0x481672);}};EmailChannel['prototype']['handleImapEmail']=function(_0x3e2d3d,_0x3d2ff8){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x3d2ff8[_0x9ab9('0x28')],_0x3d2ff8['lastName'],_0x3d2ff8[_0x9ab9('0x29')],_0x3e2d3d);if(this[_0x9ab9('0xb')][_0x3e2d3d]){return mailAccount[_0x9ab9('0x2a')](_0x3e2d3d,_0x3d2ff8)[_0x9ab9('0x2b')](function(_0x5871ae){if(_0x5871ae){logger[_0x9ab9('0xa')](_0x9ab9('0x2c'));}})['catch'](function(_0x10c76f){logger[_0x9ab9('0x23')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x9ab9('0x2d')](_0x10c76f));});}};EmailChannel[_0x9ab9('0xd')]['handleImapEnd']=function(_0x26753a){if(this[_0x9ab9('0xb')][_0x26753a]&&this['mailAccounts'][_0x26753a]['Imap']){if(this[_0x9ab9('0x1c')][this[_0x9ab9('0xb')][_0x26753a][_0x9ab9('0x12')]['id']]){delete this['imapAccounts'][this[_0x9ab9('0xb')][_0x26753a][_0x9ab9('0x12')]['id']];}this['mailAccounts'][_0x26753a]['Imap'][_0x9ab9('0x2e')]=moment();this['emit'](_0x26753a);}};EmailChannel[_0x9ab9('0xd')][_0x9ab9('0x24')]=function(_0x404e70,_0x2e9833){if(this[_0x9ab9('0xb')][_0x404e70]){this[_0x9ab9('0xb')][_0x404e70][_0x9ab9('0x12')][_0x9ab9('0x25')]='error';this[_0x9ab9('0xb')][_0x404e70][_0x9ab9('0x12')]['messageStatus']=_0x2e9833;return this[_0x9ab9('0xe')](_0x404e70);}};EmailChannel[_0x9ab9('0xd')][_0x9ab9('0x2f')]=function(_0xfc73b5,_0x5185ec){return this['smtp'][_0x9ab9('0x30')](_0xfc73b5,_0x5185ec);};EmailChannel[_0x9ab9('0xd')][_0x9ab9('0x31')]=function(_0x56da10){var _0x240a01=this;if(this[_0x9ab9('0xb')][_0x56da10['id']]){if(_[_0x9ab9('0x15')](this[_0x9ab9('0xb')][_0x56da10['id']][_0x9ab9('0x32')])){this['mailAccounts'][_0x56da10['id']][_0x9ab9('0x32')]={};}this['mailAccounts'][_0x56da10['id']]['Smtp'][_0x9ab9('0x2e')]=moment();return new BPromise(function(_0x4d58de,_0x35ab93){return _0x240a01[_0x9ab9('0xc')][_0x9ab9('0x33')](_0x56da10)['then'](function(_0x3fcd21){_0x240a01[_0x9ab9('0xb')][_0x56da10['id']]['Smtp']['status']=_0x9ab9('0x34');_0x240a01['mailAccounts'][_0x56da10['id']]['Smtp'][_0x9ab9('0x13')]='';_0x240a01['emit'](_0x56da10['id']);_0x4d58de(_0x3fcd21);})['catch'](function(_0x447355){_0x240a01['mailAccounts'][_0x56da10['id']][_0x9ab9('0x32')][_0x9ab9('0x25')]='error';_0x240a01[_0x9ab9('0xb')][_0x56da10['id']][_0x9ab9('0x32')][_0x9ab9('0x13')]=_0x447355;_0x240a01[_0x9ab9('0xe')](_0x56da10['id']);_0x35ab93(_0x447355);});});}return this[_0x9ab9('0xc')][_0x9ab9('0x33')](_0x56da10);};module[_0x9ab9('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 2a6459a..e172b1b 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 _0x4409=['xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','handleFetchMessage','once','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleEnd','textCode','hasOwnProperty','upperFirst','exports','imap','mailparser','iconv','Iconv','events','EventEmitter','./utils','email','mailbox','account','getAccount','ready','handleReady','bind','end','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','user'];(function(_0x4abe74,_0x5f0c0){var _0x1653f5=function(_0x35de5d){while(--_0x35de5d){_0x4abe74['push'](_0x4abe74['shift']());}};_0x1653f5(++_0x5f0c0);}(_0x4409,0xa0));var _0x9440=function(_0x740a0f,_0x271871){_0x740a0f=_0x740a0f-0x0;var _0x299fa6=_0x4409[_0x740a0f];return _0x299fa6;};'use strict';var _=require('lodash');var util=require('util');var Imap=require(_0x9440('0x0'));var simpleParser=require(_0x9440('0x1'))['simpleParser'];var Iconv=require(_0x9440('0x2'))[_0x9440('0x3')];var EventEmitter=require(_0x9440('0x4'))[_0x9440('0x5')];var utils=require(_0x9440('0x6'));var logger=require('../../../config/logger')(_0x9440('0x7'));function EmailImap(_0x556b2f,_0x57b03a){this[_0x9440('0x8')]=_0x556b2f[_0x9440('0x8')];this[_0x9440('0x9')]=this[_0x9440('0xa')](_0x556b2f,_0x57b03a);this[_0x9440('0x0')]=new Imap(this[_0x9440('0x9')]);this[_0x9440('0x0')]['once'](_0x9440('0xb'),this[_0x9440('0xc')][_0x9440('0xd')](this));this[_0x9440('0x0')]['once'](_0x9440('0xe'),this['handleEnd'][_0x9440('0xd')](this));this[_0x9440('0x0')]['on'](_0x9440('0xf'),this[_0x9440('0x10')][_0x9440('0xd')](this));this[_0x9440('0x0')][_0x9440('0x11')]();}util[_0x9440('0x12')](EmailImap,EventEmitter);EmailImap[_0x9440('0x13')][_0x9440('0xa')]=function(_0xe197b7,_0x54f76b){var _0x3523fa={'connTimeout':_0xe197b7[_0x9440('0x14')]?_0xe197b7[_0x9440('0x14')]*0x3e8:0x2710,'authTimeout':_0xe197b7['authTimeout']?_0xe197b7[_0x9440('0x15')]*0x3e8:0x1388};if(_0xe197b7['service']){_0x3523fa[_0x9440('0x16')]=_0xe197b7['user'];if(_0xe197b7['modernAuthentication']){_0x3523fa[_0x9440('0x17')]=utils[_0x9440('0x18')](_0xe197b7[_0x9440('0x19')][_0x9440('0x1a')],_0xe197b7[_0x9440('0x16')]);}else{_0x3523fa[_0x9440('0x1b')]=_0xe197b7[_0x9440('0x1b')];}}else{if(_0xe197b7[_0x9440('0x1c')]){_0x3523fa[_0x9440('0x16')]=_0xe197b7[_0x9440('0x16')];_0x3523fa[_0x9440('0x1b')]=_0xe197b7['password'];}}_0x3523fa[_0x9440('0x7')]=_0x54f76b||_0xe197b7['user']||'anonymous@xcally.com';_0x3523fa[_0x9440('0x1d')]=_0xe197b7[_0x9440('0x1d')];_0x3523fa[_0x9440('0x1e')]=_0xe197b7[_0x9440('0x1e')]||0x3e1;if(_0xe197b7[_0x9440('0x1f')]){_0x3523fa[_0x9440('0x1f')]=!![];}else{_0x3523fa[_0x9440('0x1f')]=![];_0x3523fa[_0x9440('0x20')]=_0x9440('0x21');}return _0x3523fa;};EmailImap[_0x9440('0x13')][_0x9440('0xc')]=function(){this[_0x9440('0x0')][_0x9440('0x22')](this[_0x9440('0x8')],![],this[_0x9440('0x23')][_0x9440('0xd')](this));};EmailImap[_0x9440('0x13')][_0x9440('0x23')]=function(_0x1fbed3,_0x310b5f){if(_0x1fbed3){this['handleError'](_0x1fbed3,!![]);}else{this[_0x9440('0x24')](_0x9440('0x25'),_0x310b5f);this[_0x9440('0x26')]();}};EmailImap['prototype'][_0x9440('0x27')]=function(_0x2ba1fb){if(_0x2ba1fb){this['handleError'](_0x2ba1fb,!![]);}else{this[_0x9440('0x0')][_0x9440('0xe')]();}};EmailImap['prototype'][_0x9440('0x26')]=function(){this[_0x9440('0x0')][_0x9440('0x28')]([_0x9440('0x29')],this[_0x9440('0x2a')][_0x9440('0xd')](this));};EmailImap[_0x9440('0x13')][_0x9440('0x2a')]=function(_0x5bfe17,_0x4c7f33){if(_0x5bfe17){this['handleError'](_0x5bfe17,!![]);}else{if(_0x4c7f33[_0x9440('0x2b')]){try{var _0x40a739=this[_0x9440('0x0')]['fetch'](_0x4c7f33,{'bodies':'','markSeen':!![]});_0x40a739['on']('message',this[_0x9440('0x2c')][_0x9440('0xd')](this));_0x40a739[_0x9440('0x2d')]('error',this[_0x9440('0x2e')][_0x9440('0xd')](this));_0x40a739[_0x9440('0x2d')](_0x9440('0xe'),this[_0x9440('0x2f')]['bind'](this));}catch(_0x204c09){logger[_0x9440('0xf')](_0x204c09);}}else{this['imap'][_0x9440('0x30')](!![],this['handleCloseBox']['bind'](this));}}};EmailImap[_0x9440('0x13')]['handleFetchMessage']=function(_0x346bb5){_0x346bb5['on'](_0x9440('0x31'),this[_0x9440('0x32')][_0x9440('0xd')](this));_0x346bb5[_0x9440('0x2d')](_0x9440('0x33'),this[_0x9440('0x34')][_0x9440('0xd')](this));_0x346bb5[_0x9440('0x2d')](_0x9440('0xe'),this[_0x9440('0x35')][_0x9440('0xd')](this));};EmailImap[_0x9440('0x13')]['handleMessageBody']=function(_0x355bcd){simpleParser(_0x355bcd,{'Iconv':Iconv},this[_0x9440('0x36')][_0x9440('0xd')](this));};EmailImap[_0x9440('0x13')]['handleMessageAttributes']=function(){};EmailImap[_0x9440('0x13')][_0x9440('0x35')]=function(){};EmailImap['prototype'][_0x9440('0x36')]=function(_0x968da0,_0x1fad20){if(_0x968da0){logger['error'](_0x968da0);}else{var _0x28a6bf=this;utils[_0x9440('0x37')](this[_0x9440('0x9')],_0x1fad20,function(_0x13daa7){_0x28a6bf['emit'](_0x9440('0x7'),_0x13daa7);});}};EmailImap['prototype']['handleFetchEnd']=function(){this[_0x9440('0x0')][_0x9440('0x30')](!![],this[_0x9440('0x27')][_0x9440('0xd')](this));};EmailImap[_0x9440('0x13')]['handleFetchError']=function(_0x10500c){this[_0x9440('0x10')](_0x10500c);this[_0x9440('0x0')][_0x9440('0x30')](!![],this[_0x9440('0x27')][_0x9440('0xd')](this));};EmailImap[_0x9440('0x13')][_0x9440('0x38')]=function(){this[_0x9440('0x24')]('end');};EmailImap[_0x9440('0x13')][_0x9440('0x10')]=function(_0x32dcb8,_0x4edf67){logger[_0x9440('0xf')]('handleError',this[_0x9440('0x9')][_0x9440('0x7')],JSON['stringify'](_0x32dcb8));var _0x2b50ab='';if(_0x32dcb8){if(_0x32dcb8[_0x9440('0x39')]){_0x2b50ab=_0x32dcb8[_0x9440('0x39')];}else{for(var _0x491c34 in _0x32dcb8){if(_0x32dcb8[_0x9440('0x3a')](_0x491c34)){_0x2b50ab+=_[_0x9440('0x3b')](_0x491c34)+':\x20'+_0x32dcb8[_0x491c34]+'\x0a';}}}}if(_0x4edf67){this[_0x9440('0x0')][_0x9440('0xe')]();}else{this['emit']('error',_0x2b50ab);this[_0x9440('0x24')]('end');}};module[_0x9440('0x3c')]=EmailImap; \ No newline at end of file +var _0x5547=['inherits','getAccount','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','email','host','port','tls','autotls','required','prototype','openBox','handleOpenBox','handleError','emit','box','readUnseen','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageEnd','handleMessageAttributes','stringify','textCode','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','EventEmitter','../../../config/logger','mailbox','account','once','handleReady','bind','end','handleEnd'];(function(_0x3119e0,_0x26865c){var _0x408fa4=function(_0xe008e2){while(--_0xe008e2){_0x3119e0['push'](_0x3119e0['shift']());}};_0x408fa4(++_0x26865c);}(_0x5547,0x6c));var _0x7554=function(_0x25b8b1,_0xe0b951){_0x25b8b1=_0x25b8b1-0x0;var _0x2d04f7=_0x5547[_0x25b8b1];return _0x2d04f7;};'use strict';var _=require(_0x7554('0x0'));var util=require(_0x7554('0x1'));var Imap=require(_0x7554('0x2'));var simpleParser=require(_0x7554('0x3'))[_0x7554('0x4')];var Iconv=require(_0x7554('0x5'))[_0x7554('0x6')];var EventEmitter=require('events')[_0x7554('0x7')];var utils=require('./utils');var logger=require(_0x7554('0x8'))('email');function EmailImap(_0x1d91c4,_0x1505a0){this[_0x7554('0x9')]=_0x1d91c4[_0x7554('0x9')];this[_0x7554('0xa')]=this['getAccount'](_0x1d91c4,_0x1505a0);this[_0x7554('0x2')]=new Imap(this[_0x7554('0xa')]);this[_0x7554('0x2')][_0x7554('0xb')]('ready',this[_0x7554('0xc')][_0x7554('0xd')](this));this['imap'][_0x7554('0xb')](_0x7554('0xe'),this[_0x7554('0xf')]['bind'](this));this[_0x7554('0x2')]['on']('error',this['handleError']['bind'](this));this['imap']['connect']();}util[_0x7554('0x10')](EmailImap,EventEmitter);EmailImap['prototype'][_0x7554('0x11')]=function(_0x122537,_0x32cfd7){var _0x8a7d23={'connTimeout':_0x122537[_0x7554('0x12')]?_0x122537[_0x7554('0x12')]*0x3e8:0x2710,'authTimeout':_0x122537[_0x7554('0x13')]?_0x122537['authTimeout']*0x3e8:0x1388};if(_0x122537[_0x7554('0x14')]){_0x8a7d23[_0x7554('0x15')]=_0x122537[_0x7554('0x15')];if(_0x122537[_0x7554('0x16')]){_0x8a7d23[_0x7554('0x17')]=utils[_0x7554('0x18')](_0x122537[_0x7554('0x19')][_0x7554('0x1a')],_0x122537['user']);}else{_0x8a7d23[_0x7554('0x1b')]=_0x122537[_0x7554('0x1b')];}}else{if(_0x122537[_0x7554('0x1c')]){_0x8a7d23[_0x7554('0x15')]=_0x122537[_0x7554('0x15')];_0x8a7d23['password']=_0x122537[_0x7554('0x1b')];}}_0x8a7d23[_0x7554('0x1d')]=_0x32cfd7||_0x122537['user']||'anonymous@xcally.com';_0x8a7d23[_0x7554('0x1e')]=_0x122537[_0x7554('0x1e')];_0x8a7d23[_0x7554('0x1f')]=_0x122537[_0x7554('0x1f')]||0x3e1;if(_0x122537[_0x7554('0x20')]){_0x8a7d23['tls']=!![];}else{_0x8a7d23[_0x7554('0x20')]=![];_0x8a7d23[_0x7554('0x21')]=_0x7554('0x22');}return _0x8a7d23;};EmailImap[_0x7554('0x23')][_0x7554('0xc')]=function(){this['imap'][_0x7554('0x24')](this[_0x7554('0x9')],![],this[_0x7554('0x25')][_0x7554('0xd')](this));};EmailImap[_0x7554('0x23')][_0x7554('0x25')]=function(_0x20a870,_0x4be2b0){if(_0x20a870){this[_0x7554('0x26')](_0x20a870,!![]);}else{this[_0x7554('0x27')](_0x7554('0x28'),_0x4be2b0);this[_0x7554('0x29')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x374e0c){if(_0x374e0c){this[_0x7554('0x26')](_0x374e0c,!![]);}else{this[_0x7554('0x2')][_0x7554('0xe')]();}};EmailImap[_0x7554('0x23')][_0x7554('0x29')]=function(){this[_0x7554('0x2')]['search']([_0x7554('0x2a')],this[_0x7554('0x2b')]['bind'](this));};EmailImap[_0x7554('0x23')][_0x7554('0x2b')]=function(_0x1cca27,_0x125265){if(_0x1cca27){this[_0x7554('0x26')](_0x1cca27,!![]);}else{if(_0x125265[_0x7554('0x2c')]){try{var _0x26f13d=this[_0x7554('0x2')][_0x7554('0x2d')](_0x125265,{'bodies':'','markSeen':!![]});_0x26f13d['on'](_0x7554('0x2e'),this[_0x7554('0x2f')]['bind'](this));_0x26f13d['once'](_0x7554('0x30'),this[_0x7554('0x31')][_0x7554('0xd')](this));_0x26f13d[_0x7554('0xb')](_0x7554('0xe'),this[_0x7554('0x32')][_0x7554('0xd')](this));}catch(_0x2d4a43){logger[_0x7554('0x30')](_0x2d4a43);}}else{this[_0x7554('0x2')][_0x7554('0x33')](!![],this[_0x7554('0x34')][_0x7554('0xd')](this));}}};EmailImap[_0x7554('0x23')]['handleFetchMessage']=function(_0x2d0238){_0x2d0238['on'](_0x7554('0x35'),this[_0x7554('0x36')][_0x7554('0xd')](this));_0x2d0238[_0x7554('0xb')](_0x7554('0x37'),this['handleMessageAttributes'][_0x7554('0xd')](this));_0x2d0238[_0x7554('0xb')](_0x7554('0xe'),this[_0x7554('0x38')]['bind'](this));};EmailImap[_0x7554('0x23')][_0x7554('0x36')]=function(_0x1531c4){simpleParser(_0x1531c4,{'Iconv':Iconv},this['handleSimpleParser'][_0x7554('0xd')](this));};EmailImap[_0x7554('0x23')][_0x7554('0x39')]=function(){};EmailImap[_0x7554('0x23')]['handleMessageEnd']=function(){};EmailImap[_0x7554('0x23')]['handleSimpleParser']=function(_0x3f24bd,_0x186e93){if(_0x3f24bd){logger[_0x7554('0x30')](_0x3f24bd);}else{var _0x1433b3=this;utils['parser'](this['account'],_0x186e93,function(_0x2baf00){_0x1433b3['emit'](_0x7554('0x1d'),_0x2baf00);});}};EmailImap['prototype'][_0x7554('0x32')]=function(){this[_0x7554('0x2')][_0x7554('0x33')](!![],this['handleCloseBox'][_0x7554('0xd')](this));};EmailImap[_0x7554('0x23')][_0x7554('0x31')]=function(_0x81832f){this[_0x7554('0x26')](_0x81832f);this[_0x7554('0x2')]['closeBox'](!![],this[_0x7554('0x34')][_0x7554('0xd')](this));};EmailImap[_0x7554('0x23')]['handleEnd']=function(){this[_0x7554('0x27')](_0x7554('0xe'));};EmailImap[_0x7554('0x23')][_0x7554('0x26')]=function(_0x441a4f,_0x957979){logger[_0x7554('0x30')]('handleError',this[_0x7554('0xa')][_0x7554('0x1d')],JSON[_0x7554('0x3a')](_0x441a4f));var _0x2b3e55='';if(_0x441a4f){if(_0x441a4f[_0x7554('0x3b')]){_0x2b3e55=_0x441a4f[_0x7554('0x3b')];}else{for(var _0x5b0f93 in _0x441a4f){if(_0x441a4f['hasOwnProperty'](_0x5b0f93)){_0x2b3e55+=_[_0x7554('0x3c')](_0x5b0f93)+':\x20'+_0x441a4f[_0x5b0f93]+'\x0a';}}}}if(_0x957979){this['imap'][_0x7554('0xe')]();}else{this[_0x7554('0x27')]('error',_0x2b3e55);this[_0x7554('0x27')](_0x7554('0xe'));}};module[_0x7554('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index fbf534b..c3a208a 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 _0x0781=['send','use','compile','sendMail','toString','createTransport','Not\x20verifired','exports','nodemailer'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0781,0x7d));var _0x1078=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0781[_0x3dd15e];return _0x231fd0;};'use strict';var nodemailer=require(_0x1078('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x1078('0x1')]=function(_0x4920b5,_0x2865e7){return new Promise(function(_0x11c25c,_0x52e653){var _0x2f31cb=nodemailer['createTransport'](_0x4920b5);_0x2f31cb[_0x1078('0x2')](_0x1078('0x3'),inlineBase64());_0x2f31cb[_0x1078('0x4')](_0x2865e7,function(_0x38c536,_0x5cd320){if(_0x38c536){_0x52e653(_0x38c536[_0x1078('0x5')]());}else{_0x11c25c(_0x5cd320);}});});};EmailSmtp['prototype']['verify']=function(_0x1adf76){return new Promise(function(_0x560b90,_0x2497b5){var _0x32270b=nodemailer[_0x1078('0x6')](_0x1adf76);_0x32270b['verify'](function(_0xe76bee,_0x1e29f1){if(_0xe76bee){_0x2497b5(_0xe76bee[_0x1078('0x5')]());}else{if(_0x1e29f1){_0x560b90(_0x1e29f1);}else{_0x2497b5(_0x1078('0x7'));}}});});};module[_0x1078('0x8')]=EmailSmtp; \ No newline at end of file +var _0x8cf0=['verify','exports','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','toString'];(function(_0x44b74a,_0x3e7c94){var _0x2fbcf8=function(_0x32b319){while(--_0x32b319){_0x44b74a['push'](_0x44b74a['shift']());}};_0x2fbcf8(++_0x3e7c94);}(_0x8cf0,0x1ca));var _0x08cf=function(_0x4c62e5,_0x431a87){_0x4c62e5=_0x4c62e5-0x0;var _0x239f84=_0x8cf0[_0x4c62e5];return _0x239f84;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x08cf('0x0'));function EmailSmtp(){}EmailSmtp[_0x08cf('0x1')][_0x08cf('0x2')]=function(_0x284b3d,_0x1cf782){return new Promise(function(_0xc8354c,_0x10dd33){var _0x299fd1=nodemailer[_0x08cf('0x3')](_0x284b3d);_0x299fd1[_0x08cf('0x4')]('compile',inlineBase64());_0x299fd1['sendMail'](_0x1cf782,function(_0x3832a2,_0x59643d){if(_0x3832a2){_0x10dd33(_0x3832a2[_0x08cf('0x5')]());}else{_0xc8354c(_0x59643d);}});});};EmailSmtp[_0x08cf('0x1')][_0x08cf('0x6')]=function(_0x9cd788){return new Promise(function(_0x3f110b,_0x150fa5){var _0x107bd6=nodemailer['createTransport'](_0x9cd788);_0x107bd6[_0x08cf('0x6')](function(_0x6bad3d,_0x2261e1){if(_0x6bad3d){_0x150fa5(_0x6bad3d[_0x08cf('0x5')]());}else{if(_0x2261e1){_0x3f110b(_0x2261e1);}else{_0x150fa5('Not\x20verifired');}}});});};module[_0x08cf('0x7')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 0006e06..c37511c 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 _0xd4f4=['BodyHTML','

Empty\x20message

','Attachments','push','Title','Data','generateXOAuth2Token','auth=Bearer\x20','toString','base64','lodash','moment','randomstring','path','util','node-tnef','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','html','replace','includes','\x20[Attachment:\x20','body','textAsHtml','0x1?_0x3735e8[_0x4d4f('0x13')](0x0,-0x1)[_0x4d4f('0x14')]('\x20'):_0x752bed['name'];}return _0x4d4f('0x15');}function getLastName(_0x4460bd){var _0x4dae0a=_['head'](_0x4460bd[_0x4d4f('0x9')]);if(_0x4dae0a&&_0x4dae0a['name']){var _0x500b7d=_0x4dae0a[_0x4d4f('0xe')]['split'](/\s+/);return _0x500b7d['length']>0x1?_0x500b7d['pop']():'';}return'';}function getMails(_0x2b7448,_0x1d51b2){var _0x3581cb='';for(var _0x42f504=0x0;_0x42f504<_0x1d51b2[_0x4d4f('0x9')][_0x4d4f('0x12')];_0x42f504+=0x1){if(_0x1d51b2[_0x4d4f('0x9')][_0x42f504][_0x4d4f('0xa')]!==_0x2b7448){if(!_['isEmpty'](_0x3581cb)){_0x3581cb+=',';}_0x3581cb+=_0x1d51b2[_0x4d4f('0x9')][_0x42f504][_0x4d4f('0xe')]||_0x1d51b2[_0x4d4f('0x9')][_0x42f504][_0x4d4f('0xa')]||'';_0x3581cb+='\x20<';_0x3581cb+=_0x1d51b2[_0x4d4f('0x9')][_0x42f504][_0x4d4f('0xa')]?_0x1d51b2[_0x4d4f('0x9')][_0x42f504][_0x4d4f('0xa')]:_0x4d4f('0xb')+random[_0x4d4f('0xc')](0x6)+_0x4d4f('0xd');_0x3581cb+='>';}}return _0x3581cb;}function parseEmail(_0x2010f1,_0x341e1b,_0x35bbf9){if(_0x341e1b[_0x4d4f('0x16')]){var _0x361ad9=/)<[^<]*)*<\/script>/gi;while(_0x361ad9['test'](_0x341e1b[_0x4d4f('0x16')])){_0x341e1b[_0x4d4f('0x16')]=_0x341e1b[_0x4d4f('0x16')][_0x4d4f('0x17')](_0x361ad9,'');}if(_0x341e1b['html'][_0x4d4f('0x18')](_0x4d4f('0x19'))){var _0x545f9a=[];_0x341e1b[_0x4d4f('0x1a')][_0x4d4f('0x1b')](_0x2d142c=>{_0x545f9a['push'](_0x2d142c['filename']);});var _0x3fe630=/]+>/g;var _0xfa42df=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x791f99=_0x341e1b[_0x4d4f('0x16')][_0x4d4f('0x17')](_0xfa42df,'_SRC');var _0x4b6994=_0x791f99[_0x4d4f('0x17')](_0x3fe630,'_IMG');for(let _0x38fd1d=0x0;_0x38fd1d<_0x545f9a[_0x4d4f('0x12')];_0x38fd1d++){var _0x15964d=_0x4b6994['replace'](_0x4d4f('0x1c'),_0x4d4f('0x1d')+_0x545f9a[_0x38fd1d]+'\x20]');_0x4b6994=_0x15964d;}_0x341e1b[_0x4d4f('0x16')]=_0x4b6994;}_0x35bbf9[_0x4d4f('0x1e')]=_0x341e1b[_0x4d4f('0x16')];}else{_0x35bbf9[_0x4d4f('0x1e')]=_0x341e1b[_0x4d4f('0x1f')];}if(_0x35bbf9[_0x4d4f('0x1e')]){_0x35bbf9[_0x4d4f('0x1e')]=_0x35bbf9[_0x4d4f('0x1e')]['replace'](/0x0){var _0x4cf74f=['Auto-Submitted:\x20auto-replied',_0x4d4f('0x2e'),_0x4d4f('0x2f')];for(var _0x362caf=0x0;_0x362caf<_0x341e1b['headerLines']['length'];_0x362caf++){var _0x14b524=_['indexOf'](_0x4cf74f,_0x341e1b[_0x4d4f('0x2d')][_0x362caf][_0x4d4f('0x30')]);if(_0x14b524>=0x0){_0x35bbf9[_0x4d4f('0x31')]=!![];}}}return _0x35bbf9;}exports[_0x4d4f('0x32')]=function(_0x219812,_0x17af1f,_0x5e20ec){var _0x564901={'from':getAddress(_0x17af1f[_0x4d4f('0x33')]),'firstName':getFirstName(_0x17af1f[_0x4d4f('0x33')]),'lastName':getLastName(_0x17af1f['from']),'mapKey':_0x4d4f('0x6'),'message':{'from':getMails(_0x219812[_0x4d4f('0x6')],_0x17af1f[_0x4d4f('0x33')]),'to':_0x219812['email'],'cc':'','subject':_0x17af1f[_0x4d4f('0x34')]||'','messageId':_0x17af1f[_0x4d4f('0x35')],'inReplyTo':_0x17af1f[_0x4d4f('0x36')],'sentAt':moment(_0x17af1f[_0x4d4f('0x37')])['format'](_0x4d4f('0x38')),'attach':![],'attachments':[]}};if(!_0x17af1f[_0x4d4f('0x16')]&&!_0x17af1f[_0x4d4f('0x1f')]){var _0x278c75=_[_0x4d4f('0x39')](_0x17af1f[_0x4d4f('0x1a')],{'contentType':_0x4d4f('0x3a')});if(_0x278c75[_0x4d4f('0x12')]){logger[_0x4d4f('0x3b')](util['format'](_0x4d4f('0x3c'),_0x17af1f['messageId']));tnef['parseBuffer'](_[_0x4d4f('0x3d')](_0x278c75)[_0x4d4f('0x2b')],function(_0x232310,_0x3e92c4){if(_0x3e92c4){_0x17af1f[_0x4d4f('0x16')]=_0x3e92c4[_0x4d4f('0x3e')]||_0x4d4f('0x3f');if(_0x3e92c4[_0x4d4f('0x40')]){for(var _0x39002f=0x0;_0x39002f<_0x3e92c4['Attachments'][_0x4d4f('0x12')];_0x39002f++){var _0x394235=_0x3e92c4[_0x4d4f('0x40')][_0x39002f];_0x564901['message']['attachments'][_0x4d4f('0x41')]({'filename':_0x394235[_0x4d4f('0x42')],'content':Buffer[_0x4d4f('0x33')](_0x394235[_0x4d4f('0x43')])});}}}_0x5e20ec(parseEmail(_0x219812,_0x17af1f,_0x564901));});}else{_0x17af1f['html']='

Empty\x20message

';_0x5e20ec(parseEmail(_0x219812,_0x17af1f,_0x564901));}}else{_0x5e20ec(parseEmail(_0x219812,_0x17af1f,_0x564901));}};exports[_0x4d4f('0x44')]=function(_0x4c5702,_0x3f73af){var _0xd754da=['user='+(_0x3f73af||''),_0x4d4f('0x45')+_0x4c5702,'',''];return Buffer[_0x4d4f('0x33')](_0xd754da[_0x4d4f('0x14')](''),'utf-8')[_0x4d4f('0x46')](_0x4d4f('0x47'));}; \ No newline at end of file +var _0x0800=['generate','@xcally.com','name','substring','indexOf','length','slice','join','split','pop','html','replace','attachments','forEach','push','filename','_IMG','\x20[Attachment:\x20','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous'];(function(_0x5cd23e,_0x20777b){var _0x216550=function(_0x2935bb){while(--_0x2935bb){_0x5cd23e['push'](_0x5cd23e['shift']());}};_0x216550(++_0x20777b);}(_0x0800,0x171));var _0x0080=function(_0x5ba28b,_0xa00021){_0x5ba28b=_0x5ba28b-0x0;var _0x16581a=_0x0800[_0x5ba28b];return _0x16581a;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0x0080('0x0'));var fs=require('fs');var path=require(_0x0080('0x1'));var util=require(_0x0080('0x2'));var tnef=require(_0x0080('0x3'));var logger=require(_0x0080('0x4'))(_0x0080('0x5'));var config=require(_0x0080('0x6'));function getAddress(_0x2ee274){var _0x3f8039=_[_0x0080('0x7')](_0x2ee274[_0x0080('0x8')]);return _0x3f8039&&_0x3f8039['address']?_0x3f8039[_0x0080('0x9')]:_0x0080('0xa')+random[_0x0080('0xb')](0x6)+_0x0080('0xc');}function getFirstName(_0x1717e6){var _0x20bb8d=_['head'](_0x1717e6[_0x0080('0x8')]);if(_0x20bb8d&&_0x20bb8d['name']){if(_0x20bb8d[_0x0080('0xd')]==_0x20bb8d[_0x0080('0x9')]){return _0x20bb8d[_0x0080('0xd')][_0x0080('0xe')](0x0,_0x20bb8d[_0x0080('0xd')][_0x0080('0xf')]('@'));}var _0xaea98e=_0x20bb8d[_0x0080('0xd')]['split'](/\s+/);return _0xaea98e[_0x0080('0x10')]>0x1?_0xaea98e[_0x0080('0x11')](0x0,-0x1)[_0x0080('0x12')]('\x20'):_0x20bb8d[_0x0080('0xd')];}return'Anonymous';}function getLastName(_0x46bcbf){var _0xb714ce=_[_0x0080('0x7')](_0x46bcbf[_0x0080('0x8')]);if(_0xb714ce&&_0xb714ce[_0x0080('0xd')]){var _0x2ba215=_0xb714ce[_0x0080('0xd')][_0x0080('0x13')](/\s+/);return _0x2ba215[_0x0080('0x10')]>0x1?_0x2ba215[_0x0080('0x14')]():'';}return'';}function getMails(_0x1f87cb,_0x218619){var _0x515d28='';for(var _0x379c18=0x0;_0x379c18<_0x218619[_0x0080('0x8')][_0x0080('0x10')];_0x379c18+=0x1){if(_0x218619[_0x0080('0x8')][_0x379c18]['address']!==_0x1f87cb){if(!_['isEmpty'](_0x515d28)){_0x515d28+=',';}_0x515d28+=_0x218619[_0x0080('0x8')][_0x379c18][_0x0080('0xd')]||_0x218619[_0x0080('0x8')][_0x379c18][_0x0080('0x9')]||'';_0x515d28+='\x20<';_0x515d28+=_0x218619[_0x0080('0x8')][_0x379c18][_0x0080('0x9')]?_0x218619['value'][_0x379c18]['address']:'anonymous'+random['generate'](0x6)+'@xcally.com';_0x515d28+='>';}}return _0x515d28;}function parseEmail(_0x414e13,_0x59ce3c,_0x46e9cc){if(_0x59ce3c[_0x0080('0x15')]){var _0x397071=/)<[^<]*)*<\/script>/gi;while(_0x397071['test'](_0x59ce3c[_0x0080('0x15')])){_0x59ce3c[_0x0080('0x15')]=_0x59ce3c['html'][_0x0080('0x16')](_0x397071,'');}if(_0x59ce3c[_0x0080('0x15')]['includes']('{_0x1fc941[_0x0080('0x19')](_0x36bd7e[_0x0080('0x1a')]);});var _0x2cf7f0=/]+>/g;var _0x40c0e1=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x501e18=_0x59ce3c[_0x0080('0x15')][_0x0080('0x16')](_0x40c0e1,'_SRC');var _0x4bd3c3=_0x501e18[_0x0080('0x16')](_0x2cf7f0,_0x0080('0x1b'));for(let _0x599441=0x0;_0x599441<_0x1fc941[_0x0080('0x10')];_0x599441++){var _0x478a49=_0x4bd3c3[_0x0080('0x16')](_0x0080('0x1b'),_0x0080('0x1c')+_0x1fc941[_0x599441]+'\x20]');_0x4bd3c3=_0x478a49;}_0x59ce3c[_0x0080('0x15')]=_0x4bd3c3;}_0x46e9cc[_0x0080('0x1d')]=_0x59ce3c['html'];}else{_0x46e9cc[_0x0080('0x1d')]=_0x59ce3c[_0x0080('0x1e')];}if(_0x46e9cc[_0x0080('0x1d')]){_0x46e9cc[_0x0080('0x1d')]=_0x46e9cc[_0x0080('0x1d')]['replace'](/0x0){var _0xf812d1=[_0x0080('0x32'),_0x0080('0x33'),_0x0080('0x34')];for(var _0x257668=0x0;_0x257668<_0x59ce3c[_0x0080('0x31')][_0x0080('0x10')];_0x257668++){var _0x81aebd=_[_0x0080('0xf')](_0xf812d1,_0x59ce3c[_0x0080('0x31')][_0x257668]['line']);if(_0x81aebd>=0x0){_0x46e9cc[_0x0080('0x35')]=!![];}}}return _0x46e9cc;}exports[_0x0080('0x36')]=function(_0x3f58be,_0x554cbc,_0x483ab2){var _0x44aa26={'from':getAddress(_0x554cbc['from']),'firstName':getFirstName(_0x554cbc['from']),'lastName':getLastName(_0x554cbc['from']),'mapKey':_0x0080('0x5'),'message':{'from':getMails(_0x3f58be['email'],_0x554cbc[_0x0080('0x37')]),'to':_0x3f58be[_0x0080('0x5')],'cc':'','subject':_0x554cbc[_0x0080('0x38')]||'','messageId':_0x554cbc[_0x0080('0x39')],'inReplyTo':_0x554cbc[_0x0080('0x3a')],'sentAt':moment(_0x554cbc[_0x0080('0x3b')])[_0x0080('0x2a')](_0x0080('0x3c')),'attach':![],'attachments':[]}};if(!_0x554cbc[_0x0080('0x15')]&&!_0x554cbc['textAsHtml']){var _0x28d923=_[_0x0080('0x3d')](_0x554cbc[_0x0080('0x17')],{'contentType':_0x0080('0x3e')});if(_0x28d923[_0x0080('0x10')]){logger[_0x0080('0x3f')](util['format']('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x554cbc[_0x0080('0x39')]));tnef[_0x0080('0x40')](_['first'](_0x28d923)['content'],function(_0x4be89a,_0x4ebfab){if(_0x4ebfab){_0x554cbc['html']=_0x4ebfab[_0x0080('0x41')]||_0x0080('0x42');if(_0x4ebfab['Attachments']){for(var _0x1e6af3=0x0;_0x1e6af3<_0x4ebfab[_0x0080('0x43')][_0x0080('0x10')];_0x1e6af3++){var _0x1f5fba=_0x4ebfab[_0x0080('0x43')][_0x1e6af3];_0x44aa26[_0x0080('0x20')][_0x0080('0x17')][_0x0080('0x19')]({'filename':_0x1f5fba[_0x0080('0x44')],'content':Buffer[_0x0080('0x37')](_0x1f5fba[_0x0080('0x45')])});}}}_0x483ab2(parseEmail(_0x3f58be,_0x554cbc,_0x44aa26));});}else{_0x554cbc[_0x0080('0x15')]='

Empty\x20message

';_0x483ab2(parseEmail(_0x3f58be,_0x554cbc,_0x44aa26));}}else{_0x483ab2(parseEmail(_0x3f58be,_0x554cbc,_0x44aa26));}};exports[_0x0080('0x46')]=function(_0x23b9b8,_0x2f4cc0){var _0x2dc2c0=[_0x0080('0x47')+(_0x2f4cc0||''),_0x0080('0x48')+_0x23b9b8,'',''];return Buffer[_0x0080('0x37')](_0x2dc2c0[_0x0080('0x12')](''),_0x0080('0x49'))[_0x0080('0x4a')](_0x0080('0x4b'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 67e5134..86ee4e5 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 _0x1cce=['Smtp','exports','lodash','Service','key','SERV','active'];(function(_0x520a59,_0xca1fb3){var _0x5c97c8=function(_0x71c78){while(--_0x71c78){_0x520a59['push'](_0x520a59['shift']());}};_0x5c97c8(++_0xca1fb3);}(_0x1cce,0x1f3));var _0xe1cc=function(_0x271a95,_0x4d2a07){_0x271a95=_0x271a95-0x0;var _0x3fa489=_0x1cce[_0x271a95];return _0x3fa489;};'use strict';var _=require(_0xe1cc('0x0'));function MailAccount(_0x3762b2){this['id']=_0x3762b2['id']||0x0;this['name']=_0x3762b2['name']||_0xe1cc('0x1');this[_0xe1cc('0x2')]=_0x3762b2['key']||_0xe1cc('0x3');this[_0xe1cc('0x4')]=_0x3762b2[_0xe1cc('0x4')]||![];this['Imap']=_0x3762b2['Imap']||[];this['Smtp']=_0x3762b2[_0xe1cc('0x5')]||[];}module[_0xe1cc('0x6')]=MailAccount; \ No newline at end of file +var _0x2374=['key','SERV','Imap','exports','lodash','name','Service'];(function(_0x36cb9e,_0x4cd164){var _0x353836=function(_0x5421bf){while(--_0x5421bf){_0x36cb9e['push'](_0x36cb9e['shift']());}};_0x353836(++_0x4cd164);}(_0x2374,0x17e));var _0x4237=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2374[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x4237('0x0'));function MailAccount(_0x352f45){this['id']=_0x352f45['id']||0x0;this[_0x4237('0x1')]=_0x352f45['name']||_0x4237('0x2');this['key']=_0x352f45[_0x4237('0x3')]||_0x4237('0x4');this['active']=_0x352f45['active']||![];this[_0x4237('0x5')]=_0x352f45[_0x4237('0x5')]||[];this['Smtp']=_0x352f45['Smtp']||[];}module[_0x4237('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 30b5fdf..4cdbdc0 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 _0xb1c7=['hasOwnProperty','prototype','initMailAccounts','isUndefined','merge','exports','../model/mailAccount','mailAccounts','mapKeys'];(function(_0x5be1ae,_0x4d8d2d){var _0x5e073f=function(_0x903c5c){while(--_0x903c5c){_0x5be1ae['push'](_0x5be1ae['shift']());}};_0x5e073f(++_0x4d8d2d);}(_0xb1c7,0x84));var _0x7b1c=function(_0x5c1930,_0x1b15e7){_0x5c1930=_0x5c1930-0x0;var _0x163a34=_0xb1c7[_0x5c1930];return _0x163a34;};'use strict';var _=require('lodash');var MailAccount=require(_0x7b1c('0x0'));var Realtime=function(){this[_0x7b1c('0x1')]={};};function freeIsNotKey(_0x1b830d,_0x3ae796,_0x363015){var _0x53ad68=_[_0x7b1c('0x2')](_0x1b830d,function(_0x487f30,_0x115abf){return _0x487f30[_0x363015];});for(var _0x59ac83 in _0x3ae796){if(_0x3ae796[_0x7b1c('0x3')](_0x59ac83)){if(!_0x53ad68[_0x59ac83]){delete _0x3ae796[_0x59ac83];}}}}Realtime[_0x7b1c('0x4')]['mergeFromDatabase']=function(_0x377b52,_0x1fc85c){for(var _0x571962 in _0x1fc85c){if(_0x377b52[_0x7b1c('0x3')](_0x571962)){_0x377b52[_0x571962]=_0x1fc85c[_0x571962];}}};Realtime['prototype'][_0x7b1c('0x5')]=function(){var _0x3f60c8=this;return function(_0x197465){if(_0x197465){freeIsNotKey(_0x197465,_0x3f60c8[_0x7b1c('0x1')],'id');for(var _0x236c6f=0x0,_0x311f8b={},_0x390af0={};_0x236c6f<_0x197465['length'];_0x236c6f+=0x1){_0x311f8b=_0x197465[_0x236c6f];if(_[_0x7b1c('0x6')](_0x3f60c8[_0x7b1c('0x1')][_0x311f8b['id']])){_0x3f60c8[_0x7b1c('0x1')][_0x311f8b['id']]=new MailAccount(_0x311f8b);}else{_[_0x7b1c('0x7')](_0x3f60c8[_0x7b1c('0x1')][_0x311f8b['id']],_0x311f8b);}}}return _0x3f60c8[_0x7b1c('0x1')];};};module[_0x7b1c('0x8')]=Realtime; \ No newline at end of file +var _0x6141=['hasOwnProperty','prototype','mergeFromDatabase','isUndefined','merge','exports','lodash','mailAccounts','mapKeys'];(function(_0x1e5362,_0x118bbe){var _0x2a6014=function(_0x16f322){while(--_0x16f322){_0x1e5362['push'](_0x1e5362['shift']());}};_0x2a6014(++_0x118bbe);}(_0x6141,0x177));var _0x1614=function(_0x138cba,_0x410547){_0x138cba=_0x138cba-0x0;var _0x534cd7=_0x6141[_0x138cba];return _0x534cd7;};'use strict';var _=require(_0x1614('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x1614('0x1')]={};};function freeIsNotKey(_0x14f064,_0xf0cd15,_0x518b67){var _0x27b8d3=_[_0x1614('0x2')](_0x14f064,function(_0x3ac3c4,_0x39c764){return _0x3ac3c4[_0x518b67];});for(var _0x16cde7 in _0xf0cd15){if(_0xf0cd15[_0x1614('0x3')](_0x16cde7)){if(!_0x27b8d3[_0x16cde7]){delete _0xf0cd15[_0x16cde7];}}}}Realtime[_0x1614('0x4')][_0x1614('0x5')]=function(_0x19394d,_0x40019f){for(var _0x428170 in _0x40019f){if(_0x19394d[_0x1614('0x3')](_0x428170)){_0x19394d[_0x428170]=_0x40019f[_0x428170];}}};Realtime[_0x1614('0x4')]['initMailAccounts']=function(){var _0x15f4b7=this;return function(_0x169b4f){if(_0x169b4f){freeIsNotKey(_0x169b4f,_0x15f4b7[_0x1614('0x1')],'id');for(var _0x46ad9f=0x0,_0x5859cb={},_0x474ee6={};_0x46ad9f<_0x169b4f['length'];_0x46ad9f+=0x1){_0x5859cb=_0x169b4f[_0x46ad9f];if(_[_0x1614('0x6')](_0x15f4b7['mailAccounts'][_0x5859cb['id']])){_0x15f4b7['mailAccounts'][_0x5859cb['id']]=new MailAccount(_0x5859cb);}else{_[_0x1614('0x7')](_0x15f4b7[_0x1614('0x1')][_0x5859cb['id']],_0x5859cb);}}}return _0x15f4b7[_0x1614('0x1')];};};module[_0x1614('0x8')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index b647245..328c7b2 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 _0xaaee=['notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service','email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','MailServerOut','getMailAccount'];(function(_0x100070,_0x253ebf){var _0x21fe1a=function(_0x5de018){while(--_0x5de018){_0x100070['push'](_0x100070['shift']());}};_0x21fe1a(++_0x253ebf);}(_0xaaee,0x132));var _0xeaae=function(_0x482ae3,_0xaeb145){_0x482ae3=_0x482ae3-0x0;var _0x44878a=_0xaaee[_0x482ae3];return _0x44878a;};'use strict';var client=require(_0xeaae('0x0'));exports[_0xeaae('0x1')]=function(){return function(){return client[_0xeaae('0x2')](_0xeaae('0x3'),{'options':{'attributes':['id',_0xeaae('0x4'),'provider',_0xeaae('0x5'),_0xeaae('0x6'),_0xeaae('0x7'),_0xeaae('0x8'),_0xeaae('0x9'),_0xeaae('0xa')],'raw':![],'include':[{'model':_0xeaae('0xb'),'as':_0xeaae('0xc'),'include':[{'model':_0xeaae('0xd'),'attributes':['id',_0xeaae('0x4'),_0xeaae('0x5'),_0xeaae('0xe'),'data5'],'as':_0xeaae('0xd')}]},{'model':_0xeaae('0xf'),'as':'Smtp','include':[{'model':_0xeaae('0xd'),'attributes':['id',_0xeaae('0x4'),_0xeaae('0x5'),_0xeaae('0xe'),'data5'],'as':'CloudProvider'}]}]},'log':_0xeaae('0x10')});};};exports[_0xeaae('0x11')]=function(_0x59f71d,_0x11f698){return client[_0xeaae('0x2')](_0xeaae('0x12'),{'account':{'id':_0x59f71d},'body':_0x11f698,'log':_0xeaae('0x12')});}; \ No newline at end of file +var _0x3c85=['../client','getMailAccounts','Request','GetMailAccount','service','email','active','ListId','TemplateId','MailServerIn','type','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount'];(function(_0x589bb7,_0x11a7f0){var _0x3b7e60=function(_0x6cec15){while(--_0x6cec15){_0x589bb7['push'](_0x589bb7['shift']());}};_0x3b7e60(++_0x11a7f0);}(_0x3c85,0x1a0));var _0x53c8=function(_0x1eb3a6,_0x2e5848){_0x1eb3a6=_0x1eb3a6-0x0;var _0x159f3b=_0x3c85[_0x1eb3a6];return _0x159f3b;};'use strict';var client=require(_0x53c8('0x0'));exports[_0x53c8('0x1')]=function(){return function(){return client[_0x53c8('0x2')](_0x53c8('0x3'),{'options':{'attributes':['id','name','provider',_0x53c8('0x4'),_0x53c8('0x5'),_0x53c8('0x6'),'key',_0x53c8('0x7'),_0x53c8('0x8')],'raw':![],'include':[{'model':_0x53c8('0x9'),'as':'Imap','include':[{'model':'CloudProvider','attributes':['id','name','service',_0x53c8('0xa'),'data5'],'as':'CloudProvider'}]},{'model':_0x53c8('0xb'),'as':_0x53c8('0xc'),'include':[{'model':'CloudProvider','attributes':['id','name','service',_0x53c8('0xa'),'data5'],'as':'CloudProvider'}]}]},'log':_0x53c8('0xd')});};};exports[_0x53c8('0xe')]=function(_0x394f5f,_0x25d2af){return client[_0x53c8('0x2')]('NotifyMailAccount',{'account':{'id':_0x394f5f},'body':_0x25d2af,'log':_0x53c8('0xf')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index c3c2d3d..1d186eb 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 _0x5e06=['Request','GetSettings'];(function(_0x1d7750,_0x5e7f5d){var _0x7591ea=function(_0xe40d24){while(--_0xe40d24){_0x1d7750['push'](_0x1d7750['shift']());}};_0x7591ea(++_0x5e7f5d);}(_0x5e06,0x1ce));var _0x65e0=function(_0x5a4377,_0x568be3){_0x5a4377=_0x5a4377-0x0;var _0x307cd3=_0x5e06[_0x5a4377];return _0x307cd3;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x65e0('0x0')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x65e0('0x1')});}; \ No newline at end of file +var _0x7577=['getSettings','ShowSetting','loginMailFrequency','GetSettings','../client'];(function(_0x5465e6,_0x2a8809){var _0x10044e=function(_0x1d5dcd){while(--_0x1d5dcd){_0x5465e6['push'](_0x5465e6['shift']());}};_0x10044e(++_0x2a8809);}(_0x7577,0x1d0));var _0x7757=function(_0x369cbd,_0x21f52a){_0x369cbd=_0x369cbd-0x0;var _0xb32be0=_0x7577[_0x369cbd];return _0xb32be0;};'use strict';var client=require(_0x7757('0x0'));exports[_0x7757('0x1')]=function(){return client['Request'](_0x7757('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7757('0x3')]},'log':_0x7757('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 6e01017..d4b6012 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 94623b4..fa88671 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 _0x07c3=['once','log','lodash','http','express','ioredis','../../config/environment','createServer','port','localhost','adapter','socket.io-redis','redis','../../config/triggers','../../config/socketio','default','../../config/express'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x07c3,0x1bc));var _0x307c=function(_0x44e50a,_0x1cc4a2){_0x44e50a=_0x44e50a-0x0;var _0x1b5994=_0x07c3[_0x44e50a];return _0x1b5994;};'use strict';var _=require(_0x307c('0x0'));var http=require(_0x307c('0x1'));var express=require(_0x307c('0x2'));var sticky=require('sticky-session');var Redis=require(_0x307c('0x3'));var config=require(_0x307c('0x4'));var app=express();var server=http[_0x307c('0x5')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config[_0x307c('0x6')])){var socketio=require('socket.io')(server,{'transports':['websocket','polling']});config['redis']=_['defaults'](config['redis'],{'host':_0x307c('0x7'),'port':0x18eb});socketio[_0x307c('0x8')](require(_0x307c('0x9'))({'pubClient':new Redis(config[_0x307c('0xa')]),'subClient':new Redis(config[_0x307c('0xa')])}));require(_0x307c('0xb'))['default']();require(_0x307c('0xc'))[_0x307c('0xd')](socketio);require(_0x307c('0xe'))[_0x307c('0xd')](app);require('../../routes')[_0x307c('0xd')](app);}else{server[_0x307c('0xf')]('listening',function(){console[_0x307c('0x10')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x307c('0x6')]);});}exports=module['exports']=app; \ No newline at end of file +var _0x91b6=['sticky-session','createServer','timeout','listen','port','socket.io','websocket','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express'];(function(_0x55fc1b,_0x16d022){var _0x26257d=function(_0x5b7a91){while(--_0x5b7a91){_0x55fc1b['push'](_0x55fc1b['shift']());}};_0x26257d(++_0x16d022);}(_0x91b6,0xed));var _0x691b=function(_0x42d9cf,_0x55f9bc){_0x42d9cf=_0x42d9cf-0x0;var _0x1e98fb=_0x91b6[_0x42d9cf];return _0x1e98fb;};'use strict';var _=require(_0x691b('0x0'));var http=require(_0x691b('0x1'));var express=require(_0x691b('0x2'));var sticky=require(_0x691b('0x3'));var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http[_0x691b('0x4')](app);server[_0x691b('0x5')]=0xdbba0;if(sticky[_0x691b('0x6')](server,config[_0x691b('0x7')])){var socketio=require(_0x691b('0x8'))(server,{'transports':[_0x691b('0x9'),'polling']});config[_0x691b('0xa')]=_[_0x691b('0xb')](config['redis'],{'host':_0x691b('0xc'),'port':0x18eb});socketio[_0x691b('0xd')](require(_0x691b('0xe'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x691b('0xa')])}));require(_0x691b('0xf'))[_0x691b('0x10')]();require(_0x691b('0x11'))[_0x691b('0x10')](socketio);require('../../config/express')['default'](app);require(_0x691b('0x12'))[_0x691b('0x10')](app);}else{server[_0x691b('0x13')](_0x691b('0x14'),function(){console[_0x691b('0x15')](_0x691b('0x16'),config[_0x691b('0x7')]);});}exports=module[_0x691b('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 173bef9..b47655f 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 _0x5db1=['bluebird','../../config/logger','routing','client','http','Request','request','then','debug','error','rpc','message','result','catch','exports','jayson/promise'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5db1,0x17f));var _0x15db=function(_0x3e6301,_0x4fad31){_0x3e6301=_0x3e6301-0x0;var _0x2bb0c4=_0x5db1[_0x3e6301];return _0x2bb0c4;};'use strict';var jayson=require(_0x15db('0x0'));var BPromise=require(_0x15db('0x1'));var logger=require(_0x15db('0x2'))(_0x15db('0x3'));var client=jayson[_0x15db('0x4')][_0x15db('0x5')]({'port':0x2329});client[_0x15db('0x6')]=function(_0x562362,_0x57d3c2){return new BPromise(function(_0x3e0ee7,_0x3c70b8){return client[_0x15db('0x7')](_0x562362,_0x57d3c2)[_0x15db('0x8')](function(_0xa1cdcb){logger[_0x15db('0x9')]('rpc',_0x15db('0x3'),_0x562362,_0x57d3c2,_0xa1cdcb);if(_0xa1cdcb[_0x15db('0xa')]){logger[_0x15db('0xa')](_0x15db('0xb'),_0x15db('0x3'),_0x562362,_0xa1cdcb['error'][_0x15db('0xc')],_0x57d3c2);return _0x3c70b8(_0xa1cdcb['error'][_0x15db('0xc')]);}else{return _0x3e0ee7(_0xa1cdcb[_0x15db('0xd')]);}})[_0x15db('0xe')](function(_0x583f9f){logger[_0x15db('0xa')](_0x15db('0xb'),'routing',_0x562362,_0x583f9f,_0x57d3c2);return _0x3c70b8(_0x583f9f);});});};module[_0x15db('0xf')]=client; \ No newline at end of file +var _0x53bc=['Request','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http'];(function(_0x47725b,_0x229703){var _0x283b1e=function(_0x5d5b6c){while(--_0x5d5b6c){_0x47725b['push'](_0x47725b['shift']());}};_0x283b1e(++_0x229703);}(_0x53bc,0x19a));var _0xc53b=function(_0x157da5,_0x5a5f5e){_0x157da5=_0x157da5-0x0;var _0x2a82a8=_0x53bc[_0x157da5];return _0x2a82a8;};'use strict';var jayson=require(_0xc53b('0x0'));var BPromise=require(_0xc53b('0x1'));var logger=require(_0xc53b('0x2'))(_0xc53b('0x3'));var client=jayson[_0xc53b('0x4')][_0xc53b('0x5')]({'port':0x2329});client[_0xc53b('0x6')]=function(_0x3db015,_0x10fdda){return new BPromise(function(_0x12fe30,_0x4d231a){return client[_0xc53b('0x7')](_0x3db015,_0x10fdda)[_0xc53b('0x8')](function(_0x225124){logger[_0xc53b('0x9')](_0xc53b('0xa'),'routing',_0x3db015,_0x10fdda,_0x225124);if(_0x225124[_0xc53b('0xb')]){logger[_0xc53b('0xb')]('rpc',_0xc53b('0x3'),_0x3db015,_0x225124[_0xc53b('0xb')][_0xc53b('0xc')],_0x10fdda);return _0x4d231a(_0x225124['error'][_0xc53b('0xc')]);}else{return _0x12fe30(_0x225124[_0xc53b('0xd')]);}})[_0xc53b('0xe')](function(_0x190459){logger[_0xc53b('0xb')](_0xc53b('0xa'),_0xc53b('0x3'),_0x3db015,_0x190459,_0x10fdda);return _0x4d231a(_0x190459);});});};module[_0xc53b('0xf')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 95f75f6..f87e68f 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 _0x92d4=['./rpc/smsQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getSmsQueues','initSmsQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue'];(function(_0x14022a,_0x4ca101){var _0x12b439=function(_0x9f5f11){while(--_0x9f5f11){_0x14022a['push'](_0x14022a['shift']());}};_0x12b439(++_0x4ca101);}(_0x92d4,0x161));var _0x492d=function(_0x3c522e,_0x1a4b05){_0x3c522e=_0x3c522e-0x0;var _0x27cb32=_0x92d4[_0x3c522e];return _0x27cb32;};'use strict';var BPromise=require(_0x492d('0x0'));var server=require(_0x492d('0x1'));var Realtime=require(_0x492d('0x2'));var user=require(_0x492d('0x3'));var interval=require(_0x492d('0x4'));var openchannelQueue=require(_0x492d('0x5'));var chatQueue=require(_0x492d('0x6'));var smsQueue=require(_0x492d('0x7'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x492d('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x492d('0x9')]()[_0x492d('0xa')](user[_0x492d('0xb')]())[_0x492d('0xa')](realtime[_0x492d('0xc')]())['then'](interval['getIntervals']())[_0x492d('0xa')](realtime[_0x492d('0xd')]())['then'](openchannelQueue[_0x492d('0xe')]())[_0x492d('0xa')](realtime[_0x492d('0xf')]())[_0x492d('0xa')](chatQueue['getChatQueues']())['then'](realtime['initChatQueues']())['then'](smsQueue[_0x492d('0x10')]())[_0x492d('0xa')](realtime[_0x492d('0x11')]())[_0x492d('0xa')](mailQueue['getMailQueues']())[_0x492d('0xa')](realtime['initMailQueues']())[_0x492d('0xa')](faxQueue[_0x492d('0x12')]())[_0x492d('0xa')](realtime[_0x492d('0x13')]())['then'](whatsappQueue[_0x492d('0x14')]())[_0x492d('0xa')](realtime['initWhatsappQueues']())[_0x492d('0xa')](function(){return realtime;});}function main(){return server[_0x492d('0x15')](realtime)[_0x492d('0xa')](function(_0x55fe29){return initRealtime();})['then'](function(_0x508a04){return setInterval(initRealtime,0x1388);})[_0x492d('0x16')](function(_0x3c6712){console[_0x492d('0x17')](_0x3c6712);});}main(); \ No newline at end of file +var _0x7b31=['initAgents','getIntervals','then','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','initFaxQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/whatsappQueue','getAgents'];(function(_0x3d8bca,_0x116130){var _0x54606=function(_0x2f246a){while(--_0x2f246a){_0x3d8bca['push'](_0x3d8bca['shift']());}};_0x54606(++_0x116130);}(_0x7b31,0x1d9));var _0x17b3=function(_0x18272e,_0x2ad430){_0x18272e=_0x18272e-0x0;var _0xe4b727=_0x7b31[_0x18272e];return _0xe4b727;};'use strict';var BPromise=require(_0x17b3('0x0'));var server=require(_0x17b3('0x1'));var Realtime=require(_0x17b3('0x2'));var user=require(_0x17b3('0x3'));var interval=require(_0x17b3('0x4'));var openchannelQueue=require(_0x17b3('0x5'));var chatQueue=require(_0x17b3('0x6'));var smsQueue=require(_0x17b3('0x7'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x17b3('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user[_0x17b3('0x9')]())['then'](realtime[_0x17b3('0xa')]())['then'](interval[_0x17b3('0xb')]())[_0x17b3('0xc')](realtime[_0x17b3('0xd')]())[_0x17b3('0xc')](openchannelQueue[_0x17b3('0xe')]())[_0x17b3('0xc')](realtime[_0x17b3('0xf')]())[_0x17b3('0xc')](chatQueue[_0x17b3('0x10')]())[_0x17b3('0xc')](realtime[_0x17b3('0x11')]())['then'](smsQueue['getSmsQueues']())[_0x17b3('0xc')](realtime[_0x17b3('0x12')]())['then'](mailQueue['getMailQueues']())[_0x17b3('0xc')](realtime['initMailQueues']())[_0x17b3('0xc')](faxQueue['getFaxQueues']())['then'](realtime[_0x17b3('0x13')]())[_0x17b3('0xc')](whatsappQueue['getWhatsappQueues']())['then'](realtime['initWhatsappQueues']())[_0x17b3('0xc')](function(){return realtime;});}function main(){return server[_0x17b3('0x14')](realtime)[_0x17b3('0xc')](function(_0x2a6b19){return initRealtime();})['then'](function(_0x1652fd){return setInterval(initRealtime,0x1388);})[_0x17b3('0x15')](function(_0x275b72){console[_0x17b3('0x16')](_0x275b72);});}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 cf7f01a..1b8ce1e 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 _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1261,0x144));var _0x1126=function(_0x32ee50,_0x564493){_0x32ee50=_0x32ee50-0x0;var _0x12a1b3=_0x1261[_0x32ee50];return _0x12a1b3;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file +var _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x2ded17,_0x1750bb){var _0x41378d=function(_0x23c76c){while(--_0x23c76c){_0x2ded17['push'](_0x2ded17['shift']());}};_0x41378d(++_0x1750bb);}(_0x2ef3,0xba));var _0x32ef=function(_0x9fed0e,_0x22fc8e){_0x9fed0e=_0x9fed0e-0x0;var _0x53e251=_0x2ef3[_0x9fed0e];return _0x53e251;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 6c4a49d..4d308cf 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 _0xa92b=['message','catch','SendMail','bluebird','jayson/promise','client','http','request','then','error'];(function(_0x2fb3be,_0x1b2e64){var _0x25e47b=function(_0x672ad3){while(--_0x672ad3){_0x2fb3be['push'](_0x2fb3be['shift']());}};_0x25e47b(++_0x1b2e64);}(_0xa92b,0x19d));var _0xba92=function(_0x91384,_0x545eef){_0x91384=_0x91384-0x0;var _0x44daa0=_0xa92b[_0x91384];return _0x44daa0;};'use strict';var BPromise=require(_0xba92('0x0'));var jayson=require(_0xba92('0x1'));var client=jayson[_0xba92('0x2')][_0xba92('0x3')]({'port':0x232b});function request(_0x5d02b0,_0x18c76b){return new BPromise(function(_0x1e33c2,_0x1234fc){return client[_0xba92('0x4')](_0x5d02b0,_0x18c76b)[_0xba92('0x5')](function(_0x2ff9e1){if(_0x2ff9e1[_0xba92('0x6')]){return _0x1234fc(_0x2ff9e1['error'][_0xba92('0x7')]);}else{return _0x1e33c2(_0x2ff9e1['result']);}})[_0xba92('0x8')](function(_0x29140e){return _0x1234fc(_0x29140e);});});}exports['sendMailMessage']=function(_0x2179f4,_0x195e1d){return request(_0xba92('0x9'),{'account':_0x2179f4,'message':_0x195e1d});}; \ No newline at end of file +var _0xd027=['client','http','request','then','error','message','catch','sendMailMessage','SendMail','jayson/promise'];(function(_0x11f85e,_0x16341e){var _0x2a046d=function(_0x339eac){while(--_0x339eac){_0x11f85e['push'](_0x11f85e['shift']());}};_0x2a046d(++_0x16341e);}(_0xd027,0x6d));var _0x7d02=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd027[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x7d02('0x0'));var client=jayson[_0x7d02('0x1')][_0x7d02('0x2')]({'port':0x232b});function request(_0x3fe777,_0x1b11a7){return new BPromise(function(_0x4f0805,_0x46d5df){return client[_0x7d02('0x3')](_0x3fe777,_0x1b11a7)[_0x7d02('0x4')](function(_0x412266){if(_0x412266[_0x7d02('0x5')]){return _0x46d5df(_0x412266['error'][_0x7d02('0x6')]);}else{return _0x4f0805(_0x412266['result']);}})[_0x7d02('0x7')](function(_0x2df9db){return _0x46d5df(_0x2df9db);});});}exports[_0x7d02('0x8')]=function(_0x36665f,_0x4988cd){return request(_0x7d02('0x9'),{'account':_0x36665f,'message':_0x4988cd});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index b7e9e70..25f7b28 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 _0x1967=['chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busyQueue','chatWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','maxcapacity','working','idle','openchannel','fax','sms','length','StatusTime','format','smsPause','faxStatusTime','whatsappCurrentCapacity','openchannelCurrentCapacity','faxWaitingInteractions','mailWaitingInteractions','stringify','emit','user:routing:update','omit','exports','md5','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity'];(function(_0x253cbd,_0x273747){var _0x4502a4=function(_0x3a48f5){while(--_0x3a48f5){_0x253cbd['push'](_0x253cbd['shift']());}};_0x4502a4(++_0x273747);}(_0x1967,0x173));var _0x7196=function(_0x1a2b68,_0x324233){_0x1a2b68=_0x1a2b68-0x0;var _0x186fbe=_0x1967[_0x1a2b68];return _0x186fbe;};'use strict';var _=require('lodash');var md5=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var Redis=require(_0x7196('0x2'));var config=require(_0x7196('0x3'));config[_0x7196('0x4')]=_[_0x7196('0x5')](config[_0x7196('0x4')],{'host':_0x7196('0x6'),'port':0x18eb});var io=require(_0x7196('0x7'))(new Redis(config[_0x7196('0x4')]));function Agent(_0x5c128f){this['id']=_0x5c128f['id']||0x0;this[_0x7196('0x8')]=_0x5c128f[_0x7196('0x8')]||'';this[_0x7196('0x9')]=_0x5c128f[_0x7196('0x9')]||!![];this[_0x7196('0xa')]=_0x5c128f[_0x7196('0xa')]||![];this['chatPause']=_0x5c128f[_0x7196('0xb')]||![];this[_0x7196('0xc')]=_0x5c128f[_0x7196('0xc')]||![];this[_0x7196('0xd')]=_0x5c128f[_0x7196('0xd')]||![];this['smsPause']=_0x5c128f['smsPause']||![];this[_0x7196('0xe')]=_0x5c128f[_0x7196('0xe')]||![];this[_0x7196('0xf')]=_0x7196('0x10');this[_0x7196('0x11')]=0x0;this[_0x7196('0x12')]=_0x5c128f[_0x7196('0x12')]||0x0;this[_0x7196('0x13')]=0x0;this[_0x7196('0x14')]=_0x7196('0x10');this[_0x7196('0x15')]=0x0;this['mailCapacity']=_0x5c128f[_0x7196('0x16')]||0x0;this[_0x7196('0x17')]=0x0;this[_0x7196('0x18')]=_0x7196('0x10');this['faxStatusTime']=0x0;this[_0x7196('0x19')]=_0x5c128f['faxCapacity']||0x0;this[_0x7196('0x1a')]=0x0;this[_0x7196('0x1b')]=_0x7196('0x10');this[_0x7196('0x1c')]=0x0;this[_0x7196('0x1d')]=_0x5c128f[_0x7196('0x1d')]||0x0;this[_0x7196('0x1e')]=0x0;this[_0x7196('0x1f')]=_0x7196('0x10');this[_0x7196('0x20')]=0x0;this[_0x7196('0x21')]=_0x5c128f['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x7196('0x22')]=_0x7196('0x10');this[_0x7196('0x23')]=0x0;this['openchannelCapacity']=_0x5c128f[_0x7196('0x24')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0x7196('0x25')]=undefined;this[_0x7196('0x0')]='';this[_0x7196('0x26')]={};this['faxWaitingInteractions']={};this['mailWaitingInteractions']={};this[_0x7196('0x27')]={};this[_0x7196('0x28')]={};this['whatsappWaitingInteractions']={};this[_0x7196('0x29')]();}Agent[_0x7196('0x2a')][_0x7196('0x2b')]=function(_0x18d389){if(this[_0x18d389+_0x7196('0x2c')]>0x0){if(this[_0x18d389+'Capacity']>0x0&&this[_0x18d389+_0x7196('0x2c')]>=this[_0x18d389+'Capacity']){return _0x7196('0x2d');}else{return _0x7196('0x2e');}}else{return _0x7196('0x2f');}};Agent[_0x7196('0x2a')][_0x7196('0x29')]=function(){var _0x43f6a2=['mail','chat',_0x7196('0x30'),_0x7196('0x31'),_0x7196('0x32'),'whatsapp'];for(var _0x5aa538=0x0;_0x5aa538<_0x43f6a2[_0x7196('0x33')];_0x5aa538+=0x1){var _0x162cfc=this[_0x7196('0x2b')](_0x43f6a2[_0x5aa538]);if(this[_0x43f6a2[_0x5aa538]+'Status']!==_0x162cfc){this[_0x43f6a2[_0x5aa538]+_0x7196('0x34')]=_['toNumber'](moment()[_0x7196('0x35')]('x'));}this[_0x43f6a2[_0x5aa538]+'Status']=_0x162cfc;}var _0x30151f={'id':this['id'],'name':this[_0x7196('0x8')],'online':this[_0x7196('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0x7196('0xb')],'mailPause':this[_0x7196('0xc')],'smsPause':this[_0x7196('0x36')],'faxPause':this[_0x7196('0xd')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x7196('0xf')],'chatStatusTime':this[_0x7196('0x11')],'chatCapacity':this[_0x7196('0x12')],'chatCurrentCapacity':this[_0x7196('0x13')],'mailStatus':this[_0x7196('0x14')],'mailStatusTime':this[_0x7196('0x15')],'mailCapacity':this[_0x7196('0x16')],'mailCurrentCapacity':this[_0x7196('0x17')],'faxStatus':this[_0x7196('0x18')],'faxStatusTime':this[_0x7196('0x37')],'faxCapacity':this[_0x7196('0x19')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x7196('0x1b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x7196('0x1d')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x7196('0x1f')],'whatsappStatusTime':this[_0x7196('0x20')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x7196('0x38')],'openchannelStatus':this[_0x7196('0x22')],'openchannelStatusTime':this[_0x7196('0x23')],'openchannelCapacity':this[_0x7196('0x24')],'openchannelCurrentCapacity':this[_0x7196('0x39')],'busy':this['busy'],'busyQueue':this[_0x7196('0x25')],'chatWaitingInteractions':this[_0x7196('0x26')],'faxWaitingInteractions':this[_0x7196('0x3a')],'mailWaitingInteractions':this[_0x7196('0x3b')],'openchannelWaitingInteractions':this[_0x7196('0x27')],'smsWaitingInteractions':this[_0x7196('0x28')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x23d7aa=md5(JSON[_0x7196('0x3c')](_0x30151f));if(this[_0x7196('0x0')]!==_0x23d7aa){this['md5']=_0x23d7aa;io[_0x7196('0x3d')](_0x7196('0x3e'),_[_0x7196('0x3f')](_0x30151f,[_0x7196('0x9')]));}};module[_0x7196('0x40')]=Agent; \ No newline at end of file +var _0xcaf2=['busyQueue','emit','user:routing:update','exports','lodash','moment','ioredis','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','md5','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','mail','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatStatus','smsCurrentCapacity','whatsappStatusTime'];(function(_0x5401f6,_0x3b8658){var _0x38f962=function(_0x156455){while(--_0x156455){_0x5401f6['push'](_0x5401f6['shift']());}};_0x38f962(++_0x3b8658);}(_0xcaf2,0x8a));var _0x2caf=function(_0x1de641,_0x44d464){_0x1de641=_0x1de641-0x0;var _0xccacbc=_0xcaf2[_0x1de641];return _0xccacbc;};'use strict';var _=require(_0x2caf('0x0'));var md5=require('md5');var moment=require(_0x2caf('0x1'));var Redis=require(_0x2caf('0x2'));var config=require('../../../config/environment');config[_0x2caf('0x3')]=_[_0x2caf('0x4')](config['redis'],{'host':_0x2caf('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2caf('0x3')]));function Agent(_0xae320c){this['id']=_0xae320c['id']||0x0;this[_0x2caf('0x6')]=_0xae320c['name']||'';this[_0x2caf('0x7')]=_0xae320c[_0x2caf('0x7')]||!![];this[_0x2caf('0x8')]=_0xae320c[_0x2caf('0x8')]||![];this['chatPause']=_0xae320c[_0x2caf('0x9')]||![];this[_0x2caf('0xa')]=_0xae320c[_0x2caf('0xa')]||![];this[_0x2caf('0xb')]=_0xae320c[_0x2caf('0xb')]||![];this[_0x2caf('0xc')]=_0xae320c[_0x2caf('0xc')]||![];this[_0x2caf('0xd')]=_0xae320c[_0x2caf('0xd')]||![];this['chatStatus']=_0x2caf('0xe');this[_0x2caf('0xf')]=0x0;this[_0x2caf('0x10')]=_0xae320c[_0x2caf('0x10')]||0x0;this[_0x2caf('0x11')]=0x0;this[_0x2caf('0x12')]=_0x2caf('0xe');this[_0x2caf('0x13')]=0x0;this['mailCapacity']=_0xae320c[_0x2caf('0x14')]||0x0;this[_0x2caf('0x15')]=0x0;this['faxStatus']='unknown';this['faxStatusTime']=0x0;this[_0x2caf('0x16')]=_0xae320c['faxCapacity']||0x0;this[_0x2caf('0x17')]=0x0;this[_0x2caf('0x18')]=_0x2caf('0xe');this[_0x2caf('0x19')]=0x0;this['smsCapacity']=_0xae320c[_0x2caf('0x1a')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x2caf('0x1b')]='unknown';this['whatsappStatusTime']=0x0;this[_0x2caf('0x1c')]=_0xae320c['whatsappCapacity']||0x0;this[_0x2caf('0x1d')]=0x0;this[_0x2caf('0x1e')]='unknown';this[_0x2caf('0x1f')]=0x0;this[_0x2caf('0x20')]=_0xae320c[_0x2caf('0x20')]||0x0;this[_0x2caf('0x21')]=0x0;this[_0x2caf('0x22')]=![];this['busyQueue']=undefined;this[_0x2caf('0x23')]='';this[_0x2caf('0x24')]={};this[_0x2caf('0x25')]={};this[_0x2caf('0x26')]={};this[_0x2caf('0x27')]={};this[_0x2caf('0x28')]={};this[_0x2caf('0x29')]={};this[_0x2caf('0x2a')]();}Agent[_0x2caf('0x2b')][_0x2caf('0x2c')]=function(_0x6814bc){if(this[_0x6814bc+'CurrentCapacity']>0x0){if(this[_0x6814bc+_0x2caf('0x2d')]>0x0&&this[_0x6814bc+_0x2caf('0x2e')]>=this[_0x6814bc+_0x2caf('0x2d')]){return _0x2caf('0x2f');}else{return _0x2caf('0x30');}}else{return _0x2caf('0x31');}};Agent[_0x2caf('0x2b')][_0x2caf('0x2a')]=function(){var _0x2e0a75=[_0x2caf('0x32'),'chat',_0x2caf('0x33'),_0x2caf('0x34'),_0x2caf('0x35'),_0x2caf('0x36')];for(var _0x3c60d1=0x0;_0x3c60d1<_0x2e0a75[_0x2caf('0x37')];_0x3c60d1+=0x1){var _0x13e8d9=this[_0x2caf('0x2c')](_0x2e0a75[_0x3c60d1]);if(this[_0x2e0a75[_0x3c60d1]+_0x2caf('0x38')]!==_0x13e8d9){this[_0x2e0a75[_0x3c60d1]+_0x2caf('0x39')]=_[_0x2caf('0x3a')](moment()[_0x2caf('0x3b')]('x'));}this[_0x2e0a75[_0x3c60d1]+_0x2caf('0x38')]=_0x13e8d9;}var _0x48b5f7={'id':this['id'],'name':this[_0x2caf('0x6')],'online':this[_0x2caf('0x7')],'voicePause':this[_0x2caf('0x8')],'chatPause':this[_0x2caf('0x9')],'mailPause':this[_0x2caf('0xa')],'smsPause':this[_0x2caf('0xc')],'faxPause':this[_0x2caf('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x2caf('0x3c')],'chatStatusTime':this[_0x2caf('0xf')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x2caf('0x11')],'mailStatus':this[_0x2caf('0x12')],'mailStatusTime':this[_0x2caf('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x2caf('0x15')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x2caf('0x16')],'faxCurrentCapacity':this[_0x2caf('0x17')],'smsStatus':this[_0x2caf('0x18')],'smsStatusTime':this[_0x2caf('0x19')],'smsCapacity':this[_0x2caf('0x1a')],'smsCurrentCapacity':this[_0x2caf('0x3d')],'whatsappStatus':this[_0x2caf('0x1b')],'whatsappStatusTime':this[_0x2caf('0x3e')],'whatsappCapacity':this[_0x2caf('0x1c')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x2caf('0x1e')],'openchannelStatusTime':this[_0x2caf('0x1f')],'openchannelCapacity':this[_0x2caf('0x20')],'openchannelCurrentCapacity':this[_0x2caf('0x21')],'busy':this[_0x2caf('0x22')],'busyQueue':this[_0x2caf('0x3f')],'chatWaitingInteractions':this[_0x2caf('0x24')],'faxWaitingInteractions':this[_0x2caf('0x25')],'mailWaitingInteractions':this[_0x2caf('0x26')],'openchannelWaitingInteractions':this[_0x2caf('0x27')],'smsWaitingInteractions':this[_0x2caf('0x28')],'whatsappWaitingInteractions':this[_0x2caf('0x29')]};var _0x4d1dec=md5(JSON['stringify'](_0x48b5f7));if(this[_0x2caf('0x23')]!==_0x4d1dec){this[_0x2caf('0x23')]=_0x4d1dec;io[_0x2caf('0x40')](_0x2caf('0x41'),_['omit'](_0x48b5f7,[_0x2caf('0x7')]));}};module[_0x2caf('0x42')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 95c0e98..06b15ed 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 _0x7636=['emit','chat_queue:save','md5','util','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','updateRealtime','loggedIn','paused','length','online','available','stringify','format'];(function(_0x4c6714,_0x2bbb93){var _0x5672bf=function(_0x82141d){while(--_0x82141d){_0x4c6714['push'](_0x4c6714['shift']());}};_0x5672bf(++_0x2bbb93);}(_0x7636,0x192));var _0x6763=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0x7636[_0xb6e2ea];return _0x2a57bb;};'use strict';var _=require('lodash');var md5=require(_0x6763('0x0'));var util=require(_0x6763('0x1'));var Redis=require(_0x6763('0x2'));var config=require(_0x6763('0x3'));config['redis']=_[_0x6763('0x4')](config[_0x6763('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x6763('0x6'))(new Redis(config[_0x6763('0x5')]));function ChatQueue(_0x240d14){this['id']=_0x240d14['id']||0x0;this[_0x6763('0x7')]=_0x240d14[_0x6763('0x7')]||'';this['timeout']=_0x240d14[_0x6763('0x8')]||0xa;this['strategy']=_0x240d14['strategy']||'beepall';this[_0x6763('0x9')]=_0x240d14['Agents'];this[_0x6763('0xa')]={};this[_0x6763('0xb')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}ChatQueue[_0x6763('0xc')][_0x6763('0xd')]=function(){var _0x5a7346=this[_0x6763('0xa')][_0x6763('0xe')];this[_0x6763('0xa')]=_['map'](this['Agents'],'id');this[_0x6763('0xa')][_0x6763('0xe')]=_0x5a7346;};ChatQueue[_0x6763('0xc')][_0x6763('0xf')]=function(){this[_0x6763('0x10')]=0x0;this[_0x6763('0x11')]=0x0;for(var _0xcee55c=0x0;_0xcee55c=0x0?this['available']:0x0;var _0x37a1fe={'id':this['id'],'available':this[_0x6763('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x6763('0x7')],'paused':this[_0x6763('0x11')],'waiting':this[_0x6763('0xb')]};var _0x2c0e9e=md5(JSON[_0x6763('0x15')](_0x37a1fe));if(this[_0x6763('0x0')]!==_0x2c0e9e){this[_0x6763('0x0')]=_0x2c0e9e;io['to'](util[_0x6763('0x16')]('chat:queue:%s',_0x37a1fe['name']))[_0x6763('0x17')](_0x6763('0x18'),_0x37a1fe);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xaf89=['updateRealtime','loggedIn','paused','chatPause','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','strategy','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype'];(function(_0x8bcdde,_0x52898a){var _0xc62ab3=function(_0xb60aab){while(--_0xb60aab){_0x8bcdde['push'](_0x8bcdde['shift']());}};_0xc62ab3(++_0x52898a);}(_0xaf89,0x14f));var _0x9af8=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0xaf89[_0x1a0ef3];return _0x2b86da;};'use strict';var _=require('lodash');var md5=require(_0x9af8('0x0'));var util=require(_0x9af8('0x1'));var Redis=require(_0x9af8('0x2'));var config=require(_0x9af8('0x3'));config[_0x9af8('0x4')]=_[_0x9af8('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9af8('0x6'))(new Redis(config[_0x9af8('0x4')]));function ChatQueue(_0x5e2426){this['id']=_0x5e2426['id']||0x0;this['name']=_0x5e2426[_0x9af8('0x7')]||'';this['timeout']=_0x5e2426['timeout']||0xa;this[_0x9af8('0x8')]=_0x5e2426[_0x9af8('0x8')]||'beepall';this[_0x9af8('0x9')]=_0x5e2426[_0x9af8('0x9')];this[_0x9af8('0xa')]={};this[_0x9af8('0xb')]=0x0;this[_0x9af8('0x0')]='';this[_0x9af8('0xc')]();this['updateRealtime']();}ChatQueue['prototype'][_0x9af8('0xc')]=function(){var _0x3815e5=this['mapAgentsId'][_0x9af8('0xd')];this[_0x9af8('0xa')]=_[_0x9af8('0xe')](this[_0x9af8('0x9')],'id');this['mapAgentsId']['_rr']=_0x3815e5;};ChatQueue[_0x9af8('0xf')][_0x9af8('0x10')]=function(){this[_0x9af8('0x11')]=0x0;this[_0x9af8('0x12')]=0x0;for(var _0x209c20=0x0;_0x209c20=0x0?this[_0x9af8('0x14')]:0x0;var _0x45dea9={'id':this['id'],'available':this[_0x9af8('0x14')],'loggedIn':this[_0x9af8('0x11')],'name':this[_0x9af8('0x7')],'paused':this['paused'],'waiting':this[_0x9af8('0xb')]};var _0x143c58=md5(JSON[_0x9af8('0x15')](_0x45dea9));if(this[_0x9af8('0x0')]!==_0x143c58){this[_0x9af8('0x0')]=_0x143c58;io['to'](util[_0x9af8('0x16')](_0x9af8('0x17'),_0x45dea9[_0x9af8('0x7')]))[_0x9af8('0x18')](_0x9af8('0x19'),_0x45dea9);}};module[_0x9af8('0x1a')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 622f6ae..28eebac 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 _0xa040=['strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','available','waiting','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x4dea03,_0x8c81cb){var _0x5c21f2=function(_0x24a98c){while(--_0x24a98c){_0x4dea03['push'](_0x4dea03['shift']());}};_0x5c21f2(++_0x8c81cb);}(_0xa040,0x17c));var _0x0a04=function(_0xc763db,_0x49ec33){_0xc763db=_0xc763db-0x0;var _0x3d487c=_0xa040[_0xc763db];return _0x3d487c;};'use strict';var _=require(_0x0a04('0x0'));var md5=require(_0x0a04('0x1'));var util=require(_0x0a04('0x2'));var Redis=require('ioredis');var config=require(_0x0a04('0x3'));config[_0x0a04('0x4')]=_[_0x0a04('0x5')](config[_0x0a04('0x4')],{'host':_0x0a04('0x6'),'port':0x18eb});var io=require(_0x0a04('0x7'))(new Redis(config[_0x0a04('0x4')]));function FaxQueue(_0x5e7bce){this['id']=_0x5e7bce['id']||0x0;this[_0x0a04('0x8')]=_0x5e7bce[_0x0a04('0x8')]||'';this['timeout']=_0x5e7bce[_0x0a04('0x9')]||0xa;this[_0x0a04('0xa')]=_0x5e7bce[_0x0a04('0xa')]||_0x0a04('0xb');this[_0x0a04('0xc')]=_0x5e7bce[_0x0a04('0xc')];this[_0x0a04('0xd')]={};this['waiting']=0x0;this['md5']='';this[_0x0a04('0xe')]();this[_0x0a04('0xf')]();}FaxQueue[_0x0a04('0x10')][_0x0a04('0xe')]=function(){var _0x3029b3=this[_0x0a04('0xd')][_0x0a04('0x11')];this[_0x0a04('0xd')]=_[_0x0a04('0x12')](this[_0x0a04('0xc')],'id');this[_0x0a04('0xd')][_0x0a04('0x11')]=_0x3029b3;};FaxQueue[_0x0a04('0x10')][_0x0a04('0xf')]=function(){this[_0x0a04('0x13')]=0x0;this[_0x0a04('0x14')]=0x0;for(var _0x1f3f92=0x0;_0x1f3f92=0x0?this[_0x0a04('0x16')]:0x0;var _0x12ca50={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x0a04('0x8')],'paused':this[_0x0a04('0x14')],'waiting':this[_0x0a04('0x17')]};var _0x3df03d=md5(JSON[_0x0a04('0x18')](_0x12ca50));if(this[_0x0a04('0x1')]!==_0x3df03d){this[_0x0a04('0x1')]=_0x3df03d;io['to'](util[_0x0a04('0x19')](_0x0a04('0x1a'),_0x12ca50['name']))[_0x0a04('0x1b')](_0x0a04('0x1c'),_0x12ca50);}};module[_0x0a04('0x1d')]=FaxQueue; \ No newline at end of file +var _0x2daa=['loggedIn','length','online','faxPause','available','paused','stringify','fax_queue:save','md5','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0x25c92e,_0x47c77d){var _0x3f27d9=function(_0x30eb1b){while(--_0x30eb1b){_0x25c92e['push'](_0x25c92e['shift']());}};_0x3f27d9(++_0x47c77d);}(_0x2daa,0x166));var _0xa2da=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x2daa[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require('lodash');var md5=require(_0xa2da('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0xa2da('0x1'));config['redis']=_['defaults'](config[_0xa2da('0x2')],{'host':_0xa2da('0x3'),'port':0x18eb});var io=require(_0xa2da('0x4'))(new Redis(config[_0xa2da('0x2')]));function FaxQueue(_0xc73cd9){this['id']=_0xc73cd9['id']||0x0;this[_0xa2da('0x5')]=_0xc73cd9[_0xa2da('0x5')]||'';this[_0xa2da('0x6')]=_0xc73cd9[_0xa2da('0x6')]||0xa;this['strategy']=_0xc73cd9[_0xa2da('0x7')]||_0xa2da('0x8');this[_0xa2da('0x9')]=_0xc73cd9[_0xa2da('0x9')];this[_0xa2da('0xa')]={};this[_0xa2da('0xb')]=0x0;this[_0xa2da('0x0')]='';this[_0xa2da('0xc')]();this[_0xa2da('0xd')]();}FaxQueue[_0xa2da('0xe')][_0xa2da('0xc')]=function(){var _0x2273ad=this[_0xa2da('0xa')][_0xa2da('0xf')];this[_0xa2da('0xa')]=_[_0xa2da('0x10')](this[_0xa2da('0x9')],'id');this[_0xa2da('0xa')][_0xa2da('0xf')]=_0x2273ad;};FaxQueue[_0xa2da('0xe')]['updateRealtime']=function(){this[_0xa2da('0x11')]=0x0;this['paused']=0x0;for(var _0x6049e7=0x0;_0x6049e7=0x0?this[_0xa2da('0x15')]:0x0;var _0x218f81={'id':this['id'],'available':this[_0xa2da('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xa2da('0xb')]};var _0xcc0abe=md5(JSON[_0xa2da('0x17')](_0x218f81));if(this[_0xa2da('0x0')]!==_0xcc0abe){this[_0xa2da('0x0')]=_0xcc0abe;io['to'](util['format']('fax:queue:%s',_0x218f81[_0xa2da('0x5')]))['emit'](_0xa2da('0x18'),_0x218f81);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index e736099..72fa50f 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 _0x91d6=['exports','name','Intervals'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x91d6,0x103));var _0x691d=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x91d6[_0x16d10f];return _0x50c823;};'use strict';function Interval(_0x5cec16){this['id']=_0x5cec16['id']||0x0;this[_0x691d('0x0')]=_0x5cec16[_0x691d('0x0')]||'';this[_0x691d('0x1')]=_0x5cec16[_0x691d('0x1')]||{};}module[_0x691d('0x2')]=Interval; \ No newline at end of file +var _0x379e=['Intervals','exports','name'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x379e,0x14c));var _0xe379=function(_0x41f246,_0x103097){_0x41f246=_0x41f246-0x0;var _0x1944da=_0x379e[_0x41f246];return _0x1944da;};'use strict';function Interval(_0x1a32c5){this['id']=_0x1a32c5['id']||0x0;this[_0xe379('0x0')]=_0x1a32c5[_0xe379('0x0')]||'';this['Intervals']=_0x1a32c5[_0xe379('0x1')]||{};}module[_0xe379('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index d3f0257..85ca538 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 _0x39f4=['util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','md5'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x39f4,0x185));var _0x439f=function(_0x382d32,_0x2414bc){_0x382d32=_0x382d32-0x0;var _0x1fb3f8=_0x39f4[_0x382d32];return _0x1fb3f8;};'use strict';var _=require('lodash');var md5=require(_0x439f('0x0'));var util=require(_0x439f('0x1'));var Redis=require(_0x439f('0x2'));var config=require(_0x439f('0x3'));config['redis']=_['defaults'](config[_0x439f('0x4')],{'host':_0x439f('0x5'),'port':0x18eb});var io=require(_0x439f('0x6'))(new Redis(config[_0x439f('0x4')]));function MailQueue(_0x2008bb){this['id']=_0x2008bb['id']||0x0;this[_0x439f('0x7')]=_0x2008bb[_0x439f('0x7')]||'';this[_0x439f('0x8')]=_0x2008bb[_0x439f('0x8')]||0xa;this[_0x439f('0x9')]=_0x2008bb[_0x439f('0x9')]||_0x439f('0xa');this['Agents']=_0x2008bb[_0x439f('0xb')];this[_0x439f('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0x439f('0xd')]();this[_0x439f('0xe')]();}MailQueue[_0x439f('0xf')][_0x439f('0xd')]=function(){var _0x288bfc=this['mapAgentsId'][_0x439f('0x10')];this['mapAgentsId']=_[_0x439f('0x11')](this['Agents'],'id');this[_0x439f('0xc')]['_rr']=_0x288bfc;};MailQueue[_0x439f('0xf')][_0x439f('0xe')]=function(){this[_0x439f('0x12')]=0x0;this[_0x439f('0x13')]=0x0;for(var _0x4a81c1=0x0;_0x4a81c1=0x0?this[_0x439f('0x17')]:0x0;var _0x51b5d5={'id':this['id'],'available':this[_0x439f('0x17')],'loggedIn':this[_0x439f('0x12')],'name':this[_0x439f('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x3fdbc3=md5(JSON[_0x439f('0x18')](_0x51b5d5));if(this[_0x439f('0x0')]!==_0x3fdbc3){this['md5']=_0x3fdbc3;io['to'](util[_0x439f('0x19')](_0x439f('0x1a'),_0x51b5d5[_0x439f('0x7')]))[_0x439f('0x1b')](_0x439f('0x1c'),_0x51b5d5);}};module[_0x439f('0x1d')]=MailQueue; \ No newline at end of file +var _0xbc36=['format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','online','mailPause','available','stringify'];(function(_0x18dc4e,_0x48a30b){var _0x3a6d10=function(_0x204994){while(--_0x204994){_0x18dc4e['push'](_0x18dc4e['shift']());}};_0x3a6d10(++_0x48a30b);}(_0xbc36,0x171));var _0x6bc3=function(_0x125562,_0x46b1f8){_0x125562=_0x125562-0x0;var _0x1bf93e=_0xbc36[_0x125562];return _0x1bf93e;};'use strict';var _=require(_0x6bc3('0x0'));var md5=require(_0x6bc3('0x1'));var util=require(_0x6bc3('0x2'));var Redis=require(_0x6bc3('0x3'));var config=require(_0x6bc3('0x4'));config[_0x6bc3('0x5')]=_['defaults'](config[_0x6bc3('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6bc3('0x5')]));function MailQueue(_0x35fe8a){this['id']=_0x35fe8a['id']||0x0;this[_0x6bc3('0x6')]=_0x35fe8a[_0x6bc3('0x6')]||'';this[_0x6bc3('0x7')]=_0x35fe8a[_0x6bc3('0x7')]||0xa;this[_0x6bc3('0x8')]=_0x35fe8a[_0x6bc3('0x8')]||_0x6bc3('0x9');this['Agents']=_0x35fe8a[_0x6bc3('0xa')];this[_0x6bc3('0xb')]={};this[_0x6bc3('0xc')]=0x0;this[_0x6bc3('0x1')]='';this[_0x6bc3('0xd')]();this[_0x6bc3('0xe')]();}MailQueue[_0x6bc3('0xf')]['updateRouting']=function(){var _0x324a14=this[_0x6bc3('0xb')][_0x6bc3('0x10')];this[_0x6bc3('0xb')]=_['map'](this[_0x6bc3('0xa')],'id');this[_0x6bc3('0xb')][_0x6bc3('0x10')]=_0x324a14;};MailQueue[_0x6bc3('0xf')]['updateRealtime']=function(){this[_0x6bc3('0x11')]=0x0;this[_0x6bc3('0x12')]=0x0;for(var _0x260303=0x0;_0x260303=0x0?this[_0x6bc3('0x15')]:0x0;var _0x386824={'id':this['id'],'available':this[_0x6bc3('0x15')],'loggedIn':this[_0x6bc3('0x11')],'name':this[_0x6bc3('0x6')],'paused':this[_0x6bc3('0x12')],'waiting':this[_0x6bc3('0xc')]};var _0x27b64f=md5(JSON[_0x6bc3('0x16')](_0x386824));if(this[_0x6bc3('0x1')]!==_0x27b64f){this['md5']=_0x27b64f;io['to'](util[_0x6bc3('0x17')](_0x6bc3('0x18'),_0x386824[_0x6bc3('0x6')]))[_0x6bc3('0x19')](_0x6bc3('0x1a'),_0x386824);}};module[_0x6bc3('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 76dc933..962fd24 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 _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x5ca82d,_0x7d11a0){var _0x397661=function(_0x4ce955){while(--_0x4ce955){_0x5ca82d['push'](_0x5ca82d['shift']());}};_0x397661(++_0x7d11a0);}(_0xadb5,0xad));var _0x5adb=function(_0x31f675,_0x27e338){_0x31f675=_0x31f675-0x0;var _0x274525=_0xadb5[_0x31f675];return _0x274525;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x427f38,_0x34f332){var _0x2f39d7=function(_0x593940){while(--_0x593940){_0x427f38['push'](_0x427f38['shift']());}};_0x2f39d7(++_0x34f332);}(_0x5fc3,0xa8));var _0x35fc=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0x5fc3[_0x274dd7];return _0x148829;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index d7ce698..e87455e 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 _0x55e0=['waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','paused','length','loggedIn','smsPause','available','name','format','sms:queue:%s','emit','exports','lodash','md5','util','ioredis','defaults','redis','localhost','socket.io-emitter','timeout','strategy','beepall','Agents'];(function(_0x34dadf,_0x21dfb8){var _0x2dc59b=function(_0x335b01){while(--_0x335b01){_0x34dadf['push'](_0x34dadf['shift']());}};_0x2dc59b(++_0x21dfb8);}(_0x55e0,0xdc));var _0x055e=function(_0x436641,_0x4afca2){_0x436641=_0x436641-0x0;var _0x29e38f=_0x55e0[_0x436641];return _0x29e38f;};'use strict';var _=require(_0x055e('0x0'));var md5=require(_0x055e('0x1'));var util=require(_0x055e('0x2'));var Redis=require(_0x055e('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x055e('0x4')](config[_0x055e('0x5')],{'host':_0x055e('0x6'),'port':0x18eb});var io=require(_0x055e('0x7'))(new Redis(config[_0x055e('0x5')]));function SmsQueue(_0x196394){this['id']=_0x196394['id']||0x0;this['name']=_0x196394['name']||'';this[_0x055e('0x8')]=_0x196394['timeout']||0xa;this[_0x055e('0x9')]=_0x196394[_0x055e('0x9')]||_0x055e('0xa');this[_0x055e('0xb')]=_0x196394[_0x055e('0xb')];this['mapAgentsId']={};this[_0x055e('0xc')]=0x0;this[_0x055e('0x1')]='';this[_0x055e('0xd')]();this[_0x055e('0xe')]();}SmsQueue[_0x055e('0xf')]['updateRouting']=function(){var _0x56c78a=this[_0x055e('0x10')]['_rr'];this[_0x055e('0x10')]=_[_0x055e('0x11')](this[_0x055e('0xb')],'id');this[_0x055e('0x10')][_0x055e('0x12')]=_0x56c78a;};SmsQueue[_0x055e('0xf')][_0x055e('0xe')]=function(){this['loggedIn']=0x0;this[_0x055e('0x13')]=0x0;for(var _0xb80d83=0x0;_0xb80d83=0x0?this['available']:0x0;var _0x36ef10={'id':this['id'],'available':this[_0x055e('0x17')],'loggedIn':this[_0x055e('0x15')],'name':this[_0x055e('0x18')],'paused':this['paused'],'waiting':this[_0x055e('0xc')]};var _0x3cdd68=md5(JSON['stringify'](_0x36ef10));if(this[_0x055e('0x1')]!==_0x3cdd68){this[_0x055e('0x1')]=_0x3cdd68;io['to'](util[_0x055e('0x19')](_0x055e('0x1a'),_0x36ef10[_0x055e('0x18')]))[_0x055e('0x1b')]('sms_queue:save',_0x36ef10);}};module[_0x055e('0x1c')]=SmsQueue; \ No newline at end of file +var _0x0cfa=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','length','online','smsPause','paused','available','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','redis','socket.io-emitter','name'];(function(_0x15ce3a,_0x1cf22c){var _0x202f3b=function(_0xd3605e){while(--_0xd3605e){_0x15ce3a['push'](_0x15ce3a['shift']());}};_0x202f3b(++_0x1cf22c);}(_0x0cfa,0x18f));var _0xa0cf=function(_0x1d23a5,_0x3840f4){_0x1d23a5=_0x1d23a5-0x0;var _0x314337=_0x0cfa[_0x1d23a5];return _0x314337;};'use strict';var _=require(_0xa0cf('0x0'));var md5=require(_0xa0cf('0x1'));var util=require(_0xa0cf('0x2'));var Redis=require(_0xa0cf('0x3'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xa0cf('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xa0cf('0x5'))(new Redis(config[_0xa0cf('0x4')]));function SmsQueue(_0x19f827){this['id']=_0x19f827['id']||0x0;this[_0xa0cf('0x6')]=_0x19f827['name']||'';this[_0xa0cf('0x7')]=_0x19f827['timeout']||0xa;this[_0xa0cf('0x8')]=_0x19f827['strategy']||_0xa0cf('0x9');this['Agents']=_0x19f827[_0xa0cf('0xa')];this[_0xa0cf('0xb')]={};this[_0xa0cf('0xc')]=0x0;this['md5']='';this[_0xa0cf('0xd')]();this[_0xa0cf('0xe')]();}SmsQueue['prototype']['updateRouting']=function(){var _0xe98d2a=this[_0xa0cf('0xb')][_0xa0cf('0xf')];this['mapAgentsId']=_[_0xa0cf('0x10')](this[_0xa0cf('0xa')],'id');this[_0xa0cf('0xb')][_0xa0cf('0xf')]=_0xe98d2a;};SmsQueue[_0xa0cf('0x11')][_0xa0cf('0xe')]=function(){this[_0xa0cf('0x12')]=0x0;this['paused']=0x0;for(var _0x560c9b=0x0;_0x560c9b=0x0?this[_0xa0cf('0x17')]:0x0;var _0x53a186={'id':this['id'],'available':this[_0xa0cf('0x17')],'loggedIn':this[_0xa0cf('0x12')],'name':this[_0xa0cf('0x6')],'paused':this[_0xa0cf('0x16')],'waiting':this[_0xa0cf('0xc')]};var _0x8bb2ab=md5(JSON['stringify'](_0x53a186));if(this[_0xa0cf('0x1')]!==_0x8bb2ab){this[_0xa0cf('0x1')]=_0x8bb2ab;io['to'](util[_0xa0cf('0x18')](_0xa0cf('0x19'),_0x53a186[_0xa0cf('0x6')]))[_0xa0cf('0x1a')](_0xa0cf('0x1b'),_0x53a186);}};module[_0xa0cf('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 2da66ed..1c5d17e 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 _0xb734=['available','name','stringify','format','whatsapp:queue:%s','exports','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','updateRealtime','loggedIn','length','online','whatsappPause','paused'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xb734,0x165));var _0x4b73=function(_0x2c753c,_0x3378e7){_0x2c753c=_0x2c753c-0x0;var _0x23ba20=_0xb734[_0x2c753c];return _0x23ba20;};'use strict';var _=require('lodash');var md5=require(_0x4b73('0x0'));var util=require(_0x4b73('0x1'));var Redis=require(_0x4b73('0x2'));var config=require(_0x4b73('0x3'));config[_0x4b73('0x4')]=_[_0x4b73('0x5')](config[_0x4b73('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x4b73('0x6'))(new Redis(config[_0x4b73('0x4')]));function WhatsappQueue(_0x50d4ee){this['id']=_0x50d4ee['id']||0x0;this['name']=_0x50d4ee['name']||'';this[_0x4b73('0x7')]=_0x50d4ee[_0x4b73('0x7')]||0xa;this[_0x4b73('0x8')]=_0x50d4ee[_0x4b73('0x8')]||_0x4b73('0x9');this['Agents']=_0x50d4ee[_0x4b73('0xa')];this[_0x4b73('0xb')]={};this[_0x4b73('0xc')]=0x0;this[_0x4b73('0x0')]='';this[_0x4b73('0xd')]();this['updateRealtime']();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x2938f1=this[_0x4b73('0xb')]['_rr'];this[_0x4b73('0xb')]=_['map'](this[_0x4b73('0xa')],'id');this[_0x4b73('0xb')][_0x4b73('0xe')]=_0x2938f1;};WhatsappQueue['prototype'][_0x4b73('0xf')]=function(){this[_0x4b73('0x10')]=0x0;this['paused']=0x0;for(var _0x4d3447=0x0;_0x4d3447=0x0?this['available']:0x0;var _0xe6e36f={'id':this['id'],'available':this[_0x4b73('0x15')],'loggedIn':this[_0x4b73('0x10')],'name':this[_0x4b73('0x16')],'paused':this[_0x4b73('0x14')],'waiting':this[_0x4b73('0xc')]};var _0x2ebc98=md5(JSON[_0x4b73('0x17')](_0xe6e36f));if(this[_0x4b73('0x0')]!==_0x2ebc98){this[_0x4b73('0x0')]=_0x2ebc98;io['to'](util[_0x4b73('0x18')](_0x4b73('0x19'),_0xe6e36f['name']))['emit']('whatsapp_queue:save',_0xe6e36f);}};module[_0x4b73('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x7412=['util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','map','prototype','updateRealtime','loggedIn','length','paused','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x7412,0x8f));var _0x2741=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x7412[_0x556927];return _0x5f1235;};'use strict';var _=require(_0x2741('0x0'));var md5=require(_0x2741('0x1'));var util=require(_0x2741('0x2'));var Redis=require(_0x2741('0x3'));var config=require(_0x2741('0x4'));config[_0x2741('0x5')]=_['defaults'](config[_0x2741('0x5')],{'host':_0x2741('0x6'),'port':0x18eb});var io=require(_0x2741('0x7'))(new Redis(config[_0x2741('0x5')]));function WhatsappQueue(_0x1b62e9){this['id']=_0x1b62e9['id']||0x0;this['name']=_0x1b62e9[_0x2741('0x8')]||'';this[_0x2741('0x9')]=_0x1b62e9[_0x2741('0x9')]||0xa;this[_0x2741('0xa')]=_0x1b62e9[_0x2741('0xa')]||_0x2741('0xb');this[_0x2741('0xc')]=_0x1b62e9[_0x2741('0xc')];this[_0x2741('0xd')]={};this[_0x2741('0xe')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}WhatsappQueue['prototype'][_0x2741('0xf')]=function(){var _0x31c66b=this[_0x2741('0xd')]['_rr'];this[_0x2741('0xd')]=_[_0x2741('0x10')](this[_0x2741('0xc')],'id');this[_0x2741('0xd')]['_rr']=_0x31c66b;};WhatsappQueue[_0x2741('0x11')][_0x2741('0x12')]=function(){this[_0x2741('0x13')]=0x0;this['paused']=0x0;for(var _0x24b83c=0x0;_0x24b83c=0x0?this[_0x2741('0x16')]:0x0;var _0x4404f8={'id':this['id'],'available':this[_0x2741('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x2741('0x8')],'paused':this[_0x2741('0x15')],'waiting':this[_0x2741('0xe')]};var _0x85c9ab=md5(JSON[_0x2741('0x17')](_0x4404f8));if(this['md5']!==_0x85c9ab){this[_0x2741('0x1')]=_0x85c9ab;io['to'](util[_0x2741('0x18')](_0x2741('0x19'),_0x4404f8[_0x2741('0x8')]))[_0x2741('0x1a')](_0x2741('0x1b'),_0x4404f8);}};module[_0x2741('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index ce069c5..2ca2e1b 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x4d708f,_0x27bb02){var _0x3983e8=function(_0x58dc8f){while(--_0x58dc8f){_0x4d708f['push'](_0x4d708f['shift']());}};_0x3983e8(++_0x27bb02);}(_0xb10b,0x12a));var _0xbb10=function(_0x56c7c0,_0x463d97){_0x56c7c0=_0x56c7c0-0x0;var _0x666b9a=_0xb10b[_0x56c7c0];return _0x666b9a;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 2bd5a88..b7900a5 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 _0x6d14=['updateChatInteraction','addTags','../client','update','Request','UpdateChatInteraction'];(function(_0x90c02,_0x8df543){var _0x3a3c05=function(_0x6ad79e){while(--_0x6ad79e){_0x90c02['push'](_0x90c02['shift']());}};_0x3a3c05(++_0x8df543);}(_0x6d14,0xce));var _0x46d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d14[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x46d1('0x0'));exports[_0x46d1('0x1')]=function(_0x1e1d3d,_0x36cc49){return client[_0x46d1('0x2')](_0x46d1('0x3'),{'body':_0x36cc49,'options':{'where':{'id':_0x1e1d3d}},'log':_0x46d1('0x4')});};exports[_0x46d1('0x5')]=function(_0x3430c5,_0x4c87d0){return client[_0x46d1('0x2')]('AddTagsToChatInteraction',{'body':_0x4c87d0,'options':{'where':{'id':_0x3430c5}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xa0b7=['Request','addTagsToChatInteraction','../client','update','updateChatInteraction'];(function(_0x14b020,_0x5f3bc1){var _0x34965d=function(_0x1d8f8c){while(--_0x1d8f8c){_0x14b020['push'](_0x14b020['shift']());}};_0x34965d(++_0x5f3bc1);}(_0xa0b7,0x93));var _0x7a0b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa0b7[_0xfae23b];return _0x200640;};'use strict';var client=require(_0x7a0b('0x0'));exports[_0x7a0b('0x1')]=function(_0x231b14,_0x5d5f63){return client['Request']('UpdateChatInteraction',{'body':_0x5d5f63,'options':{'where':{'id':_0x231b14}},'log':_0x7a0b('0x2')});};exports['addTags']=function(_0x3fa4bf,_0x2cda09){return client[_0x7a0b('0x3')]('AddTagsToChatInteraction',{'body':_0x2cda09,'options':{'where':{'id':_0x3fa4bf}},'log':_0x7a0b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 204986f..c463f64 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 _0x1d70=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0x510b08,_0x2c7671){var _0x2cde91=function(_0xc0702a){while(--_0xc0702a){_0x510b08['push'](_0x510b08['shift']());}};_0x2cde91(++_0x2c7671);}(_0x1d70,0x1de));var _0x01d7=function(_0xd2c45d,_0x4f303b){_0xd2c45d=_0xd2c45d-0x0;var _0x2fb10c=_0x1d70[_0xd2c45d];return _0x2fb10c;};'use strict';var client=require(_0x01d7('0x0'));exports[_0x01d7('0x1')]=function(_0x482a28){return client[_0x01d7('0x2')](_0x01d7('0x3'),{'body':_0x482a28,'log':_0x01d7('0x4')});}; \ No newline at end of file +var _0xd7f2=['create','Request','createChatMessage','../client'];(function(_0x1e948a,_0x4188f3){var _0xd6959=function(_0x435550){while(--_0x435550){_0x1e948a['push'](_0x1e948a['shift']());}};_0xd6959(++_0x4188f3);}(_0xd7f2,0xef));var _0x2d7f=function(_0x385757,_0x1d67e4){_0x385757=_0x385757-0x0;var _0x27e764=_0xd7f2[_0x385757];return _0x27e764;};'use strict';var client=require(_0x2d7f('0x0'));exports[_0x2d7f('0x1')]=function(_0x3abb9f){return client[_0x2d7f('0x2')]('CreateChatMessage',{'body':_0x3abb9f,'log':_0x2d7f('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 73071fe..87c5a82 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 _0xea44=['chatPause','../client','getChatQueues','Request','GetChatQueue','timeout','strategy','Agents','name','online'];(function(_0x1d70b9,_0x39fd1b){var _0xfc3e9f=function(_0x37c32d){while(--_0x37c32d){_0x1d70b9['push'](_0x1d70b9['shift']());}};_0xfc3e9f(++_0x39fd1b);}(_0xea44,0x1a5));var _0x4ea4=function(_0xb64fb5,_0x196555){_0xb64fb5=_0xb64fb5-0x0;var _0x55dbd5=_0xea44[_0xb64fb5];return _0x55dbd5;};'use strict';var client=require(_0x4ea4('0x0'));exports[_0x4ea4('0x1')]=function(){return function(){return client[_0x4ea4('0x2')](_0x4ea4('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x4ea4('0x4'),_0x4ea4('0x5')],'include':[{'model':'User','as':_0x4ea4('0x6'),'attributes':['id',_0x4ea4('0x7'),_0x4ea4('0x8'),_0x4ea4('0x9')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xf873=['GetChatQueue','name','timeout','strategy','User','Agents','chatPause','getChatQueues','Request'];(function(_0x3eea06,_0x303898){var _0x47e4c4=function(_0x2e27fe){while(--_0x2e27fe){_0x3eea06['push'](_0x3eea06['shift']());}};_0x47e4c4(++_0x303898);}(_0xf873,0xb2));var _0x3f87=function(_0xfd177a,_0x2ff02a){_0xfd177a=_0xfd177a-0x0;var _0x329ef9=_0xf873[_0xfd177a];return _0x329ef9;};'use strict';var client=require('../client');exports[_0x3f87('0x0')]=function(){return function(){return client[_0x3f87('0x1')](_0x3f87('0x2'),{'options':{'raw':![],'attributes':['id',_0x3f87('0x3'),_0x3f87('0x4'),_0x3f87('0x5')],'include':[{'model':_0x3f87('0x6'),'as':_0x3f87('0x7'),'attributes':['id',_0x3f87('0x3'),'online',_0x3f87('0x8')]}]},'log':_0x3f87('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 86710e6..5f0b618 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 _0xe062=['Request','CreateChatQueueReport','UpdateChatQueueReport','../client','create'];(function(_0xd745e9,_0x537598){var _0x5f02a2=function(_0x475271){while(--_0x475271){_0xd745e9['push'](_0xd745e9['shift']());}};_0x5f02a2(++_0x537598);}(_0xe062,0xd5));var _0x2e06=function(_0x4a250c,_0x19110d){_0x4a250c=_0x4a250c-0x0;var _0x276a2f=_0xe062[_0x4a250c];return _0x276a2f;};'use strict';var client=require(_0x2e06('0x0'));exports[_0x2e06('0x1')]=function(_0x4827bc){return client[_0x2e06('0x2')](_0x2e06('0x3'),{'body':_0x4827bc,'log':_0x2e06('0x3')});};exports['update']=function(_0x4d80de,_0x1a9d7d){return client[_0x2e06('0x2')]('UpdateChatQueueReport',{'body':_0x1a9d7d,'options':{'where':{'uniqueid':_0x4d80de},'order':[['id','DESC']],'limit':0x1},'log':_0x2e06('0x4')});}; \ No newline at end of file +var _0xccdc=['update','Request','UpdateChatQueueReport','DESC','../client','create','CreateChatQueueReport'];(function(_0xb4ec3a,_0x2bace0){var _0x1b83db=function(_0x5278f3){while(--_0x5278f3){_0xb4ec3a['push'](_0xb4ec3a['shift']());}};_0x1b83db(++_0x2bace0);}(_0xccdc,0x1c4));var _0xcccd=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xccdc[_0x6cf19c];return _0xce14f3;};'use strict';var client=require(_0xcccd('0x0'));exports[_0xcccd('0x1')]=function(_0x48efea){return client['Request'](_0xcccd('0x2'),{'body':_0x48efea,'log':_0xcccd('0x2')});};exports[_0xcccd('0x3')]=function(_0x183a99,_0x41cab2){return client[_0xcccd('0x4')](_0xcccd('0x5'),{'body':_0x41cab2,'options':{'where':{'uniqueid':_0x183a99},'order':[['id',_0xcccd('0x6')]],'limit':0x1},'log':_0xcccd('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index b0aab0e..cc205db 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x5a7e3c,_0xdc9219){var _0x59252b=function(_0x29655c){while(--_0x29655c){_0x5a7e3c['push'](_0x5a7e3c['shift']());}};_0x59252b(++_0xdc9219);}(_0x7a54,0x106));var _0x47a5=function(_0x27c6de,_0x3d7bf9){_0x27c6de=_0x27c6de-0x0;var _0x3c8bf2=_0x7a54[_0x27c6de];return _0x3c8bf2;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x515e24,_0x70620b){var _0xe6ee8=function(_0x26c517){while(--_0x26c517){_0x515e24['push'](_0x515e24['shift']());}};_0xe6ee8(++_0x70620b);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 c9d55cb..212b119 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 _0xee99=['../client','Request','createFaxMessage'];(function(_0x4cfc9e,_0x319ad4){var _0x3618c9=function(_0x31b17f){while(--_0x31b17f){_0x4cfc9e['push'](_0x4cfc9e['shift']());}};_0x3618c9(++_0x319ad4);}(_0xee99,0x9c));var _0x9ee9=function(_0x52e3f5,_0x1cfd3b){_0x52e3f5=_0x52e3f5-0x0;var _0x55f48e=_0xee99[_0x52e3f5];return _0x55f48e;};'use strict';var client=require(_0x9ee9('0x0'));exports['create']=function(_0x4f5f5c){return client[_0x9ee9('0x1')]('CreateFaxMessage',{'body':_0x4f5f5c,'log':_0x9ee9('0x2')});}; \ No newline at end of file +var _0xfef1=['../client','create','Request','CreateFaxMessage'];(function(_0x27dbcf,_0x435eba){var _0xdc91bc=function(_0x21a1f0){while(--_0x21a1f0){_0x27dbcf['push'](_0x27dbcf['shift']());}};_0xdc91bc(++_0x435eba);}(_0xfef1,0x1d8));var _0x1fef=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xfef1[_0x4ea69d];return _0x5318e0;};'use strict';var client=require(_0x1fef('0x0'));exports[_0x1fef('0x1')]=function(_0x4cc777){return client[_0x1fef('0x2')](_0x1fef('0x3'),{'body':_0x4cc777,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 82daa29..93c9f52 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 _0x1e6a=['name','strategy','User','Agents','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue'];(function(_0x4f35a4,_0x3137e2){var _0x167f59=function(_0x2f7e9c){while(--_0x2f7e9c){_0x4f35a4['push'](_0x4f35a4['shift']());}};_0x167f59(++_0x3137e2);}(_0x1e6a,0x10a));var _0xa1e6=function(_0x439b5c,_0x103291){_0x439b5c=_0x439b5c-0x0;var _0x1ec477=_0x1e6a[_0x439b5c];return _0x1ec477;};'use strict';var client=require(_0xa1e6('0x0'));exports[_0xa1e6('0x1')]=function(){return function(){return client[_0xa1e6('0x2')](_0xa1e6('0x3'),{'options':{'raw':![],'attributes':['id',_0xa1e6('0x4'),'timeout',_0xa1e6('0x5')],'include':[{'model':_0xa1e6('0x6'),'as':_0xa1e6('0x7'),'attributes':['id',_0xa1e6('0x4'),_0xa1e6('0x8'),_0xa1e6('0x9')]}]},'log':_0xa1e6('0x1')});};}; \ No newline at end of file +var _0xe35e=['strategy','User','online','faxPause','../client','getFaxQueues','Request','name','timeout'];(function(_0x200e0c,_0x5e715d){var _0x2b2175=function(_0x2eab0e){while(--_0x2eab0e){_0x200e0c['push'](_0x200e0c['shift']());}};_0x2b2175(++_0x5e715d);}(_0xe35e,0x148));var _0xee35=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0xe35e[_0x269ee8];return _0x4d98bd;};'use strict';var client=require(_0xee35('0x0'));exports[_0xee35('0x1')]=function(){return function(){return client[_0xee35('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xee35('0x3'),_0xee35('0x4'),_0xee35('0x5')],'include':[{'model':_0xee35('0x6'),'as':'Agents','attributes':['id','name',_0xee35('0x7'),_0xee35('0x8')]}]},'log':_0xee35('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 287e538..ad46a9a 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 _0x3805=['CreateFaxQueueReport','update','UpdateFaxQueueReport','../client','create','Request'];(function(_0x5b9168,_0x203c8a){var _0x1c8403=function(_0x59b381){while(--_0x59b381){_0x5b9168['push'](_0x5b9168['shift']());}};_0x1c8403(++_0x203c8a);}(_0x3805,0x111));var _0x5380=function(_0x369a41,_0x5ed95c){_0x369a41=_0x369a41-0x0;var _0x16807d=_0x3805[_0x369a41];return _0x16807d;};'use strict';var client=require(_0x5380('0x0'));exports[_0x5380('0x1')]=function(_0x40e601){return client[_0x5380('0x2')](_0x5380('0x3'),{'body':_0x40e601,'log':_0x5380('0x3')});};exports[_0x5380('0x4')]=function(_0x1b7979,_0x1a44c1){return client[_0x5380('0x2')](_0x5380('0x5'),{'body':_0x1a44c1,'options':{'where':{'uniqueid':_0x1b7979},'order':[['id','DESC']],'limit':0x1},'log':_0x5380('0x5')});}; \ No newline at end of file +var _0x6a84=['CreateFaxQueueReport','Request','DESC','UpdateFaxQueueReport','create'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x6a84,0x158));var _0x46a8=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x6a84[_0x543084];return _0x306a57;};'use strict';var client=require('../client');exports[_0x46a8('0x0')]=function(_0x57160b){return client['Request'](_0x46a8('0x1'),{'body':_0x57160b,'log':_0x46a8('0x1')});};exports['update']=function(_0x4bd3c1,_0x2765a3){return client[_0x46a8('0x2')]('UpdateFaxQueueReport',{'body':_0x2765a3,'options':{'where':{'uniqueid':_0x4bd3c1},'order':[['id',_0x46a8('0x3')]],'limit':0x1},'log':_0x46a8('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index c582ad7..5d5e270 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 _0xbc9a=['name','Interval','Intervals','interval','../client'];(function(_0x2d55ac,_0x45314d){var _0xef654a=function(_0x47a3d3){while(--_0x47a3d3){_0x2d55ac['push'](_0x2d55ac['shift']());}};_0xef654a(++_0x45314d);}(_0xbc9a,0xf4));var _0xabc9=function(_0x20dda3,_0xfcb775){_0x20dda3=_0x20dda3-0x0;var _0x547b71=_0xbc9a[_0x20dda3];return _0x547b71;};'use strict';var client=require(_0xabc9('0x0'));exports['getIntervals']=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xabc9('0x1')],'include':[{'model':_0xabc9('0x2'),'as':_0xabc9('0x3'),'attributes':['id',_0xabc9('0x1'),_0xabc9('0x4')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x068d=['../client','Request','GetInterval','Interval','Intervals','name','interval','getIntervals'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x068d,0x68));var _0xd068=function(_0x19f9d7,_0x614db2){_0x19f9d7=_0x19f9d7-0x0;var _0x4d377a=_0x068d[_0x19f9d7];return _0x4d377a;};'use strict';var client=require(_0xd068('0x0'));exports['getIntervals']=function(){return function(){return client[_0xd068('0x1')](_0xd068('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xd068('0x3'),'as':_0xd068('0x4'),'attributes':['id',_0xd068('0x5'),_0xd068('0x6')]}]},'log':_0xd068('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index badc49b..7a35be7 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 _0xd943=['addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x572011,_0xe8a4){var _0x133169=function(_0xa67968){while(--_0xa67968){_0x572011['push'](_0x572011['shift']());}};_0x133169(++_0xe8a4);}(_0xd943,0x15d));var _0x3d94=function(_0x47b5c7,_0x16c96c){_0x47b5c7=_0x47b5c7-0x0;var _0xa283f8=_0xd943[_0x47b5c7];return _0xa283f8;};'use strict';var client=require(_0x3d94('0x0'));exports[_0x3d94('0x1')]=function(_0x55353d,_0x440dd8){return client['Request'](_0x3d94('0x2'),{'body':_0x440dd8,'options':{'where':{'id':_0x55353d}},'log':_0x3d94('0x3')});};exports[_0x3d94('0x4')]=function(_0xc13b61,_0xaf8962){return client['Request']('AddTagsToMailInteraction',{'body':_0xaf8962,'options':{'where':{'id':_0xc13b61}},'log':_0x3d94('0x5')});}; \ No newline at end of file +var _0x7708=['update','AddTagsToMailInteraction','../client'];(function(_0x1f027d,_0x4eb301){var _0x12e5ee=function(_0x28ebb8){while(--_0x28ebb8){_0x1f027d['push'](_0x1f027d['shift']());}};_0x12e5ee(++_0x4eb301);}(_0x7708,0x188));var _0x8770=function(_0x5c4585,_0x3d0eab){_0x5c4585=_0x5c4585-0x0;var _0x21dede=_0x7708[_0x5c4585];return _0x21dede;};'use strict';var client=require(_0x8770('0x0'));exports[_0x8770('0x1')]=function(_0x5ce108,_0x141ddf){return client['Request']('UpdateMailInteraction',{'body':_0x141ddf,'options':{'where':{'id':_0x5ce108}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x182d52,_0x1a796d){return client['Request'](_0x8770('0x2'),{'body':_0x1a796d,'options':{'where':{'id':_0x182d52}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index c3b33c4..0b0c148 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 _0xac2e=['../client','create','CreateMailMessage','createMailMessage'];(function(_0x1f6f84,_0x2bab55){var _0x177f40=function(_0x384ab4){while(--_0x384ab4){_0x1f6f84['push'](_0x1f6f84['shift']());}};_0x177f40(++_0x2bab55);}(_0xac2e,0xb0));var _0xeac2=function(_0x32825e,_0x5981c1){_0x32825e=_0x32825e-0x0;var _0x119578=_0xac2e[_0x32825e];return _0x119578;};'use strict';var client=require(_0xeac2('0x0'));exports[_0xeac2('0x1')]=function(_0x2f478b){return client['Request'](_0xeac2('0x2'),{'body':_0x2f478b,'log':_0xeac2('0x3')});}; \ No newline at end of file +var _0x5cdb=['CreateMailMessage','../client','create'];(function(_0x40973b,_0x5ca6b1){var _0x4c9765=function(_0x19077b){while(--_0x19077b){_0x40973b['push'](_0x40973b['shift']());}};_0x4c9765(++_0x5ca6b1);}(_0x5cdb,0x18d));var _0xb5cd=function(_0x1ebdca,_0x44732d){_0x1ebdca=_0x1ebdca-0x0;var _0x106295=_0x5cdb[_0x1ebdca];return _0x106295;};'use strict';var client=require(_0xb5cd('0x0'));exports[_0xb5cd('0x1')]=function(_0x8a9092){return client['Request'](_0xb5cd('0x2'),{'body':_0x8a9092,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index e614b38..ddb758d 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 _0x9ba5=['Request','name','strategy','User','Agents','online','mailPause','../client','getMailQueues'];(function(_0x2cb3eb,_0x4d83aa){var _0x2759ee=function(_0x4108a0){while(--_0x4108a0){_0x2cb3eb['push'](_0x2cb3eb['shift']());}};_0x2759ee(++_0x4d83aa);}(_0x9ba5,0x139));var _0x59ba=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9ba5[_0x42cae2];return _0x5f256f;};'use strict';var client=require(_0x59ba('0x0'));exports[_0x59ba('0x1')]=function(){return function(){return client[_0x59ba('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x59ba('0x3'),'timeout',_0x59ba('0x4')],'include':[{'model':_0x59ba('0x5'),'as':_0x59ba('0x6'),'attributes':['id',_0x59ba('0x3'),_0x59ba('0x7'),_0x59ba('0x8')]}]},'log':_0x59ba('0x1')});};}; \ No newline at end of file +var _0x859b=['name','online','mailPause','../client','getMailQueues','Request','GetMailQueue'];(function(_0x1f029c,_0x1e2b73){var _0x3ebbea=function(_0x441626){while(--_0x441626){_0x1f029c['push'](_0x1f029c['shift']());}};_0x3ebbea(++_0x1e2b73);}(_0x859b,0xf8));var _0xb859=function(_0x2ad7f4,_0x25ffb3){_0x2ad7f4=_0x2ad7f4-0x0;var _0x525f20=_0x859b[_0x2ad7f4];return _0x525f20;};'use strict';var client=require(_0xb859('0x0'));exports[_0xb859('0x1')]=function(){return function(){return client[_0xb859('0x2')](_0xb859('0x3'),{'options':{'raw':![],'attributes':['id',_0xb859('0x4'),'timeout','strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0xb859('0x4'),_0xb859('0x5'),_0xb859('0x6')]}]},'log':_0xb859('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index b72f84e..e15984e 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 _0x5a2a=['UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport','update'];(function(_0x3fe0fc,_0x17b426){var _0x2c2d40=function(_0x5b214f){while(--_0x5b214f){_0x3fe0fc['push'](_0x3fe0fc['shift']());}};_0x2c2d40(++_0x17b426);}(_0x5a2a,0x67));var _0xa5a2=function(_0x5b4b29,_0x4faa7c){_0x5b4b29=_0x5b4b29-0x0;var _0x3cc869=_0x5a2a[_0x5b4b29];return _0x3cc869;};'use strict';var client=require(_0xa5a2('0x0'));exports[_0xa5a2('0x1')]=function(_0x496b02){return client[_0xa5a2('0x2')](_0xa5a2('0x3'),{'body':_0x496b02,'log':'CreateMailQueueReport'});};exports[_0xa5a2('0x4')]=function(_0x1624b2,_0x349c18){return client[_0xa5a2('0x2')](_0xa5a2('0x5'),{'body':_0x349c18,'options':{'where':{'uniqueid':_0x1624b2},'order':[['id','DESC']],'limit':0x1},'log':_0xa5a2('0x5')});}; \ No newline at end of file +var _0xea92=['update','UpdateMailQueueReport','DESC','create','Request','CreateMailQueueReport'];(function(_0x1e0357,_0x5ae9f8){var _0x3af747=function(_0x15b29e){while(--_0x15b29e){_0x1e0357['push'](_0x1e0357['shift']());}};_0x3af747(++_0x5ae9f8);}(_0xea92,0x171));var _0x2ea9=function(_0x153f59,_0xcfdfb){_0x153f59=_0x153f59-0x0;var _0x1483c6=_0xea92[_0x153f59];return _0x1483c6;};'use strict';var client=require('../client');exports[_0x2ea9('0x0')]=function(_0x404cc4){return client[_0x2ea9('0x1')](_0x2ea9('0x2'),{'body':_0x404cc4,'log':'CreateMailQueueReport'});};exports[_0x2ea9('0x3')]=function(_0x37b1a2,_0x46134b){return client['Request'](_0x2ea9('0x4'),{'body':_0x46134b,'options':{'where':{'uniqueid':_0x37b1a2},'order':[['id',_0x2ea9('0x5')]],'limit':0x1},'log':_0x2ea9('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index a2bd6b5..79f66b0 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 _0x5c0a=['update','Request','UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x6c973d,_0xbcd1e5){var _0x2e9fea=function(_0x93282f){while(--_0x93282f){_0x6c973d['push'](_0x6c973d['shift']());}};_0x2e9fea(++_0xbcd1e5);}(_0x5c0a,0x1e9));var _0xa5c0=function(_0x549d16,_0x4d069a){_0x549d16=_0x549d16-0x0;var _0x344ccc=_0x5c0a[_0x549d16];return _0x344ccc;};'use strict';var client=require(_0xa5c0('0x0'));exports[_0xa5c0('0x1')]=function(_0x591dde,_0x192955){return client[_0xa5c0('0x2')](_0xa5c0('0x3'),{'body':_0x192955,'options':{'where':{'id':_0x591dde}},'log':'updateOpenchannelInteraction'});};exports[_0xa5c0('0x4')]=function(_0x4f14b2,_0x44c9df){return client[_0xa5c0('0x2')](_0xa5c0('0x5'),{'body':_0x44c9df,'options':{'where':{'id':_0x4f14b2}},'log':_0xa5c0('0x6')});}; \ No newline at end of file +var _0xb252=['addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x2c98f5,_0x3505bd){var _0x1d5794=function(_0x4b511b){while(--_0x4b511b){_0x2c98f5['push'](_0x2c98f5['shift']());}};_0x1d5794(++_0x3505bd);}(_0xb252,0x119));var _0x2b25=function(_0x13d995,_0x30e77d){_0x13d995=_0x13d995-0x0;var _0x30999a=_0xb252[_0x13d995];return _0x30999a;};'use strict';var client=require('../client');exports[_0x2b25('0x0')]=function(_0x4525b4,_0x501147){return client[_0x2b25('0x1')](_0x2b25('0x2'),{'body':_0x501147,'options':{'where':{'id':_0x4525b4}},'log':_0x2b25('0x3')});};exports[_0x2b25('0x4')]=function(_0x298bbf,_0x20ec53){return client['Request'](_0x2b25('0x5'),{'body':_0x20ec53,'options':{'where':{'id':_0x298bbf}},'log':_0x2b25('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 84683b6..bee49ef 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 _0xaf80=['create','Request','createOpenchannelMessage','../client'];(function(_0xa6e519,_0x3f267b){var _0x540c5d=function(_0x1d6317){while(--_0x1d6317){_0xa6e519['push'](_0xa6e519['shift']());}};_0x540c5d(++_0x3f267b);}(_0xaf80,0x127));var _0x0af8=function(_0x2ffdcf,_0xef57a6){_0x2ffdcf=_0x2ffdcf-0x0;var _0x38d3b1=_0xaf80[_0x2ffdcf];return _0x38d3b1;};'use strict';var client=require(_0x0af8('0x0'));exports[_0x0af8('0x1')]=function(_0x2e7f6b){return client[_0x0af8('0x2')]('CreateOpenchannelMessage',{'body':_0x2e7f6b,'log':_0x0af8('0x3')});}; \ No newline at end of file +var _0xb3c3=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create'];(function(_0x38946b,_0x2bc5c4){var _0x25c440=function(_0x1b92aa){while(--_0x1b92aa){_0x38946b['push'](_0x38946b['shift']());}};_0x25c440(++_0x2bc5c4);}(_0xb3c3,0x18e));var _0x3b3c=function(_0x4bb5c9,_0x295b27){_0x4bb5c9=_0x4bb5c9-0x0;var _0x106534=_0xb3c3[_0x4bb5c9];return _0x106534;};'use strict';var client=require(_0x3b3c('0x0'));exports[_0x3b3c('0x1')]=function(_0x8be203){return client['Request'](_0x3b3c('0x2'),{'body':_0x8be203,'log':_0x3b3c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 28623d8..875184c 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 _0xce38=['User','Agents','online','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','name','strategy'];(function(_0x406115,_0x19f7a1){var _0xbbabdb=function(_0x28554d){while(--_0x28554d){_0x406115['push'](_0x406115['shift']());}};_0xbbabdb(++_0x19f7a1);}(_0xce38,0x163));var _0x8ce3=function(_0x194acc,_0x16a88a){_0x194acc=_0x194acc-0x0;var _0x2b7aab=_0xce38[_0x194acc];return _0x2b7aab;};'use strict';var client=require(_0x8ce3('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x8ce3('0x1')](_0x8ce3('0x2'),{'options':{'raw':![],'attributes':['id',_0x8ce3('0x3'),'timeout',_0x8ce3('0x4')],'include':[{'model':_0x8ce3('0x5'),'as':_0x8ce3('0x6'),'attributes':['id','name',_0x8ce3('0x7'),'openchannelPause']}]},'log':_0x8ce3('0x8')});};}; \ No newline at end of file +var _0x09a0=['name','strategy','User','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0x180abe,_0x36eada){var _0x42ab7a=function(_0xccdb5a){while(--_0xccdb5a){_0x180abe['push'](_0x180abe['shift']());}};_0x42ab7a(++_0x36eada);}(_0x09a0,0x13c));var _0x009a=function(_0x241695,_0x1a8e19){_0x241695=_0x241695-0x0;var _0x5792f0=_0x09a0[_0x241695];return _0x5792f0;};'use strict';var client=require(_0x009a('0x0'));exports[_0x009a('0x1')]=function(){return function(){return client[_0x009a('0x2')](_0x009a('0x3'),{'options':{'raw':![],'attributes':['id',_0x009a('0x4'),'timeout',_0x009a('0x5')],'include':[{'model':_0x009a('0x6'),'as':_0x009a('0x7'),'attributes':['id',_0x009a('0x4'),_0x009a('0x8'),_0x009a('0x9')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 12545fb..5cafacf 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 _0xc1d8=['UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc1d8,0xec));var _0x8c1d=function(_0x3079a6,_0x4c0bf2){_0x3079a6=_0x3079a6-0x0;var _0x55cc26=_0xc1d8[_0x3079a6];return _0x55cc26;};'use strict';var client=require(_0x8c1d('0x0'));exports[_0x8c1d('0x1')]=function(_0x5d1851){return client[_0x8c1d('0x2')](_0x8c1d('0x3'),{'body':_0x5d1851,'log':_0x8c1d('0x3')});};exports['update']=function(_0x58e86f,_0x1b72ef){return client[_0x8c1d('0x2')](_0x8c1d('0x4'),{'body':_0x1b72ef,'options':{'where':{'uniqueid':_0x58e86f},'order':[['id',_0x8c1d('0x5')]],'limit':0x1},'log':_0x8c1d('0x4')});}; \ No newline at end of file +var _0x7c35=['Request','CreateOpenchannelQueueReport','update','DESC','create'];(function(_0x9be28f,_0x231334){var _0xa9f52d=function(_0x239dad){while(--_0x239dad){_0x9be28f['push'](_0x9be28f['shift']());}};_0xa9f52d(++_0x231334);}(_0x7c35,0x135));var _0x57c3=function(_0x1815ca,_0x3c440f){_0x1815ca=_0x1815ca-0x0;var _0x33a318=_0x7c35[_0x1815ca];return _0x33a318;};'use strict';var client=require('../client');exports[_0x57c3('0x0')]=function(_0x25b947){return client[_0x57c3('0x1')](_0x57c3('0x2'),{'body':_0x25b947,'log':_0x57c3('0x2')});};exports[_0x57c3('0x3')]=function(_0x33d06e,_0x5519f2){return client[_0x57c3('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x5519f2,'options':{'where':{'uniqueid':_0x33d06e},'order':[['id',_0x57c3('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 6134c29..1ccdf1e 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 _0x66fa=['../client','update','UpdateSmsInteraction','updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x5d1718,_0x3c0926){var _0x1cd8ff=function(_0xd52d24){while(--_0xd52d24){_0x5d1718['push'](_0x5d1718['shift']());}};_0x1cd8ff(++_0x3c0926);}(_0x66fa,0x168));var _0xa66f=function(_0x2df231,_0x130ec1){_0x2df231=_0x2df231-0x0;var _0x21f126=_0x66fa[_0x2df231];return _0x21f126;};'use strict';var client=require(_0xa66f('0x0'));exports[_0xa66f('0x1')]=function(_0xab19a,_0x4d9703){return client['Request'](_0xa66f('0x2'),{'body':_0x4d9703,'options':{'where':{'id':_0xab19a}},'log':_0xa66f('0x3')});};exports[_0xa66f('0x4')]=function(_0x2e663b,_0x2143e6){return client[_0xa66f('0x5')](_0xa66f('0x6'),{'body':_0x2143e6,'options':{'where':{'id':_0x2e663b}},'log':_0xa66f('0x7')});}; \ No newline at end of file +var _0x9658=['addTagsToSmsInteraction','../client','UpdateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x287cf8,_0x5cedf2){var _0x132e0f=function(_0x2ac0b8){while(--_0x2ac0b8){_0x287cf8['push'](_0x287cf8['shift']());}};_0x132e0f(++_0x5cedf2);}(_0x9658,0x6f));var _0x8965=function(_0x456a4b,_0x51df8){_0x456a4b=_0x456a4b-0x0;var _0x42957c=_0x9658[_0x456a4b];return _0x42957c;};'use strict';var client=require(_0x8965('0x0'));exports['update']=function(_0x1f5bb6,_0xa89576){return client['Request'](_0x8965('0x1'),{'body':_0xa89576,'options':{'where':{'id':_0x1f5bb6}},'log':'updateSmsInteraction'});};exports[_0x8965('0x2')]=function(_0x761b45,_0x254d05){return client['Request'](_0x8965('0x3'),{'body':_0x254d05,'options':{'where':{'id':_0x761b45}},'log':_0x8965('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 023c85d..57b9f53 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 _0x9512=['create','Request','CreateSmsMessage','../client'];(function(_0x459219,_0x1cb666){var _0x36d8e1=function(_0x26ed06){while(--_0x26ed06){_0x459219['push'](_0x459219['shift']());}};_0x36d8e1(++_0x1cb666);}(_0x9512,0x17b));var _0x2951=function(_0x20a590,_0x1e8a6d){_0x20a590=_0x20a590-0x0;var _0x2e1b41=_0x9512[_0x20a590];return _0x2e1b41;};'use strict';var client=require(_0x2951('0x0'));exports[_0x2951('0x1')]=function(_0x26aa65){return client[_0x2951('0x2')](_0x2951('0x3'),{'body':_0x26aa65,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xf902=['Request','createSmsMessage','../client','create'];(function(_0x24a654,_0x2ca441){var _0x458651=function(_0x1ecda1){while(--_0x1ecda1){_0x24a654['push'](_0x24a654['shift']());}};_0x458651(++_0x2ca441);}(_0xf902,0x72));var _0x2f90=function(_0x324ad3,_0x268d10){_0x324ad3=_0x324ad3-0x0;var _0x35f76a=_0xf902[_0x324ad3];return _0x35f76a;};'use strict';var client=require(_0x2f90('0x0'));exports[_0x2f90('0x1')]=function(_0x2297cc){return client[_0x2f90('0x2')]('CreateSmsMessage',{'body':_0x2297cc,'log':_0x2f90('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 34902ce..9d3a698 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 _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x18e9ef,_0x2943ec){var _0x1b9dde=function(_0x3531d9){while(--_0x3531d9){_0x18e9ef['push'](_0x18e9ef['shift']());}};_0x1b9dde(++_0x2943ec);}(_0x70e0,0x17b));var _0x070e=function(_0x3b5e37,_0x2b4955){_0x3b5e37=_0x3b5e37-0x0;var _0x4da470=_0x70e0[_0x3b5e37];return _0x4da470;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x5c6244,_0x112ab8){var _0x5800ce=function(_0x304e3d){while(--_0x304e3d){_0x5c6244['push'](_0x5c6244['shift']());}};_0x5800ce(++_0x112ab8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index c85643c..d33fd57 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(_0x134e6f,_0x58c616){var _0x519a52=function(_0xbaad8a){while(--_0xbaad8a){_0x134e6f['push'](_0x134e6f['shift']());}};_0x519a52(++_0x58c616);}(_0x70e0,0x17b));var _0x070e=function(_0xcea36,_0x4f217b){_0xcea36=_0xcea36-0x0;var _0x4fec7f=_0x70e0[_0xcea36];return _0x4fec7f;};'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 _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x5a4392,_0x10c285){var _0x566468=function(_0x3d2a8a){while(--_0x3d2a8a){_0x5a4392['push'](_0x5a4392['shift']());}};_0x566468(++_0x10c285);}(_0x3e74,0x175));var _0x43e7=function(_0x9425c1,_0x2c85ef){_0x9425c1=_0x9425c1-0x0;var _0x40ee87=_0x3e74[_0x9425c1];return _0x40ee87;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index eaaba4d..ba4dde9 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(_0x5e906f,_0x35ad10){var _0x3d09af=function(_0x79babf){while(--_0x79babf){_0x5e906f['push'](_0x5e906f['shift']());}};_0x3d09af(++_0x35ad10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x1f2373,_0x14f5cc){var _0x4526e4=function(_0x34ef7d){while(--_0x34ef7d){_0x1f2373['push'](_0x1f2373['shift']());}};_0x4526e4(++_0x14f5cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 32ffa8d..a6da426 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 _0x0272=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags'];(function(_0x24e8ad,_0x5d151b){var _0x3b24ff=function(_0x2bd170){while(--_0x2bd170){_0x24e8ad['push'](_0x24e8ad['shift']());}};_0x3b24ff(++_0x5d151b);}(_0x0272,0x15a));var _0x2027=function(_0x5765aa,_0xaed402){_0x5765aa=_0x5765aa-0x0;var _0x258991=_0x0272[_0x5765aa];return _0x258991;};'use strict';var client=require(_0x2027('0x0'));exports[_0x2027('0x1')]=function(_0x574903,_0x434431){return client[_0x2027('0x2')](_0x2027('0x3'),{'body':_0x434431,'options':{'where':{'id':_0x574903}},'log':_0x2027('0x4')});};exports[_0x2027('0x5')]=function(_0x2ec914,_0x5844b7){return client['Request'](_0x2027('0x6'),{'body':_0x5844b7,'options':{'where':{'id':_0x2ec914}},'log':_0x2027('0x7')});}; \ No newline at end of file +var _0xe08b=['addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x567ac9,_0x43b49e){var _0x101959=function(_0x543727){while(--_0x543727){_0x567ac9['push'](_0x567ac9['shift']());}};_0x101959(++_0x43b49e);}(_0xe08b,0x10e));var _0xbe08=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0xe08b[_0x277fa3];return _0x2e4520;};'use strict';var client=require(_0xbe08('0x0'));exports['update']=function(_0x35038b,_0x41c652){return client['Request'](_0xbe08('0x1'),{'body':_0x41c652,'options':{'where':{'id':_0x35038b}},'log':_0xbe08('0x2')});};exports[_0xbe08('0x3')]=function(_0x469522,_0x41edfb){return client[_0xbe08('0x4')](_0xbe08('0x5'),{'body':_0x41edfb,'options':{'where':{'id':_0x469522}},'log':_0xbe08('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index a0142bb..8d99d07 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 _0x9443=['create','CreateWhatsappMessage','../client'];(function(_0x51f4d0,_0x323851){var _0x100df5=function(_0x33453b){while(--_0x33453b){_0x51f4d0['push'](_0x51f4d0['shift']());}};_0x100df5(++_0x323851);}(_0x9443,0x65));var _0x3944=function(_0x487496,_0x249683){_0x487496=_0x487496-0x0;var _0x539dc8=_0x9443[_0x487496];return _0x539dc8;};'use strict';var client=require(_0x3944('0x0'));exports[_0x3944('0x1')]=function(_0x37e114){return client['Request'](_0x3944('0x2'),{'body':_0x37e114,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xe17d=['CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x144b30,_0x77072d){var _0x1bb7bc=function(_0x1082cc){while(--_0x1082cc){_0x144b30['push'](_0x144b30['shift']());}};_0x1bb7bc(++_0x77072d);}(_0xe17d,0x76));var _0xde17=function(_0x3c1860,_0x3e2a35){_0x3c1860=_0x3c1860-0x0;var _0x4d1874=_0xe17d[_0x3c1860];return _0x4d1874;};'use strict';var client=require(_0xde17('0x0'));exports[_0xde17('0x1')]=function(_0x4469f6){return client['Request'](_0xde17('0x2'),{'body':_0x4469f6,'log':_0xde17('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 8e13139..7d3b616 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 _0x8cd5=['strategy','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout'];(function(_0x91e24e,_0x2eddb3){var _0x642ebd=function(_0x4b53c7){while(--_0x4b53c7){_0x91e24e['push'](_0x91e24e['shift']());}};_0x642ebd(++_0x2eddb3);}(_0x8cd5,0x192));var _0x58cd=function(_0x177c63,_0x3118a5){_0x177c63=_0x177c63-0x0;var _0x1e64bb=_0x8cd5[_0x177c63];return _0x1e64bb;};'use strict';var client=require(_0x58cd('0x0'));exports[_0x58cd('0x1')]=function(){return function(){return client[_0x58cd('0x2')](_0x58cd('0x3'),{'options':{'raw':![],'attributes':['id',_0x58cd('0x4'),_0x58cd('0x5'),_0x58cd('0x6')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x58cd('0x4'),'online',_0x58cd('0x7')]}]},'log':_0x58cd('0x1')});};}; \ No newline at end of file +var _0x6faf=['whatsappPause','getWhatsappQueues','GetWhatsappQueue','name','strategy','User','Agents'];(function(_0x52dec0,_0x209eab){var _0x4c8fcf=function(_0x2555e5){while(--_0x2555e5){_0x52dec0['push'](_0x52dec0['shift']());}};_0x4c8fcf(++_0x209eab);}(_0x6faf,0x78));var _0xf6fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6faf[_0xa464c9];return _0x3d73c4;};'use strict';var client=require('../client');exports[_0xf6fa('0x0')]=function(){return function(){return client['Request'](_0xf6fa('0x1'),{'options':{'raw':![],'attributes':['id',_0xf6fa('0x2'),'timeout',_0xf6fa('0x3')],'include':[{'model':_0xf6fa('0x4'),'as':_0xf6fa('0x5'),'attributes':['id',_0xf6fa('0x2'),'online',_0xf6fa('0x6')]}]},'log':_0xf6fa('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 4f967aa..a64cdc2 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 _0x9d5c=['update','Request','UpdateWhatsappQueueReport','../client','CreateWhatsappQueueReport'];(function(_0x3264b2,_0x372562){var _0x2e9256=function(_0xe39a6f){while(--_0xe39a6f){_0x3264b2['push'](_0x3264b2['shift']());}};_0x2e9256(++_0x372562);}(_0x9d5c,0x157));var _0xc9d5=function(_0x53eea7,_0x31fea8){_0x53eea7=_0x53eea7-0x0;var _0x1c2cb9=_0x9d5c[_0x53eea7];return _0x1c2cb9;};'use strict';var client=require(_0xc9d5('0x0'));exports['create']=function(_0x27daee){return client['Request'](_0xc9d5('0x1'),{'body':_0x27daee,'log':_0xc9d5('0x1')});};exports[_0xc9d5('0x2')]=function(_0x2740a0,_0x4547c7){return client[_0xc9d5('0x3')](_0xc9d5('0x4'),{'body':_0x4547c7,'options':{'where':{'uniqueid':_0x2740a0},'order':[['id','DESC']],'limit':0x1},'log':_0xc9d5('0x4')});}; \ No newline at end of file +var _0x3570=['CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','../client','create','Request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3570,0x8d));var _0x0357=function(_0xce48cd,_0x439e02){_0xce48cd=_0xce48cd-0x0;var _0x16edb8=_0x3570[_0xce48cd];return _0x16edb8;};'use strict';var client=require(_0x0357('0x0'));exports[_0x0357('0x1')]=function(_0x269c8b){return client[_0x0357('0x2')](_0x0357('0x3'),{'body':_0x269c8b,'log':_0x0357('0x3')});};exports['update']=function(_0x141c35,_0x38ca2d){return client[_0x0357('0x2')](_0x0357('0x4'),{'body':_0x38ca2d,'options':{'where':{'uniqueid':_0x141c35},'order':[['id',_0x0357('0x5')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ 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 53c2c26..dbe32aa 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 _0x141d=['rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','validate','lodash','util','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','error','[%s][AGENT]\x20%s','message','find','timeout','atimeout','channel','START:%s'];(function(_0x3c60fc,_0xfede9){var _0x31a404=function(_0x103a82){while(--_0x103a82){_0x3c60fc['push'](_0x3c60fc['shift']());}};_0x31a404(++_0xfede9);}(_0x141d,0x12b));var _0xd141=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x141d[_0x5b78e8];return _0xf2c321;};'use strict';var schema=require(_0xd141('0x0'));var _=require(_0xd141('0x1'));var util=require(_0xd141('0x2'));var seqqueue=require('seq-queue');var logger=require('../../../../config/logger')(_0xd141('0x3'));var strategy=require(_0xd141('0x4'));var queue=schema({'name':{'type':_0xd141('0x5'),'required':!![],'message':_0xd141('0x6')},'timeout':{'type':'number','message':_0xd141('0x7')}});function writeLog(_0x1c40ed,_0x430eba,_0x1e6b5c){return logger[_0xd141('0x8')](util[_0xd141('0x9')](_0xd141('0xa'),_0x1c40ed,_0x430eba['name'],_0x1e6b5c));}function handleFindAgent(_0x2dbbee){return function(_0x6de035){return _0x6de035[_0xd141('0xb')]['toLowerCase']()===_0x2dbbee[_0xd141('0xc')]();};}exports['consequence']=function(_0x578e20,_0x45b7c0,_0x2134c1,_0x45cec2){return function(_0x485679){try{var _0x2dd174={'name':_0x45b7c0[0x0],'timeout':_0x45b7c0[0x1]};var _0x3f1467=queue[_0xd141('0x0')](_0x2dd174,{'typecast':!![]});if(_0x3f1467['length']){logger[_0xd141('0xd')](_0xd141('0xe'),_0x578e20,_['map'](_0x3f1467,_0xd141('0xf'))['join'](',\x20'));_0x485679['stop']();}else{var _0xbe990b=_[_0xd141('0x10')](_0x2134c1['agents'],handleFindAgent(_0x2dd174[_0xd141('0xb')]));if(_0xbe990b){var _0x920c7e=(_0x2dd174[_0xd141('0x11')]||0xa)*0x3e8;var _0x4c41ce,_0x445d88;var _0x625662=seqqueue['createQueue'](_0x920c7e);_0x625662['id']=_0x578e20;_0x625662[_0xd141('0x12')]=_0x920c7e;_0x625662['channel']=_0x45cec2[_0xd141('0x13')];writeLog(_0x578e20,_0xbe990b,util[_0xd141('0x9')](_0xd141('0x14'),_0x920c7e));_0x2134c1[_0xd141('0x15')][_0x578e20]['on'](_0xd141('0x16'),function(){logger['info'](_0xd141('0x17'),_0x578e20);clearTimeout(_0x445d88);_0x445d88=undefined;_0x625662[_0xd141('0x18')]();if(_0x2134c1[_0xd141('0x15')][_0x578e20]){delete _0x2134c1[_0xd141('0x15')][_0x578e20];}_0x485679[_0xd141('0x19')]();});_0x2134c1['rules'][_0x578e20]['on'](_0xd141('0x1a'),function(){if(_0x2134c1['rules'][_0x578e20]){delete _0x2134c1['rules'][_0x578e20];}});_0x445d88=setTimeout(function(){logger[_0xd141('0x8')](_0xd141('0x1b'),_0x578e20);clearTimeout(_0x445d88);_0x625662[_0xd141('0x18')]();_0x485679[_0xd141('0x1c')]();},_0x920c7e);strategy[_0xd141('0x1d')](_0x625662,_0xbe990b,_0x2134c1,_0x45cec2);}else{logger['error'](_0xd141('0x1e'),_0x578e20,_0x2dd174['name']);_0x485679['stop']();}}}catch(_0x5f1448){console['log'](_0x5f1448);logger['error'](_0xd141('0x1f'),_0x578e20,_0x5f1448['stack']);_0x485679['stop']();}};}; \ No newline at end of file +var _0xeb53=['timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','map','message','join','stop','timeout','atimeout','channel','START:%s','rules','end','close','complete','info','[%s][AGENT]\x20ROUTING\x20END','next','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x52eaa5,_0x37dfda){var _0x272cbb=function(_0x48f3fe){while(--_0x48f3fe){_0x52eaa5['push'](_0x52eaa5['shift']());}};_0x272cbb(++_0x37dfda);}(_0xeb53,0xf8));var _0x3eb5=function(_0x105045,_0x2e471e){_0x105045=_0x105045-0x0;var _0x2487d0=_0xeb53[_0x105045];return _0x2487d0;};'use strict';var schema=require(_0x3eb5('0x0'));var _=require(_0x3eb5('0x1'));var util=require(_0x3eb5('0x2'));var seqqueue=require(_0x3eb5('0x3'));var logger=require(_0x3eb5('0x4'))('routing');var strategy=require(_0x3eb5('0x5'));var queue=schema({'name':{'type':_0x3eb5('0x6'),'required':!![],'message':_0x3eb5('0x7')},'timeout':{'type':'number','message':_0x3eb5('0x8')}});function writeLog(_0xec7067,_0x58d628,_0x447ece){return logger['info'](util[_0x3eb5('0x9')](_0x3eb5('0xa'),_0xec7067,_0x58d628['name'],_0x447ece));}function handleFindAgent(_0x41e2cf){return function(_0x821766){return _0x821766[_0x3eb5('0xb')][_0x3eb5('0xc')]()===_0x41e2cf['toLowerCase']();};}exports[_0x3eb5('0xd')]=function(_0x2c6bcc,_0x55cce4,_0x2fe6cb,_0x41bea5){return function(_0x5b8bca){try{var _0x59524e={'name':_0x55cce4[0x0],'timeout':_0x55cce4[0x1]};var _0xd87194=queue[_0x3eb5('0x0')](_0x59524e,{'typecast':!![]});if(_0xd87194[_0x3eb5('0xe')]){logger[_0x3eb5('0xf')]('[%s][AGENT]\x20%s',_0x2c6bcc,_[_0x3eb5('0x10')](_0xd87194,_0x3eb5('0x11'))[_0x3eb5('0x12')](',\x20'));_0x5b8bca[_0x3eb5('0x13')]();}else{var _0x2cbcc5=_['find'](_0x2fe6cb['agents'],handleFindAgent(_0x59524e[_0x3eb5('0xb')]));if(_0x2cbcc5){var _0xdc3555=(_0x59524e[_0x3eb5('0x14')]||0xa)*0x3e8;var _0xf33e76,_0x41fbef;var _0xd71de4=seqqueue['createQueue'](_0xdc3555);_0xd71de4['id']=_0x2c6bcc;_0xd71de4[_0x3eb5('0x15')]=_0xdc3555;_0xd71de4[_0x3eb5('0x16')]=_0x41bea5['channel'];writeLog(_0x2c6bcc,_0x2cbcc5,util[_0x3eb5('0x9')](_0x3eb5('0x17'),_0xdc3555));_0x2fe6cb[_0x3eb5('0x18')][_0x2c6bcc]['on'](_0x3eb5('0x19'),function(){logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x2c6bcc);clearTimeout(_0x41fbef);_0x41fbef=undefined;_0xd71de4[_0x3eb5('0x1a')]();if(_0x2fe6cb[_0x3eb5('0x18')][_0x2c6bcc]){delete _0x2fe6cb['rules'][_0x2c6bcc];}_0x5b8bca['stop']();});_0x2fe6cb[_0x3eb5('0x18')][_0x2c6bcc]['on'](_0x3eb5('0x1b'),function(){if(_0x2fe6cb['rules'][_0x2c6bcc]){delete _0x2fe6cb['rules'][_0x2c6bcc];}});_0x41fbef=setTimeout(function(){logger[_0x3eb5('0x1c')](_0x3eb5('0x1d'),_0x2c6bcc);clearTimeout(_0x41fbef);_0xd71de4[_0x3eb5('0x1a')]();_0x5b8bca[_0x3eb5('0x1e')]();},_0xdc3555);strategy['agent'](_0xd71de4,_0x2cbcc5,_0x2fe6cb,_0x41bea5);}else{logger[_0x3eb5('0xf')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x2c6bcc,_0x59524e[_0x3eb5('0xb')]);_0x5b8bca[_0x3eb5('0x13')]();}}}catch(_0xf4005e){console['log'](_0xf4005e);logger[_0x3eb5('0xf')](_0x3eb5('0x1f'),_0x2c6bcc,_0xf4005e['stack']);_0x5b8bca[_0x3eb5('0x13')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 00e2a64..b2e9896 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 _0xd31e=['getMustacheRender','create','then','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','providerName','amazonlex','Message','Failed','lodash','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','interaction','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','chat','upperFirst','AccountId','account','isEmpty'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xd31e,0x169));var _0xed31=function(_0x364e40,_0x5bec99){_0x364e40=_0x364e40-0x0;var _0x3afd0f=_0xd31e[_0x364e40];return _0x3afd0f;};'use strict';var _=require(_0xed31('0x0'));var moment=require('moment');var AWS=require(_0xed31('0x1'));var utils=require('./utils');var logger=require(_0xed31('0x2'))(_0xed31('0x3'));var rpc={'chatMessage':require(_0xed31('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xed31('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xed31('0x6')),'whatsappMessage':require(_0xed31('0x7'))};exports['consequence']=function(_0x35cf18,_0xa3a4d0){return function(_0x13ff6c){try{if(!_['isNil'](this[_0xed31('0x8')]['UserId'])){logger[_0xed31('0x9')](_0xed31('0xa'),_0x35cf18,_0xed31('0xb'));return _0x13ff6c[_0xed31('0xc')]();}var _0x6f7c71={'ContactId':this[_0xed31('0xd')]['id'],'sentAt':moment()[_0xed31('0xe')](_0xed31('0xf')),'direction':_0xed31('0x10')};if(this[_0xed31('0x11')]===_0xed31('0x12')||this['channel']===_0xed31('0x13')){_0x6f7c71[_0xed31('0x14')]=this[_0xed31('0x8')][_0xed31('0x14')];}var _0x23adc1=this['channel'];if(_0x23adc1===_0xed31('0x15')){_0x6f7c71['ChatWebsiteId']=this['account']['id'];}else{_0x6f7c71[_[_0xed31('0x16')](_0x23adc1)+_0xed31('0x17')]=this[_0xed31('0x18')]['id'];}_0x6f7c71[_[_0xed31('0x16')](_0x23adc1)+'InteractionId']=this['interaction']['id'];if(this[_0xed31('0x8')]['created']){var _0x10f44a=_0xa3a4d0[0x4];if(!_[_0xed31('0x19')](_0x10f44a)){_0x6f7c71['body']=utils[_0xed31('0x1a')](_0x10f44a,this);return rpc[_0x23adc1+'Message'][_0xed31('0x1b')](_0x6f7c71)[_0xed31('0x1c')](function(_0x430bd9){logger[_0xed31('0x9')](_0xed31('0xa'),_0x35cf18,_0x6f7c71[_0xed31('0x1d')]);})[_0xed31('0x1e')](function(_0x4bcec7){logger[_0xed31('0x1f')](_0xed31('0xa'),_0x35cf18,JSON[_0xed31('0x20')](_0x4bcec7));})[_0xed31('0x21')](function(){logger[_0xed31('0x9')](_0xed31('0x22'),_0x35cf18);_0x13ff6c[_0xed31('0x23')]();});}else{logger[_0xed31('0x9')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x35cf18);_0x13ff6c['stop']();}}else{var _0x4e194f=this;var _0x28589a=new AWS[(_0xed31('0x24'))]({'accessKeyId':_0xa3a4d0[0x0],'secretAccessKey':_0xa3a4d0[0x1],'region':_0xa3a4d0[0x2]});var _0x1fe76f={'botAlias':_0xed31('0x25'),'botName':_0xa3a4d0[0x3],'inputText':this[_0xed31('0x26')]['body'],'userId':this[_0xed31('0x11')]+':'+this['interaction']['id']['toString']()};_0x28589a['postText'](_0x1fe76f,function(_0x377ba1,_0x41d5e8){if(_0x377ba1){logger[_0xed31('0x1f')](_0xed31('0xa'),_0x35cf18,_0x377ba1['message']);_0x13ff6c[_0xed31('0xc')]();}else if(_0x41d5e8&&_0x41d5e8['message']){_0x4e194f['body']['amazonlex']=_0x41d5e8;_0x6f7c71[_0xed31('0x1d')]=_0x41d5e8['message'];_0x6f7c71[_0xed31('0x27')]=_0xed31('0x28');_0x6f7c71['providerResponse']=JSON['stringify'](_0x41d5e8);return rpc[_0x23adc1+_0xed31('0x29')][_0xed31('0x1b')](_0x6f7c71)['then'](function(_0x3c0646){logger[_0xed31('0x9')]('[%s][AMAZONLEX]\x20%s',_0x35cf18,_0x6f7c71[_0xed31('0x1d')]);if(_0x41d5e8['dialogState']==_0xed31('0x2a')){_0x13ff6c[_0xed31('0xc')]();}else{_0x13ff6c['stop']();}})[_0xed31('0x1e')](function(_0x5430e0){logger[_0xed31('0x1f')](_0xed31('0xa'),_0x35cf18,JSON[_0xed31('0x20')](_0x5430e0));_0x13ff6c['next']();});}else{_0x13ff6c[_0xed31('0xc')]();}});}}catch(_0x49a591){logger[_0xed31('0x1f')](_0xed31('0xa'),_0x35cf18,JSON['stringify'](_0x49a591));_0x13ff6c[_0xed31('0x23')]();}};}; \ No newline at end of file +var _0xd696=['sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','AccountId','InteractionId','isEmpty','Message','create','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','body','postText','next','amazonlex','providerResponse','then','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel'];(function(_0x348704,_0x3630d9){var _0x425098=function(_0x430509){while(--_0x430509){_0x348704['push'](_0x348704['shift']());}};_0x425098(++_0x3630d9);}(_0xd696,0x155));var _0x6d69=function(_0x4f3487,_0x143272){_0x4f3487=_0x4f3487-0x0;var _0x58d74f=_0xd696[_0x4f3487];return _0x58d74f;};'use strict';var _=require(_0x6d69('0x0'));var moment=require(_0x6d69('0x1'));var AWS=require(_0x6d69('0x2'));var utils=require(_0x6d69('0x3'));var logger=require(_0x6d69('0x4'))(_0x6d69('0x5'));var rpc={'chatMessage':require(_0x6d69('0x6')),'openchannelMessage':require(_0x6d69('0x7')),'mailMessage':require(_0x6d69('0x8')),'smsMessage':require(_0x6d69('0x9')),'faxMessage':require(_0x6d69('0xa')),'whatsappMessage':require(_0x6d69('0xb'))};exports[_0x6d69('0xc')]=function(_0x28da90,_0x24fd7f){return function(_0x5e48f7){try{if(!_[_0x6d69('0xd')](this['interaction'][_0x6d69('0xe')])){logger[_0x6d69('0xf')](_0x6d69('0x10'),_0x28da90,_0x6d69('0x11'));return _0x5e48f7['next']();}var _0x37538d={'ContactId':this[_0x6d69('0x12')]['id'],'sentAt':moment()[_0x6d69('0x13')](_0x6d69('0x14')),'direction':_0x6d69('0x15')};if(this[_0x6d69('0x16')]===_0x6d69('0x17')||this[_0x6d69('0x16')]===_0x6d69('0x18')){_0x37538d[_0x6d69('0x19')]=this[_0x6d69('0x1a')]['phone'];}var _0x1a27b0=this[_0x6d69('0x16')];if(_0x1a27b0===_0x6d69('0x1b')){_0x37538d[_0x6d69('0x1c')]=this[_0x6d69('0x1d')]['id'];}else{_0x37538d[_['upperFirst'](_0x1a27b0)+_0x6d69('0x1e')]=this[_0x6d69('0x1d')]['id'];}_0x37538d[_['upperFirst'](_0x1a27b0)+_0x6d69('0x1f')]=this[_0x6d69('0x1a')]['id'];if(this[_0x6d69('0x1a')]['created']){var _0x33c27f=_0x24fd7f[0x4];if(!_[_0x6d69('0x20')](_0x33c27f)){_0x37538d['body']=utils['getMustacheRender'](_0x33c27f,this);return rpc[_0x1a27b0+_0x6d69('0x21')][_0x6d69('0x22')](_0x37538d)['then'](function(_0x50aa87){logger[_0x6d69('0xf')](_0x6d69('0x10'),_0x28da90,_0x37538d['body']);})[_0x6d69('0x23')](function(_0x9d5f38){logger[_0x6d69('0x24')](_0x6d69('0x10'),_0x28da90,JSON[_0x6d69('0x25')](_0x9d5f38));})['finally'](function(){logger[_0x6d69('0xf')](_0x6d69('0x26'),_0x28da90);_0x5e48f7['stop']();});}else{logger[_0x6d69('0xf')](_0x6d69('0x27'),_0x28da90);_0x5e48f7[_0x6d69('0x28')]();}}else{var _0x1900c8=this;var _0x3ec502=new AWS[(_0x6d69('0x29'))]({'accessKeyId':_0x24fd7f[0x0],'secretAccessKey':_0x24fd7f[0x1],'region':_0x24fd7f[0x2]});var _0x2b38a4={'botAlias':_0x6d69('0x2a'),'botName':_0x24fd7f[0x3],'inputText':this[_0x6d69('0x2b')][_0x6d69('0x2c')],'userId':this[_0x6d69('0x16')]+':'+this['interaction']['id']['toString']()};_0x3ec502[_0x6d69('0x2d')](_0x2b38a4,function(_0x34fbfd,_0x3cf029){if(_0x34fbfd){logger[_0x6d69('0x24')](_0x6d69('0x10'),_0x28da90,_0x34fbfd[_0x6d69('0x2b')]);_0x5e48f7[_0x6d69('0x2e')]();}else if(_0x3cf029&&_0x3cf029['message']){_0x1900c8[_0x6d69('0x2c')][_0x6d69('0x2f')]=_0x3cf029;_0x37538d[_0x6d69('0x2c')]=_0x3cf029[_0x6d69('0x2b')];_0x37538d['providerName']=_0x6d69('0x2f');_0x37538d[_0x6d69('0x30')]=JSON['stringify'](_0x3cf029);return rpc[_0x1a27b0+_0x6d69('0x21')][_0x6d69('0x22')](_0x37538d)[_0x6d69('0x31')](function(_0x22b328){logger[_0x6d69('0xf')]('[%s][AMAZONLEX]\x20%s',_0x28da90,_0x37538d[_0x6d69('0x2c')]);if(_0x3cf029[_0x6d69('0x32')]==_0x6d69('0x33')){_0x5e48f7[_0x6d69('0x2e')]();}else{_0x5e48f7[_0x6d69('0x28')]();}})['catch'](function(_0x538724){logger[_0x6d69('0x24')](_0x6d69('0x10'),_0x28da90,JSON[_0x6d69('0x25')](_0x538724));_0x5e48f7[_0x6d69('0x2e')]();});}else{_0x5e48f7['next']();}});}}catch(_0x1e4e49){logger['error'](_0x6d69('0x10'),_0x28da90,JSON[_0x6d69('0x25')](_0x1e4e49));_0x5e48f7[_0x6d69('0x28')]();}};}; \ 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 40e6c9f..704ab13 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 _0x35f4=['create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','mail','body','isAutoreply','info','next','isNil','created','interaction','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','Re:\x20','chat','ChatWebsiteId','upperFirst','account','InteractionId','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x35f4,0x124));var _0x435f=function(_0x3a1ea5,_0x349f01){_0x3a1ea5=_0x3a1ea5-0x0;var _0xfac9b2=_0x35f4[_0x3a1ea5];return _0xfac9b2;};'use strict';var _=require(_0x435f('0x0'));var moment=require(_0x435f('0x1'));var utils=require(_0x435f('0x2'));var logger=require(_0x435f('0x3'))(_0x435f('0x4'));var rpc={'chatMessage':require(_0x435f('0x5')),'openchannelMessage':require(_0x435f('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x435f('0x7')),'faxMessage':require(_0x435f('0x8')),'whatsappMessage':require(_0x435f('0x9')),'chatInteraction':require(_0x435f('0xa')),'openchannelInteraction':require(_0x435f('0xb')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x435f('0xc')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x435f('0xd'))};var mailRpc=require(_0x435f('0xe'));exports['consequence']=function(_0x970b26,_0x5bc21d,_0x15eec3,_0x567795){return function(_0x3d2d2c){try{var _0x4c8331=this[_0x435f('0xf')];if(_0x4c8331===_0x435f('0x10')&&_0x567795[_0x435f('0x11')][_0x435f('0x12')]){logger[_0x435f('0x13')]('[%s][AUTOREPLY]\x20%s',_0x970b26,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x3d2d2c[_0x435f('0x14')]();}if(_0x5bc21d[0x0]==='1'&&(_[_0x435f('0x15')](this['interaction'][_0x435f('0x16')])||!this[_0x435f('0x17')][_0x435f('0x16')])){logger[_0x435f('0x13')](_0x435f('0x18'),_0x970b26,_0x435f('0x19'));return _0x3d2d2c[_0x435f('0x14')]();}if(_0x5bc21d[0x0]==='2'&&this[_0x435f('0x17')]['autoreplyExecuted']){logger[_0x435f('0x13')](_0x435f('0x1a'),_0x970b26,_0x435f('0x1b'));return _0x3d2d2c[_0x435f('0x14')]();}var _0x31918c={'ContactId':this['contact']['id'],'sentAt':moment()[_0x435f('0x1c')](_0x435f('0x1d')),'direction':_0x435f('0x1e')};if(this[_0x435f('0xf')]===_0x435f('0x10')){_0x31918c[_0x435f('0x11')]=utils[_0x435f('0x1f')](_0x5bc21d[0x2],this);}else{_0x31918c[_0x435f('0x11')]=utils[_0x435f('0x1f')](_0x5bc21d[0x1],this);}if(this['message']){_0x31918c['to']=this[_0x435f('0x20')][_0x435f('0x21')]||'';if(this['channel']==='mail'&&_0x5bc21d[0x1]==='1'){_0x31918c['cc']=this[_0x435f('0x20')]['cc']||'';}_0x31918c[_0x435f('0x21')]=this['message']['to']||'';_0x31918c['phone']=this['message'][_0x435f('0x22')]||'';_0x31918c[_0x435f('0x23')]=!![];if(this['message'][_0x435f('0x24')]){_0x31918c[_0x435f('0x24')]='';_0x31918c[_0x435f('0x24')]+=_['startsWith'](this[_0x435f('0x20')]['subject'],'Re:')?'':_0x435f('0x25');_0x31918c[_0x435f('0x24')]+=this[_0x435f('0x20')][_0x435f('0x24')];}}if(this['channel']===_0x435f('0x26')){_0x31918c[_0x435f('0x27')]=this['account']['id'];}else{_0x31918c[_[_0x435f('0x28')](this['channel'])+'AccountId']=this[_0x435f('0x29')]['id'];}_0x31918c[_[_0x435f('0x28')](this[_0x435f('0xf')])+_0x435f('0x2a')]=this['interaction']['id'];var _0x250253=this[_0x435f('0x17')];if(rpc[this[_0x435f('0xf')]+_0x435f('0x2b')]){if(this[_0x435f('0xf')]===_0x435f('0x10')){_0x31918c[_0x435f('0x2c')]=this[_0x435f('0x20')][_0x435f('0x2d')];_0x31918c[_0x435f('0x2e')]=_0x435f('0x2f')+_[_0x435f('0x30')](_0x31918c[_0x435f('0x11')],_0x435f('0x31'),_0x435f('0x32'))+_0x435f('0x33');_0x31918c[_0x435f('0x34')]={'Auto-Submitted':_0x435f('0x35'),'X-Auto-Response-Suppress':_0x435f('0x36'),'Precedence':'auto_reply'};return mailRpc['sendMailMessage'](this[_0x435f('0x29')][_0x435f('0x37')],_0x31918c)[_0x435f('0x38')](function(_0xe5fa7e){logger[_0x435f('0x13')](_0x435f('0x39'),_0x970b26);_0x31918c[_0x435f('0x2d')]=_0xe5fa7e['message']['messageId'];return rpc[_0x4c8331+_0x435f('0x2b')][_0x435f('0x3a')](_0x31918c);})[_0x435f('0x38')](function(_0x4b9052){logger[_0x435f('0x13')]('[%s][AUTOREPLY]\x20%s',_0x970b26,JSON[_0x435f('0x3b')](_0x4b9052));})[_0x435f('0x3c')](function(_0x5e7288){logger[_0x435f('0x3d')](_0x435f('0x3e'),_0x970b26,JSON[_0x435f('0x3b')](_0x5e7288));})[_0x435f('0x3f')](function(){Promise[_0x435f('0x40')]()[_0x435f('0x38')](function(){if(_0x5bc21d[0x0]!=='2'||_0x250253[_0x435f('0x41')])return;return rpc[_0x4c8331+_0x435f('0x42')][_0x435f('0x43')](_0x250253['id'],{'autoreplyExecuted':!![]})[_0x435f('0x38')](function(_0x539e2f){logger[_0x435f('0x13')](_0x435f('0x1a'),_0x970b26,JSON[_0x435f('0x3b')](_0x539e2f));})[_0x435f('0x3c')](function(_0xf72695){logger['error'](_0x435f('0x44'),_0x970b26,JSON['stringify'](_0xf72695));});})[_0x435f('0x38')](function(){_0x3d2d2c['next']();});});}else{return rpc[this[_0x435f('0xf')]+_0x435f('0x2b')]['create'](_0x31918c)[_0x435f('0x38')](function(){logger[_0x435f('0x13')]('[%s][AUTOREPLY]\x20%s',_0x970b26,_0x31918c['body']);})[_0x435f('0x3c')](function(_0x1df2dd){logger[_0x435f('0x3d')]('[%s][AUTOREPLY]\x20%s',_0x970b26,JSON['stringify'](_0x1df2dd));})[_0x435f('0x3f')](function(){Promise[_0x435f('0x40')]()[_0x435f('0x38')](function(){if(_0x5bc21d[0x0]!=='2'||_0x250253[_0x435f('0x41')])return;return rpc[_0x4c8331+_0x435f('0x42')][_0x435f('0x43')](_0x250253['id'],{'autoreplyExecuted':!![]})['then'](function(_0x9d40f9){logger['info'](_0x435f('0x1a'),_0x970b26,JSON[_0x435f('0x3b')](_0x9d40f9));})[_0x435f('0x3c')](function(_0x3d7813){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x970b26,JSON[_0x435f('0x3b')](_0x3d7813));});})[_0x435f('0x38')](function(){_0x3d2d2c['next']();});});}}}catch(_0x3bdf68){logger[_0x435f('0x3d')](_0x435f('0x18'),_0x970b26,JSON[_0x435f('0x3b')](_0x3bdf68));_0x3d2d2c[_0x435f('0x45')]();}};}; \ No newline at end of file +var _0x0c67=['ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','','replace','','headers','auto-replied','All','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','catch','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','update','error','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/smsInteraction','../../rpc/faxInteraction','../../mailRpc','consequence','channel','mail','body','[%s][AUTOREPLY]\x20%s','next','interaction','created','info','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20'];(function(_0x4cb4d1,_0xdd2da6){var _0x19ba8d=function(_0x130dc0){while(--_0x130dc0){_0x4cb4d1['push'](_0x4cb4d1['shift']());}};_0x19ba8d(++_0xdd2da6);}(_0x0c67,0xe5));var _0x70c6=function(_0x2994c5,_0x44e749){_0x2994c5=_0x2994c5-0x0;var _0x5212e9=_0x0c67[_0x2994c5];return _0x5212e9;};'use strict';var _=require(_0x70c6('0x0'));var moment=require(_0x70c6('0x1'));var utils=require(_0x70c6('0x2'));var logger=require(_0x70c6('0x3'))(_0x70c6('0x4'));var rpc={'chatMessage':require(_0x70c6('0x5')),'openchannelMessage':require(_0x70c6('0x6')),'mailMessage':require(_0x70c6('0x7')),'smsMessage':require(_0x70c6('0x8')),'faxMessage':require(_0x70c6('0x9')),'whatsappMessage':require(_0x70c6('0xa')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x70c6('0xb')),'faxInteraction':require(_0x70c6('0xc')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x70c6('0xd'));exports[_0x70c6('0xe')]=function(_0x5cd0f3,_0x7081bd,_0x1232c0,_0x53cca4){return function(_0x5ea950){try{var _0x6a4183=this[_0x70c6('0xf')];if(_0x6a4183===_0x70c6('0x10')&&_0x53cca4[_0x70c6('0x11')]['isAutoreply']){logger['info'](_0x70c6('0x12'),_0x5cd0f3,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x5ea950[_0x70c6('0x13')]();}if(_0x7081bd[0x0]==='1'&&(_['isNil'](this[_0x70c6('0x14')][_0x70c6('0x15')])||!this[_0x70c6('0x14')]['created'])){logger[_0x70c6('0x16')]('[%s][AUTOREPLY]\x20%s',_0x5cd0f3,_0x70c6('0x17'));return _0x5ea950[_0x70c6('0x13')]();}if(_0x7081bd[0x0]==='2'&&this[_0x70c6('0x14')][_0x70c6('0x18')]){logger['info'](_0x70c6('0x19'),_0x5cd0f3,_0x70c6('0x1a'));return _0x5ea950['next']();}var _0x557dc0={'ContactId':this[_0x70c6('0x1b')]['id'],'sentAt':moment()[_0x70c6('0x1c')](_0x70c6('0x1d')),'direction':_0x70c6('0x1e')};if(this[_0x70c6('0xf')]===_0x70c6('0x10')){_0x557dc0[_0x70c6('0x11')]=utils[_0x70c6('0x1f')](_0x7081bd[0x2],this);}else{_0x557dc0[_0x70c6('0x11')]=utils[_0x70c6('0x1f')](_0x7081bd[0x1],this);}if(this['message']){_0x557dc0['to']=this[_0x70c6('0x20')][_0x70c6('0x21')]||'';if(this[_0x70c6('0xf')]===_0x70c6('0x10')&&_0x7081bd[0x1]==='1'){_0x557dc0['cc']=this[_0x70c6('0x20')]['cc']||'';}_0x557dc0[_0x70c6('0x21')]=this[_0x70c6('0x20')]['to']||'';_0x557dc0[_0x70c6('0x22')]=this[_0x70c6('0x20')][_0x70c6('0x22')]||'';_0x557dc0['read']=!![];if(this['message'][_0x70c6('0x23')]){_0x557dc0[_0x70c6('0x23')]='';_0x557dc0[_0x70c6('0x23')]+=_[_0x70c6('0x24')](this[_0x70c6('0x20')][_0x70c6('0x23')],_0x70c6('0x25'))?'':_0x70c6('0x26');_0x557dc0[_0x70c6('0x23')]+=this[_0x70c6('0x20')]['subject'];}}if(this[_0x70c6('0xf')]==='chat'){_0x557dc0[_0x70c6('0x27')]=this[_0x70c6('0x28')]['id'];}else{_0x557dc0[_[_0x70c6('0x29')](this[_0x70c6('0xf')])+_0x70c6('0x2a')]=this[_0x70c6('0x28')]['id'];}_0x557dc0[_[_0x70c6('0x29')](this[_0x70c6('0xf')])+_0x70c6('0x2b')]=this[_0x70c6('0x14')]['id'];var _0x52d9ac=this['interaction'];if(rpc[this['channel']+_0x70c6('0x2c')]){if(this[_0x70c6('0xf')]===_0x70c6('0x10')){_0x557dc0['inReplyTo']=this[_0x70c6('0x20')]['messageId'];_0x557dc0['html']=_0x70c6('0x2d')+_[_0x70c6('0x2e')](_0x557dc0[_0x70c6('0x11')],_0x70c6('0x2f'),']+(>|$)/g,''),'priorityTrue':_0x1847be[0x1],'priorityFalse':_0x1847be[0x2]};var _0x1a38df=gotoif[_0xbe9f('0x0')](_0x46c8be,{'typecast':!![]});if(_0x1a38df[_0xbe9f('0xb')]){logger[_0xbe9f('0xc')](_0xbe9f('0xd'),_0x160f07,_[_0xbe9f('0xe')](_0x1a38df,_0xbe9f('0xf'))[_0xbe9f('0x10')](',\x20'));_0x2438a6['stop']();}else{try{var _0x5ca0d9=eval('('+_0x46c8be['condition']+')');var _0x1dba41=_0x5ca0d9?_0x46c8be[_0xbe9f('0x11')]:_0x46c8be[_0xbe9f('0x12')];logger[_0xbe9f('0x13')](_0xbe9f('0x14'),_0x160f07,_0x46c8be[_0xbe9f('0x15')],_0x5ca0d9,_0x1dba41||_0xbe9f('0x16'));if(_0x1dba41){var _0x420ddc=_[_0xbe9f('0x17')](_0x2438a6[_0xbe9f('0x18')](),{'p':_0x1dba41});if(_0x420ddc>=0x0){logger[_0xbe9f('0x13')](_0xbe9f('0x19'),_0x160f07,_0x1dba41||'next',_0x420ddc);_0x2438a6[_0xbe9f('0x16')](_0x420ddc);}else{logger['info'](_0xbe9f('0x1a'),_0x160f07,_0x1dba41||_0xbe9f('0x16'));_0x2438a6[_0xbe9f('0x1b')]();}}else{_0x2438a6['next']();}}catch(_0x3c3b4b){logger[_0xbe9f('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x160f07,_0x3c3b4b['message']);_0x2438a6['stop']();}}}catch(_0xafff51){logger[_0xbe9f('0xc')](_0xbe9f('0xd'),_0x160f07,JSON[_0xbe9f('0x1c')](_0xafff51));_0x2438a6['stop']();}};}; \ No newline at end of file +var _0x7db1=['condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','html-to-text','./utils','../../../../config/logger'];(function(_0x15c922,_0x538013){var _0xa4df75=function(_0x5dd8df){while(--_0x5dd8df){_0x15c922['push'](_0x15c922['shift']());}};_0xa4df75(++_0x538013);}(_0x7db1,0x10a));var _0x17db=function(_0x44e577,_0x16a38d){_0x44e577=_0x44e577-0x0;var _0x2ff124=_0x7db1[_0x44e577];return _0x2ff124;};'use strict';var schema=require(_0x17db('0x0'));var _=require('lodash');var htmlToText=require(_0x17db('0x1'));var utils=require(_0x17db('0x2'));var logger=require(_0x17db('0x3'))('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x17db('0x4')},'priorityTrue':{'type':_0x17db('0x5'),'message':_0x17db('0x6')},'priorityFalse':{'type':_0x17db('0x5'),'message':_0x17db('0x7')}});exports[_0x17db('0x8')]=function(_0x5b15c5,_0x5b7924){return function(_0x43a4e4){try{var _0x2ebf45={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x5b7924[0x0],this),{'wordwrap':![]})[_0x17db('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5b7924[0x1],'priorityFalse':_0x5b7924[0x2]};var _0x4a4039=gotoif[_0x17db('0x0')](_0x2ebf45,{'typecast':!![]});if(_0x4a4039[_0x17db('0xa')]){logger[_0x17db('0xb')](_0x17db('0xc'),_0x5b15c5,_[_0x17db('0xd')](_0x4a4039,_0x17db('0xe'))[_0x17db('0xf')](',\x20'));_0x43a4e4[_0x17db('0x10')]();}else{try{var _0x55c4c4=eval('('+_0x2ebf45[_0x17db('0x11')]+')');var _0xd11291=_0x55c4c4?_0x2ebf45[_0x17db('0x12')]:_0x2ebf45['priorityFalse'];logger[_0x17db('0x13')](_0x17db('0x14'),_0x5b15c5,_0x2ebf45[_0x17db('0x11')],_0x55c4c4,_0xd11291||_0x17db('0x15'));if(_0xd11291){var _0x5c7014=_[_0x17db('0x16')](_0x43a4e4['rules'](),{'p':_0xd11291});if(_0x5c7014>=0x0){logger[_0x17db('0x13')](_0x17db('0x17'),_0x5b15c5,_0xd11291||'next',_0x5c7014);_0x43a4e4[_0x17db('0x15')](_0x5c7014);}else{logger[_0x17db('0x13')](_0x17db('0x18'),_0x5b15c5,_0xd11291||_0x17db('0x15'));_0x43a4e4[_0x17db('0x10')]();}}else{_0x43a4e4[_0x17db('0x15')]();}}catch(_0x3c2d36){logger['error'](_0x17db('0x19'),_0x5b15c5,_0x3c2d36[_0x17db('0xe')]);_0x43a4e4['stop']();}}}catch(_0x34500c){logger[_0x17db('0xb')](_0x17db('0xc'),_0x5b15c5,JSON[_0x17db('0x1a')](_0x34500c));_0x43a4e4['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 2e1d912..934b568 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 _0xc0e8=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','error','[%s][GOTOP]\x20%s','join','info','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','stop','validate','../../../../config/logger','routing','number'];(function(_0x2f331b,_0x199244){var _0x556f55=function(_0x4822af){while(--_0x4822af){_0x2f331b['push'](_0x2f331b['shift']());}};_0x556f55(++_0x199244);}(_0xc0e8,0xdc));var _0x8c0e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc0e8[_0x20a584];return _0x4b41a8;};'use strict';var schema=require(_0x8c0e('0x0'));var _=require('lodash');var logger=require(_0x8c0e('0x1'))(_0x8c0e('0x2'));var gotop=schema({'priority':{'type':_0x8c0e('0x3'),'required':!![],'message':_0x8c0e('0x4')}});exports['consequence']=function(_0x2a9660,_0x2a34ac){return function(_0x41d452){try{var _0x19686b={'priority':_0x2a34ac[0x0]};var _0x313e3a=gotop[_0x8c0e('0x0')](_0x19686b,{'typecast':!![]});if(_0x313e3a['length']){logger[_0x8c0e('0x5')](_0x8c0e('0x6'),_0x2a9660,_['map'](_0x313e3a,'message')[_0x8c0e('0x7')](',\x20'));_0x41d452['stop']();}else{logger[_0x8c0e('0x8')]('[%s][GOTOP]\x20priority\x20%s',_0x2a9660,_0x19686b[_0x8c0e('0x9')]);if(_0x19686b[_0x8c0e('0x9')]){var _0x47ea36=_['findIndex'](_0x41d452[_0x8c0e('0xa')](),{'p':_0x19686b[_0x8c0e('0x9')]});if(_0x47ea36>=0x0){logger[_0x8c0e('0x8')](_0x8c0e('0xb'),_0x2a9660,_0x19686b[_0x8c0e('0x9')]||_0x8c0e('0xc'),_0x47ea36);_0x41d452[_0x8c0e('0xc')](_0x47ea36);}else{logger[_0x8c0e('0x8')](_0x8c0e('0xd'),_0x2a9660,_0x19686b['priority']||_0x8c0e('0xc'));_0x41d452['stop']();}}else{_0x41d452['next']();}}}catch(_0x4849c5){logger[_0x8c0e('0x5')](_0x8c0e('0x6'),_0x2a9660,JSON[_0x8c0e('0xe')](_0x4849c5));_0x41d452[_0x8c0e('0xf')]();}};}; \ No newline at end of file +var _0x4142=['number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next','stringify','routing'];(function(_0x24a6bf,_0x357772){var _0x21cf49=function(_0x25e93a){while(--_0x25e93a){_0x24a6bf['push'](_0x24a6bf['shift']());}};_0x21cf49(++_0x357772);}(_0x4142,0x179));var _0x2414=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4142[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require('../../../../config/logger')(_0x2414('0x0'));var gotop=schema({'priority':{'type':_0x2414('0x1'),'required':!![],'message':_0x2414('0x2')}});exports[_0x2414('0x3')]=function(_0x298960,_0x381af9){return function(_0x1a3487){try{var _0x1df9d7={'priority':_0x381af9[0x0]};var _0x252b23=gotop[_0x2414('0x4')](_0x1df9d7,{'typecast':!![]});if(_0x252b23[_0x2414('0x5')]){logger[_0x2414('0x6')](_0x2414('0x7'),_0x298960,_[_0x2414('0x8')](_0x252b23,'message')[_0x2414('0x9')](',\x20'));_0x1a3487[_0x2414('0xa')]();}else{logger[_0x2414('0xb')](_0x2414('0xc'),_0x298960,_0x1df9d7['priority']);if(_0x1df9d7[_0x2414('0xd')]){var _0x355cc0=_[_0x2414('0xe')](_0x1a3487['rules'](),{'p':_0x1df9d7['priority']});if(_0x355cc0>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x298960,_0x1df9d7[_0x2414('0xd')]||'next',_0x355cc0);_0x1a3487['next'](_0x355cc0);}else{logger[_0x2414('0xb')](_0x2414('0xf'),_0x298960,_0x1df9d7[_0x2414('0xd')]||_0x2414('0x10'));_0x1a3487[_0x2414('0xa')]();}}else{_0x1a3487[_0x2414('0x10')]();}}}catch(_0x2f45e7){logger[_0x2414('0x6')](_0x2414('0x7'),_0x298960,JSON[_0x2414('0x11')](_0x2f45e7));_0x1a3487[_0x2414('0xa')]();}};}; \ 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 3b009a1..c12ffd4 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 _0xb9f4=['../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','account','upperFirst','AccountId','create','then','info','[%s][MESSAGE]\x20%s','catch','error','stringify','stop','lodash','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x97a9ac,_0x38d2cc){var _0x58de49=function(_0x358ba0){while(--_0x358ba0){_0x97a9ac['push'](_0x97a9ac['shift']());}};_0x58de49(++_0x38d2cc);}(_0xb9f4,0x101));var _0x4b9f=function(_0x552bf7,_0x1eefc4){_0x552bf7=_0x552bf7-0x0;var _0x3c6acc=_0xb9f4[_0x552bf7];return _0x3c6acc;};'use strict';var _=require(_0x4b9f('0x0'));var utils=require('./utils');var logger=require(_0x4b9f('0x1'))(_0x4b9f('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x4b9f('0x3')),'mailMessage':require(_0x4b9f('0x4')),'smsMessage':require(_0x4b9f('0x5')),'faxMessage':require(_0x4b9f('0x6')),'whatsappMessage':require(_0x4b9f('0x7'))};exports[_0x4b9f('0x8')]=function(_0x560892,_0x58cdf4){return function(_0x3162fd){try{var _0x10d15e={'body':utils[_0x4b9f('0x9')](_0x58cdf4[0x0],this),'ContactId':this[_0x4b9f('0xa')]['id']};if(this[_0x4b9f('0xb')]==='chat'){_0x10d15e[_0x4b9f('0xc')]=this[_0x4b9f('0xd')]['id'];}else{_0x10d15e[_[_0x4b9f('0xe')](this[_0x4b9f('0xb')])+_0x4b9f('0xf')]=this[_0x4b9f('0xd')]['id'];}_0x10d15e[_['upperFirst'](this[_0x4b9f('0xb')])+'InteractionId']=this['interaction']['id'];if(rpc[this['channel']+'Message']){return rpc[this['channel']+'Message'][_0x4b9f('0x10')](_0x10d15e)[_0x4b9f('0x11')](function(_0x865851){logger[_0x4b9f('0x12')](_0x4b9f('0x13'),_0x560892,_0x10d15e['body']);_0x3162fd['next']();})[_0x4b9f('0x14')](function(_0x310be2){logger[_0x4b9f('0x15')]('[%s][MESSAGE]\x20%s',_0x560892,JSON[_0x4b9f('0x16')](_0x310be2));_0x3162fd[_0x4b9f('0x17')]();});}}catch(_0x2ee988){logger['error']('[%s][MESSAGE]\x20%s',_0x560892,JSON[_0x4b9f('0x16')](_0x2ee988));_0x3162fd[_0x4b9f('0x17')]();}};}; \ No newline at end of file +var _0x73a1=['[%s][MESSAGE]\x20%s','stringify','stop','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','create','info','body','next','catch','error'];(function(_0x439a9a,_0xfe21a3){var _0x585f97=function(_0x587358){while(--_0x587358){_0x439a9a['push'](_0x439a9a['shift']());}};_0x585f97(++_0xfe21a3);}(_0x73a1,0x161));var _0x173a=function(_0x5d8631,_0x44944b){_0x5d8631=_0x5d8631-0x0;var _0x34c15e=_0x73a1[_0x5d8631];return _0x34c15e;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x173a('0x0'))(_0x173a('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x173a('0x2')),'mailMessage':require(_0x173a('0x3')),'smsMessage':require(_0x173a('0x4')),'faxMessage':require(_0x173a('0x5')),'whatsappMessage':require(_0x173a('0x6'))};exports['consequence']=function(_0x417ec0,_0x1a8b94){return function(_0xac84a){try{var _0xbd8757={'body':utils[_0x173a('0x7')](_0x1a8b94[0x0],this),'ContactId':this[_0x173a('0x8')]['id']};if(this[_0x173a('0x9')]===_0x173a('0xa')){_0xbd8757[_0x173a('0xb')]=this[_0x173a('0xc')]['id'];}else{_0xbd8757[_[_0x173a('0xd')](this[_0x173a('0x9')])+'AccountId']=this[_0x173a('0xc')]['id'];}_0xbd8757[_['upperFirst'](this[_0x173a('0x9')])+_0x173a('0xe')]=this[_0x173a('0xf')]['id'];if(rpc[this[_0x173a('0x9')]+'Message']){return rpc[this[_0x173a('0x9')]+'Message'][_0x173a('0x10')](_0xbd8757)['then'](function(_0x127dc2){logger[_0x173a('0x11')]('[%s][MESSAGE]\x20%s',_0x417ec0,_0xbd8757[_0x173a('0x12')]);_0xac84a[_0x173a('0x13')]();})[_0x173a('0x14')](function(_0x20eb9f){logger[_0x173a('0x15')](_0x173a('0x16'),_0x417ec0,JSON[_0x173a('0x17')](_0x20eb9f));_0xac84a[_0x173a('0x18')]();});}}catch(_0x5e4252){logger[_0x173a('0x15')](_0x173a('0x16'),_0x417ec0,JSON[_0x173a('0x17')](_0x5e4252));_0xac84a['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 486e85b..b81b2de 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 _0x7a3a=['../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','next','error','stringify','stop'];(function(_0x441563,_0x1d4a28){var _0x2369ec=function(_0x1f97ba){while(--_0x1f97ba){_0x441563['push'](_0x441563['shift']());}};_0x2369ec(++_0x1d4a28);}(_0x7a3a,0x1c2));var _0xa7a3=function(_0xb16fe4,_0x4dd5b0){_0xb16fe4=_0xb16fe4-0x0;var _0x1149e2=_0x7a3a[_0xb16fe4];return _0x1149e2;};'use strict';var utils=require('./utils');var logger=require(_0xa7a3('0x0'))(_0xa7a3('0x1'));exports[_0xa7a3('0x2')]=function(_0x34cd91,_0x5cba24){return function(_0x2c6912){try{logger[_0xa7a3('0x3')](_0xa7a3('0x4'),_0x34cd91,utils['getMustacheRender'](_0x5cba24[0x0],this));_0x2c6912[_0xa7a3('0x5')]();}catch(_0x1eceac){logger[_0xa7a3('0x6')](_0xa7a3('0x4'),_0x34cd91,JSON[_0xa7a3('0x7')](_0x1eceac));_0x2c6912[_0xa7a3('0x8')]();}};}; \ No newline at end of file +var _0x20bb=['getMustacheRender','next','error','[%s][NOOP]\x20%s','stringify','stop','../../../../config/logger','routing','consequence'];(function(_0x3b185c,_0x5a3f59){var _0x567483=function(_0x50a73b){while(--_0x50a73b){_0x3b185c['push'](_0x3b185c['shift']());}};_0x567483(++_0x5a3f59);}(_0x20bb,0x180));var _0xb20b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x20bb[_0x321bb2];return _0x9c12ed;};'use strict';var utils=require('./utils');var logger=require(_0xb20b('0x0'))(_0xb20b('0x1'));exports[_0xb20b('0x2')]=function(_0x30518d,_0x13b6be){return function(_0x4ebf11){try{logger['info']('[%s][NOOP]\x20%s',_0x30518d,utils[_0xb20b('0x3')](_0x13b6be[0x0],this));_0x4ebf11[_0xb20b('0x4')]();}catch(_0x3c41c9){logger[_0xb20b('0x5')](_0xb20b('0x6'),_0x30518d,JSON[_0xb20b('0x7')](_0x3c41c9));_0x4ebf11[_0xb20b('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 019f855..9176fc3 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 _0x96c4=['atimeout','qtimeout','rules','end','close','complete','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','push','InteractionId','pick','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','interaction','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport','catch','error','create\x20queue\x20report','accepted','Interaction','update','then','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','createQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96c4,0x15b));var _0x496c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x96c4[_0x2dafbe];return _0x58a45a;};'use strict';var schema=require(_0x496c('0x0'));var _=require(_0x496c('0x1'));var util=require(_0x496c('0x2'));var seqqueue=require(_0x496c('0x3'));var moment=require(_0x496c('0x4'));var Redis=require(_0x496c('0x5'));var config=require(_0x496c('0x6'));var logger=require(_0x496c('0x7'))('routing');var strategy=require('./strategy');config[_0x496c('0x8')]=_['defaults'](config[_0x496c('0x8')],{'host':_0x496c('0x9'),'port':0x18eb});var io=require(_0x496c('0xa'))(new Redis(config[_0x496c('0x8')]));var attributes=['id',_0x496c('0xb'),_0x496c('0xc'),_0x496c('0xd'),_0x496c('0xe'),_0x496c('0xf')];function emit(_0x39daba,_0x564181,_0xd3c6a7){io['to'](_0x39daba)[_0x496c('0x10')](_0x564181,_0xd3c6a7);}function emitChannelQueueInteraction(_0x31a819,_0x50c00c,_0x3df710,_0x49b122,_0x41a35c,_0x458da4,_0x3e69df,_0x1f8d45){var _0x2b05fd=_[_0x496c('0x11')](_0x3df710);_0x2b05fd[_0x496c('0xb')]=_0x1f8d45;_0x2b05fd[_0x496c('0xd')]=_0x50c00c;_0x2b05fd[_0x496c('0xc')]=_0x49b122;_0x2b05fd['id']=_0x41a35c;if(_0x458da4){attributes[_0x496c('0x12')](_['capitalize'](_0x31a819)+_0x496c('0x13'));_0x3e69df[util['format']('%sQueuesWaitingInteractions',_0x31a819)][_0x41a35c]=_[_0x496c('0x14')](_0x2b05fd,attributes);}else{delete _0x3e69df[util[_0x496c('0x15')](_0x496c('0x16'),_0x31a819)][_0x41a35c];}emit(util[_0x496c('0x15')]('%s:queue:%s',_0x31a819,_0x50c00c),util['format'](_0x496c('0x17'),_0x31a819,_0x458da4?_0x496c('0x18'):'remove'),_['pick'](_0x2b05fd,attributes));}var rpc={'openchannelQueueReport':require(_0x496c('0x19')),'mailQueueReport':require(_0x496c('0x1a')),'chatQueueReport':require(_0x496c('0x1b')),'smsQueueReport':require(_0x496c('0x1c')),'faxQueueReport':require(_0x496c('0x1d')),'whatsappQueueReport':require(_0x496c('0x1e')),'chatInteraction':require(_0x496c('0x1f')),'faxInteraction':require(_0x496c('0x20')),'mailInteraction':require(_0x496c('0x21')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var queue=schema({'name':{'type':_0x496c('0x22'),'required':!![],'message':_0x496c('0x23')},'timeout':{'type':'number','message':_0x496c('0x24')}});function startRouting(_0x5546a0,_0x42bed8,_0x2cfb17,_0x5e8984){if(_0x5546a0&&_0x42bed8&&_0x2cfb17){_0x42bed8[_0x496c('0x25')]+=0x1;var _0x2c525f={'uniqueid':_0x5546a0,'from':_0x2cfb17[_0x496c('0x26')]?_0x2cfb17['body'][_0x496c('0xe')]:'','joinAt':moment()[_0x496c('0x15')](_0x496c('0x27')),'ContactId':_0x2cfb17[_0x496c('0x28')]?_0x2cfb17[_0x496c('0x28')]['id']:null,'ListId':_0x2cfb17[_0x496c('0x29')]?_0x2cfb17[_0x496c('0x29')]['id']:null};_0x2c525f[_['upperFirst'](_0x2cfb17[_0x496c('0x2a')])+_0x496c('0x2b')]=_0x42bed8['id']||null;_0x2c525f[_[_0x496c('0x2c')](_0x2cfb17[_0x496c('0x2a')])+'InteractionId']=_0x2cfb17['interaction']?_0x2cfb17[_0x496c('0x2d')]['id']:null;_0x2c525f[_[_0x496c('0x2c')](_0x2cfb17['channel'])+_0x496c('0x2e')]=_0x2cfb17[_0x496c('0x2f')]?_0x2cfb17[_0x496c('0x2f')]['id']:null;_0x2c525f[_[_0x496c('0x2c')](_0x2cfb17[_0x496c('0x2a')])+(_0x2cfb17[_0x496c('0x2a')]!==_0x496c('0x30')?_0x496c('0x31'):_0x496c('0x32'))]=_0x2cfb17[_0x496c('0xc')]?_0x2cfb17[_0x496c('0xc')]['id']:null;logger[_0x496c('0x33')](util[_0x496c('0x15')]('[%s][START:QUEUE][NAME:%s]',_0x5546a0,_0x42bed8[_0x496c('0x34')]));emitChannelQueueInteraction(_0x2cfb17[_0x496c('0x2a')],_0x42bed8[_0x496c('0x34')],_0x2c525f,_0x2cfb17['account'][_0x496c('0x34')],_0x2cfb17[_0x496c('0x2f')]['id'],!![],_0x5e8984,_0x42bed8['id']);if(rpc[_0x2cfb17[_0x496c('0x2a')]+'QueueReport']){return rpc[_0x2cfb17['channel']+_0x496c('0x35')]['create'](_0x2c525f)[_0x496c('0x36')](function(_0x528457){logger[_0x496c('0x37')](_0x496c('0x38'),_0x528457);});}}}function stopRouting(_0x5408db,_0x44187e,_0xb16e16,_0x2e08b2){if(_0x5408db&&_0x44187e){_0x44187e['waiting']-=0x1;var _0x211537={'leaveAt':moment()[_0x496c('0x15')](_0x496c('0x27')),'acceptAt':moment()[_0x496c('0x15')](_0x496c('0x27')),'reason':_0x496c('0x39')};logger[_0x496c('0x33')](util[_0x496c('0x15')]('[%s][STOP:QUEUE][NAME:%s]',_0x5408db,_0x44187e[_0x496c('0x34')]));emitChannelQueueInteraction(_0xb16e16[_0x496c('0x2a')],_0x44187e[_0x496c('0x34')],_0xb16e16[_0x496c('0x26')],_0xb16e16[_0x496c('0xc')]['name'],_0xb16e16[_0x496c('0x2f')]['id'],![],_0x2e08b2,_0x44187e['id']);return rpc[_0xb16e16[_0x496c('0x2a')]+_0x496c('0x3a')][_0x496c('0x3b')](_0xb16e16['interaction']['id'],{'queueId':_0x44187e['id']})[_0x496c('0x3c')](function(){if(rpc[_0xb16e16[_0x496c('0x2a')]+_0x496c('0x35')]){return rpc[_0xb16e16[_0x496c('0x2a')]+_0x496c('0x35')][_0x496c('0x3b')](_0x5408db,_0x211537)[_0x496c('0x36')](function(_0x3d35db){logger[_0x496c('0x37')]('update\x20queue\x20report',_0x3d35db);});}});}}function endRouting(_0x5153bb,_0x15c4c3,_0xef51e2,_0xfb8a79){if(_0x5153bb&&_0x15c4c3){_0x15c4c3[_0x496c('0x25')]-=0x1;var _0x5d5c86={'leaveAt':moment()['format'](_0x496c('0x27')),'exitAt':moment()[_0x496c('0x15')](_0x496c('0x27')),'reason':_0x496c('0x3d')};logger[_0x496c('0x33')](util[_0x496c('0x15')](_0x496c('0x3e'),_0x5153bb,_0x15c4c3['name']));emitChannelQueueInteraction(_0xef51e2['channel'],_0x15c4c3[_0x496c('0x34')],_0xef51e2[_0x496c('0x26')],_0xef51e2['account'][_0x496c('0x34')],_0xef51e2[_0x496c('0x2f')]['id'],![],_0xfb8a79);if(rpc[_0xef51e2[_0x496c('0x2a')]+_0x496c('0x35')]){return rpc[_0xef51e2['channel']+_0x496c('0x35')]['update'](_0x5153bb,_0x5d5c86)[_0x496c('0x36')](function(_0xf84ff9){logger[_0x496c('0x37')](_0x496c('0x3f'),_0xf84ff9);});}}}function handleFindQueue(_0x1a10b3){return function(_0x34e31a){return _0x34e31a[_0x496c('0x34')]['toLowerCase']()===_0x1a10b3[_0x496c('0x40')]();};}exports[_0x496c('0x41')]=function(_0x2f291f,_0x5f0880,_0x37846f,_0x2e9e13){return function(_0xc746ff){try{var _0x43b69b={'name':_0x5f0880[0x0],'timeout':_0x5f0880[0x1]};var _0xa634c4=queue['validate'](_0x43b69b,{'typecast':!![]});if(_0xa634c4[_0x496c('0x42')]){logger[_0x496c('0x37')](_0x496c('0x43'),_0x2f291f,_['map'](_0xa634c4,'message')[_0x496c('0x44')](',\x20'));_0xc746ff[_0x496c('0x45')]();}else{var _0x49f378=_[_0x496c('0x46')](_0x37846f[_0x2e9e13['channel']+_0x496c('0x47')],handleFindQueue(_0x43b69b['name']));if(_0x49f378){startRouting(_0x2f291f,_0x49f378,_0x2e9e13,_0x37846f);var _0x449db3=(_0x49f378[_0x496c('0x3d')]||0xa)*0x3e8;var _0xd3925f=(_0x43b69b[_0x496c('0x3d')]||0x14)*0x3e8;var _0x22b3a4;if(_0x449db3>_0xd3925f){_0xd3925f=_0x449db3;}var _0x16905a=seqqueue[_0x496c('0x48')](_0x449db3);_0x16905a['id']=_0x2f291f;_0x16905a[_0x496c('0x49')]=_0x449db3;_0x16905a[_0x496c('0x4a')]=_0xd3925f;_0x16905a[_0x496c('0x2a')]=_0x2e9e13['channel'];_0x37846f[_0x496c('0x4b')][_0x2f291f]['on'](_0x496c('0x4c'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x2f291f);stopRouting(_0x2f291f,_0x49f378,_0x2e9e13,_0x37846f);clearTimeout(_0x22b3a4);_0x22b3a4=undefined;_0x16905a[_0x496c('0x4d')](!![]);if(_0x37846f['rules'][_0x2f291f]){delete _0x37846f[_0x496c('0x4b')][_0x2f291f];}_0xc746ff[_0x496c('0x45')]();});_0x37846f[_0x496c('0x4b')][_0x2f291f]['on'](_0x496c('0x4e'),function(){if(_0x37846f[_0x496c('0x4b')][_0x2f291f]){delete _0x37846f[_0x496c('0x4b')][_0x2f291f];}});_0x22b3a4=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x2f291f);endRouting(_0x2f291f,_0x49f378,_0x2e9e13,_0x37846f);clearTimeout(_0x22b3a4);_0x16905a[_0x496c('0x4d')](!![]);_0xc746ff[_0x496c('0x4f')]();},_0xd3925f);switch(_0x49f378[_0x496c('0x50')]){case _0x496c('0x51'):strategy[_0x496c('0x51')](_0x16905a,_0x49f378,_0x37846f,_0x2e9e13);break;default:strategy['beepall'](_0x16905a,_0x49f378,_0x37846f,_0x2e9e13);}}else{logger[_0x496c('0x37')](_0x496c('0x52'),_0x2f291f,_0x43b69b[_0x496c('0x34')]);_0xc746ff[_0x496c('0x45')]();}}}catch(_0x8fd7ee){logger[_0x496c('0x37')]('[%s][QUEUE]\x20%s',_0x2f291f,_0x8fd7ee[_0x496c('0x53')]);_0xc746ff[_0x496c('0x45')]();}};}; \ No newline at end of file +var _0x2828=['%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','contact','list','channel','QueueId','upperFirst','interaction','MessageId','message','chat','WebsiteId','info','name','QueueReport','catch','create\x20queue\x20report','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','then','update','error','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','stop','find','Queues','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','stack','validate','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','./strategy','redis','defaults','socket.io-emitter','queue_id','account','queue','from','joinAt','clone','push','capitalize','InteractionId','format','pick','%sQueuesWaitingInteractions'];(function(_0x101176,_0x1ad975){var _0x4ec27c=function(_0x13b7bb){while(--_0x13b7bb){_0x101176['push'](_0x101176['shift']());}};_0x4ec27c(++_0x1ad975);}(_0x2828,0x18e));var _0x8282=function(_0x400096,_0x101dc3){_0x400096=_0x400096-0x0;var _0x31755a=_0x2828[_0x400096];return _0x31755a;};'use strict';var schema=require(_0x8282('0x0'));var _=require('lodash');var util=require(_0x8282('0x1'));var seqqueue=require(_0x8282('0x2'));var moment=require(_0x8282('0x3'));var Redis=require('ioredis');var config=require(_0x8282('0x4'));var logger=require(_0x8282('0x5'))('routing');var strategy=require(_0x8282('0x6'));config[_0x8282('0x7')]=_[_0x8282('0x8')](config[_0x8282('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x8282('0x9'))(new Redis(config['redis']));var attributes=['id',_0x8282('0xa'),_0x8282('0xb'),_0x8282('0xc'),_0x8282('0xd'),_0x8282('0xe')];function emit(_0x5ea25a,_0x1aa25a,_0x17f742){io['to'](_0x5ea25a)['emit'](_0x1aa25a,_0x17f742);}function emitChannelQueueInteraction(_0xf0782b,_0x16dcb2,_0x32b3aa,_0x4fe098,_0x2d2691,_0x5ba6c4,_0x144d62,_0x40a09b){var _0x572997=_[_0x8282('0xf')](_0x32b3aa);_0x572997['queue_id']=_0x40a09b;_0x572997[_0x8282('0xc')]=_0x16dcb2;_0x572997['account']=_0x4fe098;_0x572997['id']=_0x2d2691;if(_0x5ba6c4){attributes[_0x8282('0x10')](_[_0x8282('0x11')](_0xf0782b)+_0x8282('0x12'));_0x144d62[util[_0x8282('0x13')]('%sQueuesWaitingInteractions',_0xf0782b)][_0x2d2691]=_[_0x8282('0x14')](_0x572997,attributes);}else{delete _0x144d62[util[_0x8282('0x13')](_0x8282('0x15'),_0xf0782b)][_0x2d2691];}emit(util[_0x8282('0x13')]('%s:queue:%s',_0xf0782b,_0x16dcb2),util[_0x8282('0x13')](_0x8282('0x16'),_0xf0782b,_0x5ba6c4?_0x8282('0x17'):_0x8282('0x18')),_[_0x8282('0x14')](_0x572997,attributes));}var rpc={'openchannelQueueReport':require(_0x8282('0x19')),'mailQueueReport':require(_0x8282('0x1a')),'chatQueueReport':require(_0x8282('0x1b')),'smsQueueReport':require(_0x8282('0x1c')),'faxQueueReport':require(_0x8282('0x1d')),'whatsappQueueReport':require(_0x8282('0x1e')),'chatInteraction':require('../../rpc/chatInteraction'),'faxInteraction':require(_0x8282('0x1f')),'mailInteraction':require(_0x8282('0x20')),'openchannelInteraction':require(_0x8282('0x21')),'smsInteraction':require(_0x8282('0x22')),'whatsappInteraction':require(_0x8282('0x23'))};var queue=schema({'name':{'type':_0x8282('0x24'),'required':!![],'message':_0x8282('0x25')},'timeout':{'type':_0x8282('0x26'),'message':_0x8282('0x27')}});function startRouting(_0x379345,_0x3f3ea1,_0x466e85,_0x16e4c9){if(_0x379345&&_0x3f3ea1&&_0x466e85){_0x3f3ea1['waiting']+=0x1;var _0x20923c={'uniqueid':_0x379345,'from':_0x466e85[_0x8282('0x28')]?_0x466e85[_0x8282('0x28')]['from']:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x466e85['contact']?_0x466e85[_0x8282('0x29')]['id']:null,'ListId':_0x466e85['list']?_0x466e85[_0x8282('0x2a')]['id']:null};_0x20923c[_['upperFirst'](_0x466e85[_0x8282('0x2b')])+_0x8282('0x2c')]=_0x3f3ea1['id']||null;_0x20923c[_[_0x8282('0x2d')](_0x466e85[_0x8282('0x2b')])+_0x8282('0x12')]=_0x466e85[_0x8282('0x2e')]?_0x466e85[_0x8282('0x2e')]['id']:null;_0x20923c[_[_0x8282('0x2d')](_0x466e85[_0x8282('0x2b')])+_0x8282('0x2f')]=_0x466e85['message']?_0x466e85[_0x8282('0x30')]['id']:null;_0x20923c[_[_0x8282('0x2d')](_0x466e85[_0x8282('0x2b')])+(_0x466e85[_0x8282('0x2b')]!==_0x8282('0x31')?'AccountId':_0x8282('0x32'))]=_0x466e85[_0x8282('0xb')]?_0x466e85[_0x8282('0xb')]['id']:null;logger[_0x8282('0x33')](util[_0x8282('0x13')]('[%s][START:QUEUE][NAME:%s]',_0x379345,_0x3f3ea1[_0x8282('0x34')]));emitChannelQueueInteraction(_0x466e85[_0x8282('0x2b')],_0x3f3ea1['name'],_0x20923c,_0x466e85[_0x8282('0xb')][_0x8282('0x34')],_0x466e85[_0x8282('0x30')]['id'],!![],_0x16e4c9,_0x3f3ea1['id']);if(rpc[_0x466e85[_0x8282('0x2b')]+_0x8282('0x35')]){return rpc[_0x466e85[_0x8282('0x2b')]+_0x8282('0x35')]['create'](_0x20923c)[_0x8282('0x36')](function(_0x5ce507){logger['error'](_0x8282('0x37'),_0x5ce507);});}}}function stopRouting(_0x5bd7a1,_0x948496,_0x262c7f,_0x1b9fc1){if(_0x5bd7a1&&_0x948496){_0x948496[_0x8282('0x38')]-=0x1;var _0xe5cebf={'leaveAt':moment()['format'](_0x8282('0x39')),'acceptAt':moment()[_0x8282('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x8282('0x3a')};logger[_0x8282('0x33')](util['format'](_0x8282('0x3b'),_0x5bd7a1,_0x948496[_0x8282('0x34')]));emitChannelQueueInteraction(_0x262c7f[_0x8282('0x2b')],_0x948496[_0x8282('0x34')],_0x262c7f[_0x8282('0x28')],_0x262c7f['account'][_0x8282('0x34')],_0x262c7f[_0x8282('0x30')]['id'],![],_0x1b9fc1,_0x948496['id']);return rpc[_0x262c7f['channel']+_0x8282('0x3c')]['update'](_0x262c7f['interaction']['id'],{'queueId':_0x948496['id']})[_0x8282('0x3d')](function(){if(rpc[_0x262c7f[_0x8282('0x2b')]+_0x8282('0x35')]){return rpc[_0x262c7f[_0x8282('0x2b')]+_0x8282('0x35')][_0x8282('0x3e')](_0x5bd7a1,_0xe5cebf)['catch'](function(_0x155ab6){logger[_0x8282('0x3f')](_0x8282('0x40'),_0x155ab6);});}});}}function endRouting(_0x115666,_0xabc128,_0x4a65f9,_0x266595){if(_0x115666&&_0xabc128){_0xabc128[_0x8282('0x38')]-=0x1;var _0x313554={'leaveAt':moment()[_0x8282('0x13')](_0x8282('0x39')),'exitAt':moment()[_0x8282('0x13')](_0x8282('0x39')),'reason':'timeout'};logger['info'](util[_0x8282('0x13')](_0x8282('0x41'),_0x115666,_0xabc128['name']));emitChannelQueueInteraction(_0x4a65f9[_0x8282('0x2b')],_0xabc128[_0x8282('0x34')],_0x4a65f9[_0x8282('0x28')],_0x4a65f9[_0x8282('0xb')][_0x8282('0x34')],_0x4a65f9[_0x8282('0x30')]['id'],![],_0x266595);if(rpc[_0x4a65f9[_0x8282('0x2b')]+'QueueReport']){return rpc[_0x4a65f9[_0x8282('0x2b')]+'QueueReport'][_0x8282('0x3e')](_0x115666,_0x313554)[_0x8282('0x36')](function(_0x1be5ff){logger['error']('update\x20queue\x20report',_0x1be5ff);});}}}function handleFindQueue(_0x24bec5){return function(_0x4ef1ee){return _0x4ef1ee['name']['toLowerCase']()===_0x24bec5[_0x8282('0x42')]();};}exports[_0x8282('0x43')]=function(_0x12f44c,_0x3db09b,_0x163ed1,_0x420097){return function(_0x3c5445){try{var _0x435d1f={'name':_0x3db09b[0x0],'timeout':_0x3db09b[0x1]};var _0x11375e=queue['validate'](_0x435d1f,{'typecast':!![]});if(_0x11375e['length']){logger['error'](_0x8282('0x44'),_0x12f44c,_[_0x8282('0x45')](_0x11375e,_0x8282('0x30'))['join'](',\x20'));_0x3c5445[_0x8282('0x46')]();}else{var _0x25b756=_[_0x8282('0x47')](_0x163ed1[_0x420097[_0x8282('0x2b')]+_0x8282('0x48')],handleFindQueue(_0x435d1f[_0x8282('0x34')]));if(_0x25b756){startRouting(_0x12f44c,_0x25b756,_0x420097,_0x163ed1);var _0x479a54=(_0x25b756['timeout']||0xa)*0x3e8;var _0x180bf1=(_0x435d1f['timeout']||0x14)*0x3e8;var _0x286b17;if(_0x479a54>_0x180bf1){_0x180bf1=_0x479a54;}var _0x48ce1e=seqqueue['createQueue'](_0x479a54);_0x48ce1e['id']=_0x12f44c;_0x48ce1e[_0x8282('0x49')]=_0x479a54;_0x48ce1e[_0x8282('0x4a')]=_0x180bf1;_0x48ce1e[_0x8282('0x2b')]=_0x420097['channel'];_0x163ed1[_0x8282('0x4b')][_0x12f44c]['on'](_0x8282('0x4c'),function(){logger['info'](_0x8282('0x4d'),_0x12f44c);stopRouting(_0x12f44c,_0x25b756,_0x420097,_0x163ed1);clearTimeout(_0x286b17);_0x286b17=undefined;_0x48ce1e['close'](!![]);if(_0x163ed1['rules'][_0x12f44c]){delete _0x163ed1[_0x8282('0x4b')][_0x12f44c];}_0x3c5445['stop']();});_0x163ed1['rules'][_0x12f44c]['on'](_0x8282('0x4e'),function(){if(_0x163ed1['rules'][_0x12f44c]){delete _0x163ed1[_0x8282('0x4b')][_0x12f44c];}});_0x286b17=setTimeout(function(){logger[_0x8282('0x33')](_0x8282('0x4f'),_0x12f44c);endRouting(_0x12f44c,_0x25b756,_0x420097,_0x163ed1);clearTimeout(_0x286b17);_0x48ce1e[_0x8282('0x50')](!![]);_0x3c5445[_0x8282('0x51')]();},_0x180bf1);switch(_0x25b756[_0x8282('0x52')]){case'rrmemory':strategy['rrmemory'](_0x48ce1e,_0x25b756,_0x163ed1,_0x420097);break;default:strategy['beepall'](_0x48ce1e,_0x25b756,_0x163ed1,_0x420097);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x12f44c,_0x435d1f[_0x8282('0x34')]);_0x3c5445[_0x8282('0x46')]();}}}catch(_0x2b6195){logger['error'](_0x8282('0x44'),_0x12f44c,_0x2b6195[_0x8282('0x53')]);_0x3c5445['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 614e9f9..a41072b 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 _0xb903=['[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','agent','routing','handleRun','bind','handleTimeout','handleDrained','push','debug','isNil','realtime','agents','forcedOwnership','isAgentAvailable','busy','busyQueue','saveWaitingNotification','channel','showNotification','writeLog','RINGING',':FORCED'];(function(_0xea82b0,_0x592681){var _0x1ee530=function(_0x37f85b){while(--_0x37f85b){_0xea82b0['push'](_0xea82b0['shift']());}};_0x1ee530(++_0x592681);}(_0xb903,0x185));var _0x3b90=function(_0x1277f8,_0x19db4c){_0x1277f8=_0x1277f8-0x0;var _0x37cd0e=_0xb903[_0x1277f8];return _0x37cd0e;};'use strict';var _=require(_0x3b90('0x0'));var uuid=require(_0x3b90('0x1'));var util=require(_0x3b90('0x2'));var logger=require(_0x3b90('0x3'))('routing');var Agent=function(_0x3312ca,_0xf414f4,_0x3b024a,_0x1cd5d8){this[_0x3b90('0x4')]=uuid['v4']();this[_0x3b90('0x5')]=_0x3312ca;this[_0x3b90('0x6')]=_0xf414f4;this['realtime']=_0x3b024a;this[_0x3b90('0x7')]=_0x1cd5d8;this['squeue']['push'](this[_0x3b90('0x8')][_0x3b90('0x9')](this),this[_0x3b90('0xa')][_0x3b90('0x9')](this));this['squeue']['on']('timeout',this['handleTimeout']['bind'](this));this['squeue']['on']('drained',this[_0x3b90('0xb')][_0x3b90('0x9')](this));};Agent['prototype'][_0x3b90('0xc')]=function(){this[_0x3b90('0x5')]['push'](this[_0x3b90('0x8')][_0x3b90('0x9')](this),this[_0x3b90('0xa')]['bind'](this));};Agent['prototype'][_0x3b90('0xb')]=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0x3b90('0x8')]=function(){logger[_0x3b90('0xd')]('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this[_0x3b90('0x6')]['id']);if(_[_0x3b90('0xe')](this[_0x3b90('0xf')][_0x3b90('0x10')][this[_0x3b90('0x6')]['id']])){logger['debug']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x3b90('0x5')]['id'],this[_0x3b90('0x6')]['id']);setTimeout(this['push'][_0x3b90('0x9')](this),0x3e8);}else{if(this[_0x3b90('0x7')][_0x3b90('0x11')]||util[_0x3b90('0x12')](this['squeue']['id'],this[_0x3b90('0xf')]['agents'][this[_0x3b90('0x6')]['id']],this[_0x3b90('0x5')]['channel'],![])){this[_0x3b90('0xf')][_0x3b90('0x10')][this[_0x3b90('0x6')]['id']][_0x3b90('0x13')]=!![];this[_0x3b90('0xf')][_0x3b90('0x10')][this[_0x3b90('0x6')]['id']][_0x3b90('0x14')]=undefined;util[_0x3b90('0x15')](this[_0x3b90('0xf')],this['routing'],this[_0x3b90('0x6')],this[_0x3b90('0x5')][_0x3b90('0x16')]);util[_0x3b90('0x17')](this[_0x3b90('0x4')],this[_0x3b90('0x5')]['id'],this['realtime']['agents'][this[_0x3b90('0x6')]['id']],null,this[_0x3b90('0x7')]);util[_0x3b90('0x18')](this[_0x3b90('0x5')]['id'],this['realtime'][_0x3b90('0x10')][this[_0x3b90('0x6')]['id']],_0x3b90('0x19')+(this['routing'][_0x3b90('0x11')]?_0x3b90('0x1a'):''));}else{logger[_0x3b90('0xd')](_0x3b90('0x1b'),this[_0x3b90('0x5')]['id'],this[_0x3b90('0x6')]['id']);setTimeout(this['push'][_0x3b90('0x9')](this),0x3e8);}}};Agent['prototype'][_0x3b90('0xa')]=function(_0x9891e4){if(_[_0x3b90('0xe')](this[_0x3b90('0xf')][_0x3b90('0x10')][this[_0x3b90('0x6')]['id']])){return logger[_0x3b90('0xd')](_0x3b90('0x1c'),this['squeue']['id'],this['agent']['id']);}else{logger[_0x3b90('0xd')](_0x3b90('0x1d'),this[_0x3b90('0x5')]['id'],this[_0x3b90('0x6')]['id']);util['hideNotification'](this['notificationId'],this[_0x3b90('0x5')]['id'],this[_0x3b90('0xf')][_0x3b90('0x10')][this['agent']['id']],null,this[_0x3b90('0x7')]);this['realtime']['agents'][this[_0x3b90('0x6')]['id']][_0x3b90('0x13')]=![];this['realtime'][_0x3b90('0x10')][this[_0x3b90('0x6')]['id']][_0x3b90('0x14')]=undefined;util['removeWaitingNotification'](this['realtime'],this[_0x3b90('0x7')],this[_0x3b90('0x6')],this[_0x3b90('0x5')][_0x3b90('0x16')]);util['writeLog'](this['squeue']['id'],this[_0x3b90('0xf')][_0x3b90('0x10')][this['agent']['id']],_0x9891e4?'STOP':_0x3b90('0x1e'));}if(!_0x9891e4){setTimeout(this[_0x3b90('0xc')][_0x3b90('0x9')](this),0x3e8);}};function agent(_0x298df6,_0x5a3266,_0x2154e2,_0x583842){return new Agent(_0x298df6,_0x5a3266,_0x2154e2,_0x583842);}module[_0x3b90('0x1f')]=agent; \ No newline at end of file +var _0x3937=['prototype','handleDrained','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','channel','busy','showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','notificationId','squeue','agent','realtime','routing','push','handleRun','bind','timeout','handleTimeout'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x3937,0xbf));var _0x7393=function(_0x216d32,_0x57baa5){_0x216d32=_0x216d32-0x0;var _0x4a6700=_0x3937[_0x216d32];return _0x4a6700;};'use strict';var _=require(_0x7393('0x0'));var uuid=require('uuid');var util=require(_0x7393('0x1'));var logger=require(_0x7393('0x2'))('routing');var Agent=function(_0x45cd02,_0x503841,_0x224468,_0x4c9c71){this[_0x7393('0x3')]=uuid['v4']();this[_0x7393('0x4')]=_0x45cd02;this[_0x7393('0x5')]=_0x503841;this[_0x7393('0x6')]=_0x224468;this[_0x7393('0x7')]=_0x4c9c71;this[_0x7393('0x4')][_0x7393('0x8')](this[_0x7393('0x9')][_0x7393('0xa')](this),this['handleTimeout']['bind'](this));this[_0x7393('0x4')]['on'](_0x7393('0xb'),this[_0x7393('0xc')]['bind'](this));this[_0x7393('0x4')]['on']('drained',this['handleDrained']['bind'](this));};Agent['prototype'][_0x7393('0x8')]=function(){this[_0x7393('0x4')][_0x7393('0x8')](this['handleRun'][_0x7393('0xa')](this),this[_0x7393('0xc')][_0x7393('0xa')](this));};Agent[_0x7393('0xd')][_0x7393('0xe')]=function(){this[_0x7393('0xc')](!![]);};Agent[_0x7393('0xd')][_0x7393('0x9')]=function(){logger[_0x7393('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this[_0x7393('0x5')]['id']);if(_['isNil'](this['realtime']['agents'][this[_0x7393('0x5')]['id']])){logger['debug'](_0x7393('0x10'),this[_0x7393('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x7393('0x8')]['bind'](this),0x3e8);}else{if(this['routing'][_0x7393('0x11')]||util[_0x7393('0x12')](this[_0x7393('0x4')]['id'],this[_0x7393('0x6')][_0x7393('0x13')][this[_0x7393('0x5')]['id']],this[_0x7393('0x4')][_0x7393('0x14')],![])){this['realtime']['agents'][this[_0x7393('0x5')]['id']][_0x7393('0x15')]=!![];this[_0x7393('0x6')][_0x7393('0x13')][this[_0x7393('0x5')]['id']]['busyQueue']=undefined;util['saveWaitingNotification'](this['realtime'],this[_0x7393('0x7')],this['agent'],this['squeue'][_0x7393('0x14')]);util[_0x7393('0x16')](this['notificationId'],this[_0x7393('0x4')]['id'],this[_0x7393('0x6')][_0x7393('0x13')][this[_0x7393('0x5')]['id']],null,this[_0x7393('0x7')]);util[_0x7393('0x17')](this[_0x7393('0x4')]['id'],this[_0x7393('0x6')][_0x7393('0x13')][this[_0x7393('0x5')]['id']],_0x7393('0x18')+(this[_0x7393('0x7')][_0x7393('0x11')]?':FORCED':''));}else{logger[_0x7393('0xf')](_0x7393('0x19'),this[_0x7393('0x4')]['id'],this[_0x7393('0x5')]['id']);setTimeout(this[_0x7393('0x8')][_0x7393('0xa')](this),0x3e8);}}};Agent['prototype'][_0x7393('0xc')]=function(_0x4befa4){if(_[_0x7393('0x1a')](this['realtime'][_0x7393('0x13')][this[_0x7393('0x5')]['id']])){return logger[_0x7393('0xf')](_0x7393('0x10'),this[_0x7393('0x4')]['id'],this[_0x7393('0x5')]['id']);}else{logger[_0x7393('0xf')](_0x7393('0x1b'),this[_0x7393('0x4')]['id'],this[_0x7393('0x5')]['id']);util[_0x7393('0x1c')](this[_0x7393('0x3')],this['squeue']['id'],this['realtime'][_0x7393('0x13')][this['agent']['id']],null,this[_0x7393('0x7')]);this['realtime'][_0x7393('0x13')][this['agent']['id']][_0x7393('0x15')]=![];this[_0x7393('0x6')][_0x7393('0x13')][this[_0x7393('0x5')]['id']][_0x7393('0x1d')]=undefined;util[_0x7393('0x1e')](this[_0x7393('0x6')],this[_0x7393('0x7')],this[_0x7393('0x5')],this[_0x7393('0x4')]['channel']);util[_0x7393('0x17')](this['squeue']['id'],this[_0x7393('0x6')]['agents'][this[_0x7393('0x5')]['id']],_0x4befa4?_0x7393('0x1f'):_0x7393('0x20'));}if(!_0x4befa4){setTimeout(this[_0x7393('0x8')][_0x7393('0xa')](this),0x3e8);}};function agent(_0x487a9b,_0x14ee6e,_0x596f49,_0x434333){return new Agent(_0x487a9b,_0x14ee6e,_0x596f49,_0x434333);}module[_0x7393('0x21')]=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 7d12745..66a65d3 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 _0x88c0=['queue','push','handleRun','bind','handleTimeout','timeout','drained','prototype','handleDrained','isNil','Agents','length','realtime','agents','debug','isAgentAvailable','writeLog','busy','busyQueue','name','channel','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','TIMEOUT','removeWaitingNotification','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue'];(function(_0x283270,_0x4b05ec){var _0x2a3cdf=function(_0x2d4f80){while(--_0x2d4f80){_0x283270['push'](_0x283270['shift']());}};_0x2a3cdf(++_0x4b05ec);}(_0x88c0,0x165));var _0x088c=function(_0x11b4cd,_0x178af0){_0x11b4cd=_0x11b4cd-0x0;var _0x280506=_0x88c0[_0x11b4cd];return _0x280506;};'use strict';var _=require('lodash');var uuid=require(_0x088c('0x0'));var util=require(_0x088c('0x1'));var logger=require(_0x088c('0x2'))(_0x088c('0x3'));var Beepall=function(_0x21331c,_0xb16198,_0x2ba2f5,_0x4b5de3){this[_0x088c('0x4')]=uuid['v4']();this[_0x088c('0x5')]=_0x21331c;this[_0x088c('0x6')]=_0xb16198;this['realtime']=_0x2ba2f5;this[_0x088c('0x3')]=_0x4b5de3;this[_0x088c('0x5')][_0x088c('0x7')](this[_0x088c('0x8')][_0x088c('0x9')](this),this[_0x088c('0xa')][_0x088c('0x9')](this));this[_0x088c('0x5')]['on'](_0x088c('0xb'),this[_0x088c('0xa')]['bind'](this));this[_0x088c('0x5')]['on'](_0x088c('0xc'),this['handleDrained'][_0x088c('0x9')](this));};Beepall[_0x088c('0xd')][_0x088c('0x7')]=function(){this[_0x088c('0x5')][_0x088c('0x7')](this[_0x088c('0x8')]['bind'](this),this[_0x088c('0xa')]['bind'](this));};Beepall[_0x088c('0xd')][_0x088c('0xe')]=function(){this[_0x088c('0xa')](!![]);};Beepall[_0x088c('0xd')][_0x088c('0x8')]=function(){var _0x42cea1=!![];if(!_[_0x088c('0xf')](this[_0x088c('0x6')])&&!_[_0x088c('0xf')](this['queue'][_0x088c('0x10')])&&this['queue'][_0x088c('0x10')]['length']>0x0){for(var _0x13a647=0x0,_0x68edd5;_0x13a6470x0){for(var _0x9228d8=0x0,_0x56cb2a;_0x9228d80x0&&_0x3a9629[_0x228881+'CurrentCapacity']>=_0x3a9629[_0x228881+_0xbdb2('0x23')]){writeLog(_0x20a754,_0x3a9629,_0x228881[_0xbdb2('0x25')]()+_0xbdb2('0x26'));return![];}}return!![];};exports['showNotification']=function(_0x560feb,_0x13fca9,_0x386af6,_0x47b560,_0x3ce8aa){return sendNotification(!![],_0x560feb,_0x13fca9,_0x386af6,_0x47b560,_0x3ce8aa);};exports[_0xbdb2('0x27')]=function(_0x4fd945,_0x4ce2e9,_0x4bb221,_0x50d69b,_0x596704){return sendNotification(![],_0x4fd945,_0x4ce2e9,_0x4bb221,_0x50d69b,_0x596704);};exports[_0xbdb2('0x28')]=function(_0x442b94,_0x121312,_0x49aace){var _0x424bdc=_0x121312[_0xbdb2('0x29')][_0xbdb2('0x2a')];if(!_0x424bdc&&_0x49aace){_0x424bdc=_0x49aace['id'];}var _0x3c3bae=_['some'](_0x442b94[_0x121312['channel']+'QueuesWaitingInteractions'],function(_0x5709b0){var _0x1405c5=_[_0xbdb2('0x2b')](_0x121312[_0xbdb2('0x2c')])+_0xbdb2('0x2d');return _0x5709b0[_0x1405c5]===_0x121312[_0xbdb2('0x29')]['id'];});if(!_0x3c3bae&&_0x424bdc&&_0x442b94[_0xbdb2('0x2e')][_0x424bdc]){_0x3c3bae=_['some'](_0x442b94['agents'][_0x424bdc][_0x121312[_0xbdb2('0x2c')]+_0xbdb2('0x2f')],function(_0x41c264){return _0x41c264['id']===_0x121312[_0xbdb2('0x29')]['id'];});}return _0x3c3bae;};exports['saveWaitingNotification']=function(_0x3353a0,_0x158858,_0x19a9a9,_0x248193){if(_0x19a9a9&&_0x19a9a9['id']&&_0x3353a0['agents']&&_0x3353a0[_0xbdb2('0x2e')][_0x19a9a9['id']]){_0x3353a0[_0xbdb2('0x2e')][_0x19a9a9['id']][_0x248193+_0xbdb2('0x2f')][_0x158858[_0xbdb2('0x17')]['id']]={'id':_0x158858[_0xbdb2('0x29')]['id']};}};exports[_0xbdb2('0x30')]=function(_0xfb65d9,_0x532226,_0x2e3982,_0x56beff){if(_0x2e3982&&_0x2e3982['id']&&_0xfb65d9[_0xbdb2('0x2e')]&&_0xfb65d9[_0xbdb2('0x2e')][_0x2e3982['id']]){delete _0xfb65d9[_0xbdb2('0x2e')][_0x2e3982['id']][_0x56beff+_0xbdb2('0x2f')][_0x532226[_0xbdb2('0x17')]['id']];}};exports[_0xbdb2('0x31')]=writeLog; \ No newline at end of file +var _0x22be=['busy','online','OFFLINE','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','interaction','QueuesWaitingInteractions','channel','InteractionId','agents','WaitingInteractions','saveWaitingNotification','removeWaitingNotification','util','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','localhost','socket.io-emitter','name','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','message','user:%s','emit','notification:%s','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable'];(function(_0x4b22b3,_0x40807c){var _0x4d6e0d=function(_0x2e8bb5){while(--_0x2e8bb5){_0x4b22b3['push'](_0x4b22b3['shift']());}};_0x4d6e0d(++_0x40807c);}(_0x22be,0x15c));var _0xe22b=function(_0x2ab365,_0xa3812e){_0x2ab365=_0x2ab365-0x0;var _0x49fef3=_0x22be[_0x2ab365];return _0x49fef3;};'use strict';var _=require('lodash');var util=require(_0xe22b('0x0'));var utils=require('../utils');var Redis=require(_0xe22b('0x1'));var config=require(_0xe22b('0x2'));var logger=require(_0xe22b('0x3'))(_0xe22b('0x4'));config[_0xe22b('0x5')]=_['defaults'](config[_0xe22b('0x5')],{'host':_0xe22b('0x6'),'port':0x18eb});var io=require(_0xe22b('0x7'))(new Redis(config[_0xe22b('0x5')]));function sendNotification(_0x553c44,_0x427ec1,_0x29f99e,_0x2bf021,_0xfa1745,_0x772ed9){var _0x392e12=_0x772ed9||{};var _0x116470=_0x29f99e['split']('.');var _0x3ff17e={'uniqueid':_0x427ec1,'channel':_0x116470[0x0],'id':_0x116470[0x1],'title':_0x116470[0x0]+'\x20interaction','interactionId':_0x116470[0x2],'queue':_0xfa1745?_0xfa1745[_0xe22b('0x8')]:null,'sound':_0x392e12[_0xe22b('0x9')][_0xe22b('0xa')],'shake':_0x392e12[_0xe22b('0x9')][_0xe22b('0xb')]};try{if(!_0x392e12['body']){_0x392e12[_0xe22b('0xc')]={};}if(_0xfa1745){_0x392e12['body'][_0xe22b('0xd')]=_0xfa1745;}else if(_0x392e12['body'][_0xe22b('0xd')]){delete _0x392e12[_0xe22b('0xc')][_0xe22b('0xd')];}_0x3ff17e[_0xe22b('0xe')]=utils[_0xe22b('0xf')](_0x392e12['account'][_0xe22b('0x10')],_0x392e12);}catch(_0x3e84ae){_0x3ff17e['msg']=_0xe22b('0x11');logger[_0xe22b('0x12')](util[_0xe22b('0x13')]('[%s][QUEUE]\x20%s',_0x427ec1,_0x3e84ae[_0xe22b('0x14')]));}io['to'](util[_0xe22b('0x13')](_0xe22b('0x15'),_0x2bf021[_0xe22b('0x8')]))[_0xe22b('0x16')](util[_0xe22b('0x13')](_0xe22b('0x17'),_0x553c44?'save':_0xe22b('0x18')),_0x3ff17e);}function writeLog(_0x343c06,_0x6263a6,_0x4cb3c2){return logger[_0xe22b('0x19')](util[_0xe22b('0x13')](_0xe22b('0x1a'),_0x343c06,_0x6263a6[_0xe22b('0x8')],_0x4cb3c2));}exports[_0xe22b('0x1b')]=function(_0x1be946,_0x5c93e6,_0x352b9f,_0x12bcd6){if(_0x5c93e6[_0xe22b('0x1c')]){writeLog(_0x1be946,_0x5c93e6,'BUSY');return![];}if(!_0x5c93e6[_0xe22b('0x1d')]){writeLog(_0x1be946,_0x5c93e6,_0xe22b('0x1e'));return![];}if(_0x5c93e6[_0x352b9f+'Pause']){writeLog(_0x1be946,_0x5c93e6,_0xe22b('0x1f'));return![];}if(_0x12bcd6&&_0x5c93e6[_0xe22b('0x20')](_0x352b9f+_0xe22b('0x21'))&&_0x5c93e6[_0xe22b('0x20')](_0x352b9f+_0xe22b('0x22'))){if(_0x5c93e6[_0x352b9f+_0xe22b('0x21')]>0x0&&_0x5c93e6[_0x352b9f+'CurrentCapacity']>=_0x5c93e6[_0x352b9f+_0xe22b('0x21')]){writeLog(_0x1be946,_0x5c93e6,_0x352b9f[_0xe22b('0x23')]()+_0xe22b('0x24'));return![];}}return!![];};exports[_0xe22b('0x25')]=function(_0x20b0d2,_0x141dfc,_0xb85344,_0xed3182,_0x59e053){return sendNotification(!![],_0x20b0d2,_0x141dfc,_0xb85344,_0xed3182,_0x59e053);};exports[_0xe22b('0x26')]=function(_0x4293a1,_0x5f2a2e,_0x17dddf,_0x2b95a3,_0x40d0ac){return sendNotification(![],_0x4293a1,_0x5f2a2e,_0x17dddf,_0x2b95a3,_0x40d0ac);};exports['checkWaitingNotifications']=function(_0x17f868,_0x4fc53e,_0xed1a9b){var _0x1772e0=_0x4fc53e[_0xe22b('0x27')]['UserId'];if(!_0x1772e0&&_0xed1a9b){_0x1772e0=_0xed1a9b['id'];}var _0x4651c4=_['some'](_0x17f868[_0x4fc53e['channel']+_0xe22b('0x28')],function(_0x111c6e){var _0x3be907=_['capitalize'](_0x4fc53e[_0xe22b('0x29')])+_0xe22b('0x2a');return _0x111c6e[_0x3be907]===_0x4fc53e[_0xe22b('0x27')]['id'];});if(!_0x4651c4&&_0x1772e0&&_0x17f868[_0xe22b('0x2b')][_0x1772e0]){_0x4651c4=_['some'](_0x17f868[_0xe22b('0x2b')][_0x1772e0][_0x4fc53e[_0xe22b('0x29')]+_0xe22b('0x2c')],function(_0x3100aa){return _0x3100aa['id']===_0x4fc53e['interaction']['id'];});}return _0x4651c4;};exports[_0xe22b('0x2d')]=function(_0x478f66,_0x168b1b,_0x317564,_0x5be5f2){if(_0x317564&&_0x317564['id']&&_0x478f66[_0xe22b('0x2b')]&&_0x478f66[_0xe22b('0x2b')][_0x317564['id']]){_0x478f66[_0xe22b('0x2b')][_0x317564['id']][_0x5be5f2+'WaitingInteractions'][_0x168b1b[_0xe22b('0x14')]['id']]={'id':_0x168b1b[_0xe22b('0x27')]['id']};}};exports[_0xe22b('0x2e')]=function(_0x21ea9c,_0x13d478,_0x2bb504,_0x9e7fd2){if(_0x2bb504&&_0x2bb504['id']&&_0x21ea9c[_0xe22b('0x2b')]&&_0x21ea9c['agents'][_0x2bb504['id']]){delete _0x21ea9c['agents'][_0x2bb504['id']][_0x9e7fd2+_0xe22b('0x2c')][_0x13d478[_0xe22b('0x14')]['id']];}};exports['writeLog']=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 ad19fe1..f102ce4 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 _0xe1fe=['validate','routing','string','consequence','length','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','stringify'];(function(_0x218972,_0x1f9794){var _0x1bb1a8=function(_0x3fb962){while(--_0x3fb962){_0x218972['push'](_0x218972['shift']());}};_0x1bb1a8(++_0x1f9794);}(_0xe1fe,0x114));var _0xee1f=function(_0x122a8e,_0x49c307){_0x122a8e=_0x122a8e-0x0;var _0x56fc0d=_0xe1fe[_0x122a8e];return _0x56fc0d;};'use strict';var schema=require(_0xee1f('0x0'));var sh=require('shelljs');var _=require('lodash');var utils=require('./utils');var logger=require('../../../../config/logger')(_0xee1f('0x1'));var system=schema({'command':{'type':_0xee1f('0x2'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xee1f('0x3')]=function(_0x3d1f42,_0x5de093){return function(_0x276b41){try{var _0x8c07f2={'command':_0x5de093[0x0]};var _0x3fa2fa=system[_0xee1f('0x0')](_0x8c07f2,{'typecast':!![]});if(_0x3fa2fa[_0xee1f('0x4')]){logger['error'](_0xee1f('0x5'),_0x3d1f42,_[_0xee1f('0x6')](_0x3fa2fa,'message')[_0xee1f('0x7')](',\x20'));logger[_0xee1f('0x8')](_0xee1f('0x9'),_0x3d1f42);_0x276b41[_0xee1f('0xa')]();}else{var _0xf70675=this;var _0x254d3b=utils['getMustacheRender'](_0x5de093[0x0],this);logger[_0xee1f('0x8')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x3d1f42,_0x254d3b);sh[_0xee1f('0xb')](_[_0xee1f('0xc')](_0x254d3b),function(_0x1373dd,_0x46ed5e){logger['info'](_0xee1f('0xd'),_0x3d1f42,_0x1373dd);if(_0x1373dd==0x0){var _0x28934e=_0x46ed5e[_0xee1f('0xe')](/(\r\n|\n|\r)/gm,'');if(_[_0xee1f('0xf')](_0x5de093[0x1])||_[_0xee1f('0x10')](_0x5de093[0x1])){logger[_0xee1f('0x8')](_0xee1f('0x11'),_0x3d1f42);_0xf70675[_0xee1f('0x12')][_0x5de093[0x1]]=_0x28934e;}else{logger[_0xee1f('0x8')](_0xee1f('0x13'),_0x3d1f42,_0x5de093[0x1],_0x28934e);_0xf70675[_0xee1f('0x12')][_0x5de093[0x1]]=_0x28934e;}}_0x276b41['next']();});}}catch(_0x44c61c){logger[_0xee1f('0x14')](_0xee1f('0x5'),_0x3d1f42,_[_0xee1f('0x15')](_0x44c61c)?JSON[_0xee1f('0x16')](_0x44c61c):_0x44c61c);logger[_0xee1f('0x8')](_0xee1f('0x9'),_0x3d1f42);_0x276b41[_0xee1f('0xa')]();}};}; \ No newline at end of file +var _0xb066=['next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','shelljs','lodash','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error','message','join','info'];(function(_0x16b2d1,_0x4126c1){var _0x4f2026=function(_0xc752ff){while(--_0xc752ff){_0x16b2d1['push'](_0x16b2d1['shift']());}};_0x4f2026(++_0x4126c1);}(_0xb066,0x1c9));var _0x6b06=function(_0x5df9c2,_0x2438b9){_0x5df9c2=_0x5df9c2-0x0;var _0x428d29=_0xb066[_0x5df9c2];return _0x428d29;};'use strict';var schema=require('validate');var sh=require(_0x6b06('0x0'));var _=require(_0x6b06('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x6b06('0x2'));var system=schema({'command':{'type':_0x6b06('0x3'),'required':!![],'message':_0x6b06('0x4')}});exports[_0x6b06('0x5')]=function(_0x7a9ff8,_0x2a09ab){return function(_0x3e2b79){try{var _0xa85096={'command':_0x2a09ab[0x0]};var _0x1e303d=system[_0x6b06('0x6')](_0xa85096,{'typecast':!![]});if(_0x1e303d['length']){logger[_0x6b06('0x7')]('[%s][SYSTEM]\x20%s',_0x7a9ff8,_['map'](_0x1e303d,_0x6b06('0x8'))[_0x6b06('0x9')](',\x20'));logger[_0x6b06('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x7a9ff8);_0x3e2b79[_0x6b06('0xb')]();}else{var _0x3cfd65=this;var _0x5f2712=utils[_0x6b06('0xc')](_0x2a09ab[0x0],this);logger[_0x6b06('0xa')](_0x6b06('0xd'),_0x7a9ff8,_0x5f2712);sh[_0x6b06('0xe')](_[_0x6b06('0xf')](_0x5f2712),function(_0x415df5,_0x5af4b3){logger[_0x6b06('0xa')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x7a9ff8,_0x415df5);if(_0x415df5==0x0){var _0x37df11=_0x5af4b3[_0x6b06('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x6b06('0x11')](_0x2a09ab[0x1])||_[_0x6b06('0x12')](_0x2a09ab[0x1])){logger[_0x6b06('0xa')](_0x6b06('0x13'),_0x7a9ff8);_0x3cfd65[_0x6b06('0x14')][_0x2a09ab[0x1]]=_0x37df11;}else{logger['info'](_0x6b06('0x15'),_0x7a9ff8,_0x2a09ab[0x1],_0x37df11);_0x3cfd65[_0x6b06('0x14')][_0x2a09ab[0x1]]=_0x37df11;}}_0x3e2b79['next']();});}}catch(_0x4ccd87){logger[_0x6b06('0x7')](_0x6b06('0x16'),_0x7a9ff8,_[_0x6b06('0x17')](_0x4ccd87)?JSON[_0x6b06('0x18')](_0x4ccd87):_0x4ccd87);logger[_0x6b06('0xa')](_0x6b06('0x19'),_0x7a9ff8);_0x3e2b79['next']();}};}; \ 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 17b732e..bf0ac08 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 _0x5439=['[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','channel','interaction','catch','stringify','info','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5439,0xec));var _0x9543=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5439[_0x14add3];return _0x4a174f;};'use strict';var schema=require(_0x9543('0x0'));var _=require(_0x9543('0x1'));var rpc={'chatInteraction':require(_0x9543('0x2')),'openchannelInteraction':require(_0x9543('0x3')),'smsInteraction':require(_0x9543('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x9543('0x5')),'whatsappInteraction':require(_0x9543('0x6'))};var logger=require(_0x9543('0x7'))(_0x9543('0x8'));var tag=schema({'tag':{'type':_0x9543('0x9'),'required':!![],'message':_0x9543('0xa')}});exports[_0x9543('0xb')]=function(_0x10b487,_0x36f412,_0x36d379,_0x2736e0){return function(_0x2a7587){try{var _0x1ded14={'tag':_0x36f412[0x0]};var _0x284950=tag[_0x9543('0x0')](_0x1ded14,{'typecast':!![]});if(_0x284950[_0x9543('0xc')]){logger[_0x9543('0xd')](_0x9543('0xe'),_0x10b487,_[_0x9543('0xf')](_0x284950,'message')['join'](',\x20'));logger['info'](_0x9543('0x10'),_0x10b487);_0x2a7587[_0x9543('0x11')]();}else{var _0x59bc5e={'ids':[_0x36f412[0x0]]};if(rpc[_0x2736e0['channel']+_0x9543('0x12')]){rpc[_0x2736e0['channel']+'Interaction']['addTags'](_0x2736e0['interaction']['id'],_0x59bc5e)[_0x9543('0x13')](function(_0x2c25d1){logger['info'](_0x9543('0x14'),_0x10b487,_0x36f412[0x1],_0x2736e0[_0x9543('0x15')],_0x2736e0[_0x9543('0x16')]['id']);})[_0x9543('0x17')](function(_0x5d7b16){logger[_0x9543('0xd')]('[%s][TAG]\x20%s',_0x10b487,JSON[_0x9543('0x18')](_0x5d7b16));logger[_0x9543('0x19')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x10b487);})[_0x9543('0x1a')](function(){_0x2a7587[_0x9543('0x11')]();});}}}catch(_0x13cb3f){logger[_0x9543('0xd')](_0x9543('0xe'),_0x10b487,_[_0x9543('0x1b')](_0x13cb3f)?JSON[_0x9543('0x18')](_0x13cb3f):_0x13cb3f);logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x10b487);_0x2a7587[_0x9543('0x11')]();}};}; \ No newline at end of file +var _0x1862=['isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','length','error','[%s][TAG]\x20%s','map','message','info','next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x1862,0x196));var _0x2186=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1862[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x2186('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x2186('0x1')),'openchannelInteraction':require(_0x2186('0x2')),'smsInteraction':require(_0x2186('0x3')),'mailInteraction':require(_0x2186('0x4')),'faxInteraction':require(_0x2186('0x5')),'whatsappInteraction':require(_0x2186('0x6'))};var logger=require(_0x2186('0x7'))(_0x2186('0x8'));var tag=schema({'tag':{'type':_0x2186('0x9'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x2186('0xa')]=function(_0x19bb97,_0xe00e1e,_0x272158,_0x5daa8e){return function(_0x3bb863){try{var _0x51bfb4={'tag':_0xe00e1e[0x0]};var _0x40920e=tag[_0x2186('0x0')](_0x51bfb4,{'typecast':!![]});if(_0x40920e[_0x2186('0xb')]){logger[_0x2186('0xc')](_0x2186('0xd'),_0x19bb97,_[_0x2186('0xe')](_0x40920e,_0x2186('0xf'))['join'](',\x20'));logger[_0x2186('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x19bb97);_0x3bb863[_0x2186('0x11')]();}else{var _0x15ba99={'ids':[_0xe00e1e[0x0]]};if(rpc[_0x5daa8e[_0x2186('0x12')]+_0x2186('0x13')]){rpc[_0x5daa8e[_0x2186('0x12')]+_0x2186('0x13')]['addTags'](_0x5daa8e[_0x2186('0x14')]['id'],_0x15ba99)[_0x2186('0x15')](function(_0x4e4ff4){logger['info'](_0x2186('0x16'),_0x19bb97,_0xe00e1e[0x1],_0x5daa8e[_0x2186('0x12')],_0x5daa8e[_0x2186('0x14')]['id']);})[_0x2186('0x17')](function(_0xc47ecc){logger[_0x2186('0xc')](_0x2186('0xd'),_0x19bb97,JSON[_0x2186('0x18')](_0xc47ecc));logger['info'](_0x2186('0x19'),_0x19bb97);})['finally'](function(){_0x3bb863['next']();});}}}catch(_0x475669){logger[_0x2186('0xc')](_0x2186('0xd'),_0x19bb97,_[_0x2186('0x1a')](_0x475669)?JSON[_0x2186('0x18')](_0x475669):_0x475669);logger[_0x2186('0x10')](_0x2186('0x19'),_0x19bb97);_0x3bb863[_0x2186('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 6eafeb1..b226e7c 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe619=['logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','&data=','info','stop','catch','error','[%s][TVOX]\x20%s','isObject','next','../../../../config/logger','routing','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','method','login','params','stringify','utf8','POST','application/json-rpc','then','parse','result'];(function(_0x4df787,_0x337596){var _0x20fe58=function(_0x177bf2){while(--_0x177bf2){_0x4df787['push'](_0x4df787['shift']());}};_0x20fe58(++_0x337596);}(_0xe619,0xf3));var _0x9e61=function(_0x552041,_0xc34ee7){_0x552041=_0x552041-0x0;var _0x198a1a=_0xe619[_0x552041];return _0x198a1a;};'use strict';var rp=require('request-promise');var logger=require(_0x9e61('0x0'))(_0x9e61('0x1'));var _=require('lodash');var arr=[];exports['consequence']=function(_0xd923fc,_0x4745ff){return function(_0x52dc67){var _0x1192d5=_0x4745ff[0xa];var _0x4db029=_0x4745ff[0xb];var _0x552552=_0x4745ff[0xc];var _0x4f18cb=_0x4745ff[0xd];var _0x584734=_0x4745ff[0xe];var _0x317e2a=_0x4745ff[0xf][_0x9e61('0x2')](/\n/g,_0x9e61('0x3'));var _0x22a682=_0x4745ff[0x10][_0x9e61('0x2')](/\n/g,'\x20');if(!arr[_0x9e61('0x4')](_0x4db029)){arr[_0x9e61('0x5')](_0x4db029);var _0x27453a=_0x4745ff[0x3];var _0x348d21=_0x4745ff[0x4];var _0x1d1fd4=_0x4745ff[0x1];var _0x5f112b=_0x4745ff[0x0];var _0x54f4c4={};_0x54f4c4[_0x9e61('0x6')]=_0x4745ff[0x8]+_0x9e61('0x7')+_0x552552+'|'+_0x1192d5+'|'+_0x4f18cb+'|'+_0x4db029+'|'+_0x584734;_0x54f4c4[_0x9e61('0x8')]=_0x4745ff[0x7]+_0x9e61('0x7')+_0x552552+'|'+_0x1192d5+'|'+_0x4f18cb+'|'+_0x4db029+'|'+_0x584734+'|'+_0x317e2a+'|'+_0x22a682;_0x54f4c4[_0x9e61('0x9')]=_0x4745ff[0x9];var _0x95625e={};_0x95625e[_0x9e61('0xa')]='2.0';_0x95625e[_0x9e61('0xb')]=_0x9e61('0xc');var _0xd4912e=[];_0xd4912e[_0x9e61('0x5')](_0x4745ff[0x2]);_0xd4912e['push'](_0x4745ff[0x5]);_0xd4912e['push'](_0x4745ff[0x6]);_0x95625e[_0x9e61('0xd')]=_0xd4912e;_0x95625e['id']=0x1;var _0x5042eb=JSON[_0x9e61('0xe')](_0x95625e);var _0x39f814={'encoding':_0x9e61('0xf'),'method':_0x9e61('0x10'),'timeout':0x2710,'url':_0x27453a,'headers':{'Content-Type':_0x9e61('0x11')},'body':_0x5042eb};return rp(_0x39f814)[_0x9e61('0x12')](function(_0x4d49f6){const _0x37a2c2=JSON[_0x9e61('0x13')](_0x4d49f6);if(!_0x37a2c2[_0x9e61('0x14')][_0x9e61('0x15')]){throw new Error(_0x9e61('0x16'));}var _0x5d3d3c=_0x4db029;var _0x3f67c3=_0x9e61('0x17')+_0x1d1fd4+'&serviceId='+_0x5f112b+_0x9e61('0x18')+_0x5d3d3c+_0x9e61('0x19')+JSON['stringify'](_0x54f4c4);var _0xc8525f=_0x348d21+'?'+_0x3f67c3;return rp(_0xc8525f);})['then'](function(_0x2137bb){logger[_0x9e61('0x1a')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0xd923fc,_0x2137bb);_0x52dc67[_0x9e61('0x1b')]();})[_0x9e61('0x1c')](function(_0x505e80){logger[_0x9e61('0x1d')](_0x9e61('0x1e'),_0xd923fc,_[_0x9e61('0x1f')](_0x505e80)?JSON[_0x9e61('0xe')](_0x505e80):_0x505e80);_0x52dc67[_0x9e61('0x1b')]();});}else{logger[_0x9e61('0x1a')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0xd923fc);_0x52dc67[_0x9e61('0x20')]();}};}; \ No newline at end of file +var _0x13cc=['params','stringify','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','stop','catch','error','[%s][TVOX]\x20%s','isObject','info','next','request-promise','../../../../config/logger','lodash','consequence','replace','push','urlOnAnswer','?params=','title','jsonrpc','method'];(function(_0x6ada2c,_0x1d7e69){var _0x28ec9a=function(_0x30013b){while(--_0x30013b){_0x6ada2c['push'](_0x6ada2c['shift']());}};_0x28ec9a(++_0x1d7e69);}(_0x13cc,0x1c6));var _0xc13c=function(_0x388f3e,_0x453d03){_0x388f3e=_0x388f3e-0x0;var _0x57745d=_0x13cc[_0x388f3e];return _0x57745d;};'use strict';var rp=require(_0xc13c('0x0'));var logger=require(_0xc13c('0x1'))('routing');var _=require(_0xc13c('0x2'));var arr=[];exports[_0xc13c('0x3')]=function(_0x22f9f9,_0x2998b5){return function(_0xe0b5a5){var _0x28ea70=_0x2998b5[0xa];var _0x1bc57f=_0x2998b5[0xb];var _0xecfbfd=_0x2998b5[0xc];var _0x102968=_0x2998b5[0xd];var _0xa61148=_0x2998b5[0xe];var _0x34574c=_0x2998b5[0xf][_0xc13c('0x4')](/\n/g,'\x20-\x20');var _0x504020=_0x2998b5[0x10]['replace'](/\n/g,'\x20');if(!arr['includes'](_0x1bc57f)){arr[_0xc13c('0x5')](_0x1bc57f);var _0x294669=_0x2998b5[0x3];var _0x522406=_0x2998b5[0x4];var _0xadeee3=_0x2998b5[0x1];var _0x7c6566=_0x2998b5[0x0];var _0x5ee212={};_0x5ee212[_0xc13c('0x6')]=_0x2998b5[0x8]+_0xc13c('0x7')+_0xecfbfd+'|'+_0x28ea70+'|'+_0x102968+'|'+_0x1bc57f+'|'+_0xa61148;_0x5ee212['urlOnRing']=_0x2998b5[0x7]+'?params='+_0xecfbfd+'|'+_0x28ea70+'|'+_0x102968+'|'+_0x1bc57f+'|'+_0xa61148+'|'+_0x34574c+'|'+_0x504020;_0x5ee212[_0xc13c('0x8')]=_0x2998b5[0x9];var _0x2204bb={};_0x2204bb[_0xc13c('0x9')]='2.0';_0x2204bb[_0xc13c('0xa')]='login';var _0x316ec9=[];_0x316ec9['push'](_0x2998b5[0x2]);_0x316ec9[_0xc13c('0x5')](_0x2998b5[0x5]);_0x316ec9['push'](_0x2998b5[0x6]);_0x2204bb[_0xc13c('0xb')]=_0x316ec9;_0x2204bb['id']=0x1;var _0x162076=JSON[_0xc13c('0xc')](_0x2204bb);var _0x2a3a16={'encoding':'utf8','method':_0xc13c('0xd'),'timeout':0x2710,'url':_0x294669,'headers':{'Content-Type':_0xc13c('0xe')},'body':_0x162076};return rp(_0x2a3a16)[_0xc13c('0xf')](function(_0x16c562){const _0x1d9ca8=JSON[_0xc13c('0x10')](_0x16c562);if(!_0x1d9ca8[_0xc13c('0x11')][_0xc13c('0x12')]){throw new Error(_0xc13c('0x13'));}var _0x342d50=_0x1bc57f;var _0x4043d1=_0xc13c('0x14')+_0xadeee3+_0xc13c('0x15')+_0x7c6566+_0xc13c('0x16')+_0x342d50+_0xc13c('0x17')+JSON[_0xc13c('0xc')](_0x5ee212);var _0x7be87b=_0x522406+'?'+_0x4043d1;return rp(_0x7be87b);})[_0xc13c('0xf')](function(_0x1cd8b0){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x22f9f9,_0x1cd8b0);_0xe0b5a5[_0xc13c('0x18')]();})[_0xc13c('0x19')](function(_0x530dad){logger[_0xc13c('0x1a')](_0xc13c('0x1b'),_0x22f9f9,_[_0xc13c('0x1c')](_0x530dad)?JSON['stringify'](_0x530dad):_0x530dad);_0xe0b5a5[_0xc13c('0x18')]();});}else{logger[_0xc13c('0x1d')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x22f9f9);_0xe0b5a5[_0xc13c('0x1e')]();}};}; \ 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 19db98c..539656c 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(_0x18344c,_0x212c4e){var _0x316af3=function(_0x1ccb7f){while(--_0x1ccb7f){_0x18344c['push'](_0x18344c['shift']());}};_0x316af3(++_0x212c4e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x2ebdb3,_0x682c5b){var _0x471eec=function(_0xaad025){while(--_0xaad025){_0x2ebdb3['push'](_0x2ebdb3['shift']());}};_0x471eec(++_0x682c5b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index bebfc45..975dfb1 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 _0x3cae=['checkWaitingNotifications','transfer','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','amazonlex','TagId','tvox','account','notificationTemplate','ContactId','body','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','error','execute','Applications\x20executed','stringify','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','emit','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','listen','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','rules','channel','message','interaction'];(function(_0x271ba2,_0x54a752){var _0x4e760e=function(_0x5324ca){while(--_0x5324ca){_0x271ba2['push'](_0x271ba2['shift']());}};_0x4e760e(++_0x54a752);}(_0x3cae,0x117));var _0xe3ca=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x3cae[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0xe3ca('0x0'));var util=require(_0xe3ca('0x1'));var path=require(_0xe3ca('0x2'));var fs=require('fs');var jayson=require(_0xe3ca('0x3'));var BPromise=require(_0xe3ca('0x4'));var utils=require(_0xe3ca('0x5'));var sUtils=require(_0xe3ca('0x6'));var logger=require('../../../config/logger')(_0xe3ca('0x7'));var rpc={'openchannelQueueReport':require(_0xe3ca('0x8')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xe3ca('0x9')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xe3ca('0xa')),'whatsappQueueReport':require(_0xe3ca('0xb'))};var RuleEngine=require(_0xe3ca('0xc'));function getId(_0x578178,_0x2c4863,_0x100c20){return util[_0xe3ca('0xd')](_0xe3ca('0xe'),_0x578178,_0x2c4863||0x0,_0x100c20||0x0);}function getIntervals(_0x1ae7bf,_0x1785c5){var _0x423bba=[];if(!_['isNil'](_0x1785c5[_0xe3ca('0xf')])&&!_['isNil'](_0x1ae7bf[_0x1785c5[_0xe3ca('0xf')]])&&!_[_0xe3ca('0x10')](_0x1ae7bf[_0x1785c5[_0xe3ca('0xf')]][_0xe3ca('0x11')])){_0x423bba=_[_0xe3ca('0x12')](_0x1ae7bf[_0x1785c5['IntervalId']]['Intervals'],_0xe3ca('0x13'));}else if(!_['isNil'](_0x1785c5[_0xe3ca('0x13')])){_0x423bba=[_0x1785c5[_0xe3ca('0x13')]];}return _0x423bba;}exports['listen']=function(_0x3d62e2){_0x3d62e2[_0xe3ca('0x14')]={};return new BPromise(function(_0x210c69,_0x6a8907){var _0x9ef773={'Start':function(_0x292251){var _0x884795=this;return new Promise(function(_0x337b6c,_0x5f2e2d){if(_0x292251){try{var _0x479977=[];var _0xca43ee=getId(_0x292251[_0xe3ca('0x15')],_0x292251[_0xe3ca('0x16')]?_0x292251[_0xe3ca('0x16')]['id']:0x0,_0x292251[_0xe3ca('0x17')]?_0x292251[_0xe3ca('0x17')]['id']:0x0);var _0x5bb8d8=sUtils[_0xe3ca('0x18')](_0x3d62e2,_0x292251);if(_0x292251[_0xe3ca('0x19')]||!_0x5bb8d8&&_0x292251[_0xe3ca('0x1a')]&&_['isArray'](_0x292251['applications'])&&_0x292251['applications'][_0xe3ca('0x1b')]){for(var _0x593fd1=0x0;_0x593fd1<_0x292251['applications'][_0xe3ca('0x1b')];_0x593fd1+=0x1){var _0x1822e4=_0x292251[_0xe3ca('0x1a')][_0x593fd1];if(fs[_0xe3ca('0x1c')](path[_0xe3ca('0x1d')](__dirname,'applications',_0x1822e4[_0xe3ca('0x1e')]+_0xe3ca('0x1f')))){var _0x5bc481=[];switch(_0x1822e4[_0xe3ca('0x1e')][_0xe3ca('0x20')]()){case _0xe3ca('0x21'):var _0xd681a7=_0x1822e4[_0xe3ca('0x22')][_0xe3ca('0x23')](',');if(_0x292251[_0xe3ca('0x15')]===_0xe3ca('0x24')){_0x5bc481[_0xe3ca('0x25')](_0xd681a7[0x0]);_0x5bc481[_0xe3ca('0x25')](_0xd681a7[0x1]);_0x5bc481[_0xe3ca('0x25')](_0xd681a7['slice'](0x2,_0xd681a7[_0xe3ca('0x1b')])['join'](','));}else{_0x5bc481[_0xe3ca('0x25')](_0xd681a7[0x0]);_0x5bc481[_0xe3ca('0x25')](_0xd681a7[_0xe3ca('0x26')](0x1,_0xd681a7[_0xe3ca('0x1b')])['join'](','));}break;case'dialogflow':var _0x2e1636=_0x1822e4[_0xe3ca('0x22')][_0xe3ca('0x23')](',');_0x5bc481['push'](_0x2e1636[0x0]);_0x5bc481[_0xe3ca('0x25')](_0x2e1636[0x1]);_0x5bc481[_0xe3ca('0x25')](_0x2e1636[_0xe3ca('0x26')](0x2,_0x2e1636[_0xe3ca('0x1b')])['join'](','));break;case'dialogflowv2':var _0xf90c19=_0x1822e4['appdata'][_0xe3ca('0x23')](',');_0x5bc481['push'](_0xf90c19[0x0]);_0x5bc481['push'](_0xf90c19[0x1]);_0x5bc481[_0xe3ca('0x25')](_0xf90c19[0x2]);_0x5bc481[_0xe3ca('0x25')](_0xf90c19[0x3]);_0x5bc481[_0xe3ca('0x25')](_0xf90c19[_0xe3ca('0x26')](0x4,_0xf90c19[_0xe3ca('0x1b')])['join'](','));break;case _0xe3ca('0x27'):var _0x50f226=_0x1822e4['appdata'][_0xe3ca('0x23')](',');_0x5bc481[_0xe3ca('0x25')](_0x50f226[0x0]);_0x5bc481[_0xe3ca('0x25')](_0x50f226[0x1]);_0x5bc481[_0xe3ca('0x25')](_0x50f226[0x2]);_0x5bc481[_0xe3ca('0x25')](_0x50f226[0x3]);_0x5bc481[_0xe3ca('0x25')](_0x50f226[_0xe3ca('0x26')](0x4,_0x50f226[_0xe3ca('0x1b')])[_0xe3ca('0x1d')](','));break;case _0xe3ca('0x16'):_0x5bc481[_0xe3ca('0x25')](_0x1822e4[_0xe3ca('0x22')]);break;case'tag':_0x5bc481[_0xe3ca('0x25')](_0x1822e4[_0xe3ca('0x28')]);_0x5bc481[_0xe3ca('0x25')](_0x1822e4[_0xe3ca('0x22')]);break;case _0xe3ca('0x29'):var _0x3aeba2=utils['getMustacheRender'](_0x292251[_0xe3ca('0x2a')][_0xe3ca('0x2b')],_0x292251);var _0x343234=_0x1822e4[_0xe3ca('0x22')][_0xe3ca('0x23')](',');_0x5bc481[_0xe3ca('0x25')](_0x343234[0x0]);_0x5bc481[_0xe3ca('0x25')](_0x343234[0x1]);_0x5bc481[_0xe3ca('0x25')](_0x343234[0x2]);_0x5bc481[_0xe3ca('0x25')](_0x343234[0x3]);_0x5bc481['push'](_0x343234[0x4]);_0x5bc481[_0xe3ca('0x25')](_0x343234[0x5]);_0x5bc481[_0xe3ca('0x25')](_0x343234[0x6]);_0x5bc481['push'](_0x343234[0x7]);_0x5bc481[_0xe3ca('0x25')](_0x343234[0x8]);_0x5bc481[_0xe3ca('0x25')](_0x343234[0x9]);_0x5bc481[_0xe3ca('0x25')](_0x343234[0xa]);_0x5bc481['push'](_0x292251[_0xe3ca('0x17')]['id']);_0x5bc481[_0xe3ca('0x25')](_0x292251['message']['id']);_0x5bc481[_0xe3ca('0x25')](_0x1822e4['ChatWebsiteId']);_0x5bc481['push'](_0x292251[_0xe3ca('0x17')][_0xe3ca('0x2c')]);_0x5bc481['push'](_0x292251[_0xe3ca('0x2d')][_0xe3ca('0x2d')]);_0x5bc481[_0xe3ca('0x25')](_0x3aeba2);break;default:_0x5bc481=_[_0xe3ca('0x10')](_0x1822e4[_0xe3ca('0x22')])?[]:_0x1822e4[_0xe3ca('0x22')][_0xe3ca('0x23')](',');}var _0xafaf2a={'id':util[_0xe3ca('0xd')]('%s:%s:%s',_0xca43ee,_0x1822e4['id'],_0x1822e4[_0xe3ca('0x1e')]),'condition':require(_0xe3ca('0x2e'))[_0xe3ca('0x2f')](_0xca43ee,getIntervals(_0x3d62e2[_0xe3ca('0x30')],_0x1822e4),_0x3d62e2),'consequence':require(_0xe3ca('0x31')+_0x1822e4[_0xe3ca('0x1e')])[_0xe3ca('0x32')](_0xca43ee,_0x5bc481,_0x3d62e2,_0x292251),'p':_0x1822e4[_0xe3ca('0x33')]||0x0};logger[_0xe3ca('0x34')](_0xe3ca('0x35'),_0xafaf2a['id'],_0xe3ca('0x36'),getIntervals(_0x3d62e2[_0xe3ca('0x30')],_0x1822e4)[_0xe3ca('0x1d')]('\x20|\x20'));_0x479977[_0xe3ca('0x25')](_0xafaf2a);}else{logger[_0xe3ca('0x37')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xe3ca('0x1d')](__dirname,_0xe3ca('0x1a'),_0x1822e4[_0xe3ca('0x1e')]+_0xe3ca('0x1f')));}}_0x3d62e2[_0xe3ca('0x14')][_0xca43ee]=new RuleEngine(_0x479977);_0x3d62e2[_0xe3ca('0x14')][_0xca43ee][_0xe3ca('0x38')](_0x292251,function(_0x210e45){logger[_0xe3ca('0x34')](_0xe3ca('0x39'),JSON[_0xe3ca('0x3a')](_0x210e45['matchPath']));if(_0x3d62e2[_0xe3ca('0x14')][_0xca43ee]){_0x3d62e2[_0xe3ca('0x14')][_0xca43ee]['emit']('complete');}});return _0x337b6c({'code':0xc8,'message':_0x292251});}else{if(_0x5bb8d8){logger[_0xe3ca('0x34')](util[_0xe3ca('0xd')]('Skipped\x20routing\x20for\x20%s',_0xca43ee));}else{logger[_0xe3ca('0x34')](_0xe3ca('0x3b'));}return _0x337b6c({'code':0xc8,'message':_0x292251});}}catch(_0x525ead){logger['error'](_0x525ead[_0xe3ca('0x3c')]);return _0x5f2e2d(_0x884795[_0xe3ca('0x37')](0x1f4,_0x525ead));}}return _0x5f2e2d(_0xe3ca('0x3d'));});},'AcceptMessage':function(_0x409c60){var _0x139c91=this;return new Promise(function(_0x5242f6,_0xfd2d9f){if(_0x409c60[_0xe3ca('0x3e')]&&_0x409c60[_0xe3ca('0x3e')]['id']){if(_0x3d62e2[_0xe3ca('0x3f')][_0x409c60[_0xe3ca('0x3e')]['id']]){_0x3d62e2[_0xe3ca('0x3f')][_0x409c60[_0xe3ca('0x3e')]['id']][_0xe3ca('0x40')]=![];_0x3d62e2[_0xe3ca('0x3f')][_0x409c60['agent']['id']]['busyQueue']=undefined;}}if(_0x409c60['message']&&_0x409c60[_0xe3ca('0x16')]['id']){try{var _0x40a1ad=getId(_0x409c60[_0xe3ca('0x15')],_0x409c60['message']?_0x409c60['message']['id']:0x0,_0x409c60[_0xe3ca('0x17')]?_0x409c60[_0xe3ca('0x17')]['id']:0x0);if(_0x3d62e2[_0xe3ca('0x14')][_0x40a1ad]){_0x3d62e2['rules'][_0x40a1ad]['emit'](_0xe3ca('0x41'));if(rpc[_0x409c60['channel']+_0xe3ca('0x42')]){rpc[_0x409c60[_0xe3ca('0x15')]+_0xe3ca('0x42')][_0xe3ca('0x43')](_0x40a1ad,{'UserId':_0x409c60[_0xe3ca('0x16')][_0xe3ca('0x44')]})[_0xe3ca('0x45')](function(){logger[_0xe3ca('0x37')](_0xe3ca('0x46'));});}}return _0x5242f6({'code':0xc8,'message':_0x409c60});}catch(_0x7cf9dd){logger[_0xe3ca('0x37')](_0x7cf9dd['stack']);return _0xfd2d9f(_0x139c91[_0xe3ca('0x37')](0x1f4,_0x7cf9dd));}}logger[_0xe3ca('0x37')]('message\x20is\x20empty');return _0xfd2d9f(_0x139c91[_0xe3ca('0x37')](0x1f4,_0xe3ca('0x47')));});},'RejectMessage':function(_0x68b9fb){var _0x2bc5a7=this;return new Promise(function(_0x594cb7,_0x4d9e69){if(_0x68b9fb[_0xe3ca('0x3e')]&&_0x68b9fb[_0xe3ca('0x3e')]['id']){try{if(_0x3d62e2[_0xe3ca('0x3f')][_0x68b9fb['agent']['id']]){_0x3d62e2[_0xe3ca('0x3f')][_0x68b9fb[_0xe3ca('0x3e')]['id']][_0xe3ca('0x40')]=![];_0x3d62e2['agents'][_0x68b9fb[_0xe3ca('0x3e')]['id']][_0xe3ca('0x48')]=undefined;}return _0x594cb7({'code':0xc8,'message':_0x68b9fb});}catch(_0x27cef9){logger[_0xe3ca('0x37')](_0x27cef9[_0xe3ca('0x3c')]);return _0x4d9e69(_0x2bc5a7[_0xe3ca('0x37')](0x1f4,_0x27cef9));}}logger[_0xe3ca('0x37')](_0xe3ca('0x47'));return _0x4d9e69(_0x2bc5a7[_0xe3ca('0x37')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x2aca0d){var _0x84df0d=this;return new Promise(function(_0x2ede90,_0x3d3186){if(_0x2aca0d[_0xe3ca('0x15')]&&_0x2aca0d[_0xe3ca('0x17')]&&_0x2aca0d[_0xe3ca('0x17')]['id']){try{var _0x56ab94=getId(_0x2aca0d[_0xe3ca('0x15')],_0x2aca0d[_0xe3ca('0x16')]?_0x2aca0d['message']['id']:0x0,_0x2aca0d[_0xe3ca('0x17')]?_0x2aca0d[_0xe3ca('0x17')]['id']:0x0);if(_0x3d62e2['rules'][_0x56ab94]){_0x3d62e2['rules'][_0x56ab94][_0xe3ca('0x49')](_0xe3ca('0x41'));}return _0x2ede90({'code':0xc8,'message':_0x2aca0d});}catch(_0xec2366){logger['error'](_0xec2366['stack']);return _0x3d3186(_0x84df0d[_0xe3ca('0x37')](0x1f4,_0xec2366));}}logger['error'](_0xe3ca('0x47'));return _0x3d3186(_0x84df0d[_0xe3ca('0x37')](0x1f4,_0xe3ca('0x47')));});},'AgentCapacity':function(_0x45984c){var _0x309ce0=this;return new Promise(function(_0x821d5c,_0x2b8673){if(_0x3d62e2[_0xe3ca('0x3f')][_0xe3ca('0x4a')](_0x45984c['id'])){for(var _0x706d5a in _0x45984c['capacity']){if(_0x45984c[_0xe3ca('0x4b')][_0xe3ca('0x4a')](_0x706d5a)){if(_0x3d62e2[_0xe3ca('0x3f')][_0x45984c['id']][_0xe3ca('0x4a')](_0x706d5a+_0xe3ca('0x4c'))){_0x3d62e2['agents'][_0x45984c['id']][_0x706d5a+_0xe3ca('0x4c')]=parseInt(_0x45984c[_0xe3ca('0x4b')][_0x706d5a],0xa);}}}_0x3d62e2[_0xe3ca('0x3f')][_0x45984c['id']][_0xe3ca('0x4d')]();return _0x821d5c({'code':0xc8,'message':_0x3d62e2[_0xe3ca('0x3f')][_0x45984c['id']]});}else{return _0x2b8673(_0x309ce0[_0xe3ca('0x37')](0x1f4,_0xe3ca('0x4e')));}});},'Agents':function(_0x1a1421){return new Promise(function(_0x3939a3){var _0x3c4ffa=_[_0xe3ca('0x4f')](_0x3d62e2['agents']);if(_0x1a1421&&_0x1a1421['id']){var _0x560b64=_[_0xe3ca('0x50')](_0x3c4ffa,function(_0x4c3def){return _0x4c3def['id']===_0x1a1421['id'];});_0x3939a3(_0x560b64);}else{_0x3939a3({'count':_0x3c4ffa[_0xe3ca('0x1b')],'rows':_0x3c4ffa});}});},'ChatQueues':function(){return new Promise(function(_0x138285){var _0x225fbf=[];for(var _0x2f3ddc in _0x3d62e2['chatQueues']){if(_0x3d62e2[_0xe3ca('0x51')][_0xe3ca('0x4a')](_0x2f3ddc)){var _0x5b1ccc=_0x3d62e2['chatQueues'][_0x2f3ddc];var _0xa33757={'id':_0x5b1ccc['id'],'available':_0x5b1ccc[_0xe3ca('0x52')],'loggedIn':_0x5b1ccc[_0xe3ca('0x53')],'name':_0x5b1ccc[_0xe3ca('0x54')],'paused':_0x5b1ccc[_0xe3ca('0x55')],'waiting':_0x5b1ccc[_0xe3ca('0x56')]};_0x225fbf[_0xe3ca('0x25')](_0xa33757);}}_0x138285({'count':_0x225fbf['length'],'rows':_0x225fbf});});},'MailQueues':function(){return new Promise(function(_0x1082e2){var _0x38b797=[];for(var _0x451505 in _0x3d62e2[_0xe3ca('0x57')]){if(_0x3d62e2['mailQueues']['hasOwnProperty'](_0x451505)){var _0x11a69b=_0x3d62e2[_0xe3ca('0x57')][_0x451505];var _0x89caeb={'id':_0x11a69b['id'],'available':_0x11a69b[_0xe3ca('0x52')],'loggedIn':_0x11a69b[_0xe3ca('0x53')],'name':_0x11a69b['name'],'paused':_0x11a69b[_0xe3ca('0x55')],'waiting':_0x11a69b[_0xe3ca('0x56')]};_0x38b797[_0xe3ca('0x25')](_0x89caeb);}}_0x1082e2({'count':_0x38b797[_0xe3ca('0x1b')],'rows':_0x38b797});});},'OpenchannelQueues':function(){return new Promise(function(_0x43208a){var _0x395b3b=[];for(var _0x2fa297 in _0x3d62e2[_0xe3ca('0x58')]){if(_0x3d62e2['openchannelQueues'][_0xe3ca('0x4a')](_0x2fa297)){var _0x141ea9=_0x3d62e2[_0xe3ca('0x58')][_0x2fa297];var _0x330216={'id':_0x141ea9['id'],'available':_0x141ea9[_0xe3ca('0x52')],'loggedIn':_0x141ea9[_0xe3ca('0x53')],'name':_0x141ea9['name'],'paused':_0x141ea9[_0xe3ca('0x55')],'waiting':_0x141ea9[_0xe3ca('0x56')]};_0x395b3b[_0xe3ca('0x25')](_0x330216);}}_0x43208a({'count':_0x395b3b['length'],'rows':_0x395b3b});});},'SmsQueues':function(){return new Promise(function(_0x1e309b){var _0x1a37f7=[];for(var _0x51f012 in _0x3d62e2[_0xe3ca('0x59')]){if(_0x3d62e2[_0xe3ca('0x59')][_0xe3ca('0x4a')](_0x51f012)){var _0xf48d34=_0x3d62e2[_0xe3ca('0x59')][_0x51f012];var _0x4b4462={'id':_0xf48d34['id'],'available':_0xf48d34[_0xe3ca('0x52')],'loggedIn':_0xf48d34[_0xe3ca('0x53')],'name':_0xf48d34['name'],'paused':_0xf48d34[_0xe3ca('0x55')],'waiting':_0xf48d34[_0xe3ca('0x56')]};_0x1a37f7['push'](_0x4b4462);}}_0x1e309b({'count':_0x1a37f7[_0xe3ca('0x1b')],'rows':_0x1a37f7});});},'FaxQueues':function(){return new Promise(function(_0x39675a){var _0x524200=[];for(var _0x379255 in _0x3d62e2[_0xe3ca('0x5a')]){if(_0x3d62e2[_0xe3ca('0x5a')][_0xe3ca('0x4a')](_0x379255)){var _0x385975=_0x3d62e2[_0xe3ca('0x5a')][_0x379255];var _0x18f212={'id':_0x385975['id'],'available':_0x385975['available'],'loggedIn':_0x385975['loggedIn'],'name':_0x385975[_0xe3ca('0x54')],'paused':_0x385975[_0xe3ca('0x55')],'waiting':_0x385975[_0xe3ca('0x56')]};_0x524200[_0xe3ca('0x25')](_0x18f212);}}_0x39675a({'count':_0x524200['length'],'rows':_0x524200});});},'WhatsappQueues':function(){return new Promise(function(_0x177fb2){var _0x4c01ae=[];for(var _0x375dfe in _0x3d62e2[_0xe3ca('0x5b')]){if(_0x3d62e2[_0xe3ca('0x5b')][_0xe3ca('0x4a')](_0x375dfe)){var _0x22f04c=_0x3d62e2[_0xe3ca('0x5b')][_0x375dfe];var _0xc605d7={'id':_0x22f04c['id'],'available':_0x22f04c[_0xe3ca('0x52')],'loggedIn':_0x22f04c[_0xe3ca('0x53')],'name':_0x22f04c['name'],'paused':_0x22f04c['paused'],'waiting':_0x22f04c['waiting']};_0x4c01ae[_0xe3ca('0x25')](_0xc605d7);}}_0x177fb2({'count':_0x4c01ae['length'],'rows':_0x4c01ae});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x338ede){var _0x5e3ae6=_[_0xe3ca('0x4f')](_0x3d62e2['chatQueuesWaitingInteractions']);_0x338ede({'count':_0x5e3ae6[_0xe3ca('0x1b')],'rows':_0x5e3ae6});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x3ab369){var _0x2de501=_[_0xe3ca('0x4f')](_0x3d62e2['mailQueuesWaitingInteractions']);_0x3ab369({'count':_0x2de501['length'],'rows':_0x2de501});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x275571){var _0x17499b=_[_0xe3ca('0x4f')](_0x3d62e2[_0xe3ca('0x5c')]);_0x275571({'count':_0x17499b[_0xe3ca('0x1b')],'rows':_0x17499b});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x19cae9){var _0x2a5c81=_[_0xe3ca('0x4f')](_0x3d62e2[_0xe3ca('0x5d')]);_0x19cae9({'count':_0x2a5c81[_0xe3ca('0x1b')],'rows':_0x2a5c81});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4d1906){var _0x999f20=_[_0xe3ca('0x4f')](_0x3d62e2[_0xe3ca('0x5e')]);_0x4d1906({'count':_0x999f20[_0xe3ca('0x1b')],'rows':_0x999f20});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x7aad69){var _0x5df0ab=_[_0xe3ca('0x4f')](_0x3d62e2[_0xe3ca('0x5f')]);_0x7aad69({'count':_0x5df0ab[_0xe3ca('0x1b')],'rows':_0x5df0ab});});}};var _0x3f8709=jayson[_0xe3ca('0x60')](_0x9ef773)['http']();_0x3f8709['on']('error',function(_0x102169){logger[_0xe3ca('0x37')](JSON[_0xe3ca('0x3a')](_0x102169));return _0x6a8907(_0x102169);});_0x3f8709[_0xe3ca('0x61')](0x232c,_0xe3ca('0x62'),function(){console['log'](_0xe3ca('0x63'),0x232c);return _0x210c69(_0xe3ca('0x64')+0x232c);});});}; \ No newline at end of file +var _0xbac1=['listen','rules','message','interaction','applications','isArray','length','existsSync','join','.js','app','toLowerCase','appdata','split','channel','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','busyQueue','end','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xbac1,0x17f));var _0x1bac=function(_0x1829a3,_0x303a18){_0x1829a3=_0x1829a3-0x0;var _0x15e120=_0xbac1[_0x1829a3];return _0x15e120;};'use strict';var _=require('lodash');var util=require(_0x1bac('0x0'));var path=require(_0x1bac('0x1'));var fs=require('fs');var jayson=require(_0x1bac('0x2'));var BPromise=require(_0x1bac('0x3'));var utils=require(_0x1bac('0x4'));var sUtils=require(_0x1bac('0x5'));var logger=require('../../../config/logger')(_0x1bac('0x6'));var rpc={'openchannelQueueReport':require(_0x1bac('0x7')),'mailQueueReport':require(_0x1bac('0x8')),'chatQueueReport':require(_0x1bac('0x9')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x1bac('0xa'))};var RuleEngine=require(_0x1bac('0xb'));function getId(_0x5441f0,_0x1e6480,_0x86c896){return util[_0x1bac('0xc')]('%s.%s.%s',_0x5441f0,_0x1e6480||0x0,_0x86c896||0x0);}function getIntervals(_0x1f2f10,_0x138649){var _0xbac0f0=[];if(!_[_0x1bac('0xd')](_0x138649['IntervalId'])&&!_[_0x1bac('0xd')](_0x1f2f10[_0x138649[_0x1bac('0xe')]])&&!_[_0x1bac('0xd')](_0x1f2f10[_0x138649[_0x1bac('0xe')]][_0x1bac('0xf')])){_0xbac0f0=_[_0x1bac('0x10')](_0x1f2f10[_0x138649[_0x1bac('0xe')]][_0x1bac('0xf')],'interval');}else if(!_[_0x1bac('0xd')](_0x138649['interval'])){_0xbac0f0=[_0x138649['interval']];}return _0xbac0f0;}exports[_0x1bac('0x11')]=function(_0x33d2dc){_0x33d2dc[_0x1bac('0x12')]={};return new BPromise(function(_0x216c5a,_0x281da9){var _0x5b2fb2={'Start':function(_0x109b5b){var _0x5d6017=this;return new Promise(function(_0xa2da02,_0x59be64){if(_0x109b5b){try{var _0x47c516=[];var _0x44257b=getId(_0x109b5b['channel'],_0x109b5b['message']?_0x109b5b[_0x1bac('0x13')]['id']:0x0,_0x109b5b[_0x1bac('0x14')]?_0x109b5b[_0x1bac('0x14')]['id']:0x0);var _0x11f29d=sUtils['checkWaitingNotifications'](_0x33d2dc,_0x109b5b);if(_0x109b5b['transfer']||!_0x11f29d&&_0x109b5b[_0x1bac('0x15')]&&_[_0x1bac('0x16')](_0x109b5b[_0x1bac('0x15')])&&_0x109b5b[_0x1bac('0x15')][_0x1bac('0x17')]){for(var _0x5de03d=0x0;_0x5de03d<_0x109b5b[_0x1bac('0x15')][_0x1bac('0x17')];_0x5de03d+=0x1){var _0x32af3f=_0x109b5b['applications'][_0x5de03d];if(fs[_0x1bac('0x18')](path[_0x1bac('0x19')](__dirname,_0x1bac('0x15'),_0x32af3f['app']+_0x1bac('0x1a')))){var _0x57a5e3=[];switch(_0x32af3f[_0x1bac('0x1b')][_0x1bac('0x1c')]()){case'autoreply':var _0x3296f0=_0x32af3f[_0x1bac('0x1d')][_0x1bac('0x1e')](',');if(_0x109b5b[_0x1bac('0x1f')]===_0x1bac('0x20')){_0x57a5e3[_0x1bac('0x21')](_0x3296f0[0x0]);_0x57a5e3[_0x1bac('0x21')](_0x3296f0[0x1]);_0x57a5e3[_0x1bac('0x21')](_0x3296f0[_0x1bac('0x22')](0x2,_0x3296f0[_0x1bac('0x17')])[_0x1bac('0x19')](','));}else{_0x57a5e3[_0x1bac('0x21')](_0x3296f0[0x0]);_0x57a5e3[_0x1bac('0x21')](_0x3296f0[_0x1bac('0x22')](0x1,_0x3296f0[_0x1bac('0x17')])['join'](','));}break;case _0x1bac('0x23'):var _0x265957=_0x32af3f['appdata'][_0x1bac('0x1e')](',');_0x57a5e3[_0x1bac('0x21')](_0x265957[0x0]);_0x57a5e3['push'](_0x265957[0x1]);_0x57a5e3[_0x1bac('0x21')](_0x265957['slice'](0x2,_0x265957[_0x1bac('0x17')])[_0x1bac('0x19')](','));break;case _0x1bac('0x24'):var _0x516cfa=_0x32af3f[_0x1bac('0x1d')][_0x1bac('0x1e')](',');_0x57a5e3[_0x1bac('0x21')](_0x516cfa[0x0]);_0x57a5e3['push'](_0x516cfa[0x1]);_0x57a5e3['push'](_0x516cfa[0x2]);_0x57a5e3[_0x1bac('0x21')](_0x516cfa[0x3]);_0x57a5e3['push'](_0x516cfa['slice'](0x4,_0x516cfa[_0x1bac('0x17')])[_0x1bac('0x19')](','));break;case _0x1bac('0x25'):var _0x5dec3b=_0x32af3f[_0x1bac('0x1d')][_0x1bac('0x1e')](',');_0x57a5e3[_0x1bac('0x21')](_0x5dec3b[0x0]);_0x57a5e3[_0x1bac('0x21')](_0x5dec3b[0x1]);_0x57a5e3['push'](_0x5dec3b[0x2]);_0x57a5e3['push'](_0x5dec3b[0x3]);_0x57a5e3[_0x1bac('0x21')](_0x5dec3b['slice'](0x4,_0x5dec3b[_0x1bac('0x17')])['join'](','));break;case _0x1bac('0x13'):_0x57a5e3[_0x1bac('0x21')](_0x32af3f[_0x1bac('0x1d')]);break;case _0x1bac('0x26'):_0x57a5e3[_0x1bac('0x21')](_0x32af3f['TagId']);_0x57a5e3[_0x1bac('0x21')](_0x32af3f['appdata']);break;case _0x1bac('0x27'):var _0x156fd2=utils[_0x1bac('0x28')](_0x109b5b[_0x1bac('0x29')]['notificationTemplate'],_0x109b5b);var _0x2a3698=_0x32af3f[_0x1bac('0x1d')][_0x1bac('0x1e')](',');_0x57a5e3[_0x1bac('0x21')](_0x2a3698[0x0]);_0x57a5e3[_0x1bac('0x21')](_0x2a3698[0x1]);_0x57a5e3[_0x1bac('0x21')](_0x2a3698[0x2]);_0x57a5e3[_0x1bac('0x21')](_0x2a3698[0x3]);_0x57a5e3['push'](_0x2a3698[0x4]);_0x57a5e3[_0x1bac('0x21')](_0x2a3698[0x5]);_0x57a5e3[_0x1bac('0x21')](_0x2a3698[0x6]);_0x57a5e3[_0x1bac('0x21')](_0x2a3698[0x7]);_0x57a5e3[_0x1bac('0x21')](_0x2a3698[0x8]);_0x57a5e3['push'](_0x2a3698[0x9]);_0x57a5e3[_0x1bac('0x21')](_0x2a3698[0xa]);_0x57a5e3[_0x1bac('0x21')](_0x109b5b[_0x1bac('0x14')]['id']);_0x57a5e3[_0x1bac('0x21')](_0x109b5b[_0x1bac('0x13')]['id']);_0x57a5e3[_0x1bac('0x21')](_0x32af3f[_0x1bac('0x2a')]);_0x57a5e3[_0x1bac('0x21')](_0x109b5b[_0x1bac('0x14')][_0x1bac('0x2b')]);_0x57a5e3[_0x1bac('0x21')](_0x109b5b['body'][_0x1bac('0x2c')]);_0x57a5e3['push'](_0x156fd2);break;default:_0x57a5e3=_[_0x1bac('0xd')](_0x32af3f[_0x1bac('0x1d')])?[]:_0x32af3f[_0x1bac('0x1d')][_0x1bac('0x1e')](',');}var _0xc1b717={'id':util[_0x1bac('0xc')]('%s:%s:%s',_0x44257b,_0x32af3f['id'],_0x32af3f['app']),'condition':require('./interval')[_0x1bac('0x2d')](_0x44257b,getIntervals(_0x33d2dc[_0x1bac('0x2e')],_0x32af3f),_0x33d2dc),'consequence':require(_0x1bac('0x2f')+_0x32af3f[_0x1bac('0x1b')])[_0x1bac('0x30')](_0x44257b,_0x57a5e3,_0x33d2dc,_0x109b5b),'p':_0x32af3f[_0x1bac('0x31')]||0x0};logger[_0x1bac('0x32')](_0x1bac('0x33'),_0xc1b717['id'],_0x1bac('0x34'),getIntervals(_0x33d2dc[_0x1bac('0x2e')],_0x32af3f)[_0x1bac('0x19')](_0x1bac('0x35')));_0x47c516[_0x1bac('0x21')](_0xc1b717);}else{logger['error'](_0x1bac('0x36'),path[_0x1bac('0x19')](__dirname,_0x1bac('0x15'),_0x32af3f['app']+_0x1bac('0x1a')));}}_0x33d2dc['rules'][_0x44257b]=new RuleEngine(_0x47c516);_0x33d2dc['rules'][_0x44257b][_0x1bac('0x37')](_0x109b5b,function(_0x5f4e2a){logger[_0x1bac('0x32')](_0x1bac('0x38'),JSON[_0x1bac('0x39')](_0x5f4e2a[_0x1bac('0x3a')]));if(_0x33d2dc['rules'][_0x44257b]){_0x33d2dc[_0x1bac('0x12')][_0x44257b][_0x1bac('0x3b')]('complete');}});return _0xa2da02({'code':0xc8,'message':_0x109b5b});}else{if(_0x11f29d){logger['info'](util['format'](_0x1bac('0x3c'),_0x44257b));}else{logger[_0x1bac('0x32')](_0x1bac('0x3d'));}return _0xa2da02({'code':0xc8,'message':_0x109b5b});}}catch(_0x355109){logger[_0x1bac('0x3e')](_0x355109[_0x1bac('0x3f')]);return _0x59be64(_0x5d6017[_0x1bac('0x3e')](0x1f4,_0x355109));}}return _0x59be64(_0x1bac('0x40'));});},'AcceptMessage':function(_0x5d2cc3){var _0x4c16ed=this;return new Promise(function(_0x5c2418,_0x5b6169){if(_0x5d2cc3[_0x1bac('0x41')]&&_0x5d2cc3['agent']['id']){if(_0x33d2dc[_0x1bac('0x42')][_0x5d2cc3[_0x1bac('0x41')]['id']]){_0x33d2dc[_0x1bac('0x42')][_0x5d2cc3[_0x1bac('0x41')]['id']]['busy']=![];_0x33d2dc['agents'][_0x5d2cc3[_0x1bac('0x41')]['id']]['busyQueue']=undefined;}}if(_0x5d2cc3['message']&&_0x5d2cc3['message']['id']){try{var _0x3c2671=getId(_0x5d2cc3[_0x1bac('0x1f')],_0x5d2cc3[_0x1bac('0x13')]?_0x5d2cc3[_0x1bac('0x13')]['id']:0x0,_0x5d2cc3[_0x1bac('0x14')]?_0x5d2cc3[_0x1bac('0x14')]['id']:0x0);if(_0x33d2dc['rules'][_0x3c2671]){_0x33d2dc[_0x1bac('0x12')][_0x3c2671][_0x1bac('0x3b')]('end');if(rpc[_0x5d2cc3['channel']+'QueueReport']){rpc[_0x5d2cc3[_0x1bac('0x1f')]+'QueueReport'][_0x1bac('0x43')](_0x3c2671,{'UserId':_0x5d2cc3[_0x1bac('0x13')][_0x1bac('0x44')]})[_0x1bac('0x45')](function(){logger[_0x1bac('0x3e')](_0x1bac('0x46'));});}}return _0x5c2418({'code':0xc8,'message':_0x5d2cc3});}catch(_0x4862aa){logger['error'](_0x4862aa['stack']);return _0x5b6169(_0x4c16ed[_0x1bac('0x3e')](0x1f4,_0x4862aa));}}logger[_0x1bac('0x3e')](_0x1bac('0x47'));return _0x5b6169(_0x4c16ed['error'](0x1f4,_0x1bac('0x47')));});},'RejectMessage':function(_0x352e70){var _0x166a2a=this;return new Promise(function(_0x8c84b6,_0x4abfbb){if(_0x352e70[_0x1bac('0x41')]&&_0x352e70[_0x1bac('0x41')]['id']){try{if(_0x33d2dc[_0x1bac('0x42')][_0x352e70[_0x1bac('0x41')]['id']]){_0x33d2dc[_0x1bac('0x42')][_0x352e70[_0x1bac('0x41')]['id']][_0x1bac('0x48')]=![];_0x33d2dc[_0x1bac('0x42')][_0x352e70['agent']['id']][_0x1bac('0x49')]=undefined;}return _0x8c84b6({'code':0xc8,'message':_0x352e70});}catch(_0x1883db){logger[_0x1bac('0x3e')](_0x1883db[_0x1bac('0x3f')]);return _0x4abfbb(_0x166a2a[_0x1bac('0x3e')](0x1f4,_0x1883db));}}logger[_0x1bac('0x3e')]('message\x20is\x20empty');return _0x4abfbb(_0x166a2a['error'](0x1f4,_0x1bac('0x47')));});},'AbandonInteraction':function(_0xbdc374){var _0x5d3a6f=this;return new Promise(function(_0x397e9f,_0x1bc6df){if(_0xbdc374['channel']&&_0xbdc374[_0x1bac('0x14')]&&_0xbdc374[_0x1bac('0x14')]['id']){try{var _0x47a8ef=getId(_0xbdc374[_0x1bac('0x1f')],_0xbdc374[_0x1bac('0x13')]?_0xbdc374['message']['id']:0x0,_0xbdc374[_0x1bac('0x14')]?_0xbdc374[_0x1bac('0x14')]['id']:0x0);if(_0x33d2dc[_0x1bac('0x12')][_0x47a8ef]){_0x33d2dc[_0x1bac('0x12')][_0x47a8ef]['emit'](_0x1bac('0x4a'));}return _0x397e9f({'code':0xc8,'message':_0xbdc374});}catch(_0xed0986){logger['error'](_0xed0986[_0x1bac('0x3f')]);return _0x1bc6df(_0x5d3a6f[_0x1bac('0x3e')](0x1f4,_0xed0986));}}logger['error'](_0x1bac('0x47'));return _0x1bc6df(_0x5d3a6f[_0x1bac('0x3e')](0x1f4,_0x1bac('0x47')));});},'AgentCapacity':function(_0x5d2e25){var _0x33fb55=this;return new Promise(function(_0x13bfa0,_0x31d3d3){if(_0x33d2dc['agents']['hasOwnProperty'](_0x5d2e25['id'])){for(var _0xfb39c9 in _0x5d2e25[_0x1bac('0x4b')]){if(_0x5d2e25['capacity'][_0x1bac('0x4c')](_0xfb39c9)){if(_0x33d2dc[_0x1bac('0x42')][_0x5d2e25['id']][_0x1bac('0x4c')](_0xfb39c9+'CurrentCapacity')){_0x33d2dc[_0x1bac('0x42')][_0x5d2e25['id']][_0xfb39c9+_0x1bac('0x4d')]=parseInt(_0x5d2e25[_0x1bac('0x4b')][_0xfb39c9],0xa);}}}_0x33d2dc['agents'][_0x5d2e25['id']][_0x1bac('0x4e')]();return _0x13bfa0({'code':0xc8,'message':_0x33d2dc[_0x1bac('0x42')][_0x5d2e25['id']]});}else{return _0x31d3d3(_0x33fb55[_0x1bac('0x3e')](0x1f4,_0x1bac('0x4f')));}});},'Agents':function(_0x50aa1b){return new Promise(function(_0x3a4111){var _0x345bab=_[_0x1bac('0x50')](_0x33d2dc[_0x1bac('0x42')]);if(_0x50aa1b&&_0x50aa1b['id']){var _0x16116e=_[_0x1bac('0x51')](_0x345bab,function(_0x5ebe00){return _0x5ebe00['id']===_0x50aa1b['id'];});_0x3a4111(_0x16116e);}else{_0x3a4111({'count':_0x345bab[_0x1bac('0x17')],'rows':_0x345bab});}});},'ChatQueues':function(){return new Promise(function(_0xfcd678){var _0x13a127=[];for(var _0x1faa72 in _0x33d2dc[_0x1bac('0x52')]){if(_0x33d2dc[_0x1bac('0x52')]['hasOwnProperty'](_0x1faa72)){var _0x41d143=_0x33d2dc['chatQueues'][_0x1faa72];var _0x146082={'id':_0x41d143['id'],'available':_0x41d143[_0x1bac('0x53')],'loggedIn':_0x41d143[_0x1bac('0x54')],'name':_0x41d143[_0x1bac('0x55')],'paused':_0x41d143[_0x1bac('0x56')],'waiting':_0x41d143[_0x1bac('0x57')]};_0x13a127['push'](_0x146082);}}_0xfcd678({'count':_0x13a127[_0x1bac('0x17')],'rows':_0x13a127});});},'MailQueues':function(){return new Promise(function(_0xaa2473){var _0x2dbb0e=[];for(var _0x93b25c in _0x33d2dc[_0x1bac('0x58')]){if(_0x33d2dc[_0x1bac('0x58')][_0x1bac('0x4c')](_0x93b25c)){var _0x169f6f=_0x33d2dc[_0x1bac('0x58')][_0x93b25c];var _0x2f940f={'id':_0x169f6f['id'],'available':_0x169f6f[_0x1bac('0x53')],'loggedIn':_0x169f6f['loggedIn'],'name':_0x169f6f[_0x1bac('0x55')],'paused':_0x169f6f['paused'],'waiting':_0x169f6f[_0x1bac('0x57')]};_0x2dbb0e[_0x1bac('0x21')](_0x2f940f);}}_0xaa2473({'count':_0x2dbb0e[_0x1bac('0x17')],'rows':_0x2dbb0e});});},'OpenchannelQueues':function(){return new Promise(function(_0x16d83c){var _0x466985=[];for(var _0x5b7212 in _0x33d2dc[_0x1bac('0x59')]){if(_0x33d2dc[_0x1bac('0x59')][_0x1bac('0x4c')](_0x5b7212)){var _0x3819e8=_0x33d2dc[_0x1bac('0x59')][_0x5b7212];var _0x5ec7c7={'id':_0x3819e8['id'],'available':_0x3819e8['available'],'loggedIn':_0x3819e8[_0x1bac('0x54')],'name':_0x3819e8[_0x1bac('0x55')],'paused':_0x3819e8[_0x1bac('0x56')],'waiting':_0x3819e8[_0x1bac('0x57')]};_0x466985['push'](_0x5ec7c7);}}_0x16d83c({'count':_0x466985[_0x1bac('0x17')],'rows':_0x466985});});},'SmsQueues':function(){return new Promise(function(_0x4484c8){var _0x4328b0=[];for(var _0x597c7d in _0x33d2dc[_0x1bac('0x5a')]){if(_0x33d2dc[_0x1bac('0x5a')][_0x1bac('0x4c')](_0x597c7d)){var _0x50b556=_0x33d2dc[_0x1bac('0x5a')][_0x597c7d];var _0x456203={'id':_0x50b556['id'],'available':_0x50b556['available'],'loggedIn':_0x50b556[_0x1bac('0x54')],'name':_0x50b556['name'],'paused':_0x50b556['paused'],'waiting':_0x50b556[_0x1bac('0x57')]};_0x4328b0[_0x1bac('0x21')](_0x456203);}}_0x4484c8({'count':_0x4328b0[_0x1bac('0x17')],'rows':_0x4328b0});});},'FaxQueues':function(){return new Promise(function(_0x167a25){var _0x14d18b=[];for(var _0x55f4d3 in _0x33d2dc[_0x1bac('0x5b')]){if(_0x33d2dc['faxQueues']['hasOwnProperty'](_0x55f4d3)){var _0x8ec129=_0x33d2dc[_0x1bac('0x5b')][_0x55f4d3];var _0x423e77={'id':_0x8ec129['id'],'available':_0x8ec129['available'],'loggedIn':_0x8ec129['loggedIn'],'name':_0x8ec129[_0x1bac('0x55')],'paused':_0x8ec129[_0x1bac('0x56')],'waiting':_0x8ec129[_0x1bac('0x57')]};_0x14d18b[_0x1bac('0x21')](_0x423e77);}}_0x167a25({'count':_0x14d18b[_0x1bac('0x17')],'rows':_0x14d18b});});},'WhatsappQueues':function(){return new Promise(function(_0x305552){var _0x3a7620=[];for(var _0x5e2997 in _0x33d2dc[_0x1bac('0x5c')]){if(_0x33d2dc[_0x1bac('0x5c')][_0x1bac('0x4c')](_0x5e2997)){var _0x41b3da=_0x33d2dc[_0x1bac('0x5c')][_0x5e2997];var _0x3346dd={'id':_0x41b3da['id'],'available':_0x41b3da['available'],'loggedIn':_0x41b3da[_0x1bac('0x54')],'name':_0x41b3da[_0x1bac('0x55')],'paused':_0x41b3da['paused'],'waiting':_0x41b3da[_0x1bac('0x57')]};_0x3a7620[_0x1bac('0x21')](_0x3346dd);}}_0x305552({'count':_0x3a7620['length'],'rows':_0x3a7620});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x34f8ff){var _0x3ead12=_['values'](_0x33d2dc['chatQueuesWaitingInteractions']);_0x34f8ff({'count':_0x3ead12[_0x1bac('0x17')],'rows':_0x3ead12});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x2ab2c1){var _0x3487be=_['values'](_0x33d2dc[_0x1bac('0x5d')]);_0x2ab2c1({'count':_0x3487be[_0x1bac('0x17')],'rows':_0x3487be});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x5bacbb){var _0x286a63=_[_0x1bac('0x50')](_0x33d2dc[_0x1bac('0x5e')]);_0x5bacbb({'count':_0x286a63[_0x1bac('0x17')],'rows':_0x286a63});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3f7484){var _0x551375=_[_0x1bac('0x50')](_0x33d2dc[_0x1bac('0x5f')]);_0x3f7484({'count':_0x551375[_0x1bac('0x17')],'rows':_0x551375});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4eb364){var _0x15ce16=_['values'](_0x33d2dc['faxQueuesWaitingInteractions']);_0x4eb364({'count':_0x15ce16[_0x1bac('0x17')],'rows':_0x15ce16});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x22cf50){var _0x1d72c2=_[_0x1bac('0x50')](_0x33d2dc['whatsappQueuesWaitingInteractions']);_0x22cf50({'count':_0x1d72c2[_0x1bac('0x17')],'rows':_0x1d72c2});});}};var _0x4af290=jayson[_0x1bac('0x60')](_0x5b2fb2)['http']();_0x4af290['on']('error',function(_0x3c9fec){logger['error'](JSON['stringify'](_0x3c9fec));return _0x281da9(_0x3c9fec);});_0x4af290['listen'](0x232c,_0x1bac('0x61'),function(){console[_0x1bac('0x62')](_0x1bac('0x63'),0x232c);return _0x216c5a('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 146f723..ec47e2a 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 _0xbdb8=['map','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','join','iftime','../../../config/logger','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop'];(function(_0x4d4ac4,_0x34a899){var _0x37f972=function(_0x35fb1f){while(--_0x35fb1f){_0x4d4ac4['push'](_0x4d4ac4['shift']());}};_0x37f972(++_0x34a899);}(_0xbdb8,0x89));var _0x8bdb=function(_0x187dfb,_0x33bfce){_0x187dfb=_0x187dfb-0x0;var _0x1116df=_0xbdb8[_0x187dfb];return _0x1116df;};'use strict';var _=require('lodash');var iftime=require('../../../utils/iftime')[_0x8bdb('0x0')];var logger=require(_0x8bdb('0x1'))('routing');exports[_0x8bdb('0x2')]=function(_0xf896a4,_0x24d6b1,_0x2fabbc){return function(_0x5c6654){if(_0x2fabbc[_0x8bdb('0x3')]&&!_0x2fabbc[_0x8bdb('0x3')][_0xf896a4]){logger[_0x8bdb('0x4')](_0x8bdb('0x5'),_0xf896a4);return _0x5c6654[_0x8bdb('0x6')]();}var _0x461f30=_0x24d6b1[_0x8bdb('0x7')](function(_0x160429){return iftime(_0x160429);});var _0xe89163=_['some'](_0x461f30);if(_0xe89163){logger[_0x8bdb('0x4')]('[%s][INTERVAL\x20VALID]\x20%s\x20%s',_0xf896a4,_0x24d6b1['join'](_0x8bdb('0x8')),_0xe89163);_0x5c6654[_0x8bdb('0x9')](_0xe89163);}else{logger[_0x8bdb('0x4')](_0x8bdb('0xa'),_0xf896a4,_0x24d6b1[_0x8bdb('0xb')](_0x8bdb('0x8')));_0x5c6654[_0x8bdb('0x6')]();}};}; \ No newline at end of file +var _0x384d=['[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','iftime','routing','condition','rules','info','stop','map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20','when'];(function(_0x10921d,_0x242a14){var _0x163ca1=function(_0x3429b2){while(--_0x3429b2){_0x10921d['push'](_0x10921d['shift']());}};_0x163ca1(++_0x242a14);}(_0x384d,0x7f));var _0xd384=function(_0x24e3f7,_0x318e1c){_0x24e3f7=_0x24e3f7-0x0;var _0x3dc1b4=_0x384d[_0x24e3f7];return _0x3dc1b4;};'use strict';var _=require(_0xd384('0x0'));var iftime=require('../../../utils/iftime')[_0xd384('0x1')];var logger=require('../../../config/logger')(_0xd384('0x2'));exports[_0xd384('0x3')]=function(_0x15efe8,_0x33a47b,_0x2b7bb0){return function(_0x41f8b8){if(_0x2b7bb0[_0xd384('0x4')]&&!_0x2b7bb0[_0xd384('0x4')][_0x15efe8]){logger[_0xd384('0x5')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x15efe8);return _0x41f8b8[_0xd384('0x6')]();}var _0x3e7cdd=_0x33a47b[_0xd384('0x7')](function(_0x54e193){return iftime(_0x54e193);});var _0x341a93=_[_0xd384('0x8')](_0x3e7cdd);if(_0x341a93){logger[_0xd384('0x5')](_0xd384('0x9'),_0x15efe8,_0x33a47b[_0xd384('0xa')](_0xd384('0xb')),_0x341a93);_0x41f8b8[_0xd384('0xc')](_0x341a93);}else{logger[_0xd384('0x5')](_0xd384('0xd'),_0x15efe8,_0x33a47b[_0xd384('0xa')](_0xd384('0xb')));_0x41f8b8[_0xd384('0x6')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index b9e9c05..66f092d 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 _0x0713=['cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','./utils','info','format','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','destuniqueid','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','forIn','includes','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','[%s][agents][agentcomplete]','diffTime','agentcompleteAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]'];(function(_0x3c4fb1,_0x1e1136){var _0x4629b8=function(_0x4136e2){while(--_0x4136e2){_0x3c4fb1['push'](_0x3c4fb1['shift']());}};_0x4629b8(++_0x1e1136);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x3071('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2afa91,_0x27405a){utils[_0x3071('0x1')](util[_0x3071('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x2afa91[_0x3071('0x3')],_0x2afa91[_0x3071('0x4')],_0x2afa91[_0x3071('0x5')],_0x2afa91[_0x3071('0x6')],_0x2afa91[_0x3071('0x7')],_0x2afa91[_0x3071('0x8')],_0x2afa91[_0x3071('0x9')],_0x2afa91[_0x3071('0xa')]));if(_0x2afa91[_0x3071('0x5')]){utils[_0x3071('0xb')](_0x2afa91[_0x3071('0x5')])[_0x3071('0xc')](function(_0x1a868e){if(_0x1a868e){_0x2afa91['type']=_0x1a868e[_0x3071('0xd')];_0x2afa91[_0x3071('0xe')]=_0x2afa91[_0x3071('0xf')]?_0x1a868e[_0x3071('0x10')]:![];_0x2afa91[_0x3071('0x11')]=_0x2afa91['agentacw']?_0x1a868e[_0x3071('0x12')]:0x0;}utils[_0x3071('0x13')](_0x3071('0x14'),_0x2afa91);});}else{utils[_0x3071('0x13')](_0x3071('0x14'),_0x2afa91);}if(_0x27405a){delete transfers[_0x2afa91['uniqueid']];}else{delete agents[_0x2afa91['destuniqueid']];}}exports[_0x3071('0x15')]=function(_0x5dc13b){try{utils[_0x3071('0x16')](util[_0x3071('0x2')]('[%s][agents][agentcalled]',_0x5dc13b[_0x3071('0x3')]),_0x5dc13b);agents[_0x5dc13b['destuniqueid']]=_0x5dc13b;agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x18')]=utils[_0x3071('0x19')]();agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x1a');agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x9')]=null;agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x1b')]=null;utils['info'](util[_0x3071('0x2')](_0x3071('0x1c'),_0x5dc13b[_0x3071('0x3')],agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x6')],_0x5dc13b[_0x3071('0x17')]));}catch(_0x105bbb){utils[_0x3071('0x1d')](util['format'](_0x3071('0x1e'),_0x5dc13b[_0x3071('0x3')]),_0x105bbb);}};exports[_0x3071('0x1f')]=function(_0x56c267){try{if(!_[_0x3071('0x20')](agents[_0x56c267['destuniqueid']])){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x21'),_0x56c267[_0x3071('0x3')]),_0x56c267);utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x22'),_0x56c267[_0x3071('0x3')],agents[_0x56c267['destuniqueid']]['membername'],_0x56c267[_0x3071('0x17')]));agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x1f')]=!![];agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x23')]=utils[_0x3071('0x19')]();agents[_0x56c267[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x24');agents[_0x56c267['destuniqueid']][_0x3071('0x25')]=_0x3071('0x24');agents[_0x56c267[_0x3071('0x17')]]['holdtime']=_0x56c267[_0x3071('0x26')]?parseInt(_0x56c267[_0x3071('0x26')])/0x3e8:0x0;agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x27')]=0x0;unanswered[_0x3071('0x28')](_0x56c267[_0x3071('0x17')]);}}catch(_0x177b5f){utils[_0x3071('0x1d')](util[_0x3071('0x2')](_0x3071('0x21'),_0x56c267[_0x3071('0x3')]),_0x177b5f);}};exports['queuecallerabandon']=function(_0x4f1484){try{_[_0x3071('0x29')](agents,function(_0x149e0d,_0x6ddf96){if(_0x149e0d[_0x3071('0x3')]==_0x4f1484[_0x3071('0x3')]&&!_[_0x3071('0x2a')](unanswered,_0x149e0d[_0x3071('0x17')])){utils[_0x3071('0x16')](util['format']('[%s][agents][queuecallerabandon]',_0x4f1484['uniqueid']),_0x4f1484);utils[_0x3071('0x1')](util[_0x3071('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x4f1484[_0x3071('0x3')],_0x149e0d[_0x3071('0x6')],_0x149e0d[_0x3071('0x17')]));_0x149e0d[_0x3071('0x1f')]=!![];_0x149e0d['agentringnoanswerAt']=utils[_0x3071('0x19')]();_0x149e0d[_0x3071('0xa')]=_0x3071('0x2b');_0x149e0d[_0x3071('0x25')]=_0x3071('0x2b');_0x149e0d[_0x3071('0x2c')]=_0x4f1484[_0x3071('0x2c')];_0x149e0d[_0x3071('0x27')]=0x0;writeDB(_0x149e0d);}});}catch(_0x596cc3){utils[_0x3071('0x1d')](util['format']('[%s][agents][queuecallerabandon]',_0x4f1484[_0x3071('0x3')]),_0x596cc3);}};exports[_0x3071('0x2d')]=function(_0x54d9c3){try{if(agents[_0x54d9c3[_0x3071('0x17')]]){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x2e'),_0x54d9c3[_0x3071('0x3')]),_0x54d9c3);utils[_0x3071('0x1')](util['format'](_0x3071('0x2f'),_0x54d9c3[_0x3071('0x3')],agents[_0x54d9c3['destuniqueid']][_0x3071('0x6')],_0x54d9c3['destuniqueid']));agents[_0x54d9c3[_0x3071('0x17')]][_0x3071('0x30')]=utils['now']();agents[_0x54d9c3['destuniqueid']][_0x3071('0x9')]=_0x54d9c3[_0x3071('0x9')];agents[_0x54d9c3[_0x3071('0x17')]]['connectedlinename']=_0x54d9c3[_0x3071('0x1b')];agents[_0x54d9c3['destuniqueid']][_0x3071('0x2c')]=_0x54d9c3['ringtime'];agents[_0x54d9c3[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x31');_[_0x3071('0x29')](agents,function(_0x30ab68,_0x593c9c){if(_0x30ab68['destuniqueid']!=_0x54d9c3[_0x3071('0x17')]&&_0x30ab68[_0x3071('0x3')]==_0x54d9c3[_0x3071('0x3')]){_0x30ab68[_0x3071('0x27')]=0x0;_0x30ab68['holdtime']=_0x54d9c3[_0x3071('0x26')];_0x30ab68[_0x3071('0x1f')]=!![];_0x30ab68[_0x3071('0x23')]=utils[_0x3071('0x19')]();_0x30ab68[_0x3071('0xa')]=_0x3071('0x32');_0x30ab68['reason']=_0x3071('0x32');_0x30ab68['answeredelsewheredestinationuniqueid']=_0x54d9c3['destuniqueid'];_0x30ab68['answeredelsewheremembername']=_0x54d9c3['membername'];writeDB(_0x30ab68);}});}}catch(_0x2992e6){utils[_0x3071('0x1d')](util[_0x3071('0x2')](_0x3071('0x2e'),_0x54d9c3[_0x3071('0x3')]),_0x2992e6);}};exports[_0x3071('0xf')]=function(_0xa711b5){try{if(!_[_0x3071('0x20')](agents[_0xa711b5['destuniqueid']])){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x33'),_0xa711b5[_0x3071('0x3')]),_0xa711b5);utils[_0x3071('0x1')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0xa711b5[_0x3071('0x3')],agents[_0xa711b5[_0x3071('0x17')]][_0x3071('0x6')],_0xa711b5[_0x3071('0x17')]));agents[_0xa711b5[_0x3071('0x17')]]['agentcomplete']=!![];agents[_0xa711b5[_0x3071('0x17')]]['agentcompleteAt']=utils[_0x3071('0x19')]();agents[_0xa711b5['destuniqueid']]['talktime']=utils[_0x3071('0x34')](agents[_0xa711b5['destuniqueid']][_0x3071('0x35')],agents[_0xa711b5['destuniqueid']][_0x3071('0x30')]);agents[_0xa711b5[_0x3071('0x17')]][_0x3071('0x25')]=_0xa711b5[_0x3071('0x25')];agents[_0xa711b5['destuniqueid']][_0x3071('0xa')]='complete';writeDB(agents[_0xa711b5[_0x3071('0x17')]]);}}catch(_0x4b6bbb){utils[_0x3071('0x1d')](util[_0x3071('0x2')]('[%s][agents][agentcomplete]',_0xa711b5[_0x3071('0x3')]),_0x4b6bbb);}};exports[_0x3071('0x36')]=function(_0x224a70){try{if(!_[_0x3071('0x20')](agents[_0x224a70[_0x3071('0x37')]])){utils[_0x3071('0x16')](util[_0x3071('0x2')]('[%s][agents][blindtransfer]',_0x224a70[_0x3071('0x3')]),_0x224a70);utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x38'),_0x224a70['uniqueid'],agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x6')],agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3')]));agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x39')]=!![];agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3a')]=_0x3071('0x3b');agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3c')]=_0x224a70[_0x3071('0x3d')];agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3e')]=agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3')];}}catch(_0x596cdd){utils['error'](util[_0x3071('0x2')]('[%s][agents][blindtransfer]',_0x224a70[_0x3071('0x3')]),_0x596cdd);}};exports[_0x3071('0x3f')]=function(_0x15c6f8){try{utils['debug'](util[_0x3071('0x2')](_0x3071('0x40'),_0x15c6f8['origtransfereruniqueid']),_0x15c6f8);if(_0x15c6f8['origtransfereruniqueid']==_0x15c6f8[_0x3071('0x41')]){if(!_[_0x3071('0x20')](agents[_0x15c6f8[_0x3071('0x42')]])){utils[_0x3071('0x1')](util['format'](_0x3071('0x43'),_0x15c6f8[_0x3071('0x44')],agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x6')]));agents[_0x15c6f8[_0x3071('0x42')]]['transfer']=!![];agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x3a')]=_0x3071('0x45');agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x3c')]=_0x15c6f8[_0x3071('0x46')];agents[_0x15c6f8[_0x3071('0x42')]]['transferuniqueid']=_0x15c6f8['origtransfereruniqueid'];}if(_0x15c6f8[_0x3071('0x47')]&&agents[_0x15c6f8['transfereeuniqueid']]){agents[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x48')]=0x1;transfers[_0x15c6f8['transfereeuniqueid']]=_[_0x3071('0x49')](agents[_0x15c6f8[_0x3071('0x47')]]);transfers[_0x15c6f8['transfereeuniqueid']][_0x3071('0x8')]=agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x8')];transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x4a')]=agents[_0x15c6f8['secondtransfereruniqueid']][_0x3071('0x4a')];transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x18')]=utils['now']();transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x30')]=utils[_0x3071('0x19')]();transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x2c')]=0x0;transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x48')]=0x2;}}else if(_0x15c6f8[_0x3071('0x42')]==_0x15c6f8[_0x3071('0x4b')]){if(!_['isNil'](agents[_0x15c6f8[_0x3071('0x44')]])){utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x43'),_0x15c6f8[_0x3071('0x44')],agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x6')]));agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x39')]=!![];agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3a')]='ATTENDED';agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3c')]=_0x15c6f8[_0x3071('0x4c')];agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3e')]=_0x15c6f8[_0x3071('0x42')];}if(_0x15c6f8[_0x3071('0x4d')]&&agents[_0x15c6f8[_0x3071('0x4d')]]){agents[_0x15c6f8['transfertargetuniqueid']][_0x3071('0x48')]=0x1;transfers[_0x15c6f8[_0x3071('0x4d')]]=_['clone'](agents[_0x15c6f8['transfertargetuniqueid']]);transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x8')]=agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x8')];transfers[_0x15c6f8['transfertargetuniqueid']]['calleridname']=agents[_0x15c6f8[_0x3071('0x44')]]['calleridname'];transfers[_0x15c6f8['transfertargetuniqueid']]['agentcalledAt']=utils['now']();transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x30')]=utils[_0x3071('0x19')]();transfers[_0x15c6f8['transfertargetuniqueid']][_0x3071('0x2c')]=0x0;transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x48')]=0x2;}}}catch(_0x19a03d){utils['error'](util[_0x3071('0x2')](_0x3071('0x40'),_0x15c6f8['origtransfereruniqueid']),_0x19a03d);}};exports[_0x3071('0x4e')]=function(_0x29ee70){try{utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x4f'),_0x29ee70[_0x3071('0x3')]),_0x29ee70);if(agents[_0x29ee70[_0x3071('0x3')]]&&agents[_0x29ee70['uniqueid']]['reason']===_0x3071('0x24')){if(_0x29ee70[_0x3071('0x50')]==='21'){agents[_0x29ee70[_0x3071('0x3')]]['reason']='rejected';agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]=_0x3071('0x51');}utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],agents[_0x29ee70[_0x3071('0x3')]]['membername'],agents[_0x29ee70[_0x3071('0x3')]]['reason'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(agents[_0x29ee70[_0x3071('0x3')]]);var _0x2fbac7=unanswered[_0x3071('0x53')](_0x29ee70[_0x3071('0x3')]);if(_0x2fbac7>-0x1){unanswered[_0x3071('0x54')](_0x2fbac7,0x1);}}if(transfers[_0x29ee70[_0x3071('0x3')]]){transfers[_0x29ee70['uniqueid']][_0x3071('0xf')]=!![];transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x35')]=utils['now']();transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x27')]=utils[_0x3071('0x34')](transfers[_0x29ee70['uniqueid']]['agentcompleteAt'],transfers[_0x29ee70[_0x3071('0x3')]]['agentconnectAt']);transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x25')]=_0x3071('0x55');transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]=_0x3071('0x56');utils[_0x3071('0x1')](util['format'](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x6')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x25')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(transfers[_0x29ee70['uniqueid']],!![]);}if(agents[_0x29ee70[_0x3071('0x3')]]&&agents[_0x29ee70['uniqueid']][_0x3071('0x30')]){agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xf')]=!![];agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x35')]=utils[_0x3071('0x19')]();agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x27')]=utils[_0x3071('0x34')](agents[_0x29ee70[_0x3071('0x3')]]['agentcompleteAt'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x30')]);agents[_0x29ee70['uniqueid']][_0x3071('0x25')]=agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x39')]?_0x3071('0x39'):_0x3071('0x55');agents[_0x29ee70['uniqueid']]['lastevent']=_0x3071('0x56');utils['info'](util[_0x3071('0x2')](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x6')],agents[_0x29ee70[_0x3071('0x3')]]['reason'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(agents[_0x29ee70[_0x3071('0x3')]]);}}catch(_0x291bb9){utils['error'](util[_0x3071('0x2')](_0x3071('0x4f'),_0x29ee70['uniqueid']),_0x291bb9);}}; \ No newline at end of file +var _0x702d=['error','[%s][agents][agentringnoanswer]','agentringnoanswer','agentringnoanswerAt','now','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','transferexten','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transferuniqueid','transfertargetuniqueid','clone','calleridname','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','called','connectedlinename','info'];(function(_0x5095da,_0x4b42dc){var _0x4df9f6=function(_0x167840){while(--_0x167840){_0x5095da['push'](_0x5095da['shift']());}};_0x4df9f6(++_0x4b42dc);}(_0x702d,0x147));var _0xd702=function(_0x354c8b,_0x299f92){_0x354c8b=_0x354c8b-0x0;var _0x3b4f2e=_0x702d[_0x354c8b];return _0x3b4f2e;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var utils=require(_0xd702('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x33e7c5,_0x37ed5c){utils['info'](util[_0xd702('0x3')](_0xd702('0x4'),_0x33e7c5[_0xd702('0x5')],_0x33e7c5[_0xd702('0x6')],_0x33e7c5['queue'],_0x33e7c5[_0xd702('0x7')],_0x33e7c5['interface'],_0x33e7c5[_0xd702('0x8')],_0x33e7c5[_0xd702('0x9')],_0x33e7c5[_0xd702('0xa')]));if(_0x33e7c5['queue']){utils[_0xd702('0xb')](_0x33e7c5['queue'])[_0xd702('0xc')](function(_0x25423f){if(_0x25423f){_0x33e7c5[_0xd702('0xd')]=_0x25423f[_0xd702('0xd')];_0x33e7c5[_0xd702('0xe')]=_0x33e7c5[_0xd702('0xf')]?_0x25423f[_0xd702('0x10')]:![];_0x33e7c5[_0xd702('0x11')]=_0x33e7c5[_0xd702('0xe')]?_0x25423f[_0xd702('0x12')]:0x0;}utils['request']('CreateVoiceAgentReport',_0x33e7c5);});}else{utils[_0xd702('0x13')](_0xd702('0x14'),_0x33e7c5);}if(_0x37ed5c){delete transfers[_0x33e7c5[_0xd702('0x5')]];}else{delete agents[_0x33e7c5['destuniqueid']];}}exports[_0xd702('0x15')]=function(_0x128add){try{utils[_0xd702('0x16')](util[_0xd702('0x3')](_0xd702('0x17'),_0x128add[_0xd702('0x5')]),_0x128add);agents[_0x128add['destuniqueid']]=_0x128add;agents[_0x128add[_0xd702('0x18')]][_0xd702('0x19')]=utils['now']();agents[_0x128add[_0xd702('0x18')]]['lastevent']=_0xd702('0x1a');agents[_0x128add[_0xd702('0x18')]]['connectedlinenum']=null;agents[_0x128add[_0xd702('0x18')]][_0xd702('0x1b')]=null;utils[_0xd702('0x1c')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x128add[_0xd702('0x5')],agents[_0x128add['destuniqueid']][_0xd702('0x7')],_0x128add[_0xd702('0x18')]));}catch(_0x37267c){utils[_0xd702('0x1d')](util[_0xd702('0x3')](_0xd702('0x17'),_0x128add[_0xd702('0x5')]),_0x37267c);}};exports['agentringnoanswer']=function(_0x4be140){try{if(!_['isNil'](agents[_0x4be140[_0xd702('0x18')]])){utils[_0xd702('0x16')](util['format'](_0xd702('0x1e'),_0x4be140['uniqueid']),_0x4be140);utils[_0xd702('0x1c')](util['format']('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x4be140['uniqueid'],agents[_0x4be140[_0xd702('0x18')]][_0xd702('0x7')],_0x4be140[_0xd702('0x18')]));agents[_0x4be140['destuniqueid']][_0xd702('0x1f')]=!![];agents[_0x4be140[_0xd702('0x18')]][_0xd702('0x20')]=utils[_0xd702('0x21')]();agents[_0x4be140[_0xd702('0x18')]][_0xd702('0xa')]=_0xd702('0x22');agents[_0x4be140[_0xd702('0x18')]][_0xd702('0x23')]='timeout';agents[_0x4be140[_0xd702('0x18')]][_0xd702('0x24')]=_0x4be140[_0xd702('0x25')]?parseInt(_0x4be140[_0xd702('0x25')])/0x3e8:0x0;agents[_0x4be140[_0xd702('0x18')]][_0xd702('0x26')]=0x0;unanswered[_0xd702('0x27')](_0x4be140[_0xd702('0x18')]);}}catch(_0x5f1084){utils['error'](util[_0xd702('0x3')](_0xd702('0x1e'),_0x4be140['uniqueid']),_0x5f1084);}};exports[_0xd702('0x28')]=function(_0xee8bf1){try{_[_0xd702('0x29')](agents,function(_0x2946ae,_0x56e9cd){if(_0x2946ae[_0xd702('0x5')]==_0xee8bf1[_0xd702('0x5')]&&!_[_0xd702('0x2a')](unanswered,_0x2946ae[_0xd702('0x18')])){utils[_0xd702('0x16')](util['format'](_0xd702('0x2b'),_0xee8bf1[_0xd702('0x5')]),_0xee8bf1);utils[_0xd702('0x1c')](util['format'](_0xd702('0x2c'),_0xee8bf1['uniqueid'],_0x2946ae['membername'],_0x2946ae[_0xd702('0x18')]));_0x2946ae[_0xd702('0x1f')]=!![];_0x2946ae[_0xd702('0x20')]=utils['now']();_0x2946ae[_0xd702('0xa')]=_0xd702('0x2d');_0x2946ae['reason']=_0xd702('0x2d');_0x2946ae[_0xd702('0x24')]=_0xee8bf1[_0xd702('0x24')];_0x2946ae[_0xd702('0x26')]=0x0;writeDB(_0x2946ae);}});}catch(_0xa6b40a){utils[_0xd702('0x1d')](util[_0xd702('0x3')](_0xd702('0x2b'),_0xee8bf1[_0xd702('0x5')]),_0xa6b40a);}};exports[_0xd702('0x2e')]=function(_0x9f458b){try{if(agents[_0x9f458b[_0xd702('0x18')]]){utils[_0xd702('0x16')](util['format'](_0xd702('0x2f'),_0x9f458b[_0xd702('0x5')]),_0x9f458b);utils[_0xd702('0x1c')](util[_0xd702('0x3')](_0xd702('0x30'),_0x9f458b[_0xd702('0x5')],agents[_0x9f458b[_0xd702('0x18')]]['membername'],_0x9f458b['destuniqueid']));agents[_0x9f458b[_0xd702('0x18')]][_0xd702('0x31')]=utils['now']();agents[_0x9f458b['destuniqueid']][_0xd702('0x9')]=_0x9f458b[_0xd702('0x9')];agents[_0x9f458b['destuniqueid']][_0xd702('0x1b')]=_0x9f458b[_0xd702('0x1b')];agents[_0x9f458b[_0xd702('0x18')]]['holdtime']=_0x9f458b[_0xd702('0x25')];agents[_0x9f458b[_0xd702('0x18')]][_0xd702('0xa')]='connect';_[_0xd702('0x29')](agents,function(_0x512854,_0x359bbd){if(_0x512854[_0xd702('0x18')]!=_0x9f458b[_0xd702('0x18')]&&_0x512854[_0xd702('0x5')]==_0x9f458b[_0xd702('0x5')]){_0x512854[_0xd702('0x26')]=0x0;_0x512854[_0xd702('0x24')]=_0x9f458b[_0xd702('0x25')];_0x512854['agentringnoanswer']=!![];_0x512854[_0xd702('0x20')]=utils[_0xd702('0x21')]();_0x512854[_0xd702('0xa')]=_0xd702('0x32');_0x512854[_0xd702('0x23')]='answered_elsewhere';_0x512854[_0xd702('0x33')]=_0x9f458b[_0xd702('0x18')];_0x512854[_0xd702('0x34')]=_0x9f458b['membername'];writeDB(_0x512854);}});}}catch(_0xd48ad0){utils[_0xd702('0x1d')](util[_0xd702('0x3')](_0xd702('0x2f'),_0x9f458b['uniqueid']),_0xd48ad0);}};exports[_0xd702('0xf')]=function(_0xfa5e9){try{if(!_[_0xd702('0x35')](agents[_0xfa5e9[_0xd702('0x18')]])){utils[_0xd702('0x16')](util['format'](_0xd702('0x36'),_0xfa5e9[_0xd702('0x5')]),_0xfa5e9);utils['info'](util['format'](_0xd702('0x37'),_0xfa5e9[_0xd702('0x5')],agents[_0xfa5e9[_0xd702('0x18')]][_0xd702('0x7')],_0xfa5e9[_0xd702('0x18')]));agents[_0xfa5e9[_0xd702('0x18')]][_0xd702('0xf')]=!![];agents[_0xfa5e9[_0xd702('0x18')]][_0xd702('0x38')]=utils['now']();agents[_0xfa5e9['destuniqueid']][_0xd702('0x26')]=utils['diffTime'](agents[_0xfa5e9[_0xd702('0x18')]]['agentcompleteAt'],agents[_0xfa5e9[_0xd702('0x18')]]['agentconnectAt']);agents[_0xfa5e9[_0xd702('0x18')]]['reason']=_0xfa5e9[_0xd702('0x23')];agents[_0xfa5e9[_0xd702('0x18')]]['lastevent']=_0xd702('0x39');writeDB(agents[_0xfa5e9[_0xd702('0x18')]]);}}catch(_0x2c0528){utils[_0xd702('0x1d')](util[_0xd702('0x3')]('[%s][agents][agentcomplete]',_0xfa5e9[_0xd702('0x5')]),_0x2c0528);}};exports[_0xd702('0x3a')]=function(_0x2d09be){try{if(!_['isNil'](agents[_0x2d09be[_0xd702('0x3b')]])){utils['debug'](util[_0xd702('0x3')](_0xd702('0x3c'),_0x2d09be[_0xd702('0x5')]),_0x2d09be);utils['info'](util['format'](_0xd702('0x3d'),_0x2d09be[_0xd702('0x5')],agents[_0x2d09be[_0xd702('0x3b')]][_0xd702('0x7')],agents[_0x2d09be[_0xd702('0x3b')]][_0xd702('0x5')]));agents[_0x2d09be[_0xd702('0x3b')]][_0xd702('0x3e')]=!![];agents[_0x2d09be[_0xd702('0x3b')]][_0xd702('0x3f')]='blind';agents[_0x2d09be['transfereruniqueid']][_0xd702('0x40')]=_0x2d09be[_0xd702('0x41')];agents[_0x2d09be[_0xd702('0x3b')]]['transferuniqueid']=agents[_0x2d09be['transfereruniqueid']][_0xd702('0x5')];}}catch(_0x54c7e2){utils[_0xd702('0x1d')](util[_0xd702('0x3')](_0xd702('0x3c'),_0x2d09be[_0xd702('0x5')]),_0x54c7e2);}};exports[_0xd702('0x42')]=function(_0x3cd4c1){try{utils[_0xd702('0x16')](util[_0xd702('0x3')](_0xd702('0x43'),_0x3cd4c1['origtransfereruniqueid']),_0x3cd4c1);if(_0x3cd4c1[_0xd702('0x44')]==_0x3cd4c1[_0xd702('0x45')]){if(!_[_0xd702('0x35')](agents[_0x3cd4c1[_0xd702('0x46')]])){utils['info'](util[_0xd702('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x3cd4c1[_0xd702('0x44')],agents[_0x3cd4c1['secondtransfereruniqueid']]['membername']));agents[_0x3cd4c1[_0xd702('0x46')]][_0xd702('0x3e')]=!![];agents[_0x3cd4c1[_0xd702('0x46')]][_0xd702('0x3f')]=_0xd702('0x47');agents[_0x3cd4c1[_0xd702('0x46')]]['transferexten']=_0x3cd4c1[_0xd702('0x48')];agents[_0x3cd4c1[_0xd702('0x46')]]['transferuniqueid']=_0x3cd4c1[_0xd702('0x44')];}if(_0x3cd4c1[_0xd702('0x49')]&&agents[_0x3cd4c1[_0xd702('0x49')]]){agents[_0x3cd4c1[_0xd702('0x49')]][_0xd702('0x4a')]=0x1;transfers[_0x3cd4c1[_0xd702('0x49')]]=_['clone'](agents[_0x3cd4c1[_0xd702('0x49')]]);transfers[_0x3cd4c1[_0xd702('0x49')]][_0xd702('0x8')]=agents[_0x3cd4c1[_0xd702('0x46')]][_0xd702('0x8')];transfers[_0x3cd4c1['transfereeuniqueid']]['calleridname']=agents[_0x3cd4c1[_0xd702('0x46')]]['calleridname'];transfers[_0x3cd4c1['transfereeuniqueid']][_0xd702('0x19')]=utils['now']();transfers[_0x3cd4c1[_0xd702('0x49')]][_0xd702('0x31')]=utils[_0xd702('0x21')]();transfers[_0x3cd4c1[_0xd702('0x49')]]['holdtime']=0x0;transfers[_0x3cd4c1[_0xd702('0x49')]]['agententerreason']=0x2;}}else if(_0x3cd4c1[_0xd702('0x46')]==_0x3cd4c1['secondtransfererlinkedid']){if(!_[_0xd702('0x35')](agents[_0x3cd4c1[_0xd702('0x44')]])){utils[_0xd702('0x1c')](util[_0xd702('0x3')](_0xd702('0x4b'),_0x3cd4c1[_0xd702('0x44')],agents[_0x3cd4c1[_0xd702('0x44')]]['membername']));agents[_0x3cd4c1['origtransfereruniqueid']][_0xd702('0x3e')]=!![];agents[_0x3cd4c1['origtransfereruniqueid']][_0xd702('0x3f')]=_0xd702('0x47');agents[_0x3cd4c1['origtransfereruniqueid']][_0xd702('0x40')]=_0x3cd4c1[_0xd702('0x4c')];agents[_0x3cd4c1['origtransfereruniqueid']][_0xd702('0x4d')]=_0x3cd4c1['secondtransfereruniqueid'];}if(_0x3cd4c1[_0xd702('0x4e')]&&agents[_0x3cd4c1[_0xd702('0x4e')]]){agents[_0x3cd4c1[_0xd702('0x4e')]][_0xd702('0x4a')]=0x1;transfers[_0x3cd4c1['transfertargetuniqueid']]=_[_0xd702('0x4f')](agents[_0x3cd4c1[_0xd702('0x4e')]]);transfers[_0x3cd4c1[_0xd702('0x4e')]][_0xd702('0x8')]=agents[_0x3cd4c1[_0xd702('0x44')]]['calleridnum'];transfers[_0x3cd4c1[_0xd702('0x4e')]][_0xd702('0x50')]=agents[_0x3cd4c1[_0xd702('0x44')]][_0xd702('0x50')];transfers[_0x3cd4c1[_0xd702('0x4e')]][_0xd702('0x19')]=utils['now']();transfers[_0x3cd4c1[_0xd702('0x4e')]]['agentconnectAt']=utils[_0xd702('0x21')]();transfers[_0x3cd4c1[_0xd702('0x4e')]][_0xd702('0x24')]=0x0;transfers[_0x3cd4c1[_0xd702('0x4e')]]['agententerreason']=0x2;}}}catch(_0x3e99ff){utils[_0xd702('0x1d')](util[_0xd702('0x3')](_0xd702('0x43'),_0x3cd4c1[_0xd702('0x44')]),_0x3e99ff);}};exports['hangup']=function(_0x5bc3dd){try{utils[_0xd702('0x16')](util[_0xd702('0x3')](_0xd702('0x51'),_0x5bc3dd[_0xd702('0x5')]),_0x5bc3dd);if(agents[_0x5bc3dd[_0xd702('0x5')]]&&agents[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0x23')]===_0xd702('0x22')){if(_0x5bc3dd[_0xd702('0x52')]==='21'){agents[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0x23')]=_0xd702('0x53');agents[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0xa')]=_0xd702('0x53');}utils[_0xd702('0x1c')](util['format'](_0xd702('0x54'),_0x5bc3dd['uniqueid'],agents[_0x5bc3dd['uniqueid']][_0xd702('0x7')],agents[_0x5bc3dd['uniqueid']][_0xd702('0x23')],agents[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0xa')]));writeDB(agents[_0x5bc3dd[_0xd702('0x5')]]);var _0x472e5a=unanswered[_0xd702('0x55')](_0x5bc3dd[_0xd702('0x5')]);if(_0x472e5a>-0x1){unanswered[_0xd702('0x56')](_0x472e5a,0x1);}}if(transfers[_0x5bc3dd[_0xd702('0x5')]]){transfers[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0xf')]=!![];transfers[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0x38')]=utils[_0xd702('0x21')]();transfers[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0x26')]=utils[_0xd702('0x57')](transfers[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0x38')],transfers[_0x5bc3dd['uniqueid']][_0xd702('0x31')]);transfers[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0x23')]=_0xd702('0x58');transfers[_0x5bc3dd[_0xd702('0x5')]]['lastevent']=_0xd702('0x39');utils[_0xd702('0x1c')](util['format'](_0xd702('0x54'),_0x5bc3dd[_0xd702('0x5')],transfers[_0x5bc3dd[_0xd702('0x5')]]['membername'],transfers[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0x23')],transfers[_0x5bc3dd['uniqueid']][_0xd702('0xa')]));writeDB(transfers[_0x5bc3dd[_0xd702('0x5')]],!![]);}if(agents[_0x5bc3dd[_0xd702('0x5')]]&&agents[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0x31')]){agents[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0xf')]=!![];agents[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0x38')]=utils[_0xd702('0x21')]();agents[_0x5bc3dd[_0xd702('0x5')]]['talktime']=utils[_0xd702('0x57')](agents[_0x5bc3dd[_0xd702('0x5')]]['agentcompleteAt'],agents[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0x31')]);agents[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0x23')]=agents[_0x5bc3dd[_0xd702('0x5')]]['transfer']?'transfer':_0xd702('0x58');agents[_0x5bc3dd['uniqueid']][_0xd702('0xa')]=_0xd702('0x39');utils[_0xd702('0x1c')](util[_0xd702('0x3')](_0xd702('0x54'),_0x5bc3dd['uniqueid'],agents[_0x5bc3dd[_0xd702('0x5')]]['membername'],agents[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0x23')],agents[_0x5bc3dd[_0xd702('0x5')]][_0xd702('0xa')]));writeDB(agents[_0x5bc3dd[_0xd702('0x5')]]);}}catch(_0x1ea077){utils['error'](util['format'](_0xd702('0x51'),_0x5bc3dd[_0xd702('0x5')]),_0x1ea077);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 6dc0f11..3fdab1d 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 _0x0239=['includes','noop','execif','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','newchannel','debug','[%s][calls][newchannel]','linkedid','context','exten','now','DOCUMENTATION','error','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastapplication','Queue','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','routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','cdr','split','substring','lastIndexOf'];(function(_0x4144c0,_0x253e2b){var _0x424d45=function(_0x5f1644){while(--_0x5f1644){_0x4144c0['push'](_0x4144c0['shift']());}};_0x424d45(++_0x253e2b);}(_0x0239,0x141));var _0x9023=function(_0x4a34a9,_0x4a24c2){_0x4a34a9=_0x4a34a9-0x0;var _0x42d05d=_0x0239[_0x4a34a9];return _0x42d05d;};'use strict';var _=require('lodash');var util=require(_0x9023('0x0'));var utils=require(_0x9023('0x1'));var dispositions=[_0x9023('0x2'),_0x9023('0x3'),_0x9023('0x3'),'NO\x20ANSWER',_0x9023('0x2'),_0x9023('0x2'),_0x9023('0x4'),_0x9023('0x5'),_0x9023('0x3'),_0x9023('0x3'),_0x9023('0x3')];var channels={};function writeDB(_0x499690){utils[_0x9023('0x6')](util[_0x9023('0x7')](_0x9023('0x8'),_0x499690[_0x9023('0x9')],_0x499690[_0x9023('0xa')],_0x499690['queue'],_0x499690[_0x9023('0xb')],_0x499690[_0x9023('0xc')],_0x499690[_0x9023('0xd')],_0x499690['connectedlinenum'],_0x499690[_0x9023('0xe')]));if(_0x499690[_0x9023('0xf')]){utils[_0x9023('0x10')](_0x499690[_0x9023('0xf')])[_0x9023('0x11')](function(_0x18335e){if(_0x18335e){_0x499690[_0x9023('0x12')]=_0x18335e['id'];}utils['request'](_0x9023('0x13'),_0x499690);});}else{utils[_0x9023('0x14')](_0x9023('0x13'),_0x499690);}if(channels[_0x499690[_0x9023('0x9')]]){delete channels[_0x499690[_0x9023('0x9')]];}}exports[_0x9023('0x15')]=function(_0x54d182){try{utils[_0x9023('0x16')](util[_0x9023('0x7')](_0x9023('0x17'),_0x54d182[_0x9023('0x9')]),_0x54d182);if(_0x54d182['uniqueid']==_0x54d182[_0x9023('0x18')]&&_0x54d182[_0x9023('0xa')]!='OutgoingSpoolFailed'){utils[_0x9023('0x6')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x54d182[_0x9023('0x9')],_0x54d182[_0x9023('0x19')],_0x54d182[_0x9023('0x1a')]));channels[_0x54d182[_0x9023('0x9')]]={'uniqueid':_0x54d182[_0x9023('0x9')],'accountcode':_0x54d182[_0x9023('0xf')],'source':_0x54d182[_0x9023('0xd')],'destination':_0x54d182[_0x9023('0x1a')],'destinationcontext':_0x54d182['context'],'channel':_0x54d182[_0x9023('0xa')],'starttime':utils[_0x9023('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9023('0x2'),'amaflags':_0x9023('0x1c')};}}catch(_0x30c726){utils[_0x9023('0x1d')](util[_0x9023('0x7')](_0x9023('0x17'),_0x54d182['uniqueid']),_0x30c726);}};exports['newstate']=function(_0x31fa04){try{utils[_0x9023('0x16')](util['format'](_0x9023('0x1e'),_0x31fa04[_0x9023('0x9')]),_0x31fa04);if(!_[_0x9023('0x1f')](channels[_0x31fa04[_0x9023('0x9')]])&&_0x31fa04[_0x9023('0x20')]==0x6){utils[_0x9023('0x6')](util[_0x9023('0x7')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x31fa04[_0x9023('0x9')],_0x31fa04[_0x9023('0x19')],_0x31fa04[_0x9023('0xa')]));if(_[_0x9023('0x1f')](channels[_0x31fa04[_0x9023('0x9')]][_0x9023('0x21')])){channels[_0x31fa04[_0x9023('0x9')]][_0x9023('0x21')]=utils['now']();}}else if(!_['isNil'](channels[_0x31fa04[_0x9023('0x18')]])&&_0x31fa04[_0x9023('0x20')]==0x6&&_0x31fa04[_0x9023('0x19')]!=_0x9023('0x22')){utils['info'](util[_0x9023('0x7')](_0x9023('0x23'),_0x31fa04[_0x9023('0x9')],_0x31fa04['linkedid'],_0x31fa04[_0x9023('0x19')],_0x31fa04['channel']));channels[_0x31fa04['linkedid']]['accountcode']=_0x31fa04['accountcode'];channels[_0x31fa04[_0x9023('0x18')]][_0x9023('0x24')]=_0x31fa04[_0x9023('0xa')];if(_[_0x9023('0x1f')](channels[_0x31fa04[_0x9023('0x18')]][_0x9023('0x25')])){channels[_0x31fa04['linkedid']]['answertime']=utils[_0x9023('0x1b')]();}channels[_0x31fa04['linkedid']]['disposition']=dispositions[_[_0x9023('0x26')](_0x31fa04[_0x9023('0x20')])]||_0x9023('0x4');}}catch(_0x35fb31){utils['error'](util[_0x9023('0x7')](_0x9023('0x1e'),_0x31fa04[_0x9023('0x9')]),_0x35fb31);}};exports[_0x9023('0x27')]=function(_0x577c71){try{if(!_[_0x9023('0x1f')](channels[_0x577c71['uniqueid']])){utils[_0x9023('0x16')](util['format'](_0x9023('0x28'),_0x577c71[_0x9023('0x9')]),_0x577c71);if(_[_0x9023('0x1f')](channels[_0x577c71[_0x9023('0x9')]][_0x9023('0x29')])){channels[_0x577c71[_0x9023('0x9')]][_0x9023('0x29')]=_0x577c71['calleridname']+'\x20<'+_0x577c71[_0x9023('0xd')]+'>';}utils[_0x9023('0x6')](util['format'](_0x9023('0x2a'),_0x577c71[_0x9023('0x9')],channels[_0x577c71[_0x9023('0x9')]][_0x9023('0x29')],_0x577c71[_0x9023('0x2b')]));channels[_0x577c71[_0x9023('0x9')]][_0x9023('0x2c')]=utils[_0x9023('0x1b')]();channels[_0x577c71[_0x9023('0x9')]][_0x9023('0x2d')]=utils[_0x9023('0x2e')](channels[_0x577c71[_0x9023('0x9')]][_0x9023('0x2c')],channels[_0x577c71[_0x9023('0x9')]]['starttime']);channels[_0x577c71['uniqueid']]['billableseconds']=channels[_0x577c71[_0x9023('0x9')]][_0x9023('0x25')]?utils[_0x9023('0x2e')](channels[_0x577c71['uniqueid']]['endtime'],channels[_0x577c71[_0x9023('0x9')]][_0x9023('0x25')]):0x0;writeDB(channels[_0x577c71[_0x9023('0x9')]]);}}catch(_0x1829f6){utils['error'](util[_0x9023('0x7')](_0x9023('0x28'),_0x577c71[_0x9023('0x9')]),_0x1829f6);}};exports[_0x9023('0x2f')]=function(_0x40e83f){try{if(!_['isNil'](channels[_0x40e83f[_0x9023('0x30')]])){utils[_0x9023('0x16')](util[_0x9023('0x7')](_0x9023('0x31'),_0x40e83f[_0x9023('0x32')]),_0x40e83f);if(channels[_0x40e83f[_0x9023('0x30')]][_0x9023('0xa')]==_0x40e83f[_0x9023('0x33')]){utils[_0x9023('0x6')](util[_0x9023('0x7')](_0x9023('0x34'),_0x40e83f['origtransfereruniqueid'],_0x40e83f[_0x9023('0x30')],_0x40e83f[_0x9023('0x35')]));channels[_0x40e83f[_0x9023('0x30')]][_0x9023('0x24')]=_0x40e83f[_0x9023('0x35')];channels[_0x40e83f[_0x9023('0x30')]][_0x9023('0x36')]=_0x9023('0x37');}else if(channels[_0x40e83f[_0x9023('0x30')]]['channel']=_0x40e83f[_0x9023('0x38')]){utils['info'](util[_0x9023('0x7')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x40e83f[_0x9023('0x32')],_0x40e83f[_0x9023('0x30')],_0x40e83f[_0x9023('0x39')]));channels[_0x40e83f[_0x9023('0x30')]][_0x9023('0x24')]=_0x40e83f[_0x9023('0x39')];channels[_0x40e83f[_0x9023('0x30')]][_0x9023('0x36')]=_0x9023('0x37');}}}catch(_0x11c436){utils[_0x9023('0x1d')](util[_0x9023('0x7')](_0x9023('0x31'),_0x40e83f['origtransfereruniqueid']),_0x11c436);}};exports[_0x9023('0x3a')]=function(_0x39790b){try{if(!_[_0x9023('0x1f')](channels[_0x39790b['uniqueid']])){utils['debug'](util[_0x9023('0x7')]('[%s][calls][musiconholdstart]',_0x39790b['uniqueid']),_0x39790b);channels[_0x39790b[_0x9023('0x9')]][_0x9023('0x3b')]=utils[_0x9023('0x1b')]();utils[_0x9023('0x6')](util['format'](_0x9023('0x3c'),_0x39790b['uniqueid'],channels[_0x39790b[_0x9023('0x9')]][_0x9023('0x3b')]));}}catch(_0x18e3a5){utils[_0x9023('0x1d')](util[_0x9023('0x7')](_0x9023('0x3d'),_0x39790b['uniqueid']),_0x18e3a5);}};exports['musiconholdstop']=function(_0x575e19){try{if(!_[_0x9023('0x1f')](channels[_0x575e19[_0x9023('0x9')]])){utils[_0x9023('0x16')](util['format'](_0x9023('0x3e'),_0x575e19[_0x9023('0x9')]),_0x575e19);if(!_['isNil'](channels[_0x575e19[_0x9023('0x9')]][_0x9023('0x3b')])){channels[_0x575e19[_0x9023('0x9')]][_0x9023('0x3f')]+=utils[_0x9023('0x2e')](utils['now'](),channels[_0x575e19[_0x9023('0x9')]]['musiconholdstartAt']);utils[_0x9023('0x6')](util[_0x9023('0x7')](_0x9023('0x40'),_0x575e19[_0x9023('0x9')],channels[_0x575e19['uniqueid']]['mohtime']));delete channels[_0x575e19[_0x9023('0x9')]][_0x9023('0x3b')];}}}catch(_0x54cee7){utils[_0x9023('0x1d')](util[_0x9023('0x7')](_0x9023('0x3e'),_0x575e19[_0x9023('0x9')]),_0x54cee7);}};exports[_0x9023('0x41')]=function(_0xb7d27d){try{if(!_[_0x9023('0x1f')](channels[_0xb7d27d[_0x9023('0x9')]])){utils[_0x9023('0x16')](util['format'](_0x9023('0x42'),_0xb7d27d['uniqueid']),_0xb7d27d);if(!_[_0x9023('0x1f')](_0xb7d27d[_0x9023('0x43')][_0x9023('0x44')])){utils[_0x9023('0x6')](util['format'](_0x9023('0x45'),_0xb7d27d[_0x9023('0x9')],_0xb7d27d[_0x9023('0x46')]));channels[_0xb7d27d[_0x9023('0x9')]][_0x9023('0x47')]=_0xb7d27d['value'];}if(!_[_0x9023('0x1f')](_0xb7d27d[_0x9023('0x43')]['xmd-phone'])){utils['info'](util['format'](_0x9023('0x48'),_0xb7d27d['uniqueid'],_0xb7d27d[_0x9023('0x46')]));channels[_0xb7d27d['uniqueid']]['destination']=_0xb7d27d[_0x9023('0x46')];channels[_0xb7d27d[_0x9023('0x9')]][_0x9023('0x29')]='\x22'+_0xb7d27d[_0x9023('0x46')]+_0x9023('0x49')+_0xb7d27d[_0x9023('0x46')]+'>';}if(!_[_0x9023('0x1f')](_0xb7d27d[_0x9023('0x43')][_0x9023('0x4a')])||!_['isNil'](_0xb7d27d[_0x9023('0x43')][_0x9023('0x4b')])){utils[_0x9023('0x6')](util[_0x9023('0x7')](_0x9023('0x4c'),_0xb7d27d['uniqueid'],!_['isNil'](_0xb7d27d[_0x9023('0x43')][_0x9023('0x4a')])?_0x9023('0x4a'):'xmd-callerid',_0xb7d27d[_0x9023('0x46')]));channels[_0xb7d27d[_0x9023('0x9')]][_0x9023('0x29')]=_0xb7d27d['value'];}if(!_['isNil'](_0xb7d27d[_0x9023('0x43')]['xmd-queue'])||!_[_0x9023('0x1f')](_0xb7d27d['variable']['xmcs-queue'])){utils['info'](util[_0x9023('0x7')](_0x9023('0x4c'),_0xb7d27d[_0x9023('0x9')],!_[_0x9023('0x1f')](_0xb7d27d[_0x9023('0x43')][_0x9023('0x4d')])?_0x9023('0x4d'):'xmcs-queue',_0xb7d27d[_0x9023('0x46')]));channels[_0xb7d27d[_0x9023('0x9')]][_0x9023('0x4e')]=_0x9023('0x4f');channels[_0xb7d27d['uniqueid']][_0x9023('0x50')]=_0xb7d27d[_0x9023('0x46')];channels[_0xb7d27d[_0x9023('0x9')]][_0x9023('0x51')]=!![];}if(!_[_0x9023('0x1f')](_0xb7d27d[_0x9023('0x43')][_0x9023('0x52')])){utils[_0x9023('0x6')](util[_0x9023('0x7')](_0x9023('0x53'),_0xb7d27d[_0x9023('0x9')],_0xb7d27d[_0x9023('0x46')]));channels[_0xb7d27d[_0x9023('0x9')]][_0x9023('0x54')]=_0xb7d27d[_0x9023('0x46')];}if(!_['isNil'](_0xb7d27d[_0x9023('0x43')][_0x9023('0x55')])){utils[_0x9023('0x6')](util['format'](_0x9023('0x56'),_0xb7d27d['uniqueid'],_0xb7d27d[_0x9023('0x46')]));channels[_0xb7d27d[_0x9023('0x9')]][_0x9023('0x57')]=_0xb7d27d['value'];}if(!_[_0x9023('0x1f')](_0xb7d27d[_0x9023('0x43')][_0x9023('0x58')])){utils[_0x9023('0x6')](util[_0x9023('0x7')](_0x9023('0x59'),_0xb7d27d[_0x9023('0x9')],_0xb7d27d['value']));channels[_0xb7d27d['uniqueid']][_0x9023('0x5a')]=_0xb7d27d[_0x9023('0x46')];}if(!_[_0x9023('0x1f')](_0xb7d27d['variable'][_0x9023('0x5b')])){utils[_0x9023('0x6')](util[_0x9023('0x7')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0xb7d27d[_0x9023('0x9')],_0xb7d27d[_0x9023('0x46')]));channels[_0xb7d27d[_0x9023('0x9')]][_0x9023('0x5b')]=_0xb7d27d[_0x9023('0x46')];}}}catch(_0x4ee10d){utils[_0x9023('0x1d')](util[_0x9023('0x7')](_0x9023('0x42'),_0xb7d27d['uniqueid']),_0x4ee10d);}};exports[_0x9023('0x5c')]=function(_0x4445b8){try{if(!_['isNil'](channels[_0x4445b8[_0x9023('0x9')]])){utils[_0x9023('0x16')](util[_0x9023('0x7')](_0x9023('0x5d'),_0x4445b8[_0x9023('0x9')]),_0x4445b8);utils[_0x9023('0x6')](util['format'](_0x9023('0x5e'),_0x4445b8[_0x9023('0x9')],_0x4445b8[_0x9023('0x5f')],_0x4445b8['appdata']));if(_0x4445b8[_0x9023('0x5f')][_0x9023('0x60')]()==_0x9023('0x61')&&_['startsWith'](_0x4445b8[_0x9023('0x62')][_0x9023('0x60')](),_0x9023('0x63'))){var _0x4d1145=_0x4445b8[_0x9023('0x62')][_0x9023('0x64')]('=');var _0x353b4d=_0x4d1145[0x0][_0x9023('0x65')](_0x4d1145[0x0]['lastIndexOf']('(')+0x1,_0x4d1145[0x0][_0x9023('0x66')](')'));var _0xe9010f=_0x4d1145[0x1];channels[_0x4445b8[_0x9023('0x9')]][_0x353b4d]=_0xe9010f;}if(!_[_0x9023('0x67')]([_0x9023('0x27'),_0x9023('0x68'),_0x9023('0x69'),_0x9023('0x61'),'gotoif'],_0x4445b8[_0x9023('0x5f')][_0x9023('0x60')]())){channels[_0x4445b8[_0x9023('0x9')]][_0x9023('0x4e')]=_0x4445b8[_0x9023('0x5f')];channels[_0x4445b8[_0x9023('0x9')]][_0x9023('0x50')]=_0x4445b8[_0x9023('0x62')];}}}catch(_0x3fea6e){utils[_0x9023('0x1d')](util[_0x9023('0x7')](_0x9023('0x5d'),_0x4445b8[_0x9023('0x9')]),_0x3fea6e);}}; \ No newline at end of file +var _0x6bb0=['[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','info','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','isNil','channelstate','transfer','destinationchannel','answertime','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','[%s][calls][musiconholdstop]','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','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','routeid','sipcallid','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','split','substring','lastIndexOf','includes','noop','execif','gotoif','[%s][calls][newexten]','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','format'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0x6bb0,0x64));var _0x06bb=function(_0x5f4864,_0x48dd66){_0x5f4864=_0x5f4864-0x0;var _0xa73468=_0x6bb0[_0x5f4864];return _0xa73468;};'use strict';var _=require(_0x06bb('0x0'));var util=require(_0x06bb('0x1'));var utils=require(_0x06bb('0x2'));var dispositions=[_0x06bb('0x3'),_0x06bb('0x4'),_0x06bb('0x4'),_0x06bb('0x3'),_0x06bb('0x3'),_0x06bb('0x3'),_0x06bb('0x5'),_0x06bb('0x6'),_0x06bb('0x4'),_0x06bb('0x4'),_0x06bb('0x4')];var channels={};function writeDB(_0x1756f0){utils['info'](util[_0x06bb('0x7')](_0x06bb('0x8'),_0x1756f0[_0x06bb('0x9')],_0x1756f0[_0x06bb('0xa')],_0x1756f0[_0x06bb('0xb')],_0x1756f0[_0x06bb('0xc')],_0x1756f0[_0x06bb('0xd')],_0x1756f0[_0x06bb('0xe')],_0x1756f0[_0x06bb('0xf')],_0x1756f0['lastevent']));if(_0x1756f0['accountcode']){utils[_0x06bb('0x10')](_0x1756f0[_0x06bb('0x11')])[_0x06bb('0x12')](function(_0x29dfb2){if(_0x29dfb2){_0x1756f0[_0x06bb('0x13')]=_0x29dfb2['id'];}utils[_0x06bb('0x14')]('CreateVoiceCallReport',_0x1756f0);});}else{utils[_0x06bb('0x14')](_0x06bb('0x15'),_0x1756f0);}if(channels[_0x1756f0['uniqueid']]){delete channels[_0x1756f0[_0x06bb('0x9')]];}}exports[_0x06bb('0x16')]=function(_0x288d49){try{utils[_0x06bb('0x17')](util[_0x06bb('0x7')](_0x06bb('0x18'),_0x288d49['uniqueid']),_0x288d49);if(_0x288d49[_0x06bb('0x9')]==_0x288d49[_0x06bb('0x19')]&&_0x288d49[_0x06bb('0xa')]!=_0x06bb('0x1a')){utils['info'](util[_0x06bb('0x7')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x288d49[_0x06bb('0x9')],_0x288d49[_0x06bb('0x1b')],_0x288d49[_0x06bb('0x1c')]));channels[_0x288d49['uniqueid']]={'uniqueid':_0x288d49[_0x06bb('0x9')],'accountcode':_0x288d49[_0x06bb('0x11')],'source':_0x288d49[_0x06bb('0xe')],'destination':_0x288d49[_0x06bb('0x1c')],'destinationcontext':_0x288d49[_0x06bb('0x1b')],'channel':_0x288d49[_0x06bb('0xa')],'starttime':utils[_0x06bb('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x06bb('0x3'),'amaflags':_0x06bb('0x1e')};}}catch(_0x121b01){utils[_0x06bb('0x1f')](util['format'](_0x06bb('0x18'),_0x288d49[_0x06bb('0x9')]),_0x121b01);}};exports[_0x06bb('0x20')]=function(_0x23cdfe){try{utils[_0x06bb('0x17')](util[_0x06bb('0x7')](_0x06bb('0x21'),_0x23cdfe[_0x06bb('0x9')]),_0x23cdfe);if(!_['isNil'](channels[_0x23cdfe[_0x06bb('0x9')]])&&_0x23cdfe['channelstate']==0x6){utils[_0x06bb('0x22')](util[_0x06bb('0x7')](_0x06bb('0x23'),_0x23cdfe[_0x06bb('0x9')],_0x23cdfe[_0x06bb('0x1b')],_0x23cdfe[_0x06bb('0xa')]));if(_['isNil'](channels[_0x23cdfe['uniqueid']][_0x06bb('0x24')])){channels[_0x23cdfe['uniqueid']]['systemanswertime']=utils[_0x06bb('0x1d')]();}}else if(!_[_0x06bb('0x25')](channels[_0x23cdfe[_0x06bb('0x19')]])&&_0x23cdfe[_0x06bb('0x26')]==0x6&&_0x23cdfe['context']!=_0x06bb('0x27')){utils[_0x06bb('0x22')](util[_0x06bb('0x7')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x23cdfe['uniqueid'],_0x23cdfe[_0x06bb('0x19')],_0x23cdfe['context'],_0x23cdfe[_0x06bb('0xa')]));channels[_0x23cdfe[_0x06bb('0x19')]][_0x06bb('0x11')]=_0x23cdfe['accountcode'];channels[_0x23cdfe[_0x06bb('0x19')]][_0x06bb('0x28')]=_0x23cdfe[_0x06bb('0xa')];if(_['isNil'](channels[_0x23cdfe['linkedid']][_0x06bb('0x29')])){channels[_0x23cdfe[_0x06bb('0x19')]][_0x06bb('0x29')]=utils[_0x06bb('0x1d')]();}channels[_0x23cdfe['linkedid']]['disposition']=dispositions[_['toNumber'](_0x23cdfe[_0x06bb('0x26')])]||_0x06bb('0x5');}}catch(_0x7c902e){utils[_0x06bb('0x1f')](util[_0x06bb('0x7')]('[%s][calls][newstate]',_0x23cdfe[_0x06bb('0x9')]),_0x7c902e);}};exports[_0x06bb('0x2a')]=function(_0x51a00d){try{if(!_[_0x06bb('0x25')](channels[_0x51a00d[_0x06bb('0x9')]])){utils[_0x06bb('0x17')](util[_0x06bb('0x7')](_0x06bb('0x2b'),_0x51a00d['uniqueid']),_0x51a00d);if(_[_0x06bb('0x25')](channels[_0x51a00d['uniqueid']][_0x06bb('0x2c')])){channels[_0x51a00d[_0x06bb('0x9')]][_0x06bb('0x2c')]=_0x51a00d[_0x06bb('0x2d')]+'\x20<'+_0x51a00d['calleridnum']+'>';}utils['info'](util[_0x06bb('0x7')](_0x06bb('0x2e'),_0x51a00d['uniqueid'],channels[_0x51a00d[_0x06bb('0x9')]][_0x06bb('0x2c')],_0x51a00d[_0x06bb('0x2f')]));channels[_0x51a00d[_0x06bb('0x9')]][_0x06bb('0x30')]=utils[_0x06bb('0x1d')]();channels[_0x51a00d[_0x06bb('0x9')]][_0x06bb('0x31')]=utils[_0x06bb('0x32')](channels[_0x51a00d['uniqueid']][_0x06bb('0x30')],channels[_0x51a00d[_0x06bb('0x9')]][_0x06bb('0x33')]);channels[_0x51a00d[_0x06bb('0x9')]][_0x06bb('0x34')]=channels[_0x51a00d[_0x06bb('0x9')]][_0x06bb('0x29')]?utils['diffTime'](channels[_0x51a00d[_0x06bb('0x9')]]['endtime'],channels[_0x51a00d[_0x06bb('0x9')]][_0x06bb('0x29')]):0x0;writeDB(channels[_0x51a00d['uniqueid']]);}}catch(_0x22a07e){utils[_0x06bb('0x1f')](util[_0x06bb('0x7')](_0x06bb('0x2b'),_0x51a00d[_0x06bb('0x9')]),_0x22a07e);}};exports['attendedtransfer']=function(_0x30c9d5){try{if(!_[_0x06bb('0x25')](channels[_0x30c9d5[_0x06bb('0x35')]])){utils[_0x06bb('0x17')](util[_0x06bb('0x7')](_0x06bb('0x36'),_0x30c9d5['origtransfereruniqueid']),_0x30c9d5);if(channels[_0x30c9d5[_0x06bb('0x35')]][_0x06bb('0xa')]==_0x30c9d5[_0x06bb('0x37')]){utils[_0x06bb('0x22')](util[_0x06bb('0x7')](_0x06bb('0x38'),_0x30c9d5[_0x06bb('0x39')],_0x30c9d5[_0x06bb('0x35')],_0x30c9d5['secondtransfererchannel']));channels[_0x30c9d5['localtwolinkedid']][_0x06bb('0x28')]=_0x30c9d5['secondtransfererchannel'];channels[_0x30c9d5[_0x06bb('0x35')]][_0x06bb('0x3a')]=_0x06bb('0x3b');}else if(channels[_0x30c9d5[_0x06bb('0x35')]][_0x06bb('0xa')]=_0x30c9d5[_0x06bb('0x3c')]){utils[_0x06bb('0x22')](util[_0x06bb('0x7')](_0x06bb('0x38'),_0x30c9d5['origtransfereruniqueid'],_0x30c9d5[_0x06bb('0x35')],_0x30c9d5['origtransfererchannel']));channels[_0x30c9d5[_0x06bb('0x35')]][_0x06bb('0x28')]=_0x30c9d5[_0x06bb('0x3d')];channels[_0x30c9d5[_0x06bb('0x35')]]['userfield']=_0x06bb('0x3b');}}}catch(_0xc28860){utils[_0x06bb('0x1f')](util[_0x06bb('0x7')]('[%s][calls][attendedtransfer]',_0x30c9d5[_0x06bb('0x39')]),_0xc28860);}};exports[_0x06bb('0x3e')]=function(_0x554d89){try{if(!_[_0x06bb('0x25')](channels[_0x554d89[_0x06bb('0x9')]])){utils[_0x06bb('0x17')](util[_0x06bb('0x7')]('[%s][calls][musiconholdstart]',_0x554d89[_0x06bb('0x9')]),_0x554d89);channels[_0x554d89[_0x06bb('0x9')]][_0x06bb('0x3f')]=utils[_0x06bb('0x1d')]();utils[_0x06bb('0x22')](util[_0x06bb('0x7')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x554d89['uniqueid'],channels[_0x554d89['uniqueid']]['musiconholdstartAt']));}}catch(_0x584c45){utils[_0x06bb('0x1f')](util[_0x06bb('0x7')]('[%s][calls][musiconholdstart]',_0x554d89[_0x06bb('0x9')]),_0x584c45);}};exports[_0x06bb('0x40')]=function(_0x2eca70){try{if(!_[_0x06bb('0x25')](channels[_0x2eca70[_0x06bb('0x9')]])){utils[_0x06bb('0x17')](util['format']('[%s][calls][musiconholdstop]',_0x2eca70['uniqueid']),_0x2eca70);if(!_[_0x06bb('0x25')](channels[_0x2eca70[_0x06bb('0x9')]]['musiconholdstartAt'])){channels[_0x2eca70[_0x06bb('0x9')]]['mohtime']+=utils[_0x06bb('0x32')](utils[_0x06bb('0x1d')](),channels[_0x2eca70[_0x06bb('0x9')]][_0x06bb('0x3f')]);utils[_0x06bb('0x22')](util[_0x06bb('0x7')](_0x06bb('0x41'),_0x2eca70[_0x06bb('0x9')],channels[_0x2eca70[_0x06bb('0x9')]][_0x06bb('0x42')]));delete channels[_0x2eca70[_0x06bb('0x9')]][_0x06bb('0x3f')];}}}catch(_0x4dc715){utils['error'](util[_0x06bb('0x7')](_0x06bb('0x43'),_0x2eca70[_0x06bb('0x9')]),_0x4dc715);}};exports['varset']=function(_0x1f9c44){try{if(!_[_0x06bb('0x25')](channels[_0x1f9c44[_0x06bb('0x9')]])){utils[_0x06bb('0x17')](util[_0x06bb('0x7')](_0x06bb('0x44'),_0x1f9c44[_0x06bb('0x9')]),_0x1f9c44);if(!_['isNil'](_0x1f9c44[_0x06bb('0x45')][_0x06bb('0x46')])){utils[_0x06bb('0x22')](util[_0x06bb('0x7')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1f9c44[_0x06bb('0x9')],_0x1f9c44[_0x06bb('0x47')]));channels[_0x1f9c44[_0x06bb('0x9')]][_0x06bb('0x48')]=_0x1f9c44[_0x06bb('0x47')];}if(!_[_0x06bb('0x25')](_0x1f9c44[_0x06bb('0x45')][_0x06bb('0x49')])){utils[_0x06bb('0x22')](util[_0x06bb('0x7')](_0x06bb('0x4a'),_0x1f9c44[_0x06bb('0x9')],_0x1f9c44[_0x06bb('0x47')]));channels[_0x1f9c44[_0x06bb('0x9')]]['destination']=_0x1f9c44[_0x06bb('0x47')];channels[_0x1f9c44['uniqueid']][_0x06bb('0x2c')]='\x22'+_0x1f9c44[_0x06bb('0x47')]+_0x06bb('0x4b')+_0x1f9c44[_0x06bb('0x47')]+'>';}if(!_['isNil'](_0x1f9c44[_0x06bb('0x45')][_0x06bb('0x4c')])||!_[_0x06bb('0x25')](_0x1f9c44[_0x06bb('0x45')][_0x06bb('0x4d')])){utils[_0x06bb('0x22')](util[_0x06bb('0x7')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x1f9c44[_0x06bb('0x9')],!_[_0x06bb('0x25')](_0x1f9c44['variable'][_0x06bb('0x4c')])?_0x06bb('0x4c'):'xmd-callerid',_0x1f9c44[_0x06bb('0x47')]));channels[_0x1f9c44[_0x06bb('0x9')]][_0x06bb('0x2c')]=_0x1f9c44[_0x06bb('0x47')];}if(!_[_0x06bb('0x25')](_0x1f9c44[_0x06bb('0x45')][_0x06bb('0x4e')])||!_[_0x06bb('0x25')](_0x1f9c44['variable'][_0x06bb('0x4f')])){utils[_0x06bb('0x22')](util[_0x06bb('0x7')](_0x06bb('0x50'),_0x1f9c44[_0x06bb('0x9')],!_['isNil'](_0x1f9c44[_0x06bb('0x45')][_0x06bb('0x4e')])?'xmd-queue':_0x06bb('0x4f'),_0x1f9c44[_0x06bb('0x47')]));channels[_0x1f9c44[_0x06bb('0x9')]][_0x06bb('0x51')]=_0x06bb('0x52');channels[_0x1f9c44[_0x06bb('0x9')]][_0x06bb('0x53')]=_0x1f9c44[_0x06bb('0x47')];channels[_0x1f9c44[_0x06bb('0x9')]][_0x06bb('0xb')]=!![];}if(!_[_0x06bb('0x25')](_0x1f9c44[_0x06bb('0x45')][_0x06bb('0x54')])){utils['info'](util[_0x06bb('0x7')](_0x06bb('0x55'),_0x1f9c44[_0x06bb('0x9')],_0x1f9c44[_0x06bb('0x47')]));channels[_0x1f9c44['uniqueid']][_0x06bb('0x56')]=_0x1f9c44[_0x06bb('0x47')];}if(!_['isNil'](_0x1f9c44[_0x06bb('0x45')][_0x06bb('0x57')])){utils[_0x06bb('0x22')](util['format'](_0x06bb('0x58'),_0x1f9c44['uniqueid'],_0x1f9c44[_0x06bb('0x47')]));channels[_0x1f9c44['uniqueid']][_0x06bb('0x59')]=_0x1f9c44[_0x06bb('0x47')];}if(!_[_0x06bb('0x25')](_0x1f9c44[_0x06bb('0x45')][_0x06bb('0x5a')])){utils[_0x06bb('0x22')](util[_0x06bb('0x7')](_0x06bb('0x5b'),_0x1f9c44[_0x06bb('0x9')],_0x1f9c44['value']));channels[_0x1f9c44[_0x06bb('0x9')]][_0x06bb('0x5c')]=_0x1f9c44[_0x06bb('0x47')];}if(!_[_0x06bb('0x25')](_0x1f9c44[_0x06bb('0x45')][_0x06bb('0x5d')])){utils[_0x06bb('0x22')](util[_0x06bb('0x7')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x1f9c44[_0x06bb('0x9')],_0x1f9c44[_0x06bb('0x47')]));channels[_0x1f9c44['uniqueid']][_0x06bb('0x5d')]=_0x1f9c44[_0x06bb('0x47')];}}}catch(_0x4fc3fd){utils[_0x06bb('0x1f')](util['format']('[%s][calls][varset]',_0x1f9c44['uniqueid']),_0x4fc3fd);}};exports['newexten']=function(_0x3b6787){try{if(!_[_0x06bb('0x25')](channels[_0x3b6787[_0x06bb('0x9')]])){utils['debug'](util[_0x06bb('0x7')]('[%s][calls][newexten]',_0x3b6787['uniqueid']),_0x3b6787);utils[_0x06bb('0x22')](util[_0x06bb('0x7')](_0x06bb('0x5e'),_0x3b6787[_0x06bb('0x9')],_0x3b6787['application'],_0x3b6787[_0x06bb('0x5f')]));if(_0x3b6787[_0x06bb('0x60')][_0x06bb('0x61')]()==_0x06bb('0x62')&&_[_0x06bb('0x63')](_0x3b6787[_0x06bb('0x5f')][_0x06bb('0x61')](),'cdr')){var _0x3d2192=_0x3b6787[_0x06bb('0x5f')][_0x06bb('0x64')]('=');var _0x313a9f=_0x3d2192[0x0][_0x06bb('0x65')](_0x3d2192[0x0]['lastIndexOf']('(')+0x1,_0x3d2192[0x0][_0x06bb('0x66')](')'));var _0x5a3b52=_0x3d2192[0x1];channels[_0x3b6787[_0x06bb('0x9')]][_0x313a9f]=_0x5a3b52;}if(!_[_0x06bb('0x67')](['hangup',_0x06bb('0x68'),_0x06bb('0x69'),_0x06bb('0x62'),_0x06bb('0x6a')],_0x3b6787[_0x06bb('0x60')][_0x06bb('0x61')]())){channels[_0x3b6787[_0x06bb('0x9')]]['lastapplication']=_0x3b6787[_0x06bb('0x60')];channels[_0x3b6787[_0x06bb('0x9')]][_0x06bb('0x53')]=_0x3b6787['appdata'];}}}catch(_0x34c6f4){utils[_0x06bb('0x1f')](util[_0x06bb('0x7')](_0x06bb('0x6b'),_0x3b6787[_0x06bb('0x9')]),_0x34c6f4);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index d8178cf..27d81c4 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 _0xdc06=['[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x2dfb31,_0x1f19fe){var _0x38c6e5=function(_0x149f2d){while(--_0x149f2d){_0x2dfb31['push'](_0x2dfb31['shift']());}};_0x38c6e5(++_0x1f19fe);}(_0xdc06,0x15e));var _0x6dc0=function(_0x10b46e,_0x1139cb){_0x10b46e=_0x10b46e-0x0;var _0x3a15ea=_0xdc06[_0x10b46e];return _0x3a15ea;};'use strict';var utils=require(_0x6dc0('0x0'));exports[_0x6dc0('0x1')]=function(){utils[_0x6dc0('0x2')](_0x6dc0('0x3'));};exports[_0x6dc0('0x4')]=function(){utils[_0x6dc0('0x2')](_0x6dc0('0x5'));};exports['fullybooted']=function(){utils[_0x6dc0('0x2')](_0x6dc0('0x6'));};exports[_0x6dc0('0x7')]=function(_0x2f706b){utils['error'](_0x6dc0('0x8'),_0x2f706b);};exports[_0x6dc0('0x9')]=function(){utils['info'](_0x6dc0('0xa'));};exports[_0x6dc0('0xb')]=function(_0x3b9310){}; \ No newline at end of file +var _0x5bf9=['close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error'];(function(_0x3edc62,_0x2c2627){var _0x39c88c=function(_0x138695){while(--_0x138695){_0x3edc62['push'](_0x3edc62['shift']());}};_0x39c88c(++_0x2c2627);}(_0x5bf9,0x1d1));var _0x95bf=function(_0x4475cc,_0x2ae903){_0x4475cc=_0x4475cc-0x0;var _0x56d24a=_0x5bf9[_0x4475cc];return _0x56d24a;};'use strict';var utils=require(_0x95bf('0x0'));exports[_0x95bf('0x1')]=function(){utils[_0x95bf('0x2')]('[core]\x20connected');};exports['shutdown']=function(){utils[_0x95bf('0x2')](_0x95bf('0x3'));};exports[_0x95bf('0x4')]=function(){utils[_0x95bf('0x2')](_0x95bf('0x5'));};exports[_0x95bf('0x6')]=function(_0x4760b3){utils[_0x95bf('0x6')](_0x95bf('0x7'),_0x4760b3);};exports[_0x95bf('0x8')]=function(){utils['info'](_0x95bf('0x9'));};exports[_0x95bf('0xa')]=function(_0x341e32){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index d407ce8..3d37e31 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 _0xd3fa=['cause-txt','complete','duration','diffTime','holdtime','endtime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','calleridnum','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr(routeid)','error','varset','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','dialstatus','ANSWER','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname'];(function(_0x3cc05d,_0x4b8f88){var _0x28b736=function(_0x369b0e){while(--_0x369b0e){_0x3cc05d['push'](_0x3cc05d['shift']());}};_0x28b736(++_0x4b8f88);}(_0xd3fa,0x1d2));var _0xad3f=function(_0x5b1d57,_0x23b9b9){_0x5b1d57=_0x5b1d57-0x0;var _0x3f4f78=_0xd3fa[_0x5b1d57];return _0x3f4f78;};'use strict';var _=require(_0xad3f('0x0'));var util=require(_0xad3f('0x1'));var utils=require(_0xad3f('0x2'));var dials={};function writeDB(_0x4e2fdd){utils[_0xad3f('0x3')](util[_0xad3f('0x4')](_0xad3f('0x5'),_0x4e2fdd[_0xad3f('0x6')],_0x4e2fdd['channel'],_0x4e2fdd['dialstring'],_0x4e2fdd[_0xad3f('0x7')],_0x4e2fdd['connectedlinenum'],_0x4e2fdd['dialstatus']));utils[_0xad3f('0x8')](_0xad3f('0x9'),_0x4e2fdd);delete dials[_0x4e2fdd[_0xad3f('0x6')]];}exports[_0xad3f('0xa')]=function(_0x2dd36a){try{utils[_0xad3f('0xb')](util[_0xad3f('0x4')](_0xad3f('0xc'),_0x2dd36a[_0xad3f('0x6')]),_0x2dd36a);utils[_0xad3f('0x3')](util[_0xad3f('0x4')](_0xad3f('0xd'),_0x2dd36a['uniqueid'],_0x2dd36a[_0xad3f('0xe')],_0x2dd36a[_0xad3f('0xf')]));if(_0x2dd36a['application'][_0xad3f('0x10')]()==_0xad3f('0x11')&&_['startsWith'](_0x2dd36a[_0xad3f('0xf')][_0xad3f('0x10')](),_0xad3f('0x12'))){var _0x33b0f8=_0x2dd36a['appdata']['split']('=');dials[_0x2dd36a[_0xad3f('0x6')]]={'routeId':_0x33b0f8[0x1]};}}catch(_0x9d1cd8){utils[_0xad3f('0x13')](util['format'](_0xad3f('0xc'),_0x2dd36a[_0xad3f('0x6')]),_0x9d1cd8);}};exports[_0xad3f('0x14')]=function(_0x16b69a){try{utils[_0xad3f('0xb')](util['format']('[%s][dials][varset]',_0x16b69a[_0xad3f('0x6')]),_0x16b69a);if(!_[_0xad3f('0x15')](_0x16b69a[_0xad3f('0x16')][_0xad3f('0x17')])){utils[_0xad3f('0x3')](util[_0xad3f('0x4')](_0xad3f('0x18'),_0x16b69a[_0xad3f('0x6')],_0x16b69a['value']));dials[_0x16b69a[_0xad3f('0x6')]]={'routeId':_0x16b69a[_0xad3f('0x19')]};}}catch(_0x448410){utils[_0xad3f('0x13')](util['format']('[%s][dials][varset]',_0x16b69a[_0xad3f('0x6')]),_0x448410);}};exports[_0xad3f('0x1a')]=function(_0x596319){try{if(!_[_0xad3f('0x15')](dials[_0x596319[_0xad3f('0x6')]])){utils['debug'](util[_0xad3f('0x4')]('[%s][dials][dialbegin]',_0x596319[_0xad3f('0x6')]),_0x596319);dials[_0x596319[_0xad3f('0x6')]]=_[_0xad3f('0x1b')](dials[_0x596319[_0xad3f('0x6')]],_0x596319);dials[_0x596319[_0xad3f('0x6')]][_0xad3f('0x1c')]=utils['now']();dials[_0x596319[_0xad3f('0x6')]]['lastevent']=_0xad3f('0x1d');utils[_0xad3f('0x3')](util[_0xad3f('0x4')](_0xad3f('0x1e'),_0x596319[_0xad3f('0x6')],dials[_0x596319[_0xad3f('0x6')]][_0xad3f('0x1c')]));}}catch(_0x18d23b){utils['error'](util[_0xad3f('0x4')](_0xad3f('0x1f'),_0x596319[_0xad3f('0x6')]),_0x18d23b);}};exports[_0xad3f('0x20')]=function(_0x3c5464){try{if(!_[_0xad3f('0x15')](dials[_0x3c5464[_0xad3f('0x6')]])){utils[_0xad3f('0xb')](util[_0xad3f('0x4')]('[%s][dials][dialend]',_0x3c5464[_0xad3f('0x6')]),_0x3c5464);dials[_0x3c5464[_0xad3f('0x6')]][_0xad3f('0x21')]=_0x3c5464[_0xad3f('0x21')];if(_0x3c5464[_0xad3f('0x21')]==_0xad3f('0x22')){dials[_0x3c5464[_0xad3f('0x6')]]=_[_0xad3f('0x1b')](dials[_0x3c5464['uniqueid']],_0x3c5464);dials[_0x3c5464['uniqueid']]['answertime']=utils['now']();dials[_0x3c5464[_0xad3f('0x6')]][_0xad3f('0x23')]=_0xad3f('0x24');utils['info'](util[_0xad3f('0x4')](_0xad3f('0x25'),_0x3c5464[_0xad3f('0x6')],_0x3c5464[_0xad3f('0x21')],dials[_0x3c5464['uniqueid']][_0xad3f('0x26')]));}else{utils['info'](util['format']('[%s][dials][dialend]\x20dialstatus:%s',_0x3c5464[_0xad3f('0x6')],_0x3c5464['dialstatus']));}}}catch(_0x3388af){utils[_0xad3f('0x13')](util[_0xad3f('0x4')](_0xad3f('0x27'),_0x3c5464[_0xad3f('0x6')]),_0x3388af);}};exports[_0xad3f('0x28')]=function(_0x807576){try{if(!_['isNil'](dials[_0x807576[_0xad3f('0x6')]])){utils[_0xad3f('0xb')](util['format'](_0xad3f('0x29'),_0x807576['uniqueid']),_0x807576);utils[_0xad3f('0x3')](util['format'](_0xad3f('0x2a'),_0x807576['uniqueid'],_0x807576['calleridnum'],_0x807576[_0xad3f('0x2b')],_0x807576[_0xad3f('0x2c')]));dials[_0x807576[_0xad3f('0x6')]]=_[_0xad3f('0x1b')](dials[_0x807576[_0xad3f('0x6')]],{'endtime':utils['now'](),'lastevent':_0xad3f('0x2d')});dials[_0x807576['uniqueid']][_0xad3f('0x2e')]=utils[_0xad3f('0x2f')](dials[_0x807576[_0xad3f('0x6')]]['endtime'],dials[_0x807576[_0xad3f('0x6')]][_0xad3f('0x1c')]);dials[_0x807576['uniqueid']][_0xad3f('0x30')]=utils[_0xad3f('0x2f')](dials[_0x807576['uniqueid']][_0xad3f('0x26')]||dials[_0x807576[_0xad3f('0x6')]][_0xad3f('0x31')],dials[_0x807576[_0xad3f('0x6')]]['starttime']);dials[_0x807576[_0xad3f('0x6')]][_0xad3f('0x32')]=dials[_0x807576['uniqueid']]['answertime']?utils['diffTime'](dials[_0x807576[_0xad3f('0x6')]][_0xad3f('0x31')],dials[_0x807576['uniqueid']]['answertime']):0x0;writeDB(dials[_0x807576[_0xad3f('0x6')]]);}}catch(_0x9ac5e6){utils[_0xad3f('0x13')](util[_0xad3f('0x4')](_0xad3f('0x29'),_0x807576[_0xad3f('0x6')]),_0x9ac5e6);}}; \ No newline at end of file +var _0xc926=['[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','debug','[%s][dials][varset]','isNil','variable','value','dialbegin','[%s][dials][dialbegin]','now','called','starttime','dialend','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','hangup','[%s][dials][hangup]','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format'];(function(_0x46e76c,_0x8e786a){var _0x3f58c7=function(_0x501ee9){while(--_0x501ee9){_0x46e76c['push'](_0x46e76c['shift']());}};_0x3f58c7(++_0x8e786a);}(_0xc926,0x65));var _0x6c92=function(_0x29f191,_0x3f0e73){_0x29f191=_0x29f191-0x0;var _0x581ad0=_0xc926[_0x29f191];return _0x581ad0;};'use strict';var _=require(_0x6c92('0x0'));var util=require(_0x6c92('0x1'));var utils=require(_0x6c92('0x2'));var dials={};function writeDB(_0x5543e5){utils[_0x6c92('0x3')](util[_0x6c92('0x4')](_0x6c92('0x5'),_0x5543e5['uniqueid'],_0x5543e5[_0x6c92('0x6')],_0x5543e5[_0x6c92('0x7')],_0x5543e5[_0x6c92('0x8')],_0x5543e5[_0x6c92('0x9')],_0x5543e5[_0x6c92('0xa')]));utils[_0x6c92('0xb')](_0x6c92('0xc'),_0x5543e5);delete dials[_0x5543e5[_0x6c92('0xd')]];}exports[_0x6c92('0xe')]=function(_0x98f8f7){try{utils['debug'](util[_0x6c92('0x4')](_0x6c92('0xf'),_0x98f8f7['uniqueid']),_0x98f8f7);utils[_0x6c92('0x3')](util[_0x6c92('0x4')](_0x6c92('0x10'),_0x98f8f7['uniqueid'],_0x98f8f7[_0x6c92('0x11')],_0x98f8f7[_0x6c92('0x12')]));if(_0x98f8f7[_0x6c92('0x11')][_0x6c92('0x13')]()==_0x6c92('0x14')&&_[_0x6c92('0x15')](_0x98f8f7['appdata'][_0x6c92('0x13')](),_0x6c92('0x16'))){var _0x340ed1=_0x98f8f7[_0x6c92('0x12')][_0x6c92('0x17')]('=');dials[_0x98f8f7[_0x6c92('0xd')]]={'routeId':_0x340ed1[0x1]};}}catch(_0x12fa31){utils[_0x6c92('0x18')](util[_0x6c92('0x4')](_0x6c92('0xf'),_0x98f8f7[_0x6c92('0xd')]),_0x12fa31);}};exports[_0x6c92('0x19')]=function(_0x42836c){try{utils[_0x6c92('0x1a')](util[_0x6c92('0x4')](_0x6c92('0x1b'),_0x42836c['uniqueid']),_0x42836c);if(!_[_0x6c92('0x1c')](_0x42836c[_0x6c92('0x1d')]['outboundrouteid'])){utils[_0x6c92('0x3')](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x42836c['uniqueid'],_0x42836c['value']));dials[_0x42836c[_0x6c92('0xd')]]={'routeId':_0x42836c[_0x6c92('0x1e')]};}}catch(_0x189329){utils[_0x6c92('0x18')](util['format'](_0x6c92('0x1b'),_0x42836c[_0x6c92('0xd')]),_0x189329);}};exports[_0x6c92('0x1f')]=function(_0x50f105){try{if(!_[_0x6c92('0x1c')](dials[_0x50f105[_0x6c92('0xd')]])){utils[_0x6c92('0x1a')](util[_0x6c92('0x4')](_0x6c92('0x20'),_0x50f105[_0x6c92('0xd')]),_0x50f105);dials[_0x50f105[_0x6c92('0xd')]]=_['assign'](dials[_0x50f105['uniqueid']],_0x50f105);dials[_0x50f105[_0x6c92('0xd')]]['starttime']=utils[_0x6c92('0x21')]();dials[_0x50f105[_0x6c92('0xd')]]['lastevent']=_0x6c92('0x22');utils['info'](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x50f105[_0x6c92('0xd')],dials[_0x50f105[_0x6c92('0xd')]][_0x6c92('0x23')]));}}catch(_0x52ffd9){utils['error'](util[_0x6c92('0x4')](_0x6c92('0x20'),_0x50f105[_0x6c92('0xd')]),_0x52ffd9);}};exports[_0x6c92('0x24')]=function(_0x5e45e0){try{if(!_[_0x6c92('0x1c')](dials[_0x5e45e0[_0x6c92('0xd')]])){utils[_0x6c92('0x1a')](util[_0x6c92('0x4')]('[%s][dials][dialend]',_0x5e45e0[_0x6c92('0xd')]),_0x5e45e0);dials[_0x5e45e0[_0x6c92('0xd')]][_0x6c92('0xa')]=_0x5e45e0['dialstatus'];if(_0x5e45e0[_0x6c92('0xa')]=='ANSWER'){dials[_0x5e45e0['uniqueid']]=_[_0x6c92('0x25')](dials[_0x5e45e0[_0x6c92('0xd')]],_0x5e45e0);dials[_0x5e45e0[_0x6c92('0xd')]][_0x6c92('0x26')]=utils['now']();dials[_0x5e45e0[_0x6c92('0xd')]]['lastevent']=_0x6c92('0x27');utils[_0x6c92('0x3')](util[_0x6c92('0x4')](_0x6c92('0x28'),_0x5e45e0[_0x6c92('0xd')],_0x5e45e0[_0x6c92('0xa')],dials[_0x5e45e0[_0x6c92('0xd')]][_0x6c92('0x26')]));}else{utils[_0x6c92('0x3')](util[_0x6c92('0x4')](_0x6c92('0x29'),_0x5e45e0[_0x6c92('0xd')],_0x5e45e0[_0x6c92('0xa')]));}}}catch(_0x315848){utils[_0x6c92('0x18')](util[_0x6c92('0x4')](_0x6c92('0x2a'),_0x5e45e0[_0x6c92('0xd')]),_0x315848);}};exports[_0x6c92('0x2b')]=function(_0x52e52a){try{if(!_['isNil'](dials[_0x52e52a[_0x6c92('0xd')]])){utils[_0x6c92('0x1a')](util['format'](_0x6c92('0x2c'),_0x52e52a[_0x6c92('0xd')]),_0x52e52a);utils[_0x6c92('0x3')](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x52e52a[_0x6c92('0xd')],_0x52e52a[_0x6c92('0x8')],_0x52e52a[_0x6c92('0x2d')],_0x52e52a[_0x6c92('0x2e')]));dials[_0x52e52a[_0x6c92('0xd')]]=_['assign'](dials[_0x52e52a[_0x6c92('0xd')]],{'endtime':utils[_0x6c92('0x21')](),'lastevent':_0x6c92('0x2f')});dials[_0x52e52a[_0x6c92('0xd')]][_0x6c92('0x30')]=utils[_0x6c92('0x31')](dials[_0x52e52a['uniqueid']][_0x6c92('0x32')],dials[_0x52e52a['uniqueid']][_0x6c92('0x23')]);dials[_0x52e52a['uniqueid']][_0x6c92('0x33')]=utils['diffTime'](dials[_0x52e52a['uniqueid']][_0x6c92('0x26')]||dials[_0x52e52a[_0x6c92('0xd')]][_0x6c92('0x32')],dials[_0x52e52a[_0x6c92('0xd')]][_0x6c92('0x23')]);dials[_0x52e52a[_0x6c92('0xd')]][_0x6c92('0x34')]=dials[_0x52e52a['uniqueid']][_0x6c92('0x26')]?utils[_0x6c92('0x31')](dials[_0x52e52a[_0x6c92('0xd')]][_0x6c92('0x32')],dials[_0x52e52a['uniqueid']][_0x6c92('0x26')]):0x0;writeDB(dials[_0x52e52a['uniqueid']]);}}catch(_0x2c7d87){utils['error'](util['format']('[%s][dials][hangup]',_0x52e52a[_0x6c92('0xd')]),_0x2c7d87);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 8f480d1..a45462f 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 _0x9ddb=['error','close','managerevent','format','device','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','debug','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','util','xdr','disabled','env','production','asterisk','password','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted'];(function(_0x43d06c,_0x3b92ff){var _0x21c9dc=function(_0x171551){while(--_0x171551){_0x43d06c['push'](_0x43d06c['shift']());}};_0x21c9dc(++_0x3b92ff);}(_0x9ddb,0x6b));var _0xb9dd=function(_0x3fd174,_0x53926c){_0x3fd174=_0x3fd174-0x0;var _0x9d2bf2=_0x9ddb[_0x3fd174];return _0x9d2bf2;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require('./utils');var util=require(_0xb9dd('0x0'));var isXDREnabled=config[_0xb9dd('0x1')]&&config[_0xb9dd('0x1')][_0xb9dd('0x2')]?!config['xdr'][_0xb9dd('0x2')]:!![];var isProduction=config[_0xb9dd('0x3')]===_0xb9dd('0x4')||![];var isLocalAsterisk=config[_0xb9dd('0x1')]&&config[_0xb9dd('0x1')]['local']===!![]||![];var ami=new AsteriskManager(config[_0xb9dd('0x5')]['port'],config[_0xb9dd('0x5')]['ip'],config[_0xb9dd('0x5')]['username'],config[_0xb9dd('0x5')][_0xb9dd('0x6')],!![]);ami[_0xb9dd('0x7')]();if(!isXDREnabled){utils['info'](_0xb9dd('0x8'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xb9dd('0x9')](_0xb9dd('0xa'));}else{var agents=require(_0xb9dd('0xb'));var calls=require('./calls.controller');var queues=require(_0xb9dd('0xc'));var recordings=require('./recordings.controller');var members=require(_0xb9dd('0xd'));var dials=require(_0xb9dd('0xe'));var transfers=require('./transfers.controller');var core=require(_0xb9dd('0xf'));ami['on'](_0xb9dd('0x10'),core['connect']);ami['on'](_0xb9dd('0x11'),core['shutdown']);ami['on'](_0xb9dd('0x12'),core['fullybooted']);ami['on'](_0xb9dd('0x13'),core['error']);ami['on'](_0xb9dd('0x14'),core[_0xb9dd('0x14')]);ami['on'](_0xb9dd('0x15'),core[_0xb9dd('0x15')]);ami['on']('devicestatechange',function(_0x36f678){try{utils['debug'](util[_0xb9dd('0x16')]('[%s][index][devicestatechange]',_0x36f678[_0xb9dd('0x17')]),_0x36f678);members['devicestatechange'](_0x36f678);}catch(_0x1849d9){utils['error'](util['format']('[%s][index][devicestatechange]',_0x36f678[_0xb9dd('0x17')]),_0x1849d9);}});ami['on']('agentcalled',function(_0x21ed73){try{utils['debug'](util[_0xb9dd('0x16')](_0xb9dd('0x18'),_0x21ed73[_0xb9dd('0x19')]),_0x21ed73);agents[_0xb9dd('0x1a')](_0x21ed73);}catch(_0x10c504){utils[_0xb9dd('0x13')](util[_0xb9dd('0x16')](_0xb9dd('0x18'),_0x21ed73[_0xb9dd('0x19')]),_0x10c504);}});ami['on'](_0xb9dd('0x1b'),function(_0x1ba060){try{utils['debug'](util[_0xb9dd('0x16')](_0xb9dd('0x1c'),_0x1ba060[_0xb9dd('0x19')]),_0x1ba060);agents[_0xb9dd('0x1b')](_0x1ba060);}catch(_0x5ce17a){utils[_0xb9dd('0x13')](util[_0xb9dd('0x16')](_0xb9dd('0x1c'),_0x1ba060[_0xb9dd('0x19')]),_0x5ce17a);}});ami['on'](_0xb9dd('0x1d'),function(_0x58bca4){try{utils[_0xb9dd('0x1e')](util[_0xb9dd('0x16')]('[%s][index][agentconnect]',_0x58bca4['uniqueid']),_0x58bca4);agents[_0xb9dd('0x1d')](_0x58bca4);queues['agentconnect'](_0x58bca4);}catch(_0x50d87f){utils[_0xb9dd('0x13')](util[_0xb9dd('0x16')](_0xb9dd('0x1f'),_0x58bca4[_0xb9dd('0x19')]),_0x50d87f);}});ami['on'](_0xb9dd('0x20'),function(_0x11b8db){try{utils['debug'](util['format'](_0xb9dd('0x21'),_0x11b8db['uniqueid']),_0x11b8db);agents['agentcomplete'](_0x11b8db);queues[_0xb9dd('0x20')](_0x11b8db);members[_0xb9dd('0x20')](_0x11b8db);}catch(_0x4ef9dc){utils[_0xb9dd('0x13')](util[_0xb9dd('0x16')](_0xb9dd('0x21'),_0x11b8db[_0xb9dd('0x19')]),_0x4ef9dc);}});ami['on']('queuecallerabandon',function(_0x42ee0e){try{utils[_0xb9dd('0x1e')](util[_0xb9dd('0x16')](_0xb9dd('0x22'),_0x42ee0e['uniqueid']),_0x42ee0e);agents['queuecallerabandon'](_0x42ee0e);queues[_0xb9dd('0x23')](_0x42ee0e);}catch(_0x37c005){utils[_0xb9dd('0x13')](util[_0xb9dd('0x16')](_0xb9dd('0x22'),_0x42ee0e[_0xb9dd('0x19')]),_0x37c005);}});ami['on']('queuecallerjoin',function(_0x4420d8){try{utils[_0xb9dd('0x1e')](util[_0xb9dd('0x16')](_0xb9dd('0x24'),_0x4420d8[_0xb9dd('0x19')]),_0x4420d8);queues[_0xb9dd('0x25')](_0x4420d8);recordings[_0xb9dd('0x25')](_0x4420d8);}catch(_0xb5106f){utils[_0xb9dd('0x13')](util[_0xb9dd('0x16')](_0xb9dd('0x24'),_0x4420d8[_0xb9dd('0x19')]),_0xb5106f);}});ami['on'](_0xb9dd('0x26'),function(_0x5340b2){try{utils[_0xb9dd('0x1e')](util[_0xb9dd('0x16')](_0xb9dd('0x27'),_0x5340b2[_0xb9dd('0x19')]),_0x5340b2);queues['queuecallerleave'](_0x5340b2);}catch(_0x18ca45){utils['error'](util['format'](_0xb9dd('0x27'),_0x5340b2[_0xb9dd('0x19')]),_0x18ca45);}});ami['on'](_0xb9dd('0x28'),function(_0x2ea30a){try{utils['debug'](util[_0xb9dd('0x16')]('[%s][index][musiconholdstart]',_0x2ea30a['uniqueid']),_0x2ea30a);queues[_0xb9dd('0x28')](_0x2ea30a);calls[_0xb9dd('0x28')](_0x2ea30a);}catch(_0x5d56c6){utils[_0xb9dd('0x13')](util[_0xb9dd('0x16')](_0xb9dd('0x29'),_0x2ea30a['uniqueid']),_0x5d56c6);}});ami['on'](_0xb9dd('0x2a'),function(_0x3f60f8){try{utils[_0xb9dd('0x1e')](util[_0xb9dd('0x16')](_0xb9dd('0x2b'),_0x3f60f8['uniqueid']),_0x3f60f8);queues[_0xb9dd('0x2a')](_0x3f60f8);calls[_0xb9dd('0x2a')](_0x3f60f8);}catch(_0x51b96e){utils[_0xb9dd('0x13')](util[_0xb9dd('0x16')]('[%s][index][musiconholdstop]',_0x3f60f8[_0xb9dd('0x19')]),_0x51b96e);}});ami['on'](_0xb9dd('0x2c'),function(_0x59b98c){try{utils[_0xb9dd('0x1e')](util[_0xb9dd('0x16')]('[%s][index][newstate]',_0x59b98c['uniqueid']),_0x59b98c);calls['newstate'](_0x59b98c);recordings['newstate'](_0x59b98c);}catch(_0x176592){utils['error'](util['format']('[%s][index][newstate]',_0x59b98c[_0xb9dd('0x19')]),_0x176592);}});ami['on'](_0xb9dd('0x2d'),function(_0x283105){try{utils[_0xb9dd('0x1e')](util['format'](_0xb9dd('0x2e'),_0x283105[_0xb9dd('0x19')]),_0x283105);calls['hangup'](_0x283105);recordings['hangup'](_0x283105);dials[_0xb9dd('0x2d')](_0x283105);agents[_0xb9dd('0x2d')](_0x283105);queues[_0xb9dd('0x2d')](_0x283105);}catch(_0x387d90){utils[_0xb9dd('0x13')](util[_0xb9dd('0x16')]('[%s][index][hangup]',_0x283105[_0xb9dd('0x19')]),_0x387d90);}});ami['on']('cdr',function(_0x41394f){try{utils[_0xb9dd('0x1e')](util[_0xb9dd('0x16')](_0xb9dd('0x2f'),_0x41394f[_0xb9dd('0x19')]),_0x41394f);members[_0xb9dd('0x30')](_0x41394f);}catch(_0x6472fd){utils[_0xb9dd('0x13')](util[_0xb9dd('0x16')](_0xb9dd('0x2f'),_0x41394f[_0xb9dd('0x19')]),_0x6472fd);}});ami['on'](_0xb9dd('0x31'),function(_0x5f4cba){try{utils[_0xb9dd('0x1e')](util['format'](_0xb9dd('0x32'),_0x5f4cba[_0xb9dd('0x19')]),_0x5f4cba);queues[_0xb9dd('0x31')](_0x5f4cba);agents[_0xb9dd('0x31')](_0x5f4cba);transfers['blindtransfer'](_0x5f4cba);}catch(_0x14319b){utils[_0xb9dd('0x13')](util[_0xb9dd('0x16')](_0xb9dd('0x32'),_0x5f4cba['uniqueid']),_0x14319b);}});ami['on'](_0xb9dd('0x33'),function(_0x2b9424){try{utils[_0xb9dd('0x1e')](util[_0xb9dd('0x16')](_0xb9dd('0x34'),_0x2b9424[_0xb9dd('0x35')]),_0x2b9424);queues['attendedtransfer'](_0x2b9424);transfers[_0xb9dd('0x33')](_0x2b9424);agents[_0xb9dd('0x33')](_0x2b9424);calls[_0xb9dd('0x33')](_0x2b9424);}catch(_0x22497f){utils[_0xb9dd('0x13')](util[_0xb9dd('0x16')]('[%s][index][attendedtransfer]',_0x2b9424['origtransfereruniqueid']),_0x22497f);}});ami['on']('varset',function(_0x11c194){try{utils[_0xb9dd('0x1e')](util[_0xb9dd('0x16')]('[%s][index][varset]',_0x11c194[_0xb9dd('0x19')]),_0x11c194);queues[_0xb9dd('0x36')](_0x11c194);recordings[_0xb9dd('0x36')](_0x11c194);calls[_0xb9dd('0x36')](_0x11c194);dials['varset'](_0x11c194);}catch(_0x159a86){utils[_0xb9dd('0x13')](util[_0xb9dd('0x16')]('[%s][index][varset]',_0x11c194[_0xb9dd('0x19')]),_0x159a86);}});ami['on']('newexten',function(_0x578ccf){try{utils[_0xb9dd('0x1e')](util[_0xb9dd('0x16')]('[%s][index][newexten]',_0x578ccf['uniqueid']),_0x578ccf);calls[_0xb9dd('0x37')](_0x578ccf);recordings[_0xb9dd('0x37')](_0x578ccf);dials['newexten'](_0x578ccf);}catch(_0x38300c){utils['error'](util[_0xb9dd('0x16')]('[%s][index][newexten]',_0x578ccf[_0xb9dd('0x19')]),_0x38300c);}});ami['on'](_0xb9dd('0x38'),function(_0x1974b8){try{utils[_0xb9dd('0x1e')](util[_0xb9dd('0x16')](_0xb9dd('0x39'),_0x1974b8['uniqueid']),_0x1974b8);calls[_0xb9dd('0x38')](_0x1974b8);recordings[_0xb9dd('0x38')](_0x1974b8);}catch(_0x463707){utils['error'](util[_0xb9dd('0x16')](_0xb9dd('0x39'),_0x1974b8[_0xb9dd('0x19')]),_0x463707);}});ami['on'](_0xb9dd('0x3a'),function(_0x2644c2){try{utils['debug'](util[_0xb9dd('0x16')](_0xb9dd('0x3b'),_0x2644c2['uniqueid']),_0x2644c2);dials['dialbegin'](_0x2644c2);}catch(_0x304214){utils[_0xb9dd('0x13')](util[_0xb9dd('0x16')](_0xb9dd('0x3c'),_0x2644c2[_0xb9dd('0x19')]),_0x304214);}});ami['on'](_0xb9dd('0x3d'),function(_0x3148cc){try{utils[_0xb9dd('0x1e')](util['format'](_0xb9dd('0x3e'),_0x3148cc['uniqueid']),_0x3148cc);dials[_0xb9dd('0x3d')](_0x3148cc);}catch(_0x1b9a1b){utils[_0xb9dd('0x13')](util[_0xb9dd('0x16')](_0xb9dd('0x3e'),_0x3148cc['uniqueid']),_0x1b9a1b);}});} \ No newline at end of file +var _0x6f0f=['queuecallerabandon','[%s][index][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]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','local','port','asterisk','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.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','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]'];(function(_0x3ea23a,_0x506a32){var _0x5823f=function(_0x2ae7c0){while(--_0x2ae7c0){_0x3ea23a['push'](_0x3ea23a['shift']());}};_0x5823f(++_0x506a32);}(_0x6f0f,0x65));var _0xf6f0=function(_0x45a91c,_0x56541f){_0x45a91c=_0x45a91c-0x0;var _0x587932=_0x6f0f[_0x45a91c];return _0x587932;};var AsteriskManager=require(_0xf6f0('0x0'));var config=require(_0xf6f0('0x1'));var utils=require(_0xf6f0('0x2'));var util=require(_0xf6f0('0x3'));var isXDREnabled=config[_0xf6f0('0x4')]&&config[_0xf6f0('0x4')][_0xf6f0('0x5')]?!config[_0xf6f0('0x4')][_0xf6f0('0x5')]:!![];var isProduction=config['env']==='production'||![];var isLocalAsterisk=config[_0xf6f0('0x4')]&&config[_0xf6f0('0x4')][_0xf6f0('0x6')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0xf6f0('0x7')],config[_0xf6f0('0x8')]['ip'],config[_0xf6f0('0x8')][_0xf6f0('0x9')],config['asterisk'][_0xf6f0('0xa')],!![]);ami[_0xf6f0('0xb')]();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0xf6f0('0xc')](_0xf6f0('0xd'));}else{var agents=require(_0xf6f0('0xe'));var calls=require(_0xf6f0('0xf'));var queues=require(_0xf6f0('0x10'));var recordings=require('./recordings.controller');var members=require(_0xf6f0('0x11'));var dials=require(_0xf6f0('0x12'));var transfers=require(_0xf6f0('0x13'));var core=require(_0xf6f0('0x14'));ami['on']('connect',core[_0xf6f0('0x15')]);ami['on'](_0xf6f0('0x16'),core[_0xf6f0('0x16')]);ami['on']('fullybooted',core[_0xf6f0('0x17')]);ami['on'](_0xf6f0('0x18'),core[_0xf6f0('0x18')]);ami['on'](_0xf6f0('0x19'),core[_0xf6f0('0x19')]);ami['on']('managerevent',core[_0xf6f0('0x1a')]);ami['on'](_0xf6f0('0x1b'),function(_0x10e20a){try{utils[_0xf6f0('0x1c')](util[_0xf6f0('0x1d')]('[%s][index][devicestatechange]',_0x10e20a['device']),_0x10e20a);members[_0xf6f0('0x1b')](_0x10e20a);}catch(_0x3b5ee6){utils[_0xf6f0('0x18')](util[_0xf6f0('0x1d')](_0xf6f0('0x1e'),_0x10e20a[_0xf6f0('0x1f')]),_0x3b5ee6);}});ami['on'](_0xf6f0('0x20'),function(_0x16b01a){try{utils[_0xf6f0('0x1c')](util[_0xf6f0('0x1d')](_0xf6f0('0x21'),_0x16b01a[_0xf6f0('0x22')]),_0x16b01a);agents['agentcalled'](_0x16b01a);}catch(_0x3a87d6){utils['error'](util[_0xf6f0('0x1d')](_0xf6f0('0x21'),_0x16b01a['uniqueid']),_0x3a87d6);}});ami['on'](_0xf6f0('0x23'),function(_0x5ca461){try{utils[_0xf6f0('0x1c')](util[_0xf6f0('0x1d')](_0xf6f0('0x24'),_0x5ca461['uniqueid']),_0x5ca461);agents[_0xf6f0('0x23')](_0x5ca461);}catch(_0xfc7739){utils[_0xf6f0('0x18')](util[_0xf6f0('0x1d')]('[%s][index][agentringnoanswer]',_0x5ca461['uniqueid']),_0xfc7739);}});ami['on'](_0xf6f0('0x25'),function(_0x5cbc42){try{utils[_0xf6f0('0x1c')](util['format'](_0xf6f0('0x26'),_0x5cbc42[_0xf6f0('0x22')]),_0x5cbc42);agents[_0xf6f0('0x25')](_0x5cbc42);queues[_0xf6f0('0x25')](_0x5cbc42);}catch(_0x4e2717){utils[_0xf6f0('0x18')](util[_0xf6f0('0x1d')](_0xf6f0('0x26'),_0x5cbc42[_0xf6f0('0x22')]),_0x4e2717);}});ami['on'](_0xf6f0('0x27'),function(_0x957bab){try{utils[_0xf6f0('0x1c')](util[_0xf6f0('0x1d')]('[%s][index][agentcomplete]',_0x957bab[_0xf6f0('0x22')]),_0x957bab);agents[_0xf6f0('0x27')](_0x957bab);queues[_0xf6f0('0x27')](_0x957bab);members['agentcomplete'](_0x957bab);}catch(_0x1ad7e3){utils[_0xf6f0('0x18')](util[_0xf6f0('0x1d')](_0xf6f0('0x28'),_0x957bab[_0xf6f0('0x22')]),_0x1ad7e3);}});ami['on'](_0xf6f0('0x29'),function(_0x170949){try{utils[_0xf6f0('0x1c')](util[_0xf6f0('0x1d')](_0xf6f0('0x2a'),_0x170949[_0xf6f0('0x22')]),_0x170949);agents[_0xf6f0('0x29')](_0x170949);queues[_0xf6f0('0x29')](_0x170949);}catch(_0x2cdd5b){utils[_0xf6f0('0x18')](util['format']('[%s][index][queuecallerabandon]',_0x170949[_0xf6f0('0x22')]),_0x2cdd5b);}});ami['on'](_0xf6f0('0x2b'),function(_0xf26734){try{utils[_0xf6f0('0x1c')](util['format'](_0xf6f0('0x2c'),_0xf26734[_0xf6f0('0x22')]),_0xf26734);queues[_0xf6f0('0x2b')](_0xf26734);recordings[_0xf6f0('0x2b')](_0xf26734);}catch(_0x2054c9){utils[_0xf6f0('0x18')](util['format'](_0xf6f0('0x2c'),_0xf26734['uniqueid']),_0x2054c9);}});ami['on'](_0xf6f0('0x2d'),function(_0x1770ca){try{utils[_0xf6f0('0x1c')](util[_0xf6f0('0x1d')](_0xf6f0('0x2e'),_0x1770ca[_0xf6f0('0x22')]),_0x1770ca);queues[_0xf6f0('0x2d')](_0x1770ca);}catch(_0x47f024){utils[_0xf6f0('0x18')](util[_0xf6f0('0x1d')](_0xf6f0('0x2e'),_0x1770ca[_0xf6f0('0x22')]),_0x47f024);}});ami['on'](_0xf6f0('0x2f'),function(_0x1753e4){try{utils[_0xf6f0('0x1c')](util[_0xf6f0('0x1d')](_0xf6f0('0x30'),_0x1753e4['uniqueid']),_0x1753e4);queues[_0xf6f0('0x2f')](_0x1753e4);calls['musiconholdstart'](_0x1753e4);}catch(_0x2f0f11){utils['error'](util['format'](_0xf6f0('0x30'),_0x1753e4[_0xf6f0('0x22')]),_0x2f0f11);}});ami['on'](_0xf6f0('0x31'),function(_0x3ac0dc){try{utils[_0xf6f0('0x1c')](util[_0xf6f0('0x1d')](_0xf6f0('0x32'),_0x3ac0dc[_0xf6f0('0x22')]),_0x3ac0dc);queues[_0xf6f0('0x31')](_0x3ac0dc);calls[_0xf6f0('0x31')](_0x3ac0dc);}catch(_0x56928c){utils[_0xf6f0('0x18')](util[_0xf6f0('0x1d')](_0xf6f0('0x32'),_0x3ac0dc[_0xf6f0('0x22')]),_0x56928c);}});ami['on'](_0xf6f0('0x33'),function(_0x210341){try{utils[_0xf6f0('0x1c')](util['format']('[%s][index][newstate]',_0x210341[_0xf6f0('0x22')]),_0x210341);calls[_0xf6f0('0x33')](_0x210341);recordings['newstate'](_0x210341);}catch(_0x2e4575){utils['error'](util[_0xf6f0('0x1d')](_0xf6f0('0x34'),_0x210341[_0xf6f0('0x22')]),_0x2e4575);}});ami['on'](_0xf6f0('0x35'),function(_0x37a270){try{utils[_0xf6f0('0x1c')](util['format'](_0xf6f0('0x36'),_0x37a270[_0xf6f0('0x22')]),_0x37a270);calls[_0xf6f0('0x35')](_0x37a270);recordings['hangup'](_0x37a270);dials[_0xf6f0('0x35')](_0x37a270);agents[_0xf6f0('0x35')](_0x37a270);queues[_0xf6f0('0x35')](_0x37a270);}catch(_0x395e3b){utils[_0xf6f0('0x18')](util[_0xf6f0('0x1d')]('[%s][index][hangup]',_0x37a270['uniqueid']),_0x395e3b);}});ami['on'](_0xf6f0('0x37'),function(_0x34d181){try{utils['debug'](util[_0xf6f0('0x1d')](_0xf6f0('0x38'),_0x34d181[_0xf6f0('0x22')]),_0x34d181);members['cdr'](_0x34d181);}catch(_0x59477a){utils['error'](util['format'](_0xf6f0('0x38'),_0x34d181['uniqueid']),_0x59477a);}});ami['on']('blindtransfer',function(_0x18e550){try{utils[_0xf6f0('0x1c')](util[_0xf6f0('0x1d')](_0xf6f0('0x39'),_0x18e550['uniqueid']),_0x18e550);queues[_0xf6f0('0x3a')](_0x18e550);agents['blindtransfer'](_0x18e550);transfers[_0xf6f0('0x3a')](_0x18e550);}catch(_0x2c6c1d){utils['error'](util[_0xf6f0('0x1d')](_0xf6f0('0x39'),_0x18e550[_0xf6f0('0x22')]),_0x2c6c1d);}});ami['on'](_0xf6f0('0x3b'),function(_0x54b436){try{utils['debug'](util[_0xf6f0('0x1d')](_0xf6f0('0x3c'),_0x54b436[_0xf6f0('0x3d')]),_0x54b436);queues[_0xf6f0('0x3b')](_0x54b436);transfers['attendedtransfer'](_0x54b436);agents[_0xf6f0('0x3b')](_0x54b436);calls[_0xf6f0('0x3b')](_0x54b436);}catch(_0x38950b){utils[_0xf6f0('0x18')](util[_0xf6f0('0x1d')](_0xf6f0('0x3c'),_0x54b436[_0xf6f0('0x3d')]),_0x38950b);}});ami['on'](_0xf6f0('0x3e'),function(_0x280eb9){try{utils['debug'](util[_0xf6f0('0x1d')]('[%s][index][varset]',_0x280eb9[_0xf6f0('0x22')]),_0x280eb9);queues[_0xf6f0('0x3e')](_0x280eb9);recordings['varset'](_0x280eb9);calls[_0xf6f0('0x3e')](_0x280eb9);dials[_0xf6f0('0x3e')](_0x280eb9);}catch(_0x55b588){utils[_0xf6f0('0x18')](util[_0xf6f0('0x1d')](_0xf6f0('0x3f'),_0x280eb9[_0xf6f0('0x22')]),_0x55b588);}});ami['on'](_0xf6f0('0x40'),function(_0x506c6f){try{utils['debug'](util[_0xf6f0('0x1d')](_0xf6f0('0x41'),_0x506c6f[_0xf6f0('0x22')]),_0x506c6f);calls[_0xf6f0('0x40')](_0x506c6f);recordings[_0xf6f0('0x40')](_0x506c6f);dials[_0xf6f0('0x40')](_0x506c6f);}catch(_0x408431){utils[_0xf6f0('0x18')](util[_0xf6f0('0x1d')](_0xf6f0('0x41'),_0x506c6f[_0xf6f0('0x22')]),_0x408431);}});ami['on'](_0xf6f0('0x42'),function(_0x56c9ec){try{utils[_0xf6f0('0x1c')](util[_0xf6f0('0x1d')]('[%s][index][newchannel]',_0x56c9ec['uniqueid']),_0x56c9ec);calls[_0xf6f0('0x42')](_0x56c9ec);recordings['newchannel'](_0x56c9ec);}catch(_0x4d88ac){utils['error'](util[_0xf6f0('0x1d')]('[%s][index][newchannel]',_0x56c9ec[_0xf6f0('0x22')]),_0x4d88ac);}});ami['on'](_0xf6f0('0x43'),function(_0x2fb10c){try{utils['debug'](util[_0xf6f0('0x1d')]('[%s][index][dialbegin]',_0x2fb10c[_0xf6f0('0x22')]),_0x2fb10c);dials['dialbegin'](_0x2fb10c);}catch(_0x48adc4){utils['error'](util[_0xf6f0('0x1d')](_0xf6f0('0x44'),_0x2fb10c['uniqueid']),_0x48adc4);}});ami['on'](_0xf6f0('0x45'),function(_0x5c624f){try{utils[_0xf6f0('0x1c')](util[_0xf6f0('0x1d')](_0xf6f0('0x46'),_0x5c624f[_0xf6f0('0x22')]),_0x5c624f);dials[_0xf6f0('0x45')](_0x5c624f);}catch(_0x1d26b2){utils[_0xf6f0('0x18')](util[_0xf6f0('0x1d')](_0xf6f0('0x46'),_0x5c624f['uniqueid']),_0x1d26b2);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 543b9f1..1477a9c 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 _0xbb53=['split','CreateMemberReport','catch','error','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','duration','exitAt','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','cdr','channel','data1','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','data2','membername','type','interface','getUserByInterface','name','internal','request'];(function(_0x7b0b53,_0x4d6b7c){var _0x2bd38f=function(_0x381b39){while(--_0x381b39){_0x7b0b53['push'](_0x7b0b53['shift']());}};_0x2bd38f(++_0x4d6b7c);}(_0xbb53,0x121));var _0x3bb5=function(_0x401531,_0x582a70){_0x401531=_0x401531-0x0;var _0x51b83c=_0xbb53[_0x401531];return _0x51b83c;};'use strict';var _=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var utils=require(_0x3bb5('0x2'));var members={};var exclude=[_0x3bb5('0x3'),_0x3bb5('0x4')];function writeDB(_0x226d39){utils[_0x3bb5('0x5')](util[_0x3bb5('0x6')](_0x3bb5('0x7'),_0x226d39[_0x3bb5('0x8')],_0x226d39['interface'],_0x226d39['channel'],_0x226d39[_0x3bb5('0x9')],_0x226d39[_0x3bb5('0xa')],_0x226d39[_0x3bb5('0xb')]));if(_0x226d39[_0x3bb5('0xc')]){utils[_0x3bb5('0xd')](_0x226d39['interface'])['then'](function(_0x4cfdd7){if(_0x4cfdd7){_0x226d39[_0x3bb5('0xa')]=_0x4cfdd7[_0x3bb5('0xe')];_0x226d39[_0x3bb5('0xf')]=_0x4cfdd7['internal'];utils[_0x3bb5('0x10')]('CreateMemberReport',_0x226d39);}else{utils['getUserByName'](_0x226d39[_0x3bb5('0xc')][_0x3bb5('0x11')]('/')[0x1])['then'](function(_0xe00ace){if(_0xe00ace){_0x226d39['membername']=_0xe00ace[_0x3bb5('0xe')];_0x226d39['internal']=_0xe00ace['internal'];utils[_0x3bb5('0x10')](_0x3bb5('0x12'),_0x226d39);}});}})[_0x3bb5('0x13')](function(_0x512be4){utils[_0x3bb5('0x14')](util[_0x3bb5('0x6')]('[%s][members][writeDB]',_0x226d39[_0x3bb5('0x8')]),_0x512be4);});}delete members[_0x226d39[_0x3bb5('0xc')]];}function startsWith(_0x5cec77,_0x5ca99f){return _['some'](_0x5cec77,function(_0x42ef1b){return _[_0x3bb5('0x15')](_0x5ca99f,_0x42ef1b);});}exports['devicestatechange']=function(_0x25d774){try{utils[_0x3bb5('0x16')](util[_0x3bb5('0x6')](_0x3bb5('0x17'),members[_0x25d774['device']]?members[_0x25d774[_0x3bb5('0x18')]][_0x3bb5('0x8')]:_0x25d774[_0x3bb5('0x18')]),_0x25d774);utils['info'](util['format'](_0x3bb5('0x19'),members[_0x25d774[_0x3bb5('0x18')]]?members[_0x25d774[_0x3bb5('0x18')]]['uniqueid']:_0x25d774[_0x3bb5('0x18')],_0x25d774[_0x3bb5('0x1a')],_0x25d774[_0x3bb5('0x18')]));switch(_0x25d774[_0x3bb5('0x1a')]){case _0x3bb5('0x1b'):case _0x3bb5('0x1c'):if(!startsWith(exclude,_0x25d774['device'])){members[_0x25d774[_0x3bb5('0x18')]]={'channel':_0x3bb5('0x1d'),'interface':_0x25d774[_0x3bb5('0x18')],'type':_0x3bb5('0x1e'),'enterAt':utils[_0x3bb5('0x1f')](),'role':_0x3bb5('0x20')};}break;case _0x3bb5('0x21'):if(!_['isNil'](members[_0x25d774[_0x3bb5('0x18')]])){members[_0x25d774[_0x3bb5('0x18')]]['exitAt']=utils['now']();members[_0x25d774[_0x3bb5('0x18')]][_0x3bb5('0x22')]=utils['diffTime'](members[_0x25d774['device']][_0x3bb5('0x23')],members[_0x25d774[_0x3bb5('0x18')]][_0x3bb5('0x24')]);if(members[_0x25d774[_0x3bb5('0x18')]]['uniqueid']){writeDB(members[_0x25d774['device']]);}}break;default:break;}}catch(_0x33e943){utils['error'](util[_0x3bb5('0x6')](_0x3bb5('0x17'),members[_0x25d774[_0x3bb5('0x18')]]?members[_0x25d774['device']]['uniqueid']:_0x25d774[_0x3bb5('0x18')]),_0x33e943);}};exports[_0x3bb5('0x25')]=function(_0x17ada7){try{if(!_[_0x3bb5('0x26')](members[_0x17ada7[_0x3bb5('0xc')]])){utils[_0x3bb5('0x16')](util[_0x3bb5('0x6')]('[%s][members][agentcomplete]',_0x17ada7[_0x3bb5('0x8')]),_0x17ada7);utils[_0x3bb5('0x5')](util[_0x3bb5('0x6')](_0x3bb5('0x27'),_0x17ada7[_0x3bb5('0x8')],_0x17ada7[_0x3bb5('0xc')],_0x17ada7[_0x3bb5('0x28')]));members[_0x17ada7['interface']]=_[_0x3bb5('0x29')](members[_0x17ada7[_0x3bb5('0xc')]],{'data4':_0x17ada7['queue'],'uniqueid':_0x17ada7[_0x3bb5('0x8')]});}}catch(_0x1fa29d){utils[_0x3bb5('0x14')](util[_0x3bb5('0x6')](_0x3bb5('0x2a'),_0x17ada7['uniqueid']),_0x1fa29d);}};exports[_0x3bb5('0x2b')]=function(_0x1df4c6){try{utils[_0x3bb5('0x16')](util[_0x3bb5('0x6')]('[%s][members][cdr]',_0x1df4c6['uniqueid']),_0x1df4c6);if(_0x1df4c6[_0x3bb5('0x2c')]){var _0xeeb452=_0x1df4c6[_0x3bb5('0x2c')][_0x3bb5('0x11')]('-')[0x0];if(!_[_0x3bb5('0x26')](members[_0xeeb452])){members[_0xeeb452]=_[_0x3bb5('0x29')](members[_0xeeb452],{'data1':members[_0xeeb452][_0x3bb5('0x2d')]||_0x1df4c6[_0x3bb5('0xb')],'data2':members[_0xeeb452][_0x3bb5('0x9')]||_0x1df4c6['source'],'data3':members[_0xeeb452][_0x3bb5('0x2e')]||_0x1df4c6[_0x3bb5('0x2f')],'uniqueid':members[_0xeeb452]['uniqueid']||_0x1df4c6['uniqueid']});utils[_0x3bb5('0x5')](util[_0x3bb5('0x6')](_0x3bb5('0x30'),_0x1df4c6[_0x3bb5('0x8')],members[_0xeeb452]['data1'],members[_0xeeb452]['data2'],members[_0xeeb452][_0x3bb5('0x2e')]));if(members[_0xeeb452]['exitAt']){writeDB(members[_0xeeb452]);}}}if(_0x1df4c6[_0x3bb5('0x31')]){var _0x5772e4=_0x1df4c6['destinationchannel'][_0x3bb5('0x11')]('-')[0x0];if(!_['isNil'](members[_0x5772e4])){members[_0x5772e4]=_['assign'](members[_0x5772e4],{'data1':members[_0x5772e4][_0x3bb5('0x2d')]||_0x1df4c6[_0x3bb5('0xb')],'data2':members[_0x5772e4][_0x3bb5('0x9')]||_0x1df4c6['source'],'data3':members[_0x5772e4][_0x3bb5('0x2e')]||_0x1df4c6['destination'],'uniqueid':members[_0x5772e4][_0x3bb5('0x8')]||_0x1df4c6['uniqueid']});utils[_0x3bb5('0x5')](util[_0x3bb5('0x6')](_0x3bb5('0x30'),_0x1df4c6[_0x3bb5('0x8')],members[_0x5772e4][_0x3bb5('0x2d')],members[_0x5772e4][_0x3bb5('0x9')],members[_0x5772e4]['data3']));if(members[_0x5772e4][_0x3bb5('0x23')]){writeDB(members[_0x5772e4]);}}}}catch(_0x7c1b7b){utils['error'](util[_0x3bb5('0x6')](_0x3bb5('0x32'),_0x1df4c6[_0x3bb5('0x8')]),_0x7c1b7b);}}; \ No newline at end of file +var _0x8406=['[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','channel','data1','data2','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','destination','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','uniqueid','interface','membername','type','getUserByInterface','then','name','internal','request','getUserByName','split','CreateMemberReport','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','agent','NOT_INUSE','isNil','exitAt','now','duration','enterAt'];(function(_0x54fb56,_0x28bc6c){var _0x3e084b=function(_0x551483){while(--_0x551483){_0x54fb56['push'](_0x54fb56['shift']());}};_0x3e084b(++_0x28bc6c);}(_0x8406,0x10c));var _0x6840=function(_0x49f435,_0x2f6231){_0x49f435=_0x49f435-0x0;var _0x2b6df7=_0x8406[_0x49f435];return _0x2b6df7;};'use strict';var _=require(_0x6840('0x0'));var util=require(_0x6840('0x1'));var utils=require(_0x6840('0x2'));var members={};var exclude=[_0x6840('0x3'),_0x6840('0x4')];function writeDB(_0x4f2e70){utils[_0x6840('0x5')](util[_0x6840('0x6')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x4f2e70[_0x6840('0x7')],_0x4f2e70[_0x6840('0x8')],_0x4f2e70['channel'],_0x4f2e70['data2'],_0x4f2e70[_0x6840('0x9')],_0x4f2e70[_0x6840('0xa')]));if(_0x4f2e70[_0x6840('0x8')]){utils[_0x6840('0xb')](_0x4f2e70[_0x6840('0x8')])[_0x6840('0xc')](function(_0x214710){if(_0x214710){_0x4f2e70['membername']=_0x214710[_0x6840('0xd')];_0x4f2e70['internal']=_0x214710[_0x6840('0xe')];utils[_0x6840('0xf')]('CreateMemberReport',_0x4f2e70);}else{utils[_0x6840('0x10')](_0x4f2e70[_0x6840('0x8')][_0x6840('0x11')]('/')[0x1])['then'](function(_0x25f4b3){if(_0x25f4b3){_0x4f2e70[_0x6840('0x9')]=_0x25f4b3['name'];_0x4f2e70[_0x6840('0xe')]=_0x25f4b3[_0x6840('0xe')];utils[_0x6840('0xf')](_0x6840('0x12'),_0x4f2e70);}});}})[_0x6840('0x13')](function(_0x34953f){utils[_0x6840('0x14')](util[_0x6840('0x6')](_0x6840('0x15'),_0x4f2e70[_0x6840('0x7')]),_0x34953f);});}delete members[_0x4f2e70['interface']];}function startsWith(_0x349faa,_0x2b9c5b){return _[_0x6840('0x16')](_0x349faa,function(_0x566394){return _[_0x6840('0x17')](_0x2b9c5b,_0x566394);});}exports[_0x6840('0x18')]=function(_0x16c89d){try{utils[_0x6840('0x19')](util[_0x6840('0x6')]('[%s][members][devicestatechange]',members[_0x16c89d[_0x6840('0x1a')]]?members[_0x16c89d[_0x6840('0x1a')]][_0x6840('0x7')]:_0x16c89d[_0x6840('0x1a')]),_0x16c89d);utils[_0x6840('0x5')](util['format'](_0x6840('0x1b'),members[_0x16c89d[_0x6840('0x1a')]]?members[_0x16c89d[_0x6840('0x1a')]][_0x6840('0x7')]:_0x16c89d[_0x6840('0x1a')],_0x16c89d[_0x6840('0x1c')],_0x16c89d[_0x6840('0x1a')]));switch(_0x16c89d[_0x6840('0x1c')]){case _0x6840('0x1d'):case _0x6840('0x1e'):if(!startsWith(exclude,_0x16c89d[_0x6840('0x1a')])){members[_0x16c89d[_0x6840('0x1a')]]={'channel':'voice','interface':_0x16c89d[_0x6840('0x1a')],'type':'TALKING','enterAt':utils['now'](),'role':_0x6840('0x1f')};}break;case _0x6840('0x20'):if(!_[_0x6840('0x21')](members[_0x16c89d['device']])){members[_0x16c89d['device']][_0x6840('0x22')]=utils[_0x6840('0x23')]();members[_0x16c89d[_0x6840('0x1a')]][_0x6840('0x24')]=utils['diffTime'](members[_0x16c89d['device']][_0x6840('0x22')],members[_0x16c89d[_0x6840('0x1a')]][_0x6840('0x25')]);if(members[_0x16c89d[_0x6840('0x1a')]][_0x6840('0x7')]){writeDB(members[_0x16c89d['device']]);}}break;default:break;}}catch(_0x4c5135){utils['error'](util['format']('[%s][members][devicestatechange]',members[_0x16c89d['device']]?members[_0x16c89d[_0x6840('0x1a')]][_0x6840('0x7')]:_0x16c89d[_0x6840('0x1a')]),_0x4c5135);}};exports['agentcomplete']=function(_0xf6da35){try{if(!_['isNil'](members[_0xf6da35['interface']])){utils['debug'](util['format'](_0x6840('0x26'),_0xf6da35['uniqueid']),_0xf6da35);utils['info'](util['format'](_0x6840('0x27'),_0xf6da35[_0x6840('0x7')],_0xf6da35[_0x6840('0x8')],_0xf6da35[_0x6840('0x28')]));members[_0xf6da35['interface']]=_[_0x6840('0x29')](members[_0xf6da35[_0x6840('0x8')]],{'data4':_0xf6da35['queue'],'uniqueid':_0xf6da35[_0x6840('0x7')]});}}catch(_0x24b431){utils[_0x6840('0x14')](util[_0x6840('0x6')](_0x6840('0x26'),_0xf6da35[_0x6840('0x7')]),_0x24b431);}};exports['cdr']=function(_0xffb612){try{utils['debug'](util[_0x6840('0x6')](_0x6840('0x2a'),_0xffb612['uniqueid']),_0xffb612);if(_0xffb612[_0x6840('0x2b')]){var _0x2cf1f8=_0xffb612[_0x6840('0x2b')][_0x6840('0x11')]('-')[0x0];if(!_[_0x6840('0x21')](members[_0x2cf1f8])){members[_0x2cf1f8]=_['assign'](members[_0x2cf1f8],{'data1':members[_0x2cf1f8][_0x6840('0x2c')]||_0xffb612[_0x6840('0xa')],'data2':members[_0x2cf1f8][_0x6840('0x2d')]||_0xffb612[_0x6840('0x2e')],'data3':members[_0x2cf1f8][_0x6840('0x2f')]||_0xffb612['destination'],'uniqueid':members[_0x2cf1f8][_0x6840('0x7')]||_0xffb612[_0x6840('0x7')]});utils['info'](util[_0x6840('0x6')](_0x6840('0x30'),_0xffb612[_0x6840('0x7')],members[_0x2cf1f8][_0x6840('0x2c')],members[_0x2cf1f8][_0x6840('0x2d')],members[_0x2cf1f8][_0x6840('0x2f')]));if(members[_0x2cf1f8][_0x6840('0x22')]){writeDB(members[_0x2cf1f8]);}}}if(_0xffb612[_0x6840('0x31')]){var _0x3a3316=_0xffb612['destinationchannel'][_0x6840('0x11')]('-')[0x0];if(!_['isNil'](members[_0x3a3316])){members[_0x3a3316]=_[_0x6840('0x29')](members[_0x3a3316],{'data1':members[_0x3a3316]['data1']||_0xffb612[_0x6840('0xa')],'data2':members[_0x3a3316][_0x6840('0x2d')]||_0xffb612[_0x6840('0x2e')],'data3':members[_0x3a3316][_0x6840('0x2f')]||_0xffb612[_0x6840('0x32')],'uniqueid':members[_0x3a3316][_0x6840('0x7')]||_0xffb612[_0x6840('0x7')]});utils['info'](util['format'](_0x6840('0x30'),_0xffb612[_0x6840('0x7')],members[_0x3a3316][_0x6840('0x2c')],members[_0x3a3316][_0x6840('0x2d')],members[_0x3a3316][_0x6840('0x2f')]));if(members[_0x3a3316][_0x6840('0x22')]){writeDB(members[_0x3a3316]);}}}}catch(_0x420611){utils[_0x6840('0x14')](util[_0x6840('0x6')]('[%s][members][cdr]',_0xffb612['uniqueid']),_0x420611);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 791dc27..93ee06c 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 _0xa8fe=['queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridnum','calleridname','mohtime','origtransfererlinkedid','secondtransfereruniqueid','origtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','clone','holdtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','util','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','format','[%s][queues][queuecallerjoin]','info','position','assign','now','error','hangup','isNil','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandon','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s'];(function(_0x3cffda,_0x49abcc){var _0x117924=function(_0x4f2d57){while(--_0x4f2d57){_0x3cffda['push'](_0x3cffda['shift']());}};_0x117924(++_0x49abcc);}(_0xa8fe,0x9f));var _0xea8f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa8fe[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0xea8f('0x0'));var utils=require('./utils');var queues={};function writeDB(_0x4fb916){utils['info'](util['format'](_0xea8f('0x1'),_0x4fb916[_0xea8f('0x2')],_0x4fb916[_0xea8f('0x3')],_0x4fb916[_0xea8f('0x4')],_0x4fb916[_0xea8f('0x5')],_0x4fb916['calleridnum'],_0x4fb916[_0xea8f('0x6')],_0x4fb916[_0xea8f('0x7')]));if(_0x4fb916[_0xea8f('0x4')]){utils[_0xea8f('0x8')](_0x4fb916[_0xea8f('0x4')])['then'](function(_0x2b13ef){if(_0x2b13ef){_0x4fb916['type']=_0x2b13ef[_0xea8f('0x9')];}utils[_0xea8f('0xa')](_0xea8f('0xb'),_0x4fb916);});}else{utils[_0xea8f('0xa')](_0xea8f('0xb'),_0x4fb916);}if(_0x4fb916['transfereduniqueid']){delete queues[_0x4fb916[_0xea8f('0xc')]];}else{delete queues[_0x4fb916[_0xea8f('0x2')]];}}exports[_0xea8f('0xd')]=function(_0x4c8df2){try{utils['debug'](util[_0xea8f('0xe')](_0xea8f('0xf'),_0x4c8df2[_0xea8f('0x2')]),_0x4c8df2);utils[_0xea8f('0x10')](util[_0xea8f('0xe')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x4c8df2[_0xea8f('0x2')],_0x4c8df2['queue'],_0x4c8df2[_0xea8f('0x11')]));queues[_0x4c8df2[_0xea8f('0x2')]]=_[_0xea8f('0x12')](_0x4c8df2,{'originalposition':_0x4c8df2[_0xea8f('0x11')],'queuecallerjoinAt':utils[_0xea8f('0x13')](),'mohtime':0x0});}catch(_0x2a7af7){utils[_0xea8f('0x14')](util[_0xea8f('0xe')]('[%s][queues][queuecallerjoin]',_0x4c8df2[_0xea8f('0x2')]),_0x2a7af7);}};exports[_0xea8f('0x15')]=function(_0x5759ed){try{if(!_[_0xea8f('0x16')](queues[_0x5759ed['uniqueid']])){utils[_0xea8f('0x17')](util[_0xea8f('0xe')](_0xea8f('0x18'),_0x5759ed[_0xea8f('0x2')]),_0x5759ed);if(queues[_0x5759ed['uniqueid']][_0xea8f('0x19')]){if(!queues[_0x5759ed[_0xea8f('0x2')]]['queuecallerabandon']&&!queues[_0x5759ed[_0xea8f('0x2')]][_0xea8f('0x1a')]){queues[_0x5759ed['uniqueid']][_0xea8f('0x1b')]=!![];queues[_0x5759ed[_0xea8f('0x2')]][_0xea8f('0x1c')]=utils['now']();queues[_0x5759ed[_0xea8f('0x2')]][_0xea8f('0x7')]=_0xea8f('0x1d');}utils[_0xea8f('0x10')](util[_0xea8f('0xe')](_0xea8f('0x1e'),_0x5759ed[_0xea8f('0x2')],queues[_0x5759ed[_0xea8f('0x2')]][_0xea8f('0x1f')],queues[_0x5759ed[_0xea8f('0x2')]][_0xea8f('0x7')]));writeDB(queues[_0x5759ed[_0xea8f('0x2')]]);}else if(queues[_0x5759ed[_0xea8f('0x2')]][_0xea8f('0xc')]){utils['info'](util[_0xea8f('0xe')](_0xea8f('0x20'),_0x5759ed[_0xea8f('0x2')],queues[_0x5759ed[_0xea8f('0x2')]][_0xea8f('0x1f')],queues[_0x5759ed[_0xea8f('0x2')]][_0xea8f('0xc')]));queues[queues[_0x5759ed[_0xea8f('0x2')]]['transfereduniqueid']]=queues[_0x5759ed['uniqueid']];queues[queues[_0x5759ed['uniqueid']][_0xea8f('0xc')]][_0xea8f('0x21')]=0x2;delete queues[_0x5759ed[_0xea8f('0x2')]];}}}catch(_0x1cd5f7){utils[_0xea8f('0x14')](util[_0xea8f('0xe')](_0xea8f('0x18'),_0x5759ed['uniqueid']),_0x1cd5f7);}};exports[_0xea8f('0x22')]=function(_0x17df62){try{utils[_0xea8f('0x17')](util['format'](_0xea8f('0x23'),_0x17df62[_0xea8f('0x2')]),_0x17df62);if(!_['isNil'](_0x17df62[_0xea8f('0x24')][_0xea8f('0x25')])&&_0x17df62[_0xea8f('0x26')][_0xea8f('0x27')]()!=='CONTINUE'){if(!_[_0xea8f('0x16')](queues[_0x17df62[_0xea8f('0x2')]])){queues[_0x17df62['uniqueid']]['queuecallerabandon']=![];queues[_0x17df62['uniqueid']][_0xea8f('0x28')]=null;queues[_0x17df62[_0xea8f('0x2')]][_0xea8f('0x1a')]=!![];queues[_0x17df62['uniqueid']][_0xea8f('0x29')]=utils[_0xea8f('0x13')]();queues[_0x17df62[_0xea8f('0x2')]][_0xea8f('0x7')]=_0x17df62[_0xea8f('0x26')][_0xea8f('0x27')]();utils[_0xea8f('0x10')](util['format'](_0xea8f('0x2a'),_0x17df62[_0xea8f('0x2')],queues[_0x17df62[_0xea8f('0x2')]][_0xea8f('0x1f')],_0x17df62['value'],queues[_0x17df62[_0xea8f('0x2')]]['queuecallerexitreason']));writeDB(queues[_0x17df62[_0xea8f('0x2')]]);}}else if(!_[_0xea8f('0x16')](_0x17df62[_0xea8f('0x24')]['queueposition'])){if(!_[_0xea8f('0x16')](queues[_0x17df62[_0xea8f('0x2')]])&&!queues[_0x17df62[_0xea8f('0x2')]][_0xea8f('0x2b')]){queues[_0x17df62[_0xea8f('0x2')]][_0xea8f('0x2b')]=![];queues[_0x17df62[_0xea8f('0x2')]]['queuecallerabandonAt']=null;queues[_0x17df62['uniqueid']][_0xea8f('0x1a')]=!![];queues[_0x17df62['uniqueid']][_0xea8f('0x29')]=utils[_0xea8f('0x13')]();queues[_0x17df62[_0xea8f('0x2')]][_0xea8f('0x7')]=_0xea8f('0x2c');utils['info'](util[_0xea8f('0xe')](_0xea8f('0x2d'),_0x17df62[_0xea8f('0x2')],queues[_0x17df62['uniqueid']][_0xea8f('0x1f')],_0x17df62[_0xea8f('0x26')],queues[_0x17df62[_0xea8f('0x2')]]['queuecallerexitreason']));}}}catch(_0x45a5dc){utils[_0xea8f('0x14')](util[_0xea8f('0xe')](_0xea8f('0x23'),_0x17df62[_0xea8f('0x2')]),_0x45a5dc);}};exports['queuecallerabandon']=function(_0x39bbd6){try{if(!_['isNil'](queues[_0x39bbd6[_0xea8f('0x2')]])){utils[_0xea8f('0x17')](util[_0xea8f('0xe')]('[%s][queues][queuecallerabandon]',_0x39bbd6[_0xea8f('0x2')]),_0x39bbd6);queues[_0x39bbd6['uniqueid']][_0xea8f('0x1a')]=![];queues[_0x39bbd6['uniqueid']]['queuecallerexitAt']=null;queues[_0x39bbd6['uniqueid']][_0xea8f('0x2b')]=!![];queues[_0x39bbd6[_0xea8f('0x2')]][_0xea8f('0x28')]=utils['now']();queues[_0x39bbd6['uniqueid']]['queuecallerexitreason']='ABANDONED';utils[_0xea8f('0x10')](util[_0xea8f('0xe')](_0xea8f('0x2e'),_0x39bbd6[_0xea8f('0x2')],queues[_0x39bbd6[_0xea8f('0x2')]]['name'],queues[_0x39bbd6[_0xea8f('0x2')]][_0xea8f('0x7')]));}}catch(_0x2e09dc){utils[_0xea8f('0x14')](util[_0xea8f('0xe')]('[%s][queues][queuecallerabandon]',_0x39bbd6[_0xea8f('0x2')]),_0x2e09dc);}};exports[_0xea8f('0x2f')]=function(_0x508a33){try{if(!_[_0xea8f('0x16')](queues[_0x508a33[_0xea8f('0x2')]])){utils[_0xea8f('0x17')](util[_0xea8f('0xe')](_0xea8f('0x30'),_0x508a33['uniqueid']),_0x508a33);utils[_0xea8f('0x10')](util[_0xea8f('0xe')](_0xea8f('0x31'),_0x508a33['uniqueid'],queues[_0x508a33['uniqueid']][_0xea8f('0x1f')],_0x508a33['connectedlinenum'],_0x508a33['connectedlinename']));queues[_0x508a33[_0xea8f('0x2')]]['queuecallerleave']=!![];queues[_0x508a33['uniqueid']][_0xea8f('0x19')]=utils[_0xea8f('0x13')]();queues[_0x508a33[_0xea8f('0x2')]]['holdtime']=utils[_0xea8f('0x32')](queues[_0x508a33['uniqueid']]['queuecallerleaveAt'],queues[_0x508a33[_0xea8f('0x2')]][_0xea8f('0x33')]);queues[_0x508a33[_0xea8f('0x2')]]['position']=_0x508a33[_0xea8f('0x11')];queues[_0x508a33[_0xea8f('0x2')]]['count']=_0x508a33[_0xea8f('0x34')];queues[_0x508a33[_0xea8f('0x2')]][_0xea8f('0x35')]=_0x508a33[_0xea8f('0x35')];queues[_0x508a33[_0xea8f('0x2')]][_0xea8f('0x36')]=_0x508a33['connectedlinename'];}}catch(_0x190849){utils[_0xea8f('0x14')](util[_0xea8f('0xe')](_0xea8f('0x30'),_0x508a33[_0xea8f('0x2')]),_0x190849);}};exports[_0xea8f('0x37')]=function(_0xd4cd91){try{if(!_[_0xea8f('0x16')](queues[_0xd4cd91[_0xea8f('0x2')]])){utils[_0xea8f('0x17')](util[_0xea8f('0xe')](_0xea8f('0x38'),_0xd4cd91[_0xea8f('0x2')]),_0xd4cd91);utils[_0xea8f('0x10')](util[_0xea8f('0xe')](_0xea8f('0x39'),_0xd4cd91[_0xea8f('0x2')],queues[_0xd4cd91['uniqueid']]['name'],_0xd4cd91[_0xea8f('0x3a')],_0xd4cd91['destaccountcode']));queues[_0xd4cd91[_0xea8f('0x2')]]['queuecallerabandon']=![];queues[_0xd4cd91[_0xea8f('0x2')]][_0xea8f('0x2b')]=![];queues[_0xd4cd91[_0xea8f('0x2')]][_0xea8f('0x28')]=null;queues[_0xd4cd91[_0xea8f('0x2')]][_0xea8f('0x1a')]=![];queues[_0xd4cd91['uniqueid']][_0xea8f('0x7')]=null;queues[_0xd4cd91[_0xea8f('0x2')]][_0xea8f('0x29')]=null;queues[_0xd4cd91['uniqueid']][_0xea8f('0x3b')]=!![];queues[_0xd4cd91[_0xea8f('0x2')]][_0xea8f('0x6')]=_0xd4cd91[_0xea8f('0x3c')];queues[_0xd4cd91['uniqueid']][_0xea8f('0x5')]=_0xd4cd91[_0xea8f('0x3a')];}}catch(_0x334991){utils[_0xea8f('0x14')](util[_0xea8f('0xe')](_0xea8f('0x38'),_0xd4cd91[_0xea8f('0x2')]),_0x334991);}};exports[_0xea8f('0x3d')]=function(_0x3f2d0a){try{if(!_[_0xea8f('0x16')](queues[_0x3f2d0a[_0xea8f('0x2')]])){if(queues[_0x3f2d0a[_0xea8f('0x2')]]['queuecallerleaveAt']){utils['debug'](util[_0xea8f('0xe')](_0xea8f('0x3e'),_0x3f2d0a[_0xea8f('0x2')]),_0x3f2d0a);queues[_0x3f2d0a[_0xea8f('0x2')]]['queuecallerabandon']=![];queues[_0x3f2d0a[_0xea8f('0x2')]][_0xea8f('0x2b')]=![];queues[_0x3f2d0a[_0xea8f('0x2')]]['queuecallerabandonAt']=null;queues[_0x3f2d0a[_0xea8f('0x2')]]['queuecallerexit']=![];queues[_0x3f2d0a[_0xea8f('0x2')]][_0xea8f('0x29')]=null;queues[_0x3f2d0a[_0xea8f('0x2')]]['assigned']=!![];queues[_0x3f2d0a[_0xea8f('0x2')]][_0xea8f('0x5')]=_0x3f2d0a[_0xea8f('0x3a')];queues[_0x3f2d0a[_0xea8f('0x2')]][_0xea8f('0x1b')]=!![];queues[_0x3f2d0a[_0xea8f('0x2')]][_0xea8f('0x1c')]=utils['now']();if(_0x3f2d0a[_0xea8f('0x3f')]==_0xea8f('0x40')){if(!queues[_0x3f2d0a[_0xea8f('0x2')]][_0xea8f('0x40')]){queues[_0x3f2d0a[_0xea8f('0x2')]][_0xea8f('0x7')]='TRANSFER';}}else{queues[_0x3f2d0a[_0xea8f('0x2')]]['queuecallerexitreason']=_0xea8f('0x41')+_0x3f2d0a[_0xea8f('0x3f')][_0xea8f('0x27')]();}utils['info'](util[_0xea8f('0xe')](_0xea8f('0x42'),_0x3f2d0a['uniqueid'],queues[_0x3f2d0a[_0xea8f('0x2')]]['name'],_0x3f2d0a[_0xea8f('0x3a')],queues[_0x3f2d0a[_0xea8f('0x2')]][_0xea8f('0x7')]));writeDB(queues[_0x3f2d0a[_0xea8f('0x2')]]);}}}catch(_0x48d22d){utils[_0xea8f('0x14')](util[_0xea8f('0xe')](_0xea8f('0x3e'),_0x3f2d0a[_0xea8f('0x2')]),_0x48d22d);}};exports[_0xea8f('0x43')]=function(_0x389bbf){try{if(!_[_0xea8f('0x16')](queues[_0x389bbf[_0xea8f('0x44')]])){utils[_0xea8f('0x17')](util[_0xea8f('0xe')](_0xea8f('0x45'),_0x389bbf[_0xea8f('0x2')]),_0x389bbf);queues[_0x389bbf[_0xea8f('0x44')]][_0xea8f('0x40')]=!![];queues[_0x389bbf[_0xea8f('0x44')]][_0xea8f('0x46')]=_0xea8f('0x47');queues[_0x389bbf[_0xea8f('0x44')]]['transferexten']=_0x389bbf[_0xea8f('0x48')];queues[_0x389bbf[_0xea8f('0x44')]][_0xea8f('0x49')]=_0x389bbf[_0xea8f('0x44')];queues[_0x389bbf[_0xea8f('0x44')]]['queuecallerexitreason']=_0xea8f('0x4a');utils['info'](util['format'](_0xea8f('0x4b'),_0x389bbf[_0xea8f('0x2')],queues[_0x389bbf[_0xea8f('0x44')]][_0xea8f('0x1f')],_0x389bbf['transfereeuniqueid'],_0x389bbf[_0xea8f('0x48')]));}}catch(_0xa405c0){utils['error'](util[_0xea8f('0xe')](_0xea8f('0x45'),_0x389bbf[_0xea8f('0x2')]),_0xa405c0);}};exports[_0xea8f('0x4c')]=function(_0x422e5b){try{utils[_0xea8f('0x17')](util[_0xea8f('0xe')](_0xea8f('0x4d'),_0x422e5b['origtransfereruniqueid']),_0x422e5b);if(_0x422e5b['origtransfereruniqueid']==_0x422e5b['origtransfererlinkedid']){if(!_['isNil'](queues[_0x422e5b[_0xea8f('0x4e')]])){utils[_0xea8f('0x10')](util[_0xea8f('0xe')](_0xea8f('0x4f'),_0x422e5b['origtransfereruniqueid'],queues[_0x422e5b[_0xea8f('0x4e')]][_0xea8f('0x1f')],_0x422e5b[_0xea8f('0x50')]));queues[_0x422e5b[_0xea8f('0x4e')]][_0xea8f('0x40')]=!![];queues[_0x422e5b[_0xea8f('0x4e')]][_0xea8f('0x46')]=_0xea8f('0x51');queues[_0x422e5b['secondtransfererlinkedid']][_0xea8f('0x52')]=_0x422e5b['origtransfererexten'];queues[_0x422e5b[_0xea8f('0x4e')]][_0xea8f('0x49')]=_0x422e5b['origtransfereruniqueid'];queues[_0x422e5b[_0xea8f('0x4e')]][_0xea8f('0x7')]=_0xea8f('0x53');}if(!_[_0xea8f('0x16')](queues[_0x422e5b['origtransfererlinkedid']])){if(_0x422e5b['transfereelinkedid']&&queues[_0x422e5b[_0xea8f('0x54')]]){queues[_0x422e5b[_0xea8f('0x54')]][_0xea8f('0x21')]=0x1;queues[_0x422e5b['transfereeuniqueid']]=_['clone'](queues[_0x422e5b['transfereelinkedid']]);queues[_0x422e5b[_0xea8f('0x44')]][_0xea8f('0xc')]=_0x422e5b[_0xea8f('0x55')];queues[_0x422e5b[_0xea8f('0x44')]][_0xea8f('0x21')]=0x2;queues[_0x422e5b[_0xea8f('0x44')]]['calleridnum']=queues[_0x422e5b[_0xea8f('0x4e')]][_0xea8f('0x56')];queues[_0x422e5b[_0xea8f('0x44')]][_0xea8f('0x57')]=queues[_0x422e5b[_0xea8f('0x4e')]][_0xea8f('0x57')];queues[_0x422e5b[_0xea8f('0x44')]][_0xea8f('0x33')]=utils[_0xea8f('0x13')]();queues[_0x422e5b['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0xea8f('0x13')]();queues[_0x422e5b[_0xea8f('0x44')]]['holdtime']=0x0;queues[_0x422e5b[_0xea8f('0x44')]][_0xea8f('0x58')]=0x0;utils[_0xea8f('0x10')](util[_0xea8f('0xe')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x422e5b['origtransfereruniqueid'],queues[_0x422e5b[_0xea8f('0x44')]][_0xea8f('0x1f')],queues[_0x422e5b[_0xea8f('0x44')]][_0xea8f('0x56')],queues[_0x422e5b['transfereeuniqueid']][_0xea8f('0x57')]));}else{utils[_0xea8f('0x10')](util[_0xea8f('0xe')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x422e5b['origtransfereruniqueid'],queues[_0x422e5b[_0xea8f('0x59')]][_0xea8f('0x1f')],_0x422e5b[_0xea8f('0x4e')]));queues[_0x422e5b[_0xea8f('0x59')]]['transfereduniqueid']=_0x422e5b[_0xea8f('0x4e')];}}}else if(_0x422e5b[_0xea8f('0x5a')]==_0x422e5b[_0xea8f('0x4e')]){if(!_[_0xea8f('0x16')](queues[_0x422e5b['origtransfererlinkedid']])){utils[_0xea8f('0x10')](util[_0xea8f('0xe')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x422e5b[_0xea8f('0x5b')],queues[_0x422e5b[_0xea8f('0x59')]][_0xea8f('0x1f')],_0x422e5b[_0xea8f('0x5a')],_0x422e5b[_0xea8f('0x5c')]));queues[_0x422e5b['origtransfererlinkedid']][_0xea8f('0x40')]=!![];queues[_0x422e5b[_0xea8f('0x59')]][_0xea8f('0x46')]=_0xea8f('0x51');queues[_0x422e5b[_0xea8f('0x59')]][_0xea8f('0x52')]=_0x422e5b[_0xea8f('0x5c')];queues[_0x422e5b[_0xea8f('0x59')]][_0xea8f('0x49')]=_0x422e5b['secondtransfereruniqueid'];queues[_0x422e5b[_0xea8f('0x59')]][_0xea8f('0x7')]='ATTENDEDTRANSFER';}if(!_[_0xea8f('0x16')](queues[_0x422e5b[_0xea8f('0x4e')]])){if(_0x422e5b[_0xea8f('0x5d')]&&queues[_0x422e5b['transfertargetlinkedid']]){queues[_0x422e5b['transfertargetlinkedid']][_0xea8f('0x21')]=0x1;queues[_0x422e5b[_0xea8f('0x55')]]=_[_0xea8f('0x5e')](queues[_0x422e5b[_0xea8f('0x5d')]]);queues[_0x422e5b[_0xea8f('0x55')]][_0xea8f('0xc')]=_0x422e5b[_0xea8f('0x55')];queues[_0x422e5b[_0xea8f('0x55')]][_0xea8f('0x21')]=0x2;queues[_0x422e5b['transfertargetuniqueid']][_0xea8f('0x56')]=queues[_0x422e5b['origtransfererlinkedid']][_0xea8f('0x56')];queues[_0x422e5b['transfertargetuniqueid']]['calleridname']=queues[_0x422e5b[_0xea8f('0x59')]]['calleridname'];queues[_0x422e5b[_0xea8f('0x55')]][_0xea8f('0x33')]=utils[_0xea8f('0x13')]();queues[_0x422e5b[_0xea8f('0x55')]][_0xea8f('0x19')]=utils['now']();queues[_0x422e5b[_0xea8f('0x55')]][_0xea8f('0x5f')]=0x0;queues[_0x422e5b[_0xea8f('0x55')]]['mohtime']=0x0;utils[_0xea8f('0x10')](util[_0xea8f('0xe')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x422e5b[_0xea8f('0x5b')],queues[_0x422e5b[_0xea8f('0x55')]][_0xea8f('0x1f')],queues[_0x422e5b[_0xea8f('0x55')]][_0xea8f('0xc')],queues[_0x422e5b[_0xea8f('0x55')]][_0xea8f('0x56')],queues[_0x422e5b[_0xea8f('0x55')]][_0xea8f('0x57')]));}else{utils[_0xea8f('0x10')](util[_0xea8f('0xe')](_0xea8f('0x60'),_0x422e5b[_0xea8f('0x5b')],queues[_0x422e5b[_0xea8f('0x4e')]][_0xea8f('0x1f')],_0x422e5b[_0xea8f('0x59')]));queues[_0x422e5b['secondtransfererlinkedid']][_0xea8f('0xc')]=_0x422e5b[_0xea8f('0x59')];}}}}catch(_0x4345e3){utils['error'](util[_0xea8f('0xe')](_0xea8f('0x4d'),_0x422e5b[_0xea8f('0x5b')]),_0x4345e3);}};exports['musiconholdstart']=function(_0x45b10e){try{if(!_['isNil'](queues[_0x45b10e[_0xea8f('0x2')]])){utils[_0xea8f('0x17')](util[_0xea8f('0xe')](_0xea8f('0x61'),_0x45b10e[_0xea8f('0x2')]),_0x45b10e);queues[_0x45b10e[_0xea8f('0x2')]]['musiconholdstartAt']=utils[_0xea8f('0x13')]();utils[_0xea8f('0x10')](util['format'](_0xea8f('0x62'),_0x45b10e['uniqueid'],queues[_0x45b10e['uniqueid']][_0xea8f('0x1f')],queues[_0x45b10e[_0xea8f('0x2')]][_0xea8f('0x63')]));}}catch(_0x43e151){utils['error'](util['format'](_0xea8f('0x61'),_0x45b10e[_0xea8f('0x2')]),_0x43e151);}};exports[_0xea8f('0x64')]=function(_0x1c0412){try{if(!_[_0xea8f('0x16')](queues[_0x1c0412['uniqueid']])){if(!_[_0xea8f('0x16')](queues[_0x1c0412[_0xea8f('0x2')]][_0xea8f('0x63')])){utils[_0xea8f('0x17')](util[_0xea8f('0xe')]('[%s][queues][musiconholdstop]',_0x1c0412[_0xea8f('0x2')]),_0x1c0412);queues[_0x1c0412[_0xea8f('0x2')]][_0xea8f('0x58')]+=utils[_0xea8f('0x32')](utils['now'](),queues[_0x1c0412[_0xea8f('0x2')]][_0xea8f('0x63')]);utils[_0xea8f('0x10')](util['format'](_0xea8f('0x65'),_0x1c0412[_0xea8f('0x2')],queues[_0x1c0412['uniqueid']][_0xea8f('0x1f')],queues[_0x1c0412[_0xea8f('0x2')]]['mohtime']));delete queues[_0x1c0412[_0xea8f('0x2')]][_0xea8f('0x63')];}}}catch(_0x27f5de){utils[_0xea8f('0x14')](util[_0xea8f('0xe')](_0xea8f('0x66'),_0x1c0412[_0xea8f('0x2')]),_0x27f5de);}}; \ No newline at end of file +var _0x50ab=['reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transferexten','secondtransfereruniqueid','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','uniqueid','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','queuestatus','value','CONTINUE','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queueposition','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','agentcomplete','assigned'];(function(_0xe86e8b,_0x5da3bf){var _0x46341e=function(_0x51fb22){while(--_0x51fb22){_0xe86e8b['push'](_0xe86e8b['shift']());}};_0x46341e(++_0x5da3bf);}(_0x50ab,0x95));var _0xb50a=function(_0x529167,_0x426891){_0x529167=_0x529167-0x0;var _0x1adee1=_0x50ab[_0x529167];return _0x1adee1;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var queues={};function writeDB(_0x12b66d){utils[_0xb50a('0x0')](util['format'](_0xb50a('0x1'),_0x12b66d['uniqueid'],_0x12b66d[_0xb50a('0x2')],_0x12b66d['queue'],_0x12b66d[_0xb50a('0x3')],_0x12b66d[_0xb50a('0x4')],_0x12b66d[_0xb50a('0x5')],_0x12b66d[_0xb50a('0x6')]));if(_0x12b66d[_0xb50a('0x7')]){utils[_0xb50a('0x8')](_0x12b66d[_0xb50a('0x7')])[_0xb50a('0x9')](function(_0x30dff3){if(_0x30dff3){_0x12b66d[_0xb50a('0xa')]=_0x30dff3[_0xb50a('0xa')];}utils[_0xb50a('0xb')](_0xb50a('0xc'),_0x12b66d);});}else{utils[_0xb50a('0xb')]('CreateVoiceQueueReport',_0x12b66d);}if(_0x12b66d[_0xb50a('0xd')]){delete queues[_0x12b66d[_0xb50a('0xd')]];}else{delete queues[_0x12b66d['uniqueid']];}}exports[_0xb50a('0xe')]=function(_0x31e436){try{utils[_0xb50a('0xf')](util[_0xb50a('0x10')](_0xb50a('0x11'),_0x31e436[_0xb50a('0x12')]),_0x31e436);utils['info'](util[_0xb50a('0x10')](_0xb50a('0x13'),_0x31e436[_0xb50a('0x12')],_0x31e436[_0xb50a('0x7')],_0x31e436[_0xb50a('0x14')]));queues[_0x31e436[_0xb50a('0x12')]]=_[_0xb50a('0x15')](_0x31e436,{'originalposition':_0x31e436[_0xb50a('0x14')],'queuecallerjoinAt':utils[_0xb50a('0x16')](),'mohtime':0x0});}catch(_0x495002){utils[_0xb50a('0x17')](util[_0xb50a('0x10')](_0xb50a('0x11'),_0x31e436[_0xb50a('0x12')]),_0x495002);}};exports[_0xb50a('0x18')]=function(_0x357843){try{if(!_[_0xb50a('0x19')](queues[_0x357843['uniqueid']])){utils[_0xb50a('0xf')](util[_0xb50a('0x10')](_0xb50a('0x1a'),_0x357843[_0xb50a('0x12')]),_0x357843);if(queues[_0x357843[_0xb50a('0x12')]][_0xb50a('0x1b')]){if(!queues[_0x357843[_0xb50a('0x12')]][_0xb50a('0x1c')]&&!queues[_0x357843['uniqueid']][_0xb50a('0x1d')]){queues[_0x357843[_0xb50a('0x12')]][_0xb50a('0x1e')]=!![];queues[_0x357843[_0xb50a('0x12')]][_0xb50a('0x1f')]=utils[_0xb50a('0x16')]();queues[_0x357843[_0xb50a('0x12')]][_0xb50a('0x6')]=_0xb50a('0x20');}utils['info'](util['format'](_0xb50a('0x21'),_0x357843[_0xb50a('0x12')],queues[_0x357843[_0xb50a('0x12')]][_0xb50a('0x22')],queues[_0x357843[_0xb50a('0x12')]]['queuecallerexitreason']));writeDB(queues[_0x357843['uniqueid']]);}else if(queues[_0x357843[_0xb50a('0x12')]][_0xb50a('0xd')]){utils[_0xb50a('0x0')](util[_0xb50a('0x10')](_0xb50a('0x23'),_0x357843[_0xb50a('0x12')],queues[_0x357843['uniqueid']][_0xb50a('0x22')],queues[_0x357843[_0xb50a('0x12')]][_0xb50a('0xd')]));queues[queues[_0x357843[_0xb50a('0x12')]]['transfereduniqueid']]=queues[_0x357843[_0xb50a('0x12')]];queues[queues[_0x357843[_0xb50a('0x12')]]['transfereduniqueid']][_0xb50a('0x24')]=0x2;delete queues[_0x357843[_0xb50a('0x12')]];}}}catch(_0x156836){utils[_0xb50a('0x17')](util[_0xb50a('0x10')]('[%s][queues][hangup]',_0x357843[_0xb50a('0x12')]),_0x156836);}};exports[_0xb50a('0x25')]=function(_0x4c9c36){try{utils['debug'](util[_0xb50a('0x10')](_0xb50a('0x26'),_0x4c9c36[_0xb50a('0x12')]),_0x4c9c36);if(!_[_0xb50a('0x19')](_0x4c9c36['variable'][_0xb50a('0x27')])&&_0x4c9c36[_0xb50a('0x28')]['toUpperCase']()!==_0xb50a('0x29')){if(!_['isNil'](queues[_0x4c9c36['uniqueid']])){queues[_0x4c9c36[_0xb50a('0x12')]]['queuecallerabandon']=![];queues[_0x4c9c36[_0xb50a('0x12')]]['queuecallerabandonAt']=null;queues[_0x4c9c36[_0xb50a('0x12')]][_0xb50a('0x1d')]=!![];queues[_0x4c9c36[_0xb50a('0x12')]]['queuecallerexitAt']=utils['now']();queues[_0x4c9c36[_0xb50a('0x12')]][_0xb50a('0x6')]=_0x4c9c36['value'][_0xb50a('0x2a')]();utils['info'](util[_0xb50a('0x10')](_0xb50a('0x2b'),_0x4c9c36['uniqueid'],queues[_0x4c9c36[_0xb50a('0x12')]][_0xb50a('0x22')],_0x4c9c36[_0xb50a('0x28')],queues[_0x4c9c36[_0xb50a('0x12')]]['queuecallerexitreason']));writeDB(queues[_0x4c9c36[_0xb50a('0x12')]]);}}else if(!_['isNil'](_0x4c9c36[_0xb50a('0x2c')][_0xb50a('0x2d')])){if(!_[_0xb50a('0x19')](queues[_0x4c9c36['uniqueid']])&&!queues[_0x4c9c36[_0xb50a('0x12')]][_0xb50a('0x1c')]){queues[_0x4c9c36[_0xb50a('0x12')]][_0xb50a('0x1c')]=![];queues[_0x4c9c36[_0xb50a('0x12')]][_0xb50a('0x2e')]=null;queues[_0x4c9c36['uniqueid']][_0xb50a('0x1d')]=!![];queues[_0x4c9c36[_0xb50a('0x12')]][_0xb50a('0x2f')]=utils['now']();queues[_0x4c9c36[_0xb50a('0x12')]][_0xb50a('0x6')]=_0xb50a('0x30');utils[_0xb50a('0x0')](util[_0xb50a('0x10')](_0xb50a('0x31'),_0x4c9c36[_0xb50a('0x12')],queues[_0x4c9c36['uniqueid']]['name'],_0x4c9c36[_0xb50a('0x28')],queues[_0x4c9c36[_0xb50a('0x12')]][_0xb50a('0x6')]));}}}catch(_0x102b01){utils[_0xb50a('0x17')](util[_0xb50a('0x10')]('[%s][queues][varset]',_0x4c9c36[_0xb50a('0x12')]),_0x102b01);}};exports[_0xb50a('0x1c')]=function(_0x48176c){try{if(!_['isNil'](queues[_0x48176c['uniqueid']])){utils[_0xb50a('0xf')](util[_0xb50a('0x10')](_0xb50a('0x32'),_0x48176c[_0xb50a('0x12')]),_0x48176c);queues[_0x48176c[_0xb50a('0x12')]][_0xb50a('0x1d')]=![];queues[_0x48176c[_0xb50a('0x12')]][_0xb50a('0x2f')]=null;queues[_0x48176c['uniqueid']][_0xb50a('0x1c')]=!![];queues[_0x48176c[_0xb50a('0x12')]][_0xb50a('0x2e')]=utils[_0xb50a('0x16')]();queues[_0x48176c[_0xb50a('0x12')]][_0xb50a('0x6')]='ABANDONED';utils[_0xb50a('0x0')](util[_0xb50a('0x10')](_0xb50a('0x33'),_0x48176c[_0xb50a('0x12')],queues[_0x48176c[_0xb50a('0x12')]][_0xb50a('0x22')],queues[_0x48176c[_0xb50a('0x12')]][_0xb50a('0x6')]));}}catch(_0x3e844b){utils['error'](util[_0xb50a('0x10')](_0xb50a('0x32'),_0x48176c['uniqueid']),_0x3e844b);}};exports[_0xb50a('0x34')]=function(_0x204455){try{if(!_[_0xb50a('0x19')](queues[_0x204455['uniqueid']])){utils[_0xb50a('0xf')](util[_0xb50a('0x10')]('[%s][queues][queuecallerleave]',_0x204455['uniqueid']),_0x204455);utils[_0xb50a('0x0')](util[_0xb50a('0x10')](_0xb50a('0x35'),_0x204455[_0xb50a('0x12')],queues[_0x204455['uniqueid']]['name'],_0x204455['connectedlinenum'],_0x204455[_0xb50a('0x36')]));queues[_0x204455['uniqueid']][_0xb50a('0x34')]=!![];queues[_0x204455['uniqueid']][_0xb50a('0x1b')]=utils[_0xb50a('0x16')]();queues[_0x204455['uniqueid']][_0xb50a('0x37')]=utils[_0xb50a('0x38')](queues[_0x204455[_0xb50a('0x12')]]['queuecallerleaveAt'],queues[_0x204455[_0xb50a('0x12')]][_0xb50a('0x39')]);queues[_0x204455[_0xb50a('0x12')]][_0xb50a('0x14')]=_0x204455['position'];queues[_0x204455[_0xb50a('0x12')]][_0xb50a('0x3a')]=_0x204455['count'];queues[_0x204455['uniqueid']][_0xb50a('0x3b')]=_0x204455[_0xb50a('0x3b')];queues[_0x204455['uniqueid']][_0xb50a('0x36')]=_0x204455[_0xb50a('0x36')];}}catch(_0x8cd1ff){utils['error'](util[_0xb50a('0x10')](_0xb50a('0x3c'),_0x204455[_0xb50a('0x12')]),_0x8cd1ff);}};exports[_0xb50a('0x3d')]=function(_0x357cd7){try{if(!_[_0xb50a('0x19')](queues[_0x357cd7[_0xb50a('0x12')]])){utils[_0xb50a('0xf')](util['format'](_0xb50a('0x3e'),_0x357cd7[_0xb50a('0x12')]),_0x357cd7);utils['info'](util[_0xb50a('0x10')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x357cd7[_0xb50a('0x12')],queues[_0x357cd7[_0xb50a('0x12')]][_0xb50a('0x22')],_0x357cd7[_0xb50a('0x3f')],_0x357cd7['destaccountcode']));queues[_0x357cd7[_0xb50a('0x12')]]['queuecallerabandon']=![];queues[_0x357cd7[_0xb50a('0x12')]][_0xb50a('0x1c')]=![];queues[_0x357cd7['uniqueid']][_0xb50a('0x2e')]=null;queues[_0x357cd7['uniqueid']][_0xb50a('0x1d')]=![];queues[_0x357cd7[_0xb50a('0x12')]]['queuecallerexitreason']=null;queues[_0x357cd7[_0xb50a('0x12')]][_0xb50a('0x2f')]=null;queues[_0x357cd7[_0xb50a('0x12')]]['assigned']=!![];queues[_0x357cd7['uniqueid']][_0xb50a('0x5')]=_0x357cd7[_0xb50a('0x40')];queues[_0x357cd7[_0xb50a('0x12')]][_0xb50a('0x3')]=_0x357cd7[_0xb50a('0x3f')];}}catch(_0x36439e){utils[_0xb50a('0x17')](util[_0xb50a('0x10')](_0xb50a('0x3e'),_0x357cd7[_0xb50a('0x12')]),_0x36439e);}};exports[_0xb50a('0x41')]=function(_0x32dee8){try{if(!_[_0xb50a('0x19')](queues[_0x32dee8[_0xb50a('0x12')]])){if(queues[_0x32dee8[_0xb50a('0x12')]][_0xb50a('0x1b')]){utils['debug'](util[_0xb50a('0x10')]('[%s][queues][agentcomplete]',_0x32dee8[_0xb50a('0x12')]),_0x32dee8);queues[_0x32dee8['uniqueid']][_0xb50a('0x1c')]=![];queues[_0x32dee8['uniqueid']][_0xb50a('0x1c')]=![];queues[_0x32dee8[_0xb50a('0x12')]][_0xb50a('0x2e')]=null;queues[_0x32dee8[_0xb50a('0x12')]][_0xb50a('0x1d')]=![];queues[_0x32dee8['uniqueid']][_0xb50a('0x2f')]=null;queues[_0x32dee8['uniqueid']][_0xb50a('0x42')]=!![];queues[_0x32dee8['uniqueid']]['lastAssignedTo']=_0x32dee8[_0xb50a('0x3f')];queues[_0x32dee8['uniqueid']][_0xb50a('0x1e')]=!![];queues[_0x32dee8['uniqueid']][_0xb50a('0x1f')]=utils[_0xb50a('0x16')]();if(_0x32dee8[_0xb50a('0x43')]==_0xb50a('0x44')){if(!queues[_0x32dee8[_0xb50a('0x12')]]['transfer']){queues[_0x32dee8[_0xb50a('0x12')]][_0xb50a('0x6')]=_0xb50a('0x45');}}else{queues[_0x32dee8[_0xb50a('0x12')]][_0xb50a('0x6')]=_0xb50a('0x46')+_0x32dee8[_0xb50a('0x43')][_0xb50a('0x2a')]();}utils[_0xb50a('0x0')](util[_0xb50a('0x10')](_0xb50a('0x47'),_0x32dee8[_0xb50a('0x12')],queues[_0x32dee8[_0xb50a('0x12')]][_0xb50a('0x22')],_0x32dee8[_0xb50a('0x3f')],queues[_0x32dee8[_0xb50a('0x12')]][_0xb50a('0x6')]));writeDB(queues[_0x32dee8['uniqueid']]);}}}catch(_0x125eee){utils[_0xb50a('0x17')](util[_0xb50a('0x10')](_0xb50a('0x48'),_0x32dee8[_0xb50a('0x12')]),_0x125eee);}};exports[_0xb50a('0x49')]=function(_0x2d79e2){try{if(!_[_0xb50a('0x19')](queues[_0x2d79e2[_0xb50a('0x4a')]])){utils[_0xb50a('0xf')](util['format'](_0xb50a('0x4b'),_0x2d79e2[_0xb50a('0x12')]),_0x2d79e2);queues[_0x2d79e2[_0xb50a('0x4a')]][_0xb50a('0x44')]=!![];queues[_0x2d79e2[_0xb50a('0x4a')]][_0xb50a('0x4c')]=_0xb50a('0x4d');queues[_0x2d79e2[_0xb50a('0x4a')]]['transferexten']=_0x2d79e2[_0xb50a('0x4e')];queues[_0x2d79e2[_0xb50a('0x4a')]][_0xb50a('0x4f')]=_0x2d79e2[_0xb50a('0x4a')];queues[_0x2d79e2[_0xb50a('0x4a')]]['queuecallerexitreason']='BLINDTRANSFER';utils[_0xb50a('0x0')](util['format'](_0xb50a('0x50'),_0x2d79e2[_0xb50a('0x12')],queues[_0x2d79e2[_0xb50a('0x4a')]][_0xb50a('0x22')],_0x2d79e2[_0xb50a('0x4a')],_0x2d79e2[_0xb50a('0x4e')]));}}catch(_0x5b7265){utils['error'](util[_0xb50a('0x10')](_0xb50a('0x4b'),_0x2d79e2[_0xb50a('0x12')]),_0x5b7265);}};exports[_0xb50a('0x51')]=function(_0x3ea622){try{utils[_0xb50a('0xf')](util['format'](_0xb50a('0x52'),_0x3ea622['origtransfereruniqueid']),_0x3ea622);if(_0x3ea622[_0xb50a('0x53')]==_0x3ea622[_0xb50a('0x54')]){if(!_[_0xb50a('0x19')](queues[_0x3ea622[_0xb50a('0x55')]])){utils[_0xb50a('0x0')](util[_0xb50a('0x10')](_0xb50a('0x56'),_0x3ea622['origtransfereruniqueid'],queues[_0x3ea622[_0xb50a('0x55')]][_0xb50a('0x22')],_0x3ea622[_0xb50a('0x57')]));queues[_0x3ea622[_0xb50a('0x55')]][_0xb50a('0x44')]=!![];queues[_0x3ea622[_0xb50a('0x55')]][_0xb50a('0x4c')]=_0xb50a('0x58');queues[_0x3ea622['secondtransfererlinkedid']]['transferexten']=_0x3ea622[_0xb50a('0x57')];queues[_0x3ea622[_0xb50a('0x55')]][_0xb50a('0x4f')]=_0x3ea622[_0xb50a('0x53')];queues[_0x3ea622[_0xb50a('0x55')]][_0xb50a('0x6')]=_0xb50a('0x59');}if(!_[_0xb50a('0x19')](queues[_0x3ea622[_0xb50a('0x54')]])){if(_0x3ea622[_0xb50a('0x5a')]&&queues[_0x3ea622[_0xb50a('0x5a')]]){queues[_0x3ea622[_0xb50a('0x5a')]][_0xb50a('0x24')]=0x1;queues[_0x3ea622['transfereeuniqueid']]=_[_0xb50a('0x5b')](queues[_0x3ea622[_0xb50a('0x5a')]]);queues[_0x3ea622[_0xb50a('0x4a')]][_0xb50a('0xd')]=_0x3ea622[_0xb50a('0x5c')];queues[_0x3ea622[_0xb50a('0x4a')]][_0xb50a('0x24')]=0x2;queues[_0x3ea622['transfereeuniqueid']][_0xb50a('0x4')]=queues[_0x3ea622[_0xb50a('0x55')]][_0xb50a('0x4')];queues[_0x3ea622[_0xb50a('0x4a')]][_0xb50a('0x5d')]=queues[_0x3ea622[_0xb50a('0x55')]][_0xb50a('0x5d')];queues[_0x3ea622[_0xb50a('0x4a')]][_0xb50a('0x39')]=utils[_0xb50a('0x16')]();queues[_0x3ea622[_0xb50a('0x4a')]][_0xb50a('0x1b')]=utils['now']();queues[_0x3ea622[_0xb50a('0x4a')]][_0xb50a('0x37')]=0x0;queues[_0x3ea622['transfereeuniqueid']]['mohtime']=0x0;utils[_0xb50a('0x0')](util[_0xb50a('0x10')](_0xb50a('0x5e'),_0x3ea622[_0xb50a('0x53')],queues[_0x3ea622[_0xb50a('0x4a')]]['name'],queues[_0x3ea622[_0xb50a('0x4a')]]['calleridnum'],queues[_0x3ea622[_0xb50a('0x4a')]][_0xb50a('0x5d')]));}else{utils[_0xb50a('0x0')](util[_0xb50a('0x10')](_0xb50a('0x5f'),_0x3ea622[_0xb50a('0x53')],queues[_0x3ea622['origtransfererlinkedid']][_0xb50a('0x22')],_0x3ea622[_0xb50a('0x55')]));queues[_0x3ea622['origtransfererlinkedid']]['transfereduniqueid']=_0x3ea622[_0xb50a('0x55')];}}}else if(_0x3ea622['secondtransfereruniqueid']==_0x3ea622['secondtransfererlinkedid']){if(!_[_0xb50a('0x19')](queues[_0x3ea622['origtransfererlinkedid']])){utils['info'](util[_0xb50a('0x10')](_0xb50a('0x60'),_0x3ea622['origtransfereruniqueid'],queues[_0x3ea622['origtransfererlinkedid']]['name'],_0x3ea622['secondtransfereruniqueid'],_0x3ea622[_0xb50a('0x61')]));queues[_0x3ea622[_0xb50a('0x54')]][_0xb50a('0x44')]=!![];queues[_0x3ea622[_0xb50a('0x54')]][_0xb50a('0x4c')]=_0xb50a('0x58');queues[_0x3ea622[_0xb50a('0x54')]][_0xb50a('0x62')]=_0x3ea622[_0xb50a('0x61')];queues[_0x3ea622[_0xb50a('0x54')]][_0xb50a('0x4f')]=_0x3ea622[_0xb50a('0x63')];queues[_0x3ea622['origtransfererlinkedid']][_0xb50a('0x6')]=_0xb50a('0x59');}if(!_[_0xb50a('0x19')](queues[_0x3ea622[_0xb50a('0x55')]])){if(_0x3ea622[_0xb50a('0x64')]&&queues[_0x3ea622['transfertargetlinkedid']]){queues[_0x3ea622[_0xb50a('0x64')]][_0xb50a('0x24')]=0x1;queues[_0x3ea622[_0xb50a('0x5c')]]=_[_0xb50a('0x5b')](queues[_0x3ea622[_0xb50a('0x64')]]);queues[_0x3ea622[_0xb50a('0x5c')]]['transfereduniqueid']=_0x3ea622[_0xb50a('0x5c')];queues[_0x3ea622['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x3ea622['transfertargetuniqueid']][_0xb50a('0x4')]=queues[_0x3ea622[_0xb50a('0x54')]][_0xb50a('0x4')];queues[_0x3ea622[_0xb50a('0x5c')]][_0xb50a('0x5d')]=queues[_0x3ea622[_0xb50a('0x54')]][_0xb50a('0x5d')];queues[_0x3ea622[_0xb50a('0x5c')]]['queuecallerjoinAt']=utils[_0xb50a('0x16')]();queues[_0x3ea622[_0xb50a('0x5c')]][_0xb50a('0x1b')]=utils[_0xb50a('0x16')]();queues[_0x3ea622[_0xb50a('0x5c')]][_0xb50a('0x37')]=0x0;queues[_0x3ea622['transfertargetuniqueid']][_0xb50a('0x65')]=0x0;utils[_0xb50a('0x0')](util[_0xb50a('0x10')](_0xb50a('0x66'),_0x3ea622[_0xb50a('0x53')],queues[_0x3ea622['transfertargetuniqueid']][_0xb50a('0x22')],queues[_0x3ea622[_0xb50a('0x5c')]][_0xb50a('0xd')],queues[_0x3ea622[_0xb50a('0x5c')]][_0xb50a('0x4')],queues[_0x3ea622[_0xb50a('0x5c')]]['calleridname']));}else{utils[_0xb50a('0x0')](util['format'](_0xb50a('0x5f'),_0x3ea622['origtransfereruniqueid'],queues[_0x3ea622['secondtransfererlinkedid']]['name'],_0x3ea622[_0xb50a('0x54')]));queues[_0x3ea622[_0xb50a('0x55')]][_0xb50a('0xd')]=_0x3ea622['origtransfererlinkedid'];}}}}catch(_0x4eacb5){utils[_0xb50a('0x17')](util['format'](_0xb50a('0x52'),_0x3ea622[_0xb50a('0x53')]),_0x4eacb5);}};exports['musiconholdstart']=function(_0x583869){try{if(!_[_0xb50a('0x19')](queues[_0x583869[_0xb50a('0x12')]])){utils[_0xb50a('0xf')](util['format'](_0xb50a('0x67'),_0x583869[_0xb50a('0x12')]),_0x583869);queues[_0x583869[_0xb50a('0x12')]][_0xb50a('0x68')]=utils[_0xb50a('0x16')]();utils[_0xb50a('0x0')](util[_0xb50a('0x10')](_0xb50a('0x69'),_0x583869[_0xb50a('0x12')],queues[_0x583869[_0xb50a('0x12')]][_0xb50a('0x22')],queues[_0x583869[_0xb50a('0x12')]][_0xb50a('0x68')]));}}catch(_0x3ac53e){utils['error'](util[_0xb50a('0x10')](_0xb50a('0x67'),_0x583869['uniqueid']),_0x3ac53e);}};exports['musiconholdstop']=function(_0x14e987){try{if(!_[_0xb50a('0x19')](queues[_0x14e987[_0xb50a('0x12')]])){if(!_[_0xb50a('0x19')](queues[_0x14e987[_0xb50a('0x12')]][_0xb50a('0x68')])){utils[_0xb50a('0xf')](util['format'](_0xb50a('0x6a'),_0x14e987[_0xb50a('0x12')]),_0x14e987);queues[_0x14e987['uniqueid']][_0xb50a('0x65')]+=utils[_0xb50a('0x38')](utils[_0xb50a('0x16')](),queues[_0x14e987['uniqueid']]['musiconholdstartAt']);utils['info'](util[_0xb50a('0x10')](_0xb50a('0x6b'),_0x14e987['uniqueid'],queues[_0x14e987['uniqueid']][_0xb50a('0x22')],queues[_0x14e987[_0xb50a('0x12')]]['mohtime']));delete queues[_0x14e987['uniqueid']][_0xb50a('0x68')];}}}catch(_0x399007){utils[_0xb50a('0x17')](util[_0xb50a('0x10')]('[%s][queues][musiconholdstop]',_0x14e987['uniqueid']),_0x399007);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index e337250..2d4c00a 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 _0x77f0=['[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','info','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','newstate','debug','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','endsWith','value','replace','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x77f0,0x198));var _0x077f=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x77f0[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x077f('0x0'));var util=require(_0x077f('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x2c15ad){utils[_0x077f('0x2')](util[_0x077f('0x3')](_0x077f('0x4'),_0x2c15ad[_0x077f('0x5')]));if(_0x2c15ad['accountcode']){utils[_0x077f('0x6')](_0x2c15ad[_0x077f('0x7')])[_0x077f('0x8')](function(_0x322c43){if(_0x322c43){_0x2c15ad[_0x077f('0x9')]=_0x322c43[_0x077f('0xa')];_0x2c15ad[_0x077f('0xb')]=_0x322c43['id'];}utils[_0x077f('0xc')](_0x077f('0xd'),_0x2c15ad);});}else{utils[_0x077f('0xc')](_0x077f('0xd'),_0x2c15ad);}}exports['newchannel']=function(_0x31a224){try{utils['debug'](util['format']('[%s][recordings][newchannel]',_0x31a224['uniqueid']),_0x31a224);if(_0x31a224[_0x077f('0x5')]==_0x31a224[_0x077f('0xe')]){utils['info'](util[_0x077f('0x3')](_0x077f('0xf'),_0x31a224[_0x077f('0x5')],_0x31a224['context'],_0x31a224[_0x077f('0x10')]));recordings[_0x31a224[_0x077f('0x5')]]={'uniqueid':_0x31a224[_0x077f('0x5')],'accountcode':_0x31a224['accountcode'],'exten':_0x31a224[_0x077f('0x10')],'context':_0x31a224[_0x077f('0x11')],'channel':_0x31a224[_0x077f('0x12')],'monitors':[]};}}catch(_0x7deb73){utils[_0x077f('0x13')](util[_0x077f('0x3')]('[%s][recordings][newchannel]',_0x31a224[_0x077f('0x5')]),_0x7deb73);}};exports[_0x077f('0x14')]=function(_0x11514b){try{utils[_0x077f('0x15')](util[_0x077f('0x3')]('[%s][recordings][newstate]',_0x11514b[_0x077f('0x5')]),_0x11514b);if(!_[_0x077f('0x16')](recordings[_0x11514b['uniqueid']])&&_0x11514b[_0x077f('0x17')]==0x6){utils[_0x077f('0x2')](util[_0x077f('0x3')](_0x077f('0x18'),_0x11514b['uniqueid'],_0x11514b[_0x077f('0x11')],_0x11514b[_0x077f('0x12')]));}else if(!_['isNil'](recordings[_0x11514b[_0x077f('0xe')]])&&_0x11514b[_0x077f('0x17')]==0x6&&_0x11514b['context']!=_0x077f('0x19')){utils[_0x077f('0x2')](util[_0x077f('0x3')](_0x077f('0x1a'),_0x11514b['uniqueid'],_0x11514b[_0x077f('0xe')],_0x11514b[_0x077f('0x11')],_0x11514b[_0x077f('0x12')]));recordings[_0x11514b['linkedid']][_0x077f('0x7')]=_0x11514b[_0x077f('0x7')];}}catch(_0x3465ba){utils[_0x077f('0x13')](util[_0x077f('0x3')](_0x077f('0x1b'),_0x11514b[_0x077f('0x5')]),_0x3465ba);}};exports[_0x077f('0x1c')]=function(_0x3f9f17){try{if(!_[_0x077f('0x16')](_0x3f9f17['variable'])&&!_[_0x077f('0x16')](_0x3f9f17[_0x077f('0x1d')][_0x077f('0x1e')])){utils['debug'](util['format']('[%s][recordings][varset]',_0x3f9f17['uniqueid']),_0x3f9f17);utils[_0x077f('0x2')](util[_0x077f('0x3')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x3f9f17['uniqueid'],_0x3f9f17[_0x077f('0x1d')],_0x3f9f17['value']));if(_[_0x077f('0x1f')](_0x3f9f17[_0x077f('0x20')],'.wav49')){_0x3f9f17[_0x077f('0x20')]=_0x3f9f17[_0x077f('0x20')][_0x077f('0x21')]('.wav49','.WAV');}if(recordings[_0x3f9f17['linkedid']]){var _0x5d90ae=_[_0x077f('0x22')](recordings[_0x3f9f17['linkedid']][_0x077f('0x23')],{'value':_0x3f9f17[_0x077f('0x20')]});if(_[_0x077f('0x16')](_0x5d90ae)){recordings[_0x3f9f17[_0x077f('0xe')]][_0x077f('0x23')][_0x077f('0x24')]({'value':_0x3f9f17[_0x077f('0x20')]});}}}}catch(_0x2a4ac0){utils['error'](util[_0x077f('0x3')](_0x077f('0x25'),_0x3f9f17['uniqueid']),_0x2a4ac0);}};exports[_0x077f('0x26')]=function(_0x442496){try{if(!_[_0x077f('0x16')](recordings[_0x442496['uniqueid']])){utils[_0x077f('0x15')](util[_0x077f('0x3')](_0x077f('0x27'),_0x442496[_0x077f('0x5')]),_0x442496);utils[_0x077f('0x2')](util['format'](_0x077f('0x28'),_0x442496[_0x077f('0x5')],_0x442496[_0x077f('0x29')],_0x442496['calleridname'],_0x442496[_0x077f('0x2a')]));recordings[_0x442496[_0x077f('0x5')]][_0x077f('0x29')]=_0x442496[_0x077f('0x29')];recordings[_0x442496[_0x077f('0x5')]][_0x077f('0x2b')]=_0x442496[_0x077f('0x2b')];recordings[_0x442496[_0x077f('0x5')]][_0x077f('0x2c')]=_0x442496['connectedlinenum'];recordings[_0x442496[_0x077f('0x5')]][_0x077f('0x2d')]=_0x442496['connectedlinename'];if(recordings[_0x442496[_0x077f('0x5')]][_0x077f('0x2e')]=='outbound'&&recordings[_0x442496[_0x077f('0x5')]]['accountcode']){recordings[_0x442496[_0x077f('0x5')]]['connectedlinenum']=recordings[_0x442496[_0x077f('0x5')]]['accountcode'];recordings[_0x442496[_0x077f('0x5')]][_0x077f('0x2d')]='';}recordings[_0x442496[_0x077f('0x5')]]['monitors'][_0x077f('0x2f')](function(_0xb2f4ae){var _0x311f88=_[_0x077f('0x30')](recordings[_0x442496['uniqueid']]);_0x311f88[_0x077f('0x20')]=_0xb2f4ae[_0x077f('0x20')];writeDB(_0x311f88);});delete recordings[_0x442496[_0x077f('0x5')]];}}catch(_0x559953){utils[_0x077f('0x13')](util['format'](_0x077f('0x27'),_0x442496[_0x077f('0x5')]),_0x559953);}};exports[_0x077f('0x31')]=function(_0x1aa367){try{if(!_['isNil'](recordings[_0x1aa367[_0x077f('0x5')]])){utils['debug'](util[_0x077f('0x3')](_0x077f('0x32'),_0x1aa367[_0x077f('0x5')]),_0x1aa367);utils['info'](util[_0x077f('0x3')](_0x077f('0x33'),_0x1aa367[_0x077f('0x5')],_0x1aa367[_0x077f('0x34')],_0x1aa367[_0x077f('0x35')]));if(_0x1aa367[_0x077f('0x34')]['toLowerCase']()=='set'&&_[_0x077f('0x36')](_0x1aa367['appdata'][_0x077f('0x37')](),_0x077f('0x38'))){var _0x34008c=_0x1aa367[_0x077f('0x35')][_0x077f('0x39')]('=');var _0x18fbae=_0x34008c[0x0][_0x077f('0x3a')](_0x34008c[0x0][_0x077f('0x3b')]('(')+0x1,_0x34008c[0x0][_0x077f('0x3b')](')'));var _0x2dc545=_0x34008c[0x1];recordings[_0x1aa367['uniqueid']][_0x18fbae]=_0x2dc545;}}}catch(_0x226bfa){utils[_0x077f('0x13')](util[_0x077f('0x3')](_0x077f('0x32'),_0x1aa367['uniqueid']),_0x226bfa);}};exports[_0x077f('0x3c')]=function(_0x357b86){try{if(!_['isNil'](recordings[_0x357b86[_0x077f('0x5')]])){utils[_0x077f('0x15')](util[_0x077f('0x3')](_0x077f('0x3d'),_0x357b86[_0x077f('0x5')]),_0x357b86);utils[_0x077f('0x2')](util[_0x077f('0x3')](_0x077f('0x3e'),_0x357b86[_0x077f('0x5')],_0x357b86[_0x077f('0x3f')]));recordings[_0x357b86[_0x077f('0x5')]][_0x077f('0x3f')]=_0x357b86[_0x077f('0x3f')];}}catch(_0x31735e){utils[_0x077f('0x13')](util['format']('[%s][recordings][queuecallerjoin]',_0x357b86[_0x077f('0x5')]),_0x31735e);}}; \ No newline at end of file +var _0x3e68=['name','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','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','endsWith','value','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','cdr','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','uniqueid','accountcode','then','membername'];(function(_0x4b3172,_0x227392){var _0x1f5fd0=function(_0x47ae9f){while(--_0x47ae9f){_0x4b3172['push'](_0x4b3172['shift']());}};_0x1f5fd0(++_0x227392);}(_0x3e68,0x165));var _0x83e6=function(_0x5b0712,_0xee29bf){_0x5b0712=_0x5b0712-0x0;var _0x1ae2df=_0x3e68[_0x5b0712];return _0x1ae2df;};'use strict';var _=require(_0x83e6('0x0'));var util=require(_0x83e6('0x1'));var utils=require(_0x83e6('0x2'));var recordings={};function writeDB(_0x1d6a64){utils[_0x83e6('0x3')](util[_0x83e6('0x4')]('[%s][recordings][writeDB]',_0x1d6a64[_0x83e6('0x5')]));if(_0x1d6a64[_0x83e6('0x6')]){utils['getUserByInternal'](_0x1d6a64['accountcode'])[_0x83e6('0x7')](function(_0x506f51){if(_0x506f51){_0x1d6a64[_0x83e6('0x8')]=_0x506f51[_0x83e6('0x9')];_0x1d6a64[_0x83e6('0xa')]=_0x506f51['id'];}utils[_0x83e6('0xb')](_0x83e6('0xc'),_0x1d6a64);});}else{utils[_0x83e6('0xb')](_0x83e6('0xc'),_0x1d6a64);}}exports['newchannel']=function(_0x2ab2f0){try{utils[_0x83e6('0xd')](util[_0x83e6('0x4')](_0x83e6('0xe'),_0x2ab2f0[_0x83e6('0x5')]),_0x2ab2f0);if(_0x2ab2f0[_0x83e6('0x5')]==_0x2ab2f0[_0x83e6('0xf')]){utils[_0x83e6('0x3')](util['format'](_0x83e6('0x10'),_0x2ab2f0['uniqueid'],_0x2ab2f0[_0x83e6('0x11')],_0x2ab2f0[_0x83e6('0x12')]));recordings[_0x2ab2f0[_0x83e6('0x5')]]={'uniqueid':_0x2ab2f0[_0x83e6('0x5')],'accountcode':_0x2ab2f0[_0x83e6('0x6')],'exten':_0x2ab2f0[_0x83e6('0x12')],'context':_0x2ab2f0['context'],'channel':_0x2ab2f0[_0x83e6('0x13')],'monitors':[]};}}catch(_0xd67331){utils[_0x83e6('0x14')](util[_0x83e6('0x4')](_0x83e6('0xe'),_0x2ab2f0[_0x83e6('0x5')]),_0xd67331);}};exports[_0x83e6('0x15')]=function(_0x28bed4){try{utils['debug'](util[_0x83e6('0x4')](_0x83e6('0x16'),_0x28bed4['uniqueid']),_0x28bed4);if(!_[_0x83e6('0x17')](recordings[_0x28bed4['uniqueid']])&&_0x28bed4[_0x83e6('0x18')]==0x6){utils[_0x83e6('0x3')](util[_0x83e6('0x4')](_0x83e6('0x19'),_0x28bed4[_0x83e6('0x5')],_0x28bed4['context'],_0x28bed4[_0x83e6('0x13')]));}else if(!_[_0x83e6('0x17')](recordings[_0x28bed4[_0x83e6('0xf')]])&&_0x28bed4[_0x83e6('0x18')]==0x6&&_0x28bed4['context']!=_0x83e6('0x1a')){utils[_0x83e6('0x3')](util[_0x83e6('0x4')](_0x83e6('0x1b'),_0x28bed4['uniqueid'],_0x28bed4[_0x83e6('0xf')],_0x28bed4[_0x83e6('0x11')],_0x28bed4[_0x83e6('0x13')]));recordings[_0x28bed4[_0x83e6('0xf')]][_0x83e6('0x6')]=_0x28bed4[_0x83e6('0x6')];}}catch(_0xec16a6){utils[_0x83e6('0x14')](util[_0x83e6('0x4')](_0x83e6('0x16'),_0x28bed4[_0x83e6('0x5')]),_0xec16a6);}};exports[_0x83e6('0x1c')]=function(_0x32313a){try{if(!_[_0x83e6('0x17')](_0x32313a[_0x83e6('0x1d')])&&!_['isNil'](_0x32313a[_0x83e6('0x1d')][_0x83e6('0x1e')])){utils[_0x83e6('0xd')](util[_0x83e6('0x4')](_0x83e6('0x1f'),_0x32313a[_0x83e6('0x5')]),_0x32313a);utils['info'](util[_0x83e6('0x4')](_0x83e6('0x20'),_0x32313a[_0x83e6('0x5')],_0x32313a[_0x83e6('0x1d')],_0x32313a['value']));if(_[_0x83e6('0x21')](_0x32313a[_0x83e6('0x22')],'.wav49')){_0x32313a[_0x83e6('0x22')]=_0x32313a[_0x83e6('0x22')][_0x83e6('0x23')]('.wav49',_0x83e6('0x24'));}if(recordings[_0x32313a['linkedid']]){var _0x24b4a0=_[_0x83e6('0x25')](recordings[_0x32313a['linkedid']][_0x83e6('0x26')],{'value':_0x32313a[_0x83e6('0x22')]});if(_[_0x83e6('0x17')](_0x24b4a0)){recordings[_0x32313a['linkedid']][_0x83e6('0x26')][_0x83e6('0x27')]({'value':_0x32313a[_0x83e6('0x22')]});}}}}catch(_0x330c5f){utils[_0x83e6('0x14')](util[_0x83e6('0x4')](_0x83e6('0x1f'),_0x32313a[_0x83e6('0x5')]),_0x330c5f);}};exports[_0x83e6('0x28')]=function(_0x487468){try{if(!_[_0x83e6('0x17')](recordings[_0x487468[_0x83e6('0x5')]])){utils[_0x83e6('0xd')](util['format'](_0x83e6('0x29'),_0x487468['uniqueid']),_0x487468);utils[_0x83e6('0x3')](util[_0x83e6('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x487468[_0x83e6('0x5')],_0x487468['calleridnum'],_0x487468['calleridname'],_0x487468['cause-txt']));recordings[_0x487468[_0x83e6('0x5')]]['calleridnum']=_0x487468[_0x83e6('0x2a')];recordings[_0x487468['uniqueid']][_0x83e6('0x2b')]=_0x487468['calleridname'];recordings[_0x487468[_0x83e6('0x5')]][_0x83e6('0x2c')]=_0x487468['connectedlinenum'];recordings[_0x487468['uniqueid']][_0x83e6('0x2d')]=_0x487468[_0x83e6('0x2d')];if(recordings[_0x487468[_0x83e6('0x5')]][_0x83e6('0x2e')]=='outbound'&&recordings[_0x487468[_0x83e6('0x5')]][_0x83e6('0x6')]){recordings[_0x487468['uniqueid']][_0x83e6('0x2c')]=recordings[_0x487468[_0x83e6('0x5')]][_0x83e6('0x6')];recordings[_0x487468['uniqueid']][_0x83e6('0x2d')]='';}recordings[_0x487468[_0x83e6('0x5')]][_0x83e6('0x26')][_0x83e6('0x2f')](function(_0xe4dcc){var _0x52b340=_[_0x83e6('0x30')](recordings[_0x487468[_0x83e6('0x5')]]);_0x52b340[_0x83e6('0x22')]=_0xe4dcc[_0x83e6('0x22')];writeDB(_0x52b340);});delete recordings[_0x487468[_0x83e6('0x5')]];}}catch(_0x25c192){utils['error'](util['format'](_0x83e6('0x29'),_0x487468[_0x83e6('0x5')]),_0x25c192);}};exports['newexten']=function(_0x3f8322){try{if(!_['isNil'](recordings[_0x3f8322[_0x83e6('0x5')]])){utils[_0x83e6('0xd')](util[_0x83e6('0x4')](_0x83e6('0x31'),_0x3f8322[_0x83e6('0x5')]),_0x3f8322);utils[_0x83e6('0x3')](util[_0x83e6('0x4')](_0x83e6('0x32'),_0x3f8322['uniqueid'],_0x3f8322[_0x83e6('0x33')],_0x3f8322[_0x83e6('0x34')]));if(_0x3f8322[_0x83e6('0x33')]['toLowerCase']()==_0x83e6('0x35')&&_[_0x83e6('0x36')](_0x3f8322[_0x83e6('0x34')]['toLowerCase'](),_0x83e6('0x37'))){var _0x41a3a2=_0x3f8322[_0x83e6('0x34')]['split']('=');var _0x2fe4fc=_0x41a3a2[0x0]['substring'](_0x41a3a2[0x0][_0x83e6('0x38')]('(')+0x1,_0x41a3a2[0x0][_0x83e6('0x38')](')'));var _0x50d087=_0x41a3a2[0x1];recordings[_0x3f8322['uniqueid']][_0x2fe4fc]=_0x50d087;}}}catch(_0x50790d){utils['error'](util[_0x83e6('0x4')](_0x83e6('0x31'),_0x3f8322['uniqueid']),_0x50790d);}};exports[_0x83e6('0x39')]=function(_0x595e75){try{if(!_['isNil'](recordings[_0x595e75[_0x83e6('0x5')]])){utils[_0x83e6('0xd')](util[_0x83e6('0x4')](_0x83e6('0x3a'),_0x595e75[_0x83e6('0x5')]),_0x595e75);utils[_0x83e6('0x3')](util['format'](_0x83e6('0x3b'),_0x595e75[_0x83e6('0x5')],_0x595e75[_0x83e6('0x3c')]));recordings[_0x595e75[_0x83e6('0x5')]]['queue']=_0x595e75[_0x83e6('0x3c')];}}catch(_0x30eff1){utils['error'](util['format']('[%s][recordings][queuecallerjoin]',_0x595e75[_0x83e6('0x5')]),_0x30eff1);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index e6cd4b6..248da6c 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 _0xddc9=['[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','blindtransfer','debug','[%s][transfers][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridname','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','error','[%s][transfers][attendedtransfer]','./utils','info','format'];(function(_0x5563ea,_0x1b65f3){var _0x345d9d=function(_0x1a4bc3){while(--_0x1a4bc3){_0x5563ea['push'](_0x5563ea['shift']());}};_0x345d9d(++_0x1b65f3);}(_0xddc9,0x89));var _0x9ddc=function(_0x444392,_0x40f7fc){_0x444392=_0x444392-0x0;var _0x4fbb68=_0xddc9[_0x444392];return _0x4fbb68;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x9ddc('0x0'));function writeDB(_0x374c45){utils[_0x9ddc('0x1')](util[_0x9ddc('0x2')](_0x9ddc('0x3'),_0x374c45[_0x9ddc('0x4')]===_0x9ddc('0x5')?_0x374c45[_0x9ddc('0x6')]:_0x374c45[_0x9ddc('0x7')],_0x374c45[_0x9ddc('0x4')]));utils['request']('CreateVoiceTransferReport',_0x374c45);}exports[_0x9ddc('0x8')]=function(_0x428d24){try{utils[_0x9ddc('0x9')](util[_0x9ddc('0x2')](_0x9ddc('0xa'),_0x428d24[_0x9ddc('0x7')]),_0x428d24);utils[_0x9ddc('0x1')](util['format']('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x428d24[_0x9ddc('0x7')],_0x428d24[_0x9ddc('0xb')],_0x428d24[_0x9ddc('0xc')],_0x428d24['transfereecalleridnum'],_0x428d24[_0x9ddc('0xd')]));_0x428d24[_0x9ddc('0x4')]='blind';writeDB(_0x428d24);}catch(_0x1c9594){utils['error'](util[_0x9ddc('0x2')](_0x9ddc('0xa'),_0x428d24[_0x9ddc('0x7')]),_0x1c9594);}};exports['attendedtransfer']=function(_0x519a60){try{utils[_0x9ddc('0x9')](util[_0x9ddc('0x2')]('[%s][transfers][attendedtransfer]',_0x519a60[_0x9ddc('0x6')]),_0x519a60);utils[_0x9ddc('0x1')](util[_0x9ddc('0x2')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x519a60[_0x9ddc('0x6')],_0x519a60[_0x9ddc('0xe')],_0x519a60[_0x9ddc('0xf')],_0x519a60[_0x9ddc('0x10')],_0x519a60['transfertargetcalleridname']));_0x519a60=_['assign'](_0x519a60,{'transfererchannel':_0x519a60[_0x9ddc('0x11')],'transferercalleridnum':_0x519a60[_0x9ddc('0xe')],'transferercalleridname':_0x519a60[_0x9ddc('0xf')],'transfererconnectedlinenum':_0x519a60[_0x9ddc('0x12')],'transfererconnectedlinename':_0x519a60[_0x9ddc('0x13')],'transfereraccountcode':_0x519a60[_0x9ddc('0x14')],'transferercontext':_0x519a60[_0x9ddc('0x15')],'transfererexten':_0x519a60[_0x9ddc('0x16')],'transfererlinkedid':_0x519a60[_0x9ddc('0x17')],'context':_0x519a60[_0x9ddc('0x18')],'extension':_0x519a60[_0x9ddc('0x19')],'type':_0x9ddc('0x5')});if(_[_0x9ddc('0x1a')](_0x519a60[_0x9ddc('0x1b')])){_0x519a60=_[_0x9ddc('0x1c')](_0x519a60,{'transfereechannel':_0x519a60[_0x9ddc('0x1d')],'transfereecalleridnum':_0x519a60[_0x9ddc('0x10')],'transfereecalleridname':_0x519a60['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x519a60['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x519a60[_0x9ddc('0x1e')],'transfereeaccountcode':_0x519a60['transfertargetaccountcode'],'transfereecontext':_0x519a60[_0x9ddc('0x1f')],'transfereeexten':_0x519a60['transfertargetexten'],'transfereelinkedid':_0x519a60[_0x9ddc('0x20')]});}writeDB(_0x519a60);}catch(_0xa298cf){utils[_0x9ddc('0x21')](util['format'](_0x9ddc('0x22'),_0x519a60[_0x9ddc('0x6')]),_0xa298cf);}}; \ No newline at end of file +var _0x8e35=['transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','attendedtransfer','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','attended','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename'];(function(_0x1b282e,_0x2da5c5){var _0x292eb3=function(_0x4b4061){while(--_0x4b4061){_0x1b282e['push'](_0x1b282e['shift']());}};_0x292eb3(++_0x2da5c5);}(_0x8e35,0x1f0));var _0x58e3=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x8e35[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x58e3('0x0'));var util=require(_0x58e3('0x1'));var utils=require(_0x58e3('0x2'));function writeDB(_0x3b89e2){utils['info'](util[_0x58e3('0x3')](_0x58e3('0x4'),_0x3b89e2[_0x58e3('0x5')]==='attended'?_0x3b89e2[_0x58e3('0x6')]:_0x3b89e2[_0x58e3('0x7')],_0x3b89e2[_0x58e3('0x5')]));utils[_0x58e3('0x8')](_0x58e3('0x9'),_0x3b89e2);}exports[_0x58e3('0xa')]=function(_0x224f18){try{utils[_0x58e3('0xb')](util['format'](_0x58e3('0xc'),_0x224f18['uniqueid']),_0x224f18);utils[_0x58e3('0xd')](util['format'](_0x58e3('0xe'),_0x224f18['uniqueid'],_0x224f18[_0x58e3('0xf')],_0x224f18[_0x58e3('0x10')],_0x224f18[_0x58e3('0x11')],_0x224f18[_0x58e3('0x12')]));_0x224f18[_0x58e3('0x5')]=_0x58e3('0x13');writeDB(_0x224f18);}catch(_0x3a562c){utils['error'](util['format'](_0x58e3('0xc'),_0x224f18[_0x58e3('0x7')]),_0x3a562c);}};exports[_0x58e3('0x14')]=function(_0x40f550){try{utils[_0x58e3('0xb')](util[_0x58e3('0x3')](_0x58e3('0x15'),_0x40f550[_0x58e3('0x6')]),_0x40f550);utils[_0x58e3('0xd')](util[_0x58e3('0x3')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x40f550[_0x58e3('0x6')],_0x40f550[_0x58e3('0x16')],_0x40f550[_0x58e3('0x17')],_0x40f550[_0x58e3('0x18')],_0x40f550[_0x58e3('0x19')]));_0x40f550=_['assign'](_0x40f550,{'transfererchannel':_0x40f550[_0x58e3('0x1a')],'transferercalleridnum':_0x40f550[_0x58e3('0x16')],'transferercalleridname':_0x40f550[_0x58e3('0x17')],'transfererconnectedlinenum':_0x40f550['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x40f550[_0x58e3('0x1b')],'transfereraccountcode':_0x40f550[_0x58e3('0x1c')],'transferercontext':_0x40f550['secondtransferercontext'],'transfererexten':_0x40f550[_0x58e3('0x1d')],'transfererlinkedid':_0x40f550[_0x58e3('0x1e')],'context':_0x40f550[_0x58e3('0x1f')],'extension':_0x40f550['origtransfererexten'],'type':_0x58e3('0x20')});if(_['isNil'](_0x40f550['transfereechannel'])){_0x40f550=_[_0x58e3('0x21')](_0x40f550,{'transfereechannel':_0x40f550[_0x58e3('0x22')],'transfereecalleridnum':_0x40f550[_0x58e3('0x18')],'transfereecalleridname':_0x40f550['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x40f550[_0x58e3('0x23')],'transfereeconnectedlinename':_0x40f550[_0x58e3('0x24')],'transfereeaccountcode':_0x40f550[_0x58e3('0x25')],'transfereecontext':_0x40f550['transfertargetcontext'],'transfereeexten':_0x40f550[_0x58e3('0x26')],'transfereelinkedid':_0x40f550[_0x58e3('0x27')]});}writeDB(_0x40f550);}catch(_0x395035){utils[_0x58e3('0x28')](util[_0x58e3('0x3')](_0x58e3('0x15'),_0x40f550[_0x58e3('0x6')]),_0x395035);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 2eb3956..52131c9 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 _0x0737=['then','[utils][request]\x20name:%s','catch','internal','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','../../config/logger','xdr','info','inspect','debug','error','request'];(function(_0x549284,_0x41b5e5){var _0x1e9824=function(_0x3b871a){while(--_0x3b871a){_0x549284['push'](_0x549284['shift']());}};_0x1e9824(++_0x41b5e5);}(_0x0737,0xfc));var _0x7073=function(_0x14be78,_0xbb2fed){_0x14be78=_0x14be78-0x0;var _0x13f890=_0x0737[_0x14be78];return _0x13f890;};'use strict';var BPromise=require(_0x7073('0x0'));var jayson=require(_0x7073('0x1'));var moment=require(_0x7073('0x2'));var util=require(_0x7073('0x3'));var client=jayson['client'][_0x7073('0x4')]({'port':0x2329});var logger=require(_0x7073('0x5'))(_0x7073('0x6'));exports[_0x7073('0x7')]=function(_0x4c71d6,_0x34da05){logger[_0x7073('0x7')](_0x4c71d6,_0x34da05?util[_0x7073('0x8')](_0x34da05,{'showHidden':![],'depth':null}):'');};exports[_0x7073('0x9')]=function(_0x27f3b0,_0x3e87a0){logger[_0x7073('0x9')](_0x27f3b0,_0x3e87a0?util[_0x7073('0x8')](_0x3e87a0,{'showHidden':![],'depth':null}):'');};exports[_0x7073('0xa')]=function(_0x5b3ece,_0x3bef23){logger[_0x7073('0xa')](_0x5b3ece,_0x3bef23?util[_0x7073('0x8')](_0x3bef23,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x854419,_0x1c660c){return client[_0x7073('0xb')](_0x854419,{'body':_0x1c660c})[_0x7073('0xc')](function(_0x47fd8f){logger[_0x7073('0x9')](_0x7073('0xd'),_0x854419,_0x47fd8f?util[_0x7073('0x8')](_0x47fd8f,{'showHidden':![],'depth':null}):'');})[_0x7073('0xe')](function(_0x414e7d){logger[_0x7073('0xa')](_0x7073('0xd'),_0x854419,_0x414e7d?util[_0x7073('0x8')](_0x414e7d,{'showHidden':![],'depth':null}):'');});};function getUser(_0x13d198){return client[_0x7073('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x7073('0xf'),'name','interface'],'where':_0x13d198,'limit':0x1}})['then'](function(_0x1895e3){logger[_0x7073('0x9')](_0x7073('0x10'),JSON[_0x7073('0x11')](_0x13d198),_0x1895e3?util['inspect'](_0x1895e3,{'showHidden':![],'depth':null}):'');return _0x1895e3[_0x7073('0x12')][_0x7073('0x13')]?_0x1895e3[_0x7073('0x12')][0x0]:null;});}exports[_0x7073('0x14')]=function(_0x1e4c3c){return new BPromise(function(_0x372554,_0x50ff69){if(_0x1e4c3c){return getUser({'internal':_0x1e4c3c})[_0x7073('0xc')](function(_0x2aa742){logger[_0x7073('0x7')](_0x7073('0x15'),_0x1e4c3c,_0x2aa742?_0x7073('0x16'):_0x7073('0x17'));return _0x372554(_0x2aa742);})[_0x7073('0xe')](function(_0x4fdfd0){logger[_0x7073('0xa')]('[utils][getUserByInternal]',_0x4fdfd0?util[_0x7073('0x8')](_0x4fdfd0,{'showHidden':![],'depth':null}):'');return _0x372554(null);});}return _0x372554(null);});};exports[_0x7073('0x18')]=function(_0x4f7616){return new BPromise(function(_0x43b7b0,_0x1217de){if(_0x4f7616){return getUser({'interface':_0x4f7616})[_0x7073('0xc')](function(_0x5878fb){logger[_0x7073('0x7')](_0x7073('0x19'),_0x4f7616,_0x5878fb?_0x7073('0x16'):'notfound');return _0x43b7b0(_0x5878fb);})[_0x7073('0xe')](function(_0x54d3a8){logger[_0x7073('0xa')](_0x7073('0x1a'),_0x54d3a8?util[_0x7073('0x8')](_0x54d3a8,{'showHidden':![],'depth':null}):'');return _0x43b7b0(null);});}return _0x43b7b0(null);});};exports[_0x7073('0x1b')]=function(_0x365ec4){return new BPromise(function(_0x54b9dc,_0x44a585){if(_0x365ec4){return getUser({'name':_0x365ec4})[_0x7073('0xc')](function(_0x3a100d){logger[_0x7073('0x7')](_0x7073('0x1c'),_0x365ec4,_0x3a100d?'found':_0x7073('0x17'));return _0x54b9dc(_0x3a100d);})[_0x7073('0xe')](function(_0x2fdcd1){logger[_0x7073('0xa')](_0x7073('0x1d'),_0x2fdcd1?util['inspect'](_0x2fdcd1,{'showHidden':![],'depth':null}):'');return _0x54b9dc(null);});}return _0x54b9dc(null);});};exports[_0x7073('0x1e')]=function(_0xfbaac2){return new BPromise(function(_0x487a5f,_0x408f4e){if(_0xfbaac2){return client[_0x7073('0xb')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name',_0x7073('0x1f'),'acw',_0x7073('0x20')],'where':{'name':_0xfbaac2},'limit':0x1}})[_0x7073('0xc')](function(_0x204614){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0xfbaac2,_0x204614?util[_0x7073('0x8')](_0x204614,{'showHidden':![],'depth':null}):'');logger[_0x7073('0x7')](_0x7073('0x21'),_0xfbaac2,_0x204614?_0x7073('0x16'):'notfound');return _0x487a5f(_0x204614[_0x7073('0x12')][_0x7073('0x13')]?_0x204614[_0x7073('0x12')][0x0]:null);})[_0x7073('0xe')](function(_0x4e94ae){logger[_0x7073('0xa')]('[utils][getVoiceQueueByName]',_0x4e94ae?util[_0x7073('0x8')](_0x4e94ae,{'showHidden':![],'depth':null}):'');return _0x487a5f(null);});}return _0x487a5f(null);});};exports['addTime']=function(_0x355ef6,_0x5c7f0a){return moment(_0x355ef6)[_0x7073('0x22')](_0x5c7f0a,_0x7073('0x23'))[_0x7073('0x24')](_0x7073('0x25'));};exports[_0x7073('0x26')]=function(_0x40c71f,_0x488096){return moment(_0x40c71f)[_0x7073('0x27')](_0x488096,_0x7073('0x23'))[_0x7073('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x7073('0x28')]=function(_0x113398,_0x1c3b2d){return moment(_0x113398)['diff'](moment(_0x1c3b2d),_0x7073('0x23'));};exports[_0x7073('0x29')]=function(_0x59b5b7,_0x4f4a02){return parseInt(_0x59b5b7,0xa)+parseInt(_0x4f4a02,0xa);};exports['now']=function(){return moment()['format'](_0x7073('0x25'));};exports[_0x7073('0x2a')]=function(_0x1bd0f8,_0x146f35){if(_0x146f35){return moment(_0x1bd0f8)[_0x7073('0x2a')](_0x146f35);}return!![];};exports[_0x7073('0x2b')]=function(_0x578119,_0x436422){if(_0x436422){return moment(_0x578119)[_0x7073('0x2b')](_0x436422);}else if(_0x578119){return!![];}return![];}; \ No newline at end of file +var _0x885c=['[utils][getUserByInterface]\x20interface:%s\x20%s','found','notfound','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','moment','util','client','../../config/logger','xdr','info','inspect','debug','error','request','catch','[utils][request]\x20name:%s','GetUser','internal','name','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','[utils][getUserByInternal]'];(function(_0x3439ef,_0x198707){var _0x3c7937=function(_0xaf5100){while(--_0xaf5100){_0x3439ef['push'](_0x3439ef['shift']());}};_0x3c7937(++_0x198707);}(_0x885c,0x190));var _0xc885=function(_0x333714,_0x3370ac){_0x333714=_0x333714-0x0;var _0x4c211e=_0x885c[_0x333714];return _0x4c211e;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0xc885('0x0'));var util=require(_0xc885('0x1'));var client=jayson[_0xc885('0x2')]['http']({'port':0x2329});var logger=require(_0xc885('0x3'))(_0xc885('0x4'));exports[_0xc885('0x5')]=function(_0x2dae11,_0x1fd23b){logger[_0xc885('0x5')](_0x2dae11,_0x1fd23b?util[_0xc885('0x6')](_0x1fd23b,{'showHidden':![],'depth':null}):'');};exports[_0xc885('0x7')]=function(_0x1703fd,_0x9f0853){logger[_0xc885('0x7')](_0x1703fd,_0x9f0853?util['inspect'](_0x9f0853,{'showHidden':![],'depth':null}):'');};exports[_0xc885('0x8')]=function(_0x513947,_0x2fa017){logger['error'](_0x513947,_0x2fa017?util[_0xc885('0x6')](_0x2fa017,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x4ad3a5,_0x308978){return client[_0xc885('0x9')](_0x4ad3a5,{'body':_0x308978})['then'](function(_0x257377){logger['debug']('[utils][request]\x20name:%s',_0x4ad3a5,_0x257377?util[_0xc885('0x6')](_0x257377,{'showHidden':![],'depth':null}):'');})[_0xc885('0xa')](function(_0x52065b){logger['error'](_0xc885('0xb'),_0x4ad3a5,_0x52065b?util['inspect'](_0x52065b,{'showHidden':![],'depth':null}):'');});};function getUser(_0xc8defe){return client['request'](_0xc885('0xc'),{'options':{'raw':!![],'attributes':['id',_0xc885('0xd'),_0xc885('0xe'),'interface'],'where':_0xc8defe,'limit':0x1}})[_0xc885('0xf')](function(_0x41667d){logger['debug'](_0xc885('0x10'),JSON[_0xc885('0x11')](_0xc8defe),_0x41667d?util['inspect'](_0x41667d,{'showHidden':![],'depth':null}):'');return _0x41667d[_0xc885('0x12')][_0xc885('0x13')]?_0x41667d[_0xc885('0x12')][0x0]:null;});}exports[_0xc885('0x14')]=function(_0x4546ea){return new BPromise(function(_0x3139a9,_0x1c9b63){if(_0x4546ea){return getUser({'internal':_0x4546ea})[_0xc885('0xf')](function(_0x33f473){logger[_0xc885('0x5')](_0xc885('0x15'),_0x4546ea,_0x33f473?'found':'notfound');return _0x3139a9(_0x33f473);})[_0xc885('0xa')](function(_0x385a9e){logger[_0xc885('0x8')](_0xc885('0x16'),_0x385a9e?util[_0xc885('0x6')](_0x385a9e,{'showHidden':![],'depth':null}):'');return _0x3139a9(null);});}return _0x3139a9(null);});};exports['getUserByInterface']=function(_0x553cac){return new BPromise(function(_0x2b6267,_0x47137f){if(_0x553cac){return getUser({'interface':_0x553cac})[_0xc885('0xf')](function(_0x470ae6){logger[_0xc885('0x5')](_0xc885('0x17'),_0x553cac,_0x470ae6?_0xc885('0x18'):_0xc885('0x19'));return _0x2b6267(_0x470ae6);})['catch'](function(_0x5a6fa2){logger['error']('[utils][getUserByInterface]',_0x5a6fa2?util[_0xc885('0x6')](_0x5a6fa2,{'showHidden':![],'depth':null}):'');return _0x2b6267(null);});}return _0x2b6267(null);});};exports[_0xc885('0x1a')]=function(_0x347cda){return new BPromise(function(_0x5d9fb6,_0x3ccf3c){if(_0x347cda){return getUser({'name':_0x347cda})[_0xc885('0xf')](function(_0x44b914){logger[_0xc885('0x5')](_0xc885('0x1b'),_0x347cda,_0x44b914?'found':_0xc885('0x19'));return _0x5d9fb6(_0x44b914);})[_0xc885('0xa')](function(_0x283b4e){logger[_0xc885('0x8')](_0xc885('0x1c'),_0x283b4e?util[_0xc885('0x6')](_0x283b4e,{'showHidden':![],'depth':null}):'');return _0x5d9fb6(null);});}return _0x5d9fb6(null);});};exports[_0xc885('0x1d')]=function(_0x5b8589){return new BPromise(function(_0x5cb45d,_0x3803de){if(_0x5b8589){return client[_0xc885('0x9')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name',_0xc885('0x1e'),_0xc885('0x1f'),_0xc885('0x20')],'where':{'name':_0x5b8589},'limit':0x1}})[_0xc885('0xf')](function(_0x11660b){logger[_0xc885('0x7')](_0xc885('0x21'),_0x5b8589,_0x11660b?util[_0xc885('0x6')](_0x11660b,{'showHidden':![],'depth':null}):'');logger['info'](_0xc885('0x22'),_0x5b8589,_0x11660b?'found':_0xc885('0x19'));return _0x5cb45d(_0x11660b[_0xc885('0x12')][_0xc885('0x13')]?_0x11660b[_0xc885('0x12')][0x0]:null);})['catch'](function(_0x28f699){logger[_0xc885('0x8')](_0xc885('0x23'),_0x28f699?util['inspect'](_0x28f699,{'showHidden':![],'depth':null}):'');return _0x5cb45d(null);});}return _0x5cb45d(null);});};exports[_0xc885('0x24')]=function(_0x4d1b39,_0x4589e8){return moment(_0x4d1b39)[_0xc885('0x25')](_0x4589e8,'seconds')[_0xc885('0x26')](_0xc885('0x27'));};exports['subtractTime']=function(_0x55352a,_0x54f774){return moment(_0x55352a)[_0xc885('0x28')](_0x54f774,'seconds')[_0xc885('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xc885('0x29')]=function(_0x161233,_0x2b4624){return moment(_0x161233)[_0xc885('0x2a')](moment(_0x2b4624),'seconds');};exports[_0xc885('0x2b')]=function(_0x53f17d,_0x446bbe){return parseInt(_0x53f17d,0xa)+parseInt(_0x446bbe,0xa);};exports[_0xc885('0x2c')]=function(){return moment()[_0xc885('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0xff276d,_0xbef60d){if(_0xbef60d){return moment(_0xff276d)[_0xc885('0x2d')](_0xbef60d);}return!![];};exports[_0xc885('0x2e')]=function(_0x8dbc4b,_0x53609a){if(_0x53609a){return moment(_0x8dbc4b)['isBefore'](_0x53609a);}else if(_0x8dbc4b){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 739c4d3..c3528d3 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a1b=['api','auth','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','headers','connection','remoteAddress','url','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','name','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','util','./loggers','fileLogger','./safe-template','./mask-sensitive-data','join','/var','client','role','ensureDir','then','log','user','no-user','data','timestamp','catch'];(function(_0x112521,_0x178f26){var _0x150f54=function(_0x2074f9){while(--_0x2074f9){_0x112521['push'](_0x112521['shift']());}};_0x150f54(++_0x178f26);}(_0x9a1b,0x1ae));var _0xb9a1=function(_0x172172,_0x18db61){_0x172172=_0x172172-0x0;var _0x1bda0a=_0x9a1b[_0x172172];return _0x1bda0a;};var fs=require(_0xb9a1('0x0'));var _=require(_0xb9a1('0x1'));var ewinston=require(_0xb9a1('0x2'));var path=require('path');var util=require(_0xb9a1('0x3'));var fileLogger=require(_0xb9a1('0x4'))[_0xb9a1('0x5')];var safeTemplate=require(_0xb9a1('0x6'))['safeTemplate'];var maskSensitiveData=require(_0xb9a1('0x7'))['maskSensitiveData'];function ClientSideLogger(){function _0x13af05(_0x53b591){var _0x18ade4=path[_0xb9a1('0x8')](_0xb9a1('0x9'),'log','xcally');var _0x4ca339=path[_0xb9a1('0x8')](_0xb9a1('0xa'),_0x53b591[_0xb9a1('0xb')]+'-'+_0x53b591['name']);return fs[_0xb9a1('0xc')](path[_0xb9a1('0x8')](_0x18ade4,_0x4ca339))[_0xb9a1('0xd')](function(){var _0x12080a=fileLogger(_0xb9a1('0xa'),path['join'](_0x18ade4,_0x4ca339));return _0x12080a;})['catch'](function(_0x3b0ae2){throw _0x3b0ae2;});}this[_0xb9a1('0xe')]=function(_0x9b7e2,_0x183962,_0x294730,_0x1f1cb3){return _0x13af05(_0x9b7e2[_0xb9a1('0xf')])[_0xb9a1('0xd')](function(_0x2aa23e){var _0x245e07=_0x2aa23e[_0x183962];return _0x245e07;})['then'](function(_0x4861ea){var _0x2b2b28=_0x9b7e2[_0xb9a1('0xf')]?_0x9b7e2[_0xb9a1('0xf')]['id']:_0xb9a1('0x10');var _0x480ec1=_0x1f1cb3[_0xb9a1('0x11')];var _0x30cc4c=_0x1f1cb3[_0xb9a1('0x12')];var _0x492481=new Date(Number(_0x30cc4c));return _0x4861ea(_0x2b2b28,_0x492481,_0x294730,_0x480ec1);})[_0xb9a1('0x13')](function(_0x14fd83){fileLogger('client')['error'](_0x14fd83);});};}function setupLoggers(_0x5e22e4){return new Promise(function(_0x2bf8a4){var _0x173a4a=new ClientSideLogger();var _0x218faa=fileLogger(_0xb9a1('0x14'));var _0x2ac9c2=fileLogger(_0xb9a1('0x15'));_0x5e22e4['set'](_0xb9a1('0x16'),_0x173a4a);_0x5e22e4['use'](ewinston[_0xb9a1('0x17')]({'winstonInstance':_0x218faa,'meta':![],'statusLevels':!![],'msg':function(_0x52858e,_0x44ab2f){var _0x546ff7=_0xb9a1('0x18');if(!_[_0xb9a1('0x19')](_0x52858e[_0xb9a1('0x1a')])){_0x546ff7+='\x20body=%s';var _0x24b09f=_0x52858e[_0xb9a1('0x1a')];maskSensitiveData(_0x24b09f);}return safeTemplate(util[_0xb9a1('0x1b')](_0x546ff7,_0x52858e[_0xb9a1('0x1c')],_0x52858e[_0xb9a1('0x1d')]['x-forwarded-for']?_0x52858e[_0xb9a1('0x1d')]['x-forwarded-for']:_0x52858e[_0xb9a1('0x1e')][_0xb9a1('0x1f')]||_0x52858e['ip'],_0x52858e[_0xb9a1('0x20')],_0x44ab2f[_0xb9a1('0x21')],_0x44ab2f[_0xb9a1('0x22')],_0x52858e[_0xb9a1('0xf')]?_0x52858e[_0xb9a1('0xf')]['id']:null,_0x52858e[_0xb9a1('0xf')]?_0x52858e[_0xb9a1('0xf')]['name']:null,_0x52858e[_0xb9a1('0xf')]?_0x52858e['user'][_0xb9a1('0xb')]:null,_0x24b09f?util[_0xb9a1('0x23')](_0x24b09f,![],null):''));}}));_0x5e22e4['use'](ewinston[_0xb9a1('0x17')]({'winstonInstance':_0x2ac9c2,'meta':![],'statusLevels':!![],'msg':function(_0xbed996,_0x4d62fe){var _0x467855=_0xb9a1('0x24');if(_0xbed996[_0xb9a1('0x1a')]&&_0xbed996['body'][_0xb9a1('0x25')]&&_0xbed996[_0xb9a1('0x1a')][_0xb9a1('0x26')]){_0x467855=_0xb9a1('0x27');}return util['format'](_0x467855,_0xbed996[_0xb9a1('0x1c')],_0xbed996['headers']['x-forwarded-for']?_0xbed996[_0xb9a1('0x1d')]['x-forwarded-for']:_0xbed996[_0xb9a1('0x1e')][_0xb9a1('0x1f')]||_0xbed996['ip'],_0xbed996[_0xb9a1('0x20')],_0x4d62fe[_0xb9a1('0x21')],_0x4d62fe[_0xb9a1('0x22')],_0xbed996['user']?_0xbed996[_0xb9a1('0xf')]['id']:null,_0xbed996[_0xb9a1('0xf')]?_0xbed996['user'][_0xb9a1('0x28')]:null,_0xbed996[_0xb9a1('0xf')]?_0xbed996[_0xb9a1('0xf')][_0xb9a1('0xb')]:null,_0xbed996[_0xb9a1('0x1a')]&&_0xbed996[_0xb9a1('0x1a')]['device']?_0xbed996[_0xb9a1('0x1a')][_0xb9a1('0x25')]:_0xb9a1('0x29'),_0xbed996[_0xb9a1('0x1a')]&&_0xbed996[_0xb9a1('0x1a')]['agent_id']?_0xbed996['body'][_0xb9a1('0x26')]:'',_0xbed996[_0xb9a1('0x1a')]&&_0xbed996[_0xb9a1('0x1a')][_0xb9a1('0x2a')]?_0xbed996[_0xb9a1('0x1a')][_0xb9a1('0x2a')]:'');},'ignoreRoute':function(_0x1eb526){var _0x2f6617=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2f6617[_0xb9a1('0x2b')](_0x1eb526[_0xb9a1('0x20')]);}}));return _0x2bf8a4();});}exports[_0xb9a1('0x2c')]=setupLoggers; \ No newline at end of file +var _0xdba7=['use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','x-forwarded-for','headers','remoteAddress','url','statusCode','responseTime','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','other','agent_id','agent_name','test','setupLoggers','path','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','no-user','data','timestamp','api','auth','set','client-side-logger'];(function(_0x4b0dc3,_0x25948f){var _0x5bea77=function(_0x513c2c){while(--_0x513c2c){_0x4b0dc3['push'](_0x4b0dc3['shift']());}};_0x5bea77(++_0x25948f);}(_0xdba7,0x15f));var _0x7dba=function(_0x2a646d,_0x18fee8){_0x2a646d=_0x2a646d-0x0;var _0x560d1a=_0xdba7[_0x2a646d];return _0x560d1a;};var fs=require('fs-extra');var _=require('lodash');var ewinston=require('express-winston');var path=require(_0x7dba('0x0'));var util=require('util');var fileLogger=require(_0x7dba('0x1'))[_0x7dba('0x2')];var safeTemplate=require(_0x7dba('0x3'))[_0x7dba('0x4')];var maskSensitiveData=require(_0x7dba('0x5'))[_0x7dba('0x6')];function ClientSideLogger(){function _0x7a53b0(_0x4c8f75){var _0x50d43b=path[_0x7dba('0x7')](_0x7dba('0x8'),_0x7dba('0x9'),_0x7dba('0xa'));var _0x238f81=path[_0x7dba('0x7')](_0x7dba('0xb'),_0x4c8f75[_0x7dba('0xc')]+'-'+_0x4c8f75[_0x7dba('0xd')]);return fs[_0x7dba('0xe')](path[_0x7dba('0x7')](_0x50d43b,_0x238f81))[_0x7dba('0xf')](function(){var _0x3e7d99=fileLogger(_0x7dba('0xb'),path[_0x7dba('0x7')](_0x50d43b,_0x238f81));return _0x3e7d99;})[_0x7dba('0x10')](function(_0x14c143){throw _0x14c143;});}this[_0x7dba('0x9')]=function(_0x1d1594,_0x15ae22,_0x1429c8,_0x2718a4){return _0x7a53b0(_0x1d1594[_0x7dba('0x11')])[_0x7dba('0xf')](function(_0x5836f0){var _0x231b2f=_0x5836f0[_0x15ae22];return _0x231b2f;})[_0x7dba('0xf')](function(_0x12b295){var _0xba3c98=_0x1d1594[_0x7dba('0x11')]?_0x1d1594['user']['id']:_0x7dba('0x12');var _0x556aa6=_0x2718a4[_0x7dba('0x13')];var _0x5618f8=_0x2718a4[_0x7dba('0x14')];var _0x1da54a=new Date(Number(_0x5618f8));return _0x12b295(_0xba3c98,_0x1da54a,_0x1429c8,_0x556aa6);})[_0x7dba('0x10')](function(_0x151ece){fileLogger(_0x7dba('0xb'))['error'](_0x151ece);});};}function setupLoggers(_0x1edb33){return new Promise(function(_0x34285f){var _0x8b5a78=new ClientSideLogger();var _0xf89921=fileLogger(_0x7dba('0x15'));var _0x5848fe=fileLogger(_0x7dba('0x16'));_0x1edb33[_0x7dba('0x17')](_0x7dba('0x18'),_0x8b5a78);_0x1edb33[_0x7dba('0x19')](ewinston[_0x7dba('0x1a')]({'winstonInstance':_0xf89921,'meta':![],'statusLevels':!![],'msg':function(_0x2935a9,_0x452a86){var _0x3315cf=_0x7dba('0x1b');if(!_[_0x7dba('0x1c')](_0x2935a9[_0x7dba('0x1d')])){_0x3315cf+='\x20body=%s';var _0x5506f3=_0x2935a9[_0x7dba('0x1d')];maskSensitiveData(_0x5506f3);}return safeTemplate(util[_0x7dba('0x1e')](_0x3315cf,_0x2935a9[_0x7dba('0x1f')],_0x2935a9['headers'][_0x7dba('0x20')]?_0x2935a9[_0x7dba('0x21')][_0x7dba('0x20')]:_0x2935a9['connection'][_0x7dba('0x22')]||_0x2935a9['ip'],_0x2935a9[_0x7dba('0x23')],_0x452a86[_0x7dba('0x24')],_0x452a86[_0x7dba('0x25')],_0x2935a9[_0x7dba('0x11')]?_0x2935a9[_0x7dba('0x11')]['id']:null,_0x2935a9['user']?_0x2935a9['user']['name']:null,_0x2935a9[_0x7dba('0x11')]?_0x2935a9[_0x7dba('0x11')][_0x7dba('0xc')]:null,_0x5506f3?util['inspect'](_0x5506f3,![],null):''));}}));_0x1edb33[_0x7dba('0x19')](ewinston[_0x7dba('0x1a')]({'winstonInstance':_0x5848fe,'meta':![],'statusLevels':!![],'msg':function(_0x25dab7,_0x145e6e){var _0xa58efa=_0x7dba('0x26');if(_0x25dab7['body']&&_0x25dab7[_0x7dba('0x1d')][_0x7dba('0x27')]&&_0x25dab7[_0x7dba('0x1d')]['agent_id']){_0xa58efa=_0x7dba('0x28');}return util[_0x7dba('0x1e')](_0xa58efa,_0x25dab7[_0x7dba('0x1f')],_0x25dab7[_0x7dba('0x21')][_0x7dba('0x20')]?_0x25dab7[_0x7dba('0x21')][_0x7dba('0x20')]:_0x25dab7[_0x7dba('0x29')][_0x7dba('0x22')]||_0x25dab7['ip'],_0x25dab7[_0x7dba('0x23')],_0x145e6e[_0x7dba('0x24')],_0x145e6e['responseTime'],_0x25dab7['user']?_0x25dab7[_0x7dba('0x11')]['id']:null,_0x25dab7[_0x7dba('0x11')]?_0x25dab7['user'][_0x7dba('0xd')]:null,_0x25dab7['user']?_0x25dab7[_0x7dba('0x11')][_0x7dba('0xc')]:null,_0x25dab7[_0x7dba('0x1d')]&&_0x25dab7[_0x7dba('0x1d')]['device']?_0x25dab7[_0x7dba('0x1d')][_0x7dba('0x27')]:_0x7dba('0x2a'),_0x25dab7[_0x7dba('0x1d')]&&_0x25dab7[_0x7dba('0x1d')][_0x7dba('0x2b')]?_0x25dab7[_0x7dba('0x1d')]['agent_id']:'',_0x25dab7[_0x7dba('0x1d')]&&_0x25dab7['body'][_0x7dba('0x2c')]?_0x25dab7[_0x7dba('0x1d')][_0x7dba('0x2c')]:'');},'ignoreRoute':function(_0x4f4d67){var _0x3d2e41=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3d2e41[_0x7dba('0x2d')](_0x4f4d67['url']);}}));return _0x34285f();});}exports[_0x7dba('0x2e')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 3170d23..b8a80df 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x93fb=['monthCompare','test','isMoment','padStart','length','moment-timezone','map','source','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','split','locale','weekdaysShort','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','clone','hours','minutes','isBefore','startOf','day','isBetween','timeCompare','format','ddd','dowCompare','date','max','min','domCompare','includes'];(function(_0x37e069,_0x5edc46){var _0x5cb67e=function(_0x33a3f4){while(--_0x33a3f4){_0x37e069['push'](_0x37e069['shift']());}};_0x5cb67e(++_0x5edc46);}(_0x93fb,0x6e));var _0xb93f=function(_0x3f6708,_0xbd2259){_0x3f6708=_0x3f6708-0x0;var _0x40b453=_0x93fb[_0x3f6708];return _0x40b453;};var _=require('lodash');var moment=require(_0xb93f('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xb93f('0x1')](function(_0x6a02d8){return _0x6a02d8[_0xb93f('0x2')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xb93f('0x3');var EINVALID_DATE=_0xb93f('0x4');function throwIfDateNotValid(_0x26ba93){if(!_0x26ba93['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x359dff){var _0x2d1a09=_0x359dff[_0xb93f('0x5')](':')['map'](function(_0x4b1a9e){return parseInt(_0x4b1a9e,0xa);});var _0x76e70e=_0x2d1a09[0x0];var _0x19b734=_0x2d1a09[0x1];if(_0x76e70e<0x0||_0x76e70e>0x17||_0x19b734<0x0||_0x19b734>0x3b){throw new Error(EINVALID_DATE);}return[_0x76e70e,_0x19b734];}function circularDoWInterval(_0x31b3b5,_0x345d47){if(_0x31b3b5===_0x345d47){return[_0x31b3b5];}else{var _0x1584a3=moment[_0xb93f('0x6')]();moment['locale']('en');var _0xdce414=moment[_0xb93f('0x7')]()[_0xb93f('0x1')](function(_0x32d86a){return _0x32d86a['toLowerCase']();});moment[_0xb93f('0x6')](_0x1584a3);var _0x4a387f=_0xdce414[_0xb93f('0x8')](_0x31b3b5);var _0x479b21=_0xdce414[_0xb93f('0x8')](_0x345d47);if(_0x479b21>_0x4a387f){return _0xdce414[_0xb93f('0x9')](_0x4a387f,_0x479b21+0x1);}else{var _0x2d4dcd=_0xdce414['slice'](0x0,_0x479b21+0x1);var _0x4e13f6=_0xdce414['slice'](_0x4a387f);return _0x4e13f6[_0xb93f('0xa')](_0x2d4dcd);}}}module[_0xb93f('0xb')][_0xb93f('0xc')]=circularDoWInterval;function circularMonthInterval(_0x4ea8d9,_0x52a258){if(_0x4ea8d9===_0x52a258){return[_0x4ea8d9];}else{var _0x3ee69b=moment[_0xb93f('0x6')]();moment['locale']('en');var _0x4fc1c4=moment[_0xb93f('0xd')]()[_0xb93f('0x1')](function(_0x55a50b){return _0x55a50b['toLowerCase']();});moment['locale'](_0x3ee69b);var _0x14b1e2=_0x4fc1c4[_0xb93f('0x8')](_0x4ea8d9);var _0x1d8b5d=_0x4fc1c4[_0xb93f('0x8')](_0x52a258);if(_0x1d8b5d>_0x14b1e2){return _0x4fc1c4[_0xb93f('0x9')](_0x14b1e2,_0x1d8b5d+0x1);}else{var _0x1b3e73=_0x4fc1c4['slice'](0x0,_0x1d8b5d+0x1);var _0x100971=_0x4fc1c4[_0xb93f('0x9')](_0x14b1e2);return _0x100971[_0xb93f('0xa')](_0x1b3e73);}}}module[_0xb93f('0xb')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x3939bf){var _0x4abc41=parseInt(_0x3939bf,0xa);if(_0x4abc41<0x1||_0x4abc41>0x1f){throw new Error(EINVALID_DATE);}return _0x4abc41;}function timeCompare(_0x386412,_0x4f3822,_0x53491a){var _0x2e753b=_0x386412[_0xb93f('0xe')]();var _0x1c711c=extractTime(_0x4f3822);var _0xd79b5e=_0x1c711c[0x0];var _0x1269e8=_0x1c711c[0x1];var _0x5edae7=_0x386412[_0xb93f('0xe')]()[_0xb93f('0xf')](_0xd79b5e)[_0xb93f('0x10')](_0x1269e8);throwIfDateNotValid(_0x5edae7);var _0x4b1b82=extractTime(_0x53491a);var _0x53dd6a=_0x4b1b82[0x0];var _0x1b5870=_0x4b1b82[0x1];var _0x2b6c1e=_0x386412[_0xb93f('0xe')]()[_0xb93f('0xf')](_0x53dd6a)[_0xb93f('0x10')](_0x1b5870);throwIfDateNotValid(_0x2b6c1e);if(_0x2b6c1e[_0xb93f('0x11')](_0x5edae7)){var _0x4f5cc9=_0x2e753b[_0xb93f('0xe')]()[_0xb93f('0x12')]('day');var _0x3b0f6f=_0x2e753b[_0xb93f('0xe')]()['endOf'](_0xb93f('0x13'));return _0x2e753b[_0xb93f('0x14')](_0x5edae7,_0x3b0f6f,undefined,'[]')||_0x2e753b[_0xb93f('0x14')](_0x4f5cc9,_0x2b6c1e,undefined,'[]');}else{return _0x2e753b['isBetween'](_0x5edae7,_0x2b6c1e,undefined,'[]');}}module['exports'][_0xb93f('0x15')]=timeCompare;function dowCompare(_0x4a5437,_0x326e6e,_0x5f54b){var _0x1088c8=_0x4a5437['locale']('en')[_0xb93f('0x16')](_0xb93f('0x17'))['toLowerCase']();return circularDoWInterval(_0x326e6e,_0x5f54b)['includes'](_0x1088c8);}module[_0xb93f('0xb')][_0xb93f('0x18')]=dowCompare;function domCompare(_0x473bcd,_0x2bcf59,_0x4ae751){var _0x9041a2=_0x473bcd[_0xb93f('0x19')]();if(_0x2bcf59===_0x4ae751){return _0x9041a2===_0x2bcf59;}else{var _0x2ec359=_0x473bcd['daysInMonth']();var _0xf4b7d2=_0x2bcf59<_0x4ae751;let _0x21a53c=![];var _0x5a8045=0x0;var _0xa9f404=0x0;if(_0xf4b7d2){_0x5a8045=Math[_0xb93f('0x1a')](0x1,_0x2bcf59);_0xa9f404=Math[_0xb93f('0x1b')](_0x4ae751,_0x2ec359);_0x21a53c=_0x9041a2>=_0x5a8045&&_0x9041a2<=_0xa9f404;}else{_0x5a8045=Math['min'](_0x2bcf59,_0x2ec359);_0xa9f404=Math[_0xb93f('0x1a')](0x1,_0x4ae751);_0x21a53c=_0x9041a2>=_0x5a8045||_0x9041a2<=_0xa9f404;}return _0x21a53c;}}module[_0xb93f('0xb')][_0xb93f('0x1c')]=domCompare;function monthCompare(_0x5f3230,_0x29d397,_0x25db04){var _0x303796=_0x5f3230[_0xb93f('0x6')]('en')[_0xb93f('0x16')]('MMM')['toLowerCase']();return circularMonthInterval(_0x29d397,_0x25db04)[_0xb93f('0x1d')](_0x303796);}module[_0xb93f('0xb')][_0xb93f('0x1e')]=monthCompare;function iftime(_0xc0170d,_0x2fc01b=moment['tz']['guess'](),_0x11584e=moment()){if(!validateRx[_0xb93f('0x1f')](_0xc0170d)){throw new Error(EINVALID_STRING);}else{var _0x323ecb=(moment[_0xb93f('0x20')](_0x11584e)?_0x11584e[_0xb93f('0xe')]():moment(_0x11584e))['tz'](_0x2fc01b)[_0xb93f('0x6')]('en');throwIfDateNotValid(_0x323ecb);var _0x1a709f=_0xc0170d[_0xb93f('0x5')](',');var _0x39aa97=_0x1a709f[0x0];var _0x30d017=_0x1a709f[0x1];var _0x128abc=_0x1a709f[0x2];var _0x58d4d5=_0x1a709f[0x3];let _0x5a7403=!![];if(_0x39aa97!=='*'){var _0x2fe28f=_0x39aa97['split']('-');var _0x54db67=_[_0xb93f('0x21')](_0x2fe28f[0x0],0x5,'0');var _0x20a5a1=_0x2fe28f['length']===0x2?_[_0xb93f('0x21')](_0x2fe28f[0x1],0x5,'0'):_0x54db67;_0x5a7403=timeCompare(_0x323ecb,_0x54db67,_0x20a5a1);}let _0x2b42bc=!![];if(_0x30d017!=='*'){var _0x152b2d=_0x30d017['split']('-');var _0x530d20=_0x152b2d[0x0];var _0x211ba5=_0x152b2d[_0xb93f('0x22')]===0x2?_0x152b2d[0x1]:_0x530d20;_0x2b42bc=dowCompare(_0x323ecb,_0x530d20,_0x211ba5);}let _0x3d0ce2=!![];if(_0x128abc!=='*'){var _0x3989e7=_0x128abc['split']('-');var _0x3659a1=parseDom(_0x3989e7[0x0]);var _0x2044ba=_0x3989e7[_0xb93f('0x22')]===0x2?parseDom(_0x3989e7[0x1]):_0x3659a1;_0x3d0ce2=domCompare(_0x323ecb,_0x3659a1,_0x2044ba);}let _0x560eab=!![];if(_0x58d4d5!=='*'){var _0x32ccbb=_0x58d4d5['split']('-');var _0x468cde=_0x32ccbb[0x0];var _0x16c99b=_0x32ccbb[_0xb93f('0x22')]===0x2?_0x32ccbb[0x1]:_0x32ccbb[0x0];_0x560eab=monthCompare(_0x323ecb,_0x468cde,_0x16c99b);}return _0x5a7403&&_0x2b42bc&&_0x3d0ce2&&_0x560eab;}}module[_0xb93f('0xb')]['iftime']=iftime; \ No newline at end of file +var _0x8bd7=['includes','monthCompare','guess','test','length','padStart','lodash','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','circularDoWInterval','monthsShort','concat','exports','circularMonthInterval','clone','hours','minutes','startOf','endOf','isBetween','timeCompare','format','ddd','daysInMonth','max','min','domCompare'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0x8bd7,0xbf));var _0x78bd=function(_0x1048c1,_0x273701){_0x1048c1=_0x1048c1-0x0;var _0x560e0f=_0x8bd7[_0x1048c1];return _0x560e0f;};var _=require(_0x78bd('0x0'));var moment=require(_0x78bd('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x78bd('0x2')](function(_0x4173d1){return _0x4173d1[_0x78bd('0x3')];})[_0x78bd('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x78bd('0x5');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0xd9fb73){if(!_0xd9fb73[_0x78bd('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x19220c){var _0xf36ba2=_0x19220c[_0x78bd('0x7')](':')[_0x78bd('0x2')](function(_0x325f4a){return parseInt(_0x325f4a,0xa);});var _0x12f00e=_0xf36ba2[0x0];var _0x4d13a9=_0xf36ba2[0x1];if(_0x12f00e<0x0||_0x12f00e>0x17||_0x4d13a9<0x0||_0x4d13a9>0x3b){throw new Error(EINVALID_DATE);}return[_0x12f00e,_0x4d13a9];}function circularDoWInterval(_0x2e89a7,_0x5c28b1){if(_0x2e89a7===_0x5c28b1){return[_0x2e89a7];}else{var _0x54d360=moment[_0x78bd('0x8')]();moment[_0x78bd('0x8')]('en');var _0x214e29=moment[_0x78bd('0x9')]()[_0x78bd('0x2')](function(_0x1a955d){return _0x1a955d[_0x78bd('0xa')]();});moment[_0x78bd('0x8')](_0x54d360);var _0x285c28=_0x214e29[_0x78bd('0xb')](_0x2e89a7);var _0x24a285=_0x214e29[_0x78bd('0xb')](_0x5c28b1);if(_0x24a285>_0x285c28){return _0x214e29['slice'](_0x285c28,_0x24a285+0x1);}else{var _0x5d157b=_0x214e29[_0x78bd('0xc')](0x0,_0x24a285+0x1);var _0x2dcdba=_0x214e29[_0x78bd('0xc')](_0x285c28);return _0x2dcdba['concat'](_0x5d157b);}}}module['exports'][_0x78bd('0xd')]=circularDoWInterval;function circularMonthInterval(_0x1928fb,_0x8f1ce6){if(_0x1928fb===_0x8f1ce6){return[_0x1928fb];}else{var _0x3f6cc2=moment['locale']();moment[_0x78bd('0x8')]('en');var _0x2cfd60=moment[_0x78bd('0xe')]()[_0x78bd('0x2')](function(_0x1de8ca){return _0x1de8ca[_0x78bd('0xa')]();});moment[_0x78bd('0x8')](_0x3f6cc2);var _0x4c585c=_0x2cfd60[_0x78bd('0xb')](_0x1928fb);var _0x3f2168=_0x2cfd60[_0x78bd('0xb')](_0x8f1ce6);if(_0x3f2168>_0x4c585c){return _0x2cfd60['slice'](_0x4c585c,_0x3f2168+0x1);}else{var _0x589794=_0x2cfd60[_0x78bd('0xc')](0x0,_0x3f2168+0x1);var _0x5c60b3=_0x2cfd60[_0x78bd('0xc')](_0x4c585c);return _0x5c60b3[_0x78bd('0xf')](_0x589794);}}}module[_0x78bd('0x10')][_0x78bd('0x11')]=circularMonthInterval;function parseDom(_0x1e2bd8){var _0x1bf708=parseInt(_0x1e2bd8,0xa);if(_0x1bf708<0x1||_0x1bf708>0x1f){throw new Error(EINVALID_DATE);}return _0x1bf708;}function timeCompare(_0x1f9e42,_0x42a704,_0x85e0ed){var _0x21b83f=_0x1f9e42[_0x78bd('0x12')]();var _0x1d2e3e=extractTime(_0x42a704);var _0x4a8033=_0x1d2e3e[0x0];var _0x8a0ca1=_0x1d2e3e[0x1];var _0x502c50=_0x1f9e42[_0x78bd('0x12')]()[_0x78bd('0x13')](_0x4a8033)[_0x78bd('0x14')](_0x8a0ca1);throwIfDateNotValid(_0x502c50);var _0x319e8c=extractTime(_0x85e0ed);var _0x2aefd1=_0x319e8c[0x0];var _0x4565ea=_0x319e8c[0x1];var _0x8bfff0=_0x1f9e42[_0x78bd('0x12')]()[_0x78bd('0x13')](_0x2aefd1)[_0x78bd('0x14')](_0x4565ea);throwIfDateNotValid(_0x8bfff0);if(_0x8bfff0['isBefore'](_0x502c50)){var _0x554b1e=_0x21b83f[_0x78bd('0x12')]()[_0x78bd('0x15')]('day');var _0x2b7332=_0x21b83f['clone']()[_0x78bd('0x16')]('day');return _0x21b83f[_0x78bd('0x17')](_0x502c50,_0x2b7332,undefined,'[]')||_0x21b83f[_0x78bd('0x17')](_0x554b1e,_0x8bfff0,undefined,'[]');}else{return _0x21b83f[_0x78bd('0x17')](_0x502c50,_0x8bfff0,undefined,'[]');}}module['exports'][_0x78bd('0x18')]=timeCompare;function dowCompare(_0x27757a,_0x348fb2,_0xf08b19){var _0xbd2404=_0x27757a[_0x78bd('0x8')]('en')[_0x78bd('0x19')](_0x78bd('0x1a'))[_0x78bd('0xa')]();return circularDoWInterval(_0x348fb2,_0xf08b19)['includes'](_0xbd2404);}module[_0x78bd('0x10')]['dowCompare']=dowCompare;function domCompare(_0x218ce8,_0x163098,_0xcfd7b0){var _0x205324=_0x218ce8['date']();if(_0x163098===_0xcfd7b0){return _0x205324===_0x163098;}else{var _0x3a3086=_0x218ce8[_0x78bd('0x1b')]();var _0x15a3bf=_0x163098<_0xcfd7b0;let _0x1e4d28=![];var _0x3941a8=0x0;var _0x470da5=0x0;if(_0x15a3bf){_0x3941a8=Math[_0x78bd('0x1c')](0x1,_0x163098);_0x470da5=Math[_0x78bd('0x1d')](_0xcfd7b0,_0x3a3086);_0x1e4d28=_0x205324>=_0x3941a8&&_0x205324<=_0x470da5;}else{_0x3941a8=Math[_0x78bd('0x1d')](_0x163098,_0x3a3086);_0x470da5=Math[_0x78bd('0x1c')](0x1,_0xcfd7b0);_0x1e4d28=_0x205324>=_0x3941a8||_0x205324<=_0x470da5;}return _0x1e4d28;}}module[_0x78bd('0x10')][_0x78bd('0x1e')]=domCompare;function monthCompare(_0x5cdefa,_0x14eb02,_0x54964a){var _0x2f2345=_0x5cdefa[_0x78bd('0x8')]('en')[_0x78bd('0x19')]('MMM')[_0x78bd('0xa')]();return circularMonthInterval(_0x14eb02,_0x54964a)[_0x78bd('0x1f')](_0x2f2345);}module[_0x78bd('0x10')][_0x78bd('0x20')]=monthCompare;function iftime(_0x5a5628,_0x26441f=moment['tz'][_0x78bd('0x21')](),_0x16ae97=moment()){if(!validateRx[_0x78bd('0x22')](_0x5a5628)){throw new Error(EINVALID_STRING);}else{var _0x480f14=(moment['isMoment'](_0x16ae97)?_0x16ae97[_0x78bd('0x12')]():moment(_0x16ae97))['tz'](_0x26441f)['locale']('en');throwIfDateNotValid(_0x480f14);var _0x284b94=_0x5a5628[_0x78bd('0x7')](',');var _0x5799e5=_0x284b94[0x0];var _0x79f502=_0x284b94[0x1];var _0xdf78c3=_0x284b94[0x2];var _0x3563c5=_0x284b94[0x3];let _0x27a4ab=!![];if(_0x5799e5!=='*'){var _0x11ab53=_0x5799e5[_0x78bd('0x7')]('-');var _0x1afbed=_['padStart'](_0x11ab53[0x0],0x5,'0');var _0x1e4a01=_0x11ab53[_0x78bd('0x23')]===0x2?_[_0x78bd('0x24')](_0x11ab53[0x1],0x5,'0'):_0x1afbed;_0x27a4ab=timeCompare(_0x480f14,_0x1afbed,_0x1e4a01);}let _0x12af71=!![];if(_0x79f502!=='*'){var _0x2e4a8e=_0x79f502['split']('-');var _0x1991a8=_0x2e4a8e[0x0];var _0x2a1abd=_0x2e4a8e['length']===0x2?_0x2e4a8e[0x1]:_0x1991a8;_0x12af71=dowCompare(_0x480f14,_0x1991a8,_0x2a1abd);}let _0x126568=!![];if(_0xdf78c3!=='*'){var _0x4f3ceb=_0xdf78c3[_0x78bd('0x7')]('-');var _0x4438b9=parseDom(_0x4f3ceb[0x0]);var _0x3ab0e6=_0x4f3ceb[_0x78bd('0x23')]===0x2?parseDom(_0x4f3ceb[0x1]):_0x4438b9;_0x126568=domCompare(_0x480f14,_0x4438b9,_0x3ab0e6);}let _0x4f3533=!![];if(_0x3563c5!=='*'){var _0x5098f3=_0x3563c5[_0x78bd('0x7')]('-');var _0x41306e=_0x5098f3[0x0];var _0x3a889c=_0x5098f3[_0x78bd('0x23')]===0x2?_0x5098f3[0x1]:_0x5098f3[0x0];_0x4f3533=monthCompare(_0x480f14,_0x41306e,_0x3a889c);}return _0x27a4ab&&_0x12af71&&_0x126568&&_0x4f3533;}}module[_0x78bd('0x10')]['iftime']=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 0e43439..a8c9609 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd6f=['toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','{{{','meta','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','%s-%s','error','transports','File','Console','warn','consoleLogger','util','winston','debugLevel'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0xcd6f,0x1c5));var _0xfcd6=function(_0x1971ae,_0x2080bf){_0x1971ae=_0x1971ae-0x0;var _0x422bde=_0xcd6f[_0x1971ae];return _0x422bde;};'use strict';var path=require('path');var util=require(_0xfcd6('0x0'));var moment=require('moment');var winston=require(_0xfcd6('0x1'));var config=require('../config/environment');var debugLevel=config[_0xfcd6('0x2')]?config[_0xfcd6('0x2')][_0xfcd6('0x3')]():_0xfcd6('0x4');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xfcd6('0x5'),'error':_0xfcd6('0x6'),'warn':_0xfcd6('0x7'),'info':_0xfcd6('0x8'),'print':_0xfcd6('0x9'),'success':'bold\x20green','http':'gray','verbose':_0xfcd6('0xa'),'debug':_0xfcd6('0xb'),'silly':_0xfcd6('0xc')};winston[_0xfcd6('0xd')](XC_LOG_COLORS);function getLogFileName(_0x800a90,_0xb6ebc1,_0x2f3dde){var _0x5d4f7e=_0x800a90||_0xfcd6('0xe');return path[_0xfcd6('0xf')](_0x5d4f7e,util[_0xfcd6('0x10')](_0xfcd6('0x11'),_0xb6ebc1,_0x2f3dde));}function formatter(_0xf72141,_0x267365){_0x267365[_0xfcd6('0x12')]=_0x267365[_0xfcd6('0x12')][_0xfcd6('0x13')](/@@{/g,'{{{')[_0xfcd6('0x13')](/}@@/g,_0xfcd6('0x14'))[_0xfcd6('0x13')](/@{/g,'{{')[_0xfcd6('0x13')](/}@/g,'}}');return util['format'](_0xfcd6('0x15'),moment()[_0xfcd6('0x10')](_0xfcd6('0x16')),_0x267365[_0xfcd6('0x17')]['toUpperCase'](),_0xf72141,_0x267365[_0xfcd6('0x12')]);}function fileFormat(_0x585523,_0x21bd5d){_0x21bd5d[_0xfcd6('0x12')]=_0x21bd5d[_0xfcd6('0x12')][_0xfcd6('0x13')](/@@{/g,_0xfcd6('0x18'))['replace'](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0xfcd6('0x13')](/}@/g,'}}');var _0x5ebbcc=_0x21bd5d[_0xfcd6('0x19')]&&Object[_0xfcd6('0x1a')](_0x21bd5d[_0xfcd6('0x19')])['length']?'\x0a\x09'+JSON[_0xfcd6('0x1b')](_0x21bd5d['meta']):'';return util[_0xfcd6('0x10')](_0xfcd6('0x1c'),moment()[_0xfcd6('0x10')](_0xfcd6('0x16')),_0x21bd5d[_0xfcd6('0x17')][_0xfcd6('0x1d')](),_0x585523,_0x21bd5d[_0xfcd6('0x12')],_0x5ebbcc);}function consoleLogger(){var _0xd80f16=new winston[(_0xfcd6('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':'warn','json':![],'formatter':function(_0x55b834){return formatter('',_0x55b834);}})]});return _0xd80f16;}function fileLogger(_0x53ce85,_0x225fc4){var _0xb5f64d=new winston[(_0xfcd6('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['File']({'name':util[_0xfcd6('0x10')](_0xfcd6('0x1f'),_0x53ce85,_0xfcd6('0x20')),'filename':getLogFileName(_0x225fc4,_0x53ce85,_0xfcd6('0x20')),'level':_0xfcd6('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x218f36){return fileFormat(_0x53ce85,_0x218f36);}}),new winston[(_0xfcd6('0x21'))][(_0xfcd6('0x22'))]({'name':util[_0xfcd6('0x10')]('%s-%s',_0x53ce85,debugLevel),'filename':getLogFileName(_0x225fc4,_0x53ce85,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x78ab09){return fileFormat(_0x53ce85,_0x78ab09);}}),new winston[(_0xfcd6('0x21'))][(_0xfcd6('0x23'))]({'level':_0xfcd6('0x24'),'json':![],'formatter':function(_0x3a427a){return fileFormat(_0x53ce85,_0x3a427a);}})]});return _0xb5f64d;}exports[_0xfcd6('0x25')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0x2cad=['message','{{{','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','keys','meta','stringify','transports','Console','warn','Logger','File','error','%s-%s','fileLogger','util','winston','../config/environment','debugLevel','info','redBG\x20white','white','bold\x20white','bold\x20green','gray','addColors','/var/log/xcally','join','format'];(function(_0x64bbb9,_0x909c76){var _0x5c3707=function(_0x26ded5){while(--_0x26ded5){_0x64bbb9['push'](_0x64bbb9['shift']());}};_0x5c3707(++_0x909c76);}(_0x2cad,0x15d));var _0xd2ca=function(_0x3c7869,_0x207240){_0x3c7869=_0x3c7869-0x0;var _0x23bc0b=_0x2cad[_0x3c7869];return _0x23bc0b;};'use strict';var path=require('path');var util=require(_0xd2ca('0x0'));var moment=require('moment');var winston=require(_0xd2ca('0x1'));var config=require(_0xd2ca('0x2'));var debugLevel=config[_0xd2ca('0x3')]?config[_0xd2ca('0x3')]['toLowerCase']():_0xd2ca('0x4');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xd2ca('0x5'),'error':'red','warn':'bold\x20yellow','info':_0xd2ca('0x6'),'print':_0xd2ca('0x7'),'success':_0xd2ca('0x8'),'http':_0xd2ca('0x9'),'verbose':'bold\x20magenta','debug':'bold\x20blue','silly':'bold\x20cyan'};winston[_0xd2ca('0xa')](XC_LOG_COLORS);function getLogFileName(_0x37c15b,_0x20aa92,_0xadc165){var _0x86c166=_0x37c15b||_0xd2ca('0xb');return path[_0xd2ca('0xc')](_0x86c166,util[_0xd2ca('0xd')]('%s-%s.log',_0x20aa92,_0xadc165));}function formatter(_0x925280,_0x50571){_0x50571['message']=_0x50571[_0xd2ca('0xe')]['replace'](/@@{/g,_0xd2ca('0xf'))['replace'](/}@@/g,_0xd2ca('0x10'))[_0xd2ca('0x11')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xd2ca('0xd')](_0xd2ca('0x12'),moment()[_0xd2ca('0xd')](_0xd2ca('0x13')),_0x50571[_0xd2ca('0x14')][_0xd2ca('0x15')](),_0x925280,_0x50571[_0xd2ca('0xe')]);}function fileFormat(_0x18290c,_0x25b083){_0x25b083[_0xd2ca('0xe')]=_0x25b083[_0xd2ca('0xe')][_0xd2ca('0x11')](/@@{/g,_0xd2ca('0xf'))[_0xd2ca('0x11')](/}@@/g,_0xd2ca('0x10'))[_0xd2ca('0x11')](/@{/g,'{{')[_0xd2ca('0x11')](/}@/g,'}}');var _0x586601=_0x25b083['meta']&&Object[_0xd2ca('0x16')](_0x25b083[_0xd2ca('0x17')])['length']?'\x0a\x09'+JSON[_0xd2ca('0x18')](_0x25b083[_0xd2ca('0x17')]):'';return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0xd2ca('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),_0x25b083[_0xd2ca('0x14')][_0xd2ca('0x15')](),_0x18290c,_0x25b083[_0xd2ca('0xe')],_0x586601);}function consoleLogger(){var _0xf7019c=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xd2ca('0x19'))][(_0xd2ca('0x1a'))]({'level':_0xd2ca('0x1b'),'json':![],'formatter':function(_0xa2c4d0){return formatter('',_0xa2c4d0);}})]});return _0xf7019c;}function fileLogger(_0x40d849,_0x50cd37){var _0x57ec08=new winston[(_0xd2ca('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xd2ca('0x19'))][(_0xd2ca('0x1d'))]({'name':util[_0xd2ca('0xd')]('%s-%s',_0x40d849,_0xd2ca('0x1e')),'filename':getLogFileName(_0x50cd37,_0x40d849,_0xd2ca('0x1e')),'level':_0xd2ca('0x1e'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1ce127){return fileFormat(_0x40d849,_0x1ce127);}}),new winston[(_0xd2ca('0x19'))][(_0xd2ca('0x1d'))]({'name':util[_0xd2ca('0xd')](_0xd2ca('0x1f'),_0x40d849,debugLevel),'filename':getLogFileName(_0x50cd37,_0x40d849,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x12bca6){return fileFormat(_0x40d849,_0x12bca6);}}),new winston[(_0xd2ca('0x19'))]['Console']({'level':_0xd2ca('0x1b'),'json':![],'formatter':function(_0x1c41e6){return fileFormat(_0x40d849,_0x1c41e6);}})]});return _0x57ec08;}exports['consoleLogger']=consoleLogger;exports[_0xd2ca('0x20')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index bec8c92..e92c702 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a85=['isString','@@{','replace','}@@','includes','exports','maskSensitiveData','password','newPassword','apiKey','street','phone','mobile','email','clientSecret','code','accessKey','token','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length'];(function(_0x1f71d8,_0x278518){var _0x10b045=function(_0x57aea4){while(--_0x57aea4){_0x1f71d8['push'](_0x1f71d8['shift']());}};_0x10b045(++_0x278518);}(_0x1a85,0x178));var _0x51a8=function(_0x1a4a06,_0x36a5c2){_0x1a4a06=_0x1a4a06-0x0;var _0x49ec08=_0x1a85[_0x1a4a06];return _0x49ec08;};var _=require('lodash');var sensitiveFields=['username',_0x51a8('0x0'),_0x51a8('0x1'),_0x51a8('0x2'),'firstName','lastName',_0x51a8('0x3'),_0x51a8('0x4'),_0x51a8('0x5'),'fax',_0x51a8('0x6'),'clientId',_0x51a8('0x7'),'securityToken',_0x51a8('0x8'),_0x51a8('0x9'),'tenantId',_0x51a8('0xa'),'channelSecret','accessToken',_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe'),_0x51a8('0xf'),_0x51a8('0x10'),_0x51a8('0x11'),_0x51a8('0x12'),_0x51a8('0x13'),_0x51a8('0x14'),_0x51a8('0x15'),_0x51a8('0x16'),_0x51a8('0x17'),_0x51a8('0x18'),_0x51a8('0x19'),_0x51a8('0x1a'),_0x51a8('0x1b'),'localstationid',_0x51a8('0x1c'),_0x51a8('0x1d'),_0x51a8('0x1e'),'oldPassword'];function maskSensitiveData(_0xf4eb6e){const _0x547d40=/(?!^)[\s\S](?!$)/g;if(_[_0x51a8('0x1f')](_0xf4eb6e)){for(const _0x2b8d37 in _0xf4eb6e){if(_[_0x51a8('0x20')](_0xf4eb6e[_0x2b8d37])){for(let _0x2b0521=0x0;_0x2b0521<_0xf4eb6e[_0x2b8d37][_0x51a8('0x21')];_0x2b0521++){maskSensitiveData(_0xf4eb6e[_0x2b8d37][_0x2b0521]);}}else if(_[_0x51a8('0x1f')](_0xf4eb6e[_0x2b8d37])){maskSensitiveData(_0xf4eb6e[_0x2b8d37]);}else if(_[_0x51a8('0x22')](_0xf4eb6e[_0x2b8d37])){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](/{{{/g,_0x51a8('0x23'))[_0x51a8('0x24')](/}}}/g,_0x51a8('0x25'))[_0x51a8('0x24')](/{{/g,'@{')[_0x51a8('0x24')](/}}/g,'}@');if(_[_0x51a8('0x26')](sensitiveFields,_0x2b8d37)){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](_0x547d40,'*');}}}}}module[_0x51a8('0x27')][_0x51a8('0x28')]=maskSensitiveData; \ No newline at end of file +var _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0x80897f,_0x35c299){var _0x29a750=function(_0x138f81){while(--_0x138f81){_0x80897f['push'](_0x80897f['shift']());}};_0x29a750(++_0x35c299);}(_0xadb5,0xad));var _0x5adb=function(_0x23c311,_0x4f4e50){_0x23c311=_0x23c311-0x0;var _0x4d15a6=_0xadb5[_0x23c311];return _0x4d15a6;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 80e58a9..6c1ca34 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7d1=['isArray','map','isPlainObject','keys','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace'];(function(_0x174c63,_0xae013c){var _0x4263a9=function(_0x59f76f){while(--_0x59f76f){_0x174c63['push'](_0x174c63['shift']());}};_0x4263a9(++_0xae013c);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x1bc314,_0xb71ada){_0x1bc314=_0x1bc314-0x0;var _0x1198ae=_0xd7d1[_0x1bc314];return _0x1198ae;};var _=require(_0x1d7d('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x23f73c){return _0x23f73c==='{{'?_0x1d7d('0x1'):_0x1d7d('0x2');}function safeTemplate(_0x1d1926){var _0x3c3a27=_0x1d1926;if(typeof _0x1d1926===_0x1d7d('0x3')){_0x3c3a27=_0x1d1926[_0x1d7d('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x1d7d('0x5')](_0x1d1926)){_0x3c3a27=_0x1d1926[_0x1d7d('0x6')](function(_0x3c0839){return safeTemplate(_0x3c0839);});}else if(_[_0x1d7d('0x7')](_0x1d1926)){_0x3c3a27=Object[_0x1d7d('0x8')](_0x1d1926)['reduce'](function(_0x462ef8,_0x1aa456){_0x462ef8[_0x1aa456]=safeTemplate(_0x1d1926[_0x1aa456]);return _0x462ef8;},{});}return _0x3c3a27;}module[_0x1d7d('0x9')][_0x1d7d('0xa')]=safeTemplate; \ No newline at end of file +var _0x4024=['exports','lodash','\x20}\x20}','string','isArray','map','keys','reduce'];(function(_0x336b3d,_0x224a25){var _0x264a18=function(_0x409d57){while(--_0x409d57){_0x336b3d['push'](_0x336b3d['shift']());}};_0x264a18(++_0x224a25);}(_0x4024,0x89));var _0x4402=function(_0x2ae099,_0x1d9376){_0x2ae099=_0x2ae099-0x0;var _0x2ce323=_0x4024[_0x2ae099];return _0x2ce323;};var _=require(_0x4402('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x10e0ef){return _0x10e0ef==='{{'?'{\x20{\x20':_0x4402('0x1');}function safeTemplate(_0x2b36c7){var _0x49a2e2=_0x2b36c7;if(typeof _0x2b36c7===_0x4402('0x2')){_0x49a2e2=_0x2b36c7['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x4402('0x3')](_0x2b36c7)){_0x49a2e2=_0x2b36c7[_0x4402('0x4')](function(_0x5bdb3f){return safeTemplate(_0x5bdb3f);});}else if(_['isPlainObject'](_0x2b36c7)){_0x49a2e2=Object[_0x4402('0x5')](_0x2b36c7)[_0x4402('0x6')](function(_0x168acd,_0x4ed77d){_0x168acd[_0x4ed77d]=safeTemplate(_0x2b36c7[_0x4ed77d]);return _0x168acd;},{});}return _0x49a2e2;}module[_0x4402('0x7')]['safeTemplate']=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 26d9ed8..03bacd1 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2efd=['name','apps','env','NODE_PATH','string','pathExists','then','readJSON','updated','info','Updating\x20app.json','exports','../config/environment','resolve','legacy-libs','isArray','findIndex'];(function(_0x2a9250,_0x263508){var _0x1839fe=function(_0x49bd3e){while(--_0x49bd3e){_0x2a9250['push'](_0x2a9250['shift']());}};_0x1839fe(++_0x263508);}(_0x2efd,0xe9));var _0xd2ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2efd[_0x321bb2];return _0x9c12ed;};var fs=require('fs-extra');var path=require('path');var config=require(_0xd2ef('0x0'));var root=config['root'];var APP_JSON_PATH=path[_0xd2ef('0x1')](root,'server/app.json');var NODEPATH=path[_0xd2ef('0x1')](root,_0xd2ef('0x2'));function setLegacyLibsNodeEnvPath(_0x36eb51){let _0x2f2859=![];if(Array[_0xd2ef('0x3')](_0x36eb51['apps'])){var _0x1e0114=_0x36eb51['apps'][_0xd2ef('0x4')](function(_0x4166c8){return _0x4166c8[_0xd2ef('0x5')]==='motion2';});if(_0x1e0114>-0x1){var _0x53e2a3=_0x36eb51[_0xd2ef('0x6')][_0x1e0114];if(typeof _0x53e2a3[_0xd2ef('0x7')][_0xd2ef('0x8')]!==_0xd2ef('0x9')){_0x53e2a3['env'][_0xd2ef('0x8')]=NODEPATH;_0x2f2859=!![];}}return{'appConfig':_0x36eb51,'updated':_0x2f2859};}}function updateAppConfig(_0x33b982){return fs[_0xd2ef('0xa')](APP_JSON_PATH)[_0xd2ef('0xb')](function(_0x136375){if(_0x136375){return fs[_0xd2ef('0xc')](APP_JSON_PATH)['then'](function(_0x5cba9f){var _0x3b877a=setLegacyLibsNodeEnvPath(_0x5cba9f);if(_0x3b877a[_0xd2ef('0xd')]){_0x33b982[_0xd2ef('0xe')](_0xd2ef('0xf'));return fs['writeJSON'](APP_JSON_PATH,_0x5cba9f,{'spaces':0x2});}else{return Promise[_0xd2ef('0x1')]();}});}else{return Promise[_0xd2ef('0x1')]();}});}module[_0xd2ef('0x10')]=updateAppConfig; \ No newline at end of file +var _0x6273=['legacy-libs','isArray','apps','name','motion2','env','string','NODE_PATH','pathExists','then','readJSON','updated','info','writeJSON','exports','path','resolve','server/app.json'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0x6273,0x177));var _0x3627=function(_0x40a2d5,_0x17091e){_0x40a2d5=_0x40a2d5-0x0;var _0x2410ee=_0x6273[_0x40a2d5];return _0x2410ee;};var fs=require('fs-extra');var path=require(_0x3627('0x0'));var config=require('../config/environment');var root=config['root'];var APP_JSON_PATH=path[_0x3627('0x1')](root,_0x3627('0x2'));var NODEPATH=path['resolve'](root,_0x3627('0x3'));function setLegacyLibsNodeEnvPath(_0x3a85b7){let _0xe88c75=![];if(Array[_0x3627('0x4')](_0x3a85b7[_0x3627('0x5')])){var _0x1c3263=_0x3a85b7['apps']['findIndex'](function(_0x128ffa){return _0x128ffa[_0x3627('0x6')]===_0x3627('0x7');});if(_0x1c3263>-0x1){var _0x1f8370=_0x3a85b7[_0x3627('0x5')][_0x1c3263];if(typeof _0x1f8370[_0x3627('0x8')]['NODE_PATH']!==_0x3627('0x9')){_0x1f8370[_0x3627('0x8')][_0x3627('0xa')]=NODEPATH;_0xe88c75=!![];}}return{'appConfig':_0x3a85b7,'updated':_0xe88c75};}}function updateAppConfig(_0x281efd){return fs[_0x3627('0xb')](APP_JSON_PATH)[_0x3627('0xc')](function(_0x280461){if(_0x280461){return fs[_0x3627('0xd')](APP_JSON_PATH)[_0x3627('0xc')](function(_0x12cf00){var _0x6d3993=setLegacyLibsNodeEnvPath(_0x12cf00);if(_0x6d3993[_0x3627('0xe')]){_0x281efd[_0x3627('0xf')]('Updating\x20app.json');return fs[_0x3627('0x10')](APP_JSON_PATH,_0x12cf00,{'spaces':0x2});}else{return Promise[_0x3627('0x1')]();}});}else{return Promise[_0x3627('0x1')]();}});}module[_0x3627('0x11')]=updateAppConfig; \ No newline at end of file